From 4d62c409f171557cd95f6e53ba9d30162209be5d Mon Sep 17 00:00:00 2001 From: support Date: Wed, 11 Jan 2023 06:47:39 +0000 Subject: [PATCH] Built motion from commit c1aa34a0.|2.6.28 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage.events.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- .../chatWebsite/helpers/wildcard-expressions.js | 2 +- server/api/chatWebsite/index.js | 2 +- server/api/client-side-logs.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.oauth.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../cmContactHasItem.attributes.js | 2 +- .../cmContactHasItem.controller.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.model.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +- server/api/cmContactHasItem/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../cmHopperAdditionalPhone.attributes.js | 2 +- .../cmHopperAdditionalPhone.controller.js | 2 +- .../cmHopperAdditionalPhone.model.js | 2 +- .../cmHopperAdditionalPhone.rpc.js | 2 +- server/api/cmHopperAdditionalPhone/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- .../contactItemType/contactItemType.attributes.js | 2 +- .../contactItemType/contactItemType.controller.js | 2 +- .../api/contactItemType/contactItemType.model.js | 2 +- server/api/contactItemType/contactItemType.rpc.js | 2 +- server/api/contactItemType/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailInteractionHasTag/index.js | 2 +- .../mailInteractionHasTag.controller.js | 2 +- .../mailInteractionHasTag/mailInteractionHasTag.js | 2 +- .../mailInteractionHasTag.model.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user-setting/index.js | 2 +- server/api/user-setting/user-setting.attributes.js | 2 +- server/api/user-setting/user-setting.controller.js | 2 +- server/api/user-setting/user-setting.events.js | 2 +- server/api/user-setting/user-setting.model.js | 2 +- server/api/user-setting/user-setting.socket.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/contacts/index.js | 2 +- server/components/contacts/sql-utils.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/import/cm/csvUpdates.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/interaction/sql-utils.js | 2 +- .../components/interaction/update-interaction.js | 2 +- server/components/interaction/utils.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/components/realtime/agents.js | 2 +- server/components/realtime/queues.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/api.js | 2 +- server/errors/index.js | 2 +- server/files/chat/iframe.ejs | 768 ++++++++++---------- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/events.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/project.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/models/action.js | 2 +- server/services/ami/dialer/models/agentComplete.js | 2 +- server/services/ami/dialer/models/final.js | 2 +- server/services/ami/dialer/models/hangup.js | 2 +- server/services/ami/dialer/models/history.js | 2 +- .../ami/dialer/models/queueCallerAbandon.js | 2 +- server/services/ami/dialer/utils/hopper.js | 2 +- server/services/ami/dialer/utils/index.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/voiceQueueSummary.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/realtime/utils.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/interval.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- server/utils/client-side-logger.js | 2 +- server/utils/iftime.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/misc.js | 2 +- server/utils/safe-template.js | 2 +- server/utils/update-app-config.js | 2 +- 1210 files changed, 1607 insertions(+), 1579 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 530d747..0f88d0d 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2023-01-10T13:06:36.497Z", + "time": "2023-01-11T06:38:34.765Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 40eaec8..18452d9 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2023-01-10T13:06:36.497Z", + "time": "2023-01-11T06:38:34.765Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 34dc741..d4aadc2 100644 --- a/server/api/action/action.attributes.js +++ b/server/api/action/action.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb235=['getDataValue','action','STRING','contactManager','integration','motionbar','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)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL'];(function(_0xfc98bf,_0x1efed4){var _0x295f51=function(_0x5e7cd5){while(--_0x5e7cd5){_0xfc98bf['push'](_0xfc98bf['shift']());}};_0x295f51(++_0x1efed4);}(_0xb235,0x6b));var _0x5b23=function(_0xbcea1,_0x469f9f){_0xbcea1=_0xbcea1-0x0;var _0x17fb47=_0xb235[_0xbcea1];return _0x17fb47;};'use strict';var Sequelize=require(_0x5b23('0x0'));module[_0x5b23('0x1')]={'name':{'type':Sequelize[_0x5b23('0x2')],'get':function(_0x3bf3dd){return this[_0x5b23('0x3')](_0x5b23('0x4'));}},'action':{'type':Sequelize[_0x5b23('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x5b23('0x6'),_0x5b23('0x7'),_0x5b23('0x8'),_0x5b23('0x9'),_0x5b23('0xa'),_0x5b23('0xb'),_0x5b23('0xc'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x5b23('0xd')},'data1':{'type':Sequelize[_0x5b23('0x5')](0x1000),'comment':_0x5b23('0xe')},'data2':{'type':Sequelize[_0x5b23('0x5')](0x1000),'comment':_0x5b23('0xf')},'data3':{'type':Sequelize[_0x5b23('0x5')](0x1000),'comment':_0x5b23('0x10')},'data4':{'type':Sequelize[_0x5b23('0x5')](0x1000),'comments':_0x5b23('0x11')},'data5':{'type':Sequelize[_0x5b23('0x5')](0x1000),'comments':_0x5b23('0x12')},'data6':{'type':Sequelize[_0x5b23('0x5')],'comments':_0x5b23('0x13')},'data7':{'type':Sequelize[_0x5b23('0x14')],'comments':_0x5b23('0x15')}}; \ No newline at end of file +var _0x3b8b=['urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty'];(function(_0x189b1d,_0x1df005){var _0x3d8ab0=function(_0x59a27f){while(--_0x59a27f){_0x189b1d['push'](_0x189b1d['shift']());}};_0x3d8ab0(++_0x1df005);}(_0x3b8b,0x146));var _0xb3b8=function(_0x40df5f,_0x8fd59f){_0x40df5f=_0x40df5f-0x0;var _0x1573f1=_0x3b8b[_0x40df5f];return _0x1573f1;};'use strict';var Sequelize=require(_0xb3b8('0x0'));module[_0xb3b8('0x1')]={'name':{'type':Sequelize[_0xb3b8('0x2')],'get':function(_0x47050d){return this[_0xb3b8('0x3')](_0xb3b8('0x4'));}},'action':{'type':Sequelize[_0xb3b8('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb3b8('0x6'),_0xb3b8('0x7'),_0xb3b8('0x8'),_0xb3b8('0x9'),_0xb3b8('0xa'),_0xb3b8('0xb'),'bot',_0xb3b8('0xc')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xb3b8('0xd')},'data1':{'type':Sequelize[_0xb3b8('0x5')](0x1000),'comment':_0xb3b8('0xe')},'data2':{'type':Sequelize[_0xb3b8('0x5')](0x1000),'comment':_0xb3b8('0xf')},'data3':{'type':Sequelize[_0xb3b8('0x5')](0x1000),'comment':_0xb3b8('0x10')},'data4':{'type':Sequelize[_0xb3b8('0x5')](0x1000),'comments':_0xb3b8('0x11')},'data5':{'type':Sequelize[_0xb3b8('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0xb3b8('0x12')},'data7':{'type':Sequelize[_0xb3b8('0x13')],'comments':_0xb3b8('0x14')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 0e84c8e..1474ce7 100644 --- a/server/api/action/action.controller.js +++ b/server/api/action/action.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc26=['apply','reject','then','destroy','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set'];(function(_0x5ad771,_0x34186f){var _0x5b5dce=function(_0x5ad0fb){while(--_0x5ad0fb){_0x5ad771['push'](_0x5ad771['shift']());}};_0x5b5dce(++_0x34186f);}(_0xcc26,0x67));var _0x6cc2=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xcc26[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x6cc2('0x0'));var rimraf=require(_0x6cc2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6cc2('0x2'));var rp=require(_0x6cc2('0x3'));var moment=require('moment');var BPromise=require(_0x6cc2('0x4'));var Mustache=require(_0x6cc2('0x5'));var util=require(_0x6cc2('0x6'));var path=require(_0x6cc2('0x7'));var sox=require(_0x6cc2('0x8'));var csv=require(_0x6cc2('0x9'));var ejs=require(_0x6cc2('0xa'));var fs=require('fs');var fs_extra=require(_0x6cc2('0xb'));var _=require('lodash');var squel=require(_0x6cc2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6cc2('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6cc2('0xe'));var authService=require(_0x6cc2('0xf'));var qs=require(_0x6cc2('0x10'));var as=require(_0x6cc2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6cc2('0x12'))(_0x6cc2('0x13'));var utils=require(_0x6cc2('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6cc2('0x15'));var db=require(_0x6cc2('0x16'))['db'];function respondWithStatusCode(_0x121393,_0x55ab5a){_0x55ab5a=_0x55ab5a||0xcc;return function(_0x43cbdb){if(_0x43cbdb){return _0x121393[_0x6cc2('0x17')](_0x55ab5a);}return _0x121393[_0x6cc2('0x18')](_0x55ab5a)[_0x6cc2('0x19')]();};}function respondWithResult(_0x5ec647,_0x5d0d0a){_0x5d0d0a=_0x5d0d0a||0xc8;return function(_0x4ef3b0){if(_0x4ef3b0){return _0x5ec647[_0x6cc2('0x18')](_0x5d0d0a)[_0x6cc2('0x1a')](_0x4ef3b0);}};}function respondWithFilteredResult(_0x55e2ca,_0x1e7c5c){return function(_0x519c57){if(_0x519c57){var _0x39ab53=typeof _0x1e7c5c['offset']===_0x6cc2('0x1b')&&typeof _0x1e7c5c[_0x6cc2('0x1c')]===_0x6cc2('0x1b');var _0x91c516=_0x519c57[_0x6cc2('0x1d')];var _0x38200b=_0x39ab53?0x0:_0x1e7c5c[_0x6cc2('0x1e')];var _0x3dfa64=_0x39ab53?_0x519c57['count']:_0x1e7c5c[_0x6cc2('0x1e')]+_0x1e7c5c[_0x6cc2('0x1c')];var _0x568880;if(_0x3dfa64>=_0x91c516){_0x3dfa64=_0x91c516;_0x568880=0xc8;}else{_0x568880=0xce;}_0x55e2ca['status'](_0x568880);return _0x55e2ca[_0x6cc2('0x1f')]('Content-Range',_0x38200b+'-'+_0x3dfa64+'/'+_0x91c516)[_0x6cc2('0x1a')](_0x519c57);}return null;};}function patchUpdates(_0x22d3a0){return function(_0x2a2c14){try{jsonpatch[_0x6cc2('0x20')](_0x2a2c14,_0x22d3a0,!![]);}catch(_0xf52a9f){return BPromise[_0x6cc2('0x21')](_0xf52a9f);}return _0x2a2c14['save']();};}function saveUpdates(_0x624dc5,_0x123d31){return function(_0x6f1115){if(_0x6f1115){return _0x6f1115['update'](_0x624dc5)[_0x6cc2('0x22')](function(_0x2c20cb){return _0x2c20cb;});}return null;};}function removeEntity(_0x5cc87e,_0x41591b){return function(_0x6a7de){if(_0x6a7de){return _0x6a7de[_0x6cc2('0x23')]()[_0x6cc2('0x22')](function(){_0x5cc87e[_0x6cc2('0x18')](0xcc)[_0x6cc2('0x19')]();});}};}function handleEntityNotFound(_0xa51e6c,_0x2b5c1b){return function(_0x1b7fa1){if(!_0x1b7fa1){_0xa51e6c[_0x6cc2('0x17')](0x194);}return _0x1b7fa1;};}function handleError(_0x4306b0,_0x5cc6f9){_0x5cc6f9=_0x5cc6f9||0x1f4;return function(_0x3dec54){logger[_0x6cc2('0x24')](_0x3dec54[_0x6cc2('0x25')]);if(_0x3dec54[_0x6cc2('0x26')]){delete _0x3dec54[_0x6cc2('0x26')];}_0x4306b0[_0x6cc2('0x18')](_0x5cc6f9)[_0x6cc2('0x27')](_0x3dec54);};}exports['update']=function(_0x3a3567,_0x52b85e){if(_0x3a3567[_0x6cc2('0x28')]['id']){delete _0x3a3567[_0x6cc2('0x28')]['id'];}return db[_0x6cc2('0x29')][_0x6cc2('0x2a')]({'where':{'id':_0x3a3567[_0x6cc2('0x2b')]['id']}})[_0x6cc2('0x22')](handleEntityNotFound(_0x52b85e,null))[_0x6cc2('0x22')](saveUpdates(_0x3a3567[_0x6cc2('0x28')],null))['then'](respondWithResult(_0x52b85e,null))[_0x6cc2('0x2c')](handleError(_0x52b85e,null));};exports['destroy']=function(_0x2115e0,_0x1ed81e){return db[_0x6cc2('0x29')][_0x6cc2('0x2a')]({'where':{'id':_0x2115e0[_0x6cc2('0x2b')]['id']}})[_0x6cc2('0x22')](handleEntityNotFound(_0x1ed81e,null))[_0x6cc2('0x22')](removeEntity(_0x1ed81e,null))[_0x6cc2('0x2c')](handleError(_0x1ed81e,null));}; \ No newline at end of file +var _0x100b=['destroy','eml-format','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','end','stack','name','send','body','Action','find','params','catch'];(function(_0x42aba4,_0x32aac1){var _0x3df2f6=function(_0x573672){while(--_0x573672){_0x42aba4['push'](_0x42aba4['shift']());}};_0x3df2f6(++_0x32aac1);}(_0x100b,0x171));var _0xb100=function(_0x2c2d7b,_0x10f5c3){_0x2c2d7b=_0x2c2d7b-0x0;var _0x5e56f3=_0x100b[_0x2c2d7b];return _0x5e56f3;};'use strict';var emlformat=require(_0xb100('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb100('0x1'));var moment=require(_0xb100('0x2'));var BPromise=require(_0xb100('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb100('0x4'));var sox=require(_0xb100('0x5'));var csv=require(_0xb100('0x6'));var ejs=require(_0xb100('0x7'));var fs=require('fs');var fs_extra=require(_0xb100('0x8'));var _=require(_0xb100('0x9'));var squel=require('squel');var crypto=require(_0xb100('0xa'));var jsforce=require(_0xb100('0xb'));var deskjs=require(_0xb100('0xc'));var toCsv=require(_0xb100('0x6'));var querystring=require(_0xb100('0xd'));var Papa=require(_0xb100('0xe'));var Redis=require(_0xb100('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb100('0x10'));var as=require(_0xb100('0x11'));var hardwareService=require(_0xb100('0x12'));var logger=require(_0xb100('0x13'))(_0xb100('0x14'));var utils=require(_0xb100('0x15'));var config=require(_0xb100('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb100('0x17'))['db'];function respondWithStatusCode(_0x559d15,_0x55b44e){_0x55b44e=_0x55b44e||0xcc;return function(_0x573602){if(_0x573602){return _0x559d15[_0xb100('0x18')](_0x55b44e);}return _0x559d15['status'](_0x55b44e)['end']();};}function respondWithResult(_0x4d58a1,_0x300c6a){_0x300c6a=_0x300c6a||0xc8;return function(_0x3c2460){if(_0x3c2460){return _0x4d58a1[_0xb100('0x19')](_0x300c6a)[_0xb100('0x1a')](_0x3c2460);}};}function respondWithFilteredResult(_0xbc59d7,_0x386f3a){return function(_0xe2374a){if(_0xe2374a){var _0x18a6a9=typeof _0x386f3a['offset']===_0xb100('0x1b')&&typeof _0x386f3a[_0xb100('0x1c')]===_0xb100('0x1b');var _0x320843=_0xe2374a[_0xb100('0x1d')];var _0x3ab46f=_0x18a6a9?0x0:_0x386f3a[_0xb100('0x1e')];var _0x3c89db=_0x18a6a9?_0xe2374a['count']:_0x386f3a[_0xb100('0x1e')]+_0x386f3a['limit'];var _0x33d9a8;if(_0x3c89db>=_0x320843){_0x3c89db=_0x320843;_0x33d9a8=0xc8;}else{_0x33d9a8=0xce;}_0xbc59d7[_0xb100('0x19')](_0x33d9a8);return _0xbc59d7[_0xb100('0x1f')](_0xb100('0x20'),_0x3ab46f+'-'+_0x3c89db+'/'+_0x320843)[_0xb100('0x1a')](_0xe2374a);}return null;};}function patchUpdates(_0x45c9ad){return function(_0x12028a){try{jsonpatch[_0xb100('0x21')](_0x12028a,_0x45c9ad,!![]);}catch(_0x6ef877){return BPromise[_0xb100('0x22')](_0x6ef877);}return _0x12028a['save']();};}function saveUpdates(_0x490b46,_0x4229fa){return function(_0x55ba39){if(_0x55ba39){return _0x55ba39['update'](_0x490b46)['then'](function(_0x37da67){return _0x37da67;});}return null;};}function removeEntity(_0x3d5ae3,_0x13905c){return function(_0x1b8df9){if(_0x1b8df9){return _0x1b8df9['destroy']()[_0xb100('0x23')](function(){_0x3d5ae3[_0xb100('0x19')](0xcc)[_0xb100('0x24')]();});}};}function handleEntityNotFound(_0x118f7a,_0x206fe8){return function(_0x5935c0){if(!_0x5935c0){_0x118f7a[_0xb100('0x18')](0x194);}return _0x5935c0;};}function handleError(_0x2f11b4,_0x3423e4){_0x3423e4=_0x3423e4||0x1f4;return function(_0x39350f){logger['error'](_0x39350f[_0xb100('0x25')]);if(_0x39350f[_0xb100('0x26')]){delete _0x39350f[_0xb100('0x26')];}_0x2f11b4[_0xb100('0x19')](_0x3423e4)[_0xb100('0x27')](_0x39350f);};}exports['update']=function(_0x108f8e,_0x53371a){if(_0x108f8e[_0xb100('0x28')]['id']){delete _0x108f8e[_0xb100('0x28')]['id'];}return db[_0xb100('0x29')][_0xb100('0x2a')]({'where':{'id':_0x108f8e[_0xb100('0x2b')]['id']}})[_0xb100('0x23')](handleEntityNotFound(_0x53371a,null))['then'](saveUpdates(_0x108f8e[_0xb100('0x28')],null))[_0xb100('0x23')](respondWithResult(_0x53371a,null))[_0xb100('0x2c')](handleError(_0x53371a,null));};exports[_0xb100('0x2d')]=function(_0x453723,_0x3fc1a1){return db['Action'][_0xb100('0x2a')]({'where':{'id':_0x453723[_0xb100('0x2b')]['id']}})[_0xb100('0x23')](handleEntityNotFound(_0x3fc1a1,null))['then'](removeEntity(_0x3fc1a1,null))[_0xb100('0x2c')](handleError(_0x3fc1a1,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 43015e4..44157d2 100644 --- a/server/api/action/action.model.js +++ b/server/api/action/action.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x99d8=['exports','define','Action','tools_actions','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./action.attributes'];(function(_0x171f7a,_0xdc733c){var _0x1e1659=function(_0x15907b){while(--_0x15907b){_0x171f7a['push'](_0x171f7a['shift']());}};_0x1e1659(++_0xdc733c);}(_0x99d8,0x13c));var _0x899d=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x99d8[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0x899d('0x0'));var util=require(_0x899d('0x1'));var logger=require(_0x899d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x899d('0x3'));var fs=require('fs');var path=require(_0x899d('0x4'));var rimraf=require(_0x899d('0x5'));var config=require(_0x899d('0x6'));var attributes=require(_0x899d('0x7'));module[_0x899d('0x8')]=function(_0x113ae0,_0x2ff459){return _0x113ae0[_0x899d('0x9')](_0x899d('0xa'),attributes,{'tableName':_0x899d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe1e0=['exports','Action','lodash','../../config/logger','moment','bluebird','path','rimraf','./action.attributes'];(function(_0x13f729,_0x2689d0){var _0x5d1288=function(_0xd85899){while(--_0xd85899){_0x13f729['push'](_0x13f729['shift']());}};_0x5d1288(++_0x2689d0);}(_0xe1e0,0x1b2));var _0x0e1e=function(_0x3f5dc0,_0x5eb345){_0x3f5dc0=_0x3f5dc0-0x0;var _0x1bdeed=_0xe1e0[_0x3f5dc0];return _0x1bdeed;};'use strict';var _=require(_0x0e1e('0x0'));var util=require('util');var logger=require(_0x0e1e('0x1'))('api');var moment=require(_0x0e1e('0x2'));var BPromise=require(_0x0e1e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e1e('0x4'));var rimraf=require(_0x0e1e('0x5'));var config=require('../../config/environment');var attributes=require(_0x0e1e('0x6'));module[_0x0e1e('0x7')]=function(_0x1133e3,_0x1812c2){return _0x1133e3['define'](_0x0e1e('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 442a0a1..a01ab6d 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x7217,0x19e));var _0x7721=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x7217[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x106b21,_0x22cefc){var _0x5b079f=function(_0x5b99aa){while(--_0x5b99aa){_0x106b21['push'](_0x106b21['shift']());}};_0x5b079f(++_0x22cefc);}(_0x5fab,0x177));var _0xb5fa=function(_0x2bb82d,_0x42c7f8){_0x2bb82d=_0x2bb82d-0x0;var _0x5e0b92=_0x5fab[_0x2bb82d];return _0x5e0b92;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 795a59f..b654ba6 100644 --- a/server/api/action/index.js +++ b/server/api/action/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb320=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0x3a9dd4,_0x5d439f){var _0x447ba3=function(_0x27c99c){while(--_0x27c99c){_0x3a9dd4['push'](_0x3a9dd4['shift']());}};_0x447ba3(++_0x5d439f);}(_0xb320,0x138));var _0x0b32=function(_0xdaab62,_0x2728ab){_0xdaab62=_0xdaab62-0x0;var _0x13d767=_0xb320[_0xdaab62];return _0x13d767;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0b32('0x0'));var timeout=require('connect-timeout');var express=require(_0x0b32('0x1'));var router=express['Router']();var fs_extra=require(_0x0b32('0x2'));var auth=require(_0x0b32('0x3'));var interaction=require(_0x0b32('0x4'));var config=require('../../config/environment');var controller=require(_0x0b32('0x5'));router[_0x0b32('0x6')](_0x0b32('0x7'),auth[_0x0b32('0x8')](),controller[_0x0b32('0x9')]);router[_0x0b32('0xa')](_0x0b32('0x7'),auth[_0x0b32('0x8')](),controller[_0x0b32('0xb')]);module[_0x0b32('0xc')]=router; \ No newline at end of file +var _0xe491=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x45b1a2,_0x5a25cb){var _0x10cbb0=function(_0x25e1bf){while(--_0x25e1bf){_0x45b1a2['push'](_0x45b1a2['shift']());}};_0x10cbb0(++_0x5a25cb);}(_0xe491,0xeb));var _0x1e49=function(_0x27a54a,_0x49939a){_0x27a54a=_0x27a54a-0x0;var _0x58e872=_0xe491[_0x27a54a];return _0x58e872;};'use strict';var multer=require(_0x1e49('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1e49('0x1'));var express=require(_0x1e49('0x2'));var router=express['Router']();var fs_extra=require(_0x1e49('0x3'));var auth=require(_0x1e49('0x4'));var interaction=require(_0x1e49('0x5'));var config=require(_0x1e49('0x6'));var controller=require('./action.controller');router[_0x1e49('0x7')](_0x1e49('0x8'),auth[_0x1e49('0x9')](),controller[_0x1e49('0xa')]);router[_0x1e49('0xb')]('/:id',auth[_0x1e49('0x9')](),controller[_0x1e49('0xc')]);module[_0x1e49('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 8038f36..138f182 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js +++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb138=['TEXT','sequelize','exports','STRING'];(function(_0x25dcd1,_0x3077cd){var _0x44310a=function(_0xdbea90){while(--_0xdbea90){_0x25dcd1['push'](_0x25dcd1['shift']());}};_0x44310a(++_0x3077cd);}(_0xb138,0x1dd));var _0x8b13=function(_0xb84c7f,_0x4ac90f){_0xb84c7f=_0xb84c7f-0x0;var _0x3e28f1=_0xb138[_0xb84c7f];return _0x3e28f1;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'name':{'type':Sequelize[_0x8b13('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8b13('0x2')]},'parent':{'type':Sequelize[_0x8b13('0x2')]},'table':{'type':Sequelize[_0x8b13('0x2')]},'conditions':{'type':Sequelize[_0x8b13('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0x5c1192,_0x524754){var _0x1750b2=function(_0x3a6dc3){while(--_0x3a6dc3){_0x5c1192['push'](_0x5c1192['shift']());}};_0x1750b2(++_0x524754);}(_0xeec6,0x1c2));var _0x6eec=function(_0x198446,_0x119c8f){_0x198446=_0x198446-0x0;var _0x38d7b7=_0xeec6[_0x198446];return _0x38d7b7;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 362a9cb..7b8f3f5 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.controller.js +++ b/server/api/analyticCustomReport/analyticCustomReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7db2=['body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','function','replace','format','groupBy','DESC','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','debug','Limited\x20Query:','QueryTypes','SELECT','MAX(%s)','AVG(%s)','DATE(%s)','keyBy','orderBy','%s.%s\x20=\x20%s.%s','web','fullPath','%s-%s.%s','randomstring','output','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','run','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','get','CustomReports','destroy','name','send','index','map','AnalyticCustomReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x20d204,_0x19e9e8){var _0xc898d=function(_0x5190f0){while(--_0x5190f0){_0x20d204['push'](_0x20d204['shift']());}};_0xc898d(++_0x19e9e8);}(_0x7db2,0xf6));var _0x27db=function(_0x301ad3,_0x3e9eb8){_0x301ad3=_0x301ad3-0x0;var _0x278765=_0x7db2[_0x301ad3];return _0x278765;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27db('0x0'));var zipdir=require(_0x27db('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x27db('0x2'));var moment=require(_0x27db('0x3'));var BPromise=require(_0x27db('0x4'));var Mustache=require(_0x27db('0x5'));var util=require(_0x27db('0x6'));var path=require(_0x27db('0x7'));var sox=require('sox');var csv=require(_0x27db('0x8'));var ejs=require(_0x27db('0x9'));var fs=require('fs');var fs_extra=require(_0x27db('0xa'));var _=require(_0x27db('0xb'));var squel=require(_0x27db('0xc'));var crypto=require(_0x27db('0xd'));var jsforce=require(_0x27db('0xe'));var deskjs=require(_0x27db('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x27db('0x10'));var Redis=require('ioredis');var authService=require(_0x27db('0x11'));var qs=require(_0x27db('0x12'));var as=require(_0x27db('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x27db('0x14'))('api');var utils=require(_0x27db('0x15'));var config=require(_0x27db('0x16'));var licenseUtil=require(_0x27db('0x17'));var db=require(_0x27db('0x18'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x4f70d2,_0xf3a3f1){_0xf3a3f1=_0xf3a3f1||0xcc;return function(_0x597adc){if(_0x597adc){return _0x4f70d2[_0x27db('0x19')](_0xf3a3f1);}return _0x4f70d2['status'](_0xf3a3f1)[_0x27db('0x1a')]();};}function respondWithResult(_0x22a54b,_0x439ddd){_0x439ddd=_0x439ddd||0xc8;return function(_0x4dba5f){if(_0x4dba5f){return _0x22a54b[_0x27db('0x1b')](_0x439ddd)[_0x27db('0x1c')](_0x4dba5f);}};}function respondWithFilteredResult(_0x20dad9,_0x2f4ac9){return function(_0x6c9342){if(_0x6c9342){var _0x3ecaf3=typeof _0x2f4ac9['offset']===_0x27db('0x1d')&&typeof _0x2f4ac9[_0x27db('0x1e')]===_0x27db('0x1d');var _0x11bdc4=_0x6c9342[_0x27db('0x1f')];var _0x19f026=_0x3ecaf3?0x0:_0x2f4ac9[_0x27db('0x20')];var _0xb3cbc4=_0x3ecaf3?_0x6c9342[_0x27db('0x1f')]:_0x2f4ac9['offset']+_0x2f4ac9[_0x27db('0x1e')];var _0x4ebb8e;if(_0xb3cbc4>=_0x11bdc4){_0xb3cbc4=_0x11bdc4;_0x4ebb8e=0xc8;}else{_0x4ebb8e=0xce;}_0x20dad9[_0x27db('0x1b')](_0x4ebb8e);return _0x20dad9[_0x27db('0x21')](_0x27db('0x22'),_0x19f026+'-'+_0xb3cbc4+'/'+_0x11bdc4)[_0x27db('0x1c')](_0x6c9342);}return null;};}function patchUpdates(_0x1677a5){return function(_0x33e50f){try{jsonpatch[_0x27db('0x23')](_0x33e50f,_0x1677a5,!![]);}catch(_0x2371cc){return BPromise['reject'](_0x2371cc);}return _0x33e50f[_0x27db('0x24')]();};}function saveUpdates(_0x5bff75,_0x1b8377){return function(_0x23aa92){if(_0x23aa92){return _0x23aa92['update'](_0x5bff75)[_0x27db('0x25')](function(_0x167e1a){return _0x167e1a;});}return null;};}function removeEntity(_0x304d0b,_0x3a6bb4){return function(_0xbbcfda){if(_0xbbcfda){return _0xbbcfda['destroy']()[_0x27db('0x25')](function(){var _0x5d2766=_0xbbcfda[_0x27db('0x26')]({'plain':!![]});var _0x5a6ce5=_0x27db('0x27');return db['UserProfileResource'][_0x27db('0x28')]({'where':{'type':_0x5a6ce5,'resourceId':_0x5d2766['id']}})[_0x27db('0x25')](function(){return _0xbbcfda;});})[_0x27db('0x25')](function(){_0x304d0b[_0x27db('0x1b')](0xcc)[_0x27db('0x1a')]();});}};}function handleEntityNotFound(_0x2898e3,_0x139306){return function(_0x2c0b27){if(!_0x2c0b27){_0x2898e3['sendStatus'](0x194);}return _0x2c0b27;};}function handleError(_0x1d5ebb,_0x1a99f4){_0x1a99f4=_0x1a99f4||0x1f4;return function(_0x17e817){logger['error'](_0x17e817['stack']);if(_0x17e817[_0x27db('0x29')]){delete _0x17e817['name'];}_0x1d5ebb[_0x27db('0x1b')](_0x1a99f4)[_0x27db('0x2a')](_0x17e817);};}exports[_0x27db('0x2b')]=function(_0x593660,_0x5608d0){var _0x2aea6a={},_0x57dbba={},_0xffd462={'count':0x0,'rows':[]};var _0x53c2a7=_[_0x27db('0x2c')](db[_0x27db('0x2d')]['rawAttributes'],function(_0x14827b){return{'name':_0x14827b[_0x27db('0x2e')],'type':_0x14827b[_0x27db('0x2f')][_0x27db('0x30')]};});_0x57dbba[_0x27db('0x31')]=_[_0x27db('0x2c')](_0x53c2a7,_0x27db('0x29'));_0x57dbba[_0x27db('0x32')]=_[_0x27db('0x33')](_0x593660['query']);_0x57dbba[_0x27db('0x34')]=_[_0x27db('0x35')](_0x57dbba['model'],_0x57dbba['query']);_0x2aea6a['attributes']=_[_0x27db('0x35')](_0x57dbba[_0x27db('0x31')],qs['fields'](_0x593660[_0x27db('0x32')][_0x27db('0x36')]));_0x2aea6a[_0x27db('0x37')]=_0x2aea6a[_0x27db('0x37')][_0x27db('0x38')]?_0x2aea6a[_0x27db('0x37')]:_0x57dbba[_0x27db('0x31')];if(!_0x593660[_0x27db('0x32')]['hasOwnProperty'](_0x27db('0x39'))){_0x2aea6a['limit']=qs['limit'](_0x593660[_0x27db('0x32')]['limit']);_0x2aea6a[_0x27db('0x20')]=qs[_0x27db('0x20')](_0x593660[_0x27db('0x32')][_0x27db('0x20')]);}_0x2aea6a[_0x27db('0x3a')]=qs[_0x27db('0x3b')](_0x593660[_0x27db('0x32')]['sort']);_0x2aea6a[_0x27db('0x3c')]=qs[_0x27db('0x34')](_[_0x27db('0x3d')](_0x593660[_0x27db('0x32')],_0x57dbba[_0x27db('0x34')]),_0x53c2a7);if(_0x593660[_0x27db('0x32')][_0x27db('0x3e')]){_0x2aea6a[_0x27db('0x3c')]=_[_0x27db('0x3f')](_0x2aea6a[_0x27db('0x3c')],{'$or':_[_0x27db('0x2c')](_0x53c2a7,function(_0x5e32e6){if(_0x5e32e6[_0x27db('0x2f')]!==_0x27db('0x40')){var _0x218caa={};_0x218caa[_0x5e32e6[_0x27db('0x29')]]={'$like':'%'+_0x593660[_0x27db('0x32')][_0x27db('0x3e')]+'%'};return _0x218caa;}})});}_0x2aea6a=_[_0x27db('0x3f')]({},_0x2aea6a,_0x593660[_0x27db('0x41')]);var _0x20807e={'where':_0x2aea6a[_0x27db('0x3c')]};return db[_0x27db('0x2d')][_0x27db('0x1f')](_0x20807e)['then'](function(_0x14161e){_0xffd462[_0x27db('0x1f')]=_0x14161e;if(_0x593660[_0x27db('0x32')][_0x27db('0x42')]){_0x2aea6a[_0x27db('0x43')]=[{'all':!![]}];}return db[_0x27db('0x2d')][_0x27db('0x44')](_0x2aea6a);})[_0x27db('0x25')](function(_0x553a1a){_0xffd462[_0x27db('0x45')]=_0x553a1a;return _0xffd462;})[_0x27db('0x25')](respondWithFilteredResult(_0x5608d0,_0x2aea6a))['catch'](handleError(_0x5608d0,null));};exports[_0x27db('0x46')]=function(_0x3e1b69,_0x2e17a0){var _0x41c15a={'raw':![],'where':{'id':_0x3e1b69[_0x27db('0x47')]['id']}},_0x33a967={};_0x33a967['model']=_[_0x27db('0x33')](db[_0x27db('0x2d')]['rawAttributes']);_0x33a967['query']=_[_0x27db('0x33')](_0x3e1b69[_0x27db('0x32')]);_0x33a967[_0x27db('0x34')]=_[_0x27db('0x35')](_0x33a967[_0x27db('0x31')],_0x33a967[_0x27db('0x32')]);_0x41c15a[_0x27db('0x37')]=_[_0x27db('0x35')](_0x33a967[_0x27db('0x31')],qs['fields'](_0x3e1b69[_0x27db('0x32')][_0x27db('0x36')]));_0x41c15a[_0x27db('0x37')]=_0x41c15a['attributes']['length']?_0x41c15a[_0x27db('0x37')]:_0x33a967[_0x27db('0x31')];if(_0x3e1b69[_0x27db('0x32')][_0x27db('0x42')]){_0x41c15a[_0x27db('0x43')]=[{'all':!![]}];}_0x41c15a=_['merge']({},_0x41c15a,_0x3e1b69[_0x27db('0x41')]);return db['AnalyticCustomReport']['find'](_0x41c15a)['then'](handleEntityNotFound(_0x2e17a0,null))[_0x27db('0x25')](respondWithResult(_0x2e17a0,null))[_0x27db('0x48')](handleError(_0x2e17a0,null));};exports[_0x27db('0x49')]=function(_0x5b4ebf,_0x1003c0){return db[_0x27db('0x2d')][_0x27db('0x49')](_0x5b4ebf['body'],{})[_0x27db('0x25')](function(_0x1ede38){var _0x2dc872=_0x5b4ebf[_0x27db('0x4a')][_0x27db('0x26')]({'plain':!![]});if(!_0x2dc872)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2dc872[_0x27db('0x4b')]===_0x27db('0x4a')){var _0x42f244=_0x1ede38[_0x27db('0x26')]({'plain':!![]});var _0x46480d=_0x27db('0x4c');return db[_0x27db('0x4d')][_0x27db('0x4e')]({'where':{'name':_0x46480d,'userProfileId':_0x2dc872[_0x27db('0x4f')]},'raw':!![]})['then'](function(_0xc164e4){if(_0xc164e4&&_0xc164e4[_0x27db('0x50')]===0x0){return db[_0x27db('0x51')][_0x27db('0x49')]({'name':_0x42f244['name'],'resourceId':_0x42f244['id'],'type':_0x27db('0x27'),'sectionId':_0xc164e4['id']},{})[_0x27db('0x25')](function(){return _0x1ede38;});}else{return _0x1ede38;}})[_0x27db('0x48')](function(_0x5b6778){logger['error'](_0x27db('0x52'),_0x5b6778);throw _0x5b6778;});}return _0x1ede38;})[_0x27db('0x25')](respondWithResult(_0x1003c0,0xc9))['catch'](handleError(_0x1003c0,null));};exports[_0x27db('0x53')]=function(_0x2bdf98,_0x20b632){if(_0x2bdf98[_0x27db('0x54')]['id']){delete _0x2bdf98[_0x27db('0x54')]['id'];}return db[_0x27db('0x2d')][_0x27db('0x4e')]({'where':{'id':_0x2bdf98[_0x27db('0x47')]['id']}})[_0x27db('0x25')](handleEntityNotFound(_0x20b632,null))[_0x27db('0x25')](saveUpdates(_0x2bdf98[_0x27db('0x54')],null))[_0x27db('0x25')](respondWithResult(_0x20b632,null))[_0x27db('0x48')](handleError(_0x20b632,null));};exports[_0x27db('0x28')]=function(_0x261c4d,_0x2ba99d){return db['AnalyticCustomReport'][_0x27db('0x4e')]({'where':{'id':_0x261c4d[_0x27db('0x47')]['id']}})[_0x27db('0x25')](handleEntityNotFound(_0x2ba99d,null))[_0x27db('0x25')](removeEntity(_0x2ba99d,null))['catch'](handleError(_0x2ba99d,null));};exports[_0x27db('0x55')]=function(_0x1bc3f6,_0x2b2ac9){var _0x36f502=0xa;var _0x32a1a0=[_0x27db('0x56'),_0x27db('0x57'),_0x27db('0x58'),_0x27db('0x59')];var _0x4dacbd={'SUM':_0x27db('0x5a'),'COUNT':_0x27db('0x5b'),'COUNT DISTINCT':_0x27db('0x5c'),'MAX':'MAX(%s)','MIN':_0x27db('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x27db('0x5e'),'GROUP_CONCAT ASC':_0x27db('0x5f'),'GROUP_CONCAT DESC':_0x27db('0x60')};var _0x4beb4c={'SEC_TO_TIME':_0x27db('0x61'),'DATE':'DATE(%s)','HOUR':_0x27db('0x62'),'ROUND':_0x27db('0x63'),'UNIX_TIMESTAMP':_0x27db('0x64')};var _0x4fea68=function(_0x466d50){return!_[_0x27db('0x65')]([_0x27db('0x66'),_0x27db('0x67'),_0x27db('0x68'),_0x27db('0x69')],_0x466d50);};var _0x542ab1=function(_0x13b0f2){if(!_0x13b0f2||!_0x13b0f2[_0x27db('0x6a')][_0x27db('0x38')]){return'';}for(var _0x5eea25='(',_0x5b9f79=0x0;_0x5b9f79<_0x13b0f2[_0x27db('0x6a')][_0x27db('0x38')];_0x5b9f79+=0x1){_0x5b9f79>0x0&&(_0x5eea25+='\x20'+_0x13b0f2[_0x27db('0x6b')]+'\x20');_0x5eea25+=_0x13b0f2['rules'][_0x5b9f79][_0x27db('0x6c')]?_0x542ab1(_0x13b0f2[_0x27db('0x6a')][_0x5b9f79][_0x27db('0x6c')]):_0x13b0f2['rules'][_0x5b9f79][_0x27db('0x6d')]+'\x20'+_0x13b0f2[_0x27db('0x6a')][_0x5b9f79][_0x27db('0x6e')]+(_0x4fea68(_0x13b0f2[_0x27db('0x6a')][_0x5b9f79][_0x27db('0x6e')])?'\x20'+_0x13b0f2['rules'][_0x5b9f79][_0x27db('0x6f')]:'');}return _0x5eea25+')';};var _0x19ac41={'where':{'id':_0x1bc3f6[_0x27db('0x47')]['id']}},_0x55f1ba,_0x432f07,_0x3e8bd2,_0x4b49f9,_0x4331d1;_0x19ac41=_[_0x27db('0x3f')]({},_0x19ac41,_0x1bc3f6[_0x27db('0x41')]);return db['AnalyticCustomReport'][_0x27db('0x4e')](_0x19ac41)[_0x27db('0x25')](function(_0x2fa1ee){if(_0x2fa1ee){_0x55f1ba=_0x2fa1ee;return _0x2fa1ee[_0x27db('0x70')]();}return null;})['then'](function(_0xd6fac3){if(_0xd6fac3){if(!_0xd6fac3[_0x27db('0x38')]){throw new db[(_0x27db('0x71'))][(_0x27db('0x72'))](_0x27db('0x73'),0x193);}_0x432f07=_0xd6fac3;return db[_0x27db('0x74')][_0x27db('0x44')]({'raw':!![]});}return null;})['then'](function(_0x56b560){if(_0x56b560){_0x3e8bd2=_['keyBy'](_0x56b560,'id');var _0x23b39e;var _0x4e343e=squel[_0x27db('0x75')]();_0x4e343e[_0x27db('0x76')](_0x55f1ba[_0x27db('0x77')]);for(var _0x5150d9=0x0;_0x5150d9<_0x432f07[_0x27db('0x38')];_0x5150d9+=0x1){_0x23b39e=_0x432f07[_0x5150d9][_0x27db('0x78')]?_0x3e8bd2[_0x432f07[_0x5150d9][_0x27db('0x78')]][_0x27db('0x79')]:_0x432f07[_0x5150d9][_0x27db('0x6d')];_0x23b39e=_0x432f07[_0x5150d9][_0x27db('0x7a')]?_[_0x27db('0x7b')](_0x4dacbd[_0x432f07[_0x5150d9]['function']],'%s',_0x23b39e):_0x23b39e;_0x23b39e=_0x432f07[_0x5150d9][_0x27db('0x7c')]?_[_0x27db('0x7b')](_0x4beb4c[_0x432f07[_0x5150d9]['format']],'%s',_0x23b39e):_0x23b39e;if(_0x432f07[_0x5150d9][_0x27db('0x7d')]){_0x4e343e[_0x27db('0x6c')](_0x23b39e);}_0x432f07[_0x5150d9]['orderBy']&&_0x4e343e['order'](_0x23b39e,_0x432f07[_0x5150d9]['orderBy']===_0x27db('0x7e')?![]:!![]);_0x4e343e[_0x27db('0x6d')](_0x23b39e,_0x432f07[_0x5150d9]['alias']||_0x23b39e);}if(_0x55f1ba['joins']){_0x55f1ba[_0x27db('0x7f')]=JSON[_0x27db('0x80')](_0x55f1ba[_0x27db('0x7f')]);for(var _0x765e98=0x0;_0x765e98<_0x55f1ba['joins'][_0x27db('0x38')];_0x765e98+=0x1){if(_0x55f1ba[_0x27db('0x7f')][_0x765e98]['type']&&_[_0x27db('0x65')](_0x32a1a0,_0x55f1ba[_0x27db('0x7f')][_0x765e98]['type'])&&_0x55f1ba[_0x27db('0x7f')][_0x765e98][_0x27db('0x81')]&&_0x55f1ba[_0x27db('0x7f')][_0x765e98]['foreignTable']&&_0x55f1ba[_0x27db('0x7f')][_0x765e98][_0x27db('0x82')]){_0x4e343e[_0x55f1ba['joins'][_0x765e98][_0x27db('0x2f')]](_0x55f1ba[_0x27db('0x7f')][_0x765e98][_0x27db('0x83')],null,util[_0x27db('0x7c')]('%s.%s\x20=\x20%s.%s',_0x55f1ba['table'],_0x55f1ba[_0x27db('0x7f')][_0x765e98]['parentKey'],_0x55f1ba[_0x27db('0x7f')][_0x765e98][_0x27db('0x83')],_0x55f1ba[_0x27db('0x7f')][_0x765e98][_0x27db('0x82')]));}}}if(_0x55f1ba[_0x27db('0x84')]){_0x55f1ba[_0x27db('0x84')]=JSON['parse'](_0x55f1ba[_0x27db('0x84')]);_0x4e343e[_0x27db('0x3c')](_0x542ab1(_0x55f1ba[_0x27db('0x84')][_0x27db('0x6c')]));}_0x4331d1=_0x4e343e[_0x27db('0x85')]();_0x4e343e[_0x27db('0x1e')](_0x36f502);_0x4e343e[_0x27db('0x20')](0x0);logger[_0x27db('0x86')](_0x27db('0x87'),_0x4e343e['toString']());return dbH['sequelize'][_0x27db('0x32')](_0x4e343e['toString'](),{'type':dbH['sequelize'][_0x27db('0x88')][_0x27db('0x89')]});}})['then'](respondWithResult(_0x2b2ac9,null))['catch'](handleError(_0x2b2ac9,null));};function runReport(_0x4ae0c4,_0x263238,_0x52ec26){var _0x42fc8e=_0x263238[_0x27db('0x29')];var _0x7b950d=0xa;var _0x2b63d9=['join','left_join',_0x27db('0x58'),'cross_join'];var _0x50aaa1={'SUM':'SUM(%s)','COUNT':_0x27db('0x5b'),'COUNT DISTINCT':_0x27db('0x5c'),'MAX':_0x27db('0x8a'),'MIN':_0x27db('0x5d'),'AVG':_0x27db('0x8b'),'GROUP_CONCAT':_0x27db('0x5e'),'GROUP_CONCAT ASC':_0x27db('0x5f'),'GROUP_CONCAT DESC':_0x27db('0x60')};var _0x5bb87a={'SEC_TO_TIME':_0x27db('0x61'),'DATE':_0x27db('0x8c'),'HOUR':_0x27db('0x62'),'ROUND':_0x27db('0x63'),'UNIX_TIMESTAMP':_0x27db('0x64')};var _0x4785e0=function(_0x12b57c){return!_[_0x27db('0x65')](['IS\x20NULL',_0x27db('0x67'),_0x27db('0x68'),_0x27db('0x69')],_0x12b57c);};var _0x436477=function(_0x1568a9){if(!_0x1568a9||!_0x1568a9['rules'][_0x27db('0x38')]){return'';}for(var _0x24caf7='(',_0x50ebfc=0x0;_0x50ebfc<_0x1568a9[_0x27db('0x6a')][_0x27db('0x38')];_0x50ebfc+=0x1){_0x50ebfc>0x0&&(_0x24caf7+='\x20'+_0x1568a9[_0x27db('0x6b')]+'\x20');_0x24caf7+=_0x1568a9[_0x27db('0x6a')][_0x50ebfc][_0x27db('0x6c')]?_0x436477(_0x1568a9[_0x27db('0x6a')][_0x50ebfc][_0x27db('0x6c')]):_0x1568a9[_0x27db('0x6a')][_0x50ebfc][_0x27db('0x6d')]+'\x20'+_0x1568a9[_0x27db('0x6a')][_0x50ebfc][_0x27db('0x6e')]+(_0x4785e0(_0x1568a9[_0x27db('0x6a')][_0x50ebfc]['condition'])?'\x20'+_0x1568a9['rules'][_0x50ebfc][_0x27db('0x6f')]:'');}return _0x24caf7+')';};var _0x383c0a={'where':{'id':_0x4ae0c4['id']}},_0x50b376,_0x5b72f3,_0x55bb1c,_0x37b4dd,_0x1b07a9;_0x383c0a=_[_0x27db('0x3f')]({},_0x383c0a,_0x52ec26);return db[_0x27db('0x2d')][_0x27db('0x4e')](_0x383c0a)['then'](function(_0x1f09c8){if(_0x1f09c8){_0x50b376=_0x1f09c8;return _0x1f09c8[_0x27db('0x70')]();}return null;})[_0x27db('0x25')](function(_0x219269){if(_0x219269){if(!_0x219269[_0x27db('0x38')]){throw new db[(_0x27db('0x71'))][(_0x27db('0x72'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5b72f3=_0x219269;return db[_0x27db('0x74')][_0x27db('0x44')]({'raw':!![]});}return null;})[_0x27db('0x25')](function(_0x9e927e){if(_0x9e927e){_0x55bb1c=_[_0x27db('0x8d')](_0x9e927e,'id');var _0x313cf3;var _0x57ad5a=squel['select']();_0x57ad5a[_0x27db('0x76')](_0x50b376[_0x27db('0x77')]);for(var _0x159b28=0x0;_0x159b28<_0x5b72f3[_0x27db('0x38')];_0x159b28+=0x1){_0x313cf3=_0x5b72f3[_0x159b28][_0x27db('0x78')]?_0x55bb1c[_0x5b72f3[_0x159b28][_0x27db('0x78')]]['metric']:_0x5b72f3[_0x159b28][_0x27db('0x6d')];_0x313cf3=_0x5b72f3[_0x159b28][_0x27db('0x7a')]?_[_0x27db('0x7b')](_0x50aaa1[_0x5b72f3[_0x159b28]['function']],'%s',_0x313cf3):_0x313cf3;_0x313cf3=_0x5b72f3[_0x159b28][_0x27db('0x7c')]?_[_0x27db('0x7b')](_0x5bb87a[_0x5b72f3[_0x159b28][_0x27db('0x7c')]],'%s',_0x313cf3):_0x313cf3;if(_0x5b72f3[_0x159b28][_0x27db('0x7d')]){_0x57ad5a[_0x27db('0x6c')](_0x313cf3);}_0x5b72f3[_0x159b28][_0x27db('0x8e')]&&_0x57ad5a[_0x27db('0x3a')](_0x313cf3,_0x5b72f3[_0x159b28][_0x27db('0x8e')]===_0x27db('0x7e')?![]:!![]);_0x57ad5a[_0x27db('0x6d')](_0x313cf3,_0x5b72f3[_0x159b28]['alias']||_0x313cf3);}if(_0x50b376[_0x27db('0x7f')]){_0x50b376['joins']=JSON[_0x27db('0x80')](_0x50b376[_0x27db('0x7f')]);for(var _0x2929a8=0x0;_0x2929a8<_0x50b376[_0x27db('0x7f')][_0x27db('0x38')];_0x2929a8+=0x1){if(_0x50b376['joins'][_0x2929a8]['type']&&_[_0x27db('0x65')](_0x2b63d9,_0x50b376[_0x27db('0x7f')][_0x2929a8][_0x27db('0x2f')])&&_0x50b376[_0x27db('0x7f')][_0x2929a8][_0x27db('0x81')]&&_0x50b376[_0x27db('0x7f')][_0x2929a8][_0x27db('0x83')]&&_0x50b376['joins'][_0x2929a8][_0x27db('0x82')]){_0x57ad5a[_0x50b376[_0x27db('0x7f')][_0x2929a8][_0x27db('0x2f')]](_0x50b376['joins'][_0x2929a8][_0x27db('0x83')],null,util[_0x27db('0x7c')](_0x27db('0x8f'),_0x50b376[_0x27db('0x77')],_0x50b376[_0x27db('0x7f')][_0x2929a8][_0x27db('0x81')],_0x50b376[_0x27db('0x7f')][_0x2929a8][_0x27db('0x83')],_0x50b376[_0x27db('0x7f')][_0x2929a8]['foreignKey']));}}}if(_0x50b376[_0x27db('0x84')]){_0x50b376[_0x27db('0x84')]=JSON[_0x27db('0x80')](_0x50b376[_0x27db('0x84')]);_0x57ad5a[_0x27db('0x3c')](_0x436477(_0x50b376[_0x27db('0x84')][_0x27db('0x6c')]));}_0x1b07a9=_0x57ad5a[_0x27db('0x85')]();_0x57ad5a['limit'](_0x7b950d);_0x57ad5a[_0x27db('0x20')](0x0);return;}})[_0x27db('0x25')](function(){if(_0x263238['output']===_0x27db('0x90')){return null;}var _0x5c0854=_['merge'](_0x263238,{'name':_0x263238[_0x27db('0x91')]||_0x263238[_0x27db('0x29')]||_0x50b376[_0x27db('0x29')],'basename':_0x42fc8e,'savename':util[_0x27db('0x7c')](_0x27db('0x92'),_0x263238[_0x27db('0x29')]||_0x50b376[_0x27db('0x29')],require(_0x27db('0x93'))['generate'](0x4),_0x263238[_0x27db('0x94')]||'csv'),'reportId':_0x50b376['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0x27db('0x49')](_0x5c0854,{'raw':!![]});})[_0x27db('0x25')](function(_0x574f50){if(_0x50b376[_0x27db('0x77')]===_0x27db('0x95')){_0x1b07a9['where'](_0x50b376[_0x27db('0x77')]+_0x27db('0x96'),_0x263238[_0x27db('0x97')],_0x263238[_0x27db('0x98')]);}else{_0x1b07a9['where'](_0x50b376[_0x27db('0x77')]+_0x27db('0x99'),_0x263238[_0x27db('0x97')],_0x263238[_0x27db('0x98')]);}if(_0x574f50){logger[_0x27db('0x9a')]('Run\x20Query:',_0x1b07a9[_0x27db('0x9b')]());require(_0x27db('0x9c'))[_0x27db('0x9d')](path[_0x27db('0x56')](__dirname,_0x27db('0x9e'),_0x574f50['output']),[_0x574f50['id'],_0x1b07a9[_0x27db('0x9b')](),path[_0x27db('0x56')](__dirname,_0x27db('0x9f'),_0x574f50[_0x27db('0xa0')]),_0x42fc8e]);return _0x574f50;}else{var _0x1a5bb2=squel[_0x27db('0x75')]();_0x1a5bb2[_0x27db('0x76')]('('+_0x1b07a9['toString']()+')',_0x27db('0xa1'));_0x1a5bb2['field'](_0x27db('0xa2'),_0x27db('0x1f'));_0x1b07a9['limit'](_0x263238[_0x27db('0x1e')]||_0x7b950d);_0x1b07a9['offset'](_0x263238[_0x27db('0x20')]||0x0);return dbH[_0x27db('0xa3')][_0x27db('0x32')](_0x1a5bb2[_0x27db('0x9b')](),{'type':dbH[_0x27db('0xa3')][_0x27db('0x88')][_0x27db('0x89')]})[_0x27db('0x25')](function(_0xbd556c){if(!_0xbd556c[_0x27db('0x38')]){_0x37b4dd=0x0;}else{_0x37b4dd=_0xbd556c[0x0][_0x27db('0x1f')]||0x0;}return dbH[_0x27db('0xa3')][_0x27db('0x32')](_0x1b07a9[_0x27db('0x9b')](),{'type':dbH[_0x27db('0xa3')]['QueryTypes'][_0x27db('0x89')]});})['then'](function(_0x2d72c3){return{'rows':_0x2d72c3||[],'count':_0x37b4dd};});}});}exports[_0x27db('0xa4')]=function(_0x1df95c,_0x93548b){return runReport(_0x1df95c[_0x27db('0x47')],_0x1df95c[_0x27db('0x32')],_0x1df95c['options'])[_0x27db('0x25')](respondWithResult(_0x93548b,null))['catch'](handleError(_0x93548b,null));};exports['runReport']=runReport;exports['query']=function(_0x2f5184,_0x318c9a){var _0x312e35=0xa;var _0x2447c2=[_0x27db('0x56'),_0x27db('0x57'),'right_join','cross_join'];var _0x54f2fe={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x27db('0x5c'),'MAX':_0x27db('0x8a'),'MIN':'MIN(%s)','AVG':_0x27db('0x8b'),'GROUP_CONCAT':_0x27db('0x5e'),'GROUP_CONCAT ASC':_0x27db('0x5f'),'GROUP_CONCAT DESC':_0x27db('0x60')};var _0x4269de={'SEC_TO_TIME':_0x27db('0x61'),'DATE':_0x27db('0x8c'),'HOUR':_0x27db('0x62'),'ROUND':_0x27db('0x63'),'UNIX_TIMESTAMP':_0x27db('0x64')};var _0x3623ae=function(_0x58d723){return!_['includes'](['IS\x20NULL',_0x27db('0x67'),_0x27db('0x68'),_0x27db('0x69')],_0x58d723);};var _0x5853d2=function(_0x49dddb){if(!_0x49dddb||!_0x49dddb['rules'][_0x27db('0x38')]){return'';}for(var _0x1160b8='(',_0x193afe=0x0;_0x193afe<_0x49dddb[_0x27db('0x6a')][_0x27db('0x38')];_0x193afe+=0x1){_0x193afe>0x0&&(_0x1160b8+='\x20'+_0x49dddb[_0x27db('0x6b')]+'\x20');_0x1160b8+=_0x49dddb['rules'][_0x193afe][_0x27db('0x6c')]?_0x5853d2(_0x49dddb[_0x27db('0x6a')][_0x193afe]['group']):_0x49dddb[_0x27db('0x6a')][_0x193afe]['field']+'\x20'+_0x49dddb[_0x27db('0x6a')][_0x193afe][_0x27db('0x6e')]+(_0x3623ae(_0x49dddb['rules'][_0x193afe][_0x27db('0x6e')])?'\x20'+_0x49dddb[_0x27db('0x6a')][_0x193afe][_0x27db('0x6f')]:'');}return _0x1160b8+')';};var _0x1c9ee8={'where':{'id':_0x2f5184[_0x27db('0x47')]['id']}},_0x48112c,_0x29f136,_0x5a652f,_0x3db6d4,_0x4677f7;_0x1c9ee8=_[_0x27db('0x3f')]({},_0x1c9ee8,_0x2f5184[_0x27db('0x41')]);return db[_0x27db('0x2d')][_0x27db('0x4e')](_0x1c9ee8)[_0x27db('0x25')](function(_0x11fd2e){if(_0x11fd2e){_0x48112c=_0x11fd2e;return _0x11fd2e['getFields']();}return null;})['then'](function(_0x123611){if(_0x123611){if(!_0x123611['length']){throw new db['Sequelize'][(_0x27db('0x72'))](_0x27db('0x73'),0x193);}_0x29f136=_0x123611;return db[_0x27db('0x74')][_0x27db('0x44')]({'raw':!![]});}return null;})[_0x27db('0x25')](function(_0x208239){if(_0x208239){_0x5a652f=_[_0x27db('0x8d')](_0x208239,'id');var _0x43cf83;var _0x52cbd6=squel[_0x27db('0x75')]();_0x52cbd6[_0x27db('0x76')](_0x48112c[_0x27db('0x77')]);for(var _0x2f5611=0x0;_0x2f5611<_0x29f136[_0x27db('0x38')];_0x2f5611+=0x1){_0x43cf83=_0x29f136[_0x2f5611][_0x27db('0x78')]?_0x5a652f[_0x29f136[_0x2f5611][_0x27db('0x78')]][_0x27db('0x79')]:_0x29f136[_0x2f5611]['field'];_0x43cf83=_0x29f136[_0x2f5611][_0x27db('0x7a')]?_[_0x27db('0x7b')](_0x54f2fe[_0x29f136[_0x2f5611]['function']],'%s',_0x43cf83):_0x43cf83;_0x43cf83=_0x29f136[_0x2f5611][_0x27db('0x7c')]?_[_0x27db('0x7b')](_0x4269de[_0x29f136[_0x2f5611]['format']],'%s',_0x43cf83):_0x43cf83;if(_0x29f136[_0x2f5611][_0x27db('0x7d')]){_0x52cbd6[_0x27db('0x6c')](_0x43cf83);}_0x29f136[_0x2f5611][_0x27db('0x8e')]&&_0x52cbd6[_0x27db('0x3a')](_0x43cf83,_0x29f136[_0x2f5611][_0x27db('0x8e')]===_0x27db('0x7e')?![]:!![]);_0x52cbd6[_0x27db('0x6d')](_0x43cf83,_0x29f136[_0x2f5611]['alias']||_0x43cf83);}if(_0x48112c['joins']){_0x48112c[_0x27db('0x7f')]=JSON['parse'](_0x48112c[_0x27db('0x7f')]);for(var _0xf468b2=0x0;_0xf468b2<_0x48112c['joins'][_0x27db('0x38')];_0xf468b2+=0x1){if(_0x48112c[_0x27db('0x7f')][_0xf468b2][_0x27db('0x2f')]&&_['includes'](_0x2447c2,_0x48112c[_0x27db('0x7f')][_0xf468b2][_0x27db('0x2f')])&&_0x48112c['joins'][_0xf468b2][_0x27db('0x81')]&&_0x48112c['joins'][_0xf468b2][_0x27db('0x83')]&&_0x48112c[_0x27db('0x7f')][_0xf468b2][_0x27db('0x82')]){_0x52cbd6[_0x48112c[_0x27db('0x7f')][_0xf468b2][_0x27db('0x2f')]](_0x48112c[_0x27db('0x7f')][_0xf468b2][_0x27db('0x83')],null,util[_0x27db('0x7c')]('%s.%s\x20=\x20%s.%s',_0x48112c['table'],_0x48112c[_0x27db('0x7f')][_0xf468b2][_0x27db('0x81')],_0x48112c[_0x27db('0x7f')][_0xf468b2][_0x27db('0x83')],_0x48112c['joins'][_0xf468b2][_0x27db('0x82')]));}}}if(_0x48112c[_0x27db('0x84')]){_0x48112c[_0x27db('0x84')]=JSON['parse'](_0x48112c[_0x27db('0x84')]);_0x52cbd6['where'](_0x5853d2(_0x48112c['conditions']['group']));}_0x4677f7=_0x52cbd6[_0x27db('0x85')]();_0x52cbd6['limit'](_0x312e35);_0x52cbd6[_0x27db('0x20')](0x0);logger[_0x27db('0x86')](_0x27db('0x87'),_0x52cbd6[_0x27db('0x9b')]());return dbH[_0x27db('0xa3')][_0x27db('0x32')](_0x52cbd6[_0x27db('0x9b')](),{'type':dbH['sequelize']['QueryTypes'][_0x27db('0x89')]});}})[_0x27db('0x25')](function(){return{'sql':_0x4677f7['toString']()};})[_0x27db('0x25')](respondWithResult(_0x318c9a,null))[_0x27db('0x48')](handleError(_0x318c9a,null));}; \ No newline at end of file +var _0xb7dc=['squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','get','CustomReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','filters','length','find','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20NULL','getFields','keyBy','groupBy','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','cdr','startDate','endDate','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','SELECT','run','runReport','right_join','AnalyticMetric','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','fs-extra','lodash'];(function(_0x2e0137,_0x452292){var _0x26c7e4=function(_0x39c871){while(--_0x39c871){_0x2e0137['push'](_0x2e0137['shift']());}};_0x26c7e4(++_0x452292);}(_0xb7dc,0x9b));var _0xcb7d=function(_0x5e4d21,_0x403c67){_0x5e4d21=_0x5e4d21-0x0;var _0xf19fc6=_0xb7dc[_0x5e4d21];return _0xf19fc6;};'use strict';var emlformat=require(_0xcb7d('0x0'));var rimraf=require(_0xcb7d('0x1'));var zipdir=require(_0xcb7d('0x2'));var jsonpatch=require(_0xcb7d('0x3'));var rp=require(_0xcb7d('0x4'));var moment=require(_0xcb7d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcb7d('0x6'));var util=require('util');var path=require('path');var sox=require(_0xcb7d('0x7'));var csv=require('to-csv');var ejs=require(_0xcb7d('0x8'));var fs=require('fs');var fs_extra=require(_0xcb7d('0x9'));var _=require(_0xcb7d('0xa'));var squel=require(_0xcb7d('0xb'));var crypto=require(_0xcb7d('0xc'));var jsforce=require(_0xcb7d('0xd'));var deskjs=require(_0xcb7d('0xe'));var toCsv=require(_0xcb7d('0xf'));var querystring=require(_0xcb7d('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcb7d('0x11'));var qs=require(_0xcb7d('0x12'));var as=require(_0xcb7d('0x13'));var hardwareService=require(_0xcb7d('0x14'));var logger=require('../../config/logger')(_0xcb7d('0x15'));var utils=require(_0xcb7d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcb7d('0x17'));var db=require(_0xcb7d('0x18'))['db'];var dbH=require(_0xcb7d('0x18'))[_0xcb7d('0x19')];function respondWithStatusCode(_0x408dac,_0x281c0a){_0x281c0a=_0x281c0a||0xcc;return function(_0x1c0c9c){if(_0x1c0c9c){return _0x408dac[_0xcb7d('0x1a')](_0x281c0a);}return _0x408dac[_0xcb7d('0x1b')](_0x281c0a)[_0xcb7d('0x1c')]();};}function respondWithResult(_0x249ba6,_0x118d46){_0x118d46=_0x118d46||0xc8;return function(_0x44b12d){if(_0x44b12d){return _0x249ba6[_0xcb7d('0x1b')](_0x118d46)[_0xcb7d('0x1d')](_0x44b12d);}};}function respondWithFilteredResult(_0x473dc7,_0x13e228){return function(_0x589cf6){if(_0x589cf6){var _0x1a1188=typeof _0x13e228[_0xcb7d('0x1e')]===_0xcb7d('0x1f')&&typeof _0x13e228[_0xcb7d('0x20')]===_0xcb7d('0x1f');var _0x49ac57=_0x589cf6['count'];var _0x4aba01=_0x1a1188?0x0:_0x13e228[_0xcb7d('0x1e')];var _0x3f3ab5=_0x1a1188?_0x589cf6['count']:_0x13e228[_0xcb7d('0x1e')]+_0x13e228[_0xcb7d('0x20')];var _0x221da7;if(_0x3f3ab5>=_0x49ac57){_0x3f3ab5=_0x49ac57;_0x221da7=0xc8;}else{_0x221da7=0xce;}_0x473dc7[_0xcb7d('0x1b')](_0x221da7);return _0x473dc7[_0xcb7d('0x21')](_0xcb7d('0x22'),_0x4aba01+'-'+_0x3f3ab5+'/'+_0x49ac57)['json'](_0x589cf6);}return null;};}function patchUpdates(_0x2f0ec8){return function(_0x19f049){try{jsonpatch[_0xcb7d('0x23')](_0x19f049,_0x2f0ec8,!![]);}catch(_0x1906e5){return BPromise['reject'](_0x1906e5);}return _0x19f049[_0xcb7d('0x24')]();};}function saveUpdates(_0x1a3437,_0x54ecca){return function(_0xbce2f2){if(_0xbce2f2){return _0xbce2f2[_0xcb7d('0x25')](_0x1a3437)[_0xcb7d('0x26')](function(_0x585763){return _0x585763;});}return null;};}function removeEntity(_0x3ec64a,_0x536252){return function(_0x4903f0){if(_0x4903f0){return _0x4903f0['destroy']()['then'](function(){var _0x50309b=_0x4903f0[_0xcb7d('0x27')]({'plain':!![]});var _0x15575f=_0xcb7d('0x28');return db[_0xcb7d('0x29')][_0xcb7d('0x2a')]({'where':{'type':_0x15575f,'resourceId':_0x50309b['id']}})[_0xcb7d('0x26')](function(){return _0x4903f0;});})[_0xcb7d('0x26')](function(){_0x3ec64a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x342ffe,_0x610c3b){return function(_0x190630){if(!_0x190630){_0x342ffe[_0xcb7d('0x1a')](0x194);}return _0x190630;};}function handleError(_0x1a7ab6,_0x2e85e1){_0x2e85e1=_0x2e85e1||0x1f4;return function(_0x30d972){logger[_0xcb7d('0x2b')](_0x30d972[_0xcb7d('0x2c')]);if(_0x30d972[_0xcb7d('0x2d')]){delete _0x30d972[_0xcb7d('0x2d')];}_0x1a7ab6[_0xcb7d('0x1b')](_0x2e85e1)[_0xcb7d('0x2e')](_0x30d972);};}exports[_0xcb7d('0x2f')]=function(_0x67db8b,_0x4dca72){var _0x3a0ee1={},_0x65ebf8={},_0x551b13={'count':0x0,'rows':[]};var _0x348c85=_[_0xcb7d('0x30')](db[_0xcb7d('0x31')][_0xcb7d('0x32')],function(_0x1a29d5){return{'name':_0x1a29d5['fieldName'],'type':_0x1a29d5['type']['key']};});_0x65ebf8[_0xcb7d('0x33')]=_[_0xcb7d('0x30')](_0x348c85,_0xcb7d('0x2d'));_0x65ebf8[_0xcb7d('0x34')]=_[_0xcb7d('0x35')](_0x67db8b[_0xcb7d('0x34')]);_0x65ebf8['filters']=_[_0xcb7d('0x36')](_0x65ebf8['model'],_0x65ebf8[_0xcb7d('0x34')]);_0x3a0ee1[_0xcb7d('0x37')]=_[_0xcb7d('0x36')](_0x65ebf8[_0xcb7d('0x33')],qs[_0xcb7d('0x38')](_0x67db8b[_0xcb7d('0x34')][_0xcb7d('0x38')]));_0x3a0ee1[_0xcb7d('0x37')]=_0x3a0ee1['attributes']['length']?_0x3a0ee1['attributes']:_0x65ebf8[_0xcb7d('0x33')];if(!_0x67db8b[_0xcb7d('0x34')][_0xcb7d('0x39')]('nolimit')){_0x3a0ee1[_0xcb7d('0x20')]=qs[_0xcb7d('0x20')](_0x67db8b['query'][_0xcb7d('0x20')]);_0x3a0ee1[_0xcb7d('0x1e')]=qs[_0xcb7d('0x1e')](_0x67db8b[_0xcb7d('0x34')][_0xcb7d('0x1e')]);}_0x3a0ee1[_0xcb7d('0x3a')]=qs['sort'](_0x67db8b[_0xcb7d('0x34')]['sort']);_0x3a0ee1[_0xcb7d('0x3b')]=qs['filters'](_[_0xcb7d('0x3c')](_0x67db8b[_0xcb7d('0x34')],_0x65ebf8['filters']),_0x348c85);if(_0x67db8b[_0xcb7d('0x34')][_0xcb7d('0x3d')]){_0x3a0ee1[_0xcb7d('0x3b')]=_[_0xcb7d('0x3e')](_0x3a0ee1[_0xcb7d('0x3b')],{'$or':_['map'](_0x348c85,function(_0x3f4740){if(_0x3f4740[_0xcb7d('0x3f')]!==_0xcb7d('0x40')){var _0xbd5481={};_0xbd5481[_0x3f4740[_0xcb7d('0x2d')]]={'$like':'%'+_0x67db8b['query'][_0xcb7d('0x3d')]+'%'};return _0xbd5481;}})});}_0x3a0ee1=_[_0xcb7d('0x3e')]({},_0x3a0ee1,_0x67db8b[_0xcb7d('0x41')]);var _0x1d968d={'where':_0x3a0ee1['where']};return db[_0xcb7d('0x31')]['count'](_0x1d968d)[_0xcb7d('0x26')](function(_0x7facf0){_0x551b13[_0xcb7d('0x42')]=_0x7facf0;if(_0x67db8b[_0xcb7d('0x34')][_0xcb7d('0x43')]){_0x3a0ee1[_0xcb7d('0x44')]=[{'all':!![]}];}return db[_0xcb7d('0x31')][_0xcb7d('0x45')](_0x3a0ee1);})['then'](function(_0xbcea30){_0x551b13[_0xcb7d('0x46')]=_0xbcea30;return _0x551b13;})[_0xcb7d('0x26')](respondWithFilteredResult(_0x4dca72,_0x3a0ee1))[_0xcb7d('0x47')](handleError(_0x4dca72,null));};exports['show']=function(_0x57242a,_0x221f8b){var _0x29f638={'raw':![],'where':{'id':_0x57242a[_0xcb7d('0x48')]['id']}},_0x2c3a4c={};_0x2c3a4c[_0xcb7d('0x33')]=_[_0xcb7d('0x35')](db[_0xcb7d('0x31')][_0xcb7d('0x32')]);_0x2c3a4c[_0xcb7d('0x34')]=_[_0xcb7d('0x35')](_0x57242a['query']);_0x2c3a4c[_0xcb7d('0x49')]=_[_0xcb7d('0x36')](_0x2c3a4c[_0xcb7d('0x33')],_0x2c3a4c['query']);_0x29f638[_0xcb7d('0x37')]=_[_0xcb7d('0x36')](_0x2c3a4c[_0xcb7d('0x33')],qs['fields'](_0x57242a[_0xcb7d('0x34')]['fields']));_0x29f638['attributes']=_0x29f638[_0xcb7d('0x37')][_0xcb7d('0x4a')]?_0x29f638[_0xcb7d('0x37')]:_0x2c3a4c[_0xcb7d('0x33')];if(_0x57242a[_0xcb7d('0x34')][_0xcb7d('0x43')]){_0x29f638[_0xcb7d('0x44')]=[{'all':!![]}];}_0x29f638=_[_0xcb7d('0x3e')]({},_0x29f638,_0x57242a[_0xcb7d('0x41')]);return db[_0xcb7d('0x31')][_0xcb7d('0x4b')](_0x29f638)[_0xcb7d('0x26')](handleEntityNotFound(_0x221f8b,null))[_0xcb7d('0x26')](respondWithResult(_0x221f8b,null))[_0xcb7d('0x47')](handleError(_0x221f8b,null));};exports[_0xcb7d('0x4c')]=function(_0x88136c,_0xb21444){return db['AnalyticCustomReport'][_0xcb7d('0x4c')](_0x88136c[_0xcb7d('0x4d')],{})[_0xcb7d('0x26')](function(_0x3e04de){var _0xfe9e9c=_0x88136c[_0xcb7d('0x4e')][_0xcb7d('0x27')]({'plain':!![]});if(!_0xfe9e9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfe9e9c[_0xcb7d('0x4f')]==='user'){var _0x411a06=_0x3e04de[_0xcb7d('0x27')]({'plain':!![]});var _0x48dc8c=_0xcb7d('0x50');return db[_0xcb7d('0x51')][_0xcb7d('0x4b')]({'where':{'name':_0x48dc8c,'userProfileId':_0xfe9e9c[_0xcb7d('0x52')]},'raw':!![]})['then'](function(_0x513136){if(_0x513136&&_0x513136[_0xcb7d('0x53')]===0x0){return db[_0xcb7d('0x29')]['create']({'name':_0x411a06[_0xcb7d('0x2d')],'resourceId':_0x411a06['id'],'type':_0xcb7d('0x28'),'sectionId':_0x513136['id']},{})[_0xcb7d('0x26')](function(){return _0x3e04de;});}else{return _0x3e04de;}})[_0xcb7d('0x47')](function(_0x377220){logger[_0xcb7d('0x2b')](_0xcb7d('0x54'),_0x377220);throw _0x377220;});}return _0x3e04de;})[_0xcb7d('0x26')](respondWithResult(_0xb21444,0xc9))[_0xcb7d('0x47')](handleError(_0xb21444,null));};exports[_0xcb7d('0x25')]=function(_0x3791c9,_0x579859){if(_0x3791c9[_0xcb7d('0x4d')]['id']){delete _0x3791c9[_0xcb7d('0x4d')]['id'];}return db[_0xcb7d('0x31')][_0xcb7d('0x4b')]({'where':{'id':_0x3791c9[_0xcb7d('0x48')]['id']}})['then'](handleEntityNotFound(_0x579859,null))[_0xcb7d('0x26')](saveUpdates(_0x3791c9[_0xcb7d('0x4d')],null))[_0xcb7d('0x26')](respondWithResult(_0x579859,null))[_0xcb7d('0x47')](handleError(_0x579859,null));};exports[_0xcb7d('0x2a')]=function(_0x2bbf47,_0x11f9e0){return db['AnalyticCustomReport']['find']({'where':{'id':_0x2bbf47[_0xcb7d('0x48')]['id']}})[_0xcb7d('0x26')](handleEntityNotFound(_0x11f9e0,null))[_0xcb7d('0x26')](removeEntity(_0x11f9e0,null))[_0xcb7d('0x47')](handleError(_0x11f9e0,null));};exports[_0xcb7d('0x55')]=function(_0x22050d,_0x49ae82){var _0x3da166=0xa;var _0x3e7dfa=[_0xcb7d('0x56'),_0xcb7d('0x57'),'right_join',_0xcb7d('0x58')];var _0x2d6887={'SUM':_0xcb7d('0x59'),'COUNT':_0xcb7d('0x5a'),'COUNT DISTINCT':_0xcb7d('0x5b'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcb7d('0x5c'),'GROUP_CONCAT':_0xcb7d('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x59c6b3={'SEC_TO_TIME':_0xcb7d('0x5e'),'DATE':_0xcb7d('0x5f'),'HOUR':_0xcb7d('0x60'),'ROUND':_0xcb7d('0x61'),'UNIX_TIMESTAMP':_0xcb7d('0x62')};var _0x4fb959=function(_0x473c93){return!_[_0xcb7d('0x63')]([_0xcb7d('0x64'),'IS\x20NOT\x20NULL',_0xcb7d('0x65'),_0xcb7d('0x66')],_0x473c93);};var _0x211c18=function(_0x4a3b22){if(!_0x4a3b22||!_0x4a3b22[_0xcb7d('0x67')][_0xcb7d('0x4a')]){return'';}for(var _0x22f16b='(',_0x47bd99=0x0;_0x47bd99<_0x4a3b22['rules'][_0xcb7d('0x4a')];_0x47bd99+=0x1){_0x47bd99>0x0&&(_0x22f16b+='\x20'+_0x4a3b22[_0xcb7d('0x68')]+'\x20');_0x22f16b+=_0x4a3b22[_0xcb7d('0x67')][_0x47bd99][_0xcb7d('0x69')]?_0x211c18(_0x4a3b22[_0xcb7d('0x67')][_0x47bd99][_0xcb7d('0x69')]):_0x4a3b22[_0xcb7d('0x67')][_0x47bd99][_0xcb7d('0x6a')]+'\x20'+_0x4a3b22['rules'][_0x47bd99][_0xcb7d('0x6b')]+(_0x4fb959(_0x4a3b22[_0xcb7d('0x67')][_0x47bd99][_0xcb7d('0x6b')])?'\x20'+_0x4a3b22['rules'][_0x47bd99][_0xcb7d('0x6c')]:'');}return _0x22f16b+')';};var _0x5695ae={'where':{'id':_0x22050d[_0xcb7d('0x48')]['id']}},_0x3e00c2,_0x436853,_0x173d7a,_0x12034a,_0x2a22a5;_0x5695ae=_[_0xcb7d('0x3e')]({},_0x5695ae,_0x22050d[_0xcb7d('0x41')]);return db[_0xcb7d('0x31')]['find'](_0x5695ae)[_0xcb7d('0x26')](function(_0x5751dd){if(_0x5751dd){_0x3e00c2=_0x5751dd;return _0x5751dd['getFields']();}return null;})[_0xcb7d('0x26')](function(_0x5260f0){if(_0x5260f0){if(!_0x5260f0[_0xcb7d('0x4a')]){throw new db[(_0xcb7d('0x6d'))][(_0xcb7d('0x6e'))](_0xcb7d('0x6f'),0x193);}_0x436853=_0x5260f0;return db['AnalyticMetric'][_0xcb7d('0x45')]({'raw':!![]});}return null;})[_0xcb7d('0x26')](function(_0x1188bc){if(_0x1188bc){_0x173d7a=_['keyBy'](_0x1188bc,'id');var _0x3a97ae;var _0x10e3ac=squel['select']();_0x10e3ac[_0xcb7d('0x70')](_0x3e00c2[_0xcb7d('0x71')]);for(var _0x1b5e13=0x0;_0x1b5e13<_0x436853[_0xcb7d('0x4a')];_0x1b5e13+=0x1){_0x3a97ae=_0x436853[_0x1b5e13][_0xcb7d('0x72')]?_0x173d7a[_0x436853[_0x1b5e13][_0xcb7d('0x72')]][_0xcb7d('0x73')]:_0x436853[_0x1b5e13][_0xcb7d('0x6a')];_0x3a97ae=_0x436853[_0x1b5e13][_0xcb7d('0x74')]?_[_0xcb7d('0x75')](_0x2d6887[_0x436853[_0x1b5e13]['function']],'%s',_0x3a97ae):_0x3a97ae;_0x3a97ae=_0x436853[_0x1b5e13][_0xcb7d('0x76')]?_[_0xcb7d('0x75')](_0x59c6b3[_0x436853[_0x1b5e13]['format']],'%s',_0x3a97ae):_0x3a97ae;if(_0x436853[_0x1b5e13]['groupBy']){_0x10e3ac[_0xcb7d('0x69')](_0x3a97ae);}_0x436853[_0x1b5e13][_0xcb7d('0x77')]&&_0x10e3ac['order'](_0x3a97ae,_0x436853[_0x1b5e13][_0xcb7d('0x77')]===_0xcb7d('0x78')?![]:!![]);_0x10e3ac['field'](_0x3a97ae,_0x436853[_0x1b5e13][_0xcb7d('0x79')]||_0x3a97ae);}if(_0x3e00c2['joins']){_0x3e00c2[_0xcb7d('0x7a')]=JSON['parse'](_0x3e00c2[_0xcb7d('0x7a')]);for(var _0x281f2d=0x0;_0x281f2d<_0x3e00c2[_0xcb7d('0x7a')][_0xcb7d('0x4a')];_0x281f2d+=0x1){if(_0x3e00c2[_0xcb7d('0x7a')][_0x281f2d]['type']&&_[_0xcb7d('0x63')](_0x3e7dfa,_0x3e00c2['joins'][_0x281f2d][_0xcb7d('0x3f')])&&_0x3e00c2[_0xcb7d('0x7a')][_0x281f2d]['parentKey']&&_0x3e00c2[_0xcb7d('0x7a')][_0x281f2d][_0xcb7d('0x7b')]&&_0x3e00c2[_0xcb7d('0x7a')][_0x281f2d][_0xcb7d('0x7c')]){_0x10e3ac[_0x3e00c2[_0xcb7d('0x7a')][_0x281f2d][_0xcb7d('0x3f')]](_0x3e00c2['joins'][_0x281f2d]['foreignTable'],null,util[_0xcb7d('0x76')](_0xcb7d('0x7d'),_0x3e00c2[_0xcb7d('0x71')],_0x3e00c2[_0xcb7d('0x7a')][_0x281f2d][_0xcb7d('0x7e')],_0x3e00c2[_0xcb7d('0x7a')][_0x281f2d][_0xcb7d('0x7b')],_0x3e00c2[_0xcb7d('0x7a')][_0x281f2d][_0xcb7d('0x7c')]));}}}if(_0x3e00c2[_0xcb7d('0x7f')]){_0x3e00c2[_0xcb7d('0x7f')]=JSON[_0xcb7d('0x80')](_0x3e00c2['conditions']);_0x10e3ac[_0xcb7d('0x3b')](_0x211c18(_0x3e00c2['conditions'][_0xcb7d('0x69')]));}_0x2a22a5=_0x10e3ac[_0xcb7d('0x81')]();_0x10e3ac[_0xcb7d('0x20')](_0x3da166);_0x10e3ac[_0xcb7d('0x1e')](0x0);logger['debug'](_0xcb7d('0x82'),_0x10e3ac['toString']());return dbH['sequelize'][_0xcb7d('0x34')](_0x10e3ac[_0xcb7d('0x83')](),{'type':dbH[_0xcb7d('0x84')][_0xcb7d('0x85')]['SELECT']});}})[_0xcb7d('0x26')](respondWithResult(_0x49ae82,null))[_0xcb7d('0x47')](handleError(_0x49ae82,null));};function runReport(_0x1524e0,_0x3b30c7,_0x324278){var _0x2514ac=_0x3b30c7[_0xcb7d('0x2d')];var _0x3959dd=0xa;var _0x5ac373=['join',_0xcb7d('0x57'),'right_join',_0xcb7d('0x58')];var _0x739ff2={'SUM':_0xcb7d('0x59'),'COUNT':_0xcb7d('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcb7d('0x86'),'MIN':_0xcb7d('0x87'),'AVG':_0xcb7d('0x5c'),'GROUP_CONCAT':_0xcb7d('0x5d'),'GROUP_CONCAT ASC':_0xcb7d('0x88'),'GROUP_CONCAT DESC':_0xcb7d('0x89')};var _0x195e73={'SEC_TO_TIME':_0xcb7d('0x5e'),'DATE':_0xcb7d('0x5f'),'HOUR':_0xcb7d('0x60'),'ROUND':_0xcb7d('0x61'),'UNIX_TIMESTAMP':_0xcb7d('0x62')};var _0xd8b525=function(_0x335f9e){return!_[_0xcb7d('0x63')]([_0xcb7d('0x64'),_0xcb7d('0x8a'),'IS\x20EMPTY',_0xcb7d('0x66')],_0x335f9e);};var _0x593bba=function(_0x2eee0f){if(!_0x2eee0f||!_0x2eee0f[_0xcb7d('0x67')]['length']){return'';}for(var _0x475575='(',_0x4c3f36=0x0;_0x4c3f36<_0x2eee0f['rules'][_0xcb7d('0x4a')];_0x4c3f36+=0x1){_0x4c3f36>0x0&&(_0x475575+='\x20'+_0x2eee0f[_0xcb7d('0x68')]+'\x20');_0x475575+=_0x2eee0f[_0xcb7d('0x67')][_0x4c3f36][_0xcb7d('0x69')]?_0x593bba(_0x2eee0f[_0xcb7d('0x67')][_0x4c3f36][_0xcb7d('0x69')]):_0x2eee0f['rules'][_0x4c3f36][_0xcb7d('0x6a')]+'\x20'+_0x2eee0f['rules'][_0x4c3f36][_0xcb7d('0x6b')]+(_0xd8b525(_0x2eee0f[_0xcb7d('0x67')][_0x4c3f36][_0xcb7d('0x6b')])?'\x20'+_0x2eee0f[_0xcb7d('0x67')][_0x4c3f36]['value']:'');}return _0x475575+')';};var _0x54fe6d={'where':{'id':_0x1524e0['id']}},_0xc54f14,_0xf6b5c,_0x250ddd,_0x492a78,_0xaca23d;_0x54fe6d=_[_0xcb7d('0x3e')]({},_0x54fe6d,_0x324278);return db[_0xcb7d('0x31')]['find'](_0x54fe6d)[_0xcb7d('0x26')](function(_0x29e787){if(_0x29e787){_0xc54f14=_0x29e787;return _0x29e787[_0xcb7d('0x8b')]();}return null;})[_0xcb7d('0x26')](function(_0x1a8441){if(_0x1a8441){if(!_0x1a8441[_0xcb7d('0x4a')]){throw new db[(_0xcb7d('0x6d'))][(_0xcb7d('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xf6b5c=_0x1a8441;return db['AnalyticMetric'][_0xcb7d('0x45')]({'raw':!![]});}return null;})[_0xcb7d('0x26')](function(_0x20c61b){if(_0x20c61b){_0x250ddd=_[_0xcb7d('0x8c')](_0x20c61b,'id');var _0x5ac9e6;var _0x4725d8=squel['select']();_0x4725d8[_0xcb7d('0x70')](_0xc54f14[_0xcb7d('0x71')]);for(var _0x4eeaa6=0x0;_0x4eeaa6<_0xf6b5c['length'];_0x4eeaa6+=0x1){_0x5ac9e6=_0xf6b5c[_0x4eeaa6][_0xcb7d('0x72')]?_0x250ddd[_0xf6b5c[_0x4eeaa6][_0xcb7d('0x72')]]['metric']:_0xf6b5c[_0x4eeaa6][_0xcb7d('0x6a')];_0x5ac9e6=_0xf6b5c[_0x4eeaa6][_0xcb7d('0x74')]?_[_0xcb7d('0x75')](_0x739ff2[_0xf6b5c[_0x4eeaa6][_0xcb7d('0x74')]],'%s',_0x5ac9e6):_0x5ac9e6;_0x5ac9e6=_0xf6b5c[_0x4eeaa6]['format']?_[_0xcb7d('0x75')](_0x195e73[_0xf6b5c[_0x4eeaa6]['format']],'%s',_0x5ac9e6):_0x5ac9e6;if(_0xf6b5c[_0x4eeaa6][_0xcb7d('0x8d')]){_0x4725d8[_0xcb7d('0x69')](_0x5ac9e6);}_0xf6b5c[_0x4eeaa6][_0xcb7d('0x77')]&&_0x4725d8['order'](_0x5ac9e6,_0xf6b5c[_0x4eeaa6]['orderBy']===_0xcb7d('0x78')?![]:!![]);_0x4725d8[_0xcb7d('0x6a')](_0x5ac9e6,_0xf6b5c[_0x4eeaa6][_0xcb7d('0x79')]||_0x5ac9e6);}if(_0xc54f14['joins']){_0xc54f14[_0xcb7d('0x7a')]=JSON[_0xcb7d('0x80')](_0xc54f14[_0xcb7d('0x7a')]);for(var _0x94023f=0x0;_0x94023f<_0xc54f14[_0xcb7d('0x7a')][_0xcb7d('0x4a')];_0x94023f+=0x1){if(_0xc54f14['joins'][_0x94023f][_0xcb7d('0x3f')]&&_[_0xcb7d('0x63')](_0x5ac373,_0xc54f14[_0xcb7d('0x7a')][_0x94023f][_0xcb7d('0x3f')])&&_0xc54f14[_0xcb7d('0x7a')][_0x94023f][_0xcb7d('0x7e')]&&_0xc54f14[_0xcb7d('0x7a')][_0x94023f]['foreignTable']&&_0xc54f14[_0xcb7d('0x7a')][_0x94023f][_0xcb7d('0x7c')]){_0x4725d8[_0xc54f14[_0xcb7d('0x7a')][_0x94023f][_0xcb7d('0x3f')]](_0xc54f14[_0xcb7d('0x7a')][_0x94023f][_0xcb7d('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0xc54f14[_0xcb7d('0x71')],_0xc54f14[_0xcb7d('0x7a')][_0x94023f][_0xcb7d('0x7e')],_0xc54f14[_0xcb7d('0x7a')][_0x94023f][_0xcb7d('0x7b')],_0xc54f14['joins'][_0x94023f][_0xcb7d('0x7c')]));}}}if(_0xc54f14[_0xcb7d('0x7f')]){_0xc54f14['conditions']=JSON[_0xcb7d('0x80')](_0xc54f14[_0xcb7d('0x7f')]);_0x4725d8[_0xcb7d('0x3b')](_0x593bba(_0xc54f14[_0xcb7d('0x7f')][_0xcb7d('0x69')]));}_0xaca23d=_0x4725d8['clone']();_0x4725d8[_0xcb7d('0x20')](_0x3959dd);_0x4725d8['offset'](0x0);return;}})[_0xcb7d('0x26')](function(){if(_0x3b30c7[_0xcb7d('0x8e')]===_0xcb7d('0x8f')){return null;}var _0x398494=_[_0xcb7d('0x3e')](_0x3b30c7,{'name':_0x3b30c7[_0xcb7d('0x90')]||_0x3b30c7['name']||_0xc54f14['name'],'basename':_0x2514ac,'savename':util[_0xcb7d('0x76')](_0xcb7d('0x91'),_0x3b30c7[_0xcb7d('0x2d')]||_0xc54f14['name'],require(_0xcb7d('0x92'))[_0xcb7d('0x93')](0x4),_0x3b30c7[_0xcb7d('0x8e')]||_0xcb7d('0x94')),'reportId':_0xc54f14['id'],'reportType':'custom'});return db['AnalyticExtractedReport']['create'](_0x398494,{'raw':!![]});})[_0xcb7d('0x26')](function(_0x356221){if(_0xc54f14[_0xcb7d('0x71')]===_0xcb7d('0x95')){_0xaca23d[_0xcb7d('0x3b')](_0xc54f14[_0xcb7d('0x71')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3b30c7[_0xcb7d('0x96')],_0x3b30c7[_0xcb7d('0x97')]);}else{_0xaca23d['where'](_0xc54f14[_0xcb7d('0x71')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3b30c7[_0xcb7d('0x96')],_0x3b30c7[_0xcb7d('0x97')]);}if(_0x356221){logger[_0xcb7d('0x98')](_0xcb7d('0x99'),_0xaca23d['toString']());require('child_process')[_0xcb7d('0x9a')](path[_0xcb7d('0x56')](__dirname,_0xcb7d('0x9b'),_0x356221[_0xcb7d('0x8e')]),[_0x356221['id'],_0xaca23d[_0xcb7d('0x83')](),path['join'](__dirname,_0xcb7d('0x9c'),_0x356221[_0xcb7d('0x9d')]),_0x2514ac]);return _0x356221;}else{var _0x529c1c=squel[_0xcb7d('0x9e')]();_0x529c1c['from']('('+_0xaca23d[_0xcb7d('0x83')]()+')',_0xcb7d('0x9f'));_0x529c1c[_0xcb7d('0x6a')](_0xcb7d('0xa0'),_0xcb7d('0x42'));_0xaca23d[_0xcb7d('0x20')](_0x3b30c7[_0xcb7d('0x20')]||_0x3959dd);_0xaca23d[_0xcb7d('0x1e')](_0x3b30c7[_0xcb7d('0x1e')]||0x0);return dbH[_0xcb7d('0x84')][_0xcb7d('0x34')](_0x529c1c['toString'](),{'type':dbH[_0xcb7d('0x84')][_0xcb7d('0x85')][_0xcb7d('0xa1')]})['then'](function(_0x1b8153){if(!_0x1b8153[_0xcb7d('0x4a')]){_0x492a78=0x0;}else{_0x492a78=_0x1b8153[0x0]['count']||0x0;}return dbH[_0xcb7d('0x84')][_0xcb7d('0x34')](_0xaca23d[_0xcb7d('0x83')](),{'type':dbH[_0xcb7d('0x84')][_0xcb7d('0x85')][_0xcb7d('0xa1')]});})[_0xcb7d('0x26')](function(_0x290d2b){return{'rows':_0x290d2b||[],'count':_0x492a78};});}});}exports[_0xcb7d('0xa2')]=function(_0x4ebf6e,_0x36f2a3){return runReport(_0x4ebf6e[_0xcb7d('0x48')],_0x4ebf6e[_0xcb7d('0x34')],_0x4ebf6e[_0xcb7d('0x41')])['then'](respondWithResult(_0x36f2a3,null))['catch'](handleError(_0x36f2a3,null));};exports[_0xcb7d('0xa3')]=runReport;exports['query']=function(_0x36b356,_0x41d677){var _0x3ea9aa=0xa;var _0x1d00f4=[_0xcb7d('0x56'),_0xcb7d('0x57'),_0xcb7d('0xa4'),'cross_join'];var _0x1da6ff={'SUM':'SUM(%s)','COUNT':_0xcb7d('0x5a'),'COUNT DISTINCT':_0xcb7d('0x5b'),'MAX':_0xcb7d('0x86'),'MIN':'MIN(%s)','AVG':_0xcb7d('0x5c'),'GROUP_CONCAT':_0xcb7d('0x5d'),'GROUP_CONCAT ASC':_0xcb7d('0x88'),'GROUP_CONCAT DESC':_0xcb7d('0x89')};var _0x2a1237={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xcb7d('0x5f'),'HOUR':_0xcb7d('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2eaf7d=function(_0x3c1735){return!_[_0xcb7d('0x63')]([_0xcb7d('0x64'),_0xcb7d('0x8a'),_0xcb7d('0x65'),'IS\x20NOT\x20EMPTY'],_0x3c1735);};var _0x419cd4=function(_0x562517){if(!_0x562517||!_0x562517['rules'][_0xcb7d('0x4a')]){return'';}for(var _0xc54003='(',_0x3556a7=0x0;_0x3556a7<_0x562517[_0xcb7d('0x67')][_0xcb7d('0x4a')];_0x3556a7+=0x1){_0x3556a7>0x0&&(_0xc54003+='\x20'+_0x562517[_0xcb7d('0x68')]+'\x20');_0xc54003+=_0x562517[_0xcb7d('0x67')][_0x3556a7][_0xcb7d('0x69')]?_0x419cd4(_0x562517['rules'][_0x3556a7]['group']):_0x562517['rules'][_0x3556a7]['field']+'\x20'+_0x562517[_0xcb7d('0x67')][_0x3556a7]['condition']+(_0x2eaf7d(_0x562517[_0xcb7d('0x67')][_0x3556a7][_0xcb7d('0x6b')])?'\x20'+_0x562517['rules'][_0x3556a7]['value']:'');}return _0xc54003+')';};var _0x39c7fd={'where':{'id':_0x36b356[_0xcb7d('0x48')]['id']}},_0x41316d,_0x32524a,_0x487155,_0x163cf9,_0x4e3ee5;_0x39c7fd=_[_0xcb7d('0x3e')]({},_0x39c7fd,_0x36b356[_0xcb7d('0x41')]);return db[_0xcb7d('0x31')][_0xcb7d('0x4b')](_0x39c7fd)[_0xcb7d('0x26')](function(_0x1d7fd4){if(_0x1d7fd4){_0x41316d=_0x1d7fd4;return _0x1d7fd4[_0xcb7d('0x8b')]();}return null;})[_0xcb7d('0x26')](function(_0x3fce49){if(_0x3fce49){if(!_0x3fce49[_0xcb7d('0x4a')]){throw new db['Sequelize'][(_0xcb7d('0x6e'))](_0xcb7d('0x6f'),0x193);}_0x32524a=_0x3fce49;return db[_0xcb7d('0xa5')][_0xcb7d('0x45')]({'raw':!![]});}return null;})['then'](function(_0x4081fc){if(_0x4081fc){_0x487155=_[_0xcb7d('0x8c')](_0x4081fc,'id');var _0x337691;var _0xce2c68=squel['select']();_0xce2c68[_0xcb7d('0x70')](_0x41316d['table']);for(var _0x25494f=0x0;_0x25494f<_0x32524a[_0xcb7d('0x4a')];_0x25494f+=0x1){_0x337691=_0x32524a[_0x25494f]['MetricId']?_0x487155[_0x32524a[_0x25494f]['MetricId']]['metric']:_0x32524a[_0x25494f]['field'];_0x337691=_0x32524a[_0x25494f][_0xcb7d('0x74')]?_['replace'](_0x1da6ff[_0x32524a[_0x25494f][_0xcb7d('0x74')]],'%s',_0x337691):_0x337691;_0x337691=_0x32524a[_0x25494f]['format']?_[_0xcb7d('0x75')](_0x2a1237[_0x32524a[_0x25494f]['format']],'%s',_0x337691):_0x337691;if(_0x32524a[_0x25494f][_0xcb7d('0x8d')]){_0xce2c68[_0xcb7d('0x69')](_0x337691);}_0x32524a[_0x25494f]['orderBy']&&_0xce2c68[_0xcb7d('0x3a')](_0x337691,_0x32524a[_0x25494f]['orderBy']==='DESC'?![]:!![]);_0xce2c68['field'](_0x337691,_0x32524a[_0x25494f]['alias']||_0x337691);}if(_0x41316d[_0xcb7d('0x7a')]){_0x41316d[_0xcb7d('0x7a')]=JSON[_0xcb7d('0x80')](_0x41316d[_0xcb7d('0x7a')]);for(var _0x559e54=0x0;_0x559e54<_0x41316d[_0xcb7d('0x7a')][_0xcb7d('0x4a')];_0x559e54+=0x1){if(_0x41316d[_0xcb7d('0x7a')][_0x559e54][_0xcb7d('0x3f')]&&_[_0xcb7d('0x63')](_0x1d00f4,_0x41316d[_0xcb7d('0x7a')][_0x559e54][_0xcb7d('0x3f')])&&_0x41316d[_0xcb7d('0x7a')][_0x559e54]['parentKey']&&_0x41316d[_0xcb7d('0x7a')][_0x559e54][_0xcb7d('0x7b')]&&_0x41316d[_0xcb7d('0x7a')][_0x559e54][_0xcb7d('0x7c')]){_0xce2c68[_0x41316d['joins'][_0x559e54][_0xcb7d('0x3f')]](_0x41316d[_0xcb7d('0x7a')][_0x559e54][_0xcb7d('0x7b')],null,util['format'](_0xcb7d('0x7d'),_0x41316d['table'],_0x41316d[_0xcb7d('0x7a')][_0x559e54]['parentKey'],_0x41316d[_0xcb7d('0x7a')][_0x559e54][_0xcb7d('0x7b')],_0x41316d[_0xcb7d('0x7a')][_0x559e54]['foreignKey']));}}}if(_0x41316d[_0xcb7d('0x7f')]){_0x41316d['conditions']=JSON[_0xcb7d('0x80')](_0x41316d[_0xcb7d('0x7f')]);_0xce2c68[_0xcb7d('0x3b')](_0x419cd4(_0x41316d[_0xcb7d('0x7f')][_0xcb7d('0x69')]));}_0x4e3ee5=_0xce2c68['clone']();_0xce2c68[_0xcb7d('0x20')](_0x3ea9aa);_0xce2c68[_0xcb7d('0x1e')](0x0);logger['debug'](_0xcb7d('0x82'),_0xce2c68['toString']());return dbH[_0xcb7d('0x84')][_0xcb7d('0x34')](_0xce2c68[_0xcb7d('0x83')](),{'type':dbH[_0xcb7d('0x84')][_0xcb7d('0x85')][_0xcb7d('0xa1')]});}})[_0xcb7d('0x26')](function(){return{'sql':_0x4e3ee5[_0xcb7d('0x83')]()};})[_0xcb7d('0x26')](respondWithResult(_0x41d677,null))['catch'](handleError(_0x41d677,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 3e6a786..445acd7 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.model.js +++ b/server/api/analyticCustomReport/analyticCustomReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39c0=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x44ad1c,_0x530bf0){var _0x30a66a=function(_0xb30d83){while(--_0xb30d83){_0x44ad1c['push'](_0x44ad1c['shift']());}};_0x30a66a(++_0x530bf0);}(_0x39c0,0x149));var _0x039c=function(_0x2727a5,_0xfb2cf5){_0x2727a5=_0x2727a5-0x0;var _0x40666c=_0x39c0[_0x2727a5];return _0x40666c;};'use strict';var _=require(_0x039c('0x0'));var util=require(_0x039c('0x1'));var logger=require(_0x039c('0x2'))(_0x039c('0x3'));var moment=require(_0x039c('0x4'));var BPromise=require(_0x039c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x039c('0x6'));var rimraf=require(_0x039c('0x7'));var config=require(_0x039c('0x8'));var attributes=require(_0x039c('0x9'));module[_0x039c('0xa')]=function(_0xae0497,_0x548cac){return _0xae0497[_0x039c('0xb')](_0x039c('0xc'),attributes,{'tableName':_0x039c('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28f6=['analytics_custom_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x28f6,0x79));var _0x628f=function(_0x5f1c59,_0x403efe){_0x5f1c59=_0x5f1c59-0x0;var _0x1364a5=_0x28f6[_0x5f1c59];return _0x1364a5;};'use strict';var _=require('lodash');var util=require(_0x628f('0x0'));var logger=require(_0x628f('0x1'))(_0x628f('0x2'));var moment=require(_0x628f('0x3'));var BPromise=require(_0x628f('0x4'));var rp=require(_0x628f('0x5'));var fs=require('fs');var path=require(_0x628f('0x6'));var rimraf=require('rimraf');var config=require(_0x628f('0x7'));var attributes=require(_0x628f('0x8'));module['exports']=function(_0x53cd83,_0x32dc9e){return _0x53cd83[_0x628f('0x9')](_0x628f('0xa'),attributes,{'tableName':_0x628f('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 1f43f47..cd6fbf5 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.rpc.js +++ b/server/api/analyticCustomReport/analyticCustomReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd03b=['../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticCustomReport,\x20%s,\x20%s','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4bcd02,_0x401b12){var _0x4696eb=function(_0x35a989){while(--_0x35a989){_0x4bcd02['push'](_0x4bcd02['shift']());}};_0x4696eb(++_0x401b12);}(_0xd03b,0xd5));var _0xbd03=function(_0x1ed3da,_0x1e549f){_0x1ed3da=_0x1ed3da-0x0;var _0x368b7f=_0xd03b[_0x1ed3da];return _0x368b7f;};'use strict';var _=require(_0xbd03('0x0'));var util=require(_0xbd03('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbd03('0x2'));var fs=require('fs');var Redis=require(_0xbd03('0x3'));var db=require(_0xbd03('0x4'))['db'];var utils=require(_0xbd03('0x5'));var logger=require(_0xbd03('0x6'))('rpc');var config=require(_0xbd03('0x7'));var jayson=require(_0xbd03('0x8'));var client=jayson[_0xbd03('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27c63e,_0x201a3b,_0x4a3f5d){return new BPromise(function(_0x1838d7,_0x5479c7){return client[_0xbd03('0xa')](_0x27c63e,_0x4a3f5d)['then'](function(_0x4bf5dc){logger[_0xbd03('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x201a3b,_0xbd03('0xc'));logger[_0xbd03('0xd')](_0xbd03('0xe'),_0x201a3b,_0xbd03('0xc'),JSON[_0xbd03('0xf')](_0x4bf5dc));if(_0x4bf5dc[_0xbd03('0x10')]){if(_0x4bf5dc[_0xbd03('0x10')]['code']===0x1f4){logger[_0xbd03('0x10')](_0xbd03('0x11'),_0x201a3b,_0x4bf5dc['error'][_0xbd03('0x12')]);return _0x5479c7(_0x4bf5dc[_0xbd03('0x10')][_0xbd03('0x12')]);}logger[_0xbd03('0x10')](_0xbd03('0x11'),_0x201a3b,_0x4bf5dc['error'][_0xbd03('0x12')]);return _0x1838d7(_0x4bf5dc[_0xbd03('0x10')][_0xbd03('0x12')]);}else{logger['info'](_0xbd03('0x11'),_0x201a3b,_0xbd03('0xc'));_0x1838d7(_0x4bf5dc['result'][_0xbd03('0x12')]);}})[_0xbd03('0x13')](function(_0x328dec){logger[_0xbd03('0x10')](_0xbd03('0x11'),_0x201a3b,_0x328dec);_0x5479c7(_0x328dec);});});} \ No newline at end of file +var _0x8d31=['AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x133ef3,_0xc17ee6){var _0x35772d=function(_0x598d7d){while(--_0x598d7d){_0x133ef3['push'](_0x133ef3['shift']());}};_0x35772d(++_0xc17ee6);}(_0x8d31,0x121));var _0x18d3=function(_0x3d3334,_0x153407){_0x3d3334=_0x3d3334-0x0;var _0x521fa5=_0x8d31[_0x3d3334];return _0x521fa5;};'use strict';var _=require(_0x18d3('0x0'));var util=require(_0x18d3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x18d3('0x2'));var fs=require('fs');var Redis=require(_0x18d3('0x3'));var db=require(_0x18d3('0x4'))['db'];var utils=require(_0x18d3('0x5'));var logger=require(_0x18d3('0x6'))(_0x18d3('0x7'));var config=require(_0x18d3('0x8'));var jayson=require(_0x18d3('0x9'));var client=jayson[_0x18d3('0xa')][_0x18d3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4299e9,_0x8cdb35,_0x2318dd){return new BPromise(function(_0x48f39d,_0x4e4e79){return client[_0x18d3('0xc')](_0x4299e9,_0x2318dd)[_0x18d3('0xd')](function(_0x1b3e14){logger[_0x18d3('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8cdb35,_0x18d3('0xf'));logger[_0x18d3('0x10')](_0x18d3('0x11'),_0x8cdb35,_0x18d3('0xf'),JSON['stringify'](_0x1b3e14));if(_0x1b3e14['error']){if(_0x1b3e14[_0x18d3('0x12')]['code']===0x1f4){logger[_0x18d3('0x12')](_0x18d3('0x13'),_0x8cdb35,_0x1b3e14['error'][_0x18d3('0x14')]);return _0x4e4e79(_0x1b3e14[_0x18d3('0x12')][_0x18d3('0x14')]);}logger['error'](_0x18d3('0x13'),_0x8cdb35,_0x1b3e14[_0x18d3('0x12')][_0x18d3('0x14')]);return _0x48f39d(_0x1b3e14[_0x18d3('0x12')][_0x18d3('0x14')]);}else{logger[_0x18d3('0xe')](_0x18d3('0x13'),_0x8cdb35,_0x18d3('0xf'));_0x48f39d(_0x1b3e14[_0x18d3('0x15')][_0x18d3('0x14')]);}})['catch'](function(_0x570b48){logger['error'](_0x18d3('0x13'),_0x8cdb35,_0x570b48);_0x4e4e79(_0x570b48);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index fe41d3a..9c492aa 100644 --- a/server/api/analyticCustomReport/index.js +++ b/server/api/analyticCustomReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8db1=['util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','exports'];(function(_0xf4de83,_0x5d3a41){var _0x13b505=function(_0x55e2f2){while(--_0x55e2f2){_0xf4de83['push'](_0xf4de83['shift']());}};_0x13b505(++_0x5d3a41);}(_0x8db1,0x84));var _0x18db=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x8db1[_0x138adb];return _0x1b27f2;};'use strict';var multer=require('multer');var util=require(_0x18db('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x18db('0x1'));var router=express['Router']();var fs_extra=require(_0x18db('0x2'));var auth=require(_0x18db('0x3'));var interaction=require(_0x18db('0x4'));var config=require(_0x18db('0x5'));var controller=require(_0x18db('0x6'));router[_0x18db('0x7')]('/',auth[_0x18db('0x8')](),controller['index']);router[_0x18db('0x7')](_0x18db('0x9'),auth[_0x18db('0x8')](),controller[_0x18db('0xa')]);router[_0x18db('0x7')](_0x18db('0xb'),auth[_0x18db('0x8')](),controller[_0x18db('0xc')]);router[_0x18db('0x7')](_0x18db('0xd'),auth['isAuthenticated'](),controller[_0x18db('0xe')]);router[_0x18db('0x7')](_0x18db('0xf'),auth[_0x18db('0x8')](),controller[_0x18db('0x10')]);router[_0x18db('0x11')]('/',auth[_0x18db('0x8')](),controller[_0x18db('0x12')]);router[_0x18db('0x13')](_0x18db('0x9'),auth[_0x18db('0x8')](),controller[_0x18db('0x14')]);router['delete'](_0x18db('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x18db('0x15')]=router; \ No newline at end of file +var _0x314d=['post','update','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query'];(function(_0x5dbb30,_0xae62ea){var _0x34e7e0=function(_0x5d6b4b){while(--_0x5d6b4b){_0x5dbb30['push'](_0x5dbb30['shift']());}};_0x34e7e0(++_0xae62ea);}(_0x314d,0x82));var _0xd314=function(_0x1bdeaf,_0x23d54e){_0x1bdeaf=_0x1bdeaf-0x0;var _0x440ca4=_0x314d[_0x1bdeaf];return _0x440ca4;};'use strict';var multer=require(_0xd314('0x0'));var util=require('util');var path=require(_0xd314('0x1'));var timeout=require(_0xd314('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd314('0x3'));var auth=require(_0xd314('0x4'));var interaction=require(_0xd314('0x5'));var config=require(_0xd314('0x6'));var controller=require(_0xd314('0x7'));router[_0xd314('0x8')]('/',auth['isAuthenticated'](),controller[_0xd314('0x9')]);router[_0xd314('0x8')](_0xd314('0xa'),auth[_0xd314('0xb')](),controller[_0xd314('0xc')]);router['get'](_0xd314('0xd'),auth[_0xd314('0xb')](),controller[_0xd314('0xe')]);router[_0xd314('0x8')](_0xd314('0xf'),auth[_0xd314('0xb')](),controller['run']);router['get'](_0xd314('0x10'),auth['isAuthenticated'](),controller['query']);router[_0xd314('0x11')]('/',auth[_0xd314('0xb')](),controller['create']);router['put'](_0xd314('0xa'),auth[_0xd314('0xb')](),controller[_0xd314('0x12')]);router['delete']('/:id',auth[_0xd314('0xb')](),controller[_0xd314('0x13')]);module[_0xd314('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 28c157c..fecc3f4 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x4b332a,_0x442c93){_0x4b332a=_0x4b332a-0x0;var _0xd1af10=_0x8ef6[_0x4b332a];return _0xd1af10;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x258257,_0x32042d){var _0xafb58a=function(_0x506b5a){while(--_0x506b5a){_0x258257['push'](_0x258257['shift']());}};_0xafb58a(++_0x32042d);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x2b0875,_0x21ff12){_0x2b0875=_0x2b0875-0x0;var _0xedb8d7=_0xfdbd[_0x2b0875];return _0xedb8d7;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 0117a7c..9349e65 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0xa0e317,_0xf5c888){var _0x4e6c74=function(_0x3eed4d){while(--_0x3eed4d){_0xa0e317['push'](_0xa0e317['shift']());}};_0x4e6c74(++_0xf5c888);}(_0x53ec,0x192));var _0xc53e=function(_0x39ff0c,_0x2069c7){_0x39ff0c=_0x39ff0c-0x0;var _0x5c4ca6=_0x53ec[_0x39ff0c];return _0x5c4ca6;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));}; \ No newline at end of file +var _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x53fb07,_0x513401){var _0x42eb6f=function(_0x4b4dc0){while(--_0x4b4dc0){_0x53fb07['push'](_0x53fb07['shift']());}};_0x42eb6f(++_0x513401);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2013b2,_0xfd0c3d){_0x2013b2=_0x2013b2-0x0;var _0x5e0c0a=_0x1cb9[_0x2013b2];return _0x5e0c0a;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 413119f..3e29842 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.model.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x777e=['analytics_default_reports','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','AnalyticDefaultReport'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x777e,0x135));var _0xe777=function(_0x1988b0,_0x1fa6a0){_0x1988b0=_0x1988b0-0x0;var _0x1240b2=_0x777e[_0x1988b0];return _0x1240b2;};'use strict';var _=require(_0xe777('0x0'));var util=require(_0xe777('0x1'));var logger=require(_0xe777('0x2'))(_0xe777('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe777('0x4'));var fs=require('fs');var path=require(_0xe777('0x5'));var rimraf=require(_0xe777('0x6'));var config=require(_0xe777('0x7'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x53efd7,_0x18a129){return _0x53efd7[_0xe777('0x8')](_0xe777('0x9'),attributes,{'tableName':_0xe777('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c53=['api','moment','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','util'];(function(_0xd4ec0c,_0x2afcd2){var _0x580218=function(_0x3b1cd4){while(--_0x3b1cd4){_0xd4ec0c['push'](_0xd4ec0c['shift']());}};_0x580218(++_0x2afcd2);}(_0x5c53,0x1ea));var _0x35c5=function(_0xc91901,_0x16041d){_0xc91901=_0xc91901-0x0;var _0x45ded1=_0x5c53[_0xc91901];return _0x45ded1;};'use strict';var _=require(_0x35c5('0x0'));var util=require(_0x35c5('0x1'));var logger=require('../../config/logger')(_0x35c5('0x2'));var moment=require(_0x35c5('0x3'));var BPromise=require('bluebird');var rp=require(_0x35c5('0x4'));var fs=require('fs');var path=require(_0x35c5('0x5'));var rimraf=require(_0x35c5('0x6'));var config=require(_0x35c5('0x7'));var attributes=require(_0x35c5('0x8'));module[_0x35c5('0x9')]=function(_0x950087,_0x2071a3){return _0x950087[_0x35c5('0xa')](_0x35c5('0xb'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 9df1779..cfa9736 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6c3=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x4ac494,_0x2ac7d3){var _0x369355=function(_0x8fefb2){while(--_0x8fefb2){_0x4ac494['push'](_0x4ac494['shift']());}};_0x369355(++_0x2ac7d3);}(_0xa6c3,0x92));var _0x3a6c=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa6c3[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x3a6c('0x0'));var util=require(_0x3a6c('0x1'));var moment=require('moment');var BPromise=require(_0x3a6c('0x2'));var rs=require(_0x3a6c('0x3'));var fs=require('fs');var Redis=require(_0x3a6c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3a6c('0x5'));var logger=require(_0x3a6c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3a6c('0x7'));var client=jayson[_0x3a6c('0x8')][_0x3a6c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e84bf,_0x4579b4,_0x11bd55){return new BPromise(function(_0x57c38d,_0x20bb43){return client[_0x3a6c('0xa')](_0x1e84bf,_0x11bd55)[_0x3a6c('0xb')](function(_0x5b9e7d){logger[_0x3a6c('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4579b4,_0x3a6c('0xd'));logger[_0x3a6c('0xe')](_0x3a6c('0xf'),_0x4579b4,'request\x20sent',JSON[_0x3a6c('0x10')](_0x5b9e7d));if(_0x5b9e7d[_0x3a6c('0x11')]){if(_0x5b9e7d[_0x3a6c('0x11')][_0x3a6c('0x12')]===0x1f4){logger[_0x3a6c('0x11')](_0x3a6c('0x13'),_0x4579b4,_0x5b9e7d[_0x3a6c('0x11')][_0x3a6c('0x14')]);return _0x20bb43(_0x5b9e7d['error'][_0x3a6c('0x14')]);}logger[_0x3a6c('0x11')](_0x3a6c('0x13'),_0x4579b4,_0x5b9e7d['error']['message']);return _0x57c38d(_0x5b9e7d[_0x3a6c('0x11')]['message']);}else{logger[_0x3a6c('0xc')](_0x3a6c('0x13'),_0x4579b4,_0x3a6c('0xd'));_0x57c38d(_0x5b9e7d[_0x3a6c('0x15')][_0x3a6c('0x14')]);}})[_0x3a6c('0x16')](function(_0x58f14c){logger[_0x3a6c('0x11')](_0x3a6c('0x13'),_0x4579b4,_0x58f14c);_0x20bb43(_0x58f14c);});});} \ No newline at end of file +var _0x60d4=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3815b2,_0xdeaa84){var _0x2ebd79=function(_0x4ed85a){while(--_0x4ed85a){_0x3815b2['push'](_0x3815b2['shift']());}};_0x2ebd79(++_0xdeaa84);}(_0x60d4,0x1ab));var _0x460d=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x60d4[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x460d('0x0'));var util=require(_0x460d('0x1'));var moment=require(_0x460d('0x2'));var BPromise=require(_0x460d('0x3'));var rs=require(_0x460d('0x4'));var fs=require('fs');var Redis=require(_0x460d('0x5'));var db=require(_0x460d('0x6'))['db'];var utils=require(_0x460d('0x7'));var logger=require(_0x460d('0x8'))(_0x460d('0x9'));var config=require(_0x460d('0xa'));var jayson=require(_0x460d('0xb'));var client=jayson[_0x460d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b1328,_0x750b4c,_0x2c52ce){return new BPromise(function(_0x19b29e,_0x13b37f){return client[_0x460d('0xd')](_0x5b1328,_0x2c52ce)[_0x460d('0xe')](function(_0x391812){logger[_0x460d('0xf')](_0x460d('0x10'),_0x750b4c,_0x460d('0x11'));logger[_0x460d('0x12')](_0x460d('0x13'),_0x750b4c,'request\x20sent',JSON[_0x460d('0x14')](_0x391812));if(_0x391812['error']){if(_0x391812[_0x460d('0x15')][_0x460d('0x16')]===0x1f4){logger[_0x460d('0x15')](_0x460d('0x10'),_0x750b4c,_0x391812[_0x460d('0x15')][_0x460d('0x17')]);return _0x13b37f(_0x391812[_0x460d('0x15')][_0x460d('0x17')]);}logger['error'](_0x460d('0x10'),_0x750b4c,_0x391812[_0x460d('0x15')]['message']);return _0x19b29e(_0x391812[_0x460d('0x15')][_0x460d('0x17')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x750b4c,_0x460d('0x11'));_0x19b29e(_0x391812['result']['message']);}})[_0x460d('0x18')](function(_0x3798ba){logger[_0x460d('0x15')](_0x460d('0x10'),_0x750b4c,_0x3798ba);_0x13b37f(_0x3798ba);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index e182def..d7bb5d7 100644 --- a/server/api/analyticDefaultReport/index.js +++ b/server/api/analyticDefaultReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6194=['show','/:id/preview','/:id/run','run','query','post','create','put','/:id','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','get'];(function(_0x43396a,_0x3f3f7c){var _0x4bcc56=function(_0xc969e){while(--_0xc969e){_0x43396a['push'](_0x43396a['shift']());}};_0x4bcc56(++_0x3f3f7c);}(_0x6194,0x173));var _0x4619=function(_0x413b4f,_0x19b291){_0x413b4f=_0x413b4f-0x0;var _0x1ca30b=_0x6194[_0x413b4f];return _0x1ca30b;};'use strict';var multer=require('multer');var util=require(_0x4619('0x0'));var path=require(_0x4619('0x1'));var timeout=require('connect-timeout');var express=require(_0x4619('0x2'));var router=express['Router']();var fs_extra=require(_0x4619('0x3'));var auth=require(_0x4619('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4619('0x5'));var controller=require(_0x4619('0x6'));router['get']('/',auth[_0x4619('0x7')](),controller['index']);router[_0x4619('0x8')]('/:id',auth[_0x4619('0x7')](),controller[_0x4619('0x9')]);router[_0x4619('0x8')](_0x4619('0xa'),auth[_0x4619('0x7')](),controller['preview']);router[_0x4619('0x8')](_0x4619('0xb'),auth[_0x4619('0x7')](),controller[_0x4619('0xc')]);router[_0x4619('0x8')]('/:id/query',auth[_0x4619('0x7')](),controller[_0x4619('0xd')]);router[_0x4619('0xe')]('/',auth[_0x4619('0x7')](),controller[_0x4619('0xf')]);router[_0x4619('0x10')](_0x4619('0x11'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x4619('0x7')](),controller[_0x4619('0x12')]);module[_0x4619('0x13')]=router; \ No newline at end of file +var _0x4cf1=['get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x13408f,_0x5a7936){var _0x35d4ff=function(_0x4fc5bc){while(--_0x4fc5bc){_0x13408f['push'](_0x13408f['shift']());}};_0x35d4ff(++_0x5a7936);}(_0x4cf1,0x13c));var _0x14cf=function(_0x539bde,_0x14b7db){_0x539bde=_0x539bde-0x0;var _0x1718d4=_0x4cf1[_0x539bde];return _0x1718d4;};'use strict';var multer=require('multer');var util=require(_0x14cf('0x0'));var path=require(_0x14cf('0x1'));var timeout=require(_0x14cf('0x2'));var express=require(_0x14cf('0x3'));var router=express[_0x14cf('0x4')]();var fs_extra=require(_0x14cf('0x5'));var auth=require(_0x14cf('0x6'));var interaction=require(_0x14cf('0x7'));var config=require(_0x14cf('0x8'));var controller=require('./analyticDefaultReport.controller');router[_0x14cf('0x9')]('/',auth[_0x14cf('0xa')](),controller[_0x14cf('0xb')]);router[_0x14cf('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x14cf('0xc')]);router[_0x14cf('0x9')](_0x14cf('0xd'),auth[_0x14cf('0xa')](),controller[_0x14cf('0xe')]);router['get'](_0x14cf('0xf'),auth[_0x14cf('0xa')](),controller['run']);router[_0x14cf('0x9')](_0x14cf('0x10'),auth[_0x14cf('0xa')](),controller[_0x14cf('0x11')]);router[_0x14cf('0x12')]('/',auth[_0x14cf('0xa')](),controller[_0x14cf('0x13')]);router[_0x14cf('0x14')](_0x14cf('0x15'),auth[_0x14cf('0xa')](),controller[_0x14cf('0x16')]);router[_0x14cf('0x17')](_0x14cf('0x15'),auth[_0x14cf('0xa')](),controller['destroy']);module[_0x14cf('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index e108321..79cb7aa 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x30a1=['moment','exports','ENUM','csv','pdf','xlsx','DATE','STRING','Loading','scheduled','manual','INTEGER','UNSIGNED','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x30a1,0x141));var _0x130a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x30a1[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x130a('0x0'));var moment=require(_0x130a('0x1'));module[_0x130a('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x130a('0x3')](_0x130a('0x4'),_0x130a('0x5'),_0x130a('0x6')),'allowNull':![],'defaultValue':_0x130a('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x130a('0x7')]},'endDate':{'type':Sequelize[_0x130a('0x7')]},'status':{'type':Sequelize[_0x130a('0x8')],'defaultValue':_0x130a('0x9')},'type':{'type':Sequelize[_0x130a('0x3')]('manual',_0x130a('0xa')),'allowNull':![],'defaultValue':_0x130a('0xb')},'reportId':{'type':Sequelize[_0x130a('0xc')](0xb)[_0x130a('0xd')]},'reportType':{'type':Sequelize[_0x130a('0x8')]}}; \ No newline at end of file +var _0xa19a=['INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','pdf','xlsx','csv','DATE','Loading','manual','scheduled'];(function(_0x5dfe7f,_0xdbb004){var _0x43f978=function(_0x1b2a0e){while(--_0x1b2a0e){_0x5dfe7f['push'](_0x5dfe7f['shift']());}};_0x43f978(++_0xdbb004);}(_0xa19a,0x77));var _0xaa19=function(_0x5baeff,_0x3c0621){_0x5baeff=_0x5baeff-0x0;var _0x44c96e=_0xa19a[_0x5baeff];return _0x44c96e;};'use strict';var Sequelize=require(_0xaa19('0x0'));var moment=require(_0xaa19('0x1'));module['exports']={'name':{'type':Sequelize[_0xaa19('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xaa19('0x3')]('csv',_0xaa19('0x4'),_0xaa19('0x5')),'allowNull':![],'defaultValue':_0xaa19('0x6')},'savename':{'type':Sequelize[_0xaa19('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xaa19('0x7')]},'endDate':{'type':Sequelize[_0xaa19('0x7')]},'status':{'type':Sequelize[_0xaa19('0x2')],'defaultValue':_0xaa19('0x8')},'type':{'type':Sequelize[_0xaa19('0x3')](_0xaa19('0x9'),_0xaa19('0xa')),'allowNull':![],'defaultValue':_0xaa19('0x9')},'reportId':{'type':Sequelize[_0xaa19('0xb')](0xb)[_0xaa19('0xc')]},'reportType':{'type':Sequelize[_0xaa19('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index d161da3..9c43ce3 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x31df=['name','send','index','AnalyticExtractedReport','fieldName','type','key','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','rows','catch','rawAttributes','intersection','length','includeAll','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','format','%s.%s','output','toLowerCase','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','get','ExtractedReports','UserProfileResource','error','stack'];(function(_0x5c697e,_0x3f680d){var _0x962132=function(_0x29d9b1){while(--_0x29d9b1){_0x5c697e['push'](_0x5c697e['shift']());}};_0x962132(++_0x3f680d);}(_0x31df,0xff));var _0xf31d=function(_0x1920cd,_0x567031){_0x1920cd=_0x1920cd-0x0;var _0x35c72e=_0x31df[_0x1920cd];return _0x35c72e;};'use strict';var emlformat=require(_0xf31d('0x0'));var rimraf=require(_0xf31d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf31d('0x2'));var rp=require('request-promise');var moment=require(_0xf31d('0x3'));var BPromise=require(_0xf31d('0x4'));var Mustache=require(_0xf31d('0x5'));var util=require(_0xf31d('0x6'));var path=require(_0xf31d('0x7'));var sox=require(_0xf31d('0x8'));var csv=require(_0xf31d('0x9'));var ejs=require(_0xf31d('0xa'));var fs=require('fs');var fs_extra=require(_0xf31d('0xb'));var _=require('lodash');var squel=require(_0xf31d('0xc'));var crypto=require(_0xf31d('0xd'));var jsforce=require(_0xf31d('0xe'));var deskjs=require(_0xf31d('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf31d('0x10'));var Papa=require(_0xf31d('0x11'));var Redis=require(_0xf31d('0x12'));var authService=require(_0xf31d('0x13'));var qs=require(_0xf31d('0x14'));var as=require(_0xf31d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf31d('0x16'));var utils=require(_0xf31d('0x17'));var config=require(_0xf31d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf31d('0x19'))['db'];function respondWithStatusCode(_0x566f76,_0x22d9de){_0x22d9de=_0x22d9de||0xcc;return function(_0xbf50dd){if(_0xbf50dd){return _0x566f76[_0xf31d('0x1a')](_0x22d9de);}return _0x566f76[_0xf31d('0x1b')](_0x22d9de)[_0xf31d('0x1c')]();};}function respondWithResult(_0x5ef99b,_0x135ee5){_0x135ee5=_0x135ee5||0xc8;return function(_0x3cb48b){if(_0x3cb48b){return _0x5ef99b[_0xf31d('0x1b')](_0x135ee5)[_0xf31d('0x1d')](_0x3cb48b);}};}function respondWithFilteredResult(_0x3a2ad3,_0x20ce14){return function(_0x42ed4e){if(_0x42ed4e){var _0x89b5f6=typeof _0x20ce14[_0xf31d('0x1e')]==='undefined'&&typeof _0x20ce14['limit']===_0xf31d('0x1f');var _0x20d1f4=_0x42ed4e[_0xf31d('0x20')];var _0x4024b6=_0x89b5f6?0x0:_0x20ce14[_0xf31d('0x1e')];var _0x2fcfb8=_0x89b5f6?_0x42ed4e[_0xf31d('0x20')]:_0x20ce14[_0xf31d('0x1e')]+_0x20ce14[_0xf31d('0x21')];var _0x38a889;if(_0x2fcfb8>=_0x20d1f4){_0x2fcfb8=_0x20d1f4;_0x38a889=0xc8;}else{_0x38a889=0xce;}_0x3a2ad3[_0xf31d('0x1b')](_0x38a889);return _0x3a2ad3[_0xf31d('0x22')](_0xf31d('0x23'),_0x4024b6+'-'+_0x2fcfb8+'/'+_0x20d1f4)[_0xf31d('0x1d')](_0x42ed4e);}return null;};}function patchUpdates(_0x398b6e){return function(_0x4089a4){try{jsonpatch[_0xf31d('0x24')](_0x4089a4,_0x398b6e,!![]);}catch(_0xe46b40){return BPromise[_0xf31d('0x25')](_0xe46b40);}return _0x4089a4['save']();};}function saveUpdates(_0x3f87df,_0x932d2d){return function(_0x15bc80){if(_0x15bc80){return _0x15bc80['update'](_0x3f87df)[_0xf31d('0x26')](function(_0x37964b){return _0x37964b;});}return null;};}function removeEntity(_0x512bd5,_0x501768){return function(_0xdccdd2){if(_0xdccdd2){return _0xdccdd2[_0xf31d('0x27')]()[_0xf31d('0x26')](function(){var _0x515983=_0xdccdd2[_0xf31d('0x28')]({'plain':!![]});var _0x1feeb8=_0xf31d('0x29');return db[_0xf31d('0x2a')]['destroy']({'where':{'type':_0x1feeb8,'resourceId':_0x515983['id']}})['then'](function(){return _0xdccdd2;});})[_0xf31d('0x26')](function(){_0x512bd5[_0xf31d('0x1b')](0xcc)[_0xf31d('0x1c')]();});}};}function handleEntityNotFound(_0x1440ea,_0x114bb1){return function(_0x5b715b){if(!_0x5b715b){_0x1440ea['sendStatus'](0x194);}return _0x5b715b;};}function handleError(_0x3529a4,_0x288c18){_0x288c18=_0x288c18||0x1f4;return function(_0x3846d5){logger[_0xf31d('0x2b')](_0x3846d5[_0xf31d('0x2c')]);if(_0x3846d5[_0xf31d('0x2d')]){delete _0x3846d5[_0xf31d('0x2d')];}_0x3529a4['status'](_0x288c18)[_0xf31d('0x2e')](_0x3846d5);};}exports[_0xf31d('0x2f')]=function(_0x2066f1,_0x48e2b9){var _0x56cd8e={},_0x345fa4={},_0x539dd0={'count':0x0,'rows':[]};var _0x432277=_['map'](db[_0xf31d('0x30')]['rawAttributes'],function(_0x3aa3fd){return{'name':_0x3aa3fd[_0xf31d('0x31')],'type':_0x3aa3fd[_0xf31d('0x32')][_0xf31d('0x33')]};});_0x345fa4[_0xf31d('0x34')]=_[_0xf31d('0x35')](_0x432277,'name');_0x345fa4[_0xf31d('0x36')]=_[_0xf31d('0x37')](_0x2066f1[_0xf31d('0x36')]);_0x345fa4[_0xf31d('0x38')]=_['intersection'](_0x345fa4[_0xf31d('0x34')],_0x345fa4[_0xf31d('0x36')]);_0x56cd8e[_0xf31d('0x39')]=_['intersection'](_0x345fa4[_0xf31d('0x34')],qs['fields'](_0x2066f1[_0xf31d('0x36')][_0xf31d('0x3a')]));_0x56cd8e[_0xf31d('0x39')]=_0x56cd8e[_0xf31d('0x39')]['length']?_0x56cd8e['attributes']:_0x345fa4[_0xf31d('0x34')];if(!_0x2066f1[_0xf31d('0x36')][_0xf31d('0x3b')](_0xf31d('0x3c'))){_0x56cd8e[_0xf31d('0x21')]=qs[_0xf31d('0x21')](_0x2066f1[_0xf31d('0x36')]['limit']);_0x56cd8e[_0xf31d('0x1e')]=qs[_0xf31d('0x1e')](_0x2066f1[_0xf31d('0x36')][_0xf31d('0x1e')]);}_0x56cd8e[_0xf31d('0x3d')]=qs[_0xf31d('0x3e')](_0x2066f1[_0xf31d('0x36')]['sort']);_0x56cd8e[_0xf31d('0x3f')]=qs[_0xf31d('0x38')](_[_0xf31d('0x40')](_0x2066f1['query'],_0x345fa4[_0xf31d('0x38')]),_0x432277);if(_0x2066f1[_0xf31d('0x36')]['filter']){_0x56cd8e[_0xf31d('0x3f')]=_[_0xf31d('0x41')](_0x56cd8e[_0xf31d('0x3f')],{'$or':_[_0xf31d('0x35')](_0x432277,function(_0x45d0d2){if(_0x45d0d2[_0xf31d('0x32')]!==_0xf31d('0x42')){var _0x5a3294={};_0x5a3294[_0x45d0d2[_0xf31d('0x2d')]]={'$like':'%'+_0x2066f1[_0xf31d('0x36')]['filter']+'%'};return _0x5a3294;}})});}_0x56cd8e=_[_0xf31d('0x41')]({},_0x56cd8e,_0x2066f1['options']);var _0x40d043={'where':_0x56cd8e['where']};return db['AnalyticExtractedReport'][_0xf31d('0x20')](_0x40d043)[_0xf31d('0x26')](function(_0x15ef8a){_0x539dd0['count']=_0x15ef8a;if(_0x2066f1['query']['includeAll']){_0x56cd8e['include']=[{'all':!![]}];}return db[_0xf31d('0x30')]['findAll'](_0x56cd8e);})['then'](function(_0x209ab7){_0x539dd0[_0xf31d('0x43')]=_0x209ab7;return _0x539dd0;})[_0xf31d('0x26')](respondWithFilteredResult(_0x48e2b9,_0x56cd8e))[_0xf31d('0x44')](handleError(_0x48e2b9,null));};exports['show']=function(_0x12b255,_0x3d3fdb){var _0x3bebe7={'raw':!![],'where':{'id':_0x12b255['params']['id']}},_0xb8981f={};_0xb8981f['model']=_[_0xf31d('0x37')](db['AnalyticExtractedReport'][_0xf31d('0x45')]);_0xb8981f['query']=_[_0xf31d('0x37')](_0x12b255[_0xf31d('0x36')]);_0xb8981f['filters']=_[_0xf31d('0x46')](_0xb8981f[_0xf31d('0x34')],_0xb8981f[_0xf31d('0x36')]);_0x3bebe7[_0xf31d('0x39')]=_[_0xf31d('0x46')](_0xb8981f[_0xf31d('0x34')],qs[_0xf31d('0x3a')](_0x12b255[_0xf31d('0x36')][_0xf31d('0x3a')]));_0x3bebe7[_0xf31d('0x39')]=_0x3bebe7[_0xf31d('0x39')][_0xf31d('0x47')]?_0x3bebe7['attributes']:_0xb8981f[_0xf31d('0x34')];if(_0x12b255[_0xf31d('0x36')][_0xf31d('0x48')]){_0x3bebe7[_0xf31d('0x49')]=[{'all':!![]}];}_0x3bebe7=_['merge']({},_0x3bebe7,_0x12b255[_0xf31d('0x4a')]);return db[_0xf31d('0x30')][_0xf31d('0x4b')](_0x3bebe7)['then'](handleEntityNotFound(_0x3d3fdb,null))['then'](respondWithResult(_0x3d3fdb,null))[_0xf31d('0x44')](handleError(_0x3d3fdb,null));};exports['create']=function(_0xad83a3,_0xc825cb){return db[_0xf31d('0x30')][_0xf31d('0x4c')](_0xad83a3[_0xf31d('0x4d')],{})['then'](function(_0x475334){var _0x3277fc=_0xad83a3[_0xf31d('0x4e')][_0xf31d('0x28')]({'plain':!![]});if(!_0x3277fc)throw new Error(_0xf31d('0x4f'));if(_0x3277fc[_0xf31d('0x50')]===_0xf31d('0x4e')){var _0x23f130=_0x475334[_0xf31d('0x28')]({'plain':!![]});var _0x9c891b=_0xf31d('0x29');return db[_0xf31d('0x51')]['find']({'where':{'name':_0x9c891b,'userProfileId':_0x3277fc[_0xf31d('0x52')]},'raw':!![]})[_0xf31d('0x26')](function(_0xf1b995){if(_0xf1b995&&_0xf1b995[_0xf31d('0x53')]===0x0){return db[_0xf31d('0x2a')]['create']({'name':_0x23f130[_0xf31d('0x2d')],'resourceId':_0x23f130['id'],'type':_0xf1b995['name'],'sectionId':_0xf1b995['id']},{})[_0xf31d('0x26')](function(){return _0x475334;});}else{return _0x475334;}})[_0xf31d('0x44')](function(_0xfaddf6){logger[_0xf31d('0x2b')](_0xf31d('0x54'),_0xfaddf6);throw _0xfaddf6;});}return _0x475334;})[_0xf31d('0x26')](respondWithResult(_0xc825cb,0xc9))['catch'](handleError(_0xc825cb,null));};exports['update']=function(_0xb28f93,_0x400bc0){if(_0xb28f93[_0xf31d('0x4d')]['id']){delete _0xb28f93['body']['id'];}return db['AnalyticExtractedReport'][_0xf31d('0x4b')]({'where':{'id':_0xb28f93[_0xf31d('0x55')]['id']}})[_0xf31d('0x26')](handleEntityNotFound(_0x400bc0,null))[_0xf31d('0x26')](saveUpdates(_0xb28f93[_0xf31d('0x4d')],null))[_0xf31d('0x26')](respondWithResult(_0x400bc0,null))[_0xf31d('0x44')](handleError(_0x400bc0,null));};exports['destroy']=function(_0x3f8bb6,_0x3537d1){return db[_0xf31d('0x30')][_0xf31d('0x4b')]({'where':{'id':_0x3f8bb6[_0xf31d('0x55')]['id']}})[_0xf31d('0x26')](handleEntityNotFound(_0x3537d1,null))[_0xf31d('0x26')](removeEntity(_0x3537d1,null))[_0xf31d('0x44')](handleError(_0x3537d1,null));};exports[_0xf31d('0x56')]=function(_0x3e714c,_0x33dc15,_0x1be3a8){return db[_0xf31d('0x30')][_0xf31d('0x4b')]({'where':{'id':_0x3e714c[_0xf31d('0x55')]['id']},'attributes':['name',_0xf31d('0x57'),'savename','output'],'raw':!![]})[_0xf31d('0x26')](handleEntityNotFound(_0x33dc15,null))[_0xf31d('0x26')](function(_0x3fa64a){if(_0x3fa64a){if(!fs['existsSync'](path['join'](config[_0xf31d('0x58')],_0xf31d('0x59'),_0x3fa64a[_0xf31d('0x5a')]))){throw new db[(_0xf31d('0x5b'))][(_0xf31d('0x5c'))](_0xf31d('0x5d'));}if(_0x3e714c[_0xf31d('0x36')][_0xf31d('0x5e')]){return _0x33dc15[_0xf31d('0x1a')](0xc8);}return _0x33dc15[_0xf31d('0x56')](path[_0xf31d('0x5f')](config[_0xf31d('0x58')],'server/files/reports',_0x3fa64a[_0xf31d('0x5a')]),util[_0xf31d('0x60')](_0xf31d('0x61'),_0x3fa64a['basename']||_0x3fa64a[_0xf31d('0x2d')],_0x3fa64a[_0xf31d('0x62')][_0xf31d('0x63')]()));}})['catch'](handleError(_0x33dc15,null));}; \ No newline at end of file +var _0x2e5b=['catch','show','params','length','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','download','basename','savename','output','existsSync','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','join','%s.%s','toLowerCase','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','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','offset','limit','undefined','count','apply','reject','save','then','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','findAll','rows'];(function(_0x5166f8,_0x54812c){var _0x4a2a5b=function(_0xf820d0){while(--_0xf820d0){_0x5166f8['push'](_0x5166f8['shift']());}};_0x4a2a5b(++_0x54812c);}(_0x2e5b,0x7e));var _0xb2e5=function(_0x226fd5,_0x599267){_0x226fd5=_0x226fd5-0x0;var _0x5122b5=_0x2e5b[_0x226fd5];return _0x5122b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb2e5('0x0'));var zipdir=require(_0xb2e5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb2e5('0x2'));var BPromise=require(_0xb2e5('0x3'));var Mustache=require(_0xb2e5('0x4'));var util=require('util');var path=require(_0xb2e5('0x5'));var sox=require('sox');var csv=require(_0xb2e5('0x6'));var ejs=require(_0xb2e5('0x7'));var fs=require('fs');var fs_extra=require(_0xb2e5('0x8'));var _=require(_0xb2e5('0x9'));var squel=require(_0xb2e5('0xa'));var crypto=require(_0xb2e5('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb2e5('0x6'));var querystring=require(_0xb2e5('0xc'));var Papa=require(_0xb2e5('0xd'));var Redis=require(_0xb2e5('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb2e5('0xf'));var as=require(_0xb2e5('0x10'));var hardwareService=require(_0xb2e5('0x11'));var logger=require(_0xb2e5('0x12'))('api');var utils=require(_0xb2e5('0x13'));var config=require(_0xb2e5('0x14'));var licenseUtil=require(_0xb2e5('0x15'));var db=require(_0xb2e5('0x16'))['db'];function respondWithStatusCode(_0x2a5dc6,_0x34d9c9){_0x34d9c9=_0x34d9c9||0xcc;return function(_0x3575ed){if(_0x3575ed){return _0x2a5dc6[_0xb2e5('0x17')](_0x34d9c9);}return _0x2a5dc6[_0xb2e5('0x18')](_0x34d9c9)[_0xb2e5('0x19')]();};}function respondWithResult(_0x12a3ce,_0x1a2088){_0x1a2088=_0x1a2088||0xc8;return function(_0x314e){if(_0x314e){return _0x12a3ce[_0xb2e5('0x18')](_0x1a2088)['json'](_0x314e);}};}function respondWithFilteredResult(_0x273a27,_0x30589e){return function(_0x1242f0){if(_0x1242f0){var _0x1ce97b=typeof _0x30589e[_0xb2e5('0x1a')]==='undefined'&&typeof _0x30589e[_0xb2e5('0x1b')]===_0xb2e5('0x1c');var _0x461160=_0x1242f0[_0xb2e5('0x1d')];var _0x5ee708=_0x1ce97b?0x0:_0x30589e[_0xb2e5('0x1a')];var _0x38894c=_0x1ce97b?_0x1242f0[_0xb2e5('0x1d')]:_0x30589e[_0xb2e5('0x1a')]+_0x30589e[_0xb2e5('0x1b')];var _0x19f8e4;if(_0x38894c>=_0x461160){_0x38894c=_0x461160;_0x19f8e4=0xc8;}else{_0x19f8e4=0xce;}_0x273a27[_0xb2e5('0x18')](_0x19f8e4);return _0x273a27['set']('Content-Range',_0x5ee708+'-'+_0x38894c+'/'+_0x461160)['json'](_0x1242f0);}return null;};}function patchUpdates(_0x4b4c89){return function(_0x4a2cde){try{jsonpatch[_0xb2e5('0x1e')](_0x4a2cde,_0x4b4c89,!![]);}catch(_0x1a4259){return BPromise[_0xb2e5('0x1f')](_0x1a4259);}return _0x4a2cde[_0xb2e5('0x20')]();};}function saveUpdates(_0x22eaea,_0x59fc7c){return function(_0x5f1b30){if(_0x5f1b30){return _0x5f1b30['update'](_0x22eaea)[_0xb2e5('0x21')](function(_0x31668b){return _0x31668b;});}return null;};}function removeEntity(_0x59d121,_0x445281){return function(_0x460392){if(_0x460392){return _0x460392['destroy']()[_0xb2e5('0x21')](function(){var _0x1271fc=_0x460392['get']({'plain':!![]});var _0x294360=_0xb2e5('0x22');return db[_0xb2e5('0x23')]['destroy']({'where':{'type':_0x294360,'resourceId':_0x1271fc['id']}})[_0xb2e5('0x21')](function(){return _0x460392;});})[_0xb2e5('0x21')](function(){_0x59d121[_0xb2e5('0x18')](0xcc)[_0xb2e5('0x19')]();});}};}function handleEntityNotFound(_0x119f4b,_0xc30cb8){return function(_0x2be8f0){if(!_0x2be8f0){_0x119f4b[_0xb2e5('0x17')](0x194);}return _0x2be8f0;};}function handleError(_0x80ef7e,_0x362598){_0x362598=_0x362598||0x1f4;return function(_0x2f244b){logger[_0xb2e5('0x24')](_0x2f244b[_0xb2e5('0x25')]);if(_0x2f244b['name']){delete _0x2f244b[_0xb2e5('0x26')];}_0x80ef7e['status'](_0x362598)[_0xb2e5('0x27')](_0x2f244b);};}exports[_0xb2e5('0x28')]=function(_0x74e678,_0x3331ac){var _0x5a614f={},_0x176c3b={},_0x1fb0a8={'count':0x0,'rows':[]};var _0x1fb1d7=_[_0xb2e5('0x29')](db[_0xb2e5('0x2a')][_0xb2e5('0x2b')],function(_0x32f2fd){return{'name':_0x32f2fd[_0xb2e5('0x2c')],'type':_0x32f2fd['type'][_0xb2e5('0x2d')]};});_0x176c3b['model']=_[_0xb2e5('0x29')](_0x1fb1d7,'name');_0x176c3b[_0xb2e5('0x2e')]=_[_0xb2e5('0x2f')](_0x74e678[_0xb2e5('0x2e')]);_0x176c3b['filters']=_[_0xb2e5('0x30')](_0x176c3b[_0xb2e5('0x31')],_0x176c3b[_0xb2e5('0x2e')]);_0x5a614f[_0xb2e5('0x32')]=_['intersection'](_0x176c3b[_0xb2e5('0x31')],qs[_0xb2e5('0x33')](_0x74e678[_0xb2e5('0x2e')][_0xb2e5('0x33')]));_0x5a614f[_0xb2e5('0x32')]=_0x5a614f['attributes']['length']?_0x5a614f[_0xb2e5('0x32')]:_0x176c3b[_0xb2e5('0x31')];if(!_0x74e678[_0xb2e5('0x2e')][_0xb2e5('0x34')](_0xb2e5('0x35'))){_0x5a614f['limit']=qs[_0xb2e5('0x1b')](_0x74e678[_0xb2e5('0x2e')][_0xb2e5('0x1b')]);_0x5a614f['offset']=qs['offset'](_0x74e678['query'][_0xb2e5('0x1a')]);}_0x5a614f['order']=qs[_0xb2e5('0x36')](_0x74e678['query'][_0xb2e5('0x36')]);_0x5a614f[_0xb2e5('0x37')]=qs[_0xb2e5('0x38')](_[_0xb2e5('0x39')](_0x74e678[_0xb2e5('0x2e')],_0x176c3b['filters']),_0x1fb1d7);if(_0x74e678[_0xb2e5('0x2e')][_0xb2e5('0x3a')]){_0x5a614f['where']=_[_0xb2e5('0x3b')](_0x5a614f['where'],{'$or':_[_0xb2e5('0x29')](_0x1fb1d7,function(_0x5d9478){if(_0x5d9478['type']!==_0xb2e5('0x3c')){var _0x34d197={};_0x34d197[_0x5d9478['name']]={'$like':'%'+_0x74e678[_0xb2e5('0x2e')][_0xb2e5('0x3a')]+'%'};return _0x34d197;}})});}_0x5a614f=_['merge']({},_0x5a614f,_0x74e678['options']);var _0x4a616a={'where':_0x5a614f[_0xb2e5('0x37')]};return db['AnalyticExtractedReport'][_0xb2e5('0x1d')](_0x4a616a)['then'](function(_0x2eddf2){_0x1fb0a8[_0xb2e5('0x1d')]=_0x2eddf2;if(_0x74e678[_0xb2e5('0x2e')][_0xb2e5('0x3d')]){_0x5a614f['include']=[{'all':!![]}];}return db[_0xb2e5('0x2a')][_0xb2e5('0x3e')](_0x5a614f);})[_0xb2e5('0x21')](function(_0x3895c4){_0x1fb0a8[_0xb2e5('0x3f')]=_0x3895c4;return _0x1fb0a8;})[_0xb2e5('0x21')](respondWithFilteredResult(_0x3331ac,_0x5a614f))[_0xb2e5('0x40')](handleError(_0x3331ac,null));};exports[_0xb2e5('0x41')]=function(_0x583103,_0x4996da){var _0x2d03d4={'raw':!![],'where':{'id':_0x583103[_0xb2e5('0x42')]['id']}},_0x3d0b9d={};_0x3d0b9d[_0xb2e5('0x31')]=_['keys'](db[_0xb2e5('0x2a')][_0xb2e5('0x2b')]);_0x3d0b9d[_0xb2e5('0x2e')]=_[_0xb2e5('0x2f')](_0x583103[_0xb2e5('0x2e')]);_0x3d0b9d[_0xb2e5('0x38')]=_[_0xb2e5('0x30')](_0x3d0b9d[_0xb2e5('0x31')],_0x3d0b9d[_0xb2e5('0x2e')]);_0x2d03d4[_0xb2e5('0x32')]=_[_0xb2e5('0x30')](_0x3d0b9d['model'],qs[_0xb2e5('0x33')](_0x583103[_0xb2e5('0x2e')][_0xb2e5('0x33')]));_0x2d03d4[_0xb2e5('0x32')]=_0x2d03d4[_0xb2e5('0x32')][_0xb2e5('0x43')]?_0x2d03d4[_0xb2e5('0x32')]:_0x3d0b9d['model'];if(_0x583103['query'][_0xb2e5('0x3d')]){_0x2d03d4[_0xb2e5('0x44')]=[{'all':!![]}];}_0x2d03d4=_[_0xb2e5('0x3b')]({},_0x2d03d4,_0x583103['options']);return db[_0xb2e5('0x2a')][_0xb2e5('0x45')](_0x2d03d4)[_0xb2e5('0x21')](handleEntityNotFound(_0x4996da,null))[_0xb2e5('0x21')](respondWithResult(_0x4996da,null))[_0xb2e5('0x40')](handleError(_0x4996da,null));};exports[_0xb2e5('0x46')]=function(_0xb09436,_0x5323f9){return db['AnalyticExtractedReport'][_0xb2e5('0x46')](_0xb09436['body'],{})[_0xb2e5('0x21')](function(_0x557093){var _0x4defaa=_0xb09436[_0xb2e5('0x47')][_0xb2e5('0x48')]({'plain':!![]});if(!_0x4defaa)throw new Error(_0xb2e5('0x49'));if(_0x4defaa[_0xb2e5('0x4a')]===_0xb2e5('0x47')){var _0x1ff140=_0x557093[_0xb2e5('0x48')]({'plain':!![]});var _0xc6de14=_0xb2e5('0x22');return db[_0xb2e5('0x4b')][_0xb2e5('0x45')]({'where':{'name':_0xc6de14,'userProfileId':_0x4defaa[_0xb2e5('0x4c')]},'raw':!![]})[_0xb2e5('0x21')](function(_0x5d045c){if(_0x5d045c&&_0x5d045c[_0xb2e5('0x4d')]===0x0){return db[_0xb2e5('0x23')][_0xb2e5('0x46')]({'name':_0x1ff140[_0xb2e5('0x26')],'resourceId':_0x1ff140['id'],'type':_0x5d045c[_0xb2e5('0x26')],'sectionId':_0x5d045c['id']},{})[_0xb2e5('0x21')](function(){return _0x557093;});}else{return _0x557093;}})[_0xb2e5('0x40')](function(_0x372122){logger[_0xb2e5('0x24')](_0xb2e5('0x4e'),_0x372122);throw _0x372122;});}return _0x557093;})[_0xb2e5('0x21')](respondWithResult(_0x5323f9,0xc9))[_0xb2e5('0x40')](handleError(_0x5323f9,null));};exports[_0xb2e5('0x4f')]=function(_0x1bf1bc,_0x1b4327){if(_0x1bf1bc[_0xb2e5('0x50')]['id']){delete _0x1bf1bc[_0xb2e5('0x50')]['id'];}return db[_0xb2e5('0x2a')][_0xb2e5('0x45')]({'where':{'id':_0x1bf1bc[_0xb2e5('0x42')]['id']}})[_0xb2e5('0x21')](handleEntityNotFound(_0x1b4327,null))['then'](saveUpdates(_0x1bf1bc[_0xb2e5('0x50')],null))['then'](respondWithResult(_0x1b4327,null))[_0xb2e5('0x40')](handleError(_0x1b4327,null));};exports[_0xb2e5('0x51')]=function(_0x35c72a,_0x2969d0){return db[_0xb2e5('0x2a')][_0xb2e5('0x45')]({'where':{'id':_0x35c72a[_0xb2e5('0x42')]['id']}})[_0xb2e5('0x21')](handleEntityNotFound(_0x2969d0,null))[_0xb2e5('0x21')](removeEntity(_0x2969d0,null))[_0xb2e5('0x40')](handleError(_0x2969d0,null));};exports[_0xb2e5('0x52')]=function(_0x115136,_0x45b7ba,_0x506a57){return db[_0xb2e5('0x2a')][_0xb2e5('0x45')]({'where':{'id':_0x115136[_0xb2e5('0x42')]['id']},'attributes':['name',_0xb2e5('0x53'),_0xb2e5('0x54'),_0xb2e5('0x55')],'raw':!![]})[_0xb2e5('0x21')](handleEntityNotFound(_0x45b7ba,null))[_0xb2e5('0x21')](function(_0x1ca038){if(_0x1ca038){if(!fs[_0xb2e5('0x56')](path['join'](config[_0xb2e5('0x57')],_0xb2e5('0x58'),_0x1ca038[_0xb2e5('0x54')]))){throw new db[(_0xb2e5('0x59'))]['ValidationError'](_0xb2e5('0x5a'));}if(_0x115136[_0xb2e5('0x2e')][_0xb2e5('0x5b')]){return _0x45b7ba[_0xb2e5('0x17')](0xc8);}return _0x45b7ba[_0xb2e5('0x52')](path[_0xb2e5('0x5c')](config['root'],_0xb2e5('0x58'),_0x1ca038[_0xb2e5('0x54')]),util['format'](_0xb2e5('0x5d'),_0x1ca038[_0xb2e5('0x53')]||_0x1ca038[_0xb2e5('0x26')],_0x1ca038[_0xb2e5('0x55')][_0xb2e5('0x5e')]()));}})[_0xb2e5('0x40')](handleError(_0x45b7ba,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 656c95c..c026d01 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.model.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e16=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6e16,0x1b0));var _0x66e1=function(_0x460d00,_0xff714){_0x460d00=_0x460d00-0x0;var _0x4e6ddd=_0x6e16[_0x460d00];return _0x4e6ddd;};'use strict';var _=require(_0x66e1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x66e1('0x1'));var moment=require(_0x66e1('0x2'));var BPromise=require(_0x66e1('0x3'));var rp=require(_0x66e1('0x4'));var fs=require('fs');var path=require(_0x66e1('0x5'));var rimraf=require(_0x66e1('0x6'));var config=require(_0x66e1('0x7'));var attributes=require(_0x66e1('0x8'));module[_0x66e1('0x9')]=function(_0x3cc718,_0x4e07b9){return _0x3cc718['define'](_0x66e1('0xa'),attributes,{'tableName':_0x66e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2440=['./analyticExtractedReport.attributes','exports','analytics_extracted_reports','lodash','util','api','request-promise','rimraf'];(function(_0x199018,_0x24ee71){var _0x3741d4=function(_0x190025){while(--_0x190025){_0x199018['push'](_0x199018['shift']());}};_0x3741d4(++_0x24ee71);}(_0x2440,0x1db));var _0x0244=function(_0x196f51,_0x56ed2e){_0x196f51=_0x196f51-0x0;var _0x3c30ba=_0x2440[_0x196f51];return _0x3c30ba;};'use strict';var _=require(_0x0244('0x0'));var util=require(_0x0244('0x1'));var logger=require('../../config/logger')(_0x0244('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0244('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0244('0x4'));var config=require('../../config/environment');var attributes=require(_0x0244('0x5'));module[_0x0244('0x6')]=function(_0x525553,_0x19936b){return _0x525553['define']('AnalyticExtractedReport',attributes,{'tableName':_0x0244('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index df52e45..3ad8dad 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ac0=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0ac0,0x130));var _0x00ac=function(_0x99868f,_0xbdb8e7){_0x99868f=_0x99868f-0x0;var _0x27a71b=_0x0ac0[_0x99868f];return _0x27a71b;};'use strict';var _=require(_0x00ac('0x0'));var util=require(_0x00ac('0x1'));var moment=require(_0x00ac('0x2'));var BPromise=require('bluebird');var rs=require(_0x00ac('0x3'));var fs=require('fs');var Redis=require(_0x00ac('0x4'));var db=require(_0x00ac('0x5'))['db'];var utils=require(_0x00ac('0x6'));var logger=require(_0x00ac('0x7'))(_0x00ac('0x8'));var config=require(_0x00ac('0x9'));var jayson=require(_0x00ac('0xa'));var client=jayson['client'][_0x00ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa2a17e,_0x3546f0,_0x282faa){return new BPromise(function(_0x4427de,_0x121a9e){return client[_0x00ac('0xc')](_0xa2a17e,_0x282faa)['then'](function(_0x48c47e){logger[_0x00ac('0xd')](_0x00ac('0xe'),_0x3546f0,_0x00ac('0xf'));logger[_0x00ac('0x10')](_0x00ac('0x11'),_0x3546f0,'request\x20sent',JSON[_0x00ac('0x12')](_0x48c47e));if(_0x48c47e['error']){if(_0x48c47e[_0x00ac('0x13')]['code']===0x1f4){logger[_0x00ac('0x13')](_0x00ac('0xe'),_0x3546f0,_0x48c47e[_0x00ac('0x13')][_0x00ac('0x14')]);return _0x121a9e(_0x48c47e['error']['message']);}logger[_0x00ac('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3546f0,_0x48c47e['error'][_0x00ac('0x14')]);return _0x4427de(_0x48c47e[_0x00ac('0x13')]['message']);}else{logger[_0x00ac('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3546f0,'request\x20sent');_0x4427de(_0x48c47e[_0x00ac('0x15')][_0x00ac('0x14')]);}})['catch'](function(_0x66e4ba){logger[_0x00ac('0x13')](_0x00ac('0xe'),_0x3546f0,_0x66e4ba);_0x121a9e(_0x66e4ba);});});} \ No newline at end of file +var _0xc4b0=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','stringify','AnalyticExtractedReport,\x20%s,\x20%s','error','message','result','catch','lodash'];(function(_0x136619,_0x31c9b2){var _0x38c4a5=function(_0x10b74d){while(--_0x10b74d){_0x136619['push'](_0x136619['shift']());}};_0x38c4a5(++_0x31c9b2);}(_0xc4b0,0xfb));var _0x0c4b=function(_0x2c69a1,_0x30b54b){_0x2c69a1=_0x2c69a1-0x0;var _0x50e57d=_0xc4b0[_0x2c69a1];return _0x50e57d;};'use strict';var _=require(_0x0c4b('0x0'));var util=require('util');var moment=require(_0x0c4b('0x1'));var BPromise=require(_0x0c4b('0x2'));var rs=require(_0x0c4b('0x3'));var fs=require('fs');var Redis=require(_0x0c4b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c4b('0x5'));var logger=require(_0x0c4b('0x6'))(_0x0c4b('0x7'));var config=require(_0x0c4b('0x8'));var jayson=require(_0x0c4b('0x9'));var client=jayson[_0x0c4b('0xa')][_0x0c4b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5637ed,_0x4ace76,_0x2a1de0){return new BPromise(function(_0x52b5e8,_0x13067d){return client['request'](_0x5637ed,_0x2a1de0)[_0x0c4b('0xc')](function(_0x1b449d){logger[_0x0c4b('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4ace76,_0x0c4b('0xe'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x4ace76,_0x0c4b('0xe'),JSON[_0x0c4b('0xf')](_0x1b449d));if(_0x1b449d['error']){if(_0x1b449d['error']['code']===0x1f4){logger['error'](_0x0c4b('0x10'),_0x4ace76,_0x1b449d[_0x0c4b('0x11')][_0x0c4b('0x12')]);return _0x13067d(_0x1b449d[_0x0c4b('0x11')][_0x0c4b('0x12')]);}logger['error'](_0x0c4b('0x10'),_0x4ace76,_0x1b449d[_0x0c4b('0x11')]['message']);return _0x52b5e8(_0x1b449d['error'][_0x0c4b('0x12')]);}else{logger[_0x0c4b('0xd')](_0x0c4b('0x10'),_0x4ace76,_0x0c4b('0xe'));_0x52b5e8(_0x1b449d[_0x0c4b('0x13')][_0x0c4b('0x12')]);}})[_0x0c4b('0x14')](function(_0x1bbc52){logger[_0x0c4b('0x11')](_0x0c4b('0x10'),_0x4ace76,_0x1bbc52);_0x13067d(_0x1bbc52);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 9c61c8d..257f446 100644 --- a/server/api/analyticExtractedReport/index.js +++ b/server/api/analyticExtractedReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4f9=['/:id','/:id/download','download','post','create','put','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0x5e7b3a,_0x389a0b){var _0x1463bd=function(_0x3a031f){while(--_0x3a031f){_0x5e7b3a['push'](_0x5e7b3a['shift']());}};_0x1463bd(++_0x389a0b);}(_0xb4f9,0xef));var _0x9b4f=function(_0x42db3e,_0x4e0e33){_0x42db3e=_0x42db3e-0x0;var _0x1c86e2=_0xb4f9[_0x42db3e];return _0x1c86e2;};'use strict';var multer=require(_0x9b4f('0x0'));var util=require(_0x9b4f('0x1'));var path=require(_0x9b4f('0x2'));var timeout=require('connect-timeout');var express=require(_0x9b4f('0x3'));var router=express[_0x9b4f('0x4')]();var fs_extra=require(_0x9b4f('0x5'));var auth=require(_0x9b4f('0x6'));var interaction=require(_0x9b4f('0x7'));var config=require(_0x9b4f('0x8'));var controller=require(_0x9b4f('0x9'));router[_0x9b4f('0xa')]('/',auth[_0x9b4f('0xb')](),controller[_0x9b4f('0xc')]);router[_0x9b4f('0xa')](_0x9b4f('0xd'),auth[_0x9b4f('0xb')](),controller['show']);router[_0x9b4f('0xa')](_0x9b4f('0xe'),auth[_0x9b4f('0xb')](),controller[_0x9b4f('0xf')]);router[_0x9b4f('0x10')]('/',auth[_0x9b4f('0xb')](),controller[_0x9b4f('0x11')]);router[_0x9b4f('0x12')](_0x9b4f('0xd'),auth[_0x9b4f('0xb')](),controller['update']);router[_0x9b4f('0x13')](_0x9b4f('0xd'),auth[_0x9b4f('0xb')](),controller[_0x9b4f('0x14')]);module['exports']=router; \ No newline at end of file +var _0x42ff=['/:id/download','download','create','put','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x42ff,0x111));var _0xf42f=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x42ff[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0xf42f('0x0'));var util=require(_0xf42f('0x1'));var path=require('path');var timeout=require(_0xf42f('0x2'));var express=require(_0xf42f('0x3'));var router=express[_0xf42f('0x4')]();var fs_extra=require(_0xf42f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf42f('0x6'));var config=require('../../config/environment');var controller=require(_0xf42f('0x7'));router[_0xf42f('0x8')]('/',auth[_0xf42f('0x9')](),controller[_0xf42f('0xa')]);router[_0xf42f('0x8')]('/:id',auth[_0xf42f('0x9')](),controller[_0xf42f('0xb')]);router[_0xf42f('0x8')](_0xf42f('0xc'),auth[_0xf42f('0x9')](),controller[_0xf42f('0xd')]);router['post']('/',auth[_0xf42f('0x9')](),controller[_0xf42f('0xe')]);router[_0xf42f('0xf')]('/:id',auth[_0xf42f('0x9')](),controller['update']);router['delete'](_0xf42f('0x10'),auth[_0xf42f('0x9')](),controller[_0xf42f('0x11')]);module[_0xf42f('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 5225bbe..45bb778 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.attributes.js +++ b/server/api/analyticFieldReport/analyticFieldReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ca3=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x5a5648,_0x3b8b5e){var _0x598cdc=function(_0x3fbe16){while(--_0x3fbe16){_0x5a5648['push'](_0x5a5648['shift']());}};_0x598cdc(++_0x3b8b5e);}(_0x3ca3,0x116));var _0x33ca=function(_0x3deeb3,_0x243a11){_0x3deeb3=_0x3deeb3-0x0;var _0x29ed85=_0x3ca3[_0x3deeb3];return _0x29ed85;};'use strict';var Sequelize=require(_0x33ca('0x0'));module[_0x33ca('0x1')]={'field':{'type':Sequelize[_0x33ca('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x33ca('0x3')]},'format':{'type':Sequelize[_0x33ca('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x33ca('0x3')]},'custom':{'type':Sequelize[_0x33ca('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x6a7f=['exports','STRING','BOOLEAN','sequelize'];(function(_0x2f216d,_0x534bcc){var _0x2c3b4f=function(_0x1c46f1){while(--_0x1c46f1){_0x2f216d['push'](_0x2f216d['shift']());}};_0x2c3b4f(++_0x534bcc);}(_0x6a7f,0x9b));var _0xf6a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a7f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf6a7('0x0'));module[_0xf6a7('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xf6a7('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xf6a7('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xf6a7('0x2')]},'custom':{'type':Sequelize[_0xf6a7('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index e1f9c35..9ace334 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.controller.js +++ b/server/api/analyticFieldReport/analyticFieldReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x309d=['sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','catch','keys','length','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','rimraf','zip-dir','fast-json-patch','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','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','stack','name','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty'];(function(_0x56f5b6,_0x217e76){var _0x1e512b=function(_0x1c017f){while(--_0x1c017f){_0x56f5b6['push'](_0x56f5b6['shift']());}};_0x1e512b(++_0x217e76);}(_0x309d,0x1e5));var _0xd309=function(_0x369177,_0x235c2b){_0x369177=_0x369177-0x0;var _0x5f0948=_0x309d[_0x369177];return _0x5f0948;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd309('0x0'));var zipdir=require(_0xd309('0x1'));var jsonpatch=require(_0xd309('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd309('0x3'));var Mustache=require(_0xd309('0x4'));var util=require(_0xd309('0x5'));var path=require(_0xd309('0x6'));var sox=require('sox');var csv=require(_0xd309('0x7'));var ejs=require(_0xd309('0x8'));var fs=require('fs');var fs_extra=require(_0xd309('0x9'));var _=require(_0xd309('0xa'));var squel=require(_0xd309('0xb'));var crypto=require(_0xd309('0xc'));var jsforce=require(_0xd309('0xd'));var deskjs=require(_0xd309('0xe'));var toCsv=require(_0xd309('0x7'));var querystring=require('querystring');var Papa=require(_0xd309('0xf'));var Redis=require(_0xd309('0x10'));var authService=require(_0xd309('0x11'));var qs=require(_0xd309('0x12'));var as=require(_0xd309('0x13'));var hardwareService=require(_0xd309('0x14'));var logger=require(_0xd309('0x15'))(_0xd309('0x16'));var utils=require(_0xd309('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd309('0x18'));var db=require(_0xd309('0x19'))['db'];function respondWithStatusCode(_0x38bfca,_0x150d9b){_0x150d9b=_0x150d9b||0xcc;return function(_0x15bf42){if(_0x15bf42){return _0x38bfca[_0xd309('0x1a')](_0x150d9b);}return _0x38bfca[_0xd309('0x1b')](_0x150d9b)[_0xd309('0x1c')]();};}function respondWithResult(_0x5c3c1e,_0x63104){_0x63104=_0x63104||0xc8;return function(_0x57a52c){if(_0x57a52c){return _0x5c3c1e['status'](_0x63104)[_0xd309('0x1d')](_0x57a52c);}};}function respondWithFilteredResult(_0x6a418e,_0x20208e){return function(_0x367a6d){if(_0x367a6d){var _0xdb8022=typeof _0x20208e[_0xd309('0x1e')]==='undefined'&&typeof _0x20208e[_0xd309('0x1f')]===_0xd309('0x20');var _0x48e52f=_0x367a6d[_0xd309('0x21')];var _0x117c72=_0xdb8022?0x0:_0x20208e[_0xd309('0x1e')];var _0x561386=_0xdb8022?_0x367a6d[_0xd309('0x21')]:_0x20208e[_0xd309('0x1e')]+_0x20208e['limit'];var _0x4536ff;if(_0x561386>=_0x48e52f){_0x561386=_0x48e52f;_0x4536ff=0xc8;}else{_0x4536ff=0xce;}_0x6a418e['status'](_0x4536ff);return _0x6a418e[_0xd309('0x22')](_0xd309('0x23'),_0x117c72+'-'+_0x561386+'/'+_0x48e52f)[_0xd309('0x1d')](_0x367a6d);}return null;};}function patchUpdates(_0x392a57){return function(_0x283716){try{jsonpatch['apply'](_0x283716,_0x392a57,!![]);}catch(_0x76113){return BPromise[_0xd309('0x24')](_0x76113);}return _0x283716['save']();};}function saveUpdates(_0x70c943,_0xce8afc){return function(_0x4c731f){if(_0x4c731f){return _0x4c731f[_0xd309('0x25')](_0x70c943)[_0xd309('0x26')](function(_0x49a39d){return _0x49a39d;});}return null;};}function removeEntity(_0x5bbad3,_0x1963d5){return function(_0x2abe12){if(_0x2abe12){return _0x2abe12[_0xd309('0x27')]()[_0xd309('0x26')](function(){_0x5bbad3[_0xd309('0x1b')](0xcc)[_0xd309('0x1c')]();});}};}function handleEntityNotFound(_0x3a2acb,_0x2f4d43){return function(_0x4f16de){if(!_0x4f16de){_0x3a2acb['sendStatus'](0x194);}return _0x4f16de;};}function handleError(_0x1a8053,_0x1532b1){_0x1532b1=_0x1532b1||0x1f4;return function(_0x48f323){logger['error'](_0x48f323[_0xd309('0x28')]);if(_0x48f323[_0xd309('0x29')]){delete _0x48f323[_0xd309('0x29')];}_0x1a8053[_0xd309('0x1b')](_0x1532b1)['send'](_0x48f323);};}exports['index']=function(_0x404e11,_0x115c53){var _0x1b4aa6={},_0x150a49={},_0x59b048={'count':0x0,'rows':[]};var _0x232b61=_[_0xd309('0x2a')](db[_0xd309('0x2b')][_0xd309('0x2c')],function(_0x1671b5){return{'name':_0x1671b5[_0xd309('0x2d')],'type':_0x1671b5['type'][_0xd309('0x2e')]};});_0x150a49[_0xd309('0x2f')]=_[_0xd309('0x2a')](_0x232b61,_0xd309('0x29'));_0x150a49[_0xd309('0x30')]=_['keys'](_0x404e11[_0xd309('0x30')]);_0x150a49[_0xd309('0x31')]=_[_0xd309('0x32')](_0x150a49['model'],_0x150a49['query']);_0x1b4aa6['attributes']=_['intersection'](_0x150a49[_0xd309('0x2f')],qs[_0xd309('0x33')](_0x404e11[_0xd309('0x30')]['fields']));_0x1b4aa6[_0xd309('0x34')]=_0x1b4aa6[_0xd309('0x34')]['length']?_0x1b4aa6[_0xd309('0x34')]:_0x150a49['model'];if(!_0x404e11[_0xd309('0x30')][_0xd309('0x35')]('nolimit')){_0x1b4aa6[_0xd309('0x1f')]=qs[_0xd309('0x1f')](_0x404e11[_0xd309('0x30')]['limit']);_0x1b4aa6[_0xd309('0x1e')]=qs[_0xd309('0x1e')](_0x404e11[_0xd309('0x30')][_0xd309('0x1e')]);}_0x1b4aa6['order']=qs[_0xd309('0x36')](_0x404e11[_0xd309('0x30')][_0xd309('0x36')]);_0x1b4aa6[_0xd309('0x37')]=qs[_0xd309('0x31')](_[_0xd309('0x38')](_0x404e11[_0xd309('0x30')],_0x150a49[_0xd309('0x31')]),_0x232b61);if(_0x404e11[_0xd309('0x30')][_0xd309('0x39')]){_0x1b4aa6[_0xd309('0x37')]=_[_0xd309('0x3a')](_0x1b4aa6[_0xd309('0x37')],{'$or':_[_0xd309('0x2a')](_0x232b61,function(_0x56143e){if(_0x56143e[_0xd309('0x3b')]!==_0xd309('0x3c')){var _0x1a7073={};_0x1a7073[_0x56143e[_0xd309('0x29')]]={'$like':'%'+_0x404e11[_0xd309('0x30')][_0xd309('0x39')]+'%'};return _0x1a7073;}})});}_0x1b4aa6=_['merge']({},_0x1b4aa6,_0x404e11[_0xd309('0x3d')]);var _0x5e909b={'where':_0x1b4aa6[_0xd309('0x37')]};return db[_0xd309('0x2b')][_0xd309('0x21')](_0x5e909b)['then'](function(_0x2667ba){_0x59b048['count']=_0x2667ba;if(_0x404e11[_0xd309('0x30')]['includeAll']){_0x1b4aa6[_0xd309('0x3e')]=[{'all':!![]}];}return db[_0xd309('0x2b')][_0xd309('0x3f')](_0x1b4aa6);})[_0xd309('0x26')](function(_0x499d3e){_0x59b048['rows']=_0x499d3e;return _0x59b048;})[_0xd309('0x26')](respondWithFilteredResult(_0x115c53,_0x1b4aa6))[_0xd309('0x40')](handleError(_0x115c53,null));};exports['show']=function(_0xa5baa1,_0x59d4ed){var _0x77ec13={'raw':![],'where':{'id':_0xa5baa1['params']['id']}},_0x2f5c61={};_0x2f5c61[_0xd309('0x2f')]=_[_0xd309('0x41')](db['AnalyticFieldReport'][_0xd309('0x2c')]);_0x2f5c61[_0xd309('0x30')]=_[_0xd309('0x41')](_0xa5baa1[_0xd309('0x30')]);_0x2f5c61[_0xd309('0x31')]=_['intersection'](_0x2f5c61[_0xd309('0x2f')],_0x2f5c61[_0xd309('0x30')]);_0x77ec13[_0xd309('0x34')]=_[_0xd309('0x32')](_0x2f5c61['model'],qs[_0xd309('0x33')](_0xa5baa1[_0xd309('0x30')]['fields']));_0x77ec13[_0xd309('0x34')]=_0x77ec13[_0xd309('0x34')][_0xd309('0x42')]?_0x77ec13[_0xd309('0x34')]:_0x2f5c61[_0xd309('0x2f')];if(_0xa5baa1[_0xd309('0x30')]['includeAll']){_0x77ec13[_0xd309('0x3e')]=[{'all':!![]}];}_0x77ec13=_[_0xd309('0x3a')]({},_0x77ec13,_0xa5baa1[_0xd309('0x3d')]);return db[_0xd309('0x2b')][_0xd309('0x43')](_0x77ec13)[_0xd309('0x26')](handleEntityNotFound(_0x59d4ed,null))['then'](respondWithResult(_0x59d4ed,null))[_0xd309('0x40')](handleError(_0x59d4ed,null));};exports[_0xd309('0x44')]=function(_0x3ffb7e,_0x12052f){return db['AnalyticFieldReport'][_0xd309('0x44')](_0x3ffb7e[_0xd309('0x45')],{})['then'](respondWithResult(_0x12052f,0xc9))['catch'](handleError(_0x12052f,null));};exports[_0xd309('0x46')]=function(_0x2d9efc,_0x143620){return db['AnalyticFieldReport'][_0xd309('0x46')](_0x2d9efc[_0xd309('0x45')],{'raw':![],'individualHooks':!![]})[_0xd309('0x26')](respondWithResult(_0x143620,0xc9))[_0xd309('0x40')](handleError(_0x143620,null));};exports[_0xd309('0x25')]=function(_0x416299,_0x2ab7be){if(_0x416299[_0xd309('0x45')]['id']){delete _0x416299[_0xd309('0x45')]['id'];}return db[_0xd309('0x2b')][_0xd309('0x43')]({'where':{'id':_0x416299[_0xd309('0x47')]['id']}})[_0xd309('0x26')](handleEntityNotFound(_0x2ab7be,null))[_0xd309('0x26')](saveUpdates(_0x416299[_0xd309('0x45')],null))[_0xd309('0x26')](respondWithResult(_0x2ab7be,null))[_0xd309('0x40')](handleError(_0x2ab7be,null));};exports[_0xd309('0x27')]=function(_0x2257b1,_0x3f98b0){return db['AnalyticFieldReport'][_0xd309('0x43')]({'where':{'id':_0x2257b1[_0xd309('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f98b0,null))[_0xd309('0x26')](removeEntity(_0x3f98b0,null))[_0xd309('0x40')](handleError(_0x3f98b0,null));};exports[_0xd309('0x48')]=function(_0x748f6f,_0x430b59){return db[_0xd309('0x2b')][_0xd309('0x27')]({'where':{'id':_0x748f6f[_0xd309('0x30')][_0xd309('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0xd309('0x26')](respondWithResult(_0x430b59,0xcc))[_0xd309('0x40')](handleError(_0x430b59,null));};exports[_0xd309('0x4a')]=function(_0x355c4c,_0x55d0ad,_0x1b5f84){return db[_0xd309('0x4b')]['findOne']({'where':{'id':_0x355c4c[_0xd309('0x47')]['id']}})['then'](handleEntityNotFound(_0x55d0ad,null))[_0xd309('0x26')](function(_0x57ebc1){if(_0x57ebc1){return db[_0xd309('0x4c')]['transaction'](function(_0x34c240){return db['AnalyticFieldReport'][_0xd309('0x27')]({'where':{'CustomReportId':_0x355c4c[_0xd309('0x47')]['id']},'transaction':_0x34c240})[_0xd309('0x26')](function(_0x28d79c){var _0x33ea2e=_['map'](_0x355c4c[_0xd309('0x45')],function(_0x2564a2){delete _0x2564a2['id'];_0x2564a2['CustomReportId']=_0x355c4c['params']['id'];return _0x2564a2;});return db['AnalyticFieldReport'][_0xd309('0x46')](_0x33ea2e,{'transaction':_0x34c240});});})['then'](function(){return db[_0xd309('0x2b')][_0xd309('0x3f')]({'where':{'CustomReportId':_0x355c4c[_0xd309('0x47')]['id']}});});}})[_0xd309('0x26')](respondWithResult(_0x55d0ad,null))[_0xd309('0x40')](handleError(_0x55d0ad,null));}; \ No newline at end of file +var _0x6da0=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','AnalyticFieldReport','include','find','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x4f7e37,_0x291c9f){var _0x442ea8=function(_0x169420){while(--_0x169420){_0x4f7e37['push'](_0x4f7e37['shift']());}};_0x442ea8(++_0x291c9f);}(_0x6da0,0x10d));var _0x06da=function(_0x32bb62,_0x424698){_0x32bb62=_0x32bb62-0x0;var _0x528cf9=_0x6da0[_0x32bb62];return _0x528cf9;};'use strict';var emlformat=require(_0x06da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x06da('0x1'));var jsonpatch=require(_0x06da('0x2'));var rp=require(_0x06da('0x3'));var moment=require(_0x06da('0x4'));var BPromise=require(_0x06da('0x5'));var Mustache=require(_0x06da('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x06da('0x7'));var squel=require(_0x06da('0x8'));var crypto=require(_0x06da('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x06da('0xa'));var querystring=require(_0x06da('0xb'));var Papa=require(_0x06da('0xc'));var Redis=require('ioredis');var authService=require(_0x06da('0xd'));var qs=require(_0x06da('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x06da('0xf'));var utils=require(_0x06da('0x10'));var config=require(_0x06da('0x11'));var licenseUtil=require(_0x06da('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x104c4d,_0x1a0af9){_0x1a0af9=_0x1a0af9||0xcc;return function(_0x343e44){if(_0x343e44){return _0x104c4d[_0x06da('0x13')](_0x1a0af9);}return _0x104c4d[_0x06da('0x14')](_0x1a0af9)['end']();};}function respondWithResult(_0x107964,_0x2a8c50){_0x2a8c50=_0x2a8c50||0xc8;return function(_0x5f4011){if(_0x5f4011){return _0x107964[_0x06da('0x14')](_0x2a8c50)[_0x06da('0x15')](_0x5f4011);}};}function respondWithFilteredResult(_0x33a388,_0xae9d86){return function(_0x58fa31){if(_0x58fa31){var _0x3cda5c=typeof _0xae9d86['offset']==='undefined'&&typeof _0xae9d86['limit']==='undefined';var _0x38aba0=_0x58fa31[_0x06da('0x16')];var _0x845d33=_0x3cda5c?0x0:_0xae9d86[_0x06da('0x17')];var _0xad57b6=_0x3cda5c?_0x58fa31[_0x06da('0x16')]:_0xae9d86['offset']+_0xae9d86[_0x06da('0x18')];var _0x27ff6e;if(_0xad57b6>=_0x38aba0){_0xad57b6=_0x38aba0;_0x27ff6e=0xc8;}else{_0x27ff6e=0xce;}_0x33a388[_0x06da('0x14')](_0x27ff6e);return _0x33a388[_0x06da('0x19')](_0x06da('0x1a'),_0x845d33+'-'+_0xad57b6+'/'+_0x38aba0)['json'](_0x58fa31);}return null;};}function patchUpdates(_0x3eca92){return function(_0x55472c){try{jsonpatch[_0x06da('0x1b')](_0x55472c,_0x3eca92,!![]);}catch(_0x5586d2){return BPromise[_0x06da('0x1c')](_0x5586d2);}return _0x55472c[_0x06da('0x1d')]();};}function saveUpdates(_0x1f43ac,_0x50c654){return function(_0x47f1ad){if(_0x47f1ad){return _0x47f1ad[_0x06da('0x1e')](_0x1f43ac)['then'](function(_0x47ad66){return _0x47ad66;});}return null;};}function removeEntity(_0x1bd345,_0x50322d){return function(_0x54f825){if(_0x54f825){return _0x54f825[_0x06da('0x1f')]()[_0x06da('0x20')](function(){_0x1bd345[_0x06da('0x14')](0xcc)[_0x06da('0x21')]();});}};}function handleEntityNotFound(_0x5bd3c1,_0x361c01){return function(_0x5796cc){if(!_0x5796cc){_0x5bd3c1['sendStatus'](0x194);}return _0x5796cc;};}function handleError(_0x2e8275,_0x53e657){_0x53e657=_0x53e657||0x1f4;return function(_0x3bdcf4){logger[_0x06da('0x22')](_0x3bdcf4[_0x06da('0x23')]);if(_0x3bdcf4['name']){delete _0x3bdcf4[_0x06da('0x24')];}_0x2e8275[_0x06da('0x14')](_0x53e657)['send'](_0x3bdcf4);};}exports['index']=function(_0x7f4dad,_0x41db17){var _0x1c68a8={},_0x193e8b={},_0x4581ac={'count':0x0,'rows':[]};var _0x198efd=_[_0x06da('0x25')](db['AnalyticFieldReport'][_0x06da('0x26')],function(_0x2b89e2){return{'name':_0x2b89e2[_0x06da('0x27')],'type':_0x2b89e2[_0x06da('0x28')][_0x06da('0x29')]};});_0x193e8b[_0x06da('0x2a')]=_['map'](_0x198efd,_0x06da('0x24'));_0x193e8b[_0x06da('0x2b')]=_[_0x06da('0x2c')](_0x7f4dad['query']);_0x193e8b[_0x06da('0x2d')]=_[_0x06da('0x2e')](_0x193e8b['model'],_0x193e8b['query']);_0x1c68a8['attributes']=_[_0x06da('0x2e')](_0x193e8b[_0x06da('0x2a')],qs[_0x06da('0x2f')](_0x7f4dad[_0x06da('0x2b')][_0x06da('0x2f')]));_0x1c68a8[_0x06da('0x30')]=_0x1c68a8[_0x06da('0x30')][_0x06da('0x31')]?_0x1c68a8[_0x06da('0x30')]:_0x193e8b[_0x06da('0x2a')];if(!_0x7f4dad[_0x06da('0x2b')][_0x06da('0x32')](_0x06da('0x33'))){_0x1c68a8[_0x06da('0x18')]=qs[_0x06da('0x18')](_0x7f4dad[_0x06da('0x2b')][_0x06da('0x18')]);_0x1c68a8[_0x06da('0x17')]=qs[_0x06da('0x17')](_0x7f4dad[_0x06da('0x2b')][_0x06da('0x17')]);}_0x1c68a8[_0x06da('0x34')]=qs[_0x06da('0x35')](_0x7f4dad[_0x06da('0x2b')][_0x06da('0x35')]);_0x1c68a8['where']=qs[_0x06da('0x2d')](_[_0x06da('0x36')](_0x7f4dad['query'],_0x193e8b[_0x06da('0x2d')]),_0x198efd);if(_0x7f4dad['query'][_0x06da('0x37')]){_0x1c68a8[_0x06da('0x38')]=_[_0x06da('0x39')](_0x1c68a8[_0x06da('0x38')],{'$or':_[_0x06da('0x25')](_0x198efd,function(_0x126d37){if(_0x126d37[_0x06da('0x28')]!==_0x06da('0x3a')){var _0x301440={};_0x301440[_0x126d37[_0x06da('0x24')]]={'$like':'%'+_0x7f4dad['query']['filter']+'%'};return _0x301440;}})});}_0x1c68a8=_[_0x06da('0x39')]({},_0x1c68a8,_0x7f4dad[_0x06da('0x3b')]);var _0xd7d936={'where':_0x1c68a8[_0x06da('0x38')]};return db['AnalyticFieldReport']['count'](_0xd7d936)[_0x06da('0x20')](function(_0x5ce879){_0x4581ac[_0x06da('0x16')]=_0x5ce879;if(_0x7f4dad[_0x06da('0x2b')][_0x06da('0x3c')]){_0x1c68a8['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x06da('0x3d')](_0x1c68a8);})[_0x06da('0x20')](function(_0x3e0dd5){_0x4581ac[_0x06da('0x3e')]=_0x3e0dd5;return _0x4581ac;})[_0x06da('0x20')](respondWithFilteredResult(_0x41db17,_0x1c68a8))[_0x06da('0x3f')](handleError(_0x41db17,null));};exports[_0x06da('0x40')]=function(_0x9d43a9,_0x14b029){var _0x59ec94={'raw':![],'where':{'id':_0x9d43a9[_0x06da('0x41')]['id']}},_0x3ab527={};_0x3ab527[_0x06da('0x2a')]=_['keys'](db[_0x06da('0x42')][_0x06da('0x26')]);_0x3ab527[_0x06da('0x2b')]=_[_0x06da('0x2c')](_0x9d43a9[_0x06da('0x2b')]);_0x3ab527['filters']=_[_0x06da('0x2e')](_0x3ab527[_0x06da('0x2a')],_0x3ab527[_0x06da('0x2b')]);_0x59ec94[_0x06da('0x30')]=_[_0x06da('0x2e')](_0x3ab527['model'],qs[_0x06da('0x2f')](_0x9d43a9[_0x06da('0x2b')][_0x06da('0x2f')]));_0x59ec94[_0x06da('0x30')]=_0x59ec94['attributes'][_0x06da('0x31')]?_0x59ec94['attributes']:_0x3ab527['model'];if(_0x9d43a9[_0x06da('0x2b')][_0x06da('0x3c')]){_0x59ec94[_0x06da('0x43')]=[{'all':!![]}];}_0x59ec94=_[_0x06da('0x39')]({},_0x59ec94,_0x9d43a9[_0x06da('0x3b')]);return db[_0x06da('0x42')][_0x06da('0x44')](_0x59ec94)['then'](handleEntityNotFound(_0x14b029,null))[_0x06da('0x20')](respondWithResult(_0x14b029,null))['catch'](handleError(_0x14b029,null));};exports['create']=function(_0x5e8fd5,_0x3240a4){return db[_0x06da('0x42')][_0x06da('0x45')](_0x5e8fd5[_0x06da('0x46')],{})['then'](respondWithResult(_0x3240a4,0xc9))[_0x06da('0x3f')](handleError(_0x3240a4,null));};exports[_0x06da('0x47')]=function(_0x48726c,_0x2774f2){return db[_0x06da('0x42')][_0x06da('0x47')](_0x48726c[_0x06da('0x46')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2774f2,0xc9))['catch'](handleError(_0x2774f2,null));};exports[_0x06da('0x1e')]=function(_0x1028b5,_0x2a120d){if(_0x1028b5[_0x06da('0x46')]['id']){delete _0x1028b5[_0x06da('0x46')]['id'];}return db[_0x06da('0x42')][_0x06da('0x44')]({'where':{'id':_0x1028b5['params']['id']}})['then'](handleEntityNotFound(_0x2a120d,null))['then'](saveUpdates(_0x1028b5[_0x06da('0x46')],null))[_0x06da('0x20')](respondWithResult(_0x2a120d,null))[_0x06da('0x3f')](handleError(_0x2a120d,null));};exports['destroy']=function(_0x38543a,_0x13b33f){return db[_0x06da('0x42')][_0x06da('0x44')]({'where':{'id':_0x38543a[_0x06da('0x41')]['id']}})['then'](handleEntityNotFound(_0x13b33f,null))['then'](removeEntity(_0x13b33f,null))[_0x06da('0x3f')](handleError(_0x13b33f,null));};exports['bulkDestroy']=function(_0x50fdc9,_0x2c4785){return db[_0x06da('0x42')][_0x06da('0x1f')]({'where':{'id':_0x50fdc9['query'][_0x06da('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x06da('0x20')](respondWithResult(_0x2c4785,0xcc))[_0x06da('0x3f')](handleError(_0x2c4785,null));};exports[_0x06da('0x49')]=function(_0x15b6ae,_0x34a569,_0x59e4a6){return db[_0x06da('0x4a')][_0x06da('0x4b')]({'where':{'id':_0x15b6ae[_0x06da('0x41')]['id']}})['then'](handleEntityNotFound(_0x34a569,null))['then'](function(_0x45988a){if(_0x45988a){return db[_0x06da('0x4c')][_0x06da('0x4d')](function(_0x437991){return db[_0x06da('0x42')]['destroy']({'where':{'CustomReportId':_0x15b6ae[_0x06da('0x41')]['id']},'transaction':_0x437991})['then'](function(_0xdad84c){var _0x39cee0=_[_0x06da('0x25')](_0x15b6ae[_0x06da('0x46')],function(_0x4aae99){delete _0x4aae99['id'];_0x4aae99[_0x06da('0x4e')]=_0x15b6ae['params']['id'];return _0x4aae99;});return db['AnalyticFieldReport'][_0x06da('0x47')](_0x39cee0,{'transaction':_0x437991});});})[_0x06da('0x20')](function(){return db[_0x06da('0x42')][_0x06da('0x3d')]({'where':{'CustomReportId':_0x15b6ae[_0x06da('0x41')]['id']}});});}})[_0x06da('0x20')](respondWithResult(_0x34a569,null))[_0x06da('0x3f')](handleError(_0x34a569,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 4ab3e59..15cd0cd 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.model.js +++ b/server/api/analyticFieldReport/analyticFieldReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b4c=['analytics_report_fields','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x133156,_0x109b02){var _0xb6d904=function(_0x2dc8ba){while(--_0x2dc8ba){_0x133156['push'](_0x133156['shift']());}};_0xb6d904(++_0x109b02);}(_0x9b4c,0x198));var _0xc9b4=function(_0x4fe19c,_0x45d0fe){_0x4fe19c=_0x4fe19c-0x0;var _0x952ac7=_0x9b4c[_0x4fe19c];return _0x952ac7;};'use strict';var _=require('lodash');var util=require(_0xc9b4('0x0'));var logger=require(_0xc9b4('0x1'))(_0xc9b4('0x2'));var moment=require(_0xc9b4('0x3'));var BPromise=require(_0xc9b4('0x4'));var rp=require(_0xc9b4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc9b4('0x6'));var config=require(_0xc9b4('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0xc9b4('0x8')]=function(_0x28420f,_0x255689){return _0x28420f[_0xc9b4('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0xc9b4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bee=['AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x4a322e,_0x43fe03){var _0xb8a78b=function(_0x1922a0){while(--_0x1922a0){_0x4a322e['push'](_0x4a322e['shift']());}};_0xb8a78b(++_0x43fe03);}(_0x9bee,0x120));var _0xe9be=function(_0x9cd23a,_0xee570b){_0x9cd23a=_0x9cd23a-0x0;var _0x1fbe49=_0x9bee[_0x9cd23a];return _0x1fbe49;};'use strict';var _=require(_0xe9be('0x0'));var util=require('util');var logger=require(_0xe9be('0x1'))(_0xe9be('0x2'));var moment=require(_0xe9be('0x3'));var BPromise=require('bluebird');var rp=require(_0xe9be('0x4'));var fs=require('fs');var path=require(_0xe9be('0x5'));var rimraf=require(_0xe9be('0x6'));var config=require(_0xe9be('0x7'));var attributes=require(_0xe9be('0x8'));module[_0xe9be('0x9')]=function(_0x1a57b3,_0x1c5636){return _0x1a57b3[_0xe9be('0xa')](_0xe9be('0xb'),attributes,{'tableName':_0xe9be('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index c3cfcbb..610869c 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.rpc.js +++ b/server/api/analyticFieldReport/analyticFieldReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4caf=['util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x17ed7d,_0x5547ce){var _0x74132a=function(_0x397908){while(--_0x397908){_0x17ed7d['push'](_0x17ed7d['shift']());}};_0x74132a(++_0x5547ce);}(_0x4caf,0xf0));var _0xf4ca=function(_0x3dad9d,_0x24c027){_0x3dad9d=_0x3dad9d-0x0;var _0x314e3a=_0x4caf[_0x3dad9d];return _0x314e3a;};'use strict';var _=require('lodash');var util=require(_0xf4ca('0x0'));var moment=require('moment');var BPromise=require(_0xf4ca('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf4ca('0x2'))['db'];var utils=require(_0xf4ca('0x3'));var logger=require(_0xf4ca('0x4'))(_0xf4ca('0x5'));var config=require(_0xf4ca('0x6'));var jayson=require(_0xf4ca('0x7'));var client=jayson[_0xf4ca('0x8')][_0xf4ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x87c1e7,_0x44683e,_0x2fb810){return new BPromise(function(_0x59761e,_0x373b6a){return client['request'](_0x87c1e7,_0x2fb810)[_0xf4ca('0xa')](function(_0x18e901){logger[_0xf4ca('0xb')](_0xf4ca('0xc'),_0x44683e,_0xf4ca('0xd'));logger[_0xf4ca('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x44683e,'request\x20sent',JSON[_0xf4ca('0xf')](_0x18e901));if(_0x18e901['error']){if(_0x18e901[_0xf4ca('0x10')][_0xf4ca('0x11')]===0x1f4){logger[_0xf4ca('0x10')](_0xf4ca('0xc'),_0x44683e,_0x18e901[_0xf4ca('0x10')]['message']);return _0x373b6a(_0x18e901['error'][_0xf4ca('0x12')]);}logger[_0xf4ca('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x44683e,_0x18e901['error']['message']);return _0x59761e(_0x18e901['error'][_0xf4ca('0x12')]);}else{logger['info'](_0xf4ca('0xc'),_0x44683e,'request\x20sent');_0x59761e(_0x18e901['result'][_0xf4ca('0x12')]);}})[_0xf4ca('0x13')](function(_0x1e2aff){logger[_0xf4ca('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x44683e,_0x1e2aff);_0x373b6a(_0x1e2aff);});});} \ No newline at end of file +var _0x1614=['catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','then','request\x20sent','debug','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info'];(function(_0x38a4da,_0x51dd44){var _0x58f069=function(_0x56e36e){while(--_0x56e36e){_0x38a4da['push'](_0x38a4da['shift']());}};_0x58f069(++_0x51dd44);}(_0x1614,0x16a));var _0x4161=function(_0x4cd21c,_0x35fa45){_0x4cd21c=_0x4cd21c-0x0;var _0x5d8e5e=_0x1614[_0x4cd21c];return _0x5d8e5e;};'use strict';var _=require('lodash');var util=require(_0x4161('0x0'));var moment=require('moment');var BPromise=require(_0x4161('0x1'));var rs=require(_0x4161('0x2'));var fs=require('fs');var Redis=require(_0x4161('0x3'));var db=require(_0x4161('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4161('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4161('0x6'));var client=jayson[_0x4161('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a1209,_0x20838a,_0x1867a7){return new BPromise(function(_0x51daf0,_0x47e84e){return client[_0x4161('0x8')](_0x3a1209,_0x1867a7)[_0x4161('0x9')](function(_0x1836da){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x20838a,_0x4161('0xa'));logger[_0x4161('0xb')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x20838a,'request\x20sent',JSON[_0x4161('0xc')](_0x1836da));if(_0x1836da[_0x4161('0xd')]){if(_0x1836da[_0x4161('0xd')][_0x4161('0xe')]===0x1f4){logger[_0x4161('0xd')](_0x4161('0xf'),_0x20838a,_0x1836da[_0x4161('0xd')][_0x4161('0x10')]);return _0x47e84e(_0x1836da[_0x4161('0xd')][_0x4161('0x10')]);}logger[_0x4161('0xd')](_0x4161('0xf'),_0x20838a,_0x1836da['error'][_0x4161('0x10')]);return _0x51daf0(_0x1836da[_0x4161('0xd')][_0x4161('0x10')]);}else{logger[_0x4161('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x20838a,_0x4161('0xa'));_0x51daf0(_0x1836da['result'][_0x4161('0x10')]);}})[_0x4161('0x12')](function(_0x5af787){logger[_0x4161('0xd')](_0x4161('0xf'),_0x20838a,_0x5af787);_0x47e84e(_0x5af787);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index c4e9cc2..e423d4f 100644 --- a/server/api/analyticFieldReport/index.js +++ b/server/api/analyticFieldReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x53b9e9,_0x582db1){var _0x370056=function(_0x301788){while(--_0x301788){_0x53b9e9['push'](_0x53b9e9['shift']());}};_0x370056(++_0x582db1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x45cb01,_0x3df56b){var _0x20e409=function(_0x233f77){while(--_0x233f77){_0x45cb01['push'](_0x45cb01['shift']());}};_0x20e409(++_0x3df56b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index d57a3c5..346c76d 100644 --- a/server/api/analyticMetric/analyticMetric.attributes.js +++ b/server/api/analyticMetric/analyticMetric.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ffe=['STRING','TEXT','sequelize','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4ffe,0x172));var _0xe4ff=function(_0x15f852,_0x530d85){_0x15f852=_0x15f852-0x0;var _0x387460=_0x4ffe[_0x15f852];return _0x387460;};'use strict';var Sequelize=require(_0xe4ff('0x0'));module[_0xe4ff('0x1')]={'name':{'type':Sequelize[_0xe4ff('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xe4ff('0x2')]},'metric':{'type':Sequelize[_0xe4ff('0x3')]},'description':{'type':Sequelize[_0xe4ff('0x2')]}}; \ No newline at end of file +var _0xf53d=['exports','name','STRING','TEXT','sequelize'];(function(_0x319858,_0x7f2819){var _0x1fbade=function(_0x485282){while(--_0x485282){_0x319858['push'](_0x319858['shift']());}};_0x1fbade(++_0x7f2819);}(_0xf53d,0x199));var _0xdf53=function(_0x33e06f,_0x51be64){_0x33e06f=_0x33e06f-0x0;var _0x4675fd=_0xf53d[_0x33e06f];return _0x4675fd;};'use strict';var Sequelize=require(_0xdf53('0x0'));module[_0xdf53('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdf53('0x2')},'table':{'type':Sequelize[_0xdf53('0x3')]},'metric':{'type':Sequelize[_0xdf53('0x4')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 5fb1551..ce855c7 100644 --- a/server/api/analyticMetric/analyticMetric.controller.js +++ b/server/api/analyticMetric/analyticMetric.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0xaf74e9,_0x1095cb){var _0x305840=function(_0x5b800c){while(--_0x5b800c){_0xaf74e9['push'](_0xaf74e9['shift']());}};_0x305840(++_0x1095cb);}(_0x55ca,0x126));var _0xa55c=function(_0x3bae28,_0x5ca4f5){_0x3bae28=_0x3bae28-0x0;var _0xb431b=_0x55ca[_0x3bae28];return _0xb431b;};'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 +var _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0x26313e,_0x343448){var _0x16dd88=function(_0x265c77){while(--_0x265c77){_0x26313e['push'](_0x26313e['shift']());}};_0x16dd88(++_0x343448);}(_0x425d,0x1e0));var _0xd425=function(_0xb66df,_0x4fb5ce){_0xb66df=_0xb66df-0x0;var _0x42a702=_0x425d[_0xb66df];return _0x42a702;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 0373302..af5a2c5 100644 --- a/server/api/analyticMetric/analyticMetric.model.js +++ b/server/api/analyticMetric/analyticMetric.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0309=['rimraf','../../config/environment','./analyticMetric.attributes','define','analytics_metrics','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x0309,0x165));var _0x9030=function(_0xcfd2fd,_0x40a3cf){_0xcfd2fd=_0xcfd2fd-0x0;var _0x2ad9b8=_0x0309[_0xcfd2fd];return _0x2ad9b8;};'use strict';var _=require(_0x9030('0x0'));var util=require('util');var logger=require(_0x9030('0x1'))('api');var moment=require(_0x9030('0x2'));var BPromise=require(_0x9030('0x3'));var rp=require(_0x9030('0x4'));var fs=require('fs');var path=require(_0x9030('0x5'));var rimraf=require(_0x9030('0x6'));var config=require(_0x9030('0x7'));var attributes=require(_0x9030('0x8'));module['exports']=function(_0x5a3334,_0x1c9c7b){return _0x5a3334[_0x9030('0x9')]('AnalyticMetric',attributes,{'tableName':_0x9030('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbbd=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash'];(function(_0x346220,_0x177b7b){var _0x455e0c=function(_0x22daf7){while(--_0x22daf7){_0x346220['push'](_0x346220['shift']());}};_0x455e0c(++_0x177b7b);}(_0xbbbd,0x86));var _0xdbbb=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xbbbd[_0x4ed520];return _0x4415a6;};'use strict';var _=require(_0xdbbb('0x0'));var util=require(_0xdbbb('0x1'));var logger=require(_0xdbbb('0x2'))(_0xdbbb('0x3'));var moment=require(_0xdbbb('0x4'));var BPromise=require(_0xdbbb('0x5'));var rp=require(_0xdbbb('0x6'));var fs=require('fs');var path=require(_0xdbbb('0x7'));var rimraf=require(_0xdbbb('0x8'));var config=require(_0xdbbb('0x9'));var attributes=require(_0xdbbb('0xa'));module[_0xdbbb('0xb')]=function(_0x4e9523,_0xa5399d){return _0x4e9523[_0xdbbb('0xc')](_0xdbbb('0xd'),attributes,{'tableName':_0xdbbb('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 7b9d6a4..758a3b8 100644 --- a/server/api/analyticMetric/analyticMetric.rpc.js +++ b/server/api/analyticMetric/analyticMetric.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x320d=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','request\x20sent','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','info'];(function(_0x2828f8,_0x39a528){var _0x4f5aae=function(_0x3cc63b){while(--_0x3cc63b){_0x2828f8['push'](_0x2828f8['shift']());}};_0x4f5aae(++_0x39a528);}(_0x320d,0x135));var _0xd320=function(_0x2d0ea5,_0x2654ec){_0x2d0ea5=_0x2d0ea5-0x0;var _0x42b033=_0x320d[_0x2d0ea5];return _0x42b033;};'use strict';var _=require(_0xd320('0x0'));var util=require(_0xd320('0x1'));var moment=require(_0xd320('0x2'));var BPromise=require('bluebird');var rs=require(_0xd320('0x3'));var fs=require('fs');var Redis=require(_0xd320('0x4'));var db=require(_0xd320('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd320('0x6'))(_0xd320('0x7'));var config=require(_0xd320('0x8'));var jayson=require(_0xd320('0x9'));var client=jayson['client'][_0xd320('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b83a8,_0x5b7863,_0x5e17a5){return new BPromise(function(_0x39cf55,_0x2fcf8b){return client[_0xd320('0xb')](_0x2b83a8,_0x5e17a5)[_0xd320('0xc')](function(_0x22bab4){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x5b7863,'request\x20sent');logger[_0xd320('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x5b7863,_0xd320('0xe'),JSON[_0xd320('0xf')](_0x22bab4));if(_0x22bab4[_0xd320('0x10')]){if(_0x22bab4[_0xd320('0x10')][_0xd320('0x11')]===0x1f4){logger['error'](_0xd320('0x12'),_0x5b7863,_0x22bab4['error'][_0xd320('0x13')]);return _0x2fcf8b(_0x22bab4[_0xd320('0x10')][_0xd320('0x13')]);}logger[_0xd320('0x10')](_0xd320('0x12'),_0x5b7863,_0x22bab4['error'][_0xd320('0x13')]);return _0x39cf55(_0x22bab4['error'][_0xd320('0x13')]);}else{logger[_0xd320('0x14')](_0xd320('0x12'),_0x5b7863,'request\x20sent');_0x39cf55(_0x22bab4['result'][_0xd320('0x13')]);}})[_0xd320('0x15')](function(_0x159978){logger[_0xd320('0x10')](_0xd320('0x12'),_0x5b7863,_0x159978);_0x2fcf8b(_0x159978);});});} \ No newline at end of file +var _0x3866=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','message','AnalyticMetric,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x3cc977,_0x5a080e){var _0x21f180=function(_0x5da3f9){while(--_0x5da3f9){_0x3cc977['push'](_0x3cc977['shift']());}};_0x21f180(++_0x5a080e);}(_0x3866,0x145));var _0x6386=function(_0x2cd9a5,_0x4ccf41){_0x2cd9a5=_0x2cd9a5-0x0;var _0x33cb6e=_0x3866[_0x2cd9a5];return _0x33cb6e;};'use strict';var _=require('lodash');var util=require(_0x6386('0x0'));var moment=require(_0x6386('0x1'));var BPromise=require(_0x6386('0x2'));var rs=require(_0x6386('0x3'));var fs=require('fs');var Redis=require(_0x6386('0x4'));var db=require(_0x6386('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6386('0x6'))('rpc');var config=require(_0x6386('0x7'));var jayson=require(_0x6386('0x8'));var client=jayson[_0x6386('0x9')][_0x6386('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x244173,_0x1c9370,_0x37fa21){return new BPromise(function(_0x34ef4f,_0x36feee){return client['request'](_0x244173,_0x37fa21)[_0x6386('0xb')](function(_0x50de48){logger[_0x6386('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x1c9370,_0x6386('0xd'));logger[_0x6386('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x1c9370,_0x6386('0xd'),JSON[_0x6386('0xf')](_0x50de48));if(_0x50de48[_0x6386('0x10')]){if(_0x50de48[_0x6386('0x10')][_0x6386('0x11')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x1c9370,_0x50de48[_0x6386('0x10')][_0x6386('0x12')]);return _0x36feee(_0x50de48[_0x6386('0x10')]['message']);}logger[_0x6386('0x10')](_0x6386('0x13'),_0x1c9370,_0x50de48[_0x6386('0x10')][_0x6386('0x12')]);return _0x34ef4f(_0x50de48[_0x6386('0x10')][_0x6386('0x12')]);}else{logger['info'](_0x6386('0x13'),_0x1c9370,_0x6386('0xd'));_0x34ef4f(_0x50de48[_0x6386('0x14')][_0x6386('0x12')]);}})[_0x6386('0x15')](function(_0x3e7f11){logger['error'](_0x6386('0x13'),_0x1c9370,_0x3e7f11);_0x36feee(_0x3e7f11);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 0761dff..c1f88c2 100644 --- a/server/api/analyticMetric/index.js +++ b/server/api/analyticMetric/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3148=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','post','create','put','/:id','delete','destroy','multer'];(function(_0x33350c,_0x1f85d8){var _0x3a1eeb=function(_0x21863d){while(--_0x21863d){_0x33350c['push'](_0x33350c['shift']());}};_0x3a1eeb(++_0x1f85d8);}(_0x3148,0x1d3));var _0x8314=function(_0x5bff9e,_0x39ea3a){_0x5bff9e=_0x5bff9e-0x0;var _0x7f42ef=_0x3148[_0x5bff9e];return _0x7f42ef;};'use strict';var multer=require(_0x8314('0x0'));var util=require(_0x8314('0x1'));var path=require('path');var timeout=require(_0x8314('0x2'));var express=require(_0x8314('0x3'));var router=express[_0x8314('0x4')]();var fs_extra=require(_0x8314('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8314('0x6'));var config=require(_0x8314('0x7'));var controller=require(_0x8314('0x8'));router[_0x8314('0x9')]('/',auth[_0x8314('0xa')](),controller[_0x8314('0xb')]);router[_0x8314('0x9')]('/:id',auth[_0x8314('0xa')](),controller['show']);router[_0x8314('0xc')]('/',auth[_0x8314('0xa')](),controller[_0x8314('0xd')]);router[_0x8314('0xe')](_0x8314('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x8314('0x10')](_0x8314('0xf'),auth[_0x8314('0xa')](),controller[_0x8314('0x11')]);module['exports']=router; \ No newline at end of file +var _0x22ed=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','isAuthenticated','show','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4b8f44,_0x5c9193){var _0x5b1265=function(_0x742f67){while(--_0x742f67){_0x4b8f44['push'](_0x4b8f44['shift']());}};_0x5b1265(++_0x5c9193);}(_0x22ed,0x1a9));var _0xd22e=function(_0x4c1078,_0xe10656){_0x4c1078=_0x4c1078-0x0;var _0x3f347d=_0x22ed[_0x4c1078];return _0x3f347d;};'use strict';var multer=require(_0xd22e('0x0'));var util=require(_0xd22e('0x1'));var path=require(_0xd22e('0x2'));var timeout=require(_0xd22e('0x3'));var express=require(_0xd22e('0x4'));var router=express[_0xd22e('0x5')]();var fs_extra=require(_0xd22e('0x6'));var auth=require(_0xd22e('0x7'));var interaction=require(_0xd22e('0x8'));var config=require(_0xd22e('0x9'));var controller=require(_0xd22e('0xa'));router[_0xd22e('0xb')]('/',auth['isAuthenticated'](),controller[_0xd22e('0xc')]);router[_0xd22e('0xb')]('/:id',auth[_0xd22e('0xd')](),controller[_0xd22e('0xe')]);router['post']('/',auth[_0xd22e('0xd')](),controller['create']);router['put'](_0xd22e('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xd22e('0xf'),auth[_0xd22e('0xd')](),controller[_0xd22e('0x10')]);module[_0xd22e('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index d14c109..a4585ab 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js +++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20cb=['exports','TEXT'];(function(_0xb89eab,_0x905eba){var _0x1706ba=function(_0x411ad4){while(--_0x411ad4){_0xb89eab['push'](_0xb89eab['shift']());}};_0x1706ba(++_0x905eba);}(_0x20cb,0x12a));var _0xb20c=function(_0x454f02,_0x4af1d9){_0x454f02=_0x454f02-0x0;var _0x46a8e7=_0x20cb[_0x454f02];return _0x46a8e7;};'use strict';var Sequelize=require('sequelize');module[_0xb20c('0x0')]={'tree':{'type':Sequelize[_0xb20c('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x4c14=['sequelize','exports','TEXT'];(function(_0x2007cf,_0x23a105){var _0x17d6c0=function(_0x329a29){while(--_0x329a29){_0x2007cf['push'](_0x2007cf['shift']());}};_0x17d6c0(++_0x23a105);}(_0x4c14,0xcc));var _0x44c1=function(_0x2343d9,_0x5c1cf7){_0x2343d9=_0x2343d9-0x0;var _0x3d488f=_0x4c14[_0x2343d9];return _0x3d488f;};'use strict';var Sequelize=require(_0x44c1('0x0'));module[_0x44c1('0x1')]={'tree':{'type':Sequelize[_0x44c1('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index af7cb21..87f3ad4 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.controller.js +++ b/server/api/analyticTreeReport/analyticTreeReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10b0=['../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','map','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x56ec94,_0x539e9e){var _0x5a88e3=function(_0x562e25){while(--_0x562e25){_0x56ec94['push'](_0x56ec94['shift']());}};_0x5a88e3(++_0x539e9e);}(_0x10b0,0x11b));var _0x010b=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x10b0[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0x010b('0x0'));var rimraf=require(_0x010b('0x1'));var zipdir=require(_0x010b('0x2'));var jsonpatch=require(_0x010b('0x3'));var rp=require(_0x010b('0x4'));var moment=require(_0x010b('0x5'));var BPromise=require(_0x010b('0x6'));var Mustache=require(_0x010b('0x7'));var util=require(_0x010b('0x8'));var path=require(_0x010b('0x9'));var sox=require('sox');var csv=require(_0x010b('0xa'));var ejs=require(_0x010b('0xb'));var fs=require('fs');var fs_extra=require(_0x010b('0xc'));var _=require(_0x010b('0xd'));var squel=require(_0x010b('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x010b('0xf'));var toCsv=require(_0x010b('0xa'));var querystring=require(_0x010b('0x10'));var Papa=require(_0x010b('0x11'));var Redis=require('ioredis');var authService=require(_0x010b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x010b('0x13'));var hardwareService=require(_0x010b('0x14'));var logger=require(_0x010b('0x15'))(_0x010b('0x16'));var utils=require('../../config/utils');var config=require(_0x010b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x453bd9,_0x59701b){_0x59701b=_0x59701b||0xcc;return function(_0x292fab){if(_0x292fab){return _0x453bd9[_0x010b('0x18')](_0x59701b);}return _0x453bd9[_0x010b('0x19')](_0x59701b)[_0x010b('0x1a')]();};}function respondWithResult(_0x2c7d20,_0x229747){_0x229747=_0x229747||0xc8;return function(_0x34970d){if(_0x34970d){return _0x2c7d20[_0x010b('0x19')](_0x229747)[_0x010b('0x1b')](_0x34970d);}};}function respondWithFilteredResult(_0xff86d7,_0x51d392){return function(_0x4dad68){if(_0x4dad68){var _0x33fb4c=typeof _0x51d392[_0x010b('0x1c')]===_0x010b('0x1d')&&typeof _0x51d392[_0x010b('0x1e')]==='undefined';var _0x4c7002=_0x4dad68[_0x010b('0x1f')];var _0x26f011=_0x33fb4c?0x0:_0x51d392[_0x010b('0x1c')];var _0x406cde=_0x33fb4c?_0x4dad68[_0x010b('0x1f')]:_0x51d392['offset']+_0x51d392[_0x010b('0x1e')];var _0x277004;if(_0x406cde>=_0x4c7002){_0x406cde=_0x4c7002;_0x277004=0xc8;}else{_0x277004=0xce;}_0xff86d7[_0x010b('0x19')](_0x277004);return _0xff86d7[_0x010b('0x20')]('Content-Range',_0x26f011+'-'+_0x406cde+'/'+_0x4c7002)['json'](_0x4dad68);}return null;};}function patchUpdates(_0x22dda2){return function(_0x12800f){try{jsonpatch[_0x010b('0x21')](_0x12800f,_0x22dda2,!![]);}catch(_0x51ee03){return BPromise[_0x010b('0x22')](_0x51ee03);}return _0x12800f[_0x010b('0x23')]();};}function saveUpdates(_0x5b867e,_0x183111){return function(_0x333f70){if(_0x333f70){return _0x333f70[_0x010b('0x24')](_0x5b867e)[_0x010b('0x25')](function(_0x3070e7){return _0x3070e7;});}return null;};}function removeEntity(_0x5c2f0b,_0x42fffc){return function(_0x8ecda7){if(_0x8ecda7){return _0x8ecda7['destroy']()['then'](function(){_0x5c2f0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e8f65,_0x3c3dd1){return function(_0xda66f1){if(!_0xda66f1){_0x5e8f65[_0x010b('0x18')](0x194);}return _0xda66f1;};}function handleError(_0x1e9992,_0x11ff97){_0x11ff97=_0x11ff97||0x1f4;return function(_0x4987a7){logger[_0x010b('0x26')](_0x4987a7[_0x010b('0x27')]);if(_0x4987a7[_0x010b('0x28')]){delete _0x4987a7[_0x010b('0x28')];}_0x1e9992[_0x010b('0x19')](_0x11ff97)[_0x010b('0x29')](_0x4987a7);};}exports[_0x010b('0x2a')]=function(_0x3ab26a,_0x1c14ae){var _0x10b53d={},_0x56bc87={},_0x40edea={'count':0x0,'rows':[]};var _0x35675e=_['map'](db[_0x010b('0x2b')][_0x010b('0x2c')],function(_0x3ba0fa){return{'name':_0x3ba0fa[_0x010b('0x2d')],'type':_0x3ba0fa[_0x010b('0x2e')][_0x010b('0x2f')]};});_0x56bc87[_0x010b('0x30')]=_['map'](_0x35675e,_0x010b('0x28'));_0x56bc87[_0x010b('0x31')]=_[_0x010b('0x32')](_0x3ab26a[_0x010b('0x31')]);_0x56bc87[_0x010b('0x33')]=_[_0x010b('0x34')](_0x56bc87[_0x010b('0x30')],_0x56bc87[_0x010b('0x31')]);_0x10b53d[_0x010b('0x35')]=_[_0x010b('0x34')](_0x56bc87[_0x010b('0x30')],qs[_0x010b('0x36')](_0x3ab26a['query'][_0x010b('0x36')]));_0x10b53d[_0x010b('0x35')]=_0x10b53d[_0x010b('0x35')]['length']?_0x10b53d[_0x010b('0x35')]:_0x56bc87[_0x010b('0x30')];if(!_0x3ab26a['query']['hasOwnProperty'](_0x010b('0x37'))){_0x10b53d['limit']=qs[_0x010b('0x1e')](_0x3ab26a['query'][_0x010b('0x1e')]);_0x10b53d['offset']=qs[_0x010b('0x1c')](_0x3ab26a[_0x010b('0x31')][_0x010b('0x1c')]);}_0x10b53d[_0x010b('0x38')]=qs[_0x010b('0x39')](_0x3ab26a[_0x010b('0x31')]['sort']);_0x10b53d[_0x010b('0x3a')]=qs[_0x010b('0x33')](_['pick'](_0x3ab26a[_0x010b('0x31')],_0x56bc87[_0x010b('0x33')]),_0x35675e);if(_0x3ab26a['query'][_0x010b('0x3b')]){_0x10b53d[_0x010b('0x3a')]=_['merge'](_0x10b53d[_0x010b('0x3a')],{'$or':_[_0x010b('0x3c')](_0x35675e,function(_0x355b9b){if(_0x355b9b['type']!==_0x010b('0x3d')){var _0x16835a={};_0x16835a[_0x355b9b['name']]={'$like':'%'+_0x3ab26a[_0x010b('0x31')][_0x010b('0x3b')]+'%'};return _0x16835a;}})});}_0x10b53d=_[_0x010b('0x3e')]({},_0x10b53d,_0x3ab26a['options']);var _0x690aa7={'where':_0x10b53d['where']};return db[_0x010b('0x2b')][_0x010b('0x1f')](_0x690aa7)['then'](function(_0x2e2cc2){_0x40edea['count']=_0x2e2cc2;if(_0x3ab26a[_0x010b('0x31')][_0x010b('0x3f')]){_0x10b53d[_0x010b('0x40')]=[{'all':!![]}];}return db[_0x010b('0x2b')][_0x010b('0x41')](_0x10b53d);})['then'](function(_0x235692){_0x40edea[_0x010b('0x42')]=_0x235692;return _0x40edea;})[_0x010b('0x25')](respondWithFilteredResult(_0x1c14ae,_0x10b53d))[_0x010b('0x43')](handleError(_0x1c14ae,null));};exports[_0x010b('0x44')]=function(_0x5cdfbe,_0x274030){var _0x1b9028={'raw':!![],'where':{'id':_0x5cdfbe[_0x010b('0x45')]['id']}},_0x18b519={};_0x18b519[_0x010b('0x30')]=_[_0x010b('0x32')](db[_0x010b('0x2b')][_0x010b('0x2c')]);_0x18b519[_0x010b('0x31')]=_['keys'](_0x5cdfbe[_0x010b('0x31')]);_0x18b519[_0x010b('0x33')]=_[_0x010b('0x34')](_0x18b519['model'],_0x18b519[_0x010b('0x31')]);_0x1b9028[_0x010b('0x35')]=_[_0x010b('0x34')](_0x18b519[_0x010b('0x30')],qs[_0x010b('0x36')](_0x5cdfbe[_0x010b('0x31')][_0x010b('0x36')]));_0x1b9028[_0x010b('0x35')]=_0x1b9028[_0x010b('0x35')][_0x010b('0x46')]?_0x1b9028['attributes']:_0x18b519[_0x010b('0x30')];if(_0x5cdfbe[_0x010b('0x31')][_0x010b('0x3f')]){_0x1b9028['include']=[{'all':!![]}];}_0x1b9028=_[_0x010b('0x3e')]({},_0x1b9028,_0x5cdfbe[_0x010b('0x47')]);return db[_0x010b('0x2b')][_0x010b('0x48')](_0x1b9028)[_0x010b('0x25')](handleEntityNotFound(_0x274030,null))[_0x010b('0x25')](respondWithResult(_0x274030,null))[_0x010b('0x43')](handleError(_0x274030,null));};exports[_0x010b('0x49')]=function(_0x4e9f5c,_0x377612){return db['AnalyticTreeReport'][_0x010b('0x49')](_0x4e9f5c[_0x010b('0x4a')],{})[_0x010b('0x25')](respondWithResult(_0x377612,0xc9))['catch'](handleError(_0x377612,null));};exports[_0x010b('0x24')]=function(_0xce6669,_0x351f0e){if(_0xce6669['body']['id']){delete _0xce6669[_0x010b('0x4a')]['id'];}return db['AnalyticTreeReport'][_0x010b('0x48')]({'where':{'id':_0xce6669['params']['id']}})[_0x010b('0x25')](handleEntityNotFound(_0x351f0e,null))[_0x010b('0x25')](saveUpdates(_0xce6669['body'],null))[_0x010b('0x25')](respondWithResult(_0x351f0e,null))['catch'](handleError(_0x351f0e,null));};exports[_0x010b('0x4b')]=function(_0x379c1d,_0x14ee9c){return db[_0x010b('0x2b')]['find']({'where':{'id':_0x379c1d[_0x010b('0x45')]['id']}})['then'](handleEntityNotFound(_0x14ee9c,null))[_0x010b('0x25')](removeEntity(_0x14ee9c,null))[_0x010b('0x43')](handleError(_0x14ee9c,null));}; \ No newline at end of file +var _0x7b75=['send','AnalyticTreeReport','rawAttributes','type','key','model','map','name','keys','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','catch','show','includeAll','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','end','stack'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x7b75,0x1d0));var _0x57b7=function(_0x3ebb0f,_0x4937b1){_0x3ebb0f=_0x3ebb0f-0x0;var _0x455bd2=_0x7b75[_0x3ebb0f];return _0x455bd2;};'use strict';var emlformat=require(_0x57b7('0x0'));var rimraf=require(_0x57b7('0x1'));var zipdir=require(_0x57b7('0x2'));var jsonpatch=require(_0x57b7('0x3'));var rp=require(_0x57b7('0x4'));var moment=require('moment');var BPromise=require(_0x57b7('0x5'));var Mustache=require(_0x57b7('0x6'));var util=require(_0x57b7('0x7'));var path=require(_0x57b7('0x8'));var sox=require(_0x57b7('0x9'));var csv=require(_0x57b7('0xa'));var ejs=require(_0x57b7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57b7('0xc'));var squel=require(_0x57b7('0xd'));var crypto=require(_0x57b7('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x57b7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x57b7('0x10'));var Papa=require(_0x57b7('0x11'));var Redis=require(_0x57b7('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x57b7('0x13'));var as=require(_0x57b7('0x14'));var hardwareService=require(_0x57b7('0x15'));var logger=require(_0x57b7('0x16'))('api');var utils=require(_0x57b7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x57b7('0x18'));var db=require(_0x57b7('0x19'))['db'];function respondWithStatusCode(_0x2fd9fe,_0xa45459){_0xa45459=_0xa45459||0xcc;return function(_0x5ab902){if(_0x5ab902){return _0x2fd9fe[_0x57b7('0x1a')](_0xa45459);}return _0x2fd9fe[_0x57b7('0x1b')](_0xa45459)['end']();};}function respondWithResult(_0x3b31e1,_0x4c4c3e){_0x4c4c3e=_0x4c4c3e||0xc8;return function(_0xf3a49e){if(_0xf3a49e){return _0x3b31e1['status'](_0x4c4c3e)['json'](_0xf3a49e);}};}function respondWithFilteredResult(_0x198d7e,_0x14e155){return function(_0x5b77bc){if(_0x5b77bc){var _0x54d064=typeof _0x14e155[_0x57b7('0x1c')]===_0x57b7('0x1d')&&typeof _0x14e155[_0x57b7('0x1e')]===_0x57b7('0x1d');var _0x51fd0a=_0x5b77bc['count'];var _0x7a140b=_0x54d064?0x0:_0x14e155[_0x57b7('0x1c')];var _0x3f2587=_0x54d064?_0x5b77bc[_0x57b7('0x1f')]:_0x14e155['offset']+_0x14e155[_0x57b7('0x1e')];var _0x231576;if(_0x3f2587>=_0x51fd0a){_0x3f2587=_0x51fd0a;_0x231576=0xc8;}else{_0x231576=0xce;}_0x198d7e['status'](_0x231576);return _0x198d7e['set'](_0x57b7('0x20'),_0x7a140b+'-'+_0x3f2587+'/'+_0x51fd0a)[_0x57b7('0x21')](_0x5b77bc);}return null;};}function patchUpdates(_0x5060d3){return function(_0xddd82){try{jsonpatch['apply'](_0xddd82,_0x5060d3,!![]);}catch(_0x2f40f7){return BPromise[_0x57b7('0x22')](_0x2f40f7);}return _0xddd82[_0x57b7('0x23')]();};}function saveUpdates(_0x2798bf,_0x9eacde){return function(_0x1bdf6b){if(_0x1bdf6b){return _0x1bdf6b[_0x57b7('0x24')](_0x2798bf)[_0x57b7('0x25')](function(_0x46066a){return _0x46066a;});}return null;};}function removeEntity(_0x137c09,_0x3d7404){return function(_0x21b674){if(_0x21b674){return _0x21b674['destroy']()[_0x57b7('0x25')](function(){_0x137c09[_0x57b7('0x1b')](0xcc)[_0x57b7('0x26')]();});}};}function handleEntityNotFound(_0x2e2f30,_0x19ca8f){return function(_0x2e81c6){if(!_0x2e81c6){_0x2e2f30[_0x57b7('0x1a')](0x194);}return _0x2e81c6;};}function handleError(_0x3987d6,_0x2e2ff0){_0x2e2ff0=_0x2e2ff0||0x1f4;return function(_0x24bb07){logger['error'](_0x24bb07[_0x57b7('0x27')]);if(_0x24bb07['name']){delete _0x24bb07['name'];}_0x3987d6[_0x57b7('0x1b')](_0x2e2ff0)[_0x57b7('0x28')](_0x24bb07);};}exports['index']=function(_0x4b9f5a,_0x3c96e4){var _0x40e502={},_0x2d053e={},_0x5b3212={'count':0x0,'rows':[]};var _0x3a2baa=_['map'](db[_0x57b7('0x29')][_0x57b7('0x2a')],function(_0x3485c5){return{'name':_0x3485c5['fieldName'],'type':_0x3485c5[_0x57b7('0x2b')][_0x57b7('0x2c')]};});_0x2d053e[_0x57b7('0x2d')]=_[_0x57b7('0x2e')](_0x3a2baa,_0x57b7('0x2f'));_0x2d053e['query']=_[_0x57b7('0x30')](_0x4b9f5a['query']);_0x2d053e['filters']=_['intersection'](_0x2d053e[_0x57b7('0x2d')],_0x2d053e['query']);_0x40e502[_0x57b7('0x31')]=_[_0x57b7('0x32')](_0x2d053e[_0x57b7('0x2d')],qs[_0x57b7('0x33')](_0x4b9f5a[_0x57b7('0x34')][_0x57b7('0x33')]));_0x40e502[_0x57b7('0x31')]=_0x40e502[_0x57b7('0x31')][_0x57b7('0x35')]?_0x40e502['attributes']:_0x2d053e[_0x57b7('0x2d')];if(!_0x4b9f5a[_0x57b7('0x34')][_0x57b7('0x36')](_0x57b7('0x37'))){_0x40e502[_0x57b7('0x1e')]=qs[_0x57b7('0x1e')](_0x4b9f5a[_0x57b7('0x34')][_0x57b7('0x1e')]);_0x40e502[_0x57b7('0x1c')]=qs[_0x57b7('0x1c')](_0x4b9f5a['query']['offset']);}_0x40e502['order']=qs[_0x57b7('0x38')](_0x4b9f5a[_0x57b7('0x34')][_0x57b7('0x38')]);_0x40e502[_0x57b7('0x39')]=qs[_0x57b7('0x3a')](_[_0x57b7('0x3b')](_0x4b9f5a[_0x57b7('0x34')],_0x2d053e[_0x57b7('0x3a')]),_0x3a2baa);if(_0x4b9f5a[_0x57b7('0x34')][_0x57b7('0x3c')]){_0x40e502[_0x57b7('0x39')]=_[_0x57b7('0x3d')](_0x40e502[_0x57b7('0x39')],{'$or':_[_0x57b7('0x2e')](_0x3a2baa,function(_0x2bdbfb){if(_0x2bdbfb[_0x57b7('0x2b')]!==_0x57b7('0x3e')){var _0x5dda02={};_0x5dda02[_0x2bdbfb[_0x57b7('0x2f')]]={'$like':'%'+_0x4b9f5a[_0x57b7('0x34')]['filter']+'%'};return _0x5dda02;}})});}_0x40e502=_[_0x57b7('0x3d')]({},_0x40e502,_0x4b9f5a['options']);var _0x26d0f2={'where':_0x40e502[_0x57b7('0x39')]};return db[_0x57b7('0x29')][_0x57b7('0x1f')](_0x26d0f2)[_0x57b7('0x25')](function(_0x337fc3){_0x5b3212['count']=_0x337fc3;if(_0x4b9f5a[_0x57b7('0x34')]['includeAll']){_0x40e502[_0x57b7('0x3f')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x57b7('0x40')](_0x40e502);})[_0x57b7('0x25')](function(_0x2942e0){_0x5b3212['rows']=_0x2942e0;return _0x5b3212;})[_0x57b7('0x25')](respondWithFilteredResult(_0x3c96e4,_0x40e502))[_0x57b7('0x41')](handleError(_0x3c96e4,null));};exports[_0x57b7('0x42')]=function(_0x325163,_0x24ca06){var _0x1d23f7={'raw':!![],'where':{'id':_0x325163['params']['id']}},_0x5bc737={};_0x5bc737['model']=_[_0x57b7('0x30')](db[_0x57b7('0x29')][_0x57b7('0x2a')]);_0x5bc737[_0x57b7('0x34')]=_[_0x57b7('0x30')](_0x325163['query']);_0x5bc737[_0x57b7('0x3a')]=_[_0x57b7('0x32')](_0x5bc737[_0x57b7('0x2d')],_0x5bc737[_0x57b7('0x34')]);_0x1d23f7[_0x57b7('0x31')]=_[_0x57b7('0x32')](_0x5bc737[_0x57b7('0x2d')],qs[_0x57b7('0x33')](_0x325163[_0x57b7('0x34')][_0x57b7('0x33')]));_0x1d23f7[_0x57b7('0x31')]=_0x1d23f7[_0x57b7('0x31')][_0x57b7('0x35')]?_0x1d23f7['attributes']:_0x5bc737[_0x57b7('0x2d')];if(_0x325163[_0x57b7('0x34')][_0x57b7('0x43')]){_0x1d23f7[_0x57b7('0x3f')]=[{'all':!![]}];}_0x1d23f7=_[_0x57b7('0x3d')]({},_0x1d23f7,_0x325163['options']);return db[_0x57b7('0x29')][_0x57b7('0x44')](_0x1d23f7)[_0x57b7('0x25')](handleEntityNotFound(_0x24ca06,null))[_0x57b7('0x25')](respondWithResult(_0x24ca06,null))[_0x57b7('0x41')](handleError(_0x24ca06,null));};exports[_0x57b7('0x45')]=function(_0x5910ce,_0x8ecfbc){return db[_0x57b7('0x29')]['create'](_0x5910ce[_0x57b7('0x46')],{})['then'](respondWithResult(_0x8ecfbc,0xc9))[_0x57b7('0x41')](handleError(_0x8ecfbc,null));};exports[_0x57b7('0x24')]=function(_0x31dff2,_0x26bb2f){if(_0x31dff2[_0x57b7('0x46')]['id']){delete _0x31dff2['body']['id'];}return db[_0x57b7('0x29')][_0x57b7('0x44')]({'where':{'id':_0x31dff2['params']['id']}})[_0x57b7('0x25')](handleEntityNotFound(_0x26bb2f,null))['then'](saveUpdates(_0x31dff2[_0x57b7('0x46')],null))['then'](respondWithResult(_0x26bb2f,null))[_0x57b7('0x41')](handleError(_0x26bb2f,null));};exports['destroy']=function(_0x3a04dc,_0x198a7d){return db[_0x57b7('0x29')]['find']({'where':{'id':_0x3a04dc[_0x57b7('0x47')]['id']}})[_0x57b7('0x25')](handleEntityNotFound(_0x198a7d,null))[_0x57b7('0x25')](removeEntity(_0x198a7d,null))[_0x57b7('0x41')](handleError(_0x198a7d,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 67094a8..c103bc3 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.model.js +++ b/server/api/analyticTreeReport/analyticTreeReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1051=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x1051,0x1a6));var _0x1105=function(_0x1d1bbe,_0x262169){_0x1d1bbe=_0x1d1bbe-0x0;var _0x402d86=_0x1051[_0x1d1bbe];return _0x402d86;};'use strict';var _=require(_0x1105('0x0'));var util=require(_0x1105('0x1'));var logger=require(_0x1105('0x2'))(_0x1105('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1105('0x4'));var attributes=require(_0x1105('0x5'));module[_0x1105('0x6')]=function(_0x5eab0f,_0x96218c){return _0x5eab0f[_0x1105('0x7')](_0x1105('0x8'),attributes,{'tableName':_0x1105('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc070=['exports','define','AnalyticTreeReport','analytics_report_trees','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x317a90,_0x44bc7d){var _0x12bc5d=function(_0x1d49dc){while(--_0x1d49dc){_0x317a90['push'](_0x317a90['shift']());}};_0x12bc5d(++_0x44bc7d);}(_0xc070,0xd5));var _0x0c07=function(_0x44ad85,_0xfd29b){_0x44ad85=_0x44ad85-0x0;var _0x2bba7e=_0xc070[_0x44ad85];return _0x2bba7e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0c07('0x0'));var moment=require(_0x0c07('0x1'));var BPromise=require(_0x0c07('0x2'));var rp=require(_0x0c07('0x3'));var fs=require('fs');var path=require(_0x0c07('0x4'));var rimraf=require(_0x0c07('0x5'));var config=require(_0x0c07('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0x0c07('0x7')]=function(_0x28f47b,_0x49fcaf){return _0x28f47b[_0x0c07('0x8')](_0x0c07('0x9'),attributes,{'tableName':_0x0c07('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 1afc792..57b1987 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x8fba89,_0x1eac90){var _0x59c446=function(_0x53d140){while(--_0x53d140){_0x8fba89['push'](_0x8fba89['shift']());}};_0x59c446(++_0x1eac90);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc4aa[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x4beef0,_0x3bc828){var _0x4b30b8=function(_0x3dde0f){while(--_0x3dde0f){_0x4beef0['push'](_0x4beef0['shift']());}};_0x4b30b8(++_0x3bc828);}(_0x1261,0x144));var _0x1126=function(_0x43b1fb,_0x22e01e){_0x43b1fb=_0x43b1fb-0x0;var _0x2eb5bc=_0x1261[_0x43b1fb];return _0x2eb5bc;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 4a1a1b8..ff79408 100644 --- a/server/api/analyticTreeReport/index.js +++ b/server/api/analyticTreeReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1237=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout'];(function(_0x17f460,_0x47f86e){var _0xdf779a=function(_0x417446){while(--_0x417446){_0x17f460['push'](_0x17f460['shift']());}};_0xdf779a(++_0x47f86e);}(_0x1237,0x1c9));var _0x7123=function(_0x49fce6,_0x4e0ccb){_0x49fce6=_0x49fce6-0x0;var _0x37457e=_0x1237[_0x49fce6];return _0x37457e;};'use strict';var multer=require('multer');var util=require(_0x7123('0x0'));var path=require(_0x7123('0x1'));var timeout=require(_0x7123('0x2'));var express=require(_0x7123('0x3'));var router=express[_0x7123('0x4')]();var fs_extra=require(_0x7123('0x5'));var auth=require(_0x7123('0x6'));var interaction=require(_0x7123('0x7'));var config=require('../../config/environment');var controller=require(_0x7123('0x8'));router[_0x7123('0x9')]('/',auth[_0x7123('0xa')](),controller[_0x7123('0xb')]);router['get'](_0x7123('0xc'),auth[_0x7123('0xa')](),controller[_0x7123('0xd')]);router[_0x7123('0xe')]('/',auth['isAuthenticated'](),controller[_0x7123('0xf')]);router[_0x7123('0x10')]('/:id',auth[_0x7123('0xa')](),controller[_0x7123('0x11')]);router[_0x7123('0x12')](_0x7123('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x7123('0x13')]=router; \ No newline at end of file +var _0x62a4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x343ff7,_0x2b6760){var _0x227a32=function(_0x268dba){while(--_0x268dba){_0x343ff7['push'](_0x343ff7['shift']());}};_0x227a32(++_0x2b6760);}(_0x62a4,0x10c));var _0x462a=function(_0x418b39,_0x4e054e){_0x418b39=_0x418b39-0x0;var _0x4f5f6b=_0x62a4[_0x418b39];return _0x4f5f6b;};'use strict';var multer=require('multer');var util=require(_0x462a('0x0'));var path=require('path');var timeout=require(_0x462a('0x1'));var express=require(_0x462a('0x2'));var router=express[_0x462a('0x3')]();var fs_extra=require(_0x462a('0x4'));var auth=require(_0x462a('0x5'));var interaction=require(_0x462a('0x6'));var config=require(_0x462a('0x7'));var controller=require(_0x462a('0x8'));router[_0x462a('0x9')]('/',auth[_0x462a('0xa')](),controller[_0x462a('0xb')]);router['get'](_0x462a('0xc'),auth[_0x462a('0xa')](),controller[_0x462a('0xd')]);router[_0x462a('0xe')]('/',auth[_0x462a('0xa')](),controller[_0x462a('0xf')]);router[_0x462a('0x10')](_0x462a('0xc'),auth[_0x462a('0xa')](),controller[_0x462a('0x11')]);router[_0x462a('0x12')](_0x462a('0xc'),auth[_0x462a('0xa')](),controller[_0x462a('0x13')]);module[_0x462a('0x14')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 31c6f76..e9665a3 100644 --- a/server/api/attachment/attachment.attributes.js +++ b/server/api/attachment/attachment.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b2a=['STRING','sequelize'];(function(_0x40a383,_0x20e356){var _0x177115=function(_0x4287a0){while(--_0x4287a0){_0x40a383['push'](_0x40a383['shift']());}};_0x177115(++_0x20e356);}(_0x9b2a,0x127));var _0xa9b2=function(_0x36b2d5,_0x30a687){_0x36b2d5=_0x36b2d5-0x0;var _0x41299d=_0x9b2a[_0x36b2d5];return _0x41299d;};'use strict';var Sequelize=require(_0xa9b2('0x0'));module['exports']={'name':{'type':Sequelize[_0xa9b2('0x1')]},'basename':{'type':Sequelize[_0xa9b2('0x1')]},'type':{'type':Sequelize[_0xa9b2('0x1')]}}; \ No newline at end of file +var _0x87df=['exports','STRING','sequelize'];(function(_0x39be0d,_0x232ec9){var _0x26239f=function(_0x3f1ce7){while(--_0x3f1ce7){_0x39be0d['push'](_0x39be0d['shift']());}};_0x26239f(++_0x232ec9);}(_0x87df,0x167));var _0xf87d=function(_0x4796eb,_0x2f8389){_0x4796eb=_0x4796eb-0x0;var _0x1fb1a4=_0x87df[_0x4796eb];return _0x1fb1a4;};'use strict';var Sequelize=require(_0xf87d('0x0'));module[_0xf87d('0x1')]={'name':{'type':Sequelize[_0xf87d('0x2')]},'basename':{'type':Sequelize[_0xf87d('0x2')]},'type':{'type':Sequelize[_0xf87d('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 6b37407..223ce26 100644 --- a/server/api/attachment/attachment.controller.js +++ b/server/api/attachment/attachment.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9063=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','count','limit','json','apply','reject','save','update','then','destroy','end','stack','name','send','index','Attachment','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','length','find','clone','omit','createdAt','body','updatedAt','create','file','originalname','basename','filename','download','ChatOfflineMessageId','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','crypto','to-csv'];(function(_0x401609,_0x5eb61d){var _0x35fd57=function(_0x5dcddd){while(--_0x5dcddd){_0x401609['push'](_0x401609['shift']());}};_0x35fd57(++_0x5eb61d);}(_0x9063,0x1a5));var _0x3906=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x9063[_0x5447fd];return _0x15b28a;};'use strict';var emlformat=require(_0x3906('0x0'));var rimraf=require(_0x3906('0x1'));var zipdir=require(_0x3906('0x2'));var jsonpatch=require(_0x3906('0x3'));var rp=require(_0x3906('0x4'));var moment=require(_0x3906('0x5'));var BPromise=require(_0x3906('0x6'));var Mustache=require(_0x3906('0x7'));var util=require(_0x3906('0x8'));var path=require(_0x3906('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3906('0xa'));var fs=require('fs');var fs_extra=require(_0x3906('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3906('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3906('0xd'));var querystring=require(_0x3906('0xe'));var Papa=require(_0x3906('0xf'));var Redis=require(_0x3906('0x10'));var authService=require(_0x3906('0x11'));var qs=require(_0x3906('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3906('0x13'))(_0x3906('0x14'));var utils=require(_0x3906('0x15'));var config=require(_0x3906('0x16'));var licenseUtil=require(_0x3906('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x131d58,_0x8b9cc7){_0x8b9cc7=_0x8b9cc7||0xcc;return function(_0xad2553){if(_0xad2553){return _0x131d58[_0x3906('0x18')](_0x8b9cc7);}return _0x131d58[_0x3906('0x19')](_0x8b9cc7)['end']();};}function respondWithResult(_0xb7a205,_0x2f23cc){_0x2f23cc=_0x2f23cc||0xc8;return function(_0x388961){if(_0x388961){return _0xb7a205[_0x3906('0x19')](_0x2f23cc)['json'](_0x388961);}};}function respondWithFilteredResult(_0x1aaa59,_0x2b3414){return function(_0x23b173){if(_0x23b173){var _0x172f36=typeof _0x2b3414[_0x3906('0x1a')]==='undefined'&&typeof _0x2b3414['limit']===_0x3906('0x1b');var _0x451922=_0x23b173[_0x3906('0x1c')];var _0x232599=_0x172f36?0x0:_0x2b3414[_0x3906('0x1a')];var _0x28981f=_0x172f36?_0x23b173[_0x3906('0x1c')]:_0x2b3414[_0x3906('0x1a')]+_0x2b3414[_0x3906('0x1d')];var _0x4d9e29;if(_0x28981f>=_0x451922){_0x28981f=_0x451922;_0x4d9e29=0xc8;}else{_0x4d9e29=0xce;}_0x1aaa59[_0x3906('0x19')](_0x4d9e29);return _0x1aaa59['set']('Content-Range',_0x232599+'-'+_0x28981f+'/'+_0x451922)[_0x3906('0x1e')](_0x23b173);}return null;};}function patchUpdates(_0x51b93d){return function(_0x31a1f8){try{jsonpatch[_0x3906('0x1f')](_0x31a1f8,_0x51b93d,!![]);}catch(_0x4a6e2b){return BPromise[_0x3906('0x20')](_0x4a6e2b);}return _0x31a1f8[_0x3906('0x21')]();};}function saveUpdates(_0x402ff8,_0x86b325){return function(_0x13217c){if(_0x13217c){return _0x13217c[_0x3906('0x22')](_0x402ff8)[_0x3906('0x23')](function(_0x364f6f){return _0x364f6f;});}return null;};}function removeEntity(_0x4c21b3,_0x15fdbe){return function(_0x9c2dd){if(_0x9c2dd){return _0x9c2dd[_0x3906('0x24')]()[_0x3906('0x23')](function(){_0x4c21b3[_0x3906('0x19')](0xcc)[_0x3906('0x25')]();});}};}function handleEntityNotFound(_0x32c1ef,_0xca6726){return function(_0x112b53){if(!_0x112b53){_0x32c1ef[_0x3906('0x18')](0x194);}return _0x112b53;};}function handleError(_0xab8cd3,_0x24007b){_0x24007b=_0x24007b||0x1f4;return function(_0x4a192e){logger['error'](_0x4a192e[_0x3906('0x26')]);if(_0x4a192e[_0x3906('0x27')]){delete _0x4a192e[_0x3906('0x27')];}_0xab8cd3['status'](_0x24007b)[_0x3906('0x28')](_0x4a192e);};}exports[_0x3906('0x29')]=function(_0x44226d,_0x45823e){var _0x4cf48a={},_0xc44495={},_0x599b3e={'count':0x0,'rows':[]};var _0x3890de=_['map'](db[_0x3906('0x2a')][_0x3906('0x2b')],function(_0x346ca5){return{'name':_0x346ca5[_0x3906('0x2c')],'type':_0x346ca5[_0x3906('0x2d')][_0x3906('0x2e')]};});_0xc44495[_0x3906('0x2f')]=_[_0x3906('0x30')](_0x3890de,_0x3906('0x27'));_0xc44495[_0x3906('0x31')]=_[_0x3906('0x32')](_0x44226d[_0x3906('0x31')]);_0xc44495[_0x3906('0x33')]=_[_0x3906('0x34')](_0xc44495['model'],_0xc44495['query']);_0x4cf48a[_0x3906('0x35')]=_[_0x3906('0x34')](_0xc44495['model'],qs[_0x3906('0x36')](_0x44226d[_0x3906('0x31')][_0x3906('0x36')]));_0x4cf48a[_0x3906('0x35')]=_0x4cf48a['attributes']['length']?_0x4cf48a[_0x3906('0x35')]:_0xc44495[_0x3906('0x2f')];if(!_0x44226d[_0x3906('0x31')][_0x3906('0x37')](_0x3906('0x38'))){_0x4cf48a[_0x3906('0x1d')]=qs[_0x3906('0x1d')](_0x44226d['query']['limit']);_0x4cf48a[_0x3906('0x1a')]=qs[_0x3906('0x1a')](_0x44226d['query'][_0x3906('0x1a')]);}_0x4cf48a[_0x3906('0x39')]=qs[_0x3906('0x3a')](_0x44226d[_0x3906('0x31')]['sort']);_0x4cf48a[_0x3906('0x3b')]=qs[_0x3906('0x33')](_['pick'](_0x44226d[_0x3906('0x31')],_0xc44495[_0x3906('0x33')]),_0x3890de);if(_0x44226d[_0x3906('0x31')][_0x3906('0x3c')]){_0x4cf48a[_0x3906('0x3b')]=_['merge'](_0x4cf48a[_0x3906('0x3b')],{'$or':_[_0x3906('0x30')](_0x3890de,function(_0x34f1b6){if(_0x34f1b6[_0x3906('0x2d')]!==_0x3906('0x3d')){var _0x4905c6={};_0x4905c6[_0x34f1b6[_0x3906('0x27')]]={'$like':'%'+_0x44226d['query'][_0x3906('0x3c')]+'%'};return _0x4905c6;}})});}_0x4cf48a=_[_0x3906('0x3e')]({},_0x4cf48a,_0x44226d[_0x3906('0x3f')]);var _0x2c412a={'where':_0x4cf48a[_0x3906('0x3b')]};return db[_0x3906('0x2a')][_0x3906('0x1c')](_0x2c412a)[_0x3906('0x23')](function(_0x1ad233){_0x599b3e[_0x3906('0x1c')]=_0x1ad233;if(_0x44226d['query'][_0x3906('0x40')]){_0x4cf48a[_0x3906('0x41')]=[{'all':!![]}];}return db[_0x3906('0x2a')]['findAll'](_0x4cf48a);})[_0x3906('0x23')](function(_0x382e1f){_0x599b3e[_0x3906('0x42')]=_0x382e1f;return _0x599b3e;})['then'](respondWithFilteredResult(_0x45823e,_0x4cf48a))[_0x3906('0x43')](handleError(_0x45823e,null));};exports[_0x3906('0x44')]=function(_0x14ef7e,_0x4ff1e9){var _0x4f89aa={'raw':!![],'where':{'id':_0x14ef7e[_0x3906('0x45')]['id']}},_0x155bda={};_0x155bda['model']=_[_0x3906('0x32')](db['Attachment'][_0x3906('0x2b')]);_0x155bda[_0x3906('0x31')]=_[_0x3906('0x32')](_0x14ef7e['query']);_0x155bda[_0x3906('0x33')]=_[_0x3906('0x34')](_0x155bda[_0x3906('0x2f')],_0x155bda[_0x3906('0x31')]);_0x4f89aa[_0x3906('0x35')]=_[_0x3906('0x34')](_0x155bda['model'],qs[_0x3906('0x36')](_0x14ef7e[_0x3906('0x31')]['fields']));_0x4f89aa['attributes']=_0x4f89aa[_0x3906('0x35')][_0x3906('0x46')]?_0x4f89aa[_0x3906('0x35')]:_0x155bda[_0x3906('0x2f')];if(_0x14ef7e[_0x3906('0x31')]['includeAll']){_0x4f89aa[_0x3906('0x41')]=[{'all':!![]}];}_0x4f89aa=_['merge']({},_0x4f89aa,_0x14ef7e[_0x3906('0x3f')]);return db['Attachment'][_0x3906('0x47')](_0x4f89aa)[_0x3906('0x23')](handleEntityNotFound(_0x4ff1e9,null))[_0x3906('0x23')](respondWithResult(_0x4ff1e9,null))[_0x3906('0x43')](handleError(_0x4ff1e9,null));};exports[_0x3906('0x48')]=function(_0x47f129,_0x2f531e){var _0x202ae4={'where':{'id':_0x47f129[_0x3906('0x45')]['id']}},_0x5b533b={};_0x5b533b[_0x3906('0x2f')]=_[_0x3906('0x32')](db[_0x3906('0x2a')]['rawAttributes']);_0x202ae4[_0x3906('0x35')]=_[_0x3906('0x34')](_0x5b533b[_0x3906('0x2f')],qs[_0x3906('0x36')](_0x47f129['query'][_0x3906('0x36')]));_0x202ae4[_0x3906('0x35')]=_0x202ae4[_0x3906('0x35')][_0x3906('0x46')]?_0x202ae4[_0x3906('0x35')]:_0x5b533b[_0x3906('0x2f')];if(_0x47f129['query'][_0x3906('0x40')]){_0x202ae4[_0x3906('0x41')]=[{'all':!![]}];}_0x202ae4=_[_0x3906('0x3e')]({},_0x202ae4,_0x47f129[_0x3906('0x3f')]);return db[_0x3906('0x2a')]['find'](_0x202ae4)[_0x3906('0x23')](handleEntityNotFound(_0x2f531e,null))[_0x3906('0x23')](function(_0x4a1416){if(_0x4a1416){var _0x10e60b=_0x4a1416['get']({'plain':!![]});_0x10e60b=qs[_0x3906('0x49')](_0x10e60b,['id',_0x3906('0x4a'),'updatedAt']);_0x47f129[_0x3906('0x4b')]=_[_0x3906('0x49')](_0x47f129[_0x3906('0x4b')],['id','createdAt',_0x3906('0x4c')]);return db[_0x3906('0x2a')][_0x3906('0x4d')](_['merge'](_0x10e60b,_0x47f129['body']),{'include':_0x47f129[_0x3906('0x31')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x3906('0x23')](respondWithResult(_0x2f531e,0xc9))[_0x3906('0x43')](handleError(_0x2f531e,null));};exports['update']=function(_0x1e14e3,_0x5af2c3){if(_0x1e14e3[_0x3906('0x4b')]['id']){delete _0x1e14e3[_0x3906('0x4b')]['id'];}return db[_0x3906('0x2a')]['find']({'where':{'id':_0x1e14e3[_0x3906('0x45')]['id']}})[_0x3906('0x23')](handleEntityNotFound(_0x5af2c3,null))['then'](saveUpdates(_0x1e14e3[_0x3906('0x4b')],null))[_0x3906('0x23')](respondWithResult(_0x5af2c3,null))['catch'](handleError(_0x5af2c3,null));};exports[_0x3906('0x24')]=function(_0x376810,_0x27121f){return db[_0x3906('0x2a')]['find']({'where':{'id':_0x376810[_0x3906('0x45')]['id']}})['then'](handleEntityNotFound(_0x27121f,null))[_0x3906('0x23')](removeEntity(_0x27121f,null))['catch'](handleError(_0x27121f,null));};exports[_0x3906('0x4d')]=function(_0x199c2f,_0x586f8a,_0x2fbc3f){_0x199c2f['body'][_0x3906('0x27')]=_0x199c2f[_0x3906('0x4e')][_0x3906('0x4f')];_0x199c2f[_0x3906('0x4b')][_0x3906('0x50')]=_0x199c2f[_0x3906('0x4e')][_0x3906('0x51')];_0x199c2f[_0x3906('0x4b')][_0x3906('0x2d')]=_0x199c2f[_0x3906('0x4e')]['mimetype'];return db['Attachment'][_0x3906('0x4d')](_0x199c2f[_0x3906('0x4b')])[_0x3906('0x23')](respondWithResult(_0x586f8a,0xc9))[_0x3906('0x43')](handleError(_0x586f8a,null));};exports[_0x3906('0x52')]=function(_0x3b0d80,_0x466da4,_0x156f6a){return db[_0x3906('0x2a')]['findOne']({'where':{'id':_0x3b0d80[_0x3906('0x45')]['id']},'raw':!![]})[_0x3906('0x23')](handleEntityNotFound(_0x466da4,null))[_0x3906('0x23')](function(_0x40e1e1){if(_0x40e1e1){var _0x5b2de8=_0x40e1e1[_0x3906('0x53')]!==null;var _0x1b9bfb=path[_0x3906('0x54')](config[_0x3906('0x55')],_0x3906('0x56'));if(_0x5b2de8){_0x1b9bfb=path[_0x3906('0x54')](_0x1b9bfb,'offline-chat/');}var _0x5d51d2=path[_0x3906('0x54')](_0x1b9bfb,_0x40e1e1[_0x3906('0x50')]);return _0x466da4[_0x3906('0x52')](_0x5d51d2);}})[_0x3906('0x43')](handleError(_0x466da4,null));}; \ No newline at end of file +var _0xd6c6=['includeAll','clone','rawAttributes','options','find','get','omit','createdAt','body','updatedAt','create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','eml-format','zip-dir','fast-json-patch','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','map','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','count','include','Attachment','rows','catch','show','params','fields'];(function(_0x510af5,_0x54a233){var _0x219705=function(_0x4de1a0){while(--_0x4de1a0){_0x510af5['push'](_0x510af5['shift']());}};_0x219705(++_0x54a233);}(_0xd6c6,0x127));var _0x6d6c=function(_0x7dc160,_0x78ef75){_0x7dc160=_0x7dc160-0x0;var _0x84c2b1=_0xd6c6[_0x7dc160];return _0x84c2b1;};'use strict';var emlformat=require(_0x6d6c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6d6c('0x1'));var jsonpatch=require(_0x6d6c('0x2'));var rp=require(_0x6d6c('0x3'));var moment=require(_0x6d6c('0x4'));var BPromise=require(_0x6d6c('0x5'));var Mustache=require(_0x6d6c('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6d6c('0x7'));var csv=require(_0x6d6c('0x8'));var ejs=require(_0x6d6c('0x9'));var fs=require('fs');var fs_extra=require(_0x6d6c('0xa'));var _=require(_0x6d6c('0xb'));var squel=require(_0x6d6c('0xc'));var crypto=require(_0x6d6c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6d6c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6d6c('0xf'));var Redis=require(_0x6d6c('0x10'));var authService=require(_0x6d6c('0x11'));var qs=require(_0x6d6c('0x12'));var as=require(_0x6d6c('0x13'));var hardwareService=require(_0x6d6c('0x14'));var logger=require(_0x6d6c('0x15'))(_0x6d6c('0x16'));var utils=require(_0x6d6c('0x17'));var config=require(_0x6d6c('0x18'));var licenseUtil=require(_0x6d6c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bce85,_0x37b1f4){_0x37b1f4=_0x37b1f4||0xcc;return function(_0x41bf46){if(_0x41bf46){return _0x4bce85[_0x6d6c('0x1a')](_0x37b1f4);}return _0x4bce85[_0x6d6c('0x1b')](_0x37b1f4)[_0x6d6c('0x1c')]();};}function respondWithResult(_0x67625a,_0xbb652b){_0xbb652b=_0xbb652b||0xc8;return function(_0xe6d980){if(_0xe6d980){return _0x67625a[_0x6d6c('0x1b')](_0xbb652b)[_0x6d6c('0x1d')](_0xe6d980);}};}function respondWithFilteredResult(_0x1c9458,_0x2af7b8){return function(_0x38cdbf){if(_0x38cdbf){var _0x240223=typeof _0x2af7b8[_0x6d6c('0x1e')]===_0x6d6c('0x1f')&&typeof _0x2af7b8['limit']===_0x6d6c('0x1f');var _0x55daa1=_0x38cdbf['count'];var _0x129f72=_0x240223?0x0:_0x2af7b8[_0x6d6c('0x1e')];var _0x46c61f=_0x240223?_0x38cdbf['count']:_0x2af7b8[_0x6d6c('0x1e')]+_0x2af7b8[_0x6d6c('0x20')];var _0x9ac121;if(_0x46c61f>=_0x55daa1){_0x46c61f=_0x55daa1;_0x9ac121=0xc8;}else{_0x9ac121=0xce;}_0x1c9458['status'](_0x9ac121);return _0x1c9458[_0x6d6c('0x21')](_0x6d6c('0x22'),_0x129f72+'-'+_0x46c61f+'/'+_0x55daa1)[_0x6d6c('0x1d')](_0x38cdbf);}return null;};}function patchUpdates(_0x6ba5b3){return function(_0x5715db){try{jsonpatch[_0x6d6c('0x23')](_0x5715db,_0x6ba5b3,!![]);}catch(_0x144575){return BPromise[_0x6d6c('0x24')](_0x144575);}return _0x5715db['save']();};}function saveUpdates(_0x3e54ca,_0x474cf7){return function(_0x593cdb){if(_0x593cdb){return _0x593cdb[_0x6d6c('0x25')](_0x3e54ca)['then'](function(_0x4b00e1){return _0x4b00e1;});}return null;};}function removeEntity(_0x123cc7,_0x36b1de){return function(_0x4921dc){if(_0x4921dc){return _0x4921dc[_0x6d6c('0x26')]()[_0x6d6c('0x27')](function(){_0x123cc7[_0x6d6c('0x1b')](0xcc)[_0x6d6c('0x1c')]();});}};}function handleEntityNotFound(_0x47f0ec,_0x391113){return function(_0x3bbf4c){if(!_0x3bbf4c){_0x47f0ec[_0x6d6c('0x1a')](0x194);}return _0x3bbf4c;};}function handleError(_0x39fd7d,_0x790230){_0x790230=_0x790230||0x1f4;return function(_0x4e3c29){logger[_0x6d6c('0x28')](_0x4e3c29[_0x6d6c('0x29')]);if(_0x4e3c29[_0x6d6c('0x2a')]){delete _0x4e3c29[_0x6d6c('0x2a')];}_0x39fd7d['status'](_0x790230)[_0x6d6c('0x2b')](_0x4e3c29);};}exports['index']=function(_0x1524d6,_0x1a20b7){var _0x31a8fb={},_0x4a2107={},_0x52c892={'count':0x0,'rows':[]};var _0x5c5e4e=_[_0x6d6c('0x2c')](db['Attachment']['rawAttributes'],function(_0x466ee3){return{'name':_0x466ee3['fieldName'],'type':_0x466ee3[_0x6d6c('0x2d')][_0x6d6c('0x2e')]};});_0x4a2107[_0x6d6c('0x2f')]=_['map'](_0x5c5e4e,_0x6d6c('0x2a'));_0x4a2107[_0x6d6c('0x30')]=_[_0x6d6c('0x31')](_0x1524d6[_0x6d6c('0x30')]);_0x4a2107[_0x6d6c('0x32')]=_[_0x6d6c('0x33')](_0x4a2107[_0x6d6c('0x2f')],_0x4a2107['query']);_0x31a8fb[_0x6d6c('0x34')]=_[_0x6d6c('0x33')](_0x4a2107[_0x6d6c('0x2f')],qs['fields'](_0x1524d6[_0x6d6c('0x30')]['fields']));_0x31a8fb[_0x6d6c('0x34')]=_0x31a8fb[_0x6d6c('0x34')][_0x6d6c('0x35')]?_0x31a8fb[_0x6d6c('0x34')]:_0x4a2107['model'];if(!_0x1524d6[_0x6d6c('0x30')][_0x6d6c('0x36')]('nolimit')){_0x31a8fb[_0x6d6c('0x20')]=qs[_0x6d6c('0x20')](_0x1524d6[_0x6d6c('0x30')]['limit']);_0x31a8fb[_0x6d6c('0x1e')]=qs[_0x6d6c('0x1e')](_0x1524d6[_0x6d6c('0x30')]['offset']);}_0x31a8fb[_0x6d6c('0x37')]=qs[_0x6d6c('0x38')](_0x1524d6[_0x6d6c('0x30')]['sort']);_0x31a8fb['where']=qs[_0x6d6c('0x32')](_[_0x6d6c('0x39')](_0x1524d6[_0x6d6c('0x30')],_0x4a2107[_0x6d6c('0x32')]),_0x5c5e4e);if(_0x1524d6[_0x6d6c('0x30')][_0x6d6c('0x3a')]){_0x31a8fb[_0x6d6c('0x3b')]=_[_0x6d6c('0x3c')](_0x31a8fb[_0x6d6c('0x3b')],{'$or':_[_0x6d6c('0x2c')](_0x5c5e4e,function(_0x10e462){if(_0x10e462['type']!=='VIRTUAL'){var _0x51d3db={};_0x51d3db[_0x10e462['name']]={'$like':'%'+_0x1524d6[_0x6d6c('0x30')][_0x6d6c('0x3a')]+'%'};return _0x51d3db;}})});}_0x31a8fb=_[_0x6d6c('0x3c')]({},_0x31a8fb,_0x1524d6['options']);var _0x31a6de={'where':_0x31a8fb[_0x6d6c('0x3b')]};return db['Attachment'][_0x6d6c('0x3d')](_0x31a6de)['then'](function(_0xef7ed0){_0x52c892['count']=_0xef7ed0;if(_0x1524d6['query']['includeAll']){_0x31a8fb[_0x6d6c('0x3e')]=[{'all':!![]}];}return db[_0x6d6c('0x3f')]['findAll'](_0x31a8fb);})[_0x6d6c('0x27')](function(_0x30424a){_0x52c892[_0x6d6c('0x40')]=_0x30424a;return _0x52c892;})[_0x6d6c('0x27')](respondWithFilteredResult(_0x1a20b7,_0x31a8fb))[_0x6d6c('0x41')](handleError(_0x1a20b7,null));};exports[_0x6d6c('0x42')]=function(_0x43aa25,_0x5dd9e2){var _0x44be16={'raw':!![],'where':{'id':_0x43aa25[_0x6d6c('0x43')]['id']}},_0x2a1551={};_0x2a1551[_0x6d6c('0x2f')]=_[_0x6d6c('0x31')](db[_0x6d6c('0x3f')]['rawAttributes']);_0x2a1551[_0x6d6c('0x30')]=_['keys'](_0x43aa25[_0x6d6c('0x30')]);_0x2a1551[_0x6d6c('0x32')]=_[_0x6d6c('0x33')](_0x2a1551[_0x6d6c('0x2f')],_0x2a1551[_0x6d6c('0x30')]);_0x44be16['attributes']=_[_0x6d6c('0x33')](_0x2a1551[_0x6d6c('0x2f')],qs['fields'](_0x43aa25[_0x6d6c('0x30')][_0x6d6c('0x44')]));_0x44be16[_0x6d6c('0x34')]=_0x44be16[_0x6d6c('0x34')][_0x6d6c('0x35')]?_0x44be16[_0x6d6c('0x34')]:_0x2a1551[_0x6d6c('0x2f')];if(_0x43aa25['query'][_0x6d6c('0x45')]){_0x44be16[_0x6d6c('0x3e')]=[{'all':!![]}];}_0x44be16=_[_0x6d6c('0x3c')]({},_0x44be16,_0x43aa25['options']);return db[_0x6d6c('0x3f')]['find'](_0x44be16)[_0x6d6c('0x27')](handleEntityNotFound(_0x5dd9e2,null))[_0x6d6c('0x27')](respondWithResult(_0x5dd9e2,null))[_0x6d6c('0x41')](handleError(_0x5dd9e2,null));};exports[_0x6d6c('0x46')]=function(_0x201a66,_0x3e7f32){var _0x3b3050={'where':{'id':_0x201a66[_0x6d6c('0x43')]['id']}},_0x3ff4dc={};_0x3ff4dc['model']=_[_0x6d6c('0x31')](db[_0x6d6c('0x3f')][_0x6d6c('0x47')]);_0x3b3050['attributes']=_[_0x6d6c('0x33')](_0x3ff4dc['model'],qs[_0x6d6c('0x44')](_0x201a66[_0x6d6c('0x30')][_0x6d6c('0x44')]));_0x3b3050[_0x6d6c('0x34')]=_0x3b3050[_0x6d6c('0x34')][_0x6d6c('0x35')]?_0x3b3050[_0x6d6c('0x34')]:_0x3ff4dc[_0x6d6c('0x2f')];if(_0x201a66['query']['includeAll']){_0x3b3050[_0x6d6c('0x3e')]=[{'all':!![]}];}_0x3b3050=_[_0x6d6c('0x3c')]({},_0x3b3050,_0x201a66[_0x6d6c('0x48')]);return db[_0x6d6c('0x3f')][_0x6d6c('0x49')](_0x3b3050)[_0x6d6c('0x27')](handleEntityNotFound(_0x3e7f32,null))['then'](function(_0x56d942){if(_0x56d942){var _0x573bbc=_0x56d942[_0x6d6c('0x4a')]({'plain':!![]});_0x573bbc=qs[_0x6d6c('0x4b')](_0x573bbc,['id',_0x6d6c('0x4c'),'updatedAt']);_0x201a66[_0x6d6c('0x4d')]=_[_0x6d6c('0x4b')](_0x201a66['body'],['id',_0x6d6c('0x4c'),_0x6d6c('0x4e')]);return db['Attachment'][_0x6d6c('0x4f')](_[_0x6d6c('0x3c')](_0x573bbc,_0x201a66[_0x6d6c('0x4d')]),{'include':_0x201a66[_0x6d6c('0x30')][_0x6d6c('0x45')]?[{'all':!![]}]:undefined});}})[_0x6d6c('0x27')](respondWithResult(_0x3e7f32,0xc9))['catch'](handleError(_0x3e7f32,null));};exports[_0x6d6c('0x25')]=function(_0x47a023,_0x3cdb7f){if(_0x47a023['body']['id']){delete _0x47a023['body']['id'];}return db[_0x6d6c('0x3f')][_0x6d6c('0x49')]({'where':{'id':_0x47a023['params']['id']}})[_0x6d6c('0x27')](handleEntityNotFound(_0x3cdb7f,null))[_0x6d6c('0x27')](saveUpdates(_0x47a023[_0x6d6c('0x4d')],null))[_0x6d6c('0x27')](respondWithResult(_0x3cdb7f,null))[_0x6d6c('0x41')](handleError(_0x3cdb7f,null));};exports[_0x6d6c('0x26')]=function(_0x4e5817,_0x3c1258){return db[_0x6d6c('0x3f')][_0x6d6c('0x49')]({'where':{'id':_0x4e5817['params']['id']}})['then'](handleEntityNotFound(_0x3c1258,null))[_0x6d6c('0x27')](removeEntity(_0x3c1258,null))['catch'](handleError(_0x3c1258,null));};exports[_0x6d6c('0x4f')]=function(_0x122ab1,_0x53d3d7,_0x10785b){_0x122ab1[_0x6d6c('0x4d')]['name']=_0x122ab1[_0x6d6c('0x50')][_0x6d6c('0x51')];_0x122ab1[_0x6d6c('0x4d')][_0x6d6c('0x52')]=_0x122ab1[_0x6d6c('0x50')][_0x6d6c('0x53')];_0x122ab1['body'][_0x6d6c('0x2d')]=_0x122ab1[_0x6d6c('0x50')][_0x6d6c('0x54')];return db[_0x6d6c('0x3f')]['create'](_0x122ab1[_0x6d6c('0x4d')])[_0x6d6c('0x27')](respondWithResult(_0x53d3d7,0xc9))['catch'](handleError(_0x53d3d7,null));};exports['download']=function(_0x506eab,_0x4b8e1a,_0x859511){return db[_0x6d6c('0x3f')][_0x6d6c('0x55')]({'where':{'id':_0x506eab[_0x6d6c('0x43')]['id']},'raw':!![]})[_0x6d6c('0x27')](handleEntityNotFound(_0x4b8e1a,null))['then'](function(_0xb0272c){if(_0xb0272c){var _0x1ad853=_0xb0272c[_0x6d6c('0x56')]!==null;var _0x14ffcc=path[_0x6d6c('0x57')](config['root'],_0x6d6c('0x58'));if(_0x1ad853){_0x14ffcc=path[_0x6d6c('0x57')](_0x14ffcc,_0x6d6c('0x59'));}var _0x289d59=path[_0x6d6c('0x57')](_0x14ffcc,_0xb0272c[_0x6d6c('0x52')]);return _0x4b8e1a[_0x6d6c('0x5a')](_0x289d59);}})[_0x6d6c('0x41')](handleError(_0x4b8e1a,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 8a0c5d4..c24fcc9 100644 --- a/server/api/attachment/attachment.model.js +++ b/server/api/attachment/attachment.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b07=['Attachment','attachments','lodash','util','../../config/logger','moment','bluebird','request-promise','path','exports','define'];(function(_0x2c9f51,_0x2eec01){var _0x12abf9=function(_0x2d463f){while(--_0x2d463f){_0x2c9f51['push'](_0x2c9f51['shift']());}};_0x12abf9(++_0x2eec01);}(_0x5b07,0x1db));var _0x75b0=function(_0x4a6b5d,_0x63d8a){_0x4a6b5d=_0x4a6b5d-0x0;var _0x4fe057=_0x5b07[_0x4a6b5d];return _0x4fe057;};'use strict';var _=require(_0x75b0('0x0'));var util=require(_0x75b0('0x1'));var logger=require(_0x75b0('0x2'))('api');var moment=require(_0x75b0('0x3'));var BPromise=require(_0x75b0('0x4'));var rp=require(_0x75b0('0x5'));var fs=require('fs');var path=require(_0x75b0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x75b0('0x7')]=function(_0x46fce0,_0x5ae519){return _0x46fce0[_0x75b0('0x8')](_0x75b0('0x9'),attributes,{'tableName':_0x75b0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10f5=['../../config/environment','./attachment.attributes','define','attachments','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x52085a,_0x3717ca){var _0x5afc1a=function(_0x2aa175){while(--_0x2aa175){_0x52085a['push'](_0x52085a['shift']());}};_0x5afc1a(++_0x3717ca);}(_0x10f5,0x100));var _0x510f=function(_0x32a350,_0x32d6a7){_0x32a350=_0x32a350-0x0;var _0x5456ae=_0x10f5[_0x32a350];return _0x5456ae;};'use strict';var _=require(_0x510f('0x0'));var util=require(_0x510f('0x1'));var logger=require(_0x510f('0x2'))(_0x510f('0x3'));var moment=require(_0x510f('0x4'));var BPromise=require(_0x510f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x510f('0x6'));var rimraf=require(_0x510f('0x7'));var config=require(_0x510f('0x8'));var attributes=require(_0x510f('0x9'));module['exports']=function(_0x3954e0,_0x3deeb6){return _0x3954e0[_0x510f('0xa')]('Attachment',attributes,{'tableName':_0x510f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index e5483b3..fa84f11 100644 --- a/server/api/attachment/attachment.rpc.js +++ b/server/api/attachment/attachment.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2821=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','then','lodash','util','moment','bluebird','randomstring'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2821,0x87));var _0x1282=function(_0xef067f,_0x157096){_0xef067f=_0xef067f-0x0;var _0x5d8012=_0x2821[_0xef067f];return _0x5d8012;};'use strict';var _=require(_0x1282('0x0'));var util=require(_0x1282('0x1'));var moment=require(_0x1282('0x2'));var BPromise=require(_0x1282('0x3'));var rs=require(_0x1282('0x4'));var fs=require('fs');var Redis=require(_0x1282('0x5'));var db=require(_0x1282('0x6'))['db'];var utils=require(_0x1282('0x7'));var logger=require(_0x1282('0x8'))(_0x1282('0x9'));var config=require(_0x1282('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1282('0xb')][_0x1282('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x293947,_0x13beb5,_0xa4eee9){return new BPromise(function(_0x1a8666,_0x18d69a){return client[_0x1282('0xd')](_0x293947,_0xa4eee9)['then'](function(_0x41c458){logger[_0x1282('0xe')](_0x1282('0xf'),_0x13beb5,_0x1282('0x10'));logger[_0x1282('0x11')]('Attachment,\x20%s,\x20%s,\x20%s',_0x13beb5,_0x1282('0x10'),JSON[_0x1282('0x12')](_0x41c458));if(_0x41c458['error']){if(_0x41c458[_0x1282('0x13')][_0x1282('0x14')]===0x1f4){logger['error'](_0x1282('0xf'),_0x13beb5,_0x41c458['error']['message']);return _0x18d69a(_0x41c458[_0x1282('0x13')][_0x1282('0x15')]);}logger[_0x1282('0x13')](_0x1282('0xf'),_0x13beb5,_0x41c458['error']['message']);return _0x1a8666(_0x41c458['error'][_0x1282('0x15')]);}else{logger[_0x1282('0xe')](_0x1282('0xf'),_0x13beb5,_0x1282('0x10'));_0x1a8666(_0x41c458[_0x1282('0x16')][_0x1282('0x15')]);}})[_0x1282('0x17')](function(_0x116ef1){logger['error'](_0x1282('0xf'),_0x13beb5,_0x116ef1);_0x18d69a(_0x116ef1);});});}exports[_0x1282('0x18')]=function(_0x518733){var _0x48c857=this;return new Promise(function(_0xebc97e,_0x4e3ec7){return db[_0x1282('0x19')][_0x1282('0x1a')](_0x518733['body'],{'raw':_0x518733['options']?_0x518733['options']['raw']===undefined?!![]:![]:!![]})[_0x1282('0x1b')](function(_0x2f4e4a){logger[_0x1282('0xe')](_0x1282('0x18'),_0x518733);logger[_0x1282('0x11')](_0x1282('0x18'),_0x518733,JSON[_0x1282('0x12')](_0x2f4e4a));_0xebc97e(_0x2f4e4a);})[_0x1282('0x17')](function(_0x153159){logger[_0x1282('0x13')]('CreateAttachment',_0x153159[_0x1282('0x15')],_0x518733);_0x4e3ec7(_0x48c857['error'](0x1f4,_0x153159[_0x1282('0x15')]));});});}; \ No newline at end of file +var _0x80df=['catch','CreateAttachment','Attachment','create','options','lodash','util','moment','bluebird','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','stringify','error','message','result'];(function(_0x427d3a,_0x23724c){var _0xe5c521=function(_0x77b277){while(--_0x77b277){_0x427d3a['push'](_0x427d3a['shift']());}};_0xe5c521(++_0x23724c);}(_0x80df,0x17e));var _0xf80d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80df[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf80d('0x0'));var util=require(_0xf80d('0x1'));var moment=require(_0xf80d('0x2'));var BPromise=require(_0xf80d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf80d('0x4'));var db=require(_0xf80d('0x5'))['db'];var utils=require(_0xf80d('0x6'));var logger=require(_0xf80d('0x7'))(_0xf80d('0x8'));var config=require(_0xf80d('0x9'));var jayson=require(_0xf80d('0xa'));var client=jayson[_0xf80d('0xb')][_0xf80d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x62e50f,_0x5068d4,_0x30e2b3){return new BPromise(function(_0x16b219,_0x2f56b3){return client[_0xf80d('0xd')](_0x62e50f,_0x30e2b3)[_0xf80d('0xe')](function(_0x186339){logger[_0xf80d('0xf')](_0xf80d('0x10'),_0x5068d4,_0xf80d('0x11'));logger[_0xf80d('0x12')](_0xf80d('0x13'),_0x5068d4,_0xf80d('0x11'),JSON[_0xf80d('0x14')](_0x186339));if(_0x186339[_0xf80d('0x15')]){if(_0x186339['error']['code']===0x1f4){logger[_0xf80d('0x15')](_0xf80d('0x10'),_0x5068d4,_0x186339['error'][_0xf80d('0x16')]);return _0x2f56b3(_0x186339['error'][_0xf80d('0x16')]);}logger['error'](_0xf80d('0x10'),_0x5068d4,_0x186339['error'][_0xf80d('0x16')]);return _0x16b219(_0x186339[_0xf80d('0x15')][_0xf80d('0x16')]);}else{logger[_0xf80d('0xf')](_0xf80d('0x10'),_0x5068d4,_0xf80d('0x11'));_0x16b219(_0x186339[_0xf80d('0x17')][_0xf80d('0x16')]);}})[_0xf80d('0x18')](function(_0x3b8a82){logger[_0xf80d('0x15')](_0xf80d('0x10'),_0x5068d4,_0x3b8a82);_0x2f56b3(_0x3b8a82);});});}exports[_0xf80d('0x19')]=function(_0x1d104a){var _0x34b49d=this;return new Promise(function(_0x2ea2c1,_0x7ba89c){return db[_0xf80d('0x1a')][_0xf80d('0x1b')](_0x1d104a['body'],{'raw':_0x1d104a[_0xf80d('0x1c')]?_0x1d104a[_0xf80d('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xf80d('0xe')](function(_0x539c80){logger[_0xf80d('0xf')](_0xf80d('0x19'),_0x1d104a);logger[_0xf80d('0x12')](_0xf80d('0x19'),_0x1d104a,JSON[_0xf80d('0x14')](_0x539c80));_0x2ea2c1(_0x539c80);})[_0xf80d('0x18')](function(_0x446153){logger[_0xf80d('0x15')](_0xf80d('0x19'),_0x446153[_0xf80d('0x16')],_0x1d104a);_0x7ba89c(_0x34b49d[_0xf80d('0x15')](0x1f4,_0x446153[_0xf80d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index e566710..a44d3dd 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x398c90,_0x5e7d93){var _0x99f3e7=function(_0x5b0ee0){while(--_0x5b0ee0){_0x398c90['push'](_0x398c90['shift']());}};_0x99f3e7(++_0x5e7d93);}(_0x2032,0xd9));var _0x2203=function(_0x542da8,_0x367ffd){_0x542da8=_0x542da8-0x0;var _0x24c3df=_0x2032[_0x542da8];return _0x24c3df;};'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 +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x2c090c,_0x38db9f){var _0x597b3d=function(_0x4d6ab0){while(--_0x4d6ab0){_0x2c090c['push'](_0x2c090c['shift']());}};_0x597b3d(++_0x38db9f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5ce96b,_0x44f094){_0x5ce96b=_0x5ce96b-0x0;var _0xbe18=_0x5f2f[_0x5ce96b];return _0xbe18;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 7ec81d0..c8f0243 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba6e=['passport','passport-local','moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','role','disabled','blockedAt','online','admin','blocked','add','clearBlockUser','getLicense','status','send','login','ad-login','json','use','User'];(function(_0x5349a9,_0x3245fc){var _0x4285e9=function(_0x3f6442){while(--_0x3f6442){_0x5349a9['push'](_0x5349a9['shift']());}};_0x4285e9(++_0x3245fc);}(_0xba6e,0x168));var _0xeba6=function(_0x28c02e,_0x4c9b20){_0x28c02e=_0x28c02e-0x0;var _0xa550ac=_0xba6e[_0x28c02e];return _0xa550ac;};'use strict';var passport=require(_0xeba6('0x0'));var LocalStrategy=require(_0xeba6('0x1'))['Strategy'];var moment=require(_0xeba6('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xeba6('0x3'));var util=require(_0xeba6('0x4'));var db=require(_0xeba6('0x5'))['db'];var authService=require(_0xeba6('0x6'));var utils=require(_0xeba6('0x7'));var config=require(_0xeba6('0x8'));var logger=require(_0xeba6('0x9'))(_0xeba6('0xa'));function isActiveDirectoryConfigured(_0x15fcd7){var _0xf68154=![];if(typeof _0x15fcd7[_0xeba6('0xb')]!==_0xeba6('0xc')){_0xf68154=_0x15fcd7[_0xeba6('0xb')]['baseDN']&&_0x15fcd7[_0xeba6('0xb')][_0xeba6('0xd')]&&_0x15fcd7[_0xeba6('0xb')][_0xeba6('0xe')];}return _0xf68154;}function adAuthenticate(_0x18e626,_0x229f9a,_0x59c0b8){return new BPromise(function(_0x3b713e,_0xa2ef9){try{var _0x3377fd=new ActiveDirectory(_0x18e626);_0x3377fd[_0xeba6('0xf')](_0x229f9a,_0x59c0b8,function(_0xc349cc,_0x5466e1){if(_0xc349cc){logger[_0xeba6('0x10')](_0xeba6('0x11'),_0x229f9a,util[_0xeba6('0x12')](_0xc349cc,{'showHidden':![],'depth':null}));_0xa2ef9(_0xeba6('0x13'));}else if(!_0x5466e1){logger[_0xeba6('0x10')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x229f9a);_0xa2ef9(_0xeba6('0x13'));}else{_0x3b713e(_0x5466e1);}});}catch(_0x48abfc){_0xa2ef9(_0x48abfc);}});}function ActiveDirectoryAuthenticate(_0x2a9607,_0x232ac1,_0xa66b22,_0x20a564){var _0x25d2f9,_0x32c8aa;if(!isActiveDirectoryConfigured(config)){logger[_0xeba6('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x232ac1);return _0x20a564(null,![],{'message':_0xeba6('0x13')});}return db[_0xeba6('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0xeba6('0x15'),_0xeba6('0x16')],'raw':!![]})[_0xeba6('0x17')](function(_0xd632dc){_0x25d2f9=_0xd632dc;if(!_0x25d2f9[_0xeba6('0x15')]){logger[_0xeba6('0x10')](_0xeba6('0x18'),_0x232ac1);throw new Error(_0xeba6('0x13'));}return _0x2a9607[_0xeba6('0x19')]({'attributes':['id',_0xeba6('0x1a'),_0xeba6('0x1b'),_0xeba6('0x1c'),_0xeba6('0x1d'),_0xeba6('0x1e'),'blocked',_0xeba6('0x1f'),_0xeba6('0x20')],'where':{'name':_0x232ac1,'role':{'$or':[_0xeba6('0x21'),'user','agent']},'adSsoEnabled':!![]}});})[_0xeba6('0x17')](function(_0x1264fc){if(!_0x1264fc||_0x1264fc&&_0x1264fc[_0xeba6('0x1a')]!==_0x232ac1){throw new Error(_0xeba6('0x13'));}_0x32c8aa=_0x1264fc;var _0x2b78aa=_0x32c8aa[_0xeba6('0x1a')]+'@'+config[_0xeba6('0xb')]['domain'];return adAuthenticate(config[_0xeba6('0xb')],_0x2b78aa,_0xa66b22);})[_0xeba6('0x17')](function(_0x2649e6){if(_0x32c8aa['disabled']){throw new Error(_0xeba6('0x13'));}if(_0x25d2f9[_0xeba6('0x16')]>0x0){if(_0x32c8aa[_0xeba6('0x22')]){if(moment(_0x32c8aa[_0xeba6('0x1f')])[_0xeba6('0x23')](_0x25d2f9[_0xeba6('0x16')],'minutes')>moment()){throw new Error(_0xeba6('0x13'));}return utils[_0xeba6('0x24')](_0x32c8aa,0x0,![],null)[_0xeba6('0x17')](function(){return utils[_0xeba6('0x25')](_0x32c8aa);})['then'](function(){return _0x20a564(null,_0x32c8aa);});}else{return utils[_0xeba6('0x25')](_0x32c8aa)['then'](function(){return _0x20a564(null,_0x32c8aa);});}}else{return utils['getLicense'](_0x32c8aa)[_0xeba6('0x17')](function(){return _0x20a564(null,_0x32c8aa);});}})['catch'](function(_0x2c27f9){return _0x20a564(null,![],_0x2c27f9);});}function handleError(_0x1d7107,_0x4a6a19,_0x4ad2bc){return _0x1d7107[_0xeba6('0x26')](_0x4a6a19||0x1f4)[_0xeba6('0x27')]({'message':_0x4ad2bc?_0x4ad2bc['message']||_0x4ad2bc:''});}exports[_0xeba6('0x28')]=function(_0x3327dc,_0x5c6797,_0x2f8ef6){passport['authenticate'](_0xeba6('0x29'),function(_0x1b8d06,_0x28605b,_0x56bcde){var _0x3d671f=_0x1b8d06||_0x56bcde;if(_0x3d671f){return handleError(_0x5c6797,0x191,_0x3d671f);}if(!_0x28605b){return handleError(_0x5c6797,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xc51367={'payload':{'id':_0x28605b['id'],'role':_0x28605b[_0xeba6('0x1d')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xc51367)[_0xeba6('0x17')](function(_0xf51cbb){_0x5c6797[_0xeba6('0x2a')]({'id':_0x28605b['id'],'token':_0xf51cbb,'statusCall':'','isAlreadyLogged':_0x28605b[_0xeba6('0x20')]});});}})(_0x3327dc,_0x5c6797,_0x2f8ef6);};passport[_0xeba6('0x2b')](_0xeba6('0x29'),new LocalStrategy({'usernameField':_0xeba6('0x1a'),'passwordField':_0xeba6('0x1b')},function(_0xf9eed9,_0x17c23d,_0x4be5af){return ActiveDirectoryAuthenticate(db[_0xeba6('0x2c')],_0xf9eed9,_0x17c23d,_0x4be5af);})); \ No newline at end of file +var _0x989a=['moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','url','domain','authenticate','error','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','disabled','blocked','blockedAt','online','admin','user','then','name','blockDuration','add','clearBlockUser','getLicense','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','use','ad-login','User','passport','passport-local'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x989a,0x1ae));var _0xa989=function(_0x35031c,_0x400fac){_0x35031c=_0x35031c-0x0;var _0x2a7adf=_0x989a[_0x35031c];return _0x2a7adf;};'use strict';var passport=require(_0xa989('0x0'));var LocalStrategy=require(_0xa989('0x1'))['Strategy'];var moment=require(_0xa989('0x2'));var ActiveDirectory=require(_0xa989('0x3'));var BPromise=require(_0xa989('0x4'));var util=require(_0xa989('0x5'));var db=require(_0xa989('0x6'))['db'];var authService=require(_0xa989('0x7'));var utils=require(_0xa989('0x8'));var config=require(_0xa989('0x9'));var logger=require(_0xa989('0xa'))('api');function isActiveDirectoryConfigured(_0x5735be){var _0x3f39d6=![];if(typeof _0x5735be[_0xa989('0xb')]!==_0xa989('0xc')){_0x3f39d6=_0x5735be[_0xa989('0xb')]['baseDN']&&_0x5735be[_0xa989('0xb')][_0xa989('0xd')]&&_0x5735be['activedirectory'][_0xa989('0xe')];}return _0x3f39d6;}function adAuthenticate(_0xd6ebe,_0x3fa427,_0x333c82){return new BPromise(function(_0x22990b,_0x20c364){try{var _0x3c8569=new ActiveDirectory(_0xd6ebe);_0x3c8569[_0xa989('0xf')](_0x3fa427,_0x333c82,function(_0x1a409c,_0x7d75de){if(_0x1a409c){logger[_0xa989('0x10')]('Error\x20authenticate\x20%s:\x20%s',_0x3fa427,util[_0xa989('0x11')](_0x1a409c,{'showHidden':![],'depth':null}));_0x20c364('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x7d75de){logger['error'](_0xa989('0x12'),_0x3fa427);_0x20c364('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x22990b(_0x7d75de);}});}catch(_0x592cc5){_0x20c364(_0x592cc5);}});}function ActiveDirectoryAuthenticate(_0x44b408,_0x179d53,_0x44844a,_0x50be28){var _0xd3ae18,_0x13529f;if(!isActiveDirectoryConfigured(config)){logger[_0xa989('0x10')](_0xa989('0x13'),_0x179d53);return _0x50be28(null,![],{'message':_0xa989('0x14')});}return db[_0xa989('0x15')][_0xa989('0x16')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})['then'](function(_0x304a9c){_0xd3ae18=_0x304a9c;if(!_0xd3ae18['adSsoEnabled']){logger['error'](_0xa989('0x17'),_0x179d53);throw new Error(_0xa989('0x14'));}return _0x44b408[_0xa989('0x16')]({'attributes':['id','name',_0xa989('0x18'),_0xa989('0x19'),'role',_0xa989('0x1a'),_0xa989('0x1b'),_0xa989('0x1c'),_0xa989('0x1d')],'where':{'name':_0x179d53,'role':{'$or':[_0xa989('0x1e'),_0xa989('0x1f'),'agent']},'adSsoEnabled':!![]}});})[_0xa989('0x20')](function(_0x25a025){if(!_0x25a025||_0x25a025&&_0x25a025[_0xa989('0x21')]!==_0x179d53){throw new Error(_0xa989('0x14'));}_0x13529f=_0x25a025;var _0x2aedfc=_0x13529f[_0xa989('0x21')]+'@'+config[_0xa989('0xb')][_0xa989('0xe')];return adAuthenticate(config['activedirectory'],_0x2aedfc,_0x44844a);})['then'](function(_0x4bfaa1){if(_0x13529f[_0xa989('0x1a')]){throw new Error(_0xa989('0x14'));}if(_0xd3ae18[_0xa989('0x22')]>0x0){if(_0x13529f['blocked']){if(moment(_0x13529f[_0xa989('0x1c')])[_0xa989('0x23')](_0xd3ae18['blockDuration'],'minutes')>moment()){throw new Error(_0xa989('0x14'));}return utils[_0xa989('0x24')](_0x13529f,0x0,![],null)['then'](function(){return utils[_0xa989('0x25')](_0x13529f);})['then'](function(){return _0x50be28(null,_0x13529f);});}else{return utils[_0xa989('0x25')](_0x13529f)[_0xa989('0x20')](function(){return _0x50be28(null,_0x13529f);});}}else{return utils[_0xa989('0x25')](_0x13529f)[_0xa989('0x20')](function(){return _0x50be28(null,_0x13529f);});}})['catch'](function(_0x483a5b){return _0x50be28(null,![],_0x483a5b);});}function handleError(_0x21897d,_0x34a73c,_0x33fcf4){return _0x21897d[_0xa989('0x26')](_0x34a73c||0x1f4)[_0xa989('0x27')]({'message':_0x33fcf4?_0x33fcf4[_0xa989('0x28')]||_0x33fcf4:''});}exports[_0xa989('0x29')]=function(_0x1af08c,_0x2118ed,_0x506f77){passport[_0xa989('0xf')]('ad-login',function(_0x33581a,_0x2d86ac,_0x16083c){var _0x11442e=_0x33581a||_0x16083c;if(_0x11442e){return handleError(_0x2118ed,0x191,_0x11442e);}if(!_0x2d86ac){return handleError(_0x2118ed,0x194,{'message':_0xa989('0x2a')});}else{var _0x1c1b98={'payload':{'id':_0x2d86ac['id'],'role':_0x2d86ac[_0xa989('0x2b')]},'options':{'expiresIn':0x15180}};return authService[_0xa989('0x2c')](_0x1c1b98)['then'](function(_0x3b0df3){_0x2118ed['json']({'id':_0x2d86ac['id'],'token':_0x3b0df3,'statusCall':'','isAlreadyLogged':_0x2d86ac[_0xa989('0x1d')]});});}})(_0x1af08c,_0x2118ed,_0x506f77);};passport[_0xa989('0x2d')](_0xa989('0x2e'),new LocalStrategy({'usernameField':_0xa989('0x21'),'passwordField':'password'},function(_0x17bd3a,_0x2c8435,_0x1cf0b9){return ActiveDirectoryAuthenticate(db[_0xa989('0x2f')],_0x17bd3a,_0x2c8435,_0x1cf0b9);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 8c45a17..3eb0c68 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bf7=['./authActiveDirectory.controller','post','exports','express','Router'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x7bf7,0x8f));var _0x77bf=function(_0xfa374c,_0x76b208){_0xfa374c=_0xfa374c-0x0;var _0x1fb223=_0x7bf7[_0xfa374c];return _0x1fb223;};'use strict';var express=require(_0x77bf('0x0'));var router=express[_0x77bf('0x1')]();var controller=require(_0x77bf('0x2'));router[_0x77bf('0x3')]('/',controller['login']);module[_0x77bf('0x4')]=router; \ No newline at end of file +var _0xb9d8=['login','exports','express','Router','./authActiveDirectory.controller','post'];(function(_0x1fea7a,_0x40a9d2){var _0x5f8e8c=function(_0x4eecfb){while(--_0x4eecfb){_0x1fea7a['push'](_0x1fea7a['shift']());}};_0x5f8e8c(++_0x40a9d2);}(_0xb9d8,0x1c4));var _0x8b9d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb9d8[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x8b9d('0x0'));var router=express[_0x8b9d('0x1')]();var controller=require(_0x8b9d('0x2'));router[_0x8b9d('0x3')]('/',controller[_0x8b9d('0x4')]);module[_0x8b9d('0x5')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 28da81e..f797f6d 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x13134f,_0xffe6f2){var _0x160f40=function(_0x5e0b9e){while(--_0x5e0b9e){_0x13134f['push'](_0x13134f['shift']());}};_0x160f40(++_0xffe6f2);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 +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(_0x4e14b8,_0x1400ca){var _0x1b4e0a=function(_0x1607fe){while(--_0x1607fe){_0x4e14b8['push'](_0x4e14b8['shift']());}};_0x1b4e0a(++_0x1400ca);}(_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 diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index f47948c..cf3772d 100644 --- a/server/api/authGoogle/index.js +++ b/server/api/authGoogle/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce5c=['exports','express','Router','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie'];(function(_0x441563,_0x1d4a28){var _0x2369ec=function(_0x1f97ba){while(--_0x1f97ba){_0x441563['push'](_0x441563['shift']());}};_0x2369ec(++_0x1d4a28);}(_0xce5c,0x79));var _0xcce5=function(_0x1b745b,_0x3e2d40){_0x1b745b=_0x1b745b-0x0;var _0x120a9d=_0xce5c[_0x1b745b];return _0x120a9d;};'use strict';var express=require(_0xcce5('0x0'));var passport=require('passport');var router=express[_0xcce5('0x1')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0xcce5('0x2'));router[_0xcce5('0x3')]('/',controller[_0xcce5('0x4')]);router['get'](_0xcce5('0x5'),controller[_0xcce5('0x6')],authService[_0xcce5('0x7')],userController[_0xcce5('0x4')],authService[_0xcce5('0x8')]);module[_0xcce5('0x9')]=router; \ No newline at end of file +var _0x460d=['../user/user.controller.js','../../components/auth/service','get','login','/callback','isMiddleware','setTokenCookie','passport','Router','./authGoogle.controller'];(function(_0x36a4c6,_0x20099e){var _0x600ba0=function(_0x5d8ac6){while(--_0x5d8ac6){_0x36a4c6['push'](_0x36a4c6['shift']());}};_0x600ba0(++_0x20099e);}(_0x460d,0x13d));var _0xd460=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0x460d[_0x1ed116];return _0x574066;};'use strict';var express=require('express');var passport=require(_0xd460('0x0'));var router=express[_0xd460('0x1')]();var controller=require(_0xd460('0x2'));var userController=require(_0xd460('0x3'));var authService=require(_0xd460('0x4'));router[_0xd460('0x5')]('/',controller[_0xd460('0x6')]);router[_0xd460('0x5')](_0xd460('0x7'),controller['callback'],authService[_0xd460('0x8')],userController['login'],authService[_0xd460('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 365bfe9..ece9a70 100644 --- a/server/api/authLocal/authLocal.controller.js +++ b/server/api/authLocal/authLocal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6fec=['https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','client','Setting','findOne','blockDuration','name','password','role','disabled','blocked','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'];(function(_0x24de36,_0x506331){var _0x639465=function(_0x4319a1){while(--_0x4319a1){_0x24de36['push'](_0x24de36['shift']());}};_0x639465(++_0x506331);}(_0x6fec,0xb2));var _0xc6fe=function(_0x32e6db,_0x9dc9b5){_0x32e6db=_0x32e6db-0x0;var _0x47a10b=_0x6fec[_0x32e6db];return _0x47a10b;};'use strict';var util=require(_0xc6fe('0x0'));var passport=require(_0xc6fe('0x1'));var LocalStrategy=require(_0xc6fe('0x2'))[_0xc6fe('0x3')];var jayson=require(_0xc6fe('0x4'));var _=require(_0xc6fe('0x5'));var rs=require(_0xc6fe('0x6'));var moment=require(_0xc6fe('0x7'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0xc6fe('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x33f8ad,_0x527104,_0x4a44f0,_0x196144){var _0xa32c8f,_0x3dcd02;return db[_0xc6fe('0x9')][_0xc6fe('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc6fe('0xb')],'raw':!![]})['then'](function(_0x1d49e8){_0xa32c8f=_0x1d49e8;return _0x33f8ad['findOne']({'attributes':['id',_0xc6fe('0xc'),_0xc6fe('0xd'),'salt',_0xc6fe('0xe'),_0xc6fe('0xf'),_0xc6fe('0x10'),'blockedAt',_0xc6fe('0x11')],'where':{'name':_0x527104,'role':{'$or':[_0xc6fe('0x12'),_0xc6fe('0x13'),_0xc6fe('0x14')]}}});})[_0xc6fe('0x15')](function(_0x5fb4c4){if(!_0x5fb4c4||_0x5fb4c4&&_0x5fb4c4['name']!==_0x527104){throw new Error(_0xc6fe('0x16'));}else{_0x3dcd02=_0x5fb4c4;return _0x3dcd02;}})[_0xc6fe('0x15')](function(){_0x3dcd02[_0xc6fe('0x17')](_0x4a44f0,function(_0x48307e,_0x2831d2){var _0x2f41dc=_0x3dcd02[_0xc6fe('0x11')]+0x1;if(_0x48307e){return _0x196144(_0x48307e);}else if(!_0x2831d2){if(_0x3dcd02[_0xc6fe('0xf')]){return _0x196144(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0xa32c8f[_0xc6fe('0x18')]>0x0){if(_0x3dcd02[_0xc6fe('0x10')]){if(_0xa32c8f['blockDuration']>0x0){if(moment(_0x3dcd02[_0xc6fe('0x19')])[_0xc6fe('0x1a')](_0xa32c8f[_0xc6fe('0xb')],_0xc6fe('0x1b'))>moment()){return _0x196144(null,![],{'message':_0xc6fe('0x16')});}else{return utils[_0xc6fe('0x1c')](_0x3dcd02,_0x2f41dc,![],null)[_0xc6fe('0x15')](function(){return _0x196144(null,![],{'message':_0xc6fe('0x16')});});}}else{return _0x196144(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2f41dc>=_0xa32c8f[_0xc6fe('0x18')]){return utils[_0xc6fe('0x1c')](_0x3dcd02,0x0,!![],moment())['then'](function(){return _0x196144(null,![],{'message':_0xc6fe('0x16')});});}else{return utils[_0xc6fe('0x1c')](_0x3dcd02,_0x2f41dc,![],null)['then'](function(){return _0x196144(null,![],{'message':_0xc6fe('0x16')});});}}}else{return _0x196144(null,![],{'message':_0xc6fe('0x16')});}}else{if(_0x3dcd02[_0xc6fe('0xf')]){return _0x196144(null,![],{'message':_0xc6fe('0x16')});}else if(_0xa32c8f[_0xc6fe('0x18')]>0x0){if(_0x3dcd02[_0xc6fe('0x10')]){if(_0xa32c8f[_0xc6fe('0xb')]>0x0){if(moment(_0x3dcd02[_0xc6fe('0x19')])[_0xc6fe('0x1a')](_0xa32c8f[_0xc6fe('0xb')],'minutes')>moment()){return _0x196144(null,![],{'message':_0xc6fe('0x16')});}else{return utils['clearBlockUser'](_0x3dcd02,0x0,![],null)[_0xc6fe('0x15')](function(){return utils[_0xc6fe('0x1d')](_0x3dcd02);})['then'](function(){return _0x196144(null,_0x3dcd02);});}}else{return _0x196144(null,![],{'message':_0xc6fe('0x16')});}}else{return utils[_0xc6fe('0x1c')](_0x3dcd02,0x0,![],null)[_0xc6fe('0x15')](function(){return utils[_0xc6fe('0x1d')](_0x3dcd02);})[_0xc6fe('0x15')](function(){return _0x196144(null,_0x3dcd02);})[_0xc6fe('0x1e')](function(_0x1a2703){return _0x196144(null,![],_0x1a2703);});}}else{if(_0x3dcd02[_0xc6fe('0x10')]){return _0x196144(null,![],{'message':_0xc6fe('0x16')});}else{return utils[_0xc6fe('0x1d')](_0x3dcd02)[_0xc6fe('0x15')](function(){return _0x196144(null,_0x3dcd02);});}}}});})[_0xc6fe('0x1e')](function(_0x5b7f8b){return _0x196144(null,![],_0x5b7f8b);});}function sendServiceMail(_0x5778b6){return db[_0xc6fe('0x1f')][_0xc6fe('0x20')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0xc6fe('0x21')],'as':'Smtp','include':[{'model':db[_0xc6fe('0x22')],'as':'CloudProvider'}]}]})['then'](function(_0x3bc4a0){if(!_0x3bc4a0){throw new Error(_0xc6fe('0x23'));}var _0x16cf91=_0x3bc4a0['getSmtpOptions']();var _0x479262={'account':_0x16cf91,'message':_[_0xc6fe('0x24')]({'from':util[_0xc6fe('0x25')](_0xc6fe('0x26'),_0x3bc4a0[_0xc6fe('0xc')],_0x3bc4a0[_0xc6fe('0x27')]||_0x3bc4a0['Smtp'][_0xc6fe('0x13')])},_0x5778b6)};return client[_0xc6fe('0x28')](_0xc6fe('0x29'),_0x479262);})[_0xc6fe('0x15')](function(_0x406e25){if(_0x406e25[_0xc6fe('0x2a')]){throw new Error(util[_0xc6fe('0x25')](_0xc6fe('0x2b'),_0x406e25[_0xc6fe('0x2a')][_0xc6fe('0x2c')]||JSON['stringify'](_0x406e25[_0xc6fe('0x2a')])));}return!![];});}function handleError(_0x25799c,_0x1e574a,_0xaff673){return _0x25799c[_0xc6fe('0x2d')](_0x1e574a||0x1f4)[_0xc6fe('0x2e')]({'message':_0xaff673?_0xaff673[_0xc6fe('0x2c')]||_0xaff673:''});}exports['login']=function(_0x173c24,_0x41a2d5,_0x807678){passport[_0xc6fe('0x17')](_0xc6fe('0x2f'),function(_0x36bcbe,_0x2541d1,_0x42e231){var _0x20116c=_0x36bcbe||_0x42e231;if(_0x20116c){return handleError(_0x41a2d5,0x191,_0x20116c);}if(!_0x2541d1){return handleError(_0x41a2d5,0x194,{'message':_0xc6fe('0x30')});}else{var _0x48bf29={'payload':{'id':_0x2541d1['id'],'role':_0x2541d1[_0xc6fe('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0xc6fe('0x31')](_0x48bf29)[_0xc6fe('0x15')](function(_0x19391a){_0x41a2d5[_0xc6fe('0x32')]({'id':_0x2541d1['id'],'token':_0x19391a,'statusCall':'','isAlreadyLogged':_0x2541d1[_0xc6fe('0x33')]});});}})(_0x173c24,_0x41a2d5,_0x807678);};exports[_0xc6fe('0x34')]=function(_0x699a56,_0x416c34){if(!_0x699a56['body']['email']){return handleError(_0x416c34,0x1f4,{'message':_0xc6fe('0x35')});}var _0x38852f=rs[_0xc6fe('0x36')]();_0x699a56[_0xc6fe('0x37')][_0xc6fe('0x27')]=_0x699a56[_0xc6fe('0x37')][_0xc6fe('0x27')][_0xc6fe('0x38')]()[_0xc6fe('0x39')]();var _0xfb4d54;return db[_0xc6fe('0x9')][_0xc6fe('0xa')]({'where':{'id':0x1},'attributes':[_0xc6fe('0x18'),'blockDuration'],'raw':!![]})['then'](function(_0x2dd9b3){_0xfb4d54=_0x2dd9b3;return db[_0xc6fe('0x3a')][_0xc6fe('0x20')]({'where':{'email':_0x699a56[_0xc6fe('0x37')][_0xc6fe('0x27')]}});})[_0xc6fe('0x15')](function(_0x7d12e){if(!_0x7d12e){throw new Error(_0xc6fe('0x3b'));}if(_0x7d12e[_0xc6fe('0xf')]){throw new Error(_0xc6fe('0x3c'));}if(_0x7d12e[_0xc6fe('0x10')]){if(moment(_0x7d12e['blockedAt'])['add'](_0xfb4d54[_0xc6fe('0xb')],_0xc6fe('0x1b'))>moment()){throw new Error(_0xc6fe('0x3d'));}else{_0x7d12e['blocked']=![];_0x7d12e['blockedAt']=null;}}_0x7d12e[_0xc6fe('0x3e')]=_0x38852f;_0x7d12e[_0xc6fe('0x3f')]=Date[_0xc6fe('0x40')]()+0x36ee80;return _0x7d12e['save']();})[_0xc6fe('0x15')](function(){return sendServiceMail({'to':_0x699a56[_0xc6fe('0x37')][_0xc6fe('0x27')],'subject':_0xc6fe('0x41'),'text':_0xc6fe('0x42')+_0xc6fe('0x43')+_0xc6fe('0x44')+_0x699a56[_0xc6fe('0x45')][_0xc6fe('0x46')]+_0xc6fe('0x47')+_0x38852f+'\x0a\x0a'+_0xc6fe('0x48')});})[_0xc6fe('0x15')](function(){_0x416c34['status'](0xc8)[_0xc6fe('0x2e')]({'message':_0xc6fe('0x49')});})[_0xc6fe('0x1e')](function(_0xd4a82b){return handleError(_0x416c34,0x1f4,_0xd4a82b);});};exports[_0xc6fe('0x4a')]=function(_0x20243a,_0x4a56f9){return db[_0xc6fe('0x3a')][_0xc6fe('0x20')]({'where':{'resetPasswordToken':_0x20243a['params'][_0xc6fe('0x4b')],'resetPasswordExpires':{'$gt':Date[_0xc6fe('0x40')]()}}})[_0xc6fe('0x15')](function(_0x34ae66){if(!_0x34ae66){throw new Error(_0xc6fe('0x4c'));}return db[_0xc6fe('0x9')][_0xc6fe('0xa')]({'attributes':['id',_0xc6fe('0x4d'),_0xc6fe('0x4e'),_0xc6fe('0x4f')]})[_0xc6fe('0x15')](function(_0x1f5350){if(_0x1f5350['securePassword'])authService['validatePasswordPattern'](_0x20243a[_0xc6fe('0x37')][_0xc6fe('0xd')]);if(!_0x1f5350[_0xc6fe('0x4e')]||!_0x34ae66[_0xc6fe('0x50')])return _0x34ae66;authService['validatePasswordHistory'](_0x20243a[_0xc6fe('0x37')]['password'],_0x34ae66[_0xc6fe('0x50')],_0x1f5350[_0xc6fe('0x4f')]);return _0x34ae66;})[_0xc6fe('0x15')](function(){_0x34ae66[_0xc6fe('0xd')]=_0x20243a[_0xc6fe('0x37')][_0xc6fe('0xd')];_0x34ae66['resetPasswordToken']=null;_0x34ae66['resetPasswordExpires']=null;return _0x34ae66['save']();});})['then'](function(){_0x4a56f9[_0xc6fe('0x2d')](0xc8)[_0xc6fe('0x2e')]({'message':'Password\x20reset!'});})['catch'](function(_0x5c8676){return handleError(_0x4a56f9,0x1f4,_0x5c8676);});};passport[_0xc6fe('0x51')](_0xc6fe('0x2f'),new LocalStrategy({'usernameField':_0xc6fe('0xc'),'passwordField':_0xc6fe('0xd')},function(_0x319f75,_0xd0acf8,_0x55a55e){return localAuthenticate(db['User'],_0x319f75,_0xd0acf8,_0x55a55e);})); \ No newline at end of file +var _0x1384=['The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','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','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','util','passport-local','Strategy','jayson/promise','lodash','../../mysqldb','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','blockedAt','add','clearBlockUser','getLicense','catch','MailAccount','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','minutes'];(function(_0x210451,_0x1c9949){var _0xbccbe0=function(_0x41be90){while(--_0x41be90){_0x210451['push'](_0x210451['shift']());}};_0xbccbe0(++_0x1c9949);}(_0x1384,0x1f2));var _0x4138=function(_0x57030e,_0x1b9833){_0x57030e=_0x57030e-0x0;var _0x53979a=_0x1384[_0x57030e];return _0x53979a;};'use strict';var util=require(_0x4138('0x0'));var passport=require('passport');var LocalStrategy=require(_0x4138('0x1'))[_0x4138('0x2')];var jayson=require(_0x4138('0x3'));var _=require(_0x4138('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x4138('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x4138('0x6'));var client=jayson[_0x4138('0x7')][_0x4138('0x8')]({'port':0x232b});function localAuthenticate(_0x3f09d,_0x121e29,_0x42acb0,_0x3ead99){var _0x4907e6,_0x426759;return db[_0x4138('0x9')][_0x4138('0xa')]({'where':{'id':0x1},'attributes':[_0x4138('0xb'),'blockDuration'],'raw':!![]})[_0x4138('0xc')](function(_0x49488f){_0x4907e6=_0x49488f;return _0x3f09d[_0x4138('0xa')]({'attributes':['id',_0x4138('0xd'),_0x4138('0xe'),_0x4138('0xf'),_0x4138('0x10'),_0x4138('0x11'),_0x4138('0x12'),'blockedAt',_0x4138('0x13')],'where':{'name':_0x121e29,'role':{'$or':[_0x4138('0x14'),_0x4138('0x15'),_0x4138('0x16')]}}});})[_0x4138('0xc')](function(_0x434cae){if(!_0x434cae||_0x434cae&&_0x434cae[_0x4138('0xd')]!==_0x121e29){throw new Error(_0x4138('0x17'));}else{_0x426759=_0x434cae;return _0x426759;}})[_0x4138('0xc')](function(){_0x426759[_0x4138('0x18')](_0x42acb0,function(_0x54741e,_0x2f4e16){var _0x347cd0=_0x426759['loginAttempts']+0x1;if(_0x54741e){return _0x3ead99(_0x54741e);}else if(!_0x2f4e16){if(_0x426759['disabled']){return _0x3ead99(null,![],{'message':_0x4138('0x17')});}else if(_0x4907e6[_0x4138('0xb')]>0x0){if(_0x426759['blocked']){if(_0x4907e6[_0x4138('0x19')]>0x0){if(moment(_0x426759[_0x4138('0x1a')])[_0x4138('0x1b')](_0x4907e6[_0x4138('0x19')],'minutes')>moment()){return _0x3ead99(null,![],{'message':_0x4138('0x17')});}else{return utils[_0x4138('0x1c')](_0x426759,_0x347cd0,![],null)[_0x4138('0xc')](function(){return _0x3ead99(null,![],{'message':_0x4138('0x17')});});}}else{return _0x3ead99(null,![],{'message':_0x4138('0x17')});}}else{if(_0x347cd0>=_0x4907e6[_0x4138('0xb')]){return utils[_0x4138('0x1c')](_0x426759,0x0,!![],moment())[_0x4138('0xc')](function(){return _0x3ead99(null,![],{'message':_0x4138('0x17')});});}else{return utils[_0x4138('0x1c')](_0x426759,_0x347cd0,![],null)['then'](function(){return _0x3ead99(null,![],{'message':_0x4138('0x17')});});}}}else{return _0x3ead99(null,![],{'message':_0x4138('0x17')});}}else{if(_0x426759['disabled']){return _0x3ead99(null,![],{'message':_0x4138('0x17')});}else if(_0x4907e6['allowedLoginAttempts']>0x0){if(_0x426759[_0x4138('0x12')]){if(_0x4907e6[_0x4138('0x19')]>0x0){if(moment(_0x426759[_0x4138('0x1a')])[_0x4138('0x1b')](_0x4907e6[_0x4138('0x19')],'minutes')>moment()){return _0x3ead99(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x4138('0x1c')](_0x426759,0x0,![],null)[_0x4138('0xc')](function(){return utils['getLicense'](_0x426759);})[_0x4138('0xc')](function(){return _0x3ead99(null,_0x426759);});}}else{return _0x3ead99(null,![],{'message':_0x4138('0x17')});}}else{return utils[_0x4138('0x1c')](_0x426759,0x0,![],null)['then'](function(){return utils[_0x4138('0x1d')](_0x426759);})[_0x4138('0xc')](function(){return _0x3ead99(null,_0x426759);})[_0x4138('0x1e')](function(_0x1877f9){return _0x3ead99(null,![],_0x1877f9);});}}else{if(_0x426759[_0x4138('0x12')]){return _0x3ead99(null,![],{'message':_0x4138('0x17')});}else{return utils[_0x4138('0x1d')](_0x426759)[_0x4138('0xc')](function(){return _0x3ead99(null,_0x426759);});}}}});})[_0x4138('0x1e')](function(_0x2ae1e0){return _0x3ead99(null,![],_0x2ae1e0);});}function sendServiceMail(_0x2abbf9){return db[_0x4138('0x1f')]['find']({'where':{'service':!![]},'attributes':['id',_0x4138('0xd'),'email'],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x4138('0x20')],'as':_0x4138('0x20')}]}]})['then'](function(_0x146f77){if(!_0x146f77){throw new Error(_0x4138('0x21'));}var _0x133977=_0x146f77[_0x4138('0x22')]();var _0x1ce2f1={'account':_0x133977,'message':_[_0x4138('0x23')]({'from':util[_0x4138('0x24')](_0x4138('0x25'),_0x146f77[_0x4138('0xd')],_0x146f77[_0x4138('0x26')]||_0x146f77[_0x4138('0x27')]['user'])},_0x2abbf9)};return client[_0x4138('0x28')](_0x4138('0x29'),_0x1ce2f1);})[_0x4138('0xc')](function(_0x4db444){if(_0x4db444[_0x4138('0x2a')]){throw new Error(util[_0x4138('0x24')](_0x4138('0x2b'),_0x4db444[_0x4138('0x2a')][_0x4138('0x2c')]||JSON['stringify'](_0x4db444[_0x4138('0x2a')])));}return!![];});}function handleError(_0x4d0724,_0x2f79f8,_0x5d4ea7){return _0x4d0724[_0x4138('0x2d')](_0x2f79f8||0x1f4)['send']({'message':_0x5d4ea7?_0x5d4ea7[_0x4138('0x2c')]||_0x5d4ea7:''});}exports[_0x4138('0x2e')]=function(_0x14ae76,_0x2babc0,_0xa58f7c){passport[_0x4138('0x18')](_0x4138('0x2f'),function(_0x446713,_0x33b2cc,_0x3a9628){var _0x59a764=_0x446713||_0x3a9628;if(_0x59a764){return handleError(_0x2babc0,0x191,_0x59a764);}if(!_0x33b2cc){return handleError(_0x2babc0,0x194,{'message':_0x4138('0x30')});}else{var _0x2d3ddc={'payload':{'id':_0x33b2cc['id'],'role':_0x33b2cc[_0x4138('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x4138('0x31')](_0x2d3ddc)[_0x4138('0xc')](function(_0x11488b){_0x2babc0['json']({'id':_0x33b2cc['id'],'token':_0x11488b,'statusCall':'','isAlreadyLogged':_0x33b2cc[_0x4138('0x32')]});});}})(_0x14ae76,_0x2babc0,_0xa58f7c);};exports[_0x4138('0x33')]=function(_0x4c8fe4,_0xbdf6ba){if(!_0x4c8fe4[_0x4138('0x34')][_0x4138('0x26')]){return handleError(_0xbdf6ba,0x1f4,{'message':_0x4138('0x35')});}var _0x247ad8=rs[_0x4138('0x36')]();_0x4c8fe4[_0x4138('0x34')][_0x4138('0x26')]=_0x4c8fe4[_0x4138('0x34')][_0x4138('0x26')][_0x4138('0x37')]()[_0x4138('0x38')]();var _0x505270;return db[_0x4138('0x9')][_0x4138('0xa')]({'where':{'id':0x1},'attributes':[_0x4138('0xb'),_0x4138('0x19')],'raw':!![]})[_0x4138('0xc')](function(_0x26e8d6){_0x505270=_0x26e8d6;return db[_0x4138('0x39')][_0x4138('0x3a')]({'where':{'email':_0x4c8fe4['body'][_0x4138('0x26')]}});})[_0x4138('0xc')](function(_0x2a28b5){if(!_0x2a28b5){throw new Error(_0x4138('0x3b'));}if(_0x2a28b5[_0x4138('0x11')]){throw new Error(_0x4138('0x3c'));}if(_0x2a28b5[_0x4138('0x12')]){if(moment(_0x2a28b5['blockedAt'])[_0x4138('0x1b')](_0x505270[_0x4138('0x19')],_0x4138('0x3d'))>moment()){throw new Error(_0x4138('0x3e'));}else{_0x2a28b5['blocked']=![];_0x2a28b5[_0x4138('0x1a')]=null;}}_0x2a28b5[_0x4138('0x3f')]=_0x247ad8;_0x2a28b5['resetPasswordExpires']=Date[_0x4138('0x40')]()+0x36ee80;return _0x2a28b5[_0x4138('0x41')]();})[_0x4138('0xc')](function(){return sendServiceMail({'to':_0x4c8fe4[_0x4138('0x34')]['email'],'subject':_0x4138('0x42'),'text':_0x4138('0x43')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x4c8fe4[_0x4138('0x44')][_0x4138('0x45')]+_0x4138('0x46')+_0x247ad8+'\x0a\x0a'+_0x4138('0x47')});})[_0x4138('0xc')](function(){_0xbdf6ba['status'](0xc8)['send']({'message':_0x4138('0x48')});})[_0x4138('0x1e')](function(_0x160d8c){return handleError(_0xbdf6ba,0x1f4,_0x160d8c);});};exports[_0x4138('0x49')]=function(_0x3ae2ae,_0x47cd28){return db['User'][_0x4138('0x3a')]({'where':{'resetPasswordToken':_0x3ae2ae['params'][_0x4138('0x4a')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x4138('0xc')](function(_0x53deb1){if(!_0x53deb1){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x4138('0x9')][_0x4138('0xa')]({'attributes':['id',_0x4138('0x4b'),_0x4138('0x4c'),_0x4138('0x4d')]})[_0x4138('0xc')](function(_0x34c6a4){if(_0x34c6a4[_0x4138('0x4b')])authService['validatePasswordPattern'](_0x3ae2ae[_0x4138('0x34')]['password']);if(!_0x34c6a4[_0x4138('0x4c')]||!_0x53deb1[_0x4138('0x4e')])return _0x53deb1;authService[_0x4138('0x4f')](_0x3ae2ae[_0x4138('0x34')][_0x4138('0xe')],_0x53deb1[_0x4138('0x4e')],_0x34c6a4['passwordHistoryLimit']);return _0x53deb1;})[_0x4138('0xc')](function(){_0x53deb1['password']=_0x3ae2ae[_0x4138('0x34')][_0x4138('0xe')];_0x53deb1['resetPasswordToken']=null;_0x53deb1['resetPasswordExpires']=null;return _0x53deb1[_0x4138('0x41')]();});})['then'](function(){_0x47cd28[_0x4138('0x2d')](0xc8)['send']({'message':'Password\x20reset!'});})[_0x4138('0x1e')](function(_0x29c896){return handleError(_0x47cd28,0x1f4,_0x29c896);});};passport['use'](_0x4138('0x2f'),new LocalStrategy({'usernameField':_0x4138('0xd'),'passwordField':'password'},function(_0x4cab4e,_0x3d6bbf,_0x13ab3a){return localAuthenticate(db['User'],_0x4cab4e,_0x3d6bbf,_0x13ab3a);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 64688df..a79d1e9 100644 --- a/server/api/authLocal/index.js +++ b/server/api/authLocal/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa34a=['./authLocal.controller','post','/forgot','/reset/:token','express','Router'];(function(_0x5676db,_0x5cd7d1){var _0x51394d=function(_0x10deed){while(--_0x10deed){_0x5676db['push'](_0x5676db['shift']());}};_0x51394d(++_0x5cd7d1);}(_0xa34a,0x160));var _0xaa34=function(_0x4ce783,_0x30d6d2){_0x4ce783=_0x4ce783-0x0;var _0x1fa2a1=_0xa34a[_0x4ce783];return _0x1fa2a1;};'use strict';var express=require(_0xaa34('0x0'));var router=express[_0xaa34('0x1')]();var controller=require(_0xaa34('0x2'));router[_0xaa34('0x3')]('/',controller['login']);router[_0xaa34('0x3')](_0xaa34('0x4'),controller['forgot']);router[_0xaa34('0x3')](_0xaa34('0x5'),controller['reset']);module['exports']=router; \ No newline at end of file +var _0x1f67=['express','Router','./authLocal.controller','post','/forgot','forgot','reset','exports'];(function(_0x502159,_0x3244e2){var _0x265971=function(_0x193a56){while(--_0x193a56){_0x502159['push'](_0x502159['shift']());}};_0x265971(++_0x3244e2);}(_0x1f67,0x168));var _0x71f6=function(_0xca06e,_0x25a203){_0xca06e=_0xca06e-0x0;var _0x32bb7e=_0x1f67[_0xca06e];return _0x32bb7e;};'use strict';var express=require(_0x71f6('0x0'));var router=express[_0x71f6('0x1')]();var controller=require(_0x71f6('0x2'));router[_0x71f6('0x3')]('/',controller['login']);router[_0x71f6('0x3')](_0x71f6('0x4'),controller[_0x71f6('0x5')]);router[_0x71f6('0x3')]('/reset/:token',controller[_0x71f6('0x6')]);module[_0x71f6('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 502770a..ff25864 100644 --- a/server/api/automation/automation.attributes.js +++ b/server/api/automation/automation.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc9e9=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x3c8e96,_0x49f9fd){var _0x18667f=function(_0x5b7e14){while(--_0x5b7e14){_0x3c8e96['push'](_0x3c8e96['shift']());}};_0x18667f(++_0x49f9fd);}(_0xc9e9,0x123));var _0x9c9e=function(_0x40d8d7,_0x30dd5e){_0x40d8d7=_0x40d8d7-0x0;var _0x3454cc=_0xc9e9[_0x40d8d7];return _0x3454cc;};'use strict';var Sequelize=require(_0x9c9e('0x0'));module[_0x9c9e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9c9e('0x2')]},'status':{'type':Sequelize[_0x9c9e('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9c9e('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x924e=['BOOLEAN','INTEGER','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x924e,0x7a));var _0xe924=function(_0x17c2b1,_0x423e01){_0x17c2b1=_0x17c2b1-0x0;var _0x4c2b13=_0x924e[_0x17c2b1];return _0x4c2b13;};'use strict';var Sequelize=require('sequelize');module[_0xe924('0x0')]={'name':{'type':Sequelize[_0xe924('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xe924('0x1')]},'description':{'type':Sequelize[_0xe924('0x1')]},'status':{'type':Sequelize[_0xe924('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe924('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 7503284..989bdcb 100644 --- a/server/api/automation/automation.controller.js +++ b/server/api/automation/automation.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b3d=['intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','then','rows','catch','show','params','includeAll','create','body','find','addConditions','Condition','omit','ids','Action','addActions','findOne','getActions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','fs-extra','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','Automation','rawAttributes','fieldName','key','model','map','query','keys','filters'];(function(_0x134258,_0x16c07d){var _0x494c0b=function(_0x3fe3ad){while(--_0x3fe3ad){_0x134258['push'](_0x134258['shift']());}};_0x494c0b(++_0x16c07d);}(_0x6b3d,0x1a3));var _0xd6b3=function(_0x35a8dd,_0x41adcc){_0x35a8dd=_0x35a8dd-0x0;var _0x525969=_0x6b3d[_0x35a8dd];return _0x525969;};'use strict';var emlformat=require(_0xd6b3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd6b3('0x1'));var jsonpatch=require(_0xd6b3('0x2'));var rp=require(_0xd6b3('0x3'));var moment=require('moment');var BPromise=require(_0xd6b3('0x4'));var Mustache=require('mustache');var util=require(_0xd6b3('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xd6b3('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd6b3('0x7'));var _=require('lodash');var squel=require(_0xd6b3('0x8'));var crypto=require(_0xd6b3('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xd6b3('0xa'));var toCsv=require(_0xd6b3('0x6'));var querystring=require('querystring');var Papa=require(_0xd6b3('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd6b3('0xc'));var as=require(_0xd6b3('0xd'));var hardwareService=require(_0xd6b3('0xe'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd6b3('0xf'));var db=require(_0xd6b3('0x10'))['db'];function respondWithStatusCode(_0x6062ba,_0x550b82){_0x550b82=_0x550b82||0xcc;return function(_0x535b88){if(_0x535b88){return _0x6062ba[_0xd6b3('0x11')](_0x550b82);}return _0x6062ba[_0xd6b3('0x12')](_0x550b82)[_0xd6b3('0x13')]();};}function respondWithResult(_0x49f084,_0x479264){_0x479264=_0x479264||0xc8;return function(_0x19f0d2){if(_0x19f0d2){return _0x49f084[_0xd6b3('0x12')](_0x479264)[_0xd6b3('0x14')](_0x19f0d2);}};}function respondWithFilteredResult(_0x1dd995,_0x3ee5f9){return function(_0x19e7ff){if(_0x19e7ff){var _0x1efe8d=typeof _0x3ee5f9[_0xd6b3('0x15')]===_0xd6b3('0x16')&&typeof _0x3ee5f9['limit']==='undefined';var _0x5cd5d5=_0x19e7ff['count'];var _0x5f21d7=_0x1efe8d?0x0:_0x3ee5f9[_0xd6b3('0x15')];var _0x14c6cb=_0x1efe8d?_0x19e7ff[_0xd6b3('0x17')]:_0x3ee5f9[_0xd6b3('0x15')]+_0x3ee5f9['limit'];var _0x3a11f0;if(_0x14c6cb>=_0x5cd5d5){_0x14c6cb=_0x5cd5d5;_0x3a11f0=0xc8;}else{_0x3a11f0=0xce;}_0x1dd995[_0xd6b3('0x12')](_0x3a11f0);return _0x1dd995[_0xd6b3('0x18')](_0xd6b3('0x19'),_0x5f21d7+'-'+_0x14c6cb+'/'+_0x5cd5d5)[_0xd6b3('0x14')](_0x19e7ff);}return null;};}function patchUpdates(_0x5075bf){return function(_0x5a44bc){try{jsonpatch[_0xd6b3('0x1a')](_0x5a44bc,_0x5075bf,!![]);}catch(_0x1dc60b){return BPromise[_0xd6b3('0x1b')](_0x1dc60b);}return _0x5a44bc[_0xd6b3('0x1c')]();};}function saveUpdates(_0x513709,_0x16d64d){return function(_0x4e528e){if(_0x4e528e){return _0x4e528e[_0xd6b3('0x1d')](_0x513709)['then'](function(_0x30528f){return _0x30528f;});}return null;};}function removeEntity(_0x16d292,_0x2e2ba7){return function(_0x218969){if(_0x218969){return _0x218969[_0xd6b3('0x1e')]()['then'](function(){_0x16d292[_0xd6b3('0x12')](0xcc)[_0xd6b3('0x13')]();});}};}function handleEntityNotFound(_0xa48ff1,_0x475622){return function(_0x57f50c){if(!_0x57f50c){_0xa48ff1[_0xd6b3('0x11')](0x194);}return _0x57f50c;};}function handleError(_0x484a60,_0x16eb3d){_0x16eb3d=_0x16eb3d||0x1f4;return function(_0x1a7d46){logger[_0xd6b3('0x1f')](_0x1a7d46[_0xd6b3('0x20')]);if(_0x1a7d46['name']){delete _0x1a7d46[_0xd6b3('0x21')];}_0x484a60[_0xd6b3('0x12')](_0x16eb3d)['send'](_0x1a7d46);};}exports['index']=function(_0x2e4796,_0x53738c){var _0x45601b={},_0x35b2f3={},_0x3960e7={'count':0x0,'rows':[]};var _0x4901d4=_['map'](db[_0xd6b3('0x22')][_0xd6b3('0x23')],function(_0x57dc4f){return{'name':_0x57dc4f[_0xd6b3('0x24')],'type':_0x57dc4f['type'][_0xd6b3('0x25')]};});_0x35b2f3[_0xd6b3('0x26')]=_[_0xd6b3('0x27')](_0x4901d4,_0xd6b3('0x21'));_0x35b2f3[_0xd6b3('0x28')]=_[_0xd6b3('0x29')](_0x2e4796[_0xd6b3('0x28')]);_0x35b2f3[_0xd6b3('0x2a')]=_[_0xd6b3('0x2b')](_0x35b2f3[_0xd6b3('0x26')],_0x35b2f3[_0xd6b3('0x28')]);_0x45601b[_0xd6b3('0x2c')]=_['intersection'](_0x35b2f3[_0xd6b3('0x26')],qs['fields'](_0x2e4796[_0xd6b3('0x28')][_0xd6b3('0x2d')]));_0x45601b[_0xd6b3('0x2c')]=_0x45601b['attributes'][_0xd6b3('0x2e')]?_0x45601b['attributes']:_0x35b2f3[_0xd6b3('0x26')];if(!_0x2e4796[_0xd6b3('0x28')][_0xd6b3('0x2f')](_0xd6b3('0x30'))){_0x45601b[_0xd6b3('0x31')]=qs[_0xd6b3('0x31')](_0x2e4796[_0xd6b3('0x28')][_0xd6b3('0x31')]);_0x45601b['offset']=qs['offset'](_0x2e4796[_0xd6b3('0x28')][_0xd6b3('0x15')]);}_0x45601b[_0xd6b3('0x32')]=qs['sort'](_0x2e4796[_0xd6b3('0x28')][_0xd6b3('0x33')]);_0x45601b[_0xd6b3('0x34')]=qs[_0xd6b3('0x2a')](_[_0xd6b3('0x35')](_0x2e4796[_0xd6b3('0x28')],_0x35b2f3['filters']),_0x4901d4);if(_0x2e4796[_0xd6b3('0x28')][_0xd6b3('0x36')]){_0x45601b['where']=_[_0xd6b3('0x37')](_0x45601b[_0xd6b3('0x34')],{'$or':_['map'](_0x4901d4,function(_0x281c23){if(_0x281c23['type']!==_0xd6b3('0x38')){var _0xe9077a={};_0xe9077a[_0x281c23[_0xd6b3('0x21')]]={'$like':'%'+_0x2e4796['query']['filter']+'%'};return _0xe9077a;}})});}_0x45601b=_[_0xd6b3('0x37')]({},_0x45601b,_0x2e4796[_0xd6b3('0x39')]);var _0x419f25={'where':_0x45601b[_0xd6b3('0x34')]};return db[_0xd6b3('0x22')][_0xd6b3('0x17')](_0x419f25)['then'](function(_0x22b101){_0x3960e7[_0xd6b3('0x17')]=_0x22b101;if(_0x2e4796[_0xd6b3('0x28')]['includeAll']){_0x45601b[_0xd6b3('0x3a')]=[{'all':!![]}];}return db[_0xd6b3('0x22')][_0xd6b3('0x3b')](_0x45601b);})[_0xd6b3('0x3c')](function(_0x195a3a){_0x3960e7[_0xd6b3('0x3d')]=_0x195a3a;return _0x3960e7;})[_0xd6b3('0x3c')](respondWithFilteredResult(_0x53738c,_0x45601b))[_0xd6b3('0x3e')](handleError(_0x53738c,null));};exports[_0xd6b3('0x3f')]=function(_0x5e1256,_0x167be5){var _0x3adcb6={'raw':![],'where':{'id':_0x5e1256[_0xd6b3('0x40')]['id']}},_0x1dd7c4={};_0x1dd7c4[_0xd6b3('0x26')]=_[_0xd6b3('0x29')](db[_0xd6b3('0x22')][_0xd6b3('0x23')]);_0x1dd7c4[_0xd6b3('0x28')]=_[_0xd6b3('0x29')](_0x5e1256[_0xd6b3('0x28')]);_0x1dd7c4['filters']=_[_0xd6b3('0x2b')](_0x1dd7c4['model'],_0x1dd7c4[_0xd6b3('0x28')]);_0x3adcb6[_0xd6b3('0x2c')]=_[_0xd6b3('0x2b')](_0x1dd7c4[_0xd6b3('0x26')],qs[_0xd6b3('0x2d')](_0x5e1256[_0xd6b3('0x28')]['fields']));_0x3adcb6[_0xd6b3('0x2c')]=_0x3adcb6['attributes'][_0xd6b3('0x2e')]?_0x3adcb6[_0xd6b3('0x2c')]:_0x1dd7c4[_0xd6b3('0x26')];if(_0x5e1256[_0xd6b3('0x28')][_0xd6b3('0x41')]){_0x3adcb6[_0xd6b3('0x3a')]=[{'all':!![]}];}_0x3adcb6=_[_0xd6b3('0x37')]({},_0x3adcb6,_0x5e1256[_0xd6b3('0x39')]);return db[_0xd6b3('0x22')]['find'](_0x3adcb6)[_0xd6b3('0x3c')](handleEntityNotFound(_0x167be5,null))[_0xd6b3('0x3c')](respondWithResult(_0x167be5,null))[_0xd6b3('0x3e')](handleError(_0x167be5,null));};exports[_0xd6b3('0x42')]=function(_0x165be5,_0x1cdc60){return db[_0xd6b3('0x22')][_0xd6b3('0x42')](_0x165be5['body'],{})[_0xd6b3('0x3c')](respondWithResult(_0x1cdc60,0xc9))['catch'](handleError(_0x1cdc60,null));};exports['update']=function(_0x4fb8e7,_0x440faf){if(_0x4fb8e7['body']['id']){delete _0x4fb8e7[_0xd6b3('0x43')]['id'];}return db['Automation']['find']({'where':{'id':_0x4fb8e7[_0xd6b3('0x40')]['id']}})[_0xd6b3('0x3c')](handleEntityNotFound(_0x440faf,null))[_0xd6b3('0x3c')](saveUpdates(_0x4fb8e7[_0xd6b3('0x43')],null))['then'](respondWithResult(_0x440faf,null))[_0xd6b3('0x3e')](handleError(_0x440faf,null));};exports['destroy']=function(_0x1ebb17,_0x438877){return db['Automation'][_0xd6b3('0x44')]({'where':{'id':_0x1ebb17[_0xd6b3('0x40')]['id']}})['then'](handleEntityNotFound(_0x438877,null))['then'](removeEntity(_0x438877,null))[_0xd6b3('0x3e')](handleError(_0x438877,null));};exports[_0xd6b3('0x45')]=function(_0x4a3726,_0x3a4d67,_0x2e87a9){return db[_0xd6b3('0x46')][_0xd6b3('0x44')]({'where':{'id':_0x4a3726['params']['id']}})[_0xd6b3('0x3c')](handleEntityNotFound(_0x3a4d67,null))[_0xd6b3('0x3c')](function(_0x6f9dda){if(_0x6f9dda){return _0x6f9dda[_0xd6b3('0x45')](_0x4a3726[_0xd6b3('0x43')]['ids'],_[_0xd6b3('0x47')](_0x4a3726[_0xd6b3('0x43')],[_0xd6b3('0x48'),'id'])||{});}})[_0xd6b3('0x3c')](respondWithResult(_0x3a4d67,null))[_0xd6b3('0x3e')](handleError(_0x3a4d67,null));};exports['getConditions']=function(_0x41c06d,_0x212e26,_0x367a45){var _0x524235={};var _0x3af15b={};var _0x24734f;var _0x258ae4;return db[_0xd6b3('0x22')]['findOne']({'where':{'id':_0x41c06d[_0xd6b3('0x40')]['id']}})[_0xd6b3('0x3c')](handleEntityNotFound(_0x212e26,null))[_0xd6b3('0x3c')](function(_0x209772){if(_0x209772){_0x24734f=_0x209772;_0x3af15b[_0xd6b3('0x26')]=_['keys'](db['Condition'][_0xd6b3('0x23')]);_0x3af15b[_0xd6b3('0x28')]=_[_0xd6b3('0x29')](_0x41c06d['query']);_0x3af15b[_0xd6b3('0x2a')]=_[_0xd6b3('0x2b')](_0x3af15b[_0xd6b3('0x26')],_0x3af15b[_0xd6b3('0x28')]);_0x524235[_0xd6b3('0x2c')]=_[_0xd6b3('0x2b')](_0x3af15b['model'],qs[_0xd6b3('0x2d')](_0x41c06d[_0xd6b3('0x28')][_0xd6b3('0x2d')]));_0x524235[_0xd6b3('0x2c')]=_0x524235[_0xd6b3('0x2c')][_0xd6b3('0x2e')]?_0x524235[_0xd6b3('0x2c')]:_0x3af15b[_0xd6b3('0x26')];_0x524235[_0xd6b3('0x32')]=qs['sort'](_0x41c06d[_0xd6b3('0x28')][_0xd6b3('0x33')]);_0x524235[_0xd6b3('0x34')]=qs[_0xd6b3('0x2a')](_['pick'](_0x41c06d[_0xd6b3('0x28')],_0x3af15b[_0xd6b3('0x2a')]));if(_0x41c06d[_0xd6b3('0x28')][_0xd6b3('0x36')]){_0x524235[_0xd6b3('0x34')]=_[_0xd6b3('0x37')](_0x524235[_0xd6b3('0x34')],{'$or':_[_0xd6b3('0x27')](_0x524235[_0xd6b3('0x2c')],function(_0x4fd2ae){var _0xa8c5ee={};_0xa8c5ee[_0x4fd2ae]={'$like':'%'+_0x41c06d['query']['filter']+'%'};return _0xa8c5ee;})});}_0x524235=_['merge']({},_0x524235,_0x41c06d[_0xd6b3('0x39')]);return _0x24734f['getConditions'](_0x524235);}})['then'](function(_0x9376a9){if(_0x9376a9){_0x258ae4=_0x9376a9['length'];if(!_0x41c06d[_0xd6b3('0x28')][_0xd6b3('0x2f')](_0xd6b3('0x30'))){_0x524235['limit']=qs[_0xd6b3('0x31')](_0x41c06d[_0xd6b3('0x28')]['limit']);_0x524235['offset']=qs['offset'](_0x41c06d[_0xd6b3('0x28')]['offset']);}return _0x24734f['getConditions'](_0x524235);}})['then'](function(_0x511ef7){if(_0x511ef7){return _0x511ef7?{'count':_0x258ae4,'rows':_0x511ef7}:null;}})[_0xd6b3('0x3c')](respondWithResult(_0x212e26,null))['catch'](handleError(_0x212e26,null));};exports['addActions']=function(_0x5cdb09,_0x3dce16,_0x8bf187){return db[_0xd6b3('0x49')]['find']({'where':{'id':_0x5cdb09[_0xd6b3('0x40')]['id']}})['then'](handleEntityNotFound(_0x3dce16,null))[_0xd6b3('0x3c')](function(_0x10fead){if(_0x10fead){return _0x10fead[_0xd6b3('0x4a')](_0x5cdb09[_0xd6b3('0x43')][_0xd6b3('0x48')],_['omit'](_0x5cdb09[_0xd6b3('0x43')],['ids','id'])||{});}})[_0xd6b3('0x3c')](respondWithResult(_0x3dce16,null))[_0xd6b3('0x3e')](handleError(_0x3dce16,null));};exports['getActions']=function(_0xddc8b2,_0x47def,_0x38770a){var _0x4c791e={};var _0x8b3977={};var _0x3d340b;var _0x3072d1;return db[_0xd6b3('0x22')][_0xd6b3('0x4b')]({'where':{'id':_0xddc8b2[_0xd6b3('0x40')]['id']}})['then'](handleEntityNotFound(_0x47def,null))[_0xd6b3('0x3c')](function(_0x6316ae){if(_0x6316ae){_0x3d340b=_0x6316ae;_0x8b3977[_0xd6b3('0x26')]=_['keys'](db[_0xd6b3('0x49')][_0xd6b3('0x23')]);_0x8b3977[_0xd6b3('0x28')]=_['keys'](_0xddc8b2[_0xd6b3('0x28')]);_0x8b3977[_0xd6b3('0x2a')]=_['intersection'](_0x8b3977[_0xd6b3('0x26')],_0x8b3977[_0xd6b3('0x28')]);_0x4c791e[_0xd6b3('0x2c')]=_[_0xd6b3('0x2b')](_0x8b3977[_0xd6b3('0x26')],qs[_0xd6b3('0x2d')](_0xddc8b2['query'][_0xd6b3('0x2d')]));_0x4c791e[_0xd6b3('0x2c')]=_0x4c791e[_0xd6b3('0x2c')][_0xd6b3('0x2e')]?_0x4c791e[_0xd6b3('0x2c')]:_0x8b3977[_0xd6b3('0x26')];_0x4c791e['order']=qs['sort'](_0xddc8b2[_0xd6b3('0x28')]['sort']);_0x4c791e['where']=qs[_0xd6b3('0x2a')](_[_0xd6b3('0x35')](_0xddc8b2['query'],_0x8b3977[_0xd6b3('0x2a')]));if(_0xddc8b2[_0xd6b3('0x28')][_0xd6b3('0x36')]){_0x4c791e[_0xd6b3('0x34')]=_[_0xd6b3('0x37')](_0x4c791e[_0xd6b3('0x34')],{'$or':_[_0xd6b3('0x27')](_0x4c791e[_0xd6b3('0x2c')],function(_0xb5913){var _0x26cbf7={};_0x26cbf7[_0xb5913]={'$like':'%'+_0xddc8b2['query'][_0xd6b3('0x36')]+'%'};return _0x26cbf7;})});}_0x4c791e=_[_0xd6b3('0x37')]({},_0x4c791e,_0xddc8b2['options']);return _0x3d340b[_0xd6b3('0x4c')](_0x4c791e);}})[_0xd6b3('0x3c')](function(_0x119f3d){if(_0x119f3d){_0x3072d1=_0x119f3d[_0xd6b3('0x2e')];if(!_0xddc8b2[_0xd6b3('0x28')]['hasOwnProperty']('nolimit')){_0x4c791e['limit']=qs[_0xd6b3('0x31')](_0xddc8b2[_0xd6b3('0x28')][_0xd6b3('0x31')]);_0x4c791e[_0xd6b3('0x15')]=qs[_0xd6b3('0x15')](_0xddc8b2['query'][_0xd6b3('0x15')]);}return _0x3d340b[_0xd6b3('0x4c')](_0x4c791e);}})[_0xd6b3('0x3c')](function(_0x5f174f){if(_0x5f174f){return _0x5f174f?{'count':_0x3072d1,'rows':_0x5f174f}:null;}})[_0xd6b3('0x3c')](respondWithResult(_0x47def,null))[_0xd6b3('0x3e')](handleError(_0x47def,null));}; \ No newline at end of file +var _0xceb1=['mustache','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','reject','save','update','destroy','then','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','Automation','includeAll','include','findAll','rows','params','merge','find','catch','create','body','addConditions','Condition','ids','omit','getConditions','findOne','hasOwnProperty','addActions','getActions','Action','order','options','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x573624,_0x5e9cea){var _0x4f8393=function(_0x486de8){while(--_0x486de8){_0x573624['push'](_0x573624['shift']());}};_0x4f8393(++_0x5e9cea);}(_0xceb1,0x1f1));var _0x1ceb=function(_0x351456,_0x2f81d5){_0x351456=_0x351456-0x0;var _0x4f9217=_0xceb1[_0x351456];return _0x4f9217;};'use strict';var emlformat=require(_0x1ceb('0x0'));var rimraf=require(_0x1ceb('0x1'));var zipdir=require(_0x1ceb('0x2'));var jsonpatch=require(_0x1ceb('0x3'));var rp=require(_0x1ceb('0x4'));var moment=require(_0x1ceb('0x5'));var BPromise=require(_0x1ceb('0x6'));var Mustache=require(_0x1ceb('0x7'));var util=require(_0x1ceb('0x8'));var path=require(_0x1ceb('0x9'));var sox=require('sox');var csv=require(_0x1ceb('0xa'));var ejs=require(_0x1ceb('0xb'));var fs=require('fs');var fs_extra=require(_0x1ceb('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1ceb('0xd'));var deskjs=require(_0x1ceb('0xe'));var toCsv=require(_0x1ceb('0xa'));var querystring=require(_0x1ceb('0xf'));var Papa=require('papaparse');var Redis=require(_0x1ceb('0x10'));var authService=require(_0x1ceb('0x11'));var qs=require(_0x1ceb('0x12'));var as=require(_0x1ceb('0x13'));var hardwareService=require(_0x1ceb('0x14'));var logger=require(_0x1ceb('0x15'))(_0x1ceb('0x16'));var utils=require('../../config/utils');var config=require(_0x1ceb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ceb('0x18'))['db'];function respondWithStatusCode(_0x38e8b9,_0x16fbbc){_0x16fbbc=_0x16fbbc||0xcc;return function(_0x5d8459){if(_0x5d8459){return _0x38e8b9[_0x1ceb('0x19')](_0x16fbbc);}return _0x38e8b9[_0x1ceb('0x1a')](_0x16fbbc)[_0x1ceb('0x1b')]();};}function respondWithResult(_0x5281ce,_0x2daa67){_0x2daa67=_0x2daa67||0xc8;return function(_0x2d6ef1){if(_0x2d6ef1){return _0x5281ce[_0x1ceb('0x1a')](_0x2daa67)['json'](_0x2d6ef1);}};}function respondWithFilteredResult(_0xc7bf76,_0x14038e){return function(_0x4856e0){if(_0x4856e0){var _0xb6d67c=typeof _0x14038e['offset']==='undefined'&&typeof _0x14038e[_0x1ceb('0x1c')]===_0x1ceb('0x1d');var _0x5b1fcf=_0x4856e0[_0x1ceb('0x1e')];var _0x333460=_0xb6d67c?0x0:_0x14038e[_0x1ceb('0x1f')];var _0x26e006=_0xb6d67c?_0x4856e0['count']:_0x14038e[_0x1ceb('0x1f')]+_0x14038e[_0x1ceb('0x1c')];var _0x1a6ba8;if(_0x26e006>=_0x5b1fcf){_0x26e006=_0x5b1fcf;_0x1a6ba8=0xc8;}else{_0x1a6ba8=0xce;}_0xc7bf76[_0x1ceb('0x1a')](_0x1a6ba8);return _0xc7bf76[_0x1ceb('0x20')](_0x1ceb('0x21'),_0x333460+'-'+_0x26e006+'/'+_0x5b1fcf)[_0x1ceb('0x22')](_0x4856e0);}return null;};}function patchUpdates(_0x2e6cf6){return function(_0x4f9c2e){try{jsonpatch['apply'](_0x4f9c2e,_0x2e6cf6,!![]);}catch(_0x1b05e9){return BPromise[_0x1ceb('0x23')](_0x1b05e9);}return _0x4f9c2e[_0x1ceb('0x24')]();};}function saveUpdates(_0x4da214,_0x1e0159){return function(_0x3d83de){if(_0x3d83de){return _0x3d83de[_0x1ceb('0x25')](_0x4da214)['then'](function(_0x399519){return _0x399519;});}return null;};}function removeEntity(_0x33eea9,_0x49bf71){return function(_0x41df00){if(_0x41df00){return _0x41df00[_0x1ceb('0x26')]()[_0x1ceb('0x27')](function(){_0x33eea9[_0x1ceb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f731f,_0x5ef71b){return function(_0x1e91e8){if(!_0x1e91e8){_0x2f731f[_0x1ceb('0x19')](0x194);}return _0x1e91e8;};}function handleError(_0x4e6694,_0x2e3dac){_0x2e3dac=_0x2e3dac||0x1f4;return function(_0x5eba47){logger['error'](_0x5eba47['stack']);if(_0x5eba47[_0x1ceb('0x28')]){delete _0x5eba47[_0x1ceb('0x28')];}_0x4e6694[_0x1ceb('0x1a')](_0x2e3dac)[_0x1ceb('0x29')](_0x5eba47);};}exports[_0x1ceb('0x2a')]=function(_0x55c483,_0x5ed631){var _0x27ddc1={},_0x20cb72={},_0x45e717={'count':0x0,'rows':[]};var _0x15b92e=_['map'](db['Automation'][_0x1ceb('0x2b')],function(_0x392531){return{'name':_0x392531['fieldName'],'type':_0x392531[_0x1ceb('0x2c')][_0x1ceb('0x2d')]};});_0x20cb72[_0x1ceb('0x2e')]=_[_0x1ceb('0x2f')](_0x15b92e,_0x1ceb('0x28'));_0x20cb72[_0x1ceb('0x30')]=_[_0x1ceb('0x31')](_0x55c483['query']);_0x20cb72[_0x1ceb('0x32')]=_[_0x1ceb('0x33')](_0x20cb72[_0x1ceb('0x2e')],_0x20cb72['query']);_0x27ddc1[_0x1ceb('0x34')]=_[_0x1ceb('0x33')](_0x20cb72['model'],qs[_0x1ceb('0x35')](_0x55c483['query'][_0x1ceb('0x35')]));_0x27ddc1[_0x1ceb('0x34')]=_0x27ddc1[_0x1ceb('0x34')][_0x1ceb('0x36')]?_0x27ddc1[_0x1ceb('0x34')]:_0x20cb72[_0x1ceb('0x2e')];if(!_0x55c483[_0x1ceb('0x30')]['hasOwnProperty'](_0x1ceb('0x37'))){_0x27ddc1['limit']=qs[_0x1ceb('0x1c')](_0x55c483[_0x1ceb('0x30')][_0x1ceb('0x1c')]);_0x27ddc1[_0x1ceb('0x1f')]=qs[_0x1ceb('0x1f')](_0x55c483['query'][_0x1ceb('0x1f')]);}_0x27ddc1['order']=qs['sort'](_0x55c483[_0x1ceb('0x30')][_0x1ceb('0x38')]);_0x27ddc1[_0x1ceb('0x39')]=qs[_0x1ceb('0x32')](_[_0x1ceb('0x3a')](_0x55c483[_0x1ceb('0x30')],_0x20cb72[_0x1ceb('0x32')]),_0x15b92e);if(_0x55c483[_0x1ceb('0x30')]['filter']){_0x27ddc1['where']=_['merge'](_0x27ddc1[_0x1ceb('0x39')],{'$or':_['map'](_0x15b92e,function(_0x578490){if(_0x578490[_0x1ceb('0x2c')]!==_0x1ceb('0x3b')){var _0x35f61b={};_0x35f61b[_0x578490[_0x1ceb('0x28')]]={'$like':'%'+_0x55c483[_0x1ceb('0x30')][_0x1ceb('0x3c')]+'%'};return _0x35f61b;}})});}_0x27ddc1=_['merge']({},_0x27ddc1,_0x55c483['options']);var _0x4a1999={'where':_0x27ddc1[_0x1ceb('0x39')]};return db[_0x1ceb('0x3d')][_0x1ceb('0x1e')](_0x4a1999)['then'](function(_0x40c28f){_0x45e717['count']=_0x40c28f;if(_0x55c483[_0x1ceb('0x30')][_0x1ceb('0x3e')]){_0x27ddc1[_0x1ceb('0x3f')]=[{'all':!![]}];}return db[_0x1ceb('0x3d')][_0x1ceb('0x40')](_0x27ddc1);})[_0x1ceb('0x27')](function(_0x548a5f){_0x45e717[_0x1ceb('0x41')]=_0x548a5f;return _0x45e717;})[_0x1ceb('0x27')](respondWithFilteredResult(_0x5ed631,_0x27ddc1))['catch'](handleError(_0x5ed631,null));};exports['show']=function(_0x15099b,_0x425464){var _0x29c369={'raw':![],'where':{'id':_0x15099b[_0x1ceb('0x42')]['id']}},_0x190a78={};_0x190a78[_0x1ceb('0x2e')]=_[_0x1ceb('0x31')](db[_0x1ceb('0x3d')][_0x1ceb('0x2b')]);_0x190a78[_0x1ceb('0x30')]=_[_0x1ceb('0x31')](_0x15099b[_0x1ceb('0x30')]);_0x190a78[_0x1ceb('0x32')]=_[_0x1ceb('0x33')](_0x190a78[_0x1ceb('0x2e')],_0x190a78[_0x1ceb('0x30')]);_0x29c369[_0x1ceb('0x34')]=_[_0x1ceb('0x33')](_0x190a78[_0x1ceb('0x2e')],qs[_0x1ceb('0x35')](_0x15099b['query'][_0x1ceb('0x35')]));_0x29c369[_0x1ceb('0x34')]=_0x29c369[_0x1ceb('0x34')][_0x1ceb('0x36')]?_0x29c369[_0x1ceb('0x34')]:_0x190a78[_0x1ceb('0x2e')];if(_0x15099b[_0x1ceb('0x30')]['includeAll']){_0x29c369[_0x1ceb('0x3f')]=[{'all':!![]}];}_0x29c369=_[_0x1ceb('0x43')]({},_0x29c369,_0x15099b['options']);return db[_0x1ceb('0x3d')][_0x1ceb('0x44')](_0x29c369)[_0x1ceb('0x27')](handleEntityNotFound(_0x425464,null))['then'](respondWithResult(_0x425464,null))[_0x1ceb('0x45')](handleError(_0x425464,null));};exports[_0x1ceb('0x46')]=function(_0x44aef8,_0x59845b){return db['Automation'][_0x1ceb('0x46')](_0x44aef8['body'],{})[_0x1ceb('0x27')](respondWithResult(_0x59845b,0xc9))['catch'](handleError(_0x59845b,null));};exports[_0x1ceb('0x25')]=function(_0x166b06,_0x2150a4){if(_0x166b06[_0x1ceb('0x47')]['id']){delete _0x166b06[_0x1ceb('0x47')]['id'];}return db[_0x1ceb('0x3d')]['find']({'where':{'id':_0x166b06[_0x1ceb('0x42')]['id']}})['then'](handleEntityNotFound(_0x2150a4,null))['then'](saveUpdates(_0x166b06['body'],null))[_0x1ceb('0x27')](respondWithResult(_0x2150a4,null))[_0x1ceb('0x45')](handleError(_0x2150a4,null));};exports[_0x1ceb('0x26')]=function(_0x1876ba,_0x14feba){return db[_0x1ceb('0x3d')][_0x1ceb('0x44')]({'where':{'id':_0x1876ba[_0x1ceb('0x42')]['id']}})[_0x1ceb('0x27')](handleEntityNotFound(_0x14feba,null))[_0x1ceb('0x27')](removeEntity(_0x14feba,null))['catch'](handleError(_0x14feba,null));};exports[_0x1ceb('0x48')]=function(_0x113734,_0x388d03,_0x4fc8cf){return db[_0x1ceb('0x49')][_0x1ceb('0x44')]({'where':{'id':_0x113734[_0x1ceb('0x42')]['id']}})[_0x1ceb('0x27')](handleEntityNotFound(_0x388d03,null))['then'](function(_0x28b667){if(_0x28b667){return _0x28b667['addConditions'](_0x113734['body'][_0x1ceb('0x4a')],_[_0x1ceb('0x4b')](_0x113734[_0x1ceb('0x47')],[_0x1ceb('0x4a'),'id'])||{});}})[_0x1ceb('0x27')](respondWithResult(_0x388d03,null))['catch'](handleError(_0x388d03,null));};exports[_0x1ceb('0x4c')]=function(_0x31883a,_0x3b01ac,_0x3b4acc){var _0x46cfb5={};var _0x43ba45={};var _0xaa45a4;var _0x80ae6d;return db[_0x1ceb('0x3d')][_0x1ceb('0x4d')]({'where':{'id':_0x31883a[_0x1ceb('0x42')]['id']}})[_0x1ceb('0x27')](handleEntityNotFound(_0x3b01ac,null))[_0x1ceb('0x27')](function(_0x5eafd3){if(_0x5eafd3){_0xaa45a4=_0x5eafd3;_0x43ba45[_0x1ceb('0x2e')]=_[_0x1ceb('0x31')](db[_0x1ceb('0x49')][_0x1ceb('0x2b')]);_0x43ba45[_0x1ceb('0x30')]=_[_0x1ceb('0x31')](_0x31883a[_0x1ceb('0x30')]);_0x43ba45[_0x1ceb('0x32')]=_[_0x1ceb('0x33')](_0x43ba45[_0x1ceb('0x2e')],_0x43ba45[_0x1ceb('0x30')]);_0x46cfb5[_0x1ceb('0x34')]=_[_0x1ceb('0x33')](_0x43ba45[_0x1ceb('0x2e')],qs[_0x1ceb('0x35')](_0x31883a[_0x1ceb('0x30')][_0x1ceb('0x35')]));_0x46cfb5[_0x1ceb('0x34')]=_0x46cfb5[_0x1ceb('0x34')]['length']?_0x46cfb5['attributes']:_0x43ba45[_0x1ceb('0x2e')];_0x46cfb5['order']=qs['sort'](_0x31883a['query'][_0x1ceb('0x38')]);_0x46cfb5[_0x1ceb('0x39')]=qs[_0x1ceb('0x32')](_['pick'](_0x31883a[_0x1ceb('0x30')],_0x43ba45[_0x1ceb('0x32')]));if(_0x31883a[_0x1ceb('0x30')][_0x1ceb('0x3c')]){_0x46cfb5[_0x1ceb('0x39')]=_[_0x1ceb('0x43')](_0x46cfb5[_0x1ceb('0x39')],{'$or':_['map'](_0x46cfb5['attributes'],function(_0x7703c7){var _0x78ed26={};_0x78ed26[_0x7703c7]={'$like':'%'+_0x31883a[_0x1ceb('0x30')][_0x1ceb('0x3c')]+'%'};return _0x78ed26;})});}_0x46cfb5=_['merge']({},_0x46cfb5,_0x31883a['options']);return _0xaa45a4[_0x1ceb('0x4c')](_0x46cfb5);}})['then'](function(_0x3ecc4b){if(_0x3ecc4b){_0x80ae6d=_0x3ecc4b[_0x1ceb('0x36')];if(!_0x31883a[_0x1ceb('0x30')][_0x1ceb('0x4e')](_0x1ceb('0x37'))){_0x46cfb5['limit']=qs[_0x1ceb('0x1c')](_0x31883a[_0x1ceb('0x30')][_0x1ceb('0x1c')]);_0x46cfb5[_0x1ceb('0x1f')]=qs[_0x1ceb('0x1f')](_0x31883a[_0x1ceb('0x30')][_0x1ceb('0x1f')]);}return _0xaa45a4[_0x1ceb('0x4c')](_0x46cfb5);}})[_0x1ceb('0x27')](function(_0x8cfaf1){if(_0x8cfaf1){return _0x8cfaf1?{'count':_0x80ae6d,'rows':_0x8cfaf1}:null;}})[_0x1ceb('0x27')](respondWithResult(_0x3b01ac,null))[_0x1ceb('0x45')](handleError(_0x3b01ac,null));};exports['addActions']=function(_0x232b2b,_0xe2de43,_0x224c0d){return db['Action'][_0x1ceb('0x44')]({'where':{'id':_0x232b2b[_0x1ceb('0x42')]['id']}})[_0x1ceb('0x27')](handleEntityNotFound(_0xe2de43,null))['then'](function(_0x967563){if(_0x967563){return _0x967563[_0x1ceb('0x4f')](_0x232b2b['body'][_0x1ceb('0x4a')],_[_0x1ceb('0x4b')](_0x232b2b[_0x1ceb('0x47')],[_0x1ceb('0x4a'),'id'])||{});}})['then'](respondWithResult(_0xe2de43,null))[_0x1ceb('0x45')](handleError(_0xe2de43,null));};exports[_0x1ceb('0x50')]=function(_0x2c6199,_0x385788,_0x2b5bd5){var _0x4bd76a={};var _0x4d5e55={};var _0x56a5e4;var _0x490dde;return db[_0x1ceb('0x3d')][_0x1ceb('0x4d')]({'where':{'id':_0x2c6199[_0x1ceb('0x42')]['id']}})[_0x1ceb('0x27')](handleEntityNotFound(_0x385788,null))[_0x1ceb('0x27')](function(_0x237cad){if(_0x237cad){_0x56a5e4=_0x237cad;_0x4d5e55[_0x1ceb('0x2e')]=_[_0x1ceb('0x31')](db[_0x1ceb('0x51')]['rawAttributes']);_0x4d5e55[_0x1ceb('0x30')]=_[_0x1ceb('0x31')](_0x2c6199[_0x1ceb('0x30')]);_0x4d5e55[_0x1ceb('0x32')]=_[_0x1ceb('0x33')](_0x4d5e55['model'],_0x4d5e55[_0x1ceb('0x30')]);_0x4bd76a[_0x1ceb('0x34')]=_[_0x1ceb('0x33')](_0x4d5e55[_0x1ceb('0x2e')],qs[_0x1ceb('0x35')](_0x2c6199[_0x1ceb('0x30')]['fields']));_0x4bd76a['attributes']=_0x4bd76a['attributes'][_0x1ceb('0x36')]?_0x4bd76a['attributes']:_0x4d5e55[_0x1ceb('0x2e')];_0x4bd76a[_0x1ceb('0x52')]=qs['sort'](_0x2c6199[_0x1ceb('0x30')]['sort']);_0x4bd76a[_0x1ceb('0x39')]=qs[_0x1ceb('0x32')](_[_0x1ceb('0x3a')](_0x2c6199[_0x1ceb('0x30')],_0x4d5e55[_0x1ceb('0x32')]));if(_0x2c6199[_0x1ceb('0x30')]['filter']){_0x4bd76a[_0x1ceb('0x39')]=_[_0x1ceb('0x43')](_0x4bd76a[_0x1ceb('0x39')],{'$or':_[_0x1ceb('0x2f')](_0x4bd76a[_0x1ceb('0x34')],function(_0x599444){var _0x11181f={};_0x11181f[_0x599444]={'$like':'%'+_0x2c6199[_0x1ceb('0x30')][_0x1ceb('0x3c')]+'%'};return _0x11181f;})});}_0x4bd76a=_['merge']({},_0x4bd76a,_0x2c6199[_0x1ceb('0x53')]);return _0x56a5e4['getActions'](_0x4bd76a);}})[_0x1ceb('0x27')](function(_0x22bcb9){if(_0x22bcb9){_0x490dde=_0x22bcb9['length'];if(!_0x2c6199[_0x1ceb('0x30')]['hasOwnProperty']('nolimit')){_0x4bd76a[_0x1ceb('0x1c')]=qs[_0x1ceb('0x1c')](_0x2c6199[_0x1ceb('0x30')][_0x1ceb('0x1c')]);_0x4bd76a[_0x1ceb('0x1f')]=qs[_0x1ceb('0x1f')](_0x2c6199[_0x1ceb('0x30')][_0x1ceb('0x1f')]);}return _0x56a5e4[_0x1ceb('0x50')](_0x4bd76a);}})[_0x1ceb('0x27')](function(_0x1109b7){if(_0x1109b7){return _0x1109b7?{'count':_0x490dde,'rows':_0x1109b7}:null;}})[_0x1ceb('0x27')](respondWithResult(_0x385788,null))[_0x1ceb('0x45')](handleError(_0x385788,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 611b87a..0d5e8ec 100644 --- a/server/api/automation/automation.model.js +++ b/server/api/automation/automation.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25f3=['define','Automation','api','moment','bluebird','../../config/environment','exports'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x25f3,0x167));var _0x325f=function(_0x256e19,_0x6e625){_0x256e19=_0x256e19-0x0;var _0x4a2bf8=_0x25f3[_0x256e19];return _0x4a2bf8;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x325f('0x0'));var moment=require(_0x325f('0x1'));var BPromise=require(_0x325f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x325f('0x3'));var attributes=require('./automation.attributes');module[_0x325f('0x4')]=function(_0x5080bb,_0x380e93){return _0x5080bb[_0x325f('0x5')](_0x325f('0x6'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5aa5=['moment','request-promise','path','rimraf','tools_automations','util','../../config/logger','api'];(function(_0x3a86a7,_0x12ade0){var _0x19b1b6=function(_0x2af9d0){while(--_0x2af9d0){_0x3a86a7['push'](_0x3a86a7['shift']());}};_0x19b1b6(++_0x12ade0);}(_0x5aa5,0x1dd));var _0x55aa=function(_0x3523aa,_0x52cd63){_0x3523aa=_0x3523aa-0x0;var _0x3231de=_0x5aa5[_0x3523aa];return _0x3231de;};'use strict';var _=require('lodash');var util=require(_0x55aa('0x0'));var logger=require(_0x55aa('0x1'))(_0x55aa('0x2'));var moment=require(_0x55aa('0x3'));var BPromise=require('bluebird');var rp=require(_0x55aa('0x4'));var fs=require('fs');var path=require(_0x55aa('0x5'));var rimraf=require(_0x55aa('0x6'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module['exports']=function(_0x29847d,_0x2fede0){return _0x29847d['define']('Automation',attributes,{'tableName':_0x55aa('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 79df4f8..30abdd2 100644 --- a/server/api/automation/automation.rpc.js +++ b/server/api/automation/automation.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4329=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3c642a,_0x35223b){var _0x9db7d6=function(_0x4d0d8d){while(--_0x4d0d8d){_0x3c642a['push'](_0x3c642a['shift']());}};_0x9db7d6(++_0x35223b);}(_0x4329,0x13b));var _0x9432=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4329[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9432('0x0'));var util=require(_0x9432('0x1'));var moment=require(_0x9432('0x2'));var BPromise=require(_0x9432('0x3'));var rs=require(_0x9432('0x4'));var fs=require('fs');var Redis=require(_0x9432('0x5'));var db=require(_0x9432('0x6'))['db'];var utils=require(_0x9432('0x7'));var logger=require(_0x9432('0x8'))(_0x9432('0x9'));var config=require(_0x9432('0xa'));var jayson=require(_0x9432('0xb'));var client=jayson[_0x9432('0xc')][_0x9432('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5568ad,_0x376967,_0x5346c3){return new BPromise(function(_0x10509f,_0x4563c4){return client['request'](_0x5568ad,_0x5346c3)[_0x9432('0xe')](function(_0x2b06c7){logger[_0x9432('0xf')](_0x9432('0x10'),_0x376967,_0x9432('0x11'));logger['debug'](_0x9432('0x12'),_0x376967,_0x9432('0x11'),JSON['stringify'](_0x2b06c7));if(_0x2b06c7['error']){if(_0x2b06c7[_0x9432('0x13')][_0x9432('0x14')]===0x1f4){logger[_0x9432('0x13')](_0x9432('0x10'),_0x376967,_0x2b06c7['error'][_0x9432('0x15')]);return _0x4563c4(_0x2b06c7[_0x9432('0x13')][_0x9432('0x15')]);}logger[_0x9432('0x13')](_0x9432('0x10'),_0x376967,_0x2b06c7['error'][_0x9432('0x15')]);return _0x10509f(_0x2b06c7[_0x9432('0x13')]['message']);}else{logger[_0x9432('0xf')](_0x9432('0x10'),_0x376967,'request\x20sent');_0x10509f(_0x2b06c7[_0x9432('0x16')][_0x9432('0x15')]);}})['catch'](function(_0x5c4360){logger['error']('Automation,\x20%s,\x20%s',_0x376967,_0x5c4360);_0x4563c4(_0x5c4360);});});} \ No newline at end of file +var _0xe2cf=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x50c03b,_0x21a32f){var _0x4e03a8=function(_0x6deeb){while(--_0x6deeb){_0x50c03b['push'](_0x50c03b['shift']());}};_0x4e03a8(++_0x21a32f);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x27fa56,_0x4def9b){_0x27fa56=_0x27fa56-0x0;var _0x25b2bc=_0xe2cf[_0x27fa56];return _0x25b2bc;};'use strict';var _=require('lodash');var util=require(_0xfe2c('0x0'));var moment=require('moment');var BPromise=require(_0xfe2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe2c('0x2'));var db=require(_0xfe2c('0x3'))['db'];var utils=require(_0xfe2c('0x4'));var logger=require(_0xfe2c('0x5'))('rpc');var config=require(_0xfe2c('0x6'));var jayson=require(_0xfe2c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e0b97,_0x417bc4,_0x5e5b46){return new BPromise(function(_0x485a24,_0x30aafe){return client[_0xfe2c('0x8')](_0x4e0b97,_0x5e5b46)[_0xfe2c('0x9')](function(_0x562414){logger['info'](_0xfe2c('0xa'),_0x417bc4,_0xfe2c('0xb'));logger['debug'](_0xfe2c('0xc'),_0x417bc4,_0xfe2c('0xb'),JSON[_0xfe2c('0xd')](_0x562414));if(_0x562414[_0xfe2c('0xe')]){if(_0x562414[_0xfe2c('0xe')][_0xfe2c('0xf')]===0x1f4){logger[_0xfe2c('0xe')]('Automation,\x20%s,\x20%s',_0x417bc4,_0x562414['error']['message']);return _0x30aafe(_0x562414['error'][_0xfe2c('0x10')]);}logger['error']('Automation,\x20%s,\x20%s',_0x417bc4,_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);return _0x485a24(_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x417bc4,_0xfe2c('0xb'));_0x485a24(_0x562414[_0xfe2c('0x11')][_0xfe2c('0x10')]);}})[_0xfe2c('0x12')](function(_0x565f40){logger[_0xfe2c('0xe')](_0xfe2c('0xa'),_0x417bc4,_0x565f40);_0x30aafe(_0x565f40);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 5fbb880..601403a 100644 --- a/server/api/automation/index.js +++ b/server/api/automation/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf712=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','isAuthenticated','/:id/conditions','getConditions','/:id/actions','getActions','create','addConditions','put','/:id'];(function(_0x115850,_0x4bb634){var _0xbad084=function(_0xa14074){while(--_0xa14074){_0x115850['push'](_0x115850['shift']());}};_0xbad084(++_0x4bb634);}(_0xf712,0x19c));var _0x2f71=function(_0x6d7a2b,_0x56bff4){_0x6d7a2b=_0x6d7a2b-0x0;var _0x3e8361=_0xf712[_0x6d7a2b];return _0x3e8361;};'use strict';var multer=require(_0x2f71('0x0'));var util=require('util');var path=require(_0x2f71('0x1'));var timeout=require(_0x2f71('0x2'));var express=require(_0x2f71('0x3'));var router=express[_0x2f71('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2f71('0x5'));var interaction=require(_0x2f71('0x6'));var config=require(_0x2f71('0x7'));var controller=require(_0x2f71('0x8'));router[_0x2f71('0x9')]('/',auth['isAuthenticated'](),controller[_0x2f71('0xa')]);router['get']('/:id',auth[_0x2f71('0xb')](),controller['show']);router[_0x2f71('0x9')](_0x2f71('0xc'),auth[_0x2f71('0xb')](),controller[_0x2f71('0xd')]);router[_0x2f71('0x9')](_0x2f71('0xe'),auth[_0x2f71('0xb')](),controller[_0x2f71('0xf')]);router['post']('/',auth[_0x2f71('0xb')](),controller[_0x2f71('0x10')]);router['post'](_0x2f71('0xc'),auth[_0x2f71('0xb')](),controller[_0x2f71('0x11')]);router['post']('/:id/actions',auth[_0x2f71('0xb')](),controller['addActions']);router[_0x2f71('0x12')](_0x2f71('0x13'),auth[_0x2f71('0xb')](),controller[_0x2f71('0x14')]);router[_0x2f71('0x15')](_0x2f71('0x13'),auth[_0x2f71('0xb')](),controller[_0x2f71('0x16')]);module[_0x2f71('0x17')]=router; \ No newline at end of file +var _0x6ae0=['update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','./automation.controller','get','index','/:id','isAuthenticated','/:id/conditions','getConditions','/:id/actions','post','create','addConditions','addActions'];(function(_0x3a60b8,_0x47caab){var _0x4eb583=function(_0x2251b5){while(--_0x2251b5){_0x3a60b8['push'](_0x3a60b8['shift']());}};_0x4eb583(++_0x47caab);}(_0x6ae0,0x192));var _0x06ae=function(_0x2b22e6,_0x3f2337){_0x2b22e6=_0x2b22e6-0x0;var _0x225b25=_0x6ae0[_0x2b22e6];return _0x225b25;};'use strict';var multer=require(_0x06ae('0x0'));var util=require(_0x06ae('0x1'));var path=require(_0x06ae('0x2'));var timeout=require(_0x06ae('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x06ae('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x06ae('0x5'));var config=require('../../config/environment');var controller=require(_0x06ae('0x6'));router[_0x06ae('0x7')]('/',auth['isAuthenticated'](),controller[_0x06ae('0x8')]);router['get'](_0x06ae('0x9'),auth[_0x06ae('0xa')](),controller['show']);router[_0x06ae('0x7')](_0x06ae('0xb'),auth[_0x06ae('0xa')](),controller[_0x06ae('0xc')]);router[_0x06ae('0x7')](_0x06ae('0xd'),auth[_0x06ae('0xa')](),controller['getActions']);router[_0x06ae('0xe')]('/',auth[_0x06ae('0xa')](),controller[_0x06ae('0xf')]);router[_0x06ae('0xe')](_0x06ae('0xb'),auth[_0x06ae('0xa')](),controller[_0x06ae('0x10')]);router['post']('/:id/actions',auth['isAuthenticated'](),controller[_0x06ae('0x11')]);router['put'](_0x06ae('0x9'),auth[_0x06ae('0xa')](),controller[_0x06ae('0x12')]);router[_0x06ae('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x06ae('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 0077fdb..79852c7 100644 --- a/server/api/campaign/campaign.attributes.js +++ b/server/api/campaign/campaign.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5990=['DESC','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'];(function(_0x2c16ab,_0xaa3f47){var _0x50d50c=function(_0x4bd914){while(--_0x4bd914){_0x2c16ab['push'](_0x2c16ab['shift']());}};_0x50d50c(++_0xaa3f47);}(_0x5990,0x1a1));var _0x0599=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5990[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x0599('0x0'));module[_0x0599('0x1')]={'name':{'type':Sequelize[_0x0599('0x2')],'unique':_0x0599('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x0599('0x2')]},'active':{'type':Sequelize[_0x0599('0x4')],'defaultValue':0x0,'comment':_0x0599('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x0599('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0599('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0599('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0599('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0599('0x8')](0x3)[_0x0599('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x0599('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0599('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0599('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0599('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x0599('0x8')](0x3)[_0x0599('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0599('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0599('0x8')](0x5)[_0x0599('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0599('0x8')](0x5)[_0x0599('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0599('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0599('0x8')](0x3)[_0x0599('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0599('0xd')},'dialTimezone':{'type':Sequelize[_0x0599('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0599('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x0599('0xe')](_0x0599('0xf'),_0x0599('0x10'),_0x0599('0x11')),'defaultValue':_0x0599('0xf')},'dialAMDActive':{'type':Sequelize[_0x0599('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0599('0x8')](0x9)[_0x0599('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0599('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x0599('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0599('0x8')](0x9)[_0x0599('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0599('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0599('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0599('0x14')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0599('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0599('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0599('0x8')](0x9)[_0x0599('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0599('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0599('0x8')](0x9)[_0x0599('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0599('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0599('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0599('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0599('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x0599('0xe')](_0x0599('0x19'),'ASC'),'defaultValue':_0x0599('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0599('0x8')](0x3)[_0x0599('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x0599('0x8')](0x3)[_0x0599('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0599('0x8')](0x3)[_0x0599('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0599('0x8')](0x5)[_0x0599('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0599('0x1a')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0599('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0599('0x1b')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0599('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0599('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0599('0x8')](0x3)[_0x0599('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0599('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0599('0x8')](0x5)[_0x0599('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0599('0x1e')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0599('0x8')](0x5)[_0x0599('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0599('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0599('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0599('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0599('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0599('0x21')}}; \ No newline at end of file +var _0x8a78=['INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\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,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED'];(function(_0x35d66b,_0x298440){var _0x3a0437=function(_0x4fa705){while(--_0x4fa705){_0x35d66b['push'](_0x35d66b['shift']());}};_0x3a0437(++_0x298440);}(_0x8a78,0x158));var _0x88a7=function(_0x3074f3,_0x4f2c03){_0x3074f3=_0x3074f3-0x0;var _0x53f112=_0x8a78[_0x3074f3];return _0x53f112;};'use strict';var Sequelize=require(_0x88a7('0x0'));module[_0x88a7('0x1')]={'name':{'type':Sequelize[_0x88a7('0x2')],'unique':_0x88a7('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x88a7('0x4')),'allowNull':![],'defaultValue':_0x88a7('0x4')},'description':{'type':Sequelize[_0x88a7('0x2')]},'active':{'type':Sequelize[_0x88a7('0x5')],'defaultValue':0x0,'comment':_0x88a7('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x88a7('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x88a7('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x88a7('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x88a7('0x8')](0x3)[_0x88a7('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x88a7('0x8')](0x3)[_0x88a7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x88a7('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x88a7('0x8')](0x5)[_0x88a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x88a7('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x88a7('0x8')](0x3)[_0x88a7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x88a7('0x8')](0x5)[_0x88a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x88a7('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x88a7('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x88a7('0x8')](0x5)[_0x88a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x88a7('0x8')](0x3)[_0x88a7('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x88a7('0xc')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x88a7('0x2')],'defaultValue':_0x88a7('0xd')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x88a7('0xe'),'never',_0x88a7('0xf')),'defaultValue':_0x88a7('0xe')},'dialAMDActive':{'type':Sequelize[_0x88a7('0x5')],'defaultValue':0x0,'comment':_0x88a7('0x10')},'dialAMDInitialSilence':{'type':Sequelize[_0x88a7('0x8')](0x9)[_0x88a7('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x88a7('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x88a7('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x88a7('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x88a7('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x88a7('0x8')](0x9)[_0x88a7('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x88a7('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x88a7('0x8')](0x9)[_0x88a7('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x88a7('0x13')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x88a7('0x8')](0x5)[_0x88a7('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x88a7('0x14')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x88a7('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x88a7('0x15'),_0x88a7('0x16')),'defaultValue':_0x88a7('0x15')},'dialPrefix':{'type':Sequelize[_0x88a7('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x88a7('0x8')](0x3)[_0x88a7('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x88a7('0x17')},'dialCutDigit':{'type':Sequelize[_0x88a7('0x8')](0x3)[_0x88a7('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x88a7('0x8')](0x3)[_0x88a7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x88a7('0x18')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x88a7('0x8')](0x5)[_0x88a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x88a7('0x19')},'dialDropMaxRetry':{'type':Sequelize[_0x88a7('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x88a7('0x8')](0x5)[_0x88a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x88a7('0x1a')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x88a7('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x88a7('0x1b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x88a7('0x8')](0x5)[_0x88a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x88a7('0x1c')},'dialMachineMaxRetry':{'type':Sequelize[_0x88a7('0x8')](0x3)[_0x88a7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x88a7('0x1d')},'dialMachineRetryFrequency':{'type':Sequelize[_0x88a7('0x8')](0x5)[_0x88a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x88a7('0x1e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x88a7('0x8')](0x3)[_0x88a7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x88a7('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x88a7('0x8')](0x5)[_0x88a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index bdfad0a..2c74a16 100644 --- a/server/api/campaign/campaign.controller.js +++ b/server/api/campaign/campaign.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc6f=['sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','show','merge','find','create','body','user','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','params','CmHopper','length','CampaignId','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','format','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','select','field','phone','NOW()','CmListId','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId\x20=\x20?','cmHopperId','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc6f,0x127));var _0xfbc6=function(_0x5c0a22,_0x3e0eb3){_0x5c0a22=_0x5c0a22-0x0;var _0x292d8e=_0xbc6f[_0x5c0a22];return _0x292d8e;};'use strict';var emlformat=require(_0xfbc6('0x0'));var rimraf=require(_0xfbc6('0x1'));var zipdir=require(_0xfbc6('0x2'));var jsonpatch=require(_0xfbc6('0x3'));var rp=require(_0xfbc6('0x4'));var moment=require(_0xfbc6('0x5'));var BPromise=require(_0xfbc6('0x6'));var Mustache=require(_0xfbc6('0x7'));var util=require('util');var path=require(_0xfbc6('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfbc6('0x9'));var fs=require('fs');var fs_extra=require(_0xfbc6('0xa'));var _=require('lodash');var squel=require(_0xfbc6('0xb'));var crypto=require(_0xfbc6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfbc6('0xd'));var toCsv=require(_0xfbc6('0xe'));var querystring=require(_0xfbc6('0xf'));var Papa=require('papaparse');var Redis=require(_0xfbc6('0x10'));var authService=require(_0xfbc6('0x11'));var qs=require(_0xfbc6('0x12'));var as=require(_0xfbc6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfbc6('0x14'));var utils=require(_0xfbc6('0x15'));var config=require(_0xfbc6('0x16'));var licenseUtil=require(_0xfbc6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x266b26,_0x2fc2d1){_0x2fc2d1=_0x2fc2d1||0xcc;return function(_0x2fb25a){if(_0x2fb25a){return _0x266b26[_0xfbc6('0x18')](_0x2fc2d1);}return _0x266b26[_0xfbc6('0x19')](_0x2fc2d1)[_0xfbc6('0x1a')]();};}function respondWithResult(_0x39efba,_0x20f3ab){_0x20f3ab=_0x20f3ab||0xc8;return function(_0x5416e8){if(_0x5416e8){return _0x39efba[_0xfbc6('0x19')](_0x20f3ab)[_0xfbc6('0x1b')](_0x5416e8);}};}function respondWithFilteredResult(_0x3721c7,_0x5212da){return function(_0x152d3d){if(_0x152d3d){var _0x3e6cd5=typeof _0x5212da[_0xfbc6('0x1c')]===_0xfbc6('0x1d')&&typeof _0x5212da[_0xfbc6('0x1e')]==='undefined';var _0x56bf3a=_0x152d3d[_0xfbc6('0x1f')];var _0x2eea68=_0x3e6cd5?0x0:_0x5212da['offset'];var _0x486b96=_0x3e6cd5?_0x152d3d[_0xfbc6('0x1f')]:_0x5212da[_0xfbc6('0x1c')]+_0x5212da[_0xfbc6('0x1e')];var _0x514b12;if(_0x486b96>=_0x56bf3a){_0x486b96=_0x56bf3a;_0x514b12=0xc8;}else{_0x514b12=0xce;}_0x3721c7[_0xfbc6('0x19')](_0x514b12);return _0x3721c7[_0xfbc6('0x20')](_0xfbc6('0x21'),_0x2eea68+'-'+_0x486b96+'/'+_0x56bf3a)['json'](_0x152d3d);}return null;};}function patchUpdates(_0x52c6fe){return function(_0x4bf3f3){try{jsonpatch[_0xfbc6('0x22')](_0x4bf3f3,_0x52c6fe,!![]);}catch(_0x4a1927){return BPromise[_0xfbc6('0x23')](_0x4a1927);}return _0x4bf3f3[_0xfbc6('0x24')]();};}function saveUpdates(_0x4ba737,_0x57d3b3){return function(_0x4afd39){if(_0x4afd39){return _0x4afd39[_0xfbc6('0x25')](_0x4ba737)[_0xfbc6('0x26')](function(_0x59d74a){return _0x59d74a;});}return null;};}function removeEntity(_0x94aa88,_0x3bca40){return function(_0x3572d7){if(_0x3572d7){return _0x3572d7[_0xfbc6('0x27')]()[_0xfbc6('0x26')](function(){var _0x575d1a=_0x3572d7[_0xfbc6('0x28')]({'plain':!![]});var _0x535952=_0xfbc6('0x29');return db['UserProfileResource'][_0xfbc6('0x27')]({'where':{'type':_0x535952,'resourceId':_0x575d1a['id']}})['then'](function(){return _0x3572d7;});})['then'](function(){_0x94aa88[_0xfbc6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2753f0,_0x4c0b60){return function(_0x37c3d3){if(!_0x37c3d3){_0x2753f0['sendStatus'](0x194);}return _0x37c3d3;};}function handleError(_0x11b105,_0x3c9ed3){_0x3c9ed3=_0x3c9ed3||0x1f4;return function(_0x52176b){logger['error'](_0x52176b['stack']);if(_0x52176b['name']){delete _0x52176b[_0xfbc6('0x2a')];}_0x11b105[_0xfbc6('0x19')](_0x3c9ed3)[_0xfbc6('0x2b')](_0x52176b);};}exports['index']=function(_0x352442,_0x2c11de){var _0x531e0b={},_0x36c13d={},_0xd37e53={'count':0x0,'rows':[]};var _0x21e864=_[_0xfbc6('0x2c')](db['Campaign'][_0xfbc6('0x2d')],function(_0x5232a0){return{'name':_0x5232a0[_0xfbc6('0x2e')],'type':_0x5232a0[_0xfbc6('0x2f')]['key']};});_0x36c13d[_0xfbc6('0x30')]=_[_0xfbc6('0x2c')](_0x21e864,_0xfbc6('0x2a'));_0x36c13d[_0xfbc6('0x31')]=_[_0xfbc6('0x32')](_0x352442[_0xfbc6('0x31')]);_0x36c13d[_0xfbc6('0x33')]=_['intersection'](_0x36c13d[_0xfbc6('0x30')],_0x36c13d[_0xfbc6('0x31')]);_0x531e0b['attributes']=_[_0xfbc6('0x34')](_0x36c13d[_0xfbc6('0x30')],qs['fields'](_0x352442[_0xfbc6('0x31')][_0xfbc6('0x35')]));_0x531e0b[_0xfbc6('0x36')]=_0x531e0b[_0xfbc6('0x36')]['length']?_0x531e0b[_0xfbc6('0x36')]:_0x36c13d[_0xfbc6('0x30')];if(!_0x352442['query'][_0xfbc6('0x37')](_0xfbc6('0x38'))){_0x531e0b[_0xfbc6('0x1e')]=qs[_0xfbc6('0x1e')](_0x352442[_0xfbc6('0x31')]['limit']);_0x531e0b[_0xfbc6('0x1c')]=qs[_0xfbc6('0x1c')](_0x352442[_0xfbc6('0x31')]['offset']);}_0x531e0b[_0xfbc6('0x39')]=qs[_0xfbc6('0x3a')](_0x352442[_0xfbc6('0x31')][_0xfbc6('0x3a')]);_0x531e0b['where']=qs[_0xfbc6('0x33')](_[_0xfbc6('0x3b')](_0x352442[_0xfbc6('0x31')],_0x36c13d[_0xfbc6('0x33')]),_0x21e864);if(_0x352442[_0xfbc6('0x31')][_0xfbc6('0x3c')]){_0x531e0b[_0xfbc6('0x3d')]=_['merge'](_0x531e0b[_0xfbc6('0x3d')],{'$or':_[_0xfbc6('0x2c')](_0x21e864,function(_0x465bb1){if(_0x465bb1[_0xfbc6('0x2f')]!==_0xfbc6('0x3e')){var _0x3c39ce={};_0x3c39ce[_0x465bb1[_0xfbc6('0x2a')]]={'$like':'%'+_0x352442[_0xfbc6('0x31')][_0xfbc6('0x3c')]+'%'};return _0x3c39ce;}})});}_0x531e0b=_['merge']({},_0x531e0b,_0x352442[_0xfbc6('0x3f')]);var _0x4ae754={'where':_0x531e0b['where']};return db[_0xfbc6('0x40')][_0xfbc6('0x1f')](_0x4ae754)['then'](function(_0x554a0f){_0xd37e53[_0xfbc6('0x1f')]=_0x554a0f;if(_0x352442[_0xfbc6('0x31')][_0xfbc6('0x41')]){_0x531e0b[_0xfbc6('0x42')]=[{'all':!![]}];}return db[_0xfbc6('0x40')][_0xfbc6('0x43')](_0x531e0b);})[_0xfbc6('0x26')](function(_0x2db510){_0xd37e53[_0xfbc6('0x44')]=_0x2db510;return _0xd37e53;})['then'](respondWithFilteredResult(_0x2c11de,_0x531e0b))[_0xfbc6('0x45')](handleError(_0x2c11de,null));};exports[_0xfbc6('0x46')]=function(_0x3170b7,_0x1a4012){var _0x11d734={'raw':![],'where':{'id':_0x3170b7['params']['id']}},_0x39c609={};_0x39c609[_0xfbc6('0x30')]=_['keys'](db[_0xfbc6('0x40')]['rawAttributes']);_0x39c609[_0xfbc6('0x31')]=_[_0xfbc6('0x32')](_0x3170b7[_0xfbc6('0x31')]);_0x39c609[_0xfbc6('0x33')]=_[_0xfbc6('0x34')](_0x39c609[_0xfbc6('0x30')],_0x39c609[_0xfbc6('0x31')]);_0x11d734[_0xfbc6('0x36')]=_['intersection'](_0x39c609[_0xfbc6('0x30')],qs[_0xfbc6('0x35')](_0x3170b7[_0xfbc6('0x31')][_0xfbc6('0x35')]));_0x11d734[_0xfbc6('0x36')]=_0x11d734['attributes']['length']?_0x11d734[_0xfbc6('0x36')]:_0x39c609[_0xfbc6('0x30')];if(_0x3170b7[_0xfbc6('0x31')]['includeAll']){_0x11d734['include']=[{'all':!![]}];}_0x11d734=_[_0xfbc6('0x47')]({},_0x11d734,_0x3170b7[_0xfbc6('0x3f')]);return db[_0xfbc6('0x40')][_0xfbc6('0x48')](_0x11d734)[_0xfbc6('0x26')](handleEntityNotFound(_0x1a4012,null))[_0xfbc6('0x26')](respondWithResult(_0x1a4012,null))[_0xfbc6('0x45')](handleError(_0x1a4012,null));};exports[_0xfbc6('0x49')]=function(_0x1bfc78,_0x324c44){return db[_0xfbc6('0x40')][_0xfbc6('0x49')](_0x1bfc78[_0xfbc6('0x4a')],{})['then'](function(_0x2d34cd){var _0x8be198=_0x1bfc78[_0xfbc6('0x4b')][_0xfbc6('0x28')]({'plain':!![]});if(!_0x8be198)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x8be198['role']===_0xfbc6('0x4b')){var _0x2ddf8e=_0x2d34cd[_0xfbc6('0x28')]({'plain':!![]});var _0x1022ec='IvrCampaigns';return db[_0xfbc6('0x4c')][_0xfbc6('0x48')]({'where':{'name':_0x1022ec,'userProfileId':_0x8be198['userProfileId']},'raw':!![]})['then'](function(_0x3556c3){if(_0x3556c3&&_0x3556c3[_0xfbc6('0x4d')]===0x0){return db[_0xfbc6('0x4e')]['create']({'name':_0x2ddf8e[_0xfbc6('0x2a')],'resourceId':_0x2ddf8e['id'],'type':_0x3556c3[_0xfbc6('0x2a')],'sectionId':_0x3556c3['id']},{})[_0xfbc6('0x26')](function(){return _0x2d34cd;});}else{return _0x2d34cd;}})[_0xfbc6('0x45')](function(_0x35f6d0){logger[_0xfbc6('0x4f')](_0xfbc6('0x50'),_0x35f6d0);throw _0x35f6d0;});}return _0x2d34cd;})[_0xfbc6('0x26')](respondWithResult(_0x324c44,0xc9))[_0xfbc6('0x45')](handleError(_0x324c44,null));};exports[_0xfbc6('0x51')]=function(_0x3aa570,_0x3bbe1d){var _0x52cac0={'where':{'id':_0x3aa570['params']['id']}},_0x44312f={};_0x44312f[_0xfbc6('0x30')]=_[_0xfbc6('0x32')](db[_0xfbc6('0x40')]['rawAttributes']);_0x52cac0['attributes']=_[_0xfbc6('0x34')](_0x44312f[_0xfbc6('0x30')],qs[_0xfbc6('0x35')](_0x3aa570[_0xfbc6('0x31')]['fields']));_0x52cac0[_0xfbc6('0x36')]=_0x52cac0[_0xfbc6('0x36')]['length']?_0x52cac0[_0xfbc6('0x36')]:_0x44312f[_0xfbc6('0x30')];if(_0x3aa570['query']['includeAll']){_0x52cac0[_0xfbc6('0x42')]=[{'all':!![]}];}_0x52cac0=_[_0xfbc6('0x47')]({},_0x52cac0,_0x3aa570[_0xfbc6('0x3f')]);return db[_0xfbc6('0x40')][_0xfbc6('0x48')](_0x52cac0)[_0xfbc6('0x26')](handleEntityNotFound(_0x3bbe1d,null))['then'](function(_0xce017b){if(_0xce017b){var _0x4111e0=_0xce017b[_0xfbc6('0x28')]({'plain':!![]});_0x4111e0=qs[_0xfbc6('0x52')](_0x4111e0,['id',_0xfbc6('0x53'),_0xfbc6('0x54')]);_0x3aa570[_0xfbc6('0x4a')]=_['omit'](_0x3aa570[_0xfbc6('0x4a')],['id','createdAt','updatedAt']);return db[_0xfbc6('0x40')][_0xfbc6('0x49')](_[_0xfbc6('0x47')](_0x4111e0,_0x3aa570[_0xfbc6('0x4a')]),{'include':_0x3aa570[_0xfbc6('0x31')][_0xfbc6('0x41')]?[{'all':!![]}]:undefined})[_0xfbc6('0x26')](function(_0x40a847){var _0x1b21c9=_0x3aa570[_0xfbc6('0x4b')][_0xfbc6('0x28')]({'plain':!![]});if(!_0x1b21c9)throw new Error(_0xfbc6('0x55'));if(_0x1b21c9['role']===_0xfbc6('0x4b')){var _0x229026=_0x40a847[_0xfbc6('0x28')]({'plain':!![]});var _0x4e5332='IvrCampaigns';return db[_0xfbc6('0x4c')][_0xfbc6('0x48')]({'where':{'name':_0x4e5332,'userProfileId':_0x1b21c9[_0xfbc6('0x56')]},'raw':!![]})['then'](function(_0x1f8d22){if(_0x1f8d22&&_0x1f8d22[_0xfbc6('0x4d')]===0x0){return db[_0xfbc6('0x4e')][_0xfbc6('0x49')]({'name':_0x229026[_0xfbc6('0x2a')],'resourceId':_0x229026['id'],'type':_0x1f8d22['name'],'sectionId':_0x1f8d22['id']},{})[_0xfbc6('0x26')](function(){return _0x40a847;});}else{return _0x40a847;}})['catch'](function(_0x309868){logger[_0xfbc6('0x4f')](_0xfbc6('0x50'),_0x309868);throw _0x309868;});}return _0x40a847;});}})[_0xfbc6('0x26')](respondWithResult(_0x3bbe1d,0xc9))['catch'](handleError(_0x3bbe1d,null));};exports[_0xfbc6('0x25')]=function(_0xb5e9dc,_0x3f7ed4){if(_0xb5e9dc[_0xfbc6('0x4a')]['id']){delete _0xb5e9dc[_0xfbc6('0x4a')]['id'];}return db[_0xfbc6('0x40')][_0xfbc6('0x48')]({'where':{'id':_0xb5e9dc[_0xfbc6('0x57')]['id']}})[_0xfbc6('0x26')](handleEntityNotFound(_0x3f7ed4,null))[_0xfbc6('0x26')](saveUpdates(_0xb5e9dc[_0xfbc6('0x4a')],null))['then'](respondWithResult(_0x3f7ed4,null))[_0xfbc6('0x45')](handleError(_0x3f7ed4,null));};exports[_0xfbc6('0x27')]=function(_0x42548e,_0xbc0a14){return db['Campaign'][_0xfbc6('0x48')]({'where':{'id':_0x42548e['params']['id']}})['then'](handleEntityNotFound(_0xbc0a14,null))[_0xfbc6('0x26')](removeEntity(_0xbc0a14,null))['catch'](handleError(_0xbc0a14,null));};exports['getHoppers']=function(_0x12167d,_0x595b58,_0x33c5c0){var _0x30382f={'raw':!![],'where':{}};var _0x5ca340={};var _0x28abf9={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x12167d[_0xfbc6('0x57')]['id']}})[_0xfbc6('0x26')](handleEntityNotFound(_0x595b58,null))[_0xfbc6('0x26')](function(_0x366775){if(_0x366775){_0x5ca340[_0xfbc6('0x30')]=_[_0xfbc6('0x32')](db[_0xfbc6('0x58')][_0xfbc6('0x2d')]);_0x5ca340['query']=_['keys'](_0x12167d['query']);_0x5ca340[_0xfbc6('0x33')]=_[_0xfbc6('0x34')](_0x5ca340[_0xfbc6('0x30')],_0x5ca340[_0xfbc6('0x31')]);_0x30382f[_0xfbc6('0x36')]=_[_0xfbc6('0x34')](_0x5ca340[_0xfbc6('0x30')],qs['fields'](_0x12167d['query'][_0xfbc6('0x35')]));_0x30382f['attributes']=_0x30382f[_0xfbc6('0x36')][_0xfbc6('0x59')]?_0x30382f[_0xfbc6('0x36')]:_0x5ca340[_0xfbc6('0x30')];if(!_0x12167d[_0xfbc6('0x31')][_0xfbc6('0x37')](_0xfbc6('0x38'))){_0x30382f[_0xfbc6('0x1e')]=qs[_0xfbc6('0x1e')](_0x12167d[_0xfbc6('0x31')]['limit']);_0x30382f['offset']=qs['offset'](_0x12167d[_0xfbc6('0x31')][_0xfbc6('0x1c')]);}_0x30382f[_0xfbc6('0x39')]=qs[_0xfbc6('0x3a')](_0x12167d[_0xfbc6('0x31')]['sort']);_0x30382f[_0xfbc6('0x3d')]=qs[_0xfbc6('0x33')](_[_0xfbc6('0x3b')](_0x12167d[_0xfbc6('0x31')],_0x5ca340[_0xfbc6('0x33')]));_0x30382f[_0xfbc6('0x3d')][_0xfbc6('0x5a')]=_0x366775['id'];if(_0x12167d[_0xfbc6('0x31')]['filter']){_0x30382f['where']=_[_0xfbc6('0x47')](_0x30382f['where'],{'$or':_[_0xfbc6('0x2c')](_0x30382f['attributes'],function(_0x2c5bbb){var _0x4a1cdd={};_0x4a1cdd[_0x2c5bbb]={'$like':'%'+_0x12167d['query'][_0xfbc6('0x3c')]+'%'};return _0x4a1cdd;})});}_0x30382f=_[_0xfbc6('0x47')]({},_0x30382f,_0x12167d[_0xfbc6('0x3f')]);return db['CmHopper'][_0xfbc6('0x1f')]({'where':_0x30382f[_0xfbc6('0x3d')]})[_0xfbc6('0x26')](function(_0x49eb6e){_0x28abf9[_0xfbc6('0x1f')]=_0x49eb6e;if(_0x12167d[_0xfbc6('0x31')][_0xfbc6('0x41')]){_0x30382f[_0xfbc6('0x42')]=[{'all':!![]}];}return db['CmHopper'][_0xfbc6('0x43')](_0x30382f);})[_0xfbc6('0x26')](function(_0x375b8f){_0x28abf9[_0xfbc6('0x44')]=_0x375b8f;return _0x28abf9;});}})[_0xfbc6('0x26')](respondWithFilteredResult(_0x595b58,_0x30382f))[_0xfbc6('0x45')](handleError(_0x595b58,null));};exports['getHopperHistories']=function(_0x4fe6b4,_0x5eba30,_0x33fd98){var _0xbe1474={'raw':!![],'where':{}};var _0x5dfe97={};var _0x256bc9={'count':0x0,'rows':[]};return db[_0xfbc6('0x40')][_0xfbc6('0x5b')]({'where':{'id':_0x4fe6b4['params']['id']}})[_0xfbc6('0x26')](handleEntityNotFound(_0x5eba30,null))[_0xfbc6('0x26')](function(_0x3aeb91){if(_0x3aeb91){_0x5dfe97[_0xfbc6('0x30')]=_[_0xfbc6('0x32')](db['CmHopperHistory'][_0xfbc6('0x2d')]);_0x5dfe97[_0xfbc6('0x31')]=_[_0xfbc6('0x32')](_0x4fe6b4[_0xfbc6('0x31')]);_0x5dfe97['filters']=_['intersection'](_0x5dfe97['model'],_0x5dfe97[_0xfbc6('0x31')]);_0xbe1474[_0xfbc6('0x36')]=_[_0xfbc6('0x34')](_0x5dfe97['model'],qs['fields'](_0x4fe6b4[_0xfbc6('0x31')]['fields']));_0xbe1474[_0xfbc6('0x36')]=_0xbe1474[_0xfbc6('0x36')][_0xfbc6('0x59')]?_0xbe1474[_0xfbc6('0x36')]:_0x5dfe97['model'];if(!_0x4fe6b4[_0xfbc6('0x31')][_0xfbc6('0x37')](_0xfbc6('0x38'))){_0xbe1474[_0xfbc6('0x1e')]=qs['limit'](_0x4fe6b4[_0xfbc6('0x31')][_0xfbc6('0x1e')]);_0xbe1474['offset']=qs[_0xfbc6('0x1c')](_0x4fe6b4['query'][_0xfbc6('0x1c')]);}_0xbe1474[_0xfbc6('0x39')]=qs[_0xfbc6('0x3a')](_0x4fe6b4[_0xfbc6('0x31')][_0xfbc6('0x3a')]);_0xbe1474[_0xfbc6('0x3d')]=qs[_0xfbc6('0x33')](_[_0xfbc6('0x3b')](_0x4fe6b4[_0xfbc6('0x31')],_0x5dfe97[_0xfbc6('0x33')]));_0xbe1474[_0xfbc6('0x3d')][_0xfbc6('0x5a')]=_0x3aeb91['id'];if(_0x4fe6b4['query'][_0xfbc6('0x3c')]){_0xbe1474['where']=_[_0xfbc6('0x47')](_0xbe1474[_0xfbc6('0x3d')],{'$or':_[_0xfbc6('0x2c')](_0xbe1474[_0xfbc6('0x36')],function(_0x5c4712){var _0x234367={};_0x234367[_0x5c4712]={'$like':'%'+_0x4fe6b4[_0xfbc6('0x31')][_0xfbc6('0x3c')]+'%'};return _0x234367;})});}_0xbe1474=_[_0xfbc6('0x47')]({},_0xbe1474,_0x4fe6b4['options']);return db[_0xfbc6('0x5c')][_0xfbc6('0x1f')]({'where':_0xbe1474[_0xfbc6('0x3d')]})['then'](function(_0x5cd893){_0x256bc9['count']=_0x5cd893;if(_0x4fe6b4['query'][_0xfbc6('0x41')]){_0xbe1474[_0xfbc6('0x42')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xfbc6('0x43')](_0xbe1474);})['then'](function(_0x2e8845){_0x256bc9[_0xfbc6('0x44')]=_0x2e8845;return _0x256bc9;});}})[_0xfbc6('0x26')](respondWithFilteredResult(_0x5eba30,_0xbe1474))[_0xfbc6('0x45')](handleError(_0x5eba30,null));};exports[_0xfbc6('0x5d')]=function(_0x99a884,_0x24808b,_0x5d40af){var _0x5cbe87={'raw':!![],'where':{}};var _0x3b2c49={};var _0x358310={'count':0x0,'rows':[]};return db[_0xfbc6('0x40')][_0xfbc6('0x5b')]({'where':{'id':_0x99a884['params']['id']}})[_0xfbc6('0x26')](handleEntityNotFound(_0x24808b,null))[_0xfbc6('0x26')](function(_0xd36be0){if(_0xd36be0){_0x3b2c49[_0xfbc6('0x30')]=_[_0xfbc6('0x32')](db[_0xfbc6('0x5e')][_0xfbc6('0x2d')]);_0x3b2c49[_0xfbc6('0x31')]=_[_0xfbc6('0x32')](_0x99a884['query']);_0x3b2c49[_0xfbc6('0x33')]=_[_0xfbc6('0x34')](_0x3b2c49['model'],_0x3b2c49[_0xfbc6('0x31')]);_0x5cbe87[_0xfbc6('0x36')]=_['intersection'](_0x3b2c49['model'],qs[_0xfbc6('0x35')](_0x99a884[_0xfbc6('0x31')]['fields']));_0x5cbe87['attributes']=_0x5cbe87[_0xfbc6('0x36')][_0xfbc6('0x59')]?_0x5cbe87[_0xfbc6('0x36')]:_0x3b2c49[_0xfbc6('0x30')];if(!_0x99a884['query'][_0xfbc6('0x37')](_0xfbc6('0x38'))){_0x5cbe87[_0xfbc6('0x1e')]=qs[_0xfbc6('0x1e')](_0x99a884[_0xfbc6('0x31')]['limit']);_0x5cbe87[_0xfbc6('0x1c')]=qs[_0xfbc6('0x1c')](_0x99a884[_0xfbc6('0x31')][_0xfbc6('0x1c')]);}_0x5cbe87['order']=qs['sort'](_0x99a884[_0xfbc6('0x31')][_0xfbc6('0x3a')]);_0x5cbe87['where']=qs['filters'](_[_0xfbc6('0x3b')](_0x99a884[_0xfbc6('0x31')],_0x3b2c49[_0xfbc6('0x33')]));_0x5cbe87['where'][_0xfbc6('0x5a')]=_0xd36be0['id'];if(_0x99a884[_0xfbc6('0x31')][_0xfbc6('0x3c')]){_0x5cbe87[_0xfbc6('0x3d')]=_[_0xfbc6('0x47')](_0x5cbe87[_0xfbc6('0x3d')],{'$or':_[_0xfbc6('0x2c')](_0x5cbe87[_0xfbc6('0x36')],function(_0x565cad){var _0xb80f9={};_0xb80f9[_0x565cad]={'$like':'%'+_0x99a884['query'][_0xfbc6('0x3c')]+'%'};return _0xb80f9;})});}_0x5cbe87=_[_0xfbc6('0x47')]({},_0x5cbe87,_0x99a884['options']);return db[_0xfbc6('0x5e')][_0xfbc6('0x1f')]({'where':_0x5cbe87[_0xfbc6('0x3d')]})[_0xfbc6('0x26')](function(_0x40a15f){_0x358310[_0xfbc6('0x1f')]=_0x40a15f;if(_0x99a884[_0xfbc6('0x31')][_0xfbc6('0x41')]){_0x5cbe87[_0xfbc6('0x42')]=[{'all':!![]}];}return db[_0xfbc6('0x5e')][_0xfbc6('0x43')](_0x5cbe87);})[_0xfbc6('0x26')](function(_0x2b3ce8){_0x358310[_0xfbc6('0x44')]=_0x2b3ce8;return _0x358310;});}})['then'](respondWithFilteredResult(_0x24808b,_0x5cbe87))[_0xfbc6('0x45')](handleError(_0x24808b,null));};exports['getHopperBlacks']=function(_0x5b3e3f,_0x22eeab,_0xc78df0){var _0x4a0dbc={'raw':!![],'where':{}};var _0x25e443={};var _0x4f5ae8={'count':0x0,'rows':[]};return db[_0xfbc6('0x40')]['findOne']({'where':{'id':_0x5b3e3f[_0xfbc6('0x57')]['id']}})[_0xfbc6('0x26')](handleEntityNotFound(_0x22eeab,null))[_0xfbc6('0x26')](function(_0x58d51b){if(_0x58d51b){_0x25e443[_0xfbc6('0x30')]=_['keys'](db['CmHopperBlack'][_0xfbc6('0x2d')]);_0x25e443[_0xfbc6('0x31')]=_[_0xfbc6('0x32')](_0x5b3e3f[_0xfbc6('0x31')]);_0x25e443[_0xfbc6('0x33')]=_[_0xfbc6('0x34')](_0x25e443[_0xfbc6('0x30')],_0x25e443['query']);_0x4a0dbc[_0xfbc6('0x36')]=_[_0xfbc6('0x34')](_0x25e443['model'],qs[_0xfbc6('0x35')](_0x5b3e3f['query'][_0xfbc6('0x35')]));_0x4a0dbc[_0xfbc6('0x36')]=_0x4a0dbc['attributes'][_0xfbc6('0x59')]?_0x4a0dbc[_0xfbc6('0x36')]:_0x25e443[_0xfbc6('0x30')];if(!_0x5b3e3f['query'][_0xfbc6('0x37')](_0xfbc6('0x38'))){_0x4a0dbc[_0xfbc6('0x1e')]=qs['limit'](_0x5b3e3f[_0xfbc6('0x31')][_0xfbc6('0x1e')]);_0x4a0dbc[_0xfbc6('0x1c')]=qs['offset'](_0x5b3e3f[_0xfbc6('0x31')]['offset']);}_0x4a0dbc[_0xfbc6('0x39')]=qs[_0xfbc6('0x3a')](_0x5b3e3f[_0xfbc6('0x31')][_0xfbc6('0x3a')]);_0x4a0dbc[_0xfbc6('0x3d')]=qs[_0xfbc6('0x33')](_[_0xfbc6('0x3b')](_0x5b3e3f[_0xfbc6('0x31')],_0x25e443[_0xfbc6('0x33')]));_0x4a0dbc[_0xfbc6('0x3d')][_0xfbc6('0x5a')]=_0x58d51b['id'];if(_0x5b3e3f[_0xfbc6('0x31')][_0xfbc6('0x3c')]){_0x4a0dbc[_0xfbc6('0x3d')]=_['merge'](_0x4a0dbc['where'],{'$or':_['map'](_0x4a0dbc[_0xfbc6('0x36')],function(_0x5f48e1){var _0x1763a4={};_0x1763a4[_0x5f48e1]={'$like':'%'+_0x5b3e3f[_0xfbc6('0x31')][_0xfbc6('0x3c')]+'%'};return _0x1763a4;})});}_0x4a0dbc=_[_0xfbc6('0x47')]({},_0x4a0dbc,_0x5b3e3f[_0xfbc6('0x3f')]);return db['CmHopperBlack']['count']({'where':_0x4a0dbc[_0xfbc6('0x3d')]})[_0xfbc6('0x26')](function(_0x293ab4){_0x4f5ae8[_0xfbc6('0x1f')]=_0x293ab4;if(_0x5b3e3f[_0xfbc6('0x31')][_0xfbc6('0x41')]){_0x4a0dbc[_0xfbc6('0x42')]=[{'all':!![]}];}return db[_0xfbc6('0x5f')][_0xfbc6('0x43')](_0x4a0dbc);})[_0xfbc6('0x26')](function(_0xcdb6ef){_0x4f5ae8[_0xfbc6('0x44')]=_0xcdb6ef;return _0x4f5ae8;});}})[_0xfbc6('0x26')](respondWithFilteredResult(_0x22eeab,_0x4a0dbc))['catch'](handleError(_0x22eeab,null));};exports[_0xfbc6('0x60')]=function(_0x2f4ddd,_0xb661cc,_0x2a2eee){var _0x38548f={};var _0x410cd6={};var _0x1e9c3e;var _0x5c8213;return db[_0xfbc6('0x40')][_0xfbc6('0x5b')]({'where':{'id':_0x2f4ddd[_0xfbc6('0x57')]['id']}})[_0xfbc6('0x26')](handleEntityNotFound(_0xb661cc,null))[_0xfbc6('0x26')](function(_0x54b3f4){if(_0x54b3f4){_0x1e9c3e=_0x54b3f4;_0x410cd6[_0xfbc6('0x30')]=_[_0xfbc6('0x32')](db[_0xfbc6('0x61')][_0xfbc6('0x2d')]);_0x410cd6[_0xfbc6('0x31')]=_[_0xfbc6('0x32')](_0x2f4ddd[_0xfbc6('0x31')]);_0x410cd6[_0xfbc6('0x33')]=_['intersection'](_0x410cd6[_0xfbc6('0x30')],_0x410cd6['query']);_0x38548f[_0xfbc6('0x36')]=_[_0xfbc6('0x34')](_0x410cd6['model'],qs[_0xfbc6('0x35')](_0x2f4ddd[_0xfbc6('0x31')][_0xfbc6('0x35')]));_0x38548f[_0xfbc6('0x36')]=_0x38548f[_0xfbc6('0x36')][_0xfbc6('0x59')]?_0x38548f['attributes']:_0x410cd6[_0xfbc6('0x30')];_0x38548f[_0xfbc6('0x39')]=qs[_0xfbc6('0x3a')](_0x2f4ddd['query']['sort']);_0x38548f[_0xfbc6('0x3d')]=qs[_0xfbc6('0x33')](_[_0xfbc6('0x3b')](_0x2f4ddd[_0xfbc6('0x31')],_0x410cd6['filters']));if(_0x2f4ddd[_0xfbc6('0x31')][_0xfbc6('0x3c')]){_0x38548f[_0xfbc6('0x3d')]=_[_0xfbc6('0x47')](_0x38548f[_0xfbc6('0x3d')],{'$or':_[_0xfbc6('0x2c')](_0x38548f['attributes'],function(_0x286aec){var _0x41d46c={};_0x41d46c[_0x286aec]={'$like':'%'+_0x2f4ddd[_0xfbc6('0x31')][_0xfbc6('0x3c')]+'%'};return _0x41d46c;})});}_0x38548f=_['merge']({},_0x38548f,_0x2f4ddd[_0xfbc6('0x3f')]);return _0x1e9c3e[_0xfbc6('0x60')](_0x38548f);}})[_0xfbc6('0x26')](function(_0x290d05){if(_0x290d05){_0x5c8213=_0x290d05[_0xfbc6('0x59')];if(!_0x2f4ddd[_0xfbc6('0x31')][_0xfbc6('0x37')](_0xfbc6('0x38'))){_0x38548f[_0xfbc6('0x1e')]=qs[_0xfbc6('0x1e')](_0x2f4ddd[_0xfbc6('0x31')][_0xfbc6('0x1e')]);_0x38548f[_0xfbc6('0x1c')]=qs['offset'](_0x2f4ddd[_0xfbc6('0x31')][_0xfbc6('0x1c')]);}return _0x1e9c3e['getLists'](_0x38548f);}})[_0xfbc6('0x26')](function(_0x39a439){if(_0x39a439){return _0x39a439?{'count':_0x5c8213,'rows':_0x39a439}:null;}})[_0xfbc6('0x26')](respondWithResult(_0xb661cc,null))['catch'](handleError(_0xb661cc,null));};exports[_0xfbc6('0x62')]=function(_0x3a1b49,_0x5e618f,_0x42e139){var _0x47db90,_0x1760aa;var _0x4ab1ac=[];var _0x176174=moment()[_0xfbc6('0x63')]('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign']['find']({'where':{'id':_0x3a1b49[_0xfbc6('0x57')]['id']}})['then'](handleEntityNotFound(_0x5e618f,null))[_0xfbc6('0x26')](function(_0x13ff22){if(_0x13ff22){_0x1760aa=_0x13ff22;return _0x13ff22['addLists'](_0x3a1b49[_0xfbc6('0x4a')][_0xfbc6('0x64')],_[_0xfbc6('0x52')](_0x3a1b49[_0xfbc6('0x4a')],[_0xfbc6('0x64'),'id'])||{});}return null;})['spread'](function(_0x1bd495){var _0x35a4e0;var _0x342c70;_0x47db90=_0x1bd495||[];var _0x30996b=[];if(_0x1bd495){for(var _0x234078=0x0;_0x234078<_0x1bd495[_0xfbc6('0x59')];_0x234078+=0x1){var _0x5446af=_0x1bd495[_0x234078][_0xfbc6('0x28')]({'plain':!![]});_0x1760aa[_0xfbc6('0x65')]=_0x3a1b49['body']['dialCheckDuplicateType']?_0x3a1b49[_0xfbc6('0x4a')][_0xfbc6('0x65')]:_0x1760aa[_0xfbc6('0x65')];switch(_0x1760aa[_0xfbc6('0x65')]){case _0xfbc6('0x66'):_0x35a4e0=squel[_0xfbc6('0x67')]()[_0xfbc6('0x68')](_0xfbc6('0x69'))[_0xfbc6('0x6a')](['phone',_0xfbc6('0x6b'),_0xfbc6('0x6c'),'ListId',_0xfbc6('0x5a'),_0xfbc6('0x53'),_0xfbc6('0x54')],squel[_0xfbc6('0x6d')]()[_0xfbc6('0x6e')](_0xfbc6('0x6f'),_0xfbc6('0x6f'))[_0xfbc6('0x6e')](_0xfbc6('0x70'),'scheduledAt')[_0xfbc6('0x6e')]('id','ContactId')['field'](_0x5446af[_0xfbc6('0x71')][_0xfbc6('0x72')](),_0xfbc6('0x73'))[_0xfbc6('0x6e')](_0x3a1b49[_0xfbc6('0x57')]['id'][_0xfbc6('0x72')](),'CampaignId')[_0xfbc6('0x6e')]('\x27'+_0x176174+'\x27','createdAt')[_0xfbc6('0x6e')]('\x27'+_0x176174+'\x27',_0xfbc6('0x54'))[_0xfbc6('0x74')](_0xfbc6('0x75'))['where'](_0xfbc6('0x76'))[_0xfbc6('0x3d')]('ListId\x20=\x20?',_0x5446af[_0xfbc6('0x71')]['toString']())['where'](_0xfbc6('0x77'))[_0xfbc6('0x3d')](_0xfbc6('0x78'),squel[_0xfbc6('0x6d')]()[_0xfbc6('0x6e')](_0xfbc6('0x79'))[_0xfbc6('0x74')](_0xfbc6('0x7a'))[_0xfbc6('0x3d')](_0xfbc6('0x7b'),_0x3a1b49[_0xfbc6('0x57')]['id'][_0xfbc6('0x72')]()))[_0xfbc6('0x3d')](_0xfbc6('0x78'),squel['select']()[_0xfbc6('0x6e')](_0xfbc6('0x7c'))[_0xfbc6('0x74')](_0xfbc6('0x69'))['where'](_0xfbc6('0x7b'),_0x3a1b49['params']['id'][_0xfbc6('0x72')]())))[_0xfbc6('0x72')]();break;case _0xfbc6('0x7d'):_0x35a4e0=squel[_0xfbc6('0x67')]()[_0xfbc6('0x68')]('cm_hopper')[_0xfbc6('0x6a')](['phone','scheduledAt',_0xfbc6('0x6c'),_0xfbc6('0x73'),'CampaignId','createdAt',_0xfbc6('0x54')],squel[_0xfbc6('0x6d')]()[_0xfbc6('0x6e')](_0xfbc6('0x6f'),_0xfbc6('0x6f'))[_0xfbc6('0x6e')](_0xfbc6('0x70'),'scheduledAt')['field']('id',_0xfbc6('0x6c'))[_0xfbc6('0x6e')](_0x5446af[_0xfbc6('0x71')][_0xfbc6('0x72')](),_0xfbc6('0x73'))[_0xfbc6('0x6e')](_0x3a1b49[_0xfbc6('0x57')]['id'][_0xfbc6('0x72')](),_0xfbc6('0x5a'))['field']('\x27'+_0x176174+'\x27',_0xfbc6('0x53'))[_0xfbc6('0x6e')]('\x27'+_0x176174+'\x27','updatedAt')[_0xfbc6('0x74')](_0xfbc6('0x75'))['where'](_0xfbc6('0x76'))[_0xfbc6('0x3d')]('ListId\x20=\x20?',_0x5446af[_0xfbc6('0x71')][_0xfbc6('0x72')]())[_0xfbc6('0x3d')](_0xfbc6('0x77'))[_0xfbc6('0x3d')](_0xfbc6('0x78'),squel['select']()[_0xfbc6('0x6e')](_0xfbc6('0x7c'))[_0xfbc6('0x74')]('cm_hopper')['where'](_0xfbc6('0x7b'),_0x3a1b49[_0xfbc6('0x57')]['id']['toString']())))['toString']();break;default:_0x35a4e0=squel[_0xfbc6('0x67')]()[_0xfbc6('0x68')](_0xfbc6('0x69'))[_0xfbc6('0x6a')]([_0xfbc6('0x6f'),_0xfbc6('0x6b'),_0xfbc6('0x6c'),_0xfbc6('0x73'),_0xfbc6('0x5a'),_0xfbc6('0x53'),'updatedAt'],squel[_0xfbc6('0x6d')]()[_0xfbc6('0x6e')](_0xfbc6('0x6f'),_0xfbc6('0x6f'))[_0xfbc6('0x6e')](_0xfbc6('0x70'),_0xfbc6('0x6b'))['field']('id',_0xfbc6('0x6c'))[_0xfbc6('0x6e')](_0x5446af[_0xfbc6('0x71')][_0xfbc6('0x72')](),_0xfbc6('0x73'))[_0xfbc6('0x6e')](_0x3a1b49[_0xfbc6('0x57')]['id'][_0xfbc6('0x72')](),_0xfbc6('0x5a'))[_0xfbc6('0x6e')]('\x27'+_0x176174+'\x27','createdAt')[_0xfbc6('0x6e')]('\x27'+_0x176174+'\x27',_0xfbc6('0x54'))[_0xfbc6('0x74')](_0xfbc6('0x75'))[_0xfbc6('0x3d')](_0xfbc6('0x76'))[_0xfbc6('0x3d')](_0xfbc6('0x7e'),_0x5446af[_0xfbc6('0x71')][_0xfbc6('0x72')]())['where'](_0xfbc6('0x77')))[_0xfbc6('0x72')]();}_0x342c70=squel[_0xfbc6('0x67')]()[_0xfbc6('0x68')]('cm_hopper_additional_phones')['fromQuery']([_0xfbc6('0x7f'),_0xfbc6('0x6b'),_0xfbc6('0x6f'),'OrderBy',_0xfbc6('0x53'),_0xfbc6('0x54')],squel['select']()['field'](_0xfbc6('0x80'),'id')[_0xfbc6('0x6e')](_0xfbc6('0x70'),_0xfbc6('0x6b'))[_0xfbc6('0x6e')](_0xfbc6('0x81'),_0xfbc6('0x6f'))[_0xfbc6('0x6e')](_0xfbc6('0x82'),'OrderBy')[_0xfbc6('0x6e')]('\x27'+_0x176174+'\x27','createdAt')[_0xfbc6('0x6e')]('\x27'+_0x176174+'\x27','updatedAt')[_0xfbc6('0x74')](_0xfbc6('0x83'),'ci')[_0xfbc6('0x84')](_0xfbc6('0x69'),'h',_0xfbc6('0x85'))[_0xfbc6('0x3d')](_0xfbc6('0x86'),_0x5446af[_0xfbc6('0x71')][_0xfbc6('0x72')]())['where'](_0xfbc6('0x87'),_0x3a1b49[_0xfbc6('0x57')]['id']['toString']())[_0xfbc6('0x3d')]('h.createdAt\x20=\x20?',_0x176174))['toString']();_0x30996b[_0xfbc6('0x88')](db[_0xfbc6('0x89')][_0xfbc6('0x31')](_0x35a4e0));_0x4ab1ac['push'](db[_0xfbc6('0x89')][_0xfbc6('0x31')](_0x342c70));}return BPromise[_0xfbc6('0x8a')](_0x30996b);}})[_0xfbc6('0x26')](function(){return BPromise[_0xfbc6('0x8a')](_0x4ab1ac);})[_0xfbc6('0x26')](function(){return _0x47db90;})[_0xfbc6('0x26')](respondWithResult(_0x5e618f,null))['catch'](handleError(_0x5e618f,null));};exports[_0xfbc6('0x8b')]=function(_0x2a8545,_0x10134e,_0x2779e8){return db[_0xfbc6('0x40')][_0xfbc6('0x48')]({'where':{'id':_0x2a8545[_0xfbc6('0x57')]['id']}})[_0xfbc6('0x26')](handleEntityNotFound(_0x10134e,null))[_0xfbc6('0x26')](function(_0x253748){if(_0x253748){return _0x253748[_0xfbc6('0x8b')](_0x2a8545[_0xfbc6('0x31')][_0xfbc6('0x64')]);}})[_0xfbc6('0x26')](function(_0x52e437){if(_0x52e437){return db[_0xfbc6('0x58')][_0xfbc6('0x27')]({'where':{'ListId':_0x2a8545['query'][_0xfbc6('0x64')],'CampaignId':_0x2a8545[_0xfbc6('0x57')]['id']}})[_0xfbc6('0x26')](function(){return _0x52e437;});}})[_0xfbc6('0x26')](respondWithStatusCode(_0x10134e,null))['catch'](handleError(_0x10134e,null));};exports[_0xfbc6('0x8c')]=function(_0xcdeb57,_0x5307c7,_0x5af0b1){var _0x112490={};var _0x3327e0={};var _0x304f14;var _0x58c992;return db['Campaign']['findOne']({'where':{'id':_0xcdeb57[_0xfbc6('0x57')]['id']}})[_0xfbc6('0x26')](handleEntityNotFound(_0x5307c7,null))[_0xfbc6('0x26')](function(_0x49ce44){if(_0x49ce44){_0x304f14=_0x49ce44;_0x3327e0[_0xfbc6('0x30')]=_['keys'](db[_0xfbc6('0x61')]['rawAttributes']);_0x3327e0[_0xfbc6('0x31')]=_[_0xfbc6('0x32')](_0xcdeb57[_0xfbc6('0x31')]);_0x3327e0[_0xfbc6('0x33')]=_[_0xfbc6('0x34')](_0x3327e0['model'],_0x3327e0['query']);_0x112490[_0xfbc6('0x36')]=_[_0xfbc6('0x34')](_0x3327e0[_0xfbc6('0x30')],qs[_0xfbc6('0x35')](_0xcdeb57[_0xfbc6('0x31')][_0xfbc6('0x35')]));_0x112490[_0xfbc6('0x36')]=_0x112490['attributes'][_0xfbc6('0x59')]?_0x112490[_0xfbc6('0x36')]:_0x3327e0[_0xfbc6('0x30')];_0x112490[_0xfbc6('0x39')]=qs[_0xfbc6('0x3a')](_0xcdeb57[_0xfbc6('0x31')][_0xfbc6('0x3a')]);_0x112490[_0xfbc6('0x3d')]=qs[_0xfbc6('0x33')](_[_0xfbc6('0x3b')](_0xcdeb57[_0xfbc6('0x31')],_0x3327e0['filters']));if(_0xcdeb57[_0xfbc6('0x31')][_0xfbc6('0x3c')]){_0x112490[_0xfbc6('0x3d')]=_[_0xfbc6('0x47')](_0x112490[_0xfbc6('0x3d')],{'$or':_['map'](_0x112490['attributes'],function(_0x1ccb5f){var _0x1b5df0={};_0x1b5df0[_0x1ccb5f]={'$like':'%'+_0xcdeb57['query'][_0xfbc6('0x3c')]+'%'};return _0x1b5df0;})});}_0x112490=_[_0xfbc6('0x47')]({},_0x112490,_0xcdeb57[_0xfbc6('0x3f')]);return _0x304f14[_0xfbc6('0x8c')](_0x112490);}})['then'](function(_0x2277ef){if(_0x2277ef){_0x58c992=_0x2277ef[_0xfbc6('0x59')];if(!_0xcdeb57['query'][_0xfbc6('0x37')]('nolimit')){_0x112490[_0xfbc6('0x1e')]=qs[_0xfbc6('0x1e')](_0xcdeb57[_0xfbc6('0x31')][_0xfbc6('0x1e')]);_0x112490[_0xfbc6('0x1c')]=qs[_0xfbc6('0x1c')](_0xcdeb57['query'][_0xfbc6('0x1c')]);}return _0x304f14['getBlackLists'](_0x112490);}})[_0xfbc6('0x26')](function(_0x4eed5c){if(_0x4eed5c){return _0x4eed5c?{'count':_0x58c992,'rows':_0x4eed5c}:null;}})[_0xfbc6('0x26')](respondWithResult(_0x5307c7,null))[_0xfbc6('0x45')](handleError(_0x5307c7,null));};exports['addBlackLists']=function(_0x22c568,_0x2b3899,_0x4c097d){var _0x1e4b67,_0x52d7f4;var _0x26170a=[];var _0x1ab43a=moment()[_0xfbc6('0x63')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xfbc6('0x40')][_0xfbc6('0x48')]({'where':{'id':_0x22c568[_0xfbc6('0x57')]['id']}})['then'](handleEntityNotFound(_0x2b3899,null))[_0xfbc6('0x26')](function(_0x1dabfa){if(_0x1dabfa){_0x52d7f4=_0x1dabfa;return _0x1dabfa[_0xfbc6('0x8d')](_0x22c568['body']['ids'],_[_0xfbc6('0x52')](_0x22c568[_0xfbc6('0x4a')],[_0xfbc6('0x64'),'id'])||{});}return null;})[_0xfbc6('0x8e')](function(_0x4af880){var _0x16d1b0;var _0x1d41b8;_0x1e4b67=_0x4af880||[];var _0x3a822b=[];if(_0x4af880){for(var _0x331ba1=0x0;_0x331ba1<_0x4af880['length'];_0x331ba1+=0x1){var _0x491cd9=_0x4af880[_0x331ba1][_0xfbc6('0x28')]({'plain':!![]});_0x16d1b0=squel[_0xfbc6('0x67')]()[_0xfbc6('0x68')](_0xfbc6('0x8f'))[_0xfbc6('0x6a')]([_0xfbc6('0x6f'),'ContactId',_0xfbc6('0x73'),'CampaignId','createdAt',_0xfbc6('0x54')],squel[_0xfbc6('0x6d')]()[_0xfbc6('0x6e')](_0xfbc6('0x6f'),_0xfbc6('0x6f'))[_0xfbc6('0x6e')]('id',_0xfbc6('0x6c'))[_0xfbc6('0x6e')](_0x491cd9[_0xfbc6('0x71')][_0xfbc6('0x72')](),_0xfbc6('0x73'))[_0xfbc6('0x6e')](_0x22c568[_0xfbc6('0x57')]['id'][_0xfbc6('0x72')](),_0xfbc6('0x5a'))[_0xfbc6('0x6e')](_0xfbc6('0x70'),'createdAt')[_0xfbc6('0x6e')](_0xfbc6('0x70'),_0xfbc6('0x54'))[_0xfbc6('0x74')]('cm_contacts')[_0xfbc6('0x3d')](_0xfbc6('0x76'))[_0xfbc6('0x3d')]('ListId\x20=\x20?',_0x491cd9[_0xfbc6('0x71')][_0xfbc6('0x72')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xfbc6('0x72')]();_0x3a822b[_0xfbc6('0x88')](db['sequelize']['query'](_0x16d1b0));}return BPromise[_0xfbc6('0x8a')](_0x3a822b);}})[_0xfbc6('0x26')](function(){return _0x1e4b67;})[_0xfbc6('0x26')](respondWithResult(_0x2b3899,null))[_0xfbc6('0x45')](handleError(_0x2b3899,null));};exports['removeBlackLists']=function(_0x5157d5,_0x54d593,_0x343402){return db[_0xfbc6('0x40')][_0xfbc6('0x48')]({'where':{'id':_0x5157d5[_0xfbc6('0x57')]['id']}})[_0xfbc6('0x26')](handleEntityNotFound(_0x54d593,null))[_0xfbc6('0x26')](function(_0x278e05){if(_0x278e05){return _0x278e05['removeBlackLists'](_0x5157d5[_0xfbc6('0x31')][_0xfbc6('0x64')]);}})['then'](function(_0xf1bf7f){if(_0xf1bf7f){return db[_0xfbc6('0x5f')][_0xfbc6('0x27')]({'where':{'ListId':_0x5157d5[_0xfbc6('0x31')]['ids'],'CampaignId':_0x5157d5[_0xfbc6('0x57')]['id']}})['then'](function(){return _0xf1bf7f;});}})[_0xfbc6('0x26')](respondWithStatusCode(_0x54d593,null))[_0xfbc6('0x45')](handleError(_0x54d593,null));}; \ No newline at end of file +var _0xd1d3=['index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','createdAt','updatedAt','role','userProfileId','getHoppers','findOne','CmHopper','getHopperHistories','order','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','fromQuery','cm_hopper_additional_phones','cmHopperId','h.id','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','spread','removeBlackLists','rimraf','zip-dir','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','IvrCampaigns','UserProfileResource','sendStatus','error','name'];(function(_0x2cbb6b,_0xbc776d){var _0x2f98a1=function(_0x1eb9dd){while(--_0x1eb9dd){_0x2cbb6b['push'](_0x2cbb6b['shift']());}};_0x2f98a1(++_0xbc776d);}(_0xd1d3,0x68));var _0x3d1d=function(_0x5e35ab,_0x315186){_0x5e35ab=_0x5e35ab-0x0;var _0x44a8f0=_0xd1d3[_0x5e35ab];return _0x44a8f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d1d('0x0'));var zipdir=require(_0x3d1d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3d1d('0x2'));var Mustache=require(_0x3d1d('0x3'));var util=require('util');var path=require(_0x3d1d('0x4'));var sox=require(_0x3d1d('0x5'));var csv=require('to-csv');var ejs=require(_0x3d1d('0x6'));var fs=require('fs');var fs_extra=require(_0x3d1d('0x7'));var _=require(_0x3d1d('0x8'));var squel=require('squel');var crypto=require(_0x3d1d('0x9'));var jsforce=require(_0x3d1d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3d1d('0xb'));var querystring=require('querystring');var Papa=require(_0x3d1d('0xc'));var Redis=require('ioredis');var authService=require(_0x3d1d('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x3d1d('0xe'));var hardwareService=require(_0x3d1d('0xf'));var logger=require(_0x3d1d('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3d1d('0x11'))['db'];function respondWithStatusCode(_0x4a5005,_0xd725fe){_0xd725fe=_0xd725fe||0xcc;return function(_0x1bc123){if(_0x1bc123){return _0x4a5005['sendStatus'](_0xd725fe);}return _0x4a5005[_0x3d1d('0x12')](_0xd725fe)[_0x3d1d('0x13')]();};}function respondWithResult(_0x28e129,_0x374296){_0x374296=_0x374296||0xc8;return function(_0x36aede){if(_0x36aede){return _0x28e129['status'](_0x374296)[_0x3d1d('0x14')](_0x36aede);}};}function respondWithFilteredResult(_0x3e1f54,_0x2614db){return function(_0x3f7fbb){if(_0x3f7fbb){var _0x2453bc=typeof _0x2614db[_0x3d1d('0x15')]===_0x3d1d('0x16')&&typeof _0x2614db['limit']===_0x3d1d('0x16');var _0x3c52ba=_0x3f7fbb[_0x3d1d('0x17')];var _0x630b4a=_0x2453bc?0x0:_0x2614db[_0x3d1d('0x15')];var _0x257dc2=_0x2453bc?_0x3f7fbb[_0x3d1d('0x17')]:_0x2614db[_0x3d1d('0x15')]+_0x2614db[_0x3d1d('0x18')];var _0x5e0cf2;if(_0x257dc2>=_0x3c52ba){_0x257dc2=_0x3c52ba;_0x5e0cf2=0xc8;}else{_0x5e0cf2=0xce;}_0x3e1f54[_0x3d1d('0x12')](_0x5e0cf2);return _0x3e1f54[_0x3d1d('0x19')](_0x3d1d('0x1a'),_0x630b4a+'-'+_0x257dc2+'/'+_0x3c52ba)[_0x3d1d('0x14')](_0x3f7fbb);}return null;};}function patchUpdates(_0xca4143){return function(_0x129b25){try{jsonpatch[_0x3d1d('0x1b')](_0x129b25,_0xca4143,!![]);}catch(_0x568673){return BPromise['reject'](_0x568673);}return _0x129b25[_0x3d1d('0x1c')]();};}function saveUpdates(_0x452929,_0x30fa6f){return function(_0x1cab9a){if(_0x1cab9a){return _0x1cab9a[_0x3d1d('0x1d')](_0x452929)[_0x3d1d('0x1e')](function(_0x4bb782){return _0x4bb782;});}return null;};}function removeEntity(_0x596af5,_0x4420fb){return function(_0x4e3686){if(_0x4e3686){return _0x4e3686[_0x3d1d('0x1f')]()['then'](function(){var _0x265686=_0x4e3686['get']({'plain':!![]});var _0x5c8952=_0x3d1d('0x20');return db[_0x3d1d('0x21')][_0x3d1d('0x1f')]({'where':{'type':_0x5c8952,'resourceId':_0x265686['id']}})['then'](function(){return _0x4e3686;});})[_0x3d1d('0x1e')](function(){_0x596af5[_0x3d1d('0x12')](0xcc)[_0x3d1d('0x13')]();});}};}function handleEntityNotFound(_0x4cc223,_0x4b0e1d){return function(_0x18d7d5){if(!_0x18d7d5){_0x4cc223[_0x3d1d('0x22')](0x194);}return _0x18d7d5;};}function handleError(_0x155486,_0x3beaac){_0x3beaac=_0x3beaac||0x1f4;return function(_0x3b399b){logger[_0x3d1d('0x23')](_0x3b399b['stack']);if(_0x3b399b[_0x3d1d('0x24')]){delete _0x3b399b['name'];}_0x155486['status'](_0x3beaac)['send'](_0x3b399b);};}exports[_0x3d1d('0x25')]=function(_0x42de03,_0x5ee1fd){var _0x215d5e={},_0x1029b6={},_0x330146={'count':0x0,'rows':[]};var _0x35f7f9=_[_0x3d1d('0x26')](db[_0x3d1d('0x27')][_0x3d1d('0x28')],function(_0x4f0d9d){return{'name':_0x4f0d9d[_0x3d1d('0x29')],'type':_0x4f0d9d[_0x3d1d('0x2a')][_0x3d1d('0x2b')]};});_0x1029b6[_0x3d1d('0x2c')]=_[_0x3d1d('0x26')](_0x35f7f9,'name');_0x1029b6[_0x3d1d('0x2d')]=_[_0x3d1d('0x2e')](_0x42de03[_0x3d1d('0x2d')]);_0x1029b6['filters']=_[_0x3d1d('0x2f')](_0x1029b6[_0x3d1d('0x2c')],_0x1029b6[_0x3d1d('0x2d')]);_0x215d5e['attributes']=_['intersection'](_0x1029b6['model'],qs[_0x3d1d('0x30')](_0x42de03['query'][_0x3d1d('0x30')]));_0x215d5e[_0x3d1d('0x31')]=_0x215d5e[_0x3d1d('0x31')][_0x3d1d('0x32')]?_0x215d5e['attributes']:_0x1029b6[_0x3d1d('0x2c')];if(!_0x42de03[_0x3d1d('0x2d')][_0x3d1d('0x33')](_0x3d1d('0x34'))){_0x215d5e[_0x3d1d('0x18')]=qs[_0x3d1d('0x18')](_0x42de03[_0x3d1d('0x2d')][_0x3d1d('0x18')]);_0x215d5e['offset']=qs['offset'](_0x42de03[_0x3d1d('0x2d')][_0x3d1d('0x15')]);}_0x215d5e['order']=qs[_0x3d1d('0x35')](_0x42de03[_0x3d1d('0x2d')][_0x3d1d('0x35')]);_0x215d5e[_0x3d1d('0x36')]=qs[_0x3d1d('0x37')](_[_0x3d1d('0x38')](_0x42de03[_0x3d1d('0x2d')],_0x1029b6[_0x3d1d('0x37')]),_0x35f7f9);if(_0x42de03[_0x3d1d('0x2d')][_0x3d1d('0x39')]){_0x215d5e[_0x3d1d('0x36')]=_['merge'](_0x215d5e[_0x3d1d('0x36')],{'$or':_[_0x3d1d('0x26')](_0x35f7f9,function(_0x3b1c01){if(_0x3b1c01[_0x3d1d('0x2a')]!==_0x3d1d('0x3a')){var _0x2b7cbe={};_0x2b7cbe[_0x3b1c01[_0x3d1d('0x24')]]={'$like':'%'+_0x42de03[_0x3d1d('0x2d')][_0x3d1d('0x39')]+'%'};return _0x2b7cbe;}})});}_0x215d5e=_[_0x3d1d('0x3b')]({},_0x215d5e,_0x42de03[_0x3d1d('0x3c')]);var _0x2f4caf={'where':_0x215d5e[_0x3d1d('0x36')]};return db[_0x3d1d('0x27')][_0x3d1d('0x17')](_0x2f4caf)['then'](function(_0x4a58d5){_0x330146[_0x3d1d('0x17')]=_0x4a58d5;if(_0x42de03[_0x3d1d('0x2d')][_0x3d1d('0x3d')]){_0x215d5e['include']=[{'all':!![]}];}return db['Campaign'][_0x3d1d('0x3e')](_0x215d5e);})[_0x3d1d('0x1e')](function(_0x326177){_0x330146[_0x3d1d('0x3f')]=_0x326177;return _0x330146;})[_0x3d1d('0x1e')](respondWithFilteredResult(_0x5ee1fd,_0x215d5e))[_0x3d1d('0x40')](handleError(_0x5ee1fd,null));};exports[_0x3d1d('0x41')]=function(_0x15c424,_0x199285){var _0x1edb1b={'raw':![],'where':{'id':_0x15c424[_0x3d1d('0x42')]['id']}},_0x496a8e={};_0x496a8e[_0x3d1d('0x2c')]=_[_0x3d1d('0x2e')](db['Campaign']['rawAttributes']);_0x496a8e[_0x3d1d('0x2d')]=_['keys'](_0x15c424['query']);_0x496a8e['filters']=_[_0x3d1d('0x2f')](_0x496a8e[_0x3d1d('0x2c')],_0x496a8e[_0x3d1d('0x2d')]);_0x1edb1b['attributes']=_['intersection'](_0x496a8e[_0x3d1d('0x2c')],qs[_0x3d1d('0x30')](_0x15c424[_0x3d1d('0x2d')]['fields']));_0x1edb1b[_0x3d1d('0x31')]=_0x1edb1b['attributes'][_0x3d1d('0x32')]?_0x1edb1b[_0x3d1d('0x31')]:_0x496a8e[_0x3d1d('0x2c')];if(_0x15c424[_0x3d1d('0x2d')][_0x3d1d('0x3d')]){_0x1edb1b['include']=[{'all':!![]}];}_0x1edb1b=_[_0x3d1d('0x3b')]({},_0x1edb1b,_0x15c424[_0x3d1d('0x3c')]);return db[_0x3d1d('0x27')][_0x3d1d('0x43')](_0x1edb1b)[_0x3d1d('0x1e')](handleEntityNotFound(_0x199285,null))[_0x3d1d('0x1e')](respondWithResult(_0x199285,null))[_0x3d1d('0x40')](handleError(_0x199285,null));};exports[_0x3d1d('0x44')]=function(_0x21c54b,_0x31658b){return db['Campaign']['create'](_0x21c54b[_0x3d1d('0x45')],{})[_0x3d1d('0x1e')](function(_0xbdf332){var _0x2a5a0d=_0x21c54b['user']['get']({'plain':!![]});if(!_0x2a5a0d)throw new Error(_0x3d1d('0x46'));if(_0x2a5a0d['role']===_0x3d1d('0x47')){var _0x1009da=_0xbdf332[_0x3d1d('0x48')]({'plain':!![]});var _0x35c2f9=_0x3d1d('0x20');return db[_0x3d1d('0x49')][_0x3d1d('0x43')]({'where':{'name':_0x35c2f9,'userProfileId':_0x2a5a0d['userProfileId']},'raw':!![]})['then'](function(_0x13c88a){if(_0x13c88a&&_0x13c88a[_0x3d1d('0x4a')]===0x0){return db[_0x3d1d('0x21')][_0x3d1d('0x44')]({'name':_0x1009da[_0x3d1d('0x24')],'resourceId':_0x1009da['id'],'type':_0x13c88a[_0x3d1d('0x24')],'sectionId':_0x13c88a['id']},{})[_0x3d1d('0x1e')](function(){return _0xbdf332;});}else{return _0xbdf332;}})['catch'](function(_0x1db497){logger[_0x3d1d('0x23')](_0x3d1d('0x4b'),_0x1db497);throw _0x1db497;});}return _0xbdf332;})['then'](respondWithResult(_0x31658b,0xc9))[_0x3d1d('0x40')](handleError(_0x31658b,null));};exports[_0x3d1d('0x4c')]=function(_0x11b3a3,_0xdf6a0){var _0x5b1dd2={'where':{'id':_0x11b3a3[_0x3d1d('0x42')]['id']}},_0x4b3b18={};_0x4b3b18[_0x3d1d('0x2c')]=_[_0x3d1d('0x2e')](db[_0x3d1d('0x27')]['rawAttributes']);_0x5b1dd2[_0x3d1d('0x31')]=_[_0x3d1d('0x2f')](_0x4b3b18[_0x3d1d('0x2c')],qs[_0x3d1d('0x30')](_0x11b3a3[_0x3d1d('0x2d')]['fields']));_0x5b1dd2[_0x3d1d('0x31')]=_0x5b1dd2[_0x3d1d('0x31')][_0x3d1d('0x32')]?_0x5b1dd2[_0x3d1d('0x31')]:_0x4b3b18['model'];if(_0x11b3a3[_0x3d1d('0x2d')][_0x3d1d('0x3d')]){_0x5b1dd2[_0x3d1d('0x4d')]=[{'all':!![]}];}_0x5b1dd2=_[_0x3d1d('0x3b')]({},_0x5b1dd2,_0x11b3a3['options']);return db['Campaign'][_0x3d1d('0x43')](_0x5b1dd2)['then'](handleEntityNotFound(_0xdf6a0,null))[_0x3d1d('0x1e')](function(_0x4e2dcb){if(_0x4e2dcb){var _0x9c44ff=_0x4e2dcb['get']({'plain':!![]});_0x9c44ff=qs[_0x3d1d('0x4e')](_0x9c44ff,['id',_0x3d1d('0x4f'),_0x3d1d('0x50')]);_0x11b3a3[_0x3d1d('0x45')]=_[_0x3d1d('0x4e')](_0x11b3a3[_0x3d1d('0x45')],['id',_0x3d1d('0x4f'),_0x3d1d('0x50')]);return db[_0x3d1d('0x27')][_0x3d1d('0x44')](_[_0x3d1d('0x3b')](_0x9c44ff,_0x11b3a3[_0x3d1d('0x45')]),{'include':_0x11b3a3['query'][_0x3d1d('0x3d')]?[{'all':!![]}]:undefined})[_0x3d1d('0x1e')](function(_0x3f5c45){var _0x5452b8=_0x11b3a3[_0x3d1d('0x47')][_0x3d1d('0x48')]({'plain':!![]});if(!_0x5452b8)throw new Error(_0x3d1d('0x46'));if(_0x5452b8[_0x3d1d('0x51')]==='user'){var _0x584387=_0x3f5c45[_0x3d1d('0x48')]({'plain':!![]});var _0x59490a=_0x3d1d('0x20');return db['UserProfileSection'][_0x3d1d('0x43')]({'where':{'name':_0x59490a,'userProfileId':_0x5452b8[_0x3d1d('0x52')]},'raw':!![]})[_0x3d1d('0x1e')](function(_0x2a86f1){if(_0x2a86f1&&_0x2a86f1[_0x3d1d('0x4a')]===0x0){return db[_0x3d1d('0x21')][_0x3d1d('0x44')]({'name':_0x584387[_0x3d1d('0x24')],'resourceId':_0x584387['id'],'type':_0x2a86f1['name'],'sectionId':_0x2a86f1['id']},{})[_0x3d1d('0x1e')](function(){return _0x3f5c45;});}else{return _0x3f5c45;}})['catch'](function(_0x9d219d){logger[_0x3d1d('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9d219d);throw _0x9d219d;});}return _0x3f5c45;});}})[_0x3d1d('0x1e')](respondWithResult(_0xdf6a0,0xc9))[_0x3d1d('0x40')](handleError(_0xdf6a0,null));};exports[_0x3d1d('0x1d')]=function(_0x22fb54,_0x278ad6){if(_0x22fb54[_0x3d1d('0x45')]['id']){delete _0x22fb54[_0x3d1d('0x45')]['id'];}return db['Campaign'][_0x3d1d('0x43')]({'where':{'id':_0x22fb54[_0x3d1d('0x42')]['id']}})[_0x3d1d('0x1e')](handleEntityNotFound(_0x278ad6,null))['then'](saveUpdates(_0x22fb54[_0x3d1d('0x45')],null))['then'](respondWithResult(_0x278ad6,null))[_0x3d1d('0x40')](handleError(_0x278ad6,null));};exports['destroy']=function(_0x2fe10e,_0x9db056){return db[_0x3d1d('0x27')]['find']({'where':{'id':_0x2fe10e['params']['id']}})['then'](handleEntityNotFound(_0x9db056,null))['then'](removeEntity(_0x9db056,null))[_0x3d1d('0x40')](handleError(_0x9db056,null));};exports[_0x3d1d('0x53')]=function(_0x2f0c5c,_0x1a4f28,_0x4f8f7b){var _0x53eda1={'raw':!![],'where':{}};var _0x21ae9e={};var _0x3ed221={'count':0x0,'rows':[]};return db[_0x3d1d('0x27')][_0x3d1d('0x54')]({'where':{'id':_0x2f0c5c[_0x3d1d('0x42')]['id']}})['then'](handleEntityNotFound(_0x1a4f28,null))['then'](function(_0x7c771f){if(_0x7c771f){_0x21ae9e['model']=_[_0x3d1d('0x2e')](db[_0x3d1d('0x55')][_0x3d1d('0x28')]);_0x21ae9e[_0x3d1d('0x2d')]=_[_0x3d1d('0x2e')](_0x2f0c5c[_0x3d1d('0x2d')]);_0x21ae9e['filters']=_['intersection'](_0x21ae9e[_0x3d1d('0x2c')],_0x21ae9e[_0x3d1d('0x2d')]);_0x53eda1[_0x3d1d('0x31')]=_[_0x3d1d('0x2f')](_0x21ae9e[_0x3d1d('0x2c')],qs['fields'](_0x2f0c5c['query'][_0x3d1d('0x30')]));_0x53eda1['attributes']=_0x53eda1[_0x3d1d('0x31')][_0x3d1d('0x32')]?_0x53eda1[_0x3d1d('0x31')]:_0x21ae9e['model'];if(!_0x2f0c5c[_0x3d1d('0x2d')][_0x3d1d('0x33')]('nolimit')){_0x53eda1['limit']=qs[_0x3d1d('0x18')](_0x2f0c5c[_0x3d1d('0x2d')][_0x3d1d('0x18')]);_0x53eda1[_0x3d1d('0x15')]=qs['offset'](_0x2f0c5c[_0x3d1d('0x2d')]['offset']);}_0x53eda1['order']=qs[_0x3d1d('0x35')](_0x2f0c5c['query'][_0x3d1d('0x35')]);_0x53eda1[_0x3d1d('0x36')]=qs[_0x3d1d('0x37')](_['pick'](_0x2f0c5c['query'],_0x21ae9e[_0x3d1d('0x37')]));_0x53eda1[_0x3d1d('0x36')]['CampaignId']=_0x7c771f['id'];if(_0x2f0c5c[_0x3d1d('0x2d')][_0x3d1d('0x39')]){_0x53eda1[_0x3d1d('0x36')]=_[_0x3d1d('0x3b')](_0x53eda1[_0x3d1d('0x36')],{'$or':_[_0x3d1d('0x26')](_0x53eda1['attributes'],function(_0x4b1629){var _0x41d6d5={};_0x41d6d5[_0x4b1629]={'$like':'%'+_0x2f0c5c[_0x3d1d('0x2d')][_0x3d1d('0x39')]+'%'};return _0x41d6d5;})});}_0x53eda1=_[_0x3d1d('0x3b')]({},_0x53eda1,_0x2f0c5c[_0x3d1d('0x3c')]);return db['CmHopper'][_0x3d1d('0x17')]({'where':_0x53eda1[_0x3d1d('0x36')]})[_0x3d1d('0x1e')](function(_0x74eb92){_0x3ed221[_0x3d1d('0x17')]=_0x74eb92;if(_0x2f0c5c[_0x3d1d('0x2d')][_0x3d1d('0x3d')]){_0x53eda1[_0x3d1d('0x4d')]=[{'all':!![]}];}return db[_0x3d1d('0x55')][_0x3d1d('0x3e')](_0x53eda1);})[_0x3d1d('0x1e')](function(_0x15db8a){_0x3ed221['rows']=_0x15db8a;return _0x3ed221;});}})[_0x3d1d('0x1e')](respondWithFilteredResult(_0x1a4f28,_0x53eda1))[_0x3d1d('0x40')](handleError(_0x1a4f28,null));};exports[_0x3d1d('0x56')]=function(_0x1cc57f,_0x2a1f31,_0x54fe64){var _0x4886af={'raw':!![],'where':{}};var _0x54a6df={};var _0x49759d={'count':0x0,'rows':[]};return db['Campaign'][_0x3d1d('0x54')]({'where':{'id':_0x1cc57f[_0x3d1d('0x42')]['id']}})[_0x3d1d('0x1e')](handleEntityNotFound(_0x2a1f31,null))[_0x3d1d('0x1e')](function(_0x2bc0fc){if(_0x2bc0fc){_0x54a6df[_0x3d1d('0x2c')]=_[_0x3d1d('0x2e')](db['CmHopperHistory'][_0x3d1d('0x28')]);_0x54a6df['query']=_[_0x3d1d('0x2e')](_0x1cc57f[_0x3d1d('0x2d')]);_0x54a6df['filters']=_['intersection'](_0x54a6df[_0x3d1d('0x2c')],_0x54a6df['query']);_0x4886af[_0x3d1d('0x31')]=_[_0x3d1d('0x2f')](_0x54a6df[_0x3d1d('0x2c')],qs['fields'](_0x1cc57f['query']['fields']));_0x4886af[_0x3d1d('0x31')]=_0x4886af[_0x3d1d('0x31')][_0x3d1d('0x32')]?_0x4886af[_0x3d1d('0x31')]:_0x54a6df[_0x3d1d('0x2c')];if(!_0x1cc57f['query'][_0x3d1d('0x33')](_0x3d1d('0x34'))){_0x4886af[_0x3d1d('0x18')]=qs[_0x3d1d('0x18')](_0x1cc57f[_0x3d1d('0x2d')][_0x3d1d('0x18')]);_0x4886af[_0x3d1d('0x15')]=qs['offset'](_0x1cc57f['query'][_0x3d1d('0x15')]);}_0x4886af[_0x3d1d('0x57')]=qs[_0x3d1d('0x35')](_0x1cc57f[_0x3d1d('0x2d')]['sort']);_0x4886af[_0x3d1d('0x36')]=qs[_0x3d1d('0x37')](_[_0x3d1d('0x38')](_0x1cc57f[_0x3d1d('0x2d')],_0x54a6df[_0x3d1d('0x37')]));_0x4886af[_0x3d1d('0x36')][_0x3d1d('0x58')]=_0x2bc0fc['id'];if(_0x1cc57f[_0x3d1d('0x2d')]['filter']){_0x4886af[_0x3d1d('0x36')]=_[_0x3d1d('0x3b')](_0x4886af[_0x3d1d('0x36')],{'$or':_[_0x3d1d('0x26')](_0x4886af[_0x3d1d('0x31')],function(_0x2a6530){var _0x42b8e9={};_0x42b8e9[_0x2a6530]={'$like':'%'+_0x1cc57f['query'][_0x3d1d('0x39')]+'%'};return _0x42b8e9;})});}_0x4886af=_[_0x3d1d('0x3b')]({},_0x4886af,_0x1cc57f['options']);return db['CmHopperHistory'][_0x3d1d('0x17')]({'where':_0x4886af[_0x3d1d('0x36')]})[_0x3d1d('0x1e')](function(_0x89f6e1){_0x49759d[_0x3d1d('0x17')]=_0x89f6e1;if(_0x1cc57f['query'][_0x3d1d('0x3d')]){_0x4886af['include']=[{'all':!![]}];}return db[_0x3d1d('0x59')]['findAll'](_0x4886af);})[_0x3d1d('0x1e')](function(_0x1ce410){_0x49759d['rows']=_0x1ce410;return _0x49759d;});}})['then'](respondWithFilteredResult(_0x2a1f31,_0x4886af))[_0x3d1d('0x40')](handleError(_0x2a1f31,null));};exports[_0x3d1d('0x5a')]=function(_0x594e42,_0x12c344,_0x242dd3){var _0x2a6bb5={'raw':!![],'where':{}};var _0x3e3c75={};var _0x4e0e80={'count':0x0,'rows':[]};return db[_0x3d1d('0x27')]['findOne']({'where':{'id':_0x594e42['params']['id']}})[_0x3d1d('0x1e')](handleEntityNotFound(_0x12c344,null))['then'](function(_0x19b723){if(_0x19b723){_0x3e3c75[_0x3d1d('0x2c')]=_['keys'](db[_0x3d1d('0x5b')][_0x3d1d('0x28')]);_0x3e3c75[_0x3d1d('0x2d')]=_[_0x3d1d('0x2e')](_0x594e42[_0x3d1d('0x2d')]);_0x3e3c75['filters']=_['intersection'](_0x3e3c75['model'],_0x3e3c75[_0x3d1d('0x2d')]);_0x2a6bb5[_0x3d1d('0x31')]=_[_0x3d1d('0x2f')](_0x3e3c75[_0x3d1d('0x2c')],qs[_0x3d1d('0x30')](_0x594e42['query'][_0x3d1d('0x30')]));_0x2a6bb5[_0x3d1d('0x31')]=_0x2a6bb5[_0x3d1d('0x31')][_0x3d1d('0x32')]?_0x2a6bb5[_0x3d1d('0x31')]:_0x3e3c75[_0x3d1d('0x2c')];if(!_0x594e42[_0x3d1d('0x2d')]['hasOwnProperty'](_0x3d1d('0x34'))){_0x2a6bb5[_0x3d1d('0x18')]=qs[_0x3d1d('0x18')](_0x594e42[_0x3d1d('0x2d')][_0x3d1d('0x18')]);_0x2a6bb5['offset']=qs[_0x3d1d('0x15')](_0x594e42[_0x3d1d('0x2d')][_0x3d1d('0x15')]);}_0x2a6bb5[_0x3d1d('0x57')]=qs[_0x3d1d('0x35')](_0x594e42[_0x3d1d('0x2d')][_0x3d1d('0x35')]);_0x2a6bb5[_0x3d1d('0x36')]=qs[_0x3d1d('0x37')](_[_0x3d1d('0x38')](_0x594e42[_0x3d1d('0x2d')],_0x3e3c75[_0x3d1d('0x37')]));_0x2a6bb5[_0x3d1d('0x36')][_0x3d1d('0x58')]=_0x19b723['id'];if(_0x594e42[_0x3d1d('0x2d')][_0x3d1d('0x39')]){_0x2a6bb5[_0x3d1d('0x36')]=_[_0x3d1d('0x3b')](_0x2a6bb5[_0x3d1d('0x36')],{'$or':_['map'](_0x2a6bb5[_0x3d1d('0x31')],function(_0x2d0e07){var _0x5f2b37={};_0x5f2b37[_0x2d0e07]={'$like':'%'+_0x594e42[_0x3d1d('0x2d')][_0x3d1d('0x39')]+'%'};return _0x5f2b37;})});}_0x2a6bb5=_[_0x3d1d('0x3b')]({},_0x2a6bb5,_0x594e42['options']);return db[_0x3d1d('0x5b')][_0x3d1d('0x17')]({'where':_0x2a6bb5['where']})[_0x3d1d('0x1e')](function(_0x540a95){_0x4e0e80['count']=_0x540a95;if(_0x594e42['query']['includeAll']){_0x2a6bb5[_0x3d1d('0x4d')]=[{'all':!![]}];}return db[_0x3d1d('0x5b')][_0x3d1d('0x3e')](_0x2a6bb5);})[_0x3d1d('0x1e')](function(_0x28027d){_0x4e0e80[_0x3d1d('0x3f')]=_0x28027d;return _0x4e0e80;});}})[_0x3d1d('0x1e')](respondWithFilteredResult(_0x12c344,_0x2a6bb5))[_0x3d1d('0x40')](handleError(_0x12c344,null));};exports[_0x3d1d('0x5c')]=function(_0x316a85,_0x32b24b,_0x3feb37){var _0x3f33be={'raw':!![],'where':{}};var _0x3b24ac={};var _0xd0958f={'count':0x0,'rows':[]};return db['Campaign'][_0x3d1d('0x54')]({'where':{'id':_0x316a85[_0x3d1d('0x42')]['id']}})['then'](handleEntityNotFound(_0x32b24b,null))[_0x3d1d('0x1e')](function(_0x20b64a){if(_0x20b64a){_0x3b24ac[_0x3d1d('0x2c')]=_['keys'](db[_0x3d1d('0x5d')][_0x3d1d('0x28')]);_0x3b24ac[_0x3d1d('0x2d')]=_[_0x3d1d('0x2e')](_0x316a85[_0x3d1d('0x2d')]);_0x3b24ac[_0x3d1d('0x37')]=_[_0x3d1d('0x2f')](_0x3b24ac[_0x3d1d('0x2c')],_0x3b24ac[_0x3d1d('0x2d')]);_0x3f33be[_0x3d1d('0x31')]=_[_0x3d1d('0x2f')](_0x3b24ac[_0x3d1d('0x2c')],qs[_0x3d1d('0x30')](_0x316a85[_0x3d1d('0x2d')][_0x3d1d('0x30')]));_0x3f33be[_0x3d1d('0x31')]=_0x3f33be[_0x3d1d('0x31')][_0x3d1d('0x32')]?_0x3f33be[_0x3d1d('0x31')]:_0x3b24ac[_0x3d1d('0x2c')];if(!_0x316a85[_0x3d1d('0x2d')][_0x3d1d('0x33')](_0x3d1d('0x34'))){_0x3f33be[_0x3d1d('0x18')]=qs['limit'](_0x316a85[_0x3d1d('0x2d')]['limit']);_0x3f33be['offset']=qs['offset'](_0x316a85[_0x3d1d('0x2d')]['offset']);}_0x3f33be['order']=qs[_0x3d1d('0x35')](_0x316a85['query']['sort']);_0x3f33be[_0x3d1d('0x36')]=qs['filters'](_['pick'](_0x316a85[_0x3d1d('0x2d')],_0x3b24ac[_0x3d1d('0x37')]));_0x3f33be['where'][_0x3d1d('0x58')]=_0x20b64a['id'];if(_0x316a85[_0x3d1d('0x2d')][_0x3d1d('0x39')]){_0x3f33be[_0x3d1d('0x36')]=_[_0x3d1d('0x3b')](_0x3f33be[_0x3d1d('0x36')],{'$or':_[_0x3d1d('0x26')](_0x3f33be[_0x3d1d('0x31')],function(_0x150ffd){var _0x662e3a={};_0x662e3a[_0x150ffd]={'$like':'%'+_0x316a85['query'][_0x3d1d('0x39')]+'%'};return _0x662e3a;})});}_0x3f33be=_[_0x3d1d('0x3b')]({},_0x3f33be,_0x316a85['options']);return db[_0x3d1d('0x5d')][_0x3d1d('0x17')]({'where':_0x3f33be[_0x3d1d('0x36')]})[_0x3d1d('0x1e')](function(_0x105055){_0xd0958f[_0x3d1d('0x17')]=_0x105055;if(_0x316a85['query'][_0x3d1d('0x3d')]){_0x3f33be[_0x3d1d('0x4d')]=[{'all':!![]}];}return db[_0x3d1d('0x5d')]['findAll'](_0x3f33be);})[_0x3d1d('0x1e')](function(_0x3edefb){_0xd0958f[_0x3d1d('0x3f')]=_0x3edefb;return _0xd0958f;});}})[_0x3d1d('0x1e')](respondWithFilteredResult(_0x32b24b,_0x3f33be))[_0x3d1d('0x40')](handleError(_0x32b24b,null));};exports[_0x3d1d('0x5e')]=function(_0x32ecc4,_0x5258b1,_0x478bcb){var _0x3cdbf3={};var _0x585349={};var _0x4583ae;var _0x2f2f0b;return db[_0x3d1d('0x27')]['findOne']({'where':{'id':_0x32ecc4[_0x3d1d('0x42')]['id']}})[_0x3d1d('0x1e')](handleEntityNotFound(_0x5258b1,null))[_0x3d1d('0x1e')](function(_0x1ab59f){if(_0x1ab59f){_0x4583ae=_0x1ab59f;_0x585349[_0x3d1d('0x2c')]=_[_0x3d1d('0x2e')](db[_0x3d1d('0x5f')][_0x3d1d('0x28')]);_0x585349[_0x3d1d('0x2d')]=_[_0x3d1d('0x2e')](_0x32ecc4[_0x3d1d('0x2d')]);_0x585349[_0x3d1d('0x37')]=_[_0x3d1d('0x2f')](_0x585349[_0x3d1d('0x2c')],_0x585349[_0x3d1d('0x2d')]);_0x3cdbf3[_0x3d1d('0x31')]=_[_0x3d1d('0x2f')](_0x585349[_0x3d1d('0x2c')],qs[_0x3d1d('0x30')](_0x32ecc4[_0x3d1d('0x2d')][_0x3d1d('0x30')]));_0x3cdbf3[_0x3d1d('0x31')]=_0x3cdbf3[_0x3d1d('0x31')][_0x3d1d('0x32')]?_0x3cdbf3['attributes']:_0x585349[_0x3d1d('0x2c')];_0x3cdbf3['order']=qs['sort'](_0x32ecc4[_0x3d1d('0x2d')][_0x3d1d('0x35')]);_0x3cdbf3[_0x3d1d('0x36')]=qs['filters'](_[_0x3d1d('0x38')](_0x32ecc4['query'],_0x585349[_0x3d1d('0x37')]));if(_0x32ecc4[_0x3d1d('0x2d')]['filter']){_0x3cdbf3['where']=_['merge'](_0x3cdbf3['where'],{'$or':_['map'](_0x3cdbf3[_0x3d1d('0x31')],function(_0x210107){var _0x126b6e={};_0x126b6e[_0x210107]={'$like':'%'+_0x32ecc4[_0x3d1d('0x2d')][_0x3d1d('0x39')]+'%'};return _0x126b6e;})});}_0x3cdbf3=_[_0x3d1d('0x3b')]({},_0x3cdbf3,_0x32ecc4[_0x3d1d('0x3c')]);return _0x4583ae[_0x3d1d('0x5e')](_0x3cdbf3);}})['then'](function(_0x589906){if(_0x589906){_0x2f2f0b=_0x589906[_0x3d1d('0x32')];if(!_0x32ecc4[_0x3d1d('0x2d')][_0x3d1d('0x33')](_0x3d1d('0x34'))){_0x3cdbf3['limit']=qs['limit'](_0x32ecc4[_0x3d1d('0x2d')][_0x3d1d('0x18')]);_0x3cdbf3['offset']=qs['offset'](_0x32ecc4['query'][_0x3d1d('0x15')]);}return _0x4583ae['getLists'](_0x3cdbf3);}})[_0x3d1d('0x1e')](function(_0x539a00){if(_0x539a00){return _0x539a00?{'count':_0x2f2f0b,'rows':_0x539a00}:null;}})[_0x3d1d('0x1e')](respondWithResult(_0x5258b1,null))['catch'](handleError(_0x5258b1,null));};exports[_0x3d1d('0x60')]=function(_0x5884ac,_0x49c5ee,_0xa28476){var _0xea1882,_0x16366d;var _0xbd17f3=[];var _0x2fe902=moment()['format'](_0x3d1d('0x61'));return db['Campaign'][_0x3d1d('0x43')]({'where':{'id':_0x5884ac[_0x3d1d('0x42')]['id']}})['then'](handleEntityNotFound(_0x49c5ee,null))['then'](function(_0x1cbfe0){if(_0x1cbfe0){_0x16366d=_0x1cbfe0;return _0x1cbfe0[_0x3d1d('0x60')](_0x5884ac[_0x3d1d('0x45')][_0x3d1d('0x62')],_[_0x3d1d('0x4e')](_0x5884ac[_0x3d1d('0x45')],[_0x3d1d('0x62'),'id'])||{});}return null;})['spread'](function(_0x3d0f25){var _0x1afb62;var _0x531884;_0xea1882=_0x3d0f25||[];var _0x4f735b=[];if(_0x3d0f25){for(var _0xf40d69=0x0;_0xf40d69<_0x3d0f25['length'];_0xf40d69+=0x1){var _0x381b9b=_0x3d0f25[_0xf40d69]['get']({'plain':!![]});_0x16366d[_0x3d1d('0x63')]=_0x5884ac[_0x3d1d('0x45')]['dialCheckDuplicateType']?_0x5884ac[_0x3d1d('0x45')]['dialCheckDuplicateType']:_0x16366d['dialCheckDuplicateType'];switch(_0x16366d[_0x3d1d('0x63')]){case _0x3d1d('0x64'):_0x1afb62=squel[_0x3d1d('0x65')]()['into'](_0x3d1d('0x66'))['fromQuery']([_0x3d1d('0x67'),_0x3d1d('0x68'),_0x3d1d('0x69'),_0x3d1d('0x6a'),_0x3d1d('0x58'),'createdAt',_0x3d1d('0x50')],squel[_0x3d1d('0x6b')]()[_0x3d1d('0x6c')](_0x3d1d('0x67'),'phone')['field'](_0x3d1d('0x6d'),'scheduledAt')[_0x3d1d('0x6c')]('id',_0x3d1d('0x69'))['field'](_0x381b9b[_0x3d1d('0x6e')][_0x3d1d('0x6f')](),_0x3d1d('0x6a'))['field'](_0x5884ac[_0x3d1d('0x42')]['id']['toString'](),'CampaignId')[_0x3d1d('0x6c')]('\x27'+_0x2fe902+'\x27',_0x3d1d('0x4f'))[_0x3d1d('0x6c')]('\x27'+_0x2fe902+'\x27',_0x3d1d('0x50'))[_0x3d1d('0x70')](_0x3d1d('0x71'))[_0x3d1d('0x36')](_0x3d1d('0x72'))[_0x3d1d('0x36')](_0x3d1d('0x73'),_0x381b9b[_0x3d1d('0x6e')][_0x3d1d('0x6f')]())[_0x3d1d('0x36')](_0x3d1d('0x74'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3d1d('0x6c')](_0x3d1d('0x75'))[_0x3d1d('0x70')](_0x3d1d('0x76'))[_0x3d1d('0x36')](_0x3d1d('0x77'),_0x5884ac[_0x3d1d('0x42')]['id'][_0x3d1d('0x6f')]()))[_0x3d1d('0x36')](_0x3d1d('0x78'),squel[_0x3d1d('0x6b')]()['field'](_0x3d1d('0x79'))[_0x3d1d('0x70')](_0x3d1d('0x66'))[_0x3d1d('0x36')](_0x3d1d('0x77'),_0x5884ac[_0x3d1d('0x42')]['id']['toString']())))['toString']();break;case _0x3d1d('0x7a'):_0x1afb62=squel['insert']()[_0x3d1d('0x7b')]('cm_hopper')['fromQuery']([_0x3d1d('0x67'),_0x3d1d('0x68'),_0x3d1d('0x69'),_0x3d1d('0x6a'),_0x3d1d('0x58'),_0x3d1d('0x4f'),_0x3d1d('0x50')],squel[_0x3d1d('0x6b')]()[_0x3d1d('0x6c')](_0x3d1d('0x67'),_0x3d1d('0x67'))[_0x3d1d('0x6c')](_0x3d1d('0x6d'),_0x3d1d('0x68'))[_0x3d1d('0x6c')]('id',_0x3d1d('0x69'))[_0x3d1d('0x6c')](_0x381b9b[_0x3d1d('0x6e')][_0x3d1d('0x6f')](),_0x3d1d('0x6a'))[_0x3d1d('0x6c')](_0x5884ac[_0x3d1d('0x42')]['id']['toString'](),'CampaignId')['field']('\x27'+_0x2fe902+'\x27',_0x3d1d('0x4f'))[_0x3d1d('0x6c')]('\x27'+_0x2fe902+'\x27',_0x3d1d('0x50'))[_0x3d1d('0x70')](_0x3d1d('0x71'))[_0x3d1d('0x36')](_0x3d1d('0x72'))[_0x3d1d('0x36')](_0x3d1d('0x73'),_0x381b9b[_0x3d1d('0x6e')][_0x3d1d('0x6f')]())[_0x3d1d('0x36')](_0x3d1d('0x74'))[_0x3d1d('0x36')](_0x3d1d('0x78'),squel['select']()[_0x3d1d('0x6c')]('COALESCE(phone,\x27\x27)')['from'](_0x3d1d('0x66'))[_0x3d1d('0x36')](_0x3d1d('0x77'),_0x5884ac['params']['id'][_0x3d1d('0x6f')]())))[_0x3d1d('0x6f')]();break;default:_0x1afb62=squel[_0x3d1d('0x65')]()[_0x3d1d('0x7b')]('cm_hopper')[_0x3d1d('0x7c')]([_0x3d1d('0x67'),'scheduledAt',_0x3d1d('0x69'),_0x3d1d('0x6a'),_0x3d1d('0x58'),'createdAt','updatedAt'],squel['select']()['field'](_0x3d1d('0x67'),_0x3d1d('0x67'))[_0x3d1d('0x6c')](_0x3d1d('0x6d'),'scheduledAt')[_0x3d1d('0x6c')]('id',_0x3d1d('0x69'))[_0x3d1d('0x6c')](_0x381b9b[_0x3d1d('0x6e')][_0x3d1d('0x6f')](),_0x3d1d('0x6a'))[_0x3d1d('0x6c')](_0x5884ac[_0x3d1d('0x42')]['id']['toString'](),'CampaignId')['field']('\x27'+_0x2fe902+'\x27',_0x3d1d('0x4f'))[_0x3d1d('0x6c')]('\x27'+_0x2fe902+'\x27',_0x3d1d('0x50'))['from'](_0x3d1d('0x71'))[_0x3d1d('0x36')](_0x3d1d('0x72'))['where'](_0x3d1d('0x73'),_0x381b9b[_0x3d1d('0x6e')][_0x3d1d('0x6f')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x3d1d('0x6f')]();}_0x531884=squel[_0x3d1d('0x65')]()['into'](_0x3d1d('0x7d'))['fromQuery']([_0x3d1d('0x7e'),_0x3d1d('0x68'),_0x3d1d('0x67'),'OrderBy',_0x3d1d('0x4f'),_0x3d1d('0x50')],squel[_0x3d1d('0x6b')]()[_0x3d1d('0x6c')](_0x3d1d('0x7f'),'id')[_0x3d1d('0x6c')](_0x3d1d('0x6d'),_0x3d1d('0x68'))[_0x3d1d('0x6c')]('ci.item',_0x3d1d('0x67'))['field']('ci.OrderBY',_0x3d1d('0x80'))['field']('\x27'+_0x2fe902+'\x27',_0x3d1d('0x4f'))[_0x3d1d('0x6c')]('\x27'+_0x2fe902+'\x27','updatedAt')[_0x3d1d('0x70')](_0x3d1d('0x81'),'ci')[_0x3d1d('0x82')](_0x3d1d('0x66'),'h',_0x3d1d('0x83'))[_0x3d1d('0x36')](_0x3d1d('0x84'),_0x381b9b[_0x3d1d('0x6e')][_0x3d1d('0x6f')]())['where']('h.CampaignId=?',_0x5884ac[_0x3d1d('0x42')]['id'][_0x3d1d('0x6f')]())[_0x3d1d('0x36')]('h.createdAt\x20=\x20?',_0x2fe902))[_0x3d1d('0x6f')]();_0x4f735b['push'](db[_0x3d1d('0x85')][_0x3d1d('0x2d')](_0x1afb62));_0xbd17f3[_0x3d1d('0x86')](db[_0x3d1d('0x85')][_0x3d1d('0x2d')](_0x531884));}return BPromise[_0x3d1d('0x87')](_0x4f735b);}})['then'](function(){return BPromise['all'](_0xbd17f3);})['then'](function(){return _0xea1882;})['then'](respondWithResult(_0x49c5ee,null))[_0x3d1d('0x40')](handleError(_0x49c5ee,null));};exports[_0x3d1d('0x88')]=function(_0x5f2417,_0x496606,_0xa25353){return db[_0x3d1d('0x27')][_0x3d1d('0x43')]({'where':{'id':_0x5f2417[_0x3d1d('0x42')]['id']}})[_0x3d1d('0x1e')](handleEntityNotFound(_0x496606,null))['then'](function(_0x5d9f28){if(_0x5d9f28){return _0x5d9f28[_0x3d1d('0x88')](_0x5f2417[_0x3d1d('0x2d')]['ids']);}})['then'](function(_0x30297a){if(_0x30297a){return db[_0x3d1d('0x55')][_0x3d1d('0x1f')]({'where':{'ListId':_0x5f2417[_0x3d1d('0x2d')][_0x3d1d('0x62')],'CampaignId':_0x5f2417[_0x3d1d('0x42')]['id']}})[_0x3d1d('0x1e')](function(){return _0x30297a;});}})[_0x3d1d('0x1e')](respondWithStatusCode(_0x496606,null))[_0x3d1d('0x40')](handleError(_0x496606,null));};exports[_0x3d1d('0x89')]=function(_0x41a7ae,_0x3d2e12,_0x38f0d8){var _0x1e4f67={};var _0x32902b={};var _0x29b234;var _0x6a54c1;return db[_0x3d1d('0x27')][_0x3d1d('0x54')]({'where':{'id':_0x41a7ae[_0x3d1d('0x42')]['id']}})['then'](handleEntityNotFound(_0x3d2e12,null))[_0x3d1d('0x1e')](function(_0x42e1a6){if(_0x42e1a6){_0x29b234=_0x42e1a6;_0x32902b[_0x3d1d('0x2c')]=_[_0x3d1d('0x2e')](db[_0x3d1d('0x5f')][_0x3d1d('0x28')]);_0x32902b[_0x3d1d('0x2d')]=_[_0x3d1d('0x2e')](_0x41a7ae[_0x3d1d('0x2d')]);_0x32902b[_0x3d1d('0x37')]=_['intersection'](_0x32902b[_0x3d1d('0x2c')],_0x32902b[_0x3d1d('0x2d')]);_0x1e4f67[_0x3d1d('0x31')]=_[_0x3d1d('0x2f')](_0x32902b[_0x3d1d('0x2c')],qs['fields'](_0x41a7ae['query'][_0x3d1d('0x30')]));_0x1e4f67[_0x3d1d('0x31')]=_0x1e4f67['attributes'][_0x3d1d('0x32')]?_0x1e4f67[_0x3d1d('0x31')]:_0x32902b[_0x3d1d('0x2c')];_0x1e4f67[_0x3d1d('0x57')]=qs['sort'](_0x41a7ae['query'][_0x3d1d('0x35')]);_0x1e4f67[_0x3d1d('0x36')]=qs[_0x3d1d('0x37')](_['pick'](_0x41a7ae[_0x3d1d('0x2d')],_0x32902b['filters']));if(_0x41a7ae[_0x3d1d('0x2d')][_0x3d1d('0x39')]){_0x1e4f67['where']=_[_0x3d1d('0x3b')](_0x1e4f67[_0x3d1d('0x36')],{'$or':_[_0x3d1d('0x26')](_0x1e4f67[_0x3d1d('0x31')],function(_0x3635f2){var _0x3e3960={};_0x3e3960[_0x3635f2]={'$like':'%'+_0x41a7ae[_0x3d1d('0x2d')]['filter']+'%'};return _0x3e3960;})});}_0x1e4f67=_[_0x3d1d('0x3b')]({},_0x1e4f67,_0x41a7ae[_0x3d1d('0x3c')]);return _0x29b234[_0x3d1d('0x89')](_0x1e4f67);}})['then'](function(_0x3f8e70){if(_0x3f8e70){_0x6a54c1=_0x3f8e70[_0x3d1d('0x32')];if(!_0x41a7ae[_0x3d1d('0x2d')][_0x3d1d('0x33')](_0x3d1d('0x34'))){_0x1e4f67[_0x3d1d('0x18')]=qs[_0x3d1d('0x18')](_0x41a7ae[_0x3d1d('0x2d')][_0x3d1d('0x18')]);_0x1e4f67[_0x3d1d('0x15')]=qs[_0x3d1d('0x15')](_0x41a7ae[_0x3d1d('0x2d')]['offset']);}return _0x29b234[_0x3d1d('0x89')](_0x1e4f67);}})[_0x3d1d('0x1e')](function(_0x43b94c){if(_0x43b94c){return _0x43b94c?{'count':_0x6a54c1,'rows':_0x43b94c}:null;}})[_0x3d1d('0x1e')](respondWithResult(_0x3d2e12,null))['catch'](handleError(_0x3d2e12,null));};exports[_0x3d1d('0x8a')]=function(_0xa52960,_0x588298,_0x49fc3f){var _0x478363,_0x49e39b;var _0x2a80da=[];var _0x446efb=moment()['format'](_0x3d1d('0x61'));return db[_0x3d1d('0x27')][_0x3d1d('0x43')]({'where':{'id':_0xa52960[_0x3d1d('0x42')]['id']}})[_0x3d1d('0x1e')](handleEntityNotFound(_0x588298,null))[_0x3d1d('0x1e')](function(_0x29b5d8){if(_0x29b5d8){_0x49e39b=_0x29b5d8;return _0x29b5d8[_0x3d1d('0x8a')](_0xa52960[_0x3d1d('0x45')]['ids'],_[_0x3d1d('0x4e')](_0xa52960[_0x3d1d('0x45')],[_0x3d1d('0x62'),'id'])||{});}return null;})[_0x3d1d('0x8b')](function(_0x2de8c7){var _0x508392;var _0x249b57;_0x478363=_0x2de8c7||[];var _0x376048=[];if(_0x2de8c7){for(var _0x41f231=0x0;_0x41f231<_0x2de8c7[_0x3d1d('0x32')];_0x41f231+=0x1){var _0x881406=_0x2de8c7[_0x41f231][_0x3d1d('0x48')]({'plain':!![]});_0x508392=squel[_0x3d1d('0x65')]()[_0x3d1d('0x7b')]('cm_hopper_black')[_0x3d1d('0x7c')]([_0x3d1d('0x67'),_0x3d1d('0x69'),_0x3d1d('0x6a'),_0x3d1d('0x58'),_0x3d1d('0x4f'),_0x3d1d('0x50')],squel[_0x3d1d('0x6b')]()[_0x3d1d('0x6c')](_0x3d1d('0x67'),_0x3d1d('0x67'))[_0x3d1d('0x6c')]('id',_0x3d1d('0x69'))['field'](_0x881406[_0x3d1d('0x6e')][_0x3d1d('0x6f')](),_0x3d1d('0x6a'))[_0x3d1d('0x6c')](_0xa52960['params']['id'][_0x3d1d('0x6f')](),'CampaignId')['field']('NOW()',_0x3d1d('0x4f'))['field'](_0x3d1d('0x6d'),_0x3d1d('0x50'))['from'](_0x3d1d('0x71'))[_0x3d1d('0x36')](_0x3d1d('0x72'))[_0x3d1d('0x36')](_0x3d1d('0x73'),_0x881406['CmListId'][_0x3d1d('0x6f')]())[_0x3d1d('0x36')](_0x3d1d('0x74')))[_0x3d1d('0x6f')]();_0x376048[_0x3d1d('0x86')](db['sequelize'][_0x3d1d('0x2d')](_0x508392));}return BPromise[_0x3d1d('0x87')](_0x376048);}})[_0x3d1d('0x1e')](function(){return _0x478363;})[_0x3d1d('0x1e')](respondWithResult(_0x588298,null))['catch'](handleError(_0x588298,null));};exports[_0x3d1d('0x8c')]=function(_0x25c087,_0x1865e0,_0x1576f0){return db[_0x3d1d('0x27')][_0x3d1d('0x43')]({'where':{'id':_0x25c087[_0x3d1d('0x42')]['id']}})[_0x3d1d('0x1e')](handleEntityNotFound(_0x1865e0,null))['then'](function(_0xf55bf7){if(_0xf55bf7){return _0xf55bf7[_0x3d1d('0x8c')](_0x25c087[_0x3d1d('0x2d')]['ids']);}})['then'](function(_0x1342a7){if(_0x1342a7){return db[_0x3d1d('0x5d')]['destroy']({'where':{'ListId':_0x25c087[_0x3d1d('0x2d')]['ids'],'CampaignId':_0x25c087[_0x3d1d('0x42')]['id']}})[_0x3d1d('0x1e')](function(){return _0x1342a7;});}})[_0x3d1d('0x1e')](respondWithStatusCode(_0x1865e0,null))[_0x3d1d('0x40')](handleError(_0x1865e0,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 51c2dc5..4b0326a 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xf7b88a,_0x12c26c){var _0x286494=function(_0x22c311){while(--_0x22c311){_0xf7b88a['push'](_0xf7b88a['shift']());}};_0x286494(++_0x12c26c);}(_0x7a54,0x106));var _0x47a5=function(_0x1797e3,_0x4cc700){_0x1797e3=_0x1797e3-0x0;var _0x3f35f5=_0x7a54[_0x1797e3];return _0x3f35f5;};'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(_0x2b18e5,_0x1a141c){var _0x12e52c=function(_0x27ea16){while(--_0x27ea16){_0x2b18e5['push'](_0x2b18e5['shift']());}};_0x12e52c(++_0x1a141c);}(_0x7a54,0x106));var _0x47a5=function(_0x551fa8,_0x35f7b5){_0x551fa8=_0x551fa8-0x0;var _0x505d7c=_0x7a54[_0x551fa8];return _0x505d7c;};'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 diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index aabd15f..17c24af 100644 --- a/server/api/campaign/campaign.rpc.js +++ b/server/api/campaign/campaign.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9224=['options','raw','where','attributes','limit','include','map','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','findAll'];(function(_0x1e9dfe,_0x13f09f){var _0x5c0b0f=function(_0x2f99af){while(--_0x2f99af){_0x1e9dfe['push'](_0x1e9dfe['shift']());}};_0x5c0b0f(++_0x13f09f);}(_0x9224,0xa3));var _0x4922=function(_0x1238cf,_0xb25e8f){_0x1238cf=_0x1238cf-0x0;var _0x5eec1d=_0x9224[_0x1238cf];return _0x5eec1d;};'use strict';var _=require('lodash');var util=require(_0x4922('0x0'));var moment=require(_0x4922('0x1'));var BPromise=require(_0x4922('0x2'));var rs=require(_0x4922('0x3'));var fs=require('fs');var Redis=require(_0x4922('0x4'));var db=require(_0x4922('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4922('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4922('0x7')][_0x4922('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4216c0,_0x251048,_0x7a8bd1){return new BPromise(function(_0x245562,_0x5c65dd){return client[_0x4922('0x9')](_0x4216c0,_0x7a8bd1)[_0x4922('0xa')](function(_0x50db40){logger[_0x4922('0xb')](_0x4922('0xc'),_0x251048,_0x4922('0xd'));logger[_0x4922('0xe')](_0x4922('0xf'),_0x251048,_0x4922('0xd'),JSON[_0x4922('0x10')](_0x50db40));if(_0x50db40[_0x4922('0x11')]){if(_0x50db40['error'][_0x4922('0x12')]===0x1f4){logger['error'](_0x4922('0xc'),_0x251048,_0x50db40[_0x4922('0x11')][_0x4922('0x13')]);return _0x5c65dd(_0x50db40[_0x4922('0x11')][_0x4922('0x13')]);}logger['error'](_0x4922('0xc'),_0x251048,_0x50db40[_0x4922('0x11')]['message']);return _0x245562(_0x50db40[_0x4922('0x11')][_0x4922('0x13')]);}else{logger[_0x4922('0xb')](_0x4922('0xc'),_0x251048,_0x4922('0xd'));_0x245562(_0x50db40[_0x4922('0x14')][_0x4922('0x13')]);}})['catch'](function(_0x2ae924){logger['error'](_0x4922('0xc'),_0x251048,_0x2ae924);_0x5c65dd(_0x2ae924);});});}exports[_0x4922('0x15')]=function(_0x1d7fc2){var _0x15cdc9=this;return new Promise(function(_0x2ef410,_0x435e7b){return db['Campaign'][_0x4922('0x16')]({'raw':_0x1d7fc2[_0x4922('0x17')]?_0x1d7fc2[_0x4922('0x17')][_0x4922('0x18')]===undefined?!![]:![]:!![],'where':_0x1d7fc2[_0x4922('0x17')]?_0x1d7fc2['options'][_0x4922('0x19')]||null:null,'attributes':_0x1d7fc2[_0x4922('0x17')]?_0x1d7fc2[_0x4922('0x17')][_0x4922('0x1a')]||null:null,'limit':_0x1d7fc2[_0x4922('0x17')]?_0x1d7fc2[_0x4922('0x17')][_0x4922('0x1b')]||null:null,'include':_0x1d7fc2[_0x4922('0x17')]?_0x1d7fc2['options'][_0x4922('0x1c')]?_[_0x4922('0x1d')](_0x1d7fc2['options'][_0x4922('0x1c')],function(_0x23ce8d){return{'model':db[_0x23ce8d['model']],'as':_0x23ce8d['as'],'attributes':_0x23ce8d[_0x4922('0x1a')],'include':_0x23ce8d['include']?_[_0x4922('0x1d')](_0x23ce8d[_0x4922('0x1c')],function(_0x26bb17){return{'model':db[_0x26bb17['model']],'as':_0x26bb17['as'],'attributes':_0x26bb17[_0x4922('0x1a')],'include':_0x26bb17[_0x4922('0x1c')]?_[_0x4922('0x1d')](_0x26bb17['include'],function(_0x3eb5d){return{'model':db[_0x3eb5d['model']],'as':_0x3eb5d['as'],'attributes':_0x3eb5d[_0x4922('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4922('0xa')](function(_0x41ef37){logger[_0x4922('0xb')](_0x4922('0x15'),_0x1d7fc2);logger['debug'](_0x4922('0x15'),_0x1d7fc2,JSON['stringify'](_0x41ef37));_0x2ef410(_0x41ef37);})[_0x4922('0x1e')](function(_0x416e26){logger['error']('GetCampaign',_0x416e26['message'],_0x1d7fc2);_0x435e7b(_0x15cdc9[_0x4922('0x11')](0x1f4,_0x416e26['message']));});});}; \ No newline at end of file +var _0x0624=['Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetCampaign','Campaign','options','raw','where','attributes','limit','map','include','model','catch','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x0624,0x132));var _0x4062=function(_0x189be2,_0x5139dc){_0x189be2=_0x189be2-0x0;var _0xeac5af=_0x0624[_0x189be2];return _0xeac5af;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4062('0x0'));var fs=require('fs');var Redis=require(_0x4062('0x1'));var db=require(_0x4062('0x2'))['db'];var utils=require(_0x4062('0x3'));var logger=require(_0x4062('0x4'))(_0x4062('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4062('0x6')][_0x4062('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2f4928,_0xdff88c,_0x27794b){return new BPromise(function(_0x5d19e8,_0x75ce4e){return client['request'](_0x2f4928,_0x27794b)[_0x4062('0x8')](function(_0x35663b){logger[_0x4062('0x9')](_0x4062('0xa'),_0xdff88c,_0x4062('0xb'));logger[_0x4062('0xc')](_0x4062('0xd'),_0xdff88c,'request\x20sent',JSON[_0x4062('0xe')](_0x35663b));if(_0x35663b['error']){if(_0x35663b[_0x4062('0xf')][_0x4062('0x10')]===0x1f4){logger[_0x4062('0xf')](_0x4062('0xa'),_0xdff88c,_0x35663b[_0x4062('0xf')]['message']);return _0x75ce4e(_0x35663b[_0x4062('0xf')][_0x4062('0x11')]);}logger['error'](_0x4062('0xa'),_0xdff88c,_0x35663b[_0x4062('0xf')][_0x4062('0x11')]);return _0x5d19e8(_0x35663b['error']['message']);}else{logger[_0x4062('0x9')](_0x4062('0xa'),_0xdff88c,'request\x20sent');_0x5d19e8(_0x35663b['result']['message']);}})['catch'](function(_0x437432){logger['error'](_0x4062('0xa'),_0xdff88c,_0x437432);_0x75ce4e(_0x437432);});});}exports[_0x4062('0x12')]=function(_0x3d14bb){var _0x37cd8b=this;return new Promise(function(_0x2a04c7,_0x3942f2){return db[_0x4062('0x13')]['findAll']({'raw':_0x3d14bb[_0x4062('0x14')]?_0x3d14bb['options'][_0x4062('0x15')]===undefined?!![]:![]:!![],'where':_0x3d14bb['options']?_0x3d14bb[_0x4062('0x14')][_0x4062('0x16')]||null:null,'attributes':_0x3d14bb[_0x4062('0x14')]?_0x3d14bb[_0x4062('0x14')][_0x4062('0x17')]||null:null,'limit':_0x3d14bb[_0x4062('0x14')]?_0x3d14bb[_0x4062('0x14')][_0x4062('0x18')]||null:null,'include':_0x3d14bb[_0x4062('0x14')]?_0x3d14bb['options']['include']?_[_0x4062('0x19')](_0x3d14bb[_0x4062('0x14')][_0x4062('0x1a')],function(_0x1fa194){return{'model':db[_0x1fa194['model']],'as':_0x1fa194['as'],'attributes':_0x1fa194['attributes'],'include':_0x1fa194['include']?_[_0x4062('0x19')](_0x1fa194[_0x4062('0x1a')],function(_0x11b962){return{'model':db[_0x11b962[_0x4062('0x1b')]],'as':_0x11b962['as'],'attributes':_0x11b962[_0x4062('0x17')],'include':_0x11b962[_0x4062('0x1a')]?_['map'](_0x11b962[_0x4062('0x1a')],function(_0x448545){return{'model':db[_0x448545[_0x4062('0x1b')]],'as':_0x448545['as'],'attributes':_0x448545[_0x4062('0x17')]};}):[]};}):[]};}):[]:[]})[_0x4062('0x8')](function(_0x5934d2){logger[_0x4062('0x9')]('GetCampaign',_0x3d14bb);logger['debug'](_0x4062('0x12'),_0x3d14bb,JSON['stringify'](_0x5934d2));_0x2a04c7(_0x5934d2);})[_0x4062('0x1c')](function(_0x169c12){logger[_0x4062('0xf')](_0x4062('0x12'),_0x169c12[_0x4062('0x11')],_0x3d14bb);_0x3942f2(_0x37cd8b[_0x4062('0xf')](0x1f4,_0x169c12[_0x4062('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 0f7b44b..aaee105 100644 --- a/server/api/campaign/index.js +++ b/server/api/campaign/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1445=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHopperHistories','getHopperFinals','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addBlackLists','put','update','delete','destroy','/:id/lists','removeLists','removeBlackLists','exports','multer','util'];(function(_0x60a07f,_0x3cfed8){var _0x500cdd=function(_0x5874ea){while(--_0x5874ea){_0x60a07f['push'](_0x60a07f['shift']());}};_0x500cdd(++_0x3cfed8);}(_0x1445,0xa3));var _0x5144=function(_0x23a32f,_0x115c93){_0x23a32f=_0x23a32f-0x0;var _0x54eaf6=_0x1445[_0x23a32f];return _0x54eaf6;};'use strict';var multer=require(_0x5144('0x0'));var util=require(_0x5144('0x1'));var path=require('path');var timeout=require(_0x5144('0x2'));var express=require(_0x5144('0x3'));var router=express[_0x5144('0x4')]();var fs_extra=require(_0x5144('0x5'));var auth=require(_0x5144('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5144('0x7'));var controller=require('./campaign.controller');router[_0x5144('0x8')]('/',auth[_0x5144('0x9')](),controller[_0x5144('0xa')]);router[_0x5144('0x8')](_0x5144('0xb'),auth['isAuthenticated'](),controller[_0x5144('0xc')]);router[_0x5144('0x8')](_0x5144('0xd'),auth[_0x5144('0x9')](),controller['getHoppers']);router[_0x5144('0x8')]('/:id/hopper_histories',auth[_0x5144('0x9')](),controller[_0x5144('0xe')]);router[_0x5144('0x8')]('/:id/hopper_finals',auth[_0x5144('0x9')](),controller[_0x5144('0xf')]);router[_0x5144('0x8')]('/:id/hopper_black',auth[_0x5144('0x9')](),controller[_0x5144('0x10')]);router['get']('/:id/lists',auth[_0x5144('0x9')](),controller[_0x5144('0x11')]);router[_0x5144('0x8')](_0x5144('0x12'),auth[_0x5144('0x9')](),controller[_0x5144('0x13')]);router['post']('/',auth[_0x5144('0x9')](),controller[_0x5144('0x14')]);router[_0x5144('0x15')](_0x5144('0x16'),auth[_0x5144('0x9')](),controller[_0x5144('0x17')]);router['post']('/:id/lists',auth[_0x5144('0x9')](),controller['addLists']);router[_0x5144('0x15')](_0x5144('0x12'),auth['isAuthenticated'](),controller[_0x5144('0x18')]);router[_0x5144('0x19')](_0x5144('0xb'),auth[_0x5144('0x9')](),controller[_0x5144('0x1a')]);router[_0x5144('0x1b')](_0x5144('0xb'),auth[_0x5144('0x9')](),controller[_0x5144('0x1c')]);router[_0x5144('0x1b')](_0x5144('0x1d'),auth['isAuthenticated'](),controller[_0x5144('0x1e')]);router[_0x5144('0x1b')](_0x5144('0x12'),auth[_0x5144('0x9')](),controller[_0x5144('0x1f')]);module[_0x5144('0x20')]=router; \ No newline at end of file +var _0xc3f9=['/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addBlackLists','delete','destroy','removeLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black'];(function(_0x4b0c3e,_0x50754a){var _0xa99d4e=function(_0x1034a2){while(--_0x1034a2){_0x4b0c3e['push'](_0x4b0c3e['shift']());}};_0xa99d4e(++_0x50754a);}(_0xc3f9,0x125));var _0x9c3f=function(_0xe09a2,_0x4034bf){_0xe09a2=_0xe09a2-0x0;var _0x503d42=_0xc3f9[_0xe09a2];return _0x503d42;};'use strict';var multer=require(_0x9c3f('0x0'));var util=require(_0x9c3f('0x1'));var path=require(_0x9c3f('0x2'));var timeout=require(_0x9c3f('0x3'));var express=require(_0x9c3f('0x4'));var router=express[_0x9c3f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9c3f('0x6'));var interaction=require(_0x9c3f('0x7'));var config=require(_0x9c3f('0x8'));var controller=require(_0x9c3f('0x9'));router[_0x9c3f('0xa')]('/',auth['isAuthenticated'](),controller[_0x9c3f('0xb')]);router['get'](_0x9c3f('0xc'),auth[_0x9c3f('0xd')](),controller[_0x9c3f('0xe')]);router['get'](_0x9c3f('0xf'),auth['isAuthenticated'](),controller[_0x9c3f('0x10')]);router[_0x9c3f('0xa')](_0x9c3f('0x11'),auth[_0x9c3f('0xd')](),controller[_0x9c3f('0x12')]);router[_0x9c3f('0xa')](_0x9c3f('0x13'),auth[_0x9c3f('0xd')](),controller[_0x9c3f('0x14')]);router['get'](_0x9c3f('0x15'),auth[_0x9c3f('0xd')](),controller['getHopperBlacks']);router[_0x9c3f('0xa')](_0x9c3f('0x16'),auth[_0x9c3f('0xd')](),controller[_0x9c3f('0x17')]);router['get'](_0x9c3f('0x18'),auth[_0x9c3f('0xd')](),controller[_0x9c3f('0x19')]);router[_0x9c3f('0x1a')]('/',auth[_0x9c3f('0xd')](),controller[_0x9c3f('0x1b')]);router[_0x9c3f('0x1a')](_0x9c3f('0x1c'),auth[_0x9c3f('0xd')](),controller[_0x9c3f('0x1d')]);router[_0x9c3f('0x1a')]('/:id/lists',auth[_0x9c3f('0xd')](),controller['addLists']);router[_0x9c3f('0x1a')](_0x9c3f('0x18'),auth[_0x9c3f('0xd')](),controller[_0x9c3f('0x1e')]);router['put'](_0x9c3f('0xc'),auth[_0x9c3f('0xd')](),controller['update']);router[_0x9c3f('0x1f')](_0x9c3f('0xc'),auth[_0x9c3f('0xd')](),controller[_0x9c3f('0x20')]);router['delete'](_0x9c3f('0x16'),auth[_0x9c3f('0xd')](),controller[_0x9c3f('0x21')]);router['delete'](_0x9c3f('0x18'),auth[_0x9c3f('0xd')](),controller['removeBlackLists']);module[_0x9c3f('0x22')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index c75eed8..326fca3 100644 --- a/server/api/cannedAnswer/cannedAnswer.attributes.js +++ b/server/api/cannedAnswer/cannedAnswer.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc9fe=['STRING','VIRTUAL','key','exports','TEXT','medium'];(function(_0x216b8a,_0x459a11){var _0x344626=function(_0x27c690){while(--_0x27c690){_0x216b8a['push'](_0x216b8a['shift']());}};_0x344626(++_0x459a11);}(_0xc9fe,0x1b9));var _0xec9f=function(_0x30c5c6,_0x43db74){_0x30c5c6=_0x30c5c6-0x0;var _0x2aaa31=_0xc9fe[_0x30c5c6];return _0x2aaa31;};'use strict';var Sequelize=require('sequelize');module[_0xec9f('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xec9f('0x1')],'length':_0xec9f('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xec9f('0x3')]},'name':{'type':Sequelize[_0xec9f('0x4')],'get':function(){return this['getDataValue'](_0xec9f('0x5'));}}}; \ No newline at end of file +var _0x16e1=['medium','VIRTUAL','getDataValue','STRING','TEXT'];(function(_0x20629d,_0x1a6757){var _0x4ca950=function(_0x2c806c){while(--_0x2c806c){_0x20629d['push'](_0x20629d['shift']());}};_0x4ca950(++_0x1a6757);}(_0x16e1,0x120));var _0x116e=function(_0x336376,_0xe4b28d){_0x336376=_0x336376-0x0;var _0x1d2a8e=_0x16e1[_0x336376];return _0x1d2a8e;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x116e('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x116e('0x1')],'length':_0x116e('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x116e('0x0')]},'name':{'type':Sequelize[_0x116e('0x3')],'get':function(){return this[_0x116e('0x4')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index eab278e..a4845b4 100644 --- a/server/api/cannedAnswer/cannedAnswer.controller.js +++ b/server/api/cannedAnswer/cannedAnswer.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x92ff=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x92ff,0x118));var _0xf92f=function(_0x3b968d,_0x1bf92a){_0x3b968d=_0x3b968d-0x0;var _0x565012=_0x92ff[_0x3b968d];return _0x565012;};'use strict';var emlformat=require(_0xf92f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf92f('0x1'));var rp=require(_0xf92f('0x2'));var moment=require(_0xf92f('0x3'));var BPromise=require(_0xf92f('0x4'));var Mustache=require(_0xf92f('0x5'));var util=require('util');var path=require(_0xf92f('0x6'));var sox=require(_0xf92f('0x7'));var csv=require('to-csv');var ejs=require(_0xf92f('0x8'));var fs=require('fs');var fs_extra=require(_0xf92f('0x9'));var _=require('lodash');var squel=require(_0xf92f('0xa'));var crypto=require(_0xf92f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf92f('0xc'));var toCsv=require(_0xf92f('0xd'));var querystring=require(_0xf92f('0xe'));var Papa=require('papaparse');var Redis=require(_0xf92f('0xf'));var authService=require(_0xf92f('0x10'));var qs=require(_0xf92f('0x11'));var as=require(_0xf92f('0x12'));var hardwareService=require(_0xf92f('0x13'));var logger=require(_0xf92f('0x14'))(_0xf92f('0x15'));var utils=require(_0xf92f('0x16'));var config=require(_0xf92f('0x17'));var licenseUtil=require(_0xf92f('0x18'));var db=require(_0xf92f('0x19'))['db'];function respondWithStatusCode(_0x51db28,_0x497030){_0x497030=_0x497030||0xcc;return function(_0x2e4a0d){if(_0x2e4a0d){return _0x51db28[_0xf92f('0x1a')](_0x497030);}return _0x51db28[_0xf92f('0x1b')](_0x497030)[_0xf92f('0x1c')]();};}function respondWithResult(_0x566a02,_0x2ff88a){_0x2ff88a=_0x2ff88a||0xc8;return function(_0x5773d1){if(_0x5773d1){return _0x566a02['status'](_0x2ff88a)[_0xf92f('0x1d')](_0x5773d1);}};}function respondWithFilteredResult(_0x565a4f,_0x586585){return function(_0x3bd8c2){if(_0x3bd8c2){var _0x4f2248=typeof _0x586585[_0xf92f('0x1e')]===_0xf92f('0x1f')&&typeof _0x586585[_0xf92f('0x20')]===_0xf92f('0x1f');var _0x2584a5=_0x3bd8c2[_0xf92f('0x21')];var _0x58f139=_0x4f2248?0x0:_0x586585[_0xf92f('0x1e')];var _0x3e59c9=_0x4f2248?_0x3bd8c2['count']:_0x586585[_0xf92f('0x1e')]+_0x586585[_0xf92f('0x20')];var _0x1d052e;if(_0x3e59c9>=_0x2584a5){_0x3e59c9=_0x2584a5;_0x1d052e=0xc8;}else{_0x1d052e=0xce;}_0x565a4f[_0xf92f('0x1b')](_0x1d052e);return _0x565a4f['set'](_0xf92f('0x22'),_0x58f139+'-'+_0x3e59c9+'/'+_0x2584a5)[_0xf92f('0x1d')](_0x3bd8c2);}return null;};}function patchUpdates(_0x1a47de){return function(_0x57c5b9){try{jsonpatch[_0xf92f('0x23')](_0x57c5b9,_0x1a47de,!![]);}catch(_0x56bc24){return BPromise[_0xf92f('0x24')](_0x56bc24);}return _0x57c5b9[_0xf92f('0x25')]();};}function saveUpdates(_0x2644f9,_0x42b939){return function(_0x4abf18){if(_0x4abf18){return _0x4abf18[_0xf92f('0x26')](_0x2644f9)[_0xf92f('0x27')](function(_0x4252b9){return _0x4252b9;});}return null;};}function removeEntity(_0x1729ca,_0x5f3099){return function(_0x1ae76d){if(_0x1ae76d){return _0x1ae76d[_0xf92f('0x28')]()[_0xf92f('0x27')](function(){var _0x4a4329=_0x1ae76d[_0xf92f('0x29')]({'plain':!![]});var _0x2bed05=_0xf92f('0x2a');return db[_0xf92f('0x2b')][_0xf92f('0x28')]({'where':{'type':_0x2bed05,'resourceId':_0x4a4329['id']}})[_0xf92f('0x27')](function(){return _0x1ae76d;});})[_0xf92f('0x27')](function(){_0x1729ca[_0xf92f('0x1b')](0xcc)[_0xf92f('0x1c')]();});}};}function handleEntityNotFound(_0x446dfc,_0x437f1d){return function(_0x24928b){if(!_0x24928b){_0x446dfc[_0xf92f('0x1a')](0x194);}return _0x24928b;};}function handleError(_0x2816da,_0x20ba6d){_0x20ba6d=_0x20ba6d||0x1f4;return function(_0x50f67f){logger[_0xf92f('0x2c')](_0x50f67f[_0xf92f('0x2d')]);if(_0x50f67f['name']){delete _0x50f67f[_0xf92f('0x2e')];}_0x2816da['status'](_0x20ba6d)[_0xf92f('0x2f')](_0x50f67f);};}exports[_0xf92f('0x30')]=function(_0x3df235,_0x3e1603){var _0x5d12d1={},_0x3d4f2b={},_0x25e8f8={'count':0x0,'rows':[]};var _0x291a47=_[_0xf92f('0x31')](db[_0xf92f('0x32')][_0xf92f('0x33')],function(_0x140a8d){return{'name':_0x140a8d['fieldName'],'type':_0x140a8d[_0xf92f('0x34')][_0xf92f('0x35')]};});_0x3d4f2b[_0xf92f('0x36')]=_[_0xf92f('0x31')](_0x291a47,_0xf92f('0x2e'));_0x3d4f2b[_0xf92f('0x37')]=_[_0xf92f('0x38')](_0x3df235[_0xf92f('0x37')]);_0x3d4f2b[_0xf92f('0x39')]=_[_0xf92f('0x3a')](_0x3d4f2b[_0xf92f('0x36')],_0x3d4f2b['query']);_0x5d12d1['attributes']=_['intersection'](_0x3d4f2b[_0xf92f('0x36')],qs['fields'](_0x3df235[_0xf92f('0x37')][_0xf92f('0x3b')]));_0x5d12d1[_0xf92f('0x3c')]=_0x5d12d1[_0xf92f('0x3c')][_0xf92f('0x3d')]?_0x5d12d1[_0xf92f('0x3c')]:_0x3d4f2b[_0xf92f('0x36')];if(!_0x3df235[_0xf92f('0x37')]['hasOwnProperty'](_0xf92f('0x3e'))){_0x5d12d1[_0xf92f('0x20')]=qs['limit'](_0x3df235[_0xf92f('0x37')]['limit']);_0x5d12d1['offset']=qs['offset'](_0x3df235[_0xf92f('0x37')][_0xf92f('0x1e')]);}_0x5d12d1[_0xf92f('0x3f')]=qs[_0xf92f('0x40')](_0x3df235['query'][_0xf92f('0x40')]);_0x5d12d1['where']=qs[_0xf92f('0x39')](_[_0xf92f('0x41')](_0x3df235[_0xf92f('0x37')],_0x3d4f2b[_0xf92f('0x39')]),_0x291a47);if(_0x3df235[_0xf92f('0x37')][_0xf92f('0x42')]){_0x5d12d1[_0xf92f('0x43')]=_[_0xf92f('0x44')](_0x5d12d1[_0xf92f('0x43')],{'$or':[{'key':{'$like':'%'+_0x3df235[_0xf92f('0x37')][_0xf92f('0x42')]+'%'}},{'value':{'$like':'%'+_0x3df235[_0xf92f('0x37')][_0xf92f('0x42')]+'%'}}]});}_0x5d12d1=_[_0xf92f('0x44')]({},_0x5d12d1,_0x3df235['options']);var _0x4aede5={'where':_0x5d12d1[_0xf92f('0x43')]};return db[_0xf92f('0x32')][_0xf92f('0x21')](_0x4aede5)['then'](function(_0x5eb3f9){_0x25e8f8[_0xf92f('0x21')]=_0x5eb3f9;if(_0x3df235[_0xf92f('0x37')][_0xf92f('0x45')]){_0x5d12d1[_0xf92f('0x46')]=[{'all':!![]}];}return db['CannedAnswer'][_0xf92f('0x47')](_0x5d12d1);})['then'](function(_0x25b18c){_0x25e8f8[_0xf92f('0x48')]=_0x25b18c;return _0x25e8f8;})[_0xf92f('0x27')](respondWithFilteredResult(_0x3e1603,_0x5d12d1))[_0xf92f('0x49')](handleError(_0x3e1603,null));};exports[_0xf92f('0x4a')]=function(_0x2786c2,_0x12f088){var _0x359cb2={'raw':!![],'where':{'id':_0x2786c2[_0xf92f('0x4b')]['id']}},_0x287e6b={};_0x287e6b[_0xf92f('0x36')]=_[_0xf92f('0x38')](db[_0xf92f('0x32')][_0xf92f('0x33')]);_0x287e6b[_0xf92f('0x37')]=_[_0xf92f('0x38')](_0x2786c2[_0xf92f('0x37')]);_0x287e6b['filters']=_['intersection'](_0x287e6b[_0xf92f('0x36')],_0x287e6b['query']);_0x359cb2[_0xf92f('0x3c')]=_[_0xf92f('0x3a')](_0x287e6b['model'],qs[_0xf92f('0x3b')](_0x2786c2[_0xf92f('0x37')]['fields']));_0x359cb2[_0xf92f('0x3c')]=_0x359cb2[_0xf92f('0x3c')][_0xf92f('0x3d')]?_0x359cb2[_0xf92f('0x3c')]:_0x287e6b[_0xf92f('0x36')];if(_0x2786c2[_0xf92f('0x37')][_0xf92f('0x45')]){_0x359cb2[_0xf92f('0x46')]=[{'all':!![]}];}_0x359cb2=_[_0xf92f('0x44')]({},_0x359cb2,_0x2786c2[_0xf92f('0x4c')]);return db['CannedAnswer'][_0xf92f('0x4d')](_0x359cb2)[_0xf92f('0x27')](handleEntityNotFound(_0x12f088,null))[_0xf92f('0x27')](respondWithResult(_0x12f088,null))[_0xf92f('0x49')](handleError(_0x12f088,null));};exports[_0xf92f('0x26')]=function(_0x251a0f,_0x304cfe){if(_0x251a0f[_0xf92f('0x4e')]['id']){delete _0x251a0f[_0xf92f('0x4e')]['id'];}return db[_0xf92f('0x32')][_0xf92f('0x4d')]({'where':{'id':_0x251a0f[_0xf92f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x304cfe,null))['then'](saveUpdates(_0x251a0f['body'],null))[_0xf92f('0x27')](respondWithResult(_0x304cfe,null))[_0xf92f('0x49')](handleError(_0x304cfe,null));};exports['destroy']=function(_0x333ce0,_0x4331e1){return db[_0xf92f('0x32')][_0xf92f('0x4d')]({'where':{'id':_0x333ce0[_0xf92f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4331e1,null))[_0xf92f('0x27')](removeEntity(_0x4331e1,null))[_0xf92f('0x49')](handleError(_0x4331e1,null));};exports[_0xf92f('0x4f')]=function(_0x478370,_0x5f5413){var _0x59a300={'key':_0x478370[_0xf92f('0x4e')]['key']};if(_0x478370[_0xf92f('0x4e')][_0xf92f('0x50')]){_0x59a300[_0xf92f('0x50')]=_0x478370[_0xf92f('0x4e')][_0xf92f('0x50')];}else if(_0x478370[_0xf92f('0x4e')][_0xf92f('0x51')]){_0x59a300['SmsAccountId']=_0x478370[_0xf92f('0x4e')][_0xf92f('0x51')];}else if(_0x478370[_0xf92f('0x4e')][_0xf92f('0x52')]){_0x59a300[_0xf92f('0x52')]=_0x478370[_0xf92f('0x4e')][_0xf92f('0x52')];}else if(_0x478370[_0xf92f('0x4e')][_0xf92f('0x53')]){_0x59a300[_0xf92f('0x53')]=_0x478370[_0xf92f('0x4e')][_0xf92f('0x53')];}return db[_0xf92f('0x32')][_0xf92f('0x4d')]({'where':_0x59a300})[_0xf92f('0x27')](function(_0x579e06){if(_0x579e06){throw new db[(_0xf92f('0x54'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xf92f('0x32')]['create'](_0x478370['body']);})[_0xf92f('0x27')](function(_0x107c8d){var _0x402b57=_0x478370[_0xf92f('0x55')]['get']({'plain':!![]});if(!_0x402b57)throw new Error(_0xf92f('0x56'));if(_0x402b57[_0xf92f('0x57')]===_0xf92f('0x55')){var _0x3819ab=_0x107c8d['get']({'plain':!![]});return db[_0xf92f('0x58')][_0xf92f('0x4d')]({'where':{'name':'CannedAnswers','userProfileId':_0x402b57[_0xf92f('0x59')]},'raw':!![]})[_0xf92f('0x27')](function(_0x5554f9){if(_0x5554f9&&_0x5554f9[_0xf92f('0x5a')]===0x0){return db[_0xf92f('0x2b')][_0xf92f('0x4f')]({'name':_0x3819ab[_0xf92f('0x2e')],'resourceId':_0x3819ab['id'],'type':_0x5554f9['name'],'sectionId':_0x5554f9['id']},{})[_0xf92f('0x27')](function(){return _0x107c8d;});}else{return _0x107c8d;}})[_0xf92f('0x49')](function(_0x25d8d7){logger[_0xf92f('0x2c')](_0xf92f('0x5b'),_0x25d8d7);throw _0x25d8d7;});}return _0x107c8d;})['then'](respondWithResult(_0x5f5413,0xc9))[_0xf92f('0x49')](handleError(_0x5f5413,null));}; \ No newline at end of file +var _0xd7fd=['pick','where','filter','merge','options','CannedAnswer','includeAll','findAll','rows','catch','show','params','keys','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send','index','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7fd,0x12f));var _0xdd7f=function(_0x5a2291,_0x3ddda7){_0x5a2291=_0x5a2291-0x0;var _0x10e3f5=_0xd7fd[_0x5a2291];return _0x10e3f5;};'use strict';var emlformat=require(_0xdd7f('0x0'));var rimraf=require(_0xdd7f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd7f('0x2'));var rp=require(_0xdd7f('0x3'));var moment=require(_0xdd7f('0x4'));var BPromise=require(_0xdd7f('0x5'));var Mustache=require('mustache');var util=require(_0xdd7f('0x6'));var path=require(_0xdd7f('0x7'));var sox=require(_0xdd7f('0x8'));var csv=require('to-csv');var ejs=require(_0xdd7f('0x9'));var fs=require('fs');var fs_extra=require(_0xdd7f('0xa'));var _=require(_0xdd7f('0xb'));var squel=require(_0xdd7f('0xc'));var crypto=require(_0xdd7f('0xd'));var jsforce=require(_0xdd7f('0xe'));var deskjs=require(_0xdd7f('0xf'));var toCsv=require(_0xdd7f('0x10'));var querystring=require(_0xdd7f('0x11'));var Papa=require(_0xdd7f('0x12'));var Redis=require(_0xdd7f('0x13'));var authService=require(_0xdd7f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xdd7f('0x15'));var hardwareService=require(_0xdd7f('0x16'));var logger=require(_0xdd7f('0x17'))(_0xdd7f('0x18'));var utils=require('../../config/utils');var config=require(_0xdd7f('0x19'));var licenseUtil=require(_0xdd7f('0x1a'));var db=require(_0xdd7f('0x1b'))['db'];function respondWithStatusCode(_0x2d3c77,_0x5f5227){_0x5f5227=_0x5f5227||0xcc;return function(_0x10b2e3){if(_0x10b2e3){return _0x2d3c77[_0xdd7f('0x1c')](_0x5f5227);}return _0x2d3c77[_0xdd7f('0x1d')](_0x5f5227)['end']();};}function respondWithResult(_0x415620,_0x6480ae){_0x6480ae=_0x6480ae||0xc8;return function(_0x5ab3dc){if(_0x5ab3dc){return _0x415620[_0xdd7f('0x1d')](_0x6480ae)['json'](_0x5ab3dc);}};}function respondWithFilteredResult(_0x36ef28,_0x8a2e0d){return function(_0x26f5dc){if(_0x26f5dc){var _0xf3b5af=typeof _0x8a2e0d['offset']==='undefined'&&typeof _0x8a2e0d['limit']==='undefined';var _0x5f5c8d=_0x26f5dc[_0xdd7f('0x1e')];var _0x508069=_0xf3b5af?0x0:_0x8a2e0d[_0xdd7f('0x1f')];var _0x3099b1=_0xf3b5af?_0x26f5dc[_0xdd7f('0x1e')]:_0x8a2e0d['offset']+_0x8a2e0d[_0xdd7f('0x20')];var _0x52055d;if(_0x3099b1>=_0x5f5c8d){_0x3099b1=_0x5f5c8d;_0x52055d=0xc8;}else{_0x52055d=0xce;}_0x36ef28[_0xdd7f('0x1d')](_0x52055d);return _0x36ef28[_0xdd7f('0x21')](_0xdd7f('0x22'),_0x508069+'-'+_0x3099b1+'/'+_0x5f5c8d)[_0xdd7f('0x23')](_0x26f5dc);}return null;};}function patchUpdates(_0x166fba){return function(_0x2829e5){try{jsonpatch['apply'](_0x2829e5,_0x166fba,!![]);}catch(_0x3784de){return BPromise[_0xdd7f('0x24')](_0x3784de);}return _0x2829e5[_0xdd7f('0x25')]();};}function saveUpdates(_0x16a82b,_0x4d7c56){return function(_0x5be066){if(_0x5be066){return _0x5be066[_0xdd7f('0x26')](_0x16a82b)[_0xdd7f('0x27')](function(_0x3c79c7){return _0x3c79c7;});}return null;};}function removeEntity(_0x175a9d,_0x5b3ace){return function(_0x3c3328){if(_0x3c3328){return _0x3c3328[_0xdd7f('0x28')]()[_0xdd7f('0x27')](function(){var _0x455977=_0x3c3328[_0xdd7f('0x29')]({'plain':!![]});var _0xcc5dcb=_0xdd7f('0x2a');return db[_0xdd7f('0x2b')][_0xdd7f('0x28')]({'where':{'type':_0xcc5dcb,'resourceId':_0x455977['id']}})['then'](function(){return _0x3c3328;});})[_0xdd7f('0x27')](function(){_0x175a9d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f1492,_0x399b12){return function(_0xcac826){if(!_0xcac826){_0x2f1492[_0xdd7f('0x1c')](0x194);}return _0xcac826;};}function handleError(_0xabd864,_0x5cb3bb){_0x5cb3bb=_0x5cb3bb||0x1f4;return function(_0x2dea52){logger['error'](_0x2dea52[_0xdd7f('0x2c')]);if(_0x2dea52[_0xdd7f('0x2d')]){delete _0x2dea52[_0xdd7f('0x2d')];}_0xabd864[_0xdd7f('0x1d')](_0x5cb3bb)[_0xdd7f('0x2e')](_0x2dea52);};}exports[_0xdd7f('0x2f')]=function(_0x580c0a,_0x1105dd){var _0x6d13ad={},_0x2ef3cf={},_0x40dd49={'count':0x0,'rows':[]};var _0x1dd90a=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x3568fe){return{'name':_0x3568fe[_0xdd7f('0x30')],'type':_0x3568fe[_0xdd7f('0x31')]['key']};});_0x2ef3cf['model']=_[_0xdd7f('0x32')](_0x1dd90a,'name');_0x2ef3cf[_0xdd7f('0x33')]=_['keys'](_0x580c0a['query']);_0x2ef3cf[_0xdd7f('0x34')]=_[_0xdd7f('0x35')](_0x2ef3cf[_0xdd7f('0x36')],_0x2ef3cf['query']);_0x6d13ad[_0xdd7f('0x37')]=_[_0xdd7f('0x35')](_0x2ef3cf[_0xdd7f('0x36')],qs[_0xdd7f('0x38')](_0x580c0a[_0xdd7f('0x33')][_0xdd7f('0x38')]));_0x6d13ad[_0xdd7f('0x37')]=_0x6d13ad[_0xdd7f('0x37')][_0xdd7f('0x39')]?_0x6d13ad[_0xdd7f('0x37')]:_0x2ef3cf[_0xdd7f('0x36')];if(!_0x580c0a[_0xdd7f('0x33')]['hasOwnProperty'](_0xdd7f('0x3a'))){_0x6d13ad[_0xdd7f('0x20')]=qs[_0xdd7f('0x20')](_0x580c0a[_0xdd7f('0x33')][_0xdd7f('0x20')]);_0x6d13ad[_0xdd7f('0x1f')]=qs[_0xdd7f('0x1f')](_0x580c0a[_0xdd7f('0x33')][_0xdd7f('0x1f')]);}_0x6d13ad[_0xdd7f('0x3b')]=qs[_0xdd7f('0x3c')](_0x580c0a['query']['sort']);_0x6d13ad['where']=qs[_0xdd7f('0x34')](_[_0xdd7f('0x3d')](_0x580c0a[_0xdd7f('0x33')],_0x2ef3cf['filters']),_0x1dd90a);if(_0x580c0a[_0xdd7f('0x33')]['filter']){_0x6d13ad[_0xdd7f('0x3e')]=_['merge'](_0x6d13ad[_0xdd7f('0x3e')],{'$or':[{'key':{'$like':'%'+_0x580c0a['query'][_0xdd7f('0x3f')]+'%'}},{'value':{'$like':'%'+_0x580c0a[_0xdd7f('0x33')][_0xdd7f('0x3f')]+'%'}}]});}_0x6d13ad=_[_0xdd7f('0x40')]({},_0x6d13ad,_0x580c0a[_0xdd7f('0x41')]);var _0x2ea2de={'where':_0x6d13ad[_0xdd7f('0x3e')]};return db[_0xdd7f('0x42')][_0xdd7f('0x1e')](_0x2ea2de)['then'](function(_0x4f342f){_0x40dd49[_0xdd7f('0x1e')]=_0x4f342f;if(_0x580c0a[_0xdd7f('0x33')][_0xdd7f('0x43')]){_0x6d13ad['include']=[{'all':!![]}];}return db[_0xdd7f('0x42')][_0xdd7f('0x44')](_0x6d13ad);})['then'](function(_0x47ade5){_0x40dd49[_0xdd7f('0x45')]=_0x47ade5;return _0x40dd49;})['then'](respondWithFilteredResult(_0x1105dd,_0x6d13ad))[_0xdd7f('0x46')](handleError(_0x1105dd,null));};exports[_0xdd7f('0x47')]=function(_0x2be1f7,_0x2ee5ed){var _0x1d952f={'raw':!![],'where':{'id':_0x2be1f7[_0xdd7f('0x48')]['id']}},_0x31fd69={};_0x31fd69[_0xdd7f('0x36')]=_[_0xdd7f('0x49')](db[_0xdd7f('0x42')]['rawAttributes']);_0x31fd69[_0xdd7f('0x33')]=_[_0xdd7f('0x49')](_0x2be1f7['query']);_0x31fd69[_0xdd7f('0x34')]=_[_0xdd7f('0x35')](_0x31fd69[_0xdd7f('0x36')],_0x31fd69[_0xdd7f('0x33')]);_0x1d952f[_0xdd7f('0x37')]=_['intersection'](_0x31fd69['model'],qs[_0xdd7f('0x38')](_0x2be1f7['query'][_0xdd7f('0x38')]));_0x1d952f[_0xdd7f('0x37')]=_0x1d952f['attributes']['length']?_0x1d952f[_0xdd7f('0x37')]:_0x31fd69[_0xdd7f('0x36')];if(_0x2be1f7[_0xdd7f('0x33')]['includeAll']){_0x1d952f[_0xdd7f('0x4a')]=[{'all':!![]}];}_0x1d952f=_['merge']({},_0x1d952f,_0x2be1f7[_0xdd7f('0x41')]);return db[_0xdd7f('0x42')][_0xdd7f('0x4b')](_0x1d952f)[_0xdd7f('0x27')](handleEntityNotFound(_0x2ee5ed,null))[_0xdd7f('0x27')](respondWithResult(_0x2ee5ed,null))[_0xdd7f('0x46')](handleError(_0x2ee5ed,null));};exports[_0xdd7f('0x26')]=function(_0x1a1bb0,_0x2a09f5){if(_0x1a1bb0[_0xdd7f('0x4c')]['id']){delete _0x1a1bb0[_0xdd7f('0x4c')]['id'];}return db[_0xdd7f('0x42')]['find']({'where':{'id':_0x1a1bb0[_0xdd7f('0x48')]['id']}})[_0xdd7f('0x27')](handleEntityNotFound(_0x2a09f5,null))[_0xdd7f('0x27')](saveUpdates(_0x1a1bb0[_0xdd7f('0x4c')],null))[_0xdd7f('0x27')](respondWithResult(_0x2a09f5,null))[_0xdd7f('0x46')](handleError(_0x2a09f5,null));};exports[_0xdd7f('0x28')]=function(_0xc7318e,_0x97f9d0){return db[_0xdd7f('0x42')]['find']({'where':{'id':_0xc7318e['params']['id']}})['then'](handleEntityNotFound(_0x97f9d0,null))['then'](removeEntity(_0x97f9d0,null))[_0xdd7f('0x46')](handleError(_0x97f9d0,null));};exports[_0xdd7f('0x4d')]=function(_0x33897b,_0x580cf1){var _0xf92eea={'key':_0x33897b['body']['key']};if(_0x33897b[_0xdd7f('0x4c')][_0xdd7f('0x4e')]){_0xf92eea[_0xdd7f('0x4e')]=_0x33897b[_0xdd7f('0x4c')][_0xdd7f('0x4e')];}else if(_0x33897b['body'][_0xdd7f('0x4f')]){_0xf92eea['SmsAccountId']=_0x33897b[_0xdd7f('0x4c')][_0xdd7f('0x4f')];}else if(_0x33897b[_0xdd7f('0x4c')][_0xdd7f('0x50')]){_0xf92eea[_0xdd7f('0x50')]=_0x33897b[_0xdd7f('0x4c')][_0xdd7f('0x50')];}else if(_0x33897b[_0xdd7f('0x4c')]['ChatWebsiteId']){_0xf92eea[_0xdd7f('0x51')]=_0x33897b[_0xdd7f('0x4c')][_0xdd7f('0x51')];}return db['CannedAnswer'][_0xdd7f('0x4b')]({'where':_0xf92eea})[_0xdd7f('0x27')](function(_0x247903){if(_0x247903){throw new db[(_0xdd7f('0x52'))][(_0xdd7f('0x53'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xdd7f('0x42')][_0xdd7f('0x4d')](_0x33897b['body']);})[_0xdd7f('0x27')](function(_0x366059){var _0x16c306=_0x33897b[_0xdd7f('0x54')]['get']({'plain':!![]});if(!_0x16c306)throw new Error(_0xdd7f('0x55'));if(_0x16c306[_0xdd7f('0x56')]==='user'){var _0x5da8da=_0x366059[_0xdd7f('0x29')]({'plain':!![]});return db[_0xdd7f('0x57')][_0xdd7f('0x4b')]({'where':{'name':'CannedAnswers','userProfileId':_0x16c306['userProfileId']},'raw':!![]})[_0xdd7f('0x27')](function(_0x582c07){if(_0x582c07&&_0x582c07[_0xdd7f('0x58')]===0x0){return db[_0xdd7f('0x2b')]['create']({'name':_0x5da8da[_0xdd7f('0x2d')],'resourceId':_0x5da8da['id'],'type':_0x582c07['name'],'sectionId':_0x582c07['id']},{})[_0xdd7f('0x27')](function(){return _0x366059;});}else{return _0x366059;}})[_0xdd7f('0x46')](function(_0x8aa590){logger[_0xdd7f('0x59')](_0xdd7f('0x5a'),_0x8aa590);throw _0x8aa590;});}return _0x366059;})[_0xdd7f('0x27')](respondWithResult(_0x580cf1,0xc9))[_0xdd7f('0x46')](handleError(_0x580cf1,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index c493c0f..1448795 100644 --- a/server/api/cannedAnswer/cannedAnswer.model.js +++ b/server/api/cannedAnswer/cannedAnswer.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8fde=['util','api','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x8fde,0x138));var _0xe8fd=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x8fde[_0x2064e5];return _0x21a233;};'use strict';var _=require('lodash');var util=require(_0xe8fd('0x0'));var logger=require('../../config/logger')(_0xe8fd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8fd('0x2'));var rimraf=require(_0xe8fd('0x3'));var config=require(_0xe8fd('0x4'));var attributes=require(_0xe8fd('0x5'));module[_0xe8fd('0x6')]=function(_0x2c8125,_0x289235){return _0x2c8125[_0xe8fd('0x7')](_0xe8fd('0x8'),attributes,{'tableName':_0xe8fd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe8fd('0xa'),'collate':_0xe8fd('0xb')});}; \ No newline at end of file +var _0x8b54=['CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','./cannedAnswer.attributes','exports'];(function(_0x50f392,_0x1d8441){var _0x5926f2=function(_0x17df32){while(--_0x17df32){_0x50f392['push'](_0x50f392['shift']());}};_0x5926f2(++_0x1d8441);}(_0x8b54,0x1a8));var _0x48b5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8b54[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x48b5('0x0'));var util=require(_0x48b5('0x1'));var logger=require('../../config/logger')(_0x48b5('0x2'));var moment=require(_0x48b5('0x3'));var BPromise=require('bluebird');var rp=require(_0x48b5('0x4'));var fs=require('fs');var path=require(_0x48b5('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x48b5('0x6'));module[_0x48b5('0x7')]=function(_0x129382,_0x33064f){return _0x129382['define'](_0x48b5('0x8'),attributes,{'tableName':_0x48b5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x48b5('0xa'),'collate':_0x48b5('0xb')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 2736216..c45f873 100644 --- a/server/api/cannedAnswer/cannedAnswer.rpc.js +++ b/server/api/cannedAnswer/cannedAnswer.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x180342,_0x58a67b){var _0x23e0f7=function(_0x14c8bf){while(--_0x14c8bf){_0x180342['push'](_0x180342['shift']());}};_0x23e0f7(++_0x58a67b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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(_0x329cff,_0x23abc1){var _0x7b53f4=function(_0x10bd89){while(--_0x10bd89){_0x329cff['push'](_0x329cff['shift']());}};_0x7b53f4(++_0x23abc1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index f251339..a718be1 100644 --- a/server/api/cannedAnswer/index.js +++ b/server/api/cannedAnswer/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc87=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util','path','Router','../../components/auth/service'];(function(_0x5c56ef,_0x32b007){var _0x5f03ca=function(_0x44ce5c){while(--_0x44ce5c){_0x5c56ef['push'](_0x5c56ef['shift']());}};_0x5f03ca(++_0x32b007);}(_0xbc87,0x199));var _0x7bc8=function(_0x109e39,_0x27f91c){_0x109e39=_0x109e39-0x0;var _0x3b142f=_0xbc87[_0x109e39];return _0x3b142f;};'use strict';var multer=require(_0x7bc8('0x0'));var util=require(_0x7bc8('0x1'));var path=require(_0x7bc8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7bc8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7bc8('0x4'));var interaction=require(_0x7bc8('0x5'));var config=require(_0x7bc8('0x6'));var controller=require(_0x7bc8('0x7'));router[_0x7bc8('0x8')]('/',auth[_0x7bc8('0x9')](),controller[_0x7bc8('0xa')]);router[_0x7bc8('0x8')](_0x7bc8('0xb'),auth[_0x7bc8('0x9')](),controller['show']);router[_0x7bc8('0xc')]('/',auth[_0x7bc8('0x9')](),controller[_0x7bc8('0xd')]);router[_0x7bc8('0xe')](_0x7bc8('0xb'),auth[_0x7bc8('0x9')](),controller[_0x7bc8('0xf')]);router[_0x7bc8('0x10')](_0x7bc8('0xb'),auth[_0x7bc8('0x9')](),controller[_0x7bc8('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8076=['get','isAuthenticated','show','post','put','/:id','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8076,0x169));var _0x6807=function(_0x90f7ae,_0x3d4ecf){_0x90f7ae=_0x90f7ae-0x0;var _0xfb7e10=_0x8076[_0x90f7ae];return _0xfb7e10;};'use strict';var multer=require(_0x6807('0x0'));var util=require(_0x6807('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6807('0x2')]();var fs_extra=require(_0x6807('0x3'));var auth=require(_0x6807('0x4'));var interaction=require(_0x6807('0x5'));var config=require('../../config/environment');var controller=require(_0x6807('0x6'));router[_0x6807('0x7')]('/',auth[_0x6807('0x8')](),controller['index']);router[_0x6807('0x7')]('/:id',auth[_0x6807('0x8')](),controller[_0x6807('0x9')]);router[_0x6807('0xa')]('/',auth[_0x6807('0x8')](),controller['create']);router[_0x6807('0xb')](_0x6807('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x6807('0xd')](_0x6807('0xc'),auth['isAuthenticated'](),controller[_0x6807('0xe')]);module[_0x6807('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index ad26407..217e426 100644 --- a/server/api/cdr/cdr.attributes.js +++ b/server/api/cdr/cdr.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3095=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x43b0d5,_0x499afb){var _0x25909e=function(_0x44b792){while(--_0x44b792){_0x43b0d5['push'](_0x43b0d5['shift']());}};_0x25909e(++_0x499afb);}(_0x3095,0x158));var _0x5309=function(_0x476031,_0x41aef3){_0x476031=_0x476031-0x0;var _0x4950fb=_0x3095[_0x476031];return _0x4950fb;};'use strict';var Sequelize=require(_0x5309('0x0'));module[_0x5309('0x1')]={'calldate':{'type':Sequelize[_0x5309('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x5309('0x3')]},'dst':{'type':Sequelize[_0x5309('0x3')]},'dcontext':{'type':Sequelize[_0x5309('0x3')]},'channel':{'type':Sequelize[_0x5309('0x3')]},'dstchannel':{'type':Sequelize[_0x5309('0x3')]},'lastapp':{'type':Sequelize[_0x5309('0x3')]},'lastdata':{'type':Sequelize[_0x5309('0x3')]},'duration':{'type':Sequelize[_0x5309('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5309('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5309('0x3')]},'amaflags':{'type':Sequelize[_0x5309('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5309('0x3')]},'userfield':{'type':Sequelize[_0x5309('0x3')]},'uniqueid':{'type':Sequelize[_0x5309('0x3')]},'linkedid':{'type':Sequelize[_0x5309('0x3')]},'sequence':{'type':Sequelize[_0x5309('0x3')]},'peeraccount':{'type':Sequelize[_0x5309('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x5309('0x3')]}}; \ No newline at end of file +var _0x851d=['sequelize','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x1df45d,_0x1a446d){var _0x512f7c=function(_0xbf46f3){while(--_0xbf46f3){_0x1df45d['push'](_0x1df45d['shift']());}};_0x512f7c(++_0x1a446d);}(_0x851d,0x69));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd851('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xd851('0x1')],'allowNull':![],'defaultValue':_0xd851('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xd851('0x3')]},'dst':{'type':Sequelize[_0xd851('0x3')]},'dcontext':{'type':Sequelize[_0xd851('0x3')]},'channel':{'type':Sequelize[_0xd851('0x3')]},'dstchannel':{'type':Sequelize[_0xd851('0x3')]},'lastapp':{'type':Sequelize[_0xd851('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd851('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd851('0x3')]},'amaflags':{'type':Sequelize[_0xd851('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd851('0x3')]},'userfield':{'type':Sequelize[_0xd851('0x3')]},'uniqueid':{'type':Sequelize[_0xd851('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xd851('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd851('0x3')]},'tag':{'type':Sequelize[_0xd851('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 836e26f..61c305e 100644 --- a/server/api/cdr/cdr.controller.js +++ b/server/api/cdr/cdr.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c17=['apply','reject','save','update','destroy','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','options','then','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json'];(function(_0x2bd693,_0x436100){var _0x125b5a=function(_0x1a587b){while(--_0x1a587b){_0x2bd693['push'](_0x2bd693['shift']());}};_0x125b5a(++_0x436100);}(_0x3c17,0x1a1));var _0x73c1=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x3c17[_0x139a3c];return _0x2b375b;};'use strict';var emlformat=require(_0x73c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x73c1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x73c1('0x2'));var moment=require(_0x73c1('0x3'));var BPromise=require(_0x73c1('0x4'));var Mustache=require('mustache');var util=require(_0x73c1('0x5'));var path=require(_0x73c1('0x6'));var sox=require(_0x73c1('0x7'));var csv=require(_0x73c1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73c1('0x9'));var _=require('lodash');var squel=require(_0x73c1('0xa'));var crypto=require(_0x73c1('0xb'));var jsforce=require(_0x73c1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x73c1('0xd'));var Papa=require(_0x73c1('0xe'));var Redis=require(_0x73c1('0xf'));var authService=require(_0x73c1('0x10'));var qs=require(_0x73c1('0x11'));var as=require(_0x73c1('0x12'));var hardwareService=require(_0x73c1('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x73c1('0x14'));var config=require(_0x73c1('0x15'));var licenseUtil=require(_0x73c1('0x16'));var db=require(_0x73c1('0x17'))['db'];function respondWithStatusCode(_0x592a6a,_0x2b77bc){_0x2b77bc=_0x2b77bc||0xcc;return function(_0x5e6b55){if(_0x5e6b55){return _0x592a6a[_0x73c1('0x18')](_0x2b77bc);}return _0x592a6a['status'](_0x2b77bc)[_0x73c1('0x19')]();};}function respondWithResult(_0x3ecf5a,_0x57cb11){_0x57cb11=_0x57cb11||0xc8;return function(_0x537965){if(_0x537965){return _0x3ecf5a[_0x73c1('0x1a')](_0x57cb11)['json'](_0x537965);}};}function respondWithFilteredResult(_0x72a36,_0x52d0ff){return function(_0xe5d5c8){if(_0xe5d5c8){var _0x47d81e=typeof _0x52d0ff[_0x73c1('0x1b')]===_0x73c1('0x1c')&&typeof _0x52d0ff[_0x73c1('0x1d')]===_0x73c1('0x1c');var _0x8c0803=_0xe5d5c8[_0x73c1('0x1e')];var _0x16deb6=_0x47d81e?0x0:_0x52d0ff[_0x73c1('0x1b')];var _0x1ce19e=_0x47d81e?_0xe5d5c8['count']:_0x52d0ff[_0x73c1('0x1b')]+_0x52d0ff[_0x73c1('0x1d')];var _0x28df60;if(_0x1ce19e>=_0x8c0803){_0x1ce19e=_0x8c0803;_0x28df60=0xc8;}else{_0x28df60=0xce;}_0x72a36[_0x73c1('0x1a')](_0x28df60);return _0x72a36['set'](_0x73c1('0x1f'),_0x16deb6+'-'+_0x1ce19e+'/'+_0x8c0803)[_0x73c1('0x20')](_0xe5d5c8);}return null;};}function patchUpdates(_0x344fb5){return function(_0x2e17e5){try{jsonpatch[_0x73c1('0x21')](_0x2e17e5,_0x344fb5,!![]);}catch(_0x2aa7df){return BPromise[_0x73c1('0x22')](_0x2aa7df);}return _0x2e17e5[_0x73c1('0x23')]();};}function saveUpdates(_0x49b817,_0x2eba51){return function(_0x32b379){if(_0x32b379){return _0x32b379[_0x73c1('0x24')](_0x49b817)['then'](function(_0x10254c){return _0x10254c;});}return null;};}function removeEntity(_0x2ebfda,_0x1125ff){return function(_0x3abaab){if(_0x3abaab){return _0x3abaab[_0x73c1('0x25')]()['then'](function(){_0x2ebfda[_0x73c1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54feeb,_0x2301b7){return function(_0x1c567d){if(!_0x1c567d){_0x54feeb[_0x73c1('0x18')](0x194);}return _0x1c567d;};}function handleError(_0x1c54aa,_0x123cc0){_0x123cc0=_0x123cc0||0x1f4;return function(_0x30ec73){logger[_0x73c1('0x26')](_0x30ec73[_0x73c1('0x27')]);if(_0x30ec73[_0x73c1('0x28')]){delete _0x30ec73[_0x73c1('0x28')];}_0x1c54aa[_0x73c1('0x1a')](_0x123cc0)[_0x73c1('0x29')](_0x30ec73);};}exports[_0x73c1('0x2a')]=function(_0x240137,_0x5bf2b1){var _0x2b2996={},_0x9050fd={},_0x33b5bc={'count':0x0,'rows':[]};var _0x153141=_[_0x73c1('0x2b')](db[_0x73c1('0x2c')][_0x73c1('0x2d')],function(_0x45c411){return{'name':_0x45c411[_0x73c1('0x2e')],'type':_0x45c411['type']['key']};});_0x9050fd[_0x73c1('0x2f')]=_[_0x73c1('0x2b')](_0x153141,_0x73c1('0x28'));_0x9050fd[_0x73c1('0x30')]=_['keys'](_0x240137[_0x73c1('0x30')]);_0x9050fd[_0x73c1('0x31')]=_[_0x73c1('0x32')](_0x9050fd['model'],_0x9050fd[_0x73c1('0x30')]);_0x2b2996[_0x73c1('0x33')]=_[_0x73c1('0x32')](_0x9050fd[_0x73c1('0x2f')],qs[_0x73c1('0x34')](_0x240137[_0x73c1('0x30')]['fields']));_0x2b2996[_0x73c1('0x33')]=_0x2b2996[_0x73c1('0x33')][_0x73c1('0x35')]?_0x2b2996[_0x73c1('0x33')]:_0x9050fd[_0x73c1('0x2f')];if(!_0x240137[_0x73c1('0x30')][_0x73c1('0x36')](_0x73c1('0x37'))){_0x2b2996[_0x73c1('0x1d')]=qs[_0x73c1('0x1d')](_0x240137['query'][_0x73c1('0x1d')]);_0x2b2996['offset']=qs[_0x73c1('0x1b')](_0x240137[_0x73c1('0x30')][_0x73c1('0x1b')]);}_0x2b2996[_0x73c1('0x38')]=qs['sort'](_0x240137['query']['sort']);_0x2b2996[_0x73c1('0x39')]=qs['filters'](_[_0x73c1('0x3a')](_0x240137[_0x73c1('0x30')],_0x9050fd[_0x73c1('0x31')]),_0x153141);if(_0x240137[_0x73c1('0x30')][_0x73c1('0x3b')]){_0x2b2996[_0x73c1('0x39')]=_[_0x73c1('0x3c')](_0x2b2996[_0x73c1('0x39')],{'$or':_[_0x73c1('0x2b')](_0x153141,function(_0x304c2b){if(_0x304c2b[_0x73c1('0x3d')]!=='VIRTUAL'){var _0x2bb535={};_0x2bb535[_0x304c2b[_0x73c1('0x28')]]={'$like':'%'+_0x240137[_0x73c1('0x30')][_0x73c1('0x3b')]+'%'};return _0x2bb535;}})});}_0x2b2996=_[_0x73c1('0x3c')]({},_0x2b2996,_0x240137[_0x73c1('0x3e')]);var _0x5a8c11={'where':_0x2b2996[_0x73c1('0x39')]};return db[_0x73c1('0x2c')][_0x73c1('0x1e')](_0x5a8c11)[_0x73c1('0x3f')](function(_0x21feb9){_0x33b5bc[_0x73c1('0x1e')]=_0x21feb9;if(_0x240137['query'][_0x73c1('0x40')]){_0x2b2996['include']=[{'all':!![]}];}return db[_0x73c1('0x2c')][_0x73c1('0x41')](_0x2b2996);})['then'](function(_0x57d843){_0x33b5bc[_0x73c1('0x42')]=_0x57d843;return _0x33b5bc;})[_0x73c1('0x3f')](respondWithFilteredResult(_0x5bf2b1,_0x2b2996))[_0x73c1('0x43')](handleError(_0x5bf2b1,null));};exports[_0x73c1('0x44')]=function(_0x689ca5,_0x282b73){var _0x515a52={'raw':!![],'where':{'id':_0x689ca5[_0x73c1('0x45')]['id']}},_0x5c70b9={};_0x5c70b9[_0x73c1('0x2f')]=_['keys'](db['Cdr'][_0x73c1('0x2d')]);_0x5c70b9['query']=_[_0x73c1('0x46')](_0x689ca5[_0x73c1('0x30')]);_0x5c70b9[_0x73c1('0x31')]=_[_0x73c1('0x32')](_0x5c70b9[_0x73c1('0x2f')],_0x5c70b9[_0x73c1('0x30')]);_0x515a52[_0x73c1('0x33')]=_[_0x73c1('0x32')](_0x5c70b9['model'],qs['fields'](_0x689ca5[_0x73c1('0x30')][_0x73c1('0x34')]));_0x515a52[_0x73c1('0x33')]=_0x515a52['attributes'][_0x73c1('0x35')]?_0x515a52[_0x73c1('0x33')]:_0x5c70b9[_0x73c1('0x2f')];if(_0x689ca5[_0x73c1('0x30')][_0x73c1('0x40')]){_0x515a52[_0x73c1('0x47')]=[{'all':!![]}];}_0x515a52=_[_0x73c1('0x3c')]({},_0x515a52,_0x689ca5[_0x73c1('0x3e')]);return db[_0x73c1('0x2c')][_0x73c1('0x48')](_0x515a52)[_0x73c1('0x3f')](handleEntityNotFound(_0x282b73,null))[_0x73c1('0x3f')](respondWithResult(_0x282b73,null))['catch'](handleError(_0x282b73,null));};exports[_0x73c1('0x49')]=function(_0x512295,_0x1a681c){return db[_0x73c1('0x2c')][_0x73c1('0x49')](_0x512295[_0x73c1('0x4a')],{})[_0x73c1('0x3f')](respondWithResult(_0x1a681c,0xc9))[_0x73c1('0x43')](handleError(_0x1a681c,null));};exports['update']=function(_0x34093c,_0x2ccd11){if(_0x34093c[_0x73c1('0x4a')]['id']){delete _0x34093c['body']['id'];}return db[_0x73c1('0x2c')][_0x73c1('0x48')]({'where':{'id':_0x34093c[_0x73c1('0x45')]['id']}})[_0x73c1('0x3f')](handleEntityNotFound(_0x2ccd11,null))[_0x73c1('0x3f')](saveUpdates(_0x34093c[_0x73c1('0x4a')],null))[_0x73c1('0x3f')](respondWithResult(_0x2ccd11,null))[_0x73c1('0x43')](handleError(_0x2ccd11,null));};exports[_0x73c1('0x25')]=function(_0x53d491,_0x3291db){return db['Cdr']['find']({'where':{'id':_0x53d491['params']['id']}})['then'](handleEntityNotFound(_0x3291db,null))['then'](removeEntity(_0x3291db,null))[_0x73c1('0x43')](handleError(_0x3291db,null));};exports['describe']=function(_0x3c31e8,_0x47e3ca){return db['Cdr']['describe']()[_0x73c1('0x3f')](respondWithResult(_0x47e3ca,null))['catch'](handleError(_0x47e3ca,null));}; \ No newline at end of file +var _0x8375=['attributes','intersection','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','length','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','save','destroy','then','error','stack','name','send','map','Cdr','fieldName','type','model','query','keys'];(function(_0x27c068,_0x342981){var _0xe5a67f=function(_0x20658a){while(--_0x20658a){_0x27c068['push'](_0x27c068['shift']());}};_0xe5a67f(++_0x342981);}(_0x8375,0xa8));var _0x5837=function(_0x45f5d2,_0x1d8c8a){_0x45f5d2=_0x45f5d2-0x0;var _0x20353b=_0x8375[_0x45f5d2];return _0x20353b;};'use strict';var emlformat=require(_0x5837('0x0'));var rimraf=require(_0x5837('0x1'));var zipdir=require(_0x5837('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5837('0x3'));var moment=require(_0x5837('0x4'));var BPromise=require(_0x5837('0x5'));var Mustache=require(_0x5837('0x6'));var util=require(_0x5837('0x7'));var path=require(_0x5837('0x8'));var sox=require('sox');var csv=require(_0x5837('0x9'));var ejs=require(_0x5837('0xa'));var fs=require('fs');var fs_extra=require(_0x5837('0xb'));var _=require(_0x5837('0xc'));var squel=require(_0x5837('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5837('0xe'));var toCsv=require(_0x5837('0x9'));var querystring=require('querystring');var Papa=require(_0x5837('0xf'));var Redis=require('ioredis');var authService=require(_0x5837('0x10'));var qs=require(_0x5837('0x11'));var as=require(_0x5837('0x12'));var hardwareService=require(_0x5837('0x13'));var logger=require(_0x5837('0x14'))(_0x5837('0x15'));var utils=require('../../config/utils');var config=require(_0x5837('0x16'));var licenseUtil=require(_0x5837('0x17'));var db=require(_0x5837('0x18'))['db'];function respondWithStatusCode(_0x10c1a1,_0x143210){_0x143210=_0x143210||0xcc;return function(_0x485366){if(_0x485366){return _0x10c1a1['sendStatus'](_0x143210);}return _0x10c1a1['status'](_0x143210)[_0x5837('0x19')]();};}function respondWithResult(_0x111dbf,_0x469903){_0x469903=_0x469903||0xc8;return function(_0xa5718d){if(_0xa5718d){return _0x111dbf[_0x5837('0x1a')](_0x469903)[_0x5837('0x1b')](_0xa5718d);}};}function respondWithFilteredResult(_0x206f02,_0x754f39){return function(_0x10d882){if(_0x10d882){var _0x59a378=typeof _0x754f39[_0x5837('0x1c')]===_0x5837('0x1d')&&typeof _0x754f39['limit']===_0x5837('0x1d');var _0x2297b4=_0x10d882[_0x5837('0x1e')];var _0x49279d=_0x59a378?0x0:_0x754f39['offset'];var _0x4bee08=_0x59a378?_0x10d882[_0x5837('0x1e')]:_0x754f39[_0x5837('0x1c')]+_0x754f39[_0x5837('0x1f')];var _0x58e7f7;if(_0x4bee08>=_0x2297b4){_0x4bee08=_0x2297b4;_0x58e7f7=0xc8;}else{_0x58e7f7=0xce;}_0x206f02[_0x5837('0x1a')](_0x58e7f7);return _0x206f02[_0x5837('0x20')](_0x5837('0x21'),_0x49279d+'-'+_0x4bee08+'/'+_0x2297b4)[_0x5837('0x1b')](_0x10d882);}return null;};}function patchUpdates(_0x5881ff){return function(_0x4908c2){try{jsonpatch['apply'](_0x4908c2,_0x5881ff,!![]);}catch(_0x3d352f){return BPromise['reject'](_0x3d352f);}return _0x4908c2[_0x5837('0x22')]();};}function saveUpdates(_0x2bd103,_0x32733a){return function(_0x3a7efe){if(_0x3a7efe){return _0x3a7efe['update'](_0x2bd103)['then'](function(_0x1b80db){return _0x1b80db;});}return null;};}function removeEntity(_0x2262b9,_0x406506){return function(_0x5e8089){if(_0x5e8089){return _0x5e8089[_0x5837('0x23')]()[_0x5837('0x24')](function(){_0x2262b9[_0x5837('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41f86a,_0x2646ed){return function(_0x39babd){if(!_0x39babd){_0x41f86a['sendStatus'](0x194);}return _0x39babd;};}function handleError(_0x57baed,_0x1d545c){_0x1d545c=_0x1d545c||0x1f4;return function(_0x15655e){logger[_0x5837('0x25')](_0x15655e[_0x5837('0x26')]);if(_0x15655e[_0x5837('0x27')]){delete _0x15655e[_0x5837('0x27')];}_0x57baed[_0x5837('0x1a')](_0x1d545c)[_0x5837('0x28')](_0x15655e);};}exports['index']=function(_0x2f0c8d,_0x13830f){var _0x3cbd3f={},_0x3918ee={},_0x1c9f32={'count':0x0,'rows':[]};var _0x228f1=_[_0x5837('0x29')](db[_0x5837('0x2a')]['rawAttributes'],function(_0x4f7502){return{'name':_0x4f7502[_0x5837('0x2b')],'type':_0x4f7502[_0x5837('0x2c')]['key']};});_0x3918ee[_0x5837('0x2d')]=_[_0x5837('0x29')](_0x228f1,'name');_0x3918ee[_0x5837('0x2e')]=_[_0x5837('0x2f')](_0x2f0c8d[_0x5837('0x2e')]);_0x3918ee['filters']=_['intersection'](_0x3918ee['model'],_0x3918ee[_0x5837('0x2e')]);_0x3cbd3f[_0x5837('0x30')]=_[_0x5837('0x31')](_0x3918ee[_0x5837('0x2d')],qs[_0x5837('0x32')](_0x2f0c8d['query']['fields']));_0x3cbd3f[_0x5837('0x30')]=_0x3cbd3f[_0x5837('0x30')]['length']?_0x3cbd3f['attributes']:_0x3918ee[_0x5837('0x2d')];if(!_0x2f0c8d['query']['hasOwnProperty'](_0x5837('0x33'))){_0x3cbd3f[_0x5837('0x1f')]=qs['limit'](_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x1f')]);_0x3cbd3f[_0x5837('0x1c')]=qs['offset'](_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x1c')]);}_0x3cbd3f[_0x5837('0x34')]=qs[_0x5837('0x35')](_0x2f0c8d[_0x5837('0x2e')]['sort']);_0x3cbd3f[_0x5837('0x36')]=qs['filters'](_['pick'](_0x2f0c8d[_0x5837('0x2e')],_0x3918ee[_0x5837('0x37')]),_0x228f1);if(_0x2f0c8d['query'][_0x5837('0x38')]){_0x3cbd3f[_0x5837('0x36')]=_[_0x5837('0x39')](_0x3cbd3f[_0x5837('0x36')],{'$or':_['map'](_0x228f1,function(_0x2ed688){if(_0x2ed688[_0x5837('0x2c')]!==_0x5837('0x3a')){var _0x5dcd18={};_0x5dcd18[_0x2ed688[_0x5837('0x27')]]={'$like':'%'+_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x38')]+'%'};return _0x5dcd18;}})});}_0x3cbd3f=_[_0x5837('0x39')]({},_0x3cbd3f,_0x2f0c8d[_0x5837('0x3b')]);var _0x76f00d={'where':_0x3cbd3f[_0x5837('0x36')]};return db[_0x5837('0x2a')][_0x5837('0x1e')](_0x76f00d)[_0x5837('0x24')](function(_0x1a5e2d){_0x1c9f32[_0x5837('0x1e')]=_0x1a5e2d;if(_0x2f0c8d['query']['includeAll']){_0x3cbd3f[_0x5837('0x3c')]=[{'all':!![]}];}return db[_0x5837('0x2a')]['findAll'](_0x3cbd3f);})[_0x5837('0x24')](function(_0x1ae168){_0x1c9f32[_0x5837('0x3d')]=_0x1ae168;return _0x1c9f32;})['then'](respondWithFilteredResult(_0x13830f,_0x3cbd3f))[_0x5837('0x3e')](handleError(_0x13830f,null));};exports[_0x5837('0x3f')]=function(_0x1c81ed,_0x3acdf5){var _0x4643e3={'raw':!![],'where':{'id':_0x1c81ed[_0x5837('0x40')]['id']}},_0xd443be={};_0xd443be[_0x5837('0x2d')]=_[_0x5837('0x2f')](db['Cdr'][_0x5837('0x41')]);_0xd443be[_0x5837('0x2e')]=_[_0x5837('0x2f')](_0x1c81ed['query']);_0xd443be['filters']=_[_0x5837('0x31')](_0xd443be[_0x5837('0x2d')],_0xd443be[_0x5837('0x2e')]);_0x4643e3[_0x5837('0x30')]=_[_0x5837('0x31')](_0xd443be[_0x5837('0x2d')],qs[_0x5837('0x32')](_0x1c81ed[_0x5837('0x2e')][_0x5837('0x32')]));_0x4643e3[_0x5837('0x30')]=_0x4643e3[_0x5837('0x30')][_0x5837('0x42')]?_0x4643e3['attributes']:_0xd443be[_0x5837('0x2d')];if(_0x1c81ed['query'][_0x5837('0x43')]){_0x4643e3[_0x5837('0x3c')]=[{'all':!![]}];}_0x4643e3=_['merge']({},_0x4643e3,_0x1c81ed[_0x5837('0x3b')]);return db[_0x5837('0x2a')]['find'](_0x4643e3)[_0x5837('0x24')](handleEntityNotFound(_0x3acdf5,null))[_0x5837('0x24')](respondWithResult(_0x3acdf5,null))[_0x5837('0x3e')](handleError(_0x3acdf5,null));};exports[_0x5837('0x44')]=function(_0x54a23b,_0x55cf2b){return db[_0x5837('0x2a')][_0x5837('0x44')](_0x54a23b['body'],{})['then'](respondWithResult(_0x55cf2b,0xc9))['catch'](handleError(_0x55cf2b,null));};exports['update']=function(_0x38e987,_0x6423f2){if(_0x38e987[_0x5837('0x45')]['id']){delete _0x38e987['body']['id'];}return db['Cdr'][_0x5837('0x46')]({'where':{'id':_0x38e987[_0x5837('0x40')]['id']}})[_0x5837('0x24')](handleEntityNotFound(_0x6423f2,null))[_0x5837('0x24')](saveUpdates(_0x38e987[_0x5837('0x45')],null))[_0x5837('0x24')](respondWithResult(_0x6423f2,null))[_0x5837('0x3e')](handleError(_0x6423f2,null));};exports[_0x5837('0x23')]=function(_0x27f7b9,_0x38743a){return db['Cdr'][_0x5837('0x46')]({'where':{'id':_0x27f7b9[_0x5837('0x40')]['id']}})['then'](handleEntityNotFound(_0x38743a,null))[_0x5837('0x24')](removeEntity(_0x38743a,null))[_0x5837('0x3e')](handleError(_0x38743a,null));};exports[_0x5837('0x47')]=function(_0x397cd9,_0x38e75d){return db['Cdr'][_0x5837('0x47')]()[_0x5837('0x24')](respondWithResult(_0x38e75d,null))[_0x5837('0x3e')](handleError(_0x38e75d,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 2a3aadb..4d6ab10 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x559948,_0x5d7a75){var _0x4fc8d5=function(_0x4f77aa){while(--_0x4f77aa){_0x559948['push'](_0x559948['shift']());}};_0x4fc8d5(++_0x5d7a75);}(_0x7a54,0x106));var _0x47a5=function(_0x5dbb19,_0x1b55c9){_0x5dbb19=_0x5dbb19-0x0;var _0x27f390=_0x7a54[_0x5dbb19];return _0x27f390;};'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 +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x4133f6,_0xbb2204){var _0x108375=function(_0x5d789e){while(--_0x5d789e){_0x4133f6['push'](_0x4133f6['shift']());}};_0x108375(++_0xbb2204);}(_0x7a54,0x106));var _0x47a5=function(_0x2e516e,_0x29a816){_0x2e516e=_0x2e516e-0x0;var _0x588b23=_0x7a54[_0x2e516e];return _0x588b23;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 4b4b01c..40d7952 100644 --- a/server/api/cdr/cdr.rpc.js +++ b/server/api/cdr/cdr.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce3d=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','info','request\x20sent','debug','stringify','error','code','Cdr,\x20%s,\x20%s'];(function(_0x52fd3c,_0x988fa7){var _0x69b86d=function(_0x3328ad){while(--_0x3328ad){_0x52fd3c['push'](_0x52fd3c['shift']());}};_0x69b86d(++_0x988fa7);}(_0xce3d,0x1bb));var _0xdce3=function(_0xea6c20,_0x5a0de8){_0xea6c20=_0xea6c20-0x0;var _0x458655=_0xce3d[_0xea6c20];return _0x458655;};'use strict';var _=require('lodash');var util=require(_0xdce3('0x0'));var moment=require(_0xdce3('0x1'));var BPromise=require(_0xdce3('0x2'));var rs=require(_0xdce3('0x3'));var fs=require('fs');var Redis=require(_0xdce3('0x4'));var db=require(_0xdce3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xdce3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdce3('0x7')][_0xdce3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1fe2d8,_0x6e819a,_0x4003a2){return new BPromise(function(_0x103d74,_0x914d47){return client[_0xdce3('0x9')](_0x1fe2d8,_0x4003a2)['then'](function(_0x1fe3aa){logger[_0xdce3('0xa')]('Cdr,\x20%s,\x20%s',_0x6e819a,_0xdce3('0xb'));logger[_0xdce3('0xc')]('Cdr,\x20%s,\x20%s,\x20%s',_0x6e819a,'request\x20sent',JSON[_0xdce3('0xd')](_0x1fe3aa));if(_0x1fe3aa[_0xdce3('0xe')]){if(_0x1fe3aa[_0xdce3('0xe')][_0xdce3('0xf')]===0x1f4){logger['error'](_0xdce3('0x10'),_0x6e819a,_0x1fe3aa['error'][_0xdce3('0x11')]);return _0x914d47(_0x1fe3aa[_0xdce3('0xe')][_0xdce3('0x11')]);}logger[_0xdce3('0xe')]('Cdr,\x20%s,\x20%s',_0x6e819a,_0x1fe3aa[_0xdce3('0xe')][_0xdce3('0x11')]);return _0x103d74(_0x1fe3aa[_0xdce3('0xe')][_0xdce3('0x11')]);}else{logger[_0xdce3('0xa')](_0xdce3('0x10'),_0x6e819a,_0xdce3('0xb'));_0x103d74(_0x1fe3aa[_0xdce3('0x12')][_0xdce3('0x11')]);}})[_0xdce3('0x13')](function(_0x24f658){logger[_0xdce3('0xe')](_0xdce3('0x10'),_0x6e819a,_0x24f658);_0x914d47(_0x24f658);});});} \ No newline at end of file +var _0x2863=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x309113,_0xe6e4af){var _0x48ab78=function(_0x460938){while(--_0x460938){_0x309113['push'](_0x309113['shift']());}};_0x48ab78(++_0xe6e4af);}(_0x2863,0xc5));var _0x3286=function(_0xb7ba99,_0x26ea20){_0xb7ba99=_0xb7ba99-0x0;var _0x4a0dfa=_0x2863[_0xb7ba99];return _0x4a0dfa;};'use strict';var _=require(_0x3286('0x0'));var util=require(_0x3286('0x1'));var moment=require(_0x3286('0x2'));var BPromise=require(_0x3286('0x3'));var rs=require(_0x3286('0x4'));var fs=require('fs');var Redis=require(_0x3286('0x5'));var db=require(_0x3286('0x6'))['db'];var utils=require(_0x3286('0x7'));var logger=require(_0x3286('0x8'))(_0x3286('0x9'));var config=require(_0x3286('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3286('0xb')][_0x3286('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e2a13,_0x31fbfe,_0x449f16){return new BPromise(function(_0x32b4a6,_0x25246e){return client[_0x3286('0xd')](_0x1e2a13,_0x449f16)[_0x3286('0xe')](function(_0x514b0c){logger[_0x3286('0xf')](_0x3286('0x10'),_0x31fbfe,_0x3286('0x11'));logger[_0x3286('0x12')](_0x3286('0x13'),_0x31fbfe,_0x3286('0x11'),JSON[_0x3286('0x14')](_0x514b0c));if(_0x514b0c[_0x3286('0x15')]){if(_0x514b0c[_0x3286('0x15')][_0x3286('0x16')]===0x1f4){logger['error'](_0x3286('0x10'),_0x31fbfe,_0x514b0c[_0x3286('0x15')][_0x3286('0x17')]);return _0x25246e(_0x514b0c[_0x3286('0x15')][_0x3286('0x17')]);}logger[_0x3286('0x15')](_0x3286('0x10'),_0x31fbfe,_0x514b0c['error']['message']);return _0x32b4a6(_0x514b0c['error'][_0x3286('0x17')]);}else{logger[_0x3286('0xf')]('Cdr,\x20%s,\x20%s',_0x31fbfe,_0x3286('0x11'));_0x32b4a6(_0x514b0c[_0x3286('0x18')][_0x3286('0x17')]);}})['catch'](function(_0x2f8557){logger[_0x3286('0x15')](_0x3286('0x10'),_0x31fbfe,_0x2f8557);_0x25246e(_0x2f8557);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index aa27f8b..f539b15 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x38015e,_0x1a5000){var _0x164067=function(_0x403094){while(--_0x403094){_0x38015e['push'](_0x38015e['shift']());}};_0x164067(++_0x1a5000);}(_0xb10b,0x12a));var _0xbb10=function(_0x3093fe,_0x5a0cff){_0x3093fe=_0x3093fe-0x0;var _0x31517d=_0xb10b[_0x3093fe];return _0x31517d;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x3bcb7c,_0x5af870){var _0x584411=function(_0x4b9a67){while(--_0x4b9a67){_0x3bcb7c['push'](_0x3bcb7c['shift']());}};_0x584411(++_0x5af870);}(_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('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 85a2dbd..a34c226 100644 --- a/server/api/chatApplication/chatApplication.attributes.js +++ b/server/api/chatApplication/chatApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf909=['*,*,*,*','sequelize','exports','INTEGER','noop','STRING'];(function(_0x465e16,_0x511b1f){var _0x2546c4=function(_0x49eb2f){while(--_0x49eb2f){_0x465e16['push'](_0x465e16['shift']());}};_0x2546c4(++_0x511b1f);}(_0xf909,0xc7));var _0x9f90=function(_0x276654,_0x5a16d9){_0x276654=_0x276654-0x0;var _0x3ca0b8=_0xf909[_0x276654];return _0x3ca0b8;};'use strict';var Sequelize=require(_0x9f90('0x0'));module[_0x9f90('0x1')]={'priority':{'type':Sequelize[_0x9f90('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9f90('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9f90('0x4')]},'interval':{'type':Sequelize[_0x9f90('0x4')],'defaultValue':_0x9f90('0x5')}}; \ No newline at end of file +var _0xfc18=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x2e343b,_0x865533){var _0x2f5490=function(_0x45fa91){while(--_0x45fa91){_0x2e343b['push'](_0x2e343b['shift']());}};_0x2f5490(++_0x865533);}(_0xfc18,0x90));var _0x8fc1=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xfc18[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require(_0x8fc1('0x0'));module[_0x8fc1('0x1')]={'priority':{'type':Sequelize[_0x8fc1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8fc1('0x3')],'allowNull':![],'defaultValue':_0x8fc1('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x8fc1('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index cbbc5a0..c031d05 100644 --- a/server/api/chatApplication/chatApplication.controller.js +++ b/server/api/chatApplication/chatApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x5685fc,_0x4a57c8){var _0x3a68a1=function(_0x151705){while(--_0x151705){_0x5685fc['push'](_0x5685fc['shift']());}};_0x3a68a1(++_0x4a57c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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['ChatApplication'][_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 +var _0x60e1=['stack','name','send','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','then','destroy','error'];(function(_0x5a9555,_0x5eb0c1){var _0x294298=function(_0x1b9c02){while(--_0x1b9c02){_0x5a9555['push'](_0x5a9555['shift']());}};_0x294298(++_0x5eb0c1);}(_0x60e1,0x14c));var _0x160e=function(_0x59096d,_0x5f4f59){_0x59096d=_0x59096d-0x0;var _0x40e56f=_0x60e1[_0x59096d];return _0x40e56f;};'use strict';var emlformat=require(_0x160e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x160e('0x1'));var jsonpatch=require(_0x160e('0x2'));var rp=require(_0x160e('0x3'));var moment=require(_0x160e('0x4'));var BPromise=require(_0x160e('0x5'));var Mustache=require(_0x160e('0x6'));var util=require(_0x160e('0x7'));var path=require(_0x160e('0x8'));var sox=require(_0x160e('0x9'));var csv=require(_0x160e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x160e('0xb'));var _=require('lodash');var squel=require(_0x160e('0xc'));var crypto=require(_0x160e('0xd'));var jsforce=require(_0x160e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x160e('0xa'));var querystring=require(_0x160e('0xf'));var Papa=require(_0x160e('0x10'));var Redis=require(_0x160e('0x11'));var authService=require(_0x160e('0x12'));var qs=require(_0x160e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x160e('0x14'));var logger=require(_0x160e('0x15'))(_0x160e('0x16'));var utils=require(_0x160e('0x17'));var config=require(_0x160e('0x18'));var licenseUtil=require(_0x160e('0x19'));var db=require(_0x160e('0x1a'))['db'];function respondWithStatusCode(_0x59dafa,_0x3b9da5){_0x3b9da5=_0x3b9da5||0xcc;return function(_0x3ea1f3){if(_0x3ea1f3){return _0x59dafa[_0x160e('0x1b')](_0x3b9da5);}return _0x59dafa[_0x160e('0x1c')](_0x3b9da5)['end']();};}function respondWithResult(_0x36948a,_0x1d754d){_0x1d754d=_0x1d754d||0xc8;return function(_0x3e0d93){if(_0x3e0d93){return _0x36948a[_0x160e('0x1c')](_0x1d754d)['json'](_0x3e0d93);}};}function respondWithFilteredResult(_0x4797b9,_0x5d618d){return function(_0x56a685){if(_0x56a685){var _0x302052=typeof _0x5d618d[_0x160e('0x1d')]===_0x160e('0x1e')&&typeof _0x5d618d[_0x160e('0x1f')]===_0x160e('0x1e');var _0x1ed6aa=_0x56a685['count'];var _0x37d722=_0x302052?0x0:_0x5d618d[_0x160e('0x1d')];var _0x5c7bde=_0x302052?_0x56a685[_0x160e('0x20')]:_0x5d618d[_0x160e('0x1d')]+_0x5d618d[_0x160e('0x1f')];var _0x34dbe9;if(_0x5c7bde>=_0x1ed6aa){_0x5c7bde=_0x1ed6aa;_0x34dbe9=0xc8;}else{_0x34dbe9=0xce;}_0x4797b9[_0x160e('0x1c')](_0x34dbe9);return _0x4797b9[_0x160e('0x21')]('Content-Range',_0x37d722+'-'+_0x5c7bde+'/'+_0x1ed6aa)[_0x160e('0x22')](_0x56a685);}return null;};}function patchUpdates(_0x4ca9d4){return function(_0x25ab88){try{jsonpatch[_0x160e('0x23')](_0x25ab88,_0x4ca9d4,!![]);}catch(_0x5c11fd){return BPromise[_0x160e('0x24')](_0x5c11fd);}return _0x25ab88['save']();};}function saveUpdates(_0x3e00ca,_0x4d1047){return function(_0x453266){if(_0x453266){return _0x453266['update'](_0x3e00ca)[_0x160e('0x25')](function(_0x13395b){return _0x13395b;});}return null;};}function removeEntity(_0x4ffc29,_0x280763){return function(_0x48aed9){if(_0x48aed9){return _0x48aed9[_0x160e('0x26')]()['then'](function(){_0x4ffc29[_0x160e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e8d17,_0x7dc886){return function(_0x38fcce){if(!_0x38fcce){_0x5e8d17[_0x160e('0x1b')](0x194);}return _0x38fcce;};}function handleError(_0x1a563c,_0x3e8856){_0x3e8856=_0x3e8856||0x1f4;return function(_0x34979d){logger[_0x160e('0x27')](_0x34979d[_0x160e('0x28')]);if(_0x34979d[_0x160e('0x29')]){delete _0x34979d[_0x160e('0x29')];}_0x1a563c[_0x160e('0x1c')](_0x3e8856)[_0x160e('0x2a')](_0x34979d);};}exports['show']=function(_0x57d37e,_0x4ac531){var _0x1a49a0={'raw':!![],'where':{'id':_0x57d37e[_0x160e('0x2b')]['id']}},_0x4468ec={};_0x4468ec[_0x160e('0x2c')]=_[_0x160e('0x2d')](db[_0x160e('0x2e')][_0x160e('0x2f')]);_0x4468ec[_0x160e('0x30')]=_[_0x160e('0x2d')](_0x57d37e[_0x160e('0x30')]);_0x4468ec[_0x160e('0x31')]=_[_0x160e('0x32')](_0x4468ec[_0x160e('0x2c')],_0x4468ec['query']);_0x1a49a0[_0x160e('0x33')]=_[_0x160e('0x32')](_0x4468ec[_0x160e('0x2c')],qs['fields'](_0x57d37e[_0x160e('0x30')][_0x160e('0x34')]));_0x1a49a0[_0x160e('0x33')]=_0x1a49a0[_0x160e('0x33')][_0x160e('0x35')]?_0x1a49a0[_0x160e('0x33')]:_0x4468ec['model'];if(_0x57d37e[_0x160e('0x30')][_0x160e('0x36')]){_0x1a49a0[_0x160e('0x37')]=[{'all':!![]}];}_0x1a49a0=_[_0x160e('0x38')]({},_0x1a49a0,_0x57d37e[_0x160e('0x39')]);return db['ChatApplication'][_0x160e('0x3a')](_0x1a49a0)[_0x160e('0x25')](handleEntityNotFound(_0x4ac531,null))[_0x160e('0x25')](respondWithResult(_0x4ac531,null))[_0x160e('0x3b')](handleError(_0x4ac531,null));};exports[_0x160e('0x3c')]=function(_0x196e98,_0x30854e){if(_0x196e98[_0x160e('0x3d')]['id']){delete _0x196e98[_0x160e('0x3d')]['id'];}return db[_0x160e('0x2e')][_0x160e('0x3a')]({'where':{'id':_0x196e98[_0x160e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x30854e,null))['then'](saveUpdates(_0x196e98[_0x160e('0x3d')],null))[_0x160e('0x25')](respondWithResult(_0x30854e,null))[_0x160e('0x3b')](handleError(_0x30854e,null));};exports['destroy']=function(_0x3b9728,_0xa097b5){return db['ChatApplication'][_0x160e('0x3a')]({'where':{'id':_0x3b9728[_0x160e('0x2b')]['id']}})[_0x160e('0x25')](handleEntityNotFound(_0xa097b5,null))[_0x160e('0x25')](removeEntity(_0xa097b5,null))[_0x160e('0x3b')](handleError(_0xa097b5,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 3c6af5b..4aed133 100644 --- a/server/api/chatApplication/chatApplication.model.js +++ b/server/api/chatApplication/chatApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf903=['rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','lodash','util','../../config/logger','api','request-promise','path'];(function(_0xcb6d2b,_0x1a56ac){var _0x2c3687=function(_0x1b6ed0){while(--_0x1b6ed0){_0xcb6d2b['push'](_0xcb6d2b['shift']());}};_0x2c3687(++_0x1a56ac);}(_0xf903,0x174));var _0x3f90=function(_0x2c25bc,_0x13b023){_0x2c25bc=_0x2c25bc-0x0;var _0x52408c=_0xf903[_0x2c25bc];return _0x52408c;};'use strict';var _=require(_0x3f90('0x0'));var util=require(_0x3f90('0x1'));var logger=require(_0x3f90('0x2'))(_0x3f90('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3f90('0x4'));var fs=require('fs');var path=require(_0x3f90('0x5'));var rimraf=require(_0x3f90('0x6'));var config=require(_0x3f90('0x7'));var attributes=require(_0x3f90('0x8'));module[_0x3f90('0x9')]=function(_0x1f625b,_0x2dca71){return _0x1f625b[_0x3f90('0xa')](_0x3f90('0xb'),attributes,{'tableName':_0x3f90('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3f90('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb826=['rimraf','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x252328,_0x4c22f0){var _0xaa85b7=function(_0x2623d0){while(--_0x2623d0){_0x252328['push'](_0x252328['shift']());}};_0xaa85b7(++_0x4c22f0);}(_0xb826,0x1b8));var _0x6b82=function(_0x1fb759,_0x2e03db){_0x1fb759=_0x1fb759-0x0;var _0x2600e7=_0xb826[_0x1fb759];return _0x2600e7;};'use strict';var _=require(_0x6b82('0x0'));var util=require(_0x6b82('0x1'));var logger=require(_0x6b82('0x2'))(_0x6b82('0x3'));var moment=require(_0x6b82('0x4'));var BPromise=require(_0x6b82('0x5'));var rp=require(_0x6b82('0x6'));var fs=require('fs');var path=require(_0x6b82('0x7'));var rimraf=require(_0x6b82('0x8'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0x6b82('0x9')]=function(_0x55921b,_0x2edc5d){return _0x55921b[_0x6b82('0xa')](_0x6b82('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b82('0xc'),'collate':_0x6b82('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index ab6b551..b7904d4 100644 --- a/server/api/chatApplication/chatApplication.rpc.js +++ b/server/api/chatApplication/chatApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7125=['jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5a5388,_0x2acd5d){var _0x59e707=function(_0x50aec1){while(--_0x50aec1){_0x5a5388['push'](_0x5a5388['shift']());}};_0x59e707(++_0x2acd5d);}(_0x7125,0x15f));var _0x5712=function(_0x4aabdf,_0x1694c1){_0x4aabdf=_0x4aabdf-0x0;var _0x226ab0=_0x7125[_0x4aabdf];return _0x226ab0;};'use strict';var _=require(_0x5712('0x0'));var util=require(_0x5712('0x1'));var moment=require('moment');var BPromise=require(_0x5712('0x2'));var rs=require(_0x5712('0x3'));var fs=require('fs');var Redis=require(_0x5712('0x4'));var db=require(_0x5712('0x5'))['db'];var utils=require(_0x5712('0x6'));var logger=require(_0x5712('0x7'))(_0x5712('0x8'));var config=require('../../config/environment');var jayson=require(_0x5712('0x9'));var client=jayson[_0x5712('0xa')][_0x5712('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28f42e,_0xf6642c,_0x2b1b80){return new BPromise(function(_0x588ee8,_0x3354f2){return client[_0x5712('0xc')](_0x28f42e,_0x2b1b80)[_0x5712('0xd')](function(_0x22fff2){logger[_0x5712('0xe')]('ChatApplication,\x20%s,\x20%s',_0xf6642c,_0x5712('0xf'));logger[_0x5712('0x10')](_0x5712('0x11'),_0xf6642c,_0x5712('0xf'),JSON[_0x5712('0x12')](_0x22fff2));if(_0x22fff2['error']){if(_0x22fff2[_0x5712('0x13')]['code']===0x1f4){logger[_0x5712('0x13')](_0x5712('0x14'),_0xf6642c,_0x22fff2['error'][_0x5712('0x15')]);return _0x3354f2(_0x22fff2[_0x5712('0x13')][_0x5712('0x15')]);}logger['error'](_0x5712('0x14'),_0xf6642c,_0x22fff2[_0x5712('0x13')][_0x5712('0x15')]);return _0x588ee8(_0x22fff2[_0x5712('0x13')][_0x5712('0x15')]);}else{logger[_0x5712('0xe')](_0x5712('0x14'),_0xf6642c,_0x5712('0xf'));_0x588ee8(_0x22fff2[_0x5712('0x16')][_0x5712('0x15')]);}})[_0x5712('0x17')](function(_0x50ea61){logger['error']('ChatApplication,\x20%s,\x20%s',_0xf6642c,_0x50ea61);_0x3354f2(_0x50ea61);});});} \ No newline at end of file +var _0x70cb=['result','catch','lodash','util','moment','bluebird','../../config/utils','rpc','jayson/promise','client','http','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x32f099,_0x8e8c68){var _0x4d010a=function(_0x4c4d13){while(--_0x4c4d13){_0x32f099['push'](_0x32f099['shift']());}};_0x4d010a(++_0x8e8c68);}(_0x70cb,0x16b));var _0xb70c=function(_0x2d0669,_0xfd69a1){_0x2d0669=_0x2d0669-0x0;var _0x2b7d1a=_0x70cb[_0x2d0669];return _0x2b7d1a;};'use strict';var _=require(_0xb70c('0x0'));var util=require(_0xb70c('0x1'));var moment=require(_0xb70c('0x2'));var BPromise=require(_0xb70c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb70c('0x4'));var logger=require('../../config/logger')(_0xb70c('0x5'));var config=require('../../config/environment');var jayson=require(_0xb70c('0x6'));var client=jayson[_0xb70c('0x7')][_0xb70c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x229957,_0x327a3e,_0x1879bd){return new BPromise(function(_0x3137b6,_0x2b2bf9){return client['request'](_0x229957,_0x1879bd)['then'](function(_0x2a6eac){logger['info'](_0xb70c('0x9'),_0x327a3e,_0xb70c('0xa'));logger[_0xb70c('0xb')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x327a3e,_0xb70c('0xa'),JSON[_0xb70c('0xc')](_0x2a6eac));if(_0x2a6eac[_0xb70c('0xd')]){if(_0x2a6eac['error'][_0xb70c('0xe')]===0x1f4){logger[_0xb70c('0xd')](_0xb70c('0x9'),_0x327a3e,_0x2a6eac[_0xb70c('0xd')][_0xb70c('0xf')]);return _0x2b2bf9(_0x2a6eac['error'][_0xb70c('0xf')]);}logger[_0xb70c('0xd')](_0xb70c('0x9'),_0x327a3e,_0x2a6eac[_0xb70c('0xd')]['message']);return _0x3137b6(_0x2a6eac['error']['message']);}else{logger[_0xb70c('0x10')](_0xb70c('0x9'),_0x327a3e,_0xb70c('0xa'));_0x3137b6(_0x2a6eac[_0xb70c('0x11')][_0xb70c('0xf')]);}})[_0xb70c('0x12')](function(_0x1daabb){logger[_0xb70c('0xd')](_0xb70c('0x9'),_0x327a3e,_0x1daabb);_0x2b2bf9(_0x1daabb);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 9b574b8..4c63380 100644 --- a/server/api/chatApplication/index.js +++ b/server/api/chatApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2493=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','multer','path'];(function(_0x46ff82,_0x59d48c){var _0x262d95=function(_0xec0f3f){while(--_0xec0f3f){_0x46ff82['push'](_0x46ff82['shift']());}};_0x262d95(++_0x59d48c);}(_0x2493,0x14e));var _0x3249=function(_0x5b92f6,_0x383c5d){_0x5b92f6=_0x5b92f6-0x0;var _0x5d6d66=_0x2493[_0x5b92f6];return _0x5d6d66;};'use strict';var multer=require(_0x3249('0x0'));var util=require('util');var path=require(_0x3249('0x1'));var timeout=require(_0x3249('0x2'));var express=require(_0x3249('0x3'));var router=express[_0x3249('0x4')]();var fs_extra=require(_0x3249('0x5'));var auth=require(_0x3249('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3249('0x7'));router[_0x3249('0x8')](_0x3249('0x9'),auth[_0x3249('0xa')](),controller[_0x3249('0xb')]);router[_0x3249('0xc')](_0x3249('0x9'),auth[_0x3249('0xa')](),controller[_0x3249('0xd')]);router[_0x3249('0xe')](_0x3249('0x9'),auth[_0x3249('0xa')](),controller[_0x3249('0xf')]);module['exports']=router; \ No newline at end of file +var _0xd268=['show','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0x3dbf0a,_0x54530a){var _0x4ec977=function(_0x3b2251){while(--_0x3b2251){_0x3dbf0a['push'](_0x3dbf0a['shift']());}};_0x4ec977(++_0x54530a);}(_0xd268,0x1e1));var _0x8d26=function(_0x16847a,_0xb61ec){_0x16847a=_0x16847a-0x0;var _0x18dd33=_0xd268[_0x16847a];return _0x18dd33;};'use strict';var multer=require(_0x8d26('0x0'));var util=require(_0x8d26('0x1'));var path=require(_0x8d26('0x2'));var timeout=require('connect-timeout');var express=require(_0x8d26('0x3'));var router=express[_0x8d26('0x4')]();var fs_extra=require(_0x8d26('0x5'));var auth=require(_0x8d26('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8d26('0x7'));var controller=require(_0x8d26('0x8'));router[_0x8d26('0x9')](_0x8d26('0xa'),auth[_0x8d26('0xb')](),controller[_0x8d26('0xc')]);router[_0x8d26('0xd')](_0x8d26('0xa'),auth['isAuthenticated'](),controller[_0x8d26('0xe')]);router[_0x8d26('0xf')]('/:id',auth[_0x8d26('0xb')](),controller[_0x8d26('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index c9dcc7d..1d4832d 100644 --- a/server/api/chatGroup/chatGroup.attributes.js +++ b/server/api/chatGroup/chatGroup.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48f5=['sequelize','exports','STRING','BOOLEAN'];(function(_0x118c0f,_0x1d196f){var _0xa6cd15=function(_0x62c53a){while(--_0x62c53a){_0x118c0f['push'](_0x118c0f['shift']());}};_0xa6cd15(++_0x1d196f);}(_0x48f5,0x68));var _0x548f=function(_0x408e4f,_0x2da1ac){_0x408e4f=_0x408e4f-0x0;var _0x3b49a0=_0x48f5[_0x408e4f];return _0x3b49a0;};'use strict';var Sequelize=require(_0x548f('0x0'));module[_0x548f('0x1')]={'name':{'type':Sequelize[_0x548f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x548f('0x2')]},'write':{'type':Sequelize[_0x548f('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5d59=['exports','STRING','BOOLEAN'];(function(_0x3d125f,_0x579fa8){var _0x4123d0=function(_0x3665c6){while(--_0x3665c6){_0x3d125f['push'](_0x3d125f['shift']());}};_0x4123d0(++_0x579fa8);}(_0x5d59,0x15f));var _0x95d5=function(_0x3c0c96,_0x449674){_0x3c0c96=_0x3c0c96-0x0;var _0x1780ec=_0x5d59[_0x3c0c96];return _0x1780ec;};'use strict';var Sequelize=require('sequelize');module[_0x95d5('0x0')]={'name':{'type':Sequelize[_0x95d5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x95d5('0x1')]},'write':{'type':Sequelize[_0x95d5('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 94d86c7..029fc2b 100644 --- a/server/api/chatGroup/chatGroup.controller.js +++ b/server/api/chatGroup/chatGroup.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2fc=['key','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ChatGroup','includeAll','rows','catch','show','include','options','find','body','params','describe','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','create','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','end','error','name','send','map','rawAttributes','fieldName','type'];(function(_0x6bb0a0,_0x468b8f){var _0x19dbc5=function(_0x28bbbb){while(--_0x28bbbb){_0x6bb0a0['push'](_0x6bb0a0['shift']());}};_0x19dbc5(++_0x468b8f);}(_0xd2fc,0x198));var _0xcd2f=function(_0x20b103,_0xe86d0c){_0x20b103=_0x20b103-0x0;var _0x2de2c2=_0xd2fc[_0x20b103];return _0x2de2c2;};'use strict';var emlformat=require(_0xcd2f('0x0'));var rimraf=require(_0xcd2f('0x1'));var zipdir=require(_0xcd2f('0x2'));var jsonpatch=require(_0xcd2f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcd2f('0x4'));var Mustache=require(_0xcd2f('0x5'));var util=require(_0xcd2f('0x6'));var path=require(_0xcd2f('0x7'));var sox=require('sox');var csv=require(_0xcd2f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd2f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcd2f('0xa'));var deskjs=require(_0xcd2f('0xb'));var toCsv=require(_0xcd2f('0x8'));var querystring=require(_0xcd2f('0xc'));var Papa=require(_0xcd2f('0xd'));var Redis=require(_0xcd2f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xcd2f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcd2f('0x10'));var logger=require(_0xcd2f('0x11'))(_0xcd2f('0x12'));var utils=require(_0xcd2f('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xcd2f('0x14')]=_[_0xcd2f('0x15')](config[_0xcd2f('0x14')],{'host':_0xcd2f('0x16'),'port':0x18eb});var socket=require(_0xcd2f('0x17'))(new Redis(config[_0xcd2f('0x14')]));require('./chatGroup.socket')[_0xcd2f('0x18')](socket);function respondWithStatusCode(_0x3bb21d,_0x5f26b6){_0x5f26b6=_0x5f26b6||0xcc;return function(_0x127bdb){if(_0x127bdb){return _0x3bb21d[_0xcd2f('0x19')](_0x5f26b6);}return _0x3bb21d[_0xcd2f('0x1a')](_0x5f26b6)['end']();};}function respondWithResult(_0x128b2a,_0xbb727b){_0xbb727b=_0xbb727b||0xc8;return function(_0x22b3ff){if(_0x22b3ff){return _0x128b2a['status'](_0xbb727b)[_0xcd2f('0x1b')](_0x22b3ff);}};}function respondWithFilteredResult(_0x40e8fb,_0x14a818){return function(_0x229ee2){if(_0x229ee2){var _0x625472=typeof _0x14a818[_0xcd2f('0x1c')]===_0xcd2f('0x1d')&&typeof _0x14a818[_0xcd2f('0x1e')]==='undefined';var _0x203e5c=_0x229ee2['count'];var _0x2323a5=_0x625472?0x0:_0x14a818[_0xcd2f('0x1c')];var _0x25089e=_0x625472?_0x229ee2[_0xcd2f('0x1f')]:_0x14a818[_0xcd2f('0x1c')]+_0x14a818[_0xcd2f('0x1e')];var _0x1c10e4;if(_0x25089e>=_0x203e5c){_0x25089e=_0x203e5c;_0x1c10e4=0xc8;}else{_0x1c10e4=0xce;}_0x40e8fb[_0xcd2f('0x1a')](_0x1c10e4);return _0x40e8fb[_0xcd2f('0x20')](_0xcd2f('0x21'),_0x2323a5+'-'+_0x25089e+'/'+_0x203e5c)[_0xcd2f('0x1b')](_0x229ee2);}return null;};}function patchUpdates(_0x4d617c){return function(_0x102011){try{jsonpatch[_0xcd2f('0x22')](_0x102011,_0x4d617c,!![]);}catch(_0x347765){return BPromise['reject'](_0x347765);}return _0x102011[_0xcd2f('0x23')]();};}function saveUpdates(_0x4d9eda,_0xb3afde){return function(_0x228c2d){if(_0x228c2d){return _0x228c2d[_0xcd2f('0x24')](_0x4d9eda)['then'](function(_0x928d2){return _0x928d2;});}return null;};}function removeEntity(_0x23ff12,_0x2124f2){return function(_0x2fc21d){if(_0x2fc21d){return _0x2fc21d[_0xcd2f('0x25')]()[_0xcd2f('0x26')](function(){_0x23ff12['status'](0xcc)[_0xcd2f('0x27')]();});}};}function handleEntityNotFound(_0x4c2903,_0x3ae591){return function(_0x17b3eb){if(!_0x17b3eb){_0x4c2903[_0xcd2f('0x19')](0x194);}return _0x17b3eb;};}function handleError(_0x154b0a,_0x2d4397){_0x2d4397=_0x2d4397||0x1f4;return function(_0x26dab0){logger[_0xcd2f('0x28')](_0x26dab0['stack']);if(_0x26dab0[_0xcd2f('0x29')]){delete _0x26dab0[_0xcd2f('0x29')];}_0x154b0a[_0xcd2f('0x1a')](_0x2d4397)[_0xcd2f('0x2a')](_0x26dab0);};}exports['index']=function(_0x672387,_0x5c175e){var _0x774cd2={},_0x56a857={},_0x22d9d0={'count':0x0,'rows':[]};var _0x537736=_[_0xcd2f('0x2b')](db['ChatGroup'][_0xcd2f('0x2c')],function(_0x41229c){return{'name':_0x41229c[_0xcd2f('0x2d')],'type':_0x41229c[_0xcd2f('0x2e')][_0xcd2f('0x2f')]};});_0x56a857[_0xcd2f('0x30')]=_[_0xcd2f('0x2b')](_0x537736,'name');_0x56a857['query']=_[_0xcd2f('0x31')](_0x672387['query']);_0x56a857[_0xcd2f('0x32')]=_[_0xcd2f('0x33')](_0x56a857[_0xcd2f('0x30')],_0x56a857['query']);_0x774cd2['attributes']=_[_0xcd2f('0x33')](_0x56a857[_0xcd2f('0x30')],qs[_0xcd2f('0x34')](_0x672387[_0xcd2f('0x35')][_0xcd2f('0x34')]));_0x774cd2[_0xcd2f('0x36')]=_0x774cd2[_0xcd2f('0x36')][_0xcd2f('0x37')]?_0x774cd2[_0xcd2f('0x36')]:_0x56a857[_0xcd2f('0x30')];if(!_0x672387[_0xcd2f('0x35')][_0xcd2f('0x38')](_0xcd2f('0x39'))){_0x774cd2['limit']=qs[_0xcd2f('0x1e')](_0x672387[_0xcd2f('0x35')][_0xcd2f('0x1e')]);_0x774cd2[_0xcd2f('0x1c')]=qs[_0xcd2f('0x1c')](_0x672387['query'][_0xcd2f('0x1c')]);}_0x774cd2[_0xcd2f('0x3a')]=qs[_0xcd2f('0x3b')](_0x672387['query'][_0xcd2f('0x3b')]);_0x774cd2[_0xcd2f('0x3c')]=qs[_0xcd2f('0x32')](_[_0xcd2f('0x3d')](_0x672387['query'],_0x56a857['filters']),_0x537736);if(_0x672387[_0xcd2f('0x35')][_0xcd2f('0x3e')]){_0x774cd2[_0xcd2f('0x3c')]=_[_0xcd2f('0x3f')](_0x774cd2[_0xcd2f('0x3c')],{'$or':_['map'](_0x537736,function(_0x3c3f86){if(_0x3c3f86[_0xcd2f('0x2e')]!==_0xcd2f('0x40')){var _0x1fd028={};_0x1fd028[_0x3c3f86[_0xcd2f('0x29')]]={'$like':'%'+_0x672387['query']['filter']+'%'};return _0x1fd028;}})});}_0x774cd2=_['merge']({},_0x774cd2,_0x672387['options']);var _0x1fd831={'where':_0x774cd2[_0xcd2f('0x3c')]};return db[_0xcd2f('0x41')][_0xcd2f('0x1f')](_0x1fd831)[_0xcd2f('0x26')](function(_0x44255a){_0x22d9d0['count']=_0x44255a;if(_0x672387[_0xcd2f('0x35')][_0xcd2f('0x42')]){_0x774cd2['include']=[{'all':!![]}];}return db[_0xcd2f('0x41')]['findAll'](_0x774cd2);})[_0xcd2f('0x26')](function(_0x5f5922){_0x22d9d0[_0xcd2f('0x43')]=_0x5f5922;return _0x22d9d0;})['then'](respondWithFilteredResult(_0x5c175e,_0x774cd2))[_0xcd2f('0x44')](handleError(_0x5c175e,null));};exports[_0xcd2f('0x45')]=function(_0x5a887c,_0x386694){var _0x42a2e2={'raw':!![],'where':{'id':_0x5a887c['params']['id']}},_0x222677={};_0x222677[_0xcd2f('0x30')]=_[_0xcd2f('0x31')](db[_0xcd2f('0x41')][_0xcd2f('0x2c')]);_0x222677[_0xcd2f('0x35')]=_[_0xcd2f('0x31')](_0x5a887c['query']);_0x222677[_0xcd2f('0x32')]=_[_0xcd2f('0x33')](_0x222677['model'],_0x222677['query']);_0x42a2e2[_0xcd2f('0x36')]=_['intersection'](_0x222677[_0xcd2f('0x30')],qs[_0xcd2f('0x34')](_0x5a887c[_0xcd2f('0x35')]['fields']));_0x42a2e2['attributes']=_0x42a2e2[_0xcd2f('0x36')][_0xcd2f('0x37')]?_0x42a2e2[_0xcd2f('0x36')]:_0x222677['model'];if(_0x5a887c[_0xcd2f('0x35')][_0xcd2f('0x42')]){_0x42a2e2[_0xcd2f('0x46')]=[{'all':!![]}];}_0x42a2e2=_[_0xcd2f('0x3f')]({},_0x42a2e2,_0x5a887c[_0xcd2f('0x47')]);return db[_0xcd2f('0x41')][_0xcd2f('0x48')](_0x42a2e2)[_0xcd2f('0x26')](handleEntityNotFound(_0x386694,null))[_0xcd2f('0x26')](respondWithResult(_0x386694,null))[_0xcd2f('0x44')](handleError(_0x386694,null));};exports['create']=function(_0x3b7797,_0x195666){return db[_0xcd2f('0x41')]['create'](_0x3b7797['body'],{})[_0xcd2f('0x26')](respondWithResult(_0x195666,0xc9))[_0xcd2f('0x44')](handleError(_0x195666,null));};exports['update']=function(_0x13fda7,_0x428c47){if(_0x13fda7[_0xcd2f('0x49')]['id']){delete _0x13fda7['body']['id'];}return db['ChatGroup'][_0xcd2f('0x48')]({'where':{'id':_0x13fda7[_0xcd2f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x428c47,null))[_0xcd2f('0x26')](saveUpdates(_0x13fda7['body'],null))[_0xcd2f('0x26')](respondWithResult(_0x428c47,null))['catch'](handleError(_0x428c47,null));};exports[_0xcd2f('0x25')]=function(_0x1163a8,_0x252e59){return db[_0xcd2f('0x41')]['find']({'where':{'id':_0x1163a8[_0xcd2f('0x4a')]['id']}})[_0xcd2f('0x26')](handleEntityNotFound(_0x252e59,null))[_0xcd2f('0x26')](removeEntity(_0x252e59,null))[_0xcd2f('0x44')](handleError(_0x252e59,null));};exports[_0xcd2f('0x4b')]=function(_0x265106,_0x4e32e9){return db['ChatGroup'][_0xcd2f('0x4b')]()['then'](respondWithResult(_0x4e32e9,null))[_0xcd2f('0x44')](handleError(_0x4e32e9,null));};exports['getUnread']=function(_0x4c820c,_0x2d2ca6,_0x443940){return db[_0xcd2f('0x4c')][_0xcd2f('0x1f')]({'where':{'ChatGroupId':_0x4c820c[_0xcd2f('0x4a')]['id'],'ToId':_0x4c820c[_0xcd2f('0x4d')]['id'],'read':![]}})[_0xcd2f('0x26')](function(_0x566ea3){return{'id':_['toInteger'](_0x4c820c[_0xcd2f('0x4a')]['id']),'count':_0x566ea3};})['then'](respondWithResult(_0x2d2ca6,null))[_0xcd2f('0x44')](handleError(_0x2d2ca6,null));};exports[_0xcd2f('0x4e')]=function(_0x19ad2b,_0x1a451b,_0x71f741){return db['ChatGroup']['find']({'where':{'id':_0x19ad2b[_0xcd2f('0x4a')]['id']}})[_0xcd2f('0x26')](handleEntityNotFound(_0x1a451b,null))['then'](function(_0x1a0231){if(_0x1a0231){return _0x1a0231[_0xcd2f('0x4e')](_0x19ad2b['body'][_0xcd2f('0x4f')],_[_0xcd2f('0x50')](_0x19ad2b[_0xcd2f('0x49')],[_0xcd2f('0x4f'),'id'])||{});}})[_0xcd2f('0x26')](respondWithResult(_0x1a451b,null))[_0xcd2f('0x44')](handleError(_0x1a451b,null));};exports[_0xcd2f('0x51')]=function(_0x4cd25d,_0x5c7ef1,_0x4f5798){var _0xb36b0b={};var _0x2bbec9={};var _0x313f42;var _0x279965;return db['ChatGroup'][_0xcd2f('0x52')]({'where':{'id':_0x4cd25d[_0xcd2f('0x4a')]['id']}})[_0xcd2f('0x26')](handleEntityNotFound(_0x5c7ef1,null))[_0xcd2f('0x26')](function(_0xa0751c){if(_0xa0751c){_0x313f42=_0xa0751c;_0x2bbec9[_0xcd2f('0x30')]=_[_0xcd2f('0x31')](db[_0xcd2f('0x53')][_0xcd2f('0x2c')]);_0x2bbec9[_0xcd2f('0x35')]=_[_0xcd2f('0x31')](_0x4cd25d[_0xcd2f('0x35')]);_0x2bbec9[_0xcd2f('0x32')]=_[_0xcd2f('0x33')](_0x2bbec9['model'],_0x2bbec9[_0xcd2f('0x35')]);_0xb36b0b[_0xcd2f('0x36')]=_[_0xcd2f('0x33')](_0x2bbec9[_0xcd2f('0x30')],qs['fields'](_0x4cd25d[_0xcd2f('0x35')]['fields']));_0xb36b0b[_0xcd2f('0x36')]=_0xb36b0b[_0xcd2f('0x36')][_0xcd2f('0x37')]?_0xb36b0b[_0xcd2f('0x36')]:_0x2bbec9[_0xcd2f('0x30')];_0xb36b0b[_0xcd2f('0x3a')]=qs[_0xcd2f('0x3b')](_0x4cd25d[_0xcd2f('0x35')][_0xcd2f('0x3b')]);_0xb36b0b[_0xcd2f('0x3c')]=qs[_0xcd2f('0x32')](_[_0xcd2f('0x3d')](_0x4cd25d['query'],_0x2bbec9[_0xcd2f('0x32')]));if(_0x4cd25d[_0xcd2f('0x35')][_0xcd2f('0x3e')]){_0xb36b0b['where']=_[_0xcd2f('0x3f')](_0xb36b0b[_0xcd2f('0x3c')],{'$or':_[_0xcd2f('0x2b')](_0xb36b0b[_0xcd2f('0x36')],function(_0x394015){var _0x29fbff={};_0x29fbff[_0x394015]={'$like':'%'+_0x4cd25d[_0xcd2f('0x35')][_0xcd2f('0x3e')]+'%'};return _0x29fbff;})});}_0xb36b0b=_['merge']({},_0xb36b0b,_0x4cd25d['options']);return _0x313f42[_0xcd2f('0x51')](_0xb36b0b);}})[_0xcd2f('0x26')](function(_0x44deb7){if(_0x44deb7){_0x279965=_0x44deb7['length'];if(!_0x4cd25d[_0xcd2f('0x35')][_0xcd2f('0x38')]('nolimit')){_0xb36b0b[_0xcd2f('0x1e')]=qs[_0xcd2f('0x1e')](_0x4cd25d['query'][_0xcd2f('0x1e')]);_0xb36b0b[_0xcd2f('0x1c')]=qs['offset'](_0x4cd25d['query'][_0xcd2f('0x1c')]);}return _0x313f42[_0xcd2f('0x51')](_0xb36b0b);}})[_0xcd2f('0x26')](function(_0x172617){if(_0x172617){return _0x172617?{'count':_0x279965,'rows':_0x172617}:null;}})[_0xcd2f('0x26')](respondWithResult(_0x5c7ef1,null))[_0xcd2f('0x44')](handleError(_0x5c7ef1,null));};exports[_0xcd2f('0x54')]=function(_0x5f4d12,_0x24c342,_0x17425b){return db['ChatGroup'][_0xcd2f('0x48')]({'where':{'id':_0x5f4d12[_0xcd2f('0x4a')]['id']}})[_0xcd2f('0x26')](handleEntityNotFound(_0x24c342,null))['then'](function(_0x40df4a){if(_0x40df4a){return _0x40df4a[_0xcd2f('0x54')](_0x5f4d12['query'][_0xcd2f('0x4f')]);}})[_0xcd2f('0x26')](respondWithStatusCode(_0x24c342,null))[_0xcd2f('0x44')](handleError(_0x24c342,null));};exports[_0xcd2f('0x55')]=function(_0x2f73a4,_0xe413c1,_0x2aade0){if(_0x2f73a4[_0xcd2f('0x49')]['id']){delete _0x2f73a4[_0xcd2f('0x49')]['id'];}return db[_0xcd2f('0x41')][_0xcd2f('0x48')]({'where':{'id':_0x2f73a4[_0xcd2f('0x4a')]['id']}})[_0xcd2f('0x26')](handleEntityNotFound(_0xe413c1,null))[_0xcd2f('0x26')](function(_0x39bcaf){if(_0x39bcaf){_0x2f73a4[_0xcd2f('0x49')][_0xcd2f('0x56')]=_0x39bcaf['id'];return db['ChatInternalMessage'][_0xcd2f('0x57')](_0x2f73a4[_0xcd2f('0x49')]);}})[_0xcd2f('0x26')](respondWithResult(_0xe413c1,null))['catch'](handleError(_0xe413c1,null));};exports[_0xcd2f('0x58')]=function(_0x215af2,_0x21a282,_0x9e38b4){var _0x28f4a3={};var _0x1f2625={};var _0x287a3a;var _0x4af001;return db['ChatGroup'][_0xcd2f('0x52')]({'where':{'id':_0x215af2[_0xcd2f('0x4a')]['id']}})[_0xcd2f('0x26')](handleEntityNotFound(_0x21a282,null))[_0xcd2f('0x26')](function(_0x42d791){if(_0x42d791){_0x287a3a=_0x42d791;_0x1f2625[_0xcd2f('0x30')]=_['keys'](db[_0xcd2f('0x4c')][_0xcd2f('0x2c')]);_0x1f2625[_0xcd2f('0x35')]=_[_0xcd2f('0x31')](_0x215af2[_0xcd2f('0x35')]);_0x1f2625[_0xcd2f('0x32')]=_[_0xcd2f('0x33')](_0x1f2625[_0xcd2f('0x30')],_0x1f2625[_0xcd2f('0x35')]);_0x28f4a3[_0xcd2f('0x36')]=_[_0xcd2f('0x33')](_0x1f2625[_0xcd2f('0x30')],qs[_0xcd2f('0x34')](_0x215af2[_0xcd2f('0x35')][_0xcd2f('0x34')]));_0x28f4a3[_0xcd2f('0x36')]=_0x28f4a3['attributes'][_0xcd2f('0x37')]?_0x28f4a3[_0xcd2f('0x36')]:_0x1f2625[_0xcd2f('0x30')];_0x28f4a3['order']=qs[_0xcd2f('0x3b')](_0x215af2[_0xcd2f('0x35')][_0xcd2f('0x3b')]);_0x28f4a3[_0xcd2f('0x3c')]=qs[_0xcd2f('0x32')](_['pick'](_0x215af2[_0xcd2f('0x35')],_0x1f2625['filters']));if(_0x215af2[_0xcd2f('0x35')]['filter']){_0x28f4a3[_0xcd2f('0x3c')]=_[_0xcd2f('0x3f')](_0x28f4a3[_0xcd2f('0x3c')],{'$or':_[_0xcd2f('0x2b')](_0x28f4a3[_0xcd2f('0x36')],function(_0x210e37){var _0x11ac69={};_0x11ac69[_0x210e37]={'$like':'%'+_0x215af2[_0xcd2f('0x35')][_0xcd2f('0x3e')]+'%'};return _0x11ac69;})});}if(_0x215af2[_0xcd2f('0x35')][_0xcd2f('0x59')]){var _0x564b94=_0x215af2[_0xcd2f('0x35')][_0xcd2f('0x59')]['split'](',');var _0x86aa6d={};_0x86aa6d[_0x564b94[0x0]]={'$gte':moment(_0x564b94[0x1])['format'](_0xcd2f('0x5a'))};_0x28f4a3[_0xcd2f('0x3c')]=_[_0xcd2f('0x3f')](_0x28f4a3[_0xcd2f('0x3c')],_0x86aa6d);}_0x28f4a3=_['merge']({},_0x28f4a3,_0x215af2[_0xcd2f('0x47')]);return _0x287a3a['getMessages'](_0x28f4a3);}})['then'](function(_0xef6399){if(_0xef6399){_0x4af001=_0xef6399[_0xcd2f('0x37')];if(!_0x215af2['query']['hasOwnProperty'](_0xcd2f('0x39'))){_0x28f4a3[_0xcd2f('0x1e')]=qs[_0xcd2f('0x1e')](_0x215af2[_0xcd2f('0x35')][_0xcd2f('0x1e')]);_0x28f4a3[_0xcd2f('0x1c')]=qs[_0xcd2f('0x1c')](_0x215af2[_0xcd2f('0x35')]['offset']);}return _0x287a3a[_0xcd2f('0x58')](_0x28f4a3);}})['then'](function(_0x3a69f8){if(_0x3a69f8){return _0x3a69f8?{'count':_0x4af001,'rows':_0x3a69f8}:null;}})['then'](respondWithResult(_0x21a282,null))['catch'](handleError(_0x21a282,null));}; \ No newline at end of file +var _0xd654=['fields','length','find','create','body','catch','params','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','order','pick','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd654,0x154));var _0x4d65=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd654[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x4d65('0x0'));var rimraf=require(_0x4d65('0x1'));var zipdir=require(_0x4d65('0x2'));var jsonpatch=require(_0x4d65('0x3'));var rp=require(_0x4d65('0x4'));var moment=require(_0x4d65('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4d65('0x6'));var util=require(_0x4d65('0x7'));var path=require(_0x4d65('0x8'));var sox=require(_0x4d65('0x9'));var csv=require(_0x4d65('0xa'));var ejs=require(_0x4d65('0xb'));var fs=require('fs');var fs_extra=require(_0x4d65('0xc'));var _=require(_0x4d65('0xd'));var squel=require(_0x4d65('0xe'));var crypto=require(_0x4d65('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x4d65('0x10'));var toCsv=require(_0x4d65('0xa'));var querystring=require(_0x4d65('0x11'));var Papa=require(_0x4d65('0x12'));var Redis=require('ioredis');var authService=require(_0x4d65('0x13'));var qs=require(_0x4d65('0x14'));var as=require(_0x4d65('0x15'));var hardwareService=require(_0x4d65('0x16'));var logger=require(_0x4d65('0x17'))(_0x4d65('0x18'));var utils=require(_0x4d65('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x4d65('0x1a'));var db=require(_0x4d65('0x1b'))['db'];config[_0x4d65('0x1c')]=_[_0x4d65('0x1d')](config[_0x4d65('0x1c')],{'host':_0x4d65('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d65('0x1c')]));require(_0x4d65('0x1f'))[_0x4d65('0x20')](socket);function respondWithStatusCode(_0x2be655,_0x3e1234){_0x3e1234=_0x3e1234||0xcc;return function(_0x4d05bd){if(_0x4d05bd){return _0x2be655[_0x4d65('0x21')](_0x3e1234);}return _0x2be655[_0x4d65('0x22')](_0x3e1234)[_0x4d65('0x23')]();};}function respondWithResult(_0x461e03,_0x496ffa){_0x496ffa=_0x496ffa||0xc8;return function(_0x3e4f53){if(_0x3e4f53){return _0x461e03['status'](_0x496ffa)[_0x4d65('0x24')](_0x3e4f53);}};}function respondWithFilteredResult(_0x2c5f1a,_0x2f624e){return function(_0x5d6274){if(_0x5d6274){var _0x3bd0cc=typeof _0x2f624e[_0x4d65('0x25')]==='undefined'&&typeof _0x2f624e[_0x4d65('0x26')]==='undefined';var _0x1f99aa=_0x5d6274[_0x4d65('0x27')];var _0x15fbfd=_0x3bd0cc?0x0:_0x2f624e['offset'];var _0x14db02=_0x3bd0cc?_0x5d6274[_0x4d65('0x27')]:_0x2f624e[_0x4d65('0x25')]+_0x2f624e[_0x4d65('0x26')];var _0x467b45;if(_0x14db02>=_0x1f99aa){_0x14db02=_0x1f99aa;_0x467b45=0xc8;}else{_0x467b45=0xce;}_0x2c5f1a[_0x4d65('0x22')](_0x467b45);return _0x2c5f1a[_0x4d65('0x28')](_0x4d65('0x29'),_0x15fbfd+'-'+_0x14db02+'/'+_0x1f99aa)['json'](_0x5d6274);}return null;};}function patchUpdates(_0x3c7bf0){return function(_0x5195b2){try{jsonpatch['apply'](_0x5195b2,_0x3c7bf0,!![]);}catch(_0x100d6b){return BPromise[_0x4d65('0x2a')](_0x100d6b);}return _0x5195b2[_0x4d65('0x2b')]();};}function saveUpdates(_0x15c515,_0x5dc45f){return function(_0x231dd5){if(_0x231dd5){return _0x231dd5[_0x4d65('0x2c')](_0x15c515)[_0x4d65('0x2d')](function(_0x352bd4){return _0x352bd4;});}return null;};}function removeEntity(_0x3df43e,_0xa8f442){return function(_0x14ece5){if(_0x14ece5){return _0x14ece5[_0x4d65('0x2e')]()[_0x4d65('0x2d')](function(){_0x3df43e['status'](0xcc)[_0x4d65('0x23')]();});}};}function handleEntityNotFound(_0x30e6ae,_0x561ddf){return function(_0x2d2910){if(!_0x2d2910){_0x30e6ae[_0x4d65('0x21')](0x194);}return _0x2d2910;};}function handleError(_0x58ed7d,_0x4a95a9){_0x4a95a9=_0x4a95a9||0x1f4;return function(_0x5b15c7){logger[_0x4d65('0x2f')](_0x5b15c7[_0x4d65('0x30')]);if(_0x5b15c7[_0x4d65('0x31')]){delete _0x5b15c7['name'];}_0x58ed7d[_0x4d65('0x22')](_0x4a95a9)[_0x4d65('0x32')](_0x5b15c7);};}exports[_0x4d65('0x33')]=function(_0x1274f1,_0x1094f3){var _0x45d28e={},_0x41e19c={},_0x1db98c={'count':0x0,'rows':[]};var _0x16a749=_[_0x4d65('0x34')](db[_0x4d65('0x35')][_0x4d65('0x36')],function(_0x52eaa1){return{'name':_0x52eaa1[_0x4d65('0x37')],'type':_0x52eaa1[_0x4d65('0x38')]['key']};});_0x41e19c[_0x4d65('0x39')]=_[_0x4d65('0x34')](_0x16a749,_0x4d65('0x31'));_0x41e19c[_0x4d65('0x3a')]=_[_0x4d65('0x3b')](_0x1274f1['query']);_0x41e19c[_0x4d65('0x3c')]=_['intersection'](_0x41e19c[_0x4d65('0x39')],_0x41e19c[_0x4d65('0x3a')]);_0x45d28e[_0x4d65('0x3d')]=_[_0x4d65('0x3e')](_0x41e19c[_0x4d65('0x39')],qs['fields'](_0x1274f1[_0x4d65('0x3a')]['fields']));_0x45d28e['attributes']=_0x45d28e[_0x4d65('0x3d')]['length']?_0x45d28e[_0x4d65('0x3d')]:_0x41e19c[_0x4d65('0x39')];if(!_0x1274f1[_0x4d65('0x3a')][_0x4d65('0x3f')](_0x4d65('0x40'))){_0x45d28e['limit']=qs[_0x4d65('0x26')](_0x1274f1[_0x4d65('0x3a')]['limit']);_0x45d28e[_0x4d65('0x25')]=qs[_0x4d65('0x25')](_0x1274f1[_0x4d65('0x3a')]['offset']);}_0x45d28e['order']=qs['sort'](_0x1274f1['query'][_0x4d65('0x41')]);_0x45d28e[_0x4d65('0x42')]=qs[_0x4d65('0x3c')](_['pick'](_0x1274f1['query'],_0x41e19c[_0x4d65('0x3c')]),_0x16a749);if(_0x1274f1[_0x4d65('0x3a')]['filter']){_0x45d28e[_0x4d65('0x42')]=_[_0x4d65('0x43')](_0x45d28e[_0x4d65('0x42')],{'$or':_[_0x4d65('0x34')](_0x16a749,function(_0x5dbe0b){if(_0x5dbe0b['type']!==_0x4d65('0x44')){var _0x590642={};_0x590642[_0x5dbe0b[_0x4d65('0x31')]]={'$like':'%'+_0x1274f1[_0x4d65('0x3a')][_0x4d65('0x45')]+'%'};return _0x590642;}})});}_0x45d28e=_['merge']({},_0x45d28e,_0x1274f1[_0x4d65('0x46')]);var _0x363dd6={'where':_0x45d28e[_0x4d65('0x42')]};return db[_0x4d65('0x35')][_0x4d65('0x27')](_0x363dd6)['then'](function(_0x9c49e1){_0x1db98c[_0x4d65('0x27')]=_0x9c49e1;if(_0x1274f1['query'][_0x4d65('0x47')]){_0x45d28e[_0x4d65('0x48')]=[{'all':!![]}];}return db['ChatGroup'][_0x4d65('0x49')](_0x45d28e);})[_0x4d65('0x2d')](function(_0x272e6b){_0x1db98c[_0x4d65('0x4a')]=_0x272e6b;return _0x1db98c;})['then'](respondWithFilteredResult(_0x1094f3,_0x45d28e))['catch'](handleError(_0x1094f3,null));};exports[_0x4d65('0x4b')]=function(_0x5940e8,_0x1b2cb8){var _0x2055ee={'raw':!![],'where':{'id':_0x5940e8['params']['id']}},_0x2e22fb={};_0x2e22fb[_0x4d65('0x39')]=_['keys'](db[_0x4d65('0x35')]['rawAttributes']);_0x2e22fb['query']=_[_0x4d65('0x3b')](_0x5940e8[_0x4d65('0x3a')]);_0x2e22fb[_0x4d65('0x3c')]=_['intersection'](_0x2e22fb[_0x4d65('0x39')],_0x2e22fb[_0x4d65('0x3a')]);_0x2055ee[_0x4d65('0x3d')]=_[_0x4d65('0x3e')](_0x2e22fb[_0x4d65('0x39')],qs[_0x4d65('0x4c')](_0x5940e8[_0x4d65('0x3a')]['fields']));_0x2055ee[_0x4d65('0x3d')]=_0x2055ee[_0x4d65('0x3d')][_0x4d65('0x4d')]?_0x2055ee[_0x4d65('0x3d')]:_0x2e22fb[_0x4d65('0x39')];if(_0x5940e8['query'][_0x4d65('0x47')]){_0x2055ee[_0x4d65('0x48')]=[{'all':!![]}];}_0x2055ee=_[_0x4d65('0x43')]({},_0x2055ee,_0x5940e8[_0x4d65('0x46')]);return db[_0x4d65('0x35')][_0x4d65('0x4e')](_0x2055ee)[_0x4d65('0x2d')](handleEntityNotFound(_0x1b2cb8,null))[_0x4d65('0x2d')](respondWithResult(_0x1b2cb8,null))['catch'](handleError(_0x1b2cb8,null));};exports['create']=function(_0x484f88,_0x58d745){return db['ChatGroup'][_0x4d65('0x4f')](_0x484f88[_0x4d65('0x50')],{})[_0x4d65('0x2d')](respondWithResult(_0x58d745,0xc9))[_0x4d65('0x51')](handleError(_0x58d745,null));};exports[_0x4d65('0x2c')]=function(_0x21e084,_0x318837){if(_0x21e084[_0x4d65('0x50')]['id']){delete _0x21e084[_0x4d65('0x50')]['id'];}return db[_0x4d65('0x35')][_0x4d65('0x4e')]({'where':{'id':_0x21e084[_0x4d65('0x52')]['id']}})[_0x4d65('0x2d')](handleEntityNotFound(_0x318837,null))[_0x4d65('0x2d')](saveUpdates(_0x21e084['body'],null))[_0x4d65('0x2d')](respondWithResult(_0x318837,null))[_0x4d65('0x51')](handleError(_0x318837,null));};exports[_0x4d65('0x2e')]=function(_0x20a8cc,_0x152d73){return db['ChatGroup']['find']({'where':{'id':_0x20a8cc[_0x4d65('0x52')]['id']}})[_0x4d65('0x2d')](handleEntityNotFound(_0x152d73,null))[_0x4d65('0x2d')](removeEntity(_0x152d73,null))['catch'](handleError(_0x152d73,null));};exports['describe']=function(_0x28db00,_0x433bba){return db['ChatGroup'][_0x4d65('0x53')]()[_0x4d65('0x2d')](respondWithResult(_0x433bba,null))[_0x4d65('0x51')](handleError(_0x433bba,null));};exports[_0x4d65('0x54')]=function(_0x432699,_0x3bb500,_0x1fca67){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x432699[_0x4d65('0x52')]['id'],'ToId':_0x432699[_0x4d65('0x55')]['id'],'read':![]}})[_0x4d65('0x2d')](function(_0x544f30){return{'id':_[_0x4d65('0x56')](_0x432699[_0x4d65('0x52')]['id']),'count':_0x544f30};})[_0x4d65('0x2d')](respondWithResult(_0x3bb500,null))['catch'](handleError(_0x3bb500,null));};exports[_0x4d65('0x57')]=function(_0x4d5572,_0x5c3217,_0x27c635){return db[_0x4d65('0x35')][_0x4d65('0x4e')]({'where':{'id':_0x4d5572[_0x4d65('0x52')]['id']}})[_0x4d65('0x2d')](handleEntityNotFound(_0x5c3217,null))[_0x4d65('0x2d')](function(_0x3990f3){if(_0x3990f3){return _0x3990f3['addMembers'](_0x4d5572[_0x4d65('0x50')][_0x4d65('0x58')],_[_0x4d65('0x59')](_0x4d5572[_0x4d65('0x50')],[_0x4d65('0x58'),'id'])||{});}})[_0x4d65('0x2d')](respondWithResult(_0x5c3217,null))[_0x4d65('0x51')](handleError(_0x5c3217,null));};exports[_0x4d65('0x5a')]=function(_0x191097,_0x709c5e,_0x1aaf10){var _0x123b5b={};var _0x1c0b3d={};var _0x48c082;var _0x34e2f4;return db[_0x4d65('0x35')][_0x4d65('0x5b')]({'where':{'id':_0x191097[_0x4d65('0x52')]['id']}})['then'](handleEntityNotFound(_0x709c5e,null))[_0x4d65('0x2d')](function(_0x3973aa){if(_0x3973aa){_0x48c082=_0x3973aa;_0x1c0b3d[_0x4d65('0x39')]=_['keys'](db[_0x4d65('0x5c')][_0x4d65('0x36')]);_0x1c0b3d['query']=_[_0x4d65('0x3b')](_0x191097[_0x4d65('0x3a')]);_0x1c0b3d['filters']=_[_0x4d65('0x3e')](_0x1c0b3d[_0x4d65('0x39')],_0x1c0b3d[_0x4d65('0x3a')]);_0x123b5b[_0x4d65('0x3d')]=_['intersection'](_0x1c0b3d['model'],qs['fields'](_0x191097[_0x4d65('0x3a')][_0x4d65('0x4c')]));_0x123b5b['attributes']=_0x123b5b[_0x4d65('0x3d')][_0x4d65('0x4d')]?_0x123b5b[_0x4d65('0x3d')]:_0x1c0b3d[_0x4d65('0x39')];_0x123b5b[_0x4d65('0x5d')]=qs[_0x4d65('0x41')](_0x191097[_0x4d65('0x3a')][_0x4d65('0x41')]);_0x123b5b[_0x4d65('0x42')]=qs[_0x4d65('0x3c')](_[_0x4d65('0x5e')](_0x191097[_0x4d65('0x3a')],_0x1c0b3d['filters']));if(_0x191097[_0x4d65('0x3a')]['filter']){_0x123b5b[_0x4d65('0x42')]=_['merge'](_0x123b5b['where'],{'$or':_[_0x4d65('0x34')](_0x123b5b[_0x4d65('0x3d')],function(_0x5f5ae2){var _0x49b5b3={};_0x49b5b3[_0x5f5ae2]={'$like':'%'+_0x191097[_0x4d65('0x3a')][_0x4d65('0x45')]+'%'};return _0x49b5b3;})});}_0x123b5b=_[_0x4d65('0x43')]({},_0x123b5b,_0x191097[_0x4d65('0x46')]);return _0x48c082[_0x4d65('0x5a')](_0x123b5b);}})['then'](function(_0x462383){if(_0x462383){_0x34e2f4=_0x462383[_0x4d65('0x4d')];if(!_0x191097['query'][_0x4d65('0x3f')](_0x4d65('0x40'))){_0x123b5b[_0x4d65('0x26')]=qs[_0x4d65('0x26')](_0x191097[_0x4d65('0x3a')][_0x4d65('0x26')]);_0x123b5b[_0x4d65('0x25')]=qs[_0x4d65('0x25')](_0x191097[_0x4d65('0x3a')]['offset']);}return _0x48c082['getMembers'](_0x123b5b);}})[_0x4d65('0x2d')](function(_0x1a1b76){if(_0x1a1b76){return _0x1a1b76?{'count':_0x34e2f4,'rows':_0x1a1b76}:null;}})[_0x4d65('0x2d')](respondWithResult(_0x709c5e,null))[_0x4d65('0x51')](handleError(_0x709c5e,null));};exports['removeMembers']=function(_0x2c7ee6,_0x30199f,_0x5181bb){return db[_0x4d65('0x35')][_0x4d65('0x4e')]({'where':{'id':_0x2c7ee6[_0x4d65('0x52')]['id']}})['then'](handleEntityNotFound(_0x30199f,null))[_0x4d65('0x2d')](function(_0x281c0c){if(_0x281c0c){return _0x281c0c[_0x4d65('0x5f')](_0x2c7ee6[_0x4d65('0x3a')][_0x4d65('0x58')]);}})[_0x4d65('0x2d')](respondWithStatusCode(_0x30199f,null))[_0x4d65('0x51')](handleError(_0x30199f,null));};exports[_0x4d65('0x60')]=function(_0x1f6ddd,_0x126ec7,_0x15e96a){if(_0x1f6ddd['body']['id']){delete _0x1f6ddd[_0x4d65('0x50')]['id'];}return db[_0x4d65('0x35')][_0x4d65('0x4e')]({'where':{'id':_0x1f6ddd[_0x4d65('0x52')]['id']}})[_0x4d65('0x2d')](handleEntityNotFound(_0x126ec7,null))[_0x4d65('0x2d')](function(_0x3f66af){if(_0x3f66af){_0x1f6ddd[_0x4d65('0x50')][_0x4d65('0x61')]=_0x3f66af['id'];return db[_0x4d65('0x62')][_0x4d65('0x4f')](_0x1f6ddd[_0x4d65('0x50')]);}})[_0x4d65('0x2d')](respondWithResult(_0x126ec7,null))['catch'](handleError(_0x126ec7,null));};exports[_0x4d65('0x63')]=function(_0x13b3d5,_0x5d7781,_0x460889){var _0x184688={};var _0x1c5a8={};var _0x3f8fc6;var _0x45b529;return db[_0x4d65('0x35')][_0x4d65('0x5b')]({'where':{'id':_0x13b3d5['params']['id']}})[_0x4d65('0x2d')](handleEntityNotFound(_0x5d7781,null))[_0x4d65('0x2d')](function(_0x37ed0e){if(_0x37ed0e){_0x3f8fc6=_0x37ed0e;_0x1c5a8[_0x4d65('0x39')]=_['keys'](db[_0x4d65('0x62')][_0x4d65('0x36')]);_0x1c5a8[_0x4d65('0x3a')]=_[_0x4d65('0x3b')](_0x13b3d5[_0x4d65('0x3a')]);_0x1c5a8[_0x4d65('0x3c')]=_['intersection'](_0x1c5a8['model'],_0x1c5a8[_0x4d65('0x3a')]);_0x184688[_0x4d65('0x3d')]=_[_0x4d65('0x3e')](_0x1c5a8[_0x4d65('0x39')],qs[_0x4d65('0x4c')](_0x13b3d5[_0x4d65('0x3a')][_0x4d65('0x4c')]));_0x184688['attributes']=_0x184688[_0x4d65('0x3d')][_0x4d65('0x4d')]?_0x184688[_0x4d65('0x3d')]:_0x1c5a8[_0x4d65('0x39')];_0x184688[_0x4d65('0x5d')]=qs[_0x4d65('0x41')](_0x13b3d5[_0x4d65('0x3a')][_0x4d65('0x41')]);_0x184688['where']=qs['filters'](_[_0x4d65('0x5e')](_0x13b3d5[_0x4d65('0x3a')],_0x1c5a8[_0x4d65('0x3c')]));if(_0x13b3d5[_0x4d65('0x3a')][_0x4d65('0x45')]){_0x184688[_0x4d65('0x42')]=_[_0x4d65('0x43')](_0x184688[_0x4d65('0x42')],{'$or':_['map'](_0x184688['attributes'],function(_0x1dcdca){var _0x439f06={};_0x439f06[_0x1dcdca]={'$like':'%'+_0x13b3d5[_0x4d65('0x3a')][_0x4d65('0x45')]+'%'};return _0x439f06;})});}if(_0x13b3d5[_0x4d65('0x3a')][_0x4d65('0x64')]){var _0x1d1567=_0x13b3d5[_0x4d65('0x3a')][_0x4d65('0x64')][_0x4d65('0x65')](',');var _0x5eb2c0={};_0x5eb2c0[_0x1d1567[0x0]]={'$gte':moment(_0x1d1567[0x1])[_0x4d65('0x66')](_0x4d65('0x67'))};_0x184688[_0x4d65('0x42')]=_['merge'](_0x184688['where'],_0x5eb2c0);}_0x184688=_[_0x4d65('0x43')]({},_0x184688,_0x13b3d5[_0x4d65('0x46')]);return _0x3f8fc6[_0x4d65('0x63')](_0x184688);}})[_0x4d65('0x2d')](function(_0x14b396){if(_0x14b396){_0x45b529=_0x14b396['length'];if(!_0x13b3d5['query'][_0x4d65('0x3f')](_0x4d65('0x40'))){_0x184688['limit']=qs[_0x4d65('0x26')](_0x13b3d5[_0x4d65('0x3a')][_0x4d65('0x26')]);_0x184688['offset']=qs[_0x4d65('0x25')](_0x13b3d5[_0x4d65('0x3a')][_0x4d65('0x25')]);}return _0x3f8fc6[_0x4d65('0x63')](_0x184688);}})[_0x4d65('0x2d')](function(_0x2f3298){if(_0x2f3298){return _0x2f3298?{'count':_0x45b529,'rows':_0x2f3298}:null;}})[_0x4d65('0x2d')](respondWithResult(_0x5d7781,null))[_0x4d65('0x51')](handleError(_0x5d7781,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 87d8a85..1cee381 100644 --- a/server/api/chatGroup/chatGroup.events.js +++ b/server/api/chatGroup/chatGroup.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfcf0=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5124d2,_0x3400cb){var _0x361478=function(_0x21915a){while(--_0x21915a){_0x5124d2['push'](_0x5124d2['shift']());}};_0x361478(++_0x3400cb);}(_0xfcf0,0x138));var _0x0fcf=function(_0x50bf5a,_0x807bba){_0x50bf5a=_0x50bf5a-0x0;var _0x4ddc1d=_0xfcf0[_0x50bf5a];return _0x4ddc1d;};'use strict';var EventEmitter=require(_0x0fcf('0x0'));var ChatGroup=require(_0x0fcf('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0fcf('0x2')](0x0);var events={'afterCreate':_0x0fcf('0x3'),'afterUpdate':_0x0fcf('0x4'),'afterDestroy':_0x0fcf('0x5')};function emitEvent(_0x5c865e){return function(_0x2fe6d8,_0x265968,_0x3bd34d){ChatGroupEvents[_0x0fcf('0x6')](_0x5c865e+':'+_0x2fe6d8['id'],_0x2fe6d8);ChatGroupEvents[_0x0fcf('0x6')](_0x5c865e,_0x2fe6d8);_0x3bd34d(null);};}for(var e in events){if(events[_0x0fcf('0x7')](e)){var event=events[e];ChatGroup[_0x0fcf('0x8')](e,emitEvent(event));}}module[_0x0fcf('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0x1d0d=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit','hook'];(function(_0x532311,_0xdd4791){var _0x59f41f=function(_0xd4564d){while(--_0xd4564d){_0x532311['push'](_0x532311['shift']());}};_0x59f41f(++_0xdd4791);}(_0x1d0d,0x184));var _0xd1d0=function(_0x2783da,_0x1f84e0){_0x2783da=_0x2783da-0x0;var _0x49652f=_0x1d0d[_0x2783da];return _0x49652f;};'use strict';var EventEmitter=require(_0xd1d0('0x0'));var ChatGroup=require(_0xd1d0('0x1'))['db'][_0xd1d0('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd1d0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd1d0('0x4'),'afterDestroy':_0xd1d0('0x5')};function emitEvent(_0x5e6b12){return function(_0x1db763,_0x1c844c,_0x54fb90){ChatGroupEvents[_0xd1d0('0x6')](_0x5e6b12+':'+_0x1db763['id'],_0x1db763);ChatGroupEvents[_0xd1d0('0x6')](_0x5e6b12,_0x1db763);_0x54fb90(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xd1d0('0x7')](e,emitEvent(event));}}module[_0xd1d0('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 41795c0..34c6a6e 100644 --- a/server/api/chatGroup/chatGroup.model.js +++ b/server/api/chatGroup/chatGroup.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4eb8=['../../config/environment','./chatGroup.attributes','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5e49de,_0x1d3dd9){var _0x328849=function(_0x457210){while(--_0x457210){_0x5e49de['push'](_0x5e49de['shift']());}};_0x328849(++_0x1d3dd9);}(_0x4eb8,0x88));var _0x84eb=function(_0x206137,_0x2a56c7){_0x206137=_0x206137-0x0;var _0x96c5f7=_0x4eb8[_0x206137];return _0x96c5f7;};'use strict';var _=require(_0x84eb('0x0'));var util=require(_0x84eb('0x1'));var logger=require(_0x84eb('0x2'))(_0x84eb('0x3'));var moment=require(_0x84eb('0x4'));var BPromise=require(_0x84eb('0x5'));var rp=require(_0x84eb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x84eb('0x7'));var attributes=require(_0x84eb('0x8'));module['exports']=function(_0x260bd5,_0x487fef){return _0x260bd5['define'](_0x84eb('0x9'),attributes,{'tableName':_0x84eb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a5c=['ChatGroup','chat_groups','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0x8a5c,0xe9));var _0xc8a5=function(_0xe63929,_0x296869){_0xe63929=_0xe63929-0x0;var _0x568ee7=_0x8a5c[_0xe63929];return _0x568ee7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc8a5('0x0'))('api');var moment=require(_0xc8a5('0x1'));var BPromise=require('bluebird');var rp=require(_0xc8a5('0x2'));var fs=require('fs');var path=require(_0xc8a5('0x3'));var rimraf=require(_0xc8a5('0x4'));var config=require(_0xc8a5('0x5'));var attributes=require(_0xc8a5('0x6'));module[_0xc8a5('0x7')]=function(_0x2efa0b,_0x5dcf21){return _0x2efa0b[_0xc8a5('0x8')](_0xc8a5('0x9'),attributes,{'tableName':_0xc8a5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 5849271..aa20aa1 100644 --- a/server/api/chatGroup/chatGroup.rpc.js +++ b/server/api/chatGroup/chatGroup.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ec7=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','defaults','redis','socket.io-emitter','./chatGroup.socket','request'];(function(_0x37e342,_0x160c8f){var _0x1768f9=function(_0x413c98){while(--_0x413c98){_0x37e342['push'](_0x37e342['shift']());}};_0x1768f9(++_0x160c8f);}(_0x7ec7,0x19b));var _0x77ec=function(_0x57a368,_0x69b27c){_0x57a368=_0x57a368-0x0;var _0x26ac3b=_0x7ec7[_0x57a368];return _0x26ac3b;};'use strict';var _=require(_0x77ec('0x0'));var util=require(_0x77ec('0x1'));var moment=require(_0x77ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x77ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x77ec('0x4'))['db'];var utils=require(_0x77ec('0x5'));var logger=require(_0x77ec('0x6'))('rpc');var config=require(_0x77ec('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x77ec('0x8')]({'port':0x232a});config['redis']=_[_0x77ec('0x9')](config[_0x77ec('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x77ec('0xb'))(new Redis(config[_0x77ec('0xa')]));require(_0x77ec('0xc'))['register'](socket);function respondWithRpcPromise(_0xd62db6,_0x329cb9,_0x3d87cc){return new BPromise(function(_0x300933,_0x4494c7){return client[_0x77ec('0xd')](_0xd62db6,_0x3d87cc)[_0x77ec('0xe')](function(_0x5c3bf4){logger[_0x77ec('0xf')](_0x77ec('0x10'),_0x329cb9,_0x77ec('0x11'));logger[_0x77ec('0x12')](_0x77ec('0x13'),_0x329cb9,'request\x20sent',JSON[_0x77ec('0x14')](_0x5c3bf4));if(_0x5c3bf4['error']){if(_0x5c3bf4['error'][_0x77ec('0x15')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x329cb9,_0x5c3bf4[_0x77ec('0x16')]['message']);return _0x4494c7(_0x5c3bf4[_0x77ec('0x16')][_0x77ec('0x17')]);}logger[_0x77ec('0x16')]('ChatGroup,\x20%s,\x20%s',_0x329cb9,_0x5c3bf4[_0x77ec('0x16')][_0x77ec('0x17')]);return _0x300933(_0x5c3bf4[_0x77ec('0x16')][_0x77ec('0x17')]);}else{logger[_0x77ec('0xf')]('ChatGroup,\x20%s,\x20%s',_0x329cb9,_0x77ec('0x11'));_0x300933(_0x5c3bf4[_0x77ec('0x18')]['message']);}})['catch'](function(_0x49a879){logger[_0x77ec('0x16')](_0x77ec('0x10'),_0x329cb9,_0x49a879);_0x4494c7(_0x49a879);});});} \ No newline at end of file +var _0x20ec=['./chatGroup.socket','register','request','then','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','ChatGroup,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x5d5cee,_0x1d2109){var _0x31e49a=function(_0x4f167a){while(--_0x4f167a){_0x5d5cee['push'](_0x5d5cee['shift']());}};_0x31e49a(++_0x1d2109);}(_0x20ec,0x12f));var _0xc20e=function(_0x11f1fd,_0xce95a8){_0x11f1fd=_0x11f1fd-0x0;var _0x2d1215=_0x20ec[_0x11f1fd];return _0x2d1215;};'use strict';var _=require(_0xc20e('0x0'));var util=require(_0xc20e('0x1'));var moment=require(_0xc20e('0x2'));var BPromise=require(_0xc20e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc20e('0x4'))['db'];var utils=require(_0xc20e('0x5'));var logger=require(_0xc20e('0x6'))(_0xc20e('0x7'));var config=require(_0xc20e('0x8'));var jayson=require(_0xc20e('0x9'));var client=jayson[_0xc20e('0xa')][_0xc20e('0xb')]({'port':0x232a});config[_0xc20e('0xc')]=_[_0xc20e('0xd')](config[_0xc20e('0xc')],{'host':_0xc20e('0xe'),'port':0x18eb});var socket=require(_0xc20e('0xf'))(new Redis(config['redis']));require(_0xc20e('0x10'))[_0xc20e('0x11')](socket);function respondWithRpcPromise(_0x302ba2,_0xa72501,_0x15fd37){return new BPromise(function(_0x1e45d9,_0x4c8dca){return client[_0xc20e('0x12')](_0x302ba2,_0x15fd37)[_0xc20e('0x13')](function(_0x5665c2){logger['info']('ChatGroup,\x20%s,\x20%s',_0xa72501,_0xc20e('0x14'));logger[_0xc20e('0x15')](_0xc20e('0x16'),_0xa72501,_0xc20e('0x14'),JSON['stringify'](_0x5665c2));if(_0x5665c2['error']){if(_0x5665c2[_0xc20e('0x17')]['code']===0x1f4){logger[_0xc20e('0x17')](_0xc20e('0x18'),_0xa72501,_0x5665c2[_0xc20e('0x17')][_0xc20e('0x19')]);return _0x4c8dca(_0x5665c2[_0xc20e('0x17')]['message']);}logger['error']('ChatGroup,\x20%s,\x20%s',_0xa72501,_0x5665c2[_0xc20e('0x17')][_0xc20e('0x19')]);return _0x1e45d9(_0x5665c2[_0xc20e('0x17')][_0xc20e('0x19')]);}else{logger[_0xc20e('0x1a')](_0xc20e('0x18'),_0xa72501,_0xc20e('0x14'));_0x1e45d9(_0x5665c2[_0xc20e('0x1b')][_0xc20e('0x19')]);}})[_0xc20e('0x1c')](function(_0xfeae40){logger['error'](_0xc20e('0x18'),_0xa72501,_0xfeae40);_0x4c8dca(_0xfeae40);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index c26ebef..5f50876 100644 --- a/server/api/chatGroup/chatGroup.socket.js +++ b/server/api/chatGroup/chatGroup.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5704=['removeListener','length','./chatGroup.events','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5704,0xed));var _0x4570=function(_0x3a29e5,_0xffee26){_0x3a29e5=_0x3a29e5-0x0;var _0x496fb5=_0x5704[_0x3a29e5];return _0x496fb5;};'use strict';var ChatGroupEvents=require(_0x4570('0x0'));var events=['save',_0x4570('0x1'),_0x4570('0x2')];function createListener(_0xc73d2d,_0x41b5db){return function(_0x3c885a){_0x41b5db['emit'](_0xc73d2d,_0x3c885a);};}function removeListener(_0x13b8e8,_0x43f98b){return function(){ChatGroupEvents[_0x4570('0x3')](_0x13b8e8,_0x43f98b);};}exports['register']=function(_0xfa91ee){for(var _0x150655=0x0,_0x506086=events[_0x4570('0x4')];_0x150655<_0x506086;_0x150655++){var _0x2f37c2=events[_0x150655];var _0x20b87b=createListener('chatGroup:'+_0x2f37c2,_0xfa91ee);ChatGroupEvents['on'](_0x2f37c2,_0x20b87b);}}; \ No newline at end of file +var _0x91e0=['update','emit','removeListener','register','./chatGroup.events','save','remove'];(function(_0x5015cc,_0x36ba25){var _0x5930d7=function(_0x5ee93a){while(--_0x5ee93a){_0x5015cc['push'](_0x5015cc['shift']());}};_0x5930d7(++_0x36ba25);}(_0x91e0,0xc1));var _0x091e=function(_0x2f35be,_0x5aa2c6){_0x2f35be=_0x2f35be-0x0;var _0x2d6a0c=_0x91e0[_0x2f35be];return _0x2d6a0c;};'use strict';var ChatGroupEvents=require(_0x091e('0x0'));var events=[_0x091e('0x1'),_0x091e('0x2'),_0x091e('0x3')];function createListener(_0x1bd7df,_0x5df8ea){return function(_0x56f74b){_0x5df8ea[_0x091e('0x4')](_0x1bd7df,_0x56f74b);};}function removeListener(_0x333065,_0x35b4c9){return function(){ChatGroupEvents[_0x091e('0x5')](_0x333065,_0x35b4c9);};}exports[_0x091e('0x6')]=function(_0x25c8aa){for(var _0x2e7f23=0x0,_0x516bac=events['length'];_0x2e7f23<_0x516bac;_0x2e7f23++){var _0x4a2c6c=events[_0x2e7f23];var _0x40c9f2=createListener('chatGroup:'+_0x4a2c6c,_0x25c8aa);ChatGroupEvents['on'](_0x4a2c6c,_0x40c9f2);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index d7d2652..6130bb9 100644 --- a/server/api/chatGroup/index.js +++ b/server/api/chatGroup/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb48=['delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','update'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xcb48,0xda));var _0x8cb4=function(_0x10f9b6,_0x41fe76){_0x10f9b6=_0x10f9b6-0x0;var _0xca3e65=_0xcb48[_0x10f9b6];return _0xca3e65;};'use strict';var multer=require(_0x8cb4('0x0'));var util=require('util');var path=require(_0x8cb4('0x1'));var timeout=require(_0x8cb4('0x2'));var express=require(_0x8cb4('0x3'));var router=express[_0x8cb4('0x4')]();var fs_extra=require(_0x8cb4('0x5'));var auth=require(_0x8cb4('0x6'));var interaction=require(_0x8cb4('0x7'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0x8cb4('0x8')]('/',auth[_0x8cb4('0x9')](),controller['index']);router['get'](_0x8cb4('0xa'),auth[_0x8cb4('0x9')](),controller[_0x8cb4('0xb')]);router[_0x8cb4('0x8')](_0x8cb4('0xc'),auth[_0x8cb4('0x9')](),controller[_0x8cb4('0xd')]);router['get'](_0x8cb4('0xe'),auth['isAuthenticated'](),controller[_0x8cb4('0xf')]);router[_0x8cb4('0x8')](_0x8cb4('0x10'),auth['isAuthenticated'](),controller[_0x8cb4('0x11')]);router[_0x8cb4('0x8')](_0x8cb4('0x12'),auth['isAuthenticated'](),controller[_0x8cb4('0x13')]);router['post']('/',auth[_0x8cb4('0x9')](),controller['create']);router[_0x8cb4('0x14')](_0x8cb4('0x10'),auth[_0x8cb4('0x9')](),controller[_0x8cb4('0x15')]);router[_0x8cb4('0x14')](_0x8cb4('0x12'),auth['isAuthenticated'](),controller[_0x8cb4('0x16')]);router[_0x8cb4('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x8cb4('0x18')]);router[_0x8cb4('0x19')](_0x8cb4('0xc'),auth[_0x8cb4('0x9')](),controller[_0x8cb4('0x1a')]);router['delete']('/:id/members',auth[_0x8cb4('0x9')](),controller['removeMembers']);module['exports']=router; \ No newline at end of file +var _0x40f7=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMessages','post','create','addMembers','/:id/messages','addMessage','update','delete','removeMembers'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x40f7,0x75));var _0x740f=function(_0x40cb8c,_0x381f11){_0x40cb8c=_0x40cb8c-0x0;var _0x5315ce=_0x40f7[_0x40cb8c];return _0x5315ce;};'use strict';var multer=require(_0x740f('0x0'));var util=require(_0x740f('0x1'));var path=require('path');var timeout=require(_0x740f('0x2'));var express=require(_0x740f('0x3'));var router=express[_0x740f('0x4')]();var fs_extra=require(_0x740f('0x5'));var auth=require(_0x740f('0x6'));var interaction=require(_0x740f('0x7'));var config=require(_0x740f('0x8'));var controller=require(_0x740f('0x9'));router[_0x740f('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x740f('0xa')](_0x740f('0xb'),auth[_0x740f('0xc')](),controller[_0x740f('0xd')]);router[_0x740f('0xa')](_0x740f('0xe'),auth['isAuthenticated'](),controller[_0x740f('0xf')]);router[_0x740f('0xa')](_0x740f('0x10'),auth['isAuthenticated'](),controller[_0x740f('0x11')]);router[_0x740f('0xa')](_0x740f('0x12'),auth[_0x740f('0xc')](),controller['getMembers']);router[_0x740f('0xa')]('/:id/messages',auth[_0x740f('0xc')](),controller[_0x740f('0x13')]);router[_0x740f('0x14')]('/',auth['isAuthenticated'](),controller[_0x740f('0x15')]);router[_0x740f('0x14')]('/:id/members',auth[_0x740f('0xc')](),controller[_0x740f('0x16')]);router[_0x740f('0x14')](_0x740f('0x17'),auth['isAuthenticated'](),controller[_0x740f('0x18')]);router['put'](_0x740f('0xe'),auth[_0x740f('0xc')](),controller[_0x740f('0x19')]);router[_0x740f('0x1a')](_0x740f('0xe'),auth[_0x740f('0xc')](),controller['destroy']);router['delete']('/:id/members',auth[_0x740f('0xc')](),controller[_0x740f('0x1b')]);module[_0x740f('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 84a7f10..a1782fa 100644 --- a/server/api/chatInteraction/chatInteraction.attributes.js +++ b/server/api/chatInteraction/chatInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x035c=['exports','BOOLEAN','INTEGER','star','thumb','TEXT','STRING','DATE','long','ENUM','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x035c,0xc5));var _0xc035=function(_0x2304e4,_0x2fd0f5){_0x2304e4=_0x2304e4-0x0;var _0x1561f7=_0x035c[_0x2304e4];return _0x1561f7;};'use strict';var Sequelize=require(_0xc035('0x0'));module[_0xc035('0x1')]={'closed':{'type':Sequelize[_0xc035('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc035('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xc035('0x4'),_0xc035('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xc035('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xc035('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc035('0x8')]},'disposition':{'type':Sequelize[_0xc035('0x7')]},'secondDisposition':{'type':Sequelize[_0xc035('0x7')]},'thirdDisposition':{'type':Sequelize[_0xc035('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xc035('0x7')]},'browserVersion':{'type':Sequelize[_0xc035('0x7')]},'osName':{'type':Sequelize[_0xc035('0x7')]},'osVersion':{'type':Sequelize[_0xc035('0x7')]},'deviceModel':{'type':Sequelize[_0xc035('0x7')]},'deviceVendor':{'type':Sequelize[_0xc035('0x7')]},'deviceType':{'type':Sequelize[_0xc035('0x7')]},'referer':{'type':Sequelize[_0xc035('0x6')]},'customerIp':{'type':Sequelize[_0xc035('0x7')]},'formData':{'type':Sequelize[_0xc035('0x6')](_0xc035('0x9'))},'read1stAt':{'type':Sequelize[_0xc035('0x8')]},'lastMsgAt':{'type':Sequelize[_0xc035('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xc035('0xa')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xc035('0x7')]},'customerPort':{'type':Sequelize[_0xc035('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xc035('0x6')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xc035('0x3')]}}; \ No newline at end of file +var _0x5797=['BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','exports'];(function(_0x126056,_0x1c4008){var _0xff1758=function(_0x5a87e5){while(--_0x5a87e5){_0x126056['push'](_0x126056['shift']());}};_0xff1758(++_0x1c4008);}(_0x5797,0x1b7));var _0x7579=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x5797[_0x1762b4];return _0x29beda;};'use strict';var Sequelize=require('sequelize');module[_0x7579('0x0')]={'closed':{'type':Sequelize[_0x7579('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7579('0x2')]},'ratingType':{'type':Sequelize[_0x7579('0x3')](_0x7579('0x4'),_0x7579('0x5')),'defaultValue':_0x7579('0x4')},'ratingMessage':{'type':Sequelize[_0x7579('0x6')]},'pathTranscript':{'type':Sequelize[_0x7579('0x6')]},'mailTranscript':{'type':Sequelize[_0x7579('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7579('0x8')]},'disposition':{'type':Sequelize[_0x7579('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x7579('0x7')]},'note':{'type':Sequelize[_0x7579('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x7579('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x7579('0x7')]},'deviceVendor':{'type':Sequelize[_0x7579('0x7')]},'deviceType':{'type':Sequelize[_0x7579('0x7')]},'referer':{'type':Sequelize[_0x7579('0x6')]},'customerIp':{'type':Sequelize[_0x7579('0x7')]},'formData':{'type':Sequelize[_0x7579('0x6')](_0x7579('0x9'))},'read1stAt':{'type':Sequelize[_0x7579('0x8')]},'lastMsgAt':{'type':Sequelize[_0x7579('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x7579('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x7579('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x7579('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x7579('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 4e7f78d..71c72f6 100644 --- a/server/api/chatInteraction/chatInteraction.controller.js +++ b/server/api/chatInteraction/chatInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa04=['read','Account','Owner','get','mkdirSync','Chat','N.A.','toString','browserName','osName','referer','customerPort','tail','createReadStream','pipe','createWriteStream','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','moment','bluebird','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','stack','name','send','render','merge','body','contact','agent','account','map','ChatInteraction','rawAttributes','fieldName','type','key','findAll','chat','query','user','catch','params','model','keys','intersection','fields','attributes','length','include','options','find','create','describe','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','isNull','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','basename','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','User','Messages','agentAlias','UserId','System','customer','%s%d','Visitor','ContactId','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','CloudProvider','Smtp','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','filters','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','getMyMessages','secret','includeAgent','addTags','setTags','spread','Tag','color','emit','removeTags','download','unix','server','files','tmp','transcript-%d-%s.zip','push','firstName','lastName','attachments'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xaa04,0x1ba));var _0x4aa0=function(_0x2b01af,_0x3e8848){_0x2b01af=_0x2b01af-0x0;var _0x3d2c18=_0xaa04[_0x2b01af];return _0x3d2c18;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x4aa0('0x0'));var rp=require('request-promise');var moment=require(_0x4aa0('0x1'));var BPromise=require(_0x4aa0('0x2'));var Mustache=require(_0x4aa0('0x3'));var util=require(_0x4aa0('0x4'));var path=require(_0x4aa0('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4aa0('0x6'));var Redis=require(_0x4aa0('0x7'));var interaction=require(_0x4aa0('0x8'));var qs=require(_0x4aa0('0x9'));var pdf=require(_0x4aa0('0xa'));var logger=require(_0x4aa0('0xb'))(_0x4aa0('0xc'));var config=require(_0x4aa0('0xd'));var db=require(_0x4aa0('0xe'))['db'];config[_0x4aa0('0xf')]=_[_0x4aa0('0x10')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4aa0('0x11'))(new Redis(config[_0x4aa0('0xf')]));require('./chatInteraction.socket')[_0x4aa0('0x12')](socket);var jayson=require(_0x4aa0('0x13'));var client=jayson[_0x4aa0('0x14')][_0x4aa0('0x15')]({'port':0x232b});var client9004=jayson[_0x4aa0('0x14')][_0x4aa0('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x184568,_0x4e92e5,_0x2618da,_0xf908ec){return new BPromise(function(_0x1d1e4e,_0x58b035){var _0x513bc=_0xf908ec||client;return _0x513bc[_0x4aa0('0x16')](_0x184568,_0x2618da)['then'](function(_0x34a2bc){logger[_0x4aa0('0x17')](_0x4aa0('0x18'),_0x4e92e5,_0x4aa0('0x19'));logger[_0x4aa0('0x1a')](_0x4aa0('0x1b'),_0x4e92e5,'request\x20sent',JSON[_0x4aa0('0x1c')](_0x34a2bc));if(_0x34a2bc['error']){if(_0x34a2bc[_0x4aa0('0x1d')][_0x4aa0('0x1e')]===0x1f4){logger[_0x4aa0('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x4e92e5,_0x34a2bc[_0x4aa0('0x1d')][_0x4aa0('0x1f')]);return _0x58b035(_0x34a2bc[_0x4aa0('0x1d')][_0x4aa0('0x1f')]);}logger[_0x4aa0('0x1d')](_0x4aa0('0x18'),_0x4e92e5,_0x34a2bc[_0x4aa0('0x1d')][_0x4aa0('0x1f')]);return _0x1d1e4e(_0x34a2bc[_0x4aa0('0x1d')]['message']);}else{logger[_0x4aa0('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x4e92e5,_0x4aa0('0x19'));_0x1d1e4e(_0x34a2bc[_0x4aa0('0x20')][_0x4aa0('0x1f')]);}})['catch'](function(_0x3e2bd2){logger[_0x4aa0('0x1d')](_0x4aa0('0x18'),_0x4e92e5,_0x3e2bd2);_0x58b035(_0x3e2bd2);});});}function respondWithStatusCode(_0x147df1,_0x33f220){_0x33f220=_0x33f220||0xcc;return function(_0x440827){if(_0x440827){return _0x147df1[_0x4aa0('0x21')](_0x33f220);}return _0x147df1['status'](_0x33f220)[_0x4aa0('0x22')]();};}function respondWithResult(_0x465941,_0x1b2dae){_0x1b2dae=_0x1b2dae||0xc8;return function(_0x3ce20e){if(_0x3ce20e){return _0x465941[_0x4aa0('0x23')](_0x1b2dae)[_0x4aa0('0x24')](_0x3ce20e);}};}function respondWithFilteredResult(_0x552b10,_0x48a2f5){return function(_0xbc1156){if(_0xbc1156){var _0x543bbb=typeof _0x48a2f5[_0x4aa0('0x25')]===_0x4aa0('0x26')&&typeof _0x48a2f5[_0x4aa0('0x27')]===_0x4aa0('0x26');var _0x1e7e3e=_0xbc1156['count'];var _0x18e43f=_0x543bbb?0x0:_0x48a2f5[_0x4aa0('0x25')];var _0x266fb4=_0x543bbb?_0xbc1156[_0x4aa0('0x28')]:_0x48a2f5['offset']+_0x48a2f5[_0x4aa0('0x27')];var _0x52c781;if(_0x266fb4>=_0x1e7e3e){_0x266fb4=_0x1e7e3e;_0x52c781=0xc8;}else{_0x52c781=0xce;}_0x552b10[_0x4aa0('0x23')](_0x52c781);return _0x552b10['set'](_0x4aa0('0x29'),_0x18e43f+'-'+_0x266fb4+'/'+_0x1e7e3e)['json'](_0xbc1156);}return null;};}function saveUpdates(_0x107a6f){return function(_0x462ca9){if(_0x462ca9){return _0x462ca9[_0x4aa0('0x2a')](_0x107a6f)[_0x4aa0('0x2b')](function(_0x36dd82){return _0x36dd82;});}return null;};}function removeEntity(_0x24f1a1){return function(_0x9dd407){if(_0x9dd407){return _0x9dd407[_0x4aa0('0x2c')]()['then'](function(){_0x24f1a1[_0x4aa0('0x23')](0xcc)[_0x4aa0('0x22')]();});}};}function handleEntityNotFound(_0x2b9f5d){return function(_0x1cd446){if(!_0x1cd446){_0x2b9f5d[_0x4aa0('0x21')](0x194);}return _0x1cd446;};}function handleError(_0x2ad39d,_0x3f0404){_0x3f0404=_0x3f0404||0x1f4;return function(_0x1dfd41){logger['error'](_0x1dfd41[_0x4aa0('0x2d')]);if(_0x1dfd41[_0x4aa0('0x2e')]){delete _0x1dfd41[_0x4aa0('0x2e')];}_0x2ad39d[_0x4aa0('0x23')](_0x3f0404)[_0x4aa0('0x2f')](_0x1dfd41);};}function getMustacheRender(_0x5708d9,_0x1b913c){return Mustache[_0x4aa0('0x30')](_0x5708d9,_[_0x4aa0('0x31')](_0x1b913c[_0x4aa0('0x32')],{'contact':_0x1b913c[_0x4aa0('0x33')],'message':_0x1b913c[_0x4aa0('0x1f')],'agent':_0x1b913c[_0x4aa0('0x34')],'interaction':_0x1b913c['interaction'],'account':_0x1b913c[_0x4aa0('0x35')]}))||'';}exports['index']=function(_0x5b097b,_0x723cc){var _0x1f5a08={};var _0x1b615c=_[_0x4aa0('0x36')](db[_0x4aa0('0x37')][_0x4aa0('0x38')],function(_0x12d073){return{'name':_0x12d073[_0x4aa0('0x39')],'type':_0x12d073[_0x4aa0('0x3a')][_0x4aa0('0x3b')]};});_0x1f5a08=qs['getOptions'](_0x1b615c,_0x5b097b);return interaction[_0x4aa0('0x3c')](_0x4aa0('0x3d'),_0x5b097b[_0x4aa0('0x3e')],_0x5b097b[_0x4aa0('0x3f')],_0x1f5a08,_0x1b615c)['then'](respondWithFilteredResult(_0x723cc,_0x1f5a08))[_0x4aa0('0x40')](handleError(_0x723cc,null));};exports['show']=function(_0x596f38,_0x4af8d8){var _0x26b687={'raw':![],'where':{'id':_0x596f38[_0x4aa0('0x41')]['id']}},_0x4940ae={};_0x4940ae[_0x4aa0('0x42')]=_[_0x4aa0('0x43')](db[_0x4aa0('0x37')][_0x4aa0('0x38')]);_0x4940ae[_0x4aa0('0x3e')]=_['keys'](_0x596f38['query']);_0x4940ae['filters']=_[_0x4aa0('0x44')](_0x4940ae['model'],_0x4940ae['query']);_0x26b687['attributes']=_[_0x4aa0('0x44')](_0x4940ae[_0x4aa0('0x42')],qs[_0x4aa0('0x45')](_0x596f38[_0x4aa0('0x3e')][_0x4aa0('0x45')]));_0x26b687['attributes']=_0x26b687[_0x4aa0('0x46')][_0x4aa0('0x47')]?_0x26b687[_0x4aa0('0x46')]:_0x4940ae['model'];if(_0x596f38['query']['includeAll']){_0x26b687[_0x4aa0('0x48')]=[{'all':!![]}];}_0x26b687=_[_0x4aa0('0x31')]({},_0x26b687,_0x596f38[_0x4aa0('0x49')]);return db['ChatInteraction'][_0x4aa0('0x4a')](_0x26b687)[_0x4aa0('0x2b')](handleEntityNotFound(_0x4af8d8,null))[_0x4aa0('0x2b')](respondWithResult(_0x4af8d8,null))['catch'](handleError(_0x4af8d8,null));};exports[_0x4aa0('0x4b')]=function(_0xc3b5c3,_0x10b4f3){return db[_0x4aa0('0x37')][_0x4aa0('0x4b')](_0xc3b5c3[_0x4aa0('0x32')],{})[_0x4aa0('0x2b')](respondWithResult(_0x10b4f3,0xc9))[_0x4aa0('0x40')](handleError(_0x10b4f3,null));};exports['update']=function(_0x21d774,_0x27fe87){if(_0x21d774[_0x4aa0('0x32')]['id']){delete _0x21d774[_0x4aa0('0x32')]['id'];}return db[_0x4aa0('0x37')][_0x4aa0('0x4a')]({'where':{'id':_0x21d774[_0x4aa0('0x41')]['id']}})[_0x4aa0('0x2b')](handleEntityNotFound(_0x27fe87,null))['then'](saveUpdates(_0x21d774['body'],null))[_0x4aa0('0x2b')](respondWithResult(_0x27fe87,null))[_0x4aa0('0x40')](handleError(_0x27fe87,null));};exports[_0x4aa0('0x2c')]=function(_0x2f3985,_0x501f0c){return db['ChatInteraction'][_0x4aa0('0x4a')]({'where':{'id':_0x2f3985[_0x4aa0('0x41')]['id']}})[_0x4aa0('0x2b')](handleEntityNotFound(_0x501f0c,null))[_0x4aa0('0x2b')](removeEntity(_0x501f0c,null))[_0x4aa0('0x40')](handleError(_0x501f0c,null));};exports[_0x4aa0('0x4c')]=function(_0x5a0081,_0x5144af){return db[_0x4aa0('0x37')]['describe']()[_0x4aa0('0x2b')](respondWithResult(_0x5144af,null))[_0x4aa0('0x40')](handleError(_0x5144af,null));};exports['createVidaooSession']=function(_0x51eae3,_0x27c5cd){var _0x3133a2=_0x51eae3[_0x4aa0('0x41')]['id'];var _0x462429;var _0x465b6e;var _0x460a6a;return db[_0x4aa0('0x37')]['findOne']({'where':{'id':_0x3133a2}})[_0x4aa0('0x2b')](function(_0x5c05cb){_0x462429=_0x5c05cb;return db[_0x4aa0('0x4d')][_0x4aa0('0x4e')]({'where':{'id':_0x5c05cb['ChatWebsiteId']},'attributes':['id',_0x4aa0('0x4f'),_0x4aa0('0x50'),_0x4aa0('0x51'),_0x4aa0('0x52'),_0x4aa0('0x53')],'raw':!![]});})[_0x4aa0('0x2b')](function(_0x5b99a9){if(_0x5b99a9&&_0x5b99a9[_0x4aa0('0x4f')]&&_0x5b99a9[_0x4aa0('0x50')]){_0x465b6e=_0x5b99a9;var _0x84716a={'interaction':{'id':_0x3133a2},'agent':{'id':_0x51eae3[_0x4aa0('0x3f')]['id'],'name':_0x51eae3[_0x4aa0('0x3f')]['name'],'fullname':_0x51eae3['user'][_0x4aa0('0x54')],'email':_0x51eae3[_0x4aa0('0x3f')][_0x4aa0('0x55')]},'contact':_0x51eae3[_0x4aa0('0x32')][_0x4aa0('0x33')],'account':_0x51eae3[_0x4aa0('0x32')][_0x4aa0('0x35')]};var _0x4b96a1={'rejectUnauthorized':![],'method':_0x4aa0('0x56'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x5b99a9[_0x4aa0('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x51eae3[_0x4aa0('0x3f')][_0x4aa0('0x55')]],'buttons':null,'topic':_0x465b6e['vidaooTopic'],'note':_[_0x4aa0('0x57')](_0x465b6e[_0x4aa0('0x52')])?null:getMustacheRender(_0x465b6e[_0x4aa0('0x52')],_0x84716a),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x4aa0('0x57')](_0x465b6e['vidaooMetadata'])){var _0x4333d6=getMustacheRender(_0x465b6e['vidaooMetadata'],_0x84716a);var _0x1c9047=JSON['parse'](_0x4333d6);_0x4b96a1[_0x4aa0('0x32')][_0x4aa0('0x58')]=_0x1c9047;}}catch(_0x3c0e36){throw new db[(_0x4aa0('0x59'))][(_0x4aa0('0x5a'))](_0x4aa0('0x5b'));}return rp(_0x4b96a1);}else{throw new db[(_0x4aa0('0x59'))]['ValidationError'](_0x4aa0('0x5c'));}})[_0x4aa0('0x2b')](function(_0x5d49d3){_0x460a6a=_0x5d49d3;if(_0x460a6a['id']){var _0x5663a={'body':_0x460a6a[_0x4aa0('0x5d')],'ChatWebsiteId':_0x465b6e['id'],'ChatInteractionId':_0x462429['id'],'direction':_0x4aa0('0x5e'),'UserId':_0x51eae3['user']['id']};return db[_0x4aa0('0x5f')][_0x4aa0('0x4b')](_0x5663a,{});}else{throw new db['Sequelize'][(_0x4aa0('0x5a'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x462429['updateAttributes']({'vidaooSessionId':_0x460a6a['id']});})[_0x4aa0('0x2b')](respondWithResult(_0x27c5cd,null))[_0x4aa0('0x40')](handleError(_0x27c5cd,null));};exports[_0x4aa0('0x60')]=function(_0x22cb91,_0x491a96){if(_0x22cb91[_0x4aa0('0x32')]['id']){delete _0x22cb91[_0x4aa0('0x32')]['id'];}return db['ChatInteraction'][_0x4aa0('0x4a')]({'where':{'id':_0x22cb91[_0x4aa0('0x41')]['id']},'include':[{'model':db[_0x4aa0('0x61')],'as':_0x4aa0('0x62')}]})['then'](handleEntityNotFound(_0x491a96,null))[_0x4aa0('0x2b')](saveUpdates(_0x22cb91[_0x4aa0('0x32')],null))[_0x4aa0('0x2b')](respondWithResult(_0x491a96,null))[_0x4aa0('0x40')](handleError(_0x491a96,null));};exports[_0x4aa0('0x63')]=function(_0x30307f,_0xa6da62){if(_0x30307f[_0x4aa0('0x32')]['id']){delete _0x30307f[_0x4aa0('0x32')]['id'];}return db[_0x4aa0('0x37')][_0x4aa0('0x4a')]({'where':{'id':_0x30307f[_0x4aa0('0x41')]['id']}})[_0x4aa0('0x2b')](function(_0x489754){if(!_0x489754){logger[_0x4aa0('0x1d')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x4aa0('0x63'),0x194,_0x4aa0('0x64'));_0xa6da62[_0x4aa0('0x21')](0x194);}else{if(_0x489754['UserId']){throw new db['Sequelize'][(_0x4aa0('0x5a'))](_0x4aa0('0x65'));}}return _0x489754;})[_0x4aa0('0x2b')](function(_0xe7cd8c){if(_0xe7cd8c){return _0xe7cd8c[_0x4aa0('0x2a')]({'closed':_0x30307f[_0x4aa0('0x32')][_0x4aa0('0x66')],'disposition':_0x30307f[_0x4aa0('0x32')][_0x4aa0('0x67')]})[_0x4aa0('0x2b')](function(_0x3a5d36){return _0x3a5d36;});}})[_0x4aa0('0x2b')](function(){return respondWithRpcPromise('AbandonInteraction',_0x4aa0('0x63'),_0x30307f[_0x4aa0('0x32')],client9004);})[_0x4aa0('0x2b')](respondWithResult(_0xa6da62,null))[_0x4aa0('0x40')](handleError(_0xa6da62,null));};exports[_0x4aa0('0x68')]=function(_0x3b5232,_0x1f976e){_0x3b5232[_0x4aa0('0x32')][_0x4aa0('0x2e')]=_0x3b5232[_0x4aa0('0x69')][_0x4aa0('0x6a')];_0x3b5232['body']['basename']=_0x3b5232[_0x4aa0('0x69')][_0x4aa0('0x6b')];_0x3b5232[_0x4aa0('0x32')][_0x4aa0('0x3a')]=_0x3b5232['file'][_0x4aa0('0x6c')];return db[_0x4aa0('0x6d')][_0x4aa0('0x4b')](_0x3b5232['body'])[_0x4aa0('0x2b')](respondWithResult(_0x1f976e,0xc9))[_0x4aa0('0x40')](handleError(_0x1f976e,null));};exports[_0x4aa0('0x6e')]=function(_0x12c41a,_0x530f34){return db[_0x4aa0('0x37')][_0x4aa0('0x4e')]({'where':{'id':_0x12c41a[_0x4aa0('0x41')]['id']},'raw':!![]})[_0x4aa0('0x2b')](handleEntityNotFound(_0x530f34,null))[_0x4aa0('0x2b')](function(_0x520fe1){if(_0x520fe1){if(_0x520fe1[_0x4aa0('0x66')]){return _0x530f34[_0x4aa0('0x23')](0x193)[_0x4aa0('0x24')]({'status':0x193,'message':_0x4aa0('0x6f')});}return db[_0x4aa0('0x6d')][_0x4aa0('0x4e')]({'where':{'id':_0x12c41a[_0x4aa0('0x3e')][_0x4aa0('0x70')]},'raw':!![]})['then'](handleEntityNotFound(_0x530f34,null));}})[_0x4aa0('0x2b')](function(_0x1c7d5d){if(_0x1c7d5d){var _0x272a00=_0x1c7d5d['ChatOfflineMessageId']!==null;var _0x2cf9e9=path[_0x4aa0('0x71')](config[_0x4aa0('0x72')],_0x4aa0('0x73'));if(_0x272a00){_0x2cf9e9=path[_0x4aa0('0x71')](_0x2cf9e9,_0x4aa0('0x74'));}var _0x454a49=path['join'](_0x2cf9e9,_0x1c7d5d[_0x4aa0('0x75')]);return _0x530f34['download'](_0x454a49);}})[_0x4aa0('0x40')](handleError(_0x530f34,null));};exports[_0x4aa0('0x76')]=function(_0x419924,_0x3a5bce){var _0x31b48c=null;var _0x43195a=null;var _0x58bf79=null;if(_0x419924[_0x4aa0('0x32')]['id']){delete _0x419924[_0x4aa0('0x32')]['id'];}if(_0x419924[_0x4aa0('0x32')][_0x4aa0('0x77')]){_0x58bf79=path[_0x4aa0('0x71')](config[_0x4aa0('0x72')],_0x4aa0('0x78'),util[_0x4aa0('0x79')](_0x4aa0('0x7a'),Date['now']()));_0x419924[_0x4aa0('0x32')][_0x4aa0('0x7b')]=_0x58bf79;}return db[_0x4aa0('0x37')][_0x4aa0('0x4a')]({'where':{'id':_0x419924[_0x4aa0('0x41')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x4aa0('0x7c')],'as':'User'}]}]})['then'](handleEntityNotFound(_0x3a5bce,null))[_0x4aa0('0x2b')](saveUpdates(_0x419924[_0x4aa0('0x32')],null))[_0x4aa0('0x2b')](function(_0x2b0aaa){if(_0x2b0aaa){_0x31b48c=_0x2b0aaa;return db[_0x4aa0('0x4d')][_0x4aa0('0x4a')]({'where':{'id':_0x31b48c['ChatWebsiteId']}});}})[_0x4aa0('0x2b')](function(_0x2f5fd9){if(_0x2f5fd9){_0x43195a=_0x2f5fd9;return db['CmContact'][_0x4aa0('0x4a')]({'where':{'id':_0x31b48c['ContactId']}});}})['then'](function(_0xa1eb47){if(_0xa1eb47){if(_0x58bf79){var _0x2fe338=null;for(var _0x599399=0x1;_0x599399<_0x31b48c[_0x4aa0('0x7d')][_0x4aa0('0x47')];++_0x599399){_0x2fe338=_0x31b48c[_0x4aa0('0x7d')][_0x599399];var _0x9082d3=_0x2fe338['UserId']?util['format']('%s%d',_0x43195a[_0x4aa0('0x7e')],_0x2fe338[_0x4aa0('0x7f')]):_0x4aa0('0x80');var _0x1903da=_0x419924[_0x4aa0('0x32')][_0x4aa0('0x81')]||util[_0x4aa0('0x79')](_0x4aa0('0x82'),_0x4aa0('0x83'),_0x2fe338[_0x4aa0('0x84')]);switch(_0x43195a['agentIdentifier']){case _0x4aa0('0x85'):_0x9082d3=_0x2fe338[_0x4aa0('0x7f')]?util[_0x4aa0('0x79')]('%s%d',_0x43195a[_0x4aa0('0x7e')],_0x2fe338['UserId']):'System';break;case'agent_alias':_0x9082d3=_0x2fe338['UserId']?_0x2fe338[_0x4aa0('0x7c')][_0x4aa0('0x86')]||_0x2fe338[_0x4aa0('0x7c')][_0x4aa0('0x54')]:_0x4aa0('0x80');break;case _0x4aa0('0x87'):_0x9082d3=_0x2fe338[_0x4aa0('0x7f')]?_0x2fe338[_0x4aa0('0x7c')][_0x4aa0('0x54')]:_0x4aa0('0x80');break;default:_0x9082d3=_0x2fe338[_0x4aa0('0x7f')]?util[_0x4aa0('0x79')](_0x4aa0('0x82'),_0x43195a['agentAlias'],_0x2fe338[_0x4aa0('0x7f')]):_0x4aa0('0x80');}var _0x132948=util[_0x4aa0('0x79')](_0x4aa0('0x88'),moment(_0x2fe338[_0x4aa0('0x89')])['format'](_0x4aa0('0x8a')),_0x2fe338[_0x4aa0('0x8b')]==='in'?_0x1903da:_0x9082d3,_0x2fe338[_0x4aa0('0x32')]);if(!_0x2fe338['secret']){fs[_0x4aa0('0x8c')](_0x58bf79,_0x132948);}}return db[_0x4aa0('0x8d')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x4aa0('0x8e')],'as':_0x4aa0('0x8e'),'raw':!![]}]}]});}}})['then'](function(_0x3c52de){if(!_0x3c52de||!_0x3c52de[_0x4aa0('0x8f')]||!_0x419924[_0x4aa0('0x32')])return _0x31b48c;var _0x38d360=_0x3c52de['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x4aa0('0x90'),{'account':_0x38d360,'message':{'from':util[_0x4aa0('0x79')]('\x22%s\x22\x20<%s>',_0x3c52de[_0x4aa0('0x2e')],_0x3c52de['email']||_0x3c52de[_0x4aa0('0x8f')][_0x4aa0('0x3f')]),'to':_0x419924[_0x4aa0('0x32')]['mailTranscript'],'subject':_0x4aa0('0x91'),'text':util[_0x4aa0('0x79')](_0x4aa0('0x92'),_0x419924['body'][_0x4aa0('0x77')]),'attachments':[{'path':_0x58bf79}]}})[_0x4aa0('0x2b')](function(){return _0x31b48c;})['catch'](function(_0x12f86e){logger['error'](_0x12f86e);});})[_0x4aa0('0x2b')](respondWithStatusCode(_0x3a5bce,0xc8))[_0x4aa0('0x40')](handleError(_0x3a5bce,null));};exports[_0x4aa0('0x93')]=function(_0x7c69c0,_0x4ff4a1){return db['ChatMessage'][_0x4aa0('0x4a')]({'where':{'id':_0x7c69c0[_0x4aa0('0x41')]['id']}})[_0x4aa0('0x2b')](handleEntityNotFound(_0x4ff4a1,null))[_0x4aa0('0x2b')](function(_0x164398){if(_0x164398){return _0x164398['addMessage'](_0x7c69c0[_0x4aa0('0x32')][_0x4aa0('0x94')],_[_0x4aa0('0x95')](_0x7c69c0['body'],['ids','id'])||{});}})[_0x4aa0('0x2b')](respondWithResult(_0x4ff4a1,null))[_0x4aa0('0x40')](handleError(_0x4ff4a1,null));};exports[_0x4aa0('0x96')]=function(_0xe8ac8,_0x4fbee1){var _0x531662={'raw':![],'where':{}};var _0x12a077={};var _0x23d36b={'count':0x0,'rows':[]};return db[_0x4aa0('0x37')][_0x4aa0('0x4e')]({'where':{'id':_0xe8ac8[_0x4aa0('0x41')]['id']}})[_0x4aa0('0x2b')](handleEntityNotFound(_0x4fbee1,null))[_0x4aa0('0x2b')](function(_0x456647){if(_0x456647){_0x12a077[_0x4aa0('0x42')]=_['keys'](db[_0x4aa0('0x5f')][_0x4aa0('0x38')]);_0x12a077[_0x4aa0('0x3e')]=_[_0x4aa0('0x43')](_0xe8ac8[_0x4aa0('0x3e')]);_0x12a077['filters']=_[_0x4aa0('0x44')](_0x12a077[_0x4aa0('0x42')],_0x12a077[_0x4aa0('0x3e')]);_0x531662[_0x4aa0('0x46')]=_[_0x4aa0('0x44')](_0x12a077[_0x4aa0('0x42')],qs[_0x4aa0('0x45')](_0xe8ac8[_0x4aa0('0x3e')][_0x4aa0('0x45')]));_0x531662['attributes']=_0x531662[_0x4aa0('0x46')][_0x4aa0('0x47')]?_0x531662[_0x4aa0('0x46')]:_0x12a077[_0x4aa0('0x42')];if(!_0xe8ac8['query'][_0x4aa0('0x97')](_0x4aa0('0x98'))){_0x531662[_0x4aa0('0x27')]=qs[_0x4aa0('0x27')](_0xe8ac8['query'][_0x4aa0('0x27')]);_0x531662[_0x4aa0('0x25')]=qs[_0x4aa0('0x25')](_0xe8ac8[_0x4aa0('0x3e')]['offset']);}_0x531662[_0x4aa0('0x99')]=qs[_0x4aa0('0x9a')](_0xe8ac8[_0x4aa0('0x3e')]['sort']);_0x531662[_0x4aa0('0x9b')]=qs['filters'](_[_0x4aa0('0x9c')](_0xe8ac8[_0x4aa0('0x3e')],_0x12a077[_0x4aa0('0x9d')]));_0x531662['where'][_0x4aa0('0x9e')]=_0x456647['id'];if(_0xe8ac8[_0x4aa0('0x3e')]['filter']){_0x531662[_0x4aa0('0x9b')]=_[_0x4aa0('0x31')](_0x531662[_0x4aa0('0x9b')],{'$or':_[_0x4aa0('0x36')](_0x531662[_0x4aa0('0x46')],function(_0x4fc716){var _0x37e99f={};_0x37e99f[_0x4fc716]={'$like':'%'+_0xe8ac8[_0x4aa0('0x3e')][_0x4aa0('0x9f')]+'%'};return _0x37e99f;})});}if(_0xe8ac8[_0x4aa0('0x3e')][_0x4aa0('0xa0')]){var _0x4182de=_0xe8ac8[_0x4aa0('0x3e')][_0x4aa0('0xa0')][_0x4aa0('0xa1')](',');var _0x5791bc={};_0x5791bc[_0x4182de[0x0]]={'$gte':moment(_0x4182de[0x1])[_0x4aa0('0x79')](_0x4aa0('0xa2'))};_0x531662['where']=_['merge'](_0x531662[_0x4aa0('0x9b')],_0x5791bc);}_0x531662=_[_0x4aa0('0x31')]({},_0x531662,_0xe8ac8[_0x4aa0('0x49')]);return db['ChatMessage'][_0x4aa0('0x28')]({'where':_0x531662[_0x4aa0('0x9b')]})[_0x4aa0('0x2b')](function(_0x41f542){_0x23d36b[_0x4aa0('0x28')]=_0x41f542;if(_0xe8ac8[_0x4aa0('0x3e')][_0x4aa0('0xa3')]){_0x531662['include']=[{'all':!![]}];}return db['ChatMessage'][_0x4aa0('0x3c')](_0x531662);})['then'](function(_0x368692){_0x23d36b[_0x4aa0('0xa4')]=_0x368692;return _0x23d36b;});}})['then'](respondWithFilteredResult(_0x4fbee1,_0x531662))[_0x4aa0('0x40')](handleError(_0x4fbee1,null));};exports[_0x4aa0('0xa5')]=function(_0x56c58a,_0x3735c7){var _0xf7be16={'where':{}},_0x55f04b={},_0x1c8d8e={'count':0x0,'rows':[]};return db[_0x4aa0('0x37')][_0x4aa0('0x4e')]({'where':{'id':_0x56c58a[_0x4aa0('0x41')]['id']}})['then'](handleEntityNotFound(_0x3735c7,null))[_0x4aa0('0x2b')](function(_0x3c732b){if(_0x3c732b){_0x55f04b[_0x4aa0('0x42')]=_['keys'](db[_0x4aa0('0x5f')][_0x4aa0('0x38')]);_0x55f04b[_0x4aa0('0x3e')]=_['keys'](_0x56c58a[_0x4aa0('0x3e')]);_0x55f04b[_0x4aa0('0x9d')]=_[_0x4aa0('0x44')](_0x55f04b[_0x4aa0('0x42')],_0x55f04b[_0x4aa0('0x3e')]);_0xf7be16[_0x4aa0('0x46')]=_['intersection'](_0x55f04b['model'],qs[_0x4aa0('0x45')](_0x56c58a[_0x4aa0('0x3e')][_0x4aa0('0x45')]));_0xf7be16[_0x4aa0('0x46')]=_0xf7be16[_0x4aa0('0x46')]['length']?_0xf7be16['attributes']:_0x55f04b[_0x4aa0('0x42')];if(!_0x56c58a[_0x4aa0('0x3e')]['hasOwnProperty'](_0x4aa0('0x98'))){_0xf7be16['limit']=qs[_0x4aa0('0x27')](_0x56c58a[_0x4aa0('0x3e')][_0x4aa0('0x27')]);_0xf7be16[_0x4aa0('0x25')]=qs[_0x4aa0('0x25')](_0x56c58a[_0x4aa0('0x3e')][_0x4aa0('0x25')]);}_0xf7be16['order']=qs['sort'](_0x56c58a[_0x4aa0('0x3e')]['sort']);_0xf7be16[_0x4aa0('0x9b')]=qs[_0x4aa0('0x9d')](_['pick'](_0x56c58a[_0x4aa0('0x3e')],_0x55f04b[_0x4aa0('0x9d')]));_0xf7be16[_0x4aa0('0x9b')][_0x4aa0('0x9e')]=_0x3c732b['id'];if(_0x56c58a[_0x4aa0('0x3e')]['filter']){_0xf7be16['where']=_[_0x4aa0('0x31')](_0xf7be16[_0x4aa0('0x9b')],{'$or':_['map'](_0xf7be16[_0x4aa0('0x46')],function(_0x24018a){var _0x40f347={};_0x40f347[_0x24018a]={'$like':'%'+_0x56c58a[_0x4aa0('0x3e')][_0x4aa0('0x9f')]+'%'};return _0x40f347;})});}_0xf7be16[_0x4aa0('0x9b')][_0x4aa0('0xa6')]=![];if(_0x56c58a[_0x4aa0('0x3e')]['id']){_0xf7be16['where']['id']={'$gt':_0x56c58a['query']['id']};}_0xf7be16=_['merge']({},_0xf7be16,_0x56c58a['options']);return db[_0x4aa0('0x5f')][_0x4aa0('0x28')]({'where':_0xf7be16['where']})[_0x4aa0('0x2b')](function(_0x24a69d){_0x1c8d8e[_0x4aa0('0x28')]=_0x24a69d;_0xf7be16['include']=[];if(_0x56c58a['query'][_0x4aa0('0xa7')]){_0xf7be16[_0x4aa0('0x48')]['push']({'model':db[_0x4aa0('0x7c')],'as':_0x4aa0('0x7c'),'attributes':['id',_0x4aa0('0x54'),_0x4aa0('0x86')]});}if(_0x56c58a[_0x4aa0('0x3e')][_0x4aa0('0xa3')]){_0xf7be16[_0x4aa0('0x48')]=[{'all':!![]}];}return db['ChatMessage'][_0x4aa0('0x3c')](_0xf7be16);})[_0x4aa0('0x2b')](function(_0x1bf7f7){_0x1c8d8e['rows']=_0x1bf7f7;return _0x1c8d8e;});}})[_0x4aa0('0x2b')](respondWithFilteredResult(_0x3735c7,_0xf7be16))[_0x4aa0('0x40')](handleError(_0x3735c7,null));};exports[_0x4aa0('0xa8')]=function(_0x1fea65,_0x2c54a7){return db[_0x4aa0('0x37')][_0x4aa0('0x4a')]({'where':{'id':_0x1fea65[_0x4aa0('0x41')]['id']}})[_0x4aa0('0x2b')](handleEntityNotFound(_0x2c54a7,null))['then'](function(_0x447725){if(_0x447725){return _0x447725[_0x4aa0('0xa9')](_0x1fea65[_0x4aa0('0x32')][_0x4aa0('0x94')],_[_0x4aa0('0x95')](_0x1fea65[_0x4aa0('0x32')],[_0x4aa0('0x94'),'id'])||{})[_0x4aa0('0xaa')](function(){return db[_0x4aa0('0xab')]['findAll']({'attributes':['id',_0x4aa0('0x2e'),_0x4aa0('0xac')],'where':{'id':_0x1fea65[_0x4aa0('0x32')][_0x4aa0('0x94')]}});})[_0x4aa0('0x2b')](function(_0x1436d0){socket[_0x4aa0('0xad')]('chatInteractionTags:save',{'id':Number(_0x1fea65[_0x4aa0('0x41')]['id']),'tags':_0x1436d0||[]});return{'id':Number(_0x1fea65['params']['id']),'tags':_0x1436d0||[]};});}})[_0x4aa0('0x2b')](respondWithResult(_0x2c54a7,null))[_0x4aa0('0x40')](handleError(_0x2c54a7,null));};exports[_0x4aa0('0xae')]=function(_0xb436e2,_0x1b3925){return db[_0x4aa0('0x37')]['find']({'where':{'id':_0xb436e2['params']['id']}})[_0x4aa0('0x2b')](handleEntityNotFound(_0x1b3925,null))[_0x4aa0('0x2b')](function(_0x265b81){if(_0x265b81){return _0x265b81[_0x4aa0('0xae')](_0xb436e2[_0x4aa0('0x3e')][_0x4aa0('0x94')]);}})['then'](respondWithStatusCode(_0x1b3925,null))[_0x4aa0('0x40')](handleError(_0x1b3925,null));};exports[_0x4aa0('0xaf')]=function(_0x3c3d34,_0x433faa){var _0x4ac2c4=moment()[_0x4aa0('0xb0')]()['toString']();var _0x26b8b1=path[_0x4aa0('0x71')](config[_0x4aa0('0x72')],_0x4aa0('0xb1'),_0x4aa0('0xb2'),_0x4aa0('0xb3'));var _0x38c550=path[_0x4aa0('0x71')](config[_0x4aa0('0x72')],_0x4aa0('0xb1'),_0x4aa0('0xb2'),'attachments');var _0x2ecb82=path[_0x4aa0('0x71')](_0x26b8b1,_0x4ac2c4);var _0x114be1=util[_0x4aa0('0x79')](_0x4aa0('0xb4'),_0x3c3d34[_0x4aa0('0x41')]['id'],_0x4ac2c4);var _0x248dbc=path[_0x4aa0('0x71')](_0x26b8b1,_0x114be1);var _0x4c3bc5=[];_0x4c3bc5[_0x4aa0('0xb5')]({'model':db['User'],'as':_0x4aa0('0x7c'),'attributes':['id',_0x4aa0('0x54')],'raw':!![]});_0x4c3bc5[_0x4aa0('0xb5')]({'model':db['CmContact'],'as':_0x4aa0('0x62'),'attributes':['id',_0x4aa0('0xb6'),_0x4aa0('0xb7')],'raw':!![]});if(_0x3c3d34[_0x4aa0('0x3e')][_0x4aa0('0xb8')]){_0x4c3bc5[_0x4aa0('0xb5')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0xd36fde=[{'model':db['ChatMessage'],'as':_0x4aa0('0x7d'),'attributes':['id',_0x4aa0('0x32'),_0x4aa0('0x89'),'direction',_0x4aa0('0xa6'),_0x4aa0('0xb9')],'include':_0x4c3bc5}];_0xd36fde[_0x4aa0('0xb5')]({'model':db['ChatWebsite'],'as':_0x4aa0('0xba'),'attributes':['id',_0x4aa0('0x2e')]});_0xd36fde['push']({'model':db['User'],'as':_0x4aa0('0xbb'),'attributes':['id',_0x4aa0('0x54')]});return db[_0x4aa0('0x37')][_0x4aa0('0x4a')]({'where':{'id':_0x3c3d34['params']['id']},'include':_0xd36fde})[_0x4aa0('0x2b')](handleEntityNotFound(_0x433faa,null))[_0x4aa0('0x2b')](function(_0x17ac27){if(_0x17ac27){var _0x1977e5=_0x17ac27[_0x4aa0('0xbc')]({'plain':!![]});fs[_0x4aa0('0xbd')](_0x2ecb82);var _0x1cf702={'channel':_0x4aa0('0xbe'),'account':_0x1977e5[_0x4aa0('0xba')]['name'],'agent':_0x1977e5[_0x4aa0('0xbb')]?_0x1977e5['Owner'][_0x4aa0('0x54')]:_0x4aa0('0xbf'),'createdAt':moment(_0x1977e5[_0x4aa0('0x89')])[_0x4aa0('0x79')](_0x4aa0('0xa2'))[_0x4aa0('0xc0')](),'closedAt':_0x1977e5[_0x4aa0('0x66')]?moment(_0x1977e5['closedAt'])['format'](_0x4aa0('0xa2'))['toString']():'','disposition':_0x1977e5['disposition'],'chatInfo':{'browser':_0x1977e5[_0x4aa0('0xc1')],'os':_0x1977e5[_0x4aa0('0xc2')],'referer':_0x1977e5[_0x4aa0('0xc3')],'customerIp':_0x1977e5['customerIp'],'customerPort':_0x1977e5[_0x4aa0('0xc4')]?_0x1977e5['customerPort']:'N.A.'},'messages':_(_0x1977e5['Messages'])[_0x4aa0('0xc5')]()[_0x4aa0('0x9f')]({'secret':![]})[_0x4aa0('0x36')](function(_0x16efef){if(_0x16efef['Attachment']){var _0x4f323b=path['join'](_0x38c550,_0x16efef['Attachment']['basename']);if(fs['existsSync'](_0x4f323b)){fs[_0x4aa0('0xc6')](_0x4f323b)[_0x4aa0('0xc7')](fs[_0x4aa0('0xc8')](path[_0x4aa0('0x71')](_0x2ecb82,_0x16efef[_0x4aa0('0x6d')]['basename'])));}}return{'date':moment(_0x16efef[_0x4aa0('0x89')])[_0x4aa0('0x79')](_0x4aa0('0xa2'))[_0x4aa0('0xc0')](),'sender':_0x16efef[_0x4aa0('0x8b')]===_0x4aa0('0x5e')?_0x16efef[_0x4aa0('0x7c')]?_0x16efef[_0x4aa0('0x7c')][_0x4aa0('0x54')]:_0x4aa0('0x80'):_0x16efef[_0x4aa0('0x62')][_0x4aa0('0xb6')]+(_0x16efef[_0x4aa0('0x62')][_0x4aa0('0xb7')]?'\x20'+_0x16efef['Contact'][_0x4aa0('0xb7')]:''),'body':_0x16efef['Attachment']?_0x16efef[_0x4aa0('0x6d')][_0x4aa0('0x75')]:_0x16efef[_0x4aa0('0x32')],'direction':_0x16efef[_0x4aa0('0x8b')]===_0x4aa0('0x5e')?'A':'C','secret':_0x16efef['secret'],'read':_0x16efef[_0x4aa0('0xb9')],'attachment':_0x16efef[_0x4aa0('0x6d')]};})[_0x4aa0('0xc9')]()};return ejs[_0x4aa0('0xca')](path[_0x4aa0('0x71')](config[_0x4aa0('0x72')],_0x4aa0('0xb1'),_0x4aa0('0xcb'),'downloadInteraction.ejs'),{'interaction':_0x1cf702})[_0x4aa0('0x2b')](function(_0x20d5b4){var _0x1969c4=path[_0x4aa0('0x71')](_0x2ecb82,_0x4aa0('0xcc')+_0x1977e5['id']+'-'+_0x4ac2c4+_0x4aa0('0xcd'));var _0x5adb35={'path':_0x1969c4,'channel':_0x4aa0('0xbe'),'interactionId':_0x1977e5['id']};return pdf[_0x4aa0('0xce')](_0x20d5b4,_0x5adb35);})[_0x4aa0('0x2b')](function(){return new Promise(function(_0x4b9996,_0x308d36){zipdir(_0x2ecb82,{'saveTo':_0x248dbc},function(_0x26b173,_0x4848ec){if(_0x26b173)return _0x308d36(_0x26b173);return _0x4b9996(_0x4848ec);});})[_0x4aa0('0x2b')](function(){return new BPromise(function(_0x2cda69,_0x2b2ac7){rimraf(_0x2ecb82,function(_0x86eb8e){if(_0x86eb8e)_0x2b2ac7(_0x86eb8e);return _0x2cda69();});});})['then'](function(){return _0x433faa[_0x4aa0('0xaf')](_0x248dbc,_0x114be1,function(_0x4aadc5){if(_0x4aadc5){logger['error'](_0x4aa0('0xcf'),_0x4aadc5);}else{fs[_0x4aa0('0xd0')](_0x248dbc);}});});});}else{return _0x433faa[_0x4aa0('0x21')](0xc8);}})[_0x4aa0('0x40')](handleError(_0x433faa,null));}; \ No newline at end of file +var _0x8553=['ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','type','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','length','agentAlias','System','customer','%s%d','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','hasOwnProperty','nolimit','sort','where','pick','ChatInteractionId','filter','$gte','split','findAll','getMyMessages','order','includeAgent','rows','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','transcript-%d-%s.zip','push','firstName','lastName','attachments','read','Owner','get','mkdirSync','N.A.','toString','closedAt','YYYY-MM-DD\x20HH:mm:ss','osName','referer','customerIp','customerPort','tail','existsSync','out','secret','renderFile','views','downloadInteraction.ejs','.pdf','Chat','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','path','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','ChatInteraction,\x20%s,\x20%s','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','send','render','body','agent','interaction','account','map','ChatInteraction','rawAttributes','fieldName','key','getOptions','chat','query','user','show','params','model','keys','filters','intersection','fields','attributes','includeAll','include','merge','options','create','find','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','name','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url'];(function(_0x307e32,_0x292b7d){var _0x2fcc03=function(_0x5e43fb){while(--_0x5e43fb){_0x307e32['push'](_0x307e32['shift']());}};_0x2fcc03(++_0x292b7d);}(_0x8553,0x14b));var _0x3855=function(_0x212e46,_0x43365e){_0x212e46=_0x212e46-0x0;var _0x58ec67=_0x8553[_0x212e46];return _0x58ec67;};'use strict';var rimraf=require(_0x3855('0x0'));var zipdir=require(_0x3855('0x1'));var rp=require(_0x3855('0x2'));var moment=require(_0x3855('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3855('0x4'));var util=require('util');var path=require(_0x3855('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3855('0x6'));var Redis=require(_0x3855('0x7'));var interaction=require(_0x3855('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0x3855('0x9'));var logger=require(_0x3855('0xa'))(_0x3855('0xb'));var config=require(_0x3855('0xc'));var db=require(_0x3855('0xd'))['db'];config[_0x3855('0xe')]=_[_0x3855('0xf')](config['redis'],{'host':_0x3855('0x10'),'port':0x18eb});var socket=require(_0x3855('0x11'))(new Redis(config[_0x3855('0xe')]));require(_0x3855('0x12'))[_0x3855('0x13')](socket);var jayson=require(_0x3855('0x14'));var client=jayson['client'][_0x3855('0x15')]({'port':0x232b});var client9004=jayson['client'][_0x3855('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x5a8b80,_0x12cb42,_0x32a0c8,_0x45a9b7){return new BPromise(function(_0x1929f2,_0x3a78d1){var _0x4a8208=_0x45a9b7||client;return _0x4a8208[_0x3855('0x16')](_0x5a8b80,_0x32a0c8)[_0x3855('0x17')](function(_0x366056){logger[_0x3855('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x12cb42,_0x3855('0x19'));logger[_0x3855('0x1a')](_0x3855('0x1b'),_0x12cb42,'request\x20sent',JSON['stringify'](_0x366056));if(_0x366056[_0x3855('0x1c')]){if(_0x366056[_0x3855('0x1c')][_0x3855('0x1d')]===0x1f4){logger[_0x3855('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x12cb42,_0x366056[_0x3855('0x1c')][_0x3855('0x1e')]);return _0x3a78d1(_0x366056['error']['message']);}logger[_0x3855('0x1c')](_0x3855('0x1f'),_0x12cb42,_0x366056['error']['message']);return _0x1929f2(_0x366056[_0x3855('0x1c')]['message']);}else{logger[_0x3855('0x18')](_0x3855('0x1f'),_0x12cb42,_0x3855('0x19'));_0x1929f2(_0x366056[_0x3855('0x20')]['message']);}})[_0x3855('0x21')](function(_0x58b38e){logger['error'](_0x3855('0x1f'),_0x12cb42,_0x58b38e);_0x3a78d1(_0x58b38e);});});}function respondWithStatusCode(_0x1f1a80,_0x2b0fdb){_0x2b0fdb=_0x2b0fdb||0xcc;return function(_0x4cbf13){if(_0x4cbf13){return _0x1f1a80['sendStatus'](_0x2b0fdb);}return _0x1f1a80['status'](_0x2b0fdb)[_0x3855('0x22')]();};}function respondWithResult(_0x24e9e8,_0x544e36){_0x544e36=_0x544e36||0xc8;return function(_0x435cc9){if(_0x435cc9){return _0x24e9e8[_0x3855('0x23')](_0x544e36)[_0x3855('0x24')](_0x435cc9);}};}function respondWithFilteredResult(_0x4ed6c6,_0x4e1e22){return function(_0x4bdcce){if(_0x4bdcce){var _0xe1f887=typeof _0x4e1e22[_0x3855('0x25')]===_0x3855('0x26')&&typeof _0x4e1e22[_0x3855('0x27')]==='undefined';var _0x536180=_0x4bdcce['count'];var _0x38e9a8=_0xe1f887?0x0:_0x4e1e22[_0x3855('0x25')];var _0x46cc5c=_0xe1f887?_0x4bdcce[_0x3855('0x28')]:_0x4e1e22[_0x3855('0x25')]+_0x4e1e22[_0x3855('0x27')];var _0x306e9e;if(_0x46cc5c>=_0x536180){_0x46cc5c=_0x536180;_0x306e9e=0xc8;}else{_0x306e9e=0xce;}_0x4ed6c6['status'](_0x306e9e);return _0x4ed6c6[_0x3855('0x29')](_0x3855('0x2a'),_0x38e9a8+'-'+_0x46cc5c+'/'+_0x536180)['json'](_0x4bdcce);}return null;};}function saveUpdates(_0x14d422){return function(_0x4345bd){if(_0x4345bd){return _0x4345bd[_0x3855('0x2b')](_0x14d422)['then'](function(_0x52d2eb){return _0x52d2eb;});}return null;};}function removeEntity(_0x436bdb){return function(_0x2cc89b){if(_0x2cc89b){return _0x2cc89b[_0x3855('0x2c')]()[_0x3855('0x17')](function(){_0x436bdb[_0x3855('0x23')](0xcc)[_0x3855('0x22')]();});}};}function handleEntityNotFound(_0x52eadb){return function(_0x596558){if(!_0x596558){_0x52eadb['sendStatus'](0x194);}return _0x596558;};}function handleError(_0x2d23f3,_0x5547a6){_0x5547a6=_0x5547a6||0x1f4;return function(_0x28f6f7){logger[_0x3855('0x1c')](_0x28f6f7[_0x3855('0x2d')]);if(_0x28f6f7['name']){delete _0x28f6f7['name'];}_0x2d23f3[_0x3855('0x23')](_0x5547a6)[_0x3855('0x2e')](_0x28f6f7);};}function getMustacheRender(_0x2c7e42,_0x35362e){return Mustache[_0x3855('0x2f')](_0x2c7e42,_['merge'](_0x35362e[_0x3855('0x30')],{'contact':_0x35362e['contact'],'message':_0x35362e[_0x3855('0x1e')],'agent':_0x35362e[_0x3855('0x31')],'interaction':_0x35362e[_0x3855('0x32')],'account':_0x35362e[_0x3855('0x33')]}))||'';}exports['index']=function(_0x570c95,_0x15e573){var _0x1abefa={};var _0x40bf0c=_[_0x3855('0x34')](db[_0x3855('0x35')][_0x3855('0x36')],function(_0x2d4516){return{'name':_0x2d4516[_0x3855('0x37')],'type':_0x2d4516['type'][_0x3855('0x38')]};});_0x1abefa=qs[_0x3855('0x39')](_0x40bf0c,_0x570c95);return interaction['findAll'](_0x3855('0x3a'),_0x570c95[_0x3855('0x3b')],_0x570c95[_0x3855('0x3c')],_0x1abefa,_0x40bf0c)[_0x3855('0x17')](respondWithFilteredResult(_0x15e573,_0x1abefa))[_0x3855('0x21')](handleError(_0x15e573,null));};exports[_0x3855('0x3d')]=function(_0x3a0db2,_0x231221){var _0x9c29f5={'raw':![],'where':{'id':_0x3a0db2[_0x3855('0x3e')]['id']}},_0x158fd8={};_0x158fd8[_0x3855('0x3f')]=_['keys'](db[_0x3855('0x35')][_0x3855('0x36')]);_0x158fd8[_0x3855('0x3b')]=_[_0x3855('0x40')](_0x3a0db2[_0x3855('0x3b')]);_0x158fd8[_0x3855('0x41')]=_[_0x3855('0x42')](_0x158fd8[_0x3855('0x3f')],_0x158fd8['query']);_0x9c29f5['attributes']=_[_0x3855('0x42')](_0x158fd8[_0x3855('0x3f')],qs[_0x3855('0x43')](_0x3a0db2[_0x3855('0x3b')][_0x3855('0x43')]));_0x9c29f5['attributes']=_0x9c29f5['attributes']['length']?_0x9c29f5[_0x3855('0x44')]:_0x158fd8[_0x3855('0x3f')];if(_0x3a0db2[_0x3855('0x3b')][_0x3855('0x45')]){_0x9c29f5[_0x3855('0x46')]=[{'all':!![]}];}_0x9c29f5=_[_0x3855('0x47')]({},_0x9c29f5,_0x3a0db2[_0x3855('0x48')]);return db[_0x3855('0x35')]['find'](_0x9c29f5)['then'](handleEntityNotFound(_0x231221,null))[_0x3855('0x17')](respondWithResult(_0x231221,null))['catch'](handleError(_0x231221,null));};exports[_0x3855('0x49')]=function(_0x37ef0b,_0x1ba697){return db['ChatInteraction'][_0x3855('0x49')](_0x37ef0b[_0x3855('0x30')],{})[_0x3855('0x17')](respondWithResult(_0x1ba697,0xc9))[_0x3855('0x21')](handleError(_0x1ba697,null));};exports[_0x3855('0x2b')]=function(_0xa3e654,_0x5dd3c9){if(_0xa3e654[_0x3855('0x30')]['id']){delete _0xa3e654[_0x3855('0x30')]['id'];}return db[_0x3855('0x35')][_0x3855('0x4a')]({'where':{'id':_0xa3e654[_0x3855('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5dd3c9,null))[_0x3855('0x17')](saveUpdates(_0xa3e654[_0x3855('0x30')],null))[_0x3855('0x17')](respondWithResult(_0x5dd3c9,null))[_0x3855('0x21')](handleError(_0x5dd3c9,null));};exports[_0x3855('0x2c')]=function(_0x198437,_0x13bf4f){return db[_0x3855('0x35')]['find']({'where':{'id':_0x198437['params']['id']}})[_0x3855('0x17')](handleEntityNotFound(_0x13bf4f,null))[_0x3855('0x17')](removeEntity(_0x13bf4f,null))[_0x3855('0x21')](handleError(_0x13bf4f,null));};exports[_0x3855('0x4b')]=function(_0x5aa073,_0xd70348){return db[_0x3855('0x35')][_0x3855('0x4b')]()[_0x3855('0x17')](respondWithResult(_0xd70348,null))[_0x3855('0x21')](handleError(_0xd70348,null));};exports[_0x3855('0x4c')]=function(_0x316335,_0x356705){var _0x56b5d5=_0x316335[_0x3855('0x3e')]['id'];var _0x9bb178;var _0x12c8e1;var _0xa24c71;return db['ChatInteraction'][_0x3855('0x4d')]({'where':{'id':_0x56b5d5}})[_0x3855('0x17')](function(_0x298144){_0x9bb178=_0x298144;return db[_0x3855('0x4e')][_0x3855('0x4d')]({'where':{'id':_0x298144[_0x3855('0x4f')]},'attributes':['id',_0x3855('0x50'),_0x3855('0x51'),'vidaooTopic',_0x3855('0x52'),_0x3855('0x53')],'raw':!![]});})['then'](function(_0x2f0c15){if(_0x2f0c15&&_0x2f0c15['vidaooApiKey']&&_0x2f0c15['vidaooEscalation']){_0x12c8e1=_0x2f0c15;var _0x1f918d={'interaction':{'id':_0x56b5d5},'agent':{'id':_0x316335['user']['id'],'name':_0x316335['user'][_0x3855('0x54')],'fullname':_0x316335[_0x3855('0x3c')][_0x3855('0x55')],'email':_0x316335[_0x3855('0x3c')][_0x3855('0x56')]},'contact':_0x316335[_0x3855('0x30')]['contact'],'account':_0x316335[_0x3855('0x30')]['account']};var _0x4b07f8={'rejectUnauthorized':![],'method':'POST','url':_0x3855('0x57'),'headers':{'X-APIKEY':_0x2f0c15[_0x3855('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x316335[_0x3855('0x3c')]['email']],'buttons':null,'topic':_0x12c8e1[_0x3855('0x58')],'note':_['isNull'](_0x12c8e1[_0x3855('0x52')])?null:getMustacheRender(_0x12c8e1[_0x3855('0x52')],_0x1f918d),'metadata':null},'redirect':_0x3855('0x59'),'json':!![]};try{if(!_[_0x3855('0x5a')](_0x12c8e1[_0x3855('0x53')])){var _0x750581=getMustacheRender(_0x12c8e1[_0x3855('0x53')],_0x1f918d);var _0x25a581=JSON[_0x3855('0x5b')](_0x750581);_0x4b07f8[_0x3855('0x30')][_0x3855('0x5c')]=_0x25a581;}}catch(_0x5775ee){throw new db[(_0x3855('0x5d'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x4b07f8);}else{throw new db[(_0x3855('0x5d'))][(_0x3855('0x5e'))](_0x3855('0x5f'));}})[_0x3855('0x17')](function(_0x1cf80a){_0xa24c71=_0x1cf80a;if(_0xa24c71['id']){var _0x2c783e={'body':_0xa24c71[_0x3855('0x60')],'ChatWebsiteId':_0x12c8e1['id'],'ChatInteractionId':_0x9bb178['id'],'direction':'out','UserId':_0x316335['user']['id']};return db[_0x3855('0x61')]['create'](_0x2c783e,{});}else{throw new db[(_0x3855('0x5d'))][(_0x3855('0x5e'))](_0x3855('0x62'));}})['then'](function(){return _0x9bb178[_0x3855('0x63')]({'vidaooSessionId':_0xa24c71['id']});})[_0x3855('0x17')](respondWithResult(_0x356705,null))[_0x3855('0x21')](handleError(_0x356705,null));};exports['customUpdate']=function(_0x4cc54b,_0x60858f){if(_0x4cc54b[_0x3855('0x30')]['id']){delete _0x4cc54b[_0x3855('0x30')]['id'];}return db['ChatInteraction'][_0x3855('0x4a')]({'where':{'id':_0x4cc54b[_0x3855('0x3e')]['id']},'include':[{'model':db[_0x3855('0x64')],'as':_0x3855('0x65')}]})[_0x3855('0x17')](handleEntityNotFound(_0x60858f,null))[_0x3855('0x17')](saveUpdates(_0x4cc54b[_0x3855('0x30')],null))['then'](respondWithResult(_0x60858f,null))[_0x3855('0x21')](handleError(_0x60858f,null));};exports[_0x3855('0x66')]=function(_0x5c9b94,_0x2ecbd9){if(_0x5c9b94[_0x3855('0x30')]['id']){delete _0x5c9b94['body']['id'];}return db[_0x3855('0x35')][_0x3855('0x4a')]({'where':{'id':_0x5c9b94[_0x3855('0x3e')]['id']}})['then'](function(_0x3a6edc){if(!_0x3a6edc){logger[_0x3855('0x1c')](_0x3855('0x67'),_0x3855('0x66'),0x194,_0x3855('0x68'));_0x2ecbd9[_0x3855('0x69')](0x194);}else{if(_0x3a6edc[_0x3855('0x6a')]){throw new db['Sequelize'][(_0x3855('0x5e'))](_0x3855('0x6b'));}}return _0x3a6edc;})[_0x3855('0x17')](function(_0x31d24d){if(_0x31d24d){return _0x31d24d[_0x3855('0x2b')]({'closed':_0x5c9b94[_0x3855('0x30')][_0x3855('0x6c')],'disposition':_0x5c9b94[_0x3855('0x30')][_0x3855('0x6d')]})[_0x3855('0x17')](function(_0x37156a){return _0x37156a;});}})[_0x3855('0x17')](function(){return respondWithRpcPromise(_0x3855('0x6e'),_0x3855('0x66'),_0x5c9b94[_0x3855('0x30')],client9004);})[_0x3855('0x17')](respondWithResult(_0x2ecbd9,null))[_0x3855('0x21')](handleError(_0x2ecbd9,null));};exports[_0x3855('0x6f')]=function(_0x1397ef,_0x3cd5b5){_0x1397ef[_0x3855('0x30')]['name']=_0x1397ef[_0x3855('0x70')][_0x3855('0x71')];_0x1397ef[_0x3855('0x30')][_0x3855('0x72')]=_0x1397ef[_0x3855('0x70')]['filename'];_0x1397ef[_0x3855('0x30')][_0x3855('0x73')]=_0x1397ef[_0x3855('0x70')][_0x3855('0x74')];return db['Attachment'][_0x3855('0x49')](_0x1397ef[_0x3855('0x30')])['then'](respondWithResult(_0x3cd5b5,0xc9))[_0x3855('0x21')](handleError(_0x3cd5b5,null));};exports[_0x3855('0x75')]=function(_0xe9e434,_0x59fb1c){return db['ChatInteraction'][_0x3855('0x4d')]({'where':{'id':_0xe9e434['params']['id']},'raw':!![]})[_0x3855('0x17')](handleEntityNotFound(_0x59fb1c,null))[_0x3855('0x17')](function(_0xfe0318){if(_0xfe0318){if(_0xfe0318[_0x3855('0x6c')]){return _0x59fb1c[_0x3855('0x23')](0x193)[_0x3855('0x24')]({'status':0x193,'message':_0x3855('0x76')});}return db[_0x3855('0x77')]['findOne']({'where':{'id':_0xe9e434[_0x3855('0x3b')][_0x3855('0x78')]},'raw':!![]})['then'](handleEntityNotFound(_0x59fb1c,null));}})['then'](function(_0x23a26b){if(_0x23a26b){var _0x4e49ec=_0x23a26b[_0x3855('0x79')]!==null;var _0x11daca=path[_0x3855('0x7a')](config[_0x3855('0x7b')],_0x3855('0x7c'));if(_0x4e49ec){_0x11daca=path[_0x3855('0x7a')](_0x11daca,_0x3855('0x7d'));}var _0x1152b0=path[_0x3855('0x7a')](_0x11daca,_0x23a26b[_0x3855('0x72')]);return _0x59fb1c[_0x3855('0x7e')](_0x1152b0);}})[_0x3855('0x21')](handleError(_0x59fb1c,null));};exports[_0x3855('0x7f')]=function(_0x16a6a4,_0x3089df){var _0x316801=null;var _0x4550d2=null;var _0x4aac2f=null;if(_0x16a6a4[_0x3855('0x30')]['id']){delete _0x16a6a4['body']['id'];}if(_0x16a6a4[_0x3855('0x30')][_0x3855('0x80')]){_0x4aac2f=path[_0x3855('0x7a')](config[_0x3855('0x7b')],'server/files/chat/upload/',util[_0x3855('0x81')](_0x3855('0x82'),Date[_0x3855('0x83')]()));_0x16a6a4[_0x3855('0x30')][_0x3855('0x84')]=_0x4aac2f;}return db[_0x3855('0x35')][_0x3855('0x4a')]({'where':{'id':_0x16a6a4[_0x3855('0x3e')]['id']},'include':[{'model':db[_0x3855('0x61')],'as':_0x3855('0x85'),'include':[{'model':db[_0x3855('0x86')],'as':'User'}]}]})[_0x3855('0x17')](handleEntityNotFound(_0x3089df,null))[_0x3855('0x17')](saveUpdates(_0x16a6a4[_0x3855('0x30')],null))['then'](function(_0x562195){if(_0x562195){_0x316801=_0x562195;return db[_0x3855('0x4e')][_0x3855('0x4a')]({'where':{'id':_0x316801[_0x3855('0x4f')]}});}})['then'](function(_0x1a5da5){if(_0x1a5da5){_0x4550d2=_0x1a5da5;return db['CmContact'][_0x3855('0x4a')]({'where':{'id':_0x316801[_0x3855('0x87')]}});}})[_0x3855('0x17')](function(_0x401d67){if(_0x401d67){if(_0x4aac2f){var _0x2d990b=null;for(var _0x463bc9=0x1;_0x463bc9<_0x316801[_0x3855('0x85')][_0x3855('0x88')];++_0x463bc9){_0x2d990b=_0x316801[_0x3855('0x85')][_0x463bc9];var _0x360cd5=_0x2d990b['UserId']?util['format']('%s%d',_0x4550d2[_0x3855('0x89')],_0x2d990b[_0x3855('0x6a')]):_0x3855('0x8a');var _0x560f81=_0x16a6a4[_0x3855('0x30')][_0x3855('0x8b')]||util[_0x3855('0x81')](_0x3855('0x8c'),'Visitor',_0x2d990b[_0x3855('0x87')]);switch(_0x4550d2[_0x3855('0x8d')]){case _0x3855('0x8e'):_0x360cd5=_0x2d990b['UserId']?util[_0x3855('0x81')](_0x3855('0x8c'),_0x4550d2[_0x3855('0x89')],_0x2d990b[_0x3855('0x6a')]):_0x3855('0x8a');break;case'agent_alias':_0x360cd5=_0x2d990b['UserId']?_0x2d990b[_0x3855('0x86')][_0x3855('0x8f')]||_0x2d990b['User'][_0x3855('0x55')]:_0x3855('0x8a');break;case _0x3855('0x90'):_0x360cd5=_0x2d990b[_0x3855('0x6a')]?_0x2d990b[_0x3855('0x86')][_0x3855('0x55')]:_0x3855('0x8a');break;default:_0x360cd5=_0x2d990b[_0x3855('0x6a')]?util['format']('%s%d',_0x4550d2[_0x3855('0x89')],_0x2d990b[_0x3855('0x6a')]):_0x3855('0x8a');}var _0x163562=util[_0x3855('0x81')](_0x3855('0x91'),moment(_0x2d990b[_0x3855('0x92')])[_0x3855('0x81')](_0x3855('0x93')),_0x2d990b[_0x3855('0x94')]==='in'?_0x560f81:_0x360cd5,_0x2d990b[_0x3855('0x30')]);if(!_0x2d990b['secret']){fs['appendFileSync'](_0x4aac2f,_0x163562);}}return db[_0x3855('0x95')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x3855('0x96')],'as':_0x3855('0x97'),'raw':!![],'include':[{'model':db[_0x3855('0x98')],'as':_0x3855('0x98'),'raw':!![]}]}]});}}})[_0x3855('0x17')](function(_0x3a8fa2){if(!_0x3a8fa2||!_0x3a8fa2[_0x3855('0x97')]||!_0x16a6a4[_0x3855('0x30')])return _0x316801;var _0x2dd60e=_0x3a8fa2[_0x3855('0x99')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x2dd60e,'message':{'from':util[_0x3855('0x81')]('\x22%s\x22\x20<%s>',_0x3a8fa2[_0x3855('0x54')],_0x3a8fa2[_0x3855('0x56')]||_0x3a8fa2[_0x3855('0x97')][_0x3855('0x3c')]),'to':_0x16a6a4['body']['mailTranscript'],'subject':_0x3855('0x9a'),'text':util[_0x3855('0x81')](_0x3855('0x9b'),_0x16a6a4['body'][_0x3855('0x80')]),'attachments':[{'path':_0x4aac2f}]}})['then'](function(){return _0x316801;})['catch'](function(_0x12f258){logger[_0x3855('0x1c')](_0x12f258);});})[_0x3855('0x17')](respondWithStatusCode(_0x3089df,0xc8))[_0x3855('0x21')](handleError(_0x3089df,null));};exports[_0x3855('0x9c')]=function(_0x11b4c2,_0x22364e){return db[_0x3855('0x61')]['find']({'where':{'id':_0x11b4c2[_0x3855('0x3e')]['id']}})[_0x3855('0x17')](handleEntityNotFound(_0x22364e,null))['then'](function(_0x55b3dd){if(_0x55b3dd){return _0x55b3dd['addMessage'](_0x11b4c2[_0x3855('0x30')]['ids'],_[_0x3855('0x9d')](_0x11b4c2[_0x3855('0x30')],[_0x3855('0x9e'),'id'])||{});}})[_0x3855('0x17')](respondWithResult(_0x22364e,null))[_0x3855('0x21')](handleError(_0x22364e,null));};exports['getMessages']=function(_0x280fc8,_0x2da0af){var _0x145f6f={'raw':![],'where':{}};var _0x5e2538={};var _0x221709={'count':0x0,'rows':[]};return db[_0x3855('0x35')]['findOne']({'where':{'id':_0x280fc8[_0x3855('0x3e')]['id']}})[_0x3855('0x17')](handleEntityNotFound(_0x2da0af,null))[_0x3855('0x17')](function(_0x401a06){if(_0x401a06){_0x5e2538[_0x3855('0x3f')]=_['keys'](db['ChatMessage'][_0x3855('0x36')]);_0x5e2538[_0x3855('0x3b')]=_[_0x3855('0x40')](_0x280fc8[_0x3855('0x3b')]);_0x5e2538[_0x3855('0x41')]=_['intersection'](_0x5e2538[_0x3855('0x3f')],_0x5e2538[_0x3855('0x3b')]);_0x145f6f[_0x3855('0x44')]=_[_0x3855('0x42')](_0x5e2538[_0x3855('0x3f')],qs[_0x3855('0x43')](_0x280fc8['query'][_0x3855('0x43')]));_0x145f6f[_0x3855('0x44')]=_0x145f6f[_0x3855('0x44')][_0x3855('0x88')]?_0x145f6f['attributes']:_0x5e2538[_0x3855('0x3f')];if(!_0x280fc8[_0x3855('0x3b')][_0x3855('0x9f')](_0x3855('0xa0'))){_0x145f6f[_0x3855('0x27')]=qs[_0x3855('0x27')](_0x280fc8[_0x3855('0x3b')]['limit']);_0x145f6f[_0x3855('0x25')]=qs[_0x3855('0x25')](_0x280fc8[_0x3855('0x3b')][_0x3855('0x25')]);}_0x145f6f['order']=qs['sort'](_0x280fc8[_0x3855('0x3b')][_0x3855('0xa1')]);_0x145f6f[_0x3855('0xa2')]=qs[_0x3855('0x41')](_[_0x3855('0xa3')](_0x280fc8[_0x3855('0x3b')],_0x5e2538[_0x3855('0x41')]));_0x145f6f['where'][_0x3855('0xa4')]=_0x401a06['id'];if(_0x280fc8['query'][_0x3855('0xa5')]){_0x145f6f[_0x3855('0xa2')]=_[_0x3855('0x47')](_0x145f6f[_0x3855('0xa2')],{'$or':_[_0x3855('0x34')](_0x145f6f[_0x3855('0x44')],function(_0x19dca0){var _0x20bdc8={};_0x20bdc8[_0x19dca0]={'$like':'%'+_0x280fc8['query']['filter']+'%'};return _0x20bdc8;})});}if(_0x280fc8[_0x3855('0x3b')][_0x3855('0xa6')]){var _0x5e7c80=_0x280fc8[_0x3855('0x3b')][_0x3855('0xa6')][_0x3855('0xa7')](',');var _0x4d75b4={};_0x4d75b4[_0x5e7c80[0x0]]={'$gte':moment(_0x5e7c80[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x145f6f[_0x3855('0xa2')]=_[_0x3855('0x47')](_0x145f6f[_0x3855('0xa2')],_0x4d75b4);}_0x145f6f=_[_0x3855('0x47')]({},_0x145f6f,_0x280fc8[_0x3855('0x48')]);return db['ChatMessage']['count']({'where':_0x145f6f[_0x3855('0xa2')]})[_0x3855('0x17')](function(_0x48d76a){_0x221709['count']=_0x48d76a;if(_0x280fc8[_0x3855('0x3b')][_0x3855('0x45')]){_0x145f6f[_0x3855('0x46')]=[{'all':!![]}];}return db[_0x3855('0x61')][_0x3855('0xa8')](_0x145f6f);})[_0x3855('0x17')](function(_0x546d3c){_0x221709['rows']=_0x546d3c;return _0x221709;});}})[_0x3855('0x17')](respondWithFilteredResult(_0x2da0af,_0x145f6f))['catch'](handleError(_0x2da0af,null));};exports[_0x3855('0xa9')]=function(_0x2adb8c,_0x173f36){var _0x368c84={'where':{}},_0x5944f9={},_0x513d18={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x3855('0x4d')]({'where':{'id':_0x2adb8c[_0x3855('0x3e')]['id']}})[_0x3855('0x17')](handleEntityNotFound(_0x173f36,null))['then'](function(_0x246b50){if(_0x246b50){_0x5944f9[_0x3855('0x3f')]=_['keys'](db['ChatMessage'][_0x3855('0x36')]);_0x5944f9['query']=_[_0x3855('0x40')](_0x2adb8c[_0x3855('0x3b')]);_0x5944f9[_0x3855('0x41')]=_[_0x3855('0x42')](_0x5944f9[_0x3855('0x3f')],_0x5944f9[_0x3855('0x3b')]);_0x368c84[_0x3855('0x44')]=_[_0x3855('0x42')](_0x5944f9[_0x3855('0x3f')],qs[_0x3855('0x43')](_0x2adb8c[_0x3855('0x3b')][_0x3855('0x43')]));_0x368c84[_0x3855('0x44')]=_0x368c84[_0x3855('0x44')]['length']?_0x368c84[_0x3855('0x44')]:_0x5944f9[_0x3855('0x3f')];if(!_0x2adb8c[_0x3855('0x3b')][_0x3855('0x9f')]('nolimit')){_0x368c84[_0x3855('0x27')]=qs[_0x3855('0x27')](_0x2adb8c[_0x3855('0x3b')][_0x3855('0x27')]);_0x368c84['offset']=qs[_0x3855('0x25')](_0x2adb8c[_0x3855('0x3b')]['offset']);}_0x368c84[_0x3855('0xaa')]=qs[_0x3855('0xa1')](_0x2adb8c[_0x3855('0x3b')][_0x3855('0xa1')]);_0x368c84[_0x3855('0xa2')]=qs[_0x3855('0x41')](_[_0x3855('0xa3')](_0x2adb8c['query'],_0x5944f9[_0x3855('0x41')]));_0x368c84['where'][_0x3855('0xa4')]=_0x246b50['id'];if(_0x2adb8c[_0x3855('0x3b')][_0x3855('0xa5')]){_0x368c84['where']=_[_0x3855('0x47')](_0x368c84[_0x3855('0xa2')],{'$or':_[_0x3855('0x34')](_0x368c84[_0x3855('0x44')],function(_0x1999c8){var _0x49d9f9={};_0x49d9f9[_0x1999c8]={'$like':'%'+_0x2adb8c['query']['filter']+'%'};return _0x49d9f9;})});}_0x368c84[_0x3855('0xa2')]['secret']=![];if(_0x2adb8c[_0x3855('0x3b')]['id']){_0x368c84[_0x3855('0xa2')]['id']={'$gt':_0x2adb8c[_0x3855('0x3b')]['id']};}_0x368c84=_[_0x3855('0x47')]({},_0x368c84,_0x2adb8c[_0x3855('0x48')]);return db[_0x3855('0x61')]['count']({'where':_0x368c84[_0x3855('0xa2')]})[_0x3855('0x17')](function(_0x2db773){_0x513d18[_0x3855('0x28')]=_0x2db773;_0x368c84['include']=[];if(_0x2adb8c[_0x3855('0x3b')][_0x3855('0xab')]){_0x368c84[_0x3855('0x46')]['push']({'model':db[_0x3855('0x86')],'as':_0x3855('0x86'),'attributes':['id',_0x3855('0x55'),_0x3855('0x8f')]});}if(_0x2adb8c['query'][_0x3855('0x45')]){_0x368c84[_0x3855('0x46')]=[{'all':!![]}];}return db[_0x3855('0x61')]['findAll'](_0x368c84);})['then'](function(_0x2c2a1a){_0x513d18[_0x3855('0xac')]=_0x2c2a1a;return _0x513d18;});}})[_0x3855('0x17')](respondWithFilteredResult(_0x173f36,_0x368c84))[_0x3855('0x21')](handleError(_0x173f36,null));};exports[_0x3855('0xad')]=function(_0x4c8e2d,_0xfcfe4d){return db['ChatInteraction'][_0x3855('0x4a')]({'where':{'id':_0x4c8e2d['params']['id']}})[_0x3855('0x17')](handleEntityNotFound(_0xfcfe4d,null))[_0x3855('0x17')](function(_0x39eba2){if(_0x39eba2){return _0x39eba2[_0x3855('0xae')](_0x4c8e2d['body']['ids'],_[_0x3855('0x9d')](_0x4c8e2d[_0x3855('0x30')],[_0x3855('0x9e'),'id'])||{})[_0x3855('0xaf')](function(){return db[_0x3855('0xb0')][_0x3855('0xa8')]({'attributes':['id',_0x3855('0x54'),_0x3855('0xb1')],'where':{'id':_0x4c8e2d[_0x3855('0x30')][_0x3855('0x9e')]}});})['then'](function(_0x5e0d74){socket[_0x3855('0xb2')](_0x3855('0xb3'),{'id':Number(_0x4c8e2d[_0x3855('0x3e')]['id']),'tags':_0x5e0d74||[]});return{'id':Number(_0x4c8e2d[_0x3855('0x3e')]['id']),'tags':_0x5e0d74||[]};});}})[_0x3855('0x17')](respondWithResult(_0xfcfe4d,null))[_0x3855('0x21')](handleError(_0xfcfe4d,null));};exports['removeTags']=function(_0x415ea2,_0x5235fe){return db[_0x3855('0x35')]['find']({'where':{'id':_0x415ea2[_0x3855('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5235fe,null))[_0x3855('0x17')](function(_0x48f216){if(_0x48f216){return _0x48f216[_0x3855('0xb4')](_0x415ea2[_0x3855('0x3b')][_0x3855('0x9e')]);}})[_0x3855('0x17')](respondWithStatusCode(_0x5235fe,null))[_0x3855('0x21')](handleError(_0x5235fe,null));};exports[_0x3855('0x7e')]=function(_0x1a9b20,_0xc52278){var _0x38ce3a=moment()[_0x3855('0xb5')]()['toString']();var _0x5c8151=path['join'](config[_0x3855('0x7b')],_0x3855('0xb6'),_0x3855('0xb7'),_0x3855('0xb8'));var _0x59f445=path[_0x3855('0x7a')](config[_0x3855('0x7b')],_0x3855('0xb6'),_0x3855('0xb7'),'attachments');var _0x3f2241=path[_0x3855('0x7a')](_0x5c8151,_0x38ce3a);var _0xa6bb95=util[_0x3855('0x81')](_0x3855('0xb9'),_0x1a9b20[_0x3855('0x3e')]['id'],_0x38ce3a);var _0x480bf7=path[_0x3855('0x7a')](_0x5c8151,_0xa6bb95);var _0x2b3f30=[];_0x2b3f30[_0x3855('0xba')]({'model':db[_0x3855('0x86')],'as':_0x3855('0x86'),'attributes':['id','fullname'],'raw':!![]});_0x2b3f30[_0x3855('0xba')]({'model':db[_0x3855('0x64')],'as':_0x3855('0x65'),'attributes':['id',_0x3855('0xbb'),_0x3855('0xbc')],'raw':!![]});if(_0x1a9b20[_0x3855('0x3b')][_0x3855('0xbd')]){_0x2b3f30[_0x3855('0xba')]({'model':db['Attachment'],'as':_0x3855('0x77'),'raw':!![]});}var _0x2c261f=[{'model':db[_0x3855('0x61')],'as':_0x3855('0x85'),'attributes':['id',_0x3855('0x30'),_0x3855('0x92'),_0x3855('0x94'),'secret',_0x3855('0xbe')],'include':_0x2b3f30}];_0x2c261f['push']({'model':db[_0x3855('0x4e')],'as':'Account','attributes':['id',_0x3855('0x54')]});_0x2c261f[_0x3855('0xba')]({'model':db[_0x3855('0x86')],'as':_0x3855('0xbf'),'attributes':['id',_0x3855('0x55')]});return db['ChatInteraction'][_0x3855('0x4a')]({'where':{'id':_0x1a9b20[_0x3855('0x3e')]['id']},'include':_0x2c261f})['then'](handleEntityNotFound(_0xc52278,null))[_0x3855('0x17')](function(_0x459d31){if(_0x459d31){var _0x26df70=_0x459d31[_0x3855('0xc0')]({'plain':!![]});fs[_0x3855('0xc1')](_0x3f2241);var _0xdc64e4={'channel':'Chat','account':_0x26df70['Account'][_0x3855('0x54')],'agent':_0x26df70['Owner']?_0x26df70[_0x3855('0xbf')]['fullname']:_0x3855('0xc2'),'createdAt':moment(_0x26df70[_0x3855('0x92')])[_0x3855('0x81')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3855('0xc3')](),'closedAt':_0x26df70[_0x3855('0x6c')]?moment(_0x26df70[_0x3855('0xc4')])[_0x3855('0x81')](_0x3855('0xc5'))[_0x3855('0xc3')]():'','disposition':_0x26df70['disposition'],'chatInfo':{'browser':_0x26df70['browserName'],'os':_0x26df70[_0x3855('0xc6')],'referer':_0x26df70[_0x3855('0xc7')],'customerIp':_0x26df70[_0x3855('0xc8')],'customerPort':_0x26df70[_0x3855('0xc9')]?_0x26df70[_0x3855('0xc9')]:_0x3855('0xc2')},'messages':_(_0x26df70[_0x3855('0x85')])[_0x3855('0xca')]()[_0x3855('0xa5')]({'secret':![]})['map'](function(_0x381f34){if(_0x381f34[_0x3855('0x77')]){var _0x3afb95=path['join'](_0x59f445,_0x381f34[_0x3855('0x77')][_0x3855('0x72')]);if(fs[_0x3855('0xcb')](_0x3afb95)){fs['createReadStream'](_0x3afb95)['pipe'](fs['createWriteStream'](path['join'](_0x3f2241,_0x381f34['Attachment'][_0x3855('0x72')])));}}return{'date':moment(_0x381f34[_0x3855('0x92')])[_0x3855('0x81')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3855('0xc3')](),'sender':_0x381f34['direction']===_0x3855('0xcc')?_0x381f34[_0x3855('0x86')]?_0x381f34['User']['fullname']:_0x3855('0x8a'):_0x381f34[_0x3855('0x65')][_0x3855('0xbb')]+(_0x381f34[_0x3855('0x65')][_0x3855('0xbc')]?'\x20'+_0x381f34['Contact'][_0x3855('0xbc')]:''),'body':_0x381f34[_0x3855('0x77')]?_0x381f34[_0x3855('0x77')][_0x3855('0x72')]:_0x381f34[_0x3855('0x30')],'direction':_0x381f34[_0x3855('0x94')]===_0x3855('0xcc')?'A':'C','secret':_0x381f34[_0x3855('0xcd')],'read':_0x381f34['read'],'attachment':_0x381f34[_0x3855('0x77')]};})['value']()};return ejs[_0x3855('0xce')](path['join'](config[_0x3855('0x7b')],_0x3855('0xb6'),_0x3855('0xcf'),_0x3855('0xd0')),{'interaction':_0xdc64e4})['then'](function(_0x532f9a){var _0x43a611=path[_0x3855('0x7a')](_0x3f2241,'transcript-'+_0x26df70['id']+'-'+_0x38ce3a+_0x3855('0xd1'));var _0x10bd9c={'path':_0x43a611,'channel':_0x3855('0xd2'),'interactionId':_0x26df70['id']};return pdf[_0x3855('0xd3')](_0x532f9a,_0x10bd9c);})[_0x3855('0x17')](function(){return new Promise(function(_0x514893,_0x9f9bc6){zipdir(_0x3f2241,{'saveTo':_0x480bf7},function(_0x3dd95a,_0x2b929c){if(_0x3dd95a)return _0x9f9bc6(_0x3dd95a);return _0x514893(_0x2b929c);});})[_0x3855('0x17')](function(){return new BPromise(function(_0x46d934,_0x507295){rimraf(_0x3f2241,function(_0x3b9fa4){if(_0x3b9fa4)_0x507295(_0x3b9fa4);return _0x46d934();});});})[_0x3855('0x17')](function(){return _0xc52278[_0x3855('0x7e')](_0x480bf7,_0xa6bb95,function(_0x1f4cb7){if(_0x1f4cb7){logger[_0x3855('0x1c')](_0x3855('0xd4'),_0x1f4cb7);}else{fs[_0x3855('0xd5')](_0x480bf7);}});});});}else{return _0xc52278[_0x3855('0x69')](0xc8);}})[_0x3855('0x21')](handleError(_0xc52278,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 4dcc920..65c50e9 100644 --- a/server/api/chatInteraction/chatInteraction.events.js +++ b/server/api/chatInteraction/chatInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb18d=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','save','update','remove','getUsers','then','setDataValue','map'];(function(_0x3a7077,_0x1f9d15){var _0x3ad27d=function(_0x3e2ece){while(--_0x3e2ece){_0x3a7077['push'](_0x3a7077['shift']());}};_0x3ad27d(++_0x1f9d15);}(_0xb18d,0x18e));var _0xdb18=function(_0x45da17,_0x17a5f4){_0x45da17=_0x45da17-0x0;var _0x52997b=_0xb18d[_0x45da17];return _0x52997b;};'use strict';var EventEmitter=require(_0xdb18('0x0'));var ChatInteraction=require(_0xdb18('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xdb18('0x1'))['db'][_0xdb18('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdb18('0x3'),'afterUpdate':_0xdb18('0x4'),'afterDestroy':_0xdb18('0x5')};function emitEvent(_0x3e47b5){return function(_0x388f66,_0x2fd8af,_0x294454){_0x388f66[_0xdb18('0x6')]({'attributes':['id'],'raw':!![]})[_0xdb18('0x7')](function(_0x4b1c91){_0x388f66[_0xdb18('0x8')]('Users',_0x4b1c91[_0xdb18('0x9')](function(_0x1db826){return{'id':_0x1db826['id']};}));return ChatMessage[_0xdb18('0xa')]({'where':{'ChatInteractionId':_0x388f66['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x54e064){_0x388f66['setDataValue'](_0xdb18('0xb'),_0x54e064[_0xdb18('0xc')]);ChatInteractionEvents[_0xdb18('0xd')](_0x3e47b5+':'+_0x388f66['id'],_0x388f66);ChatInteractionEvents['emit'](_0x3e47b5,_0x388f66);_0x294454(null);})[_0xdb18('0xe')](_0x294454(null));};}for(var e in events){if(events[_0xdb18('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xdb18('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0x7d4b=['Users','findAll','unreadMessages','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','getUsers','then','setDataValue'];(function(_0x68b8db,_0x34578c){var _0x4f8173=function(_0x46adcb){while(--_0x46adcb){_0x68b8db['push'](_0x68b8db['shift']());}};_0x4f8173(++_0x34578c);}(_0x7d4b,0xb2));var _0xb7d4=function(_0x96b68a,_0x39e7ad){_0x96b68a=_0x96b68a-0x0;var _0x220e87=_0x7d4b[_0x96b68a];return _0x220e87;};'use strict';var EventEmitter=require(_0xb7d4('0x0'));var ChatInteraction=require(_0xb7d4('0x1'))['db'][_0xb7d4('0x2')];var ChatMessage=require(_0xb7d4('0x1'))['db'][_0xb7d4('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb7d4('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb7d4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x53de15){return function(_0x38a358,_0x4b0212,_0x2ca101){_0x38a358[_0xb7d4('0x6')]({'attributes':['id'],'raw':!![]})[_0xb7d4('0x7')](function(_0x583c07){_0x38a358[_0xb7d4('0x8')](_0xb7d4('0x9'),_0x583c07['map'](function(_0x39cc18){return{'id':_0x39cc18['id']};}));return ChatMessage[_0xb7d4('0xa')]({'where':{'ChatInteractionId':_0x38a358['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb7d4('0x7')](function(_0x4b1405){_0x38a358[_0xb7d4('0x8')](_0xb7d4('0xb'),_0x4b1405[_0xb7d4('0xc')]);ChatInteractionEvents['emit'](_0x53de15+':'+_0x38a358['id'],_0x38a358);ChatInteractionEvents['emit'](_0x53de15,_0x38a358);_0x2ca101(null);})[_0xb7d4('0xd')](_0x2ca101(null));};}for(var e in events){if(events[_0xb7d4('0xe')](e)){var event=events[e];ChatInteraction[_0xb7d4('0xf')](e,emitEvent(event));}}module[_0xb7d4('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 35de728..bbb5f76 100644 --- a/server/api/chatInteraction/chatInteraction.model.js +++ b/server/api/chatInteraction/chatInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02f0=['define','ChatInteraction','chat_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatInteraction.attributes'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x02f0,0x1e4));var _0x002f=function(_0x15bea2,_0x5d7617){_0x15bea2=_0x15bea2-0x0;var _0x4bc90a=_0x02f0[_0x15bea2];return _0x4bc90a;};'use strict';var _=require(_0x002f('0x0'));var util=require(_0x002f('0x1'));var logger=require(_0x002f('0x2'))(_0x002f('0x3'));var moment=require('moment');var BPromise=require(_0x002f('0x4'));var rp=require(_0x002f('0x5'));var fs=require('fs');var path=require(_0x002f('0x6'));var rimraf=require(_0x002f('0x7'));var config=require('../../config/environment');var attributes=require(_0x002f('0x8'));module['exports']=function(_0xb56179,_0x3834a8){return _0xb56179[_0x002f('0x9')](_0x002f('0xa'),attributes,{'tableName':_0x002f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5c1c02,_0xd0b01f,_0x26507f){if(_0x5c1c02[_0x002f('0xc')](_0x002f('0xd'))){_0x5c1c02['closedAt']=moment()['format'](_0x002f('0xe'));}_0x26507f(null,_0x5c1c02);}},'charset':_0x002f('0xf'),'collate':_0x002f('0x10')});}; \ No newline at end of file +var _0xbd01=['changed','closed','closedAt','format','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions'];(function(_0x2d4510,_0x2b88be){var _0x3555d4=function(_0x4e5259){while(--_0x4e5259){_0x2d4510['push'](_0x2d4510['shift']());}};_0x3555d4(++_0x2b88be);}(_0xbd01,0xf3));var _0x1bd0=function(_0x158685,_0x58ab1a){_0x158685=_0x158685-0x0;var _0x273d9c=_0xbd01[_0x158685];return _0x273d9c;};'use strict';var _=require('lodash');var util=require(_0x1bd0('0x0'));var logger=require(_0x1bd0('0x1'))(_0x1bd0('0x2'));var moment=require(_0x1bd0('0x3'));var BPromise=require(_0x1bd0('0x4'));var rp=require(_0x1bd0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1bd0('0x6'));var config=require(_0x1bd0('0x7'));var attributes=require(_0x1bd0('0x8'));module['exports']=function(_0x4c2b55,_0x11de07){return _0x4c2b55[_0x1bd0('0x9')](_0x1bd0('0xa'),attributes,{'tableName':_0x1bd0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1468a9,_0x1cbe01,_0x38f6fc){if(_0x1468a9[_0x1bd0('0xc')](_0x1bd0('0xd'))){_0x1468a9[_0x1bd0('0xe')]=moment()[_0x1bd0('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x38f6fc(null,_0x1468a9);}},'charset':'utf8mb4','collate':_0x1bd0('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 32f6554..fcb91a0 100644 --- a/server/api/chatInteraction/chatInteraction.rpc.js +++ b/server/api/chatInteraction/chatInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafb7=['where','limit','catch','AddTagsToChatInteraction','ChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateChatInteraction','body','options','raw'];(function(_0x3e1cdd,_0xbef891){var _0x497827=function(_0x25604b){while(--_0x25604b){_0x3e1cdd['push'](_0x3e1cdd['shift']());}};_0x497827(++_0xbef891);}(_0xafb7,0x1ad));var _0x7afb=function(_0x4b6316,_0x43f114){_0x4b6316=_0x4b6316-0x0;var _0x12fa84=_0xafb7[_0x4b6316];return _0x12fa84;};'use strict';var _=require(_0x7afb('0x0'));var util=require('util');var moment=require(_0x7afb('0x1'));var BPromise=require('bluebird');var rs=require(_0x7afb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7afb('0x3'));var logger=require(_0x7afb('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7afb('0x5'));var client=jayson[_0x7afb('0x6')][_0x7afb('0x7')]({'port':0x232a});config[_0x7afb('0x8')]=_[_0x7afb('0x9')](config[_0x7afb('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7afb('0x8')]));require('./chatInteraction.socket')[_0x7afb('0xa')](socket);function respondWithRpcPromise(_0x1d13d4,_0xcd3e12,_0x594337){return new BPromise(function(_0x527fb0,_0x512611){return client[_0x7afb('0xb')](_0x1d13d4,_0x594337)[_0x7afb('0xc')](function(_0x18e925){logger['info'](_0x7afb('0xd'),_0xcd3e12,_0x7afb('0xe'));logger[_0x7afb('0xf')](_0x7afb('0x10'),_0xcd3e12,'request\x20sent',JSON[_0x7afb('0x11')](_0x18e925));if(_0x18e925[_0x7afb('0x12')]){if(_0x18e925[_0x7afb('0x12')][_0x7afb('0x13')]===0x1f4){logger['error'](_0x7afb('0xd'),_0xcd3e12,_0x18e925[_0x7afb('0x12')][_0x7afb('0x14')]);return _0x512611(_0x18e925[_0x7afb('0x12')][_0x7afb('0x14')]);}logger['error'](_0x7afb('0xd'),_0xcd3e12,_0x18e925[_0x7afb('0x12')][_0x7afb('0x14')]);return _0x527fb0(_0x18e925['error']['message']);}else{logger[_0x7afb('0x15')](_0x7afb('0xd'),_0xcd3e12,_0x7afb('0xe'));_0x527fb0(_0x18e925[_0x7afb('0x16')][_0x7afb('0x14')]);}})['catch'](function(_0x21c8a6){logger[_0x7afb('0x12')](_0x7afb('0xd'),_0xcd3e12,_0x21c8a6);_0x512611(_0x21c8a6);});});}exports[_0x7afb('0x17')]=function(_0x20c7ac){var _0x21564d=this;return new Promise(function(_0x5bbc23,_0x1b7d87){return db['ChatInteraction']['update'](_0x20c7ac[_0x7afb('0x18')],{'raw':_0x20c7ac[_0x7afb('0x19')]?_0x20c7ac['options'][_0x7afb('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20c7ac[_0x7afb('0x19')]?_0x20c7ac['options'][_0x7afb('0x1b')]||null:null,'attributes':_0x20c7ac[_0x7afb('0x19')]?_0x20c7ac[_0x7afb('0x19')]['attributes']||null:null,'limit':_0x20c7ac[_0x7afb('0x19')]?_0x20c7ac['options'][_0x7afb('0x1c')]||null:null})[_0x7afb('0xc')](function(_0x18bc03){logger[_0x7afb('0x15')](_0x7afb('0x17'),_0x20c7ac);logger[_0x7afb('0xf')]('UpdateChatInteraction',_0x20c7ac,JSON[_0x7afb('0x11')](_0x18bc03));_0x5bbc23(_0x18bc03);})[_0x7afb('0x1d')](function(_0xaa2660){logger['error'](_0x7afb('0x17'),_0xaa2660['message'],_0x20c7ac);_0x1b7d87(_0x21564d[_0x7afb('0x12')](0x1f4,_0xaa2660[_0x7afb('0x14')]));});});};exports[_0x7afb('0x1e')]=function(_0x57eb6f){return new Promise(function(_0x4684b1,_0x3168f6){return db[_0x7afb('0x1f')][_0x7afb('0x20')]({'where':_0x57eb6f[_0x7afb('0x19')]?_0x57eb6f['options']['where']||null:null})[_0x7afb('0xc')](function(_0x1aa4d5){if(_0x1aa4d5){return _0x1aa4d5[_0x7afb('0x21')](_0x57eb6f[_0x7afb('0x18')][_0x7afb('0x22')],_[_0x7afb('0x23')](_0x57eb6f['body'],[_0x7afb('0x22'),'id'])||{});}})[_0x7afb('0x24')](function(_0x80aff4){logger['info']('AddTags',_0x57eb6f);logger[_0x7afb('0xf')](_0x7afb('0x25'),_0x57eb6f,JSON[_0x7afb('0x11')](_0x80aff4));_0x4684b1(_0x80aff4);})[_0x7afb('0x1d')](function(_0x4875b6){logger[_0x7afb('0x12')]('AddTags',_0x4875b6[_0x7afb('0x14')],_0x57eb6f);_0x3168f6(_this[_0x7afb('0x12')](0x1f4,_0x4875b6[_0x7afb('0x14')]));});});}; \ No newline at end of file +var _0xcbca=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','ChatInteraction','update','body','options','raw','where','attributes','limit','stringify','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xcbca,0x77));var _0xacbc=function(_0x5026ab,_0x25bd8b){_0x5026ab=_0x5026ab-0x0;var _0x55f39a=_0xcbca[_0x5026ab];return _0x55f39a;};'use strict';var _=require(_0xacbc('0x0'));var util=require(_0xacbc('0x1'));var moment=require(_0xacbc('0x2'));var BPromise=require(_0xacbc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xacbc('0x4'));var db=require(_0xacbc('0x5'))['db'];var utils=require(_0xacbc('0x6'));var logger=require('../../config/logger')(_0xacbc('0x7'));var config=require(_0xacbc('0x8'));var jayson=require(_0xacbc('0x9'));var client=jayson[_0xacbc('0xa')]['http']({'port':0x232a});config[_0xacbc('0xb')]=_[_0xacbc('0xc')](config[_0xacbc('0xb')],{'host':_0xacbc('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xacbc('0xb')]));require(_0xacbc('0xe'))[_0xacbc('0xf')](socket);function respondWithRpcPromise(_0x549f14,_0x3c53c7,_0x517d32){return new BPromise(function(_0x5c1ecb,_0x2f45a5){return client['request'](_0x549f14,_0x517d32)[_0xacbc('0x10')](function(_0x539011){logger[_0xacbc('0x11')](_0xacbc('0x12'),_0x3c53c7,'request\x20sent');logger[_0xacbc('0x13')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3c53c7,_0xacbc('0x14'),JSON['stringify'](_0x539011));if(_0x539011['error']){if(_0x539011[_0xacbc('0x15')][_0xacbc('0x16')]===0x1f4){logger[_0xacbc('0x15')](_0xacbc('0x12'),_0x3c53c7,_0x539011[_0xacbc('0x15')]['message']);return _0x2f45a5(_0x539011['error'][_0xacbc('0x17')]);}logger[_0xacbc('0x15')](_0xacbc('0x12'),_0x3c53c7,_0x539011[_0xacbc('0x15')][_0xacbc('0x17')]);return _0x5c1ecb(_0x539011[_0xacbc('0x15')][_0xacbc('0x17')]);}else{logger[_0xacbc('0x11')](_0xacbc('0x12'),_0x3c53c7,'request\x20sent');_0x5c1ecb(_0x539011['result'][_0xacbc('0x17')]);}})[_0xacbc('0x18')](function(_0x20016a){logger[_0xacbc('0x15')](_0xacbc('0x12'),_0x3c53c7,_0x20016a);_0x2f45a5(_0x20016a);});});}exports['UpdateChatInteraction']=function(_0x12ca7a){var _0x465a18=this;return new Promise(function(_0x4a64a9,_0x4f6014){return db[_0xacbc('0x19')][_0xacbc('0x1a')](_0x12ca7a[_0xacbc('0x1b')],{'raw':_0x12ca7a[_0xacbc('0x1c')]?_0x12ca7a[_0xacbc('0x1c')][_0xacbc('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12ca7a[_0xacbc('0x1c')]?_0x12ca7a[_0xacbc('0x1c')][_0xacbc('0x1e')]||null:null,'attributes':_0x12ca7a['options']?_0x12ca7a[_0xacbc('0x1c')][_0xacbc('0x1f')]||null:null,'limit':_0x12ca7a[_0xacbc('0x1c')]?_0x12ca7a[_0xacbc('0x1c')][_0xacbc('0x20')]||null:null})[_0xacbc('0x10')](function(_0x6a8558){logger[_0xacbc('0x11')]('UpdateChatInteraction',_0x12ca7a);logger[_0xacbc('0x13')]('UpdateChatInteraction',_0x12ca7a,JSON[_0xacbc('0x21')](_0x6a8558));_0x4a64a9(_0x6a8558);})[_0xacbc('0x18')](function(_0x172dd5){logger[_0xacbc('0x15')](_0xacbc('0x22'),_0x172dd5[_0xacbc('0x17')],_0x12ca7a);_0x4f6014(_0x465a18[_0xacbc('0x15')](0x1f4,_0x172dd5['message']));});});};exports[_0xacbc('0x23')]=function(_0x3b12ba){return new Promise(function(_0x5b0604,_0x394ef4){return db[_0xacbc('0x19')][_0xacbc('0x24')]({'where':_0x3b12ba[_0xacbc('0x1c')]?_0x3b12ba[_0xacbc('0x1c')]['where']||null:null})[_0xacbc('0x10')](function(_0x448a4b){if(_0x448a4b){return _0x448a4b[_0xacbc('0x25')](_0x3b12ba[_0xacbc('0x1b')][_0xacbc('0x26')],_[_0xacbc('0x27')](_0x3b12ba[_0xacbc('0x1b')],[_0xacbc('0x26'),'id'])||{});}})['spread'](function(_0x25ef25){logger[_0xacbc('0x11')](_0xacbc('0x28'),_0x3b12ba);logger['debug'](_0xacbc('0x28'),_0x3b12ba,JSON['stringify'](_0x25ef25));_0x5b0604(_0x25ef25);})['catch'](function(_0x4b32a9){logger[_0xacbc('0x15')](_0xacbc('0x28'),_0x4b32a9[_0xacbc('0x17')],_0x3b12ba);_0x394ef4(_this[_0xacbc('0x15')](0x1f4,_0x4b32a9['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 346c449..613e7f2 100644 --- a/server/api/chatInteraction/chatInteraction.socket.js +++ b/server/api/chatInteraction/chatInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe8c5=['./chatInteraction.events','save','update','removeListener','register','length','chatInteraction:'];(function(_0xdb2ca,_0x166259){var _0x3b8030=function(_0x5d5cf4){while(--_0x5d5cf4){_0xdb2ca['push'](_0xdb2ca['shift']());}};_0x3b8030(++_0x166259);}(_0xe8c5,0x1c0));var _0x5e8c=function(_0xce7df0,_0x310799){_0xce7df0=_0xce7df0-0x0;var _0x5882a9=_0xe8c5[_0xce7df0];return _0x5882a9;};'use strict';var ChatInteractionEvents=require(_0x5e8c('0x0'));var events=[_0x5e8c('0x1'),'remove',_0x5e8c('0x2')];function createListener(_0xbc9a46,_0x4fc18d){return function(_0x1fb9ea){_0x4fc18d['emit'](_0xbc9a46,_0x1fb9ea);};}function removeListener(_0xeacb5b,_0x17f0e0){return function(){ChatInteractionEvents[_0x5e8c('0x3')](_0xeacb5b,_0x17f0e0);};}exports[_0x5e8c('0x4')]=function(_0xe4055b){for(var _0x40c88f=0x0,_0x20a6e8=events[_0x5e8c('0x5')];_0x40c88f<_0x20a6e8;_0x40c88f++){var _0x5bd9db=events[_0x40c88f];var _0x5edb0f=createListener(_0x5e8c('0x6')+_0x5bd9db,_0xe4055b);ChatInteractionEvents['on'](_0x5bd9db,_0x5edb0f);}}; \ No newline at end of file +var _0xb2c5=['removeListener','register','length','chatInteraction:','remove','update','emit'];(function(_0x2860e7,_0x416e82){var _0x146fbe=function(_0x483f92){while(--_0x483f92){_0x2860e7['push'](_0x2860e7['shift']());}};_0x146fbe(++_0x416e82);}(_0xb2c5,0x146));var _0x5b2c=function(_0x138d06,_0x33edf2){_0x138d06=_0x138d06-0x0;var _0x1a01eb=_0xb2c5[_0x138d06];return _0x1a01eb;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x5b2c('0x0'),_0x5b2c('0x1')];function createListener(_0x49aa61,_0x257f5e){return function(_0x52ed2b){_0x257f5e[_0x5b2c('0x2')](_0x49aa61,_0x52ed2b);};}function removeListener(_0x4fd498,_0x17a2fa){return function(){ChatInteractionEvents[_0x5b2c('0x3')](_0x4fd498,_0x17a2fa);};}exports[_0x5b2c('0x4')]=function(_0x22e0ed){for(var _0x29d748=0x0,_0x4f807a=events[_0x5b2c('0x5')];_0x29d748<_0x4f807a;_0x29d748++){var _0x2cc804=events[_0x29d748];var _0x599086=createListener(_0x5b2c('0x6')+_0x2cc804,_0x22e0ed);ChatInteractionEvents['on'](_0x2cc804,_0x599086);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 11fa8d2..469812b 100644 --- a/server/api/chatInteraction/index.js +++ b/server/api/chatInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd77=['getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','join','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','file','attachmentUpload','/:id/tags','tracked','chat','addTags','/:id','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','put','/:id/close','delete','chatinteraction:destroy','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','isChatInteractionAuthorized','/:id/messages'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd77,0x1ec));var _0x7cd7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcd77[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x7cd7('0x0'));var util=require(_0x7cd7('0x1'));var path=require(_0x7cd7('0x2'));var timeout=require(_0x7cd7('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7cd7('0x4'));var interaction=require(_0x7cd7('0x5'));var config=require(_0x7cd7('0x6'));var controller=require(_0x7cd7('0x7'));router['get']('/',auth[_0x7cd7('0x8')](),controller[_0x7cd7('0x9')]);router[_0x7cd7('0xa')](_0x7cd7('0xb'),auth[_0x7cd7('0x8')](),controller['describe']);router[_0x7cd7('0xa')]('/:id',auth['isChatInteractionAuthorized'](),controller['show']);router['get']('/:id/attachment_download',auth[_0x7cd7('0xc')](),controller['attachmentDownload']);router[_0x7cd7('0xa')](_0x7cd7('0xd'),auth[_0x7cd7('0x8')](),controller[_0x7cd7('0xe')]);router[_0x7cd7('0xa')](_0x7cd7('0xf'),auth[_0x7cd7('0xc')](),controller[_0x7cd7('0x10')]);router[_0x7cd7('0xa')](_0x7cd7('0x11'),auth[_0x7cd7('0x8')](),controller[_0x7cd7('0x12')]);router[_0x7cd7('0x13')]('/',auth['isAuthenticated'](),controller[_0x7cd7('0x14')]);router[_0x7cd7('0x13')]('/:id/vidaoo',auth[_0x7cd7('0x8')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5ee115,_0x4314ef,_0x5f3ce8){_0x5f3ce8(null,path[_0x7cd7('0x15')](config[_0x7cd7('0x16')],_0x7cd7('0x17')));},'filename':function(_0x3fe5f7,_0x1d30e1,_0x26b0d4){_0x26b0d4(null,util[_0x7cd7('0x18')](_0x7cd7('0x19'),Date[_0x7cd7('0x1a')](),_0x1d30e1['originalname'][_0x7cd7('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x7cd7('0x13')](_0x7cd7('0x1c'),upload['single'](_0x7cd7('0x1d')),controller[_0x7cd7('0x1e')]);router['post'](_0x7cd7('0xd'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router['post'](_0x7cd7('0x1f'),auth[_0x7cd7('0x8')](),interaction[_0x7cd7('0x20')](_0x7cd7('0x21'),'chatinteraction:addtags'),controller[_0x7cd7('0x22')]);router['put'](_0x7cd7('0x23'),auth[_0x7cd7('0x8')](),interaction[_0x7cd7('0x20')](_0x7cd7('0x21'),_0x7cd7('0x24')),controller[_0x7cd7('0x25')]);router['put']('/:id/custom_update',controller[_0x7cd7('0x26')]);router['put'](_0x7cd7('0x27'),auth[_0x7cd7('0xc')](),controller[_0x7cd7('0x28')]);router[_0x7cd7('0x29')](_0x7cd7('0x2a'),controller['close']);router[_0x7cd7('0x2b')](_0x7cd7('0x23'),auth[_0x7cd7('0x8')](),interaction[_0x7cd7('0x20')]('chat',_0x7cd7('0x2c')),controller[_0x7cd7('0x2d')]);router[_0x7cd7('0x2b')]('/:id/tags',auth[_0x7cd7('0x8')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x87d2=['attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','root','server/files/attachments/','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','tracked','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','express','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized'];(function(_0x2f5100,_0x565cbe){var _0x40c4bc=function(_0x525168){while(--_0x525168){_0x2f5100['push'](_0x2f5100['shift']());}};_0x40c4bc(++_0x565cbe);}(_0x87d2,0x8b));var _0x287d=function(_0x1f9ace,_0x694975){_0x1f9ace=_0x1f9ace-0x0;var _0x2c348d=_0x87d2[_0x1f9ace];return _0x2c348d;};'use strict';var multer=require(_0x287d('0x0'));var util=require(_0x287d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x287d('0x2'));var router=express['Router']();var fs_extra=require(_0x287d('0x3'));var auth=require(_0x287d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x287d('0x5'));var controller=require(_0x287d('0x6'));router[_0x287d('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x287d('0x7')]('/describe',auth[_0x287d('0x8')](),controller[_0x287d('0x9')]);router[_0x287d('0x7')](_0x287d('0xa'),auth['isChatInteractionAuthorized'](),controller[_0x287d('0xb')]);router['get'](_0x287d('0xc'),auth[_0x287d('0xd')](),controller[_0x287d('0xe')]);router[_0x287d('0x7')](_0x287d('0xf'),auth['isAuthenticated'](),controller[_0x287d('0x10')]);router[_0x287d('0x7')](_0x287d('0x11'),auth[_0x287d('0xd')](),controller[_0x287d('0x12')]);router['get'](_0x287d('0x13'),auth[_0x287d('0x8')](),controller[_0x287d('0x14')]);router[_0x287d('0x15')]('/',auth['isAuthenticated'](),controller[_0x287d('0x16')]);router['post'](_0x287d('0x17'),auth['isAuthenticated'](),controller[_0x287d('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x223910,_0x12f5d6,_0x16d785){_0x16d785(null,path['join'](config[_0x287d('0x19')],_0x287d('0x1a')));},'filename':function(_0x13ab72,_0x19b8c5,_0x46c6ad){_0x46c6ad(null,util['format'](_0x287d('0x1b'),Date[_0x287d('0x1c')](),_0x19b8c5['originalname'][_0x287d('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x287d('0x15')](_0x287d('0x1e'),upload[_0x287d('0x1f')](_0x287d('0x20')),controller[_0x287d('0x21')]);router['post'](_0x287d('0xf'),auth[_0x287d('0xd')](),controller[_0x287d('0x22')]);router[_0x287d('0x15')]('/:id/tags',auth[_0x287d('0x8')](),interaction[_0x287d('0x23')]('chat','chatinteraction:addtags'),controller['addTags']);router[_0x287d('0x24')]('/:id',auth[_0x287d('0x8')](),interaction['tracked'](_0x287d('0x25'),_0x287d('0x26')),controller[_0x287d('0x27')]);router[_0x287d('0x24')](_0x287d('0x28'),controller[_0x287d('0x29')]);router['put'](_0x287d('0x2a'),auth['isChatInteractionAuthorized'](),controller[_0x287d('0x2b')]);router[_0x287d('0x24')](_0x287d('0x2c'),controller[_0x287d('0x2d')]);router[_0x287d('0x2e')](_0x287d('0xa'),auth[_0x287d('0x8')](),interaction['tracked']('chat',_0x287d('0x2f')),controller[_0x287d('0x30')]);router[_0x287d('0x2e')](_0x287d('0x31'),auth[_0x287d('0x8')](),controller[_0x287d('0x32')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index ec1d06d..0683e77 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.attributes.js +++ b/server/api/chatInternalMessage/chatInternalMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0762=['exports','BOOLEAN','sequelize'];(function(_0x4003dd,_0x6a4f7e){var _0x403928=function(_0x52bd4e){while(--_0x52bd4e){_0x4003dd['push'](_0x4003dd['shift']());}};_0x403928(++_0x6a4f7e);}(_0x0762,0x128));var _0x2076=function(_0x1111ac,_0x27f3d9){_0x1111ac=_0x1111ac-0x0;var _0x2b30c6=_0x0762[_0x1111ac];return _0x2b30c6;};'use strict';var Sequelize=require(_0x2076('0x0'));module[_0x2076('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2076('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1558=['sequelize','exports','medium','BOOLEAN','INTEGER'];(function(_0x2bb13b,_0x192734){var _0x2852a9=function(_0x323ec8){while(--_0x323ec8){_0x2bb13b['push'](_0x2bb13b['shift']());}};_0x2852a9(++_0x192734);}(_0x1558,0x9b));var _0x8155=function(_0x337651,_0x2af690){_0x337651=_0x337651-0x0;var _0x20893c=_0x1558[_0x337651];return _0x20893c;};'use strict';var Sequelize=require(_0x8155('0x0'));module[_0x8155('0x1')]={'body':{'type':Sequelize['TEXT'](_0x8155('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8155('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8155('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 98df504..fff124e 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.controller.js +++ b/server/api/chatInternalMessage/chatInternalMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0027=['lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./chatInternalMessage.socket','register','status','end','json','undefined','limit','count','offset','set','apply','save','update','destroy','then','name','index','map','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','describe','get','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','createdAt','all','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0027,0x1a4));var _0x7002=function(_0x3f539e,_0x1fadde){_0x3f539e=_0x3f539e-0x0;var _0x5c5653=_0x0027[_0x3f539e];return _0x5c5653;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7002('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7002('0x1'));var moment=require(_0x7002('0x2'));var BPromise=require(_0x7002('0x3'));var Mustache=require(_0x7002('0x4'));var util=require('util');var path=require(_0x7002('0x5'));var sox=require(_0x7002('0x6'));var csv=require(_0x7002('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7002('0x8'));var squel=require('squel');var crypto=require(_0x7002('0x9'));var jsforce=require(_0x7002('0xa'));var deskjs=require(_0x7002('0xb'));var toCsv=require(_0x7002('0x7'));var querystring=require(_0x7002('0xc'));var Papa=require(_0x7002('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7002('0xe'));var as=require(_0x7002('0xf'));var hardwareService=require(_0x7002('0x10'));var logger=require(_0x7002('0x11'))(_0x7002('0x12'));var utils=require(_0x7002('0x13'));var config=require(_0x7002('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7002('0x15'))['db'];config[_0x7002('0x16')]=_['defaults'](config[_0x7002('0x16')],{'host':_0x7002('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7002('0x16')]));require(_0x7002('0x18'))[_0x7002('0x19')](socket);function respondWithStatusCode(_0x2110cf,_0x4706f4){_0x4706f4=_0x4706f4||0xcc;return function(_0x5957e8){if(_0x5957e8){return _0x2110cf['sendStatus'](_0x4706f4);}return _0x2110cf[_0x7002('0x1a')](_0x4706f4)[_0x7002('0x1b')]();};}function respondWithResult(_0x45914e,_0x261164){_0x261164=_0x261164||0xc8;return function(_0x28ed4d){if(_0x28ed4d){return _0x45914e[_0x7002('0x1a')](_0x261164)[_0x7002('0x1c')](_0x28ed4d);}};}function respondWithFilteredResult(_0xa5abe2,_0x37271a){return function(_0x4fbf16){if(_0x4fbf16){var _0x1e284a=typeof _0x37271a['offset']===_0x7002('0x1d')&&typeof _0x37271a[_0x7002('0x1e')]===_0x7002('0x1d');var _0x5b11bf=_0x4fbf16[_0x7002('0x1f')];var _0x4ab270=_0x1e284a?0x0:_0x37271a[_0x7002('0x20')];var _0x1eedee=_0x1e284a?_0x4fbf16['count']:_0x37271a[_0x7002('0x20')]+_0x37271a['limit'];var _0x411b74;if(_0x1eedee>=_0x5b11bf){_0x1eedee=_0x5b11bf;_0x411b74=0xc8;}else{_0x411b74=0xce;}_0xa5abe2[_0x7002('0x1a')](_0x411b74);return _0xa5abe2[_0x7002('0x21')]('Content-Range',_0x4ab270+'-'+_0x1eedee+'/'+_0x5b11bf)[_0x7002('0x1c')](_0x4fbf16);}return null;};}function patchUpdates(_0x3cf805){return function(_0x3d5355){try{jsonpatch[_0x7002('0x22')](_0x3d5355,_0x3cf805,!![]);}catch(_0x15b638){return BPromise['reject'](_0x15b638);}return _0x3d5355[_0x7002('0x23')]();};}function saveUpdates(_0x5aad9a,_0x3cc654){return function(_0x26bb62){if(_0x26bb62){return _0x26bb62[_0x7002('0x24')](_0x5aad9a)['then'](function(_0x32de7d){return _0x32de7d;});}return null;};}function removeEntity(_0xa3e983,_0x4e828e){return function(_0x45ab16){if(_0x45ab16){return _0x45ab16[_0x7002('0x25')]()[_0x7002('0x26')](function(){_0xa3e983[_0x7002('0x1a')](0xcc)[_0x7002('0x1b')]();});}};}function handleEntityNotFound(_0x16ca87,_0x1a6e0c){return function(_0x193e80){if(!_0x193e80){_0x16ca87['sendStatus'](0x194);}return _0x193e80;};}function handleError(_0x1ede36,_0x5a84c1){_0x5a84c1=_0x5a84c1||0x1f4;return function(_0x5c4e6f){logger['error'](_0x5c4e6f['stack']);if(_0x5c4e6f['name']){delete _0x5c4e6f[_0x7002('0x27')];}_0x1ede36[_0x7002('0x1a')](_0x5a84c1)['send'](_0x5c4e6f);};}exports[_0x7002('0x28')]=function(_0x12ed3c,_0x3033fd){var _0x2b69c2={},_0x4bc987={},_0x7983f9={'count':0x0,'rows':[]};var _0x1b2e98=_[_0x7002('0x29')](db['ChatInternalMessage'][_0x7002('0x2a')],function(_0x370cd3){return{'name':_0x370cd3[_0x7002('0x2b')],'type':_0x370cd3[_0x7002('0x2c')][_0x7002('0x2d')]};});_0x4bc987[_0x7002('0x2e')]=_['map'](_0x1b2e98,_0x7002('0x27'));_0x4bc987[_0x7002('0x2f')]=_['keys'](_0x12ed3c['query']);_0x4bc987['filters']=_['intersection'](_0x4bc987['model'],_0x4bc987[_0x7002('0x2f')]);_0x2b69c2[_0x7002('0x30')]=_[_0x7002('0x31')](_0x4bc987[_0x7002('0x2e')],qs[_0x7002('0x32')](_0x12ed3c[_0x7002('0x2f')][_0x7002('0x32')]));_0x2b69c2[_0x7002('0x30')]=_0x2b69c2['attributes'][_0x7002('0x33')]?_0x2b69c2[_0x7002('0x30')]:_0x4bc987[_0x7002('0x2e')];if(!_0x12ed3c['query'][_0x7002('0x34')](_0x7002('0x35'))){_0x2b69c2[_0x7002('0x1e')]=qs[_0x7002('0x1e')](_0x12ed3c[_0x7002('0x2f')][_0x7002('0x1e')]);_0x2b69c2[_0x7002('0x20')]=qs[_0x7002('0x20')](_0x12ed3c['query'][_0x7002('0x20')]);}_0x2b69c2[_0x7002('0x36')]=qs[_0x7002('0x37')](_0x12ed3c[_0x7002('0x2f')][_0x7002('0x37')]);_0x2b69c2['where']=qs[_0x7002('0x38')](_[_0x7002('0x39')](_0x12ed3c[_0x7002('0x2f')],_0x4bc987[_0x7002('0x38')]),_0x1b2e98);if(_0x12ed3c[_0x7002('0x2f')]['filter']){_0x2b69c2['where']=_[_0x7002('0x3a')](_0x2b69c2[_0x7002('0x3b')],{'$or':_[_0x7002('0x29')](_0x1b2e98,function(_0x2d4028){if(_0x2d4028['type']!==_0x7002('0x3c')){var _0x310d67={};_0x310d67[_0x2d4028[_0x7002('0x27')]]={'$like':'%'+_0x12ed3c[_0x7002('0x2f')][_0x7002('0x3d')]+'%'};return _0x310d67;}})});}_0x2b69c2=_[_0x7002('0x3a')]({},_0x2b69c2,_0x12ed3c[_0x7002('0x3e')]);var _0x1dd1af={'where':_0x2b69c2[_0x7002('0x3b')]};return db[_0x7002('0x3f')]['count'](_0x1dd1af)['then'](function(_0x579bed){_0x7983f9[_0x7002('0x1f')]=_0x579bed;if(_0x12ed3c[_0x7002('0x2f')][_0x7002('0x40')]){_0x2b69c2[_0x7002('0x41')]=[{'all':!![]}];}return db[_0x7002('0x3f')][_0x7002('0x42')](_0x2b69c2);})[_0x7002('0x26')](function(_0x226a46){_0x7983f9[_0x7002('0x43')]=_0x226a46;return _0x7983f9;})[_0x7002('0x26')](respondWithFilteredResult(_0x3033fd,_0x2b69c2))[_0x7002('0x44')](handleError(_0x3033fd,null));};exports[_0x7002('0x45')]=function(_0x1bb55e,_0xcea194){var _0x227c28={'raw':!![],'where':{'id':_0x1bb55e['params']['id']}},_0x48e48c={};_0x48e48c[_0x7002('0x2e')]=_[_0x7002('0x46')](db[_0x7002('0x3f')]['rawAttributes']);_0x48e48c['query']=_[_0x7002('0x46')](_0x1bb55e['query']);_0x48e48c['filters']=_[_0x7002('0x31')](_0x48e48c[_0x7002('0x2e')],_0x48e48c[_0x7002('0x2f')]);_0x227c28[_0x7002('0x30')]=_[_0x7002('0x31')](_0x48e48c[_0x7002('0x2e')],qs[_0x7002('0x32')](_0x1bb55e[_0x7002('0x2f')][_0x7002('0x32')]));_0x227c28['attributes']=_0x227c28[_0x7002('0x30')]['length']?_0x227c28['attributes']:_0x48e48c[_0x7002('0x2e')];if(_0x1bb55e[_0x7002('0x2f')][_0x7002('0x40')]){_0x227c28[_0x7002('0x41')]=[{'all':!![]}];}_0x227c28=_[_0x7002('0x3a')]({},_0x227c28,_0x1bb55e[_0x7002('0x3e')]);return db[_0x7002('0x3f')][_0x7002('0x47')](_0x227c28)[_0x7002('0x26')](handleEntityNotFound(_0xcea194,null))['then'](respondWithResult(_0xcea194,null))['catch'](handleError(_0xcea194,null));};exports[_0x7002('0x48')]=function(_0x4385c2,_0x1cb965){return db[_0x7002('0x3f')][_0x7002('0x48')](_0x4385c2[_0x7002('0x49')],{})[_0x7002('0x26')](respondWithResult(_0x1cb965,0xc9))[_0x7002('0x44')](handleError(_0x1cb965,null));};exports[_0x7002('0x24')]=function(_0x5f0096,_0x3d7581){if(_0x5f0096[_0x7002('0x49')]['id']){delete _0x5f0096['body']['id'];}return db['ChatInternalMessage'][_0x7002('0x47')]({'where':{'id':_0x5f0096[_0x7002('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3d7581,null))[_0x7002('0x26')](saveUpdates(_0x5f0096[_0x7002('0x49')],null))[_0x7002('0x26')](respondWithResult(_0x3d7581,null))[_0x7002('0x44')](handleError(_0x3d7581,null));};exports[_0x7002('0x25')]=function(_0x3760f6,_0x56e821){return db[_0x7002('0x3f')][_0x7002('0x47')]({'where':{'id':_0x3760f6[_0x7002('0x4a')]['id']}})[_0x7002('0x26')](handleEntityNotFound(_0x56e821,null))[_0x7002('0x26')](removeEntity(_0x56e821,null))['catch'](handleError(_0x56e821,null));};exports[_0x7002('0x4b')]=function(_0x4d8851,_0x291e86){return db[_0x7002('0x3f')][_0x7002('0x4b')]()[_0x7002('0x26')](respondWithResult(_0x291e86,null))[_0x7002('0x44')](handleError(_0x291e86,null));};function wrapUser(_0x2dd0d1){return function(_0x51c8a5){var _0x170fab=_0x2dd0d1[_0x7002('0x4c')]({'plain':!![]});_0x170fab[_0x7002('0x4d')]=[];if(_0x51c8a5){_0x170fab['lastMessageAt']=_0x51c8a5['createdAt'];_0x170fab['lastMessage']=_0x51c8a5;}else{_0x170fab[_0x7002('0x4e')]=moment(0x0)[_0x7002('0x4f')](_0x7002('0x50'));_0x170fab[_0x7002('0x51')]={};}return _0x170fab;};}exports[_0x7002('0x52')]=function(_0x372e63,_0x2d0a0d,_0x45a8f2){var _0x53acfe=[];return db[_0x7002('0x53')]['findAll']({'where':{'role':[_0x7002('0x54'),_0x7002('0x55'),'user']},'attributes':['id',_0x7002('0x56'),'name',_0x7002('0x57'),_0x7002('0x58'),_0x7002('0x59'),_0x7002('0x5a'),_0x7002('0x5b'),_0x7002('0x5c'),_0x7002('0x5d')],'order':qs['sort'](_0x7002('0x5e')),'include':[{'model':db[_0x7002('0x5f')],'as':'VoiceQueues','attributes':['id',_0x7002('0x27'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x9c345c){if(_0x9c345c){var _0x1bb597=_0x372e63['user'][_0x7002('0x4c')]({'plain':!![]});if(!_0x1bb597)throw new Error(_0x7002('0x60'));if(_0x1bb597['role']===_0x7002('0x61')){return db[_0x7002('0x62')][_0x7002('0x47')]({'where':{'name':_0x7002('0x63'),'userProfileId':_0x1bb597[_0x7002('0x64')]},'raw':!![]})[_0x7002('0x26')](function(_0x263ea1){if(_0x263ea1){if(_0x263ea1[_0x7002('0x65')]===0x0){return db['UserProfileResource'][_0x7002('0x42')]({'where':{'sectionId':_0x263ea1['id']},'raw':!![]})[_0x7002('0x26')](function(_0x431ce7){var _0x3e1a3b=[];if(_[_0x7002('0x66')](_0x431ce7)){_0x3e1a3b=_[_0x7002('0x3d')](_0x9c345c,function(_0x45a46f){if(_0x45a46f['role']!==_0x7002('0x54')){return _0x45a46f;}});return _0x3e1a3b;}else{for(var _0x440091=0x0;_0x440091<_0x9c345c[_0x7002('0x33')];_0x440091++){var _0x455838=_0x9c345c[_0x440091];if(_0x455838[_0x7002('0x57')]===_0x7002('0x54')){var _0x599434=_[_0x7002('0x47')](_0x431ce7,function(_0x4a6467){return _0x4a6467[_0x7002('0x67')]===_0x455838['id'];});if(_0x599434)_0x3e1a3b[_0x7002('0x68')](_0x455838);}else{_0x3e1a3b['push'](_0x455838);}}return _0x3e1a3b;}});}else{return _0x9c345c;}}else{var _0xa67c8f=_[_0x7002('0x3d')](_0x9c345c,function(_0x3417bb){if(_0x3417bb[_0x7002('0x57')]!==_0x7002('0x54')){return _0x3417bb;}});return _0xa67c8f;}});}else{return _0x9c345c;}}})[_0x7002('0x26')](function(_0x170346){var _0x5c7ec0=[];if(_0x170346){_0x53acfe=_0x170346;for(var _0x487dbb=0x0;_0x487dbb<_0x170346['length'];_0x487dbb+=0x1){_0x53acfe[_0x487dbb][_0x7002('0x4d')]=[];_0x5c7ec0[_0x7002('0x68')](db[_0x7002('0x3f')][_0x7002('0x47')]({'where':{'FromId':[_0x372e63[_0x7002('0x61')]['id'],_0x170346[_0x487dbb]['id']],'ToId':[_0x372e63[_0x7002('0x61')]['id'],_0x170346[_0x487dbb]['id']],'ChatGroupId':null},'attributes':['id',_0x7002('0x69'),'FromId','ToId','read','body'],'order':qs[_0x7002('0x37')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7002('0x26')](wrapUser(_0x170346[_0x487dbb])));}return BPromise[_0x7002('0x6a')](_0x5c7ec0);}return[];})[_0x7002('0x26')](function(_0x53edf6){return{'rows':_0x53edf6,'count':_0x53edf6[_0x7002('0x33')]};})[_0x7002('0x26')](respondWithResult(_0x2d0a0d,null))[_0x7002('0x44')](handleError(_0x2d0a0d,null));}; \ No newline at end of file +var _0xf79f=['user','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','status','end','json','offset','undefined','limit','count','set','apply','reject','destroy','then','sendStatus','error','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','filters','find','body','params','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin'];(function(_0x49d19d,_0x245cf5){var _0x4ebef1=function(_0xf0a4e6){while(--_0xf0a4e6){_0x49d19d['push'](_0x49d19d['shift']());}};_0x4ebef1(++_0x245cf5);}(_0xf79f,0x15a));var _0xff79=function(_0x74895e,_0x298c35){_0x74895e=_0x74895e-0x0;var _0x40bc2a=_0xf79f[_0x74895e];return _0x40bc2a;};'use strict';var emlformat=require(_0xff79('0x0'));var rimraf=require(_0xff79('0x1'));var zipdir=require(_0xff79('0x2'));var jsonpatch=require(_0xff79('0x3'));var rp=require(_0xff79('0x4'));var moment=require('moment');var BPromise=require(_0xff79('0x5'));var Mustache=require(_0xff79('0x6'));var util=require(_0xff79('0x7'));var path=require(_0xff79('0x8'));var sox=require(_0xff79('0x9'));var csv=require('to-csv');var ejs=require(_0xff79('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xff79('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xff79('0xc'));var toCsv=require(_0xff79('0xd'));var querystring=require(_0xff79('0xe'));var Papa=require(_0xff79('0xf'));var Redis=require(_0xff79('0x10'));var authService=require(_0xff79('0x11'));var qs=require(_0xff79('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff79('0x13'));var logger=require(_0xff79('0x14'))(_0xff79('0x15'));var utils=require('../../config/utils');var config=require(_0xff79('0x16'));var licenseUtil=require(_0xff79('0x17'));var db=require('../../mysqldb')['db'];config[_0xff79('0x18')]=_[_0xff79('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xff79('0x1a'))(new Redis(config[_0xff79('0x18')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x33d197,_0x1173ee){_0x1173ee=_0x1173ee||0xcc;return function(_0x13776e){if(_0x13776e){return _0x33d197['sendStatus'](_0x1173ee);}return _0x33d197[_0xff79('0x1b')](_0x1173ee)[_0xff79('0x1c')]();};}function respondWithResult(_0x79e163,_0x2a11d2){_0x2a11d2=_0x2a11d2||0xc8;return function(_0x5e032f){if(_0x5e032f){return _0x79e163['status'](_0x2a11d2)[_0xff79('0x1d')](_0x5e032f);}};}function respondWithFilteredResult(_0x4573ca,_0x5aaa56){return function(_0x49c3bb){if(_0x49c3bb){var _0x52c2fa=typeof _0x5aaa56[_0xff79('0x1e')]===_0xff79('0x1f')&&typeof _0x5aaa56[_0xff79('0x20')]===_0xff79('0x1f');var _0x4daf9f=_0x49c3bb['count'];var _0x11b7c1=_0x52c2fa?0x0:_0x5aaa56[_0xff79('0x1e')];var _0x48e908=_0x52c2fa?_0x49c3bb[_0xff79('0x21')]:_0x5aaa56[_0xff79('0x1e')]+_0x5aaa56[_0xff79('0x20')];var _0x37afe5;if(_0x48e908>=_0x4daf9f){_0x48e908=_0x4daf9f;_0x37afe5=0xc8;}else{_0x37afe5=0xce;}_0x4573ca[_0xff79('0x1b')](_0x37afe5);return _0x4573ca[_0xff79('0x22')]('Content-Range',_0x11b7c1+'-'+_0x48e908+'/'+_0x4daf9f)[_0xff79('0x1d')](_0x49c3bb);}return null;};}function patchUpdates(_0x4cca75){return function(_0x1407eb){try{jsonpatch[_0xff79('0x23')](_0x1407eb,_0x4cca75,!![]);}catch(_0x27a9a2){return BPromise[_0xff79('0x24')](_0x27a9a2);}return _0x1407eb['save']();};}function saveUpdates(_0x4d43b2,_0x2081db){return function(_0x5097eb){if(_0x5097eb){return _0x5097eb['update'](_0x4d43b2)['then'](function(_0x73ba89){return _0x73ba89;});}return null;};}function removeEntity(_0x5ed14f,_0x15169a){return function(_0x207ffa){if(_0x207ffa){return _0x207ffa[_0xff79('0x25')]()[_0xff79('0x26')](function(){_0x5ed14f[_0xff79('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x463e51,_0x143448){return function(_0x177406){if(!_0x177406){_0x463e51[_0xff79('0x27')](0x194);}return _0x177406;};}function handleError(_0x42f0cd,_0x2935ff){_0x2935ff=_0x2935ff||0x1f4;return function(_0x53294d){logger[_0xff79('0x28')](_0x53294d['stack']);if(_0x53294d[_0xff79('0x29')]){delete _0x53294d['name'];}_0x42f0cd[_0xff79('0x1b')](_0x2935ff)[_0xff79('0x2a')](_0x53294d);};}exports[_0xff79('0x2b')]=function(_0x4f47a0,_0x4790be){var _0x3632c6={},_0x362f3b={},_0x1826e2={'count':0x0,'rows':[]};var _0x32148b=_[_0xff79('0x2c')](db[_0xff79('0x2d')][_0xff79('0x2e')],function(_0x410fc1){return{'name':_0x410fc1[_0xff79('0x2f')],'type':_0x410fc1[_0xff79('0x30')]['key']};});_0x362f3b[_0xff79('0x31')]=_['map'](_0x32148b,_0xff79('0x29'));_0x362f3b[_0xff79('0x32')]=_[_0xff79('0x33')](_0x4f47a0[_0xff79('0x32')]);_0x362f3b['filters']=_[_0xff79('0x34')](_0x362f3b[_0xff79('0x31')],_0x362f3b['query']);_0x3632c6['attributes']=_[_0xff79('0x34')](_0x362f3b['model'],qs[_0xff79('0x35')](_0x4f47a0[_0xff79('0x32')][_0xff79('0x35')]));_0x3632c6[_0xff79('0x36')]=_0x3632c6['attributes'][_0xff79('0x37')]?_0x3632c6[_0xff79('0x36')]:_0x362f3b[_0xff79('0x31')];if(!_0x4f47a0[_0xff79('0x32')][_0xff79('0x38')](_0xff79('0x39'))){_0x3632c6[_0xff79('0x20')]=qs[_0xff79('0x20')](_0x4f47a0[_0xff79('0x32')][_0xff79('0x20')]);_0x3632c6[_0xff79('0x1e')]=qs[_0xff79('0x1e')](_0x4f47a0['query'][_0xff79('0x1e')]);}_0x3632c6['order']=qs[_0xff79('0x3a')](_0x4f47a0[_0xff79('0x32')][_0xff79('0x3a')]);_0x3632c6[_0xff79('0x3b')]=qs['filters'](_[_0xff79('0x3c')](_0x4f47a0['query'],_0x362f3b['filters']),_0x32148b);if(_0x4f47a0[_0xff79('0x32')][_0xff79('0x3d')]){_0x3632c6[_0xff79('0x3b')]=_[_0xff79('0x3e')](_0x3632c6['where'],{'$or':_[_0xff79('0x2c')](_0x32148b,function(_0x38b534){if(_0x38b534['type']!==_0xff79('0x3f')){var _0x513a0d={};_0x513a0d[_0x38b534['name']]={'$like':'%'+_0x4f47a0[_0xff79('0x32')]['filter']+'%'};return _0x513a0d;}})});}_0x3632c6=_[_0xff79('0x3e')]({},_0x3632c6,_0x4f47a0[_0xff79('0x40')]);var _0x3ce4fa={'where':_0x3632c6[_0xff79('0x3b')]};return db[_0xff79('0x2d')][_0xff79('0x21')](_0x3ce4fa)[_0xff79('0x26')](function(_0x42cbc6){_0x1826e2[_0xff79('0x21')]=_0x42cbc6;if(_0x4f47a0[_0xff79('0x32')][_0xff79('0x41')]){_0x3632c6[_0xff79('0x42')]=[{'all':!![]}];}return db[_0xff79('0x2d')][_0xff79('0x43')](_0x3632c6);})[_0xff79('0x26')](function(_0x2291aa){_0x1826e2['rows']=_0x2291aa;return _0x1826e2;})['then'](respondWithFilteredResult(_0x4790be,_0x3632c6))[_0xff79('0x44')](handleError(_0x4790be,null));};exports[_0xff79('0x45')]=function(_0x30209f,_0x3e6db6){var _0x2d6810={'raw':!![],'where':{'id':_0x30209f['params']['id']}},_0x2b54b9={};_0x2b54b9[_0xff79('0x31')]=_['keys'](db[_0xff79('0x2d')][_0xff79('0x2e')]);_0x2b54b9['query']=_[_0xff79('0x33')](_0x30209f['query']);_0x2b54b9[_0xff79('0x46')]=_[_0xff79('0x34')](_0x2b54b9[_0xff79('0x31')],_0x2b54b9['query']);_0x2d6810[_0xff79('0x36')]=_['intersection'](_0x2b54b9[_0xff79('0x31')],qs[_0xff79('0x35')](_0x30209f['query'][_0xff79('0x35')]));_0x2d6810[_0xff79('0x36')]=_0x2d6810[_0xff79('0x36')][_0xff79('0x37')]?_0x2d6810['attributes']:_0x2b54b9[_0xff79('0x31')];if(_0x30209f[_0xff79('0x32')][_0xff79('0x41')]){_0x2d6810['include']=[{'all':!![]}];}_0x2d6810=_['merge']({},_0x2d6810,_0x30209f['options']);return db[_0xff79('0x2d')][_0xff79('0x47')](_0x2d6810)[_0xff79('0x26')](handleEntityNotFound(_0x3e6db6,null))[_0xff79('0x26')](respondWithResult(_0x3e6db6,null))[_0xff79('0x44')](handleError(_0x3e6db6,null));};exports['create']=function(_0x4ac749,_0x3fe31e){return db[_0xff79('0x2d')]['create'](_0x4ac749[_0xff79('0x48')],{})[_0xff79('0x26')](respondWithResult(_0x3fe31e,0xc9))[_0xff79('0x44')](handleError(_0x3fe31e,null));};exports['update']=function(_0x6c6995,_0x3eed0e){if(_0x6c6995[_0xff79('0x48')]['id']){delete _0x6c6995[_0xff79('0x48')]['id'];}return db[_0xff79('0x2d')][_0xff79('0x47')]({'where':{'id':_0x6c6995[_0xff79('0x49')]['id']}})['then'](handleEntityNotFound(_0x3eed0e,null))['then'](saveUpdates(_0x6c6995[_0xff79('0x48')],null))[_0xff79('0x26')](respondWithResult(_0x3eed0e,null))[_0xff79('0x44')](handleError(_0x3eed0e,null));};exports[_0xff79('0x25')]=function(_0x1d62d3,_0x1756b0){return db['ChatInternalMessage'][_0xff79('0x47')]({'where':{'id':_0x1d62d3[_0xff79('0x49')]['id']}})['then'](handleEntityNotFound(_0x1756b0,null))[_0xff79('0x26')](removeEntity(_0x1756b0,null))[_0xff79('0x44')](handleError(_0x1756b0,null));};exports[_0xff79('0x4a')]=function(_0x2516be,_0xa10563){return db['ChatInternalMessage'][_0xff79('0x4a')]()[_0xff79('0x26')](respondWithResult(_0xa10563,null))['catch'](handleError(_0xa10563,null));};function wrapUser(_0x451021){return function(_0x538b37){var _0x237f45=_0x451021[_0xff79('0x4b')]({'plain':!![]});_0x237f45[_0xff79('0x4c')]=[];if(_0x538b37){_0x237f45[_0xff79('0x4d')]=_0x538b37[_0xff79('0x4e')];_0x237f45[_0xff79('0x4f')]=_0x538b37;}else{_0x237f45[_0xff79('0x4d')]=moment(0x0)[_0xff79('0x50')](_0xff79('0x51'));_0x237f45[_0xff79('0x4f')]={};}return _0x237f45;};}exports[_0xff79('0x52')]=function(_0x1fa9dc,_0x3cbd81,_0x47481){var _0x1f8a86=[];return db[_0xff79('0x53')][_0xff79('0x43')]({'where':{'role':[_0xff79('0x54'),_0xff79('0x55'),_0xff79('0x56')]},'attributes':['id','fullname',_0xff79('0x29'),_0xff79('0x57'),_0xff79('0x58'),_0xff79('0x59'),_0xff79('0x5a'),_0xff79('0x5b'),_0xff79('0x5c'),_0xff79('0x5d')],'order':qs['sort'](_0xff79('0x5e')),'include':[{'model':db[_0xff79('0x5f')],'as':_0xff79('0x60'),'attributes':['id',_0xff79('0x29'),_0xff79('0x30')],'through':{'attributes':[]}}]})[_0xff79('0x26')](function(_0x34b358){if(_0x34b358){var _0x3e4ba8=_0x1fa9dc[_0xff79('0x56')][_0xff79('0x4b')]({'plain':!![]});if(!_0x3e4ba8)throw new Error(_0xff79('0x61'));if(_0x3e4ba8[_0xff79('0x57')]===_0xff79('0x56')){return db[_0xff79('0x62')]['find']({'where':{'name':_0xff79('0x63'),'userProfileId':_0x3e4ba8['userProfileId']},'raw':!![]})[_0xff79('0x26')](function(_0xcd3bfb){if(_0xcd3bfb){if(_0xcd3bfb[_0xff79('0x64')]===0x0){return db[_0xff79('0x65')]['findAll']({'where':{'sectionId':_0xcd3bfb['id']},'raw':!![]})[_0xff79('0x26')](function(_0x3d32b4){var _0x1d5442=[];if(_[_0xff79('0x66')](_0x3d32b4)){_0x1d5442=_['filter'](_0x34b358,function(_0x219874){if(_0x219874[_0xff79('0x57')]!==_0xff79('0x54')){return _0x219874;}});return _0x1d5442;}else{for(var _0x551348=0x0;_0x551348<_0x34b358['length'];_0x551348++){var _0x255684=_0x34b358[_0x551348];if(_0x255684[_0xff79('0x57')]===_0xff79('0x54')){var _0x1327d1=_[_0xff79('0x47')](_0x3d32b4,function(_0x2ab86f){return _0x2ab86f[_0xff79('0x67')]===_0x255684['id'];});if(_0x1327d1)_0x1d5442[_0xff79('0x68')](_0x255684);}else{_0x1d5442[_0xff79('0x68')](_0x255684);}}return _0x1d5442;}});}else{return _0x34b358;}}else{var _0x407209=_[_0xff79('0x3d')](_0x34b358,function(_0x16d73c){if(_0x16d73c[_0xff79('0x57')]!=='agent'){return _0x16d73c;}});return _0x407209;}});}else{return _0x34b358;}}})[_0xff79('0x26')](function(_0x241d92){var _0x5d1a89=[];if(_0x241d92){_0x1f8a86=_0x241d92;for(var _0x402fdd=0x0;_0x402fdd<_0x241d92[_0xff79('0x37')];_0x402fdd+=0x1){_0x1f8a86[_0x402fdd][_0xff79('0x4c')]=[];_0x5d1a89[_0xff79('0x68')](db[_0xff79('0x2d')][_0xff79('0x47')]({'where':{'FromId':[_0x1fa9dc['user']['id'],_0x241d92[_0x402fdd]['id']],'ToId':[_0x1fa9dc['user']['id'],_0x241d92[_0x402fdd]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId','ToId',_0xff79('0x69'),'body'],'order':qs[_0xff79('0x3a')](_0xff79('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xff79('0x26')](wrapUser(_0x241d92[_0x402fdd])));}return BPromise[_0xff79('0x6b')](_0x5d1a89);}return[];})['then'](function(_0x191b23){return{'rows':_0x191b23,'count':_0x191b23[_0xff79('0x37')]};})['then'](respondWithResult(_0x3cbd81,null))[_0xff79('0x44')](handleError(_0x3cbd81,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 462aedc..01b9fbe 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.events.js +++ b/server/api/chatInternalMessage/chatInternalMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc88=['hasOwnProperty','exports','ChatInternalMessage','setMaxListeners','save','update','remove','emit'];(function(_0x345f8f,_0x54cdb7){var _0x274518=function(_0x3857cf){while(--_0x3857cf){_0x345f8f['push'](_0x345f8f['shift']());}};_0x274518(++_0x54cdb7);}(_0xcc88,0xc2));var _0x8cc8=function(_0x57f74e,_0x34b923){_0x57f74e=_0x57f74e-0x0;var _0x451a29=_0xcc88[_0x57f74e];return _0x451a29;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x8cc8('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x8cc8('0x1')](0x0);var events={'afterCreate':_0x8cc8('0x2'),'afterUpdate':_0x8cc8('0x3'),'afterDestroy':_0x8cc8('0x4')};function emitEvent(_0x174286){return function(_0x5bcc01,_0x49b977,_0x16cb22){ChatInternalMessageEvents[_0x8cc8('0x5')](_0x174286+':'+_0x5bcc01['id'],_0x5bcc01);ChatInternalMessageEvents[_0x8cc8('0x5')](_0x174286,_0x5bcc01);_0x16cb22(null);};}for(var e in events){if(events[_0x8cc8('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x8cc8('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xbcc2=['emit','hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x4616b8,_0x18d11e){var _0x4fe895=function(_0x212fa7){while(--_0x212fa7){_0x4616b8['push'](_0x4616b8['shift']());}};_0x4fe895(++_0x18d11e);}(_0xbcc2,0x150));var _0x2bcc=function(_0x3f43fa,_0x1ccd65){_0x3f43fa=_0x3f43fa-0x0;var _0x3cf4bb=_0xbcc2[_0x3f43fa];return _0x3cf4bb;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x2bcc('0x0'))['db'][_0x2bcc('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2bcc('0x2')](0x0);var events={'afterCreate':_0x2bcc('0x3'),'afterUpdate':_0x2bcc('0x4'),'afterDestroy':_0x2bcc('0x5')};function emitEvent(_0x474025){return function(_0x2ca34b,_0x3c232b,_0x2ba3bb){ChatInternalMessageEvents[_0x2bcc('0x6')](_0x474025+':'+_0x2ca34b['id'],_0x2ca34b);ChatInternalMessageEvents[_0x2bcc('0x6')](_0x474025,_0x2ca34b);_0x2ba3bb(null);};}for(var e in events){if(events[_0x2bcc('0x7')](e)){var event=events[e];ChatInternalMessage[_0x2bcc('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index b68b995..b7439e2 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.model.js +++ b/server/api/chatInternalMessage/chatInternalMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0752=['path','rimraf','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x0752,0x19e));var _0x2075=function(_0x5dba7e,_0x1a50b7){_0x5dba7e=_0x5dba7e-0x0;var _0x7bdae9=_0x0752[_0x5dba7e];return _0x7bdae9;};'use strict';var _=require(_0x2075('0x0'));var util=require(_0x2075('0x1'));var logger=require(_0x2075('0x2'))(_0x2075('0x3'));var moment=require(_0x2075('0x4'));var BPromise=require(_0x2075('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2075('0x6'));var rimraf=require(_0x2075('0x7'));var config=require('../../config/environment');var attributes=require(_0x2075('0x8'));module[_0x2075('0x9')]=function(_0x3c839f,_0x2b7b34){return _0x3c839f['define'](_0x2075('0xa'),attributes,{'tableName':_0x2075('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2075('0xc'),'collate':_0x2075('0xd')});}; \ No newline at end of file +var _0xb831=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4_unicode_ci','lodash','util'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb831,0x196));var _0x1b83=function(_0x2f037f,_0x2958c5){_0x2f037f=_0x2f037f-0x0;var _0x2d1573=_0xb831[_0x2f037f];return _0x2d1573;};'use strict';var _=require(_0x1b83('0x0'));var util=require(_0x1b83('0x1'));var logger=require(_0x1b83('0x2'))(_0x1b83('0x3'));var moment=require(_0x1b83('0x4'));var BPromise=require(_0x1b83('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b83('0x6'));var config=require(_0x1b83('0x7'));var attributes=require(_0x1b83('0x8'));module[_0x1b83('0x9')]=function(_0x64eae,_0x323392){return _0x64eae['define'](_0x1b83('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1b83('0xb')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index a5ed563..1dd830d 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.rpc.js +++ b/server/api/chatInternalMessage/chatInternalMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53a2=['ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','then','info'];(function(_0x152a08,_0x23d85e){var _0x4651d6=function(_0x4163ed){while(--_0x4163ed){_0x152a08['push'](_0x152a08['shift']());}};_0x4651d6(++_0x23d85e);}(_0x53a2,0x1a7));var _0x253a=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x53a2[_0x34021d];return _0x16597b;};'use strict';var _=require('lodash');var util=require(_0x253a('0x0'));var moment=require(_0x253a('0x1'));var BPromise=require('bluebird');var rs=require(_0x253a('0x2'));var fs=require('fs');var Redis=require(_0x253a('0x3'));var db=require(_0x253a('0x4'))['db'];var utils=require(_0x253a('0x5'));var logger=require(_0x253a('0x6'))(_0x253a('0x7'));var config=require(_0x253a('0x8'));var jayson=require(_0x253a('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x253a('0xa')]=_[_0x253a('0xb')](config[_0x253a('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x253a('0xa')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x58319a,_0x1d7f76,_0x177cf9){return new BPromise(function(_0x47d0d2,_0x4a5d06){return client['request'](_0x58319a,_0x177cf9)[_0x253a('0xc')](function(_0x1d0e1a){logger[_0x253a('0xd')](_0x253a('0xe'),_0x1d7f76,_0x253a('0xf'));logger['debug'](_0x253a('0x10'),_0x1d7f76,_0x253a('0xf'),JSON[_0x253a('0x11')](_0x1d0e1a));if(_0x1d0e1a['error']){if(_0x1d0e1a[_0x253a('0x12')][_0x253a('0x13')]===0x1f4){logger[_0x253a('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x1d7f76,_0x1d0e1a[_0x253a('0x12')][_0x253a('0x14')]);return _0x4a5d06(_0x1d0e1a[_0x253a('0x12')]['message']);}logger[_0x253a('0x12')](_0x253a('0xe'),_0x1d7f76,_0x1d0e1a[_0x253a('0x12')][_0x253a('0x14')]);return _0x47d0d2(_0x1d0e1a[_0x253a('0x12')][_0x253a('0x14')]);}else{logger[_0x253a('0xd')](_0x253a('0xe'),_0x1d7f76,_0x253a('0xf'));_0x47d0d2(_0x1d0e1a[_0x253a('0x15')]['message']);}})[_0x253a('0x16')](function(_0x322ed0){logger[_0x253a('0x12')](_0x253a('0xe'),_0x1d7f76,_0x322ed0);_0x4a5d06(_0x322ed0);});});} \ No newline at end of file +var _0x5034=['error','code','ChatInternalMessage,\x20%s,\x20%s','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x1d0c7e,_0x40b36c){var _0x30cf02=function(_0x2c8b55){while(--_0x2c8b55){_0x1d0c7e['push'](_0x1d0c7e['shift']());}};_0x30cf02(++_0x40b36c);}(_0x5034,0x8d));var _0x4503=function(_0x8ce10d,_0x77ee79){_0x8ce10d=_0x8ce10d-0x0;var _0x8facb1=_0x5034[_0x8ce10d];return _0x8facb1;};'use strict';var _=require(_0x4503('0x0'));var util=require(_0x4503('0x1'));var moment=require(_0x4503('0x2'));var BPromise=require('bluebird');var rs=require(_0x4503('0x3'));var fs=require('fs');var Redis=require(_0x4503('0x4'));var db=require(_0x4503('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4503('0x6'))(_0x4503('0x7'));var config=require(_0x4503('0x8'));var jayson=require(_0x4503('0x9'));var client=jayson[_0x4503('0xa')]['http']({'port':0x232a});config['redis']=_[_0x4503('0xb')](config[_0x4503('0xc')],{'host':_0x4503('0xd'),'port':0x18eb});var socket=require(_0x4503('0xe'))(new Redis(config[_0x4503('0xc')]));require('./chatInternalMessage.socket')[_0x4503('0xf')](socket);function respondWithRpcPromise(_0x29150e,_0x1b5be7,_0x302ed4){return new BPromise(function(_0x4e9737,_0x578d35){return client[_0x4503('0x10')](_0x29150e,_0x302ed4)[_0x4503('0x11')](function(_0x260eef){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x1b5be7,_0x4503('0x12'));logger[_0x4503('0x13')](_0x4503('0x14'),_0x1b5be7,_0x4503('0x12'),JSON['stringify'](_0x260eef));if(_0x260eef[_0x4503('0x15')]){if(_0x260eef['error'][_0x4503('0x16')]===0x1f4){logger[_0x4503('0x15')](_0x4503('0x17'),_0x1b5be7,_0x260eef[_0x4503('0x15')][_0x4503('0x18')]);return _0x578d35(_0x260eef['error'][_0x4503('0x18')]);}logger['error'](_0x4503('0x17'),_0x1b5be7,_0x260eef[_0x4503('0x15')][_0x4503('0x18')]);return _0x4e9737(_0x260eef[_0x4503('0x15')]['message']);}else{logger[_0x4503('0x19')](_0x4503('0x17'),_0x1b5be7,'request\x20sent');_0x4e9737(_0x260eef[_0x4503('0x1a')][_0x4503('0x18')]);}})['catch'](function(_0x5abf44){logger[_0x4503('0x15')](_0x4503('0x17'),_0x1b5be7,_0x5abf44);_0x578d35(_0x5abf44);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 5820684..eca6fc9 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.socket.js +++ b/server/api/chatInternalMessage/chatInternalMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2fc6=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x243dce,_0x548bcf){var _0x482b9d=function(_0x504104){while(--_0x504104){_0x243dce['push'](_0x243dce['shift']());}};_0x482b9d(++_0x548bcf);}(_0x2fc6,0xf7));var _0x62fc=function(_0x375308,_0x2afd0d){_0x375308=_0x375308-0x0;var _0x35b040=_0x2fc6[_0x375308];return _0x35b040;};'use strict';var ChatInternalMessageEvents=require(_0x62fc('0x0'));var events=[_0x62fc('0x1'),_0x62fc('0x2'),_0x62fc('0x3')];function createListener(_0x324072,_0x50afdb){return function(_0x4b8f24){_0x50afdb[_0x62fc('0x4')](_0x324072,_0x4b8f24);};}function removeListener(_0x141c26,_0x4965dd){return function(){ChatInternalMessageEvents[_0x62fc('0x5')](_0x141c26,_0x4965dd);};}exports[_0x62fc('0x6')]=function(_0x456e06){for(var _0x729022=0x0,_0xd58bf9=events[_0x62fc('0x7')];_0x729022<_0xd58bf9;_0x729022++){var _0xa38461=events[_0x729022];var _0x2296ab=createListener(_0x62fc('0x8')+_0xa38461,_0x456e06);ChatInternalMessageEvents['on'](_0xa38461,_0x2296ab);}}; \ No newline at end of file +var _0x212d=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x212d,0x68));var _0xd212=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x212d[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0xd212('0x0'));var events=[_0xd212('0x1'),_0xd212('0x2'),_0xd212('0x3')];function createListener(_0x1876dd,_0x4e2eb7){return function(_0x3bf34c){_0x4e2eb7[_0xd212('0x4')](_0x1876dd,_0x3bf34c);};}function removeListener(_0x1d8766,_0x59736){return function(){ChatInternalMessageEvents[_0xd212('0x5')](_0x1d8766,_0x59736);};}exports[_0xd212('0x6')]=function(_0x7b88c9){for(var _0x4ae68a=0x0,_0x43e7c6=events[_0xd212('0x7')];_0x4ae68a<_0x43e7c6;_0x4ae68a++){var _0x3c182a=events[_0x4ae68a];var _0x2d7de5=createListener(_0xd212('0x8')+_0x3c182a,_0x7b88c9);ChatInternalMessageEvents['on'](_0x3c182a,_0x2d7de5);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index bd91501..39b2070 100644 --- a/server/api/chatInternalMessage/index.js +++ b/server/api/chatInternalMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0498=['delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','/:id','show','post','put','update'];(function(_0x7a5cf1,_0x1f6459){var _0x4e4825=function(_0x39bac3){while(--_0x39bac3){_0x7a5cf1['push'](_0x7a5cf1['shift']());}};_0x4e4825(++_0x1f6459);}(_0x0498,0x193));var _0x8049=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x0498[_0x3ab9ee];return _0x82ee88;};'use strict';var multer=require(_0x8049('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8049('0x1'));var router=express[_0x8049('0x2')]();var fs_extra=require(_0x8049('0x3'));var auth=require(_0x8049('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8049('0x5'));router[_0x8049('0x6')]('/',auth[_0x8049('0x7')](),controller[_0x8049('0x8')]);router[_0x8049('0x6')](_0x8049('0x9'),auth[_0x8049('0x7')](),controller[_0x8049('0xa')]);router[_0x8049('0x6')](_0x8049('0xb'),auth['isAuthenticated'](),controller['getUsers']);router[_0x8049('0x6')](_0x8049('0xc'),auth['isAuthenticated'](),controller[_0x8049('0xd')]);router[_0x8049('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8049('0xf')](_0x8049('0xc'),controller[_0x8049('0x10')]);router[_0x8049('0x11')](_0x8049('0xc'),auth['isAuthenticated'](),controller[_0x8049('0x12')]);module[_0x8049('0x13')]=router; \ No newline at end of file +var _0x7fcf=['get','isAuthenticated','index','/describe','/users','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7fcf,0xb5));var _0xf7fc=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x7fcf[_0x4709c0];return _0x13348b;};'use strict';var multer=require('multer');var util=require(_0xf7fc('0x0'));var path=require(_0xf7fc('0x1'));var timeout=require(_0xf7fc('0x2'));var express=require(_0xf7fc('0x3'));var router=express[_0xf7fc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf7fc('0x5'));var interaction=require(_0xf7fc('0x6'));var config=require(_0xf7fc('0x7'));var controller=require('./chatInternalMessage.controller');router[_0xf7fc('0x8')]('/',auth[_0xf7fc('0x9')](),controller[_0xf7fc('0xa')]);router[_0xf7fc('0x8')](_0xf7fc('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xf7fc('0x8')](_0xf7fc('0xc'),auth[_0xf7fc('0x9')](),controller['getUsers']);router[_0xf7fc('0x8')](_0xf7fc('0xd'),auth[_0xf7fc('0x9')](),controller[_0xf7fc('0xe')]);router[_0xf7fc('0xf')]('/',auth[_0xf7fc('0x9')](),controller[_0xf7fc('0x10')]);router[_0xf7fc('0x11')](_0xf7fc('0xd'),controller[_0xf7fc('0x12')]);router[_0xf7fc('0x13')](_0xf7fc('0xd'),auth[_0xf7fc('0x9')](),controller[_0xf7fc('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 7c9a2cd..37ea59f 100644 --- a/server/api/chatMessage/chatMessage.attributes.js +++ b/server/api/chatMessage/chatMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39c4=['exports','BOOLEAN','out','DATE','STRING','TEXT'];(function(_0x5d3226,_0x389ddf){var _0x1a1c3b=function(_0x22128c){while(--_0x22128c){_0x5d3226['push'](_0x5d3226['shift']());}};_0x1a1c3b(++_0x389ddf);}(_0x39c4,0x174));var _0x439c=function(_0x440535,_0x25d8a1){_0x440535=_0x440535-0x0;var _0xb68db2=_0x39c4[_0x440535];return _0xb68db2;};'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 _0x3266=['out','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x4df19,_0x32dbdc){var _0x1b7bab=function(_0x1baae2){while(--_0x1baae2){_0x4df19['push'](_0x4df19['shift']());}};_0x1b7bab(++_0x32dbdc);}(_0x3266,0x6a));var _0x6326=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0x3266[_0xf2628e];return _0x13863a;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'body':{'type':Sequelize[_0x6326('0x2')](_0x6326('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x6326('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x6326('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6326('0x5')]('in',_0x6326('0x6')),'defaultValue':_0x6326('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x6326('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index e0db8ca..11b80f3 100644 --- a/server/api/chatMessage/chatMessage.controller.js +++ b/server/api/chatMessage/chatMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe886=['set','Content-Range','save','update','destroy','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','params','keys','includeAll','find','body','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','interaction','stringify','AcceptMessage','acceptMessage','ContactId','Sequelize','contact','User','fullname','email','internal','manual','SIP/%s','channel','event','EventManager','parse','formData','reject','ChatInteraction','null','RejectMessage','rejectMessage','sequelize','SELECT','interface','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','./chatMessage.socket','jayson/promise','http','request','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','end','offset','undefined','count','limit'];(function(_0x44ec72,_0x3a2a12){var _0x447fa8=function(_0x4c37b5){while(--_0x4c37b5){_0x44ec72['push'](_0x44ec72['shift']());}};_0x447fa8(++_0x3a2a12);}(_0xe886,0xc0));var _0x6e88=function(_0x5b37ce,_0x5bae3b){_0x5b37ce=_0x5b37ce-0x0;var _0x13f369=_0xe886[_0x5b37ce];return _0x13f369;};'use strict';var emlformat=require(_0x6e88('0x0'));var rimraf=require(_0x6e88('0x1'));var zipdir=require(_0x6e88('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e88('0x3'));var moment=require(_0x6e88('0x4'));var BPromise=require(_0x6e88('0x5'));var Mustache=require(_0x6e88('0x6'));var util=require('util');var path=require(_0x6e88('0x7'));var sox=require(_0x6e88('0x8'));var csv=require('to-csv');var ejs=require(_0x6e88('0x9'));var fs=require('fs');var fs_extra=require(_0x6e88('0xa'));var _=require('lodash');var squel=require(_0x6e88('0xb'));var crypto=require(_0x6e88('0xc'));var jsforce=require(_0x6e88('0xd'));var deskjs=require(_0x6e88('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6e88('0xf'));var Papa=require('papaparse');var Redis=require(_0x6e88('0x10'));var authService=require(_0x6e88('0x11'));var qs=require(_0x6e88('0x12'));var as=require(_0x6e88('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6e88('0x14'))('api');var utils=require(_0x6e88('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6e88('0x16'));var db=require('../../mysqldb')['db'];config[_0x6e88('0x17')]=_[_0x6e88('0x18')](config[_0x6e88('0x17')],{'host':_0x6e88('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6e88('0x17')]));require(_0x6e88('0x1a'))['register'](socket);var jayson=require(_0x6e88('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x6e88('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x21af31,_0x28641e,_0x1a0572,_0x43cd3d){return new BPromise(function(_0x2f3df5,_0x55ca71){var _0x4442f6=_0x43cd3d||client;return _0x4442f6[_0x6e88('0x1d')](_0x21af31,_0x1a0572)[_0x6e88('0x1e')](function(_0x2df51a){logger[_0x6e88('0x1f')](_0x6e88('0x20'),_0x28641e,'request\x20sent');logger['debug'](_0x6e88('0x21'),_0x28641e,_0x6e88('0x22'),JSON['stringify'](_0x2df51a));if(_0x2df51a[_0x6e88('0x23')]){if(_0x2df51a['error']['code']===0x1f4){logger[_0x6e88('0x23')]('ChatMessage,\x20%s,\x20%s',_0x28641e,_0x2df51a[_0x6e88('0x23')][_0x6e88('0x24')]);return _0x55ca71(_0x2df51a[_0x6e88('0x23')][_0x6e88('0x24')]);}logger[_0x6e88('0x23')](_0x6e88('0x20'),_0x28641e,_0x2df51a[_0x6e88('0x23')]['message']);return _0x2f3df5(_0x2df51a[_0x6e88('0x23')][_0x6e88('0x24')]);}else{logger['info'](_0x6e88('0x20'),_0x28641e,_0x6e88('0x22'));_0x2f3df5(_0x2df51a[_0x6e88('0x25')][_0x6e88('0x24')]);}})[_0x6e88('0x26')](function(_0x5aa188){logger['error'](_0x6e88('0x20'),_0x28641e,_0x5aa188);_0x55ca71(_0x5aa188);});});}function respondWithStatusCode(_0x3d6051,_0x5cedfd){_0x5cedfd=_0x5cedfd||0xcc;return function(_0x155cba){if(_0x155cba){return _0x3d6051[_0x6e88('0x27')](_0x5cedfd);}return _0x3d6051[_0x6e88('0x28')](_0x5cedfd)[_0x6e88('0x29')]();};}function respondWithResult(_0xe9da02,_0x52a68){_0x52a68=_0x52a68||0xc8;return function(_0x2f4b0e){if(_0x2f4b0e){return _0xe9da02[_0x6e88('0x28')](_0x52a68)['json'](_0x2f4b0e);}};}function respondWithFilteredResult(_0x4e295f,_0x339ed8){return function(_0x48f8dc){if(_0x48f8dc){var _0x54dd07=typeof _0x339ed8[_0x6e88('0x2a')]===_0x6e88('0x2b')&&typeof _0x339ed8['limit']===_0x6e88('0x2b');var _0x4d1f20=_0x48f8dc['count'];var _0x2cd05f=_0x54dd07?0x0:_0x339ed8[_0x6e88('0x2a')];var _0x23fde4=_0x54dd07?_0x48f8dc[_0x6e88('0x2c')]:_0x339ed8[_0x6e88('0x2a')]+_0x339ed8[_0x6e88('0x2d')];var _0x44f02e;if(_0x23fde4>=_0x4d1f20){_0x23fde4=_0x4d1f20;_0x44f02e=0xc8;}else{_0x44f02e=0xce;}_0x4e295f[_0x6e88('0x28')](_0x44f02e);return _0x4e295f[_0x6e88('0x2e')](_0x6e88('0x2f'),_0x2cd05f+'-'+_0x23fde4+'/'+_0x4d1f20)['json'](_0x48f8dc);}return null;};}function patchUpdates(_0x3ea491){return function(_0x1f38e3){try{jsonpatch['apply'](_0x1f38e3,_0x3ea491,!![]);}catch(_0x53448b){return BPromise['reject'](_0x53448b);}return _0x1f38e3[_0x6e88('0x30')]();};}function saveUpdates(_0x3b0e9c,_0x30de99){return function(_0x3113dc){if(_0x3113dc){return _0x3113dc[_0x6e88('0x31')](_0x3b0e9c)[_0x6e88('0x1e')](function(_0x248dde){return _0x248dde;});}return null;};}function removeEntity(_0x1f9e5e,_0x227268){return function(_0x4daeb9){if(_0x4daeb9){return _0x4daeb9[_0x6e88('0x32')]()[_0x6e88('0x1e')](function(){_0x1f9e5e[_0x6e88('0x28')](0xcc)[_0x6e88('0x29')]();});}};}function handleEntityNotFound(_0x31abbb,_0x2e477f){return function(_0x21a90f){if(!_0x21a90f){_0x31abbb[_0x6e88('0x27')](0x194);}return _0x21a90f;};}function handleError(_0x49c117,_0x2a9f93){_0x2a9f93=_0x2a9f93||0x1f4;return function(_0x271a71){logger['error'](_0x271a71[_0x6e88('0x33')]);if(_0x271a71['name']){delete _0x271a71[_0x6e88('0x34')];}_0x49c117['status'](_0x2a9f93)['send'](_0x271a71);};}exports[_0x6e88('0x35')]=function(_0x3e7e4f,_0x32f0ae){var _0x1296b1={},_0x58ffec={},_0x502fb1={'count':0x0,'rows':[]};var _0x43b14c=_[_0x6e88('0x36')](db[_0x6e88('0x37')][_0x6e88('0x38')],function(_0x50efc4){return{'name':_0x50efc4[_0x6e88('0x39')],'type':_0x50efc4[_0x6e88('0x3a')][_0x6e88('0x3b')]};});_0x58ffec['model']=_[_0x6e88('0x36')](_0x43b14c,_0x6e88('0x34'));_0x58ffec[_0x6e88('0x3c')]=_['keys'](_0x3e7e4f[_0x6e88('0x3c')]);_0x58ffec[_0x6e88('0x3d')]=_[_0x6e88('0x3e')](_0x58ffec[_0x6e88('0x3f')],_0x58ffec[_0x6e88('0x3c')]);_0x1296b1['attributes']=_['intersection'](_0x58ffec['model'],qs[_0x6e88('0x40')](_0x3e7e4f[_0x6e88('0x3c')]['fields']));_0x1296b1['attributes']=_0x1296b1[_0x6e88('0x41')][_0x6e88('0x42')]?_0x1296b1[_0x6e88('0x41')]:_0x58ffec['model'];if(!_0x3e7e4f[_0x6e88('0x3c')][_0x6e88('0x43')](_0x6e88('0x44'))){_0x1296b1[_0x6e88('0x2d')]=qs[_0x6e88('0x2d')](_0x3e7e4f[_0x6e88('0x3c')][_0x6e88('0x2d')]);_0x1296b1[_0x6e88('0x2a')]=qs[_0x6e88('0x2a')](_0x3e7e4f[_0x6e88('0x3c')][_0x6e88('0x2a')]);}_0x1296b1['order']=qs['sort'](_0x3e7e4f[_0x6e88('0x3c')][_0x6e88('0x45')]);_0x1296b1[_0x6e88('0x46')]=qs[_0x6e88('0x3d')](_[_0x6e88('0x47')](_0x3e7e4f[_0x6e88('0x3c')],_0x58ffec[_0x6e88('0x3d')]),_0x43b14c);if(_0x3e7e4f[_0x6e88('0x3c')][_0x6e88('0x48')]){_0x1296b1[_0x6e88('0x46')]=_['merge'](_0x1296b1[_0x6e88('0x46')],{'$or':_[_0x6e88('0x36')](_0x43b14c,function(_0x2051d2){if(_0x2051d2[_0x6e88('0x3a')]!=='VIRTUAL'){var _0x34cc11={};_0x34cc11[_0x2051d2['name']]={'$like':'%'+_0x3e7e4f['query'][_0x6e88('0x48')]+'%'};return _0x34cc11;}})});}_0x1296b1=_[_0x6e88('0x49')]({},_0x1296b1,_0x3e7e4f[_0x6e88('0x4a')]);var _0x5d5d74={'where':_0x1296b1['where']};return db[_0x6e88('0x37')][_0x6e88('0x2c')](_0x5d5d74)[_0x6e88('0x1e')](function(_0x192987){_0x502fb1[_0x6e88('0x2c')]=_0x192987;if(_0x3e7e4f[_0x6e88('0x3c')]['includeAll']){_0x1296b1['include']=[{'all':!![]}];}return db[_0x6e88('0x37')]['findAll'](_0x1296b1);})[_0x6e88('0x1e')](function(_0xafbc56){_0x502fb1['rows']=_0xafbc56;return _0x502fb1;})[_0x6e88('0x1e')](respondWithFilteredResult(_0x32f0ae,_0x1296b1))[_0x6e88('0x26')](handleError(_0x32f0ae,null));};exports['show']=function(_0x1a08f6,_0x23b87d){var _0x3cfa50={'raw':!![],'where':{'id':_0x1a08f6[_0x6e88('0x4b')]['id']}},_0x591c09={};_0x591c09[_0x6e88('0x3f')]=_[_0x6e88('0x4c')](db[_0x6e88('0x37')][_0x6e88('0x38')]);_0x591c09[_0x6e88('0x3c')]=_[_0x6e88('0x4c')](_0x1a08f6[_0x6e88('0x3c')]);_0x591c09[_0x6e88('0x3d')]=_[_0x6e88('0x3e')](_0x591c09['model'],_0x591c09[_0x6e88('0x3c')]);_0x3cfa50[_0x6e88('0x41')]=_[_0x6e88('0x3e')](_0x591c09[_0x6e88('0x3f')],qs[_0x6e88('0x40')](_0x1a08f6['query'][_0x6e88('0x40')]));_0x3cfa50['attributes']=_0x3cfa50[_0x6e88('0x41')][_0x6e88('0x42')]?_0x3cfa50[_0x6e88('0x41')]:_0x591c09[_0x6e88('0x3f')];if(_0x1a08f6[_0x6e88('0x3c')][_0x6e88('0x4d')]){_0x3cfa50['include']=[{'all':!![]}];}_0x3cfa50=_['merge']({},_0x3cfa50,_0x1a08f6[_0x6e88('0x4a')]);return db[_0x6e88('0x37')][_0x6e88('0x4e')](_0x3cfa50)[_0x6e88('0x1e')](handleEntityNotFound(_0x23b87d,null))['then'](respondWithResult(_0x23b87d,null))[_0x6e88('0x26')](handleError(_0x23b87d,null));};exports['create']=function(_0x440b46,_0x354ef3){return db['ChatMessage']['create'](_0x440b46[_0x6e88('0x4f')],{})[_0x6e88('0x1e')](respondWithResult(_0x354ef3,0xc9))['catch'](handleError(_0x354ef3,null));};exports['update']=function(_0x5f5a1b,_0x21db8c){if(_0x5f5a1b[_0x6e88('0x4f')]['id']){delete _0x5f5a1b[_0x6e88('0x4f')]['id'];}return db[_0x6e88('0x37')]['find']({'where':{'id':_0x5f5a1b[_0x6e88('0x4b')]['id']}})['then'](handleEntityNotFound(_0x21db8c,null))['then'](saveUpdates(_0x5f5a1b[_0x6e88('0x4f')],null))[_0x6e88('0x1e')](respondWithResult(_0x21db8c,null))[_0x6e88('0x26')](handleError(_0x21db8c,null));};exports[_0x6e88('0x32')]=function(_0x546893,_0x311463){return db[_0x6e88('0x37')][_0x6e88('0x4e')]({'where':{'id':_0x546893[_0x6e88('0x4b')]['id']}})[_0x6e88('0x1e')](handleEntityNotFound(_0x311463,null))[_0x6e88('0x1e')](removeEntity(_0x311463,null))[_0x6e88('0x26')](handleError(_0x311463,null));};exports['describe']=function(_0x25fa30,_0x433c4f){return db[_0x6e88('0x37')]['describe']()['then'](respondWithResult(_0x433c4f,null))['catch'](handleError(_0x433c4f,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x6e88('0x50')]=function(_0x30828c,_0x1983ec,_0x3326cb){var _0x10f3c9={'agent':{},'channel':_0x6e88('0x51')};if(_0x30828c[_0x6e88('0x4f')]['id']){delete _0x30828c['body']['id'];}_0x30828c['body'][_0x6e88('0x52')]=!![];_0x30828c[_0x6e88('0x4f')][_0x6e88('0x53')]=moment()[_0x6e88('0x54')](_0x6e88('0x55'));_0x30828c[_0x6e88('0x4f')][_0x6e88('0x56')]=_0x30828c[_0x6e88('0x4f')][_0x6e88('0x56')]||_0x30828c[_0x6e88('0x57')]['id'];_0x10f3c9[_0x6e88('0x58')]['id']=_0x30828c[_0x6e88('0x4f')]['UserId'];return db[_0x6e88('0x37')][_0x6e88('0x4e')]({'where':{'id':_0x30828c[_0x6e88('0x4b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1983ec,null))['then'](saveUpdates(_0x30828c[_0x6e88('0x4f')],null))[_0x6e88('0x1e')](function(_0x290d09){if(_0x290d09){_0x10f3c9[_0x6e88('0x24')]=_0x290d09[_0x6e88('0x59')]({'plain':!![]});return db['ChatInteraction'][_0x6e88('0x4e')]({'where':{'id':_0x290d09[_0x6e88('0x5a')]}});}return null;})[_0x6e88('0x1e')](handleEntityNotFound(_0x1983ec,null))[_0x6e88('0x1e')](function(_0x507d47){if(_0x507d47){return _0x507d47[_0x6e88('0x31')]({'UserId':_0x30828c['body'][_0x6e88('0x56')],'read1stAt':_[_0x6e88('0x5b')](_0x507d47['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6e88('0x1e')](function(_0x405a07){if(_0x405a07){_0x10f3c9[_0x6e88('0x5c')]=_0x405a07[_0x6e88('0x59')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x30828c[_0x6e88('0x57')]['id'],_0x30828c[_0x6e88('0x57')]['name'],_0x30828c['user']['role'],_0x10f3c9['interaction']['id'],_0x30828c[_0x6e88('0x4f')]?JSON[_0x6e88('0x5d')](_0x30828c[_0x6e88('0x4f')]):'null');return respondWithRpcPromise(_0x6e88('0x5e'),_0x6e88('0x5f'),_0x10f3c9);}return null;})['then'](function(_0x2d7a38){var _0x2bd362='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2d7a38[_0x6e88('0x24')][_0x6e88('0x60')];return db['sequelize']['query'](_0x2bd362,{'type':db[_0x6e88('0x61')]['QueryTypes']['SELECT'],'raw':!![]})[_0x6e88('0x1e')](function(_0x1325a8){return _0x1325a8;});})['then'](function(_0x52dd1a){if(_0x52dd1a){_0x10f3c9[_0x6e88('0x24')][_0x6e88('0x62')]=_0x52dd1a[0x0];if(!_0x30828c[_0x6e88('0x4f')][_0x6e88('0x56')])return;return db[_0x6e88('0x63')][_0x6e88('0x4e')]({'where':{'id':_0x30828c[_0x6e88('0x4f')]['UserId'],'role':'agent'},'attributes':['id','name',_0x6e88('0x64'),_0x6e88('0x65'),_0x6e88('0x66')],'raw':!![]});}return null;})[_0x6e88('0x1e')](function(_0x11f545){if(!_0x11f545)return null;_0x10f3c9['message'][_0x6e88('0x58')]=_0x11f545;return _0x10f3c9;})[_0x6e88('0x1e')](function(_0x5f12a3){if(_0x5f12a3){if(_0x30828c['body'][_0x6e88('0x67')]){_0x10f3c9[_0x6e88('0x24')]['interface']=util[_0x6e88('0x54')](_0x6e88('0x68'),_0x30828c[_0x6e88('0x57')][_0x6e88('0x34')]);_0x10f3c9['message']['channel']=_0x10f3c9[_0x6e88('0x69')];_0x10f3c9[_0x6e88('0x24')]['motionChannel']=_0x10f3c9['channel'];_0x10f3c9['message'][_0x6e88('0x6a')]='accept';return respondWithRpcPromise(_0x6e88('0x6b'),_0x6e88('0x6b'),{'event':'acceptmessage','message':_[_0x6e88('0x49')](_0x10f3c9[_0x6e88('0x24')],JSON[_0x6e88('0x6c')](_0x10f3c9[_0x6e88('0x5c')][_0x6e88('0x6d')]))},client9002)[_0x6e88('0x1e')](function(){return _0x10f3c9;});}return _0x10f3c9;}return null;})['then'](respondWithResult(_0x1983ec,null))[_0x6e88('0x26')](handleError(_0x1983ec,null));};var interaction_log=require(_0x6e88('0x14'))('chat-interactions');exports[_0x6e88('0x6e')]=function(_0x2de834,_0x10bdeb,_0x439a74){var _0x54eb76={'agent':{},'channel':_0x6e88('0x51')};if(_0x2de834[_0x6e88('0x4f')]['id']){delete _0x2de834[_0x6e88('0x4f')]['id'];}_0x2de834['body'][_0x6e88('0x56')]=_0x2de834[_0x6e88('0x4f')][_0x6e88('0x56')]||_0x2de834[_0x6e88('0x57')]['id'];_0x54eb76['agent']['id']=_0x2de834[_0x6e88('0x4f')][_0x6e88('0x56')];return db[_0x6e88('0x37')][_0x6e88('0x4e')]({'where':{'id':_0x2de834[_0x6e88('0x4b')]['id'],'UserId':null}})[_0x6e88('0x1e')](handleEntityNotFound(_0x10bdeb,null))[_0x6e88('0x1e')](function(_0x3c658c){if(_0x3c658c){_0x54eb76[_0x6e88('0x24')]=_0x3c658c['get']({'plain':!![]});return db[_0x6e88('0x6f')][_0x6e88('0x4e')]({'where':{'id':_0x3c658c[_0x6e88('0x5a')]}});}return null;})[_0x6e88('0x1e')](handleEntityNotFound(_0x10bdeb,null))[_0x6e88('0x1e')](function(_0x4ea996){if(_0x4ea996){_0x54eb76['interaction']=_0x4ea996['get']({'plain':!![]});interaction_log[_0x6e88('0x1f')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2de834[_0x6e88('0x57')]['id'],_0x2de834[_0x6e88('0x57')][_0x6e88('0x34')],_0x2de834[_0x6e88('0x57')]['role'],_0x54eb76[_0x6e88('0x5c')]['id'],_0x2de834[_0x6e88('0x4f')]?JSON['stringify'](_0x2de834['body']):_0x6e88('0x70'));return respondWithRpcPromise(_0x6e88('0x71'),_0x6e88('0x72'),_0x54eb76);}return null;})[_0x6e88('0x1e')](function(_0xb18c04){var _0x509108='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xb18c04[_0x6e88('0x24')][_0x6e88('0x60')];return db[_0x6e88('0x73')]['query'](_0x509108,{'type':db[_0x6e88('0x61')]['QueryTypes'][_0x6e88('0x74')],'raw':!![]})[_0x6e88('0x1e')](function(_0x2e82b8){return _0x2e82b8;});})[_0x6e88('0x1e')](function(_0x2c59e7){if(_0x2c59e7){_0x54eb76[_0x6e88('0x24')][_0x6e88('0x62')]=_0x2c59e7[0x0];if(!_0x2de834[_0x6e88('0x4f')][_0x6e88('0x56')])return;return db['User']['find']({'where':{'id':_0x2de834[_0x6e88('0x4f')]['UserId'],'role':_0x6e88('0x58')},'attributes':['id',_0x6e88('0x34'),_0x6e88('0x64'),_0x6e88('0x65'),_0x6e88('0x66')],'raw':!![]});}return null;})[_0x6e88('0x1e')](function(_0x157959){if(!_0x157959)return null;_0x54eb76[_0x6e88('0x24')][_0x6e88('0x58')]=_0x157959;return _0x54eb76;})[_0x6e88('0x1e')](function(_0x5270f8){if(_0x5270f8){_0x5270f8[_0x6e88('0x24')][_0x6e88('0x75')]=util[_0x6e88('0x54')]('SIP/%s',_0x2de834[_0x6e88('0x57')][_0x6e88('0x34')]);_0x5270f8[_0x6e88('0x24')][_0x6e88('0x69')]=_0x54eb76[_0x6e88('0x69')];_0x5270f8[_0x6e88('0x24')]['motionChannel']=_0x54eb76[_0x6e88('0x69')];_0x5270f8[_0x6e88('0x24')]['event']=_0x6e88('0x6e');respondWithRpcPromise(_0x6e88('0x6b'),'EventManager',{'event':_0x6e88('0x76'),'message':_['merge'](_0x54eb76['message'],JSON['parse'](_0x54eb76[_0x6e88('0x5c')]['formData']))},client9002);return _0x54eb76;}return null;})[_0x6e88('0x1e')](respondWithResult(_0x10bdeb,null))[_0x6e88('0x26')](handleError(_0x10bdeb,null));}; \ No newline at end of file +var _0x4c18=['RejectMessage','rejectMessage','Sequelize','interface','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','destroy','name','send','map','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','ChatMessage','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','describe','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE: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','SELECT','contact','User','fullname','email','manual','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat-interactions'];(function(_0x4be97b,_0x419fac){var _0x3b1f2a=function(_0x709fa2){while(--_0x709fa2){_0x4be97b['push'](_0x4be97b['shift']());}};_0x3b1f2a(++_0x419fac);}(_0x4c18,0x8c));var _0x84c1=function(_0x15a1e0,_0x229403){_0x15a1e0=_0x15a1e0-0x0;var _0x246430=_0x4c18[_0x15a1e0];return _0x246430;};'use strict';var emlformat=require(_0x84c1('0x0'));var rimraf=require(_0x84c1('0x1'));var zipdir=require(_0x84c1('0x2'));var jsonpatch=require(_0x84c1('0x3'));var rp=require(_0x84c1('0x4'));var moment=require(_0x84c1('0x5'));var BPromise=require(_0x84c1('0x6'));var Mustache=require(_0x84c1('0x7'));var util=require('util');var path=require(_0x84c1('0x8'));var sox=require(_0x84c1('0x9'));var csv=require(_0x84c1('0xa'));var ejs=require(_0x84c1('0xb'));var fs=require('fs');var fs_extra=require(_0x84c1('0xc'));var _=require(_0x84c1('0xd'));var squel=require(_0x84c1('0xe'));var crypto=require(_0x84c1('0xf'));var jsforce=require(_0x84c1('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x84c1('0xa'));var querystring=require(_0x84c1('0x11'));var Papa=require('papaparse');var Redis=require(_0x84c1('0x12'));var authService=require(_0x84c1('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x84c1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84c1('0x15'))(_0x84c1('0x16'));var utils=require(_0x84c1('0x17'));var config=require(_0x84c1('0x18'));var licenseUtil=require(_0x84c1('0x19'));var db=require(_0x84c1('0x1a'))['db'];config[_0x84c1('0x1b')]=_[_0x84c1('0x1c')](config['redis'],{'host':_0x84c1('0x1d'),'port':0x18eb});var socket=require(_0x84c1('0x1e'))(new Redis(config[_0x84c1('0x1b')]));require(_0x84c1('0x1f'))[_0x84c1('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x84c1('0x21')]['http']({'port':0x232c});var client9002=jayson[_0x84c1('0x21')][_0x84c1('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x22c2fd,_0xa6eba8,_0x59c3e8,_0x199a0c){return new BPromise(function(_0x483b0a,_0xd166e9){var _0x438c94=_0x199a0c||client;return _0x438c94[_0x84c1('0x23')](_0x22c2fd,_0x59c3e8)[_0x84c1('0x24')](function(_0x5e0c4f){logger[_0x84c1('0x25')](_0x84c1('0x26'),_0xa6eba8,_0x84c1('0x27'));logger[_0x84c1('0x28')](_0x84c1('0x29'),_0xa6eba8,_0x84c1('0x27'),JSON[_0x84c1('0x2a')](_0x5e0c4f));if(_0x5e0c4f['error']){if(_0x5e0c4f[_0x84c1('0x2b')][_0x84c1('0x2c')]===0x1f4){logger[_0x84c1('0x2b')](_0x84c1('0x26'),_0xa6eba8,_0x5e0c4f['error'][_0x84c1('0x2d')]);return _0xd166e9(_0x5e0c4f['error'][_0x84c1('0x2d')]);}logger['error'](_0x84c1('0x26'),_0xa6eba8,_0x5e0c4f[_0x84c1('0x2b')][_0x84c1('0x2d')]);return _0x483b0a(_0x5e0c4f[_0x84c1('0x2b')][_0x84c1('0x2d')]);}else{logger[_0x84c1('0x25')]('ChatMessage,\x20%s,\x20%s',_0xa6eba8,_0x84c1('0x27'));_0x483b0a(_0x5e0c4f['result'][_0x84c1('0x2d')]);}})['catch'](function(_0x37c587){logger['error'](_0x84c1('0x26'),_0xa6eba8,_0x37c587);_0xd166e9(_0x37c587);});});}function respondWithStatusCode(_0x5b4c21,_0x45c2b6){_0x45c2b6=_0x45c2b6||0xcc;return function(_0xf82a69){if(_0xf82a69){return _0x5b4c21[_0x84c1('0x2e')](_0x45c2b6);}return _0x5b4c21[_0x84c1('0x2f')](_0x45c2b6)[_0x84c1('0x30')]();};}function respondWithResult(_0x5bdb6a,_0x114cc3){_0x114cc3=_0x114cc3||0xc8;return function(_0xd7a6f0){if(_0xd7a6f0){return _0x5bdb6a[_0x84c1('0x2f')](_0x114cc3)['json'](_0xd7a6f0);}};}function respondWithFilteredResult(_0x1721fc,_0x34c2c9){return function(_0x30d6c1){if(_0x30d6c1){var _0x4a274e=typeof _0x34c2c9['offset']===_0x84c1('0x31')&&typeof _0x34c2c9[_0x84c1('0x32')]===_0x84c1('0x31');var _0x1c704f=_0x30d6c1[_0x84c1('0x33')];var _0xf8645a=_0x4a274e?0x0:_0x34c2c9['offset'];var _0x4b0d2f=_0x4a274e?_0x30d6c1[_0x84c1('0x33')]:_0x34c2c9[_0x84c1('0x34')]+_0x34c2c9[_0x84c1('0x32')];var _0x39efbc;if(_0x4b0d2f>=_0x1c704f){_0x4b0d2f=_0x1c704f;_0x39efbc=0xc8;}else{_0x39efbc=0xce;}_0x1721fc[_0x84c1('0x2f')](_0x39efbc);return _0x1721fc[_0x84c1('0x35')]('Content-Range',_0xf8645a+'-'+_0x4b0d2f+'/'+_0x1c704f)[_0x84c1('0x36')](_0x30d6c1);}return null;};}function patchUpdates(_0x32411e){return function(_0x59efc1){try{jsonpatch[_0x84c1('0x37')](_0x59efc1,_0x32411e,!![]);}catch(_0x4e85c0){return BPromise[_0x84c1('0x38')](_0x4e85c0);}return _0x59efc1[_0x84c1('0x39')]();};}function saveUpdates(_0x1fddbc,_0x5815b4){return function(_0x30c24f){if(_0x30c24f){return _0x30c24f[_0x84c1('0x3a')](_0x1fddbc)['then'](function(_0x54f574){return _0x54f574;});}return null;};}function removeEntity(_0x403fc5,_0x579d7d){return function(_0x481733){if(_0x481733){return _0x481733[_0x84c1('0x3b')]()[_0x84c1('0x24')](function(){_0x403fc5['status'](0xcc)[_0x84c1('0x30')]();});}};}function handleEntityNotFound(_0x5c4064,_0x43e6de){return function(_0x3b2080){if(!_0x3b2080){_0x5c4064[_0x84c1('0x2e')](0x194);}return _0x3b2080;};}function handleError(_0x4f7dce,_0x3d75fc){_0x3d75fc=_0x3d75fc||0x1f4;return function(_0xdf2508){logger[_0x84c1('0x2b')](_0xdf2508['stack']);if(_0xdf2508[_0x84c1('0x3c')]){delete _0xdf2508[_0x84c1('0x3c')];}_0x4f7dce[_0x84c1('0x2f')](_0x3d75fc)[_0x84c1('0x3d')](_0xdf2508);};}exports['index']=function(_0x477948,_0x40c005){var _0x34841f={},_0x1e6e64={},_0x1f97ea={'count':0x0,'rows':[]};var _0x1028bf=_[_0x84c1('0x3e')](db['ChatMessage']['rawAttributes'],function(_0x147341){return{'name':_0x147341['fieldName'],'type':_0x147341[_0x84c1('0x3f')][_0x84c1('0x40')]};});_0x1e6e64[_0x84c1('0x41')]=_[_0x84c1('0x3e')](_0x1028bf,_0x84c1('0x3c'));_0x1e6e64['query']=_['keys'](_0x477948[_0x84c1('0x42')]);_0x1e6e64['filters']=_[_0x84c1('0x43')](_0x1e6e64['model'],_0x1e6e64[_0x84c1('0x42')]);_0x34841f['attributes']=_['intersection'](_0x1e6e64['model'],qs[_0x84c1('0x44')](_0x477948[_0x84c1('0x42')][_0x84c1('0x44')]));_0x34841f[_0x84c1('0x45')]=_0x34841f[_0x84c1('0x45')][_0x84c1('0x46')]?_0x34841f[_0x84c1('0x45')]:_0x1e6e64[_0x84c1('0x41')];if(!_0x477948[_0x84c1('0x42')]['hasOwnProperty'](_0x84c1('0x47'))){_0x34841f[_0x84c1('0x32')]=qs[_0x84c1('0x32')](_0x477948[_0x84c1('0x42')]['limit']);_0x34841f[_0x84c1('0x34')]=qs[_0x84c1('0x34')](_0x477948[_0x84c1('0x42')][_0x84c1('0x34')]);}_0x34841f[_0x84c1('0x48')]=qs[_0x84c1('0x49')](_0x477948[_0x84c1('0x42')][_0x84c1('0x49')]);_0x34841f[_0x84c1('0x4a')]=qs['filters'](_[_0x84c1('0x4b')](_0x477948[_0x84c1('0x42')],_0x1e6e64[_0x84c1('0x4c')]),_0x1028bf);if(_0x477948['query'][_0x84c1('0x4d')]){_0x34841f[_0x84c1('0x4a')]=_[_0x84c1('0x4e')](_0x34841f['where'],{'$or':_[_0x84c1('0x3e')](_0x1028bf,function(_0x16c57b){if(_0x16c57b['type']!==_0x84c1('0x4f')){var _0x36361d={};_0x36361d[_0x16c57b[_0x84c1('0x3c')]]={'$like':'%'+_0x477948['query'][_0x84c1('0x4d')]+'%'};return _0x36361d;}})});}_0x34841f=_['merge']({},_0x34841f,_0x477948[_0x84c1('0x50')]);var _0x295c90={'where':_0x34841f[_0x84c1('0x4a')]};return db[_0x84c1('0x51')][_0x84c1('0x33')](_0x295c90)[_0x84c1('0x24')](function(_0x2cb22e){_0x1f97ea[_0x84c1('0x33')]=_0x2cb22e;if(_0x477948[_0x84c1('0x42')][_0x84c1('0x52')]){_0x34841f[_0x84c1('0x53')]=[{'all':!![]}];}return db[_0x84c1('0x51')][_0x84c1('0x54')](_0x34841f);})[_0x84c1('0x24')](function(_0x58211a){_0x1f97ea[_0x84c1('0x55')]=_0x58211a;return _0x1f97ea;})[_0x84c1('0x24')](respondWithFilteredResult(_0x40c005,_0x34841f))['catch'](handleError(_0x40c005,null));};exports[_0x84c1('0x56')]=function(_0x7b2cd8,_0xf509cf){var _0x46c5df={'raw':!![],'where':{'id':_0x7b2cd8[_0x84c1('0x57')]['id']}},_0x51a823={};_0x51a823[_0x84c1('0x41')]=_[_0x84c1('0x58')](db['ChatMessage'][_0x84c1('0x59')]);_0x51a823[_0x84c1('0x42')]=_[_0x84c1('0x58')](_0x7b2cd8[_0x84c1('0x42')]);_0x51a823['filters']=_[_0x84c1('0x43')](_0x51a823[_0x84c1('0x41')],_0x51a823['query']);_0x46c5df[_0x84c1('0x45')]=_[_0x84c1('0x43')](_0x51a823[_0x84c1('0x41')],qs['fields'](_0x7b2cd8[_0x84c1('0x42')][_0x84c1('0x44')]));_0x46c5df['attributes']=_0x46c5df[_0x84c1('0x45')][_0x84c1('0x46')]?_0x46c5df[_0x84c1('0x45')]:_0x51a823['model'];if(_0x7b2cd8[_0x84c1('0x42')][_0x84c1('0x52')]){_0x46c5df[_0x84c1('0x53')]=[{'all':!![]}];}_0x46c5df=_[_0x84c1('0x4e')]({},_0x46c5df,_0x7b2cd8[_0x84c1('0x50')]);return db[_0x84c1('0x51')][_0x84c1('0x5a')](_0x46c5df)['then'](handleEntityNotFound(_0xf509cf,null))[_0x84c1('0x24')](respondWithResult(_0xf509cf,null))[_0x84c1('0x5b')](handleError(_0xf509cf,null));};exports[_0x84c1('0x5c')]=function(_0x37de6d,_0x1b8a27){return db['ChatMessage'][_0x84c1('0x5c')](_0x37de6d[_0x84c1('0x5d')],{})[_0x84c1('0x24')](respondWithResult(_0x1b8a27,0xc9))[_0x84c1('0x5b')](handleError(_0x1b8a27,null));};exports[_0x84c1('0x3a')]=function(_0x179a91,_0x17e3d9){if(_0x179a91['body']['id']){delete _0x179a91['body']['id'];}return db[_0x84c1('0x51')][_0x84c1('0x5a')]({'where':{'id':_0x179a91[_0x84c1('0x57')]['id']}})[_0x84c1('0x24')](handleEntityNotFound(_0x17e3d9,null))[_0x84c1('0x24')](saveUpdates(_0x179a91[_0x84c1('0x5d')],null))[_0x84c1('0x24')](respondWithResult(_0x17e3d9,null))['catch'](handleError(_0x17e3d9,null));};exports[_0x84c1('0x3b')]=function(_0x346521,_0x52e15e){return db[_0x84c1('0x51')][_0x84c1('0x5a')]({'where':{'id':_0x346521[_0x84c1('0x57')]['id']}})[_0x84c1('0x24')](handleEntityNotFound(_0x52e15e,null))[_0x84c1('0x24')](removeEntity(_0x52e15e,null))['catch'](handleError(_0x52e15e,null));};exports[_0x84c1('0x5e')]=function(_0x3096dd,_0x45ca9b){return db['ChatMessage'][_0x84c1('0x5e')]()[_0x84c1('0x24')](respondWithResult(_0x45ca9b,null))[_0x84c1('0x5b')](handleError(_0x45ca9b,null));};var interaction_log=require(_0x84c1('0x15'))('chat-interactions');exports[_0x84c1('0x5f')]=function(_0x19da11,_0x1df2ea,_0x1644cd){var _0x341768={'agent':{},'channel':_0x84c1('0x60')};if(_0x19da11[_0x84c1('0x5d')]['id']){delete _0x19da11['body']['id'];}_0x19da11[_0x84c1('0x5d')][_0x84c1('0x61')]=!![];_0x19da11[_0x84c1('0x5d')]['readAt']=moment()[_0x84c1('0x62')](_0x84c1('0x63'));_0x19da11[_0x84c1('0x5d')][_0x84c1('0x64')]=_0x19da11[_0x84c1('0x5d')][_0x84c1('0x64')]||_0x19da11[_0x84c1('0x65')]['id'];_0x341768[_0x84c1('0x66')]['id']=_0x19da11[_0x84c1('0x5d')][_0x84c1('0x64')];return db[_0x84c1('0x51')][_0x84c1('0x5a')]({'where':{'id':_0x19da11['params']['id'],'UserId':null}})[_0x84c1('0x24')](handleEntityNotFound(_0x1df2ea,null))[_0x84c1('0x24')](saveUpdates(_0x19da11[_0x84c1('0x5d')],null))['then'](function(_0x2b80b6){if(_0x2b80b6){_0x341768[_0x84c1('0x2d')]=_0x2b80b6[_0x84c1('0x67')]({'plain':!![]});return db[_0x84c1('0x68')]['find']({'where':{'id':_0x2b80b6[_0x84c1('0x69')]}});}return null;})[_0x84c1('0x24')](handleEntityNotFound(_0x1df2ea,null))[_0x84c1('0x24')](function(_0x182df5){if(_0x182df5){return _0x182df5[_0x84c1('0x3a')]({'UserId':_0x19da11[_0x84c1('0x5d')]['UserId'],'read1stAt':_[_0x84c1('0x6a')](_0x182df5[_0x84c1('0x6b')])?moment()['format'](_0x84c1('0x63')):undefined});}return null;})[_0x84c1('0x24')](function(_0xb38387){if(_0xb38387){_0x341768[_0x84c1('0x6c')]=_0xb38387[_0x84c1('0x67')]({'plain':!![]});interaction_log['info'](_0x84c1('0x6d'),_0x19da11[_0x84c1('0x65')]['id'],_0x19da11[_0x84c1('0x65')]['name'],_0x19da11['user'][_0x84c1('0x6e')],_0x341768[_0x84c1('0x6c')]['id'],_0x19da11['body']?JSON['stringify'](_0x19da11[_0x84c1('0x5d')]):_0x84c1('0x6f'));return respondWithRpcPromise('AcceptMessage',_0x84c1('0x70'),_0x341768);}return null;})[_0x84c1('0x24')](function(_0x5c56eb){var _0x32fc51=_0x84c1('0x71')+_0x5c56eb[_0x84c1('0x2d')][_0x84c1('0x72')];return db[_0x84c1('0x73')]['query'](_0x32fc51,{'type':db['Sequelize']['QueryTypes'][_0x84c1('0x74')],'raw':!![]})[_0x84c1('0x24')](function(_0x2d73d2){return _0x2d73d2;});})[_0x84c1('0x24')](function(_0x5913d2){if(_0x5913d2){_0x341768[_0x84c1('0x2d')][_0x84c1('0x75')]=_0x5913d2[0x0];if(!_0x19da11['body']['UserId'])return;return db[_0x84c1('0x76')][_0x84c1('0x5a')]({'where':{'id':_0x19da11[_0x84c1('0x5d')][_0x84c1('0x64')],'role':_0x84c1('0x66')},'attributes':['id',_0x84c1('0x3c'),_0x84c1('0x77'),_0x84c1('0x78'),'internal'],'raw':!![]});}return null;})['then'](function(_0x3cea15){if(!_0x3cea15)return null;_0x341768[_0x84c1('0x2d')][_0x84c1('0x66')]=_0x3cea15;return _0x341768;})[_0x84c1('0x24')](function(_0x499487){if(_0x499487){if(_0x19da11['body'][_0x84c1('0x79')]){_0x341768[_0x84c1('0x2d')]['interface']=util[_0x84c1('0x62')]('SIP/%s',_0x19da11['user'][_0x84c1('0x3c')]);_0x341768['message'][_0x84c1('0x7a')]=_0x341768['channel'];_0x341768[_0x84c1('0x2d')][_0x84c1('0x7b')]=_0x341768['channel'];_0x341768[_0x84c1('0x2d')][_0x84c1('0x7c')]=_0x84c1('0x5f');return respondWithRpcPromise('EventManager',_0x84c1('0x7d'),{'event':_0x84c1('0x7e'),'message':_[_0x84c1('0x4e')](_0x341768['message'],JSON[_0x84c1('0x7f')](_0x341768['interaction'][_0x84c1('0x80')]))},client9002)[_0x84c1('0x24')](function(){return _0x341768;});}return _0x341768;}return null;})[_0x84c1('0x24')](respondWithResult(_0x1df2ea,null))[_0x84c1('0x5b')](handleError(_0x1df2ea,null));};var interaction_log=require('../../config/logger')(_0x84c1('0x81'));exports[_0x84c1('0x38')]=function(_0x48ba7e,_0x4e128d,_0x19ee6d){var _0x5e03a1={'agent':{},'channel':_0x84c1('0x60')};if(_0x48ba7e[_0x84c1('0x5d')]['id']){delete _0x48ba7e['body']['id'];}_0x48ba7e['body'][_0x84c1('0x64')]=_0x48ba7e[_0x84c1('0x5d')][_0x84c1('0x64')]||_0x48ba7e[_0x84c1('0x65')]['id'];_0x5e03a1[_0x84c1('0x66')]['id']=_0x48ba7e['body'][_0x84c1('0x64')];return db[_0x84c1('0x51')][_0x84c1('0x5a')]({'where':{'id':_0x48ba7e[_0x84c1('0x57')]['id'],'UserId':null}})[_0x84c1('0x24')](handleEntityNotFound(_0x4e128d,null))[_0x84c1('0x24')](function(_0xcf173a){if(_0xcf173a){_0x5e03a1[_0x84c1('0x2d')]=_0xcf173a[_0x84c1('0x67')]({'plain':!![]});return db[_0x84c1('0x68')][_0x84c1('0x5a')]({'where':{'id':_0xcf173a[_0x84c1('0x69')]}});}return null;})[_0x84c1('0x24')](handleEntityNotFound(_0x4e128d,null))[_0x84c1('0x24')](function(_0x2d1212){if(_0x2d1212){_0x5e03a1[_0x84c1('0x6c')]=_0x2d1212[_0x84c1('0x67')]({'plain':!![]});interaction_log[_0x84c1('0x25')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x48ba7e[_0x84c1('0x65')]['id'],_0x48ba7e[_0x84c1('0x65')]['name'],_0x48ba7e[_0x84c1('0x65')][_0x84c1('0x6e')],_0x5e03a1[_0x84c1('0x6c')]['id'],_0x48ba7e[_0x84c1('0x5d')]?JSON[_0x84c1('0x2a')](_0x48ba7e[_0x84c1('0x5d')]):'null');return respondWithRpcPromise(_0x84c1('0x82'),_0x84c1('0x83'),_0x5e03a1);}return null;})[_0x84c1('0x24')](function(_0x1e7405){var _0x3083f7=_0x84c1('0x71')+_0x1e7405[_0x84c1('0x2d')][_0x84c1('0x72')];return db[_0x84c1('0x73')][_0x84c1('0x42')](_0x3083f7,{'type':db[_0x84c1('0x84')]['QueryTypes'][_0x84c1('0x74')],'raw':!![]})[_0x84c1('0x24')](function(_0xffb50f){return _0xffb50f;});})[_0x84c1('0x24')](function(_0x1acc6b){if(_0x1acc6b){_0x5e03a1[_0x84c1('0x2d')][_0x84c1('0x75')]=_0x1acc6b[0x0];if(!_0x48ba7e[_0x84c1('0x5d')][_0x84c1('0x64')])return;return db['User']['find']({'where':{'id':_0x48ba7e[_0x84c1('0x5d')][_0x84c1('0x64')],'role':_0x84c1('0x66')},'attributes':['id','name','fullname',_0x84c1('0x78'),'internal'],'raw':!![]});}return null;})['then'](function(_0x355561){if(!_0x355561)return null;_0x5e03a1[_0x84c1('0x2d')][_0x84c1('0x66')]=_0x355561;return _0x5e03a1;})[_0x84c1('0x24')](function(_0x1f2184){if(_0x1f2184){_0x1f2184[_0x84c1('0x2d')][_0x84c1('0x85')]=util[_0x84c1('0x62')]('SIP/%s',_0x48ba7e[_0x84c1('0x65')]['name']);_0x1f2184[_0x84c1('0x2d')][_0x84c1('0x7a')]=_0x5e03a1[_0x84c1('0x7a')];_0x1f2184[_0x84c1('0x2d')][_0x84c1('0x7b')]=_0x5e03a1[_0x84c1('0x7a')];_0x1f2184['message'][_0x84c1('0x7c')]=_0x84c1('0x38');respondWithRpcPromise(_0x84c1('0x7d'),_0x84c1('0x7d'),{'event':_0x84c1('0x86'),'message':_[_0x84c1('0x4e')](_0x5e03a1['message'],JSON[_0x84c1('0x7f')](_0x5e03a1['interaction']['formData']))},client9002);return _0x5e03a1;}return null;})['then'](respondWithResult(_0x4e128d,null))[_0x84c1('0x5b')](handleError(_0x4e128d,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 1b99ccd..309d50f 100644 --- a/server/api/chatMessage/chatMessage.events.js +++ b/server/api/chatMessage/chatMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a6c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x771b25,_0x286c5f){var _0x42522f=function(_0x75c890){while(--_0x75c890){_0x771b25['push'](_0x771b25['shift']());}};_0x42522f(++_0x286c5f);}(_0x8a6c,0x19f));var _0xc8a6=function(_0x166714,_0x244119){_0x166714=_0x166714-0x0;var _0x1e40a0=_0x8a6c[_0x166714];return _0x1e40a0;};'use strict';var EventEmitter=require(_0xc8a6('0x0'));var ChatMessage=require(_0xc8a6('0x1'))['db'][_0xc8a6('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xc8a6('0x3')](0x0);var events={'afterCreate':_0xc8a6('0x4'),'afterUpdate':_0xc8a6('0x5'),'afterDestroy':_0xc8a6('0x6')};function emitEvent(_0x447bcd){return function(_0x422ef5,_0x36aa54,_0x2b920f){ChatMessageEvents[_0xc8a6('0x7')](_0x447bcd+':'+_0x422ef5['id'],_0x422ef5);ChatMessageEvents[_0xc8a6('0x7')](_0x447bcd,_0x422ef5);_0x2b920f(null);};}for(var e in events){if(events[_0xc8a6('0x8')](e)){var event=events[e];ChatMessage[_0xc8a6('0x9')](e,emitEvent(event));}}module[_0xc8a6('0xa')]=ChatMessageEvents; \ No newline at end of file +var _0xfa29=['setMaxListeners','update','remove','emit','hook','../../mysqldb'];(function(_0x185133,_0x29a472){var _0x862f7f=function(_0x25ea87){while(--_0x25ea87){_0x185133['push'](_0x185133['shift']());}};_0x862f7f(++_0x29a472);}(_0xfa29,0x95));var _0x9fa2=function(_0x3fa5f9,_0xb7f5df){_0x3fa5f9=_0x3fa5f9-0x0;var _0x4117ec=_0xfa29[_0x3fa5f9];return _0x4117ec;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x9fa2('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9fa2('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9fa2('0x2'),'afterDestroy':_0x9fa2('0x3')};function emitEvent(_0x431e1e){return function(_0x4ae905,_0x3371cc,_0x5714ff){ChatMessageEvents['emit'](_0x431e1e+':'+_0x4ae905['id'],_0x4ae905);ChatMessageEvents[_0x9fa2('0x4')](_0x431e1e,_0x4ae905);_0x5714ff(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x9fa2('0x5')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 670e6e9..11d4891 100644 --- a/server/api/chatMessage/chatMessage.model.js +++ b/server/api/chatMessage/chatMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15ff=['./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x307a28,_0x2bdd9f){var _0x523ac7=function(_0x173ff2){while(--_0x173ff2){_0x307a28['push'](_0x307a28['shift']());}};_0x523ac7(++_0x2bdd9f);}(_0x15ff,0x74));var _0xf15f=function(_0x53902a,_0x4abe1c){_0x53902a=_0x53902a-0x0;var _0x4772e4=_0x15ff[_0x53902a];return _0x4772e4;};'use strict';var _=require(_0xf15f('0x0'));var util=require(_0xf15f('0x1'));var logger=require('../../config/logger')(_0xf15f('0x2'));var moment=require('moment');var BPromise=require(_0xf15f('0x3'));var rp=require(_0xf15f('0x4'));var fs=require('fs');var path=require(_0xf15f('0x5'));var rimraf=require(_0xf15f('0x6'));var config=require(_0xf15f('0x7'));var attributes=require(_0xf15f('0x8'));module['exports']=function(_0x31df48,_0x48b6a4){return _0x31df48[_0xf15f('0x9')](_0xf15f('0xa'),attributes,{'tableName':_0xf15f('0xb'),'paranoid':![],'indexes':[{'name':_0xf15f('0xc'),'fields':['body'],'type':_0xf15f('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x122f18,_0xec7424,_0x5f18ef){var _0x1dfda0=_0x31df48[_0xf15f('0xe')];var _0x4fa7d8=_0x122f18[_0xf15f('0xf')]({'plain':!![]});if(_0x4fa7d8[_0xf15f('0x10')][_0xf15f('0x11')]()==='in'||_0x4fa7d8[_0xf15f('0x10')][_0xf15f('0x11')]()===_0xf15f('0x12')&&!_0x4fa7d8[_0xf15f('0x13')]&&!_[_0xf15f('0x14')](_0x4fa7d8[_0xf15f('0x15')])){_0x1dfda0[_0xf15f('0x16')][_0xf15f('0x17')]({'where':{'id':_0x4fa7d8[_0xf15f('0x18')]}})[_0xf15f('0x19')](function(_0x273c5d){if(_0x273c5d){_0x273c5d[_0xf15f('0x1a')]({'lastMsgAt':_0x4fa7d8[_0xf15f('0x1b')],'lastMsgDirection':_0x4fa7d8[_0xf15f('0x10')][_0xf15f('0x11')]()});}})[_0xf15f('0x1c')](function(_0x5331ff){console['error'](_0x5331ff);});}_0x5f18ef();}},'charset':_0xf15f('0x1d'),'collate':_0xf15f('0x1e')});}; \ No newline at end of file +var _0x68da=['../../config/environment','./chatMessage.attributes','exports','chat_messages','fti_chat_messages','body','models','get','toLowerCase','direction','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x68da,0x173));var _0xa68d=function(_0x2c2980,_0x34282a){_0x2c2980=_0x2c2980-0x0;var _0x2a20a9=_0x68da[_0x2c2980];return _0x2a20a9;};'use strict';var _=require(_0xa68d('0x0'));var util=require(_0xa68d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa68d('0x2'));var BPromise=require(_0xa68d('0x3'));var rp=require(_0xa68d('0x4'));var fs=require('fs');var path=require(_0xa68d('0x5'));var rimraf=require(_0xa68d('0x6'));var config=require(_0xa68d('0x7'));var attributes=require(_0xa68d('0x8'));module[_0xa68d('0x9')]=function(_0x1973bf,_0x15fb12){return _0x1973bf['define']('ChatMessage',attributes,{'tableName':_0xa68d('0xa'),'paranoid':![],'indexes':[{'name':_0xa68d('0xb'),'fields':[_0xa68d('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x342150,_0x1d0a66,_0x59abe9){var _0x1c371e=_0x1973bf[_0xa68d('0xd')];var _0x4e790a=_0x342150[_0xa68d('0xe')]({'plain':!![]});if(_0x4e790a['direction'][_0xa68d('0xf')]()==='in'||_0x4e790a[_0xa68d('0x10')][_0xa68d('0xf')]()==='out'&&!_0x4e790a['secret']&&!_[_0xa68d('0x11')](_0x4e790a[_0xa68d('0x12')])){_0x1c371e[_0xa68d('0x13')][_0xa68d('0x14')]({'where':{'id':_0x4e790a[_0xa68d('0x15')]}})['then'](function(_0x4d45ff){if(_0x4d45ff){_0x4d45ff[_0xa68d('0x16')]({'lastMsgAt':_0x4e790a['createdAt'],'lastMsgDirection':_0x4e790a[_0xa68d('0x10')]['toLowerCase']()});}})[_0xa68d('0x17')](function(_0x2fe339){console[_0xa68d('0x18')](_0x2fe339);});}_0x59abe9();}},'charset':_0xa68d('0x19'),'collate':_0xa68d('0x1a')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index c0e7495..2b44ca2 100644 --- a/server/api/chatMessage/chatMessage.rpc.js +++ b/server/api/chatMessage/chatMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc811=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','redis','defaults','localhost','./chatMessage.socket','register','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','CreateChatMessage','body','options','raw','moment'];(function(_0x84293f,_0x1b4173){var _0x15a611=function(_0x32f46b){while(--_0x32f46b){_0x84293f['push'](_0x84293f['shift']());}};_0x15a611(++_0x1b4173);}(_0xc811,0x14f));var _0x1c81=function(_0xc695a3,_0x116142){_0xc695a3=_0xc695a3-0x0;var _0x2d0864=_0xc811[_0xc695a3];return _0x2d0864;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1c81('0x0'));var BPromise=require(_0x1c81('0x1'));var rs=require(_0x1c81('0x2'));var fs=require('fs');var Redis=require(_0x1c81('0x3'));var db=require(_0x1c81('0x4'))['db'];var utils=require(_0x1c81('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1c81('0x6')][_0x1c81('0x7')]({'port':0x232a});config[_0x1c81('0x8')]=_[_0x1c81('0x9')](config[_0x1c81('0x8')],{'host':_0x1c81('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c81('0x8')]));require(_0x1c81('0xb'))[_0x1c81('0xc')](socket);function respondWithRpcPromise(_0x258352,_0x431f18,_0x276c12){return new BPromise(function(_0xa76a20,_0x1d5c67){return client['request'](_0x258352,_0x276c12)[_0x1c81('0xd')](function(_0x2edd09){logger['info'](_0x1c81('0xe'),_0x431f18,'request\x20sent');logger[_0x1c81('0xf')](_0x1c81('0x10'),_0x431f18,_0x1c81('0x11'),JSON[_0x1c81('0x12')](_0x2edd09));if(_0x2edd09[_0x1c81('0x13')]){if(_0x2edd09['error']['code']===0x1f4){logger[_0x1c81('0x13')](_0x1c81('0xe'),_0x431f18,_0x2edd09['error'][_0x1c81('0x14')]);return _0x1d5c67(_0x2edd09[_0x1c81('0x13')][_0x1c81('0x14')]);}logger[_0x1c81('0x13')](_0x1c81('0xe'),_0x431f18,_0x2edd09['error'][_0x1c81('0x14')]);return _0xa76a20(_0x2edd09[_0x1c81('0x13')]['message']);}else{logger[_0x1c81('0x15')](_0x1c81('0xe'),_0x431f18,_0x1c81('0x11'));_0xa76a20(_0x2edd09[_0x1c81('0x16')][_0x1c81('0x14')]);}})[_0x1c81('0x17')](function(_0x1da860){logger[_0x1c81('0x13')]('ChatMessage,\x20%s,\x20%s',_0x431f18,_0x1da860);_0x1d5c67(_0x1da860);});});}exports[_0x1c81('0x18')]=function(_0x3b96cd){var _0x896934=this;return new Promise(function(_0x45d2c5,_0x56e6cc){return db['ChatMessage']['create'](_0x3b96cd[_0x1c81('0x19')],{'raw':_0x3b96cd[_0x1c81('0x1a')]?_0x3b96cd['options'][_0x1c81('0x1b')]===undefined?!![]:![]:!![]})[_0x1c81('0xd')](function(_0x574108){logger[_0x1c81('0x15')](_0x1c81('0x18'),_0x3b96cd);logger[_0x1c81('0xf')](_0x1c81('0x18'),_0x3b96cd,JSON[_0x1c81('0x12')](_0x574108));_0x45d2c5(_0x574108);})[_0x1c81('0x17')](function(_0x38bdb6){logger[_0x1c81('0x13')](_0x1c81('0x18'),_0x38bdb6['message'],_0x3b96cd);_0x56e6cc(_0x896934[_0x1c81('0x13')](0x1f4,_0x38bdb6['message']));});});}; \ No newline at end of file +var _0xb1dc=['CreateChatMessage','create','body','raw','then','debug','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch'];(function(_0x8d1dba,_0x19297d){var _0x230c62=function(_0x4ff4b1){while(--_0x4ff4b1){_0x8d1dba['push'](_0x8d1dba['shift']());}};_0x230c62(++_0x19297d);}(_0xb1dc,0x8a));var _0xcb1d=function(_0x507ac5,_0x33aaee){_0x507ac5=_0x507ac5-0x0;var _0x12c1bc=_0xb1dc[_0x507ac5];return _0x12c1bc;};'use strict';var _=require('lodash');var util=require(_0xcb1d('0x0'));var moment=require(_0xcb1d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb1d('0x2'));var db=require(_0xcb1d('0x3'))['db'];var utils=require(_0xcb1d('0x4'));var logger=require(_0xcb1d('0x5'))('rpc');var config=require(_0xcb1d('0x6'));var jayson=require(_0xcb1d('0x7'));var client=jayson[_0xcb1d('0x8')][_0xcb1d('0x9')]({'port':0x232a});config[_0xcb1d('0xa')]=_[_0xcb1d('0xb')](config[_0xcb1d('0xa')],{'host':_0xcb1d('0xc'),'port':0x18eb});var socket=require(_0xcb1d('0xd'))(new Redis(config['redis']));require(_0xcb1d('0xe'))[_0xcb1d('0xf')](socket);function respondWithRpcPromise(_0x510ff8,_0x13d22b,_0x290936){return new BPromise(function(_0x4adf7a,_0x5f2a73){return client[_0xcb1d('0x10')](_0x510ff8,_0x290936)['then'](function(_0x599ee9){logger[_0xcb1d('0x11')]('ChatMessage,\x20%s,\x20%s',_0x13d22b,'request\x20sent');logger['debug'](_0xcb1d('0x12'),_0x13d22b,_0xcb1d('0x13'),JSON[_0xcb1d('0x14')](_0x599ee9));if(_0x599ee9[_0xcb1d('0x15')]){if(_0x599ee9[_0xcb1d('0x15')][_0xcb1d('0x16')]===0x1f4){logger[_0xcb1d('0x15')](_0xcb1d('0x17'),_0x13d22b,_0x599ee9[_0xcb1d('0x15')][_0xcb1d('0x18')]);return _0x5f2a73(_0x599ee9['error'][_0xcb1d('0x18')]);}logger[_0xcb1d('0x15')](_0xcb1d('0x17'),_0x13d22b,_0x599ee9[_0xcb1d('0x15')][_0xcb1d('0x18')]);return _0x4adf7a(_0x599ee9[_0xcb1d('0x15')][_0xcb1d('0x18')]);}else{logger[_0xcb1d('0x11')]('ChatMessage,\x20%s,\x20%s',_0x13d22b,'request\x20sent');_0x4adf7a(_0x599ee9[_0xcb1d('0x19')][_0xcb1d('0x18')]);}})[_0xcb1d('0x1a')](function(_0x35cecd){logger[_0xcb1d('0x15')](_0xcb1d('0x17'),_0x13d22b,_0x35cecd);_0x5f2a73(_0x35cecd);});});}exports[_0xcb1d('0x1b')]=function(_0x454c50){var _0x41f188=this;return new Promise(function(_0x26d03f,_0x379a6b){return db['ChatMessage'][_0xcb1d('0x1c')](_0x454c50[_0xcb1d('0x1d')],{'raw':_0x454c50['options']?_0x454c50['options'][_0xcb1d('0x1e')]===undefined?!![]:![]:!![]})[_0xcb1d('0x1f')](function(_0x1ead05){logger[_0xcb1d('0x11')](_0xcb1d('0x1b'),_0x454c50);logger[_0xcb1d('0x20')](_0xcb1d('0x1b'),_0x454c50,JSON[_0xcb1d('0x14')](_0x1ead05));_0x26d03f(_0x1ead05);})[_0xcb1d('0x1a')](function(_0x43b42e){logger['error'](_0xcb1d('0x1b'),_0x43b42e[_0xcb1d('0x18')],_0x454c50);_0x379a6b(_0x41f188[_0xcb1d('0x15')](0x1f4,_0x43b42e[_0xcb1d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 9ea718b..ef7da23 100644 --- a/server/api/chatMessage/chatMessage.socket.js +++ b/server/api/chatMessage/chatMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46e1=['remove','update','emit','register','length','./chatMessage.events','save'];(function(_0x2debc2,_0x4a20fc){var _0x2cd301=function(_0x210259){while(--_0x210259){_0x2debc2['push'](_0x2debc2['shift']());}};_0x2cd301(++_0x4a20fc);}(_0x46e1,0x155));var _0x146e=function(_0x434757,_0x1605ce){_0x434757=_0x434757-0x0;var _0x10087c=_0x46e1[_0x434757];return _0x10087c;};'use strict';var ChatMessageEvents=require(_0x146e('0x0'));var events=[_0x146e('0x1'),_0x146e('0x2'),_0x146e('0x3')];function createListener(_0x155784,_0x1ff284){return function(_0x3708b1){_0x1ff284[_0x146e('0x4')](_0x155784,_0x3708b1);};}function removeListener(_0x18dab9,_0x3bbaec){return function(){ChatMessageEvents['removeListener'](_0x18dab9,_0x3bbaec);};}exports[_0x146e('0x5')]=function(_0x1f1f15){for(var _0x3de564=0x0,_0x228fe7=events[_0x146e('0x6')];_0x3de564<_0x228fe7;_0x3de564++){var _0x35e40e=events[_0x3de564];var _0x1c1398=createListener('chatMessage:'+_0x35e40e,_0x1f1f15);ChatMessageEvents['on'](_0x35e40e,_0x1c1398);}}; \ No newline at end of file +var _0xe14b=['removeListener','register','length','./chatMessage.events','save','emit'];(function(_0xb67251,_0x1f6208){var _0x979d96=function(_0x41d0d0){while(--_0x41d0d0){_0xb67251['push'](_0xb67251['shift']());}};_0x979d96(++_0x1f6208);}(_0xe14b,0x93));var _0xbe14=function(_0x3d2a97,_0x1f0a9f){_0x3d2a97=_0x3d2a97-0x0;var _0x4cb991=_0xe14b[_0x3d2a97];return _0x4cb991;};'use strict';var ChatMessageEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){ChatMessageEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('chatMessage:'+_0x196fca,_0x1fe204);ChatMessageEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 26200ca..59faa5b 100644 --- a/server/api/chatMessage/index.js +++ b/server/api/chatMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e8f=['tracked','chat','chatmessage:create','put','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','describe','/:id','show','post'];(function(_0x10427a,_0x1dfe34){var _0x45e8e2=function(_0x3f5fca){while(--_0x3f5fca){_0x10427a['push'](_0x10427a['shift']());}};_0x45e8e2(++_0x1dfe34);}(_0x9e8f,0x1ba));var _0xf9e8=function(_0x1d10a3,_0xdeea7c){_0x1d10a3=_0x1d10a3-0x0;var _0x4bf0d7=_0x9e8f[_0x1d10a3];return _0x4bf0d7;};'use strict';var multer=require(_0xf9e8('0x0'));var util=require(_0xf9e8('0x1'));var path=require(_0xf9e8('0x2'));var timeout=require(_0xf9e8('0x3'));var express=require('express');var router=express[_0xf9e8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf9e8('0x5'));var interaction=require(_0xf9e8('0x6'));var config=require('../../config/environment');var controller=require(_0xf9e8('0x7'));router[_0xf9e8('0x8')]('/',auth[_0xf9e8('0x9')](),controller['index']);router['get']('/describe',auth[_0xf9e8('0x9')](),controller[_0xf9e8('0xa')]);router['get'](_0xf9e8('0xb'),auth[_0xf9e8('0x9')](),controller[_0xf9e8('0xc')]);router[_0xf9e8('0xd')]('/',auth[_0xf9e8('0x9')](),interaction[_0xf9e8('0xe')](_0xf9e8('0xf'),_0xf9e8('0x10')),controller['create']);router[_0xf9e8('0x11')](_0xf9e8('0xb'),controller['update']);router['put'](_0xf9e8('0x12'),auth[_0xf9e8('0x9')](),controller[_0xf9e8('0x13')]);router[_0xf9e8('0x11')](_0xf9e8('0x14'),auth[_0xf9e8('0x9')](),controller[_0xf9e8('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf9e8('0x16')]);module[_0xf9e8('0x17')]=router; \ No newline at end of file +var _0xea02=['chatmessage:create','put','update','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','tracked'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xea02,0x98));var _0x2ea0=function(_0x19a1c0,_0x14f0bb){_0x19a1c0=_0x19a1c0-0x0;var _0x2afb24=_0xea02[_0x19a1c0];return _0x2afb24;};'use strict';var multer=require(_0x2ea0('0x0'));var util=require(_0x2ea0('0x1'));var path=require(_0x2ea0('0x2'));var timeout=require('connect-timeout');var express=require(_0x2ea0('0x3'));var router=express[_0x2ea0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2ea0('0x5'));var interaction=require(_0x2ea0('0x6'));var config=require(_0x2ea0('0x7'));var controller=require(_0x2ea0('0x8'));router[_0x2ea0('0x9')]('/',auth[_0x2ea0('0xa')](),controller[_0x2ea0('0xb')]);router[_0x2ea0('0x9')](_0x2ea0('0xc'),auth[_0x2ea0('0xa')](),controller[_0x2ea0('0xd')]);router['get']('/:id',auth[_0x2ea0('0xa')](),controller[_0x2ea0('0xe')]);router['post']('/',auth[_0x2ea0('0xa')](),interaction[_0x2ea0('0xf')]('chat',_0x2ea0('0x10')),controller['create']);router[_0x2ea0('0x11')]('/:id',controller[_0x2ea0('0x12')]);router['put'](_0x2ea0('0x13'),auth[_0x2ea0('0xa')](),controller['accept']);router['put'](_0x2ea0('0x14'),auth['isAuthenticated'](),controller[_0x2ea0('0x15')]);router['delete']('/:id',auth[_0x2ea0('0xa')](),controller[_0x2ea0('0x16')]);module[_0x2ea0('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index d7ffeea..82330ef 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0b0e,0x187));var _0xe0b0=function(_0x23c262,_0x74765a){_0x23c262=_0x23c262-0x0;var _0x9b913f=_0x0b0e[_0x23c262];return _0x9b913f;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x55e0b2,_0x3e5579){var _0x53a220=function(_0x162ba8){while(--_0x162ba8){_0x55e0b2['push'](_0x55e0b2['shift']());}};_0x53a220(++_0x3e5579);}(_0xdb28,0x106));var _0x8db2=function(_0x119504,_0x265e38){_0x119504=_0x119504-0x0;var _0x5cf8f2=_0xdb28[_0x119504];return _0x5cf8f2;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 8b5c159..c4ca166 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x7a54,0x106));var _0x47a5=function(_0x26a901,_0x2da806){_0x26a901=_0x26a901-0x0;var _0x329bb6=_0x7a54[_0x26a901];return _0x329bb6;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x7a54,0x106));var _0x47a5=function(_0x3543c9,_0x8c4816){_0x3543c9=_0x3543c9-0x0;var _0x2c0cb8=_0x7a54[_0x3543c9];return _0x2c0cb8;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 6675bd1..0410ff8 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ae5=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save'];(function(_0x11a962,_0x3cc338){var _0x55d423=function(_0xf4b236){while(--_0xf4b236){_0x11a962['push'](_0x11a962['shift']());}};_0x55d423(++_0x3cc338);}(_0x8ae5,0xab));var _0x58ae=function(_0x44057a,_0x31e227){_0x44057a=_0x44057a-0x0;var _0x5859db=_0x8ae5[_0x44057a];return _0x5859db;};'use strict';var EventEmitter=require(_0x58ae('0x0'));var ChatOfflineMessage=require(_0x58ae('0x1'))['db'][_0x58ae('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x58ae('0x3')](0x0);var events={'afterCreate':_0x58ae('0x4'),'afterUpdate':_0x58ae('0x5'),'afterDestroy':_0x58ae('0x6')};function emitEvent(_0x736589){return function(_0x464fbb,_0x898c59,_0x1e9111){ChatOfflineMessageEvents[_0x58ae('0x7')](_0x736589+':'+_0x464fbb['id'],_0x464fbb);ChatOfflineMessageEvents[_0x58ae('0x7')](_0x736589,_0x464fbb);_0x1e9111(null);};}for(var e in events){if(events[_0x58ae('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x58ae('0x9')](e,emitEvent(event));}}module[_0x58ae('0xa')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xe144=['events','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x53fb5c,_0x19b33d){var _0x467ef8=function(_0x1e5d7c){while(--_0x1e5d7c){_0x53fb5c['push'](_0x53fb5c['shift']());}};_0x467ef8(++_0x19b33d);}(_0xe144,0x168));var _0x4e14=function(_0x31061a,_0x5ab647){_0x31061a=_0x31061a-0x0;var _0x48d92a=_0xe144[_0x31061a];return _0x48d92a;};'use strict';var EventEmitter=require(_0x4e14('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x4e14('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x4e14('0x2')](0x0);var events={'afterCreate':_0x4e14('0x3'),'afterUpdate':_0x4e14('0x4'),'afterDestroy':_0x4e14('0x5')};function emitEvent(_0x451f57){return function(_0x388b22,_0x37241e,_0x279fde){ChatOfflineMessageEvents[_0x4e14('0x6')](_0x451f57+':'+_0x388b22['id'],_0x388b22);ChatOfflineMessageEvents[_0x4e14('0x6')](_0x451f57,_0x388b22);_0x279fde(null);};}for(var e in events){if(events[_0x4e14('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x4e14('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index ed0ff5d..8b8f6ff 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.model.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x385e=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','chat_offline_messages','utf8mb4'];(function(_0x37357f,_0x3b23bb){var _0x505ef9=function(_0x42df61){while(--_0x42df61){_0x37357f['push'](_0x37357f['shift']());}};_0x505ef9(++_0x3b23bb);}(_0x385e,0x1b7));var _0xe385=function(_0x412342,_0x180734){_0x412342=_0x412342-0x0;var _0x3e62cb=_0x385e[_0x412342];return _0x3e62cb;};'use strict';var attributes=require(_0xe385('0x0'));module[_0xe385('0x1')]=function(_0x4e12e9){return _0x4e12e9[_0xe385('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0xe385('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe385('0x4'),'collate':_0xe385('0x5')});}; \ No newline at end of file +var _0x12e5=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports'];(function(_0xd9c274,_0x58f1ef){var _0x56aa81=function(_0x20029f){while(--_0x20029f){_0xd9c274['push'](_0xd9c274['shift']());}};_0x56aa81(++_0x58f1ef);}(_0x12e5,0x144));var _0x512e=function(_0x5f2330,_0x298a0d){_0x5f2330=_0x5f2330-0x0;var _0x1e9150=_0x12e5[_0x5f2330];return _0x1e9150;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x512e('0x0')]=function(_0x3da138){return _0x3da138['define'](_0x512e('0x1'),attributes,{'tableName':_0x512e('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x512e('0x3'),'collate':_0x512e('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 114de60..a6d24b1 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3f6=['stringify','error','code','message','result','catch','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4fac01,_0x58c00a){var _0x1db7ba=function(_0x4f4f19){while(--_0x4f4f19){_0x4fac01['push'](_0x4fac01['shift']());}};_0x1db7ba(++_0x58c00a);}(_0xe3f6,0x9e));var _0x6e3f=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xe3f6[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0x6e3f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6e3f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e3f('0x2'))['db'];var utils=require(_0x6e3f('0x3'));var logger=require(_0x6e3f('0x4'))(_0x6e3f('0x5'));var config=require(_0x6e3f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6e3f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4f7bf1,_0x5b0791,_0x3b8c01){return new BPromise(function(_0x32f8ac,_0xe49409){return client[_0x6e3f('0x8')](_0x4f7bf1,_0x3b8c01)['then'](function(_0x2307e9){logger['info'](_0x6e3f('0x9'),_0x5b0791,_0x6e3f('0xa'));logger[_0x6e3f('0xb')](_0x6e3f('0xc'),_0x5b0791,_0x6e3f('0xa'),JSON[_0x6e3f('0xd')](_0x2307e9));if(_0x2307e9[_0x6e3f('0xe')]){if(_0x2307e9[_0x6e3f('0xe')][_0x6e3f('0xf')]===0x1f4){logger[_0x6e3f('0xe')](_0x6e3f('0x9'),_0x5b0791,_0x2307e9[_0x6e3f('0xe')][_0x6e3f('0x10')]);return _0xe49409(_0x2307e9[_0x6e3f('0xe')][_0x6e3f('0x10')]);}logger[_0x6e3f('0xe')](_0x6e3f('0x9'),_0x5b0791,_0x2307e9[_0x6e3f('0xe')][_0x6e3f('0x10')]);return _0x32f8ac(_0x2307e9['error'][_0x6e3f('0x10')]);}else{logger['info'](_0x6e3f('0x9'),_0x5b0791,_0x6e3f('0xa'));_0x32f8ac(_0x2307e9[_0x6e3f('0x11')][_0x6e3f('0x10')]);}})[_0x6e3f('0x12')](function(_0x1826af){logger[_0x6e3f('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5b0791,_0x1826af);_0xe49409(_0x1826af);});});} \ No newline at end of file +var _0x3dd8=['then','info','debug','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','request\x20sent','catch','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x55b026,_0x22dbc5){var _0xcd43fa=function(_0x3cae16){while(--_0x3cae16){_0x55b026['push'](_0x55b026['shift']());}};_0xcd43fa(++_0x22dbc5);}(_0x3dd8,0x199));var _0x83dd=function(_0x54ef43,_0x308497){_0x54ef43=_0x54ef43-0x0;var _0x4e3816=_0x3dd8[_0x54ef43];return _0x4e3816;};'use strict';var _=require('lodash');var util=require(_0x83dd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x83dd('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x83dd('0x2'));var logger=require(_0x83dd('0x3'))(_0x83dd('0x4'));var config=require(_0x83dd('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x83dd('0x6')][_0x83dd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5b01fa,_0x403e77,_0x5a6dd1){return new BPromise(function(_0x48d9b3,_0x19a488){return client[_0x83dd('0x8')](_0x5b01fa,_0x5a6dd1)[_0x83dd('0x9')](function(_0x3a78b1){logger[_0x83dd('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x403e77,'request\x20sent');logger[_0x83dd('0xb')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x403e77,'request\x20sent',JSON[_0x83dd('0xc')](_0x3a78b1));if(_0x3a78b1[_0x83dd('0xd')]){if(_0x3a78b1['error'][_0x83dd('0xe')]===0x1f4){logger[_0x83dd('0xd')](_0x83dd('0xf'),_0x403e77,_0x3a78b1[_0x83dd('0xd')][_0x83dd('0x10')]);return _0x19a488(_0x3a78b1[_0x83dd('0xd')][_0x83dd('0x10')]);}logger[_0x83dd('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x403e77,_0x3a78b1[_0x83dd('0xd')][_0x83dd('0x10')]);return _0x48d9b3(_0x3a78b1[_0x83dd('0xd')][_0x83dd('0x10')]);}else{logger[_0x83dd('0xa')](_0x83dd('0xf'),_0x403e77,_0x83dd('0x11'));_0x48d9b3(_0x3a78b1['result']['message']);}})[_0x83dd('0x12')](function(_0x178385){logger[_0x83dd('0xd')](_0x83dd('0xf'),_0x403e77,_0x178385);_0x19a488(_0x178385);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index cd35c59..ebbdbfd 100644 --- a/server/api/chatOfflineMessage/index.js +++ b/server/api/chatOfflineMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x99f1=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0x552c4b,_0xce95ce){var _0x3f54f5=function(_0x3effaf){while(--_0x3effaf){_0x552c4b['push'](_0x552c4b['shift']());}};_0x3f54f5(++_0xce95ce);}(_0x99f1,0x1ce));var _0x199f=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x99f1[_0x3fba9f];return _0x192cf1;};'use strict';var multer=require('multer');var util=require(_0x199f('0x0'));var path=require(_0x199f('0x1'));var timeout=require(_0x199f('0x2'));var express=require('express');var router=express[_0x199f('0x3')]();var fs_extra=require(_0x199f('0x4'));var auth=require(_0x199f('0x5'));var interaction=require(_0x199f('0x6'));var config=require('../../config/environment');var controller=require(_0x199f('0x7'));router[_0x199f('0x8')]('/',auth[_0x199f('0x9')](),controller[_0x199f('0xa')]);router[_0x199f('0x8')](_0x199f('0xb'),auth[_0x199f('0x9')](),controller[_0x199f('0xc')]);router['get'](_0x199f('0xd'),auth['isAuthenticated'](),controller[_0x199f('0xe')]);router[_0x199f('0xf')]('/',auth[_0x199f('0x9')](),controller[_0x199f('0x10')]);router[_0x199f('0x11')](_0x199f('0xd'),auth[_0x199f('0x9')](),controller[_0x199f('0x12')]);router['delete'](_0x199f('0xd'),auth['isAuthenticated'](),controller[_0x199f('0x13')]);module[_0x199f('0x14')]=router; \ No newline at end of file +var _0xf7fe=['/describe','isAuthenticated','describe','show','post','/:id','update','delete','destroy','exports','util','path','Router','fs-extra','./chatOfflineMessage.controller','get','index'];(function(_0x30580f,_0xdec83d){var _0x276442=function(_0x427c44){while(--_0x427c44){_0x30580f['push'](_0x30580f['shift']());}};_0x276442(++_0xdec83d);}(_0xf7fe,0x1e6));var _0xef7f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf7fe[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xef7f('0x0'));var path=require(_0xef7f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xef7f('0x2')]();var fs_extra=require(_0xef7f('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xef7f('0x4'));router[_0xef7f('0x5')]('/',auth['isAuthenticated'](),controller[_0xef7f('0x6')]);router['get'](_0xef7f('0x7'),auth[_0xef7f('0x8')](),controller[_0xef7f('0x9')]);router['get']('/:id',auth[_0xef7f('0x8')](),controller[_0xef7f('0xa')]);router[_0xef7f('0xb')]('/',auth[_0xef7f('0x8')](),controller['create']);router['put'](_0xef7f('0xc'),auth['isAuthenticated'](),controller[_0xef7f('0xd')]);router[_0xef7f('0xe')]('/:id',auth[_0xef7f('0x8')](),controller[_0xef7f('0xf')]);module[_0xef7f('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 267719c..0b01288 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.attributes.js +++ b/server/api/chatProactiveAction/chatProactiveAction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f97=['STRING','ENUM','mouseOver','timeout','INTEGER','exports'];(function(_0x2786d9,_0x333eb5){var _0x34fb80=function(_0x8aa31){while(--_0x8aa31){_0x2786d9['push'](_0x2786d9['shift']());}};_0x34fb80(++_0x333eb5);}(_0x3f97,0xd1));var _0x73f9=function(_0x1a8b10,_0x2cd934){_0x1a8b10=_0x1a8b10-0x0;var _0x167aa4=_0x3f97[_0x1a8b10];return _0x167aa4;};'use strict';var Sequelize=require('sequelize');module[_0x73f9('0x0')]={'name':{'type':Sequelize[_0x73f9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x73f9('0x2')](_0x73f9('0x3'),_0x73f9('0x4')),'defaultValue':_0x73f9('0x3')},'selector':{'type':Sequelize[_0x73f9('0x1')]},'timeout':{'type':Sequelize[_0x73f9('0x5')]}}; \ No newline at end of file +var _0x1cea=['INTEGER','sequelize','exports','STRING','mouseOver','timeout'];(function(_0x2139b3,_0x8fac0e){var _0x41c80a=function(_0x4155d4){while(--_0x4155d4){_0x2139b3['push'](_0x2139b3['shift']());}};_0x41c80a(++_0x8fac0e);}(_0x1cea,0xd3));var _0xa1ce=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0x1cea[_0x3a6e4b];return _0x36572d;};'use strict';var Sequelize=require(_0xa1ce('0x0'));module[_0xa1ce('0x1')]={'name':{'type':Sequelize[_0xa1ce('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa1ce('0x3'),_0xa1ce('0x4')),'defaultValue':_0xa1ce('0x3')},'selector':{'type':Sequelize[_0xa1ce('0x2')]},'timeout':{'type':Sequelize[_0xa1ce('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 4afcfd1..c224e87 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.controller.js +++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48e3=['bluebird','mustache','util','path','to-csv','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','count','set','Content-Range','json','apply','save','then','destroy','stack','name','send','show','model','keys','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','create','ChatProactiveAction','update','body','params','eml-format','rimraf','fast-json-patch'];(function(_0x3ba721,_0x5b8f13){var _0x3a3244=function(_0x5f4c29){while(--_0x5f4c29){_0x3ba721['push'](_0x3ba721['shift']());}};_0x3a3244(++_0x5b8f13);}(_0x48e3,0xe9));var _0x348e=function(_0x268fdd,_0x46b228){_0x268fdd=_0x268fdd-0x0;var _0x5ce50c=_0x48e3[_0x268fdd];return _0x5ce50c;};'use strict';var emlformat=require(_0x348e('0x0'));var rimraf=require(_0x348e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x348e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x348e('0x3'));var Mustache=require(_0x348e('0x4'));var util=require(_0x348e('0x5'));var path=require(_0x348e('0x6'));var sox=require('sox');var csv=require(_0x348e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x348e('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x348e('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x348e('0x7'));var querystring=require(_0x348e('0xa'));var Papa=require(_0x348e('0xb'));var Redis=require(_0x348e('0xc'));var authService=require(_0x348e('0xd'));var qs=require(_0x348e('0xe'));var as=require(_0x348e('0xf'));var hardwareService=require(_0x348e('0x10'));var logger=require(_0x348e('0x11'))(_0x348e('0x12'));var utils=require(_0x348e('0x13'));var config=require(_0x348e('0x14'));var licenseUtil=require(_0x348e('0x15'));var db=require(_0x348e('0x16'))['db'];function respondWithStatusCode(_0x57c341,_0x2ba049){_0x2ba049=_0x2ba049||0xcc;return function(_0x271fe7){if(_0x271fe7){return _0x57c341[_0x348e('0x17')](_0x2ba049);}return _0x57c341['status'](_0x2ba049)[_0x348e('0x18')]();};}function respondWithResult(_0x3031ee,_0x23865f){_0x23865f=_0x23865f||0xc8;return function(_0x246a85){if(_0x246a85){return _0x3031ee[_0x348e('0x19')](_0x23865f)['json'](_0x246a85);}};}function respondWithFilteredResult(_0x5169aa,_0x718b84){return function(_0x9cf0b8){if(_0x9cf0b8){var _0x1f9e74=typeof _0x718b84[_0x348e('0x1a')]==='undefined'&&typeof _0x718b84[_0x348e('0x1b')]==='undefined';var _0x217857=_0x9cf0b8[_0x348e('0x1c')];var _0x409ea8=_0x1f9e74?0x0:_0x718b84['offset'];var _0x2326bc=_0x1f9e74?_0x9cf0b8['count']:_0x718b84['offset']+_0x718b84['limit'];var _0x5eca68;if(_0x2326bc>=_0x217857){_0x2326bc=_0x217857;_0x5eca68=0xc8;}else{_0x5eca68=0xce;}_0x5169aa[_0x348e('0x19')](_0x5eca68);return _0x5169aa[_0x348e('0x1d')](_0x348e('0x1e'),_0x409ea8+'-'+_0x2326bc+'/'+_0x217857)[_0x348e('0x1f')](_0x9cf0b8);}return null;};}function patchUpdates(_0x3a5907){return function(_0x3d1ae3){try{jsonpatch[_0x348e('0x20')](_0x3d1ae3,_0x3a5907,!![]);}catch(_0x5c631d){return BPromise['reject'](_0x5c631d);}return _0x3d1ae3[_0x348e('0x21')]();};}function saveUpdates(_0x33600d,_0x2225d0){return function(_0xa0917f){if(_0xa0917f){return _0xa0917f['update'](_0x33600d)[_0x348e('0x22')](function(_0x45c4a9){return _0x45c4a9;});}return null;};}function removeEntity(_0x1c0caa,_0x4a5a84){return function(_0x116583){if(_0x116583){return _0x116583[_0x348e('0x23')]()[_0x348e('0x22')](function(){_0x1c0caa['status'](0xcc)[_0x348e('0x18')]();});}};}function handleEntityNotFound(_0x845e7f,_0x2519f3){return function(_0x49ba87){if(!_0x49ba87){_0x845e7f[_0x348e('0x17')](0x194);}return _0x49ba87;};}function handleError(_0x6f72c4,_0x1a987a){_0x1a987a=_0x1a987a||0x1f4;return function(_0x23bed7){logger['error'](_0x23bed7[_0x348e('0x24')]);if(_0x23bed7[_0x348e('0x25')]){delete _0x23bed7[_0x348e('0x25')];}_0x6f72c4[_0x348e('0x19')](_0x1a987a)[_0x348e('0x26')](_0x23bed7);};}exports[_0x348e('0x27')]=function(_0xcf5f40,_0x487784){var _0x37d892={'raw':!![],'where':{'id':_0xcf5f40['params']['id']}},_0xcf7f99={};_0xcf7f99[_0x348e('0x28')]=_[_0x348e('0x29')](db['ChatProactiveAction'][_0x348e('0x2a')]);_0xcf7f99[_0x348e('0x2b')]=_['keys'](_0xcf5f40[_0x348e('0x2b')]);_0xcf7f99[_0x348e('0x2c')]=_[_0x348e('0x2d')](_0xcf7f99[_0x348e('0x28')],_0xcf7f99[_0x348e('0x2b')]);_0x37d892[_0x348e('0x2e')]=_[_0x348e('0x2d')](_0xcf7f99['model'],qs['fields'](_0xcf5f40['query'][_0x348e('0x2f')]));_0x37d892[_0x348e('0x2e')]=_0x37d892[_0x348e('0x2e')]['length']?_0x37d892[_0x348e('0x2e')]:_0xcf7f99['model'];if(_0xcf5f40['query'][_0x348e('0x30')]){_0x37d892[_0x348e('0x31')]=[{'all':!![]}];}_0x37d892=_[_0x348e('0x32')]({},_0x37d892,_0xcf5f40[_0x348e('0x33')]);return db['ChatProactiveAction'][_0x348e('0x34')](_0x37d892)[_0x348e('0x22')](handleEntityNotFound(_0x487784,null))[_0x348e('0x22')](respondWithResult(_0x487784,null))[_0x348e('0x35')](handleError(_0x487784,null));};exports[_0x348e('0x36')]=function(_0x3a3b2c,_0x3e769c){return db[_0x348e('0x37')]['create'](_0x3a3b2c['body'],{})[_0x348e('0x22')](respondWithResult(_0x3e769c,0xc9))[_0x348e('0x35')](handleError(_0x3e769c,null));};exports[_0x348e('0x38')]=function(_0x900473,_0x405e6e){if(_0x900473[_0x348e('0x39')]['id']){delete _0x900473['body']['id'];}return db[_0x348e('0x37')][_0x348e('0x34')]({'where':{'id':_0x900473[_0x348e('0x3a')]['id']}})['then'](handleEntityNotFound(_0x405e6e,null))[_0x348e('0x22')](saveUpdates(_0x900473[_0x348e('0x39')],null))[_0x348e('0x22')](respondWithResult(_0x405e6e,null))[_0x348e('0x35')](handleError(_0x405e6e,null));};exports[_0x348e('0x23')]=function(_0x326b50,_0x40d487){return db['ChatProactiveAction'][_0x348e('0x34')]({'where':{'id':_0x326b50[_0x348e('0x3a')]['id']}})['then'](handleEntityNotFound(_0x40d487,null))[_0x348e('0x22')](removeEntity(_0x40d487,null))[_0x348e('0x35')](handleError(_0x40d487,null));}; \ No newline at end of file +var _0x57cf=['include','merge','options','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','offset','count','set','apply','reject','save','then','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','fields'];(function(_0x458e6c,_0x206d46){var _0x1130c5=function(_0x1fdb2a){while(--_0x1fdb2a){_0x458e6c['push'](_0x458e6c['shift']());}};_0x1130c5(++_0x206d46);}(_0x57cf,0x11b));var _0xf57c=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0x57cf[_0x513047];return _0x15b779;};'use strict';var emlformat=require(_0xf57c('0x0'));var rimraf=require(_0xf57c('0x1'));var zipdir=require(_0xf57c('0x2'));var jsonpatch=require(_0xf57c('0x3'));var rp=require(_0xf57c('0x4'));var moment=require(_0xf57c('0x5'));var BPromise=require(_0xf57c('0x6'));var Mustache=require(_0xf57c('0x7'));var util=require(_0xf57c('0x8'));var path=require(_0xf57c('0x9'));var sox=require('sox');var csv=require(_0xf57c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf57c('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf57c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf57c('0xd'));var toCsv=require(_0xf57c('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf57c('0xe'));var authService=require(_0xf57c('0xf'));var qs=require(_0xf57c('0x10'));var as=require(_0xf57c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf57c('0x12'))(_0xf57c('0x13'));var utils=require(_0xf57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf57c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27de1b,_0x15e264){_0x15e264=_0x15e264||0xcc;return function(_0x4cc38b){if(_0x4cc38b){return _0x27de1b[_0xf57c('0x16')](_0x15e264);}return _0x27de1b['status'](_0x15e264)[_0xf57c('0x17')]();};}function respondWithResult(_0x598342,_0x23c2b5){_0x23c2b5=_0x23c2b5||0xc8;return function(_0xc56c5){if(_0xc56c5){return _0x598342[_0xf57c('0x18')](_0x23c2b5)[_0xf57c('0x19')](_0xc56c5);}};}function respondWithFilteredResult(_0x168f5c,_0x3d12a0){return function(_0x1fb5f5){if(_0x1fb5f5){var _0x3163eb=typeof _0x3d12a0['offset']===_0xf57c('0x1a')&&typeof _0x3d12a0['limit']===_0xf57c('0x1a');var _0x2d8386=_0x1fb5f5['count'];var _0x385a4f=_0x3163eb?0x0:_0x3d12a0[_0xf57c('0x1b')];var _0x3eb951=_0x3163eb?_0x1fb5f5[_0xf57c('0x1c')]:_0x3d12a0[_0xf57c('0x1b')]+_0x3d12a0['limit'];var _0x3c6e33;if(_0x3eb951>=_0x2d8386){_0x3eb951=_0x2d8386;_0x3c6e33=0xc8;}else{_0x3c6e33=0xce;}_0x168f5c[_0xf57c('0x18')](_0x3c6e33);return _0x168f5c[_0xf57c('0x1d')]('Content-Range',_0x385a4f+'-'+_0x3eb951+'/'+_0x2d8386)['json'](_0x1fb5f5);}return null;};}function patchUpdates(_0x3ac299){return function(_0x1f8a65){try{jsonpatch[_0xf57c('0x1e')](_0x1f8a65,_0x3ac299,!![]);}catch(_0x23a827){return BPromise[_0xf57c('0x1f')](_0x23a827);}return _0x1f8a65[_0xf57c('0x20')]();};}function saveUpdates(_0xea8ee8,_0x396e18){return function(_0xf3baee){if(_0xf3baee){return _0xf3baee['update'](_0xea8ee8)[_0xf57c('0x21')](function(_0x177e74){return _0x177e74;});}return null;};}function removeEntity(_0x551cf0,_0x5ad03e){return function(_0x3c4923){if(_0x3c4923){return _0x3c4923['destroy']()[_0xf57c('0x21')](function(){_0x551cf0[_0xf57c('0x18')](0xcc)[_0xf57c('0x17')]();});}};}function handleEntityNotFound(_0x584bc3,_0xc70f3e){return function(_0x195ae5){if(!_0x195ae5){_0x584bc3['sendStatus'](0x194);}return _0x195ae5;};}function handleError(_0x387d7c,_0x2ac666){_0x2ac666=_0x2ac666||0x1f4;return function(_0x1b12ff){logger[_0xf57c('0x22')](_0x1b12ff[_0xf57c('0x23')]);if(_0x1b12ff[_0xf57c('0x24')]){delete _0x1b12ff[_0xf57c('0x24')];}_0x387d7c[_0xf57c('0x18')](_0x2ac666)[_0xf57c('0x25')](_0x1b12ff);};}exports['show']=function(_0x35e6f8,_0x1f5f3b){var _0x56726f={'raw':!![],'where':{'id':_0x35e6f8[_0xf57c('0x26')]['id']}},_0x2e69e9={};_0x2e69e9[_0xf57c('0x27')]=_[_0xf57c('0x28')](db[_0xf57c('0x29')][_0xf57c('0x2a')]);_0x2e69e9[_0xf57c('0x2b')]=_[_0xf57c('0x28')](_0x35e6f8[_0xf57c('0x2b')]);_0x2e69e9[_0xf57c('0x2c')]=_['intersection'](_0x2e69e9[_0xf57c('0x27')],_0x2e69e9[_0xf57c('0x2b')]);_0x56726f[_0xf57c('0x2d')]=_['intersection'](_0x2e69e9['model'],qs['fields'](_0x35e6f8[_0xf57c('0x2b')][_0xf57c('0x2e')]));_0x56726f[_0xf57c('0x2d')]=_0x56726f[_0xf57c('0x2d')]['length']?_0x56726f[_0xf57c('0x2d')]:_0x2e69e9[_0xf57c('0x27')];if(_0x35e6f8[_0xf57c('0x2b')]['includeAll']){_0x56726f[_0xf57c('0x2f')]=[{'all':!![]}];}_0x56726f=_[_0xf57c('0x30')]({},_0x56726f,_0x35e6f8[_0xf57c('0x31')]);return db[_0xf57c('0x29')][_0xf57c('0x32')](_0x56726f)[_0xf57c('0x21')](handleEntityNotFound(_0x1f5f3b,null))['then'](respondWithResult(_0x1f5f3b,null))[_0xf57c('0x33')](handleError(_0x1f5f3b,null));};exports[_0xf57c('0x34')]=function(_0x4da04a,_0x533795){return db[_0xf57c('0x29')]['create'](_0x4da04a[_0xf57c('0x35')],{})['then'](respondWithResult(_0x533795,0xc9))[_0xf57c('0x33')](handleError(_0x533795,null));};exports[_0xf57c('0x36')]=function(_0x17e8dc,_0x136304){if(_0x17e8dc['body']['id']){delete _0x17e8dc[_0xf57c('0x35')]['id'];}return db['ChatProactiveAction'][_0xf57c('0x32')]({'where':{'id':_0x17e8dc[_0xf57c('0x26')]['id']}})[_0xf57c('0x21')](handleEntityNotFound(_0x136304,null))[_0xf57c('0x21')](saveUpdates(_0x17e8dc[_0xf57c('0x35')],null))[_0xf57c('0x21')](respondWithResult(_0x136304,null))['catch'](handleError(_0x136304,null));};exports['destroy']=function(_0x1d5bf9,_0x26a65b){return db[_0xf57c('0x29')]['find']({'where':{'id':_0x1d5bf9[_0xf57c('0x26')]['id']}})['then'](handleEntityNotFound(_0x26a65b,null))[_0xf57c('0x21')](removeEntity(_0x26a65b,null))[_0xf57c('0x33')](handleError(_0x26a65b,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 1116cf4..02cd9c7 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.model.js +++ b/server/api/chatProactiveAction/chatProactiveAction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x032a=['ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x032a,0xfe));var _0xa032=function(_0x5c6c64,_0x12d4cb){_0x5c6c64=_0x5c6c64-0x0;var _0x172174=_0x032a[_0x5c6c64];return _0x172174;};'use strict';var _=require(_0xa032('0x0'));var util=require(_0xa032('0x1'));var logger=require(_0xa032('0x2'))(_0xa032('0x3'));var moment=require(_0xa032('0x4'));var BPromise=require(_0xa032('0x5'));var rp=require(_0xa032('0x6'));var fs=require('fs');var path=require(_0xa032('0x7'));var rimraf=require(_0xa032('0x8'));var config=require(_0xa032('0x9'));var attributes=require(_0xa032('0xa'));module['exports']=function(_0x529494,_0xc8a2b6){return _0x529494[_0xa032('0xb')](_0xa032('0xc'),attributes,{'tableName':_0xa032('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c8d=['moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','api'];(function(_0x3fc105,_0x3cd614){var _0x1dc50c=function(_0x19ff17){while(--_0x19ff17){_0x3fc105['push'](_0x3fc105['shift']());}};_0x1dc50c(++_0x3cd614);}(_0x4c8d,0x69));var _0xd4c8=function(_0x481e5a,_0x4cfe56){_0x481e5a=_0x481e5a-0x0;var _0x35674e=_0x4c8d[_0x481e5a];return _0x35674e;};'use strict';var _=require(_0xd4c8('0x0'));var util=require(_0xd4c8('0x1'));var logger=require('../../config/logger')(_0xd4c8('0x2'));var moment=require(_0xd4c8('0x3'));var BPromise=require(_0xd4c8('0x4'));var rp=require(_0xd4c8('0x5'));var fs=require('fs');var path=require(_0xd4c8('0x6'));var rimraf=require('rimraf');var config=require(_0xd4c8('0x7'));var attributes=require(_0xd4c8('0x8'));module['exports']=function(_0x12ce4e,_0x565efd){return _0x12ce4e[_0xd4c8('0x9')](_0xd4c8('0xa'),attributes,{'tableName':_0xd4c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 7ffbebd..d44ea1c 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js +++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf0a0=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x2ed3ea,_0x1669e1){var _0x33a347=function(_0x5b69f7){while(--_0x5b69f7){_0x2ed3ea['push'](_0x2ed3ea['shift']());}};_0x33a347(++_0x1669e1);}(_0xf0a0,0x178));var _0x0f0a=function(_0x5c128e,_0x3d5149){_0x5c128e=_0x5c128e-0x0;var _0x3951d6=_0xf0a0[_0x5c128e];return _0x3951d6;};'use strict';var _=require(_0x0f0a('0x0'));var util=require('util');var moment=require(_0x0f0a('0x1'));var BPromise=require('bluebird');var rs=require(_0x0f0a('0x2'));var fs=require('fs');var Redis=require(_0x0f0a('0x3'));var db=require(_0x0f0a('0x4'))['db'];var utils=require(_0x0f0a('0x5'));var logger=require('../../config/logger')(_0x0f0a('0x6'));var config=require(_0x0f0a('0x7'));var jayson=require(_0x0f0a('0x8'));var client=jayson[_0x0f0a('0x9')][_0x0f0a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb9ff58,_0x36acc2,_0x5795ad){return new BPromise(function(_0x1bfa65,_0x24409d){return client[_0x0f0a('0xb')](_0xb9ff58,_0x5795ad)['then'](function(_0x198aba){logger[_0x0f0a('0xc')](_0x0f0a('0xd'),_0x36acc2,_0x0f0a('0xe'));logger[_0x0f0a('0xf')](_0x0f0a('0x10'),_0x36acc2,'request\x20sent',JSON[_0x0f0a('0x11')](_0x198aba));if(_0x198aba[_0x0f0a('0x12')]){if(_0x198aba['error']['code']===0x1f4){logger[_0x0f0a('0x12')](_0x0f0a('0xd'),_0x36acc2,_0x198aba[_0x0f0a('0x12')][_0x0f0a('0x13')]);return _0x24409d(_0x198aba[_0x0f0a('0x12')][_0x0f0a('0x13')]);}logger['error'](_0x0f0a('0xd'),_0x36acc2,_0x198aba[_0x0f0a('0x12')][_0x0f0a('0x13')]);return _0x1bfa65(_0x198aba[_0x0f0a('0x12')][_0x0f0a('0x13')]);}else{logger[_0x0f0a('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x36acc2,_0x0f0a('0xe'));_0x1bfa65(_0x198aba[_0x0f0a('0x14')][_0x0f0a('0x13')]);}})[_0x0f0a('0x15')](function(_0x264bfe){logger['error'](_0x0f0a('0xd'),_0x36acc2,_0x264bfe);_0x24409d(_0x264bfe);});});} \ No newline at end of file +var _0x2170=['rpc','../../config/environment','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x540381,_0x48e0ed){var _0x5e7c3d=function(_0x215b7a){while(--_0x215b7a){_0x540381['push'](_0x540381['shift']());}};_0x5e7c3d(++_0x48e0ed);}(_0x2170,0xa1));var _0x0217=function(_0x23b4df,_0x33dfa6){_0x23b4df=_0x23b4df-0x0;var _0x26b927=_0x2170[_0x23b4df];return _0x26b927;};'use strict';var _=require(_0x0217('0x0'));var util=require(_0x0217('0x1'));var moment=require(_0x0217('0x2'));var BPromise=require(_0x0217('0x3'));var rs=require(_0x0217('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0217('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0217('0x6'))(_0x0217('0x7'));var config=require(_0x0217('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0217('0x9')][_0x0217('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36379f,_0xfdbe80,_0x313f74){return new BPromise(function(_0x221e94,_0x48b98a){return client[_0x0217('0xb')](_0x36379f,_0x313f74)[_0x0217('0xc')](function(_0x53070d){logger['info'](_0x0217('0xd'),_0xfdbe80,_0x0217('0xe'));logger[_0x0217('0xf')](_0x0217('0x10'),_0xfdbe80,_0x0217('0xe'),JSON[_0x0217('0x11')](_0x53070d));if(_0x53070d[_0x0217('0x12')]){if(_0x53070d['error'][_0x0217('0x13')]===0x1f4){logger[_0x0217('0x12')](_0x0217('0xd'),_0xfdbe80,_0x53070d['error'][_0x0217('0x14')]);return _0x48b98a(_0x53070d[_0x0217('0x12')][_0x0217('0x14')]);}logger[_0x0217('0x12')](_0x0217('0xd'),_0xfdbe80,_0x53070d[_0x0217('0x12')][_0x0217('0x14')]);return _0x221e94(_0x53070d['error'][_0x0217('0x14')]);}else{logger[_0x0217('0x15')](_0x0217('0xd'),_0xfdbe80,_0x0217('0xe'));_0x221e94(_0x53070d[_0x0217('0x16')]['message']);}})[_0x0217('0x17')](function(_0x44c020){logger[_0x0217('0x12')](_0x0217('0xd'),_0xfdbe80,_0x44c020);_0x48b98a(_0x44c020);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index d1e5745..1b6ab8b 100644 --- a/server/api/chatProactiveAction/index.js +++ b/server/api/chatProactiveAction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae24=['destroy','exports','multer','path','express','Router','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','delete'];(function(_0x490c02,_0x2faa1b){var _0x4604ab=function(_0x336e0d){while(--_0x336e0d){_0x490c02['push'](_0x490c02['shift']());}};_0x4604ab(++_0x2faa1b);}(_0xae24,0x182));var _0x4ae2=function(_0x2fdbb8,_0x3c304f){_0x2fdbb8=_0x2fdbb8-0x0;var _0xfa5de=_0xae24[_0x2fdbb8];return _0xfa5de;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ae2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ae2('0x5'));router[_0x4ae2('0x6')](_0x4ae2('0x7'),auth[_0x4ae2('0x8')](),controller[_0x4ae2('0x9')]);router[_0x4ae2('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4ae2('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x4ae2('0xc')]);router[_0x4ae2('0xd')]('/:id',auth[_0x4ae2('0x8')](),controller[_0x4ae2('0xe')]);module[_0x4ae2('0xf')]=router; \ No newline at end of file +var _0x5fd1=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','multer','path','connect-timeout','express'];(function(_0x22df57,_0xdf14d5){var _0x160738=function(_0x2865e8){while(--_0x2865e8){_0x22df57['push'](_0x22df57['shift']());}};_0x160738(++_0xdf14d5);}(_0x5fd1,0x155));var _0x15fd=function(_0x18f07e,_0x38a819){_0x18f07e=_0x18f07e-0x0;var _0x2b1a96=_0x5fd1[_0x18f07e];return _0x2b1a96;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x15fd('0x4'));var interaction=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x15fd('0x7')](_0x15fd('0x8'),auth[_0x15fd('0x9')](),controller[_0x15fd('0xa')]);router[_0x15fd('0xb')]('/',auth['isAuthenticated'](),controller[_0x15fd('0xc')]);router[_0x15fd('0xd')](_0x15fd('0x8'),auth['isAuthenticated'](),controller[_0x15fd('0xe')]);router['delete'](_0x15fd('0x8'),auth[_0x15fd('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index be9a95b..3b3d494 100644 --- a/server/api/chatQueue/chatQueue.attributes.js +++ b/server/api/chatQueue/chatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25c5=['ENUM','beepall','sequelize','STRING','name','INTEGER'];(function(_0x2e0fb8,_0x489160){var _0x212b1b=function(_0x2bb946){while(--_0x2bb946){_0x2e0fb8['push'](_0x2e0fb8['shift']());}};_0x212b1b(++_0x489160);}(_0x25c5,0xda));var _0x525c=function(_0x420d8d,_0x78b67f){_0x420d8d=_0x420d8d-0x0;var _0x4865d7=_0x25c5[_0x420d8d];return _0x4865d7;};'use strict';var Sequelize=require(_0x525c('0x0'));module['exports']={'name':{'type':Sequelize[_0x525c('0x1')],'unique':_0x525c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x525c('0x1')]},'timeout':{'type':Sequelize[_0x525c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x525c('0x4')]('rrmemory',_0x525c('0x5'),'roundrobin')}}; \ No newline at end of file +var _0xa3c7=['STRING','name','beepall','roundrobin'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xa3c7,0xec));var _0x7a3c=function(_0x385603,_0x1cf762){_0x385603=_0x385603-0x0;var _0x2e10ca=_0xa3c7[_0x385603];return _0x2e10ca;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7a3c('0x0')],'unique':_0x7a3c('0x1'),'allowNull':![],'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']('rrmemory',_0x7a3c('0x2'),_0x7a3c('0x3'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 1d690dc..fa98fc9 100644 --- a/server/api/chatQueue/chatQueue.controller.js +++ b/server/api/chatQueue/chatQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8c5=['online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','User','select','field','tq.TeamId','from','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','localhost','./chatQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','send','index','map','fieldName','type','key','getOptions','where','ChatQueue','include','query','findAll','rows','show','model','keys','rawAttributes','filters','intersection','fields','attributes','length','includeAll','options','catch','create','body','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserChatQueue','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','merge','findAndCountAll','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','ids','Agents'];(function(_0x153515,_0x4b0bec){var _0x260bc2=function(_0x40f802){while(--_0x40f802){_0x153515['push'](_0x153515['shift']());}};_0x260bc2(++_0x4b0bec);}(_0xb8c5,0xa0));var _0x5b8c=function(_0x464cef,_0xf19a90){_0x464cef=_0x464cef-0x0;var _0x4f535a=_0xb8c5[_0x464cef];return _0x4f535a;};'use strict';var BPromise=require(_0x5b8c('0x0'));var util=require(_0x5b8c('0x1'));var _=require(_0x5b8c('0x2'));var squel=require(_0x5b8c('0x3'));var Redis=require(_0x5b8c('0x4'));var qs=require(_0x5b8c('0x5'));var logger=require(_0x5b8c('0x6'))(_0x5b8c('0x7'));var config=require(_0x5b8c('0x8'));var db=require('../../mysqldb')['db'];config[_0x5b8c('0x9')]=_['defaults'](config[_0x5b8c('0x9')],{'host':_0x5b8c('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5b8c('0x9')]));require(_0x5b8c('0xb'))[_0x5b8c('0xc')](socket);function respondWithStatusCode(_0x5f31da,_0x31d880){_0x31d880=_0x31d880||0xcc;return function(_0x264010){if(_0x264010){return _0x5f31da[_0x5b8c('0xd')](_0x31d880);}return _0x5f31da[_0x5b8c('0xe')](_0x31d880)[_0x5b8c('0xf')]();};}function respondWithResult(_0x54c26f,_0x4401ff){_0x4401ff=_0x4401ff||0xc8;return function(_0x53cd75){if(_0x53cd75){return _0x54c26f[_0x5b8c('0xe')](_0x4401ff)['json'](_0x53cd75);}};}function respondWithFilteredResult(_0x1e50ef,_0x54f6b5){return function(_0xf52482){if(_0xf52482){var _0x16f2b6=typeof _0x54f6b5[_0x5b8c('0x10')]===_0x5b8c('0x11')&&typeof _0x54f6b5[_0x5b8c('0x12')]==='undefined';var _0x17854a=_0xf52482[_0x5b8c('0x13')];var _0x32c207=_0x16f2b6?0x0:_0x54f6b5['offset'];var _0x136b1f=_0x16f2b6?_0xf52482[_0x5b8c('0x13')]:_0x54f6b5[_0x5b8c('0x10')]+_0x54f6b5[_0x5b8c('0x12')];var _0x1bdb6b;if(_0x136b1f>=_0x17854a){_0x136b1f=_0x17854a;_0x1bdb6b=0xc8;}else{_0x1bdb6b=0xce;}_0x1e50ef[_0x5b8c('0xe')](_0x1bdb6b);return _0x1e50ef[_0x5b8c('0x14')](_0x5b8c('0x15'),_0x32c207+'-'+_0x136b1f+'/'+_0x17854a)['json'](_0xf52482);}return null;};}function saveUpdates(_0x2d6f58){return function(_0x4de7e0){if(_0x4de7e0){return _0x4de7e0[_0x5b8c('0x16')](_0x2d6f58)[_0x5b8c('0x17')](function(_0x2dd30b){return _0x2dd30b;});}return null;};}function removeEntity(_0x22b725){return function(_0x4efc3b){if(_0x4efc3b){return _0x4efc3b[_0x5b8c('0x18')]()[_0x5b8c('0x17')](function(){var _0x318ac8=_0x4efc3b[_0x5b8c('0x19')]({'plain':!![]});var _0x5a3510=_0x5b8c('0x1a');return db[_0x5b8c('0x1b')][_0x5b8c('0x18')]({'where':{'type':_0x5a3510,'resourceId':_0x318ac8['id']}})[_0x5b8c('0x17')](function(){return _0x4efc3b;});})[_0x5b8c('0x17')](function(){_0x22b725[_0x5b8c('0xe')](0xcc)[_0x5b8c('0xf')]();});}};}function handleEntityNotFound(_0x370f35){return function(_0xcc324c){if(!_0xcc324c){_0x370f35['sendStatus'](0x194);}return _0xcc324c;};}function handleError(_0x4340f4,_0xb520c8){_0xb520c8=_0xb520c8||0x1f4;return function(_0x4dbd51){logger[_0x5b8c('0x1c')](_0x4dbd51[_0x5b8c('0x1d')]);if(_0x4dbd51[_0x5b8c('0x1e')]){delete _0x4dbd51[_0x5b8c('0x1e')];}_0x4340f4['status'](_0xb520c8)[_0x5b8c('0x1f')](_0x4dbd51);};}exports[_0x5b8c('0x20')]=function(_0x3861ea,_0x3db38f){var _0x3af101={};var _0x691050={'count':0x0,'rows':[]};var _0x23521a=_[_0x5b8c('0x21')](db['ChatQueue']['rawAttributes'],function(_0x5d8566){return{'name':_0x5d8566[_0x5b8c('0x22')],'type':_0x5d8566[_0x5b8c('0x23')][_0x5b8c('0x24')]};});_0x3af101=qs[_0x5b8c('0x25')](_0x23521a,_0x3861ea);var _0x517f26={'where':_0x3af101[_0x5b8c('0x26')]};return db[_0x5b8c('0x27')][_0x5b8c('0x13')](_0x517f26)[_0x5b8c('0x17')](function(_0x15a038){_0x691050[_0x5b8c('0x13')]=_0x15a038;_0x3af101[_0x5b8c('0x28')]=qs[_0x5b8c('0x28')](_0x3861ea[_0x5b8c('0x29')]);return db[_0x5b8c('0x27')][_0x5b8c('0x2a')](_0x3af101);})[_0x5b8c('0x17')](function(_0x143f08){_0x691050[_0x5b8c('0x2b')]=_0x143f08;return _0x691050;})[_0x5b8c('0x17')](respondWithFilteredResult(_0x3db38f,_0x3af101))['catch'](handleError(_0x3db38f,null));};exports[_0x5b8c('0x2c')]=function(_0x474065,_0x13db02){var _0x1f0a16={'raw':!![],'where':{'id':_0x474065['params']['id']}},_0x4509d7={};_0x4509d7[_0x5b8c('0x2d')]=_[_0x5b8c('0x2e')](db[_0x5b8c('0x27')][_0x5b8c('0x2f')]);_0x4509d7['query']=_[_0x5b8c('0x2e')](_0x474065[_0x5b8c('0x29')]);_0x4509d7[_0x5b8c('0x30')]=_['intersection'](_0x4509d7['model'],_0x4509d7[_0x5b8c('0x29')]);_0x1f0a16['attributes']=_[_0x5b8c('0x31')](_0x4509d7[_0x5b8c('0x2d')],qs[_0x5b8c('0x32')](_0x474065[_0x5b8c('0x29')][_0x5b8c('0x32')]));_0x1f0a16[_0x5b8c('0x33')]=_0x1f0a16[_0x5b8c('0x33')][_0x5b8c('0x34')]?_0x1f0a16[_0x5b8c('0x33')]:_0x4509d7[_0x5b8c('0x2d')];if(_0x474065[_0x5b8c('0x29')][_0x5b8c('0x35')]){_0x1f0a16['include']=[{'all':!![]}];}_0x1f0a16=_['merge']({},_0x1f0a16,_0x474065[_0x5b8c('0x36')]);return db[_0x5b8c('0x27')]['find'](_0x1f0a16)[_0x5b8c('0x17')](handleEntityNotFound(_0x13db02,null))['then'](respondWithResult(_0x13db02,null))[_0x5b8c('0x37')](handleError(_0x13db02,null));};exports[_0x5b8c('0x38')]=function(_0x129a3f,_0x21e215){return db[_0x5b8c('0x27')][_0x5b8c('0x38')](_0x129a3f[_0x5b8c('0x39')],{})['then'](function(_0x5a59b4){var _0x192a3c=_0x129a3f['user'][_0x5b8c('0x19')]({'plain':!![]});if(!_0x192a3c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x192a3c[_0x5b8c('0x3a')]===_0x5b8c('0x3b')){var _0x162e1c=_0x5a59b4[_0x5b8c('0x19')]({'plain':!![]});var _0x421111='ChatQueues';return db[_0x5b8c('0x3c')][_0x5b8c('0x3d')]({'where':{'name':_0x421111,'userProfileId':_0x192a3c[_0x5b8c('0x3e')]},'raw':!![]})['then'](function(_0x1d234c){if(_0x1d234c&&_0x1d234c[_0x5b8c('0x3f')]===0x0){return db[_0x5b8c('0x1b')][_0x5b8c('0x38')]({'name':_0x162e1c[_0x5b8c('0x1e')],'resourceId':_0x162e1c['id'],'type':_0x1d234c['name'],'sectionId':_0x1d234c['id']},{})[_0x5b8c('0x17')](function(){return _0x5a59b4;});}else{return _0x5a59b4;}})[_0x5b8c('0x37')](function(_0x5d9fc3){logger[_0x5b8c('0x1c')](_0x5b8c('0x40'),_0x5d9fc3);throw _0x5d9fc3;});}return _0x5a59b4;})[_0x5b8c('0x17')](respondWithResult(_0x21e215,0xc9))[_0x5b8c('0x37')](handleError(_0x21e215,null));};exports['update']=function(_0x17407b,_0x468896){if(_0x17407b['body']['id']){delete _0x17407b[_0x5b8c('0x39')]['id'];}return db['ChatQueue'][_0x5b8c('0x3d')]({'where':{'id':_0x17407b[_0x5b8c('0x41')]['id']}})[_0x5b8c('0x17')](handleEntityNotFound(_0x468896,null))[_0x5b8c('0x17')](saveUpdates(_0x17407b[_0x5b8c('0x39')],null))[_0x5b8c('0x17')](respondWithResult(_0x468896,null))[_0x5b8c('0x37')](handleError(_0x468896,null));};exports[_0x5b8c('0x18')]=function(_0xcbf4ee,_0x285f4d){return db[_0x5b8c('0x27')][_0x5b8c('0x3d')]({'where':{'id':_0xcbf4ee[_0x5b8c('0x41')]['id']}})[_0x5b8c('0x17')](handleEntityNotFound(_0x285f4d,null))[_0x5b8c('0x17')](removeEntity(_0x285f4d,null))['catch'](handleError(_0x285f4d,null));};exports[_0x5b8c('0x42')]=function(_0x548b7f,_0x5b6b84){return db[_0x5b8c('0x27')][_0x5b8c('0x42')]()[_0x5b8c('0x17')](respondWithResult(_0x5b6b84,null))[_0x5b8c('0x37')](handleError(_0x5b6b84,null));};exports['getMembers']=function(_0x294ec5,_0x57f2fd){var _0x33344d={'raw':!![],'where':{}},_0x452904={},_0x54e738;return db[_0x5b8c('0x27')][_0x5b8c('0x43')]({'where':{'id':_0x294ec5[_0x5b8c('0x41')]['id']}})[_0x5b8c('0x17')](handleEntityNotFound(_0x57f2fd,null))[_0x5b8c('0x17')](function(_0x223940){if(_0x223940){_0x54e738=_0x223940['get']({'plain':!![]});_0x452904['model']=_[_0x5b8c('0x2e')](db[_0x5b8c('0x44')][_0x5b8c('0x2f')]);_0x452904[_0x5b8c('0x29')]=_[_0x5b8c('0x2e')](_0x294ec5[_0x5b8c('0x29')]);_0x452904[_0x5b8c('0x30')]=_[_0x5b8c('0x31')](_0x452904[_0x5b8c('0x2d')],_0x452904[_0x5b8c('0x29')]);_0x33344d[_0x5b8c('0x33')]=_[_0x5b8c('0x31')](_0x452904['model'],qs[_0x5b8c('0x32')](_0x294ec5[_0x5b8c('0x29')]['fields']));_0x33344d[_0x5b8c('0x33')]=_0x33344d['attributes'][_0x5b8c('0x34')]?_0x33344d[_0x5b8c('0x33')]:_0x452904['model'];if(!_0x294ec5[_0x5b8c('0x29')][_0x5b8c('0x45')](_0x5b8c('0x46'))){_0x33344d[_0x5b8c('0x12')]=qs[_0x5b8c('0x12')](_0x294ec5[_0x5b8c('0x29')]['limit']);_0x33344d[_0x5b8c('0x10')]=qs[_0x5b8c('0x10')](_0x294ec5[_0x5b8c('0x29')][_0x5b8c('0x10')]);}_0x33344d[_0x5b8c('0x47')]=qs[_0x5b8c('0x48')](_0x294ec5['query'][_0x5b8c('0x48')]);_0x33344d[_0x5b8c('0x26')]=qs[_0x5b8c('0x30')](_[_0x5b8c('0x49')](_0x294ec5[_0x5b8c('0x29')],_0x452904[_0x5b8c('0x30')]));_0x33344d[_0x5b8c('0x26')][_0x5b8c('0x4a')]=_0x223940['id'];if(_0x294ec5[_0x5b8c('0x29')][_0x5b8c('0x4b')]){_0x33344d[_0x5b8c('0x26')]=_['merge'](_0x33344d[_0x5b8c('0x26')],{'$or':_['map'](_0x33344d['attributes'],function(_0x19474a){var _0x392c3d={};_0x392c3d[_0x19474a]={'$like':'%'+_0x294ec5['query'][_0x5b8c('0x4b')]+'%'};return _0x392c3d;})});}_0x33344d=_[_0x5b8c('0x4c')]({},_0x33344d,_0x294ec5[_0x5b8c('0x36')]);return db[_0x5b8c('0x44')][_0x5b8c('0x2a')](_0x33344d);}})['then'](function(_0x42e0b5){if(_0x42e0b5){return db['User'][_0x5b8c('0x4d')]({'where':{'id':_[_0x5b8c('0x21')](_0x42e0b5,'UserId'),'role':_0x5b8c('0x4e')},'attributes':['id',_0x5b8c('0x1e'),_0x5b8c('0x4f'),_0x5b8c('0x50'),_0x5b8c('0x51')]});}})[_0x5b8c('0x17')](function(_0x173216){if(_0x173216){return{'count':_0x173216[_0x5b8c('0x13')],'rows':_[_0x5b8c('0x21')](_0x173216[_0x5b8c('0x2b')],function(_0x2e6e70){return{'membername':_0x2e6e70['name'],'UserId':_0x2e6e70['id'],'queue_name':_0x54e738[_0x5b8c('0x1e')],'ChatQueueId':_0x54e738['id'],'interface':util['format'](_0x5b8c('0x52'),_0x5b8c('0x53'),_0x2e6e70[_0x5b8c('0x1e')]),'penalty':0x0,'paused':_0x2e6e70[_0x5b8c('0x4f')],'createdAt':_0x2e6e70[_0x5b8c('0x51')],'updatedAt':_0x2e6e70[_0x5b8c('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x57f2fd,_0x33344d))[_0x5b8c('0x37')](handleError(_0x57f2fd,null));};exports[_0x5b8c('0x54')]=function(_0x44366c,_0xdf18b1){var _0x45721f={};var _0x5901a3={};var _0x1ef146;var _0x751ea4;return db[_0x5b8c('0x27')][_0x5b8c('0x43')]({'where':{'id':_0x44366c[_0x5b8c('0x41')]['id']}})[_0x5b8c('0x17')](handleEntityNotFound(_0xdf18b1,null))['then'](function(_0x94a26d){if(_0x94a26d){_0x1ef146=_0x94a26d;_0x5901a3['model']=_[_0x5b8c('0x2e')](db[_0x5b8c('0x55')][_0x5b8c('0x2f')]);_0x5901a3[_0x5b8c('0x29')]=_['keys'](_0x44366c[_0x5b8c('0x29')]);_0x5901a3['filters']=_['intersection'](_0x5901a3['model'],_0x5901a3['query']);_0x45721f[_0x5b8c('0x33')]=_[_0x5b8c('0x31')](_0x5901a3[_0x5b8c('0x2d')],qs['fields'](_0x44366c[_0x5b8c('0x29')][_0x5b8c('0x32')]));_0x45721f['attributes']=_0x45721f[_0x5b8c('0x33')]['length']?_0x45721f[_0x5b8c('0x33')]:_0x5901a3[_0x5b8c('0x2d')];_0x45721f[_0x5b8c('0x47')]=qs['sort'](_0x44366c[_0x5b8c('0x29')][_0x5b8c('0x48')]);_0x45721f[_0x5b8c('0x26')]=qs[_0x5b8c('0x30')](_['pick'](_0x44366c[_0x5b8c('0x29')],_0x5901a3[_0x5b8c('0x30')]));if(_0x44366c[_0x5b8c('0x29')][_0x5b8c('0x4b')]){_0x45721f[_0x5b8c('0x26')]=_[_0x5b8c('0x4c')](_0x45721f[_0x5b8c('0x26')],{'$or':_[_0x5b8c('0x21')](_0x45721f[_0x5b8c('0x33')],function(_0x2f2888){var _0x2f45ac={};_0x2f45ac[_0x2f2888]={'$like':'%'+_0x44366c['query'][_0x5b8c('0x4b')]+'%'};return _0x2f45ac;})});}_0x45721f=_['merge']({},_0x45721f,_0x44366c[_0x5b8c('0x36')]);return _0x1ef146[_0x5b8c('0x54')](_0x45721f);}})[_0x5b8c('0x17')](function(_0x1d23f4){if(_0x1d23f4){_0x751ea4=_0x1d23f4[_0x5b8c('0x34')];if(!_0x44366c[_0x5b8c('0x29')][_0x5b8c('0x45')](_0x5b8c('0x46'))){_0x45721f[_0x5b8c('0x12')]=qs[_0x5b8c('0x12')](_0x44366c[_0x5b8c('0x29')]['limit']);_0x45721f['offset']=qs[_0x5b8c('0x10')](_0x44366c['query'][_0x5b8c('0x10')]);}return _0x1ef146['getTeams'](_0x45721f);}})[_0x5b8c('0x17')](function(_0x31e561){if(_0x31e561){return _0x31e561?{'count':_0x751ea4,'rows':_0x31e561}:null;}})[_0x5b8c('0x17')](respondWithResult(_0xdf18b1,null))['catch'](handleError(_0xdf18b1,null));};exports['addTeams']=function(_0x316c6a,_0x51de3a){var _0x32a58a=_0x316c6a[_0x5b8c('0x39')][_0x5b8c('0x56')];return db[_0x5b8c('0x55')][_0x5b8c('0x2a')]({'where':{'id':_0x32a58a},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5b8c('0x57'),'attributes':['id',_0x5b8c('0x1e'),_0x5b8c('0x58'),_0x5b8c('0x59'),_0x5b8c('0x5a')],'raw':!![]}]})[_0x5b8c('0x17')](function(_0x16a610){if(_0x16a610){var _0x5c702a=_[_0x5b8c('0x5b')](_0x16a610,function(_0x201987){var _0x4ba31d=_0x201987['get']({'plain':!![]});return _0x4ba31d[_0x5b8c('0x57')];});return db[_0x5b8c('0x27')][_0x5b8c('0x3d')]({'where':{'id':_0x316c6a['params']['id']}})[_0x5b8c('0x17')](function(_0x4cccf3){return db[_0x5b8c('0x5c')][_0x5b8c('0x5d')](function(_0x4440ca){return _0x4cccf3['addTeams'](_0x32a58a,{'transaction':_0x4440ca})[_0x5b8c('0x17')](function(){return BPromise[_0x5b8c('0x5e')](_0x5c702a,function(_0x5758af){return db[_0x5b8c('0x44')][_0x5b8c('0x5f')]({'where':{'UserId':_0x5758af['id'],'ChatQueueId':_0x316c6a[_0x5b8c('0x41')]['id']},'transaction':_0x4440ca});});})[_0x5b8c('0x17')](function(){_0x5c702a[_0x5b8c('0x60')](function(_0x38b1e9){socket[_0x5b8c('0x61')](_0x5b8c('0x62'),{'UserId':_0x38b1e9['id'],'ChatQueueId':_0x4cccf3['id']});});});});});}})[_0x5b8c('0x17')](respondWithStatusCode(_0x51de3a,null))['catch'](handleError(_0x51de3a,null));};exports[_0x5b8c('0x63')]=function(_0x5927e2,_0x17ae85){return db[_0x5b8c('0x55')][_0x5b8c('0x2a')]({'where':{'id':_0x5927e2['query'][_0x5b8c('0x56')]},'attributes':['id'],'include':[{'model':db[_0x5b8c('0x64')],'as':_0x5b8c('0x57'),'attributes':['id'],'raw':!![]}]})[_0x5b8c('0x17')](handleEntityNotFound(_0x17ae85,null))['then'](function(_0x1dcc53){var _0x2e402e=_['map'](_0x1dcc53,'id');var _0x1b9134=[];var _0x5ef605=[];var _0x5bd48c=squel[_0x5b8c('0x65')]();_0x5bd48c[_0x5b8c('0x66')](_0x5b8c('0x67'))[_0x5b8c('0x68')]('team_has_chat_queues','tq')['join']('user_has_teams','ut',_0x5b8c('0x69'))[_0x5b8c('0x26')](_0x5b8c('0x6a'),_0x5927e2[_0x5b8c('0x41')]['id']);for(var _0x48486d=0x0;_0x48486d<_0x1dcc53['length'];_0x48486d+=0x1){let _0x20e9ce=_0x1dcc53[_0x48486d];for(var _0x593a38=0x0;_0x593a38<_0x20e9ce[_0x5b8c('0x57')][_0x5b8c('0x34')];_0x593a38+=0x1){let _0xc28e7d=_0x20e9ce['Agents'][_0x593a38];var _0x477a61=_0x5bd48c[_0x5b8c('0x6b')]();_0x477a61[_0x5b8c('0x26')]('ut.UserId\x20=\x20?',_0xc28e7d['id']);_0x5ef605[_0x5b8c('0x6c')](db[_0x5b8c('0x5c')]['query'](_0x477a61[_0x5b8c('0x6d')](),{'type':db[_0x5b8c('0x5c')][_0x5b8c('0x6e')][_0x5b8c('0x6f')]})[_0x5b8c('0x17')](function(_0x2da927){if(_0x2da927[_0x5b8c('0x34')]===0x1){return _0xc28e7d['id'];}else{var _0x8a3a88=_[_0x5b8c('0x70')](_[_0x5b8c('0x21')](_0x2da927,'TeamId'),function(_0x423ca8){return _['includes'](_0x2e402e,_0x423ca8);});if(_0x8a3a88){return _0xc28e7d['id'];}}}));}}return BPromise[_0x5b8c('0x71')](_0x5ef605)[_0x5b8c('0x17')](function(_0x3b1739){_0x1b9134=_(_0x1b9134)[_0x5b8c('0x72')](_0x3b1739)[_0x5b8c('0x73')]()[_0x5b8c('0x74')]();return db[_0x5b8c('0x27')][_0x5b8c('0x3d')]({'where':{'id':_0x5927e2[_0x5b8c('0x41')]['id']}})[_0x5b8c('0x17')](function(_0x27e2b7){return db[_0x5b8c('0x5c')][_0x5b8c('0x5d')](function(_0x269bbc){return _0x27e2b7[_0x5b8c('0x63')](_0x5927e2[_0x5b8c('0x29')][_0x5b8c('0x56')],{'transaction':_0x269bbc})[_0x5b8c('0x17')](function(){if(!_[_0x5b8c('0x75')](_0x1b9134)){return _0x27e2b7[_0x5b8c('0x76')](_0x1b9134,{'transaction':_0x269bbc});}})[_0x5b8c('0x17')](function(){_0x1b9134[_0x5b8c('0x60')](function(_0x5d0b8c){socket[_0x5b8c('0x61')](_0x5b8c('0x77'),{'UserId':_0x5d0b8c,'ChatQueueId':_0x27e2b7['id']});});});});});});})[_0x5b8c('0x17')](respondWithStatusCode(_0x17ae85,null))[_0x5b8c('0x37')](handleError(_0x17ae85,null));};exports[_0x5b8c('0x78')]=function(_0x12afd3,_0x473f85){return db[_0x5b8c('0x27')][_0x5b8c('0x3d')]({'where':{'id':_0x12afd3[_0x5b8c('0x41')]['id']}})[_0x5b8c('0x17')](handleEntityNotFound(_0x473f85,null))['then'](function(_0x367980){if(_0x367980){return _0x367980[_0x5b8c('0x78')](_0x12afd3[_0x5b8c('0x39')][_0x5b8c('0x56')],_[_0x5b8c('0x79')](_0x12afd3[_0x5b8c('0x39')],[_0x5b8c('0x56'),'id'])||{})['spread'](function(_0x18874d){for(var _0xcaf120=0x0;_0xcaf120<_0x12afd3[_0x5b8c('0x39')]['ids']['length'];_0xcaf120+=0x1){socket[_0x5b8c('0x61')](_0x5b8c('0x62'),{'UserId':Number(_0x12afd3[_0x5b8c('0x39')][_0x5b8c('0x56')][_0xcaf120]),'ChatQueueId':Number(_0x12afd3[_0x5b8c('0x41')]['id'])});}return _0x18874d;});}})[_0x5b8c('0x17')](respondWithResult(_0x473f85,null))[_0x5b8c('0x37')](handleError(_0x473f85,null));};exports['removeAgents']=function(_0x5e13b8,_0x18cc97){return db['ChatQueue'][_0x5b8c('0x3d')]({'where':{'id':_0x5e13b8[_0x5b8c('0x41')]['id']}})[_0x5b8c('0x17')](handleEntityNotFound(_0x18cc97,null))['then'](function(_0x4f6e53){if(_0x4f6e53){return _0x4f6e53[_0x5b8c('0x76')](_0x5e13b8[_0x5b8c('0x29')][_0x5b8c('0x56')])[_0x5b8c('0x17')](function(){if(_[_0x5b8c('0x7a')](_0x5e13b8[_0x5b8c('0x29')][_0x5b8c('0x56')])){for(var _0x113f9b=0x0;_0x113f9b<_0x5e13b8['query']['ids'][_0x5b8c('0x34')];_0x113f9b+=0x1){socket[_0x5b8c('0x61')](_0x5b8c('0x77'),{'UserId':Number(_0x5e13b8[_0x5b8c('0x29')]['ids'][_0x113f9b]),'ChatQueueId':Number(_0x5e13b8[_0x5b8c('0x41')]['id'])});}}else{socket[_0x5b8c('0x61')](_0x5b8c('0x77'),{'UserId':Number(_0x5e13b8[_0x5b8c('0x29')][_0x5b8c('0x56')]),'ChatQueueId':Number(_0x5e13b8[_0x5b8c('0x41')]['id'])});}});}})['then'](respondWithStatusCode(_0x18cc97,null))[_0x5b8c('0x37')](handleError(_0x18cc97,null));};exports['getAgents']=function(_0x492610,_0x1473dc){var _0x1e1967={};var _0x138d46={};var _0x27e497;var _0x3c4f39;return db[_0x5b8c('0x27')][_0x5b8c('0x43')]({'where':{'id':_0x492610[_0x5b8c('0x41')]['id']}})[_0x5b8c('0x17')](handleEntityNotFound(_0x1473dc,null))[_0x5b8c('0x17')](function(_0x2f0659){if(_0x2f0659){_0x27e497=_0x2f0659;_0x138d46[_0x5b8c('0x2d')]=_['keys'](db[_0x5b8c('0x64')][_0x5b8c('0x2f')]);_0x138d46[_0x5b8c('0x29')]=_[_0x5b8c('0x2e')](_0x492610[_0x5b8c('0x29')]);_0x138d46[_0x5b8c('0x30')]=_[_0x5b8c('0x31')](_0x138d46[_0x5b8c('0x2d')],_0x138d46[_0x5b8c('0x29')]);_0x1e1967[_0x5b8c('0x33')]=_[_0x5b8c('0x31')](_0x138d46[_0x5b8c('0x2d')],qs['fields'](_0x492610[_0x5b8c('0x29')][_0x5b8c('0x32')]));_0x1e1967[_0x5b8c('0x33')]=_0x1e1967[_0x5b8c('0x33')][_0x5b8c('0x34')]?_0x1e1967[_0x5b8c('0x33')]:_0x138d46['model'];_0x1e1967['order']=qs[_0x5b8c('0x48')](_0x492610[_0x5b8c('0x29')][_0x5b8c('0x48')]);_0x1e1967['where']=qs[_0x5b8c('0x30')](_['pick'](_0x492610[_0x5b8c('0x29')],_0x138d46[_0x5b8c('0x30')]));if(_0x492610[_0x5b8c('0x29')][_0x5b8c('0x4b')]){_0x1e1967[_0x5b8c('0x26')]=_[_0x5b8c('0x4c')](_0x1e1967[_0x5b8c('0x26')],{'$or':_[_0x5b8c('0x21')](_0x1e1967[_0x5b8c('0x33')],function(_0x55cb54){var _0x2a1de8={};_0x2a1de8[_0x55cb54]={'$like':'%'+_0x492610['query'][_0x5b8c('0x4b')]+'%'};return _0x2a1de8;})});}_0x1e1967=_[_0x5b8c('0x4c')]({},_0x1e1967,_0x492610[_0x5b8c('0x36')]);return _0x27e497[_0x5b8c('0x7b')](_0x1e1967);}})[_0x5b8c('0x17')](function(_0x45f715){if(_0x45f715){_0x3c4f39=_0x45f715[_0x5b8c('0x34')];if(!_0x492610[_0x5b8c('0x29')][_0x5b8c('0x45')](_0x5b8c('0x46'))){_0x1e1967[_0x5b8c('0x12')]=qs[_0x5b8c('0x12')](_0x492610['query']['limit']);_0x1e1967[_0x5b8c('0x10')]=qs['offset'](_0x492610[_0x5b8c('0x29')][_0x5b8c('0x10')]);}return _0x27e497[_0x5b8c('0x7b')](_0x1e1967);}})[_0x5b8c('0x17')](function(_0x41078e){if(_0x41078e){return _0x41078e?{'count':_0x3c4f39,'rows':_0x41078e}:null;}})[_0x5b8c('0x17')](respondWithResult(_0x1473dc,null))['catch'](handleError(_0x1473dc,null));}; \ No newline at end of file +var _0x850f=['UserChatQueue','hasOwnProperty','order','sort','pick','filter','findAll','User','findAndCountAll','UserId','agent','chatPause','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','addTeams','ids','online','voicePause','interface','Agents','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','join','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','value','transaction','removeAgents','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','nolimit','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','ChatQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','getOptions','where','include','query','ChatQueue','rows','params','keys','filters','intersection','attributes','model','fields','length','merge','options','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne'];(function(_0x873b4a,_0x530ded){var _0x127210=function(_0x1a57af){while(--_0x1a57af){_0x873b4a['push'](_0x873b4a['shift']());}};_0x127210(++_0x530ded);}(_0x850f,0xb6));var _0xf850=function(_0x2657ee,_0x18647f){_0x2657ee=_0x2657ee-0x0;var _0x2785f3=_0x850f[_0x2657ee];return _0x2785f3;};'use strict';var BPromise=require(_0xf850('0x0'));var util=require('util');var _=require(_0xf850('0x1'));var squel=require('squel');var Redis=require(_0xf850('0x2'));var qs=require(_0xf850('0x3'));var logger=require(_0xf850('0x4'))(_0xf850('0x5'));var config=require(_0xf850('0x6'));var db=require(_0xf850('0x7'))['db'];config[_0xf850('0x8')]=_[_0xf850('0x9')](config[_0xf850('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xf850('0xa'))(new Redis(config[_0xf850('0x8')]));require(_0xf850('0xb'))[_0xf850('0xc')](socket);function respondWithStatusCode(_0x14f3e9,_0x497d66){_0x497d66=_0x497d66||0xcc;return function(_0x48ec9e){if(_0x48ec9e){return _0x14f3e9[_0xf850('0xd')](_0x497d66);}return _0x14f3e9['status'](_0x497d66)[_0xf850('0xe')]();};}function respondWithResult(_0x370649,_0x221cdc){_0x221cdc=_0x221cdc||0xc8;return function(_0x5c7e7b){if(_0x5c7e7b){return _0x370649[_0xf850('0xf')](_0x221cdc)[_0xf850('0x10')](_0x5c7e7b);}};}function respondWithFilteredResult(_0xaa376e,_0x18ed1f){return function(_0x5b4b2f){if(_0x5b4b2f){var _0x5cd387=typeof _0x18ed1f[_0xf850('0x11')]==='undefined'&&typeof _0x18ed1f[_0xf850('0x12')]===_0xf850('0x13');var _0x2b0110=_0x5b4b2f['count'];var _0x32703b=_0x5cd387?0x0:_0x18ed1f[_0xf850('0x11')];var _0x47d7b5=_0x5cd387?_0x5b4b2f[_0xf850('0x14')]:_0x18ed1f[_0xf850('0x11')]+_0x18ed1f[_0xf850('0x12')];var _0x2ebbba;if(_0x47d7b5>=_0x2b0110){_0x47d7b5=_0x2b0110;_0x2ebbba=0xc8;}else{_0x2ebbba=0xce;}_0xaa376e[_0xf850('0xf')](_0x2ebbba);return _0xaa376e[_0xf850('0x15')](_0xf850('0x16'),_0x32703b+'-'+_0x47d7b5+'/'+_0x2b0110)[_0xf850('0x10')](_0x5b4b2f);}return null;};}function saveUpdates(_0x16ca2b){return function(_0x43e4b1){if(_0x43e4b1){return _0x43e4b1[_0xf850('0x17')](_0x16ca2b)[_0xf850('0x18')](function(_0x1a6f9e){return _0x1a6f9e;});}return null;};}function removeEntity(_0x1506e5){return function(_0x1a71d8){if(_0x1a71d8){return _0x1a71d8[_0xf850('0x19')]()[_0xf850('0x18')](function(){var _0x33eaaa=_0x1a71d8['get']({'plain':!![]});var _0x2b5d8e=_0xf850('0x1a');return db[_0xf850('0x1b')][_0xf850('0x19')]({'where':{'type':_0x2b5d8e,'resourceId':_0x33eaaa['id']}})['then'](function(){return _0x1a71d8;});})[_0xf850('0x18')](function(){_0x1506e5['status'](0xcc)[_0xf850('0xe')]();});}};}function handleEntityNotFound(_0x1af7ff){return function(_0x2d55b3){if(!_0x2d55b3){_0x1af7ff['sendStatus'](0x194);}return _0x2d55b3;};}function handleError(_0x5ad608,_0x146888){_0x146888=_0x146888||0x1f4;return function(_0x376ef8){logger[_0xf850('0x1c')](_0x376ef8[_0xf850('0x1d')]);if(_0x376ef8[_0xf850('0x1e')]){delete _0x376ef8[_0xf850('0x1e')];}_0x5ad608['status'](_0x146888)[_0xf850('0x1f')](_0x376ef8);};}exports[_0xf850('0x20')]=function(_0x44df32,_0x29cf7b){var _0x456aa3={};var _0x133bdf={'count':0x0,'rows':[]};var _0x42c3f4=_[_0xf850('0x21')](db['ChatQueue'][_0xf850('0x22')],function(_0x1cc98e){return{'name':_0x1cc98e[_0xf850('0x23')],'type':_0x1cc98e['type'][_0xf850('0x24')]};});_0x456aa3=qs[_0xf850('0x25')](_0x42c3f4,_0x44df32);var _0x1524dc={'where':_0x456aa3[_0xf850('0x26')]};return db['ChatQueue'][_0xf850('0x14')](_0x1524dc)[_0xf850('0x18')](function(_0x4c82eb){_0x133bdf['count']=_0x4c82eb;_0x456aa3[_0xf850('0x27')]=qs[_0xf850('0x27')](_0x44df32[_0xf850('0x28')]);return db[_0xf850('0x29')]['findAll'](_0x456aa3);})[_0xf850('0x18')](function(_0x4db3e0){_0x133bdf[_0xf850('0x2a')]=_0x4db3e0;return _0x133bdf;})[_0xf850('0x18')](respondWithFilteredResult(_0x29cf7b,_0x456aa3))['catch'](handleError(_0x29cf7b,null));};exports['show']=function(_0x20635e,_0x3dffed){var _0x32afaf={'raw':!![],'where':{'id':_0x20635e[_0xf850('0x2b')]['id']}},_0x1cf7e1={};_0x1cf7e1['model']=_['keys'](db['ChatQueue'][_0xf850('0x22')]);_0x1cf7e1[_0xf850('0x28')]=_[_0xf850('0x2c')](_0x20635e[_0xf850('0x28')]);_0x1cf7e1[_0xf850('0x2d')]=_[_0xf850('0x2e')](_0x1cf7e1['model'],_0x1cf7e1[_0xf850('0x28')]);_0x32afaf[_0xf850('0x2f')]=_[_0xf850('0x2e')](_0x1cf7e1[_0xf850('0x30')],qs[_0xf850('0x31')](_0x20635e[_0xf850('0x28')][_0xf850('0x31')]));_0x32afaf[_0xf850('0x2f')]=_0x32afaf[_0xf850('0x2f')][_0xf850('0x32')]?_0x32afaf['attributes']:_0x1cf7e1[_0xf850('0x30')];if(_0x20635e['query']['includeAll']){_0x32afaf[_0xf850('0x27')]=[{'all':!![]}];}_0x32afaf=_[_0xf850('0x33')]({},_0x32afaf,_0x20635e[_0xf850('0x34')]);return db[_0xf850('0x29')]['find'](_0x32afaf)['then'](handleEntityNotFound(_0x3dffed,null))['then'](respondWithResult(_0x3dffed,null))[_0xf850('0x35')](handleError(_0x3dffed,null));};exports[_0xf850('0x36')]=function(_0xdee3d3,_0x30139b){return db[_0xf850('0x29')]['create'](_0xdee3d3['body'],{})[_0xf850('0x18')](function(_0x48fce7){var _0x5714e5=_0xdee3d3[_0xf850('0x37')][_0xf850('0x38')]({'plain':!![]});if(!_0x5714e5)throw new Error(_0xf850('0x39'));if(_0x5714e5[_0xf850('0x3a')]===_0xf850('0x37')){var _0x5868ee=_0x48fce7[_0xf850('0x38')]({'plain':!![]});var _0x5a6077=_0xf850('0x1a');return db[_0xf850('0x3b')][_0xf850('0x3c')]({'where':{'name':_0x5a6077,'userProfileId':_0x5714e5[_0xf850('0x3d')]},'raw':!![]})['then'](function(_0x46d5f5){if(_0x46d5f5&&_0x46d5f5[_0xf850('0x3e')]===0x0){return db[_0xf850('0x1b')][_0xf850('0x36')]({'name':_0x5868ee[_0xf850('0x1e')],'resourceId':_0x5868ee['id'],'type':_0x46d5f5[_0xf850('0x1e')],'sectionId':_0x46d5f5['id']},{})[_0xf850('0x18')](function(){return _0x48fce7;});}else{return _0x48fce7;}})[_0xf850('0x35')](function(_0x1c8dc2){logger[_0xf850('0x1c')](_0xf850('0x3f'),_0x1c8dc2);throw _0x1c8dc2;});}return _0x48fce7;})[_0xf850('0x18')](respondWithResult(_0x30139b,0xc9))[_0xf850('0x35')](handleError(_0x30139b,null));};exports[_0xf850('0x17')]=function(_0x16cf53,_0x211782){if(_0x16cf53['body']['id']){delete _0x16cf53['body']['id'];}return db[_0xf850('0x29')]['find']({'where':{'id':_0x16cf53[_0xf850('0x2b')]['id']}})[_0xf850('0x18')](handleEntityNotFound(_0x211782,null))['then'](saveUpdates(_0x16cf53[_0xf850('0x40')],null))['then'](respondWithResult(_0x211782,null))[_0xf850('0x35')](handleError(_0x211782,null));};exports[_0xf850('0x19')]=function(_0x4178de,_0x307fb1){return db[_0xf850('0x29')][_0xf850('0x3c')]({'where':{'id':_0x4178de[_0xf850('0x2b')]['id']}})[_0xf850('0x18')](handleEntityNotFound(_0x307fb1,null))['then'](removeEntity(_0x307fb1,null))[_0xf850('0x35')](handleError(_0x307fb1,null));};exports['describe']=function(_0x37a97c,_0x42526b){return db['ChatQueue'][_0xf850('0x41')]()[_0xf850('0x18')](respondWithResult(_0x42526b,null))['catch'](handleError(_0x42526b,null));};exports[_0xf850('0x42')]=function(_0x2f7e0a,_0xc4d657){var _0x1a4b3e={'raw':!![],'where':{}},_0x2189b3={},_0x19b813;return db[_0xf850('0x29')][_0xf850('0x43')]({'where':{'id':_0x2f7e0a['params']['id']}})[_0xf850('0x18')](handleEntityNotFound(_0xc4d657,null))[_0xf850('0x18')](function(_0x2b9c0f){if(_0x2b9c0f){_0x19b813=_0x2b9c0f['get']({'plain':!![]});_0x2189b3[_0xf850('0x30')]=_[_0xf850('0x2c')](db[_0xf850('0x44')][_0xf850('0x22')]);_0x2189b3['query']=_[_0xf850('0x2c')](_0x2f7e0a[_0xf850('0x28')]);_0x2189b3[_0xf850('0x2d')]=_[_0xf850('0x2e')](_0x2189b3[_0xf850('0x30')],_0x2189b3[_0xf850('0x28')]);_0x1a4b3e['attributes']=_[_0xf850('0x2e')](_0x2189b3[_0xf850('0x30')],qs[_0xf850('0x31')](_0x2f7e0a['query']['fields']));_0x1a4b3e[_0xf850('0x2f')]=_0x1a4b3e[_0xf850('0x2f')][_0xf850('0x32')]?_0x1a4b3e[_0xf850('0x2f')]:_0x2189b3[_0xf850('0x30')];if(!_0x2f7e0a[_0xf850('0x28')][_0xf850('0x45')]('nolimit')){_0x1a4b3e['limit']=qs[_0xf850('0x12')](_0x2f7e0a[_0xf850('0x28')][_0xf850('0x12')]);_0x1a4b3e[_0xf850('0x11')]=qs[_0xf850('0x11')](_0x2f7e0a['query'][_0xf850('0x11')]);}_0x1a4b3e[_0xf850('0x46')]=qs[_0xf850('0x47')](_0x2f7e0a[_0xf850('0x28')]['sort']);_0x1a4b3e['where']=qs['filters'](_[_0xf850('0x48')](_0x2f7e0a['query'],_0x2189b3[_0xf850('0x2d')]));_0x1a4b3e[_0xf850('0x26')]['ChatQueueId']=_0x2b9c0f['id'];if(_0x2f7e0a['query']['filter']){_0x1a4b3e[_0xf850('0x26')]=_['merge'](_0x1a4b3e[_0xf850('0x26')],{'$or':_[_0xf850('0x21')](_0x1a4b3e[_0xf850('0x2f')],function(_0x42efc6){var _0x5e0382={};_0x5e0382[_0x42efc6]={'$like':'%'+_0x2f7e0a[_0xf850('0x28')][_0xf850('0x49')]+'%'};return _0x5e0382;})});}_0x1a4b3e=_[_0xf850('0x33')]({},_0x1a4b3e,_0x2f7e0a[_0xf850('0x34')]);return db[_0xf850('0x44')][_0xf850('0x4a')](_0x1a4b3e);}})['then'](function(_0x126aa9){if(_0x126aa9){return db[_0xf850('0x4b')][_0xf850('0x4c')]({'where':{'id':_[_0xf850('0x21')](_0x126aa9,_0xf850('0x4d')),'role':_0xf850('0x4e')},'attributes':['id',_0xf850('0x1e'),_0xf850('0x4f'),'updatedAt','createdAt']});}})[_0xf850('0x18')](function(_0x36f331){if(_0x36f331){return{'count':_0x36f331[_0xf850('0x14')],'rows':_['map'](_0x36f331['rows'],function(_0x4366d6){return{'membername':_0x4366d6[_0xf850('0x1e')],'UserId':_0x4366d6['id'],'queue_name':_0x19b813[_0xf850('0x1e')],'ChatQueueId':_0x19b813['id'],'interface':util['format'](_0xf850('0x50'),_0xf850('0x51'),_0x4366d6['name']),'penalty':0x0,'paused':_0x4366d6['chatPause'],'createdAt':_0x4366d6[_0xf850('0x52')],'updatedAt':_0x4366d6[_0xf850('0x53')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xc4d657,_0x1a4b3e))['catch'](handleError(_0xc4d657,null));};exports[_0xf850('0x54')]=function(_0x5c19ea,_0x49bad9){var _0x4832cf={};var _0x146146={};var _0x2bff35;var _0x3ff06c;return db['ChatQueue']['findOne']({'where':{'id':_0x5c19ea[_0xf850('0x2b')]['id']}})[_0xf850('0x18')](handleEntityNotFound(_0x49bad9,null))[_0xf850('0x18')](function(_0x2486b8){if(_0x2486b8){_0x2bff35=_0x2486b8;_0x146146[_0xf850('0x30')]=_[_0xf850('0x2c')](db[_0xf850('0x55')][_0xf850('0x22')]);_0x146146[_0xf850('0x28')]=_[_0xf850('0x2c')](_0x5c19ea['query']);_0x146146['filters']=_[_0xf850('0x2e')](_0x146146[_0xf850('0x30')],_0x146146[_0xf850('0x28')]);_0x4832cf['attributes']=_[_0xf850('0x2e')](_0x146146[_0xf850('0x30')],qs[_0xf850('0x31')](_0x5c19ea[_0xf850('0x28')][_0xf850('0x31')]));_0x4832cf['attributes']=_0x4832cf[_0xf850('0x2f')]['length']?_0x4832cf[_0xf850('0x2f')]:_0x146146[_0xf850('0x30')];_0x4832cf['order']=qs['sort'](_0x5c19ea[_0xf850('0x28')][_0xf850('0x47')]);_0x4832cf[_0xf850('0x26')]=qs[_0xf850('0x2d')](_['pick'](_0x5c19ea['query'],_0x146146[_0xf850('0x2d')]));if(_0x5c19ea[_0xf850('0x28')]['filter']){_0x4832cf[_0xf850('0x26')]=_[_0xf850('0x33')](_0x4832cf[_0xf850('0x26')],{'$or':_['map'](_0x4832cf['attributes'],function(_0x5ed9b5){var _0x2c32ee={};_0x2c32ee[_0x5ed9b5]={'$like':'%'+_0x5c19ea[_0xf850('0x28')]['filter']+'%'};return _0x2c32ee;})});}_0x4832cf=_['merge']({},_0x4832cf,_0x5c19ea[_0xf850('0x34')]);return _0x2bff35[_0xf850('0x54')](_0x4832cf);}})[_0xf850('0x18')](function(_0x84b2c1){if(_0x84b2c1){_0x3ff06c=_0x84b2c1[_0xf850('0x32')];if(!_0x5c19ea[_0xf850('0x28')][_0xf850('0x45')]('nolimit')){_0x4832cf['limit']=qs[_0xf850('0x12')](_0x5c19ea[_0xf850('0x28')]['limit']);_0x4832cf['offset']=qs['offset'](_0x5c19ea[_0xf850('0x28')]['offset']);}return _0x2bff35['getTeams'](_0x4832cf);}})[_0xf850('0x18')](function(_0x285b8){if(_0x285b8){return _0x285b8?{'count':_0x3ff06c,'rows':_0x285b8}:null;}})[_0xf850('0x18')](respondWithResult(_0x49bad9,null))[_0xf850('0x35')](handleError(_0x49bad9,null));};exports[_0xf850('0x56')]=function(_0x28a0a9,_0x22be54){var _0x6f37ff=_0x28a0a9[_0xf850('0x40')][_0xf850('0x57')];return db[_0xf850('0x55')][_0xf850('0x4a')]({'where':{'id':_0x6f37ff},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0xf850('0x58'),_0xf850('0x59'),_0xf850('0x5a')],'raw':!![]}]})[_0xf850('0x18')](function(_0x23d873){if(_0x23d873){var _0x19c483=_['flatMap'](_0x23d873,function(_0x2b6a46){var _0x5e2880=_0x2b6a46[_0xf850('0x38')]({'plain':!![]});return _0x5e2880[_0xf850('0x5b')];});return db[_0xf850('0x29')][_0xf850('0x3c')]({'where':{'id':_0x28a0a9[_0xf850('0x2b')]['id']}})['then'](function(_0x17acdf){return db[_0xf850('0x5c')]['transaction'](function(_0x3a3640){return _0x17acdf[_0xf850('0x56')](_0x6f37ff,{'transaction':_0x3a3640})[_0xf850('0x18')](function(){return BPromise[_0xf850('0x5d')](_0x19c483,function(_0x454fcf){return db[_0xf850('0x44')][_0xf850('0x5e')]({'where':{'UserId':_0x454fcf['id'],'ChatQueueId':_0x28a0a9[_0xf850('0x2b')]['id']},'transaction':_0x3a3640});});})['then'](function(){_0x19c483[_0xf850('0x5f')](function(_0x3ac203){socket[_0xf850('0x60')](_0xf850('0x61'),{'UserId':_0x3ac203['id'],'ChatQueueId':_0x17acdf['id']});});});});});}})['then'](respondWithStatusCode(_0x22be54,null))[_0xf850('0x35')](handleError(_0x22be54,null));};exports[_0xf850('0x62')]=function(_0x400be6,_0x1b3dab){return db[_0xf850('0x55')][_0xf850('0x4a')]({'where':{'id':_0x400be6[_0xf850('0x28')][_0xf850('0x57')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf850('0x5b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1b3dab,null))[_0xf850('0x18')](function(_0x4a13e9){var _0x5837bc=_[_0xf850('0x21')](_0x4a13e9,'id');var _0x4cf6ec=[];var _0x22d112=[];var _0x4cb941=squel[_0xf850('0x63')]();_0x4cb941['field'](_0xf850('0x64'))[_0xf850('0x65')](_0xf850('0x66'),'tq')[_0xf850('0x67')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf850('0x26')](_0xf850('0x68'),_0x400be6[_0xf850('0x2b')]['id']);for(var _0x59d8fc=0x0;_0x59d8fc<_0x4a13e9[_0xf850('0x32')];_0x59d8fc+=0x1){let _0x4a658d=_0x4a13e9[_0x59d8fc];for(var _0x4d472f=0x0;_0x4d472f<_0x4a658d[_0xf850('0x5b')][_0xf850('0x32')];_0x4d472f+=0x1){let _0x1bf958=_0x4a658d[_0xf850('0x5b')][_0x4d472f];var _0x552613=_0x4cb941[_0xf850('0x69')]();_0x552613[_0xf850('0x26')](_0xf850('0x6a'),_0x1bf958['id']);_0x22d112[_0xf850('0x6b')](db[_0xf850('0x5c')][_0xf850('0x28')](_0x552613[_0xf850('0x6c')](),{'type':db['sequelize']['QueryTypes'][_0xf850('0x6d')]})['then'](function(_0x3ba0f6){if(_0x3ba0f6['length']===0x1){return _0x1bf958['id'];}else{var _0xe5b5b3=_[_0xf850('0x6e')](_[_0xf850('0x21')](_0x3ba0f6,_0xf850('0x6f')),function(_0x4c3db5){return _[_0xf850('0x70')](_0x5837bc,_0x4c3db5);});if(_0xe5b5b3){return _0x1bf958['id'];}}}));}}return BPromise[_0xf850('0x71')](_0x22d112)[_0xf850('0x18')](function(_0x530a49){_0x4cf6ec=_(_0x4cf6ec)[_0xf850('0x72')](_0x530a49)['compact']()[_0xf850('0x73')]();return db[_0xf850('0x29')]['find']({'where':{'id':_0x400be6[_0xf850('0x2b')]['id']}})['then'](function(_0xa795b6){return db['sequelize'][_0xf850('0x74')](function(_0x3a8c71){return _0xa795b6[_0xf850('0x62')](_0x400be6['query'][_0xf850('0x57')],{'transaction':_0x3a8c71})[_0xf850('0x18')](function(){if(!_['isEmpty'](_0x4cf6ec)){return _0xa795b6[_0xf850('0x75')](_0x4cf6ec,{'transaction':_0x3a8c71});}})['then'](function(){_0x4cf6ec[_0xf850('0x5f')](function(_0xd07c3f){socket[_0xf850('0x60')]('userChatQueue:remove',{'UserId':_0xd07c3f,'ChatQueueId':_0xa795b6['id']});});});});});});})[_0xf850('0x18')](respondWithStatusCode(_0x1b3dab,null))[_0xf850('0x35')](handleError(_0x1b3dab,null));};exports[_0xf850('0x76')]=function(_0x4752ac,_0x317ce0){return db[_0xf850('0x29')][_0xf850('0x3c')]({'where':{'id':_0x4752ac['params']['id']}})[_0xf850('0x18')](handleEntityNotFound(_0x317ce0,null))[_0xf850('0x18')](function(_0x377669){if(_0x377669){return _0x377669[_0xf850('0x76')](_0x4752ac[_0xf850('0x40')]['ids'],_[_0xf850('0x77')](_0x4752ac['body'],[_0xf850('0x57'),'id'])||{})[_0xf850('0x78')](function(_0x5ad861){for(var _0x41fd19=0x0;_0x41fd19<_0x4752ac[_0xf850('0x40')][_0xf850('0x57')][_0xf850('0x32')];_0x41fd19+=0x1){socket[_0xf850('0x60')](_0xf850('0x61'),{'UserId':Number(_0x4752ac[_0xf850('0x40')]['ids'][_0x41fd19]),'ChatQueueId':Number(_0x4752ac[_0xf850('0x2b')]['id'])});}return _0x5ad861;});}})[_0xf850('0x18')](respondWithResult(_0x317ce0,null))[_0xf850('0x35')](handleError(_0x317ce0,null));};exports['removeAgents']=function(_0x50caa6,_0x5662ec){return db[_0xf850('0x29')]['find']({'where':{'id':_0x50caa6[_0xf850('0x2b')]['id']}})[_0xf850('0x18')](handleEntityNotFound(_0x5662ec,null))[_0xf850('0x18')](function(_0x13f694){if(_0x13f694){return _0x13f694[_0xf850('0x75')](_0x50caa6[_0xf850('0x28')][_0xf850('0x57')])[_0xf850('0x18')](function(){if(_[_0xf850('0x79')](_0x50caa6['query'][_0xf850('0x57')])){for(var _0x580117=0x0;_0x580117<_0x50caa6[_0xf850('0x28')][_0xf850('0x57')][_0xf850('0x32')];_0x580117+=0x1){socket[_0xf850('0x60')](_0xf850('0x7a'),{'UserId':Number(_0x50caa6['query'][_0xf850('0x57')][_0x580117]),'ChatQueueId':Number(_0x50caa6[_0xf850('0x2b')]['id'])});}}else{socket['emit'](_0xf850('0x7a'),{'UserId':Number(_0x50caa6[_0xf850('0x28')][_0xf850('0x57')]),'ChatQueueId':Number(_0x50caa6[_0xf850('0x2b')]['id'])});}});}})['then'](respondWithStatusCode(_0x5662ec,null))[_0xf850('0x35')](handleError(_0x5662ec,null));};exports[_0xf850('0x7b')]=function(_0xf63c9e,_0x1645dc){var _0x4a55f0={};var _0x265427={};var _0x5cc060;var _0x2937e8;return db['ChatQueue']['findOne']({'where':{'id':_0xf63c9e[_0xf850('0x2b')]['id']}})[_0xf850('0x18')](handleEntityNotFound(_0x1645dc,null))['then'](function(_0xbe6fda){if(_0xbe6fda){_0x5cc060=_0xbe6fda;_0x265427[_0xf850('0x30')]=_[_0xf850('0x2c')](db['User'][_0xf850('0x22')]);_0x265427['query']=_['keys'](_0xf63c9e[_0xf850('0x28')]);_0x265427[_0xf850('0x2d')]=_[_0xf850('0x2e')](_0x265427[_0xf850('0x30')],_0x265427[_0xf850('0x28')]);_0x4a55f0[_0xf850('0x2f')]=_[_0xf850('0x2e')](_0x265427[_0xf850('0x30')],qs[_0xf850('0x31')](_0xf63c9e['query'][_0xf850('0x31')]));_0x4a55f0[_0xf850('0x2f')]=_0x4a55f0[_0xf850('0x2f')][_0xf850('0x32')]?_0x4a55f0[_0xf850('0x2f')]:_0x265427['model'];_0x4a55f0[_0xf850('0x46')]=qs[_0xf850('0x47')](_0xf63c9e[_0xf850('0x28')][_0xf850('0x47')]);_0x4a55f0[_0xf850('0x26')]=qs['filters'](_[_0xf850('0x48')](_0xf63c9e[_0xf850('0x28')],_0x265427['filters']));if(_0xf63c9e[_0xf850('0x28')][_0xf850('0x49')]){_0x4a55f0[_0xf850('0x26')]=_[_0xf850('0x33')](_0x4a55f0['where'],{'$or':_[_0xf850('0x21')](_0x4a55f0[_0xf850('0x2f')],function(_0x3412e5){var _0x769e5e={};_0x769e5e[_0x3412e5]={'$like':'%'+_0xf63c9e['query'][_0xf850('0x49')]+'%'};return _0x769e5e;})});}_0x4a55f0=_[_0xf850('0x33')]({},_0x4a55f0,_0xf63c9e['options']);return _0x5cc060[_0xf850('0x7b')](_0x4a55f0);}})[_0xf850('0x18')](function(_0x2d4cda){if(_0x2d4cda){_0x2937e8=_0x2d4cda['length'];if(!_0xf63c9e[_0xf850('0x28')]['hasOwnProperty'](_0xf850('0x7c'))){_0x4a55f0[_0xf850('0x12')]=qs[_0xf850('0x12')](_0xf63c9e['query'][_0xf850('0x12')]);_0x4a55f0[_0xf850('0x11')]=qs[_0xf850('0x11')](_0xf63c9e[_0xf850('0x28')][_0xf850('0x11')]);}return _0x5cc060['getAgents'](_0x4a55f0);}})['then'](function(_0x3d1574){if(_0x3d1574){return _0x3d1574?{'count':_0x2937e8,'rows':_0x3d1574}:null;}})[_0xf850('0x18')](respondWithResult(_0x1645dc,null))[_0xf850('0x35')](handleError(_0x1645dc,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index cacefca..1205d94 100644 --- a/server/api/chatQueue/chatQueue.events.js +++ b/server/api/chatQueue/chatQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d93=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x368e74,_0x1afa3c){var _0x1f393e=function(_0xd401c4){while(--_0xd401c4){_0x368e74['push'](_0x368e74['shift']());}};_0x1f393e(++_0x1afa3c);}(_0x6d93,0x177));var _0x36d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d93[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x36d9('0x0'));var ChatQueue=require(_0x36d9('0x1'))['db'][_0x36d9('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x36d9('0x3')](0x0);var events={'afterCreate':_0x36d9('0x4'),'afterUpdate':_0x36d9('0x5'),'afterDestroy':_0x36d9('0x6')};function emitEvent(_0x5caf36){return function(_0xd57379,_0x21a561,_0x179082){ChatQueueEvents[_0x36d9('0x7')](_0x5caf36+':'+_0xd57379['id'],_0xd57379);ChatQueueEvents[_0x36d9('0x7')](_0x5caf36,_0xd57379);_0x179082(null);};}for(var e in events){if(events[_0x36d9('0x8')](e)){var event=events[e];ChatQueue[_0x36d9('0x9')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xcdc8=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0x16a7bc,_0x3ee4fb){var _0x54e51d=function(_0x37aa57){while(--_0x37aa57){_0x16a7bc['push'](_0x16a7bc['shift']());}};_0x54e51d(++_0x3ee4fb);}(_0xcdc8,0x1a9));var _0x8cdc=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xcdc8[_0x134c2e];return _0x2825db;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x8cdc('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8cdc('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8cdc('0x2'),'afterDestroy':_0x8cdc('0x3')};function emitEvent(_0x440424){return function(_0x5a5de8,_0x3591a5,_0x450ba0){ChatQueueEvents[_0x8cdc('0x4')](_0x440424+':'+_0x5a5de8['id'],_0x5a5de8);ChatQueueEvents[_0x8cdc('0x4')](_0x440424,_0x5a5de8);_0x450ba0(null);};}for(var e in events){if(events[_0x8cdc('0x5')](e)){var event=events[e];ChatQueue[_0x8cdc('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 392a179..bc849a0 100644 --- a/server/api/chatQueue/chatQueue.model.js +++ b/server/api/chatQueue/chatQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x383c=['bluebird','request-promise','rimraf','./chatQueue.attributes','lodash','util','../../config/logger','api','moment'];(function(_0x3c8d95,_0x1cffaa){var _0x501c2f=function(_0x5c88d0){while(--_0x5c88d0){_0x3c8d95['push'](_0x3c8d95['shift']());}};_0x501c2f(++_0x1cffaa);}(_0x383c,0xaf));var _0xc383=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x383c[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0xc383('0x0'));var util=require(_0xc383('0x1'));var logger=require(_0xc383('0x2'))(_0xc383('0x3'));var moment=require(_0xc383('0x4'));var BPromise=require(_0xc383('0x5'));var rp=require(_0xc383('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc383('0x7'));var config=require('../../config/environment');var attributes=require(_0xc383('0x8'));module['exports']=function(_0x1598a7,_0x11f6d6){return _0x1598a7['define']('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdab2=['ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0xf31df4,_0x502718){var _0xb79fc=function(_0x237593){while(--_0x237593){_0xf31df4['push'](_0xf31df4['shift']());}};_0xb79fc(++_0x502718);}(_0xdab2,0x188));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2dab('0x0'));var util=require(_0x2dab('0x1'));var logger=require(_0x2dab('0x2'))(_0x2dab('0x3'));var moment=require(_0x2dab('0x4'));var BPromise=require(_0x2dab('0x5'));var rp=require(_0x2dab('0x6'));var fs=require('fs');var path=require(_0x2dab('0x7'));var rimraf=require(_0x2dab('0x8'));var config=require(_0x2dab('0x9'));var attributes=require(_0x2dab('0xa'));module[_0x2dab('0xb')]=function(_0x4c4802,_0x9cafa7){return _0x4c4802[_0x2dab('0xc')](_0x2dab('0xd'),attributes,{'tableName':_0x2dab('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 3c92e24..ecedcfb 100644 --- a/server/api/chatQueue/chatQueue.rpc.js +++ b/server/api/chatQueue/chatQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bc7=['ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','findAll','options','where','attributes','limit','include','map','model','then','ShowChatQueue','ChatQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatQueue.socket','register','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2ba96b,_0x3bcefd){var _0x4b7d33=function(_0x3379b7){while(--_0x3379b7){_0x2ba96b['push'](_0x2ba96b['shift']());}};_0x4b7d33(++_0x3bcefd);}(_0x9bc7,0x1cd));var _0x79bc=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9bc7[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x79bc('0x0'));var util=require(_0x79bc('0x1'));var moment=require(_0x79bc('0x2'));var BPromise=require(_0x79bc('0x3'));var rs=require(_0x79bc('0x4'));var fs=require('fs');var Redis=require(_0x79bc('0x5'));var db=require(_0x79bc('0x6'))['db'];var utils=require(_0x79bc('0x7'));var logger=require(_0x79bc('0x8'))(_0x79bc('0x9'));var config=require('../../config/environment');var jayson=require(_0x79bc('0xa'));var client=jayson[_0x79bc('0xb')][_0x79bc('0xc')]({'port':0x232a});config['redis']=_[_0x79bc('0xd')](config['redis'],{'host':_0x79bc('0xe'),'port':0x18eb});var socket=require(_0x79bc('0xf'))(new Redis(config[_0x79bc('0x10')]));require(_0x79bc('0x11'))[_0x79bc('0x12')](socket);function respondWithRpcPromise(_0x5046ba,_0x2513e5,_0x500abb){return new BPromise(function(_0x217077,_0x3c5c73){return client['request'](_0x5046ba,_0x500abb)['then'](function(_0xc6122d){logger[_0x79bc('0x13')](_0x79bc('0x14'),_0x2513e5,_0x79bc('0x15'));logger[_0x79bc('0x16')](_0x79bc('0x17'),_0x2513e5,_0x79bc('0x15'),JSON[_0x79bc('0x18')](_0xc6122d));if(_0xc6122d['error']){if(_0xc6122d[_0x79bc('0x19')][_0x79bc('0x1a')]===0x1f4){logger[_0x79bc('0x19')](_0x79bc('0x14'),_0x2513e5,_0xc6122d[_0x79bc('0x19')][_0x79bc('0x1b')]);return _0x3c5c73(_0xc6122d['error'][_0x79bc('0x1b')]);}logger[_0x79bc('0x19')]('ChatQueue,\x20%s,\x20%s',_0x2513e5,_0xc6122d[_0x79bc('0x19')]['message']);return _0x217077(_0xc6122d[_0x79bc('0x19')][_0x79bc('0x1b')]);}else{logger['info'](_0x79bc('0x14'),_0x2513e5,_0x79bc('0x15'));_0x217077(_0xc6122d[_0x79bc('0x1c')][_0x79bc('0x1b')]);}})[_0x79bc('0x1d')](function(_0x5a2129){logger[_0x79bc('0x19')](_0x79bc('0x14'),_0x2513e5,_0x5a2129);_0x3c5c73(_0x5a2129);});});}exports[_0x79bc('0x1e')]=function(_0x269d07){var _0x5686f6=this;return new Promise(function(_0x3067f4,_0x52a423){return db['ChatQueue'][_0x79bc('0x1f')]({'raw':_0x269d07[_0x79bc('0x20')]?_0x269d07[_0x79bc('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x269d07[_0x79bc('0x20')]?_0x269d07[_0x79bc('0x20')][_0x79bc('0x21')]||null:null,'attributes':_0x269d07[_0x79bc('0x20')]?_0x269d07[_0x79bc('0x20')][_0x79bc('0x22')]||null:null,'limit':_0x269d07['options']?_0x269d07['options'][_0x79bc('0x23')]||null:null,'include':_0x269d07[_0x79bc('0x20')]?_0x269d07[_0x79bc('0x20')][_0x79bc('0x24')]?_[_0x79bc('0x25')](_0x269d07[_0x79bc('0x20')][_0x79bc('0x24')],function(_0x38f667){return{'model':db[_0x38f667[_0x79bc('0x26')]],'as':_0x38f667['as'],'attributes':_0x38f667[_0x79bc('0x22')],'include':_0x38f667[_0x79bc('0x24')]?_[_0x79bc('0x25')](_0x38f667['include'],function(_0x4b3eb9){return{'model':db[_0x4b3eb9[_0x79bc('0x26')]],'as':_0x4b3eb9['as'],'attributes':_0x4b3eb9[_0x79bc('0x22')],'include':_0x4b3eb9['include']?_[_0x79bc('0x25')](_0x4b3eb9[_0x79bc('0x24')],function(_0x48584b){return{'model':db[_0x48584b['model']],'as':_0x48584b['as'],'attributes':_0x48584b['attributes']};}):[]};}):[]};}):[]:[]})[_0x79bc('0x27')](function(_0xe7fe10){logger[_0x79bc('0x13')]('GetChatQueue',_0x269d07);logger[_0x79bc('0x16')](_0x79bc('0x1e'),_0x269d07,JSON['stringify'](_0xe7fe10));_0x3067f4(_0xe7fe10);})['catch'](function(_0x2da9bc){logger['error'](_0x79bc('0x1e'),_0x2da9bc[_0x79bc('0x1b')],_0x269d07);_0x52a423(_0x5686f6[_0x79bc('0x19')](0x1f4,_0x2da9bc['message']));});});};exports[_0x79bc('0x28')]=function(_0x4d70d1){var _0x17808c=this;return new Promise(function(_0x265901,_0x1587fb){return db[_0x79bc('0x29')][_0x79bc('0x2a')]({'raw':_0x4d70d1['options']?_0x4d70d1[_0x79bc('0x20')][_0x79bc('0x2b')]===undefined?!![]:![]:!![],'where':_0x4d70d1[_0x79bc('0x20')]?_0x4d70d1[_0x79bc('0x20')]['where']||null:null,'attributes':_0x4d70d1[_0x79bc('0x20')]?_0x4d70d1[_0x79bc('0x20')]['attributes']||null:null,'include':_0x4d70d1[_0x79bc('0x20')]?_0x4d70d1[_0x79bc('0x20')][_0x79bc('0x24')]?_['map'](_0x4d70d1[_0x79bc('0x20')][_0x79bc('0x24')],function(_0x3209d2){return{'model':db[_0x3209d2['model']],'as':_0x3209d2['as'],'attributes':_0x3209d2[_0x79bc('0x22')],'include':_0x3209d2['include']?_['map'](_0x3209d2[_0x79bc('0x24')],function(_0x47c36d){return{'model':db[_0x47c36d[_0x79bc('0x26')]],'as':_0x47c36d['as'],'attributes':_0x47c36d[_0x79bc('0x22')],'include':_0x47c36d[_0x79bc('0x24')]?_[_0x79bc('0x25')](_0x47c36d[_0x79bc('0x24')],function(_0x4972d9){return{'model':db[_0x4972d9['model']],'as':_0x4972d9['as'],'attributes':_0x4972d9['attributes']};}):[]};}):[]};}):[]:[]})[_0x79bc('0x27')](function(_0x45d5a6){logger[_0x79bc('0x13')]('ShowChatQueue',_0x4d70d1);logger[_0x79bc('0x16')]('ShowChatQueue',_0x4d70d1,JSON['stringify'](_0x45d5a6));_0x265901(_0x45d5a6);})[_0x79bc('0x1d')](function(_0x413edb){logger[_0x79bc('0x19')](_0x79bc('0x28'),_0x413edb[_0x79bc('0x1b')],_0x4d70d1);_0x1587fb(_0x17808c[_0x79bc('0x19')](0x1f4,_0x413edb[_0x79bc('0x1b')]));});});}; \ No newline at end of file +var _0x62ff=['map','model','then','ShowChatQueue','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','attributes','limit','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x62ff,0x1e5));var _0xf62f=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x62ff[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xf62f('0x0'));var util=require(_0xf62f('0x1'));var moment=require('moment');var BPromise=require(_0xf62f('0x2'));var rs=require(_0xf62f('0x3'));var fs=require('fs');var Redis=require(_0xf62f('0x4'));var db=require(_0xf62f('0x5'))['db'];var utils=require(_0xf62f('0x6'));var logger=require(_0xf62f('0x7'))(_0xf62f('0x8'));var config=require('../../config/environment');var jayson=require(_0xf62f('0x9'));var client=jayson[_0xf62f('0xa')][_0xf62f('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf62f('0xc')],{'host':_0xf62f('0xd'),'port':0x18eb});var socket=require(_0xf62f('0xe'))(new Redis(config[_0xf62f('0xc')]));require(_0xf62f('0xf'))[_0xf62f('0x10')](socket);function respondWithRpcPromise(_0x5c10ee,_0x1ca783,_0x52624a){return new BPromise(function(_0x6e5ead,_0x226349){return client['request'](_0x5c10ee,_0x52624a)['then'](function(_0x3da720){logger[_0xf62f('0x11')](_0xf62f('0x12'),_0x1ca783,_0xf62f('0x13'));logger[_0xf62f('0x14')](_0xf62f('0x15'),_0x1ca783,_0xf62f('0x13'),JSON[_0xf62f('0x16')](_0x3da720));if(_0x3da720[_0xf62f('0x17')]){if(_0x3da720['error'][_0xf62f('0x18')]===0x1f4){logger[_0xf62f('0x17')](_0xf62f('0x12'),_0x1ca783,_0x3da720[_0xf62f('0x17')]['message']);return _0x226349(_0x3da720['error']['message']);}logger[_0xf62f('0x17')]('ChatQueue,\x20%s,\x20%s',_0x1ca783,_0x3da720[_0xf62f('0x17')][_0xf62f('0x19')]);return _0x6e5ead(_0x3da720[_0xf62f('0x17')][_0xf62f('0x19')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x1ca783,_0xf62f('0x13'));_0x6e5ead(_0x3da720[_0xf62f('0x1a')]['message']);}})[_0xf62f('0x1b')](function(_0x20255a){logger[_0xf62f('0x17')](_0xf62f('0x12'),_0x1ca783,_0x20255a);_0x226349(_0x20255a);});});}exports[_0xf62f('0x1c')]=function(_0x233009){var _0x334c48=this;return new Promise(function(_0x6e3326,_0x2f8a91){return db[_0xf62f('0x1d')][_0xf62f('0x1e')]({'raw':_0x233009['options']?_0x233009['options']['raw']===undefined?!![]:![]:!![],'where':_0x233009[_0xf62f('0x1f')]?_0x233009[_0xf62f('0x1f')]['where']||null:null,'attributes':_0x233009[_0xf62f('0x1f')]?_0x233009[_0xf62f('0x1f')][_0xf62f('0x20')]||null:null,'limit':_0x233009[_0xf62f('0x1f')]?_0x233009['options'][_0xf62f('0x21')]||null:null,'include':_0x233009['options']?_0x233009['options'][_0xf62f('0x22')]?_['map'](_0x233009['options'][_0xf62f('0x22')],function(_0x1fa792){return{'model':db[_0x1fa792['model']],'as':_0x1fa792['as'],'attributes':_0x1fa792['attributes'],'include':_0x1fa792['include']?_[_0xf62f('0x23')](_0x1fa792['include'],function(_0x3c8d64){return{'model':db[_0x3c8d64[_0xf62f('0x24')]],'as':_0x3c8d64['as'],'attributes':_0x3c8d64[_0xf62f('0x20')],'include':_0x3c8d64[_0xf62f('0x22')]?_[_0xf62f('0x23')](_0x3c8d64[_0xf62f('0x22')],function(_0x23dec6){return{'model':db[_0x23dec6[_0xf62f('0x24')]],'as':_0x23dec6['as'],'attributes':_0x23dec6[_0xf62f('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf62f('0x25')](function(_0x1b2f33){logger[_0xf62f('0x11')](_0xf62f('0x1c'),_0x233009);logger[_0xf62f('0x14')]('GetChatQueue',_0x233009,JSON[_0xf62f('0x16')](_0x1b2f33));_0x6e3326(_0x1b2f33);})[_0xf62f('0x1b')](function(_0x2020dc){logger[_0xf62f('0x17')]('GetChatQueue',_0x2020dc[_0xf62f('0x19')],_0x233009);_0x2f8a91(_0x334c48[_0xf62f('0x17')](0x1f4,_0x2020dc[_0xf62f('0x19')]));});});};exports[_0xf62f('0x26')]=function(_0x529d6b){var _0x567da2=this;return new Promise(function(_0xd7e5b8,_0x10e00f){return db[_0xf62f('0x1d')]['find']({'raw':_0x529d6b['options']?_0x529d6b[_0xf62f('0x1f')][_0xf62f('0x27')]===undefined?!![]:![]:!![],'where':_0x529d6b[_0xf62f('0x1f')]?_0x529d6b['options']['where']||null:null,'attributes':_0x529d6b[_0xf62f('0x1f')]?_0x529d6b[_0xf62f('0x1f')]['attributes']||null:null,'include':_0x529d6b[_0xf62f('0x1f')]?_0x529d6b[_0xf62f('0x1f')][_0xf62f('0x22')]?_[_0xf62f('0x23')](_0x529d6b[_0xf62f('0x1f')][_0xf62f('0x22')],function(_0x4ed9ee){return{'model':db[_0x4ed9ee[_0xf62f('0x24')]],'as':_0x4ed9ee['as'],'attributes':_0x4ed9ee[_0xf62f('0x20')],'include':_0x4ed9ee[_0xf62f('0x22')]?_[_0xf62f('0x23')](_0x4ed9ee['include'],function(_0x36fb4c){return{'model':db[_0x36fb4c[_0xf62f('0x24')]],'as':_0x36fb4c['as'],'attributes':_0x36fb4c[_0xf62f('0x20')],'include':_0x36fb4c[_0xf62f('0x22')]?_[_0xf62f('0x23')](_0x36fb4c[_0xf62f('0x22')],function(_0x4c6e5e){return{'model':db[_0x4c6e5e[_0xf62f('0x24')]],'as':_0x4c6e5e['as'],'attributes':_0x4c6e5e[_0xf62f('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf62f('0x25')](function(_0x11cdcf){logger[_0xf62f('0x11')](_0xf62f('0x26'),_0x529d6b);logger['debug']('ShowChatQueue',_0x529d6b,JSON[_0xf62f('0x16')](_0x11cdcf));_0xd7e5b8(_0x11cdcf);})[_0xf62f('0x1b')](function(_0x5d3649){logger[_0xf62f('0x17')](_0xf62f('0x26'),_0x5d3649[_0xf62f('0x19')],_0x529d6b);_0x10e00f(_0x567da2[_0xf62f('0x17')](0x1f4,_0x5d3649[_0xf62f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 6498a32..175df7e 100644 --- a/server/api/chatQueue/chatQueue.socket.js +++ b/server/api/chatQueue/chatQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['remove','emit','removeListener','length','./chatQueue.events','save'];(function(_0x4d6bce,_0x62fd0e){var _0x287399=function(_0x37bf32){while(--_0x37bf32){_0x4d6bce['push'](_0x4d6bce['shift']());}};_0x287399(++_0x62fd0e);}(_0x54ef,0x112));var _0xf54e=function(_0x1bb786,_0x22b392){_0x1bb786=_0x1bb786-0x0;var _0x21263f=_0x54ef[_0x1bb786];return _0x21263f;};'use strict';var ChatQueueEvents=require(_0xf54e('0x0'));var events=[_0xf54e('0x1'),_0xf54e('0x2'),'update'];function createListener(_0xd936f7,_0x18b7d6){return function(_0x18b1cf){_0x18b7d6[_0xf54e('0x3')](_0xd936f7,_0x18b1cf);};}function removeListener(_0x8b6bb6,_0x431e36){return function(){ChatQueueEvents[_0xf54e('0x4')](_0x8b6bb6,_0x431e36);};}exports['register']=function(_0x55e611){for(var _0x18e84e=0x0,_0x99cf9=events[_0xf54e('0x5')];_0x18e84e<_0x99cf9;_0x18e84e++){var _0x561870=events[_0x18e84e];var _0x27e69b=createListener('chatQueue:'+_0x561870,_0x55e611);ChatQueueEvents['on'](_0x561870,_0x27e69b);}}; \ No newline at end of file +var _0x00bb=['removeListener','length','chatQueue:','./chatQueue.events','save','remove','emit'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x00bb,0x1d8));var _0xb00b=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x00bb[_0xb0f7c3];return _0x28ea68;};'use strict';var ChatQueueEvents=require(_0xb00b('0x0'));var events=[_0xb00b('0x1'),_0xb00b('0x2'),'update'];function createListener(_0x170f94,_0x47a3bf){return function(_0x278c5e){_0x47a3bf[_0xb00b('0x3')](_0x170f94,_0x278c5e);};}function removeListener(_0x582ef9,_0x14b5d0){return function(){ChatQueueEvents[_0xb00b('0x4')](_0x582ef9,_0x14b5d0);};}exports['register']=function(_0x574cf8){for(var _0x532ffb=0x0,_0x36e363=events[_0xb00b('0x5')];_0x532ffb<_0x36e363;_0x532ffb++){var _0x41dfc9=events[_0x532ffb];var _0x37f07d=createListener(_0xb00b('0x6')+_0x41dfc9,_0x574cf8);ChatQueueEvents['on'](_0x41dfc9,_0x37f07d);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index fbdcdb1..f2d4cfd 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x501b84,_0x2e173f){var _0x34f5b5=function(_0x499a09){while(--_0x499a09){_0x501b84['push'](_0x501b84['shift']());}};_0x34f5b5(++_0x2e173f);}(_0x814b,0x1a2));var _0xb814=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x814b[_0x1ae5ab];return _0x1ce001;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x5fc3[_0x2dea24];return _0x309d58;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 3ac675a..3380d97 100644 --- a/server/api/chatQueueReport/chatQueueReport.attributes.js +++ b/server/api/chatQueueReport/chatQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4b6=['DATE','sequelize','exports','STRING'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xf4b6,0x85));var _0x6f4b=function(_0x1c7136,_0x4bb9c4){_0x1c7136=_0x1c7136-0x0;var _0x401f8c=_0xf4b6[_0x1c7136];return _0x401f8c;};'use strict';var moment=require('moment');var Sequelize=require(_0x6f4b('0x0'));module[_0x6f4b('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x6f4b('0x2')]},'joinAt':{'type':Sequelize[_0x6f4b('0x3')]},'leaveAt':{'type':Sequelize[_0x6f4b('0x3')]},'acceptAt':{'type':Sequelize[_0x6f4b('0x3')]},'exitAt':{'type':Sequelize[_0x6f4b('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6865=['exports','STRING','DATE','sequelize'];(function(_0x1f932c,_0x661d29){var _0x5cd7e4=function(_0x45d726){while(--_0x45d726){_0x1f932c['push'](_0x1f932c['shift']());}};_0x5cd7e4(++_0x661d29);}(_0x6865,0x17f));var _0x5686=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6865[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var Sequelize=require(_0x5686('0x0'));module[_0x5686('0x1')]={'uniqueid':{'type':Sequelize[_0x5686('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5686('0x3')]},'acceptAt':{'type':Sequelize[_0x5686('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x5686('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index a0dbe24..c6f0daf 100644 --- a/server/api/chatQueueReport/chatQueueReport.controller.js +++ b/server/api/chatQueueReport/chatQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafc4=['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','ChatQueueReport','includeAll','catch','show','params','create','body','find','describe','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','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x626517,_0x45895d){var _0x12d579=function(_0x130787){while(--_0x130787){_0x626517['push'](_0x626517['shift']());}};_0x12d579(++_0x45895d);}(_0xafc4,0x69));var _0x4afc=function(_0x3e79ea,_0x3367ab){_0x3e79ea=_0x3e79ea-0x0;var _0x318d9e=_0xafc4[_0x3e79ea];return _0x318d9e;};'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['ChatQueueReport'][_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['ChatQueueReport']['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['ChatQueueReport']['create'](_0x4772db['body'],{})[_0x4afc('0x25')](respondWithResult(_0x19a0ac,0xc9))[_0x4afc('0x3f')](handleError(_0x19a0ac,null));};exports[_0x4afc('0x23')]=function(_0x269c24,_0xb5cca9){if(_0x269c24[_0x4afc('0x43')]['id']){delete _0x269c24[_0x4afc('0x43')]['id'];}return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x269c24[_0x4afc('0x41')]['id']}})['then'](handleEntityNotFound(_0xb5cca9,null))[_0x4afc('0x25')](saveUpdates(_0x269c24['body'],null))['then'](respondWithResult(_0xb5cca9,null))[_0x4afc('0x3f')](handleError(_0xb5cca9,null));};exports['destroy']=function(_0x428d78,_0x355198){return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x428d78['params']['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x355198,null))['then'](removeEntity(_0x355198,null))[_0x4afc('0x3f')](handleError(_0x355198,null));};exports[_0x4afc('0x45')]=function(_0x3625c9,_0x387834){return db[_0x4afc('0x3d')][_0x4afc('0x45')]()[_0x4afc('0x25')](respondWithResult(_0x387834,null))[_0x4afc('0x3f')](handleError(_0x387834,null));}; \ No newline at end of file +var _0x9e69=['ChatQueueReport','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map'];(function(_0x1269c6,_0x1c8942){var _0x4868c7=function(_0x1661bc){while(--_0x1661bc){_0x1269c6['push'](_0x1269c6['shift']());}};_0x4868c7(++_0x1c8942);}(_0x9e69,0x150));var _0x99e6=function(_0x5f0789,_0x487895){_0x5f0789=_0x5f0789-0x0;var _0xb30640=_0x9e69[_0x5f0789];return _0xb30640;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x99e6('0x0'));var zipdir=require(_0x99e6('0x1'));var jsonpatch=require(_0x99e6('0x2'));var rp=require(_0x99e6('0x3'));var moment=require('moment');var BPromise=require(_0x99e6('0x4'));var Mustache=require(_0x99e6('0x5'));var util=require('util');var path=require(_0x99e6('0x6'));var sox=require(_0x99e6('0x7'));var csv=require(_0x99e6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99e6('0x9'));var _=require(_0x99e6('0xa'));var squel=require(_0x99e6('0xb'));var crypto=require('crypto');var jsforce=require(_0x99e6('0xc'));var deskjs=require(_0x99e6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x99e6('0xe'));var Papa=require(_0x99e6('0xf'));var Redis=require('ioredis');var authService=require(_0x99e6('0x10'));var qs=require(_0x99e6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x99e6('0x12'))(_0x99e6('0x13'));var utils=require(_0x99e6('0x14'));var config=require(_0x99e6('0x15'));var licenseUtil=require(_0x99e6('0x16'));var db=require(_0x99e6('0x17'))['db'];function respondWithStatusCode(_0x51de85,_0x13a62b){_0x13a62b=_0x13a62b||0xcc;return function(_0x4033c5){if(_0x4033c5){return _0x51de85[_0x99e6('0x18')](_0x13a62b);}return _0x51de85['status'](_0x13a62b)[_0x99e6('0x19')]();};}function respondWithResult(_0x4061b2,_0x2cf6a4){_0x2cf6a4=_0x2cf6a4||0xc8;return function(_0x57111c){if(_0x57111c){return _0x4061b2['status'](_0x2cf6a4)['json'](_0x57111c);}};}function respondWithFilteredResult(_0x40fdb8,_0x4741c9){return function(_0x1d910a){if(_0x1d910a){var _0x5d5cd5=typeof _0x4741c9[_0x99e6('0x1a')]===_0x99e6('0x1b')&&typeof _0x4741c9[_0x99e6('0x1c')]===_0x99e6('0x1b');var _0x3a302d=_0x1d910a['count'];var _0x2e9e24=_0x5d5cd5?0x0:_0x4741c9['offset'];var _0x2749bf=_0x5d5cd5?_0x1d910a[_0x99e6('0x1d')]:_0x4741c9['offset']+_0x4741c9[_0x99e6('0x1c')];var _0x3c4cc8;if(_0x2749bf>=_0x3a302d){_0x2749bf=_0x3a302d;_0x3c4cc8=0xc8;}else{_0x3c4cc8=0xce;}_0x40fdb8[_0x99e6('0x1e')](_0x3c4cc8);return _0x40fdb8[_0x99e6('0x1f')](_0x99e6('0x20'),_0x2e9e24+'-'+_0x2749bf+'/'+_0x3a302d)[_0x99e6('0x21')](_0x1d910a);}return null;};}function patchUpdates(_0x41a32b){return function(_0x95a8e5){try{jsonpatch[_0x99e6('0x22')](_0x95a8e5,_0x41a32b,!![]);}catch(_0xef736c){return BPromise['reject'](_0xef736c);}return _0x95a8e5[_0x99e6('0x23')]();};}function saveUpdates(_0xef9c63,_0x16f05d){return function(_0x249872){if(_0x249872){return _0x249872[_0x99e6('0x24')](_0xef9c63)[_0x99e6('0x25')](function(_0x2a308f){return _0x2a308f;});}return null;};}function removeEntity(_0xa0b949,_0x2033af){return function(_0x1b4339){if(_0x1b4339){return _0x1b4339[_0x99e6('0x26')]()[_0x99e6('0x25')](function(){_0xa0b949[_0x99e6('0x1e')](0xcc)[_0x99e6('0x19')]();});}};}function handleEntityNotFound(_0x210b02,_0x19d2f1){return function(_0x17bc07){if(!_0x17bc07){_0x210b02['sendStatus'](0x194);}return _0x17bc07;};}function handleError(_0x43038d,_0x5390b3){_0x5390b3=_0x5390b3||0x1f4;return function(_0x30b956){logger[_0x99e6('0x27')](_0x30b956[_0x99e6('0x28')]);if(_0x30b956['name']){delete _0x30b956[_0x99e6('0x29')];}_0x43038d['status'](_0x5390b3)[_0x99e6('0x2a')](_0x30b956);};}exports['index']=function(_0x39ca5d,_0x46343f){var _0x4b58c7={},_0x4d6b19={},_0x2c9b92={'count':0x0,'rows':[]};var _0x350fa0=_[_0x99e6('0x2b')](db[_0x99e6('0x2c')][_0x99e6('0x2d')],function(_0x4b92af){return{'name':_0x4b92af[_0x99e6('0x2e')],'type':_0x4b92af[_0x99e6('0x2f')][_0x99e6('0x30')]};});_0x4d6b19['model']=_['map'](_0x350fa0,_0x99e6('0x29'));_0x4d6b19['query']=_['keys'](_0x39ca5d[_0x99e6('0x31')]);_0x4d6b19['filters']=_[_0x99e6('0x32')](_0x4d6b19[_0x99e6('0x33')],_0x4d6b19[_0x99e6('0x31')]);_0x4b58c7['attributes']=_[_0x99e6('0x32')](_0x4d6b19[_0x99e6('0x33')],qs[_0x99e6('0x34')](_0x39ca5d[_0x99e6('0x31')]['fields']));_0x4b58c7[_0x99e6('0x35')]=_0x4b58c7[_0x99e6('0x35')][_0x99e6('0x36')]?_0x4b58c7[_0x99e6('0x35')]:_0x4d6b19[_0x99e6('0x33')];if(!_0x39ca5d[_0x99e6('0x31')]['hasOwnProperty'](_0x99e6('0x37'))){_0x4b58c7['limit']=qs['limit'](_0x39ca5d['query'][_0x99e6('0x1c')]);_0x4b58c7[_0x99e6('0x1a')]=qs['offset'](_0x39ca5d[_0x99e6('0x31')][_0x99e6('0x1a')]);}_0x4b58c7[_0x99e6('0x38')]=qs[_0x99e6('0x39')](_0x39ca5d[_0x99e6('0x31')][_0x99e6('0x39')]);_0x4b58c7['where']=qs[_0x99e6('0x3a')](_[_0x99e6('0x3b')](_0x39ca5d[_0x99e6('0x31')],_0x4d6b19[_0x99e6('0x3a')]),_0x350fa0);if(_0x39ca5d['query'][_0x99e6('0x3c')]){_0x4b58c7[_0x99e6('0x3d')]=_[_0x99e6('0x3e')](_0x4b58c7[_0x99e6('0x3d')],{'$or':_[_0x99e6('0x2b')](_0x350fa0,function(_0x2fc6e5){if(_0x2fc6e5[_0x99e6('0x2f')]!=='VIRTUAL'){var _0x4b888c={};_0x4b888c[_0x2fc6e5['name']]={'$like':'%'+_0x39ca5d[_0x99e6('0x31')][_0x99e6('0x3c')]+'%'};return _0x4b888c;}})});}_0x4b58c7=_['merge']({},_0x4b58c7,_0x39ca5d[_0x99e6('0x3f')]);var _0x2975d8={'where':_0x4b58c7[_0x99e6('0x3d')]};return db[_0x99e6('0x2c')][_0x99e6('0x1d')](_0x2975d8)[_0x99e6('0x25')](function(_0x26cade){_0x2c9b92[_0x99e6('0x1d')]=_0x26cade;if(_0x39ca5d[_0x99e6('0x31')][_0x99e6('0x40')]){_0x4b58c7[_0x99e6('0x41')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x99e6('0x42')](_0x4b58c7);})[_0x99e6('0x25')](function(_0x13ee61){_0x2c9b92[_0x99e6('0x43')]=_0x13ee61;return _0x2c9b92;})[_0x99e6('0x25')](respondWithFilteredResult(_0x46343f,_0x4b58c7))[_0x99e6('0x44')](handleError(_0x46343f,null));};exports[_0x99e6('0x45')]=function(_0x34991f,_0x2f5b4f){var _0x534f05={'raw':!![],'where':{'id':_0x34991f['params']['id']}},_0x562921={};_0x562921['model']=_['keys'](db[_0x99e6('0x2c')][_0x99e6('0x2d')]);_0x562921['query']=_[_0x99e6('0x46')](_0x34991f[_0x99e6('0x31')]);_0x562921[_0x99e6('0x3a')]=_[_0x99e6('0x32')](_0x562921[_0x99e6('0x33')],_0x562921[_0x99e6('0x31')]);_0x534f05['attributes']=_[_0x99e6('0x32')](_0x562921[_0x99e6('0x33')],qs[_0x99e6('0x34')](_0x34991f[_0x99e6('0x31')][_0x99e6('0x34')]));_0x534f05[_0x99e6('0x35')]=_0x534f05[_0x99e6('0x35')][_0x99e6('0x36')]?_0x534f05[_0x99e6('0x35')]:_0x562921[_0x99e6('0x33')];if(_0x34991f[_0x99e6('0x31')][_0x99e6('0x40')]){_0x534f05[_0x99e6('0x41')]=[{'all':!![]}];}_0x534f05=_[_0x99e6('0x3e')]({},_0x534f05,_0x34991f['options']);return db['ChatQueueReport']['find'](_0x534f05)['then'](handleEntityNotFound(_0x2f5b4f,null))[_0x99e6('0x25')](respondWithResult(_0x2f5b4f,null))[_0x99e6('0x44')](handleError(_0x2f5b4f,null));};exports[_0x99e6('0x47')]=function(_0x10d693,_0x2c071f){return db['ChatQueueReport']['create'](_0x10d693[_0x99e6('0x48')],{})[_0x99e6('0x25')](respondWithResult(_0x2c071f,0xc9))['catch'](handleError(_0x2c071f,null));};exports['update']=function(_0x10a08e,_0x437bf2){if(_0x10a08e['body']['id']){delete _0x10a08e[_0x99e6('0x48')]['id'];}return db['ChatQueueReport'][_0x99e6('0x49')]({'where':{'id':_0x10a08e[_0x99e6('0x4a')]['id']}})[_0x99e6('0x25')](handleEntityNotFound(_0x437bf2,null))['then'](saveUpdates(_0x10a08e[_0x99e6('0x48')],null))[_0x99e6('0x25')](respondWithResult(_0x437bf2,null))['catch'](handleError(_0x437bf2,null));};exports[_0x99e6('0x26')]=function(_0x202159,_0x35973e){return db['ChatQueueReport']['find']({'where':{'id':_0x202159[_0x99e6('0x4a')]['id']}})[_0x99e6('0x25')](handleEntityNotFound(_0x35973e,null))['then'](removeEntity(_0x35973e,null))[_0x99e6('0x44')](handleError(_0x35973e,null));};exports[_0x99e6('0x4b')]=function(_0x20d286,_0x40de95){return db[_0x99e6('0x2c')][_0x99e6('0x4b')]()[_0x99e6('0x25')](respondWithResult(_0x40de95,null))['catch'](handleError(_0x40de95,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 6de28f2..04395f5 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x542fa7,_0x4d89ef){var _0xbc8fa6=function(_0x4afb38){while(--_0x4afb38){_0x542fa7['push'](_0x542fa7['shift']());}};_0xbc8fa6(++_0x4d89ef);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0xb7e7[_0x1e3c16];return _0x47a0c9;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 6b92934..98c2fbc 100644 --- a/server/api/chatQueueReport/chatQueueReport.rpc.js +++ b/server/api/chatQueueReport/chatQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe157=['body','options','raw','UpdateChatQueueReport','update','where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueueReport,\x20%s,\x20%s','CreateChatQueueReport','ChatQueueReport','create'];(function(_0x970068,_0x3e4142){var _0x51063d=function(_0x32b30e){while(--_0x32b30e){_0x970068['push'](_0x970068['shift']());}};_0x51063d(++_0x3e4142);}(_0xe157,0x1f2));var _0x7e15=function(_0x1fa478,_0x95b11c){_0x1fa478=_0x1fa478-0x0;var _0x566766=_0xe157[_0x1fa478];return _0x566766;};'use strict';var _=require('lodash');var util=require(_0x7e15('0x0'));var moment=require(_0x7e15('0x1'));var BPromise=require(_0x7e15('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e15('0x3'));var db=require(_0x7e15('0x4'))['db'];var utils=require(_0x7e15('0x5'));var logger=require(_0x7e15('0x6'))(_0x7e15('0x7'));var config=require(_0x7e15('0x8'));var jayson=require(_0x7e15('0x9'));var client=jayson[_0x7e15('0xa')][_0x7e15('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3461bd,_0x3f2f12,_0x3bb872){return new BPromise(function(_0x3273a3,_0x16c62b){return client['request'](_0x3461bd,_0x3bb872)[_0x7e15('0xc')](function(_0x2b3a6c){logger[_0x7e15('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x3f2f12,_0x7e15('0xe'));logger[_0x7e15('0xf')](_0x7e15('0x10'),_0x3f2f12,_0x7e15('0xe'),JSON[_0x7e15('0x11')](_0x2b3a6c));if(_0x2b3a6c[_0x7e15('0x12')]){if(_0x2b3a6c[_0x7e15('0x12')][_0x7e15('0x13')]===0x1f4){logger[_0x7e15('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x3f2f12,_0x2b3a6c[_0x7e15('0x12')][_0x7e15('0x14')]);return _0x16c62b(_0x2b3a6c['error']['message']);}logger[_0x7e15('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x3f2f12,_0x2b3a6c[_0x7e15('0x12')][_0x7e15('0x14')]);return _0x3273a3(_0x2b3a6c[_0x7e15('0x12')][_0x7e15('0x14')]);}else{logger[_0x7e15('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x3f2f12,_0x7e15('0xe'));_0x3273a3(_0x2b3a6c[_0x7e15('0x15')][_0x7e15('0x14')]);}})[_0x7e15('0x16')](function(_0x561999){logger['error'](_0x7e15('0x17'),_0x3f2f12,_0x561999);_0x16c62b(_0x561999);});});}exports[_0x7e15('0x18')]=function(_0x4ca9cc){var _0x332338=this;return new Promise(function(_0x3b40a9,_0x35f48d){return db[_0x7e15('0x19')][_0x7e15('0x1a')](_0x4ca9cc[_0x7e15('0x1b')],{'raw':_0x4ca9cc['options']?_0x4ca9cc[_0x7e15('0x1c')][_0x7e15('0x1d')]===undefined?!![]:![]:!![]})[_0x7e15('0xc')](function(_0x427e26){logger['info'](_0x7e15('0x18'),_0x4ca9cc);logger[_0x7e15('0xf')](_0x7e15('0x18'),_0x4ca9cc,JSON[_0x7e15('0x11')](_0x427e26));_0x3b40a9(_0x427e26);})[_0x7e15('0x16')](function(_0x166f91){logger[_0x7e15('0x12')](_0x7e15('0x18'),_0x166f91[_0x7e15('0x14')],_0x4ca9cc);_0x35f48d(_0x332338[_0x7e15('0x12')](0x1f4,_0x166f91[_0x7e15('0x14')]));});});};exports[_0x7e15('0x1e')]=function(_0x4215e5){var _0x1b2a67=this;return new Promise(function(_0x2aaacc,_0x544c9e){return db[_0x7e15('0x19')][_0x7e15('0x1f')](_0x4215e5['body'],{'raw':_0x4215e5[_0x7e15('0x1c')]?_0x4215e5[_0x7e15('0x1c')][_0x7e15('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4215e5['options']?_0x4215e5[_0x7e15('0x1c')][_0x7e15('0x20')]||null:null,'attributes':_0x4215e5[_0x7e15('0x1c')]?_0x4215e5[_0x7e15('0x1c')][_0x7e15('0x21')]||null:null,'limit':_0x4215e5[_0x7e15('0x1c')]?_0x4215e5['options'][_0x7e15('0x22')]||null:null})[_0x7e15('0xc')](function(_0x4528d5){logger[_0x7e15('0xd')](_0x7e15('0x1e'),_0x4215e5);logger[_0x7e15('0xf')](_0x7e15('0x1e'),_0x4215e5,JSON[_0x7e15('0x11')](_0x4528d5));_0x2aaacc(_0x4528d5);})[_0x7e15('0x16')](function(_0x1e23d5){logger[_0x7e15('0x12')](_0x7e15('0x1e'),_0x1e23d5[_0x7e15('0x14')],_0x4215e5);_0x544c9e(_0x1b2a67[_0x7e15('0x12')](0x1f4,_0x1e23d5[_0x7e15('0x14')]));});});}; \ No newline at end of file +var _0x2d50=['moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ChatQueueReport','create','body','options','raw','then','CreateChatQueueReport','debug','UpdateChatQueueReport','update','attributes','limit','lodash','util'];(function(_0x52bbc9,_0xb342e0){var _0x5909d0=function(_0x24370d){while(--_0x24370d){_0x52bbc9['push'](_0x52bbc9['shift']());}};_0x5909d0(++_0xb342e0);}(_0x2d50,0x106));var _0x02d5=function(_0x56d4f2,_0x3cc8bb){_0x56d4f2=_0x56d4f2-0x0;var _0x187f51=_0x2d50[_0x56d4f2];return _0x187f51;};'use strict';var _=require(_0x02d5('0x0'));var util=require(_0x02d5('0x1'));var moment=require(_0x02d5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02d5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x02d5('0x4'));var logger=require(_0x02d5('0x5'))(_0x02d5('0x6'));var config=require(_0x02d5('0x7'));var jayson=require(_0x02d5('0x8'));var client=jayson['client'][_0x02d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4065de,_0x3ad800,_0x93874d){return new BPromise(function(_0x4bd172,_0x45f7c7){return client[_0x02d5('0xa')](_0x4065de,_0x93874d)['then'](function(_0x4734d9){logger[_0x02d5('0xb')](_0x02d5('0xc'),_0x3ad800,'request\x20sent');logger['debug'](_0x02d5('0xd'),_0x3ad800,_0x02d5('0xe'),JSON[_0x02d5('0xf')](_0x4734d9));if(_0x4734d9['error']){if(_0x4734d9[_0x02d5('0x10')][_0x02d5('0x11')]===0x1f4){logger[_0x02d5('0x10')](_0x02d5('0xc'),_0x3ad800,_0x4734d9[_0x02d5('0x10')]['message']);return _0x45f7c7(_0x4734d9[_0x02d5('0x10')][_0x02d5('0x12')]);}logger['error'](_0x02d5('0xc'),_0x3ad800,_0x4734d9[_0x02d5('0x10')][_0x02d5('0x12')]);return _0x4bd172(_0x4734d9[_0x02d5('0x10')]['message']);}else{logger[_0x02d5('0xb')](_0x02d5('0xc'),_0x3ad800,_0x02d5('0xe'));_0x4bd172(_0x4734d9[_0x02d5('0x13')][_0x02d5('0x12')]);}})[_0x02d5('0x14')](function(_0x3aaf05){logger['error'](_0x02d5('0xc'),_0x3ad800,_0x3aaf05);_0x45f7c7(_0x3aaf05);});});}exports['CreateChatQueueReport']=function(_0x4ce9b1){var _0x58bdba=this;return new Promise(function(_0x22e65c,_0x1952bc){return db[_0x02d5('0x15')][_0x02d5('0x16')](_0x4ce9b1[_0x02d5('0x17')],{'raw':_0x4ce9b1[_0x02d5('0x18')]?_0x4ce9b1[_0x02d5('0x18')][_0x02d5('0x19')]===undefined?!![]:![]:!![]})[_0x02d5('0x1a')](function(_0x1f9657){logger[_0x02d5('0xb')](_0x02d5('0x1b'),_0x4ce9b1);logger[_0x02d5('0x1c')](_0x02d5('0x1b'),_0x4ce9b1,JSON['stringify'](_0x1f9657));_0x22e65c(_0x1f9657);})['catch'](function(_0x2e0bac){logger['error']('CreateChatQueueReport',_0x2e0bac[_0x02d5('0x12')],_0x4ce9b1);_0x1952bc(_0x58bdba[_0x02d5('0x10')](0x1f4,_0x2e0bac['message']));});});};exports[_0x02d5('0x1d')]=function(_0x164122){var _0x36b9cb=this;return new Promise(function(_0x527f9b,_0x390b13){return db[_0x02d5('0x15')][_0x02d5('0x1e')](_0x164122[_0x02d5('0x17')],{'raw':_0x164122[_0x02d5('0x18')]?_0x164122[_0x02d5('0x18')][_0x02d5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x164122[_0x02d5('0x18')]?_0x164122[_0x02d5('0x18')]['where']||null:null,'attributes':_0x164122[_0x02d5('0x18')]?_0x164122['options'][_0x02d5('0x1f')]||null:null,'limit':_0x164122[_0x02d5('0x18')]?_0x164122[_0x02d5('0x18')][_0x02d5('0x20')]||null:null})[_0x02d5('0x1a')](function(_0xfa6253){logger[_0x02d5('0xb')]('UpdateChatQueueReport',_0x164122);logger[_0x02d5('0x1c')](_0x02d5('0x1d'),_0x164122,JSON['stringify'](_0xfa6253));_0x527f9b(_0xfa6253);})[_0x02d5('0x14')](function(_0x2de7df){logger['error'](_0x02d5('0x1d'),_0x2de7df[_0x02d5('0x12')],_0x164122);_0x390b13(_0x36b9cb[_0x02d5('0x10')](0x1f4,_0x2de7df[_0x02d5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 500e98b..157bb79 100644 --- a/server/api/chatQueueReport/index.js +++ b/server/api/chatQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00a4=['isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get'];(function(_0x471b53,_0x4ddaec){var _0x3c8fe8=function(_0x2af33f){while(--_0x2af33f){_0x471b53['push'](_0x471b53['shift']());}};_0x3c8fe8(++_0x4ddaec);}(_0x00a4,0x1c4));var _0x400a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x00a4[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x400a('0x0'));var util=require(_0x400a('0x1'));var path=require('path');var timeout=require(_0x400a('0x2'));var express=require(_0x400a('0x3'));var router=express[_0x400a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x400a('0x5'));var interaction=require(_0x400a('0x6'));var config=require(_0x400a('0x7'));var controller=require(_0x400a('0x8'));router[_0x400a('0x9')]('/',auth[_0x400a('0xa')](),controller['index']);router[_0x400a('0x9')](_0x400a('0xb'),auth[_0x400a('0xa')](),controller[_0x400a('0xc')]);router[_0x400a('0x9')](_0x400a('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x400a('0xe')]('/',auth['isAuthenticated'](),controller[_0x400a('0xf')]);router[_0x400a('0x10')](_0x400a('0xd'),auth[_0x400a('0xa')](),controller[_0x400a('0x11')]);router[_0x400a('0x12')](_0x400a('0xd'),auth[_0x400a('0xa')](),controller[_0x400a('0x13')]);module[_0x400a('0x14')]=router; \ No newline at end of file +var _0xbefe=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','/:id','show','post'];(function(_0x39e46f,_0x2c9ba3){var _0x692df5=function(_0x4ae77a){while(--_0x4ae77a){_0x39e46f['push'](_0x39e46f['shift']());}};_0x692df5(++_0x2c9ba3);}(_0xbefe,0x156));var _0xebef=function(_0x35f154,_0x50c6e2){_0x35f154=_0x35f154-0x0;var _0x3302b6=_0xbefe[_0x35f154];return _0x3302b6;};'use strict';var multer=require(_0xebef('0x0'));var util=require('util');var path=require(_0xebef('0x1'));var timeout=require(_0xebef('0x2'));var express=require(_0xebef('0x3'));var router=express[_0xebef('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xebef('0x5'));var interaction=require(_0xebef('0x6'));var config=require(_0xebef('0x7'));var controller=require(_0xebef('0x8'));router[_0xebef('0x9')]('/',auth[_0xebef('0xa')](),controller['index']);router[_0xebef('0x9')](_0xebef('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xebef('0xc'),auth[_0xebef('0xa')](),controller[_0xebef('0xd')]);router[_0xebef('0xe')]('/',auth[_0xebef('0xa')](),controller[_0xebef('0xf')]);router[_0xebef('0x10')]('/:id',auth[_0xebef('0xa')](),controller[_0xebef('0x11')]);router[_0xebef('0x12')](_0xebef('0xc'),auth[_0xebef('0xa')](),controller[_0xebef('0x13')]);module[_0xebef('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 1ac1a39..8576543 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x163874,_0xb045df){var _0x42bb8d=function(_0xca7cf4){while(--_0xca7cf4){_0x163874['push'](_0x163874['shift']());}};_0x42bb8d(++_0xb045df);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0xcb91[_0x34d275];return _0x1379cc;};'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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x418d9f,_0x456b56){var _0x494dad=function(_0x234b8a){while(--_0x234b8a){_0x418d9f['push'](_0x418d9f['shift']());}};_0x494dad(++_0x456b56);}(_0xf4eb,0xec));var _0xbf4e=function(_0xd0af37,_0x36933a){_0xd0af37=_0xd0af37-0x0;var _0x8359f8=_0xf4eb[_0xd0af37];return _0x8359f8;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 2a77591..d6b9ae6 100644 --- a/server/api/chatTransferReport/chatTransferReport.controller.js +++ b/server/api/chatTransferReport/chatTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x60ca=['send','index','map','ChatTransferReport','fieldName','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','status','sendStatus','error','stack','name'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x60ca,0x71));var _0xa60c=function(_0x2f75a6,_0x2a57c7){_0x2f75a6=_0x2f75a6-0x0;var _0xfb964f=_0x60ca[_0x2f75a6];return _0xfb964f;};'use strict';var emlformat=require(_0xa60c('0x0'));var rimraf=require(_0xa60c('0x1'));var zipdir=require(_0xa60c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa60c('0x3'));var moment=require(_0xa60c('0x4'));var BPromise=require(_0xa60c('0x5'));var Mustache=require(_0xa60c('0x6'));var util=require(_0xa60c('0x7'));var path=require(_0xa60c('0x8'));var sox=require(_0xa60c('0x9'));var csv=require(_0xa60c('0xa'));var ejs=require(_0xa60c('0xb'));var fs=require('fs');var fs_extra=require(_0xa60c('0xc'));var _=require(_0xa60c('0xd'));var squel=require(_0xa60c('0xe'));var crypto=require(_0xa60c('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xa60c('0x10'));var toCsv=require(_0xa60c('0xa'));var querystring=require(_0xa60c('0x11'));var Papa=require(_0xa60c('0x12'));var Redis=require('ioredis');var authService=require(_0xa60c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa60c('0x14'));var hardwareService=require(_0xa60c('0x15'));var logger=require(_0xa60c('0x16'))(_0xa60c('0x17'));var utils=require(_0xa60c('0x18'));var config=require(_0xa60c('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4adf36,_0x567aad){_0x567aad=_0x567aad||0xcc;return function(_0x93c397){if(_0x93c397){return _0x4adf36['sendStatus'](_0x567aad);}return _0x4adf36['status'](_0x567aad)[_0xa60c('0x1a')]();};}function respondWithResult(_0x40ae3e,_0x5f0b7e){_0x5f0b7e=_0x5f0b7e||0xc8;return function(_0x25086f){if(_0x25086f){return _0x40ae3e['status'](_0x5f0b7e)[_0xa60c('0x1b')](_0x25086f);}};}function respondWithFilteredResult(_0x17f596,_0xeaff5e){return function(_0x43a4ee){if(_0x43a4ee){var _0x381d5f=typeof _0xeaff5e[_0xa60c('0x1c')]===_0xa60c('0x1d')&&typeof _0xeaff5e['limit']===_0xa60c('0x1d');var _0x2ecf0b=_0x43a4ee[_0xa60c('0x1e')];var _0x1a3394=_0x381d5f?0x0:_0xeaff5e[_0xa60c('0x1c')];var _0x2847c5=_0x381d5f?_0x43a4ee[_0xa60c('0x1e')]:_0xeaff5e[_0xa60c('0x1c')]+_0xeaff5e[_0xa60c('0x1f')];var _0x22afe1;if(_0x2847c5>=_0x2ecf0b){_0x2847c5=_0x2ecf0b;_0x22afe1=0xc8;}else{_0x22afe1=0xce;}_0x17f596['status'](_0x22afe1);return _0x17f596[_0xa60c('0x20')](_0xa60c('0x21'),_0x1a3394+'-'+_0x2847c5+'/'+_0x2ecf0b)[_0xa60c('0x1b')](_0x43a4ee);}return null;};}function patchUpdates(_0x51649c){return function(_0x312ba7){try{jsonpatch[_0xa60c('0x22')](_0x312ba7,_0x51649c,!![]);}catch(_0x567467){return BPromise[_0xa60c('0x23')](_0x567467);}return _0x312ba7[_0xa60c('0x24')]();};}function saveUpdates(_0x32784a,_0x5071a5){return function(_0x33b3aa){if(_0x33b3aa){return _0x33b3aa[_0xa60c('0x25')](_0x32784a)[_0xa60c('0x26')](function(_0x2aca72){return _0x2aca72;});}return null;};}function removeEntity(_0x35b2c7,_0x183e25){return function(_0x2c0723){if(_0x2c0723){return _0x2c0723[_0xa60c('0x27')]()[_0xa60c('0x26')](function(){_0x35b2c7[_0xa60c('0x28')](0xcc)[_0xa60c('0x1a')]();});}};}function handleEntityNotFound(_0x45ddb7,_0x44f51c){return function(_0x124bed){if(!_0x124bed){_0x45ddb7[_0xa60c('0x29')](0x194);}return _0x124bed;};}function handleError(_0x55fef0,_0x49ab5c){_0x49ab5c=_0x49ab5c||0x1f4;return function(_0x4921d0){logger[_0xa60c('0x2a')](_0x4921d0[_0xa60c('0x2b')]);if(_0x4921d0[_0xa60c('0x2c')]){delete _0x4921d0[_0xa60c('0x2c')];}_0x55fef0[_0xa60c('0x28')](_0x49ab5c)[_0xa60c('0x2d')](_0x4921d0);};}exports[_0xa60c('0x2e')]=function(_0x56383e,_0x8b6ab1){var _0x44badc={},_0x3e8d8e={},_0x508077={'count':0x0,'rows':[]};var _0xa2240b=_[_0xa60c('0x2f')](db[_0xa60c('0x30')]['rawAttributes'],function(_0x381317){return{'name':_0x381317[_0xa60c('0x31')],'type':_0x381317['type']['key']};});_0x3e8d8e[_0xa60c('0x32')]=_[_0xa60c('0x2f')](_0xa2240b,'name');_0x3e8d8e[_0xa60c('0x33')]=_['keys'](_0x56383e[_0xa60c('0x33')]);_0x3e8d8e[_0xa60c('0x34')]=_['intersection'](_0x3e8d8e[_0xa60c('0x32')],_0x3e8d8e[_0xa60c('0x33')]);_0x44badc[_0xa60c('0x35')]=_['intersection'](_0x3e8d8e['model'],qs['fields'](_0x56383e[_0xa60c('0x33')][_0xa60c('0x36')]));_0x44badc[_0xa60c('0x35')]=_0x44badc['attributes'][_0xa60c('0x37')]?_0x44badc[_0xa60c('0x35')]:_0x3e8d8e[_0xa60c('0x32')];if(!_0x56383e['query'][_0xa60c('0x38')](_0xa60c('0x39'))){_0x44badc[_0xa60c('0x1f')]=qs[_0xa60c('0x1f')](_0x56383e[_0xa60c('0x33')]['limit']);_0x44badc[_0xa60c('0x1c')]=qs[_0xa60c('0x1c')](_0x56383e[_0xa60c('0x33')][_0xa60c('0x1c')]);}_0x44badc[_0xa60c('0x3a')]=qs[_0xa60c('0x3b')](_0x56383e['query'][_0xa60c('0x3b')]);_0x44badc[_0xa60c('0x3c')]=qs[_0xa60c('0x34')](_[_0xa60c('0x3d')](_0x56383e[_0xa60c('0x33')],_0x3e8d8e[_0xa60c('0x34')]),_0xa2240b);if(_0x56383e[_0xa60c('0x33')][_0xa60c('0x3e')]){_0x44badc['where']=_[_0xa60c('0x3f')](_0x44badc['where'],{'$or':_[_0xa60c('0x2f')](_0xa2240b,function(_0x3adeee){if(_0x3adeee['type']!==_0xa60c('0x40')){var _0x42e50f={};_0x42e50f[_0x3adeee['name']]={'$like':'%'+_0x56383e[_0xa60c('0x33')][_0xa60c('0x3e')]+'%'};return _0x42e50f;}})});}_0x44badc=_[_0xa60c('0x3f')]({},_0x44badc,_0x56383e[_0xa60c('0x41')]);var _0x395e12={'where':_0x44badc[_0xa60c('0x3c')]};return db[_0xa60c('0x30')][_0xa60c('0x1e')](_0x395e12)[_0xa60c('0x26')](function(_0x26bc17){_0x508077[_0xa60c('0x1e')]=_0x26bc17;if(_0x56383e[_0xa60c('0x33')][_0xa60c('0x42')]){_0x44badc[_0xa60c('0x43')]=[{'all':!![]}];}return db[_0xa60c('0x30')][_0xa60c('0x44')](_0x44badc);})[_0xa60c('0x26')](function(_0x8f549d){_0x508077[_0xa60c('0x45')]=_0x8f549d;return _0x508077;})[_0xa60c('0x26')](respondWithFilteredResult(_0x8b6ab1,_0x44badc))[_0xa60c('0x46')](handleError(_0x8b6ab1,null));};exports[_0xa60c('0x47')]=function(_0x51286b,_0x41dc71){var _0x378bb4={'raw':!![],'where':{'id':_0x51286b[_0xa60c('0x48')]['id']}},_0x558344={};_0x558344['model']=_['keys'](db['ChatTransferReport'][_0xa60c('0x49')]);_0x558344[_0xa60c('0x33')]=_[_0xa60c('0x4a')](_0x51286b[_0xa60c('0x33')]);_0x558344['filters']=_['intersection'](_0x558344['model'],_0x558344[_0xa60c('0x33')]);_0x378bb4[_0xa60c('0x35')]=_['intersection'](_0x558344[_0xa60c('0x32')],qs[_0xa60c('0x36')](_0x51286b['query'][_0xa60c('0x36')]));_0x378bb4['attributes']=_0x378bb4[_0xa60c('0x35')][_0xa60c('0x37')]?_0x378bb4[_0xa60c('0x35')]:_0x558344[_0xa60c('0x32')];if(_0x51286b['query'][_0xa60c('0x42')]){_0x378bb4[_0xa60c('0x43')]=[{'all':!![]}];}_0x378bb4=_['merge']({},_0x378bb4,_0x51286b['options']);return db['ChatTransferReport']['find'](_0x378bb4)[_0xa60c('0x26')](handleEntityNotFound(_0x41dc71,null))[_0xa60c('0x26')](respondWithResult(_0x41dc71,null))[_0xa60c('0x46')](handleError(_0x41dc71,null));};exports[_0xa60c('0x4b')]=function(_0x54a85a,_0x298503){return db[_0xa60c('0x30')][_0xa60c('0x4b')](_0x54a85a[_0xa60c('0x4c')],{})['then'](respondWithResult(_0x298503,0xc9))[_0xa60c('0x46')](handleError(_0x298503,null));};exports[_0xa60c('0x25')]=function(_0x47f06e,_0xd26c06){if(_0x47f06e['body']['id']){delete _0x47f06e[_0xa60c('0x4c')]['id'];}return db[_0xa60c('0x30')][_0xa60c('0x4d')]({'where':{'id':_0x47f06e[_0xa60c('0x48')]['id']}})[_0xa60c('0x26')](handleEntityNotFound(_0xd26c06,null))['then'](saveUpdates(_0x47f06e[_0xa60c('0x4c')],null))[_0xa60c('0x26')](respondWithResult(_0xd26c06,null))['catch'](handleError(_0xd26c06,null));};exports[_0xa60c('0x27')]=function(_0x1b8489,_0x176958){return db[_0xa60c('0x30')][_0xa60c('0x4d')]({'where':{'id':_0x1b8489[_0xa60c('0x48')]['id']}})['then'](handleEntityNotFound(_0x176958,null))[_0xa60c('0x26')](removeEntity(_0x176958,null))[_0xa60c('0x46')](handleError(_0x176958,null));};exports['describe']=function(_0x510145,_0x5a95b9){return db[_0xa60c('0x30')][_0xa60c('0x4e')]()[_0xa60c('0x26')](respondWithResult(_0x5a95b9,null))[_0xa60c('0x46')](handleError(_0x5a95b9,null));}; \ No newline at end of file +var _0x83e1=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','merge','find','create','body','describe','fast-json-patch','request-promise','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x247f35,_0x26a86e){var _0x1d28bb=function(_0x2d944d){while(--_0x2d944d){_0x247f35['push'](_0x247f35['shift']());}};_0x1d28bb(++_0x26a86e);}(_0x83e1,0x168));var _0x183e=function(_0x36ab4b,_0xe17de5){_0x36ab4b=_0x36ab4b-0x0;var _0x4aa903=_0x83e1[_0x36ab4b];return _0x4aa903;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x183e('0x0'));var rp=require(_0x183e('0x1'));var moment=require(_0x183e('0x2'));var BPromise=require(_0x183e('0x3'));var Mustache=require(_0x183e('0x4'));var util=require(_0x183e('0x5'));var path=require(_0x183e('0x6'));var sox=require(_0x183e('0x7'));var csv=require(_0x183e('0x8'));var ejs=require(_0x183e('0x9'));var fs=require('fs');var fs_extra=require(_0x183e('0xa'));var _=require(_0x183e('0xb'));var squel=require(_0x183e('0xc'));var crypto=require('crypto');var jsforce=require(_0x183e('0xd'));var deskjs=require(_0x183e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x183e('0xf'));var Papa=require(_0x183e('0x10'));var Redis=require(_0x183e('0x11'));var authService=require(_0x183e('0x12'));var qs=require(_0x183e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x183e('0x14'));var logger=require(_0x183e('0x15'))(_0x183e('0x16'));var utils=require(_0x183e('0x17'));var config=require(_0x183e('0x18'));var licenseUtil=require(_0x183e('0x19'));var db=require(_0x183e('0x1a'))['db'];function respondWithStatusCode(_0x5baf0e,_0x537b43){_0x537b43=_0x537b43||0xcc;return function(_0x595824){if(_0x595824){return _0x5baf0e[_0x183e('0x1b')](_0x537b43);}return _0x5baf0e[_0x183e('0x1c')](_0x537b43)[_0x183e('0x1d')]();};}function respondWithResult(_0x1510ab,_0x27680b){_0x27680b=_0x27680b||0xc8;return function(_0x3be3be){if(_0x3be3be){return _0x1510ab[_0x183e('0x1c')](_0x27680b)[_0x183e('0x1e')](_0x3be3be);}};}function respondWithFilteredResult(_0x271c0b,_0x59b79c){return function(_0x428802){if(_0x428802){var _0x403b0d=typeof _0x59b79c[_0x183e('0x1f')]==='undefined'&&typeof _0x59b79c[_0x183e('0x20')]==='undefined';var _0x57a454=_0x428802[_0x183e('0x21')];var _0x3b22bc=_0x403b0d?0x0:_0x59b79c['offset'];var _0x14c337=_0x403b0d?_0x428802['count']:_0x59b79c[_0x183e('0x1f')]+_0x59b79c['limit'];var _0x1b23e3;if(_0x14c337>=_0x57a454){_0x14c337=_0x57a454;_0x1b23e3=0xc8;}else{_0x1b23e3=0xce;}_0x271c0b['status'](_0x1b23e3);return _0x271c0b[_0x183e('0x22')](_0x183e('0x23'),_0x3b22bc+'-'+_0x14c337+'/'+_0x57a454)[_0x183e('0x1e')](_0x428802);}return null;};}function patchUpdates(_0x35b109){return function(_0x2a0dff){try{jsonpatch['apply'](_0x2a0dff,_0x35b109,!![]);}catch(_0x1a1810){return BPromise[_0x183e('0x24')](_0x1a1810);}return _0x2a0dff['save']();};}function saveUpdates(_0x29a869,_0x22e970){return function(_0xe0832d){if(_0xe0832d){return _0xe0832d[_0x183e('0x25')](_0x29a869)[_0x183e('0x26')](function(_0x52f5b1){return _0x52f5b1;});}return null;};}function removeEntity(_0x43c5e0,_0x449373){return function(_0x1cc027){if(_0x1cc027){return _0x1cc027[_0x183e('0x27')]()[_0x183e('0x26')](function(){_0x43c5e0[_0x183e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fcb6e,_0x42b440){return function(_0x13d772){if(!_0x13d772){_0x2fcb6e[_0x183e('0x1b')](0x194);}return _0x13d772;};}function handleError(_0xf70c71,_0xe4ca7f){_0xe4ca7f=_0xe4ca7f||0x1f4;return function(_0xc68ba4){logger[_0x183e('0x28')](_0xc68ba4[_0x183e('0x29')]);if(_0xc68ba4[_0x183e('0x2a')]){delete _0xc68ba4[_0x183e('0x2a')];}_0xf70c71['status'](_0xe4ca7f)[_0x183e('0x2b')](_0xc68ba4);};}exports[_0x183e('0x2c')]=function(_0x2cb8d0,_0x2d7644){var _0x97c8f={},_0x1cca27={},_0x95bddf={'count':0x0,'rows':[]};var _0x7c47ae=_[_0x183e('0x2d')](db[_0x183e('0x2e')][_0x183e('0x2f')],function(_0x290652){return{'name':_0x290652[_0x183e('0x30')],'type':_0x290652[_0x183e('0x31')][_0x183e('0x32')]};});_0x1cca27['model']=_['map'](_0x7c47ae,_0x183e('0x2a'));_0x1cca27[_0x183e('0x33')]=_[_0x183e('0x34')](_0x2cb8d0['query']);_0x1cca27[_0x183e('0x35')]=_[_0x183e('0x36')](_0x1cca27[_0x183e('0x37')],_0x1cca27[_0x183e('0x33')]);_0x97c8f[_0x183e('0x38')]=_[_0x183e('0x36')](_0x1cca27[_0x183e('0x37')],qs[_0x183e('0x39')](_0x2cb8d0[_0x183e('0x33')][_0x183e('0x39')]));_0x97c8f['attributes']=_0x97c8f['attributes'][_0x183e('0x3a')]?_0x97c8f[_0x183e('0x38')]:_0x1cca27[_0x183e('0x37')];if(!_0x2cb8d0[_0x183e('0x33')][_0x183e('0x3b')]('nolimit')){_0x97c8f[_0x183e('0x20')]=qs[_0x183e('0x20')](_0x2cb8d0[_0x183e('0x33')][_0x183e('0x20')]);_0x97c8f[_0x183e('0x1f')]=qs[_0x183e('0x1f')](_0x2cb8d0[_0x183e('0x33')]['offset']);}_0x97c8f[_0x183e('0x3c')]=qs[_0x183e('0x3d')](_0x2cb8d0['query'][_0x183e('0x3d')]);_0x97c8f['where']=qs['filters'](_['pick'](_0x2cb8d0['query'],_0x1cca27[_0x183e('0x35')]),_0x7c47ae);if(_0x2cb8d0[_0x183e('0x33')][_0x183e('0x3e')]){_0x97c8f[_0x183e('0x3f')]=_['merge'](_0x97c8f[_0x183e('0x3f')],{'$or':_[_0x183e('0x2d')](_0x7c47ae,function(_0x5cf214){if(_0x5cf214[_0x183e('0x31')]!==_0x183e('0x40')){var _0x2804e2={};_0x2804e2[_0x5cf214[_0x183e('0x2a')]]={'$like':'%'+_0x2cb8d0['query']['filter']+'%'};return _0x2804e2;}})});}_0x97c8f=_['merge']({},_0x97c8f,_0x2cb8d0[_0x183e('0x41')]);var _0x92532={'where':_0x97c8f[_0x183e('0x3f')]};return db['ChatTransferReport'][_0x183e('0x21')](_0x92532)[_0x183e('0x26')](function(_0x28fa8f){_0x95bddf[_0x183e('0x21')]=_0x28fa8f;if(_0x2cb8d0['query'][_0x183e('0x42')]){_0x97c8f['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x183e('0x43')](_0x97c8f);})[_0x183e('0x26')](function(_0x3d72fe){_0x95bddf[_0x183e('0x44')]=_0x3d72fe;return _0x95bddf;})[_0x183e('0x26')](respondWithFilteredResult(_0x2d7644,_0x97c8f))[_0x183e('0x45')](handleError(_0x2d7644,null));};exports[_0x183e('0x46')]=function(_0x5b6ea7,_0x2430a3){var _0x4eb018={'raw':!![],'where':{'id':_0x5b6ea7[_0x183e('0x47')]['id']}},_0x1262ea={};_0x1262ea[_0x183e('0x37')]=_[_0x183e('0x34')](db[_0x183e('0x2e')][_0x183e('0x2f')]);_0x1262ea['query']=_['keys'](_0x5b6ea7[_0x183e('0x33')]);_0x1262ea['filters']=_[_0x183e('0x36')](_0x1262ea[_0x183e('0x37')],_0x1262ea['query']);_0x4eb018['attributes']=_['intersection'](_0x1262ea[_0x183e('0x37')],qs[_0x183e('0x39')](_0x5b6ea7[_0x183e('0x33')][_0x183e('0x39')]));_0x4eb018['attributes']=_0x4eb018[_0x183e('0x38')]['length']?_0x4eb018[_0x183e('0x38')]:_0x1262ea[_0x183e('0x37')];if(_0x5b6ea7['query'][_0x183e('0x42')]){_0x4eb018['include']=[{'all':!![]}];}_0x4eb018=_[_0x183e('0x48')]({},_0x4eb018,_0x5b6ea7[_0x183e('0x41')]);return db[_0x183e('0x2e')][_0x183e('0x49')](_0x4eb018)['then'](handleEntityNotFound(_0x2430a3,null))[_0x183e('0x26')](respondWithResult(_0x2430a3,null))[_0x183e('0x45')](handleError(_0x2430a3,null));};exports['create']=function(_0x625c4d,_0x1d5709){return db['ChatTransferReport'][_0x183e('0x4a')](_0x625c4d[_0x183e('0x4b')],{})['then'](respondWithResult(_0x1d5709,0xc9))['catch'](handleError(_0x1d5709,null));};exports[_0x183e('0x25')]=function(_0x3b741c,_0x1f8820){if(_0x3b741c[_0x183e('0x4b')]['id']){delete _0x3b741c[_0x183e('0x4b')]['id'];}return db[_0x183e('0x2e')][_0x183e('0x49')]({'where':{'id':_0x3b741c['params']['id']}})['then'](handleEntityNotFound(_0x1f8820,null))[_0x183e('0x26')](saveUpdates(_0x3b741c['body'],null))[_0x183e('0x26')](respondWithResult(_0x1f8820,null))[_0x183e('0x45')](handleError(_0x1f8820,null));};exports['destroy']=function(_0x386c35,_0x315585){return db[_0x183e('0x2e')]['find']({'where':{'id':_0x386c35[_0x183e('0x47')]['id']}})['then'](handleEntityNotFound(_0x315585,null))['then'](removeEntity(_0x315585,null))[_0x183e('0x45')](handleError(_0x315585,null));};exports[_0x183e('0x4c')]=function(_0x4f76c0,_0x525efe){return db['ChatTransferReport'][_0x183e('0x4c')]()[_0x183e('0x26')](respondWithResult(_0x525efe,null))[_0x183e('0x45')](handleError(_0x525efe,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 21de619..037edc0 100644 --- a/server/api/chatTransferReport/chatTransferReport.model.js +++ b/server/api/chatTransferReport/chatTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa69b=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x340454,_0x52af2c){var _0x118e75=function(_0x3d3e27){while(--_0x3d3e27){_0x340454['push'](_0x340454['shift']());}};_0x118e75(++_0x52af2c);}(_0xa69b,0x11d));var _0xba69=function(_0x48c7c5,_0x504d06){_0x48c7c5=_0x48c7c5-0x0;var _0x45fc92=_0xa69b[_0x48c7c5];return _0x45fc92;};'use strict';var _=require(_0xba69('0x0'));var util=require('util');var logger=require(_0xba69('0x1'))(_0xba69('0x2'));var moment=require('moment');var BPromise=require(_0xba69('0x3'));var rp=require(_0xba69('0x4'));var fs=require('fs');var path=require(_0xba69('0x5'));var rimraf=require(_0xba69('0x6'));var config=require(_0xba69('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xba69('0x8')]=function(_0x3bac6d,_0x5be9bc){return _0x3bac6d[_0xba69('0x9')](_0xba69('0xa'),attributes,{'tableName':_0xba69('0xb'),'paranoid':![],'indexes':[{'name':_0xba69('0xc'),'fields':[_0xba69('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7072=['path','rimraf','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','../../config/logger','request-promise'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x7072,0xa8));var _0x2707=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x7072[_0x2dea24];return _0x309d58;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2707('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2707('0x1'));var fs=require('fs');var path=require(_0x2707('0x2'));var rimraf=require(_0x2707('0x3'));var config=require(_0x2707('0x4'));var attributes=require('./chatTransferReport.attributes');module[_0x2707('0x5')]=function(_0x54a24c,_0x3bf38b){return _0x54a24c[_0x2707('0x6')](_0x2707('0x7'),attributes,{'tableName':_0x2707('0x8'),'paranoid':![],'indexes':[{'name':_0x2707('0x9'),'fields':[_0x2707('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index c53611c..170b833 100644 --- a/server/api/chatTransferReport/chatTransferReport.rpc.js +++ b/server/api/chatTransferReport/chatTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x889e=['jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment'];(function(_0x3c0ffa,_0xf7ee6a){var _0x38c658=function(_0x95a838){while(--_0x95a838){_0x3c0ffa['push'](_0x3c0ffa['shift']());}};_0x38c658(++_0xf7ee6a);}(_0x889e,0x117));var _0xe889=function(_0x4857a9,_0x53b85d){_0x4857a9=_0x4857a9-0x0;var _0x1fe8af=_0x889e[_0x4857a9];return _0x1fe8af;};'use strict';var _=require(_0xe889('0x0'));var util=require(_0xe889('0x1'));var moment=require(_0xe889('0x2'));var BPromise=require(_0xe889('0x3'));var rs=require(_0xe889('0x4'));var fs=require('fs');var Redis=require(_0xe889('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe889('0x6'));var jayson=require(_0xe889('0x7'));var client=jayson[_0xe889('0x8')][_0xe889('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2934c9,_0x2b7406,_0x1b966e){return new BPromise(function(_0x598735,_0x54867c){return client['request'](_0x2934c9,_0x1b966e)[_0xe889('0xa')](function(_0x58da71){logger[_0xe889('0xb')](_0xe889('0xc'),_0x2b7406,_0xe889('0xd'));logger[_0xe889('0xe')](_0xe889('0xf'),_0x2b7406,_0xe889('0xd'),JSON[_0xe889('0x10')](_0x58da71));if(_0x58da71[_0xe889('0x11')]){if(_0x58da71[_0xe889('0x11')][_0xe889('0x12')]===0x1f4){logger[_0xe889('0x11')](_0xe889('0xc'),_0x2b7406,_0x58da71[_0xe889('0x11')]['message']);return _0x54867c(_0x58da71[_0xe889('0x11')][_0xe889('0x13')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x2b7406,_0x58da71[_0xe889('0x11')][_0xe889('0x13')]);return _0x598735(_0x58da71[_0xe889('0x11')][_0xe889('0x13')]);}else{logger[_0xe889('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x2b7406,_0xe889('0xd'));_0x598735(_0x58da71[_0xe889('0x14')][_0xe889('0x13')]);}})[_0xe889('0x15')](function(_0xaf505c){logger[_0xe889('0x11')](_0xe889('0xc'),_0x2b7406,_0xaf505c);_0x54867c(_0xaf505c);});});} \ No newline at end of file +var _0xaa6e=['code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0xaa6e,0xba));var _0xeaa6=function(_0x57e6c0,_0x5d630a){_0x57e6c0=_0x57e6c0-0x0;var _0x51c843=_0xaa6e[_0x57e6c0];return _0x51c843;};'use strict';var _=require(_0xeaa6('0x0'));var util=require(_0xeaa6('0x1'));var moment=require(_0xeaa6('0x2'));var BPromise=require(_0xeaa6('0x3'));var rs=require(_0xeaa6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeaa6('0x5'))['db'];var utils=require(_0xeaa6('0x6'));var logger=require(_0xeaa6('0x7'))(_0xeaa6('0x8'));var config=require(_0xeaa6('0x9'));var jayson=require(_0xeaa6('0xa'));var client=jayson[_0xeaa6('0xb')][_0xeaa6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x27d1a8,_0x13db04,_0x58beb7){return new BPromise(function(_0x38bf4d,_0x10cf77){return client[_0xeaa6('0xd')](_0x27d1a8,_0x58beb7)[_0xeaa6('0xe')](function(_0x514c71){logger[_0xeaa6('0xf')](_0xeaa6('0x10'),_0x13db04,'request\x20sent');logger[_0xeaa6('0x11')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x13db04,_0xeaa6('0x12'),JSON[_0xeaa6('0x13')](_0x514c71));if(_0x514c71[_0xeaa6('0x14')]){if(_0x514c71[_0xeaa6('0x14')][_0xeaa6('0x15')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x13db04,_0x514c71[_0xeaa6('0x14')]['message']);return _0x10cf77(_0x514c71[_0xeaa6('0x14')]['message']);}logger[_0xeaa6('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x13db04,_0x514c71[_0xeaa6('0x14')]['message']);return _0x38bf4d(_0x514c71[_0xeaa6('0x14')][_0xeaa6('0x16')]);}else{logger['info'](_0xeaa6('0x10'),_0x13db04,'request\x20sent');_0x38bf4d(_0x514c71['result'][_0xeaa6('0x16')]);}})['catch'](function(_0x39f452){logger[_0xeaa6('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x13db04,_0x39f452);_0x10cf77(_0x39f452);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index fd23205..2ea293c 100644 --- a/server/api/chatTransferReport/index.js +++ b/server/api/chatTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb798=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','post','create','put','/:id','exports','multer','util'];(function(_0x3387ae,_0x1368ca){var _0x3385c6=function(_0x4622ef){while(--_0x4622ef){_0x3387ae['push'](_0x3387ae['shift']());}};_0x3385c6(++_0x1368ca);}(_0xb798,0xc4));var _0x8b79=function(_0x59165d,_0x15c6ef){_0x59165d=_0x59165d-0x0;var _0x5ee1cd=_0xb798[_0x59165d];return _0x5ee1cd;};'use strict';var multer=require(_0x8b79('0x0'));var util=require(_0x8b79('0x1'));var path=require('path');var timeout=require(_0x8b79('0x2'));var express=require(_0x8b79('0x3'));var router=express[_0x8b79('0x4')]();var fs_extra=require(_0x8b79('0x5'));var auth=require(_0x8b79('0x6'));var interaction=require(_0x8b79('0x7'));var config=require(_0x8b79('0x8'));var controller=require('./chatTransferReport.controller');router['get']('/',auth[_0x8b79('0x9')](),controller[_0x8b79('0xa')]);router[_0x8b79('0xb')](_0x8b79('0xc'),auth[_0x8b79('0x9')](),controller['describe']);router[_0x8b79('0xb')]('/:id',auth[_0x8b79('0x9')](),controller['show']);router[_0x8b79('0xd')]('/',auth[_0x8b79('0x9')](),controller[_0x8b79('0xe')]);router[_0x8b79('0xf')](_0x8b79('0x10'),auth[_0x8b79('0x9')](),controller['update']);router['delete']('/:id',auth[_0x8b79('0x9')](),controller['destroy']);module[_0x8b79('0x11')]=router; \ No newline at end of file +var _0x25a4=['get','/describe','isAuthenticated','describe','/:id','show','create','put','update','destroy','exports','util','connect-timeout','express','Router','../../config/environment'];(function(_0x5689e4,_0xca20b8){var _0x46ec6e=function(_0x16f4f2){while(--_0x16f4f2){_0x5689e4['push'](_0x5689e4['shift']());}};_0x46ec6e(++_0xca20b8);}(_0x25a4,0x10b));var _0x425a=function(_0x2a390b,_0xf49f9b){_0x2a390b=_0x2a390b-0x0;var _0x5df10a=_0x25a4[_0x2a390b];return _0x5df10a;};'use strict';var multer=require('multer');var util=require(_0x425a('0x0'));var path=require('path');var timeout=require(_0x425a('0x1'));var express=require(_0x425a('0x2'));var router=express[_0x425a('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x425a('0x4'));var controller=require('./chatTransferReport.controller');router[_0x425a('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x425a('0x6'),auth[_0x425a('0x7')](),controller[_0x425a('0x8')]);router[_0x425a('0x5')](_0x425a('0x9'),auth[_0x425a('0x7')](),controller[_0x425a('0xa')]);router['post']('/',auth[_0x425a('0x7')](),controller[_0x425a('0xb')]);router[_0x425a('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x425a('0xd')]);router['delete'](_0x425a('0x9'),auth['isAuthenticated'](),controller[_0x425a('0xe')]);module[_0x425a('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 531f29b..ffeb4af 100644 --- a/server/api/chatWebsite/chatWebsite.attributes.js +++ b/server/api/chatWebsite/chatWebsite.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x393c=['onlineForm','parse','setDataValue','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue'];(function(_0x334209,_0x522448){var _0x27c495=function(_0x26a2ef){while(--_0x26a2ef){_0x334209['push'](_0x334209['shift']());}};_0x27c495(++_0x522448);}(_0x393c,0x189));var _0xc393=function(_0x4ffe4f,_0x531c08){_0x4ffe4f=_0x4ffe4f-0x0;var _0x3c0864=_0x393c[_0x4ffe4f];return _0x3c0864;};'use strict';var Sequelize=require(_0xc393('0x0'));var rs=require('randomstring');module[_0xc393('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xc393('0x2')],'allowNull':![],'unique':_0xc393('0x3')},'description':{'type':Sequelize[_0xc393('0x2')]},'mapKey':{'type':Sequelize[_0xc393('0x2')],'defaultValue':_0xc393('0x4')},'mapKeyOffline':{'type':Sequelize[_0xc393('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0xc393('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xc393('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xc393('0x2')],'allowNull':![],'defaultValue':_0xc393('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xc393('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xc393('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xc393('0x2')],'allowNull':![],'defaultValue':_0xc393('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xc393('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xc393('0x2')]},'animation':{'type':Sequelize[_0xc393('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xc393('0xa')]('rounded',_0xc393('0xb')),'defaultValue':_0xc393('0xc')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xc393('0xd')},'start_chat_button':{'type':Sequelize[_0xc393('0x2')],'defaultValue':_0xc393('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xc393('0xf')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xc393('0x10')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xc393('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xc393('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xc393('0x11')]},'closingQuestion':{'type':Sequelize[_0xc393('0x2')],'defaultValue':_0xc393('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xc393('0x2')],'defaultValue':_0xc393('0x13')},'noteTitle':{'type':Sequelize[_0xc393('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xc393('0x2')],'defaultValue':_0xc393('0x14')},'closingMessage':{'type':Sequelize[_0xc393('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xc393('0xf')},'skipMessageButton':{'type':Sequelize[_0xc393('0x2')],'defaultValue':_0xc393('0x15')},'conditionAgreement':{'type':Sequelize[_0xc393('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xc393('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xc393('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xc393('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xc393('0x2')],'defaultValue':_0xc393('0x16')},'ratingType':{'type':Sequelize[_0xc393('0xa')](_0xc393('0x17'),_0xc393('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xc393('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xc393('0x11')],'defaultValue':function(){return JSON[_0xc393('0x19')]({'items':[{'type':_0xc393('0x1a'),'variable':null,'config':{'placeholder':_0xc393('0x1b'),'type':_0xc393('0x1c'),'required':!![]},'props':{'title':_0xc393('0x1b'),'helpText':''}},{'type':'input','props':{'title':_0xc393('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xc393('0x4'),'type':_0xc393('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xc393('0x1d')](_0xc393('0x1e'))?JSON[_0xc393('0x1f')](this[_0xc393('0x1d')](_0xc393('0x1e'))):{};},'set':function(_0x4fad5b){return this[_0xc393('0x20')]('onlineForm',JSON['stringify'](_0x4fad5b));}},'offlineForm':{'type':Sequelize[_0xc393('0x11')],'defaultValue':function(){return JSON[_0xc393('0x19')]({'items':[{'type':_0xc393('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xc393('0x4'),'type':_0xc393('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xc393('0x21'))?JSON[_0xc393('0x1f')](this[_0xc393('0x1d')](_0xc393('0x21'))):{};},'set':function(_0x5c0ef4){return this['setDataValue'](_0xc393('0x21'),JSON[_0xc393('0x19')](_0x5c0ef4));}},'token':{'type':Sequelize[_0xc393('0x2')],'defaultValue':function(){return rs[_0xc393('0x22')]();}},'autoclose':{'type':Sequelize[_0xc393('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xc393('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xc393('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xc393('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xc393('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xc393('0x23')},'waitingMessage':{'type':Sequelize[_0xc393('0x2')],'defaultValue':_0xc393('0x24')},'offlineMessageSubject':{'type':Sequelize[_0xc393('0x2')],'defaultValue':_0xc393('0x25')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xc393('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xc393('0x2')],'defaultValue':_0xc393('0x27')},'skipUnmanaged':{'type':Sequelize[_0xc393('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xc393('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xc393('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xc393('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xc393('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xc393('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xc393('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc393('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xc393('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xc393('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc393('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xc393('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xc393('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xc393('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xc393('0x2')],'defaultValue':_0xc393('0x28')},'defaultTitle':{'type':Sequelize[_0xc393('0x2')]},'customerAvatar':{'type':Sequelize[_0xc393('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xc393('0x2')],'allowNull':![],'defaultValue':_0xc393('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xc393('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc393('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc393('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xc393('0x2')],'defaultValue':_0xc393('0x2a')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xc393('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0xc393('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3ff88e){if(!_0x3ff88e)this[_0xc393('0x20')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xc393('0x2c'),_0x3ff88e);}},'vidaooEscalation':{'type':Sequelize[_0xc393('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xc393('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc393('0x2d')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xc393('0x2e');}},'vidaooMetadata':{'type':Sequelize[_0xc393('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xc393('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xc393('0x11')]}}; \ No newline at end of file +var _0x498b=['textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','ENUM','squared','rounded','Send','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Feedback','star','thumb','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify'];(function(_0x4caade,_0x549ce1){var _0x2041ff=function(_0x402f3a){while(--_0x402f3a){_0x4caade['push'](_0x4caade['shift']());}};_0x2041ff(++_0x549ce1);}(_0x498b,0xa3));var _0xb498=function(_0xd0799f,_0x1968ab){_0xd0799f=_0xd0799f-0x0;var _0x3d0469=_0x498b[_0xd0799f];return _0x3d0469;};'use strict';var Sequelize=require(_0xb498('0x0'));var rs=require(_0xb498('0x1'));module['exports']={'name':{'type':Sequelize[_0xb498('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb498('0x3')},'description':{'type':Sequelize[_0xb498('0x2')]},'mapKey':{'type':Sequelize[_0xb498('0x2')],'defaultValue':_0xb498('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb498('0x2')],'defaultValue':_0xb498('0x5')},'customerAlias':{'type':Sequelize[_0xb498('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb498('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb498('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xb498('0x2')],'allowNull':![],'defaultValue':_0xb498('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb498('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb498('0x2')]},'animation':{'type':Sequelize[_0xb498('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb498('0x9')]('rounded',_0xb498('0xa')),'defaultValue':_0xb498('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xb498('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xb498('0x2')],'defaultValue':_0xb498('0xc')},'header_offline':{'type':Sequelize[_0xb498('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xb498('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb498('0xd')]},'closingQuestion':{'type':Sequelize[_0xb498('0x2')],'defaultValue':_0xb498('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xb498('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xb498('0x2')],'defaultValue':_0xb498('0xf')},'noteTitle':{'type':Sequelize[_0xb498('0x2')],'defaultValue':_0xb498('0x10')},'placeholderMessage':{'type':Sequelize[_0xb498('0x2')],'defaultValue':_0xb498('0x11')},'closingMessage':{'type':Sequelize[_0xb498('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xb498('0x2')],'defaultValue':_0xb498('0xc')},'skipMessageButton':{'type':Sequelize[_0xb498('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xb498('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb498('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb498('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb498('0x2')],'defaultValue':_0xb498('0x12')},'ratingType':{'type':Sequelize['ENUM'](_0xb498('0x13'),_0xb498('0x14')),'defaultValue':_0xb498('0x13')},'ratingStarsNumber':{'type':Sequelize[_0xb498('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb498('0xd')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xb498('0x15'),'variable':null,'config':{'placeholder':_0xb498('0x16'),'type':_0xb498('0x17'),'required':!![]},'props':{'title':_0xb498('0x16'),'helpText':''}},{'type':_0xb498('0x15'),'props':{'title':_0xb498('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb498('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb498('0x18')](_0xb498('0x19'))?JSON[_0xb498('0x1a')](this[_0xb498('0x18')]('onlineForm')):{};},'set':function(_0x4685e6){return this[_0xb498('0x1b')](_0xb498('0x19'),JSON[_0xb498('0x1c')](_0x4685e6));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xb498('0x15'),'props':{'title':_0xb498('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb498('0x4'),'type':'email'},'variable':null},{'type':_0xb498('0x1d'),'config':{'placeholder':'Comments'},'props':{'title':_0xb498('0x1e'),'helpText':_0xb498('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0xb498('0x18')](_0xb498('0x20'))?JSON['parse'](this[_0xb498('0x18')](_0xb498('0x20'))):{};},'set':function(_0x34ad0f){return this[_0xb498('0x1b')](_0xb498('0x20'),JSON[_0xb498('0x1c')](_0x34ad0f));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xb498('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xb498('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb498('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb498('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xb498('0x21')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb498('0x22')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xb498('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb498('0x2')],'defaultValue':_0xb498('0x23')},'skipUnmanaged':{'type':Sequelize[_0xb498('0x2')],'defaultValue':_0xb498('0x24')},'sendUnmanaged':{'type':Sequelize[_0xb498('0x2')],'defaultValue':_0xb498('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xb498('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb498('0xd')]},'showAgentAvatar':{'type':Sequelize[_0xb498('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xb498('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb498('0x25');}},'notificationSound':{'type':Sequelize[_0xb498('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb498('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb498('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb498('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xb498('0x26')},'verticalAlignment':{'type':Sequelize[_0xb498('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xb498('0x2')],'defaultValue':_0xb498('0x27')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xb498('0xd')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb498('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb498('0x2')],'allowNull':![],'defaultValue':_0xb498('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb498('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb498('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb498('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb498('0x2')],'defaultValue':_0xb498('0x29')},'systemAvatar':{'type':Sequelize[_0xb498('0xd')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb498('0x7')],'comment':_0xb498('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0xb498('0x8')],'defaultValue':![],'comment':_0xb498('0x2b'),'set':function(_0x1b47db){if(!_0x1b47db)this[_0xb498('0x1b')](_0xb498('0x2c'),null);this[_0xb498('0x1b')](_0xb498('0x2d'),_0x1b47db);}},'vidaooEscalation':{'type':Sequelize[_0xb498('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xb498('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb498('0x2e')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xb498('0x2f');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb498('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xb498('0xd')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 6f9fd92..84948b3 100644 --- a/server/api/chatWebsite/chatWebsite.controller.js +++ b/server/api/chatWebsite/chatWebsite.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3aae=['Writing\x20on\x20closed\x20interaction','externalUrl','ChatInteraction','ContactId','interaction','contact','lastName','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','ChatQueue','queueId','unshift','queue','Start','startRouting','EventManager','files','Sequelize','difference','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','originalname','mimetype','openNewInteraction','sequelize','transaction','Attachment','findOne','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','server','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','fullname','internal','Tag','color','tag','getSnippet','getProactiveActions','getLicense','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.9.0','origin','replace','testWebsiteWithWildcard','remote','x-forwarded-for','x-real-ip','remoteAddress','render','alignment','verticalAlignment','textColor','textButtonColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','online','onlineForm','items','fromKey','addAgents','spread','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APIBadRequestError','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','url','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','ChatWebsite,\x20%s,\x20%s','status','end','json','undefined','count','limit','set','Content-Range','update','destroy','get','ChatWebsites','sendStatus','stack','send','user-agent-parser','setUA','user-agent','customerIp','first','firstName','x-real-port','referer','name','format','browser','version','unknown','%s\x20%s','device','model','vendor','%s\x20%s\x20%s','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','sort','filter','merge','where','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','address','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','testWildcardValidity','describe','addDisposition','getDispositions','Disposition','hasOwnProperty','order','ChatWebsiteId','findAll','removeDispositions','ids','addAnswer','CannedAnswer','pick','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','Interval','timezone','ifTime','notify','from','From\x20is\x20mandatory','mapKey','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','CmContact','Contacts','DESC','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','asc','list','headers','threadId','closed'];(function(_0x52b227,_0x590c49){var _0x122ec5=function(_0x147b77){while(--_0x147b77){_0x52b227['push'](_0x52b227['shift']());}};_0x122ec5(++_0x590c49);}(_0x3aae,0x7e));var _0xe3aa=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3aae[_0x17d9e3];return _0x14192d;};'use strict';var Mustache=require(_0xe3aa('0x0'));var util=require(_0xe3aa('0x1'));var path=require(_0xe3aa('0x2'));var ejs=require(_0xe3aa('0x3'));var fs=require('fs');var fs_extra=require(_0xe3aa('0x4'));var _=require(_0xe3aa('0x5'));var querystring=require(_0xe3aa('0x6'));var htmlToText=require('html-to-text');var Redis=require(_0xe3aa('0x7'));var jayson=require(_0xe3aa('0x8'));var qs=require(_0xe3aa('0x9'));var logger=require(_0xe3aa('0xa'))(_0xe3aa('0xb'));var config=require(_0xe3aa('0xc'));var APIBadRequestError=require(_0xe3aa('0xd'))[_0xe3aa('0xe')];var APINotFoundError=require(_0xe3aa('0xd'))['APINotFoundError'];var APIOutOfIntervalError=require(_0xe3aa('0xd'))[_0xe3aa('0xf')];var APIHandleError=require('../../errors/api')[_0xe3aa('0x10')];var APIConflictError=require('../../errors/api')[_0xe3aa('0x11')];var wildcardUtils=require(_0xe3aa('0x12'));var URL=require(_0xe3aa('0x13'))['URL'];var db=require(_0xe3aa('0x14'))['db'];config[_0xe3aa('0x15')]=_[_0xe3aa('0x16')](config[_0xe3aa('0x15')],{'host':_0xe3aa('0x17'),'port':0x18eb});var socket=require(_0xe3aa('0x18'))(new Redis(config[_0xe3aa('0x15')]));require(_0xe3aa('0x19'))[_0xe3aa('0x1a')](socket);var client=jayson[_0xe3aa('0x1b')][_0xe3aa('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0xe3aa('0x1c')]({'port':0x232a});var client9003=jayson[_0xe3aa('0x1b')][_0xe3aa('0x1c')]({'port':0x232b});var client9001=jayson[_0xe3aa('0x1b')][_0xe3aa('0x1c')]({'port':0x2329});function respondWithRpcPromise(_0x32c45a,_0x2b9dd2,_0x6041ac,_0x3aab8e){return new Promise(function(_0x5121ac,_0x492bbc){var _0x24eaaa=_0x3aab8e||client;return _0x24eaaa[_0xe3aa('0x1d')](_0x32c45a,_0x6041ac)[_0xe3aa('0x1e')](function(_0x108238){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2b9dd2,_0xe3aa('0x1f'));logger[_0xe3aa('0x20')](_0xe3aa('0x21'),_0x2b9dd2,'request\x20sent',JSON[_0xe3aa('0x22')](_0x108238));if(_0x108238[_0xe3aa('0x23')]){if(_0x108238[_0xe3aa('0x23')][_0xe3aa('0x24')]===0x1f4){logger[_0xe3aa('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x2b9dd2,_0x108238[_0xe3aa('0x23')][_0xe3aa('0x25')]);return _0x492bbc(_0x108238[_0xe3aa('0x23')]['message']);}logger[_0xe3aa('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x2b9dd2,_0x108238[_0xe3aa('0x23')][_0xe3aa('0x25')]);return _0x5121ac(_0x108238[_0xe3aa('0x23')][_0xe3aa('0x25')]);}else{logger[_0xe3aa('0x26')](_0xe3aa('0x27'),_0x2b9dd2,'request\x20sent');_0x5121ac(_0x108238['result'][_0xe3aa('0x25')]);}})['catch'](function(_0x202610){logger[_0xe3aa('0x23')](_0xe3aa('0x27'),_0x2b9dd2,_0x202610);_0x492bbc(_0x202610);});});}function respondWithStatusCode(_0x4e2144,_0x1117a5){_0x1117a5=_0x1117a5||0xcc;return function(_0x52cce2){if(_0x52cce2){return _0x4e2144['sendStatus'](_0x1117a5);}return _0x4e2144[_0xe3aa('0x28')](_0x1117a5)[_0xe3aa('0x29')]();};}function respondWithResult(_0x16199f,_0x378375){_0x378375=_0x378375||0xc8;return function(_0x35ef25){if(_0x35ef25){return _0x16199f[_0xe3aa('0x28')](_0x378375)[_0xe3aa('0x2a')](_0x35ef25);}};}function respondWithFilteredResult(_0x417424,_0x22919f){return function(_0x3c5094){if(_0x3c5094){var _0x1501da=typeof _0x22919f['offset']===_0xe3aa('0x2b')&&typeof _0x22919f['limit']===_0xe3aa('0x2b');var _0x5dddf1=_0x3c5094[_0xe3aa('0x2c')];var _0x352b99=_0x1501da?0x0:_0x22919f['offset'];var _0x3c924f=_0x1501da?_0x3c5094[_0xe3aa('0x2c')]:_0x22919f['offset']+_0x22919f[_0xe3aa('0x2d')];var _0x14a35c;if(_0x3c924f>=_0x5dddf1){_0x3c924f=_0x5dddf1;_0x14a35c=0xc8;}else{_0x14a35c=0xce;}_0x417424[_0xe3aa('0x28')](_0x14a35c);return _0x417424[_0xe3aa('0x2e')](_0xe3aa('0x2f'),_0x352b99+'-'+_0x3c924f+'/'+_0x5dddf1)['json'](_0x3c5094);}return null;};}function saveUpdates(_0x405f0a){return function(_0x558fb6){if(_0x558fb6){return _0x558fb6[_0xe3aa('0x30')](_0x405f0a)['then'](function(_0xbe1d93){return _0xbe1d93;});}return null;};}function removeEntity(_0x2b9538){return function(_0x2706da){if(_0x2706da){return _0x2706da[_0xe3aa('0x31')]()[_0xe3aa('0x1e')](function(){var _0x13be1b=_0x2706da[_0xe3aa('0x32')]({'plain':!![]});var _0x56adca=_0xe3aa('0x33');return db['UserProfileResource'][_0xe3aa('0x31')]({'where':{'type':_0x56adca,'resourceId':_0x13be1b['id']}})[_0xe3aa('0x1e')](function(){return _0x2706da;});})[_0xe3aa('0x1e')](function(){_0x2b9538[_0xe3aa('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28af1e){return function(_0x3d9168){if(!_0x3d9168){_0x28af1e[_0xe3aa('0x34')](0x194);}return _0x3d9168;};}function handleError(_0x2b4ecc,_0x4883db){_0x4883db=_0x4883db||0x1f4;return function(_0x13aa20){logger[_0xe3aa('0x23')](_0x13aa20[_0xe3aa('0x35')]);if(_0x13aa20['name']){delete _0x13aa20['name'];}_0x2b4ecc['status'](_0x4883db)[_0xe3aa('0x36')](_0x13aa20);};}function createInteractionObject(_0x5e8477,_0x2b97a1,_0x2774e6,_0x2cff7a){var _0x12b866=require(_0xe3aa('0x37'));var _0x2d6881=new _0x12b866();var _0x35e69a=_0x2d6881[_0xe3aa('0x38')](_0x2774e6[_0xe3aa('0x39')])['getResult']();var _0x4cbffb=_0x2b97a1[_0xe3aa('0x3a')];if(_0x2774e6['cf-connecting-ip']){_0x4cbffb=_0x2774e6['cf-connecting-ip'];}else if(_0x2774e6['x-forwarded-for']){_0x4cbffb=_[_0xe3aa('0x3b')](_0x2774e6['x-forwarded-for']['split'](','));}return{'ContactId':_0x2cff7a['id'],'ChatWebsiteId':_0x5e8477,'from':(_0x2cff7a[_0xe3aa('0x3c')]||'')+'\x20'+(_0x2cff7a['lastName']||''),'customerIp':_0x4cbffb,'customerPort':_0x2774e6[_0xe3aa('0x3d')]?_0x2774e6[_0xe3aa('0x3d')]:null,'referer':_0x2b97a1[_0xe3aa('0x3e')],'browserName':_0x35e69a['browser'][_0xe3aa('0x3f')]&&_0x35e69a['browser']['version']?util[_0xe3aa('0x40')]('%s\x20%s',_0x35e69a['browser'][_0xe3aa('0x3f')],_0x35e69a[_0xe3aa('0x41')][_0xe3aa('0x42')]):'unknown','browserVersion':_0x35e69a[_0xe3aa('0x41')][_0xe3aa('0x42')]||_0xe3aa('0x43'),'osName':util[_0xe3aa('0x40')](_0xe3aa('0x44'),_0x35e69a['os']['name'],_0x35e69a['os'][_0xe3aa('0x42')]),'osVersion':_0x35e69a['os']['version'],'deviceModel':_0x35e69a[_0xe3aa('0x45')][_0xe3aa('0x46')]&&_0x35e69a[_0xe3aa('0x45')][_0xe3aa('0x47')]?util[_0xe3aa('0x40')](_0xe3aa('0x48'),_0x35e69a[_0xe3aa('0x45')][_0xe3aa('0x46')],_0x35e69a[_0xe3aa('0x45')]['vendor'],_0x35e69a[_0xe3aa('0x45')][_0xe3aa('0x49')]):null,'deviceVendor':_0x35e69a['device'][_0xe3aa('0x47')],'deviceType':_0x35e69a[_0xe3aa('0x45')][_0xe3aa('0x49')],'formData':JSON[_0xe3aa('0x22')](_0x2b97a1)};}exports[_0xe3aa('0x4a')]=function(_0x18c84f,_0xd013a8){var _0x28f799={'include':[{'model':db[_0xe3aa('0x4b')],'as':_0xe3aa('0x4c')}]},_0x3ac8f0={},_0x7736fb={'count':0x0,'rows':[]};var _0x282a40=_[_0xe3aa('0x4d')](db[_0xe3aa('0x4e')][_0xe3aa('0x4f')],function(_0x1be115){return{'name':_0x1be115[_0xe3aa('0x50')],'type':_0x1be115['type'][_0xe3aa('0x51')]};});_0x3ac8f0[_0xe3aa('0x46')]=_[_0xe3aa('0x4d')](_0x282a40,_0xe3aa('0x3f'));_0x3ac8f0[_0xe3aa('0x52')]=_[_0xe3aa('0x53')](_0x18c84f['query']);_0x3ac8f0[_0xe3aa('0x54')]=_[_0xe3aa('0x55')](_0x3ac8f0['model'],_0x3ac8f0[_0xe3aa('0x52')]);_0x28f799[_0xe3aa('0x56')]=_['intersection'](_0x3ac8f0[_0xe3aa('0x46')],qs[_0xe3aa('0x57')](_0x18c84f['query'][_0xe3aa('0x57')]));_0x28f799[_0xe3aa('0x56')]=_0x28f799[_0xe3aa('0x56')][_0xe3aa('0x58')]?_0x28f799[_0xe3aa('0x56')]:_0x3ac8f0['model'];if(!_0x18c84f[_0xe3aa('0x52')]['hasOwnProperty'](_0xe3aa('0x59'))){_0x28f799[_0xe3aa('0x2d')]=qs[_0xe3aa('0x2d')](_0x18c84f[_0xe3aa('0x52')][_0xe3aa('0x2d')]);_0x28f799[_0xe3aa('0x5a')]=qs['offset'](_0x18c84f['query']['offset']);}_0x28f799['order']=qs[_0xe3aa('0x5b')](_0x18c84f[_0xe3aa('0x52')][_0xe3aa('0x5b')]);_0x28f799['where']=qs['filters'](_['pick'](_0x18c84f['query'],_0x3ac8f0[_0xe3aa('0x54')]),_0x282a40);if(_0x18c84f[_0xe3aa('0x52')][_0xe3aa('0x5c')]){_0x28f799['where']=_[_0xe3aa('0x5d')](_0x28f799[_0xe3aa('0x5e')],{'$or':_['map'](_0x282a40,function(_0x58951d){if(_0x58951d[_0xe3aa('0x49')]!==_0xe3aa('0x5f')){var _0x3d054a={};_0x3d054a[_0x58951d['name']]={'$like':'%'+_0x18c84f['query'][_0xe3aa('0x5c')]+'%'};return _0x3d054a;}})});}_0x28f799=_[_0xe3aa('0x5d')]({},_0x28f799,_0x18c84f[_0xe3aa('0x60')]);var _0x53ea6a={'where':_0x28f799['where']};return db[_0xe3aa('0x4e')]['count'](_0x53ea6a)[_0xe3aa('0x1e')](function(_0x47e74c){_0x7736fb[_0xe3aa('0x2c')]=_0x47e74c;if(_0x18c84f[_0xe3aa('0x52')][_0xe3aa('0x61')]){_0x28f799[_0xe3aa('0x62')]=[{'all':!![]}];}return db[_0xe3aa('0x4e')]['findAll'](_0x28f799);})['then'](function(_0x5bc8a8){_0x7736fb[_0xe3aa('0x63')]=_0x5bc8a8;return _0x7736fb;})[_0xe3aa('0x1e')](respondWithFilteredResult(_0xd013a8,_0x28f799))['catch'](handleError(_0xd013a8,null));};exports[_0xe3aa('0x64')]=function(_0x909ca6,_0x4db825){var _0x289c7d={'raw':![],'where':{'id':_0x909ca6[_0xe3aa('0x65')]['id']},'include':[{'model':db[_0xe3aa('0x4b')],'as':_0xe3aa('0x4c')}]},_0x1340b2={};_0x1340b2['model']=_['keys'](db['ChatWebsite'][_0xe3aa('0x4f')]);_0x1340b2['query']=_[_0xe3aa('0x53')](_0x909ca6[_0xe3aa('0x52')]);_0x1340b2[_0xe3aa('0x54')]=_[_0xe3aa('0x55')](_0x1340b2['model'],_0x1340b2[_0xe3aa('0x52')]);_0x289c7d[_0xe3aa('0x56')]=_[_0xe3aa('0x55')](_0x1340b2[_0xe3aa('0x46')],qs[_0xe3aa('0x57')](_0x909ca6[_0xe3aa('0x52')]['fields']));_0x289c7d[_0xe3aa('0x56')]=_0x289c7d['attributes'][_0xe3aa('0x58')]?_0x289c7d[_0xe3aa('0x56')]:_0x1340b2['model'];if(_0x909ca6[_0xe3aa('0x52')][_0xe3aa('0x61')]){_0x289c7d[_0xe3aa('0x62')]=[{'all':!![]}];}_0x289c7d=_[_0xe3aa('0x5d')]({},_0x289c7d,_0x909ca6[_0xe3aa('0x60')]);return db['ChatWebsite'][_0xe3aa('0x66')](_0x289c7d)[_0xe3aa('0x1e')](handleEntityNotFound(_0x4db825,null))[_0xe3aa('0x1e')](respondWithResult(_0x4db825,null))[_0xe3aa('0x67')](handleError(_0x4db825,null));};exports[_0xe3aa('0x68')]=function(_0x5d56cf,_0x336ab5){if(!wildcardUtils['testWildcardValidity'](_0x5d56cf[_0xe3aa('0x69')][_0xe3aa('0x6a')])){return handleError(_0x336ab5,null)(new APIBadRequestError('\x22'+_0x5d56cf[_0xe3aa('0x69')][_0xe3aa('0x6a')]+_0xe3aa('0x6b')));}return db[_0xe3aa('0x4e')]['create'](_0x5d56cf[_0xe3aa('0x69')],{})[_0xe3aa('0x1e')](function(_0xf15208){var _0x2a76ee=_0x5d56cf[_0xe3aa('0x6c')][_0xe3aa('0x32')]({'plain':!![]});if(!_0x2a76ee)throw new Error(_0xe3aa('0x6d'));if(_0x2a76ee['role']==='user'){var _0x295d3f=_0xf15208[_0xe3aa('0x32')]({'plain':!![]});var _0x2e7e24=_0xe3aa('0x33');return db['UserProfileSection'][_0xe3aa('0x66')]({'where':{'name':_0x2e7e24,'userProfileId':_0x2a76ee[_0xe3aa('0x6e')]},'raw':!![]})['then'](function(_0x1fec9c){if(_0x1fec9c&&_0x1fec9c[_0xe3aa('0x6f')]===0x0){return db['UserProfileResource'][_0xe3aa('0x68')]({'name':_0x295d3f[_0xe3aa('0x3f')],'resourceId':_0x295d3f['id'],'type':_0x1fec9c[_0xe3aa('0x3f')],'sectionId':_0x1fec9c['id']},{})[_0xe3aa('0x1e')](function(){return _0xf15208;});}else{return _0xf15208;}})['catch'](function(_0x36fc23){logger[_0xe3aa('0x23')](_0xe3aa('0x70'),_0x36fc23);throw _0x36fc23;});}return _0xf15208;})['then'](respondWithResult(_0x336ab5,0xc9))[_0xe3aa('0x67')](handleError(_0x336ab5,null));};exports[_0xe3aa('0x30')]=function(_0x5179f5,_0x124170){if(!wildcardUtils[_0xe3aa('0x71')](_0x5179f5['body'][_0xe3aa('0x6a')])){return handleError(_0x124170,null)(new APIBadRequestError('\x22'+_0x5179f5[_0xe3aa('0x69')]['address']+_0xe3aa('0x6b')));}if(_0x5179f5[_0xe3aa('0x69')]['id']){delete _0x5179f5[_0xe3aa('0x69')]['id'];}return db['ChatWebsite'][_0xe3aa('0x66')]({'where':{'id':_0x5179f5['params']['id']},'include':[{'model':db[_0xe3aa('0x4b')],'as':_0xe3aa('0x4c')}]})[_0xe3aa('0x1e')](handleEntityNotFound(_0x124170,null))[_0xe3aa('0x1e')](saveUpdates(_0x5179f5[_0xe3aa('0x69')],null))['then'](respondWithResult(_0x124170,null))[_0xe3aa('0x67')](handleError(_0x124170,null));};exports['destroy']=function(_0x5b4794,_0x2e1810){return db[_0xe3aa('0x4e')][_0xe3aa('0x66')]({'where':{'id':_0x5b4794[_0xe3aa('0x65')]['id']}})[_0xe3aa('0x1e')](handleEntityNotFound(_0x2e1810,null))['then'](removeEntity(_0x2e1810,null))['catch'](handleError(_0x2e1810,null));};exports[_0xe3aa('0x72')]=function(_0x4890a5,_0x31061b){return db['ChatWebsite'][_0xe3aa('0x72')]()[_0xe3aa('0x1e')](respondWithResult(_0x31061b,null))['catch'](handleError(_0x31061b,null));};exports[_0xe3aa('0x73')]=function(_0x4ca7a0,_0x5b7dd0){if(_0x4ca7a0[_0xe3aa('0x69')]['id']){delete _0x4ca7a0[_0xe3aa('0x69')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x4ca7a0[_0xe3aa('0x65')]['id']}})[_0xe3aa('0x1e')](handleEntityNotFound(_0x5b7dd0,null))[_0xe3aa('0x1e')](function(_0x1a1359){if(_0x1a1359){_0x4ca7a0[_0xe3aa('0x69')]['ChatWebsiteId']=_0x1a1359['id'];return db['Disposition']['create'](_0x4ca7a0[_0xe3aa('0x69')]);}})[_0xe3aa('0x1e')](respondWithResult(_0x5b7dd0,null))[_0xe3aa('0x67')](handleError(_0x5b7dd0,null));};exports[_0xe3aa('0x74')]=function(_0xe3efe,_0x1e01bd){var _0x527b7c={'raw':![],'where':{}};var _0x5966b7={};var _0x22acb5={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0xe3efe[_0xe3aa('0x65')]['id']}})[_0xe3aa('0x1e')](handleEntityNotFound(_0x1e01bd,null))['then'](function(_0x3cb1f3){if(_0x3cb1f3){_0x5966b7[_0xe3aa('0x46')]=_['keys'](db[_0xe3aa('0x75')]['rawAttributes']);_0x5966b7[_0xe3aa('0x52')]=_[_0xe3aa('0x53')](_0xe3efe[_0xe3aa('0x52')]);_0x5966b7[_0xe3aa('0x54')]=_[_0xe3aa('0x55')](_0x5966b7['model'],_0x5966b7['query']);_0x527b7c['attributes']=_[_0xe3aa('0x55')](_0x5966b7[_0xe3aa('0x46')],qs[_0xe3aa('0x57')](_0xe3efe[_0xe3aa('0x52')]['fields']));_0x527b7c[_0xe3aa('0x56')]=_0x527b7c[_0xe3aa('0x56')]['length']?_0x527b7c[_0xe3aa('0x56')]:_0x5966b7[_0xe3aa('0x46')];if(!_0xe3efe['query'][_0xe3aa('0x76')]('nolimit')){_0x527b7c[_0xe3aa('0x2d')]=qs[_0xe3aa('0x2d')](_0xe3efe[_0xe3aa('0x52')][_0xe3aa('0x2d')]);_0x527b7c['offset']=qs[_0xe3aa('0x5a')](_0xe3efe[_0xe3aa('0x52')][_0xe3aa('0x5a')]);}_0x527b7c[_0xe3aa('0x77')]=qs[_0xe3aa('0x5b')](_0xe3efe[_0xe3aa('0x52')][_0xe3aa('0x5b')]);_0x527b7c[_0xe3aa('0x5e')]=qs[_0xe3aa('0x54')](_['pick'](_0xe3efe[_0xe3aa('0x52')],_0x5966b7['filters']));_0x527b7c[_0xe3aa('0x5e')][_0xe3aa('0x78')]=_0x3cb1f3['id'];if(_0xe3efe[_0xe3aa('0x52')]['filter']){_0x527b7c[_0xe3aa('0x5e')]=_[_0xe3aa('0x5d')](_0x527b7c[_0xe3aa('0x5e')],{'$or':_[_0xe3aa('0x4d')](_0x527b7c[_0xe3aa('0x56')],function(_0x1bc77d){var _0xb760fa={};_0xb760fa[_0x1bc77d]={'$like':'%'+_0xe3efe[_0xe3aa('0x52')][_0xe3aa('0x5c')]+'%'};return _0xb760fa;})});}_0x527b7c=_[_0xe3aa('0x5d')]({},_0x527b7c,_0xe3efe['options']);return db['Disposition'][_0xe3aa('0x2c')]({'where':_0x527b7c[_0xe3aa('0x5e')]})['then'](function(_0x389de8){_0x22acb5['count']=_0x389de8;if(_0xe3efe[_0xe3aa('0x52')][_0xe3aa('0x61')]){_0x527b7c[_0xe3aa('0x62')]=[{'all':!![]}];}return db[_0xe3aa('0x75')][_0xe3aa('0x79')](_0x527b7c);})['then'](function(_0x2278b6){_0x22acb5['rows']=_0x2278b6;return _0x22acb5;});}})[_0xe3aa('0x1e')](respondWithFilteredResult(_0x1e01bd,_0x527b7c))[_0xe3aa('0x67')](handleError(_0x1e01bd,null));};exports[_0xe3aa('0x7a')]=function(_0x2bae00,_0x1875de){return db[_0xe3aa('0x4e')][_0xe3aa('0x66')]({'where':{'id':_0x2bae00['params']['id']}})[_0xe3aa('0x1e')](handleEntityNotFound(_0x1875de,null))[_0xe3aa('0x1e')](function(_0x47c942){if(_0x47c942){return _0x47c942[_0xe3aa('0x7a')](_0x2bae00[_0xe3aa('0x52')][_0xe3aa('0x7b')]);}})[_0xe3aa('0x1e')](respondWithStatusCode(_0x1875de,null))[_0xe3aa('0x67')](handleError(_0x1875de,null));};exports[_0xe3aa('0x7c')]=function(_0x151a3d,_0x6d6aef){if(_0x151a3d['body']['id']){delete _0x151a3d[_0xe3aa('0x69')]['id'];}return db[_0xe3aa('0x4e')][_0xe3aa('0x66')]({'where':{'id':_0x151a3d[_0xe3aa('0x65')]['id']}})[_0xe3aa('0x1e')](handleEntityNotFound(_0x6d6aef,null))[_0xe3aa('0x1e')](function(_0x5ac9bd){if(_0x5ac9bd){_0x151a3d[_0xe3aa('0x69')][_0xe3aa('0x78')]=_0x5ac9bd['id'];return db[_0xe3aa('0x7d')][_0xe3aa('0x68')](_0x151a3d['body']);}})['then'](respondWithResult(_0x6d6aef,null))[_0xe3aa('0x67')](handleError(_0x6d6aef,null));};exports['getAnswers']=function(_0x52290d,_0x5c2123){var _0x2b49be={'raw':![],'where':{}};var _0x5f2d13={};var _0x153882={'count':0x0,'rows':[]};return db[_0xe3aa('0x4e')]['findOne']({'where':{'id':_0x52290d['params']['id']}})[_0xe3aa('0x1e')](handleEntityNotFound(_0x5c2123,null))[_0xe3aa('0x1e')](function(_0xa7dceb){if(_0xa7dceb){_0x5f2d13[_0xe3aa('0x46')]=_[_0xe3aa('0x53')](db['CannedAnswer']['rawAttributes']);_0x5f2d13['query']=_[_0xe3aa('0x53')](_0x52290d['query']);_0x5f2d13[_0xe3aa('0x54')]=_[_0xe3aa('0x55')](_0x5f2d13[_0xe3aa('0x46')],_0x5f2d13[_0xe3aa('0x52')]);_0x2b49be[_0xe3aa('0x56')]=_['intersection'](_0x5f2d13[_0xe3aa('0x46')],qs[_0xe3aa('0x57')](_0x52290d['query']['fields']));_0x2b49be[_0xe3aa('0x56')]=_0x2b49be['attributes'][_0xe3aa('0x58')]?_0x2b49be[_0xe3aa('0x56')]:_0x5f2d13[_0xe3aa('0x46')];if(!_0x52290d[_0xe3aa('0x52')][_0xe3aa('0x76')](_0xe3aa('0x59'))){_0x2b49be[_0xe3aa('0x2d')]=qs[_0xe3aa('0x2d')](_0x52290d[_0xe3aa('0x52')]['limit']);_0x2b49be[_0xe3aa('0x5a')]=qs[_0xe3aa('0x5a')](_0x52290d[_0xe3aa('0x52')][_0xe3aa('0x5a')]);}_0x2b49be[_0xe3aa('0x77')]=qs[_0xe3aa('0x5b')](_0x52290d[_0xe3aa('0x52')][_0xe3aa('0x5b')]);_0x2b49be['where']=qs[_0xe3aa('0x54')](_[_0xe3aa('0x7e')](_0x52290d[_0xe3aa('0x52')],_0x5f2d13[_0xe3aa('0x54')]));_0x2b49be['where'][_0xe3aa('0x78')]=_0xa7dceb['id'];if(_0x52290d[_0xe3aa('0x52')][_0xe3aa('0x5c')]){_0x2b49be[_0xe3aa('0x5e')]=_[_0xe3aa('0x5d')](_0x2b49be[_0xe3aa('0x5e')],{'$or':_[_0xe3aa('0x4d')](_0x2b49be[_0xe3aa('0x56')],function(_0x2a1062){var _0x257b0e={};_0x257b0e[_0x2a1062]={'$like':'%'+_0x52290d['query']['filter']+'%'};return _0x257b0e;})});}_0x2b49be=_[_0xe3aa('0x5d')]({},_0x2b49be,_0x52290d[_0xe3aa('0x60')]);return db[_0xe3aa('0x7d')][_0xe3aa('0x2c')]({'where':_0x2b49be[_0xe3aa('0x5e')]})[_0xe3aa('0x1e')](function(_0xf0e76e){_0x153882[_0xe3aa('0x2c')]=_0xf0e76e;if(_0x52290d[_0xe3aa('0x52')][_0xe3aa('0x61')]){_0x2b49be['include']=[{'all':!![]}];}return db[_0xe3aa('0x7d')]['findAll'](_0x2b49be);})[_0xe3aa('0x1e')](function(_0x89ba6d){_0x153882[_0xe3aa('0x63')]=_0x89ba6d;return _0x153882;});}})[_0xe3aa('0x1e')](respondWithFilteredResult(_0x5c2123,_0x2b49be))[_0xe3aa('0x67')](handleError(_0x5c2123,null));};exports['removeAnswers']=function(_0x408c7a,_0x352294){return db[_0xe3aa('0x4e')][_0xe3aa('0x66')]({'where':{'id':_0x408c7a[_0xe3aa('0x65')]['id']}})[_0xe3aa('0x1e')](handleEntityNotFound(_0x352294,null))[_0xe3aa('0x1e')](function(_0x2679ee){if(_0x2679ee){return _0x2679ee[_0xe3aa('0x7f')](_0x408c7a[_0xe3aa('0x52')][_0xe3aa('0x7b')]);}})[_0xe3aa('0x1e')](respondWithStatusCode(_0x352294,null))[_0xe3aa('0x67')](handleError(_0x352294,null));};exports[_0xe3aa('0x80')]=function(_0x1beb73,_0xc42725){_0x1beb73[_0xe3aa('0x69')][_0xe3aa('0x81')]=_0x1beb73[_0xe3aa('0x82')][_0xe3aa('0x83')];return db[_0xe3aa('0x4e')][_0xe3aa('0x66')]({'where':{'id':_0x1beb73[_0xe3aa('0x65')]['id']}})[_0xe3aa('0x1e')](handleEntityNotFound(_0xc42725,null))[_0xe3aa('0x1e')](saveUpdates(_0x1beb73[_0xe3aa('0x69')],null))[_0xe3aa('0x1e')](respondWithResult(_0xc42725,null))['catch'](handleError(_0xc42725,null));};exports[_0xe3aa('0x84')]=function(_0xfde800,_0x306f47){_0xfde800['body'][_0xe3aa('0x85')]=_0xfde800[_0xe3aa('0x82')][_0xe3aa('0x83')];return db['ChatWebsite'][_0xe3aa('0x66')]({'where':{'id':_0xfde800[_0xe3aa('0x65')]['id']}})['then'](handleEntityNotFound(_0x306f47,null))['then'](saveUpdates(_0xfde800['body'],null))[_0xe3aa('0x1e')](respondWithResult(_0x306f47,null))[_0xe3aa('0x67')](handleError(_0x306f47,null));};exports[_0xe3aa('0x86')]=function(_0xeb01f8,_0x327c76){_0xeb01f8[_0xe3aa('0x69')][_0xe3aa('0x87')]=_0xeb01f8[_0xe3aa('0x82')][_0xe3aa('0x83')];return db[_0xe3aa('0x4e')][_0xe3aa('0x66')]({'where':{'id':_0xeb01f8[_0xe3aa('0x65')]['id']}})[_0xe3aa('0x1e')](handleEntityNotFound(_0x327c76,null))[_0xe3aa('0x1e')](saveUpdates(_0xeb01f8[_0xe3aa('0x69')],null))[_0xe3aa('0x1e')](respondWithResult(_0x327c76,null))[_0xe3aa('0x67')](handleError(_0x327c76,null));};exports['addSystemAvatar']=function(_0x1abd02,_0x191621){_0x1abd02[_0xe3aa('0x69')][_0xe3aa('0x88')]=_0x1abd02['file'][_0xe3aa('0x83')];return db[_0xe3aa('0x4e')][_0xe3aa('0x66')]({'where':{'id':_0x1abd02[_0xe3aa('0x65')]['id']}})[_0xe3aa('0x1e')](handleEntityNotFound(_0x191621,null))[_0xe3aa('0x1e')](saveUpdates(_0x1abd02[_0xe3aa('0x69')],null))['then'](respondWithResult(_0x191621,null))[_0xe3aa('0x67')](handleError(_0x191621,null));};exports[_0xe3aa('0x89')]=function(_0x15ec4f,_0x53002d){var _0x20d54c=path['join'](config[_0xe3aa('0x8a')],_0xe3aa('0x8b'));var _0x3b4ab7={'where':{'id':_0x15ec4f[_0xe3aa('0x65')]['id']},'attributes':['id',_0xe3aa('0x81')],'raw':!![]};var _0x20db3f=![];return require('../../config/license/util')['getLicense']()[_0xe3aa('0x1e')](function(_0x299cff){if(_0x299cff){_0x20db3f=_0x299cff[_0xe3aa('0x8c')];}})[_0xe3aa('0x1e')](function(){return db[_0xe3aa('0x4e')][_0xe3aa('0x66')](_0x3b4ab7);})['then'](handleEntityNotFound(_0x53002d,null))[_0xe3aa('0x1e')](function(_0x33795d){if(_0x33795d){if(!_[_0xe3aa('0x8d')](_0x33795d[_0xe3aa('0x81')])){if(fs[_0xe3aa('0x8e')](path[_0xe3aa('0x8f')](config[_0xe3aa('0x8a')],'server/files/images/logos/',_0x33795d[_0xe3aa('0x81')]))&&_0x20db3f){_0x20d54c=path[_0xe3aa('0x8f')](config[_0xe3aa('0x8a')],_0xe3aa('0x90'),_0x33795d[_0xe3aa('0x81')]);}}return _0x53002d[_0xe3aa('0x91')](_0x20d54c);}})['catch'](handleError(_0x53002d,null));};exports[_0xe3aa('0x92')]=function(_0x1c0d66,_0x3bfa8a){var _0x12fd8b=path['join'](config['root'],_0xe3aa('0x93'));var _0x1221e2={'where':{'id':_0x1c0d66[_0xe3aa('0x65')]['id']},'attributes':['id',_0xe3aa('0x85')],'raw':!![]};return db[_0xe3aa('0x4e')][_0xe3aa('0x66')](_0x1221e2)['then'](handleEntityNotFound(_0x3bfa8a,null))[_0xe3aa('0x1e')](function(_0x40879a){if(_0x40879a){if(!_[_0xe3aa('0x8d')](_0x40879a[_0xe3aa('0x85')])){if(fs['existsSync'](path[_0xe3aa('0x8f')](config['root'],_0xe3aa('0x94'),_0x40879a[_0xe3aa('0x85')]))){_0x12fd8b=path[_0xe3aa('0x8f')](config[_0xe3aa('0x8a')],_0xe3aa('0x94'),_0x40879a['agentAvatar']);}}return _0x3bfa8a[_0xe3aa('0x91')](_0x12fd8b);}})[_0xe3aa('0x67')](handleError(_0x3bfa8a,null));};exports[_0xe3aa('0x95')]=function(_0x5132dc,_0xcb288d){var _0x240ca0=path['join'](config['root'],_0xe3aa('0x96'));var _0x187c9d={'where':{'id':_0x5132dc['params']['id']},'attributes':['id',_0xe3aa('0x87'),_0xe3aa('0x97')],'raw':!![]};return db[_0xe3aa('0x4e')][_0xe3aa('0x66')](_0x187c9d)['then'](handleEntityNotFound(_0xcb288d,null))[_0xe3aa('0x1e')](function(_0x290c62){if(_0x290c62){if(!_[_0xe3aa('0x8d')](_0x290c62['customerAvatar'])){if(fs[_0xe3aa('0x8e')](path[_0xe3aa('0x8f')](config[_0xe3aa('0x8a')],_0xe3aa('0x94'),_0x290c62[_0xe3aa('0x87')]))&&_0x290c62[_0xe3aa('0x97')]){_0x240ca0=path['join'](config[_0xe3aa('0x8a')],_0xe3aa('0x94'),_0x290c62[_0xe3aa('0x87')]);}}return _0xcb288d[_0xe3aa('0x91')](_0x240ca0);}})[_0xe3aa('0x67')](handleError(_0xcb288d,null));};exports['getSystemAvatar']=function(_0x2e66e6,_0x1879cf){var _0x207b04=path[_0xe3aa('0x8f')](config['root'],_0xe3aa('0x98'));var _0x3f8acb={'where':{'id':_0x2e66e6[_0xe3aa('0x65')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xe3aa('0x4e')][_0xe3aa('0x66')](_0x3f8acb)[_0xe3aa('0x1e')](handleEntityNotFound(_0x1879cf,null))[_0xe3aa('0x1e')](function(_0x370fa8){if(_0x370fa8){if(!_[_0xe3aa('0x8d')](_0x370fa8[_0xe3aa('0x88')])){if(fs[_0xe3aa('0x8e')](path[_0xe3aa('0x8f')](config[_0xe3aa('0x8a')],_0xe3aa('0x94'),_0x370fa8[_0xe3aa('0x88')]))){_0x207b04=path[_0xe3aa('0x8f')](config[_0xe3aa('0x8a')],_0xe3aa('0x94'),_0x370fa8[_0xe3aa('0x88')]);}}return _0x1879cf['download'](_0x207b04);}})[_0xe3aa('0x67')](handleError(_0x1879cf,null));};function checkWebsiteInterval(_0x3734a3){var _0x9e4b13=_0x3734a3[_0xe3aa('0x99')];if(!_0x9e4b13){return Promise['resolve'](_0x3734a3);}var _0x219225=_0x3734a3[_0xe3aa('0x9a')]||undefined;return _0x9e4b13[_0xe3aa('0x9b')](_0x219225)[_0xe3aa('0x1e')](function(_0x5ed5b0){if(!_0x5ed5b0){throw new APIOutOfIntervalError();}return _0x3734a3;});}exports[_0xe3aa('0x9c')]=function(_0x4431f3,_0x38c1a9){var _0x154d01={'body':_0x4431f3[_0xe3aa('0x69')],'channel':'chat'};var _0x23175b=[];var _0x5c8ea4=[];var _0x329851={};var _0x12e7f9=![];if(_0x4431f3[_0xe3aa('0x69')]['id']){delete _0x4431f3[_0xe3aa('0x69')]['id'];}if(_[_0xe3aa('0x8d')](_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0x9d')])){throw new APIBadRequestError(_0xe3aa('0x9e'));}if(_[_0xe3aa('0x8d')](_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0x9f')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_['isEmpty'](_0x4431f3['body'][_0xe3aa('0x69')])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0x12585b=_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0x3a')]&&_0x4431f3['body'][_0xe3aa('0x3e')];return db['CmContact']['describe']()[_0xe3aa('0x1e')](function(_0x1c47c9){if(!_0x1c47c9){throw new Error(_0xe3aa('0xa0'));}_0x23175b=Object[_0xe3aa('0x53')](_0x1c47c9)[_0xe3aa('0x5c')](function(_0x1dfe39){return![_0xe3aa('0xa1'),_0xe3aa('0xa2')][_0xe3aa('0xa3')](_0x1dfe39);});_0x5c8ea4=Object[_0xe3aa('0x53')](_0x1c47c9)[_0xe3aa('0x5c')](function(_0x258faa){return![_0xe3aa('0xa1'),'updatedAt',_0xe3aa('0xa4'),_0xe3aa('0xa5')][_0xe3aa('0xa3')](_0x258faa);});if(!_['includes'](_0x5c8ea4,_0x4431f3['body'][_0xe3aa('0x9f')])){throw new APIBadRequestError(_0xe3aa('0xa6')+_0x5c8ea4[_0xe3aa('0x8f')](',\x20'));}_0x329851[_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0x9f')]]=_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0x9d')];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x4431f3['params']['id']},'include':[{'model':db[_0xe3aa('0xa7')],'as':_0xe3aa('0xa8'),'include':[{'model':db[_0xe3aa('0xa9')],'as':_0xe3aa('0xaa'),'where':_0x329851,'limit':0x1,'order':[[_0xe3aa('0xa2'),_0xe3aa('0xab')]]}]},{'model':db['ChatApplication'],'as':_0xe3aa('0xac')},{'model':db[_0xe3aa('0x99')],'as':_0xe3aa('0x99'),'include':[{'model':db['Interval'],'as':_0xe3aa('0xad'),'attributes':['id',_0xe3aa('0xae')],'raw':!![]}]}]});})[_0xe3aa('0x1e')](function(_0x50925b){if(!_0x50925b){throw new APINotFoundError(util[_0xe3aa('0x40')](_0xe3aa('0xaf'),_0x4431f3[_0xe3aa('0x65')]['id']));}if(_0x12585b){return checkWebsiteInterval(_0x50925b);}return _0x50925b;})[_0xe3aa('0x1e')](function(_0x3c654a){_0x154d01[_0xe3aa('0xb0')]=_0x3c654a;_0x154d01[_0xe3aa('0xb1')]=_['orderBy'](_0x3c654a[_0xe3aa('0xac')],['priority'],[_0xe3aa('0xb2')]);if(_0x154d01['account'][_0xe3aa('0xac')]){delete _0x154d01[_0xe3aa('0xb0')]['Applications'];}_0x154d01['list']=_0x3c654a[_0xe3aa('0xa8')]||{'id':_0x3c654a[_0xe3aa('0xa5')]};if(_0x154d01[_0xe3aa('0xb3')]&&_0x154d01[_0xe3aa('0xb3')][_0xe3aa('0xaa')][_0xe3aa('0x58')]){return _0x154d01[_0xe3aa('0xb3')]['Contacts'][0x0];}var _0x20f83a=_[_0xe3aa('0x16')](_0x4431f3[_0xe3aa('0x69')],{'firstName':_0x4431f3['body'][_0xe3aa('0x9d')],'ListId':_0x3c654a['ListId']});_0x20f83a[_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0x9f')]]=_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0x9d')];return db[_0xe3aa('0xa9')][_0xe3aa('0x68')](_0x20f83a,{'fields':_0x23175b,'raw':!![]});})['then'](function(_0x1f06db){_0x154d01['contact']=_0x1f06db;var _0x1a1c03=createInteractionObject(_0x4431f3[_0xe3aa('0x65')]['id'],_0x4431f3[_0xe3aa('0x69')],_0x4431f3[_0xe3aa('0xb4')],_0x1f06db);var _0x345b2a={'ChatWebsiteId':_0x4431f3['params']['id']};if(_0x4431f3[_0xe3aa('0x69')]['threadId']){_0x345b2a[_0xe3aa('0xb5')]=_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0xb5')];_0x345b2a[_0xe3aa('0xb6')]=![];return db['ChatInteraction'][_0xe3aa('0x66')]({'where':_0x345b2a})['then'](function(_0x6bddd4){var _0x11699a=_0x4431f3['body'][_0xe3aa('0x3a')]&&_0x4431f3[_0xe3aa('0x69')]['referer'];if(_0x6bddd4){_0x12e7f9=!![];return _0x6bddd4;}else if(!_0x11699a&&_0x6bddd4&&_0x6bddd4[_0xe3aa('0xb6')]){throw new APIConflictError(_0xe3aa('0xb7'));}_0x1a1c03['threadId']=_0x4431f3['body'][_0xe3aa('0xb5')];_0x1a1c03['externalUrl']=_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0xb8')];return db[_0xe3aa('0xb9')][_0xe3aa('0x68')](_0x1a1c03);});}_0x345b2a[_0xe3aa('0xba')]=_0x1f06db['id'];if(_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0xbb')]&&_0x4431f3['body'][_0xe3aa('0xbb')]['id']){_0x345b2a['id']=_0x4431f3['body'][_0xe3aa('0xbb')]['id'];return db[_0xe3aa('0xb9')][_0xe3aa('0x66')]({'where':_0x345b2a})[_0xe3aa('0x1e')](function(_0x2b418b){var _0x245045=_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0x3a')]&&_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0x3e')];if(!_0x245045&&_0x2b418b&&_0x2b418b[_0xe3aa('0xb6')]){throw new APIConflictError(_0xe3aa('0xb7'));}else if(_0x2b418b){_0x12e7f9=!![];return _0x2b418b;}else{return db[_0xe3aa('0xb9')][_0xe3aa('0x68')](_0x1a1c03);}});}return db[_0xe3aa('0xb9')][_0xe3aa('0x68')](_0x1a1c03);})[_0xe3aa('0x1e')](function(_0x4b2434){if(!_0x12e7f9){return _0x4b2434;}var _0x5829ab={'from':(_0x154d01['contact'][_0xe3aa('0x3c')]||'')+'\x20'+(_0x154d01[_0xe3aa('0xbc')][_0xe3aa('0xbd')]||'')};if(_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0xb5')]&&_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0xbe')]&&_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0xb5')]!=_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0xbe')]){_0x5829ab[_0xe3aa('0xb5')]=_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0xbe')];}return _0x4b2434['update'](_0x5829ab);})[_0xe3aa('0x1e')](function(_0x358992){_0x154d01[_0xe3aa('0xbb')]=_0x358992[_0xe3aa('0x32')]({'plain':!![]});_0x154d01['interaction'][_0xe3aa('0xbf')]=!_0x12e7f9;if(_0x154d01[_0xe3aa('0xbb')][_0xe3aa('0xbf')]){if(_0x154d01[_0xe3aa('0xb0')][_0xe3aa('0xc0')]){_0x154d01[_0xe3aa('0xb1')][_0xe3aa('0xc1')]({'id':0x0,'priority':_0x154d01[_0xe3aa('0xb1')][_0xe3aa('0x58')]+0x1,'app':_0xe3aa('0xc2'),'appdata':_0xe3aa('0xc3'),'interval':'*,*,*,*'});}}return db[_0xe3aa('0xc4')]['create']({'body':_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0x69')],'ChatWebsiteId':_0x4431f3[_0xe3aa('0x65')]['id'],'ChatInteractionId':_0x358992['id'],'direction':'in','ContactId':_0x154d01[_0xe3aa('0xbc')]['id'],'AttachmentId':_0x4431f3[_0xe3aa('0x69')][_0xe3aa('0xc5')]});})[_0xe3aa('0x1e')](function(_0x862ac3){_0x154d01[_0xe3aa('0x25')]=_0x862ac3;if(!_0x154d01['interaction'][_0xe3aa('0xc6')]){return;}return db[_0xe3aa('0xc7')][_0xe3aa('0x66')]({'attributes':['id','name'],'where':{'id':_0x154d01[_0xe3aa('0xbb')][_0xe3aa('0xc6')]}});})[_0xe3aa('0x1e')](function(_0x5cf8f7){if(_0x5cf8f7){_0x154d01[_0xe3aa('0xb1')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5cf8f7[_0xe3aa('0x3f')]+','+(_0x154d01[_0xe3aa('0xb0')][_0xe3aa('0xc8')]||0xa),'interval':_0xe3aa('0xc9')});_0x154d01[_0xe3aa('0xca')]=!![];}if(!_0x154d01['interaction']['queueId']){return;}return db[_0xe3aa('0xcb')]['find']({'attributes':['id','name'],'where':{'id':_0x154d01['interaction'][_0xe3aa('0xcc')]}});})[_0xe3aa('0x1e')](function(_0x82f0d7){if(_0x82f0d7){_0x154d01['applications'][_0xe3aa('0xcd')]({'id':0x0,'priority':0x1,'app':_0xe3aa('0xce'),'appdata':_0x82f0d7[_0xe3aa('0x3f')]+','+(_0x154d01[_0xe3aa('0xb0')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xe3aa('0xcf'),_0xe3aa('0xd0'),_0x154d01);})['then'](function(_0x209024){respondWithRpcPromise('EventManager',_0xe3aa('0xd1'),{'event':_0xe3aa('0x9c'),'message':_0x209024},client9002);return _0x209024;})['then'](respondWithResult(_0x38c1a9,null))['catch'](APIHandleError(_0x38c1a9));};exports['offline']=function(_0x307870,_0x502696){var _0x33553d,_0x979de1,_0x2b2747;var _0x2b6bfa=[];var _0x5394b6={};var _0x30a862=_0x307870[_0xe3aa('0xd2')]||[];var _0xab41f9=[];var _0x15020e;return db[_0xe3aa('0xa9')][_0xe3aa('0x72')]()[_0xe3aa('0x1e')](function(_0x52f5fc){if(!_0x52f5fc){throw new db[(_0xe3aa('0xd3'))]['ValidationError']('no\x20available\x20attributes');}_0x2b6bfa=_[_0xe3aa('0xd4')](_[_0xe3aa('0x53')](_0x52f5fc),[_0xe3aa('0xa1'),'updatedAt',_0xe3aa('0xa4'),_0xe3aa('0xa5')]);if(_0x307870[_0xe3aa('0x69')]['id']){delete _0x307870[_0xe3aa('0x69')]['id'];}if(_[_0xe3aa('0x8d')](_0x307870[_0xe3aa('0x69')][_0xe3aa('0x9d')])){throw _0x502696[_0xe3aa('0x28')](0x1f4)[_0xe3aa('0x36')](new db[(_0xe3aa('0xd3'))][(_0xe3aa('0xd5'))](_0xe3aa('0xd6')));}if(_[_0xe3aa('0x8d')](_0x307870[_0xe3aa('0x69')][_0xe3aa('0x69')])||_0x307870['body'][_0xe3aa('0x69')]===''){throw _0x502696[_0xe3aa('0x28')](0x1f4)[_0xe3aa('0x36')](new db['Sequelize'][(_0xe3aa('0xd5'))](_0xe3aa('0xd7')));}if(_[_0xe3aa('0x8d')](_0x307870[_0xe3aa('0x69')][_0xe3aa('0xd8')])){throw _0x502696[_0xe3aa('0x28')](0x1f4)[_0xe3aa('0x36')](new db[(_0xe3aa('0xd3'))]['ValidationError'](_0xe3aa('0xd9')+_0x2b6bfa));}if(!_['includes'](_0x2b6bfa,_0x307870[_0xe3aa('0x69')][_0xe3aa('0xd8')])){throw _0x502696['status'](0x1f4)[_0xe3aa('0x36')](new db[(_0xe3aa('0xd3'))][(_0xe3aa('0xd5'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2b6bfa));}_0x5394b6[_0x307870[_0xe3aa('0x69')]['mapKeyOffline']]=_0x307870[_0xe3aa('0x69')]['from'];})[_0xe3aa('0x1e')](function(){return db[_0xe3aa('0x4e')][_0xe3aa('0x66')]({'where':{'id':_0x307870[_0xe3aa('0x65')]['id']},'include':[{'model':db[_0xe3aa('0xa7')],'as':_0xe3aa('0xa8')},{'model':db[_0xe3aa('0xda')],'as':_0xe3aa('0xda')}]});})[_0xe3aa('0x1e')](handleEntityNotFound(_0x502696,null))[_0xe3aa('0x1e')](function(_0x41ef2a){if(_0x41ef2a&&_0x41ef2a[_0xe3aa('0xa8')]){_0x979de1=_0x41ef2a;var _0x1a1a52=_['defaults'](_0x307870[_0xe3aa('0x69')],{'firstName':_0x307870[_0xe3aa('0x69')][_0xe3aa('0x9d')],'phone':_0x307870[_0xe3aa('0x69')]['from'],'ListId':_0x41ef2a[_0xe3aa('0xa5')]});_0x1a1a52[_0x307870[_0xe3aa('0x69')][_0xe3aa('0xd8')]]=_0x307870[_0xe3aa('0x69')]['from'];return db[_0xe3aa('0xa9')][_0xe3aa('0xdb')]({'where':_0x5394b6,'defaults':_0x1a1a52});}})['spread'](function(_0x8a7b25){if(_0x8a7b25){_0x2b2747=_0x8a7b25;var _0x4c2618=fs[_0xe3aa('0xdc')](path['join'](config[_0xe3aa('0x8a')],_0xe3aa('0xdd')),_0xe3aa('0xde'));var _0x302fa6=ejs['render'](_0x4c2618,{'body':_[_0xe3aa('0xdf')](_0x307870[_0xe3aa('0x69')]['body']),'bodyTitle':_0x979de1['offlineMessageBody']});return db[_0xe3aa('0xe0')]['create']({'body':_0x302fa6,'plainBody':htmlToText['fromString'](_0x302fa6),'ContactId':_0x8a7b25['id'],'ChatWebsiteId':_0x979de1['id']});}})['then'](function(_0x49b060){_0x15020e=_0x49b060;if(_0x30a862[_0xe3aa('0x58')]){var _0x4e349b=_0x30a862[_0xe3aa('0x4d')](function(_0x65691d){return{'name':_0x65691d[_0xe3aa('0xe1')],'basename':_0x65691d['filename'],'type':_0x65691d[_0xe3aa('0xe2')],'ChatOfflineMessageId':_0x49b060['id']};});_0xab41f9=_0x4e349b[_0xe3aa('0x4d')](_0x3f7c89=>{var _0x47e248={'filename':_0x3f7c89[_0xe3aa('0x3f')],'path':path['join'](config[_0xe3aa('0x8a')],'server',_0xe3aa('0xd2'),'attachments','offline-chat',_0x3f7c89['basename'])};return _0x47e248;});if(!_0x979de1[_0xe3aa('0xe3')]){return db[_0xe3aa('0xe4')][_0xe3aa('0xe5')](function(_0x4532f2){return db[_0xe3aa('0xe6')]['bulkCreate'](_0x4e349b,{'transaction':_0x4532f2});});}}})['then'](function(){if(_0x15020e){_0x33553d=_0x15020e;return db['MailAccount'][_0xe3aa('0xe7')]({'where':{'service':!![]},'include':[{'model':db[_0xe3aa('0xe8')],'as':_0xe3aa('0xe9'),'raw':!![],'include':[{'model':db[_0xe3aa('0xea')],'as':_0xe3aa('0xea'),'raw':!![]}]}]});}})[_0xe3aa('0x1e')](function(_0x41d0fb){if(_0x41d0fb&&_0x41d0fb['Smtp']&&_0x979de1[_0xe3aa('0xeb')]&&_0x979de1['forwardOfflineAddress']){var _0x10eb6e=_0x41d0fb[_0xe3aa('0xec')]();return respondWithRpcPromise(_0xe3aa('0xed'),_0xe3aa('0xee'),{'account':_0x10eb6e,'message':{'from':util[_0xe3aa('0x40')](_0xe3aa('0xef'),_0x41d0fb[_0xe3aa('0x3f')],_0x41d0fb[_0xe3aa('0xf0')]||_0x41d0fb[_0xe3aa('0xe9')]['user']),'to':_0x979de1['forwardOfflineAddress'],'subject':_0x979de1[_0xe3aa('0xf1')],'html':_0x33553d[_0xe3aa('0x69')],'attachments':_0xab41f9}},client9003)['then'](function(){return _0x33553d;})[_0xe3aa('0x67')](function(_0x2a03c0){logger['error'](_0x2a03c0);});}})[_0xe3aa('0x1e')](function(){if(_0x979de1&&_0x979de1[_0xe3aa('0xe3')]&&_0x979de1[_0xe3aa('0xf2')]){var _0x357408=[];if(_0x30a862[_0xe3aa('0x58')]){_0x357408=_0x30a862[_0xe3aa('0x4d')](function(_0x3d37e2){return{'name':_0x3d37e2[_0xe3aa('0xe1')],'basename':_0x3d37e2['filename'],'type':_0x3d37e2['mimetype'],'ChatOfflineMessageId':_0x15020e['id']};});}var _0x2249c1;if(!_[_0xe3aa('0x8d')](_0x979de1[_0xe3aa('0xf3')])){var _0x4248d3=_[_0xe3aa('0x4d')](_0x307870[_0xe3aa('0x69')],function(_0x3e8c80){return _0x3e8c80;});var _0x4e5c9c=_[_0xe3aa('0xf4')](_0x4248d3)[0x0];var _0x37843d=_[_0xe3aa('0xf5')](_0x4e5c9c,function(_0x2a5cdd){return _0x2a5cdd;});_0x2249c1=_0x37843d[0x1][_0x979de1[_0xe3aa('0xf3')]];}var _0x417ce6={'from':_0x2b2747[_0xe3aa('0xf0')],'firstName':_0x2b2747[_0xe3aa('0x3c')],'lastName':_0x2b2747[_0xe3aa('0xbd')],'mapKey':_0xe3aa('0xf0'),'message':{'from':_0x2b2747[_0xe3aa('0xf0')],'to':_0x979de1[_0xe3aa('0xda')]['email'],'cc':'','subject':_[_0xe3aa('0x8d')](_0x2249c1)?_0x979de1[_0xe3aa('0xf1')]:_0x2249c1,'messageId':'','sentAt':new Date(),'attach':_0x357408[_0xe3aa('0x58')],'attachments':_0x357408,'originChannel':_0xe3aa('0xf6'),'ChatWebsiteId':_0x979de1['id'],'ChatOfflineMessageId':_0x33553d['id'],'originTo':_0x979de1[_0xe3aa('0xda')][_0xe3aa('0xf0')]},'body':_0x33553d['body']};var _0x45086f={'account':{'id':_0x979de1['MailAccountId']},'body':_0x417ce6,'log':_0xe3aa('0xf7')};return respondWithRpcPromise('NotifyMailAccount',_0xe3aa('0xf8'),_0x45086f,client9001)['then'](function(){return _0x33553d;})[_0xe3aa('0x67')](function(_0x5c65ff){logger['error'](_0x5c65ff);});}return;})[_0xe3aa('0x1e')](function(){if(_0x33553d){return _0x33553d;}})['then'](respondWithResult(_0x502696,null))[_0xe3aa('0x67')](function(){for(var _0x5a3c3c of _0x30a862){var _0x52fa87=path[_0xe3aa('0x8f')](config[_0xe3aa('0x8a')],_0xe3aa('0xf9'),_0xe3aa('0xd2'),_0xe3aa('0xfa'),'offline-chat',_0x5a3c3c['filename']);fs_extra[_0xe3aa('0xfb')](_0x52fa87)[_0xe3aa('0x67')](function(_0x26438d){logger[_0xe3aa('0x23')](_0xe3aa('0xfc'),_0x52fa87,_0x26438d);});}});};exports[_0xe3aa('0xfd')]=function(_0x3a15e5,_0x3f1e08){return db['ChatInteraction'][_0xe3aa('0x66')]({'where':{'id':_0x3a15e5[_0xe3aa('0x65')]['id']}})[_0xe3aa('0x1e')](handleEntityNotFound(_0x3f1e08,null))[_0xe3aa('0x1e')](function(_0x39f7e3){if(_0x39f7e3){return _0x39f7e3['addInteraction'](_0x3a15e5[_0xe3aa('0x69')][_0xe3aa('0x7b')],_[_0xe3aa('0xfe')](_0x3a15e5['body'],[_0xe3aa('0x7b'),'id'])||{});}})[_0xe3aa('0x1e')](respondWithResult(_0x3f1e08,null))['catch'](handleError(_0x3f1e08,null));};exports[_0xe3aa('0xff')]=function(_0x2d6ff1,_0x481ef4){var _0x48bb72={'raw':![],'where':{}};var _0x1e2754={};var _0x4739f2={'count':0x0,'rows':[]};return db[_0xe3aa('0x4e')][_0xe3aa('0xe7')]({'where':{'id':_0x2d6ff1[_0xe3aa('0x65')]['id']}})['then'](handleEntityNotFound(_0x481ef4,null))['then'](function(_0x406212){if(_0x406212){_0x1e2754[_0xe3aa('0x46')]=_[_0xe3aa('0x53')](db['ChatInteraction'][_0xe3aa('0x4f')]);_0x1e2754[_0xe3aa('0x52')]=_['keys'](_0x2d6ff1[_0xe3aa('0x52')]);_0x1e2754[_0xe3aa('0x54')]=_[_0xe3aa('0x55')](_0x1e2754[_0xe3aa('0x46')],_0x1e2754[_0xe3aa('0x52')]);_0x48bb72[_0xe3aa('0x56')]=_[_0xe3aa('0x55')](_0x1e2754[_0xe3aa('0x46')],qs['fields'](_0x2d6ff1[_0xe3aa('0x52')]['fields']));_0x48bb72['attributes']=_0x48bb72[_0xe3aa('0x56')][_0xe3aa('0x58')]?_0x48bb72[_0xe3aa('0x56')]:_0x1e2754[_0xe3aa('0x46')];if(!_0x2d6ff1[_0xe3aa('0x52')][_0xe3aa('0x76')](_0xe3aa('0x59'))){_0x48bb72[_0xe3aa('0x2d')]=qs[_0xe3aa('0x2d')](_0x2d6ff1[_0xe3aa('0x52')]['limit']);_0x48bb72[_0xe3aa('0x5a')]=qs[_0xe3aa('0x5a')](_0x2d6ff1['query'][_0xe3aa('0x5a')]);}_0x48bb72['order']=qs[_0xe3aa('0x5b')](_0x2d6ff1[_0xe3aa('0x52')][_0xe3aa('0x5b')]);_0x48bb72[_0xe3aa('0x5e')]=qs[_0xe3aa('0x54')](_[_0xe3aa('0x7e')](_0x2d6ff1[_0xe3aa('0x52')],_0x1e2754[_0xe3aa('0x54')]));_0x48bb72['where'][_0xe3aa('0x78')]=_0x406212['id'];if(_0x2d6ff1[_0xe3aa('0x52')][_0xe3aa('0x5c')]){_0x48bb72[_0xe3aa('0x5e')]=_['merge'](_0x48bb72['where'],{'$or':_[_0xe3aa('0x4d')](_0x48bb72[_0xe3aa('0x56')],function(_0x17f47b){var _0x42a5de={};_0x42a5de[_0x17f47b]={'$like':'%'+_0x2d6ff1[_0xe3aa('0x52')]['filter']+'%'};return _0x42a5de;})});}_0x48bb72=_['merge']({},_0x48bb72,_0x2d6ff1['options']);return db[_0xe3aa('0xb9')][_0xe3aa('0x2c')]({'where':_0x48bb72[_0xe3aa('0x5e')]})['then'](function(_0x468e62){_0x4739f2[_0xe3aa('0x2c')]=_0x468e62;if(_0x2d6ff1['query'][_0xe3aa('0x61')]){_0x48bb72[_0xe3aa('0x62')]=[{'model':db[_0xe3aa('0xa9')],'as':_0xe3aa('0x100'),'required':![]},{'model':db[_0xe3aa('0xc7')],'as':'Owner','attributes':['name',_0xe3aa('0x101'),_0xe3aa('0x102')],'required':![]},{'model':db[_0xe3aa('0x103')],'as':'Tags','attributes':['id',_0xe3aa('0x3f'),_0xe3aa('0x104')],'where':_0x2d6ff1[_0xe3aa('0x52')][_0xe3aa('0x105')]?{'id':_0x2d6ff1[_0xe3aa('0x52')]['tag']}:undefined,'required':_0x2d6ff1['query']['tag']?!![]:![]}];}return db[_0xe3aa('0xb9')][_0xe3aa('0x79')](_0x48bb72);})[_0xe3aa('0x1e')](function(_0x1f7006){_0x4739f2[_0xe3aa('0x63')]=_0x1f7006;return _0x4739f2;});}})[_0xe3aa('0x1e')](respondWithFilteredResult(_0x481ef4,_0x48bb72))[_0xe3aa('0x67')](handleError(_0x481ef4,null));};exports[_0xe3aa('0x106')]=function(_0x293727,_0x5a9041){var _0x3d9475=0x0;var _0x134cc3=0x0;var _0x1db2f9=![];var _0x555616;var _0x43ca71;return db['ChatWebsite']['find']({'where':{'id':_0x293727[_0xe3aa('0x65')]['id']},'include':[{'model':db[_0xe3aa('0x99')],'as':_0xe3aa('0x99'),'include':[{'model':db[_0xe3aa('0x99')],'as':'Intervals','attributes':['id',_0xe3aa('0xae')]}]}]})[_0xe3aa('0x1e')](handleEntityNotFound(_0x5a9041,null))[_0xe3aa('0x1e')](function(_0x4eea4c){if(_0x4eea4c){_0x555616=_0x4eea4c;return _0x4eea4c[_0xe3aa('0x107')]({'raw':!![]});}})['then'](function(_0x2588b4){if(_0x555616){if(_0x2588b4){_0x43ca71=_0x2588b4;}}return require('../../config/license/util')[_0xe3aa('0x108')]();})[_0xe3aa('0x1e')](function(_0x521b61){if(_0x521b61){_0x134cc3=_0x521b61[_0xe3aa('0x109')];_0x1db2f9=_0x521b61[_0xe3aa('0x8c')];}})[_0xe3aa('0x1e')](function(){return db[_0xe3aa('0xb9')][_0xe3aa('0x2c')]({'where':{'closed':![]}});})['then'](function(_0x351e70){_0x3d9475=_0x351e70;if(_0x134cc3&&_0x351e70>_0x134cc3){return db[_0xe3aa('0x10a')][_0xe3aa('0xe7')]({'where':{'id':0x1}})['then'](function(_0x123f3b){if(_0x123f3b){_0x123f3b[_0xe3aa('0x10b')](_0xe3aa('0x10c'));}});}})[_0xe3aa('0x1e')](function(){var _0x44e176=_0x555616[_0xe3aa('0x99')];var _0x18ac97=_0x555616[_0xe3aa('0x9a')]||undefined;return _0x44e176?_0x44e176[_0xe3aa('0x9b')](_0x18ac97):!![];})[_0xe3aa('0x1e')](function(_0x41c6d3){var _0x2e75b1=fs[_0xe3aa('0xdc')](path['join'](config[_0xe3aa('0x8a')],_0xe3aa('0x10d')),_0xe3aa('0xde'));var _0x56e859=_0xe3aa('0x10e');var _0x28b7b1=![];try{const _0x274aa6=new URL(_0x555616[_0xe3aa('0x6a')]);_0x555616[_0xe3aa('0x6a')]=_0x274aa6[_0xe3aa('0x10f')];}catch(_0x216f15){}var _0x37b642;if(_0x293727['headers']['referer']){_0x293727[_0xe3aa('0xb4')][_0xe3aa('0x3e')]=_0x293727[_0xe3aa('0xb4')][_0xe3aa('0x3e')][_0xe3aa('0x110')](/\/$/,'');_0x37b642=wildcardUtils[_0xe3aa('0x111')](_0x555616[_0xe3aa('0x6a')],_0x293727['headers'][_0xe3aa('0x3e')]);}else{_0x293727[_0xe3aa('0xb4')][_0xe3aa('0x3e')]=_0x555616[_0xe3aa('0x6a')];_0x37b642=!![];}var _0x5003dc={'chatVersion':_0x56e859,'chatWebsiteAddressOrigin':_0x37b642?_0x293727[_0xe3aa('0xb4')][_0xe3aa('0x3e')]:_0x555616[_0xe3aa('0x6a')],'remote':_0x555616[_0xe3aa('0x112')],'query':querystring[_0xe3aa('0x22')](_['merge'](_0x555616[_0xe3aa('0x32')]({'plain':!![]}),{'customerIp':_0x293727['headers'][_0xe3aa('0x113')]||_0x293727[_0xe3aa('0xb4')][_0xe3aa('0x114')]||_0x293727['connection'][_0xe3aa('0x115')]||_0x293727['ip'],'referer':_0x293727[_0xe3aa('0xb4')]['referer'],'openedInteractions':_0x3d9475,'maxInteractions':_0x134cc3,'virtual':_0x1db2f9[_0xe3aa('0x109')],'online':_0x41c6d3,'custom':_0x1db2f9,'address':_0x37b642?_0x293727['headers']['referer']:null}))[_0xe3aa('0x110')](/'/g,'\x5c\x27')};_0x5a9041[_0xe3aa('0x36')](ejs[_0xe3aa('0x116')](Mustache[_0xe3aa('0x116')](_0x2e75b1,_0x5003dc),{'proactiveActions':_0x43ca71,'alignment':_0x555616[_0xe3aa('0x117')],'verticalAlignment':_0x555616[_0xe3aa('0x118')],'div_color':_0x555616[_0xe3aa('0x104')],'labelText':_0x555616['labelText'],'text_color':_0x555616[_0xe3aa('0x119')],'text_button_color':_0x555616[_0xe3aa('0x11a')],'button_color':_0x555616[_0xe3aa('0x11b')],'background_color':_0x555616[_0xe3aa('0x11c')],'hideWhenOffline':_0x555616['hideWhenOffline'],'intervalId':_0x555616['IntervalId'],'isDevelopment':_0x28b7b1,'chatVersion':_0x56e859}));})[_0xe3aa('0x67')](handleError(_0x5a9041,null));};exports[_0xe3aa('0x11d')]=function(_0x4fe879,_0x534f03){var _0x2506fb=_0x4fe879[_0xe3aa('0x65')]['id'];var _0x6c4770=_0x4fe879[_0xe3aa('0x69')];var _0x2a025d=0xc8;var _0x1ccd19=null;return db[_0xe3aa('0xe4')][_0xe3aa('0xe5')]({'isolationLevel':db[_0xe3aa('0xe4')][_0xe3aa('0x11e')][_0xe3aa('0x11f')][_0xe3aa('0x120')]},function(_0xd23b74){return db['ChatWebsite'][_0xe3aa('0xe7')]({'where':{'id':_0x2506fb},'transaction':_0xd23b74})[_0xe3aa('0x1e')](function(_0x5258e4){if(_0x5258e4){return db[_0xe3aa('0x121')]['destroy']({'where':{'ChatWebsiteId':_0x2506fb},'transaction':_0xd23b74})['then'](function(){var _0x25e39d=_['map'](_0x6c4770,function(_0x5b6b3a){_0x5b6b3a[_0xe3aa('0x78')]=_0x2506fb;return _0x5b6b3a;});return db[_0xe3aa('0x121')][_0xe3aa('0x122')](_0x25e39d,{'transaction':_0xd23b74});});}else{_0x2a025d=0x194;_0x1ccd19=[];}});})[_0xe3aa('0x1e')](function(){if(_0x2a025d!==0x194){return db['ChatApplication'][_0xe3aa('0x123')]({'where':{'ChatWebsiteId':_0x2506fb},'order':_0xe3aa('0x124')})[_0xe3aa('0x1e')](function(_0x105a14){_0x1ccd19=_0x105a14;});}})[_0xe3aa('0x67')](function(_0x248c26){_0x2a025d=0x1f4;logger[_0xe3aa('0x23')](_0x248c26[_0xe3aa('0x35')]);if(_0x248c26[_0xe3aa('0x3f')]){delete _0x248c26['name'];}_0x1ccd19=_0x248c26;})[_0xe3aa('0x125')](function(){if(_0x1ccd19===null){_0x534f03[_0xe3aa('0x34')](_0x2a025d);}else{if(_0x2a025d===0x1f4){_0x534f03[_0xe3aa('0x28')](_0x2a025d)['send'](_0x1ccd19);}else{_0x534f03[_0xe3aa('0x28')](_0x2a025d)[_0xe3aa('0x2a')](_0x1ccd19);}}});};exports[_0xe3aa('0x126')]=function(_0x4bb69c,_0x3a7c65){var _0x5f0bbe={};var _0x4dd045={};var _0x56e470;var _0x34b73a;return db[_0xe3aa('0x4e')][_0xe3aa('0xe7')]({'where':{'id':_0x4bb69c[_0xe3aa('0x65')]['id']}})[_0xe3aa('0x1e')](handleEntityNotFound(_0x3a7c65,null))[_0xe3aa('0x1e')](function(_0x2c3f36){if(_0x2c3f36){_0x56e470=_0x2c3f36;_0x4dd045[_0xe3aa('0x46')]=_['keys'](db[_0xe3aa('0x121')][_0xe3aa('0x4f')]);_0x4dd045[_0xe3aa('0x52')]=_[_0xe3aa('0x53')](_0x4bb69c[_0xe3aa('0x52')]);_0x4dd045[_0xe3aa('0x54')]=_['intersection'](_0x4dd045['model'],_0x4dd045[_0xe3aa('0x52')]);_0x5f0bbe['attributes']=_[_0xe3aa('0x55')](_0x4dd045[_0xe3aa('0x46')],qs[_0xe3aa('0x57')](_0x4bb69c[_0xe3aa('0x52')][_0xe3aa('0x57')]));_0x5f0bbe[_0xe3aa('0x56')]=_0x5f0bbe['attributes'][_0xe3aa('0x58')]?_0x5f0bbe[_0xe3aa('0x56')]:_0x4dd045['model'];_0x5f0bbe[_0xe3aa('0x77')]=qs['sort'](_0x4bb69c[_0xe3aa('0x52')]['sort']);_0x5f0bbe['where']=qs[_0xe3aa('0x54')](_['pick'](_0x4bb69c[_0xe3aa('0x52')],_0x4dd045[_0xe3aa('0x54')]));if(_0x4bb69c['query'][_0xe3aa('0x5c')]){_0x5f0bbe[_0xe3aa('0x5e')]=_[_0xe3aa('0x5d')](_0x5f0bbe[_0xe3aa('0x5e')],{'$or':_['map'](_0x5f0bbe[_0xe3aa('0x56')],function(_0x353527){var _0x2293e2={};_0x2293e2[_0x353527]={'$like':'%'+_0x4bb69c['query'][_0xe3aa('0x5c')]+'%'};return _0x2293e2;})});}_0x5f0bbe=_[_0xe3aa('0x5d')]({},_0x5f0bbe,_0x4bb69c[_0xe3aa('0x60')]);return _0x56e470[_0xe3aa('0x126')](_0x5f0bbe);}})['then'](function(_0x4a5c60){if(_0x4a5c60){_0x34b73a=_0x4a5c60[_0xe3aa('0x58')];if(!_0x4bb69c[_0xe3aa('0x52')][_0xe3aa('0x76')](_0xe3aa('0x59'))){_0x5f0bbe[_0xe3aa('0x2d')]=qs[_0xe3aa('0x2d')](_0x4bb69c[_0xe3aa('0x52')][_0xe3aa('0x2d')]);_0x5f0bbe[_0xe3aa('0x5a')]=qs['offset'](_0x4bb69c[_0xe3aa('0x52')]['offset']);}return _0x56e470[_0xe3aa('0x126')](_0x5f0bbe);}})['then'](function(_0x484593){if(_0x484593){return _0x484593?{'count':_0x34b73a,'rows':_0x484593}:null;}})[_0xe3aa('0x1e')](respondWithResult(_0x3a7c65,null))[_0xe3aa('0x67')](handleError(_0x3a7c65,null));};exports['addProactiveActions']=function(_0x37cb6d,_0x32085a){return db[_0xe3aa('0x127')][_0xe3aa('0x66')]({'where':{'id':_0x37cb6d[_0xe3aa('0x65')]['id']}})[_0xe3aa('0x1e')](handleEntityNotFound(_0x32085a,null))['then'](function(_0x275abd){if(_0x275abd){return _0x275abd[_0xe3aa('0x128')](_0x37cb6d[_0xe3aa('0x69')]['ids'],_[_0xe3aa('0xfe')](_0x37cb6d[_0xe3aa('0x69')],['ids','id'])||{});}})[_0xe3aa('0x1e')](respondWithResult(_0x32085a,null))[_0xe3aa('0x67')](handleError(_0x32085a,null));};exports[_0xe3aa('0x107')]=function(_0x1160dc,_0x101108){var _0x5bc5af={};var _0x36443b={};var _0x5eb62e;var _0x5112e8;return db['ChatWebsite'][_0xe3aa('0xe7')]({'where':{'id':_0x1160dc[_0xe3aa('0x65')]['id']}})[_0xe3aa('0x1e')](handleEntityNotFound(_0x101108,null))['then'](function(_0x2e7f77){if(_0x2e7f77){_0x5eb62e=_0x2e7f77;_0x36443b[_0xe3aa('0x46')]=_[_0xe3aa('0x53')](db[_0xe3aa('0x129')]['rawAttributes']);_0x36443b[_0xe3aa('0x52')]=_[_0xe3aa('0x53')](_0x1160dc[_0xe3aa('0x52')]);_0x36443b[_0xe3aa('0x54')]=_[_0xe3aa('0x55')](_0x36443b['model'],_0x36443b[_0xe3aa('0x52')]);_0x5bc5af[_0xe3aa('0x56')]=_[_0xe3aa('0x55')](_0x36443b[_0xe3aa('0x46')],qs[_0xe3aa('0x57')](_0x1160dc['query']['fields']));_0x5bc5af[_0xe3aa('0x56')]=_0x5bc5af[_0xe3aa('0x56')][_0xe3aa('0x58')]?_0x5bc5af[_0xe3aa('0x56')]:_0x36443b[_0xe3aa('0x46')];_0x5bc5af[_0xe3aa('0x77')]=qs[_0xe3aa('0x5b')](_0x1160dc[_0xe3aa('0x52')][_0xe3aa('0x5b')]);_0x5bc5af['where']=qs[_0xe3aa('0x54')](_[_0xe3aa('0x7e')](_0x1160dc[_0xe3aa('0x52')],_0x36443b[_0xe3aa('0x54')]));if(_0x1160dc[_0xe3aa('0x52')][_0xe3aa('0x5c')]){_0x5bc5af[_0xe3aa('0x5e')]=_[_0xe3aa('0x5d')](_0x5bc5af['where'],{'$or':_[_0xe3aa('0x4d')](_0x5bc5af[_0xe3aa('0x56')],function(_0x233057){var _0x1d644a={};_0x1d644a[_0x233057]={'$like':'%'+_0x1160dc[_0xe3aa('0x52')][_0xe3aa('0x5c')]+'%'};return _0x1d644a;})});}_0x5bc5af=_[_0xe3aa('0x5d')]({},_0x5bc5af,_0x1160dc[_0xe3aa('0x60')]);return _0x5eb62e[_0xe3aa('0x107')](_0x5bc5af);}})['then'](function(_0xc6e122){if(_0xc6e122){_0x5112e8=_0xc6e122[_0xe3aa('0x58')];if(!_0x1160dc['query'][_0xe3aa('0x76')](_0xe3aa('0x59'))){_0x5bc5af[_0xe3aa('0x2d')]=qs['limit'](_0x1160dc[_0xe3aa('0x52')][_0xe3aa('0x2d')]);_0x5bc5af[_0xe3aa('0x5a')]=qs[_0xe3aa('0x5a')](_0x1160dc[_0xe3aa('0x52')]['offset']);}return _0x5eb62e[_0xe3aa('0x107')](_0x5bc5af);}})['then'](function(_0x4a74dc){if(_0x4a74dc){return _0x4a74dc?{'count':_0x5112e8,'rows':_0x4a74dc}:null;}})[_0xe3aa('0x1e')](respondWithResult(_0x101108,null))[_0xe3aa('0x67')](handleError(_0x101108,null));};exports['getFields']=function(_0x14ef06,_0x7ea29b){var _0x407742=_0x14ef06[_0xe3aa('0x52')][_0xe3aa('0x12a')]==='false'?'offlineForm':_0xe3aa('0x12b');return db[_0xe3aa('0x4e')][_0xe3aa('0x66')]({'attributes':['id',_0x407742],'where':{'id':_0x14ef06[_0xe3aa('0x65')]['id']}})['then'](handleEntityNotFound(_0x7ea29b,null))[_0xe3aa('0x1e')](function(_0x3836f0){if(_0x3836f0){var _0x47c157=_0x3836f0[_0x407742];var _0x27d498=_0x47c157&&_0x47c157['items']?_0x47c157[_0xe3aa('0x12c')]:[];_0x7ea29b[_0xe3aa('0x36')]({'fromKey':_[_0xe3aa('0x8d')](_0x47c157[_0xe3aa('0x12d')])?undefined:_0x47c157['fromKey'],'count':_0x27d498[_0xe3aa('0x58')],'rows':_0x27d498});}})[_0xe3aa('0x67')](handleError(_0x7ea29b,null));};exports['getOfflineMessages']=function(_0x37fa13,_0x2bb59c){var _0x1706ff={'raw':![],'where':{}};var _0x33ee16={};var _0x325e74={'count':0x0,'rows':[]};return db[_0xe3aa('0x4e')][_0xe3aa('0xe7')]({'where':{'id':_0x37fa13[_0xe3aa('0x65')]['id']}})[_0xe3aa('0x1e')](handleEntityNotFound(_0x2bb59c,null))[_0xe3aa('0x1e')](function(_0x150062){if(_0x150062){_0x33ee16[_0xe3aa('0x46')]=_[_0xe3aa('0x53')](db[_0xe3aa('0xe0')][_0xe3aa('0x4f')]);_0x33ee16[_0xe3aa('0x52')]=_[_0xe3aa('0x53')](_0x37fa13[_0xe3aa('0x52')]);_0x33ee16[_0xe3aa('0x54')]=_[_0xe3aa('0x55')](_0x33ee16[_0xe3aa('0x46')],_0x33ee16[_0xe3aa('0x52')]);_0x1706ff[_0xe3aa('0x56')]=_[_0xe3aa('0x55')](_0x33ee16[_0xe3aa('0x46')],qs[_0xe3aa('0x57')](_0x37fa13[_0xe3aa('0x52')][_0xe3aa('0x57')]));_0x1706ff[_0xe3aa('0x56')]=_0x1706ff[_0xe3aa('0x56')][_0xe3aa('0x58')]?_0x1706ff[_0xe3aa('0x56')]:_0x33ee16[_0xe3aa('0x46')];if(!_0x37fa13[_0xe3aa('0x52')][_0xe3aa('0x76')]('nolimit')){_0x1706ff[_0xe3aa('0x2d')]=qs[_0xe3aa('0x2d')](_0x37fa13[_0xe3aa('0x52')][_0xe3aa('0x2d')]);_0x1706ff['offset']=qs[_0xe3aa('0x5a')](_0x37fa13['query'][_0xe3aa('0x5a')]);}_0x1706ff[_0xe3aa('0x77')]=qs[_0xe3aa('0x5b')](_0x37fa13[_0xe3aa('0x52')]['sort']);_0x1706ff[_0xe3aa('0x5e')]=qs[_0xe3aa('0x54')](_[_0xe3aa('0x7e')](_0x37fa13[_0xe3aa('0x52')],_0x33ee16['filters']));_0x1706ff[_0xe3aa('0x5e')][_0xe3aa('0x78')]=_0x150062['id'];if(_0x37fa13['query'][_0xe3aa('0x5c')]){_0x1706ff['where']=_['merge'](_0x1706ff[_0xe3aa('0x5e')],{'$or':_[_0xe3aa('0x4d')](_0x1706ff['attributes'],function(_0x135c8e){var _0x3572c6={};_0x3572c6[_0x135c8e]={'$like':'%'+_0x37fa13['query'][_0xe3aa('0x5c')]+'%'};return _0x3572c6;})});}_0x1706ff=_[_0xe3aa('0x5d')]({},_0x1706ff,_0x37fa13[_0xe3aa('0x60')]);return db[_0xe3aa('0xe0')][_0xe3aa('0x2c')]({'where':_0x1706ff[_0xe3aa('0x5e')]})[_0xe3aa('0x1e')](function(_0x445605){_0x325e74[_0xe3aa('0x2c')]=_0x445605;if(_0x37fa13[_0xe3aa('0x52')]['includeAll']){_0x1706ff[_0xe3aa('0x62')]=[{'all':!![]}];}else{_0x1706ff['include']=[{'model':db[_0xe3aa('0xa9')],'as':_0xe3aa('0x100'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xe3aa('0xe0')][_0xe3aa('0x79')](_0x1706ff);})['then'](function(_0x5ad30c){_0x325e74[_0xe3aa('0x63')]=_0x5ad30c;return _0x325e74;});}})['then'](respondWithFilteredResult(_0x2bb59c,_0x1706ff))['catch'](handleError(_0x2bb59c,null));};exports[_0xe3aa('0x12e')]=function(_0x3a81ab,_0x2f5ace){return db[_0xe3aa('0x4e')][_0xe3aa('0x66')]({'where':{'id':_0x3a81ab[_0xe3aa('0x65')]['id']}})['then'](handleEntityNotFound(_0x2f5ace,null))[_0xe3aa('0x1e')](function(_0x48983c){if(_0x48983c){return _0x48983c[_0xe3aa('0x12e')](_0x3a81ab['body']['ids'],_[_0xe3aa('0xfe')](_0x3a81ab[_0xe3aa('0x69')],['ids','id'])||{})[_0xe3aa('0x12f')](function(_0x840c40){for(var _0x13b3d7=0x0;_0x13b3d7<_0x3a81ab['body'][_0xe3aa('0x7b')][_0xe3aa('0x58')];_0x13b3d7+=0x1){socket[_0xe3aa('0x130')]('userChatWebsite:save',{'UserId':Number(_0x3a81ab[_0xe3aa('0x69')][_0xe3aa('0x7b')][_0x13b3d7]),'ChatWebsiteId':Number(_0x3a81ab[_0xe3aa('0x65')]['id'])});}return _0x840c40;});}})[_0xe3aa('0x1e')](respondWithResult(_0x2f5ace,null))[_0xe3aa('0x67')](handleError(_0x2f5ace,null));};exports[_0xe3aa('0x131')]=function(_0x3f083d,_0x4c17ed){return db[_0xe3aa('0x4e')][_0xe3aa('0x66')]({'where':{'id':_0x3f083d['params']['id']}})[_0xe3aa('0x1e')](handleEntityNotFound(_0x4c17ed,null))[_0xe3aa('0x1e')](function(_0xd79f59){if(_0xd79f59){return _0xd79f59['removeAgents'](_0x3f083d[_0xe3aa('0x52')][_0xe3aa('0x7b')])[_0xe3aa('0x1e')](function(){if(_[_0xe3aa('0x132')](_0x3f083d[_0xe3aa('0x52')][_0xe3aa('0x7b')])){for(var _0x32ed14=0x0;_0x32ed14<_0x3f083d[_0xe3aa('0x52')]['ids'][_0xe3aa('0x58')];_0x32ed14+=0x1){socket[_0xe3aa('0x130')](_0xe3aa('0x133'),{'UserId':Number(_0x3f083d[_0xe3aa('0x52')]['ids'][_0x32ed14]),'ChatWebsiteId':Number(_0x3f083d[_0xe3aa('0x65')]['id'])});}}else{socket['emit'](_0xe3aa('0x133'),{'UserId':Number(_0x3f083d[_0xe3aa('0x52')][_0xe3aa('0x7b')]),'ChatWebsiteId':Number(_0x3f083d[_0xe3aa('0x65')]['id'])});}});}})[_0xe3aa('0x1e')](respondWithStatusCode(_0x4c17ed,null))[_0xe3aa('0x67')](handleError(_0x4c17ed,null));};exports[_0xe3aa('0x134')]=function(_0x4f49c1,_0x270b58){var _0x308da2={};var _0x182eb8={};var _0x4a01e6;var _0x335d23;return db[_0xe3aa('0x4e')][_0xe3aa('0xe7')]({'where':{'id':_0x4f49c1[_0xe3aa('0x65')]['id']}})[_0xe3aa('0x1e')](handleEntityNotFound(_0x270b58,null))[_0xe3aa('0x1e')](function(_0x3337ee){if(_0x3337ee){_0x4a01e6=_0x3337ee;_0x182eb8['model']=_['keys'](db[_0xe3aa('0xc7')]['rawAttributes']);_0x182eb8['query']=_[_0xe3aa('0x53')](_0x4f49c1['query']);_0x182eb8['filters']=_['intersection'](_0x182eb8[_0xe3aa('0x46')],_0x182eb8[_0xe3aa('0x52')]);_0x308da2['attributes']=_[_0xe3aa('0x55')](_0x182eb8[_0xe3aa('0x46')],qs[_0xe3aa('0x57')](_0x4f49c1[_0xe3aa('0x52')][_0xe3aa('0x57')]));_0x308da2['attributes']=_0x308da2['attributes'][_0xe3aa('0x58')]?_0x308da2[_0xe3aa('0x56')]:_0x182eb8[_0xe3aa('0x46')];_0x308da2['order']=qs[_0xe3aa('0x5b')](_0x4f49c1[_0xe3aa('0x52')]['sort']);_0x308da2[_0xe3aa('0x5e')]=qs[_0xe3aa('0x54')](_[_0xe3aa('0x7e')](_0x4f49c1[_0xe3aa('0x52')],_0x182eb8[_0xe3aa('0x54')]));if(_0x4f49c1[_0xe3aa('0x52')][_0xe3aa('0x5c')]){_0x308da2[_0xe3aa('0x5e')]=_[_0xe3aa('0x5d')](_0x308da2[_0xe3aa('0x5e')],{'$or':_[_0xe3aa('0x4d')](_0x308da2[_0xe3aa('0x56')],function(_0x3e477a){var _0x34a262={};_0x34a262[_0x3e477a]={'$like':'%'+_0x4f49c1['query'][_0xe3aa('0x5c')]+'%'};return _0x34a262;})});}_0x308da2=_[_0xe3aa('0x5d')]({},_0x308da2,_0x4f49c1[_0xe3aa('0x60')]);return _0x4a01e6[_0xe3aa('0x134')](_0x308da2);}})[_0xe3aa('0x1e')](function(_0x1c5f46){if(_0x1c5f46){_0x335d23=_0x1c5f46['length'];if(!_0x4f49c1[_0xe3aa('0x52')][_0xe3aa('0x76')](_0xe3aa('0x59'))){_0x308da2[_0xe3aa('0x2d')]=qs[_0xe3aa('0x2d')](_0x4f49c1[_0xe3aa('0x52')]['limit']);_0x308da2['offset']=qs[_0xe3aa('0x5a')](_0x4f49c1['query'][_0xe3aa('0x5a')]);}return _0x4a01e6[_0xe3aa('0x134')](_0x308da2);}})['then'](function(_0x232b96){if(_0x232b96){return _0x232b96?{'count':_0x335d23,'rows':_0x232b96}:null;}})['then'](respondWithResult(_0x270b58,null))[_0xe3aa('0x67')](handleError(_0x270b58,null));}; \ No newline at end of file +var _0xcfce=['end','json','offset','undefined','limit','count','set','Content-Range','destroy','get','ChatWebsites','UserProfileResource','stack','name','user-agent-parser','setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','browser','version','format','unknown','%s\x20%s','device','model','vendor','%s\x20%s\x20%s','type','stringify','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','show','params','length','options','find','body','address','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','testWildcardValidity','describe','ChatWebsiteId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','agentAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','ifTime','notify','chat','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','CmContact','No\x20available\x20attributes','createdAt','includes','updatedAt','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','asc','list','defaults','contact','headers','threadId','closed','ChatInteraction','referer','externalUrl','ContactId','interaction','Writing\x20on\x20closed\x20interaction','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','waitForTheAssignedQueue','startRouting','offline','Sequelize','ValidationError','no\x20available\x20attributes','difference','from\x20is\x20mandatory','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','originalname','mimetype','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','getSnippet','Intervals','interval','virtual','chatLicenseExceeded','server/files/chat/iframe.ejs','3.9.0','origin','replace','testWebsiteWithWildcard','remote','connection','remoteAddress','render','alignment','verticalAlignment','color','textColor','textButtonColor','backgroundColor','hideWhenOffline','addApplications','transaction','Transaction','findAndCountAll','priority','finally','getApplications','chatProactiveAction','addProactiveActions','omit','getProactiveActions','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','User','getAgents','util','path','ejs','fs-extra','lodash','html-to-text','jayson/promise','../../components/parsers/qs','../../config/environment','../../errors/api','APIBadRequestError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','redis','localhost','register','client','http','then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','sendStatus','status'];(function(_0x3058b8,_0x5e12e1){var _0x282a80=function(_0x49bf6c){while(--_0x49bf6c){_0x3058b8['push'](_0x3058b8['shift']());}};_0x282a80(++_0x5e12e1);}(_0xcfce,0x115));var _0xecfc=function(_0x4bfaa7,_0x1033b0){_0x4bfaa7=_0x4bfaa7-0x0;var _0x282f8f=_0xcfce[_0x4bfaa7];return _0x282f8f;};'use strict';var Mustache=require('mustache');var util=require(_0xecfc('0x0'));var path=require(_0xecfc('0x1'));var ejs=require(_0xecfc('0x2'));var fs=require('fs');var fs_extra=require(_0xecfc('0x3'));var _=require(_0xecfc('0x4'));var querystring=require('querystring');var htmlToText=require(_0xecfc('0x5'));var Redis=require('ioredis');var jayson=require(_0xecfc('0x6'));var qs=require(_0xecfc('0x7'));var logger=require('../../config/logger')('api');var config=require(_0xecfc('0x8'));var APIBadRequestError=require(_0xecfc('0x9'))[_0xecfc('0xa')];var APINotFoundError=require(_0xecfc('0x9'))['APINotFoundError'];var APIOutOfIntervalError=require('../../errors/api')['APIOutOfIntervalError'];var APIHandleError=require('../../errors/api')[_0xecfc('0xb')];var APIConflictError=require(_0xecfc('0x9'))[_0xecfc('0xc')];var wildcardUtils=require(_0xecfc('0xd'));var URL=require(_0xecfc('0xe'))[_0xecfc('0xf')];var db=require('../../mysqldb')['db'];config[_0xecfc('0x10')]=_['defaults'](config[_0xecfc('0x10')],{'host':_0xecfc('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xecfc('0x10')]));require('./chatWebsite.socket')[_0xecfc('0x12')](socket);var client=jayson[_0xecfc('0x13')]['http']({'port':0x232c});var client9002=jayson[_0xecfc('0x13')][_0xecfc('0x14')]({'port':0x232a});var client9003=jayson[_0xecfc('0x13')][_0xecfc('0x14')]({'port':0x232b});var client9001=jayson[_0xecfc('0x13')][_0xecfc('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x46235f,_0x3e03aa,_0x328c26,_0xbdc7f4){return new Promise(function(_0xd66403,_0x44c785){var _0x52c8d2=_0xbdc7f4||client;return _0x52c8d2['request'](_0x46235f,_0x328c26)[_0xecfc('0x15')](function(_0x59bc0e){logger[_0xecfc('0x16')](_0xecfc('0x17'),_0x3e03aa,'request\x20sent');logger[_0xecfc('0x18')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3e03aa,_0xecfc('0x19'),JSON['stringify'](_0x59bc0e));if(_0x59bc0e['error']){if(_0x59bc0e[_0xecfc('0x1a')]['code']===0x1f4){logger[_0xecfc('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x3e03aa,_0x59bc0e[_0xecfc('0x1a')]['message']);return _0x44c785(_0x59bc0e[_0xecfc('0x1a')][_0xecfc('0x1b')]);}logger[_0xecfc('0x1a')](_0xecfc('0x17'),_0x3e03aa,_0x59bc0e[_0xecfc('0x1a')]['message']);return _0xd66403(_0x59bc0e[_0xecfc('0x1a')][_0xecfc('0x1b')]);}else{logger[_0xecfc('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x3e03aa,_0xecfc('0x19'));_0xd66403(_0x59bc0e['result']['message']);}})[_0xecfc('0x1c')](function(_0x594272){logger[_0xecfc('0x1a')](_0xecfc('0x17'),_0x3e03aa,_0x594272);_0x44c785(_0x594272);});});}function respondWithStatusCode(_0x157dd6,_0x2de944){_0x2de944=_0x2de944||0xcc;return function(_0x449562){if(_0x449562){return _0x157dd6[_0xecfc('0x1d')](_0x2de944);}return _0x157dd6[_0xecfc('0x1e')](_0x2de944)[_0xecfc('0x1f')]();};}function respondWithResult(_0x120646,_0x2b4d69){_0x2b4d69=_0x2b4d69||0xc8;return function(_0x35554c){if(_0x35554c){return _0x120646[_0xecfc('0x1e')](_0x2b4d69)[_0xecfc('0x20')](_0x35554c);}};}function respondWithFilteredResult(_0x5c58e2,_0x803acd){return function(_0x381547){if(_0x381547){var _0x1e2f51=typeof _0x803acd[_0xecfc('0x21')]===_0xecfc('0x22')&&typeof _0x803acd[_0xecfc('0x23')]===_0xecfc('0x22');var _0x408541=_0x381547[_0xecfc('0x24')];var _0x2a8eb1=_0x1e2f51?0x0:_0x803acd[_0xecfc('0x21')];var _0x382773=_0x1e2f51?_0x381547[_0xecfc('0x24')]:_0x803acd[_0xecfc('0x21')]+_0x803acd[_0xecfc('0x23')];var _0x3c12b2;if(_0x382773>=_0x408541){_0x382773=_0x408541;_0x3c12b2=0xc8;}else{_0x3c12b2=0xce;}_0x5c58e2[_0xecfc('0x1e')](_0x3c12b2);return _0x5c58e2[_0xecfc('0x25')](_0xecfc('0x26'),_0x2a8eb1+'-'+_0x382773+'/'+_0x408541)['json'](_0x381547);}return null;};}function saveUpdates(_0x495f86){return function(_0x31b77a){if(_0x31b77a){return _0x31b77a['update'](_0x495f86)[_0xecfc('0x15')](function(_0x242511){return _0x242511;});}return null;};}function removeEntity(_0x353947){return function(_0x1b75bf){if(_0x1b75bf){return _0x1b75bf[_0xecfc('0x27')]()[_0xecfc('0x15')](function(){var _0x10f33e=_0x1b75bf[_0xecfc('0x28')]({'plain':!![]});var _0x11abaa=_0xecfc('0x29');return db[_0xecfc('0x2a')][_0xecfc('0x27')]({'where':{'type':_0x11abaa,'resourceId':_0x10f33e['id']}})[_0xecfc('0x15')](function(){return _0x1b75bf;});})[_0xecfc('0x15')](function(){_0x353947[_0xecfc('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cdc72){return function(_0x397a18){if(!_0x397a18){_0x1cdc72[_0xecfc('0x1d')](0x194);}return _0x397a18;};}function handleError(_0x29873e,_0x36f2af){_0x36f2af=_0x36f2af||0x1f4;return function(_0x115f1f){logger[_0xecfc('0x1a')](_0x115f1f[_0xecfc('0x2b')]);if(_0x115f1f[_0xecfc('0x2c')]){delete _0x115f1f['name'];}_0x29873e['status'](_0x36f2af)['send'](_0x115f1f);};}function createInteractionObject(_0x48dc53,_0x27c3ff,_0x4043b6,_0x284b42){var _0x45dd1b=require(_0xecfc('0x2d'));var _0x1a9faa=new _0x45dd1b();var _0x9ec64c=_0x1a9faa[_0xecfc('0x2e')](_0x4043b6[_0xecfc('0x2f')])[_0xecfc('0x30')]();var _0x2e86b1=_0x27c3ff[_0xecfc('0x31')];if(_0x4043b6[_0xecfc('0x32')]){_0x2e86b1=_0x4043b6['cf-connecting-ip'];}else if(_0x4043b6[_0xecfc('0x33')]){_0x2e86b1=_[_0xecfc('0x34')](_0x4043b6['x-forwarded-for']['split'](','));}return{'ContactId':_0x284b42['id'],'ChatWebsiteId':_0x48dc53,'from':(_0x284b42[_0xecfc('0x35')]||'')+'\x20'+(_0x284b42[_0xecfc('0x36')]||''),'customerIp':_0x2e86b1,'customerPort':_0x4043b6[_0xecfc('0x37')]?_0x4043b6[_0xecfc('0x37')]:null,'referer':_0x27c3ff['referer'],'browserName':_0x9ec64c['browser']['name']&&_0x9ec64c[_0xecfc('0x38')][_0xecfc('0x39')]?util[_0xecfc('0x3a')]('%s\x20%s',_0x9ec64c['browser']['name'],_0x9ec64c[_0xecfc('0x38')][_0xecfc('0x39')]):_0xecfc('0x3b'),'browserVersion':_0x9ec64c[_0xecfc('0x38')][_0xecfc('0x39')]||_0xecfc('0x3b'),'osName':util[_0xecfc('0x3a')](_0xecfc('0x3c'),_0x9ec64c['os'][_0xecfc('0x2c')],_0x9ec64c['os']['version']),'osVersion':_0x9ec64c['os'][_0xecfc('0x39')],'deviceModel':_0x9ec64c[_0xecfc('0x3d')][_0xecfc('0x3e')]&&_0x9ec64c[_0xecfc('0x3d')][_0xecfc('0x3f')]?util[_0xecfc('0x3a')](_0xecfc('0x40'),_0x9ec64c[_0xecfc('0x3d')][_0xecfc('0x3e')],_0x9ec64c[_0xecfc('0x3d')][_0xecfc('0x3f')],_0x9ec64c[_0xecfc('0x3d')]['type']):null,'deviceVendor':_0x9ec64c[_0xecfc('0x3d')][_0xecfc('0x3f')],'deviceType':_0x9ec64c[_0xecfc('0x3d')][_0xecfc('0x41')],'formData':JSON[_0xecfc('0x42')](_0x27c3ff)};}exports[_0xecfc('0x43')]=function(_0x15b425,_0x42e235){var _0x242533={'include':[{'model':db[_0xecfc('0x44')],'as':_0xecfc('0x45')}]},_0x10f7b5={},_0x5a764a={'count':0x0,'rows':[]};var _0x693885=_[_0xecfc('0x46')](db[_0xecfc('0x47')][_0xecfc('0x48')],function(_0x3f43d0){return{'name':_0x3f43d0[_0xecfc('0x49')],'type':_0x3f43d0[_0xecfc('0x41')][_0xecfc('0x4a')]};});_0x10f7b5[_0xecfc('0x3e')]=_[_0xecfc('0x46')](_0x693885,_0xecfc('0x2c'));_0x10f7b5[_0xecfc('0x4b')]=_[_0xecfc('0x4c')](_0x15b425[_0xecfc('0x4b')]);_0x10f7b5[_0xecfc('0x4d')]=_[_0xecfc('0x4e')](_0x10f7b5[_0xecfc('0x3e')],_0x10f7b5[_0xecfc('0x4b')]);_0x242533[_0xecfc('0x4f')]=_[_0xecfc('0x4e')](_0x10f7b5[_0xecfc('0x3e')],qs[_0xecfc('0x50')](_0x15b425['query'][_0xecfc('0x50')]));_0x242533[_0xecfc('0x4f')]=_0x242533[_0xecfc('0x4f')]['length']?_0x242533[_0xecfc('0x4f')]:_0x10f7b5[_0xecfc('0x3e')];if(!_0x15b425[_0xecfc('0x4b')][_0xecfc('0x51')](_0xecfc('0x52'))){_0x242533['limit']=qs[_0xecfc('0x23')](_0x15b425[_0xecfc('0x4b')]['limit']);_0x242533['offset']=qs[_0xecfc('0x21')](_0x15b425['query']['offset']);}_0x242533[_0xecfc('0x53')]=qs[_0xecfc('0x54')](_0x15b425['query'][_0xecfc('0x54')]);_0x242533[_0xecfc('0x55')]=qs[_0xecfc('0x4d')](_[_0xecfc('0x56')](_0x15b425[_0xecfc('0x4b')],_0x10f7b5[_0xecfc('0x4d')]),_0x693885);if(_0x15b425[_0xecfc('0x4b')][_0xecfc('0x57')]){_0x242533[_0xecfc('0x55')]=_[_0xecfc('0x58')](_0x242533[_0xecfc('0x55')],{'$or':_['map'](_0x693885,function(_0x34a1f9){if(_0x34a1f9[_0xecfc('0x41')]!=='VIRTUAL'){var _0x2630b6={};_0x2630b6[_0x34a1f9[_0xecfc('0x2c')]]={'$like':'%'+_0x15b425['query'][_0xecfc('0x57')]+'%'};return _0x2630b6;}})});}_0x242533=_[_0xecfc('0x58')]({},_0x242533,_0x15b425['options']);var _0x2ebf93={'where':_0x242533['where']};return db[_0xecfc('0x47')]['count'](_0x2ebf93)[_0xecfc('0x15')](function(_0x55be49){_0x5a764a['count']=_0x55be49;if(_0x15b425['query'][_0xecfc('0x59')]){_0x242533[_0xecfc('0x5a')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x242533);})[_0xecfc('0x15')](function(_0x633ded){_0x5a764a[_0xecfc('0x5b')]=_0x633ded;return _0x5a764a;})[_0xecfc('0x15')](respondWithFilteredResult(_0x42e235,_0x242533))[_0xecfc('0x1c')](handleError(_0x42e235,null));};exports[_0xecfc('0x5c')]=function(_0x1b6db5,_0x60783d){var _0xf40d5b={'raw':![],'where':{'id':_0x1b6db5[_0xecfc('0x5d')]['id']},'include':[{'model':db[_0xecfc('0x44')],'as':_0xecfc('0x45')}]},_0x3b5db1={};_0x3b5db1[_0xecfc('0x3e')]=_[_0xecfc('0x4c')](db['ChatWebsite'][_0xecfc('0x48')]);_0x3b5db1[_0xecfc('0x4b')]=_[_0xecfc('0x4c')](_0x1b6db5[_0xecfc('0x4b')]);_0x3b5db1[_0xecfc('0x4d')]=_[_0xecfc('0x4e')](_0x3b5db1[_0xecfc('0x3e')],_0x3b5db1[_0xecfc('0x4b')]);_0xf40d5b[_0xecfc('0x4f')]=_[_0xecfc('0x4e')](_0x3b5db1[_0xecfc('0x3e')],qs[_0xecfc('0x50')](_0x1b6db5[_0xecfc('0x4b')][_0xecfc('0x50')]));_0xf40d5b[_0xecfc('0x4f')]=_0xf40d5b['attributes'][_0xecfc('0x5e')]?_0xf40d5b[_0xecfc('0x4f')]:_0x3b5db1[_0xecfc('0x3e')];if(_0x1b6db5[_0xecfc('0x4b')][_0xecfc('0x59')]){_0xf40d5b['include']=[{'all':!![]}];}_0xf40d5b=_[_0xecfc('0x58')]({},_0xf40d5b,_0x1b6db5[_0xecfc('0x5f')]);return db['ChatWebsite'][_0xecfc('0x60')](_0xf40d5b)['then'](handleEntityNotFound(_0x60783d,null))[_0xecfc('0x15')](respondWithResult(_0x60783d,null))['catch'](handleError(_0x60783d,null));};exports['create']=function(_0x3ef8b2,_0xea67e7){if(!wildcardUtils['testWildcardValidity'](_0x3ef8b2[_0xecfc('0x61')][_0xecfc('0x62')])){return handleError(_0xea67e7,null)(new APIBadRequestError('\x22'+_0x3ef8b2[_0xecfc('0x61')][_0xecfc('0x62')]+'\x22\x20is\x20not\x20a\x20valid\x20website\x20domain'));}return db['ChatWebsite'][_0xecfc('0x63')](_0x3ef8b2[_0xecfc('0x61')],{})[_0xecfc('0x15')](function(_0x4c96d0){var _0x131499=_0x3ef8b2[_0xecfc('0x64')][_0xecfc('0x28')]({'plain':!![]});if(!_0x131499)throw new Error(_0xecfc('0x65'));if(_0x131499[_0xecfc('0x66')]===_0xecfc('0x64')){var _0x126ad9=_0x4c96d0[_0xecfc('0x28')]({'plain':!![]});var _0x99d72d=_0xecfc('0x29');return db[_0xecfc('0x67')][_0xecfc('0x60')]({'where':{'name':_0x99d72d,'userProfileId':_0x131499[_0xecfc('0x68')]},'raw':!![]})[_0xecfc('0x15')](function(_0x534969){if(_0x534969&&_0x534969[_0xecfc('0x69')]===0x0){return db[_0xecfc('0x2a')][_0xecfc('0x63')]({'name':_0x126ad9[_0xecfc('0x2c')],'resourceId':_0x126ad9['id'],'type':_0x534969[_0xecfc('0x2c')],'sectionId':_0x534969['id']},{})[_0xecfc('0x15')](function(){return _0x4c96d0;});}else{return _0x4c96d0;}})[_0xecfc('0x1c')](function(_0x4868da){logger[_0xecfc('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4868da);throw _0x4868da;});}return _0x4c96d0;})[_0xecfc('0x15')](respondWithResult(_0xea67e7,0xc9))[_0xecfc('0x1c')](handleError(_0xea67e7,null));};exports[_0xecfc('0x6a')]=function(_0x3ad08e,_0x2744f2){if(!wildcardUtils[_0xecfc('0x6b')](_0x3ad08e['body'][_0xecfc('0x62')])){return handleError(_0x2744f2,null)(new APIBadRequestError('\x22'+_0x3ad08e[_0xecfc('0x61')]['address']+'\x22\x20is\x20not\x20a\x20valid\x20website\x20domain'));}if(_0x3ad08e[_0xecfc('0x61')]['id']){delete _0x3ad08e[_0xecfc('0x61')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x3ad08e['params']['id']},'include':[{'model':db[_0xecfc('0x44')],'as':_0xecfc('0x45')}]})['then'](handleEntityNotFound(_0x2744f2,null))[_0xecfc('0x15')](saveUpdates(_0x3ad08e['body'],null))[_0xecfc('0x15')](respondWithResult(_0x2744f2,null))[_0xecfc('0x1c')](handleError(_0x2744f2,null));};exports[_0xecfc('0x27')]=function(_0x23c031,_0xde8504){return db[_0xecfc('0x47')][_0xecfc('0x60')]({'where':{'id':_0x23c031['params']['id']}})[_0xecfc('0x15')](handleEntityNotFound(_0xde8504,null))[_0xecfc('0x15')](removeEntity(_0xde8504,null))[_0xecfc('0x1c')](handleError(_0xde8504,null));};exports[_0xecfc('0x6c')]=function(_0xd6fe69,_0x303fea){return db[_0xecfc('0x47')][_0xecfc('0x6c')]()['then'](respondWithResult(_0x303fea,null))[_0xecfc('0x1c')](handleError(_0x303fea,null));};exports['addDisposition']=function(_0x675dba,_0x565fe6){if(_0x675dba[_0xecfc('0x61')]['id']){delete _0x675dba[_0xecfc('0x61')]['id'];}return db['ChatWebsite'][_0xecfc('0x60')]({'where':{'id':_0x675dba[_0xecfc('0x5d')]['id']}})[_0xecfc('0x15')](handleEntityNotFound(_0x565fe6,null))[_0xecfc('0x15')](function(_0x331dde){if(_0x331dde){_0x675dba[_0xecfc('0x61')][_0xecfc('0x6d')]=_0x331dde['id'];return db[_0xecfc('0x6e')][_0xecfc('0x63')](_0x675dba[_0xecfc('0x61')]);}})[_0xecfc('0x15')](respondWithResult(_0x565fe6,null))[_0xecfc('0x1c')](handleError(_0x565fe6,null));};exports[_0xecfc('0x6f')]=function(_0x30e260,_0x391bf1){var _0x237071={'raw':![],'where':{}};var _0xb674e3={};var _0x5abb08={'count':0x0,'rows':[]};return db[_0xecfc('0x47')][_0xecfc('0x70')]({'where':{'id':_0x30e260['params']['id']}})[_0xecfc('0x15')](handleEntityNotFound(_0x391bf1,null))['then'](function(_0x1a2a76){if(_0x1a2a76){_0xb674e3[_0xecfc('0x3e')]=_['keys'](db[_0xecfc('0x6e')][_0xecfc('0x48')]);_0xb674e3[_0xecfc('0x4b')]=_[_0xecfc('0x4c')](_0x30e260[_0xecfc('0x4b')]);_0xb674e3[_0xecfc('0x4d')]=_['intersection'](_0xb674e3[_0xecfc('0x3e')],_0xb674e3[_0xecfc('0x4b')]);_0x237071[_0xecfc('0x4f')]=_['intersection'](_0xb674e3[_0xecfc('0x3e')],qs[_0xecfc('0x50')](_0x30e260[_0xecfc('0x4b')][_0xecfc('0x50')]));_0x237071[_0xecfc('0x4f')]=_0x237071[_0xecfc('0x4f')]['length']?_0x237071[_0xecfc('0x4f')]:_0xb674e3[_0xecfc('0x3e')];if(!_0x30e260[_0xecfc('0x4b')][_0xecfc('0x51')](_0xecfc('0x52'))){_0x237071[_0xecfc('0x23')]=qs[_0xecfc('0x23')](_0x30e260[_0xecfc('0x4b')][_0xecfc('0x23')]);_0x237071[_0xecfc('0x21')]=qs[_0xecfc('0x21')](_0x30e260[_0xecfc('0x4b')]['offset']);}_0x237071[_0xecfc('0x53')]=qs[_0xecfc('0x54')](_0x30e260['query']['sort']);_0x237071['where']=qs['filters'](_[_0xecfc('0x56')](_0x30e260[_0xecfc('0x4b')],_0xb674e3[_0xecfc('0x4d')]));_0x237071['where']['ChatWebsiteId']=_0x1a2a76['id'];if(_0x30e260['query'][_0xecfc('0x57')]){_0x237071[_0xecfc('0x55')]=_[_0xecfc('0x58')](_0x237071[_0xecfc('0x55')],{'$or':_['map'](_0x237071[_0xecfc('0x4f')],function(_0x417f5b){var _0xc334ac={};_0xc334ac[_0x417f5b]={'$like':'%'+_0x30e260['query']['filter']+'%'};return _0xc334ac;})});}_0x237071=_[_0xecfc('0x58')]({},_0x237071,_0x30e260['options']);return db[_0xecfc('0x6e')][_0xecfc('0x24')]({'where':_0x237071['where']})[_0xecfc('0x15')](function(_0x39a7e7){_0x5abb08[_0xecfc('0x24')]=_0x39a7e7;if(_0x30e260[_0xecfc('0x4b')][_0xecfc('0x59')]){_0x237071[_0xecfc('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0xecfc('0x71')](_0x237071);})['then'](function(_0x540df2){_0x5abb08[_0xecfc('0x5b')]=_0x540df2;return _0x5abb08;});}})[_0xecfc('0x15')](respondWithFilteredResult(_0x391bf1,_0x237071))[_0xecfc('0x1c')](handleError(_0x391bf1,null));};exports[_0xecfc('0x72')]=function(_0x22be92,_0x42ee28){return db['ChatWebsite']['find']({'where':{'id':_0x22be92[_0xecfc('0x5d')]['id']}})[_0xecfc('0x15')](handleEntityNotFound(_0x42ee28,null))[_0xecfc('0x15')](function(_0x4dfb95){if(_0x4dfb95){return _0x4dfb95[_0xecfc('0x72')](_0x22be92[_0xecfc('0x4b')][_0xecfc('0x73')]);}})[_0xecfc('0x15')](respondWithStatusCode(_0x42ee28,null))[_0xecfc('0x1c')](handleError(_0x42ee28,null));};exports['addAnswer']=function(_0xa4779a,_0x1ceeab){if(_0xa4779a[_0xecfc('0x61')]['id']){delete _0xa4779a[_0xecfc('0x61')]['id'];}return db[_0xecfc('0x47')][_0xecfc('0x60')]({'where':{'id':_0xa4779a['params']['id']}})[_0xecfc('0x15')](handleEntityNotFound(_0x1ceeab,null))[_0xecfc('0x15')](function(_0x5273a8){if(_0x5273a8){_0xa4779a[_0xecfc('0x61')][_0xecfc('0x6d')]=_0x5273a8['id'];return db['CannedAnswer']['create'](_0xa4779a[_0xecfc('0x61')]);}})[_0xecfc('0x15')](respondWithResult(_0x1ceeab,null))[_0xecfc('0x1c')](handleError(_0x1ceeab,null));};exports[_0xecfc('0x74')]=function(_0x57889f,_0x2811ea){var _0x48ab0f={'raw':![],'where':{}};var _0x551038={};var _0x22126d={'count':0x0,'rows':[]};return db[_0xecfc('0x47')][_0xecfc('0x70')]({'where':{'id':_0x57889f[_0xecfc('0x5d')]['id']}})[_0xecfc('0x15')](handleEntityNotFound(_0x2811ea,null))[_0xecfc('0x15')](function(_0x19ab28){if(_0x19ab28){_0x551038[_0xecfc('0x3e')]=_[_0xecfc('0x4c')](db[_0xecfc('0x75')][_0xecfc('0x48')]);_0x551038[_0xecfc('0x4b')]=_[_0xecfc('0x4c')](_0x57889f['query']);_0x551038['filters']=_['intersection'](_0x551038['model'],_0x551038[_0xecfc('0x4b')]);_0x48ab0f[_0xecfc('0x4f')]=_[_0xecfc('0x4e')](_0x551038[_0xecfc('0x3e')],qs[_0xecfc('0x50')](_0x57889f[_0xecfc('0x4b')][_0xecfc('0x50')]));_0x48ab0f[_0xecfc('0x4f')]=_0x48ab0f[_0xecfc('0x4f')][_0xecfc('0x5e')]?_0x48ab0f[_0xecfc('0x4f')]:_0x551038['model'];if(!_0x57889f[_0xecfc('0x4b')][_0xecfc('0x51')](_0xecfc('0x52'))){_0x48ab0f[_0xecfc('0x23')]=qs[_0xecfc('0x23')](_0x57889f[_0xecfc('0x4b')][_0xecfc('0x23')]);_0x48ab0f[_0xecfc('0x21')]=qs[_0xecfc('0x21')](_0x57889f['query'][_0xecfc('0x21')]);}_0x48ab0f[_0xecfc('0x53')]=qs[_0xecfc('0x54')](_0x57889f[_0xecfc('0x4b')]['sort']);_0x48ab0f[_0xecfc('0x55')]=qs[_0xecfc('0x4d')](_[_0xecfc('0x56')](_0x57889f[_0xecfc('0x4b')],_0x551038[_0xecfc('0x4d')]));_0x48ab0f[_0xecfc('0x55')][_0xecfc('0x6d')]=_0x19ab28['id'];if(_0x57889f[_0xecfc('0x4b')][_0xecfc('0x57')]){_0x48ab0f['where']=_[_0xecfc('0x58')](_0x48ab0f['where'],{'$or':_[_0xecfc('0x46')](_0x48ab0f[_0xecfc('0x4f')],function(_0x2b346e){var _0x7c906a={};_0x7c906a[_0x2b346e]={'$like':'%'+_0x57889f[_0xecfc('0x4b')]['filter']+'%'};return _0x7c906a;})});}_0x48ab0f=_['merge']({},_0x48ab0f,_0x57889f['options']);return db[_0xecfc('0x75')][_0xecfc('0x24')]({'where':_0x48ab0f[_0xecfc('0x55')]})[_0xecfc('0x15')](function(_0x569a83){_0x22126d['count']=_0x569a83;if(_0x57889f['query']['includeAll']){_0x48ab0f['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xecfc('0x71')](_0x48ab0f);})[_0xecfc('0x15')](function(_0x504eed){_0x22126d[_0xecfc('0x5b')]=_0x504eed;return _0x22126d;});}})[_0xecfc('0x15')](respondWithFilteredResult(_0x2811ea,_0x48ab0f))[_0xecfc('0x1c')](handleError(_0x2811ea,null));};exports[_0xecfc('0x76')]=function(_0xa0d3a,_0x264bf0){return db[_0xecfc('0x47')][_0xecfc('0x60')]({'where':{'id':_0xa0d3a['params']['id']}})['then'](handleEntityNotFound(_0x264bf0,null))[_0xecfc('0x15')](function(_0x76872a){if(_0x76872a){return _0x76872a[_0xecfc('0x76')](_0xa0d3a[_0xecfc('0x4b')][_0xecfc('0x73')]);}})[_0xecfc('0x15')](respondWithStatusCode(_0x264bf0,null))[_0xecfc('0x1c')](handleError(_0x264bf0,null));};exports[_0xecfc('0x77')]=function(_0x1c86e9,_0x50b2fa){_0x1c86e9[_0xecfc('0x61')][_0xecfc('0x78')]=_0x1c86e9[_0xecfc('0x79')]['filename'];return db[_0xecfc('0x47')][_0xecfc('0x60')]({'where':{'id':_0x1c86e9[_0xecfc('0x5d')]['id']}})[_0xecfc('0x15')](handleEntityNotFound(_0x50b2fa,null))[_0xecfc('0x15')](saveUpdates(_0x1c86e9[_0xecfc('0x61')],null))[_0xecfc('0x15')](respondWithResult(_0x50b2fa,null))[_0xecfc('0x1c')](handleError(_0x50b2fa,null));};exports['addAvatar']=function(_0x29d98f,_0x187310){_0x29d98f[_0xecfc('0x61')]['agentAvatar']=_0x29d98f[_0xecfc('0x79')][_0xecfc('0x7a')];return db[_0xecfc('0x47')][_0xecfc('0x60')]({'where':{'id':_0x29d98f[_0xecfc('0x5d')]['id']}})['then'](handleEntityNotFound(_0x187310,null))[_0xecfc('0x15')](saveUpdates(_0x29d98f[_0xecfc('0x61')],null))[_0xecfc('0x15')](respondWithResult(_0x187310,null))[_0xecfc('0x1c')](handleError(_0x187310,null));};exports[_0xecfc('0x7b')]=function(_0x432889,_0x5d081d){_0x432889[_0xecfc('0x61')][_0xecfc('0x7c')]=_0x432889[_0xecfc('0x79')][_0xecfc('0x7a')];return db[_0xecfc('0x47')][_0xecfc('0x60')]({'where':{'id':_0x432889[_0xecfc('0x5d')]['id']}})[_0xecfc('0x15')](handleEntityNotFound(_0x5d081d,null))[_0xecfc('0x15')](saveUpdates(_0x432889[_0xecfc('0x61')],null))[_0xecfc('0x15')](respondWithResult(_0x5d081d,null))[_0xecfc('0x1c')](handleError(_0x5d081d,null));};exports[_0xecfc('0x7d')]=function(_0x4d7713,_0x26bca4){_0x4d7713[_0xecfc('0x61')][_0xecfc('0x7e')]=_0x4d7713[_0xecfc('0x79')][_0xecfc('0x7a')];return db[_0xecfc('0x47')][_0xecfc('0x60')]({'where':{'id':_0x4d7713[_0xecfc('0x5d')]['id']}})[_0xecfc('0x15')](handleEntityNotFound(_0x26bca4,null))[_0xecfc('0x15')](saveUpdates(_0x4d7713['body'],null))[_0xecfc('0x15')](respondWithResult(_0x26bca4,null))[_0xecfc('0x1c')](handleError(_0x26bca4,null));};exports[_0xecfc('0x7f')]=function(_0x4492be,_0x4f6456){var _0x44c649=path[_0xecfc('0x80')](config[_0xecfc('0x81')],_0xecfc('0x82'));var _0x3251b9={'where':{'id':_0x4492be[_0xecfc('0x5d')]['id']},'attributes':['id',_0xecfc('0x78')],'raw':!![]};var _0x15b44f=![];return require(_0xecfc('0x83'))[_0xecfc('0x84')]()[_0xecfc('0x15')](function(_0x55a8aa){if(_0x55a8aa){_0x15b44f=_0x55a8aa[_0xecfc('0x85')];}})[_0xecfc('0x15')](function(){return db[_0xecfc('0x47')][_0xecfc('0x60')](_0x3251b9);})[_0xecfc('0x15')](handleEntityNotFound(_0x4f6456,null))[_0xecfc('0x15')](function(_0x1b66ad){if(_0x1b66ad){if(!_[_0xecfc('0x86')](_0x1b66ad[_0xecfc('0x78')])){if(fs[_0xecfc('0x87')](path[_0xecfc('0x80')](config[_0xecfc('0x81')],_0xecfc('0x88'),_0x1b66ad['sitepic']))&&_0x15b44f){_0x44c649=path[_0xecfc('0x80')](config[_0xecfc('0x81')],'server/files/images/logos/',_0x1b66ad[_0xecfc('0x78')]);}}return _0x4f6456['download'](_0x44c649);}})[_0xecfc('0x1c')](handleError(_0x4f6456,null));};exports[_0xecfc('0x89')]=function(_0x1c1c52,_0x46e0d1){var _0x1a9cc6=path['join'](config['root'],'server/files/images/avatars/default_avatar.png');var _0x45f68a={'where':{'id':_0x1c1c52['params']['id']},'attributes':['id',_0xecfc('0x8a')],'raw':!![]};return db[_0xecfc('0x47')]['find'](_0x45f68a)[_0xecfc('0x15')](handleEntityNotFound(_0x46e0d1,null))[_0xecfc('0x15')](function(_0x21093e){if(_0x21093e){if(!_[_0xecfc('0x86')](_0x21093e[_0xecfc('0x8a')])){if(fs[_0xecfc('0x87')](path[_0xecfc('0x80')](config[_0xecfc('0x81')],_0xecfc('0x8b'),_0x21093e[_0xecfc('0x8a')]))){_0x1a9cc6=path[_0xecfc('0x80')](config['root'],'server/files/images/avatars/',_0x21093e[_0xecfc('0x8a')]);}}return _0x46e0d1[_0xecfc('0x8c')](_0x1a9cc6);}})[_0xecfc('0x1c')](handleError(_0x46e0d1,null));};exports[_0xecfc('0x8d')]=function(_0x299b45,_0xd0e9a0){var _0x23fe25=path[_0xecfc('0x80')](config[_0xecfc('0x81')],_0xecfc('0x8e'));var _0xb87995={'where':{'id':_0x299b45[_0xecfc('0x5d')]['id']},'attributes':['id','customerAvatar',_0xecfc('0x8f')],'raw':!![]};return db[_0xecfc('0x47')]['find'](_0xb87995)['then'](handleEntityNotFound(_0xd0e9a0,null))[_0xecfc('0x15')](function(_0x4be8ad){if(_0x4be8ad){if(!_[_0xecfc('0x86')](_0x4be8ad[_0xecfc('0x7c')])){if(fs[_0xecfc('0x87')](path[_0xecfc('0x80')](config[_0xecfc('0x81')],_0xecfc('0x8b'),_0x4be8ad[_0xecfc('0x7c')]))&&_0x4be8ad[_0xecfc('0x8f')]){_0x23fe25=path[_0xecfc('0x80')](config['root'],_0xecfc('0x8b'),_0x4be8ad[_0xecfc('0x7c')]);}}return _0xd0e9a0[_0xecfc('0x8c')](_0x23fe25);}})[_0xecfc('0x1c')](handleError(_0xd0e9a0,null));};exports[_0xecfc('0x90')]=function(_0x21f34c,_0x1a2284){var _0x17f698=path[_0xecfc('0x80')](config[_0xecfc('0x81')],_0xecfc('0x91'));var _0x221f46={'where':{'id':_0x21f34c[_0xecfc('0x5d')]['id']},'attributes':['id',_0xecfc('0x7e')],'raw':!![]};return db[_0xecfc('0x47')][_0xecfc('0x60')](_0x221f46)['then'](handleEntityNotFound(_0x1a2284,null))[_0xecfc('0x15')](function(_0x480944){if(_0x480944){if(!_[_0xecfc('0x86')](_0x480944[_0xecfc('0x7e')])){if(fs['existsSync'](path[_0xecfc('0x80')](config[_0xecfc('0x81')],_0xecfc('0x8b'),_0x480944[_0xecfc('0x7e')]))){_0x17f698=path[_0xecfc('0x80')](config[_0xecfc('0x81')],_0xecfc('0x8b'),_0x480944['systemAvatar']);}}return _0x1a2284[_0xecfc('0x8c')](_0x17f698);}})[_0xecfc('0x1c')](handleError(_0x1a2284,null));};function checkWebsiteInterval(_0x4c2d21){var _0xa4db28=_0x4c2d21[_0xecfc('0x92')];if(!_0xa4db28){return Promise[_0xecfc('0x93')](_0x4c2d21);}var _0x5adf73=_0x4c2d21[_0xecfc('0x94')]||undefined;return _0xa4db28[_0xecfc('0x95')](_0x5adf73)[_0xecfc('0x15')](function(_0x3240fd){if(!_0x3240fd){throw new APIOutOfIntervalError();}return _0x4c2d21;});}exports[_0xecfc('0x96')]=function(_0x2009a2,_0x3d299b){var _0x26fe81={'body':_0x2009a2[_0xecfc('0x61')],'channel':_0xecfc('0x97')};var _0x36c290=[];var _0x157bf7=[];var _0x4ee9c2={};var _0x34f252=![];if(_0x2009a2['body']['id']){delete _0x2009a2[_0xecfc('0x61')]['id'];}if(_[_0xecfc('0x86')](_0x2009a2[_0xecfc('0x61')][_0xecfc('0x98')])){throw new APIBadRequestError(_0xecfc('0x99'));}if(_[_0xecfc('0x86')](_0x2009a2[_0xecfc('0x61')][_0xecfc('0x9a')])){throw new APIBadRequestError(_0xecfc('0x9b'));}if(_[_0xecfc('0x9c')](_0x2009a2['body']['body'])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0x42b6f8=_0x2009a2[_0xecfc('0x61')]['customerIp']&&_0x2009a2['body']['referer'];return db[_0xecfc('0x9d')]['describe']()[_0xecfc('0x15')](function(_0x328612){if(!_0x328612){throw new Error(_0xecfc('0x9e'));}_0x36c290=Object['keys'](_0x328612)[_0xecfc('0x57')](function(_0x140ca9){return![_0xecfc('0x9f'),'updatedAt'][_0xecfc('0xa0')](_0x140ca9);});_0x157bf7=Object[_0xecfc('0x4c')](_0x328612)[_0xecfc('0x57')](function(_0x4f3687){return!['createdAt',_0xecfc('0xa1'),_0xecfc('0xa2'),_0xecfc('0xa3')]['includes'](_0x4f3687);});if(!_['includes'](_0x157bf7,_0x2009a2['body']['mapKey'])){throw new APIBadRequestError(_0xecfc('0xa4')+_0x157bf7[_0xecfc('0x80')](',\x20'));}_0x4ee9c2[_0x2009a2[_0xecfc('0x61')][_0xecfc('0x9a')]]=_0x2009a2[_0xecfc('0x61')]['from'];})[_0xecfc('0x15')](function(){return db[_0xecfc('0x47')][_0xecfc('0x60')]({'where':{'id':_0x2009a2[_0xecfc('0x5d')]['id']},'include':[{'model':db[_0xecfc('0xa5')],'as':_0xecfc('0xa6'),'include':[{'model':db['CmContact'],'as':_0xecfc('0xa7'),'where':_0x4ee9c2,'limit':0x1,'order':[[_0xecfc('0xa1'),_0xecfc('0xa8')]]}]},{'model':db[_0xecfc('0xa9')],'as':_0xecfc('0xaa')},{'model':db[_0xecfc('0x92')],'as':_0xecfc('0x92'),'include':[{'model':db[_0xecfc('0x92')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]});})['then'](function(_0x492f5f){if(!_0x492f5f){throw new APINotFoundError(util[_0xecfc('0x3a')](_0xecfc('0xab'),_0x2009a2['params']['id']));}if(_0x42b6f8){return checkWebsiteInterval(_0x492f5f);}return _0x492f5f;})['then'](function(_0x6cee5f){_0x26fe81[_0xecfc('0xac')]=_0x6cee5f;_0x26fe81[_0xecfc('0xad')]=_[_0xecfc('0xae')](_0x6cee5f[_0xecfc('0xaa')],['priority'],[_0xecfc('0xaf')]);if(_0x26fe81[_0xecfc('0xac')][_0xecfc('0xaa')]){delete _0x26fe81[_0xecfc('0xac')][_0xecfc('0xaa')];}_0x26fe81[_0xecfc('0xb0')]=_0x6cee5f['List']||{'id':_0x6cee5f[_0xecfc('0xa3')]};if(_0x26fe81[_0xecfc('0xb0')]&&_0x26fe81['list'][_0xecfc('0xa7')][_0xecfc('0x5e')]){return _0x26fe81[_0xecfc('0xb0')][_0xecfc('0xa7')][0x0];}var _0x2b84c7=_[_0xecfc('0xb1')](_0x2009a2[_0xecfc('0x61')],{'firstName':_0x2009a2['body'][_0xecfc('0x98')],'ListId':_0x6cee5f[_0xecfc('0xa3')]});_0x2b84c7[_0x2009a2[_0xecfc('0x61')][_0xecfc('0x9a')]]=_0x2009a2[_0xecfc('0x61')][_0xecfc('0x98')];return db[_0xecfc('0x9d')]['create'](_0x2b84c7,{'fields':_0x36c290,'raw':!![]});})[_0xecfc('0x15')](function(_0x4a7e48){_0x26fe81[_0xecfc('0xb2')]=_0x4a7e48;var _0x16fb89=createInteractionObject(_0x2009a2['params']['id'],_0x2009a2['body'],_0x2009a2[_0xecfc('0xb3')],_0x4a7e48);var _0x30ce1a={'ChatWebsiteId':_0x2009a2[_0xecfc('0x5d')]['id']};if(_0x2009a2[_0xecfc('0x61')][_0xecfc('0xb4')]){_0x30ce1a[_0xecfc('0xb4')]=_0x2009a2['body'][_0xecfc('0xb4')];_0x30ce1a[_0xecfc('0xb5')]=![];return db[_0xecfc('0xb6')][_0xecfc('0x60')]({'where':_0x30ce1a})[_0xecfc('0x15')](function(_0x471d40){var _0x49c966=_0x2009a2[_0xecfc('0x61')]['customerIp']&&_0x2009a2[_0xecfc('0x61')][_0xecfc('0xb7')];if(_0x471d40){_0x34f252=!![];return _0x471d40;}else if(!_0x49c966&&_0x471d40&&_0x471d40['closed']){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x16fb89[_0xecfc('0xb4')]=_0x2009a2['body']['threadId'];_0x16fb89[_0xecfc('0xb8')]=_0x2009a2[_0xecfc('0x61')][_0xecfc('0xb8')];return db['ChatInteraction'][_0xecfc('0x63')](_0x16fb89);});}_0x30ce1a[_0xecfc('0xb9')]=_0x4a7e48['id'];if(_0x2009a2[_0xecfc('0x61')][_0xecfc('0xba')]&&_0x2009a2[_0xecfc('0x61')][_0xecfc('0xba')]['id']){_0x30ce1a['id']=_0x2009a2[_0xecfc('0x61')]['interaction']['id'];return db[_0xecfc('0xb6')]['find']({'where':_0x30ce1a})[_0xecfc('0x15')](function(_0x4cc980){var _0x1a246b=_0x2009a2['body'][_0xecfc('0x31')]&&_0x2009a2[_0xecfc('0x61')][_0xecfc('0xb7')];if(!_0x1a246b&&_0x4cc980&&_0x4cc980[_0xecfc('0xb5')]){throw new APIConflictError(_0xecfc('0xbb'));}else if(_0x4cc980){_0x34f252=!![];return _0x4cc980;}else{return db[_0xecfc('0xb6')][_0xecfc('0x63')](_0x16fb89);}});}return db[_0xecfc('0xb6')][_0xecfc('0x63')](_0x16fb89);})[_0xecfc('0x15')](function(_0x383c21){if(!_0x34f252){return _0x383c21;}var _0x3cd7c3={'from':(_0x26fe81[_0xecfc('0xb2')][_0xecfc('0x35')]||'')+'\x20'+(_0x26fe81[_0xecfc('0xb2')][_0xecfc('0x36')]||'')};if(_0x2009a2['body'][_0xecfc('0xb4')]&&_0x2009a2[_0xecfc('0x61')]['messageId']&&_0x2009a2[_0xecfc('0x61')][_0xecfc('0xb4')]!=_0x2009a2[_0xecfc('0x61')][_0xecfc('0xbc')]){_0x3cd7c3['threadId']=_0x2009a2[_0xecfc('0x61')][_0xecfc('0xbc')];}return _0x383c21[_0xecfc('0x6a')](_0x3cd7c3);})[_0xecfc('0x15')](function(_0x18f8b8){_0x26fe81[_0xecfc('0xba')]=_0x18f8b8[_0xecfc('0x28')]({'plain':!![]});_0x26fe81[_0xecfc('0xba')][_0xecfc('0xbd')]=!_0x34f252;if(_0x26fe81[_0xecfc('0xba')][_0xecfc('0xbd')]){if(_0x26fe81[_0xecfc('0xac')][_0xecfc('0xbe')]){_0x26fe81[_0xecfc('0xad')]['push']({'id':0x0,'priority':_0x26fe81[_0xecfc('0xad')][_0xecfc('0x5e')]+0x1,'app':_0xecfc('0xbf'),'appdata':_0xecfc('0xc0'),'interval':_0xecfc('0xc1')});}}return db[_0xecfc('0xc2')][_0xecfc('0x63')]({'body':_0x2009a2[_0xecfc('0x61')]['body'],'ChatWebsiteId':_0x2009a2[_0xecfc('0x5d')]['id'],'ChatInteractionId':_0x18f8b8['id'],'direction':'in','ContactId':_0x26fe81[_0xecfc('0xb2')]['id'],'AttachmentId':_0x2009a2[_0xecfc('0x61')][_0xecfc('0xc3')]});})[_0xecfc('0x15')](function(_0x42b0b7){_0x26fe81[_0xecfc('0x1b')]=_0x42b0b7;if(!_0x26fe81['interaction'][_0xecfc('0xc4')]){return;}return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x26fe81[_0xecfc('0xba')]['UserId']}});})['then'](function(_0x49abf9){if(_0x49abf9){_0x26fe81['applications'][_0xecfc('0xc5')]({'id':0x0,'priority':0x0,'app':_0xecfc('0xc6'),'appdata':_0x49abf9[_0xecfc('0x2c')]+','+(_0x26fe81[_0xecfc('0xac')][_0xecfc('0xc7')]||0xa),'interval':'*,*,*,*'});_0x26fe81[_0xecfc('0xc8')]=!![];}if(!_0x26fe81['interaction'][_0xecfc('0xc9')]){return;}return db[_0xecfc('0xca')]['find']({'attributes':['id',_0xecfc('0x2c')],'where':{'id':_0x26fe81[_0xecfc('0xba')][_0xecfc('0xc9')]}});})['then'](function(_0x2f5515){if(_0x2f5515){_0x26fe81[_0xecfc('0xad')][_0xecfc('0xc5')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x2f5515[_0xecfc('0x2c')]+','+(_0x26fe81[_0xecfc('0xac')][_0xecfc('0xcb')]||0x12c),'interval':_0xecfc('0xc1')});}return respondWithRpcPromise('Start',_0xecfc('0xcc'),_0x26fe81);})[_0xecfc('0x15')](function(_0x20f982){respondWithRpcPromise('EventManager','EventManager',{'event':_0xecfc('0x96'),'message':_0x20f982},client9002);return _0x20f982;})[_0xecfc('0x15')](respondWithResult(_0x3d299b,null))[_0xecfc('0x1c')](APIHandleError(_0x3d299b));};exports[_0xecfc('0xcd')]=function(_0x20d59e,_0x518520){var _0x1928f5,_0x3a67fb,_0x4b88fe;var _0x5e05ba=[];var _0x156132={};var _0x38aa84=_0x20d59e['files']||[];var _0x55df0d=[];var _0x2db4d1;return db[_0xecfc('0x9d')][_0xecfc('0x6c')]()[_0xecfc('0x15')](function(_0x541895){if(!_0x541895){throw new db[(_0xecfc('0xce'))][(_0xecfc('0xcf'))](_0xecfc('0xd0'));}_0x5e05ba=_[_0xecfc('0xd1')](_[_0xecfc('0x4c')](_0x541895),['createdAt',_0xecfc('0xa1'),_0xecfc('0xa2'),_0xecfc('0xa3')]);if(_0x20d59e[_0xecfc('0x61')]['id']){delete _0x20d59e[_0xecfc('0x61')]['id'];}if(_[_0xecfc('0x86')](_0x20d59e[_0xecfc('0x61')][_0xecfc('0x98')])){throw _0x518520[_0xecfc('0x1e')](0x1f4)['send'](new db[(_0xecfc('0xce'))]['ValidationError'](_0xecfc('0xd2')));}if(_[_0xecfc('0x86')](_0x20d59e[_0xecfc('0x61')][_0xecfc('0x61')])||_0x20d59e['body'][_0xecfc('0x61')]===''){throw _0x518520['status'](0x1f4)[_0xecfc('0xd3')](new db[(_0xecfc('0xce'))]['ValidationError'](_0xecfc('0xd4')));}if(_[_0xecfc('0x86')](_0x20d59e['body']['mapKeyOffline'])){throw _0x518520[_0xecfc('0x1e')](0x1f4)['send'](new db[(_0xecfc('0xce'))][(_0xecfc('0xcf'))](_0xecfc('0xd5')+_0x5e05ba));}if(!_[_0xecfc('0xa0')](_0x5e05ba,_0x20d59e[_0xecfc('0x61')][_0xecfc('0xd6')])){throw _0x518520[_0xecfc('0x1e')](0x1f4)[_0xecfc('0xd3')](new db[(_0xecfc('0xce'))][(_0xecfc('0xcf'))](_0xecfc('0xd7')+_0x5e05ba));}_0x156132[_0x20d59e[_0xecfc('0x61')][_0xecfc('0xd6')]]=_0x20d59e[_0xecfc('0x61')][_0xecfc('0x98')];})[_0xecfc('0x15')](function(){return db[_0xecfc('0x47')][_0xecfc('0x60')]({'where':{'id':_0x20d59e['params']['id']},'include':[{'model':db[_0xecfc('0xa5')],'as':_0xecfc('0xa6')},{'model':db[_0xecfc('0xd8')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x518520,null))[_0xecfc('0x15')](function(_0x3fe02b){if(_0x3fe02b&&_0x3fe02b[_0xecfc('0xa6')]){_0x3a67fb=_0x3fe02b;var _0x373901=_[_0xecfc('0xb1')](_0x20d59e[_0xecfc('0x61')],{'firstName':_0x20d59e['body']['from'],'phone':_0x20d59e[_0xecfc('0x61')][_0xecfc('0x98')],'ListId':_0x3fe02b['ListId']});_0x373901[_0x20d59e['body']['mapKeyOffline']]=_0x20d59e[_0xecfc('0x61')][_0xecfc('0x98')];return db[_0xecfc('0x9d')][_0xecfc('0xd9')]({'where':_0x156132,'defaults':_0x373901});}})['spread'](function(_0x24a39b){if(_0x24a39b){_0x4b88fe=_0x24a39b;var _0x277b8f=fs[_0xecfc('0xda')](path[_0xecfc('0x80')](config['root'],_0xecfc('0xdb')),_0xecfc('0xdc'));var _0x48e2a2=ejs['render'](_0x277b8f,{'body':_[_0xecfc('0xdd')](_0x20d59e[_0xecfc('0x61')][_0xecfc('0x61')]),'bodyTitle':_0x3a67fb['offlineMessageBody']});return db[_0xecfc('0xde')]['create']({'body':_0x48e2a2,'plainBody':htmlToText['fromString'](_0x48e2a2),'ContactId':_0x24a39b['id'],'ChatWebsiteId':_0x3a67fb['id']});}})[_0xecfc('0x15')](function(_0x4d0609){_0x2db4d1=_0x4d0609;if(_0x38aa84[_0xecfc('0x5e')]){var _0x1a5629=_0x38aa84['map'](function(_0x42f136){return{'name':_0x42f136[_0xecfc('0xdf')],'basename':_0x42f136[_0xecfc('0x7a')],'type':_0x42f136[_0xecfc('0xe0')],'ChatOfflineMessageId':_0x4d0609['id']};});_0x55df0d=_0x1a5629[_0xecfc('0x46')](_0x1a89a5=>{var _0x2a5053={'filename':_0x1a89a5[_0xecfc('0x2c')],'path':path['join'](config[_0xecfc('0x81')],_0xecfc('0xe1'),_0xecfc('0xe2'),_0xecfc('0xe3'),_0xecfc('0xe4'),_0x1a89a5[_0xecfc('0xe5')])};return _0x2a5053;});if(!_0x3a67fb[_0xecfc('0xe6')]){return db[_0xecfc('0xe7')]['transaction'](function(_0x52bf92){return db['Attachment'][_0xecfc('0xe8')](_0x1a5629,{'transaction':_0x52bf92});});}}})[_0xecfc('0x15')](function(){if(_0x2db4d1){_0x1928f5=_0x2db4d1;return db[_0xecfc('0xd8')][_0xecfc('0x70')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xecfc('0xe9'),'raw':!![],'include':[{'model':db[_0xecfc('0xea')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xecfc('0x15')](function(_0x35055f){if(_0x35055f&&_0x35055f[_0xecfc('0xe9')]&&_0x3a67fb[_0xecfc('0xeb')]&&_0x3a67fb[_0xecfc('0xec')]){var _0x42d33d=_0x35055f[_0xecfc('0xed')]();return respondWithRpcPromise(_0xecfc('0xee'),_0xecfc('0xef'),{'account':_0x42d33d,'message':{'from':util['format'](_0xecfc('0xf0'),_0x35055f[_0xecfc('0x2c')],_0x35055f[_0xecfc('0xf1')]||_0x35055f['Smtp']['user']),'to':_0x3a67fb[_0xecfc('0xec')],'subject':_0x3a67fb[_0xecfc('0xf2')],'html':_0x1928f5['body'],'attachments':_0x55df0d}},client9003)[_0xecfc('0x15')](function(){return _0x1928f5;})['catch'](function(_0x3c2993){logger[_0xecfc('0x1a')](_0x3c2993);});}})[_0xecfc('0x15')](function(){if(_0x3a67fb&&_0x3a67fb['openNewInteraction']&&_0x3a67fb[_0xecfc('0xf3')]){var _0xcdc2bd=[];if(_0x38aa84['length']){_0xcdc2bd=_0x38aa84['map'](function(_0x384aa0){return{'name':_0x384aa0['originalname'],'basename':_0x384aa0[_0xecfc('0x7a')],'type':_0x384aa0[_0xecfc('0xe0')],'ChatOfflineMessageId':_0x2db4d1['id']};});}var _0x3ac5ee;if(!_[_0xecfc('0x86')](_0x3a67fb[_0xecfc('0xf4')])){var _0x406fa5=_[_0xecfc('0x46')](_0x20d59e[_0xecfc('0x61')],function(_0x2e92c3){return _0x2e92c3;});var _0x1f57b6=_[_0xecfc('0xf5')](_0x406fa5)[0x0];var _0x17b9f3=_[_0xecfc('0xf6')](_0x1f57b6,function(_0x55e97e){return _0x55e97e;});_0x3ac5ee=_0x17b9f3[0x1][_0x3a67fb[_0xecfc('0xf4')]];}var _0x4472eb={'from':_0x4b88fe[_0xecfc('0xf1')],'firstName':_0x4b88fe[_0xecfc('0x35')],'lastName':_0x4b88fe[_0xecfc('0x36')],'mapKey':_0xecfc('0xf1'),'message':{'from':_0x4b88fe[_0xecfc('0xf1')],'to':_0x3a67fb[_0xecfc('0xd8')]['email'],'cc':'','subject':_[_0xecfc('0x86')](_0x3ac5ee)?_0x3a67fb[_0xecfc('0xf2')]:_0x3ac5ee,'messageId':'','sentAt':new Date(),'attach':_0xcdc2bd[_0xecfc('0x5e')],'attachments':_0xcdc2bd,'originChannel':'Chat','ChatWebsiteId':_0x3a67fb['id'],'ChatOfflineMessageId':_0x1928f5['id'],'originTo':_0x3a67fb[_0xecfc('0xd8')][_0xecfc('0xf1')]},'body':_0x1928f5[_0xecfc('0x61')]};var _0x3e6edc={'account':{'id':_0x3a67fb[_0xecfc('0xf3')]},'body':_0x4472eb,'log':_0xecfc('0xf7')};return respondWithRpcPromise('NotifyMailAccount',_0xecfc('0xf8'),_0x3e6edc,client9001)['then'](function(){return _0x1928f5;})['catch'](function(_0x30da41){logger[_0xecfc('0x1a')](_0x30da41);});}return;})['then'](function(){if(_0x1928f5){return _0x1928f5;}})['then'](respondWithResult(_0x518520,null))['catch'](function(){for(var _0x347d17 of _0x38aa84){var _0x551f50=path[_0xecfc('0x80')](config[_0xecfc('0x81')],_0xecfc('0xe1'),_0xecfc('0xe2'),_0xecfc('0xe3'),_0xecfc('0xe4'),_0x347d17[_0xecfc('0x7a')]);fs_extra[_0xecfc('0xf9')](_0x551f50)[_0xecfc('0x1c')](function(_0x2ce679){logger[_0xecfc('0x1a')](_0xecfc('0xfa'),_0x551f50,_0x2ce679);});}});};exports[_0xecfc('0xfb')]=function(_0x3c761e,_0x12b973){return db['ChatInteraction'][_0xecfc('0x60')]({'where':{'id':_0x3c761e[_0xecfc('0x5d')]['id']}})[_0xecfc('0x15')](handleEntityNotFound(_0x12b973,null))[_0xecfc('0x15')](function(_0x4f3162){if(_0x4f3162){return _0x4f3162[_0xecfc('0xfb')](_0x3c761e[_0xecfc('0x61')][_0xecfc('0x73')],_['omit'](_0x3c761e['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x12b973,null))['catch'](handleError(_0x12b973,null));};exports[_0xecfc('0xfc')]=function(_0x3b27ca,_0xc20cb2){var _0x35fb2f={'raw':![],'where':{}};var _0x3d83b9={};var _0x244268={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xecfc('0x70')]({'where':{'id':_0x3b27ca[_0xecfc('0x5d')]['id']}})[_0xecfc('0x15')](handleEntityNotFound(_0xc20cb2,null))[_0xecfc('0x15')](function(_0x70804a){if(_0x70804a){_0x3d83b9['model']=_[_0xecfc('0x4c')](db[_0xecfc('0xb6')][_0xecfc('0x48')]);_0x3d83b9['query']=_['keys'](_0x3b27ca[_0xecfc('0x4b')]);_0x3d83b9[_0xecfc('0x4d')]=_[_0xecfc('0x4e')](_0x3d83b9[_0xecfc('0x3e')],_0x3d83b9[_0xecfc('0x4b')]);_0x35fb2f[_0xecfc('0x4f')]=_[_0xecfc('0x4e')](_0x3d83b9[_0xecfc('0x3e')],qs[_0xecfc('0x50')](_0x3b27ca[_0xecfc('0x4b')][_0xecfc('0x50')]));_0x35fb2f['attributes']=_0x35fb2f[_0xecfc('0x4f')][_0xecfc('0x5e')]?_0x35fb2f[_0xecfc('0x4f')]:_0x3d83b9['model'];if(!_0x3b27ca[_0xecfc('0x4b')][_0xecfc('0x51')](_0xecfc('0x52'))){_0x35fb2f[_0xecfc('0x23')]=qs['limit'](_0x3b27ca[_0xecfc('0x4b')][_0xecfc('0x23')]);_0x35fb2f[_0xecfc('0x21')]=qs[_0xecfc('0x21')](_0x3b27ca[_0xecfc('0x4b')][_0xecfc('0x21')]);}_0x35fb2f[_0xecfc('0x53')]=qs[_0xecfc('0x54')](_0x3b27ca[_0xecfc('0x4b')][_0xecfc('0x54')]);_0x35fb2f[_0xecfc('0x55')]=qs['filters'](_['pick'](_0x3b27ca[_0xecfc('0x4b')],_0x3d83b9['filters']));_0x35fb2f[_0xecfc('0x55')]['ChatWebsiteId']=_0x70804a['id'];if(_0x3b27ca[_0xecfc('0x4b')][_0xecfc('0x57')]){_0x35fb2f[_0xecfc('0x55')]=_[_0xecfc('0x58')](_0x35fb2f['where'],{'$or':_[_0xecfc('0x46')](_0x35fb2f[_0xecfc('0x4f')],function(_0x439c6b){var _0x412efa={};_0x412efa[_0x439c6b]={'$like':'%'+_0x3b27ca[_0xecfc('0x4b')][_0xecfc('0x57')]+'%'};return _0x412efa;})});}_0x35fb2f=_['merge']({},_0x35fb2f,_0x3b27ca[_0xecfc('0x5f')]);return db[_0xecfc('0xb6')][_0xecfc('0x24')]({'where':_0x35fb2f[_0xecfc('0x55')]})[_0xecfc('0x15')](function(_0x1af69f){_0x244268[_0xecfc('0x24')]=_0x1af69f;if(_0x3b27ca[_0xecfc('0x4b')][_0xecfc('0x59')]){_0x35fb2f[_0xecfc('0x5a')]=[{'model':db[_0xecfc('0x9d')],'as':_0xecfc('0xfd'),'required':![]},{'model':db['User'],'as':_0xecfc('0xfe'),'attributes':[_0xecfc('0x2c'),_0xecfc('0xff'),_0xecfc('0x100')],'required':![]},{'model':db[_0xecfc('0x101')],'as':_0xecfc('0x102'),'attributes':['id','name','color'],'where':_0x3b27ca[_0xecfc('0x4b')]['tag']?{'id':_0x3b27ca[_0xecfc('0x4b')]['tag']}:undefined,'required':_0x3b27ca[_0xecfc('0x4b')][_0xecfc('0x103')]?!![]:![]}];}return db[_0xecfc('0xb6')][_0xecfc('0x71')](_0x35fb2f);})[_0xecfc('0x15')](function(_0x30d621){_0x244268[_0xecfc('0x5b')]=_0x30d621;return _0x244268;});}})[_0xecfc('0x15')](respondWithFilteredResult(_0xc20cb2,_0x35fb2f))[_0xecfc('0x1c')](handleError(_0xc20cb2,null));};exports[_0xecfc('0x104')]=function(_0x239dc8,_0x1a319c){var _0x47686e=0x0;var _0x10d3fc=0x0;var _0x2fdc18=![];var _0x159f48;var _0x357421;return db[_0xecfc('0x47')]['find']({'where':{'id':_0x239dc8[_0xecfc('0x5d')]['id']},'include':[{'model':db['Interval'],'as':_0xecfc('0x92'),'include':[{'model':db[_0xecfc('0x92')],'as':_0xecfc('0x105'),'attributes':['id',_0xecfc('0x106')]}]}]})[_0xecfc('0x15')](handleEntityNotFound(_0x1a319c,null))[_0xecfc('0x15')](function(_0x2909d6){if(_0x2909d6){_0x159f48=_0x2909d6;return _0x2909d6['getProactiveActions']({'raw':!![]});}})[_0xecfc('0x15')](function(_0x4098e4){if(_0x159f48){if(_0x4098e4){_0x357421=_0x4098e4;}}return require('../../config/license/util')[_0xecfc('0x84')]();})['then'](function(_0x56c7ea){if(_0x56c7ea){_0x10d3fc=_0x56c7ea[_0xecfc('0x107')];_0x2fdc18=_0x56c7ea[_0xecfc('0x85')];}})[_0xecfc('0x15')](function(){return db[_0xecfc('0xb6')]['count']({'where':{'closed':![]}});})['then'](function(_0x4c2b43){_0x47686e=_0x4c2b43;if(_0x10d3fc&&_0x4c2b43>_0x10d3fc){return db['License']['findOne']({'where':{'id':0x1}})[_0xecfc('0x15')](function(_0x4505d4){if(_0x4505d4){_0x4505d4['increment'](_0xecfc('0x108'));}});}})[_0xecfc('0x15')](function(){var _0x55c011=_0x159f48[_0xecfc('0x92')];var _0x15f9d0=_0x159f48[_0xecfc('0x94')]||undefined;return _0x55c011?_0x55c011[_0xecfc('0x95')](_0x15f9d0):!![];})[_0xecfc('0x15')](function(_0x58ba8e){var _0x1c652c=fs[_0xecfc('0xda')](path['join'](config[_0xecfc('0x81')],_0xecfc('0x109')),_0xecfc('0xdc'));var _0xb6dbfe=_0xecfc('0x10a');var _0x5c26a0=![];try{const _0x45b6e3=new URL(_0x159f48[_0xecfc('0x62')]);_0x159f48[_0xecfc('0x62')]=_0x45b6e3[_0xecfc('0x10b')];}catch(_0x35dc73){}var _0x168357;if(_0x239dc8[_0xecfc('0xb3')][_0xecfc('0xb7')]){_0x239dc8[_0xecfc('0xb3')][_0xecfc('0xb7')]=_0x239dc8['headers'][_0xecfc('0xb7')][_0xecfc('0x10c')](/\/$/,'');_0x168357=wildcardUtils[_0xecfc('0x10d')](_0x159f48[_0xecfc('0x62')],_0x239dc8[_0xecfc('0xb3')][_0xecfc('0xb7')]);}else{_0x239dc8['headers']['referer']=_0x159f48['address'];_0x168357=!![];}var _0x1e807e={'chatVersion':_0xb6dbfe,'chatWebsiteAddressOrigin':_0x168357?_0x239dc8[_0xecfc('0xb3')][_0xecfc('0xb7')]:_0x159f48[_0xecfc('0x62')],'remote':_0x159f48[_0xecfc('0x10e')],'query':querystring['stringify'](_['merge'](_0x159f48[_0xecfc('0x28')]({'plain':!![]}),{'customerIp':_0x239dc8[_0xecfc('0xb3')][_0xecfc('0x33')]||_0x239dc8[_0xecfc('0xb3')]['x-real-ip']||_0x239dc8[_0xecfc('0x10f')][_0xecfc('0x110')]||_0x239dc8['ip'],'referer':_0x239dc8[_0xecfc('0xb3')][_0xecfc('0xb7')],'openedInteractions':_0x47686e,'maxInteractions':_0x10d3fc,'virtual':_0x2fdc18[_0xecfc('0x107')],'online':_0x58ba8e,'custom':_0x2fdc18,'address':_0x168357?_0x239dc8[_0xecfc('0xb3')][_0xecfc('0xb7')]:null}))[_0xecfc('0x10c')](/'/g,'\x5c\x27')};_0x1a319c[_0xecfc('0xd3')](ejs[_0xecfc('0x111')](Mustache[_0xecfc('0x111')](_0x1c652c,_0x1e807e),{'proactiveActions':_0x357421,'alignment':_0x159f48[_0xecfc('0x112')],'verticalAlignment':_0x159f48[_0xecfc('0x113')],'div_color':_0x159f48[_0xecfc('0x114')],'labelText':_0x159f48['labelText'],'text_color':_0x159f48[_0xecfc('0x115')],'text_button_color':_0x159f48[_0xecfc('0x116')],'button_color':_0x159f48['color_button'],'background_color':_0x159f48[_0xecfc('0x117')],'hideWhenOffline':_0x159f48[_0xecfc('0x118')],'intervalId':_0x159f48['IntervalId'],'isDevelopment':_0x5c26a0,'chatVersion':_0xb6dbfe}));})[_0xecfc('0x1c')](handleError(_0x1a319c,null));};exports[_0xecfc('0x119')]=function(_0x1993d0,_0x4ea016){var _0x35cdc0=_0x1993d0[_0xecfc('0x5d')]['id'];var _0x342f4c=_0x1993d0['body'];var _0x2ad29c=0xc8;var _0xbecb73=null;return db[_0xecfc('0xe7')][_0xecfc('0x11a')]({'isolationLevel':db[_0xecfc('0xe7')][_0xecfc('0x11b')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x122978){return db[_0xecfc('0x47')][_0xecfc('0x70')]({'where':{'id':_0x35cdc0},'transaction':_0x122978})[_0xecfc('0x15')](function(_0x50ca33){if(_0x50ca33){return db[_0xecfc('0xa9')][_0xecfc('0x27')]({'where':{'ChatWebsiteId':_0x35cdc0},'transaction':_0x122978})[_0xecfc('0x15')](function(){var _0x5ac590=_[_0xecfc('0x46')](_0x342f4c,function(_0x426032){_0x426032[_0xecfc('0x6d')]=_0x35cdc0;return _0x426032;});return db[_0xecfc('0xa9')][_0xecfc('0xe8')](_0x5ac590,{'transaction':_0x122978});});}else{_0x2ad29c=0x194;_0xbecb73=[];}});})[_0xecfc('0x15')](function(){if(_0x2ad29c!==0x194){return db['ChatApplication'][_0xecfc('0x11c')]({'where':{'ChatWebsiteId':_0x35cdc0},'order':_0xecfc('0x11d')})[_0xecfc('0x15')](function(_0x33c2ab){_0xbecb73=_0x33c2ab;});}})[_0xecfc('0x1c')](function(_0x2405b4){_0x2ad29c=0x1f4;logger[_0xecfc('0x1a')](_0x2405b4[_0xecfc('0x2b')]);if(_0x2405b4[_0xecfc('0x2c')]){delete _0x2405b4[_0xecfc('0x2c')];}_0xbecb73=_0x2405b4;})[_0xecfc('0x11e')](function(){if(_0xbecb73===null){_0x4ea016[_0xecfc('0x1d')](_0x2ad29c);}else{if(_0x2ad29c===0x1f4){_0x4ea016[_0xecfc('0x1e')](_0x2ad29c)[_0xecfc('0xd3')](_0xbecb73);}else{_0x4ea016[_0xecfc('0x1e')](_0x2ad29c)[_0xecfc('0x20')](_0xbecb73);}}});};exports[_0xecfc('0x11f')]=function(_0x30d0aa,_0x34f345){var _0x396bb1={};var _0x364a4e={};var _0x5a916b;var _0x5b15b0;return db['ChatWebsite'][_0xecfc('0x70')]({'where':{'id':_0x30d0aa[_0xecfc('0x5d')]['id']}})['then'](handleEntityNotFound(_0x34f345,null))[_0xecfc('0x15')](function(_0x2bfc22){if(_0x2bfc22){_0x5a916b=_0x2bfc22;_0x364a4e[_0xecfc('0x3e')]=_[_0xecfc('0x4c')](db[_0xecfc('0xa9')][_0xecfc('0x48')]);_0x364a4e[_0xecfc('0x4b')]=_[_0xecfc('0x4c')](_0x30d0aa[_0xecfc('0x4b')]);_0x364a4e[_0xecfc('0x4d')]=_[_0xecfc('0x4e')](_0x364a4e[_0xecfc('0x3e')],_0x364a4e[_0xecfc('0x4b')]);_0x396bb1['attributes']=_[_0xecfc('0x4e')](_0x364a4e['model'],qs['fields'](_0x30d0aa[_0xecfc('0x4b')][_0xecfc('0x50')]));_0x396bb1[_0xecfc('0x4f')]=_0x396bb1[_0xecfc('0x4f')]['length']?_0x396bb1[_0xecfc('0x4f')]:_0x364a4e['model'];_0x396bb1['order']=qs['sort'](_0x30d0aa['query'][_0xecfc('0x54')]);_0x396bb1[_0xecfc('0x55')]=qs[_0xecfc('0x4d')](_[_0xecfc('0x56')](_0x30d0aa[_0xecfc('0x4b')],_0x364a4e[_0xecfc('0x4d')]));if(_0x30d0aa[_0xecfc('0x4b')][_0xecfc('0x57')]){_0x396bb1[_0xecfc('0x55')]=_[_0xecfc('0x58')](_0x396bb1['where'],{'$or':_[_0xecfc('0x46')](_0x396bb1[_0xecfc('0x4f')],function(_0x38a24c){var _0x2e3ce8={};_0x2e3ce8[_0x38a24c]={'$like':'%'+_0x30d0aa[_0xecfc('0x4b')][_0xecfc('0x57')]+'%'};return _0x2e3ce8;})});}_0x396bb1=_[_0xecfc('0x58')]({},_0x396bb1,_0x30d0aa[_0xecfc('0x5f')]);return _0x5a916b[_0xecfc('0x11f')](_0x396bb1);}})['then'](function(_0x2b44af){if(_0x2b44af){_0x5b15b0=_0x2b44af[_0xecfc('0x5e')];if(!_0x30d0aa[_0xecfc('0x4b')][_0xecfc('0x51')](_0xecfc('0x52'))){_0x396bb1['limit']=qs[_0xecfc('0x23')](_0x30d0aa['query'][_0xecfc('0x23')]);_0x396bb1[_0xecfc('0x21')]=qs[_0xecfc('0x21')](_0x30d0aa[_0xecfc('0x4b')]['offset']);}return _0x5a916b[_0xecfc('0x11f')](_0x396bb1);}})[_0xecfc('0x15')](function(_0xaeb550){if(_0xaeb550){return _0xaeb550?{'count':_0x5b15b0,'rows':_0xaeb550}:null;}})[_0xecfc('0x15')](respondWithResult(_0x34f345,null))['catch'](handleError(_0x34f345,null));};exports['addProactiveActions']=function(_0x31b0b1,_0xfc8115){return db[_0xecfc('0x120')]['find']({'where':{'id':_0x31b0b1[_0xecfc('0x5d')]['id']}})[_0xecfc('0x15')](handleEntityNotFound(_0xfc8115,null))['then'](function(_0x5957cc){if(_0x5957cc){return _0x5957cc[_0xecfc('0x121')](_0x31b0b1[_0xecfc('0x61')][_0xecfc('0x73')],_[_0xecfc('0x122')](_0x31b0b1['body'],['ids','id'])||{});}})[_0xecfc('0x15')](respondWithResult(_0xfc8115,null))[_0xecfc('0x1c')](handleError(_0xfc8115,null));};exports[_0xecfc('0x123')]=function(_0x234a9e,_0x29dcb1){var _0x14da84={};var _0x3876a6={};var _0x280c7e;var _0x353f19;return db['ChatWebsite']['findOne']({'where':{'id':_0x234a9e['params']['id']}})[_0xecfc('0x15')](handleEntityNotFound(_0x29dcb1,null))[_0xecfc('0x15')](function(_0x16c867){if(_0x16c867){_0x280c7e=_0x16c867;_0x3876a6[_0xecfc('0x3e')]=_[_0xecfc('0x4c')](db['ChatProactiveAction'][_0xecfc('0x48')]);_0x3876a6[_0xecfc('0x4b')]=_[_0xecfc('0x4c')](_0x234a9e[_0xecfc('0x4b')]);_0x3876a6[_0xecfc('0x4d')]=_[_0xecfc('0x4e')](_0x3876a6['model'],_0x3876a6[_0xecfc('0x4b')]);_0x14da84[_0xecfc('0x4f')]=_[_0xecfc('0x4e')](_0x3876a6['model'],qs[_0xecfc('0x50')](_0x234a9e['query']['fields']));_0x14da84['attributes']=_0x14da84['attributes']['length']?_0x14da84[_0xecfc('0x4f')]:_0x3876a6[_0xecfc('0x3e')];_0x14da84[_0xecfc('0x53')]=qs['sort'](_0x234a9e[_0xecfc('0x4b')][_0xecfc('0x54')]);_0x14da84[_0xecfc('0x55')]=qs[_0xecfc('0x4d')](_[_0xecfc('0x56')](_0x234a9e[_0xecfc('0x4b')],_0x3876a6[_0xecfc('0x4d')]));if(_0x234a9e[_0xecfc('0x4b')][_0xecfc('0x57')]){_0x14da84[_0xecfc('0x55')]=_[_0xecfc('0x58')](_0x14da84[_0xecfc('0x55')],{'$or':_[_0xecfc('0x46')](_0x14da84[_0xecfc('0x4f')],function(_0x37edd8){var _0x52c095={};_0x52c095[_0x37edd8]={'$like':'%'+_0x234a9e[_0xecfc('0x4b')]['filter']+'%'};return _0x52c095;})});}_0x14da84=_[_0xecfc('0x58')]({},_0x14da84,_0x234a9e['options']);return _0x280c7e[_0xecfc('0x123')](_0x14da84);}})['then'](function(_0x40a2a9){if(_0x40a2a9){_0x353f19=_0x40a2a9[_0xecfc('0x5e')];if(!_0x234a9e[_0xecfc('0x4b')][_0xecfc('0x51')]('nolimit')){_0x14da84[_0xecfc('0x23')]=qs[_0xecfc('0x23')](_0x234a9e[_0xecfc('0x4b')]['limit']);_0x14da84[_0xecfc('0x21')]=qs[_0xecfc('0x21')](_0x234a9e[_0xecfc('0x4b')][_0xecfc('0x21')]);}return _0x280c7e['getProactiveActions'](_0x14da84);}})['then'](function(_0x5bde02){if(_0x5bde02){return _0x5bde02?{'count':_0x353f19,'rows':_0x5bde02}:null;}})['then'](respondWithResult(_0x29dcb1,null))[_0xecfc('0x1c')](handleError(_0x29dcb1,null));};exports[_0xecfc('0x124')]=function(_0x2e379e,_0x29cf62){var _0x37981a=_0x2e379e[_0xecfc('0x4b')][_0xecfc('0x125')]===_0xecfc('0x126')?_0xecfc('0x127'):'onlineForm';return db[_0xecfc('0x47')]['find']({'attributes':['id',_0x37981a],'where':{'id':_0x2e379e[_0xecfc('0x5d')]['id']}})['then'](handleEntityNotFound(_0x29cf62,null))[_0xecfc('0x15')](function(_0x198c44){if(_0x198c44){var _0xc3e118=_0x198c44[_0x37981a];var _0x489fb6=_0xc3e118&&_0xc3e118[_0xecfc('0x128')]?_0xc3e118[_0xecfc('0x128')]:[];_0x29cf62['send']({'fromKey':_[_0xecfc('0x86')](_0xc3e118[_0xecfc('0x129')])?undefined:_0xc3e118['fromKey'],'count':_0x489fb6[_0xecfc('0x5e')],'rows':_0x489fb6});}})[_0xecfc('0x1c')](handleError(_0x29cf62,null));};exports[_0xecfc('0x12a')]=function(_0x5df7b2,_0x4fa67b){var _0x3d9e75={'raw':![],'where':{}};var _0x5d84fd={};var _0x129684={'count':0x0,'rows':[]};return db[_0xecfc('0x47')][_0xecfc('0x70')]({'where':{'id':_0x5df7b2[_0xecfc('0x5d')]['id']}})[_0xecfc('0x15')](handleEntityNotFound(_0x4fa67b,null))[_0xecfc('0x15')](function(_0x128aac){if(_0x128aac){_0x5d84fd[_0xecfc('0x3e')]=_['keys'](db[_0xecfc('0xde')]['rawAttributes']);_0x5d84fd['query']=_[_0xecfc('0x4c')](_0x5df7b2[_0xecfc('0x4b')]);_0x5d84fd[_0xecfc('0x4d')]=_[_0xecfc('0x4e')](_0x5d84fd[_0xecfc('0x3e')],_0x5d84fd[_0xecfc('0x4b')]);_0x3d9e75['attributes']=_[_0xecfc('0x4e')](_0x5d84fd[_0xecfc('0x3e')],qs['fields'](_0x5df7b2[_0xecfc('0x4b')][_0xecfc('0x50')]));_0x3d9e75[_0xecfc('0x4f')]=_0x3d9e75[_0xecfc('0x4f')][_0xecfc('0x5e')]?_0x3d9e75[_0xecfc('0x4f')]:_0x5d84fd[_0xecfc('0x3e')];if(!_0x5df7b2[_0xecfc('0x4b')][_0xecfc('0x51')]('nolimit')){_0x3d9e75['limit']=qs[_0xecfc('0x23')](_0x5df7b2[_0xecfc('0x4b')][_0xecfc('0x23')]);_0x3d9e75[_0xecfc('0x21')]=qs[_0xecfc('0x21')](_0x5df7b2[_0xecfc('0x4b')][_0xecfc('0x21')]);}_0x3d9e75[_0xecfc('0x53')]=qs[_0xecfc('0x54')](_0x5df7b2[_0xecfc('0x4b')][_0xecfc('0x54')]);_0x3d9e75[_0xecfc('0x55')]=qs[_0xecfc('0x4d')](_[_0xecfc('0x56')](_0x5df7b2[_0xecfc('0x4b')],_0x5d84fd['filters']));_0x3d9e75[_0xecfc('0x55')]['ChatWebsiteId']=_0x128aac['id'];if(_0x5df7b2[_0xecfc('0x4b')][_0xecfc('0x57')]){_0x3d9e75[_0xecfc('0x55')]=_['merge'](_0x3d9e75['where'],{'$or':_[_0xecfc('0x46')](_0x3d9e75[_0xecfc('0x4f')],function(_0xa982e1){var _0x5a9103={};_0x5a9103[_0xa982e1]={'$like':'%'+_0x5df7b2[_0xecfc('0x4b')][_0xecfc('0x57')]+'%'};return _0x5a9103;})});}_0x3d9e75=_[_0xecfc('0x58')]({},_0x3d9e75,_0x5df7b2['options']);return db['ChatOfflineMessage'][_0xecfc('0x24')]({'where':_0x3d9e75[_0xecfc('0x55')]})[_0xecfc('0x15')](function(_0x21fe38){_0x129684[_0xecfc('0x24')]=_0x21fe38;if(_0x5df7b2[_0xecfc('0x4b')][_0xecfc('0x59')]){_0x3d9e75['include']=[{'all':!![]}];}else{_0x3d9e75[_0xecfc('0x5a')]=[{'model':db[_0xecfc('0x9d')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':_0xecfc('0x12b'),'required':![]}];}return db[_0xecfc('0xde')]['findAll'](_0x3d9e75);})[_0xecfc('0x15')](function(_0x18d5b2){_0x129684['rows']=_0x18d5b2;return _0x129684;});}})[_0xecfc('0x15')](respondWithFilteredResult(_0x4fa67b,_0x3d9e75))[_0xecfc('0x1c')](handleError(_0x4fa67b,null));};exports[_0xecfc('0x12c')]=function(_0x24cfe5,_0x3797f7){return db[_0xecfc('0x47')]['find']({'where':{'id':_0x24cfe5['params']['id']}})[_0xecfc('0x15')](handleEntityNotFound(_0x3797f7,null))[_0xecfc('0x15')](function(_0x45251c){if(_0x45251c){return _0x45251c[_0xecfc('0x12c')](_0x24cfe5[_0xecfc('0x61')][_0xecfc('0x73')],_[_0xecfc('0x122')](_0x24cfe5['body'],['ids','id'])||{})['spread'](function(_0x448a05){for(var _0x407dc6=0x0;_0x407dc6<_0x24cfe5[_0xecfc('0x61')][_0xecfc('0x73')]['length'];_0x407dc6+=0x1){socket[_0xecfc('0x12d')](_0xecfc('0x12e'),{'UserId':Number(_0x24cfe5[_0xecfc('0x61')]['ids'][_0x407dc6]),'ChatWebsiteId':Number(_0x24cfe5['params']['id'])});}return _0x448a05;});}})['then'](respondWithResult(_0x3797f7,null))['catch'](handleError(_0x3797f7,null));};exports[_0xecfc('0x12f')]=function(_0x5303b3,_0x542774){return db['ChatWebsite']['find']({'where':{'id':_0x5303b3[_0xecfc('0x5d')]['id']}})[_0xecfc('0x15')](handleEntityNotFound(_0x542774,null))[_0xecfc('0x15')](function(_0x387f0c){if(_0x387f0c){return _0x387f0c[_0xecfc('0x12f')](_0x5303b3[_0xecfc('0x4b')][_0xecfc('0x73')])['then'](function(){if(_[_0xecfc('0x130')](_0x5303b3[_0xecfc('0x4b')]['ids'])){for(var _0x486bee=0x0;_0x486bee<_0x5303b3[_0xecfc('0x4b')][_0xecfc('0x73')][_0xecfc('0x5e')];_0x486bee+=0x1){socket[_0xecfc('0x12d')](_0xecfc('0x131'),{'UserId':Number(_0x5303b3[_0xecfc('0x4b')][_0xecfc('0x73')][_0x486bee]),'ChatWebsiteId':Number(_0x5303b3['params']['id'])});}}else{socket['emit'](_0xecfc('0x131'),{'UserId':Number(_0x5303b3[_0xecfc('0x4b')][_0xecfc('0x73')]),'ChatWebsiteId':Number(_0x5303b3['params']['id'])});}});}})[_0xecfc('0x15')](respondWithStatusCode(_0x542774,null))[_0xecfc('0x1c')](handleError(_0x542774,null));};exports['getAgents']=function(_0x8e181,_0x29d989){var _0x5216dd={};var _0x392eac={};var _0x265359;var _0xe13dc8;return db[_0xecfc('0x47')][_0xecfc('0x70')]({'where':{'id':_0x8e181['params']['id']}})['then'](handleEntityNotFound(_0x29d989,null))[_0xecfc('0x15')](function(_0x557446){if(_0x557446){_0x265359=_0x557446;_0x392eac[_0xecfc('0x3e')]=_[_0xecfc('0x4c')](db[_0xecfc('0x132')]['rawAttributes']);_0x392eac[_0xecfc('0x4b')]=_[_0xecfc('0x4c')](_0x8e181[_0xecfc('0x4b')]);_0x392eac[_0xecfc('0x4d')]=_[_0xecfc('0x4e')](_0x392eac[_0xecfc('0x3e')],_0x392eac[_0xecfc('0x4b')]);_0x5216dd[_0xecfc('0x4f')]=_['intersection'](_0x392eac[_0xecfc('0x3e')],qs[_0xecfc('0x50')](_0x8e181[_0xecfc('0x4b')][_0xecfc('0x50')]));_0x5216dd[_0xecfc('0x4f')]=_0x5216dd[_0xecfc('0x4f')][_0xecfc('0x5e')]?_0x5216dd[_0xecfc('0x4f')]:_0x392eac[_0xecfc('0x3e')];_0x5216dd[_0xecfc('0x53')]=qs['sort'](_0x8e181[_0xecfc('0x4b')][_0xecfc('0x54')]);_0x5216dd[_0xecfc('0x55')]=qs[_0xecfc('0x4d')](_[_0xecfc('0x56')](_0x8e181[_0xecfc('0x4b')],_0x392eac[_0xecfc('0x4d')]));if(_0x8e181[_0xecfc('0x4b')]['filter']){_0x5216dd[_0xecfc('0x55')]=_[_0xecfc('0x58')](_0x5216dd[_0xecfc('0x55')],{'$or':_[_0xecfc('0x46')](_0x5216dd[_0xecfc('0x4f')],function(_0x3cc970){var _0x39f620={};_0x39f620[_0x3cc970]={'$like':'%'+_0x8e181[_0xecfc('0x4b')][_0xecfc('0x57')]+'%'};return _0x39f620;})});}_0x5216dd=_[_0xecfc('0x58')]({},_0x5216dd,_0x8e181[_0xecfc('0x5f')]);return _0x265359[_0xecfc('0x133')](_0x5216dd);}})[_0xecfc('0x15')](function(_0x4a0b0e){if(_0x4a0b0e){_0xe13dc8=_0x4a0b0e['length'];if(!_0x8e181['query'][_0xecfc('0x51')]('nolimit')){_0x5216dd[_0xecfc('0x23')]=qs[_0xecfc('0x23')](_0x8e181['query'][_0xecfc('0x23')]);_0x5216dd['offset']=qs[_0xecfc('0x21')](_0x8e181[_0xecfc('0x4b')][_0xecfc('0x21')]);}return _0x265359['getAgents'](_0x5216dd);}})[_0xecfc('0x15')](function(_0x2176b2){if(_0x2176b2){return _0x2176b2?{'count':_0xe13dc8,'rows':_0x2176b2}:null;}})[_0xecfc('0x15')](respondWithResult(_0x29d989,null))[_0xecfc('0x1c')](handleError(_0x29d989,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 0bf72ab..be188bb 100644 --- a/server/api/chatWebsite/chatWebsite.events.js +++ b/server/api/chatWebsite/chatWebsite.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6dfa=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','remove','emit'];(function(_0x5201c0,_0x5d5fba){var _0x1cf48b=function(_0x5b9203){while(--_0x5b9203){_0x5201c0['push'](_0x5201c0['shift']());}};_0x1cf48b(++_0x5d5fba);}(_0x6dfa,0x7b));var _0xa6df=function(_0x159232,_0x439514){_0x159232=_0x159232-0x0;var _0x448bc4=_0x6dfa[_0x159232];return _0x448bc4;};'use strict';var EventEmitter=require(_0xa6df('0x0'));var ChatWebsite=require(_0xa6df('0x1'))['db'][_0xa6df('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa6df('0x3')](0x0);var events={'afterCreate':_0xa6df('0x4'),'afterUpdate':'update','afterDestroy':_0xa6df('0x5')};function emitEvent(_0x4e356f){return function(_0x2ea163,_0x4da450,_0x5b92a8){ChatWebsiteEvents[_0xa6df('0x6')](_0x4e356f+':'+_0x2ea163['id'],_0x2ea163);ChatWebsiteEvents[_0xa6df('0x6')](_0x4e356f,_0x2ea163);_0x5b92a8(null);};}for(var e in events){if(events[_0xa6df('0x7')](e)){var event=events[e];ChatWebsite[_0xa6df('0x8')](e,emitEvent(event));}}module[_0xa6df('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x83d3=['hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','remove','emit'];(function(_0x547c35,_0x34928b){var _0x4b843b=function(_0x1bffc4){while(--_0x1bffc4){_0x547c35['push'](_0x547c35['shift']());}};_0x4b843b(++_0x34928b);}(_0x83d3,0x17c));var _0x383d=function(_0x35ce45,_0x57c22a){_0x35ce45=_0x35ce45-0x0;var _0x5cd865=_0x83d3[_0x35ce45];return _0x5cd865;};'use strict';var EventEmitter=require(_0x383d('0x0'));var ChatWebsite=require(_0x383d('0x1'))['db'][_0x383d('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x383d('0x3')](0x0);var events={'afterCreate':_0x383d('0x4'),'afterUpdate':'update','afterDestroy':_0x383d('0x5')};function emitEvent(_0x1184a6){return function(_0x31cbfc,_0x202ffc,_0x52adf4){ChatWebsiteEvents[_0x383d('0x6')](_0x1184a6+':'+_0x31cbfc['id'],_0x31cbfc);ChatWebsiteEvents['emit'](_0x1184a6,_0x31cbfc);_0x52adf4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x383d('0x7')](e,emitEvent(event));}}module[_0x383d('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 4b37aec..ce7ace3 100644 --- a/server/api/chatWebsite/chatWebsite.model.js +++ b/server/api/chatWebsite/chatWebsite.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8958=['rimraf','../../config/environment','./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x22ac02,_0x183aec){var _0x20cc5c=function(_0x1e0bd9){while(--_0x1e0bd9){_0x22ac02['push'](_0x22ac02['shift']());}};_0x20cc5c(++_0x183aec);}(_0x8958,0x180));var _0x8895=function(_0x36cb88,_0x3c5153){_0x36cb88=_0x36cb88-0x0;var _0x59fbf9=_0x8958[_0x36cb88];return _0x59fbf9;};'use strict';var _=require(_0x8895('0x0'));var util=require(_0x8895('0x1'));var logger=require(_0x8895('0x2'))(_0x8895('0x3'));var moment=require(_0x8895('0x4'));var BPromise=require(_0x8895('0x5'));var rp=require(_0x8895('0x6'));var fs=require('fs');var path=require(_0x8895('0x7'));var rimraf=require(_0x8895('0x8'));var config=require(_0x8895('0x9'));var attributes=require(_0x8895('0xa'));module['exports']=function(_0x592a1a,_0x161a49){return _0x592a1a[_0x8895('0xb')](_0x8895('0xc'),attributes,{'tableName':_0x8895('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fac=['./chatWebsite.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2fac,0x19b));var _0xc2fa=function(_0x30ad86,_0x31285b){_0x30ad86=_0x30ad86-0x0;var _0x48941a=_0x2fac[_0x30ad86];return _0x48941a;};'use strict';var _=require(_0xc2fa('0x0'));var util=require(_0xc2fa('0x1'));var logger=require(_0xc2fa('0x2'))(_0xc2fa('0x3'));var moment=require(_0xc2fa('0x4'));var BPromise=require(_0xc2fa('0x5'));var rp=require(_0xc2fa('0x6'));var fs=require('fs');var path=require(_0xc2fa('0x7'));var rimraf=require(_0xc2fa('0x8'));var config=require('../../config/environment');var attributes=require(_0xc2fa('0x9'));module[_0xc2fa('0xa')]=function(_0x1c505b,_0x52d413){return _0x1c505b[_0xc2fa('0xb')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index b0712de..845ebd7 100644 --- a/server/api/chatWebsite/chatWebsite.rpc.js +++ b/server/api/chatWebsite/chatWebsite.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x674b=['http','redis','socket.io-emitter','./chatWebsite.socket','register','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x674b,0xdf));var _0xb674=function(_0x3159c0,_0x592776){_0x3159c0=_0x3159c0-0x0;var _0x12411f=_0x674b[_0x3159c0];return _0x12411f;};'use strict';var _=require(_0xb674('0x0'));var util=require(_0xb674('0x1'));var moment=require(_0xb674('0x2'));var BPromise=require(_0xb674('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb674('0x4'))['db'];var utils=require(_0xb674('0x5'));var logger=require(_0xb674('0x6'))(_0xb674('0x7'));var config=require(_0xb674('0x8'));var jayson=require(_0xb674('0x9'));var client=jayson[_0xb674('0xa')][_0xb674('0xb')]({'port':0x232a});config[_0xb674('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb674('0xd'))(new Redis(config[_0xb674('0xc')]));require(_0xb674('0xe'))[_0xb674('0xf')](socket);function respondWithRpcPromise(_0x3cbeca,_0x4af829,_0x56e29a){return new BPromise(function(_0x160914,_0x31208a){return client['request'](_0x3cbeca,_0x56e29a)[_0xb674('0x10')](function(_0x32f792){logger['info'](_0xb674('0x11'),_0x4af829,'request\x20sent');logger[_0xb674('0x12')](_0xb674('0x13'),_0x4af829,'request\x20sent',JSON['stringify'](_0x32f792));if(_0x32f792['error']){if(_0x32f792[_0xb674('0x14')][_0xb674('0x15')]===0x1f4){logger[_0xb674('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x4af829,_0x32f792[_0xb674('0x14')][_0xb674('0x16')]);return _0x31208a(_0x32f792[_0xb674('0x14')][_0xb674('0x16')]);}logger[_0xb674('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x4af829,_0x32f792[_0xb674('0x14')][_0xb674('0x16')]);return _0x160914(_0x32f792[_0xb674('0x14')][_0xb674('0x16')]);}else{logger[_0xb674('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x4af829,_0xb674('0x18'));_0x160914(_0x32f792['result'][_0xb674('0x16')]);}})[_0xb674('0x19')](function(_0x126adf){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4af829,_0x126adf);_0x31208a(_0x126adf);});});} \ No newline at end of file +var _0x4e12=['request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','then','info'];(function(_0x531552,_0x2c78b4){var _0x3e0076=function(_0x4b7de6){while(--_0x4b7de6){_0x531552['push'](_0x531552['shift']());}};_0x3e0076(++_0x2c78b4);}(_0x4e12,0xaf));var _0x24e1=function(_0x65ac85,_0x588dd1){_0x65ac85=_0x65ac85-0x0;var _0x5b8e27=_0x4e12[_0x65ac85];return _0x5b8e27;};'use strict';var _=require(_0x24e1('0x0'));var util=require('util');var moment=require(_0x24e1('0x1'));var BPromise=require('bluebird');var rs=require(_0x24e1('0x2'));var fs=require('fs');var Redis=require(_0x24e1('0x3'));var db=require(_0x24e1('0x4'))['db'];var utils=require(_0x24e1('0x5'));var logger=require('../../config/logger')(_0x24e1('0x6'));var config=require(_0x24e1('0x7'));var jayson=require(_0x24e1('0x8'));var client=jayson['client'][_0x24e1('0x9')]({'port':0x232a});config[_0x24e1('0xa')]=_[_0x24e1('0xb')](config[_0x24e1('0xa')],{'host':_0x24e1('0xc'),'port':0x18eb});var socket=require(_0x24e1('0xd'))(new Redis(config[_0x24e1('0xa')]));require('./chatWebsite.socket')[_0x24e1('0xe')](socket);function respondWithRpcPromise(_0x2dfe94,_0x3a7986,_0x11483e){return new BPromise(function(_0x157eb3,_0x314ee7){return client['request'](_0x2dfe94,_0x11483e)[_0x24e1('0xf')](function(_0x3853c9){logger[_0x24e1('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x3a7986,_0x24e1('0x11'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3a7986,_0x24e1('0x11'),JSON['stringify'](_0x3853c9));if(_0x3853c9[_0x24e1('0x12')]){if(_0x3853c9[_0x24e1('0x12')][_0x24e1('0x13')]===0x1f4){logger['error'](_0x24e1('0x14'),_0x3a7986,_0x3853c9['error'][_0x24e1('0x15')]);return _0x314ee7(_0x3853c9[_0x24e1('0x12')][_0x24e1('0x15')]);}logger['error'](_0x24e1('0x14'),_0x3a7986,_0x3853c9[_0x24e1('0x12')]['message']);return _0x157eb3(_0x3853c9[_0x24e1('0x12')][_0x24e1('0x15')]);}else{logger[_0x24e1('0x10')](_0x24e1('0x14'),_0x3a7986,_0x24e1('0x11'));_0x157eb3(_0x3853c9[_0x24e1('0x16')]['message']);}})[_0x24e1('0x17')](function(_0x5e0357){logger['error'](_0x24e1('0x14'),_0x3a7986,_0x5e0357);_0x314ee7(_0x5e0357);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 008b1bf..4f9a8a6 100644 --- a/server/api/chatWebsite/chatWebsite.socket.js +++ b/server/api/chatWebsite/chatWebsite.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4067=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x58c9a1,_0xd72b43){var _0x1026b1=function(_0x2c0fde){while(--_0x2c0fde){_0x58c9a1['push'](_0x58c9a1['shift']());}};_0x1026b1(++_0xd72b43);}(_0x4067,0x154));var _0x7406=function(_0x85ee53,_0x6698ec){_0x85ee53=_0x85ee53-0x0;var _0x42552e=_0x4067[_0x85ee53];return _0x42552e;};'use strict';var ChatWebsiteEvents=require(_0x7406('0x0'));var events=[_0x7406('0x1'),_0x7406('0x2'),_0x7406('0x3')];function createListener(_0x41beb2,_0x2c0775){return function(_0x20cc64){_0x2c0775[_0x7406('0x4')](_0x41beb2,_0x20cc64);};}function removeListener(_0x56d555,_0x5d614e){return function(){ChatWebsiteEvents[_0x7406('0x5')](_0x56d555,_0x5d614e);};}exports[_0x7406('0x6')]=function(_0x3afd61){for(var _0x5cabff=0x0,_0x3bfea4=events[_0x7406('0x7')];_0x5cabff<_0x3bfea4;_0x5cabff++){var _0x230354=events[_0x5cabff];var _0x36ced4=createListener(_0x7406('0x8')+_0x230354,_0x3afd61);ChatWebsiteEvents['on'](_0x230354,_0x36ced4);}}; \ No newline at end of file +var _0x6bba=['./chatWebsite.events','save','remove','update','emit','removeListener','register','length','chatWebsite:'];(function(_0x2121d1,_0x3e17d6){var _0x404ec5=function(_0x2e4bc4){while(--_0x2e4bc4){_0x2121d1['push'](_0x2121d1['shift']());}};_0x404ec5(++_0x3e17d6);}(_0x6bba,0x1d4));var _0xa6bb=function(_0x44b057,_0x4f87f2){_0x44b057=_0x44b057-0x0;var _0x440a12=_0x6bba[_0x44b057];return _0x440a12;};'use strict';var ChatWebsiteEvents=require(_0xa6bb('0x0'));var events=[_0xa6bb('0x1'),_0xa6bb('0x2'),_0xa6bb('0x3')];function createListener(_0x153e0c,_0x1a9d36){return function(_0x40ee84){_0x1a9d36[_0xa6bb('0x4')](_0x153e0c,_0x40ee84);};}function removeListener(_0x112395,_0x2b8fc5){return function(){ChatWebsiteEvents[_0xa6bb('0x5')](_0x112395,_0x2b8fc5);};}exports[_0xa6bb('0x6')]=function(_0x30fa98){for(var _0x30f4c2=0x0,_0x3ae261=events[_0xa6bb('0x7')];_0x30f4c2<_0x3ae261;_0x30f4c2++){var _0xe17311=events[_0x30f4c2];var _0xcbc5e5=createListener(_0xa6bb('0x8')+_0xe17311,_0x30fa98);ChatWebsiteEvents['on'](_0xe17311,_0xcbc5e5);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js index 62a527f..8f94f96 100644 --- a/server/api/chatWebsite/helpers/wildcard-expressions.js +++ b/server/api/chatWebsite/helpers/wildcard-expressions.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9234=['localhost','replace','([\x5cw]+)','test','exports','../../../utils/misc','url','URL'];(function(_0x5d2481,_0x1d0d33){var _0x8a55d2=function(_0x2a2647){while(--_0x2a2647){_0x5d2481['push'](_0x5d2481['shift']());}};_0x8a55d2(++_0x1d0d33);}(_0x9234,0x1bd));var _0x4923=function(_0x11e05d,_0x3a4491){_0x11e05d=_0x11e05d-0x0;var _0x335588=_0x9234[_0x11e05d];return _0x335588;};var escapeRegExp=require(_0x4923('0x0'))['escapeRegExp'];var URL=require(_0x4923('0x1'))[_0x4923('0x2')];function testWildcardValidity(_0x1f0d3a){let _0x34915b=!![];try{new URL(_0x1f0d3a['replace']('*',_0x4923('0x3')));}catch(_0x436ce1){_0x34915b=![];}return _0x34915b&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)['test'](_0x1f0d3a);}function testWebsiteWithWildcard(_0x100be3,_0x1184c3){let _0x526ad7;const _0x3c5e3f=escapeRegExp(_0x100be3)[_0x4923('0x4')]('\x5c*',_0x4923('0x5'));try{new URL(_0x100be3[_0x4923('0x4')]('\x5c*','localhost'));_0x526ad7=new RegExp(_0x3c5e3f)[_0x4923('0x6')](_0x1184c3);}catch(_0x590bb6){_0x526ad7=![];}return _0x526ad7;}module[_0x4923('0x7')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file +var _0x6931=['test','([\x5cw]+)','localhost','exports','../../../utils/misc','escapeRegExp','replace'];(function(_0x581efc,_0x51d419){var _0xf5939d=function(_0x10ffaa){while(--_0x10ffaa){_0x581efc['push'](_0x581efc['shift']());}};_0xf5939d(++_0x51d419);}(_0x6931,0xa5));var _0x1693=function(_0x4ac6c7,_0xcb8ac3){_0x4ac6c7=_0x4ac6c7-0x0;var _0x741168=_0x6931[_0x4ac6c7];return _0x741168;};var escapeRegExp=require(_0x1693('0x0'))[_0x1693('0x1')];var URL=require('url')['URL'];function testWildcardValidity(_0x7828b9){let _0x190052=!![];try{new URL(_0x7828b9[_0x1693('0x2')]('*','localhost'));}catch(_0x1c8ac6){_0x190052=![];}return _0x190052&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x1693('0x3')](_0x7828b9);}function testWebsiteWithWildcard(_0x2c6ed0,_0x576a1d){let _0x361381;const _0x4bd166=escapeRegExp(_0x2c6ed0)[_0x1693('0x2')]('\x5c*',_0x1693('0x4'));try{new URL(_0x2c6ed0[_0x1693('0x2')]('\x5c*',_0x1693('0x5')));_0x361381=new RegExp(_0x4bd166)[_0x1693('0x3')](_0x576a1d);}catch(_0x1c3da1){_0x361381=![];}return _0x361381;}module[_0x1693('0x6')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 306dd7b..7c172b3 100644 --- a/server/api/chatWebsite/index.js +++ b/server/api/chatWebsite/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x708e=['getCustomerAvatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','notify','extname','replace','/:id/offline','offline','addInteraction','addAgents','put','delete','removeDispositions','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x708e,0xac));var _0xe708=function(_0x183256,_0x1a596d){_0x183256=_0x183256-0x0;var _0x5394a2=_0x708e[_0x183256];return _0x5394a2;};'use strict';var multer=require(_0xe708('0x0'));var util=require(_0xe708('0x1'));var path=require(_0xe708('0x2'));var timeout=require(_0xe708('0x3'));var express=require('express');var router=express[_0xe708('0x4')]();var fs_extra=require(_0xe708('0x5'));var auth=require(_0xe708('0x6'));var interaction=require(_0xe708('0x7'));var config=require(_0xe708('0x8'));var controller=require(_0xe708('0x9'));router[_0xe708('0xa')]('/',auth['isAuthenticated'](),controller[_0xe708('0xb')]);router[_0xe708('0xa')](_0xe708('0xc'),auth[_0xe708('0xd')](),controller[_0xe708('0xe')]);router[_0xe708('0xa')](_0xe708('0xf'),auth['isAuthenticated'](),controller[_0xe708('0x10')]);router[_0xe708('0xa')](_0xe708('0x11'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xe708('0xa')](_0xe708('0x12'),auth[_0xe708('0xd')](),controller['getAnswers']);router[_0xe708('0xa')](_0xe708('0x13'),controller[_0xe708('0x14')]);router[_0xe708('0xa')](_0xe708('0x15'),controller[_0xe708('0x16')]);router[_0xe708('0xa')]('/:id/customer_avatar',controller[_0xe708('0x17')]);router[_0xe708('0xa')]('/:id/system_avatar',controller[_0xe708('0x18')]);router[_0xe708('0xa')](_0xe708('0x19'),auth[_0xe708('0xd')](),controller['getInteractions']);router[_0xe708('0xa')](_0xe708('0x1a'),controller[_0xe708('0x1b')]);router[_0xe708('0xa')](_0xe708('0x1c'),auth[_0xe708('0xd')](),controller[_0xe708('0x1d')]);router[_0xe708('0xa')](_0xe708('0x1e'),auth[_0xe708('0xd')](),controller['getProactiveActions']);router['get']('/:id/fields',controller['getFields']);router[_0xe708('0xa')](_0xe708('0x1f'),auth['isAuthenticated'](),controller[_0xe708('0x20')]);router[_0xe708('0xa')]('/:id/users',auth[_0xe708('0xd')](),controller[_0xe708('0x21')]);router[_0xe708('0x22')]('/',auth[_0xe708('0xd')](),controller[_0xe708('0x23')]);router[_0xe708('0x22')](_0xe708('0x11'),auth[_0xe708('0xd')](),controller[_0xe708('0x24')]);router[_0xe708('0x22')](_0xe708('0x12'),auth[_0xe708('0xd')](),controller[_0xe708('0x25')]);var upload=multer({'storage':multer[_0xe708('0x26')]({'destination':function(_0x1e66cd,_0x171b75,_0x3fd39e){_0x3fd39e(null,path[_0xe708('0x27')](config[_0xe708('0x28')],_0xe708('0x29')));},'filename':function(_0x19415e,_0x247e9b,_0x3f2ed2){_0x3f2ed2(null,util[_0xe708('0x2a')](_0xe708('0x2b'),Date[_0xe708('0x2c')](),_0x247e9b[_0xe708('0x2d')]));}})});router[_0xe708('0x22')](_0xe708('0x13'),upload[_0xe708('0x2e')](_0xe708('0x2f')),controller[_0xe708('0x30')]);var upload=multer({'storage':multer[_0xe708('0x26')]({'destination':function(_0x37faec,_0x5149f7,_0x124bae){_0x124bae(null,path[_0xe708('0x27')](config['root'],_0xe708('0x31')));},'filename':function(_0x344be9,_0x14518b,_0x44b47f){_0x44b47f(null,util[_0xe708('0x2a')](_0xe708('0x2b'),Date['now'](),_0x14518b[_0xe708('0x2d')]));}})});router['post'](_0xe708('0x15'),upload[_0xe708('0x2e')](_0xe708('0x2f')),controller[_0xe708('0x32')]);var upload=multer({'storage':multer[_0xe708('0x26')]({'destination':function(_0x496c52,_0x943255,_0x3ea043){_0x3ea043(null,path[_0xe708('0x27')](config[_0xe708('0x28')],_0xe708('0x31')));},'filename':function(_0x13029c,_0x4fba12,_0xefe2c5){_0xefe2c5(null,util[_0xe708('0x2a')](_0xe708('0x2b'),Date[_0xe708('0x2c')](),_0x4fba12[_0xe708('0x2d')]));}})});router['post'](_0xe708('0x33'),upload[_0xe708('0x2e')](_0xe708('0x2f')),controller[_0xe708('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c70d8,_0x125c16,_0x47a8a8){_0x47a8a8(null,path['join'](config[_0xe708('0x28')],_0xe708('0x31')));},'filename':function(_0x60bde0,_0x1eff96,_0x25b1db){_0x25b1db(null,util['format'](_0xe708('0x2b'),Date[_0xe708('0x2c')](),_0x1eff96[_0xe708('0x2d')]));}})});router['post'](_0xe708('0x35'),upload[_0xe708('0x2e')](_0xe708('0x2f')),controller['addSystemAvatar']);router['post']('/:id/notify',controller[_0xe708('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0xe708('0x26')]({'destination':function(_0x39626e,_0x1213e9,_0x3aa796){const _0x4f0449=path[_0xe708('0x27')](config[_0xe708('0x28')],'server/files','attachments','offline-chat');fs_extra['ensureDir'](_0x4f0449,function(){_0x3aa796(null,_0x4f0449);});},'filename':function(_0x19b35b,_0x387a70,_0x5ed2a9){const _0x14e1a8=_0x387a70[_0xe708('0x2d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x430965=path[_0xe708('0x37')](_0x14e1a8);const _0x255969=Date[_0xe708('0x2c')]()+'-'+_0x14e1a8[_0xe708('0x38')](_0x430965,'')+_0x430965;_0x5ed2a9(null,_0x255969);}})});router[_0xe708('0x22')](_0xe708('0x39'),offlineUploadMulter['any'](),controller[_0xe708('0x3a')]);router[_0xe708('0x22')](_0xe708('0x19'),auth[_0xe708('0xd')](),controller[_0xe708('0x3b')]);router[_0xe708('0x22')](_0xe708('0x1c'),auth[_0xe708('0xd')](),controller['addApplications']);router[_0xe708('0x22')](_0xe708('0x1e'),auth[_0xe708('0xd')](),controller['addProactiveActions']);router[_0xe708('0x22')]('/:id/users',auth[_0xe708('0xd')](),controller[_0xe708('0x3c')]);router[_0xe708('0x3d')](_0xe708('0xf'),auth[_0xe708('0xd')](),controller['update']);router[_0xe708('0x3e')](_0xe708('0xf'),auth[_0xe708('0xd')](),controller['destroy']);router[_0xe708('0x3e')]('/:id/dispositions',auth[_0xe708('0xd')](),controller[_0xe708('0x3f')]);router[_0xe708('0x3e')](_0xe708('0x12'),auth[_0xe708('0xd')](),controller['removeAnswers']);router[_0xe708('0x3e')]('/:id/users',auth[_0xe708('0xd')](),controller[_0xe708('0x40')]);module['exports']=router; \ No newline at end of file +var _0x983e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','getAgents','post','addDisposition','join','root','server/files/images/logos/','%s-%s','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','format','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','any','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','update','removeDispositions','delete','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router'];(function(_0x37cf70,_0x3a4c38){var _0xc24675=function(_0x4ae381){while(--_0x4ae381){_0x37cf70['push'](_0x37cf70['shift']());}};_0xc24675(++_0x3a4c38);}(_0x983e,0x113));var _0xe983=function(_0xbee8ad,_0x1595fb){_0xbee8ad=_0xbee8ad-0x0;var _0x4665ff=_0x983e[_0xbee8ad];return _0x4665ff;};'use strict';var multer=require('multer');var util=require(_0xe983('0x0'));var path=require(_0xe983('0x1'));var timeout=require(_0xe983('0x2'));var express=require(_0xe983('0x3'));var router=express[_0xe983('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe983('0x5'));var interaction=require(_0xe983('0x6'));var config=require(_0xe983('0x7'));var controller=require(_0xe983('0x8'));router[_0xe983('0x9')]('/',auth[_0xe983('0xa')](),controller[_0xe983('0xb')]);router[_0xe983('0x9')](_0xe983('0xc'),auth[_0xe983('0xa')](),controller['describe']);router[_0xe983('0x9')](_0xe983('0xd'),auth[_0xe983('0xa')](),controller[_0xe983('0xe')]);router[_0xe983('0x9')](_0xe983('0xf'),auth['isAuthenticated'](),controller[_0xe983('0x10')]);router[_0xe983('0x9')](_0xe983('0x11'),auth[_0xe983('0xa')](),controller[_0xe983('0x12')]);router[_0xe983('0x9')](_0xe983('0x13'),controller[_0xe983('0x14')]);router[_0xe983('0x9')](_0xe983('0x15'),controller['getAvatar']);router[_0xe983('0x9')]('/:id/customer_avatar',controller[_0xe983('0x16')]);router['get'](_0xe983('0x17'),controller[_0xe983('0x18')]);router[_0xe983('0x9')](_0xe983('0x19'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xe983('0x9')](_0xe983('0x1a'),controller[_0xe983('0x1b')]);router[_0xe983('0x9')](_0xe983('0x1c'),auth['isAuthenticated'](),controller[_0xe983('0x1d')]);router[_0xe983('0x9')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xe983('0x1e')]);router['get'](_0xe983('0x1f'),controller['getFields']);router[_0xe983('0x9')](_0xe983('0x20'),auth[_0xe983('0xa')](),controller[_0xe983('0x21')]);router[_0xe983('0x9')]('/:id/users',auth[_0xe983('0xa')](),controller[_0xe983('0x22')]);router['post']('/',auth[_0xe983('0xa')](),controller['create']);router[_0xe983('0x23')](_0xe983('0xf'),auth[_0xe983('0xa')](),controller[_0xe983('0x24')]);router[_0xe983('0x23')]('/:id/canned_answers',auth[_0xe983('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xa2d16b,_0x48a89f,_0x3d50af){_0x3d50af(null,path[_0xe983('0x25')](config[_0xe983('0x26')],_0xe983('0x27')));},'filename':function(_0x4317b2,_0x113517,_0x7ce8f3){_0x7ce8f3(null,util['format'](_0xe983('0x28'),Date[_0xe983('0x29')](),_0x113517[_0xe983('0x2a')]));}})});router[_0xe983('0x23')](_0xe983('0x13'),upload[_0xe983('0x2b')](_0xe983('0x2c')),controller[_0xe983('0x2d')]);var upload=multer({'storage':multer[_0xe983('0x2e')]({'destination':function(_0x25253d,_0x84c5a,_0x1f5f93){_0x1f5f93(null,path[_0xe983('0x25')](config[_0xe983('0x26')],_0xe983('0x2f')));},'filename':function(_0x213c9e,_0x2a7fa4,_0xc3d89b){_0xc3d89b(null,util[_0xe983('0x30')]('%s-%s',Date[_0xe983('0x29')](),_0x2a7fa4['originalname']));}})});router['post']('/:id/avatar',upload[_0xe983('0x2b')](_0xe983('0x2c')),controller[_0xe983('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2e0f6a,_0x57d42a,_0x153062){_0x153062(null,path[_0xe983('0x25')](config[_0xe983('0x26')],_0xe983('0x2f')));},'filename':function(_0x3864ca,_0x25d2e9,_0xf8adfe){_0xf8adfe(null,util[_0xe983('0x30')](_0xe983('0x28'),Date['now'](),_0x25d2e9[_0xe983('0x2a')]));}})});router[_0xe983('0x23')](_0xe983('0x32'),upload[_0xe983('0x2b')](_0xe983('0x2c')),controller[_0xe983('0x33')]);var upload=multer({'storage':multer[_0xe983('0x2e')]({'destination':function(_0x53d9c2,_0x101f42,_0x483d55){_0x483d55(null,path[_0xe983('0x25')](config['root'],_0xe983('0x2f')));},'filename':function(_0x4b4431,_0x27d068,_0x5b9199){_0x5b9199(null,util[_0xe983('0x30')](_0xe983('0x28'),Date[_0xe983('0x29')](),_0x27d068[_0xe983('0x2a')]));}})});router['post'](_0xe983('0x17'),upload[_0xe983('0x2b')](_0xe983('0x2c')),controller['addSystemAvatar']);router['post'](_0xe983('0x34'),controller[_0xe983('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xe983('0x2e')]({'destination':function(_0x4a4700,_0x148da6,_0x5d355d){const _0x5212a9=path[_0xe983('0x25')](config[_0xe983('0x26')],_0xe983('0x36'),_0xe983('0x37'),_0xe983('0x38'));fs_extra['ensureDir'](_0x5212a9,function(){_0x5d355d(null,_0x5212a9);});},'filename':function(_0x5d2e5e,_0x2e0757,_0x5a4cb6){const _0x4f0311=_0x2e0757[_0xe983('0x2a')][_0xe983('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5ccd78=path['extname'](_0x4f0311);const _0x1abf80=Date[_0xe983('0x29')]()+'-'+_0x4f0311['replace'](_0x5ccd78,'')+_0x5ccd78;_0x5a4cb6(null,_0x1abf80);}})});router[_0xe983('0x23')]('/:id/offline',offlineUploadMulter[_0xe983('0x3a')](),controller['offline']);router['post'](_0xe983('0x19'),auth[_0xe983('0xa')](),controller[_0xe983('0x3b')]);router[_0xe983('0x23')](_0xe983('0x1c'),auth[_0xe983('0xa')](),controller[_0xe983('0x3c')]);router[_0xe983('0x23')]('/:id/proactive_actions',auth[_0xe983('0xa')](),controller[_0xe983('0x3d')]);router['post'](_0xe983('0x3e'),auth['isAuthenticated'](),controller[_0xe983('0x3f')]);router['put'](_0xe983('0xd'),auth[_0xe983('0xa')](),controller[_0xe983('0x40')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xe983('0xf'),auth[_0xe983('0xa')](),controller[_0xe983('0x41')]);router[_0xe983('0x42')](_0xe983('0x11'),auth['isAuthenticated'](),controller[_0xe983('0x43')]);router[_0xe983('0x42')](_0xe983('0x3e'),auth[_0xe983('0xa')](),controller[_0xe983('0x44')]);module[_0xe983('0x45')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index b6eb633..e211704 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x29cd=['production','app','get','client-side-logger','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','env'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x29cd,0x167));var _0xd29c=function(_0xc44e06,_0x308d58){_0xc44e06=_0xc44e06-0x0;var _0x3094dd=_0x29cd[_0xc44e06];return _0x3094dd;};var beaverLogger=require(_0xd29c('0x0'));var express=require('express');var auth=require(_0xd29c('0x1'));var config=require(_0xd29c('0x2'));var router=express[_0xd29c('0x3')]();var isProduction=config[_0xd29c('0x4')]===_0xd29c('0x5')||![];function clientSideLogs(_0x57682f,_0x3dc0c7,_0x2ca520){var _0x4b2c23=_0x57682f[_0xd29c('0x6')][_0xd29c('0x7')](_0xd29c('0x8'));if(!_0x4b2c23){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xd29c('0x9')]({'uri':'/client-logs','logger':_0x4b2c23,'enableCors':!isProduction})(_0x57682f,_0x3dc0c7,_0x2ca520);}router[_0xd29c('0xa')](auth[_0xd29c('0xb')](),clientSideLogs);module[_0xd29c('0xc')]=router; \ No newline at end of file +var _0x720c=['isAuthenticated','beaver-logger/server','express','../components/auth/service','../config/environment','env','production','get','client-side-logger','expressEndpoint','/client-logs','use'];(function(_0x1356ca,_0x491e8a){var _0x126bee=function(_0x5b1f8b){while(--_0x5b1f8b){_0x1356ca['push'](_0x1356ca['shift']());}};_0x126bee(++_0x491e8a);}(_0x720c,0x18d));var _0xc720=function(_0x3db140,_0x88e7d0){_0x3db140=_0x3db140-0x0;var _0x5c88cf=_0x720c[_0x3db140];return _0x5c88cf;};var beaverLogger=require(_0xc720('0x0'));var express=require(_0xc720('0x1'));var auth=require(_0xc720('0x2'));var config=require(_0xc720('0x3'));var router=express['Router']();var isProduction=config[_0xc720('0x4')]===_0xc720('0x5')||![];function clientSideLogs(_0x3164fd,_0x500a0c,_0x43630f){var _0x5cc48a=_0x3164fd['app'][_0xc720('0x6')](_0xc720('0x7'));if(!_0x5cc48a){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xc720('0x8')]({'uri':_0xc720('0x9'),'logger':_0x5cc48a,'enableCors':!isProduction})(_0x3164fd,_0x500a0c,_0x43630f);}router[_0xc720('0xa')](auth[_0xc720('0xb')](),clientSideLogs);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index b2f7b41..056df84 100644 --- a/server/api/cloudProvider/cloudProvider.attributes.js +++ b/server/api/cloudProvider/cloudProvider.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4b7=['exports','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize'];(function(_0x1b6e11,_0x51702b){var _0x439bca=function(_0x4f75d0){while(--_0x4f75d0){_0x1b6e11['push'](_0x1b6e11['shift']());}};_0x439bca(++_0x51702b);}(_0xf4b7,0x95));var _0x7f4b=function(_0x5dbaa4,_0x2a4df0){_0x5dbaa4=_0x5dbaa4-0x0;var _0x41cf0f=_0xf4b7[_0x5dbaa4];return _0x41cf0f;};'use strict';var Sequelize=require(_0x7f4b('0x0'));module[_0x7f4b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x7f4b('0x2')](_0x7f4b('0x3'),_0x7f4b('0x4'),_0x7f4b('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x7f4b('0x6'),_0x7f4b('0x7'))},'data1':{'type':Sequelize[_0x7f4b('0x8')],'comment':_0x7f4b('0x9')},'data2':{'type':Sequelize['STRING'],'comment':_0x7f4b('0xa')},'data3':{'type':Sequelize['STRING'],'comment':_0x7f4b('0xb')},'data4':{'type':Sequelize[_0x7f4b('0x8')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':_0x7f4b('0xc')},'data6':{'type':Sequelize[_0x7f4b('0xd')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':_0x7f4b('0xe')}}; \ No newline at end of file +var _0x6fc8=['sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x25cdb6,_0x1f9fd9){var _0xf6543=function(_0x5b7828){while(--_0x5b7828){_0x25cdb6['push'](_0x25cdb6['shift']());}};_0xf6543(++_0x1f9fd9);}(_0x6fc8,0x1dc));var _0x86fc=function(_0xf8f137,_0x31cea7){_0xf8f137=_0xf8f137-0x0;var _0x4bc7f2=_0x6fc8[_0xf8f137];return _0x4bc7f2;};'use strict';var Sequelize=require(_0x86fc('0x0'));module[_0x86fc('0x1')]={'name':{'type':Sequelize[_0x86fc('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x86fc('0x3')](_0x86fc('0x4'),_0x86fc('0x5'),_0x86fc('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x86fc('0x3')](_0x86fc('0x7'),_0x86fc('0x8'))},'data1':{'type':Sequelize[_0x86fc('0x2')],'comment':_0x86fc('0x9')},'data2':{'type':Sequelize[_0x86fc('0x2')],'comment':_0x86fc('0xa')},'data3':{'type':Sequelize[_0x86fc('0x2')],'comment':_0x86fc('0xb')},'data4':{'type':Sequelize[_0x86fc('0x2')],'comment':_0x86fc('0xc')},'data5':{'type':Sequelize['TEXT'],'comment':_0x86fc('0xd')},'data6':{'type':Sequelize[_0x86fc('0xe')],'comment':_0x86fc('0xf')},'data7':{'type':Sequelize[_0x86fc('0xe')],'comment':_0x86fc('0x10')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 1c8c72c..d6d28d4 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc31f=['name','padEnd','slice','map','CloudProvider','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','count','includeAll','findAll','rows','service','decryptString','data3','catch','show','params','include','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','data5','data6','refresh_token','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','update','then','error','stack'];(function(_0x3a2c92,_0x409f57){var _0x4433a1=function(_0x410efc){while(--_0x410efc){_0x3a2c92['push'](_0x3a2c92['shift']());}};_0x4433a1(++_0x409f57);}(_0xc31f,0x105));var _0xfc31=function(_0x16a4a8,_0x275cb8){_0x16a4a8=_0x16a4a8-0x0;var _0x319271=_0xc31f[_0x16a4a8];return _0x319271;};'use strict';var _=require(_0xfc31('0x0'));var Redis=require('ioredis');var qs=require(_0xfc31('0x1'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0xfc31('0x2'))('api');var db=require(_0xfc31('0x3'))['db'];var oauth=require(_0xfc31('0x4'));config[_0xfc31('0x5')]=_[_0xfc31('0x6')](config[_0xfc31('0x5')],{'host':_0xfc31('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfc31('0x5')]));var redis=new Redis(config[_0xfc31('0x5')]);function respondWithStatusCode(_0x524c16,_0x20bd3b){_0x20bd3b=_0x20bd3b||0xcc;return function(_0x52d385){if(_0x52d385){return _0x524c16[_0xfc31('0x8')](_0x20bd3b);}return _0x524c16['status'](_0x20bd3b)[_0xfc31('0x9')]();};}function respondWithResult(_0x574621,_0x1d52dd){_0x1d52dd=_0x1d52dd||0xc8;return function(_0x5e82f0){if(_0x5e82f0){return _0x574621[_0xfc31('0xa')](_0x1d52dd)[_0xfc31('0xb')](_0x5e82f0);}};}function respondWithFilteredResult(_0x3a4e9d,_0x1d9479){return function(_0x2abb57){if(_0x2abb57){var _0x56b022=typeof _0x1d9479['offset']===_0xfc31('0xc')&&typeof _0x1d9479[_0xfc31('0xd')]==='undefined';var _0x4598db=_0x2abb57['count'];var _0x1220e2=_0x56b022?0x0:_0x1d9479[_0xfc31('0xe')];var _0x101575=_0x56b022?_0x2abb57['count']:_0x1d9479[_0xfc31('0xe')]+_0x1d9479[_0xfc31('0xd')];var _0x44ba82;if(_0x101575>=_0x4598db){_0x101575=_0x4598db;_0x44ba82=0xc8;}else{_0x44ba82=0xce;}_0x3a4e9d['status'](_0x44ba82);return _0x3a4e9d[_0xfc31('0xf')](_0xfc31('0x10'),_0x1220e2+'-'+_0x101575+'/'+_0x4598db)[_0xfc31('0xb')](_0x2abb57);}return null;};}function saveUpdates(_0x35a670){return function(_0x38b1bb){if(_0x38b1bb){return _0x38b1bb[_0xfc31('0x11')](_0x35a670)[_0xfc31('0x12')](function(_0x4d7511){return _0x4d7511;});}return null;};}function removeEntity(_0x2e5a78){return function(_0x3f7b68){if(_0x3f7b68){return _0x3f7b68['destroy']()[_0xfc31('0x12')](function(){_0x2e5a78[_0xfc31('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f9912){return function(_0xff2187){if(!_0xff2187){_0x4f9912['sendStatus'](0x194);}return _0xff2187;};}function handleError(_0x14ba4a,_0x5dee54){_0x5dee54=_0x5dee54||0x1f4;return function(_0x48f908){logger[_0xfc31('0x13')](_0x48f908[_0xfc31('0x14')]);if(_0x48f908[_0xfc31('0x15')]){delete _0x48f908[_0xfc31('0x15')];}_0x14ba4a[_0xfc31('0xa')](_0x5dee54)['send'](_0x48f908);};}function maskClientSecret(_0x4dee06){return _[_0xfc31('0x16')](_0x4dee06[_0xfc31('0x17')](0x0,0x3),0x14,'*');}exports['index']=function(_0x5ac563,_0x524bce){var _0x9cdbf7={},_0x1a3a47={},_0x2d11a1={'count':0x0,'rows':[]};var _0x48a7ed=_[_0xfc31('0x18')](db[_0xfc31('0x19')][_0xfc31('0x1a')],function(_0xdd0ce5){return{'name':_0xdd0ce5[_0xfc31('0x1b')],'type':_0xdd0ce5[_0xfc31('0x1c')]['key']};});_0x1a3a47[_0xfc31('0x1d')]=_[_0xfc31('0x18')](_0x48a7ed,_0xfc31('0x15'));_0x1a3a47[_0xfc31('0x1e')]=_[_0xfc31('0x1f')](_0x5ac563[_0xfc31('0x1e')]);_0x1a3a47[_0xfc31('0x20')]=_['intersection'](_0x1a3a47[_0xfc31('0x1d')],_0x1a3a47[_0xfc31('0x1e')]);_0x9cdbf7[_0xfc31('0x21')]=_[_0xfc31('0x22')](_0x1a3a47['model'],qs[_0xfc31('0x23')](_0x5ac563[_0xfc31('0x1e')][_0xfc31('0x23')]));_0x9cdbf7['attributes']=_0x9cdbf7[_0xfc31('0x21')][_0xfc31('0x24')]?_0x9cdbf7[_0xfc31('0x21')]:_0x1a3a47[_0xfc31('0x1d')];if(!_0x5ac563[_0xfc31('0x1e')][_0xfc31('0x25')](_0xfc31('0x26'))){_0x9cdbf7[_0xfc31('0xd')]=qs[_0xfc31('0xd')](_0x5ac563['query'][_0xfc31('0xd')]);_0x9cdbf7[_0xfc31('0xe')]=qs['offset'](_0x5ac563[_0xfc31('0x1e')]['offset']);}_0x9cdbf7[_0xfc31('0x27')]=qs[_0xfc31('0x28')](_0x5ac563[_0xfc31('0x1e')][_0xfc31('0x28')]);_0x9cdbf7[_0xfc31('0x29')]=qs['filters'](_[_0xfc31('0x2a')](_0x5ac563[_0xfc31('0x1e')],_0x1a3a47[_0xfc31('0x20')]),_0x48a7ed);if(_0x5ac563[_0xfc31('0x1e')]['filter']){_0x9cdbf7[_0xfc31('0x29')]=_['merge'](_0x9cdbf7[_0xfc31('0x29')],{'$or':_[_0xfc31('0x18')](_0x48a7ed,function(_0xe9028c){if(_0xe9028c[_0xfc31('0x1c')]!==_0xfc31('0x2b')){var _0xf0eff0={};_0xf0eff0[_0xe9028c['name']]={'$like':'%'+_0x5ac563['query'][_0xfc31('0x2c')]+'%'};return _0xf0eff0;}})});}_0x9cdbf7=_[_0xfc31('0x2d')]({},_0x9cdbf7,_0x5ac563[_0xfc31('0x2e')]);var _0x238227={'where':_0x9cdbf7['where']};return db[_0xfc31('0x19')][_0xfc31('0x2f')](_0x238227)[_0xfc31('0x12')](function(_0x16c3c6){_0x2d11a1['count']=_0x16c3c6;if(_0x5ac563[_0xfc31('0x1e')][_0xfc31('0x30')]){_0x9cdbf7['include']=[{'all':!![]}];}return db['CloudProvider'][_0xfc31('0x31')](_0x9cdbf7);})[_0xfc31('0x12')](function(_0x4b855b){_0x2d11a1[_0xfc31('0x32')]=_[_0xfc31('0x18')](_0x4b855b,function(_0x3108fd){if(_0x3108fd[_0xfc31('0x33')]==='MicrosoftAzure'){var _0x2af9fd=encryptor[_0xfc31('0x34')](_0x3108fd[_0xfc31('0x35')]);_0x3108fd[_0xfc31('0x35')]=maskClientSecret(_0x2af9fd);}return _0x3108fd;});return _0x2d11a1;})['then'](respondWithFilteredResult(_0x524bce,_0x9cdbf7))[_0xfc31('0x36')](handleError(_0x524bce,null));};exports[_0xfc31('0x37')]=function(_0x2ce943,_0xe8504){var _0xa5cbad={'raw':!![],'where':{'id':_0x2ce943[_0xfc31('0x38')]['id']}},_0x51e57d={};_0x51e57d[_0xfc31('0x1d')]=_['keys'](db[_0xfc31('0x19')]['rawAttributes']);_0x51e57d[_0xfc31('0x1e')]=_[_0xfc31('0x1f')](_0x2ce943['query']);_0x51e57d[_0xfc31('0x20')]=_[_0xfc31('0x22')](_0x51e57d[_0xfc31('0x1d')],_0x51e57d[_0xfc31('0x1e')]);_0xa5cbad[_0xfc31('0x21')]=_[_0xfc31('0x22')](_0x51e57d['model'],qs[_0xfc31('0x23')](_0x2ce943[_0xfc31('0x1e')][_0xfc31('0x23')]));_0xa5cbad[_0xfc31('0x21')]=_0xa5cbad[_0xfc31('0x21')][_0xfc31('0x24')]?_0xa5cbad[_0xfc31('0x21')]:_0x51e57d[_0xfc31('0x1d')];if(_0x2ce943[_0xfc31('0x1e')][_0xfc31('0x30')]){_0xa5cbad[_0xfc31('0x39')]=[{'all':!![]}];}_0xa5cbad=_['merge']({},_0xa5cbad,_0x2ce943['options']);return db[_0xfc31('0x19')][_0xfc31('0x3a')](_0xa5cbad)[_0xfc31('0x12')](handleEntityNotFound(_0xe8504,null))[_0xfc31('0x12')](function(_0x22de38){if(_0x22de38[_0xfc31('0x33')]===_0xfc31('0x3b')){var _0x5437d4=encryptor[_0xfc31('0x34')](_0x22de38['data3']);_0x22de38['data3']=maskClientSecret(_0x5437d4);}return _0x22de38;})[_0xfc31('0x12')](respondWithResult(_0xe8504,null))[_0xfc31('0x36')](handleError(_0xe8504,null));};exports[_0xfc31('0x3c')]=function(_0x2bb395,_0x21834d){if(!_0x2bb395[_0xfc31('0x3d')]['name'])throw new Error(_0xfc31('0x3e'));if(!_0x2bb395['body'][_0xfc31('0x33')])throw new Error(_0xfc31('0x3f'));var _0x5efdea=db[_0xfc31('0x19')][_0xfc31('0x1a')][_0xfc31('0x33')][_0xfc31('0x40')];if(!_0x5efdea['includes'](_0x2bb395[_0xfc31('0x3d')][_0xfc31('0x33')]))throw new Error(_0xfc31('0x41')+_0x5efdea[_0xfc31('0x42')](',\x20'));if(_0x2bb395['body'][_0xfc31('0x33')]===_0xfc31('0x3b')&&_0x2bb395[_0xfc31('0x3d')]['data3']){_0x2bb395[_0xfc31('0x3d')]['data3']=encryptor['encryptString'](_0x2bb395[_0xfc31('0x3d')][_0xfc31('0x35')]);}return db[_0xfc31('0x19')][_0xfc31('0x3c')](_0x2bb395[_0xfc31('0x3d')],{})['then'](respondWithResult(_0x21834d,0xc9))[_0xfc31('0x36')](handleError(_0x21834d,null));};exports[_0xfc31('0x11')]=function(_0x5b07c2,_0x54d8dc){if(_0x5b07c2[_0xfc31('0x3d')]['id']){delete _0x5b07c2[_0xfc31('0x3d')]['id'];}return db[_0xfc31('0x19')][_0xfc31('0x3a')]({'where':{'id':_0x5b07c2[_0xfc31('0x38')]['id']}})[_0xfc31('0x12')](handleEntityNotFound(_0x54d8dc,null))[_0xfc31('0x12')](function(_0x40fcec){if(_0x40fcec[_0xfc31('0x33')]===_0xfc31('0x3b')&&_0x5b07c2[_0xfc31('0x3d')][_0xfc31('0x35')]){_0x5b07c2[_0xfc31('0x3d')][_0xfc31('0x35')]=encryptor[_0xfc31('0x43')](_0x5b07c2['body'][_0xfc31('0x35')]);}return _0x40fcec;})['then'](saveUpdates(_0x5b07c2[_0xfc31('0x3d')],null))[_0xfc31('0x12')](respondWithResult(_0x54d8dc,null))[_0xfc31('0x36')](handleError(_0x54d8dc,null));};exports[_0xfc31('0x44')]=function(_0x57cf8e,_0x26b1f4){return db[_0xfc31('0x19')][_0xfc31('0x3a')]({'where':{'id':_0x57cf8e[_0xfc31('0x38')]['id']}})[_0xfc31('0x12')](handleEntityNotFound(_0x26b1f4,null))['then'](removeEntity(_0x26b1f4,null))[_0xfc31('0x36')](handleError(_0x26b1f4,null));};exports[_0xfc31('0x45')]=function(_0x282e5a,_0x3552e1){return db[_0xfc31('0x19')][_0xfc31('0x46')]({'where':{'id':_0x282e5a[_0xfc31('0x38')]['id']},'raw':!![]})[_0xfc31('0x12')](function(_0xf12c22){if(!_0xf12c22)return _0x3552e1[_0xfc31('0x8')](0x194);return{'url':oauth[_0xfc31('0x47')](_0xf12c22,_0x282e5a[_0xfc31('0x48')]['id'])};})[_0xfc31('0x12')](respondWithResult(_0x3552e1,null))[_0xfc31('0x36')](handleError(_0x3552e1,null));};exports[_0xfc31('0x49')]=function(_0x3047aa,_0x660dea){var _0x246d7d=_0x3047aa[_0xfc31('0x3d')];var _0x58190a;var _0x416c02;if(_0x246d7d[_0xfc31('0x13')])throw _0x246d7d;redis[_0xfc31('0x4a')](_0x246d7d[_0xfc31('0x4b')])[_0xfc31('0x12')](function(_0x1f0c5a){if(!_0x1f0c5a)throw new Error(_0xfc31('0x4c'));_0x58190a=JSON[_0xfc31('0x4d')](_0x1f0c5a);var _0x206811=Buffer[_0xfc31('0x4e')](_0x246d7d[_0xfc31('0x4b')],_0xfc31('0x4f'))[_0xfc31('0x50')](_0xfc31('0x51'));_0x416c02=JSON[_0xfc31('0x4d')](_0x206811);if(!oauth[_0xfc31('0x52')](_0x246d7d[_0xfc31('0x53')],_0x58190a['oauth2Claims']))throw new Error(_0xfc31('0x54'));redis[_0xfc31('0x55')](_0x246d7d[_0xfc31('0x4b')]);return oauth['getOauth2MicrosoftAccessToken'](_0x246d7d['code'],_0x58190a);})[_0xfc31('0x12')](function(_0x13781f){_0x58190a[_0xfc31('0x56')]=_0x13781f['access_token'];_0x58190a[_0xfc31('0x57')]=_0x13781f[_0xfc31('0x58')];return db[_0xfc31('0x19')][_0xfc31('0x11')]({'data5':_0x58190a[_0xfc31('0x56')],'data6':_0x58190a[_0xfc31('0x57')]},{'where':{'id':_0x58190a['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x58190a);socket[_0xfc31('0x59')]('microsoftAuthorization:success',{'id':_0x416c02['id']});return;})[_0xfc31('0x12')](respondWithStatusCode(_0x660dea,null))['catch'](function(_0x384bfc){if(_0x416c02){socket[_0xfc31('0x59')](_0xfc31('0x5a'),{'id':_0x416c02['id']});}if(!_0x58190a){logger[_0xfc31('0x13')](_0xfc31('0x5b'),_0x384bfc);return _0x660dea[_0xfc31('0xa')](0x1f4)['send'](_0x384bfc['message']);}logger[_0xfc31('0x13')](_0xfc31('0x5c'),_0x58190a['id'],JSON[_0xfc31('0x5d')](_0x384bfc));});}; \ No newline at end of file +var _0x46d7=['socket.io-emitter','sendStatus','json','offset','undefined','count','limit','status','set','Content-Range','update','then','end','error','name','send','padEnd','slice','index','CloudProvider','rawAttributes','fieldName','map','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','MicrosoftAzure','decryptString','data3','catch','show','params','keys','fields','includeAll','include','find','service','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','encryptString','findOne','generateMicrosoftAuthorizationUrl','state','parse','base64','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x46d7,0x15a));var _0x746d=function(_0x46e3ad,_0x27b6a1){_0x46e3ad=_0x46e3ad-0x0;var _0x3947c6=_0x46d7[_0x46e3ad];return _0x3947c6;};'use strict';var _=require(_0x746d('0x0'));var Redis=require(_0x746d('0x1'));var qs=require(_0x746d('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x746d('0x3'));var logger=require(_0x746d('0x4'))(_0x746d('0x5'));var db=require(_0x746d('0x6'))['db'];var oauth=require(_0x746d('0x7'));config['redis']=_[_0x746d('0x8')](config[_0x746d('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x746d('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x746d('0x9')]);function respondWithStatusCode(_0x272aed,_0x5b4915){_0x5b4915=_0x5b4915||0xcc;return function(_0x414974){if(_0x414974){return _0x272aed[_0x746d('0xb')](_0x5b4915);}return _0x272aed['status'](_0x5b4915)['end']();};}function respondWithResult(_0x1047a3,_0x29c98){_0x29c98=_0x29c98||0xc8;return function(_0x4b7690){if(_0x4b7690){return _0x1047a3['status'](_0x29c98)[_0x746d('0xc')](_0x4b7690);}};}function respondWithFilteredResult(_0x255b3b,_0x4af3e5){return function(_0x4157d6){if(_0x4157d6){var _0x1ccae1=typeof _0x4af3e5[_0x746d('0xd')]===_0x746d('0xe')&&typeof _0x4af3e5['limit']==='undefined';var _0x449bd3=_0x4157d6[_0x746d('0xf')];var _0x434b8a=_0x1ccae1?0x0:_0x4af3e5[_0x746d('0xd')];var _0x4fa766=_0x1ccae1?_0x4157d6[_0x746d('0xf')]:_0x4af3e5[_0x746d('0xd')]+_0x4af3e5[_0x746d('0x10')];var _0x1d56ba;if(_0x4fa766>=_0x449bd3){_0x4fa766=_0x449bd3;_0x1d56ba=0xc8;}else{_0x1d56ba=0xce;}_0x255b3b[_0x746d('0x11')](_0x1d56ba);return _0x255b3b[_0x746d('0x12')](_0x746d('0x13'),_0x434b8a+'-'+_0x4fa766+'/'+_0x449bd3)['json'](_0x4157d6);}return null;};}function saveUpdates(_0x3a550a){return function(_0xe92eef){if(_0xe92eef){return _0xe92eef[_0x746d('0x14')](_0x3a550a)[_0x746d('0x15')](function(_0x538fb2){return _0x538fb2;});}return null;};}function removeEntity(_0x347c08){return function(_0x556e85){if(_0x556e85){return _0x556e85['destroy']()[_0x746d('0x15')](function(){_0x347c08[_0x746d('0x11')](0xcc)[_0x746d('0x16')]();});}};}function handleEntityNotFound(_0x319bdf){return function(_0x1025c2){if(!_0x1025c2){_0x319bdf[_0x746d('0xb')](0x194);}return _0x1025c2;};}function handleError(_0x69b0b6,_0x422b8c){_0x422b8c=_0x422b8c||0x1f4;return function(_0x4fceac){logger[_0x746d('0x17')](_0x4fceac['stack']);if(_0x4fceac['name']){delete _0x4fceac[_0x746d('0x18')];}_0x69b0b6[_0x746d('0x11')](_0x422b8c)[_0x746d('0x19')](_0x4fceac);};}function maskClientSecret(_0x267adb){return _[_0x746d('0x1a')](_0x267adb[_0x746d('0x1b')](0x0,0x3),0x14,'*');}exports[_0x746d('0x1c')]=function(_0x13f80a,_0x73ab28){var _0x50c61f={},_0x261efc={},_0x469d39={'count':0x0,'rows':[]};var _0x19a22c=_['map'](db[_0x746d('0x1d')][_0x746d('0x1e')],function(_0x102c54){return{'name':_0x102c54[_0x746d('0x1f')],'type':_0x102c54['type']['key']};});_0x261efc['model']=_[_0x746d('0x20')](_0x19a22c,_0x746d('0x18'));_0x261efc[_0x746d('0x21')]=_['keys'](_0x13f80a[_0x746d('0x21')]);_0x261efc[_0x746d('0x22')]=_[_0x746d('0x23')](_0x261efc[_0x746d('0x24')],_0x261efc[_0x746d('0x21')]);_0x50c61f[_0x746d('0x25')]=_[_0x746d('0x23')](_0x261efc[_0x746d('0x24')],qs['fields'](_0x13f80a['query']['fields']));_0x50c61f[_0x746d('0x25')]=_0x50c61f[_0x746d('0x25')][_0x746d('0x26')]?_0x50c61f[_0x746d('0x25')]:_0x261efc['model'];if(!_0x13f80a[_0x746d('0x21')]['hasOwnProperty'](_0x746d('0x27'))){_0x50c61f['limit']=qs[_0x746d('0x10')](_0x13f80a['query']['limit']);_0x50c61f[_0x746d('0xd')]=qs[_0x746d('0xd')](_0x13f80a[_0x746d('0x21')][_0x746d('0xd')]);}_0x50c61f[_0x746d('0x28')]=qs['sort'](_0x13f80a[_0x746d('0x21')][_0x746d('0x29')]);_0x50c61f[_0x746d('0x2a')]=qs[_0x746d('0x22')](_[_0x746d('0x2b')](_0x13f80a['query'],_0x261efc[_0x746d('0x22')]),_0x19a22c);if(_0x13f80a[_0x746d('0x21')][_0x746d('0x2c')]){_0x50c61f[_0x746d('0x2a')]=_[_0x746d('0x2d')](_0x50c61f[_0x746d('0x2a')],{'$or':_[_0x746d('0x20')](_0x19a22c,function(_0x2abf9f){if(_0x2abf9f[_0x746d('0x2e')]!==_0x746d('0x2f')){var _0xc45121={};_0xc45121[_0x2abf9f[_0x746d('0x18')]]={'$like':'%'+_0x13f80a[_0x746d('0x21')][_0x746d('0x2c')]+'%'};return _0xc45121;}})});}_0x50c61f=_[_0x746d('0x2d')]({},_0x50c61f,_0x13f80a[_0x746d('0x30')]);var _0x530409={'where':_0x50c61f[_0x746d('0x2a')]};return db[_0x746d('0x1d')]['count'](_0x530409)[_0x746d('0x15')](function(_0x607a21){_0x469d39[_0x746d('0xf')]=_0x607a21;if(_0x13f80a[_0x746d('0x21')]['includeAll']){_0x50c61f['include']=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x50c61f);})[_0x746d('0x15')](function(_0x46219f){_0x469d39['rows']=_[_0x746d('0x20')](_0x46219f,function(_0x56f45e){if(_0x56f45e['service']===_0x746d('0x31')){var _0x37e316=encryptor[_0x746d('0x32')](_0x56f45e[_0x746d('0x33')]);_0x56f45e['data3']=maskClientSecret(_0x37e316);}return _0x56f45e;});return _0x469d39;})[_0x746d('0x15')](respondWithFilteredResult(_0x73ab28,_0x50c61f))[_0x746d('0x34')](handleError(_0x73ab28,null));};exports[_0x746d('0x35')]=function(_0x2a48ab,_0x40fa09){var _0x503748={'raw':!![],'where':{'id':_0x2a48ab[_0x746d('0x36')]['id']}},_0x5a2822={};_0x5a2822[_0x746d('0x24')]=_[_0x746d('0x37')](db['CloudProvider'][_0x746d('0x1e')]);_0x5a2822['query']=_[_0x746d('0x37')](_0x2a48ab[_0x746d('0x21')]);_0x5a2822['filters']=_[_0x746d('0x23')](_0x5a2822['model'],_0x5a2822[_0x746d('0x21')]);_0x503748['attributes']=_[_0x746d('0x23')](_0x5a2822[_0x746d('0x24')],qs['fields'](_0x2a48ab['query'][_0x746d('0x38')]));_0x503748[_0x746d('0x25')]=_0x503748[_0x746d('0x25')][_0x746d('0x26')]?_0x503748[_0x746d('0x25')]:_0x5a2822['model'];if(_0x2a48ab['query'][_0x746d('0x39')]){_0x503748[_0x746d('0x3a')]=[{'all':!![]}];}_0x503748=_[_0x746d('0x2d')]({},_0x503748,_0x2a48ab['options']);return db[_0x746d('0x1d')][_0x746d('0x3b')](_0x503748)['then'](handleEntityNotFound(_0x40fa09,null))[_0x746d('0x15')](function(_0xcbb97f){if(_0xcbb97f[_0x746d('0x3c')]===_0x746d('0x31')){var _0xea4b3d=encryptor[_0x746d('0x32')](_0xcbb97f[_0x746d('0x33')]);_0xcbb97f[_0x746d('0x33')]=maskClientSecret(_0xea4b3d);}return _0xcbb97f;})[_0x746d('0x15')](respondWithResult(_0x40fa09,null))['catch'](handleError(_0x40fa09,null));};exports[_0x746d('0x3d')]=function(_0x4ab7cd,_0x25d26c){if(!_0x4ab7cd[_0x746d('0x3e')][_0x746d('0x18')])throw new Error(_0x746d('0x3f'));if(!_0x4ab7cd[_0x746d('0x3e')]['service'])throw new Error(_0x746d('0x40'));var _0x25919d=db[_0x746d('0x1d')][_0x746d('0x1e')][_0x746d('0x3c')][_0x746d('0x41')];if(!_0x25919d[_0x746d('0x42')](_0x4ab7cd[_0x746d('0x3e')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x25919d['join'](',\x20'));if(_0x4ab7cd['body'][_0x746d('0x3c')]==='MicrosoftAzure'&&_0x4ab7cd[_0x746d('0x3e')][_0x746d('0x33')]){_0x4ab7cd[_0x746d('0x3e')][_0x746d('0x33')]=encryptor['encryptString'](_0x4ab7cd[_0x746d('0x3e')][_0x746d('0x33')]);}return db[_0x746d('0x1d')][_0x746d('0x3d')](_0x4ab7cd[_0x746d('0x3e')],{})[_0x746d('0x15')](respondWithResult(_0x25d26c,0xc9))['catch'](handleError(_0x25d26c,null));};exports[_0x746d('0x14')]=function(_0xe02ad7,_0x5c926e){if(_0xe02ad7[_0x746d('0x3e')]['id']){delete _0xe02ad7[_0x746d('0x3e')]['id'];}return db[_0x746d('0x1d')]['find']({'where':{'id':_0xe02ad7['params']['id']}})['then'](handleEntityNotFound(_0x5c926e,null))[_0x746d('0x15')](function(_0x4204dd){if(_0x4204dd[_0x746d('0x3c')]===_0x746d('0x31')&&_0xe02ad7['body'][_0x746d('0x33')]){_0xe02ad7[_0x746d('0x3e')]['data3']=encryptor[_0x746d('0x43')](_0xe02ad7[_0x746d('0x3e')]['data3']);}return _0x4204dd;})[_0x746d('0x15')](saveUpdates(_0xe02ad7[_0x746d('0x3e')],null))['then'](respondWithResult(_0x5c926e,null))[_0x746d('0x34')](handleError(_0x5c926e,null));};exports['destroy']=function(_0x5f2734,_0x91f6ae){return db[_0x746d('0x1d')][_0x746d('0x3b')]({'where':{'id':_0x5f2734['params']['id']}})[_0x746d('0x15')](handleEntityNotFound(_0x91f6ae,null))[_0x746d('0x15')](removeEntity(_0x91f6ae,null))['catch'](handleError(_0x91f6ae,null));};exports['oauth2MicrosoftAuthorize']=function(_0x2bf66d,_0x39427e){return db[_0x746d('0x1d')][_0x746d('0x44')]({'where':{'id':_0x2bf66d['params']['id']},'raw':!![]})[_0x746d('0x15')](function(_0x30d28b){if(!_0x30d28b)return _0x39427e['sendStatus'](0x194);return{'url':oauth[_0x746d('0x45')](_0x30d28b,_0x2bf66d['user']['id'])};})[_0x746d('0x15')](respondWithResult(_0x39427e,null))['catch'](handleError(_0x39427e,null));};exports['oauth2MicrosoftCallback']=function(_0x40326f,_0x57c3c9){var _0x32a28b=_0x40326f[_0x746d('0x3e')];var _0x5cc58d;var _0x359c92;if(_0x32a28b[_0x746d('0x17')])throw _0x32a28b;redis['get'](_0x32a28b[_0x746d('0x46')])['then'](function(_0x45bab5){if(!_0x45bab5)throw new Error('Invalid\x20state\x20parameter');_0x5cc58d=JSON[_0x746d('0x47')](_0x45bab5);var _0x249ecb=Buffer['from'](_0x32a28b['state'],_0x746d('0x48'))['toString'](_0x746d('0x49'));_0x359c92=JSON[_0x746d('0x47')](_0x249ecb);if(!oauth['isValidIdToken'](_0x32a28b[_0x746d('0x4a')],_0x5cc58d[_0x746d('0x4b')]))throw new Error(_0x746d('0x4c'));redis[_0x746d('0x4d')](_0x32a28b['state']);return oauth[_0x746d('0x4e')](_0x32a28b[_0x746d('0x4f')],_0x5cc58d);})[_0x746d('0x15')](function(_0x36321b){_0x5cc58d[_0x746d('0x50')]=_0x36321b[_0x746d('0x51')];_0x5cc58d[_0x746d('0x52')]=_0x36321b['refresh_token'];return db[_0x746d('0x1d')][_0x746d('0x14')]({'data5':_0x5cc58d[_0x746d('0x50')],'data6':_0x5cc58d[_0x746d('0x52')]},{'where':{'id':_0x5cc58d['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x5cc58d);socket[_0x746d('0x53')](_0x746d('0x54'),{'id':_0x359c92['id']});return;})[_0x746d('0x15')](respondWithStatusCode(_0x57c3c9,null))['catch'](function(_0x5f4660){if(_0x359c92){socket[_0x746d('0x53')](_0x746d('0x55'),{'id':_0x359c92['id']});}if(!_0x5cc58d){logger[_0x746d('0x17')]('Invalid\x20authentication\x20state\x20parameter',_0x5f4660);return _0x57c3c9[_0x746d('0x11')](0x1f4)[_0x746d('0x19')](_0x5f4660[_0x746d('0x56')]);}logger[_0x746d('0x17')](_0x746d('0x57'),_0x5cc58d['id'],JSON[_0x746d('0x58')](_0x5f4660));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 91f7e3a..a3608bc 100644 --- a/server/api/cloudProvider/cloudProvider.model.js +++ b/server/api/cloudProvider/cloudProvider.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x51dc=['CloudProvider','cloud_providers','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cloudProvider.attributes'];(function(_0x6c77bb,_0xa00580){var _0x3932f7=function(_0x12e066){while(--_0x12e066){_0x6c77bb['push'](_0x6c77bb['shift']());}};_0x3932f7(++_0xa00580);}(_0x51dc,0x1af));var _0xc51d=function(_0x129d3b,_0x4f181a){_0x129d3b=_0x129d3b-0x0;var _0x35281d=_0x51dc[_0x129d3b];return _0x35281d;};'use strict';var _=require(_0xc51d('0x0'));var util=require('util');var logger=require(_0xc51d('0x1'))(_0xc51d('0x2'));var moment=require(_0xc51d('0x3'));var BPromise=require(_0xc51d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc51d('0x5'));var rimraf=require(_0xc51d('0x6'));var config=require(_0xc51d('0x7'));var attributes=require(_0xc51d('0x8'));module['exports']=function(_0x28f889,_0x53fd3c){return _0x28f889['define'](_0xc51d('0x9'),attributes,{'tableName':_0xc51d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x556b=['path','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','api','moment'];(function(_0x357141,_0x4ca2e8){var _0x4e8661=function(_0xba31c4){while(--_0xba31c4){_0x357141['push'](_0x357141['shift']());}};_0x4e8661(++_0x4ca2e8);}(_0x556b,0x18c));var _0xb556=function(_0xcb4c93,_0x3bc387){_0xcb4c93=_0xcb4c93-0x0;var _0x39ce92=_0x556b[_0xcb4c93];return _0x39ce92;};'use strict';var _=require(_0xb556('0x0'));var util=require(_0xb556('0x1'));var logger=require('../../config/logger')(_0xb556('0x2'));var moment=require(_0xb556('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb556('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb556('0x5'));module[_0xb556('0x6')]=function(_0x59cfd2,_0x9074f3){return _0x59cfd2[_0xb556('0x7')](_0xb556('0x8'),attributes,{'tableName':_0xb556('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 52b929b..412aa21 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x67b7=['resolve','then','data3','CloudProvider','findOne','data6','data4','POST','access_token','refresh_token','update','data5','catch','error','authorization_code','decryptString','intervals','bind','findAll','all','inspect','exports','lodash','crypto','jsonwebtoken','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','openid','/token','map','type','push','join','Outlook365','Dynamics365','data7','/.default','replace','{TENANT_ID}','data2','code','id_token','from','stringify','randomBytes','client_id','data1','response_type','form_post','state','nonce','key','oauth2/','set','decode','payload','issuer','aud','audience','exp'];(function(_0x4eb00b,_0x22adaf){var _0x2dd4bf=function(_0x5e3d6e){while(--_0x5e3d6e){_0x4eb00b['push'](_0x4eb00b['shift']());}};_0x2dd4bf(++_0x22adaf);}(_0x67b7,0x136));var _0x767b=function(_0x479744,_0x1c7d54){_0x479744=_0x479744-0x0;var _0x1f33ae=_0x67b7[_0x479744];return _0x1f33ae;};'use strict';var _=require(_0x767b('0x0'));var crypto=require(_0x767b('0x1'));var jwt=require(_0x767b('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require(_0x767b('0x3'));var util=require(_0x767b('0x4'));var encryptor=require(_0x767b('0x5'));var config=require(_0x767b('0x6'));var logger=require(_0x767b('0x7'))('api');var schedule=require(_0x767b('0x8'));var db=require('../../mysqldb')['db'];config[_0x767b('0x9')]=_[_0x767b('0xa')](config[_0x767b('0x9')],{'host':'localhost','port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x767b('0xb');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x767b('0xc'),_0x767b('0xd'),_0x767b('0xe'),_0x767b('0xf'),_0x767b('0x10'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x767b('0x11'),_0x767b('0xe')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x767b('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x299999){var _0x5b86bc=_[_0x767b('0x13')](AZURE_AUTH_SCOPES[_0x299999[_0x767b('0x14')]]);if(_0x299999['type']==='Dynamics365')_0x5b86bc[_0x767b('0x15')](_0x299999['data7']+'/.default');return _0x5b86bc[_0x767b('0x16')]('\x20');}function getAccessTokenScope(_0x54be58){if(_0x54be58[_0x767b('0x14')]===_0x767b('0x17'))return _0x767b('0xf');if(_0x54be58[_0x767b('0x14')]===_0x767b('0x18'))return _0x54be58[_0x767b('0x19')]+_0x767b('0x1a');}function generateMicrosoftAuthorizationUrl(_0x3fe469,_0x28113d){var _0x544349=MICROSOFT_AUTH_URL[_0x767b('0x1b')](_0x767b('0x1c'),_0x3fe469[_0x767b('0x1d')]);var _0x36d169=[_0x767b('0x1e'),_0x767b('0x1f')];var _0x41c90a=Buffer[_0x767b('0x20')](JSON[_0x767b('0x21')]({'id':_0x28113d}))['toString']('base64');var _0x3a6c54=crypto[_0x767b('0x22')](0x10)['toString']('hex');var _0x2e98d2=getAuthorizationScopes(_0x3fe469);var _0x198c6c=[{'key':_0x767b('0x23'),'value':_0x3fe469[_0x767b('0x24')]},{'key':_0x767b('0x25'),'value':encodeURIComponent(_0x36d169['join']('\x20'))},{'key':'redirect_uri','value':_0x3fe469['data4']},{'key':'response_mode','value':_0x767b('0x26')},{'key':'scope','value':encodeURIComponent(_0x2e98d2)},{'key':_0x767b('0x27'),'value':_0x41c90a},{'key':_0x767b('0x28'),'value':_0x3a6c54},{'key':'prompt','value':'login'}];var _0x19416b=_0x544349+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x767b('0x13')](_0x198c6c,function(_0x145080){return _0x145080[_0x767b('0x29')]+'='+_0x145080['value'];})[_0x767b('0x16')]('&');_0x3fe469['oauth2Claims']={'issuer':_0x544349[_0x767b('0x1b')](_0x767b('0x2a'),''),'audience':_0x3fe469[_0x767b('0x24')],'state':_0x41c90a,'nonce':_0x3a6c54};redis[_0x767b('0x2b')](_0x41c90a,JSON[_0x767b('0x21')](_0x3fe469));return _0x19416b;}function isValidIdToken(_0x43726c,_0xa9fd98){try{var _0x465ec4=jwt[_0x767b('0x2c')](_0x43726c,{'complete':!![]});var _0x564abb=_0x465ec4[_0x767b('0x2d')];if(_0x564abb['iss']!==_0xa9fd98[_0x767b('0x2e')])return![];if(_0x564abb[_0x767b('0x2f')]!==_0xa9fd98[_0x767b('0x30')])return![];if(_0x564abb['nonce']!==_0xa9fd98[_0x767b('0x28')])return![];if(moment()['isAfter'](moment['unix'](_0x564abb[_0x767b('0x31')])))return![];return!![];}catch(_0x24ce80){throw _0x24ce80;}}function refreshOauth2MicrosoftAccessToken(_0xcd83e0){return Promise[_0x767b('0x32')]()[_0x767b('0x33')](function(){if(_0xcd83e0[_0x767b('0x34')])return _0xcd83e0;return db[_0x767b('0x35')][_0x767b('0x36')]({'where':{'id':_0xcd83e0['id']},'raw':!![]});})[_0x767b('0x33')](function(_0x2af5ae){var _0x6ffb34={'grant_type':'refresh_token','refresh_token':_0x2af5ae[_0x767b('0x37')],'scope':getAccessTokenScope(_0x2af5ae),'redirect_uri':_0x2af5ae[_0x767b('0x38')],'client_id':_0x2af5ae[_0x767b('0x24')],'client_secret':encryptor['decryptString'](_0x2af5ae[_0x767b('0x34')])};var _0x6515b5={'method':_0x767b('0x39'),'uri':MICROSOFT_AUTH_URL['replace'](_0x767b('0x1c'),_0x2af5ae[_0x767b('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x6ffb34,'json':!![]};return rp(_0x6515b5);})[_0x767b('0x33')](function(_0x297fdc){_0xcd83e0['data5']=_0x297fdc[_0x767b('0x3a')];_0xcd83e0[_0x767b('0x37')]=_0x297fdc[_0x767b('0x3b')];return db[_0x767b('0x35')][_0x767b('0x3c')]({'data5':_0xcd83e0[_0x767b('0x3d')],'data6':_0xcd83e0[_0x767b('0x37')]},{'where':{'id':_0xcd83e0['id']}});})['then'](function(){return _0xcd83e0;})[_0x767b('0x3e')](function(_0x7fcd3d){logger[_0x767b('0x3f')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0xcd83e0['id'],_0x7fcd3d);});}function getOauth2MicrosoftAccessToken(_0x2f38ae,_0x998404){var _0x1a7f17={'grant_type':_0x767b('0x40'),'code':_0x2f38ae,'scope':getAccessTokenScope(_0x998404),'redirect_uri':_0x998404[_0x767b('0x38')],'client_id':_0x998404[_0x767b('0x24')],'client_secret':encryptor[_0x767b('0x41')](_0x998404[_0x767b('0x34')])};var _0x443047={'method':_0x767b('0x39'),'uri':MICROSOFT_AUTH_URL[_0x767b('0x1b')](_0x767b('0x1c'),_0x998404['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1a7f17,'json':!![]};return rp(_0x443047);}function startRefreshInterval(_0x4f67d1){var _0xb000c7=schedule[_0x767b('0x42')];if(_0xb000c7[_0x4f67d1['id']])clearInterval(_0xb000c7[_0x4f67d1['id']]);_0xb000c7[_0x4f67d1['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x767b('0x43')](this,{'id':_0x4f67d1['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x767b('0x42')]=_0xb000c7;}function startAllRefreshIntervals(){return db[_0x767b('0x35')][_0x767b('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x767b('0x33')](function(_0x203aa8){var _0x22f707=_0x203aa8['map'](function(_0x234c99){return refreshOauth2MicrosoftAccessToken(_0x234c99)[_0x767b('0x33')](function(_0xe7b633){startRefreshInterval(_0xe7b633);});});return Promise[_0x767b('0x45')](_0x22f707);})[_0x767b('0x3e')](function(_0x2a0b69){var _0x4d55df=_0x2a0b69?util[_0x767b('0x46')](_0x2a0b69,{'showHidden':![],'depth':null}):'';logger['error']('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x4d55df);});}module[_0x767b('0x47')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xb605=['data7','/.default','Outlook365','{TENANT_ID}','data2','id_token','from','toString','base64','randomBytes','hex','client_id','data1','redirect_uri','data4','form_post','scope','nonce','prompt','login','key','value','join','replace','set','stringify','decode','payload','audience','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','data5','access_token','update','catch','error','authorization_code','POST','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','util','../../components/encryptor','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','openid','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'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb605,0x145));var _0x5b60=function(_0x27c24e,_0x5db1c7){_0x27c24e=_0x27c24e-0x0;var _0x39004a=_0xb605[_0x27c24e];return _0x39004a;};'use strict';var _=require(_0x5b60('0x0'));var crypto=require(_0x5b60('0x1'));var jwt=require(_0x5b60('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0x5b60('0x3'));var encryptor=require(_0x5b60('0x4'));var config=require('../../config/environment');var logger=require(_0x5b60('0x5'))('api');var schedule=require(_0x5b60('0x6'));var db=require(_0x5b60('0x7'))['db'];config[_0x5b60('0x8')]=_[_0x5b60('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x5b60('0x8')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x5b60('0xa'),'profile',_0x5b60('0xb'),_0x5b60('0xc'),_0x5b60('0xd'),_0x5b60('0xe'),_0x5b60('0xf')],'Dynamics365':[_0x5b60('0xa'),_0x5b60('0xc')]};var MICROSOFT_AUTH_ENDPOINT=_0x5b60('0x10');var MICROSOFT_TOKEN_ENDPOINT=_0x5b60('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3ad09e){var _0xf6fc9e=_[_0x5b60('0x12')](AZURE_AUTH_SCOPES[_0x3ad09e[_0x5b60('0x13')]]);if(_0x3ad09e[_0x5b60('0x13')]==='Dynamics365')_0xf6fc9e['push'](_0x3ad09e[_0x5b60('0x14')]+_0x5b60('0x15'));return _0xf6fc9e['join']('\x20');}function getAccessTokenScope(_0xaef650){if(_0xaef650['type']===_0x5b60('0x16'))return _0x5b60('0xd');if(_0xaef650[_0x5b60('0x13')]==='Dynamics365')return _0xaef650['data7']+_0x5b60('0x15');}function generateMicrosoftAuthorizationUrl(_0x48d314,_0x8d987c){var _0x178f20=MICROSOFT_AUTH_URL['replace'](_0x5b60('0x17'),_0x48d314[_0x5b60('0x18')]);var _0x1ec039=['code',_0x5b60('0x19')];var _0xa724d7=Buffer[_0x5b60('0x1a')](JSON['stringify']({'id':_0x8d987c}))[_0x5b60('0x1b')](_0x5b60('0x1c'));var _0x17c442=crypto[_0x5b60('0x1d')](0x10)[_0x5b60('0x1b')](_0x5b60('0x1e'));var _0x259b14=getAuthorizationScopes(_0x48d314);var _0x32df78=[{'key':_0x5b60('0x1f'),'value':_0x48d314[_0x5b60('0x20')]},{'key':'response_type','value':encodeURIComponent(_0x1ec039['join']('\x20'))},{'key':_0x5b60('0x21'),'value':_0x48d314[_0x5b60('0x22')]},{'key':'response_mode','value':_0x5b60('0x23')},{'key':_0x5b60('0x24'),'value':encodeURIComponent(_0x259b14)},{'key':'state','value':_0xa724d7},{'key':_0x5b60('0x25'),'value':_0x17c442},{'key':_0x5b60('0x26'),'value':_0x5b60('0x27')}];var _0x341718=_0x178f20+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x5b60('0x12')](_0x32df78,function(_0xd23e74){return _0xd23e74[_0x5b60('0x28')]+'='+_0xd23e74[_0x5b60('0x29')];})[_0x5b60('0x2a')]('&');_0x48d314['oauth2Claims']={'issuer':_0x178f20[_0x5b60('0x2b')]('oauth2/',''),'audience':_0x48d314['data1'],'state':_0xa724d7,'nonce':_0x17c442};redis[_0x5b60('0x2c')](_0xa724d7,JSON[_0x5b60('0x2d')](_0x48d314));return _0x341718;}function isValidIdToken(_0x44f133,_0x53ea1b){try{var _0x1620b3=jwt[_0x5b60('0x2e')](_0x44f133,{'complete':!![]});var _0x16c2f8=_0x1620b3[_0x5b60('0x2f')];if(_0x16c2f8['iss']!==_0x53ea1b['issuer'])return![];if(_0x16c2f8['aud']!==_0x53ea1b[_0x5b60('0x30')])return![];if(_0x16c2f8[_0x5b60('0x25')]!==_0x53ea1b[_0x5b60('0x25')])return![];if(moment()['isAfter'](moment['unix'](_0x16c2f8['exp'])))return![];return!![];}catch(_0x553f62){throw _0x553f62;}}function refreshOauth2MicrosoftAccessToken(_0x5c817f){return Promise['resolve']()[_0x5b60('0x31')](function(){if(_0x5c817f[_0x5b60('0x32')])return _0x5c817f;return db[_0x5b60('0x33')][_0x5b60('0x34')]({'where':{'id':_0x5c817f['id']},'raw':!![]});})[_0x5b60('0x31')](function(_0x18745f){var _0x2d0927={'grant_type':_0x5b60('0x35'),'refresh_token':_0x18745f[_0x5b60('0x36')],'scope':getAccessTokenScope(_0x18745f),'redirect_uri':_0x18745f['data4'],'client_id':_0x18745f['data1'],'client_secret':encryptor[_0x5b60('0x37')](_0x18745f[_0x5b60('0x32')])};var _0x53a53b={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x5b60('0x2b')](_0x5b60('0x17'),_0x18745f[_0x5b60('0x18')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2d0927,'json':!![]};return rp(_0x53a53b);})['then'](function(_0x3aa029){_0x5c817f[_0x5b60('0x38')]=_0x3aa029[_0x5b60('0x39')];_0x5c817f[_0x5b60('0x36')]=_0x3aa029[_0x5b60('0x35')];return db['CloudProvider'][_0x5b60('0x3a')]({'data5':_0x5c817f[_0x5b60('0x38')],'data6':_0x5c817f['data6']},{'where':{'id':_0x5c817f['id']}});})[_0x5b60('0x31')](function(){return _0x5c817f;})[_0x5b60('0x3b')](function(_0x1f582f){logger[_0x5b60('0x3c')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x5c817f['id'],_0x1f582f);});}function getOauth2MicrosoftAccessToken(_0xdf28b5,_0x38d1e4){var _0x2c0875={'grant_type':_0x5b60('0x3d'),'code':_0xdf28b5,'scope':getAccessTokenScope(_0x38d1e4),'redirect_uri':_0x38d1e4[_0x5b60('0x22')],'client_id':_0x38d1e4['data1'],'client_secret':encryptor[_0x5b60('0x37')](_0x38d1e4['data3'])};var _0x2a2c47={'method':_0x5b60('0x3e'),'uri':MICROSOFT_AUTH_URL['replace'](_0x5b60('0x17'),_0x38d1e4['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2c0875,'json':!![]};return rp(_0x2a2c47);}function startRefreshInterval(_0x5691bf){var _0x442fa1=schedule[_0x5b60('0x3f')];if(_0x442fa1[_0x5691bf['id']])clearInterval(_0x442fa1[_0x5691bf['id']]);_0x442fa1[_0x5691bf['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x5691bf['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x5b60('0x3f')]=_0x442fa1;}function startAllRefreshIntervals(){return db[_0x5b60('0x33')][_0x5b60('0x40')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x55468b){var _0x3dc5d7=_0x55468b[_0x5b60('0x12')](function(_0x20c247){return refreshOauth2MicrosoftAccessToken(_0x20c247)[_0x5b60('0x31')](function(_0x4c3449){startRefreshInterval(_0x4c3449);});});return Promise[_0x5b60('0x41')](_0x3dc5d7);})[_0x5b60('0x3b')](function(_0x83692){var _0x425b92=_0x83692?util[_0x5b60('0x42')](_0x83692,{'showHidden':![],'depth':null}):'';logger['error'](_0x5b60('0x43'),_0x425b92);});}module[_0x5b60('0x44')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 78a55e4..189a3a0 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c71=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent'];(function(_0x1b704b,_0x51747d){var _0x7ebffa=function(_0x13b16c){while(--_0x13b16c){_0x1b704b['push'](_0x1b704b['shift']());}};_0x7ebffa(++_0x51747d);}(_0x7c71,0x177));var _0x17c7=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0x7c71[_0x16db8b];return _0x5ba017;};'use strict';var _=require(_0x17c7('0x0'));var util=require(_0x17c7('0x1'));var moment=require(_0x17c7('0x2'));var BPromise=require(_0x17c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x17c7('0x4'));var db=require(_0x17c7('0x5'))['db'];var utils=require(_0x17c7('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x17c7('0x7'));var jayson=require(_0x17c7('0x8'));var client=jayson[_0x17c7('0x9')][_0x17c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c061b,_0xf284a2,_0x1ff4ec){return new BPromise(function(_0x50feb0,_0x13fdad){return client[_0x17c7('0xb')](_0x3c061b,_0x1ff4ec)[_0x17c7('0xc')](function(_0xdb3575){logger[_0x17c7('0xd')](_0x17c7('0xe'),_0xf284a2,_0x17c7('0xf'));logger[_0x17c7('0x10')](_0x17c7('0x11'),_0xf284a2,_0x17c7('0xf'),JSON['stringify'](_0xdb3575));if(_0xdb3575['error']){if(_0xdb3575[_0x17c7('0x12')][_0x17c7('0x13')]===0x1f4){logger['error'](_0x17c7('0xe'),_0xf284a2,_0xdb3575[_0x17c7('0x12')]['message']);return _0x13fdad(_0xdb3575[_0x17c7('0x12')][_0x17c7('0x14')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0xf284a2,_0xdb3575[_0x17c7('0x12')][_0x17c7('0x14')]);return _0x50feb0(_0xdb3575[_0x17c7('0x12')][_0x17c7('0x14')]);}else{logger[_0x17c7('0xd')](_0x17c7('0xe'),_0xf284a2,_0x17c7('0xf'));_0x50feb0(_0xdb3575[_0x17c7('0x15')][_0x17c7('0x14')]);}})[_0x17c7('0x16')](function(_0x296f9c){logger[_0x17c7('0x12')]('CloudProvider,\x20%s,\x20%s',_0xf284a2,_0x296f9c);_0x13fdad(_0x296f9c);});});} \ No newline at end of file +var _0x7d8a=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CloudProvider,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info'];(function(_0x4450b1,_0x214ace){var _0x399b0b=function(_0x2197df){while(--_0x2197df){_0x4450b1['push'](_0x4450b1['shift']());}};_0x399b0b(++_0x214ace);}(_0x7d8a,0x1ca));var _0xa7d8=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x7d8a[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0xa7d8('0x0'));var util=require(_0xa7d8('0x1'));var moment=require(_0xa7d8('0x2'));var BPromise=require(_0xa7d8('0x3'));var rs=require(_0xa7d8('0x4'));var fs=require('fs');var Redis=require(_0xa7d8('0x5'));var db=require(_0xa7d8('0x6'))['db'];var utils=require(_0xa7d8('0x7'));var logger=require(_0xa7d8('0x8'))(_0xa7d8('0x9'));var config=require(_0xa7d8('0xa'));var jayson=require(_0xa7d8('0xb'));var client=jayson[_0xa7d8('0xc')][_0xa7d8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x55bb66,_0x410b09,_0x2e1955){return new BPromise(function(_0x1807cc,_0x455082){return client[_0xa7d8('0xe')](_0x55bb66,_0x2e1955)['then'](function(_0x40f419){logger['info'](_0xa7d8('0xf'),_0x410b09,'request\x20sent');logger[_0xa7d8('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x410b09,_0xa7d8('0x11'),JSON[_0xa7d8('0x12')](_0x40f419));if(_0x40f419['error']){if(_0x40f419[_0xa7d8('0x13')]['code']===0x1f4){logger[_0xa7d8('0x13')](_0xa7d8('0xf'),_0x410b09,_0x40f419[_0xa7d8('0x13')]['message']);return _0x455082(_0x40f419[_0xa7d8('0x13')][_0xa7d8('0x14')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x410b09,_0x40f419['error'][_0xa7d8('0x14')]);return _0x1807cc(_0x40f419[_0xa7d8('0x13')][_0xa7d8('0x14')]);}else{logger[_0xa7d8('0x15')](_0xa7d8('0xf'),_0x410b09,_0xa7d8('0x11'));_0x1807cc(_0x40f419[_0xa7d8('0x16')][_0xa7d8('0x14')]);}})[_0xa7d8('0x17')](function(_0xfc0284){logger[_0xa7d8('0x13')](_0xa7d8('0xf'),_0x410b09,_0xfc0284);_0x455082(_0xfc0284);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 5a2d14e..9ae2f90 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0xd8aad0,_0x4da2cd){var _0x570860=function(_0x1acc03){while(--_0x1acc03){_0xd8aad0['push'](_0xd8aad0['shift']());}};_0x570860(++_0x4da2cd);}(_0x1261,0x144));var _0x1126=function(_0x3fa1c7,_0x13d816){_0x3fa1c7=_0x3fa1c7-0x0;var _0x21e45d=_0x1261[_0x3fa1c7];return _0x21e45d;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file +var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0xd695,_0x4469af){var _0x3f4bf1=function(_0x1eae51){while(--_0x1eae51){_0xd695['push'](_0xd695['shift']());}};_0x3f4bf1(++_0x4469af);}(_0x2ef3,0xba));var _0x32ef=function(_0x2da418,_0x11591a){_0x2da418=_0x2da418-0x0;var _0x56ee3b=_0x2ef3[_0x2da418];return _0x56ee3b;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 30a0d47..63d9306 100644 --- a/server/api/cmCompany/cmCompany.attributes.js +++ b/server/api/cmCompany/cmCompany.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bbd=['sequelize','STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7bbd,0x12c));var _0xd7bb=function(_0x5ce195,_0x12511b){_0x5ce195=_0x5ce195-0x0;var _0x53d780=_0x7bbd[_0x5ce195];return _0x53d780;};'use strict';var Sequelize=require(_0xd7bb('0x0'));module['exports']={'name':{'type':Sequelize[_0xd7bb('0x1')],'unique':_0xd7bb('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd7bb('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xd7bb('0x1')]},'phone':{'type':Sequelize[_0xd7bb('0x1')]},'fax':{'type':Sequelize[_0xd7bb('0x1')]},'type':{'type':Sequelize[_0xd7bb('0x1')]},'street':{'type':Sequelize[_0xd7bb('0x1')]},'postalCode':{'type':Sequelize[_0xd7bb('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd7bb('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd7bb('0x1')]},'sStreet':{'type':Sequelize[_0xd7bb('0x1')]},'sPostalCode':{'type':Sequelize[_0xd7bb('0x1')]},'sCity':{'type':Sequelize[_0xd7bb('0x1')]},'sCountry':{'type':Sequelize[_0xd7bb('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9e87=['name','exports','STRING'];(function(_0x56e07e,_0xfd0481){var _0x446548=function(_0x20dfe4){while(--_0x20dfe4){_0x56e07e['push'](_0x56e07e['shift']());}};_0x446548(++_0xfd0481);}(_0x9e87,0x1ba));var _0x79e8=function(_0x36616c,_0x23a468){_0x36616c=_0x36616c-0x0;var _0x56e518=_0x9e87[_0x36616c];return _0x56e518;};'use strict';var Sequelize=require('sequelize');module[_0x79e8('0x0')]={'name':{'type':Sequelize[_0x79e8('0x1')],'unique':_0x79e8('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x79e8('0x1')]},'companyId':{'type':Sequelize[_0x79e8('0x1')]},'website':{'type':Sequelize[_0x79e8('0x1')]},'phone':{'type':Sequelize[_0x79e8('0x1')]},'fax':{'type':Sequelize[_0x79e8('0x1')]},'type':{'type':Sequelize[_0x79e8('0x1')]},'street':{'type':Sequelize[_0x79e8('0x1')]},'postalCode':{'type':Sequelize[_0x79e8('0x1')]},'city':{'type':Sequelize[_0x79e8('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x79e8('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x79e8('0x1')]},'sStreet':{'type':Sequelize[_0x79e8('0x1')]},'sPostalCode':{'type':Sequelize[_0x79e8('0x1')]},'sCity':{'type':Sequelize[_0x79e8('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x79e8('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 58f7d4e..d7a0084 100644 --- a/server/api/cmCompany/cmCompany.controller.js +++ b/server/api/cmCompany/cmCompany.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53b2=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','options','getContacts','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','stack','name','send','describe','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','CmCompany','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x53b2,0x10c));var _0x253b=function(_0x5ee08e,_0x353983){_0x5ee08e=_0x5ee08e-0x0;var _0x53c275=_0x53b2[_0x5ee08e];return _0x53c275;};'use strict';var emlformat=require(_0x253b('0x0'));var rimraf=require(_0x253b('0x1'));var zipdir=require(_0x253b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x253b('0x3'));var moment=require('moment');var BPromise=require(_0x253b('0x4'));var Mustache=require('mustache');var util=require(_0x253b('0x5'));var path=require(_0x253b('0x6'));var sox=require(_0x253b('0x7'));var csv=require(_0x253b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x253b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x253b('0xa'));var jsforce=require(_0x253b('0xb'));var deskjs=require(_0x253b('0xc'));var toCsv=require(_0x253b('0x8'));var querystring=require('querystring');var Papa=require(_0x253b('0xd'));var Redis=require(_0x253b('0xe'));var authService=require(_0x253b('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x253b('0x10'))(_0x253b('0x11'));var utils=require(_0x253b('0x12'));var config=require(_0x253b('0x13'));var licenseUtil=require(_0x253b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x508171,_0x4ebcc0){_0x4ebcc0=_0x4ebcc0||0xcc;return function(_0x19048a){if(_0x19048a){return _0x508171[_0x253b('0x15')](_0x4ebcc0);}return _0x508171[_0x253b('0x16')](_0x4ebcc0)[_0x253b('0x17')]();};}function respondWithResult(_0xaa2020,_0x37f2d7){_0x37f2d7=_0x37f2d7||0xc8;return function(_0x21db0a){if(_0x21db0a){return _0xaa2020[_0x253b('0x16')](_0x37f2d7)[_0x253b('0x18')](_0x21db0a);}};}function respondWithFilteredResult(_0x3f5c9f,_0x330ec5){return function(_0xb9cfd7){if(_0xb9cfd7){var _0x9cbae=typeof _0x330ec5[_0x253b('0x19')]===_0x253b('0x1a')&&typeof _0x330ec5[_0x253b('0x1b')]==='undefined';var _0x1c9c41=_0xb9cfd7[_0x253b('0x1c')];var _0xba0422=_0x9cbae?0x0:_0x330ec5[_0x253b('0x19')];var _0x4fb88e=_0x9cbae?_0xb9cfd7['count']:_0x330ec5[_0x253b('0x19')]+_0x330ec5[_0x253b('0x1b')];var _0x39d795;if(_0x4fb88e>=_0x1c9c41){_0x4fb88e=_0x1c9c41;_0x39d795=0xc8;}else{_0x39d795=0xce;}_0x3f5c9f[_0x253b('0x16')](_0x39d795);return _0x3f5c9f[_0x253b('0x1d')](_0x253b('0x1e'),_0xba0422+'-'+_0x4fb88e+'/'+_0x1c9c41)[_0x253b('0x18')](_0xb9cfd7);}return null;};}function patchUpdates(_0xa33615){return function(_0x484153){try{jsonpatch[_0x253b('0x1f')](_0x484153,_0xa33615,!![]);}catch(_0x558de9){return BPromise[_0x253b('0x20')](_0x558de9);}return _0x484153[_0x253b('0x21')]();};}function saveUpdates(_0x12721a,_0x24ac26){return function(_0x585dd0){if(_0x585dd0){return _0x585dd0[_0x253b('0x22')](_0x12721a)[_0x253b('0x23')](function(_0x44a0e6){return _0x44a0e6;});}return null;};}function removeEntity(_0x4a828c,_0x2b5e5d){return function(_0x38c253){if(_0x38c253){return _0x38c253[_0x253b('0x24')]()[_0x253b('0x23')](function(){var _0x1980bd=_0x38c253[_0x253b('0x25')]({'plain':!![]});var _0x2626e5=_0x253b('0x26');return db[_0x253b('0x27')][_0x253b('0x24')]({'where':{'type':_0x2626e5,'resourceId':_0x1980bd['id']}})['then'](function(){return _0x38c253;});})[_0x253b('0x23')](function(){_0x4a828c[_0x253b('0x16')](0xcc)[_0x253b('0x17')]();});}};}function handleEntityNotFound(_0x7d4417,_0x4319df){return function(_0x40a404){if(!_0x40a404){_0x7d4417[_0x253b('0x15')](0x194);}return _0x40a404;};}function handleError(_0x478a4d,_0x5f20dc){_0x5f20dc=_0x5f20dc||0x1f4;return function(_0x3cf621){logger['error'](_0x3cf621[_0x253b('0x28')]);if(_0x3cf621['name']){delete _0x3cf621[_0x253b('0x29')];}_0x478a4d[_0x253b('0x16')](_0x5f20dc)[_0x253b('0x2a')](_0x3cf621);};}exports['index']=function(_0x2e822c,_0x399d7d){var _0x30b531={},_0x4dbb69={},_0x2d71d2={'count':0x0,'rows':[]};return db['CmCompany'][_0x253b('0x2b')]()['then'](function(_0x58394b){_0x4dbb69[_0x253b('0x2c')]=_[_0x253b('0x2d')](_0x58394b);_0x4dbb69[_0x253b('0x2e')]=_[_0x253b('0x2d')](_0x2e822c['query']);_0x4dbb69['filters']=_['intersection'](_0x4dbb69[_0x253b('0x2c')],_0x4dbb69[_0x253b('0x2e')]);_0x30b531[_0x253b('0x2f')]=_[_0x253b('0x30')](_0x4dbb69['model'],qs[_0x253b('0x31')](_0x2e822c[_0x253b('0x2e')]['fields']));_0x30b531[_0x253b('0x2f')]=_0x30b531['attributes'][_0x253b('0x32')]?_0x30b531[_0x253b('0x2f')]:_0x4dbb69[_0x253b('0x2c')];if(!_0x2e822c[_0x253b('0x2e')][_0x253b('0x33')](_0x253b('0x34'))){_0x30b531['limit']=qs[_0x253b('0x1b')](_0x2e822c[_0x253b('0x2e')]['limit']);_0x30b531['offset']=qs[_0x253b('0x19')](_0x2e822c['query'][_0x253b('0x19')]);}_0x30b531[_0x253b('0x35')]=qs[_0x253b('0x36')](_0x2e822c['query'][_0x253b('0x36')]);_0x30b531[_0x253b('0x37')]=qs[_0x253b('0x38')](_[_0x253b('0x39')](_0x2e822c[_0x253b('0x2e')],_0x4dbb69[_0x253b('0x38')]),_0x58394b);if(_0x2e822c[_0x253b('0x2e')][_0x253b('0x3a')]){_0x30b531[_0x253b('0x37')]=_[_0x253b('0x3b')](_0x30b531[_0x253b('0x37')],{'$or':_[_0x253b('0x3c')](_0x30b531['attributes'],function(_0x110dfd){var _0x4973f8={};_0x4973f8[_0x110dfd]={'$like':'%'+_0x2e822c[_0x253b('0x2e')][_0x253b('0x3a')]+'%'};return _0x4973f8;})});}_0x30b531=_[_0x253b('0x3b')]({},_0x30b531,_0x2e822c['options']);var _0x4c8762={'where':_0x30b531[_0x253b('0x37')]};return db[_0x253b('0x3d')][_0x253b('0x1c')](_0x4c8762)[_0x253b('0x23')](function(_0x2d8ab1){_0x2d71d2['count']=_0x2d8ab1;if(_0x2e822c[_0x253b('0x2e')]['includeAll']){_0x30b531[_0x253b('0x3e')]=[{'all':!![]}];}return db[_0x253b('0x3d')][_0x253b('0x3f')](_0x30b531);})[_0x253b('0x23')](function(_0x1cf622){_0x2d71d2[_0x253b('0x40')]=_0x1cf622;return _0x2d71d2;})[_0x253b('0x23')](respondWithFilteredResult(_0x399d7d,_0x30b531))[_0x253b('0x41')](handleError(_0x399d7d,null));})['catch'](handleError(_0x399d7d,null));};exports[_0x253b('0x42')]=function(_0x22d1bf,_0x3d6576){var _0x442313={'raw':![],'where':{'id':_0x22d1bf[_0x253b('0x43')]['id']}},_0x478d7d={};_0x478d7d[_0x253b('0x2c')]=_[_0x253b('0x2d')](db['CmCompany'][_0x253b('0x44')]);_0x478d7d[_0x253b('0x2e')]=_[_0x253b('0x2d')](_0x22d1bf['query']);_0x478d7d[_0x253b('0x38')]=_[_0x253b('0x30')](_0x478d7d[_0x253b('0x2c')],_0x478d7d[_0x253b('0x2e')]);_0x442313[_0x253b('0x2f')]=_[_0x253b('0x30')](_0x478d7d['model'],qs[_0x253b('0x31')](_0x22d1bf[_0x253b('0x2e')]['fields']));_0x442313[_0x253b('0x2f')]=_0x442313[_0x253b('0x2f')][_0x253b('0x32')]?_0x442313[_0x253b('0x2f')]:_0x478d7d[_0x253b('0x2c')];if(_0x22d1bf[_0x253b('0x2e')][_0x253b('0x45')]){_0x442313[_0x253b('0x3e')]=[{'all':!![]}];}_0x442313=_[_0x253b('0x3b')]({},_0x442313,_0x22d1bf['options']);return db[_0x253b('0x3d')][_0x253b('0x46')](_0x442313)[_0x253b('0x23')](handleEntityNotFound(_0x3d6576,null))['then'](respondWithResult(_0x3d6576,null))['catch'](handleError(_0x3d6576,null));};exports['create']=function(_0x3d4042,_0x3826d7){return db['CmCompany'][_0x253b('0x47')](_0x3d4042[_0x253b('0x48')],{})['then'](function(_0x43b2f5){var _0x2eeae7=_0x3d4042[_0x253b('0x49')][_0x253b('0x25')]({'plain':!![]});if(!_0x2eeae7)throw new Error(_0x253b('0x4a'));if(_0x2eeae7['role']===_0x253b('0x49')){var _0x17ec6f=_0x43b2f5['get']({'plain':!![]});var _0x37660c='Companies';return db[_0x253b('0x4b')][_0x253b('0x46')]({'where':{'name':_0x37660c,'userProfileId':_0x2eeae7[_0x253b('0x4c')]},'raw':!![]})[_0x253b('0x23')](function(_0x36d3af){if(_0x36d3af&&_0x36d3af[_0x253b('0x4d')]===0x0){return db[_0x253b('0x27')][_0x253b('0x47')]({'name':_0x17ec6f['name'],'resourceId':_0x17ec6f['id'],'type':_0x36d3af[_0x253b('0x29')],'sectionId':_0x36d3af['id']},{})[_0x253b('0x23')](function(){return _0x43b2f5;});}else{return _0x43b2f5;}})['catch'](function(_0x1b8723){logger['error'](_0x253b('0x4e'),_0x1b8723);throw _0x1b8723;});}return _0x43b2f5;})['then'](respondWithResult(_0x3826d7,0xc9))[_0x253b('0x41')](handleError(_0x3826d7,null));};exports['update']=function(_0xb61e37,_0x10c1f4){if(_0xb61e37[_0x253b('0x48')]['id']){delete _0xb61e37[_0x253b('0x48')]['id'];}return db[_0x253b('0x3d')][_0x253b('0x46')]({'where':{'id':_0xb61e37[_0x253b('0x43')]['id']}})[_0x253b('0x23')](handleEntityNotFound(_0x10c1f4,null))[_0x253b('0x23')](saveUpdates(_0xb61e37[_0x253b('0x48')],null))['then'](respondWithResult(_0x10c1f4,null))['catch'](handleError(_0x10c1f4,null));};exports[_0x253b('0x24')]=function(_0x524242,_0x163b97){return db['CmCompany'][_0x253b('0x46')]({'where':{'id':_0x524242[_0x253b('0x43')]['id']}})[_0x253b('0x23')](handleEntityNotFound(_0x163b97,null))[_0x253b('0x23')](removeEntity(_0x163b97,null))[_0x253b('0x41')](handleError(_0x163b97,null));};exports['describe']=function(_0x144eb2,_0x12a3ce){return db[_0x253b('0x3d')][_0x253b('0x2b')]()['then'](respondWithResult(_0x12a3ce,null))['catch'](handleError(_0x12a3ce,null));};exports[_0x253b('0x4f')]=function(_0x21cfa8,_0x57643e,_0x141380){return db[_0x253b('0x50')][_0x253b('0x46')]({'where':{'id':_0x21cfa8[_0x253b('0x43')]['id']}})[_0x253b('0x23')](handleEntityNotFound(_0x57643e,null))[_0x253b('0x23')](function(_0x2349bb){if(_0x2349bb){return _0x2349bb[_0x253b('0x4f')](_0x21cfa8[_0x253b('0x48')][_0x253b('0x51')],_[_0x253b('0x52')](_0x21cfa8[_0x253b('0x48')],[_0x253b('0x51'),'id'])||{});}})['then'](respondWithResult(_0x57643e,null))[_0x253b('0x41')](handleError(_0x57643e,null));};exports['getContacts']=function(_0x584a50,_0x5c2a99,_0x10a709){var _0x25b8bb={};var _0x41fdf9={};var _0x1a7ee6;var _0x31070b;return db['CmCompany']['findOne']({'where':{'id':_0x584a50[_0x253b('0x43')]['id']}})[_0x253b('0x23')](handleEntityNotFound(_0x5c2a99,null))[_0x253b('0x23')](function(_0x270fe7){if(_0x270fe7){_0x1a7ee6=_0x270fe7;_0x41fdf9[_0x253b('0x2c')]=_[_0x253b('0x2d')](db[_0x253b('0x50')][_0x253b('0x44')]);_0x41fdf9[_0x253b('0x2e')]=_[_0x253b('0x2d')](_0x584a50[_0x253b('0x2e')]);_0x41fdf9[_0x253b('0x38')]=_[_0x253b('0x30')](_0x41fdf9[_0x253b('0x2c')],_0x41fdf9['query']);_0x25b8bb[_0x253b('0x2f')]=_[_0x253b('0x30')](_0x41fdf9[_0x253b('0x2c')],qs[_0x253b('0x31')](_0x584a50[_0x253b('0x2e')][_0x253b('0x31')]));_0x25b8bb['attributes']=_0x25b8bb[_0x253b('0x2f')][_0x253b('0x32')]?_0x25b8bb['attributes']:_0x41fdf9['model'];_0x25b8bb[_0x253b('0x35')]=qs[_0x253b('0x36')](_0x584a50['query'][_0x253b('0x36')]);_0x25b8bb[_0x253b('0x37')]=qs[_0x253b('0x38')](_[_0x253b('0x39')](_0x584a50[_0x253b('0x2e')],_0x41fdf9['filters']));if(_0x584a50[_0x253b('0x2e')]['filter']){_0x25b8bb[_0x253b('0x37')]=_['merge'](_0x25b8bb[_0x253b('0x37')],{'$or':_[_0x253b('0x3c')](_0x25b8bb[_0x253b('0x2f')],function(_0x3e87d9){var _0x53e326={};_0x53e326[_0x3e87d9]={'$like':'%'+_0x584a50[_0x253b('0x2e')][_0x253b('0x3a')]+'%'};return _0x53e326;})});}_0x25b8bb=_[_0x253b('0x3b')]({},_0x25b8bb,_0x584a50[_0x253b('0x53')]);return _0x1a7ee6[_0x253b('0x54')](_0x25b8bb);}})[_0x253b('0x23')](function(_0x1eec63){if(_0x1eec63){_0x31070b=_0x1eec63['length'];if(!_0x584a50[_0x253b('0x2e')][_0x253b('0x33')](_0x253b('0x34'))){_0x25b8bb['limit']=qs[_0x253b('0x1b')](_0x584a50[_0x253b('0x2e')][_0x253b('0x1b')]);_0x25b8bb['offset']=qs[_0x253b('0x19')](_0x584a50[_0x253b('0x2e')][_0x253b('0x19')]);}return _0x1a7ee6[_0x253b('0x54')](_0x25b8bb);}})[_0x253b('0x23')](function(_0x1e3a05){if(_0x1e3a05){return _0x1e3a05?{'count':_0x31070b,'rows':_0x1e3a05}:null;}})[_0x253b('0x23')](respondWithResult(_0x5c2a99,null))['catch'](handleError(_0x5c2a99,null));}; \ No newline at end of file +var _0x7c84=['user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','rawAttributes','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','name','send','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','options','CmCompany','includeAll','findAll','rows','catch','params','include','merge','find','create','body'];(function(_0x215c68,_0xfb7290){var _0x16682a=function(_0x21de61){while(--_0x21de61){_0x215c68['push'](_0x215c68['shift']());}};_0x16682a(++_0xfb7290);}(_0x7c84,0xb5));var _0x47c8=function(_0x525428,_0x396124){_0x525428=_0x525428-0x0;var _0x133d40=_0x7c84[_0x525428];return _0x133d40;};'use strict';var emlformat=require(_0x47c8('0x0'));var rimraf=require(_0x47c8('0x1'));var zipdir=require(_0x47c8('0x2'));var jsonpatch=require(_0x47c8('0x3'));var rp=require(_0x47c8('0x4'));var moment=require('moment');var BPromise=require(_0x47c8('0x5'));var Mustache=require(_0x47c8('0x6'));var util=require(_0x47c8('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x47c8('0x8'));var fs=require('fs');var fs_extra=require(_0x47c8('0x9'));var _=require(_0x47c8('0xa'));var squel=require(_0x47c8('0xb'));var crypto=require('crypto');var jsforce=require(_0x47c8('0xc'));var deskjs=require(_0x47c8('0xd'));var toCsv=require(_0x47c8('0xe'));var querystring=require(_0x47c8('0xf'));var Papa=require(_0x47c8('0x10'));var Redis=require(_0x47c8('0x11'));var authService=require(_0x47c8('0x12'));var qs=require(_0x47c8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x47c8('0x14'));var logger=require('../../config/logger')(_0x47c8('0x15'));var utils=require(_0x47c8('0x16'));var config=require(_0x47c8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x47c8('0x18'))['db'];function respondWithStatusCode(_0x41e9fe,_0x2e5ba5){_0x2e5ba5=_0x2e5ba5||0xcc;return function(_0x4ea7d0){if(_0x4ea7d0){return _0x41e9fe[_0x47c8('0x19')](_0x2e5ba5);}return _0x41e9fe[_0x47c8('0x1a')](_0x2e5ba5)[_0x47c8('0x1b')]();};}function respondWithResult(_0x5f552c,_0x17e973){_0x17e973=_0x17e973||0xc8;return function(_0x4f050a){if(_0x4f050a){return _0x5f552c['status'](_0x17e973)[_0x47c8('0x1c')](_0x4f050a);}};}function respondWithFilteredResult(_0x582713,_0x5df296){return function(_0x1caa01){if(_0x1caa01){var _0x45d92a=typeof _0x5df296[_0x47c8('0x1d')]===_0x47c8('0x1e')&&typeof _0x5df296[_0x47c8('0x1f')]===_0x47c8('0x1e');var _0x5aead3=_0x1caa01[_0x47c8('0x20')];var _0x3a730a=_0x45d92a?0x0:_0x5df296[_0x47c8('0x1d')];var _0xf4ce37=_0x45d92a?_0x1caa01[_0x47c8('0x20')]:_0x5df296[_0x47c8('0x1d')]+_0x5df296['limit'];var _0x11bc69;if(_0xf4ce37>=_0x5aead3){_0xf4ce37=_0x5aead3;_0x11bc69=0xc8;}else{_0x11bc69=0xce;}_0x582713[_0x47c8('0x1a')](_0x11bc69);return _0x582713[_0x47c8('0x21')]('Content-Range',_0x3a730a+'-'+_0xf4ce37+'/'+_0x5aead3)[_0x47c8('0x1c')](_0x1caa01);}return null;};}function patchUpdates(_0x4ed8b6){return function(_0x44d4f8){try{jsonpatch[_0x47c8('0x22')](_0x44d4f8,_0x4ed8b6,!![]);}catch(_0x5cddc3){return BPromise[_0x47c8('0x23')](_0x5cddc3);}return _0x44d4f8[_0x47c8('0x24')]();};}function saveUpdates(_0x21039f,_0x2baddc){return function(_0x6f6c7c){if(_0x6f6c7c){return _0x6f6c7c[_0x47c8('0x25')](_0x21039f)[_0x47c8('0x26')](function(_0x19a68b){return _0x19a68b;});}return null;};}function removeEntity(_0x1e3336,_0x13845a){return function(_0x1c464c){if(_0x1c464c){return _0x1c464c[_0x47c8('0x27')]()[_0x47c8('0x26')](function(){var _0x420b02=_0x1c464c[_0x47c8('0x28')]({'plain':!![]});var _0x2f1a85=_0x47c8('0x29');return db[_0x47c8('0x2a')][_0x47c8('0x27')]({'where':{'type':_0x2f1a85,'resourceId':_0x420b02['id']}})['then'](function(){return _0x1c464c;});})[_0x47c8('0x26')](function(){_0x1e3336[_0x47c8('0x1a')](0xcc)[_0x47c8('0x1b')]();});}};}function handleEntityNotFound(_0x545912,_0x37aa9f){return function(_0x36cfcc){if(!_0x36cfcc){_0x545912[_0x47c8('0x19')](0x194);}return _0x36cfcc;};}function handleError(_0x393901,_0x3ef589){_0x3ef589=_0x3ef589||0x1f4;return function(_0x589f73){logger[_0x47c8('0x2b')](_0x589f73['stack']);if(_0x589f73[_0x47c8('0x2c')]){delete _0x589f73[_0x47c8('0x2c')];}_0x393901[_0x47c8('0x1a')](_0x3ef589)[_0x47c8('0x2d')](_0x589f73);};}exports['index']=function(_0x3d3445,_0x2a8d7e){var _0x406404={},_0x463d27={},_0xbbbebf={'count':0x0,'rows':[]};return db['CmCompany'][_0x47c8('0x2e')]()[_0x47c8('0x26')](function(_0x30c42a){_0x463d27[_0x47c8('0x2f')]=_[_0x47c8('0x30')](_0x30c42a);_0x463d27[_0x47c8('0x31')]=_['keys'](_0x3d3445[_0x47c8('0x31')]);_0x463d27[_0x47c8('0x32')]=_[_0x47c8('0x33')](_0x463d27['model'],_0x463d27[_0x47c8('0x31')]);_0x406404[_0x47c8('0x34')]=_[_0x47c8('0x33')](_0x463d27[_0x47c8('0x2f')],qs['fields'](_0x3d3445['query'][_0x47c8('0x35')]));_0x406404[_0x47c8('0x34')]=_0x406404[_0x47c8('0x34')][_0x47c8('0x36')]?_0x406404['attributes']:_0x463d27[_0x47c8('0x2f')];if(!_0x3d3445['query'][_0x47c8('0x37')](_0x47c8('0x38'))){_0x406404[_0x47c8('0x1f')]=qs['limit'](_0x3d3445[_0x47c8('0x31')][_0x47c8('0x1f')]);_0x406404[_0x47c8('0x1d')]=qs[_0x47c8('0x1d')](_0x3d3445[_0x47c8('0x31')][_0x47c8('0x1d')]);}_0x406404[_0x47c8('0x39')]=qs[_0x47c8('0x3a')](_0x3d3445[_0x47c8('0x31')][_0x47c8('0x3a')]);_0x406404[_0x47c8('0x3b')]=qs[_0x47c8('0x32')](_['pick'](_0x3d3445[_0x47c8('0x31')],_0x463d27[_0x47c8('0x32')]),_0x30c42a);if(_0x3d3445['query'][_0x47c8('0x3c')]){_0x406404['where']=_['merge'](_0x406404['where'],{'$or':_[_0x47c8('0x3d')](_0x406404['attributes'],function(_0x18bdb6){var _0x556c3b={};_0x556c3b[_0x18bdb6]={'$like':'%'+_0x3d3445['query'][_0x47c8('0x3c')]+'%'};return _0x556c3b;})});}_0x406404=_['merge']({},_0x406404,_0x3d3445[_0x47c8('0x3e')]);var _0x5dae22={'where':_0x406404[_0x47c8('0x3b')]};return db[_0x47c8('0x3f')]['count'](_0x5dae22)['then'](function(_0x3bc375){_0xbbbebf[_0x47c8('0x20')]=_0x3bc375;if(_0x3d3445[_0x47c8('0x31')][_0x47c8('0x40')]){_0x406404['include']=[{'all':!![]}];}return db[_0x47c8('0x3f')][_0x47c8('0x41')](_0x406404);})[_0x47c8('0x26')](function(_0x42bc17){_0xbbbebf[_0x47c8('0x42')]=_0x42bc17;return _0xbbbebf;})['then'](respondWithFilteredResult(_0x2a8d7e,_0x406404))[_0x47c8('0x43')](handleError(_0x2a8d7e,null));})[_0x47c8('0x43')](handleError(_0x2a8d7e,null));};exports['show']=function(_0x7a9861,_0xb64e6f){var _0x41be0c={'raw':![],'where':{'id':_0x7a9861[_0x47c8('0x44')]['id']}},_0x42d0de={};_0x42d0de[_0x47c8('0x2f')]=_[_0x47c8('0x30')](db['CmCompany']['rawAttributes']);_0x42d0de[_0x47c8('0x31')]=_['keys'](_0x7a9861[_0x47c8('0x31')]);_0x42d0de[_0x47c8('0x32')]=_[_0x47c8('0x33')](_0x42d0de['model'],_0x42d0de[_0x47c8('0x31')]);_0x41be0c[_0x47c8('0x34')]=_[_0x47c8('0x33')](_0x42d0de['model'],qs[_0x47c8('0x35')](_0x7a9861[_0x47c8('0x31')]['fields']));_0x41be0c['attributes']=_0x41be0c[_0x47c8('0x34')][_0x47c8('0x36')]?_0x41be0c[_0x47c8('0x34')]:_0x42d0de['model'];if(_0x7a9861[_0x47c8('0x31')]['includeAll']){_0x41be0c[_0x47c8('0x45')]=[{'all':!![]}];}_0x41be0c=_[_0x47c8('0x46')]({},_0x41be0c,_0x7a9861[_0x47c8('0x3e')]);return db[_0x47c8('0x3f')][_0x47c8('0x47')](_0x41be0c)['then'](handleEntityNotFound(_0xb64e6f,null))[_0x47c8('0x26')](respondWithResult(_0xb64e6f,null))[_0x47c8('0x43')](handleError(_0xb64e6f,null));};exports[_0x47c8('0x48')]=function(_0x304a31,_0x5528e7){return db['CmCompany']['create'](_0x304a31[_0x47c8('0x49')],{})['then'](function(_0x9bf9d){var _0x4948fa=_0x304a31[_0x47c8('0x4a')]['get']({'plain':!![]});if(!_0x4948fa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4948fa[_0x47c8('0x4b')]===_0x47c8('0x4a')){var _0x2cd941=_0x9bf9d['get']({'plain':!![]});var _0xa3b960='Companies';return db[_0x47c8('0x4c')][_0x47c8('0x47')]({'where':{'name':_0xa3b960,'userProfileId':_0x4948fa[_0x47c8('0x4d')]},'raw':!![]})[_0x47c8('0x26')](function(_0x329328){if(_0x329328&&_0x329328['autoAssociation']===0x0){return db[_0x47c8('0x2a')][_0x47c8('0x48')]({'name':_0x2cd941[_0x47c8('0x2c')],'resourceId':_0x2cd941['id'],'type':_0x329328[_0x47c8('0x2c')],'sectionId':_0x329328['id']},{})['then'](function(){return _0x9bf9d;});}else{return _0x9bf9d;}})[_0x47c8('0x43')](function(_0x5de1b1){logger[_0x47c8('0x2b')](_0x47c8('0x4e'),_0x5de1b1);throw _0x5de1b1;});}return _0x9bf9d;})[_0x47c8('0x26')](respondWithResult(_0x5528e7,0xc9))[_0x47c8('0x43')](handleError(_0x5528e7,null));};exports[_0x47c8('0x25')]=function(_0x217c41,_0x5616aa){if(_0x217c41[_0x47c8('0x49')]['id']){delete _0x217c41[_0x47c8('0x49')]['id'];}return db[_0x47c8('0x3f')][_0x47c8('0x47')]({'where':{'id':_0x217c41[_0x47c8('0x44')]['id']}})[_0x47c8('0x26')](handleEntityNotFound(_0x5616aa,null))[_0x47c8('0x26')](saveUpdates(_0x217c41[_0x47c8('0x49')],null))['then'](respondWithResult(_0x5616aa,null))[_0x47c8('0x43')](handleError(_0x5616aa,null));};exports[_0x47c8('0x27')]=function(_0x17b0ea,_0x117a76){return db[_0x47c8('0x3f')][_0x47c8('0x47')]({'where':{'id':_0x17b0ea[_0x47c8('0x44')]['id']}})[_0x47c8('0x26')](handleEntityNotFound(_0x117a76,null))[_0x47c8('0x26')](removeEntity(_0x117a76,null))[_0x47c8('0x43')](handleError(_0x117a76,null));};exports['describe']=function(_0x532557,_0x322534){return db[_0x47c8('0x3f')][_0x47c8('0x2e')]()[_0x47c8('0x26')](respondWithResult(_0x322534,null))[_0x47c8('0x43')](handleError(_0x322534,null));};exports[_0x47c8('0x4f')]=function(_0x4ece88,_0x1e3876,_0x14a7c3){return db[_0x47c8('0x50')][_0x47c8('0x47')]({'where':{'id':_0x4ece88[_0x47c8('0x44')]['id']}})[_0x47c8('0x26')](handleEntityNotFound(_0x1e3876,null))[_0x47c8('0x26')](function(_0x461f6c){if(_0x461f6c){return _0x461f6c['addContacts'](_0x4ece88[_0x47c8('0x49')][_0x47c8('0x51')],_[_0x47c8('0x52')](_0x4ece88[_0x47c8('0x49')],[_0x47c8('0x51'),'id'])||{});}})[_0x47c8('0x26')](respondWithResult(_0x1e3876,null))['catch'](handleError(_0x1e3876,null));};exports[_0x47c8('0x53')]=function(_0x7a5d60,_0x81cd69,_0x505b95){var _0x21b4a7={};var _0x2c46bc={};var _0x10aaff;var _0x204ead;return db['CmCompany']['findOne']({'where':{'id':_0x7a5d60[_0x47c8('0x44')]['id']}})['then'](handleEntityNotFound(_0x81cd69,null))['then'](function(_0xab44bb){if(_0xab44bb){_0x10aaff=_0xab44bb;_0x2c46bc[_0x47c8('0x2f')]=_[_0x47c8('0x30')](db[_0x47c8('0x50')][_0x47c8('0x54')]);_0x2c46bc[_0x47c8('0x31')]=_[_0x47c8('0x30')](_0x7a5d60[_0x47c8('0x31')]);_0x2c46bc['filters']=_[_0x47c8('0x33')](_0x2c46bc[_0x47c8('0x2f')],_0x2c46bc[_0x47c8('0x31')]);_0x21b4a7[_0x47c8('0x34')]=_[_0x47c8('0x33')](_0x2c46bc[_0x47c8('0x2f')],qs['fields'](_0x7a5d60['query'][_0x47c8('0x35')]));_0x21b4a7['attributes']=_0x21b4a7[_0x47c8('0x34')]['length']?_0x21b4a7[_0x47c8('0x34')]:_0x2c46bc[_0x47c8('0x2f')];_0x21b4a7[_0x47c8('0x39')]=qs[_0x47c8('0x3a')](_0x7a5d60[_0x47c8('0x31')]['sort']);_0x21b4a7['where']=qs[_0x47c8('0x32')](_['pick'](_0x7a5d60[_0x47c8('0x31')],_0x2c46bc[_0x47c8('0x32')]));if(_0x7a5d60[_0x47c8('0x31')][_0x47c8('0x3c')]){_0x21b4a7[_0x47c8('0x3b')]=_[_0x47c8('0x46')](_0x21b4a7[_0x47c8('0x3b')],{'$or':_[_0x47c8('0x3d')](_0x21b4a7[_0x47c8('0x34')],function(_0x5a7c1b){var _0x187214={};_0x187214[_0x5a7c1b]={'$like':'%'+_0x7a5d60[_0x47c8('0x31')][_0x47c8('0x3c')]+'%'};return _0x187214;})});}_0x21b4a7=_[_0x47c8('0x46')]({},_0x21b4a7,_0x7a5d60['options']);return _0x10aaff[_0x47c8('0x53')](_0x21b4a7);}})[_0x47c8('0x26')](function(_0x8b06e9){if(_0x8b06e9){_0x204ead=_0x8b06e9[_0x47c8('0x36')];if(!_0x7a5d60['query']['hasOwnProperty']('nolimit')){_0x21b4a7['limit']=qs[_0x47c8('0x1f')](_0x7a5d60['query'][_0x47c8('0x1f')]);_0x21b4a7['offset']=qs['offset'](_0x7a5d60[_0x47c8('0x31')]['offset']);}return _0x10aaff['getContacts'](_0x21b4a7);}})['then'](function(_0xa3b8db){if(_0xa3b8db){return _0xa3b8db?{'count':_0x204ead,'rows':_0xa3b8db}:null;}})[_0x47c8('0x26')](respondWithResult(_0x81cd69,null))[_0x47c8('0x43')](handleError(_0x81cd69,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 428ee0b..1181ca1 100644 --- a/server/api/cmCompany/cmCompany.model.js +++ b/server/api/cmCompany/cmCompany.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b88=['path','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3b88,0x10f));var _0x83b8=function(_0x3a17cf,_0x26adcf){_0x3a17cf=_0x3a17cf-0x0;var _0x274e11=_0x3b88[_0x3a17cf];return _0x274e11;};'use strict';var _=require(_0x83b8('0x0'));var util=require(_0x83b8('0x1'));var logger=require(_0x83b8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x83b8('0x3'));var rp=require(_0x83b8('0x4'));var fs=require('fs');var path=require(_0x83b8('0x5'));var rimraf=require(_0x83b8('0x6'));var config=require(_0x83b8('0x7'));var attributes=require(_0x83b8('0x8'));module[_0x83b8('0x9')]=function(_0xbbbe43,_0x118f10){return _0xbbbe43['define'](_0x83b8('0xa'),attributes,{'tableName':_0x83b8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x335c=['path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x13023b,_0x51328e){var _0x458326=function(_0x24d4cf){while(--_0x24d4cf){_0x13023b['push'](_0x13023b['shift']());}};_0x458326(++_0x51328e);}(_0x335c,0x1da));var _0xc335=function(_0xf4f3c2,_0x48bcbc){_0xf4f3c2=_0xf4f3c2-0x0;var _0x1380d6=_0x335c[_0xf4f3c2];return _0x1380d6;};'use strict';var _=require(_0xc335('0x0'));var util=require(_0xc335('0x1'));var logger=require(_0xc335('0x2'))(_0xc335('0x3'));var moment=require(_0xc335('0x4'));var BPromise=require(_0xc335('0x5'));var rp=require(_0xc335('0x6'));var fs=require('fs');var path=require(_0xc335('0x7'));var rimraf=require('rimraf');var config=require(_0xc335('0x8'));var attributes=require(_0xc335('0x9'));module[_0xc335('0xa')]=function(_0x3f2d9b,_0x1a133d){return _0x3f2d9b[_0xc335('0xb')](_0xc335('0xc'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 0a7f6f1..f014c4c 100644 --- a/server/api/cmCompany/cmCompany.rpc.js +++ b/server/api/cmCompany/cmCompany.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c76=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','bluebird','randomstring'];(function(_0x517dcb,_0xbc9470){var _0x107e15=function(_0x2450a2){while(--_0x2450a2){_0x517dcb['push'](_0x517dcb['shift']());}};_0x107e15(++_0xbc9470);}(_0x9c76,0x75));var _0x69c7=function(_0x2c03c1,_0x19b296){_0x2c03c1=_0x2c03c1-0x0;var _0x513ba0=_0x9c76[_0x2c03c1];return _0x513ba0;};'use strict';var _=require(_0x69c7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x69c7('0x1'));var rs=require(_0x69c7('0x2'));var fs=require('fs');var Redis=require(_0x69c7('0x3'));var db=require(_0x69c7('0x4'))['db'];var utils=require(_0x69c7('0x5'));var logger=require('../../config/logger')(_0x69c7('0x6'));var config=require(_0x69c7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x69c7('0x8')][_0x69c7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d11f5,_0x3b1f13,_0x3cd10f){return new BPromise(function(_0x23525b,_0x1efa97){return client['request'](_0x3d11f5,_0x3cd10f)[_0x69c7('0xa')](function(_0x1f5a2e){logger['info'](_0x69c7('0xb'),_0x3b1f13,_0x69c7('0xc'));logger['debug'](_0x69c7('0xd'),_0x3b1f13,_0x69c7('0xc'),JSON[_0x69c7('0xe')](_0x1f5a2e));if(_0x1f5a2e[_0x69c7('0xf')]){if(_0x1f5a2e[_0x69c7('0xf')][_0x69c7('0x10')]===0x1f4){logger['error'](_0x69c7('0xb'),_0x3b1f13,_0x1f5a2e[_0x69c7('0xf')]['message']);return _0x1efa97(_0x1f5a2e[_0x69c7('0xf')][_0x69c7('0x11')]);}logger[_0x69c7('0xf')](_0x69c7('0xb'),_0x3b1f13,_0x1f5a2e[_0x69c7('0xf')][_0x69c7('0x11')]);return _0x23525b(_0x1f5a2e['error'][_0x69c7('0x11')]);}else{logger[_0x69c7('0x12')](_0x69c7('0xb'),_0x3b1f13,'request\x20sent');_0x23525b(_0x1f5a2e[_0x69c7('0x13')]['message']);}})['catch'](function(_0xaed830){logger[_0x69c7('0xf')](_0x69c7('0xb'),_0x3b1f13,_0xaed830);_0x1efa97(_0xaed830);});});} \ No newline at end of file +var _0xba6d=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x146beb,_0x57b1f4){var _0x404c81=function(_0x320269){while(--_0x320269){_0x146beb['push'](_0x146beb['shift']());}};_0x404c81(++_0x57b1f4);}(_0xba6d,0xeb));var _0xdba6=function(_0x17be5e,_0x35edc6){_0x17be5e=_0x17be5e-0x0;var _0x7b900f=_0xba6d[_0x17be5e];return _0x7b900f;};'use strict';var _=require('lodash');var util=require(_0xdba6('0x0'));var moment=require(_0xdba6('0x1'));var BPromise=require(_0xdba6('0x2'));var rs=require(_0xdba6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdba6('0x4'))['db'];var utils=require(_0xdba6('0x5'));var logger=require(_0xdba6('0x6'))('rpc');var config=require(_0xdba6('0x7'));var jayson=require(_0xdba6('0x8'));var client=jayson[_0xdba6('0x9')][_0xdba6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x305f55,_0x16d39a,_0x304b16){return new BPromise(function(_0x103077,_0x29da7c){return client['request'](_0x305f55,_0x304b16)[_0xdba6('0xb')](function(_0x5ad502){logger[_0xdba6('0xc')](_0xdba6('0xd'),_0x16d39a,_0xdba6('0xe'));logger[_0xdba6('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x16d39a,_0xdba6('0xe'),JSON[_0xdba6('0x10')](_0x5ad502));if(_0x5ad502['error']){if(_0x5ad502[_0xdba6('0x11')]['code']===0x1f4){logger[_0xdba6('0x11')](_0xdba6('0xd'),_0x16d39a,_0x5ad502['error'][_0xdba6('0x12')]);return _0x29da7c(_0x5ad502[_0xdba6('0x11')][_0xdba6('0x12')]);}logger[_0xdba6('0x11')](_0xdba6('0xd'),_0x16d39a,_0x5ad502[_0xdba6('0x11')][_0xdba6('0x12')]);return _0x103077(_0x5ad502[_0xdba6('0x11')][_0xdba6('0x12')]);}else{logger[_0xdba6('0xc')](_0xdba6('0xd'),_0x16d39a,_0xdba6('0xe'));_0x103077(_0x5ad502[_0xdba6('0x13')]['message']);}})['catch'](function(_0x5b1bdd){logger[_0xdba6('0x11')](_0xdba6('0xd'),_0x16d39a,_0x5b1bdd);_0x29da7c(_0x5b1bdd);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 1a4db6e..5ff1e48 100644 --- a/server/api/cmCompany/index.js +++ b/server/api/cmCompany/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81a9=['show','create','post','/:id/contacts','addContacts','put','update','delete','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','describe','/:id'];(function(_0x22e9a5,_0x2a1c0e){var _0x393dda=function(_0x4d67eb){while(--_0x4d67eb){_0x22e9a5['push'](_0x22e9a5['shift']());}};_0x393dda(++_0x2a1c0e);}(_0x81a9,0xe4));var _0x981a=function(_0x1d840d,_0x4160f2){_0x1d840d=_0x1d840d-0x0;var _0x4f52c4=_0x81a9[_0x1d840d];return _0x4f52c4;};'use strict';var multer=require(_0x981a('0x0'));var util=require(_0x981a('0x1'));var path=require('path');var timeout=require(_0x981a('0x2'));var express=require('express');var router=express[_0x981a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x981a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x981a('0x5'));var controller=require(_0x981a('0x6'));router['get']('/',auth[_0x981a('0x7')](),controller[_0x981a('0x8')]);router[_0x981a('0x9')]('/describe',auth[_0x981a('0x7')](),controller[_0x981a('0xa')]);router[_0x981a('0x9')](_0x981a('0xb'),auth['isAuthenticated'](),controller[_0x981a('0xc')]);router['get']('/:id/contacts',auth[_0x981a('0x7')](),controller['getContacts']);router['post']('/',auth[_0x981a('0x7')](),controller[_0x981a('0xd')]);router[_0x981a('0xe')](_0x981a('0xf'),auth['isAuthenticated'](),controller[_0x981a('0x10')]);router[_0x981a('0x11')](_0x981a('0xb'),auth[_0x981a('0x7')](),controller[_0x981a('0x12')]);router[_0x981a('0x13')]('/:id',auth[_0x981a('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0cfe=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','delete','exports','multer','express','Router'];(function(_0x5b5317,_0x2a49c4){var _0x3a212a=function(_0x44c6ba){while(--_0x44c6ba){_0x5b5317['push'](_0x5b5317['shift']());}};_0x3a212a(++_0x2a49c4);}(_0x0cfe,0xb5));var _0xe0cf=function(_0x4a9446,_0x511bb8){_0x4a9446=_0x4a9446-0x0;var _0x5065eb=_0x0cfe[_0x4a9446];return _0x5065eb;};'use strict';var multer=require(_0xe0cf('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe0cf('0x1'));var router=express[_0xe0cf('0x2')]();var fs_extra=require(_0xe0cf('0x3'));var auth=require(_0xe0cf('0x4'));var interaction=require(_0xe0cf('0x5'));var config=require(_0xe0cf('0x6'));var controller=require(_0xe0cf('0x7'));router['get']('/',auth[_0xe0cf('0x8')](),controller[_0xe0cf('0x9')]);router[_0xe0cf('0xa')](_0xe0cf('0xb'),auth[_0xe0cf('0x8')](),controller[_0xe0cf('0xc')]);router[_0xe0cf('0xa')](_0xe0cf('0xd'),auth[_0xe0cf('0x8')](),controller[_0xe0cf('0xe')]);router[_0xe0cf('0xa')](_0xe0cf('0xf'),auth[_0xe0cf('0x8')](),controller[_0xe0cf('0x10')]);router[_0xe0cf('0x11')]('/',auth[_0xe0cf('0x8')](),controller[_0xe0cf('0x12')]);router['post'](_0xe0cf('0xf'),auth[_0xe0cf('0x8')](),controller[_0xe0cf('0x13')]);router[_0xe0cf('0x14')]('/:id',auth[_0xe0cf('0x8')](),controller['update']);router[_0xe0cf('0x15')](_0xe0cf('0xd'),auth[_0xe0cf('0x8')](),controller['destroy']);module[_0xe0cf('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index a961c33..3c8fd36 100644 --- a/server/api/cmContact/cmContact.attributes.js +++ b/server/api/cmContact/cmContact.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x998a=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x3850bb,_0xd4b9ad){var _0x801b50=function(_0x1731d3){while(--_0x1731d3){_0x3850bb['push'](_0x3850bb['shift']());}};_0x801b50(++_0xd4b9ad);}(_0x998a,0x15e));var _0xa998=function(_0x88f35f,_0x51aa02){_0x88f35f=_0x88f35f-0x0;var _0xfeed1c=_0x998a[_0x88f35f];return _0xfeed1c;};'use strict';var _=require(_0xa998('0x0'));var Sequelize=require(_0xa998('0x1'));module[_0xa998('0x2')]={'firstName':{'type':Sequelize[_0xa998('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xa998('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa998('0x3')]},'country':{'type':Sequelize[_0xa998('0x3')]},'dateOfBirth':{'type':Sequelize[_0xa998('0x3')]},'description':{'type':Sequelize[_0xa998('0x4')]},'phone':{'type':Sequelize[_0xa998('0x3')]},'mobile':{'type':Sequelize[_0xa998('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xa998('0x3')]},'url':{'type':Sequelize[_0xa998('0x3')]},'facebook':{'type':Sequelize[_0xa998('0x3')]},'fb_data':{'type':Sequelize[_0xa998('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xa998('0x3')]},'teams':{'type':Sequelize[_0xa998('0x3')]},'viber':{'type':Sequelize[_0xa998('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xa998('0x3')]},'telegram':{'type':Sequelize[_0xa998('0x3')]},'UserId':{'type':Sequelize[_0xa998('0x5')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xa998('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa998('0x7')],'defaultValue':Sequelize[_0xa998('0x8')]},'dialTimezone':{'type':Sequelize[_0xa998('0x3')]},'utcOffset':{'type':Sequelize[_0xa998('0x5')]}}; \ No newline at end of file +var _0x9528=['exports','STRING','TEXT','INTEGER','DATE','NOW','lodash'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x9528,0xae));var _0x8952=function(_0x1417be,_0x1558c7){_0x1417be=_0x1417be-0x0;var _0x34a33e=_0x9528[_0x1417be];return _0x34a33e;};'use strict';var _=require(_0x8952('0x0'));var Sequelize=require('sequelize');module[_0x8952('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x8952('0x2')]},'street':{'type':Sequelize[_0x8952('0x2')]},'postalCode':{'type':Sequelize[_0x8952('0x2')]},'city':{'type':Sequelize[_0x8952('0x2')]},'country':{'type':Sequelize[_0x8952('0x2')]},'dateOfBirth':{'type':Sequelize[_0x8952('0x2')]},'description':{'type':Sequelize[_0x8952('0x3')]},'phone':{'type':Sequelize[_0x8952('0x2')]},'mobile':{'type':Sequelize[_0x8952('0x2')]},'fax':{'type':Sequelize[_0x8952('0x2')]},'email':{'type':Sequelize[_0x8952('0x2')]},'url':{'type':Sequelize[_0x8952('0x2')]},'facebook':{'type':Sequelize[_0x8952('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x8952('0x2')]},'teams':{'type':Sequelize[_0x8952('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x8952('0x2')]},'wechat':{'type':Sequelize[_0x8952('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x8952('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x8952('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x8952('0x5')],'defaultValue':Sequelize[_0x8952('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x8952('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 29d6fed..6823c58 100644 --- a/server/api/cmContact/cmContact.controller.js +++ b/server/api/cmContact/cmContact.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa93=['setFields','toParam','phone','getTags','findOne','model','rawAttributes','filters','attributes','intersection','fields','order','pick','filter','options','nolimit','setTags','ids','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','`ItemType`.OrderBy','CmHopperId','item','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','sort','ContactId','rows','getHopperHistories','CmHopperHistory','includeAll','getHopperFinals','include','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','binding_keys','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','file','filename','chmodSync','0777','child_process','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','path','parse','import','User','agent','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','json','error\x20child\x20process','importUpdates','fork','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','whatsapp','voice','-createdAt','channel','includes','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20createdAt\x20filter','uniqueid','starttime','endtime','duration','note','userDisposition','userSecondDisposition','userThirdDisposition','fullname','createdAt','DESC','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','UserId','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','threadId','Interaction','flatten','sortBy','reverse','value','moment','bluebird','util','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/environment/shared','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register','status','undefined','count','offset','limit','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','describe','getOptions','findAll','query','user','catch','find','params','keys','startsWith','columnName','analytics','CmCustomField','cf_','alias','custom','type','forEach','merge','body','CmContact','from','length','get','mergeWith','isArray','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','$or','where','ListId','findOrCreate','hasOwnProperty','push','contact','all','Tag','Tags','color','CmContactHasItem','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','map','format','cf_%d','pickBy','table'];(function(_0x146711,_0x160ec6){var _0x101a19=function(_0xe6cb2a){while(--_0xe6cb2a){_0x146711['push'](_0x146711['shift']());}};_0x101a19(++_0x160ec6);}(_0xfa93,0x183));var _0x3fa9=function(_0xd4ff0f,_0x45a95a){_0xd4ff0f=_0xd4ff0f-0x0;var _0x5ce111=_0xfa93[_0xd4ff0f];return _0x5ce111;};'use strict';var moment=require(_0x3fa9('0x0'));var BPromise=require(_0x3fa9('0x1'));var util=require(_0x3fa9('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x3fa9('0x3'));var squel=require(_0x3fa9('0x4'));var Papa=require(_0x3fa9('0x5'));var Redis=require(_0x3fa9('0x6'));var contacts=require(_0x3fa9('0x7'));var qs=require(_0x3fa9('0x8'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var shared=require(_0x3fa9('0x9'));var db=require(_0x3fa9('0xa'))['db'];config['redis']=_['defaults'](config[_0x3fa9('0xb')],{'host':_0x3fa9('0xc'),'port':0x18eb});var socket=require(_0x3fa9('0xd'))(new Redis(config[_0x3fa9('0xb')]));require(_0x3fa9('0xe'))[_0x3fa9('0xf')](socket);function respondWithResult(_0x26118f,_0x2d6388){_0x2d6388=_0x2d6388||0xc8;return function(_0x246a17){if(_0x246a17){return _0x26118f[_0x3fa9('0x10')](_0x2d6388)['json'](_0x246a17);}};}function respondWithFilteredResult(_0x30e45d,_0x438c4d){return function(_0x36c163){if(_0x36c163){var _0x57c2aa=typeof _0x438c4d['offset']==='undefined'&&typeof _0x438c4d['limit']===_0x3fa9('0x11');var _0x22b16d=_0x36c163[_0x3fa9('0x12')];var _0x249bfe=_0x57c2aa?0x0:_0x438c4d[_0x3fa9('0x13')];var _0xd88594=_0x57c2aa?_0x36c163[_0x3fa9('0x12')]:_0x438c4d[_0x3fa9('0x13')]+_0x438c4d[_0x3fa9('0x14')];var _0x5fe48c;if(_0xd88594>=_0x22b16d){_0xd88594=_0x22b16d;_0x5fe48c=0xc8;}else{_0x5fe48c=0xce;}_0x30e45d[_0x3fa9('0x10')](_0x5fe48c);return _0x30e45d[_0x3fa9('0x15')](_0x3fa9('0x16'),_0x249bfe+'-'+_0xd88594+'/'+_0x22b16d)['json'](_0x36c163);}return null;};}function saveUpdates(_0x116172){return function(_0x1fa56b){if(_0x1fa56b){return _0x1fa56b[_0x3fa9('0x17')](_0x116172)[_0x3fa9('0x18')](function(_0x3b23a7){return _0x3b23a7;});}return null;};}function removeEntity(_0x5c6a34){return function(_0x5d496c){if(_0x5d496c){return _0x5d496c[_0x3fa9('0x19')]()['then'](function(){_0x5c6a34[_0x3fa9('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2816d2){return function(_0x536965){if(!_0x536965){_0x2816d2[_0x3fa9('0x1a')](0x194);}return _0x536965;};}function handleError(_0x10c0d5,_0x1b7896){_0x1b7896=_0x1b7896||0x1f4;return function(_0x77e5cc){logger[_0x3fa9('0x1b')](_0x77e5cc[_0x3fa9('0x1c')]);if(_0x77e5cc[_0x3fa9('0x1d')]){delete _0x77e5cc[_0x3fa9('0x1d')];}_0x10c0d5['status'](_0x1b7896)[_0x3fa9('0x1e')](_0x77e5cc);};}exports['index']=function(_0x6bc056,_0x3ab978){var _0x3335e3={};return contacts[_0x3fa9('0x1f')]()[_0x3fa9('0x18')](function(_0x4ab2b2){_0x3335e3=qs[_0x3fa9('0x20')](_0x4ab2b2,_0x6bc056);return contacts[_0x3fa9('0x21')](_0x6bc056[_0x3fa9('0x22')],_0x6bc056[_0x3fa9('0x23')],_0x3335e3,_0x4ab2b2);})[_0x3fa9('0x18')](respondWithFilteredResult(_0x3ab978,_0x3335e3))[_0x3fa9('0x24')](handleError(_0x3ab978,null));};exports['destroy']=function(_0x4a2d76,_0x5c9646){return db['CmContact'][_0x3fa9('0x25')]({'where':{'id':_0x4a2d76[_0x3fa9('0x26')]['id']}})['then'](handleEntityNotFound(_0x5c9646,null))[_0x3fa9('0x18')](removeEntity(_0x5c9646,null))[_0x3fa9('0x24')](handleError(_0x5c9646,null));};exports[_0x3fa9('0x1f')]=function(_0x370ddd,_0x350b50){return db['CmContact'][_0x3fa9('0x1f')]()[_0x3fa9('0x18')](function(_0x81eac2){delete _0x81eac2['tags'];for(var _0x4bca5b=0x0;_0x4bca5b0x0){return new Promise(function(_0x21c9d1){var _0x3f61b5=[];for(var _0x1d966f=0x0;_0x1d966f<_0x93105b['length'];_0x1d966f++){_0x3f61b5[_0x3fa9('0x60')](insertAdditionalPhones(_0x93105b[_0x1d966f][_0x3fa9('0x61')],_0x93105b[_0x1d966f][_0x3fa9('0x57')]));}Promise[_0x3fa9('0x62')](_0x3f61b5)[_0x3fa9('0x18')](function(){_0x21c9d1(0x1);});})[_0x3fa9('0x18')](function(){return{'success':_0x33ea43,'failure':_0x11edd0,'duplicates':_0x4693e7};});}else{return{'success':_0x33ea43,'failure':_0x11edd0,'duplicates':_0x4693e7};}}})[_0x3fa9('0x18')](respondWithResult(_0x23c84b,0xc9))[_0x3fa9('0x24')](handleError(_0x23c84b,null));};exports['show']=function(_0xf28e08,_0x7cc52c){var _0x531255;return db[_0x3fa9('0x33')][_0x3fa9('0x1f')]()['then'](function(_0x2bc3c2){return db['CmContact'][_0x3fa9('0x25')]({'where':{'id':_0xf28e08['params']['id']},'include':[{'model':db[_0x3fa9('0x63')],'as':_0x3fa9('0x64'),'attributes':['id',_0x3fa9('0x1d'),_0x3fa9('0x65')],'required':_0xf28e08[_0x3fa9('0x22')]['tag']?!![]:![]},{'model':db[_0x3fa9('0x66')],'as':_0x3fa9('0x67'),'where':{'CmContactId':_0xf28e08[_0x3fa9('0x26')]['id']},'required':![],'include':[{'model':db[_0x3fa9('0x68')],'as':_0x3fa9('0x69')}]}],'order':[db[_0x3fa9('0x6a')][_0x3fa9('0x6b')](_0x3fa9('0x6c'))],'attributes':_[_0x3fa9('0x27')](_0x2bc3c2)});})[_0x3fa9('0x18')](function(_0x488874){if(!_[_0x3fa9('0x53')](_0x488874)){_0x531255=_0x488874['get']({'plain':!![]});var _0x10b73e={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x488874&&_0x488874['ListId']){if(_0x488874['ListId']){_0x10b73e[_0x3fa9('0x5c')][_0x3fa9('0x6d')][_0x3fa9('0x60')]({'ListId':{'$ne':_0x488874[_0x3fa9('0x5d')]}});}}return db[_0x3fa9('0x2b')][_0x3fa9('0x21')](_0x10b73e);}})[_0x3fa9('0x18')](function(_0x30eb81){if(!_[_0x3fa9('0x53')](_0x30eb81)){return _['omit'](_0x531255,_[_0x3fa9('0x6e')](_0x30eb81,function(_0x3e01f1){return util[_0x3fa9('0x6f')](_0x3fa9('0x70'),_0x3e01f1['id']);}));}})[_0x3fa9('0x18')](handleEntityNotFound(_0x7cc52c,null))[_0x3fa9('0x18')](respondWithResult(_0x7cc52c,null))['catch'](handleError(_0x7cc52c,null));};exports['update']=function(_0x3aa063,_0x19f407){var _0x33f316;if(_0x3aa063[_0x3fa9('0x32')]['id']){delete _0x3aa063['body']['id'];}if(!_[_0x3fa9('0x53')](_0x3aa063[_0x3fa9('0x32')][_0x3fa9('0x54')])){var _0x3cd6ae=_0x3aa063[_0x3fa9('0x32')]['dialTimezone'];if(!_[_0x3fa9('0x53')](shared['timezones'][_0x3cd6ae]))_0x3aa063[_0x3fa9('0x32')][_0x3fa9('0x56')]=shared[_0x3fa9('0x55')][_0x3cd6ae][_0x3fa9('0x56')];}return db['CmContact'][_0x3fa9('0x25')]({'where':{'id':_0x3aa063[_0x3fa9('0x26')]['id']}})['then'](handleEntityNotFound(_0x19f407,null))[_0x3fa9('0x18')](saveUpdates(_0x3aa063[_0x3fa9('0x32')],null))[_0x3fa9('0x18')](function(_0x4ab7fe){_0x33f316=_0x4ab7fe;var _0x465529={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4ab7fe&&_0x4ab7fe[_0x3fa9('0x5d')]){if(_0x4ab7fe[_0x3fa9('0x5d')]){_0x465529[_0x3fa9('0x5c')][_0x3fa9('0x6d')][_0x3fa9('0x60')]({'ListId':{'$ne':_0x4ab7fe[_0x3fa9('0x5d')]}});}}return db[_0x3fa9('0x2b')][_0x3fa9('0x21')](_0x465529);})[_0x3fa9('0x18')](function(_0x4d2c8b){if(_0x4d2c8b){return _['omit'](_[_0x3fa9('0x71')](_0x3aa063[_0x3fa9('0x32')],function(_0x510d5b,_0x3be40b){return _[_0x3fa9('0x28')](_0x3be40b,_0x3fa9('0x2c'));}),_[_0x3fa9('0x6e')](_0x4d2c8b,function(_0x17bab5){return util[_0x3fa9('0x6f')]('cf_%d',_0x17bab5['id']);}));}})['then'](function(_0x4000f0){if(_0x4000f0&&!_['isEmpty'](_0x4000f0)){var _0x405941=squel[_0x3fa9('0x17')]()[_0x3fa9('0x72')]('cm_contacts')[_0x3fa9('0x73')](_0x4000f0)[_0x3fa9('0x5c')]('id\x20=\x20?',_0x3aa063[_0x3fa9('0x26')]['id'])[_0x3fa9('0x74')]();return db[_0x3fa9('0x6a')][_0x3fa9('0x22')](_0x405941['text'],{'replacements':_0x405941['values']});}})[_0x3fa9('0x18')](function(){if(_0x3aa063[_0x3fa9('0x32')][_0x3fa9('0x75')]&&_0x33f316){return db['CmHopper'][_0x3fa9('0x17')]({'phone':_0x3aa063[_0x3fa9('0x32')][_0x3fa9('0x75')],'OrderBy':0x0},{'where':{'ContactId':_0x33f316['id']}});}})[_0x3fa9('0x18')](function(){return _0x33f316;})['then'](respondWithResult(_0x19f407,null))['catch'](handleError(_0x19f407,null));};exports[_0x3fa9('0x76')]=function(_0x33c972,_0x4a22a2){var _0x2d31db={};var _0x4aa5fb={};var _0x32ea04;var _0x494ac2;return db[_0x3fa9('0x33')][_0x3fa9('0x77')]({'where':{'id':_0x33c972['params']['id']}})[_0x3fa9('0x18')](handleEntityNotFound(_0x4a22a2,null))[_0x3fa9('0x18')](function(_0x444e2d){if(_0x444e2d){_0x32ea04=_0x444e2d;_0x4aa5fb[_0x3fa9('0x78')]=_[_0x3fa9('0x27')](db[_0x3fa9('0x63')][_0x3fa9('0x79')]);_0x4aa5fb[_0x3fa9('0x22')]=_['keys'](_0x33c972[_0x3fa9('0x22')]);_0x4aa5fb[_0x3fa9('0x7a')]=_['intersection'](_0x4aa5fb[_0x3fa9('0x78')],_0x4aa5fb[_0x3fa9('0x22')]);_0x2d31db[_0x3fa9('0x7b')]=_[_0x3fa9('0x7c')](_0x4aa5fb['model'],qs[_0x3fa9('0x7d')](_0x33c972[_0x3fa9('0x22')][_0x3fa9('0x7d')]));_0x2d31db['attributes']=_0x2d31db[_0x3fa9('0x7b')][_0x3fa9('0x35')]?_0x2d31db['attributes']:_0x4aa5fb['model'];_0x2d31db[_0x3fa9('0x7e')]=qs['sort'](_0x33c972[_0x3fa9('0x22')]['sort']);_0x2d31db[_0x3fa9('0x5c')]=qs[_0x3fa9('0x7a')](_[_0x3fa9('0x7f')](_0x33c972[_0x3fa9('0x22')],_0x4aa5fb[_0x3fa9('0x7a')]));if(_0x33c972['query'][_0x3fa9('0x80')]){_0x2d31db['where']=_[_0x3fa9('0x31')](_0x2d31db['where'],{'$or':_[_0x3fa9('0x6e')](_0x2d31db[_0x3fa9('0x7b')],function(_0x187ebb){var _0x52a429={};_0x52a429[_0x187ebb]={'$like':'%'+_0x33c972[_0x3fa9('0x22')][_0x3fa9('0x80')]+'%'};return _0x52a429;})});}_0x2d31db=_[_0x3fa9('0x31')]({},_0x2d31db,_0x33c972[_0x3fa9('0x81')]);return _0x32ea04[_0x3fa9('0x76')](_0x2d31db);}})[_0x3fa9('0x18')](function(_0xe0b04d){if(_0xe0b04d){_0x494ac2=_0xe0b04d['length'];if(!_0x33c972['query'][_0x3fa9('0x5f')](_0x3fa9('0x82'))){_0x2d31db[_0x3fa9('0x14')]=qs[_0x3fa9('0x14')](_0x33c972['query'][_0x3fa9('0x14')]);_0x2d31db[_0x3fa9('0x13')]=qs[_0x3fa9('0x13')](_0x33c972['query'][_0x3fa9('0x13')]);}return _0x32ea04[_0x3fa9('0x76')](_0x2d31db);}})[_0x3fa9('0x18')](function(_0x552310){if(_0x552310){return _0x552310?{'count':_0x494ac2,'rows':_0x552310}:null;}})[_0x3fa9('0x18')](respondWithResult(_0x4a22a2,null))[_0x3fa9('0x24')](handleError(_0x4a22a2,null));};exports[_0x3fa9('0x83')]=function(_0x47fe70,_0x8da793){if(_0x47fe70[_0x3fa9('0x32')]['id']){delete _0x47fe70[_0x3fa9('0x32')]['id'];}return db[_0x3fa9('0x33')]['findOne']({'where':{'id':_0x47fe70[_0x3fa9('0x26')]['id']}})[_0x3fa9('0x18')](handleEntityNotFound(_0x8da793,null))[_0x3fa9('0x18')](function(_0x5b4df0){if(_0x5b4df0){return _0x5b4df0['setTags'](_0x47fe70['body'][_0x3fa9('0x84')]||[]);}return null;})[_0x3fa9('0x18')](respondWithResult(_0x8da793,null))[_0x3fa9('0x24')](handleError(_0x8da793,null));};exports['setAdditionalPhones']=function(_0x3e778c,_0x1ffddd){var _0x234178=[];_0x234178[_0x3fa9('0x60')](addAdditionalPhones(_0x3e778c['body']));Promise[_0x3fa9('0x62')](_0x234178)[_0x3fa9('0x18')](function(){_0x234178=[];_0x234178[_0x3fa9('0x60')](deleteCmHopperPhones(_0x3e778c[_0x3fa9('0x32')]['id']));_0x234178[_0x3fa9('0x60')](addCmHopperPhones(_0x3e778c[_0x3fa9('0x32')]['id']));Promise[_0x3fa9('0x62')](_0x234178)[_0x3fa9('0x18')](function(){return[0x1];})[_0x3fa9('0x18')](respondWithResult(_0x1ffddd,null));});};function addAdditionalPhones(_0x5433ee){var _0x40c3fd;return new Promise(function(_0x4acba7){return db[_0x3fa9('0x66')][_0x3fa9('0x19')]({'where':{'CmContactId':_0x5433ee['id']}})[_0x3fa9('0x18')](function(){db['ContactItemType'][_0x3fa9('0x21')]({'raw':!![],'attributes':['id',_0x3fa9('0x85')]})[_0x3fa9('0x18')](function(_0x44ff71){var _0xea3c47=[];for(var _0x2ebc3e=0x0;_0x2ebc3e<_0x5433ee[_0x3fa9('0x86')][_0x3fa9('0x35')];_0x2ebc3e++){var _0x5c173f=_0x5433ee['item_types']?_['isNil'](_0x5433ee[_0x3fa9('0x87')][_0x2ebc3e])?'':_0x5433ee[_0x3fa9('0x87')][_0x2ebc3e]:_0x5433ee[_0x3fa9('0x86')][_0x2ebc3e][_0x3fa9('0x88')]?_0x5433ee[_0x3fa9('0x86')][_0x2ebc3e][_0x3fa9('0x88')]:'';var _0x59227e=_['isNil'](_0x5433ee[_0x3fa9('0x86')][_0x2ebc3e][_0x3fa9('0x89')])?'':_0x5433ee[_0x3fa9('0x86')][_0x2ebc3e][_0x3fa9('0x89')];var _0x6d7512=_0x5c173f+':'+_0x5433ee[_0x3fa9('0x86')][_0x2ebc3e][_0x3fa9('0x75')]+'§'+_0x59227e;if(_[_0x3fa9('0x53')](_0x40c3fd))_0x40c3fd=_0x6d7512;else _0x40c3fd+=';'+_0x6d7512;var _0x199fcd=null;var _0x7cbade=null;if(_0x5433ee[_0x3fa9('0x87')]){if(!_[_0x3fa9('0x53')](_0x5433ee[_0x3fa9('0x87')][_0x2ebc3e])){_0x7cbade=_[_0x3fa9('0x25')](_0x44ff71,function(_0xfaeeab){return _0xfaeeab['id']===_0x5433ee[_0x3fa9('0x87')][_0x2ebc3e];});if(!_[_0x3fa9('0x53')](_0x7cbade)){_0x199fcd=_0x7cbade['OrderBy'];}}}else{if(!_[_0x3fa9('0x53')](_0x5433ee[_0x3fa9('0x86')][_0x2ebc3e])){_0x7cbade=_[_0x3fa9('0x25')](_0x44ff71,function(_0x18fce8){return _0x18fce8['id']===_0x5433ee[_0x3fa9('0x86')][_0x2ebc3e][_0x3fa9('0x88')];});if(!_[_0x3fa9('0x53')](_0x7cbade)){_0x199fcd=_0x2ebc3e;}}}if(_[_0x3fa9('0x53')](_0x199fcd)){_0x199fcd=0x64;}_0xea3c47[_0x3fa9('0x60')](addAdditionalPhone(_0x5433ee['id'],_0x5433ee['items'][_0x2ebc3e][_0x3fa9('0x75')],_0x5433ee[_0x3fa9('0x87')]?_[_0x3fa9('0x53')](_0x5433ee[_0x3fa9('0x87')][_0x2ebc3e])?null:_0x5433ee[_0x3fa9('0x87')][_0x2ebc3e]:_0x5433ee[_0x3fa9('0x86')][_0x2ebc3e][_0x3fa9('0x88')]?_0x5433ee[_0x3fa9('0x86')][_0x2ebc3e][_0x3fa9('0x88')]:null,_0x199fcd,_0x59227e));}Promise['all'](_0xea3c47)[_0x3fa9('0x18')](function(){db[_0x3fa9('0x33')][_0x3fa9('0x17')]({'AdditionalPhones':_0x40c3fd},{'where':{'id':_0x5433ee['id']}})[_0x3fa9('0x18')](function(){_0x4acba7(0x1);});});});});});}function addAdditionalPhone(_0x3f40af,_0x5b1d88,_0x16d36f,_0x493a2b,_0x44d47c){return db[_0x3fa9('0x66')][_0x3fa9('0x25')]({'where':{'CmContactId':_0x3f40af,'item':_0x5b1d88}})[_0x3fa9('0x18')](function(_0x143ec3){if(_0x143ec3)logger['info'](_0x3fa9('0x8a'),_0x143ec3);else{db[_0x3fa9('0x66')][_0x3fa9('0x40')]({'CmContactId':_0x3f40af,'item':_0x5b1d88,'ItemTypeId':_0x16d36f,'OrderBy':_0x493a2b,'ItemClass':'PHONE','description':_0x44d47c});}});}function deleteCmHopperPhones(_0x18c5d1){return new Promise(function(_0x960819){return db[_0x3fa9('0x3d')][_0x3fa9('0x21')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x18c5d1}})[_0x3fa9('0x18')](function(_0x18fe81){db[_0x3fa9('0x8b')][_0x3fa9('0x19')]({'where':{'CmHopperId':{'$in':_[_0x3fa9('0x6e')](_0x18fe81,'id')}}});})[_0x3fa9('0x18')](function(){_0x960819(0x1);});});}function addCmHopperPhones(_0x39dd28){return new Promise(function(_0x2f0729){return db[_0x3fa9('0x3d')][_0x3fa9('0x21')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x39dd28}})[_0x3fa9('0x18')](function(_0x1a7276){var _0x156bd3=[];_[_0x3fa9('0x6e')](_0x1a7276,function(_0x598073){_0x156bd3[_0x3fa9('0x60')](createCmHopperPhone(_0x39dd28,_0x598073['id']));});Promise[_0x3fa9('0x62')](_0x156bd3)[_0x3fa9('0x18')](function(){_0x2f0729(0x1);});});});}function createCmHopperPhone(_0x4b02db,_0x45fa24){return new Promise(function(_0x35bd72){db[_0x3fa9('0x66')][_0x3fa9('0x21')]({'raw':!![],'attributes':['item',_0x3fa9('0x85')],'where':{'CmContactId':_0x4b02db,'ItemClass':'PHONE'},'include':[{'model':db[_0x3fa9('0x68')],'attributes':['OrderBy'],'as':'ItemType'}],'order':['OrderBy',db[_0x3fa9('0x6a')][_0x3fa9('0x6b')](_0x3fa9('0x8c'))]})['then'](function(_0x46e2ac){var _0x435e19=0x1;var _0x5eebe0=_[_0x3fa9('0x6e')](_0x46e2ac,function(_0x5593bd){_0x5593bd[_0x3fa9('0x8d')]=_0x45fa24;_0x5593bd['phone']=_0x5593bd[_0x3fa9('0x8e')];_0x5593bd[_0x3fa9('0x85')]=_0x435e19;delete _0x5593bd[_0x3fa9('0x8f')];_0x435e19=_0x435e19+0x1;return _0x5593bd;});return db['CmHopperAdditionalPhone'][_0x3fa9('0x58')](_0x5eebe0,{});})[_0x3fa9('0x18')](function(){_0x35bd72(0x1);});});}function insertAdditionalPhones(_0x360a78,_0xbf019e){return new Promise(function(_0x55b097){var _0x5e90b2=[];for(var _0x2a3ef4=0x0;_0x2a3ef4<_0xbf019e[_0x3fa9('0x35')];_0x2a3ef4++){var _0x13261d=_0xbf019e[_0x2a3ef4];_0x5e90b2[_0x3fa9('0x60')](parseContactItemType(_0x13261d));}Promise[_0x3fa9('0x62')](_0x5e90b2)[_0x3fa9('0x18')](function(){var _0x390234={'id':_0x360a78['id'],'items':_0xbf019e};return addAdditionalPhones(_0x390234)['then'](function(){return addCmHopperPhones(_0x360a78['id']);});})[_0x3fa9('0x18')](function(){_0x55b097(_0x360a78);});});}function parseContactItemType(_0x17d304){return new Promise(function(_0x480522){if(_0x17d304[_0x3fa9('0x5f')]('ItemTypeId')){_0x480522(_0x17d304);}else{return db[_0x3fa9('0x68')][_0x3fa9('0x25')]({'where':{'name':_0x17d304[_0x3fa9('0x69')]}})[_0x3fa9('0x18')](function(_0x509df6){if(_['isNil'](_0x509df6))_0x17d304[_0x3fa9('0x88')]=null;else _0x17d304[_0x3fa9('0x88')]=_0x509df6['id'];_0x480522(_0x17d304);});}});}exports[_0x3fa9('0x90')]=function(_0x4312ef,_0x2b316a){return db['CmContactHasItem'][_0x3fa9('0x21')]({'raw':!![],'where':{'CmContactId':_0x4312ef[_0x3fa9('0x26')]['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0x3fa9('0x68')],'as':_0x3fa9('0x69')}],'order':[[_0x3fa9('0x85')],[db[_0x3fa9('0x6a')][_0x3fa9('0x6b')](_0x3fa9('0x8c'))]]})[_0x3fa9('0x18')](function(_0x12e0c7){return _0x12e0c7;})[_0x3fa9('0x18')](respondWithResult(_0x2b316a,null))[_0x3fa9('0x24')](handleError(_0x2b316a,null));};exports[_0x3fa9('0x91')]=function(_0x5d7538,_0x1f2602){return db[_0x3fa9('0x66')][_0x3fa9('0x21')]({'raw':!![],'where':{'CmContactId':_0x5d7538[_0x3fa9('0x32')][_0x3fa9('0x92')]}})[_0x3fa9('0x18')](function(_0x553144){var _0x354196=_[_0x3fa9('0x6e')](_0x553144,function(_0x420f04){_0x420f04[_0x3fa9('0x93')]=_0x5d7538[_0x3fa9('0x32')][_0x3fa9('0x94')];return _0x420f04;});return db[_0x3fa9('0x66')][_0x3fa9('0x58')](_0x354196,{});})[_0x3fa9('0x18')](function(){return addCmHopperPhones(_0x5d7538[_0x3fa9('0x32')][_0x3fa9('0x94')]);})[_0x3fa9('0x18')](function(){return['ok'];})[_0x3fa9('0x18')](respondWithResult(_0x1f2602,null))[_0x3fa9('0x24')](handleError(_0x1f2602,null));};exports[_0x3fa9('0x95')]=function(_0x19db34,_0x19468d){var _0x4cfcd9=[];_0x4cfcd9[_0x3fa9('0x60')](createCmHopperPhone(_0x19db34['body']['id'],_0x19db34['body']['hopperId']));Promise[_0x3fa9('0x62')](_0x4cfcd9)['then'](function(){return[0x1];})[_0x3fa9('0x18')](respondWithResult(_0x19468d,null));};exports[_0x3fa9('0x96')]=function(_0x269d65,_0x3d28ed){var _0x1e6b92={'raw':![],'where':{}};var _0x3bfdaf={};var _0x7647c8={'count':0x0,'rows':[]};return db[_0x3fa9('0x33')][_0x3fa9('0x77')]({'where':{'id':_0x269d65['params']['id']}})[_0x3fa9('0x18')](handleEntityNotFound(_0x3d28ed,null))[_0x3fa9('0x18')](function(_0x28b07c){if(_0x28b07c){_0x3bfdaf[_0x3fa9('0x78')]=_[_0x3fa9('0x27')](db[_0x3fa9('0x3d')]['rawAttributes']);_0x3bfdaf[_0x3fa9('0x22')]=_['keys'](_0x269d65['query']);_0x3bfdaf[_0x3fa9('0x7a')]=_[_0x3fa9('0x7c')](_0x3bfdaf['model'],_0x3bfdaf[_0x3fa9('0x22')]);_0x1e6b92[_0x3fa9('0x7b')]=_[_0x3fa9('0x7c')](_0x3bfdaf[_0x3fa9('0x78')],qs['fields'](_0x269d65[_0x3fa9('0x22')][_0x3fa9('0x7d')]));_0x1e6b92[_0x3fa9('0x7b')]=_0x1e6b92[_0x3fa9('0x7b')][_0x3fa9('0x35')]?_0x1e6b92[_0x3fa9('0x7b')]:_0x3bfdaf[_0x3fa9('0x78')];if(!_0x269d65[_0x3fa9('0x22')][_0x3fa9('0x5f')](_0x3fa9('0x82'))){_0x1e6b92[_0x3fa9('0x14')]=qs[_0x3fa9('0x14')](_0x269d65[_0x3fa9('0x22')]['limit']);_0x1e6b92[_0x3fa9('0x13')]=qs[_0x3fa9('0x13')](_0x269d65[_0x3fa9('0x22')][_0x3fa9('0x13')]);}_0x1e6b92[_0x3fa9('0x7e')]=qs[_0x3fa9('0x97')](_0x269d65[_0x3fa9('0x22')][_0x3fa9('0x97')]);_0x1e6b92['where']=qs[_0x3fa9('0x7a')](_[_0x3fa9('0x7f')](_0x269d65[_0x3fa9('0x22')],_0x3bfdaf[_0x3fa9('0x7a')]));_0x1e6b92['where'][_0x3fa9('0x98')]=_0x28b07c['id'];if(_0x269d65['query'][_0x3fa9('0x80')]){_0x1e6b92['where']=_[_0x3fa9('0x31')](_0x1e6b92[_0x3fa9('0x5c')],{'$or':_[_0x3fa9('0x6e')](_0x1e6b92[_0x3fa9('0x7b')],function(_0x58a1a4){var _0x3b206f={};_0x3b206f[_0x58a1a4]={'$like':'%'+_0x269d65[_0x3fa9('0x22')][_0x3fa9('0x80')]+'%'};return _0x3b206f;})});}_0x1e6b92=_[_0x3fa9('0x31')]({},_0x1e6b92,_0x269d65[_0x3fa9('0x81')]);return db[_0x3fa9('0x3d')][_0x3fa9('0x12')]({'where':_0x1e6b92[_0x3fa9('0x5c')]})['then'](function(_0x510887){_0x7647c8[_0x3fa9('0x12')]=_0x510887;if(_0x269d65[_0x3fa9('0x22')]['includeAll']){_0x1e6b92['include']=[{'all':!![]}];}return db['CmHopper'][_0x3fa9('0x21')](_0x1e6b92);})[_0x3fa9('0x18')](function(_0x502ed7){_0x7647c8[_0x3fa9('0x99')]=_0x502ed7;return _0x7647c8;});}})[_0x3fa9('0x18')](respondWithFilteredResult(_0x3d28ed,_0x1e6b92))[_0x3fa9('0x24')](handleError(_0x3d28ed,null));};exports[_0x3fa9('0x9a')]=function(_0x1750f3,_0x2f5c17){var _0x42ba1f={'raw':!![],'where':{}};var _0x2b2e5d={};var _0x365d79={'count':0x0,'rows':[]};return db[_0x3fa9('0x33')][_0x3fa9('0x77')]({'where':{'id':_0x1750f3[_0x3fa9('0x26')]['id']}})[_0x3fa9('0x18')](handleEntityNotFound(_0x2f5c17,null))[_0x3fa9('0x18')](function(_0x3314c4){if(_0x3314c4){_0x2b2e5d[_0x3fa9('0x78')]=_[_0x3fa9('0x27')](db[_0x3fa9('0x9b')]['rawAttributes']);_0x2b2e5d['query']=_[_0x3fa9('0x27')](_0x1750f3['query']);_0x2b2e5d[_0x3fa9('0x7a')]=_['intersection'](_0x2b2e5d[_0x3fa9('0x78')],_0x2b2e5d[_0x3fa9('0x22')]);_0x42ba1f[_0x3fa9('0x7b')]=_[_0x3fa9('0x7c')](_0x2b2e5d[_0x3fa9('0x78')],qs[_0x3fa9('0x7d')](_0x1750f3[_0x3fa9('0x22')]['fields']));_0x42ba1f['attributes']=_0x42ba1f['attributes'][_0x3fa9('0x35')]?_0x42ba1f[_0x3fa9('0x7b')]:_0x2b2e5d[_0x3fa9('0x78')];if(!_0x1750f3[_0x3fa9('0x22')][_0x3fa9('0x5f')]('nolimit')){_0x42ba1f[_0x3fa9('0x14')]=qs[_0x3fa9('0x14')](_0x1750f3['query'][_0x3fa9('0x14')]);_0x42ba1f[_0x3fa9('0x13')]=qs[_0x3fa9('0x13')](_0x1750f3[_0x3fa9('0x22')][_0x3fa9('0x13')]);}_0x42ba1f[_0x3fa9('0x7e')]=qs['sort'](_0x1750f3[_0x3fa9('0x22')][_0x3fa9('0x97')]);_0x42ba1f[_0x3fa9('0x5c')]=qs[_0x3fa9('0x7a')](_[_0x3fa9('0x7f')](_0x1750f3[_0x3fa9('0x22')],_0x2b2e5d[_0x3fa9('0x7a')]));_0x42ba1f[_0x3fa9('0x5c')][_0x3fa9('0x98')]=_0x3314c4['id'];if(_0x1750f3[_0x3fa9('0x22')]['filter']){_0x42ba1f[_0x3fa9('0x5c')]=_['merge'](_0x42ba1f[_0x3fa9('0x5c')],{'$or':_[_0x3fa9('0x6e')](_0x42ba1f[_0x3fa9('0x7b')],function(_0x4ada14){var _0x4ce3b0={};_0x4ce3b0[_0x4ada14]={'$like':'%'+_0x1750f3['query'][_0x3fa9('0x80')]+'%'};return _0x4ce3b0;})});}_0x42ba1f=_[_0x3fa9('0x31')]({},_0x42ba1f,_0x1750f3[_0x3fa9('0x81')]);return db[_0x3fa9('0x9b')]['count']({'where':_0x42ba1f[_0x3fa9('0x5c')]})['then'](function(_0xc6e0b9){_0x365d79[_0x3fa9('0x12')]=_0xc6e0b9;if(_0x1750f3[_0x3fa9('0x22')][_0x3fa9('0x9c')]){_0x42ba1f['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x3fa9('0x21')](_0x42ba1f);})[_0x3fa9('0x18')](function(_0x4c450e){_0x365d79[_0x3fa9('0x99')]=_0x4c450e;return _0x365d79;});}})[_0x3fa9('0x18')](respondWithFilteredResult(_0x2f5c17,_0x42ba1f))['catch'](handleError(_0x2f5c17,null));};exports[_0x3fa9('0x9d')]=function(_0x34aa51,_0x1a107b){var _0x76161f={'raw':!![],'where':{}};var _0x3e0e8a={};var _0x5ccb0e={'count':0x0,'rows':[]};return db[_0x3fa9('0x33')][_0x3fa9('0x77')]({'where':{'id':_0x34aa51[_0x3fa9('0x26')]['id']}})['then'](handleEntityNotFound(_0x1a107b,null))['then'](function(_0x42657e){if(_0x42657e){_0x3e0e8a[_0x3fa9('0x78')]=_[_0x3fa9('0x27')](db[_0x3fa9('0x4a')][_0x3fa9('0x79')]);_0x3e0e8a['query']=_[_0x3fa9('0x27')](_0x34aa51[_0x3fa9('0x22')]);_0x3e0e8a[_0x3fa9('0x7a')]=_[_0x3fa9('0x7c')](_0x3e0e8a[_0x3fa9('0x78')],_0x3e0e8a[_0x3fa9('0x22')]);_0x76161f[_0x3fa9('0x7b')]=_[_0x3fa9('0x7c')](_0x3e0e8a[_0x3fa9('0x78')],qs['fields'](_0x34aa51[_0x3fa9('0x22')]['fields']));_0x76161f[_0x3fa9('0x7b')]=_0x76161f['attributes'][_0x3fa9('0x35')]?_0x76161f[_0x3fa9('0x7b')]:_0x3e0e8a[_0x3fa9('0x78')];if(!_0x34aa51[_0x3fa9('0x22')][_0x3fa9('0x5f')]('nolimit')){_0x76161f[_0x3fa9('0x14')]=qs[_0x3fa9('0x14')](_0x34aa51[_0x3fa9('0x22')][_0x3fa9('0x14')]);_0x76161f[_0x3fa9('0x13')]=qs['offset'](_0x34aa51[_0x3fa9('0x22')]['offset']);}_0x76161f['order']=qs[_0x3fa9('0x97')](_0x34aa51[_0x3fa9('0x22')][_0x3fa9('0x97')]);_0x76161f[_0x3fa9('0x5c')]=qs[_0x3fa9('0x7a')](_['pick'](_0x34aa51[_0x3fa9('0x22')],_0x3e0e8a[_0x3fa9('0x7a')]));_0x76161f['where'][_0x3fa9('0x98')]=_0x42657e['id'];if(_0x34aa51[_0x3fa9('0x22')][_0x3fa9('0x80')]){_0x76161f[_0x3fa9('0x5c')]=_[_0x3fa9('0x31')](_0x76161f[_0x3fa9('0x5c')],{'$or':_[_0x3fa9('0x6e')](_0x76161f['attributes'],function(_0x487dc){var _0x4d55cb={};_0x4d55cb[_0x487dc]={'$like':'%'+_0x34aa51[_0x3fa9('0x22')][_0x3fa9('0x80')]+'%'};return _0x4d55cb;})});}_0x76161f=_[_0x3fa9('0x31')]({},_0x76161f,_0x34aa51[_0x3fa9('0x81')]);return db[_0x3fa9('0x4a')][_0x3fa9('0x12')]({'where':_0x76161f[_0x3fa9('0x5c')]})[_0x3fa9('0x18')](function(_0xff0412){_0x5ccb0e[_0x3fa9('0x12')]=_0xff0412;if(_0x34aa51[_0x3fa9('0x22')][_0x3fa9('0x9c')]){_0x76161f[_0x3fa9('0x9e')]=[{'all':!![]}];}return db[_0x3fa9('0x4a')][_0x3fa9('0x21')](_0x76161f);})['then'](function(_0x17b5cb){_0x5ccb0e[_0x3fa9('0x99')]=_0x17b5cb;return _0x5ccb0e;});}})[_0x3fa9('0x18')](respondWithFilteredResult(_0x1a107b,_0x76161f))[_0x3fa9('0x24')](handleError(_0x1a107b,null));};exports[_0x3fa9('0x9f')]=function(_0x5e18f0,_0xecfcaa){var _0xdb5965={'raw':!![],'where':{}};var _0x10b05d={};var _0x344fa7={'count':0x0,'rows':[]};return db[_0x3fa9('0x33')][_0x3fa9('0x77')]({'where':{'id':_0x5e18f0[_0x3fa9('0x26')]['id']}})['then'](handleEntityNotFound(_0xecfcaa,null))[_0x3fa9('0x18')](function(_0x413b55){if(_0x413b55){_0x10b05d[_0x3fa9('0x78')]=_[_0x3fa9('0x27')](db['JscriptySessionReport'][_0x3fa9('0x79')]);_0x10b05d['query']=_[_0x3fa9('0x27')](_0x5e18f0[_0x3fa9('0x22')]);_0x10b05d['filters']=_[_0x3fa9('0x7c')](_0x10b05d[_0x3fa9('0x78')],_0x10b05d[_0x3fa9('0x22')]);_0xdb5965[_0x3fa9('0x7b')]=_['intersection'](_0x10b05d[_0x3fa9('0x78')],qs[_0x3fa9('0x7d')](_0x5e18f0[_0x3fa9('0x22')][_0x3fa9('0x7d')]));_0xdb5965[_0x3fa9('0x7b')]=_0xdb5965['attributes'][_0x3fa9('0x35')]?_0xdb5965[_0x3fa9('0x7b')]:_0x10b05d['model'];if(!_0x5e18f0[_0x3fa9('0x22')][_0x3fa9('0x5f')](_0x3fa9('0x82'))){_0xdb5965[_0x3fa9('0x14')]=qs[_0x3fa9('0x14')](_0x5e18f0['query'][_0x3fa9('0x14')]);_0xdb5965[_0x3fa9('0x13')]=qs[_0x3fa9('0x13')](_0x5e18f0[_0x3fa9('0x22')]['offset']);}_0xdb5965['order']=qs[_0x3fa9('0x97')](_0x5e18f0['query']['sort']);_0xdb5965['where']=qs[_0x3fa9('0x7a')](_[_0x3fa9('0x7f')](_0x5e18f0[_0x3fa9('0x22')],_0x10b05d['filters']));_0xdb5965[_0x3fa9('0x5c')]['ContactId']=_0x413b55['id'];if(_0x5e18f0[_0x3fa9('0x22')][_0x3fa9('0x80')]){_0xdb5965[_0x3fa9('0x5c')]=_['merge'](_0xdb5965[_0x3fa9('0x5c')],{'$or':_[_0x3fa9('0x6e')](_0xdb5965[_0x3fa9('0x7b')],function(_0x12d311){var _0xab2bf8={};_0xab2bf8[_0x12d311]={'$like':'%'+_0x5e18f0[_0x3fa9('0x22')][_0x3fa9('0x80')]+'%'};return _0xab2bf8;})});}_0xdb5965=_[_0x3fa9('0x31')]({},_0xdb5965,_0x5e18f0[_0x3fa9('0x81')]);return db[_0x3fa9('0x51')]['count']({'where':_0xdb5965[_0x3fa9('0x5c')]})[_0x3fa9('0x18')](function(_0x4c47b1){_0x344fa7[_0x3fa9('0x12')]=_0x4c47b1;if(_0x5e18f0[_0x3fa9('0x22')]['includeAll']){_0xdb5965[_0x3fa9('0x9e')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x3fa9('0x21')](_0xdb5965);})[_0x3fa9('0x18')](function(_0x481472){_0x344fa7['rows']=_0x481472;return _0x344fa7;});}})[_0x3fa9('0x18')](respondWithFilteredResult(_0xecfcaa,_0xdb5965))[_0x3fa9('0x24')](handleError(_0xecfcaa,null));};exports[_0x3fa9('0xa0')]=function(_0x2cce2b,_0x4d3ba9){try{if(!_0x2cce2b[_0x3fa9('0x32')][_0x3fa9('0x5d')]){throw new Error(_0x3fa9('0xa1'));}if(!_0x2cce2b[_0x3fa9('0x32')]['binding_keys']){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x2cce2b[_0x3fa9('0x32')][_0x3fa9('0xa2')]){throw new Error(_0x3fa9('0xa3'));}if(!_0x2cce2b[_0x3fa9('0x32')][_0x3fa9('0xa4')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x4f4844=_0x2cce2b[_0x3fa9('0x32')][_0x3fa9('0xa5')][_0x3fa9('0xa6')](',');var _0x3cf240=_0x2cce2b[_0x3fa9('0x32')][_0x3fa9('0xa2')][_0x3fa9('0xa6')](',');if(!_0x4f4844[_0x3fa9('0x35')]||!_0x3cf240[_0x3fa9('0x35')]||_0x4f4844[_0x3fa9('0x35')]!==_0x3cf240[_0x3fa9('0x35')]){throw new Error(_0x3fa9('0xa7'));}_0x2cce2b[_0x3fa9('0x32')][_0x3fa9('0x7d')]=_[_0x3fa9('0xa8')](_0x4f4844,_0x3cf240);if(!_0x2cce2b[_0x3fa9('0x32')][_0x3fa9('0x7d')][_0x3fa9('0x75')]){throw new Error(_0x3fa9('0xa9'));}if(!_0x2cce2b[_0x3fa9('0x32')][_0x3fa9('0x7d')][_0x3fa9('0xaa')]){throw new Error(_0x3fa9('0xab'));}var _0x43c8d7=path[_0x3fa9('0x3a')](config['root'],'server/files/tmp',_0x2cce2b[_0x3fa9('0xac')][_0x3fa9('0xad')]);fs[_0x3fa9('0xae')](_0x43c8d7,parseInt(_0x3fa9('0xaf'),0x8));var _0x43c15b=require(_0x3fa9('0xb0'))['fork'](path[_0x3fa9('0x3a')](__dirname,'../../components/import/cm/csv'),[_0x43c8d7,_0x2cce2b[_0x3fa9('0x32')][_0x3fa9('0xa5')],_0x2cce2b[_0x3fa9('0x32')][_0x3fa9('0xa2')],_0x2cce2b['body'][_0x3fa9('0x5d')],_0x2cce2b[_0x3fa9('0x32')][_0x3fa9('0xb1')],_0x2cce2b[_0x3fa9('0x32')][_0x3fa9('0x5a')],_0x2cce2b[_0x3fa9('0x32')][_0x3fa9('0xa4')]]);return _0x4d3ba9[_0x3fa9('0x10')](0xc8)['json']({'message':_0x3fa9('0xb2'),'pid':_0x43c15b[_0x3fa9('0xb3')]});}catch(_0x48856c){return _0x4d3ba9[_0x3fa9('0x10')](0x1f4)['send'](_0x48856c);}};exports[_0x3fa9('0xb4')]=function(_0x5b54fe,_0x7b26bd){var _0x19aa47=fs[_0x3fa9('0xb5')](_0x5b54fe[_0x3fa9('0xac')][_0x3fa9('0xb6')]);Papa[_0x3fa9('0xb7')](_0x19aa47,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x155d7c){return _0x7b26bd['status'](0xc8)['json']({'file':_0x5b54fe['file'],'fields':_0x155d7c['meta'][_0x3fa9('0x7d')]});}});};exports[_0x3fa9('0xb8')]=function(_0x40cee7,_0x518672){return db[_0x3fa9('0xb9')][_0x3fa9('0x21')]({'raw':!![],'attributes':['id'],'where':{'role':_0x3fa9('0xba')}})['then'](function(_0x3329f1){var _0x3b71c3=![];if(!_0x40cee7[_0x3fa9('0x32')][_0x3fa9('0x5d')]){throw new Error(_0x3fa9('0xa1'));}if(!_0x40cee7[_0x3fa9('0x32')]['binding'][_0x3fa9('0x75')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x40cee7[_0x3fa9('0x32')][_0x3fa9('0xbb')][_0x3fa9('0xaa')]){throw new Error(_0x3fa9('0xab'));}if(!_0x40cee7['body'][_0x3fa9('0xa4')]){throw new Error(_0x3fa9('0xbc'));}var _0x283e87=require('child_process')['fork'](path[_0x3fa9('0x3a')](__dirname,_0x3fa9('0xbd')),[_0x40cee7['params']['id'],JSON[_0x3fa9('0xbe')](_0x40cee7[_0x3fa9('0x32')]),JSON[_0x3fa9('0xbe')](_0x3329f1)]);_0x283e87['on'](_0x3fa9('0xbf'),function(){_0x3b71c3=!![];return _0x518672[_0x3fa9('0x10')](0xc8)[_0x3fa9('0xc0')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x283e87[_0x3fa9('0xb3')]});});_0x283e87['on']('exit',function(_0x58d44d){if(_0x58d44d&&!_0x3b71c3){return _0x518672['status'](0x1f4)[_0x3fa9('0xc0')]({'message':_0x3fa9('0xc1'),'pid':_0x283e87[_0x3fa9('0xb3')]});}});})['catch'](handleError(_0x518672,null));};exports[_0x3fa9('0xc2')]=function(_0x1f65c4,_0x1e2599){return db['User'][_0x3fa9('0x21')]({'raw':!![],'attributes':['id'],'where':{'role':_0x3fa9('0xba')}})['then'](function(_0x49211e){var _0x4ece3d=![];if(!_0x1f65c4[_0x3fa9('0x32')][_0x3fa9('0x5d')]){throw new Error('No\x20ListId\x20specified');}if(!_0x1f65c4[_0x3fa9('0x32')][_0x3fa9('0xbb')][_0x3fa9('0x75')]){throw new Error(_0x3fa9('0xa9'));}if(!_0x1f65c4['body']['binding'][_0x3fa9('0xaa')]){throw new Error(_0x3fa9('0xab'));}if(!_0x1f65c4[_0x3fa9('0x32')][_0x3fa9('0xa4')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x9c2449=require(_0x3fa9('0xb0'))[_0x3fa9('0xc3')](path[_0x3fa9('0x3a')](__dirname,_0x3fa9('0xc4')),[_0x1f65c4['params']['id'],JSON[_0x3fa9('0xbe')](_0x1f65c4['body']),JSON['stringify'](_0x49211e)]);_0x9c2449['on']('message',function(){_0x4ece3d=!![];return _0x1e2599[_0x3fa9('0x10')](0xc8)[_0x3fa9('0xc0')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x9c2449['pid']});});_0x9c2449['on'](_0x3fa9('0xc5'),function(_0x173e9c){if(_0x173e9c&&!_0x4ece3d){return _0x1e2599[_0x3fa9('0x10')](0x1f4)[_0x3fa9('0xc0')]({'message':_0x3fa9('0xc1'),'pid':_0x9c2449[_0x3fa9('0xb3')]});}});})[_0x3fa9('0x24')](handleError(_0x1e2599,null));};exports[_0x3fa9('0xc6')]=function(_0x5bb97a,_0x2e0224){var _0x22756a=[_0x3fa9('0xc7'),_0x3fa9('0xc8'),_0x3fa9('0xc9'),_0x3fa9('0xca'),'fax',_0x3fa9('0xcb'),_0x3fa9('0xcc')];var _0x27d2f1={'offset':0x0,'order':qs[_0x3fa9('0x97')](_0x3fa9('0xcd'))},_0x4f0e60={'count':0x0,'rows':[]};Promise['resolve']()[_0x3fa9('0x18')](function(){if(_0x5bb97a['query'][_0x3fa9('0xce')]){if(!_[_0x3fa9('0xcf')](_0x22756a,_0x5bb97a[_0x3fa9('0x22')]['channel'][_0x3fa9('0xd0')]())){throw new Error('Invalid\x20channel');}_0x22756a=[_0x5bb97a['query'][_0x3fa9('0xce')][_0x3fa9('0xd0')]()];}if(_0x5bb97a[_0x3fa9('0x22')][_0x3fa9('0xd1')]){try{var _0x25362e=JSON[_0x3fa9('0xb7')](_0x5bb97a[_0x3fa9('0x22')]['range']);if(!moment(_0x25362e[_0x3fa9('0x34')])['isValid']()){throw new Error(_0x3fa9('0xd2'));}if(!moment(_0x25362e['to'])[_0x3fa9('0xd3')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x4df7bd){throw new Error(_0x3fa9('0xd4'));}}if(!_0x5bb97a['query'][_0x3fa9('0x5f')](_0x3fa9('0x82'))){_0x27d2f1[_0x3fa9('0x14')]=qs[_0x3fa9('0x14')](_0x5bb97a[_0x3fa9('0x22')][_0x3fa9('0x14')]||0xa);_0x27d2f1[_0x3fa9('0x13')]=qs[_0x3fa9('0x13')](_0x5bb97a[_0x3fa9('0x22')][_0x3fa9('0x13')]);}var _0x2fa206=_0x22756a[_0x3fa9('0x6e')](function(_0x4e1062){if(_0x4e1062==='voice'){var _0x574290={'attributes':['id',_0x3fa9('0xd5'),_0x3fa9('0x2f'),'source','destination','callerid',_0x3fa9('0xd6'),_0x3fa9('0xd7'),_0x3fa9('0xd8'),_0x3fa9('0xd9'),'createdAt',_0x3fa9('0xda'),_0x3fa9('0xdb'),_0x3fa9('0xdc'),'UserId'],'where':{'ContactId':_0x5bb97a[_0x3fa9('0x26')]['id']},'include':[{'model':db['User'],'as':_0x3fa9('0xb9'),'attributes':['id',_0x3fa9('0x1d'),_0x3fa9('0xdd'),_0x3fa9('0x2d')]}],'order':[[_0x3fa9('0xde'),_0x3fa9('0xdf')]]};if(_0x5bb97a[_0x3fa9('0x22')][_0x3fa9('0xd1')]){_0x574290[_0x3fa9('0x5c')][_0x3fa9('0xde')]={'$gte':_0x25362e[_0x3fa9('0x34')],'$lte':_0x25362e['to']};}return db[_0x3fa9('0x4c')]['findAndCountAll'](_0x574290)[_0x3fa9('0x18')](function(_0x17acc1){_0x4f0e60[_0x3fa9('0x12')]+=_0x17acc1[_0x3fa9('0x12')];return _[_0x3fa9('0x6e')](_0x17acc1[_0x3fa9('0x99')],function(_0x247a54){var _0x144936=_0x247a54[_0x3fa9('0x36')]({'plain':!![]});_0x144936[_0x3fa9('0xce')]=_0x4e1062;if(_0x144936[_0x3fa9('0xb9')]){_0x144936['User']={'id':_0x144936[_0x3fa9('0xb9')]['id'],'name':_0x144936[_0x3fa9('0xb9')][_0x3fa9('0x1d')],'fullname':_0x144936['User'][_0x3fa9('0xdd')],'alias':_0x144936[_0x3fa9('0xb9')][_0x3fa9('0x2d')]};}return _0x144936;});});}else{var _0x276703=_[_0x3fa9('0xe0')](_0x4e1062)+(_0x4e1062==='chat'?_0x3fa9('0xe1'):_0x3fa9('0xe2'));var _0x26abf={'attributes':['id',_0x3fa9('0xe3'),_0x3fa9('0xe4'),'createdAt',_0x3fa9('0xd9'),_0x3fa9('0xe5'),_0x3fa9('0xe6'),_0x3fa9('0xe7'),_0x3fa9('0xe8'),_0x276703+'Id'],'where':{'ContactId':_0x5bb97a['params']['id']},'include':[{'model':db[_0x276703],'as':_0x3fa9('0xe2'),'attributes':['id',_0x3fa9('0x1d'),'key']},{'model':db['User'],'as':_0x3fa9('0xe9'),'attributes':['id',_0x3fa9('0x1d'),'fullname']},{'model':db['Tag'],'as':_0x3fa9('0x64'),'attributes':['id',_0x3fa9('0x1d'),'color'],'through':{'attributes':[]}}],'order':[[_0x3fa9('0xde'),_0x3fa9('0xdf')]]};if(_0x5bb97a[_0x3fa9('0x22')][_0x3fa9('0xd1')]){_0x26abf['where'][_0x3fa9('0xde')]={'$gte':_0x25362e[_0x3fa9('0x34')],'$lte':_0x25362e['to']};}switch(_0x4e1062){case _0x3fa9('0xc8'):_0x26abf[_0x3fa9('0x7b')]['push'](_0x3fa9('0xea'),_0x3fa9('0xeb'),_0x3fa9('0xec'),_0x3fa9('0xed'),_0x3fa9('0xee'),_0x3fa9('0xef'),_0x3fa9('0xf0'),_0x3fa9('0xf1'),_0x3fa9('0xf2'));break;case'mail':_0x26abf[_0x3fa9('0x7b')][_0x3fa9('0x60')](_0x3fa9('0xf3'),_0x3fa9('0xf4'));break;case'openchannel':_0x26abf[_0x3fa9('0x7b')]['push']('externalUrl',_0x3fa9('0xf5'));break;}return db[_[_0x3fa9('0xe0')](_0x4e1062)+_0x3fa9('0xf6')]['findAndCountAll'](_0x26abf)[_0x3fa9('0x18')](function(_0xba152e){_0x4f0e60[_0x3fa9('0x12')]+=_0xba152e[_0x3fa9('0x12')];return _[_0x3fa9('0x6e')](_0xba152e[_0x3fa9('0x99')],function(_0x5c05db){var _0x221c97=_0x5c05db['get']({'plain':!![]});_0x221c97[_0x3fa9('0xce')]=_0x4e1062;if(_0x221c97[_0x3fa9('0xe9')]){_0x221c97[_0x3fa9('0xe9')]={'id':_0x221c97['Owner']['id'],'name':_0x221c97[_0x3fa9('0xe9')][_0x3fa9('0x1d')],'fullname':_0x221c97[_0x3fa9('0xe9')][_0x3fa9('0xdd')]};}return _0x221c97;});});}});return Promise[_0x3fa9('0x62')](_0x2fa206);})[_0x3fa9('0x18')](function(_0x515303){return _(_0x515303)[_0x3fa9('0xf7')]()[_0x3fa9('0xf8')](_0x3fa9('0xde'))[_0x3fa9('0xf9')]()[_0x3fa9('0xfa')]();})[_0x3fa9('0x18')](function(_0x3b55a2){_0x4f0e60[_0x3fa9('0x99')]=_0x27d2f1[_0x3fa9('0x14')]?_0x3b55a2['slice'](_0x27d2f1[_0x3fa9('0x13')],_0x27d2f1[_0x3fa9('0x13')]+_0x27d2f1['limit']):_0x3b55a2;return _0x4f0e60;})[_0x3fa9('0x18')](respondWithFilteredResult(_0x2e0224,_0x27d2f1))[_0x3fa9('0x24')](handleError(_0x2e0224,null));}; \ No newline at end of file +var _0xf7a5=['../../config/environment/shared','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','end','sendStatus','error','stack','name','send','index','describe','getOptions','query','user','CmContact','find','params','tags','keys','startsWith','cf_','columnName','displayName','analytics','CmCustomField','length','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','findAll','from','get','mergeWith','isArray','CmHopper','CmHopperBlack','ChatInteraction','ChatMessage','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','catch','join','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','ListId','findOrCreate','spread','push','all','Tag','Tags','color','tag','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','omit','map','format','pickBy','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','phone','getTags','findOne','rawAttributes','filters','intersection','model','attributes','fields','order','sort','pick','options','setTags','ids','OrderBy','items','item_types','ItemTypeId','description','create','item','PHONE','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','CmHopperAdditionalPhone','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','getHoppers','nolimit','ContactId','filter','includeAll','getHopperHistories','include','rows','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','meta','import','agent','binding','../../components/import/cm/csv2','stringify','exit','importUpdates','User','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','whatsapp','voice','-createdAt','resolve','channel','toLowerCase','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','note','userSecondDisposition','userThirdDisposition','UserId','fullname','createdAt','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','DESC','browserName','customerIp','customerPort','deviceModel','ratingType','ratingValue','referer','subject','Interaction','reverse','value','slice','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs'];(function(_0x27b39b,_0x1b9786){var _0x700a04=function(_0x2dab19){while(--_0x2dab19){_0x27b39b['push'](_0x27b39b['shift']());}};_0x700a04(++_0x1b9786);}(_0xf7a5,0x1ef));var _0x5f7a=function(_0x4d94db,_0x5a2d71){_0x4d94db=_0x4d94db-0x0;var _0x41d157=_0xf7a5[_0x4d94db];return _0x41d157;};'use strict';var moment=require('moment');var BPromise=require(_0x5f7a('0x0'));var util=require(_0x5f7a('0x1'));var path=require(_0x5f7a('0x2'));var fs=require('fs');var _=require(_0x5f7a('0x3'));var squel=require(_0x5f7a('0x4'));var Papa=require(_0x5f7a('0x5'));var Redis=require(_0x5f7a('0x6'));var contacts=require(_0x5f7a('0x7'));var qs=require(_0x5f7a('0x8'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var shared=require(_0x5f7a('0x9'));var db=require(_0x5f7a('0xa'))['db'];config[_0x5f7a('0xb')]=_[_0x5f7a('0xc')](config[_0x5f7a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5f7a('0xd'))(new Redis(config[_0x5f7a('0xb')]));require(_0x5f7a('0xe'))[_0x5f7a('0xf')](socket);function respondWithResult(_0x426cae,_0x36d61f){_0x36d61f=_0x36d61f||0xc8;return function(_0xdf92fa){if(_0xdf92fa){return _0x426cae[_0x5f7a('0x10')](_0x36d61f)[_0x5f7a('0x11')](_0xdf92fa);}};}function respondWithFilteredResult(_0x32db85,_0x6834aa){return function(_0x11c27d){if(_0x11c27d){var _0x245e62=typeof _0x6834aa[_0x5f7a('0x12')]===_0x5f7a('0x13')&&typeof _0x6834aa[_0x5f7a('0x14')]==='undefined';var _0x8e44bf=_0x11c27d[_0x5f7a('0x15')];var _0x8bf680=_0x245e62?0x0:_0x6834aa[_0x5f7a('0x12')];var _0x539fa6=_0x245e62?_0x11c27d[_0x5f7a('0x15')]:_0x6834aa[_0x5f7a('0x12')]+_0x6834aa[_0x5f7a('0x14')];var _0x46d7c7;if(_0x539fa6>=_0x8e44bf){_0x539fa6=_0x8e44bf;_0x46d7c7=0xc8;}else{_0x46d7c7=0xce;}_0x32db85[_0x5f7a('0x10')](_0x46d7c7);return _0x32db85[_0x5f7a('0x16')](_0x5f7a('0x17'),_0x8bf680+'-'+_0x539fa6+'/'+_0x8e44bf)[_0x5f7a('0x11')](_0x11c27d);}return null;};}function saveUpdates(_0x558073){return function(_0x24c3d7){if(_0x24c3d7){return _0x24c3d7['update'](_0x558073)[_0x5f7a('0x18')](function(_0x21d604){return _0x21d604;});}return null;};}function removeEntity(_0x170bc3){return function(_0x37b30a){if(_0x37b30a){return _0x37b30a[_0x5f7a('0x19')]()[_0x5f7a('0x18')](function(){_0x170bc3['status'](0xcc)[_0x5f7a('0x1a')]();});}};}function handleEntityNotFound(_0x3d4df4){return function(_0x4573f0){if(!_0x4573f0){_0x3d4df4[_0x5f7a('0x1b')](0x194);}return _0x4573f0;};}function handleError(_0x531903,_0x3604ff){_0x3604ff=_0x3604ff||0x1f4;return function(_0x4b7b0b){logger[_0x5f7a('0x1c')](_0x4b7b0b[_0x5f7a('0x1d')]);if(_0x4b7b0b[_0x5f7a('0x1e')]){delete _0x4b7b0b[_0x5f7a('0x1e')];}_0x531903[_0x5f7a('0x10')](_0x3604ff)[_0x5f7a('0x1f')](_0x4b7b0b);};}exports[_0x5f7a('0x20')]=function(_0x29ba7f,_0x2aa3dd){var _0x3ee9fb={};return contacts[_0x5f7a('0x21')]()[_0x5f7a('0x18')](function(_0xdf6496){_0x3ee9fb=qs[_0x5f7a('0x22')](_0xdf6496,_0x29ba7f);return contacts['findAll'](_0x29ba7f[_0x5f7a('0x23')],_0x29ba7f[_0x5f7a('0x24')],_0x3ee9fb,_0xdf6496);})[_0x5f7a('0x18')](respondWithFilteredResult(_0x2aa3dd,_0x3ee9fb))['catch'](handleError(_0x2aa3dd,null));};exports[_0x5f7a('0x19')]=function(_0x2a437e,_0x1b4dd4){return db[_0x5f7a('0x25')][_0x5f7a('0x26')]({'where':{'id':_0x2a437e[_0x5f7a('0x27')]['id']}})[_0x5f7a('0x18')](handleEntityNotFound(_0x1b4dd4,null))[_0x5f7a('0x18')](removeEntity(_0x1b4dd4,null))['catch'](handleError(_0x1b4dd4,null));};exports[_0x5f7a('0x21')]=function(_0x136f41,_0x325ca5){return db[_0x5f7a('0x25')][_0x5f7a('0x21')]()[_0x5f7a('0x18')](function(_0x439ad6){delete _0x439ad6[_0x5f7a('0x28')];for(var _0x34dd5e=0x0;_0x34dd5e0x0){return new Promise(function(_0x18457d){var _0x492519=[];for(var _0x4a3e55=0x0;_0x4a3e55<_0x11b463[_0x5f7a('0x30')];_0x4a3e55++){_0x492519[_0x5f7a('0x67')](insertAdditionalPhones(_0x11b463[_0x4a3e55]['contact'],_0x11b463[_0x4a3e55][_0x5f7a('0x5f')]));}Promise[_0x5f7a('0x68')](_0x492519)[_0x5f7a('0x18')](function(){_0x18457d(0x1);});})[_0x5f7a('0x18')](function(){return{'success':_0x316a39,'failure':_0x475e35,'duplicates':_0x41bb4a};});}else{return{'success':_0x316a39,'failure':_0x475e35,'duplicates':_0x41bb4a};}}})['then'](respondWithResult(_0x5d445c,0xc9))[_0x5f7a('0x59')](handleError(_0x5d445c,null));};exports['show']=function(_0x17f65f,_0x5467b2){var _0x2750b9;return db['CmContact'][_0x5f7a('0x21')]()[_0x5f7a('0x18')](function(_0x24aedf){return db[_0x5f7a('0x25')][_0x5f7a('0x26')]({'where':{'id':_0x17f65f['params']['id']},'include':[{'model':db[_0x5f7a('0x69')],'as':_0x5f7a('0x6a'),'attributes':['id',_0x5f7a('0x1e'),_0x5f7a('0x6b')],'required':_0x17f65f[_0x5f7a('0x23')][_0x5f7a('0x6c')]?!![]:![]},{'model':db['CmContactHasItem'],'as':'Phones','where':{'CmContactId':_0x17f65f[_0x5f7a('0x27')]['id']},'required':![],'include':[{'model':db[_0x5f7a('0x6d')],'as':_0x5f7a('0x6e')}]}],'order':[db[_0x5f7a('0x6f')][_0x5f7a('0x70')](_0x5f7a('0x71'))],'attributes':_[_0x5f7a('0x29')](_0x24aedf)});})[_0x5f7a('0x18')](function(_0x483ed0){if(!_[_0x5f7a('0x5b')](_0x483ed0)){_0x2750b9=_0x483ed0['get']({'plain':!![]});var _0x411905={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x483ed0&&_0x483ed0['ListId']){if(_0x483ed0[_0x5f7a('0x64')]){_0x411905[_0x5f7a('0x63')][_0x5f7a('0x72')]['push']({'ListId':{'$ne':_0x483ed0[_0x5f7a('0x64')]}});}}return db['CmCustomField'][_0x5f7a('0x3b')](_0x411905);}})[_0x5f7a('0x18')](function(_0x5aebf9){if(!_[_0x5f7a('0x5b')](_0x5aebf9)){return _[_0x5f7a('0x73')](_0x2750b9,_[_0x5f7a('0x74')](_0x5aebf9,function(_0x3d9c08){return util[_0x5f7a('0x75')]('cf_%d',_0x3d9c08['id']);}));}})[_0x5f7a('0x18')](handleEntityNotFound(_0x5467b2,null))[_0x5f7a('0x18')](respondWithResult(_0x5467b2,null))[_0x5f7a('0x59')](handleError(_0x5467b2,null));};exports['update']=function(_0x1c58b7,_0x242c75){var _0x413028;if(_0x1c58b7[_0x5f7a('0x3a')]['id']){delete _0x1c58b7['body']['id'];}if(!_[_0x5f7a('0x5b')](_0x1c58b7['body']['dialTimezone'])){var _0x537fb3=_0x1c58b7[_0x5f7a('0x3a')]['dialTimezone'];if(!_[_0x5f7a('0x5b')](shared[_0x5f7a('0x5d')][_0x537fb3]))_0x1c58b7[_0x5f7a('0x3a')][_0x5f7a('0x5e')]=shared['timezones'][_0x537fb3]['utcOffset'];}return db[_0x5f7a('0x25')][_0x5f7a('0x26')]({'where':{'id':_0x1c58b7[_0x5f7a('0x27')]['id']}})[_0x5f7a('0x18')](handleEntityNotFound(_0x242c75,null))['then'](saveUpdates(_0x1c58b7[_0x5f7a('0x3a')],null))[_0x5f7a('0x18')](function(_0x3bf856){_0x413028=_0x3bf856;var _0x19641d={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3bf856&&_0x3bf856[_0x5f7a('0x64')]){if(_0x3bf856[_0x5f7a('0x64')]){_0x19641d[_0x5f7a('0x63')]['$and'][_0x5f7a('0x67')]({'ListId':{'$ne':_0x3bf856['ListId']}});}}return db['CmCustomField'][_0x5f7a('0x3b')](_0x19641d);})['then'](function(_0x3dfa89){if(_0x3dfa89){return _[_0x5f7a('0x73')](_[_0x5f7a('0x76')](_0x1c58b7[_0x5f7a('0x3a')],function(_0x544144,_0x3b6fd7){return _[_0x5f7a('0x2a')](_0x3b6fd7,_0x5f7a('0x2b'));}),_[_0x5f7a('0x74')](_0x3dfa89,function(_0x107572){return util[_0x5f7a('0x75')](_0x5f7a('0x77'),_0x107572['id']);}));}})[_0x5f7a('0x18')](function(_0x2e351f){if(_0x2e351f&&!_[_0x5f7a('0x78')](_0x2e351f)){var _0x4a4648=squel[_0x5f7a('0x44')]()['table'](_0x5f7a('0x79'))['setFields'](_0x2e351f)[_0x5f7a('0x63')](_0x5f7a('0x7a'),_0x1c58b7[_0x5f7a('0x27')]['id'])[_0x5f7a('0x7b')]();return db['sequelize'][_0x5f7a('0x23')](_0x4a4648['text'],{'replacements':_0x4a4648[_0x5f7a('0x34')]});}})[_0x5f7a('0x18')](function(){if(_0x1c58b7[_0x5f7a('0x3a')][_0x5f7a('0x7c')]&&_0x413028){return db['CmHopper'][_0x5f7a('0x44')]({'phone':_0x1c58b7[_0x5f7a('0x3a')]['phone'],'OrderBy':0x0},{'where':{'ContactId':_0x413028['id']}});}})[_0x5f7a('0x18')](function(){return _0x413028;})[_0x5f7a('0x18')](respondWithResult(_0x242c75,null))[_0x5f7a('0x59')](handleError(_0x242c75,null));};exports[_0x5f7a('0x7d')]=function(_0x1e2877,_0x2fe923){var _0x598982={};var _0x5e65ab={};var _0x1455b1;var _0x384cc9;return db['CmContact'][_0x5f7a('0x7e')]({'where':{'id':_0x1e2877[_0x5f7a('0x27')]['id']}})[_0x5f7a('0x18')](handleEntityNotFound(_0x2fe923,null))[_0x5f7a('0x18')](function(_0x16fedb){if(_0x16fedb){_0x1455b1=_0x16fedb;_0x5e65ab['model']=_['keys'](db['Tag'][_0x5f7a('0x7f')]);_0x5e65ab['query']=_[_0x5f7a('0x29')](_0x1e2877[_0x5f7a('0x23')]);_0x5e65ab[_0x5f7a('0x80')]=_[_0x5f7a('0x81')](_0x5e65ab[_0x5f7a('0x82')],_0x5e65ab[_0x5f7a('0x23')]);_0x598982[_0x5f7a('0x83')]=_['intersection'](_0x5e65ab['model'],qs[_0x5f7a('0x84')](_0x1e2877[_0x5f7a('0x23')][_0x5f7a('0x84')]));_0x598982[_0x5f7a('0x83')]=_0x598982['attributes'][_0x5f7a('0x30')]?_0x598982[_0x5f7a('0x83')]:_0x5e65ab['model'];_0x598982[_0x5f7a('0x85')]=qs[_0x5f7a('0x86')](_0x1e2877[_0x5f7a('0x23')][_0x5f7a('0x86')]);_0x598982['where']=qs['filters'](_[_0x5f7a('0x87')](_0x1e2877['query'],_0x5e65ab['filters']));if(_0x1e2877['query']['filter']){_0x598982[_0x5f7a('0x63')]=_[_0x5f7a('0x39')](_0x598982[_0x5f7a('0x63')],{'$or':_[_0x5f7a('0x74')](_0x598982[_0x5f7a('0x83')],function(_0x4a4838){var _0x1efaf7={};_0x1efaf7[_0x4a4838]={'$like':'%'+_0x1e2877[_0x5f7a('0x23')]['filter']+'%'};return _0x1efaf7;})});}_0x598982=_[_0x5f7a('0x39')]({},_0x598982,_0x1e2877[_0x5f7a('0x88')]);return _0x1455b1[_0x5f7a('0x7d')](_0x598982);}})[_0x5f7a('0x18')](function(_0x23ef67){if(_0x23ef67){_0x384cc9=_0x23ef67[_0x5f7a('0x30')];if(!_0x1e2877[_0x5f7a('0x23')]['hasOwnProperty']('nolimit')){_0x598982[_0x5f7a('0x14')]=qs['limit'](_0x1e2877[_0x5f7a('0x23')][_0x5f7a('0x14')]);_0x598982['offset']=qs[_0x5f7a('0x12')](_0x1e2877[_0x5f7a('0x23')][_0x5f7a('0x12')]);}return _0x1455b1[_0x5f7a('0x7d')](_0x598982);}})[_0x5f7a('0x18')](function(_0x2e302c){if(_0x2e302c){return _0x2e302c?{'count':_0x384cc9,'rows':_0x2e302c}:null;}})['then'](respondWithResult(_0x2fe923,null))[_0x5f7a('0x59')](handleError(_0x2fe923,null));};exports[_0x5f7a('0x89')]=function(_0x273453,_0x5dc277){if(_0x273453['body']['id']){delete _0x273453[_0x5f7a('0x3a')]['id'];}return db['CmContact'][_0x5f7a('0x7e')]({'where':{'id':_0x273453['params']['id']}})[_0x5f7a('0x18')](handleEntityNotFound(_0x5dc277,null))[_0x5f7a('0x18')](function(_0x2158e8){if(_0x2158e8){return _0x2158e8[_0x5f7a('0x89')](_0x273453[_0x5f7a('0x3a')][_0x5f7a('0x8a')]||[]);}return null;})[_0x5f7a('0x18')](respondWithResult(_0x5dc277,null))[_0x5f7a('0x59')](handleError(_0x5dc277,null));};exports['setAdditionalPhones']=function(_0x32efd1,_0x1d66da){var _0x3c967b=[];_0x3c967b[_0x5f7a('0x67')](addAdditionalPhones(_0x32efd1[_0x5f7a('0x3a')]));Promise[_0x5f7a('0x68')](_0x3c967b)[_0x5f7a('0x18')](function(){_0x3c967b=[];_0x3c967b[_0x5f7a('0x67')](deleteCmHopperPhones(_0x32efd1[_0x5f7a('0x3a')]['id']));_0x3c967b['push'](addCmHopperPhones(_0x32efd1['body']['id']));Promise[_0x5f7a('0x68')](_0x3c967b)['then'](function(){return[0x1];})[_0x5f7a('0x18')](respondWithResult(_0x1d66da,null));});};function addAdditionalPhones(_0x2d5e77){var _0x1c15d9;return new Promise(function(_0x43e535){return db[_0x5f7a('0x4e')][_0x5f7a('0x19')]({'where':{'CmContactId':_0x2d5e77['id']}})[_0x5f7a('0x18')](function(){db[_0x5f7a('0x6d')][_0x5f7a('0x3b')]({'raw':!![],'attributes':['id',_0x5f7a('0x8b')]})[_0x5f7a('0x18')](function(_0xed4ecc){var _0x378317=[];for(var _0x4ab771=0x0;_0x4ab771<_0x2d5e77[_0x5f7a('0x8c')][_0x5f7a('0x30')];_0x4ab771++){var _0x365685=_0x2d5e77['item_types']?_[_0x5f7a('0x5b')](_0x2d5e77[_0x5f7a('0x8d')][_0x4ab771])?'':_0x2d5e77[_0x5f7a('0x8d')][_0x4ab771]:_0x2d5e77[_0x5f7a('0x8c')][_0x4ab771][_0x5f7a('0x8e')]?_0x2d5e77[_0x5f7a('0x8c')][_0x4ab771][_0x5f7a('0x8e')]:'';var _0x7cd8a9=_[_0x5f7a('0x5b')](_0x2d5e77[_0x5f7a('0x8c')][_0x4ab771][_0x5f7a('0x8f')])?'':_0x2d5e77[_0x5f7a('0x8c')][_0x4ab771][_0x5f7a('0x8f')];var _0x86bb60=_0x365685+':'+_0x2d5e77['items'][_0x4ab771][_0x5f7a('0x7c')]+'§'+_0x7cd8a9;if(_[_0x5f7a('0x5b')](_0x1c15d9))_0x1c15d9=_0x86bb60;else _0x1c15d9+=';'+_0x86bb60;var _0x42881b=null;var _0x9c2ca6=null;if(_0x2d5e77[_0x5f7a('0x8d')]){if(!_['isNil'](_0x2d5e77['item_types'][_0x4ab771])){_0x9c2ca6=_[_0x5f7a('0x26')](_0xed4ecc,function(_0x1e16de){return _0x1e16de['id']===_0x2d5e77[_0x5f7a('0x8d')][_0x4ab771];});if(!_[_0x5f7a('0x5b')](_0x9c2ca6)){_0x42881b=_0x9c2ca6['OrderBy'];}}}else{if(!_[_0x5f7a('0x5b')](_0x2d5e77[_0x5f7a('0x8c')][_0x4ab771])){_0x9c2ca6=_['find'](_0xed4ecc,function(_0x367fe6){return _0x367fe6['id']===_0x2d5e77[_0x5f7a('0x8c')][_0x4ab771][_0x5f7a('0x8e')];});if(!_[_0x5f7a('0x5b')](_0x9c2ca6)){_0x42881b=_0x4ab771;}}}if(_[_0x5f7a('0x5b')](_0x42881b)){_0x42881b=0x64;}_0x378317[_0x5f7a('0x67')](addAdditionalPhone(_0x2d5e77['id'],_0x2d5e77['items'][_0x4ab771][_0x5f7a('0x7c')],_0x2d5e77[_0x5f7a('0x8d')]?_[_0x5f7a('0x5b')](_0x2d5e77[_0x5f7a('0x8d')][_0x4ab771])?null:_0x2d5e77[_0x5f7a('0x8d')][_0x4ab771]:_0x2d5e77[_0x5f7a('0x8c')][_0x4ab771][_0x5f7a('0x8e')]?_0x2d5e77['items'][_0x4ab771][_0x5f7a('0x8e')]:null,_0x42881b,_0x7cd8a9));}Promise[_0x5f7a('0x68')](_0x378317)['then'](function(){db[_0x5f7a('0x25')][_0x5f7a('0x44')]({'AdditionalPhones':_0x1c15d9},{'where':{'id':_0x2d5e77['id']}})['then'](function(){_0x43e535(0x1);});});});});});}function addAdditionalPhone(_0xa1dc1b,_0x209c50,_0x24fcc0,_0x52fc66,_0x2b34e9){return db['CmContactHasItem'][_0x5f7a('0x26')]({'where':{'CmContactId':_0xa1dc1b,'item':_0x209c50}})['then'](function(_0x3339a0){if(_0x3339a0)logger[_0x5f7a('0x35')]('contact\x20phone\x20exists',_0x3339a0);else{db[_0x5f7a('0x4e')][_0x5f7a('0x90')]({'CmContactId':_0xa1dc1b,'item':_0x209c50,'ItemTypeId':_0x24fcc0,'OrderBy':_0x52fc66,'ItemClass':'PHONE','description':_0x2b34e9});}});}function deleteCmHopperPhones(_0x543306){return new Promise(function(_0x4c080b){return db[_0x5f7a('0x40')][_0x5f7a('0x3b')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x543306}})[_0x5f7a('0x18')](function(_0x479985){db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':{'$in':_['map'](_0x479985,'id')}}});})['then'](function(){_0x4c080b(0x1);});});}function addCmHopperPhones(_0x14b603){return new Promise(function(_0x37b963){return db[_0x5f7a('0x40')][_0x5f7a('0x3b')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x14b603}})[_0x5f7a('0x18')](function(_0x3323ab){var _0x433deb=[];_[_0x5f7a('0x74')](_0x3323ab,function(_0x1d98c7){_0x433deb['push'](createCmHopperPhone(_0x14b603,_0x1d98c7['id']));});Promise[_0x5f7a('0x68')](_0x433deb)[_0x5f7a('0x18')](function(){_0x37b963(0x1);});});});}function createCmHopperPhone(_0x3ae03a,_0x1d3993){return new Promise(function(_0x465bc7){db[_0x5f7a('0x4e')][_0x5f7a('0x3b')]({'raw':!![],'attributes':[_0x5f7a('0x91'),_0x5f7a('0x8b')],'where':{'CmContactId':_0x3ae03a,'ItemClass':_0x5f7a('0x92')},'include':[{'model':db[_0x5f7a('0x6d')],'attributes':[_0x5f7a('0x8b')],'as':_0x5f7a('0x6e')}],'order':[_0x5f7a('0x8b'),db['sequelize'][_0x5f7a('0x70')](_0x5f7a('0x93'))]})[_0x5f7a('0x18')](function(_0x4bdeef){var _0x57c97b=0x1;var _0x147155=_[_0x5f7a('0x74')](_0x4bdeef,function(_0x1d2e47){_0x1d2e47[_0x5f7a('0x94')]=_0x1d3993;_0x1d2e47[_0x5f7a('0x7c')]=_0x1d2e47[_0x5f7a('0x91')];_0x1d2e47[_0x5f7a('0x8b')]=_0x57c97b;delete _0x1d2e47[_0x5f7a('0x95')];_0x57c97b=_0x57c97b+0x1;return _0x1d2e47;});return db[_0x5f7a('0x96')]['bulkCreate'](_0x147155,{});})['then'](function(){_0x465bc7(0x1);});});}function insertAdditionalPhones(_0x4c98cf,_0x1e233f){return new Promise(function(_0x2d931b){var _0x4c2d6f=[];for(var _0x1328a3=0x0;_0x1328a3<_0x1e233f['length'];_0x1328a3++){var _0x2a87a0=_0x1e233f[_0x1328a3];_0x4c2d6f[_0x5f7a('0x67')](parseContactItemType(_0x2a87a0));}Promise[_0x5f7a('0x68')](_0x4c2d6f)[_0x5f7a('0x18')](function(){var _0x593b47={'id':_0x4c98cf['id'],'items':_0x1e233f};return addAdditionalPhones(_0x593b47)[_0x5f7a('0x18')](function(){return addCmHopperPhones(_0x4c98cf['id']);});})[_0x5f7a('0x18')](function(){_0x2d931b(_0x4c98cf);});});}function parseContactItemType(_0x3b3b5b){return new Promise(function(_0x2f60eb){if(_0x3b3b5b['hasOwnProperty'](_0x5f7a('0x8e'))){_0x2f60eb(_0x3b3b5b);}else{return db[_0x5f7a('0x6d')][_0x5f7a('0x26')]({'where':{'name':_0x3b3b5b['ItemType']}})['then'](function(_0xcfe7ab){if(_[_0x5f7a('0x5b')](_0xcfe7ab))_0x3b3b5b[_0x5f7a('0x8e')]=null;else _0x3b3b5b['ItemTypeId']=_0xcfe7ab['id'];_0x2f60eb(_0x3b3b5b);});}});}exports[_0x5f7a('0x97')]=function(_0x2244f8,_0x1fdaab){return db[_0x5f7a('0x4e')]['findAll']({'raw':!![],'where':{'CmContactId':_0x2244f8[_0x5f7a('0x27')]['id'],'ItemClass':_0x5f7a('0x92')},'include':[{'model':db[_0x5f7a('0x6d')],'as':_0x5f7a('0x6e')}],'order':[['OrderBy'],[db[_0x5f7a('0x6f')]['literal'](_0x5f7a('0x93'))]]})['then'](function(_0x441565){return _0x441565;})[_0x5f7a('0x18')](respondWithResult(_0x1fdaab,null))[_0x5f7a('0x59')](handleError(_0x1fdaab,null));};exports[_0x5f7a('0x98')]=function(_0x441fcf,_0x35dded){return db[_0x5f7a('0x4e')][_0x5f7a('0x3b')]({'raw':!![],'where':{'CmContactId':_0x441fcf['body'][_0x5f7a('0x99')]}})['then'](function(_0x2d680c){var _0x4fcd23=_['map'](_0x2d680c,function(_0x5868ad){_0x5868ad[_0x5f7a('0x9a')]=_0x441fcf['body'][_0x5f7a('0x9b')];return _0x5868ad;});return db[_0x5f7a('0x4e')][_0x5f7a('0x60')](_0x4fcd23,{});})['then'](function(){return addCmHopperPhones(_0x441fcf[_0x5f7a('0x3a')][_0x5f7a('0x9b')]);})[_0x5f7a('0x18')](function(){return['ok'];})[_0x5f7a('0x18')](respondWithResult(_0x35dded,null))['catch'](handleError(_0x35dded,null));};exports['rescheduleAdditionalPhones']=function(_0x472cca,_0x46ed39){var _0x17bd6f=[];_0x17bd6f[_0x5f7a('0x67')](createCmHopperPhone(_0x472cca[_0x5f7a('0x3a')]['id'],_0x472cca[_0x5f7a('0x3a')]['hopperId']));Promise[_0x5f7a('0x68')](_0x17bd6f)[_0x5f7a('0x18')](function(){return[0x1];})[_0x5f7a('0x18')](respondWithResult(_0x46ed39,null));};exports[_0x5f7a('0x9c')]=function(_0x247fd2,_0x5d070c){var _0x5b6dcc={'raw':![],'where':{}};var _0x5cc09c={};var _0x3715b1={'count':0x0,'rows':[]};return db[_0x5f7a('0x25')][_0x5f7a('0x7e')]({'where':{'id':_0x247fd2[_0x5f7a('0x27')]['id']}})[_0x5f7a('0x18')](handleEntityNotFound(_0x5d070c,null))[_0x5f7a('0x18')](function(_0x222490){if(_0x222490){_0x5cc09c[_0x5f7a('0x82')]=_[_0x5f7a('0x29')](db[_0x5f7a('0x40')][_0x5f7a('0x7f')]);_0x5cc09c['query']=_[_0x5f7a('0x29')](_0x247fd2[_0x5f7a('0x23')]);_0x5cc09c['filters']=_[_0x5f7a('0x81')](_0x5cc09c[_0x5f7a('0x82')],_0x5cc09c['query']);_0x5b6dcc['attributes']=_[_0x5f7a('0x81')](_0x5cc09c[_0x5f7a('0x82')],qs[_0x5f7a('0x84')](_0x247fd2[_0x5f7a('0x23')][_0x5f7a('0x84')]));_0x5b6dcc[_0x5f7a('0x83')]=_0x5b6dcc[_0x5f7a('0x83')][_0x5f7a('0x30')]?_0x5b6dcc[_0x5f7a('0x83')]:_0x5cc09c['model'];if(!_0x247fd2[_0x5f7a('0x23')][_0x5f7a('0x38')](_0x5f7a('0x9d'))){_0x5b6dcc[_0x5f7a('0x14')]=qs[_0x5f7a('0x14')](_0x247fd2[_0x5f7a('0x23')][_0x5f7a('0x14')]);_0x5b6dcc[_0x5f7a('0x12')]=qs[_0x5f7a('0x12')](_0x247fd2[_0x5f7a('0x23')][_0x5f7a('0x12')]);}_0x5b6dcc['order']=qs[_0x5f7a('0x86')](_0x247fd2['query']['sort']);_0x5b6dcc[_0x5f7a('0x63')]=qs[_0x5f7a('0x80')](_[_0x5f7a('0x87')](_0x247fd2['query'],_0x5cc09c[_0x5f7a('0x80')]));_0x5b6dcc['where'][_0x5f7a('0x9e')]=_0x222490['id'];if(_0x247fd2[_0x5f7a('0x23')][_0x5f7a('0x9f')]){_0x5b6dcc[_0x5f7a('0x63')]=_[_0x5f7a('0x39')](_0x5b6dcc[_0x5f7a('0x63')],{'$or':_[_0x5f7a('0x74')](_0x5b6dcc[_0x5f7a('0x83')],function(_0x518648){var _0x3d98a8={};_0x3d98a8[_0x518648]={'$like':'%'+_0x247fd2[_0x5f7a('0x23')][_0x5f7a('0x9f')]+'%'};return _0x3d98a8;})});}_0x5b6dcc=_[_0x5f7a('0x39')]({},_0x5b6dcc,_0x247fd2[_0x5f7a('0x88')]);return db[_0x5f7a('0x40')][_0x5f7a('0x15')]({'where':_0x5b6dcc[_0x5f7a('0x63')]})[_0x5f7a('0x18')](function(_0x46f03a){_0x3715b1[_0x5f7a('0x15')]=_0x46f03a;if(_0x247fd2[_0x5f7a('0x23')][_0x5f7a('0xa0')]){_0x5b6dcc['include']=[{'all':!![]}];}return db['CmHopper'][_0x5f7a('0x3b')](_0x5b6dcc);})['then'](function(_0x2d8238){_0x3715b1['rows']=_0x2d8238;return _0x3715b1;});}})['then'](respondWithFilteredResult(_0x5d070c,_0x5b6dcc))[_0x5f7a('0x59')](handleError(_0x5d070c,null));};exports[_0x5f7a('0xa1')]=function(_0x5c73f3,_0xd1bd54){var _0x44df0d={'raw':!![],'where':{}};var _0x51325a={};var _0x100965={'count':0x0,'rows':[]};return db[_0x5f7a('0x25')]['findOne']({'where':{'id':_0x5c73f3[_0x5f7a('0x27')]['id']}})[_0x5f7a('0x18')](handleEntityNotFound(_0xd1bd54,null))[_0x5f7a('0x18')](function(_0x4890de){if(_0x4890de){_0x51325a[_0x5f7a('0x82')]=_[_0x5f7a('0x29')](db['CmHopperHistory'][_0x5f7a('0x7f')]);_0x51325a[_0x5f7a('0x23')]=_['keys'](_0x5c73f3['query']);_0x51325a[_0x5f7a('0x80')]=_[_0x5f7a('0x81')](_0x51325a[_0x5f7a('0x82')],_0x51325a[_0x5f7a('0x23')]);_0x44df0d[_0x5f7a('0x83')]=_[_0x5f7a('0x81')](_0x51325a['model'],qs[_0x5f7a('0x84')](_0x5c73f3[_0x5f7a('0x23')][_0x5f7a('0x84')]));_0x44df0d[_0x5f7a('0x83')]=_0x44df0d[_0x5f7a('0x83')][_0x5f7a('0x30')]?_0x44df0d[_0x5f7a('0x83')]:_0x51325a[_0x5f7a('0x82')];if(!_0x5c73f3[_0x5f7a('0x23')][_0x5f7a('0x38')](_0x5f7a('0x9d'))){_0x44df0d[_0x5f7a('0x14')]=qs[_0x5f7a('0x14')](_0x5c73f3['query'][_0x5f7a('0x14')]);_0x44df0d[_0x5f7a('0x12')]=qs[_0x5f7a('0x12')](_0x5c73f3[_0x5f7a('0x23')][_0x5f7a('0x12')]);}_0x44df0d[_0x5f7a('0x85')]=qs[_0x5f7a('0x86')](_0x5c73f3[_0x5f7a('0x23')]['sort']);_0x44df0d['where']=qs[_0x5f7a('0x80')](_[_0x5f7a('0x87')](_0x5c73f3[_0x5f7a('0x23')],_0x51325a[_0x5f7a('0x80')]));_0x44df0d[_0x5f7a('0x63')][_0x5f7a('0x9e')]=_0x4890de['id'];if(_0x5c73f3['query'][_0x5f7a('0x9f')]){_0x44df0d['where']=_[_0x5f7a('0x39')](_0x44df0d[_0x5f7a('0x63')],{'$or':_[_0x5f7a('0x74')](_0x44df0d[_0x5f7a('0x83')],function(_0x5e9856){var _0x1b4be5={};_0x1b4be5[_0x5e9856]={'$like':'%'+_0x5c73f3['query']['filter']+'%'};return _0x1b4be5;})});}_0x44df0d=_[_0x5f7a('0x39')]({},_0x44df0d,_0x5c73f3[_0x5f7a('0x88')]);return db['CmHopperHistory'][_0x5f7a('0x15')]({'where':_0x44df0d[_0x5f7a('0x63')]})['then'](function(_0x51011e){_0x100965['count']=_0x51011e;if(_0x5c73f3[_0x5f7a('0x23')][_0x5f7a('0xa0')]){_0x44df0d[_0x5f7a('0xa2')]=[{'all':!![]}];}return db[_0x5f7a('0x50')]['findAll'](_0x44df0d);})['then'](function(_0x4fd742){_0x100965[_0x5f7a('0xa3')]=_0x4fd742;return _0x100965;});}})['then'](respondWithFilteredResult(_0xd1bd54,_0x44df0d))[_0x5f7a('0x59')](handleError(_0xd1bd54,null));};exports['getHopperFinals']=function(_0x2b791f,_0x4e4a4a){var _0x26eb9e={'raw':!![],'where':{}};var _0x1ee2e8={};var _0x14a215={'count':0x0,'rows':[]};return db[_0x5f7a('0x25')][_0x5f7a('0x7e')]({'where':{'id':_0x2b791f[_0x5f7a('0x27')]['id']}})[_0x5f7a('0x18')](handleEntityNotFound(_0x4e4a4a,null))[_0x5f7a('0x18')](function(_0x51b95c){if(_0x51b95c){_0x1ee2e8[_0x5f7a('0x82')]=_[_0x5f7a('0x29')](db[_0x5f7a('0x4f')][_0x5f7a('0x7f')]);_0x1ee2e8[_0x5f7a('0x23')]=_[_0x5f7a('0x29')](_0x2b791f[_0x5f7a('0x23')]);_0x1ee2e8[_0x5f7a('0x80')]=_['intersection'](_0x1ee2e8[_0x5f7a('0x82')],_0x1ee2e8['query']);_0x26eb9e[_0x5f7a('0x83')]=_['intersection'](_0x1ee2e8['model'],qs[_0x5f7a('0x84')](_0x2b791f[_0x5f7a('0x23')][_0x5f7a('0x84')]));_0x26eb9e[_0x5f7a('0x83')]=_0x26eb9e['attributes'][_0x5f7a('0x30')]?_0x26eb9e['attributes']:_0x1ee2e8['model'];if(!_0x2b791f[_0x5f7a('0x23')]['hasOwnProperty'](_0x5f7a('0x9d'))){_0x26eb9e['limit']=qs[_0x5f7a('0x14')](_0x2b791f['query']['limit']);_0x26eb9e[_0x5f7a('0x12')]=qs[_0x5f7a('0x12')](_0x2b791f[_0x5f7a('0x23')][_0x5f7a('0x12')]);}_0x26eb9e[_0x5f7a('0x85')]=qs[_0x5f7a('0x86')](_0x2b791f['query']['sort']);_0x26eb9e[_0x5f7a('0x63')]=qs[_0x5f7a('0x80')](_['pick'](_0x2b791f[_0x5f7a('0x23')],_0x1ee2e8['filters']));_0x26eb9e[_0x5f7a('0x63')][_0x5f7a('0x9e')]=_0x51b95c['id'];if(_0x2b791f['query'][_0x5f7a('0x9f')]){_0x26eb9e['where']=_['merge'](_0x26eb9e[_0x5f7a('0x63')],{'$or':_['map'](_0x26eb9e[_0x5f7a('0x83')],function(_0x436e86){var _0x10ffed={};_0x10ffed[_0x436e86]={'$like':'%'+_0x2b791f[_0x5f7a('0x23')][_0x5f7a('0x9f')]+'%'};return _0x10ffed;})});}_0x26eb9e=_[_0x5f7a('0x39')]({},_0x26eb9e,_0x2b791f[_0x5f7a('0x88')]);return db[_0x5f7a('0x4f')][_0x5f7a('0x15')]({'where':_0x26eb9e['where']})[_0x5f7a('0x18')](function(_0x45838e){_0x14a215[_0x5f7a('0x15')]=_0x45838e;if(_0x2b791f[_0x5f7a('0x23')][_0x5f7a('0xa0')]){_0x26eb9e[_0x5f7a('0xa2')]=[{'all':!![]}];}return db[_0x5f7a('0x4f')][_0x5f7a('0x3b')](_0x26eb9e);})['then'](function(_0x4f65a5){_0x14a215['rows']=_0x4f65a5;return _0x14a215;});}})[_0x5f7a('0x18')](respondWithFilteredResult(_0x4e4a4a,_0x26eb9e))[_0x5f7a('0x59')](handleError(_0x4e4a4a,null));};exports[_0x5f7a('0xa4')]=function(_0x329085,_0x2fd2b2){var _0x526769={'raw':!![],'where':{}};var _0x5d5185={};var _0x136942={'count':0x0,'rows':[]};return db['CmContact'][_0x5f7a('0x7e')]({'where':{'id':_0x329085[_0x5f7a('0x27')]['id']}})[_0x5f7a('0x18')](handleEntityNotFound(_0x2fd2b2,null))[_0x5f7a('0x18')](function(_0xe06987){if(_0xe06987){_0x5d5185[_0x5f7a('0x82')]=_[_0x5f7a('0x29')](db['JscriptySessionReport']['rawAttributes']);_0x5d5185[_0x5f7a('0x23')]=_[_0x5f7a('0x29')](_0x329085['query']);_0x5d5185[_0x5f7a('0x80')]=_['intersection'](_0x5d5185['model'],_0x5d5185['query']);_0x526769[_0x5f7a('0x83')]=_['intersection'](_0x5d5185['model'],qs[_0x5f7a('0x84')](_0x329085[_0x5f7a('0x23')][_0x5f7a('0x84')]));_0x526769[_0x5f7a('0x83')]=_0x526769[_0x5f7a('0x83')]['length']?_0x526769[_0x5f7a('0x83')]:_0x5d5185[_0x5f7a('0x82')];if(!_0x329085[_0x5f7a('0x23')][_0x5f7a('0x38')](_0x5f7a('0x9d'))){_0x526769[_0x5f7a('0x14')]=qs['limit'](_0x329085[_0x5f7a('0x23')][_0x5f7a('0x14')]);_0x526769['offset']=qs['offset'](_0x329085[_0x5f7a('0x23')][_0x5f7a('0x12')]);}_0x526769[_0x5f7a('0x85')]=qs[_0x5f7a('0x86')](_0x329085['query']['sort']);_0x526769[_0x5f7a('0x63')]=qs[_0x5f7a('0x80')](_[_0x5f7a('0x87')](_0x329085['query'],_0x5d5185['filters']));_0x526769[_0x5f7a('0x63')][_0x5f7a('0x9e')]=_0xe06987['id'];if(_0x329085[_0x5f7a('0x23')]['filter']){_0x526769['where']=_[_0x5f7a('0x39')](_0x526769['where'],{'$or':_[_0x5f7a('0x74')](_0x526769[_0x5f7a('0x83')],function(_0x1b75e9){var _0x441d23={};_0x441d23[_0x1b75e9]={'$like':'%'+_0x329085[_0x5f7a('0x23')][_0x5f7a('0x9f')]+'%'};return _0x441d23;})});}_0x526769=_['merge']({},_0x526769,_0x329085[_0x5f7a('0x88')]);return db[_0x5f7a('0x55')][_0x5f7a('0x15')]({'where':_0x526769[_0x5f7a('0x63')]})['then'](function(_0x4cd723){_0x136942[_0x5f7a('0x15')]=_0x4cd723;if(_0x329085[_0x5f7a('0x23')]['includeAll']){_0x526769[_0x5f7a('0xa2')]=[{'all':!![]}];}return db[_0x5f7a('0x55')]['findAll'](_0x526769);})[_0x5f7a('0x18')](function(_0x50cb6a){_0x136942['rows']=_0x50cb6a;return _0x136942;});}})[_0x5f7a('0x18')](respondWithFilteredResult(_0x2fd2b2,_0x526769))[_0x5f7a('0x59')](handleError(_0x2fd2b2,null));};exports[_0x5f7a('0xa5')]=function(_0x178f66,_0x48960e){try{if(!_0x178f66['body']['ListId']){throw new Error(_0x5f7a('0xa6'));}if(!_0x178f66['body'][_0x5f7a('0xa7')]){throw new Error(_0x5f7a('0xa8'));}if(!_0x178f66['body'][_0x5f7a('0xa9')]){throw new Error(_0x5f7a('0xaa'));}if(!_0x178f66['body'][_0x5f7a('0xab')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x36cf3b=_0x178f66[_0x5f7a('0x3a')]['binding_keys'][_0x5f7a('0xac')](',');var _0x644335=_0x178f66[_0x5f7a('0x3a')]['binding_values'][_0x5f7a('0xac')](',');if(!_0x36cf3b[_0x5f7a('0x30')]||!_0x644335['length']||_0x36cf3b[_0x5f7a('0x30')]!==_0x644335[_0x5f7a('0x30')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x178f66[_0x5f7a('0x3a')][_0x5f7a('0x84')]=_[_0x5f7a('0xad')](_0x36cf3b,_0x644335);if(!_0x178f66[_0x5f7a('0x3a')][_0x5f7a('0x84')][_0x5f7a('0x7c')]){throw new Error(_0x5f7a('0xae'));}if(!_0x178f66[_0x5f7a('0x3a')]['fields'][_0x5f7a('0xaf')]){throw new Error(_0x5f7a('0xb0'));}var _0x193239=path[_0x5f7a('0x5a')](config[_0x5f7a('0xb1')],_0x5f7a('0xb2'),_0x178f66[_0x5f7a('0xb3')]['filename']);fs['chmodSync'](_0x193239,parseInt(_0x5f7a('0xb4'),0x8));var _0x3f6197=require(_0x5f7a('0xb5'))[_0x5f7a('0xb6')](path[_0x5f7a('0x5a')](__dirname,_0x5f7a('0xb7')),[_0x193239,_0x178f66['body']['binding_keys'],_0x178f66['body']['binding_values'],_0x178f66[_0x5f7a('0x3a')][_0x5f7a('0x64')],_0x178f66[_0x5f7a('0x3a')][_0x5f7a('0xb8')],_0x178f66[_0x5f7a('0x3a')]['duplicates'],_0x178f66[_0x5f7a('0x3a')][_0x5f7a('0xab')]]);return _0x48960e[_0x5f7a('0x10')](0xc8)[_0x5f7a('0x11')]({'message':_0x5f7a('0xb9'),'pid':_0x3f6197[_0x5f7a('0xba')]});}catch(_0x2c4af2){return _0x48960e[_0x5f7a('0x10')](0x1f4)['send'](_0x2c4af2);}};exports[_0x5f7a('0xbb')]=function(_0x4aac67,_0x115e66){var _0xc5fb8=fs[_0x5f7a('0xbc')](_0x4aac67['file']['path']);Papa['parse'](_0xc5fb8,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x52ce14){return _0x115e66[_0x5f7a('0x10')](0xc8)[_0x5f7a('0x11')]({'file':_0x4aac67[_0x5f7a('0xb3')],'fields':_0x52ce14[_0x5f7a('0xbd')]['fields']});}});};exports[_0x5f7a('0xbe')]=function(_0x46d4d9,_0x2c1ac2){return db['User'][_0x5f7a('0x3b')]({'raw':!![],'attributes':['id'],'where':{'role':_0x5f7a('0xbf')}})['then'](function(_0x5ee561){var _0x2251ce=![];if(!_0x46d4d9[_0x5f7a('0x3a')]['ListId']){throw new Error(_0x5f7a('0xa6'));}if(!_0x46d4d9[_0x5f7a('0x3a')][_0x5f7a('0xc0')][_0x5f7a('0x7c')]){throw new Error(_0x5f7a('0xae'));}if(!_0x46d4d9[_0x5f7a('0x3a')][_0x5f7a('0xc0')][_0x5f7a('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x46d4d9[_0x5f7a('0x3a')][_0x5f7a('0xab')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x3e464b=require(_0x5f7a('0xb5'))['fork'](path[_0x5f7a('0x5a')](__dirname,_0x5f7a('0xc1')),[_0x46d4d9[_0x5f7a('0x27')]['id'],JSON[_0x5f7a('0xc2')](_0x46d4d9[_0x5f7a('0x3a')]),JSON['stringify'](_0x5ee561)]);_0x3e464b['on']('message',function(){_0x2251ce=!![];return _0x2c1ac2[_0x5f7a('0x10')](0xc8)[_0x5f7a('0x11')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x3e464b[_0x5f7a('0xba')]});});_0x3e464b['on'](_0x5f7a('0xc3'),function(_0x39f9a6){if(_0x39f9a6&&!_0x2251ce){return _0x2c1ac2['status'](0x1f4)[_0x5f7a('0x11')]({'message':'error\x20child\x20process','pid':_0x3e464b[_0x5f7a('0xba')]});}});})[_0x5f7a('0x59')](handleError(_0x2c1ac2,null));};exports[_0x5f7a('0xc4')]=function(_0x58275b,_0x40d407){return db[_0x5f7a('0xc5')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x5f7a('0x18')](function(_0x488697){var _0x514758=![];if(!_0x58275b['body'][_0x5f7a('0x64')]){throw new Error(_0x5f7a('0xa6'));}if(!_0x58275b[_0x5f7a('0x3a')]['binding'][_0x5f7a('0x7c')]){throw new Error(_0x5f7a('0xae'));}if(!_0x58275b[_0x5f7a('0x3a')][_0x5f7a('0xc0')][_0x5f7a('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x58275b['body'][_0x5f7a('0xab')]){throw new Error(_0x5f7a('0xc6'));}var _0xfc098f=require(_0x5f7a('0xb5'))[_0x5f7a('0xb6')](path['join'](__dirname,_0x5f7a('0xc7')),[_0x58275b[_0x5f7a('0x27')]['id'],JSON[_0x5f7a('0xc2')](_0x58275b[_0x5f7a('0x3a')]),JSON[_0x5f7a('0xc2')](_0x488697)]);_0xfc098f['on']('message',function(){_0x514758=!![];return _0x40d407[_0x5f7a('0x10')](0xc8)[_0x5f7a('0x11')]({'message':_0x5f7a('0xc8'),'pid':_0xfc098f[_0x5f7a('0xba')]});});_0xfc098f['on']('exit',function(_0x58596f){if(_0x58596f&&!_0x514758){return _0x40d407[_0x5f7a('0x10')](0x1f4)['json']({'message':_0x5f7a('0xc9'),'pid':_0xfc098f[_0x5f7a('0xba')]});}});})[_0x5f7a('0x59')](handleError(_0x40d407,null));};exports[_0x5f7a('0xca')]=function(_0xb0beea,_0xef1479){var _0x3ccd80=[_0x5f7a('0xcb'),_0x5f7a('0xcc'),_0x5f7a('0xcd'),_0x5f7a('0xce'),'fax',_0x5f7a('0xcf'),_0x5f7a('0xd0')];var _0x44bf38={'offset':0x0,'order':qs[_0x5f7a('0x86')](_0x5f7a('0xd1'))},_0x23e11d={'count':0x0,'rows':[]};Promise[_0x5f7a('0xd2')]()[_0x5f7a('0x18')](function(){if(_0xb0beea[_0x5f7a('0x23')][_0x5f7a('0xd3')]){if(!_['includes'](_0x3ccd80,_0xb0beea[_0x5f7a('0x23')][_0x5f7a('0xd3')][_0x5f7a('0xd4')]())){throw new Error('Invalid\x20channel');}_0x3ccd80=[_0xb0beea['query']['channel'][_0x5f7a('0xd4')]()];}if(_0xb0beea['query'][_0x5f7a('0xd5')]){try{var _0x315a58=JSON[_0x5f7a('0xd6')](_0xb0beea[_0x5f7a('0x23')][_0x5f7a('0xd5')]);if(!moment(_0x315a58[_0x5f7a('0x3c')])[_0x5f7a('0xd7')]()){throw new Error(_0x5f7a('0xd8'));}if(!moment(_0x315a58['to'])[_0x5f7a('0xd7')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0xd3a936){throw new Error(_0x5f7a('0xd9'));}}if(!_0xb0beea[_0x5f7a('0x23')][_0x5f7a('0x38')](_0x5f7a('0x9d'))){_0x44bf38[_0x5f7a('0x14')]=qs['limit'](_0xb0beea[_0x5f7a('0x23')][_0x5f7a('0x14')]||0xa);_0x44bf38[_0x5f7a('0x12')]=qs[_0x5f7a('0x12')](_0xb0beea[_0x5f7a('0x23')][_0x5f7a('0x12')]);}var _0x8833a4=_0x3ccd80[_0x5f7a('0x74')](function(_0x41bf2b){if(_0x41bf2b===_0x5f7a('0xd0')){var _0x328dfa={'attributes':['id',_0x5f7a('0xda'),_0x5f7a('0x33'),_0x5f7a('0xdb'),_0x5f7a('0xdc'),_0x5f7a('0xdd'),'starttime','endtime','duration',_0x5f7a('0xde'),'createdAt','userDisposition',_0x5f7a('0xdf'),_0x5f7a('0xe0'),_0x5f7a('0xe1')],'where':{'ContactId':_0xb0beea[_0x5f7a('0x27')]['id']},'include':[{'model':db[_0x5f7a('0xc5')],'as':_0x5f7a('0xc5'),'attributes':['id',_0x5f7a('0x1e'),_0x5f7a('0xe2'),'alias']}],'order':[[_0x5f7a('0xe3'),'DESC']]};if(_0xb0beea['query'][_0x5f7a('0xd5')]){_0x328dfa[_0x5f7a('0x63')][_0x5f7a('0xe3')]={'$gte':_0x315a58[_0x5f7a('0x3c')],'$lte':_0x315a58['to']};}return db[_0x5f7a('0x51')][_0x5f7a('0xe4')](_0x328dfa)[_0x5f7a('0x18')](function(_0x1d88d5){_0x23e11d['count']+=_0x1d88d5[_0x5f7a('0x15')];return _['map'](_0x1d88d5['rows'],function(_0x595d76){var _0x5a177a=_0x595d76['get']({'plain':!![]});_0x5a177a[_0x5f7a('0xd3')]=_0x41bf2b;if(_0x5a177a['User']){_0x5a177a[_0x5f7a('0xc5')]={'id':_0x5a177a[_0x5f7a('0xc5')]['id'],'name':_0x5a177a[_0x5f7a('0xc5')][_0x5f7a('0x1e')],'fullname':_0x5a177a[_0x5f7a('0xc5')][_0x5f7a('0xe2')],'alias':_0x5a177a['User']['alias']};}return _0x5a177a;});});}else{var _0x3dae67=_[_0x5f7a('0xe5')](_0x41bf2b)+(_0x41bf2b===_0x5f7a('0xcc')?_0x5f7a('0xe6'):_0x5f7a('0xe7'));var _0xa5a607={'attributes':['id',_0x5f7a('0xe8'),_0x5f7a('0xe9'),_0x5f7a('0xe3'),_0x5f7a('0xde'),_0x5f7a('0xea'),_0x5f7a('0xeb'),_0x5f7a('0xec'),_0x5f7a('0xe1'),_0x3dae67+'Id'],'where':{'ContactId':_0xb0beea['params']['id']},'include':[{'model':db[_0x3dae67],'as':_0x5f7a('0xe7'),'attributes':['id',_0x5f7a('0x1e'),_0x5f7a('0xed')]},{'model':db[_0x5f7a('0xc5')],'as':_0x5f7a('0xee'),'attributes':['id',_0x5f7a('0x1e'),'fullname']},{'model':db[_0x5f7a('0x69')],'as':_0x5f7a('0x6a'),'attributes':['id',_0x5f7a('0x1e'),_0x5f7a('0x6b')],'through':{'attributes':[]}}],'order':[[_0x5f7a('0xe3'),_0x5f7a('0xef')]]};if(_0xb0beea['query']['range']){_0xa5a607['where'][_0x5f7a('0xe3')]={'$gte':_0x315a58[_0x5f7a('0x3c')],'$lte':_0x315a58['to']};}switch(_0x41bf2b){case _0x5f7a('0xcc'):_0xa5a607[_0x5f7a('0x83')][_0x5f7a('0x67')](_0x5f7a('0xf0'),_0x5f7a('0xf1'),_0x5f7a('0xf2'),_0x5f7a('0xf3'),'osName','ratingMessage',_0x5f7a('0xf4'),_0x5f7a('0xf5'),_0x5f7a('0xf6'));break;case _0x5f7a('0xcb'):_0xa5a607['attributes'][_0x5f7a('0x67')](_0x5f7a('0xf7'),'substatus');break;case'openchannel':_0xa5a607[_0x5f7a('0x83')]['push']('externalUrl','threadId');break;}return db[_['startCase'](_0x41bf2b)+_0x5f7a('0xf8')][_0x5f7a('0xe4')](_0xa5a607)[_0x5f7a('0x18')](function(_0x3f8976){_0x23e11d[_0x5f7a('0x15')]+=_0x3f8976[_0x5f7a('0x15')];return _[_0x5f7a('0x74')](_0x3f8976[_0x5f7a('0xa3')],function(_0x3ae633){var _0x2b0c83=_0x3ae633[_0x5f7a('0x3d')]({'plain':!![]});_0x2b0c83[_0x5f7a('0xd3')]=_0x41bf2b;if(_0x2b0c83[_0x5f7a('0xee')]){_0x2b0c83[_0x5f7a('0xee')]={'id':_0x2b0c83[_0x5f7a('0xee')]['id'],'name':_0x2b0c83[_0x5f7a('0xee')][_0x5f7a('0x1e')],'fullname':_0x2b0c83['Owner'][_0x5f7a('0xe2')]};}return _0x2b0c83;});});}});return Promise['all'](_0x8833a4);})[_0x5f7a('0x18')](function(_0xaf5345){return _(_0xaf5345)['flatten']()['sortBy'](_0x5f7a('0xe3'))[_0x5f7a('0xf9')]()[_0x5f7a('0xfa')]();})[_0x5f7a('0x18')](function(_0x18747d){_0x23e11d[_0x5f7a('0xa3')]=_0x44bf38['limit']?_0x18747d[_0x5f7a('0xfb')](_0x44bf38[_0x5f7a('0x12')],_0x44bf38['offset']+_0x44bf38[_0x5f7a('0x14')]):_0x18747d;return _0x23e11d;})[_0x5f7a('0x18')](respondWithFilteredResult(_0xef1479,_0x44bf38))[_0x5f7a('0x59')](handleError(_0xef1479,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 5ee9104..6160adb 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c28=['CmContact','setMaxListeners','save','remove','emit','exports','events','../../mysqldb'];(function(_0x37bb50,_0x307c14){var _0x183cc4=function(_0x2baf80){while(--_0x2baf80){_0x37bb50['push'](_0x37bb50['shift']());}};_0x183cc4(++_0x307c14);}(_0x8c28,0x106));var _0x88c2=function(_0x34900,_0x2c3e4e){_0x34900=_0x34900-0x0;var _0x1a4d59=_0x8c28[_0x34900];return _0x1a4d59;};'use strict';var EventEmitter=require(_0x88c2('0x0'));var CmContact=require(_0x88c2('0x1'))['db'][_0x88c2('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x88c2('0x3')](0x0);var events={'afterCreate':_0x88c2('0x4'),'afterUpdate':'update','afterDestroy':_0x88c2('0x5')};function emitEvent(_0x37ec90){return function(_0x2548ba,_0x4a727c,_0x3e20e5){CmContactEvents[_0x88c2('0x6')](_0x37ec90+':'+_0x2548ba['id'],_0x2548ba);CmContactEvents[_0x88c2('0x6')](_0x37ec90,_0x2548ba);_0x3e20e5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x88c2('0x7')]=CmContactEvents; \ No newline at end of file +var _0x6dfb=['events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xbf09eb,_0x1c2276){var _0x31e8af=function(_0x23b600){while(--_0x23b600){_0xbf09eb['push'](_0xbf09eb['shift']());}};_0x31e8af(++_0x1c2276);}(_0x6dfb,0x99));var _0xb6df=function(_0x289ded,_0x422ee8){_0x289ded=_0x289ded-0x0;var _0x4509f3=_0x6dfb[_0x289ded];return _0x4509f3;};'use strict';var EventEmitter=require(_0xb6df('0x0'));var CmContact=require(_0xb6df('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xb6df('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb6df('0x3'),'afterDestroy':_0xb6df('0x4')};function emitEvent(_0x2045db){return function(_0x2b6e43,_0x2931c2,_0x138baa){CmContactEvents[_0xb6df('0x5')](_0x2045db+':'+_0x2b6e43['id'],_0x2b6e43);CmContactEvents[_0xb6df('0x5')](_0x2045db,_0x2b6e43);_0x138baa(null);};}for(var e in events){if(events[_0xb6df('0x6')](e)){var event=events[e];CmContact[_0xb6df('0x7')](e,emitEvent(event));}}module[_0xb6df('0x8')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 0f81ef2..5c32f9d 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc8d5=['YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','CmHopperFinal','cmContact,\x20afterCreate,\x20','create','error','Campaign','add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','dialCheckDuplicateType','length','always','onlyIfOpen','outbound','CmList','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Lists','BlackLists','List\x20not\x20found','destroy','ContactId','VoiceQueueId','CampaignId','push','all','[CmContact][afterDestroy][Succesfull]','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','cm_contacts','phone','fti_cm_contacts','firstName','mobile','email','FULLTEXT','utf8mb4_unicode_ci','get','cmContact','afterCreate','inspect','scheduledat','isNil','VoiceQueue','findOne','then','dialTimezone','timezones','utcOffset','minutes','format','ret','CmHopper','cmContact,\x20afterCreate\x20','ListId','priority'];(function(_0x2de0ae,_0x2eaf39){var _0x51059a=function(_0x4235e6){while(--_0x4235e6){_0x2de0ae['push'](_0x2de0ae['shift']());}};_0x51059a(++_0x2eaf39);}(_0xc8d5,0x17d));var _0x5c8d=function(_0x56e632,_0xe99421){_0x56e632=_0x56e632-0x0;var _0x2a710e=_0xc8d5[_0x56e632];return _0x2a710e;};'use strict';var _=require(_0x5c8d('0x0'));var util=require(_0x5c8d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5c8d('0x2'));var BPromise=require(_0x5c8d('0x3'));var rp=require(_0x5c8d('0x4'));var fs=require('fs');var path=require(_0x5c8d('0x5'));var rimraf=require(_0x5c8d('0x6'));var config=require(_0x5c8d('0x7'));var shared=require(_0x5c8d('0x8'));var attributes=require(_0x5c8d('0x9'));module[_0x5c8d('0xa')]=function(_0x4bb13a,_0x339c29){return _0x4bb13a[_0x5c8d('0xb')]('CmContact',attributes,{'tableName':_0x5c8d('0xc'),'paranoid':!![],'indexes':[{'name':_0x5c8d('0xd'),'fields':[_0x5c8d('0xd')]},{'name':_0x5c8d('0xe'),'fields':[_0x5c8d('0xf'),'lastName',_0x5c8d('0xd'),_0x5c8d('0x10'),'fax',_0x5c8d('0x11')],'type':_0x5c8d('0x12')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x5c8d('0x13'),'hooks':{'afterCreate':function(_0x37d735,_0x524ff3,_0x4b9a76){var _0x1a0854=_0x4bb13a['models'];var _0x1cba4c=_0x37d735[_0x5c8d('0x14')]({'plain':!![]});function _0x3c1c67(){return function(_0x1ea42f){logger['error'](_0x5c8d('0x15'),_0x5c8d('0x16'),util[_0x5c8d('0x17')](_0x1ea42f,{'showHidden':![],'depth':null}));};}function _0x47e2c7(_0x153a4b,_0x4c94eb){var _0x143844=_0x4c94eb[_0x5c8d('0x18')]?_0x4c94eb[_0x5c8d('0x18')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x5a4f73,_0xc7c9ef){if(_[_0x5c8d('0x19')](_0x4c94eb['dialTimezone'])){_0x5a4f73({'ret':_0x143844});}else{_0x1a0854[_0x5c8d('0x1a')][_0x5c8d('0x1b')]({'where':{'id':_0x153a4b['id']}})[_0x5c8d('0x1c')](function(_0x1ba1a2){if(!_['isNil'](_0x1ba1a2)){var _0x355c80=_0x1ba1a2[_0x5c8d('0x1d')];if(!_[_0x5c8d('0x19')](_0x355c80)){var _0x16df60=shared[_0x5c8d('0x1e')];var _0x194a0f=_0x16df60[_0x355c80];var _0x264cc3=_0x16df60[_0x4c94eb['dialTimezone']];if(!_[_0x5c8d('0x19')](_0x194a0f)&&!_[_0x5c8d('0x19')](_0x264cc3)){var _0x2b6145=_0x194a0f[_0x5c8d('0x1f')]-_0x264cc3[_0x5c8d('0x1f')];_0x143844=_0x4c94eb[_0x5c8d('0x18')]?_0x4c94eb[_0x5c8d('0x18')]:moment();var _0x355ace=moment(_0x143844)['add'](_0x2b6145,_0x5c8d('0x20'));_0x5a4f73({'ret':_0x355ace[_0x5c8d('0x21')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x5a4f73({'ret':_0x143844});}else _0x5a4f73({'ret':_0x143844});}else{_0x5a4f73({'ret':_0x143844});}});}});return 0xa;}var _0x49e2e8=function(_0x54eca4){return new BPromise(function(_0x52b452,_0x5e175f){_0x47e2c7(_0x54eca4,_0x1cba4c)['then'](function(_0x4d483c){_0x1cba4c[_0x5c8d('0x18')]=_0x4d483c[_0x5c8d('0x22')];_0x1a0854[_0x5c8d('0x23')][_0x5c8d('0x1b')]({'where':{'phone':_0x1cba4c[_0x5c8d('0xd')],'VoiceQueueId':_0x54eca4['id']}})[_0x5c8d('0x1c')](function(_0x303aa9){if(!_[_0x5c8d('0x19')](_0x303aa9)){throw new Error(_0x5c8d('0x24')+_0x1cba4c[_0x5c8d('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x54eca4['id']);}return _0x1a0854[_0x5c8d('0x23')]['create']({'phone':_0x1cba4c['phone'],'ContactId':_0x1cba4c['id'],'ListId':_0x1cba4c[_0x5c8d('0x25')],'priority':_0x1cba4c[_0x5c8d('0x26')]?_0x1cba4c[_0x5c8d('0x26')]:0x2,'scheduledat':_0x1cba4c[_0x5c8d('0x18')]?_0x1cba4c[_0x5c8d('0x18')]:moment()[_0x5c8d('0x21')](_0x5c8d('0x27')),'callback':_0x1cba4c[_0x5c8d('0x28')]?!![]:![],'callbackuniqueid':_0x1cba4c[_0x5c8d('0x28')]?_0x1cba4c['callbackUniqueid']:undefined,'callbackat':_0x1cba4c[_0x5c8d('0x28')]?moment()[_0x5c8d('0x21')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x54eca4['id']});})[_0x5c8d('0x29')](function(_0x56c25d){_0x5e175f(_0x56c25d);});});});};var _0x2c4b42=function(_0x280f2f){return new BPromise(function(_0x176d1e,_0x544ced){_0x47e2c7(_0x280f2f,_0x1cba4c)['then'](function(_0xea936b){_0x1cba4c[_0x5c8d('0x18')]=_0xea936b[_0x5c8d('0x22')];_0x1a0854[_0x5c8d('0x23')][_0x5c8d('0x1b')]({'where':{'phone':_0x1cba4c['phone'],'VoiceQueueId':_0x280f2f['id']}})[_0x5c8d('0x1c')](function(_0x121b09){if(!_[_0x5c8d('0x19')](_0x121b09)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1cba4c[_0x5c8d('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x280f2f['id']);}return _0x1a0854[_0x5c8d('0x2a')][_0x5c8d('0x1b')]({'where':{'calleridnum':_0x1cba4c['phone'],'VoiceQueueId':_0x280f2f['id']}});})[_0x5c8d('0x1c')](function(_0x34af18){if(!_[_0x5c8d('0x19')](_0x34af18)){throw new Error(_0x5c8d('0x2b')+_0x1cba4c['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x280f2f['id']);}return _0x1a0854['CmHopper'][_0x5c8d('0x2c')]({'phone':_0x1cba4c[_0x5c8d('0xd')],'ContactId':_0x1cba4c['id'],'ListId':_0x1cba4c['ListId'],'priority':_0x1cba4c[_0x5c8d('0x26')]?_0x1cba4c['priority']:0x2,'scheduledat':_0x1cba4c[_0x5c8d('0x18')]?_0x1cba4c['scheduledat']:moment()[_0x5c8d('0x21')](_0x5c8d('0x27')),'callback':_0x1cba4c[_0x5c8d('0x28')]?!![]:![],'callbackuniqueid':_0x1cba4c[_0x5c8d('0x28')]?_0x1cba4c[_0x5c8d('0x28')]:undefined,'callbackat':_0x1cba4c[_0x5c8d('0x28')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x280f2f['id']});})[_0x5c8d('0x29')](function(_0x1c856f){_0x544ced(_0x1c856f);});});});};function _0x41e59b(){return function(_0x136971){logger[_0x5c8d('0x2d')](_0x5c8d('0x15'),_0x5c8d('0x16'),util[_0x5c8d('0x17')](_0x136971,{'showHidden':![],'depth':null}));};}function _0x5e465d(_0x5dd084,_0x5552dd){var _0x508540=_0x5552dd[_0x5c8d('0x18')]?_0x5552dd[_0x5c8d('0x18')]:moment()[_0x5c8d('0x21')](_0x5c8d('0x27'));return new BPromise(function(_0x1732af,_0x444c50){if(_[_0x5c8d('0x19')](_0x5552dd[_0x5c8d('0x1d')])){_0x1732af({'ret':_0x508540});}else{_0x1a0854[_0x5c8d('0x2e')][_0x5c8d('0x1b')]({'where':{'id':_0x5dd084['id']}})[_0x5c8d('0x1c')](function(_0x4540cf){if(!_[_0x5c8d('0x19')](_0x4540cf)){var _0xbe0c37=_0x4540cf[_0x5c8d('0x1d')];if(!_['isNil'](_0xbe0c37)){var _0x4781cf=shared[_0x5c8d('0x1e')];var _0xb04cc8=_0x4781cf[_0xbe0c37];var _0x30dd27=_0x4781cf[_0x5552dd[_0x5c8d('0x1d')]];if(!_['isNil'](_0xb04cc8)&&!_[_0x5c8d('0x19')](_0x30dd27)){var _0x5b3c23=_0xb04cc8[_0x5c8d('0x1f')]-_0x30dd27[_0x5c8d('0x1f')];_0x508540=_0x5552dd[_0x5c8d('0x18')]?_0x5552dd[_0x5c8d('0x18')]:moment();var _0x57cdec=moment(_0x508540)[_0x5c8d('0x2f')](_0x5b3c23,'minutes');_0x1732af({'ret':_0x57cdec['format'](_0x5c8d('0x27'))});}else _0x1732af({'ret':_0x508540});}else _0x1732af({'ret':_0x508540});}else{_0x1732af({'ret':_0x508540});}});}});return 0xa;}var _0x17337e=function(_0x253f94){return new BPromise(function(_0x268756,_0x43553d){_0x5e465d(_0x253f94,_0x1cba4c)['then'](function(_0x1c02b3){_0x1cba4c['scheduledat']=_0x1c02b3[_0x5c8d('0x22')];_0x1a0854['CmHopper']['findOne']({'where':{'phone':_0x1cba4c[_0x5c8d('0xd')],'CampaignId':_0x253f94['id']}})['then'](function(_0x33d8f4){if(!_[_0x5c8d('0x19')](_0x33d8f4)){throw new Error(_0x5c8d('0x24')+_0x1cba4c[_0x5c8d('0xd')]+_0x5c8d('0x30')+_0x253f94['id']);}return _0x1a0854[_0x5c8d('0x23')][_0x5c8d('0x2c')]({'phone':_0x1cba4c[_0x5c8d('0xd')],'ContactId':_0x1cba4c['id'],'ListId':_0x1cba4c[_0x5c8d('0x25')],'priority':_0x1cba4c['priority']?_0x1cba4c[_0x5c8d('0x26')]:0x2,'scheduledat':_0x1cba4c[_0x5c8d('0x18')]?_0x1cba4c[_0x5c8d('0x18')]:moment()['format'](_0x5c8d('0x27')),'callback':_0x1cba4c[_0x5c8d('0x28')]?!![]:![],'callbackuniqueid':_0x1cba4c[_0x5c8d('0x28')]?_0x1cba4c[_0x5c8d('0x28')]:undefined,'callbackat':_0x1cba4c[_0x5c8d('0x28')]?moment()[_0x5c8d('0x21')](_0x5c8d('0x27')):undefined,'CampaignId':_0x253f94['id']});})[_0x5c8d('0x29')](function(_0x415cd5){_0x43553d(_0x415cd5);});});});};var _0x51f7da=function(_0xcf474){return new BPromise(function(_0x20214b,_0x7293b){_0x5e465d(_0xcf474,_0x1cba4c)[_0x5c8d('0x1c')](function(_0x5ce7e7){_0x1cba4c['scheduledat']=_0x5ce7e7[_0x5c8d('0x22')];_0x1a0854['CmHopper'][_0x5c8d('0x1b')]({'where':{'phone':_0x1cba4c[_0x5c8d('0xd')],'CampaignId':_0xcf474['id']}})[_0x5c8d('0x1c')](function(_0x32c8ce){if(!_[_0x5c8d('0x19')](_0x32c8ce)){throw new Error(_0x5c8d('0x24')+_0x1cba4c[_0x5c8d('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0xcf474['id']);}return _0x1a0854[_0x5c8d('0x2a')][_0x5c8d('0x1b')]({'where':{'calleridnum':_0x1cba4c[_0x5c8d('0xd')],'CampaignId':_0xcf474['id']}});})[_0x5c8d('0x1c')](function(_0x4270a1){if(!_['isNil'](_0x4270a1)){throw new Error(_0x5c8d('0x2b')+_0x1cba4c['phone']+_0x5c8d('0x31')+_0xcf474['id']);}return _0x1a0854['CmHopper'][_0x5c8d('0x2c')]({'phone':_0x1cba4c[_0x5c8d('0xd')],'ContactId':_0x1cba4c['id'],'ListId':_0x1cba4c['ListId'],'priority':_0x1cba4c[_0x5c8d('0x26')]?_0x1cba4c[_0x5c8d('0x26')]:0x2,'scheduledat':_0x1cba4c[_0x5c8d('0x18')]?_0x1cba4c[_0x5c8d('0x18')]:moment()[_0x5c8d('0x21')](_0x5c8d('0x27')),'callback':_0x1cba4c['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1cba4c['callbackUniqueid']?_0x1cba4c[_0x5c8d('0x28')]:undefined,'callbackat':_0x1cba4c[_0x5c8d('0x28')]?moment()[_0x5c8d('0x21')](_0x5c8d('0x27')):undefined,'CampaignId':_0xcf474['id']});})[_0x5c8d('0x29')](function(_0x6dcb7a){_0x7293b(_0x6dcb7a);});});});};if(_0x1cba4c[_0x5c8d('0x25')]){_0x1a0854[_0x5c8d('0x1a')][_0x5c8d('0x32')]({'where':{'type':'outbound'},'attributes':['id',_0x5c8d('0x33'),_0x5c8d('0x1d')],'include':[{'model':_0x1a0854['CmList'],'as':'Lists','where':{'id':_0x1cba4c[_0x5c8d('0x25')]}}]})[_0x5c8d('0x1c')](function(_0x42b7b1){if(_0x42b7b1){var _0x11f3a7=[];for(var _0x1be12a=0x0,_0x531616;_0x1be12a<_0x42b7b1[_0x5c8d('0x34')];_0x1be12a+=0x1){_0x531616=_0x42b7b1[_0x1be12a]['get']({'plain':!![]});switch(_0x531616[_0x5c8d('0x33')]){case _0x5c8d('0x35'):_0x2c4b42(_0x531616)[_0x5c8d('0x29')](_0x3c1c67());break;case _0x5c8d('0x36'):_0x49e2e8(_0x531616)[_0x5c8d('0x29')](_0x3c1c67());break;default:_0x5e465d(_0x531616,_0x1cba4c)[_0x5c8d('0x1c')](function(_0x3c6ccd){_0x1cba4c[_0x5c8d('0x18')]=_0x3c6ccd[_0x5c8d('0x22')];_0x1a0854[_0x5c8d('0x23')][_0x5c8d('0x2c')]({'phone':_0x1cba4c[_0x5c8d('0xd')],'ContactId':_0x1cba4c['id'],'ListId':_0x1cba4c[_0x5c8d('0x25')],'scheduledat':_0x1cba4c[_0x5c8d('0x18')]?_0x1cba4c[_0x5c8d('0x18')]:moment()['format'](_0x5c8d('0x27')),'priority':_0x1cba4c[_0x5c8d('0x26')]?_0x1cba4c[_0x5c8d('0x26')]:0x2,'callback':_0x1cba4c[_0x5c8d('0x28')]?!![]:![],'callbackuniqueid':_0x1cba4c[_0x5c8d('0x28')]?_0x1cba4c[_0x5c8d('0x28')]:undefined,'callbackat':_0x1cba4c[_0x5c8d('0x28')]?moment()[_0x5c8d('0x21')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x531616['id']})[_0x5c8d('0x29')](_0x3c1c67());});}}}})['then'](function(){return _0x1a0854['VoiceQueue'][_0x5c8d('0x32')]({'where':{'type':_0x5c8d('0x37')},'attributes':['id'],'include':[{'model':_0x1a0854[_0x5c8d('0x38')],'as':'BlackLists','where':{'id':_0x1cba4c[_0x5c8d('0x25')]}}]})[_0x5c8d('0x1c')](function(_0x409c08){if(_0x409c08){var _0x59f2b8=[];for(var _0x303ea6=0x0,_0x714fc2;_0x303ea6<_0x409c08[_0x5c8d('0x34')];_0x303ea6+=0x1){_0x714fc2=_0x409c08[_0x303ea6][_0x5c8d('0x14')]({'plain':!![]});_0x1a0854[_0x5c8d('0x39')][_0x5c8d('0x2c')]({'phone':_0x1cba4c[_0x5c8d('0xd')],'ContactId':_0x1cba4c['id'],'ListId':_0x1cba4c[_0x5c8d('0x25')],'VoiceQueueId':_0x714fc2['id']})[_0x5c8d('0x29')](function(_0x128cdd){logger[_0x5c8d('0x2d')](_0x5c8d('0x3a'),_0x5c8d('0x16'),_0x128cdd[_0x5c8d('0x3b')]);});}}});})[_0x5c8d('0x1c')](function(){return _0x1a0854['Campaign'][_0x5c8d('0x32')]({'attributes':['id','dialCheckDuplicateType',_0x5c8d('0x1d')],'include':[{'model':_0x1a0854[_0x5c8d('0x38')],'as':_0x5c8d('0x3c'),'where':{'id':_0x1cba4c[_0x5c8d('0x25')]}}]})[_0x5c8d('0x1c')](function(_0x297797){if(_0x297797){var _0x399e72=[];for(var _0x2fa0e7=0x0,_0x3117a1;_0x2fa0e7<_0x297797[_0x5c8d('0x34')];_0x2fa0e7+=0x1){_0x3117a1=_0x297797[_0x2fa0e7][_0x5c8d('0x14')]({'plain':!![]});switch(_0x3117a1[_0x5c8d('0x33')]){case'always':_0x51f7da(_0x3117a1)[_0x5c8d('0x29')](_0x41e59b());break;case'onlyIfOpen':_0x17337e(_0x3117a1)[_0x5c8d('0x29')](_0x41e59b());break;default:_0x1a0854[_0x5c8d('0x23')][_0x5c8d('0x2c')]({'phone':_0x1cba4c[_0x5c8d('0xd')],'ContactId':_0x1cba4c['id'],'ListId':_0x1cba4c[_0x5c8d('0x25')],'scheduledat':_0x1cba4c[_0x5c8d('0x18')]?_0x1cba4c[_0x5c8d('0x18')]:moment()[_0x5c8d('0x21')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x1cba4c[_0x5c8d('0x26')]?_0x1cba4c['priority']:0x2,'callback':_0x1cba4c[_0x5c8d('0x28')]?!![]:![],'callbackuniqueid':_0x1cba4c[_0x5c8d('0x28')]?_0x1cba4c['callbackUniqueid']:undefined,'callbackat':_0x1cba4c[_0x5c8d('0x28')]?moment()[_0x5c8d('0x21')](_0x5c8d('0x27')):undefined,'CampaignId':_0x3117a1['id']})[_0x5c8d('0x29')](_0x41e59b());}}}});})[_0x5c8d('0x1c')](function(){return _0x1a0854['Campaign']['findAll']({'attributes':['id'],'include':[{'model':_0x1a0854['CmList'],'as':_0x5c8d('0x3d'),'where':{'id':_0x1cba4c[_0x5c8d('0x25')]}}]})['then'](function(_0x5cb8e9){if(_0x5cb8e9){var _0xf3c3b3=[];for(var _0x429af4=0x0,_0x105c98;_0x429af4<_0x5cb8e9[_0x5c8d('0x34')];_0x429af4+=0x1){_0x105c98=_0x5cb8e9[_0x429af4][_0x5c8d('0x14')]({'plain':!![]});_0x1a0854[_0x5c8d('0x39')][_0x5c8d('0x2c')]({'phone':_0x1cba4c[_0x5c8d('0xd')],'ContactId':_0x1cba4c['id'],'ListId':_0x1cba4c[_0x5c8d('0x25')],'CampaignId':_0x105c98['id']})[_0x5c8d('0x29')](function(_0x194985){logger[_0x5c8d('0x2d')](_0x5c8d('0x3a'),_0x5c8d('0x16'),_0x194985[_0x5c8d('0x3b')]);});}}});})[_0x5c8d('0x1c')](function(){_0x4b9a76();})[_0x5c8d('0x29')](function(_0x4eae92){logger['error']('cmContact,\x20%s,\x20%s',_0x5c8d('0x16'),_0x4eae92[_0x5c8d('0x3b')]);_0x4b9a76(_0x4eae92);});}else{_0x4b9a76(new Error(_0x5c8d('0x3e')));}},'afterDestroy':function(_0x3dbb67,_0xf6e392,_0x519743){var _0x299a8f=_0x4bb13a['models'];var _0x314d0d=_0x3dbb67[_0x5c8d('0x14')]({'plain':!![]});return _0x299a8f[_0x5c8d('0x23')][_0x5c8d('0x32')]({'raw':!![],'where':{'ListId':_0x314d0d['ListId'],'ContactId':_0x314d0d['id']}})[_0x5c8d('0x1c')](function(_0xe89400){if(!_['isEmpty'](_0xe89400)){var _0x1a3594=[];for(var _0x4c34a3=0x0;_0x4c34a3<_0xe89400[_0x5c8d('0x34')];_0x4c34a3+=0x1){var _0x6a4b0=_0x299a8f[_0x5c8d('0x23')][_0x5c8d('0x3f')]({'where':{'ListId':_0xe89400[_0x4c34a3][_0x5c8d('0x25')],'ContactId':_0xe89400[_0x4c34a3][_0x5c8d('0x40')],'VoiceQueueId':_0xe89400[_0x4c34a3][_0x5c8d('0x41')],'CampaignId':_0xe89400[_0x4c34a3][_0x5c8d('0x42')]}});_0x1a3594[_0x5c8d('0x43')](_0x6a4b0);}return BPromise[_0x5c8d('0x44')](_0x1a3594);}})[_0x5c8d('0x1c')](function(_0x4d6801){logger['info'](_0x5c8d('0x45'),util['inspect'](_0x4d6801,{'showHidden':![],'depth':null}));_0x519743();})[_0x5c8d('0x29')](function(_0x34768b){logger[_0x5c8d('0x2d')]('[CmContact][afterDestroy][Error]',util[_0x5c8d('0x17')](_0x34768b,{'showHidden':![],'depth':null}));_0x519743(_0x34768b);});}}});}; \ No newline at end of file +var _0xf1a1=['timezones','utcOffset','add','ret','CmHopper','findOne','cmContact,\x20afterCreate\x20','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','create','error','minutes','\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','length','BlackLists','message','onlyIfOpen','Campaign','cmContact,\x20%s,\x20%s','List\x20not\x20found','models','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment/shared','./cmContact.attributes','exports','CmContact','cm_contacts','phone','fti_cm_contacts','lastName','mobile','fax','email','utf8mb4','utf8mb4_unicode_ci','get','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','VoiceQueue','then','dialTimezone'];(function(_0x26e9df,_0x46bb15){var _0x2a0d2b=function(_0x2c9773){while(--_0x2c9773){_0x26e9df['push'](_0x26e9df['shift']());}};_0x2a0d2b(++_0x46bb15);}(_0xf1a1,0x1d9));var _0x1f1a=function(_0x413629,_0x35dcb2){_0x413629=_0x413629-0x0;var _0x4b23cd=_0xf1a1[_0x413629];return _0x4b23cd;};'use strict';var _=require(_0x1f1a('0x0'));var util=require(_0x1f1a('0x1'));var logger=require(_0x1f1a('0x2'))(_0x1f1a('0x3'));var moment=require(_0x1f1a('0x4'));var BPromise=require(_0x1f1a('0x5'));var rp=require(_0x1f1a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f1a('0x7'));var config=require('../../config/environment');var shared=require(_0x1f1a('0x8'));var attributes=require(_0x1f1a('0x9'));module[_0x1f1a('0xa')]=function(_0x28e701,_0x28750f){return _0x28e701['define'](_0x1f1a('0xb'),attributes,{'tableName':_0x1f1a('0xc'),'paranoid':!![],'indexes':[{'name':_0x1f1a('0xd'),'fields':[_0x1f1a('0xd')]},{'name':_0x1f1a('0xe'),'fields':['firstName',_0x1f1a('0xf'),'phone',_0x1f1a('0x10'),_0x1f1a('0x11'),_0x1f1a('0x12')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x1f1a('0x13'),'collate':_0x1f1a('0x14'),'hooks':{'afterCreate':function(_0x471432,_0x2792f1,_0x487ea0){var _0x25d96c=_0x28e701['models'];var _0x4546b3=_0x471432[_0x1f1a('0x15')]({'plain':!![]});function _0x3b0964(){return function(_0x471534){logger['error']('cmContact',_0x1f1a('0x16'),util[_0x1f1a('0x17')](_0x471534,{'showHidden':![],'depth':null}));};}function _0x380d6d(_0x50c2cf,_0x55dd4e){var _0x125264=_0x55dd4e[_0x1f1a('0x18')]?_0x55dd4e[_0x1f1a('0x18')]:moment()[_0x1f1a('0x19')](_0x1f1a('0x1a'));return new BPromise(function(_0x3f88b0,_0x161535){if(_[_0x1f1a('0x1b')](_0x55dd4e['dialTimezone'])){_0x3f88b0({'ret':_0x125264});}else{_0x25d96c[_0x1f1a('0x1c')]['findOne']({'where':{'id':_0x50c2cf['id']}})[_0x1f1a('0x1d')](function(_0x234f96){if(!_[_0x1f1a('0x1b')](_0x234f96)){var _0x4a0390=_0x234f96[_0x1f1a('0x1e')];if(!_[_0x1f1a('0x1b')](_0x4a0390)){var _0x83abf9=shared[_0x1f1a('0x1f')];var _0x6616ab=_0x83abf9[_0x4a0390];var _0x57c4df=_0x83abf9[_0x55dd4e['dialTimezone']];if(!_[_0x1f1a('0x1b')](_0x6616ab)&&!_[_0x1f1a('0x1b')](_0x57c4df)){var _0x1292e5=_0x6616ab['utcOffset']-_0x57c4df[_0x1f1a('0x20')];_0x125264=_0x55dd4e['scheduledat']?_0x55dd4e[_0x1f1a('0x18')]:moment();var _0x1d8b2c=moment(_0x125264)[_0x1f1a('0x21')](_0x1292e5,'minutes');_0x3f88b0({'ret':_0x1d8b2c['format'](_0x1f1a('0x1a'))});}else _0x3f88b0({'ret':_0x125264});}else _0x3f88b0({'ret':_0x125264});}else{_0x3f88b0({'ret':_0x125264});}});}});return 0xa;}var _0x93cfac=function(_0x50e809){return new BPromise(function(_0x69652,_0x4102b8){_0x380d6d(_0x50e809,_0x4546b3)[_0x1f1a('0x1d')](function(_0x13ef6d){_0x4546b3[_0x1f1a('0x18')]=_0x13ef6d[_0x1f1a('0x22')];_0x25d96c[_0x1f1a('0x23')][_0x1f1a('0x24')]({'where':{'phone':_0x4546b3[_0x1f1a('0xd')],'VoiceQueueId':_0x50e809['id']}})[_0x1f1a('0x1d')](function(_0x5b0ec2){if(!_[_0x1f1a('0x1b')](_0x5b0ec2)){throw new Error(_0x1f1a('0x25')+_0x4546b3[_0x1f1a('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x50e809['id']);}return _0x25d96c[_0x1f1a('0x23')]['create']({'phone':_0x4546b3[_0x1f1a('0xd')],'ContactId':_0x4546b3['id'],'ListId':_0x4546b3[_0x1f1a('0x26')],'priority':_0x4546b3['priority']?_0x4546b3[_0x1f1a('0x27')]:0x2,'scheduledat':_0x4546b3['scheduledat']?_0x4546b3['scheduledat']:moment()[_0x1f1a('0x19')](_0x1f1a('0x1a')),'callback':_0x4546b3['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4546b3['callbackUniqueid']?_0x4546b3[_0x1f1a('0x28')]:undefined,'callbackat':_0x4546b3[_0x1f1a('0x28')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x50e809['id']});})[_0x1f1a('0x29')](function(_0x10bbb8){_0x4102b8(_0x10bbb8);});});});};var _0xde0dc0=function(_0x33a836){return new BPromise(function(_0x251ae5,_0x264f22){_0x380d6d(_0x33a836,_0x4546b3)[_0x1f1a('0x1d')](function(_0x2eb45b){_0x4546b3[_0x1f1a('0x18')]=_0x2eb45b[_0x1f1a('0x22')];_0x25d96c[_0x1f1a('0x23')][_0x1f1a('0x24')]({'where':{'phone':_0x4546b3['phone'],'VoiceQueueId':_0x33a836['id']}})['then'](function(_0x1571ee){if(!_[_0x1f1a('0x1b')](_0x1571ee)){throw new Error(_0x1f1a('0x25')+_0x4546b3[_0x1f1a('0xd')]+_0x1f1a('0x2a')+_0x33a836['id']);}return _0x25d96c[_0x1f1a('0x2b')]['findOne']({'where':{'calleridnum':_0x4546b3[_0x1f1a('0xd')],'VoiceQueueId':_0x33a836['id']}});})[_0x1f1a('0x1d')](function(_0x388396){if(!_['isNil'](_0x388396)){throw new Error(_0x1f1a('0x2c')+_0x4546b3[_0x1f1a('0xd')]+_0x1f1a('0x2d')+_0x33a836['id']);}return _0x25d96c['CmHopper'][_0x1f1a('0x2e')]({'phone':_0x4546b3[_0x1f1a('0xd')],'ContactId':_0x4546b3['id'],'ListId':_0x4546b3[_0x1f1a('0x26')],'priority':_0x4546b3['priority']?_0x4546b3[_0x1f1a('0x27')]:0x2,'scheduledat':_0x4546b3[_0x1f1a('0x18')]?_0x4546b3[_0x1f1a('0x18')]:moment()[_0x1f1a('0x19')](_0x1f1a('0x1a')),'callback':_0x4546b3[_0x1f1a('0x28')]?!![]:![],'callbackuniqueid':_0x4546b3['callbackUniqueid']?_0x4546b3[_0x1f1a('0x28')]:undefined,'callbackat':_0x4546b3['callbackUniqueid']?moment()['format'](_0x1f1a('0x1a')):undefined,'VoiceQueueId':_0x33a836['id']});})[_0x1f1a('0x29')](function(_0x4b799b){_0x264f22(_0x4b799b);});});});};function _0x47501d(){return function(_0x2a11b1){logger[_0x1f1a('0x2f')]('cmContact',_0x1f1a('0x16'),util[_0x1f1a('0x17')](_0x2a11b1,{'showHidden':![],'depth':null}));};}function _0x49c26e(_0x26d6e2,_0x1b6b6a){var _0x2b0bbd=_0x1b6b6a['scheduledat']?_0x1b6b6a[_0x1f1a('0x18')]:moment()[_0x1f1a('0x19')](_0x1f1a('0x1a'));return new BPromise(function(_0x59093c,_0x1879fe){if(_[_0x1f1a('0x1b')](_0x1b6b6a['dialTimezone'])){_0x59093c({'ret':_0x2b0bbd});}else{_0x25d96c['Campaign'][_0x1f1a('0x24')]({'where':{'id':_0x26d6e2['id']}})[_0x1f1a('0x1d')](function(_0x22f998){if(!_[_0x1f1a('0x1b')](_0x22f998)){var _0x28f39b=_0x22f998['dialTimezone'];if(!_[_0x1f1a('0x1b')](_0x28f39b)){var _0x49c19c=shared['timezones'];var _0x4d7ac3=_0x49c19c[_0x28f39b];var _0x433c68=_0x49c19c[_0x1b6b6a[_0x1f1a('0x1e')]];if(!_[_0x1f1a('0x1b')](_0x4d7ac3)&&!_[_0x1f1a('0x1b')](_0x433c68)){var _0x39f1a9=_0x4d7ac3[_0x1f1a('0x20')]-_0x433c68[_0x1f1a('0x20')];_0x2b0bbd=_0x1b6b6a[_0x1f1a('0x18')]?_0x1b6b6a[_0x1f1a('0x18')]:moment();var _0x4812b2=moment(_0x2b0bbd)[_0x1f1a('0x21')](_0x39f1a9,_0x1f1a('0x30'));_0x59093c({'ret':_0x4812b2[_0x1f1a('0x19')](_0x1f1a('0x1a'))});}else _0x59093c({'ret':_0x2b0bbd});}else _0x59093c({'ret':_0x2b0bbd});}else{_0x59093c({'ret':_0x2b0bbd});}});}});return 0xa;}var _0x520a66=function(_0x5f5aad){return new BPromise(function(_0x42e9a6,_0x15904c){_0x49c26e(_0x5f5aad,_0x4546b3)['then'](function(_0x94b050){_0x4546b3['scheduledat']=_0x94b050[_0x1f1a('0x22')];_0x25d96c['CmHopper'][_0x1f1a('0x24')]({'where':{'phone':_0x4546b3[_0x1f1a('0xd')],'CampaignId':_0x5f5aad['id']}})[_0x1f1a('0x1d')](function(_0x4babc9){if(!_['isNil'](_0x4babc9)){throw new Error(_0x1f1a('0x25')+_0x4546b3[_0x1f1a('0xd')]+_0x1f1a('0x31')+_0x5f5aad['id']);}return _0x25d96c[_0x1f1a('0x23')][_0x1f1a('0x2e')]({'phone':_0x4546b3['phone'],'ContactId':_0x4546b3['id'],'ListId':_0x4546b3[_0x1f1a('0x26')],'priority':_0x4546b3[_0x1f1a('0x27')]?_0x4546b3[_0x1f1a('0x27')]:0x2,'scheduledat':_0x4546b3[_0x1f1a('0x18')]?_0x4546b3['scheduledat']:moment()[_0x1f1a('0x19')](_0x1f1a('0x1a')),'callback':_0x4546b3[_0x1f1a('0x28')]?!![]:![],'callbackuniqueid':_0x4546b3[_0x1f1a('0x28')]?_0x4546b3['callbackUniqueid']:undefined,'callbackat':_0x4546b3[_0x1f1a('0x28')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x5f5aad['id']});})[_0x1f1a('0x29')](function(_0x58a3b6){_0x15904c(_0x58a3b6);});});});};var _0x565937=function(_0x577baa){return new BPromise(function(_0x2438a0,_0x291373){_0x49c26e(_0x577baa,_0x4546b3)[_0x1f1a('0x1d')](function(_0x2315a1){_0x4546b3[_0x1f1a('0x18')]=_0x2315a1[_0x1f1a('0x22')];_0x25d96c[_0x1f1a('0x23')][_0x1f1a('0x24')]({'where':{'phone':_0x4546b3[_0x1f1a('0xd')],'CampaignId':_0x577baa['id']}})['then'](function(_0x4bbe90){if(!_['isNil'](_0x4bbe90)){throw new Error(_0x1f1a('0x25')+_0x4546b3[_0x1f1a('0xd')]+_0x1f1a('0x32')+_0x577baa['id']);}return _0x25d96c['CmHopperFinal'][_0x1f1a('0x24')]({'where':{'calleridnum':_0x4546b3[_0x1f1a('0xd')],'CampaignId':_0x577baa['id']}});})['then'](function(_0x5bb655){if(!_[_0x1f1a('0x1b')](_0x5bb655)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x4546b3[_0x1f1a('0xd')]+_0x1f1a('0x33')+_0x577baa['id']);}return _0x25d96c['CmHopper'][_0x1f1a('0x2e')]({'phone':_0x4546b3[_0x1f1a('0xd')],'ContactId':_0x4546b3['id'],'ListId':_0x4546b3[_0x1f1a('0x26')],'priority':_0x4546b3[_0x1f1a('0x27')]?_0x4546b3[_0x1f1a('0x27')]:0x2,'scheduledat':_0x4546b3[_0x1f1a('0x18')]?_0x4546b3[_0x1f1a('0x18')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x4546b3[_0x1f1a('0x28')]?!![]:![],'callbackuniqueid':_0x4546b3[_0x1f1a('0x28')]?_0x4546b3['callbackUniqueid']:undefined,'callbackat':_0x4546b3['callbackUniqueid']?moment()[_0x1f1a('0x19')](_0x1f1a('0x1a')):undefined,'CampaignId':_0x577baa['id']});})[_0x1f1a('0x29')](function(_0x533ae9){_0x291373(_0x533ae9);});});});};if(_0x4546b3['ListId']){_0x25d96c[_0x1f1a('0x1c')][_0x1f1a('0x34')]({'where':{'type':_0x1f1a('0x35')},'attributes':['id',_0x1f1a('0x36'),_0x1f1a('0x1e')],'include':[{'model':_0x25d96c[_0x1f1a('0x37')],'as':_0x1f1a('0x38'),'where':{'id':_0x4546b3[_0x1f1a('0x26')]}}]})[_0x1f1a('0x1d')](function(_0x349452){if(_0x349452){var _0x3de1e3=[];for(var _0x63ee3f=0x0,_0x38b6f7;_0x63ee3f<_0x349452[_0x1f1a('0x39')];_0x63ee3f+=0x1){_0x38b6f7=_0x349452[_0x63ee3f][_0x1f1a('0x15')]({'plain':!![]});switch(_0x38b6f7[_0x1f1a('0x36')]){case'always':_0xde0dc0(_0x38b6f7)['catch'](_0x3b0964());break;case'onlyIfOpen':_0x93cfac(_0x38b6f7)[_0x1f1a('0x29')](_0x3b0964());break;default:_0x49c26e(_0x38b6f7,_0x4546b3)[_0x1f1a('0x1d')](function(_0x283398){_0x4546b3[_0x1f1a('0x18')]=_0x283398[_0x1f1a('0x22')];_0x25d96c[_0x1f1a('0x23')][_0x1f1a('0x2e')]({'phone':_0x4546b3['phone'],'ContactId':_0x4546b3['id'],'ListId':_0x4546b3[_0x1f1a('0x26')],'scheduledat':_0x4546b3[_0x1f1a('0x18')]?_0x4546b3[_0x1f1a('0x18')]:moment()[_0x1f1a('0x19')](_0x1f1a('0x1a')),'priority':_0x4546b3[_0x1f1a('0x27')]?_0x4546b3[_0x1f1a('0x27')]:0x2,'callback':_0x4546b3[_0x1f1a('0x28')]?!![]:![],'callbackuniqueid':_0x4546b3['callbackUniqueid']?_0x4546b3[_0x1f1a('0x28')]:undefined,'callbackat':_0x4546b3[_0x1f1a('0x28')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x38b6f7['id']})[_0x1f1a('0x29')](_0x3b0964());});}}}})[_0x1f1a('0x1d')](function(){return _0x25d96c[_0x1f1a('0x1c')][_0x1f1a('0x34')]({'where':{'type':_0x1f1a('0x35')},'attributes':['id'],'include':[{'model':_0x25d96c[_0x1f1a('0x37')],'as':_0x1f1a('0x3a'),'where':{'id':_0x4546b3[_0x1f1a('0x26')]}}]})[_0x1f1a('0x1d')](function(_0x6cc3ca){if(_0x6cc3ca){var _0x5e0f60=[];for(var _0x10e591=0x0,_0x10df19;_0x10e591<_0x6cc3ca['length'];_0x10e591+=0x1){_0x10df19=_0x6cc3ca[_0x10e591][_0x1f1a('0x15')]({'plain':!![]});_0x25d96c['CmHopperBlack'][_0x1f1a('0x2e')]({'phone':_0x4546b3[_0x1f1a('0xd')],'ContactId':_0x4546b3['id'],'ListId':_0x4546b3[_0x1f1a('0x26')],'VoiceQueueId':_0x10df19['id']})[_0x1f1a('0x29')](function(_0x1776ff){logger[_0x1f1a('0x2f')]('cmContact,\x20%s,\x20%s','afterCreate',_0x1776ff[_0x1f1a('0x3b')]);});}}});})[_0x1f1a('0x1d')](function(){return _0x25d96c['Campaign'][_0x1f1a('0x34')]({'attributes':['id',_0x1f1a('0x36'),_0x1f1a('0x1e')],'include':[{'model':_0x25d96c[_0x1f1a('0x37')],'as':_0x1f1a('0x38'),'where':{'id':_0x4546b3[_0x1f1a('0x26')]}}]})[_0x1f1a('0x1d')](function(_0x1fb223){if(_0x1fb223){var _0xc4ad1=[];for(var _0x37963c=0x0,_0x131306;_0x37963c<_0x1fb223[_0x1f1a('0x39')];_0x37963c+=0x1){_0x131306=_0x1fb223[_0x37963c][_0x1f1a('0x15')]({'plain':!![]});switch(_0x131306['dialCheckDuplicateType']){case'always':_0x565937(_0x131306)[_0x1f1a('0x29')](_0x47501d());break;case _0x1f1a('0x3c'):_0x520a66(_0x131306)[_0x1f1a('0x29')](_0x47501d());break;default:_0x25d96c[_0x1f1a('0x23')][_0x1f1a('0x2e')]({'phone':_0x4546b3['phone'],'ContactId':_0x4546b3['id'],'ListId':_0x4546b3['ListId'],'scheduledat':_0x4546b3[_0x1f1a('0x18')]?_0x4546b3[_0x1f1a('0x18')]:moment()[_0x1f1a('0x19')](_0x1f1a('0x1a')),'priority':_0x4546b3[_0x1f1a('0x27')]?_0x4546b3['priority']:0x2,'callback':_0x4546b3[_0x1f1a('0x28')]?!![]:![],'callbackuniqueid':_0x4546b3[_0x1f1a('0x28')]?_0x4546b3[_0x1f1a('0x28')]:undefined,'callbackat':_0x4546b3['callbackUniqueid']?moment()['format'](_0x1f1a('0x1a')):undefined,'CampaignId':_0x131306['id']})['catch'](_0x47501d());}}}});})[_0x1f1a('0x1d')](function(){return _0x25d96c[_0x1f1a('0x3d')][_0x1f1a('0x34')]({'attributes':['id'],'include':[{'model':_0x25d96c[_0x1f1a('0x37')],'as':_0x1f1a('0x3a'),'where':{'id':_0x4546b3[_0x1f1a('0x26')]}}]})['then'](function(_0x1c93ed){if(_0x1c93ed){var _0x5a45a0=[];for(var _0x577d05=0x0,_0x4711a8;_0x577d05<_0x1c93ed[_0x1f1a('0x39')];_0x577d05+=0x1){_0x4711a8=_0x1c93ed[_0x577d05]['get']({'plain':!![]});_0x25d96c['CmHopperBlack'][_0x1f1a('0x2e')]({'phone':_0x4546b3[_0x1f1a('0xd')],'ContactId':_0x4546b3['id'],'ListId':_0x4546b3[_0x1f1a('0x26')],'CampaignId':_0x4711a8['id']})[_0x1f1a('0x29')](function(_0x4aa328){logger[_0x1f1a('0x2f')](_0x1f1a('0x3e'),_0x1f1a('0x16'),_0x4aa328[_0x1f1a('0x3b')]);});}}});})[_0x1f1a('0x1d')](function(){_0x487ea0();})['catch'](function(_0x5925ac){logger[_0x1f1a('0x2f')](_0x1f1a('0x3e'),_0x1f1a('0x16'),_0x5925ac[_0x1f1a('0x3b')]);_0x487ea0(_0x5925ac);});}else{_0x487ea0(new Error(_0x1f1a('0x3f')));}},'afterDestroy':function(_0x3ae4d0,_0x339506,_0x881858){var _0x2702b9=_0x28e701[_0x1f1a('0x40')];var _0x39bc73=_0x3ae4d0[_0x1f1a('0x15')]({'plain':!![]});return _0x2702b9[_0x1f1a('0x23')][_0x1f1a('0x34')]({'raw':!![],'where':{'ListId':_0x39bc73[_0x1f1a('0x26')],'ContactId':_0x39bc73['id']}})[_0x1f1a('0x1d')](function(_0x1b8cc0){if(!_['isEmpty'](_0x1b8cc0)){var _0x39a3fb=[];for(var _0x61a006=0x0;_0x61a006<_0x1b8cc0['length'];_0x61a006+=0x1){var _0x43322b=_0x2702b9['CmHopper']['destroy']({'where':{'ListId':_0x1b8cc0[_0x61a006][_0x1f1a('0x26')],'ContactId':_0x1b8cc0[_0x61a006][_0x1f1a('0x41')],'VoiceQueueId':_0x1b8cc0[_0x61a006][_0x1f1a('0x42')],'CampaignId':_0x1b8cc0[_0x61a006][_0x1f1a('0x43')]}});_0x39a3fb[_0x1f1a('0x44')](_0x43322b);}return BPromise[_0x1f1a('0x45')](_0x39a3fb);}})[_0x1f1a('0x1d')](function(_0x18eabb){logger[_0x1f1a('0x46')](_0x1f1a('0x47'),util[_0x1f1a('0x17')](_0x18eabb,{'showHidden':![],'depth':null}));_0x881858();})[_0x1f1a('0x29')](function(_0x26a2c8){logger['error']('[CmContact][afterDestroy][Error]',util['inspect'](_0x26a2c8,{'showHidden':![],'depth':null}));_0x881858(_0x26a2c8);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index dc5b534..0547f7e 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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(_0x4d04e6,_0x4830fa){var _0x37322e=function(_0x23de74){while(--_0x23de74){_0x4d04e6['push'](_0x4d04e6['shift']());}};_0x37322e(++_0x4830fa);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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{}\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(_0x4ec142,_0x3f9ecb){var _0x27eb43=function(_0x30197b){while(--_0x30197b){_0x4ec142['push'](_0x4ec142['shift']());}};_0x27eb43(++_0x3f9ecb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 16c086c..f8634c2 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5127=['exports','INTEGER','STRING','PHONE','sequelize'];(function(_0x406115,_0x19f7a1){var _0xbbabdb=function(_0x28554d){while(--_0x28554d){_0x406115['push'](_0x406115['shift']());}};_0xbbabdb(++_0x19f7a1);}(_0x5127,0x18f));var _0x7512=function(_0x2d3c60,_0x4df458){_0x2d3c60=_0x2d3c60-0x0;var _0x560041=_0x5127[_0x2d3c60];return _0x560041;};'use strict';var Sequelize=require(_0x7512('0x0'));module[_0x7512('0x1')]={'CmContactId':{'type':Sequelize[_0x7512('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x7512('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x7512('0x4')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0x7512('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0x74f0=['INTEGER','STRING','PHONE','exports'];(function(_0x52a857,_0xc99fa1){var _0x4e2aae=function(_0x5410d9){while(--_0x5410d9){_0x52a857['push'](_0x52a857['shift']());}};_0x4e2aae(++_0xc99fa1);}(_0x74f0,0xf3));var _0x074f=function(_0x1e081a,_0x482d6b){_0x1e081a=_0x1e081a-0x0;var _0x428209=_0x74f0[_0x1e081a];return _0x428209;};'use strict';var Sequelize=require('sequelize');module[_0x074f('0x0')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x074f('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x074f('0x2')],'defaultValue':_0x074f('0x3')},'OrderBy':{'type':Sequelize[_0x074f('0x1')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 572d63a..f11543a 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a3b=['catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasItems','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','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','offset','undefined','limit','count','json','apply','update','then','UserProfileResource','destroy','end','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','keys','find'];(function(_0x2618a7,_0x590671){var _0x27668b=function(_0x2b1b63){while(--_0x2b1b63){_0x2618a7['push'](_0x2618a7['shift']());}};_0x27668b(++_0x590671);}(_0x9a3b,0x14e));var _0xb9a3=function(_0x272e19,_0x1fbcc2){_0x272e19=_0x272e19-0x0;var _0x835bfb=_0x9a3b[_0x272e19];return _0x835bfb;};'use strict';var emlformat=require(_0xb9a3('0x0'));var rimraf=require(_0xb9a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb9a3('0x2'));var rp=require(_0xb9a3('0x3'));var moment=require(_0xb9a3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb9a3('0x5'));var util=require(_0xb9a3('0x6'));var path=require('path');var sox=require(_0xb9a3('0x7'));var csv=require('to-csv');var ejs=require(_0xb9a3('0x8'));var fs=require('fs');var fs_extra=require(_0xb9a3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb9a3('0xa'));var deskjs=require(_0xb9a3('0xb'));var toCsv=require(_0xb9a3('0xc'));var querystring=require('querystring');var Papa=require(_0xb9a3('0xd'));var Redis=require(_0xb9a3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb9a3('0xf'));var as=require(_0xb9a3('0x10'));var hardwareService=require(_0xb9a3('0x11'));var logger=require(_0xb9a3('0x12'))(_0xb9a3('0x13'));var utils=require(_0xb9a3('0x14'));var config=require(_0xb9a3('0x15'));var licenseUtil=require(_0xb9a3('0x16'));var db=require(_0xb9a3('0x17'))['db'];function respondWithStatusCode(_0x4d72f4,_0x5f3442){_0x5f3442=_0x5f3442||0xcc;return function(_0x1a33e1){if(_0x1a33e1){return _0x4d72f4[_0xb9a3('0x18')](_0x5f3442);}return _0x4d72f4[_0xb9a3('0x19')](_0x5f3442)['end']();};}function respondWithResult(_0x190fd6,_0x79d6b2){_0x79d6b2=_0x79d6b2||0xc8;return function(_0x2b4392){if(_0x2b4392){return _0x190fd6['status'](_0x79d6b2)['json'](_0x2b4392);}};}function respondWithFilteredResult(_0x10a459,_0x8c01f7){return function(_0x11dbed){if(_0x11dbed){var _0x36a922=typeof _0x8c01f7[_0xb9a3('0x1a')]===_0xb9a3('0x1b')&&typeof _0x8c01f7[_0xb9a3('0x1c')]==='undefined';var _0x260736=_0x11dbed[_0xb9a3('0x1d')];var _0x185da6=_0x36a922?0x0:_0x8c01f7[_0xb9a3('0x1a')];var _0x413bc0=_0x36a922?_0x11dbed[_0xb9a3('0x1d')]:_0x8c01f7[_0xb9a3('0x1a')]+_0x8c01f7['limit'];var _0x21ba0a;if(_0x413bc0>=_0x260736){_0x413bc0=_0x260736;_0x21ba0a=0xc8;}else{_0x21ba0a=0xce;}_0x10a459[_0xb9a3('0x19')](_0x21ba0a);return _0x10a459['set']('Content-Range',_0x185da6+'-'+_0x413bc0+'/'+_0x260736)[_0xb9a3('0x1e')](_0x11dbed);}return null;};}function patchUpdates(_0x1cfc6a){return function(_0x33affc){try{jsonpatch[_0xb9a3('0x1f')](_0x33affc,_0x1cfc6a,!![]);}catch(_0x1ed271){return BPromise['reject'](_0x1ed271);}return _0x33affc['save']();};}function saveUpdates(_0xa8d361,_0x39a123){return function(_0x28ee53){if(_0x28ee53){return _0x28ee53[_0xb9a3('0x20')](_0xa8d361)[_0xb9a3('0x21')](function(_0x1c4677){return _0x1c4677;});}return null;};}function removeEntity(_0x82bbc8,_0x54e948){return function(_0x4d5e10){if(_0x4d5e10){return _0x4d5e10['destroy']()[_0xb9a3('0x21')](function(){var _0x41dc14=_0x4d5e10['get']({'plain':!![]});var _0x3027b0='CmContactHasItems';return db[_0xb9a3('0x22')][_0xb9a3('0x23')]({'where':{'type':_0x3027b0,'resourceId':_0x41dc14['id']}})[_0xb9a3('0x21')](function(){return _0x4d5e10;});})[_0xb9a3('0x21')](function(){_0x82bbc8[_0xb9a3('0x19')](0xcc)[_0xb9a3('0x24')]();});}};}function handleEntityNotFound(_0x188406,_0x1ab5c3){return function(_0x1d80d1){if(!_0x1d80d1){_0x188406[_0xb9a3('0x18')](0x194);}return _0x1d80d1;};}function handleError(_0x4b1f9a,_0x5a5d90){_0x5a5d90=_0x5a5d90||0x1f4;return function(_0x53e502){logger[_0xb9a3('0x25')](_0x53e502[_0xb9a3('0x26')]);if(_0x53e502[_0xb9a3('0x27')]){delete _0x53e502[_0xb9a3('0x27')];}_0x4b1f9a[_0xb9a3('0x19')](_0x5a5d90)[_0xb9a3('0x28')](_0x53e502);};}exports[_0xb9a3('0x29')]=function(_0x4e8ac9,_0x478bed){var _0x347dd6={},_0x37f670={},_0x30645c={'count':0x0,'rows':[]};var _0x5ca7e7=_[_0xb9a3('0x2a')](db[_0xb9a3('0x2b')][_0xb9a3('0x2c')],function(_0x21f16a){return{'name':_0x21f16a[_0xb9a3('0x2d')],'type':_0x21f16a[_0xb9a3('0x2e')][_0xb9a3('0x2f')]};});_0x37f670[_0xb9a3('0x30')]=_['map'](_0x5ca7e7,_0xb9a3('0x27'));_0x37f670[_0xb9a3('0x31')]=_['keys'](_0x4e8ac9[_0xb9a3('0x31')]);_0x37f670[_0xb9a3('0x32')]=_[_0xb9a3('0x33')](_0x37f670[_0xb9a3('0x30')],_0x37f670[_0xb9a3('0x31')]);_0x347dd6[_0xb9a3('0x34')]=_[_0xb9a3('0x33')](_0x37f670[_0xb9a3('0x30')],qs[_0xb9a3('0x35')](_0x4e8ac9[_0xb9a3('0x31')][_0xb9a3('0x35')]));_0x347dd6[_0xb9a3('0x34')]=_0x347dd6['attributes'][_0xb9a3('0x36')]?_0x347dd6['attributes']:_0x37f670[_0xb9a3('0x30')];if(!_0x4e8ac9[_0xb9a3('0x31')][_0xb9a3('0x37')](_0xb9a3('0x38'))){_0x347dd6[_0xb9a3('0x1c')]=qs[_0xb9a3('0x1c')](_0x4e8ac9[_0xb9a3('0x31')]['limit']);_0x347dd6[_0xb9a3('0x1a')]=qs['offset'](_0x4e8ac9[_0xb9a3('0x31')]['offset']);}_0x347dd6[_0xb9a3('0x39')]=qs['sort'](_0x4e8ac9[_0xb9a3('0x31')][_0xb9a3('0x3a')]);_0x347dd6[_0xb9a3('0x3b')]=qs['filters'](_[_0xb9a3('0x3c')](_0x4e8ac9[_0xb9a3('0x31')],_0x37f670['filters']),_0x5ca7e7);if(_0x4e8ac9[_0xb9a3('0x31')][_0xb9a3('0x3d')]){_0x347dd6[_0xb9a3('0x3b')]=_[_0xb9a3('0x3e')](_0x347dd6[_0xb9a3('0x3b')],{'$or':_['map'](_0x5ca7e7,function(_0x498f90){if(_0x498f90['type']!==_0xb9a3('0x3f')){var _0x14ae3e={};_0x14ae3e[_0x498f90[_0xb9a3('0x27')]]={'$like':'%'+_0x4e8ac9['query'][_0xb9a3('0x3d')]+'%'};return _0x14ae3e;}})});}_0x347dd6=_['merge']({},_0x347dd6,_0x4e8ac9[_0xb9a3('0x40')]);var _0x191792={'where':_0x347dd6['where']};return db[_0xb9a3('0x2b')][_0xb9a3('0x1d')](_0x191792)[_0xb9a3('0x21')](function(_0x416edc){_0x30645c['count']=_0x416edc;if(_0x4e8ac9[_0xb9a3('0x31')][_0xb9a3('0x41')]){_0x347dd6[_0xb9a3('0x42')]=[{'all':!![]}];}return db[_0xb9a3('0x2b')]['findAll'](_0x347dd6);})[_0xb9a3('0x21')](function(_0x403a56){_0x30645c['rows']=_0x403a56;return _0x30645c;})['then'](respondWithFilteredResult(_0x478bed,_0x347dd6))['catch'](handleError(_0x478bed,null));};exports[_0xb9a3('0x43')]=function(_0x2943fa,_0x7a3b9f){var _0x22f814={'raw':!![],'where':{'id':_0x2943fa[_0xb9a3('0x44')]['id']}},_0x3901c9={};_0x3901c9[_0xb9a3('0x30')]=_[_0xb9a3('0x45')](db['CmContactHasItem']['rawAttributes']);_0x3901c9['query']=_[_0xb9a3('0x45')](_0x2943fa[_0xb9a3('0x31')]);_0x3901c9[_0xb9a3('0x32')]=_['intersection'](_0x3901c9[_0xb9a3('0x30')],_0x3901c9['query']);_0x22f814[_0xb9a3('0x34')]=_[_0xb9a3('0x33')](_0x3901c9[_0xb9a3('0x30')],qs[_0xb9a3('0x35')](_0x2943fa['query'][_0xb9a3('0x35')]));_0x22f814[_0xb9a3('0x34')]=_0x22f814['attributes'][_0xb9a3('0x36')]?_0x22f814[_0xb9a3('0x34')]:_0x3901c9[_0xb9a3('0x30')];if(_0x2943fa[_0xb9a3('0x31')][_0xb9a3('0x41')]){_0x22f814[_0xb9a3('0x42')]=[{'all':!![]}];}_0x22f814=_[_0xb9a3('0x3e')]({},_0x22f814,_0x2943fa[_0xb9a3('0x40')]);return db[_0xb9a3('0x2b')][_0xb9a3('0x46')](_0x22f814)[_0xb9a3('0x21')](handleEntityNotFound(_0x7a3b9f,null))['then'](respondWithResult(_0x7a3b9f,null))[_0xb9a3('0x47')](handleError(_0x7a3b9f,null));};exports['create']=function(_0x5c5c60,_0x233d34){return db[_0xb9a3('0x2b')][_0xb9a3('0x48')](_0x5c5c60[_0xb9a3('0x49')],{})[_0xb9a3('0x21')](function(_0x41c3c0){var _0x2a329a=_0x5c5c60[_0xb9a3('0x4a')]['get']({'plain':!![]});if(!_0x2a329a)throw new Error(_0xb9a3('0x4b'));if(_0x2a329a[_0xb9a3('0x4c')]===_0xb9a3('0x4a')){var _0x27cda3=_0x41c3c0['get']({'plain':!![]});var _0x14db8c=_0xb9a3('0x4d');return db[_0xb9a3('0x4e')][_0xb9a3('0x46')]({'where':{'name':_0x14db8c,'userProfileId':_0x2a329a[_0xb9a3('0x4f')]},'raw':!![]})[_0xb9a3('0x21')](function(_0x3cec8d){if(_0x3cec8d&&_0x3cec8d['autoAssociation']===0x0){return db[_0xb9a3('0x22')][_0xb9a3('0x48')]({'name':_0x27cda3[_0xb9a3('0x27')],'resourceId':_0x27cda3['id'],'type':_0x3cec8d[_0xb9a3('0x27')],'sectionId':_0x3cec8d['id']},{})[_0xb9a3('0x21')](function(){return _0x41c3c0;});}else{return _0x41c3c0;}})[_0xb9a3('0x47')](function(_0x5e4b54){logger[_0xb9a3('0x25')](_0xb9a3('0x50'),_0x5e4b54);throw _0x5e4b54;});}return _0x41c3c0;})['then'](respondWithResult(_0x233d34,0xc9))['catch'](handleError(_0x233d34,null));};exports[_0xb9a3('0x20')]=function(_0x24cf9c,_0x2112df){if(_0x24cf9c[_0xb9a3('0x49')]['id']){delete _0x24cf9c['body']['id'];}return db[_0xb9a3('0x2b')][_0xb9a3('0x46')]({'where':{'id':_0x24cf9c[_0xb9a3('0x44')]['id']}})['then'](handleEntityNotFound(_0x2112df,null))[_0xb9a3('0x21')](saveUpdates(_0x24cf9c[_0xb9a3('0x49')],null))[_0xb9a3('0x21')](respondWithResult(_0x2112df,null))[_0xb9a3('0x47')](handleError(_0x2112df,null));};exports['destroy']=function(_0x4d3743,_0x588de2){return db[_0xb9a3('0x2b')][_0xb9a3('0x46')]({'where':{'id':_0x4d3743[_0xb9a3('0x44')]['id']}})[_0xb9a3('0x21')](handleEntityNotFound(_0x588de2,null))[_0xb9a3('0x21')](removeEntity(_0x588de2,null))[_0xb9a3('0x47')](handleError(_0x588de2,null));}; \ No newline at end of file +var _0x3a23=['intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','update','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','json','apply','reject','save','then','destroy','get','CmContactHasItems','stack','name','send','index','map','CmContactHasItem','rawAttributes','model','query','keys','filters'];(function(_0x19a830,_0x4d4bd0){var _0x5ecb96=function(_0x43f735){while(--_0x43f735){_0x19a830['push'](_0x19a830['shift']());}};_0x5ecb96(++_0x4d4bd0);}(_0x3a23,0x14b));var _0x33a2=function(_0x5a6446,_0xf7be6b){_0x5a6446=_0x5a6446-0x0;var _0x5dd9c1=_0x3a23[_0x5a6446];return _0x5dd9c1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x33a2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x33a2('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x33a2('0x2'));var Mustache=require(_0x33a2('0x3'));var util=require(_0x33a2('0x4'));var path=require(_0x33a2('0x5'));var sox=require(_0x33a2('0x6'));var csv=require(_0x33a2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x33a2('0x8'));var _=require('lodash');var squel=require(_0x33a2('0x9'));var crypto=require(_0x33a2('0xa'));var jsforce=require(_0x33a2('0xb'));var deskjs=require(_0x33a2('0xc'));var toCsv=require(_0x33a2('0x7'));var querystring=require(_0x33a2('0xd'));var Papa=require(_0x33a2('0xe'));var Redis=require(_0x33a2('0xf'));var authService=require(_0x33a2('0x10'));var qs=require(_0x33a2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x33a2('0x12'));var logger=require(_0x33a2('0x13'))(_0x33a2('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x33a2('0x15'));var db=require(_0x33a2('0x16'))['db'];function respondWithStatusCode(_0xff10c,_0x19a349){_0x19a349=_0x19a349||0xcc;return function(_0x561177){if(_0x561177){return _0xff10c[_0x33a2('0x17')](_0x19a349);}return _0xff10c[_0x33a2('0x18')](_0x19a349)[_0x33a2('0x19')]();};}function respondWithResult(_0x9e260f,_0x4feb59){_0x4feb59=_0x4feb59||0xc8;return function(_0x4180a0){if(_0x4180a0){return _0x9e260f[_0x33a2('0x18')](_0x4feb59)['json'](_0x4180a0);}};}function respondWithFilteredResult(_0x45ba59,_0x529e5c){return function(_0x3061e6){if(_0x3061e6){var _0x1ab46e=typeof _0x529e5c[_0x33a2('0x1a')]==='undefined'&&typeof _0x529e5c[_0x33a2('0x1b')]==='undefined';var _0x1e8fce=_0x3061e6[_0x33a2('0x1c')];var _0x161334=_0x1ab46e?0x0:_0x529e5c['offset'];var _0x55daf6=_0x1ab46e?_0x3061e6[_0x33a2('0x1c')]:_0x529e5c['offset']+_0x529e5c['limit'];var _0x6402a4;if(_0x55daf6>=_0x1e8fce){_0x55daf6=_0x1e8fce;_0x6402a4=0xc8;}else{_0x6402a4=0xce;}_0x45ba59[_0x33a2('0x18')](_0x6402a4);return _0x45ba59[_0x33a2('0x1d')]('Content-Range',_0x161334+'-'+_0x55daf6+'/'+_0x1e8fce)[_0x33a2('0x1e')](_0x3061e6);}return null;};}function patchUpdates(_0x4676d4){return function(_0x28c7aa){try{jsonpatch[_0x33a2('0x1f')](_0x28c7aa,_0x4676d4,!![]);}catch(_0x163f4b){return BPromise[_0x33a2('0x20')](_0x163f4b);}return _0x28c7aa[_0x33a2('0x21')]();};}function saveUpdates(_0x47c0e4,_0x3eb58e){return function(_0x2318a7){if(_0x2318a7){return _0x2318a7['update'](_0x47c0e4)[_0x33a2('0x22')](function(_0x473539){return _0x473539;});}return null;};}function removeEntity(_0x452571,_0x585962){return function(_0x10dcb4){if(_0x10dcb4){return _0x10dcb4[_0x33a2('0x23')]()[_0x33a2('0x22')](function(){var _0xf7a6f6=_0x10dcb4[_0x33a2('0x24')]({'plain':!![]});var _0x49de1d=_0x33a2('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x49de1d,'resourceId':_0xf7a6f6['id']}})[_0x33a2('0x22')](function(){return _0x10dcb4;});})[_0x33a2('0x22')](function(){_0x452571[_0x33a2('0x18')](0xcc)[_0x33a2('0x19')]();});}};}function handleEntityNotFound(_0x4fc219,_0x24734d){return function(_0x5eb1ec){if(!_0x5eb1ec){_0x4fc219['sendStatus'](0x194);}return _0x5eb1ec;};}function handleError(_0x2af529,_0x28f74e){_0x28f74e=_0x28f74e||0x1f4;return function(_0x14b7e5){logger['error'](_0x14b7e5[_0x33a2('0x26')]);if(_0x14b7e5[_0x33a2('0x27')]){delete _0x14b7e5[_0x33a2('0x27')];}_0x2af529[_0x33a2('0x18')](_0x28f74e)[_0x33a2('0x28')](_0x14b7e5);};}exports[_0x33a2('0x29')]=function(_0x5ec962,_0x38a429){var _0x5db7e3={},_0xfb22de={},_0x4afac5={'count':0x0,'rows':[]};var _0x11381b=_[_0x33a2('0x2a')](db[_0x33a2('0x2b')][_0x33a2('0x2c')],function(_0x55f6bb){return{'name':_0x55f6bb['fieldName'],'type':_0x55f6bb['type']['key']};});_0xfb22de[_0x33a2('0x2d')]=_[_0x33a2('0x2a')](_0x11381b,_0x33a2('0x27'));_0xfb22de[_0x33a2('0x2e')]=_[_0x33a2('0x2f')](_0x5ec962[_0x33a2('0x2e')]);_0xfb22de[_0x33a2('0x30')]=_[_0x33a2('0x31')](_0xfb22de[_0x33a2('0x2d')],_0xfb22de[_0x33a2('0x2e')]);_0x5db7e3[_0x33a2('0x32')]=_[_0x33a2('0x31')](_0xfb22de[_0x33a2('0x2d')],qs[_0x33a2('0x33')](_0x5ec962['query'][_0x33a2('0x33')]));_0x5db7e3[_0x33a2('0x32')]=_0x5db7e3[_0x33a2('0x32')][_0x33a2('0x34')]?_0x5db7e3[_0x33a2('0x32')]:_0xfb22de['model'];if(!_0x5ec962[_0x33a2('0x2e')][_0x33a2('0x35')]('nolimit')){_0x5db7e3[_0x33a2('0x1b')]=qs[_0x33a2('0x1b')](_0x5ec962[_0x33a2('0x2e')][_0x33a2('0x1b')]);_0x5db7e3['offset']=qs[_0x33a2('0x1a')](_0x5ec962[_0x33a2('0x2e')]['offset']);}_0x5db7e3['order']=qs[_0x33a2('0x36')](_0x5ec962[_0x33a2('0x2e')][_0x33a2('0x36')]);_0x5db7e3[_0x33a2('0x37')]=qs[_0x33a2('0x30')](_['pick'](_0x5ec962['query'],_0xfb22de[_0x33a2('0x30')]),_0x11381b);if(_0x5ec962[_0x33a2('0x2e')][_0x33a2('0x38')]){_0x5db7e3[_0x33a2('0x37')]=_[_0x33a2('0x39')](_0x5db7e3[_0x33a2('0x37')],{'$or':_[_0x33a2('0x2a')](_0x11381b,function(_0x344eda){if(_0x344eda['type']!==_0x33a2('0x3a')){var _0x598a9e={};_0x598a9e[_0x344eda[_0x33a2('0x27')]]={'$like':'%'+_0x5ec962[_0x33a2('0x2e')][_0x33a2('0x38')]+'%'};return _0x598a9e;}})});}_0x5db7e3=_[_0x33a2('0x39')]({},_0x5db7e3,_0x5ec962[_0x33a2('0x3b')]);var _0x4f3f5b={'where':_0x5db7e3[_0x33a2('0x37')]};return db[_0x33a2('0x2b')]['count'](_0x4f3f5b)[_0x33a2('0x22')](function(_0x451a78){_0x4afac5[_0x33a2('0x1c')]=_0x451a78;if(_0x5ec962[_0x33a2('0x2e')]['includeAll']){_0x5db7e3['include']=[{'all':!![]}];}return db[_0x33a2('0x2b')][_0x33a2('0x3c')](_0x5db7e3);})[_0x33a2('0x22')](function(_0x47ebf7){_0x4afac5[_0x33a2('0x3d')]=_0x47ebf7;return _0x4afac5;})[_0x33a2('0x22')](respondWithFilteredResult(_0x38a429,_0x5db7e3))[_0x33a2('0x3e')](handleError(_0x38a429,null));};exports[_0x33a2('0x3f')]=function(_0x6cba58,_0x1d9d20){var _0x23dc5a={'raw':!![],'where':{'id':_0x6cba58[_0x33a2('0x40')]['id']}},_0xdb5828={};_0xdb5828['model']=_[_0x33a2('0x2f')](db['CmContactHasItem'][_0x33a2('0x2c')]);_0xdb5828['query']=_[_0x33a2('0x2f')](_0x6cba58['query']);_0xdb5828['filters']=_['intersection'](_0xdb5828[_0x33a2('0x2d')],_0xdb5828[_0x33a2('0x2e')]);_0x23dc5a[_0x33a2('0x32')]=_[_0x33a2('0x31')](_0xdb5828[_0x33a2('0x2d')],qs[_0x33a2('0x33')](_0x6cba58[_0x33a2('0x2e')][_0x33a2('0x33')]));_0x23dc5a[_0x33a2('0x32')]=_0x23dc5a[_0x33a2('0x32')][_0x33a2('0x34')]?_0x23dc5a[_0x33a2('0x32')]:_0xdb5828['model'];if(_0x6cba58[_0x33a2('0x2e')][_0x33a2('0x41')]){_0x23dc5a[_0x33a2('0x42')]=[{'all':!![]}];}_0x23dc5a=_['merge']({},_0x23dc5a,_0x6cba58['options']);return db[_0x33a2('0x2b')][_0x33a2('0x43')](_0x23dc5a)[_0x33a2('0x22')](handleEntityNotFound(_0x1d9d20,null))[_0x33a2('0x22')](respondWithResult(_0x1d9d20,null))[_0x33a2('0x3e')](handleError(_0x1d9d20,null));};exports[_0x33a2('0x44')]=function(_0x4a097c,_0x42717f){return db['CmContactHasItem'][_0x33a2('0x44')](_0x4a097c[_0x33a2('0x45')],{})['then'](function(_0x58f2fa){var _0x2d7f27=_0x4a097c[_0x33a2('0x46')][_0x33a2('0x24')]({'plain':!![]});if(!_0x2d7f27)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d7f27[_0x33a2('0x47')]===_0x33a2('0x46')){var _0x3f51ae=_0x58f2fa[_0x33a2('0x24')]({'plain':!![]});var _0x465ba1=_0x33a2('0x25');return db[_0x33a2('0x48')][_0x33a2('0x43')]({'where':{'name':_0x465ba1,'userProfileId':_0x2d7f27[_0x33a2('0x49')]},'raw':!![]})[_0x33a2('0x22')](function(_0x1b38d3){if(_0x1b38d3&&_0x1b38d3[_0x33a2('0x4a')]===0x0){return db['UserProfileResource'][_0x33a2('0x44')]({'name':_0x3f51ae[_0x33a2('0x27')],'resourceId':_0x3f51ae['id'],'type':_0x1b38d3[_0x33a2('0x27')],'sectionId':_0x1b38d3['id']},{})[_0x33a2('0x22')](function(){return _0x58f2fa;});}else{return _0x58f2fa;}})[_0x33a2('0x3e')](function(_0x301535){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x301535);throw _0x301535;});}return _0x58f2fa;})['then'](respondWithResult(_0x42717f,0xc9))['catch'](handleError(_0x42717f,null));};exports[_0x33a2('0x4b')]=function(_0x34e616,_0x2f56e8){if(_0x34e616[_0x33a2('0x45')]['id']){delete _0x34e616[_0x33a2('0x45')]['id'];}return db[_0x33a2('0x2b')]['find']({'where':{'id':_0x34e616['params']['id']}})['then'](handleEntityNotFound(_0x2f56e8,null))['then'](saveUpdates(_0x34e616['body'],null))[_0x33a2('0x22')](respondWithResult(_0x2f56e8,null))[_0x33a2('0x3e')](handleError(_0x2f56e8,null));};exports[_0x33a2('0x23')]=function(_0xf46bb5,_0x4a3151){return db['CmContactHasItem'][_0x33a2('0x43')]({'where':{'id':_0xf46bb5[_0x33a2('0x40')]['id']}})[_0x33a2('0x22')](handleEntityNotFound(_0x4a3151,null))['then'](removeEntity(_0x4a3151,null))[_0x33a2('0x3e')](handleError(_0x4a3151,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index e740afe..f09ab65 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45a6=['../../config/logger','api','request-promise','path','../../config/environment','./cmContactHasItem.attributes','exports','CmContactHasItem','cm_contact_has_items','lodash','util'];(function(_0x1e8854,_0x54be63){var _0xdbb377=function(_0x3dbf3b){while(--_0x3dbf3b){_0x1e8854['push'](_0x1e8854['shift']());}};_0xdbb377(++_0x54be63);}(_0x45a6,0xfb));var _0x645a=function(_0x4d5c99,_0x31fa6a){_0x4d5c99=_0x4d5c99-0x0;var _0x13e254=_0x45a6[_0x4d5c99];return _0x13e254;};'use strict';var _=require(_0x645a('0x0'));var util=require(_0x645a('0x1'));var logger=require(_0x645a('0x2'))(_0x645a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x645a('0x4'));var fs=require('fs');var path=require(_0x645a('0x5'));var rimraf=require('rimraf');var config=require(_0x645a('0x6'));var attributes=require(_0x645a('0x7'));module[_0x645a('0x8')]=function(_0x11ee3b,_0x5e9775){return _0x11ee3b['define'](_0x645a('0x9'),attributes,{'tableName':_0x645a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b6a=['./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x286243,_0x1118af){var _0x4c5212=function(_0x1c99a6){while(--_0x1c99a6){_0x286243['push'](_0x286243['shift']());}};_0x4c5212(++_0x1118af);}(_0x9b6a,0x10d));var _0xa9b6=function(_0x519ee1,_0x3aab5c){_0x519ee1=_0x519ee1-0x0;var _0x101c5a=_0x9b6a[_0x519ee1];return _0x101c5a;};'use strict';var _=require(_0xa9b6('0x0'));var util=require(_0xa9b6('0x1'));var logger=require('../../config/logger')(_0xa9b6('0x2'));var moment=require(_0xa9b6('0x3'));var BPromise=require(_0xa9b6('0x4'));var rp=require(_0xa9b6('0x5'));var fs=require('fs');var path=require(_0xa9b6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa9b6('0x7'));module[_0xa9b6('0x8')]=function(_0x49b2f6,_0xe1a0f0){return _0x49b2f6[_0xa9b6('0x9')](_0xa9b6('0xa'),attributes,{'tableName':_0xa9b6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 23e8ded..7838e1a 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd445=['stringify','error','CmContactHasItem,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s'];(function(_0x36c686,_0x2d83fa){var _0xc10915=function(_0x147aec){while(--_0x147aec){_0x36c686['push'](_0x36c686['shift']());}};_0xc10915(++_0x2d83fa);}(_0xd445,0x167));var _0x5d44=function(_0x179bd9,_0x1d5672){_0x179bd9=_0x179bd9-0x0;var _0x2d608d=_0xd445[_0x179bd9];return _0x2d608d;};'use strict';var _=require(_0x5d44('0x0'));var util=require(_0x5d44('0x1'));var moment=require('moment');var BPromise=require(_0x5d44('0x2'));var rs=require(_0x5d44('0x3'));var fs=require('fs');var Redis=require(_0x5d44('0x4'));var db=require(_0x5d44('0x5'))['db'];var utils=require(_0x5d44('0x6'));var logger=require(_0x5d44('0x7'))(_0x5d44('0x8'));var config=require('../../config/environment');var jayson=require(_0x5d44('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1dbfc5,_0x405f56,_0x21ad4f){return new BPromise(function(_0x19bed1,_0x5a5e83){return client[_0x5d44('0xa')](_0x1dbfc5,_0x21ad4f)[_0x5d44('0xb')](function(_0x3f8acb){logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x405f56,_0x5d44('0xc'));logger[_0x5d44('0xd')](_0x5d44('0xe'),_0x405f56,_0x5d44('0xc'),JSON[_0x5d44('0xf')](_0x3f8acb));if(_0x3f8acb[_0x5d44('0x10')]){if(_0x3f8acb['error']['code']===0x1f4){logger[_0x5d44('0x10')](_0x5d44('0x11'),_0x405f56,_0x3f8acb[_0x5d44('0x10')]['message']);return _0x5a5e83(_0x3f8acb['error'][_0x5d44('0x12')]);}logger['error'](_0x5d44('0x11'),_0x405f56,_0x3f8acb[_0x5d44('0x10')][_0x5d44('0x12')]);return _0x19bed1(_0x3f8acb[_0x5d44('0x10')][_0x5d44('0x12')]);}else{logger[_0x5d44('0x13')]('CmContactHasItem,\x20%s,\x20%s',_0x405f56,'request\x20sent');_0x19bed1(_0x3f8acb[_0x5d44('0x14')][_0x5d44('0x12')]);}})[_0x5d44('0x15')](function(_0x2c1918){logger[_0x5d44('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x405f56,_0x2c1918);_0x5a5e83(_0x2c1918);});});} \ No newline at end of file +var _0x9e3d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','error','code','CmContactHasItem,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x1e0ff0,_0xa596fd){var _0x1a9571=function(_0x455d5f){while(--_0x455d5f){_0x1e0ff0['push'](_0x1e0ff0['shift']());}};_0x1a9571(++_0xa596fd);}(_0x9e3d,0x16b));var _0xd9e3=function(_0x5699ab,_0x2748c9){_0x5699ab=_0x5699ab-0x0;var _0x41ee55=_0x9e3d[_0x5699ab];return _0x41ee55;};'use strict';var _=require(_0xd9e3('0x0'));var util=require(_0xd9e3('0x1'));var moment=require('moment');var BPromise=require(_0xd9e3('0x2'));var rs=require(_0xd9e3('0x3'));var fs=require('fs');var Redis=require(_0xd9e3('0x4'));var db=require(_0xd9e3('0x5'))['db'];var utils=require(_0xd9e3('0x6'));var logger=require(_0xd9e3('0x7'))(_0xd9e3('0x8'));var config=require(_0xd9e3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd9e3('0xa')][_0xd9e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ca640,_0x2245f6,_0x4118fd){return new BPromise(function(_0x55652c,_0x115189){return client[_0xd9e3('0xc')](_0x4ca640,_0x4118fd)[_0xd9e3('0xd')](function(_0xf535c3){logger[_0xd9e3('0xe')]('CmContactHasItem,\x20%s,\x20%s',_0x2245f6,_0xd9e3('0xf'));logger[_0xd9e3('0x10')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x2245f6,_0xd9e3('0xf'),JSON['stringify'](_0xf535c3));if(_0xf535c3[_0xd9e3('0x11')]){if(_0xf535c3[_0xd9e3('0x11')][_0xd9e3('0x12')]===0x1f4){logger[_0xd9e3('0x11')](_0xd9e3('0x13'),_0x2245f6,_0xf535c3[_0xd9e3('0x11')]['message']);return _0x115189(_0xf535c3[_0xd9e3('0x11')][_0xd9e3('0x14')]);}logger['error'](_0xd9e3('0x13'),_0x2245f6,_0xf535c3[_0xd9e3('0x11')]['message']);return _0x55652c(_0xf535c3[_0xd9e3('0x11')][_0xd9e3('0x14')]);}else{logger[_0xd9e3('0xe')]('CmContactHasItem,\x20%s,\x20%s',_0x2245f6,_0xd9e3('0xf'));_0x55652c(_0xf535c3[_0xd9e3('0x15')]['message']);}})[_0xd9e3('0x16')](function(_0x1b6d13){logger['error'](_0xd9e3('0x13'),_0x2245f6,_0x1b6d13);_0x115189(_0x1b6d13);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index ace30fa..4218397 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36b1=['get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','../../components/auth/service','../../config/environment','./cmContactHasItem.controller'];(function(_0x1f1af6,_0x26de84){var _0x516025=function(_0x4e4967){while(--_0x4e4967){_0x1f1af6['push'](_0x1f1af6['shift']());}};_0x516025(++_0x26de84);}(_0x36b1,0x1aa));var _0x136b=function(_0x43bbd7,_0x1fbced){_0x43bbd7=_0x43bbd7-0x0;var _0x229107=_0x36b1[_0x43bbd7];return _0x229107;};'use strict';var multer=require(_0x136b('0x0'));var util=require(_0x136b('0x1'));var path=require(_0x136b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x136b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x136b('0x4'));var controller=require(_0x136b('0x5'));router[_0x136b('0x6')]('/',auth[_0x136b('0x7')](),controller['index']);router[_0x136b('0x6')](_0x136b('0x8'),auth['isAuthenticated'](),controller[_0x136b('0x9')]);router[_0x136b('0xa')]('/',auth[_0x136b('0x7')](),controller[_0x136b('0xb')]);router['put']('/:id',auth[_0x136b('0x7')](),controller[_0x136b('0xc')]);router[_0x136b('0xd')]('/:id',auth[_0x136b('0x7')](),controller[_0x136b('0xe')]);module[_0x136b('0xf')]=router; \ No newline at end of file +var _0xd6de=['get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x38ee7c,_0x2df4be){var _0x52706a=function(_0x9c9cf0){while(--_0x9c9cf0){_0x38ee7c['push'](_0x38ee7c['shift']());}};_0x52706a(++_0x2df4be);}(_0xd6de,0x14a));var _0xed6d=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xd6de[_0x4f9b18];return _0x29f20c;};'use strict';var multer=require(_0xed6d('0x0'));var util=require(_0xed6d('0x1'));var path=require(_0xed6d('0x2'));var timeout=require(_0xed6d('0x3'));var express=require(_0xed6d('0x4'));var router=express[_0xed6d('0x5')]();var fs_extra=require(_0xed6d('0x6'));var auth=require(_0xed6d('0x7'));var interaction=require(_0xed6d('0x8'));var config=require(_0xed6d('0x9'));var controller=require('./cmContactHasItem.controller');router[_0xed6d('0xa')]('/',auth[_0xed6d('0xb')](),controller[_0xed6d('0xc')]);router[_0xed6d('0xa')](_0xed6d('0xd'),auth['isAuthenticated'](),controller[_0xed6d('0xe')]);router[_0xed6d('0xf')]('/',auth['isAuthenticated'](),controller[_0xed6d('0x10')]);router['put'](_0xed6d('0xd'),auth[_0xed6d('0xb')](),controller[_0xed6d('0x11')]);router[_0xed6d('0x12')](_0xed6d('0xd'),auth[_0xed6d('0xb')](),controller[_0xed6d('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index e968f0f..3932bb8 100644 --- a/server/api/cmCustomField/cmCustomField.attributes.js +++ b/server/api/cmCustomField/cmCustomField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x133e=['ENUM','sequelize','lodash','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','long','type','select','parse','values','isArray','BOOLEAN'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x133e,0x1c1));var _0xe133=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0x133e[_0x12bcf7];return _0x2825a;};'use strict';var Sequelize=require(_0xe133('0x0'));var _=require(_0xe133('0x1'));module['exports']={'name':{'type':Sequelize[_0xe133('0x2')],'get':function(_0x4c99d1){return this[_0xe133('0x3')](_0xe133('0x4'));}},'alias':{'type':Sequelize[_0xe133('0x5')],'allowNull':![],'set':function(_0x47ba04){this[_0xe133('0x6')](_0xe133('0x4'),_0x47ba04?_0x47ba04:this[_0xe133('0x3')](_0xe133('0x7')));}},'type':{'type':Sequelize[_0xe133('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xe133('0x8')),'get':function(){if(this[_0xe133('0x3')](_0xe133('0x9'))===_0xe133('0xa')){return JSON[_0xe133('0xb')](this[_0xe133('0x3')](_0xe133('0xc')));}else{return this[_0xe133('0x3')](_0xe133('0xc'));}},'set':function(_0xf31a7c){if(Array[_0xe133('0xd')](_0xf31a7c)){this[_0xe133('0x6')](_0xe133('0xc'),JSON['stringify'](_0xf31a7c));}else{this['setDataValue'](_0xe133('0xc'),_0xf31a7c);}}},'required':{'type':Sequelize[_0xe133('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xe133('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xe133('0xf')]('voice')}}; \ No newline at end of file +var _0xa211=['voice','lodash','exports','VIRTUAL','alias','setDataValue','getDataValue','name','TEXT','long','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM'];(function(_0x430129,_0x5946c8){var _0x3aa221=function(_0x40b73a){while(--_0x40b73a){_0x430129['push'](_0x430129['shift']());}};_0x3aa221(++_0x5946c8);}(_0xa211,0x19f));var _0x1a21=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa211[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');var _=require(_0x1a21('0x0'));module[_0x1a21('0x1')]={'name':{'type':Sequelize[_0x1a21('0x2')],'get':function(_0x1b40b5){return this['getDataValue'](_0x1a21('0x3'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0xd177d4){this[_0x1a21('0x4')](_0x1a21('0x3'),_0xd177d4?_0xd177d4:this[_0x1a21('0x5')](_0x1a21('0x6')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x1a21('0x7')](_0x1a21('0x8')),'get':function(){if(this[_0x1a21('0x5')](_0x1a21('0x9'))===_0x1a21('0xa')){return JSON[_0x1a21('0xb')](this[_0x1a21('0x5')](_0x1a21('0xc')));}else{return this[_0x1a21('0x5')](_0x1a21('0xc'));}},'set':function(_0xbf42d4){if(Array[_0x1a21('0xd')](_0xbf42d4)){this[_0x1a21('0x4')](_0x1a21('0xc'),JSON[_0x1a21('0xe')](_0xbf42d4));}else{this[_0x1a21('0x4')]('values',_0xbf42d4);}}},'required':{'type':Sequelize[_0x1a21('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x1a21('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x1a21('0x10')](_0x1a21('0x11'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index a6fb7fe..65fb635 100644 --- a/server/api/cmCustomField/cmCustomField.controller.js +++ b/server/api/cmCustomField/cmCustomField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4707=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','body','transaction','create','TEXT','text','number','Sequelize','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','model','differenceBy','filters','intersection','query','attributes'];(function(_0x29586f,_0x2c49b6){var _0x3cc6ab=function(_0xb62915){while(--_0xb62915){_0x29586f['push'](_0x29586f['shift']());}};_0x3cc6ab(++_0x2c49b6);}(_0x4707,0x80));var _0x7470=function(_0x2f8ad2,_0x2482ca){_0x2f8ad2=_0x2f8ad2-0x0;var _0x3e6483=_0x4707[_0x2f8ad2];return _0x3e6483;};'use strict';var emlformat=require(_0x7470('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7470('0x1'));var jsonpatch=require(_0x7470('0x2'));var rp=require(_0x7470('0x3'));var moment=require(_0x7470('0x4'));var BPromise=require(_0x7470('0x5'));var Mustache=require(_0x7470('0x6'));var util=require(_0x7470('0x7'));var path=require(_0x7470('0x8'));var sox=require(_0x7470('0x9'));var csv=require(_0x7470('0xa'));var ejs=require(_0x7470('0xb'));var fs=require('fs');var fs_extra=require(_0x7470('0xc'));var _=require('lodash');var squel=require(_0x7470('0xd'));var crypto=require(_0x7470('0xe'));var jsforce=require(_0x7470('0xf'));var deskjs=require(_0x7470('0x10'));var toCsv=require(_0x7470('0xa'));var querystring=require(_0x7470('0x11'));var Papa=require(_0x7470('0x12'));var Redis=require(_0x7470('0x13'));var authService=require(_0x7470('0x14'));var qs=require(_0x7470('0x15'));var as=require(_0x7470('0x16'));var hardwareService=require(_0x7470('0x17'));var logger=require(_0x7470('0x18'))(_0x7470('0x19'));var utils=require('../../config/utils');var config=require(_0x7470('0x1a'));var licenseUtil=require(_0x7470('0x1b'));var db=require(_0x7470('0x1c'))['db'];function respondWithStatusCode(_0x48ba6d,_0x35ebfd){_0x35ebfd=_0x35ebfd||0xcc;return function(_0x2cfe49){if(_0x2cfe49){return _0x48ba6d[_0x7470('0x1d')](_0x35ebfd);}return _0x48ba6d[_0x7470('0x1e')](_0x35ebfd)[_0x7470('0x1f')]();};}function respondWithResult(_0x1fe136,_0x32f4fc){_0x32f4fc=_0x32f4fc||0xc8;return function(_0x5aa58a){if(_0x5aa58a){return _0x1fe136[_0x7470('0x1e')](_0x32f4fc)[_0x7470('0x20')](_0x5aa58a);}};}function respondWithFilteredResult(_0x3834eb,_0x261318){return function(_0x9d1b59){if(_0x9d1b59){var _0xae8681=typeof _0x261318[_0x7470('0x21')]==='undefined'&&typeof _0x261318[_0x7470('0x22')]===_0x7470('0x23');var _0x58e370=_0x9d1b59[_0x7470('0x24')];var _0x282b0e=_0xae8681?0x0:_0x261318['offset'];var _0x535108=_0xae8681?_0x9d1b59[_0x7470('0x24')]:_0x261318[_0x7470('0x21')]+_0x261318[_0x7470('0x22')];var _0x1fe16e;if(_0x535108>=_0x58e370){_0x535108=_0x58e370;_0x1fe16e=0xc8;}else{_0x1fe16e=0xce;}_0x3834eb[_0x7470('0x1e')](_0x1fe16e);return _0x3834eb[_0x7470('0x25')](_0x7470('0x26'),_0x282b0e+'-'+_0x535108+'/'+_0x58e370)['json'](_0x9d1b59);}return null;};}function patchUpdates(_0x52e4ac){return function(_0x4ffb13){try{jsonpatch[_0x7470('0x27')](_0x4ffb13,_0x52e4ac,!![]);}catch(_0x51ff6c){return BPromise[_0x7470('0x28')](_0x51ff6c);}return _0x4ffb13[_0x7470('0x29')]();};}function saveUpdates(_0xf97ceb,_0x3b2183){return function(_0x23a51f){if(_0x23a51f){return _0x23a51f[_0x7470('0x2a')](_0xf97ceb)[_0x7470('0x2b')](function(_0x3cc29a){return _0x3cc29a;});}return null;};}function removeEntity(_0x3b905e,_0x15d196){return function(_0x29faae){if(_0x29faae){return _0x29faae[_0x7470('0x2c')]()[_0x7470('0x2b')](function(){_0x3b905e[_0x7470('0x1e')](0xcc)[_0x7470('0x1f')]();});}};}function handleEntityNotFound(_0x4b459b,_0x99d771){return function(_0x451963){if(!_0x451963){_0x4b459b[_0x7470('0x1d')](0x194);}return _0x451963;};}function handleError(_0x5a8b57,_0x26ef2c){_0x26ef2c=_0x26ef2c||0x1f4;return function(_0x270ec0){logger[_0x7470('0x2d')](_0x270ec0[_0x7470('0x2e')]);if(_0x270ec0['name']){delete _0x270ec0[_0x7470('0x2f')];}_0x5a8b57[_0x7470('0x1e')](_0x26ef2c)[_0x7470('0x30')](_0x270ec0);};}exports[_0x7470('0x31')]=function(_0x19a7eb,_0x12f67a){var _0x4362a8={},_0x4e2696={},_0x16bee4={'count':0x0,'rows':[]};var _0x1d44e4=_[_0x7470('0x32')](db[_0x7470('0x33')][_0x7470('0x34')],function(_0x3b8125){return{'name':_0x3b8125[_0x7470('0x35')],'type':_0x3b8125['type']['key']};});_0x4e2696[_0x7470('0x36')]=_[_0x7470('0x37')](_[_0x7470('0x32')](_0x1d44e4,'name'),[_0x7470('0x2f')]);_0x4e2696['query']=_['keys'](_0x19a7eb['query']);_0x4e2696[_0x7470('0x38')]=_[_0x7470('0x39')](_0x4e2696[_0x7470('0x36')],_0x4e2696[_0x7470('0x3a')]);_0x4362a8[_0x7470('0x3b')]=_[_0x7470('0x39')](_0x4e2696['model'],qs[_0x7470('0x3c')](_0x19a7eb[_0x7470('0x3a')][_0x7470('0x3c')]));_0x4362a8[_0x7470('0x3b')]=_0x4362a8[_0x7470('0x3b')][_0x7470('0x3d')]?_0x4362a8[_0x7470('0x3b')]:_0x4e2696['model'];if(!_0x19a7eb[_0x7470('0x3a')][_0x7470('0x3e')](_0x7470('0x3f'))){_0x4362a8[_0x7470('0x22')]=qs[_0x7470('0x22')](_0x19a7eb[_0x7470('0x3a')][_0x7470('0x22')]);_0x4362a8['offset']=qs['offset'](_0x19a7eb[_0x7470('0x3a')]['offset']);}_0x4362a8[_0x7470('0x40')]=qs['sort'](_0x19a7eb[_0x7470('0x3a')][_0x7470('0x41')]);_0x4362a8[_0x7470('0x42')]=qs[_0x7470('0x38')](_[_0x7470('0x43')](_0x19a7eb['query'],_0x4e2696[_0x7470('0x38')]),_0x1d44e4);if(_0x19a7eb[_0x7470('0x3a')]['filter']){_0x4362a8['where']=_[_0x7470('0x44')](_0x4362a8['where'],{'$or':_[_0x7470('0x32')](_0x1d44e4,function(_0x26cc8b){if(_0x26cc8b[_0x7470('0x45')]!==_0x7470('0x46')){var _0x40e5db={};_0x40e5db[_0x26cc8b[_0x7470('0x2f')]]={'$like':'%'+_0x19a7eb[_0x7470('0x3a')]['filter']+'%'};return _0x40e5db;}})});}_0x4362a8=_[_0x7470('0x44')]({},_0x4362a8,_0x19a7eb[_0x7470('0x47')]);var _0x29a7f1={'where':_0x4362a8['where']};return db[_0x7470('0x33')][_0x7470('0x24')](_0x29a7f1)[_0x7470('0x2b')](function(_0x1129ee){_0x16bee4[_0x7470('0x24')]=_0x1129ee;if(_0x19a7eb['query'][_0x7470('0x48')]){_0x4362a8[_0x7470('0x49')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x4362a8);})[_0x7470('0x2b')](function(_0x1199cd){_0x16bee4[_0x7470('0x4a')]=_0x1199cd;return _0x16bee4;})[_0x7470('0x2b')](respondWithFilteredResult(_0x12f67a,_0x4362a8))[_0x7470('0x4b')](handleError(_0x12f67a,null));};exports[_0x7470('0x4c')]=function(_0x18a6a0,_0x1f26e3){var _0x4e237f={'raw':!![],'where':{'id':_0x18a6a0[_0x7470('0x4d')]['id']}},_0x339de7={};_0x339de7[_0x7470('0x36')]=_['keys'](db['CmCustomField'][_0x7470('0x34')]);_0x339de7['query']=_[_0x7470('0x4e')](_0x18a6a0['query']);_0x339de7['filters']=_[_0x7470('0x39')](_0x339de7[_0x7470('0x36')],_0x339de7[_0x7470('0x3a')]);_0x4e237f['attributes']=_['intersection'](_0x339de7[_0x7470('0x36')],qs[_0x7470('0x3c')](_0x18a6a0['query'][_0x7470('0x3c')]));_0x4e237f['attributes']=_0x4e237f['attributes'][_0x7470('0x3d')]?_0x4e237f[_0x7470('0x3b')]:_0x339de7[_0x7470('0x36')];if(_0x18a6a0[_0x7470('0x3a')][_0x7470('0x48')]){_0x4e237f['include']=[{'all':!![]}];}_0x4e237f=_[_0x7470('0x44')]({},_0x4e237f,_0x18a6a0[_0x7470('0x47')]);return db['CmCustomField'][_0x7470('0x4f')](_0x4e237f)[_0x7470('0x2b')](handleEntityNotFound(_0x1f26e3,null))[_0x7470('0x2b')](respondWithResult(_0x1f26e3,null))[_0x7470('0x4b')](handleError(_0x1f26e3,null));};exports[_0x7470('0x2a')]=function(_0x847c0f,_0x5a07ae){if(_0x847c0f[_0x7470('0x50')]['id']){delete _0x847c0f[_0x7470('0x50')]['id'];}return db['CmCustomField'][_0x7470('0x4f')]({'where':{'id':_0x847c0f[_0x7470('0x4d')]['id']}})[_0x7470('0x2b')](handleEntityNotFound(_0x5a07ae,null))[_0x7470('0x2b')](saveUpdates(_0x847c0f[_0x7470('0x50')],null))[_0x7470('0x2b')](respondWithResult(_0x5a07ae,null))[_0x7470('0x4b')](handleError(_0x5a07ae,null));};exports[_0x7470('0x2c')]=function(_0x3486c7,_0x5e39c4){return db['CmCustomField'][_0x7470('0x4f')]({'where':{'id':_0x3486c7[_0x7470('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5e39c4,null))['then'](removeEntity(_0x5e39c4,null))['catch'](handleError(_0x5e39c4,null));};exports['create']=function(_0x5823e9,_0x2a0328){var _0x17f907;return db['sequelize'][_0x7470('0x51')](function(_0x60c6){return db['CmCustomField'][_0x7470('0x52')](_0x5823e9[_0x7470('0x50')],{'transaction':_0x60c6})[_0x7470('0x2b')](function(_0x5a9355){_0x17f907=_0x5a9355;var _0x524028={'type':db['Sequelize'][_0x7470('0x53')],'transaction':_0x60c6};switch(_0x5823e9[_0x7470('0x50')][_0x7470('0x45')]){case _0x7470('0x54'):_0x524028[_0x7470('0x45')]=db['Sequelize'][_0x7470('0x53')];break;case _0x7470('0x55'):_0x524028[_0x7470('0x45')]=db[_0x7470('0x56')][_0x7470('0x57')];break;case'switch':_0x524028[_0x7470('0x45')]=db[_0x7470('0x56')][_0x7470('0x58')];_0x524028[_0x7470('0x59')]=![];break;default:}return db[_0x7470('0x5a')][_0x7470('0x5b')][_0x7470('0x5c')](_0x7470('0x5d'),util['format']('cf_%d',_0x17f907['id']),_0x524028);})[_0x7470('0x2b')](function(){return _0x17f907;});})[_0x7470('0x2b')](respondWithResult(_0x2a0328,0xc9))[_0x7470('0x4b')](handleError(_0x2a0328,null));}; \ No newline at end of file +var _0x559c=['cm_contacts','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../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','reject','update','then','destroy','sendStatus','error','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','length','find','body','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn'];(function(_0x117968,_0x25b1e2){var _0x39f3b2=function(_0x2ad8f4){while(--_0x2ad8f4){_0x117968['push'](_0x117968['shift']());}};_0x39f3b2(++_0x25b1e2);}(_0x559c,0x166));var _0xc559=function(_0x2a75cd,_0x247962){_0x2a75cd=_0x2a75cd-0x0;var _0x2319bc=_0x559c[_0x2a75cd];return _0x2319bc;};'use strict';var emlformat=require(_0xc559('0x0'));var rimraf=require(_0xc559('0x1'));var zipdir=require(_0xc559('0x2'));var jsonpatch=require(_0xc559('0x3'));var rp=require(_0xc559('0x4'));var moment=require(_0xc559('0x5'));var BPromise=require(_0xc559('0x6'));var Mustache=require(_0xc559('0x7'));var util=require(_0xc559('0x8'));var path=require('path');var sox=require(_0xc559('0x9'));var csv=require(_0xc559('0xa'));var ejs=require(_0xc559('0xb'));var fs=require('fs');var fs_extra=require(_0xc559('0xc'));var _=require('lodash');var squel=require(_0xc559('0xd'));var crypto=require(_0xc559('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc559('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc559('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc559('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc559('0x12'));var hardwareService=require(_0xc559('0x13'));var logger=require(_0xc559('0x14'))(_0xc559('0x15'));var utils=require(_0xc559('0x16'));var config=require(_0xc559('0x17'));var licenseUtil=require(_0xc559('0x18'));var db=require(_0xc559('0x19'))['db'];function respondWithStatusCode(_0x3e31bb,_0x5efb3a){_0x5efb3a=_0x5efb3a||0xcc;return function(_0x411e10){if(_0x411e10){return _0x3e31bb['sendStatus'](_0x5efb3a);}return _0x3e31bb[_0xc559('0x1a')](_0x5efb3a)[_0xc559('0x1b')]();};}function respondWithResult(_0x280932,_0x4985bf){_0x4985bf=_0x4985bf||0xc8;return function(_0x413d92){if(_0x413d92){return _0x280932[_0xc559('0x1a')](_0x4985bf)[_0xc559('0x1c')](_0x413d92);}};}function respondWithFilteredResult(_0x50c5a0,_0x49b9a6){return function(_0x388105){if(_0x388105){var _0xc8b6c5=typeof _0x49b9a6[_0xc559('0x1d')]===_0xc559('0x1e')&&typeof _0x49b9a6[_0xc559('0x1f')]===_0xc559('0x1e');var _0x1085bb=_0x388105[_0xc559('0x20')];var _0xa8a499=_0xc8b6c5?0x0:_0x49b9a6['offset'];var _0x532cdd=_0xc8b6c5?_0x388105[_0xc559('0x20')]:_0x49b9a6[_0xc559('0x1d')]+_0x49b9a6[_0xc559('0x1f')];var _0x3d9252;if(_0x532cdd>=_0x1085bb){_0x532cdd=_0x1085bb;_0x3d9252=0xc8;}else{_0x3d9252=0xce;}_0x50c5a0[_0xc559('0x1a')](_0x3d9252);return _0x50c5a0[_0xc559('0x21')](_0xc559('0x22'),_0xa8a499+'-'+_0x532cdd+'/'+_0x1085bb)[_0xc559('0x1c')](_0x388105);}return null;};}function patchUpdates(_0x2afea5){return function(_0x3dcfdd){try{jsonpatch['apply'](_0x3dcfdd,_0x2afea5,!![]);}catch(_0x2588a0){return BPromise[_0xc559('0x23')](_0x2588a0);}return _0x3dcfdd['save']();};}function saveUpdates(_0x6f9358,_0x1c8128){return function(_0x46bb0a){if(_0x46bb0a){return _0x46bb0a[_0xc559('0x24')](_0x6f9358)[_0xc559('0x25')](function(_0x347580){return _0x347580;});}return null;};}function removeEntity(_0x3217b7,_0x384078){return function(_0x363c42){if(_0x363c42){return _0x363c42[_0xc559('0x26')]()[_0xc559('0x25')](function(){_0x3217b7[_0xc559('0x1a')](0xcc)[_0xc559('0x1b')]();});}};}function handleEntityNotFound(_0x3d60a8,_0x48dec5){return function(_0x447328){if(!_0x447328){_0x3d60a8[_0xc559('0x27')](0x194);}return _0x447328;};}function handleError(_0x49f120,_0x20dcc1){_0x20dcc1=_0x20dcc1||0x1f4;return function(_0x3e7fe7){logger[_0xc559('0x28')](_0x3e7fe7['stack']);if(_0x3e7fe7['name']){delete _0x3e7fe7[_0xc559('0x29')];}_0x49f120['status'](_0x20dcc1)[_0xc559('0x2a')](_0x3e7fe7);};}exports[_0xc559('0x2b')]=function(_0x4ae753,_0x144597){var _0x1d4c02={},_0x4048db={},_0x56ccd9={'count':0x0,'rows':[]};var _0x519077=_[_0xc559('0x2c')](db[_0xc559('0x2d')][_0xc559('0x2e')],function(_0x43b23c){return{'name':_0x43b23c[_0xc559('0x2f')],'type':_0x43b23c[_0xc559('0x30')][_0xc559('0x31')]};});_0x4048db[_0xc559('0x32')]=_[_0xc559('0x33')](_[_0xc559('0x2c')](_0x519077,_0xc559('0x29')),['name']);_0x4048db[_0xc559('0x34')]=_[_0xc559('0x35')](_0x4ae753[_0xc559('0x34')]);_0x4048db[_0xc559('0x36')]=_[_0xc559('0x37')](_0x4048db['model'],_0x4048db[_0xc559('0x34')]);_0x1d4c02['attributes']=_[_0xc559('0x37')](_0x4048db[_0xc559('0x32')],qs[_0xc559('0x38')](_0x4ae753[_0xc559('0x34')][_0xc559('0x38')]));_0x1d4c02[_0xc559('0x39')]=_0x1d4c02[_0xc559('0x39')]['length']?_0x1d4c02[_0xc559('0x39')]:_0x4048db[_0xc559('0x32')];if(!_0x4ae753[_0xc559('0x34')]['hasOwnProperty'](_0xc559('0x3a'))){_0x1d4c02[_0xc559('0x1f')]=qs[_0xc559('0x1f')](_0x4ae753[_0xc559('0x34')]['limit']);_0x1d4c02[_0xc559('0x1d')]=qs[_0xc559('0x1d')](_0x4ae753[_0xc559('0x34')][_0xc559('0x1d')]);}_0x1d4c02[_0xc559('0x3b')]=qs[_0xc559('0x3c')](_0x4ae753['query'][_0xc559('0x3c')]);_0x1d4c02[_0xc559('0x3d')]=qs[_0xc559('0x36')](_[_0xc559('0x3e')](_0x4ae753[_0xc559('0x34')],_0x4048db['filters']),_0x519077);if(_0x4ae753[_0xc559('0x34')]['filter']){_0x1d4c02[_0xc559('0x3d')]=_[_0xc559('0x3f')](_0x1d4c02[_0xc559('0x3d')],{'$or':_[_0xc559('0x2c')](_0x519077,function(_0x323b49){if(_0x323b49['type']!==_0xc559('0x40')){var _0x171aa2={};_0x171aa2[_0x323b49[_0xc559('0x29')]]={'$like':'%'+_0x4ae753['query'][_0xc559('0x41')]+'%'};return _0x171aa2;}})});}_0x1d4c02=_['merge']({},_0x1d4c02,_0x4ae753[_0xc559('0x42')]);var _0x3f4ca4={'where':_0x1d4c02[_0xc559('0x3d')]};return db[_0xc559('0x2d')][_0xc559('0x20')](_0x3f4ca4)[_0xc559('0x25')](function(_0x15831b){_0x56ccd9[_0xc559('0x20')]=_0x15831b;if(_0x4ae753[_0xc559('0x34')][_0xc559('0x43')]){_0x1d4c02[_0xc559('0x44')]=[{'all':!![]}];}return db[_0xc559('0x2d')]['findAll'](_0x1d4c02);})['then'](function(_0x624911){_0x56ccd9[_0xc559('0x45')]=_0x624911;return _0x56ccd9;})[_0xc559('0x25')](respondWithFilteredResult(_0x144597,_0x1d4c02))[_0xc559('0x46')](handleError(_0x144597,null));};exports['show']=function(_0x465a16,_0x49a9c4){var _0x49a443={'raw':!![],'where':{'id':_0x465a16[_0xc559('0x47')]['id']}},_0x469d8={};_0x469d8[_0xc559('0x32')]=_['keys'](db[_0xc559('0x2d')]['rawAttributes']);_0x469d8[_0xc559('0x34')]=_[_0xc559('0x35')](_0x465a16[_0xc559('0x34')]);_0x469d8[_0xc559('0x36')]=_['intersection'](_0x469d8[_0xc559('0x32')],_0x469d8[_0xc559('0x34')]);_0x49a443['attributes']=_[_0xc559('0x37')](_0x469d8[_0xc559('0x32')],qs[_0xc559('0x38')](_0x465a16[_0xc559('0x34')][_0xc559('0x38')]));_0x49a443[_0xc559('0x39')]=_0x49a443[_0xc559('0x39')][_0xc559('0x48')]?_0x49a443[_0xc559('0x39')]:_0x469d8['model'];if(_0x465a16[_0xc559('0x34')][_0xc559('0x43')]){_0x49a443['include']=[{'all':!![]}];}_0x49a443=_[_0xc559('0x3f')]({},_0x49a443,_0x465a16[_0xc559('0x42')]);return db[_0xc559('0x2d')][_0xc559('0x49')](_0x49a443)[_0xc559('0x25')](handleEntityNotFound(_0x49a9c4,null))[_0xc559('0x25')](respondWithResult(_0x49a9c4,null))[_0xc559('0x46')](handleError(_0x49a9c4,null));};exports[_0xc559('0x24')]=function(_0x3265ef,_0x168eb2){if(_0x3265ef[_0xc559('0x4a')]['id']){delete _0x3265ef[_0xc559('0x4a')]['id'];}return db['CmCustomField'][_0xc559('0x49')]({'where':{'id':_0x3265ef[_0xc559('0x47')]['id']}})[_0xc559('0x25')](handleEntityNotFound(_0x168eb2,null))[_0xc559('0x25')](saveUpdates(_0x3265ef[_0xc559('0x4a')],null))[_0xc559('0x25')](respondWithResult(_0x168eb2,null))[_0xc559('0x46')](handleError(_0x168eb2,null));};exports[_0xc559('0x26')]=function(_0x6d4987,_0x42ee63){return db[_0xc559('0x2d')]['find']({'where':{'id':_0x6d4987[_0xc559('0x47')]['id']}})[_0xc559('0x25')](handleEntityNotFound(_0x42ee63,null))[_0xc559('0x25')](removeEntity(_0x42ee63,null))[_0xc559('0x46')](handleError(_0x42ee63,null));};exports[_0xc559('0x4b')]=function(_0x1b8119,_0x5dc59f){var _0x136052;return db[_0xc559('0x4c')][_0xc559('0x4d')](function(_0x54ff8b){return db['CmCustomField'][_0xc559('0x4b')](_0x1b8119[_0xc559('0x4a')],{'transaction':_0x54ff8b})[_0xc559('0x25')](function(_0x4813e7){_0x136052=_0x4813e7;var _0x41b725={'type':db[_0xc559('0x4e')][_0xc559('0x4f')],'transaction':_0x54ff8b};switch(_0x1b8119[_0xc559('0x4a')]['type']){case _0xc559('0x50'):_0x41b725[_0xc559('0x30')]=db['Sequelize']['TEXT'];break;case _0xc559('0x51'):_0x41b725['type']=db[_0xc559('0x4e')][_0xc559('0x52')];break;case'switch':_0x41b725['type']=db[_0xc559('0x4e')][_0xc559('0x53')];_0x41b725[_0xc559('0x54')]=![];break;default:}return db[_0xc559('0x4c')][_0xc559('0x55')][_0xc559('0x56')](_0xc559('0x57'),util['format'](_0xc559('0x58'),_0x136052['id']),_0x41b725);})['then'](function(){return _0x136052;});})[_0xc559('0x25')](respondWithResult(_0x5dc59f,0xc9))['catch'](handleError(_0x5dc59f,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 1b86940..97a32b9 100644 --- a/server/api/cmCustomField/cmCustomField.model.js +++ b/server/api/cmCustomField/cmCustomField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3021=['rimraf','../../config/environment','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util','../../config/logger','moment','request-promise'];(function(_0x2f353c,_0x1162d6){var _0x12db88=function(_0x569333){while(--_0x569333){_0x2f353c['push'](_0x2f353c['shift']());}};_0x12db88(++_0x1162d6);}(_0x3021,0xf8));var _0x1302=function(_0x5721fb,_0x156210){_0x5721fb=_0x5721fb-0x0;var _0x3fa003=_0x3021[_0x5721fb];return _0x3fa003;};'use strict';var _=require(_0x1302('0x0'));var util=require(_0x1302('0x1'));var logger=require(_0x1302('0x2'))('api');var moment=require(_0x1302('0x3'));var BPromise=require('bluebird');var rp=require(_0x1302('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1302('0x5'));var config=require(_0x1302('0x6'));var attributes=require(_0x1302('0x7'));module[_0x1302('0x8')]=function(_0x17cac9,_0x22ec8a){return _0x17cac9[_0x1302('0x9')]('CmCustomField',attributes,{'tableName':_0x1302('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ae0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields','util','api'];(function(_0x318f48,_0x5e9633){var _0x532d2e=function(_0x12bc3a){while(--_0x12bc3a){_0x318f48['push'](_0x318f48['shift']());}};_0x532d2e(++_0x5e9633);}(_0x3ae0,0x17e));var _0x03ae=function(_0x3304d7,_0x550912){_0x3304d7=_0x3304d7-0x0;var _0x2f6b15=_0x3ae0[_0x3304d7];return _0x2f6b15;};'use strict';var _=require('lodash');var util=require(_0x03ae('0x0'));var logger=require('../../config/logger')(_0x03ae('0x1'));var moment=require(_0x03ae('0x2'));var BPromise=require(_0x03ae('0x3'));var rp=require(_0x03ae('0x4'));var fs=require('fs');var path=require(_0x03ae('0x5'));var rimraf=require(_0x03ae('0x6'));var config=require(_0x03ae('0x7'));var attributes=require(_0x03ae('0x8'));module[_0x03ae('0x9')]=function(_0xf3437d,_0x1cb69c){return _0xf3437d['define'](_0x03ae('0xa'),attributes,{'tableName':_0x03ae('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index ebf6bac..2b9d5a6 100644 --- a/server/api/cmCustomField/cmCustomField.rpc.js +++ b/server/api/cmCustomField/cmCustomField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a1c=['util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x1bc1a9,_0x274638){var _0x4ac617=function(_0x58cf23){while(--_0x58cf23){_0x1bc1a9['push'](_0x1bc1a9['shift']());}};_0x4ac617(++_0x274638);}(_0x7a1c,0x78));var _0xc7a1=function(_0x493665,_0x475fae){_0x493665=_0x493665-0x0;var _0x496f1d=_0x7a1c[_0x493665];return _0x496f1d;};'use strict';var _=require('lodash');var util=require(_0xc7a1('0x0'));var moment=require(_0xc7a1('0x1'));var BPromise=require(_0xc7a1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc7a1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc7a1('0x4'))(_0xc7a1('0x5'));var config=require(_0xc7a1('0x6'));var jayson=require(_0xc7a1('0x7'));var client=jayson[_0xc7a1('0x8')][_0xc7a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52b162,_0x21d8f1,_0x4c11d0){return new BPromise(function(_0x7f53c0,_0x40439a){return client[_0xc7a1('0xa')](_0x52b162,_0x4c11d0)[_0xc7a1('0xb')](function(_0x25a9b4){logger['info'](_0xc7a1('0xc'),_0x21d8f1,_0xc7a1('0xd'));logger[_0xc7a1('0xe')](_0xc7a1('0xf'),_0x21d8f1,_0xc7a1('0xd'),JSON['stringify'](_0x25a9b4));if(_0x25a9b4['error']){if(_0x25a9b4[_0xc7a1('0x10')][_0xc7a1('0x11')]===0x1f4){logger[_0xc7a1('0x10')](_0xc7a1('0xc'),_0x21d8f1,_0x25a9b4[_0xc7a1('0x10')][_0xc7a1('0x12')]);return _0x40439a(_0x25a9b4[_0xc7a1('0x10')][_0xc7a1('0x12')]);}logger[_0xc7a1('0x10')](_0xc7a1('0xc'),_0x21d8f1,_0x25a9b4[_0xc7a1('0x10')][_0xc7a1('0x12')]);return _0x7f53c0(_0x25a9b4[_0xc7a1('0x10')][_0xc7a1('0x12')]);}else{logger['info'](_0xc7a1('0xc'),_0x21d8f1,'request\x20sent');_0x7f53c0(_0x25a9b4['result']['message']);}})[_0xc7a1('0x13')](function(_0x38886d){logger[_0xc7a1('0x10')](_0xc7a1('0xc'),_0x21d8f1,_0x38886d);_0x40439a(_0x38886d);});});} \ No newline at end of file +var _0x5de8=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1a03e2,_0x3e2733){var _0x44e20c=function(_0x3cb863){while(--_0x3cb863){_0x1a03e2['push'](_0x1a03e2['shift']());}};_0x44e20c(++_0x3e2733);}(_0x5de8,0xf7));var _0x85de=function(_0x1c51e2,_0x9d617c){_0x1c51e2=_0x1c51e2-0x0;var _0x508bb0=_0x5de8[_0x1c51e2];return _0x508bb0;};'use strict';var _=require('lodash');var util=require(_0x85de('0x0'));var moment=require(_0x85de('0x1'));var BPromise=require('bluebird');var rs=require(_0x85de('0x2'));var fs=require('fs');var Redis=require(_0x85de('0x3'));var db=require(_0x85de('0x4'))['db'];var utils=require(_0x85de('0x5'));var logger=require(_0x85de('0x6'))(_0x85de('0x7'));var config=require(_0x85de('0x8'));var jayson=require(_0x85de('0x9'));var client=jayson[_0x85de('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x383bea,_0x437691,_0x3b240b){return new BPromise(function(_0x1c55ca,_0x4b40c2){return client[_0x85de('0xb')](_0x383bea,_0x3b240b)['then'](function(_0x569097){logger[_0x85de('0xc')](_0x85de('0xd'),_0x437691,_0x85de('0xe'));logger[_0x85de('0xf')](_0x85de('0x10'),_0x437691,_0x85de('0xe'),JSON[_0x85de('0x11')](_0x569097));if(_0x569097[_0x85de('0x12')]){if(_0x569097[_0x85de('0x12')][_0x85de('0x13')]===0x1f4){logger[_0x85de('0x12')](_0x85de('0xd'),_0x437691,_0x569097[_0x85de('0x12')][_0x85de('0x14')]);return _0x4b40c2(_0x569097['error'][_0x85de('0x14')]);}logger[_0x85de('0x12')](_0x85de('0xd'),_0x437691,_0x569097[_0x85de('0x12')][_0x85de('0x14')]);return _0x1c55ca(_0x569097[_0x85de('0x12')][_0x85de('0x14')]);}else{logger[_0x85de('0xc')](_0x85de('0xd'),_0x437691,_0x85de('0xe'));_0x1c55ca(_0x569097[_0x85de('0x15')][_0x85de('0x14')]);}})[_0x85de('0x16')](function(_0x118cc1){logger[_0x85de('0x12')](_0x85de('0xd'),_0x437691,_0x118cc1);_0x4b40c2(_0x118cc1);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index d1f97fa..b0a1458 100644 --- a/server/api/cmCustomField/index.js +++ b/server/api/cmCustomField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8289=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0xe1a3a5,_0xd3e341){var _0x362646=function(_0xdcef03){while(--_0xdcef03){_0xe1a3a5['push'](_0xe1a3a5['shift']());}};_0x362646(++_0xd3e341);}(_0x8289,0xf8));var _0x9828=function(_0x336579,_0x43e21a){_0x336579=_0x336579-0x0;var _0x41e244=_0x8289[_0x336579];return _0x41e244;};'use strict';var multer=require(_0x9828('0x0'));var util=require(_0x9828('0x1'));var path=require(_0x9828('0x2'));var timeout=require(_0x9828('0x3'));var express=require(_0x9828('0x4'));var router=express[_0x9828('0x5')]();var fs_extra=require(_0x9828('0x6'));var auth=require(_0x9828('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9828('0x8'));var controller=require(_0x9828('0x9'));router[_0x9828('0xa')]('/',auth[_0x9828('0xb')](),controller[_0x9828('0xc')]);router[_0x9828('0xa')](_0x9828('0xd'),auth[_0x9828('0xb')](),controller[_0x9828('0xe')]);router[_0x9828('0xf')]('/',auth[_0x9828('0xb')](),controller[_0x9828('0x10')]);router[_0x9828('0x11')](_0x9828('0xd'),auth[_0x9828('0xb')](),controller[_0x9828('0x12')]);router[_0x9828('0x13')](_0x9828('0xd'),auth[_0x9828('0xb')](),controller['destroy']);module[_0x9828('0x14')]=router; \ No newline at end of file +var _0xb55e=['isAuthenticated','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','index','get','/:id'];(function(_0xba370,_0x8b56f1){var _0x575aa9=function(_0x95be54){while(--_0x95be54){_0xba370['push'](_0xba370['shift']());}};_0x575aa9(++_0x8b56f1);}(_0xb55e,0x106));var _0xeb55=function(_0x4caa44,_0xef800a){_0x4caa44=_0x4caa44-0x0;var _0x40bf7d=_0xb55e[_0x4caa44];return _0x40bf7d;};'use strict';var multer=require(_0xeb55('0x0'));var util=require(_0xeb55('0x1'));var path=require(_0xeb55('0x2'));var timeout=require(_0xeb55('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xeb55('0x4'));var auth=require(_0xeb55('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xeb55('0x6'));var controller=require('./cmCustomField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xeb55('0x7')]);router[_0xeb55('0x8')](_0xeb55('0x9'),auth[_0xeb55('0xa')](),controller[_0xeb55('0xb')]);router[_0xeb55('0xc')]('/',auth[_0xeb55('0xa')](),controller[_0xeb55('0xd')]);router['put']('/:id',auth[_0xeb55('0xa')](),controller[_0xeb55('0xe')]);router['delete'](_0xeb55('0x9'),auth['isAuthenticated'](),controller[_0xeb55('0xf')]);module[_0xeb55('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index e78a014..a520e12 100644 --- a/server/api/cmHopper/cmHopper.attributes.js +++ b/server/api/cmHopper/cmHopper.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2391=['sequelize','STRING','BOOLEAN','DATE','format','INTEGER','contactListQueue','moment'];(function(_0x323582,_0x3fd4b5){var _0xc12c85=function(_0x253653){while(--_0x253653){_0x323582['push'](_0x323582['shift']());}};_0xc12c85(++_0x3fd4b5);}(_0x2391,0xa7));var _0x1239=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x2391[_0x5bd426];return _0x23a7eb;};'use strict';var moment=require(_0x1239('0x0'));var Sequelize=require(_0x1239('0x1'));module['exports']={'phone':{'type':Sequelize[_0x1239('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x1239('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x1239('0x4')],'defaultValue':moment()[_0x1239('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x1239('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1239('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1239('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x1239('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1239('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1239('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x1239('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x1239('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x1239('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x1239('0x6')],'unique':_0x1239('0x7')},'CampaignId':{'type':Sequelize[_0x1239('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x1239('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1239('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1239('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1239('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x1239('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x1239('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x1239('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x5c04=['DATE','UNSIGNED','contactListQueue','moment','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x263e6a,_0x5e7919){var _0x4dc3d4=function(_0x577209){while(--_0x577209){_0x263e6a['push'](_0x263e6a['shift']());}};_0x4dc3d4(++_0x5e7919);}(_0x5c04,0x193));var _0x45c0=function(_0x44cdb7,_0x54961f){_0x44cdb7=_0x44cdb7-0x0;var _0x14c551=_0x5c04[_0x44cdb7];return _0x14c551;};'use strict';var moment=require(_0x45c0('0x0'));var Sequelize=require('sequelize');module[_0x45c0('0x1')]={'phone':{'type':Sequelize[_0x45c0('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x45c0('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x45c0('0x4')](_0x45c0('0x5'))},'countbusyretry':{'type':Sequelize[_0x45c0('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x45c0('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x45c0('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x45c0('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x45c0('0x7')]},'priority':{'type':Sequelize[_0x45c0('0x6')](0x2)[_0x45c0('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x45c0('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x45c0('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x45c0('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x45c0('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x45c0('0x6')],'unique':_0x45c0('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x45c0('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x45c0('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x45c0('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x45c0('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x45c0('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x45c0('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x45c0('0x2')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 0c73e43..f3d95ab 100644 --- a/server/api/cmHopper/cmHopper.controller.js +++ b/server/api/cmHopper/cmHopper.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8b2=['VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','createdAt','state','deleted','campaign','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','getPreview','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','filter','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','literal','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','Company','dialActive','getPreviewRecall','scheduledat','recallme','Contact','CmCompany','List','Queue','getVoiceQueues','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','then','sendStatus','error','stack','name','send','index','CmHopper','fieldName','type','key','model','query','keys','filters','intersection','concat','$and','$or','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$iLike','$notILike','$overlap','$contains','$any','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','update','body','describe','destroy'];(function(_0x2730da,_0x1098bd){var _0xfe9991=function(_0x2ea521){while(--_0x2ea521){_0x2730da['push'](_0x2730da['shift']());}};_0xfe9991(++_0x1098bd);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x178ca4,_0x5aaa16){_0x178ca4=_0x178ca4-0x0;var _0x57f6a8=_0xf8b2[_0x178ca4];return _0x57f6a8;};'use strict';var moment=require(_0x2f8b('0x0'));var _=require(_0x2f8b('0x1'));var qs=require(_0x2f8b('0x2'));var logger=require(_0x2f8b('0x3'))(_0x2f8b('0x4'));var shared=require(_0x2f8b('0x5'));var db=require(_0x2f8b('0x6'))['db'];function respondWithResult(_0x2952c2,_0x50dae3){_0x50dae3=_0x50dae3||0xc8;return function(_0x4b33e9){if(_0x4b33e9){return _0x2952c2[_0x2f8b('0x7')](_0x50dae3)[_0x2f8b('0x8')](_0x4b33e9);}};}function respondWithFilteredResult(_0x3c6838,_0x1d133a){return function(_0x3b0511){if(_0x3b0511){var _0x2cc1e9=typeof _0x1d133a[_0x2f8b('0x9')]===_0x2f8b('0xa')&&typeof _0x1d133a[_0x2f8b('0xb')]==='undefined';var _0xdb9718=_0x3b0511[_0x2f8b('0xc')];var _0x120486=_0x2cc1e9?0x0:_0x1d133a['offset'];var _0x225804=_0x2cc1e9?_0x3b0511[_0x2f8b('0xc')]:_0x1d133a[_0x2f8b('0x9')]+_0x1d133a['limit'];var _0x53cec0;if(_0x225804>=_0xdb9718){_0x225804=_0xdb9718;_0x53cec0=0xc8;}else{_0x53cec0=0xce;}_0x3c6838[_0x2f8b('0x7')](_0x53cec0);return _0x3c6838[_0x2f8b('0xd')](_0x2f8b('0xe'),_0x120486+'-'+_0x225804+'/'+_0xdb9718)[_0x2f8b('0x8')](_0x3b0511);}return null;};}function saveUpdates(_0x175111,_0x4cb1e0){return function(_0x16d5a2){if(_0x16d5a2){return _0x16d5a2['update'](_0x175111)[_0x2f8b('0xf')](function(_0x5e9eb1){return _0x5e9eb1;});}return null;};}function handleEntityNotFound(_0x1b6a17,_0x15634){return function(_0xf9cbe0){if(!_0xf9cbe0){_0x1b6a17[_0x2f8b('0x10')](0x194);}return _0xf9cbe0;};}function handleError(_0xd7dbcd,_0x2b6003){_0x2b6003=_0x2b6003||0x1f4;return function(_0x532fe4){logger[_0x2f8b('0x11')](_0x532fe4[_0x2f8b('0x12')]);if(_0x532fe4[_0x2f8b('0x13')]){delete _0x532fe4[_0x2f8b('0x13')];}_0xd7dbcd[_0x2f8b('0x7')](_0x2b6003)[_0x2f8b('0x14')](_0x532fe4);};}exports[_0x2f8b('0x15')]=function(_0x1fe74a,_0x35ec40){var _0x4aaef4={},_0x23dd63={},_0x2a0a49={'count':0x0,'rows':[]};var _0x35f0ca=_['map'](db[_0x2f8b('0x16')]['rawAttributes'],function(_0x1c455f){return{'name':_0x1c455f[_0x2f8b('0x17')],'type':_0x1c455f[_0x2f8b('0x18')][_0x2f8b('0x19')]};});_0x23dd63[_0x2f8b('0x1a')]=_['map'](_0x35f0ca,_0x2f8b('0x13'));_0x23dd63[_0x2f8b('0x1b')]=_[_0x2f8b('0x1c')](_0x1fe74a[_0x2f8b('0x1b')]);_0x23dd63[_0x2f8b('0x1d')]=_[_0x2f8b('0x1e')](_0x23dd63[_0x2f8b('0x1a')],_0x23dd63['query']);_0x23dd63[_0x2f8b('0x1d')]=_[_0x2f8b('0x1f')](_0x23dd63[_0x2f8b('0x1d')],[_0x2f8b('0x20'),_0x2f8b('0x21'),'$gt',_0x2f8b('0x22'),_0x2f8b('0x23'),_0x2f8b('0x24'),_0x2f8b('0x25'),_0x2f8b('0x26'),_0x2f8b('0x27'),_0x2f8b('0x28'),_0x2f8b('0x29'),_0x2f8b('0x2a'),'$notIn',_0x2f8b('0x2b'),'$notLike',_0x2f8b('0x2c'),_0x2f8b('0x2d'),_0x2f8b('0x2b'),_0x2f8b('0x2e'),_0x2f8b('0x2f'),'$contained',_0x2f8b('0x30')]);_0x4aaef4['attributes']=_['intersection'](_0x23dd63[_0x2f8b('0x1a')],qs[_0x2f8b('0x31')](_0x1fe74a['query'][_0x2f8b('0x31')]));_0x4aaef4[_0x2f8b('0x32')]=_0x4aaef4[_0x2f8b('0x32')][_0x2f8b('0x33')]?_0x4aaef4[_0x2f8b('0x32')]:_0x23dd63[_0x2f8b('0x1a')];if(!_0x1fe74a['query'][_0x2f8b('0x34')](_0x2f8b('0x35'))){_0x4aaef4[_0x2f8b('0xb')]=qs[_0x2f8b('0xb')](_0x1fe74a[_0x2f8b('0x1b')][_0x2f8b('0xb')]);_0x4aaef4[_0x2f8b('0x9')]=qs['offset'](_0x1fe74a[_0x2f8b('0x1b')]['offset']);}_0x4aaef4[_0x2f8b('0x36')]=qs[_0x2f8b('0x37')](_0x1fe74a[_0x2f8b('0x1b')][_0x2f8b('0x37')]);_0x4aaef4[_0x2f8b('0x38')]=qs[_0x2f8b('0x1d')](_[_0x2f8b('0x39')](_0x1fe74a[_0x2f8b('0x1b')],_0x23dd63[_0x2f8b('0x1d')]),_0x35f0ca);if(_0x1fe74a['query']['filter']){_0x4aaef4[_0x2f8b('0x38')]=_[_0x2f8b('0x3a')](_0x4aaef4[_0x2f8b('0x38')],{'$or':_[_0x2f8b('0x3b')](_0x35f0ca,function(_0x5c52ad){if(_0x5c52ad[_0x2f8b('0x18')]!==_0x2f8b('0x3c')){var _0x37676c={};_0x37676c[_0x5c52ad[_0x2f8b('0x13')]]={'$like':'%'+_0x1fe74a[_0x2f8b('0x1b')]['filter']+'%'};return _0x37676c;}})});}_0x4aaef4=_['merge']({},_0x4aaef4,_0x1fe74a[_0x2f8b('0x3d')]);var _0x25c805={'where':_0x4aaef4[_0x2f8b('0x38')]};return db[_0x2f8b('0x16')][_0x2f8b('0xc')](_0x25c805)[_0x2f8b('0xf')](function(_0x2c554d){_0x2a0a49['count']=_0x2c554d;if(_0x1fe74a[_0x2f8b('0x1b')][_0x2f8b('0x3e')]){_0x4aaef4['include']=[{'all':!![]}];}return db[_0x2f8b('0x16')][_0x2f8b('0x3f')](_0x4aaef4);})[_0x2f8b('0xf')](function(_0x4fc170){_0x2a0a49[_0x2f8b('0x40')]=_0x4fc170;return _0x2a0a49;})[_0x2f8b('0xf')](respondWithFilteredResult(_0x35ec40,_0x4aaef4))['catch'](handleError(_0x35ec40,null));};exports[_0x2f8b('0x41')]=function(_0x46a49b,_0x5e8a3e){var _0x92b37a={'raw':!![],'where':{'id':_0x46a49b[_0x2f8b('0x42')]['id']}},_0x57576e={};_0x57576e[_0x2f8b('0x1a')]=_['keys'](db[_0x2f8b('0x16')][_0x2f8b('0x43')]);_0x57576e[_0x2f8b('0x1b')]=_['keys'](_0x46a49b[_0x2f8b('0x1b')]);_0x57576e['filters']=_[_0x2f8b('0x1e')](_0x57576e[_0x2f8b('0x1a')],_0x57576e[_0x2f8b('0x1b')]);_0x92b37a[_0x2f8b('0x32')]=_[_0x2f8b('0x1e')](_0x57576e[_0x2f8b('0x1a')],qs[_0x2f8b('0x31')](_0x46a49b[_0x2f8b('0x1b')][_0x2f8b('0x31')]));_0x92b37a[_0x2f8b('0x32')]=_0x92b37a[_0x2f8b('0x32')][_0x2f8b('0x33')]?_0x92b37a[_0x2f8b('0x32')]:_0x57576e[_0x2f8b('0x1a')];if(_0x46a49b[_0x2f8b('0x1b')][_0x2f8b('0x3e')]){_0x92b37a[_0x2f8b('0x44')]=[{'all':!![]}];}_0x92b37a=_[_0x2f8b('0x3a')]({},_0x92b37a,_0x46a49b[_0x2f8b('0x3d')]);return db[_0x2f8b('0x16')][_0x2f8b('0x45')](_0x92b37a)[_0x2f8b('0xf')](handleEntityNotFound(_0x5e8a3e,null))[_0x2f8b('0xf')](respondWithResult(_0x5e8a3e,null))[_0x2f8b('0x46')](handleError(_0x5e8a3e,null));};exports[_0x2f8b('0x47')]=function(_0x564b81,_0x4a8a89){return db['CmHopper'][_0x2f8b('0x47')](_0x564b81['body'],{})[_0x2f8b('0xf')](respondWithResult(_0x4a8a89,0xc9))[_0x2f8b('0x46')](handleError(_0x4a8a89,null));};exports[_0x2f8b('0x48')]=function(_0x5f0a8d,_0x98b96){if(_0x5f0a8d['body']['id']){delete _0x5f0a8d[_0x2f8b('0x49')]['id'];}return db['CmHopper'][_0x2f8b('0x45')]({'where':{'id':_0x5f0a8d[_0x2f8b('0x42')]['id']}})['then'](handleEntityNotFound(_0x98b96,null))[_0x2f8b('0xf')](saveUpdates(_0x5f0a8d[_0x2f8b('0x49')],null))[_0x2f8b('0xf')](respondWithResult(_0x98b96,null))[_0x2f8b('0x46')](handleError(_0x98b96,null));};exports[_0x2f8b('0x4a')]=function(_0x465d59,_0xd9b1d1){return db[_0x2f8b('0x16')][_0x2f8b('0x4a')]()['then'](respondWithResult(_0xd9b1d1,null))[_0x2f8b('0x46')](handleError(_0xd9b1d1,null));};exports[_0x2f8b('0x4b')]=function(_0x2d79f9,_0x1bb257){var _0x14e50e;var _0x487c81=_0x2d79f9[_0x2f8b('0x42')]['id'];return db[_0x2f8b('0x16')][_0x2f8b('0x45')]({'where':{'id':_0x2d79f9['params']['id']}})[_0x2f8b('0xf')](handleEntityNotFound(_0x1bb257,null))['then'](function(_0x26dfb1){if(_0x26dfb1){return _0x26dfb1[_0x2f8b('0x4b')]()[_0x2f8b('0xf')](function(_0x3a25bb){return _0x3a25bb;});}})[_0x2f8b('0xf')](function(_0x5b181f){_0x14e50e=_0x5b181f;if(_0x5b181f){if(_0x5b181f['VoiceQueueId']||_0x5b181f['CampaignId']){return db[_0x5b181f[_0x2f8b('0x4c')]?_0x2f8b('0x4d'):_0x2f8b('0x4e')][_0x2f8b('0x45')]({'where':{'id':_0x5b181f['VoiceQueueId']?_0x5b181f['VoiceQueueId']:_0x5b181f[_0x2f8b('0x4f')]},'attributes':['id',_0x2f8b('0x13')],'raw':!![]});}}})[_0x2f8b('0xf')](function(_0x448382){var _0x4ae427={};if(_0x448382){_[_0x2f8b('0x3a')](_0x4ae427,_[_0x2f8b('0x50')](_0x14e50e['dataValues'],[_0x2f8b('0x51'),'updatedAt','id']));_0x4ae427[_0x2f8b('0x52')]=0x15;_0x4ae427['statedesc']=_0x2f8b('0x53');_0x4ae427[_0x2f8b('0x54')]=_0x448382[_0x2f8b('0x13')];_0x4ae427['membername']=_0x2d79f9[_0x2f8b('0x55')]['name'];_0x4ae427[_0x2f8b('0x56')]=_0x2d79f9['user']['id'];_0x4ae427[_0x2f8b('0x53')]=!![];_0x4ae427[_0x2f8b('0x57')]=moment()[_0x2f8b('0x58')](_0x2f8b('0x59'));_0x4ae427[_0x2f8b('0x5a')]=_0x14e50e[_0x2f8b('0x5b')];_0x4ae427[_0x2f8b('0x5c')]=_0x14e50e[_0x2f8b('0x4c')]?'queue':_0x2f8b('0x5d');return db[_0x2f8b('0x5e')][_0x2f8b('0x45')]({'where':{'id':_0x4ae427[_0x2f8b('0x5f')]},'attributes':[_0x2f8b('0x60'),_0x2f8b('0x61')]})[_0x2f8b('0xf')](function(_0x2de537){if(!_[_0x2f8b('0x62')](_0x1bb257)&&!_[_0x2f8b('0x62')](_0x2de537[_0x2f8b('0x60')])){_0x4ae427[_0x2f8b('0x63')]=_0x2de537['firstName'];if(!_[_0x2f8b('0x62')](_0x2de537['lastName'])){_0x4ae427[_0x2f8b('0x63')]+='\x20'+_0x2de537[_0x2f8b('0x61')];}}})[_0x2f8b('0x64')](function(){return db[_0x2f8b('0x65')][_0x2f8b('0x47')](_0x4ae427);});}})['then'](function(_0x2b0627){return db[_0x2f8b('0x66')][_0x2f8b('0x4b')]({'where':{'CmHopperId':_0x487c81}});})[_0x2f8b('0xf')](function(){return _0x1bb257['status'](0xcc)['end']();})[_0x2f8b('0x46')](handleError(_0x1bb257,null));};exports[_0x2f8b('0x67')]=function(_0x334153,_0x34870f){var _0x5441ea=[];return db[_0x2f8b('0x5e')][_0x2f8b('0x4a')]()['then'](function(_0x4c502d){_0x5441ea=_['keys'](_0x4c502d);return _0x334153[_0x2f8b('0x55')]['getVoiceQueues']({'where':{'type':_0x2f8b('0x68'),'dialActive':!![],'dialMethod':_0x2f8b('0x69')},'attributes':['id',_0x2f8b('0x6a'),_0x2f8b('0x6b')],'raw':!![]});})[_0x2f8b('0xf')](function(_0x1c1563){if(_0x1c1563&&_0x1c1563[_0x2f8b('0x33')]){return db[_0x2f8b('0x6c')]['transaction'](function(_0x49a2ca){var _0x14ff2a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2f8b('0x58')](_0x2f8b('0x59'))},'VoiceQueueId':{'$in':_[_0x2f8b('0x3b')](_0x1c1563,'id')},'$or':[{'UserId':null},{'UserId':_0x334153[_0x2f8b('0x55')]['id']}]};var _0x23ac08={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1c1563)[_0x2f8b('0x6d')]([_0x2f8b('0x6b'),0x0])[_0x2f8b('0x3b')]('id')[_0x2f8b('0x6e')]()},'$or':[{'UserId':null},{'UserId':_0x334153['user']['id']}]};var _0x3dbd17={'$or':[_0x14ff2a,_0x23ac08]};var _0x1e3434=[];if(_0x334153[_0x2f8b('0x49')][_0x2f8b('0x6f')]&&_0x334153[_0x2f8b('0x49')]['direction']===_0x2f8b('0x70')){if(!_[_0x2f8b('0x71')](_0x334153['body'][_0x2f8b('0x72')])){_0x3dbd17['id']={'$in':_0x334153['body']['hopperIds']};}_0x1e3434=[[_0x2f8b('0x73'),_0x2f8b('0x74')],[_0x2f8b('0x75'),_0x1c1563[0x0]['dialOrderByScheduledAt']===_0x2f8b('0x74')?'DESC':_0x2f8b('0x74')],db[_0x2f8b('0x6c')][_0x2f8b('0x76')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x2f8b('0x77')]];}else{if(!_['isEmpty'](_0x334153[_0x2f8b('0x49')][_0x2f8b('0x72')])){_0x3dbd17['id']={'$notIn':_0x334153['body'][_0x2f8b('0x72')]};}_0x1e3434=[[_0x2f8b('0x73'),_0x2f8b('0x77')],['scheduledAt',_0x1c1563[0x0][_0x2f8b('0x6a')]],db[_0x2f8b('0x6c')][_0x2f8b('0x76')](_0x2f8b('0x78')),['id','ASC']];}return db[_0x2f8b('0x16')][_0x2f8b('0x79')]({'attributes':['id','scheduledat',_0x2f8b('0x5b'),'recallme'],'where':_0x3dbd17,'order':_0x1e3434,'transaction':_0x49a2ca,'lock':_0x49a2ca[_0x2f8b('0x7a')][_0x2f8b('0x7b')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x5441ea,'include':[{'model':db['CmCompany'],'as':_0x2f8b('0x7c'),'attributes':['id',_0x2f8b('0x13')]}]},{'model':db['CmList'],'as':'List','attributes':['id','name']},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name',_0x2f8b('0x7d')]}]})[_0x2f8b('0xf')](function(_0x7348e8){if(_0x7348e8){return _0x7348e8[_0x2f8b('0x48')]({'UserId':_0x334153[_0x2f8b('0x55')]['id']},{'transaction':_0x49a2ca});}});});}})['then'](handleEntityNotFound(_0x34870f,null))['then'](respondWithResult(_0x34870f,null))[_0x2f8b('0x46')](handleError(_0x34870f,null));};exports[_0x2f8b('0x7e')]=function(_0x34a7b6,_0x585196,_0x5ae32e){var _0x55254b=[];var _0x4358e0=_0x34a7b6[_0x2f8b('0x42')]['id'];var _0x34b0d2=_0x34a7b6['user']['id'];return db[_0x2f8b('0x5e')][_0x2f8b('0x4a')]()[_0x2f8b('0xf')](function(_0x3afad1){_0x55254b=_[_0x2f8b('0x1c')](_0x3afad1);return db[_0x2f8b('0x6c')]['transaction'](function(_0x38b1fe){const _0x31d6cc={'id':_0x4358e0};return db['CmHopper'][_0x2f8b('0x79')]({'attributes':['id',_0x2f8b('0x7f'),_0x2f8b('0x80')],'where':_0x31d6cc,'transaction':_0x38b1fe,'lock':_0x38b1fe[_0x2f8b('0x7a')][_0x2f8b('0x7b')],'include':[{'model':db[_0x2f8b('0x5e')],'as':_0x2f8b('0x81'),'attributes':_0x55254b,'include':[{'model':db[_0x2f8b('0x82')],'as':'Company','attributes':['id',_0x2f8b('0x13')]}]},{'model':db['CmList'],'as':_0x2f8b('0x83'),'attributes':['id',_0x2f8b('0x13')]},{'model':db['VoiceQueue'],'as':_0x2f8b('0x84'),'attributes':['id','name',_0x2f8b('0x7d')]}]})[_0x2f8b('0xf')](function(_0x1ebbc8){if(_0x1ebbc8){return _0x1ebbc8[_0x2f8b('0x48')]({'UserId':_0x34b0d2},{'transaction':_0x38b1fe});}});});})['then'](handleEntityNotFound(_0x585196,null))[_0x2f8b('0xf')](respondWithResult(_0x585196,null))['catch'](handleError(_0x585196,null));};exports['getOpenContacts']=function(_0x7ded8e,_0x3bf354){return _0x7ded8e[_0x2f8b('0x55')][_0x2f8b('0x85')]({'where':{'type':_0x2f8b('0x68'),'dialActive':!![],'dialMethod':_0x2f8b('0x69')},'attributes':['id'],'raw':!![]})[_0x2f8b('0xf')](function(_0x1be1f5){if(_0x1be1f5&&_0x1be1f5['length']){return db[_0x2f8b('0x16')][_0x2f8b('0xc')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2f8b('0x58')](_0x2f8b('0x59'))},'VoiceQueueId':{'$in':_[_0x2f8b('0x3b')](_0x1be1f5,'id')},'$or':[{'UserId':null},{'UserId':_0x7ded8e[_0x2f8b('0x55')]['id']}]}});}return 0x0;})[_0x2f8b('0xf')](function(_0x4d0a73){if(!_[_0x2f8b('0x62')](_0x4d0a73)&&_['isNumber'](_0x4d0a73)){return _0x3bf354[_0x2f8b('0x7')](0xc8)[_0x2f8b('0x8')]({'contacts':_0x4d0a73});}else{logger['error'](_0x2f8b('0x86'),_0x2f8b('0x87'),0x194,_0x2f8b('0x88'));_0x3bf354[_0x2f8b('0x10')](0x194);}})[_0x2f8b('0x46')](handleError(_0x3bf354,null));};exports[_0x2f8b('0x89')]=function(_0x53fbfe,_0x1ba4d2){var _0x55dcc1=shared[_0x2f8b('0x8a')];var _0x5da15b=[];_['map'](_0x55dcc1,function(_0x260d55){_0x5da15b[_0x2f8b('0x8b')]({'id':_0x260d55[_0x2f8b('0x13')],'name':_0x260d55[_0x2f8b('0x13')],'utcOffset':_0x260d55[_0x2f8b('0x8c')]});});return _0x1ba4d2[_0x2f8b('0x7')](0xc8)[_0x2f8b('0x8')]({'tz':_0x5da15b});};exports[_0x2f8b('0x8d')]=function(_0x2cf869,_0x2deff8){var _0x405dd9=shared[_0x2f8b('0x8a')];var _0x3ddea8={};if(!_[_0x2f8b('0x62')](_0x405dd9[_0x2cf869[_0x2f8b('0x49')]['id']]))_0x3ddea8=_0x405dd9[_0x2cf869['body']['id']];return _0x2deff8[_0x2f8b('0x7')](0xc8)['json'](_0x3ddea8);}; \ No newline at end of file +var _0x23f4=['VIRTUAL','merge','options','CmHopper','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','dataValues','updatedAt','state','statedesc','deleted','campaign','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','getPreview','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','priority','findOne','recallme','LOCK','Contact','CmCompany','Queue','dialActive','getPreviewRecall','transaction','scheduledat','UPDATE','Company','CmList','List','getOpenContacts','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','lodash','api','../../config/environment','../../mysqldb','status','json','undefined','limit','offset','count','set','Content-Range','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','keys','query','intersection','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$notIn','$like','$notILike','$overlap','$any','attributes','model','fields','length','hasOwnProperty','nolimit','sort','filter','where'];(function(_0x4a77e1,_0x213125){var _0x1bd46d=function(_0x1ab441){while(--_0x1ab441){_0x4a77e1['push'](_0x4a77e1['shift']());}};_0x1bd46d(++_0x213125);}(_0x23f4,0x1ee));var _0x423f=function(_0x1e2928,_0x4e4955){_0x1e2928=_0x1e2928-0x0;var _0xf29ab1=_0x23f4[_0x1e2928];return _0xf29ab1;};'use strict';var moment=require('moment');var _=require(_0x423f('0x0'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x423f('0x1'));var shared=require(_0x423f('0x2'));var db=require(_0x423f('0x3'))['db'];function respondWithResult(_0x3503a0,_0x1ab106){_0x1ab106=_0x1ab106||0xc8;return function(_0x129dba){if(_0x129dba){return _0x3503a0[_0x423f('0x4')](_0x1ab106)[_0x423f('0x5')](_0x129dba);}};}function respondWithFilteredResult(_0x34a2d9,_0x51066b){return function(_0x260eae){if(_0x260eae){var _0x47716d=typeof _0x51066b['offset']===_0x423f('0x6')&&typeof _0x51066b[_0x423f('0x7')]===_0x423f('0x6');var _0x50301a=_0x260eae['count'];var _0x4b8a90=_0x47716d?0x0:_0x51066b[_0x423f('0x8')];var _0x481c41=_0x47716d?_0x260eae[_0x423f('0x9')]:_0x51066b[_0x423f('0x8')]+_0x51066b[_0x423f('0x7')];var _0x162c83;if(_0x481c41>=_0x50301a){_0x481c41=_0x50301a;_0x162c83=0xc8;}else{_0x162c83=0xce;}_0x34a2d9['status'](_0x162c83);return _0x34a2d9[_0x423f('0xa')](_0x423f('0xb'),_0x4b8a90+'-'+_0x481c41+'/'+_0x50301a)[_0x423f('0x5')](_0x260eae);}return null;};}function saveUpdates(_0x3d4027,_0x216360){return function(_0x5275b0){if(_0x5275b0){return _0x5275b0[_0x423f('0xc')](_0x3d4027)[_0x423f('0xd')](function(_0x2ebc8c){return _0x2ebc8c;});}return null;};}function handleEntityNotFound(_0x1c894f,_0x44e1d5){return function(_0x3b531d){if(!_0x3b531d){_0x1c894f[_0x423f('0xe')](0x194);}return _0x3b531d;};}function handleError(_0x21d804,_0x252e6c){_0x252e6c=_0x252e6c||0x1f4;return function(_0x235c86){logger[_0x423f('0xf')](_0x235c86[_0x423f('0x10')]);if(_0x235c86[_0x423f('0x11')]){delete _0x235c86[_0x423f('0x11')];}_0x21d804[_0x423f('0x4')](_0x252e6c)[_0x423f('0x12')](_0x235c86);};}exports[_0x423f('0x13')]=function(_0x34e968,_0x26b6d1){var _0x5424e6={},_0x99435f={},_0x569fd0={'count':0x0,'rows':[]};var _0x504d8b=_[_0x423f('0x14')](db['CmHopper'][_0x423f('0x15')],function(_0xd7b80e){return{'name':_0xd7b80e['fieldName'],'type':_0xd7b80e[_0x423f('0x16')][_0x423f('0x17')]};});_0x99435f['model']=_[_0x423f('0x14')](_0x504d8b,_0x423f('0x11'));_0x99435f['query']=_[_0x423f('0x18')](_0x34e968[_0x423f('0x19')]);_0x99435f['filters']=_[_0x423f('0x1a')](_0x99435f['model'],_0x99435f[_0x423f('0x19')]);_0x99435f[_0x423f('0x1b')]=_[_0x423f('0x1c')](_0x99435f[_0x423f('0x1b')],[_0x423f('0x1d'),_0x423f('0x1e'),_0x423f('0x1f'),_0x423f('0x20'),_0x423f('0x21'),_0x423f('0x22'),_0x423f('0x23'),_0x423f('0x24'),_0x423f('0x25'),_0x423f('0x26'),'$notBetween',_0x423f('0x27'),_0x423f('0x28'),_0x423f('0x29'),'$notLike','$iLike',_0x423f('0x2a'),_0x423f('0x29'),_0x423f('0x2b'),'$contains','$contained',_0x423f('0x2c')]);_0x5424e6[_0x423f('0x2d')]=_['intersection'](_0x99435f[_0x423f('0x2e')],qs[_0x423f('0x2f')](_0x34e968[_0x423f('0x19')][_0x423f('0x2f')]));_0x5424e6['attributes']=_0x5424e6[_0x423f('0x2d')][_0x423f('0x30')]?_0x5424e6[_0x423f('0x2d')]:_0x99435f[_0x423f('0x2e')];if(!_0x34e968['query'][_0x423f('0x31')](_0x423f('0x32'))){_0x5424e6[_0x423f('0x7')]=qs[_0x423f('0x7')](_0x34e968[_0x423f('0x19')][_0x423f('0x7')]);_0x5424e6[_0x423f('0x8')]=qs[_0x423f('0x8')](_0x34e968[_0x423f('0x19')][_0x423f('0x8')]);}_0x5424e6['order']=qs[_0x423f('0x33')](_0x34e968[_0x423f('0x19')][_0x423f('0x33')]);_0x5424e6['where']=qs[_0x423f('0x1b')](_['pick'](_0x34e968[_0x423f('0x19')],_0x99435f[_0x423f('0x1b')]),_0x504d8b);if(_0x34e968[_0x423f('0x19')][_0x423f('0x34')]){_0x5424e6[_0x423f('0x35')]=_['merge'](_0x5424e6['where'],{'$or':_[_0x423f('0x14')](_0x504d8b,function(_0x5a2225){if(_0x5a2225[_0x423f('0x16')]!==_0x423f('0x36')){var _0x3e4c9f={};_0x3e4c9f[_0x5a2225[_0x423f('0x11')]]={'$like':'%'+_0x34e968[_0x423f('0x19')][_0x423f('0x34')]+'%'};return _0x3e4c9f;}})});}_0x5424e6=_[_0x423f('0x37')]({},_0x5424e6,_0x34e968[_0x423f('0x38')]);var _0x3aeb17={'where':_0x5424e6[_0x423f('0x35')]};return db[_0x423f('0x39')]['count'](_0x3aeb17)['then'](function(_0x382f91){_0x569fd0[_0x423f('0x9')]=_0x382f91;if(_0x34e968[_0x423f('0x19')][_0x423f('0x3a')]){_0x5424e6[_0x423f('0x3b')]=[{'all':!![]}];}return db['CmHopper'][_0x423f('0x3c')](_0x5424e6);})[_0x423f('0xd')](function(_0x2e6d28){_0x569fd0[_0x423f('0x3d')]=_0x2e6d28;return _0x569fd0;})[_0x423f('0xd')](respondWithFilteredResult(_0x26b6d1,_0x5424e6))[_0x423f('0x3e')](handleError(_0x26b6d1,null));};exports[_0x423f('0x3f')]=function(_0x1d280f,_0x3464e3){var _0x40571a={'raw':!![],'where':{'id':_0x1d280f['params']['id']}},_0x4fb566={};_0x4fb566[_0x423f('0x2e')]=_[_0x423f('0x18')](db[_0x423f('0x39')][_0x423f('0x15')]);_0x4fb566[_0x423f('0x19')]=_[_0x423f('0x18')](_0x1d280f['query']);_0x4fb566[_0x423f('0x1b')]=_[_0x423f('0x1a')](_0x4fb566[_0x423f('0x2e')],_0x4fb566[_0x423f('0x19')]);_0x40571a[_0x423f('0x2d')]=_[_0x423f('0x1a')](_0x4fb566[_0x423f('0x2e')],qs[_0x423f('0x2f')](_0x1d280f['query'][_0x423f('0x2f')]));_0x40571a[_0x423f('0x2d')]=_0x40571a[_0x423f('0x2d')][_0x423f('0x30')]?_0x40571a[_0x423f('0x2d')]:_0x4fb566[_0x423f('0x2e')];if(_0x1d280f[_0x423f('0x19')][_0x423f('0x3a')]){_0x40571a[_0x423f('0x3b')]=[{'all':!![]}];}_0x40571a=_['merge']({},_0x40571a,_0x1d280f[_0x423f('0x38')]);return db['CmHopper'][_0x423f('0x40')](_0x40571a)[_0x423f('0xd')](handleEntityNotFound(_0x3464e3,null))[_0x423f('0xd')](respondWithResult(_0x3464e3,null))[_0x423f('0x3e')](handleError(_0x3464e3,null));};exports[_0x423f('0x41')]=function(_0x3ad48c,_0x3087e4){return db[_0x423f('0x39')][_0x423f('0x41')](_0x3ad48c[_0x423f('0x42')],{})[_0x423f('0xd')](respondWithResult(_0x3087e4,0xc9))[_0x423f('0x3e')](handleError(_0x3087e4,null));};exports[_0x423f('0xc')]=function(_0x350e11,_0xa7708c){if(_0x350e11[_0x423f('0x42')]['id']){delete _0x350e11[_0x423f('0x42')]['id'];}return db[_0x423f('0x39')][_0x423f('0x40')]({'where':{'id':_0x350e11[_0x423f('0x43')]['id']}})['then'](handleEntityNotFound(_0xa7708c,null))[_0x423f('0xd')](saveUpdates(_0x350e11['body'],null))[_0x423f('0xd')](respondWithResult(_0xa7708c,null))[_0x423f('0x3e')](handleError(_0xa7708c,null));};exports[_0x423f('0x44')]=function(_0x37035a,_0x57f5d6){return db[_0x423f('0x39')][_0x423f('0x44')]()[_0x423f('0xd')](respondWithResult(_0x57f5d6,null))[_0x423f('0x3e')](handleError(_0x57f5d6,null));};exports[_0x423f('0x45')]=function(_0x31b88e,_0x2dcbec){var _0x489894;var _0x1e2b9f=_0x31b88e[_0x423f('0x43')]['id'];return db['CmHopper'][_0x423f('0x40')]({'where':{'id':_0x31b88e['params']['id']}})[_0x423f('0xd')](handleEntityNotFound(_0x2dcbec,null))['then'](function(_0x56e907){if(_0x56e907){return _0x56e907[_0x423f('0x45')]()[_0x423f('0xd')](function(_0x1668d4){return _0x1668d4;});}})[_0x423f('0xd')](function(_0x545476){_0x489894=_0x545476;if(_0x545476){if(_0x545476[_0x423f('0x46')]||_0x545476['CampaignId']){return db[_0x545476[_0x423f('0x46')]?_0x423f('0x47'):_0x423f('0x48')][_0x423f('0x40')]({'where':{'id':_0x545476[_0x423f('0x46')]?_0x545476[_0x423f('0x46')]:_0x545476[_0x423f('0x49')]},'attributes':['id',_0x423f('0x11')],'raw':!![]});}}})[_0x423f('0xd')](function(_0x4e3003){var _0x104fd9={};if(_0x4e3003){_[_0x423f('0x37')](_0x104fd9,_['omit'](_0x489894[_0x423f('0x4a')],['createdAt',_0x423f('0x4b'),'id']));_0x104fd9[_0x423f('0x4c')]=0x15;_0x104fd9[_0x423f('0x4d')]=_0x423f('0x4e');_0x104fd9[_0x423f('0x4f')]=_0x4e3003[_0x423f('0x11')];_0x104fd9['membername']=_0x31b88e['user'][_0x423f('0x11')];_0x104fd9[_0x423f('0x50')]=_0x31b88e[_0x423f('0x51')]['id'];_0x104fd9[_0x423f('0x4e')]=!![];_0x104fd9[_0x423f('0x52')]=moment()[_0x423f('0x53')](_0x423f('0x54'));_0x104fd9[_0x423f('0x55')]=_0x489894[_0x423f('0x56')];_0x104fd9['campaigntype']=_0x489894[_0x423f('0x46')]?_0x423f('0x57'):'ivr';return db[_0x423f('0x58')]['find']({'where':{'id':_0x104fd9[_0x423f('0x59')]},'attributes':[_0x423f('0x5a'),_0x423f('0x5b')]})['then'](function(_0x5c39e4){if(!_[_0x423f('0x5c')](_0x2dcbec)&&!_[_0x423f('0x5c')](_0x5c39e4[_0x423f('0x5a')])){_0x104fd9['calleridname']=_0x5c39e4[_0x423f('0x5a')];if(!_[_0x423f('0x5c')](_0x5c39e4[_0x423f('0x5b')])){_0x104fd9[_0x423f('0x5d')]+='\x20'+_0x5c39e4[_0x423f('0x5b')];}}})[_0x423f('0x5e')](function(){return db[_0x423f('0x5f')]['create'](_0x104fd9);});}})[_0x423f('0xd')](function(_0x588483){return db[_0x423f('0x60')][_0x423f('0x45')]({'where':{'CmHopperId':_0x1e2b9f}});})[_0x423f('0xd')](function(){return _0x2dcbec[_0x423f('0x4')](0xcc)['end']();})[_0x423f('0x3e')](handleError(_0x2dcbec,null));};exports[_0x423f('0x61')]=function(_0x4c33c7,_0x5ae8a9){var _0xfe89a9=[];return db[_0x423f('0x58')]['describe']()[_0x423f('0xd')](function(_0x1897ff){_0xfe89a9=_['keys'](_0x1897ff);return _0x4c33c7['user']['getVoiceQueues']({'where':{'type':_0x423f('0x62'),'dialActive':!![],'dialMethod':_0x423f('0x63')},'attributes':['id',_0x423f('0x64'),_0x423f('0x65')],'raw':!![]});})['then'](function(_0x4fa0ef){if(_0x4fa0ef&&_0x4fa0ef[_0x423f('0x30')]){return db[_0x423f('0x66')]['transaction'](function(_0x43b569){var _0x13ed0b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x423f('0x53')](_0x423f('0x54'))},'VoiceQueueId':{'$in':_[_0x423f('0x14')](_0x4fa0ef,'id')},'$or':[{'UserId':null},{'UserId':_0x4c33c7[_0x423f('0x51')]['id']}]};var _0x116605={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4fa0ef)['filter']([_0x423f('0x65'),0x0])[_0x423f('0x14')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x4c33c7[_0x423f('0x51')]['id']}]};var _0x223e8c={'$or':[_0x13ed0b,_0x116605]};var _0x3e5d47=[];if(_0x4c33c7['body'][_0x423f('0x67')]&&_0x4c33c7[_0x423f('0x42')][_0x423f('0x67')]===_0x423f('0x68')){if(!_[_0x423f('0x69')](_0x4c33c7[_0x423f('0x42')][_0x423f('0x6a')])){_0x223e8c['id']={'$in':_0x4c33c7[_0x423f('0x42')][_0x423f('0x6a')]};}_0x3e5d47=[['priority',_0x423f('0x6b')],[_0x423f('0x6c'),_0x4fa0ef[0x0][_0x423f('0x64')]===_0x423f('0x6b')?'DESC':_0x423f('0x6b')],db[_0x423f('0x66')][_0x423f('0x6d')](_0x423f('0x6e')),['id',_0x423f('0x6f')]];}else{if(!_[_0x423f('0x69')](_0x4c33c7[_0x423f('0x42')]['hopperIds'])){_0x223e8c['id']={'$notIn':_0x4c33c7[_0x423f('0x42')][_0x423f('0x6a')]};}_0x3e5d47=[[_0x423f('0x70'),_0x423f('0x6f')],['scheduledAt',_0x4fa0ef[0x0][_0x423f('0x64')]],db[_0x423f('0x66')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x423f('0x6b')]];}return db[_0x423f('0x39')][_0x423f('0x71')]({'attributes':['id','scheduledat',_0x423f('0x56'),_0x423f('0x72')],'where':_0x223e8c,'order':_0x3e5d47,'transaction':_0x43b569,'lock':_0x43b569[_0x423f('0x73')]['UPDATE'],'include':[{'model':db[_0x423f('0x58')],'as':_0x423f('0x74'),'attributes':_0xfe89a9,'include':[{'model':db[_0x423f('0x75')],'as':'Company','attributes':['id',_0x423f('0x11')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x423f('0x11')]},{'model':db[_0x423f('0x47')],'as':_0x423f('0x76'),'attributes':['id',_0x423f('0x11'),_0x423f('0x77')]}]})['then'](function(_0x29e60c){if(_0x29e60c){return _0x29e60c[_0x423f('0xc')]({'UserId':_0x4c33c7[_0x423f('0x51')]['id']},{'transaction':_0x43b569});}});});}})[_0x423f('0xd')](handleEntityNotFound(_0x5ae8a9,null))[_0x423f('0xd')](respondWithResult(_0x5ae8a9,null))[_0x423f('0x3e')](handleError(_0x5ae8a9,null));};exports[_0x423f('0x78')]=function(_0x5b9577,_0x4e1e04,_0xd9409e){var _0x320528=[];var _0xe76487=_0x5b9577[_0x423f('0x43')]['id'];var _0x3cffc3=_0x5b9577['user']['id'];return db[_0x423f('0x58')][_0x423f('0x44')]()[_0x423f('0xd')](function(_0x358ab3){_0x320528=_[_0x423f('0x18')](_0x358ab3);return db[_0x423f('0x66')][_0x423f('0x79')](function(_0x1db383){const _0x20bd00={'id':_0xe76487};return db[_0x423f('0x39')][_0x423f('0x71')]({'attributes':['id',_0x423f('0x7a'),_0x423f('0x72')],'where':_0x20bd00,'transaction':_0x1db383,'lock':_0x1db383['LOCK'][_0x423f('0x7b')],'include':[{'model':db[_0x423f('0x58')],'as':_0x423f('0x74'),'attributes':_0x320528,'include':[{'model':db[_0x423f('0x75')],'as':_0x423f('0x7c'),'attributes':['id','name']}]},{'model':db[_0x423f('0x7d')],'as':_0x423f('0x7e'),'attributes':['id',_0x423f('0x11')]},{'model':db[_0x423f('0x47')],'as':'Queue','attributes':['id',_0x423f('0x11'),_0x423f('0x77')]}]})[_0x423f('0xd')](function(_0x3832b6){if(_0x3832b6){return _0x3832b6[_0x423f('0xc')]({'UserId':_0x3cffc3},{'transaction':_0x1db383});}});});})[_0x423f('0xd')](handleEntityNotFound(_0x4e1e04,null))[_0x423f('0xd')](respondWithResult(_0x4e1e04,null))[_0x423f('0x3e')](handleError(_0x4e1e04,null));};exports[_0x423f('0x7f')]=function(_0x22f2af,_0x3c78c7){return _0x22f2af[_0x423f('0x51')][_0x423f('0x80')]({'where':{'type':_0x423f('0x62'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x423f('0xd')](function(_0x5333b7){if(_0x5333b7&&_0x5333b7['length']){return db[_0x423f('0x39')][_0x423f('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x423f('0x53')](_0x423f('0x54'))},'VoiceQueueId':{'$in':_['map'](_0x5333b7,'id')},'$or':[{'UserId':null},{'UserId':_0x22f2af[_0x423f('0x51')]['id']}]}});}return 0x0;})['then'](function(_0xf18525){if(!_[_0x423f('0x5c')](_0xf18525)&&_[_0x423f('0x81')](_0xf18525)){return _0x3c78c7[_0x423f('0x4')](0xc8)[_0x423f('0x5')]({'contacts':_0xf18525});}else{logger['error'](_0x423f('0x82'),'getOpenContacts',0x194,_0x423f('0x83'));_0x3c78c7['sendStatus'](0x194);}})[_0x423f('0x3e')](handleError(_0x3c78c7,null));};exports[_0x423f('0x84')]=function(_0x1990ec,_0x5697e8){var _0xbcf529=shared[_0x423f('0x85')];var _0x3ecfd5=[];_[_0x423f('0x14')](_0xbcf529,function(_0x5baf51){_0x3ecfd5[_0x423f('0x86')]({'id':_0x5baf51[_0x423f('0x11')],'name':_0x5baf51['name'],'utcOffset':_0x5baf51[_0x423f('0x87')]});});return _0x5697e8[_0x423f('0x4')](0xc8)[_0x423f('0x5')]({'tz':_0x3ecfd5});};exports[_0x423f('0x88')]=function(_0x36241e,_0x2bb2ba){var _0x140db1=shared[_0x423f('0x85')];var _0x2ede33={};if(!_[_0x423f('0x5c')](_0x140db1[_0x36241e['body']['id']]))_0x2ede33=_0x140db1[_0x36241e['body']['id']];return _0x2bb2ba[_0x423f('0x4')](0xc8)['json'](_0x2ede33);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 1a73421..c1faea2 100644 --- a/server/api/cmHopper/cmHopper.model.js +++ b/server/api/cmHopper/cmHopper.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c09=['scheduledat','phone','priority','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','cm_hopper'];(function(_0x26456b,_0x3eec5f){var _0x47384c=function(_0x181298){while(--_0x181298){_0x26456b['push'](_0x26456b['shift']());}};_0x47384c(++_0x3eec5f);}(_0x7c09,0x102));var _0x97c0=function(_0x3d4eff,_0x5918b9){_0x3d4eff=_0x3d4eff-0x0;var _0x4a9369=_0x7c09[_0x3d4eff];return _0x4a9369;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var logger=require(_0x97c0('0x1'))('api');var moment=require(_0x97c0('0x2'));var BPromise=require(_0x97c0('0x3'));var rp=require(_0x97c0('0x4'));var fs=require('fs');var path=require(_0x97c0('0x5'));var rimraf=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var attributes=require(_0x97c0('0x8'));module['exports']=function(_0x4b2f81,_0x590368){return _0x4b2f81[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'paranoid':![],'indexes':[{'name':_0x97c0('0xc'),'fields':[_0x97c0('0xc')]},{'name':'phone','fields':[_0x97c0('0xd')]},{'name':'priority','fields':[_0x97c0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x39a333,_0x5581a4){var _0x5366f1=function(_0x41599c){while(--_0x41599c){_0x39a333['push'](_0x39a333['shift']());}};_0x5366f1(++_0x5581a4);}(_0x5fab,0x177));var _0xb5fa=function(_0x453016,_0x2bd244){_0x453016=_0x453016-0x0;var _0x3352f5=_0x5fab[_0x453016];return _0x3352f5;};'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'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['scheduledat']},{'name':_0xb5fa('0xe'),'fields':[_0xb5fa('0xe')]},{'name':_0xb5fa('0xf'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 5fb65bd..fdc7021 100644 --- a/server/api/cmHopper/cmHopper.rpc.js +++ b/server/api/cmHopper/cmHopper.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6268=['\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','describe','order','UPDATE','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','User','CmList','List','lodash','util','bluebird','GetCmHopper','findAll','options','where','limit','include','map','model','attributes','then','debug','stringify','catch','error','message','ShowCmHopper','CmHopper','raw','info','create','body','CreateCmHopper','update','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','sequelize','transaction','CmContact','Contact','keys','Agent','name','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x6268,0x101));var _0x8626=function(_0x1579d7,_0x505dcf){_0x1579d7=_0x1579d7-0x0;var _0x21b002=_0x6268[_0x1579d7];return _0x21b002;};'use strict';var _=require(_0x8626('0x0'));var util=require(_0x8626('0x1'));var moment=require('moment');var BPromise=require(_0x8626('0x2'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')('rpc');exports[_0x8626('0x3')]=function(_0x199680){var _0x153b12=this;return new Promise(function(_0x2a1c8b,_0x25c2a5){return db['CmHopper'][_0x8626('0x4')]({'raw':_0x199680[_0x8626('0x5')]?_0x199680[_0x8626('0x5')]['raw']===undefined?!![]:![]:!![],'where':_0x199680['options']?_0x199680[_0x8626('0x5')][_0x8626('0x6')]||null:null,'attributes':_0x199680[_0x8626('0x5')]?_0x199680[_0x8626('0x5')]['attributes']||null:null,'limit':_0x199680[_0x8626('0x5')]?_0x199680[_0x8626('0x5')][_0x8626('0x7')]||null:null,'include':_0x199680[_0x8626('0x5')]?_0x199680[_0x8626('0x5')][_0x8626('0x8')]?_[_0x8626('0x9')](_0x199680[_0x8626('0x5')][_0x8626('0x8')],function(_0x169999){return{'model':db[_0x169999[_0x8626('0xa')]],'as':_0x169999['as'],'attributes':_0x169999[_0x8626('0xb')],'include':_0x169999[_0x8626('0x8')]?_[_0x8626('0x9')](_0x169999[_0x8626('0x8')],function(_0x4b70a8){return{'model':db[_0x4b70a8['model']],'as':_0x4b70a8['as'],'attributes':_0x4b70a8[_0x8626('0xb')],'include':_0x4b70a8[_0x8626('0x8')]?_['map'](_0x4b70a8['include'],function(_0x58161f){return{'model':db[_0x58161f[_0x8626('0xa')]],'as':_0x58161f['as'],'attributes':_0x58161f[_0x8626('0xb')]};}):[]};}):[]};}):[]:[]})[_0x8626('0xc')](function(_0xadd61d){logger['info'](_0x8626('0x3'),_0x199680);logger[_0x8626('0xd')](_0x8626('0x3'),_0x199680,JSON[_0x8626('0xe')](_0xadd61d));_0x2a1c8b(_0xadd61d);})[_0x8626('0xf')](function(_0x561ca2){logger[_0x8626('0x10')](_0x8626('0x3'),_0x561ca2[_0x8626('0x11')],_0x199680);_0x25c2a5(_0x153b12[_0x8626('0x10')](0x1f4,_0x561ca2['message']));});});};exports[_0x8626('0x12')]=function(_0xbd58ac){var _0x5f4085=this;return new Promise(function(_0x8bb9d8,_0x54c11c){return db[_0x8626('0x13')]['find']({'raw':_0xbd58ac['options']?_0xbd58ac[_0x8626('0x5')][_0x8626('0x14')]===undefined?!![]:![]:!![],'where':_0xbd58ac[_0x8626('0x5')]?_0xbd58ac['options']['where']||null:null,'attributes':_0xbd58ac[_0x8626('0x5')]?_0xbd58ac[_0x8626('0x5')][_0x8626('0xb')]||null:null,'include':_0xbd58ac['options']?_0xbd58ac['options']['include']?_[_0x8626('0x9')](_0xbd58ac['options']['include'],function(_0x3b00c6){return{'model':db[_0x3b00c6[_0x8626('0xa')]],'as':_0x3b00c6['as'],'attributes':_0x3b00c6[_0x8626('0xb')],'include':_0x3b00c6[_0x8626('0x8')]?_['map'](_0x3b00c6[_0x8626('0x8')],function(_0x41461c){return{'model':db[_0x41461c['model']],'as':_0x41461c['as'],'attributes':_0x41461c['attributes'],'include':_0x41461c[_0x8626('0x8')]?_[_0x8626('0x9')](_0x41461c[_0x8626('0x8')],function(_0x230ffc){return{'model':db[_0x230ffc[_0x8626('0xa')]],'as':_0x230ffc['as'],'attributes':_0x230ffc[_0x8626('0xb')]};}):[]};}):[]};}):[]:[]})[_0x8626('0xc')](function(_0x34a5e7){logger[_0x8626('0x15')](_0x8626('0x12'),_0xbd58ac);logger['debug'](_0x8626('0x12'),_0xbd58ac,JSON[_0x8626('0xe')](_0x34a5e7));_0x8bb9d8(_0x34a5e7);})[_0x8626('0xf')](function(_0x24324e){logger[_0x8626('0x10')](_0x8626('0x12'),_0x24324e['message'],_0xbd58ac);_0x54c11c(_0x5f4085[_0x8626('0x10')](0x1f4,_0x24324e[_0x8626('0x11')]));});});};exports['CreateCmHopper']=function(_0x3682d8){var _0x4b7722=this;return new Promise(function(_0x52d6a3,_0x2af350){return db[_0x8626('0x13')][_0x8626('0x16')](_0x3682d8[_0x8626('0x17')],{'raw':_0x3682d8['options']?_0x3682d8[_0x8626('0x5')][_0x8626('0x14')]===undefined?!![]:![]:!![]})[_0x8626('0xc')](function(_0x810cd1){logger[_0x8626('0x15')](_0x8626('0x18'),_0x3682d8);logger[_0x8626('0xd')](_0x8626('0x18'),_0x3682d8,JSON[_0x8626('0xe')](_0x810cd1));_0x52d6a3(_0x810cd1);})[_0x8626('0xf')](function(_0x40bf99){logger['error'](_0x8626('0x18'),_0x40bf99[_0x8626('0x11')],_0x3682d8);_0x2af350(_0x4b7722[_0x8626('0x10')](0x1f4,_0x40bf99[_0x8626('0x11')]));});});};exports['UpdateCmHopper']=function(_0x82dff5){var _0x288c47=this;return new Promise(function(_0x24eabc,_0x2393ad){return db[_0x8626('0x13')][_0x8626('0x19')](_0x82dff5['body'],{'raw':_0x82dff5[_0x8626('0x5')]?_0x82dff5['options'][_0x8626('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x82dff5['options']?_0x82dff5['options'][_0x8626('0x6')]||null:null,'attributes':_0x82dff5[_0x8626('0x5')]?_0x82dff5[_0x8626('0x5')]['attributes']||null:null,'limit':_0x82dff5[_0x8626('0x5')]?_0x82dff5['options'][_0x8626('0x7')]||null:null})[_0x8626('0xc')](function(_0x525394){logger[_0x8626('0x15')](_0x8626('0x1a'),_0x82dff5);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x8626('0xe')](_0x82dff5['options'][_0x8626('0x6')]),_0x82dff5[_0x8626('0x17')]['active']);logger['debug']('UpdateCmHopper',_0x82dff5,JSON[_0x8626('0xe')](_0x525394));_0x24eabc(_0x525394);})[_0x8626('0xf')](function(_0x16a125){logger[_0x8626('0x10')](_0x8626('0x1a'),_0x16a125[_0x8626('0x11')],_0x82dff5);_0x2393ad(_0x288c47[_0x8626('0x10')](0x1f4,_0x16a125['message']));});});};exports[_0x8626('0x1b')]=function(_0x50b105){var _0x2ee4d2=this;return new Promise(function(_0x180792,_0x4feb76){return db['CmHopper'][_0x8626('0x1c')]({'where':_0x50b105[_0x8626('0x5')]?_0x50b105['options']['where']||null:null})[_0x8626('0xc')](function(_0x40a943){logger['info'](_0x8626('0x1b'),_0x50b105);logger['debug'](_0x8626('0x1b'),_0x50b105,JSON[_0x8626('0xe')](_0x40a943));_0x180792(_0x40a943);})['catch'](function(_0x12abfd){logger[_0x8626('0x10')](_0x8626('0x1b'),_0x12abfd[_0x8626('0x11')],_0x50b105);_0x4feb76(_0x2ee4d2[_0x8626('0x10')](0x1f4,_0x12abfd['message']));});});};exports[_0x8626('0x1d')]=function(_0x1a3bd0){var _0x2e7558=this;return new Promise(function(_0x3b9eee,_0x266b09){return db['CmContact']['describe']()[_0x8626('0xc')](function(_0x5d4c34){return db[_0x8626('0x1e')][_0x8626('0x1f')](function(_0x215b33){return db[_0x8626('0x13')]['findAll']({'where':_0x1a3bd0['options']?_0x1a3bd0[_0x8626('0x5')]['where']||null:null,'attributes':_0x1a3bd0[_0x8626('0x5')]?_0x1a3bd0['options'][_0x8626('0xb')]||null:null,'limit':_0x1a3bd0[_0x8626('0x5')]?_0x1a3bd0['options']['limit']||null:null,'order':_0x1a3bd0[_0x8626('0x5')]?_0x1a3bd0['options']['order']||null:null,'transaction':_0x215b33,'lock':_0x215b33['LOCK']['UPDATE'],'include':[{'model':db[_0x8626('0x20')],'as':_0x8626('0x21'),'attributes':_[_0x8626('0x22')](_0x5d4c34)},{'model':db['User'],'as':_0x8626('0x23'),'attributes':['id',_0x8626('0x24'),_0x8626('0x25')]}]})[_0x8626('0xc')](function(_0x231d53){var _0x24c6b9=[];var _0x6579f7=[];for(var _0x21cba6=0x0;_0x21cba6<_0x231d53[_0x8626('0x26')];_0x21cba6+=0x1){var _0x3c65e7=_0x231d53[_0x21cba6][_0x8626('0x27')];if(_0x3c65e7===null){_0x24c6b9[_0x8626('0x28')](_0x231d53[_0x21cba6][_0x8626('0x19')](_0x1a3bd0[_0x8626('0x17')],{'transaction':_0x215b33}));}else if(!_0x6579f7[_0x8626('0x29')](_0x3c65e7)){_0x6579f7[_0x8626('0x28')](_0x3c65e7);_0x24c6b9[_0x8626('0x28')](_0x231d53[_0x21cba6][_0x8626('0x19')](_0x1a3bd0[_0x8626('0x17')],{'transaction':_0x215b33}));}}return BPromise[_0x8626('0x2a')](_0x24c6b9);});})['then'](function(_0x336dcb){logger[_0x8626('0x15')]('GetContactDialer',_0x1a3bd0);if(_0x336dcb['length']>0x0){logger['info'](_0x8626('0x2b'),_0x336dcb[0x0]['dataValues']['id'],_0x336dcb[0x0][_0x8626('0x2c')][_0x8626('0x2d')],_0x336dcb[0x0][_0x8626('0x2c')][_0x8626('0x2e')]);}logger[_0x8626('0xd')]('GetContactDialer',_0x1a3bd0,JSON[_0x8626('0xe')](_0x336dcb));_0x3b9eee(_0x336dcb);})[_0x8626('0xf')](function(_0x11b7b9){logger[_0x8626('0x10')]('GetContactDialer',_0x11b7b9[_0x8626('0x11')],_0x1a3bd0);_0x266b09(_0x2e7558[_0x8626('0x10')](0x1f4,_0x11b7b9[_0x8626('0x11')]));});});});};exports['MoveContactManagedDialer']=function(_0xb0ed00){var _0x1a0dd2=this;return new Promise(function(_0x2da46f,_0x26de30){return db[_0x8626('0x1e')][_0x8626('0x1f')](function(_0x5187eb){return db[_0x8626('0x2f')]['create'](_0xb0ed00['body'],{'raw':_0xb0ed00[_0x8626('0x5')]?_0xb0ed00[_0x8626('0x5')][_0x8626('0x14')]===undefined?!![]:![]:!![],'transaction':_0x5187eb})[_0x8626('0xc')](function(){logger['info'](_0x8626('0x30'),JSON[_0x8626('0xe')](_0xb0ed00[_0x8626('0x5')][_0x8626('0x6')]),_0xb0ed00[_0x8626('0x5')][_0x8626('0x6')][_0x8626('0x2e')]);return db[_0x8626('0x13')]['destroy']({'where':_0xb0ed00[_0x8626('0x5')]?_0xb0ed00[_0x8626('0x5')][_0x8626('0x6')]||null:null,'transaction':_0x5187eb});});})['then'](function(_0x2051f9){logger[_0x8626('0x15')](_0x8626('0x31'),_0xb0ed00);logger['debug'](_0x8626('0x31'),_0xb0ed00,JSON['stringify'](_0x2051f9));_0x2da46f(_0x2051f9);})[_0x8626('0xf')](function(_0x3c4ac2){logger[_0x8626('0x10')]('MoveContactManagedDialer',_0x3c4ac2[_0x8626('0x11')],_0xb0ed00);_0x26de30(_0x1a0dd2[_0x8626('0x10')](0x1f4,_0x3c4ac2[_0x8626('0x11')]));});});};exports[_0x8626('0x32')]=function(_0x4bdee1){var _0x38ea8e=this;return new Promise(function(_0x409591,_0x481bad){return db[_0x8626('0x13')][_0x8626('0x4')]({'raw':_0x4bdee1[_0x8626('0x5')]?_0x4bdee1['options'][_0x8626('0x14')]===undefined?!![]:![]:!![],'where':_0x4bdee1[_0x8626('0x5')]?_0x4bdee1['options'][_0x8626('0x6')]||null:null,'attributes':[[db[_0x8626('0x1e')]['fn'](_0x8626('0x33'),db[_0x8626('0x1e')]['fn']('IF',db[_0x8626('0x1e')][_0x8626('0x34')](_0x8626('0x35')+util[_0x8626('0x36')](_0x8626('0x37'),moment()[_0x8626('0x36')](_0x8626('0x38')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0x8626('0xc')](function(_0x3003d9){logger[_0x8626('0x15')](_0x8626('0x32'),_0x4bdee1);logger[_0x8626('0xd')](_0x8626('0x32'),_0x4bdee1,JSON['stringify'](_0x3003d9));_0x409591(_0x3003d9);})['catch'](function(_0x2550ec){logger[_0x8626('0x10')]('CountReScheduled',_0x2550ec[_0x8626('0x11')],_0x4bdee1);_0x481bad(_0x38ea8e[_0x8626('0x10')](0x1f4,_0x2550ec['message']));});});};exports['GetContactRecallMe']=function(_0x1003e6){var _0x211fec=this;return new Promise(function(_0x3212bf,_0x117691){return db[_0x8626('0x20')][_0x8626('0x39')]()['then'](function(){return db[_0x8626('0x1e')]['transaction'](function(_0x1c8a17){return db['CmHopper'][_0x8626('0x4')]({'where':_0x1003e6[_0x8626('0x5')]?_0x1003e6[_0x8626('0x5')]['where']||null:null,'attributes':_0x1003e6[_0x8626('0x5')]?_0x1003e6['options'][_0x8626('0xb')]||null:null,'limit':0x1,'order':_0x1003e6[_0x8626('0x5')]?_0x1003e6[_0x8626('0x5')][_0x8626('0x3a')]||null:null,'group':db[_0x8626('0x13')][_0x8626('0x27')],'transaction':_0x1c8a17,'lock':_0x1c8a17['LOCK'][_0x8626('0x3b')],'include':_0x1003e6['options']?_0x1003e6[_0x8626('0x5')][_0x8626('0x8')]?_[_0x8626('0x9')](_0x1003e6[_0x8626('0x5')][_0x8626('0x8')],function(_0x490494){return{'model':db[_0x490494[_0x8626('0xa')]],'as':_0x490494['as'],'attributes':_0x490494[_0x8626('0xb')],'include':_0x490494['include']?_[_0x8626('0x9')](_0x490494['include'],function(_0x4fa4dc){return{'model':db[_0x4fa4dc[_0x8626('0xa')]],'as':_0x4fa4dc['as'],'attributes':_0x4fa4dc[_0x8626('0xb')],'include':_0x4fa4dc[_0x8626('0x8')]?_[_0x8626('0x9')](_0x4fa4dc['include'],function(_0x2f6509){return{'model':db[_0x2f6509['model']],'as':_0x2f6509['as'],'attributes':_0x2f6509[_0x8626('0xb')]};}):[]};}):[]};}):[]:[]})[_0x8626('0xc')](function(_0x13b48e){var _0x1a3128=[];for(var _0x31f280=0x0;_0x31f280<_0x13b48e[_0x8626('0x26')];_0x31f280+=0x1){_0x1a3128[_0x8626('0x28')](_0x13b48e[_0x31f280]['update'](_0x1003e6[_0x8626('0x17')],{'transaction':_0x1c8a17}));}return BPromise[_0x8626('0x2a')](_0x1a3128);});})[_0x8626('0xc')](function(_0x54a5ef){logger[_0x8626('0x15')](_0x8626('0x3c'),_0x1003e6);logger['debug'](_0x8626('0x3c'),_0x1003e6,JSON[_0x8626('0xe')](_0x54a5ef));_0x3212bf(_0x54a5ef);})[_0x8626('0xf')](function(_0x2c85a0){logger[_0x8626('0x10')]('GetContactRecallMe',_0x2c85a0['message'],_0x1003e6);_0x117691(_0x211fec[_0x8626('0x10')](0x1f4,_0x2c85a0[_0x8626('0x11')]));});});});};exports[_0x8626('0x3d')]=function(_0x2351e9){var _0x2ad19e=this;return new Promise(function(_0x3ac910,_0x2d3085){db['CmContact']['describe']()[_0x8626('0xc')](function(_0x3e1a0f){return db[_0x8626('0x13')][_0x8626('0x4')]({'raw':_0x2351e9[_0x8626('0x5')]?_0x2351e9[_0x8626('0x5')][_0x8626('0x14')]===undefined?!![]:![]:!![],'where':_0x2351e9['options']?_0x2351e9[_0x8626('0x5')]['where']||null:null,'attributes':_0x2351e9[_0x8626('0x5')]?_0x2351e9['options'][_0x8626('0xb')]||null:null,'limit':_0x2351e9[_0x8626('0x5')]?_0x2351e9[_0x8626('0x5')][_0x8626('0x7')]||null:null,'include':_0x2351e9['options']?_0x2351e9['options'][_0x8626('0x8')]?_[_0x8626('0x9')](_0x2351e9[_0x8626('0x5')][_0x8626('0x8')],function(_0x1d8b29){return{'model':db[_0x1d8b29['model']],'as':_0x1d8b29['as'],'attributes':_0x1d8b29['as']===_0x8626('0x21')?_['keys'](_0x3e1a0f):_0x1d8b29['attributes'],'include':_0x1d8b29['include']?_[_0x8626('0x9')](_0x1d8b29[_0x8626('0x8')],function(_0x44d507){return{'model':db[_0x44d507[_0x8626('0xa')]],'as':_0x44d507['as'],'attributes':_0x44d507[_0x8626('0xb')],'include':_0x44d507[_0x8626('0x8')]?_[_0x8626('0x9')](_0x44d507[_0x8626('0x8')],function(_0x138ccc){return{'model':db[_0x138ccc[_0x8626('0xa')]],'as':_0x138ccc['as'],'attributes':_0x138ccc[_0x8626('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11839a){logger['info'](_0x8626('0x3'),_0x2351e9);logger[_0x8626('0xd')](_0x8626('0x3'),_0x2351e9,JSON[_0x8626('0xe')](_0x11839a));_0x3ac910(_0x11839a);})[_0x8626('0xf')](function(_0x11ce1f){logger[_0x8626('0x10')](_0x8626('0x3'),_0x11ce1f['message'],_0x2351e9);_0x2d3085(_0x2ad19e['error'](0x1f4,_0x11ce1f[_0x8626('0x11')]));});});});};exports[_0x8626('0x3e')]=function(_0x2bd8ac){var _0x819914=this;return new Promise(function(_0x2594f2,_0x409575){return db['CmContact'][_0x8626('0x3f')]({'raw':!![],'where':{'phone':_0x2bd8ac['options']['where'][_0x8626('0x40')]},'attributes':['id',_0x8626('0x41')],'order':[['id',_0x8626('0x42')]]})[_0x8626('0xc')](function(_0x130ff4){logger['info'](_0x8626('0x43'),_0x2bd8ac);logger[_0x8626('0xd')](_0x8626('0x43'),_0x2bd8ac,JSON[_0x8626('0xe')](_0x130ff4));_0x2594f2(_0x130ff4);})[_0x8626('0xf')](function(_0x4a1d23){logger[_0x8626('0x10')](_0x8626('0x43'),_0x4a1d23[_0x8626('0x11')],_0x2bd8ac);_0x409575(_0x819914['error'](0x1f4,_0x4a1d23['message']));});});};exports[_0x8626('0x44')]=function(_0xae1305){var _0x462b74=this;return new Promise(function(_0x47ad30,_0x317f74){return db[_0x8626('0x1e')]['transaction'](function(_0xfdc559){var _0x16565d=_0xae1305['options']&&_0xae1305[_0x8626('0x5')][_0x8626('0x6')]?_0xae1305['options'][_0x8626('0x6')]:{};return db['CmHopper'][_0x8626('0x19')](_0xae1305['body'],{'where':_0x16565d,'transaction':_0xfdc559})[_0x8626('0xc')](function(_0x495046){logger[_0x8626('0x15')](_0x8626('0x44'),_0xae1305);logger[_0x8626('0xd')](_0x8626('0x44'),_0xae1305,JSON['stringify'](_0x495046));_0x47ad30(_0x495046);})['catch'](function(_0x3ceb26){logger[_0x8626('0x10')]('ResetActiveCalls',_0x3ceb26[_0x8626('0x11')],_0xae1305);_0x317f74(_0x462b74[_0x8626('0x10')](0x1f4,_0x3ceb26[_0x8626('0x11')]));});});});};exports[_0x8626('0x45')]=function(_0x3b7215){var _0x2086a9=this;var _0xb4b987=_0x3b7215[_0x8626('0x17')]['where'][_0x8626('0x46')];var _0x35e515=_0x3b7215[_0x8626('0x17')]['where']['interval'];var _0x161455=_0x3b7215[_0x8626('0x17')]['where'][_0x8626('0x47')];return new Promise(function(_0x5157b9,_0x3058e7){return db[_0x8626('0x13')]['findAll']({'where':{'voiceQueueId':{'$in':_0xb4b987},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize']['literal'](_0x8626('0x48')+_0x35e515+_0x8626('0x49')),'$gt':db[_0x8626('0x1e')][_0x8626('0x34')](_0x8626('0x4a'))}},'UserId':{'$in':_0x161455}},'include':[{'model':db[_0x8626('0x20')],'as':_0x8626('0x21')},{'model':db[_0x8626('0x4b')],'as':'Agent','attributes':['id',_0x8626('0x24'),_0x8626('0x25')]},{'model':db[_0x8626('0x4c')],'as':_0x8626('0x4d')}]})[_0x8626('0xc')](function(_0xc66063){if(_0xc66063[_0x8626('0x26')]>0x0){return db[_0x8626('0x1e')][_0x8626('0x1f')](function(_0x2a886f){return db['CmHopper'][_0x8626('0x19')]({'recallmeNotifiedDate':db[_0x8626('0x1e')][_0x8626('0x34')](_0x8626('0x4a'))},{'where':{'id':{'$in':_[_0x8626('0x9')](_0xc66063,'id')}},'transaction':_0x2a886f})[_0x8626('0xc')](function(){_0x5157b9(_0xc66063);})[_0x8626('0xf')](function(_0x586f9b){logger[_0x8626('0x10')](_0x8626('0x45'),_0x586f9b[_0x8626('0x11')],_0x3b7215);_0x3058e7(_0x2086a9[_0x8626('0x10')](0x1f4,_0x586f9b[_0x8626('0x11')]));});})[_0x8626('0xf')](function(_0x3f40fa){logger['error'](_0x8626('0x45'),_0x3f40fa[_0x8626('0x11')],_0x3b7215);_0x3058e7(_0x2086a9[_0x8626('0x10')](0x1f4,_0x3f40fa[_0x8626('0x11')]));});}else{_0x5157b9(_0xc66063);}});});}; \ No newline at end of file +var _0x2127=['CreateCmHopper','create','UpdateCmHopper','update','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','findAll','order','User','Agent','name','voicePause','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','LOCK','UPDATE','length','GetCmHopperPreview','Contact','keys','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','literal','NOW()\x20+\x20INTERVAL\x20','NOW()','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','options','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','error','message','ShowCmHopper','find','raw'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x2127,0x8a));var _0x7212=function(_0x4b1b84,_0xa9dba){_0x4b1b84=_0x4b1b84-0x0;var _0x48daf9=_0x2127[_0x4b1b84];return _0x48daf9;};'use strict';var _=require(_0x7212('0x0'));var util=require(_0x7212('0x1'));var moment=require(_0x7212('0x2'));var BPromise=require(_0x7212('0x3'));var db=require(_0x7212('0x4'))['db'];var logger=require(_0x7212('0x5'))(_0x7212('0x6'));exports[_0x7212('0x7')]=function(_0x1e4dc0){var _0x4d45e4=this;return new Promise(function(_0x49813c,_0x293eaf){return db[_0x7212('0x8')]['findAll']({'raw':_0x1e4dc0[_0x7212('0x9')]?_0x1e4dc0[_0x7212('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x1e4dc0[_0x7212('0x9')]?_0x1e4dc0['options'][_0x7212('0xa')]||null:null,'attributes':_0x1e4dc0[_0x7212('0x9')]?_0x1e4dc0['options'][_0x7212('0xb')]||null:null,'limit':_0x1e4dc0[_0x7212('0x9')]?_0x1e4dc0[_0x7212('0x9')][_0x7212('0xc')]||null:null,'include':_0x1e4dc0[_0x7212('0x9')]?_0x1e4dc0['options'][_0x7212('0xd')]?_[_0x7212('0xe')](_0x1e4dc0[_0x7212('0x9')]['include'],function(_0x290934){return{'model':db[_0x290934['model']],'as':_0x290934['as'],'attributes':_0x290934[_0x7212('0xb')],'include':_0x290934[_0x7212('0xd')]?_[_0x7212('0xe')](_0x290934[_0x7212('0xd')],function(_0x204a09){return{'model':db[_0x204a09[_0x7212('0xf')]],'as':_0x204a09['as'],'attributes':_0x204a09[_0x7212('0xb')],'include':_0x204a09[_0x7212('0xd')]?_[_0x7212('0xe')](_0x204a09[_0x7212('0xd')],function(_0x2334e6){return{'model':db[_0x2334e6[_0x7212('0xf')]],'as':_0x2334e6['as'],'attributes':_0x2334e6[_0x7212('0xb')]};}):[]};}):[]};}):[]:[]})[_0x7212('0x10')](function(_0x4b9b57){logger[_0x7212('0x11')](_0x7212('0x7'),_0x1e4dc0);logger[_0x7212('0x12')](_0x7212('0x7'),_0x1e4dc0,JSON[_0x7212('0x13')](_0x4b9b57));_0x49813c(_0x4b9b57);})[_0x7212('0x14')](function(_0x2cf4f0){logger[_0x7212('0x15')]('GetCmHopper',_0x2cf4f0[_0x7212('0x16')],_0x1e4dc0);_0x293eaf(_0x4d45e4[_0x7212('0x15')](0x1f4,_0x2cf4f0['message']));});});};exports[_0x7212('0x17')]=function(_0x2fdbe6){var _0x5f6004=this;return new Promise(function(_0x2048bc,_0x5c6fe1){return db[_0x7212('0x8')][_0x7212('0x18')]({'raw':_0x2fdbe6[_0x7212('0x9')]?_0x2fdbe6['options'][_0x7212('0x19')]===undefined?!![]:![]:!![],'where':_0x2fdbe6[_0x7212('0x9')]?_0x2fdbe6[_0x7212('0x9')][_0x7212('0xa')]||null:null,'attributes':_0x2fdbe6[_0x7212('0x9')]?_0x2fdbe6[_0x7212('0x9')]['attributes']||null:null,'include':_0x2fdbe6[_0x7212('0x9')]?_0x2fdbe6[_0x7212('0x9')][_0x7212('0xd')]?_['map'](_0x2fdbe6[_0x7212('0x9')]['include'],function(_0x30e1be){return{'model':db[_0x30e1be[_0x7212('0xf')]],'as':_0x30e1be['as'],'attributes':_0x30e1be[_0x7212('0xb')],'include':_0x30e1be[_0x7212('0xd')]?_[_0x7212('0xe')](_0x30e1be[_0x7212('0xd')],function(_0x7741e8){return{'model':db[_0x7741e8['model']],'as':_0x7741e8['as'],'attributes':_0x7741e8[_0x7212('0xb')],'include':_0x7741e8[_0x7212('0xd')]?_[_0x7212('0xe')](_0x7741e8['include'],function(_0x3d7411){return{'model':db[_0x3d7411['model']],'as':_0x3d7411['as'],'attributes':_0x3d7411[_0x7212('0xb')]};}):[]};}):[]};}):[]:[]})[_0x7212('0x10')](function(_0x3b8957){logger[_0x7212('0x11')](_0x7212('0x17'),_0x2fdbe6);logger[_0x7212('0x12')](_0x7212('0x17'),_0x2fdbe6,JSON[_0x7212('0x13')](_0x3b8957));_0x2048bc(_0x3b8957);})[_0x7212('0x14')](function(_0x1d3441){logger['error'](_0x7212('0x17'),_0x1d3441[_0x7212('0x16')],_0x2fdbe6);_0x5c6fe1(_0x5f6004['error'](0x1f4,_0x1d3441[_0x7212('0x16')]));});});};exports[_0x7212('0x1a')]=function(_0x127c53){var _0x2ef272=this;return new Promise(function(_0x36a74e,_0xa1f6dc){return db['CmHopper'][_0x7212('0x1b')](_0x127c53['body'],{'raw':_0x127c53['options']?_0x127c53[_0x7212('0x9')]['raw']===undefined?!![]:![]:!![]})[_0x7212('0x10')](function(_0x4eaec2){logger[_0x7212('0x11')](_0x7212('0x1a'),_0x127c53);logger[_0x7212('0x12')](_0x7212('0x1a'),_0x127c53,JSON['stringify'](_0x4eaec2));_0x36a74e(_0x4eaec2);})[_0x7212('0x14')](function(_0x15acac){logger[_0x7212('0x15')]('CreateCmHopper',_0x15acac[_0x7212('0x16')],_0x127c53);_0xa1f6dc(_0x2ef272[_0x7212('0x15')](0x1f4,_0x15acac[_0x7212('0x16')]));});});};exports[_0x7212('0x1c')]=function(_0x14f2d3){var _0x33c5ec=this;return new Promise(function(_0x116b98,_0x6bf1ad){return db[_0x7212('0x8')][_0x7212('0x1d')](_0x14f2d3[_0x7212('0x1e')],{'raw':_0x14f2d3[_0x7212('0x9')]?_0x14f2d3[_0x7212('0x9')][_0x7212('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14f2d3[_0x7212('0x9')]?_0x14f2d3[_0x7212('0x9')][_0x7212('0xa')]||null:null,'attributes':_0x14f2d3['options']?_0x14f2d3[_0x7212('0x9')][_0x7212('0xb')]||null:null,'limit':_0x14f2d3[_0x7212('0x9')]?_0x14f2d3[_0x7212('0x9')]['limit']||null:null})[_0x7212('0x10')](function(_0x54da93){logger[_0x7212('0x11')](_0x7212('0x1c'),_0x14f2d3);logger[_0x7212('0x11')](_0x7212('0x1f'),JSON[_0x7212('0x13')](_0x14f2d3[_0x7212('0x9')][_0x7212('0xa')]),_0x14f2d3[_0x7212('0x1e')][_0x7212('0x20')]);logger['debug'](_0x7212('0x1c'),_0x14f2d3,JSON[_0x7212('0x13')](_0x54da93));_0x116b98(_0x54da93);})['catch'](function(_0x140366){logger['error'](_0x7212('0x1c'),_0x140366[_0x7212('0x16')],_0x14f2d3);_0x6bf1ad(_0x33c5ec[_0x7212('0x15')](0x1f4,_0x140366[_0x7212('0x16')]));});});};exports[_0x7212('0x21')]=function(_0x1f7efa){var _0x3daef0=this;return new Promise(function(_0x121eba,_0x3766f8){return db[_0x7212('0x8')][_0x7212('0x22')]({'where':_0x1f7efa[_0x7212('0x9')]?_0x1f7efa[_0x7212('0x9')][_0x7212('0xa')]||null:null})[_0x7212('0x10')](function(_0x15c761){logger[_0x7212('0x11')](_0x7212('0x21'),_0x1f7efa);logger[_0x7212('0x12')](_0x7212('0x21'),_0x1f7efa,JSON[_0x7212('0x13')](_0x15c761));_0x121eba(_0x15c761);})['catch'](function(_0x5bc516){logger[_0x7212('0x15')]('DestroyCmHopper',_0x5bc516[_0x7212('0x16')],_0x1f7efa);_0x3766f8(_0x3daef0[_0x7212('0x15')](0x1f4,_0x5bc516[_0x7212('0x16')]));});});};exports[_0x7212('0x23')]=function(_0x6b5214){var _0x5461a8=this;return new Promise(function(_0x518e82,_0x107d20){return db[_0x7212('0x24')][_0x7212('0x25')]()['then'](function(_0xf6c42){return db[_0x7212('0x26')]['transaction'](function(_0x35a2af){return db[_0x7212('0x8')][_0x7212('0x27')]({'where':_0x6b5214['options']?_0x6b5214[_0x7212('0x9')]['where']||null:null,'attributes':_0x6b5214['options']?_0x6b5214['options']['attributes']||null:null,'limit':_0x6b5214[_0x7212('0x9')]?_0x6b5214['options'][_0x7212('0xc')]||null:null,'order':_0x6b5214[_0x7212('0x9')]?_0x6b5214[_0x7212('0x9')][_0x7212('0x28')]||null:null,'transaction':_0x35a2af,'lock':_0x35a2af['LOCK']['UPDATE'],'include':[{'model':db[_0x7212('0x24')],'as':'Contact','attributes':_['keys'](_0xf6c42)},{'model':db[_0x7212('0x29')],'as':_0x7212('0x2a'),'attributes':['id',_0x7212('0x2b'),_0x7212('0x2c')]}]})[_0x7212('0x10')](function(_0x25245d){var _0x16ed42=[];var _0xdd08af=[];for(var _0xb6ca29=0x0;_0xb6ca29<_0x25245d['length'];_0xb6ca29+=0x1){var _0x237716=_0x25245d[_0xb6ca29][_0x7212('0x2d')];if(_0x237716===null){_0x16ed42[_0x7212('0x2e')](_0x25245d[_0xb6ca29][_0x7212('0x1d')](_0x6b5214[_0x7212('0x1e')],{'transaction':_0x35a2af}));}else if(!_0xdd08af[_0x7212('0x2f')](_0x237716)){_0xdd08af[_0x7212('0x2e')](_0x237716);_0x16ed42[_0x7212('0x2e')](_0x25245d[_0xb6ca29]['update'](_0x6b5214[_0x7212('0x1e')],{'transaction':_0x35a2af}));}}return BPromise[_0x7212('0x30')](_0x16ed42);});})[_0x7212('0x10')](function(_0x280e1f){logger[_0x7212('0x11')](_0x7212('0x23'),_0x6b5214);if(_0x280e1f['length']>0x0){logger['info'](_0x7212('0x31'),_0x280e1f[0x0][_0x7212('0x32')]['id'],_0x280e1f[0x0][_0x7212('0x32')][_0x7212('0x33')],_0x280e1f[0x0]['dataValues'][_0x7212('0x20')]);}logger[_0x7212('0x12')](_0x7212('0x23'),_0x6b5214,JSON['stringify'](_0x280e1f));_0x518e82(_0x280e1f);})['catch'](function(_0x4a9ed3){logger[_0x7212('0x15')](_0x7212('0x23'),_0x4a9ed3[_0x7212('0x16')],_0x6b5214);_0x107d20(_0x5461a8['error'](0x1f4,_0x4a9ed3['message']));});});});};exports[_0x7212('0x34')]=function(_0x5e4254){var _0x59fcff=this;return new Promise(function(_0x2f2cb6,_0x4c9c02){return db[_0x7212('0x26')][_0x7212('0x35')](function(_0xfec660){return db[_0x7212('0x36')]['create'](_0x5e4254[_0x7212('0x1e')],{'raw':_0x5e4254[_0x7212('0x9')]?_0x5e4254[_0x7212('0x9')]['raw']===undefined?!![]:![]:!![],'transaction':_0xfec660})[_0x7212('0x10')](function(){logger[_0x7212('0x11')](_0x7212('0x37'),JSON['stringify'](_0x5e4254[_0x7212('0x9')][_0x7212('0xa')]),_0x5e4254[_0x7212('0x9')][_0x7212('0xa')][_0x7212('0x20')]);return db[_0x7212('0x8')][_0x7212('0x22')]({'where':_0x5e4254['options']?_0x5e4254[_0x7212('0x9')][_0x7212('0xa')]||null:null,'transaction':_0xfec660});});})['then'](function(_0x52be94){logger[_0x7212('0x11')]('MoveContactManagedDialer',_0x5e4254);logger['debug'](_0x7212('0x34'),_0x5e4254,JSON[_0x7212('0x13')](_0x52be94));_0x2f2cb6(_0x52be94);})[_0x7212('0x14')](function(_0x186b56){logger[_0x7212('0x15')](_0x7212('0x34'),_0x186b56[_0x7212('0x16')],_0x5e4254);_0x4c9c02(_0x59fcff[_0x7212('0x15')](0x1f4,_0x186b56['message']));});});};exports[_0x7212('0x38')]=function(_0x2988f7){var _0x574e0e=this;return new Promise(function(_0x4226ee,_0x43cd38){return db['CmHopper'][_0x7212('0x27')]({'raw':_0x2988f7[_0x7212('0x9')]?_0x2988f7['options'][_0x7212('0x19')]===undefined?!![]:![]:!![],'where':_0x2988f7[_0x7212('0x9')]?_0x2988f7['options'][_0x7212('0xa')]||null:null,'attributes':[[db[_0x7212('0x26')]['fn'](_0x7212('0x39'),db[_0x7212('0x26')]['fn']('IF',db[_0x7212('0x26')]['literal']('`scheduledat`\x20>=\x20'+util['format'](_0x7212('0x3a'),moment()[_0x7212('0x3b')](_0x7212('0x3c')))+_0x7212('0x3d')))),'contactsRescheduled']]})[_0x7212('0x10')](function(_0x626378){logger[_0x7212('0x11')](_0x7212('0x38'),_0x2988f7);logger[_0x7212('0x12')](_0x7212('0x38'),_0x2988f7,JSON[_0x7212('0x13')](_0x626378));_0x4226ee(_0x626378);})[_0x7212('0x14')](function(_0x31c883){logger[_0x7212('0x15')]('CountReScheduled',_0x31c883[_0x7212('0x16')],_0x2988f7);_0x43cd38(_0x574e0e[_0x7212('0x15')](0x1f4,_0x31c883['message']));});});};exports[_0x7212('0x3e')]=function(_0x2282ad){var _0x3bf370=this;return new Promise(function(_0x44126e,_0x56e1ea){return db[_0x7212('0x24')][_0x7212('0x25')]()[_0x7212('0x10')](function(){return db[_0x7212('0x26')][_0x7212('0x35')](function(_0x379fff){return db[_0x7212('0x8')][_0x7212('0x27')]({'where':_0x2282ad[_0x7212('0x9')]?_0x2282ad[_0x7212('0x9')][_0x7212('0xa')]||null:null,'attributes':_0x2282ad['options']?_0x2282ad[_0x7212('0x9')][_0x7212('0xb')]||null:null,'limit':0x1,'order':_0x2282ad[_0x7212('0x9')]?_0x2282ad[_0x7212('0x9')][_0x7212('0x28')]||null:null,'group':db[_0x7212('0x8')][_0x7212('0x2d')],'transaction':_0x379fff,'lock':_0x379fff[_0x7212('0x3f')][_0x7212('0x40')],'include':_0x2282ad[_0x7212('0x9')]?_0x2282ad[_0x7212('0x9')][_0x7212('0xd')]?_['map'](_0x2282ad[_0x7212('0x9')]['include'],function(_0x3f938c){return{'model':db[_0x3f938c[_0x7212('0xf')]],'as':_0x3f938c['as'],'attributes':_0x3f938c[_0x7212('0xb')],'include':_0x3f938c['include']?_[_0x7212('0xe')](_0x3f938c['include'],function(_0x93c2ee){return{'model':db[_0x93c2ee[_0x7212('0xf')]],'as':_0x93c2ee['as'],'attributes':_0x93c2ee[_0x7212('0xb')],'include':_0x93c2ee[_0x7212('0xd')]?_['map'](_0x93c2ee['include'],function(_0x16041a){return{'model':db[_0x16041a['model']],'as':_0x16041a['as'],'attributes':_0x16041a[_0x7212('0xb')]};}):[]};}):[]};}):[]:[]})[_0x7212('0x10')](function(_0x440604){var _0x1147b9=[];for(var _0x505b9b=0x0;_0x505b9b<_0x440604[_0x7212('0x41')];_0x505b9b+=0x1){_0x1147b9['push'](_0x440604[_0x505b9b][_0x7212('0x1d')](_0x2282ad[_0x7212('0x1e')],{'transaction':_0x379fff}));}return BPromise[_0x7212('0x30')](_0x1147b9);});})[_0x7212('0x10')](function(_0x5973ae){logger[_0x7212('0x11')](_0x7212('0x3e'),_0x2282ad);logger[_0x7212('0x12')]('GetContactRecallMe',_0x2282ad,JSON['stringify'](_0x5973ae));_0x44126e(_0x5973ae);})[_0x7212('0x14')](function(_0x41a6a3){logger[_0x7212('0x15')]('GetContactRecallMe',_0x41a6a3[_0x7212('0x16')],_0x2282ad);_0x56e1ea(_0x3bf370[_0x7212('0x15')](0x1f4,_0x41a6a3[_0x7212('0x16')]));});});});};exports[_0x7212('0x42')]=function(_0x447bba){var _0x17dc59=this;return new Promise(function(_0x3afe1c,_0x3a1793){db[_0x7212('0x24')][_0x7212('0x25')]()[_0x7212('0x10')](function(_0x1afdd2){return db[_0x7212('0x8')][_0x7212('0x27')]({'raw':_0x447bba[_0x7212('0x9')]?_0x447bba['options'][_0x7212('0x19')]===undefined?!![]:![]:!![],'where':_0x447bba[_0x7212('0x9')]?_0x447bba[_0x7212('0x9')][_0x7212('0xa')]||null:null,'attributes':_0x447bba[_0x7212('0x9')]?_0x447bba['options']['attributes']||null:null,'limit':_0x447bba['options']?_0x447bba[_0x7212('0x9')][_0x7212('0xc')]||null:null,'include':_0x447bba[_0x7212('0x9')]?_0x447bba[_0x7212('0x9')][_0x7212('0xd')]?_[_0x7212('0xe')](_0x447bba[_0x7212('0x9')][_0x7212('0xd')],function(_0x5c74db){return{'model':db[_0x5c74db[_0x7212('0xf')]],'as':_0x5c74db['as'],'attributes':_0x5c74db['as']===_0x7212('0x43')?_[_0x7212('0x44')](_0x1afdd2):_0x5c74db[_0x7212('0xb')],'include':_0x5c74db['include']?_[_0x7212('0xe')](_0x5c74db['include'],function(_0x55ff2e){return{'model':db[_0x55ff2e[_0x7212('0xf')]],'as':_0x55ff2e['as'],'attributes':_0x55ff2e[_0x7212('0xb')],'include':_0x55ff2e[_0x7212('0xd')]?_[_0x7212('0xe')](_0x55ff2e['include'],function(_0x1fc5b4){return{'model':db[_0x1fc5b4[_0x7212('0xf')]],'as':_0x1fc5b4['as'],'attributes':_0x1fc5b4['attributes']};}):[]};}):[]};}):[]:[]})[_0x7212('0x10')](function(_0x564fd8){logger[_0x7212('0x11')](_0x7212('0x7'),_0x447bba);logger['debug'](_0x7212('0x7'),_0x447bba,JSON[_0x7212('0x13')](_0x564fd8));_0x3afe1c(_0x564fd8);})[_0x7212('0x14')](function(_0x157ca8){logger[_0x7212('0x15')](_0x7212('0x7'),_0x157ca8[_0x7212('0x16')],_0x447bba);_0x3a1793(_0x17dc59['error'](0x1f4,_0x157ca8[_0x7212('0x16')]));});});});};exports['GetContactByPhone']=function(_0x214e81){var _0x205e14=this;return new Promise(function(_0x50274e,_0x39054e){return db[_0x7212('0x24')]['findOne']({'raw':!![],'where':{'phone':_0x214e81['options'][_0x7212('0xa')][_0x7212('0x45')]},'attributes':['id',_0x7212('0x46')],'order':[['id',_0x7212('0x47')]]})[_0x7212('0x10')](function(_0xee3560){logger[_0x7212('0x11')](_0x7212('0x48'),_0x214e81);logger[_0x7212('0x12')](_0x7212('0x48'),_0x214e81,JSON[_0x7212('0x13')](_0xee3560));_0x50274e(_0xee3560);})[_0x7212('0x14')](function(_0x2a85dc){logger[_0x7212('0x15')]('getContactByPhone',_0x2a85dc[_0x7212('0x16')],_0x214e81);_0x39054e(_0x205e14[_0x7212('0x15')](0x1f4,_0x2a85dc[_0x7212('0x16')]));});});};exports[_0x7212('0x49')]=function(_0x18d760){var _0x2ed5df=this;return new Promise(function(_0x5b12ec,_0xbd8d38){return db['sequelize']['transaction'](function(_0x5b7413){var _0x1b41a8=_0x18d760[_0x7212('0x9')]&&_0x18d760[_0x7212('0x9')][_0x7212('0xa')]?_0x18d760['options'][_0x7212('0xa')]:{};return db[_0x7212('0x8')]['update'](_0x18d760[_0x7212('0x1e')],{'where':_0x1b41a8,'transaction':_0x5b7413})['then'](function(_0x25e896){logger[_0x7212('0x11')](_0x7212('0x49'),_0x18d760);logger['debug']('ResetActiveCalls',_0x18d760,JSON[_0x7212('0x13')](_0x25e896));_0x5b12ec(_0x25e896);})['catch'](function(_0x3ed664){logger[_0x7212('0x15')](_0x7212('0x49'),_0x3ed664[_0x7212('0x16')],_0x18d760);_0xbd8d38(_0x2ed5df[_0x7212('0x15')](0x1f4,_0x3ed664[_0x7212('0x16')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x3d325f){var _0x19d02f=this;var _0x17e312=_0x3d325f[_0x7212('0x1e')][_0x7212('0xa')][_0x7212('0x4a')];var _0x2f3eaa=_0x3d325f[_0x7212('0x1e')][_0x7212('0xa')][_0x7212('0x4b')];var _0x34df71=_0x3d325f[_0x7212('0x1e')]['where']['availableAgentsIds'];return new Promise(function(_0xe1b975,_0x1f176d){return db[_0x7212('0x8')][_0x7212('0x27')]({'where':{'voiceQueueId':{'$in':_0x17e312},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x7212('0x4c')](_0x7212('0x4d')+_0x2f3eaa+'\x20MINUTE'),'$gt':db['sequelize']['literal'](_0x7212('0x4e'))}},'UserId':{'$in':_0x34df71}},'include':[{'model':db['CmContact'],'as':_0x7212('0x43')},{'model':db[_0x7212('0x29')],'as':'Agent','attributes':['id',_0x7212('0x2b'),_0x7212('0x2c')]},{'model':db[_0x7212('0x4f')],'as':_0x7212('0x50')}]})[_0x7212('0x10')](function(_0x3d3616){if(_0x3d3616[_0x7212('0x41')]>0x0){return db[_0x7212('0x26')]['transaction'](function(_0x145e5d){return db[_0x7212('0x8')]['update']({'recallmeNotifiedDate':db[_0x7212('0x26')]['literal'](_0x7212('0x4e'))},{'where':{'id':{'$in':_[_0x7212('0xe')](_0x3d3616,'id')}},'transaction':_0x145e5d})[_0x7212('0x10')](function(){_0xe1b975(_0x3d3616);})[_0x7212('0x14')](function(_0x4ac19d){logger['error'](_0x7212('0x51'),_0x4ac19d[_0x7212('0x16')],_0x3d325f);_0x1f176d(_0x19d02f['error'](0x1f4,_0x4ac19d[_0x7212('0x16')]));});})[_0x7212('0x14')](function(_0x3b4ab8){logger[_0x7212('0x15')]('CmHopperHandlePreviewRecallNotifications',_0x3b4ab8['message'],_0x3d325f);_0x1f176d(_0x19d02f[_0x7212('0x15')](0x1f4,_0x3b4ab8[_0x7212('0x16')]));});}else{_0xe1b975(_0x3d3616);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index fd2f1fd..cc577d7 100644 --- a/server/api/cmHopper/index.js +++ b/server/api/cmHopper/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f0f=['/:id/previewrecall','post','create','/preview','getPreview','/timezone','delete','destroy','express','Router','../../components/auth/service','./cmHopper.controller','isAuthenticated','index','get','/describe','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show'];(function(_0x3a2c1b,_0x5171d1){var _0x3f42d1=function(_0x212aad){while(--_0x212aad){_0x3a2c1b['push'](_0x3a2c1b['shift']());}};_0x3f42d1(++_0x5171d1);}(_0x4f0f,0x18f));var _0xf4f0=function(_0x19ba6a,_0x805578){_0x19ba6a=_0x19ba6a-0x0;var _0x2f506a=_0x4f0f[_0x19ba6a];return _0x2f506a;};'use strict';var express=require(_0xf4f0('0x0'));var router=express[_0xf4f0('0x1')]();var auth=require(_0xf4f0('0x2'));var controller=require(_0xf4f0('0x3'));router['get']('/',auth[_0xf4f0('0x4')](),controller[_0xf4f0('0x5')]);router[_0xf4f0('0x6')](_0xf4f0('0x7'),auth[_0xf4f0('0x4')](),controller[_0xf4f0('0x8')]);router[_0xf4f0('0x6')](_0xf4f0('0x9'),auth[_0xf4f0('0x4')](),controller[_0xf4f0('0xa')]);router[_0xf4f0('0x6')](_0xf4f0('0xb'),auth[_0xf4f0('0x4')](),controller[_0xf4f0('0xc')]);router['get'](_0xf4f0('0xd'),auth[_0xf4f0('0x4')](),controller[_0xf4f0('0xe')]);router[_0xf4f0('0x6')](_0xf4f0('0xf'),auth[_0xf4f0('0x4')](),controller['getPreviewRecall']);router[_0xf4f0('0x10')]('/',auth[_0xf4f0('0x4')](),controller[_0xf4f0('0x11')]);router[_0xf4f0('0x10')](_0xf4f0('0x12'),auth['isAuthenticated'](),controller[_0xf4f0('0x13')]);router[_0xf4f0('0x10')](_0xf4f0('0x14'),auth[_0xf4f0('0x4')](),controller['getTimezone']);router['put'](_0xf4f0('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xf4f0('0x15')]('/:id',auth[_0xf4f0('0x4')](),controller[_0xf4f0('0x16')]);module['exports']=router; \ No newline at end of file +var _0xcc60=['getTimezones','/:id','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','getTimezone','update','delete','destroy','Router','../../components/auth/service','get','index','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','/timezones'];(function(_0x5016d0,_0xaa7512){var _0x3f2cae=function(_0x1a8a5e){while(--_0x1a8a5e){_0x5016d0['push'](_0x5016d0['shift']());}};_0x3f2cae(++_0xaa7512);}(_0xcc60,0x1c2));var _0x0cc6=function(_0x4cc4af,_0xff9505){_0x4cc4af=_0x4cc4af-0x0;var _0x2bdac8=_0xcc60[_0x4cc4af];return _0x2bdac8;};'use strict';var express=require('express');var router=express[_0x0cc6('0x0')]();var auth=require(_0x0cc6('0x1'));var controller=require('./cmHopper.controller');router[_0x0cc6('0x2')]('/',auth['isAuthenticated'](),controller[_0x0cc6('0x3')]);router[_0x0cc6('0x2')](_0x0cc6('0x4'),auth[_0x0cc6('0x5')](),controller[_0x0cc6('0x6')]);router[_0x0cc6('0x2')](_0x0cc6('0x7'),auth['isAuthenticated'](),controller[_0x0cc6('0x8')]);router[_0x0cc6('0x2')](_0x0cc6('0x9'),auth[_0x0cc6('0x5')](),controller[_0x0cc6('0xa')]);router['get'](_0x0cc6('0xb'),auth[_0x0cc6('0x5')](),controller['show']);router[_0x0cc6('0x2')](_0x0cc6('0xc'),auth[_0x0cc6('0x5')](),controller[_0x0cc6('0xd')]);router[_0x0cc6('0xe')]('/',auth[_0x0cc6('0x5')](),controller[_0x0cc6('0xf')]);router[_0x0cc6('0xe')](_0x0cc6('0x10'),auth[_0x0cc6('0x5')](),controller[_0x0cc6('0x11')]);router[_0x0cc6('0xe')](_0x0cc6('0x12'),auth[_0x0cc6('0x5')](),controller[_0x0cc6('0x13')]);router['put']('/:id',auth[_0x0cc6('0x5')](),controller[_0x0cc6('0x14')]);router[_0x0cc6('0x15')]('/:id',auth[_0x0cc6('0x5')](),controller[_0x0cc6('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 674710a..db7cb5b 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x499f=['INTEGER','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x121504,_0x371cc3){var _0x54bc04=function(_0x2aa9b2){while(--_0x2aa9b2){_0x121504['push'](_0x121504['shift']());}};_0x54bc04(++_0x371cc3);}(_0x499f,0x1c7));var _0xf499=function(_0x51ec61,_0xf9d1e3){_0x51ec61=_0x51ec61-0x0;var _0x223200=_0x499f[_0x51ec61];return _0x223200;};'use strict';var moment=require(_0xf499('0x0'));var Sequelize=require('sequelize');module['exports']={'CmHopperId':{'type':Sequelize[_0xf499('0x1')]},'phone':{'type':Sequelize[_0xf499('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xf499('0x1')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xf499('0x3')],'defaultValue':moment()[_0xf499('0x4')](_0xf499('0x5'))},'countbusyretry':{'type':Sequelize[_0xf499('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf499('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf499('0x1')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xf499('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf499('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf499('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf499('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcd01=['YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','INTEGER','DATE','format'];(function(_0x3aae33,_0x4ad899){var _0x527e87=function(_0x524f74){while(--_0x524f74){_0x3aae33['push'](_0x3aae33['shift']());}};_0x527e87(++_0x4ad899);}(_0xcd01,0xd9));var _0x1cd0=function(_0x24136f,_0x526392){_0x24136f=_0x24136f-0x0;var _0x38dc46=_0xcd01[_0x24136f];return _0x38dc46;};'use strict';var moment=require('moment');var Sequelize=require(_0x1cd0('0x0'));module[_0x1cd0('0x1')]={'CmHopperId':{'type':Sequelize[_0x1cd0('0x2')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x1cd0('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x1cd0('0x3')],'defaultValue':moment()[_0x1cd0('0x4')](_0x1cd0('0x5'))},'countbusyretry':{'type':Sequelize[_0x1cd0('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1cd0('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x1cd0('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1cd0('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1cd0('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1cd0('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 9caa544..2383b43 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4156=['map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','count','includeAll','include','findAll','rows','show','params','options','catch','create','body','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','set','Content-Range','json','apply','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send'];(function(_0x31f1f7,_0x796534){var _0x29d68e=function(_0x37d5a7){while(--_0x37d5a7){_0x31f1f7['push'](_0x31f1f7['shift']());}};_0x29d68e(++_0x796534);}(_0x4156,0x15c));var _0x6415=function(_0x4e93ce,_0x4c67d6){_0x4e93ce=_0x4e93ce-0x0;var _0x16954d=_0x4156[_0x4e93ce];return _0x16954d;};'use strict';var emlformat=require(_0x6415('0x0'));var rimraf=require(_0x6415('0x1'));var zipdir=require(_0x6415('0x2'));var jsonpatch=require(_0x6415('0x3'));var rp=require(_0x6415('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6415('0x5'));var util=require(_0x6415('0x6'));var path=require(_0x6415('0x7'));var sox=require('sox');var csv=require(_0x6415('0x8'));var ejs=require(_0x6415('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6415('0xa'));var crypto=require('crypto');var jsforce=require(_0x6415('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6415('0xc'));var Redis=require('ioredis');var authService=require(_0x6415('0xd'));var qs=require(_0x6415('0xe'));var as=require(_0x6415('0xf'));var hardwareService=require(_0x6415('0x10'));var logger=require(_0x6415('0x11'))(_0x6415('0x12'));var utils=require(_0x6415('0x13'));var config=require(_0x6415('0x14'));var licenseUtil=require(_0x6415('0x15'));var db=require(_0x6415('0x16'))['db'];function respondWithStatusCode(_0x2d0b25,_0x35b190){_0x35b190=_0x35b190||0xcc;return function(_0x120f22){if(_0x120f22){return _0x2d0b25[_0x6415('0x17')](_0x35b190);}return _0x2d0b25[_0x6415('0x18')](_0x35b190)[_0x6415('0x19')]();};}function respondWithResult(_0x255bc3,_0x33c1ca){_0x33c1ca=_0x33c1ca||0xc8;return function(_0x4336dc){if(_0x4336dc){return _0x255bc3[_0x6415('0x18')](_0x33c1ca)['json'](_0x4336dc);}};}function respondWithFilteredResult(_0x3c9a50,_0x4f1143){return function(_0x428cc9){if(_0x428cc9){var _0x4001f3=typeof _0x4f1143[_0x6415('0x1a')]==='undefined'&&typeof _0x4f1143['limit']===_0x6415('0x1b');var _0x28c198=_0x428cc9['count'];var _0x27a49b=_0x4001f3?0x0:_0x4f1143['offset'];var _0x42f35a=_0x4001f3?_0x428cc9['count']:_0x4f1143['offset']+_0x4f1143['limit'];var _0x552531;if(_0x42f35a>=_0x28c198){_0x42f35a=_0x28c198;_0x552531=0xc8;}else{_0x552531=0xce;}_0x3c9a50[_0x6415('0x18')](_0x552531);return _0x3c9a50[_0x6415('0x1c')](_0x6415('0x1d'),_0x27a49b+'-'+_0x42f35a+'/'+_0x28c198)[_0x6415('0x1e')](_0x428cc9);}return null;};}function patchUpdates(_0x50a2e1){return function(_0x40ef96){try{jsonpatch[_0x6415('0x1f')](_0x40ef96,_0x50a2e1,!![]);}catch(_0xfd5e51){return BPromise['reject'](_0xfd5e51);}return _0x40ef96['save']();};}function saveUpdates(_0x3c8e89,_0x438716){return function(_0x534142){if(_0x534142){return _0x534142[_0x6415('0x20')](_0x3c8e89)[_0x6415('0x21')](function(_0x2fa88e){return _0x2fa88e;});}return null;};}function removeEntity(_0x5f00e9,_0x234e4e){return function(_0x246edd){if(_0x246edd){return _0x246edd[_0x6415('0x22')]()['then'](function(){var _0x130695=_0x246edd[_0x6415('0x23')]({'plain':!![]});var _0x48a0ac=_0x6415('0x24');return db[_0x6415('0x25')][_0x6415('0x22')]({'where':{'type':_0x48a0ac,'resourceId':_0x130695['id']}})[_0x6415('0x21')](function(){return _0x246edd;});})[_0x6415('0x21')](function(){_0x5f00e9[_0x6415('0x18')](0xcc)[_0x6415('0x19')]();});}};}function handleEntityNotFound(_0x2ce847,_0x19e2f0){return function(_0x4cb1c3){if(!_0x4cb1c3){_0x2ce847[_0x6415('0x17')](0x194);}return _0x4cb1c3;};}function handleError(_0x5cca,_0x5023da){_0x5023da=_0x5023da||0x1f4;return function(_0x312a45){logger[_0x6415('0x26')](_0x312a45[_0x6415('0x27')]);if(_0x312a45[_0x6415('0x28')]){delete _0x312a45[_0x6415('0x28')];}_0x5cca['status'](_0x5023da)[_0x6415('0x29')](_0x312a45);};}exports['index']=function(_0x869367,_0x1a1dba){var _0x3d7df9={},_0x1385fa={},_0x2f92ce={'count':0x0,'rows':[]};var _0x201561=_[_0x6415('0x2a')](db[_0x6415('0x2b')][_0x6415('0x2c')],function(_0x1c405d){return{'name':_0x1c405d[_0x6415('0x2d')],'type':_0x1c405d[_0x6415('0x2e')]['key']};});_0x1385fa['model']=_[_0x6415('0x2a')](_0x201561,_0x6415('0x28'));_0x1385fa[_0x6415('0x2f')]=_[_0x6415('0x30')](_0x869367[_0x6415('0x2f')]);_0x1385fa[_0x6415('0x31')]=_[_0x6415('0x32')](_0x1385fa[_0x6415('0x33')],_0x1385fa[_0x6415('0x2f')]);_0x3d7df9['attributes']=_[_0x6415('0x32')](_0x1385fa['model'],qs[_0x6415('0x34')](_0x869367[_0x6415('0x2f')][_0x6415('0x34')]));_0x3d7df9[_0x6415('0x35')]=_0x3d7df9[_0x6415('0x35')][_0x6415('0x36')]?_0x3d7df9['attributes']:_0x1385fa[_0x6415('0x33')];if(!_0x869367[_0x6415('0x2f')][_0x6415('0x37')](_0x6415('0x38'))){_0x3d7df9[_0x6415('0x39')]=qs[_0x6415('0x39')](_0x869367[_0x6415('0x2f')]['limit']);_0x3d7df9[_0x6415('0x1a')]=qs[_0x6415('0x1a')](_0x869367[_0x6415('0x2f')][_0x6415('0x1a')]);}_0x3d7df9['order']=qs['sort'](_0x869367[_0x6415('0x2f')][_0x6415('0x3a')]);_0x3d7df9[_0x6415('0x3b')]=qs['filters'](_[_0x6415('0x3c')](_0x869367[_0x6415('0x2f')],_0x1385fa[_0x6415('0x31')]),_0x201561);if(_0x869367[_0x6415('0x2f')]['filter']){_0x3d7df9[_0x6415('0x3b')]=_[_0x6415('0x3d')](_0x3d7df9[_0x6415('0x3b')],{'$or':_[_0x6415('0x2a')](_0x201561,function(_0x14fff3){if(_0x14fff3['type']!=='VIRTUAL'){var _0x2550d3={};_0x2550d3[_0x14fff3['name']]={'$like':'%'+_0x869367[_0x6415('0x2f')]['filter']+'%'};return _0x2550d3;}})});}_0x3d7df9=_[_0x6415('0x3d')]({},_0x3d7df9,_0x869367['options']);var _0x5923bd={'where':_0x3d7df9['where']};return db[_0x6415('0x2b')][_0x6415('0x3e')](_0x5923bd)[_0x6415('0x21')](function(_0x1f51a7){_0x2f92ce['count']=_0x1f51a7;if(_0x869367[_0x6415('0x2f')][_0x6415('0x3f')]){_0x3d7df9[_0x6415('0x40')]=[{'all':!![]}];}return db[_0x6415('0x2b')][_0x6415('0x41')](_0x3d7df9);})[_0x6415('0x21')](function(_0x22af6b){_0x2f92ce[_0x6415('0x42')]=_0x22af6b;return _0x2f92ce;})[_0x6415('0x21')](respondWithFilteredResult(_0x1a1dba,_0x3d7df9))['catch'](handleError(_0x1a1dba,null));};exports[_0x6415('0x43')]=function(_0xcc2dc,_0x40e4fd){var _0x32038e={'raw':!![],'where':{'id':_0xcc2dc[_0x6415('0x44')]['id']}},_0x4a8e11={};_0x4a8e11[_0x6415('0x33')]=_[_0x6415('0x30')](db[_0x6415('0x2b')][_0x6415('0x2c')]);_0x4a8e11[_0x6415('0x2f')]=_[_0x6415('0x30')](_0xcc2dc[_0x6415('0x2f')]);_0x4a8e11[_0x6415('0x31')]=_[_0x6415('0x32')](_0x4a8e11['model'],_0x4a8e11['query']);_0x32038e[_0x6415('0x35')]=_[_0x6415('0x32')](_0x4a8e11[_0x6415('0x33')],qs['fields'](_0xcc2dc['query'][_0x6415('0x34')]));_0x32038e[_0x6415('0x35')]=_0x32038e[_0x6415('0x35')][_0x6415('0x36')]?_0x32038e[_0x6415('0x35')]:_0x4a8e11[_0x6415('0x33')];if(_0xcc2dc['query']['includeAll']){_0x32038e[_0x6415('0x40')]=[{'all':!![]}];}_0x32038e=_[_0x6415('0x3d')]({},_0x32038e,_0xcc2dc[_0x6415('0x45')]);return db[_0x6415('0x2b')]['find'](_0x32038e)[_0x6415('0x21')](handleEntityNotFound(_0x40e4fd,null))['then'](respondWithResult(_0x40e4fd,null))[_0x6415('0x46')](handleError(_0x40e4fd,null));};exports[_0x6415('0x47')]=function(_0x52c943,_0x427795){return db['CmHopperAdditionalPhone'][_0x6415('0x47')](_0x52c943[_0x6415('0x48')],{})['then'](function(_0x247b99){var _0x19a2d3=_0x52c943['user'][_0x6415('0x23')]({'plain':!![]});if(!_0x19a2d3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19a2d3[_0x6415('0x49')]==='user'){var _0x3a11b0=_0x247b99[_0x6415('0x23')]({'plain':!![]});var _0x1ff4af='CmHopperAdditionalPhones';return db[_0x6415('0x4a')][_0x6415('0x4b')]({'where':{'name':_0x1ff4af,'userProfileId':_0x19a2d3[_0x6415('0x4c')]},'raw':!![]})[_0x6415('0x21')](function(_0x1f2533){if(_0x1f2533&&_0x1f2533['autoAssociation']===0x0){return db[_0x6415('0x25')]['create']({'name':_0x3a11b0[_0x6415('0x28')],'resourceId':_0x3a11b0['id'],'type':_0x1f2533['name'],'sectionId':_0x1f2533['id']},{})['then'](function(){return _0x247b99;});}else{return _0x247b99;}})[_0x6415('0x46')](function(_0x56819f){logger[_0x6415('0x26')](_0x6415('0x4d'),_0x56819f);throw _0x56819f;});}return _0x247b99;})[_0x6415('0x21')](respondWithResult(_0x427795,0xc9))['catch'](handleError(_0x427795,null));};exports[_0x6415('0x20')]=function(_0xba38fc,_0x29f41e){if(_0xba38fc[_0x6415('0x48')]['id']){delete _0xba38fc[_0x6415('0x48')]['id'];}return db[_0x6415('0x2b')][_0x6415('0x4b')]({'where':{'id':_0xba38fc[_0x6415('0x44')]['id']}})[_0x6415('0x21')](handleEntityNotFound(_0x29f41e,null))['then'](saveUpdates(_0xba38fc[_0x6415('0x48')],null))[_0x6415('0x21')](respondWithResult(_0x29f41e,null))[_0x6415('0x46')](handleError(_0x29f41e,null));};exports['destroy']=function(_0x2210f9,_0xe29720){return db['CmHopperAdditionalPhone'][_0x6415('0x4b')]({'where':{'id':_0x2210f9[_0x6415('0x44')]['id']}})['then'](handleEntityNotFound(_0xe29720,null))['then'](removeEntity(_0xe29720,null))[_0x6415('0x46')](handleError(_0xe29720,null));}; \ No newline at end of file +var _0x7277=['save','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0x157ef5,_0x2d2e5f){var _0x1f6596=function(_0x446c1d){while(--_0x446c1d){_0x157ef5['push'](_0x157ef5['shift']());}};_0x1f6596(++_0x2d2e5f);}(_0x7277,0x84));var _0x7727=function(_0x46a00e,_0x595365){_0x46a00e=_0x46a00e-0x0;var _0x1b3984=_0x7277[_0x46a00e];return _0x1b3984;};'use strict';var emlformat=require(_0x7727('0x0'));var rimraf=require(_0x7727('0x1'));var zipdir=require(_0x7727('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7727('0x3'));var moment=require('moment');var BPromise=require(_0x7727('0x4'));var Mustache=require(_0x7727('0x5'));var util=require(_0x7727('0x6'));var path=require('path');var sox=require(_0x7727('0x7'));var csv=require(_0x7727('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7727('0x9'));var _=require('lodash');var squel=require(_0x7727('0xa'));var crypto=require(_0x7727('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7727('0xc'));var Papa=require(_0x7727('0xd'));var Redis=require(_0x7727('0xe'));var authService=require(_0x7727('0xf'));var qs=require(_0x7727('0x10'));var as=require(_0x7727('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7727('0x12'));var utils=require(_0x7727('0x13'));var config=require(_0x7727('0x14'));var licenseUtil=require(_0x7727('0x15'));var db=require(_0x7727('0x16'))['db'];function respondWithStatusCode(_0x1887b4,_0x203654){_0x203654=_0x203654||0xcc;return function(_0x93fe64){if(_0x93fe64){return _0x1887b4[_0x7727('0x17')](_0x203654);}return _0x1887b4[_0x7727('0x18')](_0x203654)[_0x7727('0x19')]();};}function respondWithResult(_0x4979b3,_0x151d0d){_0x151d0d=_0x151d0d||0xc8;return function(_0x2582ef){if(_0x2582ef){return _0x4979b3[_0x7727('0x18')](_0x151d0d)[_0x7727('0x1a')](_0x2582ef);}};}function respondWithFilteredResult(_0x760572,_0x2065f8){return function(_0x567301){if(_0x567301){var _0x407ca3=typeof _0x2065f8[_0x7727('0x1b')]===_0x7727('0x1c')&&typeof _0x2065f8[_0x7727('0x1d')]==='undefined';var _0x715d7f=_0x567301[_0x7727('0x1e')];var _0x305054=_0x407ca3?0x0:_0x2065f8['offset'];var _0x191594=_0x407ca3?_0x567301[_0x7727('0x1e')]:_0x2065f8['offset']+_0x2065f8[_0x7727('0x1d')];var _0x572075;if(_0x191594>=_0x715d7f){_0x191594=_0x715d7f;_0x572075=0xc8;}else{_0x572075=0xce;}_0x760572[_0x7727('0x18')](_0x572075);return _0x760572['set'](_0x7727('0x1f'),_0x305054+'-'+_0x191594+'/'+_0x715d7f)[_0x7727('0x1a')](_0x567301);}return null;};}function patchUpdates(_0x2626a8){return function(_0x58a497){try{jsonpatch[_0x7727('0x20')](_0x58a497,_0x2626a8,!![]);}catch(_0x1fc08c){return BPromise[_0x7727('0x21')](_0x1fc08c);}return _0x58a497[_0x7727('0x22')]();};}function saveUpdates(_0xc2bbb8,_0x1e3760){return function(_0x25ac9e){if(_0x25ac9e){return _0x25ac9e['update'](_0xc2bbb8)[_0x7727('0x23')](function(_0x5bc02d){return _0x5bc02d;});}return null;};}function removeEntity(_0x5c5452,_0x3d2f92){return function(_0x518481){if(_0x518481){return _0x518481[_0x7727('0x24')]()['then'](function(){var _0x289e3a=_0x518481[_0x7727('0x25')]({'plain':!![]});var _0x114c86=_0x7727('0x26');return db[_0x7727('0x27')]['destroy']({'where':{'type':_0x114c86,'resourceId':_0x289e3a['id']}})[_0x7727('0x23')](function(){return _0x518481;});})[_0x7727('0x23')](function(){_0x5c5452[_0x7727('0x18')](0xcc)[_0x7727('0x19')]();});}};}function handleEntityNotFound(_0x2199a1,_0x2c2520){return function(_0x4cf606){if(!_0x4cf606){_0x2199a1['sendStatus'](0x194);}return _0x4cf606;};}function handleError(_0x33095b,_0x1981ac){_0x1981ac=_0x1981ac||0x1f4;return function(_0x519af1){logger[_0x7727('0x28')](_0x519af1['stack']);if(_0x519af1[_0x7727('0x29')]){delete _0x519af1['name'];}_0x33095b[_0x7727('0x18')](_0x1981ac)[_0x7727('0x2a')](_0x519af1);};}exports[_0x7727('0x2b')]=function(_0x46a64f,_0x4d7310){var _0x1971ca={},_0x26bd29={},_0xce5cf5={'count':0x0,'rows':[]};var _0x2f00bc=_[_0x7727('0x2c')](db[_0x7727('0x2d')][_0x7727('0x2e')],function(_0x199431){return{'name':_0x199431[_0x7727('0x2f')],'type':_0x199431[_0x7727('0x30')][_0x7727('0x31')]};});_0x26bd29[_0x7727('0x32')]=_[_0x7727('0x2c')](_0x2f00bc,'name');_0x26bd29[_0x7727('0x33')]=_['keys'](_0x46a64f[_0x7727('0x33')]);_0x26bd29[_0x7727('0x34')]=_[_0x7727('0x35')](_0x26bd29['model'],_0x26bd29[_0x7727('0x33')]);_0x1971ca[_0x7727('0x36')]=_['intersection'](_0x26bd29[_0x7727('0x32')],qs[_0x7727('0x37')](_0x46a64f[_0x7727('0x33')][_0x7727('0x37')]));_0x1971ca[_0x7727('0x36')]=_0x1971ca[_0x7727('0x36')][_0x7727('0x38')]?_0x1971ca[_0x7727('0x36')]:_0x26bd29[_0x7727('0x32')];if(!_0x46a64f[_0x7727('0x33')]['hasOwnProperty'](_0x7727('0x39'))){_0x1971ca[_0x7727('0x1d')]=qs[_0x7727('0x1d')](_0x46a64f[_0x7727('0x33')][_0x7727('0x1d')]);_0x1971ca['offset']=qs[_0x7727('0x1b')](_0x46a64f[_0x7727('0x33')][_0x7727('0x1b')]);}_0x1971ca['order']=qs[_0x7727('0x3a')](_0x46a64f[_0x7727('0x33')][_0x7727('0x3a')]);_0x1971ca[_0x7727('0x3b')]=qs[_0x7727('0x34')](_[_0x7727('0x3c')](_0x46a64f['query'],_0x26bd29[_0x7727('0x34')]),_0x2f00bc);if(_0x46a64f[_0x7727('0x33')][_0x7727('0x3d')]){_0x1971ca[_0x7727('0x3b')]=_[_0x7727('0x3e')](_0x1971ca['where'],{'$or':_[_0x7727('0x2c')](_0x2f00bc,function(_0x75b67){if(_0x75b67['type']!==_0x7727('0x3f')){var _0x830515={};_0x830515[_0x75b67[_0x7727('0x29')]]={'$like':'%'+_0x46a64f[_0x7727('0x33')][_0x7727('0x3d')]+'%'};return _0x830515;}})});}_0x1971ca=_['merge']({},_0x1971ca,_0x46a64f['options']);var _0x26bfc6={'where':_0x1971ca[_0x7727('0x3b')]};return db[_0x7727('0x2d')]['count'](_0x26bfc6)[_0x7727('0x23')](function(_0x195d45){_0xce5cf5[_0x7727('0x1e')]=_0x195d45;if(_0x46a64f['query'][_0x7727('0x40')]){_0x1971ca[_0x7727('0x41')]=[{'all':!![]}];}return db[_0x7727('0x2d')][_0x7727('0x42')](_0x1971ca);})['then'](function(_0x3bc5a7){_0xce5cf5[_0x7727('0x43')]=_0x3bc5a7;return _0xce5cf5;})[_0x7727('0x23')](respondWithFilteredResult(_0x4d7310,_0x1971ca))[_0x7727('0x44')](handleError(_0x4d7310,null));};exports[_0x7727('0x45')]=function(_0x1f929e,_0x1f2d6c){var _0x4925f4={'raw':!![],'where':{'id':_0x1f929e[_0x7727('0x46')]['id']}},_0x2f5d22={};_0x2f5d22[_0x7727('0x32')]=_[_0x7727('0x47')](db[_0x7727('0x2d')][_0x7727('0x2e')]);_0x2f5d22[_0x7727('0x33')]=_[_0x7727('0x47')](_0x1f929e['query']);_0x2f5d22[_0x7727('0x34')]=_[_0x7727('0x35')](_0x2f5d22[_0x7727('0x32')],_0x2f5d22[_0x7727('0x33')]);_0x4925f4['attributes']=_[_0x7727('0x35')](_0x2f5d22[_0x7727('0x32')],qs[_0x7727('0x37')](_0x1f929e[_0x7727('0x33')][_0x7727('0x37')]));_0x4925f4[_0x7727('0x36')]=_0x4925f4[_0x7727('0x36')][_0x7727('0x38')]?_0x4925f4['attributes']:_0x2f5d22['model'];if(_0x1f929e[_0x7727('0x33')][_0x7727('0x40')]){_0x4925f4['include']=[{'all':!![]}];}_0x4925f4=_[_0x7727('0x3e')]({},_0x4925f4,_0x1f929e[_0x7727('0x48')]);return db[_0x7727('0x2d')][_0x7727('0x49')](_0x4925f4)[_0x7727('0x23')](handleEntityNotFound(_0x1f2d6c,null))[_0x7727('0x23')](respondWithResult(_0x1f2d6c,null))[_0x7727('0x44')](handleError(_0x1f2d6c,null));};exports[_0x7727('0x4a')]=function(_0x46a04b,_0x50f184){return db[_0x7727('0x2d')][_0x7727('0x4a')](_0x46a04b[_0x7727('0x4b')],{})[_0x7727('0x23')](function(_0x415193){var _0x2b1fb1=_0x46a04b[_0x7727('0x4c')][_0x7727('0x25')]({'plain':!![]});if(!_0x2b1fb1)throw new Error(_0x7727('0x4d'));if(_0x2b1fb1[_0x7727('0x4e')]==='user'){var _0x14068f=_0x415193[_0x7727('0x25')]({'plain':!![]});var _0x4eadef='CmHopperAdditionalPhones';return db['UserProfileSection']['find']({'where':{'name':_0x4eadef,'userProfileId':_0x2b1fb1[_0x7727('0x4f')]},'raw':!![]})[_0x7727('0x23')](function(_0xb2b34f){if(_0xb2b34f&&_0xb2b34f[_0x7727('0x50')]===0x0){return db[_0x7727('0x27')][_0x7727('0x4a')]({'name':_0x14068f[_0x7727('0x29')],'resourceId':_0x14068f['id'],'type':_0xb2b34f[_0x7727('0x29')],'sectionId':_0xb2b34f['id']},{})[_0x7727('0x23')](function(){return _0x415193;});}else{return _0x415193;}})[_0x7727('0x44')](function(_0x559521){logger[_0x7727('0x28')](_0x7727('0x51'),_0x559521);throw _0x559521;});}return _0x415193;})['then'](respondWithResult(_0x50f184,0xc9))[_0x7727('0x44')](handleError(_0x50f184,null));};exports[_0x7727('0x52')]=function(_0x27b9b7,_0x137d4a){if(_0x27b9b7[_0x7727('0x4b')]['id']){delete _0x27b9b7['body']['id'];}return db[_0x7727('0x2d')][_0x7727('0x49')]({'where':{'id':_0x27b9b7[_0x7727('0x46')]['id']}})[_0x7727('0x23')](handleEntityNotFound(_0x137d4a,null))[_0x7727('0x23')](saveUpdates(_0x27b9b7[_0x7727('0x4b')],null))[_0x7727('0x23')](respondWithResult(_0x137d4a,null))[_0x7727('0x44')](handleError(_0x137d4a,null));};exports['destroy']=function(_0x1da7a9,_0x2f5be6){return db[_0x7727('0x2d')][_0x7727('0x49')]({'where':{'id':_0x1da7a9[_0x7727('0x46')]['id']}})[_0x7727('0x23')](handleEntityNotFound(_0x2f5be6,null))[_0x7727('0x23')](removeEntity(_0x2f5be6,null))[_0x7727('0x44')](handleError(_0x2f5be6,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 6976fb3..7645189 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe64a=['moment','bluebird','request-promise','path','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api'];(function(_0x2c0dc0,_0x19900d){var _0x4c0990=function(_0x530791){while(--_0x530791){_0x2c0dc0['push'](_0x2c0dc0['shift']());}};_0x4c0990(++_0x19900d);}(_0xe64a,0x1e0));var _0xae64=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe64a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xae64('0x0'));var util=require(_0xae64('0x1'));var logger=require(_0xae64('0x2'))(_0xae64('0x3'));var moment=require(_0xae64('0x4'));var BPromise=require(_0xae64('0x5'));var rp=require(_0xae64('0x6'));var fs=require('fs');var path=require(_0xae64('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperAdditionalPhone.attributes');module['exports']=function(_0x2b1046,_0x896007){return _0x2b1046[_0xae64('0x8')](_0xae64('0x9'),attributes,{'tableName':_0xae64('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ba6=['request-promise','path','rimraf','../../config/environment','exports','define','cm_hopper_additional_phones','util','api'];(function(_0x1e17df,_0x31e2af){var _0x390268=function(_0x27cdba){while(--_0x27cdba){_0x1e17df['push'](_0x1e17df['shift']());}};_0x390268(++_0x31e2af);}(_0x3ba6,0x73));var _0x63ba=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0x3ba6[_0x1597e2];return _0x4c8c0a;};'use strict';var _=require('lodash');var util=require(_0x63ba('0x0'));var logger=require('../../config/logger')(_0x63ba('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x63ba('0x2'));var fs=require('fs');var path=require(_0x63ba('0x3'));var rimraf=require(_0x63ba('0x4'));var config=require(_0x63ba('0x5'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x63ba('0x6')]=function(_0x6ce43d,_0x241d93){return _0x6ce43d[_0x63ba('0x7')]('CmHopperAdditionalPhone',attributes,{'tableName':_0x63ba('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 3550b78..63b588e 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x73f1=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','VerifyAdditionalPhones','findOne','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','entity','dialGlobalMaxRetry','countabandonedretry','countmachineretry','CmHopper','ContactId','duration','waitTime','scheduledat','add','minutes','phone','isNil','createdAt','updatedAt','update','activateAdditionalPhone','IncrementPreviewCounters'];(function(_0x208c54,_0x120a70){var _0x4b0116=function(_0x32be34){while(--_0x32be34){_0x208c54['push'](_0x208c54['shift']());}};_0x4b0116(++_0x120a70);}(_0x73f1,0x74));var _0x173f=function(_0x54508f,_0x112b5a){_0x54508f=_0x54508f-0x0;var _0x3ddd0b=_0x73f1[_0x54508f];return _0x3ddd0b;};'use strict';var _=require(_0x173f('0x0'));var util=require(_0x173f('0x1'));var moment=require(_0x173f('0x2'));var BPromise=require(_0x173f('0x3'));var rs=require(_0x173f('0x4'));var fs=require('fs');var Redis=require(_0x173f('0x5'));var db=require(_0x173f('0x6'))['db'];var utils=require(_0x173f('0x7'));var logger=require(_0x173f('0x8'))(_0x173f('0x9'));var config=require(_0x173f('0xa'));var jayson=require(_0x173f('0xb'));var client=jayson[_0x173f('0xc')][_0x173f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4c268a,_0x175ab9,_0x332c99){return new BPromise(function(_0x5e8e1b,_0x39f261){return client[_0x173f('0xe')](_0x4c268a,_0x332c99)[_0x173f('0xf')](function(_0x2b3f04){logger[_0x173f('0x10')](_0x173f('0x11'),_0x175ab9,_0x173f('0x12'));logger[_0x173f('0x13')](_0x173f('0x14'),_0x175ab9,'request\x20sent',JSON[_0x173f('0x15')](_0x2b3f04));if(_0x2b3f04[_0x173f('0x16')]){if(_0x2b3f04[_0x173f('0x16')]['code']===0x1f4){logger[_0x173f('0x16')](_0x173f('0x11'),_0x175ab9,_0x2b3f04[_0x173f('0x16')][_0x173f('0x17')]);return _0x39f261(_0x2b3f04[_0x173f('0x16')]['message']);}logger[_0x173f('0x16')](_0x173f('0x11'),_0x175ab9,_0x2b3f04[_0x173f('0x16')][_0x173f('0x17')]);return _0x5e8e1b(_0x2b3f04[_0x173f('0x16')][_0x173f('0x17')]);}else{logger[_0x173f('0x10')](_0x173f('0x11'),_0x175ab9,_0x173f('0x12'));_0x5e8e1b(_0x2b3f04['result']['message']);}})[_0x173f('0x18')](function(_0x116459){logger[_0x173f('0x16')](_0x173f('0x11'),_0x175ab9,_0x116459);_0x39f261(_0x116459);});});}exports[_0x173f('0x19')]=function(_0x189a97){var _0x34c480=this;return new Promise(function(_0x54547b,_0xe92d6d){return db['CmHopper'][_0x173f('0x1a')]({'raw':!![],'where':{'ContactId':_0x189a97['body']['ContactId'],'ListId':_0x189a97[_0x173f('0x1b')][_0x173f('0x1c')],'VoiceQueueId':_0x189a97[_0x173f('0x1b')][_0x173f('0x1d')]===undefined?null:_0x189a97[_0x173f('0x1b')][_0x173f('0x1d')],'CampaignId':_0x189a97[_0x173f('0x1b')][_0x173f('0x1e')]===undefined?null:_0x189a97[_0x173f('0x1b')][_0x173f('0x1e')]}})['then'](function(_0x38311f){if(_0x38311f!=null){return db[_0x173f('0x1f')][_0x173f('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x38311f['id'],'OrderBy':{'$gt':_0x38311f[_0x173f('0x20')]}},'order':[['OrderBy',_0x173f('0x21')]]})['then'](function(_0x452831){var _0x27b8a7=0x0;if(_0x452831){if(_0x452831[_0x173f('0x22')]+_0x452831[_0x173f('0x23')]+_0x452831[_0x173f('0x24')]+_0x452831[_0x173f('0x25')]+_0x452831[_0x173f('0x26')]+_0x452831['countabandonedretry']+_0x452831['countmachineretry']+_0x452831[_0x173f('0x27')]<_0x189a97[_0x173f('0x28')][_0x173f('0x29')])_0x27b8a7=0x1;_0x54547b({'additional':_0x27b8a7});}else{return db[_0x173f('0x1f')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x38311f['id']},'order':[[_0x173f('0x20'),'ASC']]})[_0x173f('0xf')](function(_0x815d88){var _0x43a882=0x0;if(_0x815d88){if(_0x815d88[_0x173f('0x22')]+_0x815d88['countcongestionretry']+_0x815d88[_0x173f('0x24')]+_0x815d88['countnosuchnumberretry']+_0x815d88['countdropretry']+_0x815d88[_0x173f('0x2a')]+_0x815d88[_0x173f('0x2b')]+_0x815d88[_0x173f('0x27')]<_0x189a97[_0x173f('0x28')][_0x173f('0x29')])_0x43a882=0x1;_0x54547b({'additional':_0x43a882});}else{_0x54547b({'additional':0x0});}})[_0x173f('0x18')](function(_0x1a3032){logger[_0x173f('0x16')](_0x173f('0x19'),_0x1a3032[_0x173f('0x17')]);_0xe92d6d(_0x34c480[_0x173f('0x16')](0x1f4,_0x1a3032[_0x173f('0x17')]));});}})['catch'](function(_0x2e1c86){logger[_0x173f('0x16')](_0x173f('0x19'),_0x2e1c86[_0x173f('0x17')]);_0xe92d6d(_0x34c480[_0x173f('0x16')](0x1f4,_0x2e1c86[_0x173f('0x17')]));});}else _0x54547b({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x1e0655){var _0x15ad27=this;return new Promise(function(_0x339140,_0x4fb30d){return db[_0x173f('0x2c')][_0x173f('0x1a')]({'raw':!![],'where':{'ContactId':_0x1e0655[_0x173f('0x1b')][_0x173f('0x2d')],'ListId':_0x1e0655[_0x173f('0x1b')]['ListId'],'VoiceQueueId':_0x1e0655['body']['VoiceQueueId']===undefined?null:_0x1e0655[_0x173f('0x1b')][_0x173f('0x1d')],'CampaignId':_0x1e0655[_0x173f('0x1b')][_0x173f('0x1e')]===undefined?null:_0x1e0655[_0x173f('0x1b')][_0x173f('0x1e')]}})['then'](function(_0x192302){if(_0x192302!=null){return db[_0x173f('0x1f')][_0x173f('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x192302['id'],'OrderBy':{'$gte':_0x192302[_0x173f('0x20')]}},'order':[['OrderBy',_0x173f('0x21')]]})['then'](function(_0x12144f){if(_0x12144f)return activateAdditionalPhone(_0x192302,_0x1e0655['body'],_0x12144f,_0x1e0655[_0x173f('0x2e')],_0x1e0655['waitTime'])[_0x173f('0xf')](function(_0x5a065d){_0x339140(_0x5a065d);});else{return db[_0x173f('0x1f')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x192302['id']},'order':[[_0x173f('0x20'),_0x173f('0x21')]]})['then'](function(_0x29fdc6){if(_0x29fdc6)return activateAdditionalPhone(_0x192302,_0x1e0655[_0x173f('0x1b')],_0x29fdc6,_0x1e0655['duration'],_0x1e0655[_0x173f('0x2f')])[_0x173f('0xf')](function(_0x17755c){_0x339140(_0x17755c);});else{_0x339140({'id':_0x192302['id'],'phone':''});}})[_0x173f('0x18')](function(_0x3ce568){logger['error'](_0x173f('0x19'),_0x3ce568[_0x173f('0x17')]);_0x4fb30d(_0x15ad27[_0x173f('0x16')](0x1f4,_0x3ce568[_0x173f('0x17')]));});}})['catch'](function(_0x5b403e){logger[_0x173f('0x16')]('VerifyAdditionalPhones',_0x5b403e['message']);_0x4fb30d(_0x15ad27[_0x173f('0x16')](0x1f4,_0x5b403e[_0x173f('0x17')]));});}else _0x339140(0x1);});});};function activateAdditionalPhone(_0x5b0b0b,_0x24af6b,_0x5273a1,_0x5a2bb3,_0x20d4d9){return new Promise(function(_0x5b10b8,_0x200f2e){var _0x9caaa1;if(_['isNil'](_0x5273a1['scheduledat'])){_0x5273a1[_0x173f('0x30')]=moment();}if(moment()>moment(_0x5273a1[_0x173f('0x30')])){_0x9caaa1=moment()[_0x173f('0x31')](_0x20d4d9||0x3,_0x173f('0x32'));}else{if(_0x5273a1[_0x173f('0x20')]==0x0){_0x9caaa1=moment(_0x5273a1['scheduledat']);}else{_0x9caaa1=moment()['add'](_0x20d4d9||0x3,_0x173f('0x32'));}}if(_['isNil'](_0x9caaa1)){_0x9caaa1=moment()[_0x173f('0x31')](_0x20d4d9||0x3,'minutes');}var _0x28b47b={'phone':_0x5b0b0b[_0x173f('0x33')],'active':0x0,'OrderBy':_[_0x173f('0x34')](_0x5b0b0b[_0x173f('0x20')])?0x0:_0x5b0b0b[_0x173f('0x20')],'scheduledat':moment()[_0x173f('0x31')](_0x5a2bb3||0x1,'minutes'),'countbusyretry':_0x24af6b['countbusyretry'],'countcongestionretry':_0x24af6b[_0x173f('0x23')],'countnoanswerretry':_0x24af6b['countnoanswerretry'],'countnosuchnumberretry':_0x24af6b['countnosuchnumberretry'],'countdropretry':_0x24af6b[_0x173f('0x26')],'countabandonedretry':_0x24af6b[_0x173f('0x2a')],'countmachineretry':_0x24af6b[_0x173f('0x2b')],'countagentrejectretry':_0x24af6b['countagentrejectretry'],'createdAt':_0x24af6b[_0x173f('0x35')],'updatedAt':_0x24af6b[_0x173f('0x36')]};var _0x7be251={'CmHopperId':_0x5b0b0b['id'],'phone':_0x5273a1[_0x173f('0x33')],'active':0x0,'OrderBy':_[_0x173f('0x34')](_0x5273a1[_0x173f('0x20')])?0x0:_0x5273a1[_0x173f('0x20')],'scheduledat':_0x9caaa1,'countbusyretry':_0x5273a1[_0x173f('0x22')],'countcongestionretry':_0x5273a1[_0x173f('0x23')],'countnoanswerretry':_0x5273a1[_0x173f('0x24')],'countnosuchnumberretry':_0x5273a1['countnosuchnumberretry'],'countdropretry':_0x5273a1[_0x173f('0x26')],'countabandonedretry':_0x5273a1[_0x173f('0x2a')],'countmachineretry':_0x5273a1['countmachineretry'],'countagentrejectretry':_0x5273a1['countagentrejectretry'],'createdAt':_0x5273a1['createdAt'],'updatedAt':_0x5273a1[_0x173f('0x36')]};return db['sequelize']['transaction'](function(_0x4b79a3){return db[_0x173f('0x1f')][_0x173f('0x37')](_0x28b47b,{'where':{'id':_0x5273a1['id']}},{'transaction':_0x4b79a3})[_0x173f('0xf')](function(){return db[_0x173f('0x2c')]['update'](_0x7be251,{'where':{'id':_0x5b0b0b['id']}},{'transaction':_0x4b79a3});});})[_0x173f('0xf')](function(_0x568b66){_0x5b10b8({'id':_0x5b0b0b['id'],'phone':_0x5273a1[_0x173f('0x33')]});})[_0x173f('0x18')](function(_0x238a15){logger['error'](_0x173f('0x38'),_0x238a15[_0x173f('0x17')]);_0x200f2e({'error':_0x238a15['message']});});});}exports[_0x173f('0x39')]=function(_0x23a347){var _0x2001e5=this;return new Promise(function(_0x27c7a1,_0x12e62f){return db[_0x173f('0x2c')][_0x173f('0x37')](_0x23a347[_0x173f('0x1b')]['field'],{'where':{'id':_0x23a347[_0x173f('0x1b')]['id']}})['then'](function(_0x660ae5){_0x27c7a1(_0x660ae5);})['catch'](function(_0x542e38){logger['error'](_0x173f('0x39'),_0x542e38[_0x173f('0x17')]);_0x12e62f(_0x2001e5[_0x173f('0x16')](0x1f4,_0x542e38[_0x173f('0x17')]));});});}; \ No newline at end of file +var _0x8a85=['CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','VerifyAdditionalPhones','body','ContactId','ListId','VoiceQueueId','CampaignId','findOne','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countnosuchnumberretry','countdropretry','countagentrejectretry','catch','SwapAdditionalPhones','CmHopper','duration','waitTime','isNil','scheduledat','add','minutes','updatedAt','phone','createdAt','sequelize','update','activateAdditionalPhone','IncrementPreviewCounters','field','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info'];(function(_0x616fb8,_0x177e11){var _0x739e20=function(_0xfe27e9){while(--_0xfe27e9){_0x616fb8['push'](_0x616fb8['shift']());}};_0x739e20(++_0x177e11);}(_0x8a85,0x64));var _0x58a8=function(_0x37f433,_0x53c8f3){_0x37f433=_0x37f433-0x0;var _0x13d946=_0x8a85[_0x37f433];return _0x13d946;};'use strict';var _=require('lodash');var util=require(_0x58a8('0x0'));var moment=require('moment');var BPromise=require(_0x58a8('0x1'));var rs=require(_0x58a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x58a8('0x3'));var logger=require(_0x58a8('0x4'))(_0x58a8('0x5'));var config=require(_0x58a8('0x6'));var jayson=require(_0x58a8('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2b35d4,_0x17824c,_0x32f0d3){return new BPromise(function(_0x474aac,_0x1aceb1){return client['request'](_0x2b35d4,_0x32f0d3)[_0x58a8('0x8')](function(_0x427f42){logger[_0x58a8('0x9')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x17824c,'request\x20sent');logger['debug'](_0x58a8('0xa'),_0x17824c,_0x58a8('0xb'),JSON[_0x58a8('0xc')](_0x427f42));if(_0x427f42[_0x58a8('0xd')]){if(_0x427f42[_0x58a8('0xd')][_0x58a8('0xe')]===0x1f4){logger[_0x58a8('0xd')](_0x58a8('0xf'),_0x17824c,_0x427f42['error'][_0x58a8('0x10')]);return _0x1aceb1(_0x427f42[_0x58a8('0xd')][_0x58a8('0x10')]);}logger[_0x58a8('0xd')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x17824c,_0x427f42[_0x58a8('0xd')][_0x58a8('0x10')]);return _0x474aac(_0x427f42[_0x58a8('0xd')]['message']);}else{logger[_0x58a8('0x9')](_0x58a8('0xf'),_0x17824c,_0x58a8('0xb'));_0x474aac(_0x427f42[_0x58a8('0x11')][_0x58a8('0x10')]);}})['catch'](function(_0x1e45cf){logger['error'](_0x58a8('0xf'),_0x17824c,_0x1e45cf);_0x1aceb1(_0x1e45cf);});});}exports[_0x58a8('0x12')]=function(_0x241854){var _0x46db7c=this;return new Promise(function(_0x2cc44b,_0x47237f){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x241854[_0x58a8('0x13')][_0x58a8('0x14')],'ListId':_0x241854[_0x58a8('0x13')][_0x58a8('0x15')],'VoiceQueueId':_0x241854[_0x58a8('0x13')][_0x58a8('0x16')]===undefined?null:_0x241854[_0x58a8('0x13')][_0x58a8('0x16')],'CampaignId':_0x241854[_0x58a8('0x13')][_0x58a8('0x17')]===undefined?null:_0x241854['body'][_0x58a8('0x17')]}})['then'](function(_0x473dc3){if(_0x473dc3!=null){return db['CmHopperAdditionalPhone'][_0x58a8('0x18')]({'raw':!![],'where':{'CmHopperId':_0x473dc3['id'],'OrderBy':{'$gt':_0x473dc3[_0x58a8('0x19')]}},'order':[[_0x58a8('0x19'),_0x58a8('0x1a')]]})[_0x58a8('0x8')](function(_0x5f4ac3){var _0x3306f5=0x0;if(_0x5f4ac3){if(_0x5f4ac3[_0x58a8('0x1b')]+_0x5f4ac3[_0x58a8('0x1c')]+_0x5f4ac3[_0x58a8('0x1d')]+_0x5f4ac3['countnosuchnumberretry']+_0x5f4ac3['countdropretry']+_0x5f4ac3[_0x58a8('0x1e')]+_0x5f4ac3[_0x58a8('0x1f')]+_0x5f4ac3['countagentrejectretry']<_0x241854[_0x58a8('0x20')][_0x58a8('0x21')])_0x3306f5=0x1;_0x2cc44b({'additional':_0x3306f5});}else{return db[_0x58a8('0x22')][_0x58a8('0x18')]({'raw':!![],'where':{'CmHopperId':_0x473dc3['id']},'order':[[_0x58a8('0x19'),_0x58a8('0x1a')]]})[_0x58a8('0x8')](function(_0x11c916){var _0x52fe37=0x0;if(_0x11c916){if(_0x11c916[_0x58a8('0x1b')]+_0x11c916[_0x58a8('0x1c')]+_0x11c916[_0x58a8('0x1d')]+_0x11c916[_0x58a8('0x23')]+_0x11c916[_0x58a8('0x24')]+_0x11c916['countabandonedretry']+_0x11c916[_0x58a8('0x1f')]+_0x11c916[_0x58a8('0x25')]<_0x241854[_0x58a8('0x20')][_0x58a8('0x21')])_0x52fe37=0x1;_0x2cc44b({'additional':_0x52fe37});}else{_0x2cc44b({'additional':0x0});}})['catch'](function(_0xee55b3){logger[_0x58a8('0xd')](_0x58a8('0x12'),_0xee55b3[_0x58a8('0x10')]);_0x47237f(_0x46db7c[_0x58a8('0xd')](0x1f4,_0xee55b3['message']));});}})[_0x58a8('0x26')](function(_0x5d1140){logger['error']('VerifyAdditionalPhones',_0x5d1140['message']);_0x47237f(_0x46db7c[_0x58a8('0xd')](0x1f4,_0x5d1140['message']));});}else _0x2cc44b({'additional':0x0});});});};exports[_0x58a8('0x27')]=function(_0x27c257){var _0x2b8ca3=this;return new Promise(function(_0x29f356,_0x3d2404){return db[_0x58a8('0x28')][_0x58a8('0x18')]({'raw':!![],'where':{'ContactId':_0x27c257[_0x58a8('0x13')][_0x58a8('0x14')],'ListId':_0x27c257[_0x58a8('0x13')][_0x58a8('0x15')],'VoiceQueueId':_0x27c257[_0x58a8('0x13')][_0x58a8('0x16')]===undefined?null:_0x27c257[_0x58a8('0x13')][_0x58a8('0x16')],'CampaignId':_0x27c257[_0x58a8('0x13')][_0x58a8('0x17')]===undefined?null:_0x27c257['body']['CampaignId']}})['then'](function(_0xcbea7){if(_0xcbea7!=null){return db['CmHopperAdditionalPhone'][_0x58a8('0x18')]({'raw':!![],'where':{'CmHopperId':_0xcbea7['id'],'OrderBy':{'$gte':_0xcbea7[_0x58a8('0x19')]}},'order':[[_0x58a8('0x19'),_0x58a8('0x1a')]]})['then'](function(_0xf79089){if(_0xf79089)return activateAdditionalPhone(_0xcbea7,_0x27c257[_0x58a8('0x13')],_0xf79089,_0x27c257[_0x58a8('0x29')],_0x27c257[_0x58a8('0x2a')])[_0x58a8('0x8')](function(_0x5c0364){_0x29f356(_0x5c0364);});else{return db[_0x58a8('0x22')][_0x58a8('0x18')]({'raw':!![],'where':{'CmHopperId':_0xcbea7['id']},'order':[['OrderBy',_0x58a8('0x1a')]]})[_0x58a8('0x8')](function(_0x309a20){if(_0x309a20)return activateAdditionalPhone(_0xcbea7,_0x27c257[_0x58a8('0x13')],_0x309a20,_0x27c257[_0x58a8('0x29')],_0x27c257[_0x58a8('0x2a')])[_0x58a8('0x8')](function(_0x2ca70e){_0x29f356(_0x2ca70e);});else{_0x29f356({'id':_0xcbea7['id'],'phone':''});}})[_0x58a8('0x26')](function(_0x5c938a){logger[_0x58a8('0xd')]('VerifyAdditionalPhones',_0x5c938a[_0x58a8('0x10')]);_0x3d2404(_0x2b8ca3[_0x58a8('0xd')](0x1f4,_0x5c938a[_0x58a8('0x10')]));});}})[_0x58a8('0x26')](function(_0x2de08b){logger['error'](_0x58a8('0x12'),_0x2de08b['message']);_0x3d2404(_0x2b8ca3[_0x58a8('0xd')](0x1f4,_0x2de08b[_0x58a8('0x10')]));});}else _0x29f356(0x1);});});};function activateAdditionalPhone(_0x4529eb,_0x208209,_0x10b0f4,_0x468663,_0x18e164){return new Promise(function(_0x296640,_0x27e74e){var _0x40b1b5;if(_[_0x58a8('0x2b')](_0x10b0f4[_0x58a8('0x2c')])){_0x10b0f4[_0x58a8('0x2c')]=moment();}if(moment()>moment(_0x10b0f4['scheduledat'])){_0x40b1b5=moment()[_0x58a8('0x2d')](_0x18e164||0x3,_0x58a8('0x2e'));}else{if(_0x10b0f4[_0x58a8('0x19')]==0x0){_0x40b1b5=moment(_0x10b0f4[_0x58a8('0x2c')]);}else{_0x40b1b5=moment()[_0x58a8('0x2d')](_0x18e164||0x3,_0x58a8('0x2e'));}}if(_[_0x58a8('0x2b')](_0x40b1b5)){_0x40b1b5=moment()[_0x58a8('0x2d')](_0x18e164||0x3,_0x58a8('0x2e'));}var _0x4ef815={'phone':_0x4529eb['phone'],'active':0x0,'OrderBy':_[_0x58a8('0x2b')](_0x4529eb['OrderBy'])?0x0:_0x4529eb[_0x58a8('0x19')],'scheduledat':moment()[_0x58a8('0x2d')](_0x468663||0x1,_0x58a8('0x2e')),'countbusyretry':_0x208209[_0x58a8('0x1b')],'countcongestionretry':_0x208209[_0x58a8('0x1c')],'countnoanswerretry':_0x208209[_0x58a8('0x1d')],'countnosuchnumberretry':_0x208209['countnosuchnumberretry'],'countdropretry':_0x208209['countdropretry'],'countabandonedretry':_0x208209[_0x58a8('0x1e')],'countmachineretry':_0x208209[_0x58a8('0x1f')],'countagentrejectretry':_0x208209[_0x58a8('0x25')],'createdAt':_0x208209['createdAt'],'updatedAt':_0x208209[_0x58a8('0x2f')]};var _0x3c3dcf={'CmHopperId':_0x4529eb['id'],'phone':_0x10b0f4[_0x58a8('0x30')],'active':0x0,'OrderBy':_['isNil'](_0x10b0f4[_0x58a8('0x19')])?0x0:_0x10b0f4['OrderBy'],'scheduledat':_0x40b1b5,'countbusyretry':_0x10b0f4['countbusyretry'],'countcongestionretry':_0x10b0f4['countcongestionretry'],'countnoanswerretry':_0x10b0f4[_0x58a8('0x1d')],'countnosuchnumberretry':_0x10b0f4[_0x58a8('0x23')],'countdropretry':_0x10b0f4['countdropretry'],'countabandonedretry':_0x10b0f4['countabandonedretry'],'countmachineretry':_0x10b0f4[_0x58a8('0x1f')],'countagentrejectretry':_0x10b0f4[_0x58a8('0x25')],'createdAt':_0x10b0f4[_0x58a8('0x31')],'updatedAt':_0x10b0f4['updatedAt']};return db[_0x58a8('0x32')]['transaction'](function(_0x21d5aa){return db[_0x58a8('0x22')][_0x58a8('0x33')](_0x4ef815,{'where':{'id':_0x10b0f4['id']}},{'transaction':_0x21d5aa})[_0x58a8('0x8')](function(){return db[_0x58a8('0x28')][_0x58a8('0x33')](_0x3c3dcf,{'where':{'id':_0x4529eb['id']}},{'transaction':_0x21d5aa});});})[_0x58a8('0x8')](function(_0x5b3666){_0x296640({'id':_0x4529eb['id'],'phone':_0x10b0f4[_0x58a8('0x30')]});})[_0x58a8('0x26')](function(_0x503c76){logger[_0x58a8('0xd')](_0x58a8('0x34'),_0x503c76[_0x58a8('0x10')]);_0x27e74e({'error':_0x503c76['message']});});});}exports[_0x58a8('0x35')]=function(_0x5d0a0b){var _0x32dcbd=this;return new Promise(function(_0x19ffb5,_0x2b308a){return db[_0x58a8('0x28')][_0x58a8('0x33')](_0x5d0a0b['body'][_0x58a8('0x36')],{'where':{'id':_0x5d0a0b[_0x58a8('0x13')]['id']}})[_0x58a8('0x8')](function(_0x24d12a){_0x19ffb5(_0x24d12a);})[_0x58a8('0x26')](function(_0x5298e4){logger[_0x58a8('0xd')](_0x58a8('0x35'),_0x5298e4[_0x58a8('0x10')]);_0x2b308a(_0x32dcbd[_0x58a8('0xd')](0x1f4,_0x5298e4[_0x58a8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 60b5070..43da0ec 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc65=['isAuthenticated','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/:id','show','post'];(function(_0x1df530,_0x7b2772){var _0x2cc8d8=function(_0x1e3650){while(--_0x1e3650){_0x1df530['push'](_0x1df530['shift']());}};_0x2cc8d8(++_0x7b2772);}(_0xcc65,0x71));var _0x5cc6=function(_0x21b359,_0x4dc80e){_0x21b359=_0x21b359-0x0;var _0x57b8e7=_0xcc65[_0x21b359];return _0x57b8e7;};'use strict';var multer=require(_0x5cc6('0x0'));var util=require('util');var path=require(_0x5cc6('0x1'));var timeout=require(_0x5cc6('0x2'));var express=require(_0x5cc6('0x3'));var router=express[_0x5cc6('0x4')]();var fs_extra=require(_0x5cc6('0x5'));var auth=require(_0x5cc6('0x6'));var interaction=require(_0x5cc6('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperAdditionalPhone.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x5cc6('0x8')]);router[_0x5cc6('0x9')](_0x5cc6('0xa'),auth['isAuthenticated'](),controller[_0x5cc6('0xb')]);router[_0x5cc6('0xc')]('/',auth[_0x5cc6('0xd')](),controller['create']);router[_0x5cc6('0xe')]('/:id',auth[_0x5cc6('0xd')](),controller[_0x5cc6('0xf')]);router[_0x5cc6('0x10')]('/:id',auth[_0x5cc6('0xd')](),controller['destroy']);module[_0x5cc6('0x11')]=router; \ No newline at end of file +var _0xf3b2=['connect-timeout','express','Router','fs-extra','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','get','/:id','show','post','create','put','destroy','multer','path'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xf3b2,0x152));var _0x2f3b=function(_0x5c1829,_0x5e5b18){_0x5c1829=_0x5c1829-0x0;var _0x45dd65=_0xf3b2[_0x5c1829];return _0x45dd65;};'use strict';var multer=require(_0x2f3b('0x0'));var util=require('util');var path=require(_0x2f3b('0x1'));var timeout=require(_0x2f3b('0x2'));var express=require(_0x2f3b('0x3'));var router=express[_0x2f3b('0x4')]();var fs_extra=require(_0x2f3b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2f3b('0x6'));var controller=require(_0x2f3b('0x7'));router['get']('/',auth[_0x2f3b('0x8')](),controller[_0x2f3b('0x9')]);router[_0x2f3b('0xa')](_0x2f3b('0xb'),auth[_0x2f3b('0x8')](),controller[_0x2f3b('0xc')]);router[_0x2f3b('0xd')]('/',auth[_0x2f3b('0x8')](),controller[_0x2f3b('0xe')]);router[_0x2f3b('0xf')]('/:id',auth[_0x2f3b('0x8')](),controller['update']);router['delete'](_0x2f3b('0xb'),auth[_0x2f3b('0x8')](),controller[_0x2f3b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index f04e223..fdaf80c 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.attributes.js +++ b/server/api/cmHopperBlack/cmHopperBlack.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc17=['exports','STRING','contactListQueue','INTEGER','moment','sequelize'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x198e88,_0x1e4ebf){_0x198e88=_0x198e88-0x0;var _0x3ed988=_0xfc17[_0x198e88];return _0x3ed988;};'use strict';var moment=require(_0x7fc1('0x0'));var Sequelize=require(_0x7fc1('0x1'));module[_0x7fc1('0x2')]={'phone':{'type':Sequelize[_0x7fc1('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x7fc1('0x4')},'ListId':{'type':Sequelize[_0x7fc1('0x5')],'unique':_0x7fc1('0x4')},'VoiceQueueId':{'type':Sequelize[_0x7fc1('0x5')],'unique':_0x7fc1('0x4')}}; \ No newline at end of file +var _0xb8f1=['contactListQueue','moment','sequelize','STRING','INTEGER'];(function(_0x4a4d88,_0x2be95a){var _0x479329=function(_0x37bb8e){while(--_0x37bb8e){_0x4a4d88['push'](_0x4a4d88['shift']());}};_0x479329(++_0x2be95a);}(_0xb8f1,0x15f));var _0x1b8f=function(_0x493bb7,_0x26e7a4){_0x493bb7=_0x493bb7-0x0;var _0xe727c6=_0xb8f1[_0x493bb7];return _0xe727c6;};'use strict';var moment=require(_0x1b8f('0x0'));var Sequelize=require(_0x1b8f('0x1'));module['exports']={'phone':{'type':Sequelize[_0x1b8f('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x1b8f('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x1b8f('0x4')},'VoiceQueueId':{'type':Sequelize[_0x1b8f('0x3')],'unique':_0x1b8f('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 3bebe3d..c7046f9 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.controller.js +++ b/server/api/cmHopperBlack/cmHopperBlack.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x056d=['stack','name','send','index','CmHopperBlack','rawAttributes','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x056d,0xa6));var _0xd056=function(_0x23ace9,_0x2d4ed2){_0x23ace9=_0x23ace9-0x0;var _0x40a4fe=_0x056d[_0x23ace9];return _0x40a4fe;};'use strict';var emlformat=require(_0xd056('0x0'));var rimraf=require(_0xd056('0x1'));var zipdir=require(_0xd056('0x2'));var jsonpatch=require(_0xd056('0x3'));var rp=require(_0xd056('0x4'));var moment=require(_0xd056('0x5'));var BPromise=require(_0xd056('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd056('0x7'));var sox=require(_0xd056('0x8'));var csv=require(_0xd056('0x9'));var ejs=require(_0xd056('0xa'));var fs=require('fs');var fs_extra=require(_0xd056('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd056('0xc'));var jsforce=require(_0xd056('0xd'));var deskjs=require(_0xd056('0xe'));var toCsv=require(_0xd056('0x9'));var querystring=require(_0xd056('0xf'));var Papa=require('papaparse');var Redis=require(_0xd056('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd056('0x11'));var hardwareService=require(_0xd056('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd056('0x13'))['db'];function respondWithStatusCode(_0x3ff91f,_0x3ba811){_0x3ba811=_0x3ba811||0xcc;return function(_0xcb80ac){if(_0xcb80ac){return _0x3ff91f[_0xd056('0x14')](_0x3ba811);}return _0x3ff91f[_0xd056('0x15')](_0x3ba811)[_0xd056('0x16')]();};}function respondWithResult(_0x39b7d9,_0x44260e){_0x44260e=_0x44260e||0xc8;return function(_0x3e2f09){if(_0x3e2f09){return _0x39b7d9[_0xd056('0x15')](_0x44260e)[_0xd056('0x17')](_0x3e2f09);}};}function respondWithFilteredResult(_0x171bf7,_0x3d5ac2){return function(_0x30ff0e){if(_0x30ff0e){var _0x3f6bdf=typeof _0x3d5ac2[_0xd056('0x18')]===_0xd056('0x19')&&typeof _0x3d5ac2[_0xd056('0x1a')]===_0xd056('0x19');var _0x5b7430=_0x30ff0e['count'];var _0x291ad2=_0x3f6bdf?0x0:_0x3d5ac2[_0xd056('0x18')];var _0x4d187e=_0x3f6bdf?_0x30ff0e[_0xd056('0x1b')]:_0x3d5ac2[_0xd056('0x18')]+_0x3d5ac2['limit'];var _0x1ed921;if(_0x4d187e>=_0x5b7430){_0x4d187e=_0x5b7430;_0x1ed921=0xc8;}else{_0x1ed921=0xce;}_0x171bf7[_0xd056('0x15')](_0x1ed921);return _0x171bf7[_0xd056('0x1c')](_0xd056('0x1d'),_0x291ad2+'-'+_0x4d187e+'/'+_0x5b7430)[_0xd056('0x17')](_0x30ff0e);}return null;};}function patchUpdates(_0x135a8c){return function(_0x21107a){try{jsonpatch['apply'](_0x21107a,_0x135a8c,!![]);}catch(_0xd3a2f1){return BPromise['reject'](_0xd3a2f1);}return _0x21107a[_0xd056('0x1e')]();};}function saveUpdates(_0x8958f6,_0x370085){return function(_0x4406ea){if(_0x4406ea){return _0x4406ea[_0xd056('0x1f')](_0x8958f6)[_0xd056('0x20')](function(_0x944c0b){return _0x944c0b;});}return null;};}function removeEntity(_0x2fa0b5,_0x3b2f9f){return function(_0x5b8a3b){if(_0x5b8a3b){return _0x5b8a3b[_0xd056('0x21')]()[_0xd056('0x20')](function(){_0x2fa0b5[_0xd056('0x15')](0xcc)[_0xd056('0x16')]();});}};}function handleEntityNotFound(_0x44da3d,_0x3c1f1e){return function(_0x4c4bc3){if(!_0x4c4bc3){_0x44da3d[_0xd056('0x14')](0x194);}return _0x4c4bc3;};}function handleError(_0x3f3bc5,_0x56d78f){_0x56d78f=_0x56d78f||0x1f4;return function(_0x189512){logger[_0xd056('0x22')](_0x189512[_0xd056('0x23')]);if(_0x189512[_0xd056('0x24')]){delete _0x189512[_0xd056('0x24')];}_0x3f3bc5['status'](_0x56d78f)[_0xd056('0x25')](_0x189512);};}exports[_0xd056('0x26')]=function(_0x225376,_0x13a4ab){var _0x420cf5={},_0x440bae={},_0x50bf3c={'count':0x0,'rows':[]};var _0x14c18a=_['map'](db[_0xd056('0x27')][_0xd056('0x28')],function(_0x35b885){return{'name':_0x35b885['fieldName'],'type':_0x35b885[_0xd056('0x29')][_0xd056('0x2a')]};});_0x440bae['model']=_[_0xd056('0x2b')](_0x14c18a,_0xd056('0x24'));_0x440bae[_0xd056('0x2c')]=_[_0xd056('0x2d')](_0x225376[_0xd056('0x2c')]);_0x440bae[_0xd056('0x2e')]=_[_0xd056('0x2f')](_0x440bae['model'],_0x440bae['query']);_0x420cf5[_0xd056('0x30')]=_[_0xd056('0x2f')](_0x440bae[_0xd056('0x31')],qs['fields'](_0x225376['query'][_0xd056('0x32')]));_0x420cf5[_0xd056('0x30')]=_0x420cf5[_0xd056('0x30')][_0xd056('0x33')]?_0x420cf5[_0xd056('0x30')]:_0x440bae[_0xd056('0x31')];if(!_0x225376[_0xd056('0x2c')][_0xd056('0x34')]('nolimit')){_0x420cf5[_0xd056('0x1a')]=qs['limit'](_0x225376[_0xd056('0x2c')][_0xd056('0x1a')]);_0x420cf5[_0xd056('0x18')]=qs[_0xd056('0x18')](_0x225376['query'][_0xd056('0x18')]);}_0x420cf5[_0xd056('0x35')]=qs['sort'](_0x225376[_0xd056('0x2c')]['sort']);_0x420cf5[_0xd056('0x36')]=qs[_0xd056('0x2e')](_[_0xd056('0x37')](_0x225376[_0xd056('0x2c')],_0x440bae['filters']),_0x14c18a);if(_0x225376[_0xd056('0x2c')][_0xd056('0x38')]){_0x420cf5[_0xd056('0x36')]=_[_0xd056('0x39')](_0x420cf5[_0xd056('0x36')],{'$or':_[_0xd056('0x2b')](_0x14c18a,function(_0x5c54ef){if(_0x5c54ef[_0xd056('0x29')]!==_0xd056('0x3a')){var _0x4427b5={};_0x4427b5[_0x5c54ef[_0xd056('0x24')]]={'$like':'%'+_0x225376['query'][_0xd056('0x38')]+'%'};return _0x4427b5;}})});}_0x420cf5=_[_0xd056('0x39')]({},_0x420cf5,_0x225376[_0xd056('0x3b')]);var _0x4026da={'where':_0x420cf5['where']};return db[_0xd056('0x27')][_0xd056('0x1b')](_0x4026da)[_0xd056('0x20')](function(_0x5e0d59){_0x50bf3c[_0xd056('0x1b')]=_0x5e0d59;if(_0x225376[_0xd056('0x2c')]['includeAll']){_0x420cf5[_0xd056('0x3c')]=[{'all':!![]}];}return db[_0xd056('0x27')][_0xd056('0x3d')](_0x420cf5);})[_0xd056('0x20')](function(_0x2426e5){_0x50bf3c['rows']=_0x2426e5;return _0x50bf3c;})['then'](respondWithFilteredResult(_0x13a4ab,_0x420cf5))[_0xd056('0x3e')](handleError(_0x13a4ab,null));};exports['show']=function(_0x2fc7d9,_0x4a77e7){var _0x162b23={'raw':!![],'where':{'id':_0x2fc7d9[_0xd056('0x3f')]['id']}},_0x86c248={};_0x86c248[_0xd056('0x31')]=_[_0xd056('0x2d')](db[_0xd056('0x27')][_0xd056('0x28')]);_0x86c248[_0xd056('0x2c')]=_[_0xd056('0x2d')](_0x2fc7d9['query']);_0x86c248[_0xd056('0x2e')]=_['intersection'](_0x86c248[_0xd056('0x31')],_0x86c248['query']);_0x162b23[_0xd056('0x30')]=_[_0xd056('0x2f')](_0x86c248[_0xd056('0x31')],qs[_0xd056('0x32')](_0x2fc7d9[_0xd056('0x2c')][_0xd056('0x32')]));_0x162b23['attributes']=_0x162b23['attributes']['length']?_0x162b23['attributes']:_0x86c248[_0xd056('0x31')];if(_0x2fc7d9[_0xd056('0x2c')]['includeAll']){_0x162b23[_0xd056('0x3c')]=[{'all':!![]}];}_0x162b23=_[_0xd056('0x39')]({},_0x162b23,_0x2fc7d9['options']);return db['CmHopperBlack'][_0xd056('0x40')](_0x162b23)[_0xd056('0x20')](handleEntityNotFound(_0x4a77e7,null))[_0xd056('0x20')](respondWithResult(_0x4a77e7,null))[_0xd056('0x3e')](handleError(_0x4a77e7,null));};exports[_0xd056('0x1f')]=function(_0x2f82b4,_0x15cd2f){if(_0x2f82b4['body']['id']){delete _0x2f82b4[_0xd056('0x41')]['id'];}return db[_0xd056('0x27')][_0xd056('0x40')]({'where':{'id':_0x2f82b4['params']['id']}})['then'](handleEntityNotFound(_0x15cd2f,null))[_0xd056('0x20')](saveUpdates(_0x2f82b4['body'],null))[_0xd056('0x20')](respondWithResult(_0x15cd2f,null))['catch'](handleError(_0x15cd2f,null));};exports[_0xd056('0x21')]=function(_0x1c39a0,_0x5009fd){return db[_0xd056('0x27')][_0xd056('0x40')]({'where':{'id':_0x1c39a0[_0xd056('0x3f')]['id']}})[_0xd056('0x20')](handleEntityNotFound(_0x5009fd,null))['then'](removeEntity(_0x5009fd,null))[_0xd056('0x3e')](handleError(_0x5009fd,null));};exports[_0xd056('0x42')]=function(_0x1bfa32,_0x41582b){return db[_0xd056('0x27')][_0xd056('0x42')]()[_0xd056('0x20')](respondWithResult(_0x41582b,null))[_0xd056('0x3e')](handleError(_0x41582b,null));}; \ No newline at end of file +var _0xf40b=['keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','options','findAll','rows','catch','show','include','body','find','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','map','CmHopperBlack','rawAttributes','fieldName','query'];(function(_0x31f9bd,_0x544e9b){var _0x291f0e=function(_0x476024){while(--_0x476024){_0x31f9bd['push'](_0x31f9bd['shift']());}};_0x291f0e(++_0x544e9b);}(_0xf40b,0xf7));var _0xbf40=function(_0x51de21,_0x2143bb){_0x51de21=_0x51de21-0x0;var _0x11e461=_0xf40b[_0x51de21];return _0x11e461;};'use strict';var emlformat=require(_0xbf40('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf40('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf40('0x2'));var moment=require(_0xbf40('0x3'));var BPromise=require(_0xbf40('0x4'));var Mustache=require(_0xbf40('0x5'));var util=require(_0xbf40('0x6'));var path=require(_0xbf40('0x7'));var sox=require(_0xbf40('0x8'));var csv=require('to-csv');var ejs=require(_0xbf40('0x9'));var fs=require('fs');var fs_extra=require(_0xbf40('0xa'));var _=require(_0xbf40('0xb'));var squel=require(_0xbf40('0xc'));var crypto=require(_0xbf40('0xd'));var jsforce=require(_0xbf40('0xe'));var deskjs=require(_0xbf40('0xf'));var toCsv=require(_0xbf40('0x10'));var querystring=require(_0xbf40('0x11'));var Papa=require(_0xbf40('0x12'));var Redis=require(_0xbf40('0x13'));var authService=require(_0xbf40('0x14'));var qs=require(_0xbf40('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf40('0x16'))(_0xbf40('0x17'));var utils=require(_0xbf40('0x18'));var config=require(_0xbf40('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xbf40('0x1a'))['db'];function respondWithStatusCode(_0x5c6fa6,_0xb1fa36){_0xb1fa36=_0xb1fa36||0xcc;return function(_0xe759ce){if(_0xe759ce){return _0x5c6fa6[_0xbf40('0x1b')](_0xb1fa36);}return _0x5c6fa6['status'](_0xb1fa36)[_0xbf40('0x1c')]();};}function respondWithResult(_0x1d3045,_0x81c2a4){_0x81c2a4=_0x81c2a4||0xc8;return function(_0x3aa14a){if(_0x3aa14a){return _0x1d3045[_0xbf40('0x1d')](_0x81c2a4)[_0xbf40('0x1e')](_0x3aa14a);}};}function respondWithFilteredResult(_0x566daa,_0x4857d1){return function(_0x5cc271){if(_0x5cc271){var _0x70e952=typeof _0x4857d1[_0xbf40('0x1f')]===_0xbf40('0x20')&&typeof _0x4857d1[_0xbf40('0x21')]==='undefined';var _0x4bc7c3=_0x5cc271['count'];var _0x3326af=_0x70e952?0x0:_0x4857d1[_0xbf40('0x1f')];var _0x15c7e9=_0x70e952?_0x5cc271[_0xbf40('0x22')]:_0x4857d1['offset']+_0x4857d1[_0xbf40('0x21')];var _0x31dc5f;if(_0x15c7e9>=_0x4bc7c3){_0x15c7e9=_0x4bc7c3;_0x31dc5f=0xc8;}else{_0x31dc5f=0xce;}_0x566daa['status'](_0x31dc5f);return _0x566daa[_0xbf40('0x23')]('Content-Range',_0x3326af+'-'+_0x15c7e9+'/'+_0x4bc7c3)[_0xbf40('0x1e')](_0x5cc271);}return null;};}function patchUpdates(_0x14dfcf){return function(_0x23aa64){try{jsonpatch[_0xbf40('0x24')](_0x23aa64,_0x14dfcf,!![]);}catch(_0xb0a4bb){return BPromise[_0xbf40('0x25')](_0xb0a4bb);}return _0x23aa64[_0xbf40('0x26')]();};}function saveUpdates(_0x4a249f,_0x1d6f8c){return function(_0x21f50a){if(_0x21f50a){return _0x21f50a[_0xbf40('0x27')](_0x4a249f)[_0xbf40('0x28')](function(_0x43164d){return _0x43164d;});}return null;};}function removeEntity(_0x298db8,_0x493fb5){return function(_0x167a41){if(_0x167a41){return _0x167a41[_0xbf40('0x29')]()[_0xbf40('0x28')](function(){_0x298db8[_0xbf40('0x1d')](0xcc)[_0xbf40('0x1c')]();});}};}function handleEntityNotFound(_0x53d29d,_0x4890d2){return function(_0xcdf32e){if(!_0xcdf32e){_0x53d29d[_0xbf40('0x1b')](0x194);}return _0xcdf32e;};}function handleError(_0x56cb50,_0x7b097d){_0x7b097d=_0x7b097d||0x1f4;return function(_0x445002){logger[_0xbf40('0x2a')](_0x445002['stack']);if(_0x445002[_0xbf40('0x2b')]){delete _0x445002[_0xbf40('0x2b')];}_0x56cb50['status'](_0x7b097d)['send'](_0x445002);};}exports['index']=function(_0x5b2d42,_0x49abb6){var _0x3ee0f5={},_0xf9517b={},_0x373efe={'count':0x0,'rows':[]};var _0x3b322c=_[_0xbf40('0x2c')](db[_0xbf40('0x2d')][_0xbf40('0x2e')],function(_0x3c5ef5){return{'name':_0x3c5ef5[_0xbf40('0x2f')],'type':_0x3c5ef5['type']['key']};});_0xf9517b['model']=_[_0xbf40('0x2c')](_0x3b322c,_0xbf40('0x2b'));_0xf9517b[_0xbf40('0x30')]=_[_0xbf40('0x31')](_0x5b2d42[_0xbf40('0x30')]);_0xf9517b['filters']=_[_0xbf40('0x32')](_0xf9517b[_0xbf40('0x33')],_0xf9517b['query']);_0x3ee0f5[_0xbf40('0x34')]=_[_0xbf40('0x32')](_0xf9517b[_0xbf40('0x33')],qs['fields'](_0x5b2d42[_0xbf40('0x30')][_0xbf40('0x35')]));_0x3ee0f5[_0xbf40('0x34')]=_0x3ee0f5[_0xbf40('0x34')][_0xbf40('0x36')]?_0x3ee0f5['attributes']:_0xf9517b['model'];if(!_0x5b2d42[_0xbf40('0x30')]['hasOwnProperty'](_0xbf40('0x37'))){_0x3ee0f5[_0xbf40('0x21')]=qs[_0xbf40('0x21')](_0x5b2d42[_0xbf40('0x30')][_0xbf40('0x21')]);_0x3ee0f5['offset']=qs[_0xbf40('0x1f')](_0x5b2d42[_0xbf40('0x30')][_0xbf40('0x1f')]);}_0x3ee0f5[_0xbf40('0x38')]=qs[_0xbf40('0x39')](_0x5b2d42[_0xbf40('0x30')][_0xbf40('0x39')]);_0x3ee0f5[_0xbf40('0x3a')]=qs[_0xbf40('0x3b')](_[_0xbf40('0x3c')](_0x5b2d42[_0xbf40('0x30')],_0xf9517b[_0xbf40('0x3b')]),_0x3b322c);if(_0x5b2d42[_0xbf40('0x30')]['filter']){_0x3ee0f5[_0xbf40('0x3a')]=_[_0xbf40('0x3d')](_0x3ee0f5[_0xbf40('0x3a')],{'$or':_[_0xbf40('0x2c')](_0x3b322c,function(_0x4adfe1){if(_0x4adfe1[_0xbf40('0x3e')]!==_0xbf40('0x3f')){var _0x19d24c={};_0x19d24c[_0x4adfe1[_0xbf40('0x2b')]]={'$like':'%'+_0x5b2d42[_0xbf40('0x30')]['filter']+'%'};return _0x19d24c;}})});}_0x3ee0f5=_[_0xbf40('0x3d')]({},_0x3ee0f5,_0x5b2d42[_0xbf40('0x40')]);var _0x51f4a8={'where':_0x3ee0f5['where']};return db['CmHopperBlack'][_0xbf40('0x22')](_0x51f4a8)['then'](function(_0x4cf67a){_0x373efe[_0xbf40('0x22')]=_0x4cf67a;if(_0x5b2d42['query']['includeAll']){_0x3ee0f5['include']=[{'all':!![]}];}return db[_0xbf40('0x2d')][_0xbf40('0x41')](_0x3ee0f5);})[_0xbf40('0x28')](function(_0x4c1a27){_0x373efe[_0xbf40('0x42')]=_0x4c1a27;return _0x373efe;})[_0xbf40('0x28')](respondWithFilteredResult(_0x49abb6,_0x3ee0f5))[_0xbf40('0x43')](handleError(_0x49abb6,null));};exports[_0xbf40('0x44')]=function(_0x20e9d3,_0xd8ad6b){var _0x2e59ad={'raw':!![],'where':{'id':_0x20e9d3['params']['id']}},_0x40104a={};_0x40104a[_0xbf40('0x33')]=_[_0xbf40('0x31')](db[_0xbf40('0x2d')][_0xbf40('0x2e')]);_0x40104a[_0xbf40('0x30')]=_[_0xbf40('0x31')](_0x20e9d3['query']);_0x40104a[_0xbf40('0x3b')]=_[_0xbf40('0x32')](_0x40104a[_0xbf40('0x33')],_0x40104a[_0xbf40('0x30')]);_0x2e59ad[_0xbf40('0x34')]=_['intersection'](_0x40104a[_0xbf40('0x33')],qs[_0xbf40('0x35')](_0x20e9d3[_0xbf40('0x30')]['fields']));_0x2e59ad['attributes']=_0x2e59ad['attributes'][_0xbf40('0x36')]?_0x2e59ad[_0xbf40('0x34')]:_0x40104a[_0xbf40('0x33')];if(_0x20e9d3['query']['includeAll']){_0x2e59ad[_0xbf40('0x45')]=[{'all':!![]}];}_0x2e59ad=_['merge']({},_0x2e59ad,_0x20e9d3[_0xbf40('0x40')]);return db[_0xbf40('0x2d')]['find'](_0x2e59ad)[_0xbf40('0x28')](handleEntityNotFound(_0xd8ad6b,null))[_0xbf40('0x28')](respondWithResult(_0xd8ad6b,null))[_0xbf40('0x43')](handleError(_0xd8ad6b,null));};exports['update']=function(_0x48afe5,_0x58aa0d){if(_0x48afe5['body']['id']){delete _0x48afe5[_0xbf40('0x46')]['id'];}return db[_0xbf40('0x2d')][_0xbf40('0x47')]({'where':{'id':_0x48afe5['params']['id']}})[_0xbf40('0x28')](handleEntityNotFound(_0x58aa0d,null))[_0xbf40('0x28')](saveUpdates(_0x48afe5[_0xbf40('0x46')],null))[_0xbf40('0x28')](respondWithResult(_0x58aa0d,null))[_0xbf40('0x43')](handleError(_0x58aa0d,null));};exports[_0xbf40('0x29')]=function(_0x4fc4bd,_0x454920){return db['CmHopperBlack'][_0xbf40('0x47')]({'where':{'id':_0x4fc4bd[_0xbf40('0x48')]['id']}})['then'](handleEntityNotFound(_0x454920,null))[_0xbf40('0x28')](removeEntity(_0x454920,null))[_0xbf40('0x43')](handleError(_0x454920,null));};exports['describe']=function(_0x241eef,_0x1394fd){return db[_0xbf40('0x2d')][_0xbf40('0x49')]()[_0xbf40('0x28')](respondWithResult(_0x1394fd,null))['catch'](handleError(_0x1394fd,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index b5d4ef5..d88efbc 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.model.js +++ b/server/api/cmHopperBlack/cmHopperBlack.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeca9=['util','../../config/logger','api','moment','bluebird','path','rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0xeca9,0x103));var _0x9eca=function(_0x349aff,_0x4d6bcc){_0x349aff=_0x349aff-0x0;var _0x1b6bb6=_0xeca9[_0x349aff];return _0x1b6bb6;};'use strict';var _=require(_0x9eca('0x0'));var util=require(_0x9eca('0x1'));var logger=require(_0x9eca('0x2'))(_0x9eca('0x3'));var moment=require(_0x9eca('0x4'));var BPromise=require(_0x9eca('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9eca('0x6'));var rimraf=require(_0x9eca('0x7'));var config=require('../../config/environment');var attributes=require(_0x9eca('0x8'));module[_0x9eca('0x9')]=function(_0x13138b,_0x4c61eb){return _0x13138b[_0x9eca('0xa')](_0x9eca('0xb'),attributes,{'tableName':_0x9eca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf5b9=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black'];(function(_0x575494,_0x77fca8){var _0x7fd47d=function(_0x442e3d){while(--_0x442e3d){_0x575494['push'](_0x575494['shift']());}};_0x7fd47d(++_0x77fca8);}(_0xf5b9,0x1d4));var _0x9f5b=function(_0x54a31f,_0x5b00d0){_0x54a31f=_0x54a31f-0x0;var _0x1ae377=_0xf5b9[_0x54a31f];return _0x1ae377;};'use strict';var _=require(_0x9f5b('0x0'));var util=require(_0x9f5b('0x1'));var logger=require(_0x9f5b('0x2'))(_0x9f5b('0x3'));var moment=require(_0x9f5b('0x4'));var BPromise=require(_0x9f5b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9f5b('0x6'));var config=require(_0x9f5b('0x7'));var attributes=require(_0x9f5b('0x8'));module['exports']=function(_0x16e2c9,_0x2eb856){return _0x16e2c9[_0x9f5b('0x9')](_0x9f5b('0xa'),attributes,{'tableName':_0x9f5b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index e5ec115..4a39492 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.rpc.js +++ b/server/api/cmHopperBlack/cmHopperBlack.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05b3=['attributes','limit','map','model','include','GetCmHopperBlack','update','raw','UpdateCmHopperBlack','debug','DestroyCmHopperBlack','destroy','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CmHopperBlack','options','where'];(function(_0x58eca9,_0x219608){var _0x25a12e=function(_0x1d3695){while(--_0x1d3695){_0x58eca9['push'](_0x58eca9['shift']());}};_0x25a12e(++_0x219608);}(_0x05b3,0x198));var _0x305b=function(_0x411e71,_0xf9652){_0x411e71=_0x411e71-0x0;var _0x226ae3=_0x05b3[_0x411e71];return _0x226ae3;};'use strict';var _=require(_0x305b('0x0'));var util=require('util');var moment=require(_0x305b('0x1'));var BPromise=require('bluebird');var rs=require(_0x305b('0x2'));var fs=require('fs');var Redis=require(_0x305b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x305b('0x4'));var logger=require(_0x305b('0x5'))(_0x305b('0x6'));var config=require(_0x305b('0x7'));var jayson=require(_0x305b('0x8'));var client=jayson[_0x305b('0x9')][_0x305b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x527645,_0x14659a,_0x12ba69){return new BPromise(function(_0x4f3663,_0x238855){return client[_0x305b('0xb')](_0x527645,_0x12ba69)[_0x305b('0xc')](function(_0x4f5d80){logger[_0x305b('0xd')](_0x305b('0xe'),_0x14659a,_0x305b('0xf'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x14659a,_0x305b('0xf'),JSON[_0x305b('0x10')](_0x4f5d80));if(_0x4f5d80['error']){if(_0x4f5d80[_0x305b('0x11')]['code']===0x1f4){logger[_0x305b('0x11')](_0x305b('0xe'),_0x14659a,_0x4f5d80[_0x305b('0x11')][_0x305b('0x12')]);return _0x238855(_0x4f5d80[_0x305b('0x11')]['message']);}logger[_0x305b('0x11')](_0x305b('0xe'),_0x14659a,_0x4f5d80['error'][_0x305b('0x12')]);return _0x4f3663(_0x4f5d80[_0x305b('0x11')][_0x305b('0x12')]);}else{logger[_0x305b('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x14659a,_0x305b('0xf'));_0x4f3663(_0x4f5d80[_0x305b('0x13')][_0x305b('0x12')]);}})[_0x305b('0x14')](function(_0x2873d6){logger[_0x305b('0x11')](_0x305b('0xe'),_0x14659a,_0x2873d6);_0x238855(_0x2873d6);});});}exports['GetCmHopperBlack']=function(_0x576768){var _0x470ed5=this;return new Promise(function(_0x34e8d9,_0x56b655){return db[_0x305b('0x15')]['findAll']({'raw':_0x576768[_0x305b('0x16')]?_0x576768[_0x305b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x576768[_0x305b('0x16')]?_0x576768['options'][_0x305b('0x17')]||null:null,'attributes':_0x576768[_0x305b('0x16')]?_0x576768[_0x305b('0x16')][_0x305b('0x18')]||null:null,'limit':_0x576768[_0x305b('0x16')]?_0x576768[_0x305b('0x16')][_0x305b('0x19')]||null:null,'include':_0x576768[_0x305b('0x16')]?_0x576768[_0x305b('0x16')]['include']?_[_0x305b('0x1a')](_0x576768[_0x305b('0x16')]['include'],function(_0x18c8f6){return{'model':db[_0x18c8f6[_0x305b('0x1b')]],'as':_0x18c8f6['as'],'attributes':_0x18c8f6[_0x305b('0x18')],'include':_0x18c8f6['include']?_[_0x305b('0x1a')](_0x18c8f6[_0x305b('0x1c')],function(_0x16b2a3){return{'model':db[_0x16b2a3[_0x305b('0x1b')]],'as':_0x16b2a3['as'],'attributes':_0x16b2a3[_0x305b('0x18')],'include':_0x16b2a3[_0x305b('0x1c')]?_[_0x305b('0x1a')](_0x16b2a3[_0x305b('0x1c')],function(_0x3ef2fd){return{'model':db[_0x3ef2fd[_0x305b('0x1b')]],'as':_0x3ef2fd['as'],'attributes':_0x3ef2fd[_0x305b('0x18')]};}):[]};}):[]};}):[]:[]})[_0x305b('0xc')](function(_0x13331c){logger[_0x305b('0xd')](_0x305b('0x1d'),_0x576768);logger['debug'](_0x305b('0x1d'),_0x576768,JSON['stringify'](_0x13331c));_0x34e8d9(_0x13331c);})[_0x305b('0x14')](function(_0x4fc825){logger[_0x305b('0x11')](_0x305b('0x1d'),_0x4fc825[_0x305b('0x12')],_0x576768);_0x56b655(_0x470ed5['error'](0x1f4,_0x4fc825[_0x305b('0x12')]));});});};exports['UpdateCmHopperBlack']=function(_0x2f1bcf){var _0x3f41ef=this;return new Promise(function(_0x550bdf,_0x4841db){return db[_0x305b('0x15')][_0x305b('0x1e')](_0x2f1bcf['body'],{'raw':_0x2f1bcf[_0x305b('0x16')]?_0x2f1bcf[_0x305b('0x16')][_0x305b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f1bcf[_0x305b('0x16')]?_0x2f1bcf['options']['where']||null:null,'attributes':_0x2f1bcf['options']?_0x2f1bcf[_0x305b('0x16')]['attributes']||null:null,'limit':_0x2f1bcf[_0x305b('0x16')]?_0x2f1bcf[_0x305b('0x16')]['limit']||null:null})[_0x305b('0xc')](function(_0x8b1c55){logger[_0x305b('0xd')](_0x305b('0x20'),_0x2f1bcf);logger[_0x305b('0x21')](_0x305b('0x20'),_0x2f1bcf,JSON[_0x305b('0x10')](_0x8b1c55));_0x550bdf(_0x8b1c55);})[_0x305b('0x14')](function(_0x2e7425){logger[_0x305b('0x11')]('UpdateCmHopperBlack',_0x2e7425[_0x305b('0x12')],_0x2f1bcf);_0x4841db(_0x3f41ef[_0x305b('0x11')](0x1f4,_0x2e7425['message']));});});};exports[_0x305b('0x22')]=function(_0x496eea){var _0x3f798c=this;return new Promise(function(_0x281ccc,_0x592052){return db['CmHopperBlack'][_0x305b('0x23')]({'where':_0x496eea['options']?_0x496eea[_0x305b('0x16')]['where']||null:null})['then'](function(_0x330f31){logger[_0x305b('0xd')](_0x305b('0x22'),_0x496eea);logger[_0x305b('0x21')](_0x305b('0x22'),_0x496eea,JSON['stringify'](_0x330f31));_0x281ccc(_0x330f31);})[_0x305b('0x14')](function(_0x273fd3){logger[_0x305b('0x11')](_0x305b('0x22'),_0x273fd3[_0x305b('0x12')],_0x496eea);_0x592052(_0x3f798c[_0x305b('0x11')](0x1f4,_0x273fd3[_0x305b('0x12')]));});});}; \ No newline at end of file +var _0x3a9a=['info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','include','map','model','attributes','then','UpdateCmHopperBlack','update','limit','destroy','DestroyCmHopperBlack','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request'];(function(_0xf437c5,_0x5cb65c){var _0x302843=function(_0xa0111){while(--_0xa0111){_0xf437c5['push'](_0xf437c5['shift']());}};_0x302843(++_0x5cb65c);}(_0x3a9a,0x16d));var _0xa3a9=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x3a9a[_0x2112d4];return _0x434972;};'use strict';var _=require(_0xa3a9('0x0'));var util=require(_0xa3a9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa3a9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa3a9('0x3'))['db'];var utils=require(_0xa3a9('0x4'));var logger=require(_0xa3a9('0x5'))(_0xa3a9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa3a9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdad778,_0x3091fb,_0x107b10){return new BPromise(function(_0x34c262,_0xdb1426){return client[_0xa3a9('0x8')](_0xdad778,_0x107b10)['then'](function(_0x257505){logger[_0xa3a9('0x9')](_0xa3a9('0xa'),_0x3091fb,_0xa3a9('0xb'));logger[_0xa3a9('0xc')](_0xa3a9('0xd'),_0x3091fb,_0xa3a9('0xb'),JSON[_0xa3a9('0xe')](_0x257505));if(_0x257505[_0xa3a9('0xf')]){if(_0x257505[_0xa3a9('0xf')][_0xa3a9('0x10')]===0x1f4){logger['error'](_0xa3a9('0xa'),_0x3091fb,_0x257505[_0xa3a9('0xf')][_0xa3a9('0x11')]);return _0xdb1426(_0x257505[_0xa3a9('0xf')]['message']);}logger['error'](_0xa3a9('0xa'),_0x3091fb,_0x257505[_0xa3a9('0xf')][_0xa3a9('0x11')]);return _0x34c262(_0x257505[_0xa3a9('0xf')][_0xa3a9('0x11')]);}else{logger[_0xa3a9('0x9')](_0xa3a9('0xa'),_0x3091fb,_0xa3a9('0xb'));_0x34c262(_0x257505['result']['message']);}})[_0xa3a9('0x12')](function(_0x56334e){logger[_0xa3a9('0xf')](_0xa3a9('0xa'),_0x3091fb,_0x56334e);_0xdb1426(_0x56334e);});});}exports[_0xa3a9('0x13')]=function(_0xb2764a){var _0x40936f=this;return new Promise(function(_0x4ceb7d,_0x4a8b5d){return db[_0xa3a9('0x14')]['findAll']({'raw':_0xb2764a['options']?_0xb2764a[_0xa3a9('0x15')][_0xa3a9('0x16')]===undefined?!![]:![]:!![],'where':_0xb2764a['options']?_0xb2764a['options'][_0xa3a9('0x17')]||null:null,'attributes':_0xb2764a[_0xa3a9('0x15')]?_0xb2764a['options']['attributes']||null:null,'limit':_0xb2764a[_0xa3a9('0x15')]?_0xb2764a[_0xa3a9('0x15')]['limit']||null:null,'include':_0xb2764a[_0xa3a9('0x15')]?_0xb2764a['options'][_0xa3a9('0x18')]?_[_0xa3a9('0x19')](_0xb2764a[_0xa3a9('0x15')][_0xa3a9('0x18')],function(_0xda1117){return{'model':db[_0xda1117[_0xa3a9('0x1a')]],'as':_0xda1117['as'],'attributes':_0xda1117['attributes'],'include':_0xda1117[_0xa3a9('0x18')]?_['map'](_0xda1117[_0xa3a9('0x18')],function(_0x18847a){return{'model':db[_0x18847a[_0xa3a9('0x1a')]],'as':_0x18847a['as'],'attributes':_0x18847a[_0xa3a9('0x1b')],'include':_0x18847a['include']?_[_0xa3a9('0x19')](_0x18847a[_0xa3a9('0x18')],function(_0x96e5fa){return{'model':db[_0x96e5fa[_0xa3a9('0x1a')]],'as':_0x96e5fa['as'],'attributes':_0x96e5fa['attributes']};}):[]};}):[]};}):[]:[]})[_0xa3a9('0x1c')](function(_0x42b01a){logger[_0xa3a9('0x9')]('GetCmHopperBlack',_0xb2764a);logger[_0xa3a9('0xc')](_0xa3a9('0x13'),_0xb2764a,JSON[_0xa3a9('0xe')](_0x42b01a));_0x4ceb7d(_0x42b01a);})['catch'](function(_0x112b56){logger['error'](_0xa3a9('0x13'),_0x112b56['message'],_0xb2764a);_0x4a8b5d(_0x40936f['error'](0x1f4,_0x112b56[_0xa3a9('0x11')]));});});};exports[_0xa3a9('0x1d')]=function(_0x465cb6){var _0x4f6a0e=this;return new Promise(function(_0x4d49ea,_0x1b5176){return db[_0xa3a9('0x14')][_0xa3a9('0x1e')](_0x465cb6['body'],{'raw':_0x465cb6[_0xa3a9('0x15')]?_0x465cb6['options'][_0xa3a9('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x465cb6[_0xa3a9('0x15')]?_0x465cb6[_0xa3a9('0x15')][_0xa3a9('0x17')]||null:null,'attributes':_0x465cb6[_0xa3a9('0x15')]?_0x465cb6[_0xa3a9('0x15')][_0xa3a9('0x1b')]||null:null,'limit':_0x465cb6[_0xa3a9('0x15')]?_0x465cb6[_0xa3a9('0x15')][_0xa3a9('0x1f')]||null:null})['then'](function(_0x3016c5){logger[_0xa3a9('0x9')](_0xa3a9('0x1d'),_0x465cb6);logger['debug'](_0xa3a9('0x1d'),_0x465cb6,JSON[_0xa3a9('0xe')](_0x3016c5));_0x4d49ea(_0x3016c5);})[_0xa3a9('0x12')](function(_0x2f8d59){logger['error'](_0xa3a9('0x1d'),_0x2f8d59[_0xa3a9('0x11')],_0x465cb6);_0x1b5176(_0x4f6a0e['error'](0x1f4,_0x2f8d59['message']));});});};exports['DestroyCmHopperBlack']=function(_0x326106){var _0x1bedf6=this;return new Promise(function(_0x5d2495,_0x57f9ad){return db[_0xa3a9('0x14')][_0xa3a9('0x20')]({'where':_0x326106[_0xa3a9('0x15')]?_0x326106[_0xa3a9('0x15')][_0xa3a9('0x17')]||null:null})[_0xa3a9('0x1c')](function(_0x2a5349){logger[_0xa3a9('0x9')](_0xa3a9('0x21'),_0x326106);logger[_0xa3a9('0xc')](_0xa3a9('0x21'),_0x326106,JSON[_0xa3a9('0xe')](_0x2a5349));_0x5d2495(_0x2a5349);})[_0xa3a9('0x12')](function(_0x31f95e){logger[_0xa3a9('0xf')]('DestroyCmHopperBlack',_0x31f95e['message'],_0x326106);_0x57f9ad(_0x1bedf6[_0xa3a9('0xf')](0x1f4,_0x31f95e['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index e9a8e59..05d4b38 100644 --- a/server/api/cmHopperBlack/index.js +++ b/server/api/cmHopperBlack/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb016=['multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','put','/:id','destroy'];(function(_0x4b91c6,_0x56cc8b){var _0x39d324=function(_0x4813cc){while(--_0x4813cc){_0x4b91c6['push'](_0x4b91c6['shift']());}};_0x39d324(++_0x56cc8b);}(_0xb016,0x159));var _0x6b01=function(_0x810d8f,_0x3e7c80){_0x810d8f=_0x810d8f-0x0;var _0x5c94d5=_0xb016[_0x810d8f];return _0x5c94d5;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var fs_extra=require(_0x6b01('0x3'));var auth=require(_0x6b01('0x4'));var interaction=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var controller=require('./cmHopperBlack.controller');router[_0x6b01('0x7')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0x9')]);router['get']('/describe',auth[_0x6b01('0x8')](),controller[_0x6b01('0xa')]);router['get']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xb')]);router[_0x6b01('0xc')](_0x6b01('0xd'),auth[_0x6b01('0x8')](),controller['update']);router['delete'](_0x6b01('0xd'),auth[_0x6b01('0x8')](),controller[_0x6b01('0xe')]);module['exports']=router; \ No newline at end of file +var _0xba34=['./cmHopperBlack.controller','get','isAuthenticated','index','describe','/:id','show','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x52c6e3,_0x4f614b){var _0x2f320f=function(_0x3655bb){while(--_0x3655bb){_0x52c6e3['push'](_0x52c6e3['shift']());}};_0x2f320f(++_0x4f614b);}(_0xba34,0x119));var _0x4ba3=function(_0xdb9b57,_0x4b1ad6){_0xdb9b57=_0xdb9b57-0x0;var _0x2a6aa2=_0xba34[_0xdb9b57];return _0x2a6aa2;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/describe',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')]('/:id',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 7ddd2ce..2fe6b46 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.attributes.js +++ b/server/api/cmHopperFinal/cmHopperFinal.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaff6=['sequelize','moment','exports','DATE','INTEGER','STRING','getDataValue','endtime','setDataValue','followuptime','diff','BOOLEAN'];(function(_0x28c4db,_0x2ccd05){var _0x5907ed=function(_0x1d83c2){while(--_0x1d83c2){_0x28c4db['push'](_0x28c4db['shift']());}};_0x5907ed(++_0x2ccd05);}(_0xaff6,0xd8));var _0x6aff=function(_0x77b525,_0xd4dc1e){_0x77b525=_0x77b525-0x0;var _0xa83673=_0xaff6[_0x77b525];return _0xa83673;};'use strict';var Sequelize=require(_0x6aff('0x0'));var moment=require(_0x6aff('0x1'));module[_0x6aff('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x6aff('0x3')]},'countbusyretry':{'type':Sequelize[_0x6aff('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6aff('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x6aff('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6aff('0x5')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6aff('0x5')]},'calleridname':{'type':Sequelize[_0x6aff('0x5')]},'starttime':{'type':Sequelize[_0x6aff('0x3')]},'responsetime':{'type':Sequelize[_0x6aff('0x3')]},'answertime':{'type':Sequelize[_0x6aff('0x3')]},'droptime':{'type':Sequelize[_0x6aff('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x6aff('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6aff('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6aff('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6aff('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6aff('0x5')]},'campaign':{'type':Sequelize[_0x6aff('0x5')]},'campaigntype':{'type':Sequelize[_0x6aff('0x5')]},'membername':{'type':Sequelize[_0x6aff('0x5')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x6aff('0x5')]},'secondDisposition':{'type':Sequelize[_0x6aff('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x6aff('0x3')],'set':function(_0x39b16f){var _0x1f1ee0=this[_0x6aff('0x6')](_0x6aff('0x7'));if(_0x1f1ee0&&_0x39b16f){this[_0x6aff('0x8')](_0x6aff('0x9'),moment(_0x39b16f)[_0x6aff('0xa')](moment(_0x1f1ee0),'seconds'));}}},'amd':{'type':Sequelize[_0x6aff('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x6aff('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x6aff('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x6aff('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x6aff('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6aff('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x6aff('0x3')]},'recallme':{'type':Sequelize[_0x6aff('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x6aff('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6aff('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6aff('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6aff('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6aff('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7e0d=['setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','INTEGER','STRING','DATE','endtime'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x7e0d,0x165));var _0xd7e0=function(_0x132168,_0x4e5d6c){_0x132168=_0x132168-0x0;var _0x25c815=_0x7e0d[_0x132168];return _0x25c815;};'use strict';var Sequelize=require(_0xd7e0('0x0'));var moment=require(_0xd7e0('0x1'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xd7e0('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd7e0('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd7e0('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd7e0('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xd7e0('0x3')]},'originatecalleridname':{'type':Sequelize[_0xd7e0('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd7e0('0x3')]},'starttime':{'type':Sequelize[_0xd7e0('0x4')]},'responsetime':{'type':Sequelize[_0xd7e0('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd7e0('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd7e0('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd7e0('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xd7e0('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xd7e0('0x3')]},'membername':{'type':Sequelize[_0xd7e0('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xd7e0('0x3')]},'secondDisposition':{'type':Sequelize[_0xd7e0('0x3')]},'thirdDisposition':{'type':Sequelize[_0xd7e0('0x3')]},'dispositionat':{'type':Sequelize[_0xd7e0('0x4')],'set':function(_0x5621e1){var _0x3dfc67=this['getDataValue'](_0xd7e0('0x5'));if(_0x3dfc67&&_0x5621e1){this[_0xd7e0('0x6')](_0xd7e0('0x7'),moment(_0x5621e1)[_0xd7e0('0x8')](moment(_0x3dfc67),_0xd7e0('0x9')));}}},'amd':{'type':Sequelize[_0xd7e0('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd7e0('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xd7e0('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xd7e0('0x4')]},'callback':{'type':Sequelize[_0xd7e0('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd7e0('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd7e0('0x4')]},'deleted':{'type':Sequelize[_0xd7e0('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xd7e0('0x4')]},'recallme':{'type':Sequelize[_0xd7e0('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xd7e0('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd7e0('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd7e0('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd7e0('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd7e0('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 258c0bc..dc54f03 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.controller.js +++ b/server/api/cmHopperFinal/cmHopperFinal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x144856,_0x21f180){var _0x377cf9=function(_0xc5ac5a){while(--_0xc5ac5a){_0x144856['push'](_0x144856['shift']());}};_0x377cf9(++_0x21f180);}(_0x90b1,0x1bb));var _0x190b=function(_0x5e7361,_0x31140d){_0x5e7361=_0x5e7361-0x0;var _0x248a05=_0x90b1[_0x5e7361];return _0x248a05;};'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 +var _0x1883=['abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','noAnswerContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','cm_hopper','fromQuery','scheduledAt','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','NOW()','ContactId','field','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','into','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperFinal','includeAll','include','findAll','params','catch','describe','body','uniqueid','find','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null'];(function(_0x23ad03,_0x5bced3){var _0x2f5991=function(_0xddde8d){while(--_0xddde8d){_0x23ad03['push'](_0x23ad03['shift']());}};_0x2f5991(++_0x5bced3);}(_0x1883,0xab));var _0x3188=function(_0xed3cfb,_0x1a335f){_0xed3cfb=_0xed3cfb-0x0;var _0xe8f878=_0x1883[_0xed3cfb];return _0xe8f878;};'use strict';var emlformat=require(_0x3188('0x0'));var rimraf=require(_0x3188('0x1'));var zipdir=require(_0x3188('0x2'));var jsonpatch=require(_0x3188('0x3'));var rp=require(_0x3188('0x4'));var moment=require(_0x3188('0x5'));var BPromise=require(_0x3188('0x6'));var Mustache=require(_0x3188('0x7'));var util=require(_0x3188('0x8'));var path=require(_0x3188('0x9'));var sox=require(_0x3188('0xa'));var csv=require(_0x3188('0xb'));var ejs=require(_0x3188('0xc'));var fs=require('fs');var fs_extra=require(_0x3188('0xd'));var _=require(_0x3188('0xe'));var squel=require(_0x3188('0xf'));var crypto=require(_0x3188('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x3188('0x11'));var toCsv=require(_0x3188('0xb'));var querystring=require('querystring');var Papa=require(_0x3188('0x12'));var Redis=require('ioredis');var authService=require(_0x3188('0x13'));var qs=require(_0x3188('0x14'));var as=require(_0x3188('0x15'));var hardwareService=require(_0x3188('0x16'));var logger=require('../../config/logger')(_0x3188('0x17'));var utils=require(_0x3188('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3188('0x19'))['db'];function respondWithStatusCode(_0x45e94e,_0x20fef6){_0x20fef6=_0x20fef6||0xcc;return function(_0x3ae228){if(_0x3ae228){return _0x45e94e[_0x3188('0x1a')](_0x20fef6);}return _0x45e94e[_0x3188('0x1b')](_0x20fef6)['end']();};}function respondWithResult(_0x276d69,_0x5e0044){_0x5e0044=_0x5e0044||0xc8;return function(_0x4a2f36){if(_0x4a2f36){return _0x276d69[_0x3188('0x1b')](_0x5e0044)['json'](_0x4a2f36);}};}function respondWithFilteredResult(_0x54a87f,_0x32c239){return function(_0x1beead){if(_0x1beead){var _0xa2269=typeof _0x32c239[_0x3188('0x1c')]===_0x3188('0x1d')&&typeof _0x32c239[_0x3188('0x1e')]==='undefined';var _0x19cc72=_0x1beead[_0x3188('0x1f')];var _0x3f5b35=_0xa2269?0x0:_0x32c239[_0x3188('0x1c')];var _0x18a71a=_0xa2269?_0x1beead[_0x3188('0x1f')]:_0x32c239[_0x3188('0x1c')]+_0x32c239[_0x3188('0x1e')];var _0x5bcbba;if(_0x18a71a>=_0x19cc72){_0x18a71a=_0x19cc72;_0x5bcbba=0xc8;}else{_0x5bcbba=0xce;}_0x54a87f[_0x3188('0x1b')](_0x5bcbba);return _0x54a87f[_0x3188('0x20')]('Content-Range',_0x3f5b35+'-'+_0x18a71a+'/'+_0x19cc72)['json'](_0x1beead);}return null;};}function patchUpdates(_0x5d8d62){return function(_0x46a318){try{jsonpatch[_0x3188('0x21')](_0x46a318,_0x5d8d62,!![]);}catch(_0xd292b5){return BPromise['reject'](_0xd292b5);}return _0x46a318['save']();};}function saveUpdates(_0x266260,_0x461286){return function(_0x375077){if(_0x375077){return _0x375077[_0x3188('0x22')](_0x266260)[_0x3188('0x23')](function(_0x4bd5ee){return _0x4bd5ee;});}return null;};}function removeEntity(_0x30cf2c,_0x33f882){return function(_0x5a2e67){if(_0x5a2e67){return _0x5a2e67[_0x3188('0x24')]()['then'](function(){_0x30cf2c['status'](0xcc)[_0x3188('0x25')]();});}};}function handleEntityNotFound(_0x129bd7,_0x87d5a3){return function(_0x1aeaba){if(!_0x1aeaba){_0x129bd7[_0x3188('0x1a')](0x194);}return _0x1aeaba;};}function handleError(_0x2cd060,_0xe57f73){_0xe57f73=_0xe57f73||0x1f4;return function(_0x11021c){logger['error'](_0x11021c[_0x3188('0x26')]);if(_0x11021c[_0x3188('0x27')]){delete _0x11021c['name'];}_0x2cd060[_0x3188('0x1b')](_0xe57f73)[_0x3188('0x28')](_0x11021c);};}exports[_0x3188('0x29')]=function(_0x44db9a,_0x20e6aa){var _0x1f1c6f={},_0x8f810f={},_0x472926={'count':0x0,'rows':[]};var _0x57c21c=_[_0x3188('0x2a')](db['CmHopperFinal'][_0x3188('0x2b')],function(_0x5623f1){return{'name':_0x5623f1[_0x3188('0x2c')],'type':_0x5623f1[_0x3188('0x2d')][_0x3188('0x2e')]};});_0x8f810f[_0x3188('0x2f')]=_[_0x3188('0x2a')](_0x57c21c,_0x3188('0x27'));_0x8f810f[_0x3188('0x30')]=_[_0x3188('0x31')](_0x44db9a[_0x3188('0x30')]);_0x8f810f[_0x3188('0x32')]=_[_0x3188('0x33')](_0x8f810f[_0x3188('0x2f')],_0x8f810f[_0x3188('0x30')]);_0x1f1c6f[_0x3188('0x34')]=_[_0x3188('0x33')](_0x8f810f[_0x3188('0x2f')],qs[_0x3188('0x35')](_0x44db9a[_0x3188('0x30')]['fields']));_0x1f1c6f[_0x3188('0x34')]=_0x1f1c6f['attributes'][_0x3188('0x36')]?_0x1f1c6f[_0x3188('0x34')]:_0x8f810f['model'];if(!_0x44db9a[_0x3188('0x30')][_0x3188('0x37')](_0x3188('0x38'))){_0x1f1c6f[_0x3188('0x1e')]=qs[_0x3188('0x1e')](_0x44db9a[_0x3188('0x30')][_0x3188('0x1e')]);_0x1f1c6f['offset']=qs['offset'](_0x44db9a[_0x3188('0x30')][_0x3188('0x1c')]);}_0x1f1c6f[_0x3188('0x39')]=qs[_0x3188('0x3a')](_0x44db9a['query'][_0x3188('0x3a')]);_0x1f1c6f[_0x3188('0x3b')]=qs[_0x3188('0x32')](_[_0x3188('0x3c')](_0x44db9a['query'],_0x8f810f[_0x3188('0x32')]),_0x57c21c);if(_0x44db9a['query'][_0x3188('0x3d')]){_0x1f1c6f['where']=_[_0x3188('0x3e')](_0x1f1c6f[_0x3188('0x3b')],{'$or':_[_0x3188('0x2a')](_0x57c21c,function(_0x2990c4){if(_0x2990c4[_0x3188('0x2d')]!==_0x3188('0x3f')){var _0x4666b2={};_0x4666b2[_0x2990c4[_0x3188('0x27')]]={'$like':'%'+_0x44db9a[_0x3188('0x30')][_0x3188('0x3d')]+'%'};return _0x4666b2;}})});}_0x1f1c6f=_['merge']({},_0x1f1c6f,_0x44db9a[_0x3188('0x40')]);var _0x2bad0f={'where':_0x1f1c6f[_0x3188('0x3b')]};return db[_0x3188('0x41')][_0x3188('0x1f')](_0x2bad0f)[_0x3188('0x23')](function(_0x5a815d){_0x472926[_0x3188('0x1f')]=_0x5a815d;if(_0x44db9a['query'][_0x3188('0x42')]){_0x1f1c6f[_0x3188('0x43')]=[{'all':!![]}];}return db[_0x3188('0x41')][_0x3188('0x44')](_0x1f1c6f);})[_0x3188('0x23')](function(_0x549ab2){_0x472926['rows']=_0x549ab2;return _0x472926;})['then'](respondWithFilteredResult(_0x20e6aa,_0x1f1c6f))['catch'](handleError(_0x20e6aa,null));};exports['show']=function(_0x763943,_0x28c224){var _0x3e5f90={'raw':!![],'where':{'id':_0x763943[_0x3188('0x45')]['id']}},_0x1b40b1={};_0x1b40b1['model']=_[_0x3188('0x31')](db['CmHopperFinal'][_0x3188('0x2b')]);_0x1b40b1[_0x3188('0x30')]=_[_0x3188('0x31')](_0x763943[_0x3188('0x30')]);_0x1b40b1['filters']=_[_0x3188('0x33')](_0x1b40b1[_0x3188('0x2f')],_0x1b40b1[_0x3188('0x30')]);_0x3e5f90[_0x3188('0x34')]=_[_0x3188('0x33')](_0x1b40b1['model'],qs['fields'](_0x763943[_0x3188('0x30')][_0x3188('0x35')]));_0x3e5f90['attributes']=_0x3e5f90[_0x3188('0x34')][_0x3188('0x36')]?_0x3e5f90['attributes']:_0x1b40b1[_0x3188('0x2f')];if(_0x763943[_0x3188('0x30')][_0x3188('0x42')]){_0x3e5f90[_0x3188('0x43')]=[{'all':!![]}];}_0x3e5f90=_[_0x3188('0x3e')]({},_0x3e5f90,_0x763943['options']);return db[_0x3188('0x41')]['find'](_0x3e5f90)[_0x3188('0x23')](handleEntityNotFound(_0x28c224,null))[_0x3188('0x23')](respondWithResult(_0x28c224,null))[_0x3188('0x46')](handleError(_0x28c224,null));};exports[_0x3188('0x47')]=function(_0xe4cbb0,_0x315524){return db[_0x3188('0x41')][_0x3188('0x47')]()[_0x3188('0x23')](respondWithResult(_0x315524,null))[_0x3188('0x46')](handleError(_0x315524,null));};exports[_0x3188('0x22')]=function(_0x50c08d,_0x50fd56){if(_0x50c08d[_0x3188('0x48')]['uniqueid']){delete _0x50c08d[_0x3188('0x48')][_0x3188('0x49')];}return db['CmHopperFinal'][_0x3188('0x4a')]({'where':{'uniqueid':_0x50c08d[_0x3188('0x45')]['id']}})[_0x3188('0x23')](handleEntityNotFound(_0x50fd56,null))[_0x3188('0x23')](saveUpdates(_0x50c08d[_0x3188('0x48')],null))[_0x3188('0x23')](respondWithResult(_0x50fd56,null))[_0x3188('0x46')](handleError(_0x50fd56,null));};exports[_0x3188('0x4b')]=function(_0x59a177,_0x3b8fe9,_0x3051ce){return db['CmHopperFinal'][_0x3188('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x59a177['params']['id']},'attributes':[[db[_0x3188('0x4c')]['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db['sequelize']['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db['sequelize'][_0x3188('0x4e')](_0x3188('0x4f')))),'noAnswerContacts'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x3188('0x4e')](_0x3188('0x50')))),_0x3188('0x51')],[db[_0x3188('0x4c')]['fn'](_0x3188('0x4d'),db['sequelize']['fn']('IF',db[_0x3188('0x4c')][_0x3188('0x4e')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db['sequelize']['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db[_0x3188('0x4c')]['literal'](_0x3188('0x52')))),_0x3188('0x53')],[db[_0x3188('0x4c')]['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db['sequelize'][_0x3188('0x4e')](_0x3188('0x54')))),_0x3188('0x55')],[db['sequelize']['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db[_0x3188('0x4c')][_0x3188('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x3188('0x56')],[db[_0x3188('0x4c')]['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db[_0x3188('0x4c')][_0x3188('0x4e')](_0x3188('0x57')))),'answeringMachine']]})[_0x3188('0x23')](handleEntityNotFound(_0x3b8fe9,null))[_0x3188('0x23')](respondWithResult(_0x3b8fe9,null))[_0x3188('0x46')](handleError(_0x3b8fe9,null));};exports[_0x3188('0x58')]=function(_0x3afd94,_0x447827,_0x27983c){return db['CmHopperFinal'][_0x3188('0x44')]({'raw':![],'where':{'CampaignId':_0x3afd94[_0x3188('0x45')]['id']},'attributes':[[db[_0x3188('0x4c')]['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db['sequelize'][_0x3188('0x4e')](_0x3188('0x59')))),'noSuchContacts'],[db['sequelize']['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db[_0x3188('0x4c')][_0x3188('0x4e')](_0x3188('0x4f')))),_0x3188('0x5a')],[db[_0x3188('0x4c')]['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db[_0x3188('0x4c')]['literal'](_0x3188('0x50')))),'busyContacts'],[db['sequelize']['fn'](_0x3188('0x4d'),db['sequelize']['fn']('IF',db[_0x3188('0x4c')][_0x3188('0x4e')](_0x3188('0x5b')))),_0x3188('0x5c')],[db[_0x3188('0x4c')]['fn'](_0x3188('0x4d'),db['sequelize']['fn']('IF',db[_0x3188('0x4c')][_0x3188('0x4e')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x3188('0x53')],[db[_0x3188('0x4c')]['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db[_0x3188('0x4c')][_0x3188('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x3188('0x55')],[db[_0x3188('0x4c')]['fn']('COUNT',db[_0x3188('0x4c')]['fn']('IF',db[_0x3188('0x4c')][_0x3188('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x3188('0x56')],[db[_0x3188('0x4c')]['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db[_0x3188('0x4c')][_0x3188('0x4e')](_0x3188('0x57')))),'answeringMachine']]})['then'](handleEntityNotFound(_0x447827,null))['then'](respondWithResult(_0x447827,null))['catch'](handleError(_0x447827,null));};exports[_0x3188('0x5d')]=function(_0x693395,_0x3b6a13,_0x30f3b3){return db[_0x3188('0x5e')]['find']({'where':{'id':_0x693395[_0x3188('0x45')]['id']}})['then'](handleEntityNotFound(_0x3b6a13,null))[_0x3188('0x23')](function(_0x96600f){var _0x5b93cd;if(_0x96600f){_0x5b93cd=squel[_0x3188('0x5f')]()['into'](_0x3188('0x60'))[_0x3188('0x61')](['phone',_0x3188('0x62'),'ContactId',_0x3188('0x63'),_0x3188('0x64'),_0x3188('0x65'),_0x3188('0x66')],squel[_0x3188('0x67')]()['field'](_0x3188('0x68'),_0x3188('0x69'))['field'](_0x3188('0x6a'),_0x3188('0x62'))['field']('ANY_VALUE(ContactId)',_0x3188('0x6b'))[_0x3188('0x6c')](_0x3188('0x6d'),_0x3188('0x63'))[_0x3188('0x6c')](_0x3188('0x6e'),'VoiceQueueId')[_0x3188('0x6c')](_0x3188('0x6a'),_0x3188('0x65'))['field'](_0x3188('0x6a'),_0x3188('0x66'))[_0x3188('0x6f')](_0x3188('0x70'))[_0x3188('0x3b')](_0x3188('0x71'),_0x693395['params']['id']['toString']())['where'](_0x3188('0x72'),_0x693395[_0x3188('0x48')]['state'][_0x3188('0x73')]())[_0x3188('0x3b')](_0x3188('0x74'))[_0x3188('0x3b')](_0x3188('0x75'),squel[_0x3188('0x67')]()['field'](_0x3188('0x69'))[_0x3188('0x6f')](_0x3188('0x60'))[_0x3188('0x3b')](_0x3188('0x71'),_0x693395[_0x3188('0x45')]['id'][_0x3188('0x73')]()))[_0x3188('0x3b')](_0x3188('0x75'),squel[_0x3188('0x67')]()[_0x3188('0x6c')](_0x3188('0x76'))[_0x3188('0x6f')](_0x3188('0x70'))[_0x3188('0x3b')](_0x3188('0x71'),_0x693395[_0x3188('0x45')]['id'][_0x3188('0x73')]())['where'](_0x3188('0x77')))[_0x3188('0x78')](_0x3188('0x6b')))[_0x3188('0x73')]();return db[_0x3188('0x4c')]['query'](_0x5b93cd);}return[];})[_0x3188('0x23')](respondWithResult(_0x3b6a13,null))[_0x3188('0x46')](handleError(_0x3b6a13,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0xc1ee8e,_0x2ba5a5,_0x43212c){return db['Campaign'][_0x3188('0x4a')]({'where':{'id':_0xc1ee8e['params']['id']}})[_0x3188('0x23')](handleEntityNotFound(_0x2ba5a5,null))[_0x3188('0x23')](function(_0x31029d){var _0xcf9ceb;if(_0x31029d){_0xcf9ceb=squel[_0x3188('0x5f')]()[_0x3188('0x79')]('cm_hopper')['fromQuery']([_0x3188('0x69'),_0x3188('0x62'),_0x3188('0x6b'),_0x3188('0x63'),_0x3188('0x7a'),_0x3188('0x65'),'updatedAt'],squel[_0x3188('0x67')]()[_0x3188('0x6c')](_0x3188('0x68'),_0x3188('0x69'))['field'](_0x3188('0x6a'),'scheduledAt')['field']('ANY_VALUE(ContactId)','ContactId')[_0x3188('0x6c')](_0x3188('0x6d'),'ListId')[_0x3188('0x6c')](_0x3188('0x7b'),'CampaignId')[_0x3188('0x6c')]('NOW()',_0x3188('0x65'))[_0x3188('0x6c')]('NOW()',_0x3188('0x66'))[_0x3188('0x6f')](_0x3188('0x70'))[_0x3188('0x3b')](_0x3188('0x7c'),_0xc1ee8e[_0x3188('0x45')]['id'][_0x3188('0x73')]())[_0x3188('0x3b')](_0x3188('0x72'),_0xc1ee8e[_0x3188('0x48')]['state'][_0x3188('0x73')]())[_0x3188('0x3b')](_0x3188('0x74'))['where'](_0x3188('0x75'),squel['select']()[_0x3188('0x6c')]('phone')['from']('cm_hopper')['where'](_0x3188('0x7c'),_0xc1ee8e[_0x3188('0x45')]['id'][_0x3188('0x73')]()))[_0x3188('0x3b')](_0x3188('0x75'),squel['select']()[_0x3188('0x6c')]('calleridnum')['from'](_0x3188('0x70'))[_0x3188('0x3b')]('CampaignId\x20=\x20?',_0xc1ee8e[_0x3188('0x45')]['id'][_0x3188('0x73')]())[_0x3188('0x3b')](_0x3188('0x77')))[_0x3188('0x78')](_0x3188('0x6b')))[_0x3188('0x73')]();return db['sequelize'][_0x3188('0x30')](_0xcf9ceb);}return[];})[_0x3188('0x23')](respondWithResult(_0x2ba5a5,null))[_0x3188('0x46')](handleError(_0x2ba5a5,null));};exports[_0x3188('0x7d')]=function(_0x203f04,_0x12c18c,_0x11b74c){return db[_0x3188('0x7e')][_0x3188('0x7f')]({'where':{'VoiceQueueId':_0x203f04['body'][_0x3188('0x64')],'CampaignId':_0x203f04['body'][_0x3188('0x7a')],'ContactId':_0x203f04[_0x3188('0x48')][_0x3188('0x6b')]}})[_0x3188('0x23')](handleEntityNotFound(_0x12c18c,null))[_0x3188('0x23')](function(_0x41ca86){if(_0x41ca86){return _0x41ca86;}return null;})[_0x3188('0x23')](respondWithResult(_0x12c18c,null))[_0x3188('0x46')](handleError(_0x12c18c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index ce0fc9c..e6bcb40 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.model.js +++ b/server/api/cmHopperFinal/cmHopperFinal.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x77b0=['rimraf','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','bluebird','path'];(function(_0x6b5247,_0x4dd4e3){var _0x59d032=function(_0x56ad89){while(--_0x56ad89){_0x6b5247['push'](_0x6b5247['shift']());}};_0x59d032(++_0x4dd4e3);}(_0x77b0,0x104));var _0x077b=function(_0x3e075c,_0x213346){_0x3e075c=_0x3e075c-0x0;var _0x1e2eda=_0x77b0[_0x3e075c];return _0x1e2eda;};'use strict';var _=require(_0x077b('0x0'));var util=require(_0x077b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x077b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x077b('0x3'));var rimraf=require(_0x077b('0x4'));var config=require('../../config/environment');var attributes=require(_0x077b('0x5'));module[_0x077b('0x6')]=function(_0xbbf93a,_0x507f1f){return _0xbbf93a[_0x077b('0x7')](_0x077b('0x8'),attributes,{'tableName':_0x077b('0x9'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x077b('0xa')]},{'name':'uniqueid','fields':[_0x077b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0c29=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger'];(function(_0x408ec6,_0x3654a8){var _0x49e017=function(_0x4e3e05){while(--_0x4e3e05){_0x408ec6['push'](_0x408ec6['shift']());}};_0x49e017(++_0x3654a8);}(_0x0c29,0x14f));var _0x90c2=function(_0x214266,_0x1f6f52){_0x214266=_0x214266-0x0;var _0x568f75=_0x0c29[_0x214266];return _0x568f75;};'use strict';var _=require(_0x90c2('0x0'));var util=require(_0x90c2('0x1'));var logger=require(_0x90c2('0x2'))('api');var moment=require(_0x90c2('0x3'));var BPromise=require(_0x90c2('0x4'));var rp=require(_0x90c2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x90c2('0x6'));var config=require(_0x90c2('0x7'));var attributes=require('./cmHopperFinal.attributes');module[_0x90c2('0x8')]=function(_0x6f43e3,_0x1068ed){return _0x6f43e3[_0x90c2('0x9')]('CmHopperFinal',attributes,{'tableName':_0x90c2('0xa'),'paranoid':![],'indexes':[{'name':_0x90c2('0xb'),'fields':[_0x90c2('0xb')]},{'name':_0x90c2('0xc'),'fields':[_0x90c2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 4427026..76b78af 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x51c9ea,_0x2ca0a2){var _0x545fbf=function(_0x2b51ab){while(--_0x2b51ab){_0x51c9ea['push'](_0x51c9ea['shift']());}};_0x545fbf(++_0x2ca0a2);}(_0xb10b,0x12a));var _0xbb10=function(_0x415302,_0x595773){_0x415302=_0x415302-0x0;var _0x810824=_0xb10b[_0x415302];return _0x810824;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x60f36,_0x4160bb){var _0x25c221=function(_0x5414c6){while(--_0x5414c6){_0x60f36['push'](_0x60f36['shift']());}};_0x25c221(++_0x4160bb);}(_0xb10b,0x12a));var _0xbb10=function(_0x273fd1,_0x388bbe){_0x273fd1=_0x273fd1-0x0;var _0x5d3dbf=_0xb10b[_0x273fd1];return _0x5d3dbf;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index d1aa34c..eb2335d 100644 --- a/server/api/cmHopperFinal/index.js +++ b/server/api/cmHopperFinal/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3025=['post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id'];(function(_0x2b1fde,_0x20c2ec){var _0xd3dc52=function(_0x3d4ac3){while(--_0x3d4ac3){_0x2b1fde['push'](_0x2b1fde['shift']());}};_0xd3dc52(++_0x20c2ec);}(_0x3025,0x1c7));var _0x5302=function(_0x368af6,_0x5a0aa1){_0x368af6=_0x368af6-0x0;var _0x1ed260=_0x3025[_0x368af6];return _0x1ed260;};'use strict';var multer=require(_0x5302('0x0'));var util=require(_0x5302('0x1'));var path=require(_0x5302('0x2'));var timeout=require(_0x5302('0x3'));var express=require(_0x5302('0x4'));var router=express[_0x5302('0x5')]();var fs_extra=require(_0x5302('0x6'));var auth=require(_0x5302('0x7'));var interaction=require(_0x5302('0x8'));var config=require('../../config/environment');var controller=require(_0x5302('0x9'));router[_0x5302('0xa')]('/',auth['isAuthenticated'](),controller[_0x5302('0xb')]);router['get'](_0x5302('0xc'),auth[_0x5302('0xd')](),controller['describe']);router[_0x5302('0xa')](_0x5302('0xe'),auth['isAuthenticated'](),controller[_0x5302('0xf')]);router[_0x5302('0xa')](_0x5302('0x10'),auth[_0x5302('0xd')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x5302('0xa')](_0x5302('0x11'),auth[_0x5302('0xd')](),controller[_0x5302('0x12')]);router['post'](_0x5302('0x13'),auth['isAuthenticated'](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x5302('0x14')](_0x5302('0x15'),auth[_0x5302('0xd')](),controller[_0x5302('0x16')]);router['post']('/checkContactHopper',auth['isAuthenticated'](),controller[_0x5302('0x17')]);router[_0x5302('0x18')]('/:id',auth[_0x5302('0xd')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0xa467=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0xa467,0x143));var _0x7a46=function(_0x50c192,_0x33e66f){_0x50c192=_0x50c192-0x0;var _0x2b9aa9=_0xa467[_0x50c192];return _0x2b9aa9;};'use strict';var multer=require(_0x7a46('0x0'));var util=require(_0x7a46('0x1'));var path=require(_0x7a46('0x2'));var timeout=require(_0x7a46('0x3'));var express=require(_0x7a46('0x4'));var router=express[_0x7a46('0x5')]();var fs_extra=require(_0x7a46('0x6'));var auth=require(_0x7a46('0x7'));var interaction=require(_0x7a46('0x8'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x7a46('0x9')]('/',auth[_0x7a46('0xa')](),controller[_0x7a46('0xb')]);router[_0x7a46('0x9')](_0x7a46('0xc'),auth['isAuthenticated'](),controller[_0x7a46('0xd')]);router[_0x7a46('0x9')](_0x7a46('0xe'),auth[_0x7a46('0xa')](),controller[_0x7a46('0xf')]);router[_0x7a46('0x9')]('/voice/queue/countAttributes/:id',auth[_0x7a46('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x7a46('0x9')]('/campaign/countAttributes/:id',auth[_0x7a46('0xa')](),controller[_0x7a46('0x10')]);router[_0x7a46('0x11')](_0x7a46('0x12'),auth[_0x7a46('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x7a46('0x11')](_0x7a46('0x13'),auth[_0x7a46('0xa')](),controller[_0x7a46('0x14')]);router[_0x7a46('0x11')]('/checkContactHopper',auth[_0x7a46('0xa')](),controller['checkContactHopper']);router['put'](_0x7a46('0xe'),auth[_0x7a46('0xa')](),controller['update']);module[_0x7a46('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index a493972..fbfdc52 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.attributes.js +++ b/server/api/cmHopperHistory/cmHopperHistory.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a38=['STRING','INTEGER','DATE','BOOLEAN','sequelize','exports'];(function(_0x533b74,_0x55d520){var _0x1ddee1=function(_0x163b73){while(--_0x163b73){_0x533b74['push'](_0x533b74['shift']());}};_0x1ddee1(++_0x55d520);}(_0x4a38,0x1de));var _0x84a3=function(_0x2f883f,_0x307e53){_0x2f883f=_0x2f883f-0x0;var _0x565c41=_0x4a38[_0x2f883f];return _0x565c41;};'use strict';var Sequelize=require(_0x84a3('0x0'));module[_0x84a3('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x84a3('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x84a3('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x84a3('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x84a3('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x84a3('0x2')]},'originatecalleridname':{'type':Sequelize[_0x84a3('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x84a3('0x2')]},'starttime':{'type':Sequelize[_0x84a3('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x84a3('0x4')]},'droptime':{'type':Sequelize[_0x84a3('0x4')]},'endtime':{'type':Sequelize[_0x84a3('0x4')]},'ringtime':{'type':Sequelize[_0x84a3('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x84a3('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x84a3('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x84a3('0x2')]},'campaign':{'type':Sequelize[_0x84a3('0x2')]},'campaigntype':{'type':Sequelize[_0x84a3('0x2')]},'membername':{'type':Sequelize[_0x84a3('0x2')]},'reason':{'type':Sequelize[_0x84a3('0x2')]},'amd':{'type':Sequelize[_0x84a3('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x84a3('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x84a3('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x84a3('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x84a3('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x84a3('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x84a3('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x84a3('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x84a3('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x84a3('0x2')]}}; \ No newline at end of file +var _0x50a1=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x141ca5,_0x3cf958){var _0xfe9f6e=function(_0x5780e5){while(--_0x5780e5){_0x141ca5['push'](_0x141ca5['shift']());}};_0xfe9f6e(++_0x3cf958);}(_0x50a1,0x9a));var _0x150a=function(_0x14768a,_0x49d653){_0x14768a=_0x14768a-0x0;var _0x47ab06=_0x50a1[_0x14768a];return _0x47ab06;};'use strict';var Sequelize=require(_0x150a('0x0'));module[_0x150a('0x1')]={'state':{'type':Sequelize[_0x150a('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x150a('0x3')]},'scheduledat':{'type':Sequelize[_0x150a('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x150a('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x150a('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x150a('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x150a('0x3')]},'originatecalleridname':{'type':Sequelize[_0x150a('0x3')]},'calleridnum':{'type':Sequelize[_0x150a('0x3')]},'calleridname':{'type':Sequelize[_0x150a('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x150a('0x4')]},'answertime':{'type':Sequelize[_0x150a('0x4')]},'droptime':{'type':Sequelize[_0x150a('0x4')]},'endtime':{'type':Sequelize[_0x150a('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x150a('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x150a('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x150a('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x150a('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x150a('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x150a('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x150a('0x4')]},'recallme':{'type':Sequelize[_0x150a('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x150a('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x150a('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x150a('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 3c2183c..42d3ff9 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.controller.js +++ b/server/api/cmHopperHistory/cmHopperHistory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa108=['index','CmHopperHistory','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','describe','body','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send'];(function(_0x4fb08a,_0x4c04dd){var _0x32aa19=function(_0x542426){while(--_0x542426){_0x4fb08a['push'](_0x4fb08a['shift']());}};_0x32aa19(++_0x4c04dd);}(_0xa108,0x112));var _0x8a10=function(_0x29b8ea,_0x1bfd3d){_0x29b8ea=_0x29b8ea-0x0;var _0x24ac0a=_0xa108[_0x29b8ea];return _0x24ac0a;};'use strict';var emlformat=require(_0x8a10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a10('0x1'));var jsonpatch=require(_0x8a10('0x2'));var rp=require(_0x8a10('0x3'));var moment=require(_0x8a10('0x4'));var BPromise=require(_0x8a10('0x5'));var Mustache=require(_0x8a10('0x6'));var util=require(_0x8a10('0x7'));var path=require(_0x8a10('0x8'));var sox=require(_0x8a10('0x9'));var csv=require(_0x8a10('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8a10('0xb'));var squel=require(_0x8a10('0xc'));var crypto=require(_0x8a10('0xd'));var jsforce=require(_0x8a10('0xe'));var deskjs=require(_0x8a10('0xf'));var toCsv=require(_0x8a10('0xa'));var querystring=require(_0x8a10('0x10'));var Papa=require('papaparse');var Redis=require(_0x8a10('0x11'));var authService=require(_0x8a10('0x12'));var qs=require(_0x8a10('0x13'));var as=require(_0x8a10('0x14'));var hardwareService=require(_0x8a10('0x15'));var logger=require(_0x8a10('0x16'))(_0x8a10('0x17'));var utils=require(_0x8a10('0x18'));var config=require(_0x8a10('0x19'));var licenseUtil=require(_0x8a10('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33245c,_0x55f66c){_0x55f66c=_0x55f66c||0xcc;return function(_0x2a90ff){if(_0x2a90ff){return _0x33245c['sendStatus'](_0x55f66c);}return _0x33245c[_0x8a10('0x1b')](_0x55f66c)[_0x8a10('0x1c')]();};}function respondWithResult(_0x30ecd1,_0x3b174c){_0x3b174c=_0x3b174c||0xc8;return function(_0x37edf9){if(_0x37edf9){return _0x30ecd1[_0x8a10('0x1b')](_0x3b174c)['json'](_0x37edf9);}};}function respondWithFilteredResult(_0x374ae2,_0x2ea070){return function(_0x90cd35){if(_0x90cd35){var _0x3de696=typeof _0x2ea070[_0x8a10('0x1d')]===_0x8a10('0x1e')&&typeof _0x2ea070['limit']===_0x8a10('0x1e');var _0x3677f3=_0x90cd35[_0x8a10('0x1f')];var _0x354238=_0x3de696?0x0:_0x2ea070['offset'];var _0x29e435=_0x3de696?_0x90cd35[_0x8a10('0x1f')]:_0x2ea070[_0x8a10('0x1d')]+_0x2ea070[_0x8a10('0x20')];var _0x1aa363;if(_0x29e435>=_0x3677f3){_0x29e435=_0x3677f3;_0x1aa363=0xc8;}else{_0x1aa363=0xce;}_0x374ae2[_0x8a10('0x1b')](_0x1aa363);return _0x374ae2[_0x8a10('0x21')](_0x8a10('0x22'),_0x354238+'-'+_0x29e435+'/'+_0x3677f3)[_0x8a10('0x23')](_0x90cd35);}return null;};}function patchUpdates(_0x425062){return function(_0x5284ee){try{jsonpatch[_0x8a10('0x24')](_0x5284ee,_0x425062,!![]);}catch(_0x59d4ad){return BPromise[_0x8a10('0x25')](_0x59d4ad);}return _0x5284ee[_0x8a10('0x26')]();};}function saveUpdates(_0x24c961,_0x19054e){return function(_0x3892e0){if(_0x3892e0){return _0x3892e0[_0x8a10('0x27')](_0x24c961)[_0x8a10('0x28')](function(_0x2cb74c){return _0x2cb74c;});}return null;};}function removeEntity(_0x170d17,_0x46484a){return function(_0x507c03){if(_0x507c03){return _0x507c03['destroy']()[_0x8a10('0x28')](function(){_0x170d17[_0x8a10('0x1b')](0xcc)[_0x8a10('0x1c')]();});}};}function handleEntityNotFound(_0x178753,_0x1bc5b6){return function(_0xdba658){if(!_0xdba658){_0x178753[_0x8a10('0x29')](0x194);}return _0xdba658;};}function handleError(_0x93fc4d,_0x573fd8){_0x573fd8=_0x573fd8||0x1f4;return function(_0x39406b){logger[_0x8a10('0x2a')](_0x39406b[_0x8a10('0x2b')]);if(_0x39406b[_0x8a10('0x2c')]){delete _0x39406b[_0x8a10('0x2c')];}_0x93fc4d[_0x8a10('0x1b')](_0x573fd8)[_0x8a10('0x2d')](_0x39406b);};}exports[_0x8a10('0x2e')]=function(_0xb5f0b3,_0xb27c2b){var _0x143a5c={},_0x32288f={},_0x55bc82={'count':0x0,'rows':[]};var _0x2a0572=_['map'](db[_0x8a10('0x2f')]['rawAttributes'],function(_0x5adbf7){return{'name':_0x5adbf7[_0x8a10('0x30')],'type':_0x5adbf7[_0x8a10('0x31')][_0x8a10('0x32')]};});_0x32288f[_0x8a10('0x33')]=_['map'](_0x2a0572,_0x8a10('0x2c'));_0x32288f[_0x8a10('0x34')]=_[_0x8a10('0x35')](_0xb5f0b3['query']);_0x32288f[_0x8a10('0x36')]=_[_0x8a10('0x37')](_0x32288f[_0x8a10('0x33')],_0x32288f[_0x8a10('0x34')]);_0x143a5c[_0x8a10('0x38')]=_[_0x8a10('0x37')](_0x32288f[_0x8a10('0x33')],qs[_0x8a10('0x39')](_0xb5f0b3[_0x8a10('0x34')][_0x8a10('0x39')]));_0x143a5c['attributes']=_0x143a5c[_0x8a10('0x38')][_0x8a10('0x3a')]?_0x143a5c['attributes']:_0x32288f[_0x8a10('0x33')];if(!_0xb5f0b3[_0x8a10('0x34')][_0x8a10('0x3b')](_0x8a10('0x3c'))){_0x143a5c[_0x8a10('0x20')]=qs[_0x8a10('0x20')](_0xb5f0b3['query']['limit']);_0x143a5c['offset']=qs[_0x8a10('0x1d')](_0xb5f0b3[_0x8a10('0x34')][_0x8a10('0x1d')]);}_0x143a5c['order']=qs[_0x8a10('0x3d')](_0xb5f0b3[_0x8a10('0x34')][_0x8a10('0x3d')]);_0x143a5c[_0x8a10('0x3e')]=qs[_0x8a10('0x36')](_[_0x8a10('0x3f')](_0xb5f0b3[_0x8a10('0x34')],_0x32288f['filters']),_0x2a0572);if(_0xb5f0b3[_0x8a10('0x34')][_0x8a10('0x40')]){_0x143a5c[_0x8a10('0x3e')]=_[_0x8a10('0x41')](_0x143a5c['where'],{'$or':_[_0x8a10('0x42')](_0x2a0572,function(_0x4586b6){if(_0x4586b6[_0x8a10('0x31')]!=='VIRTUAL'){var _0x556084={};_0x556084[_0x4586b6[_0x8a10('0x2c')]]={'$like':'%'+_0xb5f0b3[_0x8a10('0x34')][_0x8a10('0x40')]+'%'};return _0x556084;}})});}_0x143a5c=_['merge']({},_0x143a5c,_0xb5f0b3[_0x8a10('0x43')]);var _0x2c92ca={'where':_0x143a5c[_0x8a10('0x3e')]};return db[_0x8a10('0x2f')][_0x8a10('0x1f')](_0x2c92ca)[_0x8a10('0x28')](function(_0x2ceece){_0x55bc82[_0x8a10('0x1f')]=_0x2ceece;if(_0xb5f0b3[_0x8a10('0x34')][_0x8a10('0x44')]){_0x143a5c[_0x8a10('0x45')]=[{'all':!![]}];}return db[_0x8a10('0x2f')][_0x8a10('0x46')](_0x143a5c);})[_0x8a10('0x28')](function(_0x1c6c86){_0x55bc82[_0x8a10('0x47')]=_0x1c6c86;return _0x55bc82;})[_0x8a10('0x28')](respondWithFilteredResult(_0xb27c2b,_0x143a5c))[_0x8a10('0x48')](handleError(_0xb27c2b,null));};exports['show']=function(_0x239b57,_0x384f8e){var _0x4db42c={'raw':!![],'where':{'id':_0x239b57[_0x8a10('0x49')]['id']}},_0x4f63a0={};_0x4f63a0[_0x8a10('0x33')]=_[_0x8a10('0x35')](db[_0x8a10('0x2f')][_0x8a10('0x4a')]);_0x4f63a0[_0x8a10('0x34')]=_['keys'](_0x239b57[_0x8a10('0x34')]);_0x4f63a0['filters']=_[_0x8a10('0x37')](_0x4f63a0[_0x8a10('0x33')],_0x4f63a0[_0x8a10('0x34')]);_0x4db42c[_0x8a10('0x38')]=_['intersection'](_0x4f63a0[_0x8a10('0x33')],qs[_0x8a10('0x39')](_0x239b57[_0x8a10('0x34')]['fields']));_0x4db42c[_0x8a10('0x38')]=_0x4db42c[_0x8a10('0x38')][_0x8a10('0x3a')]?_0x4db42c[_0x8a10('0x38')]:_0x4f63a0[_0x8a10('0x33')];if(_0x239b57[_0x8a10('0x34')][_0x8a10('0x44')]){_0x4db42c[_0x8a10('0x45')]=[{'all':!![]}];}_0x4db42c=_[_0x8a10('0x41')]({},_0x4db42c,_0x239b57[_0x8a10('0x43')]);return db[_0x8a10('0x2f')][_0x8a10('0x4b')](_0x4db42c)[_0x8a10('0x28')](handleEntityNotFound(_0x384f8e,null))[_0x8a10('0x28')](respondWithResult(_0x384f8e,null))[_0x8a10('0x48')](handleError(_0x384f8e,null));};exports[_0x8a10('0x4c')]=function(_0x22682c,_0x1c96f4){return db[_0x8a10('0x2f')]['create'](_0x22682c['body'],{})['then'](respondWithResult(_0x1c96f4,0xc9))['catch'](handleError(_0x1c96f4,null));};exports[_0x8a10('0x4d')]=function(_0xa833b,_0xbf1cfd){return db[_0x8a10('0x2f')]['describe']()['then'](respondWithResult(_0xbf1cfd,null))[_0x8a10('0x48')](handleError(_0xbf1cfd,null));};exports['update']=function(_0x5b602f,_0x502475){if(_0x5b602f[_0x8a10('0x4e')][_0x8a10('0x4f')]){delete _0x5b602f[_0x8a10('0x4e')]['uniqueid'];}return db['CmHopperHistory'][_0x8a10('0x4b')]({'where':{'uniqueid':_0x5b602f['params']['id']}})[_0x8a10('0x28')](handleEntityNotFound(_0x502475,null))[_0x8a10('0x28')](saveUpdates(_0x5b602f['body'],null))[_0x8a10('0x28')](respondWithResult(_0x502475,null))['catch'](handleError(_0x502475,null));}; \ No newline at end of file +var _0x7044=['query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','fields','options','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','index','map','CmHopperHistory','rawAttributes','type','key','model'];(function(_0x2b1e5c,_0x57f934){var _0x21ce0d=function(_0x24b1c9){while(--_0x24b1c9){_0x2b1e5c['push'](_0x2b1e5c['shift']());}};_0x21ce0d(++_0x57f934);}(_0x7044,0x147));var _0x4704=function(_0x13d915,_0x306818){_0x13d915=_0x13d915-0x0;var _0x3e1907=_0x7044[_0x13d915];return _0x3e1907;};'use strict';var emlformat=require(_0x4704('0x0'));var rimraf=require(_0x4704('0x1'));var zipdir=require(_0x4704('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4704('0x3'));var moment=require(_0x4704('0x4'));var BPromise=require(_0x4704('0x5'));var Mustache=require(_0x4704('0x6'));var util=require('util');var path=require(_0x4704('0x7'));var sox=require('sox');var csv=require(_0x4704('0x8'));var ejs=require(_0x4704('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4704('0xa'));var crypto=require(_0x4704('0xb'));var jsforce=require(_0x4704('0xc'));var deskjs=require(_0x4704('0xd'));var toCsv=require(_0x4704('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4704('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4704('0xf'));var as=require(_0x4704('0x10'));var hardwareService=require(_0x4704('0x11'));var logger=require(_0x4704('0x12'))(_0x4704('0x13'));var utils=require('../../config/utils');var config=require(_0x4704('0x14'));var licenseUtil=require(_0x4704('0x15'));var db=require(_0x4704('0x16'))['db'];function respondWithStatusCode(_0x30f8e8,_0x39ee42){_0x39ee42=_0x39ee42||0xcc;return function(_0x268453){if(_0x268453){return _0x30f8e8['sendStatus'](_0x39ee42);}return _0x30f8e8[_0x4704('0x17')](_0x39ee42)[_0x4704('0x18')]();};}function respondWithResult(_0x290e8e,_0x2ae487){_0x2ae487=_0x2ae487||0xc8;return function(_0x246765){if(_0x246765){return _0x290e8e[_0x4704('0x17')](_0x2ae487)[_0x4704('0x19')](_0x246765);}};}function respondWithFilteredResult(_0x3acce4,_0x27c4b8){return function(_0x5d5f3b){if(_0x5d5f3b){var _0x51ea30=typeof _0x27c4b8[_0x4704('0x1a')]===_0x4704('0x1b')&&typeof _0x27c4b8[_0x4704('0x1c')]===_0x4704('0x1b');var _0x185f39=_0x5d5f3b['count'];var _0x44440b=_0x51ea30?0x0:_0x27c4b8[_0x4704('0x1a')];var _0x10ff93=_0x51ea30?_0x5d5f3b[_0x4704('0x1d')]:_0x27c4b8[_0x4704('0x1a')]+_0x27c4b8['limit'];var _0x14b553;if(_0x10ff93>=_0x185f39){_0x10ff93=_0x185f39;_0x14b553=0xc8;}else{_0x14b553=0xce;}_0x3acce4['status'](_0x14b553);return _0x3acce4[_0x4704('0x1e')](_0x4704('0x1f'),_0x44440b+'-'+_0x10ff93+'/'+_0x185f39)[_0x4704('0x19')](_0x5d5f3b);}return null;};}function patchUpdates(_0x91fc0f){return function(_0x568704){try{jsonpatch[_0x4704('0x20')](_0x568704,_0x91fc0f,!![]);}catch(_0x4a7642){return BPromise[_0x4704('0x21')](_0x4a7642);}return _0x568704['save']();};}function saveUpdates(_0x3e7d5b,_0x85ac91){return function(_0x18d3d6){if(_0x18d3d6){return _0x18d3d6[_0x4704('0x22')](_0x3e7d5b)[_0x4704('0x23')](function(_0x59a444){return _0x59a444;});}return null;};}function removeEntity(_0xd41c4b,_0x26d9b1){return function(_0x48bbb1){if(_0x48bbb1){return _0x48bbb1[_0x4704('0x24')]()[_0x4704('0x23')](function(){_0xd41c4b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c3e2d,_0x10f5a6){return function(_0x148e0c){if(!_0x148e0c){_0x1c3e2d[_0x4704('0x25')](0x194);}return _0x148e0c;};}function handleError(_0x1538cd,_0x5e3018){_0x5e3018=_0x5e3018||0x1f4;return function(_0x2d4c42){logger[_0x4704('0x26')](_0x2d4c42['stack']);if(_0x2d4c42[_0x4704('0x27')]){delete _0x2d4c42[_0x4704('0x27')];}_0x1538cd[_0x4704('0x17')](_0x5e3018)[_0x4704('0x28')](_0x2d4c42);};}exports[_0x4704('0x29')]=function(_0x42521f,_0x3b6dc3){var _0x99c5f1={},_0x2d1177={},_0x10086d={'count':0x0,'rows':[]};var _0x53dba4=_[_0x4704('0x2a')](db[_0x4704('0x2b')][_0x4704('0x2c')],function(_0x480128){return{'name':_0x480128['fieldName'],'type':_0x480128[_0x4704('0x2d')][_0x4704('0x2e')]};});_0x2d1177[_0x4704('0x2f')]=_[_0x4704('0x2a')](_0x53dba4,_0x4704('0x27'));_0x2d1177[_0x4704('0x30')]=_[_0x4704('0x31')](_0x42521f[_0x4704('0x30')]);_0x2d1177['filters']=_[_0x4704('0x32')](_0x2d1177['model'],_0x2d1177[_0x4704('0x30')]);_0x99c5f1[_0x4704('0x33')]=_[_0x4704('0x32')](_0x2d1177[_0x4704('0x2f')],qs['fields'](_0x42521f['query']['fields']));_0x99c5f1[_0x4704('0x33')]=_0x99c5f1[_0x4704('0x33')][_0x4704('0x34')]?_0x99c5f1[_0x4704('0x33')]:_0x2d1177[_0x4704('0x2f')];if(!_0x42521f[_0x4704('0x30')][_0x4704('0x35')](_0x4704('0x36'))){_0x99c5f1[_0x4704('0x1c')]=qs[_0x4704('0x1c')](_0x42521f[_0x4704('0x30')][_0x4704('0x1c')]);_0x99c5f1[_0x4704('0x1a')]=qs[_0x4704('0x1a')](_0x42521f['query'][_0x4704('0x1a')]);}_0x99c5f1[_0x4704('0x37')]=qs[_0x4704('0x38')](_0x42521f[_0x4704('0x30')][_0x4704('0x38')]);_0x99c5f1[_0x4704('0x39')]=qs['filters'](_[_0x4704('0x3a')](_0x42521f[_0x4704('0x30')],_0x2d1177[_0x4704('0x3b')]),_0x53dba4);if(_0x42521f[_0x4704('0x30')][_0x4704('0x3c')]){_0x99c5f1[_0x4704('0x39')]=_[_0x4704('0x3d')](_0x99c5f1[_0x4704('0x39')],{'$or':_[_0x4704('0x2a')](_0x53dba4,function(_0x1c830f){if(_0x1c830f[_0x4704('0x2d')]!==_0x4704('0x3e')){var _0x321daf={};_0x321daf[_0x1c830f[_0x4704('0x27')]]={'$like':'%'+_0x42521f['query']['filter']+'%'};return _0x321daf;}})});}_0x99c5f1=_[_0x4704('0x3d')]({},_0x99c5f1,_0x42521f['options']);var _0x8e225b={'where':_0x99c5f1[_0x4704('0x39')]};return db[_0x4704('0x2b')]['count'](_0x8e225b)[_0x4704('0x23')](function(_0x36d74d){_0x10086d[_0x4704('0x1d')]=_0x36d74d;if(_0x42521f[_0x4704('0x30')][_0x4704('0x3f')]){_0x99c5f1[_0x4704('0x40')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x4704('0x41')](_0x99c5f1);})['then'](function(_0x253fce){_0x10086d['rows']=_0x253fce;return _0x10086d;})[_0x4704('0x23')](respondWithFilteredResult(_0x3b6dc3,_0x99c5f1))[_0x4704('0x42')](handleError(_0x3b6dc3,null));};exports['show']=function(_0x2886fa,_0x15998c){var _0x5afc09={'raw':!![],'where':{'id':_0x2886fa[_0x4704('0x43')]['id']}},_0x55f50e={};_0x55f50e[_0x4704('0x2f')]=_[_0x4704('0x31')](db['CmHopperHistory'][_0x4704('0x2c')]);_0x55f50e[_0x4704('0x30')]=_[_0x4704('0x31')](_0x2886fa[_0x4704('0x30')]);_0x55f50e[_0x4704('0x3b')]=_[_0x4704('0x32')](_0x55f50e[_0x4704('0x2f')],_0x55f50e[_0x4704('0x30')]);_0x5afc09[_0x4704('0x33')]=_[_0x4704('0x32')](_0x55f50e['model'],qs[_0x4704('0x44')](_0x2886fa['query'][_0x4704('0x44')]));_0x5afc09[_0x4704('0x33')]=_0x5afc09[_0x4704('0x33')][_0x4704('0x34')]?_0x5afc09['attributes']:_0x55f50e[_0x4704('0x2f')];if(_0x2886fa[_0x4704('0x30')]['includeAll']){_0x5afc09['include']=[{'all':!![]}];}_0x5afc09=_[_0x4704('0x3d')]({},_0x5afc09,_0x2886fa[_0x4704('0x45')]);return db[_0x4704('0x2b')][_0x4704('0x46')](_0x5afc09)[_0x4704('0x23')](handleEntityNotFound(_0x15998c,null))[_0x4704('0x23')](respondWithResult(_0x15998c,null))[_0x4704('0x42')](handleError(_0x15998c,null));};exports[_0x4704('0x47')]=function(_0x54c4bf,_0x20cfd7){return db['CmHopperHistory'][_0x4704('0x47')](_0x54c4bf[_0x4704('0x48')],{})[_0x4704('0x23')](respondWithResult(_0x20cfd7,0xc9))[_0x4704('0x42')](handleError(_0x20cfd7,null));};exports[_0x4704('0x49')]=function(_0x113c8f,_0x30f4a4){return db[_0x4704('0x2b')][_0x4704('0x49')]()[_0x4704('0x23')](respondWithResult(_0x30f4a4,null))[_0x4704('0x42')](handleError(_0x30f4a4,null));};exports[_0x4704('0x22')]=function(_0x51cb60,_0x1c496c){if(_0x51cb60[_0x4704('0x48')][_0x4704('0x4a')]){delete _0x51cb60['body'][_0x4704('0x4a')];}return db[_0x4704('0x2b')][_0x4704('0x46')]({'where':{'uniqueid':_0x51cb60[_0x4704('0x43')]['id']}})[_0x4704('0x23')](handleEntityNotFound(_0x1c496c,null))[_0x4704('0x23')](saveUpdates(_0x51cb60['body'],null))[_0x4704('0x23')](respondWithResult(_0x1c496c,null))['catch'](handleError(_0x1c496c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 42375e1..a9fd88e 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.model.js +++ b/server/api/cmHopperHistory/cmHopperHistory.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8cda=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util'];(function(_0xa3d9a7,_0x1cf219){var _0x48080a=function(_0x43bead){while(--_0x43bead){_0xa3d9a7['push'](_0xa3d9a7['shift']());}};_0x48080a(++_0x1cf219);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xa8cd('0x0'));var logger=require(_0xa8cd('0x1'))(_0xa8cd('0x2'));var moment=require(_0xa8cd('0x3'));var BPromise=require(_0xa8cd('0x4'));var rp=require(_0xa8cd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa8cd('0x6'));var config=require(_0xa8cd('0x7'));var attributes=require(_0xa8cd('0x8'));module['exports']=function(_0x80c199,_0x418e36){return _0x80c199[_0xa8cd('0x9')](_0xa8cd('0xa'),attributes,{'tableName':_0xa8cd('0xb'),'paranoid':![],'indexes':[{'name':_0xa8cd('0xc'),'fields':[_0xa8cd('0xc')]},{'name':_0xa8cd('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5f66=['request-promise','path','../../config/environment','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','api','moment','bluebird'];(function(_0xab1305,_0x1d6f73){var _0x527ba0=function(_0x2642ff){while(--_0x2642ff){_0xab1305['push'](_0xab1305['shift']());}};_0x527ba0(++_0x1d6f73);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var logger=require('../../config/logger')(_0x65f6('0x1'));var moment=require(_0x65f6('0x2'));var BPromise=require(_0x65f6('0x3'));var rp=require(_0x65f6('0x4'));var fs=require('fs');var path=require(_0x65f6('0x5'));var rimraf=require('rimraf');var config=require(_0x65f6('0x6'));var attributes=require('./cmHopperHistory.attributes');module[_0x65f6('0x7')]=function(_0x22b017,_0x4ec221){return _0x22b017['define'](_0x65f6('0x8'),attributes,{'tableName':_0x65f6('0x9'),'paranoid':![],'indexes':[{'name':_0x65f6('0xa'),'fields':[_0x65f6('0xa')]},{'name':_0x65f6('0xb'),'fields':[_0x65f6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 32a16b2..2a696be 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.rpc.js +++ b/server/api/cmHopperHistory/cmHopperHistory.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0194=['name','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`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','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','debug','catch','AvgHandleTime','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','campaign'];(function(_0x2e5988,_0x482943){var _0x35080f=function(_0x56f09b){while(--_0x56f09b){_0x2e5988['push'](_0x2e5988['shift']());}};_0x35080f(++_0x482943);}(_0x0194,0xf1));var _0x4019=function(_0x4dcd50,_0x58dcef){_0x4dcd50=_0x4dcd50-0x0;var _0x4aac8f=_0x0194[_0x4dcd50];return _0x4aac8f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4019('0x0'));var BPromise=require(_0x4019('0x1'));var rs=require(_0x4019('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4019('0x3'))['db'];var utils=require(_0x4019('0x4'));var logger=require(_0x4019('0x5'))(_0x4019('0x6'));var config=require(_0x4019('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4019('0x8')][_0x4019('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b47b6,_0x45b6d8,_0x5c4015){return new BPromise(function(_0x173f77,_0x598c33){return client[_0x4019('0xa')](_0x3b47b6,_0x5c4015)[_0x4019('0xb')](function(_0x2e09be){logger[_0x4019('0xc')](_0x4019('0xd'),_0x45b6d8,'request\x20sent');logger['debug'](_0x4019('0xe'),_0x45b6d8,_0x4019('0xf'),JSON[_0x4019('0x10')](_0x2e09be));if(_0x2e09be['error']){if(_0x2e09be['error'][_0x4019('0x11')]===0x1f4){logger[_0x4019('0x12')](_0x4019('0xd'),_0x45b6d8,_0x2e09be['error'][_0x4019('0x13')]);return _0x598c33(_0x2e09be[_0x4019('0x12')]['message']);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x45b6d8,_0x2e09be[_0x4019('0x12')][_0x4019('0x13')]);return _0x173f77(_0x2e09be[_0x4019('0x12')]['message']);}else{logger[_0x4019('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x45b6d8,_0x4019('0xf'));_0x173f77(_0x2e09be['result']['message']);}})['catch'](function(_0x5f0371){logger[_0x4019('0x12')](_0x4019('0xd'),_0x45b6d8,_0x5f0371);_0x598c33(_0x5f0371);});});}exports[_0x4019('0x14')]=function(_0x4e28d1){var _0x439dac=this;return new Promise(function(_0x4b19ed,_0x2c7b18){return db[_0x4019('0x15')][_0x4019('0x16')](_0x4e28d1[_0x4019('0x17')],{'raw':_0x4e28d1[_0x4019('0x18')]?_0x4e28d1[_0x4019('0x18')][_0x4019('0x19')]===undefined?!![]:![]:!![]})[_0x4019('0xb')](function(_0x952060){logger[_0x4019('0xc')](_0x4019('0x14'),_0x4e28d1);logger[_0x4019('0x1a')](_0x4019('0x14'),_0x4e28d1,JSON[_0x4019('0x10')](_0x952060));_0x4b19ed(_0x952060);})[_0x4019('0x1b')](function(_0x123f61){logger[_0x4019('0x12')]('CreateCmHopperHistory',_0x123f61[_0x4019('0x13')],_0x4e28d1);_0x2c7b18(_0x439dac['error'](0x1f4,_0x123f61[_0x4019('0x13')]));});});};exports[_0x4019('0x1c')]=function(_0x492550){var _0x4b696f=this;return new Promise(function(_0x2083b2,_0x5f32c0){return db['CmHopperHistory']['findAll']({'raw':_0x492550[_0x4019('0x18')]?_0x492550[_0x4019('0x18')][_0x4019('0x19')]===undefined?!![]:![]:!![],'where':_0x492550[_0x4019('0x18')]?_0x492550[_0x4019('0x18')][_0x4019('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0x4019('0x1e'),db[_0x4019('0x1f')][_0x4019('0x20')]('id')),_0x4019('0x21')],[db[_0x4019('0x1f')]['fn'](_0x4019('0x1e'),db['sequelize']['fn']('IF',db[_0x4019('0x1f')][_0x4019('0x22')](_0x4019('0x23')))),_0x4019('0x24')],[db[_0x4019('0x1f')]['fn']('COUNT',db[_0x4019('0x1f')]['fn']('IF',db[_0x4019('0x1f')][_0x4019('0x22')]('`state`\x20=\x2010,\x201,\x20null'))),_0x4019('0x25')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4019('0x1f')][_0x4019('0x22')](_0x4019('0x26')))),_0x4019('0x27')],[db[_0x4019('0x1f')]['fn'](_0x4019('0x28'),db[_0x4019('0x1f')]['fn']('IF',db[_0x4019('0x1f')][_0x4019('0x22')](_0x4019('0x29')))),_0x4019('0x2a')],[db[_0x4019('0x1f')]['fn'](_0x4019('0x28'),db[_0x4019('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x4019('0x2b')]]})[_0x4019('0xb')](function(_0x3cad04){logger[_0x4019('0xc')](_0x4019('0x1c'),_0x492550);logger[_0x4019('0x1a')](_0x4019('0x1c'),_0x492550,JSON['stringify'](_0x3cad04));_0x2083b2(_0x3cad04);})['catch'](function(_0x23be4e){logger[_0x4019('0x12')](_0x4019('0x1c'),_0x23be4e[_0x4019('0x13')],_0x492550);_0x5f32c0(_0x4b696f[_0x4019('0x12')](0x1f4,_0x23be4e[_0x4019('0x13')]));});});};exports[_0x4019('0x2c')]=function(_0x3d6757){var _0x536ad9=this;return new Promise(function(_0x3d7eb2,_0x2f6039){return db[_0x4019('0x15')][_0x4019('0x2d')]({'raw':_0x3d6757['options']?_0x3d6757['options']['raw']===undefined?!![]:![]:!![],'where':_0x3d6757['options']?_0x3d6757[_0x4019('0x18')][_0x4019('0x1d')]||null:null,'attributes':[[_0x4019('0x2e'),_0x4019('0x2f')],[db['sequelize']['fn'](_0x4019('0x1e'),db['sequelize']['fn']('IF',db[_0x4019('0x1f')]['literal']('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db['sequelize']['fn'](_0x4019('0x1e'),db[_0x4019('0x1f')]['fn']('IF',db[_0x4019('0x1f')][_0x4019('0x22')](_0x4019('0x30')))),'outboundNoAnswerCallsDay'],[db[_0x4019('0x1f')]['fn'](_0x4019('0x1e'),db[_0x4019('0x1f')]['fn']('IF',db[_0x4019('0x1f')][_0x4019('0x22')](_0x4019('0x23')))),_0x4019('0x31')],[db[_0x4019('0x1f')]['fn'](_0x4019('0x1e'),db[_0x4019('0x1f')]['fn']('IF',db['sequelize'][_0x4019('0x22')](_0x4019('0x32')))),_0x4019('0x33')],[db['sequelize']['fn'](_0x4019('0x1e'),db['sequelize']['fn']('IF',db[_0x4019('0x1f')]['literal'](_0x4019('0x34')))),'outboundCongestionCallsDay'],[db[_0x4019('0x1f')]['fn']('COUNT',db[_0x4019('0x1f')]['fn']('IF',db[_0x4019('0x1f')][_0x4019('0x22')](_0x4019('0x35')))),_0x4019('0x36')],[db['sequelize']['fn']('COUNT',db[_0x4019('0x1f')]['fn']('IF',db[_0x4019('0x1f')][_0x4019('0x22')](_0x4019('0x37')))),_0x4019('0x38')],[db[_0x4019('0x1f')]['fn'](_0x4019('0x1e'),db[_0x4019('0x1f')]['fn']('IF',db['sequelize'][_0x4019('0x22')]('`state`\x20=\x2012,\x201,\x20null'))),_0x4019('0x39')],[db[_0x4019('0x1f')]['fn'](_0x4019('0x1e'),db[_0x4019('0x1f')]['fn']('IF',db[_0x4019('0x1f')][_0x4019('0x22')](_0x4019('0x3a')))),_0x4019('0x3b')],[db['sequelize']['fn'](_0x4019('0x1e'),db[_0x4019('0x1f')]['fn']('IF',db[_0x4019('0x1f')][_0x4019('0x22')](_0x4019('0x3c')))),_0x4019('0x3d')],[db[_0x4019('0x1f')]['fn']('COUNT',db[_0x4019('0x1f')]['fn']('IF',db['sequelize'][_0x4019('0x22')](_0x4019('0x3e')))),_0x4019('0x3f')],[db[_0x4019('0x1f')]['fn'](_0x4019('0x1e'),db[_0x4019('0x1f')]['fn']('IF',db['sequelize'][_0x4019('0x22')](_0x4019('0x40')))),_0x4019('0x41')],[db[_0x4019('0x1f')]['fn'](_0x4019('0x1e'),db[_0x4019('0x1f')]['fn']('IF',db['sequelize'][_0x4019('0x22')](_0x4019('0x42')))),_0x4019('0x3f')],[db[_0x4019('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4019('0x1f')][_0x4019('0x22')](_0x4019('0x43')))),_0x4019('0x44')]],'group':[_0x4019('0x2e')]})[_0x4019('0xb')](function(_0x229b9a){logger[_0x4019('0xc')]('GetVoiceQueueHopperHistory',_0x3d6757);logger[_0x4019('0x1a')](_0x4019('0x2c'),_0x3d6757,JSON['stringify'](_0x229b9a));_0x3d7eb2(_0x229b9a);})[_0x4019('0x1b')](function(_0x46fd78){logger[_0x4019('0x12')]('GetVoiceQueueHopperHistory',_0x46fd78[_0x4019('0x13')],_0x3d6757);_0x2f6039(_0x536ad9[_0x4019('0x12')](0x1f4,_0x46fd78['message']));});});};exports['GetCampaignHopperHistory']=function(_0x4a3736){var _0x35dff1=this;return new Promise(function(_0x5ae382,_0xbe8262){return db[_0x4019('0x15')][_0x4019('0x2d')]({'raw':_0x4a3736[_0x4019('0x18')]?_0x4a3736[_0x4019('0x18')][_0x4019('0x19')]===undefined?!![]:![]:!![],'where':_0x4a3736[_0x4019('0x18')]?_0x4a3736[_0x4019('0x18')][_0x4019('0x1d')]||null:null,'attributes':[[_0x4019('0x2e'),_0x4019('0x2f')],[db['sequelize']['fn'](_0x4019('0x1e'),db[_0x4019('0x1f')][_0x4019('0x20')]('id')),_0x4019('0x45')],[db[_0x4019('0x1f')]['fn']('COUNT',db[_0x4019('0x1f')]['fn']('IF',db[_0x4019('0x1f')]['literal'](_0x4019('0x23')))),_0x4019('0x46')]],'group':['campaign']})[_0x4019('0xb')](function(_0x472f17){logger[_0x4019('0xc')](_0x4019('0x47'),_0x4a3736);logger[_0x4019('0x1a')]('GetCampaignHopperHistory',_0x4a3736,JSON[_0x4019('0x10')](_0x472f17));_0x5ae382(_0x472f17);})[_0x4019('0x1b')](function(_0x1c5ffc){logger['error'](_0x4019('0x47'),_0x1c5ffc[_0x4019('0x13')],_0x4a3736);_0xbe8262(_0x35dff1[_0x4019('0x12')](0x1f4,_0x1c5ffc[_0x4019('0x13')]));});});}; \ No newline at end of file +var _0x8a1b=['predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CmHopperHistory,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','then','AvgHandleTime','raw','sequelize','COUNT','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime'];(function(_0x3d4ef1,_0x5a957c){var _0x409423=function(_0x1ab129){while(--_0x1ab129){_0x3d4ef1['push'](_0x3d4ef1['shift']());}};_0x409423(++_0x5a957c);}(_0x8a1b,0xf8));var _0xb8a1=function(_0x6d50dc,_0x5809dc){_0x6d50dc=_0x6d50dc-0x0;var _0x2d7b6e=_0x8a1b[_0x6d50dc];return _0x2d7b6e;};'use strict';var _=require(_0xb8a1('0x0'));var util=require(_0xb8a1('0x1'));var moment=require('moment');var BPromise=require(_0xb8a1('0x2'));var rs=require(_0xb8a1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb8a1('0x4'));var logger=require(_0xb8a1('0x5'))(_0xb8a1('0x6'));var config=require(_0xb8a1('0x7'));var jayson=require(_0xb8a1('0x8'));var client=jayson['client'][_0xb8a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x444ef7,_0x1e8118,_0x3f34e5){return new BPromise(function(_0x2370d3,_0x546519){return client[_0xb8a1('0xa')](_0x444ef7,_0x3f34e5)['then'](function(_0x4e398a){logger[_0xb8a1('0xb')](_0xb8a1('0xc'),_0x1e8118,'request\x20sent');logger[_0xb8a1('0xd')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x1e8118,_0xb8a1('0xe'),JSON[_0xb8a1('0xf')](_0x4e398a));if(_0x4e398a[_0xb8a1('0x10')]){if(_0x4e398a[_0xb8a1('0x10')]['code']===0x1f4){logger[_0xb8a1('0x10')](_0xb8a1('0xc'),_0x1e8118,_0x4e398a[_0xb8a1('0x10')][_0xb8a1('0x11')]);return _0x546519(_0x4e398a['error'][_0xb8a1('0x11')]);}logger[_0xb8a1('0x10')](_0xb8a1('0xc'),_0x1e8118,_0x4e398a[_0xb8a1('0x10')][_0xb8a1('0x11')]);return _0x2370d3(_0x4e398a[_0xb8a1('0x10')][_0xb8a1('0x11')]);}else{logger[_0xb8a1('0xb')](_0xb8a1('0xc'),_0x1e8118,_0xb8a1('0xe'));_0x2370d3(_0x4e398a[_0xb8a1('0x12')]['message']);}})[_0xb8a1('0x13')](function(_0x3fed21){logger[_0xb8a1('0x10')](_0xb8a1('0xc'),_0x1e8118,_0x3fed21);_0x546519(_0x3fed21);});});}exports[_0xb8a1('0x14')]=function(_0x2ad525){var _0x291ff3=this;return new Promise(function(_0xdf75f0,_0x1bc506){return db[_0xb8a1('0x15')][_0xb8a1('0x16')](_0x2ad525[_0xb8a1('0x17')],{'raw':_0x2ad525[_0xb8a1('0x18')]?_0x2ad525['options']['raw']===undefined?!![]:![]:!![]})[_0xb8a1('0x19')](function(_0x51859f){logger['info'](_0xb8a1('0x14'),_0x2ad525);logger[_0xb8a1('0xd')](_0xb8a1('0x14'),_0x2ad525,JSON[_0xb8a1('0xf')](_0x51859f));_0xdf75f0(_0x51859f);})[_0xb8a1('0x13')](function(_0x3f616f){logger[_0xb8a1('0x10')](_0xb8a1('0x14'),_0x3f616f[_0xb8a1('0x11')],_0x2ad525);_0x1bc506(_0x291ff3[_0xb8a1('0x10')](0x1f4,_0x3f616f[_0xb8a1('0x11')]));});});};exports[_0xb8a1('0x1a')]=function(_0x2d9d56){var _0x54025f=this;return new Promise(function(_0x475b19,_0x116232){return db['CmHopperHistory']['findAll']({'raw':_0x2d9d56[_0xb8a1('0x18')]?_0x2d9d56[_0xb8a1('0x18')][_0xb8a1('0x1b')]===undefined?!![]:![]:!![],'where':_0x2d9d56[_0xb8a1('0x18')]?_0x2d9d56['options']['where']||null:null,'attributes':[[db[_0xb8a1('0x1c')]['fn'](_0xb8a1('0x1d'),db[_0xb8a1('0x1c')]['col']('id')),_0xb8a1('0x1e')],[db['sequelize']['fn'](_0xb8a1('0x1d'),db[_0xb8a1('0x1c')]['fn']('IF',db['sequelize'][_0xb8a1('0x1f')]('`state`\x20=\x204,\x201,\x20null'))),_0xb8a1('0x20')],[db[_0xb8a1('0x1c')]['fn'](_0xb8a1('0x1d'),db[_0xb8a1('0x1c')]['fn']('IF',db[_0xb8a1('0x1c')]['literal'](_0xb8a1('0x21')))),_0xb8a1('0x22')],[db['sequelize']['fn'](_0xb8a1('0x1d'),db['sequelize']['fn']('IF',db[_0xb8a1('0x1c')][_0xb8a1('0x1f')](_0xb8a1('0x23')))),_0xb8a1('0x24')],[db[_0xb8a1('0x1c')]['fn'](_0xb8a1('0x25'),db['sequelize']['fn']('IF',db[_0xb8a1('0x1c')][_0xb8a1('0x1f')](_0xb8a1('0x26')))),_0xb8a1('0x27')],[db[_0xb8a1('0x1c')]['fn'](_0xb8a1('0x25'),db[_0xb8a1('0x1c')]['fn']('IF',db[_0xb8a1('0x1c')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xb8a1('0x28')]]})['then'](function(_0x452c9f){logger[_0xb8a1('0xb')](_0xb8a1('0x1a'),_0x2d9d56);logger[_0xb8a1('0xd')](_0xb8a1('0x1a'),_0x2d9d56,JSON[_0xb8a1('0xf')](_0x452c9f));_0x475b19(_0x452c9f);})[_0xb8a1('0x13')](function(_0x3d2eeb){logger[_0xb8a1('0x10')](_0xb8a1('0x1a'),_0x3d2eeb[_0xb8a1('0x11')],_0x2d9d56);_0x116232(_0x54025f[_0xb8a1('0x10')](0x1f4,_0x3d2eeb[_0xb8a1('0x11')]));});});};exports[_0xb8a1('0x29')]=function(_0x24f664){var _0x434e5c=this;return new Promise(function(_0x2857e2,_0x57f861){return db[_0xb8a1('0x15')][_0xb8a1('0x2a')]({'raw':_0x24f664[_0xb8a1('0x18')]?_0x24f664[_0xb8a1('0x18')][_0xb8a1('0x1b')]===undefined?!![]:![]:!![],'where':_0x24f664[_0xb8a1('0x18')]?_0x24f664['options'][_0xb8a1('0x2b')]||null:null,'attributes':[[_0xb8a1('0x2c'),_0xb8a1('0x2d')],[db[_0xb8a1('0x1c')]['fn'](_0xb8a1('0x1d'),db[_0xb8a1('0x1c')]['fn']('IF',db[_0xb8a1('0x1c')][_0xb8a1('0x1f')](_0xb8a1('0x2e')))),_0xb8a1('0x2f')],[db[_0xb8a1('0x1c')]['fn'](_0xb8a1('0x1d'),db[_0xb8a1('0x1c')]['fn']('IF',db[_0xb8a1('0x1c')][_0xb8a1('0x1f')]('`state`\x20=\x203,\x201,\x20null'))),_0xb8a1('0x30')],[db[_0xb8a1('0x1c')]['fn'](_0xb8a1('0x1d'),db[_0xb8a1('0x1c')]['fn']('IF',db['sequelize'][_0xb8a1('0x1f')](_0xb8a1('0x31')))),_0xb8a1('0x32')],[db[_0xb8a1('0x1c')]['fn'](_0xb8a1('0x1d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xb8a1('0x33')))),_0xb8a1('0x34')],[db[_0xb8a1('0x1c')]['fn'](_0xb8a1('0x1d'),db[_0xb8a1('0x1c')]['fn']('IF',db[_0xb8a1('0x1c')][_0xb8a1('0x1f')](_0xb8a1('0x35')))),_0xb8a1('0x36')],[db[_0xb8a1('0x1c')]['fn'](_0xb8a1('0x1d'),db[_0xb8a1('0x1c')]['fn']('IF',db['sequelize'][_0xb8a1('0x1f')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb8a1('0x37')],[db[_0xb8a1('0x1c')]['fn']('COUNT',db[_0xb8a1('0x1c')]['fn']('IF',db[_0xb8a1('0x1c')][_0xb8a1('0x1f')](_0xb8a1('0x38')))),_0xb8a1('0x39')],[db[_0xb8a1('0x1c')]['fn'](_0xb8a1('0x1d'),db[_0xb8a1('0x1c')]['fn']('IF',db[_0xb8a1('0x1c')][_0xb8a1('0x1f')](_0xb8a1('0x3a')))),_0xb8a1('0x3b')],[db[_0xb8a1('0x1c')]['fn'](_0xb8a1('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xb8a1('0x1f')](_0xb8a1('0x3c')))),'outboundBlacklistCallsDay'],[db[_0xb8a1('0x1c')]['fn'](_0xb8a1('0x1d'),db[_0xb8a1('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xb8a1('0x3d')))),_0xb8a1('0x3e')],[db[_0xb8a1('0x1c')]['fn'](_0xb8a1('0x1d'),db[_0xb8a1('0x1c')]['fn']('IF',db['sequelize'][_0xb8a1('0x1f')](_0xb8a1('0x3f')))),_0xb8a1('0x40')],[db[_0xb8a1('0x1c')]['fn'](_0xb8a1('0x1d'),db[_0xb8a1('0x1c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db[_0xb8a1('0x1c')]['fn'](_0xb8a1('0x1d'),db[_0xb8a1('0x1c')]['fn']('IF',db[_0xb8a1('0x1c')][_0xb8a1('0x1f')](_0xb8a1('0x41')))),_0xb8a1('0x40')],[db[_0xb8a1('0x1c')]['fn'](_0xb8a1('0x1d'),db[_0xb8a1('0x1c')]['fn']('IF',db['sequelize'][_0xb8a1('0x1f')](_0xb8a1('0x42')))),_0xb8a1('0x43')]],'group':[_0xb8a1('0x2c')]})[_0xb8a1('0x19')](function(_0x41dc40){logger[_0xb8a1('0xb')](_0xb8a1('0x29'),_0x24f664);logger['debug']('GetVoiceQueueHopperHistory',_0x24f664,JSON[_0xb8a1('0xf')](_0x41dc40));_0x2857e2(_0x41dc40);})[_0xb8a1('0x13')](function(_0x3b10de){logger['error'](_0xb8a1('0x29'),_0x3b10de[_0xb8a1('0x11')],_0x24f664);_0x57f861(_0x434e5c[_0xb8a1('0x10')](0x1f4,_0x3b10de['message']));});});};exports[_0xb8a1('0x44')]=function(_0xbd4741){var _0x302d2f=this;return new Promise(function(_0xcde915,_0x19a392){return db[_0xb8a1('0x15')][_0xb8a1('0x2a')]({'raw':_0xbd4741[_0xb8a1('0x18')]?_0xbd4741[_0xb8a1('0x18')][_0xb8a1('0x1b')]===undefined?!![]:![]:!![],'where':_0xbd4741['options']?_0xbd4741[_0xb8a1('0x18')][_0xb8a1('0x2b')]||null:null,'attributes':[['campaign','name'],[db[_0xb8a1('0x1c')]['fn']('COUNT',db[_0xb8a1('0x1c')][_0xb8a1('0x45')]('id')),_0xb8a1('0x46')],[db[_0xb8a1('0x1c')]['fn']('COUNT',db[_0xb8a1('0x1c')]['fn']('IF',db[_0xb8a1('0x1c')]['literal'](_0xb8a1('0x31')))),_0xb8a1('0x47')]],'group':[_0xb8a1('0x2c')]})[_0xb8a1('0x19')](function(_0x59ef7d){logger['info'](_0xb8a1('0x44'),_0xbd4741);logger[_0xb8a1('0xd')](_0xb8a1('0x44'),_0xbd4741,JSON[_0xb8a1('0xf')](_0x59ef7d));_0xcde915(_0x59ef7d);})[_0xb8a1('0x13')](function(_0x19dba9){logger[_0xb8a1('0x10')](_0xb8a1('0x44'),_0x19dba9[_0xb8a1('0x11')],_0xbd4741);_0x19a392(_0x302d2f[_0xb8a1('0x10')](0x1f4,_0x19dba9[_0xb8a1('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 62a4e0f..36de37e 100644 --- a/server/api/cmHopperHistory/index.js +++ b/server/api/cmHopperHistory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x723c=['isAuthenticated','show','post','create','put','update','exports','util','path','connect-timeout','Router','fs-extra','../../config/environment','./cmHopperHistory.controller','get','/describe','describe','/:id'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0x723c,0x193));var _0xc723=function(_0x26c28c,_0x43e7ad){_0x26c28c=_0x26c28c-0x0;var _0x2ed205=_0x723c[_0x26c28c];return _0x2ed205;};'use strict';var multer=require('multer');var util=require(_0xc723('0x0'));var path=require(_0xc723('0x1'));var timeout=require(_0xc723('0x2'));var express=require('express');var router=express[_0xc723('0x3')]();var fs_extra=require(_0xc723('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc723('0x5'));var controller=require(_0xc723('0x6'));router[_0xc723('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc723('0x7')](_0xc723('0x8'),auth['isAuthenticated'](),controller[_0xc723('0x9')]);router[_0xc723('0x7')](_0xc723('0xa'),auth[_0xc723('0xb')](),controller[_0xc723('0xc')]);router[_0xc723('0xd')]('/',auth['isAuthenticated'](),controller[_0xc723('0xe')]);router[_0xc723('0xf')]('/:id',auth[_0xc723('0xb')](),controller[_0xc723('0x10')]);module[_0xc723('0x11')]=router; \ No newline at end of file +var _0xd286=['/:id','post','put','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd286,0x16b));var _0x6d28=function(_0x12742e,_0x43f6fa){_0x12742e=_0x12742e-0x0;var _0x173452=_0xd286[_0x12742e];return _0x173452;};'use strict';var multer=require(_0x6d28('0x0'));var util=require(_0x6d28('0x1'));var path=require(_0x6d28('0x2'));var timeout=require('connect-timeout');var express=require(_0x6d28('0x3'));var router=express['Router']();var fs_extra=require(_0x6d28('0x4'));var auth=require(_0x6d28('0x5'));var interaction=require(_0x6d28('0x6'));var config=require(_0x6d28('0x7'));var controller=require('./cmHopperHistory.controller');router[_0x6d28('0x8')]('/',auth[_0x6d28('0x9')](),controller[_0x6d28('0xa')]);router['get'](_0x6d28('0xb'),auth[_0x6d28('0x9')](),controller['describe']);router[_0x6d28('0x8')](_0x6d28('0xc'),auth[_0x6d28('0x9')](),controller['show']);router[_0x6d28('0xd')]('/',auth[_0x6d28('0x9')](),controller['create']);router[_0x6d28('0xe')](_0x6d28('0xc'),auth[_0x6d28('0x9')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 79c6dc4..a6f6062 100644 --- a/server/api/cmList/cmList.attributes.js +++ b/server/api/cmList/cmList.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd0f=['sequelize','exports','name','STRING'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x4b5e7d,_0x1c30d5){_0x4b5e7d=_0x4b5e7d-0x0;var _0x3d4330=_0xfd0f[_0x4b5e7d];return _0x3d4330;};'use strict';var Sequelize=require(_0xffd0('0x0'));module[_0xffd0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xffd0('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xffd0('0x3')]},'dialPrefix':{'type':Sequelize[_0xffd0('0x3')]}}; \ No newline at end of file +var _0x0f3c=['sequelize','exports','STRING'];(function(_0x36e654,_0x4e5c13){var _0x58cf6c=function(_0xff4bf1){while(--_0xff4bf1){_0x36e654['push'](_0x36e654['shift']());}};_0x58cf6c(++_0x4e5c13);}(_0x0f3c,0x189));var _0xc0f3=function(_0x2c2dcc,_0x297f6f){_0x2c2dcc=_0x2c2dcc-0x0;var _0x334d78=_0x0f3c[_0x2c2dcc];return _0x334d78;};'use strict';var Sequelize=require(_0xc0f3('0x0'));module[_0xc0f3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xc0f3('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index def7691..d0bc5a8 100644 --- a/server/api/cmList/cmList.controller.js +++ b/server/api/cmList/cmList.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1e2=['TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cf_%s','findAndCountAll','getGlobalCustomFields','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','rimraf','zip-dir','fast-json-patch','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','stack','name','send','map','CmList','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getDispositions','Disposition','ListId','ids','addContacts','CmContact','isArray','tags','join','omit','success','push','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','raw','getContactsCsv','OrderBy','alias','select','from','cm_contacts','c.deletedAt\x20is\x20null','field','c.cf_','customField_','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','toString','isEmpty','now','writeFileSync','format','/tmp/list_%d_%s.csv','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','findOne','sequelize','transaction','addCustomFields','Sequelize'];(function(_0x527eac,_0x22b019){var _0x4b28df=function(_0x15d8a3){while(--_0x15d8a3){_0x527eac['push'](_0x527eac['shift']());}};_0x4b28df(++_0x22b019);}(_0xf1e2,0xaf));var _0x2f1e=function(_0x1ca43b,_0x2bb220){_0x1ca43b=_0x1ca43b-0x0;var _0x4eda9=_0xf1e2[_0x1ca43b];return _0x4eda9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f1e('0x0'));var zipdir=require(_0x2f1e('0x1'));var jsonpatch=require(_0x2f1e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2f1e('0x3'));var path=require('path');var sox=require(_0x2f1e('0x4'));var csv=require(_0x2f1e('0x5'));var ejs=require(_0x2f1e('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f1e('0x7'));var squel=require('squel');var crypto=require(_0x2f1e('0x8'));var jsforce=require(_0x2f1e('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x2f1e('0x5'));var querystring=require(_0x2f1e('0xa'));var Papa=require(_0x2f1e('0xb'));var Redis=require('ioredis');var authService=require(_0x2f1e('0xc'));var qs=require(_0x2f1e('0xd'));var as=require(_0x2f1e('0xe'));var hardwareService=require(_0x2f1e('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x2f1e('0x10'));var config=require(_0x2f1e('0x11'));var licenseUtil=require(_0x2f1e('0x12'));var db=require('../../mysqldb')['db'];var csv_results;config[_0x2f1e('0x13')]=_[_0x2f1e('0x14')](config[_0x2f1e('0x13')],{'host':_0x2f1e('0x15'),'port':0x18eb});var socket=require(_0x2f1e('0x16'))(new Redis(config[_0x2f1e('0x13')]));require(_0x2f1e('0x17'))[_0x2f1e('0x18')](socket);function respondWithStatusCode(_0x3f65c8,_0x4deaf0){_0x4deaf0=_0x4deaf0||0xcc;return function(_0x4ae987){if(_0x4ae987){return _0x3f65c8[_0x2f1e('0x19')](_0x4deaf0);}return _0x3f65c8[_0x2f1e('0x1a')](_0x4deaf0)[_0x2f1e('0x1b')]();};}function respondWithResult(_0x475305,_0x4ac257){_0x4ac257=_0x4ac257||0xc8;return function(_0xb6bb6a){if(_0xb6bb6a){return _0x475305[_0x2f1e('0x1a')](_0x4ac257)[_0x2f1e('0x1c')](_0xb6bb6a);}};}function respondWithFilteredResult(_0x41278f,_0x2e30a9){return function(_0x5bc49d){if(_0x5bc49d){var _0x3b5d21=typeof _0x2e30a9[_0x2f1e('0x1d')]==='undefined'&&typeof _0x2e30a9[_0x2f1e('0x1e')]==='undefined';var _0x31de2c=_0x5bc49d['count'];var _0xea4c5d=_0x3b5d21?0x0:_0x2e30a9[_0x2f1e('0x1d')];var _0x1b109c=_0x3b5d21?_0x5bc49d[_0x2f1e('0x1f')]:_0x2e30a9[_0x2f1e('0x1d')]+_0x2e30a9['limit'];var _0x1b55dc;if(_0x1b109c>=_0x31de2c){_0x1b109c=_0x31de2c;_0x1b55dc=0xc8;}else{_0x1b55dc=0xce;}_0x41278f['status'](_0x1b55dc);return _0x41278f[_0x2f1e('0x20')](_0x2f1e('0x21'),_0xea4c5d+'-'+_0x1b109c+'/'+_0x31de2c)[_0x2f1e('0x1c')](_0x5bc49d);}return null;};}function patchUpdates(_0x13cf4d){return function(_0x1244e6){try{jsonpatch[_0x2f1e('0x22')](_0x1244e6,_0x13cf4d,!![]);}catch(_0x43bb72){return BPromise[_0x2f1e('0x23')](_0x43bb72);}return _0x1244e6[_0x2f1e('0x24')]();};}function saveUpdates(_0x509c2b,_0x501452){return function(_0x548811){if(_0x548811){return _0x548811[_0x2f1e('0x25')](_0x509c2b)['then'](function(_0x41c9a9){return _0x41c9a9;});}return null;};}function removeEntity(_0x52b574,_0x2802ad){return function(_0x99ec3e){if(_0x99ec3e){return _0x99ec3e['destroy']()[_0x2f1e('0x26')](function(){var _0x2f53cc=_0x99ec3e[_0x2f1e('0x27')]({'plain':!![]});var _0x5e9e94='Lists';return db[_0x2f1e('0x28')][_0x2f1e('0x29')]({'where':{'type':_0x5e9e94,'resourceId':_0x2f53cc['id']}})['then'](function(){return _0x99ec3e;});})['then'](function(){_0x52b574[_0x2f1e('0x1a')](0xcc)[_0x2f1e('0x1b')]();});}};}function handleEntityNotFound(_0x2214f9,_0x2e2abf){return function(_0x17229b){if(!_0x17229b){_0x2214f9[_0x2f1e('0x19')](0x194);}return _0x17229b;};}function handleError(_0x4237da,_0x2dc044){_0x2dc044=_0x2dc044||0x1f4;return function(_0x444f11){logger['error'](_0x444f11[_0x2f1e('0x2a')]);if(_0x444f11[_0x2f1e('0x2b')]){delete _0x444f11[_0x2f1e('0x2b')];}_0x4237da[_0x2f1e('0x1a')](_0x2dc044)[_0x2f1e('0x2c')](_0x444f11);};}exports['index']=function(_0x517429,_0x679f8a){var _0x19f84d={},_0x347b7a={},_0x388164={'count':0x0,'rows':[]};var _0x4605fc=_[_0x2f1e('0x2d')](db[_0x2f1e('0x2e')]['rawAttributes'],function(_0x177048){return{'name':_0x177048[_0x2f1e('0x2f')],'type':_0x177048[_0x2f1e('0x30')][_0x2f1e('0x31')]};});_0x347b7a[_0x2f1e('0x32')]=_['map'](_0x4605fc,_0x2f1e('0x2b'));_0x347b7a[_0x2f1e('0x33')]=_[_0x2f1e('0x34')](_0x517429[_0x2f1e('0x33')]);_0x347b7a[_0x2f1e('0x35')]=_[_0x2f1e('0x36')](_0x347b7a[_0x2f1e('0x32')],_0x347b7a[_0x2f1e('0x33')]);_0x19f84d[_0x2f1e('0x37')]=_[_0x2f1e('0x36')](_0x347b7a[_0x2f1e('0x32')],qs['fields'](_0x517429[_0x2f1e('0x33')][_0x2f1e('0x38')]));_0x19f84d['attributes']=_0x19f84d[_0x2f1e('0x37')][_0x2f1e('0x39')]?_0x19f84d[_0x2f1e('0x37')]:_0x347b7a[_0x2f1e('0x32')];if(!_0x517429[_0x2f1e('0x33')][_0x2f1e('0x3a')](_0x2f1e('0x3b'))){_0x19f84d[_0x2f1e('0x1e')]=qs[_0x2f1e('0x1e')](_0x517429[_0x2f1e('0x33')]['limit']);_0x19f84d[_0x2f1e('0x1d')]=qs['offset'](_0x517429[_0x2f1e('0x33')][_0x2f1e('0x1d')]);}_0x19f84d[_0x2f1e('0x3c')]=qs[_0x2f1e('0x3d')](_0x517429[_0x2f1e('0x33')]['sort']);_0x19f84d[_0x2f1e('0x3e')]=qs['filters'](_[_0x2f1e('0x3f')](_0x517429[_0x2f1e('0x33')],_0x347b7a[_0x2f1e('0x35')]),_0x4605fc);if(_0x517429[_0x2f1e('0x33')][_0x2f1e('0x40')]){_0x19f84d[_0x2f1e('0x3e')]=_['merge'](_0x19f84d[_0x2f1e('0x3e')],{'$or':_[_0x2f1e('0x2d')](_0x4605fc,function(_0x1f66f8){if(_0x1f66f8[_0x2f1e('0x30')]!==_0x2f1e('0x41')){var _0x4fd8bc={};_0x4fd8bc[_0x1f66f8['name']]={'$like':'%'+_0x517429[_0x2f1e('0x33')][_0x2f1e('0x40')]+'%'};return _0x4fd8bc;}})});}_0x19f84d=_['merge']({},_0x19f84d,_0x517429[_0x2f1e('0x42')]);var _0x97d453={'where':_0x19f84d[_0x2f1e('0x3e')]};return db[_0x2f1e('0x2e')][_0x2f1e('0x1f')](_0x97d453)['then'](function(_0x4bc157){_0x388164['count']=_0x4bc157;if(_0x517429[_0x2f1e('0x33')][_0x2f1e('0x43')]){_0x19f84d[_0x2f1e('0x44')]=[{'all':!![]}];}return db[_0x2f1e('0x2e')][_0x2f1e('0x45')](_0x19f84d);})[_0x2f1e('0x26')](function(_0x48d083){_0x388164[_0x2f1e('0x46')]=_0x48d083;return _0x388164;})[_0x2f1e('0x26')](respondWithFilteredResult(_0x679f8a,_0x19f84d))[_0x2f1e('0x47')](handleError(_0x679f8a,null));};exports['show']=function(_0x438af9,_0x10fdc8){var _0x1de599={'raw':![],'where':{'id':_0x438af9[_0x2f1e('0x48')]['id']}},_0x10a924={};_0x10a924[_0x2f1e('0x32')]=_[_0x2f1e('0x34')](db[_0x2f1e('0x2e')][_0x2f1e('0x49')]);_0x10a924[_0x2f1e('0x33')]=_[_0x2f1e('0x34')](_0x438af9[_0x2f1e('0x33')]);_0x10a924['filters']=_['intersection'](_0x10a924[_0x2f1e('0x32')],_0x10a924['query']);_0x1de599[_0x2f1e('0x37')]=_[_0x2f1e('0x36')](_0x10a924[_0x2f1e('0x32')],qs[_0x2f1e('0x38')](_0x438af9[_0x2f1e('0x33')][_0x2f1e('0x38')]));_0x1de599[_0x2f1e('0x37')]=_0x1de599[_0x2f1e('0x37')][_0x2f1e('0x39')]?_0x1de599['attributes']:_0x10a924['model'];if(_0x438af9[_0x2f1e('0x33')][_0x2f1e('0x43')]){_0x1de599[_0x2f1e('0x44')]=[{'all':!![]}];}_0x1de599=_[_0x2f1e('0x4a')]({},_0x1de599,_0x438af9['options']);return db[_0x2f1e('0x2e')][_0x2f1e('0x4b')](_0x1de599)[_0x2f1e('0x26')](handleEntityNotFound(_0x10fdc8,null))[_0x2f1e('0x26')](respondWithResult(_0x10fdc8,null))[_0x2f1e('0x47')](handleError(_0x10fdc8,null));};exports[_0x2f1e('0x4c')]=function(_0x5178ac,_0x70b54e){return db[_0x2f1e('0x2e')][_0x2f1e('0x4c')](_0x5178ac[_0x2f1e('0x4d')],{})[_0x2f1e('0x26')](function(_0x2f106c){var _0x100756=_0x5178ac[_0x2f1e('0x4e')][_0x2f1e('0x27')]({'plain':!![]});if(!_0x100756)throw new Error(_0x2f1e('0x4f'));if(_0x100756[_0x2f1e('0x50')]===_0x2f1e('0x4e')){var _0x3f4e89=_0x2f106c['get']({'plain':!![]});var _0x104370=_0x2f1e('0x51');return db[_0x2f1e('0x52')][_0x2f1e('0x4b')]({'where':{'name':_0x104370,'userProfileId':_0x100756[_0x2f1e('0x53')]},'raw':!![]})['then'](function(_0x59ec6a){if(_0x59ec6a&&_0x59ec6a[_0x2f1e('0x54')]===0x0){return db[_0x2f1e('0x28')][_0x2f1e('0x4c')]({'name':_0x3f4e89['name'],'resourceId':_0x3f4e89['id'],'type':_0x59ec6a[_0x2f1e('0x2b')],'sectionId':_0x59ec6a['id']},{})['then'](function(){return _0x2f106c;});}else{return _0x2f106c;}})[_0x2f1e('0x47')](function(_0x1cbfc4){logger[_0x2f1e('0x55')](_0x2f1e('0x56'),_0x1cbfc4);throw _0x1cbfc4;});}return _0x2f106c;})[_0x2f1e('0x26')](respondWithResult(_0x70b54e,0xc9))['catch'](handleError(_0x70b54e,null));};exports[_0x2f1e('0x25')]=function(_0x19e299,_0x51f250){if(_0x19e299[_0x2f1e('0x4d')]['id']){delete _0x19e299[_0x2f1e('0x4d')]['id'];}return db[_0x2f1e('0x2e')][_0x2f1e('0x4b')]({'where':{'id':_0x19e299[_0x2f1e('0x48')]['id']}})[_0x2f1e('0x26')](handleEntityNotFound(_0x51f250,null))[_0x2f1e('0x26')](saveUpdates(_0x19e299['body'],null))[_0x2f1e('0x26')](respondWithResult(_0x51f250,null))[_0x2f1e('0x47')](handleError(_0x51f250,null));};exports[_0x2f1e('0x29')]=function(_0x2ce1e9,_0x344a43){return db[_0x2f1e('0x2e')][_0x2f1e('0x4b')]({'where':{'id':_0x2ce1e9[_0x2f1e('0x48')]['id']}})[_0x2f1e('0x26')](handleEntityNotFound(_0x344a43,null))[_0x2f1e('0x26')](removeEntity(_0x344a43,null))['catch'](handleError(_0x344a43,null));};exports[_0x2f1e('0x57')]=function(_0x3d6511,_0x476ba0){return db[_0x2f1e('0x2e')][_0x2f1e('0x57')]()[_0x2f1e('0x26')](respondWithResult(_0x476ba0,null))[_0x2f1e('0x47')](handleError(_0x476ba0,null));};exports['addDisposition']=function(_0x37776d,_0x35c359,_0x2a4af0){if(_0x37776d[_0x2f1e('0x4d')]['id']){delete _0x37776d[_0x2f1e('0x4d')]['id'];}return db[_0x2f1e('0x2e')][_0x2f1e('0x4b')]({'where':{'id':_0x37776d[_0x2f1e('0x48')]['id']}})[_0x2f1e('0x26')](handleEntityNotFound(_0x35c359,null))['then'](function(_0x3c5451){if(_0x3c5451){_0x37776d[_0x2f1e('0x4d')]['ListId']=_0x3c5451['id'];return db['Disposition'][_0x2f1e('0x4c')](_0x37776d[_0x2f1e('0x4d')]);}})['then'](respondWithResult(_0x35c359,null))[_0x2f1e('0x47')](handleError(_0x35c359,null));};exports[_0x2f1e('0x58')]=function(_0x680f9c,_0x5eb7b8,_0x21ed40){var _0x2ac070={'raw':![],'where':{}};var _0x5abf54={};var _0x49abad={'count':0x0,'rows':[]};return db[_0x2f1e('0x2e')]['findOne']({'where':{'id':_0x680f9c[_0x2f1e('0x48')]['id']}})[_0x2f1e('0x26')](handleEntityNotFound(_0x5eb7b8,null))[_0x2f1e('0x26')](function(_0x40e0ff){if(_0x40e0ff){_0x5abf54[_0x2f1e('0x32')]=_[_0x2f1e('0x34')](db[_0x2f1e('0x59')][_0x2f1e('0x49')]);_0x5abf54[_0x2f1e('0x33')]=_[_0x2f1e('0x34')](_0x680f9c[_0x2f1e('0x33')]);_0x5abf54[_0x2f1e('0x35')]=_[_0x2f1e('0x36')](_0x5abf54[_0x2f1e('0x32')],_0x5abf54[_0x2f1e('0x33')]);_0x2ac070[_0x2f1e('0x37')]=_[_0x2f1e('0x36')](_0x5abf54[_0x2f1e('0x32')],qs[_0x2f1e('0x38')](_0x680f9c[_0x2f1e('0x33')][_0x2f1e('0x38')]));_0x2ac070[_0x2f1e('0x37')]=_0x2ac070[_0x2f1e('0x37')][_0x2f1e('0x39')]?_0x2ac070[_0x2f1e('0x37')]:_0x5abf54[_0x2f1e('0x32')];if(!_0x680f9c[_0x2f1e('0x33')][_0x2f1e('0x3a')](_0x2f1e('0x3b'))){_0x2ac070[_0x2f1e('0x1e')]=qs['limit'](_0x680f9c[_0x2f1e('0x33')][_0x2f1e('0x1e')]);_0x2ac070[_0x2f1e('0x1d')]=qs['offset'](_0x680f9c['query'][_0x2f1e('0x1d')]);}_0x2ac070['order']=qs[_0x2f1e('0x3d')](_0x680f9c[_0x2f1e('0x33')][_0x2f1e('0x3d')]);_0x2ac070[_0x2f1e('0x3e')]=qs['filters'](_[_0x2f1e('0x3f')](_0x680f9c[_0x2f1e('0x33')],_0x5abf54[_0x2f1e('0x35')]));_0x2ac070[_0x2f1e('0x3e')][_0x2f1e('0x5a')]=_0x40e0ff['id'];if(_0x680f9c['query'][_0x2f1e('0x40')]){_0x2ac070[_0x2f1e('0x3e')]=_[_0x2f1e('0x4a')](_0x2ac070[_0x2f1e('0x3e')],{'$or':_[_0x2f1e('0x2d')](_0x2ac070[_0x2f1e('0x37')],function(_0x36c008){var _0x59ec78={};_0x59ec78[_0x36c008]={'$like':'%'+_0x680f9c[_0x2f1e('0x33')][_0x2f1e('0x40')]+'%'};return _0x59ec78;})});}_0x2ac070=_['merge']({},_0x2ac070,_0x680f9c[_0x2f1e('0x42')]);return db[_0x2f1e('0x59')][_0x2f1e('0x1f')]({'where':_0x2ac070[_0x2f1e('0x3e')]})[_0x2f1e('0x26')](function(_0x3e9315){_0x49abad[_0x2f1e('0x1f')]=_0x3e9315;if(_0x680f9c[_0x2f1e('0x33')]['includeAll']){_0x2ac070[_0x2f1e('0x44')]=[{'all':!![]}];}return db[_0x2f1e('0x59')][_0x2f1e('0x45')](_0x2ac070);})[_0x2f1e('0x26')](function(_0x69b0dc){_0x49abad[_0x2f1e('0x46')]=_0x69b0dc;return _0x49abad;});}})[_0x2f1e('0x26')](respondWithFilteredResult(_0x5eb7b8,_0x2ac070))[_0x2f1e('0x47')](handleError(_0x5eb7b8,null));};exports['removeDispositions']=function(_0x124c9c,_0x1970a1,_0xa40348){return db['CmList']['find']({'where':{'id':_0x124c9c[_0x2f1e('0x48')]['id']}})[_0x2f1e('0x26')](handleEntityNotFound(_0x1970a1,null))['then'](function(_0x5a4876){if(_0x5a4876){return _0x5a4876['removeDispositions'](_0x124c9c[_0x2f1e('0x33')][_0x2f1e('0x5b')]);}})[_0x2f1e('0x26')](respondWithStatusCode(_0x1970a1,null))['catch'](handleError(_0x1970a1,null));};exports[_0x2f1e('0x5c')]=function(_0x2c1cc4,_0x328c25,_0x424c36){return db[_0x2f1e('0x2e')][_0x2f1e('0x4b')]({'where':{'id':_0x2c1cc4[_0x2f1e('0x48')]['id']}})[_0x2f1e('0x26')](handleEntityNotFound(_0x328c25,null))[_0x2f1e('0x26')](function(_0x31d49c){if(_0x31d49c){var _0x7fdc22=[];var _0x35bff5={'success':[],'errors':[]};return db[_0x2f1e('0x5d')][_0x2f1e('0x57')]()[_0x2f1e('0x26')](function(_0x3314b1){if(_0x2c1cc4[_0x2f1e('0x4d')]['tags']&&_[_0x2f1e('0x5e')](_0x2c1cc4['body'][_0x2f1e('0x5f')])){if(_0x2c1cc4['body'][_0x2f1e('0x5f')][_0x2f1e('0x39')]){_0x2c1cc4[_0x2f1e('0x4d')][_0x2f1e('0x5f')]=_0x2c1cc4['body'][_0x2f1e('0x5f')][_0x2f1e('0x60')](';')+';';}else{_0x2c1cc4[_0x2f1e('0x4d')][_0x2f1e('0x5f')]=null;}}else{_0x2c1cc4[_0x2f1e('0x4d')][_0x2f1e('0x5f')]=null;}if(_0x2c1cc4[_0x2f1e('0x4d')]&&_[_0x2f1e('0x5e')](_0x2c1cc4['body'])){for(var _0x1af6b0=0x0;_0x1af6b0<_0x2c1cc4[_0x2f1e('0x4d')][_0x2f1e('0x39')];_0x1af6b0+=0x1){_0x2c1cc4['body'][_0x1af6b0][_0x2f1e('0x5a')]=_0x2c1cc4[_0x2f1e('0x48')]['id'];_0x7fdc22['push'](_0x2c1cc4[_0x2f1e('0x4d')][_0x1af6b0]);}return BPromise['each'](_0x7fdc22,function(_0x223c5c){return db[_0x2f1e('0x5d')]['create'](_[_0x2f1e('0x61')](_0x223c5c,[_0x2f1e('0x5b'),'id'])||{},{'fields':_[_0x2f1e('0x34')](_0x3314b1),'raw':!![]})['then'](function(_0x3573a9){_0x35bff5[_0x2f1e('0x62')][_0x2f1e('0x63')](_0x3573a9[_0x2f1e('0x64')]);})['catch'](function(_0x22b22f){_0x35bff5['errors']['push']({'data':_0x223c5c,'error':_0x22b22f[_0x2f1e('0x65')]});});})['then'](function(_0x2ceb1d){return _0x35bff5;})[_0x2f1e('0x47')](function(_0xcc3cab){return _0xcc3cab;});}else{_0x328c25[_0x2f1e('0x1a')](0x190)[_0x2f1e('0x1c')]({'message':_0x2f1e('0x66')});}});}})[_0x2f1e('0x26')](respondWithResult(_0x328c25,null))[_0x2f1e('0x47')](handleError(_0x328c25,null));};exports[_0x2f1e('0x67')]=function(_0xcc4c1d,_0x1f8007,_0x34de38){var _0x2186cf;return db[_0x2f1e('0x2e')]['find']({'where':{'id':_0xcc4c1d[_0x2f1e('0x48')]['id']},'include':[{'model':db[_0x2f1e('0x68')],'as':_0x2f1e('0x69')}]})['then'](handleEntityNotFound(_0x1f8007,null))[_0x2f1e('0x26')](function(_0x47ceed){if(_0x47ceed){_0x2186cf=_0x47ceed;return db['CmContact'][_0x2f1e('0x49')];}})[_0x2f1e('0x26')](function(_0x26fc7d){if(_0x26fc7d){var _0x1b2e77={};var _0x12c061={};_0x12c061[_0x2f1e('0x32')]=_[_0x2f1e('0x6a')](_[_0x2f1e('0x34')](_0x26fc7d),_[_0x2f1e('0x2d')](_0x2186cf[_0x2f1e('0x69')],function(_0x15892b){return util['format'](_0x2f1e('0x6b'),_0x15892b['id']);}));_0x12c061[_0x2f1e('0x33')]=_[_0x2f1e('0x34')](_0xcc4c1d[_0x2f1e('0x33')]);_0x12c061['filters']=_['intersection'](_0x12c061[_0x2f1e('0x32')],_0x12c061[_0x2f1e('0x33')]);_0x1b2e77['attributes']=_[_0x2f1e('0x36')](_0x12c061[_0x2f1e('0x32')],qs['fields'](_0xcc4c1d[_0x2f1e('0x33')][_0x2f1e('0x38')]));_0x1b2e77['attributes']=_0x1b2e77['attributes'][_0x2f1e('0x39')]?_0x1b2e77[_0x2f1e('0x37')]:_0x12c061[_0x2f1e('0x32')];if(!_0xcc4c1d[_0x2f1e('0x33')][_0x2f1e('0x3a')](_0x2f1e('0x3b'))){_0x1b2e77[_0x2f1e('0x1e')]=qs[_0x2f1e('0x1e')](_0xcc4c1d[_0x2f1e('0x33')][_0x2f1e('0x1e')]);_0x1b2e77[_0x2f1e('0x1d')]=qs[_0x2f1e('0x1d')](_0xcc4c1d['query']['offset']);}_0x1b2e77[_0x2f1e('0x3c')]=qs[_0x2f1e('0x3d')](_0xcc4c1d['query'][_0x2f1e('0x3d')]);_0x1b2e77[_0x2f1e('0x3e')]=qs[_0x2f1e('0x35')](_[_0x2f1e('0x3f')](_0xcc4c1d[_0x2f1e('0x33')],_0x12c061['filters']));_0x1b2e77[_0x2f1e('0x6c')]=!![];if(_0xcc4c1d['query'][_0x2f1e('0x40')]){_0x1b2e77['where']=_[_0x2f1e('0x4a')](_0x1b2e77[_0x2f1e('0x3e')],{'$or':_[_0x2f1e('0x2d')](_0x1b2e77[_0x2f1e('0x37')],function(_0x244b17){var _0x4448fb={};_0x4448fb[_0x244b17]={'$like':'%'+_0xcc4c1d[_0x2f1e('0x33')][_0x2f1e('0x40')]+'%'};return _0x4448fb;})});}_0x1b2e77=_[_0x2f1e('0x4a')]({},_0x1b2e77,_0xcc4c1d['options']);return _0x2186cf[_0x2f1e('0x67')](_0x1b2e77);}})[_0x2f1e('0x26')](respondWithResult(_0x1f8007,null))[_0x2f1e('0x47')](handleError(_0x1f8007,null));};exports[_0x2f1e('0x6d')]=function(_0x525fb5,_0x29397c,_0x58ba4b){var _0x2c4f6d;var _0x34afc5;var _0x7d8f60;var _0x147aa2=_0x525fb5[_0x2f1e('0x48')]['id'];csv_results=[];return db['ContactItemType'][_0x2f1e('0x45')]({'attributes':['id',_0x2f1e('0x2b')],'raw':!![],'order':[_0x2f1e('0x6e')]})[_0x2f1e('0x26')](function(_0x17c489){_0x2c4f6d=_0x17c489;var _0x56f2f9=_[_0x2f1e('0x34')](db[_0x2f1e('0x5d')][_0x2f1e('0x49')]);return db[_0x2f1e('0x68')][_0x2f1e('0x45')]({'raw':!![],'attributes':['id',_0x2f1e('0x6f')]})[_0x2f1e('0x26')](function(_0x288c62){_0x34afc5=_0x288c62;var _0x2a0518=squel[_0x2f1e('0x70')]()[_0x2f1e('0x38')](_0x56f2f9)[_0x2f1e('0x71')](_0x2f1e('0x72'),'c')[_0x2f1e('0x3e')]('c.ListId\x20=\x20?',_0x147aa2)['where'](_0x2f1e('0x73'))['distinct']();for(var _0x3563af=0x0;_0x3563af<_0x34afc5[_0x2f1e('0x39')];_0x3563af++){_0x2a0518[_0x2f1e('0x74')](_0x2f1e('0x75')+_0x34afc5[_0x3563af]['id'],_0x2f1e('0x76')+_0x34afc5[_0x3563af][_0x2f1e('0x6f')]);}for(var _0x3563af=0x0;_0x3563af<_0x2c4f6d[_0x2f1e('0x39')];_0x3563af++){_0x2a0518[_0x2f1e('0x74')](squel['select']()[_0x2f1e('0x74')]('item')[_0x2f1e('0x71')](_0x2f1e('0x77'))[_0x2f1e('0x3e')](_0x2f1e('0x78'),_0x2c4f6d[_0x3563af]['id'])['where'](_0x2f1e('0x79')),_0x2f1e('0x7a')+_0x2c4f6d[_0x3563af]['name']);_0x2a0518[_0x2f1e('0x74')](squel[_0x2f1e('0x70')]()[_0x2f1e('0x74')]('description')[_0x2f1e('0x71')](_0x2f1e('0x77'))['where'](_0x2f1e('0x78'),_0x2c4f6d[_0x3563af]['id'])['where'](_0x2f1e('0x79')),'description_additionalPhone_'+_0x2c4f6d[_0x3563af]['name']);}var _0x509ed9=[];_0x509ed9[_0x2f1e('0x63')](_0x2a0518[_0x2f1e('0x7b')]());BPromise['each'](_0x509ed9,handleQuery)[_0x2f1e('0x26')](function(_0x119c77){handleQuery(_0x2a0518['toString']());var _0x1da12d=csv_results[0x0];if(!_[_0x2f1e('0x7c')](_0x1da12d)){var _0x131fa4=toCsv(_0x1da12d);var _0x2b1774=Date[_0x2f1e('0x7d')]();fs[_0x2f1e('0x7e')](util[_0x2f1e('0x7f')](_0x2f1e('0x80'),_0x147aa2,_0x2b1774),_0x131fa4);_0x29397c['setHeader'](_0x2f1e('0x81'),'attachment;\x20filename='+util[_0x2f1e('0x7f')](_0x2f1e('0x82'),_0x147aa2,_0x2b1774));_0x29397c['setHeader'](_0x2f1e('0x83'),_0x2f1e('0x84'));return _0x29397c[_0x2f1e('0x85')](util[_0x2f1e('0x7f')](_0x2f1e('0x80'),_0x147aa2,_0x2b1774));}else{return _0x29397c[_0x2f1e('0x19')](0xcc);}});});});};exports['addCustomField']=function(_0x3cb4d2,_0x129a38,_0x151c04){var _0x56d1c1;delete _0x3cb4d2[_0x2f1e('0x4d')]['id'];return db['CmList'][_0x2f1e('0x86')]({'where':{'id':_0x3cb4d2[_0x2f1e('0x48')]['id']}})[_0x2f1e('0x26')](handleEntityNotFound(_0x129a38,null))[_0x2f1e('0x26')](function(_0x5e1203){if(_0x5e1203){return db[_0x2f1e('0x87')][_0x2f1e('0x88')](function(_0x55251b){return db['CmCustomField'][_0x2f1e('0x4c')](_0x3cb4d2[_0x2f1e('0x4d')],{'transaction':_0x55251b})['then'](function(_0x13031a){_0x56d1c1=_0x13031a;return _0x5e1203[_0x2f1e('0x89')](_0x13031a,{'transaction':_0x55251b});})[_0x2f1e('0x26')](function(){var _0xb083c5={'type':db[_0x2f1e('0x8a')][_0x2f1e('0x8b')],'transaction':_0x55251b};switch(_0x3cb4d2['body']['type']){case _0x2f1e('0x8c'):_0xb083c5[_0x2f1e('0x30')]=db[_0x2f1e('0x8a')]['TEXT'];break;case'number':_0xb083c5[_0x2f1e('0x30')]=db[_0x2f1e('0x8a')][_0x2f1e('0x8d')];break;case _0x2f1e('0x8e'):_0xb083c5['type']=db[_0x2f1e('0x8a')][_0x2f1e('0x8f')];_0xb083c5[_0x2f1e('0x90')]=![];break;default:}return db[_0x2f1e('0x87')]['queryInterface'][_0x2f1e('0x91')](_0x2f1e('0x72'),util['format'](_0x2f1e('0x92'),_0x56d1c1['id']),_0xb083c5);})[_0x2f1e('0x26')](function(){return _0x56d1c1;});});}})[_0x2f1e('0x26')](respondWithResult(_0x129a38,null))[_0x2f1e('0x47')](handleError(_0x129a38,null));};exports['getCustomFields']=function(_0x4e6c61,_0x325308,_0x2cdee3){var _0x469929={};var _0x14ea1d={};var _0x5bfe52;var _0x1aeb60;return db['CmList'][_0x2f1e('0x86')]({'where':{'id':_0x4e6c61['params']['id']}})[_0x2f1e('0x26')](handleEntityNotFound(_0x325308,null))[_0x2f1e('0x26')](function(_0x14f8c3){if(_0x14f8c3){_0x5bfe52=_0x14f8c3;_0x14ea1d[_0x2f1e('0x32')]=_[_0x2f1e('0x34')](db[_0x2f1e('0x68')][_0x2f1e('0x49')]);_0x14ea1d[_0x2f1e('0x33')]=_[_0x2f1e('0x34')](_0x4e6c61[_0x2f1e('0x33')]);_0x14ea1d[_0x2f1e('0x35')]=_[_0x2f1e('0x36')](_0x14ea1d[_0x2f1e('0x32')],_0x14ea1d[_0x2f1e('0x33')]);_0x469929[_0x2f1e('0x37')]=_['intersection'](_0x14ea1d['model'],qs['fields'](_0x4e6c61['query'][_0x2f1e('0x38')]));_0x469929[_0x2f1e('0x37')]=_0x469929[_0x2f1e('0x37')][_0x2f1e('0x39')]?_0x469929[_0x2f1e('0x37')]:_0x14ea1d['model'];_0x469929['order']=qs[_0x2f1e('0x3d')](_0x4e6c61['query'][_0x2f1e('0x3d')]);_0x469929[_0x2f1e('0x3e')]=qs[_0x2f1e('0x35')](_[_0x2f1e('0x3f')](_0x4e6c61[_0x2f1e('0x33')],_0x14ea1d[_0x2f1e('0x35')]));_0x469929['where']=_['merge'](_0x469929[_0x2f1e('0x3e')],{'$or':[{'ListId':_0x14f8c3['id']},{'ListId':null}]});if(_0x4e6c61[_0x2f1e('0x33')][_0x2f1e('0x40')]){_0x469929[_0x2f1e('0x3e')]=_[_0x2f1e('0x4a')](_0x469929[_0x2f1e('0x3e')],{'$or':_[_0x2f1e('0x2d')](_0x469929[_0x2f1e('0x37')],function(_0x5e3b36){var _0x5eefe0={};_0x5eefe0[_0x5e3b36]={'$like':'%'+_0x4e6c61['query'][_0x2f1e('0x40')]+'%'};return _0x5eefe0;})});}_0x469929=_[_0x2f1e('0x4a')]({},_0x469929,_0x4e6c61[_0x2f1e('0x42')]);return db['CmCustomField'][_0x2f1e('0x93')](_0x469929);}})[_0x2f1e('0x26')](respondWithResult(_0x325308,null))[_0x2f1e('0x47')](handleError(_0x325308,null));};exports[_0x2f1e('0x94')]=function(_0x2c70c5,_0xc05663){return db[_0x2f1e('0x68')][_0x2f1e('0x93')]({'where':{'ListId':null}})[_0x2f1e('0x26')](handleEntityNotFound(_0xc05663,null))[_0x2f1e('0x26')](function(_0x42b528){return _0x42b528;})['then'](respondWithResult(_0xc05663,null))['catch'](handleError(_0xc05663,null));};exports['addAgents']=function(_0x2d58f7,_0x5435a8,_0x13570f){return db[_0x2f1e('0x2e')][_0x2f1e('0x4b')]({'where':{'id':_0x2d58f7[_0x2f1e('0x48')]['id']}})[_0x2f1e('0x26')](handleEntityNotFound(_0x5435a8,null))[_0x2f1e('0x26')](function(_0x2b7433){if(_0x2b7433){return _0x2b7433['addAgents'](_0x2d58f7[_0x2f1e('0x4d')][_0x2f1e('0x5b')],_[_0x2f1e('0x61')](_0x2d58f7[_0x2f1e('0x4d')],[_0x2f1e('0x5b'),'id'])||{})[_0x2f1e('0x95')](function(_0x179b8e){for(var _0x4bc892=0x0;_0x4bc892<_0x2d58f7['body'][_0x2f1e('0x5b')][_0x2f1e('0x39')];_0x4bc892+=0x1){socket[_0x2f1e('0x96')](_0x2f1e('0x97'),{'UserId':Number(_0x2d58f7[_0x2f1e('0x4d')][_0x2f1e('0x5b')][_0x4bc892]),'CmListId':Number(_0x2d58f7[_0x2f1e('0x48')]['id'])});}return _0x179b8e;});}})[_0x2f1e('0x26')](respondWithResult(_0x5435a8,null))[_0x2f1e('0x47')](handleError(_0x5435a8,null));};exports[_0x2f1e('0x98')]=function(_0x156cd2,_0x46b412,_0x21f968){return db['CmList'][_0x2f1e('0x4b')]({'where':{'id':_0x156cd2[_0x2f1e('0x48')]['id']}})['then'](handleEntityNotFound(_0x46b412,null))[_0x2f1e('0x26')](function(_0x42fbbd){if(_0x42fbbd){return _0x42fbbd['removeAgents'](_0x156cd2['query'][_0x2f1e('0x5b')])['then'](function(){if(_[_0x2f1e('0x5e')](_0x156cd2[_0x2f1e('0x33')]['ids'])){for(var _0x27176d=0x0;_0x27176d<_0x156cd2[_0x2f1e('0x33')][_0x2f1e('0x5b')][_0x2f1e('0x39')];_0x27176d+=0x1){socket[_0x2f1e('0x96')](_0x2f1e('0x99'),{'UserId':Number(_0x156cd2['query'][_0x2f1e('0x5b')][_0x27176d]),'CmListId':Number(_0x156cd2[_0x2f1e('0x48')]['id'])});}}else{socket[_0x2f1e('0x96')](_0x2f1e('0x99'),{'UserId':Number(_0x156cd2['query'][_0x2f1e('0x5b')]),'CmListId':Number(_0x156cd2[_0x2f1e('0x48')]['id'])});}});}})[_0x2f1e('0x26')](respondWithStatusCode(_0x46b412,null))[_0x2f1e('0x47')](handleError(_0x46b412,null));};exports[_0x2f1e('0x9a')]=function(_0x3212c5,_0xce851f,_0x1e1952){var _0x286cb0={};var _0x24c119={};var _0x59fe21;var _0x4afeb3;return db[_0x2f1e('0x2e')]['findOne']({'where':{'id':_0x3212c5['params']['id']}})[_0x2f1e('0x26')](handleEntityNotFound(_0xce851f,null))[_0x2f1e('0x26')](function(_0x143e8a){if(_0x143e8a){_0x59fe21=_0x143e8a;_0x24c119[_0x2f1e('0x32')]=_[_0x2f1e('0x34')](db[_0x2f1e('0x9b')][_0x2f1e('0x49')]);_0x24c119[_0x2f1e('0x33')]=_[_0x2f1e('0x34')](_0x3212c5[_0x2f1e('0x33')]);_0x24c119[_0x2f1e('0x35')]=_[_0x2f1e('0x36')](_0x24c119[_0x2f1e('0x32')],_0x24c119[_0x2f1e('0x33')]);_0x286cb0['attributes']=_[_0x2f1e('0x36')](_0x24c119['model'],qs[_0x2f1e('0x38')](_0x3212c5[_0x2f1e('0x33')]['fields']));_0x286cb0[_0x2f1e('0x37')]=_0x286cb0[_0x2f1e('0x37')][_0x2f1e('0x39')]?_0x286cb0[_0x2f1e('0x37')]:_0x24c119[_0x2f1e('0x32')];_0x286cb0[_0x2f1e('0x3c')]=qs['sort'](_0x3212c5['query'][_0x2f1e('0x3d')]);_0x286cb0[_0x2f1e('0x3e')]=qs['filters'](_[_0x2f1e('0x3f')](_0x3212c5[_0x2f1e('0x33')],_0x24c119[_0x2f1e('0x35')]));if(_0x3212c5[_0x2f1e('0x33')][_0x2f1e('0x40')]){_0x286cb0[_0x2f1e('0x3e')]=_[_0x2f1e('0x4a')](_0x286cb0[_0x2f1e('0x3e')],{'$or':_['map'](_0x286cb0[_0x2f1e('0x37')],function(_0x5c4fd8){var _0x3a3194={};_0x3a3194[_0x5c4fd8]={'$like':'%'+_0x3212c5[_0x2f1e('0x33')][_0x2f1e('0x40')]+'%'};return _0x3a3194;})});}_0x286cb0=_['merge']({},_0x286cb0,_0x3212c5[_0x2f1e('0x42')]);return _0x59fe21[_0x2f1e('0x9a')](_0x286cb0);}})[_0x2f1e('0x26')](function(_0x342dfd){if(_0x342dfd){_0x4afeb3=_0x342dfd[_0x2f1e('0x39')];if(!_0x3212c5[_0x2f1e('0x33')][_0x2f1e('0x3a')](_0x2f1e('0x3b'))){_0x286cb0[_0x2f1e('0x1e')]=qs[_0x2f1e('0x1e')](_0x3212c5[_0x2f1e('0x33')][_0x2f1e('0x1e')]);_0x286cb0['offset']=qs[_0x2f1e('0x1d')](_0x3212c5[_0x2f1e('0x33')][_0x2f1e('0x1d')]);}return _0x59fe21['getAgents'](_0x286cb0);}})['then'](function(_0x33005c){if(_0x33005c){return _0x33005c?{'count':_0x4afeb3,'rows':_0x33005c}:null;}})[_0x2f1e('0x26')](respondWithResult(_0xce851f,null))['catch'](handleError(_0xce851f,null));};function handleQuery(_0x2cefa6){logger[_0x2f1e('0x9c')](_0x2cefa6);return db[_0x2f1e('0x87')][_0x2f1e('0x33')](_0x2cefa6)[_0x2f1e('0x95')](function(_0x3776c8){csv_results['push'](_0x3776c8);})['catch'](function(_0x3efa95){logger[_0x2f1e('0x55')](_0x3efa95['message']);});} \ No newline at end of file +var _0xf459=['Lists','UserProfileResource','stack','name','send','map','CmList','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','includeAll','options','find','create','body','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','getDispositions','findOne','Disposition','order','ListId','removeDispositions','ids','isArray','tags','join','push','each','CmContact','omit','success','dataValues','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','ContactItemType','OrderBy','alias','select','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','customField_','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','from','ItemTypeId\x20=\x20?','description_additionalPhone_','toString','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','Content-type','text/csv','addCustomField','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','message','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','end','json','offset','count','limit','set','apply','reject','save','update','destroy','then','get'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xf459,0x73));var _0x9f45=function(_0x1abeb2,_0x79f462){_0x1abeb2=_0x1abeb2-0x0;var _0x48da20=_0xf459[_0x1abeb2];return _0x48da20;};'use strict';var emlformat=require(_0x9f45('0x0'));var rimraf=require(_0x9f45('0x1'));var zipdir=require(_0x9f45('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f45('0x3'));var moment=require(_0x9f45('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9f45('0x5'));var util=require(_0x9f45('0x6'));var path=require(_0x9f45('0x7'));var sox=require(_0x9f45('0x8'));var csv=require(_0x9f45('0x9'));var ejs=require(_0x9f45('0xa'));var fs=require('fs');var fs_extra=require(_0x9f45('0xb'));var _=require(_0x9f45('0xc'));var squel=require(_0x9f45('0xd'));var crypto=require(_0x9f45('0xe'));var jsforce=require(_0x9f45('0xf'));var deskjs=require(_0x9f45('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9f45('0x11'));var Papa=require(_0x9f45('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9f45('0x13'));var hardwareService=require(_0x9f45('0x14'));var logger=require('../../config/logger')(_0x9f45('0x15'));var utils=require(_0x9f45('0x16'));var config=require(_0x9f45('0x17'));var licenseUtil=require(_0x9f45('0x18'));var db=require(_0x9f45('0x19'))['db'];var csv_results;config[_0x9f45('0x1a')]=_[_0x9f45('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f45('0x1a')]));require('./cmList.socket')[_0x9f45('0x1c')](socket);function respondWithStatusCode(_0x382701,_0x368893){_0x368893=_0x368893||0xcc;return function(_0x15df9a){if(_0x15df9a){return _0x382701[_0x9f45('0x1d')](_0x368893);}return _0x382701[_0x9f45('0x1e')](_0x368893)[_0x9f45('0x1f')]();};}function respondWithResult(_0x4f7f7c,_0x11a626){_0x11a626=_0x11a626||0xc8;return function(_0x1a1632){if(_0x1a1632){return _0x4f7f7c[_0x9f45('0x1e')](_0x11a626)[_0x9f45('0x20')](_0x1a1632);}};}function respondWithFilteredResult(_0x8a7d15,_0x242d4a){return function(_0x4b9077){if(_0x4b9077){var _0x55380f=typeof _0x242d4a[_0x9f45('0x21')]==='undefined'&&typeof _0x242d4a['limit']==='undefined';var _0x44f7a6=_0x4b9077[_0x9f45('0x22')];var _0x191ee8=_0x55380f?0x0:_0x242d4a['offset'];var _0xf0e5ba=_0x55380f?_0x4b9077[_0x9f45('0x22')]:_0x242d4a[_0x9f45('0x21')]+_0x242d4a[_0x9f45('0x23')];var _0x1c9fff;if(_0xf0e5ba>=_0x44f7a6){_0xf0e5ba=_0x44f7a6;_0x1c9fff=0xc8;}else{_0x1c9fff=0xce;}_0x8a7d15['status'](_0x1c9fff);return _0x8a7d15[_0x9f45('0x24')]('Content-Range',_0x191ee8+'-'+_0xf0e5ba+'/'+_0x44f7a6)[_0x9f45('0x20')](_0x4b9077);}return null;};}function patchUpdates(_0xaf3cc8){return function(_0x49a435){try{jsonpatch[_0x9f45('0x25')](_0x49a435,_0xaf3cc8,!![]);}catch(_0x3d4b89){return BPromise[_0x9f45('0x26')](_0x3d4b89);}return _0x49a435[_0x9f45('0x27')]();};}function saveUpdates(_0x2df2dd,_0x3d69d1){return function(_0x2ab3d9){if(_0x2ab3d9){return _0x2ab3d9[_0x9f45('0x28')](_0x2df2dd)['then'](function(_0x34edfe){return _0x34edfe;});}return null;};}function removeEntity(_0x4fd9e4,_0x4ed18c){return function(_0x550133){if(_0x550133){return _0x550133[_0x9f45('0x29')]()[_0x9f45('0x2a')](function(){var _0x6eacee=_0x550133[_0x9f45('0x2b')]({'plain':!![]});var _0x226b93=_0x9f45('0x2c');return db[_0x9f45('0x2d')]['destroy']({'where':{'type':_0x226b93,'resourceId':_0x6eacee['id']}})[_0x9f45('0x2a')](function(){return _0x550133;});})['then'](function(){_0x4fd9e4[_0x9f45('0x1e')](0xcc)[_0x9f45('0x1f')]();});}};}function handleEntityNotFound(_0x58a7e3,_0x21d35a){return function(_0x52f033){if(!_0x52f033){_0x58a7e3[_0x9f45('0x1d')](0x194);}return _0x52f033;};}function handleError(_0x574f0d,_0x18754d){_0x18754d=_0x18754d||0x1f4;return function(_0x2a62e9){logger['error'](_0x2a62e9[_0x9f45('0x2e')]);if(_0x2a62e9['name']){delete _0x2a62e9[_0x9f45('0x2f')];}_0x574f0d[_0x9f45('0x1e')](_0x18754d)[_0x9f45('0x30')](_0x2a62e9);};}exports['index']=function(_0x541f72,_0x31a953){var _0x32ea28={},_0x1319b4={},_0x54a0f3={'count':0x0,'rows':[]};var _0x4874e0=_[_0x9f45('0x31')](db[_0x9f45('0x32')][_0x9f45('0x33')],function(_0x4d6ba3){return{'name':_0x4d6ba3[_0x9f45('0x34')],'type':_0x4d6ba3[_0x9f45('0x35')][_0x9f45('0x36')]};});_0x1319b4['model']=_[_0x9f45('0x31')](_0x4874e0,_0x9f45('0x2f'));_0x1319b4[_0x9f45('0x37')]=_[_0x9f45('0x38')](_0x541f72['query']);_0x1319b4[_0x9f45('0x39')]=_[_0x9f45('0x3a')](_0x1319b4[_0x9f45('0x3b')],_0x1319b4[_0x9f45('0x37')]);_0x32ea28[_0x9f45('0x3c')]=_[_0x9f45('0x3a')](_0x1319b4[_0x9f45('0x3b')],qs[_0x9f45('0x3d')](_0x541f72[_0x9f45('0x37')][_0x9f45('0x3d')]));_0x32ea28[_0x9f45('0x3c')]=_0x32ea28['attributes'][_0x9f45('0x3e')]?_0x32ea28[_0x9f45('0x3c')]:_0x1319b4[_0x9f45('0x3b')];if(!_0x541f72[_0x9f45('0x37')][_0x9f45('0x3f')](_0x9f45('0x40'))){_0x32ea28[_0x9f45('0x23')]=qs['limit'](_0x541f72[_0x9f45('0x37')]['limit']);_0x32ea28['offset']=qs[_0x9f45('0x21')](_0x541f72['query']['offset']);}_0x32ea28['order']=qs[_0x9f45('0x41')](_0x541f72['query']['sort']);_0x32ea28['where']=qs[_0x9f45('0x39')](_[_0x9f45('0x42')](_0x541f72['query'],_0x1319b4[_0x9f45('0x39')]),_0x4874e0);if(_0x541f72[_0x9f45('0x37')][_0x9f45('0x43')]){_0x32ea28[_0x9f45('0x44')]=_[_0x9f45('0x45')](_0x32ea28[_0x9f45('0x44')],{'$or':_[_0x9f45('0x31')](_0x4874e0,function(_0x50a863){if(_0x50a863[_0x9f45('0x35')]!==_0x9f45('0x46')){var _0xdf6703={};_0xdf6703[_0x50a863[_0x9f45('0x2f')]]={'$like':'%'+_0x541f72[_0x9f45('0x37')]['filter']+'%'};return _0xdf6703;}})});}_0x32ea28=_[_0x9f45('0x45')]({},_0x32ea28,_0x541f72['options']);var _0x55cb31={'where':_0x32ea28[_0x9f45('0x44')]};return db['CmList'][_0x9f45('0x22')](_0x55cb31)[_0x9f45('0x2a')](function(_0x4fca5e){_0x54a0f3[_0x9f45('0x22')]=_0x4fca5e;if(_0x541f72[_0x9f45('0x37')]['includeAll']){_0x32ea28[_0x9f45('0x47')]=[{'all':!![]}];}return db['CmList'][_0x9f45('0x48')](_0x32ea28);})[_0x9f45('0x2a')](function(_0x4766e9){_0x54a0f3[_0x9f45('0x49')]=_0x4766e9;return _0x54a0f3;})[_0x9f45('0x2a')](respondWithFilteredResult(_0x31a953,_0x32ea28))[_0x9f45('0x4a')](handleError(_0x31a953,null));};exports[_0x9f45('0x4b')]=function(_0x4a3e6a,_0x52ddd6){var _0x37af15={'raw':![],'where':{'id':_0x4a3e6a['params']['id']}},_0x3ebd7b={};_0x3ebd7b[_0x9f45('0x3b')]=_[_0x9f45('0x38')](db['CmList'][_0x9f45('0x33')]);_0x3ebd7b['query']=_[_0x9f45('0x38')](_0x4a3e6a[_0x9f45('0x37')]);_0x3ebd7b[_0x9f45('0x39')]=_['intersection'](_0x3ebd7b[_0x9f45('0x3b')],_0x3ebd7b['query']);_0x37af15['attributes']=_['intersection'](_0x3ebd7b[_0x9f45('0x3b')],qs[_0x9f45('0x3d')](_0x4a3e6a[_0x9f45('0x37')]['fields']));_0x37af15['attributes']=_0x37af15['attributes'][_0x9f45('0x3e')]?_0x37af15['attributes']:_0x3ebd7b[_0x9f45('0x3b')];if(_0x4a3e6a['query'][_0x9f45('0x4c')]){_0x37af15['include']=[{'all':!![]}];}_0x37af15=_[_0x9f45('0x45')]({},_0x37af15,_0x4a3e6a[_0x9f45('0x4d')]);return db[_0x9f45('0x32')][_0x9f45('0x4e')](_0x37af15)[_0x9f45('0x2a')](handleEntityNotFound(_0x52ddd6,null))[_0x9f45('0x2a')](respondWithResult(_0x52ddd6,null))['catch'](handleError(_0x52ddd6,null));};exports[_0x9f45('0x4f')]=function(_0x46f889,_0x30ffad){return db[_0x9f45('0x32')][_0x9f45('0x4f')](_0x46f889[_0x9f45('0x50')],{})['then'](function(_0x1fbe67){var _0x547fea=_0x46f889['user'][_0x9f45('0x2b')]({'plain':!![]});if(!_0x547fea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x547fea['role']==='user'){var _0x5a6565=_0x1fbe67['get']({'plain':!![]});var _0x45d053=_0x9f45('0x2c');return db[_0x9f45('0x51')][_0x9f45('0x4e')]({'where':{'name':_0x45d053,'userProfileId':_0x547fea['userProfileId']},'raw':!![]})[_0x9f45('0x2a')](function(_0x36950c){if(_0x36950c&&_0x36950c['autoAssociation']===0x0){return db[_0x9f45('0x2d')][_0x9f45('0x4f')]({'name':_0x5a6565['name'],'resourceId':_0x5a6565['id'],'type':_0x36950c[_0x9f45('0x2f')],'sectionId':_0x36950c['id']},{})[_0x9f45('0x2a')](function(){return _0x1fbe67;});}else{return _0x1fbe67;}})[_0x9f45('0x4a')](function(_0xaa75d1){logger[_0x9f45('0x52')](_0x9f45('0x53'),_0xaa75d1);throw _0xaa75d1;});}return _0x1fbe67;})[_0x9f45('0x2a')](respondWithResult(_0x30ffad,0xc9))['catch'](handleError(_0x30ffad,null));};exports[_0x9f45('0x28')]=function(_0x39f214,_0xe77912){if(_0x39f214['body']['id']){delete _0x39f214[_0x9f45('0x50')]['id'];}return db[_0x9f45('0x32')]['find']({'where':{'id':_0x39f214['params']['id']}})[_0x9f45('0x2a')](handleEntityNotFound(_0xe77912,null))['then'](saveUpdates(_0x39f214['body'],null))[_0x9f45('0x2a')](respondWithResult(_0xe77912,null))[_0x9f45('0x4a')](handleError(_0xe77912,null));};exports[_0x9f45('0x29')]=function(_0x3da207,_0x5496b){return db[_0x9f45('0x32')][_0x9f45('0x4e')]({'where':{'id':_0x3da207[_0x9f45('0x54')]['id']}})[_0x9f45('0x2a')](handleEntityNotFound(_0x5496b,null))[_0x9f45('0x2a')](removeEntity(_0x5496b,null))['catch'](handleError(_0x5496b,null));};exports[_0x9f45('0x55')]=function(_0x10fc2e,_0x421241){return db['CmList']['describe']()[_0x9f45('0x2a')](respondWithResult(_0x421241,null))[_0x9f45('0x4a')](handleError(_0x421241,null));};exports[_0x9f45('0x56')]=function(_0x15f99a,_0x3c469e,_0x1f3541){if(_0x15f99a[_0x9f45('0x50')]['id']){delete _0x15f99a['body']['id'];}return db[_0x9f45('0x32')][_0x9f45('0x4e')]({'where':{'id':_0x15f99a['params']['id']}})['then'](handleEntityNotFound(_0x3c469e,null))[_0x9f45('0x2a')](function(_0x1eaec8){if(_0x1eaec8){_0x15f99a[_0x9f45('0x50')]['ListId']=_0x1eaec8['id'];return db['Disposition'][_0x9f45('0x4f')](_0x15f99a[_0x9f45('0x50')]);}})[_0x9f45('0x2a')](respondWithResult(_0x3c469e,null))[_0x9f45('0x4a')](handleError(_0x3c469e,null));};exports[_0x9f45('0x57')]=function(_0x5f5a42,_0x105105,_0x4b7aa6){var _0x123923={'raw':![],'where':{}};var _0x1c9c0a={};var _0x106ca6={'count':0x0,'rows':[]};return db['CmList'][_0x9f45('0x58')]({'where':{'id':_0x5f5a42[_0x9f45('0x54')]['id']}})[_0x9f45('0x2a')](handleEntityNotFound(_0x105105,null))[_0x9f45('0x2a')](function(_0x42f398){if(_0x42f398){_0x1c9c0a[_0x9f45('0x3b')]=_['keys'](db[_0x9f45('0x59')]['rawAttributes']);_0x1c9c0a['query']=_['keys'](_0x5f5a42['query']);_0x1c9c0a[_0x9f45('0x39')]=_[_0x9f45('0x3a')](_0x1c9c0a[_0x9f45('0x3b')],_0x1c9c0a['query']);_0x123923[_0x9f45('0x3c')]=_['intersection'](_0x1c9c0a[_0x9f45('0x3b')],qs[_0x9f45('0x3d')](_0x5f5a42[_0x9f45('0x37')][_0x9f45('0x3d')]));_0x123923[_0x9f45('0x3c')]=_0x123923[_0x9f45('0x3c')][_0x9f45('0x3e')]?_0x123923['attributes']:_0x1c9c0a[_0x9f45('0x3b')];if(!_0x5f5a42[_0x9f45('0x37')][_0x9f45('0x3f')]('nolimit')){_0x123923[_0x9f45('0x23')]=qs[_0x9f45('0x23')](_0x5f5a42[_0x9f45('0x37')][_0x9f45('0x23')]);_0x123923['offset']=qs[_0x9f45('0x21')](_0x5f5a42[_0x9f45('0x37')][_0x9f45('0x21')]);}_0x123923[_0x9f45('0x5a')]=qs[_0x9f45('0x41')](_0x5f5a42[_0x9f45('0x37')][_0x9f45('0x41')]);_0x123923[_0x9f45('0x44')]=qs[_0x9f45('0x39')](_[_0x9f45('0x42')](_0x5f5a42[_0x9f45('0x37')],_0x1c9c0a[_0x9f45('0x39')]));_0x123923['where'][_0x9f45('0x5b')]=_0x42f398['id'];if(_0x5f5a42[_0x9f45('0x37')]['filter']){_0x123923[_0x9f45('0x44')]=_['merge'](_0x123923[_0x9f45('0x44')],{'$or':_[_0x9f45('0x31')](_0x123923[_0x9f45('0x3c')],function(_0x219532){var _0xd25b4f={};_0xd25b4f[_0x219532]={'$like':'%'+_0x5f5a42[_0x9f45('0x37')]['filter']+'%'};return _0xd25b4f;})});}_0x123923=_[_0x9f45('0x45')]({},_0x123923,_0x5f5a42[_0x9f45('0x4d')]);return db[_0x9f45('0x59')][_0x9f45('0x22')]({'where':_0x123923[_0x9f45('0x44')]})[_0x9f45('0x2a')](function(_0x1e9d44){_0x106ca6['count']=_0x1e9d44;if(_0x5f5a42[_0x9f45('0x37')][_0x9f45('0x4c')]){_0x123923[_0x9f45('0x47')]=[{'all':!![]}];}return db[_0x9f45('0x59')][_0x9f45('0x48')](_0x123923);})[_0x9f45('0x2a')](function(_0x2d7a6b){_0x106ca6[_0x9f45('0x49')]=_0x2d7a6b;return _0x106ca6;});}})[_0x9f45('0x2a')](respondWithFilteredResult(_0x105105,_0x123923))[_0x9f45('0x4a')](handleError(_0x105105,null));};exports[_0x9f45('0x5c')]=function(_0x5d3cbd,_0x3cfc7f,_0x4398cb){return db['CmList'][_0x9f45('0x4e')]({'where':{'id':_0x5d3cbd[_0x9f45('0x54')]['id']}})[_0x9f45('0x2a')](handleEntityNotFound(_0x3cfc7f,null))[_0x9f45('0x2a')](function(_0x5a6f20){if(_0x5a6f20){return _0x5a6f20[_0x9f45('0x5c')](_0x5d3cbd[_0x9f45('0x37')][_0x9f45('0x5d')]);}})[_0x9f45('0x2a')](respondWithStatusCode(_0x3cfc7f,null))[_0x9f45('0x4a')](handleError(_0x3cfc7f,null));};exports['addContacts']=function(_0x1081cc,_0x173ef5,_0x110b15){return db['CmList'][_0x9f45('0x4e')]({'where':{'id':_0x1081cc[_0x9f45('0x54')]['id']}})[_0x9f45('0x2a')](handleEntityNotFound(_0x173ef5,null))[_0x9f45('0x2a')](function(_0x56272f){if(_0x56272f){var _0x360f1c=[];var _0x276c31={'success':[],'errors':[]};return db['CmContact'][_0x9f45('0x55')]()[_0x9f45('0x2a')](function(_0x4caa4e){if(_0x1081cc[_0x9f45('0x50')]['tags']&&_[_0x9f45('0x5e')](_0x1081cc[_0x9f45('0x50')][_0x9f45('0x5f')])){if(_0x1081cc[_0x9f45('0x50')]['tags'][_0x9f45('0x3e')]){_0x1081cc['body'][_0x9f45('0x5f')]=_0x1081cc[_0x9f45('0x50')][_0x9f45('0x5f')][_0x9f45('0x60')](';')+';';}else{_0x1081cc[_0x9f45('0x50')][_0x9f45('0x5f')]=null;}}else{_0x1081cc['body'][_0x9f45('0x5f')]=null;}if(_0x1081cc[_0x9f45('0x50')]&&_[_0x9f45('0x5e')](_0x1081cc['body'])){for(var _0x54519d=0x0;_0x54519d<_0x1081cc['body'][_0x9f45('0x3e')];_0x54519d+=0x1){_0x1081cc['body'][_0x54519d]['ListId']=_0x1081cc[_0x9f45('0x54')]['id'];_0x360f1c[_0x9f45('0x61')](_0x1081cc[_0x9f45('0x50')][_0x54519d]);}return BPromise[_0x9f45('0x62')](_0x360f1c,function(_0x10f557){return db[_0x9f45('0x63')]['create'](_[_0x9f45('0x64')](_0x10f557,[_0x9f45('0x5d'),'id'])||{},{'fields':_[_0x9f45('0x38')](_0x4caa4e),'raw':!![]})[_0x9f45('0x2a')](function(_0x333bb6){_0x276c31[_0x9f45('0x65')][_0x9f45('0x61')](_0x333bb6[_0x9f45('0x66')]);})[_0x9f45('0x4a')](function(_0x3af106){_0x276c31['errors']['push']({'data':_0x10f557,'error':_0x3af106['message']});});})['then'](function(_0x495d58){return _0x276c31;})[_0x9f45('0x4a')](function(_0x2c1276){return _0x2c1276;});}else{_0x173ef5['status'](0x190)[_0x9f45('0x20')]({'message':_0x9f45('0x67')});}});}})[_0x9f45('0x2a')](respondWithResult(_0x173ef5,null))['catch'](handleError(_0x173ef5,null));};exports[_0x9f45('0x68')]=function(_0x4f9d73,_0x2a3863,_0x36d6cc){var _0x257874;return db[_0x9f45('0x32')][_0x9f45('0x4e')]({'where':{'id':_0x4f9d73[_0x9f45('0x54')]['id']},'include':[{'model':db[_0x9f45('0x69')],'as':_0x9f45('0x6a')}]})[_0x9f45('0x2a')](handleEntityNotFound(_0x2a3863,null))[_0x9f45('0x2a')](function(_0x4b9a8f){if(_0x4b9a8f){_0x257874=_0x4b9a8f;return db['CmContact'][_0x9f45('0x33')];}})['then'](function(_0x1268ad){if(_0x1268ad){var _0x1adae6={};var _0x36f8fc={};_0x36f8fc[_0x9f45('0x3b')]=_[_0x9f45('0x6b')](_['keys'](_0x1268ad),_[_0x9f45('0x31')](_0x257874[_0x9f45('0x6a')],function(_0xea17ba){return util[_0x9f45('0x6c')]('cf_%d',_0xea17ba['id']);}));_0x36f8fc[_0x9f45('0x37')]=_['keys'](_0x4f9d73[_0x9f45('0x37')]);_0x36f8fc['filters']=_[_0x9f45('0x3a')](_0x36f8fc[_0x9f45('0x3b')],_0x36f8fc[_0x9f45('0x37')]);_0x1adae6[_0x9f45('0x3c')]=_['intersection'](_0x36f8fc[_0x9f45('0x3b')],qs[_0x9f45('0x3d')](_0x4f9d73[_0x9f45('0x37')][_0x9f45('0x3d')]));_0x1adae6['attributes']=_0x1adae6[_0x9f45('0x3c')][_0x9f45('0x3e')]?_0x1adae6['attributes']:_0x36f8fc[_0x9f45('0x3b')];if(!_0x4f9d73[_0x9f45('0x37')][_0x9f45('0x3f')](_0x9f45('0x40'))){_0x1adae6[_0x9f45('0x23')]=qs[_0x9f45('0x23')](_0x4f9d73[_0x9f45('0x37')][_0x9f45('0x23')]);_0x1adae6[_0x9f45('0x21')]=qs[_0x9f45('0x21')](_0x4f9d73[_0x9f45('0x37')][_0x9f45('0x21')]);}_0x1adae6[_0x9f45('0x5a')]=qs[_0x9f45('0x41')](_0x4f9d73['query'][_0x9f45('0x41')]);_0x1adae6['where']=qs[_0x9f45('0x39')](_[_0x9f45('0x42')](_0x4f9d73['query'],_0x36f8fc['filters']));_0x1adae6['raw']=!![];if(_0x4f9d73[_0x9f45('0x37')][_0x9f45('0x43')]){_0x1adae6[_0x9f45('0x44')]=_['merge'](_0x1adae6[_0x9f45('0x44')],{'$or':_[_0x9f45('0x31')](_0x1adae6['attributes'],function(_0x35f6bf){var _0x189652={};_0x189652[_0x35f6bf]={'$like':'%'+_0x4f9d73[_0x9f45('0x37')][_0x9f45('0x43')]+'%'};return _0x189652;})});}_0x1adae6=_[_0x9f45('0x45')]({},_0x1adae6,_0x4f9d73['options']);return _0x257874[_0x9f45('0x68')](_0x1adae6);}})[_0x9f45('0x2a')](respondWithResult(_0x2a3863,null))[_0x9f45('0x4a')](handleError(_0x2a3863,null));};exports['getContactsCsv']=function(_0x43af7c,_0x2c56ec,_0x3f8a35){var _0xa9a5b7;var _0x2d33df;var _0x53b338;var _0x15392a=_0x43af7c[_0x9f45('0x54')]['id'];csv_results=[];return db[_0x9f45('0x6d')][_0x9f45('0x48')]({'attributes':['id','name'],'raw':!![],'order':[_0x9f45('0x6e')]})[_0x9f45('0x2a')](function(_0xf3df3){_0xa9a5b7=_0xf3df3;var _0x326c43=_[_0x9f45('0x38')](db[_0x9f45('0x63')]['rawAttributes']);return db['CmCustomField']['findAll']({'raw':!![],'attributes':['id',_0x9f45('0x6f')]})[_0x9f45('0x2a')](function(_0x18c4b9){_0x2d33df=_0x18c4b9;var _0x476c76=squel[_0x9f45('0x70')]()[_0x9f45('0x3d')](_0x326c43)['from'](_0x9f45('0x71'),'c')[_0x9f45('0x44')](_0x9f45('0x72'),_0x15392a)['where'](_0x9f45('0x73'))[_0x9f45('0x74')]();for(var _0x533128=0x0;_0x533128<_0x2d33df['length'];_0x533128++){_0x476c76[_0x9f45('0x75')]('c.cf_'+_0x2d33df[_0x533128]['id'],_0x9f45('0x76')+_0x2d33df[_0x533128][_0x9f45('0x6f')]);}for(var _0x533128=0x0;_0x533128<_0xa9a5b7[_0x9f45('0x3e')];_0x533128++){_0x476c76[_0x9f45('0x75')](squel[_0x9f45('0x70')]()[_0x9f45('0x75')]('item')['from'](_0x9f45('0x77'))['where']('ItemTypeId\x20=\x20?',_0xa9a5b7[_0x533128]['id'])[_0x9f45('0x44')](_0x9f45('0x78')),_0x9f45('0x79')+_0xa9a5b7[_0x533128][_0x9f45('0x2f')]);_0x476c76[_0x9f45('0x75')](squel[_0x9f45('0x70')]()[_0x9f45('0x75')](_0x9f45('0x7a'))[_0x9f45('0x7b')](_0x9f45('0x77'))['where'](_0x9f45('0x7c'),_0xa9a5b7[_0x533128]['id'])[_0x9f45('0x44')](_0x9f45('0x78')),_0x9f45('0x7d')+_0xa9a5b7[_0x533128][_0x9f45('0x2f')]);}var _0x15b471=[];_0x15b471[_0x9f45('0x61')](_0x476c76[_0x9f45('0x7e')]());BPromise[_0x9f45('0x62')](_0x15b471,handleQuery)[_0x9f45('0x2a')](function(_0x115a64){handleQuery(_0x476c76[_0x9f45('0x7e')]());var _0xc6c72a=csv_results[0x0];if(!_['isEmpty'](_0xc6c72a)){var _0x1a5782=toCsv(_0xc6c72a);var _0x15df6e=Date[_0x9f45('0x7f')]();fs[_0x9f45('0x80')](util['format'](_0x9f45('0x81'),_0x15392a,_0x15df6e),_0x1a5782);_0x2c56ec[_0x9f45('0x82')](_0x9f45('0x83'),'attachment;\x20filename='+util[_0x9f45('0x6c')]('list_%d_%s.csv',_0x15392a,_0x15df6e));_0x2c56ec['setHeader'](_0x9f45('0x84'),_0x9f45('0x85'));return _0x2c56ec['download'](util[_0x9f45('0x6c')](_0x9f45('0x81'),_0x15392a,_0x15df6e));}else{return _0x2c56ec['sendStatus'](0xcc);}});});});};exports[_0x9f45('0x86')]=function(_0x5d560c,_0x2c9582,_0x1f2979){var _0x11e67b;delete _0x5d560c[_0x9f45('0x50')]['id'];return db['CmList'][_0x9f45('0x58')]({'where':{'id':_0x5d560c['params']['id']}})[_0x9f45('0x2a')](handleEntityNotFound(_0x2c9582,null))[_0x9f45('0x2a')](function(_0x4799df){if(_0x4799df){return db['sequelize'][_0x9f45('0x87')](function(_0x291846){return db[_0x9f45('0x69')][_0x9f45('0x4f')](_0x5d560c[_0x9f45('0x50')],{'transaction':_0x291846})['then'](function(_0x290b71){_0x11e67b=_0x290b71;return _0x4799df[_0x9f45('0x88')](_0x290b71,{'transaction':_0x291846});})['then'](function(){var _0x45ffb8={'type':db[_0x9f45('0x89')][_0x9f45('0x8a')],'transaction':_0x291846};switch(_0x5d560c[_0x9f45('0x50')][_0x9f45('0x35')]){case _0x9f45('0x8b'):_0x45ffb8['type']=db[_0x9f45('0x89')]['TEXT'];break;case _0x9f45('0x8c'):_0x45ffb8[_0x9f45('0x35')]=db['Sequelize'][_0x9f45('0x8d')];break;case _0x9f45('0x8e'):_0x45ffb8['type']=db['Sequelize'][_0x9f45('0x8f')];_0x45ffb8[_0x9f45('0x90')]=![];break;default:}return db[_0x9f45('0x91')][_0x9f45('0x92')][_0x9f45('0x93')](_0x9f45('0x71'),util[_0x9f45('0x6c')](_0x9f45('0x94'),_0x11e67b['id']),_0x45ffb8);})['then'](function(){return _0x11e67b;});});}})[_0x9f45('0x2a')](respondWithResult(_0x2c9582,null))['catch'](handleError(_0x2c9582,null));};exports[_0x9f45('0x95')]=function(_0x1fb77a,_0x3f98d0,_0x5540ea){var _0x5b5527={};var _0x2cab8e={};var _0x16fe69;var _0x114a24;return db[_0x9f45('0x32')][_0x9f45('0x58')]({'where':{'id':_0x1fb77a[_0x9f45('0x54')]['id']}})['then'](handleEntityNotFound(_0x3f98d0,null))[_0x9f45('0x2a')](function(_0x19c02e){if(_0x19c02e){_0x16fe69=_0x19c02e;_0x2cab8e[_0x9f45('0x3b')]=_[_0x9f45('0x38')](db[_0x9f45('0x69')][_0x9f45('0x33')]);_0x2cab8e[_0x9f45('0x37')]=_['keys'](_0x1fb77a[_0x9f45('0x37')]);_0x2cab8e[_0x9f45('0x39')]=_[_0x9f45('0x3a')](_0x2cab8e[_0x9f45('0x3b')],_0x2cab8e[_0x9f45('0x37')]);_0x5b5527[_0x9f45('0x3c')]=_[_0x9f45('0x3a')](_0x2cab8e['model'],qs[_0x9f45('0x3d')](_0x1fb77a[_0x9f45('0x37')][_0x9f45('0x3d')]));_0x5b5527[_0x9f45('0x3c')]=_0x5b5527[_0x9f45('0x3c')][_0x9f45('0x3e')]?_0x5b5527[_0x9f45('0x3c')]:_0x2cab8e[_0x9f45('0x3b')];_0x5b5527[_0x9f45('0x5a')]=qs['sort'](_0x1fb77a[_0x9f45('0x37')][_0x9f45('0x41')]);_0x5b5527['where']=qs[_0x9f45('0x39')](_[_0x9f45('0x42')](_0x1fb77a[_0x9f45('0x37')],_0x2cab8e['filters']));_0x5b5527['where']=_['merge'](_0x5b5527[_0x9f45('0x44')],{'$or':[{'ListId':_0x19c02e['id']},{'ListId':null}]});if(_0x1fb77a['query'][_0x9f45('0x43')]){_0x5b5527[_0x9f45('0x44')]=_[_0x9f45('0x45')](_0x5b5527[_0x9f45('0x44')],{'$or':_['map'](_0x5b5527[_0x9f45('0x3c')],function(_0x2cacfe){var _0x86a193={};_0x86a193[_0x2cacfe]={'$like':'%'+_0x1fb77a[_0x9f45('0x37')][_0x9f45('0x43')]+'%'};return _0x86a193;})});}_0x5b5527=_[_0x9f45('0x45')]({},_0x5b5527,_0x1fb77a[_0x9f45('0x4d')]);return db['CmCustomField'][_0x9f45('0x96')](_0x5b5527);}})[_0x9f45('0x2a')](respondWithResult(_0x3f98d0,null))['catch'](handleError(_0x3f98d0,null));};exports['getGlobalCustomFields']=function(_0x42f2d1,_0x234b02){return db['CmCustomField'][_0x9f45('0x96')]({'where':{'ListId':null}})[_0x9f45('0x2a')](handleEntityNotFound(_0x234b02,null))[_0x9f45('0x2a')](function(_0x457ffe){return _0x457ffe;})[_0x9f45('0x2a')](respondWithResult(_0x234b02,null))[_0x9f45('0x4a')](handleError(_0x234b02,null));};exports['addAgents']=function(_0x255fef,_0x31cb54,_0x4bb555){return db[_0x9f45('0x32')][_0x9f45('0x4e')]({'where':{'id':_0x255fef[_0x9f45('0x54')]['id']}})['then'](handleEntityNotFound(_0x31cb54,null))['then'](function(_0x399947){if(_0x399947){return _0x399947['addAgents'](_0x255fef[_0x9f45('0x50')][_0x9f45('0x5d')],_[_0x9f45('0x64')](_0x255fef['body'],[_0x9f45('0x5d'),'id'])||{})['spread'](function(_0x3ea5a8){for(var _0x143e1f=0x0;_0x143e1f<_0x255fef[_0x9f45('0x50')]['ids'][_0x9f45('0x3e')];_0x143e1f+=0x1){socket[_0x9f45('0x97')](_0x9f45('0x98'),{'UserId':Number(_0x255fef['body']['ids'][_0x143e1f]),'CmListId':Number(_0x255fef[_0x9f45('0x54')]['id'])});}return _0x3ea5a8;});}})[_0x9f45('0x2a')](respondWithResult(_0x31cb54,null))[_0x9f45('0x4a')](handleError(_0x31cb54,null));};exports[_0x9f45('0x99')]=function(_0x5ac472,_0x63ee54,_0x5d2b39){return db[_0x9f45('0x32')][_0x9f45('0x4e')]({'where':{'id':_0x5ac472[_0x9f45('0x54')]['id']}})[_0x9f45('0x2a')](handleEntityNotFound(_0x63ee54,null))[_0x9f45('0x2a')](function(_0x3279d7){if(_0x3279d7){return _0x3279d7[_0x9f45('0x99')](_0x5ac472[_0x9f45('0x37')]['ids'])['then'](function(){if(_['isArray'](_0x5ac472[_0x9f45('0x37')]['ids'])){for(var _0x4a5f40=0x0;_0x4a5f40<_0x5ac472[_0x9f45('0x37')]['ids'][_0x9f45('0x3e')];_0x4a5f40+=0x1){socket[_0x9f45('0x97')](_0x9f45('0x9a'),{'UserId':Number(_0x5ac472[_0x9f45('0x37')][_0x9f45('0x5d')][_0x4a5f40]),'CmListId':Number(_0x5ac472[_0x9f45('0x54')]['id'])});}}else{socket['emit']('userCmList:remove',{'UserId':Number(_0x5ac472[_0x9f45('0x37')][_0x9f45('0x5d')]),'CmListId':Number(_0x5ac472[_0x9f45('0x54')]['id'])});}});}})[_0x9f45('0x2a')](respondWithStatusCode(_0x63ee54,null))[_0x9f45('0x4a')](handleError(_0x63ee54,null));};exports[_0x9f45('0x9b')]=function(_0x2c110f,_0x45297a,_0x375f09){var _0x570776={};var _0x54b5dc={};var _0x4130e5;var _0x186d27;return db[_0x9f45('0x32')][_0x9f45('0x58')]({'where':{'id':_0x2c110f[_0x9f45('0x54')]['id']}})['then'](handleEntityNotFound(_0x45297a,null))[_0x9f45('0x2a')](function(_0x292364){if(_0x292364){_0x4130e5=_0x292364;_0x54b5dc[_0x9f45('0x3b')]=_[_0x9f45('0x38')](db[_0x9f45('0x9c')][_0x9f45('0x33')]);_0x54b5dc[_0x9f45('0x37')]=_[_0x9f45('0x38')](_0x2c110f['query']);_0x54b5dc[_0x9f45('0x39')]=_['intersection'](_0x54b5dc[_0x9f45('0x3b')],_0x54b5dc[_0x9f45('0x37')]);_0x570776[_0x9f45('0x3c')]=_[_0x9f45('0x3a')](_0x54b5dc['model'],qs[_0x9f45('0x3d')](_0x2c110f['query'][_0x9f45('0x3d')]));_0x570776[_0x9f45('0x3c')]=_0x570776['attributes']['length']?_0x570776[_0x9f45('0x3c')]:_0x54b5dc['model'];_0x570776[_0x9f45('0x5a')]=qs[_0x9f45('0x41')](_0x2c110f[_0x9f45('0x37')][_0x9f45('0x41')]);_0x570776[_0x9f45('0x44')]=qs[_0x9f45('0x39')](_['pick'](_0x2c110f[_0x9f45('0x37')],_0x54b5dc['filters']));if(_0x2c110f[_0x9f45('0x37')]['filter']){_0x570776[_0x9f45('0x44')]=_[_0x9f45('0x45')](_0x570776[_0x9f45('0x44')],{'$or':_[_0x9f45('0x31')](_0x570776[_0x9f45('0x3c')],function(_0xdf700d){var _0x47d61e={};_0x47d61e[_0xdf700d]={'$like':'%'+_0x2c110f[_0x9f45('0x37')]['filter']+'%'};return _0x47d61e;})});}_0x570776=_['merge']({},_0x570776,_0x2c110f[_0x9f45('0x4d')]);return _0x4130e5[_0x9f45('0x9b')](_0x570776);}})[_0x9f45('0x2a')](function(_0x188bc8){if(_0x188bc8){_0x186d27=_0x188bc8[_0x9f45('0x3e')];if(!_0x2c110f[_0x9f45('0x37')]['hasOwnProperty']('nolimit')){_0x570776[_0x9f45('0x23')]=qs[_0x9f45('0x23')](_0x2c110f[_0x9f45('0x37')][_0x9f45('0x23')]);_0x570776[_0x9f45('0x21')]=qs['offset'](_0x2c110f[_0x9f45('0x37')][_0x9f45('0x21')]);}return _0x4130e5[_0x9f45('0x9b')](_0x570776);}})[_0x9f45('0x2a')](function(_0x155a41){if(_0x155a41){return _0x155a41?{'count':_0x186d27,'rows':_0x155a41}:null;}})[_0x9f45('0x2a')](respondWithResult(_0x45297a,null))[_0x9f45('0x4a')](handleError(_0x45297a,null));};function handleQuery(_0x1496c4){logger[_0x9f45('0x9d')](_0x1496c4);return db[_0x9f45('0x91')][_0x9f45('0x37')](_0x1496c4)['spread'](function(_0x31f37f){csv_results['push'](_0x31f37f);})['catch'](function(_0x1555d2){logger[_0x9f45('0x52')](_0x1555d2[_0x9f45('0x9e')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index a15322a..c0e4fbc 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0x55ca,0x126));var _0xa55c=function(_0x117713,_0x1b3f0c){_0x117713=_0x117713-0x0;var _0x310d68=_0x55ca[_0x117713];return _0x310d68;};'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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x156792,_0x5c22ca){var _0xf6a038=function(_0x1cb52e){while(--_0x1cb52e){_0x156792['push'](_0x156792['shift']());}};_0xf6a038(++_0x5c22ca);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 9945735..f261911 100644 --- a/server/api/cmList/cmList.model.js +++ b/server/api/cmList/cmList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41bb=['bluebird','request-promise','path','rimraf','./cmList.attributes','exports','cm_lists','lodash','util','api'];(function(_0x33eb89,_0x5517f1){var _0x531a2f=function(_0x1b24d5){while(--_0x1b24d5){_0x33eb89['push'](_0x33eb89['shift']());}};_0x531a2f(++_0x5517f1);}(_0x41bb,0xc5));var _0xb41b=function(_0x3a5a1b,_0x4a34a8){_0x3a5a1b=_0x3a5a1b-0x0;var _0x10927d=_0x41bb[_0x3a5a1b];return _0x10927d;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var logger=require('../../config/logger')(_0xb41b('0x2'));var moment=require('moment');var BPromise=require(_0xb41b('0x3'));var rp=require(_0xb41b('0x4'));var fs=require('fs');var path=require(_0xb41b('0x5'));var rimraf=require(_0xb41b('0x6'));var config=require('../../config/environment');var attributes=require(_0xb41b('0x7'));module[_0xb41b('0x8')]=function(_0x2dbaa3,_0x50bc62){return _0x2dbaa3['define']('CmList',attributes,{'tableName':_0xb41b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb43b=['rimraf','../../config/environment','./cmList.attributes','CmList','cm_lists','lodash','util','api','moment','bluebird','path'];(function(_0x36abe6,_0x7b8e40){var _0x6e2568=function(_0x510825){while(--_0x510825){_0x36abe6['push'](_0x36abe6['shift']());}};_0x6e2568(++_0x7b8e40);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2108f4,_0x596050){_0x2108f4=_0x2108f4-0x0;var _0x269f76=_0xb43b[_0x2108f4];return _0x269f76;};'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 diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 3c1b7ff..2193888 100644 --- a/server/api/cmList/cmList.rpc.js +++ b/server/api/cmList/cmList.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec0b=['./cmList.socket','request','then','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0xec0b,0x15b));var _0xbec0=function(_0x53539c,_0x33ee38){_0x53539c=_0x53539c-0x0;var _0x25d812=_0xec0b[_0x53539c];return _0x25d812;};'use strict';var _=require(_0xbec0('0x0'));var util=require(_0xbec0('0x1'));var moment=require(_0xbec0('0x2'));var BPromise=require(_0xbec0('0x3'));var rs=require(_0xbec0('0x4'));var fs=require('fs');var Redis=require(_0xbec0('0x5'));var db=require(_0xbec0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbec0('0x7'))('rpc');var config=require(_0xbec0('0x8'));var jayson=require(_0xbec0('0x9'));var client=jayson['client'][_0xbec0('0xa')]({'port':0x232a});config[_0xbec0('0xb')]=_[_0xbec0('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbec0('0xd'))['register'](socket);function respondWithRpcPromise(_0x564257,_0x430eb2,_0x178cfe){return new BPromise(function(_0x153622,_0x32ec56){return client[_0xbec0('0xe')](_0x564257,_0x178cfe)[_0xbec0('0xf')](function(_0x2966ae){logger['info'](_0xbec0('0x10'),_0x430eb2,_0xbec0('0x11'));logger['debug'](_0xbec0('0x12'),_0x430eb2,_0xbec0('0x11'),JSON['stringify'](_0x2966ae));if(_0x2966ae[_0xbec0('0x13')]){if(_0x2966ae['error'][_0xbec0('0x14')]===0x1f4){logger[_0xbec0('0x13')](_0xbec0('0x10'),_0x430eb2,_0x2966ae[_0xbec0('0x13')][_0xbec0('0x15')]);return _0x32ec56(_0x2966ae['error'][_0xbec0('0x15')]);}logger[_0xbec0('0x13')](_0xbec0('0x10'),_0x430eb2,_0x2966ae[_0xbec0('0x13')][_0xbec0('0x15')]);return _0x153622(_0x2966ae[_0xbec0('0x13')]['message']);}else{logger['info'](_0xbec0('0x10'),_0x430eb2,_0xbec0('0x11'));_0x153622(_0x2966ae[_0xbec0('0x16')][_0xbec0('0x15')]);}})[_0xbec0('0x17')](function(_0x3cd155){logger[_0xbec0('0x13')]('CmList,\x20%s,\x20%s',_0x430eb2,_0x3cd155);_0x32ec56(_0x3cd155);});});} \ No newline at end of file +var _0xd7a3=['../../config/logger','rpc','../../config/environment','http','redis','localhost','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2e6184,_0xf2fc16){var _0x1e4c2c=function(_0x1dc66b){while(--_0x1dc66b){_0x2e6184['push'](_0x2e6184['shift']());}};_0x1e4c2c(++_0xf2fc16);}(_0xd7a3,0x15a));var _0x3d7a=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xd7a3[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var util=require(_0x3d7a('0x0'));var moment=require(_0x3d7a('0x1'));var BPromise=require(_0x3d7a('0x2'));var rs=require(_0x3d7a('0x3'));var fs=require('fs');var Redis=require(_0x3d7a('0x4'));var db=require(_0x3d7a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3d7a('0x6'))(_0x3d7a('0x7'));var config=require(_0x3d7a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3d7a('0x9')]({'port':0x232a});config[_0x3d7a('0xa')]=_['defaults'](config['redis'],{'host':_0x3d7a('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d7a('0xa')]));require(_0x3d7a('0xc'))[_0x3d7a('0xd')](socket);function respondWithRpcPromise(_0x423c8e,_0x219fe0,_0x344d19){return new BPromise(function(_0x3a6438,_0x20c568){return client[_0x3d7a('0xe')](_0x423c8e,_0x344d19)['then'](function(_0x2c48ba){logger[_0x3d7a('0xf')](_0x3d7a('0x10'),_0x219fe0,_0x3d7a('0x11'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x219fe0,'request\x20sent',JSON[_0x3d7a('0x12')](_0x2c48ba));if(_0x2c48ba['error']){if(_0x2c48ba[_0x3d7a('0x13')]['code']===0x1f4){logger[_0x3d7a('0x13')](_0x3d7a('0x10'),_0x219fe0,_0x2c48ba[_0x3d7a('0x13')]['message']);return _0x20c568(_0x2c48ba[_0x3d7a('0x13')][_0x3d7a('0x14')]);}logger[_0x3d7a('0x13')](_0x3d7a('0x10'),_0x219fe0,_0x2c48ba[_0x3d7a('0x13')]['message']);return _0x3a6438(_0x2c48ba[_0x3d7a('0x13')][_0x3d7a('0x14')]);}else{logger[_0x3d7a('0xf')]('CmList,\x20%s,\x20%s',_0x219fe0,_0x3d7a('0x11'));_0x3a6438(_0x2c48ba[_0x3d7a('0x15')][_0x3d7a('0x14')]);}})['catch'](function(_0x1d29d9){logger[_0x3d7a('0x13')](_0x3d7a('0x10'),_0x219fe0,_0x1d29d9);_0x20c568(_0x1d29d9);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 7877222..45e8e2c 100644 --- a/server/api/cmList/cmList.socket.js +++ b/server/api/cmList/cmList.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4711=['remove','update','emit','register','length','cmList:','save'];(function(_0x4f436c,_0x54b915){var _0x49d2a9=function(_0x3bce5b){while(--_0x3bce5b){_0x4f436c['push'](_0x4f436c['shift']());}};_0x49d2a9(++_0x54b915);}(_0x4711,0x1c6));var _0x1471=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4711[_0x321bb2];return _0x9c12ed;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x1471('0x0'),_0x1471('0x1'),_0x1471('0x2')];function createListener(_0x3e32df,_0x59f4d3){return function(_0x121406){_0x59f4d3[_0x1471('0x3')](_0x3e32df,_0x121406);};}function removeListener(_0x2bc5c8,_0x1a4004){return function(){CmListEvents['removeListener'](_0x2bc5c8,_0x1a4004);};}exports[_0x1471('0x4')]=function(_0x41e51a){for(var _0x5b770c=0x0,_0x5ef915=events[_0x1471('0x5')];_0x5b770c<_0x5ef915;_0x5b770c++){var _0x504916=events[_0x5b770c];var _0x114d8e=createListener(_0x1471('0x6')+_0x504916,_0x41e51a);CmListEvents['on'](_0x504916,_0x114d8e);}}; \ No newline at end of file +var _0xace8=['removeListener','length','cmList:','./cmList.events','save','remove','update'];(function(_0x5b8566,_0x2152e2){var _0x557e4b=function(_0x52908f){while(--_0x52908f){_0x5b8566['push'](_0x5b8566['shift']());}};_0x557e4b(++_0x2152e2);}(_0xace8,0x88));var _0x8ace=function(_0x52d441,_0x343fb0){_0x52d441=_0x52d441-0x0;var _0x5cf70f=_0xace8[_0x52d441];return _0x5cf70f;};'use strict';var CmListEvents=require(_0x8ace('0x0'));var events=[_0x8ace('0x1'),_0x8ace('0x2'),_0x8ace('0x3')];function createListener(_0x2810d7,_0x7046bc){return function(_0x21b48c){_0x7046bc['emit'](_0x2810d7,_0x21b48c);};}function removeListener(_0x198de9,_0x3c8d2a){return function(){CmListEvents[_0x8ace('0x4')](_0x198de9,_0x3c8d2a);};}exports['register']=function(_0x56b566){for(var _0x571c6c=0x0,_0x2c8d91=events[_0x8ace('0x5')];_0x571c6c<_0x2c8d91;_0x571c6c++){var _0xf7c200=events[_0x571c6c];var _0x42d103=createListener(_0x8ace('0x6')+_0xf7c200,_0x56b566);CmListEvents['on'](_0xf7c200,_0x42d103);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 991463b..b27d076 100644 --- a/server/api/cmList/index.js +++ b/server/api/cmList/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xddc8=['destroy','removeDispositions','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','get','/:id','show','/:id/dispositions','getDispositions','/:id/contacts/csv','/:id/fields','/:id/users','getAgents','create','post','addDisposition','/:id/contacts','addContacts','addAgents','put','update','delete'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xddc8,0x87));var _0x8ddc=function(_0x4f475a,_0x23dc9f){_0x4f475a=_0x4f475a-0x0;var _0xd03e1b=_0xddc8[_0x4f475a];return _0xd03e1b;};'use strict';var multer=require('multer');var util=require(_0x8ddc('0x0'));var path=require(_0x8ddc('0x1'));var timeout=require(_0x8ddc('0x2'));var express=require(_0x8ddc('0x3'));var router=express[_0x8ddc('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8ddc('0x5'));var config=require('../../config/environment');var controller=require('./cmList.controller');router['get']('/',auth[_0x8ddc('0x6')](),controller[_0x8ddc('0x7')]);router['get'](_0x8ddc('0x8'),auth[_0x8ddc('0x6')](),controller[_0x8ddc('0x9')]);router['get'](_0x8ddc('0xa'),auth[_0x8ddc('0x6')](),controller[_0x8ddc('0xb')]);router[_0x8ddc('0xc')](_0x8ddc('0xd'),auth['isAuthenticated'](),controller[_0x8ddc('0xe')]);router['get'](_0x8ddc('0xf'),auth[_0x8ddc('0x6')](),controller[_0x8ddc('0x10')]);router[_0x8ddc('0xc')]('/:id/contacts',auth[_0x8ddc('0x6')](),controller['getContacts']);router[_0x8ddc('0xc')](_0x8ddc('0x11'),auth[_0x8ddc('0x6')](),controller['getContactsCsv']);router['get'](_0x8ddc('0x12'),auth[_0x8ddc('0x6')](),controller['getCustomFields']);router[_0x8ddc('0xc')](_0x8ddc('0x13'),auth[_0x8ddc('0x6')](),controller[_0x8ddc('0x14')]);router['post']('/',auth[_0x8ddc('0x6')](),controller[_0x8ddc('0x15')]);router[_0x8ddc('0x16')](_0x8ddc('0xf'),auth[_0x8ddc('0x6')](),controller[_0x8ddc('0x17')]);router[_0x8ddc('0x16')](_0x8ddc('0x18'),auth[_0x8ddc('0x6')](),controller[_0x8ddc('0x19')]);router['post'](_0x8ddc('0x12'),auth[_0x8ddc('0x6')](),controller['addCustomField']);router['post'](_0x8ddc('0x13'),auth[_0x8ddc('0x6')](),controller[_0x8ddc('0x1a')]);router[_0x8ddc('0x1b')](_0x8ddc('0xd'),auth[_0x8ddc('0x6')](),controller[_0x8ddc('0x1c')]);router[_0x8ddc('0x1d')](_0x8ddc('0xd'),auth[_0x8ddc('0x6')](),controller[_0x8ddc('0x1e')]);router[_0x8ddc('0x1d')](_0x8ddc('0xf'),auth[_0x8ddc('0x6')](),controller[_0x8ddc('0x1f')]);router[_0x8ddc('0x1d')]('/:id/users',auth[_0x8ddc('0x6')](),controller['removeAgents']);module[_0x8ddc('0x20')]=router; \ No newline at end of file +var _0x1f77=['get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','addDisposition','addContacts','/:id/users','addAgents','delete','destroy','removeDispositions','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller'];(function(_0x446148,_0x4b816c){var _0x90ab91=function(_0x20127c){while(--_0x20127c){_0x446148['push'](_0x446148['shift']());}};_0x90ab91(++_0x4b816c);}(_0x1f77,0x131));var _0x71f7=function(_0x41b0e6,_0x7a9383){_0x41b0e6=_0x41b0e6-0x0;var _0x125443=_0x1f77[_0x41b0e6];return _0x125443;};'use strict';var multer=require(_0x71f7('0x0'));var util=require(_0x71f7('0x1'));var path=require(_0x71f7('0x2'));var timeout=require(_0x71f7('0x3'));var express=require(_0x71f7('0x4'));var router=express[_0x71f7('0x5')]();var fs_extra=require(_0x71f7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x71f7('0x7'));var config=require(_0x71f7('0x8'));var controller=require(_0x71f7('0x9'));router[_0x71f7('0xa')]('/',auth[_0x71f7('0xb')](),controller[_0x71f7('0xc')]);router[_0x71f7('0xa')](_0x71f7('0xd'),auth[_0x71f7('0xb')](),controller[_0x71f7('0xe')]);router[_0x71f7('0xa')](_0x71f7('0xf'),auth['isAuthenticated'](),controller[_0x71f7('0x10')]);router['get'](_0x71f7('0x11'),auth[_0x71f7('0xb')](),controller['show']);router['get'](_0x71f7('0x12'),auth[_0x71f7('0xb')](),controller[_0x71f7('0x13')]);router['get'](_0x71f7('0x14'),auth[_0x71f7('0xb')](),controller[_0x71f7('0x15')]);router[_0x71f7('0xa')](_0x71f7('0x16'),auth[_0x71f7('0xb')](),controller[_0x71f7('0x17')]);router[_0x71f7('0xa')](_0x71f7('0x18'),auth[_0x71f7('0xb')](),controller[_0x71f7('0x19')]);router[_0x71f7('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0x71f7('0x1a')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x71f7('0x1b')](_0x71f7('0x12'),auth[_0x71f7('0xb')](),controller[_0x71f7('0x1c')]);router[_0x71f7('0x1b')](_0x71f7('0x14'),auth[_0x71f7('0xb')](),controller[_0x71f7('0x1d')]);router[_0x71f7('0x1b')](_0x71f7('0x18'),auth['isAuthenticated'](),controller['addCustomField']);router['post'](_0x71f7('0x1e'),auth[_0x71f7('0xb')](),controller[_0x71f7('0x1f')]);router['put'](_0x71f7('0x11'),auth[_0x71f7('0xb')](),controller['update']);router[_0x71f7('0x20')](_0x71f7('0x11'),auth['isAuthenticated'](),controller[_0x71f7('0x21')]);router[_0x71f7('0x20')](_0x71f7('0x12'),auth[_0x71f7('0xb')](),controller[_0x71f7('0x22')]);router[_0x71f7('0x20')](_0x71f7('0x1e'),auth[_0x71f7('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index cd40f08..262f702 100644 --- a/server/api/condition/condition.attributes.js +++ b/server/api/condition/condition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa450=['exports','VIRTUAL','field','STRING','sequelize'];(function(_0x161648,_0x247a96){var _0x3f3e70=function(_0x6483d6){while(--_0x6483d6){_0x161648['push'](_0x161648['shift']());}};_0x3f3e70(++_0x247a96);}(_0xa450,0x6d));var _0x0a45=function(_0x168998,_0x21547e){_0x168998=_0x168998-0x0;var _0xbb7371=_0xa450[_0x168998];return _0xbb7371;};'use strict';var Sequelize=require(_0x0a45('0x0'));module[_0x0a45('0x1')]={'name':{'type':Sequelize[_0x0a45('0x2')],'get':function(_0x4ecaa2){return this['getDataValue'](_0x0a45('0x3'));}},'field':{'type':Sequelize[_0x0a45('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x0a45('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x601a=['STRING','sequelize','exports','getDataValue','field'];(function(_0x28e405,_0x155e72){var _0x190254=function(_0x3271ab){while(--_0x3271ab){_0x28e405['push'](_0x28e405['shift']());}};_0x190254(++_0x155e72);}(_0x601a,0x1d2));var _0xa601=function(_0x296666,_0xc1fb98){_0x296666=_0x296666-0x0;var _0x1278ef=_0x601a[_0x296666];return _0x1278ef;};'use strict';var Sequelize=require(_0xa601('0x0'));module[_0xa601('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2f727d){return this[_0xa601('0x2')](_0xa601('0x3'));}},'field':{'type':Sequelize[_0xa601('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xa601('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xa601('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index e481862..39350f4 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x380bc4,_0x44faa9){var _0x18e1ef=function(_0x2caac4){while(--_0x2caac4){_0x380bc4['push'](_0x380bc4['shift']());}};_0x18e1ef(++_0x44faa9);}(_0x7a54,0x106));var _0x47a5=function(_0x32a92d,_0x442235){_0x32a92d=_0x32a92d-0x0;var _0x1a0337=_0x7a54[_0x32a92d];return _0x1a0337;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x46e5af,_0x5056a2){var _0x501446=function(_0x5327b1){while(--_0x5327b1){_0x46e5af['push'](_0x46e5af['shift']());}};_0x501446(++_0x5056a2);}(_0x7a54,0x106));var _0x47a5=function(_0x4508cf,_0x3df8fb){_0x4508cf=_0x4508cf-0x0;var _0x4a8d8e=_0x7a54[_0x4508cf];return _0x4a8d8e;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index e04d839..37925b3 100644 --- a/server/api/condition/condition.model.js +++ b/server/api/condition/condition.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47df=['exports','define','tools_conditions','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./condition.attributes'];(function(_0x9b243f,_0x3f5ece){var _0x2a3d3b=function(_0x5aac39){while(--_0x5aac39){_0x9b243f['push'](_0x9b243f['shift']());}};_0x2a3d3b(++_0x3f5ece);}(_0x47df,0x177));var _0xf47d=function(_0x124c30,_0x552cc7){_0x124c30=_0x124c30-0x0;var _0x3f70de=_0x47df[_0x124c30];return _0x3f70de;};'use strict';var _=require(_0xf47d('0x0'));var util=require(_0xf47d('0x1'));var logger=require(_0xf47d('0x2'))(_0xf47d('0x3'));var moment=require('moment');var BPromise=require(_0xf47d('0x4'));var rp=require(_0xf47d('0x5'));var fs=require('fs');var path=require(_0xf47d('0x6'));var rimraf=require('rimraf');var config=require(_0xf47d('0x7'));var attributes=require(_0xf47d('0x8'));module[_0xf47d('0x9')]=function(_0x35a735,_0x46b9e7){return _0x35a735[_0xf47d('0xa')]('Condition',attributes,{'tableName':_0xf47d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0bd0=['bluebird','request-promise','rimraf','./condition.attributes','define','Condition','tools_conditions','lodash','util','../../config/logger','api'];(function(_0x14d0d7,_0x32df52){var _0x36da65=function(_0x1b1839){while(--_0x1b1839){_0x14d0d7['push'](_0x14d0d7['shift']());}};_0x36da65(++_0x32df52);}(_0x0bd0,0x167));var _0x00bd=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x0bd0[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x00bd('0x0'));var util=require(_0x00bd('0x1'));var logger=require(_0x00bd('0x2'))(_0x00bd('0x3'));var moment=require('moment');var BPromise=require(_0x00bd('0x4'));var rp=require(_0x00bd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x00bd('0x6'));var config=require('../../config/environment');var attributes=require(_0x00bd('0x7'));module['exports']=function(_0xaa0b94,_0x172e01){return _0xaa0b94[_0x00bd('0x8')](_0x00bd('0x9'),attributes,{'tableName':_0x00bd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 035a7e7..83ce478 100644 --- a/server/api/condition/condition.rpc.js +++ b/server/api/condition/condition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7384=['stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s'];(function(_0x81ca42,_0x1c4809){var _0x59377d=function(_0x1ad32d){while(--_0x1ad32d){_0x81ca42['push'](_0x81ca42['shift']());}};_0x59377d(++_0x1c4809);}(_0x7384,0xdd));var _0x4738=function(_0x48b5e7,_0x5e249f){_0x48b5e7=_0x48b5e7-0x0;var _0x405730=_0x7384[_0x48b5e7];return _0x405730;};'use strict';var _=require(_0x4738('0x0'));var util=require(_0x4738('0x1'));var moment=require(_0x4738('0x2'));var BPromise=require(_0x4738('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4738('0x4'));var db=require(_0x4738('0x5'))['db'];var utils=require(_0x4738('0x6'));var logger=require('../../config/logger')(_0x4738('0x7'));var config=require(_0x4738('0x8'));var jayson=require(_0x4738('0x9'));var client=jayson[_0x4738('0xa')][_0x4738('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18aeeb,_0x3bcd76,_0xe0a3f9){return new BPromise(function(_0x203af1,_0x59d164){return client[_0x4738('0xc')](_0x18aeeb,_0xe0a3f9)[_0x4738('0xd')](function(_0xafe533){logger[_0x4738('0xe')](_0x4738('0xf'),_0x3bcd76,_0x4738('0x10'));logger[_0x4738('0x11')](_0x4738('0x12'),_0x3bcd76,_0x4738('0x10'),JSON[_0x4738('0x13')](_0xafe533));if(_0xafe533['error']){if(_0xafe533[_0x4738('0x14')]['code']===0x1f4){logger[_0x4738('0x14')]('Condition,\x20%s,\x20%s',_0x3bcd76,_0xafe533['error'][_0x4738('0x15')]);return _0x59d164(_0xafe533[_0x4738('0x14')][_0x4738('0x15')]);}logger[_0x4738('0x14')](_0x4738('0xf'),_0x3bcd76,_0xafe533[_0x4738('0x14')][_0x4738('0x15')]);return _0x203af1(_0xafe533[_0x4738('0x14')][_0x4738('0x15')]);}else{logger[_0x4738('0xe')](_0x4738('0xf'),_0x3bcd76,_0x4738('0x10'));_0x203af1(_0xafe533[_0x4738('0x16')][_0x4738('0x15')]);}})[_0x4738('0x17')](function(_0x4d2863){logger[_0x4738('0x14')](_0x4738('0xf'),_0x3bcd76,_0x4d2863);_0x59d164(_0x4d2863);});});} \ No newline at end of file +var _0xaf6f=['rpc','../../config/environment','jayson/promise','client','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x3ccc44,_0x207b0c){var _0x5d74bb=function(_0x59989a){while(--_0x59989a){_0x3ccc44['push'](_0x3ccc44['shift']());}};_0x5d74bb(++_0x207b0c);}(_0xaf6f,0x7e));var _0xfaf6=function(_0x615438,_0x83e83){_0x615438=_0x615438-0x0;var _0x7f1b53=_0xaf6f[_0x615438];return _0x7f1b53;};'use strict';var _=require(_0xfaf6('0x0'));var util=require(_0xfaf6('0x1'));var moment=require('moment');var BPromise=require(_0xfaf6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfaf6('0x3'));var db=require(_0xfaf6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfaf6('0x5'))(_0xfaf6('0x6'));var config=require(_0xfaf6('0x7'));var jayson=require(_0xfaf6('0x8'));var client=jayson[_0xfaf6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x180bcb,_0x31687b,_0x9a9c6c){return new BPromise(function(_0x6744c4,_0x11551e){return client['request'](_0x180bcb,_0x9a9c6c)[_0xfaf6('0xa')](function(_0x4c0e32){logger[_0xfaf6('0xb')](_0xfaf6('0xc'),_0x31687b,_0xfaf6('0xd'));logger[_0xfaf6('0xe')](_0xfaf6('0xf'),_0x31687b,_0xfaf6('0xd'),JSON[_0xfaf6('0x10')](_0x4c0e32));if(_0x4c0e32['error']){if(_0x4c0e32[_0xfaf6('0x11')][_0xfaf6('0x12')]===0x1f4){logger[_0xfaf6('0x11')](_0xfaf6('0xc'),_0x31687b,_0x4c0e32[_0xfaf6('0x11')][_0xfaf6('0x13')]);return _0x11551e(_0x4c0e32['error'][_0xfaf6('0x13')]);}logger[_0xfaf6('0x11')](_0xfaf6('0xc'),_0x31687b,_0x4c0e32[_0xfaf6('0x11')][_0xfaf6('0x13')]);return _0x6744c4(_0x4c0e32[_0xfaf6('0x11')][_0xfaf6('0x13')]);}else{logger[_0xfaf6('0xb')](_0xfaf6('0xc'),_0x31687b,'request\x20sent');_0x6744c4(_0x4c0e32[_0xfaf6('0x14')][_0xfaf6('0x13')]);}})[_0xfaf6('0x15')](function(_0x3c8b04){logger[_0xfaf6('0x11')](_0xfaf6('0xc'),_0x31687b,_0x3c8b04);_0x11551e(_0x3c8b04);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 4ce0268..3b5e935 100644 --- a/server/api/condition/index.js +++ b/server/api/condition/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe952=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','delete','destroy','multer','util'];(function(_0x3634a6,_0x12da9a){var _0x19088a=function(_0x9f0d3d){while(--_0x9f0d3d){_0x3634a6['push'](_0x3634a6['shift']());}};_0x19088a(++_0x12da9a);}(_0xe952,0x184));var _0x2e95=function(_0xddb4b5,_0x7d4e00){_0xddb4b5=_0xddb4b5-0x0;var _0xc32cd7=_0xe952[_0xddb4b5];return _0xc32cd7;};'use strict';var multer=require(_0x2e95('0x0'));var util=require(_0x2e95('0x1'));var path=require(_0x2e95('0x2'));var timeout=require(_0x2e95('0x3'));var express=require(_0x2e95('0x4'));var router=express['Router']();var fs_extra=require(_0x2e95('0x5'));var auth=require(_0x2e95('0x6'));var interaction=require(_0x2e95('0x7'));var config=require(_0x2e95('0x8'));var controller=require(_0x2e95('0x9'));router[_0x2e95('0xa')](_0x2e95('0xb'),auth[_0x2e95('0xc')](),controller['update']);router[_0x2e95('0xd')](_0x2e95('0xb'),auth['isAuthenticated'](),controller[_0x2e95('0xe')]);module['exports']=router; \ No newline at end of file +var _0xcf5f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x184438,_0x3ea61c){var _0x1f2c93=function(_0x5ed587){while(--_0x5ed587){_0x184438['push'](_0x184438['shift']());}};_0x1f2c93(++_0x3ea61c);}(_0xcf5f,0x82));var _0xfcf5=function(_0x4349a7,_0x8ad8a7){_0x4349a7=_0x4349a7-0x0;var _0x1db191=_0xcf5f[_0x4349a7];return _0x1db191;};'use strict';var multer=require(_0xfcf5('0x0'));var util=require(_0xfcf5('0x1'));var path=require(_0xfcf5('0x2'));var timeout=require(_0xfcf5('0x3'));var express=require('express');var router=express[_0xfcf5('0x4')]();var fs_extra=require(_0xfcf5('0x5'));var auth=require(_0xfcf5('0x6'));var interaction=require(_0xfcf5('0x7'));var config=require(_0xfcf5('0x8'));var controller=require(_0xfcf5('0x9'));router[_0xfcf5('0xa')]('/:id',auth[_0xfcf5('0xb')](),controller[_0xfcf5('0xc')]);router['delete']('/:id',auth[_0xfcf5('0xb')](),controller[_0xfcf5('0xd')]);module[_0xfcf5('0xe')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 5836205..ab840ed 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedb6=['INTEGER','sequelize','STRING','name'];(function(_0x267f27,_0x60064){var _0x5cbe40=function(_0x46de63){while(--_0x46de63){_0x267f27['push'](_0x267f27['shift']());}};_0x5cbe40(++_0x60064);}(_0xedb6,0x18d));var _0x6edb=function(_0x11b58d,_0x555c55){_0x11b58d=_0x11b58d-0x0;var _0xc2811b=_0xedb6[_0x11b58d];return _0xc2811b;};'use strict';var Sequelize=require(_0x6edb('0x0'));module['exports']={'name':{'type':Sequelize[_0x6edb('0x1')],'allowNull':![],'unique':_0x6edb('0x2')},'OrderBy':{'type':Sequelize[_0x6edb('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x6edb('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x091c=['STRING','INTEGER','exports'];(function(_0x44960d,_0x27ab5f){var _0x370dbf=function(_0x1a8098){while(--_0x1a8098){_0x44960d['push'](_0x44960d['shift']());}};_0x370dbf(++_0x27ab5f);}(_0x091c,0x1af));var _0xc091=function(_0x40dd31,_0x4a887a){_0x40dd31=_0x40dd31-0x0;var _0x2da8de=_0x091c[_0x40dd31];return _0x2da8de;};'use strict';var Sequelize=require('sequelize');module[_0xc091('0x0')]={'name':{'type':Sequelize[_0xc091('0x1')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0xc091('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xc091('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 4d1fbef..6e7fc46 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb44a=['where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','ContactItemTypes','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','CmContactHasItem','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','UserProfileResource','error','stack','name','index','ContactItemType','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x5465c0,_0x3786f7){var _0x45ff36=function(_0x593525){while(--_0x593525){_0x5465c0['push'](_0x5465c0['shift']());}};_0x45ff36(++_0x3786f7);}(_0xb44a,0x1c2));var _0xab44=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xb44a[_0x3a6efd];return _0x487b9a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xab44('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab44('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xab44('0x2'));var util=require('util');var path=require(_0xab44('0x3'));var sox=require(_0xab44('0x4'));var csv=require(_0xab44('0x5'));var ejs=require(_0xab44('0x6'));var fs=require('fs');var fs_extra=require(_0xab44('0x7'));var _=require(_0xab44('0x8'));var squel=require(_0xab44('0x9'));var crypto=require(_0xab44('0xa'));var jsforce=require(_0xab44('0xb'));var deskjs=require(_0xab44('0xc'));var toCsv=require(_0xab44('0x5'));var querystring=require(_0xab44('0xd'));var Papa=require(_0xab44('0xe'));var Redis=require('ioredis');var authService=require(_0xab44('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xab44('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xab44('0x11'));var utils=require(_0xab44('0x12'));var config=require(_0xab44('0x13'));var licenseUtil=require(_0xab44('0x14'));var db=require(_0xab44('0x15'))['db'];function respondWithStatusCode(_0x237c26,_0x52d282){_0x52d282=_0x52d282||0xcc;return function(_0x57fcff){if(_0x57fcff){return _0x237c26[_0xab44('0x16')](_0x52d282);}return _0x237c26['status'](_0x52d282)[_0xab44('0x17')]();};}function respondWithResult(_0x5ae369,_0x25f611){_0x25f611=_0x25f611||0xc8;return function(_0x15b98a){if(_0x15b98a){return _0x5ae369[_0xab44('0x18')](_0x25f611)[_0xab44('0x19')](_0x15b98a);}};}function respondWithFilteredResult(_0x31404d,_0x41701b){return function(_0x4875df){if(_0x4875df){var _0x51251b=typeof _0x41701b[_0xab44('0x1a')]===_0xab44('0x1b')&&typeof _0x41701b[_0xab44('0x1c')]===_0xab44('0x1b');var _0xffdfbc=_0x4875df[_0xab44('0x1d')];var _0x354b09=_0x51251b?0x0:_0x41701b[_0xab44('0x1a')];var _0x310b15=_0x51251b?_0x4875df[_0xab44('0x1d')]:_0x41701b[_0xab44('0x1a')]+_0x41701b['limit'];var _0xb779bb;if(_0x310b15>=_0xffdfbc){_0x310b15=_0xffdfbc;_0xb779bb=0xc8;}else{_0xb779bb=0xce;}_0x31404d[_0xab44('0x18')](_0xb779bb);return _0x31404d[_0xab44('0x1e')](_0xab44('0x1f'),_0x354b09+'-'+_0x310b15+'/'+_0xffdfbc)[_0xab44('0x19')](_0x4875df);}return null;};}function patchUpdates(_0x5123b1){return function(_0xcd426){try{jsonpatch['apply'](_0xcd426,_0x5123b1,!![]);}catch(_0x1f7311){return BPromise[_0xab44('0x20')](_0x1f7311);}return _0xcd426[_0xab44('0x21')]();};}function saveUpdates(_0x355083,_0x486317){return function(_0x3a2b1d){if(_0x3a2b1d){return _0x3a2b1d[_0xab44('0x22')](_0x355083)[_0xab44('0x23')](function(_0x3b17d5){return _0x3b17d5;});}return null;};}function removeEntity(_0x11f0b,_0x402950){return function(_0x43f1c6){if(_0x43f1c6){return _0x43f1c6['destroy']()['then'](function(){var _0x1d4a2f=_0x43f1c6['get']({'plain':!![]});var _0x2439f3='ContactItemTypes';return db[_0xab44('0x24')]['destroy']({'where':{'type':_0x2439f3,'resourceId':_0x1d4a2f['id']}})['then'](function(){return _0x43f1c6;});})[_0xab44('0x23')](function(){_0x11f0b[_0xab44('0x18')](0xcc)[_0xab44('0x17')]();});}};}function handleEntityNotFound(_0x4620ed,_0x132bf6){return function(_0x4e820c){if(!_0x4e820c){_0x4620ed[_0xab44('0x16')](0x194);}return _0x4e820c;};}function handleError(_0x5587fe,_0x5071f3){_0x5071f3=_0x5071f3||0x1f4;return function(_0x887b0d){logger[_0xab44('0x25')](_0x887b0d[_0xab44('0x26')]);if(_0x887b0d[_0xab44('0x27')]){delete _0x887b0d[_0xab44('0x27')];}_0x5587fe[_0xab44('0x18')](_0x5071f3)['send'](_0x887b0d);};}exports[_0xab44('0x28')]=function(_0x43a42d,_0x36f9b6){var _0x47e1be={},_0x54cac8={},_0x106d3a={'count':0x0,'rows':[]};var _0x5082e4=_['map'](db[_0xab44('0x29')][_0xab44('0x2a')],function(_0x160177){return{'name':_0x160177[_0xab44('0x2b')],'type':_0x160177[_0xab44('0x2c')][_0xab44('0x2d')]};});_0x54cac8[_0xab44('0x2e')]=_[_0xab44('0x2f')](_0x5082e4,_0xab44('0x27'));_0x54cac8[_0xab44('0x30')]=_[_0xab44('0x31')](_0x43a42d[_0xab44('0x30')]);_0x54cac8[_0xab44('0x32')]=_[_0xab44('0x33')](_0x54cac8['model'],_0x54cac8['query']);_0x47e1be[_0xab44('0x34')]=_[_0xab44('0x33')](_0x54cac8['model'],qs[_0xab44('0x35')](_0x43a42d[_0xab44('0x30')][_0xab44('0x35')]));_0x47e1be[_0xab44('0x34')]=_0x47e1be[_0xab44('0x34')][_0xab44('0x36')]?_0x47e1be[_0xab44('0x34')]:_0x54cac8[_0xab44('0x2e')];if(!_0x43a42d[_0xab44('0x30')][_0xab44('0x37')](_0xab44('0x38'))){_0x47e1be[_0xab44('0x1c')]=qs[_0xab44('0x1c')](_0x43a42d[_0xab44('0x30')][_0xab44('0x1c')]);_0x47e1be[_0xab44('0x1a')]=qs[_0xab44('0x1a')](_0x43a42d[_0xab44('0x30')]['offset']);}_0x47e1be[_0xab44('0x39')]=qs[_0xab44('0x3a')](_0x43a42d[_0xab44('0x30')][_0xab44('0x3a')]);_0x47e1be['where']=qs[_0xab44('0x32')](_[_0xab44('0x3b')](_0x43a42d[_0xab44('0x30')],_0x54cac8[_0xab44('0x32')]),_0x5082e4);if(_0x43a42d[_0xab44('0x30')]['filter']){_0x47e1be[_0xab44('0x3c')]=_[_0xab44('0x3d')](_0x47e1be[_0xab44('0x3c')],{'$or':_['map'](_0x5082e4,function(_0x3ef5ea){if(_0x3ef5ea[_0xab44('0x2c')]!==_0xab44('0x3e')){var _0xf80acf={};_0xf80acf[_0x3ef5ea[_0xab44('0x27')]]={'$like':'%'+_0x43a42d['query'][_0xab44('0x3f')]+'%'};return _0xf80acf;}})});}_0x47e1be=_['merge']({},_0x47e1be,_0x43a42d[_0xab44('0x40')]);var _0x4f2b94={'where':_0x47e1be['where']};return db['ContactItemType']['count'](_0x4f2b94)['then'](function(_0x120585){_0x106d3a[_0xab44('0x1d')]=_0x120585;if(_0x43a42d[_0xab44('0x30')][_0xab44('0x41')]){_0x47e1be[_0xab44('0x42')]=[{'all':!![]}];}return db[_0xab44('0x29')][_0xab44('0x43')](_0x47e1be);})[_0xab44('0x23')](function(_0x4429e6){_0x106d3a[_0xab44('0x44')]=_0x4429e6;return _0x106d3a;})['then'](respondWithFilteredResult(_0x36f9b6,_0x47e1be))[_0xab44('0x45')](handleError(_0x36f9b6,null));};exports[_0xab44('0x46')]=function(_0x3cb9fc,_0x9a6da5){var _0x54f603={'raw':!![],'where':{'id':_0x3cb9fc[_0xab44('0x47')]['id']}},_0x3e9a79={};_0x3e9a79[_0xab44('0x2e')]=_[_0xab44('0x31')](db[_0xab44('0x29')][_0xab44('0x2a')]);_0x3e9a79['query']=_['keys'](_0x3cb9fc[_0xab44('0x30')]);_0x3e9a79[_0xab44('0x32')]=_[_0xab44('0x33')](_0x3e9a79[_0xab44('0x2e')],_0x3e9a79[_0xab44('0x30')]);_0x54f603['attributes']=_[_0xab44('0x33')](_0x3e9a79[_0xab44('0x2e')],qs[_0xab44('0x35')](_0x3cb9fc[_0xab44('0x30')]['fields']));_0x54f603[_0xab44('0x34')]=_0x54f603[_0xab44('0x34')][_0xab44('0x36')]?_0x54f603['attributes']:_0x3e9a79[_0xab44('0x2e')];if(_0x3cb9fc[_0xab44('0x30')][_0xab44('0x41')]){_0x54f603[_0xab44('0x42')]=[{'all':!![]}];}_0x54f603=_['merge']({},_0x54f603,_0x3cb9fc[_0xab44('0x40')]);return db['ContactItemType'][_0xab44('0x48')](_0x54f603)[_0xab44('0x23')](handleEntityNotFound(_0x9a6da5,null))[_0xab44('0x23')](respondWithResult(_0x9a6da5,null))[_0xab44('0x45')](handleError(_0x9a6da5,null));};exports['create']=function(_0x328891,_0x5497a3){return db[_0xab44('0x29')][_0xab44('0x49')](_0x328891[_0xab44('0x4a')],{})[_0xab44('0x23')](function(_0x14bd54){var _0x4eeef0=_0x328891[_0xab44('0x4b')]['get']({'plain':!![]});if(!_0x4eeef0)throw new Error(_0xab44('0x4c'));if(_0x4eeef0[_0xab44('0x4d')]===_0xab44('0x4b')){var _0x50b705=_0x14bd54[_0xab44('0x4e')]({'plain':!![]});var _0x105a89=_0xab44('0x4f');return db[_0xab44('0x50')][_0xab44('0x48')]({'where':{'name':_0x105a89,'userProfileId':_0x4eeef0['userProfileId']},'raw':!![]})['then'](function(_0xe5302b){if(_0xe5302b&&_0xe5302b[_0xab44('0x51')]===0x0){return db[_0xab44('0x24')]['create']({'name':_0x50b705[_0xab44('0x27')],'resourceId':_0x50b705['id'],'type':_0xe5302b[_0xab44('0x27')],'sectionId':_0xe5302b['id']},{})[_0xab44('0x23')](function(){return _0x14bd54;});}else{return _0x14bd54;}})[_0xab44('0x45')](function(_0x4eb2eb){logger['error'](_0xab44('0x52'),_0x4eb2eb);throw _0x4eb2eb;});}return _0x14bd54;})[_0xab44('0x23')](respondWithResult(_0x5497a3,0xc9))[_0xab44('0x45')](handleError(_0x5497a3,null));};exports[_0xab44('0x22')]=function(_0x109f38,_0x2234c0){if(_0x109f38[_0xab44('0x4a')]['id']){delete _0x109f38[_0xab44('0x4a')]['id'];}return db['ContactItemType']['find']({'where':{'id':_0x109f38[_0xab44('0x47')]['id']}})[_0xab44('0x23')](handleEntityNotFound(_0x2234c0,null))[_0xab44('0x23')](saveUpdates(_0x109f38[_0xab44('0x4a')],null))[_0xab44('0x23')](respondWithResult(_0x2234c0,null))[_0xab44('0x45')](handleError(_0x2234c0,null));};exports[_0xab44('0x53')]=function(_0x411bac,_0x1e606b){return db['ContactItemType'][_0xab44('0x48')]({'where':{'id':_0x411bac[_0xab44('0x47')]['id']}})[_0xab44('0x23')](handleEntityNotFound(_0x1e606b,null))[_0xab44('0x23')](db[_0xab44('0x54')][_0xab44('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x411bac[_0xab44('0x47')]['id']}}))[_0xab44('0x23')](removeEntity(_0x1e606b,null))['catch'](handleError(_0x1e606b,null));}; \ No newline at end of file +var _0x1399=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','count','findAll','rows','show','rawAttributes','includeAll','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','ContactItemTypes','UserProfileResource','sendStatus','error','stack','name','send','index','map','ContactItemType','fieldName'];(function(_0x1b6d4a,_0x2d0bdc){var _0x55e0c4=function(_0x59c1d5){while(--_0x59c1d5){_0x1b6d4a['push'](_0x1b6d4a['shift']());}};_0x55e0c4(++_0x2d0bdc);}(_0x1399,0x16c));var _0x9139=function(_0x151002,_0x1c9af6){_0x151002=_0x151002-0x0;var _0x1a7a58=_0x1399[_0x151002];return _0x1a7a58;};'use strict';var emlformat=require(_0x9139('0x0'));var rimraf=require(_0x9139('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9139('0x2'));var rp=require('request-promise');var moment=require(_0x9139('0x3'));var BPromise=require(_0x9139('0x4'));var Mustache=require(_0x9139('0x5'));var util=require(_0x9139('0x6'));var path=require(_0x9139('0x7'));var sox=require(_0x9139('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9139('0x9'));var _=require(_0x9139('0xa'));var squel=require(_0x9139('0xb'));var crypto=require('crypto');var jsforce=require(_0x9139('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9139('0xd'));var Papa=require(_0x9139('0xe'));var Redis=require('ioredis');var authService=require(_0x9139('0xf'));var qs=require(_0x9139('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9139('0x11'))(_0x9139('0x12'));var utils=require(_0x9139('0x13'));var config=require(_0x9139('0x14'));var licenseUtil=require(_0x9139('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52b32d,_0x511ec9){_0x511ec9=_0x511ec9||0xcc;return function(_0x417637){if(_0x417637){return _0x52b32d['sendStatus'](_0x511ec9);}return _0x52b32d[_0x9139('0x16')](_0x511ec9)[_0x9139('0x17')]();};}function respondWithResult(_0x375ada,_0x262009){_0x262009=_0x262009||0xc8;return function(_0x5936d2){if(_0x5936d2){return _0x375ada[_0x9139('0x16')](_0x262009)['json'](_0x5936d2);}};}function respondWithFilteredResult(_0x58307f,_0x52c57b){return function(_0x159e50){if(_0x159e50){var _0x3e2bad=typeof _0x52c57b[_0x9139('0x18')]===_0x9139('0x19')&&typeof _0x52c57b[_0x9139('0x1a')]===_0x9139('0x19');var _0x4bd957=_0x159e50['count'];var _0x13cab8=_0x3e2bad?0x0:_0x52c57b[_0x9139('0x18')];var _0x5e0a59=_0x3e2bad?_0x159e50['count']:_0x52c57b[_0x9139('0x18')]+_0x52c57b[_0x9139('0x1a')];var _0x56add4;if(_0x5e0a59>=_0x4bd957){_0x5e0a59=_0x4bd957;_0x56add4=0xc8;}else{_0x56add4=0xce;}_0x58307f[_0x9139('0x16')](_0x56add4);return _0x58307f[_0x9139('0x1b')](_0x9139('0x1c'),_0x13cab8+'-'+_0x5e0a59+'/'+_0x4bd957)[_0x9139('0x1d')](_0x159e50);}return null;};}function patchUpdates(_0xd2eb33){return function(_0x6f901b){try{jsonpatch[_0x9139('0x1e')](_0x6f901b,_0xd2eb33,!![]);}catch(_0x45fa16){return BPromise[_0x9139('0x1f')](_0x45fa16);}return _0x6f901b[_0x9139('0x20')]();};}function saveUpdates(_0x1bac18,_0x269f8a){return function(_0x5a3e2e){if(_0x5a3e2e){return _0x5a3e2e[_0x9139('0x21')](_0x1bac18)[_0x9139('0x22')](function(_0x31635a){return _0x31635a;});}return null;};}function removeEntity(_0x1aee3b,_0x934732){return function(_0x1a7350){if(_0x1a7350){return _0x1a7350['destroy']()[_0x9139('0x22')](function(){var _0x31c22d=_0x1a7350['get']({'plain':!![]});var _0x3ed4da=_0x9139('0x23');return db[_0x9139('0x24')]['destroy']({'where':{'type':_0x3ed4da,'resourceId':_0x31c22d['id']}})[_0x9139('0x22')](function(){return _0x1a7350;});})[_0x9139('0x22')](function(){_0x1aee3b['status'](0xcc)[_0x9139('0x17')]();});}};}function handleEntityNotFound(_0x39e8cf,_0x452d9a){return function(_0x55e95f){if(!_0x55e95f){_0x39e8cf[_0x9139('0x25')](0x194);}return _0x55e95f;};}function handleError(_0x22e11e,_0x2a35fd){_0x2a35fd=_0x2a35fd||0x1f4;return function(_0x22994c){logger[_0x9139('0x26')](_0x22994c[_0x9139('0x27')]);if(_0x22994c[_0x9139('0x28')]){delete _0x22994c['name'];}_0x22e11e['status'](_0x2a35fd)[_0x9139('0x29')](_0x22994c);};}exports[_0x9139('0x2a')]=function(_0xd27355,_0x4c1693){var _0x50d545={},_0x24e8d5={},_0x2118a2={'count':0x0,'rows':[]};var _0x2dff49=_[_0x9139('0x2b')](db[_0x9139('0x2c')]['rawAttributes'],function(_0x5a1673){return{'name':_0x5a1673[_0x9139('0x2d')],'type':_0x5a1673['type']['key']};});_0x24e8d5[_0x9139('0x2e')]=_[_0x9139('0x2b')](_0x2dff49,'name');_0x24e8d5[_0x9139('0x2f')]=_[_0x9139('0x30')](_0xd27355['query']);_0x24e8d5[_0x9139('0x31')]=_[_0x9139('0x32')](_0x24e8d5[_0x9139('0x2e')],_0x24e8d5[_0x9139('0x2f')]);_0x50d545[_0x9139('0x33')]=_[_0x9139('0x32')](_0x24e8d5[_0x9139('0x2e')],qs[_0x9139('0x34')](_0xd27355[_0x9139('0x2f')][_0x9139('0x34')]));_0x50d545[_0x9139('0x33')]=_0x50d545['attributes'][_0x9139('0x35')]?_0x50d545[_0x9139('0x33')]:_0x24e8d5['model'];if(!_0xd27355[_0x9139('0x2f')][_0x9139('0x36')](_0x9139('0x37'))){_0x50d545['limit']=qs[_0x9139('0x1a')](_0xd27355[_0x9139('0x2f')][_0x9139('0x1a')]);_0x50d545[_0x9139('0x18')]=qs[_0x9139('0x18')](_0xd27355[_0x9139('0x2f')][_0x9139('0x18')]);}_0x50d545[_0x9139('0x38')]=qs[_0x9139('0x39')](_0xd27355[_0x9139('0x2f')]['sort']);_0x50d545[_0x9139('0x3a')]=qs[_0x9139('0x31')](_[_0x9139('0x3b')](_0xd27355[_0x9139('0x2f')],_0x24e8d5[_0x9139('0x31')]),_0x2dff49);if(_0xd27355[_0x9139('0x2f')][_0x9139('0x3c')]){_0x50d545['where']=_[_0x9139('0x3d')](_0x50d545['where'],{'$or':_[_0x9139('0x2b')](_0x2dff49,function(_0x11789e){if(_0x11789e[_0x9139('0x3e')]!=='VIRTUAL'){var _0x1228b6={};_0x1228b6[_0x11789e[_0x9139('0x28')]]={'$like':'%'+_0xd27355[_0x9139('0x2f')][_0x9139('0x3c')]+'%'};return _0x1228b6;}})});}_0x50d545=_[_0x9139('0x3d')]({},_0x50d545,_0xd27355[_0x9139('0x3f')]);var _0x3c98a4={'where':_0x50d545[_0x9139('0x3a')]};return db[_0x9139('0x2c')][_0x9139('0x40')](_0x3c98a4)['then'](function(_0xf14393){_0x2118a2[_0x9139('0x40')]=_0xf14393;if(_0xd27355[_0x9139('0x2f')]['includeAll']){_0x50d545['include']=[{'all':!![]}];}return db['ContactItemType'][_0x9139('0x41')](_0x50d545);})[_0x9139('0x22')](function(_0x3611b4){_0x2118a2[_0x9139('0x42')]=_0x3611b4;return _0x2118a2;})[_0x9139('0x22')](respondWithFilteredResult(_0x4c1693,_0x50d545))['catch'](handleError(_0x4c1693,null));};exports[_0x9139('0x43')]=function(_0x2f3ed4,_0x40fd52){var _0xf81f77={'raw':!![],'where':{'id':_0x2f3ed4['params']['id']}},_0x2197ff={};_0x2197ff[_0x9139('0x2e')]=_[_0x9139('0x30')](db[_0x9139('0x2c')][_0x9139('0x44')]);_0x2197ff['query']=_['keys'](_0x2f3ed4[_0x9139('0x2f')]);_0x2197ff[_0x9139('0x31')]=_['intersection'](_0x2197ff['model'],_0x2197ff[_0x9139('0x2f')]);_0xf81f77[_0x9139('0x33')]=_['intersection'](_0x2197ff[_0x9139('0x2e')],qs[_0x9139('0x34')](_0x2f3ed4['query'][_0x9139('0x34')]));_0xf81f77['attributes']=_0xf81f77['attributes'][_0x9139('0x35')]?_0xf81f77[_0x9139('0x33')]:_0x2197ff[_0x9139('0x2e')];if(_0x2f3ed4[_0x9139('0x2f')][_0x9139('0x45')]){_0xf81f77['include']=[{'all':!![]}];}_0xf81f77=_[_0x9139('0x3d')]({},_0xf81f77,_0x2f3ed4[_0x9139('0x3f')]);return db[_0x9139('0x2c')]['find'](_0xf81f77)[_0x9139('0x22')](handleEntityNotFound(_0x40fd52,null))[_0x9139('0x22')](respondWithResult(_0x40fd52,null))[_0x9139('0x46')](handleError(_0x40fd52,null));};exports[_0x9139('0x47')]=function(_0x215793,_0x31395f){return db[_0x9139('0x2c')][_0x9139('0x47')](_0x215793[_0x9139('0x48')],{})[_0x9139('0x22')](function(_0x2da28c){var _0x54c926=_0x215793[_0x9139('0x49')][_0x9139('0x4a')]({'plain':!![]});if(!_0x54c926)throw new Error(_0x9139('0x4b'));if(_0x54c926['role']===_0x9139('0x49')){var _0x46f77a=_0x2da28c['get']({'plain':!![]});var _0x2f4a6f=_0x9139('0x23');return db[_0x9139('0x4c')]['find']({'where':{'name':_0x2f4a6f,'userProfileId':_0x54c926[_0x9139('0x4d')]},'raw':!![]})[_0x9139('0x22')](function(_0x1404ce){if(_0x1404ce&&_0x1404ce[_0x9139('0x4e')]===0x0){return db['UserProfileResource'][_0x9139('0x47')]({'name':_0x46f77a[_0x9139('0x28')],'resourceId':_0x46f77a['id'],'type':_0x1404ce[_0x9139('0x28')],'sectionId':_0x1404ce['id']},{})['then'](function(){return _0x2da28c;});}else{return _0x2da28c;}})[_0x9139('0x46')](function(_0x146201){logger[_0x9139('0x26')](_0x9139('0x4f'),_0x146201);throw _0x146201;});}return _0x2da28c;})[_0x9139('0x22')](respondWithResult(_0x31395f,0xc9))[_0x9139('0x46')](handleError(_0x31395f,null));};exports[_0x9139('0x21')]=function(_0x5857bf,_0x35002d){if(_0x5857bf[_0x9139('0x48')]['id']){delete _0x5857bf['body']['id'];}return db[_0x9139('0x2c')][_0x9139('0x50')]({'where':{'id':_0x5857bf[_0x9139('0x51')]['id']}})[_0x9139('0x22')](handleEntityNotFound(_0x35002d,null))[_0x9139('0x22')](saveUpdates(_0x5857bf['body'],null))[_0x9139('0x22')](respondWithResult(_0x35002d,null))[_0x9139('0x46')](handleError(_0x35002d,null));};exports['destroy']=function(_0x500863,_0x212d56){return db[_0x9139('0x2c')][_0x9139('0x50')]({'where':{'id':_0x500863['params']['id']}})[_0x9139('0x22')](handleEntityNotFound(_0x212d56,null))['then'](db['CmContactHasItem'][_0x9139('0x21')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x500863[_0x9139('0x51')]['id']}}))[_0x9139('0x22')](removeEntity(_0x212d56,null))[_0x9139('0x46')](handleError(_0x212d56,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 0f026c7..3674f5d 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9f3=['path','rimraf','../../config/environment','./contactItemType.attributes','ContactItemType','tools_contact_item_types','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4e30c0,_0x534a76){var _0x5db594=function(_0x1832e7){while(--_0x1832e7){_0x4e30c0['push'](_0x4e30c0['shift']());}};_0x5db594(++_0x534a76);}(_0xa9f3,0x186));var _0x3a9f=function(_0x53ddbb,_0x3d5ef1){_0x53ddbb=_0x53ddbb-0x0;var _0x96de71=_0xa9f3[_0x53ddbb];return _0x96de71;};'use strict';var _=require(_0x3a9f('0x0'));var util=require('util');var logger=require(_0x3a9f('0x1'))(_0x3a9f('0x2'));var moment=require(_0x3a9f('0x3'));var BPromise=require(_0x3a9f('0x4'));var rp=require(_0x3a9f('0x5'));var fs=require('fs');var path=require(_0x3a9f('0x6'));var rimraf=require(_0x3a9f('0x7'));var config=require(_0x3a9f('0x8'));var attributes=require(_0x3a9f('0x9'));module['exports']=function(_0xfec7bc,_0x390be8){return _0xfec7bc['define'](_0x3a9f('0xa'),attributes,{'tableName':_0x3a9f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc222=['util','moment','bluebird','rimraf','../../config/environment','exports','ContactItemType','tools_contact_item_types','lodash'];(function(_0x1c2c21,_0x44c147){var _0x359c41=function(_0x4c8207){while(--_0x4c8207){_0x1c2c21['push'](_0x1c2c21['shift']());}};_0x359c41(++_0x44c147);}(_0xc222,0x194));var _0x2c22=function(_0x48f4fb,_0x2d5e58){_0x48f4fb=_0x48f4fb-0x0;var _0x47e4cf=_0xc222[_0x48f4fb];return _0x47e4cf;};'use strict';var _=require(_0x2c22('0x0'));var util=require(_0x2c22('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2c22('0x2'));var BPromise=require(_0x2c22('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2c22('0x4'));var config=require(_0x2c22('0x5'));var attributes=require('./contactItemType.attributes');module[_0x2c22('0x6')]=function(_0x2f7b5c,_0xf3cee0){return _0x2f7b5c['define'](_0x2c22('0x7'),attributes,{'tableName':_0x2c22('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 35162e5..e61f215 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe0e2=['http','request','then','ContactItemType,\x20%s,\x20%s','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','rpc','../../config/environment','client'];(function(_0x44618e,_0x3f5074){var _0x4bb4dd=function(_0x20c1b8){while(--_0x20c1b8){_0x44618e['push'](_0x44618e['shift']());}};_0x4bb4dd(++_0x3f5074);}(_0xe0e2,0x13c));var _0x2e0e=function(_0x2cd061,_0x3fde39){_0x2cd061=_0x2cd061-0x0;var _0xee1f5f=_0xe0e2[_0x2cd061];return _0xee1f5f;};'use strict';var _=require(_0x2e0e('0x0'));var util=require('util');var moment=require(_0x2e0e('0x1'));var BPromise=require('bluebird');var rs=require(_0x2e0e('0x2'));var fs=require('fs');var Redis=require(_0x2e0e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2e0e('0x4'));var config=require(_0x2e0e('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2e0e('0x6')][_0x2e0e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x26449f,_0x53a5d7,_0x1a72ca){return new BPromise(function(_0x17b427,_0x1e1c2a){return client[_0x2e0e('0x8')](_0x26449f,_0x1a72ca)[_0x2e0e('0x9')](function(_0x47b2dc){logger['info'](_0x2e0e('0xa'),_0x53a5d7,'request\x20sent');logger['debug'](_0x2e0e('0xb'),_0x53a5d7,_0x2e0e('0xc'),JSON['stringify'](_0x47b2dc));if(_0x47b2dc['error']){if(_0x47b2dc[_0x2e0e('0xd')][_0x2e0e('0xe')]===0x1f4){logger[_0x2e0e('0xd')](_0x2e0e('0xa'),_0x53a5d7,_0x47b2dc[_0x2e0e('0xd')][_0x2e0e('0xf')]);return _0x1e1c2a(_0x47b2dc[_0x2e0e('0xd')][_0x2e0e('0xf')]);}logger['error']('ContactItemType,\x20%s,\x20%s',_0x53a5d7,_0x47b2dc[_0x2e0e('0xd')][_0x2e0e('0xf')]);return _0x17b427(_0x47b2dc[_0x2e0e('0xd')][_0x2e0e('0xf')]);}else{logger[_0x2e0e('0x10')](_0x2e0e('0xa'),_0x53a5d7,_0x2e0e('0xc'));_0x17b427(_0x47b2dc[_0x2e0e('0x11')][_0x2e0e('0xf')]);}})[_0x2e0e('0x12')](function(_0x518d13){logger[_0x2e0e('0xd')]('ContactItemType,\x20%s,\x20%s',_0x53a5d7,_0x518d13);_0x1e1c2a(_0x518d13);});});} \ No newline at end of file +var _0x766f=['then','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','request'];(function(_0x1b34dc,_0x514cf8){var _0x136e3e=function(_0x191c5a){while(--_0x191c5a){_0x1b34dc['push'](_0x1b34dc['shift']());}};_0x136e3e(++_0x514cf8);}(_0x766f,0x14f));var _0xf766=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x766f[_0x500419];return _0x241c1a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf766('0x0'));var fs=require('fs');var Redis=require(_0xf766('0x1'));var db=require(_0xf766('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf766('0x3'));var config=require(_0xf766('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf766('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2284f8,_0x1d394d,_0x4e283a){return new BPromise(function(_0x3c48b1,_0x577129){return client[_0xf766('0x6')](_0x2284f8,_0x4e283a)[_0xf766('0x7')](function(_0x59142d){logger['info'](_0xf766('0x8'),_0x1d394d,_0xf766('0x9'));logger[_0xf766('0xa')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x1d394d,_0xf766('0x9'),JSON[_0xf766('0xb')](_0x59142d));if(_0x59142d[_0xf766('0xc')]){if(_0x59142d[_0xf766('0xc')][_0xf766('0xd')]===0x1f4){logger[_0xf766('0xc')](_0xf766('0x8'),_0x1d394d,_0x59142d[_0xf766('0xc')]['message']);return _0x577129(_0x59142d['error'][_0xf766('0xe')]);}logger[_0xf766('0xc')](_0xf766('0x8'),_0x1d394d,_0x59142d[_0xf766('0xc')][_0xf766('0xe')]);return _0x3c48b1(_0x59142d['error'][_0xf766('0xe')]);}else{logger[_0xf766('0xf')](_0xf766('0x8'),_0x1d394d,'request\x20sent');_0x3c48b1(_0x59142d[_0xf766('0x10')]['message']);}})[_0xf766('0x11')](function(_0x19350d){logger[_0xf766('0xc')](_0xf766('0x8'),_0x1d394d,_0x19350d);_0x577129(_0x19350d);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index bdf867d..556d06e 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33ec=['../../components/interaction/service','./contactItemType.controller','get','isAuthenticated','post','create','/:id','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x191b8c,_0x6cc2e){var _0x1f231b=function(_0x339ee9){while(--_0x339ee9){_0x191b8c['push'](_0x191b8c['shift']());}};_0x1f231b(++_0x6cc2e);}(_0x33ec,0x1b3));var _0xc33e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x33ec[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc33e('0x0'));var util=require(_0xc33e('0x1'));var path=require(_0xc33e('0x2'));var timeout=require('connect-timeout');var express=require(_0xc33e('0x3'));var router=express[_0xc33e('0x4')]();var fs_extra=require(_0xc33e('0x5'));var auth=require(_0xc33e('0x6'));var interaction=require(_0xc33e('0x7'));var config=require('../../config/environment');var controller=require(_0xc33e('0x8'));router[_0xc33e('0x9')]('/',auth[_0xc33e('0xa')](),controller['index']);router[_0xc33e('0x9')]('/:id',auth[_0xc33e('0xa')](),controller['show']);router[_0xc33e('0xb')]('/',auth[_0xc33e('0xa')](),controller[_0xc33e('0xc')]);router['put'](_0xc33e('0xd'),auth[_0xc33e('0xa')](),controller[_0xc33e('0xe')]);router[_0xc33e('0xf')](_0xc33e('0xd'),auth[_0xc33e('0xa')](),controller[_0xc33e('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4c7a=['path','express','Router','fs-extra','../../components/interaction/service','./contactItemType.controller','get','/:id','isAuthenticated','put','exports','multer','util'];(function(_0x31f5ec,_0x4106ee){var _0x44eee0=function(_0x21bc95){while(--_0x21bc95){_0x31f5ec['push'](_0x31f5ec['shift']());}};_0x44eee0(++_0x4106ee);}(_0x4c7a,0x19e));var _0xa4c7=function(_0x4eb179,_0x311360){_0x4eb179=_0x4eb179-0x0;var _0x547d07=_0x4c7a[_0x4eb179];return _0x547d07;};'use strict';var multer=require(_0xa4c7('0x0'));var util=require(_0xa4c7('0x1'));var path=require(_0xa4c7('0x2'));var timeout=require('connect-timeout');var express=require(_0xa4c7('0x3'));var router=express[_0xa4c7('0x4')]();var fs_extra=require(_0xa4c7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa4c7('0x6'));var config=require('../../config/environment');var controller=require(_0xa4c7('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xa4c7('0x8')](_0xa4c7('0x9'),auth[_0xa4c7('0xa')](),controller['show']);router['post']('/',auth[_0xa4c7('0xa')](),controller['create']);router[_0xa4c7('0xb')](_0xa4c7('0x9'),auth[_0xa4c7('0xa')](),controller['update']);router['delete'](_0xa4c7('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xa4c7('0xc')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index a1d97bd..09672d3 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['name','exports','STRING'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x5c35f1,_0x4a72b4){var _0x53e5b5=function(_0x3bdb78){while(--_0x3bdb78){_0x5c35f1['push'](_0x5c35f1['shift']());}};_0x53e5b5(++_0x4a72b4);}(_0x757a,0xde));var _0xa757=function(_0x54ed8f,_0x55782c){_0x54ed8f=_0x54ed8f-0x0;var _0x408c0d=_0x757a[_0x54ed8f];return _0x408c0d;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index b2e36f5..cd62630 100644 --- a/server/api/dashboard/dashboard.controller.js +++ b/server/api/dashboard/dashboard.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x741f=['attrRefresh','widgetAttributes:\x20%s','stringify','getItems','DashboardItem','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','keys','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','update','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType'];(function(_0x4a6379,_0x2ce744){var _0x5a99d4=function(_0x404e99){while(--_0x404e99){_0x4a6379['push'](_0x4a6379['shift']());}};_0x5a99d4(++_0x2ce744);}(_0x741f,0x82));var _0xf741=function(_0x5e96fe,_0x40b644){_0x5e96fe=_0x5e96fe-0x0;var _0x26e8cc=_0x741f[_0x5e96fe];return _0x26e8cc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf741('0x0'));var zipdir=require(_0xf741('0x1'));var jsonpatch=require(_0xf741('0x2'));var rp=require(_0xf741('0x3'));var moment=require(_0xf741('0x4'));var BPromise=require(_0xf741('0x5'));var Mustache=require(_0xf741('0x6'));var util=require(_0xf741('0x7'));var path=require(_0xf741('0x8'));var sox=require(_0xf741('0x9'));var csv=require(_0xf741('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf741('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf741('0xc'));var jsforce=require(_0xf741('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf741('0xa'));var querystring=require(_0xf741('0xe'));var Papa=require('papaparse');var Redis=require(_0xf741('0xf'));var authService=require(_0xf741('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf741('0x11'));var logger=require(_0xf741('0x12'))(_0xf741('0x13'));var utils=require(_0xf741('0x14'));var config=require(_0xf741('0x15'));var licenseUtil=require(_0xf741('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf741('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf741('0x18')]));require(_0xf741('0x19'))[_0xf741('0x1a')](socket);function respondWithStatusCode(_0x58dd27,_0x323e9a){_0x323e9a=_0x323e9a||0xcc;return function(_0x49581b){if(_0x49581b){return _0x58dd27[_0xf741('0x1b')](_0x323e9a);}return _0x58dd27[_0xf741('0x1c')](_0x323e9a)[_0xf741('0x1d')]();};}function respondWithResult(_0x52e318,_0x29f8dc){_0x29f8dc=_0x29f8dc||0xc8;return function(_0x40b769){if(_0x40b769){return _0x52e318['status'](_0x29f8dc)[_0xf741('0x1e')](_0x40b769);}};}function respondWithFilteredResult(_0x3c110c,_0x20a6a3){return function(_0x1141c8){if(_0x1141c8){var _0xe6bd2a=typeof _0x20a6a3[_0xf741('0x1f')]===_0xf741('0x20')&&typeof _0x20a6a3[_0xf741('0x21')]===_0xf741('0x20');var _0x53970b=_0x1141c8[_0xf741('0x22')];var _0x1d2ab1=_0xe6bd2a?0x0:_0x20a6a3['offset'];var _0x281ac5=_0xe6bd2a?_0x1141c8['count']:_0x20a6a3['offset']+_0x20a6a3[_0xf741('0x21')];var _0x57d68b;if(_0x281ac5>=_0x53970b){_0x281ac5=_0x53970b;_0x57d68b=0xc8;}else{_0x57d68b=0xce;}_0x3c110c[_0xf741('0x1c')](_0x57d68b);return _0x3c110c[_0xf741('0x23')]('Content-Range',_0x1d2ab1+'-'+_0x281ac5+'/'+_0x53970b)[_0xf741('0x1e')](_0x1141c8);}return null;};}function patchUpdates(_0x4b3102){return function(_0x21d17d){try{jsonpatch[_0xf741('0x24')](_0x21d17d,_0x4b3102,!![]);}catch(_0x1bf922){return BPromise[_0xf741('0x25')](_0x1bf922);}return _0x21d17d[_0xf741('0x26')]();};}function saveUpdates(_0x1d8ad5,_0x5dd94c){return function(_0x3c7a23){if(_0x3c7a23){return _0x3c7a23['update'](_0x1d8ad5)[_0xf741('0x27')](function(_0x307a97){return _0x307a97;});}return null;};}function removeEntity(_0x292ee6,_0x2b0ee5){return function(_0x90c12d){if(_0x90c12d){return _0x90c12d[_0xf741('0x28')]()[_0xf741('0x27')](function(){var _0x5eaf14=_0x90c12d[_0xf741('0x29')]({'plain':!![]});var _0x1852af=_0xf741('0x2a');return db[_0xf741('0x2b')]['destroy']({'where':{'type':_0x1852af,'resourceId':_0x5eaf14['id']}})[_0xf741('0x27')](function(){return _0x90c12d;});})[_0xf741('0x27')](function(){_0x292ee6[_0xf741('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23f829,_0x5894c0){return function(_0x8e9f8c){if(!_0x8e9f8c){_0x23f829[_0xf741('0x1b')](0x194);}return _0x8e9f8c;};}function handleError(_0x3dbfca,_0x14c5f1){_0x14c5f1=_0x14c5f1||0x1f4;return function(_0x49f778){logger[_0xf741('0x2c')](_0x49f778[_0xf741('0x2d')]);if(_0x49f778[_0xf741('0x2e')]){delete _0x49f778[_0xf741('0x2e')];}_0x3dbfca['status'](_0x14c5f1)['send'](_0x49f778);};}exports[_0xf741('0x2f')]=function(_0x55d640,_0x3b758e){var _0x4aa080={},_0x4c46e0={},_0x195731={'count':0x0,'rows':[]};var _0x5e8742=_[_0xf741('0x30')](db[_0xf741('0x31')][_0xf741('0x32')],function(_0xf24227){return{'name':_0xf24227[_0xf741('0x33')],'type':_0xf24227[_0xf741('0x34')]['key']};});_0x4c46e0[_0xf741('0x35')]=_[_0xf741('0x30')](_0x5e8742,_0xf741('0x2e'));_0x4c46e0[_0xf741('0x36')]=_['keys'](_0x55d640[_0xf741('0x36')]);_0x4c46e0[_0xf741('0x37')]=_['intersection'](_0x4c46e0[_0xf741('0x35')],_0x4c46e0[_0xf741('0x36')]);_0x4aa080[_0xf741('0x38')]=_[_0xf741('0x39')](_0x4c46e0['model'],qs[_0xf741('0x3a')](_0x55d640[_0xf741('0x36')][_0xf741('0x3a')]));_0x4aa080[_0xf741('0x38')]=_0x4aa080[_0xf741('0x38')][_0xf741('0x3b')]?_0x4aa080[_0xf741('0x38')]:_0x4c46e0[_0xf741('0x35')];if(!_0x55d640[_0xf741('0x36')][_0xf741('0x3c')](_0xf741('0x3d'))){_0x4aa080['limit']=qs[_0xf741('0x21')](_0x55d640[_0xf741('0x36')][_0xf741('0x21')]);_0x4aa080[_0xf741('0x1f')]=qs['offset'](_0x55d640['query'][_0xf741('0x1f')]);}_0x4aa080[_0xf741('0x3e')]=qs['sort'](_0x55d640[_0xf741('0x36')][_0xf741('0x3f')]);_0x4aa080[_0xf741('0x40')]=qs['filters'](_[_0xf741('0x41')](_0x55d640[_0xf741('0x36')],_0x4c46e0[_0xf741('0x37')]),_0x5e8742);if(_0x55d640[_0xf741('0x36')][_0xf741('0x42')]){_0x4aa080[_0xf741('0x40')]=_[_0xf741('0x43')](_0x4aa080[_0xf741('0x40')],{'$or':_['map'](_0x5e8742,function(_0x5d0e35){if(_0x5d0e35[_0xf741('0x34')]!==_0xf741('0x44')){var _0x1626e7={};_0x1626e7[_0x5d0e35['name']]={'$like':'%'+_0x55d640[_0xf741('0x36')][_0xf741('0x42')]+'%'};return _0x1626e7;}})});}_0x4aa080=_[_0xf741('0x43')]({},_0x4aa080,_0x55d640[_0xf741('0x45')]);var _0x5f19fc={'where':_0x4aa080[_0xf741('0x40')]};return db[_0xf741('0x31')]['count'](_0x5f19fc)[_0xf741('0x27')](function(_0x1bb88c){_0x195731['count']=_0x1bb88c;if(_0x55d640[_0xf741('0x36')]['includeAll']){_0x4aa080[_0xf741('0x46')]=[{'all':!![]}];}return db[_0xf741('0x31')][_0xf741('0x47')](_0x4aa080);})[_0xf741('0x27')](function(_0x285163){_0x195731[_0xf741('0x48')]=_0x285163;return _0x195731;})[_0xf741('0x27')](respondWithFilteredResult(_0x3b758e,_0x4aa080))['catch'](handleError(_0x3b758e,null));};exports['show']=function(_0x2f93d9,_0x918dc2){var _0xfce6ab={'raw':![],'where':{'id':_0x2f93d9[_0xf741('0x49')]['id']}},_0xe2913d={};_0xe2913d[_0xf741('0x35')]=_[_0xf741('0x4a')](db['Dashboard'][_0xf741('0x32')]);_0xe2913d['query']=_[_0xf741('0x4a')](_0x2f93d9[_0xf741('0x36')]);_0xe2913d['filters']=_[_0xf741('0x39')](_0xe2913d[_0xf741('0x35')],_0xe2913d['query']);_0xfce6ab[_0xf741('0x38')]=_[_0xf741('0x39')](_0xe2913d[_0xf741('0x35')],qs[_0xf741('0x3a')](_0x2f93d9[_0xf741('0x36')][_0xf741('0x3a')]));_0xfce6ab['attributes']=_0xfce6ab[_0xf741('0x38')][_0xf741('0x3b')]?_0xfce6ab['attributes']:_0xe2913d['model'];if(_0x2f93d9[_0xf741('0x36')][_0xf741('0x4b')]){_0xfce6ab[_0xf741('0x46')]=[{'all':!![]}];}_0xfce6ab=_['merge']({},_0xfce6ab,_0x2f93d9['options']);return db[_0xf741('0x31')][_0xf741('0x4c')](_0xfce6ab)[_0xf741('0x27')](handleEntityNotFound(_0x918dc2,null))[_0xf741('0x27')](respondWithResult(_0x918dc2,null))['catch'](handleError(_0x918dc2,null));};exports['create']=function(_0x2666cb,_0x5f1d9d){return db['Dashboard'][_0xf741('0x4d')](_0x2666cb[_0xf741('0x4e')],{})['then'](function(_0x1de2e0){var _0x5076b5=_0x2666cb[_0xf741('0x4f')][_0xf741('0x29')]({'plain':!![]});if(!_0x5076b5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5076b5[_0xf741('0x50')]==='user'){var _0x145316=_0x1de2e0[_0xf741('0x29')]({'plain':!![]});var _0x50683c='CustomDashboards';return db[_0xf741('0x51')]['find']({'where':{'name':_0x50683c,'userProfileId':_0x5076b5[_0xf741('0x52')]},'raw':!![]})[_0xf741('0x27')](function(_0x4c6374){if(_0x4c6374&&_0x4c6374[_0xf741('0x53')]===0x0){return db[_0xf741('0x2b')]['create']({'name':_0x145316[_0xf741('0x2e')],'resourceId':_0x145316['id'],'type':_0x4c6374[_0xf741('0x2e')],'sectionId':_0x4c6374['id']},{})['then'](function(){return _0x1de2e0;});}else{return _0x1de2e0;}})[_0xf741('0x54')](function(_0xc8a79c){logger[_0xf741('0x2c')](_0xf741('0x55'),_0xc8a79c);throw _0xc8a79c;});}return _0x1de2e0;})[_0xf741('0x27')](respondWithResult(_0x5f1d9d,0xc9))['catch'](handleError(_0x5f1d9d,null));};exports[_0xf741('0x56')]=function(_0x320120,_0x3ebfc3){var _0x543ec3={'where':{'id':_0x320120[_0xf741('0x49')]['id']}},_0x35019d={};_0x35019d[_0xf741('0x35')]=_[_0xf741('0x4a')](db['Dashboard'][_0xf741('0x32')]);_0x543ec3[_0xf741('0x38')]=_['intersection'](_0x35019d[_0xf741('0x35')],qs['fields'](_0x320120[_0xf741('0x36')][_0xf741('0x3a')]));_0x543ec3[_0xf741('0x38')]=_0x543ec3[_0xf741('0x38')][_0xf741('0x3b')]?_0x543ec3[_0xf741('0x38')]:_0x35019d[_0xf741('0x35')];if(_0x320120[_0xf741('0x36')][_0xf741('0x4b')]){_0x543ec3[_0xf741('0x46')]=[{'all':!![]}];}_0x543ec3=_[_0xf741('0x43')]({},_0x543ec3,_0x320120[_0xf741('0x45')]);return db[_0xf741('0x31')]['find'](_0x543ec3)[_0xf741('0x27')](handleEntityNotFound(_0x3ebfc3,null))[_0xf741('0x27')](function(_0x437275){if(_0x437275){var _0x55b9ad=_0x437275[_0xf741('0x29')]({'plain':!![]});_0x55b9ad=qs[_0xf741('0x57')](_0x55b9ad,['id',_0xf741('0x58'),_0xf741('0x59')]);_0x320120['body']=_[_0xf741('0x57')](_0x320120[_0xf741('0x4e')],['id','createdAt',_0xf741('0x59')]);return db[_0xf741('0x31')][_0xf741('0x4d')](_[_0xf741('0x43')](_0x55b9ad,_0x320120[_0xf741('0x4e')]),{'include':_0x320120[_0xf741('0x36')]['includeAll']?[{'all':!![]}]:undefined})[_0xf741('0x27')](function(_0x526d04){var _0x1f3f0f=_0x320120[_0xf741('0x4f')][_0xf741('0x29')]({'plain':!![]});if(!_0x1f3f0f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f3f0f[_0xf741('0x50')]===_0xf741('0x4f')){var _0x1f970e=_0x526d04['get']({'plain':!![]});var _0x2c4f64='CustomDashboards';return db[_0xf741('0x51')][_0xf741('0x4c')]({'where':{'name':_0x2c4f64,'userProfileId':_0x1f3f0f[_0xf741('0x52')]},'raw':!![]})[_0xf741('0x27')](function(_0x9b6905){if(_0x9b6905&&_0x9b6905[_0xf741('0x53')]===0x0){return db[_0xf741('0x2b')][_0xf741('0x4d')]({'name':_0x1f970e[_0xf741('0x2e')],'resourceId':_0x1f970e['id'],'type':_0x9b6905[_0xf741('0x2e')],'sectionId':_0x9b6905['id']},{})[_0xf741('0x27')](function(){return _0x526d04;});}else{return _0x526d04;}})[_0xf741('0x54')](function(_0x4a80b6){logger[_0xf741('0x2c')](_0xf741('0x55'),_0x4a80b6);throw _0x4a80b6;});}return _0x526d04;});}})[_0xf741('0x27')](respondWithResult(_0x3ebfc3,0xc9))[_0xf741('0x54')](handleError(_0x3ebfc3,null));};exports[_0xf741('0x5a')]=function(_0x26dc36,_0x3ffae2){if(_0x26dc36[_0xf741('0x4e')]['id']){delete _0x26dc36['body']['id'];}return db['Dashboard'][_0xf741('0x4c')]({'where':{'id':_0x26dc36[_0xf741('0x49')]['id']}})['then'](handleEntityNotFound(_0x3ffae2,null))[_0xf741('0x27')](saveUpdates(_0x26dc36[_0xf741('0x4e')],null))[_0xf741('0x27')](respondWithResult(_0x3ffae2,null))['catch'](handleError(_0x3ffae2,null));};exports[_0xf741('0x28')]=function(_0x4e067e,_0x2e638c){return db[_0xf741('0x31')][_0xf741('0x4c')]({'where':{'id':_0x4e067e[_0xf741('0x49')]['id']}})[_0xf741('0x27')](handleEntityNotFound(_0x2e638c,null))[_0xf741('0x27')](removeEntity(_0x2e638c,null))[_0xf741('0x54')](handleError(_0x2e638c,null));};function widgetAttributes(_0x1cd94d){try{switch(_0x1cd94d[_0xf741('0x34')]){case'iframe':return[{'name':_0xf741('0x5b'),'value':_0x1cd94d[_0xf741('0x5b')]||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d[_0xf741('0x5c')][0x0]?_0x1cd94d[_0xf741('0x5c')][0x0][_0xf741('0x5d')]:undefined)||_0xf741('0x5e')}];case _0xf741('0x5f'):return[{'name':_0xf741('0x60'),'value':_0x1cd94d[_0xf741('0x60')]||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d[_0xf741('0x5c')][0x0]?_0x1cd94d['attrs'][0x0][_0xf741('0x5d')]:undefined)||''}];case _0xf741('0x61'):return[{'name':_0xf741('0x62'),'value':_0x1cd94d['attrHourFormat']||(_0x1cd94d['attrs']&&_0x1cd94d[_0xf741('0x5c')][0x0]?_0x1cd94d[_0xf741('0x5c')][0x0][_0xf741('0x5d')]:undefined)||_0xf741('0x63')},{'name':'attrTimezone','value':_0x1cd94d['attrTimezone']||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d[_0xf741('0x5c')][0x1]?_0x1cd94d[_0xf741('0x5c')][0x1][_0xf741('0x5d')]:undefined)||_0xf741('0x64')},{'name':'attrFontSize','value':_0x1cd94d[_0xf741('0x65')]||(_0x1cd94d['attrs']&&_0x1cd94d[_0xf741('0x5c')][0x2]?_0x1cd94d[_0xf741('0x5c')][0x2][_0xf741('0x5d')]:undefined)||0xc}];case _0xf741('0x66'):return[{'name':_0xf741('0x67'),'value':_0x1cd94d['attrMetric']||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d[_0xf741('0x5c')][0x0]?_0x1cd94d[_0xf741('0x5c')][0x0][_0xf741('0x5d')]:undefined)||_0xf741('0x68')},{'name':'attrVoiceQueues','value':_0x1cd94d[_0xf741('0x69')]||(_0x1cd94d['attrs']&&_0x1cd94d[_0xf741('0x5c')][0x1]?_0x1cd94d[_0xf741('0x5c')][0x1]['value']:undefined)||[]},{'name':_0xf741('0x65'),'value':_0x1cd94d['attrFontSize']||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d['attrs'][0x2]?_0x1cd94d[_0xf741('0x5c')][0x2][_0xf741('0x5d')]:undefined)||0x14},{'name':'attrChannel','value':_0x1cd94d[_0xf741('0x6a')]||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d[_0xf741('0x5c')][0x3]?_0x1cd94d[_0xf741('0x5c')][0x3]['value']:undefined)||_0xf741('0x6b')},{'name':_0xf741('0x6c'),'value':_0x1cd94d[_0xf741('0x6c')]||(_0x1cd94d['attrs']&&_0x1cd94d['attrs'][0x4]?_0x1cd94d[_0xf741('0x5c')][0x4][_0xf741('0x5d')]:undefined)||''},{'name':_0xf741('0x6d'),'value':_0x1cd94d[_0xf741('0x6d')]||(_0x1cd94d['attrs']&&_0x1cd94d[_0xf741('0x5c')][0x5]?_0x1cd94d[_0xf741('0x5c')][0x5][_0xf741('0x5d')]:undefined)||''},{'name':_0xf741('0x6e'),'value':_0x1cd94d['attrSmsAccounts']||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d[_0xf741('0x5c')][0x6]?_0x1cd94d[_0xf741('0x5c')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1cd94d[_0xf741('0x6f')]||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d[_0xf741('0x5c')][0x7]?_0x1cd94d[_0xf741('0x5c')][0x7][_0xf741('0x5d')]:undefined)||''},{'name':_0xf741('0x70'),'value':_0x1cd94d[_0xf741('0x70')]||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d[_0xf741('0x5c')][0x8]?_0x1cd94d[_0xf741('0x5c')][0x8][_0xf741('0x5d')]:undefined)||''},{'name':_0xf741('0x71'),'value':_0x1cd94d[_0xf741('0x71')]||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d['attrs'][0x9]?_0x1cd94d['attrs'][0x9][_0xf741('0x5d')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0xf741('0x72'),'value':_0x1cd94d[_0xf741('0x72')]||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d[_0xf741('0x5c')][0x0]?_0x1cd94d[_0xf741('0x5c')][0x0][_0xf741('0x5d')]:undefined)||_0xf741('0x68')},{'name':_0xf741('0x73'),'value':_0x1cd94d['attrSerie2']||(_0x1cd94d['attrs']&&_0x1cd94d[_0xf741('0x5c')][0x1]?_0x1cd94d[_0xf741('0x5c')][0x1][_0xf741('0x5d')]:undefined)||null},{'name':_0xf741('0x74'),'value':_0x1cd94d[_0xf741('0x74')]||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d[_0xf741('0x5c')][0x2]?_0x1cd94d[_0xf741('0x5c')][0x2]['value']:undefined)||null},{'name':_0xf741('0x69'),'value':_0x1cd94d[_0xf741('0x69')]||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d[_0xf741('0x5c')][0x3]?_0x1cd94d[_0xf741('0x5c')][0x3][_0xf741('0x5d')]:undefined)||[]},{'name':_0xf741('0x6a'),'value':_0x1cd94d[_0xf741('0x6a')]||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d[_0xf741('0x5c')][0x4]?_0x1cd94d[_0xf741('0x5c')][0x4]['value']:undefined)||_0xf741('0x6b')},{'name':_0xf741('0x6c'),'value':_0x1cd94d[_0xf741('0x6c')]||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d[_0xf741('0x5c')][0x5]?_0x1cd94d[_0xf741('0x5c')][0x5][_0xf741('0x5d')]:undefined)||''},{'name':_0xf741('0x6d'),'value':_0x1cd94d[_0xf741('0x6d')]||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d[_0xf741('0x5c')][0x6]?_0x1cd94d[_0xf741('0x5c')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x1cd94d['attrSmsAccounts']||(_0x1cd94d['attrs']&&_0x1cd94d[_0xf741('0x5c')][0x7]?_0x1cd94d['attrs'][0x7][_0xf741('0x5d')]:undefined)||''},{'name':_0xf741('0x6f'),'value':_0x1cd94d[_0xf741('0x6f')]||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d[_0xf741('0x5c')][0x8]?_0x1cd94d['attrs'][0x8][_0xf741('0x5d')]:undefined)||''},{'name':_0xf741('0x70'),'value':_0x1cd94d['attrWhatsappAccounts']||(_0x1cd94d['attrs']&&_0x1cd94d[_0xf741('0x5c')][0x9]?_0x1cd94d[_0xf741('0x5c')][0x9][_0xf741('0x5d')]:undefined)||''},{'name':_0xf741('0x71'),'value':_0x1cd94d[_0xf741('0x71')]||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d[_0xf741('0x5c')][0xa]?_0x1cd94d[_0xf741('0x5c')][0xa][_0xf741('0x5d')]:undefined)||''}];case _0xf741('0x75'):return[{'name':_0xf741('0x76'),'type':_0x1cd94d[_0xf741('0x77')]||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d[_0xf741('0x5c')][0x0]?_0x1cd94d[_0xf741('0x5c')][0x0][_0xf741('0x34')]:undefined)||null,'value':_0x1cd94d[_0xf741('0x76')]||(_0x1cd94d[_0xf741('0x5c')]&&_0x1cd94d[_0xf741('0x5c')][0x0]?_0x1cd94d[_0xf741('0x5c')][0x0][_0xf741('0x5d')]:undefined)||null},{'name':_0xf741('0x78'),'value':_0x1cd94d[_0xf741('0x78')]||(_0x1cd94d['attrs']&&_0x1cd94d[_0xf741('0x5c')][0x1]?_0x1cd94d[_0xf741('0x5c')][0x1][_0xf741('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x3c7d9f){logger[_0xf741('0x2c')](_0xf741('0x79'),JSON[_0xf741('0x7a')](_0x3c7d9f));return[];}}exports['addItem']=function(_0x414e04,_0x375c99,_0x2941a1){if(_0x414e04['body']['id']){delete _0x414e04['body']['id'];}return db[_0xf741('0x31')]['find']({'where':{'id':_0x414e04[_0xf741('0x49')]['id']}})[_0xf741('0x27')](handleEntityNotFound(_0x375c99,null))['then'](function(_0x2d0065){if(_0x2d0065){_0x414e04[_0xf741('0x4e')]['DashboardId']=_0x2d0065['id'];_0x414e04['body'][_0xf741('0x5c')]=widgetAttributes(_0x414e04[_0xf741('0x4e')]);return db['DashboardItem'][_0xf741('0x4d')](_0x414e04[_0xf741('0x4e')]);}})[_0xf741('0x27')](respondWithResult(_0x375c99,null))[_0xf741('0x54')](handleError(_0x375c99,null));};exports[_0xf741('0x7b')]=function(_0x380d54,_0x4bee9f,_0x59a6ed){var _0x42554a={};var _0x30a65c={};var _0x3406d3;var _0x4611a6;return db[_0xf741('0x31')]['findOne']({'where':{'id':_0x380d54[_0xf741('0x49')]['id']}})[_0xf741('0x27')](handleEntityNotFound(_0x4bee9f,null))['then'](function(_0x38cad0){if(_0x38cad0){_0x3406d3=_0x38cad0;_0x30a65c[_0xf741('0x35')]=_['keys'](db[_0xf741('0x7c')][_0xf741('0x32')]);_0x30a65c[_0xf741('0x36')]=_[_0xf741('0x4a')](_0x380d54[_0xf741('0x36')]);_0x30a65c[_0xf741('0x37')]=_['intersection'](_0x30a65c[_0xf741('0x35')],_0x30a65c['query']);_0x42554a['attributes']=_[_0xf741('0x39')](_0x30a65c[_0xf741('0x35')],qs[_0xf741('0x3a')](_0x380d54['query'][_0xf741('0x3a')]));_0x42554a[_0xf741('0x38')]=_0x42554a[_0xf741('0x38')][_0xf741('0x3b')]?_0x42554a[_0xf741('0x38')]:_0x30a65c[_0xf741('0x35')];_0x42554a[_0xf741('0x3e')]=qs['sort'](_0x380d54[_0xf741('0x36')][_0xf741('0x3f')]);_0x42554a[_0xf741('0x40')]=qs[_0xf741('0x37')](_['pick'](_0x380d54['query'],_0x30a65c['filters']));if(_0x380d54[_0xf741('0x36')][_0xf741('0x42')]){_0x42554a[_0xf741('0x40')]=_['merge'](_0x42554a[_0xf741('0x40')],{'$or':_[_0xf741('0x30')](_0x42554a[_0xf741('0x38')],function(_0x333608){var _0x57872d={};_0x57872d[_0x333608]={'$like':'%'+_0x380d54[_0xf741('0x36')][_0xf741('0x42')]+'%'};return _0x57872d;})});}_0x42554a=_[_0xf741('0x43')]({},_0x42554a,_0x380d54[_0xf741('0x45')]);return _0x3406d3[_0xf741('0x7b')](_0x42554a);}})[_0xf741('0x27')](function(_0x532eb2){if(_0x532eb2){_0x4611a6=_0x532eb2[_0xf741('0x3b')];if(!_0x380d54[_0xf741('0x36')]['hasOwnProperty']('nolimit')){_0x42554a[_0xf741('0x21')]=qs['limit'](_0x380d54[_0xf741('0x36')]['limit']);_0x42554a[_0xf741('0x1f')]=qs[_0xf741('0x1f')](_0x380d54[_0xf741('0x36')][_0xf741('0x1f')]);}return _0x3406d3[_0xf741('0x7b')](_0x42554a);}})[_0xf741('0x27')](function(_0x3f91c3){if(_0x3f91c3){return _0x3f91c3?{'count':_0x4611a6,'rows':_0x3f91c3}:null;}})[_0xf741('0x27')](respondWithResult(_0x4bee9f,null))[_0xf741('0x54')](handleError(_0x4bee9f,null));}; \ No newline at end of file +var _0x1d9b=['attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','total','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','findOne','length','pick','getItems','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','CustomDashboards','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Dashboard','include','rows','catch','show','params','fields','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','UserProfileSection','userProfileId','error','destroy','attrUrl','attrs','value','custom'];(function(_0x5d2214,_0x3bdb78){var _0x5410f5=function(_0x458db3){while(--_0x458db3){_0x5d2214['push'](_0x5d2214['shift']());}};_0x5410f5(++_0x3bdb78);}(_0x1d9b,0x19d));var _0xb1d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d9b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb1d9('0x0'));var rimraf=require(_0xb1d9('0x1'));var zipdir=require(_0xb1d9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb1d9('0x3'));var moment=require(_0xb1d9('0x4'));var BPromise=require(_0xb1d9('0x5'));var Mustache=require(_0xb1d9('0x6'));var util=require(_0xb1d9('0x7'));var path=require('path');var sox=require(_0xb1d9('0x8'));var csv=require('to-csv');var ejs=require(_0xb1d9('0x9'));var fs=require('fs');var fs_extra=require(_0xb1d9('0xa'));var _=require(_0xb1d9('0xb'));var squel=require(_0xb1d9('0xc'));var crypto=require(_0xb1d9('0xd'));var jsforce=require(_0xb1d9('0xe'));var deskjs=require(_0xb1d9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb1d9('0x10'));var Papa=require('papaparse');var Redis=require(_0xb1d9('0x11'));var authService=require(_0xb1d9('0x12'));var qs=require(_0xb1d9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb1d9('0x14'));var logger=require(_0xb1d9('0x15'))('api');var utils=require(_0xb1d9('0x16'));var config=require(_0xb1d9('0x17'));var licenseUtil=require(_0xb1d9('0x18'));var db=require(_0xb1d9('0x19'))['db'];config[_0xb1d9('0x1a')]=_[_0xb1d9('0x1b')](config[_0xb1d9('0x1a')],{'host':_0xb1d9('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb1d9('0x1a')]));require('./dashboard.socket')[_0xb1d9('0x1d')](socket);function respondWithStatusCode(_0x29e032,_0x539aa0){_0x539aa0=_0x539aa0||0xcc;return function(_0x537ffb){if(_0x537ffb){return _0x29e032[_0xb1d9('0x1e')](_0x539aa0);}return _0x29e032['status'](_0x539aa0)[_0xb1d9('0x1f')]();};}function respondWithResult(_0x167155,_0x4a03c0){_0x4a03c0=_0x4a03c0||0xc8;return function(_0x153938){if(_0x153938){return _0x167155[_0xb1d9('0x20')](_0x4a03c0)['json'](_0x153938);}};}function respondWithFilteredResult(_0x4906a4,_0x681b77){return function(_0x1e3175){if(_0x1e3175){var _0x81e4c9=typeof _0x681b77[_0xb1d9('0x21')]===_0xb1d9('0x22')&&typeof _0x681b77[_0xb1d9('0x23')]===_0xb1d9('0x22');var _0x1ba04e=_0x1e3175[_0xb1d9('0x24')];var _0x2c3a43=_0x81e4c9?0x0:_0x681b77[_0xb1d9('0x21')];var _0x2aca4b=_0x81e4c9?_0x1e3175[_0xb1d9('0x24')]:_0x681b77[_0xb1d9('0x21')]+_0x681b77[_0xb1d9('0x23')];var _0x4bacca;if(_0x2aca4b>=_0x1ba04e){_0x2aca4b=_0x1ba04e;_0x4bacca=0xc8;}else{_0x4bacca=0xce;}_0x4906a4[_0xb1d9('0x20')](_0x4bacca);return _0x4906a4[_0xb1d9('0x25')](_0xb1d9('0x26'),_0x2c3a43+'-'+_0x2aca4b+'/'+_0x1ba04e)[_0xb1d9('0x27')](_0x1e3175);}return null;};}function patchUpdates(_0x5f8c65){return function(_0x586e0d){try{jsonpatch[_0xb1d9('0x28')](_0x586e0d,_0x5f8c65,!![]);}catch(_0x1db030){return BPromise[_0xb1d9('0x29')](_0x1db030);}return _0x586e0d['save']();};}function saveUpdates(_0x341da2,_0x3b355b){return function(_0x1384cf){if(_0x1384cf){return _0x1384cf[_0xb1d9('0x2a')](_0x341da2)[_0xb1d9('0x2b')](function(_0x150c8e){return _0x150c8e;});}return null;};}function removeEntity(_0x222ffc,_0x3e361a){return function(_0x5a4858){if(_0x5a4858){return _0x5a4858['destroy']()[_0xb1d9('0x2b')](function(){var _0x33825a=_0x5a4858['get']({'plain':!![]});var _0x352232=_0xb1d9('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x352232,'resourceId':_0x33825a['id']}})[_0xb1d9('0x2b')](function(){return _0x5a4858;});})[_0xb1d9('0x2b')](function(){_0x222ffc[_0xb1d9('0x20')](0xcc)[_0xb1d9('0x1f')]();});}};}function handleEntityNotFound(_0x57d980,_0x35f1cd){return function(_0x2d650b){if(!_0x2d650b){_0x57d980[_0xb1d9('0x1e')](0x194);}return _0x2d650b;};}function handleError(_0x2f6bd2,_0x4bc26b){_0x4bc26b=_0x4bc26b||0x1f4;return function(_0x301ed8){logger['error'](_0x301ed8[_0xb1d9('0x2d')]);if(_0x301ed8[_0xb1d9('0x2e')]){delete _0x301ed8[_0xb1d9('0x2e')];}_0x2f6bd2[_0xb1d9('0x20')](_0x4bc26b)['send'](_0x301ed8);};}exports[_0xb1d9('0x2f')]=function(_0x5eee7a,_0x6bb965){var _0xecf170={},_0x23e284={},_0x21b488={'count':0x0,'rows':[]};var _0x2d5caa=_[_0xb1d9('0x30')](db['Dashboard'][_0xb1d9('0x31')],function(_0x1c1bbb){return{'name':_0x1c1bbb[_0xb1d9('0x32')],'type':_0x1c1bbb[_0xb1d9('0x33')][_0xb1d9('0x34')]};});_0x23e284[_0xb1d9('0x35')]=_[_0xb1d9('0x30')](_0x2d5caa,'name');_0x23e284['query']=_[_0xb1d9('0x36')](_0x5eee7a[_0xb1d9('0x37')]);_0x23e284[_0xb1d9('0x38')]=_['intersection'](_0x23e284[_0xb1d9('0x35')],_0x23e284[_0xb1d9('0x37')]);_0xecf170[_0xb1d9('0x39')]=_[_0xb1d9('0x3a')](_0x23e284[_0xb1d9('0x35')],qs['fields'](_0x5eee7a['query']['fields']));_0xecf170[_0xb1d9('0x39')]=_0xecf170['attributes']['length']?_0xecf170[_0xb1d9('0x39')]:_0x23e284['model'];if(!_0x5eee7a[_0xb1d9('0x37')]['hasOwnProperty'](_0xb1d9('0x3b'))){_0xecf170[_0xb1d9('0x23')]=qs[_0xb1d9('0x23')](_0x5eee7a[_0xb1d9('0x37')][_0xb1d9('0x23')]);_0xecf170[_0xb1d9('0x21')]=qs[_0xb1d9('0x21')](_0x5eee7a[_0xb1d9('0x37')]['offset']);}_0xecf170[_0xb1d9('0x3c')]=qs[_0xb1d9('0x3d')](_0x5eee7a[_0xb1d9('0x37')]['sort']);_0xecf170[_0xb1d9('0x3e')]=qs[_0xb1d9('0x38')](_['pick'](_0x5eee7a[_0xb1d9('0x37')],_0x23e284[_0xb1d9('0x38')]),_0x2d5caa);if(_0x5eee7a[_0xb1d9('0x37')][_0xb1d9('0x3f')]){_0xecf170[_0xb1d9('0x3e')]=_[_0xb1d9('0x40')](_0xecf170[_0xb1d9('0x3e')],{'$or':_[_0xb1d9('0x30')](_0x2d5caa,function(_0xd2daf3){if(_0xd2daf3[_0xb1d9('0x33')]!==_0xb1d9('0x41')){var _0x5e95a5={};_0x5e95a5[_0xd2daf3[_0xb1d9('0x2e')]]={'$like':'%'+_0x5eee7a[_0xb1d9('0x37')][_0xb1d9('0x3f')]+'%'};return _0x5e95a5;}})});}_0xecf170=_['merge']({},_0xecf170,_0x5eee7a[_0xb1d9('0x42')]);var _0x35fc77={'where':_0xecf170[_0xb1d9('0x3e')]};return db[_0xb1d9('0x43')][_0xb1d9('0x24')](_0x35fc77)[_0xb1d9('0x2b')](function(_0x37049f){_0x21b488[_0xb1d9('0x24')]=_0x37049f;if(_0x5eee7a[_0xb1d9('0x37')]['includeAll']){_0xecf170[_0xb1d9('0x44')]=[{'all':!![]}];}return db[_0xb1d9('0x43')]['findAll'](_0xecf170);})[_0xb1d9('0x2b')](function(_0x1655a3){_0x21b488[_0xb1d9('0x45')]=_0x1655a3;return _0x21b488;})[_0xb1d9('0x2b')](respondWithFilteredResult(_0x6bb965,_0xecf170))[_0xb1d9('0x46')](handleError(_0x6bb965,null));};exports[_0xb1d9('0x47')]=function(_0x19701f,_0x1987ae){var _0x4d95e9={'raw':![],'where':{'id':_0x19701f[_0xb1d9('0x48')]['id']}},_0x194bdc={};_0x194bdc['model']=_[_0xb1d9('0x36')](db[_0xb1d9('0x43')][_0xb1d9('0x31')]);_0x194bdc['query']=_[_0xb1d9('0x36')](_0x19701f[_0xb1d9('0x37')]);_0x194bdc[_0xb1d9('0x38')]=_['intersection'](_0x194bdc[_0xb1d9('0x35')],_0x194bdc[_0xb1d9('0x37')]);_0x4d95e9[_0xb1d9('0x39')]=_[_0xb1d9('0x3a')](_0x194bdc[_0xb1d9('0x35')],qs[_0xb1d9('0x49')](_0x19701f[_0xb1d9('0x37')][_0xb1d9('0x49')]));_0x4d95e9[_0xb1d9('0x39')]=_0x4d95e9[_0xb1d9('0x39')]['length']?_0x4d95e9[_0xb1d9('0x39')]:_0x194bdc[_0xb1d9('0x35')];if(_0x19701f[_0xb1d9('0x37')][_0xb1d9('0x4a')]){_0x4d95e9[_0xb1d9('0x44')]=[{'all':!![]}];}_0x4d95e9=_[_0xb1d9('0x40')]({},_0x4d95e9,_0x19701f[_0xb1d9('0x42')]);return db[_0xb1d9('0x43')][_0xb1d9('0x4b')](_0x4d95e9)['then'](handleEntityNotFound(_0x1987ae,null))[_0xb1d9('0x2b')](respondWithResult(_0x1987ae,null))[_0xb1d9('0x46')](handleError(_0x1987ae,null));};exports[_0xb1d9('0x4c')]=function(_0x55e6c3,_0x9c0e19){return db[_0xb1d9('0x43')]['create'](_0x55e6c3[_0xb1d9('0x4d')],{})['then'](function(_0x2acae7){var _0x3bc217=_0x55e6c3[_0xb1d9('0x4e')]['get']({'plain':!![]});if(!_0x3bc217)throw new Error(_0xb1d9('0x4f'));if(_0x3bc217[_0xb1d9('0x50')]==='user'){var _0x2be559=_0x2acae7[_0xb1d9('0x51')]({'plain':!![]});var _0x150697=_0xb1d9('0x2c');return db['UserProfileSection'][_0xb1d9('0x4b')]({'where':{'name':_0x150697,'userProfileId':_0x3bc217['userProfileId']},'raw':!![]})[_0xb1d9('0x2b')](function(_0x3909dd){if(_0x3909dd&&_0x3909dd[_0xb1d9('0x52')]===0x0){return db['UserProfileResource'][_0xb1d9('0x4c')]({'name':_0x2be559[_0xb1d9('0x2e')],'resourceId':_0x2be559['id'],'type':_0x3909dd[_0xb1d9('0x2e')],'sectionId':_0x3909dd['id']},{})[_0xb1d9('0x2b')](function(){return _0x2acae7;});}else{return _0x2acae7;}})[_0xb1d9('0x46')](function(_0x34033b){logger['error'](_0xb1d9('0x53'),_0x34033b);throw _0x34033b;});}return _0x2acae7;})[_0xb1d9('0x2b')](respondWithResult(_0x9c0e19,0xc9))['catch'](handleError(_0x9c0e19,null));};exports[_0xb1d9('0x54')]=function(_0x53592a,_0x3b797d){var _0x1ffdf1={'where':{'id':_0x53592a[_0xb1d9('0x48')]['id']}},_0x5c5f32={};_0x5c5f32[_0xb1d9('0x35')]=_[_0xb1d9('0x36')](db['Dashboard']['rawAttributes']);_0x1ffdf1[_0xb1d9('0x39')]=_[_0xb1d9('0x3a')](_0x5c5f32[_0xb1d9('0x35')],qs[_0xb1d9('0x49')](_0x53592a[_0xb1d9('0x37')][_0xb1d9('0x49')]));_0x1ffdf1['attributes']=_0x1ffdf1[_0xb1d9('0x39')]['length']?_0x1ffdf1[_0xb1d9('0x39')]:_0x5c5f32[_0xb1d9('0x35')];if(_0x53592a[_0xb1d9('0x37')][_0xb1d9('0x4a')]){_0x1ffdf1[_0xb1d9('0x44')]=[{'all':!![]}];}_0x1ffdf1=_[_0xb1d9('0x40')]({},_0x1ffdf1,_0x53592a[_0xb1d9('0x42')]);return db[_0xb1d9('0x43')][_0xb1d9('0x4b')](_0x1ffdf1)[_0xb1d9('0x2b')](handleEntityNotFound(_0x3b797d,null))[_0xb1d9('0x2b')](function(_0x4042f2){if(_0x4042f2){var _0x7c7150=_0x4042f2[_0xb1d9('0x51')]({'plain':!![]});_0x7c7150=qs[_0xb1d9('0x55')](_0x7c7150,['id',_0xb1d9('0x56'),'updatedAt']);_0x53592a[_0xb1d9('0x4d')]=_[_0xb1d9('0x55')](_0x53592a['body'],['id','createdAt','updatedAt']);return db['Dashboard'][_0xb1d9('0x4c')](_[_0xb1d9('0x40')](_0x7c7150,_0x53592a[_0xb1d9('0x4d')]),{'include':_0x53592a[_0xb1d9('0x37')][_0xb1d9('0x4a')]?[{'all':!![]}]:undefined})[_0xb1d9('0x2b')](function(_0xa8ba0c){var _0x28a456=_0x53592a[_0xb1d9('0x4e')]['get']({'plain':!![]});if(!_0x28a456)throw new Error(_0xb1d9('0x4f'));if(_0x28a456['role']==='user'){var _0x4a8ab4=_0xa8ba0c[_0xb1d9('0x51')]({'plain':!![]});var _0x1cf6ac=_0xb1d9('0x2c');return db[_0xb1d9('0x57')][_0xb1d9('0x4b')]({'where':{'name':_0x1cf6ac,'userProfileId':_0x28a456[_0xb1d9('0x58')]},'raw':!![]})['then'](function(_0x18b810){if(_0x18b810&&_0x18b810[_0xb1d9('0x52')]===0x0){return db['UserProfileResource'][_0xb1d9('0x4c')]({'name':_0x4a8ab4[_0xb1d9('0x2e')],'resourceId':_0x4a8ab4['id'],'type':_0x18b810[_0xb1d9('0x2e')],'sectionId':_0x18b810['id']},{})[_0xb1d9('0x2b')](function(){return _0xa8ba0c;});}else{return _0xa8ba0c;}})['catch'](function(_0x5e77f5){logger[_0xb1d9('0x59')](_0xb1d9('0x53'),_0x5e77f5);throw _0x5e77f5;});}return _0xa8ba0c;});}})[_0xb1d9('0x2b')](respondWithResult(_0x3b797d,0xc9))['catch'](handleError(_0x3b797d,null));};exports[_0xb1d9('0x2a')]=function(_0x452960,_0x34363c){if(_0x452960[_0xb1d9('0x4d')]['id']){delete _0x452960[_0xb1d9('0x4d')]['id'];}return db['Dashboard'][_0xb1d9('0x4b')]({'where':{'id':_0x452960[_0xb1d9('0x48')]['id']}})[_0xb1d9('0x2b')](handleEntityNotFound(_0x34363c,null))[_0xb1d9('0x2b')](saveUpdates(_0x452960['body'],null))[_0xb1d9('0x2b')](respondWithResult(_0x34363c,null))[_0xb1d9('0x46')](handleError(_0x34363c,null));};exports[_0xb1d9('0x5a')]=function(_0x2641e7,_0x590ee5){return db[_0xb1d9('0x43')][_0xb1d9('0x4b')]({'where':{'id':_0x2641e7[_0xb1d9('0x48')]['id']}})[_0xb1d9('0x2b')](handleEntityNotFound(_0x590ee5,null))[_0xb1d9('0x2b')](removeEntity(_0x590ee5,null))[_0xb1d9('0x46')](handleError(_0x590ee5,null));};function widgetAttributes(_0x217daf){try{switch(_0x217daf['type']){case'iframe':return[{'name':_0xb1d9('0x5b'),'value':_0x217daf['attrUrl']||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf['attrs'][0x0]?_0x217daf[_0xb1d9('0x5c')][0x0][_0xb1d9('0x5d')]:undefined)||'https://'}];case _0xb1d9('0x5e'):return[{'name':_0xb1d9('0x5f'),'value':_0x217daf[_0xb1d9('0x5f')]||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf[_0xb1d9('0x5c')][0x0]?_0x217daf[_0xb1d9('0x5c')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0xb1d9('0x60'),'value':_0x217daf[_0xb1d9('0x60')]||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf[_0xb1d9('0x5c')][0x0]?_0x217daf[_0xb1d9('0x5c')][0x0][_0xb1d9('0x5d')]:undefined)||_0xb1d9('0x61')},{'name':_0xb1d9('0x62'),'value':_0x217daf[_0xb1d9('0x62')]||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf[_0xb1d9('0x5c')][0x1]?_0x217daf[_0xb1d9('0x5c')][0x1][_0xb1d9('0x5d')]:undefined)||_0xb1d9('0x63')},{'name':_0xb1d9('0x64'),'value':_0x217daf[_0xb1d9('0x64')]||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf[_0xb1d9('0x5c')][0x2]?_0x217daf[_0xb1d9('0x5c')][0x2][_0xb1d9('0x5d')]:undefined)||0xc}];case _0xb1d9('0x65'):return[{'name':_0xb1d9('0x66'),'value':_0x217daf[_0xb1d9('0x66')]||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf[_0xb1d9('0x5c')][0x0]?_0x217daf['attrs'][0x0][_0xb1d9('0x5d')]:undefined)||'total'},{'name':_0xb1d9('0x67'),'value':_0x217daf['attrVoiceQueues']||(_0x217daf['attrs']&&_0x217daf[_0xb1d9('0x5c')][0x1]?_0x217daf[_0xb1d9('0x5c')][0x1][_0xb1d9('0x5d')]:undefined)||[]},{'name':_0xb1d9('0x64'),'value':_0x217daf[_0xb1d9('0x64')]||(_0x217daf['attrs']&&_0x217daf[_0xb1d9('0x5c')][0x2]?_0x217daf[_0xb1d9('0x5c')][0x2][_0xb1d9('0x5d')]:undefined)||0x14},{'name':'attrChannel','value':_0x217daf[_0xb1d9('0x68')]||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf[_0xb1d9('0x5c')][0x3]?_0x217daf[_0xb1d9('0x5c')][0x3][_0xb1d9('0x5d')]:undefined)||_0xb1d9('0x69')},{'name':'attrEmailAccounts','value':_0x217daf[_0xb1d9('0x6a')]||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf[_0xb1d9('0x5c')][0x4]?_0x217daf['attrs'][0x4]['value']:undefined)||''},{'name':_0xb1d9('0x6b'),'value':_0x217daf[_0xb1d9('0x6b')]||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf[_0xb1d9('0x5c')][0x5]?_0x217daf['attrs'][0x5][_0xb1d9('0x5d')]:undefined)||''},{'name':_0xb1d9('0x6c'),'value':_0x217daf['attrSmsAccounts']||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf['attrs'][0x6]?_0x217daf[_0xb1d9('0x5c')][0x6][_0xb1d9('0x5d')]:undefined)||''},{'name':_0xb1d9('0x6d'),'value':_0x217daf[_0xb1d9('0x6d')]||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf['attrs'][0x7]?_0x217daf['attrs'][0x7][_0xb1d9('0x5d')]:undefined)||''},{'name':_0xb1d9('0x6e'),'value':_0x217daf[_0xb1d9('0x6e')]||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf['attrs'][0x8]?_0x217daf[_0xb1d9('0x5c')][0x8][_0xb1d9('0x5d')]:undefined)||''},{'name':_0xb1d9('0x6f'),'value':_0x217daf[_0xb1d9('0x6f')]||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf[_0xb1d9('0x5c')][0x9]?_0x217daf[_0xb1d9('0x5c')][0x9][_0xb1d9('0x5d')]:undefined)||''}];case _0xb1d9('0x70'):case _0xb1d9('0x71'):return[{'name':'attrSerie1','value':_0x217daf['attrSerie1']||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf[_0xb1d9('0x5c')][0x0]?_0x217daf[_0xb1d9('0x5c')][0x0][_0xb1d9('0x5d')]:undefined)||_0xb1d9('0x72')},{'name':'attrSerie2','value':_0x217daf['attrSerie2']||(_0x217daf['attrs']&&_0x217daf[_0xb1d9('0x5c')][0x1]?_0x217daf[_0xb1d9('0x5c')][0x1][_0xb1d9('0x5d')]:undefined)||null},{'name':'attrSerie3','value':_0x217daf[_0xb1d9('0x73')]||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf[_0xb1d9('0x5c')][0x2]?_0x217daf[_0xb1d9('0x5c')][0x2][_0xb1d9('0x5d')]:undefined)||null},{'name':_0xb1d9('0x67'),'value':_0x217daf[_0xb1d9('0x67')]||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf[_0xb1d9('0x5c')][0x3]?_0x217daf[_0xb1d9('0x5c')][0x3][_0xb1d9('0x5d')]:undefined)||[]},{'name':_0xb1d9('0x68'),'value':_0x217daf[_0xb1d9('0x68')]||(_0x217daf['attrs']&&_0x217daf['attrs'][0x4]?_0x217daf['attrs'][0x4]['value']:undefined)||'voice'},{'name':_0xb1d9('0x6a'),'value':_0x217daf['attrEmailAccounts']||(_0x217daf['attrs']&&_0x217daf[_0xb1d9('0x5c')][0x5]?_0x217daf[_0xb1d9('0x5c')][0x5][_0xb1d9('0x5d')]:undefined)||''},{'name':_0xb1d9('0x6b'),'value':_0x217daf[_0xb1d9('0x6b')]||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf['attrs'][0x6]?_0x217daf[_0xb1d9('0x5c')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x217daf['attrSmsAccounts']||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf[_0xb1d9('0x5c')][0x7]?_0x217daf[_0xb1d9('0x5c')][0x7]['value']:undefined)||''},{'name':_0xb1d9('0x6d'),'value':_0x217daf[_0xb1d9('0x6d')]||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf[_0xb1d9('0x5c')][0x8]?_0x217daf[_0xb1d9('0x5c')][0x8][_0xb1d9('0x5d')]:undefined)||''},{'name':_0xb1d9('0x6e'),'value':_0x217daf['attrWhatsappAccounts']||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf[_0xb1d9('0x5c')][0x9]?_0x217daf[_0xb1d9('0x5c')][0x9][_0xb1d9('0x5d')]:undefined)||''},{'name':_0xb1d9('0x6f'),'value':_0x217daf[_0xb1d9('0x6f')]||(_0x217daf['attrs']&&_0x217daf['attrs'][0xa]?_0x217daf[_0xb1d9('0x5c')][0xa]['value']:undefined)||''}];case _0xb1d9('0x74'):return[{'name':_0xb1d9('0x75'),'type':_0x217daf['reportType']||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf[_0xb1d9('0x5c')][0x0]?_0x217daf['attrs'][0x0]['type']:undefined)||null,'value':_0x217daf[_0xb1d9('0x75')]||(_0x217daf['attrs']&&_0x217daf['attrs'][0x0]?_0x217daf[_0xb1d9('0x5c')][0x0][_0xb1d9('0x5d')]:undefined)||null},{'name':_0xb1d9('0x76'),'value':_0x217daf[_0xb1d9('0x76')]||(_0x217daf[_0xb1d9('0x5c')]&&_0x217daf[_0xb1d9('0x5c')][0x1]?_0x217daf['attrs'][0x1][_0xb1d9('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x1a3cfc){logger['error'](_0xb1d9('0x77'),JSON['stringify'](_0x1a3cfc));return[];}}exports[_0xb1d9('0x78')]=function(_0xe36ec2,_0x30f22a,_0x1deee8){if(_0xe36ec2[_0xb1d9('0x4d')]['id']){delete _0xe36ec2[_0xb1d9('0x4d')]['id'];}return db['Dashboard']['find']({'where':{'id':_0xe36ec2[_0xb1d9('0x48')]['id']}})[_0xb1d9('0x2b')](handleEntityNotFound(_0x30f22a,null))[_0xb1d9('0x2b')](function(_0x4615fb){if(_0x4615fb){_0xe36ec2['body'][_0xb1d9('0x79')]=_0x4615fb['id'];_0xe36ec2[_0xb1d9('0x4d')][_0xb1d9('0x5c')]=widgetAttributes(_0xe36ec2['body']);return db[_0xb1d9('0x7a')][_0xb1d9('0x4c')](_0xe36ec2[_0xb1d9('0x4d')]);}})[_0xb1d9('0x2b')](respondWithResult(_0x30f22a,null))[_0xb1d9('0x46')](handleError(_0x30f22a,null));};exports['getItems']=function(_0x25a947,_0x5598cd,_0x2db747){var _0x287e92={};var _0xcab721={};var _0x54c04b;var _0x5ecbd4;return db[_0xb1d9('0x43')][_0xb1d9('0x7b')]({'where':{'id':_0x25a947[_0xb1d9('0x48')]['id']}})['then'](handleEntityNotFound(_0x5598cd,null))[_0xb1d9('0x2b')](function(_0xed9c84){if(_0xed9c84){_0x54c04b=_0xed9c84;_0xcab721[_0xb1d9('0x35')]=_[_0xb1d9('0x36')](db[_0xb1d9('0x7a')][_0xb1d9('0x31')]);_0xcab721[_0xb1d9('0x37')]=_['keys'](_0x25a947[_0xb1d9('0x37')]);_0xcab721[_0xb1d9('0x38')]=_['intersection'](_0xcab721[_0xb1d9('0x35')],_0xcab721[_0xb1d9('0x37')]);_0x287e92[_0xb1d9('0x39')]=_[_0xb1d9('0x3a')](_0xcab721[_0xb1d9('0x35')],qs[_0xb1d9('0x49')](_0x25a947[_0xb1d9('0x37')][_0xb1d9('0x49')]));_0x287e92[_0xb1d9('0x39')]=_0x287e92[_0xb1d9('0x39')][_0xb1d9('0x7c')]?_0x287e92[_0xb1d9('0x39')]:_0xcab721[_0xb1d9('0x35')];_0x287e92[_0xb1d9('0x3c')]=qs[_0xb1d9('0x3d')](_0x25a947['query'][_0xb1d9('0x3d')]);_0x287e92['where']=qs['filters'](_[_0xb1d9('0x7d')](_0x25a947[_0xb1d9('0x37')],_0xcab721[_0xb1d9('0x38')]));if(_0x25a947[_0xb1d9('0x37')][_0xb1d9('0x3f')]){_0x287e92[_0xb1d9('0x3e')]=_[_0xb1d9('0x40')](_0x287e92[_0xb1d9('0x3e')],{'$or':_['map'](_0x287e92[_0xb1d9('0x39')],function(_0x38b2ef){var _0x1b07d9={};_0x1b07d9[_0x38b2ef]={'$like':'%'+_0x25a947[_0xb1d9('0x37')]['filter']+'%'};return _0x1b07d9;})});}_0x287e92=_[_0xb1d9('0x40')]({},_0x287e92,_0x25a947[_0xb1d9('0x42')]);return _0x54c04b['getItems'](_0x287e92);}})[_0xb1d9('0x2b')](function(_0x10e192){if(_0x10e192){_0x5ecbd4=_0x10e192[_0xb1d9('0x7c')];if(!_0x25a947[_0xb1d9('0x37')]['hasOwnProperty'](_0xb1d9('0x3b'))){_0x287e92[_0xb1d9('0x23')]=qs[_0xb1d9('0x23')](_0x25a947[_0xb1d9('0x37')][_0xb1d9('0x23')]);_0x287e92[_0xb1d9('0x21')]=qs[_0xb1d9('0x21')](_0x25a947[_0xb1d9('0x37')][_0xb1d9('0x21')]);}return _0x54c04b[_0xb1d9('0x7e')](_0x287e92);}})['then'](function(_0x1de3f6){if(_0x1de3f6){return _0x1de3f6?{'count':_0x5ecbd4,'rows':_0x1de3f6}:null;}})[_0xb1d9('0x2b')](respondWithResult(_0x5598cd,null))[_0xb1d9('0x46')](handleError(_0x5598cd,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index dade453..a6c369c 100644 --- a/server/api/dashboard/dashboard.events.js +++ b/server/api/dashboard/dashboard.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd59d=['Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4dfb1b,_0x26850a){var _0x4dc88=function(_0x367884){while(--_0x367884){_0x4dfb1b['push'](_0x4dfb1b['shift']());}};_0x4dc88(++_0x26850a);}(_0xd59d,0x81));var _0xdd59=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xd59d[_0x3054be];return _0x3df150;};'use strict';var EventEmitter=require(_0xdd59('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xdd59('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xdd59('0x2')](0x0);var events={'afterCreate':_0xdd59('0x3'),'afterUpdate':_0xdd59('0x4'),'afterDestroy':_0xdd59('0x5')};function emitEvent(_0x25ee97){return function(_0x5b3b2d,_0x1c65cb,_0x52dd03){DashboardEvents['emit'](_0x25ee97+':'+_0x5b3b2d['id'],_0x5b3b2d);DashboardEvents[_0xdd59('0x6')](_0x25ee97,_0x5b3b2d);_0x52dd03(null);};}for(var e in events){if(events[_0xdd59('0x7')](e)){var event=events[e];Dashboard[_0xdd59('0x8')](e,emitEvent(event));}}module[_0xdd59('0x9')]=DashboardEvents; \ No newline at end of file +var _0xfa2c=['Dashboard','setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x14a5c5,_0x4d4186){var _0x4e8c6c=function(_0x1a948c){while(--_0x1a948c){_0x14a5c5['push'](_0x14a5c5['shift']());}};_0x4e8c6c(++_0x4d4186);}(_0xfa2c,0x1e4));var _0xcfa2=function(_0x562ec5,_0x36b5a4){_0x562ec5=_0x562ec5-0x0;var _0x279c8c=_0xfa2c[_0x562ec5];return _0x279c8c;};'use strict';var EventEmitter=require(_0xcfa2('0x0'));var Dashboard=require(_0xcfa2('0x1'))['db'][_0xcfa2('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xcfa2('0x3')](0x0);var events={'afterCreate':_0xcfa2('0x4'),'afterUpdate':_0xcfa2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x587ef1){return function(_0x6ad29f,_0x36229e,_0x55aaab){DashboardEvents[_0xcfa2('0x6')](_0x587ef1+':'+_0x6ad29f['id'],_0x6ad29f);DashboardEvents['emit'](_0x587ef1,_0x6ad29f);_0x55aaab(null);};}for(var e in events){if(events[_0xcfa2('0x7')](e)){var event=events[e];Dashboard[_0xcfa2('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 215d1b1..d2973ed 100644 --- a/server/api/dashboard/dashboard.model.js +++ b/server/api/dashboard/dashboard.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5fb=['api','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util'];(function(_0x48206e,_0x583832){var _0x5bdd6c=function(_0x23144a){while(--_0x23144a){_0x48206e['push'](_0x48206e['shift']());}};_0x5bdd6c(++_0x583832);}(_0xe5fb,0xce));var _0xbe5f=function(_0x41d02a,_0x355e19){_0x41d02a=_0x41d02a-0x0;var _0x4c3983=_0xe5fb[_0x41d02a];return _0x4c3983;};'use strict';var _=require(_0xbe5f('0x0'));var util=require(_0xbe5f('0x1'));var logger=require('../../config/logger')(_0xbe5f('0x2'));var moment=require(_0xbe5f('0x3'));var BPromise=require(_0xbe5f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe5f('0x5'));var rimraf=require(_0xbe5f('0x6'));var config=require(_0xbe5f('0x7'));var attributes=require(_0xbe5f('0x8'));module[_0xbe5f('0x9')]=function(_0x5b0452,_0x26347a){return _0x5b0452[_0xbe5f('0xa')](_0xbe5f('0xb'),attributes,{'tableName':_0xbe5f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f4e=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','Dashboard'];(function(_0x2ceaa7,_0xb70f45){var _0x34648f=function(_0x1716ee){while(--_0x1716ee){_0x2ceaa7['push'](_0x2ceaa7['shift']());}};_0x34648f(++_0xb70f45);}(_0x5f4e,0x1cc));var _0xe5f4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5f4e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe5f4('0x0'));var util=require(_0xe5f4('0x1'));var logger=require('../../config/logger')(_0xe5f4('0x2'));var moment=require(_0xe5f4('0x3'));var BPromise=require(_0xe5f4('0x4'));var rp=require(_0xe5f4('0x5'));var fs=require('fs');var path=require(_0xe5f4('0x6'));var rimraf=require(_0xe5f4('0x7'));var config=require(_0xe5f4('0x8'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x44f13b,_0x40d50d){return _0x44f13b['define'](_0xe5f4('0x9'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 2a71fda..139efcf 100644 --- a/server/api/dashboard/dashboard.rpc.js +++ b/server/api/dashboard/dashboard.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa084=['Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','info'];(function(_0x381372,_0xf0a5a){var _0x4e959a=function(_0x25a897){while(--_0x25a897){_0x381372['push'](_0x381372['shift']());}};_0x4e959a(++_0xf0a5a);}(_0xa084,0x190));var _0x4a08=function(_0x14b561,_0x2ec2c7){_0x14b561=_0x14b561-0x0;var _0x428c9f=_0xa084[_0x14b561];return _0x428c9f;};'use strict';var _=require('lodash');var util=require(_0x4a08('0x0'));var moment=require(_0x4a08('0x1'));var BPromise=require(_0x4a08('0x2'));var rs=require(_0x4a08('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a08('0x4'));var logger=require('../../config/logger')(_0x4a08('0x5'));var config=require(_0x4a08('0x6'));var jayson=require(_0x4a08('0x7'));var client=jayson['client'][_0x4a08('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4a08('0x9')],{'host':_0x4a08('0xa'),'port':0x18eb});var socket=require(_0x4a08('0xb'))(new Redis(config[_0x4a08('0x9')]));require('./dashboard.socket')[_0x4a08('0xc')](socket);function respondWithRpcPromise(_0x12e304,_0x288f21,_0x13eb41){return new BPromise(function(_0x1f97b1,_0x474ca5){return client[_0x4a08('0xd')](_0x12e304,_0x13eb41)[_0x4a08('0xe')](function(_0x1a9a00){logger[_0x4a08('0xf')](_0x4a08('0x10'),_0x288f21,_0x4a08('0x11'));logger[_0x4a08('0x12')](_0x4a08('0x13'),_0x288f21,_0x4a08('0x11'),JSON[_0x4a08('0x14')](_0x1a9a00));if(_0x1a9a00['error']){if(_0x1a9a00[_0x4a08('0x15')][_0x4a08('0x16')]===0x1f4){logger[_0x4a08('0x15')](_0x4a08('0x10'),_0x288f21,_0x1a9a00['error'][_0x4a08('0x17')]);return _0x474ca5(_0x1a9a00[_0x4a08('0x15')][_0x4a08('0x17')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0x288f21,_0x1a9a00[_0x4a08('0x15')]['message']);return _0x1f97b1(_0x1a9a00[_0x4a08('0x15')][_0x4a08('0x17')]);}else{logger[_0x4a08('0xf')]('Dashboard,\x20%s,\x20%s',_0x288f21,_0x4a08('0x11'));_0x1f97b1(_0x1a9a00[_0x4a08('0x18')]['message']);}})[_0x4a08('0x19')](function(_0x26c30e){logger[_0x4a08('0x15')](_0x4a08('0x10'),_0x288f21,_0x26c30e);_0x474ca5(_0x26c30e);});});} \ No newline at end of file +var _0x5cff=['request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','redis','localhost','request','info','Dashboard,\x20%s,\x20%s'];(function(_0x17d713,_0x19b690){var _0x452666=function(_0xaff2b4){while(--_0xaff2b4){_0x17d713['push'](_0x17d713['shift']());}};_0x452666(++_0x19b690);}(_0x5cff,0x129));var _0xf5cf=function(_0x5efaf0,_0x4cfe84){_0x5efaf0=_0x5efaf0-0x0;var _0x202e48=_0x5cff[_0x5efaf0];return _0x202e48;};'use strict';var _=require(_0xf5cf('0x0'));var util=require(_0xf5cf('0x1'));var moment=require(_0xf5cf('0x2'));var BPromise=require(_0xf5cf('0x3'));var rs=require(_0xf5cf('0x4'));var fs=require('fs');var Redis=require(_0xf5cf('0x5'));var db=require(_0xf5cf('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf5cf('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf5cf('0x8')][_0xf5cf('0x9')]({'port':0x232a});config[_0xf5cf('0xa')]=_['defaults'](config[_0xf5cf('0xa')],{'host':_0xf5cf('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5cf('0xa')]));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x5d27e2,_0x5c42ba,_0xe44988){return new BPromise(function(_0x197515,_0x3ba017){return client[_0xf5cf('0xc')](_0x5d27e2,_0xe44988)['then'](function(_0x57e1de){logger[_0xf5cf('0xd')](_0xf5cf('0xe'),_0x5c42ba,_0xf5cf('0xf'));logger[_0xf5cf('0x10')](_0xf5cf('0x11'),_0x5c42ba,_0xf5cf('0xf'),JSON[_0xf5cf('0x12')](_0x57e1de));if(_0x57e1de[_0xf5cf('0x13')]){if(_0x57e1de[_0xf5cf('0x13')][_0xf5cf('0x14')]===0x1f4){logger[_0xf5cf('0x13')](_0xf5cf('0xe'),_0x5c42ba,_0x57e1de[_0xf5cf('0x13')]['message']);return _0x3ba017(_0x57e1de['error'][_0xf5cf('0x15')]);}logger[_0xf5cf('0x13')](_0xf5cf('0xe'),_0x5c42ba,_0x57e1de[_0xf5cf('0x13')]['message']);return _0x197515(_0x57e1de[_0xf5cf('0x13')][_0xf5cf('0x15')]);}else{logger['info'](_0xf5cf('0xe'),_0x5c42ba,_0xf5cf('0xf'));_0x197515(_0x57e1de[_0xf5cf('0x16')]['message']);}})[_0xf5cf('0x17')](function(_0x1a0717){logger[_0xf5cf('0x13')](_0xf5cf('0xe'),_0x5c42ba,_0x1a0717);_0x3ba017(_0x1a0717);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index c3e18c8..2f033da 100644 --- a/server/api/dashboard/dashboard.socket.js +++ b/server/api/dashboard/dashboard.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbde0=['emit','register','length','dashboard:','./dashboard.events','save'];(function(_0x21c766,_0x47285c){var _0x260274=function(_0x50f83a){while(--_0x50f83a){_0x21c766['push'](_0x21c766['shift']());}};_0x260274(++_0x47285c);}(_0xbde0,0x1e4));var _0x0bde=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xbde0[_0x4ae6ef];return _0x3cbb4e;};'use strict';var DashboardEvents=require(_0x0bde('0x0'));var events=[_0x0bde('0x1'),'remove','update'];function createListener(_0x4c0436,_0x58be73){return function(_0x51268b){_0x58be73[_0x0bde('0x2')](_0x4c0436,_0x51268b);};}function removeListener(_0x36efdb,_0x50dd35){return function(){DashboardEvents['removeListener'](_0x36efdb,_0x50dd35);};}exports[_0x0bde('0x3')]=function(_0x113f9c){for(var _0x3e22a9=0x0,_0x3567e3=events[_0x0bde('0x4')];_0x3e22a9<_0x3567e3;_0x3e22a9++){var _0x31ee63=events[_0x3e22a9];var _0x360d28=createListener(_0x0bde('0x5')+_0x31ee63,_0x113f9c);DashboardEvents['on'](_0x31ee63,_0x360d28);}}; \ No newline at end of file +var _0xd86d=['update','emit','removeListener','length','dashboard:','./dashboard.events','remove'];(function(_0x3d859b,_0x1fb1ae){var _0x8a14ec=function(_0x333dc4){while(--_0x333dc4){_0x3d859b['push'](_0x3d859b['shift']());}};_0x8a14ec(++_0x1fb1ae);}(_0xd86d,0x116));var _0xdd86=function(_0x14b26a,_0x2d4f23){_0x14b26a=_0x14b26a-0x0;var _0x2141e4=_0xd86d[_0x14b26a];return _0x2141e4;};'use strict';var DashboardEvents=require(_0xdd86('0x0'));var events=['save',_0xdd86('0x1'),_0xdd86('0x2')];function createListener(_0x15b4e0,_0x5eda1a){return function(_0x4f505a){_0x5eda1a[_0xdd86('0x3')](_0x15b4e0,_0x4f505a);};}function removeListener(_0x1a0fea,_0x524b64){return function(){DashboardEvents[_0xdd86('0x4')](_0x1a0fea,_0x524b64);};}exports['register']=function(_0x30910e){for(var _0x3336c3=0x0,_0x5cd294=events[_0xdd86('0x5')];_0x3336c3<_0x5cd294;_0x3336c3++){var _0x5cf6cc=events[_0x3336c3];var _0x329755=createListener(_0xdd86('0x6')+_0x5cf6cc,_0x30910e);DashboardEvents['on'](_0x5cf6cc,_0x329755);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index d1aeb9e..f07a83a 100644 --- a/server/api/dashboard/index.js +++ b/server/api/dashboard/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35a8=['post','create','/:id/clone','clone','/:id/items','addItem','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','get','isAuthenticated','index','/:id','show','getItems'];(function(_0x75dfe2,_0x14cf83){var _0x98432a=function(_0x4dc8dc){while(--_0x4dc8dc){_0x75dfe2['push'](_0x75dfe2['shift']());}};_0x98432a(++_0x14cf83);}(_0x35a8,0x19b));var _0x835a=function(_0x2db3db,_0x5445a6){_0x2db3db=_0x2db3db-0x0;var _0x14f320=_0x35a8[_0x2db3db];return _0x14f320;};'use strict';var multer=require(_0x835a('0x0'));var util=require(_0x835a('0x1'));var path=require(_0x835a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x835a('0x3')]();var fs_extra=require(_0x835a('0x4'));var auth=require(_0x835a('0x5'));var interaction=require(_0x835a('0x6'));var config=require('../../config/environment');var controller=require(_0x835a('0x7'));router[_0x835a('0x8')]('/',auth[_0x835a('0x9')](),controller[_0x835a('0xa')]);router['get'](_0x835a('0xb'),auth['isAuthenticated'](),controller[_0x835a('0xc')]);router[_0x835a('0x8')]('/:id/items',auth[_0x835a('0x9')](),controller[_0x835a('0xd')]);router[_0x835a('0xe')]('/',auth['isAuthenticated'](),controller[_0x835a('0xf')]);router[_0x835a('0xe')](_0x835a('0x10'),auth[_0x835a('0x9')](),controller[_0x835a('0x11')]);router['post'](_0x835a('0x12'),auth['isAuthenticated'](),controller[_0x835a('0x13')]);router[_0x835a('0x14')]('/:id',auth[_0x835a('0x9')](),controller[_0x835a('0x15')]);router[_0x835a('0x16')](_0x835a('0xb'),auth['isAuthenticated'](),controller[_0x835a('0x17')]);module[_0x835a('0x18')]=router; \ No newline at end of file +var _0x80ec=['/:id','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','getItems','create','post','/:id/clone','clone','/:id/items','addItem','put','update','delete'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x80ec,0x182));var _0xc80e=function(_0x5e7b03,_0x43a679){_0x5e7b03=_0x5e7b03-0x0;var _0x292226=_0x80ec[_0x5e7b03];return _0x292226;};'use strict';var multer=require(_0xc80e('0x0'));var util=require(_0xc80e('0x1'));var path=require(_0xc80e('0x2'));var timeout=require(_0xc80e('0x3'));var express=require(_0xc80e('0x4'));var router=express['Router']();var fs_extra=require(_0xc80e('0x5'));var auth=require(_0xc80e('0x6'));var interaction=require(_0xc80e('0x7'));var config=require(_0xc80e('0x8'));var controller=require('./dashboard.controller');router[_0xc80e('0x9')]('/',auth[_0xc80e('0xa')](),controller['index']);router[_0xc80e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc80e('0xb')]);router['get']('/:id/items',auth['isAuthenticated'](),controller[_0xc80e('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc80e('0xd')]);router[_0xc80e('0xe')](_0xc80e('0xf'),auth[_0xc80e('0xa')](),controller[_0xc80e('0x10')]);router['post'](_0xc80e('0x11'),auth[_0xc80e('0xa')](),controller[_0xc80e('0x12')]);router[_0xc80e('0x13')]('/:id',auth[_0xc80e('0xa')](),controller[_0xc80e('0x14')]);router[_0xc80e('0x15')](_0xc80e('0x16'),auth[_0xc80e('0xa')](),controller[_0xc80e('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 6ff82c0..8c0db71 100644 --- a/server/api/dashboardItem/dashboardItem.attributes.js +++ b/server/api/dashboardItem/dashboardItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2542=['exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash'];(function(_0x86c6cb,_0x30bb53){var _0x1b1592=function(_0x19e1c9){while(--_0x19e1c9){_0x86c6cb['push'](_0x86c6cb['shift']());}};_0x1b1592(++_0x30bb53);}(_0x2542,0x169));var _0x2254=function(_0x4f37bc,_0x269366){_0x4f37bc=_0x4f37bc-0x0;var _0x259458=_0x2542[_0x4f37bc];return _0x259458;};'use strict';var Sequelize=require(_0x2254('0x0'));var squel=require(_0x2254('0x1'));var _=require(_0x2254('0x2'));module[_0x2254('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2254('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x2254('0x5')),'get':function(){try{return JSON[_0x2254('0x6')](this[_0x2254('0x7')](_0x2254('0x8')));}catch(_0x76c902){return[];}},'set':function(_0x508183){try{this[_0x2254('0x9')](_0x2254('0x8'),JSON[_0x2254('0xa')](_0x508183));}catch(_0x3c45ec){this[_0x2254('0x9')](_0x2254('0x8'),JSON[_0x2254('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x2254('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x2254('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x2254('0xb')]},'col':{'type':Sequelize[_0x2254('0xb')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2254('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x2254('0x4')],'allowNull':![],'defaultValue':_0x2254('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x2254('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0xe2fe=['setDataValue','INTEGER','sequelize','exports','STRING','TEXT','long','parse','getDataValue','attrs','stringify'];(function(_0x5b6dd2,_0x43f939){var _0x4a62e8=function(_0xa07ca4){while(--_0xa07ca4){_0x5b6dd2['push'](_0x5b6dd2['shift']());}};_0x4a62e8(++_0x43f939);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xee2f('0x0'));var squel=require('squel');var _=require('lodash');module[_0xee2f('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xee2f('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xee2f('0x3')](_0xee2f('0x4')),'get':function(){try{return JSON[_0xee2f('0x5')](this[_0xee2f('0x6')]('attrs'));}catch(_0x311a2f){return[];}},'set':function(_0x2b7e7c){try{this['setDataValue'](_0xee2f('0x7'),JSON[_0xee2f('0x8')](_0x2b7e7c));}catch(_0x5a7975){this[_0xee2f('0x9')]('attrs',JSON[_0xee2f('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xee2f('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xee2f('0xa')]},'col':{'type':Sequelize[_0xee2f('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xee2f('0x2')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 4f8a8ff..75a24af 100644 --- a/server/api/dashboardItem/dashboardItem.controller.js +++ b/server/api/dashboardItem/dashboardItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0024=['./dashboardItem.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','destroy','then','error','stack','name','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','catch','find','iframe','attrUrl','value','attrPath','attrs','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrOpenchannelAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrSmsAccounts','attrWhatsappAccounts','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','fast-json-patch','moment','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x2987b7,_0x2a79ea){var _0x3fd9d6=function(_0x3c5b54){while(--_0x3c5b54){_0x2987b7['push'](_0x2987b7['shift']());}};_0x3fd9d6(++_0x2a79ea);}(_0x0024,0xa8));var _0x4002=function(_0x88d3a,_0x5541d5){_0x88d3a=_0x88d3a-0x0;var _0x549872=_0x0024[_0x88d3a];return _0x549872;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4002('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4002('0x1'));var rp=require('request-promise');var moment=require(_0x4002('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4002('0x3'));var path=require(_0x4002('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4002('0x5'));var fs=require('fs');var fs_extra=require(_0x4002('0x6'));var _=require(_0x4002('0x7'));var squel=require(_0x4002('0x8'));var crypto=require('crypto');var jsforce=require(_0x4002('0x9'));var deskjs=require(_0x4002('0xa'));var toCsv=require(_0x4002('0xb'));var querystring=require(_0x4002('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4002('0xd'));var qs=require(_0x4002('0xe'));var as=require(_0x4002('0xf'));var hardwareService=require(_0x4002('0x10'));var logger=require(_0x4002('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4002('0x12'));var db=require(_0x4002('0x13'))['db'];config[_0x4002('0x14')]=_[_0x4002('0x15')](config['redis'],{'host':_0x4002('0x16'),'port':0x18eb});var socket=require(_0x4002('0x17'))(new Redis(config[_0x4002('0x14')]));require(_0x4002('0x18'))[_0x4002('0x19')](socket);function respondWithStatusCode(_0x50a1a8,_0x77b4c0){_0x77b4c0=_0x77b4c0||0xcc;return function(_0x4fe0b5){if(_0x4fe0b5){return _0x50a1a8[_0x4002('0x1a')](_0x77b4c0);}return _0x50a1a8[_0x4002('0x1b')](_0x77b4c0)[_0x4002('0x1c')]();};}function respondWithResult(_0x5813ff,_0x43a7e1){_0x43a7e1=_0x43a7e1||0xc8;return function(_0x5c4a33){if(_0x5c4a33){return _0x5813ff['status'](_0x43a7e1)[_0x4002('0x1d')](_0x5c4a33);}};}function respondWithFilteredResult(_0x3facc1,_0x4c0071){return function(_0x1b3401){if(_0x1b3401){var _0x4d5754=typeof _0x4c0071['offset']==='undefined'&&typeof _0x4c0071[_0x4002('0x1e')]===_0x4002('0x1f');var _0x283708=_0x1b3401[_0x4002('0x20')];var _0x514dfe=_0x4d5754?0x0:_0x4c0071[_0x4002('0x21')];var _0x1a5364=_0x4d5754?_0x1b3401[_0x4002('0x20')]:_0x4c0071['offset']+_0x4c0071[_0x4002('0x1e')];var _0x51b709;if(_0x1a5364>=_0x283708){_0x1a5364=_0x283708;_0x51b709=0xc8;}else{_0x51b709=0xce;}_0x3facc1[_0x4002('0x1b')](_0x51b709);return _0x3facc1[_0x4002('0x22')](_0x4002('0x23'),_0x514dfe+'-'+_0x1a5364+'/'+_0x283708)['json'](_0x1b3401);}return null;};}function patchUpdates(_0x52add8){return function(_0x447851){try{jsonpatch[_0x4002('0x24')](_0x447851,_0x52add8,!![]);}catch(_0x254b67){return BPromise['reject'](_0x254b67);}return _0x447851[_0x4002('0x25')]();};}function saveUpdates(_0x27732c,_0x18b000){return function(_0x23e917){if(_0x23e917){return _0x23e917[_0x4002('0x26')](_0x27732c)['then'](function(_0x3396d8){return _0x3396d8;});}return null;};}function removeEntity(_0x1dfb81,_0x385c35){return function(_0x425b3f){if(_0x425b3f){return _0x425b3f[_0x4002('0x27')]()[_0x4002('0x28')](function(){_0x1dfb81['status'](0xcc)[_0x4002('0x1c')]();});}};}function handleEntityNotFound(_0x2d148e,_0x49e273){return function(_0xf5ae88){if(!_0xf5ae88){_0x2d148e[_0x4002('0x1a')](0x194);}return _0xf5ae88;};}function handleError(_0x569154,_0xa7b46a){_0xa7b46a=_0xa7b46a||0x1f4;return function(_0x278907){logger[_0x4002('0x29')](_0x278907[_0x4002('0x2a')]);if(_0x278907[_0x4002('0x2b')]){delete _0x278907[_0x4002('0x2b')];}_0x569154[_0x4002('0x1b')](_0xa7b46a)['send'](_0x278907);};}exports[_0x4002('0x2c')]=function(_0x162173,_0x237704){var _0x598048={'raw':![],'where':{'id':_0x162173[_0x4002('0x2d')]['id']}},_0x52f488={};_0x52f488[_0x4002('0x2e')]=_[_0x4002('0x2f')](db[_0x4002('0x30')][_0x4002('0x31')]);_0x52f488[_0x4002('0x32')]=_[_0x4002('0x2f')](_0x162173[_0x4002('0x32')]);_0x52f488[_0x4002('0x33')]=_[_0x4002('0x34')](_0x52f488['model'],_0x52f488[_0x4002('0x32')]);_0x598048[_0x4002('0x35')]=_[_0x4002('0x34')](_0x52f488['model'],qs[_0x4002('0x36')](_0x162173[_0x4002('0x32')][_0x4002('0x36')]));_0x598048['attributes']=_0x598048[_0x4002('0x35')][_0x4002('0x37')]?_0x598048[_0x4002('0x35')]:_0x52f488[_0x4002('0x2e')];if(_0x162173[_0x4002('0x32')][_0x4002('0x38')]){_0x598048[_0x4002('0x39')]=[{'all':!![]}];}_0x598048=_['merge']({},_0x598048,_0x162173[_0x4002('0x3a')]);return db[_0x4002('0x30')]['find'](_0x598048)['then'](handleEntityNotFound(_0x237704,null))[_0x4002('0x28')](respondWithResult(_0x237704,null))[_0x4002('0x3b')](handleError(_0x237704,null));};exports[_0x4002('0x27')]=function(_0x5e412,_0x94ecc3){return db[_0x4002('0x30')][_0x4002('0x3c')]({'where':{'id':_0x5e412[_0x4002('0x2d')]['id']}})['then'](handleEntityNotFound(_0x94ecc3,null))[_0x4002('0x28')](removeEntity(_0x94ecc3,null))[_0x4002('0x3b')](handleError(_0x94ecc3,null));};function widgetAttributes(_0x3c1330){try{switch(_0x3c1330['type']){case _0x4002('0x3d'):return[{'name':'attrUrl','value':_0x3c1330[_0x4002('0x3e')]||(_0x3c1330['attrs']&&_0x3c1330['attrs'][0x0]?_0x3c1330['attrs'][0x0][_0x4002('0x3f')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x3c1330[_0x4002('0x40')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x0]?_0x3c1330['attrs'][0x0][_0x4002('0x3f')]:undefined)||''}];case _0x4002('0x42'):return[{'name':_0x4002('0x43'),'value':_0x3c1330[_0x4002('0x43')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x0]?_0x3c1330['attrs'][0x0][_0x4002('0x3f')]:undefined)||_0x4002('0x44')},{'name':_0x4002('0x45'),'value':_0x3c1330[_0x4002('0x45')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330['attrs'][0x1]?_0x3c1330[_0x4002('0x41')][0x1]['value']:undefined)||_0x4002('0x46')},{'name':_0x4002('0x47'),'value':_0x3c1330['attrFontSize']||(_0x3c1330['attrs']&&_0x3c1330[_0x4002('0x41')][0x2]?_0x3c1330[_0x4002('0x41')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x4002('0x48'),'value':_0x3c1330[_0x4002('0x48')]||(_0x3c1330['attrs']&&_0x3c1330[_0x4002('0x41')][0x0]?_0x3c1330[_0x4002('0x41')][0x0][_0x4002('0x3f')]:undefined)||_0x4002('0x49')},{'name':_0x4002('0x4a'),'value':_0x3c1330[_0x4002('0x4a')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x1]?_0x3c1330['attrs'][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x3c1330[_0x4002('0x47')]||(_0x3c1330['attrs']&&_0x3c1330[_0x4002('0x41')][0x2]?_0x3c1330['attrs'][0x2][_0x4002('0x3f')]:undefined)||0x14},{'name':_0x4002('0x4b'),'value':_0x3c1330[_0x4002('0x4b')]||(_0x3c1330['attrs']&&_0x3c1330[_0x4002('0x41')][0x3]?_0x3c1330['attrs'][0x3]['value']:undefined)||_0x4002('0x4c')},{'name':_0x4002('0x4d'),'value':_0x3c1330[_0x4002('0x4d')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330['attrs'][0x4]?_0x3c1330['attrs'][0x4][_0x4002('0x3f')]:undefined)||''},{'name':_0x4002('0x4e'),'value':_0x3c1330[_0x4002('0x4e')]||(_0x3c1330['attrs']&&_0x3c1330[_0x4002('0x41')][0x5]?_0x3c1330['attrs'][0x5][_0x4002('0x3f')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x3c1330['attrSmsAccounts']||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x6]?_0x3c1330['attrs'][0x6][_0x4002('0x3f')]:undefined)||''},{'name':_0x4002('0x4f'),'value':_0x3c1330[_0x4002('0x4f')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330['attrs'][0x7]?_0x3c1330['attrs'][0x7][_0x4002('0x3f')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3c1330['attrWhatsappAccounts']||(_0x3c1330['attrs']&&_0x3c1330[_0x4002('0x41')][0x8]?_0x3c1330[_0x4002('0x41')][0x8]['value']:undefined)||''},{'name':_0x4002('0x50'),'value':_0x3c1330[_0x4002('0x50')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x9]?_0x3c1330[_0x4002('0x41')][0x9][_0x4002('0x3f')]:undefined)||''}];case'multibar-chart':case _0x4002('0x51'):return[{'name':_0x4002('0x52'),'value':_0x3c1330['attrSerie1']||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x0]?_0x3c1330['attrs'][0x0][_0x4002('0x3f')]:undefined)||_0x4002('0x49')},{'name':_0x4002('0x53'),'value':_0x3c1330[_0x4002('0x53')]||(_0x3c1330['attrs']&&_0x3c1330[_0x4002('0x41')][0x1]?_0x3c1330[_0x4002('0x41')][0x1][_0x4002('0x3f')]:undefined)||null},{'name':_0x4002('0x54'),'value':_0x3c1330[_0x4002('0x54')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x2]?_0x3c1330[_0x4002('0x41')][0x2][_0x4002('0x3f')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x3c1330[_0x4002('0x4a')]||(_0x3c1330['attrs']&&_0x3c1330['attrs'][0x3]?_0x3c1330[_0x4002('0x41')][0x3]['value']:undefined)||[]},{'name':_0x4002('0x4b'),'value':_0x3c1330[_0x4002('0x4b')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x4]?_0x3c1330[_0x4002('0x41')][0x4][_0x4002('0x3f')]:undefined)||_0x4002('0x4c')},{'name':_0x4002('0x4d'),'value':_0x3c1330[_0x4002('0x4d')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x5]?_0x3c1330[_0x4002('0x41')][0x5][_0x4002('0x3f')]:undefined)||''},{'name':_0x4002('0x4e'),'value':_0x3c1330[_0x4002('0x4e')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x6]?_0x3c1330[_0x4002('0x41')][0x6][_0x4002('0x3f')]:undefined)||''},{'name':_0x4002('0x55'),'value':_0x3c1330[_0x4002('0x55')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x7]?_0x3c1330[_0x4002('0x41')][0x7][_0x4002('0x3f')]:undefined)||''},{'name':_0x4002('0x4f'),'value':_0x3c1330[_0x4002('0x4f')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x8]?_0x3c1330[_0x4002('0x41')][0x8][_0x4002('0x3f')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3c1330[_0x4002('0x56')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330['attrs'][0x9]?_0x3c1330[_0x4002('0x41')][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x3c1330[_0x4002('0x50')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0xa]?_0x3c1330['attrs'][0xa]['value']:undefined)||''}];case _0x4002('0x57'):return[{'name':_0x4002('0x58'),'type':_0x3c1330[_0x4002('0x59')]||(_0x3c1330['attrs']&&_0x3c1330['attrs'][0x0]?_0x3c1330[_0x4002('0x41')][0x0][_0x4002('0x5a')]:undefined)||null,'value':_0x3c1330['attrReport']||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330[_0x4002('0x41')][0x0]?_0x3c1330[_0x4002('0x41')][0x0]['value']:undefined)||null},{'name':_0x4002('0x5b'),'value':_0x3c1330[_0x4002('0x5b')]||(_0x3c1330[_0x4002('0x41')]&&_0x3c1330['attrs'][0x1]?_0x3c1330[_0x4002('0x41')][0x1][_0x4002('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x51a951){logger[_0x4002('0x29')](_0x4002('0x5c'),JSON[_0x4002('0x5d')](_0x51a951));return[];}}exports[_0x4002('0x5e')]=function(_0x5d1c12,_0x57922d){if(_0x5d1c12[_0x4002('0x5f')]){_0x5d1c12['body'][_0x4002('0x41')]=widgetAttributes(_0x5d1c12[_0x4002('0x5f')]);}return db[_0x4002('0x30')][_0x4002('0x5e')](_0x5d1c12['body'],{})[_0x4002('0x28')](respondWithResult(_0x57922d,0xc9))['catch'](handleError(_0x57922d,null));};exports[_0x4002('0x26')]=function(_0x4f596d,_0x2c0af7){if(_0x4f596d['body']['id']){delete _0x4f596d[_0x4002('0x5f')]['id'];}_0x4f596d['body'][_0x4002('0x41')]=widgetAttributes(_0x4f596d[_0x4002('0x5f')]);return db[_0x4002('0x30')][_0x4002('0x3c')]({'where':{'id':_0x4f596d[_0x4002('0x2d')]['id']}})['then'](handleEntityNotFound(_0x2c0af7,null))[_0x4002('0x28')](saveUpdates(_0x4f596d['body'],null))[_0x4002('0x28')](respondWithResult(_0x2c0af7,null))[_0x4002('0x3b')](handleError(_0x2c0af7,null));}; \ No newline at end of file +var _0x8efc=['apply','reject','update','then','destroy','error','name','show','model','rawAttributes','keys','intersection','query','attributes','fields','includeAll','include','options','DashboardItem','find','catch','params','type','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSmsAccounts','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','zip-dir','request-promise','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','status','end','offset','limit','set','Content-Range','json'];(function(_0x12b6df,_0x5571aa){var _0x4ec969=function(_0x3f7965){while(--_0x3f7965){_0x12b6df['push'](_0x12b6df['shift']());}};_0x4ec969(++_0x5571aa);}(_0x8efc,0x8f));var _0xc8ef=function(_0x1f8f66,_0x5dc25a){_0x1f8f66=_0x1f8f66-0x0;var _0x3b992d=_0x8efc[_0x1f8f66];return _0x3b992d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc8ef('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc8ef('0x1'));var moment=require('moment');var BPromise=require(_0xc8ef('0x2'));var Mustache=require(_0xc8ef('0x3'));var util=require('util');var path=require('path');var sox=require(_0xc8ef('0x4'));var csv=require('to-csv');var ejs=require(_0xc8ef('0x5'));var fs=require('fs');var fs_extra=require(_0xc8ef('0x6'));var _=require(_0xc8ef('0x7'));var squel=require(_0xc8ef('0x8'));var crypto=require(_0xc8ef('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc8ef('0xa'));var toCsv=require('to-csv');var querystring=require(_0xc8ef('0xb'));var Papa=require(_0xc8ef('0xc'));var Redis=require(_0xc8ef('0xd'));var authService=require(_0xc8ef('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8ef('0xf'))(_0xc8ef('0x10'));var utils=require(_0xc8ef('0x11'));var config=require(_0xc8ef('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc8ef('0x13'))['db'];config[_0xc8ef('0x14')]=_[_0xc8ef('0x15')](config[_0xc8ef('0x14')],{'host':_0xc8ef('0x16'),'port':0x18eb});var socket=require(_0xc8ef('0x17'))(new Redis(config[_0xc8ef('0x14')]));require(_0xc8ef('0x18'))['register'](socket);function respondWithStatusCode(_0x562685,_0xc4572e){_0xc4572e=_0xc4572e||0xcc;return function(_0x2d9ecf){if(_0x2d9ecf){return _0x562685[_0xc8ef('0x19')](_0xc4572e);}return _0x562685[_0xc8ef('0x1a')](_0xc4572e)[_0xc8ef('0x1b')]();};}function respondWithResult(_0x19054b,_0x957bb6){_0x957bb6=_0x957bb6||0xc8;return function(_0x4026c6){if(_0x4026c6){return _0x19054b['status'](_0x957bb6)['json'](_0x4026c6);}};}function respondWithFilteredResult(_0x38cad6,_0x1dc488){return function(_0x166ec4){if(_0x166ec4){var _0x183c85=typeof _0x1dc488['offset']==='undefined'&&typeof _0x1dc488['limit']==='undefined';var _0x14f7a0=_0x166ec4['count'];var _0x46a1b7=_0x183c85?0x0:_0x1dc488[_0xc8ef('0x1c')];var _0x12d604=_0x183c85?_0x166ec4['count']:_0x1dc488[_0xc8ef('0x1c')]+_0x1dc488[_0xc8ef('0x1d')];var _0x190ec2;if(_0x12d604>=_0x14f7a0){_0x12d604=_0x14f7a0;_0x190ec2=0xc8;}else{_0x190ec2=0xce;}_0x38cad6[_0xc8ef('0x1a')](_0x190ec2);return _0x38cad6[_0xc8ef('0x1e')](_0xc8ef('0x1f'),_0x46a1b7+'-'+_0x12d604+'/'+_0x14f7a0)[_0xc8ef('0x20')](_0x166ec4);}return null;};}function patchUpdates(_0x16bf51){return function(_0x20204f){try{jsonpatch[_0xc8ef('0x21')](_0x20204f,_0x16bf51,!![]);}catch(_0x1790d1){return BPromise[_0xc8ef('0x22')](_0x1790d1);}return _0x20204f['save']();};}function saveUpdates(_0x509619,_0x24b251){return function(_0x3688aa){if(_0x3688aa){return _0x3688aa[_0xc8ef('0x23')](_0x509619)[_0xc8ef('0x24')](function(_0x16c6d4){return _0x16c6d4;});}return null;};}function removeEntity(_0x50238c,_0x5093d3){return function(_0x14c3d0){if(_0x14c3d0){return _0x14c3d0[_0xc8ef('0x25')]()[_0xc8ef('0x24')](function(){_0x50238c['status'](0xcc)[_0xc8ef('0x1b')]();});}};}function handleEntityNotFound(_0x3d7a62,_0xf285d9){return function(_0xc6749){if(!_0xc6749){_0x3d7a62['sendStatus'](0x194);}return _0xc6749;};}function handleError(_0x5524dc,_0x1aad6e){_0x1aad6e=_0x1aad6e||0x1f4;return function(_0xc203df){logger[_0xc8ef('0x26')](_0xc203df['stack']);if(_0xc203df[_0xc8ef('0x27')]){delete _0xc203df[_0xc8ef('0x27')];}_0x5524dc[_0xc8ef('0x1a')](_0x1aad6e)['send'](_0xc203df);};}exports[_0xc8ef('0x28')]=function(_0x5c7b7b,_0x30dd95){var _0x3a54d4={'raw':![],'where':{'id':_0x5c7b7b['params']['id']}},_0x17c07c={};_0x17c07c[_0xc8ef('0x29')]=_['keys'](db['DashboardItem'][_0xc8ef('0x2a')]);_0x17c07c['query']=_[_0xc8ef('0x2b')](_0x5c7b7b['query']);_0x17c07c['filters']=_[_0xc8ef('0x2c')](_0x17c07c[_0xc8ef('0x29')],_0x17c07c[_0xc8ef('0x2d')]);_0x3a54d4[_0xc8ef('0x2e')]=_[_0xc8ef('0x2c')](_0x17c07c[_0xc8ef('0x29')],qs['fields'](_0x5c7b7b[_0xc8ef('0x2d')][_0xc8ef('0x2f')]));_0x3a54d4['attributes']=_0x3a54d4[_0xc8ef('0x2e')]['length']?_0x3a54d4['attributes']:_0x17c07c[_0xc8ef('0x29')];if(_0x5c7b7b[_0xc8ef('0x2d')][_0xc8ef('0x30')]){_0x3a54d4[_0xc8ef('0x31')]=[{'all':!![]}];}_0x3a54d4=_['merge']({},_0x3a54d4,_0x5c7b7b[_0xc8ef('0x32')]);return db[_0xc8ef('0x33')][_0xc8ef('0x34')](_0x3a54d4)[_0xc8ef('0x24')](handleEntityNotFound(_0x30dd95,null))[_0xc8ef('0x24')](respondWithResult(_0x30dd95,null))[_0xc8ef('0x35')](handleError(_0x30dd95,null));};exports[_0xc8ef('0x25')]=function(_0x5d32c8,_0x21e53d){return db['DashboardItem']['find']({'where':{'id':_0x5d32c8[_0xc8ef('0x36')]['id']}})[_0xc8ef('0x24')](handleEntityNotFound(_0x21e53d,null))[_0xc8ef('0x24')](removeEntity(_0x21e53d,null))[_0xc8ef('0x35')](handleError(_0x21e53d,null));};function widgetAttributes(_0xc1f2cf){try{switch(_0xc1f2cf[_0xc8ef('0x37')]){case _0xc8ef('0x38'):return[{'name':_0xc8ef('0x39'),'value':_0xc1f2cf[_0xc8ef('0x39')]||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf[_0xc8ef('0x3a')][0x0]?_0xc1f2cf[_0xc8ef('0x3a')][0x0][_0xc8ef('0x3b')]:undefined)||'https://'}];case'custom':return[{'name':_0xc8ef('0x3c'),'value':_0xc1f2cf[_0xc8ef('0x3c')]||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf[_0xc8ef('0x3a')][0x0]?_0xc1f2cf[_0xc8ef('0x3a')][0x0]['value']:undefined)||''}];case _0xc8ef('0x3d'):return[{'name':_0xc8ef('0x3e'),'value':_0xc1f2cf['attrHourFormat']||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf[_0xc8ef('0x3a')][0x0]?_0xc1f2cf[_0xc8ef('0x3a')][0x0][_0xc8ef('0x3b')]:undefined)||_0xc8ef('0x3f')},{'name':_0xc8ef('0x40'),'value':_0xc1f2cf['attrTimezone']||(_0xc1f2cf['attrs']&&_0xc1f2cf[_0xc8ef('0x3a')][0x1]?_0xc1f2cf[_0xc8ef('0x3a')][0x1][_0xc8ef('0x3b')]:undefined)||_0xc8ef('0x41')},{'name':'attrFontSize','value':_0xc1f2cf[_0xc8ef('0x42')]||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf['attrs'][0x2]?_0xc1f2cf[_0xc8ef('0x3a')][0x2][_0xc8ef('0x3b')]:undefined)||0xc}];case _0xc8ef('0x43'):return[{'name':_0xc8ef('0x44'),'value':_0xc1f2cf['attrMetric']||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf[_0xc8ef('0x3a')][0x0]?_0xc1f2cf[_0xc8ef('0x3a')][0x0][_0xc8ef('0x3b')]:undefined)||_0xc8ef('0x45')},{'name':_0xc8ef('0x46'),'value':_0xc1f2cf[_0xc8ef('0x46')]||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf[_0xc8ef('0x3a')][0x1]?_0xc1f2cf[_0xc8ef('0x3a')][0x1][_0xc8ef('0x3b')]:undefined)||[]},{'name':_0xc8ef('0x42'),'value':_0xc1f2cf[_0xc8ef('0x42')]||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf[_0xc8ef('0x3a')][0x2]?_0xc1f2cf[_0xc8ef('0x3a')][0x2]['value']:undefined)||0x14},{'name':_0xc8ef('0x47'),'value':_0xc1f2cf[_0xc8ef('0x47')]||(_0xc1f2cf['attrs']&&_0xc1f2cf[_0xc8ef('0x3a')][0x3]?_0xc1f2cf['attrs'][0x3][_0xc8ef('0x3b')]:undefined)||'voice'},{'name':_0xc8ef('0x48'),'value':_0xc1f2cf[_0xc8ef('0x48')]||(_0xc1f2cf['attrs']&&_0xc1f2cf['attrs'][0x4]?_0xc1f2cf['attrs'][0x4]['value']:undefined)||''},{'name':_0xc8ef('0x49'),'value':_0xc1f2cf[_0xc8ef('0x49')]||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf[_0xc8ef('0x3a')][0x5]?_0xc1f2cf[_0xc8ef('0x3a')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0xc1f2cf['attrSmsAccounts']||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf[_0xc8ef('0x3a')][0x6]?_0xc1f2cf[_0xc8ef('0x3a')][0x6][_0xc8ef('0x3b')]:undefined)||''},{'name':_0xc8ef('0x4a'),'value':_0xc1f2cf[_0xc8ef('0x4a')]||(_0xc1f2cf['attrs']&&_0xc1f2cf[_0xc8ef('0x3a')][0x7]?_0xc1f2cf[_0xc8ef('0x3a')][0x7]['value']:undefined)||''},{'name':_0xc8ef('0x4b'),'value':_0xc1f2cf['attrWhatsappAccounts']||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf['attrs'][0x8]?_0xc1f2cf['attrs'][0x8][_0xc8ef('0x3b')]:undefined)||''},{'name':'attrChatWebsites','value':_0xc1f2cf[_0xc8ef('0x4c')]||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf[_0xc8ef('0x3a')][0x9]?_0xc1f2cf[_0xc8ef('0x3a')][0x9]['value']:undefined)||''}];case _0xc8ef('0x4d'):case _0xc8ef('0x4e'):return[{'name':_0xc8ef('0x4f'),'value':_0xc1f2cf['attrSerie1']||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf['attrs'][0x0]?_0xc1f2cf[_0xc8ef('0x3a')][0x0][_0xc8ef('0x3b')]:undefined)||_0xc8ef('0x45')},{'name':_0xc8ef('0x50'),'value':_0xc1f2cf[_0xc8ef('0x50')]||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf[_0xc8ef('0x3a')][0x1]?_0xc1f2cf[_0xc8ef('0x3a')][0x1][_0xc8ef('0x3b')]:undefined)||null},{'name':'attrSerie3','value':_0xc1f2cf['attrSerie3']||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf['attrs'][0x2]?_0xc1f2cf[_0xc8ef('0x3a')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0xc1f2cf[_0xc8ef('0x46')]||(_0xc1f2cf['attrs']&&_0xc1f2cf['attrs'][0x3]?_0xc1f2cf[_0xc8ef('0x3a')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0xc1f2cf['attrChannel']||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf['attrs'][0x4]?_0xc1f2cf['attrs'][0x4][_0xc8ef('0x3b')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0xc1f2cf[_0xc8ef('0x48')]||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf[_0xc8ef('0x3a')][0x5]?_0xc1f2cf[_0xc8ef('0x3a')][0x5][_0xc8ef('0x3b')]:undefined)||''},{'name':'attrFaxAccounts','value':_0xc1f2cf['attrFaxAccounts']||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf[_0xc8ef('0x3a')][0x6]?_0xc1f2cf['attrs'][0x6][_0xc8ef('0x3b')]:undefined)||''},{'name':_0xc8ef('0x51'),'value':_0xc1f2cf['attrSmsAccounts']||(_0xc1f2cf['attrs']&&_0xc1f2cf['attrs'][0x7]?_0xc1f2cf[_0xc8ef('0x3a')][0x7]['value']:undefined)||''},{'name':_0xc8ef('0x4a'),'value':_0xc1f2cf[_0xc8ef('0x4a')]||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf[_0xc8ef('0x3a')][0x8]?_0xc1f2cf['attrs'][0x8][_0xc8ef('0x3b')]:undefined)||''},{'name':_0xc8ef('0x4b'),'value':_0xc1f2cf['attrWhatsappAccounts']||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf[_0xc8ef('0x3a')][0x9]?_0xc1f2cf[_0xc8ef('0x3a')][0x9][_0xc8ef('0x3b')]:undefined)||''},{'name':_0xc8ef('0x4c'),'value':_0xc1f2cf[_0xc8ef('0x4c')]||(_0xc1f2cf['attrs']&&_0xc1f2cf['attrs'][0xa]?_0xc1f2cf[_0xc8ef('0x3a')][0xa]['value']:undefined)||''}];case'web-report':return[{'name':_0xc8ef('0x52'),'type':_0xc1f2cf['reportType']||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf[_0xc8ef('0x3a')][0x0]?_0xc1f2cf[_0xc8ef('0x3a')][0x0][_0xc8ef('0x37')]:undefined)||null,'value':_0xc1f2cf[_0xc8ef('0x52')]||(_0xc1f2cf['attrs']&&_0xc1f2cf[_0xc8ef('0x3a')][0x0]?_0xc1f2cf[_0xc8ef('0x3a')][0x0][_0xc8ef('0x3b')]:undefined)||null},{'name':_0xc8ef('0x53'),'value':_0xc1f2cf[_0xc8ef('0x53')]||(_0xc1f2cf[_0xc8ef('0x3a')]&&_0xc1f2cf['attrs'][0x1]?_0xc1f2cf[_0xc8ef('0x3a')][0x1][_0xc8ef('0x3b')]:undefined)||0x0}];default:return[];}}catch(_0x36f35b){logger[_0xc8ef('0x26')](_0xc8ef('0x54'),JSON[_0xc8ef('0x55')](_0x36f35b));return[];}}exports[_0xc8ef('0x56')]=function(_0x493bc8,_0x403dee){if(_0x493bc8[_0xc8ef('0x57')]){_0x493bc8[_0xc8ef('0x57')][_0xc8ef('0x3a')]=widgetAttributes(_0x493bc8[_0xc8ef('0x57')]);}return db['DashboardItem'][_0xc8ef('0x56')](_0x493bc8[_0xc8ef('0x57')],{})[_0xc8ef('0x24')](respondWithResult(_0x403dee,0xc9))['catch'](handleError(_0x403dee,null));};exports[_0xc8ef('0x23')]=function(_0x5c8bfa,_0x23dc4a){if(_0x5c8bfa[_0xc8ef('0x57')]['id']){delete _0x5c8bfa[_0xc8ef('0x57')]['id'];}_0x5c8bfa[_0xc8ef('0x57')][_0xc8ef('0x3a')]=widgetAttributes(_0x5c8bfa['body']);return db[_0xc8ef('0x33')][_0xc8ef('0x34')]({'where':{'id':_0x5c8bfa[_0xc8ef('0x36')]['id']}})['then'](handleEntityNotFound(_0x23dc4a,null))[_0xc8ef('0x24')](saveUpdates(_0x5c8bfa[_0xc8ef('0x57')],null))['then'](respondWithResult(_0x23dc4a,null))[_0xc8ef('0x35')](handleError(_0x23dc4a,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 12fd395..f200fa7 100644 --- a/server/api/dashboardItem/dashboardItem.events.js +++ b/server/api/dashboardItem/dashboardItem.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd114=['events','../../mysqldb','DashboardItem','update','remove','emit','exports'];(function(_0x49aabc,_0x3385c6){var _0x574343=function(_0x4c4429){while(--_0x4c4429){_0x49aabc['push'](_0x49aabc['shift']());}};_0x574343(++_0x3385c6);}(_0xd114,0x157));var _0x4d11=function(_0x20cefc,_0x557f67){_0x20cefc=_0x20cefc-0x0;var _0x4a9cd8=_0xd114[_0x20cefc];return _0x4a9cd8;};'use strict';var EventEmitter=require(_0x4d11('0x0'));var DashboardItem=require(_0x4d11('0x1'))['db'][_0x4d11('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4d11('0x3'),'afterDestroy':_0x4d11('0x4')};function emitEvent(_0x68e8b8){return function(_0x1c0c6f,_0x1d5b41,_0x388e41){DashboardItemEvents[_0x4d11('0x5')](_0x68e8b8+':'+_0x1c0c6f['id'],_0x1c0c6f);DashboardItemEvents[_0x4d11('0x5')](_0x68e8b8,_0x1c0c6f);_0x388e41(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x4d11('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0x4d02=['DashboardItem','setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x5f25b2,_0x46fe2a){var _0x5fc13b=function(_0x52eb58){while(--_0x52eb58){_0x5f25b2['push'](_0x5f25b2['shift']());}};_0x5fc13b(++_0x46fe2a);}(_0x4d02,0x10c));var _0x24d0=function(_0x3fc59d,_0x57ecb6){_0x3fc59d=_0x3fc59d-0x0;var _0x4f900d=_0x4d02[_0x3fc59d];return _0x4f900d;};'use strict';var EventEmitter=require(_0x24d0('0x0'));var DashboardItem=require(_0x24d0('0x1'))['db'][_0x24d0('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x24d0('0x3')](0x0);var events={'afterCreate':_0x24d0('0x4'),'afterUpdate':_0x24d0('0x5'),'afterDestroy':'remove'};function emitEvent(_0x47cfe2){return function(_0xd8e803,_0xc8a73f,_0x787c4a){DashboardItemEvents[_0x24d0('0x6')](_0x47cfe2+':'+_0xd8e803['id'],_0xd8e803);DashboardItemEvents[_0x24d0('0x6')](_0x47cfe2,_0xd8e803);_0x787c4a(null);};}for(var e in events){if(events[_0x24d0('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x24d0('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 6c0dc51..b169e3a 100644 --- a/server/api/dashboardItem/dashboardItem.model.js +++ b/server/api/dashboardItem/dashboardItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed7f=['path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','api','moment','bluebird','request-promise'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xed7f,0xd8));var _0xfed7=function(_0x1591b0,_0x31909f){_0x1591b0=_0x1591b0-0x0;var _0x29c8de=_0xed7f[_0x1591b0];return _0x29c8de;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xfed7('0x0'));var moment=require(_0xfed7('0x1'));var BPromise=require(_0xfed7('0x2'));var rp=require(_0xfed7('0x3'));var fs=require('fs');var path=require(_0xfed7('0x4'));var rimraf=require(_0xfed7('0x5'));var config=require(_0xfed7('0x6'));var attributes=require(_0xfed7('0x7'));module[_0xfed7('0x8')]=function(_0x5abbf6,_0x585551){return _0x5abbf6[_0xfed7('0x9')](_0xfed7('0xa'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa87e=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./dashboardItem.attributes','define','dashboard_items'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa87e,0x118));var _0xea87=function(_0x9d0fc6,_0x23d10f){_0x9d0fc6=_0x9d0fc6-0x0;var _0x3f161e=_0xa87e[_0x9d0fc6];return _0x3f161e;};'use strict';var _=require('lodash');var util=require(_0xea87('0x0'));var logger=require(_0xea87('0x1'))('api');var moment=require(_0xea87('0x2'));var BPromise=require(_0xea87('0x3'));var rp=require(_0xea87('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xea87('0x5'));var config=require(_0xea87('0x6'));var attributes=require(_0xea87('0x7'));module['exports']=function(_0x59bd54,_0x2cd40f){return _0x59bd54[_0xea87('0x8')]('DashboardItem',attributes,{'tableName':_0xea87('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index fee7830..8d0fb98 100644 --- a/server/api/dashboardItem/dashboardItem.rpc.js +++ b/server/api/dashboardItem/dashboardItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x995c=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./dashboardItem.socket','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x3297b8,_0x17ce35){var _0x2066de=function(_0x4750c3){while(--_0x4750c3){_0x3297b8['push'](_0x3297b8['shift']());}};_0x2066de(++_0x17ce35);}(_0x995c,0x142));var _0xc995=function(_0x5d0980,_0x26474b){_0x5d0980=_0x5d0980-0x0;var _0x3d6318=_0x995c[_0x5d0980];return _0x3d6318;};'use strict';var _=require(_0xc995('0x0'));var util=require(_0xc995('0x1'));var moment=require('moment');var BPromise=require(_0xc995('0x2'));var rs=require(_0xc995('0x3'));var fs=require('fs');var Redis=require(_0xc995('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc995('0x5'))(_0xc995('0x6'));var config=require(_0xc995('0x7'));var jayson=require(_0xc995('0x8'));var client=jayson[_0xc995('0x9')][_0xc995('0xa')]({'port':0x232a});config[_0xc995('0xb')]=_[_0xc995('0xc')](config[_0xc995('0xb')],{'host':_0xc995('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc995('0xb')]));require(_0xc995('0xe'))['register'](socket);function respondWithRpcPromise(_0x4ce1d5,_0x247f63,_0x3a901a){return new BPromise(function(_0xc8b03a,_0x4567f7){return client[_0xc995('0xf')](_0x4ce1d5,_0x3a901a)[_0xc995('0x10')](function(_0x50ed4d){logger['info'](_0xc995('0x11'),_0x247f63,_0xc995('0x12'));logger[_0xc995('0x13')](_0xc995('0x14'),_0x247f63,_0xc995('0x12'),JSON[_0xc995('0x15')](_0x50ed4d));if(_0x50ed4d[_0xc995('0x16')]){if(_0x50ed4d[_0xc995('0x16')][_0xc995('0x17')]===0x1f4){logger[_0xc995('0x16')](_0xc995('0x11'),_0x247f63,_0x50ed4d[_0xc995('0x16')][_0xc995('0x18')]);return _0x4567f7(_0x50ed4d[_0xc995('0x16')][_0xc995('0x18')]);}logger[_0xc995('0x16')](_0xc995('0x11'),_0x247f63,_0x50ed4d[_0xc995('0x16')][_0xc995('0x18')]);return _0xc8b03a(_0x50ed4d[_0xc995('0x16')]['message']);}else{logger['info'](_0xc995('0x11'),_0x247f63,_0xc995('0x12'));_0xc8b03a(_0x50ed4d[_0xc995('0x19')][_0xc995('0x18')]);}})[_0xc995('0x1a')](function(_0x2ca40b){logger[_0xc995('0x16')](_0xc995('0x11'),_0x247f63,_0x2ca40b);_0x4567f7(_0x2ca40b);});});} \ No newline at end of file +var _0xe5d7=['redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x549565,_0x54bdb0){var _0x23c3cd=function(_0x3a81e7){while(--_0x3a81e7){_0x549565['push'](_0x549565['shift']());}};_0x23c3cd(++_0x54bdb0);}(_0xe5d7,0xc5));var _0x7e5d=function(_0x50b049,_0x3ac6f5){_0x50b049=_0x50b049-0x0;var _0x32ebe9=_0xe5d7[_0x50b049];return _0x32ebe9;};'use strict';var _=require('lodash');var util=require(_0x7e5d('0x0'));var moment=require(_0x7e5d('0x1'));var BPromise=require(_0x7e5d('0x2'));var rs=require(_0x7e5d('0x3'));var fs=require('fs');var Redis=require(_0x7e5d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e5d('0x5'));var logger=require(_0x7e5d('0x6'))(_0x7e5d('0x7'));var config=require(_0x7e5d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7e5d('0x9')][_0x7e5d('0xa')]({'port':0x232a});config[_0x7e5d('0xb')]=_[_0x7e5d('0xc')](config[_0x7e5d('0xb')],{'host':_0x7e5d('0xd'),'port':0x18eb});var socket=require(_0x7e5d('0xe'))(new Redis(config[_0x7e5d('0xb')]));require(_0x7e5d('0xf'))[_0x7e5d('0x10')](socket);function respondWithRpcPromise(_0x1f6fce,_0xc02d3b,_0x510abc){return new BPromise(function(_0x5a61f2,_0x34c4ed){return client['request'](_0x1f6fce,_0x510abc)[_0x7e5d('0x11')](function(_0x3fd6b1){logger[_0x7e5d('0x12')](_0x7e5d('0x13'),_0xc02d3b,_0x7e5d('0x14'));logger[_0x7e5d('0x15')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0xc02d3b,'request\x20sent',JSON[_0x7e5d('0x16')](_0x3fd6b1));if(_0x3fd6b1[_0x7e5d('0x17')]){if(_0x3fd6b1[_0x7e5d('0x17')]['code']===0x1f4){logger[_0x7e5d('0x17')](_0x7e5d('0x13'),_0xc02d3b,_0x3fd6b1[_0x7e5d('0x17')]['message']);return _0x34c4ed(_0x3fd6b1[_0x7e5d('0x17')]['message']);}logger[_0x7e5d('0x17')](_0x7e5d('0x13'),_0xc02d3b,_0x3fd6b1['error'][_0x7e5d('0x18')]);return _0x5a61f2(_0x3fd6b1[_0x7e5d('0x17')][_0x7e5d('0x18')]);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0xc02d3b,_0x7e5d('0x14'));_0x5a61f2(_0x3fd6b1[_0x7e5d('0x19')][_0x7e5d('0x18')]);}})['catch'](function(_0x3bbb6a){logger[_0x7e5d('0x17')](_0x7e5d('0x13'),_0xc02d3b,_0x3bbb6a);_0x34c4ed(_0x3bbb6a);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 87f5d43..bc3eb0a 100644 --- a/server/api/dashboardItem/dashboardItem.socket.js +++ b/server/api/dashboardItem/dashboardItem.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f17=['save','update','removeListener','length','./dashboardItem.events'];(function(_0x350aeb,_0x3d265a){var _0x3c5273=function(_0x32b417){while(--_0x32b417){_0x350aeb['push'](_0x350aeb['shift']());}};_0x3c5273(++_0x3d265a);}(_0x9f17,0x1c1));var _0x79f1=function(_0x166b8f,_0x414e08){_0x166b8f=_0x166b8f-0x0;var _0x32a08d=_0x9f17[_0x166b8f];return _0x32a08d;};'use strict';var DashboardItemEvents=require(_0x79f1('0x0'));var events=[_0x79f1('0x1'),'remove',_0x79f1('0x2')];function createListener(_0x1e869a,_0x48ac39){return function(_0x20829a){_0x48ac39['emit'](_0x1e869a,_0x20829a);};}function removeListener(_0x35883b,_0x3c80e4){return function(){DashboardItemEvents[_0x79f1('0x3')](_0x35883b,_0x3c80e4);};}exports['register']=function(_0x25e315){for(var _0x15e291=0x0,_0x1352fc=events[_0x79f1('0x4')];_0x15e291<_0x1352fc;_0x15e291++){var _0x3e94bc=events[_0x15e291];var _0x235c89=createListener('dashboardItem:'+_0x3e94bc,_0x25e315);DashboardItemEvents['on'](_0x3e94bc,_0x235c89);}}; \ No newline at end of file +var _0xc30f=['update','register','length','dashboardItem:','save'];(function(_0x360512,_0x5a3d66){var _0x355ca3=function(_0x469552){while(--_0x469552){_0x360512['push'](_0x360512['shift']());}};_0x355ca3(++_0x5a3d66);}(_0xc30f,0x1cb));var _0xfc30=function(_0x17d06b,_0x91eb8b){_0x17d06b=_0x17d06b-0x0;var _0x43f5df=_0xc30f[_0x17d06b];return _0x43f5df;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xfc30('0x0'),'remove',_0xfc30('0x1')];function createListener(_0x1a8e77,_0x56b770){return function(_0x187e33){_0x56b770['emit'](_0x1a8e77,_0x187e33);};}function removeListener(_0x3769b4,_0x21dd7e){return function(){DashboardItemEvents['removeListener'](_0x3769b4,_0x21dd7e);};}exports[_0xfc30('0x2')]=function(_0x57dbbd){for(var _0x416755=0x0,_0x1b19d1=events[_0xfc30('0x3')];_0x416755<_0x1b19d1;_0x416755++){var _0x394ff5=events[_0x416755];var _0x2e4a1d=createListener(_0xfc30('0x4')+_0x394ff5,_0x57dbbd);DashboardItemEvents['on'](_0x394ff5,_0x2e4a1d);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 8ade27c..1d2d6e3 100644 --- a/server/api/dashboardItem/index.js +++ b/server/api/dashboardItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xecf3=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','/:id','create','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0x2317bb,_0x3aa554){var _0x57e984=function(_0x5c8e8e){while(--_0x5c8e8e){_0x2317bb['push'](_0x2317bb['shift']());}};_0x57e984(++_0x3aa554);}(_0xecf3,0x18b));var _0x3ecf=function(_0x3ab07e,_0x1f4e83){_0x3ab07e=_0x3ab07e-0x0;var _0x3ca832=_0xecf3[_0x3ab07e];return _0x3ca832;};'use strict';var multer=require(_0x3ecf('0x0'));var util=require(_0x3ecf('0x1'));var path=require(_0x3ecf('0x2'));var timeout=require(_0x3ecf('0x3'));var express=require(_0x3ecf('0x4'));var router=express[_0x3ecf('0x5')]();var fs_extra=require(_0x3ecf('0x6'));var auth=require(_0x3ecf('0x7'));var interaction=require(_0x3ecf('0x8'));var config=require('../../config/environment');var controller=require(_0x3ecf('0x9'));router[_0x3ecf('0xa')](_0x3ecf('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3ecf('0xc')]);router['put'](_0x3ecf('0xb'),auth[_0x3ecf('0xd')](),controller[_0x3ecf('0xe')]);router[_0x3ecf('0xf')]('/:id',auth[_0x3ecf('0xd')](),controller[_0x3ecf('0x10')]);module[_0x3ecf('0x11')]=router; \ No newline at end of file +var _0xeb18=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports'];(function(_0x46b6dc,_0x5a248a){var _0x5727af=function(_0x5bce81){while(--_0x5bce81){_0x46b6dc['push'](_0x46b6dc['shift']());}};_0x5727af(++_0x5a248a);}(_0xeb18,0x1e0));var _0x8eb1=function(_0x3ddd2f,_0x46335c){_0x3ddd2f=_0x3ddd2f-0x0;var _0x569fb7=_0xeb18[_0x3ddd2f];return _0x569fb7;};'use strict';var multer=require(_0x8eb1('0x0'));var util=require(_0x8eb1('0x1'));var path=require(_0x8eb1('0x2'));var timeout=require(_0x8eb1('0x3'));var express=require(_0x8eb1('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8eb1('0x5'));var interaction=require(_0x8eb1('0x6'));var config=require('../../config/environment');var controller=require('./dashboardItem.controller');router['get'](_0x8eb1('0x7'),auth[_0x8eb1('0x8')](),controller[_0x8eb1('0x9')]);router['post']('/',auth[_0x8eb1('0x8')](),controller[_0x8eb1('0xa')]);router[_0x8eb1('0xb')](_0x8eb1('0x7'),auth[_0x8eb1('0x8')](),controller[_0x8eb1('0xc')]);router[_0x8eb1('0xd')]('/:id',auth[_0x8eb1('0x8')](),controller[_0x8eb1('0xe')]);module[_0x8eb1('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 331e16d..6917023 100644 --- a/server/api/disposition/disposition.attributes.js +++ b/server/api/disposition/disposition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7fc=['first','third','STRING','sequelize','exports'];(function(_0x53c506,_0x1c0fe8){var _0x165888=function(_0x46f0b6){while(--_0x46f0b6){_0x53c506['push'](_0x53c506['shift']());}};_0x165888(++_0x1c0fe8);}(_0xf7fc,0x1b6));var _0xcf7f=function(_0x5aac87,_0x5f497e){_0x5aac87=_0x5aac87-0x0;var _0x232a5b=_0xf7fc[_0x5aac87];return _0x232a5b;};'use strict';var Sequelize=require(_0xcf7f('0x0'));module[_0xcf7f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xcf7f('0x2'),'second',_0xcf7f('0x3')),'allowNull':![],'defaultValue':_0xcf7f('0x2')},'description':{'type':Sequelize[_0xcf7f('0x4')]}}; \ No newline at end of file +var _0x0d11=['ENUM','second','third','STRING','exports'];(function(_0x25b439,_0xb20872){var _0xbf2210=function(_0x518b01){while(--_0x518b01){_0x25b439['push'](_0x25b439['shift']());}};_0xbf2210(++_0xb20872);}(_0x0d11,0x1b2));var _0x10d1=function(_0x30173c,_0x599eb2){_0x30173c=_0x30173c-0x0;var _0x210c49=_0x0d11[_0x30173c];return _0x210c49;};'use strict';var Sequelize=require('sequelize');module[_0x10d1('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x10d1('0x1')]('first',_0x10d1('0x2'),_0x10d1('0x3')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x10d1('0x4')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index b14e724..81cab2f 100644 --- a/server/api/disposition/disposition.controller.js +++ b/server/api/disposition/disposition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe574=['userProfileId','autoAssociation','UserProfileResource','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','save','destroy','then','get','Dispositions','error','stack','name','index','map','Disposition','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','includeAll','findAll','rows','catch','params','include','options','find','create','body','user','role','UserProfileSection'];(function(_0x33b912,_0xd206d2){var _0x29cd8d=function(_0x4f5e40){while(--_0x4f5e40){_0x33b912['push'](_0x33b912['shift']());}};_0x29cd8d(++_0xd206d2);}(_0xe574,0x100));var _0x4e57=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xe574[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require(_0x4e57('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e57('0x1'));var jsonpatch=require(_0x4e57('0x2'));var rp=require(_0x4e57('0x3'));var moment=require(_0x4e57('0x4'));var BPromise=require(_0x4e57('0x5'));var Mustache=require(_0x4e57('0x6'));var util=require(_0x4e57('0x7'));var path=require(_0x4e57('0x8'));var sox=require(_0x4e57('0x9'));var csv=require(_0x4e57('0xa'));var ejs=require(_0x4e57('0xb'));var fs=require('fs');var fs_extra=require(_0x4e57('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4e57('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4e57('0xa'));var querystring=require(_0x4e57('0xe'));var Papa=require(_0x4e57('0xf'));var Redis=require(_0x4e57('0x10'));var authService=require(_0x4e57('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4e57('0x12'));var hardwareService=require(_0x4e57('0x13'));var logger=require(_0x4e57('0x14'))(_0x4e57('0x15'));var utils=require(_0x4e57('0x16'));var config=require(_0x4e57('0x17'));var licenseUtil=require(_0x4e57('0x18'));var db=require(_0x4e57('0x19'))['db'];function respondWithStatusCode(_0xed8cbc,_0x40c8c8){_0x40c8c8=_0x40c8c8||0xcc;return function(_0x330868){if(_0x330868){return _0xed8cbc[_0x4e57('0x1a')](_0x40c8c8);}return _0xed8cbc[_0x4e57('0x1b')](_0x40c8c8)[_0x4e57('0x1c')]();};}function respondWithResult(_0x28f876,_0x2e9fa8){_0x2e9fa8=_0x2e9fa8||0xc8;return function(_0x4f088a){if(_0x4f088a){return _0x28f876[_0x4e57('0x1b')](_0x2e9fa8)['json'](_0x4f088a);}};}function respondWithFilteredResult(_0x254285,_0x4af0a6){return function(_0x3401c4){if(_0x3401c4){var _0x214957=typeof _0x4af0a6['offset']===_0x4e57('0x1d')&&typeof _0x4af0a6[_0x4e57('0x1e')]===_0x4e57('0x1d');var _0xb06d8=_0x3401c4['count'];var _0x2ed980=_0x214957?0x0:_0x4af0a6[_0x4e57('0x1f')];var _0x3c2978=_0x214957?_0x3401c4[_0x4e57('0x20')]:_0x4af0a6[_0x4e57('0x1f')]+_0x4af0a6['limit'];var _0x182286;if(_0x3c2978>=_0xb06d8){_0x3c2978=_0xb06d8;_0x182286=0xc8;}else{_0x182286=0xce;}_0x254285[_0x4e57('0x1b')](_0x182286);return _0x254285[_0x4e57('0x21')](_0x4e57('0x22'),_0x2ed980+'-'+_0x3c2978+'/'+_0xb06d8)['json'](_0x3401c4);}return null;};}function patchUpdates(_0x372295){return function(_0x59df7a){try{jsonpatch[_0x4e57('0x23')](_0x59df7a,_0x372295,!![]);}catch(_0x5b6127){return BPromise[_0x4e57('0x24')](_0x5b6127);}return _0x59df7a[_0x4e57('0x25')]();};}function saveUpdates(_0x427c6b,_0x43c9a7){return function(_0x45f9cd){if(_0x45f9cd){return _0x45f9cd['update'](_0x427c6b)['then'](function(_0x17e309){return _0x17e309;});}return null;};}function removeEntity(_0x58d6ea,_0x315f7c){return function(_0x4cfa0e){if(_0x4cfa0e){return _0x4cfa0e[_0x4e57('0x26')]()[_0x4e57('0x27')](function(){var _0x38bcaa=_0x4cfa0e[_0x4e57('0x28')]({'plain':!![]});var _0x29df93=_0x4e57('0x29');return db['UserProfileResource'][_0x4e57('0x26')]({'where':{'type':_0x29df93,'resourceId':_0x38bcaa['id']}})[_0x4e57('0x27')](function(){return _0x4cfa0e;});})['then'](function(){_0x58d6ea[_0x4e57('0x1b')](0xcc)[_0x4e57('0x1c')]();});}};}function handleEntityNotFound(_0x24b9b5,_0x2ccc1f){return function(_0x45aaf1){if(!_0x45aaf1){_0x24b9b5[_0x4e57('0x1a')](0x194);}return _0x45aaf1;};}function handleError(_0x1b0ce5,_0x548a92){_0x548a92=_0x548a92||0x1f4;return function(_0x1a26f6){logger[_0x4e57('0x2a')](_0x1a26f6[_0x4e57('0x2b')]);if(_0x1a26f6[_0x4e57('0x2c')]){delete _0x1a26f6[_0x4e57('0x2c')];}_0x1b0ce5['status'](_0x548a92)['send'](_0x1a26f6);};}exports[_0x4e57('0x2d')]=function(_0x59dd4e,_0x3ce391){var _0xb7c60={},_0x4bafa8={},_0xdbd90f={'count':0x0,'rows':[]};var _0x5ba48c=_[_0x4e57('0x2e')](db[_0x4e57('0x2f')][_0x4e57('0x30')],function(_0x5e2453){return{'name':_0x5e2453[_0x4e57('0x31')],'type':_0x5e2453[_0x4e57('0x32')]['key']};});_0x4bafa8[_0x4e57('0x33')]=_['map'](_0x5ba48c,'name');_0x4bafa8[_0x4e57('0x34')]=_[_0x4e57('0x35')](_0x59dd4e[_0x4e57('0x34')]);_0x4bafa8['filters']=_[_0x4e57('0x36')](_0x4bafa8['model'],_0x4bafa8[_0x4e57('0x34')]);_0xb7c60[_0x4e57('0x37')]=_[_0x4e57('0x36')](_0x4bafa8['model'],qs[_0x4e57('0x38')](_0x59dd4e[_0x4e57('0x34')][_0x4e57('0x38')]));_0xb7c60[_0x4e57('0x37')]=_0xb7c60[_0x4e57('0x37')][_0x4e57('0x39')]?_0xb7c60[_0x4e57('0x37')]:_0x4bafa8[_0x4e57('0x33')];if(!_0x59dd4e[_0x4e57('0x34')][_0x4e57('0x3a')](_0x4e57('0x3b'))){_0xb7c60['limit']=qs[_0x4e57('0x1e')](_0x59dd4e['query'][_0x4e57('0x1e')]);_0xb7c60[_0x4e57('0x1f')]=qs[_0x4e57('0x1f')](_0x59dd4e[_0x4e57('0x34')]['offset']);}_0xb7c60['order']=qs[_0x4e57('0x3c')](_0x59dd4e[_0x4e57('0x34')][_0x4e57('0x3c')]);_0xb7c60[_0x4e57('0x3d')]=qs[_0x4e57('0x3e')](_[_0x4e57('0x3f')](_0x59dd4e[_0x4e57('0x34')],_0x4bafa8[_0x4e57('0x3e')]),_0x5ba48c);if(_0x59dd4e[_0x4e57('0x34')]['filter']){_0xb7c60[_0x4e57('0x3d')]=_['merge'](_0xb7c60[_0x4e57('0x3d')],{'$or':_[_0x4e57('0x2e')](_0x5ba48c,function(_0x526ea6){if(_0x526ea6[_0x4e57('0x32')]!==_0x4e57('0x40')){var _0x7b4391={};_0x7b4391[_0x526ea6[_0x4e57('0x2c')]]={'$like':'%'+_0x59dd4e[_0x4e57('0x34')][_0x4e57('0x41')]+'%'};return _0x7b4391;}})});}_0xb7c60=_[_0x4e57('0x42')]({},_0xb7c60,_0x59dd4e['options']);var _0x9a449d={'where':_0xb7c60[_0x4e57('0x3d')]};return db['Disposition'][_0x4e57('0x20')](_0x9a449d)[_0x4e57('0x27')](function(_0x2ef995){_0xdbd90f[_0x4e57('0x20')]=_0x2ef995;if(_0x59dd4e[_0x4e57('0x34')][_0x4e57('0x43')]){_0xb7c60['include']=[{'all':!![]}];}return db[_0x4e57('0x2f')][_0x4e57('0x44')](_0xb7c60);})[_0x4e57('0x27')](function(_0x330da6){_0xdbd90f[_0x4e57('0x45')]=_0x330da6;return _0xdbd90f;})[_0x4e57('0x27')](respondWithFilteredResult(_0x3ce391,_0xb7c60))[_0x4e57('0x46')](handleError(_0x3ce391,null));};exports['show']=function(_0x4434ed,_0x3a86eb){var _0x97c403={'raw':!![],'where':{'id':_0x4434ed[_0x4e57('0x47')]['id']}},_0x1aefd2={};_0x1aefd2['model']=_[_0x4e57('0x35')](db[_0x4e57('0x2f')][_0x4e57('0x30')]);_0x1aefd2[_0x4e57('0x34')]=_[_0x4e57('0x35')](_0x4434ed[_0x4e57('0x34')]);_0x1aefd2[_0x4e57('0x3e')]=_[_0x4e57('0x36')](_0x1aefd2[_0x4e57('0x33')],_0x1aefd2[_0x4e57('0x34')]);_0x97c403['attributes']=_['intersection'](_0x1aefd2['model'],qs[_0x4e57('0x38')](_0x4434ed[_0x4e57('0x34')][_0x4e57('0x38')]));_0x97c403[_0x4e57('0x37')]=_0x97c403[_0x4e57('0x37')][_0x4e57('0x39')]?_0x97c403[_0x4e57('0x37')]:_0x1aefd2[_0x4e57('0x33')];if(_0x4434ed[_0x4e57('0x34')][_0x4e57('0x43')]){_0x97c403[_0x4e57('0x48')]=[{'all':!![]}];}_0x97c403=_[_0x4e57('0x42')]({},_0x97c403,_0x4434ed[_0x4e57('0x49')]);return db['Disposition'][_0x4e57('0x4a')](_0x97c403)[_0x4e57('0x27')](handleEntityNotFound(_0x3a86eb,null))[_0x4e57('0x27')](respondWithResult(_0x3a86eb,null))[_0x4e57('0x46')](handleError(_0x3a86eb,null));};exports[_0x4e57('0x4b')]=function(_0x41d476,_0x48869d){return db[_0x4e57('0x2f')][_0x4e57('0x4b')](_0x41d476[_0x4e57('0x4c')],{})[_0x4e57('0x27')](function(_0x3cdb3f){var _0x3bacfb=_0x41d476[_0x4e57('0x4d')][_0x4e57('0x28')]({'plain':!![]});if(!_0x3bacfb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3bacfb[_0x4e57('0x4e')]==='user'){var _0x3deb47=_0x3cdb3f[_0x4e57('0x28')]({'plain':!![]});var _0x2e880f='Dispositions';return db[_0x4e57('0x4f')]['find']({'where':{'name':_0x2e880f,'userProfileId':_0x3bacfb[_0x4e57('0x50')]},'raw':!![]})[_0x4e57('0x27')](function(_0x243a7e){if(_0x243a7e&&_0x243a7e[_0x4e57('0x51')]===0x0){return db[_0x4e57('0x52')][_0x4e57('0x4b')]({'name':_0x3deb47[_0x4e57('0x2c')],'resourceId':_0x3deb47['id'],'type':_0x243a7e['name'],'sectionId':_0x243a7e['id']},{})['then'](function(){return _0x3cdb3f;});}else{return _0x3cdb3f;}})[_0x4e57('0x46')](function(_0x2e6a8f){logger[_0x4e57('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e6a8f);throw _0x2e6a8f;});}return _0x3cdb3f;})[_0x4e57('0x27')](respondWithResult(_0x48869d,0xc9))[_0x4e57('0x46')](handleError(_0x48869d,null));};exports[_0x4e57('0x53')]=function(_0x3d4714,_0x5b6817){if(_0x3d4714[_0x4e57('0x4c')]['id']){delete _0x3d4714['body']['id'];}return db['Disposition'][_0x4e57('0x4a')]({'where':{'id':_0x3d4714[_0x4e57('0x47')]['id']}})[_0x4e57('0x27')](handleEntityNotFound(_0x5b6817,null))[_0x4e57('0x27')](saveUpdates(_0x3d4714[_0x4e57('0x4c')],null))[_0x4e57('0x27')](respondWithResult(_0x5b6817,null))[_0x4e57('0x46')](handleError(_0x5b6817,null));};exports[_0x4e57('0x26')]=function(_0x279383,_0x454d02){return db[_0x4e57('0x2f')][_0x4e57('0x4a')]({'where':{'id':_0x279383[_0x4e57('0x47')]['id']}})['then'](handleEntityNotFound(_0x454d02,null))[_0x4e57('0x27')](removeEntity(_0x454d02,null))[_0x4e57('0x46')](handleError(_0x454d02,null));}; \ No newline at end of file +var _0x5f6f=['fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','Disposition','includeAll','include','findAll','rows','show','params','intersection','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir'];(function(_0xa31cbb,_0x3920ac){var _0xa34c42=function(_0x5b387c){while(--_0x5b387c){_0xa31cbb['push'](_0xa31cbb['shift']());}};_0xa34c42(++_0x3920ac);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x38c2b5,_0x4de8fa){_0x38c2b5=_0x38c2b5-0x0;var _0x46deb3=_0x5f6f[_0x38c2b5];return _0x46deb3;};'use strict';var emlformat=require(_0xf5f6('0x0'));var rimraf=require(_0xf5f6('0x1'));var zipdir=require(_0xf5f6('0x2'));var jsonpatch=require(_0xf5f6('0x3'));var rp=require(_0xf5f6('0x4'));var moment=require('moment');var BPromise=require(_0xf5f6('0x5'));var Mustache=require(_0xf5f6('0x6'));var util=require(_0xf5f6('0x7'));var path=require('path');var sox=require(_0xf5f6('0x8'));var csv=require(_0xf5f6('0x9'));var ejs=require(_0xf5f6('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf5f6('0xc'));var jsforce=require(_0xf5f6('0xd'));var deskjs=require(_0xf5f6('0xe'));var toCsv=require(_0xf5f6('0x9'));var querystring=require(_0xf5f6('0xf'));var Papa=require(_0xf5f6('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf5f6('0x11'));var as=require(_0xf5f6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5f6('0x13'))(_0xf5f6('0x14'));var utils=require(_0xf5f6('0x15'));var config=require(_0xf5f6('0x16'));var licenseUtil=require(_0xf5f6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b407d,_0x4cde56){_0x4cde56=_0x4cde56||0xcc;return function(_0x2a62c5){if(_0x2a62c5){return _0x3b407d[_0xf5f6('0x18')](_0x4cde56);}return _0x3b407d[_0xf5f6('0x19')](_0x4cde56)[_0xf5f6('0x1a')]();};}function respondWithResult(_0x52648d,_0x96661c){_0x96661c=_0x96661c||0xc8;return function(_0x33cc8a){if(_0x33cc8a){return _0x52648d[_0xf5f6('0x19')](_0x96661c)[_0xf5f6('0x1b')](_0x33cc8a);}};}function respondWithFilteredResult(_0x504cd9,_0x1e3037){return function(_0x3f9f49){if(_0x3f9f49){var _0x21ccf7=typeof _0x1e3037[_0xf5f6('0x1c')]==='undefined'&&typeof _0x1e3037['limit']===_0xf5f6('0x1d');var _0x59a37e=_0x3f9f49[_0xf5f6('0x1e')];var _0x4dd3ae=_0x21ccf7?0x0:_0x1e3037[_0xf5f6('0x1c')];var _0x294af2=_0x21ccf7?_0x3f9f49[_0xf5f6('0x1e')]:_0x1e3037[_0xf5f6('0x1c')]+_0x1e3037[_0xf5f6('0x1f')];var _0x3199f0;if(_0x294af2>=_0x59a37e){_0x294af2=_0x59a37e;_0x3199f0=0xc8;}else{_0x3199f0=0xce;}_0x504cd9['status'](_0x3199f0);return _0x504cd9[_0xf5f6('0x20')](_0xf5f6('0x21'),_0x4dd3ae+'-'+_0x294af2+'/'+_0x59a37e)[_0xf5f6('0x1b')](_0x3f9f49);}return null;};}function patchUpdates(_0x261015){return function(_0x46de8c){try{jsonpatch['apply'](_0x46de8c,_0x261015,!![]);}catch(_0x1049e8){return BPromise[_0xf5f6('0x22')](_0x1049e8);}return _0x46de8c[_0xf5f6('0x23')]();};}function saveUpdates(_0x579375,_0x253b42){return function(_0x32f27e){if(_0x32f27e){return _0x32f27e[_0xf5f6('0x24')](_0x579375)[_0xf5f6('0x25')](function(_0x49906c){return _0x49906c;});}return null;};}function removeEntity(_0x4adf54,_0x1503e0){return function(_0x198cbb){if(_0x198cbb){return _0x198cbb[_0xf5f6('0x26')]()['then'](function(){var _0x31d0fb=_0x198cbb[_0xf5f6('0x27')]({'plain':!![]});var _0x9500e5='Dispositions';return db['UserProfileResource'][_0xf5f6('0x26')]({'where':{'type':_0x9500e5,'resourceId':_0x31d0fb['id']}})[_0xf5f6('0x25')](function(){return _0x198cbb;});})[_0xf5f6('0x25')](function(){_0x4adf54[_0xf5f6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb2fab7,_0x345242){return function(_0x52dfe3){if(!_0x52dfe3){_0xb2fab7[_0xf5f6('0x18')](0x194);}return _0x52dfe3;};}function handleError(_0x4c6cbf,_0x3fa834){_0x3fa834=_0x3fa834||0x1f4;return function(_0x8867ac){logger['error'](_0x8867ac[_0xf5f6('0x28')]);if(_0x8867ac[_0xf5f6('0x29')]){delete _0x8867ac[_0xf5f6('0x29')];}_0x4c6cbf[_0xf5f6('0x19')](_0x3fa834)['send'](_0x8867ac);};}exports[_0xf5f6('0x2a')]=function(_0x58f320,_0x254810){var _0x301a59={},_0x202565={},_0x1c4832={'count':0x0,'rows':[]};var _0x5bc8b1=_[_0xf5f6('0x2b')](db['Disposition'][_0xf5f6('0x2c')],function(_0x1dd7af){return{'name':_0x1dd7af['fieldName'],'type':_0x1dd7af[_0xf5f6('0x2d')][_0xf5f6('0x2e')]};});_0x202565[_0xf5f6('0x2f')]=_[_0xf5f6('0x2b')](_0x5bc8b1,_0xf5f6('0x29'));_0x202565[_0xf5f6('0x30')]=_[_0xf5f6('0x31')](_0x58f320['query']);_0x202565[_0xf5f6('0x32')]=_['intersection'](_0x202565[_0xf5f6('0x2f')],_0x202565[_0xf5f6('0x30')]);_0x301a59['attributes']=_['intersection'](_0x202565[_0xf5f6('0x2f')],qs[_0xf5f6('0x33')](_0x58f320[_0xf5f6('0x30')][_0xf5f6('0x33')]));_0x301a59[_0xf5f6('0x34')]=_0x301a59[_0xf5f6('0x34')][_0xf5f6('0x35')]?_0x301a59[_0xf5f6('0x34')]:_0x202565['model'];if(!_0x58f320[_0xf5f6('0x30')][_0xf5f6('0x36')](_0xf5f6('0x37'))){_0x301a59['limit']=qs['limit'](_0x58f320[_0xf5f6('0x30')]['limit']);_0x301a59['offset']=qs[_0xf5f6('0x1c')](_0x58f320[_0xf5f6('0x30')][_0xf5f6('0x1c')]);}_0x301a59['order']=qs[_0xf5f6('0x38')](_0x58f320[_0xf5f6('0x30')]['sort']);_0x301a59[_0xf5f6('0x39')]=qs['filters'](_['pick'](_0x58f320[_0xf5f6('0x30')],_0x202565['filters']),_0x5bc8b1);if(_0x58f320['query'][_0xf5f6('0x3a')]){_0x301a59[_0xf5f6('0x39')]=_[_0xf5f6('0x3b')](_0x301a59['where'],{'$or':_['map'](_0x5bc8b1,function(_0x2e7742){if(_0x2e7742[_0xf5f6('0x2d')]!==_0xf5f6('0x3c')){var _0x47e5c3={};_0x47e5c3[_0x2e7742[_0xf5f6('0x29')]]={'$like':'%'+_0x58f320[_0xf5f6('0x30')][_0xf5f6('0x3a')]+'%'};return _0x47e5c3;}})});}_0x301a59=_[_0xf5f6('0x3b')]({},_0x301a59,_0x58f320[_0xf5f6('0x3d')]);var _0x3798bd={'where':_0x301a59[_0xf5f6('0x39')]};return db[_0xf5f6('0x3e')][_0xf5f6('0x1e')](_0x3798bd)['then'](function(_0xc344b3){_0x1c4832[_0xf5f6('0x1e')]=_0xc344b3;if(_0x58f320[_0xf5f6('0x30')][_0xf5f6('0x3f')]){_0x301a59[_0xf5f6('0x40')]=[{'all':!![]}];}return db[_0xf5f6('0x3e')][_0xf5f6('0x41')](_0x301a59);})[_0xf5f6('0x25')](function(_0x37d9a2){_0x1c4832[_0xf5f6('0x42')]=_0x37d9a2;return _0x1c4832;})[_0xf5f6('0x25')](respondWithFilteredResult(_0x254810,_0x301a59))['catch'](handleError(_0x254810,null));};exports[_0xf5f6('0x43')]=function(_0x334ce0,_0x3c9fea){var _0x479824={'raw':!![],'where':{'id':_0x334ce0[_0xf5f6('0x44')]['id']}},_0x4548b0={};_0x4548b0['model']=_[_0xf5f6('0x31')](db['Disposition']['rawAttributes']);_0x4548b0[_0xf5f6('0x30')]=_[_0xf5f6('0x31')](_0x334ce0[_0xf5f6('0x30')]);_0x4548b0['filters']=_[_0xf5f6('0x45')](_0x4548b0[_0xf5f6('0x2f')],_0x4548b0[_0xf5f6('0x30')]);_0x479824['attributes']=_[_0xf5f6('0x45')](_0x4548b0['model'],qs[_0xf5f6('0x33')](_0x334ce0['query'][_0xf5f6('0x33')]));_0x479824[_0xf5f6('0x34')]=_0x479824[_0xf5f6('0x34')][_0xf5f6('0x35')]?_0x479824[_0xf5f6('0x34')]:_0x4548b0['model'];if(_0x334ce0['query'][_0xf5f6('0x3f')]){_0x479824['include']=[{'all':!![]}];}_0x479824=_[_0xf5f6('0x3b')]({},_0x479824,_0x334ce0[_0xf5f6('0x3d')]);return db[_0xf5f6('0x3e')]['find'](_0x479824)[_0xf5f6('0x25')](handleEntityNotFound(_0x3c9fea,null))[_0xf5f6('0x25')](respondWithResult(_0x3c9fea,null))[_0xf5f6('0x46')](handleError(_0x3c9fea,null));};exports[_0xf5f6('0x47')]=function(_0x44c264,_0x1fe5a5){return db['Disposition'][_0xf5f6('0x47')](_0x44c264[_0xf5f6('0x48')],{})['then'](function(_0xf092b6){var _0x8c09ff=_0x44c264[_0xf5f6('0x49')][_0xf5f6('0x27')]({'plain':!![]});if(!_0x8c09ff)throw new Error(_0xf5f6('0x4a'));if(_0x8c09ff[_0xf5f6('0x4b')]===_0xf5f6('0x49')){var _0x18c9cf=_0xf092b6['get']({'plain':!![]});var _0x3ac888='Dispositions';return db[_0xf5f6('0x4c')][_0xf5f6('0x4d')]({'where':{'name':_0x3ac888,'userProfileId':_0x8c09ff[_0xf5f6('0x4e')]},'raw':!![]})['then'](function(_0x28ef8c){if(_0x28ef8c&&_0x28ef8c[_0xf5f6('0x4f')]===0x0){return db[_0xf5f6('0x50')]['create']({'name':_0x18c9cf[_0xf5f6('0x29')],'resourceId':_0x18c9cf['id'],'type':_0x28ef8c[_0xf5f6('0x29')],'sectionId':_0x28ef8c['id']},{})[_0xf5f6('0x25')](function(){return _0xf092b6;});}else{return _0xf092b6;}})[_0xf5f6('0x46')](function(_0x24de8f){logger[_0xf5f6('0x51')](_0xf5f6('0x52'),_0x24de8f);throw _0x24de8f;});}return _0xf092b6;})['then'](respondWithResult(_0x1fe5a5,0xc9))[_0xf5f6('0x46')](handleError(_0x1fe5a5,null));};exports[_0xf5f6('0x24')]=function(_0x1f8ae7,_0x54aeac){if(_0x1f8ae7[_0xf5f6('0x48')]['id']){delete _0x1f8ae7['body']['id'];}return db[_0xf5f6('0x3e')][_0xf5f6('0x4d')]({'where':{'id':_0x1f8ae7[_0xf5f6('0x44')]['id']}})[_0xf5f6('0x25')](handleEntityNotFound(_0x54aeac,null))[_0xf5f6('0x25')](saveUpdates(_0x1f8ae7[_0xf5f6('0x48')],null))[_0xf5f6('0x25')](respondWithResult(_0x54aeac,null))[_0xf5f6('0x46')](handleError(_0x54aeac,null));};exports[_0xf5f6('0x26')]=function(_0x26ab99,_0x438427){return db[_0xf5f6('0x3e')][_0xf5f6('0x4d')]({'where':{'id':_0x26ab99[_0xf5f6('0x44')]['id']}})[_0xf5f6('0x25')](handleEntityNotFound(_0x438427,null))[_0xf5f6('0x25')](removeEntity(_0x438427,null))[_0xf5f6('0x46')](handleError(_0x438427,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 889d7ab..d3be639 100644 --- a/server/api/disposition/disposition.model.js +++ b/server/api/disposition/disposition.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe4a=['./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','name_sms','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1aaa36,_0x303ca3){var _0x52cbaa=function(_0x43a6ea){while(--_0x43a6ea){_0x1aaa36['push'](_0x1aaa36['shift']());}};_0x52cbaa(++_0x303ca3);}(_0xbe4a,0x1d8));var _0xabe4=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0xbe4a[_0x54b283];return _0x2462b3;};'use strict';var _=require(_0xabe4('0x0'));var util=require(_0xabe4('0x1'));var logger=require(_0xabe4('0x2'))(_0xabe4('0x3'));var moment=require('moment');var BPromise=require(_0xabe4('0x4'));var rp=require(_0xabe4('0x5'));var fs=require('fs');var path=require(_0xabe4('0x6'));var rimraf=require(_0xabe4('0x7'));var config=require('../../config/environment');var attributes=require(_0xabe4('0x8'));module[_0xabe4('0x9')]=function(_0x4cd200,_0x59d83c){return _0x4cd200[_0xabe4('0xa')](_0xabe4('0xb'),attributes,{'tableName':_0xabe4('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xabe4('0xd'),'fields':[_0xabe4('0xe'),_0xabe4('0xf')]},{'unique':!![],'name':_0xabe4('0x10'),'fields':[_0xabe4('0xe'),_0xabe4('0x11')]},{'unique':!![],'name':_0xabe4('0x12'),'fields':[_0xabe4('0xe'),'MailAccountId']},{'unique':!![],'name':_0xabe4('0x13'),'fields':['name','SmsAccountId']},{'unique':!![],'name':_0xabe4('0x14'),'fields':['name',_0xabe4('0x15')]},{'unique':!![],'name':'name_openchannel','fields':[_0xabe4('0xe'),_0xabe4('0x16')]},{'unique':!![],'name':_0xabe4('0x17'),'fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1514=['bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','moment'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x1514,0x164));var _0x4151=function(_0x5965da,_0x1e1e13){_0x5965da=_0x5965da-0x0;var _0x5407f1=_0x1514[_0x5965da];return _0x5407f1;};'use strict';var _=require(_0x4151('0x0'));var util=require(_0x4151('0x1'));var logger=require(_0x4151('0x2'))('api');var moment=require(_0x4151('0x3'));var BPromise=require(_0x4151('0x4'));var rp=require(_0x4151('0x5'));var fs=require('fs');var path=require(_0x4151('0x6'));var rimraf=require('rimraf');var config=require(_0x4151('0x7'));var attributes=require(_0x4151('0x8'));module[_0x4151('0x9')]=function(_0x6875f7,_0x5d24b4){return _0x6875f7[_0x4151('0xa')](_0x4151('0xb'),attributes,{'tableName':_0x4151('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x4151('0xd'),'fields':[_0x4151('0xe'),_0x4151('0xf')]},{'unique':!![],'name':_0x4151('0x10'),'fields':['name',_0x4151('0x11')]},{'unique':!![],'name':'name_mail','fields':[_0x4151('0xe'),_0x4151('0x12')]},{'unique':!![],'name':_0x4151('0x13'),'fields':[_0x4151('0xe'),_0x4151('0x14')]},{'unique':!![],'name':'name_fax','fields':[_0x4151('0xe'),'FaxAccountId']},{'unique':!![],'name':_0x4151('0x15'),'fields':[_0x4151('0xe'),'OpenchannelAccountId']},{'unique':!![],'name':_0x4151('0x16'),'fields':[_0x4151('0xe'),_0x4151('0x17')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index c4f10fd..ba7b6bb 100644 --- a/server/api/disposition/disposition.rpc.js +++ b/server/api/disposition/disposition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x9cf19c,_0x5b2af2){var _0x252ec8=function(_0x56851a){while(--_0x56851a){_0x9cf19c['push'](_0x9cf19c['shift']());}};_0x252ec8(++_0x5b2af2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0xda92d,_0x458622){var _0x3e25f9=function(_0x188df6){while(--_0x188df6){_0xda92d['push'](_0xda92d['shift']());}};_0x3e25f9(++_0x458622);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index bb3c628..7520fb2 100644 --- a/server/api/disposition/index.js +++ b/server/api/disposition/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x79cd=['show','create','update','delete','destroy','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','/:id','isAuthenticated'];(function(_0x16bd44,_0x3c91ba){var _0x368a61=function(_0x1c68ab){while(--_0x1c68ab){_0x16bd44['push'](_0x16bd44['shift']());}};_0x368a61(++_0x3c91ba);}(_0x79cd,0x17c));var _0xd79c=function(_0x5e299e,_0x44f590){_0x5e299e=_0x5e299e-0x0;var _0x473b88=_0x79cd[_0x5e299e];return _0x473b88;};'use strict';var multer=require('multer');var util=require(_0xd79c('0x0'));var path=require('path');var timeout=require(_0xd79c('0x1'));var express=require(_0xd79c('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd79c('0x3'));var interaction=require(_0xd79c('0x4'));var config=require(_0xd79c('0x5'));var controller=require(_0xd79c('0x6'));router[_0xd79c('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd79c('0x7')](_0xd79c('0x8'),auth[_0xd79c('0x9')](),controller[_0xd79c('0xa')]);router['post']('/',auth[_0xd79c('0x9')](),controller[_0xd79c('0xb')]);router['put'](_0xd79c('0x8'),auth[_0xd79c('0x9')](),controller[_0xd79c('0xc')]);router[_0xd79c('0xd')](_0xd79c('0x8'),auth[_0xd79c('0x9')](),controller[_0xd79c('0xe')]);module['exports']=router; \ No newline at end of file +var _0x5b10=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','/:id','show','post','isAuthenticated','create','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b10,0x13e));var _0x05b1=function(_0xd692fc,_0xdc3122){_0xd692fc=_0xd692fc-0x0;var _0x40a450=_0x5b10[_0xd692fc];return _0x40a450;};'use strict';var multer=require(_0x05b1('0x0'));var util=require(_0x05b1('0x1'));var path=require(_0x05b1('0x2'));var timeout=require(_0x05b1('0x3'));var express=require(_0x05b1('0x4'));var router=express[_0x05b1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x05b1('0x6'));var interaction=require(_0x05b1('0x7'));var config=require(_0x05b1('0x8'));var controller=require(_0x05b1('0x9'));router[_0x05b1('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x05b1('0xb'),auth['isAuthenticated'](),controller[_0x05b1('0xc')]);router[_0x05b1('0xd')]('/',auth[_0x05b1('0xe')](),controller[_0x05b1('0xf')]);router[_0x05b1('0x10')](_0x05b1('0xb'),auth['isAuthenticated'](),controller[_0x05b1('0x11')]);router[_0x05b1('0x12')](_0x05b1('0xb'),auth[_0x05b1('0xe')](),controller[_0x05b1('0x13')]);module[_0x05b1('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index b5573aa..de3a591 100644 --- a/server/api/faxAccount/faxAccount.attributes.js +++ b/server/api/faxAccount/faxAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4351=['ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','12000','9600','14400','INTEGER','SIP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4351,0x1b5));var _0x1435=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x4351[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0x1435('0x0'));module[_0x1435('0x1')]={'name':{'type':Sequelize[_0x1435('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1435('0x2')]},'ecm':{'type':Sequelize[_0x1435('0x3')](_0x1435('0x4'),'no'),'defaultValue':_0x1435('0x4')},'headerinfo':{'type':Sequelize[_0x1435('0x2')],'defaultValue':_0x1435('0x5')},'localstationid':{'type':Sequelize[_0x1435('0x2')],'unique':_0x1435('0x6')},'minrate':{'type':Sequelize[_0x1435('0x3')](_0x1435('0x7'),_0x1435('0x8'),_0x1435('0x9'),'9600',_0x1435('0xa'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x1435('0x3')](_0x1435('0x7'),_0x1435('0x8'),_0x1435('0x9'),_0x1435('0xb'),'12000',_0x1435('0xc')),'defaultValue':_0x1435('0xc')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x1435('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x1435('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x1435('0xe'),'IAX','DADHI','KHOMP'),'defaultValue':_0x1435('0xe')},'key':{'type':Sequelize[_0x1435('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1435('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1435('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x1435('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1435('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1435('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1435('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1435('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1435('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x1435('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x1435('0x10')],'defaultValue':![],'comment':_0x1435('0x12'),'set':function(_0x189f4a){if(!_0x189f4a)this[_0x1435('0x13')](_0x1435('0x14'),null);this[_0x1435('0x13')](_0x1435('0x15'),_0x189f4a);}}}; \ No newline at end of file +var _0x1db9=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','7200','9600','12000','14400','4800','2400','INTEGER','IAX','DADHI','KHOMP','SIP'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0x1db9,0x176));var _0x91db=function(_0x177077,_0x2fa057){_0x177077=_0x177077-0x0;var _0x50a2f9=_0x1db9[_0x177077];return _0x50a2f9;};'use strict';var Sequelize=require(_0x91db('0x0'));module[_0x91db('0x1')]={'name':{'type':Sequelize[_0x91db('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x91db('0x2')]},'ecm':{'type':Sequelize[_0x91db('0x3')](_0x91db('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x91db('0x2')],'defaultValue':_0x91db('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x91db('0x3')]('2400','4800',_0x91db('0x6'),_0x91db('0x7'),_0x91db('0x8'),_0x91db('0x9')),'defaultValue':_0x91db('0xa')},'maxrate':{'type':Sequelize['ENUM'](_0x91db('0xb'),'4800',_0x91db('0x6'),_0x91db('0x7'),_0x91db('0x8'),'14400'),'defaultValue':_0x91db('0x9')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x91db('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x91db('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP',_0x91db('0xd'),_0x91db('0xe'),_0x91db('0xf')),'defaultValue':_0x91db('0x10')},'key':{'type':Sequelize[_0x91db('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x91db('0x11');}},'notificationSound':{'type':Sequelize[_0x91db('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x91db('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x91db('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x91db('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x91db('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x91db('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x91db('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x91db('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x91db('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x91db('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x91db('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3f744f){if(!_0x3f744f)this[_0x91db('0x14')](_0x91db('0x15'),null);this[_0x91db('0x14')](_0x91db('0x16'),_0x3f744f);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 3694052..833c983 100644 --- a/server/api/faxAccount/faxAccount.controller.js +++ b/server/api/faxAccount/faxAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf204=['debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','map','FaxAccount','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','show','params','rawAttributes','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','FaxAccountId','Disposition','create','getDispositions','findOne','length','options','includeAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','color','tag','addApplications','transaction','sequelize','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','send','json','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','ecm','gateway','headerinfo','maxrate','minrate','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','updateAccountApplications','tech','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','updatedAt','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','path','from','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','spread','Messages','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xf204,0x167));var _0x4f20=function(_0x2e12b8,_0xdb92fe){_0x2e12b8=_0x2e12b8-0x0;var _0x2f1213=_0xf204[_0x2e12b8];return _0x2f1213;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f20('0x0'));var zipdir=require(_0x4f20('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f20('0x2'));var moment=require(_0x4f20('0x3'));var BPromise=require(_0x4f20('0x4'));var Mustache=require(_0x4f20('0x5'));var util=require(_0x4f20('0x6'));var path=require('path');var sox=require(_0x4f20('0x7'));var csv=require('to-csv');var ejs=require(_0x4f20('0x8'));var fs=require('fs');var fs_extra=require(_0x4f20('0x9'));var _=require('lodash');var squel=require(_0x4f20('0xa'));var crypto=require(_0x4f20('0xb'));var jsforce=require(_0x4f20('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4f20('0xd'));var querystring=require(_0x4f20('0xe'));var Papa=require('papaparse');var Redis=require(_0x4f20('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4f20('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4f20('0x11'))(_0x4f20('0x12'));var utils=require('../../config/utils');var config=require(_0x4f20('0x13'));var licenseUtil=require(_0x4f20('0x14'));var db=require(_0x4f20('0x15'))['db'];config[_0x4f20('0x16')]=_[_0x4f20('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4f20('0x18'))(new Redis(config[_0x4f20('0x16')]));require(_0x4f20('0x19'))['register'](socket);var jayson=require(_0x4f20('0x1a'));var client=jayson[_0x4f20('0x1b')][_0x4f20('0x1c')]({'port':0x232c});var client9002=jayson[_0x4f20('0x1b')][_0x4f20('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x10f131,_0xc584d1,_0x5f0352,_0x26745e){return new BPromise(function(_0x25b799,_0x93f5a5){var _0x284839=_0x26745e||client;return _0x284839[_0x4f20('0x1d')](_0x10f131,_0x5f0352)[_0x4f20('0x1e')](function(_0x5bc149){logger[_0x4f20('0x1f')](_0x4f20('0x20'),_0xc584d1,'request\x20sent');logger[_0x4f20('0x21')](_0x4f20('0x22'),_0xc584d1,_0x4f20('0x23'),JSON['stringify'](_0x5bc149));if(_0x5bc149[_0x4f20('0x24')]){if(_0x5bc149['error']['code']===0x1f4){logger['error'](_0x4f20('0x20'),_0xc584d1,_0x5bc149['error']['message']);return _0x93f5a5(_0x5bc149[_0x4f20('0x24')][_0x4f20('0x25')]);}logger['error'](_0x4f20('0x20'),_0xc584d1,_0x5bc149[_0x4f20('0x24')][_0x4f20('0x25')]);return _0x25b799(_0x5bc149[_0x4f20('0x24')][_0x4f20('0x25')]);}else{logger[_0x4f20('0x1f')](_0x4f20('0x20'),_0xc584d1,'request\x20sent');_0x25b799(_0x5bc149[_0x4f20('0x26')][_0x4f20('0x25')]);}})[_0x4f20('0x27')](function(_0x7aa932){logger[_0x4f20('0x24')]('FaxAccount,\x20%s,\x20%s',_0xc584d1,_0x7aa932);_0x93f5a5(_0x7aa932);});});}function respondWithStatusCode(_0x528ae0,_0x3ced62){_0x3ced62=_0x3ced62||0xcc;return function(_0x54a4d7){if(_0x54a4d7){return _0x528ae0[_0x4f20('0x28')](_0x3ced62);}return _0x528ae0[_0x4f20('0x29')](_0x3ced62)[_0x4f20('0x2a')]();};}function respondWithResult(_0x153028,_0x3f7ed1){_0x3f7ed1=_0x3f7ed1||0xc8;return function(_0x3996c4){if(_0x3996c4){return _0x153028[_0x4f20('0x29')](_0x3f7ed1)['json'](_0x3996c4);}};}function respondWithFilteredResult(_0x245cac,_0x2adcfa){return function(_0x3d07b1){if(_0x3d07b1){var _0x2fcc6b=typeof _0x2adcfa[_0x4f20('0x2b')]===_0x4f20('0x2c')&&typeof _0x2adcfa[_0x4f20('0x2d')]===_0x4f20('0x2c');var _0x34ca6d=_0x3d07b1[_0x4f20('0x2e')];var _0x124bd6=_0x2fcc6b?0x0:_0x2adcfa[_0x4f20('0x2b')];var _0x4a7137=_0x2fcc6b?_0x3d07b1['count']:_0x2adcfa[_0x4f20('0x2b')]+_0x2adcfa[_0x4f20('0x2d')];var _0x1a7f4f;if(_0x4a7137>=_0x34ca6d){_0x4a7137=_0x34ca6d;_0x1a7f4f=0xc8;}else{_0x1a7f4f=0xce;}_0x245cac[_0x4f20('0x29')](_0x1a7f4f);return _0x245cac['set'](_0x4f20('0x2f'),_0x124bd6+'-'+_0x4a7137+'/'+_0x34ca6d)['json'](_0x3d07b1);}return null;};}function patchUpdates(_0x2a84dc){return function(_0xaec4a3){try{jsonpatch[_0x4f20('0x30')](_0xaec4a3,_0x2a84dc,!![]);}catch(_0x339446){return BPromise[_0x4f20('0x31')](_0x339446);}return _0xaec4a3[_0x4f20('0x32')]();};}function saveUpdates(_0x493525,_0x53ae8f){return function(_0x5803cf){if(_0x5803cf){return _0x5803cf[_0x4f20('0x33')](_0x493525)[_0x4f20('0x1e')](function(_0xaa889c){return _0xaa889c;});}return null;};}function removeEntity(_0x209e3d,_0xe08da7){return function(_0x53ee67){if(_0x53ee67){return _0x53ee67[_0x4f20('0x34')]()['then'](function(){var _0x26ed27=_0x53ee67[_0x4f20('0x35')]({'plain':!![]});var _0x5208ed=_0x4f20('0x36');return db[_0x4f20('0x37')][_0x4f20('0x34')]({'where':{'type':_0x5208ed,'resourceId':_0x26ed27['id']}})['then'](function(){return _0x53ee67;});})[_0x4f20('0x1e')](function(){_0x209e3d[_0x4f20('0x29')](0xcc)[_0x4f20('0x2a')]();});}};}function handleEntityNotFound(_0x4042b5,_0x1a21cd){return function(_0x1effcf){if(!_0x1effcf){_0x4042b5[_0x4f20('0x28')](0x194);}return _0x1effcf;};}function handleError(_0x3e5c55,_0x3d1860){_0x3d1860=_0x3d1860||0x1f4;return function(_0x205014){logger[_0x4f20('0x24')](_0x205014[_0x4f20('0x38')]);if(_0x205014[_0x4f20('0x39')]){delete _0x205014[_0x4f20('0x39')];}_0x3e5c55[_0x4f20('0x29')](_0x3d1860)['send'](_0x205014);};}exports['index']=function(_0x281689,_0x52c01f){var _0x3ab3bc={'include':[{'model':db[_0x4f20('0x3a')],'as':_0x4f20('0x3b')}]},_0x3a1ff2={},_0xb7b0e={'count':0x0,'rows':[]};var _0x369767=_[_0x4f20('0x3c')](db[_0x4f20('0x3d')]['rawAttributes'],function(_0x274fd4){return{'name':_0x274fd4['fieldName'],'type':_0x274fd4[_0x4f20('0x3e')][_0x4f20('0x3f')]};});_0x3a1ff2[_0x4f20('0x40')]=_[_0x4f20('0x3c')](_0x369767,_0x4f20('0x39'));_0x3a1ff2[_0x4f20('0x41')]=_[_0x4f20('0x42')](_0x281689[_0x4f20('0x41')]);_0x3a1ff2[_0x4f20('0x43')]=_['intersection'](_0x3a1ff2[_0x4f20('0x40')],_0x3a1ff2[_0x4f20('0x41')]);_0x3ab3bc[_0x4f20('0x44')]=_[_0x4f20('0x45')](_0x3a1ff2[_0x4f20('0x40')],qs['fields'](_0x281689['query'][_0x4f20('0x46')]));_0x3ab3bc['attributes']=_0x3ab3bc['attributes']['length']?_0x3ab3bc[_0x4f20('0x44')]:_0x3a1ff2[_0x4f20('0x40')];if(!_0x281689[_0x4f20('0x41')][_0x4f20('0x47')](_0x4f20('0x48'))){_0x3ab3bc['limit']=qs[_0x4f20('0x2d')](_0x281689[_0x4f20('0x41')][_0x4f20('0x2d')]);_0x3ab3bc['offset']=qs['offset'](_0x281689[_0x4f20('0x41')]['offset']);}_0x3ab3bc[_0x4f20('0x49')]=qs[_0x4f20('0x4a')](_0x281689[_0x4f20('0x41')]['sort']);_0x3ab3bc[_0x4f20('0x4b')]=qs[_0x4f20('0x43')](_[_0x4f20('0x4c')](_0x281689[_0x4f20('0x41')],_0x3a1ff2['filters']),_0x369767);if(_0x281689[_0x4f20('0x41')][_0x4f20('0x4d')]){_0x3ab3bc['where']=_[_0x4f20('0x4e')](_0x3ab3bc[_0x4f20('0x4b')],{'$or':_[_0x4f20('0x3c')](_0x369767,function(_0x1ac4bf){if(_0x1ac4bf[_0x4f20('0x3e')]!==_0x4f20('0x4f')){var _0x350687={};_0x350687[_0x1ac4bf[_0x4f20('0x39')]]={'$like':'%'+_0x281689['query'][_0x4f20('0x4d')]+'%'};return _0x350687;}})});}_0x3ab3bc=_['merge']({},_0x3ab3bc,_0x281689['options']);var _0x2b3555={'where':_0x3ab3bc[_0x4f20('0x4b')]};return db['FaxAccount']['count'](_0x2b3555)[_0x4f20('0x1e')](function(_0x5ca11e){_0xb7b0e['count']=_0x5ca11e;if(_0x281689['query']['includeAll']){_0x3ab3bc[_0x4f20('0x50')]=[{'all':!![]}];}return db['FaxAccount'][_0x4f20('0x51')](_0x3ab3bc);})[_0x4f20('0x1e')](function(_0x3a45e1){_0xb7b0e[_0x4f20('0x52')]=_0x3a45e1;return _0xb7b0e;})[_0x4f20('0x1e')](respondWithFilteredResult(_0x52c01f,_0x3ab3bc))[_0x4f20('0x27')](handleError(_0x52c01f,null));};exports[_0x4f20('0x53')]=function(_0x4911f0,_0xce99df){var _0x1b5b22={'raw':![],'where':{'id':_0x4911f0[_0x4f20('0x54')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4c6011={};_0x4c6011[_0x4f20('0x40')]=_[_0x4f20('0x42')](db[_0x4f20('0x3d')][_0x4f20('0x55')]);_0x4c6011[_0x4f20('0x41')]=_['keys'](_0x4911f0['query']);_0x4c6011[_0x4f20('0x43')]=_[_0x4f20('0x45')](_0x4c6011[_0x4f20('0x40')],_0x4c6011[_0x4f20('0x41')]);_0x1b5b22[_0x4f20('0x44')]=_['intersection'](_0x4c6011[_0x4f20('0x40')],qs[_0x4f20('0x46')](_0x4911f0['query'][_0x4f20('0x46')]));_0x1b5b22[_0x4f20('0x44')]=_0x1b5b22['attributes']['length']?_0x1b5b22[_0x4f20('0x44')]:_0x4c6011[_0x4f20('0x40')];if(_0x4911f0[_0x4f20('0x41')]['includeAll']){_0x1b5b22[_0x4f20('0x50')]=[{'all':!![]}];}_0x1b5b22=_['merge']({},_0x1b5b22,_0x4911f0['options']);return db['FaxAccount'][_0x4f20('0x56')](_0x1b5b22)[_0x4f20('0x1e')](handleEntityNotFound(_0xce99df,null))[_0x4f20('0x1e')](respondWithResult(_0xce99df,null))[_0x4f20('0x27')](handleError(_0xce99df,null));};exports['create']=function(_0x4a2460,_0x3d7dc8){return db[_0x4f20('0x3d')]['create'](_0x4a2460['body'],{})[_0x4f20('0x1e')](function(_0x405d8c){var _0x1712d6=_0x4a2460[_0x4f20('0x57')][_0x4f20('0x35')]({'plain':!![]});if(!_0x1712d6)throw new Error(_0x4f20('0x58'));if(_0x1712d6[_0x4f20('0x59')]===_0x4f20('0x57')){var _0x58f90b=_0x405d8c[_0x4f20('0x35')]({'plain':!![]});var _0x39dcb0='FaxAccounts';return db[_0x4f20('0x5a')]['find']({'where':{'name':_0x39dcb0,'userProfileId':_0x1712d6[_0x4f20('0x5b')]},'raw':!![]})[_0x4f20('0x1e')](function(_0x44794f){if(_0x44794f&&_0x44794f[_0x4f20('0x5c')]===0x0){return db['UserProfileResource']['create']({'name':_0x58f90b['name'],'resourceId':_0x58f90b['id'],'type':_0x44794f[_0x4f20('0x39')],'sectionId':_0x44794f['id']},{})['then'](function(){return _0x405d8c;});}else{return _0x405d8c;}})[_0x4f20('0x27')](function(_0x41df92){logger[_0x4f20('0x24')](_0x4f20('0x5d'),_0x41df92);throw _0x41df92;});}return _0x405d8c;})[_0x4f20('0x1e')](respondWithResult(_0x3d7dc8,0xc9))[_0x4f20('0x27')](handleError(_0x3d7dc8,null));};exports['update']=function(_0x395d2c,_0x14e0bc){if(_0x395d2c[_0x4f20('0x5e')]['id']){delete _0x395d2c['body']['id'];}return db[_0x4f20('0x3d')]['find']({'where':{'id':_0x395d2c[_0x4f20('0x54')]['id']},'include':[{'model':db[_0x4f20('0x3a')],'as':_0x4f20('0x3b')}]})[_0x4f20('0x1e')](handleEntityNotFound(_0x14e0bc,null))[_0x4f20('0x1e')](saveUpdates(_0x395d2c[_0x4f20('0x5e')],null))[_0x4f20('0x1e')](respondWithResult(_0x14e0bc,null))[_0x4f20('0x27')](handleError(_0x14e0bc,null));};exports[_0x4f20('0x34')]=function(_0x9aa453,_0xcc954e){return db[_0x4f20('0x3d')][_0x4f20('0x56')]({'where':{'id':_0x9aa453[_0x4f20('0x54')]['id']}})[_0x4f20('0x1e')](handleEntityNotFound(_0xcc954e,null))[_0x4f20('0x1e')](removeEntity(_0xcc954e,null))['catch'](handleError(_0xcc954e,null));};exports['describe']=function(_0x42c73e,_0x383040){return db[_0x4f20('0x3d')]['describe']()[_0x4f20('0x1e')](respondWithResult(_0x383040,null))['catch'](handleError(_0x383040,null));};exports['addDisposition']=function(_0x91b6ac,_0x14fecd,_0x12b396){if(_0x91b6ac[_0x4f20('0x5e')]['id']){delete _0x91b6ac['body']['id'];}return db[_0x4f20('0x3d')][_0x4f20('0x56')]({'where':{'id':_0x91b6ac[_0x4f20('0x54')]['id']}})[_0x4f20('0x1e')](handleEntityNotFound(_0x14fecd,null))[_0x4f20('0x1e')](function(_0xe14e96){if(_0xe14e96){_0x91b6ac[_0x4f20('0x5e')][_0x4f20('0x5f')]=_0xe14e96['id'];return db[_0x4f20('0x60')][_0x4f20('0x61')](_0x91b6ac['body']);}})[_0x4f20('0x1e')](respondWithResult(_0x14fecd,null))['catch'](handleError(_0x14fecd,null));};exports[_0x4f20('0x62')]=function(_0x4df427,_0x4480f4,_0x10738c){var _0x101949={'raw':![],'where':{}};var _0x3e0f64={};var _0x31cae6={'count':0x0,'rows':[]};return db[_0x4f20('0x3d')][_0x4f20('0x63')]({'where':{'id':_0x4df427[_0x4f20('0x54')]['id']}})[_0x4f20('0x1e')](handleEntityNotFound(_0x4480f4,null))[_0x4f20('0x1e')](function(_0x431e81){if(_0x431e81){_0x3e0f64[_0x4f20('0x40')]=_[_0x4f20('0x42')](db['Disposition']['rawAttributes']);_0x3e0f64[_0x4f20('0x41')]=_[_0x4f20('0x42')](_0x4df427[_0x4f20('0x41')]);_0x3e0f64[_0x4f20('0x43')]=_[_0x4f20('0x45')](_0x3e0f64['model'],_0x3e0f64['query']);_0x101949[_0x4f20('0x44')]=_[_0x4f20('0x45')](_0x3e0f64[_0x4f20('0x40')],qs[_0x4f20('0x46')](_0x4df427['query'][_0x4f20('0x46')]));_0x101949['attributes']=_0x101949[_0x4f20('0x44')][_0x4f20('0x64')]?_0x101949[_0x4f20('0x44')]:_0x3e0f64[_0x4f20('0x40')];if(!_0x4df427[_0x4f20('0x41')][_0x4f20('0x47')](_0x4f20('0x48'))){_0x101949[_0x4f20('0x2d')]=qs['limit'](_0x4df427[_0x4f20('0x41')][_0x4f20('0x2d')]);_0x101949[_0x4f20('0x2b')]=qs[_0x4f20('0x2b')](_0x4df427[_0x4f20('0x41')]['offset']);}_0x101949[_0x4f20('0x49')]=qs['sort'](_0x4df427[_0x4f20('0x41')]['sort']);_0x101949['where']=qs[_0x4f20('0x43')](_[_0x4f20('0x4c')](_0x4df427[_0x4f20('0x41')],_0x3e0f64[_0x4f20('0x43')]));_0x101949['where'][_0x4f20('0x5f')]=_0x431e81['id'];if(_0x4df427[_0x4f20('0x41')]['filter']){_0x101949['where']=_[_0x4f20('0x4e')](_0x101949['where'],{'$or':_['map'](_0x101949['attributes'],function(_0x7dc56d){var _0x41bf82={};_0x41bf82[_0x7dc56d]={'$like':'%'+_0x4df427[_0x4f20('0x41')][_0x4f20('0x4d')]+'%'};return _0x41bf82;})});}_0x101949=_[_0x4f20('0x4e')]({},_0x101949,_0x4df427[_0x4f20('0x65')]);return db['Disposition'][_0x4f20('0x2e')]({'where':_0x101949[_0x4f20('0x4b')]})[_0x4f20('0x1e')](function(_0x56ee8e){_0x31cae6[_0x4f20('0x2e')]=_0x56ee8e;if(_0x4df427[_0x4f20('0x41')][_0x4f20('0x66')]){_0x101949['include']=[{'all':!![]}];}return db['Disposition'][_0x4f20('0x51')](_0x101949);})[_0x4f20('0x1e')](function(_0x2fb5d2){_0x31cae6[_0x4f20('0x52')]=_0x2fb5d2;return _0x31cae6;});}})[_0x4f20('0x1e')](respondWithFilteredResult(_0x4480f4,_0x101949))[_0x4f20('0x27')](handleError(_0x4480f4,null));};exports[_0x4f20('0x67')]=function(_0x34a8c7,_0x3a9259,_0x3c9756){return db['FaxAccount'][_0x4f20('0x56')]({'where':{'id':_0x34a8c7[_0x4f20('0x54')]['id']}})[_0x4f20('0x1e')](handleEntityNotFound(_0x3a9259,null))[_0x4f20('0x1e')](function(_0x5cc2ef){if(_0x5cc2ef){return _0x5cc2ef[_0x4f20('0x67')](_0x34a8c7[_0x4f20('0x41')]['ids']);}})['then'](respondWithStatusCode(_0x3a9259,null))[_0x4f20('0x27')](handleError(_0x3a9259,null));};exports[_0x4f20('0x68')]=function(_0x34bdef,_0x71aefe,_0x1a71c8){if(_0x34bdef['body']['id']){delete _0x34bdef[_0x4f20('0x5e')]['id'];}return db[_0x4f20('0x3d')][_0x4f20('0x56')]({'where':{'id':_0x34bdef[_0x4f20('0x54')]['id']}})['then'](handleEntityNotFound(_0x71aefe,null))[_0x4f20('0x1e')](function(_0x1c158a){if(_0x1c158a){_0x34bdef[_0x4f20('0x5e')]['FaxAccountId']=_0x1c158a['id'];return db[_0x4f20('0x69')][_0x4f20('0x61')](_0x34bdef[_0x4f20('0x5e')]);}})['then'](respondWithResult(_0x71aefe,null))['catch'](handleError(_0x71aefe,null));};exports[_0x4f20('0x6a')]=function(_0x175d3d,_0x6dea82,_0x3ae57e){var _0x2b7bae={'raw':![],'where':{}};var _0xcd87fc={};var _0xea2ea7={'count':0x0,'rows':[]};return db[_0x4f20('0x3d')][_0x4f20('0x63')]({'where':{'id':_0x175d3d['params']['id']}})[_0x4f20('0x1e')](handleEntityNotFound(_0x6dea82,null))[_0x4f20('0x1e')](function(_0x519f79){if(_0x519f79){_0xcd87fc[_0x4f20('0x40')]=_[_0x4f20('0x42')](db[_0x4f20('0x69')]['rawAttributes']);_0xcd87fc[_0x4f20('0x41')]=_[_0x4f20('0x42')](_0x175d3d[_0x4f20('0x41')]);_0xcd87fc[_0x4f20('0x43')]=_[_0x4f20('0x45')](_0xcd87fc['model'],_0xcd87fc[_0x4f20('0x41')]);_0x2b7bae[_0x4f20('0x44')]=_[_0x4f20('0x45')](_0xcd87fc[_0x4f20('0x40')],qs[_0x4f20('0x46')](_0x175d3d['query'][_0x4f20('0x46')]));_0x2b7bae['attributes']=_0x2b7bae[_0x4f20('0x44')][_0x4f20('0x64')]?_0x2b7bae[_0x4f20('0x44')]:_0xcd87fc[_0x4f20('0x40')];if(!_0x175d3d[_0x4f20('0x41')][_0x4f20('0x47')]('nolimit')){_0x2b7bae[_0x4f20('0x2d')]=qs[_0x4f20('0x2d')](_0x175d3d[_0x4f20('0x41')]['limit']);_0x2b7bae[_0x4f20('0x2b')]=qs[_0x4f20('0x2b')](_0x175d3d['query'][_0x4f20('0x2b')]);}_0x2b7bae['order']=qs[_0x4f20('0x4a')](_0x175d3d[_0x4f20('0x41')]['sort']);_0x2b7bae[_0x4f20('0x4b')]=qs[_0x4f20('0x43')](_[_0x4f20('0x4c')](_0x175d3d['query'],_0xcd87fc[_0x4f20('0x43')]));_0x2b7bae[_0x4f20('0x4b')][_0x4f20('0x5f')]=_0x519f79['id'];if(_0x175d3d['query'][_0x4f20('0x4d')]){_0x2b7bae['where']=_['merge'](_0x2b7bae[_0x4f20('0x4b')],{'$or':_['map'](_0x2b7bae[_0x4f20('0x44')],function(_0x7b473a){var _0x35fc27={};_0x35fc27[_0x7b473a]={'$like':'%'+_0x175d3d[_0x4f20('0x41')][_0x4f20('0x4d')]+'%'};return _0x35fc27;})});}_0x2b7bae=_[_0x4f20('0x4e')]({},_0x2b7bae,_0x175d3d[_0x4f20('0x65')]);return db[_0x4f20('0x69')][_0x4f20('0x2e')]({'where':_0x2b7bae[_0x4f20('0x4b')]})[_0x4f20('0x1e')](function(_0x516a8f){_0xea2ea7[_0x4f20('0x2e')]=_0x516a8f;if(_0x175d3d[_0x4f20('0x41')][_0x4f20('0x66')]){_0x2b7bae[_0x4f20('0x50')]=[{'all':!![]}];}return db[_0x4f20('0x69')][_0x4f20('0x51')](_0x2b7bae);})[_0x4f20('0x1e')](function(_0x1b3f38){_0xea2ea7[_0x4f20('0x52')]=_0x1b3f38;return _0xea2ea7;});}})[_0x4f20('0x1e')](respondWithFilteredResult(_0x6dea82,_0x2b7bae))[_0x4f20('0x27')](handleError(_0x6dea82,null));};exports[_0x4f20('0x6b')]=function(_0x5ca77b,_0x12f865,_0x19f37c){return db[_0x4f20('0x3d')]['find']({'where':{'id':_0x5ca77b[_0x4f20('0x54')]['id']}})[_0x4f20('0x1e')](handleEntityNotFound(_0x12f865,null))['then'](function(_0x4089ca){if(_0x4089ca){return _0x4089ca['removeAnswers'](_0x5ca77b[_0x4f20('0x41')][_0x4f20('0x6c')]);}})[_0x4f20('0x1e')](respondWithStatusCode(_0x12f865,null))[_0x4f20('0x27')](handleError(_0x12f865,null));};exports[_0x4f20('0x6d')]=function(_0x5ec17d,_0x57d74f,_0x9dabb0){return db[_0x4f20('0x6e')][_0x4f20('0x56')]({'where':{'id':_0x5ec17d[_0x4f20('0x54')]['id']}})[_0x4f20('0x1e')](handleEntityNotFound(_0x57d74f,null))[_0x4f20('0x1e')](function(_0xb6e92c){if(_0xb6e92c){return _0xb6e92c[_0x4f20('0x6d')](_0x5ec17d['body'][_0x4f20('0x6c')],_[_0x4f20('0x6f')](_0x5ec17d[_0x4f20('0x5e')],[_0x4f20('0x6c'),'id'])||{});}})[_0x4f20('0x1e')](respondWithResult(_0x57d74f,null))[_0x4f20('0x27')](handleError(_0x57d74f,null));};exports[_0x4f20('0x70')]=function(_0x550e3f,_0x49e76c,_0x4a8e9a){var _0x5b5822={'raw':![],'where':{}};var _0x518d77={};var _0x416af1={'count':0x0,'rows':[]};return db[_0x4f20('0x3d')][_0x4f20('0x63')]({'where':{'id':_0x550e3f['params']['id']}})[_0x4f20('0x1e')](handleEntityNotFound(_0x49e76c,null))[_0x4f20('0x1e')](function(_0x4e1677){if(_0x4e1677){_0x518d77[_0x4f20('0x40')]=_['keys'](db[_0x4f20('0x6e')][_0x4f20('0x55')]);_0x518d77[_0x4f20('0x41')]=_[_0x4f20('0x42')](_0x550e3f[_0x4f20('0x41')]);_0x518d77[_0x4f20('0x43')]=_[_0x4f20('0x45')](_0x518d77[_0x4f20('0x40')],_0x518d77[_0x4f20('0x41')]);_0x5b5822[_0x4f20('0x44')]=_[_0x4f20('0x45')](_0x518d77[_0x4f20('0x40')],qs[_0x4f20('0x46')](_0x550e3f['query'][_0x4f20('0x46')]));_0x5b5822[_0x4f20('0x44')]=_0x5b5822['attributes'][_0x4f20('0x64')]?_0x5b5822[_0x4f20('0x44')]:_0x518d77[_0x4f20('0x40')];if(!_0x550e3f[_0x4f20('0x41')][_0x4f20('0x47')](_0x4f20('0x48'))){_0x5b5822[_0x4f20('0x2d')]=qs[_0x4f20('0x2d')](_0x550e3f['query'][_0x4f20('0x2d')]);_0x5b5822[_0x4f20('0x2b')]=qs[_0x4f20('0x2b')](_0x550e3f[_0x4f20('0x41')][_0x4f20('0x2b')]);}_0x5b5822[_0x4f20('0x49')]=qs[_0x4f20('0x4a')](_0x550e3f[_0x4f20('0x41')][_0x4f20('0x4a')]);_0x5b5822[_0x4f20('0x4b')]=qs['filters'](_[_0x4f20('0x4c')](_0x550e3f[_0x4f20('0x41')],_0x518d77[_0x4f20('0x43')]));_0x5b5822['where']['FaxAccountId']=_0x4e1677['id'];if(_0x550e3f[_0x4f20('0x41')][_0x4f20('0x4d')]){_0x5b5822['where']=_[_0x4f20('0x4e')](_0x5b5822[_0x4f20('0x4b')],{'$or':_[_0x4f20('0x3c')](_0x5b5822[_0x4f20('0x44')],function(_0x15eb05){var _0x2454e9={};_0x2454e9[_0x15eb05]={'$like':'%'+_0x550e3f[_0x4f20('0x41')][_0x4f20('0x4d')]+'%'};return _0x2454e9;})});}_0x5b5822=_[_0x4f20('0x4e')]({},_0x5b5822,_0x550e3f[_0x4f20('0x65')]);return db[_0x4f20('0x6e')][_0x4f20('0x2e')]({'where':_0x5b5822[_0x4f20('0x4b')]})[_0x4f20('0x1e')](function(_0x39c395){_0x416af1[_0x4f20('0x2e')]=_0x39c395;if(_0x550e3f[_0x4f20('0x41')][_0x4f20('0x66')]){_0x5b5822[_0x4f20('0x50')]=[{'model':db[_0x4f20('0x71')],'as':_0x4f20('0x72'),'required':![]},{'model':db[_0x4f20('0x73')],'as':_0x4f20('0x74'),'attributes':[_0x4f20('0x39'),_0x4f20('0x75'),'internal'],'required':![]},{'model':db[_0x4f20('0x76')],'as':'Tags','attributes':['id',_0x4f20('0x39'),_0x4f20('0x77')],'where':_0x550e3f[_0x4f20('0x41')][_0x4f20('0x78')]?{'id':_0x550e3f[_0x4f20('0x41')][_0x4f20('0x78')]}:undefined,'required':_0x550e3f[_0x4f20('0x41')][_0x4f20('0x78')]?!![]:![]}];}return db[_0x4f20('0x6e')][_0x4f20('0x51')](_0x5b5822);})[_0x4f20('0x1e')](function(_0x540fdb){_0x416af1['rows']=_0x540fdb;return _0x416af1;});}})['then'](respondWithFilteredResult(_0x49e76c,_0x5b5822))['catch'](handleError(_0x49e76c,null));};exports[_0x4f20('0x79')]=function(_0x1e39f7,_0x141e79){var _0x1c8ce6=_0x1e39f7[_0x4f20('0x54')]['id'];var _0x105fca=_0x1e39f7[_0x4f20('0x5e')];var _0xb30c6d=0xc8;var _0x83682f=null;return db['sequelize'][_0x4f20('0x7a')]({'isolationLevel':db[_0x4f20('0x7b')]['Transaction']['ISOLATION_LEVELS'][_0x4f20('0x7c')]},function(_0x284e5e){return db[_0x4f20('0x3d')]['findOne']({'where':{'id':_0x1c8ce6},'transaction':_0x284e5e})[_0x4f20('0x1e')](function(_0x1502fc){if(_0x1502fc){return db[_0x4f20('0x7d')][_0x4f20('0x34')]({'where':{'FaxAccountId':_0x1c8ce6},'transaction':_0x284e5e})[_0x4f20('0x1e')](function(){var _0x58dac1=_['map'](_0x105fca,function(_0x533a36){_0x533a36[_0x4f20('0x5f')]=_0x1c8ce6;return _0x533a36;});return db[_0x4f20('0x7d')][_0x4f20('0x7e')](_0x58dac1,{'transaction':_0x284e5e});});}else{_0xb30c6d=0x194;_0x83682f=[];}});})[_0x4f20('0x1e')](function(){if(_0xb30c6d!==0x194){return db[_0x4f20('0x7d')][_0x4f20('0x7f')]({'where':{'FaxAccountId':_0x1c8ce6},'order':_0x4f20('0x80')})['then'](function(_0x358a61){_0x83682f=_0x358a61;});}})['catch'](function(_0x4a7773){_0xb30c6d=0x1f4;logger[_0x4f20('0x24')](_0x4a7773['stack']);if(_0x4a7773[_0x4f20('0x39')]){delete _0x4a7773[_0x4f20('0x39')];}_0x83682f=_0x4a7773;})[_0x4f20('0x81')](function(){if(_0x83682f===null){_0x141e79[_0x4f20('0x28')](_0xb30c6d);}else{if(_0xb30c6d===0x1f4){_0x141e79[_0x4f20('0x29')](_0xb30c6d)[_0x4f20('0x82')](_0x83682f);}else{_0x141e79['status'](_0xb30c6d)[_0x4f20('0x83')](_0x83682f);}}});};exports[_0x4f20('0x84')]=function(_0x30030a,_0x58b76a,_0x3e0eb3){var _0x353097={};var _0x4aee4f={};var _0x4f6d7b;var _0x107961;return db[_0x4f20('0x3d')][_0x4f20('0x63')]({'where':{'id':_0x30030a['params']['id']}})['then'](handleEntityNotFound(_0x58b76a,null))[_0x4f20('0x1e')](function(_0x5892aa){if(_0x5892aa){_0x4f6d7b=_0x5892aa;_0x4aee4f[_0x4f20('0x40')]=_['keys'](db[_0x4f20('0x7d')][_0x4f20('0x55')]);_0x4aee4f[_0x4f20('0x41')]=_[_0x4f20('0x42')](_0x30030a['query']);_0x4aee4f[_0x4f20('0x43')]=_['intersection'](_0x4aee4f[_0x4f20('0x40')],_0x4aee4f[_0x4f20('0x41')]);_0x353097['attributes']=_['intersection'](_0x4aee4f['model'],qs[_0x4f20('0x46')](_0x30030a[_0x4f20('0x41')]['fields']));_0x353097[_0x4f20('0x44')]=_0x353097[_0x4f20('0x44')][_0x4f20('0x64')]?_0x353097[_0x4f20('0x44')]:_0x4aee4f[_0x4f20('0x40')];_0x353097['order']=qs['sort'](_0x30030a[_0x4f20('0x41')][_0x4f20('0x4a')]);_0x353097[_0x4f20('0x4b')]=qs[_0x4f20('0x43')](_['pick'](_0x30030a[_0x4f20('0x41')],_0x4aee4f[_0x4f20('0x43')]));if(_0x30030a['query'][_0x4f20('0x4d')]){_0x353097[_0x4f20('0x4b')]=_['merge'](_0x353097[_0x4f20('0x4b')],{'$or':_[_0x4f20('0x3c')](_0x353097[_0x4f20('0x44')],function(_0x23a9b7){var _0x53f67e={};_0x53f67e[_0x23a9b7]={'$like':'%'+_0x30030a[_0x4f20('0x41')][_0x4f20('0x4d')]+'%'};return _0x53f67e;})});}_0x353097=_[_0x4f20('0x4e')]({},_0x353097,_0x30030a[_0x4f20('0x65')]);return _0x4f6d7b['getApplications'](_0x353097);}})['then'](function(_0x1c670d){if(_0x1c670d){_0x107961=_0x1c670d['length'];if(!_0x30030a[_0x4f20('0x41')][_0x4f20('0x47')](_0x4f20('0x48'))){_0x353097[_0x4f20('0x2d')]=qs['limit'](_0x30030a[_0x4f20('0x41')][_0x4f20('0x2d')]);_0x353097[_0x4f20('0x2b')]=qs[_0x4f20('0x2b')](_0x30030a[_0x4f20('0x41')][_0x4f20('0x2b')]);}return _0x4f6d7b[_0x4f20('0x84')](_0x353097);}})['then'](function(_0x3e5797){if(_0x3e5797){return _0x3e5797?{'count':_0x107961,'rows':_0x3e5797}:null;}})[_0x4f20('0x1e')](respondWithResult(_0x58b76a,null))[_0x4f20('0x27')](handleError(_0x58b76a,null));};function Extension(_0x588f84,_0x4e1a4d,_0x2f69ef,_0x178f6d){this[_0x4f20('0x85')]=_0x4f20('0x86');this[_0x4f20('0x87')]=_0x588f84[_0x4f20('0x88')];this[_0x4f20('0x89')]=_0x178f6d;this[_0x4f20('0x3e')]=_0x4f20('0x8a');this[_0x4f20('0x8b')]=_0x4f20('0x8c');this[_0x4f20('0x5f')]=_0x588f84['id'];this[_0x4f20('0x80')]=_0x4e1a4d;this[_0x4f20('0x8d')]=_0x2f69ef;}function createExtensionsReciveFax(_0x45c574){var _0x5ec4c9=0x1;var _0x1ea725=[];_0x1ea725[_0x4f20('0x8e')](new Extension(_0x45c574,_0x5ec4c9,'','Answer'));_0x5ec4c9+=0x1;_0x1ea725['push'](new Extension(_0x45c574,_0x5ec4c9,_0x4f20('0x8f'),'Set'));_0x5ec4c9+=0x1;for(var _0x10c8d5 in _0x45c574){if(_0x45c574['hasOwnProperty'](_0x10c8d5)&&(_0x10c8d5===_0x4f20('0x90')||_0x10c8d5===_0x4f20('0x88')||_0x10c8d5===_0x4f20('0x91')||_0x10c8d5==='faxdetect'||_0x10c8d5===_0x4f20('0x92')||_0x10c8d5===_0x4f20('0x93')||_0x10c8d5===_0x4f20('0x94')||_0x10c8d5==='modem'||_0x10c8d5===_0x4f20('0x95'))){_0x1ea725[_0x4f20('0x8e')](new Extension(_0x45c574,_0x5ec4c9,_0x4f20('0x96')+_0x10c8d5+')='+_0x45c574[_0x10c8d5],'Set'));_0x5ec4c9+=0x1;}}_0x1ea725[_0x4f20('0x8e')](new Extension(_0x45c574,_0x5ec4c9,'6',_0x4f20('0x97')));_0x5ec4c9+=0x1;_0x1ea725[_0x4f20('0x8e')](new Extension(_0x45c574,_0x5ec4c9,_0x4f20('0x98'),_0x4f20('0x99')));_0x5ec4c9=0x0;return _0x1ea725;}exports[_0x4f20('0x9a')]=function(_0x1a6ebf,_0x48d457,_0x2b15e5){var _0x11ca78;return db['sequelize'][_0x4f20('0x7a')](function(_0x43166e){return db[_0x4f20('0x3d')][_0x4f20('0x61')](_0x1a6ebf[_0x4f20('0x5e')],{'transaction':_0x43166e})[_0x4f20('0x1e')](function(_0x380eb8){_0x11ca78=_0x380eb8[_0x4f20('0x35')]({'plain':!![]});return db[_0x4f20('0x9b')][_0x4f20('0x7e')](createExtensionsReciveFax(_0x11ca78),{'transaction':_0x43166e});});})[_0x4f20('0x1e')](function(){return _0x11ca78;})[_0x4f20('0x1e')](respondWithResult(_0x48d457,null))[_0x4f20('0x27')](handleError(_0x48d457,null));};exports[_0x4f20('0x9c')]=function(_0x471ad5,_0x5bc76c,_0x2779db){var _0x26a9f3;return db[_0x4f20('0x7b')][_0x4f20('0x7a')](function(_0x136ed6){return db['FaxAccount']['update'](_0x471ad5[_0x4f20('0x5e')],{'where':{'id':_0x471ad5['body']['id']},'transaction':_0x136ed6})[_0x4f20('0x1e')](function(_0x3925f5){return db[_0x4f20('0x9b')]['destroy']({'where':{'FaxAccountId':_0x471ad5[_0x4f20('0x5e')]['id']},'transaction':_0x136ed6})[_0x4f20('0x1e')](function(_0x39aaf4){return db[_0x4f20('0x9b')][_0x4f20('0x7e')](createExtensionsReciveFax(_[_0x4f20('0x6f')](_0x471ad5[_0x4f20('0x5e')],[_0x4f20('0x9d'),_0x4f20('0x3f'),_0x4f20('0x9e'),'updatedAt',_0x4f20('0x9f'),_0x4f20('0xa0')])),{'transaction':_0x136ed6});});});})[_0x4f20('0x1e')](function(){return db[_0x4f20('0x3d')][_0x4f20('0xa1')](_0x471ad5['body']['id']);})[_0x4f20('0x1e')](respondWithResult(_0x5bc76c,null))[_0x4f20('0x27')](handleError(_0x5bc76c,null));};exports[_0x4f20('0xa2')]=function(_0x4046e3,_0x1ed6f8,_0x31440a){var _0x1ada15={'raw':!![],'where':{}};var _0x1bb100={};var _0x8f6cae={'count':0x0,'rows':[]};return db['FaxAccount'][_0x4f20('0x63')]({'where':{'id':_0x4046e3[_0x4f20('0x54')]['id']}})['then'](handleEntityNotFound(_0x1ed6f8,null))[_0x4f20('0x1e')](function(_0x539d1b){if(_0x539d1b){_0x1bb100[_0x4f20('0x40')]=_[_0x4f20('0x42')](db[_0x4f20('0xa3')]['rawAttributes']);_0x1bb100[_0x4f20('0x41')]=_['keys'](_0x4046e3[_0x4f20('0x41')]);_0x1bb100['filters']=_['intersection'](_0x1bb100[_0x4f20('0x40')],_0x1bb100[_0x4f20('0x41')]);_0x1ada15[_0x4f20('0x44')]=_[_0x4f20('0x45')](_0x1bb100[_0x4f20('0x40')],qs[_0x4f20('0x46')](_0x4046e3[_0x4f20('0x41')][_0x4f20('0x46')]));_0x1ada15[_0x4f20('0x44')]=_0x1ada15['attributes'][_0x4f20('0x64')]?_0x1ada15['attributes']:_0x1bb100[_0x4f20('0x40')];if(!_0x4046e3['query'][_0x4f20('0x47')]('nolimit')){_0x1ada15[_0x4f20('0x2d')]=qs[_0x4f20('0x2d')](_0x4046e3[_0x4f20('0x41')][_0x4f20('0x2d')]);_0x1ada15['offset']=qs['offset'](_0x4046e3[_0x4f20('0x41')][_0x4f20('0x2b')]);}_0x1ada15['order']=qs[_0x4f20('0x4a')](_0x4046e3[_0x4f20('0x41')][_0x4f20('0x4a')]);_0x1ada15['where']=qs['filters'](_[_0x4f20('0x4c')](_0x4046e3['query'],_0x1bb100['filters']));_0x1ada15['where'][_0x4f20('0x5f')]=_0x539d1b['id'];if(_0x4046e3[_0x4f20('0x41')][_0x4f20('0x4d')]){_0x1ada15[_0x4f20('0x4b')]=_[_0x4f20('0x4e')](_0x1ada15[_0x4f20('0x4b')],{'$or':_['map'](_0x1ada15[_0x4f20('0x44')],function(_0x4b009d){var _0x4d9ea7={};_0x4d9ea7[_0x4b009d]={'$like':'%'+_0x4046e3['query'][_0x4f20('0x4d')]+'%'};return _0x4d9ea7;})});}if(_0x4046e3[_0x4f20('0x41')]['$gte']){var _0x2de1b4=_0x4046e3[_0x4f20('0x41')][_0x4f20('0xa4')][_0x4f20('0xa5')](',');var _0x3203ce={};_0x3203ce[_0x2de1b4[0x0]]={'$gte':moment(_0x2de1b4[0x1])[_0x4f20('0xa6')](_0x4f20('0xa7'))};_0x1ada15['where']=_[_0x4f20('0x4e')](_0x1ada15[_0x4f20('0x4b')],_0x3203ce);}_0x1ada15=_['merge']({},_0x1ada15,_0x4046e3['options']);return db[_0x4f20('0xa3')]['count']({'where':_0x1ada15[_0x4f20('0x4b')]})[_0x4f20('0x1e')](function(_0x3e0df7){_0x8f6cae['count']=_0x3e0df7;if(_0x4046e3['query'][_0x4f20('0x66')]){_0x1ada15[_0x4f20('0x50')]=[{'all':!![]}];}return db[_0x4f20('0xa3')][_0x4f20('0x51')](_0x1ada15);})[_0x4f20('0x1e')](function(_0x4b3365){_0x8f6cae[_0x4f20('0x52')]=_0x4b3365;return _0x8f6cae;});}})['then'](respondWithFilteredResult(_0x1ed6f8,_0x1ada15))[_0x4f20('0x27')](handleError(_0x1ed6f8,null));};exports[_0x4f20('0x82')]=function(_0x349108,_0x534630,_0x1fe1e0){var _0x4f8bbd,_0x4e4820={},_0x58337c;if(_0x349108[_0x4f20('0x5e')]['to']){_0x58337c=_0x349108[_0x4f20('0x5e')]['to'][0x0];}return db['FaxAccount'][_0x4f20('0x56')]({'where':{'id':_0x349108[_0x4f20('0x54')]['id']},'include':[{'model':db['CmList'],'as':_0x4f20('0xa8'),'include':[{'model':db[_0x4f20('0x71')],'as':'Contacts','where':{'fax':_0x58337c},'limit':0x1,'order':[[_0x4f20('0xa9'),'DESC']]}]}]})[_0x4f20('0x1e')](handleEntityNotFound(_0x534630,null))['then'](function(_0x74e13b){_0x4f8bbd=_0x74e13b;if(_0x349108[_0x4f20('0x5e')]['attachments']&&_0x349108[_0x4f20('0x5e')][_0x4f20('0xaa')][_0x4f20('0x64')]){for(var _0x622ab2=0x0;_0x622ab2<_0x349108[_0x4f20('0x5e')][_0x4f20('0xaa')]['length'];_0x622ab2+=0x1){_0x349108[_0x4f20('0x5e')][_0x4f20('0xaa')][_0x622ab2]={'filename':_0x349108[_0x4f20('0x5e')][_0x4f20('0xaa')][_0x622ab2][_0x4f20('0x39')],'id':_0x349108[_0x4f20('0x5e')]['attachments'][_0x622ab2]['id'],'path':path[_0x4f20('0xab')](config['root'],_0x4f20('0xac'),_0x349108[_0x4f20('0x5e')][_0x4f20('0xaa')][_0x622ab2][_0x4f20('0xad')])};}}return respondWithRpcPromise(_0x4f20('0xae'),_0x4f20('0xae'),{'FaxAccountId':_[_0x4f20('0xaf')](_0x349108[_0x4f20('0x54')]['id'])?undefined:_0x349108['params']['id'],'path':_['isNil'](_0x349108['body']['attachments'][0x0][_0x4f20('0xb0')])?undefined:_0x349108[_0x4f20('0x5e')]['attachments'][0x0][_0x4f20('0xb0')],'fax':_[_0x4f20('0xaf')](_0x349108[_0x4f20('0x5e')]['to'][0x0])?undefined:_0x349108[_0x4f20('0x5e')]['to'][0x0]},client9002);})[_0x4f20('0x1e')](function(){if(_0x4f8bbd){if(_[_0x4f20('0xaf')](_0x349108['body']['from'])){_0x349108[_0x4f20('0x5e')][_0x4f20('0xb1')]=util[_0x4f20('0xa6')]('\x22%s\x22\x20<%s>',_0x4f8bbd['name'],_0x4f8bbd[_0x4f20('0xb2')]);}if(_0x4f8bbd[_0x4f20('0xa8')]){if(_0x4f8bbd[_0x4f20('0xa8')][_0x4f20('0xb3')][_0x4f20('0x64')]){return _0x4f8bbd[_0x4f20('0xa8')][_0x4f20('0xb3')][0x0];}else{return db[_0x4f20('0x71')][_0x4f20('0x61')](_['defaults'](_0x349108[_0x4f20('0x5e')],{'firstName':_0x349108['body']['to'][0x0],'phone':_0x349108['body']['to'][0x0],'fax':_0x349108['body']['to'][0x0],'ListId':_0x4f8bbd[_0x4f20('0xa0')]}));}}else{throw new Error(_0x4f20('0xb4'));}}else{throw new Error(_0x4f20('0xb5'));}})[_0x4f20('0x1e')](function(_0x5ee433){if(_0x5ee433){return db[_0x4f20('0x6e')][_0x4f20('0x56')]({'where':{'ContactId':_0x5ee433['id'],'closed':![],'FaxAccountId':_0x4f8bbd['id']}})['then'](function(_0xfdc424){if(_0xfdc424){return[_0xfdc424,![]];}return db['FaxInteraction'][_0x4f20('0x61')]({'UserId':_0x349108[_0x4f20('0x57')]['id'],'ContactId':_0x5ee433['id'],'FaxAccountId':_0x4f8bbd['id'],'fax':_0x349108[_0x4f20('0x5e')]['to'][0x0],'firstMsgDirection':_0x4f20('0xb6'),'Messages':[_[_0x4f20('0x4e')](_0x349108['body'],{'read':![],'body':_0x349108['body'][_0x4f20('0xaa')][0x0][_0x4f20('0xb7')],'FaxAccountId':_0x4f8bbd['id'],'UserId':_0x349108[_0x4f20('0x57')]['id'],'ContactId':_0x5ee433['id'],'AttachmentId':_0x349108[_0x4f20('0x5e')][_0x4f20('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0x4f20('0xa3')],'as':'Messages'}]})[_0x4f20('0x1e')](function(_0x311651){return[_0x311651,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x4f20('0xb8')](function(_0x2bc01c,_0x46c6a6){if(_0x46c6a6){return _0x2bc01c;}return db['FaxMessage']['create']({'direction':_0x4f20('0xb6'),'read':![],'body':_0x349108['body'][_0x4f20('0xaa')][0x0][_0x4f20('0xb7')],'FaxAccountId':_0x4f8bbd['id'],'FaxInteractionId':_0x2bc01c['id'],'UserId':_0x349108[_0x4f20('0x57')]['id'],'ContactId':_0x2bc01c['ContactId'],'AttachmentId':_0x349108[_0x4f20('0x5e')][_0x4f20('0xaa')][0x0]['id']})[_0x4f20('0x1e')](function(_0x3fd6f4){_0x2bc01c['dataValues'][_0x4f20('0xb9')]=[];_0x2bc01c['dataValues'][_0x4f20('0xb9')][_0x4f20('0x8e')](_0x3fd6f4[_0x4f20('0xba')]);return _0x2bc01c;});})[_0x4f20('0x1e')](function(_0x432aed){respondWithRpcPromise(_0x4f20('0xbb'),_0x4f20('0xbb'),{'FaxAccountId':_['isNil'](_0x349108[_0x4f20('0x54')]['id'])?undefined:_0x349108[_0x4f20('0x54')]['id'],'path':_[_0x4f20('0xaf')](_0x349108[_0x4f20('0x5e')][_0x4f20('0xaa')][0x0][_0x4f20('0xb0')])?undefined:_0x349108[_0x4f20('0x5e')][_0x4f20('0xaa')][0x0][_0x4f20('0xb0')],'fax':_['isNil'](_0x349108[_0x4f20('0x5e')]['to'][0x0])?undefined:_0x349108[_0x4f20('0x5e')]['to'][0x0],'AttachmentId':_0x349108[_0x4f20('0x5e')][_0x4f20('0xaa')][0x0]['id']},client9002)['then'](function(_0x31b529){logger[_0x4f20('0x1f')]('SendFaxRpc,\x20%s',_0x31b529);})[_0x4f20('0x27')](function(_0x5657dd){logger[_0x4f20('0x1f')](_0x4f20('0xbc'),_0x5657dd);});return _0x432aed;})['then'](respondWithResult(_0x534630,null))[_0x4f20('0x27')](handleError(_0x534630,null));};exports['addAgents']=function(_0x46da63,_0x3d6c4a,_0x5bf26e){return db['FaxAccount'][_0x4f20('0x56')]({'where':{'id':_0x46da63[_0x4f20('0x54')]['id']}})['then'](handleEntityNotFound(_0x3d6c4a,null))[_0x4f20('0x1e')](function(_0x4cdb34){if(_0x4cdb34){return _0x4cdb34[_0x4f20('0xbd')](_0x46da63[_0x4f20('0x5e')][_0x4f20('0x6c')],_[_0x4f20('0x6f')](_0x46da63[_0x4f20('0x5e')],[_0x4f20('0x6c'),'id'])||{})[_0x4f20('0xb8')](function(_0x1b1e9f){for(var _0x314e70=0x0;_0x314e70<_0x46da63[_0x4f20('0x5e')]['ids'][_0x4f20('0x64')];_0x314e70+=0x1){socket[_0x4f20('0xbe')](_0x4f20('0xbf'),{'UserId':Number(_0x46da63[_0x4f20('0x5e')]['ids'][_0x314e70]),'FaxAccountId':Number(_0x46da63[_0x4f20('0x54')]['id'])});}return _0x1b1e9f;});}})['then'](respondWithResult(_0x3d6c4a,null))[_0x4f20('0x27')](handleError(_0x3d6c4a,null));};exports[_0x4f20('0xc0')]=function(_0x1ca453,_0x2dfa97,_0x50ae84){return db[_0x4f20('0x3d')]['find']({'where':{'id':_0x1ca453['params']['id']}})[_0x4f20('0x1e')](handleEntityNotFound(_0x2dfa97,null))[_0x4f20('0x1e')](function(_0x27f284){if(_0x27f284){return _0x27f284[_0x4f20('0xc0')](_0x1ca453[_0x4f20('0x41')][_0x4f20('0x6c')])[_0x4f20('0x1e')](function(){if(_[_0x4f20('0xc1')](_0x1ca453[_0x4f20('0x41')]['ids'])){for(var _0x595cf9=0x0;_0x595cf9<_0x1ca453['query'][_0x4f20('0x6c')][_0x4f20('0x64')];_0x595cf9+=0x1){socket['emit'](_0x4f20('0xc2'),{'UserId':Number(_0x1ca453[_0x4f20('0x41')][_0x4f20('0x6c')][_0x595cf9]),'FaxAccountId':Number(_0x1ca453[_0x4f20('0x54')]['id'])});}}else{socket['emit'](_0x4f20('0xc2'),{'UserId':Number(_0x1ca453[_0x4f20('0x41')]['ids']),'FaxAccountId':Number(_0x1ca453[_0x4f20('0x54')]['id'])});}});}})[_0x4f20('0x1e')](respondWithStatusCode(_0x2dfa97,null))[_0x4f20('0x27')](handleError(_0x2dfa97,null));};exports['getAgents']=function(_0x51397c,_0x4e50ab,_0x1a506b){var _0x3509b7={};var _0x2fbf21={};var _0x2986f4;var _0x20554d;return db[_0x4f20('0x3d')][_0x4f20('0x63')]({'where':{'id':_0x51397c[_0x4f20('0x54')]['id']}})[_0x4f20('0x1e')](handleEntityNotFound(_0x4e50ab,null))[_0x4f20('0x1e')](function(_0x1865a9){if(_0x1865a9){_0x2986f4=_0x1865a9;_0x2fbf21[_0x4f20('0x40')]=_['keys'](db[_0x4f20('0x73')][_0x4f20('0x55')]);_0x2fbf21[_0x4f20('0x41')]=_['keys'](_0x51397c[_0x4f20('0x41')]);_0x2fbf21['filters']=_['intersection'](_0x2fbf21[_0x4f20('0x40')],_0x2fbf21['query']);_0x3509b7[_0x4f20('0x44')]=_['intersection'](_0x2fbf21[_0x4f20('0x40')],qs[_0x4f20('0x46')](_0x51397c[_0x4f20('0x41')]['fields']));_0x3509b7[_0x4f20('0x44')]=_0x3509b7[_0x4f20('0x44')][_0x4f20('0x64')]?_0x3509b7[_0x4f20('0x44')]:_0x2fbf21[_0x4f20('0x40')];_0x3509b7['order']=qs[_0x4f20('0x4a')](_0x51397c[_0x4f20('0x41')][_0x4f20('0x4a')]);_0x3509b7[_0x4f20('0x4b')]=qs[_0x4f20('0x43')](_[_0x4f20('0x4c')](_0x51397c[_0x4f20('0x41')],_0x2fbf21[_0x4f20('0x43')]));if(_0x51397c['query'][_0x4f20('0x4d')]){_0x3509b7['where']=_['merge'](_0x3509b7['where'],{'$or':_[_0x4f20('0x3c')](_0x3509b7[_0x4f20('0x44')],function(_0x73f32d){var _0x2486dc={};_0x2486dc[_0x73f32d]={'$like':'%'+_0x51397c[_0x4f20('0x41')][_0x4f20('0x4d')]+'%'};return _0x2486dc;})});}_0x3509b7=_['merge']({},_0x3509b7,_0x51397c[_0x4f20('0x65')]);return _0x2986f4[_0x4f20('0xc3')](_0x3509b7);}})['then'](function(_0x138ba1){if(_0x138ba1){_0x20554d=_0x138ba1[_0x4f20('0x64')];if(!_0x51397c[_0x4f20('0x41')]['hasOwnProperty']('nolimit')){_0x3509b7[_0x4f20('0x2d')]=qs[_0x4f20('0x2d')](_0x51397c[_0x4f20('0x41')][_0x4f20('0x2d')]);_0x3509b7[_0x4f20('0x2b')]=qs['offset'](_0x51397c['query'][_0x4f20('0x2b')]);}return _0x2986f4[_0x4f20('0xc3')](_0x3509b7);}})['then'](function(_0x38d8e2){if(_0x38d8e2){return _0x38d8e2?{'count':_0x20554d,'rows':_0x38d8e2}:null;}})[_0x4f20('0x1e')](respondWithResult(_0x4e50ab,null))[_0x4f20('0x27')](handleError(_0x4e50ab,null));}; \ No newline at end of file +var _0x2e4d=['ecm','gateway','maxrate','minrate','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','sequelize','VoiceExtension','bulkCreate','updateAccountApplications','tech','createdAt','updatedAt','ListId','findById','FaxMessage','split','format','send','CmList','Contacts','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','fax','List','defaults','List\x20not\x20found','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','isArray','emit','userFaxAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','update','destroy','get','FaxAccounts','UserProfileResource','end','stack','name','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','include','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','Owner','fullname','internal','Tag','Tags','tag','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set'];(function(_0x51e3ab,_0xa7c312){var _0x4e3bc4=function(_0x1941c6){while(--_0x1941c6){_0x51e3ab['push'](_0x51e3ab['shift']());}};_0x4e3bc4(++_0xa7c312);}(_0x2e4d,0x1bb));var _0xd2e4=function(_0x2f8b91,_0x3a05a5){_0x2f8b91=_0x2f8b91-0x0;var _0x27f513=_0x2e4d[_0x2f8b91];return _0x27f513;};'use strict';var emlformat=require(_0xd2e4('0x0'));var rimraf=require(_0xd2e4('0x1'));var zipdir=require(_0xd2e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd2e4('0x3'));var moment=require(_0xd2e4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd2e4('0x5'));var util=require(_0xd2e4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd2e4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd2e4('0x8'));var _=require(_0xd2e4('0x9'));var squel=require(_0xd2e4('0xa'));var crypto=require(_0xd2e4('0xb'));var jsforce=require(_0xd2e4('0xc'));var deskjs=require(_0xd2e4('0xd'));var toCsv=require(_0xd2e4('0x7'));var querystring=require('querystring');var Papa=require(_0xd2e4('0xe'));var Redis=require(_0xd2e4('0xf'));var authService=require(_0xd2e4('0x10'));var qs=require(_0xd2e4('0x11'));var as=require(_0xd2e4('0x12'));var hardwareService=require(_0xd2e4('0x13'));var logger=require('../../config/logger')(_0xd2e4('0x14'));var utils=require(_0xd2e4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd2e4('0x16'));var db=require(_0xd2e4('0x17'))['db'];config[_0xd2e4('0x18')]=_['defaults'](config['redis'],{'host':_0xd2e4('0x19'),'port':0x18eb});var socket=require(_0xd2e4('0x1a'))(new Redis(config[_0xd2e4('0x18')]));require('./faxAccount.socket')['register'](socket);var jayson=require(_0xd2e4('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xd2e4('0x1c')][_0xd2e4('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x411d4,_0x31b729,_0x4334e0,_0x208eaa){return new BPromise(function(_0x4b8f4f,_0x55cc03){var _0x4b3f48=_0x208eaa||client;return _0x4b3f48[_0xd2e4('0x1e')](_0x411d4,_0x4334e0)[_0xd2e4('0x1f')](function(_0x5d7ce3){logger[_0xd2e4('0x20')](_0xd2e4('0x21'),_0x31b729,'request\x20sent');logger[_0xd2e4('0x22')](_0xd2e4('0x23'),_0x31b729,_0xd2e4('0x24'),JSON[_0xd2e4('0x25')](_0x5d7ce3));if(_0x5d7ce3[_0xd2e4('0x26')]){if(_0x5d7ce3[_0xd2e4('0x26')][_0xd2e4('0x27')]===0x1f4){logger[_0xd2e4('0x26')](_0xd2e4('0x21'),_0x31b729,_0x5d7ce3[_0xd2e4('0x26')][_0xd2e4('0x28')]);return _0x55cc03(_0x5d7ce3[_0xd2e4('0x26')]['message']);}logger[_0xd2e4('0x26')](_0xd2e4('0x21'),_0x31b729,_0x5d7ce3['error']['message']);return _0x4b8f4f(_0x5d7ce3[_0xd2e4('0x26')][_0xd2e4('0x28')]);}else{logger['info'](_0xd2e4('0x21'),_0x31b729,_0xd2e4('0x24'));_0x4b8f4f(_0x5d7ce3[_0xd2e4('0x29')][_0xd2e4('0x28')]);}})[_0xd2e4('0x2a')](function(_0x151d02){logger[_0xd2e4('0x26')](_0xd2e4('0x21'),_0x31b729,_0x151d02);_0x55cc03(_0x151d02);});});}function respondWithStatusCode(_0x42b8f7,_0x1d1285){_0x1d1285=_0x1d1285||0xcc;return function(_0x404d3b){if(_0x404d3b){return _0x42b8f7[_0xd2e4('0x2b')](_0x1d1285);}return _0x42b8f7[_0xd2e4('0x2c')](_0x1d1285)['end']();};}function respondWithResult(_0x55c488,_0x5d1169){_0x5d1169=_0x5d1169||0xc8;return function(_0x3fb136){if(_0x3fb136){return _0x55c488['status'](_0x5d1169)[_0xd2e4('0x2d')](_0x3fb136);}};}function respondWithFilteredResult(_0x35b170,_0x30930d){return function(_0x4738fb){if(_0x4738fb){var _0x5cf975=typeof _0x30930d[_0xd2e4('0x2e')]==='undefined'&&typeof _0x30930d['limit']===_0xd2e4('0x2f');var _0x4a1470=_0x4738fb[_0xd2e4('0x30')];var _0x354e10=_0x5cf975?0x0:_0x30930d['offset'];var _0x1776a5=_0x5cf975?_0x4738fb[_0xd2e4('0x30')]:_0x30930d[_0xd2e4('0x2e')]+_0x30930d[_0xd2e4('0x31')];var _0x14ee09;if(_0x1776a5>=_0x4a1470){_0x1776a5=_0x4a1470;_0x14ee09=0xc8;}else{_0x14ee09=0xce;}_0x35b170[_0xd2e4('0x2c')](_0x14ee09);return _0x35b170[_0xd2e4('0x32')]('Content-Range',_0x354e10+'-'+_0x1776a5+'/'+_0x4a1470)[_0xd2e4('0x2d')](_0x4738fb);}return null;};}function patchUpdates(_0x5756a5){return function(_0x2e18de){try{jsonpatch[_0xd2e4('0x33')](_0x2e18de,_0x5756a5,!![]);}catch(_0x1eb7b0){return BPromise[_0xd2e4('0x34')](_0x1eb7b0);}return _0x2e18de['save']();};}function saveUpdates(_0x49d500,_0xe445b9){return function(_0x3a4e26){if(_0x3a4e26){return _0x3a4e26[_0xd2e4('0x35')](_0x49d500)[_0xd2e4('0x1f')](function(_0x4fc8c2){return _0x4fc8c2;});}return null;};}function removeEntity(_0x21c7ef,_0x4b45e1){return function(_0x33678c){if(_0x33678c){return _0x33678c[_0xd2e4('0x36')]()[_0xd2e4('0x1f')](function(){var _0x58fe94=_0x33678c[_0xd2e4('0x37')]({'plain':!![]});var _0x463822=_0xd2e4('0x38');return db[_0xd2e4('0x39')][_0xd2e4('0x36')]({'where':{'type':_0x463822,'resourceId':_0x58fe94['id']}})['then'](function(){return _0x33678c;});})[_0xd2e4('0x1f')](function(){_0x21c7ef[_0xd2e4('0x2c')](0xcc)[_0xd2e4('0x3a')]();});}};}function handleEntityNotFound(_0xa19660,_0x226685){return function(_0x3111bf){if(!_0x3111bf){_0xa19660[_0xd2e4('0x2b')](0x194);}return _0x3111bf;};}function handleError(_0x510c3d,_0xfb71e0){_0xfb71e0=_0xfb71e0||0x1f4;return function(_0x4aed72){logger['error'](_0x4aed72[_0xd2e4('0x3b')]);if(_0x4aed72[_0xd2e4('0x3c')]){delete _0x4aed72[_0xd2e4('0x3c')];}_0x510c3d[_0xd2e4('0x2c')](_0xfb71e0)['send'](_0x4aed72);};}exports[_0xd2e4('0x3d')]=function(_0x56c9c5,_0xb2f287){var _0x27c0c7={'include':[{'model':db[_0xd2e4('0x3e')],'as':_0xd2e4('0x3f')}]},_0x405a50={},_0x3e01f7={'count':0x0,'rows':[]};var _0xf6764=_['map'](db[_0xd2e4('0x40')][_0xd2e4('0x41')],function(_0x148898){return{'name':_0x148898['fieldName'],'type':_0x148898[_0xd2e4('0x42')][_0xd2e4('0x43')]};});_0x405a50[_0xd2e4('0x44')]=_[_0xd2e4('0x45')](_0xf6764,_0xd2e4('0x3c'));_0x405a50[_0xd2e4('0x46')]=_[_0xd2e4('0x47')](_0x56c9c5[_0xd2e4('0x46')]);_0x405a50[_0xd2e4('0x48')]=_[_0xd2e4('0x49')](_0x405a50[_0xd2e4('0x44')],_0x405a50[_0xd2e4('0x46')]);_0x27c0c7[_0xd2e4('0x4a')]=_[_0xd2e4('0x49')](_0x405a50[_0xd2e4('0x44')],qs[_0xd2e4('0x4b')](_0x56c9c5[_0xd2e4('0x46')][_0xd2e4('0x4b')]));_0x27c0c7['attributes']=_0x27c0c7['attributes']['length']?_0x27c0c7[_0xd2e4('0x4a')]:_0x405a50['model'];if(!_0x56c9c5[_0xd2e4('0x46')][_0xd2e4('0x4c')](_0xd2e4('0x4d'))){_0x27c0c7[_0xd2e4('0x31')]=qs['limit'](_0x56c9c5[_0xd2e4('0x46')][_0xd2e4('0x31')]);_0x27c0c7[_0xd2e4('0x2e')]=qs['offset'](_0x56c9c5['query'][_0xd2e4('0x2e')]);}_0x27c0c7[_0xd2e4('0x4e')]=qs[_0xd2e4('0x4f')](_0x56c9c5['query']['sort']);_0x27c0c7[_0xd2e4('0x50')]=qs[_0xd2e4('0x48')](_[_0xd2e4('0x51')](_0x56c9c5[_0xd2e4('0x46')],_0x405a50[_0xd2e4('0x48')]),_0xf6764);if(_0x56c9c5[_0xd2e4('0x46')]['filter']){_0x27c0c7['where']=_[_0xd2e4('0x52')](_0x27c0c7[_0xd2e4('0x50')],{'$or':_['map'](_0xf6764,function(_0x4006aa){if(_0x4006aa[_0xd2e4('0x42')]!=='VIRTUAL'){var _0x53da0c={};_0x53da0c[_0x4006aa['name']]={'$like':'%'+_0x56c9c5['query'][_0xd2e4('0x53')]+'%'};return _0x53da0c;}})});}_0x27c0c7=_['merge']({},_0x27c0c7,_0x56c9c5[_0xd2e4('0x54')]);var _0x3665d8={'where':_0x27c0c7['where']};return db[_0xd2e4('0x40')][_0xd2e4('0x30')](_0x3665d8)[_0xd2e4('0x1f')](function(_0x8c9351){_0x3e01f7[_0xd2e4('0x30')]=_0x8c9351;if(_0x56c9c5['query'][_0xd2e4('0x55')]){_0x27c0c7['include']=[{'all':!![]}];}return db[_0xd2e4('0x40')][_0xd2e4('0x56')](_0x27c0c7);})['then'](function(_0x340da4){_0x3e01f7[_0xd2e4('0x57')]=_0x340da4;return _0x3e01f7;})[_0xd2e4('0x1f')](respondWithFilteredResult(_0xb2f287,_0x27c0c7))[_0xd2e4('0x2a')](handleError(_0xb2f287,null));};exports['show']=function(_0x335dea,_0x3f4a9c){var _0x3c680e={'raw':![],'where':{'id':_0x335dea[_0xd2e4('0x58')]['id']},'include':[{'model':db[_0xd2e4('0x3e')],'as':_0xd2e4('0x3f')}]},_0x48be77={};_0x48be77[_0xd2e4('0x44')]=_[_0xd2e4('0x47')](db[_0xd2e4('0x40')][_0xd2e4('0x41')]);_0x48be77[_0xd2e4('0x46')]=_[_0xd2e4('0x47')](_0x335dea['query']);_0x48be77[_0xd2e4('0x48')]=_[_0xd2e4('0x49')](_0x48be77['model'],_0x48be77[_0xd2e4('0x46')]);_0x3c680e['attributes']=_[_0xd2e4('0x49')](_0x48be77[_0xd2e4('0x44')],qs['fields'](_0x335dea[_0xd2e4('0x46')][_0xd2e4('0x4b')]));_0x3c680e[_0xd2e4('0x4a')]=_0x3c680e['attributes'][_0xd2e4('0x59')]?_0x3c680e['attributes']:_0x48be77['model'];if(_0x335dea[_0xd2e4('0x46')][_0xd2e4('0x55')]){_0x3c680e['include']=[{'all':!![]}];}_0x3c680e=_['merge']({},_0x3c680e,_0x335dea['options']);return db['FaxAccount'][_0xd2e4('0x5a')](_0x3c680e)['then'](handleEntityNotFound(_0x3f4a9c,null))['then'](respondWithResult(_0x3f4a9c,null))[_0xd2e4('0x2a')](handleError(_0x3f4a9c,null));};exports[_0xd2e4('0x5b')]=function(_0x4c5a5a,_0x539152){return db['FaxAccount'][_0xd2e4('0x5b')](_0x4c5a5a['body'],{})[_0xd2e4('0x1f')](function(_0x4b3d42){var _0x160088=_0x4c5a5a[_0xd2e4('0x5c')]['get']({'plain':!![]});if(!_0x160088)throw new Error(_0xd2e4('0x5d'));if(_0x160088['role']===_0xd2e4('0x5c')){var _0x380dd2=_0x4b3d42[_0xd2e4('0x37')]({'plain':!![]});var _0x5dcf90='FaxAccounts';return db['UserProfileSection'][_0xd2e4('0x5a')]({'where':{'name':_0x5dcf90,'userProfileId':_0x160088['userProfileId']},'raw':!![]})[_0xd2e4('0x1f')](function(_0x3df800){if(_0x3df800&&_0x3df800[_0xd2e4('0x5e')]===0x0){return db[_0xd2e4('0x39')][_0xd2e4('0x5b')]({'name':_0x380dd2[_0xd2e4('0x3c')],'resourceId':_0x380dd2['id'],'type':_0x3df800[_0xd2e4('0x3c')],'sectionId':_0x3df800['id']},{})[_0xd2e4('0x1f')](function(){return _0x4b3d42;});}else{return _0x4b3d42;}})[_0xd2e4('0x2a')](function(_0x30c9a4){logger[_0xd2e4('0x26')](_0xd2e4('0x5f'),_0x30c9a4);throw _0x30c9a4;});}return _0x4b3d42;})[_0xd2e4('0x1f')](respondWithResult(_0x539152,0xc9))[_0xd2e4('0x2a')](handleError(_0x539152,null));};exports[_0xd2e4('0x35')]=function(_0x576191,_0x33800c){if(_0x576191[_0xd2e4('0x60')]['id']){delete _0x576191[_0xd2e4('0x60')]['id'];}return db['FaxAccount'][_0xd2e4('0x5a')]({'where':{'id':_0x576191[_0xd2e4('0x58')]['id']},'include':[{'model':db[_0xd2e4('0x3e')],'as':_0xd2e4('0x3f')}]})[_0xd2e4('0x1f')](handleEntityNotFound(_0x33800c,null))[_0xd2e4('0x1f')](saveUpdates(_0x576191[_0xd2e4('0x60')],null))['then'](respondWithResult(_0x33800c,null))[_0xd2e4('0x2a')](handleError(_0x33800c,null));};exports[_0xd2e4('0x36')]=function(_0x27ac03,_0x1de24d){return db[_0xd2e4('0x40')][_0xd2e4('0x5a')]({'where':{'id':_0x27ac03[_0xd2e4('0x58')]['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0x1de24d,null))[_0xd2e4('0x1f')](removeEntity(_0x1de24d,null))[_0xd2e4('0x2a')](handleError(_0x1de24d,null));};exports['describe']=function(_0xa42d3b,_0x105b79){return db[_0xd2e4('0x40')][_0xd2e4('0x61')]()[_0xd2e4('0x1f')](respondWithResult(_0x105b79,null))[_0xd2e4('0x2a')](handleError(_0x105b79,null));};exports[_0xd2e4('0x62')]=function(_0x96c65c,_0x4e2793,_0x28deda){if(_0x96c65c[_0xd2e4('0x60')]['id']){delete _0x96c65c[_0xd2e4('0x60')]['id'];}return db['FaxAccount'][_0xd2e4('0x5a')]({'where':{'id':_0x96c65c['params']['id']}})['then'](handleEntityNotFound(_0x4e2793,null))[_0xd2e4('0x1f')](function(_0x16d418){if(_0x16d418){_0x96c65c[_0xd2e4('0x60')][_0xd2e4('0x63')]=_0x16d418['id'];return db[_0xd2e4('0x64')]['create'](_0x96c65c[_0xd2e4('0x60')]);}})[_0xd2e4('0x1f')](respondWithResult(_0x4e2793,null))['catch'](handleError(_0x4e2793,null));};exports[_0xd2e4('0x65')]=function(_0x331097,_0x445c0f,_0x246da5){var _0x47535d={'raw':![],'where':{}};var _0x165a9e={};var _0x4dd6f0={'count':0x0,'rows':[]};return db['FaxAccount'][_0xd2e4('0x66')]({'where':{'id':_0x331097[_0xd2e4('0x58')]['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0x445c0f,null))['then'](function(_0x5ed094){if(_0x5ed094){_0x165a9e[_0xd2e4('0x44')]=_[_0xd2e4('0x47')](db[_0xd2e4('0x64')][_0xd2e4('0x41')]);_0x165a9e[_0xd2e4('0x46')]=_[_0xd2e4('0x47')](_0x331097[_0xd2e4('0x46')]);_0x165a9e[_0xd2e4('0x48')]=_[_0xd2e4('0x49')](_0x165a9e['model'],_0x165a9e[_0xd2e4('0x46')]);_0x47535d[_0xd2e4('0x4a')]=_[_0xd2e4('0x49')](_0x165a9e[_0xd2e4('0x44')],qs[_0xd2e4('0x4b')](_0x331097[_0xd2e4('0x46')][_0xd2e4('0x4b')]));_0x47535d[_0xd2e4('0x4a')]=_0x47535d[_0xd2e4('0x4a')]['length']?_0x47535d[_0xd2e4('0x4a')]:_0x165a9e['model'];if(!_0x331097[_0xd2e4('0x46')][_0xd2e4('0x4c')](_0xd2e4('0x4d'))){_0x47535d[_0xd2e4('0x31')]=qs[_0xd2e4('0x31')](_0x331097[_0xd2e4('0x46')][_0xd2e4('0x31')]);_0x47535d['offset']=qs[_0xd2e4('0x2e')](_0x331097[_0xd2e4('0x46')]['offset']);}_0x47535d[_0xd2e4('0x4e')]=qs['sort'](_0x331097[_0xd2e4('0x46')][_0xd2e4('0x4f')]);_0x47535d[_0xd2e4('0x50')]=qs['filters'](_[_0xd2e4('0x51')](_0x331097['query'],_0x165a9e[_0xd2e4('0x48')]));_0x47535d['where'][_0xd2e4('0x63')]=_0x5ed094['id'];if(_0x331097['query'][_0xd2e4('0x53')]){_0x47535d['where']=_[_0xd2e4('0x52')](_0x47535d[_0xd2e4('0x50')],{'$or':_[_0xd2e4('0x45')](_0x47535d[_0xd2e4('0x4a')],function(_0x3ea85b){var _0x37eae0={};_0x37eae0[_0x3ea85b]={'$like':'%'+_0x331097[_0xd2e4('0x46')][_0xd2e4('0x53')]+'%'};return _0x37eae0;})});}_0x47535d=_[_0xd2e4('0x52')]({},_0x47535d,_0x331097[_0xd2e4('0x54')]);return db['Disposition'][_0xd2e4('0x30')]({'where':_0x47535d[_0xd2e4('0x50')]})[_0xd2e4('0x1f')](function(_0x55d32c){_0x4dd6f0[_0xd2e4('0x30')]=_0x55d32c;if(_0x331097[_0xd2e4('0x46')][_0xd2e4('0x55')]){_0x47535d[_0xd2e4('0x67')]=[{'all':!![]}];}return db[_0xd2e4('0x64')][_0xd2e4('0x56')](_0x47535d);})[_0xd2e4('0x1f')](function(_0x1195f4){_0x4dd6f0[_0xd2e4('0x57')]=_0x1195f4;return _0x4dd6f0;});}})[_0xd2e4('0x1f')](respondWithFilteredResult(_0x445c0f,_0x47535d))[_0xd2e4('0x2a')](handleError(_0x445c0f,null));};exports[_0xd2e4('0x68')]=function(_0x3aafed,_0x52381f,_0x1cac8d){return db[_0xd2e4('0x40')][_0xd2e4('0x5a')]({'where':{'id':_0x3aafed['params']['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0x52381f,null))[_0xd2e4('0x1f')](function(_0x3ffba4){if(_0x3ffba4){return _0x3ffba4[_0xd2e4('0x68')](_0x3aafed[_0xd2e4('0x46')][_0xd2e4('0x69')]);}})[_0xd2e4('0x1f')](respondWithStatusCode(_0x52381f,null))['catch'](handleError(_0x52381f,null));};exports['addAnswer']=function(_0xb030e3,_0x289135,_0x3df46a){if(_0xb030e3[_0xd2e4('0x60')]['id']){delete _0xb030e3['body']['id'];}return db[_0xd2e4('0x40')][_0xd2e4('0x5a')]({'where':{'id':_0xb030e3['params']['id']}})['then'](handleEntityNotFound(_0x289135,null))['then'](function(_0x4a9e26){if(_0x4a9e26){_0xb030e3['body']['FaxAccountId']=_0x4a9e26['id'];return db[_0xd2e4('0x6a')][_0xd2e4('0x5b')](_0xb030e3[_0xd2e4('0x60')]);}})[_0xd2e4('0x1f')](respondWithResult(_0x289135,null))[_0xd2e4('0x2a')](handleError(_0x289135,null));};exports[_0xd2e4('0x6b')]=function(_0x210ec7,_0x27723b,_0x501f27){var _0x117eb3={'raw':![],'where':{}};var _0x1d9f41={};var _0x45766e={'count':0x0,'rows':[]};return db['FaxAccount'][_0xd2e4('0x66')]({'where':{'id':_0x210ec7[_0xd2e4('0x58')]['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0x27723b,null))[_0xd2e4('0x1f')](function(_0x1a9452){if(_0x1a9452){_0x1d9f41[_0xd2e4('0x44')]=_[_0xd2e4('0x47')](db['CannedAnswer'][_0xd2e4('0x41')]);_0x1d9f41[_0xd2e4('0x46')]=_['keys'](_0x210ec7['query']);_0x1d9f41[_0xd2e4('0x48')]=_[_0xd2e4('0x49')](_0x1d9f41['model'],_0x1d9f41[_0xd2e4('0x46')]);_0x117eb3[_0xd2e4('0x4a')]=_[_0xd2e4('0x49')](_0x1d9f41[_0xd2e4('0x44')],qs[_0xd2e4('0x4b')](_0x210ec7[_0xd2e4('0x46')]['fields']));_0x117eb3['attributes']=_0x117eb3[_0xd2e4('0x4a')][_0xd2e4('0x59')]?_0x117eb3[_0xd2e4('0x4a')]:_0x1d9f41['model'];if(!_0x210ec7['query']['hasOwnProperty'](_0xd2e4('0x4d'))){_0x117eb3['limit']=qs[_0xd2e4('0x31')](_0x210ec7[_0xd2e4('0x46')][_0xd2e4('0x31')]);_0x117eb3[_0xd2e4('0x2e')]=qs['offset'](_0x210ec7[_0xd2e4('0x46')]['offset']);}_0x117eb3['order']=qs[_0xd2e4('0x4f')](_0x210ec7[_0xd2e4('0x46')][_0xd2e4('0x4f')]);_0x117eb3[_0xd2e4('0x50')]=qs[_0xd2e4('0x48')](_[_0xd2e4('0x51')](_0x210ec7[_0xd2e4('0x46')],_0x1d9f41[_0xd2e4('0x48')]));_0x117eb3[_0xd2e4('0x50')][_0xd2e4('0x63')]=_0x1a9452['id'];if(_0x210ec7[_0xd2e4('0x46')][_0xd2e4('0x53')]){_0x117eb3[_0xd2e4('0x50')]=_['merge'](_0x117eb3[_0xd2e4('0x50')],{'$or':_['map'](_0x117eb3['attributes'],function(_0x357208){var _0xb54550={};_0xb54550[_0x357208]={'$like':'%'+_0x210ec7[_0xd2e4('0x46')][_0xd2e4('0x53')]+'%'};return _0xb54550;})});}_0x117eb3=_[_0xd2e4('0x52')]({},_0x117eb3,_0x210ec7['options']);return db[_0xd2e4('0x6a')]['count']({'where':_0x117eb3[_0xd2e4('0x50')]})[_0xd2e4('0x1f')](function(_0x4824d7){_0x45766e[_0xd2e4('0x30')]=_0x4824d7;if(_0x210ec7[_0xd2e4('0x46')][_0xd2e4('0x55')]){_0x117eb3[_0xd2e4('0x67')]=[{'all':!![]}];}return db[_0xd2e4('0x6a')][_0xd2e4('0x56')](_0x117eb3);})[_0xd2e4('0x1f')](function(_0x43c4df){_0x45766e['rows']=_0x43c4df;return _0x45766e;});}})['then'](respondWithFilteredResult(_0x27723b,_0x117eb3))['catch'](handleError(_0x27723b,null));};exports[_0xd2e4('0x6c')]=function(_0x182f1e,_0x3a21aa,_0x3f7276){return db[_0xd2e4('0x40')][_0xd2e4('0x5a')]({'where':{'id':_0x182f1e[_0xd2e4('0x58')]['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0x3a21aa,null))[_0xd2e4('0x1f')](function(_0x3bab52){if(_0x3bab52){return _0x3bab52[_0xd2e4('0x6c')](_0x182f1e['query']['ids']);}})['then'](respondWithStatusCode(_0x3a21aa,null))['catch'](handleError(_0x3a21aa,null));};exports[_0xd2e4('0x6d')]=function(_0xde22b7,_0x56c952,_0x15146e){return db['FaxInteraction'][_0xd2e4('0x5a')]({'where':{'id':_0xde22b7['params']['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0x56c952,null))[_0xd2e4('0x1f')](function(_0x44123e){if(_0x44123e){return _0x44123e[_0xd2e4('0x6d')](_0xde22b7[_0xd2e4('0x60')][_0xd2e4('0x69')],_[_0xd2e4('0x6e')](_0xde22b7[_0xd2e4('0x60')],[_0xd2e4('0x69'),'id'])||{});}})[_0xd2e4('0x1f')](respondWithResult(_0x56c952,null))[_0xd2e4('0x2a')](handleError(_0x56c952,null));};exports[_0xd2e4('0x6f')]=function(_0x3ef6df,_0x2df365,_0x2f8fae){var _0x9fb8d0={'raw':![],'where':{}};var _0x2970ab={};var _0x1c6a50={'count':0x0,'rows':[]};return db['FaxAccount'][_0xd2e4('0x66')]({'where':{'id':_0x3ef6df[_0xd2e4('0x58')]['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0x2df365,null))['then'](function(_0x559438){if(_0x559438){_0x2970ab[_0xd2e4('0x44')]=_[_0xd2e4('0x47')](db[_0xd2e4('0x70')][_0xd2e4('0x41')]);_0x2970ab[_0xd2e4('0x46')]=_['keys'](_0x3ef6df[_0xd2e4('0x46')]);_0x2970ab[_0xd2e4('0x48')]=_[_0xd2e4('0x49')](_0x2970ab[_0xd2e4('0x44')],_0x2970ab[_0xd2e4('0x46')]);_0x9fb8d0[_0xd2e4('0x4a')]=_[_0xd2e4('0x49')](_0x2970ab[_0xd2e4('0x44')],qs['fields'](_0x3ef6df[_0xd2e4('0x46')][_0xd2e4('0x4b')]));_0x9fb8d0[_0xd2e4('0x4a')]=_0x9fb8d0[_0xd2e4('0x4a')][_0xd2e4('0x59')]?_0x9fb8d0[_0xd2e4('0x4a')]:_0x2970ab['model'];if(!_0x3ef6df[_0xd2e4('0x46')]['hasOwnProperty'](_0xd2e4('0x4d'))){_0x9fb8d0[_0xd2e4('0x31')]=qs['limit'](_0x3ef6df['query'][_0xd2e4('0x31')]);_0x9fb8d0[_0xd2e4('0x2e')]=qs[_0xd2e4('0x2e')](_0x3ef6df[_0xd2e4('0x46')][_0xd2e4('0x2e')]);}_0x9fb8d0[_0xd2e4('0x4e')]=qs['sort'](_0x3ef6df[_0xd2e4('0x46')]['sort']);_0x9fb8d0[_0xd2e4('0x50')]=qs[_0xd2e4('0x48')](_[_0xd2e4('0x51')](_0x3ef6df['query'],_0x2970ab[_0xd2e4('0x48')]));_0x9fb8d0[_0xd2e4('0x50')]['FaxAccountId']=_0x559438['id'];if(_0x3ef6df[_0xd2e4('0x46')][_0xd2e4('0x53')]){_0x9fb8d0[_0xd2e4('0x50')]=_[_0xd2e4('0x52')](_0x9fb8d0[_0xd2e4('0x50')],{'$or':_[_0xd2e4('0x45')](_0x9fb8d0['attributes'],function(_0x49e439){var _0x15a46a={};_0x15a46a[_0x49e439]={'$like':'%'+_0x3ef6df[_0xd2e4('0x46')][_0xd2e4('0x53')]+'%'};return _0x15a46a;})});}_0x9fb8d0=_[_0xd2e4('0x52')]({},_0x9fb8d0,_0x3ef6df[_0xd2e4('0x54')]);return db[_0xd2e4('0x70')][_0xd2e4('0x30')]({'where':_0x9fb8d0[_0xd2e4('0x50')]})[_0xd2e4('0x1f')](function(_0x344149){_0x1c6a50[_0xd2e4('0x30')]=_0x344149;if(_0x3ef6df[_0xd2e4('0x46')][_0xd2e4('0x55')]){_0x9fb8d0[_0xd2e4('0x67')]=[{'model':db[_0xd2e4('0x71')],'as':_0xd2e4('0x72'),'required':![]},{'model':db['User'],'as':_0xd2e4('0x73'),'attributes':[_0xd2e4('0x3c'),_0xd2e4('0x74'),_0xd2e4('0x75')],'required':![]},{'model':db[_0xd2e4('0x76')],'as':_0xd2e4('0x77'),'attributes':['id',_0xd2e4('0x3c'),'color'],'where':_0x3ef6df[_0xd2e4('0x46')][_0xd2e4('0x78')]?{'id':_0x3ef6df[_0xd2e4('0x46')][_0xd2e4('0x78')]}:undefined,'required':_0x3ef6df[_0xd2e4('0x46')][_0xd2e4('0x78')]?!![]:![]}];}return db[_0xd2e4('0x70')][_0xd2e4('0x56')](_0x9fb8d0);})[_0xd2e4('0x1f')](function(_0x1eef43){_0x1c6a50[_0xd2e4('0x57')]=_0x1eef43;return _0x1c6a50;});}})[_0xd2e4('0x1f')](respondWithFilteredResult(_0x2df365,_0x9fb8d0))[_0xd2e4('0x2a')](handleError(_0x2df365,null));};exports[_0xd2e4('0x79')]=function(_0x3310cb,_0x27d594){var _0x23b744=_0x3310cb['params']['id'];var _0x4fe018=_0x3310cb['body'];var _0x2e7235=0xc8;var _0x45f7c7=null;return db['sequelize'][_0xd2e4('0x7a')]({'isolationLevel':db['sequelize'][_0xd2e4('0x7b')][_0xd2e4('0x7c')][_0xd2e4('0x7d')]},function(_0x1c3ff9){return db[_0xd2e4('0x40')]['findOne']({'where':{'id':_0x23b744},'transaction':_0x1c3ff9})[_0xd2e4('0x1f')](function(_0x30e521){if(_0x30e521){return db[_0xd2e4('0x7e')]['destroy']({'where':{'FaxAccountId':_0x23b744},'transaction':_0x1c3ff9})[_0xd2e4('0x1f')](function(){var _0x34abae=_[_0xd2e4('0x45')](_0x4fe018,function(_0x2e88a2){_0x2e88a2[_0xd2e4('0x63')]=_0x23b744;return _0x2e88a2;});return db[_0xd2e4('0x7e')]['bulkCreate'](_0x34abae,{'transaction':_0x1c3ff9});});}else{_0x2e7235=0x194;_0x45f7c7=[];}});})[_0xd2e4('0x1f')](function(){if(_0x2e7235!==0x194){return db[_0xd2e4('0x7e')]['findAndCountAll']({'where':{'FaxAccountId':_0x23b744},'order':_0xd2e4('0x7f')})[_0xd2e4('0x1f')](function(_0xa492fc){_0x45f7c7=_0xa492fc;});}})[_0xd2e4('0x2a')](function(_0x230ed0){_0x2e7235=0x1f4;logger[_0xd2e4('0x26')](_0x230ed0['stack']);if(_0x230ed0[_0xd2e4('0x3c')]){delete _0x230ed0[_0xd2e4('0x3c')];}_0x45f7c7=_0x230ed0;})[_0xd2e4('0x80')](function(){if(_0x45f7c7===null){_0x27d594[_0xd2e4('0x2b')](_0x2e7235);}else{if(_0x2e7235===0x1f4){_0x27d594['status'](_0x2e7235)['send'](_0x45f7c7);}else{_0x27d594['status'](_0x2e7235)[_0xd2e4('0x2d')](_0x45f7c7);}}});};exports[_0xd2e4('0x81')]=function(_0x303a88,_0xae7543,_0x49d124){var _0x16f518={};var _0xeb19a4={};var _0x355c48;var _0x5c3e5a;return db[_0xd2e4('0x40')][_0xd2e4('0x66')]({'where':{'id':_0x303a88['params']['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0xae7543,null))[_0xd2e4('0x1f')](function(_0x242d53){if(_0x242d53){_0x355c48=_0x242d53;_0xeb19a4[_0xd2e4('0x44')]=_[_0xd2e4('0x47')](db[_0xd2e4('0x7e')]['rawAttributes']);_0xeb19a4[_0xd2e4('0x46')]=_[_0xd2e4('0x47')](_0x303a88['query']);_0xeb19a4[_0xd2e4('0x48')]=_[_0xd2e4('0x49')](_0xeb19a4[_0xd2e4('0x44')],_0xeb19a4[_0xd2e4('0x46')]);_0x16f518[_0xd2e4('0x4a')]=_['intersection'](_0xeb19a4[_0xd2e4('0x44')],qs[_0xd2e4('0x4b')](_0x303a88['query']['fields']));_0x16f518['attributes']=_0x16f518[_0xd2e4('0x4a')]['length']?_0x16f518['attributes']:_0xeb19a4[_0xd2e4('0x44')];_0x16f518['order']=qs[_0xd2e4('0x4f')](_0x303a88['query'][_0xd2e4('0x4f')]);_0x16f518['where']=qs[_0xd2e4('0x48')](_[_0xd2e4('0x51')](_0x303a88[_0xd2e4('0x46')],_0xeb19a4[_0xd2e4('0x48')]));if(_0x303a88[_0xd2e4('0x46')][_0xd2e4('0x53')]){_0x16f518[_0xd2e4('0x50')]=_['merge'](_0x16f518['where'],{'$or':_[_0xd2e4('0x45')](_0x16f518[_0xd2e4('0x4a')],function(_0x27878c){var _0x3c45da={};_0x3c45da[_0x27878c]={'$like':'%'+_0x303a88[_0xd2e4('0x46')][_0xd2e4('0x53')]+'%'};return _0x3c45da;})});}_0x16f518=_['merge']({},_0x16f518,_0x303a88[_0xd2e4('0x54')]);return _0x355c48[_0xd2e4('0x81')](_0x16f518);}})[_0xd2e4('0x1f')](function(_0x1573e9){if(_0x1573e9){_0x5c3e5a=_0x1573e9[_0xd2e4('0x59')];if(!_0x303a88['query'][_0xd2e4('0x4c')](_0xd2e4('0x4d'))){_0x16f518['limit']=qs['limit'](_0x303a88[_0xd2e4('0x46')]['limit']);_0x16f518[_0xd2e4('0x2e')]=qs['offset'](_0x303a88['query'][_0xd2e4('0x2e')]);}return _0x355c48[_0xd2e4('0x81')](_0x16f518);}})[_0xd2e4('0x1f')](function(_0x3638b2){if(_0x3638b2){return _0x3638b2?{'count':_0x5c3e5a,'rows':_0x3638b2}:null;}})[_0xd2e4('0x1f')](respondWithResult(_0xae7543,null))[_0xd2e4('0x2a')](handleError(_0xae7543,null));};function Extension(_0x4b05da,_0x3874e4,_0x3e8dd0,_0x4c6f89){this[_0xd2e4('0x82')]=_0xd2e4('0x83');this[_0xd2e4('0x84')]=_0x4b05da[_0xd2e4('0x85')];this[_0xd2e4('0x86')]=_0x4c6f89;this['type']='system';this[_0xd2e4('0x87')]=_0xd2e4('0x88');this['FaxAccountId']=_0x4b05da['id'];this[_0xd2e4('0x7f')]=_0x3874e4;this[_0xd2e4('0x89')]=_0x3e8dd0;}function createExtensionsReciveFax(_0x50a24c){var _0x58b363=0x1;var _0x1950fa=[];_0x1950fa[_0xd2e4('0x8a')](new Extension(_0x50a24c,_0x58b363,'',_0xd2e4('0x8b')));_0x58b363+=0x1;_0x1950fa['push'](new Extension(_0x50a24c,_0x58b363,_0xd2e4('0x8c'),_0xd2e4('0x8d')));_0x58b363+=0x1;for(var _0x4ee4ca in _0x50a24c){if(_0x50a24c['hasOwnProperty'](_0x4ee4ca)&&(_0x4ee4ca===_0xd2e4('0x8e')||_0x4ee4ca===_0xd2e4('0x85')||_0x4ee4ca===_0xd2e4('0x8f')||_0x4ee4ca==='faxdetect'||_0x4ee4ca==='headerinfo'||_0x4ee4ca===_0xd2e4('0x90')||_0x4ee4ca===_0xd2e4('0x91')||_0x4ee4ca==='modem'||_0x4ee4ca==='t38timeout')){_0x1950fa[_0xd2e4('0x8a')](new Extension(_0x50a24c,_0x58b363,_0xd2e4('0x92')+_0x4ee4ca+')='+_0x50a24c[_0x4ee4ca],_0xd2e4('0x8d')));_0x58b363+=0x1;}}_0x1950fa[_0xd2e4('0x8a')](new Extension(_0x50a24c,_0x58b363,'6',_0xd2e4('0x93')));_0x58b363+=0x1;_0x1950fa[_0xd2e4('0x8a')](new Extension(_0x50a24c,_0x58b363,_0xd2e4('0x94'),_0xd2e4('0x95')));_0x58b363=0x0;return _0x1950fa;}exports[_0xd2e4('0x96')]=function(_0x1161e6,_0x21fba5,_0x208ac6){var _0x48e6f6;return db[_0xd2e4('0x97')]['transaction'](function(_0x215835){return db[_0xd2e4('0x40')][_0xd2e4('0x5b')](_0x1161e6[_0xd2e4('0x60')],{'transaction':_0x215835})[_0xd2e4('0x1f')](function(_0x427d27){_0x48e6f6=_0x427d27[_0xd2e4('0x37')]({'plain':!![]});return db[_0xd2e4('0x98')][_0xd2e4('0x99')](createExtensionsReciveFax(_0x48e6f6),{'transaction':_0x215835});});})[_0xd2e4('0x1f')](function(){return _0x48e6f6;})[_0xd2e4('0x1f')](respondWithResult(_0x21fba5,null))[_0xd2e4('0x2a')](handleError(_0x21fba5,null));};exports[_0xd2e4('0x9a')]=function(_0x1d6948,_0x3eb758,_0x161683){var _0xbfb95d;return db[_0xd2e4('0x97')][_0xd2e4('0x7a')](function(_0x111fc7){return db[_0xd2e4('0x40')]['update'](_0x1d6948[_0xd2e4('0x60')],{'where':{'id':_0x1d6948[_0xd2e4('0x60')]['id']},'transaction':_0x111fc7})['then'](function(_0x3b06a9){return db['VoiceExtension'][_0xd2e4('0x36')]({'where':{'FaxAccountId':_0x1d6948[_0xd2e4('0x60')]['id']},'transaction':_0x111fc7})[_0xd2e4('0x1f')](function(_0x349512){return db['VoiceExtension'][_0xd2e4('0x99')](createExtensionsReciveFax(_[_0xd2e4('0x6e')](_0x1d6948[_0xd2e4('0x60')],[_0xd2e4('0x9b'),_0xd2e4('0x43'),_0xd2e4('0x9c'),_0xd2e4('0x9d'),'TrunkId',_0xd2e4('0x9e')])),{'transaction':_0x111fc7});});});})[_0xd2e4('0x1f')](function(){return db[_0xd2e4('0x40')][_0xd2e4('0x9f')](_0x1d6948[_0xd2e4('0x60')]['id']);})[_0xd2e4('0x1f')](respondWithResult(_0x3eb758,null))[_0xd2e4('0x2a')](handleError(_0x3eb758,null));};exports['getMessages']=function(_0x298668,_0x176cf9,_0x5cdac5){var _0x3357b3={'raw':!![],'where':{}};var _0x3b6901={};var _0xd1170d={'count':0x0,'rows':[]};return db['FaxAccount'][_0xd2e4('0x66')]({'where':{'id':_0x298668['params']['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0x176cf9,null))[_0xd2e4('0x1f')](function(_0x5bc1ee){if(_0x5bc1ee){_0x3b6901['model']=_[_0xd2e4('0x47')](db[_0xd2e4('0xa0')][_0xd2e4('0x41')]);_0x3b6901[_0xd2e4('0x46')]=_[_0xd2e4('0x47')](_0x298668[_0xd2e4('0x46')]);_0x3b6901[_0xd2e4('0x48')]=_[_0xd2e4('0x49')](_0x3b6901['model'],_0x3b6901['query']);_0x3357b3[_0xd2e4('0x4a')]=_[_0xd2e4('0x49')](_0x3b6901[_0xd2e4('0x44')],qs[_0xd2e4('0x4b')](_0x298668[_0xd2e4('0x46')][_0xd2e4('0x4b')]));_0x3357b3['attributes']=_0x3357b3[_0xd2e4('0x4a')][_0xd2e4('0x59')]?_0x3357b3[_0xd2e4('0x4a')]:_0x3b6901[_0xd2e4('0x44')];if(!_0x298668['query'][_0xd2e4('0x4c')](_0xd2e4('0x4d'))){_0x3357b3['limit']=qs['limit'](_0x298668[_0xd2e4('0x46')][_0xd2e4('0x31')]);_0x3357b3[_0xd2e4('0x2e')]=qs[_0xd2e4('0x2e')](_0x298668[_0xd2e4('0x46')][_0xd2e4('0x2e')]);}_0x3357b3[_0xd2e4('0x4e')]=qs[_0xd2e4('0x4f')](_0x298668[_0xd2e4('0x46')]['sort']);_0x3357b3[_0xd2e4('0x50')]=qs[_0xd2e4('0x48')](_[_0xd2e4('0x51')](_0x298668[_0xd2e4('0x46')],_0x3b6901[_0xd2e4('0x48')]));_0x3357b3[_0xd2e4('0x50')][_0xd2e4('0x63')]=_0x5bc1ee['id'];if(_0x298668[_0xd2e4('0x46')][_0xd2e4('0x53')]){_0x3357b3['where']=_[_0xd2e4('0x52')](_0x3357b3[_0xd2e4('0x50')],{'$or':_['map'](_0x3357b3[_0xd2e4('0x4a')],function(_0x28c245){var _0x3fce67={};_0x3fce67[_0x28c245]={'$like':'%'+_0x298668[_0xd2e4('0x46')][_0xd2e4('0x53')]+'%'};return _0x3fce67;})});}if(_0x298668[_0xd2e4('0x46')]['$gte']){var _0x167de8=_0x298668[_0xd2e4('0x46')]['$gte'][_0xd2e4('0xa1')](',');var _0x2b0921={};_0x2b0921[_0x167de8[0x0]]={'$gte':moment(_0x167de8[0x1])[_0xd2e4('0xa2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3357b3[_0xd2e4('0x50')]=_[_0xd2e4('0x52')](_0x3357b3[_0xd2e4('0x50')],_0x2b0921);}_0x3357b3=_[_0xd2e4('0x52')]({},_0x3357b3,_0x298668[_0xd2e4('0x54')]);return db[_0xd2e4('0xa0')][_0xd2e4('0x30')]({'where':_0x3357b3['where']})[_0xd2e4('0x1f')](function(_0x7ae7c3){_0xd1170d[_0xd2e4('0x30')]=_0x7ae7c3;if(_0x298668[_0xd2e4('0x46')][_0xd2e4('0x55')]){_0x3357b3[_0xd2e4('0x67')]=[{'all':!![]}];}return db[_0xd2e4('0xa0')][_0xd2e4('0x56')](_0x3357b3);})[_0xd2e4('0x1f')](function(_0x111858){_0xd1170d['rows']=_0x111858;return _0xd1170d;});}})[_0xd2e4('0x1f')](respondWithFilteredResult(_0x176cf9,_0x3357b3))[_0xd2e4('0x2a')](handleError(_0x176cf9,null));};exports[_0xd2e4('0xa3')]=function(_0x2a9549,_0xa953e1,_0x440dd8){var _0xf0a7cc,_0x376dac={},_0x31a365;if(_0x2a9549['body']['to']){_0x31a365=_0x2a9549['body']['to'][0x0];}return db[_0xd2e4('0x40')][_0xd2e4('0x5a')]({'where':{'id':_0x2a9549[_0xd2e4('0x58')]['id']},'include':[{'model':db[_0xd2e4('0xa4')],'as':'List','include':[{'model':db[_0xd2e4('0x71')],'as':_0xd2e4('0xa5'),'where':{'fax':_0x31a365},'limit':0x1,'order':[[_0xd2e4('0x9d'),_0xd2e4('0xa6')]]}]}]})[_0xd2e4('0x1f')](handleEntityNotFound(_0xa953e1,null))[_0xd2e4('0x1f')](function(_0x2be3ba){_0xf0a7cc=_0x2be3ba;if(_0x2a9549['body'][_0xd2e4('0xa7')]&&_0x2a9549['body'][_0xd2e4('0xa7')][_0xd2e4('0x59')]){for(var _0xba7f04=0x0;_0xba7f04<_0x2a9549[_0xd2e4('0x60')][_0xd2e4('0xa7')][_0xd2e4('0x59')];_0xba7f04+=0x1){_0x2a9549[_0xd2e4('0x60')]['attachments'][_0xba7f04]={'filename':_0x2a9549[_0xd2e4('0x60')][_0xd2e4('0xa7')][_0xba7f04][_0xd2e4('0x3c')],'id':_0x2a9549['body'][_0xd2e4('0xa7')][_0xba7f04]['id'],'path':path['join'](config[_0xd2e4('0xa8')],_0xd2e4('0xa9'),_0x2a9549[_0xd2e4('0x60')][_0xd2e4('0xa7')][_0xba7f04][_0xd2e4('0xaa')])};}}return respondWithRpcPromise(_0xd2e4('0xab'),_0xd2e4('0xab'),{'FaxAccountId':_[_0xd2e4('0xac')](_0x2a9549[_0xd2e4('0x58')]['id'])?undefined:_0x2a9549[_0xd2e4('0x58')]['id'],'path':_[_0xd2e4('0xac')](_0x2a9549[_0xd2e4('0x60')][_0xd2e4('0xa7')][0x0][_0xd2e4('0xad')])?undefined:_0x2a9549['body'][_0xd2e4('0xa7')][0x0][_0xd2e4('0xad')],'fax':_[_0xd2e4('0xac')](_0x2a9549[_0xd2e4('0x60')]['to'][0x0])?undefined:_0x2a9549[_0xd2e4('0x60')]['to'][0x0]},client9002);})['then'](function(){if(_0xf0a7cc){if(_[_0xd2e4('0xac')](_0x2a9549[_0xd2e4('0x60')][_0xd2e4('0xae')])){_0x2a9549['body'][_0xd2e4('0xae')]=util[_0xd2e4('0xa2')]('\x22%s\x22\x20<%s>',_0xf0a7cc[_0xd2e4('0x3c')],_0xf0a7cc[_0xd2e4('0xaf')]);}if(_0xf0a7cc['List']){if(_0xf0a7cc[_0xd2e4('0xb0')][_0xd2e4('0xa5')][_0xd2e4('0x59')]){return _0xf0a7cc['List'][_0xd2e4('0xa5')][0x0];}else{return db[_0xd2e4('0x71')]['create'](_[_0xd2e4('0xb1')](_0x2a9549[_0xd2e4('0x60')],{'firstName':_0x2a9549[_0xd2e4('0x60')]['to'][0x0],'phone':_0x2a9549[_0xd2e4('0x60')]['to'][0x0],'fax':_0x2a9549[_0xd2e4('0x60')]['to'][0x0],'ListId':_0xf0a7cc['ListId']}));}}else{throw new Error(_0xd2e4('0xb2'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xd2e4('0x1f')](function(_0x553578){if(_0x553578){return db[_0xd2e4('0x70')][_0xd2e4('0x5a')]({'where':{'ContactId':_0x553578['id'],'closed':![],'FaxAccountId':_0xf0a7cc['id']}})[_0xd2e4('0x1f')](function(_0x4b5cc8){if(_0x4b5cc8){return[_0x4b5cc8,![]];}return db[_0xd2e4('0x70')]['create']({'UserId':_0x2a9549['user']['id'],'ContactId':_0x553578['id'],'FaxAccountId':_0xf0a7cc['id'],'fax':_0x2a9549['body']['to'][0x0],'firstMsgDirection':_0xd2e4('0xb3'),'Messages':[_['merge'](_0x2a9549['body'],{'read':![],'body':_0x2a9549[_0xd2e4('0x60')]['attachments'][0x0][_0xd2e4('0xb4')],'FaxAccountId':_0xf0a7cc['id'],'UserId':_0x2a9549[_0xd2e4('0x5c')]['id'],'ContactId':_0x553578['id'],'AttachmentId':_0x2a9549[_0xd2e4('0x60')][_0xd2e4('0xa7')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xd2e4('0xb5')}]})[_0xd2e4('0x1f')](function(_0x301510){return[_0x301510,!![]];});});}else{throw new Error(_0xd2e4('0xb6'));}})[_0xd2e4('0xb7')](function(_0x7b2814,_0x375127){if(_0x375127){return _0x7b2814;}return db[_0xd2e4('0xa0')][_0xd2e4('0x5b')]({'direction':_0xd2e4('0xb3'),'read':![],'body':_0x2a9549[_0xd2e4('0x60')][_0xd2e4('0xa7')][0x0]['filename'],'FaxAccountId':_0xf0a7cc['id'],'FaxInteractionId':_0x7b2814['id'],'UserId':_0x2a9549[_0xd2e4('0x5c')]['id'],'ContactId':_0x7b2814[_0xd2e4('0xb8')],'AttachmentId':_0x2a9549[_0xd2e4('0x60')][_0xd2e4('0xa7')][0x0]['id']})[_0xd2e4('0x1f')](function(_0x44dbeb){_0x7b2814[_0xd2e4('0xb9')]['Messages']=[];_0x7b2814[_0xd2e4('0xb9')][_0xd2e4('0xb5')][_0xd2e4('0x8a')](_0x44dbeb[_0xd2e4('0xb9')]);return _0x7b2814;});})[_0xd2e4('0x1f')](function(_0x1bf809){respondWithRpcPromise(_0xd2e4('0xba'),_0xd2e4('0xba'),{'FaxAccountId':_[_0xd2e4('0xac')](_0x2a9549[_0xd2e4('0x58')]['id'])?undefined:_0x2a9549[_0xd2e4('0x58')]['id'],'path':_[_0xd2e4('0xac')](_0x2a9549[_0xd2e4('0x60')][_0xd2e4('0xa7')][0x0][_0xd2e4('0xad')])?undefined:_0x2a9549[_0xd2e4('0x60')]['attachments'][0x0][_0xd2e4('0xad')],'fax':_[_0xd2e4('0xac')](_0x2a9549[_0xd2e4('0x60')]['to'][0x0])?undefined:_0x2a9549['body']['to'][0x0],'AttachmentId':_0x2a9549[_0xd2e4('0x60')][_0xd2e4('0xa7')][0x0]['id']},client9002)[_0xd2e4('0x1f')](function(_0x5a7b88){logger[_0xd2e4('0x20')](_0xd2e4('0xbb'),_0x5a7b88);})[_0xd2e4('0x2a')](function(_0x4a8a2a){logger[_0xd2e4('0x20')]('SendFaxRpc,\x20%s',_0x4a8a2a);});return _0x1bf809;})[_0xd2e4('0x1f')](respondWithResult(_0xa953e1,null))[_0xd2e4('0x2a')](handleError(_0xa953e1,null));};exports[_0xd2e4('0xbc')]=function(_0xc9952e,_0x40b6a9,_0x59c805){return db[_0xd2e4('0x40')][_0xd2e4('0x5a')]({'where':{'id':_0xc9952e['params']['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0x40b6a9,null))[_0xd2e4('0x1f')](function(_0xd0b8b){if(_0xd0b8b){return _0xd0b8b[_0xd2e4('0xbc')](_0xc9952e[_0xd2e4('0x60')][_0xd2e4('0x69')],_[_0xd2e4('0x6e')](_0xc9952e[_0xd2e4('0x60')],[_0xd2e4('0x69'),'id'])||{})[_0xd2e4('0xb7')](function(_0x4a692b){for(var _0x9b03d0=0x0;_0x9b03d0<_0xc9952e[_0xd2e4('0x60')][_0xd2e4('0x69')][_0xd2e4('0x59')];_0x9b03d0+=0x1){socket['emit'](_0xd2e4('0xbd'),{'UserId':Number(_0xc9952e['body'][_0xd2e4('0x69')][_0x9b03d0]),'FaxAccountId':Number(_0xc9952e[_0xd2e4('0x58')]['id'])});}return _0x4a692b;});}})[_0xd2e4('0x1f')](respondWithResult(_0x40b6a9,null))[_0xd2e4('0x2a')](handleError(_0x40b6a9,null));};exports['removeAgents']=function(_0x53571d,_0x38ecb8,_0xe089f8){return db[_0xd2e4('0x40')][_0xd2e4('0x5a')]({'where':{'id':_0x53571d[_0xd2e4('0x58')]['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0x38ecb8,null))[_0xd2e4('0x1f')](function(_0x10d7c7){if(_0x10d7c7){return _0x10d7c7['removeAgents'](_0x53571d['query'][_0xd2e4('0x69')])[_0xd2e4('0x1f')](function(){if(_[_0xd2e4('0xbe')](_0x53571d[_0xd2e4('0x46')][_0xd2e4('0x69')])){for(var _0x1b8a6f=0x0;_0x1b8a6f<_0x53571d[_0xd2e4('0x46')][_0xd2e4('0x69')]['length'];_0x1b8a6f+=0x1){socket[_0xd2e4('0xbf')](_0xd2e4('0xc0'),{'UserId':Number(_0x53571d[_0xd2e4('0x46')][_0xd2e4('0x69')][_0x1b8a6f]),'FaxAccountId':Number(_0x53571d[_0xd2e4('0x58')]['id'])});}}else{socket[_0xd2e4('0xbf')](_0xd2e4('0xc0'),{'UserId':Number(_0x53571d[_0xd2e4('0x46')]['ids']),'FaxAccountId':Number(_0x53571d['params']['id'])});}});}})[_0xd2e4('0x1f')](respondWithStatusCode(_0x38ecb8,null))[_0xd2e4('0x2a')](handleError(_0x38ecb8,null));};exports[_0xd2e4('0xc1')]=function(_0x13d324,_0xbbbf58,_0x11c63d){var _0x321119={};var _0x4cea41={};var _0x365264;var _0x34b200;return db[_0xd2e4('0x40')]['findOne']({'where':{'id':_0x13d324[_0xd2e4('0x58')]['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0xbbbf58,null))[_0xd2e4('0x1f')](function(_0x4a7f50){if(_0x4a7f50){_0x365264=_0x4a7f50;_0x4cea41['model']=_[_0xd2e4('0x47')](db[_0xd2e4('0xc2')]['rawAttributes']);_0x4cea41[_0xd2e4('0x46')]=_[_0xd2e4('0x47')](_0x13d324[_0xd2e4('0x46')]);_0x4cea41[_0xd2e4('0x48')]=_[_0xd2e4('0x49')](_0x4cea41[_0xd2e4('0x44')],_0x4cea41[_0xd2e4('0x46')]);_0x321119[_0xd2e4('0x4a')]=_[_0xd2e4('0x49')](_0x4cea41[_0xd2e4('0x44')],qs[_0xd2e4('0x4b')](_0x13d324[_0xd2e4('0x46')][_0xd2e4('0x4b')]));_0x321119['attributes']=_0x321119[_0xd2e4('0x4a')][_0xd2e4('0x59')]?_0x321119['attributes']:_0x4cea41[_0xd2e4('0x44')];_0x321119[_0xd2e4('0x4e')]=qs[_0xd2e4('0x4f')](_0x13d324[_0xd2e4('0x46')][_0xd2e4('0x4f')]);_0x321119[_0xd2e4('0x50')]=qs['filters'](_[_0xd2e4('0x51')](_0x13d324[_0xd2e4('0x46')],_0x4cea41[_0xd2e4('0x48')]));if(_0x13d324[_0xd2e4('0x46')][_0xd2e4('0x53')]){_0x321119['where']=_[_0xd2e4('0x52')](_0x321119['where'],{'$or':_[_0xd2e4('0x45')](_0x321119['attributes'],function(_0x15cc33){var _0x5c03a2={};_0x5c03a2[_0x15cc33]={'$like':'%'+_0x13d324[_0xd2e4('0x46')]['filter']+'%'};return _0x5c03a2;})});}_0x321119=_['merge']({},_0x321119,_0x13d324['options']);return _0x365264['getAgents'](_0x321119);}})['then'](function(_0x57b970){if(_0x57b970){_0x34b200=_0x57b970[_0xd2e4('0x59')];if(!_0x13d324['query']['hasOwnProperty'](_0xd2e4('0x4d'))){_0x321119[_0xd2e4('0x31')]=qs['limit'](_0x13d324[_0xd2e4('0x46')][_0xd2e4('0x31')]);_0x321119[_0xd2e4('0x2e')]=qs[_0xd2e4('0x2e')](_0x13d324[_0xd2e4('0x46')][_0xd2e4('0x2e')]);}return _0x365264[_0xd2e4('0xc1')](_0x321119);}})[_0xd2e4('0x1f')](function(_0x315e8e){if(_0x315e8e){return _0x315e8e?{'count':_0x34b200,'rows':_0x315e8e}:null;}})['then'](respondWithResult(_0xbbbf58,null))[_0xd2e4('0x2a')](handleError(_0xbbbf58,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 344d809..25dda80 100644 --- a/server/api/faxAccount/faxAccount.events.js +++ b/server/api/faxAccount/faxAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b19=['remove','emit','hook','exports','events','FaxAccount','setMaxListeners','update'];(function(_0x7380e0,_0x75deb6){var _0x1ffff1=function(_0xf172b8){while(--_0xf172b8){_0x7380e0['push'](_0x7380e0['shift']());}};_0x1ffff1(++_0x75deb6);}(_0x6b19,0xf4));var _0x96b1=function(_0x25bcec,_0x4418f1){_0x25bcec=_0x25bcec-0x0;var _0x3e3e22=_0x6b19[_0x25bcec];return _0x3e3e22;};'use strict';var EventEmitter=require(_0x96b1('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x96b1('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x96b1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x96b1('0x3'),'afterDestroy':_0x96b1('0x4')};function emitEvent(_0x31c877){return function(_0x30aef8,_0x5e84f7,_0x84bd21){FaxAccountEvents[_0x96b1('0x5')](_0x31c877+':'+_0x30aef8['id'],_0x30aef8);FaxAccountEvents['emit'](_0x31c877,_0x30aef8);_0x84bd21(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x96b1('0x6')](e,emitEvent(event));}}module[_0x96b1('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x211e=['exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x530090,_0x74ce3e){var _0x258633=function(_0x3b90eb){while(--_0x3b90eb){_0x530090['push'](_0x530090['shift']());}};_0x258633(++_0x74ce3e);}(_0x211e,0x1b1));var _0xe211=function(_0x494b17,_0x5bb833){_0x494b17=_0x494b17-0x0;var _0x288f59=_0x211e[_0x494b17];return _0x288f59;};'use strict';var EventEmitter=require(_0xe211('0x0'));var FaxAccount=require(_0xe211('0x1'))['db'][_0xe211('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xe211('0x3')](0x0);var events={'afterCreate':_0xe211('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x38cabc){return function(_0x2344b0,_0x3dcb93,_0x461a87){FaxAccountEvents['emit'](_0x38cabc+':'+_0x2344b0['id'],_0x2344b0);FaxAccountEvents[_0xe211('0x5')](_0x38cabc,_0x2344b0);_0x461a87(null);};}for(var e in events){if(events[_0xe211('0x6')](e)){var event=events[e];FaxAccount[_0xe211('0x7')](e,emitEvent(event));}}module[_0xe211('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 9bc8204..e07e22d 100644 --- a/server/api/faxAccount/faxAccount.model.js +++ b/server/api/faxAccount/faxAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f7e=['FaxAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports'];(function(_0x4b8553,_0x1da94d){var _0x4e86c8=function(_0x3bdde1){while(--_0x3bdde1){_0x4b8553['push'](_0x4b8553['shift']());}};_0x4e86c8(++_0x1da94d);}(_0x0f7e,0x194));var _0xe0f7=function(_0x2508b5,_0x482f01){_0x2508b5=_0x2508b5-0x0;var _0x127baf=_0x0f7e[_0x2508b5];return _0x127baf;};'use strict';var _=require(_0xe0f7('0x0'));var util=require(_0xe0f7('0x1'));var logger=require(_0xe0f7('0x2'))(_0xe0f7('0x3'));var moment=require(_0xe0f7('0x4'));var BPromise=require(_0xe0f7('0x5'));var rp=require(_0xe0f7('0x6'));var fs=require('fs');var path=require(_0xe0f7('0x7'));var rimraf=require(_0xe0f7('0x8'));var config=require(_0xe0f7('0x9'));var attributes=require(_0xe0f7('0xa'));module[_0xe0f7('0xb')]=function(_0x405605,_0x2a6424){return _0x405605['define'](_0xe0f7('0xc'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8768=['fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','FaxAccount'];(function(_0x419044,_0x48aa83){var _0x5a69dd=function(_0x384102){while(--_0x384102){_0x419044['push'](_0x419044['shift']());}};_0x5a69dd(++_0x48aa83);}(_0x8768,0xa6));var _0x8876=function(_0x3cd0c4,_0x4f4fbb){_0x3cd0c4=_0x3cd0c4-0x0;var _0x466479=_0x8768[_0x3cd0c4];return _0x466479;};'use strict';var _=require(_0x8876('0x0'));var util=require(_0x8876('0x1'));var logger=require(_0x8876('0x2'))(_0x8876('0x3'));var moment=require(_0x8876('0x4'));var BPromise=require(_0x8876('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8876('0x6'));var config=require(_0x8876('0x7'));var attributes=require('./faxAccount.attributes');module[_0x8876('0x8')]=function(_0x1ba0c3,_0x16d773){return _0x1ba0c3['define'](_0x8876('0x9'),attributes,{'tableName':_0x8876('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 185434f..0aeca73 100644 --- a/server/api/faxAccount/faxAccount.rpc.js +++ b/server/api/faxAccount/faxAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7467=['CmContact','Sequelize','ValidationError','createdAt','updatedAt','difference','keys','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','List','DESC','FaxApplication','Applications','get','account','applications','list','orderBy','priority','asc','length','Contacts','contact','FaxInteraction','create','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','name','unshift','agent','waitForTheAssignedAgent','queueId','FaxQueue','queue','waitForTheAssignedQueue','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','limit','map','include','model','stringify','NotifyFaxAccount','body','fax'];(function(_0xf5d377,_0x1a5780){var _0x24c5aa=function(_0x4b81ce){while(--_0x4b81ce){_0xf5d377['push'](_0xf5d377['shift']());}};_0x24c5aa(++_0x1a5780);}(_0x7467,0x16e));var _0x7746=function(_0x269719,_0x446d80){_0x269719=_0x269719-0x0;var _0x48946f=_0x7467[_0x269719];return _0x48946f;};'use strict';var _=require(_0x7746('0x0'));var util=require(_0x7746('0x1'));var moment=require(_0x7746('0x2'));var BPromise=require(_0x7746('0x3'));var rs=require(_0x7746('0x4'));var fs=require('fs');var Redis=require(_0x7746('0x5'));var db=require(_0x7746('0x6'))['db'];var utils=require(_0x7746('0x7'));var logger=require(_0x7746('0x8'))(_0x7746('0x9'));var config=require(_0x7746('0xa'));var jayson=require(_0x7746('0xb'));var client=jayson[_0x7746('0xc')][_0x7746('0xd')]({'port':0x232c});config[_0x7746('0xe')]=_[_0x7746('0xf')](config[_0x7746('0xe')],{'host':_0x7746('0x10'),'port':0x18eb});var socket=require(_0x7746('0x11'))(new Redis(config[_0x7746('0xe')]));require(_0x7746('0x12'))[_0x7746('0x13')](socket);function respondWithRpcPromise(_0x576220,_0x3e990b,_0x43314e){return new BPromise(function(_0x378dea,_0x1cdbc3){return client[_0x7746('0x14')](_0x576220,_0x43314e)[_0x7746('0x15')](function(_0x2cf6fc){logger[_0x7746('0x16')](_0x7746('0x17'),_0x3e990b,_0x7746('0x18'));logger[_0x7746('0x19')](_0x7746('0x1a'),_0x3e990b,_0x7746('0x18'),JSON['stringify'](_0x2cf6fc));if(_0x2cf6fc['error']){if(_0x2cf6fc['error'][_0x7746('0x1b')]===0x1f4){logger['error'](_0x7746('0x17'),_0x3e990b,_0x2cf6fc[_0x7746('0x1c')][_0x7746('0x1d')]);return _0x1cdbc3(_0x2cf6fc['error']['message']);}logger[_0x7746('0x1c')](_0x7746('0x17'),_0x3e990b,_0x2cf6fc['error'][_0x7746('0x1d')]);return _0x378dea(_0x2cf6fc['error'][_0x7746('0x1d')]);}else{logger['info'](_0x7746('0x17'),_0x3e990b,_0x7746('0x18'));_0x378dea(_0x2cf6fc[_0x7746('0x1e')][_0x7746('0x1d')]);}})[_0x7746('0x1f')](function(_0x1be917){logger[_0x7746('0x1c')]('FaxAccount,\x20%s,\x20%s',_0x3e990b,_0x1be917);_0x1cdbc3(_0x1be917);});});}exports[_0x7746('0x20')]=function(_0x405734){var _0x24e715=this;return new Promise(function(_0x4108b9,_0x21081d){return db[_0x7746('0x21')][_0x7746('0x22')]({'raw':_0x405734[_0x7746('0x23')]?_0x405734[_0x7746('0x23')][_0x7746('0x24')]===undefined?!![]:![]:!![],'where':_0x405734['options']?_0x405734['options']['where']||null:null,'attributes':_0x405734[_0x7746('0x23')]?_0x405734[_0x7746('0x23')][_0x7746('0x25')]||null:null,'limit':_0x405734['options']?_0x405734['options'][_0x7746('0x26')]||null:null,'include':_0x405734[_0x7746('0x23')]?_0x405734[_0x7746('0x23')]['include']?_['map'](_0x405734[_0x7746('0x23')]['include'],function(_0x40d874){return{'model':db[_0x40d874['model']],'as':_0x40d874['as'],'attributes':_0x40d874[_0x7746('0x25')],'include':_0x40d874['include']?_[_0x7746('0x27')](_0x40d874[_0x7746('0x28')],function(_0x4bbd02){return{'model':db[_0x4bbd02[_0x7746('0x29')]],'as':_0x4bbd02['as'],'attributes':_0x4bbd02[_0x7746('0x25')],'include':_0x4bbd02[_0x7746('0x28')]?_[_0x7746('0x27')](_0x4bbd02[_0x7746('0x28')],function(_0x28e45a){return{'model':db[_0x28e45a[_0x7746('0x29')]],'as':_0x28e45a['as'],'attributes':_0x28e45a[_0x7746('0x25')]};}):[]};}):[]};}):[]:[]})[_0x7746('0x15')](function(_0x452d8e){logger[_0x7746('0x16')](_0x7746('0x20'),_0x405734);logger['debug'](_0x7746('0x20'),_0x405734,JSON[_0x7746('0x2a')](_0x452d8e));_0x4108b9(_0x452d8e);})['catch'](function(_0x46dd0f){logger[_0x7746('0x1c')](_0x7746('0x20'),_0x46dd0f[_0x7746('0x1d')],_0x405734);_0x21081d(_0x24e715[_0x7746('0x1c')](0x1f4,_0x46dd0f['message']));});});};exports[_0x7746('0x2b')]=function(_0x1ae272,_0x53f662,_0x2115ee){var _0x2b68d8=this;return new Promise(function(_0x37a1ac,_0x24b6b){var _0x10684e={'body':_0x1ae272[_0x7746('0x2c')],'channel':_0x7746('0x2d')};var _0x59d1dd=[];var _0x276fa1=[];var _0x1ddeb8={};return db[_0x7746('0x2e')]['describe']()['then'](function(_0x18d482){if(!_0x18d482){throw new db[(_0x7746('0x2f'))][(_0x7746('0x30'))]('no\x20available\x20attributes');}_0x59d1dd=_['difference'](_['keys'](_0x18d482),[_0x7746('0x31'),_0x7746('0x32')]);_0x276fa1=_[_0x7746('0x33')](_[_0x7746('0x34')](_0x18d482),[_0x7746('0x31'),'updatedAt',_0x7746('0x35'),_0x7746('0x36')]);if(_0x1ae272[_0x7746('0x2c')]['id']){delete _0x1ae272[_0x7746('0x2c')]['id'];}if(_['isNil'](_0x1ae272[_0x7746('0x2c')][_0x7746('0x37')])){throw new db[(_0x7746('0x2f'))][(_0x7746('0x30'))](_0x7746('0x38'));}if(_[_0x7746('0x39')](_0x1ae272['body'][_0x7746('0x2c')])||_0x1ae272[_0x7746('0x2c')][_0x7746('0x2c')]===''){throw new db[(_0x7746('0x2f'))][(_0x7746('0x30'))](_0x7746('0x3a'));}if(_[_0x7746('0x39')](_0x1ae272[_0x7746('0x2c')][_0x7746('0x3b')])){throw new db['Sequelize'][(_0x7746('0x30'))](_0x7746('0x3c')+_0x276fa1);}if(!_[_0x7746('0x3d')](_0x276fa1,_0x1ae272['body'][_0x7746('0x3b')])){throw new db[(_0x7746('0x2f'))][(_0x7746('0x30'))](_0x7746('0x3e')+_0x276fa1);}_0x1ddeb8[_0x1ae272[_0x7746('0x2c')][_0x7746('0x3b')]]=_0x1ae272[_0x7746('0x2c')]['from'];})[_0x7746('0x15')](function(){return db[_0x7746('0x21')][_0x7746('0x3f')]({'where':{'id':_0x1ae272['account']['id']},'include':[{'model':db['CmList'],'as':_0x7746('0x40'),'include':[{'model':db[_0x7746('0x2e')],'as':'Contacts','where':_0x1ddeb8,'limit':0x1,'order':[[_0x7746('0x32'),_0x7746('0x41')]]}]},{'model':db[_0x7746('0x42')],'as':_0x7746('0x43')}]});})['then'](function(_0x294bf3){if(_0x294bf3&&_0x294bf3[_0x7746('0x40')]){var _0x36f459=_0x294bf3[_0x7746('0x44')]({'plain':!![]});_0x10684e[_0x7746('0x45')]=_0x36f459;_0x10684e[_0x7746('0x46')]=_0x36f459[_0x7746('0x43')];_0x10684e[_0x7746('0x47')]=_0x36f459[_0x7746('0x40')];_0x10684e[_0x7746('0x46')]=_[_0x7746('0x48')](_0x10684e['applications'],[_0x7746('0x49')],[_0x7746('0x4a')]);if(_0x10684e[_0x7746('0x45')]['Applications']){delete _0x10684e['account']['Applications'];}if(_0x10684e[_0x7746('0x45')][_0x7746('0x40')]&&_0x10684e['account'][_0x7746('0x40')]['Contacts'][_0x7746('0x4b')]){return _0x10684e[_0x7746('0x45')][_0x7746('0x40')][_0x7746('0x4c')][0x0];}var _0x3beeb2=_[_0x7746('0xf')](_0x1ae272[_0x7746('0x2c')],{'firstName':_0x1ae272[_0x7746('0x2c')][_0x7746('0x37')],'ListId':_0x36f459[_0x7746('0x36')]});_0x3beeb2[_0x1ae272[_0x7746('0x2c')][_0x7746('0x3b')]]=_0x1ae272['body'][_0x7746('0x37')];return db['CmContact']['create'](_0x3beeb2,{'fields':_0x59d1dd,'raw':!![]});}})[_0x7746('0x15')](function(_0x1ea785){_0x10684e[_0x7746('0x4d')]=_0x1ea785;if(_0x1ea785){var _0xca75b6={'ContactId':_0x1ea785['id'],'FaxAccountId':_0x1ae272[_0x7746('0x45')]['id'],'fax':_0x1ea785[_0x7746('0x2d')]};return db['FaxInteraction'][_0x7746('0x3f')]({'where':{'ContactId':_0x1ea785['id'],'closed':![],'FaxAccountId':_0x1ae272['account']['id']}})[_0x7746('0x15')](function(_0x4bdf53){if(_0x4bdf53){return[_0x4bdf53,![]];}return db[_0x7746('0x4e')][_0x7746('0x4f')](_0xca75b6)[_0x7746('0x15')](function(_0x339ba4){return[_0x339ba4,!![]];});});}else{throw new Error(_0x7746('0x50'));}})[_0x7746('0x51')](function(_0x254c5a,_0x575671){var _0x8e41b=_0x254c5a[_0x7746('0x44')]({'plain':!![]});if(_0x575671){if(_0x10684e['account'][_0x7746('0x52')]){_0x10684e[_0x7746('0x46')][_0x7746('0x53')]({'id':0x0,'priority':_0x10684e[_0x7746('0x46')][_0x7746('0x4b')]+0x1,'app':_0x7746('0x54'),'appdata':_0x7746('0x55'),'interval':_0x7746('0x56')});}_0x8e41b[_0x7746('0x57')]=!![];}else{_0x8e41b[_0x7746('0x57')]=![];}_0x10684e['interaction']=_0x8e41b;return db[_0x7746('0x58')]['create']({'body':_0x1ae272['body']['body'],'FaxAccountId':_0x1ae272[_0x7746('0x45')]['id'],'FaxInteractionId':_0x254c5a['id'],'direction':'in','ContactId':_0x254c5a[_0x7746('0x59')],'AttachmentId':_0x1ae272[_0x7746('0x2c')][_0x7746('0x5a')]});})[_0x7746('0x15')](function(_0x194446){_0x10684e[_0x7746('0x1d')]=_0x194446;if(!_0x10684e[_0x7746('0x5b')][_0x7746('0x5c')])return;return db['User'][_0x7746('0x3f')]({'attributes':['id',_0x7746('0x5d')],'where':{'id':_0x10684e[_0x7746('0x5b')][_0x7746('0x5c')]}});})['then'](function(_0x2f531f){if(_0x2f531f){_0x10684e[_0x7746('0x46')][_0x7746('0x5e')]({'id':0x0,'priority':0x0,'app':_0x7746('0x5f'),'appdata':_0x2f531f[_0x7746('0x5d')]+','+(_0x10684e[_0x7746('0x45')][_0x7746('0x60')]||0xa),'interval':_0x7746('0x56')});}if(!_0x10684e[_0x7746('0x5b')][_0x7746('0x61')])return;return db[_0x7746('0x62')][_0x7746('0x3f')]({'attributes':['id',_0x7746('0x5d')],'where':{'id':_0x10684e[_0x7746('0x5b')][_0x7746('0x61')]}});})[_0x7746('0x15')](function(_0x580b1c){if(_0x580b1c){_0x10684e[_0x7746('0x46')][_0x7746('0x5e')]({'id':0x0,'priority':0x1,'app':_0x7746('0x63'),'appdata':_0x580b1c['name']+','+(_0x10684e['account'][_0x7746('0x64')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x7746('0x65'),_0x7746('0x66'),_0x10684e);})[_0x7746('0x15')](function(_0x3c28fb){_0x37a1ac(_0x3c28fb);})['catch'](function(_0x2f9851){_0x24b6b(_0x2b68d8[_0x7746('0x1c')](0x1f4,_0x2f9851[_0x7746('0x1d')]));});});}; \ No newline at end of file +var _0xd8ae=['Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','FaxAccount','find','account','CmList','List','DESC','FaxApplication','applications','list','orderBy','asc','Applications','Contacts','defaults','create','contact','FaxInteraction','Contact\x20not\x20found','spread','push','length','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','unshift','waitForTheAssignedAgent','queueId','FaxQueue','queue','Start','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./faxAccount.socket','request','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','findAll','options','raw','attributes','limit','map','include','model','NotifyFaxAccount','body','fax','CmContact','then','ValidationError','no\x20available\x20attributes','keys','updatedAt','difference','createdAt','CompanyId','isNil'];(function(_0x2a0024,_0x42e869){var _0x1c4d43=function(_0x5f11b5){while(--_0x5f11b5){_0x2a0024['push'](_0x2a0024['shift']());}};_0x1c4d43(++_0x42e869);}(_0xd8ae,0x19b));var _0xed8a=function(_0x1356cf,_0x2d3f6e){_0x1356cf=_0x1356cf-0x0;var _0x4b9340=_0xd8ae[_0x1356cf];return _0x4b9340;};'use strict';var _=require(_0xed8a('0x0'));var util=require(_0xed8a('0x1'));var moment=require(_0xed8a('0x2'));var BPromise=require(_0xed8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed8a('0x4'));var db=require(_0xed8a('0x5'))['db'];var utils=require(_0xed8a('0x6'));var logger=require(_0xed8a('0x7'))(_0xed8a('0x8'));var config=require(_0xed8a('0x9'));var jayson=require(_0xed8a('0xa'));var client=jayson[_0xed8a('0xb')]['http']({'port':0x232c});config[_0xed8a('0xc')]=_['defaults'](config[_0xed8a('0xc')],{'host':_0xed8a('0xd'),'port':0x18eb});var socket=require(_0xed8a('0xe'))(new Redis(config[_0xed8a('0xc')]));require(_0xed8a('0xf'))['register'](socket);function respondWithRpcPromise(_0x223387,_0xf92fe7,_0x5b51b0){return new BPromise(function(_0x5f10df,_0x6c68ab){return client[_0xed8a('0x10')](_0x223387,_0x5b51b0)['then'](function(_0x3be4a8){logger[_0xed8a('0x11')]('FaxAccount,\x20%s,\x20%s',_0xf92fe7,_0xed8a('0x12'));logger[_0xed8a('0x13')](_0xed8a('0x14'),_0xf92fe7,_0xed8a('0x12'),JSON[_0xed8a('0x15')](_0x3be4a8));if(_0x3be4a8[_0xed8a('0x16')]){if(_0x3be4a8['error']['code']===0x1f4){logger[_0xed8a('0x16')](_0xed8a('0x17'),_0xf92fe7,_0x3be4a8[_0xed8a('0x16')][_0xed8a('0x18')]);return _0x6c68ab(_0x3be4a8[_0xed8a('0x16')][_0xed8a('0x18')]);}logger[_0xed8a('0x16')](_0xed8a('0x17'),_0xf92fe7,_0x3be4a8['error'][_0xed8a('0x18')]);return _0x5f10df(_0x3be4a8['error'][_0xed8a('0x18')]);}else{logger[_0xed8a('0x11')](_0xed8a('0x17'),_0xf92fe7,_0xed8a('0x12'));_0x5f10df(_0x3be4a8[_0xed8a('0x19')][_0xed8a('0x18')]);}})[_0xed8a('0x1a')](function(_0x4045b3){logger[_0xed8a('0x16')](_0xed8a('0x17'),_0xf92fe7,_0x4045b3);_0x6c68ab(_0x4045b3);});});}exports[_0xed8a('0x1b')]=function(_0x10a88e){var _0x5b12bd=this;return new Promise(function(_0x14fb6a,_0x2be2c8){return db['FaxAccount'][_0xed8a('0x1c')]({'raw':_0x10a88e[_0xed8a('0x1d')]?_0x10a88e[_0xed8a('0x1d')][_0xed8a('0x1e')]===undefined?!![]:![]:!![],'where':_0x10a88e['options']?_0x10a88e['options']['where']||null:null,'attributes':_0x10a88e[_0xed8a('0x1d')]?_0x10a88e[_0xed8a('0x1d')][_0xed8a('0x1f')]||null:null,'limit':_0x10a88e[_0xed8a('0x1d')]?_0x10a88e[_0xed8a('0x1d')][_0xed8a('0x20')]||null:null,'include':_0x10a88e[_0xed8a('0x1d')]?_0x10a88e[_0xed8a('0x1d')]['include']?_[_0xed8a('0x21')](_0x10a88e[_0xed8a('0x1d')]['include'],function(_0xfddef8){return{'model':db[_0xfddef8['model']],'as':_0xfddef8['as'],'attributes':_0xfddef8['attributes'],'include':_0xfddef8[_0xed8a('0x22')]?_[_0xed8a('0x21')](_0xfddef8[_0xed8a('0x22')],function(_0x1139a7){return{'model':db[_0x1139a7[_0xed8a('0x23')]],'as':_0x1139a7['as'],'attributes':_0x1139a7[_0xed8a('0x1f')],'include':_0x1139a7[_0xed8a('0x22')]?_['map'](_0x1139a7[_0xed8a('0x22')],function(_0x3e91db){return{'model':db[_0x3e91db[_0xed8a('0x23')]],'as':_0x3e91db['as'],'attributes':_0x3e91db[_0xed8a('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x417d97){logger[_0xed8a('0x11')](_0xed8a('0x1b'),_0x10a88e);logger[_0xed8a('0x13')](_0xed8a('0x1b'),_0x10a88e,JSON['stringify'](_0x417d97));_0x14fb6a(_0x417d97);})[_0xed8a('0x1a')](function(_0x3da44d){logger['error'](_0xed8a('0x1b'),_0x3da44d[_0xed8a('0x18')],_0x10a88e);_0x2be2c8(_0x5b12bd['error'](0x1f4,_0x3da44d['message']));});});};exports[_0xed8a('0x24')]=function(_0x551cd4,_0xe891ba,_0xa2edd9){var _0x23d32c=this;return new Promise(function(_0xb2cf51,_0x3a2dd9){var _0x52093c={'body':_0x551cd4[_0xed8a('0x25')],'channel':_0xed8a('0x26')};var _0x5e98f4=[];var _0xd38a16=[];var _0x23a6c6={};return db[_0xed8a('0x27')]['describe']()[_0xed8a('0x28')](function(_0x307991){if(!_0x307991){throw new db['Sequelize'][(_0xed8a('0x29'))](_0xed8a('0x2a'));}_0x5e98f4=_['difference'](_[_0xed8a('0x2b')](_0x307991),['createdAt',_0xed8a('0x2c')]);_0xd38a16=_[_0xed8a('0x2d')](_[_0xed8a('0x2b')](_0x307991),[_0xed8a('0x2e'),'updatedAt',_0xed8a('0x2f'),'ListId']);if(_0x551cd4['body']['id']){delete _0x551cd4[_0xed8a('0x25')]['id'];}if(_[_0xed8a('0x30')](_0x551cd4[_0xed8a('0x25')]['from'])){throw new db[(_0xed8a('0x31'))][(_0xed8a('0x29'))](_0xed8a('0x32'));}if(_['isNil'](_0x551cd4[_0xed8a('0x25')][_0xed8a('0x25')])||_0x551cd4[_0xed8a('0x25')][_0xed8a('0x25')]===''){throw new db[(_0xed8a('0x31'))][(_0xed8a('0x29'))](_0xed8a('0x33'));}if(_[_0xed8a('0x30')](_0x551cd4[_0xed8a('0x25')][_0xed8a('0x34')])){throw new db[(_0xed8a('0x31'))][(_0xed8a('0x29'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xd38a16);}if(!_[_0xed8a('0x35')](_0xd38a16,_0x551cd4['body'][_0xed8a('0x34')])){throw new db[(_0xed8a('0x31'))][(_0xed8a('0x29'))](_0xed8a('0x36')+_0xd38a16);}_0x23a6c6[_0x551cd4[_0xed8a('0x25')]['mapKey']]=_0x551cd4[_0xed8a('0x25')][_0xed8a('0x37')];})[_0xed8a('0x28')](function(){return db[_0xed8a('0x38')][_0xed8a('0x39')]({'where':{'id':_0x551cd4[_0xed8a('0x3a')]['id']},'include':[{'model':db[_0xed8a('0x3b')],'as':_0xed8a('0x3c'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x23a6c6,'limit':0x1,'order':[[_0xed8a('0x2c'),_0xed8a('0x3d')]]}]},{'model':db[_0xed8a('0x3e')],'as':'Applications'}]});})[_0xed8a('0x28')](function(_0x5437ab){if(_0x5437ab&&_0x5437ab['List']){var _0x3311df=_0x5437ab['get']({'plain':!![]});_0x52093c[_0xed8a('0x3a')]=_0x3311df;_0x52093c[_0xed8a('0x3f')]=_0x3311df['Applications'];_0x52093c[_0xed8a('0x40')]=_0x3311df['List'];_0x52093c[_0xed8a('0x3f')]=_[_0xed8a('0x41')](_0x52093c[_0xed8a('0x3f')],['priority'],[_0xed8a('0x42')]);if(_0x52093c['account'][_0xed8a('0x43')]){delete _0x52093c[_0xed8a('0x3a')]['Applications'];}if(_0x52093c[_0xed8a('0x3a')][_0xed8a('0x3c')]&&_0x52093c[_0xed8a('0x3a')]['List']['Contacts']['length']){return _0x52093c[_0xed8a('0x3a')][_0xed8a('0x3c')][_0xed8a('0x44')][0x0];}var _0x15b170=_[_0xed8a('0x45')](_0x551cd4[_0xed8a('0x25')],{'firstName':_0x551cd4[_0xed8a('0x25')]['from'],'ListId':_0x3311df['ListId']});_0x15b170[_0x551cd4[_0xed8a('0x25')][_0xed8a('0x34')]]=_0x551cd4[_0xed8a('0x25')][_0xed8a('0x37')];return db[_0xed8a('0x27')][_0xed8a('0x46')](_0x15b170,{'fields':_0x5e98f4,'raw':!![]});}})['then'](function(_0x2e50e4){_0x52093c[_0xed8a('0x47')]=_0x2e50e4;if(_0x2e50e4){var _0x1f4949={'ContactId':_0x2e50e4['id'],'FaxAccountId':_0x551cd4[_0xed8a('0x3a')]['id'],'fax':_0x2e50e4[_0xed8a('0x26')]};return db[_0xed8a('0x48')][_0xed8a('0x39')]({'where':{'ContactId':_0x2e50e4['id'],'closed':![],'FaxAccountId':_0x551cd4[_0xed8a('0x3a')]['id']}})[_0xed8a('0x28')](function(_0x40609c){if(_0x40609c){return[_0x40609c,![]];}return db[_0xed8a('0x48')][_0xed8a('0x46')](_0x1f4949)[_0xed8a('0x28')](function(_0x4834f3){return[_0x4834f3,!![]];});});}else{throw new Error(_0xed8a('0x49'));}})[_0xed8a('0x4a')](function(_0x4700e6,_0x40af6b){var _0x3d9ea4=_0x4700e6['get']({'plain':!![]});if(_0x40af6b){if(_0x52093c[_0xed8a('0x3a')]['autoclose']){_0x52093c[_0xed8a('0x3f')][_0xed8a('0x4b')]({'id':0x0,'priority':_0x52093c[_0xed8a('0x3f')][_0xed8a('0x4c')]+0x1,'app':'close','appdata':_0xed8a('0x4d'),'interval':_0xed8a('0x4e')});}_0x3d9ea4[_0xed8a('0x4f')]=!![];}else{_0x3d9ea4[_0xed8a('0x4f')]=![];}_0x52093c[_0xed8a('0x50')]=_0x3d9ea4;return db[_0xed8a('0x51')][_0xed8a('0x46')]({'body':_0x551cd4[_0xed8a('0x25')][_0xed8a('0x25')],'FaxAccountId':_0x551cd4[_0xed8a('0x3a')]['id'],'FaxInteractionId':_0x4700e6['id'],'direction':'in','ContactId':_0x4700e6[_0xed8a('0x52')],'AttachmentId':_0x551cd4[_0xed8a('0x25')][_0xed8a('0x53')]});})[_0xed8a('0x28')](function(_0x3d1a20){_0x52093c[_0xed8a('0x18')]=_0x3d1a20;if(!_0x52093c['interaction'][_0xed8a('0x54')])return;return db['User']['find']({'attributes':['id',_0xed8a('0x55')],'where':{'id':_0x52093c[_0xed8a('0x50')]['UserId']}});})[_0xed8a('0x28')](function(_0x2ec451){if(_0x2ec451){_0x52093c[_0xed8a('0x3f')][_0xed8a('0x56')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2ec451[_0xed8a('0x55')]+','+(_0x52093c[_0xed8a('0x3a')][_0xed8a('0x57')]||0xa),'interval':'*,*,*,*'});}if(!_0x52093c[_0xed8a('0x50')][_0xed8a('0x58')])return;return db[_0xed8a('0x59')]['find']({'attributes':['id',_0xed8a('0x55')],'where':{'id':_0x52093c[_0xed8a('0x50')]['queueId']}});})[_0xed8a('0x28')](function(_0x2189c1){if(_0x2189c1){_0x52093c[_0xed8a('0x3f')][_0xed8a('0x56')]({'id':0x0,'priority':0x1,'app':_0xed8a('0x5a'),'appdata':_0x2189c1['name']+','+(_0x52093c[_0xed8a('0x3a')]['waitForTheAssignedQueue']||0x12c),'interval':_0xed8a('0x4e')});}return respondWithRpcPromise(_0xed8a('0x5b'),'startRouting',_0x52093c);})[_0xed8a('0x28')](function(_0x1cc85a){_0xb2cf51(_0x1cc85a);})[_0xed8a('0x1a')](function(_0x3f8468){_0x3a2dd9(_0x23d32c[_0xed8a('0x16')](0x1f4,_0x3f8468[_0xed8a('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 3b7449d..9085152 100644 --- a/server/api/faxAccount/faxAccount.socket.js +++ b/server/api/faxAccount/faxAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc408=['length','faxAccount:','./faxAccount.events','save','emit','removeListener','register'];(function(_0xa223ad,_0x5a574b){var _0x306d47=function(_0x4b19ab){while(--_0x4b19ab){_0xa223ad['push'](_0xa223ad['shift']());}};_0x306d47(++_0x5a574b);}(_0xc408,0x87));var _0x8c40=function(_0x56f097,_0x2e4a11){_0x56f097=_0x56f097-0x0;var _0x104bfe=_0xc408[_0x56f097];return _0x104bfe;};'use strict';var FaxAccountEvents=require(_0x8c40('0x0'));var events=[_0x8c40('0x1'),'remove','update'];function createListener(_0x16a05a,_0x2aad54){return function(_0x152722){_0x2aad54[_0x8c40('0x2')](_0x16a05a,_0x152722);};}function removeListener(_0x1a59c5,_0x215960){return function(){FaxAccountEvents[_0x8c40('0x3')](_0x1a59c5,_0x215960);};}exports[_0x8c40('0x4')]=function(_0x31db32){for(var _0xef1110=0x0,_0x4c974=events[_0x8c40('0x5')];_0xef1110<_0x4c974;_0xef1110++){var _0x15e2b4=events[_0xef1110];var _0x1944c1=createListener(_0x8c40('0x6')+_0x15e2b4,_0x31db32);FaxAccountEvents['on'](_0x15e2b4,_0x1944c1);}}; \ No newline at end of file +var _0x84c6=['remove','update','emit','register','length','faxAccount:','save'];(function(_0x96a05,_0x1f4b8c){var _0x253e31=function(_0xca8d69){while(--_0xca8d69){_0x96a05['push'](_0x96a05['shift']());}};_0x253e31(++_0x1f4b8c);}(_0x84c6,0x14f));var _0x684c=function(_0xe1d179,_0x705e21){_0xe1d179=_0xe1d179-0x0;var _0x1a5abb=_0x84c6[_0xe1d179];return _0x1a5abb;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x684c('0x0'),_0x684c('0x1'),_0x684c('0x2')];function createListener(_0x3353ec,_0x36eba7){return function(_0x56a45c){_0x36eba7[_0x684c('0x3')](_0x3353ec,_0x56a45c);};}function removeListener(_0x251c31,_0x4fdda9){return function(){FaxAccountEvents['removeListener'](_0x251c31,_0x4fdda9);};}exports[_0x684c('0x4')]=function(_0xa10907){for(var _0x4a6370=0x0,_0x44de69=events[_0x684c('0x5')];_0x4a6370<_0x44de69;_0x4a6370++){var _0x2d0cd7=events[_0x4a6370];var _0x149eef=createListener(_0x684c('0x6')+_0x2d0cd7,_0xa10907);FaxAccountEvents['on'](_0x2d0cd7,_0x149eef);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 9958977..55be8e9 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8c3=['/:id/applications','getMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','put','update','delete','destroy','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions'];(function(_0x396f22,_0x4d87a8){var _0x7aeaa6=function(_0x430844){while(--_0x430844){_0x396f22['push'](_0x396f22['shift']());}};_0x7aeaa6(++_0x4d87a8);}(_0xa8c3,0x1ad));var _0x3a8c=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xa8c3[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require(_0x3a8c('0x0'));var util=require(_0x3a8c('0x1'));var path=require(_0x3a8c('0x2'));var timeout=require(_0x3a8c('0x3'));var express=require(_0x3a8c('0x4'));var router=express[_0x3a8c('0x5')]();var fs_extra=require(_0x3a8c('0x6'));var auth=require(_0x3a8c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3a8c('0x8'));var controller=require(_0x3a8c('0x9'));router[_0x3a8c('0xa')]('/',auth[_0x3a8c('0xb')](),controller[_0x3a8c('0xc')]);router[_0x3a8c('0xa')]('/describe',auth[_0x3a8c('0xb')](),controller[_0x3a8c('0xd')]);router[_0x3a8c('0xa')](_0x3a8c('0xe'),auth[_0x3a8c('0xb')](),controller[_0x3a8c('0xf')]);router[_0x3a8c('0xa')]('/:id/dispositions',auth[_0x3a8c('0xb')](),controller[_0x3a8c('0x10')]);router['get'](_0x3a8c('0x11'),auth['isAuthenticated'](),controller[_0x3a8c('0x12')]);router['get'](_0x3a8c('0x13'),auth['isAuthenticated'](),controller[_0x3a8c('0x14')]);router[_0x3a8c('0xa')](_0x3a8c('0x15'),auth[_0x3a8c('0xb')](),controller['getApplications']);router[_0x3a8c('0xa')]('/:id/messages',auth[_0x3a8c('0xb')](),controller[_0x3a8c('0x16')]);router[_0x3a8c('0xa')](_0x3a8c('0x17'),auth['isAuthenticated'](),controller[_0x3a8c('0x18')]);router[_0x3a8c('0x19')]('/',auth[_0x3a8c('0xb')](),controller[_0x3a8c('0x1a')]);router[_0x3a8c('0x19')]('/:id/dispositions',auth[_0x3a8c('0xb')](),controller[_0x3a8c('0x1b')]);router[_0x3a8c('0x19')](_0x3a8c('0x11'),auth['isAuthenticated'](),controller[_0x3a8c('0x1c')]);router[_0x3a8c('0x19')](_0x3a8c('0x13'),auth[_0x3a8c('0xb')](),controller[_0x3a8c('0x1d')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x3a8c('0x1e')]);router[_0x3a8c('0x19')](_0x3a8c('0x1f'),auth[_0x3a8c('0xb')](),controller['addAccountApplications']);router[_0x3a8c('0x19')](_0x3a8c('0x20'),auth[_0x3a8c('0xb')](),controller[_0x3a8c('0x21')]);router[_0x3a8c('0x19')](_0x3a8c('0x22'),auth[_0x3a8c('0xb')](),controller[_0x3a8c('0x23')]);router[_0x3a8c('0x19')]('/:id/users',auth[_0x3a8c('0xb')](),controller['addAgents']);router[_0x3a8c('0x24')](_0x3a8c('0xe'),auth['isAuthenticated'](),controller[_0x3a8c('0x25')]);router[_0x3a8c('0x26')]('/:id',auth[_0x3a8c('0xb')](),controller[_0x3a8c('0x27')]);router['delete'](_0x3a8c('0x28'),auth[_0x3a8c('0xb')](),controller[_0x3a8c('0x29')]);router[_0x3a8c('0x26')]('/:id/canned_answers',auth[_0x3a8c('0xb')](),controller[_0x3a8c('0x2a')]);router[_0x3a8c('0x26')](_0x3a8c('0x17'),auth['isAuthenticated'](),controller[_0x3a8c('0x2b')]);module[_0x3a8c('0x2c')]=router; \ No newline at end of file +var _0xbe49=['/:id/canned_answers','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','getAgents','post','create','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','/:id/send','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe49,0xa4));var _0x9be4=function(_0x2cee1b,_0x2bc0a9){_0x2cee1b=_0x2cee1b-0x0;var _0x19c8a2=_0xbe49[_0x2cee1b];return _0x19c8a2;};'use strict';var multer=require(_0x9be4('0x0'));var util=require(_0x9be4('0x1'));var path=require(_0x9be4('0x2'));var timeout=require(_0x9be4('0x3'));var express=require(_0x9be4('0x4'));var router=express[_0x9be4('0x5')]();var fs_extra=require(_0x9be4('0x6'));var auth=require(_0x9be4('0x7'));var interaction=require(_0x9be4('0x8'));var config=require(_0x9be4('0x9'));var controller=require(_0x9be4('0xa'));router[_0x9be4('0xb')]('/',auth[_0x9be4('0xc')](),controller[_0x9be4('0xd')]);router['get'](_0x9be4('0xe'),auth[_0x9be4('0xc')](),controller[_0x9be4('0xf')]);router[_0x9be4('0xb')](_0x9be4('0x10'),auth['isAuthenticated'](),controller[_0x9be4('0x11')]);router['get'](_0x9be4('0x12'),auth[_0x9be4('0xc')](),controller[_0x9be4('0x13')]);router[_0x9be4('0xb')](_0x9be4('0x14'),auth[_0x9be4('0xc')](),controller['getAnswers']);router[_0x9be4('0xb')](_0x9be4('0x15'),auth[_0x9be4('0xc')](),controller[_0x9be4('0x16')]);router[_0x9be4('0xb')](_0x9be4('0x17'),auth['isAuthenticated'](),controller[_0x9be4('0x18')]);router['get']('/:id/messages',auth[_0x9be4('0xc')](),controller[_0x9be4('0x19')]);router[_0x9be4('0xb')]('/:id/users',auth[_0x9be4('0xc')](),controller[_0x9be4('0x1a')]);router[_0x9be4('0x1b')]('/',auth['isAuthenticated'](),controller[_0x9be4('0x1c')]);router[_0x9be4('0x1b')]('/:id/dispositions',auth[_0x9be4('0xc')](),controller[_0x9be4('0x1d')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x9be4('0x1e')]);router['post'](_0x9be4('0x15'),auth['isAuthenticated'](),controller[_0x9be4('0x1f')]);router['post'](_0x9be4('0x17'),auth[_0x9be4('0xc')](),controller[_0x9be4('0x20')]);router[_0x9be4('0x1b')](_0x9be4('0x21'),auth[_0x9be4('0xc')](),controller[_0x9be4('0x22')]);router[_0x9be4('0x1b')](_0x9be4('0x23'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x9be4('0x1b')](_0x9be4('0x24'),auth[_0x9be4('0xc')](),controller['send']);router[_0x9be4('0x1b')]('/:id/users',auth[_0x9be4('0xc')](),controller[_0x9be4('0x25')]);router[_0x9be4('0x26')](_0x9be4('0x10'),auth[_0x9be4('0xc')](),controller[_0x9be4('0x27')]);router[_0x9be4('0x28')](_0x9be4('0x10'),auth[_0x9be4('0xc')](),controller[_0x9be4('0x29')]);router['delete'](_0x9be4('0x12'),auth[_0x9be4('0xc')](),controller[_0x9be4('0x2a')]);router[_0x9be4('0x28')]('/:id/canned_answers',auth[_0x9be4('0xc')](),controller[_0x9be4('0x2b')]);router[_0x9be4('0x28')]('/:id/users',auth[_0x9be4('0xc')](),controller[_0x9be4('0x2c')]);module[_0x9be4('0x2d')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 4c06a9f..02e06e4 100644 --- a/server/api/faxApplication/faxApplication.attributes.js +++ b/server/api/faxApplication/faxApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e66=['INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x9e66,0xcd));var _0x69e6=function(_0xcd3e6d,_0x466d93){_0xcd3e6d=_0xcd3e6d-0x0;var _0x786f01=_0x9e66[_0xcd3e6d];return _0x786f01;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x69e6('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x69e6('0x1')],'allowNull':![],'defaultValue':_0x69e6('0x2')},'appdata':{'type':Sequelize[_0x69e6('0x3')]()},'description':{'type':Sequelize[_0x69e6('0x1')]},'interval':{'type':Sequelize[_0x69e6('0x1')],'defaultValue':_0x69e6('0x4')}}; \ No newline at end of file +var _0xdfb3=['exports','STRING'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xdfb3,0xe2));var _0x3dfb=function(_0x5ed3b1,_0x3e59b2){_0x5ed3b1=_0x5ed3b1-0x0;var _0x3cc545=_0xdfb3[_0x5ed3b1];return _0x3cc545;};'use strict';var Sequelize=require('sequelize');module[_0x3dfb('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3dfb('0x1')]},'interval':{'type':Sequelize[_0x3dfb('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index aa9db56..36e36f1 100644 --- a/server/api/faxApplication/faxApplication.controller.js +++ b/server/api/faxApplication/faxApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64fc=['sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','create','body','find','destroy','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','lodash','squel','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','undefined','count','offset','limit','set','Content-Range','reject','update','then','sendStatus','error','name','send','index','map','FaxApplication','key','model','intersection','query','attributes','fields','length'];(function(_0x29bd71,_0x25921a){var _0x3c316b=function(_0x56fa83){while(--_0x56fa83){_0x29bd71['push'](_0x29bd71['shift']());}};_0x3c316b(++_0x25921a);}(_0x64fc,0x129));var _0xc64f=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x64fc[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc64f('0x0'));var jsonpatch=require(_0xc64f('0x1'));var rp=require(_0xc64f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc64f('0x3'));var util=require(_0xc64f('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xc64f('0x5'));var ejs=require(_0xc64f('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc64f('0x7'));var squel=require(_0xc64f('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc64f('0x9'));var toCsv=require(_0xc64f('0x5'));var querystring=require(_0xc64f('0xa'));var Papa=require(_0xc64f('0xb'));var Redis=require(_0xc64f('0xc'));var authService=require(_0xc64f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xc64f('0xe'));var hardwareService=require(_0xc64f('0xf'));var logger=require(_0xc64f('0x10'))(_0xc64f('0x11'));var utils=require(_0xc64f('0x12'));var config=require(_0xc64f('0x13'));var licenseUtil=require(_0xc64f('0x14'));var db=require(_0xc64f('0x15'))['db'];function respondWithStatusCode(_0x3a335f,_0x400446){_0x400446=_0x400446||0xcc;return function(_0xa7c600){if(_0xa7c600){return _0x3a335f['sendStatus'](_0x400446);}return _0x3a335f[_0xc64f('0x16')](_0x400446)[_0xc64f('0x17')]();};}function respondWithResult(_0x2248d7,_0x5c16c7){_0x5c16c7=_0x5c16c7||0xc8;return function(_0x35ebe2){if(_0x35ebe2){return _0x2248d7[_0xc64f('0x16')](_0x5c16c7)[_0xc64f('0x18')](_0x35ebe2);}};}function respondWithFilteredResult(_0x2eddb8,_0x18f9d8){return function(_0x345361){if(_0x345361){var _0x943a16=typeof _0x18f9d8['offset']==='undefined'&&typeof _0x18f9d8['limit']===_0xc64f('0x19');var _0x494bf4=_0x345361[_0xc64f('0x1a')];var _0x1fb562=_0x943a16?0x0:_0x18f9d8['offset'];var _0x1ac2ca=_0x943a16?_0x345361[_0xc64f('0x1a')]:_0x18f9d8[_0xc64f('0x1b')]+_0x18f9d8[_0xc64f('0x1c')];var _0x4dd3c2;if(_0x1ac2ca>=_0x494bf4){_0x1ac2ca=_0x494bf4;_0x4dd3c2=0xc8;}else{_0x4dd3c2=0xce;}_0x2eddb8[_0xc64f('0x16')](_0x4dd3c2);return _0x2eddb8[_0xc64f('0x1d')](_0xc64f('0x1e'),_0x1fb562+'-'+_0x1ac2ca+'/'+_0x494bf4)['json'](_0x345361);}return null;};}function patchUpdates(_0x2a13c0){return function(_0x3d668d){try{jsonpatch['apply'](_0x3d668d,_0x2a13c0,!![]);}catch(_0xb383e5){return BPromise[_0xc64f('0x1f')](_0xb383e5);}return _0x3d668d['save']();};}function saveUpdates(_0x4d7160,_0x18f868){return function(_0x40f64b){if(_0x40f64b){return _0x40f64b[_0xc64f('0x20')](_0x4d7160)[_0xc64f('0x21')](function(_0x2ea4eb){return _0x2ea4eb;});}return null;};}function removeEntity(_0x5d391f,_0x2d64d1){return function(_0x14fb38){if(_0x14fb38){return _0x14fb38['destroy']()[_0xc64f('0x21')](function(){_0x5d391f[_0xc64f('0x16')](0xcc)[_0xc64f('0x17')]();});}};}function handleEntityNotFound(_0x3c919a,_0x6b42d7){return function(_0x3a9495){if(!_0x3a9495){_0x3c919a[_0xc64f('0x22')](0x194);}return _0x3a9495;};}function handleError(_0x406ce0,_0x1b386b){_0x1b386b=_0x1b386b||0x1f4;return function(_0x37f8d7){logger[_0xc64f('0x23')](_0x37f8d7['stack']);if(_0x37f8d7[_0xc64f('0x24')]){delete _0x37f8d7[_0xc64f('0x24')];}_0x406ce0[_0xc64f('0x16')](_0x1b386b)[_0xc64f('0x25')](_0x37f8d7);};}exports[_0xc64f('0x26')]=function(_0x5ada75,_0xb4cdb2){var _0x3c880f={},_0x41cb02={},_0x3868e6={'count':0x0,'rows':[]};var _0x923676=_[_0xc64f('0x27')](db[_0xc64f('0x28')]['rawAttributes'],function(_0x2f6923){return{'name':_0x2f6923['fieldName'],'type':_0x2f6923['type'][_0xc64f('0x29')]};});_0x41cb02[_0xc64f('0x2a')]=_[_0xc64f('0x27')](_0x923676,'name');_0x41cb02['query']=_['keys'](_0x5ada75['query']);_0x41cb02['filters']=_[_0xc64f('0x2b')](_0x41cb02[_0xc64f('0x2a')],_0x41cb02[_0xc64f('0x2c')]);_0x3c880f[_0xc64f('0x2d')]=_[_0xc64f('0x2b')](_0x41cb02['model'],qs[_0xc64f('0x2e')](_0x5ada75[_0xc64f('0x2c')][_0xc64f('0x2e')]));_0x3c880f[_0xc64f('0x2d')]=_0x3c880f[_0xc64f('0x2d')][_0xc64f('0x2f')]?_0x3c880f[_0xc64f('0x2d')]:_0x41cb02[_0xc64f('0x2a')];if(!_0x5ada75['query']['hasOwnProperty']('nolimit')){_0x3c880f['limit']=qs[_0xc64f('0x1c')](_0x5ada75[_0xc64f('0x2c')][_0xc64f('0x1c')]);_0x3c880f['offset']=qs[_0xc64f('0x1b')](_0x5ada75[_0xc64f('0x2c')]['offset']);}_0x3c880f['order']=qs[_0xc64f('0x30')](_0x5ada75[_0xc64f('0x2c')][_0xc64f('0x30')]);_0x3c880f[_0xc64f('0x31')]=qs[_0xc64f('0x32')](_[_0xc64f('0x33')](_0x5ada75[_0xc64f('0x2c')],_0x41cb02['filters']),_0x923676);if(_0x5ada75[_0xc64f('0x2c')][_0xc64f('0x34')]){_0x3c880f[_0xc64f('0x31')]=_[_0xc64f('0x35')](_0x3c880f[_0xc64f('0x31')],{'$or':_[_0xc64f('0x27')](_0x923676,function(_0x193ca5){if(_0x193ca5[_0xc64f('0x36')]!==_0xc64f('0x37')){var _0x1433b4={};_0x1433b4[_0x193ca5['name']]={'$like':'%'+_0x5ada75[_0xc64f('0x2c')][_0xc64f('0x34')]+'%'};return _0x1433b4;}})});}_0x3c880f=_['merge']({},_0x3c880f,_0x5ada75[_0xc64f('0x38')]);var _0x5c5452={'where':_0x3c880f['where']};return db[_0xc64f('0x28')][_0xc64f('0x1a')](_0x5c5452)[_0xc64f('0x21')](function(_0x5e4b1d){_0x3868e6['count']=_0x5e4b1d;if(_0x5ada75[_0xc64f('0x2c')][_0xc64f('0x39')]){_0x3c880f[_0xc64f('0x3a')]=[{'all':!![]}];}return db[_0xc64f('0x28')][_0xc64f('0x3b')](_0x3c880f);})['then'](function(_0x39c456){_0x3868e6['rows']=_0x39c456;return _0x3868e6;})['then'](respondWithFilteredResult(_0xb4cdb2,_0x3c880f))[_0xc64f('0x3c')](handleError(_0xb4cdb2,null));};exports[_0xc64f('0x3d')]=function(_0x15aa69,_0xcf3a69){var _0x590c61={'raw':!![],'where':{'id':_0x15aa69[_0xc64f('0x3e')]['id']}},_0x5de8f8={};_0x5de8f8[_0xc64f('0x2a')]=_[_0xc64f('0x3f')](db[_0xc64f('0x28')][_0xc64f('0x40')]);_0x5de8f8[_0xc64f('0x2c')]=_[_0xc64f('0x3f')](_0x15aa69['query']);_0x5de8f8[_0xc64f('0x32')]=_[_0xc64f('0x2b')](_0x5de8f8[_0xc64f('0x2a')],_0x5de8f8[_0xc64f('0x2c')]);_0x590c61[_0xc64f('0x2d')]=_[_0xc64f('0x2b')](_0x5de8f8[_0xc64f('0x2a')],qs[_0xc64f('0x2e')](_0x15aa69['query'][_0xc64f('0x2e')]));_0x590c61['attributes']=_0x590c61['attributes'][_0xc64f('0x2f')]?_0x590c61['attributes']:_0x5de8f8[_0xc64f('0x2a')];if(_0x15aa69[_0xc64f('0x2c')][_0xc64f('0x39')]){_0x590c61[_0xc64f('0x3a')]=[{'all':!![]}];}_0x590c61=_[_0xc64f('0x35')]({},_0x590c61,_0x15aa69[_0xc64f('0x38')]);return db[_0xc64f('0x28')]['find'](_0x590c61)[_0xc64f('0x21')](handleEntityNotFound(_0xcf3a69,null))['then'](respondWithResult(_0xcf3a69,null))[_0xc64f('0x3c')](handleError(_0xcf3a69,null));};exports[_0xc64f('0x41')]=function(_0x50f728,_0x2edf68){return db[_0xc64f('0x28')][_0xc64f('0x41')](_0x50f728[_0xc64f('0x42')],{})[_0xc64f('0x21')](respondWithResult(_0x2edf68,0xc9))[_0xc64f('0x3c')](handleError(_0x2edf68,null));};exports[_0xc64f('0x20')]=function(_0x27ea7b,_0x50ac54){if(_0x27ea7b[_0xc64f('0x42')]['id']){delete _0x27ea7b[_0xc64f('0x42')]['id'];}return db['FaxApplication'][_0xc64f('0x43')]({'where':{'id':_0x27ea7b[_0xc64f('0x3e')]['id']}})[_0xc64f('0x21')](handleEntityNotFound(_0x50ac54,null))[_0xc64f('0x21')](saveUpdates(_0x27ea7b[_0xc64f('0x42')],null))[_0xc64f('0x21')](respondWithResult(_0x50ac54,null))['catch'](handleError(_0x50ac54,null));};exports[_0xc64f('0x44')]=function(_0x5e7160,_0x34ec78){return db[_0xc64f('0x28')][_0xc64f('0x43')]({'where':{'id':_0x5e7160[_0xc64f('0x3e')]['id']}})[_0xc64f('0x21')](handleEntityNotFound(_0x34ec78,null))[_0xc64f('0x21')](removeEntity(_0x34ec78,null))['catch'](handleError(_0x34ec78,null));}; \ No newline at end of file +var _0x4518=['create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','name','index','FaxApplication','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','length','find'];(function(_0x3ddc08,_0x394e4a){var _0x3984a3=function(_0x1094d2){while(--_0x1094d2){_0x3ddc08['push'](_0x3ddc08['shift']());}};_0x3984a3(++_0x394e4a);}(_0x4518,0x1c4));var _0x8451=function(_0x46ec32,_0x1e842f){_0x46ec32=_0x46ec32-0x0;var _0x338f60=_0x4518[_0x46ec32];return _0x338f60;};'use strict';var emlformat=require(_0x8451('0x0'));var rimraf=require(_0x8451('0x1'));var zipdir=require(_0x8451('0x2'));var jsonpatch=require(_0x8451('0x3'));var rp=require(_0x8451('0x4'));var moment=require(_0x8451('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8451('0x6'));var util=require(_0x8451('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8451('0x8'));var ejs=require(_0x8451('0x9'));var fs=require('fs');var fs_extra=require(_0x8451('0xa'));var _=require(_0x8451('0xb'));var squel=require(_0x8451('0xc'));var crypto=require(_0x8451('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8451('0xe'));var toCsv=require(_0x8451('0x8'));var querystring=require(_0x8451('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8451('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8451('0x11'));var logger=require(_0x8451('0x12'))(_0x8451('0x13'));var utils=require(_0x8451('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8451('0x15'));var db=require(_0x8451('0x16'))['db'];function respondWithStatusCode(_0x1a25cc,_0x393153){_0x393153=_0x393153||0xcc;return function(_0x27c60a){if(_0x27c60a){return _0x1a25cc[_0x8451('0x17')](_0x393153);}return _0x1a25cc[_0x8451('0x18')](_0x393153)['end']();};}function respondWithResult(_0x505043,_0x5df614){_0x5df614=_0x5df614||0xc8;return function(_0x2decfa){if(_0x2decfa){return _0x505043[_0x8451('0x18')](_0x5df614)['json'](_0x2decfa);}};}function respondWithFilteredResult(_0x5a4499,_0x3de4e8){return function(_0x6b4b44){if(_0x6b4b44){var _0x3eccce=typeof _0x3de4e8['offset']===_0x8451('0x19')&&typeof _0x3de4e8[_0x8451('0x1a')]==='undefined';var _0x4b6607=_0x6b4b44[_0x8451('0x1b')];var _0x3b3fa2=_0x3eccce?0x0:_0x3de4e8[_0x8451('0x1c')];var _0xb2b252=_0x3eccce?_0x6b4b44['count']:_0x3de4e8[_0x8451('0x1c')]+_0x3de4e8[_0x8451('0x1a')];var _0x45bc26;if(_0xb2b252>=_0x4b6607){_0xb2b252=_0x4b6607;_0x45bc26=0xc8;}else{_0x45bc26=0xce;}_0x5a4499[_0x8451('0x18')](_0x45bc26);return _0x5a4499[_0x8451('0x1d')](_0x8451('0x1e'),_0x3b3fa2+'-'+_0xb2b252+'/'+_0x4b6607)[_0x8451('0x1f')](_0x6b4b44);}return null;};}function patchUpdates(_0x28d97d){return function(_0x336065){try{jsonpatch[_0x8451('0x20')](_0x336065,_0x28d97d,!![]);}catch(_0x44f7cd){return BPromise[_0x8451('0x21')](_0x44f7cd);}return _0x336065[_0x8451('0x22')]();};}function saveUpdates(_0x22d98e,_0x17cd7a){return function(_0x22d915){if(_0x22d915){return _0x22d915[_0x8451('0x23')](_0x22d98e)['then'](function(_0x1eef8c){return _0x1eef8c;});}return null;};}function removeEntity(_0x1fb1ed,_0x1b83fa){return function(_0x24547b){if(_0x24547b){return _0x24547b[_0x8451('0x24')]()[_0x8451('0x25')](function(){_0x1fb1ed[_0x8451('0x18')](0xcc)[_0x8451('0x26')]();});}};}function handleEntityNotFound(_0x5a5d20,_0x954e93){return function(_0x4e0670){if(!_0x4e0670){_0x5a5d20[_0x8451('0x17')](0x194);}return _0x4e0670;};}function handleError(_0x9cc75a,_0x15cec2){_0x15cec2=_0x15cec2||0x1f4;return function(_0x3e46e4){logger[_0x8451('0x27')](_0x3e46e4['stack']);if(_0x3e46e4[_0x8451('0x28')]){delete _0x3e46e4[_0x8451('0x28')];}_0x9cc75a[_0x8451('0x18')](_0x15cec2)['send'](_0x3e46e4);};}exports[_0x8451('0x29')]=function(_0x472854,_0x2f2b54){var _0x6a0980={},_0x243d6c={},_0x56ae4b={'count':0x0,'rows':[]};var _0x511e0e=_['map'](db[_0x8451('0x2a')][_0x8451('0x2b')],function(_0x16035a){return{'name':_0x16035a[_0x8451('0x2c')],'type':_0x16035a[_0x8451('0x2d')][_0x8451('0x2e')]};});_0x243d6c['model']=_[_0x8451('0x2f')](_0x511e0e,_0x8451('0x28'));_0x243d6c[_0x8451('0x30')]=_[_0x8451('0x31')](_0x472854[_0x8451('0x30')]);_0x243d6c['filters']=_[_0x8451('0x32')](_0x243d6c[_0x8451('0x33')],_0x243d6c['query']);_0x6a0980[_0x8451('0x34')]=_[_0x8451('0x32')](_0x243d6c[_0x8451('0x33')],qs[_0x8451('0x35')](_0x472854[_0x8451('0x30')][_0x8451('0x35')]));_0x6a0980[_0x8451('0x34')]=_0x6a0980['attributes']['length']?_0x6a0980[_0x8451('0x34')]:_0x243d6c['model'];if(!_0x472854[_0x8451('0x30')][_0x8451('0x36')](_0x8451('0x37'))){_0x6a0980['limit']=qs[_0x8451('0x1a')](_0x472854[_0x8451('0x30')][_0x8451('0x1a')]);_0x6a0980[_0x8451('0x1c')]=qs['offset'](_0x472854['query']['offset']);}_0x6a0980[_0x8451('0x38')]=qs[_0x8451('0x39')](_0x472854[_0x8451('0x30')][_0x8451('0x39')]);_0x6a0980[_0x8451('0x3a')]=qs[_0x8451('0x3b')](_[_0x8451('0x3c')](_0x472854[_0x8451('0x30')],_0x243d6c[_0x8451('0x3b')]),_0x511e0e);if(_0x472854[_0x8451('0x30')][_0x8451('0x3d')]){_0x6a0980[_0x8451('0x3a')]=_['merge'](_0x6a0980[_0x8451('0x3a')],{'$or':_[_0x8451('0x2f')](_0x511e0e,function(_0x3e72a4){if(_0x3e72a4[_0x8451('0x2d')]!==_0x8451('0x3e')){var _0x361f16={};_0x361f16[_0x3e72a4[_0x8451('0x28')]]={'$like':'%'+_0x472854[_0x8451('0x30')]['filter']+'%'};return _0x361f16;}})});}_0x6a0980=_[_0x8451('0x3f')]({},_0x6a0980,_0x472854[_0x8451('0x40')]);var _0x16a353={'where':_0x6a0980[_0x8451('0x3a')]};return db[_0x8451('0x2a')][_0x8451('0x1b')](_0x16a353)['then'](function(_0x1f7d5f){_0x56ae4b[_0x8451('0x1b')]=_0x1f7d5f;if(_0x472854['query'][_0x8451('0x41')]){_0x6a0980[_0x8451('0x42')]=[{'all':!![]}];}return db[_0x8451('0x2a')][_0x8451('0x43')](_0x6a0980);})[_0x8451('0x25')](function(_0x276acf){_0x56ae4b[_0x8451('0x44')]=_0x276acf;return _0x56ae4b;})[_0x8451('0x25')](respondWithFilteredResult(_0x2f2b54,_0x6a0980))[_0x8451('0x45')](handleError(_0x2f2b54,null));};exports['show']=function(_0x315722,_0x54bb24){var _0x157924={'raw':!![],'where':{'id':_0x315722[_0x8451('0x46')]['id']}},_0xe8367b={};_0xe8367b[_0x8451('0x33')]=_['keys'](db['FaxApplication'][_0x8451('0x2b')]);_0xe8367b[_0x8451('0x30')]=_[_0x8451('0x31')](_0x315722['query']);_0xe8367b[_0x8451('0x3b')]=_[_0x8451('0x32')](_0xe8367b[_0x8451('0x33')],_0xe8367b[_0x8451('0x30')]);_0x157924[_0x8451('0x34')]=_[_0x8451('0x32')](_0xe8367b[_0x8451('0x33')],qs[_0x8451('0x35')](_0x315722[_0x8451('0x30')][_0x8451('0x35')]));_0x157924[_0x8451('0x34')]=_0x157924['attributes'][_0x8451('0x47')]?_0x157924[_0x8451('0x34')]:_0xe8367b[_0x8451('0x33')];if(_0x315722[_0x8451('0x30')][_0x8451('0x41')]){_0x157924[_0x8451('0x42')]=[{'all':!![]}];}_0x157924=_[_0x8451('0x3f')]({},_0x157924,_0x315722[_0x8451('0x40')]);return db[_0x8451('0x2a')][_0x8451('0x48')](_0x157924)[_0x8451('0x25')](handleEntityNotFound(_0x54bb24,null))['then'](respondWithResult(_0x54bb24,null))[_0x8451('0x45')](handleError(_0x54bb24,null));};exports[_0x8451('0x49')]=function(_0x4f606d,_0x2a6006){return db[_0x8451('0x2a')][_0x8451('0x49')](_0x4f606d[_0x8451('0x4a')],{})[_0x8451('0x25')](respondWithResult(_0x2a6006,0xc9))['catch'](handleError(_0x2a6006,null));};exports['update']=function(_0x1cccfa,_0x4851db){if(_0x1cccfa['body']['id']){delete _0x1cccfa[_0x8451('0x4a')]['id'];}return db[_0x8451('0x2a')][_0x8451('0x48')]({'where':{'id':_0x1cccfa['params']['id']}})[_0x8451('0x25')](handleEntityNotFound(_0x4851db,null))[_0x8451('0x25')](saveUpdates(_0x1cccfa['body'],null))[_0x8451('0x25')](respondWithResult(_0x4851db,null))[_0x8451('0x45')](handleError(_0x4851db,null));};exports['destroy']=function(_0x2a11b0,_0x20a955){return db[_0x8451('0x2a')][_0x8451('0x48')]({'where':{'id':_0x2a11b0['params']['id']}})['then'](handleEntityNotFound(_0x20a955,null))['then'](removeEntity(_0x20a955,null))[_0x8451('0x45')](handleError(_0x20a955,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 9494175..19bad67 100644 --- a/server/api/faxApplication/faxApplication.model.js +++ b/server/api/faxApplication/faxApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf2c=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','FaxApplication','fax_applications','utf8mb4'];(function(_0x51c6df,_0xdf895a){var _0x47efb7=function(_0x19ccfd){while(--_0x19ccfd){_0x51c6df['push'](_0x51c6df['shift']());}};_0x47efb7(++_0xdf895a);}(_0xaf2c,0x69));var _0xcaf2=function(_0x271a7e,_0x59e9df){_0x271a7e=_0x271a7e-0x0;var _0x3f1eaa=_0xaf2c[_0x271a7e];return _0x3f1eaa;};'use strict';var _=require(_0xcaf2('0x0'));var util=require('util');var logger=require(_0xcaf2('0x1'))(_0xcaf2('0x2'));var moment=require(_0xcaf2('0x3'));var BPromise=require(_0xcaf2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcaf2('0x5'));var config=require(_0xcaf2('0x6'));var attributes=require('./faxApplication.attributes');module[_0xcaf2('0x7')]=function(_0x3ccec0,_0x53a130){return _0x3ccec0[_0xcaf2('0x8')](_0xcaf2('0x9'),attributes,{'tableName':_0xcaf2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcaf2('0xb'),'collate':_0xcaf2('0xc')});}; \ No newline at end of file +var _0xf541=['request-promise','path','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x393c99,_0x166f01){var _0x2f35fe=function(_0x62ab32){while(--_0x62ab32){_0x393c99['push'](_0x393c99['shift']());}};_0x2f35fe(++_0x166f01);}(_0xf541,0x78));var _0x1f54=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0xf541[_0x5216e0];return _0x5b3f40;};'use strict';var _=require(_0x1f54('0x0'));var util=require(_0x1f54('0x1'));var logger=require(_0x1f54('0x2'))(_0x1f54('0x3'));var moment=require(_0x1f54('0x4'));var BPromise=require(_0x1f54('0x5'));var rp=require(_0x1f54('0x6'));var fs=require('fs');var path=require(_0x1f54('0x7'));var rimraf=require('rimraf');var config=require(_0x1f54('0x8'));var attributes=require(_0x1f54('0x9'));module[_0x1f54('0xa')]=function(_0x32fe95,_0x1756ab){return _0x32fe95[_0x1f54('0xb')]('FaxApplication',attributes,{'tableName':_0x1f54('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1f54('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index cb77762..f879b23 100644 --- a/server/api/faxApplication/faxApplication.rpc.js +++ b/server/api/faxApplication/faxApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d40=['jayson/promise','client','http','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','UpdateFaxApplication','body','raw','options','where','attributes','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x3d40,0x10d));var _0x03d4=function(_0x300ddd,_0xf3c704){_0x300ddd=_0x300ddd-0x0;var _0x1b9a61=_0x3d40[_0x300ddd];return _0x1b9a61;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x03d4('0x0'));var fs=require('fs');var Redis=require(_0x03d4('0x1'));var db=require(_0x03d4('0x2'))['db'];var utils=require(_0x03d4('0x3'));var logger=require(_0x03d4('0x4'))(_0x03d4('0x5'));var config=require('../../config/environment');var jayson=require(_0x03d4('0x6'));var client=jayson[_0x03d4('0x7')][_0x03d4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59b88c,_0x47675d,_0x33c9f3){return new BPromise(function(_0x22a9ee,_0x134ba2){return client['request'](_0x59b88c,_0x33c9f3)[_0x03d4('0x9')](function(_0x48951e){logger['info'](_0x03d4('0xa'),_0x47675d,_0x03d4('0xb'));logger[_0x03d4('0xc')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x47675d,_0x03d4('0xb'),JSON[_0x03d4('0xd')](_0x48951e));if(_0x48951e[_0x03d4('0xe')]){if(_0x48951e[_0x03d4('0xe')]['code']===0x1f4){logger[_0x03d4('0xe')](_0x03d4('0xa'),_0x47675d,_0x48951e[_0x03d4('0xe')]['message']);return _0x134ba2(_0x48951e[_0x03d4('0xe')][_0x03d4('0xf')]);}logger[_0x03d4('0xe')](_0x03d4('0xa'),_0x47675d,_0x48951e[_0x03d4('0xe')][_0x03d4('0xf')]);return _0x22a9ee(_0x48951e[_0x03d4('0xe')][_0x03d4('0xf')]);}else{logger[_0x03d4('0x10')](_0x03d4('0xa'),_0x47675d,_0x03d4('0xb'));_0x22a9ee(_0x48951e[_0x03d4('0x11')]['message']);}})[_0x03d4('0x12')](function(_0x543280){logger['error'](_0x03d4('0xa'),_0x47675d,_0x543280);_0x134ba2(_0x543280);});});}exports[_0x03d4('0x13')]=function(_0x3bf411){var _0x472a5a=this;return new Promise(function(_0x5780f6,_0x35fd53){return db['FaxApplication']['update'](_0x3bf411[_0x03d4('0x14')],{'raw':_0x3bf411['options']?_0x3bf411['options'][_0x03d4('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bf411[_0x03d4('0x16')]?_0x3bf411[_0x03d4('0x16')][_0x03d4('0x17')]||null:null,'attributes':_0x3bf411[_0x03d4('0x16')]?_0x3bf411['options'][_0x03d4('0x18')]||null:null,'limit':_0x3bf411['options']?_0x3bf411['options']['limit']||null:null})[_0x03d4('0x9')](function(_0x4693a2){logger[_0x03d4('0x10')]('UpdateFaxApplication',_0x3bf411);logger[_0x03d4('0xc')](_0x03d4('0x13'),_0x3bf411,JSON[_0x03d4('0xd')](_0x4693a2));_0x5780f6(_0x4693a2);})['catch'](function(_0x34007d){logger['error'](_0x03d4('0x13'),_0x34007d[_0x03d4('0xf')],_0x3bf411);_0x35fd53(_0x472a5a[_0x03d4('0xe')](0x1f4,_0x34007d[_0x03d4('0xf')]));});});}; \ No newline at end of file +var _0xd4a5=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','result','catch','UpdateFaxApplication','FaxApplication','options','raw','where','attributes','limit','util','moment'];(function(_0x2f0eaf,_0x162021){var _0x108d21=function(_0x407ff6){while(--_0x407ff6){_0x2f0eaf['push'](_0x2f0eaf['shift']());}};_0x108d21(++_0x162021);}(_0xd4a5,0x166));var _0x5d4a=function(_0x4fc0a3,_0x297edf){_0x4fc0a3=_0x4fc0a3-0x0;var _0x12ea75=_0xd4a5[_0x4fc0a3];return _0x12ea75;};'use strict';var _=require('lodash');var util=require(_0x5d4a('0x0'));var moment=require(_0x5d4a('0x1'));var BPromise=require(_0x5d4a('0x2'));var rs=require(_0x5d4a('0x3'));var fs=require('fs');var Redis=require(_0x5d4a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d4a('0x5'));var logger=require(_0x5d4a('0x6'))(_0x5d4a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5d4a('0x8')][_0x5d4a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59f13c,_0x2a288b,_0x25bf8e){return new BPromise(function(_0x36c216,_0x9c6ac5){return client[_0x5d4a('0xa')](_0x59f13c,_0x25bf8e)[_0x5d4a('0xb')](function(_0x559d07){logger[_0x5d4a('0xc')]('FaxApplication,\x20%s,\x20%s',_0x2a288b,_0x5d4a('0xd'));logger[_0x5d4a('0xe')](_0x5d4a('0xf'),_0x2a288b,_0x5d4a('0xd'),JSON[_0x5d4a('0x10')](_0x559d07));if(_0x559d07[_0x5d4a('0x11')]){if(_0x559d07[_0x5d4a('0x11')][_0x5d4a('0x12')]===0x1f4){logger[_0x5d4a('0x11')](_0x5d4a('0x13'),_0x2a288b,_0x559d07['error'][_0x5d4a('0x14')]);return _0x9c6ac5(_0x559d07[_0x5d4a('0x11')]['message']);}logger[_0x5d4a('0x11')](_0x5d4a('0x13'),_0x2a288b,_0x559d07[_0x5d4a('0x11')][_0x5d4a('0x14')]);return _0x36c216(_0x559d07[_0x5d4a('0x11')][_0x5d4a('0x14')]);}else{logger[_0x5d4a('0xc')](_0x5d4a('0x13'),_0x2a288b,_0x5d4a('0xd'));_0x36c216(_0x559d07[_0x5d4a('0x15')][_0x5d4a('0x14')]);}})[_0x5d4a('0x16')](function(_0x125d48){logger[_0x5d4a('0x11')]('FaxApplication,\x20%s,\x20%s',_0x2a288b,_0x125d48);_0x9c6ac5(_0x125d48);});});}exports[_0x5d4a('0x17')]=function(_0x540a17){var _0x27eceb=this;return new Promise(function(_0x54a72e,_0x54c7f8){return db[_0x5d4a('0x18')]['update'](_0x540a17['body'],{'raw':_0x540a17[_0x5d4a('0x19')]?_0x540a17[_0x5d4a('0x19')][_0x5d4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x540a17['options']?_0x540a17[_0x5d4a('0x19')][_0x5d4a('0x1b')]||null:null,'attributes':_0x540a17[_0x5d4a('0x19')]?_0x540a17[_0x5d4a('0x19')][_0x5d4a('0x1c')]||null:null,'limit':_0x540a17['options']?_0x540a17[_0x5d4a('0x19')][_0x5d4a('0x1d')]||null:null})[_0x5d4a('0xb')](function(_0xb7053e){logger[_0x5d4a('0xc')](_0x5d4a('0x17'),_0x540a17);logger[_0x5d4a('0xe')](_0x5d4a('0x17'),_0x540a17,JSON[_0x5d4a('0x10')](_0xb7053e));_0x54a72e(_0xb7053e);})[_0x5d4a('0x16')](function(_0x2229d8){logger['error']('UpdateFaxApplication',_0x2229d8[_0x5d4a('0x14')],_0x540a17);_0x54c7f8(_0x27eceb[_0x5d4a('0x11')](0x1f4,_0x2229d8[_0x5d4a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 9a329f4..52a16c6 100644 --- a/server/api/faxApplication/index.js +++ b/server/api/faxApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cf8=['show','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated'];(function(_0x127c7b,_0x1f65e7){var _0x1708eb=function(_0x2033e5){while(--_0x2033e5){_0x127c7b['push'](_0x127c7b['shift']());}};_0x1708eb(++_0x1f65e7);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x514bd1,_0x25ea3e){_0x514bd1=_0x514bd1-0x0;var _0x58a281=_0x4cf8[_0x514bd1];return _0x58a281;};'use strict';var multer=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var path=require(_0x84cf('0x2'));var timeout=require(_0x84cf('0x3'));var express=require(_0x84cf('0x4'));var router=express[_0x84cf('0x5')]();var fs_extra=require(_0x84cf('0x6'));var auth=require(_0x84cf('0x7'));var interaction=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var controller=require(_0x84cf('0xa'));router[_0x84cf('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x84cf('0xb')]('/:id',auth[_0x84cf('0xc')](),controller[_0x84cf('0xd')]);router['post']('/',auth[_0x84cf('0xc')](),controller[_0x84cf('0xe')]);router['put'](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x10')]);router[_0x84cf('0x11')]('/:id',auth[_0x84cf('0xc')](),controller[_0x84cf('0x12')]);module['exports']=router; \ No newline at end of file +var _0x1775=['../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5cb83e,_0x3ed092){var _0x531b33=function(_0x443aa5){while(--_0x443aa5){_0x5cb83e['push'](_0x5cb83e['shift']());}};_0x531b33(++_0x3ed092);}(_0x1775,0x1db));var _0x5177=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1775[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0x5177('0x0'));var path=require(_0x5177('0x1'));var timeout=require(_0x5177('0x2'));var express=require(_0x5177('0x3'));var router=express[_0x5177('0x4')]();var fs_extra=require(_0x5177('0x5'));var auth=require(_0x5177('0x6'));var interaction=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var controller=require(_0x5177('0x9'));router[_0x5177('0xa')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0xc')]);router[_0x5177('0xa')](_0x5177('0xd'),auth[_0x5177('0xb')](),controller[_0x5177('0xe')]);router[_0x5177('0xf')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0x10')]);router[_0x5177('0x11')](_0x5177('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x5177('0x12')](_0x5177('0xd'),auth[_0x5177('0xb')](),controller[_0x5177('0x13')]);module[_0x5177('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 5167feb..a08da85 100644 --- a/server/api/faxInteraction/faxInteraction.attributes.js +++ b/server/api/faxInteraction/faxInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32b6=['ENUM','out','INTEGER','sequelize','exports','DATE','STRING'];(function(_0x321575,_0x458292){var _0x147fc3=function(_0x55d3a6){while(--_0x55d3a6){_0x321575['push'](_0x321575['shift']());}};_0x147fc3(++_0x458292);}(_0x32b6,0x1d1));var _0x632b=function(_0x30c109,_0x10c856){_0x30c109=_0x30c109-0x0;var _0x5dd8d0=_0x32b6[_0x30c109];return _0x5dd8d0;};'use strict';var Sequelize=require(_0x632b('0x0'));module[_0x632b('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x632b('0x2')]},'disposition':{'type':Sequelize[_0x632b('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x632b('0x3')]},'read1stAt':{'type':Sequelize[_0x632b('0x2')]},'fax':{'type':Sequelize[_0x632b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x632b('0x4')]('in',_0x632b('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x632b('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x632b('0x4')]('in',_0x632b('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x632b('0x6')]}}; \ No newline at end of file +var _0x1623=['INTEGER','sequelize','DATE','STRING','ENUM'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x1623,0xab));var _0x3162=function(_0x10ab7b,_0x59b410){_0x10ab7b=_0x10ab7b-0x0;var _0x277cab=_0x1623[_0x10ab7b];return _0x277cab;};'use strict';var Sequelize=require(_0x3162('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3162('0x1')]},'disposition':{'type':Sequelize[_0x3162('0x2')]},'secondDisposition':{'type':Sequelize[_0x3162('0x2')]},'thirdDisposition':{'type':Sequelize[_0x3162('0x2')]},'note':{'type':Sequelize[_0x3162('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x3162('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3162('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x3162('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x3162('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index b60938a..6af2f85 100644 --- a/server/api/faxInteraction/faxInteraction.controller.js +++ b/server/api/faxInteraction/faxInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x73ed=['nolimit','order','sort','where','FaxInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','spread','Tag','color','removeTags','download','unix','join','root','tmp','attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','pipe','createWriteStream','err','unlinkSync','zip-dir','bluebird','util','path','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./faxInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','then','error','stack','name','index','map','FaxInteraction','type','key','findAll','query','user','catch','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','include','merge','options','create','body','update','find','destroy','FaxMessage','ids','omit','getMessages','findOne','hasOwnProperty'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0x73ed,0x19d));var _0xd73e=function(_0x4d5ae7,_0xba6ca7){_0x4d5ae7=_0x4d5ae7-0x0;var _0x3bdbb1=_0x73ed[_0x4d5ae7];return _0x3bdbb1;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xd73e('0x0'));var moment=require('moment');var BPromise=require(_0xd73e('0x1'));var util=require(_0xd73e('0x2'));var path=require(_0xd73e('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xd73e('0x4'));var interaction=require(_0xd73e('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0xd73e('0x6'))(_0xd73e('0x7'));var config=require(_0xd73e('0x8'));var db=require(_0xd73e('0x9'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xd73e('0xa'),'port':0x18eb});var socket=require(_0xd73e('0xb'))(new Redis(config[_0xd73e('0xc')]));require(_0xd73e('0xd'))[_0xd73e('0xe')](socket);function respondWithStatusCode(_0x2b95f5,_0x45248c){_0x45248c=_0x45248c||0xcc;return function(_0x1dc451){if(_0x1dc451){return _0x2b95f5[_0xd73e('0xf')](_0x45248c);}return _0x2b95f5['status'](_0x45248c)[_0xd73e('0x10')]();};}function respondWithResult(_0xed1404,_0x4e3e01){_0x4e3e01=_0x4e3e01||0xc8;return function(_0x418594){if(_0x418594){return _0xed1404[_0xd73e('0x11')](_0x4e3e01)[_0xd73e('0x12')](_0x418594);}};}function respondWithFilteredResult(_0x1863db,_0x4a7bb0){return function(_0x484e64){if(_0x484e64){var _0x5d40d7=typeof _0x4a7bb0[_0xd73e('0x13')]===_0xd73e('0x14')&&typeof _0x4a7bb0[_0xd73e('0x15')]==='undefined';var _0x27b1f6=_0x484e64[_0xd73e('0x16')];var _0x5a4fdd=_0x5d40d7?0x0:_0x4a7bb0[_0xd73e('0x13')];var _0x559a20=_0x5d40d7?_0x484e64[_0xd73e('0x16')]:_0x4a7bb0[_0xd73e('0x13')]+_0x4a7bb0[_0xd73e('0x15')];var _0x311fd0;if(_0x559a20>=_0x27b1f6){_0x559a20=_0x27b1f6;_0x311fd0=0xc8;}else{_0x311fd0=0xce;}_0x1863db[_0xd73e('0x11')](_0x311fd0);return _0x1863db[_0xd73e('0x17')](_0xd73e('0x18'),_0x5a4fdd+'-'+_0x559a20+'/'+_0x27b1f6)[_0xd73e('0x12')](_0x484e64);}return null;};}function saveUpdates(_0x26012d){return function(_0x15a9ef){if(_0x15a9ef){return _0x15a9ef['update'](_0x26012d)[_0xd73e('0x19')](function(_0x47e750){return _0x47e750;});}return null;};}function removeEntity(_0x10eef2){return function(_0x4bd895){if(_0x4bd895){return _0x4bd895['destroy']()[_0xd73e('0x19')](function(){_0x10eef2[_0xd73e('0x11')](0xcc)[_0xd73e('0x10')]();});}};}function handleEntityNotFound(_0x523765){return function(_0x38f004){if(!_0x38f004){_0x523765[_0xd73e('0xf')](0x194);}return _0x38f004;};}function handleError(_0xbf5cf5,_0x79b1d5){_0x79b1d5=_0x79b1d5||0x1f4;return function(_0x5a9281){logger[_0xd73e('0x1a')](_0x5a9281[_0xd73e('0x1b')]);if(_0x5a9281['name']){delete _0x5a9281[_0xd73e('0x1c')];}_0xbf5cf5[_0xd73e('0x11')](_0x79b1d5)['send'](_0x5a9281);};}exports[_0xd73e('0x1d')]=function(_0x3c2743,_0x4538b0){var _0x3f9aac={};var _0x2aad0d=_[_0xd73e('0x1e')](db[_0xd73e('0x1f')]['rawAttributes'],function(_0x54e2d5){return{'name':_0x54e2d5['fieldName'],'type':_0x54e2d5[_0xd73e('0x20')][_0xd73e('0x21')]};});_0x3f9aac=qs['getOptions'](_0x2aad0d,_0x3c2743);return interaction[_0xd73e('0x22')]('fax',_0x3c2743[_0xd73e('0x23')],_0x3c2743[_0xd73e('0x24')],_0x3f9aac,_0x2aad0d)[_0xd73e('0x19')](respondWithFilteredResult(_0x4538b0,_0x3f9aac))[_0xd73e('0x25')](handleError(_0x4538b0,null));};exports[_0xd73e('0x26')]=function(_0x27c42f,_0x1d92ad){var _0x1ea777={'raw':![],'where':{'id':_0x27c42f[_0xd73e('0x27')]['id']}},_0x2af974={};_0x2af974[_0xd73e('0x28')]=_[_0xd73e('0x29')](db[_0xd73e('0x1f')][_0xd73e('0x2a')]);_0x2af974[_0xd73e('0x23')]=_[_0xd73e('0x29')](_0x27c42f[_0xd73e('0x23')]);_0x2af974[_0xd73e('0x2b')]=_[_0xd73e('0x2c')](_0x2af974[_0xd73e('0x28')],_0x2af974[_0xd73e('0x23')]);_0x1ea777[_0xd73e('0x2d')]=_['intersection'](_0x2af974[_0xd73e('0x28')],qs[_0xd73e('0x2e')](_0x27c42f[_0xd73e('0x23')][_0xd73e('0x2e')]));_0x1ea777[_0xd73e('0x2d')]=_0x1ea777[_0xd73e('0x2d')][_0xd73e('0x2f')]?_0x1ea777[_0xd73e('0x2d')]:_0x2af974[_0xd73e('0x28')];if(_0x27c42f['query']['includeAll']){_0x1ea777[_0xd73e('0x30')]=[{'all':!![]}];}_0x1ea777=_[_0xd73e('0x31')]({},_0x1ea777,_0x27c42f[_0xd73e('0x32')]);return db[_0xd73e('0x1f')]['find'](_0x1ea777)[_0xd73e('0x19')](handleEntityNotFound(_0x1d92ad,null))[_0xd73e('0x19')](respondWithResult(_0x1d92ad,null))[_0xd73e('0x25')](handleError(_0x1d92ad,null));};exports[_0xd73e('0x33')]=function(_0x3f6d1d,_0x1e9c4f){return db[_0xd73e('0x1f')][_0xd73e('0x33')](_0x3f6d1d[_0xd73e('0x34')],{})[_0xd73e('0x19')](respondWithResult(_0x1e9c4f,0xc9))[_0xd73e('0x25')](handleError(_0x1e9c4f,null));};exports[_0xd73e('0x35')]=function(_0xba7636,_0x15ef7e){if(_0xba7636[_0xd73e('0x34')]['id']){delete _0xba7636[_0xd73e('0x34')]['id'];}return db[_0xd73e('0x1f')][_0xd73e('0x36')]({'where':{'id':_0xba7636[_0xd73e('0x27')]['id']}})[_0xd73e('0x19')](handleEntityNotFound(_0x15ef7e,null))[_0xd73e('0x19')](saveUpdates(_0xba7636[_0xd73e('0x34')],null))['then'](respondWithResult(_0x15ef7e,null))[_0xd73e('0x25')](handleError(_0x15ef7e,null));};exports[_0xd73e('0x37')]=function(_0x28e719,_0x4a7403){return db[_0xd73e('0x1f')]['find']({'where':{'id':_0x28e719[_0xd73e('0x27')]['id']}})['then'](handleEntityNotFound(_0x4a7403,null))['then'](removeEntity(_0x4a7403,null))[_0xd73e('0x25')](handleError(_0x4a7403,null));};exports['describe']=function(_0x2bb574,_0x29ab07){return db[_0xd73e('0x1f')]['describe']()[_0xd73e('0x19')](respondWithResult(_0x29ab07,null))['catch'](handleError(_0x29ab07,null));};exports['addMessage']=function(_0x1eaaed,_0x4172bd){return db[_0xd73e('0x38')][_0xd73e('0x36')]({'where':{'id':_0x1eaaed[_0xd73e('0x27')]['id']}})[_0xd73e('0x19')](handleEntityNotFound(_0x4172bd,null))[_0xd73e('0x19')](function(_0x95548f){if(_0x95548f){return _0x95548f['addMessage'](_0x1eaaed[_0xd73e('0x34')][_0xd73e('0x39')],_[_0xd73e('0x3a')](_0x1eaaed[_0xd73e('0x34')],[_0xd73e('0x39'),'id'])||{});}})['then'](respondWithResult(_0x4172bd,null))[_0xd73e('0x25')](handleError(_0x4172bd,null));};exports[_0xd73e('0x3b')]=function(_0x2cfd6f,_0x559d58){var _0x2deed8={'raw':![],'where':{}};var _0x43a4e4={};var _0x2694ea={'count':0x0,'rows':[]};return db[_0xd73e('0x1f')][_0xd73e('0x3c')]({'where':{'id':_0x2cfd6f[_0xd73e('0x27')]['id']}})[_0xd73e('0x19')](handleEntityNotFound(_0x559d58,null))[_0xd73e('0x19')](function(_0x41c876){if(_0x41c876){_0x43a4e4[_0xd73e('0x28')]=_['keys'](db[_0xd73e('0x38')]['rawAttributes']);_0x43a4e4['query']=_[_0xd73e('0x29')](_0x2cfd6f['query']);_0x43a4e4[_0xd73e('0x2b')]=_[_0xd73e('0x2c')](_0x43a4e4[_0xd73e('0x28')],_0x43a4e4['query']);_0x2deed8[_0xd73e('0x2d')]=_[_0xd73e('0x2c')](_0x43a4e4['model'],qs['fields'](_0x2cfd6f[_0xd73e('0x23')][_0xd73e('0x2e')]));_0x2deed8[_0xd73e('0x2d')]=_0x2deed8['attributes'][_0xd73e('0x2f')]?_0x2deed8[_0xd73e('0x2d')]:_0x43a4e4['model'];if(!_0x2cfd6f['query'][_0xd73e('0x3d')](_0xd73e('0x3e'))){_0x2deed8[_0xd73e('0x15')]=qs[_0xd73e('0x15')](_0x2cfd6f[_0xd73e('0x23')][_0xd73e('0x15')]);_0x2deed8['offset']=qs['offset'](_0x2cfd6f['query'][_0xd73e('0x13')]);}_0x2deed8[_0xd73e('0x3f')]=qs[_0xd73e('0x40')](_0x2cfd6f['query'][_0xd73e('0x40')]);_0x2deed8[_0xd73e('0x41')]=qs[_0xd73e('0x2b')](_['pick'](_0x2cfd6f[_0xd73e('0x23')],_0x43a4e4[_0xd73e('0x2b')]));_0x2deed8[_0xd73e('0x41')][_0xd73e('0x42')]=_0x41c876['id'];if(_0x2cfd6f[_0xd73e('0x23')]['filter']){_0x2deed8[_0xd73e('0x41')]=_[_0xd73e('0x31')](_0x2deed8[_0xd73e('0x41')],{'$or':_[_0xd73e('0x1e')](_0x2deed8[_0xd73e('0x2d')],function(_0xc21c8a){var _0x3bd269={};_0x3bd269[_0xc21c8a]={'$like':'%'+_0x2cfd6f[_0xd73e('0x23')]['filter']+'%'};return _0x3bd269;})});}if(_0x2cfd6f[_0xd73e('0x23')][_0xd73e('0x43')]){var _0x151ffe=_0x2cfd6f[_0xd73e('0x23')][_0xd73e('0x43')][_0xd73e('0x44')](',');var _0x2c6d31={};_0x2c6d31[_0x151ffe[0x0]]={'$gte':moment(_0x151ffe[0x1])['format'](_0xd73e('0x45'))};_0x2deed8[_0xd73e('0x41')]=_[_0xd73e('0x31')](_0x2deed8[_0xd73e('0x41')],_0x2c6d31);}_0x2deed8=_[_0xd73e('0x31')]({},_0x2deed8,_0x2cfd6f[_0xd73e('0x32')]);return db[_0xd73e('0x38')][_0xd73e('0x16')]({'where':_0x2deed8[_0xd73e('0x41')]})[_0xd73e('0x19')](function(_0x49622b){_0x2694ea[_0xd73e('0x16')]=_0x49622b;if(_0x2cfd6f['query']['includeAll']){_0x2deed8[_0xd73e('0x30')]=[{'all':!![]}];}return db['FaxMessage'][_0xd73e('0x22')](_0x2deed8);})[_0xd73e('0x19')](function(_0x34123f){_0x2694ea[_0xd73e('0x46')]=_0x34123f;return _0x2694ea;});}})[_0xd73e('0x19')](respondWithFilteredResult(_0x559d58,_0x2deed8))[_0xd73e('0x25')](handleError(_0x559d58,null));};exports['addTags']=function(_0x39f474,_0x937fa5){return db[_0xd73e('0x1f')][_0xd73e('0x36')]({'where':{'id':_0x39f474[_0xd73e('0x27')]['id']}})[_0xd73e('0x19')](handleEntityNotFound(_0x937fa5,null))[_0xd73e('0x19')](function(_0x418fb9){if(_0x418fb9){return _0x418fb9['setTags'](_0x39f474[_0xd73e('0x34')][_0xd73e('0x39')],_[_0xd73e('0x3a')](_0x39f474[_0xd73e('0x34')],[_0xd73e('0x39'),'id'])||{})[_0xd73e('0x47')](function(){return db[_0xd73e('0x48')][_0xd73e('0x22')]({'attributes':['id',_0xd73e('0x1c'),_0xd73e('0x49')],'where':{'id':_0x39f474[_0xd73e('0x34')][_0xd73e('0x39')]}});})[_0xd73e('0x19')](function(_0x5cba98){socket['emit']('faxInteractionTags:save',{'id':Number(_0x39f474['params']['id']),'tags':_0x5cba98||[]});return{'id':Number(_0x39f474[_0xd73e('0x27')]['id']),'tags':_0x5cba98||[]};});}})[_0xd73e('0x19')](respondWithResult(_0x937fa5,null))[_0xd73e('0x25')](handleError(_0x937fa5,null));};exports[_0xd73e('0x4a')]=function(_0x205371,_0x561586){return db[_0xd73e('0x1f')][_0xd73e('0x36')]({'where':{'id':_0x205371[_0xd73e('0x27')]['id']}})[_0xd73e('0x19')](handleEntityNotFound(_0x561586,null))[_0xd73e('0x19')](function(_0x458e22){if(_0x458e22){return _0x458e22[_0xd73e('0x4a')](_0x205371['query'][_0xd73e('0x39')]);}})['then'](respondWithStatusCode(_0x561586,null))[_0xd73e('0x25')](handleError(_0x561586,null));};exports[_0xd73e('0x4b')]=function(_0x8b83b4,_0x298d6f){var _0x171677=moment()[_0xd73e('0x4c')]()['toString']();var _0x10a2c4=path[_0xd73e('0x4d')](config[_0xd73e('0x4e')],'server','files',_0xd73e('0x4f'));var _0xb3afd5=path[_0xd73e('0x4d')](config[_0xd73e('0x4e')],'server','files',_0xd73e('0x50'));var _0x4e04cf=path['join'](_0x10a2c4,_0x171677);var _0x93442=util[_0xd73e('0x51')](_0xd73e('0x52'),_0x8b83b4[_0xd73e('0x27')]['id'],_0x171677);var _0x20e70a=path[_0xd73e('0x4d')](_0x10a2c4,_0x93442);var _0xea024c=[];_0xea024c[_0xd73e('0x53')]({'model':db[_0xd73e('0x54')],'as':'Attachment','raw':!![]});var _0x2438c1=[{'model':db[_0xd73e('0x38')],'as':_0xd73e('0x55'),'attributes':['id',_0xd73e('0x34'),_0xd73e('0x56')],'include':_0xea024c}];return db[_0xd73e('0x1f')]['find']({'where':{'id':_0x8b83b4['params']['id']},'include':_0x2438c1})['then'](handleEntityNotFound(_0x298d6f,null))[_0xd73e('0x19')](function(_0x287bec){if(_0x287bec&&_0x287bec['Messages']){var _0x27caf1=_0x287bec[_0xd73e('0x57')]({'plain':!![]});fs[_0xd73e('0x58')](_0x4e04cf);for(var _0x32412d=0x0;_0x32412d<_0x27caf1[_0xd73e('0x55')][_0xd73e('0x2f')];_0x32412d++){var _0x4c0497=_0x27caf1[_0xd73e('0x55')][_0x32412d][_0xd73e('0x54')];if(_0x4c0497){var _0x5bfaeb=path[_0xd73e('0x4d')](_0xb3afd5,_0x4c0497[_0xd73e('0x59')]);if(fs[_0xd73e('0x5a')](_0x5bfaeb)){fs['createReadStream'](_0x5bfaeb)[_0xd73e('0x5b')](fs[_0xd73e('0x5c')](path[_0xd73e('0x4d')](_0x4e04cf,_0x4c0497[_0xd73e('0x59')])));}}}return BPromise['resolve']()[_0xd73e('0x19')](function(){return new BPromise(function(_0x16384b,_0x352be3){zipdir(_0x4e04cf,{'saveTo':_0x20e70a},function(_0x5ec56d,_0x5d9183){if(_0x5ec56d)return _0x352be3(_0x5ec56d);return _0x16384b(_0x5d9183);});})[_0xd73e('0x19')](function(){return new BPromise(function(_0x471cd9,_0x685996){rimraf(_0x4e04cf,function(_0x1912a6){if(_0x1912a6)_0x685996(_0x1912a6);return _0x471cd9();});});})[_0xd73e('0x19')](function(){return _0x298d6f['download'](_0x20e70a,_0x93442,function(_0x2b8ae3){if(_0x2b8ae3){console['log'](_0xd73e('0x5d'),_0x2b8ae3);}else{fs[_0xd73e('0x5e')](_0x20e70a);}});});});}else{return _0x298d6f[_0xd73e('0xf')](0xc8);}})['catch'](handleError(_0x298d6f,null));}; \ No newline at end of file +var _0xc9d4=['addMessage','FaxMessage','ids','omit','getMessages','hasOwnProperty','nolimit','sort','where','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','merge','rows','addTags','setTags','Tag','color','emit','faxInteractionTags:save','removeTags','download','toString','join','root','server','tmp','files','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','createReadStream','pipe','basename','resolve','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','ioredis','../../components/parsers/qs','api','../../config/environment','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','name','send','index','map','FaxInteraction','rawAttributes','fieldName','findAll','fax','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','options','create','body','find','describe'];(function(_0x34b87f,_0x28aef2){var _0x449805=function(_0x3735b7){while(--_0x3735b7){_0x34b87f['push'](_0x34b87f['shift']());}};_0x449805(++_0x28aef2);}(_0xc9d4,0x8f));var _0x4c9d=function(_0x1b1252,_0x35686e){_0x1b1252=_0x1b1252-0x0;var _0x253b7b=_0xc9d4[_0x1b1252];return _0x253b7b;};'use strict';var rimraf=require(_0x4c9d('0x0'));var zipdir=require(_0x4c9d('0x1'));var moment=require(_0x4c9d('0x2'));var BPromise=require(_0x4c9d('0x3'));var util=require('util');var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0x4c9d('0x4'));var interaction=require('../../components/interaction/service');var qs=require(_0x4c9d('0x5'));var logger=require('../../config/logger')(_0x4c9d('0x6'));var config=require(_0x4c9d('0x7'));var db=require('../../mysqldb')['db'];config[_0x4c9d('0x8')]=_['defaults'](config['redis'],{'host':_0x4c9d('0x9'),'port':0x18eb});var socket=require(_0x4c9d('0xa'))(new Redis(config[_0x4c9d('0x8')]));require('./faxInteraction.socket')[_0x4c9d('0xb')](socket);function respondWithStatusCode(_0x18932c,_0x2e9aa9){_0x2e9aa9=_0x2e9aa9||0xcc;return function(_0x292c48){if(_0x292c48){return _0x18932c[_0x4c9d('0xc')](_0x2e9aa9);}return _0x18932c[_0x4c9d('0xd')](_0x2e9aa9)[_0x4c9d('0xe')]();};}function respondWithResult(_0x265b5c,_0x2b1036){_0x2b1036=_0x2b1036||0xc8;return function(_0xeb84a4){if(_0xeb84a4){return _0x265b5c[_0x4c9d('0xd')](_0x2b1036)[_0x4c9d('0xf')](_0xeb84a4);}};}function respondWithFilteredResult(_0x38b2a2,_0x3312bd){return function(_0x3f3f17){if(_0x3f3f17){var _0x1cff7b=typeof _0x3312bd[_0x4c9d('0x10')]===_0x4c9d('0x11')&&typeof _0x3312bd[_0x4c9d('0x12')]===_0x4c9d('0x11');var _0x59bdb9=_0x3f3f17[_0x4c9d('0x13')];var _0x3496e3=_0x1cff7b?0x0:_0x3312bd[_0x4c9d('0x10')];var _0x1e2c2c=_0x1cff7b?_0x3f3f17[_0x4c9d('0x13')]:_0x3312bd[_0x4c9d('0x10')]+_0x3312bd[_0x4c9d('0x12')];var _0x3ddf0e;if(_0x1e2c2c>=_0x59bdb9){_0x1e2c2c=_0x59bdb9;_0x3ddf0e=0xc8;}else{_0x3ddf0e=0xce;}_0x38b2a2['status'](_0x3ddf0e);return _0x38b2a2[_0x4c9d('0x14')](_0x4c9d('0x15'),_0x3496e3+'-'+_0x1e2c2c+'/'+_0x59bdb9)['json'](_0x3f3f17);}return null;};}function saveUpdates(_0x6f1ab0){return function(_0x57c932){if(_0x57c932){return _0x57c932[_0x4c9d('0x16')](_0x6f1ab0)[_0x4c9d('0x17')](function(_0x229c61){return _0x229c61;});}return null;};}function removeEntity(_0x27821){return function(_0x315b65){if(_0x315b65){return _0x315b65[_0x4c9d('0x18')]()['then'](function(){_0x27821[_0x4c9d('0xd')](0xcc)[_0x4c9d('0xe')]();});}};}function handleEntityNotFound(_0x1eb31c){return function(_0x5ccfd9){if(!_0x5ccfd9){_0x1eb31c[_0x4c9d('0xc')](0x194);}return _0x5ccfd9;};}function handleError(_0x4d2f03,_0x634429){_0x634429=_0x634429||0x1f4;return function(_0x22a810){logger['error'](_0x22a810['stack']);if(_0x22a810[_0x4c9d('0x19')]){delete _0x22a810[_0x4c9d('0x19')];}_0x4d2f03['status'](_0x634429)[_0x4c9d('0x1a')](_0x22a810);};}exports[_0x4c9d('0x1b')]=function(_0x267904,_0x45b16f){var _0x8698c5={};var _0x960d2f=_[_0x4c9d('0x1c')](db[_0x4c9d('0x1d')][_0x4c9d('0x1e')],function(_0x2c0027){return{'name':_0x2c0027[_0x4c9d('0x1f')],'type':_0x2c0027['type']['key']};});_0x8698c5=qs['getOptions'](_0x960d2f,_0x267904);return interaction[_0x4c9d('0x20')](_0x4c9d('0x21'),_0x267904[_0x4c9d('0x22')],_0x267904[_0x4c9d('0x23')],_0x8698c5,_0x960d2f)['then'](respondWithFilteredResult(_0x45b16f,_0x8698c5))[_0x4c9d('0x24')](handleError(_0x45b16f,null));};exports[_0x4c9d('0x25')]=function(_0x5c6f11,_0x273901){var _0x7dc19d={'raw':![],'where':{'id':_0x5c6f11[_0x4c9d('0x26')]['id']}},_0x1defef={};_0x1defef[_0x4c9d('0x27')]=_[_0x4c9d('0x28')](db[_0x4c9d('0x1d')][_0x4c9d('0x1e')]);_0x1defef[_0x4c9d('0x22')]=_[_0x4c9d('0x28')](_0x5c6f11['query']);_0x1defef[_0x4c9d('0x29')]=_[_0x4c9d('0x2a')](_0x1defef[_0x4c9d('0x27')],_0x1defef[_0x4c9d('0x22')]);_0x7dc19d[_0x4c9d('0x2b')]=_[_0x4c9d('0x2a')](_0x1defef[_0x4c9d('0x27')],qs[_0x4c9d('0x2c')](_0x5c6f11[_0x4c9d('0x22')][_0x4c9d('0x2c')]));_0x7dc19d['attributes']=_0x7dc19d[_0x4c9d('0x2b')][_0x4c9d('0x2d')]?_0x7dc19d[_0x4c9d('0x2b')]:_0x1defef[_0x4c9d('0x27')];if(_0x5c6f11[_0x4c9d('0x22')][_0x4c9d('0x2e')]){_0x7dc19d[_0x4c9d('0x2f')]=[{'all':!![]}];}_0x7dc19d=_['merge']({},_0x7dc19d,_0x5c6f11[_0x4c9d('0x30')]);return db[_0x4c9d('0x1d')]['find'](_0x7dc19d)[_0x4c9d('0x17')](handleEntityNotFound(_0x273901,null))[_0x4c9d('0x17')](respondWithResult(_0x273901,null))[_0x4c9d('0x24')](handleError(_0x273901,null));};exports[_0x4c9d('0x31')]=function(_0x36192c,_0x2532d7){return db['FaxInteraction'][_0x4c9d('0x31')](_0x36192c[_0x4c9d('0x32')],{})['then'](respondWithResult(_0x2532d7,0xc9))[_0x4c9d('0x24')](handleError(_0x2532d7,null));};exports[_0x4c9d('0x16')]=function(_0x1ab7a2,_0x4a4dff){if(_0x1ab7a2['body']['id']){delete _0x1ab7a2['body']['id'];}return db['FaxInteraction'][_0x4c9d('0x33')]({'where':{'id':_0x1ab7a2[_0x4c9d('0x26')]['id']}})[_0x4c9d('0x17')](handleEntityNotFound(_0x4a4dff,null))[_0x4c9d('0x17')](saveUpdates(_0x1ab7a2[_0x4c9d('0x32')],null))[_0x4c9d('0x17')](respondWithResult(_0x4a4dff,null))[_0x4c9d('0x24')](handleError(_0x4a4dff,null));};exports['destroy']=function(_0x2e6bcf,_0x18dd6c){return db[_0x4c9d('0x1d')][_0x4c9d('0x33')]({'where':{'id':_0x2e6bcf[_0x4c9d('0x26')]['id']}})[_0x4c9d('0x17')](handleEntityNotFound(_0x18dd6c,null))['then'](removeEntity(_0x18dd6c,null))[_0x4c9d('0x24')](handleError(_0x18dd6c,null));};exports[_0x4c9d('0x34')]=function(_0x235abe,_0x5916a1){return db[_0x4c9d('0x1d')][_0x4c9d('0x34')]()[_0x4c9d('0x17')](respondWithResult(_0x5916a1,null))[_0x4c9d('0x24')](handleError(_0x5916a1,null));};exports[_0x4c9d('0x35')]=function(_0x375c01,_0x1d1764){return db[_0x4c9d('0x36')][_0x4c9d('0x33')]({'where':{'id':_0x375c01[_0x4c9d('0x26')]['id']}})[_0x4c9d('0x17')](handleEntityNotFound(_0x1d1764,null))[_0x4c9d('0x17')](function(_0x3cfaf4){if(_0x3cfaf4){return _0x3cfaf4['addMessage'](_0x375c01[_0x4c9d('0x32')][_0x4c9d('0x37')],_[_0x4c9d('0x38')](_0x375c01[_0x4c9d('0x32')],['ids','id'])||{});}})['then'](respondWithResult(_0x1d1764,null))[_0x4c9d('0x24')](handleError(_0x1d1764,null));};exports[_0x4c9d('0x39')]=function(_0x584a37,_0x351362){var _0x2b7704={'raw':![],'where':{}};var _0x1a2ad6={};var _0x5671c5={'count':0x0,'rows':[]};return db[_0x4c9d('0x1d')]['findOne']({'where':{'id':_0x584a37['params']['id']}})['then'](handleEntityNotFound(_0x351362,null))['then'](function(_0xa63956){if(_0xa63956){_0x1a2ad6[_0x4c9d('0x27')]=_['keys'](db[_0x4c9d('0x36')]['rawAttributes']);_0x1a2ad6[_0x4c9d('0x22')]=_[_0x4c9d('0x28')](_0x584a37[_0x4c9d('0x22')]);_0x1a2ad6['filters']=_[_0x4c9d('0x2a')](_0x1a2ad6[_0x4c9d('0x27')],_0x1a2ad6[_0x4c9d('0x22')]);_0x2b7704[_0x4c9d('0x2b')]=_['intersection'](_0x1a2ad6[_0x4c9d('0x27')],qs[_0x4c9d('0x2c')](_0x584a37[_0x4c9d('0x22')]['fields']));_0x2b7704[_0x4c9d('0x2b')]=_0x2b7704[_0x4c9d('0x2b')][_0x4c9d('0x2d')]?_0x2b7704['attributes']:_0x1a2ad6[_0x4c9d('0x27')];if(!_0x584a37[_0x4c9d('0x22')][_0x4c9d('0x3a')](_0x4c9d('0x3b'))){_0x2b7704[_0x4c9d('0x12')]=qs['limit'](_0x584a37[_0x4c9d('0x22')][_0x4c9d('0x12')]);_0x2b7704[_0x4c9d('0x10')]=qs[_0x4c9d('0x10')](_0x584a37[_0x4c9d('0x22')][_0x4c9d('0x10')]);}_0x2b7704['order']=qs['sort'](_0x584a37[_0x4c9d('0x22')][_0x4c9d('0x3c')]);_0x2b7704[_0x4c9d('0x3d')]=qs['filters'](_['pick'](_0x584a37[_0x4c9d('0x22')],_0x1a2ad6[_0x4c9d('0x29')]));_0x2b7704[_0x4c9d('0x3d')][_0x4c9d('0x3e')]=_0xa63956['id'];if(_0x584a37[_0x4c9d('0x22')][_0x4c9d('0x3f')]){_0x2b7704[_0x4c9d('0x3d')]=_['merge'](_0x2b7704[_0x4c9d('0x3d')],{'$or':_[_0x4c9d('0x1c')](_0x2b7704[_0x4c9d('0x2b')],function(_0x28bdbe){var _0xd47377={};_0xd47377[_0x28bdbe]={'$like':'%'+_0x584a37[_0x4c9d('0x22')]['filter']+'%'};return _0xd47377;})});}if(_0x584a37[_0x4c9d('0x22')][_0x4c9d('0x40')]){var _0x135604=_0x584a37[_0x4c9d('0x22')]['$gte'][_0x4c9d('0x41')](',');var _0x5afd98={};_0x5afd98[_0x135604[0x0]]={'$gte':moment(_0x135604[0x1])[_0x4c9d('0x42')](_0x4c9d('0x43'))};_0x2b7704[_0x4c9d('0x3d')]=_[_0x4c9d('0x44')](_0x2b7704[_0x4c9d('0x3d')],_0x5afd98);}_0x2b7704=_[_0x4c9d('0x44')]({},_0x2b7704,_0x584a37[_0x4c9d('0x30')]);return db[_0x4c9d('0x36')][_0x4c9d('0x13')]({'where':_0x2b7704[_0x4c9d('0x3d')]})[_0x4c9d('0x17')](function(_0x3e8ff1){_0x5671c5[_0x4c9d('0x13')]=_0x3e8ff1;if(_0x584a37[_0x4c9d('0x22')][_0x4c9d('0x2e')]){_0x2b7704[_0x4c9d('0x2f')]=[{'all':!![]}];}return db[_0x4c9d('0x36')][_0x4c9d('0x20')](_0x2b7704);})[_0x4c9d('0x17')](function(_0x27d0f4){_0x5671c5[_0x4c9d('0x45')]=_0x27d0f4;return _0x5671c5;});}})[_0x4c9d('0x17')](respondWithFilteredResult(_0x351362,_0x2b7704))['catch'](handleError(_0x351362,null));};exports[_0x4c9d('0x46')]=function(_0x413b75,_0x576009){return db[_0x4c9d('0x1d')]['find']({'where':{'id':_0x413b75[_0x4c9d('0x26')]['id']}})[_0x4c9d('0x17')](handleEntityNotFound(_0x576009,null))[_0x4c9d('0x17')](function(_0x4d39cf){if(_0x4d39cf){return _0x4d39cf[_0x4c9d('0x47')](_0x413b75[_0x4c9d('0x32')][_0x4c9d('0x37')],_['omit'](_0x413b75[_0x4c9d('0x32')],[_0x4c9d('0x37'),'id'])||{})['spread'](function(){return db[_0x4c9d('0x48')][_0x4c9d('0x20')]({'attributes':['id',_0x4c9d('0x19'),_0x4c9d('0x49')],'where':{'id':_0x413b75[_0x4c9d('0x32')]['ids']}});})[_0x4c9d('0x17')](function(_0x2ae99d){socket[_0x4c9d('0x4a')](_0x4c9d('0x4b'),{'id':Number(_0x413b75[_0x4c9d('0x26')]['id']),'tags':_0x2ae99d||[]});return{'id':Number(_0x413b75[_0x4c9d('0x26')]['id']),'tags':_0x2ae99d||[]};});}})[_0x4c9d('0x17')](respondWithResult(_0x576009,null))['catch'](handleError(_0x576009,null));};exports[_0x4c9d('0x4c')]=function(_0x280808,_0x864286){return db[_0x4c9d('0x1d')][_0x4c9d('0x33')]({'where':{'id':_0x280808[_0x4c9d('0x26')]['id']}})[_0x4c9d('0x17')](handleEntityNotFound(_0x864286,null))[_0x4c9d('0x17')](function(_0xcf91f){if(_0xcf91f){return _0xcf91f[_0x4c9d('0x4c')](_0x280808['query'][_0x4c9d('0x37')]);}})[_0x4c9d('0x17')](respondWithStatusCode(_0x864286,null))[_0x4c9d('0x24')](handleError(_0x864286,null));};exports[_0x4c9d('0x4d')]=function(_0x2dca9b,_0x24c892){var _0x275ee5=moment()['unix']()[_0x4c9d('0x4e')]();var _0x4efff4=path[_0x4c9d('0x4f')](config[_0x4c9d('0x50')],_0x4c9d('0x51'),'files',_0x4c9d('0x52'));var _0x47592b=path['join'](config['root'],'server',_0x4c9d('0x53'),'attachments');var _0x37a740=path['join'](_0x4efff4,_0x275ee5);var _0x38dc9a=util[_0x4c9d('0x42')](_0x4c9d('0x54'),_0x2dca9b[_0x4c9d('0x26')]['id'],_0x275ee5);var _0x47e2ea=path[_0x4c9d('0x4f')](_0x4efff4,_0x38dc9a);var _0x2c2990=[];_0x2c2990[_0x4c9d('0x55')]({'model':db[_0x4c9d('0x56')],'as':_0x4c9d('0x56'),'raw':!![]});var _0x3dce41=[{'model':db[_0x4c9d('0x36')],'as':_0x4c9d('0x57'),'attributes':['id',_0x4c9d('0x32'),_0x4c9d('0x58')],'include':_0x2c2990}];return db['FaxInteraction']['find']({'where':{'id':_0x2dca9b[_0x4c9d('0x26')]['id']},'include':_0x3dce41})['then'](handleEntityNotFound(_0x24c892,null))['then'](function(_0x439851){if(_0x439851&&_0x439851[_0x4c9d('0x57')]){var _0x575847=_0x439851[_0x4c9d('0x59')]({'plain':!![]});fs[_0x4c9d('0x5a')](_0x37a740);for(var _0x1a6e90=0x0;_0x1a6e90<_0x575847[_0x4c9d('0x57')][_0x4c9d('0x2d')];_0x1a6e90++){var _0x1e81f1=_0x575847[_0x4c9d('0x57')][_0x1a6e90]['Attachment'];if(_0x1e81f1){var _0x371e0c=path['join'](_0x47592b,_0x1e81f1['basename']);if(fs['existsSync'](_0x371e0c)){fs[_0x4c9d('0x5b')](_0x371e0c)[_0x4c9d('0x5c')](fs['createWriteStream'](path[_0x4c9d('0x4f')](_0x37a740,_0x1e81f1[_0x4c9d('0x5d')])));}}}return BPromise[_0x4c9d('0x5e')]()['then'](function(){return new BPromise(function(_0xa12c63,_0x31b38a){zipdir(_0x37a740,{'saveTo':_0x47e2ea},function(_0x52f729,_0x477033){if(_0x52f729)return _0x31b38a(_0x52f729);return _0xa12c63(_0x477033);});})['then'](function(){return new BPromise(function(_0x1c38b9,_0x22c24f){rimraf(_0x37a740,function(_0x35afd0){if(_0x35afd0)_0x22c24f(_0x35afd0);return _0x1c38b9();});});})[_0x4c9d('0x17')](function(){return _0x24c892[_0x4c9d('0x4d')](_0x47e2ea,_0x38dc9a,function(_0x14b39b){if(_0x14b39b){console[_0x4c9d('0x5f')](_0x4c9d('0x60'),_0x14b39b);}else{fs[_0x4c9d('0x61')](_0x47e2ea);}});});});}else{return _0x24c892[_0x4c9d('0xc')](0xc8);}})[_0x4c9d('0x24')](handleError(_0x24c892,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 857a6df..95555fa 100644 --- a/server/api/faxInteraction/faxInteraction.events.js +++ b/server/api/faxInteraction/faxInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e21=['Users','map','findAll','length','emit','catch','hasOwnProperty','hook','events','FaxInteraction','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x5df394,_0x34981a){var _0x2584c8=function(_0x25a714){while(--_0x25a714){_0x5df394['push'](_0x5df394['shift']());}};_0x2584c8(++_0x34981a);}(_0x2e21,0x1d0));var _0x12e2=function(_0x2fa37b,_0x423dea){_0x2fa37b=_0x2fa37b-0x0;var _0x17581b=_0x2e21[_0x2fa37b];return _0x17581b;};'use strict';var EventEmitter=require(_0x12e2('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x12e2('0x1')];var FaxMessage=require(_0x12e2('0x2'))['db'][_0x12e2('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x12e2('0x4')](0x0);var events={'afterCreate':_0x12e2('0x5'),'afterUpdate':_0x12e2('0x6'),'afterDestroy':_0x12e2('0x7')};function emitEvent(_0x17663f){return function(_0x1bed26,_0x2a4cb1,_0x2f8ad8){_0x1bed26[_0x12e2('0x8')]({'attributes':['id'],'raw':!![]})[_0x12e2('0x9')](function(_0x1ab93e){_0x1bed26[_0x12e2('0xa')](_0x12e2('0xb'),_0x1ab93e[_0x12e2('0xc')](function(_0x6849f5){return{'id':_0x6849f5['id']};}));return FaxMessage[_0x12e2('0xd')]({'where':{'FaxInteractionId':_0x1bed26['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xb6fea8){_0x1bed26[_0x12e2('0xa')]('unreadMessages',_0xb6fea8[_0x12e2('0xe')]);FaxInteractionEvents[_0x12e2('0xf')](_0x17663f+':'+_0x1bed26['id'],_0x1bed26);FaxInteractionEvents[_0x12e2('0xf')](_0x17663f,_0x1bed26);_0x2f8ad8(null);})[_0x12e2('0x10')](_0x2f8ad8(null));};}for(var e in events){if(events[_0x12e2('0x11')](e)){var event=events[e];FaxInteraction[_0x12e2('0x12')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x8f47=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','findAll','catch','hasOwnProperty','hook','events'];(function(_0x9d93d1,_0x21e0c6){var _0x67fa0=function(_0x4e098d){while(--_0x4e098d){_0x9d93d1['push'](_0x9d93d1['shift']());}};_0x67fa0(++_0x21e0c6);}(_0x8f47,0x141));var _0x78f4=function(_0x25bd0c,_0x10a934){_0x25bd0c=_0x25bd0c-0x0;var _0x1c8e6e=_0x8f47[_0x25bd0c];return _0x1c8e6e;};'use strict';var EventEmitter=require(_0x78f4('0x0'));var FaxInteraction=require(_0x78f4('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x78f4('0x1'))['db'][_0x78f4('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x78f4('0x3')](0x0);var events={'afterCreate':_0x78f4('0x4'),'afterUpdate':_0x78f4('0x5'),'afterDestroy':_0x78f4('0x6')};function emitEvent(_0x207154){return function(_0x2094c0,_0x541492,_0x4328be){_0x2094c0[_0x78f4('0x7')]({'attributes':['id'],'raw':!![]})[_0x78f4('0x8')](function(_0x3482a8){_0x2094c0[_0x78f4('0x9')]('Users',_0x3482a8['map'](function(_0x490c7b){return{'id':_0x490c7b['id']};}));return FaxMessage[_0x78f4('0xa')]({'where':{'FaxInteractionId':_0x2094c0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x78f4('0x8')](function(_0x1125b8){_0x2094c0[_0x78f4('0x9')]('unreadMessages',_0x1125b8['length']);FaxInteractionEvents['emit'](_0x207154+':'+_0x2094c0['id'],_0x2094c0);FaxInteractionEvents['emit'](_0x207154,_0x2094c0);_0x4328be(null);})[_0x78f4('0xb')](_0x4328be(null));};}for(var e in events){if(events[_0x78f4('0xc')](e)){var event=events[e];FaxInteraction[_0x78f4('0xd')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 0b77c7c..828d672 100644 --- a/server/api/faxInteraction/faxInteraction.model.js +++ b/server/api/faxInteraction/faxInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c2c=['format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt'];(function(_0x524744,_0x5e6d95){var _0x16a38c=function(_0x44c698){while(--_0x44c698){_0x524744['push'](_0x524744['shift']());}};_0x16a38c(++_0x5e6d95);}(_0x6c2c,0x158));var _0xc6c2=function(_0x596b07,_0x5795fd){_0x596b07=_0x596b07-0x0;var _0xecb3bb=_0x6c2c[_0x596b07];return _0xecb3bb;};'use strict';var _=require('lodash');var util=require(_0xc6c2('0x0'));var logger=require(_0xc6c2('0x1'))(_0xc6c2('0x2'));var moment=require(_0xc6c2('0x3'));var BPromise=require(_0xc6c2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6c2('0x5'));var rimraf=require(_0xc6c2('0x6'));var config=require(_0xc6c2('0x7'));var attributes=require(_0xc6c2('0x8'));module[_0xc6c2('0x9')]=function(_0x30ad0b,_0x2433ad){return _0x30ad0b[_0xc6c2('0xa')](_0xc6c2('0xb'),attributes,{'tableName':_0xc6c2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x490e12,_0x2f1609,_0x178763){if(_0x490e12[_0xc6c2('0xd')](_0xc6c2('0xe'))){_0x490e12[_0xc6c2('0xf')]=moment()[_0xc6c2('0x10')](_0xc6c2('0x11'));}_0x178763(null,_0x490e12);}}});}; \ No newline at end of file +var _0x9627=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','path','./faxInteraction.attributes','exports','define','fax_interactions','changed','closed'];(function(_0x219536,_0x8e0b9b){var _0x231e4d=function(_0x37b376){while(--_0x37b376){_0x219536['push'](_0x219536['shift']());}};_0x231e4d(++_0x8e0b9b);}(_0x9627,0x8a));var _0x7962=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9627[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0x7962('0x0'));var util=require('util');var logger=require(_0x7962('0x1'))(_0x7962('0x2'));var moment=require(_0x7962('0x3'));var BPromise=require(_0x7962('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7962('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7962('0x6'));module[_0x7962('0x7')]=function(_0x13a5b7,_0x10e060){return _0x13a5b7[_0x7962('0x8')]('FaxInteraction',attributes,{'tableName':_0x7962('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1446d1,_0x27072f,_0x4309c8){if(_0x1446d1[_0x7962('0xa')](_0x7962('0xb'))){_0x1446d1[_0x7962('0xc')]=moment()[_0x7962('0xd')](_0x7962('0xe'));}_0x4309c8(null,_0x1446d1);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 26b57fa..09262f9 100644 --- a/server/api/faxInteraction/faxInteraction.rpc.js +++ b/server/api/faxInteraction/faxInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x505a=['ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','FaxInteraction,\x20%s,\x20%s','result','catch','FaxInteraction','update','body','options','raw','where','attributes','limit','UpdateFaxInteraction','stringify','find'];(function(_0x43a6cd,_0x503d1a){var _0x5acb36=function(_0x2dd95e){while(--_0x2dd95e){_0x43a6cd['push'](_0x43a6cd['shift']());}};_0x5acb36(++_0x503d1a);}(_0x505a,0x144));var _0xa505=function(_0x3535f2,_0x9ef189){_0x3535f2=_0x3535f2-0x0;var _0x51f83e=_0x505a[_0x3535f2];return _0x51f83e;};'use strict';var _=require(_0xa505('0x0'));var util=require(_0xa505('0x1'));var moment=require('moment');var BPromise=require(_0xa505('0x2'));var rs=require(_0xa505('0x3'));var fs=require('fs');var Redis=require(_0xa505('0x4'));var db=require(_0xa505('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa505('0x6'));var jayson=require(_0xa505('0x7'));var client=jayson[_0xa505('0x8')][_0xa505('0x9')]({'port':0x232a});config[_0xa505('0xa')]=_[_0xa505('0xb')](config[_0xa505('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa505('0xc'))(new Redis(config[_0xa505('0xa')]));require('./faxInteraction.socket')[_0xa505('0xd')](socket);function respondWithRpcPromise(_0x8bbc51,_0x2a3276,_0x3dfede){return new BPromise(function(_0x534b3d,_0x3fa219){return client[_0xa505('0xe')](_0x8bbc51,_0x3dfede)[_0xa505('0xf')](function(_0x4230c9){logger[_0xa505('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x2a3276,'request\x20sent');logger[_0xa505('0x11')](_0xa505('0x12'),_0x2a3276,'request\x20sent',JSON['stringify'](_0x4230c9));if(_0x4230c9['error']){if(_0x4230c9[_0xa505('0x13')][_0xa505('0x14')]===0x1f4){logger[_0xa505('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x2a3276,_0x4230c9[_0xa505('0x13')][_0xa505('0x15')]);return _0x3fa219(_0x4230c9[_0xa505('0x13')][_0xa505('0x15')]);}logger[_0xa505('0x13')](_0xa505('0x16'),_0x2a3276,_0x4230c9[_0xa505('0x13')][_0xa505('0x15')]);return _0x534b3d(_0x4230c9[_0xa505('0x13')][_0xa505('0x15')]);}else{logger[_0xa505('0x10')](_0xa505('0x16'),_0x2a3276,'request\x20sent');_0x534b3d(_0x4230c9[_0xa505('0x17')][_0xa505('0x15')]);}})[_0xa505('0x18')](function(_0x2e3031){logger[_0xa505('0x13')](_0xa505('0x16'),_0x2a3276,_0x2e3031);_0x3fa219(_0x2e3031);});});}exports['UpdateFaxInteraction']=function(_0x3fa4c1){var _0xcaac5a=this;return new Promise(function(_0x4795ae,_0x1f25d8){return db[_0xa505('0x19')][_0xa505('0x1a')](_0x3fa4c1[_0xa505('0x1b')],{'raw':_0x3fa4c1['options']?_0x3fa4c1[_0xa505('0x1c')][_0xa505('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fa4c1['options']?_0x3fa4c1['options'][_0xa505('0x1e')]||null:null,'attributes':_0x3fa4c1[_0xa505('0x1c')]?_0x3fa4c1[_0xa505('0x1c')][_0xa505('0x1f')]||null:null,'limit':_0x3fa4c1[_0xa505('0x1c')]?_0x3fa4c1[_0xa505('0x1c')][_0xa505('0x20')]||null:null})[_0xa505('0xf')](function(_0x42974e){logger[_0xa505('0x10')](_0xa505('0x21'),_0x3fa4c1);logger[_0xa505('0x11')]('UpdateFaxInteraction',_0x3fa4c1,JSON[_0xa505('0x22')](_0x42974e));_0x4795ae(_0x42974e);})[_0xa505('0x18')](function(_0x55984f){logger[_0xa505('0x13')](_0xa505('0x21'),_0x55984f[_0xa505('0x15')],_0x3fa4c1);_0x1f25d8(_0xcaac5a[_0xa505('0x13')](0x1f4,_0x55984f[_0xa505('0x15')]));});});};exports['AddTagsToFaxInteraction']=function(_0x496dc8){return new Promise(function(_0x3b0dc8,_0x22068e){return db[_0xa505('0x19')][_0xa505('0x23')]({'where':_0x496dc8[_0xa505('0x1c')]?_0x496dc8['options'][_0xa505('0x1e')]||null:null})[_0xa505('0xf')](function(_0x256f9f){if(_0x256f9f){return _0x256f9f['addTags'](_0x496dc8[_0xa505('0x1b')][_0xa505('0x24')],_[_0xa505('0x25')](_0x496dc8['body'],['ids','id'])||{});}})[_0xa505('0x26')](function(_0x3c22c4){logger[_0xa505('0x10')](_0xa505('0x27'),_0x496dc8);logger[_0xa505('0x11')]('AddTags',_0x496dc8,JSON['stringify'](_0x3c22c4));_0x3b0dc8(_0x3c22c4);})[_0xa505('0x18')](function(_0x4b8425){logger[_0xa505('0x13')](_0xa505('0x27'),_0x4b8425[_0xa505('0x15')],_0x496dc8);_0x22068e(_this[_0xa505('0x13')](0x1f4,_0x4b8425[_0xa505('0x15')]));});});}; \ No newline at end of file +var _0xf2ce=['then','info','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxInteraction,\x20%s,\x20%s','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','debug','catch','AddTagsToFaxInteraction','find','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis','./faxInteraction.socket','register'];(function(_0x2cfca0,_0x210a08){var _0x293e83=function(_0x46b608){while(--_0x46b608){_0x2cfca0['push'](_0x2cfca0['shift']());}};_0x293e83(++_0x210a08);}(_0xf2ce,0x12a));var _0xef2c=function(_0x2d4979,_0x1011ad){_0x2d4979=_0x2d4979-0x0;var _0x4ce245=_0xf2ce[_0x2d4979];return _0x4ce245;};'use strict';var _=require('lodash');var util=require(_0xef2c('0x0'));var moment=require(_0xef2c('0x1'));var BPromise=require(_0xef2c('0x2'));var rs=require(_0xef2c('0x3'));var fs=require('fs');var Redis=require(_0xef2c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xef2c('0x5'));var logger=require(_0xef2c('0x6'))(_0xef2c('0x7'));var config=require(_0xef2c('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xef2c('0x9')]({'port':0x232a});config['redis']=_[_0xef2c('0xa')](config[_0xef2c('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xef2c('0xc'))[_0xef2c('0xd')](socket);function respondWithRpcPromise(_0x3654bb,_0x5a7c66,_0x56afc4){return new BPromise(function(_0x21bdee,_0x5b1bd4){return client['request'](_0x3654bb,_0x56afc4)[_0xef2c('0xe')](function(_0x44c438){logger[_0xef2c('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x5a7c66,_0xef2c('0x10'));logger['debug'](_0xef2c('0x11'),_0x5a7c66,_0xef2c('0x10'),JSON[_0xef2c('0x12')](_0x44c438));if(_0x44c438['error']){if(_0x44c438[_0xef2c('0x13')]['code']===0x1f4){logger[_0xef2c('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x5a7c66,_0x44c438['error'][_0xef2c('0x14')]);return _0x5b1bd4(_0x44c438[_0xef2c('0x13')][_0xef2c('0x14')]);}logger[_0xef2c('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x5a7c66,_0x44c438[_0xef2c('0x13')][_0xef2c('0x14')]);return _0x21bdee(_0x44c438[_0xef2c('0x13')][_0xef2c('0x14')]);}else{logger['info'](_0xef2c('0x15'),_0x5a7c66,'request\x20sent');_0x21bdee(_0x44c438[_0xef2c('0x16')][_0xef2c('0x14')]);}})['catch'](function(_0x11f533){logger['error'](_0xef2c('0x15'),_0x5a7c66,_0x11f533);_0x5b1bd4(_0x11f533);});});}exports[_0xef2c('0x17')]=function(_0x3e7395){var _0x24c8fe=this;return new Promise(function(_0x4bdcb4,_0x3c7def){return db[_0xef2c('0x18')][_0xef2c('0x19')](_0x3e7395[_0xef2c('0x1a')],{'raw':_0x3e7395[_0xef2c('0x1b')]?_0x3e7395[_0xef2c('0x1b')][_0xef2c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e7395[_0xef2c('0x1b')]?_0x3e7395[_0xef2c('0x1b')][_0xef2c('0x1d')]||null:null,'attributes':_0x3e7395[_0xef2c('0x1b')]?_0x3e7395['options'][_0xef2c('0x1e')]||null:null,'limit':_0x3e7395[_0xef2c('0x1b')]?_0x3e7395[_0xef2c('0x1b')][_0xef2c('0x1f')]||null:null})[_0xef2c('0xe')](function(_0x220813){logger[_0xef2c('0xf')]('UpdateFaxInteraction',_0x3e7395);logger[_0xef2c('0x20')](_0xef2c('0x17'),_0x3e7395,JSON[_0xef2c('0x12')](_0x220813));_0x4bdcb4(_0x220813);})[_0xef2c('0x21')](function(_0x2567bf){logger[_0xef2c('0x13')](_0xef2c('0x17'),_0x2567bf[_0xef2c('0x14')],_0x3e7395);_0x3c7def(_0x24c8fe[_0xef2c('0x13')](0x1f4,_0x2567bf[_0xef2c('0x14')]));});});};exports[_0xef2c('0x22')]=function(_0x29c78d){return new Promise(function(_0x42c9ef,_0x1b7e56){return db[_0xef2c('0x18')][_0xef2c('0x23')]({'where':_0x29c78d[_0xef2c('0x1b')]?_0x29c78d['options'][_0xef2c('0x1d')]||null:null})[_0xef2c('0xe')](function(_0x39211c){if(_0x39211c){return _0x39211c['addTags'](_0x29c78d[_0xef2c('0x1a')]['ids'],_[_0xef2c('0x24')](_0x29c78d['body'],['ids','id'])||{});}})[_0xef2c('0x25')](function(_0x49680e){logger['info'](_0xef2c('0x26'),_0x29c78d);logger[_0xef2c('0x20')](_0xef2c('0x26'),_0x29c78d,JSON[_0xef2c('0x12')](_0x49680e));_0x42c9ef(_0x49680e);})[_0xef2c('0x21')](function(_0x210ba1){logger[_0xef2c('0x13')]('AddTags',_0x210ba1[_0xef2c('0x14')],_0x29c78d);_0x1b7e56(_this['error'](0x1f4,_0x210ba1[_0xef2c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index f9b533c..fd4a38c 100644 --- a/server/api/faxInteraction/faxInteraction.socket.js +++ b/server/api/faxInteraction/faxInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7c0=['save','emit','removeListener','register','length','faxInteraction:'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0xf7c0,0x1a4));var _0x0f7c=function(_0x28881b,_0x16e4c3){_0x28881b=_0x28881b-0x0;var _0x31b0c0=_0xf7c0[_0x28881b];return _0x31b0c0;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x0f7c('0x0'),'remove','update'];function createListener(_0x3646a2,_0x5d3c52){return function(_0x1ea4aa){_0x5d3c52[_0x0f7c('0x1')](_0x3646a2,_0x1ea4aa);};}function removeListener(_0x67364,_0xab7ea2){return function(){FaxInteractionEvents[_0x0f7c('0x2')](_0x67364,_0xab7ea2);};}exports[_0x0f7c('0x3')]=function(_0x4e132c){for(var _0xf4cf30=0x0,_0x18b6c9=events[_0x0f7c('0x4')];_0xf4cf30<_0x18b6c9;_0xf4cf30++){var _0x390113=events[_0xf4cf30];var _0x745189=createListener(_0x0f7c('0x5')+_0x390113,_0x4e132c);FaxInteractionEvents['on'](_0x390113,_0x745189);}}; \ No newline at end of file +var _0x34df=['save','update','emit','removeListener','register','length','./faxInteraction.events'];(function(_0x247ab8,_0x47cd65){var _0x4a02aa=function(_0x5c4933){while(--_0x5c4933){_0x247ab8['push'](_0x247ab8['shift']());}};_0x4a02aa(++_0x47cd65);}(_0x34df,0x15d));var _0xf34d=function(_0x1678c8,_0x1c32f4){_0x1678c8=_0x1678c8-0x0;var _0x387aa9=_0x34df[_0x1678c8];return _0x387aa9;};'use strict';var FaxInteractionEvents=require(_0xf34d('0x0'));var events=[_0xf34d('0x1'),'remove',_0xf34d('0x2')];function createListener(_0x23cc73,_0x1ee703){return function(_0x17803b){_0x1ee703[_0xf34d('0x3')](_0x23cc73,_0x17803b);};}function removeListener(_0xc8d90a,_0x573b5c){return function(){FaxInteractionEvents[_0xf34d('0x4')](_0xc8d90a,_0x573b5c);};}exports[_0xf34d('0x5')]=function(_0x4ab7b5){for(var _0xc46b9f=0x0,_0x26e203=events[_0xf34d('0x6')];_0xc46b9f<_0x26e203;_0xc46b9f++){var _0x20bab0=events[_0xc46b9f];var _0x2e2722=createListener('faxInteraction:'+_0x20bab0,_0x4ab7b5);FaxInteractionEvents['on'](_0x20bab0,_0x2e2722);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 4ed54d9..c4ba0bc 100644 --- a/server/api/faxInteraction/index.js +++ b/server/api/faxInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c14=['/:id/tags','tracked','fax','addTags','put','/:id','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/:id/messages','/:id/download','download','create'];(function(_0x5eadb8,_0x208a41){var _0x30d042=function(_0x472766){while(--_0x472766){_0x5eadb8['push'](_0x5eadb8['shift']());}};_0x30d042(++_0x208a41);}(_0x3c14,0x186));var _0x43c1=function(_0x32f9ca,_0x2fa8bc){_0x32f9ca=_0x32f9ca-0x0;var _0x52e083=_0x3c14[_0x32f9ca];return _0x52e083;};'use strict';var multer=require(_0x43c1('0x0'));var util=require('util');var path=require(_0x43c1('0x1'));var timeout=require(_0x43c1('0x2'));var express=require(_0x43c1('0x3'));var router=express['Router']();var fs_extra=require(_0x43c1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x43c1('0x5'));var config=require(_0x43c1('0x6'));var controller=require(_0x43c1('0x7'));router[_0x43c1('0x8')]('/',auth[_0x43c1('0x9')](),controller[_0x43c1('0xa')]);router[_0x43c1('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x43c1('0x9')](),controller['show']);router['get'](_0x43c1('0xb'),auth[_0x43c1('0x9')](),controller['getMessages']);router['get'](_0x43c1('0xc'),auth[_0x43c1('0x9')](),controller[_0x43c1('0xd')]);router['post']('/',auth[_0x43c1('0x9')](),controller[_0x43c1('0xe')]);router['post']('/:id/messages',auth[_0x43c1('0x9')](),controller['addMessage']);router['post'](_0x43c1('0xf'),auth[_0x43c1('0x9')](),interaction[_0x43c1('0x10')](_0x43c1('0x11'),'faxinteraction:addtags'),controller[_0x43c1('0x12')]);router[_0x43c1('0x13')](_0x43c1('0x14'),auth['isAuthenticated'](),interaction[_0x43c1('0x10')](_0x43c1('0x11'),_0x43c1('0x15')),controller[_0x43c1('0x16')]);router[_0x43c1('0x17')]('/:id',auth['isAuthenticated'](),interaction[_0x43c1('0x10')](_0x43c1('0x11'),_0x43c1('0x18')),controller[_0x43c1('0x19')]);router[_0x43c1('0x17')]('/:id/tags',auth[_0x43c1('0x9')](),controller['removeTags']);module[_0x43c1('0x1a')]=router; \ No newline at end of file +var _0x9ca1=['post','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','describe','/:id','/:id/messages','getMessages','/:id/download','download'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ca1,0x1cc));var _0x19ca=function(_0x4e6cc2,_0x21f546){_0x4e6cc2=_0x4e6cc2-0x0;var _0x23f9f6=_0x9ca1[_0x4e6cc2];return _0x23f9f6;};'use strict';var multer=require(_0x19ca('0x0'));var util=require(_0x19ca('0x1'));var path=require(_0x19ca('0x2'));var timeout=require(_0x19ca('0x3'));var express=require(_0x19ca('0x4'));var router=express[_0x19ca('0x5')]();var fs_extra=require(_0x19ca('0x6'));var auth=require(_0x19ca('0x7'));var interaction=require(_0x19ca('0x8'));var config=require(_0x19ca('0x9'));var controller=require(_0x19ca('0xa'));router['get']('/',auth[_0x19ca('0xb')](),controller[_0x19ca('0xc')]);router[_0x19ca('0xd')]('/describe',auth[_0x19ca('0xb')](),controller[_0x19ca('0xe')]);router['get'](_0x19ca('0xf'),auth[_0x19ca('0xb')](),controller['show']);router[_0x19ca('0xd')](_0x19ca('0x10'),auth[_0x19ca('0xb')](),controller[_0x19ca('0x11')]);router[_0x19ca('0xd')](_0x19ca('0x12'),auth[_0x19ca('0xb')](),controller[_0x19ca('0x13')]);router[_0x19ca('0x14')]('/',auth[_0x19ca('0xb')](),controller['create']);router[_0x19ca('0x14')]('/:id/messages',auth[_0x19ca('0xb')](),controller['addMessage']);router['post']('/:id/tags',auth[_0x19ca('0xb')](),interaction[_0x19ca('0x15')](_0x19ca('0x16'),_0x19ca('0x17')),controller[_0x19ca('0x18')]);router[_0x19ca('0x19')]('/:id',auth['isAuthenticated'](),interaction[_0x19ca('0x15')]('fax',_0x19ca('0x1a')),controller[_0x19ca('0x1b')]);router[_0x19ca('0x1c')](_0x19ca('0xf'),auth[_0x19ca('0xb')](),interaction['tracked']('fax',_0x19ca('0x1d')),controller[_0x19ca('0x1e')]);router[_0x19ca('0x1c')]('/:id/tags',auth[_0x19ca('0xb')](),controller['removeTags']);module[_0x19ca('0x1f')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index c4acd6f..9c482e7 100644 --- a/server/api/faxMessage/faxMessage.attributes.js +++ b/server/api/faxMessage/faxMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x11f249,_0x4ca4a8){var _0x5c3656=function(_0x27c9f8){while(--_0x27c9f8){_0x11f249['push'](_0x11f249['shift']());}};_0x5c3656(++_0x4ca4a8);}(_0xedd9,0xfc));var _0x9edd=function(_0x24bcaa,_0x254634){_0x24bcaa=_0x24bcaa-0x0;var _0x16de50=_0xedd9[_0x24bcaa];return _0x16de50;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'body':{'type':Sequelize[_0x9edd('0x1')](_0x9edd('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9edd('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9edd('0x4')]('in',_0x9edd('0x5')),'defaultValue':_0x9edd('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x9edd('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x6108=['medium','BOOLEAN','out','sequelize','TEXT'];(function(_0x48df04,_0x1522b1){var _0x4de5fa=function(_0x3ae6db){while(--_0x3ae6db){_0x48df04['push'](_0x48df04['shift']());}};_0x4de5fa(++_0x1522b1);}(_0x6108,0xbc));var _0x8610=function(_0x12828d,_0x44137e){_0x12828d=_0x12828d-0x0;var _0x43a236=_0x6108[_0x12828d];return _0x43a236;};'use strict';var Sequelize=require(_0x8610('0x0'));module['exports']={'body':{'type':Sequelize[_0x8610('0x1')](_0x8610('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8610('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x8610('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8610('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 8c3b4db..92fb769 100644 --- a/server/api/faxMessage/faxMessage.controller.js +++ b/server/api/faxMessage/faxMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a12=['describe','fax-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','isNil','read1stAt','user','role','interaction','stringify','null','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','fax','FaxInteractionId','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','fullname','internal','rejectmessage','create','findOne','AttachmentId','SendFax','basename','download','join','root','server','files','Attachment','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','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','FaxMessage','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','rawAttributes','fields','include','find','body'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x6a12,0x1ed));var _0x26a1=function(_0x5e4db3,_0x2f53ee){_0x5e4db3=_0x5e4db3-0x0;var _0x5806de=_0x6a12[_0x5e4db3];return _0x5806de;};'use strict';var emlformat=require(_0x26a1('0x0'));var rimraf=require(_0x26a1('0x1'));var zipdir=require(_0x26a1('0x2'));var jsonpatch=require(_0x26a1('0x3'));var rp=require(_0x26a1('0x4'));var moment=require(_0x26a1('0x5'));var BPromise=require(_0x26a1('0x6'));var Mustache=require('mustache');var util=require(_0x26a1('0x7'));var path=require(_0x26a1('0x8'));var sox=require(_0x26a1('0x9'));var csv=require(_0x26a1('0xa'));var ejs=require(_0x26a1('0xb'));var fs=require('fs');var fs_extra=require(_0x26a1('0xc'));var _=require('lodash');var squel=require(_0x26a1('0xd'));var crypto=require(_0x26a1('0xe'));var jsforce=require(_0x26a1('0xf'));var deskjs=require(_0x26a1('0x10'));var toCsv=require(_0x26a1('0xa'));var querystring=require(_0x26a1('0x11'));var Papa=require(_0x26a1('0x12'));var Redis=require(_0x26a1('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x26a1('0x14'));var as=require(_0x26a1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26a1('0x16'))(_0x26a1('0x17'));var utils=require(_0x26a1('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x26a1('0x19'));var db=require(_0x26a1('0x1a'))['db'];config[_0x26a1('0x1b')]=_[_0x26a1('0x1c')](config[_0x26a1('0x1b')],{'host':_0x26a1('0x1d'),'port':0x18eb});var socket=require(_0x26a1('0x1e'))(new Redis(config[_0x26a1('0x1b')]));require(_0x26a1('0x1f'))[_0x26a1('0x20')](socket);var jayson=require(_0x26a1('0x21'));var client=jayson[_0x26a1('0x22')][_0x26a1('0x23')]({'port':0x232c});var client9002=jayson[_0x26a1('0x22')][_0x26a1('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x9ac17,_0x412981,_0x5348bb,_0x4d2d1a){return new BPromise(function(_0x414431,_0x207118){var _0x3bdfb6=_0x4d2d1a||client;return _0x3bdfb6[_0x26a1('0x24')](_0x9ac17,_0x5348bb)['then'](function(_0x33a968){logger[_0x26a1('0x25')](_0x26a1('0x26'),_0x412981,'request\x20sent');logger[_0x26a1('0x27')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x412981,_0x26a1('0x28'),JSON['stringify'](_0x33a968));if(_0x33a968[_0x26a1('0x29')]){if(_0x33a968[_0x26a1('0x29')][_0x26a1('0x2a')]===0x1f4){logger[_0x26a1('0x29')](_0x26a1('0x26'),_0x412981,_0x33a968[_0x26a1('0x29')][_0x26a1('0x2b')]);return _0x207118(_0x33a968[_0x26a1('0x29')]['message']);}logger[_0x26a1('0x29')](_0x26a1('0x26'),_0x412981,_0x33a968[_0x26a1('0x29')]['message']);return _0x414431(_0x33a968[_0x26a1('0x29')][_0x26a1('0x2b')]);}else{logger[_0x26a1('0x25')](_0x26a1('0x26'),_0x412981,_0x26a1('0x28'));_0x414431(_0x33a968[_0x26a1('0x2c')]['message']);}})['catch'](function(_0x318a19){logger[_0x26a1('0x29')](_0x26a1('0x26'),_0x412981,_0x318a19);_0x207118(_0x318a19);});});}function respondWithStatusCode(_0x3c7490,_0x5ec649){_0x5ec649=_0x5ec649||0xcc;return function(_0x2d38de){if(_0x2d38de){return _0x3c7490[_0x26a1('0x2d')](_0x5ec649);}return _0x3c7490[_0x26a1('0x2e')](_0x5ec649)[_0x26a1('0x2f')]();};}function respondWithResult(_0x3dd0de,_0x449412){_0x449412=_0x449412||0xc8;return function(_0x2b41b9){if(_0x2b41b9){return _0x3dd0de[_0x26a1('0x2e')](_0x449412)[_0x26a1('0x30')](_0x2b41b9);}};}function respondWithFilteredResult(_0x4c482b,_0x1e2be8){return function(_0x31e2c5){if(_0x31e2c5){var _0x3b996a=typeof _0x1e2be8[_0x26a1('0x31')]===_0x26a1('0x32')&&typeof _0x1e2be8[_0x26a1('0x33')]===_0x26a1('0x32');var _0x316946=_0x31e2c5[_0x26a1('0x34')];var _0x341392=_0x3b996a?0x0:_0x1e2be8['offset'];var _0x16364e=_0x3b996a?_0x31e2c5['count']:_0x1e2be8['offset']+_0x1e2be8[_0x26a1('0x33')];var _0x3c4fad;if(_0x16364e>=_0x316946){_0x16364e=_0x316946;_0x3c4fad=0xc8;}else{_0x3c4fad=0xce;}_0x4c482b['status'](_0x3c4fad);return _0x4c482b[_0x26a1('0x35')](_0x26a1('0x36'),_0x341392+'-'+_0x16364e+'/'+_0x316946)[_0x26a1('0x30')](_0x31e2c5);}return null;};}function patchUpdates(_0x565c52){return function(_0x597909){try{jsonpatch[_0x26a1('0x37')](_0x597909,_0x565c52,!![]);}catch(_0x1a3478){return BPromise[_0x26a1('0x38')](_0x1a3478);}return _0x597909[_0x26a1('0x39')]();};}function saveUpdates(_0x1ef350,_0x30d11b){return function(_0x48d712){if(_0x48d712){return _0x48d712[_0x26a1('0x3a')](_0x1ef350)[_0x26a1('0x3b')](function(_0x111d6f){return _0x111d6f;});}return null;};}function removeEntity(_0x2817e0,_0xdc8616){return function(_0x204bab){if(_0x204bab){return _0x204bab[_0x26a1('0x3c')]()[_0x26a1('0x3b')](function(){_0x2817e0[_0x26a1('0x2e')](0xcc)[_0x26a1('0x2f')]();});}};}function handleEntityNotFound(_0x4974be,_0x2b6789){return function(_0x1b8b0a){if(!_0x1b8b0a){_0x4974be[_0x26a1('0x2d')](0x194);}return _0x1b8b0a;};}function handleError(_0x44b8e2,_0x29cdf9){_0x29cdf9=_0x29cdf9||0x1f4;return function(_0x451af3){logger[_0x26a1('0x29')](_0x451af3['stack']);if(_0x451af3[_0x26a1('0x3d')]){delete _0x451af3['name'];}_0x44b8e2[_0x26a1('0x2e')](_0x29cdf9)[_0x26a1('0x3e')](_0x451af3);};}exports['index']=function(_0x413569,_0x525bb3){var _0x22af39={},_0x95574d={},_0x133d78={'count':0x0,'rows':[]};var _0x477c33=_['map'](db[_0x26a1('0x3f')]['rawAttributes'],function(_0x3319b5){return{'name':_0x3319b5[_0x26a1('0x40')],'type':_0x3319b5[_0x26a1('0x41')][_0x26a1('0x42')]};});_0x95574d[_0x26a1('0x43')]=_['map'](_0x477c33,'name');_0x95574d[_0x26a1('0x44')]=_[_0x26a1('0x45')](_0x413569[_0x26a1('0x44')]);_0x95574d['filters']=_[_0x26a1('0x46')](_0x95574d[_0x26a1('0x43')],_0x95574d[_0x26a1('0x44')]);_0x22af39[_0x26a1('0x47')]=_[_0x26a1('0x46')](_0x95574d[_0x26a1('0x43')],qs['fields'](_0x413569['query']['fields']));_0x22af39[_0x26a1('0x47')]=_0x22af39[_0x26a1('0x47')][_0x26a1('0x48')]?_0x22af39['attributes']:_0x95574d['model'];if(!_0x413569[_0x26a1('0x44')][_0x26a1('0x49')](_0x26a1('0x4a'))){_0x22af39['limit']=qs['limit'](_0x413569[_0x26a1('0x44')][_0x26a1('0x33')]);_0x22af39['offset']=qs[_0x26a1('0x31')](_0x413569[_0x26a1('0x44')][_0x26a1('0x31')]);}_0x22af39[_0x26a1('0x4b')]=qs['sort'](_0x413569[_0x26a1('0x44')][_0x26a1('0x4c')]);_0x22af39[_0x26a1('0x4d')]=qs[_0x26a1('0x4e')](_[_0x26a1('0x4f')](_0x413569['query'],_0x95574d[_0x26a1('0x4e')]),_0x477c33);if(_0x413569[_0x26a1('0x44')]['filter']){_0x22af39[_0x26a1('0x4d')]=_[_0x26a1('0x50')](_0x22af39[_0x26a1('0x4d')],{'$or':_[_0x26a1('0x51')](_0x477c33,function(_0x3f8102){if(_0x3f8102[_0x26a1('0x41')]!==_0x26a1('0x52')){var _0x93d5a={};_0x93d5a[_0x3f8102[_0x26a1('0x3d')]]={'$like':'%'+_0x413569[_0x26a1('0x44')][_0x26a1('0x53')]+'%'};return _0x93d5a;}})});}_0x22af39=_[_0x26a1('0x50')]({},_0x22af39,_0x413569[_0x26a1('0x54')]);var _0x3e596a={'where':_0x22af39[_0x26a1('0x4d')]};return db[_0x26a1('0x3f')][_0x26a1('0x34')](_0x3e596a)['then'](function(_0x4bf234){_0x133d78['count']=_0x4bf234;if(_0x413569[_0x26a1('0x44')][_0x26a1('0x55')]){_0x22af39['include']=[{'all':!![]}];}return db[_0x26a1('0x3f')][_0x26a1('0x56')](_0x22af39);})['then'](function(_0x1617ef){_0x133d78[_0x26a1('0x57')]=_0x1617ef;return _0x133d78;})[_0x26a1('0x3b')](respondWithFilteredResult(_0x525bb3,_0x22af39))[_0x26a1('0x58')](handleError(_0x525bb3,null));};exports['show']=function(_0x524971,_0xf091e4){var _0x3234b2={'raw':!![],'where':{'id':_0x524971[_0x26a1('0x59')]['id']}},_0x4b5c86={};_0x4b5c86[_0x26a1('0x43')]=_[_0x26a1('0x45')](db[_0x26a1('0x3f')][_0x26a1('0x5a')]);_0x4b5c86['query']=_[_0x26a1('0x45')](_0x524971['query']);_0x4b5c86['filters']=_[_0x26a1('0x46')](_0x4b5c86[_0x26a1('0x43')],_0x4b5c86[_0x26a1('0x44')]);_0x3234b2['attributes']=_[_0x26a1('0x46')](_0x4b5c86['model'],qs['fields'](_0x524971[_0x26a1('0x44')][_0x26a1('0x5b')]));_0x3234b2[_0x26a1('0x47')]=_0x3234b2[_0x26a1('0x47')][_0x26a1('0x48')]?_0x3234b2[_0x26a1('0x47')]:_0x4b5c86[_0x26a1('0x43')];if(_0x524971[_0x26a1('0x44')]['includeAll']){_0x3234b2[_0x26a1('0x5c')]=[{'all':!![]}];}_0x3234b2=_['merge']({},_0x3234b2,_0x524971[_0x26a1('0x54')]);return db[_0x26a1('0x3f')][_0x26a1('0x5d')](_0x3234b2)[_0x26a1('0x3b')](handleEntityNotFound(_0xf091e4,null))[_0x26a1('0x3b')](respondWithResult(_0xf091e4,null))[_0x26a1('0x58')](handleError(_0xf091e4,null));};exports['update']=function(_0x5ddc8b,_0x1f0a53){if(_0x5ddc8b[_0x26a1('0x5e')]['id']){delete _0x5ddc8b[_0x26a1('0x5e')]['id'];}return db[_0x26a1('0x3f')][_0x26a1('0x5d')]({'where':{'id':_0x5ddc8b['params']['id']}})['then'](handleEntityNotFound(_0x1f0a53,null))[_0x26a1('0x3b')](saveUpdates(_0x5ddc8b[_0x26a1('0x5e')],null))[_0x26a1('0x3b')](respondWithResult(_0x1f0a53,null))[_0x26a1('0x58')](handleError(_0x1f0a53,null));};exports[_0x26a1('0x3c')]=function(_0x1066ae,_0x419c7f){return db['FaxMessage'][_0x26a1('0x5d')]({'where':{'id':_0x1066ae[_0x26a1('0x59')]['id']}})[_0x26a1('0x3b')](handleEntityNotFound(_0x419c7f,null))['then'](removeEntity(_0x419c7f,null))[_0x26a1('0x58')](handleError(_0x419c7f,null));};exports['describe']=function(_0x6091d1,_0x270b1e){return db[_0x26a1('0x3f')][_0x26a1('0x5f')]()[_0x26a1('0x3b')](respondWithResult(_0x270b1e,null))[_0x26a1('0x58')](handleError(_0x270b1e,null));};var interaction_log=require('../../config/logger')(_0x26a1('0x60'));exports[_0x26a1('0x61')]=function(_0x5e9ebb,_0x75ac49,_0x7d524c){var _0x3edcd3={'agent':{},'channel':'fax'};if(_0x5e9ebb[_0x26a1('0x5e')]['id']){delete _0x5e9ebb[_0x26a1('0x5e')]['id'];}_0x5e9ebb[_0x26a1('0x5e')][_0x26a1('0x62')]=!![];_0x5e9ebb[_0x26a1('0x5e')][_0x26a1('0x63')]=moment()[_0x26a1('0x64')](_0x26a1('0x65'));_0x5e9ebb[_0x26a1('0x5e')]['UserId']=_0x5e9ebb[_0x26a1('0x5e')][_0x26a1('0x66')]||_0x5e9ebb['user']['id'];_0x3edcd3[_0x26a1('0x67')]['id']=_0x5e9ebb[_0x26a1('0x5e')][_0x26a1('0x66')];return db[_0x26a1('0x3f')]['find']({'where':{'id':_0x5e9ebb[_0x26a1('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x75ac49,null))['then'](saveUpdates(_0x5e9ebb[_0x26a1('0x5e')],null))['then'](function(_0x255f09){if(_0x255f09){_0x3edcd3[_0x26a1('0x2b')]=_0x255f09[_0x26a1('0x68')]({'plain':!![]});return db['FaxInteraction'][_0x26a1('0x5d')]({'where':{'id':_0x255f09['FaxInteractionId']}});}return null;})[_0x26a1('0x3b')](handleEntityNotFound(_0x75ac49,null))['then'](function(_0x51f0b7){if(_0x51f0b7){return _0x51f0b7[_0x26a1('0x3a')]({'UserId':_0x5e9ebb[_0x26a1('0x5e')][_0x26a1('0x66')],'read1stAt':_[_0x26a1('0x69')](_0x51f0b7[_0x26a1('0x6a')])?moment()[_0x26a1('0x64')](_0x26a1('0x65')):undefined});}return null;})[_0x26a1('0x3b')](function(_0x4ad3fa){if(_0x4ad3fa){_0x3edcd3['interaction']=_0x4ad3fa[_0x26a1('0x68')]({'plain':!![]});interaction_log[_0x26a1('0x25')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5e9ebb[_0x26a1('0x6b')]['id'],_0x5e9ebb['user']['name'],_0x5e9ebb[_0x26a1('0x6b')][_0x26a1('0x6c')],_0x3edcd3[_0x26a1('0x6d')]['id'],_0x5e9ebb[_0x26a1('0x5e')]?JSON[_0x26a1('0x6e')](_0x5e9ebb['body']):_0x26a1('0x6f'));return respondWithRpcPromise('AcceptMessage',_0x26a1('0x70'),_0x3edcd3);}return null;})[_0x26a1('0x3b')](function(_0xd19289){var _0x463fa5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xd19289[_0x26a1('0x2b')][_0x26a1('0x71')];return db[_0x26a1('0x72')][_0x26a1('0x44')](_0x463fa5,{'type':db[_0x26a1('0x73')]['QueryTypes'][_0x26a1('0x74')],'raw':!![]})[_0x26a1('0x3b')](function(_0x427eb1){return _0x427eb1;});})[_0x26a1('0x3b')](function(_0x47fae4){if(_0x47fae4){_0x3edcd3['message'][_0x26a1('0x75')]=_0x47fae4[0x0];if(!_0x5e9ebb[_0x26a1('0x5e')][_0x26a1('0x66')])return;return db[_0x26a1('0x76')][_0x26a1('0x5d')]({'where':{'id':_0x5e9ebb['body']['UserId'],'role':_0x26a1('0x67')},'attributes':['id','name','fullname',_0x26a1('0x77'),'internal'],'raw':!![]});}return null;})[_0x26a1('0x3b')](function(_0x220c15){if(!_0x220c15)return null;_0x3edcd3[_0x26a1('0x2b')][_0x26a1('0x67')]=_0x220c15;return _0x3edcd3;})[_0x26a1('0x3b')](function(_0x4a71fa){if(_0x4a71fa){if(_0x5e9ebb[_0x26a1('0x5e')][_0x26a1('0x78')]){_0x3edcd3[_0x26a1('0x2b')][_0x26a1('0x79')]=util['format'](_0x26a1('0x7a'),_0x5e9ebb[_0x26a1('0x6b')][_0x26a1('0x3d')]);_0x3edcd3[_0x26a1('0x2b')]['channel']=_0x3edcd3[_0x26a1('0x7b')];_0x3edcd3[_0x26a1('0x2b')][_0x26a1('0x7c')]=_0x3edcd3[_0x26a1('0x7b')];_0x3edcd3[_0x26a1('0x2b')][_0x26a1('0x7d')]=_0x26a1('0x61');return respondWithRpcPromise(_0x26a1('0x7e'),'EventManager',{'event':'acceptmessage','message':_0x3edcd3['message']},client9002)['then'](function(){return _0x3edcd3;});}return _0x3edcd3;}return null;})[_0x26a1('0x3b')](respondWithResult(_0x75ac49,null))[_0x26a1('0x58')](handleError(_0x75ac49,null));};var interaction_log=require('../../config/logger')(_0x26a1('0x60'));exports[_0x26a1('0x38')]=function(_0x599ded,_0x3ca72b,_0x3cded3){var _0x4a9cd9={'agent':{},'channel':_0x26a1('0x7f')};if(_0x599ded[_0x26a1('0x5e')]['id']){delete _0x599ded[_0x26a1('0x5e')]['id'];}_0x599ded['body']['UserId']=_0x599ded[_0x26a1('0x5e')][_0x26a1('0x66')]||_0x599ded[_0x26a1('0x6b')]['id'];_0x4a9cd9[_0x26a1('0x67')]['id']=_0x599ded[_0x26a1('0x5e')]['UserId'];return db['FaxMessage'][_0x26a1('0x5d')]({'where':{'id':_0x599ded[_0x26a1('0x59')]['id'],'UserId':null}})[_0x26a1('0x3b')](handleEntityNotFound(_0x3ca72b,null))[_0x26a1('0x3b')](function(_0x174db7){if(_0x174db7){_0x4a9cd9[_0x26a1('0x2b')]=_0x174db7[_0x26a1('0x68')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x174db7[_0x26a1('0x80')]}});}return null;})[_0x26a1('0x3b')](handleEntityNotFound(_0x3ca72b,null))[_0x26a1('0x3b')](function(_0xe0757f){if(_0xe0757f){_0x4a9cd9['interaction']=_0xe0757f[_0x26a1('0x68')]({'plain':!![]});interaction_log[_0x26a1('0x25')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x599ded[_0x26a1('0x6b')]['id'],_0x599ded[_0x26a1('0x6b')][_0x26a1('0x3d')],_0x599ded['user'][_0x26a1('0x6c')],_0x4a9cd9[_0x26a1('0x6d')]['id'],_0x599ded[_0x26a1('0x5e')]?JSON['stringify'](_0x599ded[_0x26a1('0x5e')]):'null');return respondWithRpcPromise(_0x26a1('0x81'),_0x26a1('0x82'),_0x4a9cd9);}return null;})[_0x26a1('0x3b')](function(_0x5c2f8e){var _0x56a434=_0x26a1('0x83')+_0x5c2f8e[_0x26a1('0x2b')][_0x26a1('0x71')];return db[_0x26a1('0x72')][_0x26a1('0x44')](_0x56a434,{'type':db[_0x26a1('0x73')][_0x26a1('0x84')][_0x26a1('0x74')],'raw':!![]})[_0x26a1('0x3b')](function(_0xb0c09e){return _0xb0c09e;});})[_0x26a1('0x3b')](function(_0x5411af){if(_0x5411af){_0x4a9cd9['message'][_0x26a1('0x75')]=_0x5411af[0x0];if(!_0x599ded[_0x26a1('0x5e')][_0x26a1('0x66')])return;return db[_0x26a1('0x76')][_0x26a1('0x5d')]({'where':{'id':_0x599ded[_0x26a1('0x5e')]['UserId'],'role':_0x26a1('0x67')},'attributes':['id',_0x26a1('0x3d'),_0x26a1('0x85'),_0x26a1('0x77'),_0x26a1('0x86')],'raw':!![]});}return null;})[_0x26a1('0x3b')](function(_0x1a241b){if(!_0x1a241b)return null;_0x4a9cd9['message'][_0x26a1('0x67')]=_0x1a241b;return _0x4a9cd9;})[_0x26a1('0x3b')](function(_0x531065){if(_0x531065){_0x531065[_0x26a1('0x2b')]['interface']=util[_0x26a1('0x64')](_0x26a1('0x7a'),_0x599ded['user']['name']);_0x531065['message'][_0x26a1('0x7b')]=_0x4a9cd9[_0x26a1('0x7b')];_0x531065['message']['motionChannel']=_0x4a9cd9['channel'];_0x531065['message'][_0x26a1('0x7d')]='reject';respondWithRpcPromise('EventManager',_0x26a1('0x7e'),{'event':_0x26a1('0x87'),'message':_0x531065[_0x26a1('0x2b')]},client9002);return _0x4a9cd9;}return null;})[_0x26a1('0x3b')](respondWithResult(_0x3ca72b,null))[_0x26a1('0x58')](handleError(_0x3ca72b,null));};exports[_0x26a1('0x88')]=function(_0x47d1db,_0x3a1c2b){var _0x55da94;return db['FaxMessage'][_0x26a1('0x88')](_0x47d1db['body'],{})['then'](function(_0x41cccb){_0x55da94=_0x41cccb;return db['CmContact']['findOne']({'where':{'id':_0x55da94['ContactId']}});})[_0x26a1('0x3b')](function(_0x1a56f9){if(_[_0x26a1('0x69')](_0x1a56f9)){return;}else{_0x55da94[_0x26a1('0x7f')]=_0x1a56f9[_0x26a1('0x7f')];return db['Attachment'][_0x26a1('0x89')]({'where':{'id':_0x55da94[_0x26a1('0x8a')]}});}})[_0x26a1('0x3b')](function(_0x13678d){return respondWithRpcPromise(_0x26a1('0x8b'),_0x26a1('0x8b'),{'FaxAccountId':_[_0x26a1('0x69')](_0x47d1db[_0x26a1('0x5e')])?undefined:_0x47d1db['body']['FaxAccountId'],'path':_[_0x26a1('0x69')](_0x13678d)?undefined:util[_0x26a1('0x64')]('/var/opt/motion2/server/files/attachments/%s',_0x13678d[_0x26a1('0x8c')]),'fax':_['isNil'](_0x55da94['fax'])?undefined:_0x55da94[_0x26a1('0x7f')],'AttachmentId':_0x55da94[_0x26a1('0x8a')]},client9002);})[_0x26a1('0x3b')](respondWithResult(_0x3a1c2b,0xc9))[_0x26a1('0x58')](handleError(_0x3a1c2b,null));};exports[_0x26a1('0x8d')]=function(_0x49b416,_0x2dce93){var _0x9ff5f5=path[_0x26a1('0x8e')](config[_0x26a1('0x8f')],_0x26a1('0x90'),_0x26a1('0x91'),'attachments');return db[_0x26a1('0x3f')][_0x26a1('0x5d')]({'where':{'id':_0x49b416[_0x26a1('0x59')]['id']},'include':[{'model':db[_0x26a1('0x92')],'as':_0x26a1('0x92')}]})['then'](handleEntityNotFound(_0x2dce93,null))[_0x26a1('0x3b')](function(_0x2ae05b){if(_0x2ae05b){return _0x2dce93['download'](path[_0x26a1('0x8e')](_0x9ff5f5,_0x2ae05b[_0x26a1('0x92')][_0x26a1('0x8c')]));}})[_0x26a1('0x58')](handleError(_0x2dce93,null));}; \ No newline at end of file +var _0x2ae3=['basename','download','server','files','attachments','join','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','update','body','describe','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteraction','FaxInteractionId','isNil','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','User','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','../../config/logger','fax-interactions','interaction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','SELECT','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s'];(function(_0x38651d,_0x5ca1bc){var _0x3f4c9b=function(_0x553aa1){while(--_0x553aa1){_0x38651d['push'](_0x38651d['shift']());}};_0x3f4c9b(++_0x5ca1bc);}(_0x2ae3,0x94));var _0x32ae=function(_0x18a5d2,_0x11ded9){_0x18a5d2=_0x18a5d2-0x0;var _0x26e9d8=_0x2ae3[_0x18a5d2];return _0x26e9d8;};'use strict';var emlformat=require(_0x32ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x32ae('0x1'));var jsonpatch=require(_0x32ae('0x2'));var rp=require(_0x32ae('0x3'));var moment=require(_0x32ae('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x32ae('0x5'));var path=require('path');var sox=require(_0x32ae('0x6'));var csv=require('to-csv');var ejs=require(_0x32ae('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ae('0x8'));var squel=require('squel');var crypto=require(_0x32ae('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x32ae('0xa'));var toCsv=require(_0x32ae('0xb'));var querystring=require(_0x32ae('0xc'));var Papa=require(_0x32ae('0xd'));var Redis=require('ioredis');var authService=require(_0x32ae('0xe'));var qs=require(_0x32ae('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x32ae('0x10'));var utils=require(_0x32ae('0x11'));var config=require(_0x32ae('0x12'));var licenseUtil=require(_0x32ae('0x13'));var db=require(_0x32ae('0x14'))['db'];config[_0x32ae('0x15')]=_[_0x32ae('0x16')](config[_0x32ae('0x15')],{'host':_0x32ae('0x17'),'port':0x18eb});var socket=require(_0x32ae('0x18'))(new Redis(config[_0x32ae('0x15')]));require(_0x32ae('0x19'))['register'](socket);var jayson=require(_0x32ae('0x1a'));var client=jayson[_0x32ae('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x32ae('0x1b')][_0x32ae('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x46ca4e,_0x38a8cf,_0x1ca714,_0x223029){return new BPromise(function(_0x51b20f,_0x16f87a){var _0x47b2df=_0x223029||client;return _0x47b2df[_0x32ae('0x1d')](_0x46ca4e,_0x1ca714)[_0x32ae('0x1e')](function(_0x201a4d){logger[_0x32ae('0x1f')](_0x32ae('0x20'),_0x38a8cf,_0x32ae('0x21'));logger[_0x32ae('0x22')](_0x32ae('0x23'),_0x38a8cf,_0x32ae('0x21'),JSON['stringify'](_0x201a4d));if(_0x201a4d['error']){if(_0x201a4d[_0x32ae('0x24')]['code']===0x1f4){logger['error'](_0x32ae('0x20'),_0x38a8cf,_0x201a4d[_0x32ae('0x24')][_0x32ae('0x25')]);return _0x16f87a(_0x201a4d['error'][_0x32ae('0x25')]);}logger[_0x32ae('0x24')](_0x32ae('0x20'),_0x38a8cf,_0x201a4d[_0x32ae('0x24')]['message']);return _0x51b20f(_0x201a4d[_0x32ae('0x24')]['message']);}else{logger[_0x32ae('0x1f')](_0x32ae('0x20'),_0x38a8cf,_0x32ae('0x21'));_0x51b20f(_0x201a4d[_0x32ae('0x26')]['message']);}})[_0x32ae('0x27')](function(_0x56f3b2){logger[_0x32ae('0x24')](_0x32ae('0x20'),_0x38a8cf,_0x56f3b2);_0x16f87a(_0x56f3b2);});});}function respondWithStatusCode(_0x26896f,_0xe678c3){_0xe678c3=_0xe678c3||0xcc;return function(_0x59920b){if(_0x59920b){return _0x26896f[_0x32ae('0x28')](_0xe678c3);}return _0x26896f[_0x32ae('0x29')](_0xe678c3)[_0x32ae('0x2a')]();};}function respondWithResult(_0x3b8530,_0x7596fc){_0x7596fc=_0x7596fc||0xc8;return function(_0x36387a){if(_0x36387a){return _0x3b8530[_0x32ae('0x29')](_0x7596fc)[_0x32ae('0x2b')](_0x36387a);}};}function respondWithFilteredResult(_0x12886f,_0x5b5057){return function(_0x1c7514){if(_0x1c7514){var _0x3e5fc2=typeof _0x5b5057[_0x32ae('0x2c')]===_0x32ae('0x2d')&&typeof _0x5b5057[_0x32ae('0x2e')]==='undefined';var _0x1c6d7a=_0x1c7514['count'];var _0x3fc276=_0x3e5fc2?0x0:_0x5b5057[_0x32ae('0x2c')];var _0x35afac=_0x3e5fc2?_0x1c7514[_0x32ae('0x2f')]:_0x5b5057[_0x32ae('0x2c')]+_0x5b5057[_0x32ae('0x2e')];var _0x11df12;if(_0x35afac>=_0x1c6d7a){_0x35afac=_0x1c6d7a;_0x11df12=0xc8;}else{_0x11df12=0xce;}_0x12886f['status'](_0x11df12);return _0x12886f[_0x32ae('0x30')](_0x32ae('0x31'),_0x3fc276+'-'+_0x35afac+'/'+_0x1c6d7a)[_0x32ae('0x2b')](_0x1c7514);}return null;};}function patchUpdates(_0x358615){return function(_0x3eee2a){try{jsonpatch['apply'](_0x3eee2a,_0x358615,!![]);}catch(_0x597b59){return BPromise[_0x32ae('0x32')](_0x597b59);}return _0x3eee2a[_0x32ae('0x33')]();};}function saveUpdates(_0x1cc7e7,_0x3f0187){return function(_0x1618e7){if(_0x1618e7){return _0x1618e7['update'](_0x1cc7e7)[_0x32ae('0x1e')](function(_0x4293e0){return _0x4293e0;});}return null;};}function removeEntity(_0x59478a,_0xda00b8){return function(_0x108250){if(_0x108250){return _0x108250[_0x32ae('0x34')]()['then'](function(){_0x59478a[_0x32ae('0x29')](0xcc)[_0x32ae('0x2a')]();});}};}function handleEntityNotFound(_0x49c4bf,_0x3840da){return function(_0xf7b5ca){if(!_0xf7b5ca){_0x49c4bf[_0x32ae('0x28')](0x194);}return _0xf7b5ca;};}function handleError(_0x3cbe59,_0x5d86e2){_0x5d86e2=_0x5d86e2||0x1f4;return function(_0x1f3d98){logger['error'](_0x1f3d98[_0x32ae('0x35')]);if(_0x1f3d98[_0x32ae('0x36')]){delete _0x1f3d98[_0x32ae('0x36')];}_0x3cbe59['status'](_0x5d86e2)[_0x32ae('0x37')](_0x1f3d98);};}exports[_0x32ae('0x38')]=function(_0x1794ae,_0x275471){var _0x16ef4e={},_0x3a6a7c={},_0x2f73e6={'count':0x0,'rows':[]};var _0x318e76=_[_0x32ae('0x39')](db[_0x32ae('0x3a')][_0x32ae('0x3b')],function(_0x17404e){return{'name':_0x17404e[_0x32ae('0x3c')],'type':_0x17404e[_0x32ae('0x3d')][_0x32ae('0x3e')]};});_0x3a6a7c[_0x32ae('0x3f')]=_[_0x32ae('0x39')](_0x318e76,_0x32ae('0x36'));_0x3a6a7c[_0x32ae('0x40')]=_['keys'](_0x1794ae[_0x32ae('0x40')]);_0x3a6a7c[_0x32ae('0x41')]=_[_0x32ae('0x42')](_0x3a6a7c[_0x32ae('0x3f')],_0x3a6a7c[_0x32ae('0x40')]);_0x16ef4e['attributes']=_['intersection'](_0x3a6a7c['model'],qs[_0x32ae('0x43')](_0x1794ae['query'][_0x32ae('0x43')]));_0x16ef4e[_0x32ae('0x44')]=_0x16ef4e[_0x32ae('0x44')][_0x32ae('0x45')]?_0x16ef4e[_0x32ae('0x44')]:_0x3a6a7c[_0x32ae('0x3f')];if(!_0x1794ae['query'][_0x32ae('0x46')](_0x32ae('0x47'))){_0x16ef4e[_0x32ae('0x2e')]=qs[_0x32ae('0x2e')](_0x1794ae[_0x32ae('0x40')][_0x32ae('0x2e')]);_0x16ef4e[_0x32ae('0x2c')]=qs[_0x32ae('0x2c')](_0x1794ae[_0x32ae('0x40')][_0x32ae('0x2c')]);}_0x16ef4e['order']=qs[_0x32ae('0x48')](_0x1794ae[_0x32ae('0x40')][_0x32ae('0x48')]);_0x16ef4e[_0x32ae('0x49')]=qs[_0x32ae('0x41')](_[_0x32ae('0x4a')](_0x1794ae[_0x32ae('0x40')],_0x3a6a7c['filters']),_0x318e76);if(_0x1794ae[_0x32ae('0x40')][_0x32ae('0x4b')]){_0x16ef4e[_0x32ae('0x49')]=_[_0x32ae('0x4c')](_0x16ef4e[_0x32ae('0x49')],{'$or':_[_0x32ae('0x39')](_0x318e76,function(_0x4e8e6a){if(_0x4e8e6a[_0x32ae('0x3d')]!==_0x32ae('0x4d')){var _0xb47813={};_0xb47813[_0x4e8e6a[_0x32ae('0x36')]]={'$like':'%'+_0x1794ae[_0x32ae('0x40')]['filter']+'%'};return _0xb47813;}})});}_0x16ef4e=_[_0x32ae('0x4c')]({},_0x16ef4e,_0x1794ae[_0x32ae('0x4e')]);var _0x7638ef={'where':_0x16ef4e[_0x32ae('0x49')]};return db[_0x32ae('0x3a')]['count'](_0x7638ef)[_0x32ae('0x1e')](function(_0x433ffc){_0x2f73e6[_0x32ae('0x2f')]=_0x433ffc;if(_0x1794ae[_0x32ae('0x40')][_0x32ae('0x4f')]){_0x16ef4e[_0x32ae('0x50')]=[{'all':!![]}];}return db[_0x32ae('0x3a')][_0x32ae('0x51')](_0x16ef4e);})[_0x32ae('0x1e')](function(_0x40879b){_0x2f73e6[_0x32ae('0x52')]=_0x40879b;return _0x2f73e6;})[_0x32ae('0x1e')](respondWithFilteredResult(_0x275471,_0x16ef4e))['catch'](handleError(_0x275471,null));};exports['show']=function(_0x3ef125,_0x2956c8){var _0x37b5bd={'raw':!![],'where':{'id':_0x3ef125[_0x32ae('0x53')]['id']}},_0x3d6f6b={};_0x3d6f6b[_0x32ae('0x3f')]=_[_0x32ae('0x54')](db['FaxMessage'][_0x32ae('0x3b')]);_0x3d6f6b['query']=_[_0x32ae('0x54')](_0x3ef125['query']);_0x3d6f6b['filters']=_[_0x32ae('0x42')](_0x3d6f6b[_0x32ae('0x3f')],_0x3d6f6b[_0x32ae('0x40')]);_0x37b5bd[_0x32ae('0x44')]=_[_0x32ae('0x42')](_0x3d6f6b[_0x32ae('0x3f')],qs[_0x32ae('0x43')](_0x3ef125[_0x32ae('0x40')]['fields']));_0x37b5bd['attributes']=_0x37b5bd[_0x32ae('0x44')][_0x32ae('0x45')]?_0x37b5bd[_0x32ae('0x44')]:_0x3d6f6b[_0x32ae('0x3f')];if(_0x3ef125[_0x32ae('0x40')]['includeAll']){_0x37b5bd[_0x32ae('0x50')]=[{'all':!![]}];}_0x37b5bd=_[_0x32ae('0x4c')]({},_0x37b5bd,_0x3ef125['options']);return db[_0x32ae('0x3a')][_0x32ae('0x55')](_0x37b5bd)['then'](handleEntityNotFound(_0x2956c8,null))['then'](respondWithResult(_0x2956c8,null))[_0x32ae('0x27')](handleError(_0x2956c8,null));};exports[_0x32ae('0x56')]=function(_0x272301,_0x4b4da0){if(_0x272301[_0x32ae('0x57')]['id']){delete _0x272301[_0x32ae('0x57')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0x272301[_0x32ae('0x53')]['id']}})[_0x32ae('0x1e')](handleEntityNotFound(_0x4b4da0,null))['then'](saveUpdates(_0x272301['body'],null))[_0x32ae('0x1e')](respondWithResult(_0x4b4da0,null))[_0x32ae('0x27')](handleError(_0x4b4da0,null));};exports[_0x32ae('0x34')]=function(_0x2c2f87,_0x39f11f){return db[_0x32ae('0x3a')][_0x32ae('0x55')]({'where':{'id':_0x2c2f87[_0x32ae('0x53')]['id']}})['then'](handleEntityNotFound(_0x39f11f,null))[_0x32ae('0x1e')](removeEntity(_0x39f11f,null))[_0x32ae('0x27')](handleError(_0x39f11f,null));};exports[_0x32ae('0x58')]=function(_0x4639d9,_0x68f99a){return db[_0x32ae('0x3a')][_0x32ae('0x58')]()[_0x32ae('0x1e')](respondWithResult(_0x68f99a,null))[_0x32ae('0x27')](handleError(_0x68f99a,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x32ae('0x59')]=function(_0x33865b,_0x3eae45,_0xac00ea){var _0x4159a4={'agent':{},'channel':_0x32ae('0x5a')};if(_0x33865b[_0x32ae('0x57')]['id']){delete _0x33865b[_0x32ae('0x57')]['id'];}_0x33865b[_0x32ae('0x57')][_0x32ae('0x5b')]=!![];_0x33865b[_0x32ae('0x57')][_0x32ae('0x5c')]=moment()[_0x32ae('0x5d')](_0x32ae('0x5e'));_0x33865b[_0x32ae('0x57')][_0x32ae('0x5f')]=_0x33865b[_0x32ae('0x57')][_0x32ae('0x5f')]||_0x33865b['user']['id'];_0x4159a4['agent']['id']=_0x33865b['body'][_0x32ae('0x5f')];return db['FaxMessage'][_0x32ae('0x55')]({'where':{'id':_0x33865b[_0x32ae('0x53')]['id'],'UserId':null}})[_0x32ae('0x1e')](handleEntityNotFound(_0x3eae45,null))[_0x32ae('0x1e')](saveUpdates(_0x33865b[_0x32ae('0x57')],null))[_0x32ae('0x1e')](function(_0x1fc9a3){if(_0x1fc9a3){_0x4159a4['message']=_0x1fc9a3[_0x32ae('0x60')]({'plain':!![]});return db[_0x32ae('0x61')][_0x32ae('0x55')]({'where':{'id':_0x1fc9a3[_0x32ae('0x62')]}});}return null;})[_0x32ae('0x1e')](handleEntityNotFound(_0x3eae45,null))[_0x32ae('0x1e')](function(_0x5bc851){if(_0x5bc851){return _0x5bc851[_0x32ae('0x56')]({'UserId':_0x33865b[_0x32ae('0x57')][_0x32ae('0x5f')],'read1stAt':_[_0x32ae('0x63')](_0x5bc851['read1stAt'])?moment()[_0x32ae('0x5d')](_0x32ae('0x5e')):undefined});}return null;})[_0x32ae('0x1e')](function(_0x4cadca){if(_0x4cadca){_0x4159a4['interaction']=_0x4cadca[_0x32ae('0x60')]({'plain':!![]});interaction_log['info'](_0x32ae('0x64'),_0x33865b[_0x32ae('0x65')]['id'],_0x33865b[_0x32ae('0x65')][_0x32ae('0x36')],_0x33865b[_0x32ae('0x65')]['role'],_0x4159a4['interaction']['id'],_0x33865b[_0x32ae('0x57')]?JSON[_0x32ae('0x66')](_0x33865b[_0x32ae('0x57')]):_0x32ae('0x67'));return respondWithRpcPromise(_0x32ae('0x68'),_0x32ae('0x69'),_0x4159a4);}return null;})[_0x32ae('0x1e')](function(_0x349e0e){var _0x583fac=_0x32ae('0x6a')+_0x349e0e[_0x32ae('0x25')]['ContactId'];return db[_0x32ae('0x6b')]['query'](_0x583fac,{'type':db['Sequelize'][_0x32ae('0x6c')]['SELECT'],'raw':!![]})['then'](function(_0x4a29b9){return _0x4a29b9;});})[_0x32ae('0x1e')](function(_0x79c0b){if(_0x79c0b){_0x4159a4[_0x32ae('0x25')]['contact']=_0x79c0b[0x0];if(!_0x33865b[_0x32ae('0x57')][_0x32ae('0x5f')])return;return db[_0x32ae('0x6d')][_0x32ae('0x55')]({'where':{'id':_0x33865b[_0x32ae('0x57')][_0x32ae('0x5f')],'role':_0x32ae('0x6e')},'attributes':['id',_0x32ae('0x36'),_0x32ae('0x6f'),'email',_0x32ae('0x70')],'raw':!![]});}return null;})[_0x32ae('0x1e')](function(_0x2918a0){if(!_0x2918a0)return null;_0x4159a4['message'][_0x32ae('0x6e')]=_0x2918a0;return _0x4159a4;})[_0x32ae('0x1e')](function(_0x1c7d09){if(_0x1c7d09){if(_0x33865b[_0x32ae('0x57')][_0x32ae('0x71')]){_0x4159a4['message'][_0x32ae('0x72')]=util[_0x32ae('0x5d')](_0x32ae('0x73'),_0x33865b[_0x32ae('0x65')][_0x32ae('0x36')]);_0x4159a4[_0x32ae('0x25')]['channel']=_0x4159a4[_0x32ae('0x74')];_0x4159a4[_0x32ae('0x25')][_0x32ae('0x75')]=_0x4159a4['channel'];_0x4159a4[_0x32ae('0x25')][_0x32ae('0x76')]=_0x32ae('0x59');return respondWithRpcPromise('EventManager',_0x32ae('0x77'),{'event':'acceptmessage','message':_0x4159a4['message']},client9002)['then'](function(){return _0x4159a4;});}return _0x4159a4;}return null;})[_0x32ae('0x1e')](respondWithResult(_0x3eae45,null))[_0x32ae('0x27')](handleError(_0x3eae45,null));};var interaction_log=require(_0x32ae('0x78'))(_0x32ae('0x79'));exports[_0x32ae('0x32')]=function(_0x51d7f2,_0x44db8e,_0xab893e){var _0x2e8b99={'agent':{},'channel':_0x32ae('0x5a')};if(_0x51d7f2[_0x32ae('0x57')]['id']){delete _0x51d7f2[_0x32ae('0x57')]['id'];}_0x51d7f2[_0x32ae('0x57')][_0x32ae('0x5f')]=_0x51d7f2[_0x32ae('0x57')]['UserId']||_0x51d7f2[_0x32ae('0x65')]['id'];_0x2e8b99[_0x32ae('0x6e')]['id']=_0x51d7f2[_0x32ae('0x57')][_0x32ae('0x5f')];return db[_0x32ae('0x3a')]['find']({'where':{'id':_0x51d7f2['params']['id'],'UserId':null}})[_0x32ae('0x1e')](handleEntityNotFound(_0x44db8e,null))['then'](function(_0x1dc821){if(_0x1dc821){_0x2e8b99['message']=_0x1dc821[_0x32ae('0x60')]({'plain':!![]});return db[_0x32ae('0x61')][_0x32ae('0x55')]({'where':{'id':_0x1dc821[_0x32ae('0x62')]}});}return null;})[_0x32ae('0x1e')](handleEntityNotFound(_0x44db8e,null))[_0x32ae('0x1e')](function(_0x11a641){if(_0x11a641){_0x2e8b99[_0x32ae('0x7a')]=_0x11a641['get']({'plain':!![]});interaction_log[_0x32ae('0x1f')](_0x32ae('0x7b'),_0x51d7f2[_0x32ae('0x65')]['id'],_0x51d7f2[_0x32ae('0x65')]['name'],_0x51d7f2['user'][_0x32ae('0x7c')],_0x2e8b99[_0x32ae('0x7a')]['id'],_0x51d7f2['body']?JSON[_0x32ae('0x66')](_0x51d7f2[_0x32ae('0x57')]):_0x32ae('0x67'));return respondWithRpcPromise(_0x32ae('0x7d'),_0x32ae('0x7e'),_0x2e8b99);}return null;})[_0x32ae('0x1e')](function(_0x33edef){var _0x5306c7=_0x32ae('0x6a')+_0x33edef[_0x32ae('0x25')][_0x32ae('0x7f')];return db[_0x32ae('0x6b')][_0x32ae('0x40')](_0x5306c7,{'type':db['Sequelize']['QueryTypes'][_0x32ae('0x80')],'raw':!![]})[_0x32ae('0x1e')](function(_0x1fec7f){return _0x1fec7f;});})[_0x32ae('0x1e')](function(_0x125d3a){if(_0x125d3a){_0x2e8b99[_0x32ae('0x25')]['contact']=_0x125d3a[0x0];if(!_0x51d7f2[_0x32ae('0x57')]['UserId'])return;return db[_0x32ae('0x6d')][_0x32ae('0x55')]({'where':{'id':_0x51d7f2[_0x32ae('0x57')][_0x32ae('0x5f')],'role':_0x32ae('0x6e')},'attributes':['id',_0x32ae('0x36'),_0x32ae('0x6f'),'email','internal'],'raw':!![]});}return null;})[_0x32ae('0x1e')](function(_0x4084ef){if(!_0x4084ef)return null;_0x2e8b99[_0x32ae('0x25')][_0x32ae('0x6e')]=_0x4084ef;return _0x2e8b99;})[_0x32ae('0x1e')](function(_0x11b90f){if(_0x11b90f){_0x11b90f[_0x32ae('0x25')]['interface']=util[_0x32ae('0x5d')]('SIP/%s',_0x51d7f2[_0x32ae('0x65')][_0x32ae('0x36')]);_0x11b90f['message'][_0x32ae('0x74')]=_0x2e8b99[_0x32ae('0x74')];_0x11b90f['message'][_0x32ae('0x75')]=_0x2e8b99[_0x32ae('0x74')];_0x11b90f[_0x32ae('0x25')][_0x32ae('0x76')]='reject';respondWithRpcPromise(_0x32ae('0x77'),_0x32ae('0x77'),{'event':_0x32ae('0x81'),'message':_0x11b90f[_0x32ae('0x25')]},client9002);return _0x2e8b99;}return null;})['then'](respondWithResult(_0x44db8e,null))[_0x32ae('0x27')](handleError(_0x44db8e,null));};exports[_0x32ae('0x82')]=function(_0x417a4e,_0x4d8d57){var _0x243933;return db[_0x32ae('0x3a')][_0x32ae('0x82')](_0x417a4e[_0x32ae('0x57')],{})['then'](function(_0x28be1f){_0x243933=_0x28be1f;return db['CmContact'][_0x32ae('0x83')]({'where':{'id':_0x243933[_0x32ae('0x7f')]}});})[_0x32ae('0x1e')](function(_0x46b9a5){if(_[_0x32ae('0x63')](_0x46b9a5)){return;}else{_0x243933[_0x32ae('0x5a')]=_0x46b9a5['fax'];return db[_0x32ae('0x84')][_0x32ae('0x83')]({'where':{'id':_0x243933[_0x32ae('0x85')]}});}})[_0x32ae('0x1e')](function(_0x2f2fb6){return respondWithRpcPromise(_0x32ae('0x86'),_0x32ae('0x86'),{'FaxAccountId':_[_0x32ae('0x63')](_0x417a4e[_0x32ae('0x57')])?undefined:_0x417a4e[_0x32ae('0x57')]['FaxAccountId'],'path':_[_0x32ae('0x63')](_0x2f2fb6)?undefined:util[_0x32ae('0x5d')](_0x32ae('0x87'),_0x2f2fb6[_0x32ae('0x88')]),'fax':_['isNil'](_0x243933[_0x32ae('0x5a')])?undefined:_0x243933['fax'],'AttachmentId':_0x243933['AttachmentId']},client9002);})[_0x32ae('0x1e')](respondWithResult(_0x4d8d57,0xc9))[_0x32ae('0x27')](handleError(_0x4d8d57,null));};exports[_0x32ae('0x89')]=function(_0x37928d,_0x4810ad){var _0x578b09=path['join'](config['root'],_0x32ae('0x8a'),_0x32ae('0x8b'),_0x32ae('0x8c'));return db[_0x32ae('0x3a')]['find']({'where':{'id':_0x37928d[_0x32ae('0x53')]['id']},'include':[{'model':db['Attachment'],'as':_0x32ae('0x84')}]})[_0x32ae('0x1e')](handleEntityNotFound(_0x4810ad,null))[_0x32ae('0x1e')](function(_0x10b188){if(_0x10b188){return _0x4810ad[_0x32ae('0x89')](path[_0x32ae('0x8d')](_0x578b09,_0x10b188[_0x32ae('0x84')][_0x32ae('0x88')]));}})[_0x32ae('0x27')](handleError(_0x4810ad,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 72f7201..9b0becc 100644 --- a/server/api/faxMessage/faxMessage.events.js +++ b/server/api/faxMessage/faxMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe2c=['../../mysqldb','setMaxListeners','update','remove','emit','hook','exports','events'];(function(_0x53ea04,_0x1546cc){var _0x46ad81=function(_0x1fbac9){while(--_0x1fbac9){_0x53ea04['push'](_0x53ea04['shift']());}};_0x46ad81(++_0x1546cc);}(_0xbe2c,0x18f));var _0xcbe2=function(_0x4cc776,_0xc7ae00){_0x4cc776=_0x4cc776-0x0;var _0x223327=_0xbe2c[_0x4cc776];return _0x223327;};'use strict';var EventEmitter=require(_0xcbe2('0x0'));var FaxMessage=require(_0xcbe2('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xcbe2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcbe2('0x3'),'afterDestroy':_0xcbe2('0x4')};function emitEvent(_0x107914){return function(_0x42c28d,_0x3f9f67,_0x59afb2){FaxMessageEvents[_0xcbe2('0x5')](_0x107914+':'+_0x42c28d['id'],_0x42c28d);FaxMessageEvents[_0xcbe2('0x5')](_0x107914,_0x42c28d);_0x59afb2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0xcbe2('0x6')](e,emitEvent(event));}}module[_0xcbe2('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0xb016=['remove','emit','hasOwnProperty','events','../../mysqldb','save'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb016,0x159));var _0x6b01=function(_0x501af0,_0x2de2a4){_0x501af0=_0x501af0-0x0;var _0x3f4b06=_0xb016[_0x501af0];return _0x3f4b06;};'use strict';var EventEmitter=require(_0x6b01('0x0'));var FaxMessage=require(_0x6b01('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6b01('0x2'),'afterUpdate':'update','afterDestroy':_0x6b01('0x3')};function emitEvent(_0x464e83){return function(_0x161b59,_0x3b9de1,_0x5964ca){FaxMessageEvents[_0x6b01('0x4')](_0x464e83+':'+_0x161b59['id'],_0x161b59);FaxMessageEvents[_0x6b01('0x4')](_0x464e83,_0x161b59);_0x5964ca(null);};}for(var e in events){if(events[_0x6b01('0x5')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index f4f53f2..f1f8993 100644 --- a/server/api/faxMessage/faxMessage.model.js +++ b/server/api/faxMessage/faxMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1aa3=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','body','toLowerCase','out','secret','isNil','UserId','findOne','FaxInteractionId','update','direction','catch','error'];(function(_0x5445a1,_0x1ba385){var _0x3bf175=function(_0x3e999a){while(--_0x3e999a){_0x5445a1['push'](_0x5445a1['shift']());}};_0x3bf175(++_0x1ba385);}(_0x1aa3,0x1a2));var _0x31aa=function(_0x3c0b76,_0x170065){_0x3c0b76=_0x3c0b76-0x0;var _0x51906d=_0x1aa3[_0x3c0b76];return _0x51906d;};'use strict';var _=require(_0x31aa('0x0'));var util=require(_0x31aa('0x1'));var logger=require(_0x31aa('0x2'))('api');var moment=require(_0x31aa('0x3'));var BPromise=require(_0x31aa('0x4'));var rp=require(_0x31aa('0x5'));var fs=require('fs');var path=require(_0x31aa('0x6'));var rimraf=require('rimraf');var config=require(_0x31aa('0x7'));var attributes=require(_0x31aa('0x8'));module['exports']=function(_0x37425f,_0x4b485e){return _0x37425f[_0x31aa('0x9')](_0x31aa('0xa'),attributes,{'tableName':_0x31aa('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x31aa('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4cdf27,_0x2de6aa,_0x45869d){var _0x430101=_0x37425f['models'];var _0x3f5cd4=_0x4cdf27['get']({'plain':!![]});if(_0x3f5cd4['direction'][_0x31aa('0xd')]()==='in'||_0x3f5cd4['direction'][_0x31aa('0xd')]()===_0x31aa('0xe')&&!_0x3f5cd4[_0x31aa('0xf')]&&!_[_0x31aa('0x10')](_0x3f5cd4[_0x31aa('0x11')])){_0x430101['FaxInteraction'][_0x31aa('0x12')]({'where':{'id':_0x3f5cd4[_0x31aa('0x13')]}})['then'](function(_0x5cbeb4){if(_0x5cbeb4){_0x5cbeb4[_0x31aa('0x14')]({'lastMsgAt':_0x3f5cd4['createdAt'],'lastMsgDirection':_0x3f5cd4[_0x31aa('0x15')][_0x31aa('0xd')]()});}})[_0x31aa('0x16')](function(_0x241ba0){console[_0x31aa('0x17')](_0x241ba0);});}_0x45869d();}},'charset':_0x31aa('0x18'),'collate':_0x31aa('0x19')});}; \ No newline at end of file +var _0x3789=['./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','models','direction','toLowerCase','out','secret','isNil','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x27604a,_0x6bec61){var _0x52eeae=function(_0x9f96c1){while(--_0x9f96c1){_0x27604a['push'](_0x27604a['shift']());}};_0x52eeae(++_0x6bec61);}(_0x3789,0x196));var _0x9378=function(_0x194bd1,_0x4d1cfd){_0x194bd1=_0x194bd1-0x0;var _0xfc5812=_0x3789[_0x194bd1];return _0xfc5812;};'use strict';var _=require(_0x9378('0x0'));var util=require(_0x9378('0x1'));var logger=require(_0x9378('0x2'))(_0x9378('0x3'));var moment=require(_0x9378('0x4'));var BPromise=require(_0x9378('0x5'));var rp=require(_0x9378('0x6'));var fs=require('fs');var path=require(_0x9378('0x7'));var rimraf=require(_0x9378('0x8'));var config=require(_0x9378('0x9'));var attributes=require(_0x9378('0xa'));module[_0x9378('0xb')]=function(_0x483b54,_0x57761c){return _0x483b54[_0x9378('0xc')](_0x9378('0xd'),attributes,{'tableName':_0x9378('0xe'),'paranoid':![],'indexes':[{'name':_0x9378('0xf'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x935a68,_0x5061ea,_0x18bca1){var _0x28f758=_0x483b54[_0x9378('0x10')];var _0x1146a5=_0x935a68['get']({'plain':!![]});if(_0x1146a5[_0x9378('0x11')][_0x9378('0x12')]()==='in'||_0x1146a5[_0x9378('0x11')][_0x9378('0x12')]()===_0x9378('0x13')&&!_0x1146a5[_0x9378('0x14')]&&!_[_0x9378('0x15')](_0x1146a5['UserId'])){_0x28f758[_0x9378('0x16')][_0x9378('0x17')]({'where':{'id':_0x1146a5[_0x9378('0x18')]}})[_0x9378('0x19')](function(_0xfe9778){if(_0xfe9778){_0xfe9778[_0x9378('0x1a')]({'lastMsgAt':_0x1146a5[_0x9378('0x1b')],'lastMsgDirection':_0x1146a5[_0x9378('0x11')]['toLowerCase']()});}})[_0x9378('0x1c')](function(_0x2b7adf){console[_0x9378('0x1d')](_0x2b7adf);});}_0x18bca1();}},'charset':_0x9378('0x1e'),'collate':_0x9378('0x1f')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index a8bd371..91b9be1 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeec6=['FaxMessage','create','body','options','then','catch','UpdateFaxMessage','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage'];(function(_0x518fd9,_0x455856){var _0x4ebf2d=function(_0x24e590){while(--_0x24e590){_0x518fd9['push'](_0x518fd9['shift']());}};_0x4ebf2d(++_0x455856);}(_0xeec6,0x1c2));var _0x6eec=function(_0x52096b,_0x20bab4){_0x52096b=_0x52096b-0x0;var _0x2b1cc7=_0xeec6[_0x52096b];return _0x2b1cc7;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});config['redis']=_[_0x6eec('0xc')](config[_0x6eec('0xd')],{'host':_0x6eec('0xe'),'port':0x18eb});var socket=require(_0x6eec('0xf'))(new Redis(config['redis']));require(_0x6eec('0x10'))[_0x6eec('0x11')](socket);function respondWithRpcPromise(_0x1c774d,_0x49ad4c,_0x595dd4){return new BPromise(function(_0x5e8aba,_0x295cae){return client[_0x6eec('0x12')](_0x1c774d,_0x595dd4)['then'](function(_0x4b8de1){logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));logger[_0x6eec('0x15')](_0x6eec('0x16'),_0x49ad4c,_0x6eec('0x14'),JSON[_0x6eec('0x17')](_0x4b8de1));if(_0x4b8de1['error']){if(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x19')]===0x1f4){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);return _0x295cae(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);}logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1['error'][_0x6eec('0x1b')]);return _0x5e8aba(_0x4b8de1['error'][_0x6eec('0x1b')]);}else{logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));_0x5e8aba(_0x4b8de1[_0x6eec('0x1c')][_0x6eec('0x1b')]);}})['catch'](function(_0x87f3be){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x87f3be);_0x295cae(_0x87f3be);});});}exports[_0x6eec('0x1d')]=function(_0xd86135){var _0x1761f4=this;return new Promise(function(_0x536429,_0x328693){return db[_0x6eec('0x1e')][_0x6eec('0x1f')](_0xd86135[_0x6eec('0x20')],{'raw':_0xd86135[_0x6eec('0x21')]?_0xd86135[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x6eec('0x22')](function(_0x852d08){logger[_0x6eec('0x13')](_0x6eec('0x1d'),_0xd86135);logger[_0x6eec('0x15')](_0x6eec('0x1d'),_0xd86135,JSON['stringify'](_0x852d08));_0x536429(_0x852d08);})[_0x6eec('0x23')](function(_0x2ad14b){logger[_0x6eec('0x18')](_0x6eec('0x1d'),_0x2ad14b[_0x6eec('0x1b')],_0xd86135);_0x328693(_0x1761f4[_0x6eec('0x18')](0x1f4,_0x2ad14b[_0x6eec('0x1b')]));});});};exports[_0x6eec('0x24')]=function(_0x316317){var _0x58f95c=this;return new Promise(function(_0x1d750c,_0x44b31c){return db[_0x6eec('0x1e')][_0x6eec('0x25')](_0x316317['body'],{'raw':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x316317['options']?_0x316317[_0x6eec('0x21')]['where']||null:null,'attributes':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x26')]||null:null,'limit':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x27')]||null:null})[_0x6eec('0x22')](function(_0x33e4a1){logger[_0x6eec('0x13')](_0x6eec('0x24'),_0x316317);logger['debug'](_0x6eec('0x24'),_0x316317,JSON['stringify'](_0x33e4a1));_0x1d750c(_0x33e4a1);})[_0x6eec('0x23')](function(_0x125bfc){logger[_0x6eec('0x18')]('UpdateFaxMessage',_0x125bfc['message'],_0x316317);_0x44b31c(_0x58f95c['error'](0x1f4,_0x125bfc[_0x6eec('0x1b')]));});});}; \ No newline at end of file +var _0x98a8=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./faxMessage.socket','register','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','UpdateFaxMessage','update','raw','attributes','limit','stringify','lodash','util','moment','bluebird'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x98a8,0x12c));var _0x898a=function(_0x1c5a77,_0x101791){_0x1c5a77=_0x1c5a77-0x0;var _0x318197=_0x98a8[_0x1c5a77];return _0x318197;};'use strict';var _=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var moment=require(_0x898a('0x2'));var BPromise=require(_0x898a('0x3'));var rs=require(_0x898a('0x4'));var fs=require('fs');var Redis=require(_0x898a('0x5'));var db=require(_0x898a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x898a('0x7'))(_0x898a('0x8'));var config=require(_0x898a('0x9'));var jayson=require(_0x898a('0xa'));var client=jayson[_0x898a('0xb')]['http']({'port':0x232a});config[_0x898a('0xc')]=_['defaults'](config[_0x898a('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x898a('0xd'))(new Redis(config[_0x898a('0xc')]));require(_0x898a('0xe'))[_0x898a('0xf')](socket);function respondWithRpcPromise(_0x3150df,_0x388a47,_0x42faa4){return new BPromise(function(_0x1a92de,_0x3806cb){return client['request'](_0x3150df,_0x42faa4)[_0x898a('0x10')](function(_0x502e95){logger[_0x898a('0x11')]('FaxMessage,\x20%s,\x20%s',_0x388a47,_0x898a('0x12'));logger[_0x898a('0x13')](_0x898a('0x14'),_0x388a47,'request\x20sent',JSON['stringify'](_0x502e95));if(_0x502e95['error']){if(_0x502e95[_0x898a('0x15')][_0x898a('0x16')]===0x1f4){logger[_0x898a('0x15')](_0x898a('0x17'),_0x388a47,_0x502e95[_0x898a('0x15')][_0x898a('0x18')]);return _0x3806cb(_0x502e95['error'][_0x898a('0x18')]);}logger['error'](_0x898a('0x17'),_0x388a47,_0x502e95['error'][_0x898a('0x18')]);return _0x1a92de(_0x502e95['error'][_0x898a('0x18')]);}else{logger['info'](_0x898a('0x17'),_0x388a47,_0x898a('0x12'));_0x1a92de(_0x502e95[_0x898a('0x19')]['message']);}})[_0x898a('0x1a')](function(_0x5960e0){logger['error'](_0x898a('0x17'),_0x388a47,_0x5960e0);_0x3806cb(_0x5960e0);});});}exports[_0x898a('0x1b')]=function(_0x58c3ab){var _0x4d374b=this;return new Promise(function(_0x12bc0f,_0x26449a){return db[_0x898a('0x1c')][_0x898a('0x1d')](_0x58c3ab[_0x898a('0x1e')],{'raw':_0x58c3ab[_0x898a('0x1f')]?_0x58c3ab[_0x898a('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x898a('0x10')](function(_0x50718e){logger[_0x898a('0x11')](_0x898a('0x1b'),_0x58c3ab);logger[_0x898a('0x13')](_0x898a('0x1b'),_0x58c3ab,JSON['stringify'](_0x50718e));_0x12bc0f(_0x50718e);})[_0x898a('0x1a')](function(_0x16c318){logger[_0x898a('0x15')](_0x898a('0x1b'),_0x16c318[_0x898a('0x18')],_0x58c3ab);_0x26449a(_0x4d374b[_0x898a('0x15')](0x1f4,_0x16c318['message']));});});};exports[_0x898a('0x20')]=function(_0x51d501){var _0x513c6b=this;return new Promise(function(_0x53ddb2,_0x3678be){return db[_0x898a('0x1c')][_0x898a('0x21')](_0x51d501[_0x898a('0x1e')],{'raw':_0x51d501[_0x898a('0x1f')]?_0x51d501[_0x898a('0x1f')][_0x898a('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51d501[_0x898a('0x1f')]?_0x51d501[_0x898a('0x1f')]['where']||null:null,'attributes':_0x51d501['options']?_0x51d501['options'][_0x898a('0x23')]||null:null,'limit':_0x51d501[_0x898a('0x1f')]?_0x51d501[_0x898a('0x1f')][_0x898a('0x24')]||null:null})[_0x898a('0x10')](function(_0x560000){logger[_0x898a('0x11')](_0x898a('0x20'),_0x51d501);logger[_0x898a('0x13')](_0x898a('0x20'),_0x51d501,JSON[_0x898a('0x25')](_0x560000));_0x53ddb2(_0x560000);})[_0x898a('0x1a')](function(_0x494127){logger[_0x898a('0x15')](_0x898a('0x20'),_0x494127[_0x898a('0x18')],_0x51d501);_0x3678be(_0x513c6b[_0x898a('0x15')](0x1f4,_0x494127[_0x898a('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 261d9c1..87e3eae 100644 --- a/server/api/faxMessage/faxMessage.socket.js +++ b/server/api/faxMessage/faxMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab7c=['faxMessage:','./faxMessage.events','remove','removeListener','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab7c,0xc9));var _0xcab7=function(_0x26b175,_0x39cd17){_0x26b175=_0x26b175-0x0;var _0xca7d26=_0xab7c[_0x26b175];return _0xca7d26;};'use strict';var FaxMessageEvents=require(_0xcab7('0x0'));var events=['save',_0xcab7('0x1'),'update'];function createListener(_0x2c1671,_0x40097a){return function(_0x28af28){_0x40097a['emit'](_0x2c1671,_0x28af28);};}function removeListener(_0x37bd90,_0x4117de){return function(){FaxMessageEvents[_0xcab7('0x2')](_0x37bd90,_0x4117de);};}exports['register']=function(_0x98267d){for(var _0x562fe5=0x0,_0x65f1c8=events[_0xcab7('0x3')];_0x562fe5<_0x65f1c8;_0x562fe5++){var _0x4c6a9a=events[_0x562fe5];var _0x31e03c=createListener(_0xcab7('0x4')+_0x4c6a9a,_0x98267d);FaxMessageEvents['on'](_0x4c6a9a,_0x31e03c);}}; \ No newline at end of file +var _0xa72c=['register','length','./faxMessage.events','save','remove','update','emit'];(function(_0x27e3c7,_0x52db3b){var _0x5c26fe=function(_0x44efba){while(--_0x44efba){_0x27e3c7['push'](_0x27e3c7['shift']());}};_0x5c26fe(++_0x52db3b);}(_0xa72c,0x1bb));var _0xca72=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0xa72c[_0x3c4dad];return _0x1a4f49;};'use strict';var FaxMessageEvents=require(_0xca72('0x0'));var events=[_0xca72('0x1'),_0xca72('0x2'),_0xca72('0x3')];function createListener(_0x3cfa04,_0x4a5737){return function(_0x5aacda){_0x4a5737[_0xca72('0x4')](_0x3cfa04,_0x5aacda);};}function removeListener(_0x6d55b0,_0x5e6f31){return function(){FaxMessageEvents['removeListener'](_0x6d55b0,_0x5e6f31);};}exports[_0xca72('0x5')]=function(_0x42015f){for(var _0x56f51c=0x0,_0x16e639=events[_0xca72('0x6')];_0x56f51c<_0x16e639;_0x56f51c++){var _0x42aadf=events[_0x56f51c];var _0x28e06c=createListener('faxMessage:'+_0x42aadf,_0x42015f);FaxMessageEvents['on'](_0x42aadf,_0x28e06c);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 5d59d43..6b6b808 100644 --- a/server/api/faxMessage/index.js +++ b/server/api/faxMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9354=['describe','/:id','show','/:id/download','download','post','fax','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x5a0d79,_0x17aed4){var _0x5bee8d=function(_0x12a468){while(--_0x12a468){_0x5a0d79['push'](_0x5a0d79['shift']());}};_0x5bee8d(++_0x17aed4);}(_0x9354,0x96));var _0x4935=function(_0x2a558d,_0x2df0ff){_0x2a558d=_0x2a558d-0x0;var _0xa7bc9c=_0x9354[_0x2a558d];return _0xa7bc9c;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var fs_extra=require(_0x4935('0x4'));var auth=require(_0x4935('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4935('0x6'));var controller=require(_0x4935('0x7'));router[_0x4935('0x8')]('/',auth[_0x4935('0x9')](),controller[_0x4935('0xa')]);router[_0x4935('0x8')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xc')]);router['get'](_0x4935('0xd'),auth['isAuthenticated'](),controller[_0x4935('0xe')]);router[_0x4935('0x8')](_0x4935('0xf'),auth[_0x4935('0x9')](),controller[_0x4935('0x10')]);router[_0x4935('0x11')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x4935('0x12'),'faxmessage:create'),controller['create']);router[_0x4935('0x13')](_0x4935('0xd'),auth[_0x4935('0x9')](),controller[_0x4935('0x14')]);router[_0x4935('0x13')](_0x4935('0x15'),auth[_0x4935('0x9')](),controller[_0x4935('0x16')]);router[_0x4935('0x13')](_0x4935('0x17'),auth[_0x4935('0x9')](),controller[_0x4935('0x18')]);router[_0x4935('0x19')](_0x4935('0xd'),auth[_0x4935('0x9')](),controller[_0x4935('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xb7e7=['get','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/reject','reject','delete','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller','index'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb7e7,0x121));var _0x7b7e=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0xb7e7[_0x47a349];return _0x18ab75;};'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('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')]('/',auth[_0x7b7e('0xc')](),interaction[_0x7b7e('0x11')](_0x7b7e('0x12'),_0x7b7e('0x13')),controller[_0x7b7e('0x14')]);router[_0x7b7e('0x15')](_0x7b7e('0xb'),auth['isAuthenticated'](),controller[_0x7b7e('0x16')]);router[_0x7b7e('0x15')]('/:id/accept',auth[_0x7b7e('0xc')](),controller['accept']);router['put'](_0x7b7e('0x17'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x18')]);router[_0x7b7e('0x19')](_0x7b7e('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7b7e('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index d20c1bc..6d643d3 100644 --- a/server/api/faxQueue/faxQueue.attributes.js +++ b/server/api/faxQueue/faxQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4306=['rrmemory','beepall','roundrobin','STRING','INTEGER','ENUM'];(function(_0x1fcea0,_0x5cecef){var _0x2fe4e8=function(_0x19c0cd){while(--_0x19c0cd){_0x1fcea0['push'](_0x1fcea0['shift']());}};_0x2fe4e8(++_0x5cecef);}(_0x4306,0x7b));var _0x6430=function(_0x4e7da5,_0x10ca38){_0x4e7da5=_0x4e7da5-0x0;var _0x3ee903=_0x4306[_0x4e7da5];return _0x3ee903;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6430('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x6430('0x1')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6430('0x2')](_0x6430('0x3'),_0x6430('0x4'),_0x6430('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x6430('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd7d5=['sequelize','exports','STRING','name','INTEGER','ENUM','beepall'];(function(_0x2984b3,_0x1b9e16){var _0xb49a4b=function(_0x30bd40){while(--_0x30bd40){_0x2984b3['push'](_0x2984b3['shift']());}};_0xb49a4b(++_0x1b9e16);}(_0xd7d5,0x1ea));var _0x5d7d=function(_0x4432b6,_0x5b0491){_0x4432b6=_0x4432b6-0x0;var _0x47b47d=_0xd7d5[_0x4432b6];return _0x47b47d;};'use strict';var Sequelize=require(_0x5d7d('0x0'));module[_0x5d7d('0x1')]={'name':{'type':Sequelize[_0x5d7d('0x2')],'unique':_0x5d7d('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5d7d('0x2')]},'timeout':{'type':Sequelize[_0x5d7d('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5d7d('0x5')]('rrmemory',_0x5d7d('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x5d7d('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 4c72598..f0c16ee 100644 --- a/server/api/faxQueue/faxQueue.controller.js +++ b/server/api/faxQueue/faxQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7f0=['undefined','limit','count','set','Content-Range','update','then','destroy','get','FaxQueues','UserProfileResource','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','getOptions','where','FaxQueue','include','query','findAll','rows','show','params','model','keys','filters','intersection','attributes','fields','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','describe','findOne','UserFaxQueue','length','hasOwnProperty','nolimit','order','FaxQueueId','filter','User','UserId','createdAt','format','%s/%s','SIP','faxPause','updatedAt','getTeams','Team','sort','ids','Agents','online','voicePause','interface','flatMap','sequelize','addTeams','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','field','tq.TeamId','team_has_fax_queues','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','transaction','isEmpty','addAgents','omit','spread','removeAgents','isArray','userFaxQueue:remove','getAgents','bluebird','util','lodash','squel','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset'];(function(_0x73c7c4,_0x4c96c7){var _0x15af15=function(_0x207b32){while(--_0x207b32){_0x73c7c4['push'](_0x73c7c4['shift']());}};_0x15af15(++_0x4c96c7);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x573ea2,_0x1517e4){_0x573ea2=_0x573ea2-0x0;var _0x2dc6ab=_0xb7f0[_0x573ea2];return _0x2dc6ab;};'use strict';var BPromise=require(_0x0b7f('0x0'));var util=require(_0x0b7f('0x1'));var _=require(_0x0b7f('0x2'));var squel=require(_0x0b7f('0x3'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x0b7f('0x4'))(_0x0b7f('0x5'));var config=require(_0x0b7f('0x6'));var db=require(_0x0b7f('0x7'))['db'];config[_0x0b7f('0x8')]=_[_0x0b7f('0x9')](config[_0x0b7f('0x8')],{'host':_0x0b7f('0xa'),'port':0x18eb});var socket=require(_0x0b7f('0xb'))(new Redis(config[_0x0b7f('0x8')]));require('./faxQueue.socket')[_0x0b7f('0xc')](socket);function respondWithStatusCode(_0x65287,_0x5ed192){_0x5ed192=_0x5ed192||0xcc;return function(_0x1332d4){if(_0x1332d4){return _0x65287[_0x0b7f('0xd')](_0x5ed192);}return _0x65287['status'](_0x5ed192)['end']();};}function respondWithResult(_0x596c5a,_0x255197){_0x255197=_0x255197||0xc8;return function(_0x1e8f0a){if(_0x1e8f0a){return _0x596c5a[_0x0b7f('0xe')](_0x255197)[_0x0b7f('0xf')](_0x1e8f0a);}};}function respondWithFilteredResult(_0x43114c,_0xc7fa85){return function(_0x23a0b4){if(_0x23a0b4){var _0x1ed8aa=typeof _0xc7fa85[_0x0b7f('0x10')]===_0x0b7f('0x11')&&typeof _0xc7fa85[_0x0b7f('0x12')]==='undefined';var _0x38808d=_0x23a0b4[_0x0b7f('0x13')];var _0x1e3f86=_0x1ed8aa?0x0:_0xc7fa85[_0x0b7f('0x10')];var _0x294db5=_0x1ed8aa?_0x23a0b4[_0x0b7f('0x13')]:_0xc7fa85[_0x0b7f('0x10')]+_0xc7fa85[_0x0b7f('0x12')];var _0x5a2b0b;if(_0x294db5>=_0x38808d){_0x294db5=_0x38808d;_0x5a2b0b=0xc8;}else{_0x5a2b0b=0xce;}_0x43114c[_0x0b7f('0xe')](_0x5a2b0b);return _0x43114c[_0x0b7f('0x14')](_0x0b7f('0x15'),_0x1e3f86+'-'+_0x294db5+'/'+_0x38808d)[_0x0b7f('0xf')](_0x23a0b4);}return null;};}function saveUpdates(_0x58c901){return function(_0x355fdd){if(_0x355fdd){return _0x355fdd[_0x0b7f('0x16')](_0x58c901)[_0x0b7f('0x17')](function(_0x168e7e){return _0x168e7e;});}return null;};}function removeEntity(_0x166520){return function(_0x50cee2){if(_0x50cee2){return _0x50cee2[_0x0b7f('0x18')]()['then'](function(){var _0x5b9062=_0x50cee2[_0x0b7f('0x19')]({'plain':!![]});var _0x30a8b2=_0x0b7f('0x1a');return db[_0x0b7f('0x1b')][_0x0b7f('0x18')]({'where':{'type':_0x30a8b2,'resourceId':_0x5b9062['id']}})['then'](function(){return _0x50cee2;});})['then'](function(){_0x166520[_0x0b7f('0xe')](0xcc)[_0x0b7f('0x1c')]();});}};}function handleEntityNotFound(_0x282634){return function(_0x5eec54){if(!_0x5eec54){_0x282634[_0x0b7f('0xd')](0x194);}return _0x5eec54;};}function handleError(_0x1ec1d3,_0x26f974){_0x26f974=_0x26f974||0x1f4;return function(_0x47736b){logger[_0x0b7f('0x1d')](_0x47736b[_0x0b7f('0x1e')]);if(_0x47736b[_0x0b7f('0x1f')]){delete _0x47736b[_0x0b7f('0x1f')];}_0x1ec1d3[_0x0b7f('0xe')](_0x26f974)['send'](_0x47736b);};}exports[_0x0b7f('0x20')]=function(_0x2ce9fa,_0x57ce74){var _0x50776a={};var _0x4a2841={'count':0x0,'rows':[]};var _0x37a5e5=_[_0x0b7f('0x21')](db['FaxQueue'][_0x0b7f('0x22')],function(_0x3cda59){return{'name':_0x3cda59[_0x0b7f('0x23')],'type':_0x3cda59[_0x0b7f('0x24')][_0x0b7f('0x25')]};});_0x50776a=qs[_0x0b7f('0x26')](_0x37a5e5,_0x2ce9fa);var _0x1b8e19={'where':_0x50776a[_0x0b7f('0x27')]};return db[_0x0b7f('0x28')]['count'](_0x1b8e19)['then'](function(_0x4ada58){_0x4a2841[_0x0b7f('0x13')]=_0x4ada58;_0x50776a['include']=qs[_0x0b7f('0x29')](_0x2ce9fa[_0x0b7f('0x2a')]);return db[_0x0b7f('0x28')][_0x0b7f('0x2b')](_0x50776a);})[_0x0b7f('0x17')](function(_0x2df0c6){_0x4a2841[_0x0b7f('0x2c')]=_0x2df0c6;return _0x4a2841;})['then'](respondWithFilteredResult(_0x57ce74,_0x50776a))['catch'](handleError(_0x57ce74,null));};exports[_0x0b7f('0x2d')]=function(_0x5dcf8f,_0x1201a8){var _0x2a4298={'raw':!![],'where':{'id':_0x5dcf8f[_0x0b7f('0x2e')]['id']}},_0x1dc84b={};_0x1dc84b[_0x0b7f('0x2f')]=_[_0x0b7f('0x30')](db[_0x0b7f('0x28')][_0x0b7f('0x22')]);_0x1dc84b[_0x0b7f('0x2a')]=_['keys'](_0x5dcf8f['query']);_0x1dc84b[_0x0b7f('0x31')]=_[_0x0b7f('0x32')](_0x1dc84b[_0x0b7f('0x2f')],_0x1dc84b[_0x0b7f('0x2a')]);_0x2a4298[_0x0b7f('0x33')]=_[_0x0b7f('0x32')](_0x1dc84b[_0x0b7f('0x2f')],qs[_0x0b7f('0x34')](_0x5dcf8f[_0x0b7f('0x2a')]['fields']));_0x2a4298['attributes']=_0x2a4298[_0x0b7f('0x33')]['length']?_0x2a4298[_0x0b7f('0x33')]:_0x1dc84b['model'];if(_0x5dcf8f[_0x0b7f('0x2a')][_0x0b7f('0x35')]){_0x2a4298[_0x0b7f('0x29')]=[{'all':!![]}];}_0x2a4298=_[_0x0b7f('0x36')]({},_0x2a4298,_0x5dcf8f[_0x0b7f('0x37')]);return db[_0x0b7f('0x28')][_0x0b7f('0x38')](_0x2a4298)[_0x0b7f('0x17')](handleEntityNotFound(_0x1201a8,null))[_0x0b7f('0x17')](respondWithResult(_0x1201a8,null))['catch'](handleError(_0x1201a8,null));};exports['create']=function(_0x5e0bd3,_0x17e7f7){return db['FaxQueue'][_0x0b7f('0x39')](_0x5e0bd3[_0x0b7f('0x3a')],{})[_0x0b7f('0x17')](function(_0x30d35e){var _0x1e2f6c=_0x5e0bd3['user'][_0x0b7f('0x19')]({'plain':!![]});if(!_0x1e2f6c)throw new Error(_0x0b7f('0x3b'));if(_0x1e2f6c[_0x0b7f('0x3c')]===_0x0b7f('0x3d')){var _0x40298c=_0x30d35e['get']({'plain':!![]});var _0x46ac32=_0x0b7f('0x1a');return db[_0x0b7f('0x3e')][_0x0b7f('0x38')]({'where':{'name':_0x46ac32,'userProfileId':_0x1e2f6c[_0x0b7f('0x3f')]},'raw':!![]})[_0x0b7f('0x17')](function(_0x40b1c5){if(_0x40b1c5&&_0x40b1c5[_0x0b7f('0x40')]===0x0){return db[_0x0b7f('0x1b')][_0x0b7f('0x39')]({'name':_0x40298c[_0x0b7f('0x1f')],'resourceId':_0x40298c['id'],'type':_0x40b1c5[_0x0b7f('0x1f')],'sectionId':_0x40b1c5['id']},{})[_0x0b7f('0x17')](function(){return _0x30d35e;});}else{return _0x30d35e;}})['catch'](function(_0x4aaf15){logger[_0x0b7f('0x1d')](_0x0b7f('0x41'),_0x4aaf15);throw _0x4aaf15;});}return _0x30d35e;})[_0x0b7f('0x17')](respondWithResult(_0x17e7f7,0xc9))[_0x0b7f('0x42')](handleError(_0x17e7f7,null));};exports[_0x0b7f('0x16')]=function(_0x230c6b,_0x57c147){if(_0x230c6b[_0x0b7f('0x3a')]['id']){delete _0x230c6b[_0x0b7f('0x3a')]['id'];}return db[_0x0b7f('0x28')][_0x0b7f('0x38')]({'where':{'id':_0x230c6b['params']['id']}})[_0x0b7f('0x17')](handleEntityNotFound(_0x57c147,null))['then'](saveUpdates(_0x230c6b[_0x0b7f('0x3a')],null))[_0x0b7f('0x17')](respondWithResult(_0x57c147,null))[_0x0b7f('0x42')](handleError(_0x57c147,null));};exports[_0x0b7f('0x18')]=function(_0x1429c4,_0x47c56b){return db[_0x0b7f('0x28')][_0x0b7f('0x38')]({'where':{'id':_0x1429c4[_0x0b7f('0x2e')]['id']}})[_0x0b7f('0x17')](handleEntityNotFound(_0x47c56b,null))[_0x0b7f('0x17')](removeEntity(_0x47c56b,null))[_0x0b7f('0x42')](handleError(_0x47c56b,null));};exports[_0x0b7f('0x43')]=function(_0x384b42,_0x39a5c5){return db[_0x0b7f('0x28')][_0x0b7f('0x43')]()[_0x0b7f('0x17')](respondWithResult(_0x39a5c5,null))[_0x0b7f('0x42')](handleError(_0x39a5c5,null));};exports['getMembers']=function(_0x2d3921,_0x444c00){var _0x46fae4={'raw':!![],'where':{}},_0x12fd2={},_0x2d765b;return db[_0x0b7f('0x28')][_0x0b7f('0x44')]({'where':{'id':_0x2d3921['params']['id']}})['then'](handleEntityNotFound(_0x444c00,null))['then'](function(_0x16b41b){if(_0x16b41b){_0x2d765b=_0x16b41b[_0x0b7f('0x19')]({'plain':!![]});_0x12fd2['model']=_[_0x0b7f('0x30')](db[_0x0b7f('0x45')]['rawAttributes']);_0x12fd2[_0x0b7f('0x2a')]=_['keys'](_0x2d3921[_0x0b7f('0x2a')]);_0x12fd2['filters']=_[_0x0b7f('0x32')](_0x12fd2[_0x0b7f('0x2f')],_0x12fd2[_0x0b7f('0x2a')]);_0x46fae4[_0x0b7f('0x33')]=_[_0x0b7f('0x32')](_0x12fd2[_0x0b7f('0x2f')],qs[_0x0b7f('0x34')](_0x2d3921[_0x0b7f('0x2a')][_0x0b7f('0x34')]));_0x46fae4[_0x0b7f('0x33')]=_0x46fae4[_0x0b7f('0x33')][_0x0b7f('0x46')]?_0x46fae4[_0x0b7f('0x33')]:_0x12fd2[_0x0b7f('0x2f')];if(!_0x2d3921['query'][_0x0b7f('0x47')](_0x0b7f('0x48'))){_0x46fae4[_0x0b7f('0x12')]=qs[_0x0b7f('0x12')](_0x2d3921[_0x0b7f('0x2a')][_0x0b7f('0x12')]);_0x46fae4['offset']=qs[_0x0b7f('0x10')](_0x2d3921['query']['offset']);}_0x46fae4[_0x0b7f('0x49')]=qs['sort'](_0x2d3921['query']['sort']);_0x46fae4[_0x0b7f('0x27')]=qs[_0x0b7f('0x31')](_['pick'](_0x2d3921['query'],_0x12fd2[_0x0b7f('0x31')]));_0x46fae4[_0x0b7f('0x27')][_0x0b7f('0x4a')]=_0x16b41b['id'];if(_0x2d3921[_0x0b7f('0x2a')][_0x0b7f('0x4b')]){_0x46fae4[_0x0b7f('0x27')]=_[_0x0b7f('0x36')](_0x46fae4['where'],{'$or':_['map'](_0x46fae4['attributes'],function(_0x343a12){var _0x2d06de={};_0x2d06de[_0x343a12]={'$like':'%'+_0x2d3921[_0x0b7f('0x2a')][_0x0b7f('0x4b')]+'%'};return _0x2d06de;})});}_0x46fae4=_[_0x0b7f('0x36')]({},_0x46fae4,_0x2d3921[_0x0b7f('0x37')]);return db[_0x0b7f('0x45')][_0x0b7f('0x2b')](_0x46fae4);}})[_0x0b7f('0x17')](function(_0x54a1cc){if(_0x54a1cc){return db[_0x0b7f('0x4c')]['findAndCountAll']({'where':{'id':_[_0x0b7f('0x21')](_0x54a1cc,_0x0b7f('0x4d')),'role':'agent'},'attributes':['id',_0x0b7f('0x1f'),'faxPause','updatedAt',_0x0b7f('0x4e')]});}})[_0x0b7f('0x17')](function(_0x15d70c){if(_0x15d70c){return{'count':_0x15d70c[_0x0b7f('0x13')],'rows':_[_0x0b7f('0x21')](_0x15d70c[_0x0b7f('0x2c')],function(_0x2afc9b){return{'membername':_0x2afc9b[_0x0b7f('0x1f')],'UserId':_0x2afc9b['id'],'queue_name':_0x2d765b[_0x0b7f('0x1f')],'FaxQueueId':_0x2d765b['id'],'interface':util[_0x0b7f('0x4f')](_0x0b7f('0x50'),_0x0b7f('0x51'),_0x2afc9b[_0x0b7f('0x1f')]),'penalty':0x0,'paused':_0x2afc9b[_0x0b7f('0x52')],'createdAt':_0x2afc9b[_0x0b7f('0x4e')],'updatedAt':_0x2afc9b[_0x0b7f('0x53')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0b7f('0x17')](respondWithFilteredResult(_0x444c00,_0x46fae4))[_0x0b7f('0x42')](handleError(_0x444c00,null));};exports[_0x0b7f('0x54')]=function(_0x48f434,_0x1476cf){var _0x43b607={};var _0x5f456a={};var _0x2cc10e;var _0xebf333;return db['FaxQueue'][_0x0b7f('0x44')]({'where':{'id':_0x48f434['params']['id']}})[_0x0b7f('0x17')](handleEntityNotFound(_0x1476cf,null))[_0x0b7f('0x17')](function(_0xb7fa33){if(_0xb7fa33){_0x2cc10e=_0xb7fa33;_0x5f456a[_0x0b7f('0x2f')]=_['keys'](db[_0x0b7f('0x55')][_0x0b7f('0x22')]);_0x5f456a['query']=_['keys'](_0x48f434[_0x0b7f('0x2a')]);_0x5f456a[_0x0b7f('0x31')]=_[_0x0b7f('0x32')](_0x5f456a[_0x0b7f('0x2f')],_0x5f456a[_0x0b7f('0x2a')]);_0x43b607[_0x0b7f('0x33')]=_[_0x0b7f('0x32')](_0x5f456a[_0x0b7f('0x2f')],qs[_0x0b7f('0x34')](_0x48f434[_0x0b7f('0x2a')][_0x0b7f('0x34')]));_0x43b607['attributes']=_0x43b607[_0x0b7f('0x33')][_0x0b7f('0x46')]?_0x43b607['attributes']:_0x5f456a[_0x0b7f('0x2f')];_0x43b607['order']=qs[_0x0b7f('0x56')](_0x48f434['query']['sort']);_0x43b607['where']=qs[_0x0b7f('0x31')](_['pick'](_0x48f434['query'],_0x5f456a[_0x0b7f('0x31')]));if(_0x48f434[_0x0b7f('0x2a')][_0x0b7f('0x4b')]){_0x43b607[_0x0b7f('0x27')]=_[_0x0b7f('0x36')](_0x43b607[_0x0b7f('0x27')],{'$or':_[_0x0b7f('0x21')](_0x43b607[_0x0b7f('0x33')],function(_0x27777f){var _0x3ed83b={};_0x3ed83b[_0x27777f]={'$like':'%'+_0x48f434[_0x0b7f('0x2a')][_0x0b7f('0x4b')]+'%'};return _0x3ed83b;})});}_0x43b607=_[_0x0b7f('0x36')]({},_0x43b607,_0x48f434['options']);return _0x2cc10e[_0x0b7f('0x54')](_0x43b607);}})[_0x0b7f('0x17')](function(_0x2317ba){if(_0x2317ba){_0xebf333=_0x2317ba[_0x0b7f('0x46')];if(!_0x48f434[_0x0b7f('0x2a')][_0x0b7f('0x47')](_0x0b7f('0x48'))){_0x43b607['limit']=qs[_0x0b7f('0x12')](_0x48f434[_0x0b7f('0x2a')]['limit']);_0x43b607['offset']=qs['offset'](_0x48f434['query'][_0x0b7f('0x10')]);}return _0x2cc10e[_0x0b7f('0x54')](_0x43b607);}})[_0x0b7f('0x17')](function(_0x11c39d){if(_0x11c39d){return _0x11c39d?{'count':_0xebf333,'rows':_0x11c39d}:null;}})[_0x0b7f('0x17')](respondWithResult(_0x1476cf,null))[_0x0b7f('0x42')](handleError(_0x1476cf,null));};exports['addTeams']=function(_0x5296d9,_0x3ad3b6){var _0x146e75=_0x5296d9[_0x0b7f('0x3a')][_0x0b7f('0x57')];return db['Team']['findAll']({'where':{'id':_0x146e75},'attributes':['id'],'include':[{'model':db[_0x0b7f('0x4c')],'as':_0x0b7f('0x58'),'attributes':['id',_0x0b7f('0x1f'),_0x0b7f('0x59'),_0x0b7f('0x5a'),_0x0b7f('0x5b')],'raw':!![]}]})[_0x0b7f('0x17')](function(_0xd7aae9){if(_0xd7aae9){var _0x41423f=_[_0x0b7f('0x5c')](_0xd7aae9,function(_0x24a9fd){var _0x120e4b=_0x24a9fd['get']({'plain':!![]});return _0x120e4b['Agents'];});return db[_0x0b7f('0x28')]['find']({'where':{'id':_0x5296d9['params']['id']}})['then'](function(_0x2c7f2b){return db[_0x0b7f('0x5d')]['transaction'](function(_0x21522c){return _0x2c7f2b[_0x0b7f('0x5e')](_0x146e75,{'transaction':_0x21522c})[_0x0b7f('0x17')](function(){return BPromise[_0x0b7f('0x5f')](_0x41423f,function(_0xee415c){return db[_0x0b7f('0x45')][_0x0b7f('0x60')]({'where':{'UserId':_0xee415c['id'],'FaxQueueId':_0x5296d9[_0x0b7f('0x2e')]['id']},'transaction':_0x21522c});});})[_0x0b7f('0x17')](function(){_0x41423f[_0x0b7f('0x61')](function(_0x4582a6){socket[_0x0b7f('0x62')](_0x0b7f('0x63'),{'UserId':_0x4582a6['id'],'FaxQueueId':_0x2c7f2b['id']});});});});});}})[_0x0b7f('0x17')](respondWithStatusCode(_0x3ad3b6,null))[_0x0b7f('0x42')](handleError(_0x3ad3b6,null));};exports[_0x0b7f('0x64')]=function(_0x3d896a,_0x185f7f){return db[_0x0b7f('0x55')]['findAll']({'where':{'id':_0x3d896a['query'][_0x0b7f('0x57')]},'attributes':['id'],'include':[{'model':db[_0x0b7f('0x4c')],'as':_0x0b7f('0x58'),'attributes':['id'],'raw':!![]}]})[_0x0b7f('0x17')](handleEntityNotFound(_0x185f7f,null))['then'](function(_0x54531d){var _0x55714e=_[_0x0b7f('0x21')](_0x54531d,'id');var _0x4ac551=[];var _0x3f6479=[];var _0x431bcf=squel['select']();_0x431bcf[_0x0b7f('0x65')](_0x0b7f('0x66'))['from'](_0x0b7f('0x67'),'tq')['join'](_0x0b7f('0x68'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0b7f('0x27')](_0x0b7f('0x69'),_0x3d896a[_0x0b7f('0x2e')]['id']);for(var _0x44979a=0x0;_0x44979a<_0x54531d[_0x0b7f('0x46')];_0x44979a+=0x1){let _0x3928a4=_0x54531d[_0x44979a];for(var _0x3abe26=0x0;_0x3abe26<_0x3928a4['Agents'][_0x0b7f('0x46')];_0x3abe26+=0x1){let _0xc4e2d4=_0x3928a4['Agents'][_0x3abe26];var _0x61f8d4=_0x431bcf[_0x0b7f('0x6a')]();_0x61f8d4['where'](_0x0b7f('0x6b'),_0xc4e2d4['id']);_0x3f6479[_0x0b7f('0x6c')](db['sequelize']['query'](_0x61f8d4[_0x0b7f('0x6d')](),{'type':db['sequelize'][_0x0b7f('0x6e')][_0x0b7f('0x6f')]})[_0x0b7f('0x17')](function(_0x147289){if(_0x147289['length']===0x1){return _0xc4e2d4['id'];}else{var _0x34ee5a=_[_0x0b7f('0x70')](_[_0x0b7f('0x21')](_0x147289,_0x0b7f('0x71')),function(_0x4a628f){return _[_0x0b7f('0x72')](_0x55714e,_0x4a628f);});if(_0x34ee5a){return _0xc4e2d4['id'];}}}));}}return BPromise[_0x0b7f('0x73')](_0x3f6479)['then'](function(_0x2b4693){_0x4ac551=_(_0x4ac551)[_0x0b7f('0x74')](_0x2b4693)['compact']()[_0x0b7f('0x75')]();return db[_0x0b7f('0x28')][_0x0b7f('0x38')]({'where':{'id':_0x3d896a[_0x0b7f('0x2e')]['id']}})[_0x0b7f('0x17')](function(_0x4dc00a){return db[_0x0b7f('0x5d')][_0x0b7f('0x76')](function(_0x5f365){return _0x4dc00a['removeTeams'](_0x3d896a['query'][_0x0b7f('0x57')],{'transaction':_0x5f365})['then'](function(){if(!_[_0x0b7f('0x77')](_0x4ac551)){return _0x4dc00a['removeAgents'](_0x4ac551,{'transaction':_0x5f365});}})['then'](function(){_0x4ac551[_0x0b7f('0x61')](function(_0x566042){socket[_0x0b7f('0x62')]('userFaxQueue:remove',{'UserId':_0x566042,'FaxQueueId':_0x4dc00a['id']});});});});});});})[_0x0b7f('0x17')](respondWithStatusCode(_0x185f7f,null))[_0x0b7f('0x42')](handleError(_0x185f7f,null));};exports[_0x0b7f('0x78')]=function(_0x2a9cb5,_0x3c2311){return db[_0x0b7f('0x28')]['find']({'where':{'id':_0x2a9cb5[_0x0b7f('0x2e')]['id']}})[_0x0b7f('0x17')](handleEntityNotFound(_0x3c2311,null))[_0x0b7f('0x17')](function(_0x3f3c0a){if(_0x3f3c0a){return _0x3f3c0a[_0x0b7f('0x78')](_0x2a9cb5[_0x0b7f('0x3a')][_0x0b7f('0x57')],_[_0x0b7f('0x79')](_0x2a9cb5['body'],['ids','id'])||{})[_0x0b7f('0x7a')](function(_0x3da116){for(var _0x229687=0x0;_0x229687<_0x2a9cb5['body'][_0x0b7f('0x57')][_0x0b7f('0x46')];_0x229687+=0x1){socket['emit'](_0x0b7f('0x63'),{'UserId':Number(_0x2a9cb5[_0x0b7f('0x3a')][_0x0b7f('0x57')][_0x229687]),'FaxQueueId':Number(_0x2a9cb5[_0x0b7f('0x2e')]['id'])});}return _0x3da116;});}})[_0x0b7f('0x17')](respondWithResult(_0x3c2311,null))[_0x0b7f('0x42')](handleError(_0x3c2311,null));};exports[_0x0b7f('0x7b')]=function(_0x1b37b3,_0x30c146){return db[_0x0b7f('0x28')][_0x0b7f('0x38')]({'where':{'id':_0x1b37b3[_0x0b7f('0x2e')]['id']}})['then'](handleEntityNotFound(_0x30c146,null))[_0x0b7f('0x17')](function(_0x380c63){if(_0x380c63){return _0x380c63[_0x0b7f('0x7b')](_0x1b37b3[_0x0b7f('0x2a')][_0x0b7f('0x57')])['then'](function(){if(_[_0x0b7f('0x7c')](_0x1b37b3[_0x0b7f('0x2a')][_0x0b7f('0x57')])){for(var _0x267691=0x0;_0x267691<_0x1b37b3[_0x0b7f('0x2a')][_0x0b7f('0x57')]['length'];_0x267691+=0x1){socket[_0x0b7f('0x62')](_0x0b7f('0x7d'),{'UserId':Number(_0x1b37b3[_0x0b7f('0x2a')][_0x0b7f('0x57')][_0x267691]),'FaxQueueId':Number(_0x1b37b3['params']['id'])});}}else{socket['emit'](_0x0b7f('0x7d'),{'UserId':Number(_0x1b37b3['query'][_0x0b7f('0x57')]),'FaxQueueId':Number(_0x1b37b3[_0x0b7f('0x2e')]['id'])});}});}})[_0x0b7f('0x17')](respondWithStatusCode(_0x30c146,null))[_0x0b7f('0x42')](handleError(_0x30c146,null));};exports[_0x0b7f('0x7e')]=function(_0x48992c,_0x3b65d5){var _0x532915={};var _0x2f9949={};var _0x3f0bce;var _0x4783b0;return db[_0x0b7f('0x28')][_0x0b7f('0x44')]({'where':{'id':_0x48992c[_0x0b7f('0x2e')]['id']}})['then'](handleEntityNotFound(_0x3b65d5,null))[_0x0b7f('0x17')](function(_0x100e6a){if(_0x100e6a){_0x3f0bce=_0x100e6a;_0x2f9949[_0x0b7f('0x2f')]=_[_0x0b7f('0x30')](db['User'][_0x0b7f('0x22')]);_0x2f9949[_0x0b7f('0x2a')]=_[_0x0b7f('0x30')](_0x48992c[_0x0b7f('0x2a')]);_0x2f9949[_0x0b7f('0x31')]=_['intersection'](_0x2f9949[_0x0b7f('0x2f')],_0x2f9949[_0x0b7f('0x2a')]);_0x532915[_0x0b7f('0x33')]=_['intersection'](_0x2f9949['model'],qs[_0x0b7f('0x34')](_0x48992c[_0x0b7f('0x2a')][_0x0b7f('0x34')]));_0x532915[_0x0b7f('0x33')]=_0x532915[_0x0b7f('0x33')]['length']?_0x532915[_0x0b7f('0x33')]:_0x2f9949[_0x0b7f('0x2f')];_0x532915[_0x0b7f('0x49')]=qs[_0x0b7f('0x56')](_0x48992c[_0x0b7f('0x2a')][_0x0b7f('0x56')]);_0x532915['where']=qs['filters'](_['pick'](_0x48992c[_0x0b7f('0x2a')],_0x2f9949[_0x0b7f('0x31')]));if(_0x48992c['query'][_0x0b7f('0x4b')]){_0x532915[_0x0b7f('0x27')]=_[_0x0b7f('0x36')](_0x532915[_0x0b7f('0x27')],{'$or':_['map'](_0x532915[_0x0b7f('0x33')],function(_0x4522bc){var _0x2312e5={};_0x2312e5[_0x4522bc]={'$like':'%'+_0x48992c[_0x0b7f('0x2a')][_0x0b7f('0x4b')]+'%'};return _0x2312e5;})});}_0x532915=_[_0x0b7f('0x36')]({},_0x532915,_0x48992c[_0x0b7f('0x37')]);return _0x3f0bce[_0x0b7f('0x7e')](_0x532915);}})[_0x0b7f('0x17')](function(_0x14a0dd){if(_0x14a0dd){_0x4783b0=_0x14a0dd['length'];if(!_0x48992c[_0x0b7f('0x2a')][_0x0b7f('0x47')](_0x0b7f('0x48'))){_0x532915[_0x0b7f('0x12')]=qs[_0x0b7f('0x12')](_0x48992c[_0x0b7f('0x2a')][_0x0b7f('0x12')]);_0x532915[_0x0b7f('0x10')]=qs[_0x0b7f('0x10')](_0x48992c[_0x0b7f('0x2a')][_0x0b7f('0x10')]);}return _0x3f0bce[_0x0b7f('0x7e')](_0x532915);}})[_0x0b7f('0x17')](function(_0x251792){if(_0x251792){return _0x251792?{'count':_0x4783b0,'rows':_0x251792}:null;}})[_0x0b7f('0x17')](respondWithResult(_0x3b65d5,null))[_0x0b7f('0x42')](handleError(_0x3b65d5,null));}; \ No newline at end of file +var _0x3fc6=['forEach','userFaxQueue:save','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','removeTeams','isEmpty','emit','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','bluebird','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','end','status','json','offset','limit','undefined','set','Content-Range','update','then','get','FaxQueues','destroy','error','name','index','FaxQueue','rawAttributes','type','getOptions','where','count','include','query','findAll','rows','catch','show','params','model','keys','filters','intersection','fields','attributes','includeAll','merge','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','find','describe','getMembers','findOne','UserFaxQueue','nolimit','order','sort','pick','FaxQueueId','filter','options','User','findAndCountAll','UserId','createdAt','map','format','%s/%s','faxPause','updatedAt','Team','length','getTeams','hasOwnProperty','addTeams','ids','Agents','online','voicePause','flatMap','transaction','each','findOrCreate'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3fc6,0x115));var _0x63fc=function(_0x51cf3b,_0x59c725){_0x51cf3b=_0x51cf3b-0x0;var _0x4119a7=_0x3fc6[_0x51cf3b];return _0x4119a7;};'use strict';var BPromise=require(_0x63fc('0x0'));var util=require('util');var _=require(_0x63fc('0x1'));var squel=require(_0x63fc('0x2'));var Redis=require(_0x63fc('0x3'));var qs=require(_0x63fc('0x4'));var logger=require('../../config/logger')(_0x63fc('0x5'));var config=require(_0x63fc('0x6'));var db=require(_0x63fc('0x7'))['db'];config['redis']=_[_0x63fc('0x8')](config['redis'],{'host':_0x63fc('0x9'),'port':0x18eb});var socket=require(_0x63fc('0xa'))(new Redis(config[_0x63fc('0xb')]));require('./faxQueue.socket')[_0x63fc('0xc')](socket);function respondWithStatusCode(_0xffe000,_0x144c55){_0x144c55=_0x144c55||0xcc;return function(_0x31e20c){if(_0x31e20c){return _0xffe000[_0x63fc('0xd')](_0x144c55);}return _0xffe000['status'](_0x144c55)[_0x63fc('0xe')]();};}function respondWithResult(_0x544f22,_0x5ad9a0){_0x5ad9a0=_0x5ad9a0||0xc8;return function(_0x6b8e8f){if(_0x6b8e8f){return _0x544f22[_0x63fc('0xf')](_0x5ad9a0)[_0x63fc('0x10')](_0x6b8e8f);}};}function respondWithFilteredResult(_0x4445ba,_0xddc7fe){return function(_0x240ea7){if(_0x240ea7){var _0x215fb5=typeof _0xddc7fe[_0x63fc('0x11')]==='undefined'&&typeof _0xddc7fe[_0x63fc('0x12')]===_0x63fc('0x13');var _0x3aef1d=_0x240ea7['count'];var _0x265e98=_0x215fb5?0x0:_0xddc7fe[_0x63fc('0x11')];var _0x3979f4=_0x215fb5?_0x240ea7['count']:_0xddc7fe[_0x63fc('0x11')]+_0xddc7fe[_0x63fc('0x12')];var _0x426479;if(_0x3979f4>=_0x3aef1d){_0x3979f4=_0x3aef1d;_0x426479=0xc8;}else{_0x426479=0xce;}_0x4445ba[_0x63fc('0xf')](_0x426479);return _0x4445ba[_0x63fc('0x14')](_0x63fc('0x15'),_0x265e98+'-'+_0x3979f4+'/'+_0x3aef1d)[_0x63fc('0x10')](_0x240ea7);}return null;};}function saveUpdates(_0x19a3f2){return function(_0x304ef6){if(_0x304ef6){return _0x304ef6[_0x63fc('0x16')](_0x19a3f2)[_0x63fc('0x17')](function(_0x2db18b){return _0x2db18b;});}return null;};}function removeEntity(_0x1283f8){return function(_0x2e1fb8){if(_0x2e1fb8){return _0x2e1fb8['destroy']()[_0x63fc('0x17')](function(){var _0x32aec1=_0x2e1fb8[_0x63fc('0x18')]({'plain':!![]});var _0x3c8735=_0x63fc('0x19');return db['UserProfileResource'][_0x63fc('0x1a')]({'where':{'type':_0x3c8735,'resourceId':_0x32aec1['id']}})[_0x63fc('0x17')](function(){return _0x2e1fb8;});})[_0x63fc('0x17')](function(){_0x1283f8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39afb5){return function(_0x383d10){if(!_0x383d10){_0x39afb5[_0x63fc('0xd')](0x194);}return _0x383d10;};}function handleError(_0x5810b8,_0x1053c7){_0x1053c7=_0x1053c7||0x1f4;return function(_0x26e442){logger[_0x63fc('0x1b')](_0x26e442['stack']);if(_0x26e442[_0x63fc('0x1c')]){delete _0x26e442['name'];}_0x5810b8[_0x63fc('0xf')](_0x1053c7)['send'](_0x26e442);};}exports[_0x63fc('0x1d')]=function(_0x153a1b,_0x1f26b6){var _0x327dc2={};var _0x1a349d={'count':0x0,'rows':[]};var _0x214424=_['map'](db[_0x63fc('0x1e')][_0x63fc('0x1f')],function(_0x2dda64){return{'name':_0x2dda64['fieldName'],'type':_0x2dda64[_0x63fc('0x20')]['key']};});_0x327dc2=qs[_0x63fc('0x21')](_0x214424,_0x153a1b);var _0x5ed7a5={'where':_0x327dc2[_0x63fc('0x22')]};return db[_0x63fc('0x1e')]['count'](_0x5ed7a5)[_0x63fc('0x17')](function(_0x380bea){_0x1a349d[_0x63fc('0x23')]=_0x380bea;_0x327dc2[_0x63fc('0x24')]=qs['include'](_0x153a1b[_0x63fc('0x25')]);return db['FaxQueue'][_0x63fc('0x26')](_0x327dc2);})[_0x63fc('0x17')](function(_0x5e8d3c){_0x1a349d[_0x63fc('0x27')]=_0x5e8d3c;return _0x1a349d;})[_0x63fc('0x17')](respondWithFilteredResult(_0x1f26b6,_0x327dc2))[_0x63fc('0x28')](handleError(_0x1f26b6,null));};exports[_0x63fc('0x29')]=function(_0x609a64,_0x3eecac){var _0x2e95fd={'raw':!![],'where':{'id':_0x609a64[_0x63fc('0x2a')]['id']}},_0x1206bb={};_0x1206bb[_0x63fc('0x2b')]=_['keys'](db[_0x63fc('0x1e')]['rawAttributes']);_0x1206bb[_0x63fc('0x25')]=_[_0x63fc('0x2c')](_0x609a64[_0x63fc('0x25')]);_0x1206bb[_0x63fc('0x2d')]=_[_0x63fc('0x2e')](_0x1206bb[_0x63fc('0x2b')],_0x1206bb[_0x63fc('0x25')]);_0x2e95fd['attributes']=_[_0x63fc('0x2e')](_0x1206bb[_0x63fc('0x2b')],qs[_0x63fc('0x2f')](_0x609a64[_0x63fc('0x25')]['fields']));_0x2e95fd['attributes']=_0x2e95fd[_0x63fc('0x30')]['length']?_0x2e95fd[_0x63fc('0x30')]:_0x1206bb[_0x63fc('0x2b')];if(_0x609a64[_0x63fc('0x25')][_0x63fc('0x31')]){_0x2e95fd[_0x63fc('0x24')]=[{'all':!![]}];}_0x2e95fd=_[_0x63fc('0x32')]({},_0x2e95fd,_0x609a64['options']);return db[_0x63fc('0x1e')]['find'](_0x2e95fd)[_0x63fc('0x17')](handleEntityNotFound(_0x3eecac,null))[_0x63fc('0x17')](respondWithResult(_0x3eecac,null))['catch'](handleError(_0x3eecac,null));};exports[_0x63fc('0x33')]=function(_0x1e6f68,_0x43f97f){return db[_0x63fc('0x1e')][_0x63fc('0x33')](_0x1e6f68[_0x63fc('0x34')],{})[_0x63fc('0x17')](function(_0x37edef){var _0x319b91=_0x1e6f68[_0x63fc('0x35')][_0x63fc('0x18')]({'plain':!![]});if(!_0x319b91)throw new Error(_0x63fc('0x36'));if(_0x319b91[_0x63fc('0x37')]===_0x63fc('0x35')){var _0x3f06aa=_0x37edef['get']({'plain':!![]});var _0x5bde5f='FaxQueues';return db[_0x63fc('0x38')]['find']({'where':{'name':_0x5bde5f,'userProfileId':_0x319b91[_0x63fc('0x39')]},'raw':!![]})['then'](function(_0x106b3c){if(_0x106b3c&&_0x106b3c[_0x63fc('0x3a')]===0x0){return db[_0x63fc('0x3b')][_0x63fc('0x33')]({'name':_0x3f06aa[_0x63fc('0x1c')],'resourceId':_0x3f06aa['id'],'type':_0x106b3c[_0x63fc('0x1c')],'sectionId':_0x106b3c['id']},{})[_0x63fc('0x17')](function(){return _0x37edef;});}else{return _0x37edef;}})['catch'](function(_0x48cce1){logger[_0x63fc('0x1b')](_0x63fc('0x3c'),_0x48cce1);throw _0x48cce1;});}return _0x37edef;})[_0x63fc('0x17')](respondWithResult(_0x43f97f,0xc9))[_0x63fc('0x28')](handleError(_0x43f97f,null));};exports[_0x63fc('0x16')]=function(_0x37cf7c,_0x132aa0){if(_0x37cf7c[_0x63fc('0x34')]['id']){delete _0x37cf7c[_0x63fc('0x34')]['id'];}return db[_0x63fc('0x1e')][_0x63fc('0x3d')]({'where':{'id':_0x37cf7c['params']['id']}})[_0x63fc('0x17')](handleEntityNotFound(_0x132aa0,null))['then'](saveUpdates(_0x37cf7c['body'],null))[_0x63fc('0x17')](respondWithResult(_0x132aa0,null))[_0x63fc('0x28')](handleError(_0x132aa0,null));};exports['destroy']=function(_0x15e550,_0x2c36da){return db[_0x63fc('0x1e')]['find']({'where':{'id':_0x15e550['params']['id']}})[_0x63fc('0x17')](handleEntityNotFound(_0x2c36da,null))[_0x63fc('0x17')](removeEntity(_0x2c36da,null))[_0x63fc('0x28')](handleError(_0x2c36da,null));};exports[_0x63fc('0x3e')]=function(_0x5918da,_0x210c3e){return db[_0x63fc('0x1e')][_0x63fc('0x3e')]()[_0x63fc('0x17')](respondWithResult(_0x210c3e,null))['catch'](handleError(_0x210c3e,null));};exports[_0x63fc('0x3f')]=function(_0x31b6af,_0x9d3f91){var _0x1b3bb7={'raw':!![],'where':{}},_0x1a796f={},_0xc47db9;return db[_0x63fc('0x1e')][_0x63fc('0x40')]({'where':{'id':_0x31b6af[_0x63fc('0x2a')]['id']}})[_0x63fc('0x17')](handleEntityNotFound(_0x9d3f91,null))[_0x63fc('0x17')](function(_0x5a3b2d){if(_0x5a3b2d){_0xc47db9=_0x5a3b2d['get']({'plain':!![]});_0x1a796f[_0x63fc('0x2b')]=_[_0x63fc('0x2c')](db[_0x63fc('0x41')][_0x63fc('0x1f')]);_0x1a796f[_0x63fc('0x25')]=_[_0x63fc('0x2c')](_0x31b6af['query']);_0x1a796f['filters']=_['intersection'](_0x1a796f['model'],_0x1a796f['query']);_0x1b3bb7[_0x63fc('0x30')]=_['intersection'](_0x1a796f[_0x63fc('0x2b')],qs['fields'](_0x31b6af[_0x63fc('0x25')][_0x63fc('0x2f')]));_0x1b3bb7[_0x63fc('0x30')]=_0x1b3bb7[_0x63fc('0x30')]['length']?_0x1b3bb7[_0x63fc('0x30')]:_0x1a796f['model'];if(!_0x31b6af['query']['hasOwnProperty'](_0x63fc('0x42'))){_0x1b3bb7['limit']=qs['limit'](_0x31b6af[_0x63fc('0x25')][_0x63fc('0x12')]);_0x1b3bb7[_0x63fc('0x11')]=qs[_0x63fc('0x11')](_0x31b6af[_0x63fc('0x25')][_0x63fc('0x11')]);}_0x1b3bb7[_0x63fc('0x43')]=qs[_0x63fc('0x44')](_0x31b6af['query']['sort']);_0x1b3bb7['where']=qs[_0x63fc('0x2d')](_[_0x63fc('0x45')](_0x31b6af['query'],_0x1a796f['filters']));_0x1b3bb7[_0x63fc('0x22')][_0x63fc('0x46')]=_0x5a3b2d['id'];if(_0x31b6af[_0x63fc('0x25')][_0x63fc('0x47')]){_0x1b3bb7[_0x63fc('0x22')]=_['merge'](_0x1b3bb7['where'],{'$or':_['map'](_0x1b3bb7[_0x63fc('0x30')],function(_0x47c79e){var _0x2c2e46={};_0x2c2e46[_0x47c79e]={'$like':'%'+_0x31b6af[_0x63fc('0x25')][_0x63fc('0x47')]+'%'};return _0x2c2e46;})});}_0x1b3bb7=_['merge']({},_0x1b3bb7,_0x31b6af[_0x63fc('0x48')]);return db['UserFaxQueue'][_0x63fc('0x26')](_0x1b3bb7);}})[_0x63fc('0x17')](function(_0x478202){if(_0x478202){return db[_0x63fc('0x49')][_0x63fc('0x4a')]({'where':{'id':_['map'](_0x478202,_0x63fc('0x4b')),'role':'agent'},'attributes':['id',_0x63fc('0x1c'),'faxPause','updatedAt',_0x63fc('0x4c')]});}})[_0x63fc('0x17')](function(_0x5a97b9){if(_0x5a97b9){return{'count':_0x5a97b9['count'],'rows':_[_0x63fc('0x4d')](_0x5a97b9['rows'],function(_0x2dfc9b){return{'membername':_0x2dfc9b[_0x63fc('0x1c')],'UserId':_0x2dfc9b['id'],'queue_name':_0xc47db9[_0x63fc('0x1c')],'FaxQueueId':_0xc47db9['id'],'interface':util[_0x63fc('0x4e')](_0x63fc('0x4f'),'SIP',_0x2dfc9b[_0x63fc('0x1c')]),'penalty':0x0,'paused':_0x2dfc9b[_0x63fc('0x50')],'createdAt':_0x2dfc9b['createdAt'],'updatedAt':_0x2dfc9b[_0x63fc('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x63fc('0x17')](respondWithFilteredResult(_0x9d3f91,_0x1b3bb7))[_0x63fc('0x28')](handleError(_0x9d3f91,null));};exports['getTeams']=function(_0x5ded6c,_0x1e3d71){var _0x36fcf9={};var _0x4dfbdc={};var _0x3ba07e;var _0x3ab0fd;return db[_0x63fc('0x1e')]['findOne']({'where':{'id':_0x5ded6c[_0x63fc('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1e3d71,null))[_0x63fc('0x17')](function(_0x60be36){if(_0x60be36){_0x3ba07e=_0x60be36;_0x4dfbdc[_0x63fc('0x2b')]=_['keys'](db[_0x63fc('0x52')][_0x63fc('0x1f')]);_0x4dfbdc[_0x63fc('0x25')]=_[_0x63fc('0x2c')](_0x5ded6c['query']);_0x4dfbdc[_0x63fc('0x2d')]=_[_0x63fc('0x2e')](_0x4dfbdc[_0x63fc('0x2b')],_0x4dfbdc['query']);_0x36fcf9[_0x63fc('0x30')]=_[_0x63fc('0x2e')](_0x4dfbdc[_0x63fc('0x2b')],qs[_0x63fc('0x2f')](_0x5ded6c['query']['fields']));_0x36fcf9[_0x63fc('0x30')]=_0x36fcf9[_0x63fc('0x30')][_0x63fc('0x53')]?_0x36fcf9[_0x63fc('0x30')]:_0x4dfbdc[_0x63fc('0x2b')];_0x36fcf9[_0x63fc('0x43')]=qs[_0x63fc('0x44')](_0x5ded6c[_0x63fc('0x25')][_0x63fc('0x44')]);_0x36fcf9[_0x63fc('0x22')]=qs[_0x63fc('0x2d')](_[_0x63fc('0x45')](_0x5ded6c[_0x63fc('0x25')],_0x4dfbdc['filters']));if(_0x5ded6c[_0x63fc('0x25')][_0x63fc('0x47')]){_0x36fcf9[_0x63fc('0x22')]=_[_0x63fc('0x32')](_0x36fcf9[_0x63fc('0x22')],{'$or':_[_0x63fc('0x4d')](_0x36fcf9[_0x63fc('0x30')],function(_0x360d6a){var _0x4a3064={};_0x4a3064[_0x360d6a]={'$like':'%'+_0x5ded6c['query'][_0x63fc('0x47')]+'%'};return _0x4a3064;})});}_0x36fcf9=_[_0x63fc('0x32')]({},_0x36fcf9,_0x5ded6c[_0x63fc('0x48')]);return _0x3ba07e[_0x63fc('0x54')](_0x36fcf9);}})['then'](function(_0xf06633){if(_0xf06633){_0x3ab0fd=_0xf06633['length'];if(!_0x5ded6c[_0x63fc('0x25')][_0x63fc('0x55')](_0x63fc('0x42'))){_0x36fcf9[_0x63fc('0x12')]=qs[_0x63fc('0x12')](_0x5ded6c[_0x63fc('0x25')][_0x63fc('0x12')]);_0x36fcf9['offset']=qs[_0x63fc('0x11')](_0x5ded6c['query'][_0x63fc('0x11')]);}return _0x3ba07e['getTeams'](_0x36fcf9);}})['then'](function(_0x20c0ed){if(_0x20c0ed){return _0x20c0ed?{'count':_0x3ab0fd,'rows':_0x20c0ed}:null;}})[_0x63fc('0x17')](respondWithResult(_0x1e3d71,null))[_0x63fc('0x28')](handleError(_0x1e3d71,null));};exports[_0x63fc('0x56')]=function(_0x3d45b3,_0x486861){var _0x351a9b=_0x3d45b3[_0x63fc('0x34')][_0x63fc('0x57')];return db[_0x63fc('0x52')][_0x63fc('0x26')]({'where':{'id':_0x351a9b},'attributes':['id'],'include':[{'model':db[_0x63fc('0x49')],'as':_0x63fc('0x58'),'attributes':['id',_0x63fc('0x1c'),_0x63fc('0x59'),_0x63fc('0x5a'),'interface'],'raw':!![]}]})[_0x63fc('0x17')](function(_0x77e628){if(_0x77e628){var _0x1e3bb5=_[_0x63fc('0x5b')](_0x77e628,function(_0x34cea9){var _0x53b78a=_0x34cea9[_0x63fc('0x18')]({'plain':!![]});return _0x53b78a[_0x63fc('0x58')];});return db[_0x63fc('0x1e')][_0x63fc('0x3d')]({'where':{'id':_0x3d45b3[_0x63fc('0x2a')]['id']}})[_0x63fc('0x17')](function(_0x10594f){return db['sequelize'][_0x63fc('0x5c')](function(_0x3e4358){return _0x10594f[_0x63fc('0x56')](_0x351a9b,{'transaction':_0x3e4358})['then'](function(){return BPromise[_0x63fc('0x5d')](_0x1e3bb5,function(_0x354828){return db[_0x63fc('0x41')][_0x63fc('0x5e')]({'where':{'UserId':_0x354828['id'],'FaxQueueId':_0x3d45b3[_0x63fc('0x2a')]['id']},'transaction':_0x3e4358});});})[_0x63fc('0x17')](function(){_0x1e3bb5[_0x63fc('0x5f')](function(_0x13f7d8){socket['emit'](_0x63fc('0x60'),{'UserId':_0x13f7d8['id'],'FaxQueueId':_0x10594f['id']});});});});});}})[_0x63fc('0x17')](respondWithStatusCode(_0x486861,null))[_0x63fc('0x28')](handleError(_0x486861,null));};exports['removeTeams']=function(_0x1b2229,_0x1e35d6){return db['Team'][_0x63fc('0x26')]({'where':{'id':_0x1b2229[_0x63fc('0x25')][_0x63fc('0x57')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x63fc('0x58'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1e35d6,null))[_0x63fc('0x17')](function(_0x35d4c9){var _0xa60f2e=_[_0x63fc('0x4d')](_0x35d4c9,'id');var _0x1ab188=[];var _0x134388=[];var _0x5c3230=squel['select']();_0x5c3230[_0x63fc('0x61')](_0x63fc('0x62'))[_0x63fc('0x63')]('team_has_fax_queues','tq')[_0x63fc('0x64')](_0x63fc('0x65'),'ut',_0x63fc('0x66'))[_0x63fc('0x22')]('FaxQueueId\x20=\x20?',_0x1b2229[_0x63fc('0x2a')]['id']);for(var _0x357082=0x0;_0x357082<_0x35d4c9[_0x63fc('0x53')];_0x357082+=0x1){let _0x1f34b5=_0x35d4c9[_0x357082];for(var _0x1cda73=0x0;_0x1cda73<_0x1f34b5[_0x63fc('0x58')]['length'];_0x1cda73+=0x1){let _0x543582=_0x1f34b5['Agents'][_0x1cda73];var _0x5a656f=_0x5c3230['clone']();_0x5a656f[_0x63fc('0x22')](_0x63fc('0x67'),_0x543582['id']);_0x134388['push'](db[_0x63fc('0x68')][_0x63fc('0x25')](_0x5a656f[_0x63fc('0x69')](),{'type':db[_0x63fc('0x68')][_0x63fc('0x6a')][_0x63fc('0x6b')]})[_0x63fc('0x17')](function(_0x46485c){if(_0x46485c['length']===0x1){return _0x543582['id'];}else{var _0x21da38=_[_0x63fc('0x6c')](_[_0x63fc('0x4d')](_0x46485c,_0x63fc('0x6d')),function(_0x559626){return _[_0x63fc('0x6e')](_0xa60f2e,_0x559626);});if(_0x21da38){return _0x543582['id'];}}}));}}return BPromise[_0x63fc('0x6f')](_0x134388)['then'](function(_0x38c3dc){_0x1ab188=_(_0x1ab188)[_0x63fc('0x70')](_0x38c3dc)['compact']()[_0x63fc('0x71')]();return db[_0x63fc('0x1e')][_0x63fc('0x3d')]({'where':{'id':_0x1b2229[_0x63fc('0x2a')]['id']}})[_0x63fc('0x17')](function(_0x2a2f77){return db[_0x63fc('0x68')][_0x63fc('0x5c')](function(_0x244293){return _0x2a2f77[_0x63fc('0x72')](_0x1b2229[_0x63fc('0x25')][_0x63fc('0x57')],{'transaction':_0x244293})[_0x63fc('0x17')](function(){if(!_[_0x63fc('0x73')](_0x1ab188)){return _0x2a2f77['removeAgents'](_0x1ab188,{'transaction':_0x244293});}})['then'](function(){_0x1ab188[_0x63fc('0x5f')](function(_0x150724){socket[_0x63fc('0x74')](_0x63fc('0x75'),{'UserId':_0x150724,'FaxQueueId':_0x2a2f77['id']});});});});});});})[_0x63fc('0x17')](respondWithStatusCode(_0x1e35d6,null))[_0x63fc('0x28')](handleError(_0x1e35d6,null));};exports[_0x63fc('0x76')]=function(_0x51b610,_0x855ec7){return db[_0x63fc('0x1e')][_0x63fc('0x3d')]({'where':{'id':_0x51b610[_0x63fc('0x2a')]['id']}})[_0x63fc('0x17')](handleEntityNotFound(_0x855ec7,null))['then'](function(_0x4610b4){if(_0x4610b4){return _0x4610b4[_0x63fc('0x76')](_0x51b610['body'][_0x63fc('0x57')],_[_0x63fc('0x77')](_0x51b610[_0x63fc('0x34')],['ids','id'])||{})[_0x63fc('0x78')](function(_0x225c18){for(var _0x5ebfc9=0x0;_0x5ebfc9<_0x51b610[_0x63fc('0x34')][_0x63fc('0x57')][_0x63fc('0x53')];_0x5ebfc9+=0x1){socket[_0x63fc('0x74')]('userFaxQueue:save',{'UserId':Number(_0x51b610['body']['ids'][_0x5ebfc9]),'FaxQueueId':Number(_0x51b610[_0x63fc('0x2a')]['id'])});}return _0x225c18;});}})[_0x63fc('0x17')](respondWithResult(_0x855ec7,null))['catch'](handleError(_0x855ec7,null));};exports[_0x63fc('0x79')]=function(_0x27e49b,_0x2a2660){return db[_0x63fc('0x1e')]['find']({'where':{'id':_0x27e49b['params']['id']}})[_0x63fc('0x17')](handleEntityNotFound(_0x2a2660,null))['then'](function(_0x4c6578){if(_0x4c6578){return _0x4c6578[_0x63fc('0x79')](_0x27e49b[_0x63fc('0x25')][_0x63fc('0x57')])[_0x63fc('0x17')](function(){if(_[_0x63fc('0x7a')](_0x27e49b['query'][_0x63fc('0x57')])){for(var _0x3ca1e6=0x0;_0x3ca1e6<_0x27e49b[_0x63fc('0x25')][_0x63fc('0x57')][_0x63fc('0x53')];_0x3ca1e6+=0x1){socket[_0x63fc('0x74')](_0x63fc('0x75'),{'UserId':Number(_0x27e49b[_0x63fc('0x25')]['ids'][_0x3ca1e6]),'FaxQueueId':Number(_0x27e49b['params']['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x27e49b[_0x63fc('0x25')][_0x63fc('0x57')]),'FaxQueueId':Number(_0x27e49b[_0x63fc('0x2a')]['id'])});}});}})[_0x63fc('0x17')](respondWithStatusCode(_0x2a2660,null))['catch'](handleError(_0x2a2660,null));};exports[_0x63fc('0x7b')]=function(_0x1c707f,_0x1ad5f9){var _0x26ad64={};var _0x4b1d68={};var _0x1da4cb;var _0x417e86;return db['FaxQueue'][_0x63fc('0x40')]({'where':{'id':_0x1c707f[_0x63fc('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1ad5f9,null))[_0x63fc('0x17')](function(_0x5ad271){if(_0x5ad271){_0x1da4cb=_0x5ad271;_0x4b1d68[_0x63fc('0x2b')]=_[_0x63fc('0x2c')](db[_0x63fc('0x49')][_0x63fc('0x1f')]);_0x4b1d68[_0x63fc('0x25')]=_['keys'](_0x1c707f[_0x63fc('0x25')]);_0x4b1d68[_0x63fc('0x2d')]=_[_0x63fc('0x2e')](_0x4b1d68[_0x63fc('0x2b')],_0x4b1d68[_0x63fc('0x25')]);_0x26ad64['attributes']=_[_0x63fc('0x2e')](_0x4b1d68[_0x63fc('0x2b')],qs[_0x63fc('0x2f')](_0x1c707f[_0x63fc('0x25')][_0x63fc('0x2f')]));_0x26ad64[_0x63fc('0x30')]=_0x26ad64['attributes'][_0x63fc('0x53')]?_0x26ad64['attributes']:_0x4b1d68[_0x63fc('0x2b')];_0x26ad64['order']=qs[_0x63fc('0x44')](_0x1c707f['query'][_0x63fc('0x44')]);_0x26ad64[_0x63fc('0x22')]=qs[_0x63fc('0x2d')](_[_0x63fc('0x45')](_0x1c707f[_0x63fc('0x25')],_0x4b1d68[_0x63fc('0x2d')]));if(_0x1c707f[_0x63fc('0x25')]['filter']){_0x26ad64[_0x63fc('0x22')]=_[_0x63fc('0x32')](_0x26ad64['where'],{'$or':_[_0x63fc('0x4d')](_0x26ad64[_0x63fc('0x30')],function(_0x1a547d){var _0x3015e1={};_0x3015e1[_0x1a547d]={'$like':'%'+_0x1c707f[_0x63fc('0x25')][_0x63fc('0x47')]+'%'};return _0x3015e1;})});}_0x26ad64=_[_0x63fc('0x32')]({},_0x26ad64,_0x1c707f[_0x63fc('0x48')]);return _0x1da4cb['getAgents'](_0x26ad64);}})[_0x63fc('0x17')](function(_0x461556){if(_0x461556){_0x417e86=_0x461556[_0x63fc('0x53')];if(!_0x1c707f[_0x63fc('0x25')]['hasOwnProperty'](_0x63fc('0x42'))){_0x26ad64[_0x63fc('0x12')]=qs[_0x63fc('0x12')](_0x1c707f[_0x63fc('0x25')][_0x63fc('0x12')]);_0x26ad64[_0x63fc('0x11')]=qs[_0x63fc('0x11')](_0x1c707f[_0x63fc('0x25')][_0x63fc('0x11')]);}return _0x1da4cb['getAgents'](_0x26ad64);}})[_0x63fc('0x17')](function(_0x1c4f06){if(_0x1c4f06){return _0x1c4f06?{'count':_0x417e86,'rows':_0x1c4f06}:null;}})['then'](respondWithResult(_0x1ad5f9,null))[_0x63fc('0x28')](handleError(_0x1ad5f9,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 2397912..aef3368 100644 --- a/server/api/faxQueue/faxQueue.events.js +++ b/server/api/faxQueue/faxQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x016d=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxQueue'];(function(_0x4fa291,_0x56e289){var _0x506d9b=function(_0x24c31f){while(--_0x24c31f){_0x4fa291['push'](_0x4fa291['shift']());}};_0x506d9b(++_0x56e289);}(_0x016d,0xf9));var _0xd016=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x016d[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xd016('0x0'));var FaxQueue=require(_0xd016('0x1'))['db'][_0xd016('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xd016('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd016('0x4'),'afterDestroy':_0xd016('0x5')};function emitEvent(_0x3676c4){return function(_0x2d5920,_0x42fb4e,_0x1f8e86){FaxQueueEvents[_0xd016('0x6')](_0x3676c4+':'+_0x2d5920['id'],_0x2d5920);FaxQueueEvents[_0xd016('0x6')](_0x3676c4,_0x2d5920);_0x1f8e86(null);};}for(var e in events){if(events[_0xd016('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xd016('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0xe635=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x90ae4b,_0x40a3b6){var _0x23e212=function(_0xdf876b){while(--_0xdf876b){_0x90ae4b['push'](_0x90ae4b['shift']());}};_0x23e212(++_0x40a3b6);}(_0xe635,0x185));var _0x5e63=function(_0x19da88,_0x2f2280){_0x19da88=_0x19da88-0x0;var _0x36ed9b=_0xe635[_0x19da88];return _0x36ed9b;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x5e63('0x0'))['db'][_0x5e63('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x5e63('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5e63('0x3'),'afterDestroy':_0x5e63('0x4')};function emitEvent(_0x1fd4e8){return function(_0x1455b1,_0x451c0f,_0x1590c9){FaxQueueEvents['emit'](_0x1fd4e8+':'+_0x1455b1['id'],_0x1455b1);FaxQueueEvents[_0x5e63('0x5')](_0x1fd4e8,_0x1455b1);_0x1590c9(null);};}for(var e in events){if(events[_0x5e63('0x6')](e)){var event=events[e];FaxQueue[_0x5e63('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 75293c4..bacd7d3 100644 --- a/server/api/faxQueue/faxQueue.model.js +++ b/server/api/faxQueue/faxQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd1c=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','define','FaxQueue','fax_queues'];(function(_0xc64699,_0x1b3076){var _0x40732e=function(_0x23d369){while(--_0x23d369){_0xc64699['push'](_0xc64699['shift']());}};_0x40732e(++_0x1b3076);}(_0xfd1c,0xf0));var _0xcfd1=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0xfd1c[_0x4b4f24];return _0x1c13d4;};'use strict';var _=require('lodash');var util=require(_0xcfd1('0x0'));var logger=require(_0xcfd1('0x1'))(_0xcfd1('0x2'));var moment=require('moment');var BPromise=require(_0xcfd1('0x3'));var rp=require(_0xcfd1('0x4'));var fs=require('fs');var path=require(_0xcfd1('0x5'));var rimraf=require(_0xcfd1('0x6'));var config=require(_0xcfd1('0x7'));var attributes=require(_0xcfd1('0x8'));module['exports']=function(_0x1b436b,_0x541e04){return _0x1b436b[_0xcfd1('0x9')](_0xcfd1('0xa'),attributes,{'tableName':_0xcfd1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c17=['exports','define','FaxQueue','fax_queues','util','../../config/logger','api','request-promise','../../config/environment','./faxQueue.attributes'];(function(_0x23e505,_0x241c28){var _0x17a476=function(_0x80780e){while(--_0x80780e){_0x23e505['push'](_0x23e505['shift']());}};_0x17a476(++_0x241c28);}(_0x9c17,0x112));var _0x79c1=function(_0xe65ac8,_0x2691be){_0xe65ac8=_0xe65ac8-0x0;var _0x202ba1=_0x9c17[_0xe65ac8];return _0x202ba1;};'use strict';var _=require('lodash');var util=require(_0x79c1('0x0'));var logger=require(_0x79c1('0x1'))(_0x79c1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x79c1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x79c1('0x4'));var attributes=require(_0x79c1('0x5'));module[_0x79c1('0x6')]=function(_0x345233,_0x475a25){return _0x345233[_0x79c1('0x7')](_0x79c1('0x8'),attributes,{'tableName':_0x79c1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 37816c5..b443d71 100644 --- a/server/api/faxQueue/faxQueue.rpc.js +++ b/server/api/faxQueue/faxQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa890=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring'];(function(_0xe323e3,_0x110473){var _0x208a43=function(_0x18695c){while(--_0x18695c){_0xe323e3['push'](_0xe323e3['shift']());}};_0x208a43(++_0x110473);}(_0xa890,0x163));var _0x0a89=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0xa890[_0x504df1];return _0x1063b5;};'use strict';var _=require(_0x0a89('0x0'));var util=require(_0x0a89('0x1'));var moment=require(_0x0a89('0x2'));var BPromise=require(_0x0a89('0x3'));var rs=require(_0x0a89('0x4'));var fs=require('fs');var Redis=require(_0x0a89('0x5'));var db=require(_0x0a89('0x6'))['db'];var utils=require(_0x0a89('0x7'));var logger=require('../../config/logger')(_0x0a89('0x8'));var config=require(_0x0a89('0x9'));var jayson=require(_0x0a89('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x0a89('0xb')]=_[_0x0a89('0xc')](config[_0x0a89('0xb')],{'host':_0x0a89('0xd'),'port':0x18eb});var socket=require(_0x0a89('0xe'))(new Redis(config[_0x0a89('0xb')]));require(_0x0a89('0xf'))['register'](socket);function respondWithRpcPromise(_0x425041,_0x223eee,_0x1e657a){return new BPromise(function(_0x193729,_0xa7db8d){return client[_0x0a89('0x10')](_0x425041,_0x1e657a)['then'](function(_0x46570c){logger[_0x0a89('0x11')](_0x0a89('0x12'),_0x223eee,_0x0a89('0x13'));logger[_0x0a89('0x14')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x223eee,'request\x20sent',JSON['stringify'](_0x46570c));if(_0x46570c['error']){if(_0x46570c[_0x0a89('0x15')][_0x0a89('0x16')]===0x1f4){logger[_0x0a89('0x15')](_0x0a89('0x12'),_0x223eee,_0x46570c['error'][_0x0a89('0x17')]);return _0xa7db8d(_0x46570c[_0x0a89('0x15')][_0x0a89('0x17')]);}logger[_0x0a89('0x15')](_0x0a89('0x12'),_0x223eee,_0x46570c['error']['message']);return _0x193729(_0x46570c['error']['message']);}else{logger[_0x0a89('0x11')](_0x0a89('0x12'),_0x223eee,'request\x20sent');_0x193729(_0x46570c[_0x0a89('0x18')][_0x0a89('0x17')]);}})[_0x0a89('0x19')](function(_0xc14c66){logger[_0x0a89('0x15')]('FaxQueue,\x20%s,\x20%s',_0x223eee,_0xc14c66);_0xa7db8d(_0xc14c66);});});}exports[_0x0a89('0x1a')]=function(_0x21ee87){var _0x509d19=this;return new Promise(function(_0x2c869b,_0x103ce5){return db[_0x0a89('0x1b')][_0x0a89('0x1c')]({'raw':_0x21ee87['options']?_0x21ee87[_0x0a89('0x1d')][_0x0a89('0x1e')]===undefined?!![]:![]:!![],'where':_0x21ee87[_0x0a89('0x1d')]?_0x21ee87[_0x0a89('0x1d')][_0x0a89('0x1f')]||null:null,'attributes':_0x21ee87[_0x0a89('0x1d')]?_0x21ee87[_0x0a89('0x1d')][_0x0a89('0x20')]||null:null,'limit':_0x21ee87[_0x0a89('0x1d')]?_0x21ee87[_0x0a89('0x1d')][_0x0a89('0x21')]||null:null,'include':_0x21ee87[_0x0a89('0x1d')]?_0x21ee87[_0x0a89('0x1d')][_0x0a89('0x22')]?_['map'](_0x21ee87[_0x0a89('0x1d')][_0x0a89('0x22')],function(_0x4ac68b){return{'model':db[_0x4ac68b[_0x0a89('0x23')]],'as':_0x4ac68b['as'],'attributes':_0x4ac68b[_0x0a89('0x20')],'include':_0x4ac68b[_0x0a89('0x22')]?_[_0x0a89('0x24')](_0x4ac68b['include'],function(_0x296803){return{'model':db[_0x296803[_0x0a89('0x23')]],'as':_0x296803['as'],'attributes':_0x296803[_0x0a89('0x20')],'include':_0x296803['include']?_[_0x0a89('0x24')](_0x296803[_0x0a89('0x22')],function(_0x4e1289){return{'model':db[_0x4e1289[_0x0a89('0x23')]],'as':_0x4e1289['as'],'attributes':_0x4e1289[_0x0a89('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41f084){logger[_0x0a89('0x11')]('GetFaxQueue',_0x21ee87);logger[_0x0a89('0x14')]('GetFaxQueue',_0x21ee87,JSON[_0x0a89('0x25')](_0x41f084));_0x2c869b(_0x41f084);})['catch'](function(_0x3fc2bf){logger[_0x0a89('0x15')](_0x0a89('0x1a'),_0x3fc2bf[_0x0a89('0x17')],_0x21ee87);_0x103ce5(_0x509d19[_0x0a89('0x15')](0x1f4,_0x3fc2bf['message']));});});};exports[_0x0a89('0x26')]=function(_0x5ca765){var _0x46cd3=this;return new Promise(function(_0x39f9c4,_0x244835){return db['FaxQueue'][_0x0a89('0x27')]({'raw':_0x5ca765[_0x0a89('0x1d')]?_0x5ca765['options'][_0x0a89('0x1e')]===undefined?!![]:![]:!![],'where':_0x5ca765['options']?_0x5ca765['options'][_0x0a89('0x1f')]||null:null,'attributes':_0x5ca765['options']?_0x5ca765[_0x0a89('0x1d')][_0x0a89('0x20')]||null:null,'include':_0x5ca765[_0x0a89('0x1d')]?_0x5ca765[_0x0a89('0x1d')][_0x0a89('0x22')]?_[_0x0a89('0x24')](_0x5ca765['options'][_0x0a89('0x22')],function(_0x41c65d){return{'model':db[_0x41c65d['model']],'as':_0x41c65d['as'],'attributes':_0x41c65d[_0x0a89('0x20')],'include':_0x41c65d['include']?_[_0x0a89('0x24')](_0x41c65d['include'],function(_0x51fbfc){return{'model':db[_0x51fbfc[_0x0a89('0x23')]],'as':_0x51fbfc['as'],'attributes':_0x51fbfc['attributes'],'include':_0x51fbfc[_0x0a89('0x22')]?_[_0x0a89('0x24')](_0x51fbfc[_0x0a89('0x22')],function(_0x5770d2){return{'model':db[_0x5770d2[_0x0a89('0x23')]],'as':_0x5770d2['as'],'attributes':_0x5770d2[_0x0a89('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29445b){logger['info']('ShowFaxQueue',_0x5ca765);logger[_0x0a89('0x14')](_0x0a89('0x26'),_0x5ca765,JSON['stringify'](_0x29445b));_0x39f9c4(_0x29445b);})[_0x0a89('0x19')](function(_0x13369e){logger[_0x0a89('0x15')](_0x0a89('0x26'),_0x13369e[_0x0a89('0x17')],_0x5ca765);_0x244835(_0x46cd3['error'](0x1f4,_0x13369e[_0x0a89('0x17')]));});});}; \ No newline at end of file +var _0x2a62=['FaxQueue','findAll','options','raw','where','attributes','limit','map','include','model','then','debug','ShowFaxQueue','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','FaxQueue,\x20%s,\x20%s','catch','GetFaxQueue'];(function(_0x40253e,_0x48fce2){var _0x346e29=function(_0x4e156b){while(--_0x4e156b){_0x40253e['push'](_0x40253e['shift']());}};_0x346e29(++_0x48fce2);}(_0x2a62,0xcb));var _0x22a6=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x2a62[_0x3b0731];return _0x4204d7;};'use strict';var _=require('lodash');var util=require(_0x22a6('0x0'));var moment=require(_0x22a6('0x1'));var BPromise=require(_0x22a6('0x2'));var rs=require(_0x22a6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22a6('0x4'))['db'];var utils=require(_0x22a6('0x5'));var logger=require('../../config/logger')(_0x22a6('0x6'));var config=require(_0x22a6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x22a6('0x8')]['http']({'port':0x232a});config[_0x22a6('0x9')]=_[_0x22a6('0xa')](config[_0x22a6('0x9')],{'host':_0x22a6('0xb'),'port':0x18eb});var socket=require(_0x22a6('0xc'))(new Redis(config[_0x22a6('0x9')]));require(_0x22a6('0xd'))[_0x22a6('0xe')](socket);function respondWithRpcPromise(_0x4f59d7,_0x472361,_0x549649){return new BPromise(function(_0xca3943,_0x21321a){return client[_0x22a6('0xf')](_0x4f59d7,_0x549649)['then'](function(_0x511f67){logger[_0x22a6('0x10')]('FaxQueue,\x20%s,\x20%s',_0x472361,'request\x20sent');logger['debug'](_0x22a6('0x11'),_0x472361,_0x22a6('0x12'),JSON[_0x22a6('0x13')](_0x511f67));if(_0x511f67[_0x22a6('0x14')]){if(_0x511f67[_0x22a6('0x14')]['code']===0x1f4){logger[_0x22a6('0x14')]('FaxQueue,\x20%s,\x20%s',_0x472361,_0x511f67[_0x22a6('0x14')]['message']);return _0x21321a(_0x511f67['error'][_0x22a6('0x15')]);}logger[_0x22a6('0x14')]('FaxQueue,\x20%s,\x20%s',_0x472361,_0x511f67['error'][_0x22a6('0x15')]);return _0xca3943(_0x511f67[_0x22a6('0x14')][_0x22a6('0x15')]);}else{logger['info'](_0x22a6('0x16'),_0x472361,_0x22a6('0x12'));_0xca3943(_0x511f67['result'][_0x22a6('0x15')]);}})[_0x22a6('0x17')](function(_0x960cd6){logger[_0x22a6('0x14')]('FaxQueue,\x20%s,\x20%s',_0x472361,_0x960cd6);_0x21321a(_0x960cd6);});});}exports[_0x22a6('0x18')]=function(_0x979224){var _0x141657=this;return new Promise(function(_0x482ca2,_0x508a2b){return db[_0x22a6('0x19')][_0x22a6('0x1a')]({'raw':_0x979224[_0x22a6('0x1b')]?_0x979224[_0x22a6('0x1b')][_0x22a6('0x1c')]===undefined?!![]:![]:!![],'where':_0x979224[_0x22a6('0x1b')]?_0x979224['options'][_0x22a6('0x1d')]||null:null,'attributes':_0x979224[_0x22a6('0x1b')]?_0x979224[_0x22a6('0x1b')][_0x22a6('0x1e')]||null:null,'limit':_0x979224[_0x22a6('0x1b')]?_0x979224[_0x22a6('0x1b')][_0x22a6('0x1f')]||null:null,'include':_0x979224[_0x22a6('0x1b')]?_0x979224[_0x22a6('0x1b')]['include']?_[_0x22a6('0x20')](_0x979224[_0x22a6('0x1b')]['include'],function(_0x1bab42){return{'model':db[_0x1bab42['model']],'as':_0x1bab42['as'],'attributes':_0x1bab42[_0x22a6('0x1e')],'include':_0x1bab42[_0x22a6('0x21')]?_[_0x22a6('0x20')](_0x1bab42[_0x22a6('0x21')],function(_0x3386dc){return{'model':db[_0x3386dc['model']],'as':_0x3386dc['as'],'attributes':_0x3386dc[_0x22a6('0x1e')],'include':_0x3386dc[_0x22a6('0x21')]?_[_0x22a6('0x20')](_0x3386dc[_0x22a6('0x21')],function(_0x270e02){return{'model':db[_0x270e02[_0x22a6('0x22')]],'as':_0x270e02['as'],'attributes':_0x270e02['attributes']};}):[]};}):[]};}):[]:[]})[_0x22a6('0x23')](function(_0x3e3401){logger['info'](_0x22a6('0x18'),_0x979224);logger[_0x22a6('0x24')](_0x22a6('0x18'),_0x979224,JSON[_0x22a6('0x13')](_0x3e3401));_0x482ca2(_0x3e3401);})['catch'](function(_0x3458cf){logger['error'](_0x22a6('0x18'),_0x3458cf[_0x22a6('0x15')],_0x979224);_0x508a2b(_0x141657[_0x22a6('0x14')](0x1f4,_0x3458cf[_0x22a6('0x15')]));});});};exports['ShowFaxQueue']=function(_0x2c49db){var _0x4c2ce2=this;return new Promise(function(_0x1bec87,_0x4ab95d){return db[_0x22a6('0x19')]['find']({'raw':_0x2c49db[_0x22a6('0x1b')]?_0x2c49db[_0x22a6('0x1b')][_0x22a6('0x1c')]===undefined?!![]:![]:!![],'where':_0x2c49db['options']?_0x2c49db[_0x22a6('0x1b')][_0x22a6('0x1d')]||null:null,'attributes':_0x2c49db[_0x22a6('0x1b')]?_0x2c49db['options'][_0x22a6('0x1e')]||null:null,'include':_0x2c49db[_0x22a6('0x1b')]?_0x2c49db[_0x22a6('0x1b')]['include']?_['map'](_0x2c49db[_0x22a6('0x1b')][_0x22a6('0x21')],function(_0xceb6a2){return{'model':db[_0xceb6a2[_0x22a6('0x22')]],'as':_0xceb6a2['as'],'attributes':_0xceb6a2['attributes'],'include':_0xceb6a2[_0x22a6('0x21')]?_[_0x22a6('0x20')](_0xceb6a2[_0x22a6('0x21')],function(_0x49e32e){return{'model':db[_0x49e32e['model']],'as':_0x49e32e['as'],'attributes':_0x49e32e['attributes'],'include':_0x49e32e[_0x22a6('0x21')]?_[_0x22a6('0x20')](_0x49e32e[_0x22a6('0x21')],function(_0x55946c){return{'model':db[_0x55946c[_0x22a6('0x22')]],'as':_0x55946c['as'],'attributes':_0x55946c['attributes']};}):[]};}):[]};}):[]:[]})[_0x22a6('0x23')](function(_0x14a748){logger[_0x22a6('0x10')]('ShowFaxQueue',_0x2c49db);logger[_0x22a6('0x24')](_0x22a6('0x25'),_0x2c49db,JSON[_0x22a6('0x13')](_0x14a748));_0x1bec87(_0x14a748);})[_0x22a6('0x17')](function(_0x5d1dd2){logger['error'](_0x22a6('0x25'),_0x5d1dd2[_0x22a6('0x15')],_0x2c49db);_0x4ab95d(_0x4c2ce2[_0x22a6('0x14')](0x1f4,_0x5d1dd2[_0x22a6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 767f662..1ee64b3 100644 --- a/server/api/faxQueue/faxQueue.socket.js +++ b/server/api/faxQueue/faxQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac12=['update','emit','removeListener','length','faxQueue:','./faxQueue.events','save'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xac12,0x7c));var _0x2ac1=function(_0x34b66e,_0x32c6a0){_0x34b66e=_0x34b66e-0x0;var _0x3bd12a=_0xac12[_0x34b66e];return _0x3bd12a;};'use strict';var FaxQueueEvents=require(_0x2ac1('0x0'));var events=[_0x2ac1('0x1'),'remove',_0x2ac1('0x2')];function createListener(_0x7ff374,_0x54ae5b){return function(_0x941015){_0x54ae5b[_0x2ac1('0x3')](_0x7ff374,_0x941015);};}function removeListener(_0x5a84ea,_0x2c4d54){return function(){FaxQueueEvents[_0x2ac1('0x4')](_0x5a84ea,_0x2c4d54);};}exports['register']=function(_0x393bf3){for(var _0x4c167a=0x0,_0x265f20=events[_0x2ac1('0x5')];_0x4c167a<_0x265f20;_0x4c167a++){var _0x2b7053=events[_0x4c167a];var _0x2f2594=createListener(_0x2ac1('0x6')+_0x2b7053,_0x393bf3);FaxQueueEvents['on'](_0x2b7053,_0x2f2594);}}; \ No newline at end of file +var _0xabe7=['register','length','faxQueue:','save','remove','update','emit','removeListener'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xabe7,0x1c3));var _0x7abe=function(_0x2cb454,_0x53cf1a){_0x2cb454=_0x2cb454-0x0;var _0x1d4f64=_0xabe7[_0x2cb454];return _0x1d4f64;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x7abe('0x0'),_0x7abe('0x1'),_0x7abe('0x2')];function createListener(_0x3d1a41,_0x1e304d){return function(_0x1a2b51){_0x1e304d[_0x7abe('0x3')](_0x3d1a41,_0x1a2b51);};}function removeListener(_0x27faff,_0x3f8bf8){return function(){FaxQueueEvents[_0x7abe('0x4')](_0x27faff,_0x3f8bf8);};}exports[_0x7abe('0x5')]=function(_0xcac5d1){for(var _0x324837=0x0,_0x3e2736=events[_0x7abe('0x6')];_0x324837<_0x3e2736;_0x324837++){var _0x56cd8d=events[_0x324837];var _0x3830c7=createListener(_0x7abe('0x7')+_0x56cd8d,_0xcac5d1);FaxQueueEvents['on'](_0x56cd8d,_0x3830c7);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index e1ba65d..31cedcb 100644 --- a/server/api/faxQueue/index.js +++ b/server/api/faxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x14ec75,_0x56a3d4){var _0x40b9e9=function(_0x4d2f39){while(--_0x4d2f39){_0x14ec75['push'](_0x14ec75['shift']());}};_0x40b9e9(++_0x56a3d4);}(_0xef17,0x136));var _0x7ef1=function(_0x48cfe5,_0x16a475){_0x48cfe5=_0x48cfe5-0x0;var _0x3f373a=_0xef17[_0x48cfe5];return _0x3f373a;};'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 _0xcf98=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x5decec,_0x4e5761){var _0x35e1b4=function(_0x27066d){while(--_0x27066d){_0x5decec['push'](_0x5decec['shift']());}};_0x35e1b4(++_0x4e5761);}(_0xcf98,0x8d));var _0x8cf9=function(_0x279bb4,_0x3c8a2e){_0x279bb4=_0x279bb4-0x0;var _0x30d8a4=_0xcf98[_0x279bb4];return _0x30d8a4;};'use strict';var multer=require('multer');var util=require(_0x8cf9('0x0'));var path=require(_0x8cf9('0x1'));var timeout=require(_0x8cf9('0x2'));var express=require(_0x8cf9('0x3'));var router=express[_0x8cf9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8cf9('0x5'));var config=require(_0x8cf9('0x6'));var controller=require(_0x8cf9('0x7'));router[_0x8cf9('0x8')]('/',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xa')]);router[_0x8cf9('0x8')](_0x8cf9('0xb'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xc')]);router[_0x8cf9('0x8')]('/:id',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xd')]);router['get'](_0x8cf9('0xe'),auth['isAuthenticated'](),controller[_0x8cf9('0xf')]);router[_0x8cf9('0x8')](_0x8cf9('0x10'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x11')]);router[_0x8cf9('0x8')](_0x8cf9('0x12'),auth['isAuthenticated'](),controller[_0x8cf9('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8cf9('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8cf9('0x15')]);router[_0x8cf9('0x14')](_0x8cf9('0x12'),auth['isAuthenticated'](),controller[_0x8cf9('0x16')]);router[_0x8cf9('0x17')]('/:id',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x18')]);router[_0x8cf9('0x19')](_0x8cf9('0x1a'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1b')]);router[_0x8cf9('0x19')](_0x8cf9('0x10'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1c')]);router[_0x8cf9('0x19')](_0x8cf9('0x12'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1d')]);module[_0x8cf9('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index d2f7155..ec7858b 100644 --- a/server/api/faxQueueReport/faxQueueReport.attributes.js +++ b/server/api/faxQueueReport/faxQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4434=['moment','sequelize','exports','STRING','DATE'];(function(_0x1f010c,_0x4adcd8){var _0x3cca72=function(_0x2538c7){while(--_0x2538c7){_0x1f010c['push'](_0x1f010c['shift']());}};_0x3cca72(++_0x4adcd8);}(_0x4434,0xb4));var _0x4443=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x4434[_0x19950b];return _0x3c6b41;};'use strict';var moment=require(_0x4443('0x0'));var Sequelize=require(_0x4443('0x1'));module[_0x4443('0x2')]={'uniqueid':{'type':Sequelize[_0x4443('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4443('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x4443('0x4')]},'acceptAt':{'type':Sequelize[_0x4443('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x4443('0x3')]}}; \ No newline at end of file +var _0xf9ae=['STRING','DATE','moment','sequelize','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf9ae,0xa7));var _0xef9a=function(_0x1da4bc,_0x148afa){_0x1da4bc=_0x1da4bc-0x0;var _0x3cb3f9=_0xf9ae[_0x1da4bc];return _0x3cb3f9;};'use strict';var moment=require(_0xef9a('0x0'));var Sequelize=require(_0xef9a('0x1'));module[_0xef9a('0x2')]={'uniqueid':{'type':Sequelize[_0xef9a('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xef9a('0x4')]},'leaveAt':{'type':Sequelize[_0xef9a('0x4')]},'acceptAt':{'type':Sequelize[_0xef9a('0x4')]},'exitAt':{'type':Sequelize[_0xef9a('0x4')]},'reason':{'type':Sequelize[_0xef9a('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index b247dc7..89bc4ca 100644 --- a/server/api/faxQueueReport/faxQueueReport.controller.js +++ b/server/api/faxQueueReport/faxQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81d5=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','map','FaxQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x81d5,0x1ab));var _0x581d=function(_0x1520a8,_0x2a9639){_0x1520a8=_0x1520a8-0x0;var _0x47891d=_0x81d5[_0x1520a8];return _0x47891d;};'use strict';var emlformat=require(_0x581d('0x0'));var rimraf=require(_0x581d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x581d('0x2'));var rp=require(_0x581d('0x3'));var moment=require(_0x581d('0x4'));var BPromise=require(_0x581d('0x5'));var Mustache=require(_0x581d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x581d('0x7'));var csv=require(_0x581d('0x8'));var ejs=require(_0x581d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x581d('0xa'));var squel=require(_0x581d('0xb'));var crypto=require(_0x581d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x581d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x581d('0xe'));var authService=require(_0x581d('0xf'));var qs=require(_0x581d('0x10'));var as=require(_0x581d('0x11'));var hardwareService=require(_0x581d('0x12'));var logger=require('../../config/logger')(_0x581d('0x13'));var utils=require(_0x581d('0x14'));var config=require(_0x581d('0x15'));var licenseUtil=require(_0x581d('0x16'));var db=require(_0x581d('0x17'))['db'];function respondWithStatusCode(_0x271bd1,_0x1fb6ed){_0x1fb6ed=_0x1fb6ed||0xcc;return function(_0x3329cc){if(_0x3329cc){return _0x271bd1[_0x581d('0x18')](_0x1fb6ed);}return _0x271bd1[_0x581d('0x19')](_0x1fb6ed)['end']();};}function respondWithResult(_0x338c88,_0xfab29f){_0xfab29f=_0xfab29f||0xc8;return function(_0x51a035){if(_0x51a035){return _0x338c88['status'](_0xfab29f)['json'](_0x51a035);}};}function respondWithFilteredResult(_0x4deffa,_0x110e13){return function(_0x550365){if(_0x550365){var _0x1d609f=typeof _0x110e13[_0x581d('0x1a')]==='undefined'&&typeof _0x110e13[_0x581d('0x1b')]==='undefined';var _0x3172f6=_0x550365[_0x581d('0x1c')];var _0x1e059d=_0x1d609f?0x0:_0x110e13[_0x581d('0x1a')];var _0x1f790f=_0x1d609f?_0x550365[_0x581d('0x1c')]:_0x110e13[_0x581d('0x1a')]+_0x110e13['limit'];var _0x2be45b;if(_0x1f790f>=_0x3172f6){_0x1f790f=_0x3172f6;_0x2be45b=0xc8;}else{_0x2be45b=0xce;}_0x4deffa[_0x581d('0x19')](_0x2be45b);return _0x4deffa[_0x581d('0x1d')](_0x581d('0x1e'),_0x1e059d+'-'+_0x1f790f+'/'+_0x3172f6)[_0x581d('0x1f')](_0x550365);}return null;};}function patchUpdates(_0x2a2aba){return function(_0x4635a8){try{jsonpatch[_0x581d('0x20')](_0x4635a8,_0x2a2aba,!![]);}catch(_0x468543){return BPromise[_0x581d('0x21')](_0x468543);}return _0x4635a8[_0x581d('0x22')]();};}function saveUpdates(_0xf74d2b,_0x5add13){return function(_0xb96c3d){if(_0xb96c3d){return _0xb96c3d[_0x581d('0x23')](_0xf74d2b)[_0x581d('0x24')](function(_0x2a4cd9){return _0x2a4cd9;});}return null;};}function removeEntity(_0x2addd8,_0x4f7420){return function(_0x36cc8a){if(_0x36cc8a){return _0x36cc8a[_0x581d('0x25')]()['then'](function(){_0x2addd8[_0x581d('0x19')](0xcc)[_0x581d('0x26')]();});}};}function handleEntityNotFound(_0x2c8fdb,_0x5a3fd7){return function(_0x190545){if(!_0x190545){_0x2c8fdb[_0x581d('0x18')](0x194);}return _0x190545;};}function handleError(_0x146323,_0xc270bc){_0xc270bc=_0xc270bc||0x1f4;return function(_0x38f213){logger[_0x581d('0x27')](_0x38f213['stack']);if(_0x38f213[_0x581d('0x28')]){delete _0x38f213[_0x581d('0x28')];}_0x146323[_0x581d('0x19')](_0xc270bc)['send'](_0x38f213);};}exports['index']=function(_0x504f71,_0x489682){var _0x355efe={},_0x266a2b={},_0x337361={'count':0x0,'rows':[]};var _0x408cce=_[_0x581d('0x29')](db[_0x581d('0x2a')][_0x581d('0x2b')],function(_0x298953){return{'name':_0x298953[_0x581d('0x2c')],'type':_0x298953[_0x581d('0x2d')][_0x581d('0x2e')]};});_0x266a2b['model']=_[_0x581d('0x29')](_0x408cce,'name');_0x266a2b[_0x581d('0x2f')]=_[_0x581d('0x30')](_0x504f71[_0x581d('0x2f')]);_0x266a2b[_0x581d('0x31')]=_[_0x581d('0x32')](_0x266a2b[_0x581d('0x33')],_0x266a2b['query']);_0x355efe[_0x581d('0x34')]=_[_0x581d('0x32')](_0x266a2b['model'],qs['fields'](_0x504f71['query'][_0x581d('0x35')]));_0x355efe[_0x581d('0x34')]=_0x355efe[_0x581d('0x34')][_0x581d('0x36')]?_0x355efe[_0x581d('0x34')]:_0x266a2b[_0x581d('0x33')];if(!_0x504f71[_0x581d('0x2f')]['hasOwnProperty'](_0x581d('0x37'))){_0x355efe[_0x581d('0x1b')]=qs['limit'](_0x504f71[_0x581d('0x2f')][_0x581d('0x1b')]);_0x355efe[_0x581d('0x1a')]=qs[_0x581d('0x1a')](_0x504f71[_0x581d('0x2f')]['offset']);}_0x355efe[_0x581d('0x38')]=qs['sort'](_0x504f71[_0x581d('0x2f')][_0x581d('0x39')]);_0x355efe['where']=qs['filters'](_['pick'](_0x504f71['query'],_0x266a2b[_0x581d('0x31')]),_0x408cce);if(_0x504f71['query'][_0x581d('0x3a')]){_0x355efe['where']=_[_0x581d('0x3b')](_0x355efe[_0x581d('0x3c')],{'$or':_[_0x581d('0x29')](_0x408cce,function(_0x393b2e){if(_0x393b2e[_0x581d('0x2d')]!==_0x581d('0x3d')){var _0x28f091={};_0x28f091[_0x393b2e[_0x581d('0x28')]]={'$like':'%'+_0x504f71[_0x581d('0x2f')][_0x581d('0x3a')]+'%'};return _0x28f091;}})});}_0x355efe=_['merge']({},_0x355efe,_0x504f71['options']);var _0x47668c={'where':_0x355efe[_0x581d('0x3c')]};return db[_0x581d('0x2a')]['count'](_0x47668c)[_0x581d('0x24')](function(_0x1b6aee){_0x337361[_0x581d('0x1c')]=_0x1b6aee;if(_0x504f71['query'][_0x581d('0x3e')]){_0x355efe[_0x581d('0x3f')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x581d('0x40')](_0x355efe);})[_0x581d('0x24')](function(_0x211c64){_0x337361[_0x581d('0x41')]=_0x211c64;return _0x337361;})[_0x581d('0x24')](respondWithFilteredResult(_0x489682,_0x355efe))[_0x581d('0x42')](handleError(_0x489682,null));};exports[_0x581d('0x43')]=function(_0x5550b4,_0x3cadb3){var _0x283743={'raw':!![],'where':{'id':_0x5550b4['params']['id']}},_0x20fbf1={};_0x20fbf1[_0x581d('0x33')]=_[_0x581d('0x30')](db['FaxQueueReport']['rawAttributes']);_0x20fbf1[_0x581d('0x2f')]=_[_0x581d('0x30')](_0x5550b4[_0x581d('0x2f')]);_0x20fbf1['filters']=_[_0x581d('0x32')](_0x20fbf1[_0x581d('0x33')],_0x20fbf1['query']);_0x283743[_0x581d('0x34')]=_['intersection'](_0x20fbf1[_0x581d('0x33')],qs['fields'](_0x5550b4[_0x581d('0x2f')]['fields']));_0x283743['attributes']=_0x283743[_0x581d('0x34')]['length']?_0x283743['attributes']:_0x20fbf1['model'];if(_0x5550b4[_0x581d('0x2f')][_0x581d('0x3e')]){_0x283743[_0x581d('0x3f')]=[{'all':!![]}];}_0x283743=_['merge']({},_0x283743,_0x5550b4[_0x581d('0x44')]);return db[_0x581d('0x2a')]['find'](_0x283743)['then'](handleEntityNotFound(_0x3cadb3,null))[_0x581d('0x24')](respondWithResult(_0x3cadb3,null))['catch'](handleError(_0x3cadb3,null));};exports[_0x581d('0x45')]=function(_0x5a5c30,_0x32eed9){return db[_0x581d('0x2a')]['create'](_0x5a5c30[_0x581d('0x46')],{})[_0x581d('0x24')](respondWithResult(_0x32eed9,0xc9))[_0x581d('0x42')](handleError(_0x32eed9,null));};exports[_0x581d('0x23')]=function(_0x3b8b5e,_0x4dca9e){if(_0x3b8b5e[_0x581d('0x46')]['id']){delete _0x3b8b5e[_0x581d('0x46')]['id'];}return db[_0x581d('0x2a')][_0x581d('0x47')]({'where':{'id':_0x3b8b5e[_0x581d('0x48')]['id']}})[_0x581d('0x24')](handleEntityNotFound(_0x4dca9e,null))[_0x581d('0x24')](saveUpdates(_0x3b8b5e['body'],null))[_0x581d('0x24')](respondWithResult(_0x4dca9e,null))[_0x581d('0x42')](handleError(_0x4dca9e,null));};exports[_0x581d('0x25')]=function(_0x3e95c6,_0xba6b00){return db[_0x581d('0x2a')][_0x581d('0x47')]({'where':{'id':_0x3e95c6['params']['id']}})[_0x581d('0x24')](handleEntityNotFound(_0xba6b00,null))[_0x581d('0x24')](removeEntity(_0xba6b00,null))['catch'](handleError(_0xba6b00,null));};exports[_0x581d('0x49')]=function(_0x508d4c,_0x29f36e){return db[_0x581d('0x2a')][_0x581d('0x49')]()[_0x581d('0x24')](respondWithResult(_0x29f36e,null))['catch'](handleError(_0x29f36e,null));}; \ No newline at end of file +var _0xb58b=['save','update','destroy','then','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject'];(function(_0x11f85b,_0x1c368d){var _0x573270=function(_0x590e74){while(--_0x590e74){_0x11f85b['push'](_0x11f85b['shift']());}};_0x573270(++_0x1c368d);}(_0xb58b,0x1f1));var _0xbb58=function(_0x385801,_0x1fb29f){_0x385801=_0x385801-0x0;var _0x3817c2=_0xb58b[_0x385801];return _0x3817c2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe88799,_0x18810f){_0x18810f=_0x18810f||0xcc;return function(_0x4cda21){if(_0x4cda21){return _0xe88799[_0xbb58('0x18')](_0x18810f);}return _0xe88799[_0xbb58('0x19')](_0x18810f)[_0xbb58('0x1a')]();};}function respondWithResult(_0x3b9406,_0x19ceda){_0x19ceda=_0x19ceda||0xc8;return function(_0x58245f){if(_0x58245f){return _0x3b9406[_0xbb58('0x19')](_0x19ceda)[_0xbb58('0x1b')](_0x58245f);}};}function respondWithFilteredResult(_0x5f4751,_0x4ba30e){return function(_0x33c20f){if(_0x33c20f){var _0x445b1f=typeof _0x4ba30e[_0xbb58('0x1c')]==='undefined'&&typeof _0x4ba30e['limit']==='undefined';var _0x55156e=_0x33c20f[_0xbb58('0x1d')];var _0x3134ea=_0x445b1f?0x0:_0x4ba30e['offset'];var _0xbee66=_0x445b1f?_0x33c20f['count']:_0x4ba30e[_0xbb58('0x1c')]+_0x4ba30e[_0xbb58('0x1e')];var _0x3c33d9;if(_0xbee66>=_0x55156e){_0xbee66=_0x55156e;_0x3c33d9=0xc8;}else{_0x3c33d9=0xce;}_0x5f4751[_0xbb58('0x19')](_0x3c33d9);return _0x5f4751[_0xbb58('0x1f')](_0xbb58('0x20'),_0x3134ea+'-'+_0xbee66+'/'+_0x55156e)[_0xbb58('0x1b')](_0x33c20f);}return null;};}function patchUpdates(_0x497fd0){return function(_0x84f34){try{jsonpatch[_0xbb58('0x21')](_0x84f34,_0x497fd0,!![]);}catch(_0x3e64fe){return BPromise[_0xbb58('0x22')](_0x3e64fe);}return _0x84f34[_0xbb58('0x23')]();};}function saveUpdates(_0x5d4a91,_0x49453a){return function(_0x350be7){if(_0x350be7){return _0x350be7[_0xbb58('0x24')](_0x5d4a91)['then'](function(_0x27806d){return _0x27806d;});}return null;};}function removeEntity(_0x53b693,_0x21964d){return function(_0x287822){if(_0x287822){return _0x287822[_0xbb58('0x25')]()[_0xbb58('0x26')](function(){_0x53b693[_0xbb58('0x19')](0xcc)[_0xbb58('0x1a')]();});}};}function handleEntityNotFound(_0x2d556a,_0x15e4c5){return function(_0x4e0303){if(!_0x4e0303){_0x2d556a[_0xbb58('0x18')](0x194);}return _0x4e0303;};}function handleError(_0x3bd550,_0x1be0ae){_0x1be0ae=_0x1be0ae||0x1f4;return function(_0x129094){logger[_0xbb58('0x27')](_0x129094[_0xbb58('0x28')]);if(_0x129094[_0xbb58('0x29')]){delete _0x129094[_0xbb58('0x29')];}_0x3bd550[_0xbb58('0x19')](_0x1be0ae)[_0xbb58('0x2a')](_0x129094);};}exports[_0xbb58('0x2b')]=function(_0x28b3a3,_0x2a0481){var _0x4157c4={},_0x3559b6={},_0x573cca={'count':0x0,'rows':[]};var _0x2b0f73=_[_0xbb58('0x2c')](db[_0xbb58('0x2d')][_0xbb58('0x2e')],function(_0x3304b9){return{'name':_0x3304b9[_0xbb58('0x2f')],'type':_0x3304b9[_0xbb58('0x30')][_0xbb58('0x31')]};});_0x3559b6[_0xbb58('0x32')]=_['map'](_0x2b0f73,_0xbb58('0x29'));_0x3559b6[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x28b3a3[_0xbb58('0x33')]);_0x3559b6[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x3559b6[_0xbb58('0x32')],_0x3559b6[_0xbb58('0x33')]);_0x4157c4[_0xbb58('0x37')]=_[_0xbb58('0x36')](_0x3559b6[_0xbb58('0x32')],qs[_0xbb58('0x38')](_0x28b3a3[_0xbb58('0x33')]['fields']));_0x4157c4['attributes']=_0x4157c4['attributes'][_0xbb58('0x39')]?_0x4157c4[_0xbb58('0x37')]:_0x3559b6[_0xbb58('0x32')];if(!_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3a')](_0xbb58('0x3b'))){_0x4157c4[_0xbb58('0x1e')]=qs[_0xbb58('0x1e')](_0x28b3a3['query'][_0xbb58('0x1e')]);_0x4157c4[_0xbb58('0x1c')]=qs['offset'](_0x28b3a3[_0xbb58('0x33')]['offset']);}_0x4157c4[_0xbb58('0x3c')]=qs['sort'](_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3d')]);_0x4157c4['where']=qs[_0xbb58('0x35')](_[_0xbb58('0x3e')](_0x28b3a3[_0xbb58('0x33')],_0x3559b6[_0xbb58('0x35')]),_0x2b0f73);if(_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3f')]){_0x4157c4[_0xbb58('0x40')]=_[_0xbb58('0x41')](_0x4157c4['where'],{'$or':_[_0xbb58('0x2c')](_0x2b0f73,function(_0x31aa4b){if(_0x31aa4b[_0xbb58('0x30')]!=='VIRTUAL'){var _0x4dbd5e={};_0x4dbd5e[_0x31aa4b[_0xbb58('0x29')]]={'$like':'%'+_0x28b3a3['query'][_0xbb58('0x3f')]+'%'};return _0x4dbd5e;}})});}_0x4157c4=_[_0xbb58('0x41')]({},_0x4157c4,_0x28b3a3[_0xbb58('0x42')]);var _0x560911={'where':_0x4157c4['where']};return db[_0xbb58('0x2d')][_0xbb58('0x1d')](_0x560911)[_0xbb58('0x26')](function(_0x24d82d){_0x573cca[_0xbb58('0x1d')]=_0x24d82d;if(_0x28b3a3[_0xbb58('0x33')]['includeAll']){_0x4157c4[_0xbb58('0x43')]=[{'all':!![]}];}return db[_0xbb58('0x2d')][_0xbb58('0x44')](_0x4157c4);})[_0xbb58('0x26')](function(_0x1185b3){_0x573cca[_0xbb58('0x45')]=_0x1185b3;return _0x573cca;})['then'](respondWithFilteredResult(_0x2a0481,_0x4157c4))[_0xbb58('0x46')](handleError(_0x2a0481,null));};exports['show']=function(_0x22f1c3,_0x285ad4){var _0x29fb1c={'raw':!![],'where':{'id':_0x22f1c3['params']['id']}},_0x45817f={};_0x45817f[_0xbb58('0x32')]=_[_0xbb58('0x34')](db[_0xbb58('0x2d')][_0xbb58('0x2e')]);_0x45817f['query']=_[_0xbb58('0x34')](_0x22f1c3['query']);_0x45817f[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x45817f[_0xbb58('0x32')],_0x45817f[_0xbb58('0x33')]);_0x29fb1c[_0xbb58('0x37')]=_[_0xbb58('0x36')](_0x45817f[_0xbb58('0x32')],qs[_0xbb58('0x38')](_0x22f1c3[_0xbb58('0x33')][_0xbb58('0x38')]));_0x29fb1c[_0xbb58('0x37')]=_0x29fb1c[_0xbb58('0x37')][_0xbb58('0x39')]?_0x29fb1c['attributes']:_0x45817f[_0xbb58('0x32')];if(_0x22f1c3['query']['includeAll']){_0x29fb1c[_0xbb58('0x43')]=[{'all':!![]}];}_0x29fb1c=_[_0xbb58('0x41')]({},_0x29fb1c,_0x22f1c3[_0xbb58('0x42')]);return db[_0xbb58('0x2d')][_0xbb58('0x47')](_0x29fb1c)[_0xbb58('0x26')](handleEntityNotFound(_0x285ad4,null))[_0xbb58('0x26')](respondWithResult(_0x285ad4,null))[_0xbb58('0x46')](handleError(_0x285ad4,null));};exports[_0xbb58('0x48')]=function(_0x39995e,_0x440fb3){return db['FaxQueueReport'][_0xbb58('0x48')](_0x39995e[_0xbb58('0x49')],{})['then'](respondWithResult(_0x440fb3,0xc9))[_0xbb58('0x46')](handleError(_0x440fb3,null));};exports[_0xbb58('0x24')]=function(_0xf94897,_0xdb0ff7){if(_0xf94897['body']['id']){delete _0xf94897[_0xbb58('0x49')]['id'];}return db['FaxQueueReport'][_0xbb58('0x47')]({'where':{'id':_0xf94897[_0xbb58('0x4a')]['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0xdb0ff7,null))['then'](saveUpdates(_0xf94897[_0xbb58('0x49')],null))[_0xbb58('0x26')](respondWithResult(_0xdb0ff7,null))['catch'](handleError(_0xdb0ff7,null));};exports[_0xbb58('0x25')]=function(_0x4ca201,_0x28301d){return db[_0xbb58('0x2d')][_0xbb58('0x47')]({'where':{'id':_0x4ca201[_0xbb58('0x4a')]['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0x28301d,null))[_0xbb58('0x26')](removeEntity(_0x28301d,null))[_0xbb58('0x46')](handleError(_0x28301d,null));};exports['describe']=function(_0x449088,_0x1fd892){return db['FaxQueueReport'][_0xbb58('0x4b')]()[_0xbb58('0x26')](respondWithResult(_0x1fd892,null))['catch'](handleError(_0x1fd892,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index b25ef38..f3a2a7e 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4e3fa9,_0x57068a){var _0x39067b=function(_0x1fa12d){while(--_0x1fa12d){_0x4e3fa9['push'](_0x4e3fa9['shift']());}};_0x39067b(++_0x57068a);}(_0x4975,0x86));var _0x5497=function(_0x1bb1fd,_0x45295c){_0x1bb1fd=_0x1bb1fd-0x0;var _0x527ba9=_0x4975[_0x1bb1fd];return _0x527ba9;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0295=['rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash','api','request-promise','path'];(function(_0xa4674c,_0x59b5fc){var _0x5c0f8b=function(_0x19c493){while(--_0x19c493){_0xa4674c['push'](_0xa4674c['shift']());}};_0x5c0f8b(++_0x59b5fc);}(_0x0295,0x1f0));var _0x5029=function(_0x34ac64,_0x23f246){_0x34ac64=_0x34ac64-0x0;var _0xae8ae9=_0x0295[_0x34ac64];return _0xae8ae9;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5029('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index d746617..ff77267 100644 --- a/server/api/faxQueueReport/faxQueueReport.rpc.js +++ b/server/api/faxQueueReport/faxQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd9c=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxQueueReport','FaxQueueReport','options','raw','UpdateFaxQueueReport','update','body'];(function(_0x222fa4,_0x3efe2e){var _0x12fce4=function(_0x2526c0){while(--_0x2526c0){_0x222fa4['push'](_0x222fa4['shift']());}};_0x12fce4(++_0x3efe2e);}(_0xfd9c,0xf0));var _0xcfd9=function(_0xe39824,_0xbdf61f){_0xe39824=_0xe39824-0x0;var _0x4bc31e=_0xfd9c[_0xe39824];return _0x4bc31e;};'use strict';var _=require(_0xcfd9('0x0'));var util=require(_0xcfd9('0x1'));var moment=require(_0xcfd9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfd9('0x3'));var db=require(_0xcfd9('0x4'))['db'];var utils=require(_0xcfd9('0x5'));var logger=require(_0xcfd9('0x6'))(_0xcfd9('0x7'));var config=require(_0xcfd9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcfd9('0x9')][_0xcfd9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37a78d,_0x748d3,_0x39556a){return new BPromise(function(_0x32be4d,_0x25f1d){return client['request'](_0x37a78d,_0x39556a)[_0xcfd9('0xb')](function(_0x546593){logger['info'](_0xcfd9('0xc'),_0x748d3,_0xcfd9('0xd'));logger[_0xcfd9('0xe')](_0xcfd9('0xf'),_0x748d3,_0xcfd9('0xd'),JSON[_0xcfd9('0x10')](_0x546593));if(_0x546593[_0xcfd9('0x11')]){if(_0x546593[_0xcfd9('0x11')][_0xcfd9('0x12')]===0x1f4){logger[_0xcfd9('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x748d3,_0x546593[_0xcfd9('0x11')][_0xcfd9('0x13')]);return _0x25f1d(_0x546593[_0xcfd9('0x11')][_0xcfd9('0x13')]);}logger[_0xcfd9('0x11')](_0xcfd9('0xc'),_0x748d3,_0x546593[_0xcfd9('0x11')][_0xcfd9('0x13')]);return _0x32be4d(_0x546593['error'][_0xcfd9('0x13')]);}else{logger[_0xcfd9('0x14')](_0xcfd9('0xc'),_0x748d3,'request\x20sent');_0x32be4d(_0x546593[_0xcfd9('0x15')]['message']);}})[_0xcfd9('0x16')](function(_0x190c9a){logger[_0xcfd9('0x11')](_0xcfd9('0xc'),_0x748d3,_0x190c9a);_0x25f1d(_0x190c9a);});});}exports[_0xcfd9('0x17')]=function(_0x17e25f){var _0x1ff6b7=this;return new Promise(function(_0x4d8a8e,_0x55713d){return db[_0xcfd9('0x18')]['create'](_0x17e25f['body'],{'raw':_0x17e25f[_0xcfd9('0x19')]?_0x17e25f[_0xcfd9('0x19')][_0xcfd9('0x1a')]===undefined?!![]:![]:!![]})[_0xcfd9('0xb')](function(_0x5b4f02){logger['info'](_0xcfd9('0x17'),_0x17e25f);logger['debug'](_0xcfd9('0x17'),_0x17e25f,JSON[_0xcfd9('0x10')](_0x5b4f02));_0x4d8a8e(_0x5b4f02);})[_0xcfd9('0x16')](function(_0x659424){logger[_0xcfd9('0x11')](_0xcfd9('0x17'),_0x659424['message'],_0x17e25f);_0x55713d(_0x1ff6b7[_0xcfd9('0x11')](0x1f4,_0x659424[_0xcfd9('0x13')]));});});};exports[_0xcfd9('0x1b')]=function(_0xd8704a){var _0x28c499=this;return new Promise(function(_0x2ecae0,_0x2085aa){return db['FaxQueueReport'][_0xcfd9('0x1c')](_0xd8704a[_0xcfd9('0x1d')],{'raw':_0xd8704a[_0xcfd9('0x19')]?_0xd8704a[_0xcfd9('0x19')][_0xcfd9('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd8704a['options']?_0xd8704a[_0xcfd9('0x19')]['where']||null:null,'attributes':_0xd8704a['options']?_0xd8704a['options']['attributes']||null:null,'limit':_0xd8704a['options']?_0xd8704a[_0xcfd9('0x19')]['limit']||null:null})[_0xcfd9('0xb')](function(_0x423c59){logger[_0xcfd9('0x14')]('UpdateFaxQueueReport',_0xd8704a);logger[_0xcfd9('0xe')](_0xcfd9('0x1b'),_0xd8704a,JSON[_0xcfd9('0x10')](_0x423c59));_0x2ecae0(_0x423c59);})[_0xcfd9('0x16')](function(_0x5e7722){logger[_0xcfd9('0x11')](_0xcfd9('0x1b'),_0x5e7722['message'],_0xd8704a);_0x2085aa(_0x28c499[_0xcfd9('0x11')](0x1f4,_0x5e7722[_0xcfd9('0x13')]));});});}; \ No newline at end of file +var _0x52a2=['raw','where','attributes','limit','stringify','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','create','body','options','then','UpdateFaxQueueReport','FaxQueueReport','update'];(function(_0x284cd1,_0x87b55b){var _0x4b6653=function(_0x1f4a87){while(--_0x1f4a87){_0x284cd1['push'](_0x284cd1['shift']());}};_0x4b6653(++_0x87b55b);}(_0x52a2,0xaf));var _0x252a=function(_0x35faf2,_0x56a899){_0x35faf2=_0x35faf2-0x0;var _0x113601=_0x52a2[_0x35faf2];return _0x113601;};'use strict';var _=require(_0x252a('0x0'));var util=require('util');var moment=require(_0x252a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x252a('0x2'));var db=require(_0x252a('0x3'))['db'];var utils=require(_0x252a('0x4'));var logger=require(_0x252a('0x5'))('rpc');var config=require(_0x252a('0x6'));var jayson=require(_0x252a('0x7'));var client=jayson[_0x252a('0x8')][_0x252a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x597d34,_0x42e918,_0x1eb5fa){return new BPromise(function(_0x39bd5c,_0xc8d9bf){return client[_0x252a('0xa')](_0x597d34,_0x1eb5fa)['then'](function(_0x16d066){logger[_0x252a('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x42e918,_0x252a('0xc'));logger[_0x252a('0xd')](_0x252a('0xe'),_0x42e918,'request\x20sent',JSON['stringify'](_0x16d066));if(_0x16d066[_0x252a('0xf')]){if(_0x16d066[_0x252a('0xf')][_0x252a('0x10')]===0x1f4){logger[_0x252a('0xf')](_0x252a('0x11'),_0x42e918,_0x16d066['error'][_0x252a('0x12')]);return _0xc8d9bf(_0x16d066[_0x252a('0xf')][_0x252a('0x12')]);}logger[_0x252a('0xf')](_0x252a('0x11'),_0x42e918,_0x16d066[_0x252a('0xf')][_0x252a('0x12')]);return _0x39bd5c(_0x16d066[_0x252a('0xf')][_0x252a('0x12')]);}else{logger[_0x252a('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x42e918,_0x252a('0xc'));_0x39bd5c(_0x16d066[_0x252a('0x13')][_0x252a('0x12')]);}})[_0x252a('0x14')](function(_0x1408d6){logger[_0x252a('0xf')](_0x252a('0x11'),_0x42e918,_0x1408d6);_0xc8d9bf(_0x1408d6);});});}exports[_0x252a('0x15')]=function(_0x479235){var _0x5ceb14=this;return new Promise(function(_0x22e3cc,_0x1985b0){return db['FaxQueueReport'][_0x252a('0x16')](_0x479235[_0x252a('0x17')],{'raw':_0x479235[_0x252a('0x18')]?_0x479235[_0x252a('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x252a('0x19')](function(_0x34c98b){logger[_0x252a('0xb')]('CreateFaxQueueReport',_0x479235);logger[_0x252a('0xd')](_0x252a('0x15'),_0x479235,JSON['stringify'](_0x34c98b));_0x22e3cc(_0x34c98b);})[_0x252a('0x14')](function(_0x2d0e2d){logger[_0x252a('0xf')](_0x252a('0x15'),_0x2d0e2d[_0x252a('0x12')],_0x479235);_0x1985b0(_0x5ceb14[_0x252a('0xf')](0x1f4,_0x2d0e2d['message']));});});};exports[_0x252a('0x1a')]=function(_0x4515a7){var _0x313532=this;return new Promise(function(_0x55555d,_0xb10e24){return db[_0x252a('0x1b')][_0x252a('0x1c')](_0x4515a7['body'],{'raw':_0x4515a7[_0x252a('0x18')]?_0x4515a7[_0x252a('0x18')][_0x252a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4515a7[_0x252a('0x18')]?_0x4515a7[_0x252a('0x18')][_0x252a('0x1e')]||null:null,'attributes':_0x4515a7['options']?_0x4515a7['options'][_0x252a('0x1f')]||null:null,'limit':_0x4515a7['options']?_0x4515a7['options'][_0x252a('0x20')]||null:null})[_0x252a('0x19')](function(_0x1d40bf){logger[_0x252a('0xb')]('UpdateFaxQueueReport',_0x4515a7);logger[_0x252a('0xd')](_0x252a('0x1a'),_0x4515a7,JSON[_0x252a('0x21')](_0x1d40bf));_0x55555d(_0x1d40bf);})['catch'](function(_0x5c7546){logger[_0x252a('0xf')]('UpdateFaxQueueReport',_0x5c7546[_0x252a('0x12')],_0x4515a7);_0xb10e24(_0x313532[_0x252a('0xf')](0x1f4,_0x5c7546[_0x252a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index ecb8b89..7a6cfb5 100644 --- a/server/api/faxQueueReport/index.js +++ b/server/api/faxQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x977a=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','index','get','/describe','isAuthenticated','describe','post','create','put','/:id','update','delete','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x977a,0x79));var _0xa977=function(_0x5c99e6,_0x2b3d2e){_0x5c99e6=_0x5c99e6-0x0;var _0x39f6c3=_0x977a[_0x5c99e6];return _0x39f6c3;};'use strict';var multer=require(_0xa977('0x0'));var util=require(_0xa977('0x1'));var path=require(_0xa977('0x2'));var timeout=require(_0xa977('0x3'));var express=require(_0xa977('0x4'));var router=express[_0xa977('0x5')]();var fs_extra=require(_0xa977('0x6'));var auth=require(_0xa977('0x7'));var interaction=require(_0xa977('0x8'));var config=require(_0xa977('0x9'));var controller=require(_0xa977('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xa977('0xb')]);router[_0xa977('0xc')](_0xa977('0xd'),auth[_0xa977('0xe')](),controller[_0xa977('0xf')]);router[_0xa977('0xc')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa977('0x10')]('/',auth['isAuthenticated'](),controller[_0xa977('0x11')]);router[_0xa977('0x12')](_0xa977('0x13'),auth[_0xa977('0xe')](),controller[_0xa977('0x14')]);router[_0xa977('0x15')](_0xa977('0x13'),auth[_0xa977('0xe')](),controller[_0xa977('0x16')]);module[_0xa977('0x17')]=router; \ No newline at end of file +var _0xd3c5=['post','create','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xd3c5,0x181));var _0x5d3c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd3c5[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x5d3c('0x0'));var path=require(_0x5d3c('0x1'));var timeout=require('connect-timeout');var express=require(_0x5d3c('0x2'));var router=express[_0x5d3c('0x3')]();var fs_extra=require(_0x5d3c('0x4'));var auth=require(_0x5d3c('0x5'));var interaction=require(_0x5d3c('0x6'));var config=require(_0x5d3c('0x7'));var controller=require(_0x5d3c('0x8'));router[_0x5d3c('0x9')]('/',auth[_0x5d3c('0xa')](),controller[_0x5d3c('0xb')]);router[_0x5d3c('0x9')](_0x5d3c('0xc'),auth[_0x5d3c('0xa')](),controller['describe']);router[_0x5d3c('0x9')](_0x5d3c('0xd'),auth[_0x5d3c('0xa')](),controller[_0x5d3c('0xe')]);router[_0x5d3c('0xf')]('/',auth['isAuthenticated'](),controller[_0x5d3c('0x10')]);router['put'](_0x5d3c('0xd'),auth['isAuthenticated'](),controller[_0x5d3c('0x11')]);router[_0x5d3c('0x12')](_0x5d3c('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x5d3c('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 15e0410..a73277e 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3044e3,_0x255336){var _0x389181=function(_0x4aac71){while(--_0x4aac71){_0x3044e3['push'](_0x3044e3['shift']());}};_0x389181(++_0x255336);}(_0x008c,0x188));var _0xc008=function(_0x3a83c8,_0x489ffd){_0x3a83c8=_0x3a83c8-0x0;var _0x5c89db=_0x008c[_0x3a83c8];return _0x5c89db;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x1cd106,_0x2ec7f1){var _0x13ad91=function(_0x2be497){while(--_0x2be497){_0x1cd106['push'](_0x1cd106['shift']());}};_0x13ad91(++_0x2ec7f1);}(_0x70e0,0x17b));var _0x070e=function(_0x104a29,_0x2666db){_0x104a29=_0x104a29-0x0;var _0x6649c8=_0x70e0[_0x104a29];return _0x6649c8;};'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 diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index ee288f2..b5db75e 100644 --- a/server/api/faxTransferReport/faxTransferReport.controller.js +++ b/server/api/faxTransferReport/faxTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4ce=['includeAll','findAll','rows','params','keys','include','find','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','jsforce','querystring','ioredis','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','offset','undefined','limit','count','status','set','apply','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','where','pick','filter','merge','options','FaxTransferReport'];(function(_0x30ffe7,_0x4af92d){var _0x23de6b=function(_0xd5fb95){while(--_0xd5fb95){_0x30ffe7['push'](_0x30ffe7['shift']());}};_0x23de6b(++_0x4af92d);}(_0xa4ce,0x90));var _0xea4c=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa4ce[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require(_0xea4c('0x0'));var rimraf=require(_0xea4c('0x1'));var zipdir=require(_0xea4c('0x2'));var jsonpatch=require(_0xea4c('0x3'));var rp=require(_0xea4c('0x4'));var moment=require(_0xea4c('0x5'));var BPromise=require(_0xea4c('0x6'));var Mustache=require(_0xea4c('0x7'));var util=require(_0xea4c('0x8'));var path=require('path');var sox=require(_0xea4c('0x9'));var csv=require(_0xea4c('0xa'));var ejs=require(_0xea4c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xea4c('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xea4c('0xd'));var Papa=require('papaparse');var Redis=require(_0xea4c('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xea4c('0xf'));var utils=require(_0xea4c('0x10'));var config=require(_0xea4c('0x11'));var licenseUtil=require(_0xea4c('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52b887,_0x7274e4){_0x7274e4=_0x7274e4||0xcc;return function(_0x1df95b){if(_0x1df95b){return _0x52b887[_0xea4c('0x13')](_0x7274e4);}return _0x52b887['status'](_0x7274e4)[_0xea4c('0x14')]();};}function respondWithResult(_0x2bdc25,_0x1202cf){_0x1202cf=_0x1202cf||0xc8;return function(_0x3fbb74){if(_0x3fbb74){return _0x2bdc25['status'](_0x1202cf)['json'](_0x3fbb74);}};}function respondWithFilteredResult(_0x241a30,_0x58714b){return function(_0x455a41){if(_0x455a41){var _0x21acda=typeof _0x58714b[_0xea4c('0x15')]===_0xea4c('0x16')&&typeof _0x58714b[_0xea4c('0x17')]===_0xea4c('0x16');var _0x5501b8=_0x455a41[_0xea4c('0x18')];var _0x62602=_0x21acda?0x0:_0x58714b[_0xea4c('0x15')];var _0x4adb1b=_0x21acda?_0x455a41[_0xea4c('0x18')]:_0x58714b[_0xea4c('0x15')]+_0x58714b[_0xea4c('0x17')];var _0x1eb45b;if(_0x4adb1b>=_0x5501b8){_0x4adb1b=_0x5501b8;_0x1eb45b=0xc8;}else{_0x1eb45b=0xce;}_0x241a30[_0xea4c('0x19')](_0x1eb45b);return _0x241a30[_0xea4c('0x1a')]('Content-Range',_0x62602+'-'+_0x4adb1b+'/'+_0x5501b8)['json'](_0x455a41);}return null;};}function patchUpdates(_0x97075c){return function(_0x48dc95){try{jsonpatch[_0xea4c('0x1b')](_0x48dc95,_0x97075c,!![]);}catch(_0xff7772){return BPromise['reject'](_0xff7772);}return _0x48dc95[_0xea4c('0x1c')]();};}function saveUpdates(_0x1a1431,_0x4a635e){return function(_0x2e34a1){if(_0x2e34a1){return _0x2e34a1[_0xea4c('0x1d')](_0x1a1431)[_0xea4c('0x1e')](function(_0x5b5a0c){return _0x5b5a0c;});}return null;};}function removeEntity(_0x54d251,_0x5561d2){return function(_0x18874c){if(_0x18874c){return _0x18874c['destroy']()[_0xea4c('0x1e')](function(){_0x54d251[_0xea4c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4aa8e7,_0x2d4183){return function(_0x95fe19){if(!_0x95fe19){_0x4aa8e7[_0xea4c('0x13')](0x194);}return _0x95fe19;};}function handleError(_0x10a676,_0x40f316){_0x40f316=_0x40f316||0x1f4;return function(_0x5247fd){logger[_0xea4c('0x1f')](_0x5247fd[_0xea4c('0x20')]);if(_0x5247fd['name']){delete _0x5247fd[_0xea4c('0x21')];}_0x10a676[_0xea4c('0x19')](_0x40f316)['send'](_0x5247fd);};}exports[_0xea4c('0x22')]=function(_0xbc7871,_0xaed282){var _0x2fac90={},_0x5b83e1={},_0x558d9a={'count':0x0,'rows':[]};var _0x144fef=_[_0xea4c('0x23')](db['FaxTransferReport'][_0xea4c('0x24')],function(_0x33bca3){return{'name':_0x33bca3[_0xea4c('0x25')],'type':_0x33bca3[_0xea4c('0x26')][_0xea4c('0x27')]};});_0x5b83e1[_0xea4c('0x28')]=_['map'](_0x144fef,_0xea4c('0x21'));_0x5b83e1[_0xea4c('0x29')]=_['keys'](_0xbc7871[_0xea4c('0x29')]);_0x5b83e1[_0xea4c('0x2a')]=_[_0xea4c('0x2b')](_0x5b83e1[_0xea4c('0x28')],_0x5b83e1['query']);_0x2fac90[_0xea4c('0x2c')]=_['intersection'](_0x5b83e1['model'],qs['fields'](_0xbc7871[_0xea4c('0x29')][_0xea4c('0x2d')]));_0x2fac90['attributes']=_0x2fac90[_0xea4c('0x2c')][_0xea4c('0x2e')]?_0x2fac90[_0xea4c('0x2c')]:_0x5b83e1['model'];if(!_0xbc7871[_0xea4c('0x29')]['hasOwnProperty']('nolimit')){_0x2fac90[_0xea4c('0x17')]=qs[_0xea4c('0x17')](_0xbc7871[_0xea4c('0x29')][_0xea4c('0x17')]);_0x2fac90[_0xea4c('0x15')]=qs['offset'](_0xbc7871['query'][_0xea4c('0x15')]);}_0x2fac90[_0xea4c('0x2f')]=qs['sort'](_0xbc7871['query']['sort']);_0x2fac90[_0xea4c('0x30')]=qs[_0xea4c('0x2a')](_[_0xea4c('0x31')](_0xbc7871[_0xea4c('0x29')],_0x5b83e1[_0xea4c('0x2a')]),_0x144fef);if(_0xbc7871['query']['filter']){_0x2fac90[_0xea4c('0x30')]=_['merge'](_0x2fac90[_0xea4c('0x30')],{'$or':_['map'](_0x144fef,function(_0x13525d){if(_0x13525d[_0xea4c('0x26')]!=='VIRTUAL'){var _0x15b2d4={};_0x15b2d4[_0x13525d['name']]={'$like':'%'+_0xbc7871[_0xea4c('0x29')][_0xea4c('0x32')]+'%'};return _0x15b2d4;}})});}_0x2fac90=_[_0xea4c('0x33')]({},_0x2fac90,_0xbc7871[_0xea4c('0x34')]);var _0x1b698d={'where':_0x2fac90[_0xea4c('0x30')]};return db[_0xea4c('0x35')][_0xea4c('0x18')](_0x1b698d)[_0xea4c('0x1e')](function(_0x20d61a){_0x558d9a['count']=_0x20d61a;if(_0xbc7871[_0xea4c('0x29')][_0xea4c('0x36')]){_0x2fac90['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0xea4c('0x37')](_0x2fac90);})[_0xea4c('0x1e')](function(_0x2897f3){_0x558d9a[_0xea4c('0x38')]=_0x2897f3;return _0x558d9a;})[_0xea4c('0x1e')](respondWithFilteredResult(_0xaed282,_0x2fac90))['catch'](handleError(_0xaed282,null));};exports['show']=function(_0x17f20e,_0x463e9c){var _0x4923f5={'raw':!![],'where':{'id':_0x17f20e[_0xea4c('0x39')]['id']}},_0x3adb0e={};_0x3adb0e[_0xea4c('0x28')]=_['keys'](db[_0xea4c('0x35')][_0xea4c('0x24')]);_0x3adb0e['query']=_[_0xea4c('0x3a')](_0x17f20e[_0xea4c('0x29')]);_0x3adb0e[_0xea4c('0x2a')]=_[_0xea4c('0x2b')](_0x3adb0e['model'],_0x3adb0e['query']);_0x4923f5['attributes']=_[_0xea4c('0x2b')](_0x3adb0e[_0xea4c('0x28')],qs[_0xea4c('0x2d')](_0x17f20e[_0xea4c('0x29')][_0xea4c('0x2d')]));_0x4923f5[_0xea4c('0x2c')]=_0x4923f5['attributes'][_0xea4c('0x2e')]?_0x4923f5[_0xea4c('0x2c')]:_0x3adb0e[_0xea4c('0x28')];if(_0x17f20e[_0xea4c('0x29')][_0xea4c('0x36')]){_0x4923f5[_0xea4c('0x3b')]=[{'all':!![]}];}_0x4923f5=_[_0xea4c('0x33')]({},_0x4923f5,_0x17f20e[_0xea4c('0x34')]);return db[_0xea4c('0x35')][_0xea4c('0x3c')](_0x4923f5)['then'](handleEntityNotFound(_0x463e9c,null))[_0xea4c('0x1e')](respondWithResult(_0x463e9c,null))['catch'](handleError(_0x463e9c,null));};exports[_0xea4c('0x3d')]=function(_0x5a59c2,_0x35f5a9){return db['FaxTransferReport']['create'](_0x5a59c2[_0xea4c('0x3e')],{})[_0xea4c('0x1e')](respondWithResult(_0x35f5a9,0xc9))[_0xea4c('0x3f')](handleError(_0x35f5a9,null));};exports[_0xea4c('0x1d')]=function(_0x130a77,_0x78baab){if(_0x130a77[_0xea4c('0x3e')]['id']){delete _0x130a77[_0xea4c('0x3e')]['id'];}return db[_0xea4c('0x35')][_0xea4c('0x3c')]({'where':{'id':_0x130a77[_0xea4c('0x39')]['id']}})['then'](handleEntityNotFound(_0x78baab,null))[_0xea4c('0x1e')](saveUpdates(_0x130a77[_0xea4c('0x3e')],null))[_0xea4c('0x1e')](respondWithResult(_0x78baab,null))['catch'](handleError(_0x78baab,null));};exports[_0xea4c('0x40')]=function(_0x1f6a5a,_0x118d47){return db['FaxTransferReport'][_0xea4c('0x3c')]({'where':{'id':_0x1f6a5a[_0xea4c('0x39')]['id']}})[_0xea4c('0x1e')](handleEntityNotFound(_0x118d47,null))['then'](removeEntity(_0x118d47,null))[_0xea4c('0x3f')](handleError(_0x118d47,null));};exports[_0xea4c('0x41')]=function(_0x8e29f1,_0x47e308){return db[_0xea4c('0x35')][_0xea4c('0x41')]()[_0xea4c('0x1e')](respondWithResult(_0x47e308,null))['catch'](handleError(_0x47e308,null));}; \ No newline at end of file +var _0x9a62=['fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x59926a,_0x329fdd){var _0x1a756b=function(_0x315afd){while(--_0x315afd){_0x59926a['push'](_0x59926a['shift']());}};_0x1a756b(++_0x329fdd);}(_0x9a62,0x134));var _0x29a6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9a62[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x29a6('0x0'));var rimraf=require(_0x29a6('0x1'));var zipdir=require(_0x29a6('0x2'));var jsonpatch=require(_0x29a6('0x3'));var rp=require(_0x29a6('0x4'));var moment=require(_0x29a6('0x5'));var BPromise=require(_0x29a6('0x6'));var Mustache=require('mustache');var util=require(_0x29a6('0x7'));var path=require(_0x29a6('0x8'));var sox=require(_0x29a6('0x9'));var csv=require(_0x29a6('0xa'));var ejs=require(_0x29a6('0xb'));var fs=require('fs');var fs_extra=require(_0x29a6('0xc'));var _=require(_0x29a6('0xd'));var squel=require(_0x29a6('0xe'));var crypto=require(_0x29a6('0xf'));var jsforce=require(_0x29a6('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x29a6('0xa'));var querystring=require(_0x29a6('0x11'));var Papa=require(_0x29a6('0x12'));var Redis=require(_0x29a6('0x13'));var authService=require(_0x29a6('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x29a6('0x15'));var hardwareService=require(_0x29a6('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x29a6('0x17'));var config=require(_0x29a6('0x18'));var licenseUtil=require(_0x29a6('0x19'));var db=require(_0x29a6('0x1a'))['db'];function respondWithStatusCode(_0x2a4d71,_0x181928){_0x181928=_0x181928||0xcc;return function(_0x354b82){if(_0x354b82){return _0x2a4d71[_0x29a6('0x1b')](_0x181928);}return _0x2a4d71['status'](_0x181928)[_0x29a6('0x1c')]();};}function respondWithResult(_0x1fa847,_0x475062){_0x475062=_0x475062||0xc8;return function(_0xf7227f){if(_0xf7227f){return _0x1fa847[_0x29a6('0x1d')](_0x475062)[_0x29a6('0x1e')](_0xf7227f);}};}function respondWithFilteredResult(_0x33483f,_0x14e439){return function(_0x43c8ed){if(_0x43c8ed){var _0x5dbad6=typeof _0x14e439[_0x29a6('0x1f')]==='undefined'&&typeof _0x14e439[_0x29a6('0x20')]===_0x29a6('0x21');var _0x290ebf=_0x43c8ed[_0x29a6('0x22')];var _0x2811be=_0x5dbad6?0x0:_0x14e439[_0x29a6('0x1f')];var _0x547552=_0x5dbad6?_0x43c8ed[_0x29a6('0x22')]:_0x14e439['offset']+_0x14e439[_0x29a6('0x20')];var _0x1c748b;if(_0x547552>=_0x290ebf){_0x547552=_0x290ebf;_0x1c748b=0xc8;}else{_0x1c748b=0xce;}_0x33483f['status'](_0x1c748b);return _0x33483f['set'](_0x29a6('0x23'),_0x2811be+'-'+_0x547552+'/'+_0x290ebf)[_0x29a6('0x1e')](_0x43c8ed);}return null;};}function patchUpdates(_0x1706e4){return function(_0x578922){try{jsonpatch[_0x29a6('0x24')](_0x578922,_0x1706e4,!![]);}catch(_0xe85170){return BPromise[_0x29a6('0x25')](_0xe85170);}return _0x578922[_0x29a6('0x26')]();};}function saveUpdates(_0x3aed11,_0x4454b5){return function(_0x59c6a1){if(_0x59c6a1){return _0x59c6a1[_0x29a6('0x27')](_0x3aed11)[_0x29a6('0x28')](function(_0xdda6ce){return _0xdda6ce;});}return null;};}function removeEntity(_0x1750be,_0x31c33a){return function(_0x30af1a){if(_0x30af1a){return _0x30af1a[_0x29a6('0x29')]()[_0x29a6('0x28')](function(){_0x1750be['status'](0xcc)[_0x29a6('0x1c')]();});}};}function handleEntityNotFound(_0x2bc121,_0x4d843d){return function(_0x2865b0){if(!_0x2865b0){_0x2bc121[_0x29a6('0x1b')](0x194);}return _0x2865b0;};}function handleError(_0x3be467,_0x446ac5){_0x446ac5=_0x446ac5||0x1f4;return function(_0x1e38ca){logger[_0x29a6('0x2a')](_0x1e38ca[_0x29a6('0x2b')]);if(_0x1e38ca[_0x29a6('0x2c')]){delete _0x1e38ca[_0x29a6('0x2c')];}_0x3be467['status'](_0x446ac5)[_0x29a6('0x2d')](_0x1e38ca);};}exports[_0x29a6('0x2e')]=function(_0xd425e,_0x51ecc3){var _0x55a730={},_0x156745={},_0x2f9efe={'count':0x0,'rows':[]};var _0x7a916c=_[_0x29a6('0x2f')](db[_0x29a6('0x30')][_0x29a6('0x31')],function(_0x40c731){return{'name':_0x40c731[_0x29a6('0x32')],'type':_0x40c731['type'][_0x29a6('0x33')]};});_0x156745[_0x29a6('0x34')]=_['map'](_0x7a916c,_0x29a6('0x2c'));_0x156745['query']=_[_0x29a6('0x35')](_0xd425e[_0x29a6('0x36')]);_0x156745[_0x29a6('0x37')]=_[_0x29a6('0x38')](_0x156745[_0x29a6('0x34')],_0x156745[_0x29a6('0x36')]);_0x55a730[_0x29a6('0x39')]=_[_0x29a6('0x38')](_0x156745[_0x29a6('0x34')],qs['fields'](_0xd425e['query'][_0x29a6('0x3a')]));_0x55a730[_0x29a6('0x39')]=_0x55a730[_0x29a6('0x39')][_0x29a6('0x3b')]?_0x55a730[_0x29a6('0x39')]:_0x156745[_0x29a6('0x34')];if(!_0xd425e[_0x29a6('0x36')]['hasOwnProperty'](_0x29a6('0x3c'))){_0x55a730['limit']=qs[_0x29a6('0x20')](_0xd425e[_0x29a6('0x36')][_0x29a6('0x20')]);_0x55a730[_0x29a6('0x1f')]=qs[_0x29a6('0x1f')](_0xd425e[_0x29a6('0x36')]['offset']);}_0x55a730[_0x29a6('0x3d')]=qs[_0x29a6('0x3e')](_0xd425e[_0x29a6('0x36')][_0x29a6('0x3e')]);_0x55a730[_0x29a6('0x3f')]=qs[_0x29a6('0x37')](_[_0x29a6('0x40')](_0xd425e[_0x29a6('0x36')],_0x156745['filters']),_0x7a916c);if(_0xd425e['query']['filter']){_0x55a730[_0x29a6('0x3f')]=_[_0x29a6('0x41')](_0x55a730[_0x29a6('0x3f')],{'$or':_[_0x29a6('0x2f')](_0x7a916c,function(_0xc1546c){if(_0xc1546c[_0x29a6('0x42')]!==_0x29a6('0x43')){var _0x45bbf5={};_0x45bbf5[_0xc1546c['name']]={'$like':'%'+_0xd425e[_0x29a6('0x36')][_0x29a6('0x44')]+'%'};return _0x45bbf5;}})});}_0x55a730=_[_0x29a6('0x41')]({},_0x55a730,_0xd425e['options']);var _0x1596e9={'where':_0x55a730[_0x29a6('0x3f')]};return db[_0x29a6('0x30')][_0x29a6('0x22')](_0x1596e9)[_0x29a6('0x28')](function(_0x29ad4f){_0x2f9efe[_0x29a6('0x22')]=_0x29ad4f;if(_0xd425e[_0x29a6('0x36')][_0x29a6('0x45')]){_0x55a730[_0x29a6('0x46')]=[{'all':!![]}];}return db[_0x29a6('0x30')][_0x29a6('0x47')](_0x55a730);})['then'](function(_0x8a1b63){_0x2f9efe[_0x29a6('0x48')]=_0x8a1b63;return _0x2f9efe;})['then'](respondWithFilteredResult(_0x51ecc3,_0x55a730))[_0x29a6('0x49')](handleError(_0x51ecc3,null));};exports['show']=function(_0x22b169,_0xda95fb){var _0x13bc35={'raw':!![],'where':{'id':_0x22b169[_0x29a6('0x4a')]['id']}},_0x540799={};_0x540799[_0x29a6('0x34')]=_[_0x29a6('0x35')](db[_0x29a6('0x30')]['rawAttributes']);_0x540799[_0x29a6('0x36')]=_[_0x29a6('0x35')](_0x22b169[_0x29a6('0x36')]);_0x540799[_0x29a6('0x37')]=_[_0x29a6('0x38')](_0x540799[_0x29a6('0x34')],_0x540799[_0x29a6('0x36')]);_0x13bc35[_0x29a6('0x39')]=_[_0x29a6('0x38')](_0x540799[_0x29a6('0x34')],qs['fields'](_0x22b169[_0x29a6('0x36')][_0x29a6('0x3a')]));_0x13bc35[_0x29a6('0x39')]=_0x13bc35['attributes'][_0x29a6('0x3b')]?_0x13bc35[_0x29a6('0x39')]:_0x540799[_0x29a6('0x34')];if(_0x22b169[_0x29a6('0x36')][_0x29a6('0x45')]){_0x13bc35['include']=[{'all':!![]}];}_0x13bc35=_[_0x29a6('0x41')]({},_0x13bc35,_0x22b169[_0x29a6('0x4b')]);return db['FaxTransferReport'][_0x29a6('0x4c')](_0x13bc35)[_0x29a6('0x28')](handleEntityNotFound(_0xda95fb,null))[_0x29a6('0x28')](respondWithResult(_0xda95fb,null))[_0x29a6('0x49')](handleError(_0xda95fb,null));};exports[_0x29a6('0x4d')]=function(_0x1208e8,_0x15af53){return db[_0x29a6('0x30')][_0x29a6('0x4d')](_0x1208e8['body'],{})[_0x29a6('0x28')](respondWithResult(_0x15af53,0xc9))[_0x29a6('0x49')](handleError(_0x15af53,null));};exports[_0x29a6('0x27')]=function(_0x2efb5c,_0x5f050c){if(_0x2efb5c['body']['id']){delete _0x2efb5c[_0x29a6('0x4e')]['id'];}return db['FaxTransferReport'][_0x29a6('0x4c')]({'where':{'id':_0x2efb5c[_0x29a6('0x4a')]['id']}})[_0x29a6('0x28')](handleEntityNotFound(_0x5f050c,null))['then'](saveUpdates(_0x2efb5c[_0x29a6('0x4e')],null))['then'](respondWithResult(_0x5f050c,null))[_0x29a6('0x49')](handleError(_0x5f050c,null));};exports[_0x29a6('0x29')]=function(_0x368dfb,_0x193c9f){return db[_0x29a6('0x30')][_0x29a6('0x4c')]({'where':{'id':_0x368dfb['params']['id']}})[_0x29a6('0x28')](handleEntityNotFound(_0x193c9f,null))[_0x29a6('0x28')](removeEntity(_0x193c9f,null))[_0x29a6('0x49')](handleError(_0x193c9f,null));};exports['describe']=function(_0x1d6a5b,_0x28d3a0){return db[_0x29a6('0x30')][_0x29a6('0x4f')]()[_0x29a6('0x28')](respondWithResult(_0x28d3a0,null))['catch'](handleError(_0x28d3a0,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 31b938c..3509427 100644 --- a/server/api/faxTransferReport/faxTransferReport.model.js +++ b/server/api/faxTransferReport/faxTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2671=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','FaxTransferReport','report_fax_transfer','uniqueid'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x2671,0xfc));var _0x1267=function(_0x5c7e53,_0x174ce5){_0x5c7e53=_0x5c7e53-0x0;var _0x1c9af9=_0x2671[_0x5c7e53];return _0x1c9af9;};'use strict';var _=require(_0x1267('0x0'));var util=require(_0x1267('0x1'));var logger=require(_0x1267('0x2'))(_0x1267('0x3'));var moment=require(_0x1267('0x4'));var BPromise=require(_0x1267('0x5'));var rp=require(_0x1267('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1267('0x7'));var config=require(_0x1267('0x8'));var attributes=require(_0x1267('0x9'));module[_0x1267('0xa')]=function(_0x1b05dd,_0x46a80a){return _0x1b05dd['define'](_0x1267('0xb'),attributes,{'tableName':_0x1267('0xc'),'paranoid':![],'indexes':[{'name':_0x1267('0xd'),'fields':[_0x1267('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x34e0=['util','../../config/logger','moment','bluebird','path','define','FaxTransferReport','uniqueid'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0x34e0,0xa0));var _0x034e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x34e0[_0x2763f2];return _0x3ef471;};'use strict';var _=require('lodash');var util=require(_0x034e('0x0'));var logger=require(_0x034e('0x1'))('api');var moment=require(_0x034e('0x2'));var BPromise=require(_0x034e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x034e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x39740a,_0x1a3b1d){return _0x39740a[_0x034e('0x5')](_0x034e('0x6'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x034e('0x7'),'fields':[_0x034e('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 0e6f77f..3e88c10 100644 --- a/server/api/faxTransferReport/faxTransferReport.rpc.js +++ b/server/api/faxTransferReport/faxTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd71c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xd71c,0x13a));var _0xcd71=function(_0x41ba35,_0x2dfbe8){_0x41ba35=_0x41ba35-0x0;var _0x4e10a0=_0xd71c[_0x41ba35];return _0x4e10a0;};'use strict';var _=require('lodash');var util=require(_0xcd71('0x0'));var moment=require('moment');var BPromise=require(_0xcd71('0x1'));var rs=require(_0xcd71('0x2'));var fs=require('fs');var Redis=require(_0xcd71('0x3'));var db=require(_0xcd71('0x4'))['db'];var utils=require(_0xcd71('0x5'));var logger=require('../../config/logger')(_0xcd71('0x6'));var config=require(_0xcd71('0x7'));var jayson=require(_0xcd71('0x8'));var client=jayson[_0xcd71('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c618c,_0x1cec71,_0x53954c){return new BPromise(function(_0x1b1fcb,_0x54e953){return client[_0xcd71('0xa')](_0x3c618c,_0x53954c)[_0xcd71('0xb')](function(_0x2aae48){logger['info'](_0xcd71('0xc'),_0x1cec71,_0xcd71('0xd'));logger[_0xcd71('0xe')](_0xcd71('0xf'),_0x1cec71,_0xcd71('0xd'),JSON[_0xcd71('0x10')](_0x2aae48));if(_0x2aae48[_0xcd71('0x11')]){if(_0x2aae48[_0xcd71('0x11')][_0xcd71('0x12')]===0x1f4){logger[_0xcd71('0x11')](_0xcd71('0xc'),_0x1cec71,_0x2aae48[_0xcd71('0x11')][_0xcd71('0x13')]);return _0x54e953(_0x2aae48[_0xcd71('0x11')][_0xcd71('0x13')]);}logger[_0xcd71('0x11')](_0xcd71('0xc'),_0x1cec71,_0x2aae48[_0xcd71('0x11')][_0xcd71('0x13')]);return _0x1b1fcb(_0x2aae48['error']['message']);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x1cec71,'request\x20sent');_0x1b1fcb(_0x2aae48[_0xcd71('0x14')][_0xcd71('0x13')]);}})['catch'](function(_0x52cb18){logger[_0xcd71('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x1cec71,_0x52cb18);_0x54e953(_0x52cb18);});});} \ No newline at end of file +var _0x8992=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0xa0a3d0,_0x14cddb){var _0x5c7fea=function(_0x28c54f){while(--_0x28c54f){_0xa0a3d0['push'](_0xa0a3d0['shift']());}};_0x5c7fea(++_0x14cddb);}(_0x8992,0x6d));var _0x2899=function(_0x1ea750,_0x1eef90){_0x1ea750=_0x1ea750-0x0;var _0x4e2baf=_0x8992[_0x1ea750];return _0x4e2baf;};'use strict';var _=require(_0x2899('0x0'));var util=require(_0x2899('0x1'));var moment=require(_0x2899('0x2'));var BPromise=require(_0x2899('0x3'));var rs=require(_0x2899('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2899('0x5'))['db'];var utils=require(_0x2899('0x6'));var logger=require('../../config/logger')(_0x2899('0x7'));var config=require(_0x2899('0x8'));var jayson=require(_0x2899('0x9'));var client=jayson[_0x2899('0xa')][_0x2899('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xaf77ed,_0x3a3540,_0x4e82bb){return new BPromise(function(_0x3c8cbf,_0x3fab59){return client[_0x2899('0xc')](_0xaf77ed,_0x4e82bb)['then'](function(_0x3370b9){logger['info'](_0x2899('0xd'),_0x3a3540,_0x2899('0xe'));logger['debug'](_0x2899('0xf'),_0x3a3540,_0x2899('0xe'),JSON[_0x2899('0x10')](_0x3370b9));if(_0x3370b9[_0x2899('0x11')]){if(_0x3370b9[_0x2899('0x11')][_0x2899('0x12')]===0x1f4){logger['error'](_0x2899('0xd'),_0x3a3540,_0x3370b9['error'][_0x2899('0x13')]);return _0x3fab59(_0x3370b9['error']['message']);}logger[_0x2899('0x11')](_0x2899('0xd'),_0x3a3540,_0x3370b9[_0x2899('0x11')]['message']);return _0x3c8cbf(_0x3370b9['error'][_0x2899('0x13')]);}else{logger[_0x2899('0x14')](_0x2899('0xd'),_0x3a3540,'request\x20sent');_0x3c8cbf(_0x3370b9[_0x2899('0x15')][_0x2899('0x13')]);}})[_0x2899('0x16')](function(_0x500eb7){logger[_0x2899('0x11')](_0x2899('0xd'),_0x3a3540,_0x500eb7);_0x3fab59(_0x500eb7);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 1c85dee..dcf5bee 100644 --- a/server/api/faxTransferReport/index.js +++ b/server/api/faxTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd97=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','get','/:id','show','post','create','put','update','destroy','util','path','connect-timeout','express','Router'];(function(_0x4bcf38,_0x3c12be){var _0x4a89be=function(_0x3215a6){while(--_0x3215a6){_0x4bcf38['push'](_0x4bcf38['shift']());}};_0x4a89be(++_0x3c12be);}(_0xbd97,0x164));var _0x7bd9=function(_0x2220e1,_0x5c5537){_0x2220e1=_0x2220e1-0x0;var _0x10314c=_0xbd97[_0x2220e1];return _0x10314c;};'use strict';var multer=require('multer');var util=require(_0x7bd9('0x0'));var path=require(_0x7bd9('0x1'));var timeout=require(_0x7bd9('0x2'));var express=require(_0x7bd9('0x3'));var router=express[_0x7bd9('0x4')]();var fs_extra=require(_0x7bd9('0x5'));var auth=require(_0x7bd9('0x6'));var interaction=require(_0x7bd9('0x7'));var config=require(_0x7bd9('0x8'));var controller=require(_0x7bd9('0x9'));router['get']('/',auth[_0x7bd9('0xa')](),controller['index']);router[_0x7bd9('0xb')]('/describe',auth[_0x7bd9('0xa')](),controller['describe']);router[_0x7bd9('0xb')](_0x7bd9('0xc'),auth[_0x7bd9('0xa')](),controller[_0x7bd9('0xd')]);router[_0x7bd9('0xe')]('/',auth['isAuthenticated'](),controller[_0x7bd9('0xf')]);router[_0x7bd9('0x10')]('/:id',auth[_0x7bd9('0xa')](),controller[_0x7bd9('0x11')]);router['delete'](_0x7bd9('0xc'),auth[_0x7bd9('0xa')](),controller[_0x7bd9('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6f9b=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','delete','/:id','destroy','multer','util'];(function(_0x305b00,_0x103b96){var _0x177978=function(_0x44caed){while(--_0x44caed){_0x305b00['push'](_0x305b00['shift']());}};_0x177978(++_0x103b96);}(_0x6f9b,0x1cc));var _0xb6f9=function(_0x2efac2,_0x4414b9){_0x2efac2=_0x2efac2-0x0;var _0x33c6d3=_0x6f9b[_0x2efac2];return _0x33c6d3;};'use strict';var multer=require(_0xb6f9('0x0'));var util=require(_0xb6f9('0x1'));var path=require(_0xb6f9('0x2'));var timeout=require('connect-timeout');var express=require(_0xb6f9('0x3'));var router=express[_0xb6f9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb6f9('0x5'));var interaction=require(_0xb6f9('0x6'));var config=require(_0xb6f9('0x7'));var controller=require(_0xb6f9('0x8'));router[_0xb6f9('0x9')]('/',auth[_0xb6f9('0xa')](),controller[_0xb6f9('0xb')]);router[_0xb6f9('0x9')](_0xb6f9('0xc'),auth['isAuthenticated'](),controller[_0xb6f9('0xd')]);router[_0xb6f9('0x9')]('/:id',auth[_0xb6f9('0xa')](),controller[_0xb6f9('0xe')]);router[_0xb6f9('0xf')]('/',auth[_0xb6f9('0xa')](),controller[_0xb6f9('0x10')]);router[_0xb6f9('0x11')]('/:id',auth[_0xb6f9('0xa')](),controller['update']);router[_0xb6f9('0x12')](_0xb6f9('0x13'),auth['isAuthenticated'](),controller[_0xb6f9('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 975e7c7..c53ce3c 100644 --- a/server/api/intDeskAccount/index.js +++ b/server/api/intDeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf6e1=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','create','/:id/configurations','addConfiguration','put'];(function(_0x41a6b1,_0x33302b){var _0x26a187=function(_0x4fa33f){while(--_0x4fa33f){_0x41a6b1['push'](_0x41a6b1['shift']());}};_0x26a187(++_0x33302b);}(_0xf6e1,0x183));var _0x1f6e=function(_0x8a7891,_0x3d62da){_0x8a7891=_0x8a7891-0x0;var _0x3af84b=_0xf6e1[_0x8a7891];return _0x3af84b;};'use strict';var multer=require(_0x1f6e('0x0'));var util=require(_0x1f6e('0x1'));var path=require(_0x1f6e('0x2'));var timeout=require(_0x1f6e('0x3'));var express=require(_0x1f6e('0x4'));var router=express[_0x1f6e('0x5')]();var fs_extra=require(_0x1f6e('0x6'));var auth=require(_0x1f6e('0x7'));var interaction=require(_0x1f6e('0x8'));var config=require(_0x1f6e('0x9'));var controller=require('./intDeskAccount.controller');router[_0x1f6e('0xa')]('/',auth[_0x1f6e('0xb')](),controller[_0x1f6e('0xc')]);router[_0x1f6e('0xa')](_0x1f6e('0xd'),auth[_0x1f6e('0xb')](),controller[_0x1f6e('0xe')]);router['get']('/:id/configurations',auth[_0x1f6e('0xb')](),controller[_0x1f6e('0xf')]);router[_0x1f6e('0xa')]('/:id/fields',auth[_0x1f6e('0xb')](),controller[_0x1f6e('0x10')]);router['post']('/',auth[_0x1f6e('0xb')](),controller[_0x1f6e('0x11')]);router['post'](_0x1f6e('0x12'),auth[_0x1f6e('0xb')](),controller[_0x1f6e('0x13')]);router[_0x1f6e('0x14')]('/:id',auth[_0x1f6e('0xb')](),controller[_0x1f6e('0x15')]);router[_0x1f6e('0x16')](_0x1f6e('0xd'),auth[_0x1f6e('0xb')](),controller[_0x1f6e('0x17')]);module['exports']=router; \ No newline at end of file +var _0x3c2d=['post','put','/:id','update','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','getConfigurations','/:id/fields','getFields'];(function(_0x40c58c,_0x2d371f){var _0x4bcb9f=function(_0x3e5df3){while(--_0x3e5df3){_0x40c58c['push'](_0x40c58c['shift']());}};_0x4bcb9f(++_0x2d371f);}(_0x3c2d,0x1d9));var _0xd3c2=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x3c2d[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0xd3c2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd3c2('0x1'));var express=require('express');var router=express[_0xd3c2('0x2')]();var fs_extra=require(_0xd3c2('0x3'));var auth=require(_0xd3c2('0x4'));var interaction=require(_0xd3c2('0x5'));var config=require(_0xd3c2('0x6'));var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0xd3c2('0x7')](),controller[_0xd3c2('0x8')]);router[_0xd3c2('0x9')]('/:id',auth[_0xd3c2('0x7')](),controller['show']);router[_0xd3c2('0x9')]('/:id/configurations',auth[_0xd3c2('0x7')](),controller[_0xd3c2('0xa')]);router[_0xd3c2('0x9')](_0xd3c2('0xb'),auth[_0xd3c2('0x7')](),controller[_0xd3c2('0xc')]);router[_0xd3c2('0xd')]('/',auth[_0xd3c2('0x7')](),controller['create']);router['post']('/:id/configurations',auth[_0xd3c2('0x7')](),controller['addConfiguration']);router[_0xd3c2('0xe')](_0xd3c2('0xf'),auth[_0xd3c2('0x7')](),controller[_0xd3c2('0x10')]);router['delete']('/:id',auth[_0xd3c2('0x7')](),controller['destroy']);module[_0xd3c2('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 7f62241..cf48b7e 100644 --- a/server/api/intDeskAccount/intDeskAccount.attributes.js +++ b/server/api/intDeskAccount/intDeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc34d=['exports','STRING','ENUM','basic','newTab','integrationTab','sequelize'];(function(_0x1a7567,_0x58e148){var _0xc9b41d=function(_0x17da59){while(--_0x17da59){_0x1a7567['push'](_0x1a7567['shift']());}};_0xc9b41d(++_0x58e148);}(_0xc34d,0xd8));var _0xdc34=function(_0x1b3a86,_0x4096a2){_0x1b3a86=_0x1b3a86-0x0;var _0x488108=_0xc34d[_0x1b3a86];return _0x488108;};'use strict';var Sequelize=require(_0xdc34('0x0'));module[_0xdc34('0x1')]={'name':{'type':Sequelize[_0xdc34('0x2')]},'description':{'type':Sequelize[_0xdc34('0x2')]},'username':{'type':Sequelize[_0xdc34('0x2')]},'remoteUri':{'type':Sequelize[_0xdc34('0x2')]},'authType':{'type':Sequelize[_0xdc34('0x3')](_0xdc34('0x4')),'defaultValue':_0xdc34('0x4')},'password':{'type':Sequelize[_0xdc34('0x2')]},'consumerKey':{'type':Sequelize[_0xdc34('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xdc34('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xdc34('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xdc34('0x3')]('integrationTab',_0xdc34('0x5')),'defaultValue':_0xdc34('0x6')}}; \ No newline at end of file +var _0xbfa8=['integrationTab','sequelize','exports','STRING','basic','ENUM'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xbfa8,0x17b));var _0x8bfa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbfa8[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x8bfa('0x0'));module[_0x8bfa('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8bfa('0x2')]},'username':{'type':Sequelize[_0x8bfa('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0x8bfa('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x8bfa('0x2')]},'consumerSecret':{'type':Sequelize[_0x8bfa('0x2')]},'token':{'type':Sequelize[_0x8bfa('0x2')]},'tokenSecret':{'type':Sequelize[_0x8bfa('0x2')]},'serverUrl':{'type':Sequelize[_0x8bfa('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8bfa('0x4')](_0x8bfa('0x5'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 1f19e95..d40f1cd 100644 --- a/server/api/intDeskAccount/intDeskAccount.controller.js +++ b/server/api/intDeskAccount/intDeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf735=['sendStatus','status','end','json','undefined','offset','count','limit','Content-Range','apply','reject','then','destroy','error','stack','name','send','map','DeskAccount','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','getConfigurations','findOne','filter','hasOwnProperty','AccountId','Subjects','getSubjects','getDescriptions','channel','DeskField','Descriptions','getFields','priority','remoteUri','consumerKey','consumerSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','headers','%s:%s','username','base64','concat','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration'];(function(_0x4e0d09,_0x54477b){var _0xe1d961=function(_0xbcaed4){while(--_0xbcaed4){_0x4e0d09['push'](_0x4e0d09['shift']());}};_0xe1d961(++_0x54477b);}(_0xf735,0x129));var _0x5f73=function(_0x24239a,_0x26c856){_0x24239a=_0x24239a-0x0;var _0x343eb6=_0xf735[_0x24239a];return _0x343eb6;};'use strict';var emlformat=require(_0x5f73('0x0'));var rimraf=require(_0x5f73('0x1'));var zipdir=require(_0x5f73('0x2'));var jsonpatch=require(_0x5f73('0x3'));var rp=require(_0x5f73('0x4'));var moment=require('moment');var BPromise=require(_0x5f73('0x5'));var Mustache=require('mustache');var util=require(_0x5f73('0x6'));var path=require(_0x5f73('0x7'));var sox=require(_0x5f73('0x8'));var csv=require(_0x5f73('0x9'));var ejs=require(_0x5f73('0xa'));var fs=require('fs');var fs_extra=require(_0x5f73('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5f73('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5f73('0xd'));var toCsv=require(_0x5f73('0x9'));var querystring=require(_0x5f73('0xe'));var Papa=require(_0x5f73('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5f73('0x10'));var as=require(_0x5f73('0x11'));var hardwareService=require(_0x5f73('0x12'));var logger=require('../../config/logger')(_0x5f73('0x13'));var utils=require(_0x5f73('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5f73('0x15'));var db=require(_0x5f73('0x16'))['db'];var integrations=require(_0x5f73('0x17'));function respondWithStatusCode(_0x5c7996,_0x44bc90){_0x44bc90=_0x44bc90||0xcc;return function(_0xd71fdb){if(_0xd71fdb){return _0x5c7996[_0x5f73('0x18')](_0x44bc90);}return _0x5c7996[_0x5f73('0x19')](_0x44bc90)[_0x5f73('0x1a')]();};}function respondWithResult(_0x4c22cf,_0x5bcd06){_0x5bcd06=_0x5bcd06||0xc8;return function(_0x47c798){if(_0x47c798){return _0x4c22cf[_0x5f73('0x19')](_0x5bcd06)[_0x5f73('0x1b')](_0x47c798);}};}function respondWithFilteredResult(_0x20a2fd,_0x16528b){return function(_0x417a10){if(_0x417a10){var _0x8fe342=typeof _0x16528b['offset']===_0x5f73('0x1c')&&typeof _0x16528b['limit']===_0x5f73('0x1c');var _0x45f527=_0x417a10['count'];var _0x290713=_0x8fe342?0x0:_0x16528b[_0x5f73('0x1d')];var _0x546a28=_0x8fe342?_0x417a10[_0x5f73('0x1e')]:_0x16528b[_0x5f73('0x1d')]+_0x16528b[_0x5f73('0x1f')];var _0x35b5ae;if(_0x546a28>=_0x45f527){_0x546a28=_0x45f527;_0x35b5ae=0xc8;}else{_0x35b5ae=0xce;}_0x20a2fd[_0x5f73('0x19')](_0x35b5ae);return _0x20a2fd['set'](_0x5f73('0x20'),_0x290713+'-'+_0x546a28+'/'+_0x45f527)[_0x5f73('0x1b')](_0x417a10);}return null;};}function patchUpdates(_0x3b60df){return function(_0x468623){try{jsonpatch[_0x5f73('0x21')](_0x468623,_0x3b60df,!![]);}catch(_0x498663){return BPromise[_0x5f73('0x22')](_0x498663);}return _0x468623['save']();};}function saveUpdates(_0x561dd9,_0x62162f){return function(_0xde92ad){if(_0xde92ad){return _0xde92ad['update'](_0x561dd9)[_0x5f73('0x23')](function(_0x3a477b){return _0x3a477b;});}return null;};}function removeEntity(_0x98dbc4,_0x43a8c8){return function(_0x1db59d){if(_0x1db59d){return _0x1db59d[_0x5f73('0x24')]()[_0x5f73('0x23')](function(){_0x98dbc4['status'](0xcc)[_0x5f73('0x1a')]();});}};}function handleEntityNotFound(_0x1fa895,_0x1ab12c){return function(_0x1fb689){if(!_0x1fb689){_0x1fa895[_0x5f73('0x18')](0x194);}return _0x1fb689;};}function handleError(_0x446258,_0x262bc3){_0x262bc3=_0x262bc3||0x1f4;return function(_0x418a7c){logger[_0x5f73('0x25')](_0x418a7c[_0x5f73('0x26')]);if(_0x418a7c['name']){delete _0x418a7c[_0x5f73('0x27')];}_0x446258[_0x5f73('0x19')](_0x262bc3)[_0x5f73('0x28')](_0x418a7c);};}exports['index']=function(_0x537507,_0x43a5cc){var _0x3258f0={},_0x357592={},_0x438f16={'count':0x0,'rows':[]};var _0x3f4b48=_[_0x5f73('0x29')](db[_0x5f73('0x2a')][_0x5f73('0x2b')],function(_0x154909){return{'name':_0x154909['fieldName'],'type':_0x154909[_0x5f73('0x2c')][_0x5f73('0x2d')]};});_0x357592['model']=_[_0x5f73('0x29')](_0x3f4b48,_0x5f73('0x27'));_0x357592[_0x5f73('0x2e')]=_[_0x5f73('0x2f')](_0x537507[_0x5f73('0x2e')]);_0x357592[_0x5f73('0x30')]=_[_0x5f73('0x31')](_0x357592['model'],_0x357592[_0x5f73('0x2e')]);_0x3258f0['attributes']=_[_0x5f73('0x31')](_0x357592[_0x5f73('0x32')],qs[_0x5f73('0x33')](_0x537507[_0x5f73('0x2e')]['fields']));_0x3258f0['attributes']=_0x3258f0[_0x5f73('0x34')][_0x5f73('0x35')]?_0x3258f0[_0x5f73('0x34')]:_0x357592[_0x5f73('0x32')];if(!_0x537507[_0x5f73('0x2e')]['hasOwnProperty'](_0x5f73('0x36'))){_0x3258f0[_0x5f73('0x1f')]=qs['limit'](_0x537507['query']['limit']);_0x3258f0[_0x5f73('0x1d')]=qs[_0x5f73('0x1d')](_0x537507[_0x5f73('0x2e')][_0x5f73('0x1d')]);}_0x3258f0[_0x5f73('0x37')]=qs[_0x5f73('0x38')](_0x537507[_0x5f73('0x2e')][_0x5f73('0x38')]);_0x3258f0['where']=qs[_0x5f73('0x30')](_['pick'](_0x537507[_0x5f73('0x2e')],_0x357592['filters']),_0x3f4b48);if(_0x537507[_0x5f73('0x2e')]['filter']){_0x3258f0[_0x5f73('0x39')]=_['merge'](_0x3258f0[_0x5f73('0x39')],{'$or':_[_0x5f73('0x29')](_0x3f4b48,function(_0x2d7969){if(_0x2d7969[_0x5f73('0x2c')]!==_0x5f73('0x3a')){var _0x1b55cc={};_0x1b55cc[_0x2d7969['name']]={'$like':'%'+_0x537507['query']['filter']+'%'};return _0x1b55cc;}})});}_0x3258f0=_[_0x5f73('0x3b')]({},_0x3258f0,_0x537507['options']);var _0x169a01={'where':_0x3258f0[_0x5f73('0x39')]};return db[_0x5f73('0x2a')][_0x5f73('0x1e')](_0x169a01)[_0x5f73('0x23')](function(_0x484f07){_0x438f16[_0x5f73('0x1e')]=_0x484f07;if(_0x537507[_0x5f73('0x2e')][_0x5f73('0x3c')]){_0x3258f0[_0x5f73('0x3d')]=[{'all':!![]}];}return db[_0x5f73('0x2a')][_0x5f73('0x3e')](_0x3258f0);})[_0x5f73('0x23')](function(_0x53b43a){_0x438f16['rows']=_0x53b43a;return _0x438f16;})['then'](respondWithFilteredResult(_0x43a5cc,_0x3258f0))[_0x5f73('0x3f')](handleError(_0x43a5cc,null));};exports[_0x5f73('0x40')]=function(_0x4e8605,_0x52a29f){var _0x4602d7={'raw':![],'where':{'id':_0x4e8605['params']['id']}},_0x1e22e6={};_0x1e22e6[_0x5f73('0x32')]=_['keys'](db[_0x5f73('0x2a')]['rawAttributes']);_0x1e22e6[_0x5f73('0x2e')]=_[_0x5f73('0x2f')](_0x4e8605['query']);_0x1e22e6[_0x5f73('0x30')]=_[_0x5f73('0x31')](_0x1e22e6['model'],_0x1e22e6['query']);_0x4602d7[_0x5f73('0x34')]=_['intersection'](_0x1e22e6[_0x5f73('0x32')],qs[_0x5f73('0x33')](_0x4e8605[_0x5f73('0x2e')][_0x5f73('0x33')]));_0x4602d7[_0x5f73('0x34')]=_0x4602d7['attributes'][_0x5f73('0x35')]?_0x4602d7[_0x5f73('0x34')]:_0x1e22e6[_0x5f73('0x32')];if(_0x4e8605[_0x5f73('0x2e')][_0x5f73('0x3c')]){_0x4602d7[_0x5f73('0x3d')]=[{'all':!![]}];}_0x4602d7=_[_0x5f73('0x3b')]({},_0x4602d7,_0x4e8605[_0x5f73('0x41')]);return db['DeskAccount'][_0x5f73('0x42')](_0x4602d7)[_0x5f73('0x23')](handleEntityNotFound(_0x52a29f,null))[_0x5f73('0x23')](respondWithResult(_0x52a29f,null))[_0x5f73('0x3f')](handleError(_0x52a29f,null));};exports[_0x5f73('0x43')]=function(_0x2c85f6,_0x298bf8){return db['DeskAccount']['create'](_0x2c85f6[_0x5f73('0x44')],{})[_0x5f73('0x23')](respondWithResult(_0x298bf8,0xc9))[_0x5f73('0x3f')](handleError(_0x298bf8,null));};exports['update']=function(_0x4d1cf0,_0x5bca5b){if(_0x4d1cf0['body']['id']){delete _0x4d1cf0[_0x5f73('0x44')]['id'];}return db[_0x5f73('0x2a')][_0x5f73('0x42')]({'where':{'id':_0x4d1cf0[_0x5f73('0x45')]['id']}})[_0x5f73('0x23')](handleEntityNotFound(_0x5bca5b,null))[_0x5f73('0x23')](saveUpdates(_0x4d1cf0['body'],null))[_0x5f73('0x23')](respondWithResult(_0x5bca5b,null))[_0x5f73('0x3f')](handleError(_0x5bca5b,null));};exports[_0x5f73('0x24')]=function(_0x10f369,_0x2816be){return db['DeskAccount'][_0x5f73('0x42')]({'where':{'id':_0x10f369['params']['id']}})[_0x5f73('0x23')](handleEntityNotFound(_0x2816be,null))[_0x5f73('0x23')](removeEntity(_0x2816be,null))['catch'](handleError(_0x2816be,null));};exports[_0x5f73('0x46')]=function(_0x5b08a7,_0x4a9138,_0x5e5696){var _0x3331ec={};var _0x48ccc9={};var _0x2c629d;var _0x3a8b22;return db[_0x5f73('0x2a')][_0x5f73('0x47')]({'where':{'id':_0x5b08a7[_0x5f73('0x45')]['id']}})[_0x5f73('0x23')](handleEntityNotFound(_0x4a9138,null))[_0x5f73('0x23')](function(_0x1f3bbd){if(_0x1f3bbd){_0x2c629d=_0x1f3bbd;_0x48ccc9[_0x5f73('0x32')]=_['keys'](db['DeskConfiguration'][_0x5f73('0x2b')]);_0x48ccc9[_0x5f73('0x2e')]=_[_0x5f73('0x2f')](_0x5b08a7[_0x5f73('0x2e')]);_0x48ccc9[_0x5f73('0x30')]=_['intersection'](_0x48ccc9['model'],_0x48ccc9[_0x5f73('0x2e')]);_0x3331ec['attributes']=_[_0x5f73('0x31')](_0x48ccc9[_0x5f73('0x32')],qs[_0x5f73('0x33')](_0x5b08a7['query'][_0x5f73('0x33')]));_0x3331ec[_0x5f73('0x34')]=_0x3331ec['attributes']['length']?_0x3331ec['attributes']:_0x48ccc9[_0x5f73('0x32')];_0x3331ec[_0x5f73('0x37')]=qs[_0x5f73('0x38')](_0x5b08a7[_0x5f73('0x2e')][_0x5f73('0x38')]);_0x3331ec[_0x5f73('0x39')]=qs[_0x5f73('0x30')](_['pick'](_0x5b08a7['query'],_0x48ccc9[_0x5f73('0x30')]));if(_0x5b08a7[_0x5f73('0x2e')][_0x5f73('0x48')]){_0x3331ec[_0x5f73('0x39')]=_['merge'](_0x3331ec[_0x5f73('0x39')],{'$or':_[_0x5f73('0x29')](_0x3331ec['attributes'],function(_0x389632){var _0x55b150={};_0x55b150[_0x389632]={'$like':'%'+_0x5b08a7[_0x5f73('0x2e')][_0x5f73('0x48')]+'%'};return _0x55b150;})});}_0x3331ec=_[_0x5f73('0x3b')]({},_0x3331ec,_0x5b08a7[_0x5f73('0x41')]);return _0x2c629d[_0x5f73('0x46')](_0x3331ec);}})['then'](function(_0x538ccd){if(_0x538ccd){_0x3a8b22=_0x538ccd[_0x5f73('0x35')];if(!_0x5b08a7['query'][_0x5f73('0x49')](_0x5f73('0x36'))){_0x3331ec[_0x5f73('0x1f')]=qs[_0x5f73('0x1f')](_0x5b08a7[_0x5f73('0x2e')][_0x5f73('0x1f')]);_0x3331ec['offset']=qs[_0x5f73('0x1d')](_0x5b08a7[_0x5f73('0x2e')]['offset']);}return _0x2c629d['getConfigurations'](_0x3331ec);}})[_0x5f73('0x23')](function(_0x59c229){if(_0x59c229){return _0x59c229?{'count':_0x3a8b22,'rows':_0x59c229}:null;}})[_0x5f73('0x23')](respondWithResult(_0x4a9138,null))[_0x5f73('0x3f')](handleError(_0x4a9138,null));};exports['addConfiguration']=function(_0x507e96,_0xc60a58,_0x30fa78){if(_0x507e96['body']['id']){delete _0x507e96['body']['id'];}return db[_0x5f73('0x2a')][_0x5f73('0x47')]({'where':{'id':_0x507e96[_0x5f73('0x45')]['id']}})['then'](handleEntityNotFound(_0xc60a58,null))[_0x5f73('0x23')](function(_0x32be7d){if(_0x32be7d){_0x507e96[_0x5f73('0x44')][_0x5f73('0x4a')]=_0x32be7d['id'];_0x507e96['body'][_0x5f73('0x4b')]=integrations[_0x5f73('0x4c')](_0x507e96[_0x5f73('0x44')]['channel'],_0x507e96['body']['type']);_0x507e96['body']['Descriptions']=integrations[_0x5f73('0x4d')](_0x507e96[_0x5f73('0x44')][_0x5f73('0x4e')],_0x507e96[_0x5f73('0x44')][_0x5f73('0x2c')]);return db['DeskConfiguration'][_0x5f73('0x43')](_0x507e96['body'],{'include':[{'model':db['DeskField'],'as':_0x5f73('0x4b')},{'model':db[_0x5f73('0x4f')],'as':_0x5f73('0x50')}]});}return null;})[_0x5f73('0x23')](respondWithResult(_0xc60a58,null))[_0x5f73('0x3f')](handleError(_0xc60a58,null));};exports[_0x5f73('0x51')]=function(_0x127e0e,_0x4c3d85,_0x2b9e40){var _0x5d4e5e=[{'name':_0x5f73('0x52'),'label':_0x5f73('0x52'),'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 _0x16031b='';return db[_0x5f73('0x2a')]['findOne']({'where':{'id':_0x127e0e[_0x5f73('0x45')]['id']},'attributes':['id',_0x5f73('0x53'),'authType','username','password',_0x5f73('0x54'),_0x5f73('0x55'),'token','tokenSecret']})[_0x5f73('0x23')](handleEntityNotFound(_0x4c3d85,null))['then'](function(_0x921fdb){if(_0x921fdb){_0x16031b=_0x921fdb['remoteUri'];var _0x44e73a=_0x16031b[_0x5f73('0x56')](-0x1);if(_0x44e73a==='/'){_0x16031b=_0x16031b[_0x5f73('0x57')](0x0,_0x16031b[_0x5f73('0x58')](_0x44e73a));}var _0x1a22de={'method':_0x5f73('0x59'),'uri':util[_0x5f73('0x5a')](_0x5f73('0x5b'),_0x16031b),'headers':{'Content-Type':_0x5f73('0x5c'),'Accept':'application/json'},'json':!![]};if(_0x921fdb[_0x5f73('0x5d')]==='basic'){_0x1a22de[_0x5f73('0x5e')]['Authorization']=util['format']('Basic\x20%s',new Buffer(util[_0x5f73('0x5a')](_0x5f73('0x5f'),_0x921fdb[_0x5f73('0x60')],_0x921fdb['password']))['toString'](_0x5f73('0x61')));}return rp(_0x1a22de)[_0x5f73('0x23')](function(_0x4d0282){return _0x5d4e5e[_0x5f73('0x62')](_[_0x5f73('0x29')](_0x4d0282['_embedded'][_0x5f73('0x63')],function(_0x44c66f){return{'id':_0x44c66f[_0x5f73('0x27')],'name':_0x44c66f[_0x5f73('0x27')],'type':_0x44c66f['type'],'active':_0x44c66f[_0x5f73('0x64')],'label':_0x44c66f[_0x5f73('0x65')],'custom':!![]};}));});}})[_0x5f73('0x23')](function(_0x3f6b00){return{'count':_0x3f6b00['length'],'rows':_0x3f6b00};})['then'](respondWithResult(_0x4c3d85,null))[_0x5f73('0x3f')](function(_0x22e0a4){var _0x15e9cb=_0x127e0e[_0x5f73('0x2e')][_0x5f73('0x66')]?0x1f4:_0x22e0a4[_0x5f73('0x67')]||0x1f4;logger[_0x5f73('0x25')](_0x5f73('0x68'),_0x5f73('0x51'),_0x15e9cb,JSON[_0x5f73('0x69')](_0x22e0a4));delete _0x22e0a4[_0x5f73('0x27')];if(_0x15e9cb===0x191){_0x15e9cb=0x190;}_0x4c3d85[_0x5f73('0x19')](_0x15e9cb)['send'](_0x127e0e[_0x5f73('0x2e')]['test']?{'message':_0x5f73('0x6a'),'statusCode':_0x22e0a4[_0x5f73('0x67')]}:_0x22e0a4);});}; \ No newline at end of file +var _0x199d=['slice','substring','%s/custom_fields','application/json','basic','headers','Authorization','format','toString','base64','concat','_embedded','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','offset','status','set','apply','destroy','then','error','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','create','update','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','authType','username','password','token','tokenSecret','remoteUri'];(function(_0x17e5ac,_0x502081){var _0x30a779=function(_0x433710){while(--_0x433710){_0x17e5ac['push'](_0x17e5ac['shift']());}};_0x30a779(++_0x502081);}(_0x199d,0x160));var _0xd199=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0x199d[_0x2431d6];return _0x4d0f9b;};'use strict';var emlformat=require(_0xd199('0x0'));var rimraf=require(_0xd199('0x1'));var zipdir=require(_0xd199('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd199('0x3'));var BPromise=require(_0xd199('0x4'));var Mustache=require('mustache');var util=require(_0xd199('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xd199('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd199('0x7'));var _=require(_0xd199('0x8'));var squel=require(_0xd199('0x9'));var crypto=require(_0xd199('0xa'));var jsforce=require(_0xd199('0xb'));var deskjs=require(_0xd199('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd199('0xd'));var Papa=require('papaparse');var Redis=require(_0xd199('0xe'));var authService=require(_0xd199('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd199('0x10'));var hardwareService=require(_0xd199('0x11'));var logger=require(_0xd199('0x12'))(_0xd199('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd199('0x14'));var db=require(_0xd199('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2288e4,_0x1dacc5){_0x1dacc5=_0x1dacc5||0xcc;return function(_0x4a05c2){if(_0x4a05c2){return _0x2288e4[_0xd199('0x16')](_0x1dacc5);}return _0x2288e4['status'](_0x1dacc5)[_0xd199('0x17')]();};}function respondWithResult(_0x268425,_0x454040){_0x454040=_0x454040||0xc8;return function(_0x4ee1b8){if(_0x4ee1b8){return _0x268425['status'](_0x454040)[_0xd199('0x18')](_0x4ee1b8);}};}function respondWithFilteredResult(_0x54b80c,_0x34af96){return function(_0x26f673){if(_0x26f673){var _0x5b2518=typeof _0x34af96['offset']==='undefined'&&typeof _0x34af96[_0xd199('0x19')]===_0xd199('0x1a');var _0x52e037=_0x26f673['count'];var _0x54b763=_0x5b2518?0x0:_0x34af96[_0xd199('0x1b')];var _0x2a85b4=_0x5b2518?_0x26f673['count']:_0x34af96['offset']+_0x34af96[_0xd199('0x19')];var _0x597bde;if(_0x2a85b4>=_0x52e037){_0x2a85b4=_0x52e037;_0x597bde=0xc8;}else{_0x597bde=0xce;}_0x54b80c[_0xd199('0x1c')](_0x597bde);return _0x54b80c[_0xd199('0x1d')]('Content-Range',_0x54b763+'-'+_0x2a85b4+'/'+_0x52e037)['json'](_0x26f673);}return null;};}function patchUpdates(_0x414b05){return function(_0xb60e62){try{jsonpatch[_0xd199('0x1e')](_0xb60e62,_0x414b05,!![]);}catch(_0x15cf11){return BPromise['reject'](_0x15cf11);}return _0xb60e62['save']();};}function saveUpdates(_0x4afc7f,_0x4fbf11){return function(_0x43b7f1){if(_0x43b7f1){return _0x43b7f1['update'](_0x4afc7f)['then'](function(_0x50f8b6){return _0x50f8b6;});}return null;};}function removeEntity(_0x1524ea,_0x23a4e7){return function(_0xeccc4f){if(_0xeccc4f){return _0xeccc4f[_0xd199('0x1f')]()[_0xd199('0x20')](function(){_0x1524ea[_0xd199('0x1c')](0xcc)[_0xd199('0x17')]();});}};}function handleEntityNotFound(_0x467006,_0xea898f){return function(_0x1c5297){if(!_0x1c5297){_0x467006['sendStatus'](0x194);}return _0x1c5297;};}function handleError(_0x18e2dc,_0x332f6a){_0x332f6a=_0x332f6a||0x1f4;return function(_0x221ea8){logger[_0xd199('0x21')](_0x221ea8[_0xd199('0x22')]);if(_0x221ea8[_0xd199('0x23')]){delete _0x221ea8[_0xd199('0x23')];}_0x18e2dc[_0xd199('0x1c')](_0x332f6a)[_0xd199('0x24')](_0x221ea8);};}exports[_0xd199('0x25')]=function(_0x104018,_0x569bf4){var _0x31966b={},_0x128282={},_0x38b87d={'count':0x0,'rows':[]};var _0x166280=_[_0xd199('0x26')](db[_0xd199('0x27')][_0xd199('0x28')],function(_0x275661){return{'name':_0x275661[_0xd199('0x29')],'type':_0x275661[_0xd199('0x2a')][_0xd199('0x2b')]};});_0x128282[_0xd199('0x2c')]=_[_0xd199('0x26')](_0x166280,'name');_0x128282[_0xd199('0x2d')]=_['keys'](_0x104018[_0xd199('0x2d')]);_0x128282[_0xd199('0x2e')]=_['intersection'](_0x128282['model'],_0x128282[_0xd199('0x2d')]);_0x31966b[_0xd199('0x2f')]=_['intersection'](_0x128282['model'],qs[_0xd199('0x30')](_0x104018['query'][_0xd199('0x30')]));_0x31966b[_0xd199('0x2f')]=_0x31966b[_0xd199('0x2f')][_0xd199('0x31')]?_0x31966b[_0xd199('0x2f')]:_0x128282['model'];if(!_0x104018[_0xd199('0x2d')][_0xd199('0x32')](_0xd199('0x33'))){_0x31966b[_0xd199('0x19')]=qs[_0xd199('0x19')](_0x104018[_0xd199('0x2d')][_0xd199('0x19')]);_0x31966b[_0xd199('0x1b')]=qs[_0xd199('0x1b')](_0x104018['query'][_0xd199('0x1b')]);}_0x31966b[_0xd199('0x34')]=qs[_0xd199('0x35')](_0x104018[_0xd199('0x2d')][_0xd199('0x35')]);_0x31966b[_0xd199('0x36')]=qs['filters'](_['pick'](_0x104018[_0xd199('0x2d')],_0x128282['filters']),_0x166280);if(_0x104018[_0xd199('0x2d')][_0xd199('0x37')]){_0x31966b['where']=_['merge'](_0x31966b[_0xd199('0x36')],{'$or':_['map'](_0x166280,function(_0x16cb63){if(_0x16cb63[_0xd199('0x2a')]!==_0xd199('0x38')){var _0x1958e3={};_0x1958e3[_0x16cb63['name']]={'$like':'%'+_0x104018[_0xd199('0x2d')][_0xd199('0x37')]+'%'};return _0x1958e3;}})});}_0x31966b=_[_0xd199('0x39')]({},_0x31966b,_0x104018[_0xd199('0x3a')]);var _0x70bc6b={'where':_0x31966b[_0xd199('0x36')]};return db['DeskAccount'][_0xd199('0x3b')](_0x70bc6b)[_0xd199('0x20')](function(_0x53cbad){_0x38b87d[_0xd199('0x3b')]=_0x53cbad;if(_0x104018[_0xd199('0x2d')][_0xd199('0x3c')]){_0x31966b[_0xd199('0x3d')]=[{'all':!![]}];}return db[_0xd199('0x27')][_0xd199('0x3e')](_0x31966b);})[_0xd199('0x20')](function(_0x512994){_0x38b87d[_0xd199('0x3f')]=_0x512994;return _0x38b87d;})[_0xd199('0x20')](respondWithFilteredResult(_0x569bf4,_0x31966b))[_0xd199('0x40')](handleError(_0x569bf4,null));};exports[_0xd199('0x41')]=function(_0x456f58,_0x2f3cac){var _0x587177={'raw':![],'where':{'id':_0x456f58[_0xd199('0x42')]['id']}},_0x36a6ee={};_0x36a6ee[_0xd199('0x2c')]=_[_0xd199('0x43')](db['DeskAccount'][_0xd199('0x28')]);_0x36a6ee['query']=_[_0xd199('0x43')](_0x456f58['query']);_0x36a6ee[_0xd199('0x2e')]=_['intersection'](_0x36a6ee[_0xd199('0x2c')],_0x36a6ee[_0xd199('0x2d')]);_0x587177['attributes']=_[_0xd199('0x44')](_0x36a6ee[_0xd199('0x2c')],qs[_0xd199('0x30')](_0x456f58[_0xd199('0x2d')]['fields']));_0x587177[_0xd199('0x2f')]=_0x587177[_0xd199('0x2f')][_0xd199('0x31')]?_0x587177[_0xd199('0x2f')]:_0x36a6ee[_0xd199('0x2c')];if(_0x456f58['query'][_0xd199('0x3c')]){_0x587177[_0xd199('0x3d')]=[{'all':!![]}];}_0x587177=_[_0xd199('0x39')]({},_0x587177,_0x456f58['options']);return db[_0xd199('0x27')][_0xd199('0x45')](_0x587177)['then'](handleEntityNotFound(_0x2f3cac,null))['then'](respondWithResult(_0x2f3cac,null))[_0xd199('0x40')](handleError(_0x2f3cac,null));};exports[_0xd199('0x46')]=function(_0x51979c,_0x416619){return db['DeskAccount'][_0xd199('0x46')](_0x51979c['body'],{})[_0xd199('0x20')](respondWithResult(_0x416619,0xc9))[_0xd199('0x40')](handleError(_0x416619,null));};exports[_0xd199('0x47')]=function(_0x3a668a,_0x4b201d){if(_0x3a668a[_0xd199('0x48')]['id']){delete _0x3a668a[_0xd199('0x48')]['id'];}return db['DeskAccount']['find']({'where':{'id':_0x3a668a[_0xd199('0x42')]['id']}})[_0xd199('0x20')](handleEntityNotFound(_0x4b201d,null))['then'](saveUpdates(_0x3a668a[_0xd199('0x48')],null))['then'](respondWithResult(_0x4b201d,null))['catch'](handleError(_0x4b201d,null));};exports[_0xd199('0x1f')]=function(_0x139928,_0x42a81a){return db[_0xd199('0x27')][_0xd199('0x45')]({'where':{'id':_0x139928[_0xd199('0x42')]['id']}})[_0xd199('0x20')](handleEntityNotFound(_0x42a81a,null))[_0xd199('0x20')](removeEntity(_0x42a81a,null))[_0xd199('0x40')](handleError(_0x42a81a,null));};exports[_0xd199('0x49')]=function(_0x20205d,_0x320ba6,_0x1f3cb8){var _0x37ced0={};var _0x39c3fd={};var _0x203488;var _0x25b47e;return db['DeskAccount'][_0xd199('0x4a')]({'where':{'id':_0x20205d[_0xd199('0x42')]['id']}})['then'](handleEntityNotFound(_0x320ba6,null))[_0xd199('0x20')](function(_0x350023){if(_0x350023){_0x203488=_0x350023;_0x39c3fd[_0xd199('0x2c')]=_[_0xd199('0x43')](db[_0xd199('0x4b')][_0xd199('0x28')]);_0x39c3fd[_0xd199('0x2d')]=_['keys'](_0x20205d[_0xd199('0x2d')]);_0x39c3fd['filters']=_['intersection'](_0x39c3fd[_0xd199('0x2c')],_0x39c3fd[_0xd199('0x2d')]);_0x37ced0[_0xd199('0x2f')]=_[_0xd199('0x44')](_0x39c3fd[_0xd199('0x2c')],qs[_0xd199('0x30')](_0x20205d[_0xd199('0x2d')][_0xd199('0x30')]));_0x37ced0['attributes']=_0x37ced0[_0xd199('0x2f')][_0xd199('0x31')]?_0x37ced0[_0xd199('0x2f')]:_0x39c3fd[_0xd199('0x2c')];_0x37ced0['order']=qs[_0xd199('0x35')](_0x20205d[_0xd199('0x2d')][_0xd199('0x35')]);_0x37ced0[_0xd199('0x36')]=qs[_0xd199('0x2e')](_['pick'](_0x20205d['query'],_0x39c3fd['filters']));if(_0x20205d['query']['filter']){_0x37ced0[_0xd199('0x36')]=_[_0xd199('0x39')](_0x37ced0[_0xd199('0x36')],{'$or':_[_0xd199('0x26')](_0x37ced0[_0xd199('0x2f')],function(_0x57d88f){var _0x15e690={};_0x15e690[_0x57d88f]={'$like':'%'+_0x20205d['query']['filter']+'%'};return _0x15e690;})});}_0x37ced0=_[_0xd199('0x39')]({},_0x37ced0,_0x20205d[_0xd199('0x3a')]);return _0x203488[_0xd199('0x49')](_0x37ced0);}})[_0xd199('0x20')](function(_0x5acf43){if(_0x5acf43){_0x25b47e=_0x5acf43[_0xd199('0x31')];if(!_0x20205d[_0xd199('0x2d')][_0xd199('0x32')](_0xd199('0x33'))){_0x37ced0[_0xd199('0x19')]=qs[_0xd199('0x19')](_0x20205d['query']['limit']);_0x37ced0[_0xd199('0x1b')]=qs[_0xd199('0x1b')](_0x20205d['query'][_0xd199('0x1b')]);}return _0x203488['getConfigurations'](_0x37ced0);}})[_0xd199('0x20')](function(_0x4cf286){if(_0x4cf286){return _0x4cf286?{'count':_0x25b47e,'rows':_0x4cf286}:null;}})[_0xd199('0x20')](respondWithResult(_0x320ba6,null))['catch'](handleError(_0x320ba6,null));};exports[_0xd199('0x4c')]=function(_0x508410,_0x27eaf0,_0x2fd838){if(_0x508410[_0xd199('0x48')]['id']){delete _0x508410[_0xd199('0x48')]['id'];}return db[_0xd199('0x27')][_0xd199('0x4a')]({'where':{'id':_0x508410[_0xd199('0x42')]['id']}})[_0xd199('0x20')](handleEntityNotFound(_0x27eaf0,null))[_0xd199('0x20')](function(_0x5c2756){if(_0x5c2756){_0x508410['body'][_0xd199('0x4d')]=_0x5c2756['id'];_0x508410[_0xd199('0x48')][_0xd199('0x4e')]=integrations[_0xd199('0x4f')](_0x508410[_0xd199('0x48')][_0xd199('0x50')],_0x508410[_0xd199('0x48')][_0xd199('0x2a')]);_0x508410['body'][_0xd199('0x51')]=integrations[_0xd199('0x52')](_0x508410[_0xd199('0x48')][_0xd199('0x50')],_0x508410['body'][_0xd199('0x2a')]);return db['DeskConfiguration'][_0xd199('0x46')](_0x508410[_0xd199('0x48')],{'include':[{'model':db[_0xd199('0x53')],'as':_0xd199('0x4e')},{'model':db[_0xd199('0x53')],'as':_0xd199('0x51')}]});}return null;})[_0xd199('0x20')](respondWithResult(_0x27eaf0,null))['catch'](handleError(_0x27eaf0,null));};exports[_0xd199('0x54')]=function(_0x28e914,_0xcda67d,_0x46e6f7){var _0x1771af=[{'name':_0xd199('0x55'),'label':_0xd199('0x55'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x332f6d='';return db[_0xd199('0x27')]['findOne']({'where':{'id':_0x28e914[_0xd199('0x42')]['id']},'attributes':['id','remoteUri',_0xd199('0x56'),_0xd199('0x57'),_0xd199('0x58'),'consumerKey','consumerSecret',_0xd199('0x59'),_0xd199('0x5a')]})[_0xd199('0x20')](handleEntityNotFound(_0xcda67d,null))[_0xd199('0x20')](function(_0x1027ef){if(_0x1027ef){_0x332f6d=_0x1027ef[_0xd199('0x5b')];var _0x22bd9f=_0x332f6d[_0xd199('0x5c')](-0x1);if(_0x22bd9f==='/'){_0x332f6d=_0x332f6d[_0xd199('0x5d')](0x0,_0x332f6d['lastIndexOf'](_0x22bd9f));}var _0x19a06d={'method':'GET','uri':util['format'](_0xd199('0x5e'),_0x332f6d),'headers':{'Content-Type':_0xd199('0x5f'),'Accept':_0xd199('0x5f')},'json':!![]};if(_0x1027ef['authType']===_0xd199('0x60')){_0x19a06d[_0xd199('0x61')][_0xd199('0x62')]=util[_0xd199('0x63')]('Basic\x20%s',new Buffer(util[_0xd199('0x63')]('%s:%s',_0x1027ef[_0xd199('0x57')],_0x1027ef[_0xd199('0x58')]))[_0xd199('0x64')](_0xd199('0x65')));}return rp(_0x19a06d)[_0xd199('0x20')](function(_0x1d0309){return _0x1771af[_0xd199('0x66')](_['map'](_0x1d0309[_0xd199('0x67')]['entries'],function(_0x3762e1){return{'id':_0x3762e1[_0xd199('0x23')],'name':_0x3762e1[_0xd199('0x23')],'type':_0x3762e1[_0xd199('0x2a')],'active':_0x3762e1[_0xd199('0x68')],'label':_0x3762e1[_0xd199('0x69')],'custom':!![]};}));});}})['then'](function(_0x2b904e){return{'count':_0x2b904e[_0xd199('0x31')],'rows':_0x2b904e};})[_0xd199('0x20')](respondWithResult(_0xcda67d,null))[_0xd199('0x40')](function(_0x29ae6d){var _0xb13b02=_0x28e914['query']['test']?0x1f4:_0x29ae6d[_0xd199('0x6a')]||0x1f4;logger[_0xd199('0x21')](_0xd199('0x6b'),'getFields',_0xb13b02,JSON[_0xd199('0x6c')](_0x29ae6d));delete _0x29ae6d[_0xd199('0x23')];if(_0xb13b02===0x191){_0xb13b02=0x190;}_0xcda67d[_0xd199('0x1c')](_0xb13b02)['send'](_0x28e914[_0xd199('0x2d')][_0xd199('0x6d')]?{'message':_0xd199('0x6e'),'statusCode':_0x29ae6d[_0xd199('0x6a')]}:_0x29ae6d);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 49ceecc..cb63907 100644 --- a/server/api/intDeskAccount/intDeskAccount.model.js +++ b/server/api/intDeskAccount/intDeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d8e=['int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount'];(function(_0xa1947d,_0xeb1015){var _0xccc41a=function(_0x976139){while(--_0x976139){_0xa1947d['push'](_0xa1947d['shift']());}};_0xccc41a(++_0xeb1015);}(_0x7d8e,0x6a));var _0xe7d8=function(_0x2c534a,_0x18a19e){_0x2c534a=_0x2c534a-0x0;var _0x3f5c99=_0x7d8e[_0x2c534a];return _0x3f5c99;};'use strict';var _=require(_0xe7d8('0x0'));var util=require(_0xe7d8('0x1'));var logger=require(_0xe7d8('0x2'))(_0xe7d8('0x3'));var moment=require(_0xe7d8('0x4'));var BPromise=require(_0xe7d8('0x5'));var rp=require(_0xe7d8('0x6'));var fs=require('fs');var path=require(_0xe7d8('0x7'));var rimraf=require(_0xe7d8('0x8'));var config=require(_0xe7d8('0x9'));var attributes=require(_0xe7d8('0xa'));var integrations=require(_0xe7d8('0xb'));module[_0xe7d8('0xc')]=function(_0x17ee44,_0x13ed17){return _0x17ee44['define'](_0xe7d8('0xd'),attributes,{'tableName':_0xe7d8('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde2f=['../../components/integrations/configuration','exports','define','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./intDeskAccount.attributes'];(function(_0x114be8,_0x323182){var _0x89020c=function(_0x30a38a){while(--_0x30a38a){_0x114be8['push'](_0x114be8['shift']());}};_0x89020c(++_0x323182);}(_0xde2f,0x92));var _0xfde2=function(_0x1c31dc,_0x2a8ca8){_0x1c31dc=_0x1c31dc-0x0;var _0x14c76e=_0xde2f[_0x1c31dc];return _0x14c76e;};'use strict';var _=require(_0xfde2('0x0'));var util=require(_0xfde2('0x1'));var logger=require('../../config/logger')(_0xfde2('0x2'));var moment=require(_0xfde2('0x3'));var BPromise=require('bluebird');var rp=require(_0xfde2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfde2('0x5'));var config=require(_0xfde2('0x6'));var attributes=require(_0xfde2('0x7'));var integrations=require(_0xfde2('0x8'));module[_0xfde2('0x9')]=function(_0x3ec0b8,_0x4ebd66){return _0x3ec0b8[_0xfde2('0xa')]('DeskAccount',attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 2e60813..e78d80b 100644 --- a/server/api/intDeskAccount/intDeskAccount.rpc.js +++ b/server/api/intDeskAccount/intDeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1002=['then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','DeskAccount','findAll','options','where','attributes','include','map','model','GetDeskAccount','stringify','ShowDeskAccount','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request'];(function(_0x3f9f8d,_0x499006){var _0xbe5c62=function(_0x3cf180){while(--_0x3cf180){_0x3f9f8d['push'](_0x3f9f8d['shift']());}};_0xbe5c62(++_0x499006);}(_0x1002,0x8d));var _0x2100=function(_0x41bbd0,_0x296de6){_0x41bbd0=_0x41bbd0-0x0;var _0x519942=_0x1002[_0x41bbd0];return _0x519942;};'use strict';var _=require(_0x2100('0x0'));var util=require('util');var moment=require(_0x2100('0x1'));var BPromise=require('bluebird');var rs=require(_0x2100('0x2'));var fs=require('fs');var Redis=require(_0x2100('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2100('0x4'));var logger=require(_0x2100('0x5'))(_0x2100('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2100('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d2ae1,_0x119941,_0x5e7290){return new BPromise(function(_0x1cef7a,_0x4da309){return client[_0x2100('0x8')](_0x2d2ae1,_0x5e7290)[_0x2100('0x9')](function(_0x3e5ce6){logger[_0x2100('0xa')](_0x2100('0xb'),_0x119941,_0x2100('0xc'));logger[_0x2100('0xd')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x119941,_0x2100('0xc'),JSON['stringify'](_0x3e5ce6));if(_0x3e5ce6[_0x2100('0xe')]){if(_0x3e5ce6['error'][_0x2100('0xf')]===0x1f4){logger[_0x2100('0xe')](_0x2100('0xb'),_0x119941,_0x3e5ce6['error']['message']);return _0x4da309(_0x3e5ce6[_0x2100('0xe')][_0x2100('0x10')]);}logger[_0x2100('0xe')](_0x2100('0xb'),_0x119941,_0x3e5ce6['error'][_0x2100('0x10')]);return _0x1cef7a(_0x3e5ce6[_0x2100('0xe')][_0x2100('0x10')]);}else{logger[_0x2100('0xa')]('DeskAccount,\x20%s,\x20%s',_0x119941,_0x2100('0xc'));_0x1cef7a(_0x3e5ce6[_0x2100('0x11')][_0x2100('0x10')]);}})[_0x2100('0x12')](function(_0x4365c4){logger[_0x2100('0xe')](_0x2100('0xb'),_0x119941,_0x4365c4);_0x4da309(_0x4365c4);});});}exports['GetDeskAccount']=function(_0x2a185a){var _0x2f3004=this;return new Promise(function(_0x16125f,_0x2713b1){return db[_0x2100('0x13')][_0x2100('0x14')]({'raw':_0x2a185a[_0x2100('0x15')]?_0x2a185a['options']['raw']===undefined?!![]:![]:!![],'where':_0x2a185a[_0x2100('0x15')]?_0x2a185a['options'][_0x2100('0x16')]||null:null,'attributes':_0x2a185a[_0x2100('0x15')]?_0x2a185a[_0x2100('0x15')][_0x2100('0x17')]||null:null,'limit':_0x2a185a[_0x2100('0x15')]?_0x2a185a[_0x2100('0x15')]['limit']||null:null,'include':_0x2a185a[_0x2100('0x15')]?_0x2a185a[_0x2100('0x15')][_0x2100('0x18')]?_[_0x2100('0x19')](_0x2a185a[_0x2100('0x15')][_0x2100('0x18')],function(_0x20b6d1){return{'model':db[_0x20b6d1[_0x2100('0x1a')]],'as':_0x20b6d1['as'],'attributes':_0x20b6d1[_0x2100('0x17')],'include':_0x20b6d1[_0x2100('0x18')]?_[_0x2100('0x19')](_0x20b6d1[_0x2100('0x18')],function(_0x4bdd44){return{'model':db[_0x4bdd44[_0x2100('0x1a')]],'as':_0x4bdd44['as'],'attributes':_0x4bdd44[_0x2100('0x17')],'include':_0x4bdd44[_0x2100('0x18')]?_[_0x2100('0x19')](_0x4bdd44[_0x2100('0x18')],function(_0x1d960f){return{'model':db[_0x1d960f[_0x2100('0x1a')]],'as':_0x1d960f['as'],'attributes':_0x1d960f[_0x2100('0x17')]};}):[]};}):[]};}):[]:[]})[_0x2100('0x9')](function(_0x1db496){logger[_0x2100('0xa')](_0x2100('0x1b'),_0x2a185a);logger['debug'](_0x2100('0x1b'),_0x2a185a,JSON[_0x2100('0x1c')](_0x1db496));_0x16125f(_0x1db496);})[_0x2100('0x12')](function(_0x4576e2){logger['error'](_0x2100('0x1b'),_0x4576e2[_0x2100('0x10')],_0x2a185a);_0x2713b1(_0x2f3004[_0x2100('0xe')](0x1f4,_0x4576e2[_0x2100('0x10')]));});});};exports[_0x2100('0x1d')]=function(_0x17e27e){var _0x1885e7=this;return new Promise(function(_0x3eb9a2,_0x26bbdd){return db[_0x2100('0x13')]['find']({'raw':_0x17e27e['options']?_0x17e27e[_0x2100('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x17e27e[_0x2100('0x15')]?_0x17e27e[_0x2100('0x15')]['where']||null:null,'attributes':_0x17e27e[_0x2100('0x15')]?_0x17e27e['options'][_0x2100('0x17')]||null:null,'include':_0x17e27e[_0x2100('0x15')]?_0x17e27e[_0x2100('0x15')][_0x2100('0x18')]?_[_0x2100('0x19')](_0x17e27e[_0x2100('0x15')][_0x2100('0x18')],function(_0x10a32e){return{'model':db[_0x10a32e[_0x2100('0x1a')]],'as':_0x10a32e['as'],'attributes':_0x10a32e[_0x2100('0x17')],'include':_0x10a32e[_0x2100('0x18')]?_[_0x2100('0x19')](_0x10a32e[_0x2100('0x18')],function(_0x477c57){return{'model':db[_0x477c57['model']],'as':_0x477c57['as'],'attributes':_0x477c57[_0x2100('0x17')],'include':_0x477c57['include']?_[_0x2100('0x19')](_0x477c57[_0x2100('0x18')],function(_0x3713e5){return{'model':db[_0x3713e5[_0x2100('0x1a')]],'as':_0x3713e5['as'],'attributes':_0x3713e5[_0x2100('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4570a8){logger[_0x2100('0xa')](_0x2100('0x1d'),_0x17e27e);logger[_0x2100('0xd')](_0x2100('0x1d'),_0x17e27e,JSON[_0x2100('0x1c')](_0x4570a8));_0x3eb9a2(_0x4570a8);})[_0x2100('0x12')](function(_0x54e2d4){logger[_0x2100('0xe')](_0x2100('0x1d'),_0x54e2d4[_0x2100('0x10')],_0x17e27e);_0x26bbdd(_0x1885e7[_0x2100('0xe')](0x1f4,_0x54e2d4[_0x2100('0x10')]));});});}; \ No newline at end of file +var _0xe0fb=['options','raw','where','attributes','include','map','model','catch','find','ShowDeskAccount','stringify','lodash','util','moment','randomstring','ioredis','../../config/environment','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','GetDeskAccount','DeskAccount'];(function(_0x3b18cf,_0x3b2b9a){var _0x31c179=function(_0x57bcb2){while(--_0x57bcb2){_0x3b18cf['push'](_0x3b18cf['shift']());}};_0x31c179(++_0x3b2b9a);}(_0xe0fb,0x155));var _0xbe0f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe0fb[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xbe0f('0x0'));var util=require(_0xbe0f('0x1'));var moment=require(_0xbe0f('0x2'));var BPromise=require('bluebird');var rs=require(_0xbe0f('0x3'));var fs=require('fs');var Redis=require(_0xbe0f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbe0f('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbe0f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x36215d,_0x502634,_0x422b4a){return new BPromise(function(_0x13344a,_0x3d4bd8){return client[_0xbe0f('0x7')](_0x36215d,_0x422b4a)[_0xbe0f('0x8')](function(_0x53296e){logger['info'](_0xbe0f('0x9'),_0x502634,_0xbe0f('0xa'));logger[_0xbe0f('0xb')](_0xbe0f('0xc'),_0x502634,_0xbe0f('0xa'),JSON['stringify'](_0x53296e));if(_0x53296e[_0xbe0f('0xd')]){if(_0x53296e['error'][_0xbe0f('0xe')]===0x1f4){logger[_0xbe0f('0xd')](_0xbe0f('0x9'),_0x502634,_0x53296e[_0xbe0f('0xd')][_0xbe0f('0xf')]);return _0x3d4bd8(_0x53296e[_0xbe0f('0xd')][_0xbe0f('0xf')]);}logger[_0xbe0f('0xd')]('DeskAccount,\x20%s,\x20%s',_0x502634,_0x53296e[_0xbe0f('0xd')][_0xbe0f('0xf')]);return _0x13344a(_0x53296e[_0xbe0f('0xd')][_0xbe0f('0xf')]);}else{logger[_0xbe0f('0x10')](_0xbe0f('0x9'),_0x502634,_0xbe0f('0xa'));_0x13344a(_0x53296e['result'][_0xbe0f('0xf')]);}})['catch'](function(_0x33d806){logger[_0xbe0f('0xd')]('DeskAccount,\x20%s,\x20%s',_0x502634,_0x33d806);_0x3d4bd8(_0x33d806);});});}exports[_0xbe0f('0x11')]=function(_0x169995){var _0x1f721e=this;return new Promise(function(_0x34c09d,_0x5c40ea){return db[_0xbe0f('0x12')]['findAll']({'raw':_0x169995[_0xbe0f('0x13')]?_0x169995[_0xbe0f('0x13')][_0xbe0f('0x14')]===undefined?!![]:![]:!![],'where':_0x169995['options']?_0x169995[_0xbe0f('0x13')][_0xbe0f('0x15')]||null:null,'attributes':_0x169995['options']?_0x169995[_0xbe0f('0x13')][_0xbe0f('0x16')]||null:null,'limit':_0x169995[_0xbe0f('0x13')]?_0x169995['options']['limit']||null:null,'include':_0x169995[_0xbe0f('0x13')]?_0x169995[_0xbe0f('0x13')][_0xbe0f('0x17')]?_[_0xbe0f('0x18')](_0x169995[_0xbe0f('0x13')][_0xbe0f('0x17')],function(_0x218277){return{'model':db[_0x218277[_0xbe0f('0x19')]],'as':_0x218277['as'],'attributes':_0x218277[_0xbe0f('0x16')],'include':_0x218277[_0xbe0f('0x17')]?_[_0xbe0f('0x18')](_0x218277['include'],function(_0x11f437){return{'model':db[_0x11f437['model']],'as':_0x11f437['as'],'attributes':_0x11f437[_0xbe0f('0x16')],'include':_0x11f437[_0xbe0f('0x17')]?_[_0xbe0f('0x18')](_0x11f437[_0xbe0f('0x17')],function(_0x2a8776){return{'model':db[_0x2a8776[_0xbe0f('0x19')]],'as':_0x2a8776['as'],'attributes':_0x2a8776['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe0f('0x8')](function(_0x4299b7){logger['info']('GetDeskAccount',_0x169995);logger['debug'](_0xbe0f('0x11'),_0x169995,JSON['stringify'](_0x4299b7));_0x34c09d(_0x4299b7);})[_0xbe0f('0x1a')](function(_0x496f8d){logger['error']('GetDeskAccount',_0x496f8d[_0xbe0f('0xf')],_0x169995);_0x5c40ea(_0x1f721e[_0xbe0f('0xd')](0x1f4,_0x496f8d[_0xbe0f('0xf')]));});});};exports['ShowDeskAccount']=function(_0x43ee7d){var _0x1398f2=this;return new Promise(function(_0x3b76e4,_0x46b0c0){return db[_0xbe0f('0x12')][_0xbe0f('0x1b')]({'raw':_0x43ee7d[_0xbe0f('0x13')]?_0x43ee7d[_0xbe0f('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x43ee7d[_0xbe0f('0x13')]?_0x43ee7d['options']['where']||null:null,'attributes':_0x43ee7d[_0xbe0f('0x13')]?_0x43ee7d[_0xbe0f('0x13')][_0xbe0f('0x16')]||null:null,'include':_0x43ee7d[_0xbe0f('0x13')]?_0x43ee7d[_0xbe0f('0x13')][_0xbe0f('0x17')]?_[_0xbe0f('0x18')](_0x43ee7d[_0xbe0f('0x13')][_0xbe0f('0x17')],function(_0x328d7c){return{'model':db[_0x328d7c[_0xbe0f('0x19')]],'as':_0x328d7c['as'],'attributes':_0x328d7c[_0xbe0f('0x16')],'include':_0x328d7c[_0xbe0f('0x17')]?_[_0xbe0f('0x18')](_0x328d7c['include'],function(_0x160680){return{'model':db[_0x160680[_0xbe0f('0x19')]],'as':_0x160680['as'],'attributes':_0x160680[_0xbe0f('0x16')],'include':_0x160680[_0xbe0f('0x17')]?_[_0xbe0f('0x18')](_0x160680[_0xbe0f('0x17')],function(_0x54a76d){return{'model':db[_0x54a76d[_0xbe0f('0x19')]],'as':_0x54a76d['as'],'attributes':_0x54a76d[_0xbe0f('0x16')]};}):[]};}):[]};}):[]:[]})[_0xbe0f('0x8')](function(_0x45301f){logger[_0xbe0f('0x10')](_0xbe0f('0x1c'),_0x43ee7d);logger[_0xbe0f('0xb')](_0xbe0f('0x1c'),_0x43ee7d,JSON[_0xbe0f('0x1d')](_0x45301f));_0x3b76e4(_0x45301f);})[_0xbe0f('0x1a')](function(_0x44a770){logger[_0xbe0f('0xd')](_0xbe0f('0x1c'),_0x44a770[_0xbe0f('0xf')],_0x43ee7d);_0x46b0c0(_0x1398f2[_0xbe0f('0xd')](0x1f4,_0x44a770['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index c3e1ba9..e4d793b 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x120529,_0x258749){var _0x35748d=function(_0x1c58d7){while(--_0x1c58d7){_0x120529['push'](_0x120529['shift']());}};_0x35748d(++_0x258749);}(_0x008c,0x188));var _0xc008=function(_0xee741b,_0x10cf16){_0xee741b=_0xee741b-0x0;var _0x9ce0a2=_0x008c[_0xee741b];return _0x9ce0a2;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x3725ee,_0x543bd9){var _0x399c71=function(_0xaf9400){while(--_0xaf9400){_0x3725ee['push'](_0x3725ee['shift']());}};_0x399c71(++_0x543bd9);}(_0x55ca,0x126));var _0xa55c=function(_0x2ae2bc,_0x177514){_0x2ae2bc=_0x2ae2bc-0x0;var _0x53c290=_0x55ca[_0x2ae2bc];return _0x53c290;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 9cad87c..ce5da19 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x23d2=['exports','STRING','sequelize'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x23d2,0x137));var _0x223d=function(_0x18c2ed,_0x116ba1){_0x18c2ed=_0x18c2ed-0x0;var _0x2621fb=_0x23d2[_0x18c2ed];return _0x2621fb;};'use strict';var Sequelize=require(_0x223d('0x0'));module[_0x223d('0x1')]={'name':{'type':Sequelize[_0x223d('0x2')]},'description':{'type':Sequelize[_0x223d('0x2')]}}; \ No newline at end of file +var _0x0a68=['sequelize','exports','STRING'];(function(_0x11e000,_0x12a8e5){var _0x110c27=function(_0x10d468){while(--_0x10d468){_0x11e000['push'](_0x11e000['shift']());}};_0x110c27(++_0x12a8e5);}(_0x0a68,0xba));var _0x80a6=function(_0x5a2b24,_0x21aeb2){_0x5a2b24=_0x5a2b24-0x0;var _0x200841=_0x0a68[_0x5a2b24];return _0x200841;};'use strict';var Sequelize=require(_0x80a6('0x0'));module[_0x80a6('0x1')]={'name':{'type':Sequelize[_0x80a6('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index b47102f..60de5e3 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9afa=['request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','length','includeAll','options','find','catch','create','body','params','findOne','DeskField','getFields','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x59f4e3,_0x48650b){var _0x2756e2=function(_0x10a7c4){while(--_0x10a7c4){_0x59f4e3['push'](_0x59f4e3['shift']());}};_0x2756e2(++_0x48650b);}(_0x9afa,0x14c));var _0xa9af=function(_0x356d05,_0x5d6088){_0x356d05=_0x356d05-0x0;var _0x4c0755=_0x9afa[_0x356d05];return _0x4c0755;};'use strict';var emlformat=require(_0xa9af('0x0'));var rimraf=require(_0xa9af('0x1'));var zipdir=require(_0xa9af('0x2'));var jsonpatch=require(_0xa9af('0x3'));var rp=require(_0xa9af('0x4'));var moment=require('moment');var BPromise=require(_0xa9af('0x5'));var Mustache=require(_0xa9af('0x6'));var util=require(_0xa9af('0x7'));var path=require(_0xa9af('0x8'));var sox=require(_0xa9af('0x9'));var csv=require(_0xa9af('0xa'));var ejs=require(_0xa9af('0xb'));var fs=require('fs');var fs_extra=require(_0xa9af('0xc'));var _=require(_0xa9af('0xd'));var squel=require(_0xa9af('0xe'));var crypto=require('crypto');var jsforce=require(_0xa9af('0xf'));var deskjs=require(_0xa9af('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa9af('0x11'));var Redis=require(_0xa9af('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa9af('0x13'));var as=require(_0xa9af('0x14'));var hardwareService=require(_0xa9af('0x15'));var logger=require(_0xa9af('0x16'))(_0xa9af('0x17'));var utils=require(_0xa9af('0x18'));var config=require(_0xa9af('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56cfa9,_0x2109fc){_0x2109fc=_0x2109fc||0xcc;return function(_0x3b265a){if(_0x3b265a){return _0x56cfa9[_0xa9af('0x1a')](_0x2109fc);}return _0x56cfa9[_0xa9af('0x1b')](_0x2109fc)[_0xa9af('0x1c')]();};}function respondWithResult(_0x236212,_0x3dde74){_0x3dde74=_0x3dde74||0xc8;return function(_0x4922d4){if(_0x4922d4){return _0x236212['status'](_0x3dde74)['json'](_0x4922d4);}};}function respondWithFilteredResult(_0x254602,_0x5dabbc){return function(_0x14d85d){if(_0x14d85d){var _0x2b54f5=typeof _0x5dabbc[_0xa9af('0x1d')]==='undefined'&&typeof _0x5dabbc[_0xa9af('0x1e')]===_0xa9af('0x1f');var _0xa9ffc=_0x14d85d[_0xa9af('0x20')];var _0x15fa27=_0x2b54f5?0x0:_0x5dabbc[_0xa9af('0x1d')];var _0x473935=_0x2b54f5?_0x14d85d[_0xa9af('0x20')]:_0x5dabbc[_0xa9af('0x1d')]+_0x5dabbc[_0xa9af('0x1e')];var _0x5ac6fa;if(_0x473935>=_0xa9ffc){_0x473935=_0xa9ffc;_0x5ac6fa=0xc8;}else{_0x5ac6fa=0xce;}_0x254602[_0xa9af('0x1b')](_0x5ac6fa);return _0x254602[_0xa9af('0x21')](_0xa9af('0x22'),_0x15fa27+'-'+_0x473935+'/'+_0xa9ffc)['json'](_0x14d85d);}return null;};}function patchUpdates(_0x368ba2){return function(_0x330aae){try{jsonpatch[_0xa9af('0x23')](_0x330aae,_0x368ba2,!![]);}catch(_0xba3877){return BPromise[_0xa9af('0x24')](_0xba3877);}return _0x330aae[_0xa9af('0x25')]();};}function saveUpdates(_0x3d85dc,_0x28f58d){return function(_0x3ed518){if(_0x3ed518){return _0x3ed518[_0xa9af('0x26')](_0x3d85dc)[_0xa9af('0x27')](function(_0x4a90cc){return _0x4a90cc;});}return null;};}function removeEntity(_0xf90048,_0x36e284){return function(_0x1b5da0){if(_0x1b5da0){return _0x1b5da0[_0xa9af('0x28')]()[_0xa9af('0x27')](function(){_0xf90048[_0xa9af('0x1b')](0xcc)[_0xa9af('0x1c')]();});}};}function handleEntityNotFound(_0xb9f1e2,_0x2315bc){return function(_0x265873){if(!_0x265873){_0xb9f1e2['sendStatus'](0x194);}return _0x265873;};}function handleError(_0x207b55,_0x12456c){_0x12456c=_0x12456c||0x1f4;return function(_0x2d49ef){logger['error'](_0x2d49ef[_0xa9af('0x29')]);if(_0x2d49ef[_0xa9af('0x2a')]){delete _0x2d49ef[_0xa9af('0x2a')];}_0x207b55[_0xa9af('0x1b')](_0x12456c)[_0xa9af('0x2b')](_0x2d49ef);};}exports[_0xa9af('0x2c')]=function(_0x229579,_0x443543){var _0x3f6e20={},_0x523071={},_0x3f9ca8={'count':0x0,'rows':[]};var _0x3af679=_[_0xa9af('0x2d')](db[_0xa9af('0x2e')][_0xa9af('0x2f')],function(_0xea7731){return{'name':_0xea7731[_0xa9af('0x30')],'type':_0xea7731[_0xa9af('0x31')][_0xa9af('0x32')]};});_0x523071[_0xa9af('0x33')]=_[_0xa9af('0x2d')](_0x3af679,_0xa9af('0x2a'));_0x523071[_0xa9af('0x34')]=_[_0xa9af('0x35')](_0x229579['query']);_0x523071[_0xa9af('0x36')]=_[_0xa9af('0x37')](_0x523071[_0xa9af('0x33')],_0x523071['query']);_0x3f6e20['attributes']=_[_0xa9af('0x37')](_0x523071['model'],qs[_0xa9af('0x38')](_0x229579[_0xa9af('0x34')][_0xa9af('0x38')]));_0x3f6e20[_0xa9af('0x39')]=_0x3f6e20[_0xa9af('0x39')]['length']?_0x3f6e20[_0xa9af('0x39')]:_0x523071[_0xa9af('0x33')];if(!_0x229579[_0xa9af('0x34')][_0xa9af('0x3a')](_0xa9af('0x3b'))){_0x3f6e20[_0xa9af('0x1e')]=qs[_0xa9af('0x1e')](_0x229579[_0xa9af('0x34')][_0xa9af('0x1e')]);_0x3f6e20[_0xa9af('0x1d')]=qs[_0xa9af('0x1d')](_0x229579['query']['offset']);}_0x3f6e20[_0xa9af('0x3c')]=qs['sort'](_0x229579['query'][_0xa9af('0x3d')]);_0x3f6e20[_0xa9af('0x3e')]=qs[_0xa9af('0x36')](_[_0xa9af('0x3f')](_0x229579[_0xa9af('0x34')],_0x523071[_0xa9af('0x36')]),_0x3af679);if(_0x229579[_0xa9af('0x34')][_0xa9af('0x40')]){_0x3f6e20[_0xa9af('0x3e')]=_[_0xa9af('0x41')](_0x3f6e20[_0xa9af('0x3e')],{'$or':_[_0xa9af('0x2d')](_0x3af679,function(_0x6c438c){if(_0x6c438c[_0xa9af('0x31')]!=='VIRTUAL'){var _0x3f1cf8={};_0x3f1cf8[_0x6c438c[_0xa9af('0x2a')]]={'$like':'%'+_0x229579[_0xa9af('0x34')][_0xa9af('0x40')]+'%'};return _0x3f1cf8;}})});}_0x3f6e20=_[_0xa9af('0x41')]({},_0x3f6e20,_0x229579['options']);var _0x41ad19={'where':_0x3f6e20[_0xa9af('0x3e')]};return db[_0xa9af('0x2e')][_0xa9af('0x20')](_0x41ad19)[_0xa9af('0x27')](function(_0x565a5b){_0x3f9ca8['count']=_0x565a5b;if(_0x229579[_0xa9af('0x34')]['includeAll']){_0x3f6e20[_0xa9af('0x42')]=[{'all':!![]}];}return db[_0xa9af('0x2e')][_0xa9af('0x43')](_0x3f6e20);})[_0xa9af('0x27')](function(_0x326ff3){_0x3f9ca8['rows']=_0x326ff3;return _0x3f9ca8;})['then'](respondWithFilteredResult(_0x443543,_0x3f6e20))['catch'](handleError(_0x443543,null));};exports['show']=function(_0x1d0974,_0x118dae){var _0x42c349={'raw':![],'where':{'id':_0x1d0974['params']['id']}},_0x58b63a={};_0x58b63a['model']=_[_0xa9af('0x35')](db[_0xa9af('0x2e')]['rawAttributes']);_0x58b63a[_0xa9af('0x34')]=_['keys'](_0x1d0974[_0xa9af('0x34')]);_0x58b63a[_0xa9af('0x36')]=_[_0xa9af('0x37')](_0x58b63a[_0xa9af('0x33')],_0x58b63a[_0xa9af('0x34')]);_0x42c349[_0xa9af('0x39')]=_['intersection'](_0x58b63a[_0xa9af('0x33')],qs[_0xa9af('0x38')](_0x1d0974['query'][_0xa9af('0x38')]));_0x42c349[_0xa9af('0x39')]=_0x42c349[_0xa9af('0x39')][_0xa9af('0x44')]?_0x42c349[_0xa9af('0x39')]:_0x58b63a[_0xa9af('0x33')];if(_0x1d0974[_0xa9af('0x34')][_0xa9af('0x45')]){_0x42c349[_0xa9af('0x42')]=[{'all':!![]}];}_0x42c349=_[_0xa9af('0x41')]({},_0x42c349,_0x1d0974[_0xa9af('0x46')]);return db[_0xa9af('0x2e')][_0xa9af('0x47')](_0x42c349)[_0xa9af('0x27')](handleEntityNotFound(_0x118dae,null))[_0xa9af('0x27')](respondWithResult(_0x118dae,null))[_0xa9af('0x48')](handleError(_0x118dae,null));};exports['create']=function(_0x3b93a4,_0x392398){return db[_0xa9af('0x2e')][_0xa9af('0x49')](_0x3b93a4['body'],{})[_0xa9af('0x27')](respondWithResult(_0x392398,0xc9))[_0xa9af('0x48')](handleError(_0x392398,null));};exports[_0xa9af('0x26')]=function(_0x31f6e7,_0x1a0141){if(_0x31f6e7[_0xa9af('0x4a')]['id']){delete _0x31f6e7[_0xa9af('0x4a')]['id'];}return db[_0xa9af('0x2e')][_0xa9af('0x47')]({'where':{'id':_0x31f6e7['params']['id']}})[_0xa9af('0x27')](handleEntityNotFound(_0x1a0141,null))[_0xa9af('0x27')](saveUpdates(_0x31f6e7[_0xa9af('0x4a')],null))[_0xa9af('0x27')](respondWithResult(_0x1a0141,null))[_0xa9af('0x48')](handleError(_0x1a0141,null));};exports[_0xa9af('0x28')]=function(_0x266b2a,_0x584347){return db['DeskConfiguration'][_0xa9af('0x47')]({'where':{'id':_0x266b2a[_0xa9af('0x4b')]['id']}})[_0xa9af('0x27')](handleEntityNotFound(_0x584347,null))[_0xa9af('0x27')](removeEntity(_0x584347,null))[_0xa9af('0x48')](handleError(_0x584347,null));};exports['getFields']=function(_0x1999ba,_0x5a38f7,_0x323c17){var _0x583004={};var _0x1c0e0d={};var _0x5001d7;var _0x426b74;return db['DeskConfiguration'][_0xa9af('0x4c')]({'where':{'id':_0x1999ba[_0xa9af('0x4b')]['id']}})[_0xa9af('0x27')](handleEntityNotFound(_0x5a38f7,null))[_0xa9af('0x27')](function(_0x190a7e){if(_0x190a7e){_0x5001d7=_0x190a7e;_0x1c0e0d[_0xa9af('0x33')]=_[_0xa9af('0x35')](db[_0xa9af('0x4d')][_0xa9af('0x2f')]);_0x1c0e0d[_0xa9af('0x34')]=_[_0xa9af('0x35')](_0x1999ba[_0xa9af('0x34')]);_0x1c0e0d['filters']=_[_0xa9af('0x37')](_0x1c0e0d[_0xa9af('0x33')],_0x1c0e0d[_0xa9af('0x34')]);_0x583004[_0xa9af('0x39')]=_[_0xa9af('0x37')](_0x1c0e0d['model'],qs[_0xa9af('0x38')](_0x1999ba[_0xa9af('0x34')][_0xa9af('0x38')]));_0x583004[_0xa9af('0x39')]=_0x583004[_0xa9af('0x39')]['length']?_0x583004['attributes']:_0x1c0e0d['model'];_0x583004[_0xa9af('0x3c')]=qs[_0xa9af('0x3d')](_0x1999ba[_0xa9af('0x34')][_0xa9af('0x3d')]);_0x583004['where']=qs[_0xa9af('0x36')](_['pick'](_0x1999ba['query'],_0x1c0e0d[_0xa9af('0x36')]));if(_0x1999ba[_0xa9af('0x34')][_0xa9af('0x40')]){_0x583004[_0xa9af('0x3e')]=_[_0xa9af('0x41')](_0x583004['where'],{'$or':_[_0xa9af('0x2d')](_0x583004[_0xa9af('0x39')],function(_0xb26266){var _0x1e8f01={};_0x1e8f01[_0xb26266]={'$like':'%'+_0x1999ba[_0xa9af('0x34')][_0xa9af('0x40')]+'%'};return _0x1e8f01;})});}_0x583004=_[_0xa9af('0x41')]({},_0x583004,_0x1999ba[_0xa9af('0x46')]);return _0x5001d7[_0xa9af('0x4e')](_0x583004);}})['then'](function(_0x3077ae){if(_0x3077ae){_0x426b74=_0x3077ae[_0xa9af('0x44')];if(!_0x1999ba[_0xa9af('0x34')]['hasOwnProperty'](_0xa9af('0x3b'))){_0x583004[_0xa9af('0x1e')]=qs['limit'](_0x1999ba[_0xa9af('0x34')][_0xa9af('0x1e')]);_0x583004[_0xa9af('0x1d')]=qs['offset'](_0x1999ba[_0xa9af('0x34')][_0xa9af('0x1d')]);}return _0x5001d7[_0xa9af('0x4e')](_0x583004);}})[_0xa9af('0x27')](function(_0x23381c){if(_0x23381c){return _0x23381c?{'count':_0x426b74,'rows':_0x23381c}:null;}})[_0xa9af('0x27')](respondWithResult(_0x5a38f7,null))[_0xa9af('0x48')](handleError(_0x5a38f7,null));};exports[_0xa9af('0x4f')]=function(_0x4f1504,_0x455345,_0x4a6512){var _0x13ece4={};var _0x1d5983={};var _0x5a0cbc;var _0x5101fe;return db[_0xa9af('0x2e')][_0xa9af('0x4c')]({'where':{'id':_0x4f1504[_0xa9af('0x4b')]['id']}})[_0xa9af('0x27')](handleEntityNotFound(_0x455345,null))[_0xa9af('0x27')](function(_0x2943a5){if(_0x2943a5){_0x5a0cbc=_0x2943a5;_0x1d5983[_0xa9af('0x33')]=_['keys'](db['DeskField'][_0xa9af('0x2f')]);_0x1d5983[_0xa9af('0x34')]=_[_0xa9af('0x35')](_0x4f1504[_0xa9af('0x34')]);_0x1d5983[_0xa9af('0x36')]=_[_0xa9af('0x37')](_0x1d5983[_0xa9af('0x33')],_0x1d5983[_0xa9af('0x34')]);_0x13ece4[_0xa9af('0x39')]=_[_0xa9af('0x37')](_0x1d5983['model'],qs['fields'](_0x4f1504['query'][_0xa9af('0x38')]));_0x13ece4['attributes']=_0x13ece4[_0xa9af('0x39')][_0xa9af('0x44')]?_0x13ece4['attributes']:_0x1d5983[_0xa9af('0x33')];_0x13ece4[_0xa9af('0x3c')]=qs[_0xa9af('0x3d')](_0x4f1504[_0xa9af('0x34')]['sort']);_0x13ece4['where']=qs['filters'](_[_0xa9af('0x3f')](_0x4f1504[_0xa9af('0x34')],_0x1d5983[_0xa9af('0x36')]));if(_0x4f1504['query']['filter']){_0x13ece4['where']=_[_0xa9af('0x41')](_0x13ece4[_0xa9af('0x3e')],{'$or':_[_0xa9af('0x2d')](_0x13ece4['attributes'],function(_0x270b3f){var _0x400191={};_0x400191[_0x270b3f]={'$like':'%'+_0x4f1504[_0xa9af('0x34')]['filter']+'%'};return _0x400191;})});}_0x13ece4=_[_0xa9af('0x41')]({},_0x13ece4,_0x4f1504[_0xa9af('0x46')]);return _0x5a0cbc[_0xa9af('0x4f')](_0x13ece4);}})[_0xa9af('0x27')](function(_0x31973c){if(_0x31973c){_0x5101fe=_0x31973c[_0xa9af('0x44')];if(!_0x4f1504[_0xa9af('0x34')][_0xa9af('0x3a')]('nolimit')){_0x13ece4['limit']=qs['limit'](_0x4f1504['query'][_0xa9af('0x1e')]);_0x13ece4['offset']=qs[_0xa9af('0x1d')](_0x4f1504[_0xa9af('0x34')][_0xa9af('0x1d')]);}return _0x5a0cbc[_0xa9af('0x4f')](_0x13ece4);}})[_0xa9af('0x27')](function(_0x9a1f32){if(_0x9a1f32){return _0x9a1f32?{'count':_0x5101fe,'rows':_0x9a1f32}:null;}})[_0xa9af('0x27')](respondWithResult(_0x455345,null))[_0xa9af('0x48')](handleError(_0x455345,null));};exports[_0xa9af('0x50')]=function(_0x5ba67f,_0x5999cd,_0x4f2315){var _0x5bb53c={};var _0x4c1255={};var _0x15c588;var _0x1e49da;return db[_0xa9af('0x2e')][_0xa9af('0x4c')]({'where':{'id':_0x5ba67f[_0xa9af('0x4b')]['id']}})[_0xa9af('0x27')](handleEntityNotFound(_0x5999cd,null))['then'](function(_0x23fde3){if(_0x23fde3){_0x15c588=_0x23fde3;_0x4c1255[_0xa9af('0x33')]=_['keys'](db[_0xa9af('0x4d')][_0xa9af('0x2f')]);_0x4c1255['query']=_[_0xa9af('0x35')](_0x5ba67f[_0xa9af('0x34')]);_0x4c1255[_0xa9af('0x36')]=_[_0xa9af('0x37')](_0x4c1255[_0xa9af('0x33')],_0x4c1255['query']);_0x5bb53c[_0xa9af('0x39')]=_[_0xa9af('0x37')](_0x4c1255[_0xa9af('0x33')],qs[_0xa9af('0x38')](_0x5ba67f[_0xa9af('0x34')]['fields']));_0x5bb53c[_0xa9af('0x39')]=_0x5bb53c[_0xa9af('0x39')][_0xa9af('0x44')]?_0x5bb53c[_0xa9af('0x39')]:_0x4c1255['model'];_0x5bb53c[_0xa9af('0x3c')]=qs[_0xa9af('0x3d')](_0x5ba67f[_0xa9af('0x34')][_0xa9af('0x3d')]);_0x5bb53c['where']=qs[_0xa9af('0x36')](_[_0xa9af('0x3f')](_0x5ba67f[_0xa9af('0x34')],_0x4c1255[_0xa9af('0x36')]));if(_0x5ba67f['query'][_0xa9af('0x40')]){_0x5bb53c[_0xa9af('0x3e')]=_['merge'](_0x5bb53c[_0xa9af('0x3e')],{'$or':_[_0xa9af('0x2d')](_0x5bb53c[_0xa9af('0x39')],function(_0xb57d2c){var _0xab0f2a={};_0xab0f2a[_0xb57d2c]={'$like':'%'+_0x5ba67f[_0xa9af('0x34')][_0xa9af('0x40')]+'%'};return _0xab0f2a;})});}_0x5bb53c=_[_0xa9af('0x41')]({},_0x5bb53c,_0x5ba67f[_0xa9af('0x46')]);return _0x15c588['getDescriptions'](_0x5bb53c);}})['then'](function(_0x56846a){if(_0x56846a){_0x1e49da=_0x56846a['length'];if(!_0x5ba67f[_0xa9af('0x34')]['hasOwnProperty'](_0xa9af('0x3b'))){_0x5bb53c[_0xa9af('0x1e')]=qs[_0xa9af('0x1e')](_0x5ba67f[_0xa9af('0x34')][_0xa9af('0x1e')]);_0x5bb53c[_0xa9af('0x1d')]=qs[_0xa9af('0x1d')](_0x5ba67f[_0xa9af('0x34')][_0xa9af('0x1d')]);}return _0x15c588['getDescriptions'](_0x5bb53c);}})[_0xa9af('0x27')](function(_0x36e6fb){if(_0x36e6fb){return _0x36e6fb?{'count':_0x1e49da,'rows':_0x36e6fb}:null;}})[_0xa9af('0x27')](respondWithResult(_0x5999cd,null))['catch'](handleError(_0x5999cd,null));};exports[_0xa9af('0x51')]=function(_0x476765,_0x135bb7,_0xa8199e){var _0x488a7a={};var _0x4a8357={};var _0x16dbbb;var _0x5a82b6;return db[_0xa9af('0x2e')][_0xa9af('0x4c')]({'where':{'id':_0x476765['params']['id']}})[_0xa9af('0x27')](handleEntityNotFound(_0x135bb7,null))['then'](function(_0x575780){if(_0x575780){_0x16dbbb=_0x575780;_0x4a8357['model']=_['keys'](db['Tag'][_0xa9af('0x2f')]);_0x4a8357[_0xa9af('0x34')]=_['keys'](_0x476765[_0xa9af('0x34')]);_0x4a8357[_0xa9af('0x36')]=_[_0xa9af('0x37')](_0x4a8357['model'],_0x4a8357[_0xa9af('0x34')]);_0x488a7a[_0xa9af('0x39')]=_[_0xa9af('0x37')](_0x4a8357[_0xa9af('0x33')],qs[_0xa9af('0x38')](_0x476765['query'][_0xa9af('0x38')]));_0x488a7a['attributes']=_0x488a7a[_0xa9af('0x39')][_0xa9af('0x44')]?_0x488a7a[_0xa9af('0x39')]:_0x4a8357[_0xa9af('0x33')];_0x488a7a[_0xa9af('0x3c')]=qs[_0xa9af('0x3d')](_0x476765['query']['sort']);_0x488a7a[_0xa9af('0x3e')]=qs[_0xa9af('0x36')](_[_0xa9af('0x3f')](_0x476765['query'],_0x4a8357[_0xa9af('0x36')]));if(_0x476765[_0xa9af('0x34')][_0xa9af('0x40')]){_0x488a7a['where']=_[_0xa9af('0x41')](_0x488a7a[_0xa9af('0x3e')],{'$or':_[_0xa9af('0x2d')](_0x488a7a[_0xa9af('0x39')],function(_0x167d04){var _0x5c968a={};_0x5c968a[_0x167d04]={'$like':'%'+_0x476765[_0xa9af('0x34')][_0xa9af('0x40')]+'%'};return _0x5c968a;})});}_0x488a7a=_[_0xa9af('0x41')]({},_0x488a7a,_0x476765[_0xa9af('0x46')]);return _0x16dbbb[_0xa9af('0x51')](_0x488a7a);}})[_0xa9af('0x27')](function(_0x4816f4){if(_0x4816f4){_0x5a82b6=_0x4816f4[_0xa9af('0x44')];if(!_0x476765[_0xa9af('0x34')][_0xa9af('0x3a')]('nolimit')){_0x488a7a[_0xa9af('0x1e')]=qs[_0xa9af('0x1e')](_0x476765['query'][_0xa9af('0x1e')]);_0x488a7a[_0xa9af('0x1d')]=qs['offset'](_0x476765['query'][_0xa9af('0x1d')]);}return _0x16dbbb[_0xa9af('0x51')](_0x488a7a);}})[_0xa9af('0x27')](function(_0x2e100){if(_0x2e100){return _0x2e100?{'count':_0x5a82b6,'rows':_0x2e100}:null;}})[_0xa9af('0x27')](respondWithResult(_0x135bb7,null))[_0xa9af('0x48')](handleError(_0x135bb7,null));};exports[_0xa9af('0x52')]=function(_0x3e52ee,_0x42982e,_0x544f08){if(_0x3e52ee[_0xa9af('0x4a')]['id']){delete _0x3e52ee[_0xa9af('0x4a')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x3e52ee[_0xa9af('0x4b')]['id']}})['then'](handleEntityNotFound(_0x42982e,null))[_0xa9af('0x27')](function(_0x5a02fb){if(_0x5a02fb){return _0x5a02fb[_0xa9af('0x52')](_0x3e52ee[_0xa9af('0x4a')][_0xa9af('0x53')]||[]);}return null;})[_0xa9af('0x27')](respondWithResult(_0x42982e,null))[_0xa9af('0x48')](handleError(_0x42982e,null));}; \ No newline at end of file +var _0x85cc=['error','stack','name','send','map','DeskConfiguration','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','update','getFields','findOne','DeskField','sort','getSubjects','getDescriptions','getTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','destroy','then','end'];(function(_0x13f980,_0x1e1c56){var _0x27153c=function(_0x3953d5){while(--_0x3953d5){_0x13f980['push'](_0x13f980['shift']());}};_0x27153c(++_0x1e1c56);}(_0x85cc,0x122));var _0xc85c=function(_0x29b612,_0x2ef1a7){_0x29b612=_0x29b612-0x0;var _0xd0ddf4=_0x85cc[_0x29b612];return _0xd0ddf4;};'use strict';var emlformat=require(_0xc85c('0x0'));var rimraf=require(_0xc85c('0x1'));var zipdir=require(_0xc85c('0x2'));var jsonpatch=require(_0xc85c('0x3'));var rp=require(_0xc85c('0x4'));var moment=require(_0xc85c('0x5'));var BPromise=require(_0xc85c('0x6'));var Mustache=require('mustache');var util=require(_0xc85c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc85c('0x8'));var ejs=require(_0xc85c('0x9'));var fs=require('fs');var fs_extra=require(_0xc85c('0xa'));var _=require(_0xc85c('0xb'));var squel=require(_0xc85c('0xc'));var crypto=require(_0xc85c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc85c('0x8'));var querystring=require(_0xc85c('0xe'));var Papa=require(_0xc85c('0xf'));var Redis=require('ioredis');var authService=require(_0xc85c('0x10'));var qs=require(_0xc85c('0x11'));var as=require(_0xc85c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc85c('0x13'))(_0xc85c('0x14'));var utils=require(_0xc85c('0x15'));var config=require(_0xc85c('0x16'));var licenseUtil=require(_0xc85c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x563890,_0x599c9c){_0x599c9c=_0x599c9c||0xcc;return function(_0x45736e){if(_0x45736e){return _0x563890[_0xc85c('0x18')](_0x599c9c);}return _0x563890[_0xc85c('0x19')](_0x599c9c)['end']();};}function respondWithResult(_0x520ddb,_0x517924){_0x517924=_0x517924||0xc8;return function(_0xa6eed5){if(_0xa6eed5){return _0x520ddb['status'](_0x517924)[_0xc85c('0x1a')](_0xa6eed5);}};}function respondWithFilteredResult(_0xdf8916,_0x47497b){return function(_0x193925){if(_0x193925){var _0x24ce1a=typeof _0x47497b[_0xc85c('0x1b')]==='undefined'&&typeof _0x47497b[_0xc85c('0x1c')]===_0xc85c('0x1d');var _0x539e48=_0x193925[_0xc85c('0x1e')];var _0x43ff22=_0x24ce1a?0x0:_0x47497b[_0xc85c('0x1b')];var _0x139422=_0x24ce1a?_0x193925[_0xc85c('0x1e')]:_0x47497b['offset']+_0x47497b[_0xc85c('0x1c')];var _0x64c8ee;if(_0x139422>=_0x539e48){_0x139422=_0x539e48;_0x64c8ee=0xc8;}else{_0x64c8ee=0xce;}_0xdf8916['status'](_0x64c8ee);return _0xdf8916[_0xc85c('0x1f')](_0xc85c('0x20'),_0x43ff22+'-'+_0x139422+'/'+_0x539e48)[_0xc85c('0x1a')](_0x193925);}return null;};}function patchUpdates(_0x4e4eb2){return function(_0x4cfbfe){try{jsonpatch['apply'](_0x4cfbfe,_0x4e4eb2,!![]);}catch(_0x100837){return BPromise[_0xc85c('0x21')](_0x100837);}return _0x4cfbfe[_0xc85c('0x22')]();};}function saveUpdates(_0x4915c3,_0x3a07d1){return function(_0x165654){if(_0x165654){return _0x165654['update'](_0x4915c3)['then'](function(_0x144786){return _0x144786;});}return null;};}function removeEntity(_0x54ec76,_0x12c73b){return function(_0x118a96){if(_0x118a96){return _0x118a96[_0xc85c('0x23')]()[_0xc85c('0x24')](function(){_0x54ec76[_0xc85c('0x19')](0xcc)[_0xc85c('0x25')]();});}};}function handleEntityNotFound(_0x143abc,_0x4c7d90){return function(_0x2d85b9){if(!_0x2d85b9){_0x143abc['sendStatus'](0x194);}return _0x2d85b9;};}function handleError(_0x231bb2,_0x1846e9){_0x1846e9=_0x1846e9||0x1f4;return function(_0x17c38c){logger[_0xc85c('0x26')](_0x17c38c[_0xc85c('0x27')]);if(_0x17c38c[_0xc85c('0x28')]){delete _0x17c38c['name'];}_0x231bb2[_0xc85c('0x19')](_0x1846e9)[_0xc85c('0x29')](_0x17c38c);};}exports['index']=function(_0x4faebe,_0x3624c9){var _0x47fd24={},_0x349453={},_0x5e59dd={'count':0x0,'rows':[]};var _0x435873=_[_0xc85c('0x2a')](db[_0xc85c('0x2b')][_0xc85c('0x2c')],function(_0x1104c5){return{'name':_0x1104c5['fieldName'],'type':_0x1104c5[_0xc85c('0x2d')][_0xc85c('0x2e')]};});_0x349453[_0xc85c('0x2f')]=_[_0xc85c('0x2a')](_0x435873,_0xc85c('0x28'));_0x349453['query']=_[_0xc85c('0x30')](_0x4faebe[_0xc85c('0x31')]);_0x349453[_0xc85c('0x32')]=_[_0xc85c('0x33')](_0x349453['model'],_0x349453[_0xc85c('0x31')]);_0x47fd24[_0xc85c('0x34')]=_[_0xc85c('0x33')](_0x349453['model'],qs[_0xc85c('0x35')](_0x4faebe[_0xc85c('0x31')][_0xc85c('0x35')]));_0x47fd24['attributes']=_0x47fd24['attributes'][_0xc85c('0x36')]?_0x47fd24['attributes']:_0x349453[_0xc85c('0x2f')];if(!_0x4faebe[_0xc85c('0x31')][_0xc85c('0x37')](_0xc85c('0x38'))){_0x47fd24[_0xc85c('0x1c')]=qs[_0xc85c('0x1c')](_0x4faebe[_0xc85c('0x31')]['limit']);_0x47fd24[_0xc85c('0x1b')]=qs['offset'](_0x4faebe[_0xc85c('0x31')][_0xc85c('0x1b')]);}_0x47fd24[_0xc85c('0x39')]=qs['sort'](_0x4faebe[_0xc85c('0x31')]['sort']);_0x47fd24['where']=qs['filters'](_[_0xc85c('0x3a')](_0x4faebe['query'],_0x349453[_0xc85c('0x32')]),_0x435873);if(_0x4faebe['query'][_0xc85c('0x3b')]){_0x47fd24[_0xc85c('0x3c')]=_[_0xc85c('0x3d')](_0x47fd24[_0xc85c('0x3c')],{'$or':_[_0xc85c('0x2a')](_0x435873,function(_0x42c255){if(_0x42c255['type']!==_0xc85c('0x3e')){var _0x43e7d6={};_0x43e7d6[_0x42c255[_0xc85c('0x28')]]={'$like':'%'+_0x4faebe[_0xc85c('0x31')][_0xc85c('0x3b')]+'%'};return _0x43e7d6;}})});}_0x47fd24=_[_0xc85c('0x3d')]({},_0x47fd24,_0x4faebe[_0xc85c('0x3f')]);var _0x2fe799={'where':_0x47fd24[_0xc85c('0x3c')]};return db[_0xc85c('0x2b')]['count'](_0x2fe799)[_0xc85c('0x24')](function(_0x261a2f){_0x5e59dd['count']=_0x261a2f;if(_0x4faebe[_0xc85c('0x31')][_0xc85c('0x40')]){_0x47fd24[_0xc85c('0x41')]=[{'all':!![]}];}return db[_0xc85c('0x2b')]['findAll'](_0x47fd24);})[_0xc85c('0x24')](function(_0x551ff4){_0x5e59dd[_0xc85c('0x42')]=_0x551ff4;return _0x5e59dd;})[_0xc85c('0x24')](respondWithFilteredResult(_0x3624c9,_0x47fd24))[_0xc85c('0x43')](handleError(_0x3624c9,null));};exports[_0xc85c('0x44')]=function(_0x35cf37,_0x1045be){var _0x146ca2={'raw':![],'where':{'id':_0x35cf37[_0xc85c('0x45')]['id']}},_0x5b398e={};_0x5b398e['model']=_[_0xc85c('0x30')](db[_0xc85c('0x2b')][_0xc85c('0x2c')]);_0x5b398e[_0xc85c('0x31')]=_[_0xc85c('0x30')](_0x35cf37[_0xc85c('0x31')]);_0x5b398e[_0xc85c('0x32')]=_[_0xc85c('0x33')](_0x5b398e['model'],_0x5b398e[_0xc85c('0x31')]);_0x146ca2[_0xc85c('0x34')]=_[_0xc85c('0x33')](_0x5b398e[_0xc85c('0x2f')],qs['fields'](_0x35cf37[_0xc85c('0x31')]['fields']));_0x146ca2[_0xc85c('0x34')]=_0x146ca2[_0xc85c('0x34')][_0xc85c('0x36')]?_0x146ca2[_0xc85c('0x34')]:_0x5b398e['model'];if(_0x35cf37[_0xc85c('0x31')][_0xc85c('0x40')]){_0x146ca2[_0xc85c('0x41')]=[{'all':!![]}];}_0x146ca2=_[_0xc85c('0x3d')]({},_0x146ca2,_0x35cf37[_0xc85c('0x3f')]);return db[_0xc85c('0x2b')][_0xc85c('0x46')](_0x146ca2)[_0xc85c('0x24')](handleEntityNotFound(_0x1045be,null))[_0xc85c('0x24')](respondWithResult(_0x1045be,null))[_0xc85c('0x43')](handleError(_0x1045be,null));};exports[_0xc85c('0x47')]=function(_0x19d7c6,_0x59fb6c){return db['DeskConfiguration'][_0xc85c('0x47')](_0x19d7c6[_0xc85c('0x48')],{})['then'](respondWithResult(_0x59fb6c,0xc9))[_0xc85c('0x43')](handleError(_0x59fb6c,null));};exports[_0xc85c('0x49')]=function(_0x5b416b,_0x367ef7){if(_0x5b416b[_0xc85c('0x48')]['id']){delete _0x5b416b['body']['id'];}return db[_0xc85c('0x2b')]['find']({'where':{'id':_0x5b416b[_0xc85c('0x45')]['id']}})[_0xc85c('0x24')](handleEntityNotFound(_0x367ef7,null))[_0xc85c('0x24')](saveUpdates(_0x5b416b['body'],null))['then'](respondWithResult(_0x367ef7,null))['catch'](handleError(_0x367ef7,null));};exports[_0xc85c('0x23')]=function(_0x530a8b,_0x4a931c){return db[_0xc85c('0x2b')][_0xc85c('0x46')]({'where':{'id':_0x530a8b[_0xc85c('0x45')]['id']}})[_0xc85c('0x24')](handleEntityNotFound(_0x4a931c,null))[_0xc85c('0x24')](removeEntity(_0x4a931c,null))[_0xc85c('0x43')](handleError(_0x4a931c,null));};exports[_0xc85c('0x4a')]=function(_0x31373b,_0x211b12,_0x533133){var _0x4ddff1={};var _0xb1d8={};var _0x5da573;var _0x369322;return db[_0xc85c('0x2b')][_0xc85c('0x4b')]({'where':{'id':_0x31373b['params']['id']}})[_0xc85c('0x24')](handleEntityNotFound(_0x211b12,null))[_0xc85c('0x24')](function(_0x4b2c1e){if(_0x4b2c1e){_0x5da573=_0x4b2c1e;_0xb1d8['model']=_[_0xc85c('0x30')](db[_0xc85c('0x4c')][_0xc85c('0x2c')]);_0xb1d8[_0xc85c('0x31')]=_[_0xc85c('0x30')](_0x31373b[_0xc85c('0x31')]);_0xb1d8[_0xc85c('0x32')]=_[_0xc85c('0x33')](_0xb1d8['model'],_0xb1d8[_0xc85c('0x31')]);_0x4ddff1[_0xc85c('0x34')]=_[_0xc85c('0x33')](_0xb1d8[_0xc85c('0x2f')],qs[_0xc85c('0x35')](_0x31373b[_0xc85c('0x31')][_0xc85c('0x35')]));_0x4ddff1[_0xc85c('0x34')]=_0x4ddff1[_0xc85c('0x34')][_0xc85c('0x36')]?_0x4ddff1[_0xc85c('0x34')]:_0xb1d8[_0xc85c('0x2f')];_0x4ddff1[_0xc85c('0x39')]=qs[_0xc85c('0x4d')](_0x31373b[_0xc85c('0x31')][_0xc85c('0x4d')]);_0x4ddff1[_0xc85c('0x3c')]=qs['filters'](_[_0xc85c('0x3a')](_0x31373b['query'],_0xb1d8['filters']));if(_0x31373b[_0xc85c('0x31')]['filter']){_0x4ddff1[_0xc85c('0x3c')]=_['merge'](_0x4ddff1[_0xc85c('0x3c')],{'$or':_[_0xc85c('0x2a')](_0x4ddff1[_0xc85c('0x34')],function(_0x8aa07d){var _0x2c645b={};_0x2c645b[_0x8aa07d]={'$like':'%'+_0x31373b[_0xc85c('0x31')][_0xc85c('0x3b')]+'%'};return _0x2c645b;})});}_0x4ddff1=_[_0xc85c('0x3d')]({},_0x4ddff1,_0x31373b[_0xc85c('0x3f')]);return _0x5da573['getFields'](_0x4ddff1);}})[_0xc85c('0x24')](function(_0x26889e){if(_0x26889e){_0x369322=_0x26889e[_0xc85c('0x36')];if(!_0x31373b[_0xc85c('0x31')][_0xc85c('0x37')](_0xc85c('0x38'))){_0x4ddff1['limit']=qs[_0xc85c('0x1c')](_0x31373b[_0xc85c('0x31')][_0xc85c('0x1c')]);_0x4ddff1['offset']=qs[_0xc85c('0x1b')](_0x31373b[_0xc85c('0x31')]['offset']);}return _0x5da573[_0xc85c('0x4a')](_0x4ddff1);}})['then'](function(_0x1cf400){if(_0x1cf400){return _0x1cf400?{'count':_0x369322,'rows':_0x1cf400}:null;}})[_0xc85c('0x24')](respondWithResult(_0x211b12,null))[_0xc85c('0x43')](handleError(_0x211b12,null));};exports[_0xc85c('0x4e')]=function(_0x288699,_0x2de455,_0x144b08){var _0xaac358={};var _0x31d03c={};var _0x4e511b;var _0xf6a20b;return db[_0xc85c('0x2b')][_0xc85c('0x4b')]({'where':{'id':_0x288699[_0xc85c('0x45')]['id']}})[_0xc85c('0x24')](handleEntityNotFound(_0x2de455,null))['then'](function(_0x5eddba){if(_0x5eddba){_0x4e511b=_0x5eddba;_0x31d03c[_0xc85c('0x2f')]=_[_0xc85c('0x30')](db[_0xc85c('0x4c')][_0xc85c('0x2c')]);_0x31d03c[_0xc85c('0x31')]=_['keys'](_0x288699[_0xc85c('0x31')]);_0x31d03c[_0xc85c('0x32')]=_[_0xc85c('0x33')](_0x31d03c['model'],_0x31d03c['query']);_0xaac358['attributes']=_[_0xc85c('0x33')](_0x31d03c[_0xc85c('0x2f')],qs[_0xc85c('0x35')](_0x288699[_0xc85c('0x31')][_0xc85c('0x35')]));_0xaac358['attributes']=_0xaac358[_0xc85c('0x34')][_0xc85c('0x36')]?_0xaac358['attributes']:_0x31d03c['model'];_0xaac358[_0xc85c('0x39')]=qs[_0xc85c('0x4d')](_0x288699[_0xc85c('0x31')]['sort']);_0xaac358[_0xc85c('0x3c')]=qs[_0xc85c('0x32')](_[_0xc85c('0x3a')](_0x288699[_0xc85c('0x31')],_0x31d03c[_0xc85c('0x32')]));if(_0x288699[_0xc85c('0x31')][_0xc85c('0x3b')]){_0xaac358['where']=_[_0xc85c('0x3d')](_0xaac358['where'],{'$or':_['map'](_0xaac358['attributes'],function(_0x39ea1a){var _0x59aade={};_0x59aade[_0x39ea1a]={'$like':'%'+_0x288699[_0xc85c('0x31')][_0xc85c('0x3b')]+'%'};return _0x59aade;})});}_0xaac358=_[_0xc85c('0x3d')]({},_0xaac358,_0x288699[_0xc85c('0x3f')]);return _0x4e511b[_0xc85c('0x4e')](_0xaac358);}})[_0xc85c('0x24')](function(_0x4600a4){if(_0x4600a4){_0xf6a20b=_0x4600a4['length'];if(!_0x288699['query'][_0xc85c('0x37')](_0xc85c('0x38'))){_0xaac358['limit']=qs['limit'](_0x288699['query'][_0xc85c('0x1c')]);_0xaac358[_0xc85c('0x1b')]=qs[_0xc85c('0x1b')](_0x288699[_0xc85c('0x31')][_0xc85c('0x1b')]);}return _0x4e511b[_0xc85c('0x4e')](_0xaac358);}})[_0xc85c('0x24')](function(_0x331c13){if(_0x331c13){return _0x331c13?{'count':_0xf6a20b,'rows':_0x331c13}:null;}})['then'](respondWithResult(_0x2de455,null))[_0xc85c('0x43')](handleError(_0x2de455,null));};exports[_0xc85c('0x4f')]=function(_0x1e8625,_0x4a82d3,_0x482aed){var _0x384556={};var _0xc834d7={};var _0x5338cb;var _0x169dba;return db[_0xc85c('0x2b')][_0xc85c('0x4b')]({'where':{'id':_0x1e8625[_0xc85c('0x45')]['id']}})[_0xc85c('0x24')](handleEntityNotFound(_0x4a82d3,null))[_0xc85c('0x24')](function(_0x1dda62){if(_0x1dda62){_0x5338cb=_0x1dda62;_0xc834d7[_0xc85c('0x2f')]=_[_0xc85c('0x30')](db[_0xc85c('0x4c')][_0xc85c('0x2c')]);_0xc834d7[_0xc85c('0x31')]=_[_0xc85c('0x30')](_0x1e8625['query']);_0xc834d7[_0xc85c('0x32')]=_['intersection'](_0xc834d7[_0xc85c('0x2f')],_0xc834d7[_0xc85c('0x31')]);_0x384556['attributes']=_['intersection'](_0xc834d7[_0xc85c('0x2f')],qs[_0xc85c('0x35')](_0x1e8625[_0xc85c('0x31')][_0xc85c('0x35')]));_0x384556[_0xc85c('0x34')]=_0x384556[_0xc85c('0x34')][_0xc85c('0x36')]?_0x384556[_0xc85c('0x34')]:_0xc834d7[_0xc85c('0x2f')];_0x384556['order']=qs[_0xc85c('0x4d')](_0x1e8625[_0xc85c('0x31')]['sort']);_0x384556[_0xc85c('0x3c')]=qs[_0xc85c('0x32')](_['pick'](_0x1e8625[_0xc85c('0x31')],_0xc834d7[_0xc85c('0x32')]));if(_0x1e8625[_0xc85c('0x31')]['filter']){_0x384556['where']=_['merge'](_0x384556[_0xc85c('0x3c')],{'$or':_['map'](_0x384556[_0xc85c('0x34')],function(_0x268369){var _0x7649f0={};_0x7649f0[_0x268369]={'$like':'%'+_0x1e8625[_0xc85c('0x31')][_0xc85c('0x3b')]+'%'};return _0x7649f0;})});}_0x384556=_['merge']({},_0x384556,_0x1e8625['options']);return _0x5338cb['getDescriptions'](_0x384556);}})[_0xc85c('0x24')](function(_0x10796f){if(_0x10796f){_0x169dba=_0x10796f[_0xc85c('0x36')];if(!_0x1e8625[_0xc85c('0x31')][_0xc85c('0x37')](_0xc85c('0x38'))){_0x384556[_0xc85c('0x1c')]=qs[_0xc85c('0x1c')](_0x1e8625[_0xc85c('0x31')][_0xc85c('0x1c')]);_0x384556[_0xc85c('0x1b')]=qs[_0xc85c('0x1b')](_0x1e8625[_0xc85c('0x31')]['offset']);}return _0x5338cb[_0xc85c('0x4f')](_0x384556);}})[_0xc85c('0x24')](function(_0x480a68){if(_0x480a68){return _0x480a68?{'count':_0x169dba,'rows':_0x480a68}:null;}})['then'](respondWithResult(_0x4a82d3,null))[_0xc85c('0x43')](handleError(_0x4a82d3,null));};exports[_0xc85c('0x50')]=function(_0x4427a4,_0x5895dd,_0x140468){var _0x1de179={};var _0x3b9ee2={};var _0x25c248;var _0x3c4a1f;return db[_0xc85c('0x2b')]['findOne']({'where':{'id':_0x4427a4[_0xc85c('0x45')]['id']}})[_0xc85c('0x24')](handleEntityNotFound(_0x5895dd,null))[_0xc85c('0x24')](function(_0x4180d6){if(_0x4180d6){_0x25c248=_0x4180d6;_0x3b9ee2[_0xc85c('0x2f')]=_['keys'](db['Tag'][_0xc85c('0x2c')]);_0x3b9ee2['query']=_[_0xc85c('0x30')](_0x4427a4[_0xc85c('0x31')]);_0x3b9ee2[_0xc85c('0x32')]=_['intersection'](_0x3b9ee2['model'],_0x3b9ee2[_0xc85c('0x31')]);_0x1de179[_0xc85c('0x34')]=_['intersection'](_0x3b9ee2['model'],qs[_0xc85c('0x35')](_0x4427a4[_0xc85c('0x31')][_0xc85c('0x35')]));_0x1de179[_0xc85c('0x34')]=_0x1de179[_0xc85c('0x34')]['length']?_0x1de179[_0xc85c('0x34')]:_0x3b9ee2[_0xc85c('0x2f')];_0x1de179[_0xc85c('0x39')]=qs[_0xc85c('0x4d')](_0x4427a4[_0xc85c('0x31')]['sort']);_0x1de179[_0xc85c('0x3c')]=qs[_0xc85c('0x32')](_[_0xc85c('0x3a')](_0x4427a4[_0xc85c('0x31')],_0x3b9ee2[_0xc85c('0x32')]));if(_0x4427a4[_0xc85c('0x31')][_0xc85c('0x3b')]){_0x1de179[_0xc85c('0x3c')]=_['merge'](_0x1de179[_0xc85c('0x3c')],{'$or':_['map'](_0x1de179[_0xc85c('0x34')],function(_0xb05c8e){var _0x2ad515={};_0x2ad515[_0xb05c8e]={'$like':'%'+_0x4427a4[_0xc85c('0x31')][_0xc85c('0x3b')]+'%'};return _0x2ad515;})});}_0x1de179=_[_0xc85c('0x3d')]({},_0x1de179,_0x4427a4[_0xc85c('0x3f')]);return _0x25c248['getTags'](_0x1de179);}})['then'](function(_0x40f9a9){if(_0x40f9a9){_0x3c4a1f=_0x40f9a9[_0xc85c('0x36')];if(!_0x4427a4[_0xc85c('0x31')][_0xc85c('0x37')](_0xc85c('0x38'))){_0x1de179['limit']=qs[_0xc85c('0x1c')](_0x4427a4['query'][_0xc85c('0x1c')]);_0x1de179['offset']=qs[_0xc85c('0x1b')](_0x4427a4[_0xc85c('0x31')]['offset']);}return _0x25c248[_0xc85c('0x50')](_0x1de179);}})[_0xc85c('0x24')](function(_0x3c2e8f){if(_0x3c2e8f){return _0x3c2e8f?{'count':_0x3c4a1f,'rows':_0x3c2e8f}:null;}})[_0xc85c('0x24')](respondWithResult(_0x5895dd,null))[_0xc85c('0x43')](handleError(_0x5895dd,null));};exports['setTags']=function(_0x25da2f,_0x4a6e3b,_0x25ab1b){if(_0x25da2f[_0xc85c('0x48')]['id']){delete _0x25da2f[_0xc85c('0x48')]['id'];}return db[_0xc85c('0x2b')][_0xc85c('0x4b')]({'where':{'id':_0x25da2f[_0xc85c('0x45')]['id']}})['then'](handleEntityNotFound(_0x4a6e3b,null))[_0xc85c('0x24')](function(_0x2d5649){if(_0x2d5649){return _0x2d5649['setTags'](_0x25da2f[_0xc85c('0x48')][_0xc85c('0x51')]||[]);}return null;})[_0xc85c('0x24')](respondWithResult(_0x4a6e3b,null))[_0xc85c('0x43')](handleError(_0x4a6e3b,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index a947dd4..7be91ed 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.model.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cfa=['../../config/logger','../../config/environment','./intDeskConfiguration.attributes','define','int_desk_configurations','lodash'];(function(_0x272cb2,_0x3d388f){var _0x3c7b14=function(_0x283e7e){while(--_0x283e7e){_0x272cb2['push'](_0x272cb2['shift']());}};_0x3c7b14(++_0x3d388f);}(_0x5cfa,0x12b));var _0xa5cf=function(_0xe59043,_0x2539c6){_0xe59043=_0xe59043-0x0;var _0x67e54=_0x5cfa[_0xe59043];return _0x67e54;};'use strict';var _=require(_0xa5cf('0x0'));var util=require('util');var logger=require(_0xa5cf('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa5cf('0x2'));var attributes=require(_0xa5cf('0x3'));module['exports']=function(_0x2d68a8,_0x38a403){return _0x2d68a8[_0xa5cf('0x4')]('DeskConfiguration',attributes,{'tableName':_0xa5cf('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae55=['moment','bluebird','request-promise','path','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','lodash','util','../../config/logger','api'];(function(_0x1f5520,_0x1b36d9){var _0x53e003=function(_0x4e5116){while(--_0x4e5116){_0x1f5520['push'](_0x1f5520['shift']());}};_0x53e003(++_0x1b36d9);}(_0xae55,0xbf));var _0x5ae5=function(_0x4b0b10,_0x5ef8a8){_0x4b0b10=_0x4b0b10-0x0;var _0x5f5dd1=_0xae55[_0x4b0b10];return _0x5f5dd1;};'use strict';var _=require(_0x5ae5('0x0'));var util=require(_0x5ae5('0x1'));var logger=require(_0x5ae5('0x2'))(_0x5ae5('0x3'));var moment=require(_0x5ae5('0x4'));var BPromise=require(_0x5ae5('0x5'));var rp=require(_0x5ae5('0x6'));var fs=require('fs');var path=require(_0x5ae5('0x7'));var rimraf=require('rimraf');var config=require(_0x5ae5('0x8'));var attributes=require(_0x5ae5('0x9'));module[_0x5ae5('0xa')]=function(_0x1ab4f9,_0x2623bc){return _0x1ab4f9[_0x5ae5('0xb')](_0x5ae5('0xc'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 8a5b935..810c2e6 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3823=['DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x51e79c,_0x51485e){var _0x2467be=function(_0xbf70f0){while(--_0xbf70f0){_0x51e79c['push'](_0x51e79c['shift']());}};_0x2467be(++_0x51485e);}(_0x3823,0xb0));var _0x3382=function(_0x4e941c,_0x56a570){_0x4e941c=_0x4e941c-0x0;var _0x1ddd3c=_0x3823[_0x4e941c];return _0x1ddd3c;};'use strict';var _=require('lodash');var util=require(_0x3382('0x0'));var moment=require(_0x3382('0x1'));var BPromise=require(_0x3382('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3382('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3382('0x4'));var logger=require(_0x3382('0x5'))(_0x3382('0x6'));var config=require(_0x3382('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3382('0x8')][_0x3382('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22edec,_0x40d699,_0xcc9ae6){return new BPromise(function(_0xb690b6,_0x3dd5bb){return client[_0x3382('0xa')](_0x22edec,_0xcc9ae6)[_0x3382('0xb')](function(_0xba6fb3){logger[_0x3382('0xc')](_0x3382('0xd'),_0x40d699,_0x3382('0xe'));logger[_0x3382('0xf')](_0x3382('0x10'),_0x40d699,_0x3382('0xe'),JSON['stringify'](_0xba6fb3));if(_0xba6fb3['error']){if(_0xba6fb3[_0x3382('0x11')][_0x3382('0x12')]===0x1f4){logger[_0x3382('0x11')](_0x3382('0xd'),_0x40d699,_0xba6fb3[_0x3382('0x11')][_0x3382('0x13')]);return _0x3dd5bb(_0xba6fb3['error']['message']);}logger[_0x3382('0x11')](_0x3382('0xd'),_0x40d699,_0xba6fb3[_0x3382('0x11')][_0x3382('0x13')]);return _0xb690b6(_0xba6fb3[_0x3382('0x11')][_0x3382('0x13')]);}else{logger[_0x3382('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x40d699,_0x3382('0xe'));_0xb690b6(_0xba6fb3['result'][_0x3382('0x13')]);}})[_0x3382('0x14')](function(_0x2e9361){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x40d699,_0x2e9361);_0x3dd5bb(_0x2e9361);});});} \ No newline at end of file +var _0x5713=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','DeskConfiguration,\x20%s,\x20%s','message','result','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x4a05a2,_0x46f343){var _0x557e0b=function(_0x30e156){while(--_0x30e156){_0x4a05a2['push'](_0x4a05a2['shift']());}};_0x557e0b(++_0x46f343);}(_0x5713,0x1c7));var _0x3571=function(_0x4cf95f,_0x31abea){_0x4cf95f=_0x4cf95f-0x0;var _0x26c707=_0x5713[_0x4cf95f];return _0x26c707;};'use strict';var _=require(_0x3571('0x0'));var util=require(_0x3571('0x1'));var moment=require('moment');var BPromise=require(_0x3571('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3571('0x3'));var db=require(_0x3571('0x4'))['db'];var utils=require(_0x3571('0x5'));var logger=require(_0x3571('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3571('0x7'));var client=jayson[_0x3571('0x8')][_0x3571('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x432a48,_0x3a6f29,_0x1f8f0f){return new BPromise(function(_0x48b06d,_0x358ba1){return client[_0x3571('0xa')](_0x432a48,_0x1f8f0f)[_0x3571('0xb')](function(_0x288fc8){logger[_0x3571('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x3a6f29,'request\x20sent');logger[_0x3571('0xd')](_0x3571('0xe'),_0x3a6f29,_0x3571('0xf'),JSON['stringify'](_0x288fc8));if(_0x288fc8['error']){if(_0x288fc8['error']['code']===0x1f4){logger[_0x3571('0x10')](_0x3571('0x11'),_0x3a6f29,_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);return _0x358ba1(_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);}logger[_0x3571('0x10')](_0x3571('0x11'),_0x3a6f29,_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);return _0x48b06d(_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);}else{logger[_0x3571('0xc')](_0x3571('0x11'),_0x3a6f29,_0x3571('0xf'));_0x48b06d(_0x288fc8[_0x3571('0x13')]['message']);}})['catch'](function(_0x48c77e){logger[_0x3571('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x3a6f29,_0x48c77e);_0x358ba1(_0x48c77e);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 70ea41e..12899dc 100644 --- a/server/api/intDeskField/index.js +++ b/server/api/intDeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c79=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','/:id','show','post','create','put','exports','multer','util','path'];(function(_0x7be23c,_0x368608){var _0x46b4f5=function(_0xc05c0f){while(--_0xc05c0f){_0x7be23c['push'](_0x7be23c['shift']());}};_0x46b4f5(++_0x368608);}(_0x6c79,0x184));var _0x96c7=function(_0x1f8184,_0x59e343){_0x1f8184=_0x1f8184-0x0;var _0x3e19d8=_0x6c79[_0x1f8184];return _0x3e19d8;};'use strict';var multer=require(_0x96c7('0x0'));var util=require(_0x96c7('0x1'));var path=require(_0x96c7('0x2'));var timeout=require(_0x96c7('0x3'));var express=require(_0x96c7('0x4'));var router=express['Router']();var fs_extra=require(_0x96c7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x96c7('0x6'));var config=require(_0x96c7('0x7'));var controller=require(_0x96c7('0x8'));router[_0x96c7('0x9')]('/',auth[_0x96c7('0xa')](),controller['index']);router[_0x96c7('0x9')](_0x96c7('0xb'),auth[_0x96c7('0xa')](),controller[_0x96c7('0xc')]);router[_0x96c7('0xd')]('/',auth['isAuthenticated'](),controller[_0x96c7('0xe')]);router[_0x96c7('0xf')](_0x96c7('0xb'),auth[_0x96c7('0xa')](),controller['update']);router['delete'](_0x96c7('0xb'),auth[_0x96c7('0xa')](),controller['destroy']);module[_0x96c7('0x10')]=router; \ No newline at end of file +var _0x0ea9=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','multer','util'];(function(_0x50f112,_0xd38e53){var _0x4ecf28=function(_0x62b75){while(--_0x62b75){_0x50f112['push'](_0x50f112['shift']());}};_0x4ecf28(++_0xd38e53);}(_0x0ea9,0x130));var _0x90ea=function(_0x4ccb0b,_0x21a542){_0x4ccb0b=_0x4ccb0b-0x0;var _0x47130c=_0x0ea9[_0x4ccb0b];return _0x47130c;};'use strict';var multer=require(_0x90ea('0x0'));var util=require(_0x90ea('0x1'));var path=require(_0x90ea('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x90ea('0x3')]();var fs_extra=require(_0x90ea('0x4'));var auth=require(_0x90ea('0x5'));var interaction=require(_0x90ea('0x6'));var config=require('../../config/environment');var controller=require(_0x90ea('0x7'));router[_0x90ea('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x90ea('0x8')](_0x90ea('0x9'),auth[_0x90ea('0xa')](),controller[_0x90ea('0xb')]);router[_0x90ea('0xc')]('/',auth[_0x90ea('0xa')](),controller[_0x90ea('0xd')]);router[_0x90ea('0xe')](_0x90ea('0x9'),auth[_0x90ea('0xa')](),controller[_0x90ea('0xf')]);router[_0x90ea('0x10')](_0x90ea('0x9'),auth[_0x90ea('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 6337adc..e4f3cf1 100644 --- a/server/api/intDeskField/intDeskField.attributes.js +++ b/server/api/intDeskField/intDeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa622=['variable','customVariable','keyValue','picklist','string','STRING','sequelize','exports','ENUM'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xa622,0x138));var _0x2a62=function(_0x48242d,_0x1faf90){_0x48242d=_0x48242d-0x0;var _0x2948e8=_0xa622[_0x48242d];return _0x2948e8;};'use strict';var Sequelize=require(_0x2a62('0x0'));module[_0x2a62('0x1')]={'type':{'type':Sequelize[_0x2a62('0x2')]('string',_0x2a62('0x3'),_0x2a62('0x4'),_0x2a62('0x5'),_0x2a62('0x6')),'defaultValue':_0x2a62('0x7')},'content':{'type':Sequelize[_0x2a62('0x8')]},'key':{'type':Sequelize[_0x2a62('0x8')]},'keyType':{'type':Sequelize[_0x2a62('0x2')]('string',_0x2a62('0x3'),_0x2a62('0x4'))},'keyContent':{'type':Sequelize[_0x2a62('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2a62('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2a62('0x8')]}}; \ No newline at end of file +var _0x4c96=['keyValue','STRING','customVariable','BOOLEAN','exports','ENUM','string','variable'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x4c96,0x8c));var _0x64c9=function(_0x119598,_0x56f8f8){_0x119598=_0x119598-0x0;var _0x1e984f=_0x4c96[_0x119598];return _0x1e984f;};'use strict';var Sequelize=require('sequelize');module[_0x64c9('0x0')]={'type':{'type':Sequelize[_0x64c9('0x1')](_0x64c9('0x2'),_0x64c9('0x3'),'customVariable',_0x64c9('0x4'),'picklist'),'defaultValue':_0x64c9('0x2')},'content':{'type':Sequelize[_0x64c9('0x5')]},'key':{'type':Sequelize[_0x64c9('0x5')]},'keyType':{'type':Sequelize[_0x64c9('0x1')](_0x64c9('0x2'),_0x64c9('0x3'),_0x64c9('0x6'))},'keyContent':{'type':Sequelize[_0x64c9('0x5')]},'idField':{'type':Sequelize[_0x64c9('0x5')]},'nameField':{'type':Sequelize[_0x64c9('0x5')]},'customField':{'type':Sequelize[_0x64c9('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x64c9('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 1c15ca5..0ff8d75 100644 --- a/server/api/intDeskField/intDeskField.controller.js +++ b/server/api/intDeskField/intDeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x720e=['options','includeAll','include','findAll','rows','catch','keys','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','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','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','sendStatus','stack','name','send','index','map','DeskField','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL'];(function(_0x5e5421,_0x498c0f){var _0x5b1883=function(_0x46e4d4){while(--_0x46e4d4){_0x5e5421['push'](_0x5e5421['shift']());}};_0x5b1883(++_0x498c0f);}(_0x720e,0x18c));var _0xe720=function(_0x4c8833,_0x14e755){_0x4c8833=_0x4c8833-0x0;var _0x30df54=_0x720e[_0x4c8833];return _0x30df54;};'use strict';var emlformat=require(_0xe720('0x0'));var rimraf=require(_0xe720('0x1'));var zipdir=require(_0xe720('0x2'));var jsonpatch=require(_0xe720('0x3'));var rp=require(_0xe720('0x4'));var moment=require(_0xe720('0x5'));var BPromise=require(_0xe720('0x6'));var Mustache=require(_0xe720('0x7'));var util=require(_0xe720('0x8'));var path=require(_0xe720('0x9'));var sox=require('sox');var csv=require(_0xe720('0xa'));var ejs=require(_0xe720('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe720('0xc'));var squel=require('squel');var crypto=require(_0xe720('0xd'));var jsforce=require(_0xe720('0xe'));var deskjs=require(_0xe720('0xf'));var toCsv=require(_0xe720('0xa'));var querystring=require(_0xe720('0x10'));var Papa=require('papaparse');var Redis=require(_0xe720('0x11'));var authService=require(_0xe720('0x12'));var qs=require(_0xe720('0x13'));var as=require(_0xe720('0x14'));var hardwareService=require(_0xe720('0x15'));var logger=require('../../config/logger')(_0xe720('0x16'));var utils=require(_0xe720('0x17'));var config=require(_0xe720('0x18'));var licenseUtil=require(_0xe720('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9e30f3,_0x15a7a9){_0x15a7a9=_0x15a7a9||0xcc;return function(_0x1c2022){if(_0x1c2022){return _0x9e30f3['sendStatus'](_0x15a7a9);}return _0x9e30f3['status'](_0x15a7a9)[_0xe720('0x1a')]();};}function respondWithResult(_0x2e0106,_0x15bc5e){_0x15bc5e=_0x15bc5e||0xc8;return function(_0x67bd20){if(_0x67bd20){return _0x2e0106[_0xe720('0x1b')](_0x15bc5e)[_0xe720('0x1c')](_0x67bd20);}};}function respondWithFilteredResult(_0x211ddf,_0x4f9340){return function(_0x110663){if(_0x110663){var _0x55a3ab=typeof _0x4f9340[_0xe720('0x1d')]===_0xe720('0x1e')&&typeof _0x4f9340[_0xe720('0x1f')]==='undefined';var _0x264767=_0x110663['count'];var _0x4009f4=_0x55a3ab?0x0:_0x4f9340[_0xe720('0x1d')];var _0x199567=_0x55a3ab?_0x110663[_0xe720('0x20')]:_0x4f9340[_0xe720('0x1d')]+_0x4f9340[_0xe720('0x1f')];var _0x46cbc6;if(_0x199567>=_0x264767){_0x199567=_0x264767;_0x46cbc6=0xc8;}else{_0x46cbc6=0xce;}_0x211ddf[_0xe720('0x1b')](_0x46cbc6);return _0x211ddf[_0xe720('0x21')](_0xe720('0x22'),_0x4009f4+'-'+_0x199567+'/'+_0x264767)[_0xe720('0x1c')](_0x110663);}return null;};}function patchUpdates(_0x59b6d0){return function(_0x237e4b){try{jsonpatch[_0xe720('0x23')](_0x237e4b,_0x59b6d0,!![]);}catch(_0xbdbb05){return BPromise[_0xe720('0x24')](_0xbdbb05);}return _0x237e4b['save']();};}function saveUpdates(_0x423a75,_0x29b3c7){return function(_0x3284ef){if(_0x3284ef){return _0x3284ef[_0xe720('0x25')](_0x423a75)['then'](function(_0x2a115b){return _0x2a115b;});}return null;};}function removeEntity(_0x390e32,_0xd88d67){return function(_0x4aa468){if(_0x4aa468){return _0x4aa468[_0xe720('0x26')]()[_0xe720('0x27')](function(){_0x390e32[_0xe720('0x1b')](0xcc)[_0xe720('0x1a')]();});}};}function handleEntityNotFound(_0x33bc3e,_0x255ace){return function(_0x4d6091){if(!_0x4d6091){_0x33bc3e[_0xe720('0x28')](0x194);}return _0x4d6091;};}function handleError(_0x562d1c,_0x149820){_0x149820=_0x149820||0x1f4;return function(_0x3f0b2e){logger['error'](_0x3f0b2e[_0xe720('0x29')]);if(_0x3f0b2e[_0xe720('0x2a')]){delete _0x3f0b2e['name'];}_0x562d1c['status'](_0x149820)[_0xe720('0x2b')](_0x3f0b2e);};}exports[_0xe720('0x2c')]=function(_0x46a906,_0x5513d1){var _0x1fbdaf={},_0x323547={},_0x42111b={'count':0x0,'rows':[]};var _0x343f50=_[_0xe720('0x2d')](db[_0xe720('0x2e')][_0xe720('0x2f')],function(_0x335f22){return{'name':_0x335f22['fieldName'],'type':_0x335f22[_0xe720('0x30')][_0xe720('0x31')]};});_0x323547[_0xe720('0x32')]=_[_0xe720('0x2d')](_0x343f50,_0xe720('0x2a'));_0x323547[_0xe720('0x33')]=_['keys'](_0x46a906[_0xe720('0x33')]);_0x323547[_0xe720('0x34')]=_[_0xe720('0x35')](_0x323547[_0xe720('0x32')],_0x323547['query']);_0x1fbdaf['attributes']=_['intersection'](_0x323547[_0xe720('0x32')],qs['fields'](_0x46a906['query'][_0xe720('0x36')]));_0x1fbdaf['attributes']=_0x1fbdaf[_0xe720('0x37')][_0xe720('0x38')]?_0x1fbdaf[_0xe720('0x37')]:_0x323547[_0xe720('0x32')];if(!_0x46a906[_0xe720('0x33')][_0xe720('0x39')](_0xe720('0x3a'))){_0x1fbdaf[_0xe720('0x1f')]=qs[_0xe720('0x1f')](_0x46a906[_0xe720('0x33')][_0xe720('0x1f')]);_0x1fbdaf['offset']=qs[_0xe720('0x1d')](_0x46a906[_0xe720('0x33')][_0xe720('0x1d')]);}_0x1fbdaf[_0xe720('0x3b')]=qs['sort'](_0x46a906[_0xe720('0x33')][_0xe720('0x3c')]);_0x1fbdaf['where']=qs[_0xe720('0x34')](_[_0xe720('0x3d')](_0x46a906[_0xe720('0x33')],_0x323547[_0xe720('0x34')]),_0x343f50);if(_0x46a906[_0xe720('0x33')][_0xe720('0x3e')]){_0x1fbdaf[_0xe720('0x3f')]=_[_0xe720('0x40')](_0x1fbdaf[_0xe720('0x3f')],{'$or':_[_0xe720('0x2d')](_0x343f50,function(_0x136f39){if(_0x136f39[_0xe720('0x30')]!==_0xe720('0x41')){var _0xc90a71={};_0xc90a71[_0x136f39[_0xe720('0x2a')]]={'$like':'%'+_0x46a906[_0xe720('0x33')]['filter']+'%'};return _0xc90a71;}})});}_0x1fbdaf=_[_0xe720('0x40')]({},_0x1fbdaf,_0x46a906[_0xe720('0x42')]);var _0x16163f={'where':_0x1fbdaf[_0xe720('0x3f')]};return db[_0xe720('0x2e')]['count'](_0x16163f)[_0xe720('0x27')](function(_0x3b204b){_0x42111b['count']=_0x3b204b;if(_0x46a906[_0xe720('0x33')][_0xe720('0x43')]){_0x1fbdaf[_0xe720('0x44')]=[{'all':!![]}];}return db[_0xe720('0x2e')][_0xe720('0x45')](_0x1fbdaf);})[_0xe720('0x27')](function(_0x44eaca){_0x42111b[_0xe720('0x46')]=_0x44eaca;return _0x42111b;})[_0xe720('0x27')](respondWithFilteredResult(_0x5513d1,_0x1fbdaf))[_0xe720('0x47')](handleError(_0x5513d1,null));};exports['show']=function(_0x54cf99,_0x1a6822){var _0x51bd22={'raw':!![],'where':{'id':_0x54cf99['params']['id']}},_0x3941e7={};_0x3941e7['model']=_[_0xe720('0x48')](db[_0xe720('0x2e')][_0xe720('0x2f')]);_0x3941e7[_0xe720('0x33')]=_[_0xe720('0x48')](_0x54cf99[_0xe720('0x33')]);_0x3941e7['filters']=_[_0xe720('0x35')](_0x3941e7['model'],_0x3941e7[_0xe720('0x33')]);_0x51bd22[_0xe720('0x37')]=_['intersection'](_0x3941e7[_0xe720('0x32')],qs['fields'](_0x54cf99[_0xe720('0x33')][_0xe720('0x36')]));_0x51bd22['attributes']=_0x51bd22['attributes'][_0xe720('0x38')]?_0x51bd22[_0xe720('0x37')]:_0x3941e7['model'];if(_0x54cf99[_0xe720('0x33')][_0xe720('0x43')]){_0x51bd22[_0xe720('0x44')]=[{'all':!![]}];}_0x51bd22=_[_0xe720('0x40')]({},_0x51bd22,_0x54cf99[_0xe720('0x42')]);return db['DeskField'][_0xe720('0x49')](_0x51bd22)[_0xe720('0x27')](handleEntityNotFound(_0x1a6822,null))[_0xe720('0x27')](respondWithResult(_0x1a6822,null))[_0xe720('0x47')](handleError(_0x1a6822,null));};exports[_0xe720('0x4a')]=function(_0x697ecf,_0x461292){return db['DeskField']['create'](_0x697ecf[_0xe720('0x4b')],{})[_0xe720('0x27')](respondWithResult(_0x461292,0xc9))['catch'](handleError(_0x461292,null));};exports[_0xe720('0x25')]=function(_0x434fa1,_0x54d150){if(_0x434fa1[_0xe720('0x4b')]['id']){delete _0x434fa1[_0xe720('0x4b')]['id'];}return db[_0xe720('0x2e')][_0xe720('0x49')]({'where':{'id':_0x434fa1[_0xe720('0x4c')]['id']}})[_0xe720('0x27')](handleEntityNotFound(_0x54d150,null))[_0xe720('0x27')](saveUpdates(_0x434fa1['body'],null))['then'](respondWithResult(_0x54d150,null))[_0xe720('0x47')](handleError(_0x54d150,null));};exports['destroy']=function(_0x291723,_0x375ac8){return db[_0xe720('0x2e')][_0xe720('0x49')]({'where':{'id':_0x291723['params']['id']}})[_0xe720('0x27')](handleEntityNotFound(_0x375ac8,null))[_0xe720('0x27')](removeEntity(_0x375ac8,null))[_0xe720('0x47')](handleError(_0x375ac8,null));}; \ No newline at end of file +var _0xeb98=['util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','DeskField','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','rimraf','zip-dir','fast-json-patch','mustache'];(function(_0x3e151d,_0x5b96a8){var _0x10ad6a=function(_0x57fddf){while(--_0x57fddf){_0x3e151d['push'](_0x3e151d['shift']());}};_0x10ad6a(++_0x5b96a8);}(_0xeb98,0xe0));var _0x8eb9=function(_0x41dcda,_0x21e8cc){_0x41dcda=_0x41dcda-0x0;var _0x4b0e10=_0xeb98[_0x41dcda];return _0x4b0e10;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8eb9('0x0'));var zipdir=require(_0x8eb9('0x1'));var jsonpatch=require(_0x8eb9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8eb9('0x3'));var util=require(_0x8eb9('0x4'));var path=require(_0x8eb9('0x5'));var sox=require(_0x8eb9('0x6'));var csv=require('to-csv');var ejs=require(_0x8eb9('0x7'));var fs=require('fs');var fs_extra=require(_0x8eb9('0x8'));var _=require(_0x8eb9('0x9'));var squel=require('squel');var crypto=require(_0x8eb9('0xa'));var jsforce=require(_0x8eb9('0xb'));var deskjs=require(_0x8eb9('0xc'));var toCsv=require(_0x8eb9('0xd'));var querystring=require(_0x8eb9('0xe'));var Papa=require(_0x8eb9('0xf'));var Redis=require(_0x8eb9('0x10'));var authService=require(_0x8eb9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8eb9('0x12'));var hardwareService=require(_0x8eb9('0x13'));var logger=require(_0x8eb9('0x14'))('api');var utils=require(_0x8eb9('0x15'));var config=require(_0x8eb9('0x16'));var licenseUtil=require(_0x8eb9('0x17'));var db=require(_0x8eb9('0x18'))['db'];function respondWithStatusCode(_0x3b8697,_0x4f0a7e){_0x4f0a7e=_0x4f0a7e||0xcc;return function(_0x3f39b3){if(_0x3f39b3){return _0x3b8697[_0x8eb9('0x19')](_0x4f0a7e);}return _0x3b8697['status'](_0x4f0a7e)[_0x8eb9('0x1a')]();};}function respondWithResult(_0x2106c6,_0x1fe3ec){_0x1fe3ec=_0x1fe3ec||0xc8;return function(_0x45ca9c){if(_0x45ca9c){return _0x2106c6[_0x8eb9('0x1b')](_0x1fe3ec)[_0x8eb9('0x1c')](_0x45ca9c);}};}function respondWithFilteredResult(_0x192572,_0x4c46e7){return function(_0x1cacd2){if(_0x1cacd2){var _0x43f3a4=typeof _0x4c46e7['offset']===_0x8eb9('0x1d')&&typeof _0x4c46e7[_0x8eb9('0x1e')]===_0x8eb9('0x1d');var _0x483bc7=_0x1cacd2[_0x8eb9('0x1f')];var _0x647eec=_0x43f3a4?0x0:_0x4c46e7[_0x8eb9('0x20')];var _0x515114=_0x43f3a4?_0x1cacd2[_0x8eb9('0x1f')]:_0x4c46e7[_0x8eb9('0x20')]+_0x4c46e7[_0x8eb9('0x1e')];var _0x51e79b;if(_0x515114>=_0x483bc7){_0x515114=_0x483bc7;_0x51e79b=0xc8;}else{_0x51e79b=0xce;}_0x192572[_0x8eb9('0x1b')](_0x51e79b);return _0x192572[_0x8eb9('0x21')](_0x8eb9('0x22'),_0x647eec+'-'+_0x515114+'/'+_0x483bc7)[_0x8eb9('0x1c')](_0x1cacd2);}return null;};}function patchUpdates(_0x5c2591){return function(_0x19f43e){try{jsonpatch[_0x8eb9('0x23')](_0x19f43e,_0x5c2591,!![]);}catch(_0x8e4cac){return BPromise[_0x8eb9('0x24')](_0x8e4cac);}return _0x19f43e[_0x8eb9('0x25')]();};}function saveUpdates(_0x1a5570,_0x2e5258){return function(_0x11cd9c){if(_0x11cd9c){return _0x11cd9c[_0x8eb9('0x26')](_0x1a5570)[_0x8eb9('0x27')](function(_0x363abd){return _0x363abd;});}return null;};}function removeEntity(_0x565370,_0x4c3aad){return function(_0x180f48){if(_0x180f48){return _0x180f48[_0x8eb9('0x28')]()['then'](function(){_0x565370['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cea83,_0x1e80f4){return function(_0x4ab7ee){if(!_0x4ab7ee){_0x4cea83[_0x8eb9('0x19')](0x194);}return _0x4ab7ee;};}function handleError(_0x51da61,_0x20c57d){_0x20c57d=_0x20c57d||0x1f4;return function(_0x2a410){logger[_0x8eb9('0x29')](_0x2a410[_0x8eb9('0x2a')]);if(_0x2a410['name']){delete _0x2a410[_0x8eb9('0x2b')];}_0x51da61['status'](_0x20c57d)[_0x8eb9('0x2c')](_0x2a410);};}exports[_0x8eb9('0x2d')]=function(_0x432038,_0x25896c){var _0xc3896a={},_0x576421={},_0x5be067={'count':0x0,'rows':[]};var _0x132f8f=_['map'](db[_0x8eb9('0x2e')]['rawAttributes'],function(_0x382764){return{'name':_0x382764[_0x8eb9('0x2f')],'type':_0x382764[_0x8eb9('0x30')][_0x8eb9('0x31')]};});_0x576421['model']=_['map'](_0x132f8f,_0x8eb9('0x2b'));_0x576421[_0x8eb9('0x32')]=_[_0x8eb9('0x33')](_0x432038[_0x8eb9('0x32')]);_0x576421[_0x8eb9('0x34')]=_[_0x8eb9('0x35')](_0x576421[_0x8eb9('0x36')],_0x576421['query']);_0xc3896a[_0x8eb9('0x37')]=_[_0x8eb9('0x35')](_0x576421[_0x8eb9('0x36')],qs[_0x8eb9('0x38')](_0x432038['query'][_0x8eb9('0x38')]));_0xc3896a['attributes']=_0xc3896a[_0x8eb9('0x37')][_0x8eb9('0x39')]?_0xc3896a[_0x8eb9('0x37')]:_0x576421['model'];if(!_0x432038[_0x8eb9('0x32')][_0x8eb9('0x3a')]('nolimit')){_0xc3896a['limit']=qs[_0x8eb9('0x1e')](_0x432038['query']['limit']);_0xc3896a[_0x8eb9('0x20')]=qs[_0x8eb9('0x20')](_0x432038[_0x8eb9('0x32')][_0x8eb9('0x20')]);}_0xc3896a['order']=qs[_0x8eb9('0x3b')](_0x432038[_0x8eb9('0x32')][_0x8eb9('0x3b')]);_0xc3896a[_0x8eb9('0x3c')]=qs['filters'](_[_0x8eb9('0x3d')](_0x432038[_0x8eb9('0x32')],_0x576421[_0x8eb9('0x34')]),_0x132f8f);if(_0x432038[_0x8eb9('0x32')][_0x8eb9('0x3e')]){_0xc3896a[_0x8eb9('0x3c')]=_[_0x8eb9('0x3f')](_0xc3896a[_0x8eb9('0x3c')],{'$or':_[_0x8eb9('0x40')](_0x132f8f,function(_0x557a52){if(_0x557a52[_0x8eb9('0x30')]!==_0x8eb9('0x41')){var _0xaf114e={};_0xaf114e[_0x557a52[_0x8eb9('0x2b')]]={'$like':'%'+_0x432038[_0x8eb9('0x32')]['filter']+'%'};return _0xaf114e;}})});}_0xc3896a=_[_0x8eb9('0x3f')]({},_0xc3896a,_0x432038[_0x8eb9('0x42')]);var _0x4365d5={'where':_0xc3896a[_0x8eb9('0x3c')]};return db[_0x8eb9('0x2e')][_0x8eb9('0x1f')](_0x4365d5)[_0x8eb9('0x27')](function(_0x3e814e){_0x5be067[_0x8eb9('0x1f')]=_0x3e814e;if(_0x432038['query'][_0x8eb9('0x43')]){_0xc3896a[_0x8eb9('0x44')]=[{'all':!![]}];}return db[_0x8eb9('0x2e')]['findAll'](_0xc3896a);})[_0x8eb9('0x27')](function(_0x311f76){_0x5be067[_0x8eb9('0x45')]=_0x311f76;return _0x5be067;})[_0x8eb9('0x27')](respondWithFilteredResult(_0x25896c,_0xc3896a))[_0x8eb9('0x46')](handleError(_0x25896c,null));};exports['show']=function(_0x3875cd,_0xa8bf49){var _0x29be00={'raw':!![],'where':{'id':_0x3875cd[_0x8eb9('0x47')]['id']}},_0xc5e561={};_0xc5e561[_0x8eb9('0x36')]=_[_0x8eb9('0x33')](db[_0x8eb9('0x2e')][_0x8eb9('0x48')]);_0xc5e561[_0x8eb9('0x32')]=_[_0x8eb9('0x33')](_0x3875cd[_0x8eb9('0x32')]);_0xc5e561['filters']=_[_0x8eb9('0x35')](_0xc5e561['model'],_0xc5e561[_0x8eb9('0x32')]);_0x29be00[_0x8eb9('0x37')]=_[_0x8eb9('0x35')](_0xc5e561[_0x8eb9('0x36')],qs[_0x8eb9('0x38')](_0x3875cd['query'][_0x8eb9('0x38')]));_0x29be00['attributes']=_0x29be00[_0x8eb9('0x37')]['length']?_0x29be00[_0x8eb9('0x37')]:_0xc5e561[_0x8eb9('0x36')];if(_0x3875cd['query'][_0x8eb9('0x43')]){_0x29be00[_0x8eb9('0x44')]=[{'all':!![]}];}_0x29be00=_['merge']({},_0x29be00,_0x3875cd[_0x8eb9('0x42')]);return db[_0x8eb9('0x2e')][_0x8eb9('0x49')](_0x29be00)[_0x8eb9('0x27')](handleEntityNotFound(_0xa8bf49,null))[_0x8eb9('0x27')](respondWithResult(_0xa8bf49,null))[_0x8eb9('0x46')](handleError(_0xa8bf49,null));};exports[_0x8eb9('0x4a')]=function(_0x45227a,_0x2816d2){return db[_0x8eb9('0x2e')][_0x8eb9('0x4a')](_0x45227a[_0x8eb9('0x4b')],{})[_0x8eb9('0x27')](respondWithResult(_0x2816d2,0xc9))[_0x8eb9('0x46')](handleError(_0x2816d2,null));};exports[_0x8eb9('0x26')]=function(_0x2653a1,_0x1d140a){if(_0x2653a1[_0x8eb9('0x4b')]['id']){delete _0x2653a1[_0x8eb9('0x4b')]['id'];}return db['DeskField'][_0x8eb9('0x49')]({'where':{'id':_0x2653a1[_0x8eb9('0x47')]['id']}})[_0x8eb9('0x27')](handleEntityNotFound(_0x1d140a,null))[_0x8eb9('0x27')](saveUpdates(_0x2653a1['body'],null))['then'](respondWithResult(_0x1d140a,null))['catch'](handleError(_0x1d140a,null));};exports['destroy']=function(_0x4187be,_0x4ec711){return db[_0x8eb9('0x2e')][_0x8eb9('0x49')]({'where':{'id':_0x4187be['params']['id']}})[_0x8eb9('0x27')](handleEntityNotFound(_0x4ec711,null))[_0x8eb9('0x27')](removeEntity(_0x4ec711,null))[_0x8eb9('0x46')](handleError(_0x4ec711,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 4dd74ed..fb031c5 100644 --- a/server/api/intDeskField/intDeskField.model.js +++ b/server/api/intDeskField/intDeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa14a=['path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','idField','lodash','../../config/logger','api','moment','request-promise'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xa14a,0xe9));var _0xaa14=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xa14a[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0xaa14('0x0'));var util=require('util');var logger=require(_0xaa14('0x1'))(_0xaa14('0x2'));var moment=require(_0xaa14('0x3'));var BPromise=require('bluebird');var rp=require(_0xaa14('0x4'));var fs=require('fs');var path=require(_0xaa14('0x5'));var rimraf=require(_0xaa14('0x6'));var config=require(_0xaa14('0x7'));var attributes=require(_0xaa14('0x8'));module[_0xaa14('0x9')]=function(_0x3b71b2,_0x120c51){return _0x3b71b2[_0xaa14('0xa')](_0xaa14('0xb'),attributes,{'tableName':_0xaa14('0xc'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xaa14('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2d0d=['define','int_desk_fields','desk_unique_index','FieldId','util','api','moment','bluebird','request-promise','path','../../config/environment','./intDeskField.attributes','exports'];(function(_0x30a6f4,_0x36ec40){var _0x2b3a92=function(_0x5cbccc){while(--_0x5cbccc){_0x30a6f4['push'](_0x30a6f4['shift']());}};_0x2b3a92(++_0x36ec40);}(_0x2d0d,0x1f2));var _0xd2d0=function(_0x55fa03,_0xcb96c2){_0x55fa03=_0x55fa03-0x0;var _0x2cd7cd=_0x2d0d[_0x55fa03];return _0x2cd7cd;};'use strict';var _=require('lodash');var util=require(_0xd2d0('0x0'));var logger=require('../../config/logger')(_0xd2d0('0x1'));var moment=require(_0xd2d0('0x2'));var BPromise=require(_0xd2d0('0x3'));var rp=require(_0xd2d0('0x4'));var fs=require('fs');var path=require(_0xd2d0('0x5'));var rimraf=require('rimraf');var config=require(_0xd2d0('0x6'));var attributes=require(_0xd2d0('0x7'));module[_0xd2d0('0x8')]=function(_0x1beaa0,_0x41b5e9){return _0x1beaa0[_0xd2d0('0x9')]('DeskField',attributes,{'tableName':_0xd2d0('0xa'),'paranoid':![],'indexes':[{'name':_0xd2d0('0xb'),'fields':['idField',_0xd2d0('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 4e4a0c6..c12c0a7 100644 --- a/server/api/intDeskField/intDeskField.rpc.js +++ b/server/api/intDeskField/intDeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c2a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x372731,_0x1fc3e8){var _0x37dca6=function(_0x12e4d4){while(--_0x12e4d4){_0x372731['push'](_0x372731['shift']());}};_0x37dca6(++_0x1fc3e8);}(_0x2c2a,0x199));var _0xa2c2=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2c2a[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xa2c2('0x0'));var util=require('util');var moment=require(_0xa2c2('0x1'));var BPromise=require(_0xa2c2('0x2'));var rs=require(_0xa2c2('0x3'));var fs=require('fs');var Redis=require(_0xa2c2('0x4'));var db=require(_0xa2c2('0x5'))['db'];var utils=require(_0xa2c2('0x6'));var logger=require(_0xa2c2('0x7'))(_0xa2c2('0x8'));var config=require(_0xa2c2('0x9'));var jayson=require(_0xa2c2('0xa'));var client=jayson[_0xa2c2('0xb')][_0xa2c2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5dc214,_0x1afde3,_0x27f93f){return new BPromise(function(_0x2f2181,_0x385b9e){return client[_0xa2c2('0xd')](_0x5dc214,_0x27f93f)['then'](function(_0x1561ad){logger['info'](_0xa2c2('0xe'),_0x1afde3,_0xa2c2('0xf'));logger[_0xa2c2('0x10')]('DeskField,\x20%s,\x20%s,\x20%s',_0x1afde3,_0xa2c2('0xf'),JSON[_0xa2c2('0x11')](_0x1561ad));if(_0x1561ad[_0xa2c2('0x12')]){if(_0x1561ad[_0xa2c2('0x12')]['code']===0x1f4){logger[_0xa2c2('0x12')](_0xa2c2('0xe'),_0x1afde3,_0x1561ad['error'][_0xa2c2('0x13')]);return _0x385b9e(_0x1561ad[_0xa2c2('0x12')][_0xa2c2('0x13')]);}logger[_0xa2c2('0x12')](_0xa2c2('0xe'),_0x1afde3,_0x1561ad[_0xa2c2('0x12')][_0xa2c2('0x13')]);return _0x2f2181(_0x1561ad[_0xa2c2('0x12')][_0xa2c2('0x13')]);}else{logger[_0xa2c2('0x14')](_0xa2c2('0xe'),_0x1afde3,_0xa2c2('0xf'));_0x2f2181(_0x1561ad[_0xa2c2('0x15')][_0xa2c2('0x13')]);}})[_0xa2c2('0x16')](function(_0x396086){logger[_0xa2c2('0x12')]('DeskField,\x20%s,\x20%s',_0x1afde3,_0x396086);_0x385b9e(_0x396086);});});} \ No newline at end of file +var _0xeded=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','DeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message'];(function(_0x430524,_0x23b611){var _0x3a726d=function(_0x5cc39d){while(--_0x5cc39d){_0x430524['push'](_0x430524['shift']());}};_0x3a726d(++_0x23b611);}(_0xeded,0x128));var _0xdede=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeded[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xdede('0x0'));var util=require(_0xdede('0x1'));var moment=require('moment');var BPromise=require(_0xdede('0x2'));var rs=require(_0xdede('0x3'));var fs=require('fs');var Redis=require(_0xdede('0x4'));var db=require(_0xdede('0x5'))['db'];var utils=require(_0xdede('0x6'));var logger=require(_0xdede('0x7'))(_0xdede('0x8'));var config=require(_0xdede('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdede('0xa')][_0xdede('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c694f,_0x54eef7,_0x45798f){return new BPromise(function(_0x3da2af,_0x32c7fb){return client['request'](_0x1c694f,_0x45798f)['then'](function(_0x5097e5){logger['info'](_0xdede('0xc'),_0x54eef7,'request\x20sent');logger[_0xdede('0xd')]('DeskField,\x20%s,\x20%s,\x20%s',_0x54eef7,_0xdede('0xe'),JSON[_0xdede('0xf')](_0x5097e5));if(_0x5097e5['error']){if(_0x5097e5['error'][_0xdede('0x10')]===0x1f4){logger[_0xdede('0x11')]('DeskField,\x20%s,\x20%s',_0x54eef7,_0x5097e5[_0xdede('0x11')][_0xdede('0x12')]);return _0x32c7fb(_0x5097e5[_0xdede('0x11')]['message']);}logger['error'](_0xdede('0xc'),_0x54eef7,_0x5097e5[_0xdede('0x11')]['message']);return _0x3da2af(_0x5097e5['error'][_0xdede('0x12')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x54eef7,'request\x20sent');_0x3da2af(_0x5097e5[_0xdede('0x13')][_0xdede('0x12')]);}})[_0xdede('0x14')](function(_0x1f6872){logger[_0xdede('0x11')](_0xdede('0xc'),_0x54eef7,_0x1f6872);_0x32c7fb(_0x1f6872);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index d4ae2f5..531e0af 100644 --- a/server/api/intDynamics365Account/index.js +++ b/server/api/intDynamics365Account/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc336=['../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','getFields','create','post','/:id/configurations','addConfiguration','put','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc336,0x144));var _0x6c33=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0xc336[_0x202c61];return _0x540691;};'use strict';var multer=require(_0x6c33('0x0'));var util=require('util');var path=require(_0x6c33('0x1'));var timeout=require(_0x6c33('0x2'));var express=require(_0x6c33('0x3'));var router=express['Router']();var fs_extra=require(_0x6c33('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6c33('0x5'));var config=require(_0x6c33('0x6'));var controller=require(_0x6c33('0x7'));router[_0x6c33('0x8')]('/',auth[_0x6c33('0x9')](),controller[_0x6c33('0xa')]);router[_0x6c33('0x8')](_0x6c33('0xb'),auth[_0x6c33('0x9')](),controller[_0x6c33('0xc')]);router[_0x6c33('0x8')]('/:id/configurations',auth[_0x6c33('0x9')](),controller['getConfigurations']);router[_0x6c33('0x8')]('/:id/fields',auth[_0x6c33('0x9')](),controller[_0x6c33('0xd')]);router['post']('/',auth[_0x6c33('0x9')](),controller[_0x6c33('0xe')]);router[_0x6c33('0xf')](_0x6c33('0x10'),auth['isAuthenticated'](),controller[_0x6c33('0x11')]);router[_0x6c33('0x12')]('/:id',auth[_0x6c33('0x9')](),controller[_0x6c33('0x13')]);router['delete'](_0x6c33('0xb'),auth['isAuthenticated'](),controller[_0x6c33('0x14')]);module[_0x6c33('0x15')]=router; \ No newline at end of file +var _0x3e0a=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','post','create','put','update','destroy','exports','path','connect-timeout','express'];(function(_0x29beb6,_0x282503){var _0xcfac88=function(_0x97222e){while(--_0x97222e){_0x29beb6['push'](_0x29beb6['shift']());}};_0xcfac88(++_0x282503);}(_0x3e0a,0x18c));var _0xa3e0=function(_0x38a3d6,_0x52e305){_0x38a3d6=_0x38a3d6-0x0;var _0x3768d7=_0x3e0a[_0x38a3d6];return _0x3768d7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa3e0('0x0'));var timeout=require(_0xa3e0('0x1'));var express=require(_0xa3e0('0x2'));var router=express[_0xa3e0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa3e0('0x4'));var interaction=require(_0xa3e0('0x5'));var config=require(_0xa3e0('0x6'));var controller=require(_0xa3e0('0x7'));router[_0xa3e0('0x8')]('/',auth[_0xa3e0('0x9')](),controller[_0xa3e0('0xa')]);router['get'](_0xa3e0('0xb'),auth[_0xa3e0('0x9')](),controller['show']);router[_0xa3e0('0x8')](_0xa3e0('0xc'),auth[_0xa3e0('0x9')](),controller[_0xa3e0('0xd')]);router['get']('/:id/fields',auth[_0xa3e0('0x9')](),controller[_0xa3e0('0xe')]);router[_0xa3e0('0xf')]('/',auth[_0xa3e0('0x9')](),controller[_0xa3e0('0x10')]);router[_0xa3e0('0xf')](_0xa3e0('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xa3e0('0x11')](_0xa3e0('0xb'),auth[_0xa3e0('0x9')](),controller[_0xa3e0('0x12')]);router['delete'](_0xa3e0('0xb'),auth['isAuthenticated'](),controller[_0xa3e0('0x13')]);module[_0xa3e0('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index a997f32..3b00cc0 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.attributes.js +++ b/server/api/intDynamics365Account/intDynamics365Account.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4553=['STRING','BOOLEAN','exports'];(function(_0x4d0353,_0x3fe980){var _0x1a0580=function(_0xa0b55a){while(--_0xa0b55a){_0x4d0353['push'](_0x4d0353['shift']());}};_0x1a0580(++_0x3fe980);}(_0x4553,0x1be));var _0x3455=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x4553[_0x1b5aea];return _0x15cfc6;};'use strict';var Sequelize=require('sequelize');module[_0x3455('0x0')]={'name':{'type':Sequelize[_0x3455('0x1')]},'username':{'type':Sequelize[_0x3455('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x3455('0x1')]},'clientId':{'type':Sequelize[_0x3455('0x1')]},'clientSecret':{'type':Sequelize[_0x3455('0x1')]},'serverUrl':{'type':Sequelize[_0x3455('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3455('0x1')]},'modernAuthentication':{'type':Sequelize[_0x3455('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2b83=['STRING','exports'];(function(_0x4e2eea,_0x3781b8){var _0x3973b3=function(_0x4f11be){while(--_0x4f11be){_0x4e2eea['push'](_0x4e2eea['shift']());}};_0x3973b3(++_0x3781b8);}(_0x2b83,0x1d3));var _0x32b8=function(_0x3fcf38,_0x521826){_0x3fcf38=_0x3fcf38-0x0;var _0xd7594=_0x2b83[_0x3fcf38];return _0xd7594;};'use strict';var Sequelize=require('sequelize');module[_0x32b8('0x0')]={'name':{'type':Sequelize[_0x32b8('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x32b8('0x1')]},'remoteUri':{'type':Sequelize[_0x32b8('0x1')]},'tenantId':{'type':Sequelize[_0x32b8('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x32b8('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x32b8('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index a6773fb..5c4fa01 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.controller.js +++ b/server/api/intDynamics365Account/intDynamics365Account.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb49e=['filter','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','update','getConfigurations','Dynamics365Configuration','merge','options','findOne','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','customerid','ownerid','caseorigincode','subject','phonenumber','phonecall_activity_parties','accountidyominame','actualserviceunits','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','emailaddress','entitlementidname','exchangerate','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyname','modifiedon','modifiedonbehalfbyname','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responsiblecontactidname','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientSecret','CloudProvider','data5','data7','modernAuthentication','access_token','POST','/oauth2/token','clientId','GET','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','LogicalName','@odata.type','PicklistAttributeMetadata','push','forEach','BooleanAttributeMetadata','all','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode','stack','Wrong\x20credentials',')/Attributes(','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','limit','undefined','count','set','Content-Range','then','destroy','end','sendStatus','error','name','send','index','Dynamics365Account','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type'];(function(_0x5a3126,_0x46cdad){var _0x2eb593=function(_0x165981){while(--_0x165981){_0x5a3126['push'](_0x5a3126['shift']());}};_0x2eb593(++_0x46cdad);}(_0xb49e,0x84));var _0xeb49=function(_0x5e7bed,_0x2a3ea7){_0x5e7bed=_0x5e7bed-0x0;var _0x5b492e=_0xb49e[_0x5e7bed];return _0x5b492e;};'use strict';var rp=require(_0xeb49('0x0'));var util=require(_0xeb49('0x1'));var _=require(_0xeb49('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0xeb49('0x3'))(_0xeb49('0x4'));var db=require(_0xeb49('0x5'))['db'];var integrations=require(_0xeb49('0x6'));function respondWithResult(_0x258d16,_0x4715d9){_0x4715d9=_0x4715d9||0xc8;return function(_0x2232a6){if(_0x2232a6){return _0x258d16[_0xeb49('0x7')](_0x4715d9)[_0xeb49('0x8')](_0x2232a6);}};}function respondWithFilteredResult(_0x2be28c,_0x1a6e30){return function(_0x366b45){if(_0x366b45){var _0x12973c=typeof _0x1a6e30[_0xeb49('0x9')]==='undefined'&&typeof _0x1a6e30[_0xeb49('0xa')]===_0xeb49('0xb');var _0x120b5f=_0x366b45[_0xeb49('0xc')];var _0x383293=_0x12973c?0x0:_0x1a6e30[_0xeb49('0x9')];var _0x339113=_0x12973c?_0x366b45[_0xeb49('0xc')]:_0x1a6e30[_0xeb49('0x9')]+_0x1a6e30[_0xeb49('0xa')];var _0x1f2e84;if(_0x339113>=_0x120b5f){_0x339113=_0x120b5f;_0x1f2e84=0xc8;}else{_0x1f2e84=0xce;}_0x2be28c[_0xeb49('0x7')](_0x1f2e84);return _0x2be28c[_0xeb49('0xd')](_0xeb49('0xe'),_0x383293+'-'+_0x339113+'/'+_0x120b5f)[_0xeb49('0x8')](_0x366b45);}return null;};}function saveUpdates(_0x2a973d){return function(_0x91cbbb){if(_0x91cbbb){return _0x91cbbb['update'](_0x2a973d)[_0xeb49('0xf')](function(_0xe95367){return _0xe95367;});}return null;};}function removeEntity(_0x5a18d6){return function(_0x596612){if(_0x596612){return _0x596612[_0xeb49('0x10')]()[_0xeb49('0xf')](function(){_0x5a18d6[_0xeb49('0x7')](0xcc)[_0xeb49('0x11')]();});}};}function handleEntityNotFound(_0x2cee27){return function(_0x3ca756){if(!_0x3ca756){_0x2cee27[_0xeb49('0x12')](0x194);}return _0x3ca756;};}function handleError(_0x520da9,_0x10ad5d){_0x10ad5d=_0x10ad5d||0x1f4;return function(_0x1ea69f){logger[_0xeb49('0x13')](_0x1ea69f['stack']);if(_0x1ea69f[_0xeb49('0x14')]){delete _0x1ea69f[_0xeb49('0x14')];}_0x520da9[_0xeb49('0x7')](_0x10ad5d)[_0xeb49('0x15')](_0x1ea69f);};}exports[_0xeb49('0x16')]=function(_0x1bff6d,_0x8357c9){var _0x13c6eb={},_0x4d2628={},_0x1baafa={'count':0x0,'rows':[]};var _0x46f8d9=_['map'](db[_0xeb49('0x17')]['rawAttributes'],function(_0x492063){return{'name':_0x492063[_0xeb49('0x18')],'type':_0x492063['type'][_0xeb49('0x19')]};});_0x4d2628[_0xeb49('0x1a')]=_[_0xeb49('0x1b')](_0x46f8d9,'name');_0x4d2628[_0xeb49('0x1c')]=_[_0xeb49('0x1d')](_0x1bff6d['query']);_0x4d2628[_0xeb49('0x1e')]=_[_0xeb49('0x1f')](_0x4d2628['model'],_0x4d2628[_0xeb49('0x1c')]);_0x13c6eb[_0xeb49('0x20')]=_[_0xeb49('0x1f')](_0x4d2628['model'],qs[_0xeb49('0x21')](_0x1bff6d[_0xeb49('0x1c')][_0xeb49('0x21')]));_0x13c6eb[_0xeb49('0x20')]=_0x13c6eb[_0xeb49('0x20')][_0xeb49('0x22')]?_0x13c6eb['attributes']:_0x4d2628['model'];if(!_0x1bff6d[_0xeb49('0x1c')][_0xeb49('0x23')](_0xeb49('0x24'))){_0x13c6eb[_0xeb49('0xa')]=qs[_0xeb49('0xa')](_0x1bff6d[_0xeb49('0x1c')][_0xeb49('0xa')]);_0x13c6eb[_0xeb49('0x9')]=qs[_0xeb49('0x9')](_0x1bff6d[_0xeb49('0x1c')][_0xeb49('0x9')]);}_0x13c6eb[_0xeb49('0x25')]=qs[_0xeb49('0x26')](_0x1bff6d['query'][_0xeb49('0x26')]);_0x13c6eb[_0xeb49('0x27')]=qs[_0xeb49('0x1e')](_[_0xeb49('0x28')](_0x1bff6d['query'],_0x4d2628['filters']),_0x46f8d9);if(_0x1bff6d[_0xeb49('0x1c')]['filter']){_0x13c6eb[_0xeb49('0x27')]=_['merge'](_0x13c6eb[_0xeb49('0x27')],{'$or':_['map'](_0x46f8d9,function(_0x3d47f4){if(_0x3d47f4[_0xeb49('0x29')]!=='VIRTUAL'){var _0x551636={};_0x551636[_0x3d47f4[_0xeb49('0x14')]]={'$like':'%'+_0x1bff6d[_0xeb49('0x1c')][_0xeb49('0x2a')]+'%'};return _0x551636;}})});}_0x13c6eb=_['merge']({},_0x13c6eb,_0x1bff6d['options']);var _0x7c2cc2={'where':_0x13c6eb[_0xeb49('0x27')]};return db[_0xeb49('0x17')][_0xeb49('0xc')](_0x7c2cc2)[_0xeb49('0xf')](function(_0x50999a){_0x1baafa['count']=_0x50999a;if(_0x1bff6d['query'][_0xeb49('0x2b')]){_0x13c6eb['include']=[{'all':!![]}];}return db[_0xeb49('0x17')][_0xeb49('0x2c')](_0x13c6eb);})[_0xeb49('0xf')](function(_0x5e4964){_0x1baafa[_0xeb49('0x2d')]=_0x5e4964;return _0x1baafa;})[_0xeb49('0xf')](respondWithFilteredResult(_0x8357c9,_0x13c6eb))[_0xeb49('0x2e')](handleError(_0x8357c9,null));};exports['show']=function(_0x557c8e,_0xd06a83){var _0xe4fda2={'raw':![],'where':{'id':_0x557c8e[_0xeb49('0x2f')]['id']}},_0x199415={};_0x199415[_0xeb49('0x1a')]=_[_0xeb49('0x1d')](db[_0xeb49('0x17')][_0xeb49('0x30')]);_0x199415[_0xeb49('0x1c')]=_[_0xeb49('0x1d')](_0x557c8e['query']);_0x199415[_0xeb49('0x1e')]=_[_0xeb49('0x1f')](_0x199415[_0xeb49('0x1a')],_0x199415['query']);_0xe4fda2[_0xeb49('0x20')]=_['intersection'](_0x199415[_0xeb49('0x1a')],qs['fields'](_0x557c8e['query'][_0xeb49('0x21')]));_0xe4fda2['attributes']=_0xe4fda2[_0xeb49('0x20')][_0xeb49('0x22')]?_0xe4fda2[_0xeb49('0x20')]:_0x199415['model'];if(_0x557c8e[_0xeb49('0x1c')][_0xeb49('0x2b')]){_0xe4fda2[_0xeb49('0x31')]=[{'all':!![]}];}_0xe4fda2=_['merge']({},_0xe4fda2,_0x557c8e['options']);return db[_0xeb49('0x17')][_0xeb49('0x32')](_0xe4fda2)[_0xeb49('0xf')](handleEntityNotFound(_0xd06a83,null))['then'](respondWithResult(_0xd06a83,null))[_0xeb49('0x2e')](handleError(_0xd06a83,null));};exports[_0xeb49('0x33')]=function(_0x5ea88f,_0x5131ad){return db[_0xeb49('0x17')][_0xeb49('0x33')](_0x5ea88f[_0xeb49('0x34')],{})[_0xeb49('0xf')](respondWithResult(_0x5131ad,0xc9))['catch'](handleError(_0x5131ad,null));};exports[_0xeb49('0x35')]=function(_0x2a8008,_0x5de81c){if(_0x2a8008[_0xeb49('0x34')]['id']){delete _0x2a8008[_0xeb49('0x34')]['id'];}return db[_0xeb49('0x17')]['find']({'where':{'id':_0x2a8008[_0xeb49('0x2f')]['id']}})[_0xeb49('0xf')](handleEntityNotFound(_0x5de81c,null))[_0xeb49('0xf')](saveUpdates(_0x2a8008[_0xeb49('0x34')],null))['then'](respondWithResult(_0x5de81c,null))[_0xeb49('0x2e')](handleError(_0x5de81c,null));};exports[_0xeb49('0x10')]=function(_0x52fa0e,_0xd875dd){return db[_0xeb49('0x17')][_0xeb49('0x32')]({'where':{'id':_0x52fa0e['params']['id']}})[_0xeb49('0xf')](handleEntityNotFound(_0xd875dd,null))[_0xeb49('0xf')](removeEntity(_0xd875dd,null))[_0xeb49('0x2e')](handleError(_0xd875dd,null));};exports[_0xeb49('0x36')]=function(_0x26ad13,_0x48ab48){var _0x21b553={};var _0x40b6b5={};var _0x5eac45;var _0x7c46ea;return db['Dynamics365Account']['findOne']({'where':{'id':_0x26ad13[_0xeb49('0x2f')]['id']}})[_0xeb49('0xf')](handleEntityNotFound(_0x48ab48,null))[_0xeb49('0xf')](function(_0x4b3954){if(_0x4b3954){_0x5eac45=_0x4b3954;_0x40b6b5['model']=_[_0xeb49('0x1d')](db[_0xeb49('0x37')][_0xeb49('0x30')]);_0x40b6b5[_0xeb49('0x1c')]=_[_0xeb49('0x1d')](_0x26ad13['query']);_0x40b6b5['filters']=_['intersection'](_0x40b6b5[_0xeb49('0x1a')],_0x40b6b5[_0xeb49('0x1c')]);_0x21b553[_0xeb49('0x20')]=_[_0xeb49('0x1f')](_0x40b6b5[_0xeb49('0x1a')],qs[_0xeb49('0x21')](_0x26ad13[_0xeb49('0x1c')]['fields']));_0x21b553[_0xeb49('0x20')]=_0x21b553[_0xeb49('0x20')]['length']?_0x21b553[_0xeb49('0x20')]:_0x40b6b5[_0xeb49('0x1a')];_0x21b553[_0xeb49('0x25')]=qs[_0xeb49('0x26')](_0x26ad13['query']['sort']);_0x21b553[_0xeb49('0x27')]=qs['filters'](_[_0xeb49('0x28')](_0x26ad13[_0xeb49('0x1c')],_0x40b6b5[_0xeb49('0x1e')]));if(_0x26ad13['query'][_0xeb49('0x2a')]){_0x21b553[_0xeb49('0x27')]=_[_0xeb49('0x38')](_0x21b553[_0xeb49('0x27')],{'$or':_[_0xeb49('0x1b')](_0x21b553[_0xeb49('0x20')],function(_0x58ab73){var _0x37e168={};_0x37e168[_0x58ab73]={'$like':'%'+_0x26ad13[_0xeb49('0x1c')]['filter']+'%'};return _0x37e168;})});}_0x21b553=_[_0xeb49('0x38')]({},_0x21b553,_0x26ad13[_0xeb49('0x39')]);return _0x5eac45['getConfigurations'](_0x21b553);}})[_0xeb49('0xf')](function(_0x59c6a3){if(_0x59c6a3){_0x7c46ea=_0x59c6a3['length'];if(!_0x26ad13['query'][_0xeb49('0x23')](_0xeb49('0x24'))){_0x21b553[_0xeb49('0xa')]=qs[_0xeb49('0xa')](_0x26ad13[_0xeb49('0x1c')][_0xeb49('0xa')]);_0x21b553[_0xeb49('0x9')]=qs[_0xeb49('0x9')](_0x26ad13[_0xeb49('0x1c')][_0xeb49('0x9')]);}return _0x5eac45['getConfigurations'](_0x21b553);}})['then'](function(_0x1ec832){if(_0x1ec832){return _0x1ec832?{'count':_0x7c46ea,'rows':_0x1ec832}:null;}})['then'](respondWithResult(_0x48ab48,null))[_0xeb49('0x2e')](handleError(_0x48ab48,null));};exports['addConfiguration']=function(_0x1072c9,_0x3efe22){if(_0x1072c9[_0xeb49('0x34')]['id']){delete _0x1072c9[_0xeb49('0x34')]['id'];}return db[_0xeb49('0x17')][_0xeb49('0x3a')]({'where':{'id':_0x1072c9[_0xeb49('0x2f')]['id']}})[_0xeb49('0xf')](handleEntityNotFound(_0x3efe22,null))[_0xeb49('0xf')](function(_0x199653){if(_0x199653){_0x1072c9[_0xeb49('0x34')]['AccountId']=_0x199653['id'];_0x1072c9['body'][_0xeb49('0x3b')]=integrations[_0xeb49('0x3c')](_0x1072c9[_0xeb49('0x34')]['channel'],_0x1072c9[_0xeb49('0x34')][_0xeb49('0x29')]);_0x1072c9[_0xeb49('0x34')][_0xeb49('0x3d')]=integrations[_0xeb49('0x3e')](_0x1072c9['body'][_0xeb49('0x3f')],_0x1072c9['body'][_0xeb49('0x29')]);return db[_0xeb49('0x37')][_0xeb49('0x33')](_0x1072c9['body'],{'include':[{'model':db[_0xeb49('0x40')],'as':_0xeb49('0x3b')},{'model':db[_0xeb49('0x40')],'as':_0xeb49('0x3d')}]});}return null;})[_0xeb49('0xf')](respondWithResult(_0x3efe22,null))[_0xeb49('0x2e')](handleError(_0x3efe22,null));};function sanitizeRemoteUri(_0x5a87af){var _0x5e813f=_0x5a87af['slice'](-0x1);if(_0x5e813f==='/')return _0x5a87af[_0xeb49('0x41')](0x0,_0x5a87af[_0xeb49('0x42')](_0x5e813f));return _0x5a87af;}function getWebApiUrl(_0x50afc3){return util[_0xeb49('0x43')](_0xeb49('0x44'),_0x50afc3);}exports[_0xeb49('0x45')]=function(_0x19b6ce,_0x54f329){var _0x4ef48e=_0x19b6ce['query'][_0xeb49('0x46')];var _0x40aeb2=_0x4ef48e===_0xeb49('0x47')?_0xeb49('0x48'):_0xeb49('0x49');var _0x3988c8='';var _0x26645f='';var _0x5c06ac='';var _0x563604='';var _0x59796d='';var _0x21a36f='';var _0x53fbd2='';var _0x58b4ba='';var _0x34498d=['title','description',_0xeb49('0x4a'),_0xeb49('0x4b'),_0xeb49('0x4c'),_0xeb49('0x4d'),_0xeb49('0x4e'),'regardingobjectid','directioncode',_0xeb49('0x4f')];var _0xe86771=['accountidname',_0xeb49('0x50'),_0xeb49('0x51'),'billedserviceunits','contactidname',_0xeb49('0x52'),'contractdetailidname',_0xeb49('0x53'),_0xeb49('0x54'),_0xeb49('0x55'),_0xeb49('0x56'),_0xeb49('0x57'),'createdon',_0xeb49('0x58'),'createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame',_0xeb49('0x59'),_0xeb49('0x5a'),'entityimage_timestamp','entityimage_url','escalatedon',_0xeb49('0x5b'),'firstresponsebykpiidname',_0xeb49('0x5c'),'importsequencenumber',_0xeb49('0x5d'),_0xeb49('0x5e'),_0xeb49('0x5f'),_0xeb49('0x60'),'modifiedbyexternalpartyname','modifiedbyexternalpartyyominame',_0xeb49('0x61'),'modifiedbyyominame',_0xeb49('0x62'),_0xeb49('0x63'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0xeb49('0x64'),'numberofchildincidents',_0xeb49('0x65'),_0xeb49('0x66'),_0xeb49('0x67'),_0xeb49('0x68'),_0xeb49('0x69'),_0xeb49('0x6a'),_0xeb49('0x6b'),_0xeb49('0x6c'),_0xeb49('0x6d'),_0xeb49('0x6e'),_0xeb49('0x6f'),'resolveby',_0xeb49('0x70'),'responseby',_0xeb49('0x71'),'responsiblecontactidyominame','sentimentvalue',_0xeb49('0x72'),_0xeb49('0x73'),_0xeb49('0x74'),_0xeb49('0x75'),_0xeb49('0x76'),_0xeb49('0x77'),_0xeb49('0x78'),'timezoneruleversionnumber',_0xeb49('0x79'),'traversedpath',_0xeb49('0x7a'),_0xeb49('0x7b')];var _0x3ba500=_0x34498d[_0xeb49('0x7c')](_0xe86771);return db[_0xeb49('0x17')]['findOne']({'where':{'id':_0x19b6ce[_0xeb49('0x2f')]['id']},'attributes':['id',_0xeb49('0x7d'),_0xeb49('0x7e'),_0xeb49('0x7f'),_0xeb49('0x80'),'clientId',_0xeb49('0x81'),'modernAuthentication'],'include':[{'model':db[_0xeb49('0x82')],'as':_0xeb49('0x82'),'attributes':['id',_0xeb49('0x83'),_0xeb49('0x84')]}]})[_0xeb49('0xf')](handleEntityNotFound(_0x54f329,null))[_0xeb49('0xf')](function(_0x3cafaf){if(_0x3cafaf){if(_0x3cafaf[_0xeb49('0x85')]){_0x3cafaf[_0xeb49('0x86')]=_0x3cafaf['CloudProvider']['data5'];_0x58b4ba=sanitizeRemoteUri(_0x3cafaf['CloudProvider']['data7']);_0x53fbd2=getWebApiUrl(_0x58b4ba);return _0x3cafaf;}_0x58b4ba=sanitizeRemoteUri(_0x3cafaf[_0xeb49('0x7f')]);_0x53fbd2=getWebApiUrl(_0x58b4ba);var _0x55d4d2={'method':_0xeb49('0x87'),'uri':'https://login.microsoftonline.com/'+_0x3cafaf[_0xeb49('0x80')]+_0xeb49('0x88'),'form':{'client_id':_0x3cafaf[_0xeb49('0x89')],'resource':_0x58b4ba,'username':_0x3cafaf['username'],'password':_0x3cafaf[_0xeb49('0x7e')],'grant_type':_0xeb49('0x7e'),'client_secret':_0x3cafaf[_0xeb49('0x81')]},'json':!![]};return rp(_0x55d4d2);}})[_0xeb49('0xf')](function(_0x226cbf){_0x21a36f=_0x226cbf[_0xeb49('0x86')];var _0xfb4161={'method':_0xeb49('0x8a'),'uri':encodeURI(_0x53fbd2+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x40aeb2+'\x27'),'headers':{'Authorization':_0xeb49('0x8b')+_0x21a36f,'If-None-Match':null,'OData-Version':_0xeb49('0x8c')},'json':!![]};return rp(_0xfb4161);})[_0xeb49('0xf')](function(_0x790c0a){var _0x558d40=_0x790c0a[_0xeb49('0x8d')][0x0];var _0x2351f6=_0x558d40[_0xeb49('0x8e')];var _0x18729d={'method':_0xeb49('0x8a'),'uri':_0x53fbd2+_0xeb49('0x8f')+_0x2351f6+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xeb49('0x8b')+_0x21a36f,'If-None-Match':null,'OData-Version':_0xeb49('0x8c')},'json':!![]};return rp(_0x18729d);})['then'](function(_0x2e4198){_0x3988c8=_0x2e4198;_0x26645f=_0x3988c8['Attributes'];_0x26645f=_['remove'](_0x26645f,function(_0x1284d6){return!_0x3ba500['includes'](_0x1284d6[_0xeb49('0x90')]);});var _0x9bf262=[];var _0x1f6d7f=[];_0x26645f['forEach'](function(_0x30b2ec){if(_0x30b2ec[_0xeb49('0x91')]){var _0x4e905b=_0x30b2ec[_0xeb49('0x91')][_0xeb49('0x41')](_0x30b2ec[_0xeb49('0x91')][_0xeb49('0x42')]('.')+0x1);if(_0x4e905b===_0xeb49('0x92')){_0x9bf262[_0xeb49('0x93')](getSelectList(_0x53fbd2,_0x4ef48e,_0x1f6d7f,_0x3988c8[_0xeb49('0x8e')],_0x30b2ec[_0xeb49('0x8e')],_0x21a36f));}}});return Promise['all'](_0x9bf262);})['then'](function(_0x441d55){_0x5c06ac=_0x441d55[0x0];var _0x7b6cd4=[];var _0x127aeb=[];_0x26645f[_0xeb49('0x94')](function(_0x1df96c){if(!_['isNil'](_0x1df96c[_0xeb49('0x91')])){var _0x3e310c=_0x1df96c[_0xeb49('0x91')][_0xeb49('0x41')](_0x1df96c[_0xeb49('0x91')][_0xeb49('0x42')]('.')+0x1);if(_0x3e310c===_0xeb49('0x95')){_0x7b6cd4[_0xeb49('0x93')](getBooleanList(_0x53fbd2,_0x4ef48e,_0x127aeb,_0x3988c8[_0xeb49('0x8e')],_0x1df96c[_0xeb49('0x8e')],_0x21a36f));}}});return Promise[_0xeb49('0x96')](_0x7b6cd4);})[_0xeb49('0xf')](function(_0x445aec){_0x563604=_0x445aec[0x0];var _0x143cdf=[];var _0x5f412f=[];_0x26645f['forEach'](function(_0x18065c){if(_0x18065c[_0xeb49('0x91')]){var _0x5ae0ae=_0x18065c['@odata.type'][_0xeb49('0x41')](_0x18065c['@odata.type'][_0xeb49('0x42')]('.')+0x1);if(_0x5ae0ae==='StringAttributeMetadata'||_0x5ae0ae===_0xeb49('0x97')||_0x5ae0ae===_0xeb49('0x98')||_0x5ae0ae==='IntegerAttributeMetadata'||_0x5ae0ae===_0xeb49('0x99')||_0x5ae0ae===_0xeb49('0x9a')||_0x5ae0ae==='StatusAttributeMetadata'||_0x5ae0ae===_0xeb49('0x9b')||_0x5ae0ae==='StateAttributeMetadata'||_0x5ae0ae===_0xeb49('0x9c')){_0x143cdf[_0xeb49('0x93')](getInputList(_0x53fbd2,_0x4ef48e,_0x5ae0ae,_0x5f412f,_0x3988c8[_0xeb49('0x8e')],_0x18065c[_0xeb49('0x8e')],_0x21a36f));}}});return Promise[_0xeb49('0x96')](_0x143cdf);})['then'](function(_0x459194){_0x59796d=_0x459194[0x0];var _0x2fd9fb=_0x5c06ac[_0xeb49('0x7c')](_0x563604)[_0xeb49('0x7c')](_0x59796d);var _0x1b2eee={'count':_0x2fd9fb[_0xeb49('0x22')],'rows':_0x2fd9fb};return _0x1b2eee;})[_0xeb49('0xf')](respondWithResult(_0x54f329,null))['catch'](function(_0x4c207a){var _0x4bd013=_0x19b6ce[_0xeb49('0x1c')][_0xeb49('0x9d')]?0x1f4:_0x4c207a[_0xeb49('0x9e')]||0x1f4;logger['error'](_0x4c207a[_0xeb49('0x9f')]);delete _0x4c207a[_0xeb49('0x14')];if(_0x4bd013===0x191){_0x4bd013=0x190;}_0x54f329[_0xeb49('0x7')](_0x4bd013)['send'](_0x19b6ce[_0xeb49('0x1c')][_0xeb49('0x9d')]?{'message':_0xeb49('0xa0'),'statusCode':_0x4c207a[_0xeb49('0x9e')]}:_0x4c207a);});};function getSelectList(_0x38a1b6,_0x243ccd,_0x1aa1a1,_0x71c982,_0xd41def,_0x102ecc){var _0x2ec177={'method':_0xeb49('0x8a'),'uri':_0x38a1b6+_0xeb49('0x8f')+_0x71c982+_0xeb49('0xa1')+_0xd41def+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xeb49('0x8b')+_0x102ecc,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2ec177)[_0xeb49('0xf')](function(_0x36866c){var _0x1b30c4=[];var _0x4552fc=_0x36866c[_0xeb49('0xa2')][_0xeb49('0xa3')];_0x4552fc[_0xeb49('0x94')](function(_0x5063ec){_0x1b30c4[_0xeb49('0x93')]({'name':_0x5063ec[_0xeb49('0xa4')][_0xeb49('0xa5')][_0xeb49('0xa4')],'value':String(_0x5063ec[_0xeb49('0xa6')])});});var _0x4f6ed9={'id':_0x243ccd+'_'+_0x36866c['LogicalName'],'name':_0x36866c[_0xeb49('0xa7')][_0xeb49('0xa5')][_0xeb49('0xa4')],'custom':![],'options':_0x1b30c4};_0x1aa1a1[_0xeb49('0x93')](_0x4f6ed9);return _0x1aa1a1;});}function getBooleanList(_0x9f6b6c,_0x19b397,_0x18595c,_0x249343,_0x3d887b,_0xf85d4d){var _0xb7aef6={'method':_0xeb49('0x8a'),'uri':_0x9f6b6c+'EntityDefinitions('+_0x249343+_0xeb49('0xa1')+_0x3d887b+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xeb49('0x8b')+_0xf85d4d,'If-None-Match':null,'OData-Version':_0xeb49('0x8c')},'json':!![]};return rp(_0xb7aef6)[_0xeb49('0xf')](function(_0x538b0d){var _0x33d127=[];_0x33d127[_0xeb49('0x93')]({'name':_0x538b0d[_0xeb49('0xa2')][_0xeb49('0xa8')]['Label']['UserLocalizedLabel']['Label'],'value':_0xeb49('0xa9')},{'name':_0x538b0d[_0xeb49('0xa2')][_0xeb49('0xaa')][_0xeb49('0xa4')][_0xeb49('0xa5')][_0xeb49('0xa4')],'value':_0xeb49('0xab')});var _0x2bc3c7={'id':_0x19b397+'_'+_0x538b0d[_0xeb49('0x90')],'name':_0x538b0d[_0xeb49('0xa7')][_0xeb49('0xa5')][_0xeb49('0xa4')],'custom':![],'options':_0x33d127};_0x18595c[_0xeb49('0x93')](_0x2bc3c7);return _0x18595c;});}function getInputList(_0x340f36,_0x1a62f1,_0x3cda35,_0x12a56c,_0x512eef,_0x3ffed4,_0x2cc51a){var _0x4968c3={'method':_0xeb49('0x8a'),'uri':_0x340f36+'EntityDefinitions('+_0x512eef+')/Attributes('+_0x3ffed4+_0xeb49('0xac')+_0x3cda35+_0xeb49('0xad'),'headers':{'Authorization':'Bearer\x20'+_0x2cc51a,'If-None-Match':null,'OData-Version':_0xeb49('0x8c')},'json':!![]};return rp(_0x4968c3)[_0xeb49('0xf')](function(_0x23ff96){var _0x1f43b7={'id':_0x1a62f1+'_'+_0x23ff96[_0xeb49('0x90')],'name':_0x23ff96[_0xeb49('0xa7')][_0xeb49('0xa5')]?_0x23ff96[_0xeb49('0xa7')]['UserLocalizedLabel'][_0xeb49('0xa4')]:_0x23ff96[_0xeb49('0x90')],'custom':![],'options':[]};_0x12a56c[_0xeb49('0x93')](_0x1f43b7);return _0x12a56c;});} \ No newline at end of file +var _0x954f=['LogicalName','@odata.type','PicklistAttributeMetadata','all','forEach','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','TrueOption','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','util','lodash','../../components/parsers/qs','api','status','offset','limit','undefined','count','set','Content-Range','update','then','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','create','body','find','destroy','findOne','Dynamics365Configuration','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','concat','username','password','remoteUri','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','EntityDefinitions(','4.0','remove','includes'];(function(_0x33250d,_0x39efc1){var _0x1ea1f4=function(_0x3a5bfb){while(--_0x3a5bfb){_0x33250d['push'](_0x33250d['shift']());}};_0x1ea1f4(++_0x39efc1);}(_0x954f,0xdc));var _0xf954=function(_0xd351b8,_0x410fa3){_0xd351b8=_0xd351b8-0x0;var _0x3f8a1c=_0x954f[_0xd351b8];return _0x3f8a1c;};'use strict';var rp=require('request-promise');var util=require(_0xf954('0x0'));var _=require(_0xf954('0x1'));var qs=require(_0xf954('0x2'));var logger=require('../../config/logger')(_0xf954('0x3'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x34973c,_0x1ca836){_0x1ca836=_0x1ca836||0xc8;return function(_0x27b1e9){if(_0x27b1e9){return _0x34973c[_0xf954('0x4')](_0x1ca836)['json'](_0x27b1e9);}};}function respondWithFilteredResult(_0x5d64d1,_0x479a3f){return function(_0x5270aa){if(_0x5270aa){var _0x55326d=typeof _0x479a3f[_0xf954('0x5')]==='undefined'&&typeof _0x479a3f[_0xf954('0x6')]===_0xf954('0x7');var _0x28a306=_0x5270aa[_0xf954('0x8')];var _0x480d24=_0x55326d?0x0:_0x479a3f['offset'];var _0x4f39c3=_0x55326d?_0x5270aa[_0xf954('0x8')]:_0x479a3f['offset']+_0x479a3f[_0xf954('0x6')];var _0x39440f;if(_0x4f39c3>=_0x28a306){_0x4f39c3=_0x28a306;_0x39440f=0xc8;}else{_0x39440f=0xce;}_0x5d64d1['status'](_0x39440f);return _0x5d64d1[_0xf954('0x9')](_0xf954('0xa'),_0x480d24+'-'+_0x4f39c3+'/'+_0x28a306)['json'](_0x5270aa);}return null;};}function saveUpdates(_0x57356b){return function(_0x61cdf2){if(_0x61cdf2){return _0x61cdf2[_0xf954('0xb')](_0x57356b)['then'](function(_0x4b45f8){return _0x4b45f8;});}return null;};}function removeEntity(_0x448633){return function(_0x2c2907){if(_0x2c2907){return _0x2c2907['destroy']()[_0xf954('0xc')](function(){_0x448633['status'](0xcc)[_0xf954('0xd')]();});}};}function handleEntityNotFound(_0x435bcc){return function(_0x5693eb){if(!_0x5693eb){_0x435bcc[_0xf954('0xe')](0x194);}return _0x5693eb;};}function handleError(_0x2fcfc8,_0x38d3f3){_0x38d3f3=_0x38d3f3||0x1f4;return function(_0x1b29a5){logger[_0xf954('0xf')](_0x1b29a5[_0xf954('0x10')]);if(_0x1b29a5[_0xf954('0x11')]){delete _0x1b29a5[_0xf954('0x11')];}_0x2fcfc8[_0xf954('0x4')](_0x38d3f3)[_0xf954('0x12')](_0x1b29a5);};}exports[_0xf954('0x13')]=function(_0x5a1c35,_0x1eda66){var _0x1b1854={},_0x40d987={},_0x45634b={'count':0x0,'rows':[]};var _0x36597c=_[_0xf954('0x14')](db[_0xf954('0x15')][_0xf954('0x16')],function(_0x4c8b7e){return{'name':_0x4c8b7e['fieldName'],'type':_0x4c8b7e[_0xf954('0x17')][_0xf954('0x18')]};});_0x40d987[_0xf954('0x19')]=_['map'](_0x36597c,_0xf954('0x11'));_0x40d987[_0xf954('0x1a')]=_[_0xf954('0x1b')](_0x5a1c35['query']);_0x40d987[_0xf954('0x1c')]=_['intersection'](_0x40d987['model'],_0x40d987[_0xf954('0x1a')]);_0x1b1854['attributes']=_[_0xf954('0x1d')](_0x40d987[_0xf954('0x19')],qs['fields'](_0x5a1c35[_0xf954('0x1a')]['fields']));_0x1b1854['attributes']=_0x1b1854[_0xf954('0x1e')][_0xf954('0x1f')]?_0x1b1854[_0xf954('0x1e')]:_0x40d987[_0xf954('0x19')];if(!_0x5a1c35[_0xf954('0x1a')]['hasOwnProperty'](_0xf954('0x20'))){_0x1b1854[_0xf954('0x6')]=qs['limit'](_0x5a1c35[_0xf954('0x1a')][_0xf954('0x6')]);_0x1b1854[_0xf954('0x5')]=qs['offset'](_0x5a1c35['query'][_0xf954('0x5')]);}_0x1b1854[_0xf954('0x21')]=qs[_0xf954('0x22')](_0x5a1c35['query'][_0xf954('0x22')]);_0x1b1854[_0xf954('0x23')]=qs[_0xf954('0x1c')](_[_0xf954('0x24')](_0x5a1c35[_0xf954('0x1a')],_0x40d987[_0xf954('0x1c')]),_0x36597c);if(_0x5a1c35[_0xf954('0x1a')][_0xf954('0x25')]){_0x1b1854['where']=_[_0xf954('0x26')](_0x1b1854[_0xf954('0x23')],{'$or':_[_0xf954('0x14')](_0x36597c,function(_0x32dbfc){if(_0x32dbfc[_0xf954('0x17')]!==_0xf954('0x27')){var _0x4611fe={};_0x4611fe[_0x32dbfc[_0xf954('0x11')]]={'$like':'%'+_0x5a1c35['query']['filter']+'%'};return _0x4611fe;}})});}_0x1b1854=_[_0xf954('0x26')]({},_0x1b1854,_0x5a1c35[_0xf954('0x28')]);var _0x5f3d1b={'where':_0x1b1854['where']};return db['Dynamics365Account'][_0xf954('0x8')](_0x5f3d1b)[_0xf954('0xc')](function(_0x25c44a){_0x45634b[_0xf954('0x8')]=_0x25c44a;if(_0x5a1c35[_0xf954('0x1a')][_0xf954('0x29')]){_0x1b1854[_0xf954('0x2a')]=[{'all':!![]}];}return db[_0xf954('0x15')][_0xf954('0x2b')](_0x1b1854);})[_0xf954('0xc')](function(_0x3d1902){_0x45634b[_0xf954('0x2c')]=_0x3d1902;return _0x45634b;})[_0xf954('0xc')](respondWithFilteredResult(_0x1eda66,_0x1b1854))[_0xf954('0x2d')](handleError(_0x1eda66,null));};exports[_0xf954('0x2e')]=function(_0x445a87,_0x52b4bf){var _0xf3a44d={'raw':![],'where':{'id':_0x445a87[_0xf954('0x2f')]['id']}},_0x1e26fc={};_0x1e26fc[_0xf954('0x19')]=_[_0xf954('0x1b')](db[_0xf954('0x15')][_0xf954('0x16')]);_0x1e26fc[_0xf954('0x1a')]=_['keys'](_0x445a87['query']);_0x1e26fc[_0xf954('0x1c')]=_[_0xf954('0x1d')](_0x1e26fc['model'],_0x1e26fc['query']);_0xf3a44d['attributes']=_[_0xf954('0x1d')](_0x1e26fc[_0xf954('0x19')],qs['fields'](_0x445a87[_0xf954('0x1a')][_0xf954('0x30')]));_0xf3a44d['attributes']=_0xf3a44d[_0xf954('0x1e')][_0xf954('0x1f')]?_0xf3a44d[_0xf954('0x1e')]:_0x1e26fc['model'];if(_0x445a87[_0xf954('0x1a')][_0xf954('0x29')]){_0xf3a44d['include']=[{'all':!![]}];}_0xf3a44d=_[_0xf954('0x26')]({},_0xf3a44d,_0x445a87['options']);return db[_0xf954('0x15')]['find'](_0xf3a44d)['then'](handleEntityNotFound(_0x52b4bf,null))[_0xf954('0xc')](respondWithResult(_0x52b4bf,null))[_0xf954('0x2d')](handleError(_0x52b4bf,null));};exports[_0xf954('0x31')]=function(_0x4e4569,_0x2010c9){return db[_0xf954('0x15')][_0xf954('0x31')](_0x4e4569[_0xf954('0x32')],{})[_0xf954('0xc')](respondWithResult(_0x2010c9,0xc9))[_0xf954('0x2d')](handleError(_0x2010c9,null));};exports[_0xf954('0xb')]=function(_0x30b451,_0x2f6952){if(_0x30b451[_0xf954('0x32')]['id']){delete _0x30b451['body']['id'];}return db[_0xf954('0x15')][_0xf954('0x33')]({'where':{'id':_0x30b451[_0xf954('0x2f')]['id']}})['then'](handleEntityNotFound(_0x2f6952,null))[_0xf954('0xc')](saveUpdates(_0x30b451['body'],null))[_0xf954('0xc')](respondWithResult(_0x2f6952,null))['catch'](handleError(_0x2f6952,null));};exports[_0xf954('0x34')]=function(_0x3a7f0f,_0x5edb7c){return db[_0xf954('0x15')][_0xf954('0x33')]({'where':{'id':_0x3a7f0f[_0xf954('0x2f')]['id']}})[_0xf954('0xc')](handleEntityNotFound(_0x5edb7c,null))[_0xf954('0xc')](removeEntity(_0x5edb7c,null))['catch'](handleError(_0x5edb7c,null));};exports['getConfigurations']=function(_0x17f271,_0x296f9a){var _0x259b25={};var _0x1b4f37={};var _0x3a23fd;var _0x325331;return db[_0xf954('0x15')][_0xf954('0x35')]({'where':{'id':_0x17f271[_0xf954('0x2f')]['id']}})[_0xf954('0xc')](handleEntityNotFound(_0x296f9a,null))[_0xf954('0xc')](function(_0x16f083){if(_0x16f083){_0x3a23fd=_0x16f083;_0x1b4f37[_0xf954('0x19')]=_[_0xf954('0x1b')](db[_0xf954('0x36')]['rawAttributes']);_0x1b4f37[_0xf954('0x1a')]=_[_0xf954('0x1b')](_0x17f271[_0xf954('0x1a')]);_0x1b4f37[_0xf954('0x1c')]=_[_0xf954('0x1d')](_0x1b4f37[_0xf954('0x19')],_0x1b4f37[_0xf954('0x1a')]);_0x259b25['attributes']=_[_0xf954('0x1d')](_0x1b4f37[_0xf954('0x19')],qs[_0xf954('0x30')](_0x17f271[_0xf954('0x1a')][_0xf954('0x30')]));_0x259b25['attributes']=_0x259b25[_0xf954('0x1e')][_0xf954('0x1f')]?_0x259b25[_0xf954('0x1e')]:_0x1b4f37[_0xf954('0x19')];_0x259b25['order']=qs['sort'](_0x17f271[_0xf954('0x1a')]['sort']);_0x259b25[_0xf954('0x23')]=qs[_0xf954('0x1c')](_[_0xf954('0x24')](_0x17f271[_0xf954('0x1a')],_0x1b4f37[_0xf954('0x1c')]));if(_0x17f271[_0xf954('0x1a')][_0xf954('0x25')]){_0x259b25[_0xf954('0x23')]=_['merge'](_0x259b25[_0xf954('0x23')],{'$or':_['map'](_0x259b25[_0xf954('0x1e')],function(_0x186ee6){var _0x250459={};_0x250459[_0x186ee6]={'$like':'%'+_0x17f271[_0xf954('0x1a')]['filter']+'%'};return _0x250459;})});}_0x259b25=_[_0xf954('0x26')]({},_0x259b25,_0x17f271[_0xf954('0x28')]);return _0x3a23fd[_0xf954('0x37')](_0x259b25);}})[_0xf954('0xc')](function(_0x4f16da){if(_0x4f16da){_0x325331=_0x4f16da['length'];if(!_0x17f271[_0xf954('0x1a')]['hasOwnProperty']('nolimit')){_0x259b25['limit']=qs[_0xf954('0x6')](_0x17f271['query'][_0xf954('0x6')]);_0x259b25['offset']=qs[_0xf954('0x5')](_0x17f271[_0xf954('0x1a')]['offset']);}return _0x3a23fd['getConfigurations'](_0x259b25);}})[_0xf954('0xc')](function(_0x3e602d){if(_0x3e602d){return _0x3e602d?{'count':_0x325331,'rows':_0x3e602d}:null;}})[_0xf954('0xc')](respondWithResult(_0x296f9a,null))[_0xf954('0x2d')](handleError(_0x296f9a,null));};exports['addConfiguration']=function(_0x3ce863,_0x15bdfb){if(_0x3ce863['body']['id']){delete _0x3ce863[_0xf954('0x32')]['id'];}return db[_0xf954('0x15')][_0xf954('0x35')]({'where':{'id':_0x3ce863[_0xf954('0x2f')]['id']}})[_0xf954('0xc')](handleEntityNotFound(_0x15bdfb,null))[_0xf954('0xc')](function(_0x50d014){if(_0x50d014){_0x3ce863['body'][_0xf954('0x38')]=_0x50d014['id'];_0x3ce863[_0xf954('0x32')][_0xf954('0x39')]=integrations[_0xf954('0x3a')](_0x3ce863[_0xf954('0x32')][_0xf954('0x3b')],_0x3ce863[_0xf954('0x32')][_0xf954('0x17')]);_0x3ce863[_0xf954('0x32')][_0xf954('0x3c')]=integrations[_0xf954('0x3d')](_0x3ce863[_0xf954('0x32')][_0xf954('0x3b')],_0x3ce863[_0xf954('0x32')][_0xf954('0x17')]);return db[_0xf954('0x36')][_0xf954('0x31')](_0x3ce863[_0xf954('0x32')],{'include':[{'model':db[_0xf954('0x3e')],'as':_0xf954('0x39')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0xf954('0xc')](respondWithResult(_0x15bdfb,null))[_0xf954('0x2d')](handleError(_0x15bdfb,null));};function sanitizeRemoteUri(_0x582610){var _0x1d3341=_0x582610[_0xf954('0x3f')](-0x1);if(_0x1d3341==='/')return _0x582610[_0xf954('0x40')](0x0,_0x582610[_0xf954('0x41')](_0x1d3341));return _0x582610;}function getWebApiUrl(_0x42abd5){return util[_0xf954('0x42')](_0xf954('0x43'),_0x42abd5);}exports[_0xf954('0x44')]=function(_0x4efd56,_0x246a81){var _0x26ac18=_0x4efd56[_0xf954('0x1a')][_0xf954('0x45')];var _0x5511fc=_0x26ac18==='incident'?_0xf954('0x46'):_0xf954('0x47');var _0x344687='';var _0x471dfc='';var _0x193825='';var _0x5198e6='';var _0x151dbb='';var _0x18aa5b='';var _0x44ec08='';var _0x522488='';var _0x4ce2c3=[_0xf954('0x48'),_0xf954('0x49'),_0xf954('0x4a'),_0xf954('0x4b'),_0xf954('0x4c'),_0xf954('0x4d'),_0xf954('0x4e'),_0xf954('0x4f'),_0xf954('0x50'),_0xf954('0x51')];var _0x204fad=[_0xf954('0x52'),_0xf954('0x53'),_0xf954('0x54'),'billedserviceunits','contactidname',_0xf954('0x55'),_0xf954('0x56'),_0xf954('0x57'),_0xf954('0x58'),'createdbyexternalpartyyominame',_0xf954('0x59'),_0xf954('0x5a'),_0xf954('0x5b'),_0xf954('0x5c'),_0xf954('0x5d'),_0xf954('0x5e'),_0xf954('0x5f'),_0xf954('0x60'),'emailaddress',_0xf954('0x61'),_0xf954('0x62'),_0xf954('0x63'),_0xf954('0x64'),_0xf954('0x65'),'firstresponsebykpiidname',_0xf954('0x66'),_0xf954('0x67'),_0xf954('0x68'),_0xf954('0x69'),_0xf954('0x6a'),'masteridname',_0xf954('0x6b'),_0xf954('0x6c'),_0xf954('0x6d'),_0xf954('0x6e'),_0xf954('0x6f'),'modifiedonbehalfbyname',_0xf954('0x70'),_0xf954('0x71'),_0xf954('0x72'),_0xf954('0x73'),'onholdtime',_0xf954('0x74'),'owneridname',_0xf954('0x75'),_0xf954('0x76'),_0xf954('0x77'),_0xf954('0x78'),'primarycontactidyominame',_0xf954('0x79'),_0xf954('0x7a'),'productserialnumber',_0xf954('0x7b'),_0xf954('0x7c'),_0xf954('0x7d'),_0xf954('0x7e'),_0xf954('0x7f'),_0xf954('0x80'),_0xf954('0x81'),'slaname',_0xf954('0x82'),_0xf954('0x83'),'statuscode',_0xf954('0x84'),_0xf954('0x85'),_0xf954('0x86'),_0xf954('0x87'),_0xf954('0x88'),'utcconversiontimezonecode','versionnumber'];var _0x31c4c0=_0x4ce2c3[_0xf954('0x89')](_0x204fad);return db[_0xf954('0x15')][_0xf954('0x35')]({'where':{'id':_0x4efd56['params']['id']},'attributes':['id',_0xf954('0x8a'),_0xf954('0x8b'),_0xf954('0x8c'),'tenantId',_0xf954('0x8d'),_0xf954('0x8e'),_0xf954('0x8f')],'include':[{'model':db[_0xf954('0x90')],'as':_0xf954('0x90'),'attributes':['id',_0xf954('0x91'),_0xf954('0x92')]}]})[_0xf954('0xc')](handleEntityNotFound(_0x246a81,null))['then'](function(_0x581785){if(_0x581785){if(_0x581785[_0xf954('0x8f')]){_0x581785['access_token']=_0x581785['CloudProvider']['data5'];_0x522488=sanitizeRemoteUri(_0x581785['CloudProvider'][_0xf954('0x92')]);_0x44ec08=getWebApiUrl(_0x522488);return _0x581785;}_0x522488=sanitizeRemoteUri(_0x581785[_0xf954('0x8c')]);_0x44ec08=getWebApiUrl(_0x522488);var _0x516cab={'method':_0xf954('0x93'),'uri':_0xf954('0x94')+_0x581785['tenantId']+_0xf954('0x95'),'form':{'client_id':_0x581785[_0xf954('0x8d')],'resource':_0x522488,'username':_0x581785[_0xf954('0x8a')],'password':_0x581785[_0xf954('0x8b')],'grant_type':'password','client_secret':_0x581785['clientSecret']},'json':!![]};return rp(_0x516cab);}})[_0xf954('0xc')](function(_0x1bc496){_0x18aa5b=_0x1bc496[_0xf954('0x96')];var _0x3222a7={'method':_0xf954('0x97'),'uri':encodeURI(_0x44ec08+_0xf954('0x98')+_0x5511fc+'\x27'),'headers':{'Authorization':_0xf954('0x99')+_0x18aa5b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3222a7);})[_0xf954('0xc')](function(_0x2e6005){var _0xcb21b9=_0x2e6005[_0xf954('0x9a')][0x0];var _0x55413f=_0xcb21b9[_0xf954('0x9b')];var _0x52b2a2={'method':_0xf954('0x97'),'uri':_0x44ec08+_0xf954('0x9c')+_0x55413f+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xf954('0x99')+_0x18aa5b,'If-None-Match':null,'OData-Version':_0xf954('0x9d')},'json':!![]};return rp(_0x52b2a2);})[_0xf954('0xc')](function(_0x402301){_0x344687=_0x402301;_0x471dfc=_0x344687['Attributes'];_0x471dfc=_[_0xf954('0x9e')](_0x471dfc,function(_0x3b0bfa){return!_0x31c4c0[_0xf954('0x9f')](_0x3b0bfa[_0xf954('0xa0')]);});var _0x10ac1a=[];var _0x1d17d5=[];_0x471dfc['forEach'](function(_0x3735c){if(_0x3735c[_0xf954('0xa1')]){var _0x4ef3dd=_0x3735c[_0xf954('0xa1')][_0xf954('0x40')](_0x3735c[_0xf954('0xa1')][_0xf954('0x41')]('.')+0x1);if(_0x4ef3dd===_0xf954('0xa2')){_0x10ac1a['push'](getSelectList(_0x44ec08,_0x26ac18,_0x1d17d5,_0x344687[_0xf954('0x9b')],_0x3735c[_0xf954('0x9b')],_0x18aa5b));}}});return Promise[_0xf954('0xa3')](_0x10ac1a);})[_0xf954('0xc')](function(_0x20c807){_0x193825=_0x20c807[0x0];var _0x238df8=[];var _0x777283=[];_0x471dfc[_0xf954('0xa4')](function(_0x1cc7aa){if(!_['isNil'](_0x1cc7aa['@odata.type'])){var _0x33f3a7=_0x1cc7aa[_0xf954('0xa1')][_0xf954('0x40')](_0x1cc7aa[_0xf954('0xa1')][_0xf954('0x41')]('.')+0x1);if(_0x33f3a7==='BooleanAttributeMetadata'){_0x238df8[_0xf954('0xa5')](getBooleanList(_0x44ec08,_0x26ac18,_0x777283,_0x344687[_0xf954('0x9b')],_0x1cc7aa[_0xf954('0x9b')],_0x18aa5b));}}});return Promise[_0xf954('0xa3')](_0x238df8);})[_0xf954('0xc')](function(_0x56bd05){_0x5198e6=_0x56bd05[0x0];var _0x1b282e=[];var _0x422d56=[];_0x471dfc['forEach'](function(_0x4032b5){if(_0x4032b5['@odata.type']){var _0x2301d9=_0x4032b5[_0xf954('0xa1')][_0xf954('0x40')](_0x4032b5[_0xf954('0xa1')][_0xf954('0x41')]('.')+0x1);if(_0x2301d9===_0xf954('0xa6')||_0x2301d9===_0xf954('0xa7')||_0x2301d9===_0xf954('0xa8')||_0x2301d9===_0xf954('0xa9')||_0x2301d9===_0xf954('0xaa')||_0x2301d9===_0xf954('0xab')||_0x2301d9==='StatusAttributeMetadata'||_0x2301d9===_0xf954('0xac')||_0x2301d9===_0xf954('0xad')||_0x2301d9==='DecimalAttributeMetadata'){_0x1b282e[_0xf954('0xa5')](getInputList(_0x44ec08,_0x26ac18,_0x2301d9,_0x422d56,_0x344687[_0xf954('0x9b')],_0x4032b5[_0xf954('0x9b')],_0x18aa5b));}}});return Promise[_0xf954('0xa3')](_0x1b282e);})[_0xf954('0xc')](function(_0x433a08){_0x151dbb=_0x433a08[0x0];var _0x444eef=_0x193825[_0xf954('0x89')](_0x5198e6)[_0xf954('0x89')](_0x151dbb);var _0x352936={'count':_0x444eef[_0xf954('0x1f')],'rows':_0x444eef};return _0x352936;})['then'](respondWithResult(_0x246a81,null))[_0xf954('0x2d')](function(_0x168e43){var _0x32f403=_0x4efd56[_0xf954('0x1a')][_0xf954('0xae')]?0x1f4:_0x168e43[_0xf954('0xaf')]||0x1f4;logger[_0xf954('0xf')](_0x168e43[_0xf954('0x10')]);delete _0x168e43[_0xf954('0x11')];if(_0x32f403===0x191){_0x32f403=0x190;}_0x246a81[_0xf954('0x4')](_0x32f403)[_0xf954('0x12')](_0x4efd56[_0xf954('0x1a')][_0xf954('0xae')]?{'message':_0xf954('0xb0'),'statusCode':_0x168e43[_0xf954('0xaf')]}:_0x168e43);});};function getSelectList(_0x53ac18,_0x519ecd,_0x4d5b0d,_0x175f93,_0x4ec6b6,_0x2d45ef){var _0x159f21={'method':'GET','uri':_0x53ac18+'EntityDefinitions('+_0x175f93+_0xf954('0xb1')+_0x4ec6b6+_0xf954('0xb2')+_0xf954('0xb3'),'headers':{'Authorization':'Bearer\x20'+_0x2d45ef,'If-None-Match':null,'OData-Version':_0xf954('0x9d')},'json':!![]};return rp(_0x159f21)['then'](function(_0x39c888){var _0x235d9d=[];var _0x207b12=_0x39c888[_0xf954('0xb4')][_0xf954('0xb5')];_0x207b12[_0xf954('0xa4')](function(_0x5b5455){_0x235d9d[_0xf954('0xa5')]({'name':_0x5b5455[_0xf954('0xb6')]['UserLocalizedLabel'][_0xf954('0xb6')],'value':String(_0x5b5455['Value'])});});var _0x18ec6a={'id':_0x519ecd+'_'+_0x39c888[_0xf954('0xa0')],'name':_0x39c888['DisplayName'][_0xf954('0xb7')]['Label'],'custom':![],'options':_0x235d9d};_0x4d5b0d[_0xf954('0xa5')](_0x18ec6a);return _0x4d5b0d;});}function getBooleanList(_0xbac284,_0xc9f05e,_0x41c752,_0x44581c,_0x37e67f,_0x20bd9f){var _0x3511c3={'method':_0xf954('0x97'),'uri':_0xbac284+_0xf954('0x9c')+_0x44581c+_0xf954('0xb1')+_0x37e67f+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xf954('0x99')+_0x20bd9f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3511c3)[_0xf954('0xc')](function(_0x4f609d){var _0x382244=[];_0x382244[_0xf954('0xa5')]({'name':_0x4f609d[_0xf954('0xb4')][_0xf954('0xb8')][_0xf954('0xb6')][_0xf954('0xb7')][_0xf954('0xb6')],'value':_0xf954('0xb9')},{'name':_0x4f609d['OptionSet'][_0xf954('0xba')]['Label'][_0xf954('0xb7')][_0xf954('0xb6')],'value':_0xf954('0xbb')});var _0x39b373={'id':_0xc9f05e+'_'+_0x4f609d[_0xf954('0xa0')],'name':_0x4f609d[_0xf954('0xbc')][_0xf954('0xb7')][_0xf954('0xb6')],'custom':![],'options':_0x382244};_0x41c752['push'](_0x39b373);return _0x41c752;});}function getInputList(_0x2c9832,_0xae1fd4,_0x200b55,_0x22d44f,_0x4631ea,_0x3ae3b5,_0x42f724){var _0x2dbf32={'method':_0xf954('0x97'),'uri':_0x2c9832+'EntityDefinitions('+_0x4631ea+')/Attributes('+_0x3ae3b5+_0xf954('0xbd')+_0x200b55+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xf954('0x99')+_0x42f724,'If-None-Match':null,'OData-Version':_0xf954('0x9d')},'json':!![]};return rp(_0x2dbf32)['then'](function(_0x4ba684){var _0x702a33={'id':_0xae1fd4+'_'+_0x4ba684[_0xf954('0xa0')],'name':_0x4ba684[_0xf954('0xbc')][_0xf954('0xb7')]?_0x4ba684['DisplayName'][_0xf954('0xb7')][_0xf954('0xb6')]:_0x4ba684[_0xf954('0xa0')],'custom':![],'options':[]};_0x22d44f[_0xf954('0xa5')](_0x702a33);return _0x22d44f;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index f4546a6..002f5bc 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x5c0d88,_0x447999){var _0x3f9cef=function(_0x327cad){while(--_0x327cad){_0x5c0d88['push'](_0x5c0d88['shift']());}};_0x3f9cef(++_0x447999);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x65c903,_0x41e920){var _0x23e1d7=function(_0x4279cd){while(--_0x4279cd){_0x65c903['push'](_0x65c903['shift']());}};_0x23e1d7(++_0x41e920);}(_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 diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 4cb03bd..20db736 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.rpc.js +++ b/server/api/intDynamics365Account/intDynamics365Account.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a98=['error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','map','include','model','stringify','ShowDynamics365Account','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s'];(function(_0x5d7d6c,_0x7eefd0){var _0x3c195c=function(_0x497b7e){while(--_0x497b7e){_0x5d7d6c['push'](_0x5d7d6c['shift']());}};_0x3c195c(++_0x7eefd0);}(_0x9a98,0x9a));var _0x89a9=function(_0x11d729,_0x29e576){_0x11d729=_0x11d729-0x0;var _0x327a67=_0x9a98[_0x11d729];return _0x327a67;};'use strict';var _=require(_0x89a9('0x0'));var util=require(_0x89a9('0x1'));var moment=require('moment');var BPromise=require(_0x89a9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89a9('0x3'));var db=require(_0x89a9('0x4'))['db'];var utils=require(_0x89a9('0x5'));var logger=require(_0x89a9('0x6'))(_0x89a9('0x7'));var config=require('../../config/environment');var jayson=require(_0x89a9('0x8'));var client=jayson[_0x89a9('0x9')][_0x89a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc22151,_0x419fc0,_0x26aac3){return new BPromise(function(_0x4550b1,_0x47b71f){return client[_0x89a9('0xb')](_0xc22151,_0x26aac3)[_0x89a9('0xc')](function(_0x97a771){logger[_0x89a9('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x419fc0,'request\x20sent');logger[_0x89a9('0xe')](_0x89a9('0xf'),_0x419fc0,'request\x20sent',JSON['stringify'](_0x97a771));if(_0x97a771[_0x89a9('0x10')]){if(_0x97a771['error'][_0x89a9('0x11')]===0x1f4){logger[_0x89a9('0x10')](_0x89a9('0x12'),_0x419fc0,_0x97a771[_0x89a9('0x10')][_0x89a9('0x13')]);return _0x47b71f(_0x97a771[_0x89a9('0x10')][_0x89a9('0x13')]);}logger[_0x89a9('0x10')](_0x89a9('0x12'),_0x419fc0,_0x97a771['error'][_0x89a9('0x13')]);return _0x4550b1(_0x97a771[_0x89a9('0x10')][_0x89a9('0x13')]);}else{logger[_0x89a9('0xd')](_0x89a9('0x12'),_0x419fc0,'request\x20sent');_0x4550b1(_0x97a771[_0x89a9('0x14')][_0x89a9('0x13')]);}})[_0x89a9('0x15')](function(_0x347987){logger[_0x89a9('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x419fc0,_0x347987);_0x47b71f(_0x347987);});});}exports[_0x89a9('0x16')]=function(_0x207613){var _0xd6189b=this;return new Promise(function(_0x499dd6,_0x180f0e){return db[_0x89a9('0x17')][_0x89a9('0x18')]({'raw':_0x207613[_0x89a9('0x19')]?_0x207613['options'][_0x89a9('0x1a')]===undefined?!![]:![]:!![],'where':_0x207613['options']?_0x207613[_0x89a9('0x19')]['where']||null:null,'attributes':_0x207613[_0x89a9('0x19')]?_0x207613[_0x89a9('0x19')][_0x89a9('0x1b')]||null:null,'limit':_0x207613[_0x89a9('0x19')]?_0x207613[_0x89a9('0x19')]['limit']||null:null,'include':_0x207613[_0x89a9('0x19')]?_0x207613[_0x89a9('0x19')]['include']?_[_0x89a9('0x1c')](_0x207613[_0x89a9('0x19')][_0x89a9('0x1d')],function(_0x302813){return{'model':db[_0x302813[_0x89a9('0x1e')]],'as':_0x302813['as'],'attributes':_0x302813[_0x89a9('0x1b')],'include':_0x302813[_0x89a9('0x1d')]?_[_0x89a9('0x1c')](_0x302813['include'],function(_0x5af903){return{'model':db[_0x5af903[_0x89a9('0x1e')]],'as':_0x5af903['as'],'attributes':_0x5af903[_0x89a9('0x1b')],'include':_0x5af903[_0x89a9('0x1d')]?_[_0x89a9('0x1c')](_0x5af903[_0x89a9('0x1d')],function(_0x48c1e5){return{'model':db[_0x48c1e5[_0x89a9('0x1e')]],'as':_0x48c1e5['as'],'attributes':_0x48c1e5['attributes']};}):[]};}):[]};}):[]:[]})[_0x89a9('0xc')](function(_0x46d662){logger[_0x89a9('0xd')](_0x89a9('0x16'),_0x207613);logger[_0x89a9('0xe')](_0x89a9('0x16'),_0x207613,JSON[_0x89a9('0x1f')](_0x46d662));_0x499dd6(_0x46d662);})['catch'](function(_0x1967e1){logger[_0x89a9('0x10')](_0x89a9('0x16'),_0x1967e1[_0x89a9('0x13')],_0x207613);_0x180f0e(_0xd6189b[_0x89a9('0x10')](0x1f4,_0x1967e1[_0x89a9('0x13')]));});});};exports[_0x89a9('0x20')]=function(_0x29f994){var _0x16ca00=this;return new Promise(function(_0x4e4ec9,_0x2b8cb0){return db['Dynamics365Account'][_0x89a9('0x21')]({'raw':_0x29f994[_0x89a9('0x19')]?_0x29f994[_0x89a9('0x19')][_0x89a9('0x1a')]===undefined?!![]:![]:!![],'where':_0x29f994[_0x89a9('0x19')]?_0x29f994[_0x89a9('0x19')]['where']||null:null,'attributes':_0x29f994[_0x89a9('0x19')]?_0x29f994[_0x89a9('0x19')][_0x89a9('0x1b')]||null:null,'include':_0x29f994[_0x89a9('0x19')]?_0x29f994[_0x89a9('0x19')][_0x89a9('0x1d')]?_[_0x89a9('0x1c')](_0x29f994[_0x89a9('0x19')]['include'],function(_0x37354d){return{'model':db[_0x37354d[_0x89a9('0x1e')]],'as':_0x37354d['as'],'attributes':_0x37354d[_0x89a9('0x1b')],'include':_0x37354d[_0x89a9('0x1d')]?_[_0x89a9('0x1c')](_0x37354d[_0x89a9('0x1d')],function(_0x4d4d1f){return{'model':db[_0x4d4d1f[_0x89a9('0x1e')]],'as':_0x4d4d1f['as'],'attributes':_0x4d4d1f[_0x89a9('0x1b')],'include':_0x4d4d1f['include']?_[_0x89a9('0x1c')](_0x4d4d1f['include'],function(_0x3817a3){return{'model':db[_0x3817a3['model']],'as':_0x3817a3['as'],'attributes':_0x3817a3['attributes']};}):[]};}):[]};}):[]:[]})[_0x89a9('0xc')](function(_0x529a7b){logger[_0x89a9('0xd')]('ShowDynamics365Account',_0x29f994);logger[_0x89a9('0xe')]('ShowDynamics365Account',_0x29f994,JSON['stringify'](_0x529a7b));_0x4e4ec9(_0x529a7b);})[_0x89a9('0x15')](function(_0xa0647b){logger['error']('ShowDynamics365Account',_0xa0647b[_0x89a9('0x13')],_0x29f994);_0x2b8cb0(_0x16ca00[_0x89a9('0x10')](0x1f4,_0xa0647b[_0x89a9('0x13')]));});});}; \ No newline at end of file +var _0x530d=['client','http','request','then','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','Dynamics365Account','findAll','raw','options','where','attributes','limit','include','map','model','GetDynamics365Account','ShowDynamics365Account','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x530d,0x183));var _0xd530=function(_0x583ae5,_0x35837b){_0x583ae5=_0x583ae5-0x0;var _0x35b6f0=_0x530d[_0x583ae5];return _0x35b6f0;};'use strict';var _=require('lodash');var util=require(_0xd530('0x0'));var moment=require(_0xd530('0x1'));var BPromise=require(_0xd530('0x2'));var rs=require(_0xd530('0x3'));var fs=require('fs');var Redis=require(_0xd530('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd530('0x5'));var logger=require(_0xd530('0x6'))('rpc');var config=require(_0xd530('0x7'));var jayson=require(_0xd530('0x8'));var client=jayson[_0xd530('0x9')][_0xd530('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x107868,_0xc1608b,_0x8f3dca){return new BPromise(function(_0x4b3921,_0x29f36a){return client[_0xd530('0xb')](_0x107868,_0x8f3dca)[_0xd530('0xc')](function(_0x212b75){logger['info'](_0xd530('0xd'),_0xc1608b,'request\x20sent');logger[_0xd530('0xe')](_0xd530('0xf'),_0xc1608b,_0xd530('0x10'),JSON[_0xd530('0x11')](_0x212b75));if(_0x212b75[_0xd530('0x12')]){if(_0x212b75['error'][_0xd530('0x13')]===0x1f4){logger['error'](_0xd530('0xd'),_0xc1608b,_0x212b75[_0xd530('0x12')][_0xd530('0x14')]);return _0x29f36a(_0x212b75['error'][_0xd530('0x14')]);}logger['error'](_0xd530('0xd'),_0xc1608b,_0x212b75[_0xd530('0x12')][_0xd530('0x14')]);return _0x4b3921(_0x212b75[_0xd530('0x12')][_0xd530('0x14')]);}else{logger[_0xd530('0x15')](_0xd530('0xd'),_0xc1608b,_0xd530('0x10'));_0x4b3921(_0x212b75['result'][_0xd530('0x14')]);}})[_0xd530('0x16')](function(_0x5026d7){logger[_0xd530('0x12')](_0xd530('0xd'),_0xc1608b,_0x5026d7);_0x29f36a(_0x5026d7);});});}exports['GetDynamics365Account']=function(_0x49fd84){var _0x36a1c5=this;return new Promise(function(_0x5af6c1,_0xfcf27c){return db[_0xd530('0x17')][_0xd530('0x18')]({'raw':_0x49fd84['options']?_0x49fd84['options'][_0xd530('0x19')]===undefined?!![]:![]:!![],'where':_0x49fd84[_0xd530('0x1a')]?_0x49fd84['options'][_0xd530('0x1b')]||null:null,'attributes':_0x49fd84['options']?_0x49fd84[_0xd530('0x1a')][_0xd530('0x1c')]||null:null,'limit':_0x49fd84['options']?_0x49fd84['options'][_0xd530('0x1d')]||null:null,'include':_0x49fd84['options']?_0x49fd84[_0xd530('0x1a')]['include']?_['map'](_0x49fd84[_0xd530('0x1a')][_0xd530('0x1e')],function(_0x4e2a05){return{'model':db[_0x4e2a05['model']],'as':_0x4e2a05['as'],'attributes':_0x4e2a05[_0xd530('0x1c')],'include':_0x4e2a05[_0xd530('0x1e')]?_[_0xd530('0x1f')](_0x4e2a05['include'],function(_0x41109d){return{'model':db[_0x41109d[_0xd530('0x20')]],'as':_0x41109d['as'],'attributes':_0x41109d[_0xd530('0x1c')],'include':_0x41109d['include']?_[_0xd530('0x1f')](_0x41109d[_0xd530('0x1e')],function(_0x2db44e){return{'model':db[_0x2db44e[_0xd530('0x20')]],'as':_0x2db44e['as'],'attributes':_0x2db44e[_0xd530('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd530('0xc')](function(_0x460626){logger[_0xd530('0x15')](_0xd530('0x21'),_0x49fd84);logger[_0xd530('0xe')](_0xd530('0x21'),_0x49fd84,JSON[_0xd530('0x11')](_0x460626));_0x5af6c1(_0x460626);})['catch'](function(_0x2e99bc){logger['error'](_0xd530('0x21'),_0x2e99bc[_0xd530('0x14')],_0x49fd84);_0xfcf27c(_0x36a1c5[_0xd530('0x12')](0x1f4,_0x2e99bc[_0xd530('0x14')]));});});};exports[_0xd530('0x22')]=function(_0x1f36b6){var _0x5eb47b=this;return new Promise(function(_0x1c54e1,_0x2dac0a){return db[_0xd530('0x17')][_0xd530('0x23')]({'raw':_0x1f36b6[_0xd530('0x1a')]?_0x1f36b6['options'][_0xd530('0x19')]===undefined?!![]:![]:!![],'where':_0x1f36b6[_0xd530('0x1a')]?_0x1f36b6[_0xd530('0x1a')]['where']||null:null,'attributes':_0x1f36b6[_0xd530('0x1a')]?_0x1f36b6[_0xd530('0x1a')][_0xd530('0x1c')]||null:null,'include':_0x1f36b6[_0xd530('0x1a')]?_0x1f36b6[_0xd530('0x1a')][_0xd530('0x1e')]?_[_0xd530('0x1f')](_0x1f36b6['options'][_0xd530('0x1e')],function(_0x36185e){return{'model':db[_0x36185e['model']],'as':_0x36185e['as'],'attributes':_0x36185e['attributes'],'include':_0x36185e[_0xd530('0x1e')]?_[_0xd530('0x1f')](_0x36185e[_0xd530('0x1e')],function(_0x28cd15){return{'model':db[_0x28cd15['model']],'as':_0x28cd15['as'],'attributes':_0x28cd15[_0xd530('0x1c')],'include':_0x28cd15[_0xd530('0x1e')]?_[_0xd530('0x1f')](_0x28cd15[_0xd530('0x1e')],function(_0x2b1721){return{'model':db[_0x2b1721[_0xd530('0x20')]],'as':_0x2b1721['as'],'attributes':_0x2b1721['attributes']};}):[]};}):[]};}):[]:[]})[_0xd530('0xc')](function(_0x5cabdf){logger['info'](_0xd530('0x22'),_0x1f36b6);logger['debug']('ShowDynamics365Account',_0x1f36b6,JSON['stringify'](_0x5cabdf));_0x1c54e1(_0x5cabdf);})['catch'](function(_0x31ef1b){logger[_0xd530('0x12')](_0xd530('0x22'),_0x31ef1b[_0xd530('0x14')],_0x1f36b6);_0x2dac0a(_0x5eb47b[_0xd530('0x12')](0x1f4,_0x31ef1b['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 6521f50..4b8c8ec 100644 --- a/server/api/intDynamics365Configuration/index.js +++ b/server/api/intDynamics365Configuration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf60=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','create','/:id','update','destroy','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index'];(function(_0x4e61e8,_0xd686b0){var _0x6b8776=function(_0x1eaf5b){while(--_0x1eaf5b){_0x4e61e8['push'](_0x4e61e8['shift']());}};_0x6b8776(++_0xd686b0);}(_0xaf60,0x82));var _0x0af6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaf60[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x0af6('0x0'));var util=require(_0x0af6('0x1'));var path=require(_0x0af6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0af6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0af6('0x4'));var config=require(_0x0af6('0x5'));var controller=require(_0x0af6('0x6'));router[_0x0af6('0x7')]('/',auth[_0x0af6('0x8')](),controller[_0x0af6('0x9')]);router[_0x0af6('0x7')]('/:id',auth[_0x0af6('0x8')](),controller[_0x0af6('0xa')]);router['get'](_0x0af6('0xb'),auth[_0x0af6('0x8')](),controller[_0x0af6('0xc')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x0af6('0xd')]);router['get'](_0x0af6('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x0af6('0xf')]('/',auth[_0x0af6('0x8')](),controller[_0x0af6('0x10')]);router['put'](_0x0af6('0x11'),auth[_0x0af6('0x8')](),controller[_0x0af6('0x12')]);router['delete'](_0x0af6('0x11'),auth['isAuthenticated'](),controller[_0x0af6('0x13')]);module['exports']=router; \ No newline at end of file +var _0x6fae=['/:id/descriptions','getDescriptions','post','create','put','delete','destroy','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x3d598b,_0x431fd7){var _0x29d91f=function(_0x20512f){while(--_0x20512f){_0x3d598b['push'](_0x3d598b['shift']());}};_0x29d91f(++_0x431fd7);}(_0x6fae,0x15b));var _0xe6fa=function(_0x4e3ad6,_0xd64999){_0x4e3ad6=_0x4e3ad6-0x0;var _0x5c9131=_0x6fae[_0x4e3ad6];return _0x5c9131;};'use strict';var multer=require('multer');var util=require(_0xe6fa('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe6fa('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe6fa('0x2'));var interaction=require(_0xe6fa('0x3'));var config=require(_0xe6fa('0x4'));var controller=require('./intDynamics365Configuration.controller');router[_0xe6fa('0x5')]('/',auth[_0xe6fa('0x6')](),controller['index']);router[_0xe6fa('0x5')](_0xe6fa('0x7'),auth[_0xe6fa('0x6')](),controller[_0xe6fa('0x8')]);router[_0xe6fa('0x5')](_0xe6fa('0x9'),auth[_0xe6fa('0x6')](),controller[_0xe6fa('0xa')]);router[_0xe6fa('0x5')](_0xe6fa('0xb'),auth['isAuthenticated'](),controller[_0xe6fa('0xc')]);router[_0xe6fa('0x5')](_0xe6fa('0xd'),auth[_0xe6fa('0x6')](),controller[_0xe6fa('0xe')]);router[_0xe6fa('0xf')]('/',auth[_0xe6fa('0x6')](),controller[_0xe6fa('0x10')]);router[_0xe6fa('0x11')]('/:id',auth[_0xe6fa('0x6')](),controller['update']);router[_0xe6fa('0x12')]('/:id',auth[_0xe6fa('0x6')](),controller[_0xe6fa('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 023025e..87c3ebe 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a95=['contact','nothing','exports','incident','phonecall','ENUM'];(function(_0x5163ba,_0x5e841e){var _0x562e78=function(_0x2f3139){while(--_0x2f3139){_0x5163ba['push'](_0x5163ba['shift']());}};_0x562e78(++_0x5e841e);}(_0x9a95,0x1ac));var _0x59a9=function(_0x387b1e,_0x5e49af){_0x387b1e=_0x387b1e-0x0;var _0x46e159=_0x9a95[_0x387b1e];return _0x46e159;};'use strict';var Sequelize=require('sequelize');module[_0x59a9('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x59a9('0x1'),_0x59a9('0x2')),'defaultValue':_0x59a9('0x1')},'moduleCreate':{'type':Sequelize[_0x59a9('0x3')](_0x59a9('0x4'),_0x59a9('0x5')),'defaultValue':_0x59a9('0x4'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xd739=['nothing','contact','exports','STRING','ENUM','phonecall'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xd739,0xaa));var _0x9d73=function(_0xd9be2b,_0x38a45){_0xd9be2b=_0xd9be2b-0x0;var _0x4d9656=_0xd739[_0xd9be2b];return _0x4d9656;};'use strict';var Sequelize=require('sequelize');module[_0x9d73('0x0')]={'name':{'type':Sequelize[_0x9d73('0x1')]},'description':{'type':Sequelize[_0x9d73('0x1')]},'ticketType':{'type':Sequelize[_0x9d73('0x2')]('incident',_0x9d73('0x3')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x9d73('0x2')]('contact',_0x9d73('0x4')),'defaultValue':_0x9d73('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x9d73('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 92c6dc7..06b8c14 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c28=['body','getFields','Dynamics365Field','length','nolimit','getSubjects','findOne','params','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','offset','count','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','fieldName','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','Dynamics365Configuration','catch','show','rawAttributes','includeAll','find','create'];(function(_0x1624f5,_0xa2f147){var _0x23b431=function(_0x5393d4){while(--_0x5393d4){_0x1624f5['push'](_0x1624f5['shift']());}};_0x23b431(++_0xa2f147);}(_0x8c28,0xa9));var _0x88c2=function(_0x137003,_0x131321){_0x137003=_0x137003-0x0;var _0x27bf65=_0x8c28[_0x137003];return _0x27bf65;};'use strict';var emlformat=require(_0x88c2('0x0'));var rimraf=require(_0x88c2('0x1'));var zipdir=require(_0x88c2('0x2'));var jsonpatch=require(_0x88c2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x88c2('0x4'));var Mustache=require(_0x88c2('0x5'));var util=require(_0x88c2('0x6'));var path=require(_0x88c2('0x7'));var sox=require(_0x88c2('0x8'));var csv=require(_0x88c2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x88c2('0xa'));var _=require(_0x88c2('0xb'));var squel=require(_0x88c2('0xc'));var crypto=require(_0x88c2('0xd'));var jsforce=require(_0x88c2('0xe'));var deskjs=require(_0x88c2('0xf'));var toCsv=require(_0x88c2('0x9'));var querystring=require(_0x88c2('0x10'));var Papa=require(_0x88c2('0x11'));var Redis=require(_0x88c2('0x12'));var authService=require(_0x88c2('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x88c2('0x14'));var logger=require(_0x88c2('0x15'))(_0x88c2('0x16'));var utils=require(_0x88c2('0x17'));var config=require(_0x88c2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x88c2('0x19'))['db'];function respondWithStatusCode(_0x4a31b2,_0x24da6b){_0x24da6b=_0x24da6b||0xcc;return function(_0x16aedb){if(_0x16aedb){return _0x4a31b2['sendStatus'](_0x24da6b);}return _0x4a31b2['status'](_0x24da6b)['end']();};}function respondWithResult(_0x20c45c,_0x50ea38){_0x50ea38=_0x50ea38||0xc8;return function(_0x13ad60){if(_0x13ad60){return _0x20c45c[_0x88c2('0x1a')](_0x50ea38)[_0x88c2('0x1b')](_0x13ad60);}};}function respondWithFilteredResult(_0x11f325,_0x4848bc){return function(_0x35d818){if(_0x35d818){var _0x57b14a=typeof _0x4848bc['offset']===_0x88c2('0x1c')&&typeof _0x4848bc['limit']===_0x88c2('0x1c');var _0x30446d=_0x35d818['count'];var _0x12005f=_0x57b14a?0x0:_0x4848bc[_0x88c2('0x1d')];var _0x3b6b34=_0x57b14a?_0x35d818[_0x88c2('0x1e')]:_0x4848bc[_0x88c2('0x1d')]+_0x4848bc[_0x88c2('0x1f')];var _0x59fa02;if(_0x3b6b34>=_0x30446d){_0x3b6b34=_0x30446d;_0x59fa02=0xc8;}else{_0x59fa02=0xce;}_0x11f325[_0x88c2('0x1a')](_0x59fa02);return _0x11f325['set'](_0x88c2('0x20'),_0x12005f+'-'+_0x3b6b34+'/'+_0x30446d)[_0x88c2('0x1b')](_0x35d818);}return null;};}function patchUpdates(_0x4d28d4){return function(_0x1fd889){try{jsonpatch[_0x88c2('0x21')](_0x1fd889,_0x4d28d4,!![]);}catch(_0x16504b){return BPromise[_0x88c2('0x22')](_0x16504b);}return _0x1fd889[_0x88c2('0x23')]();};}function saveUpdates(_0x4c732a,_0x9ffa77){return function(_0x2c2468){if(_0x2c2468){return _0x2c2468[_0x88c2('0x24')](_0x4c732a)[_0x88c2('0x25')](function(_0x11b4de){return _0x11b4de;});}return null;};}function removeEntity(_0xd78f0e,_0x5309ba){return function(_0x469fd6){if(_0x469fd6){return _0x469fd6[_0x88c2('0x26')]()[_0x88c2('0x25')](function(){_0xd78f0e[_0x88c2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57806f,_0x32182d){return function(_0x554761){if(!_0x554761){_0x57806f[_0x88c2('0x27')](0x194);}return _0x554761;};}function handleError(_0x102a5a,_0x5d7b7a){_0x5d7b7a=_0x5d7b7a||0x1f4;return function(_0x8cb7f0){logger[_0x88c2('0x28')](_0x8cb7f0[_0x88c2('0x29')]);if(_0x8cb7f0[_0x88c2('0x2a')]){delete _0x8cb7f0['name'];}_0x102a5a[_0x88c2('0x1a')](_0x5d7b7a)['send'](_0x8cb7f0);};}exports[_0x88c2('0x2b')]=function(_0x20ab85,_0x222bd4){var _0x2193e9={},_0xd4f022={},_0x1ce6a5={'count':0x0,'rows':[]};var _0x29d12b=_[_0x88c2('0x2c')](db['Dynamics365Configuration']['rawAttributes'],function(_0x5c32ef){return{'name':_0x5c32ef[_0x88c2('0x2d')],'type':_0x5c32ef['type']['key']};});_0xd4f022[_0x88c2('0x2e')]=_[_0x88c2('0x2c')](_0x29d12b,'name');_0xd4f022[_0x88c2('0x2f')]=_[_0x88c2('0x30')](_0x20ab85[_0x88c2('0x2f')]);_0xd4f022[_0x88c2('0x31')]=_[_0x88c2('0x32')](_0xd4f022['model'],_0xd4f022[_0x88c2('0x2f')]);_0x2193e9['attributes']=_[_0x88c2('0x32')](_0xd4f022[_0x88c2('0x2e')],qs[_0x88c2('0x33')](_0x20ab85['query'][_0x88c2('0x33')]));_0x2193e9[_0x88c2('0x34')]=_0x2193e9[_0x88c2('0x34')]['length']?_0x2193e9[_0x88c2('0x34')]:_0xd4f022[_0x88c2('0x2e')];if(!_0x20ab85['query'][_0x88c2('0x35')]('nolimit')){_0x2193e9[_0x88c2('0x1f')]=qs[_0x88c2('0x1f')](_0x20ab85[_0x88c2('0x2f')]['limit']);_0x2193e9[_0x88c2('0x1d')]=qs[_0x88c2('0x1d')](_0x20ab85['query']['offset']);}_0x2193e9[_0x88c2('0x36')]=qs[_0x88c2('0x37')](_0x20ab85['query'][_0x88c2('0x37')]);_0x2193e9['where']=qs['filters'](_[_0x88c2('0x38')](_0x20ab85[_0x88c2('0x2f')],_0xd4f022[_0x88c2('0x31')]),_0x29d12b);if(_0x20ab85[_0x88c2('0x2f')][_0x88c2('0x39')]){_0x2193e9[_0x88c2('0x3a')]=_[_0x88c2('0x3b')](_0x2193e9[_0x88c2('0x3a')],{'$or':_[_0x88c2('0x2c')](_0x29d12b,function(_0x45e24e){if(_0x45e24e[_0x88c2('0x3c')]!==_0x88c2('0x3d')){var _0x5d61c4={};_0x5d61c4[_0x45e24e[_0x88c2('0x2a')]]={'$like':'%'+_0x20ab85[_0x88c2('0x2f')][_0x88c2('0x39')]+'%'};return _0x5d61c4;}})});}_0x2193e9=_[_0x88c2('0x3b')]({},_0x2193e9,_0x20ab85[_0x88c2('0x3e')]);var _0x520fc9={'where':_0x2193e9[_0x88c2('0x3a')]};return db['Dynamics365Configuration'][_0x88c2('0x1e')](_0x520fc9)[_0x88c2('0x25')](function(_0x4dd3b7){_0x1ce6a5['count']=_0x4dd3b7;if(_0x20ab85['query']['includeAll']){_0x2193e9[_0x88c2('0x3f')]=[{'all':!![]}];}return db[_0x88c2('0x40')]['findAll'](_0x2193e9);})[_0x88c2('0x25')](function(_0x2a206e){_0x1ce6a5['rows']=_0x2a206e;return _0x1ce6a5;})[_0x88c2('0x25')](respondWithFilteredResult(_0x222bd4,_0x2193e9))[_0x88c2('0x41')](handleError(_0x222bd4,null));};exports[_0x88c2('0x42')]=function(_0x25a949,_0x553186){var _0x20e3e9={'raw':![],'where':{'id':_0x25a949['params']['id']}},_0x3ccb7e={};_0x3ccb7e[_0x88c2('0x2e')]=_[_0x88c2('0x30')](db['Dynamics365Configuration'][_0x88c2('0x43')]);_0x3ccb7e[_0x88c2('0x2f')]=_[_0x88c2('0x30')](_0x25a949['query']);_0x3ccb7e[_0x88c2('0x31')]=_['intersection'](_0x3ccb7e[_0x88c2('0x2e')],_0x3ccb7e[_0x88c2('0x2f')]);_0x20e3e9['attributes']=_[_0x88c2('0x32')](_0x3ccb7e[_0x88c2('0x2e')],qs['fields'](_0x25a949[_0x88c2('0x2f')]['fields']));_0x20e3e9[_0x88c2('0x34')]=_0x20e3e9[_0x88c2('0x34')]['length']?_0x20e3e9[_0x88c2('0x34')]:_0x3ccb7e[_0x88c2('0x2e')];if(_0x25a949[_0x88c2('0x2f')][_0x88c2('0x44')]){_0x20e3e9['include']=[{'all':!![]}];}_0x20e3e9=_[_0x88c2('0x3b')]({},_0x20e3e9,_0x25a949[_0x88c2('0x3e')]);return db[_0x88c2('0x40')][_0x88c2('0x45')](_0x20e3e9)[_0x88c2('0x25')](handleEntityNotFound(_0x553186,null))['then'](respondWithResult(_0x553186,null))[_0x88c2('0x41')](handleError(_0x553186,null));};exports[_0x88c2('0x46')]=function(_0x23bd67,_0xda6a33){return db['Dynamics365Configuration'][_0x88c2('0x46')](_0x23bd67['body'],{})[_0x88c2('0x25')](respondWithResult(_0xda6a33,0xc9))['catch'](handleError(_0xda6a33,null));};exports[_0x88c2('0x24')]=function(_0x5a0915,_0x345b6c){if(_0x5a0915[_0x88c2('0x47')]['id']){delete _0x5a0915[_0x88c2('0x47')]['id'];}return db[_0x88c2('0x40')][_0x88c2('0x45')]({'where':{'id':_0x5a0915['params']['id']}})[_0x88c2('0x25')](handleEntityNotFound(_0x345b6c,null))[_0x88c2('0x25')](saveUpdates(_0x5a0915[_0x88c2('0x47')],null))[_0x88c2('0x25')](respondWithResult(_0x345b6c,null))[_0x88c2('0x41')](handleError(_0x345b6c,null));};exports[_0x88c2('0x26')]=function(_0x5bbbf1,_0x55a464){return db[_0x88c2('0x40')]['find']({'where':{'id':_0x5bbbf1['params']['id']}})[_0x88c2('0x25')](handleEntityNotFound(_0x55a464,null))[_0x88c2('0x25')](removeEntity(_0x55a464,null))['catch'](handleError(_0x55a464,null));};exports[_0x88c2('0x48')]=function(_0x4beedf,_0x4eea56,_0x1bc12a){var _0x2dcce6={};var _0x553aef={};var _0x1e669c;var _0x3df778;return db[_0x88c2('0x40')]['findOne']({'where':{'id':_0x4beedf['params']['id']}})[_0x88c2('0x25')](handleEntityNotFound(_0x4eea56,null))['then'](function(_0x411359){if(_0x411359){_0x1e669c=_0x411359;_0x553aef[_0x88c2('0x2e')]=_[_0x88c2('0x30')](db[_0x88c2('0x49')][_0x88c2('0x43')]);_0x553aef[_0x88c2('0x2f')]=_[_0x88c2('0x30')](_0x4beedf[_0x88c2('0x2f')]);_0x553aef[_0x88c2('0x31')]=_[_0x88c2('0x32')](_0x553aef[_0x88c2('0x2e')],_0x553aef['query']);_0x2dcce6[_0x88c2('0x34')]=_[_0x88c2('0x32')](_0x553aef['model'],qs['fields'](_0x4beedf['query']['fields']));_0x2dcce6[_0x88c2('0x34')]=_0x2dcce6[_0x88c2('0x34')][_0x88c2('0x4a')]?_0x2dcce6[_0x88c2('0x34')]:_0x553aef[_0x88c2('0x2e')];_0x2dcce6[_0x88c2('0x36')]=qs['sort'](_0x4beedf['query'][_0x88c2('0x37')]);_0x2dcce6[_0x88c2('0x3a')]=qs[_0x88c2('0x31')](_[_0x88c2('0x38')](_0x4beedf['query'],_0x553aef['filters']));if(_0x4beedf[_0x88c2('0x2f')][_0x88c2('0x39')]){_0x2dcce6[_0x88c2('0x3a')]=_['merge'](_0x2dcce6[_0x88c2('0x3a')],{'$or':_[_0x88c2('0x2c')](_0x2dcce6['attributes'],function(_0x2ec17c){var _0x526bec={};_0x526bec[_0x2ec17c]={'$like':'%'+_0x4beedf[_0x88c2('0x2f')][_0x88c2('0x39')]+'%'};return _0x526bec;})});}_0x2dcce6=_['merge']({},_0x2dcce6,_0x4beedf['options']);return _0x1e669c[_0x88c2('0x48')](_0x2dcce6);}})[_0x88c2('0x25')](function(_0x2badf3){if(_0x2badf3){_0x3df778=_0x2badf3[_0x88c2('0x4a')];if(!_0x4beedf[_0x88c2('0x2f')][_0x88c2('0x35')](_0x88c2('0x4b'))){_0x2dcce6[_0x88c2('0x1f')]=qs[_0x88c2('0x1f')](_0x4beedf[_0x88c2('0x2f')][_0x88c2('0x1f')]);_0x2dcce6[_0x88c2('0x1d')]=qs[_0x88c2('0x1d')](_0x4beedf[_0x88c2('0x2f')][_0x88c2('0x1d')]);}return _0x1e669c[_0x88c2('0x48')](_0x2dcce6);}})[_0x88c2('0x25')](function(_0x3529e7){if(_0x3529e7){return _0x3529e7?{'count':_0x3df778,'rows':_0x3529e7}:null;}})['then'](respondWithResult(_0x4eea56,null))[_0x88c2('0x41')](handleError(_0x4eea56,null));};exports[_0x88c2('0x4c')]=function(_0x1928f8,_0x1a4b71,_0x42b604){var _0x269e0c={};var _0x57d005={};var _0x228712;var _0x38f57d;return db[_0x88c2('0x40')][_0x88c2('0x4d')]({'where':{'id':_0x1928f8[_0x88c2('0x4e')]['id']}})[_0x88c2('0x25')](handleEntityNotFound(_0x1a4b71,null))[_0x88c2('0x25')](function(_0x317d7e){if(_0x317d7e){_0x228712=_0x317d7e;_0x57d005[_0x88c2('0x2e')]=_['keys'](db[_0x88c2('0x49')][_0x88c2('0x43')]);_0x57d005[_0x88c2('0x2f')]=_[_0x88c2('0x30')](_0x1928f8[_0x88c2('0x2f')]);_0x57d005['filters']=_[_0x88c2('0x32')](_0x57d005[_0x88c2('0x2e')],_0x57d005[_0x88c2('0x2f')]);_0x269e0c['attributes']=_[_0x88c2('0x32')](_0x57d005['model'],qs[_0x88c2('0x33')](_0x1928f8[_0x88c2('0x2f')][_0x88c2('0x33')]));_0x269e0c[_0x88c2('0x34')]=_0x269e0c['attributes'][_0x88c2('0x4a')]?_0x269e0c['attributes']:_0x57d005[_0x88c2('0x2e')];_0x269e0c[_0x88c2('0x36')]=qs['sort'](_0x1928f8['query'][_0x88c2('0x37')]);_0x269e0c[_0x88c2('0x3a')]=qs[_0x88c2('0x31')](_['pick'](_0x1928f8[_0x88c2('0x2f')],_0x57d005[_0x88c2('0x31')]));if(_0x1928f8[_0x88c2('0x2f')][_0x88c2('0x39')]){_0x269e0c[_0x88c2('0x3a')]=_[_0x88c2('0x3b')](_0x269e0c[_0x88c2('0x3a')],{'$or':_[_0x88c2('0x2c')](_0x269e0c['attributes'],function(_0x5e1c48){var _0x4a3de3={};_0x4a3de3[_0x5e1c48]={'$like':'%'+_0x1928f8['query'][_0x88c2('0x39')]+'%'};return _0x4a3de3;})});}_0x269e0c=_[_0x88c2('0x3b')]({},_0x269e0c,_0x1928f8[_0x88c2('0x3e')]);return _0x228712[_0x88c2('0x4c')](_0x269e0c);}})['then'](function(_0x29c8a8){if(_0x29c8a8){_0x38f57d=_0x29c8a8[_0x88c2('0x4a')];if(!_0x1928f8[_0x88c2('0x2f')][_0x88c2('0x35')](_0x88c2('0x4b'))){_0x269e0c[_0x88c2('0x1f')]=qs[_0x88c2('0x1f')](_0x1928f8[_0x88c2('0x2f')]['limit']);_0x269e0c[_0x88c2('0x1d')]=qs[_0x88c2('0x1d')](_0x1928f8[_0x88c2('0x2f')][_0x88c2('0x1d')]);}return _0x228712[_0x88c2('0x4c')](_0x269e0c);}})['then'](function(_0xcb9377){if(_0xcb9377){return _0xcb9377?{'count':_0x38f57d,'rows':_0xcb9377}:null;}})[_0x88c2('0x25')](respondWithResult(_0x1a4b71,null))[_0x88c2('0x41')](handleError(_0x1a4b71,null));};exports['getDescriptions']=function(_0x2b71d3,_0x28e24d,_0x5bf65b){var _0x32a22a={};var _0x2ca6f3={};var _0x32492c;var _0x3d9041;return db[_0x88c2('0x40')][_0x88c2('0x4d')]({'where':{'id':_0x2b71d3[_0x88c2('0x4e')]['id']}})[_0x88c2('0x25')](handleEntityNotFound(_0x28e24d,null))[_0x88c2('0x25')](function(_0x38d512){if(_0x38d512){_0x32492c=_0x38d512;_0x2ca6f3['model']=_[_0x88c2('0x30')](db[_0x88c2('0x49')]['rawAttributes']);_0x2ca6f3[_0x88c2('0x2f')]=_[_0x88c2('0x30')](_0x2b71d3[_0x88c2('0x2f')]);_0x2ca6f3[_0x88c2('0x31')]=_[_0x88c2('0x32')](_0x2ca6f3[_0x88c2('0x2e')],_0x2ca6f3[_0x88c2('0x2f')]);_0x32a22a[_0x88c2('0x34')]=_['intersection'](_0x2ca6f3[_0x88c2('0x2e')],qs['fields'](_0x2b71d3[_0x88c2('0x2f')]['fields']));_0x32a22a[_0x88c2('0x34')]=_0x32a22a[_0x88c2('0x34')][_0x88c2('0x4a')]?_0x32a22a[_0x88c2('0x34')]:_0x2ca6f3[_0x88c2('0x2e')];_0x32a22a[_0x88c2('0x36')]=qs['sort'](_0x2b71d3[_0x88c2('0x2f')][_0x88c2('0x37')]);_0x32a22a['where']=qs[_0x88c2('0x31')](_['pick'](_0x2b71d3[_0x88c2('0x2f')],_0x2ca6f3[_0x88c2('0x31')]));if(_0x2b71d3['query'][_0x88c2('0x39')]){_0x32a22a[_0x88c2('0x3a')]=_[_0x88c2('0x3b')](_0x32a22a[_0x88c2('0x3a')],{'$or':_[_0x88c2('0x2c')](_0x32a22a[_0x88c2('0x34')],function(_0x1c1be1){var _0x1bb32e={};_0x1bb32e[_0x1c1be1]={'$like':'%'+_0x2b71d3[_0x88c2('0x2f')][_0x88c2('0x39')]+'%'};return _0x1bb32e;})});}_0x32a22a=_[_0x88c2('0x3b')]({},_0x32a22a,_0x2b71d3[_0x88c2('0x3e')]);return _0x32492c[_0x88c2('0x4f')](_0x32a22a);}})[_0x88c2('0x25')](function(_0x2b89f1){if(_0x2b89f1){_0x3d9041=_0x2b89f1[_0x88c2('0x4a')];if(!_0x2b71d3[_0x88c2('0x2f')][_0x88c2('0x35')](_0x88c2('0x4b'))){_0x32a22a[_0x88c2('0x1f')]=qs[_0x88c2('0x1f')](_0x2b71d3[_0x88c2('0x2f')][_0x88c2('0x1f')]);_0x32a22a[_0x88c2('0x1d')]=qs[_0x88c2('0x1d')](_0x2b71d3[_0x88c2('0x2f')][_0x88c2('0x1d')]);}return _0x32492c[_0x88c2('0x4f')](_0x32a22a);}})[_0x88c2('0x25')](function(_0x276916){if(_0x276916){return _0x276916?{'count':_0x3d9041,'rows':_0x276916}:null;}})[_0x88c2('0x25')](respondWithResult(_0x28e24d,null))[_0x88c2('0x41')](handleError(_0x28e24d,null));}; \ No newline at end of file +var _0x3074=['body','getFields','findOne','Dynamics365Field','getSubjects','pick','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','Dynamics365Configuration','findAll','rows','catch','show','params','merge','find','create'];(function(_0x37253c,_0x5a9041){var _0x4f0157=function(_0x2c9344){while(--_0x2c9344){_0x37253c['push'](_0x37253c['shift']());}};_0x4f0157(++_0x5a9041);}(_0x3074,0xa7));var _0x4307=function(_0x4fe711,_0x5125e9){_0x4fe711=_0x4fe711-0x0;var _0x3db623=_0x3074[_0x4fe711];return _0x3db623;};'use strict';var emlformat=require(_0x4307('0x0'));var rimraf=require(_0x4307('0x1'));var zipdir=require(_0x4307('0x2'));var jsonpatch=require(_0x4307('0x3'));var rp=require(_0x4307('0x4'));var moment=require('moment');var BPromise=require(_0x4307('0x5'));var Mustache=require('mustache');var util=require(_0x4307('0x6'));var path=require('path');var sox=require(_0x4307('0x7'));var csv=require(_0x4307('0x8'));var ejs=require(_0x4307('0x9'));var fs=require('fs');var fs_extra=require(_0x4307('0xa'));var _=require('lodash');var squel=require(_0x4307('0xb'));var crypto=require(_0x4307('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4307('0xd'));var toCsv=require(_0x4307('0x8'));var querystring=require(_0x4307('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4307('0xf'));var qs=require(_0x4307('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4307('0x11'));var logger=require(_0x4307('0x12'))('api');var utils=require(_0x4307('0x13'));var config=require(_0x4307('0x14'));var licenseUtil=require(_0x4307('0x15'));var db=require(_0x4307('0x16'))['db'];function respondWithStatusCode(_0x33b472,_0x3ed930){_0x3ed930=_0x3ed930||0xcc;return function(_0x3c07df){if(_0x3c07df){return _0x33b472['sendStatus'](_0x3ed930);}return _0x33b472[_0x4307('0x17')](_0x3ed930)[_0x4307('0x18')]();};}function respondWithResult(_0x37cd98,_0x23ce93){_0x23ce93=_0x23ce93||0xc8;return function(_0x476cc3){if(_0x476cc3){return _0x37cd98[_0x4307('0x17')](_0x23ce93)[_0x4307('0x19')](_0x476cc3);}};}function respondWithFilteredResult(_0x1dbc4c,_0x3d9ce8){return function(_0x337918){if(_0x337918){var _0x5f4439=typeof _0x3d9ce8[_0x4307('0x1a')]===_0x4307('0x1b')&&typeof _0x3d9ce8[_0x4307('0x1c')]===_0x4307('0x1b');var _0x40a2fc=_0x337918[_0x4307('0x1d')];var _0x109a67=_0x5f4439?0x0:_0x3d9ce8[_0x4307('0x1a')];var _0x1ce066=_0x5f4439?_0x337918[_0x4307('0x1d')]:_0x3d9ce8[_0x4307('0x1a')]+_0x3d9ce8[_0x4307('0x1c')];var _0x4597bb;if(_0x1ce066>=_0x40a2fc){_0x1ce066=_0x40a2fc;_0x4597bb=0xc8;}else{_0x4597bb=0xce;}_0x1dbc4c['status'](_0x4597bb);return _0x1dbc4c[_0x4307('0x1e')](_0x4307('0x1f'),_0x109a67+'-'+_0x1ce066+'/'+_0x40a2fc)[_0x4307('0x19')](_0x337918);}return null;};}function patchUpdates(_0x18da2d){return function(_0x543459){try{jsonpatch[_0x4307('0x20')](_0x543459,_0x18da2d,!![]);}catch(_0x13bba9){return BPromise[_0x4307('0x21')](_0x13bba9);}return _0x543459[_0x4307('0x22')]();};}function saveUpdates(_0x220965,_0x342468){return function(_0x212b8e){if(_0x212b8e){return _0x212b8e[_0x4307('0x23')](_0x220965)['then'](function(_0x2e7fe8){return _0x2e7fe8;});}return null;};}function removeEntity(_0x2a169c,_0x1ff65d){return function(_0x162571){if(_0x162571){return _0x162571[_0x4307('0x24')]()[_0x4307('0x25')](function(){_0x2a169c[_0x4307('0x17')](0xcc)[_0x4307('0x18')]();});}};}function handleEntityNotFound(_0x4da2f3,_0x367349){return function(_0x237fdb){if(!_0x237fdb){_0x4da2f3[_0x4307('0x26')](0x194);}return _0x237fdb;};}function handleError(_0x526148,_0x5e39b5){_0x5e39b5=_0x5e39b5||0x1f4;return function(_0x50c0b1){logger['error'](_0x50c0b1[_0x4307('0x27')]);if(_0x50c0b1[_0x4307('0x28')]){delete _0x50c0b1[_0x4307('0x28')];}_0x526148['status'](_0x5e39b5)['send'](_0x50c0b1);};}exports[_0x4307('0x29')]=function(_0x312baa,_0x5d59f1){var _0x3f70c1={},_0x3f3b02={},_0x3d9890={'count':0x0,'rows':[]};var _0x402d65=_['map'](db['Dynamics365Configuration'][_0x4307('0x2a')],function(_0x2f187b){return{'name':_0x2f187b[_0x4307('0x2b')],'type':_0x2f187b[_0x4307('0x2c')]['key']};});_0x3f3b02[_0x4307('0x2d')]=_[_0x4307('0x2e')](_0x402d65,'name');_0x3f3b02[_0x4307('0x2f')]=_[_0x4307('0x30')](_0x312baa[_0x4307('0x2f')]);_0x3f3b02[_0x4307('0x31')]=_[_0x4307('0x32')](_0x3f3b02['model'],_0x3f3b02[_0x4307('0x2f')]);_0x3f70c1[_0x4307('0x33')]=_[_0x4307('0x32')](_0x3f3b02[_0x4307('0x2d')],qs[_0x4307('0x34')](_0x312baa[_0x4307('0x2f')]['fields']));_0x3f70c1[_0x4307('0x33')]=_0x3f70c1[_0x4307('0x33')][_0x4307('0x35')]?_0x3f70c1['attributes']:_0x3f3b02[_0x4307('0x2d')];if(!_0x312baa[_0x4307('0x2f')][_0x4307('0x36')](_0x4307('0x37'))){_0x3f70c1[_0x4307('0x1c')]=qs['limit'](_0x312baa[_0x4307('0x2f')]['limit']);_0x3f70c1[_0x4307('0x1a')]=qs[_0x4307('0x1a')](_0x312baa[_0x4307('0x2f')]['offset']);}_0x3f70c1[_0x4307('0x38')]=qs[_0x4307('0x39')](_0x312baa[_0x4307('0x2f')]['sort']);_0x3f70c1[_0x4307('0x3a')]=qs[_0x4307('0x31')](_['pick'](_0x312baa[_0x4307('0x2f')],_0x3f3b02[_0x4307('0x31')]),_0x402d65);if(_0x312baa[_0x4307('0x2f')][_0x4307('0x3b')]){_0x3f70c1['where']=_['merge'](_0x3f70c1[_0x4307('0x3a')],{'$or':_['map'](_0x402d65,function(_0x51f89e){if(_0x51f89e[_0x4307('0x2c')]!==_0x4307('0x3c')){var _0x2f6116={};_0x2f6116[_0x51f89e[_0x4307('0x28')]]={'$like':'%'+_0x312baa[_0x4307('0x2f')][_0x4307('0x3b')]+'%'};return _0x2f6116;}})});}_0x3f70c1=_['merge']({},_0x3f70c1,_0x312baa[_0x4307('0x3d')]);var _0x6dfef3={'where':_0x3f70c1['where']};return db['Dynamics365Configuration'][_0x4307('0x1d')](_0x6dfef3)[_0x4307('0x25')](function(_0x20a78f){_0x3d9890['count']=_0x20a78f;if(_0x312baa[_0x4307('0x2f')][_0x4307('0x3e')]){_0x3f70c1[_0x4307('0x3f')]=[{'all':!![]}];}return db[_0x4307('0x40')][_0x4307('0x41')](_0x3f70c1);})['then'](function(_0x193cfd){_0x3d9890[_0x4307('0x42')]=_0x193cfd;return _0x3d9890;})[_0x4307('0x25')](respondWithFilteredResult(_0x5d59f1,_0x3f70c1))[_0x4307('0x43')](handleError(_0x5d59f1,null));};exports[_0x4307('0x44')]=function(_0x26c067,_0x39a2e4){var _0x1605d9={'raw':![],'where':{'id':_0x26c067[_0x4307('0x45')]['id']}},_0x185bf0={};_0x185bf0[_0x4307('0x2d')]=_[_0x4307('0x30')](db[_0x4307('0x40')][_0x4307('0x2a')]);_0x185bf0[_0x4307('0x2f')]=_[_0x4307('0x30')](_0x26c067[_0x4307('0x2f')]);_0x185bf0[_0x4307('0x31')]=_[_0x4307('0x32')](_0x185bf0['model'],_0x185bf0['query']);_0x1605d9[_0x4307('0x33')]=_[_0x4307('0x32')](_0x185bf0['model'],qs['fields'](_0x26c067['query']['fields']));_0x1605d9[_0x4307('0x33')]=_0x1605d9[_0x4307('0x33')][_0x4307('0x35')]?_0x1605d9['attributes']:_0x185bf0[_0x4307('0x2d')];if(_0x26c067[_0x4307('0x2f')][_0x4307('0x3e')]){_0x1605d9[_0x4307('0x3f')]=[{'all':!![]}];}_0x1605d9=_[_0x4307('0x46')]({},_0x1605d9,_0x26c067[_0x4307('0x3d')]);return db[_0x4307('0x40')][_0x4307('0x47')](_0x1605d9)[_0x4307('0x25')](handleEntityNotFound(_0x39a2e4,null))['then'](respondWithResult(_0x39a2e4,null))['catch'](handleError(_0x39a2e4,null));};exports[_0x4307('0x48')]=function(_0x1ffd39,_0x433fb2){return db[_0x4307('0x40')][_0x4307('0x48')](_0x1ffd39[_0x4307('0x49')],{})['then'](respondWithResult(_0x433fb2,0xc9))[_0x4307('0x43')](handleError(_0x433fb2,null));};exports[_0x4307('0x23')]=function(_0x36bca9,_0x4542ba){if(_0x36bca9['body']['id']){delete _0x36bca9[_0x4307('0x49')]['id'];}return db[_0x4307('0x40')]['find']({'where':{'id':_0x36bca9[_0x4307('0x45')]['id']}})[_0x4307('0x25')](handleEntityNotFound(_0x4542ba,null))[_0x4307('0x25')](saveUpdates(_0x36bca9[_0x4307('0x49')],null))[_0x4307('0x25')](respondWithResult(_0x4542ba,null))[_0x4307('0x43')](handleError(_0x4542ba,null));};exports[_0x4307('0x24')]=function(_0x44f0df,_0x265116){return db['Dynamics365Configuration'][_0x4307('0x47')]({'where':{'id':_0x44f0df['params']['id']}})['then'](handleEntityNotFound(_0x265116,null))[_0x4307('0x25')](removeEntity(_0x265116,null))[_0x4307('0x43')](handleError(_0x265116,null));};exports[_0x4307('0x4a')]=function(_0x3ceb42,_0x172653,_0x49475b){var _0x450949={};var _0x28d85b={};var _0x3e14f7;var _0x137b10;return db[_0x4307('0x40')][_0x4307('0x4b')]({'where':{'id':_0x3ceb42[_0x4307('0x45')]['id']}})[_0x4307('0x25')](handleEntityNotFound(_0x172653,null))[_0x4307('0x25')](function(_0x7dd022){if(_0x7dd022){_0x3e14f7=_0x7dd022;_0x28d85b[_0x4307('0x2d')]=_[_0x4307('0x30')](db[_0x4307('0x4c')]['rawAttributes']);_0x28d85b[_0x4307('0x2f')]=_[_0x4307('0x30')](_0x3ceb42['query']);_0x28d85b[_0x4307('0x31')]=_[_0x4307('0x32')](_0x28d85b['model'],_0x28d85b[_0x4307('0x2f')]);_0x450949[_0x4307('0x33')]=_[_0x4307('0x32')](_0x28d85b[_0x4307('0x2d')],qs['fields'](_0x3ceb42[_0x4307('0x2f')][_0x4307('0x34')]));_0x450949[_0x4307('0x33')]=_0x450949[_0x4307('0x33')][_0x4307('0x35')]?_0x450949[_0x4307('0x33')]:_0x28d85b[_0x4307('0x2d')];_0x450949[_0x4307('0x38')]=qs[_0x4307('0x39')](_0x3ceb42[_0x4307('0x2f')][_0x4307('0x39')]);_0x450949[_0x4307('0x3a')]=qs['filters'](_['pick'](_0x3ceb42[_0x4307('0x2f')],_0x28d85b['filters']));if(_0x3ceb42[_0x4307('0x2f')][_0x4307('0x3b')]){_0x450949[_0x4307('0x3a')]=_[_0x4307('0x46')](_0x450949[_0x4307('0x3a')],{'$or':_[_0x4307('0x2e')](_0x450949[_0x4307('0x33')],function(_0x4590ad){var _0x5d45c7={};_0x5d45c7[_0x4590ad]={'$like':'%'+_0x3ceb42['query'][_0x4307('0x3b')]+'%'};return _0x5d45c7;})});}_0x450949=_[_0x4307('0x46')]({},_0x450949,_0x3ceb42[_0x4307('0x3d')]);return _0x3e14f7[_0x4307('0x4a')](_0x450949);}})['then'](function(_0x26d2c9){if(_0x26d2c9){_0x137b10=_0x26d2c9['length'];if(!_0x3ceb42[_0x4307('0x2f')][_0x4307('0x36')]('nolimit')){_0x450949[_0x4307('0x1c')]=qs['limit'](_0x3ceb42[_0x4307('0x2f')]['limit']);_0x450949[_0x4307('0x1a')]=qs['offset'](_0x3ceb42[_0x4307('0x2f')][_0x4307('0x1a')]);}return _0x3e14f7[_0x4307('0x4a')](_0x450949);}})[_0x4307('0x25')](function(_0x6f6786){if(_0x6f6786){return _0x6f6786?{'count':_0x137b10,'rows':_0x6f6786}:null;}})[_0x4307('0x25')](respondWithResult(_0x172653,null))[_0x4307('0x43')](handleError(_0x172653,null));};exports[_0x4307('0x4d')]=function(_0x4a594e,_0x2299de,_0x218169){var _0x181094={};var _0x3512ce={};var _0x36f84a;var _0x441776;return db['Dynamics365Configuration'][_0x4307('0x4b')]({'where':{'id':_0x4a594e[_0x4307('0x45')]['id']}})[_0x4307('0x25')](handleEntityNotFound(_0x2299de,null))[_0x4307('0x25')](function(_0x17228a){if(_0x17228a){_0x36f84a=_0x17228a;_0x3512ce[_0x4307('0x2d')]=_[_0x4307('0x30')](db['Dynamics365Field'][_0x4307('0x2a')]);_0x3512ce[_0x4307('0x2f')]=_['keys'](_0x4a594e[_0x4307('0x2f')]);_0x3512ce[_0x4307('0x31')]=_[_0x4307('0x32')](_0x3512ce[_0x4307('0x2d')],_0x3512ce[_0x4307('0x2f')]);_0x181094[_0x4307('0x33')]=_[_0x4307('0x32')](_0x3512ce[_0x4307('0x2d')],qs[_0x4307('0x34')](_0x4a594e[_0x4307('0x2f')][_0x4307('0x34')]));_0x181094[_0x4307('0x33')]=_0x181094[_0x4307('0x33')][_0x4307('0x35')]?_0x181094[_0x4307('0x33')]:_0x3512ce[_0x4307('0x2d')];_0x181094[_0x4307('0x38')]=qs[_0x4307('0x39')](_0x4a594e['query']['sort']);_0x181094[_0x4307('0x3a')]=qs[_0x4307('0x31')](_[_0x4307('0x4e')](_0x4a594e['query'],_0x3512ce[_0x4307('0x31')]));if(_0x4a594e['query'][_0x4307('0x3b')]){_0x181094[_0x4307('0x3a')]=_['merge'](_0x181094[_0x4307('0x3a')],{'$or':_[_0x4307('0x2e')](_0x181094['attributes'],function(_0x30332a){var _0x5e4eb9={};_0x5e4eb9[_0x30332a]={'$like':'%'+_0x4a594e[_0x4307('0x2f')]['filter']+'%'};return _0x5e4eb9;})});}_0x181094=_[_0x4307('0x46')]({},_0x181094,_0x4a594e[_0x4307('0x3d')]);return _0x36f84a[_0x4307('0x4d')](_0x181094);}})['then'](function(_0x162ba0){if(_0x162ba0){_0x441776=_0x162ba0[_0x4307('0x35')];if(!_0x4a594e[_0x4307('0x2f')][_0x4307('0x36')](_0x4307('0x37'))){_0x181094[_0x4307('0x1c')]=qs[_0x4307('0x1c')](_0x4a594e[_0x4307('0x2f')][_0x4307('0x1c')]);_0x181094[_0x4307('0x1a')]=qs[_0x4307('0x1a')](_0x4a594e[_0x4307('0x2f')][_0x4307('0x1a')]);}return _0x36f84a[_0x4307('0x4d')](_0x181094);}})[_0x4307('0x25')](function(_0x4a94e6){if(_0x4a94e6){return _0x4a94e6?{'count':_0x441776,'rows':_0x4a94e6}:null;}})[_0x4307('0x25')](respondWithResult(_0x2299de,null))[_0x4307('0x43')](handleError(_0x2299de,null));};exports[_0x4307('0x4f')]=function(_0x5b9c30,_0x2f65f1,_0x50c034){var _0x1cd79d={};var _0x46cf49={};var _0x1a48a3;var _0x550b7f;return db[_0x4307('0x40')][_0x4307('0x4b')]({'where':{'id':_0x5b9c30['params']['id']}})[_0x4307('0x25')](handleEntityNotFound(_0x2f65f1,null))[_0x4307('0x25')](function(_0x5f3259){if(_0x5f3259){_0x1a48a3=_0x5f3259;_0x46cf49[_0x4307('0x2d')]=_['keys'](db[_0x4307('0x4c')][_0x4307('0x2a')]);_0x46cf49[_0x4307('0x2f')]=_[_0x4307('0x30')](_0x5b9c30[_0x4307('0x2f')]);_0x46cf49[_0x4307('0x31')]=_[_0x4307('0x32')](_0x46cf49[_0x4307('0x2d')],_0x46cf49[_0x4307('0x2f')]);_0x1cd79d[_0x4307('0x33')]=_[_0x4307('0x32')](_0x46cf49['model'],qs[_0x4307('0x34')](_0x5b9c30[_0x4307('0x2f')][_0x4307('0x34')]));_0x1cd79d[_0x4307('0x33')]=_0x1cd79d[_0x4307('0x33')][_0x4307('0x35')]?_0x1cd79d[_0x4307('0x33')]:_0x46cf49['model'];_0x1cd79d[_0x4307('0x38')]=qs[_0x4307('0x39')](_0x5b9c30[_0x4307('0x2f')][_0x4307('0x39')]);_0x1cd79d[_0x4307('0x3a')]=qs[_0x4307('0x31')](_[_0x4307('0x4e')](_0x5b9c30[_0x4307('0x2f')],_0x46cf49[_0x4307('0x31')]));if(_0x5b9c30[_0x4307('0x2f')][_0x4307('0x3b')]){_0x1cd79d[_0x4307('0x3a')]=_[_0x4307('0x46')](_0x1cd79d['where'],{'$or':_[_0x4307('0x2e')](_0x1cd79d[_0x4307('0x33')],function(_0x526dee){var _0x4e1de5={};_0x4e1de5[_0x526dee]={'$like':'%'+_0x5b9c30[_0x4307('0x2f')][_0x4307('0x3b')]+'%'};return _0x4e1de5;})});}_0x1cd79d=_[_0x4307('0x46')]({},_0x1cd79d,_0x5b9c30[_0x4307('0x3d')]);return _0x1a48a3[_0x4307('0x4f')](_0x1cd79d);}})[_0x4307('0x25')](function(_0x2e0be3){if(_0x2e0be3){_0x550b7f=_0x2e0be3['length'];if(!_0x5b9c30[_0x4307('0x2f')][_0x4307('0x36')]('nolimit')){_0x1cd79d['limit']=qs['limit'](_0x5b9c30[_0x4307('0x2f')][_0x4307('0x1c')]);_0x1cd79d['offset']=qs[_0x4307('0x1a')](_0x5b9c30[_0x4307('0x2f')][_0x4307('0x1a')]);}return _0x1a48a3[_0x4307('0x4f')](_0x1cd79d);}})['then'](function(_0x47213d){if(_0x47213d){return _0x47213d?{'count':_0x550b7f,'rows':_0x47213d}:null;}})['then'](respondWithResult(_0x2f65f1,null))[_0x4307('0x43')](handleError(_0x2f65f1,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 12bdfbc..7ddb83b 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa41a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','int_dynamics365_configurations','lodash','util','api'];(function(_0x3fe51e,_0x34060e){var _0xf53951=function(_0xfb680f){while(--_0xfb680f){_0x3fe51e['push'](_0x3fe51e['shift']());}};_0xf53951(++_0x34060e);}(_0xa41a,0x6b));var _0xaa41=function(_0x5ac0d9,_0x5463df){_0x5ac0d9=_0x5ac0d9-0x0;var _0x28e7d6=_0xa41a[_0x5ac0d9];return _0x28e7d6;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var logger=require('../../config/logger')(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var BPromise=require(_0xaa41('0x4'));var rp=require(_0xaa41('0x5'));var fs=require('fs');var path=require(_0xaa41('0x6'));var rimraf=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var attributes=require(_0xaa41('0x9'));module['exports']=function(_0x2122a0,_0x1ec9d4){return _0x2122a0['define']('Dynamics365Configuration',attributes,{'tableName':_0xaa41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5bef0b,_0x17f8ab){var _0x440fc9=function(_0x55ede0){while(--_0x55ede0){_0x5bef0b['push'](_0x5bef0b['shift']());}};_0x440fc9(++_0x17f8ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index ac0ad14..09568df 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf41f=['catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x141683,_0x439c14){var _0x233d2e=function(_0x487347){while(--_0x487347){_0x141683['push'](_0x141683['shift']());}};_0x233d2e(++_0x439c14);}(_0xf41f,0x155));var _0xff41=function(_0x4757c6,_0x2bb129){_0x4757c6=_0x4757c6-0x0;var _0x327df8=_0xf41f[_0x4757c6];return _0x327df8;};'use strict';var _=require('lodash');var util=require(_0xff41('0x0'));var moment=require(_0xff41('0x1'));var BPromise=require('bluebird');var rs=require(_0xff41('0x2'));var fs=require('fs');var Redis=require(_0xff41('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xff41('0x4'));var logger=require(_0xff41('0x5'))(_0xff41('0x6'));var config=require(_0xff41('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xff41('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ab555,_0x2303dc,_0x177a44){return new BPromise(function(_0x4eca09,_0x3cbec5){return client[_0xff41('0x9')](_0x1ab555,_0x177a44)['then'](function(_0x5167bf){logger[_0xff41('0xa')](_0xff41('0xb'),_0x2303dc,_0xff41('0xc'));logger[_0xff41('0xd')](_0xff41('0xe'),_0x2303dc,_0xff41('0xc'),JSON['stringify'](_0x5167bf));if(_0x5167bf[_0xff41('0xf')]){if(_0x5167bf[_0xff41('0xf')][_0xff41('0x10')]===0x1f4){logger[_0xff41('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2303dc,_0x5167bf[_0xff41('0xf')]['message']);return _0x3cbec5(_0x5167bf[_0xff41('0xf')][_0xff41('0x11')]);}logger[_0xff41('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2303dc,_0x5167bf['error'][_0xff41('0x11')]);return _0x4eca09(_0x5167bf[_0xff41('0xf')]['message']);}else{logger[_0xff41('0xa')](_0xff41('0xb'),_0x2303dc,_0xff41('0xc'));_0x4eca09(_0x5167bf[_0xff41('0x12')][_0xff41('0x11')]);}})[_0xff41('0x13')](function(_0x1056cc){logger[_0xff41('0xf')](_0xff41('0xb'),_0x2303dc,_0x1056cc);_0x3cbec5(_0x1056cc);});});} \ No newline at end of file +var _0x216f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x216f,0x11a));var _0xf216=function(_0x2f0841,_0x2b67ec){_0x2f0841=_0x2f0841-0x0;var _0x38531d=_0x216f[_0x2f0841];return _0x38531d;};'use strict';var _=require(_0xf216('0x0'));var util=require('util');var moment=require(_0xf216('0x1'));var BPromise=require(_0xf216('0x2'));var rs=require(_0xf216('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf216('0x4'))['db'];var utils=require(_0xf216('0x5'));var logger=require(_0xf216('0x6'))(_0xf216('0x7'));var config=require(_0xf216('0x8'));var jayson=require(_0xf216('0x9'));var client=jayson[_0xf216('0xa')][_0xf216('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fd083,_0x2fb58e,_0x2463f9){return new BPromise(function(_0x1cd23c,_0x55844b){return client[_0xf216('0xc')](_0x1fd083,_0x2463f9)['then'](function(_0x37a6c0){logger[_0xf216('0xd')](_0xf216('0xe'),_0x2fb58e,'request\x20sent');logger[_0xf216('0xf')](_0xf216('0x10'),_0x2fb58e,_0xf216('0x11'),JSON[_0xf216('0x12')](_0x37a6c0));if(_0x37a6c0[_0xf216('0x13')]){if(_0x37a6c0[_0xf216('0x13')][_0xf216('0x14')]===0x1f4){logger['error'](_0xf216('0xe'),_0x2fb58e,_0x37a6c0[_0xf216('0x13')][_0xf216('0x15')]);return _0x55844b(_0x37a6c0[_0xf216('0x13')][_0xf216('0x15')]);}logger['error'](_0xf216('0xe'),_0x2fb58e,_0x37a6c0[_0xf216('0x13')]['message']);return _0x1cd23c(_0x37a6c0['error']['message']);}else{logger[_0xf216('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2fb58e,_0xf216('0x11'));_0x1cd23c(_0x37a6c0[_0xf216('0x16')]['message']);}})[_0xf216('0x17')](function(_0x269eb6){logger['error'](_0xf216('0xe'),_0x2fb58e,_0x269eb6);_0x55844b(_0x269eb6);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 003eb9c..38b3604 100644 --- a/server/api/intDynamics365Field/index.js +++ b/server/api/intDynamics365Field/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6c8=['show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','get','isAuthenticated','index','/:id'];(function(_0x1ee7a7,_0x2478b0){var _0x291a52=function(_0x54718c){while(--_0x54718c){_0x1ee7a7['push'](_0x1ee7a7['shift']());}};_0x291a52(++_0x2478b0);}(_0xe6c8,0x1e6));var _0x8e6c=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xe6c8[_0x1d9aa0];return _0x226868;};'use strict';var multer=require(_0x8e6c('0x0'));var util=require(_0x8e6c('0x1'));var path=require(_0x8e6c('0x2'));var timeout=require(_0x8e6c('0x3'));var express=require(_0x8e6c('0x4'));var router=express[_0x8e6c('0x5')]();var fs_extra=require(_0x8e6c('0x6'));var auth=require(_0x8e6c('0x7'));var interaction=require(_0x8e6c('0x8'));var config=require('../../config/environment');var controller=require(_0x8e6c('0x9'));router[_0x8e6c('0xa')]('/',auth[_0x8e6c('0xb')](),controller[_0x8e6c('0xc')]);router[_0x8e6c('0xa')](_0x8e6c('0xd'),auth[_0x8e6c('0xb')](),controller[_0x8e6c('0xe')]);router[_0x8e6c('0xf')]('/',auth[_0x8e6c('0xb')](),controller[_0x8e6c('0x10')]);router[_0x8e6c('0x11')](_0x8e6c('0xd'),auth[_0x8e6c('0xb')](),controller['update']);router[_0x8e6c('0x12')](_0x8e6c('0xd'),auth[_0x8e6c('0xb')](),controller['destroy']);module[_0x8e6c('0x13')]=router; \ No newline at end of file +var _0x2a90=['/:id','isAuthenticated','post','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','index'];(function(_0x1db251,_0xf0443d){var _0x56685a=function(_0x6ec6b7){while(--_0x6ec6b7){_0x1db251['push'](_0x1db251['shift']());}};_0x56685a(++_0xf0443d);}(_0x2a90,0x18d));var _0x02a9=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2a90[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x02a9('0x0'));var util=require(_0x02a9('0x1'));var path=require(_0x02a9('0x2'));var timeout=require('connect-timeout');var express=require(_0x02a9('0x3'));var router=express[_0x02a9('0x4')]();var fs_extra=require(_0x02a9('0x5'));var auth=require(_0x02a9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x02a9('0x7'));var controller=require(_0x02a9('0x8'));router[_0x02a9('0x9')]('/',auth['isAuthenticated'](),controller[_0x02a9('0xa')]);router[_0x02a9('0x9')](_0x02a9('0xb'),auth[_0x02a9('0xc')](),controller['show']);router[_0x02a9('0xd')]('/',auth[_0x02a9('0xc')](),controller['create']);router['put']('/:id',auth[_0x02a9('0xc')](),controller[_0x02a9('0xe')]);router['delete'](_0x02a9('0xb'),auth[_0x02a9('0xc')](),controller[_0x02a9('0xf')]);module[_0x02a9('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 0d3b1cf..2970181 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.attributes.js +++ b/server/api/intDynamics365Field/intDynamics365Field.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb371=['variable','picklist','string','STRING','customVariable','BOOLEAN','ENUM'];(function(_0x52b0e2,_0x24aad0){var _0xc8d52a=function(_0x1507fc){while(--_0x1507fc){_0x52b0e2['push'](_0x52b0e2['shift']());}};_0xc8d52a(++_0x24aad0);}(_0xb371,0xe6));var _0x1b37=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xb371[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x1b37('0x0')]('string',_0x1b37('0x1'),'customVariable','keyValue',_0x1b37('0x2')),'defaultValue':_0x1b37('0x3')},'content':{'type':Sequelize[_0x1b37('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1b37('0x0')]('string','variable',_0x1b37('0x5'))},'keyContent':{'type':Sequelize[_0x1b37('0x4')]},'idField':{'type':Sequelize[_0x1b37('0x4')]},'nameField':{'type':Sequelize[_0x1b37('0x4')]},'customField':{'type':Sequelize[_0x1b37('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x64cc=['ENUM','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x15ff59,_0x44827e){var _0x291a50=function(_0x42dca9){while(--_0x42dca9){_0x15ff59['push'](_0x15ff59['shift']());}};_0x291a50(++_0x44827e);}(_0x64cc,0xef));var _0xc64c=function(_0x410fb9,_0x3b880b){_0x410fb9=_0x410fb9-0x0;var _0x231475=_0x64cc[_0x410fb9];return _0x231475;};'use strict';var Sequelize=require(_0xc64c('0x0'));module['exports']={'type':{'type':Sequelize[_0xc64c('0x1')]('string',_0xc64c('0x2'),_0xc64c('0x3'),_0xc64c('0x4'),_0xc64c('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc64c('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc64c('0x1')]('string',_0xc64c('0x2'),_0xc64c('0x3'))},'keyContent':{'type':Sequelize[_0xc64c('0x6')]},'idField':{'type':Sequelize[_0xc64c('0x6')]},'nameField':{'type':Sequelize[_0xc64c('0x6')]},'customField':{'type':Sequelize[_0xc64c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc64c('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 0b7b1e4..95814d3 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.controller.js +++ b/server/api/intDynamics365Field/intDynamics365Field.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e3a=['Dynamics365Field','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','options','includeAll','rows','catch','params','rawAttributes','length','include','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index'];(function(_0x26a1dc,_0x380fb3){var _0x529678=function(_0x2c8c14){while(--_0x2c8c14){_0x26a1dc['push'](_0x26a1dc['shift']());}};_0x529678(++_0x380fb3);}(_0x1e3a,0xb1));var _0xa1e3=function(_0x3388d8,_0x256024){_0x3388d8=_0x3388d8-0x0;var _0x2bbe73=_0x1e3a[_0x3388d8];return _0x2bbe73;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa1e3('0x0'));var zipdir=require(_0xa1e3('0x1'));var jsonpatch=require(_0xa1e3('0x2'));var rp=require(_0xa1e3('0x3'));var moment=require(_0xa1e3('0x4'));var BPromise=require(_0xa1e3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa1e3('0x6'));var sox=require(_0xa1e3('0x7'));var csv=require(_0xa1e3('0x8'));var ejs=require(_0xa1e3('0x9'));var fs=require('fs');var fs_extra=require(_0xa1e3('0xa'));var _=require('lodash');var squel=require(_0xa1e3('0xb'));var crypto=require(_0xa1e3('0xc'));var jsforce=require(_0xa1e3('0xd'));var deskjs=require(_0xa1e3('0xe'));var toCsv=require(_0xa1e3('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa1e3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa1e3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1e3('0x11'));var logger=require(_0xa1e3('0x12'))(_0xa1e3('0x13'));var utils=require(_0xa1e3('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa1e3('0x15'))['db'];function respondWithStatusCode(_0x10a1b5,_0x15faf2){_0x15faf2=_0x15faf2||0xcc;return function(_0x117bc9){if(_0x117bc9){return _0x10a1b5[_0xa1e3('0x16')](_0x15faf2);}return _0x10a1b5[_0xa1e3('0x17')](_0x15faf2)[_0xa1e3('0x18')]();};}function respondWithResult(_0x39e27f,_0x2127bf){_0x2127bf=_0x2127bf||0xc8;return function(_0x468211){if(_0x468211){return _0x39e27f['status'](_0x2127bf)[_0xa1e3('0x19')](_0x468211);}};}function respondWithFilteredResult(_0x47c86b,_0x579631){return function(_0x6ef5ed){if(_0x6ef5ed){var _0x3085d2=typeof _0x579631[_0xa1e3('0x1a')]===_0xa1e3('0x1b')&&typeof _0x579631[_0xa1e3('0x1c')]===_0xa1e3('0x1b');var _0x32affc=_0x6ef5ed[_0xa1e3('0x1d')];var _0x5ab4ed=_0x3085d2?0x0:_0x579631[_0xa1e3('0x1a')];var _0x5b1493=_0x3085d2?_0x6ef5ed[_0xa1e3('0x1d')]:_0x579631[_0xa1e3('0x1a')]+_0x579631[_0xa1e3('0x1c')];var _0x1c0b2c;if(_0x5b1493>=_0x32affc){_0x5b1493=_0x32affc;_0x1c0b2c=0xc8;}else{_0x1c0b2c=0xce;}_0x47c86b[_0xa1e3('0x17')](_0x1c0b2c);return _0x47c86b[_0xa1e3('0x1e')](_0xa1e3('0x1f'),_0x5ab4ed+'-'+_0x5b1493+'/'+_0x32affc)[_0xa1e3('0x19')](_0x6ef5ed);}return null;};}function patchUpdates(_0x3f290e){return function(_0x173e36){try{jsonpatch[_0xa1e3('0x20')](_0x173e36,_0x3f290e,!![]);}catch(_0x471d62){return BPromise[_0xa1e3('0x21')](_0x471d62);}return _0x173e36[_0xa1e3('0x22')]();};}function saveUpdates(_0x3f3a43,_0x414336){return function(_0x3bead1){if(_0x3bead1){return _0x3bead1['update'](_0x3f3a43)[_0xa1e3('0x23')](function(_0x5cc24e){return _0x5cc24e;});}return null;};}function removeEntity(_0x3502bd,_0x25e6be){return function(_0x282e1e){if(_0x282e1e){return _0x282e1e[_0xa1e3('0x24')]()[_0xa1e3('0x23')](function(){_0x3502bd[_0xa1e3('0x17')](0xcc)[_0xa1e3('0x18')]();});}};}function handleEntityNotFound(_0x3aceea,_0x4095c2){return function(_0x3e4d10){if(!_0x3e4d10){_0x3aceea['sendStatus'](0x194);}return _0x3e4d10;};}function handleError(_0x3e98bb,_0x1c9872){_0x1c9872=_0x1c9872||0x1f4;return function(_0x16563c){logger[_0xa1e3('0x25')](_0x16563c[_0xa1e3('0x26')]);if(_0x16563c[_0xa1e3('0x27')]){delete _0x16563c[_0xa1e3('0x27')];}_0x3e98bb[_0xa1e3('0x17')](_0x1c9872)[_0xa1e3('0x28')](_0x16563c);};}exports[_0xa1e3('0x29')]=function(_0x104db2,_0x2add17){var _0x576688={},_0x20038b={},_0x3fd2c1={'count':0x0,'rows':[]};var _0x3c3d13=_['map'](db[_0xa1e3('0x2a')]['rawAttributes'],function(_0x3e3c7f){return{'name':_0x3e3c7f[_0xa1e3('0x2b')],'type':_0x3e3c7f[_0xa1e3('0x2c')][_0xa1e3('0x2d')]};});_0x20038b[_0xa1e3('0x2e')]=_[_0xa1e3('0x2f')](_0x3c3d13,_0xa1e3('0x27'));_0x20038b[_0xa1e3('0x30')]=_[_0xa1e3('0x31')](_0x104db2[_0xa1e3('0x30')]);_0x20038b['filters']=_[_0xa1e3('0x32')](_0x20038b[_0xa1e3('0x2e')],_0x20038b[_0xa1e3('0x30')]);_0x576688['attributes']=_['intersection'](_0x20038b[_0xa1e3('0x2e')],qs[_0xa1e3('0x33')](_0x104db2[_0xa1e3('0x30')][_0xa1e3('0x33')]));_0x576688[_0xa1e3('0x34')]=_0x576688[_0xa1e3('0x34')]['length']?_0x576688[_0xa1e3('0x34')]:_0x20038b[_0xa1e3('0x2e')];if(!_0x104db2[_0xa1e3('0x30')][_0xa1e3('0x35')](_0xa1e3('0x36'))){_0x576688[_0xa1e3('0x1c')]=qs['limit'](_0x104db2[_0xa1e3('0x30')][_0xa1e3('0x1c')]);_0x576688['offset']=qs[_0xa1e3('0x1a')](_0x104db2[_0xa1e3('0x30')]['offset']);}_0x576688[_0xa1e3('0x37')]=qs[_0xa1e3('0x38')](_0x104db2[_0xa1e3('0x30')]['sort']);_0x576688['where']=qs[_0xa1e3('0x39')](_['pick'](_0x104db2[_0xa1e3('0x30')],_0x20038b[_0xa1e3('0x39')]),_0x3c3d13);if(_0x104db2['query'][_0xa1e3('0x3a')]){_0x576688[_0xa1e3('0x3b')]=_[_0xa1e3('0x3c')](_0x576688[_0xa1e3('0x3b')],{'$or':_[_0xa1e3('0x2f')](_0x3c3d13,function(_0x328142){if(_0x328142[_0xa1e3('0x2c')]!=='VIRTUAL'){var _0xfebd5d={};_0xfebd5d[_0x328142[_0xa1e3('0x27')]]={'$like':'%'+_0x104db2[_0xa1e3('0x30')]['filter']+'%'};return _0xfebd5d;}})});}_0x576688=_[_0xa1e3('0x3c')]({},_0x576688,_0x104db2[_0xa1e3('0x3d')]);var _0x655976={'where':_0x576688[_0xa1e3('0x3b')]};return db[_0xa1e3('0x2a')][_0xa1e3('0x1d')](_0x655976)[_0xa1e3('0x23')](function(_0x5826f5){_0x3fd2c1['count']=_0x5826f5;if(_0x104db2[_0xa1e3('0x30')][_0xa1e3('0x3e')]){_0x576688['include']=[{'all':!![]}];}return db[_0xa1e3('0x2a')]['findAll'](_0x576688);})[_0xa1e3('0x23')](function(_0x2e1691){_0x3fd2c1[_0xa1e3('0x3f')]=_0x2e1691;return _0x3fd2c1;})[_0xa1e3('0x23')](respondWithFilteredResult(_0x2add17,_0x576688))[_0xa1e3('0x40')](handleError(_0x2add17,null));};exports['show']=function(_0x3d55da,_0x18a70d){var _0x4538ef={'raw':!![],'where':{'id':_0x3d55da[_0xa1e3('0x41')]['id']}},_0x429f0d={};_0x429f0d[_0xa1e3('0x2e')]=_[_0xa1e3('0x31')](db[_0xa1e3('0x2a')][_0xa1e3('0x42')]);_0x429f0d[_0xa1e3('0x30')]=_[_0xa1e3('0x31')](_0x3d55da['query']);_0x429f0d[_0xa1e3('0x39')]=_[_0xa1e3('0x32')](_0x429f0d['model'],_0x429f0d['query']);_0x4538ef['attributes']=_[_0xa1e3('0x32')](_0x429f0d['model'],qs[_0xa1e3('0x33')](_0x3d55da[_0xa1e3('0x30')][_0xa1e3('0x33')]));_0x4538ef[_0xa1e3('0x34')]=_0x4538ef['attributes'][_0xa1e3('0x43')]?_0x4538ef[_0xa1e3('0x34')]:_0x429f0d[_0xa1e3('0x2e')];if(_0x3d55da[_0xa1e3('0x30')][_0xa1e3('0x3e')]){_0x4538ef[_0xa1e3('0x44')]=[{'all':!![]}];}_0x4538ef=_[_0xa1e3('0x3c')]({},_0x4538ef,_0x3d55da['options']);return db[_0xa1e3('0x2a')][_0xa1e3('0x45')](_0x4538ef)[_0xa1e3('0x23')](handleEntityNotFound(_0x18a70d,null))['then'](respondWithResult(_0x18a70d,null))[_0xa1e3('0x40')](handleError(_0x18a70d,null));};exports['create']=function(_0x1e96e0,_0x257a5d){return db[_0xa1e3('0x2a')][_0xa1e3('0x46')](_0x1e96e0[_0xa1e3('0x47')],{})['then'](respondWithResult(_0x257a5d,0xc9))[_0xa1e3('0x40')](handleError(_0x257a5d,null));};exports[_0xa1e3('0x48')]=function(_0x2df96c,_0x4c870b){if(_0x2df96c[_0xa1e3('0x47')]['id']){delete _0x2df96c[_0xa1e3('0x47')]['id'];}return db[_0xa1e3('0x2a')][_0xa1e3('0x45')]({'where':{'id':_0x2df96c['params']['id']}})['then'](handleEntityNotFound(_0x4c870b,null))[_0xa1e3('0x23')](saveUpdates(_0x2df96c['body'],null))['then'](respondWithResult(_0x4c870b,null))[_0xa1e3('0x40')](handleError(_0x4c870b,null));};exports[_0xa1e3('0x24')]=function(_0x4ec7ac,_0x2e4a0e){return db[_0xa1e3('0x2a')]['find']({'where':{'id':_0x4ec7ac[_0xa1e3('0x41')]['id']}})[_0xa1e3('0x23')](handleEntityNotFound(_0x2e4a0e,null))[_0xa1e3('0x23')](removeEntity(_0x2e4a0e,null))['catch'](handleError(_0x2e4a0e,null));}; \ No newline at end of file +var _0xa000=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','destroy','then','error','stack','name','Dynamics365Field','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','keys','options','create','body','params','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x1bb517,_0x2f395e){var _0x571f0f=function(_0x4a68dc){while(--_0x4a68dc){_0x1bb517['push'](_0x1bb517['shift']());}};_0x571f0f(++_0x2f395e);}(_0xa000,0x86));var _0x0a00=function(_0x402c9e,_0x18bec3){_0x402c9e=_0x402c9e-0x0;var _0x506904=_0xa000[_0x402c9e];return _0x506904;};'use strict';var emlformat=require(_0x0a00('0x0'));var rimraf=require(_0x0a00('0x1'));var zipdir=require(_0x0a00('0x2'));var jsonpatch=require(_0x0a00('0x3'));var rp=require(_0x0a00('0x4'));var moment=require(_0x0a00('0x5'));var BPromise=require(_0x0a00('0x6'));var Mustache=require(_0x0a00('0x7'));var util=require(_0x0a00('0x8'));var path=require(_0x0a00('0x9'));var sox=require(_0x0a00('0xa'));var csv=require(_0x0a00('0xb'));var ejs=require(_0x0a00('0xc'));var fs=require('fs');var fs_extra=require(_0x0a00('0xd'));var _=require(_0x0a00('0xe'));var squel=require('squel');var crypto=require(_0x0a00('0xf'));var jsforce=require(_0x0a00('0x10'));var deskjs=require(_0x0a00('0x11'));var toCsv=require(_0x0a00('0xb'));var querystring=require(_0x0a00('0x12'));var Papa=require(_0x0a00('0x13'));var Redis=require('ioredis');var authService=require(_0x0a00('0x14'));var qs=require(_0x0a00('0x15'));var as=require(_0x0a00('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0a00('0x17'))('api');var utils=require(_0x0a00('0x18'));var config=require(_0x0a00('0x19'));var licenseUtil=require(_0x0a00('0x1a'));var db=require(_0x0a00('0x1b'))['db'];function respondWithStatusCode(_0x9f8684,_0x59fd4e){_0x59fd4e=_0x59fd4e||0xcc;return function(_0x300274){if(_0x300274){return _0x9f8684[_0x0a00('0x1c')](_0x59fd4e);}return _0x9f8684[_0x0a00('0x1d')](_0x59fd4e)[_0x0a00('0x1e')]();};}function respondWithResult(_0x3a7463,_0x2e7fe5){_0x2e7fe5=_0x2e7fe5||0xc8;return function(_0x4a1e75){if(_0x4a1e75){return _0x3a7463[_0x0a00('0x1d')](_0x2e7fe5)[_0x0a00('0x1f')](_0x4a1e75);}};}function respondWithFilteredResult(_0x78bf48,_0x1dfd37){return function(_0x598e36){if(_0x598e36){var _0x43e554=typeof _0x1dfd37['offset']===_0x0a00('0x20')&&typeof _0x1dfd37[_0x0a00('0x21')]===_0x0a00('0x20');var _0x2653d9=_0x598e36[_0x0a00('0x22')];var _0x222c65=_0x43e554?0x0:_0x1dfd37[_0x0a00('0x23')];var _0x3502a5=_0x43e554?_0x598e36[_0x0a00('0x22')]:_0x1dfd37[_0x0a00('0x23')]+_0x1dfd37['limit'];var _0xc2579e;if(_0x3502a5>=_0x2653d9){_0x3502a5=_0x2653d9;_0xc2579e=0xc8;}else{_0xc2579e=0xce;}_0x78bf48[_0x0a00('0x1d')](_0xc2579e);return _0x78bf48[_0x0a00('0x24')](_0x0a00('0x25'),_0x222c65+'-'+_0x3502a5+'/'+_0x2653d9)[_0x0a00('0x1f')](_0x598e36);}return null;};}function patchUpdates(_0x31fef3){return function(_0x156f2b){try{jsonpatch['apply'](_0x156f2b,_0x31fef3,!![]);}catch(_0x36e98d){return BPromise[_0x0a00('0x26')](_0x36e98d);}return _0x156f2b[_0x0a00('0x27')]();};}function saveUpdates(_0x3d82aa,_0x4b1729){return function(_0x3f25e3){if(_0x3f25e3){return _0x3f25e3['update'](_0x3d82aa)['then'](function(_0x36aeda){return _0x36aeda;});}return null;};}function removeEntity(_0xf76b69,_0x33d52e){return function(_0x2c69bc){if(_0x2c69bc){return _0x2c69bc[_0x0a00('0x28')]()[_0x0a00('0x29')](function(){_0xf76b69['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45e1dc,_0x43c5f){return function(_0x476ff1){if(!_0x476ff1){_0x45e1dc[_0x0a00('0x1c')](0x194);}return _0x476ff1;};}function handleError(_0x5efe03,_0x1e62ad){_0x1e62ad=_0x1e62ad||0x1f4;return function(_0x1dfdca){logger[_0x0a00('0x2a')](_0x1dfdca[_0x0a00('0x2b')]);if(_0x1dfdca['name']){delete _0x1dfdca[_0x0a00('0x2c')];}_0x5efe03[_0x0a00('0x1d')](_0x1e62ad)['send'](_0x1dfdca);};}exports['index']=function(_0x3175c2,_0x5141bc){var _0x16c3bc={},_0x136d30={},_0x3682f1={'count':0x0,'rows':[]};var _0x172057=_['map'](db[_0x0a00('0x2d')][_0x0a00('0x2e')],function(_0x1d1ae1){return{'name':_0x1d1ae1[_0x0a00('0x2f')],'type':_0x1d1ae1[_0x0a00('0x30')][_0x0a00('0x31')]};});_0x136d30[_0x0a00('0x32')]=_[_0x0a00('0x33')](_0x172057,_0x0a00('0x2c'));_0x136d30[_0x0a00('0x34')]=_['keys'](_0x3175c2[_0x0a00('0x34')]);_0x136d30[_0x0a00('0x35')]=_[_0x0a00('0x36')](_0x136d30[_0x0a00('0x32')],_0x136d30[_0x0a00('0x34')]);_0x16c3bc[_0x0a00('0x37')]=_['intersection'](_0x136d30[_0x0a00('0x32')],qs['fields'](_0x3175c2[_0x0a00('0x34')][_0x0a00('0x38')]));_0x16c3bc[_0x0a00('0x37')]=_0x16c3bc['attributes'][_0x0a00('0x39')]?_0x16c3bc['attributes']:_0x136d30[_0x0a00('0x32')];if(!_0x3175c2[_0x0a00('0x34')][_0x0a00('0x3a')](_0x0a00('0x3b'))){_0x16c3bc[_0x0a00('0x21')]=qs[_0x0a00('0x21')](_0x3175c2[_0x0a00('0x34')][_0x0a00('0x21')]);_0x16c3bc[_0x0a00('0x23')]=qs[_0x0a00('0x23')](_0x3175c2['query'][_0x0a00('0x23')]);}_0x16c3bc[_0x0a00('0x3c')]=qs[_0x0a00('0x3d')](_0x3175c2['query']['sort']);_0x16c3bc[_0x0a00('0x3e')]=qs[_0x0a00('0x35')](_[_0x0a00('0x3f')](_0x3175c2['query'],_0x136d30['filters']),_0x172057);if(_0x3175c2['query'][_0x0a00('0x40')]){_0x16c3bc[_0x0a00('0x3e')]=_[_0x0a00('0x41')](_0x16c3bc[_0x0a00('0x3e')],{'$or':_[_0x0a00('0x33')](_0x172057,function(_0x18bc95){if(_0x18bc95[_0x0a00('0x30')]!==_0x0a00('0x42')){var _0x5a4780={};_0x5a4780[_0x18bc95['name']]={'$like':'%'+_0x3175c2[_0x0a00('0x34')][_0x0a00('0x40')]+'%'};return _0x5a4780;}})});}_0x16c3bc=_[_0x0a00('0x41')]({},_0x16c3bc,_0x3175c2['options']);var _0xaa7e3f={'where':_0x16c3bc[_0x0a00('0x3e')]};return db['Dynamics365Field'][_0x0a00('0x22')](_0xaa7e3f)['then'](function(_0x38de18){_0x3682f1[_0x0a00('0x22')]=_0x38de18;if(_0x3175c2[_0x0a00('0x34')][_0x0a00('0x43')]){_0x16c3bc[_0x0a00('0x44')]=[{'all':!![]}];}return db[_0x0a00('0x2d')]['findAll'](_0x16c3bc);})[_0x0a00('0x29')](function(_0x3df488){_0x3682f1[_0x0a00('0x45')]=_0x3df488;return _0x3682f1;})[_0x0a00('0x29')](respondWithFilteredResult(_0x5141bc,_0x16c3bc))[_0x0a00('0x46')](handleError(_0x5141bc,null));};exports['show']=function(_0x1a642a,_0x5154c2){var _0x16f2b0={'raw':!![],'where':{'id':_0x1a642a['params']['id']}},_0x37d50f={};_0x37d50f[_0x0a00('0x32')]=_['keys'](db[_0x0a00('0x2d')][_0x0a00('0x2e')]);_0x37d50f[_0x0a00('0x34')]=_[_0x0a00('0x47')](_0x1a642a[_0x0a00('0x34')]);_0x37d50f[_0x0a00('0x35')]=_[_0x0a00('0x36')](_0x37d50f[_0x0a00('0x32')],_0x37d50f['query']);_0x16f2b0['attributes']=_[_0x0a00('0x36')](_0x37d50f[_0x0a00('0x32')],qs['fields'](_0x1a642a['query'][_0x0a00('0x38')]));_0x16f2b0[_0x0a00('0x37')]=_0x16f2b0[_0x0a00('0x37')][_0x0a00('0x39')]?_0x16f2b0['attributes']:_0x37d50f[_0x0a00('0x32')];if(_0x1a642a[_0x0a00('0x34')][_0x0a00('0x43')]){_0x16f2b0[_0x0a00('0x44')]=[{'all':!![]}];}_0x16f2b0=_[_0x0a00('0x41')]({},_0x16f2b0,_0x1a642a[_0x0a00('0x48')]);return db[_0x0a00('0x2d')]['find'](_0x16f2b0)[_0x0a00('0x29')](handleEntityNotFound(_0x5154c2,null))[_0x0a00('0x29')](respondWithResult(_0x5154c2,null))['catch'](handleError(_0x5154c2,null));};exports[_0x0a00('0x49')]=function(_0x4c91b3,_0x53fc5b){return db[_0x0a00('0x2d')][_0x0a00('0x49')](_0x4c91b3['body'],{})[_0x0a00('0x29')](respondWithResult(_0x53fc5b,0xc9))['catch'](handleError(_0x53fc5b,null));};exports['update']=function(_0x318487,_0x3ead43){if(_0x318487[_0x0a00('0x4a')]['id']){delete _0x318487[_0x0a00('0x4a')]['id'];}return db[_0x0a00('0x2d')]['find']({'where':{'id':_0x318487[_0x0a00('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3ead43,null))['then'](saveUpdates(_0x318487[_0x0a00('0x4a')],null))['then'](respondWithResult(_0x3ead43,null))[_0x0a00('0x46')](handleError(_0x3ead43,null));};exports['destroy']=function(_0xe5e43d,_0xa93101){return db[_0x0a00('0x2d')][_0x0a00('0x4c')]({'where':{'id':_0xe5e43d['params']['id']}})[_0x0a00('0x29')](handleEntityNotFound(_0xa93101,null))[_0x0a00('0x29')](removeEntity(_0xa93101,null))[_0x0a00('0x46')](handleError(_0xa93101,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 51079ac..1c1791c 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.model.js +++ b/server/api/intDynamics365Field/intDynamics365Field.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x339c=['Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Field.attributes','exports','define'];(function(_0x4494bd,_0x5d4c66){var _0x49ede9=function(_0x360670){while(--_0x360670){_0x4494bd['push'](_0x4494bd['shift']());}};_0x49ede9(++_0x5d4c66);}(_0x339c,0x175));var _0xc339=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x339c[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0xc339('0x0'));var util=require(_0xc339('0x1'));var logger=require('../../config/logger')(_0xc339('0x2'));var moment=require(_0xc339('0x3'));var BPromise=require(_0xc339('0x4'));var rp=require(_0xc339('0x5'));var fs=require('fs');var path=require(_0xc339('0x6'));var rimraf=require(_0xc339('0x7'));var config=require('../../config/environment');var attributes=require(_0xc339('0x8'));module[_0xc339('0x9')]=function(_0x2f2083,_0x4f331d){return _0x2f2083[_0xc339('0xa')](_0xc339('0xb'),attributes,{'tableName':_0xc339('0xc'),'paranoid':![],'indexes':[{'name':_0xc339('0xd'),'fields':[_0xc339('0xe'),_0xc339('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa860=['util','api','moment','bluebird','request-promise','rimraf','exports','dynamics365_unique_index','idField','FieldId','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa860,0xf1));var _0x0a86=function(_0x3bb45f,_0x4b66f0){_0x3bb45f=_0x3bb45f-0x0;var _0x2b6ab4=_0xa860[_0x3bb45f];return _0x2b6ab4;};'use strict';var _=require(_0x0a86('0x0'));var util=require(_0x0a86('0x1'));var logger=require('../../config/logger')(_0x0a86('0x2'));var moment=require(_0x0a86('0x3'));var BPromise=require(_0x0a86('0x4'));var rp=require(_0x0a86('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a86('0x6'));var config=require('../../config/environment');var attributes=require('./intDynamics365Field.attributes');module[_0x0a86('0x7')]=function(_0x525fe6,_0x3d0d12){return _0x525fe6['define']('Dynamics365Field',attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x0a86('0x8'),'fields':[_0x0a86('0x9'),_0x0a86('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 857bda6..82fd4f8 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.rpc.js +++ b/server/api/intDynamics365Field/intDynamics365Field.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8d2=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message'];(function(_0x175136,_0x5cefc5){var _0x5931cc=function(_0x46aab7){while(--_0x46aab7){_0x175136['push'](_0x175136['shift']());}};_0x5931cc(++_0x5cefc5);}(_0xb8d2,0x15a));var _0x2b8d=function(_0x208749,_0x2b7b66){_0x208749=_0x208749-0x0;var _0x3e0042=_0xb8d2[_0x208749];return _0x3e0042;};'use strict';var _=require(_0x2b8d('0x0'));var util=require(_0x2b8d('0x1'));var moment=require(_0x2b8d('0x2'));var BPromise=require(_0x2b8d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b8d('0x4'));var db=require(_0x2b8d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b8d('0x6'))(_0x2b8d('0x7'));var config=require(_0x2b8d('0x8'));var jayson=require(_0x2b8d('0x9'));var client=jayson[_0x2b8d('0xa')][_0x2b8d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x728d13,_0xf3bd2c,_0x417209){return new BPromise(function(_0x1cc8fd,_0x500e5e){return client[_0x2b8d('0xc')](_0x728d13,_0x417209)[_0x2b8d('0xd')](function(_0x5aa683){logger[_0x2b8d('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0xf3bd2c,'request\x20sent');logger[_0x2b8d('0xf')](_0x2b8d('0x10'),_0xf3bd2c,'request\x20sent',JSON[_0x2b8d('0x11')](_0x5aa683));if(_0x5aa683[_0x2b8d('0x12')]){if(_0x5aa683[_0x2b8d('0x12')][_0x2b8d('0x13')]===0x1f4){logger['error'](_0x2b8d('0x14'),_0xf3bd2c,_0x5aa683[_0x2b8d('0x12')]['message']);return _0x500e5e(_0x5aa683[_0x2b8d('0x12')][_0x2b8d('0x15')]);}logger['error'](_0x2b8d('0x14'),_0xf3bd2c,_0x5aa683[_0x2b8d('0x12')][_0x2b8d('0x15')]);return _0x1cc8fd(_0x5aa683[_0x2b8d('0x12')][_0x2b8d('0x15')]);}else{logger[_0x2b8d('0xe')](_0x2b8d('0x14'),_0xf3bd2c,'request\x20sent');_0x1cc8fd(_0x5aa683[_0x2b8d('0x16')][_0x2b8d('0x15')]);}})['catch'](function(_0x32525){logger[_0x2b8d('0x12')](_0x2b8d('0x14'),_0xf3bd2c,_0x32525);_0x500e5e(_0x32525);});});} \ No newline at end of file +var _0xa1e5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','debug','request\x20sent','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0x47d252,_0xe9136b){var _0xed75f1=function(_0x546ea4){while(--_0x546ea4){_0x47d252['push'](_0x47d252['shift']());}};_0xed75f1(++_0xe9136b);}(_0xa1e5,0x81));var _0x5a1e=function(_0x55bf55,_0x37c9e4){_0x55bf55=_0x55bf55-0x0;var _0x21caea=_0xa1e5[_0x55bf55];return _0x21caea;};'use strict';var _=require(_0x5a1e('0x0'));var util=require(_0x5a1e('0x1'));var moment=require('moment');var BPromise=require(_0x5a1e('0x2'));var rs=require(_0x5a1e('0x3'));var fs=require('fs');var Redis=require(_0x5a1e('0x4'));var db=require(_0x5a1e('0x5'))['db'];var utils=require(_0x5a1e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5a1e('0x7'));var jayson=require(_0x5a1e('0x8'));var client=jayson[_0x5a1e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x561fc1,_0x5d0782,_0x564c58){return new BPromise(function(_0x1acebe,_0x556149){return client[_0x5a1e('0xa')](_0x561fc1,_0x564c58)[_0x5a1e('0xb')](function(_0x33c6c3){logger[_0x5a1e('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x5d0782,'request\x20sent');logger[_0x5a1e('0xd')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x5d0782,_0x5a1e('0xe'),JSON[_0x5a1e('0xf')](_0x33c6c3));if(_0x33c6c3['error']){if(_0x33c6c3[_0x5a1e('0x10')][_0x5a1e('0x11')]===0x1f4){logger[_0x5a1e('0x10')](_0x5a1e('0x12'),_0x5d0782,_0x33c6c3['error'][_0x5a1e('0x13')]);return _0x556149(_0x33c6c3[_0x5a1e('0x10')][_0x5a1e('0x13')]);}logger['error'](_0x5a1e('0x12'),_0x5d0782,_0x33c6c3[_0x5a1e('0x10')][_0x5a1e('0x13')]);return _0x1acebe(_0x33c6c3[_0x5a1e('0x10')][_0x5a1e('0x13')]);}else{logger[_0x5a1e('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x5d0782,_0x5a1e('0xe'));_0x1acebe(_0x33c6c3[_0x5a1e('0x14')][_0x5a1e('0x13')]);}})[_0x5a1e('0x15')](function(_0x23dd12){logger[_0x5a1e('0x10')](_0x5a1e('0x12'),_0x5d0782,_0x23dd12);_0x556149(_0x23dd12);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 3a48820..c027dee 100644 --- a/server/api/intFreshdeskAccount/index.js +++ b/server/api/intFreshdeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc94=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','/:id','show','getConfigurations','get','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','exports','multer','path','connect-timeout'];(function(_0x2ec2bf,_0x64e983){var _0x2c279c=function(_0x41fe42){while(--_0x41fe42){_0x2ec2bf['push'](_0x2ec2bf['shift']());}};_0x2c279c(++_0x64e983);}(_0xdc94,0xad));var _0x4dc9=function(_0x202388,_0x48d6c8){_0x202388=_0x202388-0x0;var _0x316e54=_0xdc94[_0x202388];return _0x316e54;};'use strict';var multer=require(_0x4dc9('0x0'));var util=require('util');var path=require(_0x4dc9('0x1'));var timeout=require(_0x4dc9('0x2'));var express=require(_0x4dc9('0x3'));var router=express[_0x4dc9('0x4')]();var fs_extra=require(_0x4dc9('0x5'));var auth=require(_0x4dc9('0x6'));var interaction=require(_0x4dc9('0x7'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth[_0x4dc9('0x8')](),controller['index']);router['get'](_0x4dc9('0x9'),auth[_0x4dc9('0x8')](),controller[_0x4dc9('0xa')]);router['get']('/:id/configurations',auth[_0x4dc9('0x8')](),controller[_0x4dc9('0xb')]);router[_0x4dc9('0xc')](_0x4dc9('0xd'),auth['isAuthenticated'](),controller[_0x4dc9('0xe')]);router[_0x4dc9('0xf')]('/',auth[_0x4dc9('0x8')](),controller[_0x4dc9('0x10')]);router[_0x4dc9('0xf')](_0x4dc9('0x11'),auth[_0x4dc9('0x8')](),controller[_0x4dc9('0x12')]);router[_0x4dc9('0x13')]('/:id',auth[_0x4dc9('0x8')](),controller[_0x4dc9('0x14')]);router['delete'](_0x4dc9('0x9'),auth[_0x4dc9('0x8')](),controller['destroy']);module[_0x4dc9('0x15')]=router; \ No newline at end of file +var _0xe2ba=['get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x247282,_0x7a92cf){var _0x5a116e=function(_0x16bbb4){while(--_0x16bbb4){_0x247282['push'](_0x247282['shift']());}};_0x5a116e(++_0x7a92cf);}(_0xe2ba,0xfa));var _0xae2b=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xe2ba[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require(_0xae2b('0x0'));var util=require(_0xae2b('0x1'));var path=require(_0xae2b('0x2'));var timeout=require(_0xae2b('0x3'));var express=require(_0xae2b('0x4'));var router=express[_0xae2b('0x5')]();var fs_extra=require(_0xae2b('0x6'));var auth=require(_0xae2b('0x7'));var interaction=require(_0xae2b('0x8'));var config=require(_0xae2b('0x9'));var controller=require('./intFreshdeskAccount.controller');router[_0xae2b('0xa')]('/',auth[_0xae2b('0xb')](),controller['index']);router[_0xae2b('0xa')](_0xae2b('0xc'),auth[_0xae2b('0xb')](),controller['show']);router[_0xae2b('0xa')](_0xae2b('0xd'),auth['isAuthenticated'](),controller[_0xae2b('0xe')]);router[_0xae2b('0xa')](_0xae2b('0xf'),auth['isAuthenticated'](),controller[_0xae2b('0x10')]);router[_0xae2b('0x11')]('/',auth[_0xae2b('0xb')](),controller['create']);router[_0xae2b('0x11')](_0xae2b('0xd'),auth[_0xae2b('0xb')](),controller[_0xae2b('0x12')]);router['put'](_0xae2b('0xc'),auth[_0xae2b('0xb')](),controller['update']);router['delete']('/:id',auth[_0xae2b('0xb')](),controller['destroy']);module[_0xae2b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 762d2df..f0089c7 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['STRING','username','remoteUri','sequelize'];(function(_0x5ccd30,_0x29f984){var _0x509096=function(_0x527c0e){while(--_0x527c0e){_0x5ccd30['push'](_0x5ccd30['shift']());}};_0x509096(++_0x29f984);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x0b0e[_0x4a747d];return _0x3a5b5c;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0b0('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe0b0('0x1')],'unique':_0xe0b0('0x2')},'apiKey':{'type':Sequelize[_0xe0b0('0x1')]},'remoteUri':{'type':Sequelize[_0xe0b0('0x1')],'unique':_0xe0b0('0x3')},'serverUrl':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x1eba=['exports','STRING','remoteUri','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x1eba[_0x1e3c16];return _0x47a0c9;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module[_0xa1eb('0x1')]={'name':{'type':Sequelize[_0xa1eb('0x2')]},'description':{'type':Sequelize[_0xa1eb('0x2')]},'username':{'type':Sequelize[_0xa1eb('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa1eb('0x2')],'unique':_0xa1eb('0x3')},'serverUrl':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 0ed7a93..667da21 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a8c=['source','ticket_type','remove','includes','custom_text','custom_dropdown','label','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','find','create','catch','body','params','getConfigurations','FreshdeskConfiguration','sort','hasOwnProperty','nolimit','addConfiguration','findOne','Subjects','channel','FreshdeskField','Descriptions','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:X','toString','base64','agent','description','group'];(function(_0x158fd8,_0x93b035){var _0x2f3374=function(_0x264688){while(--_0x264688){_0x158fd8['push'](_0x158fd8['shift']());}};_0x2f3374(++_0x93b035);}(_0x5a8c,0x1da));var _0xc5a8=function(_0x37bd0d,_0x1b3079){_0x37bd0d=_0x37bd0d-0x0;var _0x33f81d=_0x5a8c[_0x37bd0d];return _0x33f81d;};'use strict';var emlformat=require(_0xc5a8('0x0'));var rimraf=require(_0xc5a8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc5a8('0x2'));var rp=require(_0xc5a8('0x3'));var moment=require(_0xc5a8('0x4'));var BPromise=require(_0xc5a8('0x5'));var Mustache=require('mustache');var util=require(_0xc5a8('0x6'));var path=require(_0xc5a8('0x7'));var sox=require('sox');var csv=require(_0xc5a8('0x8'));var ejs=require(_0xc5a8('0x9'));var fs=require('fs');var fs_extra=require(_0xc5a8('0xa'));var _=require(_0xc5a8('0xb'));var squel=require(_0xc5a8('0xc'));var crypto=require(_0xc5a8('0xd'));var jsforce=require(_0xc5a8('0xe'));var deskjs=require(_0xc5a8('0xf'));var toCsv=require(_0xc5a8('0x8'));var querystring=require(_0xc5a8('0x10'));var Papa=require(_0xc5a8('0x11'));var Redis=require('ioredis');var authService=require(_0xc5a8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc5a8('0x13'));var hardwareService=require(_0xc5a8('0x14'));var logger=require(_0xc5a8('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xc5a8('0x16'));var licenseUtil=require(_0xc5a8('0x17'));var db=require(_0xc5a8('0x18'))['db'];var integrations=require(_0xc5a8('0x19'));function respondWithStatusCode(_0x445926,_0x5d2d2c){_0x5d2d2c=_0x5d2d2c||0xcc;return function(_0x39a28d){if(_0x39a28d){return _0x445926[_0xc5a8('0x1a')](_0x5d2d2c);}return _0x445926[_0xc5a8('0x1b')](_0x5d2d2c)[_0xc5a8('0x1c')]();};}function respondWithResult(_0x3d6990,_0x219823){_0x219823=_0x219823||0xc8;return function(_0x365df5){if(_0x365df5){return _0x3d6990[_0xc5a8('0x1b')](_0x219823)[_0xc5a8('0x1d')](_0x365df5);}};}function respondWithFilteredResult(_0x9a94e3,_0x26177f){return function(_0x443376){if(_0x443376){var _0x393e1c=typeof _0x26177f[_0xc5a8('0x1e')]===_0xc5a8('0x1f')&&typeof _0x26177f[_0xc5a8('0x20')]===_0xc5a8('0x1f');var _0x2fb8eb=_0x443376['count'];var _0x134589=_0x393e1c?0x0:_0x26177f[_0xc5a8('0x1e')];var _0x3439dc=_0x393e1c?_0x443376[_0xc5a8('0x21')]:_0x26177f['offset']+_0x26177f[_0xc5a8('0x20')];var _0x4e9b87;if(_0x3439dc>=_0x2fb8eb){_0x3439dc=_0x2fb8eb;_0x4e9b87=0xc8;}else{_0x4e9b87=0xce;}_0x9a94e3[_0xc5a8('0x1b')](_0x4e9b87);return _0x9a94e3[_0xc5a8('0x22')](_0xc5a8('0x23'),_0x134589+'-'+_0x3439dc+'/'+_0x2fb8eb)['json'](_0x443376);}return null;};}function patchUpdates(_0x59dd9b){return function(_0x5b4426){try{jsonpatch[_0xc5a8('0x24')](_0x5b4426,_0x59dd9b,!![]);}catch(_0x1150b4){return BPromise[_0xc5a8('0x25')](_0x1150b4);}return _0x5b4426[_0xc5a8('0x26')]();};}function saveUpdates(_0x4b126d,_0x1a8662){return function(_0x8b6473){if(_0x8b6473){return _0x8b6473[_0xc5a8('0x27')](_0x4b126d)[_0xc5a8('0x28')](function(_0x5d8e5e){return _0x5d8e5e;});}return null;};}function removeEntity(_0x411470,_0x4865dd){return function(_0x25e56d){if(_0x25e56d){return _0x25e56d[_0xc5a8('0x29')]()[_0xc5a8('0x28')](function(){_0x411470[_0xc5a8('0x1b')](0xcc)[_0xc5a8('0x1c')]();});}};}function handleEntityNotFound(_0x3448c1,_0x459694){return function(_0x208333){if(!_0x208333){_0x3448c1[_0xc5a8('0x1a')](0x194);}return _0x208333;};}function handleError(_0x41a2bf,_0x1a49ad){_0x1a49ad=_0x1a49ad||0x1f4;return function(_0x4294c0){logger[_0xc5a8('0x2a')](_0x4294c0['stack']);if(_0x4294c0[_0xc5a8('0x2b')]){delete _0x4294c0['name'];}_0x41a2bf[_0xc5a8('0x1b')](_0x1a49ad)['send'](_0x4294c0);};}exports[_0xc5a8('0x2c')]=function(_0x18e89e,_0x505b27){var _0x10569a={},_0x2aa6d6={},_0x45da21={'count':0x0,'rows':[]};var _0x2102c7=_[_0xc5a8('0x2d')](db[_0xc5a8('0x2e')][_0xc5a8('0x2f')],function(_0x4ec715){return{'name':_0x4ec715[_0xc5a8('0x30')],'type':_0x4ec715[_0xc5a8('0x31')][_0xc5a8('0x32')]};});_0x2aa6d6[_0xc5a8('0x33')]=_[_0xc5a8('0x2d')](_0x2102c7,_0xc5a8('0x2b'));_0x2aa6d6[_0xc5a8('0x34')]=_[_0xc5a8('0x35')](_0x18e89e[_0xc5a8('0x34')]);_0x2aa6d6[_0xc5a8('0x36')]=_[_0xc5a8('0x37')](_0x2aa6d6[_0xc5a8('0x33')],_0x2aa6d6[_0xc5a8('0x34')]);_0x10569a[_0xc5a8('0x38')]=_[_0xc5a8('0x37')](_0x2aa6d6['model'],qs['fields'](_0x18e89e[_0xc5a8('0x34')][_0xc5a8('0x39')]));_0x10569a[_0xc5a8('0x38')]=_0x10569a['attributes'][_0xc5a8('0x3a')]?_0x10569a[_0xc5a8('0x38')]:_0x2aa6d6[_0xc5a8('0x33')];if(!_0x18e89e[_0xc5a8('0x34')]['hasOwnProperty']('nolimit')){_0x10569a['limit']=qs[_0xc5a8('0x20')](_0x18e89e[_0xc5a8('0x34')][_0xc5a8('0x20')]);_0x10569a[_0xc5a8('0x1e')]=qs[_0xc5a8('0x1e')](_0x18e89e['query'][_0xc5a8('0x1e')]);}_0x10569a[_0xc5a8('0x3b')]=qs['sort'](_0x18e89e[_0xc5a8('0x34')]['sort']);_0x10569a[_0xc5a8('0x3c')]=qs[_0xc5a8('0x36')](_[_0xc5a8('0x3d')](_0x18e89e[_0xc5a8('0x34')],_0x2aa6d6[_0xc5a8('0x36')]),_0x2102c7);if(_0x18e89e[_0xc5a8('0x34')]['filter']){_0x10569a[_0xc5a8('0x3c')]=_[_0xc5a8('0x3e')](_0x10569a[_0xc5a8('0x3c')],{'$or':_[_0xc5a8('0x2d')](_0x2102c7,function(_0x457a4c){if(_0x457a4c[_0xc5a8('0x31')]!==_0xc5a8('0x3f')){var _0x23361e={};_0x23361e[_0x457a4c['name']]={'$like':'%'+_0x18e89e[_0xc5a8('0x34')][_0xc5a8('0x40')]+'%'};return _0x23361e;}})});}_0x10569a=_[_0xc5a8('0x3e')]({},_0x10569a,_0x18e89e[_0xc5a8('0x41')]);var _0x4be8d9={'where':_0x10569a[_0xc5a8('0x3c')]};return db['FreshdeskAccount'][_0xc5a8('0x21')](_0x4be8d9)[_0xc5a8('0x28')](function(_0x3207dd){_0x45da21['count']=_0x3207dd;if(_0x18e89e[_0xc5a8('0x34')][_0xc5a8('0x42')]){_0x10569a[_0xc5a8('0x43')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x10569a);})['then'](function(_0x2d8238){_0x45da21[_0xc5a8('0x44')]=_0x2d8238;return _0x45da21;})[_0xc5a8('0x28')](respondWithFilteredResult(_0x505b27,_0x10569a))['catch'](handleError(_0x505b27,null));};exports[_0xc5a8('0x45')]=function(_0x5ae3b6,_0x53bef2){var _0x5b2284={'raw':![],'where':{'id':_0x5ae3b6['params']['id']}},_0x5a0adb={};_0x5a0adb['model']=_[_0xc5a8('0x35')](db[_0xc5a8('0x2e')][_0xc5a8('0x2f')]);_0x5a0adb[_0xc5a8('0x34')]=_[_0xc5a8('0x35')](_0x5ae3b6[_0xc5a8('0x34')]);_0x5a0adb[_0xc5a8('0x36')]=_[_0xc5a8('0x37')](_0x5a0adb[_0xc5a8('0x33')],_0x5a0adb['query']);_0x5b2284[_0xc5a8('0x38')]=_[_0xc5a8('0x37')](_0x5a0adb[_0xc5a8('0x33')],qs[_0xc5a8('0x39')](_0x5ae3b6['query'][_0xc5a8('0x39')]));_0x5b2284[_0xc5a8('0x38')]=_0x5b2284[_0xc5a8('0x38')][_0xc5a8('0x3a')]?_0x5b2284['attributes']:_0x5a0adb['model'];if(_0x5ae3b6[_0xc5a8('0x34')][_0xc5a8('0x42')]){_0x5b2284[_0xc5a8('0x43')]=[{'all':!![]}];}_0x5b2284=_['merge']({},_0x5b2284,_0x5ae3b6[_0xc5a8('0x41')]);return db[_0xc5a8('0x2e')][_0xc5a8('0x46')](_0x5b2284)[_0xc5a8('0x28')](handleEntityNotFound(_0x53bef2,null))[_0xc5a8('0x28')](respondWithResult(_0x53bef2,null))['catch'](handleError(_0x53bef2,null));};exports[_0xc5a8('0x47')]=function(_0x4f40a4,_0x3efbdf){return db[_0xc5a8('0x2e')]['create'](_0x4f40a4['body'],{})[_0xc5a8('0x28')](respondWithResult(_0x3efbdf,0xc9))[_0xc5a8('0x48')](handleError(_0x3efbdf,null));};exports['update']=function(_0x526d11,_0x3dc3c0){if(_0x526d11[_0xc5a8('0x49')]['id']){delete _0x526d11[_0xc5a8('0x49')]['id'];}return db[_0xc5a8('0x2e')][_0xc5a8('0x46')]({'where':{'id':_0x526d11[_0xc5a8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3dc3c0,null))['then'](saveUpdates(_0x526d11['body'],null))['then'](respondWithResult(_0x3dc3c0,null))[_0xc5a8('0x48')](handleError(_0x3dc3c0,null));};exports[_0xc5a8('0x29')]=function(_0x796f8a,_0x4a930c){return db['FreshdeskAccount'][_0xc5a8('0x46')]({'where':{'id':_0x796f8a[_0xc5a8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4a930c,null))['then'](removeEntity(_0x4a930c,null))[_0xc5a8('0x48')](handleError(_0x4a930c,null));};exports[_0xc5a8('0x4b')]=function(_0xa227dd,_0x57ce70,_0x2718bc){var _0x185ed2={};var _0x57fd22={};var _0x486f0e;var _0x3be874;return db[_0xc5a8('0x2e')]['findOne']({'where':{'id':_0xa227dd[_0xc5a8('0x4a')]['id']}})[_0xc5a8('0x28')](handleEntityNotFound(_0x57ce70,null))[_0xc5a8('0x28')](function(_0x4fa548){if(_0x4fa548){_0x486f0e=_0x4fa548;_0x57fd22[_0xc5a8('0x33')]=_[_0xc5a8('0x35')](db[_0xc5a8('0x4c')][_0xc5a8('0x2f')]);_0x57fd22[_0xc5a8('0x34')]=_[_0xc5a8('0x35')](_0xa227dd[_0xc5a8('0x34')]);_0x57fd22[_0xc5a8('0x36')]=_[_0xc5a8('0x37')](_0x57fd22[_0xc5a8('0x33')],_0x57fd22['query']);_0x185ed2['attributes']=_[_0xc5a8('0x37')](_0x57fd22[_0xc5a8('0x33')],qs[_0xc5a8('0x39')](_0xa227dd[_0xc5a8('0x34')][_0xc5a8('0x39')]));_0x185ed2['attributes']=_0x185ed2[_0xc5a8('0x38')][_0xc5a8('0x3a')]?_0x185ed2['attributes']:_0x57fd22[_0xc5a8('0x33')];_0x185ed2[_0xc5a8('0x3b')]=qs[_0xc5a8('0x4d')](_0xa227dd[_0xc5a8('0x34')][_0xc5a8('0x4d')]);_0x185ed2[_0xc5a8('0x3c')]=qs[_0xc5a8('0x36')](_['pick'](_0xa227dd[_0xc5a8('0x34')],_0x57fd22['filters']));if(_0xa227dd[_0xc5a8('0x34')][_0xc5a8('0x40')]){_0x185ed2[_0xc5a8('0x3c')]=_[_0xc5a8('0x3e')](_0x185ed2[_0xc5a8('0x3c')],{'$or':_[_0xc5a8('0x2d')](_0x185ed2['attributes'],function(_0x3a3986){var _0x1d911c={};_0x1d911c[_0x3a3986]={'$like':'%'+_0xa227dd[_0xc5a8('0x34')][_0xc5a8('0x40')]+'%'};return _0x1d911c;})});}_0x185ed2=_['merge']({},_0x185ed2,_0xa227dd['options']);return _0x486f0e['getConfigurations'](_0x185ed2);}})[_0xc5a8('0x28')](function(_0x5b5318){if(_0x5b5318){_0x3be874=_0x5b5318['length'];if(!_0xa227dd['query'][_0xc5a8('0x4e')](_0xc5a8('0x4f'))){_0x185ed2[_0xc5a8('0x20')]=qs[_0xc5a8('0x20')](_0xa227dd['query'][_0xc5a8('0x20')]);_0x185ed2['offset']=qs[_0xc5a8('0x1e')](_0xa227dd[_0xc5a8('0x34')]['offset']);}return _0x486f0e[_0xc5a8('0x4b')](_0x185ed2);}})[_0xc5a8('0x28')](function(_0x547275){if(_0x547275){return _0x547275?{'count':_0x3be874,'rows':_0x547275}:null;}})[_0xc5a8('0x28')](respondWithResult(_0x57ce70,null))[_0xc5a8('0x48')](handleError(_0x57ce70,null));};exports[_0xc5a8('0x50')]=function(_0x449296,_0x1001b5,_0x3c7605){if(_0x449296[_0xc5a8('0x49')]['id']){delete _0x449296[_0xc5a8('0x49')]['id'];}return db[_0xc5a8('0x2e')][_0xc5a8('0x51')]({'where':{'id':_0x449296[_0xc5a8('0x4a')]['id']}})[_0xc5a8('0x28')](handleEntityNotFound(_0x1001b5,null))[_0xc5a8('0x28')](function(_0x441b9f){if(_0x441b9f){_0x449296[_0xc5a8('0x49')]['AccountId']=_0x441b9f['id'];_0x449296[_0xc5a8('0x49')][_0xc5a8('0x52')]=integrations['getSubjects'](_0x449296[_0xc5a8('0x49')][_0xc5a8('0x53')],_0x449296[_0xc5a8('0x49')]['type']);_0x449296[_0xc5a8('0x49')]['Descriptions']=integrations['getDescriptions'](_0x449296['body'][_0xc5a8('0x53')],_0x449296[_0xc5a8('0x49')][_0xc5a8('0x31')]);return db[_0xc5a8('0x4c')][_0xc5a8('0x47')](_0x449296[_0xc5a8('0x49')],{'include':[{'model':db[_0xc5a8('0x54')],'as':_0xc5a8('0x52')},{'model':db['FreshdeskField'],'as':_0xc5a8('0x55')}]});}return null;})['then'](respondWithResult(_0x1001b5,null))[_0xc5a8('0x48')](handleError(_0x1001b5,null));};exports['getFields']=function(_0x429333,_0x54ce22,_0x5adbc8){var _0x2d2c0f='';return db[_0xc5a8('0x2e')]['findOne']({'where':{'id':_0x429333['params']['id']},'attributes':['id',_0xc5a8('0x56'),_0xc5a8('0x57')]})['then'](handleEntityNotFound(_0x54ce22,null))['then'](function(_0x453da8){if(_0x453da8){_0x2d2c0f=_0x453da8[_0xc5a8('0x56')];var _0x20c7b1=_0x2d2c0f[_0xc5a8('0x58')](-0x1);if(_0x20c7b1==='/'){_0x2d2c0f=_0x2d2c0f[_0xc5a8('0x59')](0x0,_0x2d2c0f[_0xc5a8('0x5a')](_0x20c7b1));}return rp({'method':_0xc5a8('0x5b'),'uri':util[_0xc5a8('0x5c')](_0xc5a8('0x5d'),_0x2d2c0f,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xc5a8('0x5c')](_0xc5a8('0x5e'),new Buffer(util[_0xc5a8('0x5c')](_0xc5a8('0x5f'),_0x453da8[_0xc5a8('0x57')]))[_0xc5a8('0x60')](_0xc5a8('0x61')))},'json':!![]});}})[_0xc5a8('0x28')](function(_0x34b8be){if(_0x34b8be){var _0x151004=['requester','subject',_0xc5a8('0x62'),_0xc5a8('0x63'),_0xc5a8('0x1b'),'priority',_0xc5a8('0x64'),_0xc5a8('0x65'),_0xc5a8('0x66'),'group','company'];_[_0xc5a8('0x67')](_0x34b8be,function(_0xfd1bdb){return _0x151004[_0xc5a8('0x68')](_0xfd1bdb[_0xc5a8('0x2b')])||!_0xfd1bdb['default']&&_0xfd1bdb[_0xc5a8('0x31')]!==_0xc5a8('0x69')&&_0xfd1bdb[_0xc5a8('0x31')]!==_0xc5a8('0x6a');});return{'count':_0x34b8be[_0xc5a8('0x3a')],'rows':_['map'](_0x34b8be,function(_0x2e04b){return{'id':_0x2e04b[_0xc5a8('0x2b')],'name':_0x2e04b[_0xc5a8('0x6b')],'custom':!_0x2e04b['default'],'options':_0x2e04b['choices']?_[_0xc5a8('0x2d')](_0x2e04b['choices'],function(_0x3bb63b){return{'name':_[_0xc5a8('0x6c')](_0x3bb63b),'value':_0x3bb63b};}):[]};})};}})[_0xc5a8('0x28')](respondWithResult(_0x54ce22,null))[_0xc5a8('0x48')](function(_0x1050b7){var _0x598057=_0x429333[_0xc5a8('0x34')]['test']?0x1f4:_0x1050b7[_0xc5a8('0x6d')]||0x1f4;logger['error'](_0xc5a8('0x6e'),_0xc5a8('0x6f'),_0x598057,JSON[_0xc5a8('0x70')](_0x1050b7));delete _0x1050b7['name'];if(_0x598057===0x191){_0x598057=0x190;}_0x54ce22[_0xc5a8('0x1b')](_0x598057)[_0xc5a8('0x71')](_0x429333['query']['test']?{'message':_0xc5a8('0x72'),'statusCode':_0x1050b7[_0xc5a8('0x6d')]}:_0x1050b7);});}; \ No newline at end of file +var _0x175e=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','findOne','FreshdeskConfiguration','order','sort','filter','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','description','priority','group','source','ticket_type','company','includes','default','custom_text','custom_dropdown','label','choices','capitalize','statusCode','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache'];(function(_0x18aaaf,_0x385db6){var _0x52d892=function(_0x1ac6da){while(--_0x1ac6da){_0x18aaaf['push'](_0x18aaaf['shift']());}};_0x52d892(++_0x385db6);}(_0x175e,0xe6));var _0xe175=function(_0x23ca4d,_0x10b33a){_0x23ca4d=_0x23ca4d-0x0;var _0x2dd9fb=_0x175e[_0x23ca4d];return _0x2dd9fb;};'use strict';var emlformat=require(_0xe175('0x0'));var rimraf=require(_0xe175('0x1'));var zipdir=require(_0xe175('0x2'));var jsonpatch=require(_0xe175('0x3'));var rp=require(_0xe175('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe175('0x5'));var util=require(_0xe175('0x6'));var path=require(_0xe175('0x7'));var sox=require(_0xe175('0x8'));var csv=require(_0xe175('0x9'));var ejs=require(_0xe175('0xa'));var fs=require('fs');var fs_extra=require(_0xe175('0xb'));var _=require(_0xe175('0xc'));var squel=require(_0xe175('0xd'));var crypto=require(_0xe175('0xe'));var jsforce=require(_0xe175('0xf'));var deskjs=require(_0xe175('0x10'));var toCsv=require(_0xe175('0x9'));var querystring=require(_0xe175('0x11'));var Papa=require(_0xe175('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe175('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe175('0x14'));var logger=require(_0xe175('0x15'))(_0xe175('0x16'));var utils=require(_0xe175('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe175('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4b1b9b,_0x43eeb4){_0x43eeb4=_0x43eeb4||0xcc;return function(_0x336aa1){if(_0x336aa1){return _0x4b1b9b[_0xe175('0x19')](_0x43eeb4);}return _0x4b1b9b[_0xe175('0x1a')](_0x43eeb4)[_0xe175('0x1b')]();};}function respondWithResult(_0x4d2f51,_0x1e5477){_0x1e5477=_0x1e5477||0xc8;return function(_0x29885c){if(_0x29885c){return _0x4d2f51[_0xe175('0x1a')](_0x1e5477)[_0xe175('0x1c')](_0x29885c);}};}function respondWithFilteredResult(_0x3a0677,_0x20660b){return function(_0x20ac70){if(_0x20ac70){var _0x561ee3=typeof _0x20660b[_0xe175('0x1d')]===_0xe175('0x1e')&&typeof _0x20660b[_0xe175('0x1f')]==='undefined';var _0x1b3af5=_0x20ac70[_0xe175('0x20')];var _0xd6398d=_0x561ee3?0x0:_0x20660b[_0xe175('0x1d')];var _0x43e1fa=_0x561ee3?_0x20ac70[_0xe175('0x20')]:_0x20660b['offset']+_0x20660b[_0xe175('0x1f')];var _0xe697af;if(_0x43e1fa>=_0x1b3af5){_0x43e1fa=_0x1b3af5;_0xe697af=0xc8;}else{_0xe697af=0xce;}_0x3a0677[_0xe175('0x1a')](_0xe697af);return _0x3a0677[_0xe175('0x21')]('Content-Range',_0xd6398d+'-'+_0x43e1fa+'/'+_0x1b3af5)[_0xe175('0x1c')](_0x20ac70);}return null;};}function patchUpdates(_0x1d0d6c){return function(_0x242ec4){try{jsonpatch['apply'](_0x242ec4,_0x1d0d6c,!![]);}catch(_0x3c6dc9){return BPromise[_0xe175('0x22')](_0x3c6dc9);}return _0x242ec4['save']();};}function saveUpdates(_0xb10d29,_0x4f6115){return function(_0x3e27c3){if(_0x3e27c3){return _0x3e27c3[_0xe175('0x23')](_0xb10d29)[_0xe175('0x24')](function(_0x20dd39){return _0x20dd39;});}return null;};}function removeEntity(_0x2e02c0,_0x3b2111){return function(_0x15937c){if(_0x15937c){return _0x15937c[_0xe175('0x25')]()[_0xe175('0x24')](function(){_0x2e02c0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf7c205,_0x1527fe){return function(_0xe480ba){if(!_0xe480ba){_0xf7c205[_0xe175('0x19')](0x194);}return _0xe480ba;};}function handleError(_0x12340d,_0x336b44){_0x336b44=_0x336b44||0x1f4;return function(_0x274daa){logger[_0xe175('0x26')](_0x274daa[_0xe175('0x27')]);if(_0x274daa[_0xe175('0x28')]){delete _0x274daa[_0xe175('0x28')];}_0x12340d[_0xe175('0x1a')](_0x336b44)[_0xe175('0x29')](_0x274daa);};}exports[_0xe175('0x2a')]=function(_0x5c0ed7,_0x49b7fa){var _0x4f645c={},_0x266b33={},_0x3c0e15={'count':0x0,'rows':[]};var _0x3f5a18=_[_0xe175('0x2b')](db[_0xe175('0x2c')][_0xe175('0x2d')],function(_0x526bbd){return{'name':_0x526bbd[_0xe175('0x2e')],'type':_0x526bbd[_0xe175('0x2f')][_0xe175('0x30')]};});_0x266b33[_0xe175('0x31')]=_[_0xe175('0x2b')](_0x3f5a18,_0xe175('0x28'));_0x266b33[_0xe175('0x32')]=_[_0xe175('0x33')](_0x5c0ed7['query']);_0x266b33[_0xe175('0x34')]=_[_0xe175('0x35')](_0x266b33[_0xe175('0x31')],_0x266b33[_0xe175('0x32')]);_0x4f645c['attributes']=_[_0xe175('0x35')](_0x266b33[_0xe175('0x31')],qs['fields'](_0x5c0ed7['query'][_0xe175('0x36')]));_0x4f645c[_0xe175('0x37')]=_0x4f645c[_0xe175('0x37')]['length']?_0x4f645c[_0xe175('0x37')]:_0x266b33[_0xe175('0x31')];if(!_0x5c0ed7[_0xe175('0x32')][_0xe175('0x38')](_0xe175('0x39'))){_0x4f645c[_0xe175('0x1f')]=qs[_0xe175('0x1f')](_0x5c0ed7[_0xe175('0x32')][_0xe175('0x1f')]);_0x4f645c[_0xe175('0x1d')]=qs[_0xe175('0x1d')](_0x5c0ed7[_0xe175('0x32')][_0xe175('0x1d')]);}_0x4f645c['order']=qs['sort'](_0x5c0ed7[_0xe175('0x32')]['sort']);_0x4f645c[_0xe175('0x3a')]=qs['filters'](_[_0xe175('0x3b')](_0x5c0ed7[_0xe175('0x32')],_0x266b33['filters']),_0x3f5a18);if(_0x5c0ed7[_0xe175('0x32')]['filter']){_0x4f645c[_0xe175('0x3a')]=_[_0xe175('0x3c')](_0x4f645c['where'],{'$or':_[_0xe175('0x2b')](_0x3f5a18,function(_0x488b64){if(_0x488b64[_0xe175('0x2f')]!==_0xe175('0x3d')){var _0x5949e7={};_0x5949e7[_0x488b64['name']]={'$like':'%'+_0x5c0ed7['query']['filter']+'%'};return _0x5949e7;}})});}_0x4f645c=_['merge']({},_0x4f645c,_0x5c0ed7['options']);var _0x4c6c80={'where':_0x4f645c[_0xe175('0x3a')]};return db[_0xe175('0x2c')][_0xe175('0x20')](_0x4c6c80)[_0xe175('0x24')](function(_0x49252f){_0x3c0e15['count']=_0x49252f;if(_0x5c0ed7[_0xe175('0x32')][_0xe175('0x3e')]){_0x4f645c[_0xe175('0x3f')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0xe175('0x40')](_0x4f645c);})[_0xe175('0x24')](function(_0x51528a){_0x3c0e15[_0xe175('0x41')]=_0x51528a;return _0x3c0e15;})['then'](respondWithFilteredResult(_0x49b7fa,_0x4f645c))[_0xe175('0x42')](handleError(_0x49b7fa,null));};exports[_0xe175('0x43')]=function(_0x18aaf8,_0x5c0951){var _0x4464e4={'raw':![],'where':{'id':_0x18aaf8[_0xe175('0x44')]['id']}},_0x21678d={};_0x21678d[_0xe175('0x31')]=_[_0xe175('0x33')](db[_0xe175('0x2c')]['rawAttributes']);_0x21678d[_0xe175('0x32')]=_[_0xe175('0x33')](_0x18aaf8[_0xe175('0x32')]);_0x21678d['filters']=_['intersection'](_0x21678d[_0xe175('0x31')],_0x21678d[_0xe175('0x32')]);_0x4464e4['attributes']=_['intersection'](_0x21678d['model'],qs['fields'](_0x18aaf8[_0xe175('0x32')][_0xe175('0x36')]));_0x4464e4[_0xe175('0x37')]=_0x4464e4[_0xe175('0x37')][_0xe175('0x45')]?_0x4464e4[_0xe175('0x37')]:_0x21678d[_0xe175('0x31')];if(_0x18aaf8[_0xe175('0x32')][_0xe175('0x3e')]){_0x4464e4[_0xe175('0x3f')]=[{'all':!![]}];}_0x4464e4=_['merge']({},_0x4464e4,_0x18aaf8[_0xe175('0x46')]);return db[_0xe175('0x2c')][_0xe175('0x47')](_0x4464e4)['then'](handleEntityNotFound(_0x5c0951,null))[_0xe175('0x24')](respondWithResult(_0x5c0951,null))[_0xe175('0x42')](handleError(_0x5c0951,null));};exports[_0xe175('0x48')]=function(_0x4c5f4a,_0x4d0d9e){return db[_0xe175('0x2c')][_0xe175('0x48')](_0x4c5f4a['body'],{})[_0xe175('0x24')](respondWithResult(_0x4d0d9e,0xc9))[_0xe175('0x42')](handleError(_0x4d0d9e,null));};exports[_0xe175('0x23')]=function(_0x4e8cda,_0x8820e0){if(_0x4e8cda['body']['id']){delete _0x4e8cda[_0xe175('0x49')]['id'];}return db[_0xe175('0x2c')][_0xe175('0x47')]({'where':{'id':_0x4e8cda[_0xe175('0x44')]['id']}})[_0xe175('0x24')](handleEntityNotFound(_0x8820e0,null))['then'](saveUpdates(_0x4e8cda[_0xe175('0x49')],null))[_0xe175('0x24')](respondWithResult(_0x8820e0,null))[_0xe175('0x42')](handleError(_0x8820e0,null));};exports[_0xe175('0x25')]=function(_0x18d279,_0x47c62c){return db[_0xe175('0x2c')][_0xe175('0x47')]({'where':{'id':_0x18d279[_0xe175('0x44')]['id']}})[_0xe175('0x24')](handleEntityNotFound(_0x47c62c,null))[_0xe175('0x24')](removeEntity(_0x47c62c,null))[_0xe175('0x42')](handleError(_0x47c62c,null));};exports['getConfigurations']=function(_0x2114c3,_0x2b4d5e,_0x49c584){var _0x2137d2={};var _0x8de30c={};var _0x3532e8;var _0x10c983;return db[_0xe175('0x2c')][_0xe175('0x4a')]({'where':{'id':_0x2114c3[_0xe175('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b4d5e,null))['then'](function(_0x5b541c){if(_0x5b541c){_0x3532e8=_0x5b541c;_0x8de30c[_0xe175('0x31')]=_[_0xe175('0x33')](db[_0xe175('0x4b')][_0xe175('0x2d')]);_0x8de30c[_0xe175('0x32')]=_[_0xe175('0x33')](_0x2114c3[_0xe175('0x32')]);_0x8de30c[_0xe175('0x34')]=_['intersection'](_0x8de30c[_0xe175('0x31')],_0x8de30c[_0xe175('0x32')]);_0x2137d2['attributes']=_[_0xe175('0x35')](_0x8de30c[_0xe175('0x31')],qs[_0xe175('0x36')](_0x2114c3[_0xe175('0x32')][_0xe175('0x36')]));_0x2137d2['attributes']=_0x2137d2['attributes'][_0xe175('0x45')]?_0x2137d2[_0xe175('0x37')]:_0x8de30c[_0xe175('0x31')];_0x2137d2[_0xe175('0x4c')]=qs[_0xe175('0x4d')](_0x2114c3[_0xe175('0x32')][_0xe175('0x4d')]);_0x2137d2[_0xe175('0x3a')]=qs[_0xe175('0x34')](_['pick'](_0x2114c3['query'],_0x8de30c[_0xe175('0x34')]));if(_0x2114c3['query'][_0xe175('0x4e')]){_0x2137d2[_0xe175('0x3a')]=_['merge'](_0x2137d2[_0xe175('0x3a')],{'$or':_[_0xe175('0x2b')](_0x2137d2[_0xe175('0x37')],function(_0x54e91f){var _0x4bc6f5={};_0x4bc6f5[_0x54e91f]={'$like':'%'+_0x2114c3[_0xe175('0x32')][_0xe175('0x4e')]+'%'};return _0x4bc6f5;})});}_0x2137d2=_[_0xe175('0x3c')]({},_0x2137d2,_0x2114c3[_0xe175('0x46')]);return _0x3532e8[_0xe175('0x4f')](_0x2137d2);}})[_0xe175('0x24')](function(_0x11f0c9){if(_0x11f0c9){_0x10c983=_0x11f0c9[_0xe175('0x45')];if(!_0x2114c3[_0xe175('0x32')][_0xe175('0x38')]('nolimit')){_0x2137d2[_0xe175('0x1f')]=qs[_0xe175('0x1f')](_0x2114c3[_0xe175('0x32')][_0xe175('0x1f')]);_0x2137d2[_0xe175('0x1d')]=qs[_0xe175('0x1d')](_0x2114c3[_0xe175('0x32')][_0xe175('0x1d')]);}return _0x3532e8['getConfigurations'](_0x2137d2);}})[_0xe175('0x24')](function(_0x4aea5a){if(_0x4aea5a){return _0x4aea5a?{'count':_0x10c983,'rows':_0x4aea5a}:null;}})[_0xe175('0x24')](respondWithResult(_0x2b4d5e,null))['catch'](handleError(_0x2b4d5e,null));};exports[_0xe175('0x50')]=function(_0x334cc4,_0x330921,_0x4055c4){if(_0x334cc4['body']['id']){delete _0x334cc4[_0xe175('0x49')]['id'];}return db[_0xe175('0x2c')][_0xe175('0x4a')]({'where':{'id':_0x334cc4[_0xe175('0x44')]['id']}})[_0xe175('0x24')](handleEntityNotFound(_0x330921,null))[_0xe175('0x24')](function(_0x584126){if(_0x584126){_0x334cc4[_0xe175('0x49')][_0xe175('0x51')]=_0x584126['id'];_0x334cc4['body'][_0xe175('0x52')]=integrations[_0xe175('0x53')](_0x334cc4[_0xe175('0x49')][_0xe175('0x54')],_0x334cc4[_0xe175('0x49')][_0xe175('0x2f')]);_0x334cc4[_0xe175('0x49')][_0xe175('0x55')]=integrations['getDescriptions'](_0x334cc4[_0xe175('0x49')][_0xe175('0x54')],_0x334cc4[_0xe175('0x49')][_0xe175('0x2f')]);return db['FreshdeskConfiguration']['create'](_0x334cc4['body'],{'include':[{'model':db[_0xe175('0x56')],'as':'Subjects'},{'model':db[_0xe175('0x56')],'as':_0xe175('0x55')}]});}return null;})['then'](respondWithResult(_0x330921,null))[_0xe175('0x42')](handleError(_0x330921,null));};exports[_0xe175('0x57')]=function(_0x16409b,_0xb33d77,_0x2a9233){var _0x307017='';return db['FreshdeskAccount'][_0xe175('0x4a')]({'where':{'id':_0x16409b[_0xe175('0x44')]['id']},'attributes':['id',_0xe175('0x58'),_0xe175('0x59')]})[_0xe175('0x24')](handleEntityNotFound(_0xb33d77,null))[_0xe175('0x24')](function(_0x3c4375){if(_0x3c4375){_0x307017=_0x3c4375['remoteUri'];var _0x4066b1=_0x307017[_0xe175('0x5a')](-0x1);if(_0x4066b1==='/'){_0x307017=_0x307017[_0xe175('0x5b')](0x0,_0x307017[_0xe175('0x5c')](_0x4066b1));}return rp({'method':_0xe175('0x5d'),'uri':util[_0xe175('0x5e')](_0xe175('0x5f'),_0x307017,_0xe175('0x60')),'headers':{'Authorization':util[_0xe175('0x5e')](_0xe175('0x61'),new Buffer(util['format'](_0xe175('0x62'),_0x3c4375['apiKey']))[_0xe175('0x63')](_0xe175('0x64')))},'json':!![]});}})[_0xe175('0x24')](function(_0x5742f1){if(_0x5742f1){var _0x5c30a3=[_0xe175('0x65'),_0xe175('0x66'),'agent',_0xe175('0x67'),_0xe175('0x1a'),_0xe175('0x68'),_0xe175('0x69'),_0xe175('0x6a'),_0xe175('0x6b'),'group',_0xe175('0x6c')];_['remove'](_0x5742f1,function(_0x396ad7){return _0x5c30a3[_0xe175('0x6d')](_0x396ad7[_0xe175('0x28')])||!_0x396ad7[_0xe175('0x6e')]&&_0x396ad7[_0xe175('0x2f')]!==_0xe175('0x6f')&&_0x396ad7[_0xe175('0x2f')]!==_0xe175('0x70');});return{'count':_0x5742f1[_0xe175('0x45')],'rows':_[_0xe175('0x2b')](_0x5742f1,function(_0x225741){return{'id':_0x225741[_0xe175('0x28')],'name':_0x225741[_0xe175('0x71')],'custom':!_0x225741[_0xe175('0x6e')],'options':_0x225741[_0xe175('0x72')]?_[_0xe175('0x2b')](_0x225741[_0xe175('0x72')],function(_0x32926a){return{'name':_[_0xe175('0x73')](_0x32926a),'value':_0x32926a};}):[]};})};}})[_0xe175('0x24')](respondWithResult(_0xb33d77,null))[_0xe175('0x42')](function(_0x2a9372){var _0x318459=_0x16409b['query']['test']?0x1f4:_0x2a9372[_0xe175('0x74')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xe175('0x57'),_0x318459,JSON['stringify'](_0x2a9372));delete _0x2a9372[_0xe175('0x28')];if(_0x318459===0x191){_0x318459=0x190;}_0xb33d77[_0xe175('0x1a')](_0x318459)['send'](_0x16409b['query'][_0xe175('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0x2a9372[_0xe175('0x74')]}:_0x2a9372);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index bb1abf3..cc34c19 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x683b=['request-promise','path','rimraf','../../components/integrations/configuration','define','FreshdeskAccount','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x683b,0x19e));var _0xb683=function(_0x3a06f0,_0x418dcb){_0x3a06f0=_0x3a06f0-0x0;var _0x2e7b31=_0x683b[_0x3a06f0];return _0x2e7b31;};'use strict';var _=require(_0xb683('0x0'));var util=require(_0xb683('0x1'));var logger=require(_0xb683('0x2'))(_0xb683('0x3'));var moment=require(_0xb683('0x4'));var BPromise=require(_0xb683('0x5'));var rp=require(_0xb683('0x6'));var fs=require('fs');var path=require(_0xb683('0x7'));var rimraf=require(_0xb683('0x8'));var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xb683('0x9'));module['exports']=function(_0x35dce2,_0x13fc0b){return _0x35dce2[_0xb683('0xa')](_0xb683('0xb'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x09c2=['api','moment','request-promise','rimraf','./intFreshdeskAccount.attributes','exports','FreshdeskAccount','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x09c2,0x15f));var _0x209c=function(_0x470bfb,_0x389787){_0x470bfb=_0x470bfb-0x0;var _0x2f5d97=_0x09c2[_0x470bfb];return _0x2f5d97;};'use strict';var _=require(_0x209c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x209c('0x1'));var moment=require(_0x209c('0x2'));var BPromise=require('bluebird');var rp=require(_0x209c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x209c('0x4'));var config=require('../../config/environment');var attributes=require(_0x209c('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x209c('0x6')]=function(_0x54b75f,_0x488763){return _0x54b75f['define'](_0x209c('0x7'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 41e489a..9f13a74 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b45=['../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','GetFreshdeskAccount','findAll','options','raw','where','attributes','limit','map','include','model','stringify','catch','FreshdeskAccount','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x35c56e,_0x65a609){var _0x163702=function(_0x32cd6a){while(--_0x32cd6a){_0x35c56e['push'](_0x35c56e['shift']());}};_0x163702(++_0x65a609);}(_0x6b45,0xb0));var _0x56b4=function(_0x3de873,_0x174b5f){_0x3de873=_0x3de873-0x0;var _0x380b8c=_0x6b45[_0x3de873];return _0x380b8c;};'use strict';var _=require(_0x56b4('0x0'));var util=require(_0x56b4('0x1'));var moment=require(_0x56b4('0x2'));var BPromise=require(_0x56b4('0x3'));var rs=require(_0x56b4('0x4'));var fs=require('fs');var Redis=require(_0x56b4('0x5'));var db=require(_0x56b4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x56b4('0x7'))(_0x56b4('0x8'));var config=require(_0x56b4('0x9'));var jayson=require(_0x56b4('0xa'));var client=jayson[_0x56b4('0xb')][_0x56b4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x12284d,_0x55d209,_0x1789b6){return new BPromise(function(_0x3583d9,_0x601666){return client[_0x56b4('0xd')](_0x12284d,_0x1789b6)[_0x56b4('0xe')](function(_0x542311){logger[_0x56b4('0xf')](_0x56b4('0x10'),_0x55d209,'request\x20sent');logger[_0x56b4('0x11')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x55d209,_0x56b4('0x12'),JSON['stringify'](_0x542311));if(_0x542311[_0x56b4('0x13')]){if(_0x542311['error'][_0x56b4('0x14')]===0x1f4){logger['error'](_0x56b4('0x10'),_0x55d209,_0x542311['error']['message']);return _0x601666(_0x542311[_0x56b4('0x13')][_0x56b4('0x15')]);}logger[_0x56b4('0x13')](_0x56b4('0x10'),_0x55d209,_0x542311['error'][_0x56b4('0x15')]);return _0x3583d9(_0x542311[_0x56b4('0x13')][_0x56b4('0x15')]);}else{logger[_0x56b4('0xf')](_0x56b4('0x10'),_0x55d209,_0x56b4('0x12'));_0x3583d9(_0x542311[_0x56b4('0x16')]['message']);}})['catch'](function(_0x561584){logger[_0x56b4('0x13')](_0x56b4('0x10'),_0x55d209,_0x561584);_0x601666(_0x561584);});});}exports[_0x56b4('0x17')]=function(_0xd835ac){var _0x192aec=this;return new Promise(function(_0x5af3f0,_0x3b6c64){return db['FreshdeskAccount'][_0x56b4('0x18')]({'raw':_0xd835ac[_0x56b4('0x19')]?_0xd835ac[_0x56b4('0x19')][_0x56b4('0x1a')]===undefined?!![]:![]:!![],'where':_0xd835ac[_0x56b4('0x19')]?_0xd835ac[_0x56b4('0x19')][_0x56b4('0x1b')]||null:null,'attributes':_0xd835ac[_0x56b4('0x19')]?_0xd835ac[_0x56b4('0x19')][_0x56b4('0x1c')]||null:null,'limit':_0xd835ac['options']?_0xd835ac[_0x56b4('0x19')][_0x56b4('0x1d')]||null:null,'include':_0xd835ac[_0x56b4('0x19')]?_0xd835ac[_0x56b4('0x19')]['include']?_[_0x56b4('0x1e')](_0xd835ac[_0x56b4('0x19')][_0x56b4('0x1f')],function(_0x56f51e){return{'model':db[_0x56f51e['model']],'as':_0x56f51e['as'],'attributes':_0x56f51e['attributes'],'include':_0x56f51e['include']?_[_0x56b4('0x1e')](_0x56f51e[_0x56b4('0x1f')],function(_0x27aee1){return{'model':db[_0x27aee1['model']],'as':_0x27aee1['as'],'attributes':_0x27aee1[_0x56b4('0x1c')],'include':_0x27aee1[_0x56b4('0x1f')]?_[_0x56b4('0x1e')](_0x27aee1[_0x56b4('0x1f')],function(_0x3d2688){return{'model':db[_0x3d2688[_0x56b4('0x20')]],'as':_0x3d2688['as'],'attributes':_0x3d2688[_0x56b4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x56b4('0xe')](function(_0x51ed2a){logger['info'](_0x56b4('0x17'),_0xd835ac);logger['debug'](_0x56b4('0x17'),_0xd835ac,JSON[_0x56b4('0x21')](_0x51ed2a));_0x5af3f0(_0x51ed2a);})[_0x56b4('0x22')](function(_0xebae7){logger[_0x56b4('0x13')](_0x56b4('0x17'),_0xebae7[_0x56b4('0x15')],_0xd835ac);_0x3b6c64(_0x192aec['error'](0x1f4,_0xebae7[_0x56b4('0x15')]));});});};exports['ShowFreshdeskAccount']=function(_0x42dd77){var _0x58efbb=this;return new Promise(function(_0x9f7fa7,_0x5b7dde){return db[_0x56b4('0x23')]['find']({'raw':_0x42dd77['options']?_0x42dd77[_0x56b4('0x19')][_0x56b4('0x1a')]===undefined?!![]:![]:!![],'where':_0x42dd77[_0x56b4('0x19')]?_0x42dd77[_0x56b4('0x19')][_0x56b4('0x1b')]||null:null,'attributes':_0x42dd77[_0x56b4('0x19')]?_0x42dd77[_0x56b4('0x19')][_0x56b4('0x1c')]||null:null,'include':_0x42dd77[_0x56b4('0x19')]?_0x42dd77['options'][_0x56b4('0x1f')]?_[_0x56b4('0x1e')](_0x42dd77[_0x56b4('0x19')]['include'],function(_0x343f7c){return{'model':db[_0x343f7c[_0x56b4('0x20')]],'as':_0x343f7c['as'],'attributes':_0x343f7c[_0x56b4('0x1c')],'include':_0x343f7c['include']?_[_0x56b4('0x1e')](_0x343f7c[_0x56b4('0x1f')],function(_0x3d8e02){return{'model':db[_0x3d8e02[_0x56b4('0x20')]],'as':_0x3d8e02['as'],'attributes':_0x3d8e02[_0x56b4('0x1c')],'include':_0x3d8e02[_0x56b4('0x1f')]?_[_0x56b4('0x1e')](_0x3d8e02[_0x56b4('0x1f')],function(_0x181488){return{'model':db[_0x181488[_0x56b4('0x20')]],'as':_0x181488['as'],'attributes':_0x181488[_0x56b4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x56b4('0xe')](function(_0x124320){logger['info'](_0x56b4('0x24'),_0x42dd77);logger[_0x56b4('0x11')](_0x56b4('0x24'),_0x42dd77,JSON[_0x56b4('0x21')](_0x124320));_0x9f7fa7(_0x124320);})['catch'](function(_0x3ae8ca){logger[_0x56b4('0x13')](_0x56b4('0x24'),_0x3ae8ca['message'],_0x42dd77);_0x5b7dde(_0x58efbb[_0x56b4('0x13')](0x1f4,_0x3ae8ca[_0x56b4('0x15')]));});});}; \ No newline at end of file +var _0xd844=['include','map','model','ShowFreshdeskAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','where','attributes','limit'];(function(_0x4fadd1,_0x51f8cb){var _0x16744c=function(_0x2c263e){while(--_0x2c263e){_0x4fadd1['push'](_0x4fadd1['shift']());}};_0x16744c(++_0x51f8cb);}(_0xd844,0xd2));var _0x4d84=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd844[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x4d84('0x0'));var util=require(_0x4d84('0x1'));var moment=require(_0x4d84('0x2'));var BPromise=require(_0x4d84('0x3'));var rs=require(_0x4d84('0x4'));var fs=require('fs');var Redis=require(_0x4d84('0x5'));var db=require(_0x4d84('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d84('0x7'))(_0x4d84('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4d84('0x9')][_0x4d84('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6721de,_0x56732b,_0x3746ba){return new BPromise(function(_0x52f826,_0x5727e2){return client['request'](_0x6721de,_0x3746ba)[_0x4d84('0xb')](function(_0x58ed80){logger[_0x4d84('0xc')](_0x4d84('0xd'),_0x56732b,_0x4d84('0xe'));logger[_0x4d84('0xf')](_0x4d84('0x10'),_0x56732b,_0x4d84('0xe'),JSON[_0x4d84('0x11')](_0x58ed80));if(_0x58ed80[_0x4d84('0x12')]){if(_0x58ed80[_0x4d84('0x12')]['code']===0x1f4){logger[_0x4d84('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x56732b,_0x58ed80['error']['message']);return _0x5727e2(_0x58ed80['error'][_0x4d84('0x13')]);}logger[_0x4d84('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x56732b,_0x58ed80[_0x4d84('0x12')][_0x4d84('0x13')]);return _0x52f826(_0x58ed80[_0x4d84('0x12')]['message']);}else{logger[_0x4d84('0xc')](_0x4d84('0xd'),_0x56732b,_0x4d84('0xe'));_0x52f826(_0x58ed80[_0x4d84('0x14')][_0x4d84('0x13')]);}})[_0x4d84('0x15')](function(_0x59b4ae){logger[_0x4d84('0x12')](_0x4d84('0xd'),_0x56732b,_0x59b4ae);_0x5727e2(_0x59b4ae);});});}exports[_0x4d84('0x16')]=function(_0x3470b6){var _0xebe3e1=this;return new Promise(function(_0x42eb46,_0x293eaf){return db[_0x4d84('0x17')]['findAll']({'raw':_0x3470b6['options']?_0x3470b6['options']['raw']===undefined?!![]:![]:!![],'where':_0x3470b6[_0x4d84('0x18')]?_0x3470b6[_0x4d84('0x18')][_0x4d84('0x19')]||null:null,'attributes':_0x3470b6['options']?_0x3470b6[_0x4d84('0x18')][_0x4d84('0x1a')]||null:null,'limit':_0x3470b6[_0x4d84('0x18')]?_0x3470b6[_0x4d84('0x18')][_0x4d84('0x1b')]||null:null,'include':_0x3470b6[_0x4d84('0x18')]?_0x3470b6[_0x4d84('0x18')][_0x4d84('0x1c')]?_[_0x4d84('0x1d')](_0x3470b6['options']['include'],function(_0x470a2e){return{'model':db[_0x470a2e[_0x4d84('0x1e')]],'as':_0x470a2e['as'],'attributes':_0x470a2e[_0x4d84('0x1a')],'include':_0x470a2e['include']?_['map'](_0x470a2e[_0x4d84('0x1c')],function(_0x3ede1a){return{'model':db[_0x3ede1a['model']],'as':_0x3ede1a['as'],'attributes':_0x3ede1a[_0x4d84('0x1a')],'include':_0x3ede1a[_0x4d84('0x1c')]?_[_0x4d84('0x1d')](_0x3ede1a[_0x4d84('0x1c')],function(_0x398984){return{'model':db[_0x398984[_0x4d84('0x1e')]],'as':_0x398984['as'],'attributes':_0x398984[_0x4d84('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4d84('0xb')](function(_0x3d99ef){logger[_0x4d84('0xc')](_0x4d84('0x16'),_0x3470b6);logger[_0x4d84('0xf')](_0x4d84('0x16'),_0x3470b6,JSON[_0x4d84('0x11')](_0x3d99ef));_0x42eb46(_0x3d99ef);})[_0x4d84('0x15')](function(_0x153011){logger[_0x4d84('0x12')](_0x4d84('0x16'),_0x153011[_0x4d84('0x13')],_0x3470b6);_0x293eaf(_0xebe3e1[_0x4d84('0x12')](0x1f4,_0x153011[_0x4d84('0x13')]));});});};exports[_0x4d84('0x1f')]=function(_0x397d8c){var _0x2fda7b=this;return new Promise(function(_0x1c713d,_0x30c6e5){return db['FreshdeskAccount'][_0x4d84('0x20')]({'raw':_0x397d8c[_0x4d84('0x18')]?_0x397d8c[_0x4d84('0x18')][_0x4d84('0x21')]===undefined?!![]:![]:!![],'where':_0x397d8c[_0x4d84('0x18')]?_0x397d8c[_0x4d84('0x18')]['where']||null:null,'attributes':_0x397d8c[_0x4d84('0x18')]?_0x397d8c[_0x4d84('0x18')]['attributes']||null:null,'include':_0x397d8c[_0x4d84('0x18')]?_0x397d8c[_0x4d84('0x18')]['include']?_['map'](_0x397d8c[_0x4d84('0x18')][_0x4d84('0x1c')],function(_0x31e784){return{'model':db[_0x31e784[_0x4d84('0x1e')]],'as':_0x31e784['as'],'attributes':_0x31e784[_0x4d84('0x1a')],'include':_0x31e784[_0x4d84('0x1c')]?_[_0x4d84('0x1d')](_0x31e784[_0x4d84('0x1c')],function(_0x3cd0db){return{'model':db[_0x3cd0db[_0x4d84('0x1e')]],'as':_0x3cd0db['as'],'attributes':_0x3cd0db[_0x4d84('0x1a')],'include':_0x3cd0db[_0x4d84('0x1c')]?_['map'](_0x3cd0db[_0x4d84('0x1c')],function(_0x16cc1b){return{'model':db[_0x16cc1b[_0x4d84('0x1e')]],'as':_0x16cc1b['as'],'attributes':_0x16cc1b[_0x4d84('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1db946){logger[_0x4d84('0xc')](_0x4d84('0x1f'),_0x397d8c);logger[_0x4d84('0xf')]('ShowFreshdeskAccount',_0x397d8c,JSON[_0x4d84('0x11')](_0x1db946));_0x1c713d(_0x1db946);})[_0x4d84('0x15')](function(_0x23b75f){logger[_0x4d84('0x12')](_0x4d84('0x1f'),_0x23b75f[_0x4d84('0x13')],_0x397d8c);_0x30c6e5(_0x2fda7b[_0x4d84('0x12')](0x1f4,_0x23b75f[_0x4d84('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 7512efb..b586711 100644 --- a/server/api/intFreshdeskConfiguration/index.js +++ b/server/api/intFreshdeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3fa9=['multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','getSubjects','getTags','post','create','setTags','update','destroy','exports'];(function(_0x26cf7e,_0x81f72c){var _0x3fa060=function(_0x360be9){while(--_0x360be9){_0x26cf7e['push'](_0x26cf7e['shift']());}};_0x3fa060(++_0x81f72c);}(_0x3fa9,0x1b9));var _0x93fa=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x3fa9[_0x173d7e];return _0x2220d6;};'use strict';var multer=require(_0x93fa('0x0'));var util=require('util');var path=require(_0x93fa('0x1'));var timeout=require(_0x93fa('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x93fa('0x3'));var interaction=require(_0x93fa('0x4'));var config=require(_0x93fa('0x5'));var controller=require(_0x93fa('0x6'));router[_0x93fa('0x7')]('/',auth[_0x93fa('0x8')](),controller['index']);router[_0x93fa('0x7')](_0x93fa('0x9'),auth[_0x93fa('0x8')](),controller[_0x93fa('0xa')]);router[_0x93fa('0x7')](_0x93fa('0xb'),auth[_0x93fa('0x8')](),controller[_0x93fa('0xc')]);router[_0x93fa('0x7')]('/:id/subjects',auth[_0x93fa('0x8')](),controller[_0x93fa('0xd')]);router['get']('/:id/descriptions',auth[_0x93fa('0x8')](),controller['getDescriptions']);router[_0x93fa('0x7')]('/:id/tags',auth[_0x93fa('0x8')](),controller[_0x93fa('0xe')]);router[_0x93fa('0xf')]('/',auth['isAuthenticated'](),controller[_0x93fa('0x10')]);router[_0x93fa('0xf')]('/:id/tags',auth[_0x93fa('0x8')](),controller[_0x93fa('0x11')]);router['put'](_0x93fa('0x9'),auth[_0x93fa('0x8')](),controller[_0x93fa('0x12')]);router['delete'](_0x93fa('0x9'),auth[_0x93fa('0x8')](),controller[_0x93fa('0x13')]);module[_0x93fa('0x14')]=router; \ No newline at end of file +var _0xa1d5=['/:id/fields','isAuthenticated','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','create','post','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','./intFreshdeskConfiguration.controller','get','/:id','show'];(function(_0x3b7615,_0x55d16f){var _0x3e41b0=function(_0x3ddcea){while(--_0x3ddcea){_0x3b7615['push'](_0x3b7615['shift']());}};_0x3e41b0(++_0x55d16f);}(_0xa1d5,0x1f1));var _0x5a1d=function(_0x402175,_0x46a9aa){_0x402175=_0x402175-0x0;var _0x4991a4=_0xa1d5[_0x402175];return _0x4991a4;};'use strict';var multer=require(_0x5a1d('0x0'));var util=require(_0x5a1d('0x1'));var path=require('path');var timeout=require(_0x5a1d('0x2'));var express=require('express');var router=express[_0x5a1d('0x3')]();var fs_extra=require(_0x5a1d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5a1d('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5a1d('0x6')](_0x5a1d('0x7'),auth['isAuthenticated'](),controller[_0x5a1d('0x8')]);router['get'](_0x5a1d('0x9'),auth[_0x5a1d('0xa')](),controller['getFields']);router[_0x5a1d('0x6')](_0x5a1d('0xb'),auth['isAuthenticated'](),controller[_0x5a1d('0xc')]);router[_0x5a1d('0x6')]('/:id/descriptions',auth[_0x5a1d('0xa')](),controller[_0x5a1d('0xd')]);router['get'](_0x5a1d('0xe'),auth[_0x5a1d('0xa')](),controller[_0x5a1d('0xf')]);router['post']('/',auth[_0x5a1d('0xa')](),controller[_0x5a1d('0x10')]);router[_0x5a1d('0x11')](_0x5a1d('0xe'),auth['isAuthenticated'](),controller['setTags']);router[_0x5a1d('0x12')](_0x5a1d('0x7'),auth[_0x5a1d('0xa')](),controller[_0x5a1d('0x13')]);router[_0x5a1d('0x14')](_0x5a1d('0x7'),auth[_0x5a1d('0xa')](),controller[_0x5a1d('0x15')]);module[_0x5a1d('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 21597d5..9c47c72 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0691=['sequelize','STRING'];(function(_0x12656d,_0x30c8ff){var _0x55da12=function(_0x281b3c){while(--_0x281b3c){_0x12656d['push'](_0x12656d['shift']());}};_0x55da12(++_0x30c8ff);}(_0x0691,0x100));var _0x1069=function(_0x31aecd,_0x2e0059){_0x31aecd=_0x31aecd-0x0;var _0x21e81c=_0x0691[_0x31aecd];return _0x21e81c;};'use strict';var Sequelize=require(_0x1069('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1069('0x1')]}}; \ No newline at end of file +var _0x4f7e=['sequelize','exports','STRING'];(function(_0x1d187b,_0x192b45){var _0x59b741=function(_0x4827d6){while(--_0x4827d6){_0x1d187b['push'](_0x1d187b['shift']());}};_0x59b741(++_0x192b45);}(_0x4f7e,0x1cb));var _0xe4f7=function(_0x444a59,_0x6e3113){_0x444a59=_0x444a59-0x0;var _0x46d96d=_0x4f7e[_0x444a59];return _0x46d96d;};'use strict';var Sequelize=require(_0xe4f7('0x0'));module[_0xe4f7('0x1')]={'name':{'type':Sequelize[_0xe4f7('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 9600952..c2c262f 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57fa=['create','body','getFields','FreshdeskField','options','getSubjects','findOne','hasOwnProperty','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','json','apply','reject','save','update','then','error','name','send','map','FreshdeskConfiguration','rawAttributes','fieldName','model','query','keys','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','type','includeAll','rows','show','params','intersection','fields','find','catch'];(function(_0x5a8859,_0xe41f01){var _0x56cec8=function(_0x332032){while(--_0x332032){_0x5a8859['push'](_0x5a8859['shift']());}};_0x56cec8(++_0xe41f01);}(_0x57fa,0x1a2));var _0xa57f=function(_0x4418fb,_0x363fe8){_0x4418fb=_0x4418fb-0x0;var _0x4d3afe=_0x57fa[_0x4418fb];return _0x4d3afe;};'use strict';var emlformat=require(_0xa57f('0x0'));var rimraf=require(_0xa57f('0x1'));var zipdir=require(_0xa57f('0x2'));var jsonpatch=require(_0xa57f('0x3'));var rp=require(_0xa57f('0x4'));var moment=require(_0xa57f('0x5'));var BPromise=require(_0xa57f('0x6'));var Mustache=require(_0xa57f('0x7'));var util=require(_0xa57f('0x8'));var path=require(_0xa57f('0x9'));var sox=require(_0xa57f('0xa'));var csv=require(_0xa57f('0xb'));var ejs=require(_0xa57f('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa57f('0xd'));var squel=require(_0xa57f('0xe'));var crypto=require(_0xa57f('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xa57f('0x10'));var toCsv=require(_0xa57f('0xb'));var querystring=require(_0xa57f('0x11'));var Papa=require(_0xa57f('0x12'));var Redis=require(_0xa57f('0x13'));var authService=require(_0xa57f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xa57f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa57f('0x16'))(_0xa57f('0x17'));var utils=require('../../config/utils');var config=require(_0xa57f('0x18'));var licenseUtil=require(_0xa57f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14bda8,_0xbae6d5){_0xbae6d5=_0xbae6d5||0xcc;return function(_0x2e46a3){if(_0x2e46a3){return _0x14bda8[_0xa57f('0x1a')](_0xbae6d5);}return _0x14bda8[_0xa57f('0x1b')](_0xbae6d5)[_0xa57f('0x1c')]();};}function respondWithResult(_0x995a35,_0x183208){_0x183208=_0x183208||0xc8;return function(_0x91b0f0){if(_0x91b0f0){return _0x995a35[_0xa57f('0x1b')](_0x183208)['json'](_0x91b0f0);}};}function respondWithFilteredResult(_0x2bb19e,_0x29f091){return function(_0x51b654){if(_0x51b654){var _0xc71ba8=typeof _0x29f091[_0xa57f('0x1d')]==='undefined'&&typeof _0x29f091[_0xa57f('0x1e')]===_0xa57f('0x1f');var _0x5d8c9c=_0x51b654[_0xa57f('0x20')];var _0xc129fb=_0xc71ba8?0x0:_0x29f091[_0xa57f('0x1d')];var _0x11b65d=_0xc71ba8?_0x51b654[_0xa57f('0x20')]:_0x29f091['offset']+_0x29f091['limit'];var _0x5e41ad;if(_0x11b65d>=_0x5d8c9c){_0x11b65d=_0x5d8c9c;_0x5e41ad=0xc8;}else{_0x5e41ad=0xce;}_0x2bb19e[_0xa57f('0x1b')](_0x5e41ad);return _0x2bb19e['set']('Content-Range',_0xc129fb+'-'+_0x11b65d+'/'+_0x5d8c9c)[_0xa57f('0x21')](_0x51b654);}return null;};}function patchUpdates(_0x2d48b9){return function(_0x2e326e){try{jsonpatch[_0xa57f('0x22')](_0x2e326e,_0x2d48b9,!![]);}catch(_0x4f499f){return BPromise[_0xa57f('0x23')](_0x4f499f);}return _0x2e326e[_0xa57f('0x24')]();};}function saveUpdates(_0x4593b0,_0x5517ae){return function(_0x56a192){if(_0x56a192){return _0x56a192[_0xa57f('0x25')](_0x4593b0)[_0xa57f('0x26')](function(_0x19e16e){return _0x19e16e;});}return null;};}function removeEntity(_0x11b684,_0x2a4564){return function(_0x42b7b9){if(_0x42b7b9){return _0x42b7b9['destroy']()[_0xa57f('0x26')](function(){_0x11b684[_0xa57f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25c328,_0x2f471d){return function(_0x186408){if(!_0x186408){_0x25c328[_0xa57f('0x1a')](0x194);}return _0x186408;};}function handleError(_0x33a2d7,_0x58779f){_0x58779f=_0x58779f||0x1f4;return function(_0xb4f6e9){logger[_0xa57f('0x27')](_0xb4f6e9['stack']);if(_0xb4f6e9[_0xa57f('0x28')]){delete _0xb4f6e9[_0xa57f('0x28')];}_0x33a2d7['status'](_0x58779f)[_0xa57f('0x29')](_0xb4f6e9);};}exports['index']=function(_0x1d683a,_0x45e476){var _0x1277e2={},_0x306a88={},_0x46f4a2={'count':0x0,'rows':[]};var _0x375e17=_[_0xa57f('0x2a')](db[_0xa57f('0x2b')][_0xa57f('0x2c')],function(_0x2d382e){return{'name':_0x2d382e[_0xa57f('0x2d')],'type':_0x2d382e['type']['key']};});_0x306a88[_0xa57f('0x2e')]=_[_0xa57f('0x2a')](_0x375e17,_0xa57f('0x28'));_0x306a88[_0xa57f('0x2f')]=_[_0xa57f('0x30')](_0x1d683a[_0xa57f('0x2f')]);_0x306a88['filters']=_['intersection'](_0x306a88[_0xa57f('0x2e')],_0x306a88['query']);_0x1277e2[_0xa57f('0x31')]=_['intersection'](_0x306a88[_0xa57f('0x2e')],qs['fields'](_0x1d683a[_0xa57f('0x2f')]['fields']));_0x1277e2[_0xa57f('0x31')]=_0x1277e2[_0xa57f('0x31')][_0xa57f('0x32')]?_0x1277e2[_0xa57f('0x31')]:_0x306a88[_0xa57f('0x2e')];if(!_0x1d683a['query']['hasOwnProperty'](_0xa57f('0x33'))){_0x1277e2[_0xa57f('0x1e')]=qs[_0xa57f('0x1e')](_0x1d683a[_0xa57f('0x2f')]['limit']);_0x1277e2[_0xa57f('0x1d')]=qs[_0xa57f('0x1d')](_0x1d683a['query'][_0xa57f('0x1d')]);}_0x1277e2[_0xa57f('0x34')]=qs[_0xa57f('0x35')](_0x1d683a['query']['sort']);_0x1277e2[_0xa57f('0x36')]=qs[_0xa57f('0x37')](_[_0xa57f('0x38')](_0x1d683a['query'],_0x306a88[_0xa57f('0x37')]),_0x375e17);if(_0x1d683a['query'][_0xa57f('0x39')]){_0x1277e2[_0xa57f('0x36')]=_[_0xa57f('0x3a')](_0x1277e2['where'],{'$or':_['map'](_0x375e17,function(_0x3d099){if(_0x3d099[_0xa57f('0x3b')]!=='VIRTUAL'){var _0x5aa65a={};_0x5aa65a[_0x3d099[_0xa57f('0x28')]]={'$like':'%'+_0x1d683a[_0xa57f('0x2f')][_0xa57f('0x39')]+'%'};return _0x5aa65a;}})});}_0x1277e2=_[_0xa57f('0x3a')]({},_0x1277e2,_0x1d683a['options']);var _0x2d42a2={'where':_0x1277e2[_0xa57f('0x36')]};return db['FreshdeskConfiguration'][_0xa57f('0x20')](_0x2d42a2)[_0xa57f('0x26')](function(_0xfa4727){_0x46f4a2[_0xa57f('0x20')]=_0xfa4727;if(_0x1d683a['query'][_0xa57f('0x3c')]){_0x1277e2['include']=[{'all':!![]}];}return db[_0xa57f('0x2b')]['findAll'](_0x1277e2);})[_0xa57f('0x26')](function(_0xfc0b43){_0x46f4a2[_0xa57f('0x3d')]=_0xfc0b43;return _0x46f4a2;})[_0xa57f('0x26')](respondWithFilteredResult(_0x45e476,_0x1277e2))['catch'](handleError(_0x45e476,null));};exports[_0xa57f('0x3e')]=function(_0x515ae6,_0x1761c3){var _0x5eac62={'raw':![],'where':{'id':_0x515ae6[_0xa57f('0x3f')]['id']}},_0x20bf2e={};_0x20bf2e['model']=_[_0xa57f('0x30')](db[_0xa57f('0x2b')]['rawAttributes']);_0x20bf2e['query']=_[_0xa57f('0x30')](_0x515ae6[_0xa57f('0x2f')]);_0x20bf2e[_0xa57f('0x37')]=_[_0xa57f('0x40')](_0x20bf2e['model'],_0x20bf2e[_0xa57f('0x2f')]);_0x5eac62[_0xa57f('0x31')]=_[_0xa57f('0x40')](_0x20bf2e['model'],qs[_0xa57f('0x41')](_0x515ae6[_0xa57f('0x2f')][_0xa57f('0x41')]));_0x5eac62[_0xa57f('0x31')]=_0x5eac62[_0xa57f('0x31')][_0xa57f('0x32')]?_0x5eac62[_0xa57f('0x31')]:_0x20bf2e[_0xa57f('0x2e')];if(_0x515ae6['query'][_0xa57f('0x3c')]){_0x5eac62['include']=[{'all':!![]}];}_0x5eac62=_['merge']({},_0x5eac62,_0x515ae6['options']);return db['FreshdeskConfiguration'][_0xa57f('0x42')](_0x5eac62)['then'](handleEntityNotFound(_0x1761c3,null))[_0xa57f('0x26')](respondWithResult(_0x1761c3,null))[_0xa57f('0x43')](handleError(_0x1761c3,null));};exports['create']=function(_0x2abd71,_0xfc847a){return db['FreshdeskConfiguration'][_0xa57f('0x44')](_0x2abd71[_0xa57f('0x45')],{})[_0xa57f('0x26')](respondWithResult(_0xfc847a,0xc9))['catch'](handleError(_0xfc847a,null));};exports[_0xa57f('0x25')]=function(_0x749cb1,_0x3f6915){if(_0x749cb1['body']['id']){delete _0x749cb1[_0xa57f('0x45')]['id'];}return db[_0xa57f('0x2b')][_0xa57f('0x42')]({'where':{'id':_0x749cb1[_0xa57f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3f6915,null))['then'](saveUpdates(_0x749cb1[_0xa57f('0x45')],null))['then'](respondWithResult(_0x3f6915,null))[_0xa57f('0x43')](handleError(_0x3f6915,null));};exports['destroy']=function(_0x64a891,_0x548887){return db[_0xa57f('0x2b')]['find']({'where':{'id':_0x64a891[_0xa57f('0x3f')]['id']}})[_0xa57f('0x26')](handleEntityNotFound(_0x548887,null))[_0xa57f('0x26')](removeEntity(_0x548887,null))[_0xa57f('0x43')](handleError(_0x548887,null));};exports[_0xa57f('0x46')]=function(_0x2bd5a3,_0x5b0b46,_0x4c9bbe){var _0x42e264={};var _0xfd950a={};var _0x149f64;var _0x48c5fa;return db[_0xa57f('0x2b')]['findOne']({'where':{'id':_0x2bd5a3[_0xa57f('0x3f')]['id']}})[_0xa57f('0x26')](handleEntityNotFound(_0x5b0b46,null))['then'](function(_0x3867d1){if(_0x3867d1){_0x149f64=_0x3867d1;_0xfd950a['model']=_[_0xa57f('0x30')](db[_0xa57f('0x47')][_0xa57f('0x2c')]);_0xfd950a[_0xa57f('0x2f')]=_[_0xa57f('0x30')](_0x2bd5a3[_0xa57f('0x2f')]);_0xfd950a[_0xa57f('0x37')]=_[_0xa57f('0x40')](_0xfd950a[_0xa57f('0x2e')],_0xfd950a[_0xa57f('0x2f')]);_0x42e264['attributes']=_[_0xa57f('0x40')](_0xfd950a[_0xa57f('0x2e')],qs[_0xa57f('0x41')](_0x2bd5a3[_0xa57f('0x2f')]['fields']));_0x42e264[_0xa57f('0x31')]=_0x42e264['attributes']['length']?_0x42e264[_0xa57f('0x31')]:_0xfd950a['model'];_0x42e264[_0xa57f('0x34')]=qs[_0xa57f('0x35')](_0x2bd5a3[_0xa57f('0x2f')]['sort']);_0x42e264['where']=qs[_0xa57f('0x37')](_[_0xa57f('0x38')](_0x2bd5a3[_0xa57f('0x2f')],_0xfd950a[_0xa57f('0x37')]));if(_0x2bd5a3[_0xa57f('0x2f')][_0xa57f('0x39')]){_0x42e264[_0xa57f('0x36')]=_['merge'](_0x42e264[_0xa57f('0x36')],{'$or':_[_0xa57f('0x2a')](_0x42e264[_0xa57f('0x31')],function(_0x2669dd){var _0x863365={};_0x863365[_0x2669dd]={'$like':'%'+_0x2bd5a3[_0xa57f('0x2f')][_0xa57f('0x39')]+'%'};return _0x863365;})});}_0x42e264=_[_0xa57f('0x3a')]({},_0x42e264,_0x2bd5a3[_0xa57f('0x48')]);return _0x149f64[_0xa57f('0x46')](_0x42e264);}})[_0xa57f('0x26')](function(_0x92ac3){if(_0x92ac3){_0x48c5fa=_0x92ac3[_0xa57f('0x32')];if(!_0x2bd5a3[_0xa57f('0x2f')]['hasOwnProperty'](_0xa57f('0x33'))){_0x42e264[_0xa57f('0x1e')]=qs[_0xa57f('0x1e')](_0x2bd5a3['query'][_0xa57f('0x1e')]);_0x42e264[_0xa57f('0x1d')]=qs['offset'](_0x2bd5a3[_0xa57f('0x2f')][_0xa57f('0x1d')]);}return _0x149f64[_0xa57f('0x46')](_0x42e264);}})[_0xa57f('0x26')](function(_0x18d908){if(_0x18d908){return _0x18d908?{'count':_0x48c5fa,'rows':_0x18d908}:null;}})[_0xa57f('0x26')](respondWithResult(_0x5b0b46,null))['catch'](handleError(_0x5b0b46,null));};exports[_0xa57f('0x49')]=function(_0x145ea7,_0xd3a341,_0x556472){var _0xc2a386={};var _0x24b342={};var _0x586878;var _0x48becf;return db[_0xa57f('0x2b')][_0xa57f('0x4a')]({'where':{'id':_0x145ea7[_0xa57f('0x3f')]['id']}})[_0xa57f('0x26')](handleEntityNotFound(_0xd3a341,null))[_0xa57f('0x26')](function(_0x3b0351){if(_0x3b0351){_0x586878=_0x3b0351;_0x24b342[_0xa57f('0x2e')]=_[_0xa57f('0x30')](db[_0xa57f('0x47')][_0xa57f('0x2c')]);_0x24b342[_0xa57f('0x2f')]=_[_0xa57f('0x30')](_0x145ea7[_0xa57f('0x2f')]);_0x24b342[_0xa57f('0x37')]=_[_0xa57f('0x40')](_0x24b342['model'],_0x24b342[_0xa57f('0x2f')]);_0xc2a386[_0xa57f('0x31')]=_[_0xa57f('0x40')](_0x24b342[_0xa57f('0x2e')],qs[_0xa57f('0x41')](_0x145ea7[_0xa57f('0x2f')][_0xa57f('0x41')]));_0xc2a386[_0xa57f('0x31')]=_0xc2a386[_0xa57f('0x31')][_0xa57f('0x32')]?_0xc2a386[_0xa57f('0x31')]:_0x24b342[_0xa57f('0x2e')];_0xc2a386[_0xa57f('0x34')]=qs[_0xa57f('0x35')](_0x145ea7[_0xa57f('0x2f')][_0xa57f('0x35')]);_0xc2a386[_0xa57f('0x36')]=qs[_0xa57f('0x37')](_[_0xa57f('0x38')](_0x145ea7[_0xa57f('0x2f')],_0x24b342[_0xa57f('0x37')]));if(_0x145ea7[_0xa57f('0x2f')][_0xa57f('0x39')]){_0xc2a386['where']=_['merge'](_0xc2a386[_0xa57f('0x36')],{'$or':_['map'](_0xc2a386[_0xa57f('0x31')],function(_0x29e7c5){var _0x4a1291={};_0x4a1291[_0x29e7c5]={'$like':'%'+_0x145ea7[_0xa57f('0x2f')][_0xa57f('0x39')]+'%'};return _0x4a1291;})});}_0xc2a386=_[_0xa57f('0x3a')]({},_0xc2a386,_0x145ea7['options']);return _0x586878['getSubjects'](_0xc2a386);}})[_0xa57f('0x26')](function(_0x3f6e24){if(_0x3f6e24){_0x48becf=_0x3f6e24[_0xa57f('0x32')];if(!_0x145ea7[_0xa57f('0x2f')][_0xa57f('0x4b')](_0xa57f('0x33'))){_0xc2a386[_0xa57f('0x1e')]=qs[_0xa57f('0x1e')](_0x145ea7[_0xa57f('0x2f')]['limit']);_0xc2a386[_0xa57f('0x1d')]=qs[_0xa57f('0x1d')](_0x145ea7[_0xa57f('0x2f')][_0xa57f('0x1d')]);}return _0x586878['getSubjects'](_0xc2a386);}})[_0xa57f('0x26')](function(_0x1889ce){if(_0x1889ce){return _0x1889ce?{'count':_0x48becf,'rows':_0x1889ce}:null;}})[_0xa57f('0x26')](respondWithResult(_0xd3a341,null))['catch'](handleError(_0xd3a341,null));};exports[_0xa57f('0x4c')]=function(_0x56ad49,_0x4c22df,_0x2e841f){var _0xf09d30={};var _0x145a49={};var _0x2d2d66;var _0x5f4d17;return db[_0xa57f('0x2b')][_0xa57f('0x4a')]({'where':{'id':_0x56ad49[_0xa57f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4c22df,null))[_0xa57f('0x26')](function(_0x43a93b){if(_0x43a93b){_0x2d2d66=_0x43a93b;_0x145a49[_0xa57f('0x2e')]=_[_0xa57f('0x30')](db[_0xa57f('0x47')][_0xa57f('0x2c')]);_0x145a49[_0xa57f('0x2f')]=_['keys'](_0x56ad49[_0xa57f('0x2f')]);_0x145a49[_0xa57f('0x37')]=_[_0xa57f('0x40')](_0x145a49[_0xa57f('0x2e')],_0x145a49[_0xa57f('0x2f')]);_0xf09d30[_0xa57f('0x31')]=_[_0xa57f('0x40')](_0x145a49['model'],qs[_0xa57f('0x41')](_0x56ad49[_0xa57f('0x2f')][_0xa57f('0x41')]));_0xf09d30['attributes']=_0xf09d30[_0xa57f('0x31')][_0xa57f('0x32')]?_0xf09d30[_0xa57f('0x31')]:_0x145a49['model'];_0xf09d30['order']=qs[_0xa57f('0x35')](_0x56ad49[_0xa57f('0x2f')][_0xa57f('0x35')]);_0xf09d30['where']=qs['filters'](_['pick'](_0x56ad49[_0xa57f('0x2f')],_0x145a49[_0xa57f('0x37')]));if(_0x56ad49[_0xa57f('0x2f')]['filter']){_0xf09d30['where']=_['merge'](_0xf09d30['where'],{'$or':_[_0xa57f('0x2a')](_0xf09d30['attributes'],function(_0x4e7727){var _0x2c0570={};_0x2c0570[_0x4e7727]={'$like':'%'+_0x56ad49[_0xa57f('0x2f')][_0xa57f('0x39')]+'%'};return _0x2c0570;})});}_0xf09d30=_[_0xa57f('0x3a')]({},_0xf09d30,_0x56ad49[_0xa57f('0x48')]);return _0x2d2d66['getDescriptions'](_0xf09d30);}})[_0xa57f('0x26')](function(_0x32d510){if(_0x32d510){_0x5f4d17=_0x32d510[_0xa57f('0x32')];if(!_0x56ad49[_0xa57f('0x2f')][_0xa57f('0x4b')](_0xa57f('0x33'))){_0xf09d30[_0xa57f('0x1e')]=qs['limit'](_0x56ad49['query'][_0xa57f('0x1e')]);_0xf09d30['offset']=qs[_0xa57f('0x1d')](_0x56ad49[_0xa57f('0x2f')][_0xa57f('0x1d')]);}return _0x2d2d66[_0xa57f('0x4c')](_0xf09d30);}})[_0xa57f('0x26')](function(_0x26dc73){if(_0x26dc73){return _0x26dc73?{'count':_0x5f4d17,'rows':_0x26dc73}:null;}})[_0xa57f('0x26')](respondWithResult(_0x4c22df,null))[_0xa57f('0x43')](handleError(_0x4c22df,null));};exports['getTags']=function(_0x2ac07d,_0x311364,_0x649114){var _0x21f089={};var _0x4de98c={};var _0x36408f;var _0x2199d9;return db['FreshdeskConfiguration'][_0xa57f('0x4a')]({'where':{'id':_0x2ac07d[_0xa57f('0x3f')]['id']}})[_0xa57f('0x26')](handleEntityNotFound(_0x311364,null))[_0xa57f('0x26')](function(_0x95630b){if(_0x95630b){_0x36408f=_0x95630b;_0x4de98c['model']=_[_0xa57f('0x30')](db[_0xa57f('0x4d')][_0xa57f('0x2c')]);_0x4de98c['query']=_[_0xa57f('0x30')](_0x2ac07d[_0xa57f('0x2f')]);_0x4de98c['filters']=_['intersection'](_0x4de98c[_0xa57f('0x2e')],_0x4de98c['query']);_0x21f089[_0xa57f('0x31')]=_['intersection'](_0x4de98c['model'],qs[_0xa57f('0x41')](_0x2ac07d[_0xa57f('0x2f')][_0xa57f('0x41')]));_0x21f089[_0xa57f('0x31')]=_0x21f089[_0xa57f('0x31')][_0xa57f('0x32')]?_0x21f089['attributes']:_0x4de98c[_0xa57f('0x2e')];_0x21f089[_0xa57f('0x34')]=qs[_0xa57f('0x35')](_0x2ac07d['query'][_0xa57f('0x35')]);_0x21f089['where']=qs['filters'](_[_0xa57f('0x38')](_0x2ac07d[_0xa57f('0x2f')],_0x4de98c[_0xa57f('0x37')]));if(_0x2ac07d[_0xa57f('0x2f')]['filter']){_0x21f089[_0xa57f('0x36')]=_[_0xa57f('0x3a')](_0x21f089[_0xa57f('0x36')],{'$or':_[_0xa57f('0x2a')](_0x21f089['attributes'],function(_0xc2b66c){var _0x42377b={};_0x42377b[_0xc2b66c]={'$like':'%'+_0x2ac07d[_0xa57f('0x2f')][_0xa57f('0x39')]+'%'};return _0x42377b;})});}_0x21f089=_[_0xa57f('0x3a')]({},_0x21f089,_0x2ac07d['options']);return _0x36408f['getTags'](_0x21f089);}})[_0xa57f('0x26')](function(_0x4c2f9c){if(_0x4c2f9c){_0x2199d9=_0x4c2f9c[_0xa57f('0x32')];if(!_0x2ac07d[_0xa57f('0x2f')][_0xa57f('0x4b')](_0xa57f('0x33'))){_0x21f089[_0xa57f('0x1e')]=qs['limit'](_0x2ac07d[_0xa57f('0x2f')][_0xa57f('0x1e')]);_0x21f089['offset']=qs[_0xa57f('0x1d')](_0x2ac07d[_0xa57f('0x2f')]['offset']);}return _0x36408f[_0xa57f('0x4e')](_0x21f089);}})[_0xa57f('0x26')](function(_0x4b7422){if(_0x4b7422){return _0x4b7422?{'count':_0x2199d9,'rows':_0x4b7422}:null;}})[_0xa57f('0x26')](respondWithResult(_0x311364,null))[_0xa57f('0x43')](handleError(_0x311364,null));};exports[_0xa57f('0x4f')]=function(_0xad53f8,_0x7aa504,_0x29d43f){if(_0xad53f8[_0xa57f('0x45')]['id']){delete _0xad53f8[_0xa57f('0x45')]['id'];}return db[_0xa57f('0x2b')][_0xa57f('0x4a')]({'where':{'id':_0xad53f8['params']['id']}})[_0xa57f('0x26')](handleEntityNotFound(_0x7aa504,null))[_0xa57f('0x26')](function(_0x192a4c){if(_0x192a4c){return _0x192a4c[_0xa57f('0x4f')](_0xad53f8['body'][_0xa57f('0x50')]||[]);}return null;})['then'](respondWithResult(_0x7aa504,null))[_0xa57f('0x43')](handleError(_0x7aa504,null));}; \ No newline at end of file +var _0x416b=['findOne','getDescriptions','FreshdeskField','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','show','params','options','create','catch','find','body','getFields','order','getSubjects'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x416b,0x1a6));var _0xb416=function(_0x535596,_0x15c174){_0x535596=_0x535596-0x0;var _0x5751dd=_0x416b[_0x535596];return _0x5751dd;};'use strict';var emlformat=require(_0xb416('0x0'));var rimraf=require(_0xb416('0x1'));var zipdir=require(_0xb416('0x2'));var jsonpatch=require(_0xb416('0x3'));var rp=require(_0xb416('0x4'));var moment=require(_0xb416('0x5'));var BPromise=require(_0xb416('0x6'));var Mustache=require(_0xb416('0x7'));var util=require(_0xb416('0x8'));var path=require(_0xb416('0x9'));var sox=require(_0xb416('0xa'));var csv=require(_0xb416('0xb'));var ejs=require(_0xb416('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb416('0xd'));var crypto=require(_0xb416('0xe'));var jsforce=require(_0xb416('0xf'));var deskjs=require(_0xb416('0x10'));var toCsv=require(_0xb416('0xb'));var querystring=require(_0xb416('0x11'));var Papa=require('papaparse');var Redis=require(_0xb416('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb416('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb416('0x14'))(_0xb416('0x15'));var utils=require('../../config/utils');var config=require(_0xb416('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1849cc,_0x972505){_0x972505=_0x972505||0xcc;return function(_0x26a282){if(_0x26a282){return _0x1849cc[_0xb416('0x17')](_0x972505);}return _0x1849cc[_0xb416('0x18')](_0x972505)[_0xb416('0x19')]();};}function respondWithResult(_0x3cd44d,_0x193f49){_0x193f49=_0x193f49||0xc8;return function(_0x422d3d){if(_0x422d3d){return _0x3cd44d[_0xb416('0x18')](_0x193f49)[_0xb416('0x1a')](_0x422d3d);}};}function respondWithFilteredResult(_0x44482f,_0x165acf){return function(_0x2882e6){if(_0x2882e6){var _0x5b2288=typeof _0x165acf[_0xb416('0x1b')]===_0xb416('0x1c')&&typeof _0x165acf[_0xb416('0x1d')]===_0xb416('0x1c');var _0x44a8b9=_0x2882e6[_0xb416('0x1e')];var _0x2fb512=_0x5b2288?0x0:_0x165acf[_0xb416('0x1b')];var _0x2b4dc9=_0x5b2288?_0x2882e6[_0xb416('0x1e')]:_0x165acf['offset']+_0x165acf['limit'];var _0x443164;if(_0x2b4dc9>=_0x44a8b9){_0x2b4dc9=_0x44a8b9;_0x443164=0xc8;}else{_0x443164=0xce;}_0x44482f[_0xb416('0x18')](_0x443164);return _0x44482f[_0xb416('0x1f')](_0xb416('0x20'),_0x2fb512+'-'+_0x2b4dc9+'/'+_0x44a8b9)[_0xb416('0x1a')](_0x2882e6);}return null;};}function patchUpdates(_0x357b20){return function(_0x833320){try{jsonpatch[_0xb416('0x21')](_0x833320,_0x357b20,!![]);}catch(_0x2f5587){return BPromise[_0xb416('0x22')](_0x2f5587);}return _0x833320[_0xb416('0x23')]();};}function saveUpdates(_0x1a7f6c,_0x4f7c96){return function(_0x163988){if(_0x163988){return _0x163988[_0xb416('0x24')](_0x1a7f6c)['then'](function(_0x52ffbf){return _0x52ffbf;});}return null;};}function removeEntity(_0x45e5c0,_0x92b4c6){return function(_0x9a745){if(_0x9a745){return _0x9a745[_0xb416('0x25')]()[_0xb416('0x26')](function(){_0x45e5c0[_0xb416('0x18')](0xcc)[_0xb416('0x19')]();});}};}function handleEntityNotFound(_0x3cfb7a,_0x8b06a2){return function(_0x5a3015){if(!_0x5a3015){_0x3cfb7a['sendStatus'](0x194);}return _0x5a3015;};}function handleError(_0xf9fcd2,_0xafb4f5){_0xafb4f5=_0xafb4f5||0x1f4;return function(_0x45a788){logger[_0xb416('0x27')](_0x45a788['stack']);if(_0x45a788['name']){delete _0x45a788[_0xb416('0x28')];}_0xf9fcd2['status'](_0xafb4f5)['send'](_0x45a788);};}exports[_0xb416('0x29')]=function(_0x14df6e,_0x21d8ba){var _0x25feda={},_0x4a18c6={},_0x505b9a={'count':0x0,'rows':[]};var _0xdaeb00=_['map'](db[_0xb416('0x2a')][_0xb416('0x2b')],function(_0xc86133){return{'name':_0xc86133[_0xb416('0x2c')],'type':_0xc86133[_0xb416('0x2d')][_0xb416('0x2e')]};});_0x4a18c6[_0xb416('0x2f')]=_[_0xb416('0x30')](_0xdaeb00,_0xb416('0x28'));_0x4a18c6[_0xb416('0x31')]=_[_0xb416('0x32')](_0x14df6e['query']);_0x4a18c6[_0xb416('0x33')]=_[_0xb416('0x34')](_0x4a18c6['model'],_0x4a18c6[_0xb416('0x31')]);_0x25feda[_0xb416('0x35')]=_[_0xb416('0x34')](_0x4a18c6[_0xb416('0x2f')],qs[_0xb416('0x36')](_0x14df6e[_0xb416('0x31')][_0xb416('0x36')]));_0x25feda[_0xb416('0x35')]=_0x25feda['attributes'][_0xb416('0x37')]?_0x25feda[_0xb416('0x35')]:_0x4a18c6[_0xb416('0x2f')];if(!_0x14df6e['query'][_0xb416('0x38')](_0xb416('0x39'))){_0x25feda[_0xb416('0x1d')]=qs[_0xb416('0x1d')](_0x14df6e[_0xb416('0x31')][_0xb416('0x1d')]);_0x25feda['offset']=qs[_0xb416('0x1b')](_0x14df6e['query'][_0xb416('0x1b')]);}_0x25feda['order']=qs[_0xb416('0x3a')](_0x14df6e[_0xb416('0x31')][_0xb416('0x3a')]);_0x25feda[_0xb416('0x3b')]=qs[_0xb416('0x33')](_[_0xb416('0x3c')](_0x14df6e['query'],_0x4a18c6[_0xb416('0x33')]),_0xdaeb00);if(_0x14df6e[_0xb416('0x31')][_0xb416('0x3d')]){_0x25feda[_0xb416('0x3b')]=_[_0xb416('0x3e')](_0x25feda['where'],{'$or':_[_0xb416('0x30')](_0xdaeb00,function(_0x5a95c9){if(_0x5a95c9['type']!=='VIRTUAL'){var _0x391ede={};_0x391ede[_0x5a95c9[_0xb416('0x28')]]={'$like':'%'+_0x14df6e[_0xb416('0x31')]['filter']+'%'};return _0x391ede;}})});}_0x25feda=_['merge']({},_0x25feda,_0x14df6e['options']);var _0x5b3600={'where':_0x25feda['where']};return db[_0xb416('0x2a')][_0xb416('0x1e')](_0x5b3600)[_0xb416('0x26')](function(_0x3a2352){_0x505b9a[_0xb416('0x1e')]=_0x3a2352;if(_0x14df6e[_0xb416('0x31')][_0xb416('0x3f')]){_0x25feda[_0xb416('0x40')]=[{'all':!![]}];}return db[_0xb416('0x2a')][_0xb416('0x41')](_0x25feda);})[_0xb416('0x26')](function(_0x16a201){_0x505b9a['rows']=_0x16a201;return _0x505b9a;})[_0xb416('0x26')](respondWithFilteredResult(_0x21d8ba,_0x25feda))['catch'](handleError(_0x21d8ba,null));};exports[_0xb416('0x42')]=function(_0x32fb9d,_0x52f301){var _0x24ad3f={'raw':![],'where':{'id':_0x32fb9d[_0xb416('0x43')]['id']}},_0x4a1ce2={};_0x4a1ce2[_0xb416('0x2f')]=_[_0xb416('0x32')](db[_0xb416('0x2a')]['rawAttributes']);_0x4a1ce2[_0xb416('0x31')]=_[_0xb416('0x32')](_0x32fb9d[_0xb416('0x31')]);_0x4a1ce2['filters']=_[_0xb416('0x34')](_0x4a1ce2[_0xb416('0x2f')],_0x4a1ce2[_0xb416('0x31')]);_0x24ad3f[_0xb416('0x35')]=_[_0xb416('0x34')](_0x4a1ce2[_0xb416('0x2f')],qs[_0xb416('0x36')](_0x32fb9d[_0xb416('0x31')]['fields']));_0x24ad3f[_0xb416('0x35')]=_0x24ad3f[_0xb416('0x35')]['length']?_0x24ad3f['attributes']:_0x4a1ce2[_0xb416('0x2f')];if(_0x32fb9d[_0xb416('0x31')][_0xb416('0x3f')]){_0x24ad3f['include']=[{'all':!![]}];}_0x24ad3f=_['merge']({},_0x24ad3f,_0x32fb9d[_0xb416('0x44')]);return db[_0xb416('0x2a')]['find'](_0x24ad3f)[_0xb416('0x26')](handleEntityNotFound(_0x52f301,null))[_0xb416('0x26')](respondWithResult(_0x52f301,null))['catch'](handleError(_0x52f301,null));};exports[_0xb416('0x45')]=function(_0x137eb2,_0x38ffd4){return db['FreshdeskConfiguration'][_0xb416('0x45')](_0x137eb2['body'],{})['then'](respondWithResult(_0x38ffd4,0xc9))[_0xb416('0x46')](handleError(_0x38ffd4,null));};exports[_0xb416('0x24')]=function(_0x580315,_0x13c3c8){if(_0x580315['body']['id']){delete _0x580315['body']['id'];}return db[_0xb416('0x2a')][_0xb416('0x47')]({'where':{'id':_0x580315[_0xb416('0x43')]['id']}})['then'](handleEntityNotFound(_0x13c3c8,null))[_0xb416('0x26')](saveUpdates(_0x580315[_0xb416('0x48')],null))[_0xb416('0x26')](respondWithResult(_0x13c3c8,null))[_0xb416('0x46')](handleError(_0x13c3c8,null));};exports[_0xb416('0x25')]=function(_0x594b15,_0x529842){return db[_0xb416('0x2a')][_0xb416('0x47')]({'where':{'id':_0x594b15[_0xb416('0x43')]['id']}})[_0xb416('0x26')](handleEntityNotFound(_0x529842,null))[_0xb416('0x26')](removeEntity(_0x529842,null))[_0xb416('0x46')](handleError(_0x529842,null));};exports[_0xb416('0x49')]=function(_0x4bcae3,_0x287f1e,_0x264459){var _0x581745={};var _0x2b3be9={};var _0xb7703e;var _0xf976c4;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x4bcae3[_0xb416('0x43')]['id']}})[_0xb416('0x26')](handleEntityNotFound(_0x287f1e,null))[_0xb416('0x26')](function(_0x58e246){if(_0x58e246){_0xb7703e=_0x58e246;_0x2b3be9[_0xb416('0x2f')]=_[_0xb416('0x32')](db['FreshdeskField']['rawAttributes']);_0x2b3be9[_0xb416('0x31')]=_[_0xb416('0x32')](_0x4bcae3[_0xb416('0x31')]);_0x2b3be9[_0xb416('0x33')]=_[_0xb416('0x34')](_0x2b3be9[_0xb416('0x2f')],_0x2b3be9[_0xb416('0x31')]);_0x581745[_0xb416('0x35')]=_['intersection'](_0x2b3be9[_0xb416('0x2f')],qs[_0xb416('0x36')](_0x4bcae3[_0xb416('0x31')][_0xb416('0x36')]));_0x581745['attributes']=_0x581745[_0xb416('0x35')][_0xb416('0x37')]?_0x581745[_0xb416('0x35')]:_0x2b3be9['model'];_0x581745[_0xb416('0x4a')]=qs['sort'](_0x4bcae3[_0xb416('0x31')]['sort']);_0x581745[_0xb416('0x3b')]=qs[_0xb416('0x33')](_[_0xb416('0x3c')](_0x4bcae3[_0xb416('0x31')],_0x2b3be9[_0xb416('0x33')]));if(_0x4bcae3[_0xb416('0x31')][_0xb416('0x3d')]){_0x581745[_0xb416('0x3b')]=_[_0xb416('0x3e')](_0x581745[_0xb416('0x3b')],{'$or':_[_0xb416('0x30')](_0x581745[_0xb416('0x35')],function(_0x495c90){var _0x6efc8b={};_0x6efc8b[_0x495c90]={'$like':'%'+_0x4bcae3[_0xb416('0x31')]['filter']+'%'};return _0x6efc8b;})});}_0x581745=_[_0xb416('0x3e')]({},_0x581745,_0x4bcae3['options']);return _0xb7703e[_0xb416('0x49')](_0x581745);}})['then'](function(_0x5dd4b5){if(_0x5dd4b5){_0xf976c4=_0x5dd4b5['length'];if(!_0x4bcae3[_0xb416('0x31')][_0xb416('0x38')](_0xb416('0x39'))){_0x581745[_0xb416('0x1d')]=qs['limit'](_0x4bcae3[_0xb416('0x31')][_0xb416('0x1d')]);_0x581745[_0xb416('0x1b')]=qs[_0xb416('0x1b')](_0x4bcae3['query'][_0xb416('0x1b')]);}return _0xb7703e[_0xb416('0x49')](_0x581745);}})[_0xb416('0x26')](function(_0x58b5cd){if(_0x58b5cd){return _0x58b5cd?{'count':_0xf976c4,'rows':_0x58b5cd}:null;}})[_0xb416('0x26')](respondWithResult(_0x287f1e,null))['catch'](handleError(_0x287f1e,null));};exports[_0xb416('0x4b')]=function(_0x2a252b,_0xd89182,_0x4f5f58){var _0x3e5281={};var _0x5081d0={};var _0x4180c5;var _0x252e9f;return db['FreshdeskConfiguration'][_0xb416('0x4c')]({'where':{'id':_0x2a252b[_0xb416('0x43')]['id']}})['then'](handleEntityNotFound(_0xd89182,null))['then'](function(_0x4b8ae4){if(_0x4b8ae4){_0x4180c5=_0x4b8ae4;_0x5081d0[_0xb416('0x2f')]=_[_0xb416('0x32')](db['FreshdeskField'][_0xb416('0x2b')]);_0x5081d0['query']=_['keys'](_0x2a252b[_0xb416('0x31')]);_0x5081d0[_0xb416('0x33')]=_[_0xb416('0x34')](_0x5081d0[_0xb416('0x2f')],_0x5081d0[_0xb416('0x31')]);_0x3e5281['attributes']=_[_0xb416('0x34')](_0x5081d0[_0xb416('0x2f')],qs[_0xb416('0x36')](_0x2a252b[_0xb416('0x31')][_0xb416('0x36')]));_0x3e5281[_0xb416('0x35')]=_0x3e5281[_0xb416('0x35')][_0xb416('0x37')]?_0x3e5281[_0xb416('0x35')]:_0x5081d0['model'];_0x3e5281[_0xb416('0x4a')]=qs[_0xb416('0x3a')](_0x2a252b[_0xb416('0x31')]['sort']);_0x3e5281['where']=qs[_0xb416('0x33')](_['pick'](_0x2a252b['query'],_0x5081d0['filters']));if(_0x2a252b[_0xb416('0x31')][_0xb416('0x3d')]){_0x3e5281[_0xb416('0x3b')]=_[_0xb416('0x3e')](_0x3e5281['where'],{'$or':_[_0xb416('0x30')](_0x3e5281[_0xb416('0x35')],function(_0xa6e334){var _0x1006f3={};_0x1006f3[_0xa6e334]={'$like':'%'+_0x2a252b[_0xb416('0x31')][_0xb416('0x3d')]+'%'};return _0x1006f3;})});}_0x3e5281=_['merge']({},_0x3e5281,_0x2a252b[_0xb416('0x44')]);return _0x4180c5['getSubjects'](_0x3e5281);}})[_0xb416('0x26')](function(_0x23c3c6){if(_0x23c3c6){_0x252e9f=_0x23c3c6[_0xb416('0x37')];if(!_0x2a252b[_0xb416('0x31')][_0xb416('0x38')]('nolimit')){_0x3e5281[_0xb416('0x1d')]=qs[_0xb416('0x1d')](_0x2a252b[_0xb416('0x31')]['limit']);_0x3e5281['offset']=qs['offset'](_0x2a252b['query'][_0xb416('0x1b')]);}return _0x4180c5['getSubjects'](_0x3e5281);}})[_0xb416('0x26')](function(_0x3602d1){if(_0x3602d1){return _0x3602d1?{'count':_0x252e9f,'rows':_0x3602d1}:null;}})[_0xb416('0x26')](respondWithResult(_0xd89182,null))['catch'](handleError(_0xd89182,null));};exports[_0xb416('0x4d')]=function(_0x48dc8f,_0x3eab38,_0x52e692){var _0x57b704={};var _0x248d5d={};var _0x315e87;var _0x538c90;return db[_0xb416('0x2a')][_0xb416('0x4c')]({'where':{'id':_0x48dc8f[_0xb416('0x43')]['id']}})[_0xb416('0x26')](handleEntityNotFound(_0x3eab38,null))[_0xb416('0x26')](function(_0x2fe8b4){if(_0x2fe8b4){_0x315e87=_0x2fe8b4;_0x248d5d[_0xb416('0x2f')]=_[_0xb416('0x32')](db[_0xb416('0x4e')][_0xb416('0x2b')]);_0x248d5d[_0xb416('0x31')]=_[_0xb416('0x32')](_0x48dc8f[_0xb416('0x31')]);_0x248d5d[_0xb416('0x33')]=_[_0xb416('0x34')](_0x248d5d[_0xb416('0x2f')],_0x248d5d['query']);_0x57b704['attributes']=_[_0xb416('0x34')](_0x248d5d['model'],qs[_0xb416('0x36')](_0x48dc8f[_0xb416('0x31')][_0xb416('0x36')]));_0x57b704[_0xb416('0x35')]=_0x57b704[_0xb416('0x35')][_0xb416('0x37')]?_0x57b704[_0xb416('0x35')]:_0x248d5d[_0xb416('0x2f')];_0x57b704['order']=qs[_0xb416('0x3a')](_0x48dc8f['query'][_0xb416('0x3a')]);_0x57b704[_0xb416('0x3b')]=qs[_0xb416('0x33')](_[_0xb416('0x3c')](_0x48dc8f[_0xb416('0x31')],_0x248d5d[_0xb416('0x33')]));if(_0x48dc8f[_0xb416('0x31')]['filter']){_0x57b704[_0xb416('0x3b')]=_[_0xb416('0x3e')](_0x57b704[_0xb416('0x3b')],{'$or':_[_0xb416('0x30')](_0x57b704[_0xb416('0x35')],function(_0x2986db){var _0x25d4bd={};_0x25d4bd[_0x2986db]={'$like':'%'+_0x48dc8f['query'][_0xb416('0x3d')]+'%'};return _0x25d4bd;})});}_0x57b704=_[_0xb416('0x3e')]({},_0x57b704,_0x48dc8f[_0xb416('0x44')]);return _0x315e87[_0xb416('0x4d')](_0x57b704);}})[_0xb416('0x26')](function(_0x3fee07){if(_0x3fee07){_0x538c90=_0x3fee07[_0xb416('0x37')];if(!_0x48dc8f[_0xb416('0x31')][_0xb416('0x38')]('nolimit')){_0x57b704[_0xb416('0x1d')]=qs['limit'](_0x48dc8f[_0xb416('0x31')][_0xb416('0x1d')]);_0x57b704['offset']=qs['offset'](_0x48dc8f['query'][_0xb416('0x1b')]);}return _0x315e87[_0xb416('0x4d')](_0x57b704);}})[_0xb416('0x26')](function(_0x4911d3){if(_0x4911d3){return _0x4911d3?{'count':_0x538c90,'rows':_0x4911d3}:null;}})[_0xb416('0x26')](respondWithResult(_0x3eab38,null))[_0xb416('0x46')](handleError(_0x3eab38,null));};exports[_0xb416('0x4f')]=function(_0x3dae8a,_0xde56d,_0x4f6ed5){var _0x5307fe={};var _0x4f4928={};var _0x51c669;var _0x141ba1;return db[_0xb416('0x2a')][_0xb416('0x4c')]({'where':{'id':_0x3dae8a[_0xb416('0x43')]['id']}})[_0xb416('0x26')](handleEntityNotFound(_0xde56d,null))[_0xb416('0x26')](function(_0x43536c){if(_0x43536c){_0x51c669=_0x43536c;_0x4f4928['model']=_['keys'](db[_0xb416('0x50')][_0xb416('0x2b')]);_0x4f4928['query']=_[_0xb416('0x32')](_0x3dae8a[_0xb416('0x31')]);_0x4f4928[_0xb416('0x33')]=_[_0xb416('0x34')](_0x4f4928[_0xb416('0x2f')],_0x4f4928['query']);_0x5307fe[_0xb416('0x35')]=_[_0xb416('0x34')](_0x4f4928[_0xb416('0x2f')],qs[_0xb416('0x36')](_0x3dae8a[_0xb416('0x31')][_0xb416('0x36')]));_0x5307fe['attributes']=_0x5307fe[_0xb416('0x35')][_0xb416('0x37')]?_0x5307fe[_0xb416('0x35')]:_0x4f4928[_0xb416('0x2f')];_0x5307fe[_0xb416('0x4a')]=qs[_0xb416('0x3a')](_0x3dae8a[_0xb416('0x31')][_0xb416('0x3a')]);_0x5307fe[_0xb416('0x3b')]=qs['filters'](_[_0xb416('0x3c')](_0x3dae8a[_0xb416('0x31')],_0x4f4928[_0xb416('0x33')]));if(_0x3dae8a[_0xb416('0x31')]['filter']){_0x5307fe[_0xb416('0x3b')]=_['merge'](_0x5307fe[_0xb416('0x3b')],{'$or':_['map'](_0x5307fe[_0xb416('0x35')],function(_0x14e557){var _0x394925={};_0x394925[_0x14e557]={'$like':'%'+_0x3dae8a[_0xb416('0x31')][_0xb416('0x3d')]+'%'};return _0x394925;})});}_0x5307fe=_[_0xb416('0x3e')]({},_0x5307fe,_0x3dae8a[_0xb416('0x44')]);return _0x51c669[_0xb416('0x4f')](_0x5307fe);}})[_0xb416('0x26')](function(_0x556c3e){if(_0x556c3e){_0x141ba1=_0x556c3e[_0xb416('0x37')];if(!_0x3dae8a[_0xb416('0x31')][_0xb416('0x38')](_0xb416('0x39'))){_0x5307fe[_0xb416('0x1d')]=qs[_0xb416('0x1d')](_0x3dae8a[_0xb416('0x31')][_0xb416('0x1d')]);_0x5307fe[_0xb416('0x1b')]=qs[_0xb416('0x1b')](_0x3dae8a[_0xb416('0x31')]['offset']);}return _0x51c669['getTags'](_0x5307fe);}})[_0xb416('0x26')](function(_0x159ea8){if(_0x159ea8){return _0x159ea8?{'count':_0x141ba1,'rows':_0x159ea8}:null;}})[_0xb416('0x26')](respondWithResult(_0xde56d,null))[_0xb416('0x46')](handleError(_0xde56d,null));};exports[_0xb416('0x51')]=function(_0x4dd9b1,_0x2089d4,_0x80037e){if(_0x4dd9b1[_0xb416('0x48')]['id']){delete _0x4dd9b1['body']['id'];}return db[_0xb416('0x2a')]['findOne']({'where':{'id':_0x4dd9b1[_0xb416('0x43')]['id']}})[_0xb416('0x26')](handleEntityNotFound(_0x2089d4,null))[_0xb416('0x26')](function(_0xaaf597){if(_0xaaf597){return _0xaaf597['setTags'](_0x4dd9b1['body'][_0xb416('0x52')]||[]);}return null;})[_0xb416('0x26')](respondWithResult(_0x2089d4,null))['catch'](handleError(_0x2089d4,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 2c2a11f..2dd63c9 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc5a5=['request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4450b1,_0x214ace){var _0x399b0b=function(_0x2197df){while(--_0x2197df){_0x4450b1['push'](_0x4450b1['shift']());}};_0x399b0b(++_0x214ace);}(_0xc5a5,0xe5));var _0x5c5a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc5a5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5c5a('0x0'));var util=require('util');var logger=require(_0x5c5a('0x1'))(_0x5c5a('0x2'));var moment=require(_0x5c5a('0x3'));var BPromise=require(_0x5c5a('0x4'));var rp=require(_0x5c5a('0x5'));var fs=require('fs');var path=require(_0x5c5a('0x6'));var rimraf=require(_0x5c5a('0x7'));var config=require(_0x5c5a('0x8'));var attributes=require(_0x5c5a('0x9'));module[_0x5c5a('0xa')]=function(_0x2c86e5,_0x3c645c){return _0x2c86e5[_0x5c5a('0xb')]('FreshdeskConfiguration',attributes,{'tableName':_0x5c5a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16e2=['exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x2af0d0,_0x46efb2){var _0x588891=function(_0x452b66){while(--_0x452b66){_0x2af0d0['push'](_0x2af0d0['shift']());}};_0x588891(++_0x46efb2);}(_0x16e2,0xdc));var _0x216e=function(_0x25d08f,_0x14feca){_0x25d08f=_0x25d08f-0x0;var _0x39684d=_0x16e2[_0x25d08f];return _0x39684d;};'use strict';var _=require(_0x216e('0x0'));var util=require(_0x216e('0x1'));var logger=require(_0x216e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x216e('0x3'));var rp=require(_0x216e('0x4'));var fs=require('fs');var path=require(_0x216e('0x5'));var rimraf=require('rimraf');var config=require(_0x216e('0x6'));var attributes=require(_0x216e('0x7'));module[_0x216e('0x8')]=function(_0x25df8d,_0xa1484b){return _0x25df8d[_0x216e('0x9')](_0x216e('0xa'),attributes,{'tableName':_0x216e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index a892eea..6a5bc7d 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca08=['../../config/utils','../../config/logger','jayson/promise','client','then','info','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xdad237,_0x361a1d){var _0x15c575=function(_0x8db2f6){while(--_0x8db2f6){_0xdad237['push'](_0xdad237['shift']());}};_0x15c575(++_0x361a1d);}(_0xca08,0xbf));var _0x8ca0=function(_0x515801,_0x42f55c){_0x515801=_0x515801-0x0;var _0x193e64=_0xca08[_0x515801];return _0x193e64;};'use strict';var _=require(_0x8ca0('0x0'));var util=require(_0x8ca0('0x1'));var moment=require(_0x8ca0('0x2'));var BPromise=require(_0x8ca0('0x3'));var rs=require(_0x8ca0('0x4'));var fs=require('fs');var Redis=require(_0x8ca0('0x5'));var db=require(_0x8ca0('0x6'))['db'];var utils=require(_0x8ca0('0x7'));var logger=require(_0x8ca0('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8ca0('0x9'));var client=jayson[_0x8ca0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a865d,_0x35b124,_0x11cb65){return new BPromise(function(_0x349450,_0x5ea7d5){return client['request'](_0x1a865d,_0x11cb65)[_0x8ca0('0xb')](function(_0x494c1f){logger[_0x8ca0('0xc')](_0x8ca0('0xd'),_0x35b124,'request\x20sent');logger['debug'](_0x8ca0('0xe'),_0x35b124,_0x8ca0('0xf'),JSON[_0x8ca0('0x10')](_0x494c1f));if(_0x494c1f[_0x8ca0('0x11')]){if(_0x494c1f[_0x8ca0('0x11')][_0x8ca0('0x12')]===0x1f4){logger['error'](_0x8ca0('0xd'),_0x35b124,_0x494c1f['error'][_0x8ca0('0x13')]);return _0x5ea7d5(_0x494c1f[_0x8ca0('0x11')][_0x8ca0('0x13')]);}logger[_0x8ca0('0x11')](_0x8ca0('0xd'),_0x35b124,_0x494c1f[_0x8ca0('0x11')][_0x8ca0('0x13')]);return _0x349450(_0x494c1f[_0x8ca0('0x11')][_0x8ca0('0x13')]);}else{logger[_0x8ca0('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x35b124,_0x8ca0('0xf'));_0x349450(_0x494c1f[_0x8ca0('0x14')][_0x8ca0('0x13')]);}})[_0x8ca0('0x15')](function(_0x57322a){logger[_0x8ca0('0x11')](_0x8ca0('0xd'),_0x35b124,_0x57322a);_0x5ea7d5(_0x57322a);});});} \ No newline at end of file +var _0xb28a=['../../config/utils','rpc','jayson/promise','client','http','request','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','../../mysqldb'];(function(_0x5f2057,_0x59e593){var _0xa0c427=function(_0x3c5fc5){while(--_0x3c5fc5){_0x5f2057['push'](_0x5f2057['shift']());}};_0xa0c427(++_0x59e593);}(_0xb28a,0xc4));var _0xab28=function(_0x29c3ae,_0x1f1183){_0x29c3ae=_0x29c3ae-0x0;var _0x4066ee=_0xb28a[_0x29c3ae];return _0x4066ee;};'use strict';var _=require('lodash');var util=require(_0xab28('0x0'));var moment=require('moment');var BPromise=require(_0xab28('0x1'));var rs=require(_0xab28('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab28('0x3'))['db'];var utils=require(_0xab28('0x4'));var logger=require('../../config/logger')(_0xab28('0x5'));var config=require('../../config/environment');var jayson=require(_0xab28('0x6'));var client=jayson[_0xab28('0x7')][_0xab28('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5dbf67,_0x1cc9d1,_0x261af8){return new BPromise(function(_0x35fd39,_0x234081){return client[_0xab28('0x9')](_0x5dbf67,_0x261af8)['then'](function(_0xf1716a){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x1cc9d1,_0xab28('0xa'));logger[_0xab28('0xb')](_0xab28('0xc'),_0x1cc9d1,_0xab28('0xa'),JSON[_0xab28('0xd')](_0xf1716a));if(_0xf1716a[_0xab28('0xe')]){if(_0xf1716a['error'][_0xab28('0xf')]===0x1f4){logger[_0xab28('0xe')](_0xab28('0x10'),_0x1cc9d1,_0xf1716a[_0xab28('0xe')][_0xab28('0x11')]);return _0x234081(_0xf1716a[_0xab28('0xe')][_0xab28('0x11')]);}logger[_0xab28('0xe')](_0xab28('0x10'),_0x1cc9d1,_0xf1716a[_0xab28('0xe')]['message']);return _0x35fd39(_0xf1716a['error']['message']);}else{logger['info'](_0xab28('0x10'),_0x1cc9d1,'request\x20sent');_0x35fd39(_0xf1716a[_0xab28('0x12')][_0xab28('0x11')]);}})[_0xab28('0x13')](function(_0x37285c){logger[_0xab28('0xe')](_0xab28('0x10'),_0x1cc9d1,_0x37285c);_0x234081(_0x37285c);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 045960f..2f11439 100644 --- a/server/api/intFreshdeskField/index.js +++ b/server/api/intFreshdeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea86=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','/:id','show','put','update','delete','destroy','multer'];(function(_0x30182f,_0x30ce41){var _0x5207db=function(_0x50a417){while(--_0x50a417){_0x30182f['push'](_0x30182f['shift']());}};_0x5207db(++_0x30ce41);}(_0xea86,0x18b));var _0x6ea8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xea86[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x6ea8('0x0'));var util=require(_0x6ea8('0x1'));var path=require('path');var timeout=require(_0x6ea8('0x2'));var express=require(_0x6ea8('0x3'));var router=express[_0x6ea8('0x4')]();var fs_extra=require(_0x6ea8('0x5'));var auth=require(_0x6ea8('0x6'));var interaction=require(_0x6ea8('0x7'));var config=require(_0x6ea8('0x8'));var controller=require(_0x6ea8('0x9'));router[_0x6ea8('0xa')]('/',auth[_0x6ea8('0xb')](),controller['index']);router[_0x6ea8('0xa')](_0x6ea8('0xc'),auth[_0x6ea8('0xb')](),controller[_0x6ea8('0xd')]);router['post']('/',auth[_0x6ea8('0xb')](),controller['create']);router[_0x6ea8('0xe')](_0x6ea8('0xc'),auth[_0x6ea8('0xb')](),controller[_0x6ea8('0xf')]);router[_0x6ea8('0x10')](_0x6ea8('0xc'),auth[_0x6ea8('0xb')](),controller[_0x6ea8('0x11')]);module['exports']=router; \ No newline at end of file +var _0x62be=['../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x54ccf9,_0x50041a){var _0x4ce26a=function(_0x3e2331){while(--_0x3e2331){_0x54ccf9['push'](_0x54ccf9['shift']());}};_0x4ce26a(++_0x50041a);}(_0x62be,0x10a));var _0xe62b=function(_0x42e478,_0x46b112){_0x42e478=_0x42e478-0x0;var _0x36a5d9=_0x62be[_0x42e478];return _0x36a5d9;};'use strict';var multer=require(_0xe62b('0x0'));var util=require('util');var path=require(_0xe62b('0x1'));var timeout=require(_0xe62b('0x2'));var express=require(_0xe62b('0x3'));var router=express[_0xe62b('0x4')]();var fs_extra=require(_0xe62b('0x5'));var auth=require(_0xe62b('0x6'));var interaction=require(_0xe62b('0x7'));var config=require(_0xe62b('0x8'));var controller=require(_0xe62b('0x9'));router[_0xe62b('0xa')]('/',auth[_0xe62b('0xb')](),controller['index']);router[_0xe62b('0xa')](_0xe62b('0xc'),auth[_0xe62b('0xb')](),controller[_0xe62b('0xd')]);router[_0xe62b('0xe')]('/',auth[_0xe62b('0xb')](),controller[_0xe62b('0xf')]);router[_0xe62b('0x10')](_0xe62b('0xc'),auth['isAuthenticated'](),controller[_0xe62b('0x11')]);router[_0xe62b('0x12')](_0xe62b('0xc'),auth[_0xe62b('0xb')](),controller[_0xe62b('0x13')]);module[_0xe62b('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index a7db74e..acb9ebf 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.attributes.js +++ b/server/api/intFreshdeskField/intFreshdeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3c3=['picklist','STRING','ENUM','BOOLEAN','sequelize','string','variable','customVariable','keyValue'];(function(_0x6549aa,_0x5c9d0e){var _0xdf8cb2=function(_0x1d88b0){while(--_0x1d88b0){_0x6549aa['push'](_0x6549aa['shift']());}};_0xdf8cb2(++_0x5c9d0e);}(_0xc3c3,0x79));var _0x3c3c=function(_0x3f98c6,_0x2224f0){_0x3f98c6=_0x3f98c6-0x0;var _0x29dd42=_0xc3c3[_0x3f98c6];return _0x29dd42;};'use strict';var Sequelize=require(_0x3c3c('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x3c3c('0x1'),_0x3c3c('0x2'),_0x3c3c('0x3'),_0x3c3c('0x4'),_0x3c3c('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3c3c('0x6')]},'key':{'type':Sequelize[_0x3c3c('0x6')]},'keyType':{'type':Sequelize[_0x3c3c('0x7')](_0x3c3c('0x1'),_0x3c3c('0x2'),_0x3c3c('0x3'))},'keyContent':{'type':Sequelize[_0x3c3c('0x6')]},'idField':{'type':Sequelize[_0x3c3c('0x6')]},'nameField':{'type':Sequelize[_0x3c3c('0x6')]},'customField':{'type':Sequelize[_0x3c3c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3c3c('0x6')]}}; \ No newline at end of file +var _0xfc37=['picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x330733,_0x7ebb70){var _0x466dd4=function(_0x416d08){while(--_0x416d08){_0x330733['push'](_0x330733['shift']());}};_0x466dd4(++_0x7ebb70);}(_0xfc37,0x17d));var _0x7fc3=function(_0x10fd02,_0x4215ca){_0x10fd02=_0x10fd02-0x0;var _0x42ccce=_0xfc37[_0x10fd02];return _0x42ccce;};'use strict';var Sequelize=require('sequelize');module[_0x7fc3('0x0')]={'type':{'type':Sequelize[_0x7fc3('0x1')](_0x7fc3('0x2'),_0x7fc3('0x3'),_0x7fc3('0x4'),_0x7fc3('0x5'),_0x7fc3('0x6')),'defaultValue':_0x7fc3('0x2')},'content':{'type':Sequelize[_0x7fc3('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7fc3('0x1')](_0x7fc3('0x2'),_0x7fc3('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x7fc3('0x7')]},'idField':{'type':Sequelize[_0x7fc3('0x7')]},'nameField':{'type':Sequelize[_0x7fc3('0x7')]},'customField':{'type':Sequelize[_0x7fc3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 8e50ec2..f5bcb54 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.controller.js +++ b/server/api/intFreshdeskField/intFreshdeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb74=['crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','FreshdeskField','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash'];(function(_0x5cd7f0,_0x5ef56f){var _0x3c8e34=function(_0x331c48){while(--_0x331c48){_0x5cd7f0['push'](_0x5cd7f0['shift']());}};_0x3c8e34(++_0x5ef56f);}(_0xeb74,0xe3));var _0x4eb7=function(_0x1cd75b,_0x56c944){_0x1cd75b=_0x1cd75b-0x0;var _0x43c086=_0xeb74[_0x1cd75b];return _0x43c086;};'use strict';var emlformat=require(_0x4eb7('0x0'));var rimraf=require(_0x4eb7('0x1'));var zipdir=require(_0x4eb7('0x2'));var jsonpatch=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var moment=require(_0x4eb7('0x5'));var BPromise=require(_0x4eb7('0x6'));var Mustache=require('mustache');var util=require(_0x4eb7('0x7'));var path=require(_0x4eb7('0x8'));var sox=require(_0x4eb7('0x9'));var csv=require(_0x4eb7('0xa'));var ejs=require(_0x4eb7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb7('0x12'));var hardwareService=require(_0x4eb7('0x13'));var logger=require(_0x4eb7('0x14'))('api');var utils=require(_0x4eb7('0x15'));var config=require(_0x4eb7('0x16'));var licenseUtil=require(_0x4eb7('0x17'));var db=require(_0x4eb7('0x18'))['db'];function respondWithStatusCode(_0x35fa89,_0x4194e1){_0x4194e1=_0x4194e1||0xcc;return function(_0x3c9f45){if(_0x3c9f45){return _0x35fa89['sendStatus'](_0x4194e1);}return _0x35fa89['status'](_0x4194e1)['end']();};}function respondWithResult(_0x17fb81,_0x51f09d){_0x51f09d=_0x51f09d||0xc8;return function(_0x84c68b){if(_0x84c68b){return _0x17fb81[_0x4eb7('0x19')](_0x51f09d)[_0x4eb7('0x1a')](_0x84c68b);}};}function respondWithFilteredResult(_0x1c4a97,_0x5d6d5){return function(_0x21433d){if(_0x21433d){var _0x11674f=typeof _0x5d6d5[_0x4eb7('0x1b')]===_0x4eb7('0x1c')&&typeof _0x5d6d5[_0x4eb7('0x1d')]==='undefined';var _0xb86bc9=_0x21433d[_0x4eb7('0x1e')];var _0x3b6d41=_0x11674f?0x0:_0x5d6d5[_0x4eb7('0x1b')];var _0x302e16=_0x11674f?_0x21433d[_0x4eb7('0x1e')]:_0x5d6d5[_0x4eb7('0x1b')]+_0x5d6d5[_0x4eb7('0x1d')];var _0x5f4780;if(_0x302e16>=_0xb86bc9){_0x302e16=_0xb86bc9;_0x5f4780=0xc8;}else{_0x5f4780=0xce;}_0x1c4a97[_0x4eb7('0x19')](_0x5f4780);return _0x1c4a97[_0x4eb7('0x1f')](_0x4eb7('0x20'),_0x3b6d41+'-'+_0x302e16+'/'+_0xb86bc9)[_0x4eb7('0x1a')](_0x21433d);}return null;};}function patchUpdates(_0x32f0f5){return function(_0x2efd67){try{jsonpatch[_0x4eb7('0x21')](_0x2efd67,_0x32f0f5,!![]);}catch(_0x4ddbe4){return BPromise[_0x4eb7('0x22')](_0x4ddbe4);}return _0x2efd67[_0x4eb7('0x23')]();};}function saveUpdates(_0x4783b1,_0x164515){return function(_0x14a7be){if(_0x14a7be){return _0x14a7be[_0x4eb7('0x24')](_0x4783b1)[_0x4eb7('0x25')](function(_0x2df1b1){return _0x2df1b1;});}return null;};}function removeEntity(_0x1a2b8b,_0x13e871){return function(_0x4de2d9){if(_0x4de2d9){return _0x4de2d9[_0x4eb7('0x26')]()[_0x4eb7('0x25')](function(){_0x1a2b8b[_0x4eb7('0x19')](0xcc)[_0x4eb7('0x27')]();});}};}function handleEntityNotFound(_0x3e0da2,_0x25eb74){return function(_0x365060){if(!_0x365060){_0x3e0da2[_0x4eb7('0x28')](0x194);}return _0x365060;};}function handleError(_0x80b804,_0x248759){_0x248759=_0x248759||0x1f4;return function(_0xf83c11){logger[_0x4eb7('0x29')](_0xf83c11[_0x4eb7('0x2a')]);if(_0xf83c11[_0x4eb7('0x2b')]){delete _0xf83c11[_0x4eb7('0x2b')];}_0x80b804[_0x4eb7('0x19')](_0x248759)[_0x4eb7('0x2c')](_0xf83c11);};}exports[_0x4eb7('0x2d')]=function(_0x33a2c1,_0x28fda8){var _0x114c68={},_0x17030a={},_0x3ed224={'count':0x0,'rows':[]};var _0x50209d=_[_0x4eb7('0x2e')](db['FreshdeskField'][_0x4eb7('0x2f')],function(_0x13f71a){return{'name':_0x13f71a[_0x4eb7('0x30')],'type':_0x13f71a[_0x4eb7('0x31')][_0x4eb7('0x32')]};});_0x17030a[_0x4eb7('0x33')]=_[_0x4eb7('0x2e')](_0x50209d,_0x4eb7('0x2b'));_0x17030a[_0x4eb7('0x34')]=_['keys'](_0x33a2c1[_0x4eb7('0x34')]);_0x17030a['filters']=_[_0x4eb7('0x35')](_0x17030a[_0x4eb7('0x33')],_0x17030a['query']);_0x114c68['attributes']=_[_0x4eb7('0x35')](_0x17030a[_0x4eb7('0x33')],qs[_0x4eb7('0x36')](_0x33a2c1[_0x4eb7('0x34')]['fields']));_0x114c68[_0x4eb7('0x37')]=_0x114c68[_0x4eb7('0x37')][_0x4eb7('0x38')]?_0x114c68[_0x4eb7('0x37')]:_0x17030a[_0x4eb7('0x33')];if(!_0x33a2c1['query'][_0x4eb7('0x39')](_0x4eb7('0x3a'))){_0x114c68[_0x4eb7('0x1d')]=qs['limit'](_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x1d')]);_0x114c68[_0x4eb7('0x1b')]=qs['offset'](_0x33a2c1[_0x4eb7('0x34')]['offset']);}_0x114c68[_0x4eb7('0x3b')]=qs[_0x4eb7('0x3c')](_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x3c')]);_0x114c68['where']=qs[_0x4eb7('0x3d')](_[_0x4eb7('0x3e')](_0x33a2c1[_0x4eb7('0x34')],_0x17030a[_0x4eb7('0x3d')]),_0x50209d);if(_0x33a2c1['query']['filter']){_0x114c68['where']=_[_0x4eb7('0x3f')](_0x114c68[_0x4eb7('0x40')],{'$or':_[_0x4eb7('0x2e')](_0x50209d,function(_0x20ac7b){if(_0x20ac7b[_0x4eb7('0x31')]!==_0x4eb7('0x41')){var _0x1038c1={};_0x1038c1[_0x20ac7b[_0x4eb7('0x2b')]]={'$like':'%'+_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x42')]+'%'};return _0x1038c1;}})});}_0x114c68=_['merge']({},_0x114c68,_0x33a2c1[_0x4eb7('0x43')]);var _0x38218f={'where':_0x114c68[_0x4eb7('0x40')]};return db[_0x4eb7('0x44')][_0x4eb7('0x1e')](_0x38218f)[_0x4eb7('0x25')](function(_0x704d4d){_0x3ed224[_0x4eb7('0x1e')]=_0x704d4d;if(_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x45')]){_0x114c68[_0x4eb7('0x46')]=[{'all':!![]}];}return db[_0x4eb7('0x44')][_0x4eb7('0x47')](_0x114c68);})[_0x4eb7('0x25')](function(_0x38af1f){_0x3ed224[_0x4eb7('0x48')]=_0x38af1f;return _0x3ed224;})[_0x4eb7('0x25')](respondWithFilteredResult(_0x28fda8,_0x114c68))[_0x4eb7('0x49')](handleError(_0x28fda8,null));};exports[_0x4eb7('0x4a')]=function(_0x79aec5,_0x5eff9e){var _0x2fd5c2={'raw':!![],'where':{'id':_0x79aec5[_0x4eb7('0x4b')]['id']}},_0x2df542={};_0x2df542[_0x4eb7('0x33')]=_[_0x4eb7('0x4c')](db[_0x4eb7('0x44')][_0x4eb7('0x2f')]);_0x2df542[_0x4eb7('0x34')]=_[_0x4eb7('0x4c')](_0x79aec5['query']);_0x2df542[_0x4eb7('0x3d')]=_['intersection'](_0x2df542[_0x4eb7('0x33')],_0x2df542[_0x4eb7('0x34')]);_0x2fd5c2[_0x4eb7('0x37')]=_['intersection'](_0x2df542[_0x4eb7('0x33')],qs[_0x4eb7('0x36')](_0x79aec5[_0x4eb7('0x34')][_0x4eb7('0x36')]));_0x2fd5c2['attributes']=_0x2fd5c2[_0x4eb7('0x37')]['length']?_0x2fd5c2[_0x4eb7('0x37')]:_0x2df542[_0x4eb7('0x33')];if(_0x79aec5[_0x4eb7('0x34')][_0x4eb7('0x45')]){_0x2fd5c2[_0x4eb7('0x46')]=[{'all':!![]}];}_0x2fd5c2=_['merge']({},_0x2fd5c2,_0x79aec5['options']);return db[_0x4eb7('0x44')][_0x4eb7('0x4d')](_0x2fd5c2)[_0x4eb7('0x25')](handleEntityNotFound(_0x5eff9e,null))[_0x4eb7('0x25')](respondWithResult(_0x5eff9e,null))[_0x4eb7('0x49')](handleError(_0x5eff9e,null));};exports['create']=function(_0x6086,_0x104284){return db['FreshdeskField'][_0x4eb7('0x4e')](_0x6086[_0x4eb7('0x4f')],{})['then'](respondWithResult(_0x104284,0xc9))[_0x4eb7('0x49')](handleError(_0x104284,null));};exports[_0x4eb7('0x24')]=function(_0x3c8049,_0x5774d5){if(_0x3c8049[_0x4eb7('0x4f')]['id']){delete _0x3c8049['body']['id'];}return db['FreshdeskField'][_0x4eb7('0x4d')]({'where':{'id':_0x3c8049[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x5774d5,null))[_0x4eb7('0x25')](saveUpdates(_0x3c8049[_0x4eb7('0x4f')],null))[_0x4eb7('0x25')](respondWithResult(_0x5774d5,null))[_0x4eb7('0x49')](handleError(_0x5774d5,null));};exports[_0x4eb7('0x26')]=function(_0x2913c5,_0x23c0d5){return db[_0x4eb7('0x44')][_0x4eb7('0x4d')]({'where':{'id':_0x2913c5[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x23c0d5,null))[_0x4eb7('0x25')](removeEntity(_0x23c0d5,null))[_0x4eb7('0x49')](handleError(_0x23c0d5,null));}; \ No newline at end of file +var _0x6a24=['to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskField','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x6a24,0xd1));var _0x46a2=function(_0x410c2f,_0x333e3b){_0x410c2f=_0x410c2f-0x0;var _0x132297=_0x6a24[_0x410c2f];return _0x132297;};'use strict';var emlformat=require(_0x46a2('0x0'));var rimraf=require(_0x46a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46a2('0x2'));var rp=require(_0x46a2('0x3'));var moment=require(_0x46a2('0x4'));var BPromise=require(_0x46a2('0x5'));var Mustache=require(_0x46a2('0x6'));var util=require('util');var path=require(_0x46a2('0x7'));var sox=require(_0x46a2('0x8'));var csv=require('to-csv');var ejs=require(_0x46a2('0x9'));var fs=require('fs');var fs_extra=require(_0x46a2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x46a2('0xb'));var jsforce=require(_0x46a2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x46a2('0xd'));var querystring=require('querystring');var Papa=require(_0x46a2('0xe'));var Redis=require('ioredis');var authService=require(_0x46a2('0xf'));var qs=require(_0x46a2('0x10'));var as=require(_0x46a2('0x11'));var hardwareService=require(_0x46a2('0x12'));var logger=require(_0x46a2('0x13'))(_0x46a2('0x14'));var utils=require(_0x46a2('0x15'));var config=require(_0x46a2('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x403282,_0x18e584){_0x18e584=_0x18e584||0xcc;return function(_0x5c5d10){if(_0x5c5d10){return _0x403282[_0x46a2('0x17')](_0x18e584);}return _0x403282[_0x46a2('0x18')](_0x18e584)[_0x46a2('0x19')]();};}function respondWithResult(_0x18a038,_0xddc328){_0xddc328=_0xddc328||0xc8;return function(_0x2fd383){if(_0x2fd383){return _0x18a038[_0x46a2('0x18')](_0xddc328)[_0x46a2('0x1a')](_0x2fd383);}};}function respondWithFilteredResult(_0x577591,_0x4a7e7a){return function(_0x3c81e8){if(_0x3c81e8){var _0x2deb20=typeof _0x4a7e7a['offset']===_0x46a2('0x1b')&&typeof _0x4a7e7a[_0x46a2('0x1c')]==='undefined';var _0xa2eb96=_0x3c81e8[_0x46a2('0x1d')];var _0x577f18=_0x2deb20?0x0:_0x4a7e7a[_0x46a2('0x1e')];var _0x24f75f=_0x2deb20?_0x3c81e8['count']:_0x4a7e7a[_0x46a2('0x1e')]+_0x4a7e7a[_0x46a2('0x1c')];var _0x5144c7;if(_0x24f75f>=_0xa2eb96){_0x24f75f=_0xa2eb96;_0x5144c7=0xc8;}else{_0x5144c7=0xce;}_0x577591[_0x46a2('0x18')](_0x5144c7);return _0x577591[_0x46a2('0x1f')](_0x46a2('0x20'),_0x577f18+'-'+_0x24f75f+'/'+_0xa2eb96)[_0x46a2('0x1a')](_0x3c81e8);}return null;};}function patchUpdates(_0x202294){return function(_0x2d65c2){try{jsonpatch[_0x46a2('0x21')](_0x2d65c2,_0x202294,!![]);}catch(_0x473cfb){return BPromise[_0x46a2('0x22')](_0x473cfb);}return _0x2d65c2[_0x46a2('0x23')]();};}function saveUpdates(_0x5c7586,_0xa37d90){return function(_0x504b9e){if(_0x504b9e){return _0x504b9e[_0x46a2('0x24')](_0x5c7586)[_0x46a2('0x25')](function(_0x511ff6){return _0x511ff6;});}return null;};}function removeEntity(_0x43dc69,_0x15e5bb){return function(_0x233c4e){if(_0x233c4e){return _0x233c4e[_0x46a2('0x26')]()['then'](function(){_0x43dc69[_0x46a2('0x18')](0xcc)[_0x46a2('0x19')]();});}};}function handleEntityNotFound(_0x1e48f5,_0x297158){return function(_0x74bb6a){if(!_0x74bb6a){_0x1e48f5[_0x46a2('0x17')](0x194);}return _0x74bb6a;};}function handleError(_0x3e9554,_0xfa9e13){_0xfa9e13=_0xfa9e13||0x1f4;return function(_0x218f1c){logger[_0x46a2('0x27')](_0x218f1c[_0x46a2('0x28')]);if(_0x218f1c['name']){delete _0x218f1c[_0x46a2('0x29')];}_0x3e9554[_0x46a2('0x18')](_0xfa9e13)[_0x46a2('0x2a')](_0x218f1c);};}exports[_0x46a2('0x2b')]=function(_0x435155,_0x33f42a){var _0x577fd2={},_0x185647={},_0x26856f={'count':0x0,'rows':[]};var _0x2166eb=_[_0x46a2('0x2c')](db[_0x46a2('0x2d')][_0x46a2('0x2e')],function(_0x4024be){return{'name':_0x4024be['fieldName'],'type':_0x4024be[_0x46a2('0x2f')][_0x46a2('0x30')]};});_0x185647[_0x46a2('0x31')]=_[_0x46a2('0x2c')](_0x2166eb,_0x46a2('0x29'));_0x185647[_0x46a2('0x32')]=_[_0x46a2('0x33')](_0x435155[_0x46a2('0x32')]);_0x185647[_0x46a2('0x34')]=_['intersection'](_0x185647[_0x46a2('0x31')],_0x185647[_0x46a2('0x32')]);_0x577fd2[_0x46a2('0x35')]=_[_0x46a2('0x36')](_0x185647[_0x46a2('0x31')],qs['fields'](_0x435155['query'][_0x46a2('0x37')]));_0x577fd2[_0x46a2('0x35')]=_0x577fd2[_0x46a2('0x35')][_0x46a2('0x38')]?_0x577fd2[_0x46a2('0x35')]:_0x185647[_0x46a2('0x31')];if(!_0x435155['query']['hasOwnProperty'](_0x46a2('0x39'))){_0x577fd2['limit']=qs[_0x46a2('0x1c')](_0x435155[_0x46a2('0x32')][_0x46a2('0x1c')]);_0x577fd2[_0x46a2('0x1e')]=qs['offset'](_0x435155[_0x46a2('0x32')][_0x46a2('0x1e')]);}_0x577fd2[_0x46a2('0x3a')]=qs[_0x46a2('0x3b')](_0x435155['query'][_0x46a2('0x3b')]);_0x577fd2[_0x46a2('0x3c')]=qs[_0x46a2('0x34')](_[_0x46a2('0x3d')](_0x435155['query'],_0x185647[_0x46a2('0x34')]),_0x2166eb);if(_0x435155['query'][_0x46a2('0x3e')]){_0x577fd2['where']=_[_0x46a2('0x3f')](_0x577fd2[_0x46a2('0x3c')],{'$or':_['map'](_0x2166eb,function(_0x316b3d){if(_0x316b3d['type']!=='VIRTUAL'){var _0x25aa1d={};_0x25aa1d[_0x316b3d[_0x46a2('0x29')]]={'$like':'%'+_0x435155[_0x46a2('0x32')][_0x46a2('0x3e')]+'%'};return _0x25aa1d;}})});}_0x577fd2=_[_0x46a2('0x3f')]({},_0x577fd2,_0x435155[_0x46a2('0x40')]);var _0x482ed8={'where':_0x577fd2[_0x46a2('0x3c')]};return db[_0x46a2('0x2d')][_0x46a2('0x1d')](_0x482ed8)[_0x46a2('0x25')](function(_0x23cfc9){_0x26856f[_0x46a2('0x1d')]=_0x23cfc9;if(_0x435155[_0x46a2('0x32')][_0x46a2('0x41')]){_0x577fd2[_0x46a2('0x42')]=[{'all':!![]}];}return db[_0x46a2('0x2d')]['findAll'](_0x577fd2);})[_0x46a2('0x25')](function(_0x15ec39){_0x26856f[_0x46a2('0x43')]=_0x15ec39;return _0x26856f;})[_0x46a2('0x25')](respondWithFilteredResult(_0x33f42a,_0x577fd2))['catch'](handleError(_0x33f42a,null));};exports[_0x46a2('0x44')]=function(_0x18845e,_0x153305){var _0x3869d4={'raw':!![],'where':{'id':_0x18845e['params']['id']}},_0x1fcc03={};_0x1fcc03[_0x46a2('0x31')]=_['keys'](db[_0x46a2('0x2d')][_0x46a2('0x2e')]);_0x1fcc03['query']=_[_0x46a2('0x33')](_0x18845e[_0x46a2('0x32')]);_0x1fcc03[_0x46a2('0x34')]=_[_0x46a2('0x36')](_0x1fcc03[_0x46a2('0x31')],_0x1fcc03[_0x46a2('0x32')]);_0x3869d4[_0x46a2('0x35')]=_[_0x46a2('0x36')](_0x1fcc03[_0x46a2('0x31')],qs[_0x46a2('0x37')](_0x18845e['query'][_0x46a2('0x37')]));_0x3869d4[_0x46a2('0x35')]=_0x3869d4[_0x46a2('0x35')][_0x46a2('0x38')]?_0x3869d4[_0x46a2('0x35')]:_0x1fcc03['model'];if(_0x18845e[_0x46a2('0x32')][_0x46a2('0x41')]){_0x3869d4[_0x46a2('0x42')]=[{'all':!![]}];}_0x3869d4=_[_0x46a2('0x3f')]({},_0x3869d4,_0x18845e[_0x46a2('0x40')]);return db['FreshdeskField'][_0x46a2('0x45')](_0x3869d4)['then'](handleEntityNotFound(_0x153305,null))[_0x46a2('0x25')](respondWithResult(_0x153305,null))[_0x46a2('0x46')](handleError(_0x153305,null));};exports['create']=function(_0x41b4cd,_0x3f8673){return db[_0x46a2('0x2d')][_0x46a2('0x47')](_0x41b4cd[_0x46a2('0x48')],{})[_0x46a2('0x25')](respondWithResult(_0x3f8673,0xc9))[_0x46a2('0x46')](handleError(_0x3f8673,null));};exports['update']=function(_0x369015,_0x1f8640){if(_0x369015[_0x46a2('0x48')]['id']){delete _0x369015[_0x46a2('0x48')]['id'];}return db['FreshdeskField'][_0x46a2('0x45')]({'where':{'id':_0x369015['params']['id']}})[_0x46a2('0x25')](handleEntityNotFound(_0x1f8640,null))[_0x46a2('0x25')](saveUpdates(_0x369015['body'],null))[_0x46a2('0x25')](respondWithResult(_0x1f8640,null))['catch'](handleError(_0x1f8640,null));};exports[_0x46a2('0x26')]=function(_0x76ccd3,_0x3be2a7){return db[_0x46a2('0x2d')][_0x46a2('0x45')]({'where':{'id':_0x76ccd3[_0x46a2('0x49')]['id']}})['then'](handleEntityNotFound(_0x3be2a7,null))['then'](removeEntity(_0x3be2a7,null))[_0x46a2('0x46')](handleError(_0x3be2a7,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index e0cb448..d4bddba 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.model.js +++ b/server/api/intFreshdeskField/intFreshdeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34d8=['path','rimraf','../../config/environment','./intFreshdeskField.attributes','define','int_freshdesk_fields','idField','lodash','util','../../config/logger','request-promise'];(function(_0x166d6e,_0x368ad6){var _0x5d47f7=function(_0x4a36a6){while(--_0x4a36a6){_0x166d6e['push'](_0x166d6e['shift']());}};_0x5d47f7(++_0x368ad6);}(_0x34d8,0x167));var _0x834d=function(_0x336769,_0x48670a){_0x336769=_0x336769-0x0;var _0x4bcde5=_0x34d8[_0x336769];return _0x4bcde5;};'use strict';var _=require(_0x834d('0x0'));var util=require(_0x834d('0x1'));var logger=require(_0x834d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x834d('0x3'));var fs=require('fs');var path=require(_0x834d('0x4'));var rimraf=require(_0x834d('0x5'));var config=require(_0x834d('0x6'));var attributes=require(_0x834d('0x7'));module['exports']=function(_0x1ca2d7,_0x13b441){return _0x1ca2d7[_0x834d('0x8')]('FreshdeskField',attributes,{'tableName':_0x834d('0x9'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x834d('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfb58=['util','../../config/logger','api','bluebird','path','../../config/environment','exports','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xfb58,0x143));var _0x8fb5=function(_0x293f03,_0x14b01f){_0x293f03=_0x293f03-0x0;var _0x4e8861=_0xfb58[_0x293f03];return _0x4e8861;};'use strict';var _=require(_0x8fb5('0x0'));var util=require(_0x8fb5('0x1'));var logger=require(_0x8fb5('0x2'))(_0x8fb5('0x3'));var moment=require('moment');var BPromise=require(_0x8fb5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fb5('0x5'));var rimraf=require('rimraf');var config=require(_0x8fb5('0x6'));var attributes=require('./intFreshdeskField.attributes');module[_0x8fb5('0x7')]=function(_0x5a4078,_0x5139f2){return _0x5a4078['define'](_0x8fb5('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x8fb5('0x9'),'fields':[_0x8fb5('0xa'),_0x8fb5('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 033e7c6..4c740fd 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.rpc.js +++ b/server/api/intFreshdeskField/intFreshdeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a4d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5e2751,_0x518a55){var _0x139a39=function(_0x4802db){while(--_0x4802db){_0x5e2751['push'](_0x5e2751['shift']());}};_0x139a39(++_0x518a55);}(_0x8a4d,0xb1));var _0xd8a4=function(_0x4bc4c8,_0x3139d3){_0x4bc4c8=_0x4bc4c8-0x0;var _0x3bb121=_0x8a4d[_0x4bc4c8];return _0x3bb121;};'use strict';var _=require(_0xd8a4('0x0'));var util=require(_0xd8a4('0x1'));var moment=require(_0xd8a4('0x2'));var BPromise=require('bluebird');var rs=require(_0xd8a4('0x3'));var fs=require('fs');var Redis=require(_0xd8a4('0x4'));var db=require(_0xd8a4('0x5'))['db'];var utils=require(_0xd8a4('0x6'));var logger=require(_0xd8a4('0x7'))(_0xd8a4('0x8'));var config=require(_0xd8a4('0x9'));var jayson=require(_0xd8a4('0xa'));var client=jayson[_0xd8a4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1529d8,_0x164c9b,_0x262d33){return new BPromise(function(_0x1d4388,_0x537d7c){return client[_0xd8a4('0xc')](_0x1529d8,_0x262d33)[_0xd8a4('0xd')](function(_0x4ee689){logger[_0xd8a4('0xe')](_0xd8a4('0xf'),_0x164c9b,_0xd8a4('0x10'));logger['debug'](_0xd8a4('0x11'),_0x164c9b,_0xd8a4('0x10'),JSON[_0xd8a4('0x12')](_0x4ee689));if(_0x4ee689[_0xd8a4('0x13')]){if(_0x4ee689[_0xd8a4('0x13')][_0xd8a4('0x14')]===0x1f4){logger['error'](_0xd8a4('0xf'),_0x164c9b,_0x4ee689[_0xd8a4('0x13')]['message']);return _0x537d7c(_0x4ee689[_0xd8a4('0x13')]['message']);}logger[_0xd8a4('0x13')](_0xd8a4('0xf'),_0x164c9b,_0x4ee689[_0xd8a4('0x13')][_0xd8a4('0x15')]);return _0x1d4388(_0x4ee689[_0xd8a4('0x13')][_0xd8a4('0x15')]);}else{logger[_0xd8a4('0xe')](_0xd8a4('0xf'),_0x164c9b,_0xd8a4('0x10'));_0x1d4388(_0x4ee689['result'][_0xd8a4('0x15')]);}})[_0xd8a4('0x16')](function(_0x23cea1){logger[_0xd8a4('0x13')](_0xd8a4('0xf'),_0x164c9b,_0x23cea1);_0x537d7c(_0x23cea1);});});} \ No newline at end of file +var _0x9c86=['debug','stringify','error','message','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x52b703,_0x3cdc81){var _0x46d88a=function(_0x31f3ce){while(--_0x31f3ce){_0x52b703['push'](_0x52b703['shift']());}};_0x46d88a(++_0x3cdc81);}(_0x9c86,0xe1));var _0x69c8=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9c86[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x69c8('0x0'));var BPromise=require(_0x69c8('0x1'));var rs=require(_0x69c8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69c8('0x3'))['db'];var utils=require(_0x69c8('0x4'));var logger=require(_0x69c8('0x5'))(_0x69c8('0x6'));var config=require(_0x69c8('0x7'));var jayson=require(_0x69c8('0x8'));var client=jayson['client'][_0x69c8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e9191,_0x5e5d41,_0x1fd80b){return new BPromise(function(_0x57eb45,_0x12e24d){return client[_0x69c8('0xa')](_0x2e9191,_0x1fd80b)[_0x69c8('0xb')](function(_0x27c9a8){logger[_0x69c8('0xc')](_0x69c8('0xd'),_0x5e5d41,_0x69c8('0xe'));logger[_0x69c8('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x5e5d41,_0x69c8('0xe'),JSON[_0x69c8('0x10')](_0x27c9a8));if(_0x27c9a8[_0x69c8('0x11')]){if(_0x27c9a8[_0x69c8('0x11')]['code']===0x1f4){logger['error'](_0x69c8('0xd'),_0x5e5d41,_0x27c9a8[_0x69c8('0x11')][_0x69c8('0x12')]);return _0x12e24d(_0x27c9a8[_0x69c8('0x11')][_0x69c8('0x12')]);}logger[_0x69c8('0x11')](_0x69c8('0xd'),_0x5e5d41,_0x27c9a8[_0x69c8('0x11')][_0x69c8('0x12')]);return _0x57eb45(_0x27c9a8['error'][_0x69c8('0x12')]);}else{logger[_0x69c8('0xc')](_0x69c8('0xd'),_0x5e5d41,'request\x20sent');_0x57eb45(_0x27c9a8['result']['message']);}})[_0x69c8('0x13')](function(_0x5b6582){logger['error'](_0x69c8('0xd'),_0x5e5d41,_0x5b6582);_0x12e24d(_0x5b6582);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 485d529..0c43a23 100644 --- a/server/api/intFreshsalesAccount/index.js +++ b/server/api/intFreshsalesAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb574=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','index','get','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','update','delete','destroy','multer','util'];(function(_0x16740a,_0x11a37b){var _0x38d6c3=function(_0x72a835){while(--_0x72a835){_0x16740a['push'](_0x16740a['shift']());}};_0x38d6c3(++_0x11a37b);}(_0xb574,0x106));var _0x4b57=function(_0x13f34a,_0x47c9b4){_0x13f34a=_0x13f34a-0x0;var _0x5c73de=_0xb574[_0x13f34a];return _0x5c73de;};'use strict';var multer=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var path=require('path');var timeout=require(_0x4b57('0x2'));var express=require(_0x4b57('0x3'));var router=express['Router']();var fs_extra=require(_0x4b57('0x4'));var auth=require(_0x4b57('0x5'));var interaction=require(_0x4b57('0x6'));var config=require(_0x4b57('0x7'));var controller=require(_0x4b57('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x4b57('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4b57('0xa')](_0x4b57('0xb'),auth[_0x4b57('0xc')](),controller[_0x4b57('0xd')]);router[_0x4b57('0xa')](_0x4b57('0xe'),auth[_0x4b57('0xc')](),controller[_0x4b57('0xf')]);router['post']('/',auth[_0x4b57('0xc')](),controller[_0x4b57('0x10')]);router[_0x4b57('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x4b57('0x12')]);router[_0x4b57('0x13')](_0x4b57('0x14'),auth[_0x4b57('0xc')](),controller[_0x4b57('0x15')]);router[_0x4b57('0x16')](_0x4b57('0x14'),auth[_0x4b57('0xc')](),controller[_0x4b57('0x17')]);module['exports']=router; \ No newline at end of file +var _0x9354=['addConfiguration','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x28aeb2,_0x319b38){var _0x1d33e1=function(_0x651b59){while(--_0x651b59){_0x28aeb2['push'](_0x28aeb2['shift']());}};_0x1d33e1(++_0x319b38);}(_0x9354,0x96));var _0x4935=function(_0x1265ed,_0x4b85e8){_0x1265ed=_0x1265ed-0x0;var _0x5ac459=_0x9354[_0x1265ed];return _0x5ac459;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var fs_extra=require(_0x4935('0x4'));var auth=require(_0x4935('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4935('0x6'));var controller=require(_0x4935('0x7'));router[_0x4935('0x8')]('/',auth[_0x4935('0x9')](),controller[_0x4935('0xa')]);router[_0x4935('0x8')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xc')]);router['get'](_0x4935('0xd'),auth['isAuthenticated'](),controller[_0x4935('0xe')]);router[_0x4935('0x8')](_0x4935('0xf'),auth[_0x4935('0x9')](),controller[_0x4935('0x10')]);router[_0x4935('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4935('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x4935('0x12')]);router[_0x4935('0x13')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0x14')]);router[_0x4935('0x15')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0x16')]);module[_0x4935('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index b48ee2b..b4edd41 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9582=['exports','STRING','username','remoteUri','sequelize'];(function(_0x324ec4,_0x1a4cab){var _0x6dee56=function(_0x426d41){while(--_0x426d41){_0x324ec4['push'](_0x324ec4['shift']());}};_0x6dee56(++_0x1a4cab);}(_0x9582,0x95));var _0x2958=function(_0x3d76f0,_0x56f2d3){_0x3d76f0=_0x3d76f0-0x0;var _0x128dfa=_0x9582[_0x3d76f0];return _0x128dfa;};'use strict';var Sequelize=require(_0x2958('0x0'));module[_0x2958('0x1')]={'name':{'type':Sequelize[_0x2958('0x2')]},'description':{'type':Sequelize[_0x2958('0x2')]},'username':{'type':Sequelize[_0x2958('0x2')],'unique':_0x2958('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2958('0x2')],'unique':_0x2958('0x4')},'serverUrl':{'type':Sequelize[_0x2958('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x5c3c=['remoteUri','sequelize','exports','STRING','username'];(function(_0x54f4f1,_0x2e603b){var _0x14b71f=function(_0x410ca5){while(--_0x410ca5){_0x54f4f1['push'](_0x54f4f1['shift']());}};_0x14b71f(++_0x2e603b);}(_0x5c3c,0x132));var _0xc5c3=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x5c3c[_0x50007c];return _0x5c1ec7;};'use strict';var Sequelize=require(_0xc5c3('0x0'));module[_0xc5c3('0x1')]={'name':{'type':Sequelize[_0xc5c3('0x2')]},'description':{'type':Sequelize[_0xc5c3('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xc5c3('0x3')},'apiKey':{'type':Sequelize[_0xc5c3('0x2')]},'remoteUri':{'type':Sequelize[_0xc5c3('0x2')],'unique':_0xc5c3('0x4')},'serverUrl':{'type':Sequelize[_0xc5c3('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 21d3a18..dbf0c47 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x01f1=['fields','length','hasOwnProperty','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','apiKey','remoteUri','slice','lastIndexOf','%s%s','/api/selector/owners','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','zip-dir','request-promise','moment','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','../../components/integrations/configuration','status','end','json','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','sendStatus','send','map','FreshsalesAccount','fieldName','type','key','query','keys','intersection','model','attributes'];(function(_0x549332,_0x5abfdb){var _0x324f24=function(_0x3afdf0){while(--_0x3afdf0){_0x549332['push'](_0x549332['shift']());}};_0x324f24(++_0x5abfdb);}(_0x01f1,0xf9));var _0x101f=function(_0x36909d,_0x2795f1){_0x36909d=_0x36909d-0x0;var _0x1fd29d=_0x01f1[_0x36909d];return _0x1fd29d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x101f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x101f('0x1'));var moment=require(_0x101f('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x101f('0x3'));var path=require(_0x101f('0x4'));var sox=require(_0x101f('0x5'));var csv=require(_0x101f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x101f('0x7'));var _=require(_0x101f('0x8'));var squel=require(_0x101f('0x9'));var crypto=require(_0x101f('0xa'));var jsforce=require(_0x101f('0xb'));var deskjs=require(_0x101f('0xc'));var toCsv=require(_0x101f('0x6'));var querystring=require(_0x101f('0xd'));var Papa=require(_0x101f('0xe'));var Redis=require(_0x101f('0xf'));var authService=require(_0x101f('0x10'));var qs=require(_0x101f('0x11'));var as=require(_0x101f('0x12'));var hardwareService=require(_0x101f('0x13'));var logger=require(_0x101f('0x14'))(_0x101f('0x15'));var utils=require('../../config/utils');var config=require(_0x101f('0x16'));var licenseUtil=require(_0x101f('0x17'));var db=require(_0x101f('0x18'))['db'];var integrations=require(_0x101f('0x19'));function respondWithStatusCode(_0x43bf2f,_0xda2c80){_0xda2c80=_0xda2c80||0xcc;return function(_0x323f12){if(_0x323f12){return _0x43bf2f['sendStatus'](_0xda2c80);}return _0x43bf2f[_0x101f('0x1a')](_0xda2c80)[_0x101f('0x1b')]();};}function respondWithResult(_0x22af58,_0x49efea){_0x49efea=_0x49efea||0xc8;return function(_0x5075b0){if(_0x5075b0){return _0x22af58['status'](_0x49efea)[_0x101f('0x1c')](_0x5075b0);}};}function respondWithFilteredResult(_0x26f414,_0x7cf23b){return function(_0x48c815){if(_0x48c815){var _0x45ce97=typeof _0x7cf23b['offset']==='undefined'&&typeof _0x7cf23b['limit']===_0x101f('0x1d');var _0x19582e=_0x48c815[_0x101f('0x1e')];var _0x51de3b=_0x45ce97?0x0:_0x7cf23b['offset'];var _0x1a17b5=_0x45ce97?_0x48c815['count']:_0x7cf23b[_0x101f('0x1f')]+_0x7cf23b['limit'];var _0xbef2da;if(_0x1a17b5>=_0x19582e){_0x1a17b5=_0x19582e;_0xbef2da=0xc8;}else{_0xbef2da=0xce;}_0x26f414['status'](_0xbef2da);return _0x26f414[_0x101f('0x20')](_0x101f('0x21'),_0x51de3b+'-'+_0x1a17b5+'/'+_0x19582e)['json'](_0x48c815);}return null;};}function patchUpdates(_0xc25ea6){return function(_0x30e434){try{jsonpatch['apply'](_0x30e434,_0xc25ea6,!![]);}catch(_0x3cc721){return BPromise[_0x101f('0x22')](_0x3cc721);}return _0x30e434[_0x101f('0x23')]();};}function saveUpdates(_0x9b8599,_0x481957){return function(_0x3f6902){if(_0x3f6902){return _0x3f6902[_0x101f('0x24')](_0x9b8599)[_0x101f('0x25')](function(_0x32e971){return _0x32e971;});}return null;};}function removeEntity(_0x1ce4fb,_0xef3d50){return function(_0x1f3ed0){if(_0x1f3ed0){return _0x1f3ed0[_0x101f('0x26')]()[_0x101f('0x25')](function(){_0x1ce4fb['status'](0xcc)[_0x101f('0x1b')]();});}};}function handleEntityNotFound(_0x45654c,_0x18d548){return function(_0x1685f8){if(!_0x1685f8){_0x45654c[_0x101f('0x27')](0x194);}return _0x1685f8;};}function handleError(_0x5c550f,_0x43807a){_0x43807a=_0x43807a||0x1f4;return function(_0x512caa){logger['error'](_0x512caa['stack']);if(_0x512caa['name']){delete _0x512caa['name'];}_0x5c550f[_0x101f('0x1a')](_0x43807a)[_0x101f('0x28')](_0x512caa);};}exports['index']=function(_0xde439,_0x43eb07){var _0x45c1f1={},_0x143d43={},_0x1ca7c7={'count':0x0,'rows':[]};var _0xa6baa4=_[_0x101f('0x29')](db[_0x101f('0x2a')]['rawAttributes'],function(_0x4907ce){return{'name':_0x4907ce[_0x101f('0x2b')],'type':_0x4907ce[_0x101f('0x2c')][_0x101f('0x2d')]};});_0x143d43['model']=_[_0x101f('0x29')](_0xa6baa4,'name');_0x143d43[_0x101f('0x2e')]=_[_0x101f('0x2f')](_0xde439[_0x101f('0x2e')]);_0x143d43['filters']=_[_0x101f('0x30')](_0x143d43[_0x101f('0x31')],_0x143d43['query']);_0x45c1f1[_0x101f('0x32')]=_['intersection'](_0x143d43[_0x101f('0x31')],qs['fields'](_0xde439[_0x101f('0x2e')][_0x101f('0x33')]));_0x45c1f1[_0x101f('0x32')]=_0x45c1f1['attributes'][_0x101f('0x34')]?_0x45c1f1['attributes']:_0x143d43[_0x101f('0x31')];if(!_0xde439[_0x101f('0x2e')][_0x101f('0x35')]('nolimit')){_0x45c1f1[_0x101f('0x36')]=qs[_0x101f('0x36')](_0xde439[_0x101f('0x2e')]['limit']);_0x45c1f1[_0x101f('0x1f')]=qs[_0x101f('0x1f')](_0xde439[_0x101f('0x2e')][_0x101f('0x1f')]);}_0x45c1f1[_0x101f('0x37')]=qs['sort'](_0xde439[_0x101f('0x2e')][_0x101f('0x38')]);_0x45c1f1[_0x101f('0x39')]=qs['filters'](_[_0x101f('0x3a')](_0xde439[_0x101f('0x2e')],_0x143d43[_0x101f('0x3b')]),_0xa6baa4);if(_0xde439[_0x101f('0x2e')][_0x101f('0x3c')]){_0x45c1f1['where']=_[_0x101f('0x3d')](_0x45c1f1['where'],{'$or':_[_0x101f('0x29')](_0xa6baa4,function(_0x1363ab){if(_0x1363ab[_0x101f('0x2c')]!==_0x101f('0x3e')){var _0x2a7933={};_0x2a7933[_0x1363ab[_0x101f('0x3f')]]={'$like':'%'+_0xde439['query'][_0x101f('0x3c')]+'%'};return _0x2a7933;}})});}_0x45c1f1=_[_0x101f('0x3d')]({},_0x45c1f1,_0xde439[_0x101f('0x40')]);var _0x172127={'where':_0x45c1f1[_0x101f('0x39')]};return db[_0x101f('0x2a')][_0x101f('0x1e')](_0x172127)[_0x101f('0x25')](function(_0x41cd4f){_0x1ca7c7['count']=_0x41cd4f;if(_0xde439[_0x101f('0x2e')][_0x101f('0x41')]){_0x45c1f1[_0x101f('0x42')]=[{'all':!![]}];}return db[_0x101f('0x2a')][_0x101f('0x43')](_0x45c1f1);})[_0x101f('0x25')](function(_0x52c167){_0x1ca7c7[_0x101f('0x44')]=_0x52c167;return _0x1ca7c7;})['then'](respondWithFilteredResult(_0x43eb07,_0x45c1f1))[_0x101f('0x45')](handleError(_0x43eb07,null));};exports['show']=function(_0x44c884,_0x122f40){var _0x55c08c={'raw':![],'where':{'id':_0x44c884[_0x101f('0x46')]['id']}},_0x5cc507={};_0x5cc507[_0x101f('0x31')]=_[_0x101f('0x2f')](db[_0x101f('0x2a')][_0x101f('0x47')]);_0x5cc507['query']=_[_0x101f('0x2f')](_0x44c884[_0x101f('0x2e')]);_0x5cc507[_0x101f('0x3b')]=_[_0x101f('0x30')](_0x5cc507['model'],_0x5cc507['query']);_0x55c08c[_0x101f('0x32')]=_[_0x101f('0x30')](_0x5cc507[_0x101f('0x31')],qs[_0x101f('0x33')](_0x44c884[_0x101f('0x2e')][_0x101f('0x33')]));_0x55c08c[_0x101f('0x32')]=_0x55c08c[_0x101f('0x32')][_0x101f('0x34')]?_0x55c08c[_0x101f('0x32')]:_0x5cc507['model'];if(_0x44c884[_0x101f('0x2e')][_0x101f('0x41')]){_0x55c08c[_0x101f('0x42')]=[{'all':!![]}];}_0x55c08c=_[_0x101f('0x3d')]({},_0x55c08c,_0x44c884[_0x101f('0x40')]);return db[_0x101f('0x2a')][_0x101f('0x48')](_0x55c08c)['then'](handleEntityNotFound(_0x122f40,null))['then'](respondWithResult(_0x122f40,null))[_0x101f('0x45')](handleError(_0x122f40,null));};exports[_0x101f('0x49')]=function(_0x35382f,_0x2614b9){return db[_0x101f('0x2a')][_0x101f('0x49')](_0x35382f['body'],{})['then'](respondWithResult(_0x2614b9,0xc9))[_0x101f('0x45')](handleError(_0x2614b9,null));};exports[_0x101f('0x24')]=function(_0x1b5daa,_0x3aa01c){if(_0x1b5daa[_0x101f('0x4a')]['id']){delete _0x1b5daa['body']['id'];}return db[_0x101f('0x2a')]['find']({'where':{'id':_0x1b5daa['params']['id']}})[_0x101f('0x25')](handleEntityNotFound(_0x3aa01c,null))['then'](saveUpdates(_0x1b5daa[_0x101f('0x4a')],null))[_0x101f('0x25')](respondWithResult(_0x3aa01c,null))[_0x101f('0x45')](handleError(_0x3aa01c,null));};exports['destroy']=function(_0x18bd2f,_0x76e866){return db[_0x101f('0x2a')]['find']({'where':{'id':_0x18bd2f[_0x101f('0x46')]['id']}})[_0x101f('0x25')](handleEntityNotFound(_0x76e866,null))[_0x101f('0x25')](removeEntity(_0x76e866,null))[_0x101f('0x45')](handleError(_0x76e866,null));};exports[_0x101f('0x4b')]=function(_0x4356dc,_0x1870af,_0x495bde){var _0xa4bcc8={};var _0x3cfa8={};var _0x381493;var _0x19d039;return db[_0x101f('0x2a')][_0x101f('0x4c')]({'where':{'id':_0x4356dc[_0x101f('0x46')]['id']}})[_0x101f('0x25')](handleEntityNotFound(_0x1870af,null))['then'](function(_0x13b5f6){if(_0x13b5f6){_0x381493=_0x13b5f6;_0x3cfa8['model']=_[_0x101f('0x2f')](db[_0x101f('0x4d')][_0x101f('0x47')]);_0x3cfa8['query']=_[_0x101f('0x2f')](_0x4356dc[_0x101f('0x2e')]);_0x3cfa8['filters']=_[_0x101f('0x30')](_0x3cfa8[_0x101f('0x31')],_0x3cfa8[_0x101f('0x2e')]);_0xa4bcc8[_0x101f('0x32')]=_['intersection'](_0x3cfa8[_0x101f('0x31')],qs['fields'](_0x4356dc[_0x101f('0x2e')][_0x101f('0x33')]));_0xa4bcc8[_0x101f('0x32')]=_0xa4bcc8[_0x101f('0x32')][_0x101f('0x34')]?_0xa4bcc8[_0x101f('0x32')]:_0x3cfa8['model'];_0xa4bcc8['order']=qs[_0x101f('0x38')](_0x4356dc[_0x101f('0x2e')][_0x101f('0x38')]);_0xa4bcc8[_0x101f('0x39')]=qs['filters'](_[_0x101f('0x3a')](_0x4356dc[_0x101f('0x2e')],_0x3cfa8[_0x101f('0x3b')]));if(_0x4356dc['query'][_0x101f('0x3c')]){_0xa4bcc8[_0x101f('0x39')]=_[_0x101f('0x3d')](_0xa4bcc8['where'],{'$or':_[_0x101f('0x29')](_0xa4bcc8[_0x101f('0x32')],function(_0x19198f){var _0xbb756b={};_0xbb756b[_0x19198f]={'$like':'%'+_0x4356dc[_0x101f('0x2e')][_0x101f('0x3c')]+'%'};return _0xbb756b;})});}_0xa4bcc8=_[_0x101f('0x3d')]({},_0xa4bcc8,_0x4356dc[_0x101f('0x40')]);return _0x381493[_0x101f('0x4b')](_0xa4bcc8);}})[_0x101f('0x25')](function(_0x17cd0c){if(_0x17cd0c){_0x19d039=_0x17cd0c[_0x101f('0x34')];if(!_0x4356dc[_0x101f('0x2e')][_0x101f('0x35')](_0x101f('0x4e'))){_0xa4bcc8[_0x101f('0x36')]=qs[_0x101f('0x36')](_0x4356dc[_0x101f('0x2e')][_0x101f('0x36')]);_0xa4bcc8[_0x101f('0x1f')]=qs[_0x101f('0x1f')](_0x4356dc[_0x101f('0x2e')][_0x101f('0x1f')]);}return _0x381493[_0x101f('0x4b')](_0xa4bcc8);}})[_0x101f('0x25')](function(_0x4d3994){if(_0x4d3994){return _0x4d3994?{'count':_0x19d039,'rows':_0x4d3994}:null;}})['then'](respondWithResult(_0x1870af,null))['catch'](handleError(_0x1870af,null));};exports[_0x101f('0x4f')]=function(_0xfd0628,_0x15e01f,_0x7da474){if(_0xfd0628['body']['id']){delete _0xfd0628[_0x101f('0x4a')]['id'];}return db[_0x101f('0x2a')][_0x101f('0x4c')]({'where':{'id':_0xfd0628[_0x101f('0x46')]['id']}})[_0x101f('0x25')](handleEntityNotFound(_0x15e01f,null))[_0x101f('0x25')](function(_0x2be26f){if(_0x2be26f){_0xfd0628[_0x101f('0x4a')][_0x101f('0x50')]=_0x2be26f['id'];_0xfd0628['body'][_0x101f('0x51')]=integrations[_0x101f('0x52')](_0xfd0628[_0x101f('0x4a')][_0x101f('0x53')],_0xfd0628[_0x101f('0x4a')][_0x101f('0x2c')]);_0xfd0628['body'][_0x101f('0x54')]=integrations[_0x101f('0x55')](_0xfd0628[_0x101f('0x4a')][_0x101f('0x53')],_0xfd0628['body'][_0x101f('0x2c')]);return db[_0x101f('0x4d')][_0x101f('0x49')](_0xfd0628[_0x101f('0x4a')],{'include':[{'model':db[_0x101f('0x56')],'as':_0x101f('0x51')},{'model':db[_0x101f('0x56')],'as':'Descriptions'}]});}return null;})[_0x101f('0x25')](respondWithResult(_0x15e01f,null))[_0x101f('0x45')](handleError(_0x15e01f,null));};exports[_0x101f('0x57')]=function(_0x3cbe10,_0x108340,_0x48c316){var _0x51a754='';var _0x258d23='';return db[_0x101f('0x2a')][_0x101f('0x4c')]({'where':{'id':_0x3cbe10[_0x101f('0x46')]['id']},'attributes':['id',_0x101f('0x58'),'remoteUri',_0x101f('0x59')]})['then'](handleEntityNotFound(_0x108340,null))[_0x101f('0x25')](function(_0x3164a4){if(_0x3164a4){_0x258d23=_0x3164a4[_0x101f('0x58')];_0x51a754=_0x3164a4[_0x101f('0x5a')];var _0x172315=_0x3164a4[_0x101f('0x5a')][_0x101f('0x5b')](-0x1);if(_0x172315==='/'){_0x51a754=_0x51a754['substring'](0x0,_0x51a754[_0x101f('0x5c')](_0x172315));}return rp({'method':'GET','uri':util['format'](_0x101f('0x5d'),_0x51a754,_0x101f('0x5e')),'headers':{'Authorization':'Token\x20token='+_0x3164a4[_0x101f('0x59')]},'json':!![]});}})['then'](function(_0x426604){if(_0x426604){var _0xb1a33d=_0x426604[_0x101f('0x5f')];var _0x1a7f4c=![];var _0x417301=null;for(_0x417301=0x0;_0x417301<_0xb1a33d[_0x101f('0x34')];_0x417301++){if(_0xb1a33d[_0x417301][_0x101f('0x60')]===_0x258d23){_0x1a7f4c=!![];}}if(_0x1a7f4c){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x101f('0x61')});}}})[_0x101f('0x25')](respondWithResult(_0x108340,null))[_0x101f('0x45')](function(_0x46b3d3){var _0xacf76=_0x3cbe10[_0x101f('0x2e')][_0x101f('0x62')]?0x1f4:_0x46b3d3[_0x101f('0x63')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x101f('0x57'),_0xacf76,JSON['stringify'](_0x46b3d3));delete _0x46b3d3[_0x101f('0x3f')];if(_0xacf76===0x191){_0xacf76=0x190;}_0x108340[_0x101f('0x1a')](_0xacf76)[_0x101f('0x28')](_0x3cbe10[_0x101f('0x2e')][_0x101f('0x62')]?{'message':'Wrong\x20credentials','statusCode':_0x46b3d3[_0x101f('0x63')]}:_0x46b3d3);});}; \ No newline at end of file +var _0x18aa=['stack','name','send','map','FreshsalesAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','catch','create','body','getConfigurations','findOne','FreshsalesConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','type','FreshsalesField','username','remoteUri','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','statusCode','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','../../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','end','status','json','count','offset','limit','save','update','then','destroy'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x18aa,0x16d));var _0xa18a=function(_0x5c163c,_0x55da6a){_0x5c163c=_0x5c163c-0x0;var _0x4e2d05=_0x18aa[_0x5c163c];return _0x4e2d05;};'use strict';var emlformat=require(_0xa18a('0x0'));var rimraf=require(_0xa18a('0x1'));var zipdir=require(_0xa18a('0x2'));var jsonpatch=require(_0xa18a('0x3'));var rp=require(_0xa18a('0x4'));var moment=require('moment');var BPromise=require(_0xa18a('0x5'));var Mustache=require(_0xa18a('0x6'));var util=require(_0xa18a('0x7'));var path=require(_0xa18a('0x8'));var sox=require(_0xa18a('0x9'));var csv=require('to-csv');var ejs=require(_0xa18a('0xa'));var fs=require('fs');var fs_extra=require(_0xa18a('0xb'));var _=require(_0xa18a('0xc'));var squel=require('squel');var crypto=require(_0xa18a('0xd'));var jsforce=require(_0xa18a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa18a('0xf'));var querystring=require(_0xa18a('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa18a('0x11'));var qs=require(_0xa18a('0x12'));var as=require(_0xa18a('0x13'));var hardwareService=require(_0xa18a('0x14'));var logger=require(_0xa18a('0x15'))(_0xa18a('0x16'));var utils=require(_0xa18a('0x17'));var config=require(_0xa18a('0x18'));var licenseUtil=require(_0xa18a('0x19'));var db=require(_0xa18a('0x1a'))['db'];var integrations=require(_0xa18a('0x1b'));function respondWithStatusCode(_0x5b6e1e,_0x478586){_0x478586=_0x478586||0xcc;return function(_0x272c32){if(_0x272c32){return _0x5b6e1e[_0xa18a('0x1c')](_0x478586);}return _0x5b6e1e['status'](_0x478586)[_0xa18a('0x1d')]();};}function respondWithResult(_0x166dcf,_0x4f4244){_0x4f4244=_0x4f4244||0xc8;return function(_0x5d3a1b){if(_0x5d3a1b){return _0x166dcf[_0xa18a('0x1e')](_0x4f4244)[_0xa18a('0x1f')](_0x5d3a1b);}};}function respondWithFilteredResult(_0x569f45,_0x4ce5c8){return function(_0x213860){if(_0x213860){var _0x4c082e=typeof _0x4ce5c8['offset']==='undefined'&&typeof _0x4ce5c8['limit']==='undefined';var _0x1b07db=_0x213860[_0xa18a('0x20')];var _0x19a9e8=_0x4c082e?0x0:_0x4ce5c8[_0xa18a('0x21')];var _0x528b18=_0x4c082e?_0x213860[_0xa18a('0x20')]:_0x4ce5c8[_0xa18a('0x21')]+_0x4ce5c8[_0xa18a('0x22')];var _0xea19ad;if(_0x528b18>=_0x1b07db){_0x528b18=_0x1b07db;_0xea19ad=0xc8;}else{_0xea19ad=0xce;}_0x569f45[_0xa18a('0x1e')](_0xea19ad);return _0x569f45['set']('Content-Range',_0x19a9e8+'-'+_0x528b18+'/'+_0x1b07db)[_0xa18a('0x1f')](_0x213860);}return null;};}function patchUpdates(_0x764200){return function(_0x9fe8cd){try{jsonpatch['apply'](_0x9fe8cd,_0x764200,!![]);}catch(_0x345b20){return BPromise['reject'](_0x345b20);}return _0x9fe8cd[_0xa18a('0x23')]();};}function saveUpdates(_0x5da693,_0x153c9c){return function(_0x322592){if(_0x322592){return _0x322592[_0xa18a('0x24')](_0x5da693)[_0xa18a('0x25')](function(_0x537aa2){return _0x537aa2;});}return null;};}function removeEntity(_0xfc934a,_0x365345){return function(_0x1e8b7f){if(_0x1e8b7f){return _0x1e8b7f[_0xa18a('0x26')]()[_0xa18a('0x25')](function(){_0xfc934a[_0xa18a('0x1e')](0xcc)[_0xa18a('0x1d')]();});}};}function handleEntityNotFound(_0x1e9b30,_0x21d771){return function(_0x4227c1){if(!_0x4227c1){_0x1e9b30[_0xa18a('0x1c')](0x194);}return _0x4227c1;};}function handleError(_0x195579,_0x453f29){_0x453f29=_0x453f29||0x1f4;return function(_0x1b7227){logger['error'](_0x1b7227[_0xa18a('0x27')]);if(_0x1b7227[_0xa18a('0x28')]){delete _0x1b7227[_0xa18a('0x28')];}_0x195579[_0xa18a('0x1e')](_0x453f29)[_0xa18a('0x29')](_0x1b7227);};}exports['index']=function(_0x44348d,_0x5bda57){var _0x23fe67={},_0x28ef74={},_0x14d5c6={'count':0x0,'rows':[]};var _0x5e1cd7=_[_0xa18a('0x2a')](db[_0xa18a('0x2b')][_0xa18a('0x2c')],function(_0x463144){return{'name':_0x463144[_0xa18a('0x2d')],'type':_0x463144['type'][_0xa18a('0x2e')]};});_0x28ef74[_0xa18a('0x2f')]=_[_0xa18a('0x2a')](_0x5e1cd7,_0xa18a('0x28'));_0x28ef74[_0xa18a('0x30')]=_[_0xa18a('0x31')](_0x44348d[_0xa18a('0x30')]);_0x28ef74[_0xa18a('0x32')]=_[_0xa18a('0x33')](_0x28ef74[_0xa18a('0x2f')],_0x28ef74['query']);_0x23fe67[_0xa18a('0x34')]=_[_0xa18a('0x33')](_0x28ef74[_0xa18a('0x2f')],qs[_0xa18a('0x35')](_0x44348d[_0xa18a('0x30')][_0xa18a('0x35')]));_0x23fe67[_0xa18a('0x34')]=_0x23fe67['attributes'][_0xa18a('0x36')]?_0x23fe67[_0xa18a('0x34')]:_0x28ef74['model'];if(!_0x44348d[_0xa18a('0x30')][_0xa18a('0x37')](_0xa18a('0x38'))){_0x23fe67[_0xa18a('0x22')]=qs['limit'](_0x44348d[_0xa18a('0x30')][_0xa18a('0x22')]);_0x23fe67['offset']=qs['offset'](_0x44348d['query']['offset']);}_0x23fe67[_0xa18a('0x39')]=qs[_0xa18a('0x3a')](_0x44348d['query'][_0xa18a('0x3a')]);_0x23fe67[_0xa18a('0x3b')]=qs['filters'](_[_0xa18a('0x3c')](_0x44348d[_0xa18a('0x30')],_0x28ef74[_0xa18a('0x32')]),_0x5e1cd7);if(_0x44348d['query']['filter']){_0x23fe67[_0xa18a('0x3b')]=_[_0xa18a('0x3d')](_0x23fe67[_0xa18a('0x3b')],{'$or':_[_0xa18a('0x2a')](_0x5e1cd7,function(_0x257a6f){if(_0x257a6f['type']!==_0xa18a('0x3e')){var _0x30c702={};_0x30c702[_0x257a6f[_0xa18a('0x28')]]={'$like':'%'+_0x44348d[_0xa18a('0x30')][_0xa18a('0x3f')]+'%'};return _0x30c702;}})});}_0x23fe67=_['merge']({},_0x23fe67,_0x44348d[_0xa18a('0x40')]);var _0x320a11={'where':_0x23fe67['where']};return db[_0xa18a('0x2b')]['count'](_0x320a11)[_0xa18a('0x25')](function(_0x1a6717){_0x14d5c6[_0xa18a('0x20')]=_0x1a6717;if(_0x44348d[_0xa18a('0x30')][_0xa18a('0x41')]){_0x23fe67[_0xa18a('0x42')]=[{'all':!![]}];}return db[_0xa18a('0x2b')][_0xa18a('0x43')](_0x23fe67);})[_0xa18a('0x25')](function(_0x572001){_0x14d5c6[_0xa18a('0x44')]=_0x572001;return _0x14d5c6;})[_0xa18a('0x25')](respondWithFilteredResult(_0x5bda57,_0x23fe67))['catch'](handleError(_0x5bda57,null));};exports['show']=function(_0x4de1ba,_0xc99b1d){var _0x302b07={'raw':![],'where':{'id':_0x4de1ba[_0xa18a('0x45')]['id']}},_0x41d47d={};_0x41d47d[_0xa18a('0x2f')]=_[_0xa18a('0x31')](db[_0xa18a('0x2b')]['rawAttributes']);_0x41d47d[_0xa18a('0x30')]=_[_0xa18a('0x31')](_0x4de1ba['query']);_0x41d47d[_0xa18a('0x32')]=_['intersection'](_0x41d47d[_0xa18a('0x2f')],_0x41d47d[_0xa18a('0x30')]);_0x302b07['attributes']=_['intersection'](_0x41d47d[_0xa18a('0x2f')],qs[_0xa18a('0x35')](_0x4de1ba[_0xa18a('0x30')][_0xa18a('0x35')]));_0x302b07[_0xa18a('0x34')]=_0x302b07['attributes'][_0xa18a('0x36')]?_0x302b07[_0xa18a('0x34')]:_0x41d47d[_0xa18a('0x2f')];if(_0x4de1ba[_0xa18a('0x30')]['includeAll']){_0x302b07[_0xa18a('0x42')]=[{'all':!![]}];}_0x302b07=_[_0xa18a('0x3d')]({},_0x302b07,_0x4de1ba['options']);return db[_0xa18a('0x2b')][_0xa18a('0x46')](_0x302b07)[_0xa18a('0x25')](handleEntityNotFound(_0xc99b1d,null))[_0xa18a('0x25')](respondWithResult(_0xc99b1d,null))[_0xa18a('0x47')](handleError(_0xc99b1d,null));};exports[_0xa18a('0x48')]=function(_0x1b07af,_0x319a5c){return db[_0xa18a('0x2b')][_0xa18a('0x48')](_0x1b07af[_0xa18a('0x49')],{})[_0xa18a('0x25')](respondWithResult(_0x319a5c,0xc9))[_0xa18a('0x47')](handleError(_0x319a5c,null));};exports[_0xa18a('0x24')]=function(_0x4e64bd,_0x453d53){if(_0x4e64bd[_0xa18a('0x49')]['id']){delete _0x4e64bd[_0xa18a('0x49')]['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0x4e64bd[_0xa18a('0x45')]['id']}})[_0xa18a('0x25')](handleEntityNotFound(_0x453d53,null))[_0xa18a('0x25')](saveUpdates(_0x4e64bd[_0xa18a('0x49')],null))[_0xa18a('0x25')](respondWithResult(_0x453d53,null))[_0xa18a('0x47')](handleError(_0x453d53,null));};exports['destroy']=function(_0x506ade,_0x508c78){return db[_0xa18a('0x2b')][_0xa18a('0x46')]({'where':{'id':_0x506ade[_0xa18a('0x45')]['id']}})['then'](handleEntityNotFound(_0x508c78,null))[_0xa18a('0x25')](removeEntity(_0x508c78,null))[_0xa18a('0x47')](handleError(_0x508c78,null));};exports[_0xa18a('0x4a')]=function(_0x85556b,_0x1d5f44,_0x330df4){var _0x26e616={};var _0x2529da={};var _0x478a5a;var _0x2f057d;return db[_0xa18a('0x2b')][_0xa18a('0x4b')]({'where':{'id':_0x85556b[_0xa18a('0x45')]['id']}})[_0xa18a('0x25')](handleEntityNotFound(_0x1d5f44,null))[_0xa18a('0x25')](function(_0x2a08d7){if(_0x2a08d7){_0x478a5a=_0x2a08d7;_0x2529da[_0xa18a('0x2f')]=_['keys'](db[_0xa18a('0x4c')][_0xa18a('0x2c')]);_0x2529da[_0xa18a('0x30')]=_[_0xa18a('0x31')](_0x85556b[_0xa18a('0x30')]);_0x2529da[_0xa18a('0x32')]=_[_0xa18a('0x33')](_0x2529da['model'],_0x2529da[_0xa18a('0x30')]);_0x26e616[_0xa18a('0x34')]=_[_0xa18a('0x33')](_0x2529da['model'],qs[_0xa18a('0x35')](_0x85556b[_0xa18a('0x30')][_0xa18a('0x35')]));_0x26e616[_0xa18a('0x34')]=_0x26e616[_0xa18a('0x34')][_0xa18a('0x36')]?_0x26e616[_0xa18a('0x34')]:_0x2529da[_0xa18a('0x2f')];_0x26e616[_0xa18a('0x39')]=qs['sort'](_0x85556b[_0xa18a('0x30')]['sort']);_0x26e616[_0xa18a('0x3b')]=qs['filters'](_['pick'](_0x85556b[_0xa18a('0x30')],_0x2529da[_0xa18a('0x32')]));if(_0x85556b[_0xa18a('0x30')]['filter']){_0x26e616[_0xa18a('0x3b')]=_[_0xa18a('0x3d')](_0x26e616[_0xa18a('0x3b')],{'$or':_[_0xa18a('0x2a')](_0x26e616[_0xa18a('0x34')],function(_0x376b76){var _0x1fbb8f={};_0x1fbb8f[_0x376b76]={'$like':'%'+_0x85556b['query'][_0xa18a('0x3f')]+'%'};return _0x1fbb8f;})});}_0x26e616=_[_0xa18a('0x3d')]({},_0x26e616,_0x85556b[_0xa18a('0x40')]);return _0x478a5a[_0xa18a('0x4a')](_0x26e616);}})['then'](function(_0x551870){if(_0x551870){_0x2f057d=_0x551870[_0xa18a('0x36')];if(!_0x85556b['query'][_0xa18a('0x37')](_0xa18a('0x38'))){_0x26e616[_0xa18a('0x22')]=qs[_0xa18a('0x22')](_0x85556b[_0xa18a('0x30')][_0xa18a('0x22')]);_0x26e616[_0xa18a('0x21')]=qs['offset'](_0x85556b[_0xa18a('0x30')][_0xa18a('0x21')]);}return _0x478a5a[_0xa18a('0x4a')](_0x26e616);}})[_0xa18a('0x25')](function(_0x2a16ff){if(_0x2a16ff){return _0x2a16ff?{'count':_0x2f057d,'rows':_0x2a16ff}:null;}})[_0xa18a('0x25')](respondWithResult(_0x1d5f44,null))[_0xa18a('0x47')](handleError(_0x1d5f44,null));};exports['addConfiguration']=function(_0x6f8813,_0x4e8d11,_0x52c50b){if(_0x6f8813[_0xa18a('0x49')]['id']){delete _0x6f8813['body']['id'];}return db[_0xa18a('0x2b')][_0xa18a('0x4b')]({'where':{'id':_0x6f8813[_0xa18a('0x45')]['id']}})[_0xa18a('0x25')](handleEntityNotFound(_0x4e8d11,null))['then'](function(_0x591a80){if(_0x591a80){_0x6f8813[_0xa18a('0x49')]['AccountId']=_0x591a80['id'];_0x6f8813[_0xa18a('0x49')][_0xa18a('0x4d')]=integrations[_0xa18a('0x4e')](_0x6f8813[_0xa18a('0x49')]['channel'],_0x6f8813['body']['type']);_0x6f8813[_0xa18a('0x49')][_0xa18a('0x4f')]=integrations[_0xa18a('0x50')](_0x6f8813['body'][_0xa18a('0x51')],_0x6f8813[_0xa18a('0x49')][_0xa18a('0x52')]);return db['FreshsalesConfiguration']['create'](_0x6f8813[_0xa18a('0x49')],{'include':[{'model':db['FreshsalesField'],'as':_0xa18a('0x4d')},{'model':db[_0xa18a('0x53')],'as':_0xa18a('0x4f')}]});}return null;})[_0xa18a('0x25')](respondWithResult(_0x4e8d11,null))[_0xa18a('0x47')](handleError(_0x4e8d11,null));};exports['getFields']=function(_0x2f1db3,_0x3938ac,_0xea8bc0){var _0x371881='';var _0x101610='';return db[_0xa18a('0x2b')][_0xa18a('0x4b')]({'where':{'id':_0x2f1db3[_0xa18a('0x45')]['id']},'attributes':['id',_0xa18a('0x54'),_0xa18a('0x55'),'apiKey']})[_0xa18a('0x25')](handleEntityNotFound(_0x3938ac,null))[_0xa18a('0x25')](function(_0x151590){if(_0x151590){_0x101610=_0x151590['username'];_0x371881=_0x151590['remoteUri'];var _0x4a5596=_0x151590[_0xa18a('0x55')]['slice'](-0x1);if(_0x4a5596==='/'){_0x371881=_0x371881[_0xa18a('0x56')](0x0,_0x371881[_0xa18a('0x57')](_0x4a5596));}return rp({'method':_0xa18a('0x58'),'uri':util[_0xa18a('0x59')](_0xa18a('0x5a'),_0x371881,_0xa18a('0x5b')),'headers':{'Authorization':_0xa18a('0x5c')+_0x151590[_0xa18a('0x5d')]},'json':!![]});}})['then'](function(_0x321e5d){if(_0x321e5d){var _0x98d220=_0x321e5d[_0xa18a('0x5e')];var _0x2a7bc6=![];var _0x5528c0=null;for(_0x5528c0=0x0;_0x5528c0<_0x98d220[_0xa18a('0x36')];_0x5528c0++){if(_0x98d220[_0x5528c0][_0xa18a('0x5f')]===_0x101610){_0x2a7bc6=!![];}}if(_0x2a7bc6){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xa18a('0x60')});}}})[_0xa18a('0x25')](respondWithResult(_0x3938ac,null))['catch'](function(_0x4cc581){var _0x157fa5=_0x2f1db3[_0xa18a('0x30')]['test']?0x1f4:_0x4cc581[_0xa18a('0x61')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x157fa5,JSON[_0xa18a('0x62')](_0x4cc581));delete _0x4cc581[_0xa18a('0x28')];if(_0x157fa5===0x191){_0x157fa5=0x190;}_0x3938ac[_0xa18a('0x1e')](_0x157fa5)[_0xa18a('0x29')](_0x2f1db3[_0xa18a('0x30')][_0xa18a('0x63')]?{'message':_0xa18a('0x64'),'statusCode':_0x4cc581[_0xa18a('0x61')]}:_0x4cc581);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 0ac2606..51c49eb 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xadb5,0xad));var _0x5adb=function(_0x5a2612,_0x56006e){_0x5a2612=_0x5a2612-0x0;var _0x3869a6=_0xadb5[_0x5a2612];return _0x3869a6;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var logger=require('../../config/logger')(_0x5adb('0x1'));var moment=require(_0x5adb('0x2'));var BPromise=require(_0x5adb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5adb('0x4'));var rimraf=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x5adb('0x7'));module[_0x5adb('0x8')]=function(_0x3e2555,_0x3213e8){return _0x3e2555[_0x5adb('0x9')](_0x5adb('0xa'),attributes,{'tableName':_0x5adb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ace=['request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x1b33bc,_0x282af6){_0x1b33bc=_0x1b33bc-0x0;var _0x23b81c=_0x8ace[_0x1b33bc];return _0x23b81c;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var logger=require(_0xe8ac('0x2'))(_0xe8ac('0x3'));var moment=require(_0xe8ac('0x4'));var BPromise=require(_0xe8ac('0x5'));var rp=require(_0xe8ac('0x6'));var fs=require('fs');var path=require(_0xe8ac('0x7'));var rimraf=require(_0xe8ac('0x8'));var config=require(_0xe8ac('0x9'));var attributes=require(_0xe8ac('0xa'));var integrations=require(_0xe8ac('0xb'));module[_0xe8ac('0xc')]=function(_0x2b48ec,_0x4eb087){return _0x2b48ec[_0xe8ac('0xd')](_0xe8ac('0xe'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 45807ff..13327ba 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['map','include','model','attributes','then','ShowFreshsalesAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','limit'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5bcf9b,_0x3fcc1a){_0x5bcf9b=_0x5bcf9b-0x0;var _0x513620=_0x5f2f[_0x5bcf9b];return _0x513620;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')]({'raw':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options']['where']||null:null,'attributes':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['attributes']||null:null,'limit':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1c')]||null:null,'include':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['include']?_[_0xf5f2('0x1d')](_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x2833fe){return{'model':db[_0x2833fe[_0xf5f2('0x1f')]],'as':_0x2833fe['as'],'attributes':_0x2833fe['attributes'],'include':_0x2833fe['include']?_[_0xf5f2('0x1d')](_0x2833fe[_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x375ca8){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')]('GetFreshsalesAccount',_0x20fccd,JSON['stringify'](_0x375ca8));_0x4ff59b(_0x375ca8);})[_0xf5f2('0x16')](function(_0x14c829){logger[_0xf5f2('0x11')]('GetFreshsalesAccount',_0x14c829['message'],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x14c829[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x22')]=function(_0x153924){var _0x1b381e=this;return new Promise(function(_0x54c0c8,_0x52e959){return db[_0xf5f2('0x18')]['find']({'raw':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x23')]||null:null,'attributes':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x20')]||null:null,'include':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x1408b9){return{'model':db[_0x1408b9[_0xf5f2('0x1f')]],'as':_0x1408b9['as'],'attributes':_0x1408b9[_0xf5f2('0x20')],'include':_0x1408b9['include']?_[_0xf5f2('0x1d')](_0x1408b9[_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x46ad4a){logger[_0xf5f2('0xd')]('ShowFreshsalesAccount',_0x153924);logger[_0xf5f2('0xf')]('ShowFreshsalesAccount',_0x153924,JSON[_0xf5f2('0x10')](_0x46ad4a));_0x54c0c8(_0x46ad4a);})['catch'](function(_0x46f464){logger[_0xf5f2('0x11')]('ShowFreshsalesAccount',_0x46f464[_0xf5f2('0x13')],_0x153924);_0x52e959(_0x1b381e[_0xf5f2('0x11')](0x1f4,_0x46f464[_0xf5f2('0x13')]));});});}; \ No newline at end of file +var _0x9536=['code','message','info','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowFreshsalesAccount','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9536,0x179));var _0x6953=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0x9536[_0x352e09];return _0x1b7094;};'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(_0x6953('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6953('0x5'));var logger=require(_0x6953('0x6'))(_0x6953('0x7'));var config=require(_0x6953('0x8'));var jayson=require(_0x6953('0x9'));var client=jayson['client'][_0x6953('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bb026,_0x385f2d,_0x3e1aff){return new BPromise(function(_0x1c8225,_0x58ac30){return client[_0x6953('0xb')](_0x2bb026,_0x3e1aff)[_0x6953('0xc')](function(_0x449acb){logger['info'](_0x6953('0xd'),_0x385f2d,_0x6953('0xe'));logger[_0x6953('0xf')](_0x6953('0x10'),_0x385f2d,_0x6953('0xe'),JSON[_0x6953('0x11')](_0x449acb));if(_0x449acb[_0x6953('0x12')]){if(_0x449acb[_0x6953('0x12')][_0x6953('0x13')]===0x1f4){logger['error'](_0x6953('0xd'),_0x385f2d,_0x449acb['error'][_0x6953('0x14')]);return _0x58ac30(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}logger[_0x6953('0x12')](_0x6953('0xd'),_0x385f2d,_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);return _0x1c8225(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}else{logger[_0x6953('0x15')](_0x6953('0xd'),_0x385f2d,'request\x20sent');_0x1c8225(_0x449acb['result'][_0x6953('0x14')]);}})[_0x6953('0x16')](function(_0x16b79b){logger[_0x6953('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x385f2d,_0x16b79b);_0x58ac30(_0x16b79b);});});}exports[_0x6953('0x17')]=function(_0x2da771){var _0x4b43ae=this;return new Promise(function(_0x10858a,_0x3207dd){return db[_0x6953('0x18')][_0x6953('0x19')]({'raw':_0x2da771[_0x6953('0x1a')]?_0x2da771['options'][_0x6953('0x1b')]===undefined?!![]:![]:!![],'where':_0x2da771[_0x6953('0x1a')]?_0x2da771[_0x6953('0x1a')][_0x6953('0x1c')]||null:null,'attributes':_0x2da771[_0x6953('0x1a')]?_0x2da771['options'][_0x6953('0x1d')]||null:null,'limit':_0x2da771[_0x6953('0x1a')]?_0x2da771['options'][_0x6953('0x1e')]||null:null,'include':_0x2da771[_0x6953('0x1a')]?_0x2da771[_0x6953('0x1a')][_0x6953('0x1f')]?_['map'](_0x2da771[_0x6953('0x1a')][_0x6953('0x1f')],function(_0x2a7f6a){return{'model':db[_0x2a7f6a['model']],'as':_0x2a7f6a['as'],'attributes':_0x2a7f6a['attributes'],'include':_0x2a7f6a['include']?_[_0x6953('0x20')](_0x2a7f6a[_0x6953('0x1f')],function(_0x550be4){return{'model':db[_0x550be4[_0x6953('0x21')]],'as':_0x550be4['as'],'attributes':_0x550be4['attributes'],'include':_0x550be4[_0x6953('0x1f')]?_[_0x6953('0x20')](_0x550be4[_0x6953('0x1f')],function(_0x2cc01e){return{'model':db[_0x2cc01e[_0x6953('0x21')]],'as':_0x2cc01e['as'],'attributes':_0x2cc01e[_0x6953('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dd890){logger[_0x6953('0x15')]('GetFreshsalesAccount',_0x2da771);logger[_0x6953('0xf')]('GetFreshsalesAccount',_0x2da771,JSON[_0x6953('0x11')](_0x3dd890));_0x10858a(_0x3dd890);})[_0x6953('0x16')](function(_0x426c7c){logger['error'](_0x6953('0x17'),_0x426c7c[_0x6953('0x14')],_0x2da771);_0x3207dd(_0x4b43ae[_0x6953('0x12')](0x1f4,_0x426c7c['message']));});});};exports[_0x6953('0x22')]=function(_0x132a71){var _0x481c6a=this;return new Promise(function(_0x4d856d,_0xd80e42){return db[_0x6953('0x18')][_0x6953('0x23')]({'raw':_0x132a71[_0x6953('0x1a')]?_0x132a71[_0x6953('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x132a71[_0x6953('0x1a')]?_0x132a71['options'][_0x6953('0x1c')]||null:null,'attributes':_0x132a71[_0x6953('0x1a')]?_0x132a71['options']['attributes']||null:null,'include':_0x132a71[_0x6953('0x1a')]?_0x132a71[_0x6953('0x1a')][_0x6953('0x1f')]?_['map'](_0x132a71[_0x6953('0x1a')]['include'],function(_0x4e95f1){return{'model':db[_0x4e95f1['model']],'as':_0x4e95f1['as'],'attributes':_0x4e95f1['attributes'],'include':_0x4e95f1[_0x6953('0x1f')]?_[_0x6953('0x20')](_0x4e95f1[_0x6953('0x1f')],function(_0x11f316){return{'model':db[_0x11f316[_0x6953('0x21')]],'as':_0x11f316['as'],'attributes':_0x11f316[_0x6953('0x1d')],'include':_0x11f316['include']?_[_0x6953('0x20')](_0x11f316['include'],function(_0x199c67){return{'model':db[_0x199c67['model']],'as':_0x199c67['as'],'attributes':_0x199c67[_0x6953('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6953('0xc')](function(_0xd81149){logger[_0x6953('0x15')]('ShowFreshsalesAccount',_0x132a71);logger[_0x6953('0xf')](_0x6953('0x22'),_0x132a71,JSON[_0x6953('0x11')](_0xd81149));_0x4d856d(_0xd81149);})[_0x6953('0x16')](function(_0x40b6ea){logger[_0x6953('0x12')](_0x6953('0x22'),_0x40b6ea[_0x6953('0x14')],_0x132a71);_0xd80e42(_0x481c6a[_0x6953('0x12')](0x1f4,_0x40b6ea[_0x6953('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 7942058..58b82f1 100644 --- a/server/api/intFreshsalesConfiguration/index.js +++ b/server/api/intFreshsalesConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1637=['../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getDescriptions','/:id/fields','getFields','post','create','put','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x259d84,_0x99d2a1){var _0x28b1c1=function(_0x3a76a4){while(--_0x3a76a4){_0x259d84['push'](_0x259d84['shift']());}};_0x28b1c1(++_0x99d2a1);}(_0x1637,0x1da));var _0x7163=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0x1637[_0x44268d];return _0x4be92d;};'use strict';var multer=require(_0x7163('0x0'));var util=require(_0x7163('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7163('0x2'));var router=express[_0x7163('0x3')]();var fs_extra=require(_0x7163('0x4'));var auth=require(_0x7163('0x5'));var interaction=require(_0x7163('0x6'));var config=require(_0x7163('0x7'));var controller=require(_0x7163('0x8'));router[_0x7163('0x9')]('/',auth[_0x7163('0xa')](),controller[_0x7163('0xb')]);router['get'](_0x7163('0xc'),auth[_0x7163('0xa')](),controller[_0x7163('0xd')]);router[_0x7163('0x9')](_0x7163('0xe'),auth[_0x7163('0xa')](),controller['getSubjects']);router[_0x7163('0x9')]('/:id/descriptions',auth[_0x7163('0xa')](),controller[_0x7163('0xf')]);router[_0x7163('0x9')](_0x7163('0x10'),auth[_0x7163('0xa')](),controller[_0x7163('0x11')]);router[_0x7163('0x12')]('/',auth[_0x7163('0xa')](),controller[_0x7163('0x13')]);router[_0x7163('0x14')](_0x7163('0xc'),auth['isAuthenticated'](),controller[_0x7163('0x15')]);router['delete'](_0x7163('0xc'),auth[_0x7163('0xa')](),controller[_0x7163('0x16')]);module[_0x7163('0x17')]=router; \ No newline at end of file +var _0x1760=['get','isAuthenticated','getDescriptions','/:id/fields','getFields','post','create','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1760,0xe7));var _0x0176=function(_0x274c70,_0x4aaf48){_0x274c70=_0x274c70-0x0;var _0x23933a=_0x1760[_0x274c70];return _0x23933a;};'use strict';var multer=require(_0x0176('0x0'));var util=require(_0x0176('0x1'));var path=require(_0x0176('0x2'));var timeout=require(_0x0176('0x3'));var express=require(_0x0176('0x4'));var router=express[_0x0176('0x5')]();var fs_extra=require(_0x0176('0x6'));var auth=require(_0x0176('0x7'));var interaction=require(_0x0176('0x8'));var config=require(_0x0176('0x9'));var controller=require(_0x0176('0xa'));router[_0x0176('0xb')]('/',auth[_0x0176('0xc')](),controller['index']);router[_0x0176('0xb')]('/:id',auth[_0x0176('0xc')](),controller['show']);router[_0x0176('0xb')]('/:id/subjects',auth[_0x0176('0xc')](),controller['getSubjects']);router[_0x0176('0xb')]('/:id/descriptions',auth[_0x0176('0xc')](),controller[_0x0176('0xd')]);router[_0x0176('0xb')](_0x0176('0xe'),auth[_0x0176('0xc')](),controller[_0x0176('0xf')]);router[_0x0176('0x10')]('/',auth[_0x0176('0xc')](),controller[_0x0176('0x11')]);router['put']('/:id',auth[_0x0176('0xc')](),controller['update']);router[_0x0176('0x12')](_0x0176('0x13'),auth['isAuthenticated'](),controller[_0x0176('0x14')]);module[_0x0176('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 82bf8c9..57cc353 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb093=['STRING','sequelize','exports'];(function(_0x5ed928,_0x2dbbdc){var _0x2effcc=function(_0x19ba45){while(--_0x19ba45){_0x5ed928['push'](_0x5ed928['shift']());}};_0x2effcc(++_0x2dbbdc);}(_0xb093,0xc4));var _0x3b09=function(_0x3bbe0f,_0x47e915){_0x3bbe0f=_0x3bbe0f-0x0;var _0x5c60fb=_0xb093[_0x3bbe0f];return _0x5c60fb;};'use strict';var Sequelize=require(_0x3b09('0x0'));module[_0x3b09('0x1')]={'name':{'type':Sequelize[_0x3b09('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe313=['sequelize','STRING'];(function(_0x4b9b23,_0x4f3ddf){var _0x59b02b=function(_0x533d0f){while(--_0x533d0f){_0x4b9b23['push'](_0x4b9b23['shift']());}};_0x59b02b(++_0x4f3ddf);}(_0xe313,0x168));var _0x3e31=function(_0x49c46b,_0xb0d238){_0x49c46b=_0x49c46b-0x0;var _0x25dedf=_0xe313[_0x49c46b];return _0x25dedf;};'use strict';var Sequelize=require(_0x3e31('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3e31('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 71078a7..294591f 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf57=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','FreshsalesConfiguration','includeAll','include','findAll','rows','catch','params','find','create','body','getSubjects','findOne','FreshsalesField','merge','getDescriptions','getFields'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xaf57,0x148));var _0x7af5=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xaf57[_0x2e4e19];return _0x9ba20b;};'use strict';var emlformat=require(_0x7af5('0x0'));var rimraf=require(_0x7af5('0x1'));var zipdir=require(_0x7af5('0x2'));var jsonpatch=require(_0x7af5('0x3'));var rp=require(_0x7af5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7af5('0x5'));var util=require(_0x7af5('0x6'));var path=require(_0x7af5('0x7'));var sox=require(_0x7af5('0x8'));var csv=require(_0x7af5('0x9'));var ejs=require(_0x7af5('0xa'));var fs=require('fs');var fs_extra=require(_0x7af5('0xb'));var _=require('lodash');var squel=require(_0x7af5('0xc'));var crypto=require(_0x7af5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7af5('0xe'));var toCsv=require(_0x7af5('0x9'));var querystring=require(_0x7af5('0xf'));var Papa=require(_0x7af5('0x10'));var Redis=require('ioredis');var authService=require(_0x7af5('0x11'));var qs=require(_0x7af5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7af5('0x13'));var logger=require(_0x7af5('0x14'))(_0x7af5('0x15'));var utils=require(_0x7af5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7af5('0x17'));var db=require(_0x7af5('0x18'))['db'];function respondWithStatusCode(_0x4ea0e1,_0x45e235){_0x45e235=_0x45e235||0xcc;return function(_0x2353bb){if(_0x2353bb){return _0x4ea0e1[_0x7af5('0x19')](_0x45e235);}return _0x4ea0e1[_0x7af5('0x1a')](_0x45e235)['end']();};}function respondWithResult(_0x383eed,_0x211df0){_0x211df0=_0x211df0||0xc8;return function(_0x4fdba4){if(_0x4fdba4){return _0x383eed[_0x7af5('0x1a')](_0x211df0)[_0x7af5('0x1b')](_0x4fdba4);}};}function respondWithFilteredResult(_0x72db6e,_0x39c054){return function(_0x468dc6){if(_0x468dc6){var _0x55a273=typeof _0x39c054[_0x7af5('0x1c')]===_0x7af5('0x1d')&&typeof _0x39c054['limit']==='undefined';var _0x52a4c7=_0x468dc6['count'];var _0x5b7d4b=_0x55a273?0x0:_0x39c054[_0x7af5('0x1c')];var _0x1a61a5=_0x55a273?_0x468dc6[_0x7af5('0x1e')]:_0x39c054[_0x7af5('0x1c')]+_0x39c054[_0x7af5('0x1f')];var _0x2077fd;if(_0x1a61a5>=_0x52a4c7){_0x1a61a5=_0x52a4c7;_0x2077fd=0xc8;}else{_0x2077fd=0xce;}_0x72db6e[_0x7af5('0x1a')](_0x2077fd);return _0x72db6e[_0x7af5('0x20')](_0x7af5('0x21'),_0x5b7d4b+'-'+_0x1a61a5+'/'+_0x52a4c7)['json'](_0x468dc6);}return null;};}function patchUpdates(_0x92f236){return function(_0x321bc9){try{jsonpatch[_0x7af5('0x22')](_0x321bc9,_0x92f236,!![]);}catch(_0xba7029){return BPromise['reject'](_0xba7029);}return _0x321bc9['save']();};}function saveUpdates(_0xf543c9,_0x239c47){return function(_0x512abc){if(_0x512abc){return _0x512abc[_0x7af5('0x23')](_0xf543c9)[_0x7af5('0x24')](function(_0x1de000){return _0x1de000;});}return null;};}function removeEntity(_0x595667,_0x4292e6){return function(_0x3d9582){if(_0x3d9582){return _0x3d9582[_0x7af5('0x25')]()['then'](function(){_0x595667[_0x7af5('0x1a')](0xcc)[_0x7af5('0x26')]();});}};}function handleEntityNotFound(_0x304bf6,_0xdeca9b){return function(_0x2fa361){if(!_0x2fa361){_0x304bf6[_0x7af5('0x19')](0x194);}return _0x2fa361;};}function handleError(_0x57b638,_0x2ef0f9){_0x2ef0f9=_0x2ef0f9||0x1f4;return function(_0x3cf2d7){logger[_0x7af5('0x27')](_0x3cf2d7[_0x7af5('0x28')]);if(_0x3cf2d7[_0x7af5('0x29')]){delete _0x3cf2d7[_0x7af5('0x29')];}_0x57b638[_0x7af5('0x1a')](_0x2ef0f9)[_0x7af5('0x2a')](_0x3cf2d7);};}exports[_0x7af5('0x2b')]=function(_0x1d073b,_0xbb206a){var _0xd34767={},_0xf0dba2={},_0x1a90d4={'count':0x0,'rows':[]};var _0x46fe4c=_['map'](db['FreshsalesConfiguration'][_0x7af5('0x2c')],function(_0x3587de){return{'name':_0x3587de[_0x7af5('0x2d')],'type':_0x3587de['type'][_0x7af5('0x2e')]};});_0xf0dba2[_0x7af5('0x2f')]=_[_0x7af5('0x30')](_0x46fe4c,_0x7af5('0x29'));_0xf0dba2[_0x7af5('0x31')]=_[_0x7af5('0x32')](_0x1d073b['query']);_0xf0dba2[_0x7af5('0x33')]=_[_0x7af5('0x34')](_0xf0dba2[_0x7af5('0x2f')],_0xf0dba2[_0x7af5('0x31')]);_0xd34767[_0x7af5('0x35')]=_[_0x7af5('0x34')](_0xf0dba2[_0x7af5('0x2f')],qs[_0x7af5('0x36')](_0x1d073b['query'][_0x7af5('0x36')]));_0xd34767['attributes']=_0xd34767[_0x7af5('0x35')][_0x7af5('0x37')]?_0xd34767[_0x7af5('0x35')]:_0xf0dba2[_0x7af5('0x2f')];if(!_0x1d073b['query'][_0x7af5('0x38')](_0x7af5('0x39'))){_0xd34767[_0x7af5('0x1f')]=qs['limit'](_0x1d073b[_0x7af5('0x31')]['limit']);_0xd34767[_0x7af5('0x1c')]=qs[_0x7af5('0x1c')](_0x1d073b[_0x7af5('0x31')][_0x7af5('0x1c')]);}_0xd34767[_0x7af5('0x3a')]=qs[_0x7af5('0x3b')](_0x1d073b[_0x7af5('0x31')][_0x7af5('0x3b')]);_0xd34767[_0x7af5('0x3c')]=qs['filters'](_[_0x7af5('0x3d')](_0x1d073b[_0x7af5('0x31')],_0xf0dba2['filters']),_0x46fe4c);if(_0x1d073b[_0x7af5('0x31')][_0x7af5('0x3e')]){_0xd34767[_0x7af5('0x3c')]=_['merge'](_0xd34767['where'],{'$or':_['map'](_0x46fe4c,function(_0x1ad7e4){if(_0x1ad7e4[_0x7af5('0x3f')]!==_0x7af5('0x40')){var _0x325bf5={};_0x325bf5[_0x1ad7e4['name']]={'$like':'%'+_0x1d073b[_0x7af5('0x31')][_0x7af5('0x3e')]+'%'};return _0x325bf5;}})});}_0xd34767=_['merge']({},_0xd34767,_0x1d073b[_0x7af5('0x41')]);var _0x3fa93f={'where':_0xd34767['where']};return db[_0x7af5('0x42')][_0x7af5('0x1e')](_0x3fa93f)[_0x7af5('0x24')](function(_0x773f3e){_0x1a90d4[_0x7af5('0x1e')]=_0x773f3e;if(_0x1d073b[_0x7af5('0x31')][_0x7af5('0x43')]){_0xd34767[_0x7af5('0x44')]=[{'all':!![]}];}return db[_0x7af5('0x42')][_0x7af5('0x45')](_0xd34767);})[_0x7af5('0x24')](function(_0x2794a9){_0x1a90d4[_0x7af5('0x46')]=_0x2794a9;return _0x1a90d4;})[_0x7af5('0x24')](respondWithFilteredResult(_0xbb206a,_0xd34767))[_0x7af5('0x47')](handleError(_0xbb206a,null));};exports['show']=function(_0x574c56,_0x105205){var _0x347fbc={'raw':![],'where':{'id':_0x574c56[_0x7af5('0x48')]['id']}},_0x4aa1f4={};_0x4aa1f4[_0x7af5('0x2f')]=_[_0x7af5('0x32')](db[_0x7af5('0x42')][_0x7af5('0x2c')]);_0x4aa1f4['query']=_[_0x7af5('0x32')](_0x574c56['query']);_0x4aa1f4[_0x7af5('0x33')]=_['intersection'](_0x4aa1f4[_0x7af5('0x2f')],_0x4aa1f4[_0x7af5('0x31')]);_0x347fbc[_0x7af5('0x35')]=_[_0x7af5('0x34')](_0x4aa1f4[_0x7af5('0x2f')],qs[_0x7af5('0x36')](_0x574c56['query'][_0x7af5('0x36')]));_0x347fbc[_0x7af5('0x35')]=_0x347fbc[_0x7af5('0x35')]['length']?_0x347fbc['attributes']:_0x4aa1f4[_0x7af5('0x2f')];if(_0x574c56['query']['includeAll']){_0x347fbc[_0x7af5('0x44')]=[{'all':!![]}];}_0x347fbc=_['merge']({},_0x347fbc,_0x574c56['options']);return db[_0x7af5('0x42')][_0x7af5('0x49')](_0x347fbc)[_0x7af5('0x24')](handleEntityNotFound(_0x105205,null))[_0x7af5('0x24')](respondWithResult(_0x105205,null))[_0x7af5('0x47')](handleError(_0x105205,null));};exports['create']=function(_0x19e8d3,_0x3056cf){return db['FreshsalesConfiguration'][_0x7af5('0x4a')](_0x19e8d3[_0x7af5('0x4b')],{})['then'](respondWithResult(_0x3056cf,0xc9))['catch'](handleError(_0x3056cf,null));};exports[_0x7af5('0x23')]=function(_0x2ebc96,_0x499805){if(_0x2ebc96['body']['id']){delete _0x2ebc96[_0x7af5('0x4b')]['id'];}return db[_0x7af5('0x42')][_0x7af5('0x49')]({'where':{'id':_0x2ebc96[_0x7af5('0x48')]['id']}})[_0x7af5('0x24')](handleEntityNotFound(_0x499805,null))[_0x7af5('0x24')](saveUpdates(_0x2ebc96[_0x7af5('0x4b')],null))['then'](respondWithResult(_0x499805,null))['catch'](handleError(_0x499805,null));};exports[_0x7af5('0x25')]=function(_0x4d0f44,_0x580689){return db['FreshsalesConfiguration']['find']({'where':{'id':_0x4d0f44[_0x7af5('0x48')]['id']}})[_0x7af5('0x24')](handleEntityNotFound(_0x580689,null))[_0x7af5('0x24')](removeEntity(_0x580689,null))[_0x7af5('0x47')](handleError(_0x580689,null));};exports[_0x7af5('0x4c')]=function(_0x134912,_0x3ad53f,_0x466188){var _0x561491={};var _0x48268a={};var _0x4445fd;var _0x3a2f32;return db[_0x7af5('0x42')][_0x7af5('0x4d')]({'where':{'id':_0x134912['params']['id']}})[_0x7af5('0x24')](handleEntityNotFound(_0x3ad53f,null))[_0x7af5('0x24')](function(_0x45b4f7){if(_0x45b4f7){_0x4445fd=_0x45b4f7;_0x48268a[_0x7af5('0x2f')]=_[_0x7af5('0x32')](db[_0x7af5('0x4e')][_0x7af5('0x2c')]);_0x48268a['query']=_[_0x7af5('0x32')](_0x134912[_0x7af5('0x31')]);_0x48268a[_0x7af5('0x33')]=_[_0x7af5('0x34')](_0x48268a[_0x7af5('0x2f')],_0x48268a[_0x7af5('0x31')]);_0x561491['attributes']=_['intersection'](_0x48268a[_0x7af5('0x2f')],qs[_0x7af5('0x36')](_0x134912['query'][_0x7af5('0x36')]));_0x561491[_0x7af5('0x35')]=_0x561491['attributes'][_0x7af5('0x37')]?_0x561491[_0x7af5('0x35')]:_0x48268a[_0x7af5('0x2f')];_0x561491[_0x7af5('0x3a')]=qs[_0x7af5('0x3b')](_0x134912[_0x7af5('0x31')]['sort']);_0x561491[_0x7af5('0x3c')]=qs[_0x7af5('0x33')](_['pick'](_0x134912[_0x7af5('0x31')],_0x48268a[_0x7af5('0x33')]));if(_0x134912[_0x7af5('0x31')][_0x7af5('0x3e')]){_0x561491[_0x7af5('0x3c')]=_['merge'](_0x561491['where'],{'$or':_[_0x7af5('0x30')](_0x561491[_0x7af5('0x35')],function(_0x2b3b9d){var _0x4ea391={};_0x4ea391[_0x2b3b9d]={'$like':'%'+_0x134912[_0x7af5('0x31')]['filter']+'%'};return _0x4ea391;})});}_0x561491=_[_0x7af5('0x4f')]({},_0x561491,_0x134912[_0x7af5('0x41')]);return _0x4445fd[_0x7af5('0x4c')](_0x561491);}})[_0x7af5('0x24')](function(_0x2ff41a){if(_0x2ff41a){_0x3a2f32=_0x2ff41a['length'];if(!_0x134912[_0x7af5('0x31')][_0x7af5('0x38')](_0x7af5('0x39'))){_0x561491[_0x7af5('0x1f')]=qs[_0x7af5('0x1f')](_0x134912['query'][_0x7af5('0x1f')]);_0x561491['offset']=qs[_0x7af5('0x1c')](_0x134912[_0x7af5('0x31')][_0x7af5('0x1c')]);}return _0x4445fd[_0x7af5('0x4c')](_0x561491);}})[_0x7af5('0x24')](function(_0x20fad2){if(_0x20fad2){return _0x20fad2?{'count':_0x3a2f32,'rows':_0x20fad2}:null;}})[_0x7af5('0x24')](respondWithResult(_0x3ad53f,null))['catch'](handleError(_0x3ad53f,null));};exports[_0x7af5('0x50')]=function(_0x1563b8,_0x27e4b8,_0x31904c){var _0x2f2e74={};var _0x1b4b1a={};var _0x437d2b;var _0x62d9e1;return db[_0x7af5('0x42')][_0x7af5('0x4d')]({'where':{'id':_0x1563b8[_0x7af5('0x48')]['id']}})[_0x7af5('0x24')](handleEntityNotFound(_0x27e4b8,null))[_0x7af5('0x24')](function(_0x13869f){if(_0x13869f){_0x437d2b=_0x13869f;_0x1b4b1a[_0x7af5('0x2f')]=_['keys'](db['FreshsalesField'][_0x7af5('0x2c')]);_0x1b4b1a[_0x7af5('0x31')]=_['keys'](_0x1563b8[_0x7af5('0x31')]);_0x1b4b1a['filters']=_[_0x7af5('0x34')](_0x1b4b1a[_0x7af5('0x2f')],_0x1b4b1a[_0x7af5('0x31')]);_0x2f2e74[_0x7af5('0x35')]=_[_0x7af5('0x34')](_0x1b4b1a[_0x7af5('0x2f')],qs['fields'](_0x1563b8['query'][_0x7af5('0x36')]));_0x2f2e74[_0x7af5('0x35')]=_0x2f2e74['attributes']['length']?_0x2f2e74['attributes']:_0x1b4b1a['model'];_0x2f2e74[_0x7af5('0x3a')]=qs[_0x7af5('0x3b')](_0x1563b8[_0x7af5('0x31')]['sort']);_0x2f2e74[_0x7af5('0x3c')]=qs[_0x7af5('0x33')](_[_0x7af5('0x3d')](_0x1563b8['query'],_0x1b4b1a['filters']));if(_0x1563b8[_0x7af5('0x31')][_0x7af5('0x3e')]){_0x2f2e74[_0x7af5('0x3c')]=_[_0x7af5('0x4f')](_0x2f2e74['where'],{'$or':_[_0x7af5('0x30')](_0x2f2e74[_0x7af5('0x35')],function(_0x45b129){var _0x2e905c={};_0x2e905c[_0x45b129]={'$like':'%'+_0x1563b8[_0x7af5('0x31')]['filter']+'%'};return _0x2e905c;})});}_0x2f2e74=_[_0x7af5('0x4f')]({},_0x2f2e74,_0x1563b8[_0x7af5('0x41')]);return _0x437d2b[_0x7af5('0x50')](_0x2f2e74);}})[_0x7af5('0x24')](function(_0x302c51){if(_0x302c51){_0x62d9e1=_0x302c51['length'];if(!_0x1563b8[_0x7af5('0x31')]['hasOwnProperty']('nolimit')){_0x2f2e74[_0x7af5('0x1f')]=qs['limit'](_0x1563b8[_0x7af5('0x31')][_0x7af5('0x1f')]);_0x2f2e74[_0x7af5('0x1c')]=qs['offset'](_0x1563b8['query'][_0x7af5('0x1c')]);}return _0x437d2b[_0x7af5('0x50')](_0x2f2e74);}})['then'](function(_0x3f9a94){if(_0x3f9a94){return _0x3f9a94?{'count':_0x62d9e1,'rows':_0x3f9a94}:null;}})['then'](respondWithResult(_0x27e4b8,null))[_0x7af5('0x47')](handleError(_0x27e4b8,null));};exports[_0x7af5('0x51')]=function(_0x2c4223,_0x1c75a3,_0x5d559b){var _0x5eb84a={};var _0x4b8ce0={};var _0x29e9d3;var _0x302959;return db['FreshsalesConfiguration'][_0x7af5('0x4d')]({'where':{'id':_0x2c4223[_0x7af5('0x48')]['id']}})[_0x7af5('0x24')](handleEntityNotFound(_0x1c75a3,null))[_0x7af5('0x24')](function(_0x324db1){if(_0x324db1){_0x29e9d3=_0x324db1;_0x4b8ce0[_0x7af5('0x2f')]=_[_0x7af5('0x32')](db[_0x7af5('0x4e')][_0x7af5('0x2c')]);_0x4b8ce0[_0x7af5('0x31')]=_[_0x7af5('0x32')](_0x2c4223[_0x7af5('0x31')]);_0x4b8ce0[_0x7af5('0x33')]=_['intersection'](_0x4b8ce0[_0x7af5('0x2f')],_0x4b8ce0[_0x7af5('0x31')]);_0x5eb84a[_0x7af5('0x35')]=_[_0x7af5('0x34')](_0x4b8ce0[_0x7af5('0x2f')],qs[_0x7af5('0x36')](_0x2c4223[_0x7af5('0x31')][_0x7af5('0x36')]));_0x5eb84a[_0x7af5('0x35')]=_0x5eb84a['attributes'][_0x7af5('0x37')]?_0x5eb84a[_0x7af5('0x35')]:_0x4b8ce0[_0x7af5('0x2f')];_0x5eb84a[_0x7af5('0x3a')]=qs[_0x7af5('0x3b')](_0x2c4223[_0x7af5('0x31')][_0x7af5('0x3b')]);_0x5eb84a['where']=qs[_0x7af5('0x33')](_[_0x7af5('0x3d')](_0x2c4223['query'],_0x4b8ce0[_0x7af5('0x33')]));if(_0x2c4223[_0x7af5('0x31')]['filter']){_0x5eb84a[_0x7af5('0x3c')]=_['merge'](_0x5eb84a[_0x7af5('0x3c')],{'$or':_[_0x7af5('0x30')](_0x5eb84a[_0x7af5('0x35')],function(_0x137f03){var _0xc3aba0={};_0xc3aba0[_0x137f03]={'$like':'%'+_0x2c4223[_0x7af5('0x31')]['filter']+'%'};return _0xc3aba0;})});}_0x5eb84a=_['merge']({},_0x5eb84a,_0x2c4223['options']);return _0x29e9d3[_0x7af5('0x51')](_0x5eb84a);}})[_0x7af5('0x24')](function(_0x3c1fee){if(_0x3c1fee){_0x302959=_0x3c1fee[_0x7af5('0x37')];if(!_0x2c4223[_0x7af5('0x31')][_0x7af5('0x38')]('nolimit')){_0x5eb84a[_0x7af5('0x1f')]=qs['limit'](_0x2c4223['query'][_0x7af5('0x1f')]);_0x5eb84a['offset']=qs[_0x7af5('0x1c')](_0x2c4223['query'][_0x7af5('0x1c')]);}return _0x29e9d3[_0x7af5('0x51')](_0x5eb84a);}})[_0x7af5('0x24')](function(_0x2de822){if(_0x2de822){return _0x2de822?{'count':_0x302959,'rows':_0x2de822}:null;}})[_0x7af5('0x24')](respondWithResult(_0x1c75a3,null))[_0x7af5('0x47')](handleError(_0x1c75a3,null));}; \ No newline at end of file +var _0xe4ad=['then','destroy','stack','name','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','FreshsalesConfiguration','include','findAll','rows','show','params','keys','includeAll','catch','create','body','find','getSubjects','FreshsalesField','hasOwnProperty','findOne','getDescriptions','getFields','eml-format','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','count','offset','apply','reject','save','update'];(function(_0x66c01b,_0x320486){var _0x4960e3=function(_0x208f19){while(--_0x208f19){_0x66c01b['push'](_0x66c01b['shift']());}};_0x4960e3(++_0x320486);}(_0xe4ad,0x164));var _0xde4a=function(_0x33c0a2,_0x554db0){_0x33c0a2=_0x33c0a2-0x0;var _0x38952c=_0xe4ad[_0x33c0a2];return _0x38952c;};'use strict';var emlformat=require(_0xde4a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xde4a('0x1'));var moment=require(_0xde4a('0x2'));var BPromise=require(_0xde4a('0x3'));var Mustache=require(_0xde4a('0x4'));var util=require('util');var path=require(_0xde4a('0x5'));var sox=require(_0xde4a('0x6'));var csv=require(_0xde4a('0x7'));var ejs=require(_0xde4a('0x8'));var fs=require('fs');var fs_extra=require(_0xde4a('0x9'));var _=require(_0xde4a('0xa'));var squel=require(_0xde4a('0xb'));var crypto=require(_0xde4a('0xc'));var jsforce=require(_0xde4a('0xd'));var deskjs=require(_0xde4a('0xe'));var toCsv=require(_0xde4a('0x7'));var querystring=require(_0xde4a('0xf'));var Papa=require(_0xde4a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xde4a('0x11'));var as=require(_0xde4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xde4a('0x13'))(_0xde4a('0x14'));var utils=require(_0xde4a('0x15'));var config=require(_0xde4a('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51ac67,_0x39cf72){_0x39cf72=_0x39cf72||0xcc;return function(_0x35e80b){if(_0x35e80b){return _0x51ac67[_0xde4a('0x17')](_0x39cf72);}return _0x51ac67[_0xde4a('0x18')](_0x39cf72)[_0xde4a('0x19')]();};}function respondWithResult(_0x3599be,_0x553d06){_0x553d06=_0x553d06||0xc8;return function(_0x353ba4){if(_0x353ba4){return _0x3599be[_0xde4a('0x18')](_0x553d06)[_0xde4a('0x1a')](_0x353ba4);}};}function respondWithFilteredResult(_0x10e4d4,_0x7f1b1c){return function(_0x7ec284){if(_0x7ec284){var _0x44afe5=typeof _0x7f1b1c['offset']===_0xde4a('0x1b')&&typeof _0x7f1b1c['limit']===_0xde4a('0x1b');var _0x5d4ea9=_0x7ec284[_0xde4a('0x1c')];var _0x23f3d2=_0x44afe5?0x0:_0x7f1b1c[_0xde4a('0x1d')];var _0x4162cb=_0x44afe5?_0x7ec284[_0xde4a('0x1c')]:_0x7f1b1c[_0xde4a('0x1d')]+_0x7f1b1c['limit'];var _0x10313d;if(_0x4162cb>=_0x5d4ea9){_0x4162cb=_0x5d4ea9;_0x10313d=0xc8;}else{_0x10313d=0xce;}_0x10e4d4[_0xde4a('0x18')](_0x10313d);return _0x10e4d4['set']('Content-Range',_0x23f3d2+'-'+_0x4162cb+'/'+_0x5d4ea9)['json'](_0x7ec284);}return null;};}function patchUpdates(_0x26ab10){return function(_0x3ba5a3){try{jsonpatch[_0xde4a('0x1e')](_0x3ba5a3,_0x26ab10,!![]);}catch(_0x5c4797){return BPromise[_0xde4a('0x1f')](_0x5c4797);}return _0x3ba5a3[_0xde4a('0x20')]();};}function saveUpdates(_0x2eb900,_0x41f155){return function(_0x14e734){if(_0x14e734){return _0x14e734[_0xde4a('0x21')](_0x2eb900)[_0xde4a('0x22')](function(_0x558670){return _0x558670;});}return null;};}function removeEntity(_0x6e4ce2,_0x1ef6ee){return function(_0x403408){if(_0x403408){return _0x403408[_0xde4a('0x23')]()[_0xde4a('0x22')](function(){_0x6e4ce2['status'](0xcc)[_0xde4a('0x19')]();});}};}function handleEntityNotFound(_0x5046d9,_0x3f4edf){return function(_0xe51aa6){if(!_0xe51aa6){_0x5046d9[_0xde4a('0x17')](0x194);}return _0xe51aa6;};}function handleError(_0xb6d339,_0x4c9876){_0x4c9876=_0x4c9876||0x1f4;return function(_0x323f57){logger['error'](_0x323f57[_0xde4a('0x24')]);if(_0x323f57[_0xde4a('0x25')]){delete _0x323f57[_0xde4a('0x25')];}_0xb6d339[_0xde4a('0x18')](_0x4c9876)['send'](_0x323f57);};}exports['index']=function(_0x10c734,_0x3aa510){var _0x18a39a={},_0x1fa942={},_0x4ba1c7={'count':0x0,'rows':[]};var _0x30e3dd=_[_0xde4a('0x26')](db['FreshsalesConfiguration'][_0xde4a('0x27')],function(_0x1397ac){return{'name':_0x1397ac[_0xde4a('0x28')],'type':_0x1397ac[_0xde4a('0x29')][_0xde4a('0x2a')]};});_0x1fa942[_0xde4a('0x2b')]=_[_0xde4a('0x26')](_0x30e3dd,'name');_0x1fa942[_0xde4a('0x2c')]=_['keys'](_0x10c734['query']);_0x1fa942['filters']=_[_0xde4a('0x2d')](_0x1fa942['model'],_0x1fa942[_0xde4a('0x2c')]);_0x18a39a[_0xde4a('0x2e')]=_[_0xde4a('0x2d')](_0x1fa942[_0xde4a('0x2b')],qs[_0xde4a('0x2f')](_0x10c734[_0xde4a('0x2c')][_0xde4a('0x2f')]));_0x18a39a[_0xde4a('0x2e')]=_0x18a39a['attributes'][_0xde4a('0x30')]?_0x18a39a['attributes']:_0x1fa942['model'];if(!_0x10c734[_0xde4a('0x2c')]['hasOwnProperty'](_0xde4a('0x31'))){_0x18a39a['limit']=qs[_0xde4a('0x32')](_0x10c734[_0xde4a('0x2c')][_0xde4a('0x32')]);_0x18a39a['offset']=qs[_0xde4a('0x1d')](_0x10c734[_0xde4a('0x2c')][_0xde4a('0x1d')]);}_0x18a39a[_0xde4a('0x33')]=qs['sort'](_0x10c734[_0xde4a('0x2c')][_0xde4a('0x34')]);_0x18a39a[_0xde4a('0x35')]=qs[_0xde4a('0x36')](_[_0xde4a('0x37')](_0x10c734[_0xde4a('0x2c')],_0x1fa942[_0xde4a('0x36')]),_0x30e3dd);if(_0x10c734[_0xde4a('0x2c')]['filter']){_0x18a39a[_0xde4a('0x35')]=_[_0xde4a('0x38')](_0x18a39a[_0xde4a('0x35')],{'$or':_[_0xde4a('0x26')](_0x30e3dd,function(_0xe9e753){if(_0xe9e753[_0xde4a('0x29')]!==_0xde4a('0x39')){var _0x40ff80={};_0x40ff80[_0xe9e753[_0xde4a('0x25')]]={'$like':'%'+_0x10c734['query'][_0xde4a('0x3a')]+'%'};return _0x40ff80;}})});}_0x18a39a=_['merge']({},_0x18a39a,_0x10c734[_0xde4a('0x3b')]);var _0x2793fa={'where':_0x18a39a[_0xde4a('0x35')]};return db[_0xde4a('0x3c')][_0xde4a('0x1c')](_0x2793fa)[_0xde4a('0x22')](function(_0x3a4abd){_0x4ba1c7['count']=_0x3a4abd;if(_0x10c734[_0xde4a('0x2c')]['includeAll']){_0x18a39a[_0xde4a('0x3d')]=[{'all':!![]}];}return db[_0xde4a('0x3c')][_0xde4a('0x3e')](_0x18a39a);})[_0xde4a('0x22')](function(_0x77efe3){_0x4ba1c7[_0xde4a('0x3f')]=_0x77efe3;return _0x4ba1c7;})[_0xde4a('0x22')](respondWithFilteredResult(_0x3aa510,_0x18a39a))['catch'](handleError(_0x3aa510,null));};exports[_0xde4a('0x40')]=function(_0x313bbb,_0x4491f3){var _0x319afe={'raw':![],'where':{'id':_0x313bbb[_0xde4a('0x41')]['id']}},_0x57cb75={};_0x57cb75[_0xde4a('0x2b')]=_[_0xde4a('0x42')](db['FreshsalesConfiguration'][_0xde4a('0x27')]);_0x57cb75[_0xde4a('0x2c')]=_[_0xde4a('0x42')](_0x313bbb['query']);_0x57cb75[_0xde4a('0x36')]=_['intersection'](_0x57cb75['model'],_0x57cb75[_0xde4a('0x2c')]);_0x319afe['attributes']=_[_0xde4a('0x2d')](_0x57cb75[_0xde4a('0x2b')],qs[_0xde4a('0x2f')](_0x313bbb[_0xde4a('0x2c')][_0xde4a('0x2f')]));_0x319afe[_0xde4a('0x2e')]=_0x319afe['attributes'][_0xde4a('0x30')]?_0x319afe[_0xde4a('0x2e')]:_0x57cb75[_0xde4a('0x2b')];if(_0x313bbb[_0xde4a('0x2c')][_0xde4a('0x43')]){_0x319afe[_0xde4a('0x3d')]=[{'all':!![]}];}_0x319afe=_['merge']({},_0x319afe,_0x313bbb[_0xde4a('0x3b')]);return db[_0xde4a('0x3c')]['find'](_0x319afe)[_0xde4a('0x22')](handleEntityNotFound(_0x4491f3,null))[_0xde4a('0x22')](respondWithResult(_0x4491f3,null))[_0xde4a('0x44')](handleError(_0x4491f3,null));};exports['create']=function(_0x4f8001,_0x1b424b){return db[_0xde4a('0x3c')][_0xde4a('0x45')](_0x4f8001[_0xde4a('0x46')],{})[_0xde4a('0x22')](respondWithResult(_0x1b424b,0xc9))['catch'](handleError(_0x1b424b,null));};exports[_0xde4a('0x21')]=function(_0x206ce4,_0xd89f84){if(_0x206ce4[_0xde4a('0x46')]['id']){delete _0x206ce4[_0xde4a('0x46')]['id'];}return db[_0xde4a('0x3c')][_0xde4a('0x47')]({'where':{'id':_0x206ce4['params']['id']}})[_0xde4a('0x22')](handleEntityNotFound(_0xd89f84,null))[_0xde4a('0x22')](saveUpdates(_0x206ce4[_0xde4a('0x46')],null))[_0xde4a('0x22')](respondWithResult(_0xd89f84,null))[_0xde4a('0x44')](handleError(_0xd89f84,null));};exports[_0xde4a('0x23')]=function(_0x89e75f,_0x45c85d){return db[_0xde4a('0x3c')][_0xde4a('0x47')]({'where':{'id':_0x89e75f[_0xde4a('0x41')]['id']}})[_0xde4a('0x22')](handleEntityNotFound(_0x45c85d,null))[_0xde4a('0x22')](removeEntity(_0x45c85d,null))[_0xde4a('0x44')](handleError(_0x45c85d,null));};exports[_0xde4a('0x48')]=function(_0xc84a70,_0x41503b,_0xff9595){var _0x22b1db={};var _0xec25bb={};var _0x2452fe;var _0x121b41;return db[_0xde4a('0x3c')]['findOne']({'where':{'id':_0xc84a70['params']['id']}})['then'](handleEntityNotFound(_0x41503b,null))[_0xde4a('0x22')](function(_0x1b5889){if(_0x1b5889){_0x2452fe=_0x1b5889;_0xec25bb[_0xde4a('0x2b')]=_[_0xde4a('0x42')](db[_0xde4a('0x49')][_0xde4a('0x27')]);_0xec25bb[_0xde4a('0x2c')]=_[_0xde4a('0x42')](_0xc84a70[_0xde4a('0x2c')]);_0xec25bb['filters']=_['intersection'](_0xec25bb[_0xde4a('0x2b')],_0xec25bb[_0xde4a('0x2c')]);_0x22b1db['attributes']=_[_0xde4a('0x2d')](_0xec25bb['model'],qs[_0xde4a('0x2f')](_0xc84a70[_0xde4a('0x2c')][_0xde4a('0x2f')]));_0x22b1db['attributes']=_0x22b1db['attributes'][_0xde4a('0x30')]?_0x22b1db[_0xde4a('0x2e')]:_0xec25bb[_0xde4a('0x2b')];_0x22b1db['order']=qs[_0xde4a('0x34')](_0xc84a70[_0xde4a('0x2c')][_0xde4a('0x34')]);_0x22b1db[_0xde4a('0x35')]=qs['filters'](_['pick'](_0xc84a70[_0xde4a('0x2c')],_0xec25bb[_0xde4a('0x36')]));if(_0xc84a70[_0xde4a('0x2c')][_0xde4a('0x3a')]){_0x22b1db[_0xde4a('0x35')]=_[_0xde4a('0x38')](_0x22b1db['where'],{'$or':_[_0xde4a('0x26')](_0x22b1db['attributes'],function(_0x43ed0a){var _0x4adcd9={};_0x4adcd9[_0x43ed0a]={'$like':'%'+_0xc84a70[_0xde4a('0x2c')][_0xde4a('0x3a')]+'%'};return _0x4adcd9;})});}_0x22b1db=_[_0xde4a('0x38')]({},_0x22b1db,_0xc84a70[_0xde4a('0x3b')]);return _0x2452fe[_0xde4a('0x48')](_0x22b1db);}})[_0xde4a('0x22')](function(_0xe2f44b){if(_0xe2f44b){_0x121b41=_0xe2f44b['length'];if(!_0xc84a70[_0xde4a('0x2c')][_0xde4a('0x4a')]('nolimit')){_0x22b1db[_0xde4a('0x32')]=qs[_0xde4a('0x32')](_0xc84a70['query'][_0xde4a('0x32')]);_0x22b1db[_0xde4a('0x1d')]=qs['offset'](_0xc84a70[_0xde4a('0x2c')]['offset']);}return _0x2452fe[_0xde4a('0x48')](_0x22b1db);}})[_0xde4a('0x22')](function(_0x182208){if(_0x182208){return _0x182208?{'count':_0x121b41,'rows':_0x182208}:null;}})['then'](respondWithResult(_0x41503b,null))[_0xde4a('0x44')](handleError(_0x41503b,null));};exports['getDescriptions']=function(_0x5622f9,_0xa8f329,_0x9adef9){var _0x147c37={};var _0x30cd73={};var _0x1f5804;var _0x1318ad;return db[_0xde4a('0x3c')][_0xde4a('0x4b')]({'where':{'id':_0x5622f9[_0xde4a('0x41')]['id']}})[_0xde4a('0x22')](handleEntityNotFound(_0xa8f329,null))[_0xde4a('0x22')](function(_0x4682e4){if(_0x4682e4){_0x1f5804=_0x4682e4;_0x30cd73[_0xde4a('0x2b')]=_[_0xde4a('0x42')](db['FreshsalesField']['rawAttributes']);_0x30cd73[_0xde4a('0x2c')]=_[_0xde4a('0x42')](_0x5622f9[_0xde4a('0x2c')]);_0x30cd73[_0xde4a('0x36')]=_[_0xde4a('0x2d')](_0x30cd73['model'],_0x30cd73['query']);_0x147c37['attributes']=_[_0xde4a('0x2d')](_0x30cd73[_0xde4a('0x2b')],qs['fields'](_0x5622f9[_0xde4a('0x2c')][_0xde4a('0x2f')]));_0x147c37[_0xde4a('0x2e')]=_0x147c37['attributes'][_0xde4a('0x30')]?_0x147c37['attributes']:_0x30cd73[_0xde4a('0x2b')];_0x147c37[_0xde4a('0x33')]=qs[_0xde4a('0x34')](_0x5622f9[_0xde4a('0x2c')]['sort']);_0x147c37[_0xde4a('0x35')]=qs[_0xde4a('0x36')](_[_0xde4a('0x37')](_0x5622f9['query'],_0x30cd73[_0xde4a('0x36')]));if(_0x5622f9[_0xde4a('0x2c')][_0xde4a('0x3a')]){_0x147c37[_0xde4a('0x35')]=_[_0xde4a('0x38')](_0x147c37[_0xde4a('0x35')],{'$or':_[_0xde4a('0x26')](_0x147c37[_0xde4a('0x2e')],function(_0x36e6dd){var _0x2370c3={};_0x2370c3[_0x36e6dd]={'$like':'%'+_0x5622f9['query']['filter']+'%'};return _0x2370c3;})});}_0x147c37=_[_0xde4a('0x38')]({},_0x147c37,_0x5622f9['options']);return _0x1f5804[_0xde4a('0x4c')](_0x147c37);}})[_0xde4a('0x22')](function(_0xbb1fc){if(_0xbb1fc){_0x1318ad=_0xbb1fc['length'];if(!_0x5622f9[_0xde4a('0x2c')][_0xde4a('0x4a')](_0xde4a('0x31'))){_0x147c37['limit']=qs[_0xde4a('0x32')](_0x5622f9[_0xde4a('0x2c')][_0xde4a('0x32')]);_0x147c37[_0xde4a('0x1d')]=qs[_0xde4a('0x1d')](_0x5622f9['query'][_0xde4a('0x1d')]);}return _0x1f5804['getDescriptions'](_0x147c37);}})[_0xde4a('0x22')](function(_0x1f83e8){if(_0x1f83e8){return _0x1f83e8?{'count':_0x1318ad,'rows':_0x1f83e8}:null;}})['then'](respondWithResult(_0xa8f329,null))[_0xde4a('0x44')](handleError(_0xa8f329,null));};exports[_0xde4a('0x4d')]=function(_0x1c372a,_0x1d6e09,_0x2a2a10){var _0x2d4740={};var _0x146fc8={};var _0x5549dc;var _0x1fb4fd;return db['FreshsalesConfiguration'][_0xde4a('0x4b')]({'where':{'id':_0x1c372a[_0xde4a('0x41')]['id']}})[_0xde4a('0x22')](handleEntityNotFound(_0x1d6e09,null))[_0xde4a('0x22')](function(_0x50a16e){if(_0x50a16e){_0x5549dc=_0x50a16e;_0x146fc8['model']=_[_0xde4a('0x42')](db[_0xde4a('0x49')]['rawAttributes']);_0x146fc8[_0xde4a('0x2c')]=_['keys'](_0x1c372a[_0xde4a('0x2c')]);_0x146fc8[_0xde4a('0x36')]=_[_0xde4a('0x2d')](_0x146fc8[_0xde4a('0x2b')],_0x146fc8[_0xde4a('0x2c')]);_0x2d4740[_0xde4a('0x2e')]=_[_0xde4a('0x2d')](_0x146fc8[_0xde4a('0x2b')],qs['fields'](_0x1c372a[_0xde4a('0x2c')][_0xde4a('0x2f')]));_0x2d4740[_0xde4a('0x2e')]=_0x2d4740[_0xde4a('0x2e')][_0xde4a('0x30')]?_0x2d4740[_0xde4a('0x2e')]:_0x146fc8[_0xde4a('0x2b')];_0x2d4740[_0xde4a('0x33')]=qs[_0xde4a('0x34')](_0x1c372a['query'][_0xde4a('0x34')]);_0x2d4740[_0xde4a('0x35')]=qs['filters'](_['pick'](_0x1c372a[_0xde4a('0x2c')],_0x146fc8[_0xde4a('0x36')]));if(_0x1c372a['query'][_0xde4a('0x3a')]){_0x2d4740['where']=_['merge'](_0x2d4740[_0xde4a('0x35')],{'$or':_[_0xde4a('0x26')](_0x2d4740[_0xde4a('0x2e')],function(_0x3d06a9){var _0x195839={};_0x195839[_0x3d06a9]={'$like':'%'+_0x1c372a[_0xde4a('0x2c')][_0xde4a('0x3a')]+'%'};return _0x195839;})});}_0x2d4740=_[_0xde4a('0x38')]({},_0x2d4740,_0x1c372a[_0xde4a('0x3b')]);return _0x5549dc[_0xde4a('0x4d')](_0x2d4740);}})['then'](function(_0x1252d2){if(_0x1252d2){_0x1fb4fd=_0x1252d2['length'];if(!_0x1c372a[_0xde4a('0x2c')]['hasOwnProperty'](_0xde4a('0x31'))){_0x2d4740[_0xde4a('0x32')]=qs[_0xde4a('0x32')](_0x1c372a[_0xde4a('0x2c')]['limit']);_0x2d4740[_0xde4a('0x1d')]=qs[_0xde4a('0x1d')](_0x1c372a[_0xde4a('0x2c')][_0xde4a('0x1d')]);}return _0x5549dc['getFields'](_0x2d4740);}})['then'](function(_0x7ab5ea){if(_0x7ab5ea){return _0x7ab5ea?{'count':_0x1fb4fd,'rows':_0x7ab5ea}:null;}})[_0xde4a('0x22')](respondWithResult(_0x1d6e09,null))[_0xde4a('0x44')](handleError(_0x1d6e09,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 573f981..9db534b 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x414b=['request-promise','path','rimraf','../../config/environment','exports','define','FreshsalesConfiguration','int_freshsales_configurations','util','../../config/logger','moment','bluebird'];(function(_0x9fc88c,_0x18fbd2){var _0x9e6473=function(_0x3e4adb){while(--_0x3e4adb){_0x9fc88c['push'](_0x9fc88c['shift']());}};_0x9e6473(++_0x18fbd2);}(_0x414b,0x1c4));var _0xb414=function(_0x5b7b9c,_0x1b7f14){_0x5b7b9c=_0x5b7b9c-0x0;var _0x134213=_0x414b[_0x5b7b9c];return _0x134213;};'use strict';var _=require('lodash');var util=require(_0xb414('0x0'));var logger=require(_0xb414('0x1'))('api');var moment=require(_0xb414('0x2'));var BPromise=require(_0xb414('0x3'));var rp=require(_0xb414('0x4'));var fs=require('fs');var path=require(_0xb414('0x5'));var rimraf=require(_0xb414('0x6'));var config=require(_0xb414('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xb414('0x8')]=function(_0x39358f,_0x270775){return _0x39358f[_0xb414('0x9')](_0xb414('0xa'),attributes,{'tableName':_0xb414('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad5f=['api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','lodash','../../config/logger'];(function(_0x369f62,_0x17a354){var _0x323a6d=function(_0x4fc5cf){while(--_0x4fc5cf){_0x369f62['push'](_0x369f62['shift']());}};_0x323a6d(++_0x17a354);}(_0xad5f,0x127));var _0xfad5=function(_0x503a0c,_0xbc78c5){_0x503a0c=_0x503a0c-0x0;var _0x3b2e83=_0xad5f[_0x503a0c];return _0x3b2e83;};'use strict';var _=require(_0xfad5('0x0'));var util=require('util');var logger=require(_0xfad5('0x1'))(_0xfad5('0x2'));var moment=require(_0xfad5('0x3'));var BPromise=require(_0xfad5('0x4'));var rp=require(_0xfad5('0x5'));var fs=require('fs');var path=require(_0xfad5('0x6'));var rimraf=require('rimraf');var config=require(_0xfad5('0x7'));var attributes=require(_0xfad5('0x8'));module[_0xfad5('0x9')]=function(_0x49afc2,_0x235fa4){return _0x49afc2[_0xfad5('0xa')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 19c3ca8..2c67694 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94f5=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','stringify','error','FreshsalesConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5d39ea,_0x46afdd){var _0x17b40e=function(_0x2c51d6){while(--_0x2c51d6){_0x5d39ea['push'](_0x5d39ea['shift']());}};_0x17b40e(++_0x46afdd);}(_0x94f5,0xdf));var _0x594f=function(_0x50e250,_0x2d3b0b){_0x50e250=_0x50e250-0x0;var _0x355df3=_0x94f5[_0x50e250];return _0x355df3;};'use strict';var _=require(_0x594f('0x0'));var util=require(_0x594f('0x1'));var moment=require(_0x594f('0x2'));var BPromise=require(_0x594f('0x3'));var rs=require(_0x594f('0x4'));var fs=require('fs');var Redis=require(_0x594f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x594f('0x6'));var logger=require(_0x594f('0x7'))(_0x594f('0x8'));var config=require(_0x594f('0x9'));var jayson=require(_0x594f('0xa'));var client=jayson[_0x594f('0xb')][_0x594f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57333e,_0x1da3a9,_0x5c64bc){return new BPromise(function(_0x5a39fb,_0x3b2d43){return client[_0x594f('0xd')](_0x57333e,_0x5c64bc)['then'](function(_0x140734){logger[_0x594f('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1da3a9,_0x594f('0xf'));logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x1da3a9,_0x594f('0xf'),JSON[_0x594f('0x10')](_0x140734));if(_0x140734['error']){if(_0x140734[_0x594f('0x11')]['code']===0x1f4){logger[_0x594f('0x11')](_0x594f('0x12'),_0x1da3a9,_0x140734[_0x594f('0x11')][_0x594f('0x13')]);return _0x3b2d43(_0x140734[_0x594f('0x11')]['message']);}logger[_0x594f('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1da3a9,_0x140734[_0x594f('0x11')]['message']);return _0x5a39fb(_0x140734['error'][_0x594f('0x13')]);}else{logger[_0x594f('0xe')](_0x594f('0x12'),_0x1da3a9,_0x594f('0xf'));_0x5a39fb(_0x140734[_0x594f('0x14')][_0x594f('0x13')]);}})['catch'](function(_0x125cfe){logger[_0x594f('0x11')](_0x594f('0x12'),_0x1da3a9,_0x125cfe);_0x3b2d43(_0x125cfe);});});} \ No newline at end of file +var _0x0b76=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis'];(function(_0xa37a85,_0x5f0e39){var _0x6ff977=function(_0x4c9fa5){while(--_0x4c9fa5){_0xa37a85['push'](_0xa37a85['shift']());}};_0x6ff977(++_0x5f0e39);}(_0x0b76,0x18b));var _0x60b7=function(_0x105b38,_0x3ce5a3){_0x105b38=_0x105b38-0x0;var _0x2942b4=_0x0b76[_0x105b38];return _0x2942b4;};'use strict';var _=require('lodash');var util=require(_0x60b7('0x0'));var moment=require(_0x60b7('0x1'));var BPromise=require('bluebird');var rs=require(_0x60b7('0x2'));var fs=require('fs');var Redis=require(_0x60b7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x60b7('0x4'));var logger=require(_0x60b7('0x5'))(_0x60b7('0x6'));var config=require('../../config/environment');var jayson=require(_0x60b7('0x7'));var client=jayson[_0x60b7('0x8')][_0x60b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x353ec8,_0xe42b6b,_0x26d7ba){return new BPromise(function(_0x5a174b,_0x37dc0f){return client[_0x60b7('0xa')](_0x353ec8,_0x26d7ba)['then'](function(_0x4ae400){logger[_0x60b7('0xb')](_0x60b7('0xc'),_0xe42b6b,_0x60b7('0xd'));logger[_0x60b7('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0xe42b6b,_0x60b7('0xd'),JSON[_0x60b7('0xf')](_0x4ae400));if(_0x4ae400[_0x60b7('0x10')]){if(_0x4ae400[_0x60b7('0x10')][_0x60b7('0x11')]===0x1f4){logger[_0x60b7('0x10')](_0x60b7('0xc'),_0xe42b6b,_0x4ae400[_0x60b7('0x10')][_0x60b7('0x12')]);return _0x37dc0f(_0x4ae400[_0x60b7('0x10')][_0x60b7('0x12')]);}logger['error'](_0x60b7('0xc'),_0xe42b6b,_0x4ae400[_0x60b7('0x10')]['message']);return _0x5a174b(_0x4ae400[_0x60b7('0x10')]['message']);}else{logger['info'](_0x60b7('0xc'),_0xe42b6b,_0x60b7('0xd'));_0x5a174b(_0x4ae400[_0x60b7('0x13')][_0x60b7('0x12')]);}})[_0x60b7('0x14')](function(_0x1db86f){logger[_0x60b7('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xe42b6b,_0x1db86f);_0x37dc0f(_0x1db86f);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 562d8be..580872f 100644 --- a/server/api/intFreshsalesField/index.js +++ b/server/api/intFreshsalesField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x049e=['show','create','put','update','delete','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x560375,_0x5c597b){var _0xf0df57=function(_0x8d88b){while(--_0x8d88b){_0x560375['push'](_0x560375['shift']());}};_0xf0df57(++_0x5c597b);}(_0x049e,0x16a));var _0xe049=function(_0xb7a459,_0xc13228){_0xb7a459=_0xb7a459-0x0;var _0x104ab5=_0x049e[_0xb7a459];return _0x104ab5;};'use strict';var multer=require(_0xe049('0x0'));var util=require(_0xe049('0x1'));var path=require('path');var timeout=require(_0xe049('0x2'));var express=require('express');var router=express[_0xe049('0x3')]();var fs_extra=require(_0xe049('0x4'));var auth=require(_0xe049('0x5'));var interaction=require(_0xe049('0x6'));var config=require(_0xe049('0x7'));var controller=require('./intFreshsalesField.controller');router[_0xe049('0x8')]('/',auth[_0xe049('0x9')](),controller[_0xe049('0xa')]);router[_0xe049('0x8')](_0xe049('0xb'),auth[_0xe049('0x9')](),controller[_0xe049('0xc')]);router['post']('/',auth[_0xe049('0x9')](),controller[_0xe049('0xd')]);router[_0xe049('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xe049('0xf')]);router[_0xe049('0x10')](_0xe049('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xac7f=['/:id','isAuthenticated','post','create','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','index'];(function(_0x19180a,_0x44aae7){var _0x1c5392=function(_0x4b62c1){while(--_0x4b62c1){_0x19180a['push'](_0x19180a['shift']());}};_0x1c5392(++_0x44aae7);}(_0xac7f,0x1e2));var _0xfac7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xac7f[_0x432682];return _0x463d05;};'use strict';var multer=require(_0xfac7('0x0'));var util=require('util');var path=require(_0xfac7('0x1'));var timeout=require(_0xfac7('0x2'));var express=require(_0xfac7('0x3'));var router=express['Router']();var fs_extra=require(_0xfac7('0x4'));var auth=require(_0xfac7('0x5'));var interaction=require(_0xfac7('0x6'));var config=require(_0xfac7('0x7'));var controller=require(_0xfac7('0x8'));router[_0xfac7('0x9')]('/',auth['isAuthenticated'](),controller[_0xfac7('0xa')]);router['get'](_0xfac7('0xb'),auth[_0xfac7('0xc')](),controller['show']);router[_0xfac7('0xd')]('/',auth[_0xfac7('0xc')](),controller[_0xfac7('0xe')]);router['put'](_0xfac7('0xb'),auth[_0xfac7('0xc')](),controller['update']);router['delete'](_0xfac7('0xb'),auth[_0xfac7('0xc')](),controller[_0xfac7('0xf')]);module[_0xfac7('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 1755b32..82bdbfa 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.attributes.js +++ b/server/api/intFreshsalesField/intFreshsalesField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5422=['customVariable','picklist','STRING','string','exports','ENUM','variable'];(function(_0x4fdc5f,_0x425bfe){var _0x4c10c7=function(_0x3f4c3d){while(--_0x3f4c3d){_0x4fdc5f['push'](_0x4fdc5f['shift']());}};_0x4c10c7(++_0x425bfe);}(_0x5422,0xc1));var _0x2542=function(_0x58db20,_0xb7f9e){_0x58db20=_0x58db20-0x0;var _0x2dc5a2=_0x5422[_0x58db20];return _0x2dc5a2;};'use strict';var Sequelize=require('sequelize');module[_0x2542('0x0')]={'type':{'type':Sequelize[_0x2542('0x1')]('string',_0x2542('0x2'),_0x2542('0x3'),'keyValue',_0x2542('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2542('0x5')]},'key':{'type':Sequelize[_0x2542('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x2542('0x6'),_0x2542('0x2'),_0x2542('0x3'))},'keyContent':{'type':Sequelize[_0x2542('0x5')]},'idField':{'type':Sequelize[_0x2542('0x5')]},'nameField':{'type':Sequelize[_0x2542('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2542('0x5')]}}; \ No newline at end of file +var _0x85b9=['variable','customVariable','BOOLEAN','sequelize','exports','string','keyValue','picklist','STRING','ENUM'];(function(_0x3c5cb5,_0x48a57c){var _0xa2fe61=function(_0x7eaa6){while(--_0x7eaa6){_0x3c5cb5['push'](_0x3c5cb5['shift']());}};_0xa2fe61(++_0x48a57c);}(_0x85b9,0x1e3));var _0x985b=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x85b9[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0x985b('0x0'));module[_0x985b('0x1')]={'type':{'type':Sequelize['ENUM'](_0x985b('0x2'),'variable','customVariable',_0x985b('0x3'),_0x985b('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x985b('0x5')]},'key':{'type':Sequelize[_0x985b('0x5')]},'keyType':{'type':Sequelize[_0x985b('0x6')](_0x985b('0x2'),_0x985b('0x7'),_0x985b('0x8'))},'keyContent':{'type':Sequelize[_0x985b('0x5')]},'idField':{'type':Sequelize[_0x985b('0x5')]},'nameField':{'type':Sequelize[_0x985b('0x5')]},'customField':{'type':Sequelize[_0x985b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x985b('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 1458ccf..2c0adc2 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.controller.js +++ b/server/api/intFreshsalesField/intFreshsalesField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7f0=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','name','send','index','FreshsalesField','rawAttributes','fieldName','type','query','filters','model','intersection','fields','attributes','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x339711,_0x29c2bb){var _0x121590=function(_0x4e62dc){while(--_0x4e62dc){_0x339711['push'](_0x339711['shift']());}};_0x121590(++_0x29c2bb);}(_0xf7f0,0x113));var _0x0f7f=function(_0x59bed0,_0xad50a5){_0x59bed0=_0x59bed0-0x0;var _0x2e5d4c=_0xf7f0[_0x59bed0];return _0x2e5d4c;};'use strict';var emlformat=require(_0x0f7f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0f7f('0x1'));var moment=require(_0x0f7f('0x2'));var BPromise=require(_0x0f7f('0x3'));var Mustache=require(_0x0f7f('0x4'));var util=require(_0x0f7f('0x5'));var path=require(_0x0f7f('0x6'));var sox=require(_0x0f7f('0x7'));var csv=require(_0x0f7f('0x8'));var ejs=require(_0x0f7f('0x9'));var fs=require('fs');var fs_extra=require(_0x0f7f('0xa'));var _=require(_0x0f7f('0xb'));var squel=require(_0x0f7f('0xc'));var crypto=require(_0x0f7f('0xd'));var jsforce=require(_0x0f7f('0xe'));var deskjs=require(_0x0f7f('0xf'));var toCsv=require(_0x0f7f('0x8'));var querystring=require(_0x0f7f('0x10'));var Papa=require(_0x0f7f('0x11'));var Redis=require('ioredis');var authService=require(_0x0f7f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0f7f('0x13'));var hardwareService=require(_0x0f7f('0x14'));var logger=require(_0x0f7f('0x15'))('api');var utils=require(_0x0f7f('0x16'));var config=require(_0x0f7f('0x17'));var licenseUtil=require(_0x0f7f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x579c65,_0x481961){_0x481961=_0x481961||0xcc;return function(_0x413ba3){if(_0x413ba3){return _0x579c65[_0x0f7f('0x19')](_0x481961);}return _0x579c65[_0x0f7f('0x1a')](_0x481961)[_0x0f7f('0x1b')]();};}function respondWithResult(_0x36c535,_0x280464){_0x280464=_0x280464||0xc8;return function(_0x5df588){if(_0x5df588){return _0x36c535[_0x0f7f('0x1a')](_0x280464)[_0x0f7f('0x1c')](_0x5df588);}};}function respondWithFilteredResult(_0x2d612b,_0x443c73){return function(_0x3aa7cf){if(_0x3aa7cf){var _0x17d24d=typeof _0x443c73['offset']===_0x0f7f('0x1d')&&typeof _0x443c73[_0x0f7f('0x1e')]===_0x0f7f('0x1d');var _0x479050=_0x3aa7cf[_0x0f7f('0x1f')];var _0x5b8769=_0x17d24d?0x0:_0x443c73[_0x0f7f('0x20')];var _0x3604d3=_0x17d24d?_0x3aa7cf[_0x0f7f('0x1f')]:_0x443c73[_0x0f7f('0x20')]+_0x443c73[_0x0f7f('0x1e')];var _0x17e0fe;if(_0x3604d3>=_0x479050){_0x3604d3=_0x479050;_0x17e0fe=0xc8;}else{_0x17e0fe=0xce;}_0x2d612b[_0x0f7f('0x1a')](_0x17e0fe);return _0x2d612b[_0x0f7f('0x21')]('Content-Range',_0x5b8769+'-'+_0x3604d3+'/'+_0x479050)[_0x0f7f('0x1c')](_0x3aa7cf);}return null;};}function patchUpdates(_0x425392){return function(_0x21c43e){try{jsonpatch[_0x0f7f('0x22')](_0x21c43e,_0x425392,!![]);}catch(_0x284843){return BPromise[_0x0f7f('0x23')](_0x284843);}return _0x21c43e[_0x0f7f('0x24')]();};}function saveUpdates(_0x5d7023,_0x104ec0){return function(_0xc2625){if(_0xc2625){return _0xc2625[_0x0f7f('0x25')](_0x5d7023)['then'](function(_0x3d562b){return _0x3d562b;});}return null;};}function removeEntity(_0x430326,_0x5a93df){return function(_0x3ca422){if(_0x3ca422){return _0x3ca422[_0x0f7f('0x26')]()[_0x0f7f('0x27')](function(){_0x430326['status'](0xcc)[_0x0f7f('0x1b')]();});}};}function handleEntityNotFound(_0x23f034,_0x124603){return function(_0x22dab4){if(!_0x22dab4){_0x23f034[_0x0f7f('0x19')](0x194);}return _0x22dab4;};}function handleError(_0x228237,_0x27b000){_0x27b000=_0x27b000||0x1f4;return function(_0xe5b7f8){logger['error'](_0xe5b7f8['stack']);if(_0xe5b7f8[_0x0f7f('0x28')]){delete _0xe5b7f8[_0x0f7f('0x28')];}_0x228237['status'](_0x27b000)[_0x0f7f('0x29')](_0xe5b7f8);};}exports[_0x0f7f('0x2a')]=function(_0x124616,_0x5892d1){var _0x4130c3={},_0x2cbdec={},_0x143e24={'count':0x0,'rows':[]};var _0x19c813=_['map'](db[_0x0f7f('0x2b')][_0x0f7f('0x2c')],function(_0x38eea2){return{'name':_0x38eea2[_0x0f7f('0x2d')],'type':_0x38eea2[_0x0f7f('0x2e')]['key']};});_0x2cbdec['model']=_['map'](_0x19c813,'name');_0x2cbdec[_0x0f7f('0x2f')]=_['keys'](_0x124616[_0x0f7f('0x2f')]);_0x2cbdec[_0x0f7f('0x30')]=_['intersection'](_0x2cbdec[_0x0f7f('0x31')],_0x2cbdec[_0x0f7f('0x2f')]);_0x4130c3['attributes']=_[_0x0f7f('0x32')](_0x2cbdec[_0x0f7f('0x31')],qs[_0x0f7f('0x33')](_0x124616[_0x0f7f('0x2f')][_0x0f7f('0x33')]));_0x4130c3[_0x0f7f('0x34')]=_0x4130c3[_0x0f7f('0x34')][_0x0f7f('0x35')]?_0x4130c3[_0x0f7f('0x34')]:_0x2cbdec[_0x0f7f('0x31')];if(!_0x124616[_0x0f7f('0x2f')]['hasOwnProperty'](_0x0f7f('0x36'))){_0x4130c3[_0x0f7f('0x1e')]=qs[_0x0f7f('0x1e')](_0x124616[_0x0f7f('0x2f')][_0x0f7f('0x1e')]);_0x4130c3[_0x0f7f('0x20')]=qs[_0x0f7f('0x20')](_0x124616[_0x0f7f('0x2f')]['offset']);}_0x4130c3[_0x0f7f('0x37')]=qs['sort'](_0x124616[_0x0f7f('0x2f')][_0x0f7f('0x38')]);_0x4130c3['where']=qs[_0x0f7f('0x30')](_['pick'](_0x124616[_0x0f7f('0x2f')],_0x2cbdec[_0x0f7f('0x30')]),_0x19c813);if(_0x124616[_0x0f7f('0x2f')][_0x0f7f('0x39')]){_0x4130c3[_0x0f7f('0x3a')]=_[_0x0f7f('0x3b')](_0x4130c3[_0x0f7f('0x3a')],{'$or':_['map'](_0x19c813,function(_0x3f4513){if(_0x3f4513['type']!==_0x0f7f('0x3c')){var _0x24e24c={};_0x24e24c[_0x3f4513[_0x0f7f('0x28')]]={'$like':'%'+_0x124616['query']['filter']+'%'};return _0x24e24c;}})});}_0x4130c3=_[_0x0f7f('0x3b')]({},_0x4130c3,_0x124616[_0x0f7f('0x3d')]);var _0x4fb171={'where':_0x4130c3['where']};return db[_0x0f7f('0x2b')]['count'](_0x4fb171)[_0x0f7f('0x27')](function(_0x4a3746){_0x143e24[_0x0f7f('0x1f')]=_0x4a3746;if(_0x124616[_0x0f7f('0x2f')]['includeAll']){_0x4130c3[_0x0f7f('0x3e')]=[{'all':!![]}];}return db[_0x0f7f('0x2b')][_0x0f7f('0x3f')](_0x4130c3);})[_0x0f7f('0x27')](function(_0x38e211){_0x143e24[_0x0f7f('0x40')]=_0x38e211;return _0x143e24;})[_0x0f7f('0x27')](respondWithFilteredResult(_0x5892d1,_0x4130c3))[_0x0f7f('0x41')](handleError(_0x5892d1,null));};exports[_0x0f7f('0x42')]=function(_0x89bc74,_0x5c6c3a){var _0x17d8b8={'raw':!![],'where':{'id':_0x89bc74[_0x0f7f('0x43')]['id']}},_0x1f33cd={};_0x1f33cd['model']=_[_0x0f7f('0x44')](db[_0x0f7f('0x2b')][_0x0f7f('0x2c')]);_0x1f33cd[_0x0f7f('0x2f')]=_[_0x0f7f('0x44')](_0x89bc74[_0x0f7f('0x2f')]);_0x1f33cd[_0x0f7f('0x30')]=_['intersection'](_0x1f33cd[_0x0f7f('0x31')],_0x1f33cd[_0x0f7f('0x2f')]);_0x17d8b8[_0x0f7f('0x34')]=_[_0x0f7f('0x32')](_0x1f33cd[_0x0f7f('0x31')],qs[_0x0f7f('0x33')](_0x89bc74[_0x0f7f('0x2f')][_0x0f7f('0x33')]));_0x17d8b8['attributes']=_0x17d8b8[_0x0f7f('0x34')][_0x0f7f('0x35')]?_0x17d8b8['attributes']:_0x1f33cd[_0x0f7f('0x31')];if(_0x89bc74['query'][_0x0f7f('0x45')]){_0x17d8b8[_0x0f7f('0x3e')]=[{'all':!![]}];}_0x17d8b8=_[_0x0f7f('0x3b')]({},_0x17d8b8,_0x89bc74['options']);return db[_0x0f7f('0x2b')][_0x0f7f('0x46')](_0x17d8b8)[_0x0f7f('0x27')](handleEntityNotFound(_0x5c6c3a,null))[_0x0f7f('0x27')](respondWithResult(_0x5c6c3a,null))['catch'](handleError(_0x5c6c3a,null));};exports[_0x0f7f('0x47')]=function(_0x3eaa55,_0x3dd83f){return db[_0x0f7f('0x2b')]['create'](_0x3eaa55[_0x0f7f('0x48')],{})[_0x0f7f('0x27')](respondWithResult(_0x3dd83f,0xc9))[_0x0f7f('0x41')](handleError(_0x3dd83f,null));};exports[_0x0f7f('0x25')]=function(_0x7558fe,_0x2d93bf){if(_0x7558fe[_0x0f7f('0x48')]['id']){delete _0x7558fe[_0x0f7f('0x48')]['id'];}return db[_0x0f7f('0x2b')][_0x0f7f('0x46')]({'where':{'id':_0x7558fe[_0x0f7f('0x43')]['id']}})['then'](handleEntityNotFound(_0x2d93bf,null))[_0x0f7f('0x27')](saveUpdates(_0x7558fe['body'],null))[_0x0f7f('0x27')](respondWithResult(_0x2d93bf,null))['catch'](handleError(_0x2d93bf,null));};exports['destroy']=function(_0x270eb3,_0xf857da){return db[_0x0f7f('0x2b')][_0x0f7f('0x46')]({'where':{'id':_0x270eb3['params']['id']}})[_0x0f7f('0x27')](handleEntityNotFound(_0xf857da,null))[_0x0f7f('0x27')](removeEntity(_0xf857da,null))['catch'](handleError(_0xf857da,null));}; \ No newline at end of file +var _0x91d9=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../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','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','create','body','find','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash'];(function(_0x2b9c17,_0xc8ac81){var _0x28711d=function(_0x135903){while(--_0x135903){_0x2b9c17['push'](_0x2b9c17['shift']());}};_0x28711d(++_0xc8ac81);}(_0x91d9,0x168));var _0x991d=function(_0x4f0cd8,_0x2d847c){_0x4f0cd8=_0x4f0cd8-0x0;var _0x1e69c3=_0x91d9[_0x4f0cd8];return _0x1e69c3;};'use strict';var emlformat=require(_0x991d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x991d('0x1'));var jsonpatch=require(_0x991d('0x2'));var rp=require('request-promise');var moment=require(_0x991d('0x3'));var BPromise=require(_0x991d('0x4'));var Mustache=require(_0x991d('0x5'));var util=require(_0x991d('0x6'));var path=require('path');var sox=require(_0x991d('0x7'));var csv=require('to-csv');var ejs=require(_0x991d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x991d('0x9'));var squel=require('squel');var crypto=require(_0x991d('0xa'));var jsforce=require(_0x991d('0xb'));var deskjs=require(_0x991d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x991d('0xd'));var Papa=require(_0x991d('0xe'));var Redis=require('ioredis');var authService=require(_0x991d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x991d('0x10'));var hardwareService=require(_0x991d('0x11'));var logger=require(_0x991d('0x12'))(_0x991d('0x13'));var utils=require('../../config/utils');var config=require(_0x991d('0x14'));var licenseUtil=require(_0x991d('0x15'));var db=require(_0x991d('0x16'))['db'];function respondWithStatusCode(_0x14288f,_0x8e847c){_0x8e847c=_0x8e847c||0xcc;return function(_0x26a6c5){if(_0x26a6c5){return _0x14288f[_0x991d('0x17')](_0x8e847c);}return _0x14288f[_0x991d('0x18')](_0x8e847c)[_0x991d('0x19')]();};}function respondWithResult(_0x28a941,_0x1aff33){_0x1aff33=_0x1aff33||0xc8;return function(_0x1331ef){if(_0x1331ef){return _0x28a941[_0x991d('0x18')](_0x1aff33)[_0x991d('0x1a')](_0x1331ef);}};}function respondWithFilteredResult(_0x33c38c,_0x168d7e){return function(_0x26b789){if(_0x26b789){var _0x5797f8=typeof _0x168d7e[_0x991d('0x1b')]===_0x991d('0x1c')&&typeof _0x168d7e[_0x991d('0x1d')]===_0x991d('0x1c');var _0x39a344=_0x26b789[_0x991d('0x1e')];var _0x256565=_0x5797f8?0x0:_0x168d7e[_0x991d('0x1b')];var _0x4b3634=_0x5797f8?_0x26b789[_0x991d('0x1e')]:_0x168d7e[_0x991d('0x1b')]+_0x168d7e[_0x991d('0x1d')];var _0x3cf757;if(_0x4b3634>=_0x39a344){_0x4b3634=_0x39a344;_0x3cf757=0xc8;}else{_0x3cf757=0xce;}_0x33c38c[_0x991d('0x18')](_0x3cf757);return _0x33c38c[_0x991d('0x1f')](_0x991d('0x20'),_0x256565+'-'+_0x4b3634+'/'+_0x39a344)['json'](_0x26b789);}return null;};}function patchUpdates(_0x2414dd){return function(_0x5b5f0b){try{jsonpatch['apply'](_0x5b5f0b,_0x2414dd,!![]);}catch(_0x1f27be){return BPromise[_0x991d('0x21')](_0x1f27be);}return _0x5b5f0b[_0x991d('0x22')]();};}function saveUpdates(_0x206f0b,_0x260cec){return function(_0x332cc9){if(_0x332cc9){return _0x332cc9[_0x991d('0x23')](_0x206f0b)[_0x991d('0x24')](function(_0x193da9){return _0x193da9;});}return null;};}function removeEntity(_0x1adf46,_0x5c3e0a){return function(_0x5585c9){if(_0x5585c9){return _0x5585c9[_0x991d('0x25')]()[_0x991d('0x24')](function(){_0x1adf46[_0x991d('0x18')](0xcc)[_0x991d('0x19')]();});}};}function handleEntityNotFound(_0x58a597,_0x46d598){return function(_0x3f01f6){if(!_0x3f01f6){_0x58a597[_0x991d('0x17')](0x194);}return _0x3f01f6;};}function handleError(_0x45296f,_0x374ec5){_0x374ec5=_0x374ec5||0x1f4;return function(_0x53153d){logger[_0x991d('0x26')](_0x53153d[_0x991d('0x27')]);if(_0x53153d[_0x991d('0x28')]){delete _0x53153d[_0x991d('0x28')];}_0x45296f[_0x991d('0x18')](_0x374ec5)[_0x991d('0x29')](_0x53153d);};}exports[_0x991d('0x2a')]=function(_0x41a1e2,_0x5a0f78){var _0x257bfa={},_0x8fc72d={},_0x4a3ada={'count':0x0,'rows':[]};var _0x417f8b=_[_0x991d('0x2b')](db[_0x991d('0x2c')][_0x991d('0x2d')],function(_0x1fde42){return{'name':_0x1fde42[_0x991d('0x2e')],'type':_0x1fde42[_0x991d('0x2f')][_0x991d('0x30')]};});_0x8fc72d[_0x991d('0x31')]=_[_0x991d('0x2b')](_0x417f8b,_0x991d('0x28'));_0x8fc72d[_0x991d('0x32')]=_[_0x991d('0x33')](_0x41a1e2[_0x991d('0x32')]);_0x8fc72d[_0x991d('0x34')]=_['intersection'](_0x8fc72d['model'],_0x8fc72d['query']);_0x257bfa[_0x991d('0x35')]=_[_0x991d('0x36')](_0x8fc72d[_0x991d('0x31')],qs[_0x991d('0x37')](_0x41a1e2[_0x991d('0x32')][_0x991d('0x37')]));_0x257bfa[_0x991d('0x35')]=_0x257bfa[_0x991d('0x35')][_0x991d('0x38')]?_0x257bfa[_0x991d('0x35')]:_0x8fc72d[_0x991d('0x31')];if(!_0x41a1e2[_0x991d('0x32')][_0x991d('0x39')]('nolimit')){_0x257bfa['limit']=qs[_0x991d('0x1d')](_0x41a1e2[_0x991d('0x32')][_0x991d('0x1d')]);_0x257bfa[_0x991d('0x1b')]=qs['offset'](_0x41a1e2['query']['offset']);}_0x257bfa[_0x991d('0x3a')]=qs[_0x991d('0x3b')](_0x41a1e2[_0x991d('0x32')][_0x991d('0x3b')]);_0x257bfa[_0x991d('0x3c')]=qs[_0x991d('0x34')](_['pick'](_0x41a1e2[_0x991d('0x32')],_0x8fc72d[_0x991d('0x34')]),_0x417f8b);if(_0x41a1e2['query'][_0x991d('0x3d')]){_0x257bfa['where']=_['merge'](_0x257bfa[_0x991d('0x3c')],{'$or':_[_0x991d('0x2b')](_0x417f8b,function(_0x26cdfa){if(_0x26cdfa[_0x991d('0x2f')]!==_0x991d('0x3e')){var _0x482157={};_0x482157[_0x26cdfa['name']]={'$like':'%'+_0x41a1e2['query']['filter']+'%'};return _0x482157;}})});}_0x257bfa=_['merge']({},_0x257bfa,_0x41a1e2[_0x991d('0x3f')]);var _0x14bcb5={'where':_0x257bfa['where']};return db[_0x991d('0x2c')][_0x991d('0x1e')](_0x14bcb5)[_0x991d('0x24')](function(_0x305b71){_0x4a3ada['count']=_0x305b71;if(_0x41a1e2['query'][_0x991d('0x40')]){_0x257bfa['include']=[{'all':!![]}];}return db[_0x991d('0x2c')][_0x991d('0x41')](_0x257bfa);})[_0x991d('0x24')](function(_0xbdabf0){_0x4a3ada[_0x991d('0x42')]=_0xbdabf0;return _0x4a3ada;})[_0x991d('0x24')](respondWithFilteredResult(_0x5a0f78,_0x257bfa))[_0x991d('0x43')](handleError(_0x5a0f78,null));};exports[_0x991d('0x44')]=function(_0x1dbd43,_0x30bbac){var _0x43e9df={'raw':!![],'where':{'id':_0x1dbd43['params']['id']}},_0xfff1fc={};_0xfff1fc['model']=_[_0x991d('0x33')](db[_0x991d('0x2c')]['rawAttributes']);_0xfff1fc['query']=_[_0x991d('0x33')](_0x1dbd43['query']);_0xfff1fc['filters']=_[_0x991d('0x36')](_0xfff1fc[_0x991d('0x31')],_0xfff1fc[_0x991d('0x32')]);_0x43e9df['attributes']=_['intersection'](_0xfff1fc['model'],qs[_0x991d('0x37')](_0x1dbd43['query'][_0x991d('0x37')]));_0x43e9df['attributes']=_0x43e9df[_0x991d('0x35')][_0x991d('0x38')]?_0x43e9df[_0x991d('0x35')]:_0xfff1fc[_0x991d('0x31')];if(_0x1dbd43[_0x991d('0x32')]['includeAll']){_0x43e9df[_0x991d('0x45')]=[{'all':!![]}];}_0x43e9df=_['merge']({},_0x43e9df,_0x1dbd43[_0x991d('0x3f')]);return db[_0x991d('0x2c')]['find'](_0x43e9df)[_0x991d('0x24')](handleEntityNotFound(_0x30bbac,null))[_0x991d('0x24')](respondWithResult(_0x30bbac,null))[_0x991d('0x43')](handleError(_0x30bbac,null));};exports[_0x991d('0x46')]=function(_0x1f5c0d,_0x8119c3){return db[_0x991d('0x2c')]['create'](_0x1f5c0d['body'],{})['then'](respondWithResult(_0x8119c3,0xc9))[_0x991d('0x43')](handleError(_0x8119c3,null));};exports[_0x991d('0x23')]=function(_0x15479e,_0x2ebdcd){if(_0x15479e['body']['id']){delete _0x15479e[_0x991d('0x47')]['id'];}return db[_0x991d('0x2c')][_0x991d('0x48')]({'where':{'id':_0x15479e[_0x991d('0x49')]['id']}})[_0x991d('0x24')](handleEntityNotFound(_0x2ebdcd,null))[_0x991d('0x24')](saveUpdates(_0x15479e[_0x991d('0x47')],null))[_0x991d('0x24')](respondWithResult(_0x2ebdcd,null))[_0x991d('0x43')](handleError(_0x2ebdcd,null));};exports['destroy']=function(_0x2bb536,_0x49b4b5){return db['FreshsalesField'][_0x991d('0x48')]({'where':{'id':_0x2bb536[_0x991d('0x49')]['id']}})[_0x991d('0x24')](handleEntityNotFound(_0x49b4b5,null))[_0x991d('0x24')](removeEntity(_0x49b4b5,null))['catch'](handleError(_0x49b4b5,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 2bc2930..4211f8c 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.model.js +++ b/server/api/intFreshsalesField/intFreshsalesField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb875=['moment','request-promise','path','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash'];(function(_0x4c536a,_0x54577c){var _0x38bbd4=function(_0x5c2f48){while(--_0x5c2f48){_0x4c536a['push'](_0x4c536a['shift']());}};_0x38bbd4(++_0x54577c);}(_0xb875,0x167));var _0x5b87=function(_0x24ff61,_0x549c55){_0x24ff61=_0x24ff61-0x0;var _0x3e9fe2=_0xb875[_0x24ff61];return _0x3e9fe2;};'use strict';var _=require(_0x5b87('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5b87('0x1'));var BPromise=require('bluebird');var rp=require(_0x5b87('0x2'));var fs=require('fs');var path=require(_0x5b87('0x3'));var rimraf=require('rimraf');var config=require(_0x5b87('0x4'));var attributes=require(_0x5b87('0x5'));module[_0x5b87('0x6')]=function(_0x32ed83,_0x253d91){return _0x32ed83[_0x5b87('0x7')](_0x5b87('0x8'),attributes,{'tableName':_0x5b87('0x9'),'paranoid':![],'indexes':[{'name':_0x5b87('0xa'),'fields':[_0x5b87('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6f83=['idField','FieldId','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index'];(function(_0x393572,_0x1e7928){var _0x482e23=function(_0x5c8e0c){while(--_0x5c8e0c){_0x393572['push'](_0x393572['shift']());}};_0x482e23(++_0x1e7928);}(_0x6f83,0x72));var _0x36f8=function(_0x4a5a30,_0x55859b){_0x4a5a30=_0x4a5a30-0x0;var _0xb08a8d=_0x6f83[_0x4a5a30];return _0xb08a8d;};'use strict';var _=require('lodash');var util=require(_0x36f8('0x0'));var logger=require(_0x36f8('0x1'))('api');var moment=require(_0x36f8('0x2'));var BPromise=require(_0x36f8('0x3'));var rp=require(_0x36f8('0x4'));var fs=require('fs');var path=require(_0x36f8('0x5'));var rimraf=require(_0x36f8('0x6'));var config=require(_0x36f8('0x7'));var attributes=require(_0x36f8('0x8'));module[_0x36f8('0x9')]=function(_0x31ff95,_0x3b9620){return _0x31ff95[_0x36f8('0xa')](_0x36f8('0xb'),attributes,{'tableName':_0x36f8('0xc'),'paranoid':![],'indexes':[{'name':_0x36f8('0xd'),'fields':[_0x36f8('0xe'),_0x36f8('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 10865ad..3fd8ccc 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js +++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfcf0=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','bluebird'];(function(_0x1e5cc3,_0x238a87){var _0x15c596=function(_0x27bb04){while(--_0x27bb04){_0x1e5cc3['push'](_0x1e5cc3['shift']());}};_0x15c596(++_0x238a87);}(_0xfcf0,0x138));var _0x0fcf=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xfcf0[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x61bbb9,_0x2dfdf8,_0x50c575){return new BPromise(function(_0x1388d1,_0x6ced94){return client[_0x0fcf('0xc')](_0x61bbb9,_0x50c575)['then'](function(_0x69a840){logger[_0x0fcf('0xd')](_0x0fcf('0xe'),_0x2dfdf8,'request\x20sent');logger[_0x0fcf('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2dfdf8,_0x0fcf('0x10'),JSON[_0x0fcf('0x11')](_0x69a840));if(_0x69a840[_0x0fcf('0x12')]){if(_0x69a840['error']['code']===0x1f4){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x6ced94(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x1388d1(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}else{logger['info'](_0x0fcf('0xe'),_0x2dfdf8,_0x0fcf('0x10'));_0x1388d1(_0x69a840[_0x0fcf('0x14')][_0x0fcf('0x13')]);}})['catch'](function(_0x3e78d0){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x3e78d0);_0x6ced94(_0x3e78d0);});});} \ No newline at end of file +var _0xb4c7=['client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3ee653,_0x174b2c){var _0x4701bf=function(_0x580227){while(--_0x580227){_0x3ee653['push'](_0x3ee653['shift']());}};_0x4701bf(++_0x174b2c);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x26fd94,_0xef4e81){_0x26fd94=_0x26fd94-0x0;var _0x5df614=_0xb4c7[_0x26fd94];return _0x5df614;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var moment=require(_0x7b4c('0x2'));var BPromise=require(_0x7b4c('0x3'));var rs=require(_0x7b4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b4c('0x5'))['db'];var utils=require(_0x7b4c('0x6'));var logger=require(_0x7b4c('0x7'))(_0x7b4c('0x8'));var config=require(_0x7b4c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7b4c('0xa')][_0x7b4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd5c7,_0x4bf85d,_0x2d7b7e){return new BPromise(function(_0x21687f,_0x570daa){return client[_0x7b4c('0xc')](_0x2dd5c7,_0x2d7b7e)[_0x7b4c('0xd')](function(_0x28e902){logger[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x4bf85d,_0x7b4c('0x10'));logger[_0x7b4c('0x11')](_0x7b4c('0x12'),_0x4bf85d,_0x7b4c('0x10'),JSON[_0x7b4c('0x13')](_0x28e902));if(_0x28e902['error']){if(_0x28e902['error'][_0x7b4c('0x14')]===0x1f4){logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);return _0x570daa(_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);}logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x28e902[_0x7b4c('0x15')]['message']);return _0x21687f(_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);}else{logger[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x4bf85d,_0x7b4c('0x10'));_0x21687f(_0x28e902[_0x7b4c('0x17')][_0x7b4c('0x16')]);}})[_0x7b4c('0x18')](function(_0x4d3f5e){logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x4d3f5e);_0x570daa(_0x4d3f5e);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 198f594..355ee64 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x51f2bc,_0x394c29){var _0x60c7fd=function(_0x44b188){while(--_0x44b188){_0x51f2bc['push'](_0x51f2bc['shift']());}};_0x60c7fd(++_0x394c29);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _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(_0x2a250e,_0x157fb4){var _0x4d7203=function(_0x12df8d){while(--_0x12df8d){_0x2a250e['push'](_0x2a250e['shift']());}};_0x4d7203(++_0x157fb4);}(_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 diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 6c4999a..271a9d0 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe558=['sequelize','exports','STRING','username','ENUM','integrationTab','newTab'];(function(_0x4a9ac6,_0x300ffe){var _0x88b87e=function(_0x4a18de){while(--_0x4a18de){_0x4a9ac6['push'](_0x4a9ac6['shift']());}};_0x88b87e(++_0x300ffe);}(_0xe558,0x70));var _0x8e55=function(_0x32e59a,_0x31d7ee){_0x32e59a=_0x32e59a-0x0;var _0x37c349=_0xe558[_0x32e59a];return _0x37c349;};'use strict';var Sequelize=require(_0x8e55('0x0'));module[_0x8e55('0x1')]={'name':{'type':Sequelize[_0x8e55('0x2')]},'description':{'type':Sequelize[_0x8e55('0x2')]},'username':{'type':Sequelize[_0x8e55('0x2')],'unique':_0x8e55('0x3')},'remoteUri':{'type':Sequelize[_0x8e55('0x2')]},'password':{'type':Sequelize[_0x8e55('0x2')]},'clientId':{'type':Sequelize[_0x8e55('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x8e55('0x2')]},'serverUrl':{'type':Sequelize[_0x8e55('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8e55('0x4')](_0x8e55('0x5'),_0x8e55('0x6')),'defaultValue':_0x8e55('0x5')}}; \ No newline at end of file +var _0xb19a=['ENUM','newTab','integrationTab','sequelize','STRING'];(function(_0x14bc96,_0x2e656b){var _0x331eb1=function(_0x15e205){while(--_0x15e205){_0x14bc96['push'](_0x14bc96['shift']());}};_0x331eb1(++_0x2e656b);}(_0xb19a,0xd0));var _0xab19=function(_0x44e2ee,_0x10a4fe){_0x44e2ee=_0x44e2ee-0x0;var _0x460ea1=_0xb19a[_0x44e2ee];return _0x460ea1;};'use strict';var Sequelize=require(_0xab19('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xab19('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0xab19('0x1')]},'password':{'type':Sequelize[_0xab19('0x1')]},'clientId':{'type':Sequelize[_0xab19('0x1')]},'clientSecret':{'type':Sequelize[_0xab19('0x1')]},'securityToken':{'type':Sequelize[_0xab19('0x1')]},'serverUrl':{'type':Sequelize[_0xab19('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xab19('0x2')]('integrationTab',_0xab19('0x3')),'defaultValue':_0xab19('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 5264a97..b95d929 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7c9=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SalesforceAccount','count','include','catch','params','keys','length','find','create','body','getConfigurations','findOne','SalesforceConfiguration','nolimit','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','Task','clientId','clientSecret','username','password','securityToken','remoteUri','slice','lastIndexOf','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','phone','remove','includes','custom','picklistValues','label','value','True','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x31db69,_0xe8384c){var _0x27c34b=function(_0x568650){while(--_0x568650){_0x31db69['push'](_0x31db69['shift']());}};_0x27c34b(++_0xe8384c);}(_0xb7c9,0x6c));var _0x9b7c=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xb7c9[_0x45f951];return _0x24756c;};'use strict';var emlformat=require(_0x9b7c('0x0'));var rimraf=require(_0x9b7c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9b7c('0x2'));var moment=require('moment');var BPromise=require(_0x9b7c('0x3'));var Mustache=require(_0x9b7c('0x4'));var util=require(_0x9b7c('0x5'));var path=require('path');var sox=require(_0x9b7c('0x6'));var csv=require(_0x9b7c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9b7c('0x8'));var crypto=require(_0x9b7c('0x9'));var jsforce=require(_0x9b7c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x9b7c('0x7'));var querystring=require(_0x9b7c('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9b7c('0xc'));var qs=require(_0x9b7c('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b7c('0xe'));var logger=require(_0x9b7c('0xf'))(_0x9b7c('0x10'));var utils=require('../../config/utils');var config=require(_0x9b7c('0x11'));var licenseUtil=require(_0x9b7c('0x12'));var db=require(_0x9b7c('0x13'))['db'];var integrations=require(_0x9b7c('0x14'));function respondWithStatusCode(_0xff9c45,_0x20d913){_0x20d913=_0x20d913||0xcc;return function(_0x17bcfd){if(_0x17bcfd){return _0xff9c45[_0x9b7c('0x15')](_0x20d913);}return _0xff9c45[_0x9b7c('0x16')](_0x20d913)[_0x9b7c('0x17')]();};}function respondWithResult(_0x461b9c,_0x3f7144){_0x3f7144=_0x3f7144||0xc8;return function(_0xdfa5b7){if(_0xdfa5b7){return _0x461b9c['status'](_0x3f7144)['json'](_0xdfa5b7);}};}function respondWithFilteredResult(_0x3b6175,_0x381ce1){return function(_0x178111){if(_0x178111){var _0x31cc23=typeof _0x381ce1[_0x9b7c('0x18')]==='undefined'&&typeof _0x381ce1['limit']===_0x9b7c('0x19');var _0x4dc621=_0x178111['count'];var _0x5f58c1=_0x31cc23?0x0:_0x381ce1[_0x9b7c('0x18')];var _0x53fa5e=_0x31cc23?_0x178111['count']:_0x381ce1[_0x9b7c('0x18')]+_0x381ce1[_0x9b7c('0x1a')];var _0x213816;if(_0x53fa5e>=_0x4dc621){_0x53fa5e=_0x4dc621;_0x213816=0xc8;}else{_0x213816=0xce;}_0x3b6175[_0x9b7c('0x16')](_0x213816);return _0x3b6175[_0x9b7c('0x1b')](_0x9b7c('0x1c'),_0x5f58c1+'-'+_0x53fa5e+'/'+_0x4dc621)[_0x9b7c('0x1d')](_0x178111);}return null;};}function patchUpdates(_0x2b8ded){return function(_0x133440){try{jsonpatch[_0x9b7c('0x1e')](_0x133440,_0x2b8ded,!![]);}catch(_0x2466dc){return BPromise[_0x9b7c('0x1f')](_0x2466dc);}return _0x133440[_0x9b7c('0x20')]();};}function saveUpdates(_0x5ccb90,_0x2d15b1){return function(_0x2b677c){if(_0x2b677c){return _0x2b677c[_0x9b7c('0x21')](_0x5ccb90)[_0x9b7c('0x22')](function(_0x1a00d8){return _0x1a00d8;});}return null;};}function removeEntity(_0x4462bb,_0x3727df){return function(_0x470cfd){if(_0x470cfd){return _0x470cfd[_0x9b7c('0x23')]()[_0x9b7c('0x22')](function(){_0x4462bb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x34ca27,_0x334423){return function(_0x4ac6b3){if(!_0x4ac6b3){_0x34ca27['sendStatus'](0x194);}return _0x4ac6b3;};}function handleError(_0x1347a5,_0x49bbe1){_0x49bbe1=_0x49bbe1||0x1f4;return function(_0x56e7c9){logger[_0x9b7c('0x24')](_0x56e7c9[_0x9b7c('0x25')]);if(_0x56e7c9[_0x9b7c('0x26')]){delete _0x56e7c9[_0x9b7c('0x26')];}_0x1347a5[_0x9b7c('0x16')](_0x49bbe1)[_0x9b7c('0x27')](_0x56e7c9);};}exports[_0x9b7c('0x28')]=function(_0x28a8ff,_0x4fd9b5){var _0x31158f={},_0xa0f417={},_0x9b7145={'count':0x0,'rows':[]};var _0xe794b1=_[_0x9b7c('0x29')](db['SalesforceAccount'][_0x9b7c('0x2a')],function(_0x3a5dd4){return{'name':_0x3a5dd4['fieldName'],'type':_0x3a5dd4[_0x9b7c('0x2b')][_0x9b7c('0x2c')]};});_0xa0f417[_0x9b7c('0x2d')]=_[_0x9b7c('0x29')](_0xe794b1,_0x9b7c('0x26'));_0xa0f417[_0x9b7c('0x2e')]=_['keys'](_0x28a8ff[_0x9b7c('0x2e')]);_0xa0f417['filters']=_[_0x9b7c('0x2f')](_0xa0f417[_0x9b7c('0x2d')],_0xa0f417[_0x9b7c('0x2e')]);_0x31158f['attributes']=_[_0x9b7c('0x2f')](_0xa0f417['model'],qs[_0x9b7c('0x30')](_0x28a8ff[_0x9b7c('0x2e')]['fields']));_0x31158f[_0x9b7c('0x31')]=_0x31158f[_0x9b7c('0x31')]['length']?_0x31158f['attributes']:_0xa0f417[_0x9b7c('0x2d')];if(!_0x28a8ff[_0x9b7c('0x2e')][_0x9b7c('0x32')]('nolimit')){_0x31158f[_0x9b7c('0x1a')]=qs['limit'](_0x28a8ff['query'][_0x9b7c('0x1a')]);_0x31158f['offset']=qs[_0x9b7c('0x18')](_0x28a8ff[_0x9b7c('0x2e')][_0x9b7c('0x18')]);}_0x31158f[_0x9b7c('0x33')]=qs[_0x9b7c('0x34')](_0x28a8ff[_0x9b7c('0x2e')][_0x9b7c('0x34')]);_0x31158f[_0x9b7c('0x35')]=qs[_0x9b7c('0x36')](_[_0x9b7c('0x37')](_0x28a8ff[_0x9b7c('0x2e')],_0xa0f417[_0x9b7c('0x36')]),_0xe794b1);if(_0x28a8ff[_0x9b7c('0x2e')][_0x9b7c('0x38')]){_0x31158f[_0x9b7c('0x35')]=_[_0x9b7c('0x39')](_0x31158f[_0x9b7c('0x35')],{'$or':_[_0x9b7c('0x29')](_0xe794b1,function(_0x56ded4){if(_0x56ded4[_0x9b7c('0x2b')]!==_0x9b7c('0x3a')){var _0x170052={};_0x170052[_0x56ded4['name']]={'$like':'%'+_0x28a8ff['query']['filter']+'%'};return _0x170052;}})});}_0x31158f=_['merge']({},_0x31158f,_0x28a8ff[_0x9b7c('0x3b')]);var _0x2081d5={'where':_0x31158f['where']};return db[_0x9b7c('0x3c')][_0x9b7c('0x3d')](_0x2081d5)[_0x9b7c('0x22')](function(_0x317b35){_0x9b7145[_0x9b7c('0x3d')]=_0x317b35;if(_0x28a8ff[_0x9b7c('0x2e')]['includeAll']){_0x31158f[_0x9b7c('0x3e')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x31158f);})[_0x9b7c('0x22')](function(_0x2c09cf){_0x9b7145['rows']=_0x2c09cf;return _0x9b7145;})['then'](respondWithFilteredResult(_0x4fd9b5,_0x31158f))[_0x9b7c('0x3f')](handleError(_0x4fd9b5,null));};exports['show']=function(_0x38efa7,_0x5c654f){var _0x360513={'raw':![],'where':{'id':_0x38efa7[_0x9b7c('0x40')]['id']}},_0x163593={};_0x163593['model']=_[_0x9b7c('0x41')](db['SalesforceAccount'][_0x9b7c('0x2a')]);_0x163593[_0x9b7c('0x2e')]=_[_0x9b7c('0x41')](_0x38efa7[_0x9b7c('0x2e')]);_0x163593[_0x9b7c('0x36')]=_[_0x9b7c('0x2f')](_0x163593[_0x9b7c('0x2d')],_0x163593['query']);_0x360513['attributes']=_[_0x9b7c('0x2f')](_0x163593['model'],qs['fields'](_0x38efa7[_0x9b7c('0x2e')][_0x9b7c('0x30')]));_0x360513[_0x9b7c('0x31')]=_0x360513['attributes'][_0x9b7c('0x42')]?_0x360513[_0x9b7c('0x31')]:_0x163593['model'];if(_0x38efa7[_0x9b7c('0x2e')]['includeAll']){_0x360513[_0x9b7c('0x3e')]=[{'all':!![]}];}_0x360513=_[_0x9b7c('0x39')]({},_0x360513,_0x38efa7[_0x9b7c('0x3b')]);return db['SalesforceAccount'][_0x9b7c('0x43')](_0x360513)['then'](handleEntityNotFound(_0x5c654f,null))[_0x9b7c('0x22')](respondWithResult(_0x5c654f,null))[_0x9b7c('0x3f')](handleError(_0x5c654f,null));};exports[_0x9b7c('0x44')]=function(_0x458bb5,_0x3bfe7b){return db['SalesforceAccount'][_0x9b7c('0x44')](_0x458bb5[_0x9b7c('0x45')],{})[_0x9b7c('0x22')](respondWithResult(_0x3bfe7b,0xc9))[_0x9b7c('0x3f')](handleError(_0x3bfe7b,null));};exports[_0x9b7c('0x21')]=function(_0x3bbe49,_0x1bd9ae){if(_0x3bbe49[_0x9b7c('0x45')]['id']){delete _0x3bbe49[_0x9b7c('0x45')]['id'];}return db[_0x9b7c('0x3c')]['find']({'where':{'id':_0x3bbe49[_0x9b7c('0x40')]['id']}})[_0x9b7c('0x22')](handleEntityNotFound(_0x1bd9ae,null))['then'](saveUpdates(_0x3bbe49[_0x9b7c('0x45')],null))[_0x9b7c('0x22')](respondWithResult(_0x1bd9ae,null))[_0x9b7c('0x3f')](handleError(_0x1bd9ae,null));};exports[_0x9b7c('0x23')]=function(_0x174247,_0x1f45f8){return db[_0x9b7c('0x3c')][_0x9b7c('0x43')]({'where':{'id':_0x174247[_0x9b7c('0x40')]['id']}})[_0x9b7c('0x22')](handleEntityNotFound(_0x1f45f8,null))[_0x9b7c('0x22')](removeEntity(_0x1f45f8,null))[_0x9b7c('0x3f')](handleError(_0x1f45f8,null));};exports[_0x9b7c('0x46')]=function(_0x32408f,_0x5975d7,_0x25ca8e){var _0x44d4e4={};var _0x2c8237={};var _0x491d93;var _0x56b281;return db['SalesforceAccount'][_0x9b7c('0x47')]({'where':{'id':_0x32408f[_0x9b7c('0x40')]['id']}})[_0x9b7c('0x22')](handleEntityNotFound(_0x5975d7,null))[_0x9b7c('0x22')](function(_0x1b45ec){if(_0x1b45ec){_0x491d93=_0x1b45ec;_0x2c8237[_0x9b7c('0x2d')]=_[_0x9b7c('0x41')](db[_0x9b7c('0x48')]['rawAttributes']);_0x2c8237['query']=_['keys'](_0x32408f[_0x9b7c('0x2e')]);_0x2c8237[_0x9b7c('0x36')]=_[_0x9b7c('0x2f')](_0x2c8237[_0x9b7c('0x2d')],_0x2c8237['query']);_0x44d4e4[_0x9b7c('0x31')]=_[_0x9b7c('0x2f')](_0x2c8237[_0x9b7c('0x2d')],qs[_0x9b7c('0x30')](_0x32408f[_0x9b7c('0x2e')][_0x9b7c('0x30')]));_0x44d4e4[_0x9b7c('0x31')]=_0x44d4e4[_0x9b7c('0x31')]['length']?_0x44d4e4['attributes']:_0x2c8237[_0x9b7c('0x2d')];_0x44d4e4[_0x9b7c('0x33')]=qs[_0x9b7c('0x34')](_0x32408f[_0x9b7c('0x2e')][_0x9b7c('0x34')]);_0x44d4e4[_0x9b7c('0x35')]=qs[_0x9b7c('0x36')](_[_0x9b7c('0x37')](_0x32408f[_0x9b7c('0x2e')],_0x2c8237[_0x9b7c('0x36')]));if(_0x32408f[_0x9b7c('0x2e')][_0x9b7c('0x38')]){_0x44d4e4[_0x9b7c('0x35')]=_[_0x9b7c('0x39')](_0x44d4e4[_0x9b7c('0x35')],{'$or':_[_0x9b7c('0x29')](_0x44d4e4['attributes'],function(_0x4e3d1e){var _0x3c4b43={};_0x3c4b43[_0x4e3d1e]={'$like':'%'+_0x32408f[_0x9b7c('0x2e')][_0x9b7c('0x38')]+'%'};return _0x3c4b43;})});}_0x44d4e4=_['merge']({},_0x44d4e4,_0x32408f[_0x9b7c('0x3b')]);return _0x491d93['getConfigurations'](_0x44d4e4);}})[_0x9b7c('0x22')](function(_0x51044f){if(_0x51044f){_0x56b281=_0x51044f[_0x9b7c('0x42')];if(!_0x32408f[_0x9b7c('0x2e')][_0x9b7c('0x32')](_0x9b7c('0x49'))){_0x44d4e4[_0x9b7c('0x1a')]=qs['limit'](_0x32408f[_0x9b7c('0x2e')][_0x9b7c('0x1a')]);_0x44d4e4[_0x9b7c('0x18')]=qs[_0x9b7c('0x18')](_0x32408f[_0x9b7c('0x2e')][_0x9b7c('0x18')]);}return _0x491d93[_0x9b7c('0x46')](_0x44d4e4);}})[_0x9b7c('0x22')](function(_0x1fa052){if(_0x1fa052){return _0x1fa052?{'count':_0x56b281,'rows':_0x1fa052}:null;}})[_0x9b7c('0x22')](respondWithResult(_0x5975d7,null))[_0x9b7c('0x3f')](handleError(_0x5975d7,null));};exports[_0x9b7c('0x4a')]=function(_0x30ee36,_0x254ff9,_0x1630bf){if(_0x30ee36[_0x9b7c('0x45')]['id']){delete _0x30ee36[_0x9b7c('0x45')]['id'];}return db[_0x9b7c('0x3c')][_0x9b7c('0x47')]({'where':{'id':_0x30ee36[_0x9b7c('0x40')]['id']}})[_0x9b7c('0x22')](handleEntityNotFound(_0x254ff9,null))['then'](function(_0x521b7b){if(_0x521b7b){_0x30ee36[_0x9b7c('0x45')][_0x9b7c('0x4b')]=_0x521b7b['id'];_0x30ee36[_0x9b7c('0x45')]['Subjects']=integrations[_0x9b7c('0x4c')](_0x30ee36[_0x9b7c('0x45')]['channel'],_0x30ee36[_0x9b7c('0x45')][_0x9b7c('0x2b')]);_0x30ee36[_0x9b7c('0x45')][_0x9b7c('0x4d')]=integrations[_0x9b7c('0x4e')](_0x30ee36[_0x9b7c('0x45')][_0x9b7c('0x4f')],_0x30ee36['body'][_0x9b7c('0x2b')]);return db[_0x9b7c('0x48')][_0x9b7c('0x44')](_0x30ee36['body'],{'include':[{'model':db[_0x9b7c('0x50')],'as':'Subjects'},{'model':db[_0x9b7c('0x50')],'as':_0x9b7c('0x4d')}]});}return null;})[_0x9b7c('0x22')](respondWithResult(_0x254ff9,null))[_0x9b7c('0x3f')](handleError(_0x254ff9,null));};exports['getFields']=function(_0x1c6fce,_0x3ea4e3,_0x14c6ba){var _0x402070;var _0x18ca89='';var _0x4a4f23=_0x9b7c('0x51');return db[_0x9b7c('0x3c')][_0x9b7c('0x47')]({'where':{'id':_0x1c6fce[_0x9b7c('0x40')]['id']},'attributes':['id','remoteUri',_0x9b7c('0x52'),_0x9b7c('0x53'),_0x9b7c('0x54'),_0x9b7c('0x55'),_0x9b7c('0x56')]})[_0x9b7c('0x22')](handleEntityNotFound(_0x3ea4e3,null))[_0x9b7c('0x22')](function(_0xaaac67){if(_0xaaac67){_0x18ca89=_0xaaac67[_0x9b7c('0x57')];var _0x31e656=_0x18ca89[_0x9b7c('0x58')](-0x1);if(_0x31e656==='/'){_0x18ca89=_0x18ca89['substring'](0x0,_0x18ca89[_0x9b7c('0x59')](_0x31e656));}_0x402070=new jsforce['Connection']({'oauth2':{'loginUrl':_0x18ca89,'clientId':_0xaaac67[_0x9b7c('0x52')],'clientSecret':_0xaaac67['clientSecret']}});return _0x402070[_0x9b7c('0x5a')](_0xaaac67[_0x9b7c('0x54')],_0xaaac67[_0x9b7c('0x55')][_0x9b7c('0x5b')](_0xaaac67[_0x9b7c('0x56')]));}})[_0x9b7c('0x22')](function(_0x21ca74){if(_0x21ca74){if(!_[_0x9b7c('0x5c')](_0x1c6fce['query'][_0x9b7c('0x5d')])){_0x4a4f23=_0x1c6fce['query']['ticketType'];}return _0x402070[_0x9b7c('0x5e')](_0x4a4f23)[_0x9b7c('0x5f')]();}})[_0x9b7c('0x22')](function(_0xda64d7){var _0x1ba02f=[_0x9b7c('0x60'),_0x9b7c('0x61'),_0x9b7c('0x62'),_0x9b7c('0x63'),_0x9b7c('0x64'),_0x9b7c('0x65')];var _0x5b7610=[_0x9b7c('0x66'),_0x9b7c('0x67'),_0x9b7c('0x68'),_0x9b7c('0x69'),_0x9b7c('0x6a'),_0x9b7c('0x6b'),_0x9b7c('0x6c')];if(_0xda64d7){_[_0x9b7c('0x6d')](_0xda64d7[_0x9b7c('0x30')],function(_0x373d39){return _0x1ba02f[_0x9b7c('0x6e')](_0x373d39[_0x9b7c('0x26')])||!_0x5b7610[_0x9b7c('0x6e')](_0x373d39[_0x9b7c('0x2b')]);});return{'count':_0xda64d7[_0x9b7c('0x30')]['length'],'rows':_[_0x9b7c('0x29')](_0xda64d7[_0x9b7c('0x30')],function(_0xfcc83d){return{'id':_0xfcc83d[_0x9b7c('0x26')],'name':_0xfcc83d['label'],'custom':_0xfcc83d[_0x9b7c('0x6f')],'options':_0xfcc83d[_0x9b7c('0x70')]['length']>0x0?_[_0x9b7c('0x29')](_0xfcc83d['picklistValues'],function(_0xc2cd8d){return{'name':_0xc2cd8d[_0x9b7c('0x71')],'value':_0xc2cd8d[_0x9b7c('0x72')]};}):_0xfcc83d[_0x9b7c('0x2b')]==_0x9b7c('0x69')?[{'name':_0x9b7c('0x73'),'value':_0x9b7c('0x74')},{'name':'False','value':_0x9b7c('0x75')}]:[]};})};}})['then'](respondWithResult(_0x3ea4e3,null))[_0x9b7c('0x3f')](function(_0x5bc7ec){var _0xe8183=_0x1c6fce['query'][_0x9b7c('0x76')]?0x1f4:_0x5bc7ec[_0x9b7c('0x77')]||0x1f4;logger[_0x9b7c('0x24')](_0x9b7c('0x78'),_0x9b7c('0x79'),_0xe8183,JSON['stringify'](_0x5bc7ec));delete _0x5bc7ec[_0x9b7c('0x26')];if(_0xe8183===0x191){_0xe8183=0x190;}_0x3ea4e3[_0x9b7c('0x16')](_0xe8183)[_0x9b7c('0x27')](_0x1c6fce['query'][_0x9b7c('0x76')]?{'message':_0x9b7c('0x7a'),'statusCode':_0x5bc7ec[_0x9b7c('0x77')]}:_0x5bc7ec);});}; \ No newline at end of file +var _0x89c8=['name','send','index','map','SalesforceAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','include','findAll','rows','catch','params','options','create','body','find','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','Subjects','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','login','concat','isNil','ticketType','sobject','OwnerId','IsRecurrence','Description','picklist','boolean','email','textarea','phone','includes','label','custom','picklistValues','value','true','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','util','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','then','error','stack'];(function(_0x3882a4,_0x59c6e5){var _0x3acfcb=function(_0x3c706b){while(--_0x3c706b){_0x3882a4['push'](_0x3882a4['shift']());}};_0x3acfcb(++_0x59c6e5);}(_0x89c8,0x13b));var _0x889c=function(_0xb3922a,_0x3a8f83){_0xb3922a=_0xb3922a-0x0;var _0x41baf8=_0x89c8[_0xb3922a];return _0x41baf8;};'use strict';var emlformat=require(_0x889c('0x0'));var rimraf=require(_0x889c('0x1'));var zipdir=require(_0x889c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x889c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x889c('0x4'));var path=require('path');var sox=require(_0x889c('0x5'));var csv=require(_0x889c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x889c('0x7'));var squel=require('squel');var crypto=require(_0x889c('0x8'));var jsforce=require(_0x889c('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x889c('0x6'));var querystring=require(_0x889c('0xa'));var Papa=require(_0x889c('0xb'));var Redis=require(_0x889c('0xc'));var authService=require(_0x889c('0xd'));var qs=require(_0x889c('0xe'));var as=require(_0x889c('0xf'));var hardwareService=require(_0x889c('0x10'));var logger=require(_0x889c('0x11'))(_0x889c('0x12'));var utils=require(_0x889c('0x13'));var config=require(_0x889c('0x14'));var licenseUtil=require(_0x889c('0x15'));var db=require(_0x889c('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2e481c,_0x5baa3b){_0x5baa3b=_0x5baa3b||0xcc;return function(_0x49dc06){if(_0x49dc06){return _0x2e481c[_0x889c('0x17')](_0x5baa3b);}return _0x2e481c[_0x889c('0x18')](_0x5baa3b)[_0x889c('0x19')]();};}function respondWithResult(_0x4b405b,_0xe67aea){_0xe67aea=_0xe67aea||0xc8;return function(_0x527a26){if(_0x527a26){return _0x4b405b[_0x889c('0x18')](_0xe67aea)[_0x889c('0x1a')](_0x527a26);}};}function respondWithFilteredResult(_0x5c0be2,_0x4ad316){return function(_0x5db44b){if(_0x5db44b){var _0x35a50b=typeof _0x4ad316[_0x889c('0x1b')]===_0x889c('0x1c')&&typeof _0x4ad316['limit']===_0x889c('0x1c');var _0x2c4f50=_0x5db44b[_0x889c('0x1d')];var _0x38022f=_0x35a50b?0x0:_0x4ad316[_0x889c('0x1b')];var _0x5d8492=_0x35a50b?_0x5db44b[_0x889c('0x1d')]:_0x4ad316[_0x889c('0x1b')]+_0x4ad316[_0x889c('0x1e')];var _0x5918e3;if(_0x5d8492>=_0x2c4f50){_0x5d8492=_0x2c4f50;_0x5918e3=0xc8;}else{_0x5918e3=0xce;}_0x5c0be2[_0x889c('0x18')](_0x5918e3);return _0x5c0be2[_0x889c('0x1f')](_0x889c('0x20'),_0x38022f+'-'+_0x5d8492+'/'+_0x2c4f50)[_0x889c('0x1a')](_0x5db44b);}return null;};}function patchUpdates(_0x2cadda){return function(_0x2f1d2d){try{jsonpatch[_0x889c('0x21')](_0x2f1d2d,_0x2cadda,!![]);}catch(_0x476447){return BPromise['reject'](_0x476447);}return _0x2f1d2d['save']();};}function saveUpdates(_0x6fef11,_0x4f47b9){return function(_0x562c30){if(_0x562c30){return _0x562c30[_0x889c('0x22')](_0x6fef11)['then'](function(_0x329ae1){return _0x329ae1;});}return null;};}function removeEntity(_0x4b4755,_0x5965af){return function(_0x726728){if(_0x726728){return _0x726728[_0x889c('0x23')]()[_0x889c('0x24')](function(){_0x4b4755[_0x889c('0x18')](0xcc)[_0x889c('0x19')]();});}};}function handleEntityNotFound(_0x3958e6,_0x1927d1){return function(_0x9b52fd){if(!_0x9b52fd){_0x3958e6[_0x889c('0x17')](0x194);}return _0x9b52fd;};}function handleError(_0x5d573a,_0x50001b){_0x50001b=_0x50001b||0x1f4;return function(_0x1b5f82){logger[_0x889c('0x25')](_0x1b5f82[_0x889c('0x26')]);if(_0x1b5f82[_0x889c('0x27')]){delete _0x1b5f82[_0x889c('0x27')];}_0x5d573a[_0x889c('0x18')](_0x50001b)[_0x889c('0x28')](_0x1b5f82);};}exports[_0x889c('0x29')]=function(_0xdbf023,_0x5c0376){var _0x4e4f51={},_0x2fe041={},_0x197711={'count':0x0,'rows':[]};var _0x2f3999=_[_0x889c('0x2a')](db[_0x889c('0x2b')][_0x889c('0x2c')],function(_0x76af2){return{'name':_0x76af2['fieldName'],'type':_0x76af2[_0x889c('0x2d')]['key']};});_0x2fe041[_0x889c('0x2e')]=_['map'](_0x2f3999,_0x889c('0x27'));_0x2fe041[_0x889c('0x2f')]=_[_0x889c('0x30')](_0xdbf023[_0x889c('0x2f')]);_0x2fe041[_0x889c('0x31')]=_[_0x889c('0x32')](_0x2fe041['model'],_0x2fe041[_0x889c('0x2f')]);_0x4e4f51[_0x889c('0x33')]=_[_0x889c('0x32')](_0x2fe041['model'],qs[_0x889c('0x34')](_0xdbf023[_0x889c('0x2f')][_0x889c('0x34')]));_0x4e4f51[_0x889c('0x33')]=_0x4e4f51[_0x889c('0x33')][_0x889c('0x35')]?_0x4e4f51[_0x889c('0x33')]:_0x2fe041[_0x889c('0x2e')];if(!_0xdbf023[_0x889c('0x2f')][_0x889c('0x36')](_0x889c('0x37'))){_0x4e4f51[_0x889c('0x1e')]=qs['limit'](_0xdbf023[_0x889c('0x2f')][_0x889c('0x1e')]);_0x4e4f51[_0x889c('0x1b')]=qs[_0x889c('0x1b')](_0xdbf023[_0x889c('0x2f')]['offset']);}_0x4e4f51[_0x889c('0x38')]=qs[_0x889c('0x39')](_0xdbf023[_0x889c('0x2f')][_0x889c('0x39')]);_0x4e4f51[_0x889c('0x3a')]=qs[_0x889c('0x31')](_[_0x889c('0x3b')](_0xdbf023[_0x889c('0x2f')],_0x2fe041[_0x889c('0x31')]),_0x2f3999);if(_0xdbf023['query']['filter']){_0x4e4f51['where']=_['merge'](_0x4e4f51[_0x889c('0x3a')],{'$or':_[_0x889c('0x2a')](_0x2f3999,function(_0x3e56e8){if(_0x3e56e8[_0x889c('0x2d')]!==_0x889c('0x3c')){var _0x24b0a2={};_0x24b0a2[_0x3e56e8[_0x889c('0x27')]]={'$like':'%'+_0xdbf023[_0x889c('0x2f')][_0x889c('0x3d')]+'%'};return _0x24b0a2;}})});}_0x4e4f51=_[_0x889c('0x3e')]({},_0x4e4f51,_0xdbf023['options']);var _0x16c741={'where':_0x4e4f51[_0x889c('0x3a')]};return db[_0x889c('0x2b')][_0x889c('0x1d')](_0x16c741)[_0x889c('0x24')](function(_0x252d4e){_0x197711[_0x889c('0x1d')]=_0x252d4e;if(_0xdbf023[_0x889c('0x2f')]['includeAll']){_0x4e4f51[_0x889c('0x3f')]=[{'all':!![]}];}return db[_0x889c('0x2b')][_0x889c('0x40')](_0x4e4f51);})[_0x889c('0x24')](function(_0x4211a6){_0x197711[_0x889c('0x41')]=_0x4211a6;return _0x197711;})['then'](respondWithFilteredResult(_0x5c0376,_0x4e4f51))[_0x889c('0x42')](handleError(_0x5c0376,null));};exports['show']=function(_0x2aa523,_0x352a65){var _0x5ddc6e={'raw':![],'where':{'id':_0x2aa523[_0x889c('0x43')]['id']}},_0x402664={};_0x402664[_0x889c('0x2e')]=_[_0x889c('0x30')](db[_0x889c('0x2b')]['rawAttributes']);_0x402664[_0x889c('0x2f')]=_[_0x889c('0x30')](_0x2aa523[_0x889c('0x2f')]);_0x402664['filters']=_[_0x889c('0x32')](_0x402664[_0x889c('0x2e')],_0x402664[_0x889c('0x2f')]);_0x5ddc6e[_0x889c('0x33')]=_[_0x889c('0x32')](_0x402664[_0x889c('0x2e')],qs['fields'](_0x2aa523[_0x889c('0x2f')]['fields']));_0x5ddc6e['attributes']=_0x5ddc6e[_0x889c('0x33')]['length']?_0x5ddc6e['attributes']:_0x402664[_0x889c('0x2e')];if(_0x2aa523[_0x889c('0x2f')]['includeAll']){_0x5ddc6e[_0x889c('0x3f')]=[{'all':!![]}];}_0x5ddc6e=_[_0x889c('0x3e')]({},_0x5ddc6e,_0x2aa523[_0x889c('0x44')]);return db[_0x889c('0x2b')]['find'](_0x5ddc6e)[_0x889c('0x24')](handleEntityNotFound(_0x352a65,null))[_0x889c('0x24')](respondWithResult(_0x352a65,null))['catch'](handleError(_0x352a65,null));};exports[_0x889c('0x45')]=function(_0x3f01a8,_0x12c60f){return db[_0x889c('0x2b')][_0x889c('0x45')](_0x3f01a8['body'],{})[_0x889c('0x24')](respondWithResult(_0x12c60f,0xc9))[_0x889c('0x42')](handleError(_0x12c60f,null));};exports[_0x889c('0x22')]=function(_0x117c39,_0x53b8b5){if(_0x117c39['body']['id']){delete _0x117c39[_0x889c('0x46')]['id'];}return db[_0x889c('0x2b')]['find']({'where':{'id':_0x117c39[_0x889c('0x43')]['id']}})[_0x889c('0x24')](handleEntityNotFound(_0x53b8b5,null))[_0x889c('0x24')](saveUpdates(_0x117c39[_0x889c('0x46')],null))[_0x889c('0x24')](respondWithResult(_0x53b8b5,null))[_0x889c('0x42')](handleError(_0x53b8b5,null));};exports[_0x889c('0x23')]=function(_0xd46403,_0x578088){return db[_0x889c('0x2b')][_0x889c('0x47')]({'where':{'id':_0xd46403[_0x889c('0x43')]['id']}})[_0x889c('0x24')](handleEntityNotFound(_0x578088,null))[_0x889c('0x24')](removeEntity(_0x578088,null))[_0x889c('0x42')](handleError(_0x578088,null));};exports[_0x889c('0x48')]=function(_0x4396a5,_0x663803,_0x5df69f){var _0x48de1c={};var _0x1ef329={};var _0x4bbaa8;var _0x2aa253;return db[_0x889c('0x2b')][_0x889c('0x49')]({'where':{'id':_0x4396a5['params']['id']}})[_0x889c('0x24')](handleEntityNotFound(_0x663803,null))[_0x889c('0x24')](function(_0x383667){if(_0x383667){_0x4bbaa8=_0x383667;_0x1ef329[_0x889c('0x2e')]=_['keys'](db[_0x889c('0x4a')][_0x889c('0x2c')]);_0x1ef329[_0x889c('0x2f')]=_['keys'](_0x4396a5[_0x889c('0x2f')]);_0x1ef329[_0x889c('0x31')]=_[_0x889c('0x32')](_0x1ef329[_0x889c('0x2e')],_0x1ef329['query']);_0x48de1c[_0x889c('0x33')]=_[_0x889c('0x32')](_0x1ef329[_0x889c('0x2e')],qs[_0x889c('0x34')](_0x4396a5[_0x889c('0x2f')][_0x889c('0x34')]));_0x48de1c[_0x889c('0x33')]=_0x48de1c[_0x889c('0x33')][_0x889c('0x35')]?_0x48de1c['attributes']:_0x1ef329[_0x889c('0x2e')];_0x48de1c[_0x889c('0x38')]=qs[_0x889c('0x39')](_0x4396a5[_0x889c('0x2f')]['sort']);_0x48de1c[_0x889c('0x3a')]=qs[_0x889c('0x31')](_[_0x889c('0x3b')](_0x4396a5['query'],_0x1ef329[_0x889c('0x31')]));if(_0x4396a5[_0x889c('0x2f')][_0x889c('0x3d')]){_0x48de1c[_0x889c('0x3a')]=_[_0x889c('0x3e')](_0x48de1c[_0x889c('0x3a')],{'$or':_[_0x889c('0x2a')](_0x48de1c[_0x889c('0x33')],function(_0x2f13ea){var _0x13c7d0={};_0x13c7d0[_0x2f13ea]={'$like':'%'+_0x4396a5[_0x889c('0x2f')]['filter']+'%'};return _0x13c7d0;})});}_0x48de1c=_[_0x889c('0x3e')]({},_0x48de1c,_0x4396a5[_0x889c('0x44')]);return _0x4bbaa8[_0x889c('0x48')](_0x48de1c);}})[_0x889c('0x24')](function(_0x3c3e9f){if(_0x3c3e9f){_0x2aa253=_0x3c3e9f[_0x889c('0x35')];if(!_0x4396a5[_0x889c('0x2f')][_0x889c('0x36')](_0x889c('0x37'))){_0x48de1c['limit']=qs[_0x889c('0x1e')](_0x4396a5[_0x889c('0x2f')][_0x889c('0x1e')]);_0x48de1c[_0x889c('0x1b')]=qs[_0x889c('0x1b')](_0x4396a5[_0x889c('0x2f')]['offset']);}return _0x4bbaa8[_0x889c('0x48')](_0x48de1c);}})['then'](function(_0x23e382){if(_0x23e382){return _0x23e382?{'count':_0x2aa253,'rows':_0x23e382}:null;}})[_0x889c('0x24')](respondWithResult(_0x663803,null))[_0x889c('0x42')](handleError(_0x663803,null));};exports[_0x889c('0x4b')]=function(_0x23d507,_0x33b33f,_0x4a5b3){if(_0x23d507[_0x889c('0x46')]['id']){delete _0x23d507[_0x889c('0x46')]['id'];}return db[_0x889c('0x2b')]['findOne']({'where':{'id':_0x23d507['params']['id']}})[_0x889c('0x24')](handleEntityNotFound(_0x33b33f,null))[_0x889c('0x24')](function(_0x587445){if(_0x587445){_0x23d507[_0x889c('0x46')]['AccountId']=_0x587445['id'];_0x23d507[_0x889c('0x46')]['Subjects']=integrations[_0x889c('0x4c')](_0x23d507[_0x889c('0x46')][_0x889c('0x4d')],_0x23d507[_0x889c('0x46')][_0x889c('0x2d')]);_0x23d507[_0x889c('0x46')][_0x889c('0x4e')]=integrations[_0x889c('0x4f')](_0x23d507['body'][_0x889c('0x4d')],_0x23d507[_0x889c('0x46')]['type']);return db['SalesforceConfiguration'][_0x889c('0x45')](_0x23d507['body'],{'include':[{'model':db['SalesforceField'],'as':_0x889c('0x50')},{'model':db[_0x889c('0x51')],'as':_0x889c('0x4e')}]});}return null;})[_0x889c('0x24')](respondWithResult(_0x33b33f,null))[_0x889c('0x42')](handleError(_0x33b33f,null));};exports[_0x889c('0x52')]=function(_0x5c6e04,_0x1b8cc1,_0x5519d6){var _0x559fbd;var _0x59cc69='';var _0x2374a3=_0x889c('0x53');return db[_0x889c('0x2b')]['findOne']({'where':{'id':_0x5c6e04[_0x889c('0x43')]['id']},'attributes':['id',_0x889c('0x54'),_0x889c('0x55'),_0x889c('0x56'),_0x889c('0x57'),_0x889c('0x58'),_0x889c('0x59')]})[_0x889c('0x24')](handleEntityNotFound(_0x1b8cc1,null))[_0x889c('0x24')](function(_0x33a9e7){if(_0x33a9e7){_0x59cc69=_0x33a9e7[_0x889c('0x54')];var _0x9861ab=_0x59cc69[_0x889c('0x5a')](-0x1);if(_0x9861ab==='/'){_0x59cc69=_0x59cc69[_0x889c('0x5b')](0x0,_0x59cc69[_0x889c('0x5c')](_0x9861ab));}_0x559fbd=new jsforce['Connection']({'oauth2':{'loginUrl':_0x59cc69,'clientId':_0x33a9e7[_0x889c('0x55')],'clientSecret':_0x33a9e7[_0x889c('0x56')]}});return _0x559fbd[_0x889c('0x5d')](_0x33a9e7['username'],_0x33a9e7[_0x889c('0x58')][_0x889c('0x5e')](_0x33a9e7['securityToken']));}})['then'](function(_0x57f228){if(_0x57f228){if(!_[_0x889c('0x5f')](_0x5c6e04['query'][_0x889c('0x60')])){_0x2374a3=_0x5c6e04['query'][_0x889c('0x60')];}return _0x559fbd[_0x889c('0x61')](_0x2374a3)['describe']();}})[_0x889c('0x24')](function(_0x40d05b){var _0x45f2fe=[_0x889c('0x62'),'ActivityDate','IsReminderSet',_0x889c('0x63'),'Subject',_0x889c('0x64')];var _0x52dde5=['string','int',_0x889c('0x65'),_0x889c('0x66'),_0x889c('0x67'),_0x889c('0x68'),_0x889c('0x69')];if(_0x40d05b){_['remove'](_0x40d05b[_0x889c('0x34')],function(_0x34fbb1){return _0x45f2fe[_0x889c('0x6a')](_0x34fbb1[_0x889c('0x27')])||!_0x52dde5[_0x889c('0x6a')](_0x34fbb1[_0x889c('0x2d')]);});return{'count':_0x40d05b[_0x889c('0x34')][_0x889c('0x35')],'rows':_['map'](_0x40d05b['fields'],function(_0x2af10b){return{'id':_0x2af10b['name'],'name':_0x2af10b[_0x889c('0x6b')],'custom':_0x2af10b[_0x889c('0x6c')],'options':_0x2af10b[_0x889c('0x6d')][_0x889c('0x35')]>0x0?_[_0x889c('0x2a')](_0x2af10b[_0x889c('0x6d')],function(_0x2110ed){return{'name':_0x2110ed[_0x889c('0x6b')],'value':_0x2110ed[_0x889c('0x6e')]};}):_0x2af10b[_0x889c('0x2d')]==_0x889c('0x66')?[{'name':'True','value':_0x889c('0x6f')},{'name':_0x889c('0x70'),'value':'false'}]:[]};})};}})[_0x889c('0x24')](respondWithResult(_0x1b8cc1,null))[_0x889c('0x42')](function(_0x5e95a4){var _0xcf97f3=_0x5c6e04[_0x889c('0x2f')][_0x889c('0x71')]?0x1f4:_0x5e95a4[_0x889c('0x72')]||0x1f4;logger[_0x889c('0x25')](_0x889c('0x73'),_0x889c('0x52'),_0xcf97f3,JSON[_0x889c('0x74')](_0x5e95a4));delete _0x5e95a4['name'];if(_0xcf97f3===0x191){_0xcf97f3=0x190;}_0x1b8cc1[_0x889c('0x18')](_0xcf97f3)[_0x889c('0x28')](_0x5c6e04['query']['test']?{'message':_0x889c('0x75'),'statusCode':_0x5e95a4[_0x889c('0x72')]}:_0x5e95a4);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 0d5ce35..d921d0a 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.model.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24cb=['bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','SalesforceAccount','lodash','util','../../config/logger','api','moment'];(function(_0x2b7065,_0x4a5a1c){var _0x1fb959=function(_0x28026b){while(--_0x28026b){_0x2b7065['push'](_0x2b7065['shift']());}};_0x1fb959(++_0x4a5a1c);}(_0x24cb,0x11b));var _0xb24c=function(_0x2892da,_0x191a40){_0x2892da=_0x2892da-0x0;var _0x28cff2=_0x24cb[_0x2892da];return _0x28cff2;};'use strict';var _=require(_0xb24c('0x0'));var util=require(_0xb24c('0x1'));var logger=require(_0xb24c('0x2'))(_0xb24c('0x3'));var moment=require(_0xb24c('0x4'));var BPromise=require(_0xb24c('0x5'));var rp=require(_0xb24c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb24c('0x7'));var config=require(_0xb24c('0x8'));var attributes=require(_0xb24c('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xb24c('0xa')]=function(_0xe11821,_0x375c38){return _0xe11821['define'](_0xb24c('0xb'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75b5=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts'];(function(_0x234f7f,_0x1ea380){var _0x430416=function(_0x24cb4c){while(--_0x24cb4c){_0x234f7f['push'](_0x234f7f['shift']());}};_0x430416(++_0x1ea380);}(_0x75b5,0x1c7));var _0x575b=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x75b5[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x575b('0x0'));var util=require('util');var logger=require(_0x575b('0x1'))(_0x575b('0x2'));var moment=require('moment');var BPromise=require(_0x575b('0x3'));var rp=require(_0x575b('0x4'));var fs=require('fs');var path=require(_0x575b('0x5'));var rimraf=require(_0x575b('0x6'));var config=require(_0x575b('0x7'));var attributes=require(_0x575b('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x575b('0x9')]=function(_0x2c79d0,_0x4dd1a9){return _0x2c79d0[_0x575b('0xa')](_0x575b('0xb'),attributes,{'tableName':_0x575b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 7f78c91..9a44d63 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x275b=['where','attributes','limit','include','map','debug','find','model','ShowSalesforceAccount','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw'];(function(_0x5d8fa1,_0x48f172){var _0x53a280=function(_0x256d98){while(--_0x256d98){_0x5d8fa1['push'](_0x5d8fa1['shift']());}};_0x53a280(++_0x48f172);}(_0x275b,0x1a1));var _0xb275=function(_0x40f32c,_0x31a77d){_0x40f32c=_0x40f32c-0x0;var _0x3f3815=_0x275b[_0x40f32c];return _0x3f3815;};'use strict';var _=require('lodash');var util=require(_0xb275('0x0'));var moment=require(_0xb275('0x1'));var BPromise=require('bluebird');var rs=require(_0xb275('0x2'));var fs=require('fs');var Redis=require(_0xb275('0x3'));var db=require(_0xb275('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb275('0x5'));var config=require(_0xb275('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb275('0x7')][_0xb275('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2489a5,_0x2a475d,_0x3a2483){return new BPromise(function(_0x203210,_0x2c6a1d){return client[_0xb275('0x9')](_0x2489a5,_0x3a2483)[_0xb275('0xa')](function(_0x364cb8){logger[_0xb275('0xb')](_0xb275('0xc'),_0x2a475d,_0xb275('0xd'));logger['debug'](_0xb275('0xe'),_0x2a475d,_0xb275('0xd'),JSON[_0xb275('0xf')](_0x364cb8));if(_0x364cb8[_0xb275('0x10')]){if(_0x364cb8[_0xb275('0x10')][_0xb275('0x11')]===0x1f4){logger[_0xb275('0x10')](_0xb275('0xc'),_0x2a475d,_0x364cb8[_0xb275('0x10')][_0xb275('0x12')]);return _0x2c6a1d(_0x364cb8[_0xb275('0x10')][_0xb275('0x12')]);}logger[_0xb275('0x10')](_0xb275('0xc'),_0x2a475d,_0x364cb8[_0xb275('0x10')]['message']);return _0x203210(_0x364cb8[_0xb275('0x10')][_0xb275('0x12')]);}else{logger[_0xb275('0xb')](_0xb275('0xc'),_0x2a475d,_0xb275('0xd'));_0x203210(_0x364cb8['result'][_0xb275('0x12')]);}})[_0xb275('0x13')](function(_0x31705d){logger[_0xb275('0x10')](_0xb275('0xc'),_0x2a475d,_0x31705d);_0x2c6a1d(_0x31705d);});});}exports[_0xb275('0x14')]=function(_0x5e5020){var _0x5e22dd=this;return new Promise(function(_0x5d24a3,_0x345c92){return db[_0xb275('0x15')][_0xb275('0x16')]({'raw':_0x5e5020[_0xb275('0x17')]?_0x5e5020['options'][_0xb275('0x18')]===undefined?!![]:![]:!![],'where':_0x5e5020[_0xb275('0x17')]?_0x5e5020[_0xb275('0x17')][_0xb275('0x19')]||null:null,'attributes':_0x5e5020[_0xb275('0x17')]?_0x5e5020[_0xb275('0x17')][_0xb275('0x1a')]||null:null,'limit':_0x5e5020['options']?_0x5e5020['options'][_0xb275('0x1b')]||null:null,'include':_0x5e5020[_0xb275('0x17')]?_0x5e5020['options'][_0xb275('0x1c')]?_[_0xb275('0x1d')](_0x5e5020['options'][_0xb275('0x1c')],function(_0x2e2a43){return{'model':db[_0x2e2a43['model']],'as':_0x2e2a43['as'],'attributes':_0x2e2a43[_0xb275('0x1a')],'include':_0x2e2a43[_0xb275('0x1c')]?_['map'](_0x2e2a43[_0xb275('0x1c')],function(_0x17aabd){return{'model':db[_0x17aabd['model']],'as':_0x17aabd['as'],'attributes':_0x17aabd[_0xb275('0x1a')],'include':_0x17aabd[_0xb275('0x1c')]?_[_0xb275('0x1d')](_0x17aabd[_0xb275('0x1c')],function(_0x327a5a){return{'model':db[_0x327a5a['model']],'as':_0x327a5a['as'],'attributes':_0x327a5a[_0xb275('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb275('0xa')](function(_0x572b8b){logger['info']('GetSalesforceAccount',_0x5e5020);logger[_0xb275('0x1e')]('GetSalesforceAccount',_0x5e5020,JSON[_0xb275('0xf')](_0x572b8b));_0x5d24a3(_0x572b8b);})['catch'](function(_0x231de8){logger[_0xb275('0x10')](_0xb275('0x14'),_0x231de8['message'],_0x5e5020);_0x345c92(_0x5e22dd[_0xb275('0x10')](0x1f4,_0x231de8[_0xb275('0x12')]));});});};exports['ShowSalesforceAccount']=function(_0xf735a4){var _0x286e0d=this;return new Promise(function(_0x550f8f,_0x24a3e2){return db[_0xb275('0x15')][_0xb275('0x1f')]({'raw':_0xf735a4[_0xb275('0x17')]?_0xf735a4[_0xb275('0x17')][_0xb275('0x18')]===undefined?!![]:![]:!![],'where':_0xf735a4['options']?_0xf735a4[_0xb275('0x17')][_0xb275('0x19')]||null:null,'attributes':_0xf735a4[_0xb275('0x17')]?_0xf735a4[_0xb275('0x17')][_0xb275('0x1a')]||null:null,'include':_0xf735a4[_0xb275('0x17')]?_0xf735a4[_0xb275('0x17')][_0xb275('0x1c')]?_['map'](_0xf735a4[_0xb275('0x17')][_0xb275('0x1c')],function(_0x38b79f){return{'model':db[_0x38b79f[_0xb275('0x20')]],'as':_0x38b79f['as'],'attributes':_0x38b79f[_0xb275('0x1a')],'include':_0x38b79f[_0xb275('0x1c')]?_[_0xb275('0x1d')](_0x38b79f[_0xb275('0x1c')],function(_0x4eda92){return{'model':db[_0x4eda92[_0xb275('0x20')]],'as':_0x4eda92['as'],'attributes':_0x4eda92[_0xb275('0x1a')],'include':_0x4eda92[_0xb275('0x1c')]?_[_0xb275('0x1d')](_0x4eda92['include'],function(_0x2094d1){return{'model':db[_0x2094d1[_0xb275('0x20')]],'as':_0x2094d1['as'],'attributes':_0x2094d1['attributes']};}):[]};}):[]};}):[]:[]})[_0xb275('0xa')](function(_0x2c3e0a){logger[_0xb275('0xb')](_0xb275('0x21'),_0xf735a4);logger[_0xb275('0x1e')](_0xb275('0x21'),_0xf735a4,JSON[_0xb275('0xf')](_0x2c3e0a));_0x550f8f(_0x2c3e0a);})[_0xb275('0x13')](function(_0x5e61d2){logger['error']('ShowSalesforceAccount',_0x5e61d2[_0xb275('0x12')],_0xf735a4);_0x24a3e2(_0x286e0d['error'](0x1f4,_0x5e61d2['message']));});});}; \ No newline at end of file +var _0x517b=['client','request','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','info','result','catch','options','raw','where','map','include','attributes','model','then','GetSalesforceAccount','ShowSalesforceAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x517b,0xff));var _0xb517=function(_0x182227,_0x220533){_0x182227=_0x182227-0x0;var _0x1d0370=_0x517b[_0x182227];return _0x1d0370;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb517('0x0'));var BPromise=require(_0xb517('0x1'));var rs=require(_0xb517('0x2'));var fs=require('fs');var Redis=require(_0xb517('0x3'));var db=require(_0xb517('0x4'))['db'];var utils=require(_0xb517('0x5'));var logger=require(_0xb517('0x6'))(_0xb517('0x7'));var config=require('../../config/environment');var jayson=require(_0xb517('0x8'));var client=jayson[_0xb517('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe41f15,_0x4f55f7,_0x80ef50){return new BPromise(function(_0x3678f9,_0x23f9e8){return client[_0xb517('0xa')](_0xe41f15,_0x80ef50)['then'](function(_0xafd8f7){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x4f55f7,_0xb517('0xb'));logger[_0xb517('0xc')](_0xb517('0xd'),_0x4f55f7,_0xb517('0xb'),JSON[_0xb517('0xe')](_0xafd8f7));if(_0xafd8f7[_0xb517('0xf')]){if(_0xafd8f7[_0xb517('0xf')][_0xb517('0x10')]===0x1f4){logger['error'](_0xb517('0x11'),_0x4f55f7,_0xafd8f7[_0xb517('0xf')][_0xb517('0x12')]);return _0x23f9e8(_0xafd8f7[_0xb517('0xf')][_0xb517('0x12')]);}logger[_0xb517('0xf')](_0xb517('0x11'),_0x4f55f7,_0xafd8f7[_0xb517('0xf')][_0xb517('0x12')]);return _0x3678f9(_0xafd8f7[_0xb517('0xf')][_0xb517('0x12')]);}else{logger[_0xb517('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x4f55f7,_0xb517('0xb'));_0x3678f9(_0xafd8f7[_0xb517('0x14')][_0xb517('0x12')]);}})[_0xb517('0x15')](function(_0x7e93db){logger[_0xb517('0xf')](_0xb517('0x11'),_0x4f55f7,_0x7e93db);_0x23f9e8(_0x7e93db);});});}exports['GetSalesforceAccount']=function(_0x229adc){var _0x38de0e=this;return new Promise(function(_0x30e603,_0x3ef0cf){return db['SalesforceAccount']['findAll']({'raw':_0x229adc[_0xb517('0x16')]?_0x229adc['options'][_0xb517('0x17')]===undefined?!![]:![]:!![],'where':_0x229adc[_0xb517('0x16')]?_0x229adc['options'][_0xb517('0x18')]||null:null,'attributes':_0x229adc[_0xb517('0x16')]?_0x229adc[_0xb517('0x16')]['attributes']||null:null,'limit':_0x229adc[_0xb517('0x16')]?_0x229adc[_0xb517('0x16')]['limit']||null:null,'include':_0x229adc[_0xb517('0x16')]?_0x229adc[_0xb517('0x16')]['include']?_[_0xb517('0x19')](_0x229adc['options'][_0xb517('0x1a')],function(_0x8dfcda){return{'model':db[_0x8dfcda['model']],'as':_0x8dfcda['as'],'attributes':_0x8dfcda[_0xb517('0x1b')],'include':_0x8dfcda[_0xb517('0x1a')]?_['map'](_0x8dfcda['include'],function(_0x529cc9){return{'model':db[_0x529cc9[_0xb517('0x1c')]],'as':_0x529cc9['as'],'attributes':_0x529cc9['attributes'],'include':_0x529cc9[_0xb517('0x1a')]?_[_0xb517('0x19')](_0x529cc9[_0xb517('0x1a')],function(_0x4f7f53){return{'model':db[_0x4f7f53['model']],'as':_0x4f7f53['as'],'attributes':_0x4f7f53[_0xb517('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb517('0x1d')](function(_0x57e30a){logger[_0xb517('0x13')](_0xb517('0x1e'),_0x229adc);logger[_0xb517('0xc')](_0xb517('0x1e'),_0x229adc,JSON[_0xb517('0xe')](_0x57e30a));_0x30e603(_0x57e30a);})[_0xb517('0x15')](function(_0xfd2e89){logger[_0xb517('0xf')](_0xb517('0x1e'),_0xfd2e89[_0xb517('0x12')],_0x229adc);_0x3ef0cf(_0x38de0e[_0xb517('0xf')](0x1f4,_0xfd2e89[_0xb517('0x12')]));});});};exports[_0xb517('0x1f')]=function(_0xc467dd){var _0x48777e=this;return new Promise(function(_0x42e78f,_0x2c548e){return db['SalesforceAccount'][_0xb517('0x20')]({'raw':_0xc467dd[_0xb517('0x16')]?_0xc467dd[_0xb517('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xc467dd[_0xb517('0x16')]?_0xc467dd[_0xb517('0x16')][_0xb517('0x18')]||null:null,'attributes':_0xc467dd[_0xb517('0x16')]?_0xc467dd[_0xb517('0x16')][_0xb517('0x1b')]||null:null,'include':_0xc467dd[_0xb517('0x16')]?_0xc467dd[_0xb517('0x16')]['include']?_[_0xb517('0x19')](_0xc467dd[_0xb517('0x16')][_0xb517('0x1a')],function(_0x1695b0){return{'model':db[_0x1695b0[_0xb517('0x1c')]],'as':_0x1695b0['as'],'attributes':_0x1695b0[_0xb517('0x1b')],'include':_0x1695b0[_0xb517('0x1a')]?_[_0xb517('0x19')](_0x1695b0[_0xb517('0x1a')],function(_0x3e1d37){return{'model':db[_0x3e1d37[_0xb517('0x1c')]],'as':_0x3e1d37['as'],'attributes':_0x3e1d37[_0xb517('0x1b')],'include':_0x3e1d37['include']?_[_0xb517('0x19')](_0x3e1d37['include'],function(_0x507c82){return{'model':db[_0x507c82[_0xb517('0x1c')]],'as':_0x507c82['as'],'attributes':_0x507c82['attributes']};}):[]};}):[]};}):[]:[]})[_0xb517('0x1d')](function(_0x3222a8){logger[_0xb517('0x13')](_0xb517('0x1f'),_0xc467dd);logger['debug'](_0xb517('0x1f'),_0xc467dd,JSON[_0xb517('0xe')](_0x3222a8));_0x42e78f(_0x3222a8);})[_0xb517('0x15')](function(_0x4a06e5){logger['error'](_0xb517('0x1f'),_0x4a06e5['message'],_0xc467dd);_0x2c548e(_0x48777e[_0xb517('0xf')](0x1f4,_0x4a06e5[_0xb517('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 20b8f3f..98024d1 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x46a1aa,_0x4e1dc5){var _0xbf6aed=function(_0x2be96b){while(--_0x2be96b){_0x46a1aa['push'](_0x46a1aa['shift']());}};_0xbf6aed(++_0x4e1dc5);}(_0xadb5,0xad));var _0x5adb=function(_0x3a8768,_0x392a32){_0x3a8768=_0x3a8768-0x0;var _0x18f9fc=_0xadb5[_0x3a8768];return _0x18f9fc;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file +var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0x0b0e,0x187));var _0xe0b0=function(_0xf7a9cf,_0x2cfa33){_0xf7a9cf=_0xf7a9cf-0x0;var _0x7fdc45=_0x0b0e[_0xf7a9cf];return _0x7fdc45;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 6a12a3a..58d6f54 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x06f2=['account','sequelize','STRING','ENUM','Task','Case','account_contact_lead','contact_lead','contact','lead'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x06f2,0x137));var _0x206f=function(_0x17e4f3,_0x38b1a7){_0x17e4f3=_0x17e4f3-0x0;var _0x387977=_0x06f2[_0x17e4f3];return _0x387977;};'use strict';var Sequelize=require(_0x206f('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x206f('0x1')]},'ticketType':{'type':Sequelize[_0x206f('0x2')](_0x206f('0x3'),_0x206f('0x4')),'defaultValue':_0x206f('0x3')},'moduleSearch':{'type':Sequelize[_0x206f('0x2')]('contact_lead','contact','lead',_0x206f('0x5'),'account'),'defaultValue':_0x206f('0x6')},'moduleCreate':{'type':Sequelize[_0x206f('0x2')]('nothing',_0x206f('0x7'),_0x206f('0x8'),_0x206f('0x9')),'defaultValue':_0x206f('0x8')},'leadId':{'type':Sequelize[_0x206f('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x206f('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x206f('0x1')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x586b=['nothing','contact','lead','STRING','ENUM','Task','Case','contact_lead','account_contact_lead','account'];(function(_0x218972,_0x1f9794){var _0x1bb1a8=function(_0x3fb962){while(--_0x3fb962){_0x218972['push'](_0x218972['shift']());}};_0x1bb1a8(++_0x1f9794);}(_0x586b,0x1bb));var _0xb586=function(_0x54a646,_0x1d109a){_0x54a646=_0x54a646-0x0;var _0x902e2f=_0x586b[_0x54a646];return _0x902e2f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb586('0x0')]},'description':{'type':Sequelize[_0xb586('0x0')]},'ticketType':{'type':Sequelize[_0xb586('0x1')](_0xb586('0x2'),_0xb586('0x3')),'defaultValue':_0xb586('0x2')},'moduleSearch':{'type':Sequelize[_0xb586('0x1')](_0xb586('0x4'),'contact','lead',_0xb586('0x5'),_0xb586('0x6')),'defaultValue':_0xb586('0x4')},'moduleCreate':{'type':Sequelize[_0xb586('0x1')](_0xb586('0x7'),_0xb586('0x8'),'lead',_0xb586('0x6')),'defaultValue':_0xb586('0x9')},'leadId':{'type':Sequelize[_0xb586('0x0')]},'additionalSearchAccount':{'type':Sequelize[_0xb586('0x0')]},'additionalSearchContact':{'type':Sequelize[_0xb586('0x0')]},'additionalSearchLead':{'type':Sequelize[_0xb586('0x0')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index d7280aa..4d739bd 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb90d=['path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','reject','update','destroy','then','end','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','body','find','getFields','SalesforceField','order','getSubjects','findOne','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xb90d,0x17a));var _0xdb90=function(_0x14ec9d,_0x45d283){_0x14ec9d=_0x14ec9d-0x0;var _0x3636df=_0xb90d[_0x14ec9d];return _0x3636df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb90('0x0'));var zipdir=require(_0xdb90('0x1'));var jsonpatch=require(_0xdb90('0x2'));var rp=require(_0xdb90('0x3'));var moment=require(_0xdb90('0x4'));var BPromise=require(_0xdb90('0x5'));var Mustache=require('mustache');var util=require(_0xdb90('0x6'));var path=require(_0xdb90('0x7'));var sox=require(_0xdb90('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb90('0x9'));var _=require(_0xdb90('0xa'));var squel=require(_0xdb90('0xb'));var crypto=require(_0xdb90('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdb90('0xd'));var toCsv=require(_0xdb90('0xe'));var querystring=require(_0xdb90('0xf'));var Papa=require('papaparse');var Redis=require(_0xdb90('0x10'));var authService=require(_0xdb90('0x11'));var qs=require(_0xdb90('0x12'));var as=require(_0xdb90('0x13'));var hardwareService=require(_0xdb90('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xdb90('0x15'));var licenseUtil=require(_0xdb90('0x16'));var db=require(_0xdb90('0x17'))['db'];function respondWithStatusCode(_0xb5ea64,_0xdc179e){_0xdc179e=_0xdc179e||0xcc;return function(_0x113659){if(_0x113659){return _0xb5ea64['sendStatus'](_0xdc179e);}return _0xb5ea64['status'](_0xdc179e)['end']();};}function respondWithResult(_0x511592,_0x569d40){_0x569d40=_0x569d40||0xc8;return function(_0x5eb6ef){if(_0x5eb6ef){return _0x511592[_0xdb90('0x18')](_0x569d40)[_0xdb90('0x19')](_0x5eb6ef);}};}function respondWithFilteredResult(_0x5b93b1,_0x19b02e){return function(_0x1cde0d){if(_0x1cde0d){var _0x4db002=typeof _0x19b02e['offset']===_0xdb90('0x1a')&&typeof _0x19b02e[_0xdb90('0x1b')]===_0xdb90('0x1a');var _0x5101e9=_0x1cde0d[_0xdb90('0x1c')];var _0x13f6df=_0x4db002?0x0:_0x19b02e[_0xdb90('0x1d')];var _0x44d4d4=_0x4db002?_0x1cde0d[_0xdb90('0x1c')]:_0x19b02e[_0xdb90('0x1d')]+_0x19b02e[_0xdb90('0x1b')];var _0x1838ed;if(_0x44d4d4>=_0x5101e9){_0x44d4d4=_0x5101e9;_0x1838ed=0xc8;}else{_0x1838ed=0xce;}_0x5b93b1[_0xdb90('0x18')](_0x1838ed);return _0x5b93b1[_0xdb90('0x1e')]('Content-Range',_0x13f6df+'-'+_0x44d4d4+'/'+_0x5101e9)['json'](_0x1cde0d);}return null;};}function patchUpdates(_0x4110c7){return function(_0x1c2dbe){try{jsonpatch[_0xdb90('0x1f')](_0x1c2dbe,_0x4110c7,!![]);}catch(_0x13f84d){return BPromise[_0xdb90('0x20')](_0x13f84d);}return _0x1c2dbe['save']();};}function saveUpdates(_0x31f9df,_0x922395){return function(_0x590e6a){if(_0x590e6a){return _0x590e6a[_0xdb90('0x21')](_0x31f9df)['then'](function(_0x185b08){return _0x185b08;});}return null;};}function removeEntity(_0x2fdb1b,_0x1fe5ab){return function(_0x463199){if(_0x463199){return _0x463199[_0xdb90('0x22')]()[_0xdb90('0x23')](function(){_0x2fdb1b[_0xdb90('0x18')](0xcc)[_0xdb90('0x24')]();});}};}function handleEntityNotFound(_0x1ef44a,_0x1fed39){return function(_0x64268c){if(!_0x64268c){_0x1ef44a['sendStatus'](0x194);}return _0x64268c;};}function handleError(_0x1a27c3,_0xedb1a6){_0xedb1a6=_0xedb1a6||0x1f4;return function(_0x3fcafd){logger['error'](_0x3fcafd['stack']);if(_0x3fcafd[_0xdb90('0x25')]){delete _0x3fcafd[_0xdb90('0x25')];}_0x1a27c3[_0xdb90('0x18')](_0xedb1a6)[_0xdb90('0x26')](_0x3fcafd);};}exports[_0xdb90('0x27')]=function(_0x321efc,_0x46f743){var _0x67aebc={},_0x554d8f={},_0x3c8671={'count':0x0,'rows':[]};var _0x204f8a=_[_0xdb90('0x28')](db[_0xdb90('0x29')][_0xdb90('0x2a')],function(_0x66ecd3){return{'name':_0x66ecd3[_0xdb90('0x2b')],'type':_0x66ecd3[_0xdb90('0x2c')][_0xdb90('0x2d')]};});_0x554d8f[_0xdb90('0x2e')]=_[_0xdb90('0x28')](_0x204f8a,_0xdb90('0x25'));_0x554d8f[_0xdb90('0x2f')]=_[_0xdb90('0x30')](_0x321efc['query']);_0x554d8f[_0xdb90('0x31')]=_[_0xdb90('0x32')](_0x554d8f[_0xdb90('0x2e')],_0x554d8f[_0xdb90('0x2f')]);_0x67aebc[_0xdb90('0x33')]=_[_0xdb90('0x32')](_0x554d8f[_0xdb90('0x2e')],qs[_0xdb90('0x34')](_0x321efc[_0xdb90('0x2f')][_0xdb90('0x34')]));_0x67aebc['attributes']=_0x67aebc[_0xdb90('0x33')][_0xdb90('0x35')]?_0x67aebc['attributes']:_0x554d8f[_0xdb90('0x2e')];if(!_0x321efc[_0xdb90('0x2f')][_0xdb90('0x36')](_0xdb90('0x37'))){_0x67aebc[_0xdb90('0x1b')]=qs['limit'](_0x321efc[_0xdb90('0x2f')][_0xdb90('0x1b')]);_0x67aebc[_0xdb90('0x1d')]=qs['offset'](_0x321efc[_0xdb90('0x2f')][_0xdb90('0x1d')]);}_0x67aebc['order']=qs[_0xdb90('0x38')](_0x321efc[_0xdb90('0x2f')][_0xdb90('0x38')]);_0x67aebc[_0xdb90('0x39')]=qs['filters'](_[_0xdb90('0x3a')](_0x321efc[_0xdb90('0x2f')],_0x554d8f['filters']),_0x204f8a);if(_0x321efc['query'][_0xdb90('0x3b')]){_0x67aebc[_0xdb90('0x39')]=_[_0xdb90('0x3c')](_0x67aebc[_0xdb90('0x39')],{'$or':_['map'](_0x204f8a,function(_0x13ae1b){if(_0x13ae1b['type']!=='VIRTUAL'){var _0x5676db={};_0x5676db[_0x13ae1b[_0xdb90('0x25')]]={'$like':'%'+_0x321efc[_0xdb90('0x2f')][_0xdb90('0x3b')]+'%'};return _0x5676db;}})});}_0x67aebc=_[_0xdb90('0x3c')]({},_0x67aebc,_0x321efc[_0xdb90('0x3d')]);var _0x57ba6b={'where':_0x67aebc[_0xdb90('0x39')]};return db['SalesforceConfiguration'][_0xdb90('0x1c')](_0x57ba6b)[_0xdb90('0x23')](function(_0x5afca9){_0x3c8671['count']=_0x5afca9;if(_0x321efc[_0xdb90('0x2f')]['includeAll']){_0x67aebc[_0xdb90('0x3e')]=[{'all':!![]}];}return db[_0xdb90('0x29')][_0xdb90('0x3f')](_0x67aebc);})['then'](function(_0x300d70){_0x3c8671[_0xdb90('0x40')]=_0x300d70;return _0x3c8671;})['then'](respondWithFilteredResult(_0x46f743,_0x67aebc))[_0xdb90('0x41')](handleError(_0x46f743,null));};exports[_0xdb90('0x42')]=function(_0x2eec66,_0x68e9e5){var _0x1e2e7f={'raw':![],'where':{'id':_0x2eec66[_0xdb90('0x43')]['id']}},_0x284342={};_0x284342[_0xdb90('0x2e')]=_['keys'](db[_0xdb90('0x29')]['rawAttributes']);_0x284342['query']=_['keys'](_0x2eec66[_0xdb90('0x2f')]);_0x284342['filters']=_['intersection'](_0x284342[_0xdb90('0x2e')],_0x284342[_0xdb90('0x2f')]);_0x1e2e7f[_0xdb90('0x33')]=_[_0xdb90('0x32')](_0x284342['model'],qs[_0xdb90('0x34')](_0x2eec66[_0xdb90('0x2f')][_0xdb90('0x34')]));_0x1e2e7f[_0xdb90('0x33')]=_0x1e2e7f[_0xdb90('0x33')][_0xdb90('0x35')]?_0x1e2e7f[_0xdb90('0x33')]:_0x284342[_0xdb90('0x2e')];if(_0x2eec66[_0xdb90('0x2f')][_0xdb90('0x44')]){_0x1e2e7f[_0xdb90('0x3e')]=[{'all':!![]}];}_0x1e2e7f=_[_0xdb90('0x3c')]({},_0x1e2e7f,_0x2eec66[_0xdb90('0x3d')]);return db['SalesforceConfiguration']['find'](_0x1e2e7f)['then'](handleEntityNotFound(_0x68e9e5,null))['then'](respondWithResult(_0x68e9e5,null))[_0xdb90('0x41')](handleError(_0x68e9e5,null));};exports['create']=function(_0x56fef9,_0x4ba023){return db[_0xdb90('0x29')]['create'](_0x56fef9[_0xdb90('0x45')],{})[_0xdb90('0x23')](respondWithResult(_0x4ba023,0xc9))[_0xdb90('0x41')](handleError(_0x4ba023,null));};exports[_0xdb90('0x21')]=function(_0x16888b,_0x21c540){if(_0x16888b[_0xdb90('0x45')]['id']){delete _0x16888b[_0xdb90('0x45')]['id'];}return db['SalesforceConfiguration'][_0xdb90('0x46')]({'where':{'id':_0x16888b[_0xdb90('0x43')]['id']}})['then'](handleEntityNotFound(_0x21c540,null))['then'](saveUpdates(_0x16888b[_0xdb90('0x45')],null))[_0xdb90('0x23')](respondWithResult(_0x21c540,null))[_0xdb90('0x41')](handleError(_0x21c540,null));};exports['destroy']=function(_0x3ebe50,_0x13be35){return db[_0xdb90('0x29')][_0xdb90('0x46')]({'where':{'id':_0x3ebe50[_0xdb90('0x43')]['id']}})[_0xdb90('0x23')](handleEntityNotFound(_0x13be35,null))[_0xdb90('0x23')](removeEntity(_0x13be35,null))[_0xdb90('0x41')](handleError(_0x13be35,null));};exports[_0xdb90('0x47')]=function(_0x507d6e,_0x1aa695,_0x24726e){var _0x54a4ca={};var _0x58dcff={};var _0x5c0f70;var _0x3befa9;return db[_0xdb90('0x29')]['findOne']({'where':{'id':_0x507d6e['params']['id']}})[_0xdb90('0x23')](handleEntityNotFound(_0x1aa695,null))[_0xdb90('0x23')](function(_0x28606a){if(_0x28606a){_0x5c0f70=_0x28606a;_0x58dcff[_0xdb90('0x2e')]=_['keys'](db[_0xdb90('0x48')][_0xdb90('0x2a')]);_0x58dcff['query']=_['keys'](_0x507d6e[_0xdb90('0x2f')]);_0x58dcff[_0xdb90('0x31')]=_[_0xdb90('0x32')](_0x58dcff[_0xdb90('0x2e')],_0x58dcff[_0xdb90('0x2f')]);_0x54a4ca[_0xdb90('0x33')]=_['intersection'](_0x58dcff['model'],qs[_0xdb90('0x34')](_0x507d6e[_0xdb90('0x2f')]['fields']));_0x54a4ca[_0xdb90('0x33')]=_0x54a4ca[_0xdb90('0x33')][_0xdb90('0x35')]?_0x54a4ca[_0xdb90('0x33')]:_0x58dcff['model'];_0x54a4ca[_0xdb90('0x49')]=qs['sort'](_0x507d6e[_0xdb90('0x2f')][_0xdb90('0x38')]);_0x54a4ca[_0xdb90('0x39')]=qs[_0xdb90('0x31')](_[_0xdb90('0x3a')](_0x507d6e['query'],_0x58dcff['filters']));if(_0x507d6e[_0xdb90('0x2f')][_0xdb90('0x3b')]){_0x54a4ca[_0xdb90('0x39')]=_[_0xdb90('0x3c')](_0x54a4ca['where'],{'$or':_[_0xdb90('0x28')](_0x54a4ca[_0xdb90('0x33')],function(_0x443d13){var _0x318382={};_0x318382[_0x443d13]={'$like':'%'+_0x507d6e[_0xdb90('0x2f')][_0xdb90('0x3b')]+'%'};return _0x318382;})});}_0x54a4ca=_['merge']({},_0x54a4ca,_0x507d6e[_0xdb90('0x3d')]);return _0x5c0f70[_0xdb90('0x47')](_0x54a4ca);}})[_0xdb90('0x23')](function(_0x38702d){if(_0x38702d){_0x3befa9=_0x38702d[_0xdb90('0x35')];if(!_0x507d6e[_0xdb90('0x2f')][_0xdb90('0x36')]('nolimit')){_0x54a4ca[_0xdb90('0x1b')]=qs[_0xdb90('0x1b')](_0x507d6e[_0xdb90('0x2f')][_0xdb90('0x1b')]);_0x54a4ca[_0xdb90('0x1d')]=qs[_0xdb90('0x1d')](_0x507d6e['query'][_0xdb90('0x1d')]);}return _0x5c0f70[_0xdb90('0x47')](_0x54a4ca);}})['then'](function(_0x30cf1a){if(_0x30cf1a){return _0x30cf1a?{'count':_0x3befa9,'rows':_0x30cf1a}:null;}})[_0xdb90('0x23')](respondWithResult(_0x1aa695,null))[_0xdb90('0x41')](handleError(_0x1aa695,null));};exports[_0xdb90('0x4a')]=function(_0x2fc237,_0x5ec05f,_0x379480){var _0x5c3676={};var _0x157841={};var _0x20fbf5;var _0x29e13f;return db[_0xdb90('0x29')][_0xdb90('0x4b')]({'where':{'id':_0x2fc237[_0xdb90('0x43')]['id']}})['then'](handleEntityNotFound(_0x5ec05f,null))[_0xdb90('0x23')](function(_0x2c9107){if(_0x2c9107){_0x20fbf5=_0x2c9107;_0x157841['model']=_['keys'](db[_0xdb90('0x48')][_0xdb90('0x2a')]);_0x157841[_0xdb90('0x2f')]=_[_0xdb90('0x30')](_0x2fc237['query']);_0x157841[_0xdb90('0x31')]=_[_0xdb90('0x32')](_0x157841['model'],_0x157841[_0xdb90('0x2f')]);_0x5c3676[_0xdb90('0x33')]=_[_0xdb90('0x32')](_0x157841[_0xdb90('0x2e')],qs[_0xdb90('0x34')](_0x2fc237['query'][_0xdb90('0x34')]));_0x5c3676[_0xdb90('0x33')]=_0x5c3676['attributes'][_0xdb90('0x35')]?_0x5c3676[_0xdb90('0x33')]:_0x157841[_0xdb90('0x2e')];_0x5c3676['order']=qs[_0xdb90('0x38')](_0x2fc237[_0xdb90('0x2f')][_0xdb90('0x38')]);_0x5c3676[_0xdb90('0x39')]=qs['filters'](_[_0xdb90('0x3a')](_0x2fc237[_0xdb90('0x2f')],_0x157841['filters']));if(_0x2fc237['query'][_0xdb90('0x3b')]){_0x5c3676[_0xdb90('0x39')]=_['merge'](_0x5c3676['where'],{'$or':_[_0xdb90('0x28')](_0x5c3676[_0xdb90('0x33')],function(_0x6b94aa){var _0x8220a={};_0x8220a[_0x6b94aa]={'$like':'%'+_0x2fc237[_0xdb90('0x2f')][_0xdb90('0x3b')]+'%'};return _0x8220a;})});}_0x5c3676=_[_0xdb90('0x3c')]({},_0x5c3676,_0x2fc237['options']);return _0x20fbf5[_0xdb90('0x4a')](_0x5c3676);}})[_0xdb90('0x23')](function(_0x59798e){if(_0x59798e){_0x29e13f=_0x59798e['length'];if(!_0x2fc237[_0xdb90('0x2f')]['hasOwnProperty'](_0xdb90('0x37'))){_0x5c3676['limit']=qs[_0xdb90('0x1b')](_0x2fc237[_0xdb90('0x2f')][_0xdb90('0x1b')]);_0x5c3676['offset']=qs[_0xdb90('0x1d')](_0x2fc237[_0xdb90('0x2f')][_0xdb90('0x1d')]);}return _0x20fbf5[_0xdb90('0x4a')](_0x5c3676);}})['then'](function(_0x5214b7){if(_0x5214b7){return _0x5214b7?{'count':_0x29e13f,'rows':_0x5214b7}:null;}})[_0xdb90('0x23')](respondWithResult(_0x5ec05f,null))['catch'](handleError(_0x5ec05f,null));};exports[_0xdb90('0x4c')]=function(_0x4b5079,_0x257eeb,_0x39677b){var _0x5aafaf={};var _0x2e5bcd={};var _0x1bbe49;var _0x5d4a14;return db['SalesforceConfiguration'][_0xdb90('0x4b')]({'where':{'id':_0x4b5079[_0xdb90('0x43')]['id']}})[_0xdb90('0x23')](handleEntityNotFound(_0x257eeb,null))[_0xdb90('0x23')](function(_0x54bd6b){if(_0x54bd6b){_0x1bbe49=_0x54bd6b;_0x2e5bcd[_0xdb90('0x2e')]=_[_0xdb90('0x30')](db['SalesforceField'][_0xdb90('0x2a')]);_0x2e5bcd['query']=_[_0xdb90('0x30')](_0x4b5079[_0xdb90('0x2f')]);_0x2e5bcd[_0xdb90('0x31')]=_[_0xdb90('0x32')](_0x2e5bcd['model'],_0x2e5bcd['query']);_0x5aafaf[_0xdb90('0x33')]=_[_0xdb90('0x32')](_0x2e5bcd['model'],qs[_0xdb90('0x34')](_0x4b5079[_0xdb90('0x2f')][_0xdb90('0x34')]));_0x5aafaf[_0xdb90('0x33')]=_0x5aafaf[_0xdb90('0x33')][_0xdb90('0x35')]?_0x5aafaf[_0xdb90('0x33')]:_0x2e5bcd[_0xdb90('0x2e')];_0x5aafaf['order']=qs[_0xdb90('0x38')](_0x4b5079[_0xdb90('0x2f')][_0xdb90('0x38')]);_0x5aafaf[_0xdb90('0x39')]=qs['filters'](_[_0xdb90('0x3a')](_0x4b5079['query'],_0x2e5bcd[_0xdb90('0x31')]));if(_0x4b5079[_0xdb90('0x2f')]['filter']){_0x5aafaf[_0xdb90('0x39')]=_[_0xdb90('0x3c')](_0x5aafaf[_0xdb90('0x39')],{'$or':_[_0xdb90('0x28')](_0x5aafaf[_0xdb90('0x33')],function(_0x4d5822){var _0x239979={};_0x239979[_0x4d5822]={'$like':'%'+_0x4b5079[_0xdb90('0x2f')][_0xdb90('0x3b')]+'%'};return _0x239979;})});}_0x5aafaf=_[_0xdb90('0x3c')]({},_0x5aafaf,_0x4b5079[_0xdb90('0x3d')]);return _0x1bbe49[_0xdb90('0x4c')](_0x5aafaf);}})[_0xdb90('0x23')](function(_0x30ff5d){if(_0x30ff5d){_0x5d4a14=_0x30ff5d[_0xdb90('0x35')];if(!_0x4b5079[_0xdb90('0x2f')][_0xdb90('0x36')](_0xdb90('0x37'))){_0x5aafaf[_0xdb90('0x1b')]=qs[_0xdb90('0x1b')](_0x4b5079['query']['limit']);_0x5aafaf['offset']=qs[_0xdb90('0x1d')](_0x4b5079[_0xdb90('0x2f')][_0xdb90('0x1d')]);}return _0x1bbe49[_0xdb90('0x4c')](_0x5aafaf);}})[_0xdb90('0x23')](function(_0x669840){if(_0x669840){return _0x669840?{'count':_0x5d4a14,'rows':_0x669840}:null;}})[_0xdb90('0x23')](respondWithResult(_0x257eeb,null))[_0xdb90('0x41')](handleError(_0x257eeb,null));}; \ No newline at end of file +var _0x5d96=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','name','send','index','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','filter','where','merge','VIRTUAL','options','SalesforceConfiguration','includeAll','include','rows','catch','params','rawAttributes','find','create','body','destroy','getFields','findOne','SalesforceField','length','sort','getSubjects','pick','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x5d96,0xdf));var _0x65d9=function(_0xb77d9b,_0x406c11){_0xb77d9b=_0xb77d9b-0x0;var _0x5cc5e1=_0x5d96[_0xb77d9b];return _0x5cc5e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65d9('0x0'));var zipdir=require(_0x65d9('0x1'));var jsonpatch=require(_0x65d9('0x2'));var rp=require(_0x65d9('0x3'));var moment=require('moment');var BPromise=require(_0x65d9('0x4'));var Mustache=require('mustache');var util=require(_0x65d9('0x5'));var path=require('path');var sox=require(_0x65d9('0x6'));var csv=require(_0x65d9('0x7'));var ejs=require(_0x65d9('0x8'));var fs=require('fs');var fs_extra=require(_0x65d9('0x9'));var _=require(_0x65d9('0xa'));var squel=require(_0x65d9('0xb'));var crypto=require(_0x65d9('0xc'));var jsforce=require(_0x65d9('0xd'));var deskjs=require(_0x65d9('0xe'));var toCsv=require(_0x65d9('0x7'));var querystring=require(_0x65d9('0xf'));var Papa=require(_0x65d9('0x10'));var Redis=require(_0x65d9('0x11'));var authService=require(_0x65d9('0x12'));var qs=require(_0x65d9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x65d9('0x14'));var logger=require(_0x65d9('0x15'))(_0x65d9('0x16'));var utils=require(_0x65d9('0x17'));var config=require(_0x65d9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x65d9('0x19'))['db'];function respondWithStatusCode(_0xea0622,_0x25c393){_0x25c393=_0x25c393||0xcc;return function(_0x570d44){if(_0x570d44){return _0xea0622[_0x65d9('0x1a')](_0x25c393);}return _0xea0622[_0x65d9('0x1b')](_0x25c393)[_0x65d9('0x1c')]();};}function respondWithResult(_0x3727b3,_0x3cc5a3){_0x3cc5a3=_0x3cc5a3||0xc8;return function(_0x3e6c21){if(_0x3e6c21){return _0x3727b3[_0x65d9('0x1b')](_0x3cc5a3)[_0x65d9('0x1d')](_0x3e6c21);}};}function respondWithFilteredResult(_0x4fc784,_0x3550a9){return function(_0x22315a){if(_0x22315a){var _0x1fad9e=typeof _0x3550a9[_0x65d9('0x1e')]==='undefined'&&typeof _0x3550a9[_0x65d9('0x1f')]===_0x65d9('0x20');var _0x5eac15=_0x22315a[_0x65d9('0x21')];var _0x3350da=_0x1fad9e?0x0:_0x3550a9[_0x65d9('0x1e')];var _0x2c7f83=_0x1fad9e?_0x22315a['count']:_0x3550a9['offset']+_0x3550a9[_0x65d9('0x1f')];var _0x13079b;if(_0x2c7f83>=_0x5eac15){_0x2c7f83=_0x5eac15;_0x13079b=0xc8;}else{_0x13079b=0xce;}_0x4fc784[_0x65d9('0x1b')](_0x13079b);return _0x4fc784[_0x65d9('0x22')]('Content-Range',_0x3350da+'-'+_0x2c7f83+'/'+_0x5eac15)[_0x65d9('0x1d')](_0x22315a);}return null;};}function patchUpdates(_0x376e0d){return function(_0xd6a0eb){try{jsonpatch[_0x65d9('0x23')](_0xd6a0eb,_0x376e0d,!![]);}catch(_0x5ccffb){return BPromise[_0x65d9('0x24')](_0x5ccffb);}return _0xd6a0eb[_0x65d9('0x25')]();};}function saveUpdates(_0xa52563,_0x5db9a3){return function(_0x50c89c){if(_0x50c89c){return _0x50c89c[_0x65d9('0x26')](_0xa52563)[_0x65d9('0x27')](function(_0x8e8b1d){return _0x8e8b1d;});}return null;};}function removeEntity(_0x3c5bb9,_0x4b20cf){return function(_0x12b79f){if(_0x12b79f){return _0x12b79f['destroy']()['then'](function(){_0x3c5bb9[_0x65d9('0x1b')](0xcc)[_0x65d9('0x1c')]();});}};}function handleEntityNotFound(_0x31f930,_0x512568){return function(_0x35f20d){if(!_0x35f20d){_0x31f930[_0x65d9('0x1a')](0x194);}return _0x35f20d;};}function handleError(_0x3e0f41,_0x39467a){_0x39467a=_0x39467a||0x1f4;return function(_0x2a9e2f){logger[_0x65d9('0x28')](_0x2a9e2f['stack']);if(_0x2a9e2f['name']){delete _0x2a9e2f[_0x65d9('0x29')];}_0x3e0f41[_0x65d9('0x1b')](_0x39467a)[_0x65d9('0x2a')](_0x2a9e2f);};}exports[_0x65d9('0x2b')]=function(_0x571682,_0x431fb3){var _0x19b77e={},_0x3df92d={},_0x2eff6d={'count':0x0,'rows':[]};var _0x19e2a9=_['map'](db['SalesforceConfiguration']['rawAttributes'],function(_0x209e04){return{'name':_0x209e04['fieldName'],'type':_0x209e04[_0x65d9('0x2c')][_0x65d9('0x2d')]};});_0x3df92d[_0x65d9('0x2e')]=_[_0x65d9('0x2f')](_0x19e2a9,'name');_0x3df92d[_0x65d9('0x30')]=_[_0x65d9('0x31')](_0x571682[_0x65d9('0x30')]);_0x3df92d[_0x65d9('0x32')]=_[_0x65d9('0x33')](_0x3df92d['model'],_0x3df92d['query']);_0x19b77e[_0x65d9('0x34')]=_[_0x65d9('0x33')](_0x3df92d[_0x65d9('0x2e')],qs[_0x65d9('0x35')](_0x571682['query'][_0x65d9('0x35')]));_0x19b77e[_0x65d9('0x34')]=_0x19b77e[_0x65d9('0x34')]['length']?_0x19b77e[_0x65d9('0x34')]:_0x3df92d[_0x65d9('0x2e')];if(!_0x571682['query'][_0x65d9('0x36')](_0x65d9('0x37'))){_0x19b77e['limit']=qs[_0x65d9('0x1f')](_0x571682[_0x65d9('0x30')][_0x65d9('0x1f')]);_0x19b77e[_0x65d9('0x1e')]=qs[_0x65d9('0x1e')](_0x571682[_0x65d9('0x30')]['offset']);}_0x19b77e[_0x65d9('0x38')]=qs['sort'](_0x571682[_0x65d9('0x30')]['sort']);_0x19b77e['where']=qs[_0x65d9('0x32')](_['pick'](_0x571682[_0x65d9('0x30')],_0x3df92d[_0x65d9('0x32')]),_0x19e2a9);if(_0x571682[_0x65d9('0x30')][_0x65d9('0x39')]){_0x19b77e[_0x65d9('0x3a')]=_[_0x65d9('0x3b')](_0x19b77e[_0x65d9('0x3a')],{'$or':_[_0x65d9('0x2f')](_0x19e2a9,function(_0x434b39){if(_0x434b39['type']!==_0x65d9('0x3c')){var _0x317b40={};_0x317b40[_0x434b39['name']]={'$like':'%'+_0x571682[_0x65d9('0x30')][_0x65d9('0x39')]+'%'};return _0x317b40;}})});}_0x19b77e=_[_0x65d9('0x3b')]({},_0x19b77e,_0x571682[_0x65d9('0x3d')]);var _0x31c8bc={'where':_0x19b77e[_0x65d9('0x3a')]};return db[_0x65d9('0x3e')][_0x65d9('0x21')](_0x31c8bc)['then'](function(_0x3050dd){_0x2eff6d['count']=_0x3050dd;if(_0x571682['query'][_0x65d9('0x3f')]){_0x19b77e[_0x65d9('0x40')]=[{'all':!![]}];}return db[_0x65d9('0x3e')]['findAll'](_0x19b77e);})['then'](function(_0x62f620){_0x2eff6d[_0x65d9('0x41')]=_0x62f620;return _0x2eff6d;})[_0x65d9('0x27')](respondWithFilteredResult(_0x431fb3,_0x19b77e))[_0x65d9('0x42')](handleError(_0x431fb3,null));};exports['show']=function(_0x541ed9,_0x3fb3bd){var _0x3fa1d4={'raw':![],'where':{'id':_0x541ed9[_0x65d9('0x43')]['id']}},_0x312adf={};_0x312adf[_0x65d9('0x2e')]=_[_0x65d9('0x31')](db[_0x65d9('0x3e')][_0x65d9('0x44')]);_0x312adf[_0x65d9('0x30')]=_[_0x65d9('0x31')](_0x541ed9[_0x65d9('0x30')]);_0x312adf[_0x65d9('0x32')]=_[_0x65d9('0x33')](_0x312adf[_0x65d9('0x2e')],_0x312adf[_0x65d9('0x30')]);_0x3fa1d4[_0x65d9('0x34')]=_[_0x65d9('0x33')](_0x312adf[_0x65d9('0x2e')],qs[_0x65d9('0x35')](_0x541ed9['query'][_0x65d9('0x35')]));_0x3fa1d4[_0x65d9('0x34')]=_0x3fa1d4[_0x65d9('0x34')]['length']?_0x3fa1d4[_0x65d9('0x34')]:_0x312adf[_0x65d9('0x2e')];if(_0x541ed9[_0x65d9('0x30')][_0x65d9('0x3f')]){_0x3fa1d4[_0x65d9('0x40')]=[{'all':!![]}];}_0x3fa1d4=_[_0x65d9('0x3b')]({},_0x3fa1d4,_0x541ed9[_0x65d9('0x3d')]);return db[_0x65d9('0x3e')][_0x65d9('0x45')](_0x3fa1d4)[_0x65d9('0x27')](handleEntityNotFound(_0x3fb3bd,null))[_0x65d9('0x27')](respondWithResult(_0x3fb3bd,null))[_0x65d9('0x42')](handleError(_0x3fb3bd,null));};exports[_0x65d9('0x46')]=function(_0x4958cd,_0x60b788){return db[_0x65d9('0x3e')][_0x65d9('0x46')](_0x4958cd[_0x65d9('0x47')],{})['then'](respondWithResult(_0x60b788,0xc9))[_0x65d9('0x42')](handleError(_0x60b788,null));};exports[_0x65d9('0x26')]=function(_0x42e995,_0x48e5de){if(_0x42e995[_0x65d9('0x47')]['id']){delete _0x42e995[_0x65d9('0x47')]['id'];}return db['SalesforceConfiguration'][_0x65d9('0x45')]({'where':{'id':_0x42e995[_0x65d9('0x43')]['id']}})['then'](handleEntityNotFound(_0x48e5de,null))['then'](saveUpdates(_0x42e995[_0x65d9('0x47')],null))[_0x65d9('0x27')](respondWithResult(_0x48e5de,null))[_0x65d9('0x42')](handleError(_0x48e5de,null));};exports[_0x65d9('0x48')]=function(_0x19e942,_0x18b985){return db[_0x65d9('0x3e')][_0x65d9('0x45')]({'where':{'id':_0x19e942['params']['id']}})[_0x65d9('0x27')](handleEntityNotFound(_0x18b985,null))[_0x65d9('0x27')](removeEntity(_0x18b985,null))['catch'](handleError(_0x18b985,null));};exports[_0x65d9('0x49')]=function(_0x29ca5e,_0xbb70e1,_0x2efd3d){var _0x4da545={};var _0x1987c8={};var _0x40f34d;var _0x345cb7;return db[_0x65d9('0x3e')][_0x65d9('0x4a')]({'where':{'id':_0x29ca5e[_0x65d9('0x43')]['id']}})['then'](handleEntityNotFound(_0xbb70e1,null))[_0x65d9('0x27')](function(_0x46a0b3){if(_0x46a0b3){_0x40f34d=_0x46a0b3;_0x1987c8[_0x65d9('0x2e')]=_[_0x65d9('0x31')](db[_0x65d9('0x4b')][_0x65d9('0x44')]);_0x1987c8[_0x65d9('0x30')]=_[_0x65d9('0x31')](_0x29ca5e[_0x65d9('0x30')]);_0x1987c8['filters']=_[_0x65d9('0x33')](_0x1987c8[_0x65d9('0x2e')],_0x1987c8[_0x65d9('0x30')]);_0x4da545[_0x65d9('0x34')]=_[_0x65d9('0x33')](_0x1987c8[_0x65d9('0x2e')],qs[_0x65d9('0x35')](_0x29ca5e[_0x65d9('0x30')][_0x65d9('0x35')]));_0x4da545[_0x65d9('0x34')]=_0x4da545['attributes'][_0x65d9('0x4c')]?_0x4da545[_0x65d9('0x34')]:_0x1987c8[_0x65d9('0x2e')];_0x4da545[_0x65d9('0x38')]=qs['sort'](_0x29ca5e['query'][_0x65d9('0x4d')]);_0x4da545[_0x65d9('0x3a')]=qs[_0x65d9('0x32')](_['pick'](_0x29ca5e[_0x65d9('0x30')],_0x1987c8[_0x65d9('0x32')]));if(_0x29ca5e[_0x65d9('0x30')][_0x65d9('0x39')]){_0x4da545['where']=_[_0x65d9('0x3b')](_0x4da545[_0x65d9('0x3a')],{'$or':_[_0x65d9('0x2f')](_0x4da545['attributes'],function(_0x161745){var _0xcc1aab={};_0xcc1aab[_0x161745]={'$like':'%'+_0x29ca5e[_0x65d9('0x30')]['filter']+'%'};return _0xcc1aab;})});}_0x4da545=_[_0x65d9('0x3b')]({},_0x4da545,_0x29ca5e[_0x65d9('0x3d')]);return _0x40f34d['getFields'](_0x4da545);}})['then'](function(_0x22c093){if(_0x22c093){_0x345cb7=_0x22c093[_0x65d9('0x4c')];if(!_0x29ca5e['query'][_0x65d9('0x36')](_0x65d9('0x37'))){_0x4da545['limit']=qs[_0x65d9('0x1f')](_0x29ca5e[_0x65d9('0x30')][_0x65d9('0x1f')]);_0x4da545['offset']=qs['offset'](_0x29ca5e[_0x65d9('0x30')][_0x65d9('0x1e')]);}return _0x40f34d[_0x65d9('0x49')](_0x4da545);}})[_0x65d9('0x27')](function(_0x25dff4){if(_0x25dff4){return _0x25dff4?{'count':_0x345cb7,'rows':_0x25dff4}:null;}})['then'](respondWithResult(_0xbb70e1,null))[_0x65d9('0x42')](handleError(_0xbb70e1,null));};exports[_0x65d9('0x4e')]=function(_0x3fc53b,_0x49cfe6,_0x47d6c8){var _0x539d59={};var _0x2af9e2={};var _0x34459d;var _0x6f78f0;return db['SalesforceConfiguration'][_0x65d9('0x4a')]({'where':{'id':_0x3fc53b['params']['id']}})[_0x65d9('0x27')](handleEntityNotFound(_0x49cfe6,null))['then'](function(_0x1b4104){if(_0x1b4104){_0x34459d=_0x1b4104;_0x2af9e2[_0x65d9('0x2e')]=_['keys'](db[_0x65d9('0x4b')][_0x65d9('0x44')]);_0x2af9e2[_0x65d9('0x30')]=_['keys'](_0x3fc53b[_0x65d9('0x30')]);_0x2af9e2['filters']=_['intersection'](_0x2af9e2['model'],_0x2af9e2[_0x65d9('0x30')]);_0x539d59[_0x65d9('0x34')]=_[_0x65d9('0x33')](_0x2af9e2[_0x65d9('0x2e')],qs[_0x65d9('0x35')](_0x3fc53b[_0x65d9('0x30')][_0x65d9('0x35')]));_0x539d59[_0x65d9('0x34')]=_0x539d59[_0x65d9('0x34')][_0x65d9('0x4c')]?_0x539d59['attributes']:_0x2af9e2[_0x65d9('0x2e')];_0x539d59[_0x65d9('0x38')]=qs['sort'](_0x3fc53b[_0x65d9('0x30')]['sort']);_0x539d59['where']=qs[_0x65d9('0x32')](_[_0x65d9('0x4f')](_0x3fc53b[_0x65d9('0x30')],_0x2af9e2[_0x65d9('0x32')]));if(_0x3fc53b[_0x65d9('0x30')][_0x65d9('0x39')]){_0x539d59[_0x65d9('0x3a')]=_[_0x65d9('0x3b')](_0x539d59[_0x65d9('0x3a')],{'$or':_[_0x65d9('0x2f')](_0x539d59[_0x65d9('0x34')],function(_0x54cb55){var _0x1e1564={};_0x1e1564[_0x54cb55]={'$like':'%'+_0x3fc53b[_0x65d9('0x30')]['filter']+'%'};return _0x1e1564;})});}_0x539d59=_['merge']({},_0x539d59,_0x3fc53b['options']);return _0x34459d[_0x65d9('0x4e')](_0x539d59);}})['then'](function(_0x231081){if(_0x231081){_0x6f78f0=_0x231081[_0x65d9('0x4c')];if(!_0x3fc53b[_0x65d9('0x30')][_0x65d9('0x36')](_0x65d9('0x37'))){_0x539d59[_0x65d9('0x1f')]=qs[_0x65d9('0x1f')](_0x3fc53b[_0x65d9('0x30')][_0x65d9('0x1f')]);_0x539d59[_0x65d9('0x1e')]=qs[_0x65d9('0x1e')](_0x3fc53b[_0x65d9('0x30')]['offset']);}return _0x34459d[_0x65d9('0x4e')](_0x539d59);}})[_0x65d9('0x27')](function(_0x2029fc){if(_0x2029fc){return _0x2029fc?{'count':_0x6f78f0,'rows':_0x2029fc}:null;}})[_0x65d9('0x27')](respondWithResult(_0x49cfe6,null))['catch'](handleError(_0x49cfe6,null));};exports[_0x65d9('0x50')]=function(_0x5f0e73,_0x277ecf,_0x87d0b0){var _0x547ca2={};var _0x563d3f={};var _0x258ff4;var _0x13a5dc;return db['SalesforceConfiguration'][_0x65d9('0x4a')]({'where':{'id':_0x5f0e73[_0x65d9('0x43')]['id']}})[_0x65d9('0x27')](handleEntityNotFound(_0x277ecf,null))[_0x65d9('0x27')](function(_0x107700){if(_0x107700){_0x258ff4=_0x107700;_0x563d3f[_0x65d9('0x2e')]=_['keys'](db[_0x65d9('0x4b')][_0x65d9('0x44')]);_0x563d3f[_0x65d9('0x30')]=_[_0x65d9('0x31')](_0x5f0e73[_0x65d9('0x30')]);_0x563d3f[_0x65d9('0x32')]=_[_0x65d9('0x33')](_0x563d3f[_0x65d9('0x2e')],_0x563d3f['query']);_0x547ca2['attributes']=_['intersection'](_0x563d3f[_0x65d9('0x2e')],qs[_0x65d9('0x35')](_0x5f0e73[_0x65d9('0x30')][_0x65d9('0x35')]));_0x547ca2[_0x65d9('0x34')]=_0x547ca2[_0x65d9('0x34')][_0x65d9('0x4c')]?_0x547ca2[_0x65d9('0x34')]:_0x563d3f['model'];_0x547ca2[_0x65d9('0x38')]=qs['sort'](_0x5f0e73['query'][_0x65d9('0x4d')]);_0x547ca2['where']=qs[_0x65d9('0x32')](_[_0x65d9('0x4f')](_0x5f0e73[_0x65d9('0x30')],_0x563d3f[_0x65d9('0x32')]));if(_0x5f0e73[_0x65d9('0x30')]['filter']){_0x547ca2[_0x65d9('0x3a')]=_[_0x65d9('0x3b')](_0x547ca2['where'],{'$or':_[_0x65d9('0x2f')](_0x547ca2['attributes'],function(_0x1c6594){var _0x285aee={};_0x285aee[_0x1c6594]={'$like':'%'+_0x5f0e73[_0x65d9('0x30')][_0x65d9('0x39')]+'%'};return _0x285aee;})});}_0x547ca2=_['merge']({},_0x547ca2,_0x5f0e73[_0x65d9('0x3d')]);return _0x258ff4[_0x65d9('0x50')](_0x547ca2);}})[_0x65d9('0x27')](function(_0x43d940){if(_0x43d940){_0x13a5dc=_0x43d940['length'];if(!_0x5f0e73[_0x65d9('0x30')][_0x65d9('0x36')](_0x65d9('0x37'))){_0x547ca2[_0x65d9('0x1f')]=qs[_0x65d9('0x1f')](_0x5f0e73['query'][_0x65d9('0x1f')]);_0x547ca2[_0x65d9('0x1e')]=qs[_0x65d9('0x1e')](_0x5f0e73[_0x65d9('0x30')][_0x65d9('0x1e')]);}return _0x258ff4[_0x65d9('0x50')](_0x547ca2);}})[_0x65d9('0x27')](function(_0xb154a0){if(_0xb154a0){return _0xb154a0?{'count':_0x13a5dc,'rows':_0xb154a0}:null;}})[_0x65d9('0x27')](respondWithResult(_0x277ecf,null))[_0x65d9('0x42')](handleError(_0x277ecf,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 3739397..f2337ac 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02d1=['int_salesforce_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration'];(function(_0x126b99,_0x4b4f6a){var _0x183f95=function(_0x502642){while(--_0x502642){_0x126b99['push'](_0x126b99['shift']());}};_0x183f95(++_0x4b4f6a);}(_0x02d1,0xa9));var _0x102d=function(_0x4306a1,_0x1a1d8a){_0x4306a1=_0x4306a1-0x0;var _0x134a66=_0x02d1[_0x4306a1];return _0x134a66;};'use strict';var _=require(_0x102d('0x0'));var util=require('util');var logger=require(_0x102d('0x1'))(_0x102d('0x2'));var moment=require(_0x102d('0x3'));var BPromise=require(_0x102d('0x4'));var rp=require(_0x102d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x102d('0x6'));var attributes=require(_0x102d('0x7'));module[_0x102d('0x8')]=function(_0x7524fd,_0x207a00){return _0x7524fd[_0x102d('0x9')](_0x102d('0xa'),attributes,{'tableName':_0x102d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9009=['../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x159e26,_0x1ddf7b){var _0x57ba6f=function(_0x5d09f6){while(--_0x5d09f6){_0x159e26['push'](_0x159e26['shift']());}};_0x57ba6f(++_0x1ddf7b);}(_0x9009,0x12b));var _0x9900=function(_0x1d7cc7,_0x249d1e){_0x1d7cc7=_0x1d7cc7-0x0;var _0x5219e2=_0x9009[_0x1d7cc7];return _0x5219e2;};'use strict';var _=require(_0x9900('0x0'));var util=require(_0x9900('0x1'));var logger=require(_0x9900('0x2'))(_0x9900('0x3'));var moment=require(_0x9900('0x4'));var BPromise=require(_0x9900('0x5'));var rp=require(_0x9900('0x6'));var fs=require('fs');var path=require(_0x9900('0x7'));var rimraf=require(_0x9900('0x8'));var config=require(_0x9900('0x9'));var attributes=require(_0x9900('0xa'));module[_0x9900('0xb')]=function(_0x4d7d2c,_0x90a112){return _0x4d7d2c[_0x9900('0xc')]('SalesforceConfiguration',attributes,{'tableName':_0x9900('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index f82b515..d54a637 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe352=['message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0x21b077,_0x3d75bb){var _0x417e98=function(_0x2e3b92){while(--_0x2e3b92){_0x21b077['push'](_0x21b077['shift']());}};_0x417e98(++_0x3d75bb);}(_0xe352,0x6e));var _0x2e35=function(_0x129c93,_0xb1f51b){_0x129c93=_0x129c93-0x0;var _0x1a2e1d=_0xe352[_0x129c93];return _0x1a2e1d;};'use strict';var _=require(_0x2e35('0x0'));var util=require('util');var moment=require(_0x2e35('0x1'));var BPromise=require(_0x2e35('0x2'));var rs=require(_0x2e35('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e35('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e35('0x5'))(_0x2e35('0x6'));var config=require('../../config/environment');var jayson=require(_0x2e35('0x7'));var client=jayson[_0x2e35('0x8')][_0x2e35('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5403d7,_0x2cb507,_0x514aeb){return new BPromise(function(_0x4255c4,_0x362bfd){return client['request'](_0x5403d7,_0x514aeb)[_0x2e35('0xa')](function(_0x3d724f){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x2cb507,_0x2e35('0xb'));logger['debug'](_0x2e35('0xc'),_0x2cb507,_0x2e35('0xb'),JSON['stringify'](_0x3d724f));if(_0x3d724f['error']){if(_0x3d724f[_0x2e35('0xd')][_0x2e35('0xe')]===0x1f4){logger[_0x2e35('0xd')](_0x2e35('0xf'),_0x2cb507,_0x3d724f[_0x2e35('0xd')]['message']);return _0x362bfd(_0x3d724f['error']['message']);}logger[_0x2e35('0xd')](_0x2e35('0xf'),_0x2cb507,_0x3d724f[_0x2e35('0xd')][_0x2e35('0x10')]);return _0x4255c4(_0x3d724f[_0x2e35('0xd')][_0x2e35('0x10')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x2cb507,_0x2e35('0xb'));_0x4255c4(_0x3d724f[_0x2e35('0x11')][_0x2e35('0x10')]);}})['catch'](function(_0x1caea8){logger[_0x2e35('0xd')](_0x2e35('0xf'),_0x2cb507,_0x1caea8);_0x362bfd(_0x1caea8);});});} \ No newline at end of file +var _0x3431=['jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x259aee,_0x51a415){var _0x191c48=function(_0x3e65b6){while(--_0x3e65b6){_0x259aee['push'](_0x259aee['shift']());}};_0x191c48(++_0x51a415);}(_0x3431,0xc6));var _0x1343=function(_0x4a96ca,_0x13754e){_0x4a96ca=_0x4a96ca-0x0;var _0x2aed48=_0x3431[_0x4a96ca];return _0x2aed48;};'use strict';var _=require(_0x1343('0x0'));var util=require('util');var moment=require(_0x1343('0x1'));var BPromise=require(_0x1343('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1343('0x3'));var db=require(_0x1343('0x4'))['db'];var utils=require(_0x1343('0x5'));var logger=require(_0x1343('0x6'))(_0x1343('0x7'));var config=require(_0x1343('0x8'));var jayson=require(_0x1343('0x9'));var client=jayson[_0x1343('0xa')][_0x1343('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a8b3c,_0x5cd609,_0x3546b6){return new BPromise(function(_0x2423a4,_0x3fbe82){return client['request'](_0x3a8b3c,_0x3546b6)[_0x1343('0xc')](function(_0x25af0b){logger[_0x1343('0xd')](_0x1343('0xe'),_0x5cd609,_0x1343('0xf'));logger['debug'](_0x1343('0x10'),_0x5cd609,'request\x20sent',JSON[_0x1343('0x11')](_0x25af0b));if(_0x25af0b[_0x1343('0x12')]){if(_0x25af0b[_0x1343('0x12')][_0x1343('0x13')]===0x1f4){logger[_0x1343('0x12')](_0x1343('0xe'),_0x5cd609,_0x25af0b[_0x1343('0x12')][_0x1343('0x14')]);return _0x3fbe82(_0x25af0b[_0x1343('0x12')][_0x1343('0x14')]);}logger[_0x1343('0x12')](_0x1343('0xe'),_0x5cd609,_0x25af0b[_0x1343('0x12')]['message']);return _0x2423a4(_0x25af0b[_0x1343('0x12')][_0x1343('0x14')]);}else{logger[_0x1343('0xd')](_0x1343('0xe'),_0x5cd609,_0x1343('0xf'));_0x2423a4(_0x25af0b[_0x1343('0x15')]['message']);}})[_0x1343('0x16')](function(_0x53d67e){logger[_0x1343('0x12')](_0x1343('0xe'),_0x5cd609,_0x53d67e);_0x3fbe82(_0x53d67e);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 142513e..5f982f2 100644 --- a/server/api/intSalesforceField/index.js +++ b/server/api/intSalesforceField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xecb1=['delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','isAuthenticated','index','get','show','post','create','put','/:id','update'];(function(_0x41112f,_0x4de0e9){var _0x524faa=function(_0x1070f4){while(--_0x1070f4){_0x41112f['push'](_0x41112f['shift']());}};_0x524faa(++_0x4de0e9);}(_0xecb1,0x7a));var _0x1ecb=function(_0x236e28,_0x3f3e73){_0x236e28=_0x236e28-0x0;var _0x279130=_0xecb1[_0x236e28];return _0x279130;};'use strict';var multer=require(_0x1ecb('0x0'));var util=require(_0x1ecb('0x1'));var path=require('path');var timeout=require(_0x1ecb('0x2'));var express=require(_0x1ecb('0x3'));var router=express[_0x1ecb('0x4')]();var fs_extra=require(_0x1ecb('0x5'));var auth=require(_0x1ecb('0x6'));var interaction=require(_0x1ecb('0x7'));var config=require('../../config/environment');var controller=require(_0x1ecb('0x8'));router['get']('/',auth[_0x1ecb('0x9')](),controller[_0x1ecb('0xa')]);router[_0x1ecb('0xb')]('/:id',auth[_0x1ecb('0x9')](),controller[_0x1ecb('0xc')]);router[_0x1ecb('0xd')]('/',auth['isAuthenticated'](),controller[_0x1ecb('0xe')]);router[_0x1ecb('0xf')](_0x1ecb('0x10'),auth[_0x1ecb('0x9')](),controller[_0x1ecb('0x11')]);router[_0x1ecb('0x12')]('/:id',auth[_0x1ecb('0x9')](),controller['destroy']);module[_0x1ecb('0x13')]=router; \ No newline at end of file +var _0xf517=['index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get'];(function(_0x1e8c0a,_0x5921af){var _0x275615=function(_0x303e40){while(--_0x303e40){_0x1e8c0a['push'](_0x1e8c0a['shift']());}};_0x275615(++_0x5921af);}(_0xf517,0x9a));var _0x7f51=function(_0x881f55,_0x3a93fb){_0x881f55=_0x881f55-0x0;var _0x390245=_0xf517[_0x881f55];return _0x390245;};'use strict';var multer=require('multer');var util=require(_0x7f51('0x0'));var path=require(_0x7f51('0x1'));var timeout=require(_0x7f51('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7f51('0x3'));var interaction=require(_0x7f51('0x4'));var config=require(_0x7f51('0x5'));var controller=require(_0x7f51('0x6'));router[_0x7f51('0x7')]('/',auth['isAuthenticated'](),controller[_0x7f51('0x8')]);router['get'](_0x7f51('0x9'),auth[_0x7f51('0xa')](),controller[_0x7f51('0xb')]);router[_0x7f51('0xc')]('/',auth[_0x7f51('0xa')](),controller[_0x7f51('0xd')]);router[_0x7f51('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7f51('0xf')](_0x7f51('0x9'),auth['isAuthenticated'](),controller[_0x7f51('0x10')]);module[_0x7f51('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 72c9d52..3bcdb5c 100644 --- a/server/api/intSalesforceField/intSalesforceField.attributes.js +++ b/server/api/intSalesforceField/intSalesforceField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e53=['exports','string','customVariable','STRING','ENUM','variable','sequelize'];(function(_0x5cd33c,_0x151e9b){var _0x3ca5b7=function(_0x20abcc){while(--_0x20abcc){_0x5cd33c['push'](_0x5cd33c['shift']());}};_0x3ca5b7(++_0x151e9b);}(_0x0e53,0x13a));var _0x30e5=function(_0x3da6bc,_0x1b1203){_0x3da6bc=_0x3da6bc-0x0;var _0x4493ed=_0x0e53[_0x3da6bc];return _0x4493ed;};'use strict';var Sequelize=require(_0x30e5('0x0'));module[_0x30e5('0x1')]={'type':{'type':Sequelize['ENUM'](_0x30e5('0x2'),'variable',_0x30e5('0x3'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x30e5('0x4')]},'key':{'type':Sequelize[_0x30e5('0x4')]},'keyType':{'type':Sequelize[_0x30e5('0x5')]('string',_0x30e5('0x6'),_0x30e5('0x3'))},'keyContent':{'type':Sequelize[_0x30e5('0x4')]},'idField':{'type':Sequelize[_0x30e5('0x4')]},'variableName':{'type':Sequelize[_0x30e5('0x4')]}}; \ No newline at end of file +var _0x3ca6=['picklist','string','STRING','customVariable','sequelize','exports','ENUM','keyValue'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3ca6,0x84));var _0x63ca=function(_0x3273bf,_0x24c857){_0x3273bf=_0x3273bf-0x0;var _0x5975ab=_0x3ca6[_0x3273bf];return _0x5975ab;};'use strict';var Sequelize=require(_0x63ca('0x0'));module[_0x63ca('0x1')]={'type':{'type':Sequelize[_0x63ca('0x2')]('string','variable','customVariable',_0x63ca('0x3'),_0x63ca('0x4')),'defaultValue':_0x63ca('0x5')},'content':{'type':Sequelize[_0x63ca('0x6')]},'key':{'type':Sequelize[_0x63ca('0x6')]},'keyType':{'type':Sequelize[_0x63ca('0x2')](_0x63ca('0x5'),'variable',_0x63ca('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x63ca('0x6')]},'variableName':{'type':Sequelize[_0x63ca('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 599740e..398edf3 100644 --- a/server/api/intSalesforceField/intSalesforceField.controller.js +++ b/server/api/intSalesforceField/intSalesforceField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xefe7=['apply','reject','save','update','then','destroy','status','end','error','stack','name','index','fieldName','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','includeAll','include','SalesforceField','rows','catch','model','options','create','body','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x2c0380,_0x1f7c57){var _0x321502=function(_0x1e36ad){while(--_0x1e36ad){_0x2c0380['push'](_0x2c0380['shift']());}};_0x321502(++_0x1f7c57);}(_0xefe7,0xb9));var _0x7efe=function(_0x42c941,_0x13fd1e){_0x42c941=_0x42c941-0x0;var _0x25e7c0=_0xefe7[_0x42c941];return _0x25e7c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7efe('0x0'));var zipdir=require(_0x7efe('0x1'));var jsonpatch=require(_0x7efe('0x2'));var rp=require(_0x7efe('0x3'));var moment=require(_0x7efe('0x4'));var BPromise=require(_0x7efe('0x5'));var Mustache=require(_0x7efe('0x6'));var util=require(_0x7efe('0x7'));var path=require(_0x7efe('0x8'));var sox=require(_0x7efe('0x9'));var csv=require(_0x7efe('0xa'));var ejs=require(_0x7efe('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7efe('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7efe('0xd'));var toCsv=require(_0x7efe('0xa'));var querystring=require('querystring');var Papa=require(_0x7efe('0xe'));var Redis=require(_0x7efe('0xf'));var authService=require(_0x7efe('0x10'));var qs=require(_0x7efe('0x11'));var as=require(_0x7efe('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7efe('0x13'));var utils=require(_0x7efe('0x14'));var config=require(_0x7efe('0x15'));var licenseUtil=require(_0x7efe('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2890a3,_0x176a6d){_0x176a6d=_0x176a6d||0xcc;return function(_0x2a76a9){if(_0x2a76a9){return _0x2890a3[_0x7efe('0x17')](_0x176a6d);}return _0x2890a3['status'](_0x176a6d)['end']();};}function respondWithResult(_0x3a2995,_0x5e300c){_0x5e300c=_0x5e300c||0xc8;return function(_0x595bd6){if(_0x595bd6){return _0x3a2995['status'](_0x5e300c)[_0x7efe('0x18')](_0x595bd6);}};}function respondWithFilteredResult(_0x3f91bb,_0x31be6b){return function(_0x15959c){if(_0x15959c){var _0x1e99d2=typeof _0x31be6b[_0x7efe('0x19')]===_0x7efe('0x1a')&&typeof _0x31be6b[_0x7efe('0x1b')]===_0x7efe('0x1a');var _0x167c8d=_0x15959c[_0x7efe('0x1c')];var _0xe7446e=_0x1e99d2?0x0:_0x31be6b[_0x7efe('0x19')];var _0x5eb3d1=_0x1e99d2?_0x15959c[_0x7efe('0x1c')]:_0x31be6b[_0x7efe('0x19')]+_0x31be6b[_0x7efe('0x1b')];var _0x2566c9;if(_0x5eb3d1>=_0x167c8d){_0x5eb3d1=_0x167c8d;_0x2566c9=0xc8;}else{_0x2566c9=0xce;}_0x3f91bb['status'](_0x2566c9);return _0x3f91bb[_0x7efe('0x1d')](_0x7efe('0x1e'),_0xe7446e+'-'+_0x5eb3d1+'/'+_0x167c8d)[_0x7efe('0x18')](_0x15959c);}return null;};}function patchUpdates(_0x50d985){return function(_0x3739ca){try{jsonpatch[_0x7efe('0x1f')](_0x3739ca,_0x50d985,!![]);}catch(_0x3843e0){return BPromise[_0x7efe('0x20')](_0x3843e0);}return _0x3739ca[_0x7efe('0x21')]();};}function saveUpdates(_0x1f4361,_0xbbf84e){return function(_0x55c001){if(_0x55c001){return _0x55c001[_0x7efe('0x22')](_0x1f4361)[_0x7efe('0x23')](function(_0x516691){return _0x516691;});}return null;};}function removeEntity(_0x243fe3,_0x53c711){return function(_0x56b08f){if(_0x56b08f){return _0x56b08f[_0x7efe('0x24')]()[_0x7efe('0x23')](function(){_0x243fe3[_0x7efe('0x25')](0xcc)[_0x7efe('0x26')]();});}};}function handleEntityNotFound(_0x1cd7e6,_0x14f3ef){return function(_0x64485f){if(!_0x64485f){_0x1cd7e6[_0x7efe('0x17')](0x194);}return _0x64485f;};}function handleError(_0x1d5569,_0x535c7c){_0x535c7c=_0x535c7c||0x1f4;return function(_0x415c9d){logger[_0x7efe('0x27')](_0x415c9d[_0x7efe('0x28')]);if(_0x415c9d['name']){delete _0x415c9d[_0x7efe('0x29')];}_0x1d5569['status'](_0x535c7c)['send'](_0x415c9d);};}exports[_0x7efe('0x2a')]=function(_0x50b41e,_0x4043a2){var _0xb8c25c={},_0x405b11={},_0x121fc8={'count':0x0,'rows':[]};var _0x152e9e=_['map'](db['SalesforceField']['rawAttributes'],function(_0x13e1d9){return{'name':_0x13e1d9[_0x7efe('0x2b')],'type':_0x13e1d9['type']['key']};});_0x405b11['model']=_[_0x7efe('0x2c')](_0x152e9e,'name');_0x405b11['query']=_[_0x7efe('0x2d')](_0x50b41e[_0x7efe('0x2e')]);_0x405b11[_0x7efe('0x2f')]=_[_0x7efe('0x30')](_0x405b11['model'],_0x405b11[_0x7efe('0x2e')]);_0xb8c25c[_0x7efe('0x31')]=_['intersection'](_0x405b11['model'],qs[_0x7efe('0x32')](_0x50b41e[_0x7efe('0x2e')][_0x7efe('0x32')]));_0xb8c25c[_0x7efe('0x31')]=_0xb8c25c[_0x7efe('0x31')][_0x7efe('0x33')]?_0xb8c25c[_0x7efe('0x31')]:_0x405b11['model'];if(!_0x50b41e['query'][_0x7efe('0x34')](_0x7efe('0x35'))){_0xb8c25c[_0x7efe('0x1b')]=qs[_0x7efe('0x1b')](_0x50b41e['query'][_0x7efe('0x1b')]);_0xb8c25c[_0x7efe('0x19')]=qs[_0x7efe('0x19')](_0x50b41e[_0x7efe('0x2e')]['offset']);}_0xb8c25c[_0x7efe('0x36')]=qs[_0x7efe('0x37')](_0x50b41e[_0x7efe('0x2e')]['sort']);_0xb8c25c[_0x7efe('0x38')]=qs[_0x7efe('0x2f')](_[_0x7efe('0x39')](_0x50b41e[_0x7efe('0x2e')],_0x405b11[_0x7efe('0x2f')]),_0x152e9e);if(_0x50b41e[_0x7efe('0x2e')][_0x7efe('0x3a')]){_0xb8c25c['where']=_['merge'](_0xb8c25c[_0x7efe('0x38')],{'$or':_['map'](_0x152e9e,function(_0x41cf51){if(_0x41cf51[_0x7efe('0x3b')]!=='VIRTUAL'){var _0x55f94e={};_0x55f94e[_0x41cf51[_0x7efe('0x29')]]={'$like':'%'+_0x50b41e[_0x7efe('0x2e')]['filter']+'%'};return _0x55f94e;}})});}_0xb8c25c=_[_0x7efe('0x3c')]({},_0xb8c25c,_0x50b41e['options']);var _0x1622d8={'where':_0xb8c25c[_0x7efe('0x38')]};return db['SalesforceField'][_0x7efe('0x1c')](_0x1622d8)[_0x7efe('0x23')](function(_0x1cf345){_0x121fc8[_0x7efe('0x1c')]=_0x1cf345;if(_0x50b41e['query'][_0x7efe('0x3d')]){_0xb8c25c[_0x7efe('0x3e')]=[{'all':!![]}];}return db[_0x7efe('0x3f')]['findAll'](_0xb8c25c);})[_0x7efe('0x23')](function(_0x328fb6){_0x121fc8[_0x7efe('0x40')]=_0x328fb6;return _0x121fc8;})['then'](respondWithFilteredResult(_0x4043a2,_0xb8c25c))[_0x7efe('0x41')](handleError(_0x4043a2,null));};exports['show']=function(_0x5ceff3,_0x2c5f39){var _0x555759={'raw':!![],'where':{'id':_0x5ceff3['params']['id']}},_0x1e9fda={};_0x1e9fda[_0x7efe('0x42')]=_[_0x7efe('0x2d')](db[_0x7efe('0x3f')]['rawAttributes']);_0x1e9fda[_0x7efe('0x2e')]=_[_0x7efe('0x2d')](_0x5ceff3[_0x7efe('0x2e')]);_0x1e9fda['filters']=_['intersection'](_0x1e9fda[_0x7efe('0x42')],_0x1e9fda['query']);_0x555759[_0x7efe('0x31')]=_[_0x7efe('0x30')](_0x1e9fda['model'],qs['fields'](_0x5ceff3[_0x7efe('0x2e')][_0x7efe('0x32')]));_0x555759[_0x7efe('0x31')]=_0x555759[_0x7efe('0x31')]['length']?_0x555759[_0x7efe('0x31')]:_0x1e9fda[_0x7efe('0x42')];if(_0x5ceff3[_0x7efe('0x2e')][_0x7efe('0x3d')]){_0x555759[_0x7efe('0x3e')]=[{'all':!![]}];}_0x555759=_[_0x7efe('0x3c')]({},_0x555759,_0x5ceff3[_0x7efe('0x43')]);return db[_0x7efe('0x3f')]['find'](_0x555759)[_0x7efe('0x23')](handleEntityNotFound(_0x2c5f39,null))[_0x7efe('0x23')](respondWithResult(_0x2c5f39,null))[_0x7efe('0x41')](handleError(_0x2c5f39,null));};exports['create']=function(_0x10d66f,_0x3d27fc){return db[_0x7efe('0x3f')][_0x7efe('0x44')](_0x10d66f[_0x7efe('0x45')],{})[_0x7efe('0x23')](respondWithResult(_0x3d27fc,0xc9))['catch'](handleError(_0x3d27fc,null));};exports[_0x7efe('0x22')]=function(_0x4714a4,_0x5d2d44){if(_0x4714a4['body']['id']){delete _0x4714a4[_0x7efe('0x45')]['id'];}return db[_0x7efe('0x3f')]['find']({'where':{'id':_0x4714a4['params']['id']}})[_0x7efe('0x23')](handleEntityNotFound(_0x5d2d44,null))[_0x7efe('0x23')](saveUpdates(_0x4714a4['body'],null))[_0x7efe('0x23')](respondWithResult(_0x5d2d44,null))[_0x7efe('0x41')](handleError(_0x5d2d44,null));};exports[_0x7efe('0x24')]=function(_0x46a647,_0x5f400e){return db[_0x7efe('0x3f')][_0x7efe('0x46')]({'where':{'id':_0x46a647[_0x7efe('0x47')]['id']}})[_0x7efe('0x23')](handleEntityNotFound(_0x5f400e,null))[_0x7efe('0x23')](removeEntity(_0x5f400e,null))[_0x7efe('0x41')](handleError(_0x5f400e,null));}; \ No newline at end of file +var _0xe5b5=['name','send','SalesforceField','rawAttributes','fieldName','type','model','map','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','destroy','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','end','error','stack'];(function(_0xbe15ce,_0x4c3f35){var _0x2797bb=function(_0x37f618){while(--_0x37f618){_0xbe15ce['push'](_0xbe15ce['shift']());}};_0x2797bb(++_0x4c3f35);}(_0xe5b5,0x1f1));var _0x5e5b=function(_0x3ae2b2,_0x2d936f){_0x3ae2b2=_0x3ae2b2-0x0;var _0x1dbf00=_0xe5b5[_0x3ae2b2];return _0x1dbf00;};'use strict';var emlformat=require(_0x5e5b('0x0'));var rimraf=require(_0x5e5b('0x1'));var zipdir=require(_0x5e5b('0x2'));var jsonpatch=require(_0x5e5b('0x3'));var rp=require(_0x5e5b('0x4'));var moment=require('moment');var BPromise=require(_0x5e5b('0x5'));var Mustache=require(_0x5e5b('0x6'));var util=require(_0x5e5b('0x7'));var path=require(_0x5e5b('0x8'));var sox=require(_0x5e5b('0x9'));var csv=require(_0x5e5b('0xa'));var ejs=require(_0x5e5b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5e5b('0xc'));var squel=require(_0x5e5b('0xd'));var crypto=require(_0x5e5b('0xe'));var jsforce=require(_0x5e5b('0xf'));var deskjs=require(_0x5e5b('0x10'));var toCsv=require(_0x5e5b('0xa'));var querystring=require(_0x5e5b('0x11'));var Papa=require(_0x5e5b('0x12'));var Redis=require(_0x5e5b('0x13'));var authService=require(_0x5e5b('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x5e5b('0x15'));var hardwareService=require(_0x5e5b('0x16'));var logger=require('../../config/logger')(_0x5e5b('0x17'));var utils=require(_0x5e5b('0x18'));var config=require(_0x5e5b('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5e5b('0x1a'))['db'];function respondWithStatusCode(_0x41da62,_0x3fda58){_0x3fda58=_0x3fda58||0xcc;return function(_0x5c383d){if(_0x5c383d){return _0x41da62[_0x5e5b('0x1b')](_0x3fda58);}return _0x41da62['status'](_0x3fda58)['end']();};}function respondWithResult(_0x4b5546,_0x31c68e){_0x31c68e=_0x31c68e||0xc8;return function(_0x138e07){if(_0x138e07){return _0x4b5546[_0x5e5b('0x1c')](_0x31c68e)[_0x5e5b('0x1d')](_0x138e07);}};}function respondWithFilteredResult(_0x23d84c,_0x4ce37d){return function(_0xd40185){if(_0xd40185){var _0x4391fd=typeof _0x4ce37d[_0x5e5b('0x1e')]===_0x5e5b('0x1f')&&typeof _0x4ce37d[_0x5e5b('0x20')]===_0x5e5b('0x1f');var _0x54e72c=_0xd40185[_0x5e5b('0x21')];var _0x1b319d=_0x4391fd?0x0:_0x4ce37d['offset'];var _0x2473cb=_0x4391fd?_0xd40185[_0x5e5b('0x21')]:_0x4ce37d[_0x5e5b('0x1e')]+_0x4ce37d[_0x5e5b('0x20')];var _0xa5b208;if(_0x2473cb>=_0x54e72c){_0x2473cb=_0x54e72c;_0xa5b208=0xc8;}else{_0xa5b208=0xce;}_0x23d84c[_0x5e5b('0x1c')](_0xa5b208);return _0x23d84c[_0x5e5b('0x22')](_0x5e5b('0x23'),_0x1b319d+'-'+_0x2473cb+'/'+_0x54e72c)['json'](_0xd40185);}return null;};}function patchUpdates(_0x2b4cb4){return function(_0x3f69e2){try{jsonpatch['apply'](_0x3f69e2,_0x2b4cb4,!![]);}catch(_0x36d528){return BPromise['reject'](_0x36d528);}return _0x3f69e2[_0x5e5b('0x24')]();};}function saveUpdates(_0x4fcae9,_0x21e33c){return function(_0x13d461){if(_0x13d461){return _0x13d461[_0x5e5b('0x25')](_0x4fcae9)['then'](function(_0x2cc6f1){return _0x2cc6f1;});}return null;};}function removeEntity(_0x148a44,_0xa6eb5b){return function(_0x464515){if(_0x464515){return _0x464515['destroy']()[_0x5e5b('0x26')](function(){_0x148a44[_0x5e5b('0x1c')](0xcc)[_0x5e5b('0x27')]();});}};}function handleEntityNotFound(_0x277ee3,_0x316abe){return function(_0x298e59){if(!_0x298e59){_0x277ee3['sendStatus'](0x194);}return _0x298e59;};}function handleError(_0x427e13,_0x43e77a){_0x43e77a=_0x43e77a||0x1f4;return function(_0x4aec4a){logger[_0x5e5b('0x28')](_0x4aec4a[_0x5e5b('0x29')]);if(_0x4aec4a[_0x5e5b('0x2a')]){delete _0x4aec4a['name'];}_0x427e13[_0x5e5b('0x1c')](_0x43e77a)[_0x5e5b('0x2b')](_0x4aec4a);};}exports['index']=function(_0x4c38ca,_0x75b4ae){var _0x15dce5={},_0x50c9b5={},_0x4cb792={'count':0x0,'rows':[]};var _0x49d368=_['map'](db[_0x5e5b('0x2c')][_0x5e5b('0x2d')],function(_0x4b4ba9){return{'name':_0x4b4ba9[_0x5e5b('0x2e')],'type':_0x4b4ba9[_0x5e5b('0x2f')]['key']};});_0x50c9b5[_0x5e5b('0x30')]=_[_0x5e5b('0x31')](_0x49d368,_0x5e5b('0x2a'));_0x50c9b5[_0x5e5b('0x32')]=_[_0x5e5b('0x33')](_0x4c38ca[_0x5e5b('0x32')]);_0x50c9b5['filters']=_[_0x5e5b('0x34')](_0x50c9b5[_0x5e5b('0x30')],_0x50c9b5[_0x5e5b('0x32')]);_0x15dce5['attributes']=_[_0x5e5b('0x34')](_0x50c9b5[_0x5e5b('0x30')],qs['fields'](_0x4c38ca[_0x5e5b('0x32')][_0x5e5b('0x35')]));_0x15dce5[_0x5e5b('0x36')]=_0x15dce5[_0x5e5b('0x36')]['length']?_0x15dce5['attributes']:_0x50c9b5['model'];if(!_0x4c38ca['query']['hasOwnProperty'](_0x5e5b('0x37'))){_0x15dce5[_0x5e5b('0x20')]=qs['limit'](_0x4c38ca['query'][_0x5e5b('0x20')]);_0x15dce5[_0x5e5b('0x1e')]=qs['offset'](_0x4c38ca[_0x5e5b('0x32')]['offset']);}_0x15dce5[_0x5e5b('0x38')]=qs[_0x5e5b('0x39')](_0x4c38ca['query']['sort']);_0x15dce5[_0x5e5b('0x3a')]=qs[_0x5e5b('0x3b')](_[_0x5e5b('0x3c')](_0x4c38ca[_0x5e5b('0x32')],_0x50c9b5[_0x5e5b('0x3b')]),_0x49d368);if(_0x4c38ca[_0x5e5b('0x32')][_0x5e5b('0x3d')]){_0x15dce5['where']=_['merge'](_0x15dce5[_0x5e5b('0x3a')],{'$or':_['map'](_0x49d368,function(_0xad5eb0){if(_0xad5eb0['type']!==_0x5e5b('0x3e')){var _0x5969f1={};_0x5969f1[_0xad5eb0[_0x5e5b('0x2a')]]={'$like':'%'+_0x4c38ca[_0x5e5b('0x32')][_0x5e5b('0x3d')]+'%'};return _0x5969f1;}})});}_0x15dce5=_[_0x5e5b('0x3f')]({},_0x15dce5,_0x4c38ca[_0x5e5b('0x40')]);var _0x4df918={'where':_0x15dce5[_0x5e5b('0x3a')]};return db['SalesforceField'][_0x5e5b('0x21')](_0x4df918)[_0x5e5b('0x26')](function(_0x4b421d){_0x4cb792[_0x5e5b('0x21')]=_0x4b421d;if(_0x4c38ca[_0x5e5b('0x32')][_0x5e5b('0x41')]){_0x15dce5[_0x5e5b('0x42')]=[{'all':!![]}];}return db[_0x5e5b('0x2c')][_0x5e5b('0x43')](_0x15dce5);})[_0x5e5b('0x26')](function(_0x41dc15){_0x4cb792[_0x5e5b('0x44')]=_0x41dc15;return _0x4cb792;})[_0x5e5b('0x26')](respondWithFilteredResult(_0x75b4ae,_0x15dce5))[_0x5e5b('0x45')](handleError(_0x75b4ae,null));};exports[_0x5e5b('0x46')]=function(_0x5b2dd2,_0x81b32f){var _0x16e496={'raw':!![],'where':{'id':_0x5b2dd2[_0x5e5b('0x47')]['id']}},_0x257fc0={};_0x257fc0[_0x5e5b('0x30')]=_[_0x5e5b('0x33')](db[_0x5e5b('0x2c')][_0x5e5b('0x2d')]);_0x257fc0['query']=_[_0x5e5b('0x33')](_0x5b2dd2[_0x5e5b('0x32')]);_0x257fc0['filters']=_[_0x5e5b('0x34')](_0x257fc0['model'],_0x257fc0[_0x5e5b('0x32')]);_0x16e496[_0x5e5b('0x36')]=_['intersection'](_0x257fc0[_0x5e5b('0x30')],qs[_0x5e5b('0x35')](_0x5b2dd2['query']['fields']));_0x16e496[_0x5e5b('0x36')]=_0x16e496[_0x5e5b('0x36')][_0x5e5b('0x48')]?_0x16e496[_0x5e5b('0x36')]:_0x257fc0[_0x5e5b('0x30')];if(_0x5b2dd2[_0x5e5b('0x32')][_0x5e5b('0x41')]){_0x16e496[_0x5e5b('0x42')]=[{'all':!![]}];}_0x16e496=_[_0x5e5b('0x3f')]({},_0x16e496,_0x5b2dd2[_0x5e5b('0x40')]);return db[_0x5e5b('0x2c')]['find'](_0x16e496)[_0x5e5b('0x26')](handleEntityNotFound(_0x81b32f,null))[_0x5e5b('0x26')](respondWithResult(_0x81b32f,null))[_0x5e5b('0x45')](handleError(_0x81b32f,null));};exports['create']=function(_0x182b4f,_0x3c95be){return db['SalesforceField'][_0x5e5b('0x49')](_0x182b4f[_0x5e5b('0x4a')],{})[_0x5e5b('0x26')](respondWithResult(_0x3c95be,0xc9))[_0x5e5b('0x45')](handleError(_0x3c95be,null));};exports[_0x5e5b('0x25')]=function(_0x32cf58,_0x3d9f14){if(_0x32cf58[_0x5e5b('0x4a')]['id']){delete _0x32cf58[_0x5e5b('0x4a')]['id'];}return db[_0x5e5b('0x2c')]['find']({'where':{'id':_0x32cf58[_0x5e5b('0x47')]['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x3d9f14,null))[_0x5e5b('0x26')](saveUpdates(_0x32cf58['body'],null))[_0x5e5b('0x26')](respondWithResult(_0x3d9f14,null))[_0x5e5b('0x45')](handleError(_0x3d9f14,null));};exports[_0x5e5b('0x4b')]=function(_0x21e7c1,_0x460d48){return db['SalesforceField'][_0x5e5b('0x4c')]({'where':{'id':_0x21e7c1[_0x5e5b('0x47')]['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x460d48,null))[_0x5e5b('0x26')](removeEntity(_0x460d48,null))['catch'](handleError(_0x460d48,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index ef8a337..cecbbe8 100644 --- a/server/api/intSalesforceField/intSalesforceField.model.js +++ b/server/api/intSalesforceField/intSalesforceField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b2c=['int_salesforce_fields','salesforce_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes','exports','define','SalesforceField'];(function(_0x148c09,_0x4fd39f){var _0x18e613=function(_0xfaa810){while(--_0xfaa810){_0x148c09['push'](_0x148c09['shift']());}};_0x18e613(++_0x4fd39f);}(_0x3b2c,0x14d));var _0xc3b2=function(_0x280947,_0x42d339){_0x280947=_0x280947-0x0;var _0x5b77ce=_0x3b2c[_0x280947];return _0x5b77ce;};'use strict';var _=require(_0xc3b2('0x0'));var util=require(_0xc3b2('0x1'));var logger=require(_0xc3b2('0x2'))(_0xc3b2('0x3'));var moment=require('moment');var BPromise=require(_0xc3b2('0x4'));var rp=require(_0xc3b2('0x5'));var fs=require('fs');var path=require(_0xc3b2('0x6'));var rimraf=require(_0xc3b2('0x7'));var config=require('../../config/environment');var attributes=require(_0xc3b2('0x8'));module[_0xc3b2('0x9')]=function(_0x127c28,_0x25dcb8){return _0x127c28[_0xc3b2('0xa')](_0xc3b2('0xb'),attributes,{'tableName':_0xc3b2('0xc'),'paranoid':![],'indexes':[{'name':_0xc3b2('0xd'),'fields':['idField',_0xc3b2('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb904=['FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./intSalesforceField.attributes','exports','define','salesforce_unique_index','idField'];(function(_0x49eae0,_0x4f22b8){var _0x36f47d=function(_0x53398f){while(--_0x53398f){_0x49eae0['push'](_0x49eae0['shift']());}};_0x36f47d(++_0x4f22b8);}(_0xb904,0xe1));var _0x4b90=function(_0x4ef700,_0x1bf10a){_0x4ef700=_0x4ef700-0x0;var _0x2a17c6=_0xb904[_0x4ef700];return _0x2a17c6;};'use strict';var _=require(_0x4b90('0x0'));var util=require(_0x4b90('0x1'));var logger=require(_0x4b90('0x2'))(_0x4b90('0x3'));var moment=require(_0x4b90('0x4'));var BPromise=require('bluebird');var rp=require(_0x4b90('0x5'));var fs=require('fs');var path=require(_0x4b90('0x6'));var rimraf=require(_0x4b90('0x7'));var config=require('../../config/environment');var attributes=require(_0x4b90('0x8'));module[_0x4b90('0x9')]=function(_0x2e6373,_0x329e79){return _0x2e6373[_0x4b90('0xa')]('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x4b90('0xb'),'fields':[_0x4b90('0xc'),_0x4b90('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index e27481b..6158c30 100644 --- a/server/api/intSalesforceField/intSalesforceField.rpc.js +++ b/server/api/intSalesforceField/intSalesforceField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22fe=['code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','error'];(function(_0x4da862,_0xca9180){var _0x292f46=function(_0x1789a9){while(--_0x1789a9){_0x4da862['push'](_0x4da862['shift']());}};_0x292f46(++_0xca9180);}(_0x22fe,0xae));var _0xe22f=function(_0x1109c5,_0x185c3f){_0x1109c5=_0x1109c5-0x0;var _0x3ea2ad=_0x22fe[_0x1109c5];return _0x3ea2ad;};'use strict';var _=require(_0xe22f('0x0'));var util=require('util');var moment=require(_0xe22f('0x1'));var BPromise=require(_0xe22f('0x2'));var rs=require(_0xe22f('0x3'));var fs=require('fs');var Redis=require(_0xe22f('0x4'));var db=require(_0xe22f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe22f('0x6'));var config=require(_0xe22f('0x7'));var jayson=require(_0xe22f('0x8'));var client=jayson[_0xe22f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b29c8,_0x18ede3,_0x5c1e39){return new BPromise(function(_0x28a5a3,_0xa219b5){return client[_0xe22f('0xa')](_0x3b29c8,_0x5c1e39)[_0xe22f('0xb')](function(_0x4d7df6){logger[_0xe22f('0xc')](_0xe22f('0xd'),_0x18ede3,_0xe22f('0xe'));logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x18ede3,_0xe22f('0xe'),JSON['stringify'](_0x4d7df6));if(_0x4d7df6[_0xe22f('0xf')]){if(_0x4d7df6[_0xe22f('0xf')][_0xe22f('0x10')]===0x1f4){logger[_0xe22f('0xf')](_0xe22f('0xd'),_0x18ede3,_0x4d7df6[_0xe22f('0xf')][_0xe22f('0x11')]);return _0xa219b5(_0x4d7df6[_0xe22f('0xf')]['message']);}logger['error'](_0xe22f('0xd'),_0x18ede3,_0x4d7df6[_0xe22f('0xf')][_0xe22f('0x11')]);return _0x28a5a3(_0x4d7df6[_0xe22f('0xf')][_0xe22f('0x11')]);}else{logger[_0xe22f('0xc')](_0xe22f('0xd'),_0x18ede3,_0xe22f('0xe'));_0x28a5a3(_0x4d7df6['result'][_0xe22f('0x11')]);}})[_0xe22f('0x12')](function(_0x447717){logger[_0xe22f('0xf')](_0xe22f('0xd'),_0x18ede3,_0x447717);_0xa219b5(_0x447717);});});} \ No newline at end of file +var _0x81aa=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','SalesforceField,\x20%s,\x20%s','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird'];(function(_0x205379,_0x79d618){var _0x1930a4=function(_0x169570){while(--_0x169570){_0x205379['push'](_0x205379['shift']());}};_0x1930a4(++_0x79d618);}(_0x81aa,0xcf));var _0xa81a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x81aa[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xa81a('0x0'));var util=require('util');var moment=require(_0xa81a('0x1'));var BPromise=require(_0xa81a('0x2'));var rs=require(_0xa81a('0x3'));var fs=require('fs');var Redis=require(_0xa81a('0x4'));var db=require(_0xa81a('0x5'))['db'];var utils=require(_0xa81a('0x6'));var logger=require('../../config/logger')(_0xa81a('0x7'));var config=require(_0xa81a('0x8'));var jayson=require(_0xa81a('0x9'));var client=jayson['client'][_0xa81a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x210680,_0xf5a22b,_0x725059){return new BPromise(function(_0x1573ad,_0x134606){return client['request'](_0x210680,_0x725059)[_0xa81a('0xb')](function(_0x105beb){logger[_0xa81a('0xc')](_0xa81a('0xd'),_0xf5a22b,'request\x20sent');logger['debug'](_0xa81a('0xe'),_0xf5a22b,_0xa81a('0xf'),JSON[_0xa81a('0x10')](_0x105beb));if(_0x105beb[_0xa81a('0x11')]){if(_0x105beb[_0xa81a('0x11')][_0xa81a('0x12')]===0x1f4){logger[_0xa81a('0x11')](_0xa81a('0xd'),_0xf5a22b,_0x105beb[_0xa81a('0x11')]['message']);return _0x134606(_0x105beb[_0xa81a('0x11')][_0xa81a('0x13')]);}logger['error'](_0xa81a('0xd'),_0xf5a22b,_0x105beb['error'][_0xa81a('0x13')]);return _0x1573ad(_0x105beb['error']['message']);}else{logger[_0xa81a('0xc')](_0xa81a('0xd'),_0xf5a22b,'request\x20sent');_0x1573ad(_0x105beb[_0xa81a('0x14')][_0xa81a('0x13')]);}})['catch'](function(_0x59d42d){logger[_0xa81a('0x11')](_0xa81a('0xd'),_0xf5a22b,_0x59d42d);_0x134606(_0x59d42d);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 024f712..d741700 100644 --- a/server/api/intServicenowAccount/index.js +++ b/server/api/intServicenowAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x28eb=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','getFields','create','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x28eb,0x105));var _0xb28e=function(_0x3fd928,_0x58fd13){_0x3fd928=_0x3fd928-0x0;var _0x2cd537=_0x28eb[_0x3fd928];return _0x2cd537;};'use strict';var multer=require(_0xb28e('0x0'));var util=require(_0xb28e('0x1'));var path=require(_0xb28e('0x2'));var timeout=require('connect-timeout');var express=require(_0xb28e('0x3'));var router=express[_0xb28e('0x4')]();var fs_extra=require(_0xb28e('0x5'));var auth=require(_0xb28e('0x6'));var interaction=require(_0xb28e('0x7'));var config=require(_0xb28e('0x8'));var controller=require(_0xb28e('0x9'));router['get']('/',auth[_0xb28e('0xa')](),controller[_0xb28e('0xb')]);router[_0xb28e('0xc')](_0xb28e('0xd'),auth['isAuthenticated'](),controller[_0xb28e('0xe')]);router['get'](_0xb28e('0xf'),auth[_0xb28e('0xa')](),controller[_0xb28e('0x10')]);router[_0xb28e('0xc')]('/:id/fields',auth[_0xb28e('0xa')](),controller[_0xb28e('0x11')]);router['post']('/',auth[_0xb28e('0xa')](),controller[_0xb28e('0x12')]);router['post'](_0xb28e('0xf'),auth[_0xb28e('0xa')](),controller[_0xb28e('0x13')]);router[_0xb28e('0x14')](_0xb28e('0xd'),auth['isAuthenticated'](),controller[_0xb28e('0x15')]);router['delete'](_0xb28e('0xd'),auth[_0xb28e('0xa')](),controller[_0xb28e('0x16')]);module[_0xb28e('0x17')]=router; \ No newline at end of file +var _0x98b8=['/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','show'];(function(_0x36f6fd,_0x4ac52d){var _0x192ce2=function(_0x43e43e){while(--_0x43e43e){_0x36f6fd['push'](_0x36f6fd['shift']());}};_0x192ce2(++_0x4ac52d);}(_0x98b8,0x93));var _0x898b=function(_0x5cb48f,_0x5c3815){_0x5cb48f=_0x5cb48f-0x0;var _0x3f52a7=_0x98b8[_0x5cb48f];return _0x3f52a7;};'use strict';var multer=require(_0x898b('0x0'));var util=require(_0x898b('0x1'));var path=require(_0x898b('0x2'));var timeout=require(_0x898b('0x3'));var express=require(_0x898b('0x4'));var router=express[_0x898b('0x5')]();var fs_extra=require(_0x898b('0x6'));var auth=require(_0x898b('0x7'));var interaction=require(_0x898b('0x8'));var config=require(_0x898b('0x9'));var controller=require(_0x898b('0xa'));router[_0x898b('0xb')]('/',auth[_0x898b('0xc')](),controller[_0x898b('0xd')]);router[_0x898b('0xb')]('/:id',auth[_0x898b('0xc')](),controller[_0x898b('0xe')]);router[_0x898b('0xb')](_0x898b('0xf'),auth[_0x898b('0xc')](),controller[_0x898b('0x10')]);router[_0x898b('0xb')](_0x898b('0x11'),auth['isAuthenticated'](),controller[_0x898b('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x898b('0x13')]);router[_0x898b('0x14')](_0x898b('0xf'),auth[_0x898b('0xc')](),controller[_0x898b('0x15')]);router[_0x898b('0x16')](_0x898b('0x17'),auth[_0x898b('0xc')](),controller[_0x898b('0x18')]);router[_0x898b('0x19')](_0x898b('0x17'),auth[_0x898b('0xc')](),controller['destroy']);module[_0x898b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index ec14615..981230b 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.attributes.js +++ b/server/api/intServicenowAccount/intServicenowAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64b1=['STRING','username','remoteUri','exports'];(function(_0x52ad41,_0x43a14d){var _0x5b568f=function(_0x22a90e){while(--_0x22a90e){_0x52ad41['push'](_0x52ad41['shift']());}};_0x5b568f(++_0x43a14d);}(_0x64b1,0x1ab));var _0x164b=function(_0x3e50b9,_0x2d6fa1){_0x3e50b9=_0x3e50b9-0x0;var _0x21a5c1=_0x64b1[_0x3e50b9];return _0x21a5c1;};'use strict';var Sequelize=require('sequelize');module[_0x164b('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x164b('0x1')],'unique':_0x164b('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x164b('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x164b('0x3')},'serverUrl':{'type':Sequelize[_0x164b('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x5024=['remoteUri','sequelize','exports','STRING','username'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5024,0x1b4));var _0x4502=function(_0x306a88,_0x4aea61){_0x306a88=_0x306a88-0x0;var _0x26dd5a=_0x5024[_0x306a88];return _0x26dd5a;};'use strict';var Sequelize=require(_0x4502('0x0'));module[_0x4502('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4502('0x2')],'unique':_0x4502('0x3')},'password':{'type':Sequelize[_0x4502('0x2')]},'email':{'type':Sequelize[_0x4502('0x2')]},'remoteUri':{'type':Sequelize[_0x4502('0x2')],'unique':_0x4502('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 1344935..9f0ccc2 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.controller.js +++ b/server/api/intServicenowAccount/intServicenowAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4388=['closed_by','follow_up','parent_incident','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','remove','includes','forEach','internalType','push','all','assign','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','ServiceNow\x20error:\x20','test','statusCode','send','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','reject','update','then','destroy','end','error','stack','name','index','ServicenowAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','findAll','fields','include','options','find','catch','create','body','params','getConfigurations','findOne','ServicenowConfiguration','filter','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','incident_state','severity','category','parent','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','user_input','sys_created_on','sys_domain','sys_created_by','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','opened_at','work_end','resolved_at','caller_id','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','notify'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0x4388,0x199));var _0x8438=function(_0x16a24b,_0x1a4ebc){_0x16a24b=_0x16a24b-0x0;var _0x4d4e9a=_0x4388[_0x16a24b];return _0x4d4e9a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8438('0x0'));var zipdir=require(_0x8438('0x1'));var jsonpatch=require(_0x8438('0x2'));var rp=require('request-promise');var moment=require(_0x8438('0x3'));var BPromise=require(_0x8438('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8438('0x5'));var sox=require(_0x8438('0x6'));var csv=require(_0x8438('0x7'));var ejs=require(_0x8438('0x8'));var fs=require('fs');var fs_extra=require(_0x8438('0x9'));var _=require(_0x8438('0xa'));var squel=require('squel');var crypto=require(_0x8438('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8438('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8438('0xd'));var Papa=require(_0x8438('0xe'));var Redis=require('ioredis');var authService=require(_0x8438('0xf'));var qs=require(_0x8438('0x10'));var as=require(_0x8438('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8438('0x12'));var utils=require(_0x8438('0x13'));var config=require(_0x8438('0x14'));var licenseUtil=require(_0x8438('0x15'));var db=require(_0x8438('0x16'))['db'];var integrations=require(_0x8438('0x17'));function respondWithStatusCode(_0x531af5,_0x2a7305){_0x2a7305=_0x2a7305||0xcc;return function(_0x3cc140){if(_0x3cc140){return _0x531af5[_0x8438('0x18')](_0x2a7305);}return _0x531af5[_0x8438('0x19')](_0x2a7305)['end']();};}function respondWithResult(_0x38d690,_0x4b5afe){_0x4b5afe=_0x4b5afe||0xc8;return function(_0x40cc2a){if(_0x40cc2a){return _0x38d690['status'](_0x4b5afe)[_0x8438('0x1a')](_0x40cc2a);}};}function respondWithFilteredResult(_0x33d70b,_0x3b5e9a){return function(_0x8abe58){if(_0x8abe58){var _0x4d9030=typeof _0x3b5e9a[_0x8438('0x1b')]===_0x8438('0x1c')&&typeof _0x3b5e9a['limit']===_0x8438('0x1c');var _0x339ea6=_0x8abe58[_0x8438('0x1d')];var _0x476598=_0x4d9030?0x0:_0x3b5e9a[_0x8438('0x1b')];var _0x4a5887=_0x4d9030?_0x8abe58['count']:_0x3b5e9a[_0x8438('0x1b')]+_0x3b5e9a[_0x8438('0x1e')];var _0x33dbca;if(_0x4a5887>=_0x339ea6){_0x4a5887=_0x339ea6;_0x33dbca=0xc8;}else{_0x33dbca=0xce;}_0x33d70b[_0x8438('0x19')](_0x33dbca);return _0x33d70b[_0x8438('0x1f')]('Content-Range',_0x476598+'-'+_0x4a5887+'/'+_0x339ea6)[_0x8438('0x1a')](_0x8abe58);}return null;};}function patchUpdates(_0x5d5a4e){return function(_0x2b8f0f){try{jsonpatch['apply'](_0x2b8f0f,_0x5d5a4e,!![]);}catch(_0x385b19){return BPromise[_0x8438('0x20')](_0x385b19);}return _0x2b8f0f['save']();};}function saveUpdates(_0x1294e8,_0x2553d6){return function(_0x263f21){if(_0x263f21){return _0x263f21[_0x8438('0x21')](_0x1294e8)[_0x8438('0x22')](function(_0x1a7622){return _0x1a7622;});}return null;};}function removeEntity(_0x158b73,_0xf84835){return function(_0x33ff9a){if(_0x33ff9a){return _0x33ff9a[_0x8438('0x23')]()[_0x8438('0x22')](function(){_0x158b73[_0x8438('0x19')](0xcc)[_0x8438('0x24')]();});}};}function handleEntityNotFound(_0x241ab7,_0x13a8dd){return function(_0x1e7c75){if(!_0x1e7c75){_0x241ab7[_0x8438('0x18')](0x194);}return _0x1e7c75;};}function handleError(_0x262649,_0x4f78bd){_0x4f78bd=_0x4f78bd||0x1f4;return function(_0x55999d){logger[_0x8438('0x25')](_0x55999d[_0x8438('0x26')]);if(_0x55999d[_0x8438('0x27')]){delete _0x55999d['name'];}_0x262649[_0x8438('0x19')](_0x4f78bd)['send'](_0x55999d);};}exports[_0x8438('0x28')]=function(_0x2832c2,_0x4d919a){var _0x5868d5={},_0x29c0b2={},_0x388cf0={'count':0x0,'rows':[]};var _0x2fc3b6=_['map'](db[_0x8438('0x29')][_0x8438('0x2a')],function(_0x1c8f81){return{'name':_0x1c8f81[_0x8438('0x2b')],'type':_0x1c8f81[_0x8438('0x2c')][_0x8438('0x2d')]};});_0x29c0b2[_0x8438('0x2e')]=_[_0x8438('0x2f')](_0x2fc3b6,_0x8438('0x27'));_0x29c0b2[_0x8438('0x30')]=_[_0x8438('0x31')](_0x2832c2[_0x8438('0x30')]);_0x29c0b2[_0x8438('0x32')]=_[_0x8438('0x33')](_0x29c0b2[_0x8438('0x2e')],_0x29c0b2[_0x8438('0x30')]);_0x5868d5[_0x8438('0x34')]=_[_0x8438('0x33')](_0x29c0b2[_0x8438('0x2e')],qs['fields'](_0x2832c2['query']['fields']));_0x5868d5[_0x8438('0x34')]=_0x5868d5[_0x8438('0x34')][_0x8438('0x35')]?_0x5868d5[_0x8438('0x34')]:_0x29c0b2[_0x8438('0x2e')];if(!_0x2832c2['query'][_0x8438('0x36')](_0x8438('0x37'))){_0x5868d5[_0x8438('0x1e')]=qs[_0x8438('0x1e')](_0x2832c2['query'][_0x8438('0x1e')]);_0x5868d5[_0x8438('0x1b')]=qs[_0x8438('0x1b')](_0x2832c2['query'][_0x8438('0x1b')]);}_0x5868d5[_0x8438('0x38')]=qs[_0x8438('0x39')](_0x2832c2[_0x8438('0x30')][_0x8438('0x39')]);_0x5868d5[_0x8438('0x3a')]=qs[_0x8438('0x32')](_[_0x8438('0x3b')](_0x2832c2[_0x8438('0x30')],_0x29c0b2[_0x8438('0x32')]),_0x2fc3b6);if(_0x2832c2['query']['filter']){_0x5868d5['where']=_[_0x8438('0x3c')](_0x5868d5[_0x8438('0x3a')],{'$or':_[_0x8438('0x2f')](_0x2fc3b6,function(_0x3c78ac){if(_0x3c78ac[_0x8438('0x2c')]!=='VIRTUAL'){var _0x328b82={};_0x328b82[_0x3c78ac[_0x8438('0x27')]]={'$like':'%'+_0x2832c2[_0x8438('0x30')]['filter']+'%'};return _0x328b82;}})});}_0x5868d5=_[_0x8438('0x3c')]({},_0x5868d5,_0x2832c2['options']);var _0x29a16b={'where':_0x5868d5['where']};return db[_0x8438('0x29')][_0x8438('0x1d')](_0x29a16b)['then'](function(_0x4160ed){_0x388cf0[_0x8438('0x1d')]=_0x4160ed;if(_0x2832c2[_0x8438('0x30')]['includeAll']){_0x5868d5['include']=[{'all':!![]}];}return db[_0x8438('0x29')][_0x8438('0x3d')](_0x5868d5);})[_0x8438('0x22')](function(_0x4a7b36){_0x388cf0['rows']=_0x4a7b36;return _0x388cf0;})[_0x8438('0x22')](respondWithFilteredResult(_0x4d919a,_0x5868d5))['catch'](handleError(_0x4d919a,null));};exports['show']=function(_0x404633,_0x5eec9e){var _0x3fbbd1={'raw':![],'where':{'id':_0x404633['params']['id']}},_0x575e={};_0x575e[_0x8438('0x2e')]=_[_0x8438('0x31')](db[_0x8438('0x29')][_0x8438('0x2a')]);_0x575e[_0x8438('0x30')]=_[_0x8438('0x31')](_0x404633[_0x8438('0x30')]);_0x575e['filters']=_['intersection'](_0x575e['model'],_0x575e[_0x8438('0x30')]);_0x3fbbd1[_0x8438('0x34')]=_[_0x8438('0x33')](_0x575e['model'],qs[_0x8438('0x3e')](_0x404633['query'][_0x8438('0x3e')]));_0x3fbbd1['attributes']=_0x3fbbd1[_0x8438('0x34')][_0x8438('0x35')]?_0x3fbbd1[_0x8438('0x34')]:_0x575e[_0x8438('0x2e')];if(_0x404633['query']['includeAll']){_0x3fbbd1[_0x8438('0x3f')]=[{'all':!![]}];}_0x3fbbd1=_[_0x8438('0x3c')]({},_0x3fbbd1,_0x404633[_0x8438('0x40')]);return db[_0x8438('0x29')][_0x8438('0x41')](_0x3fbbd1)[_0x8438('0x22')](handleEntityNotFound(_0x5eec9e,null))[_0x8438('0x22')](respondWithResult(_0x5eec9e,null))[_0x8438('0x42')](handleError(_0x5eec9e,null));};exports[_0x8438('0x43')]=function(_0x5f3350,_0x3251b9){return db[_0x8438('0x29')][_0x8438('0x43')](_0x5f3350[_0x8438('0x44')],{})['then'](respondWithResult(_0x3251b9,0xc9))[_0x8438('0x42')](handleError(_0x3251b9,null));};exports['update']=function(_0xc7886,_0x365106){if(_0xc7886[_0x8438('0x44')]['id']){delete _0xc7886[_0x8438('0x44')]['id'];}return db[_0x8438('0x29')][_0x8438('0x41')]({'where':{'id':_0xc7886[_0x8438('0x45')]['id']}})[_0x8438('0x22')](handleEntityNotFound(_0x365106,null))['then'](saveUpdates(_0xc7886[_0x8438('0x44')],null))[_0x8438('0x22')](respondWithResult(_0x365106,null))[_0x8438('0x42')](handleError(_0x365106,null));};exports['destroy']=function(_0x19ffbe,_0x5a297b){return db['ServicenowAccount']['find']({'where':{'id':_0x19ffbe[_0x8438('0x45')]['id']}})[_0x8438('0x22')](handleEntityNotFound(_0x5a297b,null))[_0x8438('0x22')](removeEntity(_0x5a297b,null))[_0x8438('0x42')](handleError(_0x5a297b,null));};exports[_0x8438('0x46')]=function(_0x52bac9,_0x407b6f,_0x45aeec){var _0x1a3227={};var _0x504291={};var _0x10078a;var _0xd680d8;return db['ServicenowAccount'][_0x8438('0x47')]({'where':{'id':_0x52bac9[_0x8438('0x45')]['id']}})[_0x8438('0x22')](handleEntityNotFound(_0x407b6f,null))[_0x8438('0x22')](function(_0x4d9e73){if(_0x4d9e73){_0x10078a=_0x4d9e73;_0x504291[_0x8438('0x2e')]=_['keys'](db[_0x8438('0x48')][_0x8438('0x2a')]);_0x504291[_0x8438('0x30')]=_['keys'](_0x52bac9[_0x8438('0x30')]);_0x504291['filters']=_['intersection'](_0x504291[_0x8438('0x2e')],_0x504291[_0x8438('0x30')]);_0x1a3227[_0x8438('0x34')]=_[_0x8438('0x33')](_0x504291[_0x8438('0x2e')],qs[_0x8438('0x3e')](_0x52bac9[_0x8438('0x30')][_0x8438('0x3e')]));_0x1a3227[_0x8438('0x34')]=_0x1a3227[_0x8438('0x34')]['length']?_0x1a3227[_0x8438('0x34')]:_0x504291[_0x8438('0x2e')];_0x1a3227['order']=qs[_0x8438('0x39')](_0x52bac9[_0x8438('0x30')]['sort']);_0x1a3227['where']=qs[_0x8438('0x32')](_[_0x8438('0x3b')](_0x52bac9[_0x8438('0x30')],_0x504291[_0x8438('0x32')]));if(_0x52bac9[_0x8438('0x30')][_0x8438('0x49')]){_0x1a3227[_0x8438('0x3a')]=_[_0x8438('0x3c')](_0x1a3227[_0x8438('0x3a')],{'$or':_[_0x8438('0x2f')](_0x1a3227['attributes'],function(_0xc832a5){var _0x3fbb35={};_0x3fbb35[_0xc832a5]={'$like':'%'+_0x52bac9['query'][_0x8438('0x49')]+'%'};return _0x3fbb35;})});}_0x1a3227=_[_0x8438('0x3c')]({},_0x1a3227,_0x52bac9['options']);return _0x10078a[_0x8438('0x46')](_0x1a3227);}})['then'](function(_0x531c43){if(_0x531c43){_0xd680d8=_0x531c43[_0x8438('0x35')];if(!_0x52bac9[_0x8438('0x30')][_0x8438('0x36')](_0x8438('0x37'))){_0x1a3227[_0x8438('0x1e')]=qs[_0x8438('0x1e')](_0x52bac9['query'][_0x8438('0x1e')]);_0x1a3227[_0x8438('0x1b')]=qs['offset'](_0x52bac9[_0x8438('0x30')]['offset']);}return _0x10078a[_0x8438('0x46')](_0x1a3227);}})['then'](function(_0x45d4ab){if(_0x45d4ab){return _0x45d4ab?{'count':_0xd680d8,'rows':_0x45d4ab}:null;}})['then'](respondWithResult(_0x407b6f,null))[_0x8438('0x42')](handleError(_0x407b6f,null));};exports[_0x8438('0x4a')]=function(_0x6ff780,_0x4c499e,_0x5d27f1){if(_0x6ff780[_0x8438('0x44')]['id']){delete _0x6ff780[_0x8438('0x44')]['id'];}return db[_0x8438('0x29')][_0x8438('0x47')]({'where':{'id':_0x6ff780[_0x8438('0x45')]['id']}})[_0x8438('0x22')](handleEntityNotFound(_0x4c499e,null))['then'](function(_0x332a98){if(_0x332a98){_0x6ff780['body'][_0x8438('0x4b')]=_0x332a98['id'];_0x6ff780[_0x8438('0x44')][_0x8438('0x4c')]=integrations[_0x8438('0x4d')](_0x6ff780[_0x8438('0x44')][_0x8438('0x4e')],_0x6ff780[_0x8438('0x44')]['type']);_0x6ff780[_0x8438('0x44')][_0x8438('0x4f')]=integrations['getDescriptions'](_0x6ff780[_0x8438('0x44')]['channel'],_0x6ff780['body'][_0x8438('0x2c')]);return db[_0x8438('0x48')][_0x8438('0x43')](_0x6ff780[_0x8438('0x44')],{'include':[{'model':db['ServicenowField'],'as':_0x8438('0x4c')},{'model':db[_0x8438('0x50')],'as':_0x8438('0x4f')}]});}return null;})[_0x8438('0x22')](respondWithResult(_0x4c499e,null))[_0x8438('0x42')](handleError(_0x4c499e,null));};exports[_0x8438('0x51')]=function(_0x598bd6,_0x3a6ef3,_0x3ecbcc){var _0x3c1754=[_0x8438('0x52'),_0x8438('0x53'),'knowledge',_0x8438('0x54'),_0x8438('0x55'),'notify',_0x8438('0x56'),_0x8438('0x57'),_0x8438('0x58')];var _0x5914f3=[_0x8438('0x59'),_0x8438('0x52'),'caused_by',_0x8438('0x5a'),_0x8438('0x5b'),_0x8438('0x5c'),_0x8438('0x5d'),_0x8438('0x53'),'approval_history',_0x8438('0x5e'),_0x8438('0x5f'),'sys_updated_by','opened_by',_0x8438('0x60'),_0x8438('0x61'),_0x8438('0x62'),'state',_0x8438('0x63'),'knowledge',_0x8438('0x38'),'calendar_stc',_0x8438('0x64'),_0x8438('0x65'),_0x8438('0x66'),_0x8438('0x67'),_0x8438('0x68'),_0x8438('0x69'),_0x8438('0x6a'),_0x8438('0x6b'),_0x8438('0x6c'),_0x8438('0x6d'),'time_worked',_0x8438('0x6e'),_0x8438('0x6f'),'business_duration','group_list',_0x8438('0x70'),'reopened_time',_0x8438('0x71'),_0x8438('0x72'),'approval_set','subcategory',_0x8438('0x73'),_0x8438('0x74'),'close_code',_0x8438('0x75'),_0x8438('0x76'),_0x8438('0x77'),_0x8438('0x78'),_0x8438('0x79'),_0x8438('0x7a'),'description',_0x8438('0x7b'),_0x8438('0x7c'),'sys_class_name','close_notes',_0x8438('0x7d'),_0x8438('0x7e'),_0x8438('0x7f'),'sys_id',_0x8438('0x80'),_0x8438('0x81'),_0x8438('0x56'),_0x8438('0x82'),_0x8438('0x83'),_0x8438('0x84'),_0x8438('0x85'),_0x8438('0x86'),'assigned_to',_0x8438('0x57'),_0x8438('0x87'),'sla_due',_0x8438('0x88'),_0x8438('0x89'),_0x8438('0x8a'),_0x8438('0x8b'),_0x8438('0x8c'),_0x8438('0x8d'),_0x8438('0x8e'),'upon_approval',_0x8438('0x8f'),'location',_0x8438('0x58')];var _0x28621d='';var _0x5b1a7b='';var _0x5dca46=[];var _0x577f0d='';var _0x4aa7d6='';var _0x549ecc=[];var _0x6ddde9='';var _0x57a64e='';var _0x1c4aed={};var _0x5c3fcd='';return db[_0x8438('0x29')]['findOne']({'where':{'id':_0x598bd6[_0x8438('0x45')]['id']},'attributes':['id',_0x8438('0x90'),_0x8438('0x91'),_0x8438('0x92'),_0x8438('0x93'),_0x8438('0x94')]})[_0x8438('0x22')](handleEntityNotFound(_0x3a6ef3,null))[_0x8438('0x22')](function(_0x35fd2d){if(_0x35fd2d){_0x5c3fcd=_0x35fd2d['remoteUri'];var _0x39ae55=_0x5c3fcd[_0x8438('0x95')](-0x1);if(_0x39ae55==='/'){_0x5c3fcd=_0x5c3fcd[_0x8438('0x96')](0x0,_0x5c3fcd[_0x8438('0x97')](_0x39ae55));}_0x57a64e=util[_0x8438('0x98')](_0x8438('0x99'),_0x5c3fcd);_0x6ddde9=util['format'](_0x8438('0x9a'),_0x5c3fcd);_0x1c4aed={'user':_0x35fd2d[_0x8438('0x90')],'pass':_0x35fd2d[_0x8438('0x91')]};var _0x3ada93={'method':_0x8438('0x9b'),'uri':_0x57a64e+_0x8438('0x9c'),'auth':_0x1c4aed,'json':!![]};return rp(_0x3ada93);}})['then'](function(_0x2cba1c){if(_0x2cba1c[_0x8438('0x9d')][_0x8438('0x35')]>0x0){_0x28621d=_0x2cba1c[_0x8438('0x9d')];}console[_0x8438('0x9e')]('incident\x20table\x20objects',_0x28621d);_0x549ecc=[];_0x5b1a7b=Object['assign']([],_0x28621d);_[_0x8438('0x9f')](_0x5b1a7b,function(_0x284767){return!_0x3c1754[_0x8438('0xa0')](_0x284767[_0x8438('0x27')]);});_0x5b1a7b[_0x8438('0xa1')](function(_0x49b4bb){var _0x3b6c8d=createFieldObject(_0x6ddde9,_0x1c4aed,_0x49b4bb[_0x8438('0xa2')],_0x49b4bb[_0x8438('0x27')],_0x49b4bb['label'],![]);_0x549ecc[_0x8438('0xa3')](_0x3b6c8d);});return Promise[_0x8438('0xa4')](_0x549ecc);})['then'](function(_0x3add61){_0x5dca46=_0x3add61;_0x577f0d=Object[_0x8438('0xa5')]([],_0x28621d);console['log']('TCL:\x20_object',_0x28621d);_[_0x8438('0x9f')](_0x577f0d,function(_0x528bcb){return _0x5914f3[_0x8438('0xa0')](_0x528bcb[_0x8438('0x27')]);});console[_0x8438('0x9e')](_0x8438('0xa6'),_0x577f0d);_0x549ecc=[];_0x577f0d['forEach'](function(_0x441ec1){var _0x55c158=createFieldObject(_0x6ddde9,_0x1c4aed,_0x441ec1[_0x8438('0xa2')],_0x441ec1[_0x8438('0x27')],_0x441ec1[_0x8438('0xa7')],!![]);_0x549ecc[_0x8438('0xa3')](_0x55c158);});return Promise[_0x8438('0xa4')](_0x549ecc);})['then'](function(_0x7d2729){_0x4aa7d6=_0x7d2729;var _0xc2269a=_0x5dca46['concat'](_0x4aa7d6);return{'count':_0xc2269a['length'],'rows':_0xc2269a};})[_0x8438('0x22')](respondWithResult(_0x3a6ef3,null))[_0x8438('0x42')](function(_0x3f01d4){console[_0x8438('0x9e')](_0x8438('0xa8')+_0x3f01d4);var _0x312a99=_0x598bd6[_0x8438('0x30')][_0x8438('0xa9')]?0x1f4:_0x3f01d4[_0x8438('0xaa')]||0x1f4;logger[_0x8438('0x25')](_0x3f01d4[_0x8438('0x26')]);delete _0x3f01d4[_0x8438('0x27')];if(_0x312a99===0x191){_0x312a99=0x190;}_0x3a6ef3[_0x8438('0x19')](_0x312a99)[_0x8438('0xab')](_0x598bd6[_0x8438('0x30')][_0x8438('0xa9')]?{'message':'Wrong\x20credentials','statusCode':_0x3f01d4[_0x8438('0xaa')]}:_0x3f01d4);});};function createFieldObject(_0x36f421,_0x3646a1,_0x1c3b7f,_0x5f1c6a,_0x42cd00,_0x16e801){return new Promise(function(_0x34f455,_0x478c61){var _0x44f072={'id':_0x5f1c6a,'name':_0x42cd00,'custom':_0x16e801};if(_0x1c3b7f===_0x8438('0xac')){_0x44f072[_0x8438('0x40')]=[{'name':_0x8438('0xad'),'value':_0x8438('0xae')},{'name':_0x8438('0xaf'),'value':'false'}];_0x34f455(_0x44f072);}else{var _0x662944={'method':'GET','uri':_0x36f421+_0x8438('0xb0')+_0x5f1c6a,'auth':_0x3646a1,'json':!![]};return rp(_0x662944)[_0x8438('0x22')](function(_0x20eb87){var _0x207461=[];if(_0x20eb87['result']['length']>0x0){_0x20eb87[_0x8438('0x9d')][_0x8438('0xa1')](function(_0x53e477){if(_0x53e477[_0x8438('0xb1')]==='false'){var _0xc4f552={'name':_0x53e477[_0x8438('0xa7')],'value':_0x53e477['value']};_0x207461[_0x8438('0xa3')](_0xc4f552);}});}_0x44f072[_0x8438('0x40')]=_0x207461;if(_0x44f072[_0x8438('0x40')][_0x8438('0x35')]>0x0){_0x34f455(_0x44f072);}else{if(_0x16e801==![]){_0x34f455();}else{_0x34f455(_0x44f072);}}});}});} \ No newline at end of file +var _0x2af0=['../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','sort','where','filter','merge','ServicenowAccount','includeAll','include','findAll','fields','length','options','find','catch','create','body','params','findOne','ServicenowConfiguration','order','nolimit','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','number','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','work_notes_list','business_service','priority','sys_domain_path','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','work_start','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','reopened_by','problem_id','company','reassignment_count','activity_due','assigned_to','comments','comments_and_work_notes','due_date','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','label','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','push','all','concat','ServiceNow\x20error:\x20','statusCode','stack','boolean','True','true','False','false','inactive','value','eml-format','zip-dir','moment','bluebird','util','path','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/utils'];(function(_0x38a653,_0x1a5872){var _0x370492=function(_0x33a556){while(--_0x33a556){_0x38a653['push'](_0x38a653['shift']());}};_0x370492(++_0x1a5872);}(_0x2af0,0x157));var _0x02af=function(_0x2d3030,_0x2daea2){_0x2d3030=_0x2d3030-0x0;var _0x247c7e=_0x2af0[_0x2d3030];return _0x247c7e;};'use strict';var emlformat=require(_0x02af('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x02af('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x02af('0x2'));var BPromise=require(_0x02af('0x3'));var Mustache=require('mustache');var util=require(_0x02af('0x4'));var path=require(_0x02af('0x5'));var sox=require(_0x02af('0x6'));var csv=require('to-csv');var ejs=require(_0x02af('0x7'));var fs=require('fs');var fs_extra=require(_0x02af('0x8'));var _=require(_0x02af('0x9'));var squel=require(_0x02af('0xa'));var crypto=require(_0x02af('0xb'));var jsforce=require(_0x02af('0xc'));var deskjs=require(_0x02af('0xd'));var toCsv=require('to-csv');var querystring=require(_0x02af('0xe'));var Papa=require(_0x02af('0xf'));var Redis=require(_0x02af('0x10'));var authService=require(_0x02af('0x11'));var qs=require(_0x02af('0x12'));var as=require(_0x02af('0x13'));var hardwareService=require(_0x02af('0x14'));var logger=require('../../config/logger')(_0x02af('0x15'));var utils=require(_0x02af('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x02af('0x17'));var db=require(_0x02af('0x18'))['db'];var integrations=require(_0x02af('0x19'));function respondWithStatusCode(_0x57b718,_0x29d4be){_0x29d4be=_0x29d4be||0xcc;return function(_0x28a4c4){if(_0x28a4c4){return _0x57b718[_0x02af('0x1a')](_0x29d4be);}return _0x57b718[_0x02af('0x1b')](_0x29d4be)[_0x02af('0x1c')]();};}function respondWithResult(_0x50db5a,_0xd1980b){_0xd1980b=_0xd1980b||0xc8;return function(_0x3eebb5){if(_0x3eebb5){return _0x50db5a[_0x02af('0x1b')](_0xd1980b)[_0x02af('0x1d')](_0x3eebb5);}};}function respondWithFilteredResult(_0x42a3c7,_0x10e4c2){return function(_0x57b4e0){if(_0x57b4e0){var _0x10b23e=typeof _0x10e4c2[_0x02af('0x1e')]==='undefined'&&typeof _0x10e4c2[_0x02af('0x1f')]===_0x02af('0x20');var _0x623da2=_0x57b4e0[_0x02af('0x21')];var _0x53c852=_0x10b23e?0x0:_0x10e4c2[_0x02af('0x1e')];var _0xfcef77=_0x10b23e?_0x57b4e0[_0x02af('0x21')]:_0x10e4c2[_0x02af('0x1e')]+_0x10e4c2['limit'];var _0x34b3d7;if(_0xfcef77>=_0x623da2){_0xfcef77=_0x623da2;_0x34b3d7=0xc8;}else{_0x34b3d7=0xce;}_0x42a3c7['status'](_0x34b3d7);return _0x42a3c7['set'](_0x02af('0x22'),_0x53c852+'-'+_0xfcef77+'/'+_0x623da2)[_0x02af('0x1d')](_0x57b4e0);}return null;};}function patchUpdates(_0x161ff7){return function(_0x495ff0){try{jsonpatch['apply'](_0x495ff0,_0x161ff7,!![]);}catch(_0x2dc044){return BPromise[_0x02af('0x23')](_0x2dc044);}return _0x495ff0[_0x02af('0x24')]();};}function saveUpdates(_0xed26d1,_0x5b3a32){return function(_0x1e25e8){if(_0x1e25e8){return _0x1e25e8[_0x02af('0x25')](_0xed26d1)[_0x02af('0x26')](function(_0x163689){return _0x163689;});}return null;};}function removeEntity(_0x19046f,_0x5b2f64){return function(_0x5193d3){if(_0x5193d3){return _0x5193d3[_0x02af('0x27')]()['then'](function(){_0x19046f['status'](0xcc)[_0x02af('0x1c')]();});}};}function handleEntityNotFound(_0x43131a,_0x5f1551){return function(_0x58a2e2){if(!_0x58a2e2){_0x43131a[_0x02af('0x1a')](0x194);}return _0x58a2e2;};}function handleError(_0x5e598d,_0x23c4b8){_0x23c4b8=_0x23c4b8||0x1f4;return function(_0x2ac6a0){logger[_0x02af('0x28')](_0x2ac6a0['stack']);if(_0x2ac6a0[_0x02af('0x29')]){delete _0x2ac6a0[_0x02af('0x29')];}_0x5e598d['status'](_0x23c4b8)['send'](_0x2ac6a0);};}exports[_0x02af('0x2a')]=function(_0x1c18e4,_0x4fe714){var _0x45f99e={},_0x32f399={},_0x1c7ea3={'count':0x0,'rows':[]};var _0xa19452=_[_0x02af('0x2b')](db['ServicenowAccount'][_0x02af('0x2c')],function(_0x54772e){return{'name':_0x54772e[_0x02af('0x2d')],'type':_0x54772e[_0x02af('0x2e')][_0x02af('0x2f')]};});_0x32f399[_0x02af('0x30')]=_[_0x02af('0x2b')](_0xa19452,_0x02af('0x29'));_0x32f399[_0x02af('0x31')]=_[_0x02af('0x32')](_0x1c18e4[_0x02af('0x31')]);_0x32f399[_0x02af('0x33')]=_[_0x02af('0x34')](_0x32f399[_0x02af('0x30')],_0x32f399[_0x02af('0x31')]);_0x45f99e[_0x02af('0x35')]=_[_0x02af('0x34')](_0x32f399[_0x02af('0x30')],qs['fields'](_0x1c18e4['query']['fields']));_0x45f99e[_0x02af('0x35')]=_0x45f99e['attributes']['length']?_0x45f99e['attributes']:_0x32f399[_0x02af('0x30')];if(!_0x1c18e4[_0x02af('0x31')][_0x02af('0x36')]('nolimit')){_0x45f99e['limit']=qs[_0x02af('0x1f')](_0x1c18e4[_0x02af('0x31')][_0x02af('0x1f')]);_0x45f99e['offset']=qs[_0x02af('0x1e')](_0x1c18e4['query'][_0x02af('0x1e')]);}_0x45f99e['order']=qs[_0x02af('0x37')](_0x1c18e4[_0x02af('0x31')][_0x02af('0x37')]);_0x45f99e[_0x02af('0x38')]=qs[_0x02af('0x33')](_['pick'](_0x1c18e4['query'],_0x32f399[_0x02af('0x33')]),_0xa19452);if(_0x1c18e4[_0x02af('0x31')][_0x02af('0x39')]){_0x45f99e['where']=_[_0x02af('0x3a')](_0x45f99e[_0x02af('0x38')],{'$or':_[_0x02af('0x2b')](_0xa19452,function(_0x320b4a){if(_0x320b4a[_0x02af('0x2e')]!=='VIRTUAL'){var _0x523979={};_0x523979[_0x320b4a['name']]={'$like':'%'+_0x1c18e4[_0x02af('0x31')][_0x02af('0x39')]+'%'};return _0x523979;}})});}_0x45f99e=_[_0x02af('0x3a')]({},_0x45f99e,_0x1c18e4['options']);var _0x2131bf={'where':_0x45f99e['where']};return db[_0x02af('0x3b')]['count'](_0x2131bf)[_0x02af('0x26')](function(_0x47b829){_0x1c7ea3[_0x02af('0x21')]=_0x47b829;if(_0x1c18e4['query'][_0x02af('0x3c')]){_0x45f99e[_0x02af('0x3d')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x02af('0x3e')](_0x45f99e);})[_0x02af('0x26')](function(_0x1d1450){_0x1c7ea3['rows']=_0x1d1450;return _0x1c7ea3;})[_0x02af('0x26')](respondWithFilteredResult(_0x4fe714,_0x45f99e))['catch'](handleError(_0x4fe714,null));};exports['show']=function(_0x16302d,_0x881377){var _0x4c6ed0={'raw':![],'where':{'id':_0x16302d['params']['id']}},_0xecdcf4={};_0xecdcf4[_0x02af('0x30')]=_[_0x02af('0x32')](db[_0x02af('0x3b')]['rawAttributes']);_0xecdcf4[_0x02af('0x31')]=_[_0x02af('0x32')](_0x16302d['query']);_0xecdcf4['filters']=_[_0x02af('0x34')](_0xecdcf4[_0x02af('0x30')],_0xecdcf4['query']);_0x4c6ed0['attributes']=_[_0x02af('0x34')](_0xecdcf4[_0x02af('0x30')],qs['fields'](_0x16302d[_0x02af('0x31')][_0x02af('0x3f')]));_0x4c6ed0[_0x02af('0x35')]=_0x4c6ed0['attributes'][_0x02af('0x40')]?_0x4c6ed0['attributes']:_0xecdcf4[_0x02af('0x30')];if(_0x16302d[_0x02af('0x31')][_0x02af('0x3c')]){_0x4c6ed0[_0x02af('0x3d')]=[{'all':!![]}];}_0x4c6ed0=_['merge']({},_0x4c6ed0,_0x16302d[_0x02af('0x41')]);return db[_0x02af('0x3b')][_0x02af('0x42')](_0x4c6ed0)[_0x02af('0x26')](handleEntityNotFound(_0x881377,null))[_0x02af('0x26')](respondWithResult(_0x881377,null))[_0x02af('0x43')](handleError(_0x881377,null));};exports[_0x02af('0x44')]=function(_0x2190c8,_0x4c8bea){return db['ServicenowAccount'][_0x02af('0x44')](_0x2190c8[_0x02af('0x45')],{})[_0x02af('0x26')](respondWithResult(_0x4c8bea,0xc9))[_0x02af('0x43')](handleError(_0x4c8bea,null));};exports[_0x02af('0x25')]=function(_0x2690cf,_0xdca5b3){if(_0x2690cf[_0x02af('0x45')]['id']){delete _0x2690cf[_0x02af('0x45')]['id'];}return db['ServicenowAccount']['find']({'where':{'id':_0x2690cf[_0x02af('0x46')]['id']}})[_0x02af('0x26')](handleEntityNotFound(_0xdca5b3,null))[_0x02af('0x26')](saveUpdates(_0x2690cf[_0x02af('0x45')],null))['then'](respondWithResult(_0xdca5b3,null))[_0x02af('0x43')](handleError(_0xdca5b3,null));};exports[_0x02af('0x27')]=function(_0x55895b,_0x385dba){return db[_0x02af('0x3b')][_0x02af('0x42')]({'where':{'id':_0x55895b['params']['id']}})['then'](handleEntityNotFound(_0x385dba,null))[_0x02af('0x26')](removeEntity(_0x385dba,null))['catch'](handleError(_0x385dba,null));};exports['getConfigurations']=function(_0x49fc93,_0x486413,_0x455b25){var _0x59dacb={};var _0x1d8247={};var _0x4ecc77;var _0x30b234;return db[_0x02af('0x3b')][_0x02af('0x47')]({'where':{'id':_0x49fc93[_0x02af('0x46')]['id']}})[_0x02af('0x26')](handleEntityNotFound(_0x486413,null))['then'](function(_0x5b24a0){if(_0x5b24a0){_0x4ecc77=_0x5b24a0;_0x1d8247[_0x02af('0x30')]=_[_0x02af('0x32')](db[_0x02af('0x48')]['rawAttributes']);_0x1d8247[_0x02af('0x31')]=_[_0x02af('0x32')](_0x49fc93['query']);_0x1d8247[_0x02af('0x33')]=_[_0x02af('0x34')](_0x1d8247[_0x02af('0x30')],_0x1d8247['query']);_0x59dacb[_0x02af('0x35')]=_[_0x02af('0x34')](_0x1d8247['model'],qs[_0x02af('0x3f')](_0x49fc93[_0x02af('0x31')][_0x02af('0x3f')]));_0x59dacb[_0x02af('0x35')]=_0x59dacb[_0x02af('0x35')][_0x02af('0x40')]?_0x59dacb[_0x02af('0x35')]:_0x1d8247[_0x02af('0x30')];_0x59dacb[_0x02af('0x49')]=qs[_0x02af('0x37')](_0x49fc93[_0x02af('0x31')][_0x02af('0x37')]);_0x59dacb[_0x02af('0x38')]=qs[_0x02af('0x33')](_['pick'](_0x49fc93[_0x02af('0x31')],_0x1d8247[_0x02af('0x33')]));if(_0x49fc93[_0x02af('0x31')][_0x02af('0x39')]){_0x59dacb[_0x02af('0x38')]=_[_0x02af('0x3a')](_0x59dacb[_0x02af('0x38')],{'$or':_[_0x02af('0x2b')](_0x59dacb[_0x02af('0x35')],function(_0x1b8484){var _0x328649={};_0x328649[_0x1b8484]={'$like':'%'+_0x49fc93[_0x02af('0x31')][_0x02af('0x39')]+'%'};return _0x328649;})});}_0x59dacb=_['merge']({},_0x59dacb,_0x49fc93[_0x02af('0x41')]);return _0x4ecc77['getConfigurations'](_0x59dacb);}})[_0x02af('0x26')](function(_0x362922){if(_0x362922){_0x30b234=_0x362922['length'];if(!_0x49fc93['query'][_0x02af('0x36')](_0x02af('0x4a'))){_0x59dacb['limit']=qs['limit'](_0x49fc93[_0x02af('0x31')][_0x02af('0x1f')]);_0x59dacb[_0x02af('0x1e')]=qs[_0x02af('0x1e')](_0x49fc93[_0x02af('0x31')]['offset']);}return _0x4ecc77[_0x02af('0x4b')](_0x59dacb);}})[_0x02af('0x26')](function(_0x1d4863){if(_0x1d4863){return _0x1d4863?{'count':_0x30b234,'rows':_0x1d4863}:null;}})[_0x02af('0x26')](respondWithResult(_0x486413,null))[_0x02af('0x43')](handleError(_0x486413,null));};exports[_0x02af('0x4c')]=function(_0x1786e9,_0x11886a,_0x4a2980){if(_0x1786e9[_0x02af('0x45')]['id']){delete _0x1786e9[_0x02af('0x45')]['id'];}return db[_0x02af('0x3b')][_0x02af('0x47')]({'where':{'id':_0x1786e9[_0x02af('0x46')]['id']}})[_0x02af('0x26')](handleEntityNotFound(_0x11886a,null))['then'](function(_0x135873){if(_0x135873){_0x1786e9[_0x02af('0x45')][_0x02af('0x4d')]=_0x135873['id'];_0x1786e9[_0x02af('0x45')][_0x02af('0x4e')]=integrations[_0x02af('0x4f')](_0x1786e9['body'][_0x02af('0x50')],_0x1786e9[_0x02af('0x45')][_0x02af('0x2e')]);_0x1786e9[_0x02af('0x45')][_0x02af('0x51')]=integrations[_0x02af('0x52')](_0x1786e9[_0x02af('0x45')]['channel'],_0x1786e9['body'][_0x02af('0x2e')]);return db[_0x02af('0x48')]['create'](_0x1786e9[_0x02af('0x45')],{'include':[{'model':db[_0x02af('0x53')],'as':_0x02af('0x4e')},{'model':db[_0x02af('0x53')],'as':'Descriptions'}]});}return null;})[_0x02af('0x26')](respondWithResult(_0x11886a,null))['catch'](handleError(_0x11886a,null));};exports[_0x02af('0x54')]=function(_0x359d09,_0x5317ff,_0x8c8a10){var _0x524db4=[_0x02af('0x55'),_0x02af('0x56'),_0x02af('0x57'),_0x02af('0x58'),'close_code',_0x02af('0x59'),_0x02af('0x5a'),_0x02af('0x5b'),_0x02af('0x5c')];var _0x41f909=[_0x02af('0x5d'),_0x02af('0x55'),_0x02af('0x5e'),_0x02af('0x5f'),_0x02af('0x60'),_0x02af('0x61'),'child_incidents','hold_reason','approval_history',_0x02af('0x62'),'resolved_by','sys_updated_by',_0x02af('0x63'),_0x02af('0x64'),'sys_created_on',_0x02af('0x65'),_0x02af('0x66'),_0x02af('0x67'),'knowledge',_0x02af('0x49'),_0x02af('0x68'),_0x02af('0x69'),'cmdb_ci',_0x02af('0x6a'),_0x02af('0x6b'),'active',_0x02af('0x6c'),_0x02af('0x6d'),_0x02af('0x6e'),_0x02af('0x6f'),'rfc','time_worked',_0x02af('0x70'),_0x02af('0x71'),_0x02af('0x72'),_0x02af('0x73'),_0x02af('0x74'),_0x02af('0x75'),_0x02af('0x76'),_0x02af('0x77'),_0x02af('0x78'),'subcategory',_0x02af('0x79'),_0x02af('0x7a'),'close_code',_0x02af('0x7b'),'delivery_task',_0x02af('0x7c'),'assignment_group',_0x02af('0x7d'),_0x02af('0x7e'),_0x02af('0x7f'),_0x02af('0x80'),_0x02af('0x59'),_0x02af('0x81'),_0x02af('0x82'),'closed_by',_0x02af('0x83'),_0x02af('0x84'),_0x02af('0x85'),'contact_type',_0x02af('0x86'),_0x02af('0x5a'),'urgency',_0x02af('0x87'),_0x02af('0x88'),_0x02af('0x89'),_0x02af('0x8a'),_0x02af('0x8b'),_0x02af('0x5b'),_0x02af('0x8c'),'sla_due','approval',_0x02af('0x8d'),_0x02af('0x8e'),'sys_mod_count',_0x02af('0x8f'),_0x02af('0x90'),_0x02af('0x91'),_0x02af('0x92'),_0x02af('0x93'),_0x02af('0x94'),'category'];var _0x1fbae3='';var _0x5076f6='';var _0x248e93=[];var _0x253cc6='';var _0xd34792='';var _0x1fa30b=[];var _0x2110d7='';var _0x119b69='';var _0x190489={};var _0x1ba2a9='';return db[_0x02af('0x3b')][_0x02af('0x47')]({'where':{'id':_0x359d09[_0x02af('0x46')]['id']},'attributes':['id',_0x02af('0x95'),_0x02af('0x96'),_0x02af('0x97'),'remoteUri','serverUrl']})['then'](handleEntityNotFound(_0x5317ff,null))[_0x02af('0x26')](function(_0x4bff4c){if(_0x4bff4c){_0x1ba2a9=_0x4bff4c['remoteUri'];var _0x28c4de=_0x1ba2a9[_0x02af('0x98')](-0x1);if(_0x28c4de==='/'){_0x1ba2a9=_0x1ba2a9[_0x02af('0x99')](0x0,_0x1ba2a9[_0x02af('0x9a')](_0x28c4de));}_0x119b69=util['format'](_0x02af('0x9b'),_0x1ba2a9);_0x2110d7=util[_0x02af('0x9c')]('%s/api/now/table/',_0x1ba2a9);_0x190489={'user':_0x4bff4c['username'],'pass':_0x4bff4c[_0x02af('0x96')]};var _0x3e26d9={'method':_0x02af('0x9d'),'uri':_0x119b69+_0x02af('0x9e'),'auth':_0x190489,'json':!![]};return rp(_0x3e26d9);}})['then'](function(_0x10aad9){if(_0x10aad9[_0x02af('0x9f')][_0x02af('0x40')]>0x0){_0x1fbae3=_0x10aad9[_0x02af('0x9f')];}console[_0x02af('0xa0')](_0x02af('0xa1'),_0x1fbae3);_0x1fa30b=[];_0x5076f6=Object[_0x02af('0xa2')]([],_0x1fbae3);_['remove'](_0x5076f6,function(_0x37f392){return!_0x524db4[_0x02af('0xa3')](_0x37f392[_0x02af('0x29')]);});_0x5076f6[_0x02af('0xa4')](function(_0x168bf4){var _0x526cd0=createFieldObject(_0x2110d7,_0x190489,_0x168bf4['internalType'],_0x168bf4['name'],_0x168bf4[_0x02af('0xa5')],![]);_0x1fa30b['push'](_0x526cd0);});return Promise['all'](_0x1fa30b);})[_0x02af('0x26')](function(_0x22cf6e){_0x248e93=_0x22cf6e;_0x253cc6=Object['assign']([],_0x1fbae3);console[_0x02af('0xa0')](_0x02af('0xa6'),_0x1fbae3);_[_0x02af('0xa7')](_0x253cc6,function(_0x352f5b){return _0x41f909[_0x02af('0xa3')](_0x352f5b[_0x02af('0x29')]);});console[_0x02af('0xa0')](_0x02af('0xa8'),_0x253cc6);_0x1fa30b=[];_0x253cc6[_0x02af('0xa4')](function(_0x3a9094){var _0x2b145a=createFieldObject(_0x2110d7,_0x190489,_0x3a9094[_0x02af('0xa9')],_0x3a9094['name'],_0x3a9094[_0x02af('0xa5')],!![]);_0x1fa30b[_0x02af('0xaa')](_0x2b145a);});return Promise[_0x02af('0xab')](_0x1fa30b);})[_0x02af('0x26')](function(_0x1a6020){_0xd34792=_0x1a6020;var _0x363cc6=_0x248e93[_0x02af('0xac')](_0xd34792);return{'count':_0x363cc6[_0x02af('0x40')],'rows':_0x363cc6};})['then'](respondWithResult(_0x5317ff,null))[_0x02af('0x43')](function(_0x128c4b){console[_0x02af('0xa0')](_0x02af('0xad')+_0x128c4b);var _0x11e378=_0x359d09[_0x02af('0x31')]['test']?0x1f4:_0x128c4b[_0x02af('0xae')]||0x1f4;logger[_0x02af('0x28')](_0x128c4b[_0x02af('0xaf')]);delete _0x128c4b['name'];if(_0x11e378===0x191){_0x11e378=0x190;}_0x5317ff[_0x02af('0x1b')](_0x11e378)['send'](_0x359d09[_0x02af('0x31')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x128c4b[_0x02af('0xae')]}:_0x128c4b);});};function createFieldObject(_0x3ed67e,_0x13e8c2,_0x462e74,_0x41d7e4,_0x31e346,_0x159f1c){return new Promise(function(_0x3b8f63,_0x329e8d){var _0x136f7d={'id':_0x41d7e4,'name':_0x31e346,'custom':_0x159f1c};if(_0x462e74===_0x02af('0xb0')){_0x136f7d[_0x02af('0x41')]=[{'name':_0x02af('0xb1'),'value':_0x02af('0xb2')},{'name':_0x02af('0xb3'),'value':_0x02af('0xb4')}];_0x3b8f63(_0x136f7d);}else{var _0x3b7d73={'method':_0x02af('0x9d'),'uri':_0x3ed67e+'sys_choice?sysparm_query=name=incident^element='+_0x41d7e4,'auth':_0x13e8c2,'json':!![]};return rp(_0x3b7d73)[_0x02af('0x26')](function(_0x4d2648){var _0x2c9801=[];if(_0x4d2648['result'][_0x02af('0x40')]>0x0){_0x4d2648['result']['forEach'](function(_0x16b1f4){if(_0x16b1f4[_0x02af('0xb5')]===_0x02af('0xb4')){var _0x2b751c={'name':_0x16b1f4[_0x02af('0xa5')],'value':_0x16b1f4[_0x02af('0xb6')]};_0x2c9801[_0x02af('0xaa')](_0x2b751c);}});}_0x136f7d[_0x02af('0x41')]=_0x2c9801;if(_0x136f7d[_0x02af('0x41')]['length']>0x0){_0x3b8f63(_0x136f7d);}else{if(_0x159f1c==![]){_0x3b8f63();}else{_0x3b8f63(_0x136f7d);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 801b853..f93e2b6 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.model.js +++ b/server/api/intServicenowAccount/intServicenowAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8fb=['../../components/integrations/configuration','define','int_servicenow_accounts','lodash','util','../../config/logger','api','path','rimraf','./intServicenowAccount.attributes'];(function(_0x118bd1,_0x159fac){var _0x324864=function(_0x22c06f){while(--_0x22c06f){_0x118bd1['push'](_0x118bd1['shift']());}};_0x324864(++_0x159fac);}(_0xd8fb,0x99));var _0xbd8f=function(_0x2bbaba,_0x4b208b){_0x2bbaba=_0x2bbaba-0x0;var _0x271a81=_0xd8fb[_0x2bbaba];return _0x271a81;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var logger=require(_0xbd8f('0x2'))(_0xbd8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd8f('0x4'));var rimraf=require(_0xbd8f('0x5'));var config=require('../../config/environment');var attributes=require(_0xbd8f('0x6'));var integrations=require(_0xbd8f('0x7'));module['exports']=function(_0x33d541,_0x4e97cf){return _0x33d541[_0xbd8f('0x8')]('ServicenowAccount',attributes,{'tableName':_0xbd8f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafc4=['path','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x7cf518,_0x1d5328){var _0x405d63=function(_0x57f025){while(--_0x57f025){_0x7cf518['push'](_0x7cf518['shift']());}};_0x405d63(++_0x1d5328);}(_0xafc4,0x69));var _0x4afc=function(_0x456295,_0x3615b5){_0x456295=_0x456295-0x0;var _0x40e0d7=_0xafc4[_0x456295];return _0x40e0d7;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x4afc('0x6'));module[_0x4afc('0x7')]=function(_0x16953b,_0x1bb281){return _0x16953b[_0x4afc('0x8')](_0x4afc('0x9'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 1390f2e..b81d45c 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.rpc.js +++ b/server/api/intServicenowAccount/intServicenowAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x010d=['request\x20sent','debug','error','code','message','result','ServicenowAccount','findAll','options','where','attributes','limit','include','map','model','GetServicenowAccount','stringify','catch','find','raw','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s'];(function(_0x46e198,_0xbdd317){var _0x878d4f=function(_0x24610d){while(--_0x24610d){_0x46e198['push'](_0x46e198['shift']());}};_0x878d4f(++_0xbdd317);}(_0x010d,0xed));var _0xd010=function(_0x35a785,_0x1da0bc){_0x35a785=_0x35a785-0x0;var _0x54d270=_0x010d[_0x35a785];return _0x54d270;};'use strict';var _=require(_0xd010('0x0'));var util=require(_0xd010('0x1'));var moment=require(_0xd010('0x2'));var BPromise=require(_0xd010('0x3'));var rs=require(_0xd010('0x4'));var fs=require('fs');var Redis=require(_0xd010('0x5'));var db=require(_0xd010('0x6'))['db'];var utils=require(_0xd010('0x7'));var logger=require(_0xd010('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd010('0x9')][_0xd010('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34cda9,_0xd7f2ab,_0x1be1ac){return new BPromise(function(_0x3c5189,_0x140df7){return client[_0xd010('0xb')](_0x34cda9,_0x1be1ac)[_0xd010('0xc')](function(_0x13f810){logger[_0xd010('0xd')](_0xd010('0xe'),_0xd7f2ab,_0xd010('0xf'));logger[_0xd010('0x10')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0xd7f2ab,_0xd010('0xf'),JSON['stringify'](_0x13f810));if(_0x13f810['error']){if(_0x13f810[_0xd010('0x11')][_0xd010('0x12')]===0x1f4){logger['error'](_0xd010('0xe'),_0xd7f2ab,_0x13f810[_0xd010('0x11')]['message']);return _0x140df7(_0x13f810[_0xd010('0x11')][_0xd010('0x13')]);}logger[_0xd010('0x11')](_0xd010('0xe'),_0xd7f2ab,_0x13f810['error'][_0xd010('0x13')]);return _0x3c5189(_0x13f810['error'][_0xd010('0x13')]);}else{logger[_0xd010('0xd')](_0xd010('0xe'),_0xd7f2ab,_0xd010('0xf'));_0x3c5189(_0x13f810[_0xd010('0x14')]['message']);}})['catch'](function(_0x3d312b){logger[_0xd010('0x11')](_0xd010('0xe'),_0xd7f2ab,_0x3d312b);_0x140df7(_0x3d312b);});});}exports['GetServicenowAccount']=function(_0x646d8d){var _0x1ade65=this;return new Promise(function(_0x1980ed,_0x322326){return db[_0xd010('0x15')][_0xd010('0x16')]({'raw':_0x646d8d[_0xd010('0x17')]?_0x646d8d[_0xd010('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x646d8d[_0xd010('0x17')]?_0x646d8d[_0xd010('0x17')][_0xd010('0x18')]||null:null,'attributes':_0x646d8d['options']?_0x646d8d[_0xd010('0x17')][_0xd010('0x19')]||null:null,'limit':_0x646d8d[_0xd010('0x17')]?_0x646d8d[_0xd010('0x17')][_0xd010('0x1a')]||null:null,'include':_0x646d8d[_0xd010('0x17')]?_0x646d8d[_0xd010('0x17')][_0xd010('0x1b')]?_[_0xd010('0x1c')](_0x646d8d[_0xd010('0x17')]['include'],function(_0x4d0037){return{'model':db[_0x4d0037[_0xd010('0x1d')]],'as':_0x4d0037['as'],'attributes':_0x4d0037[_0xd010('0x19')],'include':_0x4d0037[_0xd010('0x1b')]?_[_0xd010('0x1c')](_0x4d0037['include'],function(_0x11d345){return{'model':db[_0x11d345['model']],'as':_0x11d345['as'],'attributes':_0x11d345['attributes'],'include':_0x11d345[_0xd010('0x1b')]?_[_0xd010('0x1c')](_0x11d345[_0xd010('0x1b')],function(_0x2d4e58){return{'model':db[_0x2d4e58[_0xd010('0x1d')]],'as':_0x2d4e58['as'],'attributes':_0x2d4e58['attributes']};}):[]};}):[]};}):[]:[]})[_0xd010('0xc')](function(_0x4343ee){logger[_0xd010('0xd')](_0xd010('0x1e'),_0x646d8d);logger['debug']('GetServicenowAccount',_0x646d8d,JSON[_0xd010('0x1f')](_0x4343ee));_0x1980ed(_0x4343ee);})[_0xd010('0x20')](function(_0x226ad6){logger['error'](_0xd010('0x1e'),_0x226ad6[_0xd010('0x13')],_0x646d8d);_0x322326(_0x1ade65[_0xd010('0x11')](0x1f4,_0x226ad6['message']));});});};exports['ShowServicenowAccount']=function(_0x178646){var _0x34d0bb=this;return new Promise(function(_0x182b78,_0x5c4284){return db[_0xd010('0x15')][_0xd010('0x21')]({'raw':_0x178646[_0xd010('0x17')]?_0x178646['options'][_0xd010('0x22')]===undefined?!![]:![]:!![],'where':_0x178646[_0xd010('0x17')]?_0x178646['options']['where']||null:null,'attributes':_0x178646['options']?_0x178646[_0xd010('0x17')][_0xd010('0x19')]||null:null,'include':_0x178646[_0xd010('0x17')]?_0x178646['options']['include']?_['map'](_0x178646[_0xd010('0x17')][_0xd010('0x1b')],function(_0x7e12a5){return{'model':db[_0x7e12a5[_0xd010('0x1d')]],'as':_0x7e12a5['as'],'attributes':_0x7e12a5['attributes'],'include':_0x7e12a5[_0xd010('0x1b')]?_[_0xd010('0x1c')](_0x7e12a5['include'],function(_0x2bb177){return{'model':db[_0x2bb177[_0xd010('0x1d')]],'as':_0x2bb177['as'],'attributes':_0x2bb177[_0xd010('0x19')],'include':_0x2bb177[_0xd010('0x1b')]?_['map'](_0x2bb177['include'],function(_0x58b287){return{'model':db[_0x58b287[_0xd010('0x1d')]],'as':_0x58b287['as'],'attributes':_0x58b287['attributes']};}):[]};}):[]};}):[]:[]})[_0xd010('0xc')](function(_0x3beed6){logger[_0xd010('0xd')](_0xd010('0x23'),_0x178646);logger[_0xd010('0x10')](_0xd010('0x23'),_0x178646,JSON[_0xd010('0x1f')](_0x3beed6));_0x182b78(_0x3beed6);})['catch'](function(_0x159a78){logger['error'](_0xd010('0x23'),_0x159a78[_0xd010('0x13')],_0x178646);_0x5c4284(_0x34d0bb['error'](0x1f4,_0x159a78[_0xd010('0x13')]));});});}; \ No newline at end of file +var _0x7702=['message','result','GetServicenowAccount','ServicenowAccount','findAll','options','attributes','limit','include','map','model','info','debug','catch','ShowServicenowAccount','find','raw','where','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x56d4b9,_0x56b68b){var _0x51d960=function(_0x4992f7){while(--_0x4992f7){_0x56d4b9['push'](_0x56d4b9['shift']());}};_0x51d960(++_0x56b68b);}(_0x7702,0x1b6));var _0x2770=function(_0x19d344,_0x2fd503){_0x19d344=_0x19d344-0x0;var _0x4decef=_0x7702[_0x19d344];return _0x4decef;};'use strict';var _=require('lodash');var util=require(_0x2770('0x0'));var moment=require('moment');var BPromise=require(_0x2770('0x1'));var rs=require(_0x2770('0x2'));var fs=require('fs');var Redis=require(_0x2770('0x3'));var db=require(_0x2770('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2770('0x5'))(_0x2770('0x6'));var config=require(_0x2770('0x7'));var jayson=require(_0x2770('0x8'));var client=jayson['client'][_0x2770('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x471eb6,_0x26bb8d,_0x5abb28){return new BPromise(function(_0x3cce67,_0x3e2e7f){return client[_0x2770('0xa')](_0x471eb6,_0x5abb28)[_0x2770('0xb')](function(_0x1b0d84){logger['info'](_0x2770('0xc'),_0x26bb8d,_0x2770('0xd'));logger['debug'](_0x2770('0xe'),_0x26bb8d,_0x2770('0xd'),JSON[_0x2770('0xf')](_0x1b0d84));if(_0x1b0d84['error']){if(_0x1b0d84['error']['code']===0x1f4){logger['error'](_0x2770('0xc'),_0x26bb8d,_0x1b0d84[_0x2770('0x10')]['message']);return _0x3e2e7f(_0x1b0d84[_0x2770('0x10')][_0x2770('0x11')]);}logger[_0x2770('0x10')](_0x2770('0xc'),_0x26bb8d,_0x1b0d84[_0x2770('0x10')][_0x2770('0x11')]);return _0x3cce67(_0x1b0d84[_0x2770('0x10')][_0x2770('0x11')]);}else{logger['info'](_0x2770('0xc'),_0x26bb8d,_0x2770('0xd'));_0x3cce67(_0x1b0d84[_0x2770('0x12')]['message']);}})['catch'](function(_0x35866a){logger[_0x2770('0x10')](_0x2770('0xc'),_0x26bb8d,_0x35866a);_0x3e2e7f(_0x35866a);});});}exports[_0x2770('0x13')]=function(_0x236e17){var _0x5bece8=this;return new Promise(function(_0x47178a,_0x466252){return db[_0x2770('0x14')][_0x2770('0x15')]({'raw':_0x236e17[_0x2770('0x16')]?_0x236e17[_0x2770('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x236e17['options']?_0x236e17['options']['where']||null:null,'attributes':_0x236e17['options']?_0x236e17[_0x2770('0x16')][_0x2770('0x17')]||null:null,'limit':_0x236e17[_0x2770('0x16')]?_0x236e17[_0x2770('0x16')][_0x2770('0x18')]||null:null,'include':_0x236e17['options']?_0x236e17[_0x2770('0x16')][_0x2770('0x19')]?_[_0x2770('0x1a')](_0x236e17[_0x2770('0x16')][_0x2770('0x19')],function(_0x2e0fa8){return{'model':db[_0x2e0fa8[_0x2770('0x1b')]],'as':_0x2e0fa8['as'],'attributes':_0x2e0fa8[_0x2770('0x17')],'include':_0x2e0fa8[_0x2770('0x19')]?_[_0x2770('0x1a')](_0x2e0fa8[_0x2770('0x19')],function(_0x37d596){return{'model':db[_0x37d596[_0x2770('0x1b')]],'as':_0x37d596['as'],'attributes':_0x37d596[_0x2770('0x17')],'include':_0x37d596[_0x2770('0x19')]?_[_0x2770('0x1a')](_0x37d596[_0x2770('0x19')],function(_0x2cce3f){return{'model':db[_0x2cce3f[_0x2770('0x1b')]],'as':_0x2cce3f['as'],'attributes':_0x2cce3f['attributes']};}):[]};}):[]};}):[]:[]})[_0x2770('0xb')](function(_0x58e485){logger[_0x2770('0x1c')](_0x2770('0x13'),_0x236e17);logger[_0x2770('0x1d')](_0x2770('0x13'),_0x236e17,JSON[_0x2770('0xf')](_0x58e485));_0x47178a(_0x58e485);})[_0x2770('0x1e')](function(_0x3d7f13){logger[_0x2770('0x10')](_0x2770('0x13'),_0x3d7f13[_0x2770('0x11')],_0x236e17);_0x466252(_0x5bece8[_0x2770('0x10')](0x1f4,_0x3d7f13['message']));});});};exports[_0x2770('0x1f')]=function(_0xb3779d){var _0x3ed3cd=this;return new Promise(function(_0x3be128,_0x37a941){return db[_0x2770('0x14')][_0x2770('0x20')]({'raw':_0xb3779d[_0x2770('0x16')]?_0xb3779d['options'][_0x2770('0x21')]===undefined?!![]:![]:!![],'where':_0xb3779d[_0x2770('0x16')]?_0xb3779d[_0x2770('0x16')][_0x2770('0x22')]||null:null,'attributes':_0xb3779d[_0x2770('0x16')]?_0xb3779d[_0x2770('0x16')][_0x2770('0x17')]||null:null,'include':_0xb3779d['options']?_0xb3779d['options'][_0x2770('0x19')]?_[_0x2770('0x1a')](_0xb3779d[_0x2770('0x16')][_0x2770('0x19')],function(_0x1fcf6f){return{'model':db[_0x1fcf6f[_0x2770('0x1b')]],'as':_0x1fcf6f['as'],'attributes':_0x1fcf6f[_0x2770('0x17')],'include':_0x1fcf6f[_0x2770('0x19')]?_[_0x2770('0x1a')](_0x1fcf6f[_0x2770('0x19')],function(_0x181756){return{'model':db[_0x181756[_0x2770('0x1b')]],'as':_0x181756['as'],'attributes':_0x181756[_0x2770('0x17')],'include':_0x181756[_0x2770('0x19')]?_[_0x2770('0x1a')](_0x181756['include'],function(_0x40a10d){return{'model':db[_0x40a10d[_0x2770('0x1b')]],'as':_0x40a10d['as'],'attributes':_0x40a10d['attributes']};}):[]};}):[]};}):[]:[]})[_0x2770('0xb')](function(_0x2613db){logger[_0x2770('0x1c')](_0x2770('0x1f'),_0xb3779d);logger[_0x2770('0x1d')](_0x2770('0x1f'),_0xb3779d,JSON['stringify'](_0x2613db));_0x3be128(_0x2613db);})[_0x2770('0x1e')](function(_0x7f57e3){logger[_0x2770('0x10')](_0x2770('0x1f'),_0x7f57e3['message'],_0xb3779d);_0x37a941(_0x3ed3cd[_0x2770('0x10')](0x1f4,_0x7f57e3[_0x2770('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 68fb4ac..6716b15 100644 --- a/server/api/intServicenowConfiguration/index.js +++ b/server/api/intServicenowConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc94=['/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','show'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xcc94,0x184));var _0x4cc9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc94[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4cc9('0x0'));var util=require('util');var path=require(_0x4cc9('0x1'));var timeout=require(_0x4cc9('0x2'));var express=require('express');var router=express[_0x4cc9('0x3')]();var fs_extra=require(_0x4cc9('0x4'));var auth=require(_0x4cc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4cc9('0x6'));var controller=require(_0x4cc9('0x7'));router[_0x4cc9('0x8')]('/',auth[_0x4cc9('0x9')](),controller[_0x4cc9('0xa')]);router[_0x4cc9('0x8')]('/:id',auth[_0x4cc9('0x9')](),controller[_0x4cc9('0xb')]);router[_0x4cc9('0x8')](_0x4cc9('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x4cc9('0x8')](_0x4cc9('0xd'),auth['isAuthenticated'](),controller[_0x4cc9('0xe')]);router[_0x4cc9('0x8')](_0x4cc9('0xf'),auth['isAuthenticated'](),controller[_0x4cc9('0x10')]);router[_0x4cc9('0x11')]('/',auth[_0x4cc9('0x9')](),controller[_0x4cc9('0x12')]);router[_0x4cc9('0x13')](_0x4cc9('0x14'),auth[_0x4cc9('0x9')](),controller[_0x4cc9('0x15')]);router[_0x4cc9('0x16')](_0x4cc9('0x14'),auth[_0x4cc9('0x9')](),controller[_0x4cc9('0x17')]);module[_0x4cc9('0x18')]=router; \ No newline at end of file +var _0xb3a9=['index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','isAuthenticated'];(function(_0x26357f,_0x34e768){var _0x50a320=function(_0x3f162f){while(--_0x3f162f){_0x26357f['push'](_0x26357f['shift']());}};_0x50a320(++_0x34e768);}(_0xb3a9,0x73));var _0x9b3a=function(_0x389fcc,_0x1bcd52){_0x389fcc=_0x389fcc-0x0;var _0x20570e=_0xb3a9[_0x389fcc];return _0x20570e;};'use strict';var multer=require(_0x9b3a('0x0'));var util=require(_0x9b3a('0x1'));var path=require(_0x9b3a('0x2'));var timeout=require(_0x9b3a('0x3'));var express=require(_0x9b3a('0x4'));var router=express[_0x9b3a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9b3a('0x6'));var interaction=require(_0x9b3a('0x7'));var config=require('../../config/environment');var controller=require(_0x9b3a('0x8'));router['get']('/',auth[_0x9b3a('0x9')](),controller[_0x9b3a('0xa')]);router[_0x9b3a('0xb')](_0x9b3a('0xc'),auth[_0x9b3a('0x9')](),controller[_0x9b3a('0xd')]);router[_0x9b3a('0xb')](_0x9b3a('0xe'),auth['isAuthenticated'](),controller[_0x9b3a('0xf')]);router['get'](_0x9b3a('0x10'),auth[_0x9b3a('0x9')](),controller[_0x9b3a('0x11')]);router[_0x9b3a('0xb')](_0x9b3a('0x12'),auth['isAuthenticated'](),controller[_0x9b3a('0x13')]);router[_0x9b3a('0x14')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9b3a('0xc'),auth[_0x9b3a('0x9')](),controller[_0x9b3a('0x15')]);router[_0x9b3a('0x16')](_0x9b3a('0xc'),auth[_0x9b3a('0x9')](),controller[_0x9b3a('0x17')]);module[_0x9b3a('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index c343d86..8ebe2fc 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x940d=['exports','STRING'];(function(_0x4d4ad7,_0x363a45){var _0x5365a2=function(_0x5ec385){while(--_0x5ec385){_0x4d4ad7['push'](_0x4d4ad7['shift']());}};_0x5365a2(++_0x363a45);}(_0x940d,0x1a2));var _0xd940=function(_0x4afb16,_0x347a4e){_0x4afb16=_0x4afb16-0x0;var _0x2bb64c=_0x940d[_0x4afb16];return _0x2bb64c;};'use strict';var Sequelize=require('sequelize');module[_0xd940('0x0')]={'name':{'type':Sequelize[_0xd940('0x1')]},'description':{'type':Sequelize[_0xd940('0x1')]}}; \ No newline at end of file +var _0xdbfd=['STRING'];(function(_0x21dd81,_0x3d7113){var _0x102e8e=function(_0x42b323){while(--_0x42b323){_0x21dd81['push'](_0x21dd81['shift']());}};_0x102e8e(++_0x3d7113);}(_0xdbfd,0x1d8));var _0xddbf=function(_0x5d8467,_0x240e01){_0x5d8467=_0x5d8467-0x0;var _0x326eab=_0xdbfd[_0x5d8467];return _0x326eab;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xddbf('0x0')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 4212a2b..5ba096e 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2bcb=['undefined','limit','count','apply','reject','save','update','destroy','then','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','filter','options','ServicenowConfiguration','includeAll','include','findAll','rows','params','keys','find','catch','create','body','getFields','findOne','order','pick','hasOwnProperty','ServicenowField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x205a6e,_0x571a14){var _0x43adb6=function(_0xb71d8b){while(--_0xb71d8b){_0x205a6e['push'](_0x205a6e['shift']());}};_0x43adb6(++_0x571a14);}(_0x2bcb,0x16a));var _0xb2bc=function(_0x122b82,_0x7f0e23){_0x122b82=_0x122b82-0x0;var _0x20ad2d=_0x2bcb[_0x122b82];return _0x20ad2d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb2bc('0x0'));var zipdir=require(_0xb2bc('0x1'));var jsonpatch=require(_0xb2bc('0x2'));var rp=require(_0xb2bc('0x3'));var moment=require(_0xb2bc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb2bc('0x5'));var util=require(_0xb2bc('0x6'));var path=require('path');var sox=require(_0xb2bc('0x7'));var csv=require(_0xb2bc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb2bc('0x9'));var _=require(_0xb2bc('0xa'));var squel=require(_0xb2bc('0xb'));var crypto=require('crypto');var jsforce=require(_0xb2bc('0xc'));var deskjs=require(_0xb2bc('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb2bc('0xe'));var Papa=require(_0xb2bc('0xf'));var Redis=require('ioredis');var authService=require(_0xb2bc('0x10'));var qs=require(_0xb2bc('0x11'));var as=require(_0xb2bc('0x12'));var hardwareService=require(_0xb2bc('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb2bc('0x14'));var licenseUtil=require(_0xb2bc('0x15'));var db=require(_0xb2bc('0x16'))['db'];function respondWithStatusCode(_0x5441ca,_0x3878d9){_0x3878d9=_0x3878d9||0xcc;return function(_0x2f66c9){if(_0x2f66c9){return _0x5441ca[_0xb2bc('0x17')](_0x3878d9);}return _0x5441ca['status'](_0x3878d9)[_0xb2bc('0x18')]();};}function respondWithResult(_0x458f95,_0x41835d){_0x41835d=_0x41835d||0xc8;return function(_0x10aa57){if(_0x10aa57){return _0x458f95[_0xb2bc('0x19')](_0x41835d)[_0xb2bc('0x1a')](_0x10aa57);}};}function respondWithFilteredResult(_0x5aa706,_0x2dbbd7){return function(_0x2c9d47){if(_0x2c9d47){var _0x207acc=typeof _0x2dbbd7[_0xb2bc('0x1b')]===_0xb2bc('0x1c')&&typeof _0x2dbbd7[_0xb2bc('0x1d')]===_0xb2bc('0x1c');var _0x76ba0d=_0x2c9d47[_0xb2bc('0x1e')];var _0x2ade3e=_0x207acc?0x0:_0x2dbbd7['offset'];var _0x57aa78=_0x207acc?_0x2c9d47[_0xb2bc('0x1e')]:_0x2dbbd7[_0xb2bc('0x1b')]+_0x2dbbd7[_0xb2bc('0x1d')];var _0x2ba866;if(_0x57aa78>=_0x76ba0d){_0x57aa78=_0x76ba0d;_0x2ba866=0xc8;}else{_0x2ba866=0xce;}_0x5aa706[_0xb2bc('0x19')](_0x2ba866);return _0x5aa706['set']('Content-Range',_0x2ade3e+'-'+_0x57aa78+'/'+_0x76ba0d)[_0xb2bc('0x1a')](_0x2c9d47);}return null;};}function patchUpdates(_0x5bc4d6){return function(_0x4aabb7){try{jsonpatch[_0xb2bc('0x1f')](_0x4aabb7,_0x5bc4d6,!![]);}catch(_0x2ff860){return BPromise[_0xb2bc('0x20')](_0x2ff860);}return _0x4aabb7[_0xb2bc('0x21')]();};}function saveUpdates(_0x3f4d13,_0x4bf784){return function(_0x384c93){if(_0x384c93){return _0x384c93[_0xb2bc('0x22')](_0x3f4d13)['then'](function(_0x191cdc){return _0x191cdc;});}return null;};}function removeEntity(_0x39afc7,_0x4ade04){return function(_0xf529bf){if(_0xf529bf){return _0xf529bf[_0xb2bc('0x23')]()[_0xb2bc('0x24')](function(){_0x39afc7['status'](0xcc)[_0xb2bc('0x18')]();});}};}function handleEntityNotFound(_0x1840af,_0x5a81c7){return function(_0x4ec561){if(!_0x4ec561){_0x1840af[_0xb2bc('0x17')](0x194);}return _0x4ec561;};}function handleError(_0x15dd55,_0x180db0){_0x180db0=_0x180db0||0x1f4;return function(_0x6dd0c2){logger['error'](_0x6dd0c2[_0xb2bc('0x25')]);if(_0x6dd0c2[_0xb2bc('0x26')]){delete _0x6dd0c2['name'];}_0x15dd55['status'](_0x180db0)['send'](_0x6dd0c2);};}exports[_0xb2bc('0x27')]=function(_0x16e561,_0x4bdfc1){var _0x314a2c={},_0xa24d81={},_0x5f28ed={'count':0x0,'rows':[]};var _0x402502=_['map'](db['ServicenowConfiguration'][_0xb2bc('0x28')],function(_0x5b3ec6){return{'name':_0x5b3ec6[_0xb2bc('0x29')],'type':_0x5b3ec6[_0xb2bc('0x2a')][_0xb2bc('0x2b')]};});_0xa24d81[_0xb2bc('0x2c')]=_[_0xb2bc('0x2d')](_0x402502,_0xb2bc('0x26'));_0xa24d81[_0xb2bc('0x2e')]=_['keys'](_0x16e561[_0xb2bc('0x2e')]);_0xa24d81[_0xb2bc('0x2f')]=_[_0xb2bc('0x30')](_0xa24d81[_0xb2bc('0x2c')],_0xa24d81[_0xb2bc('0x2e')]);_0x314a2c[_0xb2bc('0x31')]=_['intersection'](_0xa24d81[_0xb2bc('0x2c')],qs[_0xb2bc('0x32')](_0x16e561['query']['fields']));_0x314a2c['attributes']=_0x314a2c['attributes'][_0xb2bc('0x33')]?_0x314a2c['attributes']:_0xa24d81[_0xb2bc('0x2c')];if(!_0x16e561[_0xb2bc('0x2e')]['hasOwnProperty'](_0xb2bc('0x34'))){_0x314a2c['limit']=qs['limit'](_0x16e561['query'][_0xb2bc('0x1d')]);_0x314a2c[_0xb2bc('0x1b')]=qs[_0xb2bc('0x1b')](_0x16e561[_0xb2bc('0x2e')][_0xb2bc('0x1b')]);}_0x314a2c['order']=qs[_0xb2bc('0x35')](_0x16e561[_0xb2bc('0x2e')][_0xb2bc('0x35')]);_0x314a2c[_0xb2bc('0x36')]=qs[_0xb2bc('0x2f')](_['pick'](_0x16e561[_0xb2bc('0x2e')],_0xa24d81[_0xb2bc('0x2f')]),_0x402502);if(_0x16e561['query']['filter']){_0x314a2c['where']=_[_0xb2bc('0x37')](_0x314a2c['where'],{'$or':_[_0xb2bc('0x2d')](_0x402502,function(_0x3bd575){if(_0x3bd575[_0xb2bc('0x2a')]!==_0xb2bc('0x38')){var _0x493e98={};_0x493e98[_0x3bd575['name']]={'$like':'%'+_0x16e561[_0xb2bc('0x2e')][_0xb2bc('0x39')]+'%'};return _0x493e98;}})});}_0x314a2c=_[_0xb2bc('0x37')]({},_0x314a2c,_0x16e561[_0xb2bc('0x3a')]);var _0x2d487c={'where':_0x314a2c[_0xb2bc('0x36')]};return db[_0xb2bc('0x3b')][_0xb2bc('0x1e')](_0x2d487c)[_0xb2bc('0x24')](function(_0x543f71){_0x5f28ed['count']=_0x543f71;if(_0x16e561[_0xb2bc('0x2e')][_0xb2bc('0x3c')]){_0x314a2c[_0xb2bc('0x3d')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xb2bc('0x3e')](_0x314a2c);})[_0xb2bc('0x24')](function(_0x1c42e8){_0x5f28ed[_0xb2bc('0x3f')]=_0x1c42e8;return _0x5f28ed;})[_0xb2bc('0x24')](respondWithFilteredResult(_0x4bdfc1,_0x314a2c))['catch'](handleError(_0x4bdfc1,null));};exports['show']=function(_0x320439,_0x3688bf){var _0x3efcf1={'raw':![],'where':{'id':_0x320439[_0xb2bc('0x40')]['id']}},_0x3ecb00={};_0x3ecb00['model']=_[_0xb2bc('0x41')](db[_0xb2bc('0x3b')]['rawAttributes']);_0x3ecb00[_0xb2bc('0x2e')]=_[_0xb2bc('0x41')](_0x320439[_0xb2bc('0x2e')]);_0x3ecb00[_0xb2bc('0x2f')]=_['intersection'](_0x3ecb00['model'],_0x3ecb00['query']);_0x3efcf1[_0xb2bc('0x31')]=_['intersection'](_0x3ecb00['model'],qs[_0xb2bc('0x32')](_0x320439[_0xb2bc('0x2e')]['fields']));_0x3efcf1[_0xb2bc('0x31')]=_0x3efcf1[_0xb2bc('0x31')][_0xb2bc('0x33')]?_0x3efcf1[_0xb2bc('0x31')]:_0x3ecb00[_0xb2bc('0x2c')];if(_0x320439['query'][_0xb2bc('0x3c')]){_0x3efcf1[_0xb2bc('0x3d')]=[{'all':!![]}];}_0x3efcf1=_[_0xb2bc('0x37')]({},_0x3efcf1,_0x320439[_0xb2bc('0x3a')]);return db[_0xb2bc('0x3b')][_0xb2bc('0x42')](_0x3efcf1)[_0xb2bc('0x24')](handleEntityNotFound(_0x3688bf,null))[_0xb2bc('0x24')](respondWithResult(_0x3688bf,null))[_0xb2bc('0x43')](handleError(_0x3688bf,null));};exports[_0xb2bc('0x44')]=function(_0x409a52,_0xa5dd13){return db[_0xb2bc('0x3b')][_0xb2bc('0x44')](_0x409a52[_0xb2bc('0x45')],{})[_0xb2bc('0x24')](respondWithResult(_0xa5dd13,0xc9))[_0xb2bc('0x43')](handleError(_0xa5dd13,null));};exports[_0xb2bc('0x22')]=function(_0x420566,_0x17d83b){if(_0x420566[_0xb2bc('0x45')]['id']){delete _0x420566[_0xb2bc('0x45')]['id'];}return db[_0xb2bc('0x3b')][_0xb2bc('0x42')]({'where':{'id':_0x420566[_0xb2bc('0x40')]['id']}})['then'](handleEntityNotFound(_0x17d83b,null))[_0xb2bc('0x24')](saveUpdates(_0x420566[_0xb2bc('0x45')],null))[_0xb2bc('0x24')](respondWithResult(_0x17d83b,null))['catch'](handleError(_0x17d83b,null));};exports['destroy']=function(_0x35abd2,_0xfdc57a){return db['ServicenowConfiguration'][_0xb2bc('0x42')]({'where':{'id':_0x35abd2[_0xb2bc('0x40')]['id']}})[_0xb2bc('0x24')](handleEntityNotFound(_0xfdc57a,null))['then'](removeEntity(_0xfdc57a,null))['catch'](handleError(_0xfdc57a,null));};exports[_0xb2bc('0x46')]=function(_0x21f2dc,_0x52ac31,_0x3c155b){var _0x221556={};var _0x4f56d0={};var _0x413836;var _0x52b8fa;return db[_0xb2bc('0x3b')][_0xb2bc('0x47')]({'where':{'id':_0x21f2dc[_0xb2bc('0x40')]['id']}})['then'](handleEntityNotFound(_0x52ac31,null))[_0xb2bc('0x24')](function(_0x18931c){if(_0x18931c){_0x413836=_0x18931c;_0x4f56d0[_0xb2bc('0x2c')]=_['keys'](db['ServicenowField']['rawAttributes']);_0x4f56d0['query']=_[_0xb2bc('0x41')](_0x21f2dc[_0xb2bc('0x2e')]);_0x4f56d0[_0xb2bc('0x2f')]=_['intersection'](_0x4f56d0[_0xb2bc('0x2c')],_0x4f56d0[_0xb2bc('0x2e')]);_0x221556[_0xb2bc('0x31')]=_[_0xb2bc('0x30')](_0x4f56d0[_0xb2bc('0x2c')],qs[_0xb2bc('0x32')](_0x21f2dc['query'][_0xb2bc('0x32')]));_0x221556['attributes']=_0x221556[_0xb2bc('0x31')][_0xb2bc('0x33')]?_0x221556[_0xb2bc('0x31')]:_0x4f56d0[_0xb2bc('0x2c')];_0x221556[_0xb2bc('0x48')]=qs['sort'](_0x21f2dc['query'][_0xb2bc('0x35')]);_0x221556[_0xb2bc('0x36')]=qs[_0xb2bc('0x2f')](_[_0xb2bc('0x49')](_0x21f2dc[_0xb2bc('0x2e')],_0x4f56d0['filters']));if(_0x21f2dc['query'][_0xb2bc('0x39')]){_0x221556[_0xb2bc('0x36')]=_[_0xb2bc('0x37')](_0x221556['where'],{'$or':_['map'](_0x221556[_0xb2bc('0x31')],function(_0x34d179){var _0x31eb22={};_0x31eb22[_0x34d179]={'$like':'%'+_0x21f2dc[_0xb2bc('0x2e')][_0xb2bc('0x39')]+'%'};return _0x31eb22;})});}_0x221556=_['merge']({},_0x221556,_0x21f2dc[_0xb2bc('0x3a')]);return _0x413836['getFields'](_0x221556);}})['then'](function(_0x475ab8){if(_0x475ab8){_0x52b8fa=_0x475ab8[_0xb2bc('0x33')];if(!_0x21f2dc['query'][_0xb2bc('0x4a')]('nolimit')){_0x221556[_0xb2bc('0x1d')]=qs[_0xb2bc('0x1d')](_0x21f2dc[_0xb2bc('0x2e')][_0xb2bc('0x1d')]);_0x221556[_0xb2bc('0x1b')]=qs[_0xb2bc('0x1b')](_0x21f2dc['query'][_0xb2bc('0x1b')]);}return _0x413836['getFields'](_0x221556);}})[_0xb2bc('0x24')](function(_0x483c9e){if(_0x483c9e){return _0x483c9e?{'count':_0x52b8fa,'rows':_0x483c9e}:null;}})[_0xb2bc('0x24')](respondWithResult(_0x52ac31,null))[_0xb2bc('0x43')](handleError(_0x52ac31,null));};exports['getSubjects']=function(_0x45c2fc,_0x30e02f,_0x1d18c9){var _0x178757={};var _0x4b9364={};var _0x467c1b;var _0x5f2c2f;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x45c2fc[_0xb2bc('0x40')]['id']}})[_0xb2bc('0x24')](handleEntityNotFound(_0x30e02f,null))[_0xb2bc('0x24')](function(_0x483371){if(_0x483371){_0x467c1b=_0x483371;_0x4b9364[_0xb2bc('0x2c')]=_['keys'](db[_0xb2bc('0x4b')][_0xb2bc('0x28')]);_0x4b9364[_0xb2bc('0x2e')]=_[_0xb2bc('0x41')](_0x45c2fc[_0xb2bc('0x2e')]);_0x4b9364[_0xb2bc('0x2f')]=_[_0xb2bc('0x30')](_0x4b9364['model'],_0x4b9364[_0xb2bc('0x2e')]);_0x178757[_0xb2bc('0x31')]=_[_0xb2bc('0x30')](_0x4b9364[_0xb2bc('0x2c')],qs[_0xb2bc('0x32')](_0x45c2fc[_0xb2bc('0x2e')]['fields']));_0x178757[_0xb2bc('0x31')]=_0x178757[_0xb2bc('0x31')][_0xb2bc('0x33')]?_0x178757[_0xb2bc('0x31')]:_0x4b9364[_0xb2bc('0x2c')];_0x178757['order']=qs[_0xb2bc('0x35')](_0x45c2fc[_0xb2bc('0x2e')][_0xb2bc('0x35')]);_0x178757[_0xb2bc('0x36')]=qs['filters'](_[_0xb2bc('0x49')](_0x45c2fc[_0xb2bc('0x2e')],_0x4b9364[_0xb2bc('0x2f')]));if(_0x45c2fc[_0xb2bc('0x2e')][_0xb2bc('0x39')]){_0x178757['where']=_[_0xb2bc('0x37')](_0x178757[_0xb2bc('0x36')],{'$or':_[_0xb2bc('0x2d')](_0x178757['attributes'],function(_0x71a06){var _0x1df42f={};_0x1df42f[_0x71a06]={'$like':'%'+_0x45c2fc[_0xb2bc('0x2e')][_0xb2bc('0x39')]+'%'};return _0x1df42f;})});}_0x178757=_['merge']({},_0x178757,_0x45c2fc[_0xb2bc('0x3a')]);return _0x467c1b[_0xb2bc('0x4c')](_0x178757);}})[_0xb2bc('0x24')](function(_0x3295bb){if(_0x3295bb){_0x5f2c2f=_0x3295bb[_0xb2bc('0x33')];if(!_0x45c2fc[_0xb2bc('0x2e')][_0xb2bc('0x4a')](_0xb2bc('0x34'))){_0x178757[_0xb2bc('0x1d')]=qs[_0xb2bc('0x1d')](_0x45c2fc[_0xb2bc('0x2e')]['limit']);_0x178757[_0xb2bc('0x1b')]=qs[_0xb2bc('0x1b')](_0x45c2fc[_0xb2bc('0x2e')][_0xb2bc('0x1b')]);}return _0x467c1b[_0xb2bc('0x4c')](_0x178757);}})[_0xb2bc('0x24')](function(_0x55d542){if(_0x55d542){return _0x55d542?{'count':_0x5f2c2f,'rows':_0x55d542}:null;}})[_0xb2bc('0x24')](respondWithResult(_0x30e02f,null))['catch'](handleError(_0x30e02f,null));};exports[_0xb2bc('0x4d')]=function(_0x11867a,_0x117516,_0x41dda3){var _0x1e4634={};var _0x3e83f1={};var _0x471873;var _0x581e72;return db[_0xb2bc('0x3b')][_0xb2bc('0x47')]({'where':{'id':_0x11867a[_0xb2bc('0x40')]['id']}})[_0xb2bc('0x24')](handleEntityNotFound(_0x117516,null))[_0xb2bc('0x24')](function(_0x39bcd8){if(_0x39bcd8){_0x471873=_0x39bcd8;_0x3e83f1[_0xb2bc('0x2c')]=_[_0xb2bc('0x41')](db['ServicenowField'][_0xb2bc('0x28')]);_0x3e83f1[_0xb2bc('0x2e')]=_['keys'](_0x11867a['query']);_0x3e83f1[_0xb2bc('0x2f')]=_[_0xb2bc('0x30')](_0x3e83f1['model'],_0x3e83f1[_0xb2bc('0x2e')]);_0x1e4634[_0xb2bc('0x31')]=_['intersection'](_0x3e83f1[_0xb2bc('0x2c')],qs[_0xb2bc('0x32')](_0x11867a[_0xb2bc('0x2e')][_0xb2bc('0x32')]));_0x1e4634[_0xb2bc('0x31')]=_0x1e4634[_0xb2bc('0x31')][_0xb2bc('0x33')]?_0x1e4634[_0xb2bc('0x31')]:_0x3e83f1[_0xb2bc('0x2c')];_0x1e4634[_0xb2bc('0x48')]=qs[_0xb2bc('0x35')](_0x11867a[_0xb2bc('0x2e')][_0xb2bc('0x35')]);_0x1e4634[_0xb2bc('0x36')]=qs[_0xb2bc('0x2f')](_[_0xb2bc('0x49')](_0x11867a['query'],_0x3e83f1[_0xb2bc('0x2f')]));if(_0x11867a[_0xb2bc('0x2e')][_0xb2bc('0x39')]){_0x1e4634[_0xb2bc('0x36')]=_[_0xb2bc('0x37')](_0x1e4634['where'],{'$or':_[_0xb2bc('0x2d')](_0x1e4634[_0xb2bc('0x31')],function(_0x459a50){var _0xd53741={};_0xd53741[_0x459a50]={'$like':'%'+_0x11867a['query'][_0xb2bc('0x39')]+'%'};return _0xd53741;})});}_0x1e4634=_[_0xb2bc('0x37')]({},_0x1e4634,_0x11867a[_0xb2bc('0x3a')]);return _0x471873['getDescriptions'](_0x1e4634);}})[_0xb2bc('0x24')](function(_0x59a4dd){if(_0x59a4dd){_0x581e72=_0x59a4dd[_0xb2bc('0x33')];if(!_0x11867a[_0xb2bc('0x2e')][_0xb2bc('0x4a')](_0xb2bc('0x34'))){_0x1e4634[_0xb2bc('0x1d')]=qs['limit'](_0x11867a[_0xb2bc('0x2e')]['limit']);_0x1e4634[_0xb2bc('0x1b')]=qs['offset'](_0x11867a[_0xb2bc('0x2e')][_0xb2bc('0x1b')]);}return _0x471873[_0xb2bc('0x4d')](_0x1e4634);}})['then'](function(_0x1728ec){if(_0x1728ec){return _0x1728ec?{'count':_0x581e72,'rows':_0x1728ec}:null;}})[_0xb2bc('0x24')](respondWithResult(_0x117516,null))[_0xb2bc('0x43')](handleError(_0x117516,null));}; \ No newline at end of file +var _0x4b95=['fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','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','apply','reject','update','then','destroy','error','stack','name','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4b95,0x1d7));var _0x54b9=function(_0x126acb,_0x55ddec){_0x126acb=_0x126acb-0x0;var _0x58853a=_0x4b95[_0x126acb];return _0x58853a;};'use strict';var emlformat=require(_0x54b9('0x0'));var rimraf=require(_0x54b9('0x1'));var zipdir=require(_0x54b9('0x2'));var jsonpatch=require(_0x54b9('0x3'));var rp=require('request-promise');var moment=require(_0x54b9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x54b9('0x5'));var util=require(_0x54b9('0x6'));var path=require(_0x54b9('0x7'));var sox=require(_0x54b9('0x8'));var csv=require(_0x54b9('0x9'));var ejs=require(_0x54b9('0xa'));var fs=require('fs');var fs_extra=require(_0x54b9('0xb'));var _=require(_0x54b9('0xc'));var squel=require('squel');var crypto=require(_0x54b9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x54b9('0xe'));var toCsv=require(_0x54b9('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x54b9('0xf'));var authService=require(_0x54b9('0x10'));var qs=require(_0x54b9('0x11'));var as=require(_0x54b9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x54b9('0x13'))(_0x54b9('0x14'));var utils=require(_0x54b9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x54b9('0x16'));var db=require(_0x54b9('0x17'))['db'];function respondWithStatusCode(_0x2c3bbe,_0x3e4879){_0x3e4879=_0x3e4879||0xcc;return function(_0x9536eb){if(_0x9536eb){return _0x2c3bbe[_0x54b9('0x18')](_0x3e4879);}return _0x2c3bbe[_0x54b9('0x19')](_0x3e4879)[_0x54b9('0x1a')]();};}function respondWithResult(_0x296e95,_0x360a37){_0x360a37=_0x360a37||0xc8;return function(_0x4cef34){if(_0x4cef34){return _0x296e95[_0x54b9('0x19')](_0x360a37)['json'](_0x4cef34);}};}function respondWithFilteredResult(_0x1e662a,_0xd99640){return function(_0x2661c8){if(_0x2661c8){var _0x31f170=typeof _0xd99640[_0x54b9('0x1b')]===_0x54b9('0x1c')&&typeof _0xd99640[_0x54b9('0x1d')]==='undefined';var _0x27e18e=_0x2661c8[_0x54b9('0x1e')];var _0x31b9b2=_0x31f170?0x0:_0xd99640['offset'];var _0x1c06de=_0x31f170?_0x2661c8['count']:_0xd99640[_0x54b9('0x1b')]+_0xd99640['limit'];var _0xdca890;if(_0x1c06de>=_0x27e18e){_0x1c06de=_0x27e18e;_0xdca890=0xc8;}else{_0xdca890=0xce;}_0x1e662a[_0x54b9('0x19')](_0xdca890);return _0x1e662a[_0x54b9('0x1f')]('Content-Range',_0x31b9b2+'-'+_0x1c06de+'/'+_0x27e18e)['json'](_0x2661c8);}return null;};}function patchUpdates(_0x8f1415){return function(_0x3c447b){try{jsonpatch[_0x54b9('0x20')](_0x3c447b,_0x8f1415,!![]);}catch(_0xa5d4f0){return BPromise[_0x54b9('0x21')](_0xa5d4f0);}return _0x3c447b['save']();};}function saveUpdates(_0x280526,_0x44792f){return function(_0x65f427){if(_0x65f427){return _0x65f427[_0x54b9('0x22')](_0x280526)[_0x54b9('0x23')](function(_0x9f8746){return _0x9f8746;});}return null;};}function removeEntity(_0x13d8a3,_0x535b6a){return function(_0xac10d7){if(_0xac10d7){return _0xac10d7[_0x54b9('0x24')]()[_0x54b9('0x23')](function(){_0x13d8a3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31c655,_0x38b160){return function(_0x45aae8){if(!_0x45aae8){_0x31c655[_0x54b9('0x18')](0x194);}return _0x45aae8;};}function handleError(_0x1ae8b8,_0x78fba8){_0x78fba8=_0x78fba8||0x1f4;return function(_0x2138a1){logger[_0x54b9('0x25')](_0x2138a1[_0x54b9('0x26')]);if(_0x2138a1[_0x54b9('0x27')]){delete _0x2138a1[_0x54b9('0x27')];}_0x1ae8b8[_0x54b9('0x19')](_0x78fba8)['send'](_0x2138a1);};}exports[_0x54b9('0x28')]=function(_0x4c8bfd,_0x3bfff6){var _0x27b6f6={},_0x530aa0={},_0x703931={'count':0x0,'rows':[]};var _0x10e48a=_['map'](db[_0x54b9('0x29')][_0x54b9('0x2a')],function(_0x21c41d){return{'name':_0x21c41d[_0x54b9('0x2b')],'type':_0x21c41d[_0x54b9('0x2c')][_0x54b9('0x2d')]};});_0x530aa0[_0x54b9('0x2e')]=_[_0x54b9('0x2f')](_0x10e48a,'name');_0x530aa0['query']=_[_0x54b9('0x30')](_0x4c8bfd[_0x54b9('0x31')]);_0x530aa0[_0x54b9('0x32')]=_[_0x54b9('0x33')](_0x530aa0[_0x54b9('0x2e')],_0x530aa0[_0x54b9('0x31')]);_0x27b6f6['attributes']=_['intersection'](_0x530aa0['model'],qs['fields'](_0x4c8bfd[_0x54b9('0x31')][_0x54b9('0x34')]));_0x27b6f6[_0x54b9('0x35')]=_0x27b6f6['attributes'][_0x54b9('0x36')]?_0x27b6f6[_0x54b9('0x35')]:_0x530aa0[_0x54b9('0x2e')];if(!_0x4c8bfd[_0x54b9('0x31')][_0x54b9('0x37')](_0x54b9('0x38'))){_0x27b6f6[_0x54b9('0x1d')]=qs[_0x54b9('0x1d')](_0x4c8bfd[_0x54b9('0x31')][_0x54b9('0x1d')]);_0x27b6f6['offset']=qs['offset'](_0x4c8bfd['query'][_0x54b9('0x1b')]);}_0x27b6f6[_0x54b9('0x39')]=qs[_0x54b9('0x3a')](_0x4c8bfd['query'][_0x54b9('0x3a')]);_0x27b6f6[_0x54b9('0x3b')]=qs['filters'](_[_0x54b9('0x3c')](_0x4c8bfd[_0x54b9('0x31')],_0x530aa0[_0x54b9('0x32')]),_0x10e48a);if(_0x4c8bfd[_0x54b9('0x31')][_0x54b9('0x3d')]){_0x27b6f6['where']=_[_0x54b9('0x3e')](_0x27b6f6[_0x54b9('0x3b')],{'$or':_['map'](_0x10e48a,function(_0x42cc0a){if(_0x42cc0a[_0x54b9('0x2c')]!==_0x54b9('0x3f')){var _0x2648d3={};_0x2648d3[_0x42cc0a[_0x54b9('0x27')]]={'$like':'%'+_0x4c8bfd['query'][_0x54b9('0x3d')]+'%'};return _0x2648d3;}})});}_0x27b6f6=_[_0x54b9('0x3e')]({},_0x27b6f6,_0x4c8bfd[_0x54b9('0x40')]);var _0x322f40={'where':_0x27b6f6['where']};return db[_0x54b9('0x29')][_0x54b9('0x1e')](_0x322f40)[_0x54b9('0x23')](function(_0x27a73b){_0x703931['count']=_0x27a73b;if(_0x4c8bfd[_0x54b9('0x31')][_0x54b9('0x41')]){_0x27b6f6['include']=[{'all':!![]}];}return db[_0x54b9('0x29')][_0x54b9('0x42')](_0x27b6f6);})['then'](function(_0x35fdb5){_0x703931[_0x54b9('0x43')]=_0x35fdb5;return _0x703931;})[_0x54b9('0x23')](respondWithFilteredResult(_0x3bfff6,_0x27b6f6))[_0x54b9('0x44')](handleError(_0x3bfff6,null));};exports['show']=function(_0x5de9a3,_0x3809f0){var _0x1c6116={'raw':![],'where':{'id':_0x5de9a3[_0x54b9('0x45')]['id']}},_0x2c90de={};_0x2c90de[_0x54b9('0x2e')]=_[_0x54b9('0x30')](db['ServicenowConfiguration'][_0x54b9('0x2a')]);_0x2c90de['query']=_[_0x54b9('0x30')](_0x5de9a3[_0x54b9('0x31')]);_0x2c90de['filters']=_[_0x54b9('0x33')](_0x2c90de[_0x54b9('0x2e')],_0x2c90de[_0x54b9('0x31')]);_0x1c6116[_0x54b9('0x35')]=_[_0x54b9('0x33')](_0x2c90de['model'],qs[_0x54b9('0x34')](_0x5de9a3['query'][_0x54b9('0x34')]));_0x1c6116[_0x54b9('0x35')]=_0x1c6116[_0x54b9('0x35')]['length']?_0x1c6116[_0x54b9('0x35')]:_0x2c90de[_0x54b9('0x2e')];if(_0x5de9a3[_0x54b9('0x31')][_0x54b9('0x41')]){_0x1c6116[_0x54b9('0x46')]=[{'all':!![]}];}_0x1c6116=_[_0x54b9('0x3e')]({},_0x1c6116,_0x5de9a3['options']);return db[_0x54b9('0x29')][_0x54b9('0x47')](_0x1c6116)[_0x54b9('0x23')](handleEntityNotFound(_0x3809f0,null))['then'](respondWithResult(_0x3809f0,null))[_0x54b9('0x44')](handleError(_0x3809f0,null));};exports[_0x54b9('0x48')]=function(_0x123977,_0xef6c9e){return db[_0x54b9('0x29')][_0x54b9('0x48')](_0x123977[_0x54b9('0x49')],{})['then'](respondWithResult(_0xef6c9e,0xc9))[_0x54b9('0x44')](handleError(_0xef6c9e,null));};exports[_0x54b9('0x22')]=function(_0x2d79a0,_0x2c78a1){if(_0x2d79a0[_0x54b9('0x49')]['id']){delete _0x2d79a0['body']['id'];}return db['ServicenowConfiguration'][_0x54b9('0x47')]({'where':{'id':_0x2d79a0[_0x54b9('0x45')]['id']}})[_0x54b9('0x23')](handleEntityNotFound(_0x2c78a1,null))['then'](saveUpdates(_0x2d79a0[_0x54b9('0x49')],null))[_0x54b9('0x23')](respondWithResult(_0x2c78a1,null))[_0x54b9('0x44')](handleError(_0x2c78a1,null));};exports['destroy']=function(_0x1bf730,_0x2b8ada){return db[_0x54b9('0x29')]['find']({'where':{'id':_0x1bf730[_0x54b9('0x45')]['id']}})['then'](handleEntityNotFound(_0x2b8ada,null))[_0x54b9('0x23')](removeEntity(_0x2b8ada,null))[_0x54b9('0x44')](handleError(_0x2b8ada,null));};exports[_0x54b9('0x4a')]=function(_0x2eaa75,_0x19399d,_0x5622e3){var _0x5e491f={};var _0x35a2b8={};var _0x5ae1b0;var _0x156f97;return db[_0x54b9('0x29')][_0x54b9('0x4b')]({'where':{'id':_0x2eaa75[_0x54b9('0x45')]['id']}})[_0x54b9('0x23')](handleEntityNotFound(_0x19399d,null))[_0x54b9('0x23')](function(_0x248d44){if(_0x248d44){_0x5ae1b0=_0x248d44;_0x35a2b8[_0x54b9('0x2e')]=_[_0x54b9('0x30')](db[_0x54b9('0x4c')][_0x54b9('0x2a')]);_0x35a2b8[_0x54b9('0x31')]=_[_0x54b9('0x30')](_0x2eaa75[_0x54b9('0x31')]);_0x35a2b8['filters']=_['intersection'](_0x35a2b8[_0x54b9('0x2e')],_0x35a2b8[_0x54b9('0x31')]);_0x5e491f[_0x54b9('0x35')]=_[_0x54b9('0x33')](_0x35a2b8[_0x54b9('0x2e')],qs[_0x54b9('0x34')](_0x2eaa75[_0x54b9('0x31')][_0x54b9('0x34')]));_0x5e491f['attributes']=_0x5e491f['attributes'][_0x54b9('0x36')]?_0x5e491f[_0x54b9('0x35')]:_0x35a2b8['model'];_0x5e491f[_0x54b9('0x39')]=qs[_0x54b9('0x3a')](_0x2eaa75[_0x54b9('0x31')][_0x54b9('0x3a')]);_0x5e491f[_0x54b9('0x3b')]=qs['filters'](_[_0x54b9('0x3c')](_0x2eaa75[_0x54b9('0x31')],_0x35a2b8[_0x54b9('0x32')]));if(_0x2eaa75['query']['filter']){_0x5e491f['where']=_[_0x54b9('0x3e')](_0x5e491f['where'],{'$or':_[_0x54b9('0x2f')](_0x5e491f['attributes'],function(_0x2332b5){var _0x238f91={};_0x238f91[_0x2332b5]={'$like':'%'+_0x2eaa75[_0x54b9('0x31')][_0x54b9('0x3d')]+'%'};return _0x238f91;})});}_0x5e491f=_[_0x54b9('0x3e')]({},_0x5e491f,_0x2eaa75[_0x54b9('0x40')]);return _0x5ae1b0['getFields'](_0x5e491f);}})[_0x54b9('0x23')](function(_0x570f6a){if(_0x570f6a){_0x156f97=_0x570f6a[_0x54b9('0x36')];if(!_0x2eaa75['query']['hasOwnProperty'](_0x54b9('0x38'))){_0x5e491f[_0x54b9('0x1d')]=qs['limit'](_0x2eaa75[_0x54b9('0x31')][_0x54b9('0x1d')]);_0x5e491f[_0x54b9('0x1b')]=qs[_0x54b9('0x1b')](_0x2eaa75[_0x54b9('0x31')][_0x54b9('0x1b')]);}return _0x5ae1b0[_0x54b9('0x4a')](_0x5e491f);}})[_0x54b9('0x23')](function(_0x4167a0){if(_0x4167a0){return _0x4167a0?{'count':_0x156f97,'rows':_0x4167a0}:null;}})[_0x54b9('0x23')](respondWithResult(_0x19399d,null))[_0x54b9('0x44')](handleError(_0x19399d,null));};exports[_0x54b9('0x4d')]=function(_0x1f208c,_0x27af9d,_0xba85a2){var _0x5501d0={};var _0x1a7631={};var _0x2baaf4;var _0x484b99;return db[_0x54b9('0x29')][_0x54b9('0x4b')]({'where':{'id':_0x1f208c[_0x54b9('0x45')]['id']}})[_0x54b9('0x23')](handleEntityNotFound(_0x27af9d,null))[_0x54b9('0x23')](function(_0x3b8719){if(_0x3b8719){_0x2baaf4=_0x3b8719;_0x1a7631['model']=_['keys'](db[_0x54b9('0x4c')]['rawAttributes']);_0x1a7631[_0x54b9('0x31')]=_[_0x54b9('0x30')](_0x1f208c[_0x54b9('0x31')]);_0x1a7631[_0x54b9('0x32')]=_[_0x54b9('0x33')](_0x1a7631[_0x54b9('0x2e')],_0x1a7631[_0x54b9('0x31')]);_0x5501d0[_0x54b9('0x35')]=_[_0x54b9('0x33')](_0x1a7631['model'],qs['fields'](_0x1f208c[_0x54b9('0x31')][_0x54b9('0x34')]));_0x5501d0['attributes']=_0x5501d0['attributes']['length']?_0x5501d0['attributes']:_0x1a7631[_0x54b9('0x2e')];_0x5501d0[_0x54b9('0x39')]=qs[_0x54b9('0x3a')](_0x1f208c[_0x54b9('0x31')][_0x54b9('0x3a')]);_0x5501d0[_0x54b9('0x3b')]=qs[_0x54b9('0x32')](_['pick'](_0x1f208c[_0x54b9('0x31')],_0x1a7631[_0x54b9('0x32')]));if(_0x1f208c['query'][_0x54b9('0x3d')]){_0x5501d0[_0x54b9('0x3b')]=_[_0x54b9('0x3e')](_0x5501d0[_0x54b9('0x3b')],{'$or':_[_0x54b9('0x2f')](_0x5501d0[_0x54b9('0x35')],function(_0x2c938e){var _0x59b9d4={};_0x59b9d4[_0x2c938e]={'$like':'%'+_0x1f208c['query'][_0x54b9('0x3d')]+'%'};return _0x59b9d4;})});}_0x5501d0=_['merge']({},_0x5501d0,_0x1f208c[_0x54b9('0x40')]);return _0x2baaf4[_0x54b9('0x4d')](_0x5501d0);}})[_0x54b9('0x23')](function(_0x281305){if(_0x281305){_0x484b99=_0x281305['length'];if(!_0x1f208c[_0x54b9('0x31')][_0x54b9('0x37')](_0x54b9('0x38'))){_0x5501d0['limit']=qs[_0x54b9('0x1d')](_0x1f208c[_0x54b9('0x31')][_0x54b9('0x1d')]);_0x5501d0[_0x54b9('0x1b')]=qs['offset'](_0x1f208c[_0x54b9('0x31')][_0x54b9('0x1b')]);}return _0x2baaf4[_0x54b9('0x4d')](_0x5501d0);}})['then'](function(_0x43c2a2){if(_0x43c2a2){return _0x43c2a2?{'count':_0x484b99,'rows':_0x43c2a2}:null;}})[_0x54b9('0x23')](respondWithResult(_0x27af9d,null))[_0x54b9('0x44')](handleError(_0x27af9d,null));};exports[_0x54b9('0x4e')]=function(_0x310877,_0x516386,_0x5b93bd){var _0x4d1c2e={};var _0xc44eff={};var _0x5e75eb;var _0x3635d2;return db['ServicenowConfiguration'][_0x54b9('0x4b')]({'where':{'id':_0x310877[_0x54b9('0x45')]['id']}})[_0x54b9('0x23')](handleEntityNotFound(_0x516386,null))[_0x54b9('0x23')](function(_0x188a0c){if(_0x188a0c){_0x5e75eb=_0x188a0c;_0xc44eff['model']=_[_0x54b9('0x30')](db[_0x54b9('0x4c')][_0x54b9('0x2a')]);_0xc44eff[_0x54b9('0x31')]=_[_0x54b9('0x30')](_0x310877[_0x54b9('0x31')]);_0xc44eff[_0x54b9('0x32')]=_[_0x54b9('0x33')](_0xc44eff['model'],_0xc44eff[_0x54b9('0x31')]);_0x4d1c2e['attributes']=_[_0x54b9('0x33')](_0xc44eff['model'],qs[_0x54b9('0x34')](_0x310877[_0x54b9('0x31')][_0x54b9('0x34')]));_0x4d1c2e['attributes']=_0x4d1c2e[_0x54b9('0x35')][_0x54b9('0x36')]?_0x4d1c2e[_0x54b9('0x35')]:_0xc44eff['model'];_0x4d1c2e[_0x54b9('0x39')]=qs['sort'](_0x310877[_0x54b9('0x31')]['sort']);_0x4d1c2e[_0x54b9('0x3b')]=qs[_0x54b9('0x32')](_[_0x54b9('0x3c')](_0x310877[_0x54b9('0x31')],_0xc44eff[_0x54b9('0x32')]));if(_0x310877[_0x54b9('0x31')]['filter']){_0x4d1c2e[_0x54b9('0x3b')]=_[_0x54b9('0x3e')](_0x4d1c2e[_0x54b9('0x3b')],{'$or':_[_0x54b9('0x2f')](_0x4d1c2e['attributes'],function(_0x2c384f){var _0x4095c1={};_0x4095c1[_0x2c384f]={'$like':'%'+_0x310877[_0x54b9('0x31')][_0x54b9('0x3d')]+'%'};return _0x4095c1;})});}_0x4d1c2e=_[_0x54b9('0x3e')]({},_0x4d1c2e,_0x310877[_0x54b9('0x40')]);return _0x5e75eb[_0x54b9('0x4e')](_0x4d1c2e);}})['then'](function(_0x338791){if(_0x338791){_0x3635d2=_0x338791[_0x54b9('0x36')];if(!_0x310877['query'][_0x54b9('0x37')](_0x54b9('0x38'))){_0x4d1c2e[_0x54b9('0x1d')]=qs['limit'](_0x310877['query'][_0x54b9('0x1d')]);_0x4d1c2e['offset']=qs[_0x54b9('0x1b')](_0x310877[_0x54b9('0x31')][_0x54b9('0x1b')]);}return _0x5e75eb[_0x54b9('0x4e')](_0x4d1c2e);}})[_0x54b9('0x23')](function(_0x40191c){if(_0x40191c){return _0x40191c?{'count':_0x3635d2,'rows':_0x40191c}:null;}})[_0x54b9('0x23')](respondWithResult(_0x516386,null))[_0x54b9('0x44')](handleError(_0x516386,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index e0f9cf6..eaff38f 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e6b=['path','rimraf','../../config/environment','exports','ServicenowConfiguration','lodash','util','api','request-promise'];(function(_0x2e3dfc,_0x454d6c){var _0x4b1245=function(_0x5e9faa){while(--_0x5e9faa){_0x2e3dfc['push'](_0x2e3dfc['shift']());}};_0x4b1245(++_0x454d6c);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9e6b[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xb9e6('0x0'));var util=require(_0xb9e6('0x1'));var logger=require('../../config/logger')(_0xb9e6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb9e6('0x3'));var fs=require('fs');var path=require(_0xb9e6('0x4'));var rimraf=require(_0xb9e6('0x5'));var config=require(_0xb9e6('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xb9e6('0x7')]=function(_0x1a6a4f,_0x1b9eed){return _0x1a6a4f['define'](_0xb9e6('0x8'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf151=['path','rimraf','../../config/environment','exports','ServicenowConfiguration','int_servicenow_configurations','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x563123,_0x353b99){var _0x5e77c2=function(_0x23decb){while(--_0x23decb){_0x563123['push'](_0x563123['shift']());}};_0x5e77c2(++_0x353b99);}(_0xf151,0xab));var _0x1f15=function(_0x190b95,_0x1132e2){_0x190b95=_0x190b95-0x0;var _0x246c2c=_0xf151[_0x190b95];return _0x246c2c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1f15('0x0'))(_0x1f15('0x1'));var moment=require(_0x1f15('0x2'));var BPromise=require(_0x1f15('0x3'));var rp=require(_0x1f15('0x4'));var fs=require('fs');var path=require(_0x1f15('0x5'));var rimraf=require(_0x1f15('0x6'));var config=require(_0x1f15('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x1f15('0x8')]=function(_0x5548bb,_0x4cfc7b){return _0x5548bb['define'](_0x1f15('0x9'),attributes,{'tableName':_0x1f15('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index d755ab8..77815a2 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd21f=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','ServicenowConfiguration,\x20%s,\x20%s','result'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0xd21f,0xf7));var _0xfd21=function(_0x44cd28,_0x1502d9){_0x44cd28=_0x44cd28-0x0;var _0x39356e=_0xd21f[_0x44cd28];return _0x39356e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfd21('0x0'));var BPromise=require(_0xfd21('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd21('0x2'));var db=require(_0xfd21('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd21('0x4'))(_0xfd21('0x5'));var config=require(_0xfd21('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfd21('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1507f1,_0x14b496,_0x23fc92){return new BPromise(function(_0x54088d,_0x22668a){return client[_0xfd21('0x8')](_0x1507f1,_0x23fc92)[_0xfd21('0x9')](function(_0x1e989c){logger[_0xfd21('0xa')]('ServicenowConfiguration,\x20%s,\x20%s',_0x14b496,_0xfd21('0xb'));logger[_0xfd21('0xc')](_0xfd21('0xd'),_0x14b496,_0xfd21('0xb'),JSON[_0xfd21('0xe')](_0x1e989c));if(_0x1e989c[_0xfd21('0xf')]){if(_0x1e989c[_0xfd21('0xf')]['code']===0x1f4){logger[_0xfd21('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x14b496,_0x1e989c[_0xfd21('0xf')]['message']);return _0x22668a(_0x1e989c['error']['message']);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x14b496,_0x1e989c[_0xfd21('0xf')][_0xfd21('0x10')]);return _0x54088d(_0x1e989c['error'][_0xfd21('0x10')]);}else{logger['info'](_0xfd21('0x11'),_0x14b496,'request\x20sent');_0x54088d(_0x1e989c[_0xfd21('0x12')]['message']);}})['catch'](function(_0x2a4362){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x14b496,_0x2a4362);_0x22668a(_0x2a4362);});});} \ No newline at end of file +var _0xb835=['debug','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','ServicenowConfiguration,\x20%s,\x20%s'];(function(_0x492c3f,_0x255ab4){var _0x3d4e2a=function(_0x234140){while(--_0x234140){_0x492c3f['push'](_0x492c3f['shift']());}};_0x3d4e2a(++_0x255ab4);}(_0xb835,0xcd));var _0x5b83=function(_0x59b626,_0x31f800){_0x59b626=_0x59b626-0x0;var _0x209ec8=_0xb835[_0x59b626];return _0x209ec8;};'use strict';var _=require(_0x5b83('0x0'));var util=require(_0x5b83('0x1'));var moment=require(_0x5b83('0x2'));var BPromise=require(_0x5b83('0x3'));var rs=require(_0x5b83('0x4'));var fs=require('fs');var Redis=require(_0x5b83('0x5'));var db=require(_0x5b83('0x6'))['db'];var utils=require(_0x5b83('0x7'));var logger=require(_0x5b83('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5b83('0x9'));var client=jayson[_0x5b83('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42119b,_0x16bb29,_0x50ff39){return new BPromise(function(_0x4eaa74,_0xcf842b){return client[_0x5b83('0xb')](_0x42119b,_0x50ff39)[_0x5b83('0xc')](function(_0x333220){logger[_0x5b83('0xd')](_0x5b83('0xe'),_0x16bb29,'request\x20sent');logger[_0x5b83('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x16bb29,_0x5b83('0x10'),JSON[_0x5b83('0x11')](_0x333220));if(_0x333220['error']){if(_0x333220[_0x5b83('0x12')][_0x5b83('0x13')]===0x1f4){logger[_0x5b83('0x12')](_0x5b83('0xe'),_0x16bb29,_0x333220[_0x5b83('0x12')][_0x5b83('0x14')]);return _0xcf842b(_0x333220['error'][_0x5b83('0x14')]);}logger[_0x5b83('0x12')](_0x5b83('0xe'),_0x16bb29,_0x333220[_0x5b83('0x12')][_0x5b83('0x14')]);return _0x4eaa74(_0x333220[_0x5b83('0x12')][_0x5b83('0x14')]);}else{logger[_0x5b83('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x16bb29,_0x5b83('0x10'));_0x4eaa74(_0x333220[_0x5b83('0x15')][_0x5b83('0x14')]);}})['catch'](function(_0x4efbe0){logger[_0x5b83('0x12')](_0x5b83('0xe'),_0x16bb29,_0x4efbe0);_0xcf842b(_0x4efbe0);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index db97c32..75fdb4f 100644 --- a/server/api/intServicenowField/index.js +++ b/server/api/intServicenowField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6363=['delete','destroy','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','index','get','/:id','isAuthenticated','show','create'];(function(_0x20fc62,_0x12c41b){var _0x81b57d=function(_0x200912){while(--_0x200912){_0x20fc62['push'](_0x20fc62['shift']());}};_0x81b57d(++_0x12c41b);}(_0x6363,0x1d2));var _0x3636=function(_0x1f3794,_0x560bb8){_0x1f3794=_0x1f3794-0x0;var _0xf4cea5=_0x6363[_0x1f3794];return _0xf4cea5;};'use strict';var multer=require(_0x3636('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3636('0x1'));var express=require(_0x3636('0x2'));var router=express['Router']();var fs_extra=require(_0x3636('0x3'));var auth=require(_0x3636('0x4'));var interaction=require(_0x3636('0x5'));var config=require(_0x3636('0x6'));var controller=require(_0x3636('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3636('0x8')]);router[_0x3636('0x9')](_0x3636('0xa'),auth[_0x3636('0xb')](),controller[_0x3636('0xc')]);router['post']('/',auth[_0x3636('0xb')](),controller[_0x3636('0xd')]);router['put']('/:id',auth[_0x3636('0xb')](),controller['update']);router[_0x3636('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x3636('0xf')]);module['exports']=router; \ No newline at end of file +var _0x67cf=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x38efe1,_0x34a883){var _0x44c9fb=function(_0x3cbfea){while(--_0x3cbfea){_0x38efe1['push'](_0x38efe1['shift']());}};_0x44c9fb(++_0x34a883);}(_0x67cf,0x6d));var _0xf67c=function(_0x2d7a4b,_0xa36b04){_0x2d7a4b=_0x2d7a4b-0x0;var _0x603707=_0x67cf[_0x2d7a4b];return _0x603707;};'use strict';var multer=require(_0xf67c('0x0'));var util=require(_0xf67c('0x1'));var path=require(_0xf67c('0x2'));var timeout=require(_0xf67c('0x3'));var express=require(_0xf67c('0x4'));var router=express[_0xf67c('0x5')]();var fs_extra=require(_0xf67c('0x6'));var auth=require(_0xf67c('0x7'));var interaction=require(_0xf67c('0x8'));var config=require(_0xf67c('0x9'));var controller=require(_0xf67c('0xa'));router[_0xf67c('0xb')]('/',auth[_0xf67c('0xc')](),controller[_0xf67c('0xd')]);router[_0xf67c('0xb')](_0xf67c('0xe'),auth[_0xf67c('0xc')](),controller[_0xf67c('0xf')]);router[_0xf67c('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf67c('0x11')]('/:id',auth[_0xf67c('0xc')](),controller[_0xf67c('0x12')]);router['delete'](_0xf67c('0xe'),auth[_0xf67c('0xc')](),controller[_0xf67c('0x13')]);module[_0xf67c('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 3e249d3..8d6c214 100644 --- a/server/api/intServicenowField/intServicenowField.attributes.js +++ b/server/api/intServicenowField/intServicenowField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x617a=['BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','picklist','STRING','string'];(function(_0x207b53,_0x4e02dc){var _0x4519db=function(_0x6f9552){while(--_0x6f9552){_0x207b53['push'](_0x207b53['shift']());}};_0x4519db(++_0x4e02dc);}(_0x617a,0x184));var _0xa617=function(_0x36b0d7,_0x3044c7){_0x36b0d7=_0x36b0d7-0x0;var _0x3ec0c9=_0x617a[_0x36b0d7];return _0x3ec0c9;};'use strict';var Sequelize=require(_0xa617('0x0'));module['exports']={'type':{'type':Sequelize[_0xa617('0x1')]('string',_0xa617('0x2'),_0xa617('0x3'),_0xa617('0x4'),_0xa617('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa617('0x6')]},'keyType':{'type':Sequelize[_0xa617('0x1')](_0xa617('0x7'),'variable',_0xa617('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa617('0x6')]},'nameField':{'type':Sequelize[_0xa617('0x6')]},'customField':{'type':Sequelize[_0xa617('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa617('0x6')]}}; \ No newline at end of file +var _0x274a=['variable','sequelize','exports','string','customVariable','keyValue','picklist','STRING'];(function(_0x5d6c60,_0x15d20b){var _0x181b29=function(_0x1360f4){while(--_0x1360f4){_0x5d6c60['push'](_0x5d6c60['shift']());}};_0x181b29(++_0x15d20b);}(_0x274a,0x189));var _0xa274=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x274a[_0x172747];return _0x509692;};'use strict';var Sequelize=require(_0xa274('0x0'));module[_0xa274('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa274('0x2'),'variable',_0xa274('0x3'),_0xa274('0x4'),_0xa274('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xa274('0x6')]},'key':{'type':Sequelize[_0xa274('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xa274('0x2'),_0xa274('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xa274('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa274('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 033772b..9a36b91 100644 --- a/server/api/intServicenowField/intServicenowField.controller.js +++ b/server/api/intServicenowField/intServicenowField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20cf=['eml-format','fast-json-patch','request-promise','moment','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/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowField','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body'];(function(_0xddc709,_0x17b64c){var _0xa4af8e=function(_0x4abe98){while(--_0x4abe98){_0xddc709['push'](_0xddc709['shift']());}};_0xa4af8e(++_0x17b64c);}(_0x20cf,0xe7));var _0xf20c=function(_0x296431,_0x18bd9f){_0x296431=_0x296431-0x0;var _0x2cf5bb=_0x20cf[_0x296431];return _0x2cf5bb;};'use strict';var emlformat=require(_0xf20c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf20c('0x1'));var rp=require(_0xf20c('0x2'));var moment=require(_0xf20c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf20c('0x4'));var path=require(_0xf20c('0x5'));var sox=require(_0xf20c('0x6'));var csv=require(_0xf20c('0x7'));var ejs=require(_0xf20c('0x8'));var fs=require('fs');var fs_extra=require(_0xf20c('0x9'));var _=require(_0xf20c('0xa'));var squel=require(_0xf20c('0xb'));var crypto=require(_0xf20c('0xc'));var jsforce=require(_0xf20c('0xd'));var deskjs=require(_0xf20c('0xe'));var toCsv=require(_0xf20c('0x7'));var querystring=require(_0xf20c('0xf'));var Papa=require(_0xf20c('0x10'));var Redis=require(_0xf20c('0x11'));var authService=require(_0xf20c('0x12'));var qs=require(_0xf20c('0x13'));var as=require(_0xf20c('0x14'));var hardwareService=require(_0xf20c('0x15'));var logger=require(_0xf20c('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf20c('0x17'));var db=require(_0xf20c('0x18'))['db'];function respondWithStatusCode(_0x2045c6,_0x6d4b4d){_0x6d4b4d=_0x6d4b4d||0xcc;return function(_0x15770e){if(_0x15770e){return _0x2045c6[_0xf20c('0x19')](_0x6d4b4d);}return _0x2045c6['status'](_0x6d4b4d)[_0xf20c('0x1a')]();};}function respondWithResult(_0x15029c,_0xa1232f){_0xa1232f=_0xa1232f||0xc8;return function(_0x5cf15d){if(_0x5cf15d){return _0x15029c[_0xf20c('0x1b')](_0xa1232f)[_0xf20c('0x1c')](_0x5cf15d);}};}function respondWithFilteredResult(_0x2de73c,_0x1a1695){return function(_0x59d5b0){if(_0x59d5b0){var _0x23e900=typeof _0x1a1695['offset']==='undefined'&&typeof _0x1a1695['limit']===_0xf20c('0x1d');var _0x4c0e0d=_0x59d5b0[_0xf20c('0x1e')];var _0x21c4d2=_0x23e900?0x0:_0x1a1695[_0xf20c('0x1f')];var _0x20189d=_0x23e900?_0x59d5b0['count']:_0x1a1695[_0xf20c('0x1f')]+_0x1a1695[_0xf20c('0x20')];var _0x3d41c3;if(_0x20189d>=_0x4c0e0d){_0x20189d=_0x4c0e0d;_0x3d41c3=0xc8;}else{_0x3d41c3=0xce;}_0x2de73c['status'](_0x3d41c3);return _0x2de73c[_0xf20c('0x21')](_0xf20c('0x22'),_0x21c4d2+'-'+_0x20189d+'/'+_0x4c0e0d)['json'](_0x59d5b0);}return null;};}function patchUpdates(_0x41c8ad){return function(_0x3972f2){try{jsonpatch[_0xf20c('0x23')](_0x3972f2,_0x41c8ad,!![]);}catch(_0x2e70e0){return BPromise[_0xf20c('0x24')](_0x2e70e0);}return _0x3972f2[_0xf20c('0x25')]();};}function saveUpdates(_0x5dda0c,_0x444660){return function(_0x500224){if(_0x500224){return _0x500224[_0xf20c('0x26')](_0x5dda0c)[_0xf20c('0x27')](function(_0x48e87e){return _0x48e87e;});}return null;};}function removeEntity(_0x17c250,_0x292c99){return function(_0x4eedcf){if(_0x4eedcf){return _0x4eedcf[_0xf20c('0x28')]()[_0xf20c('0x27')](function(){_0x17c250[_0xf20c('0x1b')](0xcc)[_0xf20c('0x1a')]();});}};}function handleEntityNotFound(_0xbc0b4e,_0x3a0894){return function(_0x14baa8){if(!_0x14baa8){_0xbc0b4e['sendStatus'](0x194);}return _0x14baa8;};}function handleError(_0x354b4e,_0x4645f1){_0x4645f1=_0x4645f1||0x1f4;return function(_0x1b370c){logger[_0xf20c('0x29')](_0x1b370c[_0xf20c('0x2a')]);if(_0x1b370c[_0xf20c('0x2b')]){delete _0x1b370c[_0xf20c('0x2b')];}_0x354b4e[_0xf20c('0x1b')](_0x4645f1)[_0xf20c('0x2c')](_0x1b370c);};}exports[_0xf20c('0x2d')]=function(_0x41031f,_0x46b863){var _0x3d10fc={},_0xfa6a96={},_0x2dbbb5={'count':0x0,'rows':[]};var _0x36dc03=_[_0xf20c('0x2e')](db[_0xf20c('0x2f')]['rawAttributes'],function(_0xa3a6b6){return{'name':_0xa3a6b6['fieldName'],'type':_0xa3a6b6[_0xf20c('0x30')][_0xf20c('0x31')]};});_0xfa6a96['model']=_[_0xf20c('0x2e')](_0x36dc03,'name');_0xfa6a96[_0xf20c('0x32')]=_[_0xf20c('0x33')](_0x41031f[_0xf20c('0x32')]);_0xfa6a96[_0xf20c('0x34')]=_[_0xf20c('0x35')](_0xfa6a96[_0xf20c('0x36')],_0xfa6a96[_0xf20c('0x32')]);_0x3d10fc['attributes']=_[_0xf20c('0x35')](_0xfa6a96[_0xf20c('0x36')],qs[_0xf20c('0x37')](_0x41031f[_0xf20c('0x32')]['fields']));_0x3d10fc[_0xf20c('0x38')]=_0x3d10fc['attributes'][_0xf20c('0x39')]?_0x3d10fc[_0xf20c('0x38')]:_0xfa6a96[_0xf20c('0x36')];if(!_0x41031f[_0xf20c('0x32')][_0xf20c('0x3a')](_0xf20c('0x3b'))){_0x3d10fc[_0xf20c('0x20')]=qs['limit'](_0x41031f[_0xf20c('0x32')][_0xf20c('0x20')]);_0x3d10fc[_0xf20c('0x1f')]=qs['offset'](_0x41031f[_0xf20c('0x32')][_0xf20c('0x1f')]);}_0x3d10fc[_0xf20c('0x3c')]=qs[_0xf20c('0x3d')](_0x41031f['query'][_0xf20c('0x3d')]);_0x3d10fc[_0xf20c('0x3e')]=qs['filters'](_['pick'](_0x41031f[_0xf20c('0x32')],_0xfa6a96[_0xf20c('0x34')]),_0x36dc03);if(_0x41031f['query']['filter']){_0x3d10fc['where']=_['merge'](_0x3d10fc[_0xf20c('0x3e')],{'$or':_['map'](_0x36dc03,function(_0x4e1b71){if(_0x4e1b71[_0xf20c('0x30')]!==_0xf20c('0x3f')){var _0x1d43b0={};_0x1d43b0[_0x4e1b71[_0xf20c('0x2b')]]={'$like':'%'+_0x41031f['query'][_0xf20c('0x40')]+'%'};return _0x1d43b0;}})});}_0x3d10fc=_[_0xf20c('0x41')]({},_0x3d10fc,_0x41031f['options']);var _0x2a2bd1={'where':_0x3d10fc[_0xf20c('0x3e')]};return db[_0xf20c('0x2f')][_0xf20c('0x1e')](_0x2a2bd1)[_0xf20c('0x27')](function(_0x7078bb){_0x2dbbb5[_0xf20c('0x1e')]=_0x7078bb;if(_0x41031f[_0xf20c('0x32')][_0xf20c('0x42')]){_0x3d10fc[_0xf20c('0x43')]=[{'all':!![]}];}return db[_0xf20c('0x2f')][_0xf20c('0x44')](_0x3d10fc);})[_0xf20c('0x27')](function(_0xdbf964){_0x2dbbb5['rows']=_0xdbf964;return _0x2dbbb5;})[_0xf20c('0x27')](respondWithFilteredResult(_0x46b863,_0x3d10fc))[_0xf20c('0x45')](handleError(_0x46b863,null));};exports[_0xf20c('0x46')]=function(_0x3c305f,_0x43f780){var _0x3e2c9b={'raw':!![],'where':{'id':_0x3c305f[_0xf20c('0x47')]['id']}},_0x1a23ed={};_0x1a23ed[_0xf20c('0x36')]=_[_0xf20c('0x33')](db['ServicenowField'][_0xf20c('0x48')]);_0x1a23ed[_0xf20c('0x32')]=_[_0xf20c('0x33')](_0x3c305f['query']);_0x1a23ed[_0xf20c('0x34')]=_['intersection'](_0x1a23ed[_0xf20c('0x36')],_0x1a23ed[_0xf20c('0x32')]);_0x3e2c9b[_0xf20c('0x38')]=_[_0xf20c('0x35')](_0x1a23ed[_0xf20c('0x36')],qs[_0xf20c('0x37')](_0x3c305f[_0xf20c('0x32')][_0xf20c('0x37')]));_0x3e2c9b[_0xf20c('0x38')]=_0x3e2c9b['attributes'][_0xf20c('0x39')]?_0x3e2c9b[_0xf20c('0x38')]:_0x1a23ed[_0xf20c('0x36')];if(_0x3c305f[_0xf20c('0x32')][_0xf20c('0x42')]){_0x3e2c9b[_0xf20c('0x43')]=[{'all':!![]}];}_0x3e2c9b=_[_0xf20c('0x41')]({},_0x3e2c9b,_0x3c305f[_0xf20c('0x49')]);return db['ServicenowField'][_0xf20c('0x4a')](_0x3e2c9b)[_0xf20c('0x27')](handleEntityNotFound(_0x43f780,null))[_0xf20c('0x27')](respondWithResult(_0x43f780,null))[_0xf20c('0x45')](handleError(_0x43f780,null));};exports[_0xf20c('0x4b')]=function(_0x5c14bb,_0x2a35a6){return db[_0xf20c('0x2f')][_0xf20c('0x4b')](_0x5c14bb[_0xf20c('0x4c')],{})[_0xf20c('0x27')](respondWithResult(_0x2a35a6,0xc9))[_0xf20c('0x45')](handleError(_0x2a35a6,null));};exports[_0xf20c('0x26')]=function(_0x1fb6c0,_0x40a6d2){if(_0x1fb6c0['body']['id']){delete _0x1fb6c0['body']['id'];}return db['ServicenowField'][_0xf20c('0x4a')]({'where':{'id':_0x1fb6c0[_0xf20c('0x47')]['id']}})[_0xf20c('0x27')](handleEntityNotFound(_0x40a6d2,null))['then'](saveUpdates(_0x1fb6c0[_0xf20c('0x4c')],null))['then'](respondWithResult(_0x40a6d2,null))['catch'](handleError(_0x40a6d2,null));};exports[_0xf20c('0x28')]=function(_0x5326ee,_0x5d2c41){return db[_0xf20c('0x2f')][_0xf20c('0x4a')]({'where':{'id':_0x5326ee[_0xf20c('0x47')]['id']}})[_0xf20c('0x27')](handleEntityNotFound(_0x5d2c41,null))['then'](removeEntity(_0x5d2c41,null))[_0xf20c('0x45')](handleError(_0x5d2c41,null));}; \ No newline at end of file +var _0x9843=['send','map','fieldName','type','key','query','keys','filters','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','ServicenowField','includeAll','include','rows','catch','rawAttributes','intersection','create','body','find','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','name'];(function(_0x13f83f,_0x44e4b6){var _0x5648f5=function(_0x2611bb){while(--_0x2611bb){_0x13f83f['push'](_0x13f83f['shift']());}};_0x5648f5(++_0x44e4b6);}(_0x9843,0x1ca));var _0x3984=function(_0x20fbd5,_0x548e19){_0x20fbd5=_0x20fbd5-0x0;var _0x1bf745=_0x9843[_0x20fbd5];return _0x1bf745;};'use strict';var emlformat=require(_0x3984('0x0'));var rimraf=require(_0x3984('0x1'));var zipdir=require(_0x3984('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3984('0x3'));var moment=require(_0x3984('0x4'));var BPromise=require(_0x3984('0x5'));var Mustache=require('mustache');var util=require(_0x3984('0x6'));var path=require(_0x3984('0x7'));var sox=require('sox');var csv=require(_0x3984('0x8'));var ejs=require(_0x3984('0x9'));var fs=require('fs');var fs_extra=require(_0x3984('0xa'));var _=require(_0x3984('0xb'));var squel=require(_0x3984('0xc'));var crypto=require(_0x3984('0xd'));var jsforce=require(_0x3984('0xe'));var deskjs=require(_0x3984('0xf'));var toCsv=require(_0x3984('0x8'));var querystring=require(_0x3984('0x10'));var Papa=require('papaparse');var Redis=require(_0x3984('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3984('0x12'));var as=require(_0x3984('0x13'));var hardwareService=require(_0x3984('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3984('0x15'));var config=require(_0x3984('0x16'));var licenseUtil=require(_0x3984('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ab8bf,_0x16e6bc){_0x16e6bc=_0x16e6bc||0xcc;return function(_0xe4521f){if(_0xe4521f){return _0x4ab8bf['sendStatus'](_0x16e6bc);}return _0x4ab8bf['status'](_0x16e6bc)[_0x3984('0x18')]();};}function respondWithResult(_0x193849,_0x3d30a9){_0x3d30a9=_0x3d30a9||0xc8;return function(_0x2d6953){if(_0x2d6953){return _0x193849[_0x3984('0x19')](_0x3d30a9)[_0x3984('0x1a')](_0x2d6953);}};}function respondWithFilteredResult(_0x3270f8,_0x2f7fab){return function(_0x3cccce){if(_0x3cccce){var _0x5cf79e=typeof _0x2f7fab[_0x3984('0x1b')]===_0x3984('0x1c')&&typeof _0x2f7fab[_0x3984('0x1d')]==='undefined';var _0x5dd189=_0x3cccce[_0x3984('0x1e')];var _0x48d0a3=_0x5cf79e?0x0:_0x2f7fab[_0x3984('0x1b')];var _0x517c18=_0x5cf79e?_0x3cccce[_0x3984('0x1e')]:_0x2f7fab[_0x3984('0x1b')]+_0x2f7fab[_0x3984('0x1d')];var _0x7eae48;if(_0x517c18>=_0x5dd189){_0x517c18=_0x5dd189;_0x7eae48=0xc8;}else{_0x7eae48=0xce;}_0x3270f8['status'](_0x7eae48);return _0x3270f8[_0x3984('0x1f')](_0x3984('0x20'),_0x48d0a3+'-'+_0x517c18+'/'+_0x5dd189)['json'](_0x3cccce);}return null;};}function patchUpdates(_0x17bde2){return function(_0x53946e){try{jsonpatch['apply'](_0x53946e,_0x17bde2,!![]);}catch(_0x3b30ca){return BPromise[_0x3984('0x21')](_0x3b30ca);}return _0x53946e[_0x3984('0x22')]();};}function saveUpdates(_0x5bf989,_0xe7d7e4){return function(_0x4ee772){if(_0x4ee772){return _0x4ee772[_0x3984('0x23')](_0x5bf989)[_0x3984('0x24')](function(_0x5cce96){return _0x5cce96;});}return null;};}function removeEntity(_0x5090ab,_0x5953aa){return function(_0x132ad3){if(_0x132ad3){return _0x132ad3[_0x3984('0x25')]()[_0x3984('0x24')](function(){_0x5090ab['status'](0xcc)[_0x3984('0x18')]();});}};}function handleEntityNotFound(_0x59be8d,_0x24f88d){return function(_0x135cac){if(!_0x135cac){_0x59be8d['sendStatus'](0x194);}return _0x135cac;};}function handleError(_0x4f4651,_0x3b6419){_0x3b6419=_0x3b6419||0x1f4;return function(_0x1aa214){logger['error'](_0x1aa214['stack']);if(_0x1aa214[_0x3984('0x26')]){delete _0x1aa214['name'];}_0x4f4651[_0x3984('0x19')](_0x3b6419)[_0x3984('0x27')](_0x1aa214);};}exports['index']=function(_0x4ace62,_0x299c61){var _0x2cf87b={},_0x4ad474={},_0x1d9d0d={'count':0x0,'rows':[]};var _0x50e15a=_[_0x3984('0x28')](db['ServicenowField']['rawAttributes'],function(_0x5cc883){return{'name':_0x5cc883[_0x3984('0x29')],'type':_0x5cc883[_0x3984('0x2a')][_0x3984('0x2b')]};});_0x4ad474['model']=_['map'](_0x50e15a,_0x3984('0x26'));_0x4ad474[_0x3984('0x2c')]=_[_0x3984('0x2d')](_0x4ace62['query']);_0x4ad474[_0x3984('0x2e')]=_['intersection'](_0x4ad474['model'],_0x4ad474['query']);_0x2cf87b[_0x3984('0x2f')]=_['intersection'](_0x4ad474['model'],qs[_0x3984('0x30')](_0x4ace62[_0x3984('0x2c')][_0x3984('0x30')]));_0x2cf87b[_0x3984('0x2f')]=_0x2cf87b['attributes'][_0x3984('0x31')]?_0x2cf87b[_0x3984('0x2f')]:_0x4ad474[_0x3984('0x32')];if(!_0x4ace62[_0x3984('0x2c')][_0x3984('0x33')](_0x3984('0x34'))){_0x2cf87b['limit']=qs['limit'](_0x4ace62[_0x3984('0x2c')]['limit']);_0x2cf87b['offset']=qs[_0x3984('0x1b')](_0x4ace62[_0x3984('0x2c')][_0x3984('0x1b')]);}_0x2cf87b[_0x3984('0x35')]=qs[_0x3984('0x36')](_0x4ace62['query'][_0x3984('0x36')]);_0x2cf87b['where']=qs[_0x3984('0x2e')](_[_0x3984('0x37')](_0x4ace62['query'],_0x4ad474['filters']),_0x50e15a);if(_0x4ace62[_0x3984('0x2c')]['filter']){_0x2cf87b[_0x3984('0x38')]=_[_0x3984('0x39')](_0x2cf87b[_0x3984('0x38')],{'$or':_[_0x3984('0x28')](_0x50e15a,function(_0x5b92a5){if(_0x5b92a5[_0x3984('0x2a')]!==_0x3984('0x3a')){var _0x987b47={};_0x987b47[_0x5b92a5['name']]={'$like':'%'+_0x4ace62['query']['filter']+'%'};return _0x987b47;}})});}_0x2cf87b=_[_0x3984('0x39')]({},_0x2cf87b,_0x4ace62[_0x3984('0x3b')]);var _0x10be27={'where':_0x2cf87b[_0x3984('0x38')]};return db[_0x3984('0x3c')][_0x3984('0x1e')](_0x10be27)['then'](function(_0x5240fa){_0x1d9d0d[_0x3984('0x1e')]=_0x5240fa;if(_0x4ace62[_0x3984('0x2c')][_0x3984('0x3d')]){_0x2cf87b[_0x3984('0x3e')]=[{'all':!![]}];}return db[_0x3984('0x3c')]['findAll'](_0x2cf87b);})[_0x3984('0x24')](function(_0x192c01){_0x1d9d0d[_0x3984('0x3f')]=_0x192c01;return _0x1d9d0d;})[_0x3984('0x24')](respondWithFilteredResult(_0x299c61,_0x2cf87b))[_0x3984('0x40')](handleError(_0x299c61,null));};exports['show']=function(_0x268090,_0x1dac1b){var _0x3d8e6d={'raw':!![],'where':{'id':_0x268090['params']['id']}},_0x379c3f={};_0x379c3f[_0x3984('0x32')]=_['keys'](db['ServicenowField'][_0x3984('0x41')]);_0x379c3f[_0x3984('0x2c')]=_[_0x3984('0x2d')](_0x268090[_0x3984('0x2c')]);_0x379c3f[_0x3984('0x2e')]=_[_0x3984('0x42')](_0x379c3f[_0x3984('0x32')],_0x379c3f[_0x3984('0x2c')]);_0x3d8e6d[_0x3984('0x2f')]=_[_0x3984('0x42')](_0x379c3f['model'],qs[_0x3984('0x30')](_0x268090[_0x3984('0x2c')]['fields']));_0x3d8e6d['attributes']=_0x3d8e6d[_0x3984('0x2f')][_0x3984('0x31')]?_0x3d8e6d['attributes']:_0x379c3f['model'];if(_0x268090[_0x3984('0x2c')][_0x3984('0x3d')]){_0x3d8e6d[_0x3984('0x3e')]=[{'all':!![]}];}_0x3d8e6d=_[_0x3984('0x39')]({},_0x3d8e6d,_0x268090[_0x3984('0x3b')]);return db[_0x3984('0x3c')]['find'](_0x3d8e6d)[_0x3984('0x24')](handleEntityNotFound(_0x1dac1b,null))[_0x3984('0x24')](respondWithResult(_0x1dac1b,null))['catch'](handleError(_0x1dac1b,null));};exports[_0x3984('0x43')]=function(_0x13b1ec,_0x5d0285){return db[_0x3984('0x3c')][_0x3984('0x43')](_0x13b1ec[_0x3984('0x44')],{})[_0x3984('0x24')](respondWithResult(_0x5d0285,0xc9))[_0x3984('0x40')](handleError(_0x5d0285,null));};exports['update']=function(_0x1c3522,_0x5a87f0){if(_0x1c3522[_0x3984('0x44')]['id']){delete _0x1c3522[_0x3984('0x44')]['id'];}return db[_0x3984('0x3c')][_0x3984('0x45')]({'where':{'id':_0x1c3522[_0x3984('0x46')]['id']}})['then'](handleEntityNotFound(_0x5a87f0,null))[_0x3984('0x24')](saveUpdates(_0x1c3522[_0x3984('0x44')],null))[_0x3984('0x24')](respondWithResult(_0x5a87f0,null))[_0x3984('0x40')](handleError(_0x5a87f0,null));};exports[_0x3984('0x25')]=function(_0xc691b3,_0x3ea5d8){return db[_0x3984('0x3c')]['find']({'where':{'id':_0xc691b3['params']['id']}})['then'](handleEntityNotFound(_0x3ea5d8,null))['then'](removeEntity(_0x3ea5d8,null))[_0x3984('0x40')](handleError(_0x3ea5d8,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index b433597..397397c 100644 --- a/server/api/intServicenowField/intServicenowField.model.js +++ b/server/api/intServicenowField/intServicenowField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02ff=['bluebird','path','rimraf','../../config/environment','exports','ServicenowField','int_servicenow_fields','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x5c5921,_0x333609){var _0x3870cf=function(_0x53f3fd){while(--_0x53f3fd){_0x5c5921['push'](_0x5c5921['shift']());}};_0x3870cf(++_0x333609);}(_0x02ff,0x183));var _0xf02f=function(_0x5f0d26,_0x41fe72){_0x5f0d26=_0x5f0d26-0x0;var _0x1c66cc=_0x02ff[_0x5f0d26];return _0x1c66cc;};'use strict';var _=require(_0xf02f('0x0'));var util=require(_0xf02f('0x1'));var logger=require(_0xf02f('0x2'))(_0xf02f('0x3'));var moment=require(_0xf02f('0x4'));var BPromise=require(_0xf02f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf02f('0x6'));var rimraf=require(_0xf02f('0x7'));var config=require(_0xf02f('0x8'));var attributes=require('./intServicenowField.attributes');module[_0xf02f('0x9')]=function(_0x4031b6,_0xdadd9){return _0x4031b6['define'](_0xf02f('0xa'),attributes,{'tableName':_0xf02f('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xf02f('0xc'),_0xf02f('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9d55=['api','moment','bluebird','request-promise','path','rimraf','./intServicenowField.attributes','exports','define','servicenow_unique_index','idField','FieldId','lodash'];(function(_0x58e6ac,_0x271bee){var _0x4339af=function(_0x45bc49){while(--_0x45bc49){_0x58e6ac['push'](_0x58e6ac['shift']());}};_0x4339af(++_0x271bee);}(_0x9d55,0x1b9));var _0x59d5=function(_0x151c9e,_0x19707b){_0x151c9e=_0x151c9e-0x0;var _0x502cee=_0x9d55[_0x151c9e];return _0x502cee;};'use strict';var _=require(_0x59d5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x59d5('0x1'));var moment=require(_0x59d5('0x2'));var BPromise=require(_0x59d5('0x3'));var rp=require(_0x59d5('0x4'));var fs=require('fs');var path=require(_0x59d5('0x5'));var rimraf=require(_0x59d5('0x6'));var config=require('../../config/environment');var attributes=require(_0x59d5('0x7'));module[_0x59d5('0x8')]=function(_0x5b58e9,_0x237489){return _0x5b58e9[_0x59d5('0x9')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x59d5('0xa'),'fields':[_0x59d5('0xb'),_0x59d5('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 61d96ab..2e5125a 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x59ce4a,_0x2e81fd){var _0xdbae10=function(_0x1cc6eb){while(--_0x1cc6eb){_0x59ce4a['push'](_0x59ce4a['shift']());}};_0xdbae10(++_0x2e81fd);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0xb7e7[_0x1e3c16];return _0x47a0c9;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x234cd4,_0x1ff933){var _0xa9d509=function(_0x58f263){while(--_0x58f263){_0x234cd4['push'](_0x234cd4['shift']());}};_0xa9d509(++_0x1ff933);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4a52ad,_0x2f220e){_0x4a52ad=_0x4a52ad-0x0;var _0x231eb4=_0xb43b[_0x4a52ad];return _0x231eb4;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index ad55abf..fa5a74e 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x25bdbe,_0x42ffac){var _0x28b7ac=function(_0x1c948c){while(--_0x1c948c){_0x25bdbe['push'](_0x25bdbe['shift']());}};_0x28b7ac(++_0x42ffac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0xfc3391,_0x10c877){var _0x11e7c6=function(_0x4a0e8b){while(--_0x4a0e8b){_0xfc3391['push'](_0xfc3391['shift']());}};_0x11e7c6(++_0x10c877);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 32bb8bd..6dbda7e 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3242a9,_0x419edc){var _0x5017c3=function(_0x8586e8){while(--_0x8586e8){_0x3242a9['push'](_0x3242a9['shift']());}};_0x5017c3(++_0x419edc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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(_0xe8c443,_0x319242){var _0x402d07=function(_0xc0f3d6){while(--_0xc0f3d6){_0xe8c443['push'](_0xe8c443['shift']());}};_0x402d07(++_0x319242);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 52c31e9..ed6ec08 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe41d=['endsWith','values','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','name','send','index','map','SugarcrmAccount','rawAttributes','type','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows','show','intersection','length','includeAll','catch','create','body','find','params','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','Subjects','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','password','remoteUri','slice','substring','POST','format','/service/v4_1/rest.php','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','%s%s','get_module_fields','Calls','module_fields','remove','includes','label'];(function(_0x3e00f5,_0xa17b54){var _0x4e2fc1=function(_0x39435b){while(--_0x39435b){_0x3e00f5['push'](_0x3e00f5['shift']());}};_0x4e2fc1(++_0xa17b54);}(_0xe41d,0x169));var _0xde41=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe41d[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0xde41('0x0'));var rimraf=require(_0xde41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde41('0x2'));var rp=require(_0xde41('0x3'));var moment=require('moment');var BPromise=require(_0xde41('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xde41('0x5'));var sox=require(_0xde41('0x6'));var csv=require(_0xde41('0x7'));var ejs=require(_0xde41('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde41('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xde41('0x7'));var querystring=require(_0xde41('0xa'));var Papa=require(_0xde41('0xb'));var Redis=require('ioredis');var authService=require(_0xde41('0xc'));var qs=require(_0xde41('0xd'));var as=require(_0xde41('0xe'));var hardwareService=require(_0xde41('0xf'));var logger=require(_0xde41('0x10'))(_0xde41('0x11'));var utils=require('../../config/utils');var config=require(_0xde41('0x12'));var licenseUtil=require(_0xde41('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0xde41('0x14'));function respondWithStatusCode(_0x5c6122,_0xaf3d9c){_0xaf3d9c=_0xaf3d9c||0xcc;return function(_0x332d13){if(_0x332d13){return _0x5c6122[_0xde41('0x15')](_0xaf3d9c);}return _0x5c6122[_0xde41('0x16')](_0xaf3d9c)[_0xde41('0x17')]();};}function respondWithResult(_0x5d0329,_0x112193){_0x112193=_0x112193||0xc8;return function(_0x26a496){if(_0x26a496){return _0x5d0329[_0xde41('0x16')](_0x112193)[_0xde41('0x18')](_0x26a496);}};}function respondWithFilteredResult(_0x34415c,_0x34ebb4){return function(_0x40e752){if(_0x40e752){var _0x5ca82b=typeof _0x34ebb4[_0xde41('0x19')]===_0xde41('0x1a')&&typeof _0x34ebb4[_0xde41('0x1b')]===_0xde41('0x1a');var _0x110a25=_0x40e752['count'];var _0x2a4c67=_0x5ca82b?0x0:_0x34ebb4[_0xde41('0x19')];var _0x3cb13e=_0x5ca82b?_0x40e752[_0xde41('0x1c')]:_0x34ebb4[_0xde41('0x19')]+_0x34ebb4[_0xde41('0x1b')];var _0x594b39;if(_0x3cb13e>=_0x110a25){_0x3cb13e=_0x110a25;_0x594b39=0xc8;}else{_0x594b39=0xce;}_0x34415c[_0xde41('0x16')](_0x594b39);return _0x34415c[_0xde41('0x1d')](_0xde41('0x1e'),_0x2a4c67+'-'+_0x3cb13e+'/'+_0x110a25)[_0xde41('0x18')](_0x40e752);}return null;};}function patchUpdates(_0x3c6c0d){return function(_0x10e08a){try{jsonpatch['apply'](_0x10e08a,_0x3c6c0d,!![]);}catch(_0x28585a){return BPromise[_0xde41('0x1f')](_0x28585a);}return _0x10e08a[_0xde41('0x20')]();};}function saveUpdates(_0x6845a2,_0xc537c2){return function(_0xd05a84){if(_0xd05a84){return _0xd05a84[_0xde41('0x21')](_0x6845a2)[_0xde41('0x22')](function(_0x1f24a8){return _0x1f24a8;});}return null;};}function removeEntity(_0x493df5,_0x566bb6){return function(_0x401111){if(_0x401111){return _0x401111[_0xde41('0x23')]()['then'](function(){_0x493df5[_0xde41('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf3ba8,_0xa3871e){return function(_0x316fd9){if(!_0x316fd9){_0xf3ba8[_0xde41('0x15')](0x194);}return _0x316fd9;};}function handleError(_0x5a428f,_0x5e3b6d){_0x5e3b6d=_0x5e3b6d||0x1f4;return function(_0x507420){logger['error'](_0x507420['stack']);if(_0x507420[_0xde41('0x24')]){delete _0x507420[_0xde41('0x24')];}_0x5a428f[_0xde41('0x16')](_0x5e3b6d)[_0xde41('0x25')](_0x507420);};}exports[_0xde41('0x26')]=function(_0x4330a4,_0x52e4bb){var _0x347f0a={},_0x450204={},_0x497de8={'count':0x0,'rows':[]};var _0x4d56e5=_[_0xde41('0x27')](db[_0xde41('0x28')][_0xde41('0x29')],function(_0x4eee2f){return{'name':_0x4eee2f['fieldName'],'type':_0x4eee2f[_0xde41('0x2a')]['key']};});_0x450204[_0xde41('0x2b')]=_['map'](_0x4d56e5,_0xde41('0x24'));_0x450204[_0xde41('0x2c')]=_[_0xde41('0x2d')](_0x4330a4[_0xde41('0x2c')]);_0x450204[_0xde41('0x2e')]=_['intersection'](_0x450204[_0xde41('0x2b')],_0x450204['query']);_0x347f0a[_0xde41('0x2f')]=_['intersection'](_0x450204[_0xde41('0x2b')],qs[_0xde41('0x30')](_0x4330a4[_0xde41('0x2c')][_0xde41('0x30')]));_0x347f0a[_0xde41('0x2f')]=_0x347f0a[_0xde41('0x2f')]['length']?_0x347f0a[_0xde41('0x2f')]:_0x450204['model'];if(!_0x4330a4['query'][_0xde41('0x31')](_0xde41('0x32'))){_0x347f0a['limit']=qs[_0xde41('0x1b')](_0x4330a4[_0xde41('0x2c')][_0xde41('0x1b')]);_0x347f0a[_0xde41('0x19')]=qs[_0xde41('0x19')](_0x4330a4[_0xde41('0x2c')][_0xde41('0x19')]);}_0x347f0a[_0xde41('0x33')]=qs[_0xde41('0x34')](_0x4330a4[_0xde41('0x2c')][_0xde41('0x34')]);_0x347f0a['where']=qs[_0xde41('0x2e')](_[_0xde41('0x35')](_0x4330a4['query'],_0x450204['filters']),_0x4d56e5);if(_0x4330a4[_0xde41('0x2c')][_0xde41('0x36')]){_0x347f0a['where']=_[_0xde41('0x37')](_0x347f0a[_0xde41('0x38')],{'$or':_[_0xde41('0x27')](_0x4d56e5,function(_0x3cd6f5){if(_0x3cd6f5[_0xde41('0x2a')]!==_0xde41('0x39')){var _0x323555={};_0x323555[_0x3cd6f5[_0xde41('0x24')]]={'$like':'%'+_0x4330a4[_0xde41('0x2c')][_0xde41('0x36')]+'%'};return _0x323555;}})});}_0x347f0a=_[_0xde41('0x37')]({},_0x347f0a,_0x4330a4[_0xde41('0x3a')]);var _0x1c4968={'where':_0x347f0a[_0xde41('0x38')]};return db['SugarcrmAccount'][_0xde41('0x1c')](_0x1c4968)[_0xde41('0x22')](function(_0x5a4524){_0x497de8['count']=_0x5a4524;if(_0x4330a4['query']['includeAll']){_0x347f0a[_0xde41('0x3b')]=[{'all':!![]}];}return db[_0xde41('0x28')][_0xde41('0x3c')](_0x347f0a);})[_0xde41('0x22')](function(_0x348c71){_0x497de8[_0xde41('0x3d')]=_0x348c71;return _0x497de8;})[_0xde41('0x22')](respondWithFilteredResult(_0x52e4bb,_0x347f0a))['catch'](handleError(_0x52e4bb,null));};exports[_0xde41('0x3e')]=function(_0x2058da,_0x31582e){var _0x2f2e2e={'raw':![],'where':{'id':_0x2058da['params']['id']}},_0x2c8e94={};_0x2c8e94[_0xde41('0x2b')]=_[_0xde41('0x2d')](db['SugarcrmAccount'][_0xde41('0x29')]);_0x2c8e94[_0xde41('0x2c')]=_[_0xde41('0x2d')](_0x2058da[_0xde41('0x2c')]);_0x2c8e94['filters']=_[_0xde41('0x3f')](_0x2c8e94[_0xde41('0x2b')],_0x2c8e94[_0xde41('0x2c')]);_0x2f2e2e[_0xde41('0x2f')]=_[_0xde41('0x3f')](_0x2c8e94[_0xde41('0x2b')],qs['fields'](_0x2058da[_0xde41('0x2c')][_0xde41('0x30')]));_0x2f2e2e['attributes']=_0x2f2e2e[_0xde41('0x2f')][_0xde41('0x40')]?_0x2f2e2e[_0xde41('0x2f')]:_0x2c8e94[_0xde41('0x2b')];if(_0x2058da[_0xde41('0x2c')][_0xde41('0x41')]){_0x2f2e2e[_0xde41('0x3b')]=[{'all':!![]}];}_0x2f2e2e=_[_0xde41('0x37')]({},_0x2f2e2e,_0x2058da['options']);return db['SugarcrmAccount']['find'](_0x2f2e2e)[_0xde41('0x22')](handleEntityNotFound(_0x31582e,null))[_0xde41('0x22')](respondWithResult(_0x31582e,null))[_0xde41('0x42')](handleError(_0x31582e,null));};exports[_0xde41('0x43')]=function(_0x519914,_0x129a74){return db[_0xde41('0x28')][_0xde41('0x43')](_0x519914[_0xde41('0x44')],{})[_0xde41('0x22')](respondWithResult(_0x129a74,0xc9))[_0xde41('0x42')](handleError(_0x129a74,null));};exports[_0xde41('0x21')]=function(_0x34f1be,_0x35ad64){if(_0x34f1be[_0xde41('0x44')]['id']){delete _0x34f1be[_0xde41('0x44')]['id'];}return db[_0xde41('0x28')][_0xde41('0x45')]({'where':{'id':_0x34f1be[_0xde41('0x46')]['id']}})[_0xde41('0x22')](handleEntityNotFound(_0x35ad64,null))['then'](saveUpdates(_0x34f1be[_0xde41('0x44')],null))[_0xde41('0x22')](respondWithResult(_0x35ad64,null))[_0xde41('0x42')](handleError(_0x35ad64,null));};exports[_0xde41('0x23')]=function(_0x483851,_0x1cc72c){return db[_0xde41('0x28')][_0xde41('0x45')]({'where':{'id':_0x483851[_0xde41('0x46')]['id']}})[_0xde41('0x22')](handleEntityNotFound(_0x1cc72c,null))['then'](removeEntity(_0x1cc72c,null))[_0xde41('0x42')](handleError(_0x1cc72c,null));};exports[_0xde41('0x47')]=function(_0x4ec40f,_0x1ed275,_0x3cec29){var _0x43e991={};var _0x38c286={};var _0x15618c;var _0x43ec9b;return db[_0xde41('0x28')][_0xde41('0x48')]({'where':{'id':_0x4ec40f[_0xde41('0x46')]['id']}})[_0xde41('0x22')](handleEntityNotFound(_0x1ed275,null))[_0xde41('0x22')](function(_0x2f048f){if(_0x2f048f){_0x15618c=_0x2f048f;_0x38c286[_0xde41('0x2b')]=_[_0xde41('0x2d')](db[_0xde41('0x49')][_0xde41('0x29')]);_0x38c286[_0xde41('0x2c')]=_[_0xde41('0x2d')](_0x4ec40f['query']);_0x38c286['filters']=_['intersection'](_0x38c286[_0xde41('0x2b')],_0x38c286[_0xde41('0x2c')]);_0x43e991[_0xde41('0x2f')]=_[_0xde41('0x3f')](_0x38c286['model'],qs[_0xde41('0x30')](_0x4ec40f[_0xde41('0x2c')][_0xde41('0x30')]));_0x43e991[_0xde41('0x2f')]=_0x43e991[_0xde41('0x2f')]['length']?_0x43e991[_0xde41('0x2f')]:_0x38c286[_0xde41('0x2b')];_0x43e991[_0xde41('0x33')]=qs['sort'](_0x4ec40f[_0xde41('0x2c')][_0xde41('0x34')]);_0x43e991[_0xde41('0x38')]=qs[_0xde41('0x2e')](_[_0xde41('0x35')](_0x4ec40f['query'],_0x38c286[_0xde41('0x2e')]));if(_0x4ec40f[_0xde41('0x2c')][_0xde41('0x36')]){_0x43e991['where']=_[_0xde41('0x37')](_0x43e991[_0xde41('0x38')],{'$or':_[_0xde41('0x27')](_0x43e991[_0xde41('0x2f')],function(_0x3a5db7){var _0x33d712={};_0x33d712[_0x3a5db7]={'$like':'%'+_0x4ec40f[_0xde41('0x2c')][_0xde41('0x36')]+'%'};return _0x33d712;})});}_0x43e991=_[_0xde41('0x37')]({},_0x43e991,_0x4ec40f[_0xde41('0x3a')]);return _0x15618c[_0xde41('0x47')](_0x43e991);}})[_0xde41('0x22')](function(_0x16be62){if(_0x16be62){_0x43ec9b=_0x16be62['length'];if(!_0x4ec40f['query'][_0xde41('0x31')](_0xde41('0x32'))){_0x43e991['limit']=qs[_0xde41('0x1b')](_0x4ec40f['query'][_0xde41('0x1b')]);_0x43e991[_0xde41('0x19')]=qs[_0xde41('0x19')](_0x4ec40f[_0xde41('0x2c')][_0xde41('0x19')]);}return _0x15618c['getConfigurations'](_0x43e991);}})['then'](function(_0x23d850){if(_0x23d850){return _0x23d850?{'count':_0x43ec9b,'rows':_0x23d850}:null;}})[_0xde41('0x22')](respondWithResult(_0x1ed275,null))[_0xde41('0x42')](handleError(_0x1ed275,null));};exports[_0xde41('0x4a')]=function(_0x28fadd,_0x50a56b,_0x562313){if(_0x28fadd['body']['id']){delete _0x28fadd[_0xde41('0x44')]['id'];}return db[_0xde41('0x28')][_0xde41('0x48')]({'where':{'id':_0x28fadd['params']['id']}})[_0xde41('0x22')](handleEntityNotFound(_0x50a56b,null))[_0xde41('0x22')](function(_0xeba3e9){if(_0xeba3e9){_0x28fadd['body'][_0xde41('0x4b')]=_0xeba3e9['id'];_0x28fadd[_0xde41('0x44')]['Subjects']=integrations[_0xde41('0x4c')](_0x28fadd['body'][_0xde41('0x4d')],_0x28fadd[_0xde41('0x44')][_0xde41('0x2a')]);_0x28fadd[_0xde41('0x44')][_0xde41('0x4e')]=integrations[_0xde41('0x4f')](_0x28fadd[_0xde41('0x44')]['channel'],_0x28fadd[_0xde41('0x44')][_0xde41('0x2a')]);return db[_0xde41('0x49')][_0xde41('0x43')](_0x28fadd[_0xde41('0x44')],{'include':[{'model':db[_0xde41('0x50')],'as':_0xde41('0x51')},{'model':db[_0xde41('0x50')],'as':_0xde41('0x4e')}]});}return null;})[_0xde41('0x22')](respondWithResult(_0x50a56b,null))['catch'](handleError(_0x50a56b,null));};exports[_0xde41('0x52')]=function(_0x40ab9e,_0x2703c0,_0x1f7a3f){var _0x541e1e='';var _0x51ccda=['id',_0xde41('0x24'),_0xde41('0x53'),_0xde41('0x54'),'description',_0xde41('0x55'),_0xde41('0x56'),_0xde41('0x57'),_0xde41('0x58'),_0xde41('0x59'),_0xde41('0x5a'),'direction'];return db[_0xde41('0x28')][_0xde41('0x48')]({'where':{'id':_0x40ab9e[_0xde41('0x46')]['id']},'attributes':['id','username',_0xde41('0x5b'),_0xde41('0x5c')]})[_0xde41('0x22')](handleEntityNotFound(_0x2703c0,null))[_0xde41('0x22')](function(_0x56bd93){if(_0x56bd93){_0x541e1e=_0x56bd93[_0xde41('0x5c')];var _0x193f7e=_0x541e1e[_0xde41('0x5d')](-0x1);if(_0x193f7e==='/'){_0x541e1e=_0x541e1e[_0xde41('0x5e')](0x0,_0x541e1e['lastIndexOf'](_0x193f7e));}return rp({'method':_0xde41('0x5f'),'uri':util[_0xde41('0x60')]('%s%s',_0x541e1e,_0xde41('0x61')),'json':!![],'form':{'method':'login','input_type':_0xde41('0x62'),'response_type':_0xde41('0x62'),'rest_data':JSON[_0xde41('0x63')]({'user_auth':{'user_name':_0x56bd93['username'],'password':_0x56bd93['password'],'encryption':_0xde41('0x64')},'application':_0xde41('0x65')})}});}})[_0xde41('0x22')](function(_0x400068){if(_0x400068&&_0x400068[_0xde41('0x24')]!==_0xde41('0x66')&&_0x400068['name']!==_0xde41('0x67')){return rp({'method':_0xde41('0x5f'),'uri':util[_0xde41('0x60')](_0xde41('0x68'),_0x541e1e,_0xde41('0x61')),'json':!![],'form':{'method':_0xde41('0x69'),'input_type':'JSON','response_type':_0xde41('0x62'),'rest_data':JSON[_0xde41('0x63')]({'session':_0x400068['id'],'module_name':_0xde41('0x6a')})}})[_0xde41('0x22')](function(_0xd6aae0){if(_0xd6aae0){var _0x764a66=_['values'](_0xd6aae0[_0xde41('0x6b')]);_[_0xde41('0x6c')](_0x764a66,function(_0x12b6f8){return _0x51ccda[_0xde41('0x6d')](_0x12b6f8[_0xde41('0x24')]);});return{'count':_0x764a66['length'],'rows':_[_0xde41('0x27')](_0x764a66,function(_0x166309){return{'id':_0x166309[_0xde41('0x24')],'name':_0x166309[_0xde41('0x6e')],'custom':_[_0xde41('0x6f')](_0x166309[_0xde41('0x24')],'_c')?!![]:![],'options':_0x166309['options']?_[_0xde41('0x27')](_[_0xde41('0x70')](_0x166309[_0xde41('0x3a')]),function(_0x855d22){return{'name':_0x855d22['value'],'value':_0x855d22['name']};}):[]};})};}})[_0xde41('0x22')](respondWithResult(_0x2703c0,null))[_0xde41('0x42')](function(_0x38057a){var _0x6bd52f=_0x40ab9e[_0xde41('0x2c')][_0xde41('0x71')]?0x1f4:_0x38057a[_0xde41('0x72')]||0x1f4;logger[_0xde41('0x73')](_0xde41('0x74'),_0xde41('0x52'),_0x6bd52f,JSON[_0xde41('0x63')](_0x38057a));delete _0x38057a[_0xde41('0x24')];if(_0x6bd52f===0x191){_0x6bd52f=0x190;}_0x2703c0['status'](_0x6bd52f)[_0xde41('0x25')](_0x40ab9e['query'][_0xde41('0x71')]?{'message':_0xde41('0x75'),'statusCode':_0x38057a[_0xde41('0x72')]}:_0x38057a);});}else{var _0x487d9e=0x1f4;_0x2703c0['status'](_0x487d9e)['send']({'message':_0xde41('0x75'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x1a3c=['includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getConfigurations','SugarcrmConfiguration','order','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmField','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_name','direction','password','remoteUri','slice','substring','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','username','PLAIN','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options'];(function(_0x41cda7,_0x1b2fab){var _0x120bbf=function(_0x4d38db){while(--_0x4d38db){_0x41cda7['push'](_0x41cda7['shift']());}};_0x120bbf(++_0x1b2fab);}(_0x1a3c,0x1a6));var _0xc1a3=function(_0x4a71c6,_0x204b11){_0x4a71c6=_0x4a71c6-0x0;var _0x23f6d8=_0x1a3c[_0x4a71c6];return _0x23f6d8;};'use strict';var emlformat=require(_0xc1a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc1a3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc1a3('0x2'));var moment=require(_0xc1a3('0x3'));var BPromise=require(_0xc1a3('0x4'));var Mustache=require(_0xc1a3('0x5'));var util=require(_0xc1a3('0x6'));var path=require('path');var sox=require(_0xc1a3('0x7'));var csv=require(_0xc1a3('0x8'));var ejs=require(_0xc1a3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1a3('0xa'));var squel=require(_0xc1a3('0xb'));var crypto=require('crypto');var jsforce=require(_0xc1a3('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc1a3('0xd'));var Redis=require(_0xc1a3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc1a3('0xf'));var as=require(_0xc1a3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc1a3('0x11'))(_0xc1a3('0x12'));var utils=require(_0xc1a3('0x13'));var config=require(_0xc1a3('0x14'));var licenseUtil=require(_0xc1a3('0x15'));var db=require(_0xc1a3('0x16'))['db'];var integrations=require(_0xc1a3('0x17'));function respondWithStatusCode(_0x122c8f,_0x8413fe){_0x8413fe=_0x8413fe||0xcc;return function(_0x40e5de){if(_0x40e5de){return _0x122c8f[_0xc1a3('0x18')](_0x8413fe);}return _0x122c8f[_0xc1a3('0x19')](_0x8413fe)[_0xc1a3('0x1a')]();};}function respondWithResult(_0x4d9dcc,_0x3958b1){_0x3958b1=_0x3958b1||0xc8;return function(_0x3271b6){if(_0x3271b6){return _0x4d9dcc['status'](_0x3958b1)[_0xc1a3('0x1b')](_0x3271b6);}};}function respondWithFilteredResult(_0x488f51,_0xb3a107){return function(_0x44faea){if(_0x44faea){var _0x139fc2=typeof _0xb3a107[_0xc1a3('0x1c')]===_0xc1a3('0x1d')&&typeof _0xb3a107[_0xc1a3('0x1e')]===_0xc1a3('0x1d');var _0x1982c5=_0x44faea[_0xc1a3('0x1f')];var _0x135b25=_0x139fc2?0x0:_0xb3a107[_0xc1a3('0x1c')];var _0x16f680=_0x139fc2?_0x44faea['count']:_0xb3a107['offset']+_0xb3a107['limit'];var _0x3233af;if(_0x16f680>=_0x1982c5){_0x16f680=_0x1982c5;_0x3233af=0xc8;}else{_0x3233af=0xce;}_0x488f51['status'](_0x3233af);return _0x488f51['set'](_0xc1a3('0x20'),_0x135b25+'-'+_0x16f680+'/'+_0x1982c5)[_0xc1a3('0x1b')](_0x44faea);}return null;};}function patchUpdates(_0x20ac11){return function(_0x54e6a2){try{jsonpatch[_0xc1a3('0x21')](_0x54e6a2,_0x20ac11,!![]);}catch(_0x4c31cb){return BPromise['reject'](_0x4c31cb);}return _0x54e6a2['save']();};}function saveUpdates(_0x2d9ac2,_0x13558c){return function(_0x2a8aeb){if(_0x2a8aeb){return _0x2a8aeb[_0xc1a3('0x22')](_0x2d9ac2)[_0xc1a3('0x23')](function(_0x20e306){return _0x20e306;});}return null;};}function removeEntity(_0x13bf2e,_0x3a2887){return function(_0x3a9597){if(_0x3a9597){return _0x3a9597[_0xc1a3('0x24')]()[_0xc1a3('0x23')](function(){_0x13bf2e[_0xc1a3('0x19')](0xcc)[_0xc1a3('0x1a')]();});}};}function handleEntityNotFound(_0x5360da,_0x25ce9f){return function(_0x3c1ff2){if(!_0x3c1ff2){_0x5360da[_0xc1a3('0x18')](0x194);}return _0x3c1ff2;};}function handleError(_0x5a60e4,_0x182be7){_0x182be7=_0x182be7||0x1f4;return function(_0x3527de){logger[_0xc1a3('0x25')](_0x3527de[_0xc1a3('0x26')]);if(_0x3527de[_0xc1a3('0x27')]){delete _0x3527de[_0xc1a3('0x27')];}_0x5a60e4[_0xc1a3('0x19')](_0x182be7)['send'](_0x3527de);};}exports[_0xc1a3('0x28')]=function(_0x1d8a70,_0x27ac47){var _0x46ed04={},_0x55638b={},_0x2f2135={'count':0x0,'rows':[]};var _0x245748=_[_0xc1a3('0x29')](db[_0xc1a3('0x2a')][_0xc1a3('0x2b')],function(_0x53b36a){return{'name':_0x53b36a[_0xc1a3('0x2c')],'type':_0x53b36a[_0xc1a3('0x2d')][_0xc1a3('0x2e')]};});_0x55638b[_0xc1a3('0x2f')]=_['map'](_0x245748,_0xc1a3('0x27'));_0x55638b['query']=_[_0xc1a3('0x30')](_0x1d8a70['query']);_0x55638b[_0xc1a3('0x31')]=_[_0xc1a3('0x32')](_0x55638b[_0xc1a3('0x2f')],_0x55638b[_0xc1a3('0x33')]);_0x46ed04[_0xc1a3('0x34')]=_[_0xc1a3('0x32')](_0x55638b[_0xc1a3('0x2f')],qs['fields'](_0x1d8a70['query'][_0xc1a3('0x35')]));_0x46ed04['attributes']=_0x46ed04[_0xc1a3('0x34')]['length']?_0x46ed04[_0xc1a3('0x34')]:_0x55638b[_0xc1a3('0x2f')];if(!_0x1d8a70['query'][_0xc1a3('0x36')](_0xc1a3('0x37'))){_0x46ed04[_0xc1a3('0x1e')]=qs[_0xc1a3('0x1e')](_0x1d8a70['query'][_0xc1a3('0x1e')]);_0x46ed04['offset']=qs[_0xc1a3('0x1c')](_0x1d8a70['query'][_0xc1a3('0x1c')]);}_0x46ed04['order']=qs[_0xc1a3('0x38')](_0x1d8a70[_0xc1a3('0x33')][_0xc1a3('0x38')]);_0x46ed04[_0xc1a3('0x39')]=qs[_0xc1a3('0x31')](_[_0xc1a3('0x3a')](_0x1d8a70['query'],_0x55638b[_0xc1a3('0x31')]),_0x245748);if(_0x1d8a70[_0xc1a3('0x33')][_0xc1a3('0x3b')]){_0x46ed04['where']=_[_0xc1a3('0x3c')](_0x46ed04[_0xc1a3('0x39')],{'$or':_[_0xc1a3('0x29')](_0x245748,function(_0x34f351){if(_0x34f351['type']!=='VIRTUAL'){var _0x478a5d={};_0x478a5d[_0x34f351[_0xc1a3('0x27')]]={'$like':'%'+_0x1d8a70[_0xc1a3('0x33')][_0xc1a3('0x3b')]+'%'};return _0x478a5d;}})});}_0x46ed04=_[_0xc1a3('0x3c')]({},_0x46ed04,_0x1d8a70[_0xc1a3('0x3d')]);var _0x57f91d={'where':_0x46ed04['where']};return db[_0xc1a3('0x2a')][_0xc1a3('0x1f')](_0x57f91d)['then'](function(_0xd8f796){_0x2f2135['count']=_0xd8f796;if(_0x1d8a70[_0xc1a3('0x33')][_0xc1a3('0x3e')]){_0x46ed04[_0xc1a3('0x3f')]=[{'all':!![]}];}return db[_0xc1a3('0x2a')][_0xc1a3('0x40')](_0x46ed04);})[_0xc1a3('0x23')](function(_0x586435){_0x2f2135[_0xc1a3('0x41')]=_0x586435;return _0x2f2135;})[_0xc1a3('0x23')](respondWithFilteredResult(_0x27ac47,_0x46ed04))[_0xc1a3('0x42')](handleError(_0x27ac47,null));};exports[_0xc1a3('0x43')]=function(_0x1b28f3,_0x5b49c5){var _0x3abfdf={'raw':![],'where':{'id':_0x1b28f3[_0xc1a3('0x44')]['id']}},_0x574334={};_0x574334['model']=_[_0xc1a3('0x30')](db[_0xc1a3('0x2a')]['rawAttributes']);_0x574334[_0xc1a3('0x33')]=_[_0xc1a3('0x30')](_0x1b28f3[_0xc1a3('0x33')]);_0x574334[_0xc1a3('0x31')]=_[_0xc1a3('0x32')](_0x574334[_0xc1a3('0x2f')],_0x574334[_0xc1a3('0x33')]);_0x3abfdf[_0xc1a3('0x34')]=_[_0xc1a3('0x32')](_0x574334[_0xc1a3('0x2f')],qs[_0xc1a3('0x35')](_0x1b28f3['query']['fields']));_0x3abfdf['attributes']=_0x3abfdf['attributes'][_0xc1a3('0x45')]?_0x3abfdf['attributes']:_0x574334[_0xc1a3('0x2f')];if(_0x1b28f3[_0xc1a3('0x33')]['includeAll']){_0x3abfdf[_0xc1a3('0x3f')]=[{'all':!![]}];}_0x3abfdf=_[_0xc1a3('0x3c')]({},_0x3abfdf,_0x1b28f3['options']);return db[_0xc1a3('0x2a')][_0xc1a3('0x46')](_0x3abfdf)[_0xc1a3('0x23')](handleEntityNotFound(_0x5b49c5,null))[_0xc1a3('0x23')](respondWithResult(_0x5b49c5,null))[_0xc1a3('0x42')](handleError(_0x5b49c5,null));};exports[_0xc1a3('0x47')]=function(_0x39956a,_0x54e666){return db[_0xc1a3('0x2a')]['create'](_0x39956a[_0xc1a3('0x48')],{})[_0xc1a3('0x23')](respondWithResult(_0x54e666,0xc9))[_0xc1a3('0x42')](handleError(_0x54e666,null));};exports[_0xc1a3('0x22')]=function(_0xc00834,_0x1ec518){if(_0xc00834['body']['id']){delete _0xc00834[_0xc1a3('0x48')]['id'];}return db[_0xc1a3('0x2a')][_0xc1a3('0x46')]({'where':{'id':_0xc00834[_0xc1a3('0x44')]['id']}})[_0xc1a3('0x23')](handleEntityNotFound(_0x1ec518,null))['then'](saveUpdates(_0xc00834[_0xc1a3('0x48')],null))[_0xc1a3('0x23')](respondWithResult(_0x1ec518,null))[_0xc1a3('0x42')](handleError(_0x1ec518,null));};exports[_0xc1a3('0x24')]=function(_0x7ec4ae,_0x147b86){return db['SugarcrmAccount'][_0xc1a3('0x46')]({'where':{'id':_0x7ec4ae[_0xc1a3('0x44')]['id']}})[_0xc1a3('0x23')](handleEntityNotFound(_0x147b86,null))['then'](removeEntity(_0x147b86,null))[_0xc1a3('0x42')](handleError(_0x147b86,null));};exports[_0xc1a3('0x49')]=function(_0x41f77b,_0x5bde52,_0x40ffce){var _0x304f9d={};var _0x34d625={};var _0x4436ed;var _0x2a24ff;return db[_0xc1a3('0x2a')]['findOne']({'where':{'id':_0x41f77b['params']['id']}})[_0xc1a3('0x23')](handleEntityNotFound(_0x5bde52,null))['then'](function(_0x2fbbdb){if(_0x2fbbdb){_0x4436ed=_0x2fbbdb;_0x34d625[_0xc1a3('0x2f')]=_[_0xc1a3('0x30')](db[_0xc1a3('0x4a')][_0xc1a3('0x2b')]);_0x34d625[_0xc1a3('0x33')]=_[_0xc1a3('0x30')](_0x41f77b[_0xc1a3('0x33')]);_0x34d625[_0xc1a3('0x31')]=_['intersection'](_0x34d625[_0xc1a3('0x2f')],_0x34d625[_0xc1a3('0x33')]);_0x304f9d[_0xc1a3('0x34')]=_[_0xc1a3('0x32')](_0x34d625['model'],qs[_0xc1a3('0x35')](_0x41f77b[_0xc1a3('0x33')]['fields']));_0x304f9d['attributes']=_0x304f9d[_0xc1a3('0x34')][_0xc1a3('0x45')]?_0x304f9d['attributes']:_0x34d625[_0xc1a3('0x2f')];_0x304f9d[_0xc1a3('0x4b')]=qs[_0xc1a3('0x38')](_0x41f77b[_0xc1a3('0x33')][_0xc1a3('0x38')]);_0x304f9d['where']=qs[_0xc1a3('0x31')](_[_0xc1a3('0x3a')](_0x41f77b['query'],_0x34d625['filters']));if(_0x41f77b['query']['filter']){_0x304f9d['where']=_[_0xc1a3('0x3c')](_0x304f9d['where'],{'$or':_['map'](_0x304f9d[_0xc1a3('0x34')],function(_0x443954){var _0x678195={};_0x678195[_0x443954]={'$like':'%'+_0x41f77b[_0xc1a3('0x33')][_0xc1a3('0x3b')]+'%'};return _0x678195;})});}_0x304f9d=_['merge']({},_0x304f9d,_0x41f77b['options']);return _0x4436ed[_0xc1a3('0x49')](_0x304f9d);}})[_0xc1a3('0x23')](function(_0x7b69c7){if(_0x7b69c7){_0x2a24ff=_0x7b69c7[_0xc1a3('0x45')];if(!_0x41f77b[_0xc1a3('0x33')][_0xc1a3('0x36')]('nolimit')){_0x304f9d[_0xc1a3('0x1e')]=qs[_0xc1a3('0x1e')](_0x41f77b['query'][_0xc1a3('0x1e')]);_0x304f9d[_0xc1a3('0x1c')]=qs['offset'](_0x41f77b[_0xc1a3('0x33')][_0xc1a3('0x1c')]);}return _0x4436ed[_0xc1a3('0x49')](_0x304f9d);}})[_0xc1a3('0x23')](function(_0x7cf9e6){if(_0x7cf9e6){return _0x7cf9e6?{'count':_0x2a24ff,'rows':_0x7cf9e6}:null;}})['then'](respondWithResult(_0x5bde52,null))['catch'](handleError(_0x5bde52,null));};exports[_0xc1a3('0x4c')]=function(_0x574c57,_0x592bbe,_0x15e158){if(_0x574c57[_0xc1a3('0x48')]['id']){delete _0x574c57[_0xc1a3('0x48')]['id'];}return db[_0xc1a3('0x2a')][_0xc1a3('0x4d')]({'where':{'id':_0x574c57[_0xc1a3('0x44')]['id']}})[_0xc1a3('0x23')](handleEntityNotFound(_0x592bbe,null))[_0xc1a3('0x23')](function(_0x35e673){if(_0x35e673){_0x574c57[_0xc1a3('0x48')][_0xc1a3('0x4e')]=_0x35e673['id'];_0x574c57['body'][_0xc1a3('0x4f')]=integrations[_0xc1a3('0x50')](_0x574c57[_0xc1a3('0x48')][_0xc1a3('0x51')],_0x574c57[_0xc1a3('0x48')][_0xc1a3('0x2d')]);_0x574c57[_0xc1a3('0x48')][_0xc1a3('0x52')]=integrations['getDescriptions'](_0x574c57[_0xc1a3('0x48')][_0xc1a3('0x51')],_0x574c57[_0xc1a3('0x48')]['type']);return db[_0xc1a3('0x4a')][_0xc1a3('0x47')](_0x574c57[_0xc1a3('0x48')],{'include':[{'model':db[_0xc1a3('0x53')],'as':_0xc1a3('0x4f')},{'model':db[_0xc1a3('0x53')],'as':_0xc1a3('0x52')}]});}return null;})[_0xc1a3('0x23')](respondWithResult(_0x592bbe,null))[_0xc1a3('0x42')](handleError(_0x592bbe,null));};exports['getFields']=function(_0x42d5d2,_0x252cdb,_0x291361){var _0x16fa0b='';var _0x2a3714=['id',_0xc1a3('0x27'),_0xc1a3('0x54'),_0xc1a3('0x55'),_0xc1a3('0x56'),_0xc1a3('0x57'),'duration_hours',_0xc1a3('0x58'),_0xc1a3('0x59'),'parent_type',_0xc1a3('0x5a'),_0xc1a3('0x5b')];return db[_0xc1a3('0x2a')][_0xc1a3('0x4d')]({'where':{'id':_0x42d5d2[_0xc1a3('0x44')]['id']},'attributes':['id','username',_0xc1a3('0x5c'),_0xc1a3('0x5d')]})[_0xc1a3('0x23')](handleEntityNotFound(_0x252cdb,null))[_0xc1a3('0x23')](function(_0x1995f8){if(_0x1995f8){_0x16fa0b=_0x1995f8[_0xc1a3('0x5d')];var _0x4e9c7b=_0x16fa0b[_0xc1a3('0x5e')](-0x1);if(_0x4e9c7b==='/'){_0x16fa0b=_0x16fa0b[_0xc1a3('0x5f')](0x0,_0x16fa0b['lastIndexOf'](_0x4e9c7b));}return rp({'method':_0xc1a3('0x60'),'uri':util[_0xc1a3('0x61')](_0xc1a3('0x62'),_0x16fa0b,_0xc1a3('0x63')),'json':!![],'form':{'method':'login','input_type':_0xc1a3('0x64'),'response_type':_0xc1a3('0x64'),'rest_data':JSON[_0xc1a3('0x65')]({'user_auth':{'user_name':_0x1995f8[_0xc1a3('0x66')],'password':_0x1995f8[_0xc1a3('0x5c')],'encryption':_0xc1a3('0x67')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xc1a3('0x23')](function(_0x536020){if(_0x536020&&_0x536020[_0xc1a3('0x27')]!==_0xc1a3('0x68')&&_0x536020['name']!==_0xc1a3('0x69')){return rp({'method':'POST','uri':util[_0xc1a3('0x61')]('%s%s',_0x16fa0b,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xc1a3('0x6a'),'input_type':_0xc1a3('0x64'),'response_type':'JSON','rest_data':JSON[_0xc1a3('0x65')]({'session':_0x536020['id'],'module_name':_0xc1a3('0x6b')})}})[_0xc1a3('0x23')](function(_0x56a519){if(_0x56a519){var _0x3d3e66=_[_0xc1a3('0x6c')](_0x56a519[_0xc1a3('0x6d')]);_[_0xc1a3('0x6e')](_0x3d3e66,function(_0x16aecc){return _0x2a3714[_0xc1a3('0x6f')](_0x16aecc[_0xc1a3('0x27')]);});return{'count':_0x3d3e66[_0xc1a3('0x45')],'rows':_[_0xc1a3('0x29')](_0x3d3e66,function(_0x1b7be7){return{'id':_0x1b7be7[_0xc1a3('0x27')],'name':_0x1b7be7[_0xc1a3('0x70')],'custom':_[_0xc1a3('0x71')](_0x1b7be7['name'],'_c')?!![]:![],'options':_0x1b7be7[_0xc1a3('0x3d')]?_[_0xc1a3('0x29')](_['values'](_0x1b7be7[_0xc1a3('0x3d')]),function(_0x4f9129){return{'name':_0x4f9129[_0xc1a3('0x72')],'value':_0x4f9129[_0xc1a3('0x27')]};}):[]};})};}})[_0xc1a3('0x23')](respondWithResult(_0x252cdb,null))['catch'](function(_0x368ffb){var _0x49a757=_0x42d5d2[_0xc1a3('0x33')][_0xc1a3('0x73')]?0x1f4:_0x368ffb[_0xc1a3('0x74')]||0x1f4;logger[_0xc1a3('0x25')](_0xc1a3('0x75'),_0xc1a3('0x76'),_0x49a757,JSON[_0xc1a3('0x65')](_0x368ffb));delete _0x368ffb[_0xc1a3('0x27')];if(_0x49a757===0x191){_0x49a757=0x190;}_0x252cdb[_0xc1a3('0x19')](_0x49a757)[_0xc1a3('0x77')](_0x42d5d2[_0xc1a3('0x33')]['test']?{'message':_0xc1a3('0x78'),'statusCode':_0x368ffb[_0xc1a3('0x74')]}:_0x368ffb);});}else{var _0x583b95=0x1f4;_0x252cdb['status'](_0x583b95)[_0xc1a3('0x77')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index be1a237..9472157 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc2d=['SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x1340fd,_0xb32df6){var _0x45b191=function(_0x2d03b0){while(--_0x2d03b0){_0x1340fd['push'](_0x1340fd['shift']());}};_0x45b191(++_0xb32df6);}(_0xbc2d,0x1c4));var _0xdbc2=function(_0x2fd681,_0x970d7){_0x2fd681=_0x2fd681-0x0;var _0x2b6c89=_0xbc2d[_0x2fd681];return _0x2b6c89;};'use strict';var _=require('lodash');var util=require(_0xdbc2('0x0'));var logger=require(_0xdbc2('0x1'))('api');var moment=require('moment');var BPromise=require(_0xdbc2('0x2'));var rp=require(_0xdbc2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdbc2('0x4'));var config=require(_0xdbc2('0x5'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xdbc2('0x6')]=function(_0x14e396,_0x29b3cf){return _0x14e396[_0xdbc2('0x7')](_0xdbc2('0x8'),attributes,{'tableName':_0xdbc2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb2c=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x31a188,_0x160a0d){var _0xee44b5=function(_0x49e5ae){while(--_0x49e5ae){_0x31a188['push'](_0x31a188['shift']());}};_0xee44b5(++_0x160a0d);}(_0xcb2c,0x17a));var _0xccb2=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xcb2c[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0xccb2('0x0'));var util=require(_0xccb2('0x1'));var logger=require(_0xccb2('0x2'))(_0xccb2('0x3'));var moment=require(_0xccb2('0x4'));var BPromise=require('bluebird');var rp=require(_0xccb2('0x5'));var fs=require('fs');var path=require(_0xccb2('0x6'));var rimraf=require(_0xccb2('0x7'));var config=require(_0xccb2('0x8'));var attributes=require(_0xccb2('0x9'));var integrations=require(_0xccb2('0xa'));module['exports']=function(_0x59d154,_0x3e078d){return _0x59d154[_0xccb2('0xb')](_0xccb2('0xc'),attributes,{'tableName':_0xccb2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 7a31063..ead3d6f 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc60a=['findAll','options','raw','where','attributes','limit','map','include','model','ShowSugarcrmAccount','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmAccount,\x20%s,\x20%s','result','catch','GetSugarcrmAccount','SugarcrmAccount'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xc60a,0xc9));var _0xac60=function(_0x3090a4,_0x2a4438){_0x3090a4=_0x3090a4-0x0;var _0x3a548=_0xc60a[_0x3090a4];return _0x3a548;};'use strict';var _=require(_0xac60('0x0'));var util=require(_0xac60('0x1'));var moment=require('moment');var BPromise=require(_0xac60('0x2'));var rs=require(_0xac60('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac60('0x4'))['db'];var utils=require(_0xac60('0x5'));var logger=require(_0xac60('0x6'))(_0xac60('0x7'));var config=require(_0xac60('0x8'));var jayson=require(_0xac60('0x9'));var client=jayson[_0xac60('0xa')][_0xac60('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb263dc,_0x14e8a7,_0x4ea4ae){return new BPromise(function(_0x353c25,_0x2ac405){return client[_0xac60('0xc')](_0xb263dc,_0x4ea4ae)[_0xac60('0xd')](function(_0x159691){logger[_0xac60('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x14e8a7,_0xac60('0xf'));logger[_0xac60('0x10')](_0xac60('0x11'),_0x14e8a7,_0xac60('0xf'),JSON[_0xac60('0x12')](_0x159691));if(_0x159691[_0xac60('0x13')]){if(_0x159691[_0xac60('0x13')][_0xac60('0x14')]===0x1f4){logger[_0xac60('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x14e8a7,_0x159691[_0xac60('0x13')][_0xac60('0x15')]);return _0x2ac405(_0x159691[_0xac60('0x13')]['message']);}logger[_0xac60('0x13')](_0xac60('0x16'),_0x14e8a7,_0x159691[_0xac60('0x13')]['message']);return _0x353c25(_0x159691['error'][_0xac60('0x15')]);}else{logger[_0xac60('0xe')](_0xac60('0x16'),_0x14e8a7,_0xac60('0xf'));_0x353c25(_0x159691[_0xac60('0x17')][_0xac60('0x15')]);}})[_0xac60('0x18')](function(_0x1b2544){logger['error'](_0xac60('0x16'),_0x14e8a7,_0x1b2544);_0x2ac405(_0x1b2544);});});}exports[_0xac60('0x19')]=function(_0x1cec53){var _0x1aa10e=this;return new Promise(function(_0x153d43,_0x53e8bf){return db[_0xac60('0x1a')][_0xac60('0x1b')]({'raw':_0x1cec53[_0xac60('0x1c')]?_0x1cec53['options'][_0xac60('0x1d')]===undefined?!![]:![]:!![],'where':_0x1cec53[_0xac60('0x1c')]?_0x1cec53[_0xac60('0x1c')][_0xac60('0x1e')]||null:null,'attributes':_0x1cec53[_0xac60('0x1c')]?_0x1cec53[_0xac60('0x1c')][_0xac60('0x1f')]||null:null,'limit':_0x1cec53[_0xac60('0x1c')]?_0x1cec53[_0xac60('0x1c')][_0xac60('0x20')]||null:null,'include':_0x1cec53['options']?_0x1cec53[_0xac60('0x1c')]['include']?_[_0xac60('0x21')](_0x1cec53[_0xac60('0x1c')][_0xac60('0x22')],function(_0x1f4def){return{'model':db[_0x1f4def[_0xac60('0x23')]],'as':_0x1f4def['as'],'attributes':_0x1f4def[_0xac60('0x1f')],'include':_0x1f4def[_0xac60('0x22')]?_[_0xac60('0x21')](_0x1f4def[_0xac60('0x22')],function(_0x229b64){return{'model':db[_0x229b64['model']],'as':_0x229b64['as'],'attributes':_0x229b64[_0xac60('0x1f')],'include':_0x229b64['include']?_[_0xac60('0x21')](_0x229b64['include'],function(_0x7173ca){return{'model':db[_0x7173ca['model']],'as':_0x7173ca['as'],'attributes':_0x7173ca['attributes']};}):[]};}):[]};}):[]:[]})[_0xac60('0xd')](function(_0x340a6a){logger[_0xac60('0xe')](_0xac60('0x19'),_0x1cec53);logger[_0xac60('0x10')](_0xac60('0x19'),_0x1cec53,JSON['stringify'](_0x340a6a));_0x153d43(_0x340a6a);})['catch'](function(_0x1158e9){logger[_0xac60('0x13')]('GetSugarcrmAccount',_0x1158e9[_0xac60('0x15')],_0x1cec53);_0x53e8bf(_0x1aa10e['error'](0x1f4,_0x1158e9['message']));});});};exports[_0xac60('0x24')]=function(_0x5cdf23){var _0x3d60f8=this;return new Promise(function(_0x3ee635,_0x3ba86b){return db[_0xac60('0x1a')][_0xac60('0x25')]({'raw':_0x5cdf23[_0xac60('0x1c')]?_0x5cdf23[_0xac60('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5cdf23[_0xac60('0x1c')]?_0x5cdf23[_0xac60('0x1c')][_0xac60('0x1e')]||null:null,'attributes':_0x5cdf23[_0xac60('0x1c')]?_0x5cdf23[_0xac60('0x1c')]['attributes']||null:null,'include':_0x5cdf23[_0xac60('0x1c')]?_0x5cdf23[_0xac60('0x1c')][_0xac60('0x22')]?_[_0xac60('0x21')](_0x5cdf23['options'][_0xac60('0x22')],function(_0x1cbfb3){return{'model':db[_0x1cbfb3['model']],'as':_0x1cbfb3['as'],'attributes':_0x1cbfb3[_0xac60('0x1f')],'include':_0x1cbfb3['include']?_[_0xac60('0x21')](_0x1cbfb3['include'],function(_0x2fe933){return{'model':db[_0x2fe933['model']],'as':_0x2fe933['as'],'attributes':_0x2fe933[_0xac60('0x1f')],'include':_0x2fe933['include']?_['map'](_0x2fe933[_0xac60('0x22')],function(_0xea5936){return{'model':db[_0xea5936[_0xac60('0x23')]],'as':_0xea5936['as'],'attributes':_0xea5936[_0xac60('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xac60('0xd')](function(_0x28d432){logger['info']('ShowSugarcrmAccount',_0x5cdf23);logger[_0xac60('0x10')](_0xac60('0x24'),_0x5cdf23,JSON[_0xac60('0x12')](_0x28d432));_0x3ee635(_0x28d432);})[_0xac60('0x18')](function(_0x22e4f4){logger[_0xac60('0x13')]('ShowSugarcrmAccount',_0x22e4f4[_0xac60('0x15')],_0x5cdf23);_0x3ba86b(_0x3d60f8[_0xac60('0x13')](0x1f4,_0x22e4f4['message']));});});}; \ No newline at end of file +var _0xaa28=['find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SugarcrmAccount','findAll','options','where','attributes','include','map','model','GetSugarcrmAccount','stringify','ShowSugarcrmAccount'];(function(_0x345c43,_0x1b6e72){var _0x3cbd1a=function(_0x5e194d){while(--_0x5e194d){_0x345c43['push'](_0x345c43['shift']());}};_0x3cbd1a(++_0x1b6e72);}(_0xaa28,0x160));var _0x8aa2=function(_0x172ed7,_0x3d08fd){_0x172ed7=_0x172ed7-0x0;var _0xfa8f61=_0xaa28[_0x172ed7];return _0xfa8f61;};'use strict';var _=require('lodash');var util=require(_0x8aa2('0x0'));var moment=require(_0x8aa2('0x1'));var BPromise=require(_0x8aa2('0x2'));var rs=require(_0x8aa2('0x3'));var fs=require('fs');var Redis=require(_0x8aa2('0x4'));var db=require(_0x8aa2('0x5'))['db'];var utils=require(_0x8aa2('0x6'));var logger=require(_0x8aa2('0x7'))(_0x8aa2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8aa2('0x9'));var client=jayson[_0x8aa2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7cbc98,_0x2c0b08,_0x1646b6){return new BPromise(function(_0x26b42f,_0x2a945c){return client['request'](_0x7cbc98,_0x1646b6)[_0x8aa2('0xb')](function(_0x110bfa){logger[_0x8aa2('0xc')](_0x8aa2('0xd'),_0x2c0b08,_0x8aa2('0xe'));logger[_0x8aa2('0xf')](_0x8aa2('0x10'),_0x2c0b08,_0x8aa2('0xe'),JSON['stringify'](_0x110bfa));if(_0x110bfa[_0x8aa2('0x11')]){if(_0x110bfa[_0x8aa2('0x11')][_0x8aa2('0x12')]===0x1f4){logger[_0x8aa2('0x11')](_0x8aa2('0xd'),_0x2c0b08,_0x110bfa['error']['message']);return _0x2a945c(_0x110bfa['error'][_0x8aa2('0x13')]);}logger[_0x8aa2('0x11')](_0x8aa2('0xd'),_0x2c0b08,_0x110bfa[_0x8aa2('0x11')]['message']);return _0x26b42f(_0x110bfa[_0x8aa2('0x11')][_0x8aa2('0x13')]);}else{logger['info'](_0x8aa2('0xd'),_0x2c0b08,_0x8aa2('0xe'));_0x26b42f(_0x110bfa[_0x8aa2('0x14')]['message']);}})[_0x8aa2('0x15')](function(_0x11f8ff){logger[_0x8aa2('0x11')](_0x8aa2('0xd'),_0x2c0b08,_0x11f8ff);_0x2a945c(_0x11f8ff);});});}exports['GetSugarcrmAccount']=function(_0x1ed7f8){var _0x36ca2d=this;return new Promise(function(_0x5c1a46,_0x53be5d){return db[_0x8aa2('0x16')][_0x8aa2('0x17')]({'raw':_0x1ed7f8[_0x8aa2('0x18')]?_0x1ed7f8[_0x8aa2('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1ed7f8[_0x8aa2('0x18')]?_0x1ed7f8[_0x8aa2('0x18')][_0x8aa2('0x19')]||null:null,'attributes':_0x1ed7f8['options']?_0x1ed7f8[_0x8aa2('0x18')][_0x8aa2('0x1a')]||null:null,'limit':_0x1ed7f8['options']?_0x1ed7f8[_0x8aa2('0x18')]['limit']||null:null,'include':_0x1ed7f8[_0x8aa2('0x18')]?_0x1ed7f8[_0x8aa2('0x18')][_0x8aa2('0x1b')]?_[_0x8aa2('0x1c')](_0x1ed7f8[_0x8aa2('0x18')][_0x8aa2('0x1b')],function(_0x5f400f){return{'model':db[_0x5f400f[_0x8aa2('0x1d')]],'as':_0x5f400f['as'],'attributes':_0x5f400f[_0x8aa2('0x1a')],'include':_0x5f400f[_0x8aa2('0x1b')]?_[_0x8aa2('0x1c')](_0x5f400f['include'],function(_0x3856e7){return{'model':db[_0x3856e7['model']],'as':_0x3856e7['as'],'attributes':_0x3856e7['attributes'],'include':_0x3856e7[_0x8aa2('0x1b')]?_[_0x8aa2('0x1c')](_0x3856e7[_0x8aa2('0x1b')],function(_0x3f6548){return{'model':db[_0x3f6548['model']],'as':_0x3f6548['as'],'attributes':_0x3f6548[_0x8aa2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8aa2('0xb')](function(_0xdfb646){logger['info'](_0x8aa2('0x1e'),_0x1ed7f8);logger[_0x8aa2('0xf')](_0x8aa2('0x1e'),_0x1ed7f8,JSON[_0x8aa2('0x1f')](_0xdfb646));_0x5c1a46(_0xdfb646);})[_0x8aa2('0x15')](function(_0x1782b0){logger[_0x8aa2('0x11')](_0x8aa2('0x1e'),_0x1782b0[_0x8aa2('0x13')],_0x1ed7f8);_0x53be5d(_0x36ca2d[_0x8aa2('0x11')](0x1f4,_0x1782b0['message']));});});};exports[_0x8aa2('0x20')]=function(_0x4cb4b0){var _0x67c008=this;return new Promise(function(_0x1c392b,_0x581726){return db[_0x8aa2('0x16')][_0x8aa2('0x21')]({'raw':_0x4cb4b0[_0x8aa2('0x18')]?_0x4cb4b0[_0x8aa2('0x18')][_0x8aa2('0x22')]===undefined?!![]:![]:!![],'where':_0x4cb4b0[_0x8aa2('0x18')]?_0x4cb4b0[_0x8aa2('0x18')][_0x8aa2('0x19')]||null:null,'attributes':_0x4cb4b0[_0x8aa2('0x18')]?_0x4cb4b0['options'][_0x8aa2('0x1a')]||null:null,'include':_0x4cb4b0['options']?_0x4cb4b0[_0x8aa2('0x18')][_0x8aa2('0x1b')]?_[_0x8aa2('0x1c')](_0x4cb4b0['options'][_0x8aa2('0x1b')],function(_0x228044){return{'model':db[_0x228044[_0x8aa2('0x1d')]],'as':_0x228044['as'],'attributes':_0x228044[_0x8aa2('0x1a')],'include':_0x228044[_0x8aa2('0x1b')]?_[_0x8aa2('0x1c')](_0x228044[_0x8aa2('0x1b')],function(_0x1e6ee0){return{'model':db[_0x1e6ee0[_0x8aa2('0x1d')]],'as':_0x1e6ee0['as'],'attributes':_0x1e6ee0[_0x8aa2('0x1a')],'include':_0x1e6ee0[_0x8aa2('0x1b')]?_[_0x8aa2('0x1c')](_0x1e6ee0[_0x8aa2('0x1b')],function(_0x47aa3a){return{'model':db[_0x47aa3a[_0x8aa2('0x1d')]],'as':_0x47aa3a['as'],'attributes':_0x47aa3a[_0x8aa2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8aa2('0xb')](function(_0x1621a3){logger[_0x8aa2('0xc')](_0x8aa2('0x20'),_0x4cb4b0);logger[_0x8aa2('0xf')](_0x8aa2('0x20'),_0x4cb4b0,JSON[_0x8aa2('0x1f')](_0x1621a3));_0x1c392b(_0x1621a3);})['catch'](function(_0x492846){logger['error'](_0x8aa2('0x20'),_0x492846['message'],_0x4cb4b0);_0x581726(_0x67c008[_0x8aa2('0x11')](0x1f4,_0x492846[_0x8aa2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 64dda4e..134fb8e 100644 --- a/server/api/intSugarcrmConfiguration/index.js +++ b/server/api/intSugarcrmConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5403=['getDescriptions','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions'];(function(_0x54bcfc,_0x4309e2){var _0x4ed9f8=function(_0x2075e1){while(--_0x2075e1){_0x54bcfc['push'](_0x54bcfc['shift']());}};_0x4ed9f8(++_0x4309e2);}(_0x5403,0x1ea));var _0x3540=function(_0xa17a0c,_0x5b96fd){_0xa17a0c=_0xa17a0c-0x0;var _0x3e2a9b=_0x5403[_0xa17a0c];return _0x3e2a9b;};'use strict';var multer=require(_0x3540('0x0'));var util=require(_0x3540('0x1'));var path=require(_0x3540('0x2'));var timeout=require(_0x3540('0x3'));var express=require('express');var router=express[_0x3540('0x4')]();var fs_extra=require(_0x3540('0x5'));var auth=require(_0x3540('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3540('0x7'));router[_0x3540('0x8')]('/',auth[_0x3540('0x9')](),controller['index']);router[_0x3540('0x8')](_0x3540('0xa'),auth[_0x3540('0x9')](),controller[_0x3540('0xb')]);router[_0x3540('0x8')](_0x3540('0xc'),auth[_0x3540('0x9')](),controller[_0x3540('0xd')]);router[_0x3540('0x8')](_0x3540('0xe'),auth[_0x3540('0x9')](),controller['getSubjects']);router[_0x3540('0x8')](_0x3540('0xf'),auth[_0x3540('0x9')](),controller[_0x3540('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3540('0x11')]);router['put'](_0x3540('0xa'),auth[_0x3540('0x9')](),controller[_0x3540('0x12')]);router[_0x3540('0x13')](_0x3540('0xa'),auth[_0x3540('0x9')](),controller[_0x3540('0x14')]);module[_0x3540('0x15')]=router; \ No newline at end of file +var _0x4fe6=['put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create'];(function(_0x20031a,_0x57c05a){var _0x3d6902=function(_0x2c90bd){while(--_0x2c90bd){_0x20031a['push'](_0x20031a['shift']());}};_0x3d6902(++_0x57c05a);}(_0x4fe6,0x149));var _0x64fe=function(_0x3270f9,_0x407457){_0x3270f9=_0x3270f9-0x0;var _0x26006d=_0x4fe6[_0x3270f9];return _0x26006d;};'use strict';var multer=require('multer');var util=require(_0x64fe('0x0'));var path=require(_0x64fe('0x1'));var timeout=require(_0x64fe('0x2'));var express=require(_0x64fe('0x3'));var router=express[_0x64fe('0x4')]();var fs_extra=require(_0x64fe('0x5'));var auth=require(_0x64fe('0x6'));var interaction=require(_0x64fe('0x7'));var config=require(_0x64fe('0x8'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x64fe('0x9')]('/',auth[_0x64fe('0xa')](),controller[_0x64fe('0xb')]);router[_0x64fe('0x9')](_0x64fe('0xc'),auth[_0x64fe('0xa')](),controller[_0x64fe('0xd')]);router[_0x64fe('0x9')](_0x64fe('0xe'),auth['isAuthenticated'](),controller[_0x64fe('0xf')]);router['get'](_0x64fe('0x10'),auth[_0x64fe('0xa')](),controller[_0x64fe('0x11')]);router['get'](_0x64fe('0x12'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x64fe('0x13')]('/',auth[_0x64fe('0xa')](),controller[_0x64fe('0x14')]);router[_0x64fe('0x15')](_0x64fe('0xc'),auth[_0x64fe('0xa')](),controller['update']);router[_0x64fe('0x16')](_0x64fe('0xc'),auth[_0x64fe('0xa')](),controller[_0x64fe('0x17')]);module[_0x64fe('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 7e7d46b..1c1de77 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f03=['STRING','sequelize'];(function(_0xe6e78c,_0x582369){var _0x2a09c8=function(_0x470ccc){while(--_0x470ccc){_0xe6e78c['push'](_0xe6e78c['shift']());}};_0x2a09c8(++_0x582369);}(_0x8f03,0x165));var _0x38f0=function(_0xb5a041,_0x394f01){_0xb5a041=_0xb5a041-0x0;var _0x187974=_0x8f03[_0xb5a041];return _0x187974;};'use strict';var Sequelize=require(_0x38f0('0x0'));module['exports']={'name':{'type':Sequelize[_0x38f0('0x1')]},'description':{'type':Sequelize[_0x38f0('0x1')]}}; \ No newline at end of file +var _0xc87b=['exports','STRING','sequelize'];(function(_0x1ae69b,_0x3586e9){var _0x21383d=function(_0x1d4e2b){while(--_0x1d4e2b){_0x1ae69b['push'](_0x1ae69b['shift']());}};_0x21383d(++_0x3586e9);}(_0xc87b,0x161));var _0xbc87=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xc87b[_0x543084];return _0x306a57;};'use strict';var Sequelize=require(_0xbc87('0x0'));module[_0xbc87('0x1')]={'name':{'type':Sequelize[_0xbc87('0x2')]},'description':{'type':Sequelize[_0xbc87('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index bf2ab45..ca96047 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb75=['params','SugarcrmField','getSubjects','findOne','getDescriptions','eml-format','rimraf','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','getFields'];(function(_0x6059ed,_0x8ea3d2){var _0x5824ff=function(_0x18430d){while(--_0x18430d){_0x6059ed['push'](_0x6059ed['shift']());}};_0x5824ff(++_0x8ea3d2);}(_0xfb75,0x10a));var _0x5fb7=function(_0x209a55,_0x41429f){_0x209a55=_0x209a55-0x0;var _0x219f1a=_0xfb75[_0x209a55];return _0x219f1a;};'use strict';var emlformat=require(_0x5fb7('0x0'));var rimraf=require(_0x5fb7('0x1'));var zipdir=require(_0x5fb7('0x2'));var jsonpatch=require(_0x5fb7('0x3'));var rp=require(_0x5fb7('0x4'));var moment=require(_0x5fb7('0x5'));var BPromise=require(_0x5fb7('0x6'));var Mustache=require(_0x5fb7('0x7'));var util=require(_0x5fb7('0x8'));var path=require('path');var sox=require(_0x5fb7('0x9'));var csv=require(_0x5fb7('0xa'));var ejs=require(_0x5fb7('0xb'));var fs=require('fs');var fs_extra=require(_0x5fb7('0xc'));var _=require(_0x5fb7('0xd'));var squel=require(_0x5fb7('0xe'));var crypto=require(_0x5fb7('0xf'));var jsforce=require(_0x5fb7('0x10'));var deskjs=require(_0x5fb7('0x11'));var toCsv=require(_0x5fb7('0xa'));var querystring=require(_0x5fb7('0x12'));var Papa=require(_0x5fb7('0x13'));var Redis=require(_0x5fb7('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x5fb7('0x15'));var as=require(_0x5fb7('0x16'));var hardwareService=require(_0x5fb7('0x17'));var logger=require(_0x5fb7('0x18'))(_0x5fb7('0x19'));var utils=require(_0x5fb7('0x1a'));var config=require(_0x5fb7('0x1b'));var licenseUtil=require(_0x5fb7('0x1c'));var db=require(_0x5fb7('0x1d'))['db'];function respondWithStatusCode(_0x1be3aa,_0x27f5d4){_0x27f5d4=_0x27f5d4||0xcc;return function(_0x466dd6){if(_0x466dd6){return _0x1be3aa[_0x5fb7('0x1e')](_0x27f5d4);}return _0x1be3aa[_0x5fb7('0x1f')](_0x27f5d4)[_0x5fb7('0x20')]();};}function respondWithResult(_0x482ce9,_0x232a79){_0x232a79=_0x232a79||0xc8;return function(_0x2bfd4a){if(_0x2bfd4a){return _0x482ce9[_0x5fb7('0x1f')](_0x232a79)[_0x5fb7('0x21')](_0x2bfd4a);}};}function respondWithFilteredResult(_0x4ea6f0,_0x316667){return function(_0x1cfbac){if(_0x1cfbac){var _0x5a85b2=typeof _0x316667[_0x5fb7('0x22')]===_0x5fb7('0x23')&&typeof _0x316667[_0x5fb7('0x24')]===_0x5fb7('0x23');var _0x5670d7=_0x1cfbac[_0x5fb7('0x25')];var _0x5ac87c=_0x5a85b2?0x0:_0x316667[_0x5fb7('0x22')];var _0xec8084=_0x5a85b2?_0x1cfbac[_0x5fb7('0x25')]:_0x316667['offset']+_0x316667[_0x5fb7('0x24')];var _0x5a73b2;if(_0xec8084>=_0x5670d7){_0xec8084=_0x5670d7;_0x5a73b2=0xc8;}else{_0x5a73b2=0xce;}_0x4ea6f0[_0x5fb7('0x1f')](_0x5a73b2);return _0x4ea6f0[_0x5fb7('0x26')](_0x5fb7('0x27'),_0x5ac87c+'-'+_0xec8084+'/'+_0x5670d7)[_0x5fb7('0x21')](_0x1cfbac);}return null;};}function patchUpdates(_0xd41526){return function(_0x17ce95){try{jsonpatch[_0x5fb7('0x28')](_0x17ce95,_0xd41526,!![]);}catch(_0x539e9b){return BPromise[_0x5fb7('0x29')](_0x539e9b);}return _0x17ce95[_0x5fb7('0x2a')]();};}function saveUpdates(_0x3c189c,_0x52c95f){return function(_0x29da7d){if(_0x29da7d){return _0x29da7d[_0x5fb7('0x2b')](_0x3c189c)['then'](function(_0x545fa8){return _0x545fa8;});}return null;};}function removeEntity(_0x3b1661,_0x44fbfe){return function(_0x3a533a){if(_0x3a533a){return _0x3a533a[_0x5fb7('0x2c')]()[_0x5fb7('0x2d')](function(){_0x3b1661[_0x5fb7('0x1f')](0xcc)[_0x5fb7('0x20')]();});}};}function handleEntityNotFound(_0x394ba8,_0x56c86f){return function(_0x2fff35){if(!_0x2fff35){_0x394ba8[_0x5fb7('0x1e')](0x194);}return _0x2fff35;};}function handleError(_0x527813,_0x3a1a63){_0x3a1a63=_0x3a1a63||0x1f4;return function(_0x2846eb){logger[_0x5fb7('0x2e')](_0x2846eb['stack']);if(_0x2846eb[_0x5fb7('0x2f')]){delete _0x2846eb['name'];}_0x527813[_0x5fb7('0x1f')](_0x3a1a63)['send'](_0x2846eb);};}exports[_0x5fb7('0x30')]=function(_0x549cbb,_0x5923a2){var _0x558dd0={},_0x568673={},_0x2d560d={'count':0x0,'rows':[]};var _0xfc8ab9=_[_0x5fb7('0x31')](db[_0x5fb7('0x32')][_0x5fb7('0x33')],function(_0x38089f){return{'name':_0x38089f[_0x5fb7('0x34')],'type':_0x38089f[_0x5fb7('0x35')][_0x5fb7('0x36')]};});_0x568673[_0x5fb7('0x37')]=_['map'](_0xfc8ab9,_0x5fb7('0x2f'));_0x568673[_0x5fb7('0x38')]=_[_0x5fb7('0x39')](_0x549cbb['query']);_0x568673[_0x5fb7('0x3a')]=_[_0x5fb7('0x3b')](_0x568673[_0x5fb7('0x37')],_0x568673[_0x5fb7('0x38')]);_0x558dd0[_0x5fb7('0x3c')]=_['intersection'](_0x568673[_0x5fb7('0x37')],qs[_0x5fb7('0x3d')](_0x549cbb[_0x5fb7('0x38')][_0x5fb7('0x3d')]));_0x558dd0[_0x5fb7('0x3c')]=_0x558dd0[_0x5fb7('0x3c')][_0x5fb7('0x3e')]?_0x558dd0['attributes']:_0x568673['model'];if(!_0x549cbb['query'][_0x5fb7('0x3f')](_0x5fb7('0x40'))){_0x558dd0[_0x5fb7('0x24')]=qs['limit'](_0x549cbb[_0x5fb7('0x38')][_0x5fb7('0x24')]);_0x558dd0['offset']=qs['offset'](_0x549cbb[_0x5fb7('0x38')]['offset']);}_0x558dd0[_0x5fb7('0x41')]=qs[_0x5fb7('0x42')](_0x549cbb[_0x5fb7('0x38')][_0x5fb7('0x42')]);_0x558dd0[_0x5fb7('0x43')]=qs['filters'](_[_0x5fb7('0x44')](_0x549cbb[_0x5fb7('0x38')],_0x568673[_0x5fb7('0x3a')]),_0xfc8ab9);if(_0x549cbb[_0x5fb7('0x38')][_0x5fb7('0x45')]){_0x558dd0[_0x5fb7('0x43')]=_[_0x5fb7('0x46')](_0x558dd0[_0x5fb7('0x43')],{'$or':_['map'](_0xfc8ab9,function(_0x4cecce){if(_0x4cecce[_0x5fb7('0x35')]!=='VIRTUAL'){var _0x1cf07b={};_0x1cf07b[_0x4cecce['name']]={'$like':'%'+_0x549cbb[_0x5fb7('0x38')]['filter']+'%'};return _0x1cf07b;}})});}_0x558dd0=_[_0x5fb7('0x46')]({},_0x558dd0,_0x549cbb[_0x5fb7('0x47')]);var _0x5d1d4e={'where':_0x558dd0[_0x5fb7('0x43')]};return db[_0x5fb7('0x32')]['count'](_0x5d1d4e)[_0x5fb7('0x2d')](function(_0x347926){_0x2d560d[_0x5fb7('0x25')]=_0x347926;if(_0x549cbb[_0x5fb7('0x38')]['includeAll']){_0x558dd0[_0x5fb7('0x48')]=[{'all':!![]}];}return db[_0x5fb7('0x32')][_0x5fb7('0x49')](_0x558dd0);})[_0x5fb7('0x2d')](function(_0x7fcdeb){_0x2d560d[_0x5fb7('0x4a')]=_0x7fcdeb;return _0x2d560d;})[_0x5fb7('0x2d')](respondWithFilteredResult(_0x5923a2,_0x558dd0))[_0x5fb7('0x4b')](handleError(_0x5923a2,null));};exports[_0x5fb7('0x4c')]=function(_0x255227,_0x24d469){var _0x142d17={'raw':![],'where':{'id':_0x255227['params']['id']}},_0x32fbe5={};_0x32fbe5[_0x5fb7('0x37')]=_[_0x5fb7('0x39')](db[_0x5fb7('0x32')]['rawAttributes']);_0x32fbe5[_0x5fb7('0x38')]=_['keys'](_0x255227['query']);_0x32fbe5['filters']=_[_0x5fb7('0x3b')](_0x32fbe5[_0x5fb7('0x37')],_0x32fbe5[_0x5fb7('0x38')]);_0x142d17['attributes']=_[_0x5fb7('0x3b')](_0x32fbe5[_0x5fb7('0x37')],qs[_0x5fb7('0x3d')](_0x255227[_0x5fb7('0x38')]['fields']));_0x142d17[_0x5fb7('0x3c')]=_0x142d17[_0x5fb7('0x3c')][_0x5fb7('0x3e')]?_0x142d17[_0x5fb7('0x3c')]:_0x32fbe5[_0x5fb7('0x37')];if(_0x255227['query'][_0x5fb7('0x4d')]){_0x142d17[_0x5fb7('0x48')]=[{'all':!![]}];}_0x142d17=_[_0x5fb7('0x46')]({},_0x142d17,_0x255227['options']);return db['SugarcrmConfiguration'][_0x5fb7('0x4e')](_0x142d17)['then'](handleEntityNotFound(_0x24d469,null))[_0x5fb7('0x2d')](respondWithResult(_0x24d469,null))[_0x5fb7('0x4b')](handleError(_0x24d469,null));};exports['create']=function(_0x34fb85,_0xed8724){return db[_0x5fb7('0x32')][_0x5fb7('0x4f')](_0x34fb85[_0x5fb7('0x50')],{})[_0x5fb7('0x2d')](respondWithResult(_0xed8724,0xc9))[_0x5fb7('0x4b')](handleError(_0xed8724,null));};exports[_0x5fb7('0x2b')]=function(_0x5ece3e,_0x3f21ae){if(_0x5ece3e['body']['id']){delete _0x5ece3e[_0x5fb7('0x50')]['id'];}return db[_0x5fb7('0x32')][_0x5fb7('0x4e')]({'where':{'id':_0x5ece3e['params']['id']}})[_0x5fb7('0x2d')](handleEntityNotFound(_0x3f21ae,null))[_0x5fb7('0x2d')](saveUpdates(_0x5ece3e[_0x5fb7('0x50')],null))['then'](respondWithResult(_0x3f21ae,null))[_0x5fb7('0x4b')](handleError(_0x3f21ae,null));};exports[_0x5fb7('0x2c')]=function(_0x1d964b,_0x392fdd){return db['SugarcrmConfiguration'][_0x5fb7('0x4e')]({'where':{'id':_0x1d964b['params']['id']}})['then'](handleEntityNotFound(_0x392fdd,null))[_0x5fb7('0x2d')](removeEntity(_0x392fdd,null))[_0x5fb7('0x4b')](handleError(_0x392fdd,null));};exports[_0x5fb7('0x51')]=function(_0x5c2927,_0x5addf5,_0x65d489){var _0x1f04a4={};var _0x27b8de={};var _0x47f85b;var _0x14b478;return db[_0x5fb7('0x32')]['findOne']({'where':{'id':_0x5c2927[_0x5fb7('0x52')]['id']}})[_0x5fb7('0x2d')](handleEntityNotFound(_0x5addf5,null))[_0x5fb7('0x2d')](function(_0x27582c){if(_0x27582c){_0x47f85b=_0x27582c;_0x27b8de['model']=_[_0x5fb7('0x39')](db[_0x5fb7('0x53')]['rawAttributes']);_0x27b8de[_0x5fb7('0x38')]=_[_0x5fb7('0x39')](_0x5c2927[_0x5fb7('0x38')]);_0x27b8de[_0x5fb7('0x3a')]=_[_0x5fb7('0x3b')](_0x27b8de[_0x5fb7('0x37')],_0x27b8de['query']);_0x1f04a4[_0x5fb7('0x3c')]=_[_0x5fb7('0x3b')](_0x27b8de[_0x5fb7('0x37')],qs['fields'](_0x5c2927[_0x5fb7('0x38')][_0x5fb7('0x3d')]));_0x1f04a4['attributes']=_0x1f04a4[_0x5fb7('0x3c')][_0x5fb7('0x3e')]?_0x1f04a4['attributes']:_0x27b8de[_0x5fb7('0x37')];_0x1f04a4[_0x5fb7('0x41')]=qs[_0x5fb7('0x42')](_0x5c2927['query'][_0x5fb7('0x42')]);_0x1f04a4[_0x5fb7('0x43')]=qs[_0x5fb7('0x3a')](_['pick'](_0x5c2927[_0x5fb7('0x38')],_0x27b8de[_0x5fb7('0x3a')]));if(_0x5c2927[_0x5fb7('0x38')][_0x5fb7('0x45')]){_0x1f04a4[_0x5fb7('0x43')]=_['merge'](_0x1f04a4[_0x5fb7('0x43')],{'$or':_['map'](_0x1f04a4['attributes'],function(_0x33ca5f){var _0x312437={};_0x312437[_0x33ca5f]={'$like':'%'+_0x5c2927[_0x5fb7('0x38')][_0x5fb7('0x45')]+'%'};return _0x312437;})});}_0x1f04a4=_[_0x5fb7('0x46')]({},_0x1f04a4,_0x5c2927[_0x5fb7('0x47')]);return _0x47f85b[_0x5fb7('0x51')](_0x1f04a4);}})[_0x5fb7('0x2d')](function(_0xc70b4c){if(_0xc70b4c){_0x14b478=_0xc70b4c['length'];if(!_0x5c2927[_0x5fb7('0x38')]['hasOwnProperty']('nolimit')){_0x1f04a4['limit']=qs[_0x5fb7('0x24')](_0x5c2927['query'][_0x5fb7('0x24')]);_0x1f04a4[_0x5fb7('0x22')]=qs[_0x5fb7('0x22')](_0x5c2927[_0x5fb7('0x38')][_0x5fb7('0x22')]);}return _0x47f85b[_0x5fb7('0x51')](_0x1f04a4);}})[_0x5fb7('0x2d')](function(_0x319b91){if(_0x319b91){return _0x319b91?{'count':_0x14b478,'rows':_0x319b91}:null;}})[_0x5fb7('0x2d')](respondWithResult(_0x5addf5,null))[_0x5fb7('0x4b')](handleError(_0x5addf5,null));};exports[_0x5fb7('0x54')]=function(_0x5080b9,_0x34b292,_0x23c479){var _0x1f6095={};var _0x543e42={};var _0x872d4a;var _0x26b315;return db[_0x5fb7('0x32')][_0x5fb7('0x55')]({'where':{'id':_0x5080b9['params']['id']}})[_0x5fb7('0x2d')](handleEntityNotFound(_0x34b292,null))['then'](function(_0xec29ab){if(_0xec29ab){_0x872d4a=_0xec29ab;_0x543e42[_0x5fb7('0x37')]=_['keys'](db[_0x5fb7('0x53')][_0x5fb7('0x33')]);_0x543e42[_0x5fb7('0x38')]=_[_0x5fb7('0x39')](_0x5080b9[_0x5fb7('0x38')]);_0x543e42['filters']=_[_0x5fb7('0x3b')](_0x543e42['model'],_0x543e42['query']);_0x1f6095[_0x5fb7('0x3c')]=_['intersection'](_0x543e42[_0x5fb7('0x37')],qs[_0x5fb7('0x3d')](_0x5080b9[_0x5fb7('0x38')]['fields']));_0x1f6095['attributes']=_0x1f6095[_0x5fb7('0x3c')][_0x5fb7('0x3e')]?_0x1f6095[_0x5fb7('0x3c')]:_0x543e42['model'];_0x1f6095[_0x5fb7('0x41')]=qs['sort'](_0x5080b9[_0x5fb7('0x38')][_0x5fb7('0x42')]);_0x1f6095[_0x5fb7('0x43')]=qs[_0x5fb7('0x3a')](_[_0x5fb7('0x44')](_0x5080b9['query'],_0x543e42['filters']));if(_0x5080b9[_0x5fb7('0x38')][_0x5fb7('0x45')]){_0x1f6095[_0x5fb7('0x43')]=_[_0x5fb7('0x46')](_0x1f6095[_0x5fb7('0x43')],{'$or':_[_0x5fb7('0x31')](_0x1f6095['attributes'],function(_0x181449){var _0x134e9f={};_0x134e9f[_0x181449]={'$like':'%'+_0x5080b9[_0x5fb7('0x38')][_0x5fb7('0x45')]+'%'};return _0x134e9f;})});}_0x1f6095=_['merge']({},_0x1f6095,_0x5080b9[_0x5fb7('0x47')]);return _0x872d4a[_0x5fb7('0x54')](_0x1f6095);}})[_0x5fb7('0x2d')](function(_0x3de547){if(_0x3de547){_0x26b315=_0x3de547[_0x5fb7('0x3e')];if(!_0x5080b9[_0x5fb7('0x38')][_0x5fb7('0x3f')](_0x5fb7('0x40'))){_0x1f6095[_0x5fb7('0x24')]=qs['limit'](_0x5080b9[_0x5fb7('0x38')][_0x5fb7('0x24')]);_0x1f6095[_0x5fb7('0x22')]=qs[_0x5fb7('0x22')](_0x5080b9['query'][_0x5fb7('0x22')]);}return _0x872d4a['getSubjects'](_0x1f6095);}})[_0x5fb7('0x2d')](function(_0x3e224a){if(_0x3e224a){return _0x3e224a?{'count':_0x26b315,'rows':_0x3e224a}:null;}})[_0x5fb7('0x2d')](respondWithResult(_0x34b292,null))['catch'](handleError(_0x34b292,null));};exports['getDescriptions']=function(_0x31efa6,_0x1fa4c6,_0x36086e){var _0x2a3ce3={};var _0x53e018={};var _0x484b1a;var _0x189ff3;return db[_0x5fb7('0x32')]['findOne']({'where':{'id':_0x31efa6[_0x5fb7('0x52')]['id']}})[_0x5fb7('0x2d')](handleEntityNotFound(_0x1fa4c6,null))['then'](function(_0x1f166e){if(_0x1f166e){_0x484b1a=_0x1f166e;_0x53e018[_0x5fb7('0x37')]=_[_0x5fb7('0x39')](db[_0x5fb7('0x53')][_0x5fb7('0x33')]);_0x53e018['query']=_[_0x5fb7('0x39')](_0x31efa6[_0x5fb7('0x38')]);_0x53e018[_0x5fb7('0x3a')]=_[_0x5fb7('0x3b')](_0x53e018[_0x5fb7('0x37')],_0x53e018[_0x5fb7('0x38')]);_0x2a3ce3[_0x5fb7('0x3c')]=_[_0x5fb7('0x3b')](_0x53e018[_0x5fb7('0x37')],qs[_0x5fb7('0x3d')](_0x31efa6[_0x5fb7('0x38')][_0x5fb7('0x3d')]));_0x2a3ce3[_0x5fb7('0x3c')]=_0x2a3ce3[_0x5fb7('0x3c')][_0x5fb7('0x3e')]?_0x2a3ce3[_0x5fb7('0x3c')]:_0x53e018[_0x5fb7('0x37')];_0x2a3ce3[_0x5fb7('0x41')]=qs[_0x5fb7('0x42')](_0x31efa6[_0x5fb7('0x38')][_0x5fb7('0x42')]);_0x2a3ce3[_0x5fb7('0x43')]=qs[_0x5fb7('0x3a')](_[_0x5fb7('0x44')](_0x31efa6[_0x5fb7('0x38')],_0x53e018[_0x5fb7('0x3a')]));if(_0x31efa6[_0x5fb7('0x38')]['filter']){_0x2a3ce3[_0x5fb7('0x43')]=_['merge'](_0x2a3ce3[_0x5fb7('0x43')],{'$or':_[_0x5fb7('0x31')](_0x2a3ce3['attributes'],function(_0x31dcd1){var _0x4a522f={};_0x4a522f[_0x31dcd1]={'$like':'%'+_0x31efa6[_0x5fb7('0x38')][_0x5fb7('0x45')]+'%'};return _0x4a522f;})});}_0x2a3ce3=_[_0x5fb7('0x46')]({},_0x2a3ce3,_0x31efa6[_0x5fb7('0x47')]);return _0x484b1a[_0x5fb7('0x56')](_0x2a3ce3);}})['then'](function(_0x218af0){if(_0x218af0){_0x189ff3=_0x218af0[_0x5fb7('0x3e')];if(!_0x31efa6[_0x5fb7('0x38')][_0x5fb7('0x3f')]('nolimit')){_0x2a3ce3[_0x5fb7('0x24')]=qs[_0x5fb7('0x24')](_0x31efa6[_0x5fb7('0x38')]['limit']);_0x2a3ce3[_0x5fb7('0x22')]=qs['offset'](_0x31efa6['query'][_0x5fb7('0x22')]);}return _0x484b1a[_0x5fb7('0x56')](_0x2a3ce3);}})[_0x5fb7('0x2d')](function(_0x1976c8){if(_0x1976c8){return _0x1976c8?{'count':_0x189ff3,'rows':_0x1976c8}:null;}})['then'](respondWithResult(_0x1fa4c6,null))['catch'](handleError(_0x1fa4c6,null));}; \ No newline at end of file +var _0x6271=['rows','catch','show','options','find','create','body','params','getFields','SugarcrmField','pick','nolimit','getSubjects','findOne','hasOwnProperty','getDescriptions','eml-format','zip-dir','request-promise','moment','util','sox','ejs','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','offset','undefined','count','status','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','limit','order','sort','where','filter','VIRTUAL','merge','SugarcrmConfiguration','includeAll','include'];(function(_0x548200,_0x3241b8){var _0x1a6d74=function(_0x412f84){while(--_0x412f84){_0x548200['push'](_0x548200['shift']());}};_0x1a6d74(++_0x3241b8);}(_0x6271,0xf7));var _0x1627=function(_0x2cdae4,_0x29a90f){_0x2cdae4=_0x2cdae4-0x0;var _0x2888f3=_0x6271[_0x2cdae4];return _0x2888f3;};'use strict';var emlformat=require(_0x1627('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1627('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1627('0x2'));var moment=require(_0x1627('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1627('0x4'));var path=require('path');var sox=require(_0x1627('0x5'));var csv=require('to-csv');var ejs=require(_0x1627('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1627('0x7'));var crypto=require('crypto');var jsforce=require(_0x1627('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x1627('0x9'));var querystring=require(_0x1627('0xa'));var Papa=require('papaparse');var Redis=require(_0x1627('0xb'));var authService=require(_0x1627('0xc'));var qs=require(_0x1627('0xd'));var as=require(_0x1627('0xe'));var hardwareService=require(_0x1627('0xf'));var logger=require(_0x1627('0x10'))('api');var utils=require(_0x1627('0x11'));var config=require(_0x1627('0x12'));var licenseUtil=require(_0x1627('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x308c75,_0x3440c7){_0x3440c7=_0x3440c7||0xcc;return function(_0x56f97d){if(_0x56f97d){return _0x308c75[_0x1627('0x14')](_0x3440c7);}return _0x308c75['status'](_0x3440c7)[_0x1627('0x15')]();};}function respondWithResult(_0x4def2c,_0x549a57){_0x549a57=_0x549a57||0xc8;return function(_0x25e29b){if(_0x25e29b){return _0x4def2c['status'](_0x549a57)['json'](_0x25e29b);}};}function respondWithFilteredResult(_0x84eb99,_0x1ae6b8){return function(_0x233e31){if(_0x233e31){var _0xf5629a=typeof _0x1ae6b8[_0x1627('0x16')]===_0x1627('0x17')&&typeof _0x1ae6b8['limit']===_0x1627('0x17');var _0x4d9e7a=_0x233e31['count'];var _0x19d041=_0xf5629a?0x0:_0x1ae6b8[_0x1627('0x16')];var _0x53bfab=_0xf5629a?_0x233e31[_0x1627('0x18')]:_0x1ae6b8['offset']+_0x1ae6b8['limit'];var _0x51b147;if(_0x53bfab>=_0x4d9e7a){_0x53bfab=_0x4d9e7a;_0x51b147=0xc8;}else{_0x51b147=0xce;}_0x84eb99[_0x1627('0x19')](_0x51b147);return _0x84eb99[_0x1627('0x1a')](_0x1627('0x1b'),_0x19d041+'-'+_0x53bfab+'/'+_0x4d9e7a)[_0x1627('0x1c')](_0x233e31);}return null;};}function patchUpdates(_0x3e1989){return function(_0x2a69ad){try{jsonpatch['apply'](_0x2a69ad,_0x3e1989,!![]);}catch(_0x48bd2c){return BPromise[_0x1627('0x1d')](_0x48bd2c);}return _0x2a69ad['save']();};}function saveUpdates(_0x9d3548,_0x4b44cf){return function(_0x62be16){if(_0x62be16){return _0x62be16[_0x1627('0x1e')](_0x9d3548)[_0x1627('0x1f')](function(_0x2ca8eb){return _0x2ca8eb;});}return null;};}function removeEntity(_0x3e55c8,_0x8bc8b2){return function(_0x446e1a){if(_0x446e1a){return _0x446e1a[_0x1627('0x20')]()[_0x1627('0x1f')](function(){_0x3e55c8[_0x1627('0x19')](0xcc)[_0x1627('0x15')]();});}};}function handleEntityNotFound(_0x374f0d,_0x5f3206){return function(_0x121644){if(!_0x121644){_0x374f0d[_0x1627('0x14')](0x194);}return _0x121644;};}function handleError(_0x2644e2,_0x122d85){_0x122d85=_0x122d85||0x1f4;return function(_0xc2f3ab){logger[_0x1627('0x21')](_0xc2f3ab[_0x1627('0x22')]);if(_0xc2f3ab[_0x1627('0x23')]){delete _0xc2f3ab['name'];}_0x2644e2[_0x1627('0x19')](_0x122d85)[_0x1627('0x24')](_0xc2f3ab);};}exports[_0x1627('0x25')]=function(_0x261264,_0x2475b5){var _0x150191={},_0x258808={},_0x5b5fb0={'count':0x0,'rows':[]};var _0x3f8126=_[_0x1627('0x26')](db['SugarcrmConfiguration'][_0x1627('0x27')],function(_0x53c798){return{'name':_0x53c798[_0x1627('0x28')],'type':_0x53c798[_0x1627('0x29')][_0x1627('0x2a')]};});_0x258808['model']=_['map'](_0x3f8126,_0x1627('0x23'));_0x258808['query']=_[_0x1627('0x2b')](_0x261264[_0x1627('0x2c')]);_0x258808[_0x1627('0x2d')]=_['intersection'](_0x258808[_0x1627('0x2e')],_0x258808[_0x1627('0x2c')]);_0x150191[_0x1627('0x2f')]=_[_0x1627('0x30')](_0x258808['model'],qs['fields'](_0x261264[_0x1627('0x2c')][_0x1627('0x31')]));_0x150191[_0x1627('0x2f')]=_0x150191[_0x1627('0x2f')][_0x1627('0x32')]?_0x150191[_0x1627('0x2f')]:_0x258808[_0x1627('0x2e')];if(!_0x261264[_0x1627('0x2c')]['hasOwnProperty']('nolimit')){_0x150191[_0x1627('0x33')]=qs['limit'](_0x261264[_0x1627('0x2c')]['limit']);_0x150191['offset']=qs[_0x1627('0x16')](_0x261264[_0x1627('0x2c')][_0x1627('0x16')]);}_0x150191[_0x1627('0x34')]=qs['sort'](_0x261264[_0x1627('0x2c')][_0x1627('0x35')]);_0x150191[_0x1627('0x36')]=qs[_0x1627('0x2d')](_['pick'](_0x261264['query'],_0x258808[_0x1627('0x2d')]),_0x3f8126);if(_0x261264[_0x1627('0x2c')][_0x1627('0x37')]){_0x150191[_0x1627('0x36')]=_['merge'](_0x150191[_0x1627('0x36')],{'$or':_[_0x1627('0x26')](_0x3f8126,function(_0x311150){if(_0x311150[_0x1627('0x29')]!==_0x1627('0x38')){var _0x520c6e={};_0x520c6e[_0x311150[_0x1627('0x23')]]={'$like':'%'+_0x261264[_0x1627('0x2c')][_0x1627('0x37')]+'%'};return _0x520c6e;}})});}_0x150191=_[_0x1627('0x39')]({},_0x150191,_0x261264['options']);var _0x5cf66b={'where':_0x150191[_0x1627('0x36')]};return db[_0x1627('0x3a')][_0x1627('0x18')](_0x5cf66b)[_0x1627('0x1f')](function(_0x30822d){_0x5b5fb0['count']=_0x30822d;if(_0x261264[_0x1627('0x2c')][_0x1627('0x3b')]){_0x150191[_0x1627('0x3c')]=[{'all':!![]}];}return db[_0x1627('0x3a')]['findAll'](_0x150191);})[_0x1627('0x1f')](function(_0x169bea){_0x5b5fb0[_0x1627('0x3d')]=_0x169bea;return _0x5b5fb0;})[_0x1627('0x1f')](respondWithFilteredResult(_0x2475b5,_0x150191))[_0x1627('0x3e')](handleError(_0x2475b5,null));};exports[_0x1627('0x3f')]=function(_0xa5ba9c,_0x2b603c){var _0x3c99cd={'raw':![],'where':{'id':_0xa5ba9c['params']['id']}},_0x40e8f1={};_0x40e8f1[_0x1627('0x2e')]=_['keys'](db[_0x1627('0x3a')][_0x1627('0x27')]);_0x40e8f1[_0x1627('0x2c')]=_[_0x1627('0x2b')](_0xa5ba9c[_0x1627('0x2c')]);_0x40e8f1[_0x1627('0x2d')]=_[_0x1627('0x30')](_0x40e8f1[_0x1627('0x2e')],_0x40e8f1['query']);_0x3c99cd['attributes']=_[_0x1627('0x30')](_0x40e8f1[_0x1627('0x2e')],qs[_0x1627('0x31')](_0xa5ba9c[_0x1627('0x2c')]['fields']));_0x3c99cd[_0x1627('0x2f')]=_0x3c99cd[_0x1627('0x2f')][_0x1627('0x32')]?_0x3c99cd[_0x1627('0x2f')]:_0x40e8f1['model'];if(_0xa5ba9c[_0x1627('0x2c')][_0x1627('0x3b')]){_0x3c99cd['include']=[{'all':!![]}];}_0x3c99cd=_[_0x1627('0x39')]({},_0x3c99cd,_0xa5ba9c[_0x1627('0x40')]);return db[_0x1627('0x3a')][_0x1627('0x41')](_0x3c99cd)[_0x1627('0x1f')](handleEntityNotFound(_0x2b603c,null))['then'](respondWithResult(_0x2b603c,null))[_0x1627('0x3e')](handleError(_0x2b603c,null));};exports[_0x1627('0x42')]=function(_0x2700a0,_0xc8b668){return db[_0x1627('0x3a')]['create'](_0x2700a0[_0x1627('0x43')],{})[_0x1627('0x1f')](respondWithResult(_0xc8b668,0xc9))[_0x1627('0x3e')](handleError(_0xc8b668,null));};exports['update']=function(_0x28d385,_0x329296){if(_0x28d385[_0x1627('0x43')]['id']){delete _0x28d385[_0x1627('0x43')]['id'];}return db[_0x1627('0x3a')][_0x1627('0x41')]({'where':{'id':_0x28d385[_0x1627('0x44')]['id']}})[_0x1627('0x1f')](handleEntityNotFound(_0x329296,null))[_0x1627('0x1f')](saveUpdates(_0x28d385[_0x1627('0x43')],null))[_0x1627('0x1f')](respondWithResult(_0x329296,null))['catch'](handleError(_0x329296,null));};exports[_0x1627('0x20')]=function(_0x3a3d2d,_0x4da587){return db[_0x1627('0x3a')][_0x1627('0x41')]({'where':{'id':_0x3a3d2d[_0x1627('0x44')]['id']}})[_0x1627('0x1f')](handleEntityNotFound(_0x4da587,null))['then'](removeEntity(_0x4da587,null))[_0x1627('0x3e')](handleError(_0x4da587,null));};exports[_0x1627('0x45')]=function(_0x1ebe43,_0x3bb787,_0x475508){var _0x357de7={};var _0x137021={};var _0x2d4089;var _0x4ac48d;return db[_0x1627('0x3a')]['findOne']({'where':{'id':_0x1ebe43['params']['id']}})[_0x1627('0x1f')](handleEntityNotFound(_0x3bb787,null))[_0x1627('0x1f')](function(_0x34f98a){if(_0x34f98a){_0x2d4089=_0x34f98a;_0x137021['model']=_[_0x1627('0x2b')](db[_0x1627('0x46')]['rawAttributes']);_0x137021[_0x1627('0x2c')]=_[_0x1627('0x2b')](_0x1ebe43[_0x1627('0x2c')]);_0x137021[_0x1627('0x2d')]=_[_0x1627('0x30')](_0x137021[_0x1627('0x2e')],_0x137021[_0x1627('0x2c')]);_0x357de7[_0x1627('0x2f')]=_[_0x1627('0x30')](_0x137021[_0x1627('0x2e')],qs[_0x1627('0x31')](_0x1ebe43['query'][_0x1627('0x31')]));_0x357de7[_0x1627('0x2f')]=_0x357de7['attributes'][_0x1627('0x32')]?_0x357de7['attributes']:_0x137021[_0x1627('0x2e')];_0x357de7[_0x1627('0x34')]=qs['sort'](_0x1ebe43['query'][_0x1627('0x35')]);_0x357de7[_0x1627('0x36')]=qs[_0x1627('0x2d')](_[_0x1627('0x47')](_0x1ebe43[_0x1627('0x2c')],_0x137021[_0x1627('0x2d')]));if(_0x1ebe43['query'][_0x1627('0x37')]){_0x357de7[_0x1627('0x36')]=_[_0x1627('0x39')](_0x357de7['where'],{'$or':_['map'](_0x357de7[_0x1627('0x2f')],function(_0x114729){var _0x2a8518={};_0x2a8518[_0x114729]={'$like':'%'+_0x1ebe43[_0x1627('0x2c')][_0x1627('0x37')]+'%'};return _0x2a8518;})});}_0x357de7=_[_0x1627('0x39')]({},_0x357de7,_0x1ebe43[_0x1627('0x40')]);return _0x2d4089[_0x1627('0x45')](_0x357de7);}})[_0x1627('0x1f')](function(_0x21f8f2){if(_0x21f8f2){_0x4ac48d=_0x21f8f2[_0x1627('0x32')];if(!_0x1ebe43[_0x1627('0x2c')]['hasOwnProperty'](_0x1627('0x48'))){_0x357de7[_0x1627('0x33')]=qs[_0x1627('0x33')](_0x1ebe43['query'][_0x1627('0x33')]);_0x357de7[_0x1627('0x16')]=qs[_0x1627('0x16')](_0x1ebe43[_0x1627('0x2c')][_0x1627('0x16')]);}return _0x2d4089['getFields'](_0x357de7);}})[_0x1627('0x1f')](function(_0x2ad0a6){if(_0x2ad0a6){return _0x2ad0a6?{'count':_0x4ac48d,'rows':_0x2ad0a6}:null;}})[_0x1627('0x1f')](respondWithResult(_0x3bb787,null))[_0x1627('0x3e')](handleError(_0x3bb787,null));};exports[_0x1627('0x49')]=function(_0x5ab937,_0x30ff87,_0x8b1053){var _0x1f270={};var _0x58cbdf={};var _0x15f382;var _0x2fce8d;return db[_0x1627('0x3a')][_0x1627('0x4a')]({'where':{'id':_0x5ab937[_0x1627('0x44')]['id']}})['then'](handleEntityNotFound(_0x30ff87,null))[_0x1627('0x1f')](function(_0x4a5eee){if(_0x4a5eee){_0x15f382=_0x4a5eee;_0x58cbdf[_0x1627('0x2e')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x58cbdf[_0x1627('0x2c')]=_[_0x1627('0x2b')](_0x5ab937[_0x1627('0x2c')]);_0x58cbdf[_0x1627('0x2d')]=_[_0x1627('0x30')](_0x58cbdf[_0x1627('0x2e')],_0x58cbdf[_0x1627('0x2c')]);_0x1f270[_0x1627('0x2f')]=_[_0x1627('0x30')](_0x58cbdf[_0x1627('0x2e')],qs[_0x1627('0x31')](_0x5ab937[_0x1627('0x2c')][_0x1627('0x31')]));_0x1f270[_0x1627('0x2f')]=_0x1f270[_0x1627('0x2f')][_0x1627('0x32')]?_0x1f270[_0x1627('0x2f')]:_0x58cbdf['model'];_0x1f270[_0x1627('0x34')]=qs[_0x1627('0x35')](_0x5ab937[_0x1627('0x2c')][_0x1627('0x35')]);_0x1f270[_0x1627('0x36')]=qs[_0x1627('0x2d')](_[_0x1627('0x47')](_0x5ab937[_0x1627('0x2c')],_0x58cbdf[_0x1627('0x2d')]));if(_0x5ab937[_0x1627('0x2c')][_0x1627('0x37')]){_0x1f270[_0x1627('0x36')]=_[_0x1627('0x39')](_0x1f270[_0x1627('0x36')],{'$or':_[_0x1627('0x26')](_0x1f270[_0x1627('0x2f')],function(_0x782ca8){var _0x1d66eb={};_0x1d66eb[_0x782ca8]={'$like':'%'+_0x5ab937[_0x1627('0x2c')][_0x1627('0x37')]+'%'};return _0x1d66eb;})});}_0x1f270=_[_0x1627('0x39')]({},_0x1f270,_0x5ab937[_0x1627('0x40')]);return _0x15f382[_0x1627('0x49')](_0x1f270);}})['then'](function(_0x1f10d2){if(_0x1f10d2){_0x2fce8d=_0x1f10d2[_0x1627('0x32')];if(!_0x5ab937[_0x1627('0x2c')][_0x1627('0x4b')]('nolimit')){_0x1f270['limit']=qs[_0x1627('0x33')](_0x5ab937[_0x1627('0x2c')][_0x1627('0x33')]);_0x1f270[_0x1627('0x16')]=qs[_0x1627('0x16')](_0x5ab937[_0x1627('0x2c')][_0x1627('0x16')]);}return _0x15f382[_0x1627('0x49')](_0x1f270);}})[_0x1627('0x1f')](function(_0x1458b2){if(_0x1458b2){return _0x1458b2?{'count':_0x2fce8d,'rows':_0x1458b2}:null;}})[_0x1627('0x1f')](respondWithResult(_0x30ff87,null))[_0x1627('0x3e')](handleError(_0x30ff87,null));};exports[_0x1627('0x4c')]=function(_0x306b1b,_0x2e1176,_0x298267){var _0xb733c1={};var _0x36f322={};var _0x3f5ea4;var _0x1576b0;return db[_0x1627('0x3a')][_0x1627('0x4a')]({'where':{'id':_0x306b1b[_0x1627('0x44')]['id']}})[_0x1627('0x1f')](handleEntityNotFound(_0x2e1176,null))['then'](function(_0x1b268f){if(_0x1b268f){_0x3f5ea4=_0x1b268f;_0x36f322[_0x1627('0x2e')]=_[_0x1627('0x2b')](db[_0x1627('0x46')][_0x1627('0x27')]);_0x36f322[_0x1627('0x2c')]=_['keys'](_0x306b1b[_0x1627('0x2c')]);_0x36f322['filters']=_[_0x1627('0x30')](_0x36f322['model'],_0x36f322[_0x1627('0x2c')]);_0xb733c1['attributes']=_[_0x1627('0x30')](_0x36f322['model'],qs[_0x1627('0x31')](_0x306b1b['query'][_0x1627('0x31')]));_0xb733c1[_0x1627('0x2f')]=_0xb733c1[_0x1627('0x2f')][_0x1627('0x32')]?_0xb733c1[_0x1627('0x2f')]:_0x36f322['model'];_0xb733c1[_0x1627('0x34')]=qs[_0x1627('0x35')](_0x306b1b['query']['sort']);_0xb733c1[_0x1627('0x36')]=qs[_0x1627('0x2d')](_[_0x1627('0x47')](_0x306b1b[_0x1627('0x2c')],_0x36f322[_0x1627('0x2d')]));if(_0x306b1b[_0x1627('0x2c')][_0x1627('0x37')]){_0xb733c1[_0x1627('0x36')]=_[_0x1627('0x39')](_0xb733c1[_0x1627('0x36')],{'$or':_[_0x1627('0x26')](_0xb733c1['attributes'],function(_0x3bd402){var _0x70a94a={};_0x70a94a[_0x3bd402]={'$like':'%'+_0x306b1b[_0x1627('0x2c')][_0x1627('0x37')]+'%'};return _0x70a94a;})});}_0xb733c1=_[_0x1627('0x39')]({},_0xb733c1,_0x306b1b[_0x1627('0x40')]);return _0x3f5ea4[_0x1627('0x4c')](_0xb733c1);}})[_0x1627('0x1f')](function(_0x360e90){if(_0x360e90){_0x1576b0=_0x360e90[_0x1627('0x32')];if(!_0x306b1b['query'][_0x1627('0x4b')](_0x1627('0x48'))){_0xb733c1[_0x1627('0x33')]=qs[_0x1627('0x33')](_0x306b1b[_0x1627('0x2c')][_0x1627('0x33')]);_0xb733c1['offset']=qs[_0x1627('0x16')](_0x306b1b[_0x1627('0x2c')][_0x1627('0x16')]);}return _0x3f5ea4[_0x1627('0x4c')](_0xb733c1);}})[_0x1627('0x1f')](function(_0x3c3165){if(_0x3c3165){return _0x3c3165?{'count':_0x1576b0,'rows':_0x3c3165}:null;}})[_0x1627('0x1f')](respondWithResult(_0x2e1176,null))[_0x1627('0x3e')](handleError(_0x2e1176,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index c21e32e..42f2781 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda01=['request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','int_sugarcrm_configurations','../../config/logger','api','bluebird'];(function(_0x485359,_0x16dbe4){var _0x238dc0=function(_0x57f814){while(--_0x57f814){_0x485359['push'](_0x485359['shift']());}};_0x238dc0(++_0x16dbe4);}(_0xda01,0xbb));var _0x1da0=function(_0x206e49,_0x367f5a){_0x206e49=_0x206e49-0x0;var _0x18e07c=_0xda01[_0x206e49];return _0x18e07c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1da0('0x0'))(_0x1da0('0x1'));var moment=require('moment');var BPromise=require(_0x1da0('0x2'));var rp=require(_0x1da0('0x3'));var fs=require('fs');var path=require(_0x1da0('0x4'));var rimraf=require(_0x1da0('0x5'));var config=require(_0x1da0('0x6'));var attributes=require(_0x1da0('0x7'));module['exports']=function(_0x45eee7,_0x12514b){return _0x45eee7[_0x1da0('0x8')]('SugarcrmConfiguration',attributes,{'tableName':_0x1da0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ebb=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0x1811b2,_0x49d354){var _0x56bb27=function(_0x527b0c){while(--_0x527b0c){_0x1811b2['push'](_0x1811b2['shift']());}};_0x56bb27(++_0x49d354);}(_0x3ebb,0x150));var _0xb3eb=function(_0x2d6110,_0x40cfee){_0x2d6110=_0x2d6110-0x0;var _0x33e09b=_0x3ebb[_0x2d6110];return _0x33e09b;};'use strict';var _=require(_0xb3eb('0x0'));var util=require('util');var logger=require(_0xb3eb('0x1'))(_0xb3eb('0x2'));var moment=require(_0xb3eb('0x3'));var BPromise=require(_0xb3eb('0x4'));var rp=require(_0xb3eb('0x5'));var fs=require('fs');var path=require(_0xb3eb('0x6'));var rimraf=require(_0xb3eb('0x7'));var config=require(_0xb3eb('0x8'));var attributes=require(_0xb3eb('0x9'));module[_0xb3eb('0xa')]=function(_0x3b7e2a,_0x5579da){return _0x3b7e2a[_0xb3eb('0xb')](_0xb3eb('0xc'),attributes,{'tableName':_0xb3eb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 92d318e..27a15d7 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38c0=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3e9845,_0x30a9c5){var _0x4f3ee6=function(_0x24abf5){while(--_0x24abf5){_0x3e9845['push'](_0x3e9845['shift']());}};_0x4f3ee6(++_0x30a9c5);}(_0x38c0,0x7a));var _0x038c=function(_0x560448,_0x2c1082){_0x560448=_0x560448-0x0;var _0x550276=_0x38c0[_0x560448];return _0x550276;};'use strict';var _=require(_0x038c('0x0'));var util=require(_0x038c('0x1'));var moment=require(_0x038c('0x2'));var BPromise=require(_0x038c('0x3'));var rs=require(_0x038c('0x4'));var fs=require('fs');var Redis=require(_0x038c('0x5'));var db=require(_0x038c('0x6'))['db'];var utils=require(_0x038c('0x7'));var logger=require(_0x038c('0x8'))(_0x038c('0x9'));var config=require(_0x038c('0xa'));var jayson=require(_0x038c('0xb'));var client=jayson[_0x038c('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x304474,_0x119741,_0x34ee6b){return new BPromise(function(_0x4909fc,_0x29aa8b){return client[_0x038c('0xd')](_0x304474,_0x34ee6b)[_0x038c('0xe')](function(_0x575fa1){logger['info'](_0x038c('0xf'),_0x119741,_0x038c('0x10'));logger[_0x038c('0x11')](_0x038c('0x12'),_0x119741,_0x038c('0x10'),JSON[_0x038c('0x13')](_0x575fa1));if(_0x575fa1[_0x038c('0x14')]){if(_0x575fa1[_0x038c('0x14')][_0x038c('0x15')]===0x1f4){logger['error'](_0x038c('0xf'),_0x119741,_0x575fa1[_0x038c('0x14')][_0x038c('0x16')]);return _0x29aa8b(_0x575fa1[_0x038c('0x14')][_0x038c('0x16')]);}logger[_0x038c('0x14')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x119741,_0x575fa1['error'][_0x038c('0x16')]);return _0x4909fc(_0x575fa1[_0x038c('0x14')][_0x038c('0x16')]);}else{logger[_0x038c('0x17')](_0x038c('0xf'),_0x119741,_0x038c('0x10'));_0x4909fc(_0x575fa1[_0x038c('0x18')][_0x038c('0x16')]);}})[_0x038c('0x19')](function(_0x5373ed){logger[_0x038c('0x14')](_0x038c('0xf'),_0x119741,_0x5373ed);_0x29aa8b(_0x5373ed);});});} \ No newline at end of file +var _0x5577=['error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x249c76,_0x30fc97){var _0x390387=function(_0xfc2652){while(--_0xfc2652){_0x249c76['push'](_0x249c76['shift']());}};_0x390387(++_0x30fc97);}(_0x5577,0x90));var _0x7557=function(_0x504d97,_0x3c2a6e){_0x504d97=_0x504d97-0x0;var _0x49701b=_0x5577[_0x504d97];return _0x49701b;};'use strict';var _=require(_0x7557('0x0'));var util=require(_0x7557('0x1'));var moment=require(_0x7557('0x2'));var BPromise=require('bluebird');var rs=require(_0x7557('0x3'));var fs=require('fs');var Redis=require(_0x7557('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7557('0x5'));var logger=require(_0x7557('0x6'))(_0x7557('0x7'));var config=require(_0x7557('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7557('0x9')][_0x7557('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x72217e,_0xd23415,_0x5e2d52){return new BPromise(function(_0x42930b,_0x243b52){return client[_0x7557('0xb')](_0x72217e,_0x5e2d52)[_0x7557('0xc')](function(_0x1bb3ed){logger[_0x7557('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xd23415,_0x7557('0xe'));logger[_0x7557('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xd23415,_0x7557('0xe'),JSON[_0x7557('0x10')](_0x1bb3ed));if(_0x1bb3ed[_0x7557('0x11')]){if(_0x1bb3ed['error'][_0x7557('0x12')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0xd23415,_0x1bb3ed['error'][_0x7557('0x13')]);return _0x243b52(_0x1bb3ed[_0x7557('0x11')][_0x7557('0x13')]);}logger[_0x7557('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xd23415,_0x1bb3ed[_0x7557('0x11')][_0x7557('0x13')]);return _0x42930b(_0x1bb3ed[_0x7557('0x11')][_0x7557('0x13')]);}else{logger[_0x7557('0xd')](_0x7557('0x14'),_0xd23415,'request\x20sent');_0x42930b(_0x1bb3ed[_0x7557('0x15')][_0x7557('0x13')]);}})[_0x7557('0x16')](function(_0x323fec){logger['error'](_0x7557('0x14'),_0xd23415,_0x323fec);_0x243b52(_0x323fec);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index b861955..e9405e3 100644 --- a/server/api/intSugarcrmField/index.js +++ b/server/api/intSugarcrmField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9da9=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','post','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5933fb,_0x9115ad){var _0x44d988=function(_0x295228){while(--_0x295228){_0x5933fb['push'](_0x5933fb['shift']());}};_0x44d988(++_0x9115ad);}(_0x9da9,0xe0));var _0x99da=function(_0x3e7653,_0x414e83){_0x3e7653=_0x3e7653-0x0;var _0x2d518d=_0x9da9[_0x3e7653];return _0x2d518d;};'use strict';var multer=require(_0x99da('0x0'));var util=require(_0x99da('0x1'));var path=require(_0x99da('0x2'));var timeout=require(_0x99da('0x3'));var express=require(_0x99da('0x4'));var router=express[_0x99da('0x5')]();var fs_extra=require(_0x99da('0x6'));var auth=require(_0x99da('0x7'));var interaction=require(_0x99da('0x8'));var config=require('../../config/environment');var controller=require(_0x99da('0x9'));router[_0x99da('0xa')]('/',auth[_0x99da('0xb')](),controller[_0x99da('0xc')]);router[_0x99da('0xa')](_0x99da('0xd'),auth[_0x99da('0xb')](),controller['show']);router[_0x99da('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x99da('0xd'),auth[_0x99da('0xb')](),controller[_0x99da('0xf')]);router[_0x99da('0x10')](_0x99da('0xd'),auth[_0x99da('0xb')](),controller[_0x99da('0x11')]);module[_0x99da('0x12')]=router; \ No newline at end of file +var _0x9d71=['../../config/environment','isAuthenticated','get','show','post','create','put','/:id','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xa0acdc,_0x16be61){var _0x2f91d3=function(_0x363465){while(--_0x363465){_0xa0acdc['push'](_0xa0acdc['shift']());}};_0x2f91d3(++_0x16be61);}(_0x9d71,0xf5));var _0x19d7=function(_0x5f1f95,_0x1bde3a){_0x5f1f95=_0x5f1f95-0x0;var _0x467bd6=_0x9d71[_0x5f1f95];return _0x467bd6;};'use strict';var multer=require('multer');var util=require(_0x19d7('0x0'));var path=require(_0x19d7('0x1'));var timeout=require('connect-timeout');var express=require(_0x19d7('0x2'));var router=express[_0x19d7('0x3')]();var fs_extra=require(_0x19d7('0x4'));var auth=require(_0x19d7('0x5'));var interaction=require(_0x19d7('0x6'));var config=require(_0x19d7('0x7'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0x19d7('0x8')](),controller['index']);router[_0x19d7('0x9')]('/:id',auth[_0x19d7('0x8')](),controller[_0x19d7('0xa')]);router[_0x19d7('0xb')]('/',auth['isAuthenticated'](),controller[_0x19d7('0xc')]);router[_0x19d7('0xd')](_0x19d7('0xe'),auth[_0x19d7('0x8')](),controller['update']);router[_0x19d7('0xf')]('/:id',auth[_0x19d7('0x8')](),controller[_0x19d7('0x10')]);module[_0x19d7('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 03d12aa..2f47a4a 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.attributes.js +++ b/server/api/intSugarcrmField/intSugarcrmField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2e8=['keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x335022,_0x1b4896){var _0x37498f=function(_0x2b7893){while(--_0x2b7893){_0x335022['push'](_0x335022['shift']());}};_0x37498f(++_0x1b4896);}(_0xd2e8,0x18c));var _0x8d2e=function(_0x4b3300,_0x1137f1){_0x4b3300=_0x4b3300-0x0;var _0x2d26d3=_0xd2e8[_0x4b3300];return _0x2d26d3;};'use strict';var Sequelize=require(_0x8d2e('0x0'));module['exports']={'type':{'type':Sequelize[_0x8d2e('0x1')](_0x8d2e('0x2'),_0x8d2e('0x3'),'customVariable',_0x8d2e('0x4'),_0x8d2e('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x8d2e('0x2'),_0x8d2e('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x8d2e('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8d2e('0x6')]},'customField':{'type':Sequelize[_0x8d2e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8d2e('0x6')]}}; \ No newline at end of file +var _0x6cd5=['string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6cd5,0x1ab));var _0x56cd=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6cd5[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x56cd('0x0'));module[_0x56cd('0x1')]={'type':{'type':Sequelize[_0x56cd('0x2')](_0x56cd('0x3'),_0x56cd('0x4'),'customVariable',_0x56cd('0x5'),_0x56cd('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x56cd('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x56cd('0x2')](_0x56cd('0x3'),_0x56cd('0x4'),_0x56cd('0x8'))},'keyContent':{'type':Sequelize[_0x56cd('0x7')]},'idField':{'type':Sequelize[_0x56cd('0x7')]},'nameField':{'type':Sequelize[_0x56cd('0x7')]},'customField':{'type':Sequelize[_0x56cd('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 1a72154..8694c85 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.controller.js +++ b/server/api/intSugarcrmField/intSugarcrmField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x616a=['catch','show','params','keys','create','body','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','SugarcrmField','includeAll','include','findAll','rows'];(function(_0x7c2276,_0x3c148c){var _0x9dbe6c=function(_0x2f7ea9){while(--_0x2f7ea9){_0x7c2276['push'](_0x7c2276['shift']());}};_0x9dbe6c(++_0x3c148c);}(_0x616a,0xf4));var _0xa616=function(_0x1c4279,_0x2d7c69){_0x1c4279=_0x1c4279-0x0;var _0x4565a9=_0x616a[_0x1c4279];return _0x4565a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa616('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa616('0x1'));var rp=require(_0xa616('0x2'));var moment=require(_0xa616('0x3'));var BPromise=require(_0xa616('0x4'));var Mustache=require(_0xa616('0x5'));var util=require('util');var path=require(_0xa616('0x6'));var sox=require('sox');var csv=require(_0xa616('0x7'));var ejs=require(_0xa616('0x8'));var fs=require('fs');var fs_extra=require(_0xa616('0x9'));var _=require(_0xa616('0xa'));var squel=require(_0xa616('0xb'));var crypto=require(_0xa616('0xc'));var jsforce=require(_0xa616('0xd'));var deskjs=require(_0xa616('0xe'));var toCsv=require(_0xa616('0x7'));var querystring=require(_0xa616('0xf'));var Papa=require(_0xa616('0x10'));var Redis=require(_0xa616('0x11'));var authService=require(_0xa616('0x12'));var qs=require(_0xa616('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa616('0x14'));var logger=require('../../config/logger')(_0xa616('0x15'));var utils=require(_0xa616('0x16'));var config=require(_0xa616('0x17'));var licenseUtil=require(_0xa616('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x151216,_0x5d930b){_0x5d930b=_0x5d930b||0xcc;return function(_0x5232aa){if(_0x5232aa){return _0x151216[_0xa616('0x19')](_0x5d930b);}return _0x151216['status'](_0x5d930b)[_0xa616('0x1a')]();};}function respondWithResult(_0x1f0b9f,_0xe75fe3){_0xe75fe3=_0xe75fe3||0xc8;return function(_0x2e18c4){if(_0x2e18c4){return _0x1f0b9f[_0xa616('0x1b')](_0xe75fe3)[_0xa616('0x1c')](_0x2e18c4);}};}function respondWithFilteredResult(_0x3c60d9,_0x2f32ff){return function(_0x51e4a3){if(_0x51e4a3){var _0x41f2cd=typeof _0x2f32ff['offset']===_0xa616('0x1d')&&typeof _0x2f32ff[_0xa616('0x1e')]===_0xa616('0x1d');var _0xddba50=_0x51e4a3['count'];var _0x2dfdac=_0x41f2cd?0x0:_0x2f32ff[_0xa616('0x1f')];var _0x2bff0f=_0x41f2cd?_0x51e4a3[_0xa616('0x20')]:_0x2f32ff[_0xa616('0x1f')]+_0x2f32ff['limit'];var _0x13c4e9;if(_0x2bff0f>=_0xddba50){_0x2bff0f=_0xddba50;_0x13c4e9=0xc8;}else{_0x13c4e9=0xce;}_0x3c60d9['status'](_0x13c4e9);return _0x3c60d9['set'](_0xa616('0x21'),_0x2dfdac+'-'+_0x2bff0f+'/'+_0xddba50)[_0xa616('0x1c')](_0x51e4a3);}return null;};}function patchUpdates(_0x5b47ec){return function(_0x1f55d9){try{jsonpatch[_0xa616('0x22')](_0x1f55d9,_0x5b47ec,!![]);}catch(_0x32dc40){return BPromise[_0xa616('0x23')](_0x32dc40);}return _0x1f55d9[_0xa616('0x24')]();};}function saveUpdates(_0x57ab5e,_0x118587){return function(_0x116670){if(_0x116670){return _0x116670[_0xa616('0x25')](_0x57ab5e)[_0xa616('0x26')](function(_0x35d2a4){return _0x35d2a4;});}return null;};}function removeEntity(_0x1cb20c,_0x58b1d3){return function(_0x41891e){if(_0x41891e){return _0x41891e[_0xa616('0x27')]()[_0xa616('0x26')](function(){_0x1cb20c[_0xa616('0x1b')](0xcc)[_0xa616('0x1a')]();});}};}function handleEntityNotFound(_0x58cce1,_0xd917ee){return function(_0xcdb959){if(!_0xcdb959){_0x58cce1[_0xa616('0x19')](0x194);}return _0xcdb959;};}function handleError(_0x5a75e0,_0x53af5a){_0x53af5a=_0x53af5a||0x1f4;return function(_0x2095a6){logger[_0xa616('0x28')](_0x2095a6[_0xa616('0x29')]);if(_0x2095a6[_0xa616('0x2a')]){delete _0x2095a6[_0xa616('0x2a')];}_0x5a75e0['status'](_0x53af5a)[_0xa616('0x2b')](_0x2095a6);};}exports[_0xa616('0x2c')]=function(_0x5ddb86,_0xe351b8){var _0x175319={},_0x3f0911={},_0x30b9cd={'count':0x0,'rows':[]};var _0x382364=_[_0xa616('0x2d')](db['SugarcrmField'][_0xa616('0x2e')],function(_0xaec6b0){return{'name':_0xaec6b0[_0xa616('0x2f')],'type':_0xaec6b0[_0xa616('0x30')][_0xa616('0x31')]};});_0x3f0911[_0xa616('0x32')]=_[_0xa616('0x2d')](_0x382364,_0xa616('0x2a'));_0x3f0911['query']=_['keys'](_0x5ddb86[_0xa616('0x33')]);_0x3f0911[_0xa616('0x34')]=_[_0xa616('0x35')](_0x3f0911[_0xa616('0x32')],_0x3f0911[_0xa616('0x33')]);_0x175319['attributes']=_['intersection'](_0x3f0911[_0xa616('0x32')],qs[_0xa616('0x36')](_0x5ddb86[_0xa616('0x33')][_0xa616('0x36')]));_0x175319['attributes']=_0x175319[_0xa616('0x37')][_0xa616('0x38')]?_0x175319['attributes']:_0x3f0911[_0xa616('0x32')];if(!_0x5ddb86[_0xa616('0x33')][_0xa616('0x39')](_0xa616('0x3a'))){_0x175319[_0xa616('0x1e')]=qs[_0xa616('0x1e')](_0x5ddb86[_0xa616('0x33')][_0xa616('0x1e')]);_0x175319[_0xa616('0x1f')]=qs[_0xa616('0x1f')](_0x5ddb86[_0xa616('0x33')][_0xa616('0x1f')]);}_0x175319[_0xa616('0x3b')]=qs['sort'](_0x5ddb86['query'][_0xa616('0x3c')]);_0x175319['where']=qs[_0xa616('0x34')](_[_0xa616('0x3d')](_0x5ddb86['query'],_0x3f0911[_0xa616('0x34')]),_0x382364);if(_0x5ddb86[_0xa616('0x33')][_0xa616('0x3e')]){_0x175319['where']=_['merge'](_0x175319[_0xa616('0x3f')],{'$or':_[_0xa616('0x2d')](_0x382364,function(_0x5f0be6){if(_0x5f0be6[_0xa616('0x30')]!==_0xa616('0x40')){var _0x369302={};_0x369302[_0x5f0be6[_0xa616('0x2a')]]={'$like':'%'+_0x5ddb86[_0xa616('0x33')][_0xa616('0x3e')]+'%'};return _0x369302;}})});}_0x175319=_[_0xa616('0x41')]({},_0x175319,_0x5ddb86[_0xa616('0x42')]);var _0x324ded={'where':_0x175319[_0xa616('0x3f')]};return db[_0xa616('0x43')]['count'](_0x324ded)[_0xa616('0x26')](function(_0x6390ef){_0x30b9cd['count']=_0x6390ef;if(_0x5ddb86[_0xa616('0x33')][_0xa616('0x44')]){_0x175319[_0xa616('0x45')]=[{'all':!![]}];}return db[_0xa616('0x43')][_0xa616('0x46')](_0x175319);})[_0xa616('0x26')](function(_0x2bcf4f){_0x30b9cd[_0xa616('0x47')]=_0x2bcf4f;return _0x30b9cd;})[_0xa616('0x26')](respondWithFilteredResult(_0xe351b8,_0x175319))[_0xa616('0x48')](handleError(_0xe351b8,null));};exports[_0xa616('0x49')]=function(_0x2bdb5d,_0x32d1e7){var _0x1d8a88={'raw':!![],'where':{'id':_0x2bdb5d[_0xa616('0x4a')]['id']}},_0x44a7af={};_0x44a7af[_0xa616('0x32')]=_[_0xa616('0x4b')](db[_0xa616('0x43')][_0xa616('0x2e')]);_0x44a7af[_0xa616('0x33')]=_[_0xa616('0x4b')](_0x2bdb5d['query']);_0x44a7af[_0xa616('0x34')]=_[_0xa616('0x35')](_0x44a7af['model'],_0x44a7af[_0xa616('0x33')]);_0x1d8a88[_0xa616('0x37')]=_[_0xa616('0x35')](_0x44a7af[_0xa616('0x32')],qs['fields'](_0x2bdb5d[_0xa616('0x33')][_0xa616('0x36')]));_0x1d8a88[_0xa616('0x37')]=_0x1d8a88[_0xa616('0x37')][_0xa616('0x38')]?_0x1d8a88['attributes']:_0x44a7af[_0xa616('0x32')];if(_0x2bdb5d['query'][_0xa616('0x44')]){_0x1d8a88[_0xa616('0x45')]=[{'all':!![]}];}_0x1d8a88=_['merge']({},_0x1d8a88,_0x2bdb5d['options']);return db[_0xa616('0x43')]['find'](_0x1d8a88)[_0xa616('0x26')](handleEntityNotFound(_0x32d1e7,null))['then'](respondWithResult(_0x32d1e7,null))[_0xa616('0x48')](handleError(_0x32d1e7,null));};exports[_0xa616('0x4c')]=function(_0x1b641f,_0x205eba){return db[_0xa616('0x43')][_0xa616('0x4c')](_0x1b641f[_0xa616('0x4d')],{})[_0xa616('0x26')](respondWithResult(_0x205eba,0xc9))[_0xa616('0x48')](handleError(_0x205eba,null));};exports[_0xa616('0x25')]=function(_0x4f84d1,_0x3357dd){if(_0x4f84d1['body']['id']){delete _0x4f84d1['body']['id'];}return db[_0xa616('0x43')]['find']({'where':{'id':_0x4f84d1[_0xa616('0x4a')]['id']}})[_0xa616('0x26')](handleEntityNotFound(_0x3357dd,null))['then'](saveUpdates(_0x4f84d1[_0xa616('0x4d')],null))[_0xa616('0x26')](respondWithResult(_0x3357dd,null))[_0xa616('0x48')](handleError(_0x3357dd,null));};exports['destroy']=function(_0x127ef2,_0x52458c){return db['SugarcrmField'][_0xa616('0x4e')]({'where':{'id':_0x127ef2[_0xa616('0x4a')]['id']}})[_0xa616('0x26')](handleEntityNotFound(_0x52458c,null))[_0xa616('0x26')](removeEntity(_0x52458c,null))['catch'](handleError(_0x52458c,null));}; \ No newline at end of file +var _0x383e=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','options','SugarcrmField','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','error','name','index','rawAttributes','fieldName','type','key'];(function(_0x52ff77,_0x231567){var _0x578659=function(_0xb8a193){while(--_0xb8a193){_0x52ff77['push'](_0x52ff77['shift']());}};_0x578659(++_0x231567);}(_0x383e,0x68));var _0xe383=function(_0x5079f0,_0x2e0ae4){_0x5079f0=_0x5079f0-0x0;var _0x182bce=_0x383e[_0x5079f0];return _0x182bce;};'use strict';var emlformat=require(_0xe383('0x0'));var rimraf=require(_0xe383('0x1'));var zipdir=require(_0xe383('0x2'));var jsonpatch=require(_0xe383('0x3'));var rp=require(_0xe383('0x4'));var moment=require(_0xe383('0x5'));var BPromise=require(_0xe383('0x6'));var Mustache=require(_0xe383('0x7'));var util=require(_0xe383('0x8'));var path=require('path');var sox=require(_0xe383('0x9'));var csv=require(_0xe383('0xa'));var ejs=require(_0xe383('0xb'));var fs=require('fs');var fs_extra=require(_0xe383('0xc'));var _=require(_0xe383('0xd'));var squel=require('squel');var crypto=require(_0xe383('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe383('0xf'));var toCsv=require(_0xe383('0xa'));var querystring=require(_0xe383('0x10'));var Papa=require(_0xe383('0x11'));var Redis=require(_0xe383('0x12'));var authService=require(_0xe383('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe383('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe383('0x15'))(_0xe383('0x16'));var utils=require(_0xe383('0x17'));var config=require(_0xe383('0x18'));var licenseUtil=require(_0xe383('0x19'));var db=require(_0xe383('0x1a'))['db'];function respondWithStatusCode(_0x51d5d0,_0x1611ee){_0x1611ee=_0x1611ee||0xcc;return function(_0x49edd3){if(_0x49edd3){return _0x51d5d0['sendStatus'](_0x1611ee);}return _0x51d5d0[_0xe383('0x1b')](_0x1611ee)[_0xe383('0x1c')]();};}function respondWithResult(_0x391ee7,_0x3fc278){_0x3fc278=_0x3fc278||0xc8;return function(_0x277e9a){if(_0x277e9a){return _0x391ee7[_0xe383('0x1b')](_0x3fc278)[_0xe383('0x1d')](_0x277e9a);}};}function respondWithFilteredResult(_0x7ca9a7,_0x3ed0d8){return function(_0x388a99){if(_0x388a99){var _0x2bb315=typeof _0x3ed0d8[_0xe383('0x1e')]===_0xe383('0x1f')&&typeof _0x3ed0d8[_0xe383('0x20')]===_0xe383('0x1f');var _0x4d5254=_0x388a99[_0xe383('0x21')];var _0x59de2a=_0x2bb315?0x0:_0x3ed0d8['offset'];var _0x40204a=_0x2bb315?_0x388a99['count']:_0x3ed0d8[_0xe383('0x1e')]+_0x3ed0d8[_0xe383('0x20')];var _0x264887;if(_0x40204a>=_0x4d5254){_0x40204a=_0x4d5254;_0x264887=0xc8;}else{_0x264887=0xce;}_0x7ca9a7[_0xe383('0x1b')](_0x264887);return _0x7ca9a7[_0xe383('0x22')]('Content-Range',_0x59de2a+'-'+_0x40204a+'/'+_0x4d5254)['json'](_0x388a99);}return null;};}function patchUpdates(_0x4d2b4d){return function(_0x936d20){try{jsonpatch['apply'](_0x936d20,_0x4d2b4d,!![]);}catch(_0x47b435){return BPromise[_0xe383('0x23')](_0x47b435);}return _0x936d20[_0xe383('0x24')]();};}function saveUpdates(_0x1e1104,_0x5b3b08){return function(_0x2db58a){if(_0x2db58a){return _0x2db58a[_0xe383('0x25')](_0x1e1104)[_0xe383('0x26')](function(_0x2e8242){return _0x2e8242;});}return null;};}function removeEntity(_0x99c4c0,_0x5dee59){return function(_0x14fe24){if(_0x14fe24){return _0x14fe24[_0xe383('0x27')]()[_0xe383('0x26')](function(){_0x99c4c0[_0xe383('0x1b')](0xcc)[_0xe383('0x1c')]();});}};}function handleEntityNotFound(_0x159ba9,_0x21f2c1){return function(_0x37c258){if(!_0x37c258){_0x159ba9[_0xe383('0x28')](0x194);}return _0x37c258;};}function handleError(_0x3ce25f,_0x4e8577){_0x4e8577=_0x4e8577||0x1f4;return function(_0x21288d){logger[_0xe383('0x29')](_0x21288d['stack']);if(_0x21288d[_0xe383('0x2a')]){delete _0x21288d[_0xe383('0x2a')];}_0x3ce25f['status'](_0x4e8577)['send'](_0x21288d);};}exports[_0xe383('0x2b')]=function(_0x54c4f8,_0x15cbe3){var _0x4e520a={},_0x4c8d52={},_0x54d2d8={'count':0x0,'rows':[]};var _0x16ced4=_['map'](db['SugarcrmField'][_0xe383('0x2c')],function(_0x592a20){return{'name':_0x592a20[_0xe383('0x2d')],'type':_0x592a20[_0xe383('0x2e')][_0xe383('0x2f')]};});_0x4c8d52[_0xe383('0x30')]=_['map'](_0x16ced4,_0xe383('0x2a'));_0x4c8d52[_0xe383('0x31')]=_[_0xe383('0x32')](_0x54c4f8['query']);_0x4c8d52['filters']=_[_0xe383('0x33')](_0x4c8d52[_0xe383('0x30')],_0x4c8d52['query']);_0x4e520a[_0xe383('0x34')]=_[_0xe383('0x33')](_0x4c8d52[_0xe383('0x30')],qs[_0xe383('0x35')](_0x54c4f8[_0xe383('0x31')][_0xe383('0x35')]));_0x4e520a[_0xe383('0x34')]=_0x4e520a['attributes'][_0xe383('0x36')]?_0x4e520a['attributes']:_0x4c8d52[_0xe383('0x30')];if(!_0x54c4f8[_0xe383('0x31')][_0xe383('0x37')](_0xe383('0x38'))){_0x4e520a[_0xe383('0x20')]=qs[_0xe383('0x20')](_0x54c4f8[_0xe383('0x31')][_0xe383('0x20')]);_0x4e520a[_0xe383('0x1e')]=qs[_0xe383('0x1e')](_0x54c4f8['query'][_0xe383('0x1e')]);}_0x4e520a[_0xe383('0x39')]=qs[_0xe383('0x3a')](_0x54c4f8[_0xe383('0x31')][_0xe383('0x3a')]);_0x4e520a[_0xe383('0x3b')]=qs[_0xe383('0x3c')](_[_0xe383('0x3d')](_0x54c4f8[_0xe383('0x31')],_0x4c8d52[_0xe383('0x3c')]),_0x16ced4);if(_0x54c4f8[_0xe383('0x31')][_0xe383('0x3e')]){_0x4e520a['where']=_[_0xe383('0x3f')](_0x4e520a[_0xe383('0x3b')],{'$or':_[_0xe383('0x40')](_0x16ced4,function(_0xc2dbb2){if(_0xc2dbb2[_0xe383('0x2e')]!=='VIRTUAL'){var _0x5d0b27={};_0x5d0b27[_0xc2dbb2[_0xe383('0x2a')]]={'$like':'%'+_0x54c4f8[_0xe383('0x31')][_0xe383('0x3e')]+'%'};return _0x5d0b27;}})});}_0x4e520a=_[_0xe383('0x3f')]({},_0x4e520a,_0x54c4f8[_0xe383('0x41')]);var _0x39eac8={'where':_0x4e520a[_0xe383('0x3b')]};return db[_0xe383('0x42')]['count'](_0x39eac8)[_0xe383('0x26')](function(_0x5f5898){_0x54d2d8[_0xe383('0x21')]=_0x5f5898;if(_0x54c4f8[_0xe383('0x31')][_0xe383('0x43')]){_0x4e520a[_0xe383('0x44')]=[{'all':!![]}];}return db[_0xe383('0x42')][_0xe383('0x45')](_0x4e520a);})['then'](function(_0x5cd568){_0x54d2d8['rows']=_0x5cd568;return _0x54d2d8;})[_0xe383('0x26')](respondWithFilteredResult(_0x15cbe3,_0x4e520a))[_0xe383('0x46')](handleError(_0x15cbe3,null));};exports[_0xe383('0x47')]=function(_0x137484,_0x247814){var _0x5946ce={'raw':!![],'where':{'id':_0x137484[_0xe383('0x48')]['id']}},_0x1fee42={};_0x1fee42['model']=_[_0xe383('0x32')](db[_0xe383('0x42')][_0xe383('0x2c')]);_0x1fee42[_0xe383('0x31')]=_[_0xe383('0x32')](_0x137484[_0xe383('0x31')]);_0x1fee42[_0xe383('0x3c')]=_[_0xe383('0x33')](_0x1fee42['model'],_0x1fee42[_0xe383('0x31')]);_0x5946ce[_0xe383('0x34')]=_[_0xe383('0x33')](_0x1fee42['model'],qs['fields'](_0x137484[_0xe383('0x31')][_0xe383('0x35')]));_0x5946ce[_0xe383('0x34')]=_0x5946ce[_0xe383('0x34')][_0xe383('0x36')]?_0x5946ce[_0xe383('0x34')]:_0x1fee42[_0xe383('0x30')];if(_0x137484[_0xe383('0x31')][_0xe383('0x43')]){_0x5946ce['include']=[{'all':!![]}];}_0x5946ce=_[_0xe383('0x3f')]({},_0x5946ce,_0x137484[_0xe383('0x41')]);return db[_0xe383('0x42')][_0xe383('0x49')](_0x5946ce)[_0xe383('0x26')](handleEntityNotFound(_0x247814,null))[_0xe383('0x26')](respondWithResult(_0x247814,null))['catch'](handleError(_0x247814,null));};exports[_0xe383('0x4a')]=function(_0x36c7e7,_0x1c6765){return db[_0xe383('0x42')][_0xe383('0x4a')](_0x36c7e7[_0xe383('0x4b')],{})[_0xe383('0x26')](respondWithResult(_0x1c6765,0xc9))[_0xe383('0x46')](handleError(_0x1c6765,null));};exports['update']=function(_0xacaa9d,_0x50eafd){if(_0xacaa9d[_0xe383('0x4b')]['id']){delete _0xacaa9d[_0xe383('0x4b')]['id'];}return db[_0xe383('0x42')][_0xe383('0x49')]({'where':{'id':_0xacaa9d[_0xe383('0x48')]['id']}})[_0xe383('0x26')](handleEntityNotFound(_0x50eafd,null))[_0xe383('0x26')](saveUpdates(_0xacaa9d[_0xe383('0x4b')],null))['then'](respondWithResult(_0x50eafd,null))[_0xe383('0x46')](handleError(_0x50eafd,null));};exports[_0xe383('0x27')]=function(_0x3f84e7,_0xd24d5){return db[_0xe383('0x42')][_0xe383('0x49')]({'where':{'id':_0x3f84e7[_0xe383('0x48')]['id']}})[_0xe383('0x26')](handleEntityNotFound(_0xd24d5,null))[_0xe383('0x26')](removeEntity(_0xd24d5,null))[_0xe383('0x46')](handleError(_0xd24d5,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 2c919ac..d567b0b 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.model.js +++ b/server/api/intSugarcrmField/intSugarcrmField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe79=['rimraf','../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField','sugarcrm_unique_index','idField','lodash','util','moment','bluebird','request-promise','path'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbe79,0x13f));var _0x9be7=function(_0x279001,_0x42a92f){_0x279001=_0x279001-0x0;var _0x2d731f=_0xbe79[_0x279001];return _0x2d731f;};'use strict';var _=require(_0x9be7('0x0'));var util=require(_0x9be7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9be7('0x2'));var BPromise=require(_0x9be7('0x3'));var rp=require(_0x9be7('0x4'));var fs=require('fs');var path=require(_0x9be7('0x5'));var rimraf=require(_0x9be7('0x6'));var config=require(_0x9be7('0x7'));var attributes=require(_0x9be7('0x8'));module[_0x9be7('0x9')]=function(_0x1a9645,_0x18c9e1){return _0x1a9645['define'](_0x9be7('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x9be7('0xb'),'fields':[_0x9be7('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4db7=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId'];(function(_0x51b64e,_0x3b64f4){var _0x49c950=function(_0xd0f798){while(--_0xd0f798){_0x51b64e['push'](_0x51b64e['shift']());}};_0x49c950(++_0x3b64f4);}(_0x4db7,0x126));var _0x74db=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4db7[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x74db('0x0'));var logger=require(_0x74db('0x1'))(_0x74db('0x2'));var moment=require(_0x74db('0x3'));var BPromise=require('bluebird');var rp=require(_0x74db('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x74db('0x5'));var config=require(_0x74db('0x6'));var attributes=require(_0x74db('0x7'));module[_0x74db('0x8')]=function(_0xc0eb71,_0x51beea){return _0xc0eb71[_0x74db('0x9')](_0x74db('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x74db('0xb'),'fields':[_0x74db('0xc'),_0x74db('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 2b85883..6bbd7aa 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.rpc.js +++ b/server/api/intSugarcrmField/intSugarcrmField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf547=['client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4af495,_0x19dc86){var _0x5c1aeb=function(_0x3a7cae){while(--_0x3a7cae){_0x4af495['push'](_0x4af495['shift']());}};_0x5c1aeb(++_0x19dc86);}(_0xf547,0x1ed));var _0x7f54=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xf547[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x7f54('0x0'));var util=require('util');var moment=require(_0x7f54('0x1'));var BPromise=require(_0x7f54('0x2'));var rs=require(_0x7f54('0x3'));var fs=require('fs');var Redis=require(_0x7f54('0x4'));var db=require(_0x7f54('0x5'))['db'];var utils=require(_0x7f54('0x6'));var logger=require(_0x7f54('0x7'))(_0x7f54('0x8'));var config=require(_0x7f54('0x9'));var jayson=require(_0x7f54('0xa'));var client=jayson[_0x7f54('0xb')][_0x7f54('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x34945f,_0x4899b4,_0x36634a){return new BPromise(function(_0x4e700e,_0x3f43ef){return client[_0x7f54('0xd')](_0x34945f,_0x36634a)[_0x7f54('0xe')](function(_0x57e0d0){logger[_0x7f54('0xf')](_0x7f54('0x10'),_0x4899b4,_0x7f54('0x11'));logger['debug'](_0x7f54('0x12'),_0x4899b4,_0x7f54('0x11'),JSON['stringify'](_0x57e0d0));if(_0x57e0d0[_0x7f54('0x13')]){if(_0x57e0d0[_0x7f54('0x13')][_0x7f54('0x14')]===0x1f4){logger[_0x7f54('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x4899b4,_0x57e0d0[_0x7f54('0x13')][_0x7f54('0x15')]);return _0x3f43ef(_0x57e0d0['error'][_0x7f54('0x15')]);}logger[_0x7f54('0x13')](_0x7f54('0x10'),_0x4899b4,_0x57e0d0['error'][_0x7f54('0x15')]);return _0x4e700e(_0x57e0d0[_0x7f54('0x13')][_0x7f54('0x15')]);}else{logger[_0x7f54('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x4899b4,'request\x20sent');_0x4e700e(_0x57e0d0[_0x7f54('0x16')][_0x7f54('0x15')]);}})[_0x7f54('0x17')](function(_0x4b1a6d){logger[_0x7f54('0x13')](_0x7f54('0x10'),_0x4899b4,_0x4b1a6d);_0x3f43ef(_0x4b1a6d);});});} \ No newline at end of file +var _0xf3ce=['error','code','SugarcrmField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','request','then','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4ad922,_0x1538f6){var _0x3c0eef=function(_0x18d749){while(--_0x18d749){_0x4ad922['push'](_0x4ad922['shift']());}};_0x3c0eef(++_0x1538f6);}(_0xf3ce,0x141));var _0xef3c=function(_0x22f345,_0x27fa78){_0x22f345=_0x22f345-0x0;var _0x15290c=_0xf3ce[_0x22f345];return _0x15290c;};'use strict';var _=require(_0xef3c('0x0'));var util=require(_0xef3c('0x1'));var moment=require(_0xef3c('0x2'));var BPromise=require(_0xef3c('0x3'));var rs=require(_0xef3c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef3c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xef3c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xef3c('0x7'));var client=jayson[_0xef3c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a88df,_0x2c93f8,_0x2c6b7f){return new BPromise(function(_0x1a53c9,_0x545842){return client[_0xef3c('0x9')](_0x2a88df,_0x2c6b7f)[_0xef3c('0xa')](function(_0x40e632){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x2c93f8,'request\x20sent');logger[_0xef3c('0xb')](_0xef3c('0xc'),_0x2c93f8,_0xef3c('0xd'),JSON[_0xef3c('0xe')](_0x40e632));if(_0x40e632[_0xef3c('0xf')]){if(_0x40e632[_0xef3c('0xf')][_0xef3c('0x10')]===0x1f4){logger['error'](_0xef3c('0x11'),_0x2c93f8,_0x40e632['error'][_0xef3c('0x12')]);return _0x545842(_0x40e632['error']['message']);}logger['error'](_0xef3c('0x11'),_0x2c93f8,_0x40e632[_0xef3c('0xf')][_0xef3c('0x12')]);return _0x1a53c9(_0x40e632[_0xef3c('0xf')][_0xef3c('0x12')]);}else{logger['info'](_0xef3c('0x11'),_0x2c93f8,'request\x20sent');_0x1a53c9(_0x40e632[_0xef3c('0x13')][_0xef3c('0x12')]);}})[_0xef3c('0x14')](function(_0x46c5cc){logger[_0xef3c('0xf')](_0xef3c('0x11'),_0x2c93f8,_0x46c5cc);_0x545842(_0x46c5cc);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index e82a9c8..7718358 100644 --- a/server/api/intVtigerAccount/index.js +++ b/server/api/intVtigerAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae4a=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports'];(function(_0x18dfea,_0x43d571){var _0x5222e3=function(_0x3484ae){while(--_0x3484ae){_0x18dfea['push'](_0x18dfea['shift']());}};_0x5222e3(++_0x43d571);}(_0xae4a,0x68));var _0xaae4=function(_0x42e6c3,_0x348bad){_0x42e6c3=_0x42e6c3-0x0;var _0x48ab67=_0xae4a[_0x42e6c3];return _0x48ab67;};'use strict';var multer=require(_0xaae4('0x0'));var util=require(_0xaae4('0x1'));var path=require('path');var timeout=require(_0xaae4('0x2'));var express=require(_0xaae4('0x3'));var router=express['Router']();var fs_extra=require(_0xaae4('0x4'));var auth=require(_0xaae4('0x5'));var interaction=require(_0xaae4('0x6'));var config=require(_0xaae4('0x7'));var controller=require(_0xaae4('0x8'));router[_0xaae4('0x9')]('/',auth[_0xaae4('0xa')](),controller[_0xaae4('0xb')]);router[_0xaae4('0x9')](_0xaae4('0xc'),auth[_0xaae4('0xa')](),controller[_0xaae4('0xd')]);router[_0xaae4('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xaae4('0xe')]);router[_0xaae4('0x9')](_0xaae4('0xf'),auth[_0xaae4('0xa')](),controller[_0xaae4('0x10')]);router[_0xaae4('0x11')]('/',auth[_0xaae4('0xa')](),controller[_0xaae4('0x12')]);router[_0xaae4('0x11')](_0xaae4('0x13'),auth[_0xaae4('0xa')](),controller[_0xaae4('0x14')]);router[_0xaae4('0x15')](_0xaae4('0xc'),auth[_0xaae4('0xa')](),controller[_0xaae4('0x16')]);router[_0xaae4('0x17')](_0xaae4('0xc'),auth['isAuthenticated'](),controller[_0xaae4('0x18')]);module[_0xaae4('0x19')]=router; \ No newline at end of file +var _0x8781=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','update','destroy'];(function(_0x50726c,_0x4fdec4){var _0x325e0c=function(_0x4ef3cb){while(--_0x4ef3cb){_0x50726c['push'](_0x50726c['shift']());}};_0x325e0c(++_0x4fdec4);}(_0x8781,0x1c8));var _0x1878=function(_0x452089,_0x2eaebb){_0x452089=_0x452089-0x0;var _0x15d5c8=_0x8781[_0x452089];return _0x15d5c8;};'use strict';var multer=require(_0x1878('0x0'));var util=require(_0x1878('0x1'));var path=require(_0x1878('0x2'));var timeout=require(_0x1878('0x3'));var express=require(_0x1878('0x4'));var router=express[_0x1878('0x5')]();var fs_extra=require(_0x1878('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1878('0x7'));var config=require(_0x1878('0x8'));var controller=require(_0x1878('0x9'));router[_0x1878('0xa')]('/',auth[_0x1878('0xb')](),controller[_0x1878('0xc')]);router['get'](_0x1878('0xd'),auth[_0x1878('0xb')](),controller[_0x1878('0xe')]);router[_0x1878('0xa')](_0x1878('0xf'),auth[_0x1878('0xb')](),controller[_0x1878('0x10')]);router[_0x1878('0xa')](_0x1878('0x11'),auth[_0x1878('0xb')](),controller[_0x1878('0x12')]);router['post']('/',auth[_0x1878('0xb')](),controller[_0x1878('0x13')]);router[_0x1878('0x14')](_0x1878('0xf'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x1878('0x15')](_0x1878('0xd'),auth[_0x1878('0xb')](),controller[_0x1878('0x16')]);router['delete']('/:id',auth[_0x1878('0xb')](),controller[_0x1878('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 8f5d649..763e8bc 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.attributes.js +++ b/server/api/intVtigerAccount/intVtigerAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd722=['STRING','HelpDesk','sequelize'];(function(_0x15cbce,_0xda8402){var _0x257f29=function(_0x388132){while(--_0x388132){_0x15cbce['push'](_0x15cbce['shift']());}};_0x257f29(++_0xda8402);}(_0xd722,0x152));var _0x2d72=function(_0x21a91e,_0x5e3cde){_0x21a91e=_0x21a91e-0x0;var _0x3e27e7=_0xd722[_0x21a91e];return _0x3e27e7;};'use strict';var Sequelize=require(_0x2d72('0x0'));module['exports']={'name':{'type':Sequelize[_0x2d72('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x2d72('0x1')]},'username':{'type':Sequelize[_0x2d72('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x2d72('0x1')],'allowNull':![],'defaultValue':_0x2d72('0x2')},'remoteUri':{'type':Sequelize[_0x2d72('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x2d72('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x2d72('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x92bb=['sequelize','STRING'];(function(_0x412c6e,_0x10a690){var _0x2f9d5f=function(_0x15b807){while(--_0x15b807){_0x412c6e['push'](_0x412c6e['shift']());}};_0x2f9d5f(++_0x10a690);}(_0x92bb,0x1e4));var _0xb92b=function(_0x256684,_0x529c1e){_0x256684=_0x256684-0x0;var _0x37a0c9=_0x92bb[_0x256684];return _0x37a0c9;};'use strict';var Sequelize=require(_0xb92b('0x0'));module['exports']={'name':{'type':Sequelize[_0xb92b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb92b('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 6285c18..e7fc5b1 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.controller.js +++ b/server/api/intVtigerAccount/intVtigerAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x609e=['undefined','limit','count','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','map','fieldName','type','key','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','VtigerAccount','includeAll','include','rows','catch','show','params','rawAttributes','body','find','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerField','Subjects','md5','getFields','remoteUri','serverUrl','accessKey','username','moduleName','slice','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','owner','remove','editable','label','startsWith','picklist','picklistValues','vTiger\x20error:\x20','statusCode','stringify','send','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','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset'];(function(_0x3d589a,_0x565094){var _0x5bb9f5=function(_0x547574){while(--_0x547574){_0x3d589a['push'](_0x3d589a['shift']());}};_0x5bb9f5(++_0x565094);}(_0x609e,0xd0));var _0xe609=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x609e[_0x550d12];return _0x12103d;};'use strict';var emlformat=require(_0xe609('0x0'));var rimraf=require(_0xe609('0x1'));var zipdir=require(_0xe609('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe609('0x3'));var moment=require(_0xe609('0x4'));var BPromise=require(_0xe609('0x5'));var Mustache=require(_0xe609('0x6'));var util=require(_0xe609('0x7'));var path=require(_0xe609('0x8'));var sox=require(_0xe609('0x9'));var csv=require(_0xe609('0xa'));var ejs=require(_0xe609('0xb'));var fs=require('fs');var fs_extra=require(_0xe609('0xc'));var _=require(_0xe609('0xd'));var squel=require(_0xe609('0xe'));var crypto=require(_0xe609('0xf'));var jsforce=require(_0xe609('0x10'));var deskjs=require(_0xe609('0x11'));var toCsv=require('to-csv');var querystring=require(_0xe609('0x12'));var Papa=require('papaparse');var Redis=require(_0xe609('0x13'));var authService=require(_0xe609('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe609('0x15'));var hardwareService=require(_0xe609('0x16'));var logger=require('../../config/logger')(_0xe609('0x17'));var utils=require(_0xe609('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe609('0x19'));var db=require(_0xe609('0x1a'))['db'];var integrations=require(_0xe609('0x1b'));function respondWithStatusCode(_0x5d5b95,_0x5d18ec){_0x5d18ec=_0x5d18ec||0xcc;return function(_0x4349b8){if(_0x4349b8){return _0x5d5b95['sendStatus'](_0x5d18ec);}return _0x5d5b95[_0xe609('0x1c')](_0x5d18ec)[_0xe609('0x1d')]();};}function respondWithResult(_0x533be1,_0x3f2ae4){_0x3f2ae4=_0x3f2ae4||0xc8;return function(_0x42f7be){if(_0x42f7be){return _0x533be1['status'](_0x3f2ae4)[_0xe609('0x1e')](_0x42f7be);}};}function respondWithFilteredResult(_0x1e43c7,_0x18cdb9){return function(_0x1cb870){if(_0x1cb870){var _0xb8091=typeof _0x18cdb9[_0xe609('0x1f')]===_0xe609('0x20')&&typeof _0x18cdb9[_0xe609('0x21')]===_0xe609('0x20');var _0x2c97ec=_0x1cb870[_0xe609('0x22')];var _0x21debd=_0xb8091?0x0:_0x18cdb9[_0xe609('0x1f')];var _0x5f2da5=_0xb8091?_0x1cb870['count']:_0x18cdb9[_0xe609('0x1f')]+_0x18cdb9['limit'];var _0x7755e;if(_0x5f2da5>=_0x2c97ec){_0x5f2da5=_0x2c97ec;_0x7755e=0xc8;}else{_0x7755e=0xce;}_0x1e43c7['status'](_0x7755e);return _0x1e43c7['set'](_0xe609('0x23'),_0x21debd+'-'+_0x5f2da5+'/'+_0x2c97ec)[_0xe609('0x1e')](_0x1cb870);}return null;};}function patchUpdates(_0x56ac47){return function(_0x551823){try{jsonpatch['apply'](_0x551823,_0x56ac47,!![]);}catch(_0x217fa8){return BPromise[_0xe609('0x24')](_0x217fa8);}return _0x551823[_0xe609('0x25')]();};}function saveUpdates(_0x1f8bab,_0x4fff02){return function(_0x184da0){if(_0x184da0){return _0x184da0[_0xe609('0x26')](_0x1f8bab)['then'](function(_0x297d67){return _0x297d67;});}return null;};}function removeEntity(_0x1b1bf4,_0x33e620){return function(_0x5c0a46){if(_0x5c0a46){return _0x5c0a46[_0xe609('0x27')]()[_0xe609('0x28')](function(){_0x1b1bf4[_0xe609('0x1c')](0xcc)[_0xe609('0x1d')]();});}};}function handleEntityNotFound(_0x171cd7,_0x308278){return function(_0x3c467e){if(!_0x3c467e){_0x171cd7[_0xe609('0x29')](0x194);}return _0x3c467e;};}function handleError(_0x51c5f9,_0x36dc41){_0x36dc41=_0x36dc41||0x1f4;return function(_0x26a0d9){logger[_0xe609('0x2a')](_0x26a0d9[_0xe609('0x2b')]);if(_0x26a0d9[_0xe609('0x2c')]){delete _0x26a0d9[_0xe609('0x2c')];}_0x51c5f9['status'](_0x36dc41)['send'](_0x26a0d9);};}exports['index']=function(_0x55ba8e,_0x27bed8){var _0x66fa7d={},_0x14512e={},_0x3ac234={'count':0x0,'rows':[]};var _0x1acb23=_[_0xe609('0x2d')](db['VtigerAccount']['rawAttributes'],function(_0x2084f1){return{'name':_0x2084f1[_0xe609('0x2e')],'type':_0x2084f1[_0xe609('0x2f')][_0xe609('0x30')]};});_0x14512e['model']=_[_0xe609('0x2d')](_0x1acb23,_0xe609('0x2c'));_0x14512e['query']=_[_0xe609('0x31')](_0x55ba8e[_0xe609('0x32')]);_0x14512e[_0xe609('0x33')]=_['intersection'](_0x14512e[_0xe609('0x34')],_0x14512e['query']);_0x66fa7d['attributes']=_[_0xe609('0x35')](_0x14512e[_0xe609('0x34')],qs[_0xe609('0x36')](_0x55ba8e[_0xe609('0x32')]['fields']));_0x66fa7d['attributes']=_0x66fa7d[_0xe609('0x37')][_0xe609('0x38')]?_0x66fa7d[_0xe609('0x37')]:_0x14512e[_0xe609('0x34')];if(!_0x55ba8e['query'][_0xe609('0x39')]('nolimit')){_0x66fa7d['limit']=qs[_0xe609('0x21')](_0x55ba8e[_0xe609('0x32')]['limit']);_0x66fa7d[_0xe609('0x1f')]=qs['offset'](_0x55ba8e[_0xe609('0x32')][_0xe609('0x1f')]);}_0x66fa7d[_0xe609('0x3a')]=qs[_0xe609('0x3b')](_0x55ba8e[_0xe609('0x32')][_0xe609('0x3b')]);_0x66fa7d[_0xe609('0x3c')]=qs['filters'](_[_0xe609('0x3d')](_0x55ba8e[_0xe609('0x32')],_0x14512e[_0xe609('0x33')]),_0x1acb23);if(_0x55ba8e[_0xe609('0x32')]['filter']){_0x66fa7d[_0xe609('0x3c')]=_[_0xe609('0x3e')](_0x66fa7d[_0xe609('0x3c')],{'$or':_[_0xe609('0x2d')](_0x1acb23,function(_0x20942a){if(_0x20942a[_0xe609('0x2f')]!==_0xe609('0x3f')){var _0x4a2499={};_0x4a2499[_0x20942a[_0xe609('0x2c')]]={'$like':'%'+_0x55ba8e[_0xe609('0x32')][_0xe609('0x40')]+'%'};return _0x4a2499;}})});}_0x66fa7d=_[_0xe609('0x3e')]({},_0x66fa7d,_0x55ba8e[_0xe609('0x41')]);var _0x3d30e9={'where':_0x66fa7d[_0xe609('0x3c')]};return db[_0xe609('0x42')][_0xe609('0x22')](_0x3d30e9)[_0xe609('0x28')](function(_0x27bb14){_0x3ac234[_0xe609('0x22')]=_0x27bb14;if(_0x55ba8e[_0xe609('0x32')][_0xe609('0x43')]){_0x66fa7d[_0xe609('0x44')]=[{'all':!![]}];}return db['VtigerAccount']['findAll'](_0x66fa7d);})[_0xe609('0x28')](function(_0x322b73){_0x3ac234[_0xe609('0x45')]=_0x322b73;return _0x3ac234;})[_0xe609('0x28')](respondWithFilteredResult(_0x27bed8,_0x66fa7d))[_0xe609('0x46')](handleError(_0x27bed8,null));};exports[_0xe609('0x47')]=function(_0x19e05b,_0x4c8274){var _0x22d259={'raw':![],'where':{'id':_0x19e05b[_0xe609('0x48')]['id']}},_0x424a4e={};_0x424a4e[_0xe609('0x34')]=_[_0xe609('0x31')](db[_0xe609('0x42')][_0xe609('0x49')]);_0x424a4e['query']=_[_0xe609('0x31')](_0x19e05b['query']);_0x424a4e[_0xe609('0x33')]=_[_0xe609('0x35')](_0x424a4e['model'],_0x424a4e[_0xe609('0x32')]);_0x22d259[_0xe609('0x37')]=_[_0xe609('0x35')](_0x424a4e[_0xe609('0x34')],qs['fields'](_0x19e05b['query'][_0xe609('0x36')]));_0x22d259[_0xe609('0x37')]=_0x22d259[_0xe609('0x37')]['length']?_0x22d259[_0xe609('0x37')]:_0x424a4e[_0xe609('0x34')];if(_0x19e05b[_0xe609('0x32')][_0xe609('0x43')]){_0x22d259[_0xe609('0x44')]=[{'all':!![]}];}_0x22d259=_[_0xe609('0x3e')]({},_0x22d259,_0x19e05b[_0xe609('0x41')]);return db[_0xe609('0x42')]['find'](_0x22d259)['then'](handleEntityNotFound(_0x4c8274,null))[_0xe609('0x28')](respondWithResult(_0x4c8274,null))[_0xe609('0x46')](handleError(_0x4c8274,null));};exports['create']=function(_0x2106d9,_0x4c8500){return db[_0xe609('0x42')]['create'](_0x2106d9[_0xe609('0x4a')],{})[_0xe609('0x28')](respondWithResult(_0x4c8500,0xc9))[_0xe609('0x46')](handleError(_0x4c8500,null));};exports[_0xe609('0x26')]=function(_0x140ed0,_0x55586f){if(_0x140ed0[_0xe609('0x4a')]['id']){delete _0x140ed0['body']['id'];}return db[_0xe609('0x42')][_0xe609('0x4b')]({'where':{'id':_0x140ed0[_0xe609('0x48')]['id']}})[_0xe609('0x28')](handleEntityNotFound(_0x55586f,null))[_0xe609('0x28')](saveUpdates(_0x140ed0[_0xe609('0x4a')],null))[_0xe609('0x28')](respondWithResult(_0x55586f,null))[_0xe609('0x46')](handleError(_0x55586f,null));};exports['destroy']=function(_0x4490be,_0x270172){return db['VtigerAccount'][_0xe609('0x4b')]({'where':{'id':_0x4490be[_0xe609('0x48')]['id']}})['then'](handleEntityNotFound(_0x270172,null))[_0xe609('0x28')](removeEntity(_0x270172,null))['catch'](handleError(_0x270172,null));};exports[_0xe609('0x4c')]=function(_0x5d7976,_0x539b8b,_0x4118d6){var _0x84b8ca={};var _0x50a2a7={};var _0x907334;var _0x85238f;return db[_0xe609('0x42')][_0xe609('0x4d')]({'where':{'id':_0x5d7976[_0xe609('0x48')]['id']}})['then'](handleEntityNotFound(_0x539b8b,null))[_0xe609('0x28')](function(_0x2eb369){if(_0x2eb369){_0x907334=_0x2eb369;_0x50a2a7['model']=_[_0xe609('0x31')](db[_0xe609('0x4e')][_0xe609('0x49')]);_0x50a2a7['query']=_['keys'](_0x5d7976[_0xe609('0x32')]);_0x50a2a7['filters']=_['intersection'](_0x50a2a7[_0xe609('0x34')],_0x50a2a7['query']);_0x84b8ca[_0xe609('0x37')]=_[_0xe609('0x35')](_0x50a2a7[_0xe609('0x34')],qs[_0xe609('0x36')](_0x5d7976[_0xe609('0x32')]['fields']));_0x84b8ca[_0xe609('0x37')]=_0x84b8ca['attributes']['length']?_0x84b8ca[_0xe609('0x37')]:_0x50a2a7[_0xe609('0x34')];_0x84b8ca['order']=qs[_0xe609('0x3b')](_0x5d7976['query'][_0xe609('0x3b')]);_0x84b8ca[_0xe609('0x3c')]=qs['filters'](_[_0xe609('0x3d')](_0x5d7976[_0xe609('0x32')],_0x50a2a7[_0xe609('0x33')]));if(_0x5d7976[_0xe609('0x32')][_0xe609('0x40')]){_0x84b8ca[_0xe609('0x3c')]=_['merge'](_0x84b8ca['where'],{'$or':_['map'](_0x84b8ca['attributes'],function(_0x24676b){var _0x2f827a={};_0x2f827a[_0x24676b]={'$like':'%'+_0x5d7976[_0xe609('0x32')]['filter']+'%'};return _0x2f827a;})});}_0x84b8ca=_[_0xe609('0x3e')]({},_0x84b8ca,_0x5d7976['options']);return _0x907334['getConfigurations'](_0x84b8ca);}})[_0xe609('0x28')](function(_0x4e53cc){if(_0x4e53cc){_0x85238f=_0x4e53cc[_0xe609('0x38')];if(!_0x5d7976['query']['hasOwnProperty']('nolimit')){_0x84b8ca[_0xe609('0x21')]=qs['limit'](_0x5d7976[_0xe609('0x32')][_0xe609('0x21')]);_0x84b8ca['offset']=qs[_0xe609('0x1f')](_0x5d7976['query'][_0xe609('0x1f')]);}return _0x907334['getConfigurations'](_0x84b8ca);}})[_0xe609('0x28')](function(_0x3a46ec){if(_0x3a46ec){return _0x3a46ec?{'count':_0x85238f,'rows':_0x3a46ec}:null;}})[_0xe609('0x28')](respondWithResult(_0x539b8b,null))[_0xe609('0x46')](handleError(_0x539b8b,null));};exports[_0xe609('0x4f')]=function(_0x1ecedd,_0x2cf62f,_0x113acf){if(_0x1ecedd[_0xe609('0x4a')]['id']){delete _0x1ecedd[_0xe609('0x4a')]['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x1ecedd[_0xe609('0x48')]['id']}})[_0xe609('0x28')](handleEntityNotFound(_0x2cf62f,null))['then'](function(_0x3abc6c){if(_0x3abc6c){_0x1ecedd[_0xe609('0x4a')][_0xe609('0x50')]=_0x3abc6c['id'];_0x1ecedd[_0xe609('0x4a')]['Subjects']=integrations[_0xe609('0x51')](_0x1ecedd[_0xe609('0x4a')][_0xe609('0x52')],_0x1ecedd['body'][_0xe609('0x2f')]);_0x1ecedd[_0xe609('0x4a')][_0xe609('0x53')]=integrations[_0xe609('0x54')](_0x1ecedd[_0xe609('0x4a')][_0xe609('0x52')],_0x1ecedd[_0xe609('0x4a')][_0xe609('0x2f')]);return db[_0xe609('0x4e')]['create'](_0x1ecedd[_0xe609('0x4a')],{'include':[{'model':db[_0xe609('0x55')],'as':_0xe609('0x56')},{'model':db[_0xe609('0x55')],'as':_0xe609('0x53')}]});}return null;})[_0xe609('0x28')](respondWithResult(_0x2cf62f,null))[_0xe609('0x46')](handleError(_0x2cf62f,null));};var md5=require(_0xe609('0x57'));exports[_0xe609('0x58')]=function(_0x54e3b5,_0x4d305f,_0x3d2cb3){var _0x4e58dc=null;var _0x486a21=null;var _0x1964b8=null;var _0x328538=null;var _0x37106e='';return db['VtigerAccount'][_0xe609('0x4d')]({'where':{'id':_0x54e3b5['params']['id']},'attributes':['id',_0xe609('0x2c'),'username','description','moduleName',_0xe609('0x59'),_0xe609('0x5a'),_0xe609('0x5b')]})[_0xe609('0x28')](handleEntityNotFound(_0x4d305f,null))[_0xe609('0x28')](function(_0x24c9aa){if(_0x24c9aa){_0x4e58dc=_0x24c9aa[_0xe609('0x5c')];_0x486a21=_0x24c9aa[_0xe609('0x5b')];_0x1964b8=_0x24c9aa[_0xe609('0x5d')];_0x37106e=_0x24c9aa[_0xe609('0x59')];var _0x34e560=_0x37106e[_0xe609('0x5e')](-0x1);if(_0x34e560==='/'){_0x37106e=_0x37106e[_0xe609('0x5f')](0x0,_0x37106e[_0xe609('0x60')](_0x34e560));}_0x328538=util['format'](_0xe609('0x61'),_0x37106e);var _0x29720b={'method':_0xe609('0x62'),'uri':_0x328538,'qs':{'operation':_0xe609('0x63'),'username':_0x24c9aa[_0xe609('0x5c')]},'json':!![]};return rp(_0x29720b);}})['then'](function(_0x1a0b93){if(_0x1a0b93[_0xe609('0x64')]){var _0xe3af28={'method':_0xe609('0x65'),'uri':_0x328538,'form':{'operation':_0xe609('0x66'),'username':_0x4e58dc,'accessKey':md5(_0x1a0b93[_0xe609('0x67')][_0xe609('0x68')]+_0x486a21)},'json':!![]};return rp(_0xe3af28);}})[_0xe609('0x28')](function(_0x58dfbc){if(_0x58dfbc[_0xe609('0x64')]){var _0xedc04d={'method':_0xe609('0x62'),'uri':_0x328538,'qs':{'operation':_0xe609('0x69'),'username':_0x4e58dc,'sessionName':_0x58dfbc[_0xe609('0x67')][_0xe609('0x6a')],'elementType':_0x1964b8},'json':!![]};return rp(_0xedc04d);}})[_0xe609('0x28')](function(_0x2f859a){if(_0x2f859a[_0xe609('0x64')]){var _0x39c0df=[_0xe609('0x6b'),'reference',_0xe609('0x6c')];_[_0xe609('0x6d')](_0x2f859a['result'][_0xe609('0x36')],function(_0x2a5bea){return _0x39c0df['includes'](_0x2a5bea[_0xe609('0x2f')][_0xe609('0x2c')]);});_[_0xe609('0x6d')](_0x2f859a[_0xe609('0x67')]['fields'],function(_0x1ae358){return _0x1ae358[_0xe609('0x6e')]==='false';});return{'count':_0x2f859a[_0xe609('0x67')][_0xe609('0x36')]['length'],'rows':_[_0xe609('0x2d')](_0x2f859a[_0xe609('0x67')][_0xe609('0x36')],function(_0x51cf87){return{'id':_0x51cf87[_0xe609('0x2c')],'name':_0x51cf87[_0xe609('0x6f')],'custom':_[_0xe609('0x70')](_0x51cf87['name'],'cf_')?!![]:![],'options':_0x51cf87['type'][_0xe609('0x2c')]===_0xe609('0x71')&&_0x51cf87[_0xe609('0x2f')][_0xe609('0x72')][_0xe609('0x38')]>0x0?_['map'](_0x51cf87['type'][_0xe609('0x72')],function(_0x3f09e7){return{'name':_0x3f09e7[_0xe609('0x6f')],'value':_0x3f09e7['value']};}):[]};})};}})[_0xe609('0x28')](respondWithResult(_0x4d305f,null))['catch'](function(_0x4a104b){console['log'](_0xe609('0x73')+_0x4a104b);var _0x17209a=_0x54e3b5[_0xe609('0x32')]['test']?0x1f4:_0x4a104b[_0xe609('0x74')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x17209a,JSON[_0xe609('0x75')](_0x4a104b));delete _0x4a104b[_0xe609('0x2c')];if(_0x17209a===0x191){_0x17209a=0x190;}_0x4d305f[_0xe609('0x1c')](_0x17209a)[_0xe609('0x76')](_0x54e3b5['query']['test']?{'message':_0xe609('0x77'),'statusCode':_0x4a104b[_0xe609('0x74')]}:_0x4a104b);});}; \ No newline at end of file +var _0xaf33=['create','body','find','params','getConfigurations','findOne','VtigerConfiguration','pick','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','getFields','description','moduleName','remoteUri','username','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','login','result','describe','sessionName','owner','remove','editable','false','label','cf_','picklist','picklistValues','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','name','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0xaf33,0x113));var _0x3af3=function(_0x170cbb,_0x9093e){_0x170cbb=_0x170cbb-0x0;var _0x39fae4=_0xaf33[_0x170cbb];return _0x39fae4;};'use strict';var emlformat=require(_0x3af3('0x0'));var rimraf=require(_0x3af3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3af3('0x2'));var rp=require(_0x3af3('0x3'));var moment=require(_0x3af3('0x4'));var BPromise=require(_0x3af3('0x5'));var Mustache=require(_0x3af3('0x6'));var util=require(_0x3af3('0x7'));var path=require(_0x3af3('0x8'));var sox=require('sox');var csv=require(_0x3af3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3af3('0xa'));var _=require(_0x3af3('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3af3('0xc'));var deskjs=require(_0x3af3('0xd'));var toCsv=require(_0x3af3('0x9'));var querystring=require(_0x3af3('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3af3('0xf'));var as=require(_0x3af3('0x10'));var hardwareService=require(_0x3af3('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x3af3('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x3af3('0x13'));var db=require(_0x3af3('0x14'))['db'];var integrations=require(_0x3af3('0x15'));function respondWithStatusCode(_0x263071,_0x7a3de5){_0x7a3de5=_0x7a3de5||0xcc;return function(_0x57b8c7){if(_0x57b8c7){return _0x263071['sendStatus'](_0x7a3de5);}return _0x263071[_0x3af3('0x16')](_0x7a3de5)[_0x3af3('0x17')]();};}function respondWithResult(_0x16ee5d,_0x37af07){_0x37af07=_0x37af07||0xc8;return function(_0x4cd37f){if(_0x4cd37f){return _0x16ee5d['status'](_0x37af07)[_0x3af3('0x18')](_0x4cd37f);}};}function respondWithFilteredResult(_0x5c0df0,_0x3b3bc7){return function(_0xa9e848){if(_0xa9e848){var _0x3f3e0f=typeof _0x3b3bc7[_0x3af3('0x19')]===_0x3af3('0x1a')&&typeof _0x3b3bc7[_0x3af3('0x1b')]===_0x3af3('0x1a');var _0x1dd6b2=_0xa9e848[_0x3af3('0x1c')];var _0x4d31f4=_0x3f3e0f?0x0:_0x3b3bc7[_0x3af3('0x19')];var _0x55528a=_0x3f3e0f?_0xa9e848[_0x3af3('0x1c')]:_0x3b3bc7[_0x3af3('0x19')]+_0x3b3bc7[_0x3af3('0x1b')];var _0x5995fd;if(_0x55528a>=_0x1dd6b2){_0x55528a=_0x1dd6b2;_0x5995fd=0xc8;}else{_0x5995fd=0xce;}_0x5c0df0[_0x3af3('0x16')](_0x5995fd);return _0x5c0df0[_0x3af3('0x1d')](_0x3af3('0x1e'),_0x4d31f4+'-'+_0x55528a+'/'+_0x1dd6b2)[_0x3af3('0x18')](_0xa9e848);}return null;};}function patchUpdates(_0x17d804){return function(_0x4ad4c6){try{jsonpatch[_0x3af3('0x1f')](_0x4ad4c6,_0x17d804,!![]);}catch(_0x2805fe){return BPromise[_0x3af3('0x20')](_0x2805fe);}return _0x4ad4c6[_0x3af3('0x21')]();};}function saveUpdates(_0x4bd2b7,_0x5d4091){return function(_0x47087f){if(_0x47087f){return _0x47087f[_0x3af3('0x22')](_0x4bd2b7)[_0x3af3('0x23')](function(_0x4d280a){return _0x4d280a;});}return null;};}function removeEntity(_0x543f59,_0x1ce4b8){return function(_0x894c37){if(_0x894c37){return _0x894c37[_0x3af3('0x24')]()[_0x3af3('0x23')](function(){_0x543f59[_0x3af3('0x16')](0xcc)[_0x3af3('0x17')]();});}};}function handleEntityNotFound(_0x5e8165,_0x1fe2ed){return function(_0x428906){if(!_0x428906){_0x5e8165[_0x3af3('0x25')](0x194);}return _0x428906;};}function handleError(_0x179c99,_0x2cbacf){_0x2cbacf=_0x2cbacf||0x1f4;return function(_0x197bdb){logger[_0x3af3('0x26')](_0x197bdb[_0x3af3('0x27')]);if(_0x197bdb['name']){delete _0x197bdb['name'];}_0x179c99[_0x3af3('0x16')](_0x2cbacf)[_0x3af3('0x28')](_0x197bdb);};}exports[_0x3af3('0x29')]=function(_0x4e3ac2,_0x39eb6d){var _0x33ab5b={},_0x1b12e7={},_0x554012={'count':0x0,'rows':[]};var _0x396c43=_[_0x3af3('0x2a')](db[_0x3af3('0x2b')][_0x3af3('0x2c')],function(_0x561ec8){return{'name':_0x561ec8[_0x3af3('0x2d')],'type':_0x561ec8[_0x3af3('0x2e')][_0x3af3('0x2f')]};});_0x1b12e7[_0x3af3('0x30')]=_[_0x3af3('0x2a')](_0x396c43,_0x3af3('0x31'));_0x1b12e7['query']=_[_0x3af3('0x32')](_0x4e3ac2['query']);_0x1b12e7[_0x3af3('0x33')]=_[_0x3af3('0x34')](_0x1b12e7[_0x3af3('0x30')],_0x1b12e7[_0x3af3('0x35')]);_0x33ab5b[_0x3af3('0x36')]=_[_0x3af3('0x34')](_0x1b12e7[_0x3af3('0x30')],qs[_0x3af3('0x37')](_0x4e3ac2[_0x3af3('0x35')][_0x3af3('0x37')]));_0x33ab5b['attributes']=_0x33ab5b[_0x3af3('0x36')][_0x3af3('0x38')]?_0x33ab5b['attributes']:_0x1b12e7[_0x3af3('0x30')];if(!_0x4e3ac2[_0x3af3('0x35')]['hasOwnProperty'](_0x3af3('0x39'))){_0x33ab5b[_0x3af3('0x1b')]=qs[_0x3af3('0x1b')](_0x4e3ac2['query'][_0x3af3('0x1b')]);_0x33ab5b[_0x3af3('0x19')]=qs[_0x3af3('0x19')](_0x4e3ac2[_0x3af3('0x35')][_0x3af3('0x19')]);}_0x33ab5b[_0x3af3('0x3a')]=qs[_0x3af3('0x3b')](_0x4e3ac2['query'][_0x3af3('0x3b')]);_0x33ab5b[_0x3af3('0x3c')]=qs[_0x3af3('0x33')](_['pick'](_0x4e3ac2[_0x3af3('0x35')],_0x1b12e7[_0x3af3('0x33')]),_0x396c43);if(_0x4e3ac2['query'][_0x3af3('0x3d')]){_0x33ab5b[_0x3af3('0x3c')]=_[_0x3af3('0x3e')](_0x33ab5b[_0x3af3('0x3c')],{'$or':_[_0x3af3('0x2a')](_0x396c43,function(_0x68568){if(_0x68568[_0x3af3('0x2e')]!==_0x3af3('0x3f')){var _0x3deb4c={};_0x3deb4c[_0x68568['name']]={'$like':'%'+_0x4e3ac2[_0x3af3('0x35')]['filter']+'%'};return _0x3deb4c;}})});}_0x33ab5b=_[_0x3af3('0x3e')]({},_0x33ab5b,_0x4e3ac2[_0x3af3('0x40')]);var _0x549e8b={'where':_0x33ab5b[_0x3af3('0x3c')]};return db[_0x3af3('0x2b')][_0x3af3('0x1c')](_0x549e8b)[_0x3af3('0x23')](function(_0x210680){_0x554012[_0x3af3('0x1c')]=_0x210680;if(_0x4e3ac2['query'][_0x3af3('0x41')]){_0x33ab5b[_0x3af3('0x42')]=[{'all':!![]}];}return db['VtigerAccount'][_0x3af3('0x43')](_0x33ab5b);})[_0x3af3('0x23')](function(_0x2c7ba4){_0x554012[_0x3af3('0x44')]=_0x2c7ba4;return _0x554012;})['then'](respondWithFilteredResult(_0x39eb6d,_0x33ab5b))[_0x3af3('0x45')](handleError(_0x39eb6d,null));};exports['show']=function(_0x28b10d,_0x1b5f6a){var _0x1038c1={'raw':![],'where':{'id':_0x28b10d['params']['id']}},_0x5e0bbe={};_0x5e0bbe[_0x3af3('0x30')]=_[_0x3af3('0x32')](db[_0x3af3('0x2b')][_0x3af3('0x2c')]);_0x5e0bbe[_0x3af3('0x35')]=_[_0x3af3('0x32')](_0x28b10d[_0x3af3('0x35')]);_0x5e0bbe['filters']=_[_0x3af3('0x34')](_0x5e0bbe[_0x3af3('0x30')],_0x5e0bbe[_0x3af3('0x35')]);_0x1038c1['attributes']=_[_0x3af3('0x34')](_0x5e0bbe['model'],qs[_0x3af3('0x37')](_0x28b10d[_0x3af3('0x35')]['fields']));_0x1038c1[_0x3af3('0x36')]=_0x1038c1['attributes'][_0x3af3('0x38')]?_0x1038c1[_0x3af3('0x36')]:_0x5e0bbe[_0x3af3('0x30')];if(_0x28b10d[_0x3af3('0x35')][_0x3af3('0x41')]){_0x1038c1[_0x3af3('0x42')]=[{'all':!![]}];}_0x1038c1=_[_0x3af3('0x3e')]({},_0x1038c1,_0x28b10d[_0x3af3('0x40')]);return db[_0x3af3('0x2b')]['find'](_0x1038c1)[_0x3af3('0x23')](handleEntityNotFound(_0x1b5f6a,null))['then'](respondWithResult(_0x1b5f6a,null))[_0x3af3('0x45')](handleError(_0x1b5f6a,null));};exports[_0x3af3('0x46')]=function(_0x3bd530,_0x267ec6){return db[_0x3af3('0x2b')]['create'](_0x3bd530['body'],{})[_0x3af3('0x23')](respondWithResult(_0x267ec6,0xc9))['catch'](handleError(_0x267ec6,null));};exports['update']=function(_0x1ad8c5,_0x2b517a){if(_0x1ad8c5['body']['id']){delete _0x1ad8c5[_0x3af3('0x47')]['id'];}return db['VtigerAccount'][_0x3af3('0x48')]({'where':{'id':_0x1ad8c5['params']['id']}})['then'](handleEntityNotFound(_0x2b517a,null))[_0x3af3('0x23')](saveUpdates(_0x1ad8c5['body'],null))['then'](respondWithResult(_0x2b517a,null))[_0x3af3('0x45')](handleError(_0x2b517a,null));};exports['destroy']=function(_0x13ede9,_0x354d14){return db[_0x3af3('0x2b')][_0x3af3('0x48')]({'where':{'id':_0x13ede9[_0x3af3('0x49')]['id']}})[_0x3af3('0x23')](handleEntityNotFound(_0x354d14,null))['then'](removeEntity(_0x354d14,null))[_0x3af3('0x45')](handleError(_0x354d14,null));};exports[_0x3af3('0x4a')]=function(_0x2cc665,_0x2203b4,_0x330286){var _0x42af2c={};var _0x47e85c={};var _0x26b23e;var _0x4ad53a;return db['VtigerAccount'][_0x3af3('0x4b')]({'where':{'id':_0x2cc665['params']['id']}})[_0x3af3('0x23')](handleEntityNotFound(_0x2203b4,null))[_0x3af3('0x23')](function(_0x12bd7c){if(_0x12bd7c){_0x26b23e=_0x12bd7c;_0x47e85c['model']=_['keys'](db[_0x3af3('0x4c')][_0x3af3('0x2c')]);_0x47e85c[_0x3af3('0x35')]=_[_0x3af3('0x32')](_0x2cc665[_0x3af3('0x35')]);_0x47e85c['filters']=_[_0x3af3('0x34')](_0x47e85c['model'],_0x47e85c[_0x3af3('0x35')]);_0x42af2c[_0x3af3('0x36')]=_[_0x3af3('0x34')](_0x47e85c[_0x3af3('0x30')],qs['fields'](_0x2cc665[_0x3af3('0x35')]['fields']));_0x42af2c[_0x3af3('0x36')]=_0x42af2c[_0x3af3('0x36')][_0x3af3('0x38')]?_0x42af2c['attributes']:_0x47e85c[_0x3af3('0x30')];_0x42af2c[_0x3af3('0x3a')]=qs[_0x3af3('0x3b')](_0x2cc665['query']['sort']);_0x42af2c['where']=qs['filters'](_[_0x3af3('0x4d')](_0x2cc665[_0x3af3('0x35')],_0x47e85c[_0x3af3('0x33')]));if(_0x2cc665[_0x3af3('0x35')]['filter']){_0x42af2c[_0x3af3('0x3c')]=_['merge'](_0x42af2c[_0x3af3('0x3c')],{'$or':_[_0x3af3('0x2a')](_0x42af2c[_0x3af3('0x36')],function(_0x30cd50){var _0x236a69={};_0x236a69[_0x30cd50]={'$like':'%'+_0x2cc665['query'][_0x3af3('0x3d')]+'%'};return _0x236a69;})});}_0x42af2c=_[_0x3af3('0x3e')]({},_0x42af2c,_0x2cc665['options']);return _0x26b23e['getConfigurations'](_0x42af2c);}})[_0x3af3('0x23')](function(_0x14b6aa){if(_0x14b6aa){_0x4ad53a=_0x14b6aa[_0x3af3('0x38')];if(!_0x2cc665[_0x3af3('0x35')][_0x3af3('0x4e')](_0x3af3('0x39'))){_0x42af2c[_0x3af3('0x1b')]=qs[_0x3af3('0x1b')](_0x2cc665[_0x3af3('0x35')][_0x3af3('0x1b')]);_0x42af2c[_0x3af3('0x19')]=qs[_0x3af3('0x19')](_0x2cc665[_0x3af3('0x35')][_0x3af3('0x19')]);}return _0x26b23e[_0x3af3('0x4a')](_0x42af2c);}})[_0x3af3('0x23')](function(_0x47e7cf){if(_0x47e7cf){return _0x47e7cf?{'count':_0x4ad53a,'rows':_0x47e7cf}:null;}})['then'](respondWithResult(_0x2203b4,null))[_0x3af3('0x45')](handleError(_0x2203b4,null));};exports[_0x3af3('0x4f')]=function(_0x42eb6b,_0x39757c,_0x422a8b){if(_0x42eb6b[_0x3af3('0x47')]['id']){delete _0x42eb6b[_0x3af3('0x47')]['id'];}return db[_0x3af3('0x2b')][_0x3af3('0x4b')]({'where':{'id':_0x42eb6b['params']['id']}})[_0x3af3('0x23')](handleEntityNotFound(_0x39757c,null))[_0x3af3('0x23')](function(_0x5bdd19){if(_0x5bdd19){_0x42eb6b['body']['AccountId']=_0x5bdd19['id'];_0x42eb6b[_0x3af3('0x47')][_0x3af3('0x50')]=integrations[_0x3af3('0x51')](_0x42eb6b[_0x3af3('0x47')][_0x3af3('0x52')],_0x42eb6b[_0x3af3('0x47')]['type']);_0x42eb6b[_0x3af3('0x47')][_0x3af3('0x53')]=integrations['getDescriptions'](_0x42eb6b[_0x3af3('0x47')][_0x3af3('0x52')],_0x42eb6b[_0x3af3('0x47')][_0x3af3('0x2e')]);return db['VtigerConfiguration'][_0x3af3('0x46')](_0x42eb6b[_0x3af3('0x47')],{'include':[{'model':db[_0x3af3('0x54')],'as':_0x3af3('0x50')},{'model':db['VtigerField'],'as':_0x3af3('0x53')}]});}return null;})[_0x3af3('0x23')](respondWithResult(_0x39757c,null))[_0x3af3('0x45')](handleError(_0x39757c,null));};var md5=require(_0x3af3('0x55'));exports[_0x3af3('0x56')]=function(_0x575fa7,_0xc11272,_0x81bced){var _0x2e2b06=null;var _0x807f3d=null;var _0x2dc8f5=null;var _0x27ece6=null;var _0x169e27='';return db['VtigerAccount'][_0x3af3('0x4b')]({'where':{'id':_0x575fa7[_0x3af3('0x49')]['id']},'attributes':['id',_0x3af3('0x31'),'username',_0x3af3('0x57'),_0x3af3('0x58'),_0x3af3('0x59'),'serverUrl','accessKey']})['then'](handleEntityNotFound(_0xc11272,null))['then'](function(_0x41e17b){if(_0x41e17b){_0x2e2b06=_0x41e17b[_0x3af3('0x5a')];_0x807f3d=_0x41e17b['accessKey'];_0x2dc8f5=_0x41e17b[_0x3af3('0x58')];_0x169e27=_0x41e17b['remoteUri'];var _0x304433=_0x169e27[_0x3af3('0x5b')](-0x1);if(_0x304433==='/'){_0x169e27=_0x169e27[_0x3af3('0x5c')](0x0,_0x169e27[_0x3af3('0x5d')](_0x304433));}_0x27ece6=util[_0x3af3('0x5e')](_0x3af3('0x5f'),_0x169e27);var _0x21b8fa={'method':_0x3af3('0x60'),'uri':_0x27ece6,'qs':{'operation':_0x3af3('0x61'),'username':_0x41e17b['username']},'json':!![]};return rp(_0x21b8fa);}})[_0x3af3('0x23')](function(_0x2c6d30){if(_0x2c6d30[_0x3af3('0x62')]){var _0xc079c9={'method':'POST','uri':_0x27ece6,'form':{'operation':_0x3af3('0x63'),'username':_0x2e2b06,'accessKey':md5(_0x2c6d30[_0x3af3('0x64')]['token']+_0x807f3d)},'json':!![]};return rp(_0xc079c9);}})[_0x3af3('0x23')](function(_0xdf7be3){if(_0xdf7be3[_0x3af3('0x62')]){var _0x2f00d3={'method':_0x3af3('0x60'),'uri':_0x27ece6,'qs':{'operation':_0x3af3('0x65'),'username':_0x2e2b06,'sessionName':_0xdf7be3['result'][_0x3af3('0x66')],'elementType':_0x2dc8f5},'json':!![]};return rp(_0x2f00d3);}})['then'](function(_0x259d15){if(_0x259d15['success']){var _0x2360e3=['autogenerated','reference',_0x3af3('0x67')];_[_0x3af3('0x68')](_0x259d15['result']['fields'],function(_0x1be20e){return _0x2360e3['includes'](_0x1be20e[_0x3af3('0x2e')]['name']);});_[_0x3af3('0x68')](_0x259d15[_0x3af3('0x64')]['fields'],function(_0x5d1b98){return _0x5d1b98[_0x3af3('0x69')]===_0x3af3('0x6a');});return{'count':_0x259d15[_0x3af3('0x64')][_0x3af3('0x37')]['length'],'rows':_[_0x3af3('0x2a')](_0x259d15[_0x3af3('0x64')]['fields'],function(_0x438bf3){return{'id':_0x438bf3['name'],'name':_0x438bf3[_0x3af3('0x6b')],'custom':_['startsWith'](_0x438bf3[_0x3af3('0x31')],_0x3af3('0x6c'))?!![]:![],'options':_0x438bf3[_0x3af3('0x2e')][_0x3af3('0x31')]===_0x3af3('0x6d')&&_0x438bf3[_0x3af3('0x2e')][_0x3af3('0x6e')][_0x3af3('0x38')]>0x0?_[_0x3af3('0x2a')](_0x438bf3[_0x3af3('0x2e')][_0x3af3('0x6e')],function(_0x1bea06){return{'name':_0x1bea06['label'],'value':_0x1bea06['value']};}):[]};})};}})[_0x3af3('0x23')](respondWithResult(_0xc11272,null))[_0x3af3('0x45')](function(_0x550f65){console['log']('vTiger\x20error:\x20'+_0x550f65);var _0x42b6f5=_0x575fa7[_0x3af3('0x35')][_0x3af3('0x6f')]?0x1f4:_0x550f65[_0x3af3('0x70')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x3af3('0x56'),_0x42b6f5,JSON[_0x3af3('0x71')](_0x550f65));delete _0x550f65[_0x3af3('0x31')];if(_0x42b6f5===0x191){_0x42b6f5=0x190;}_0xc11272[_0x3af3('0x16')](_0x42b6f5)['send'](_0x575fa7[_0x3af3('0x35')][_0x3af3('0x6f')]?{'message':_0x3af3('0x72'),'statusCode':_0x550f65['statusCode']}:_0x550f65);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 6d2321f..4eb7b2d 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.model.js +++ b/server/api/intVtigerAccount/intVtigerAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaaf5=['define','int_vtiger_accounts','util','../../config/logger','api','bluebird','path','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x3ab47f,_0x441b32){var _0x1221fe=function(_0x5176b6){while(--_0x5176b6){_0x3ab47f['push'](_0x3ab47f['shift']());}};_0x1221fe(++_0x441b32);}(_0xaaf5,0x66));var _0x5aaf=function(_0x284ed6,_0x2a7a0d){_0x284ed6=_0x284ed6-0x0;var _0x4965cf=_0xaaf5[_0x284ed6];return _0x4965cf;};'use strict';var _=require('lodash');var util=require(_0x5aaf('0x0'));var logger=require(_0x5aaf('0x1'))(_0x5aaf('0x2'));var moment=require('moment');var BPromise=require(_0x5aaf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5aaf('0x4'));var rimraf=require('rimraf');var config=require(_0x5aaf('0x5'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x5aaf('0x6'));module[_0x5aaf('0x7')]=function(_0xd8d9d,_0x45a8e2){return _0xd8d9d[_0x5aaf('0x8')]('VtigerAccount',attributes,{'tableName':_0x5aaf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeccd=['./intVtigerAccount.attributes','exports','VtigerAccount','int_vtiger_accounts','lodash','util','api','bluebird','request-promise','../../config/environment'];(function(_0x1d2960,_0x4f763c){var _0x2bb982=function(_0x10ec67){while(--_0x10ec67){_0x1d2960['push'](_0x1d2960['shift']());}};_0x2bb982(++_0x4f763c);}(_0xeccd,0xea));var _0xdecc=function(_0x5cc506,_0x2761a0){_0x5cc506=_0x5cc506-0x0;var _0x269462=_0xeccd[_0x5cc506];return _0x269462;};'use strict';var _=require(_0xdecc('0x0'));var util=require(_0xdecc('0x1'));var logger=require('../../config/logger')(_0xdecc('0x2'));var moment=require('moment');var BPromise=require(_0xdecc('0x3'));var rp=require(_0xdecc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdecc('0x5'));var attributes=require(_0xdecc('0x6'));var integrations=require('../../components/integrations/configuration');module[_0xdecc('0x7')]=function(_0x177155,_0x6398a0){return _0x177155['define'](_0xdecc('0x8'),attributes,{'tableName':_0xdecc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 1e34298..2e6b8f3 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.rpc.js +++ b/server/api/intVtigerAccount/intVtigerAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c76=['findAll','options','raw','where','attributes','map','include','model','GetVtigerAccount','debug','ShowVtigerAccount','VtigerAccount','find','then','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x52cbea,_0x193a8f){var _0x1761f4=function(_0x4c9edb){while(--_0x4c9edb){_0x52cbea['push'](_0x52cbea['shift']());}};_0x1761f4(++_0x193a8f);}(_0x6c76,0x184));var _0x66c7=function(_0x3f1915,_0x274383){_0x3f1915=_0x3f1915-0x0;var _0x1d41e5=_0x6c76[_0x3f1915];return _0x1d41e5;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var moment=require(_0x66c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x66c7('0x3'));var fs=require('fs');var Redis=require(_0x66c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x66c7('0x5'))(_0x66c7('0x6'));var config=require('../../config/environment');var jayson=require(_0x66c7('0x7'));var client=jayson[_0x66c7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23408c,_0x4dffcd,_0x4fa6ce){return new BPromise(function(_0x208d06,_0x2b0065){return client[_0x66c7('0x9')](_0x23408c,_0x4fa6ce)['then'](function(_0x20c010){logger[_0x66c7('0xa')](_0x66c7('0xb'),_0x4dffcd,_0x66c7('0xc'));logger['debug'](_0x66c7('0xd'),_0x4dffcd,_0x66c7('0xc'),JSON[_0x66c7('0xe')](_0x20c010));if(_0x20c010[_0x66c7('0xf')]){if(_0x20c010[_0x66c7('0xf')][_0x66c7('0x10')]===0x1f4){logger[_0x66c7('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x2b0065(_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);}logger[_0x66c7('0xf')](_0x66c7('0xb'),_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x208d06(_0x20c010[_0x66c7('0xf')]['message']);}else{logger[_0x66c7('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x4dffcd,_0x66c7('0xc'));_0x208d06(_0x20c010[_0x66c7('0x12')][_0x66c7('0x11')]);}})[_0x66c7('0x13')](function(_0x22b262){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x4dffcd,_0x22b262);_0x2b0065(_0x22b262);});});}exports['GetVtigerAccount']=function(_0x5129f6){var _0x8ad572=this;return new Promise(function(_0x19f29d,_0x47a299){return db['VtigerAccount'][_0x66c7('0x14')]({'raw':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')][_0x66c7('0x16')]===undefined?!![]:![]:!![],'where':_0x5129f6['options']?_0x5129f6['options'][_0x66c7('0x17')]||null:null,'attributes':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')][_0x66c7('0x18')]||null:null,'limit':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')]['limit']||null:null,'include':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')]['include']?_[_0x66c7('0x19')](_0x5129f6[_0x66c7('0x15')][_0x66c7('0x1a')],function(_0x1fc9d3){return{'model':db[_0x1fc9d3['model']],'as':_0x1fc9d3['as'],'attributes':_0x1fc9d3[_0x66c7('0x18')],'include':_0x1fc9d3[_0x66c7('0x1a')]?_['map'](_0x1fc9d3[_0x66c7('0x1a')],function(_0x11a6b9){return{'model':db[_0x11a6b9[_0x66c7('0x1b')]],'as':_0x11a6b9['as'],'attributes':_0x11a6b9[_0x66c7('0x18')],'include':_0x11a6b9[_0x66c7('0x1a')]?_['map'](_0x11a6b9['include'],function(_0x4e514a){return{'model':db[_0x4e514a[_0x66c7('0x1b')]],'as':_0x4e514a['as'],'attributes':_0x4e514a[_0x66c7('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9afd50){logger[_0x66c7('0xa')](_0x66c7('0x1c'),_0x5129f6);logger[_0x66c7('0x1d')](_0x66c7('0x1c'),_0x5129f6,JSON[_0x66c7('0xe')](_0x9afd50));_0x19f29d(_0x9afd50);})['catch'](function(_0xccefb2){logger[_0x66c7('0xf')](_0x66c7('0x1c'),_0xccefb2[_0x66c7('0x11')],_0x5129f6);_0x47a299(_0x8ad572[_0x66c7('0xf')](0x1f4,_0xccefb2['message']));});});};exports[_0x66c7('0x1e')]=function(_0x4f1a34){var _0xfbd97=this;return new Promise(function(_0x543fbf,_0x296875){return db[_0x66c7('0x1f')][_0x66c7('0x20')]({'raw':_0x4f1a34[_0x66c7('0x15')]?_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x16')]===undefined?!![]:![]:!![],'where':_0x4f1a34['options']?_0x4f1a34['options'][_0x66c7('0x17')]||null:null,'attributes':_0x4f1a34[_0x66c7('0x15')]?_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x18')]||null:null,'include':_0x4f1a34[_0x66c7('0x15')]?_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x1a')]?_[_0x66c7('0x19')](_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x1a')],function(_0x1fd460){return{'model':db[_0x1fd460[_0x66c7('0x1b')]],'as':_0x1fd460['as'],'attributes':_0x1fd460['attributes'],'include':_0x1fd460['include']?_[_0x66c7('0x19')](_0x1fd460[_0x66c7('0x1a')],function(_0x367ad5){return{'model':db[_0x367ad5[_0x66c7('0x1b')]],'as':_0x367ad5['as'],'attributes':_0x367ad5[_0x66c7('0x18')],'include':_0x367ad5[_0x66c7('0x1a')]?_[_0x66c7('0x19')](_0x367ad5['include'],function(_0x30b90f){return{'model':db[_0x30b90f[_0x66c7('0x1b')]],'as':_0x30b90f['as'],'attributes':_0x30b90f[_0x66c7('0x18')]};}):[]};}):[]};}):[]:[]})[_0x66c7('0x21')](function(_0x1e5993){logger[_0x66c7('0xa')](_0x66c7('0x1e'),_0x4f1a34);logger[_0x66c7('0x1d')](_0x66c7('0x1e'),_0x4f1a34,JSON[_0x66c7('0xe')](_0x1e5993));_0x543fbf(_0x1e5993);})[_0x66c7('0x13')](function(_0x4cd663){logger['error'](_0x66c7('0x1e'),_0x4cd663[_0x66c7('0x11')],_0x4f1a34);_0x296875(_0xfbd97[_0x66c7('0xf')](0x1f4,_0x4cd663['message']));});});}; \ No newline at end of file +var _0x593e=['findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowVtigerAccount','VtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount'];(function(_0x2fdbda,_0x2e4f89){var _0x24896b=function(_0x5e451a){while(--_0x5e451a){_0x2fdbda['push'](_0x2fdbda['shift']());}};_0x24896b(++_0x2e4f89);}(_0x593e,0xcb));var _0xe593=function(_0x4d07da,_0x368872){_0x4d07da=_0x4d07da-0x0;var _0x44cb98=_0x593e[_0x4d07da];return _0x44cb98;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var moment=require(_0xe593('0x2'));var BPromise=require(_0xe593('0x3'));var rs=require(_0xe593('0x4'));var fs=require('fs');var Redis=require(_0xe593('0x5'));var db=require(_0xe593('0x6'))['db'];var utils=require(_0xe593('0x7'));var logger=require('../../config/logger')(_0xe593('0x8'));var config=require(_0xe593('0x9'));var jayson=require(_0xe593('0xa'));var client=jayson[_0xe593('0xb')][_0xe593('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14cff3,_0x1cda29,_0x307dad){return new BPromise(function(_0x169c08,_0x265099){return client['request'](_0x14cff3,_0x307dad)[_0xe593('0xd')](function(_0x4091db){logger[_0xe593('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x1cda29,'request\x20sent');logger[_0xe593('0xf')](_0xe593('0x10'),_0x1cda29,_0xe593('0x11'),JSON['stringify'](_0x4091db));if(_0x4091db[_0xe593('0x12')]){if(_0x4091db[_0xe593('0x12')][_0xe593('0x13')]===0x1f4){logger[_0xe593('0x12')](_0xe593('0x14'),_0x1cda29,_0x4091db[_0xe593('0x12')][_0xe593('0x15')]);return _0x265099(_0x4091db[_0xe593('0x12')][_0xe593('0x15')]);}logger[_0xe593('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x1cda29,_0x4091db[_0xe593('0x12')][_0xe593('0x15')]);return _0x169c08(_0x4091db['error'][_0xe593('0x15')]);}else{logger[_0xe593('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x1cda29,_0xe593('0x11'));_0x169c08(_0x4091db[_0xe593('0x16')][_0xe593('0x15')]);}})[_0xe593('0x17')](function(_0x3408ec){logger[_0xe593('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x1cda29,_0x3408ec);_0x265099(_0x3408ec);});});}exports[_0xe593('0x18')]=function(_0x470d07){var _0x5f57ce=this;return new Promise(function(_0xd1020e,_0x28b5ed){return db['VtigerAccount'][_0xe593('0x19')]({'raw':_0x470d07[_0xe593('0x1a')]?_0x470d07[_0xe593('0x1a')][_0xe593('0x1b')]===undefined?!![]:![]:!![],'where':_0x470d07[_0xe593('0x1a')]?_0x470d07[_0xe593('0x1a')][_0xe593('0x1c')]||null:null,'attributes':_0x470d07['options']?_0x470d07['options'][_0xe593('0x1d')]||null:null,'limit':_0x470d07['options']?_0x470d07['options'][_0xe593('0x1e')]||null:null,'include':_0x470d07[_0xe593('0x1a')]?_0x470d07['options'][_0xe593('0x1f')]?_['map'](_0x470d07[_0xe593('0x1a')][_0xe593('0x1f')],function(_0x185cea){return{'model':db[_0x185cea[_0xe593('0x20')]],'as':_0x185cea['as'],'attributes':_0x185cea[_0xe593('0x1d')],'include':_0x185cea[_0xe593('0x1f')]?_[_0xe593('0x21')](_0x185cea[_0xe593('0x1f')],function(_0x4fc483){return{'model':db[_0x4fc483[_0xe593('0x20')]],'as':_0x4fc483['as'],'attributes':_0x4fc483[_0xe593('0x1d')],'include':_0x4fc483['include']?_['map'](_0x4fc483[_0xe593('0x1f')],function(_0x25238f){return{'model':db[_0x25238f[_0xe593('0x20')]],'as':_0x25238f['as'],'attributes':_0x25238f[_0xe593('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe593('0xd')](function(_0x27a3d2){logger['info'](_0xe593('0x18'),_0x470d07);logger['debug'](_0xe593('0x18'),_0x470d07,JSON[_0xe593('0x22')](_0x27a3d2));_0xd1020e(_0x27a3d2);})['catch'](function(_0x337ee0){logger['error'](_0xe593('0x18'),_0x337ee0[_0xe593('0x15')],_0x470d07);_0x28b5ed(_0x5f57ce[_0xe593('0x12')](0x1f4,_0x337ee0['message']));});});};exports[_0xe593('0x23')]=function(_0x13f44){var _0x3066ed=this;return new Promise(function(_0x338222,_0x2588be){return db[_0xe593('0x24')][_0xe593('0x25')]({'raw':_0x13f44['options']?_0x13f44[_0xe593('0x1a')][_0xe593('0x1b')]===undefined?!![]:![]:!![],'where':_0x13f44['options']?_0x13f44[_0xe593('0x1a')]['where']||null:null,'attributes':_0x13f44[_0xe593('0x1a')]?_0x13f44[_0xe593('0x1a')][_0xe593('0x1d')]||null:null,'include':_0x13f44[_0xe593('0x1a')]?_0x13f44[_0xe593('0x1a')][_0xe593('0x1f')]?_[_0xe593('0x21')](_0x13f44[_0xe593('0x1a')][_0xe593('0x1f')],function(_0x4305de){return{'model':db[_0x4305de['model']],'as':_0x4305de['as'],'attributes':_0x4305de[_0xe593('0x1d')],'include':_0x4305de[_0xe593('0x1f')]?_[_0xe593('0x21')](_0x4305de['include'],function(_0x4fefb3){return{'model':db[_0x4fefb3[_0xe593('0x20')]],'as':_0x4fefb3['as'],'attributes':_0x4fefb3['attributes'],'include':_0x4fefb3[_0xe593('0x1f')]?_[_0xe593('0x21')](_0x4fefb3[_0xe593('0x1f')],function(_0x30511c){return{'model':db[_0x30511c[_0xe593('0x20')]],'as':_0x30511c['as'],'attributes':_0x30511c[_0xe593('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe593('0xd')](function(_0x4889cc){logger['info'](_0xe593('0x23'),_0x13f44);logger['debug'](_0xe593('0x23'),_0x13f44,JSON['stringify'](_0x4889cc));_0x338222(_0x4889cc);})[_0xe593('0x17')](function(_0x5b9589){logger['error'](_0xe593('0x23'),_0x5b9589[_0xe593('0x15')],_0x13f44);_0x2588be(_0x3066ed[_0xe593('0x12')](0x1f4,_0x5b9589['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 1b146c5..78914ca 100644 --- a/server/api/intVtigerConfiguration/index.js +++ b/server/api/intVtigerConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3eeb=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','index','isAuthenticated','show','getFields','/:id/subjects','/:id/descriptions','post','create','put','update','delete'];(function(_0x21f4ec,_0x10230a){var _0x8b6a3f=function(_0x12123e){while(--_0x12123e){_0x21f4ec['push'](_0x21f4ec['shift']());}};_0x8b6a3f(++_0x10230a);}(_0x3eeb,0x1a3));var _0xb3ee=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3eeb[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xb3ee('0x0'));var util=require(_0xb3ee('0x1'));var path=require(_0xb3ee('0x2'));var timeout=require(_0xb3ee('0x3'));var express=require(_0xb3ee('0x4'));var router=express[_0xb3ee('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb3ee('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb3ee('0x7'));var controller=require(_0xb3ee('0x8'));router[_0xb3ee('0x9')]('/',auth['isAuthenticated'](),controller[_0xb3ee('0xa')]);router['get']('/:id',auth[_0xb3ee('0xb')](),controller[_0xb3ee('0xc')]);router[_0xb3ee('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xb3ee('0xd')]);router[_0xb3ee('0x9')](_0xb3ee('0xe'),auth[_0xb3ee('0xb')](),controller['getSubjects']);router['get'](_0xb3ee('0xf'),auth[_0xb3ee('0xb')](),controller['getDescriptions']);router[_0xb3ee('0x10')]('/',auth[_0xb3ee('0xb')](),controller[_0xb3ee('0x11')]);router[_0xb3ee('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xb3ee('0x13')]);router[_0xb3ee('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xb3ee('0x15')]=router; \ No newline at end of file +var _0xab73=['../../config/environment','isAuthenticated','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xab73,0x1ae));var _0x3ab7=function(_0x56d1f9,_0x364410){_0x56d1f9=_0x56d1f9-0x0;var _0x1ceed8=_0xab73[_0x56d1f9];return _0x1ceed8;};'use strict';var multer=require('multer');var util=require(_0x3ab7('0x0'));var path=require('path');var timeout=require(_0x3ab7('0x1'));var express=require(_0x3ab7('0x2'));var router=express[_0x3ab7('0x3')]();var fs_extra=require(_0x3ab7('0x4'));var auth=require(_0x3ab7('0x5'));var interaction=require(_0x3ab7('0x6'));var config=require(_0x3ab7('0x7'));var controller=require('./intVtigerConfiguration.controller');router['get']('/',auth[_0x3ab7('0x8')](),controller['index']);router[_0x3ab7('0x9')](_0x3ab7('0xa'),auth[_0x3ab7('0x8')](),controller[_0x3ab7('0xb')]);router[_0x3ab7('0x9')](_0x3ab7('0xc'),auth[_0x3ab7('0x8')](),controller[_0x3ab7('0xd')]);router[_0x3ab7('0x9')](_0x3ab7('0xe'),auth['isAuthenticated'](),controller[_0x3ab7('0xf')]);router[_0x3ab7('0x9')](_0x3ab7('0x10'),auth[_0x3ab7('0x8')](),controller[_0x3ab7('0x11')]);router[_0x3ab7('0x12')]('/',auth[_0x3ab7('0x8')](),controller['create']);router[_0x3ab7('0x13')](_0x3ab7('0xa'),auth['isAuthenticated'](),controller[_0x3ab7('0x14')]);router['delete'](_0x3ab7('0xa'),auth[_0x3ab7('0x8')](),controller[_0x3ab7('0x15')]);module[_0x3ab7('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 3f11127..9ebd7a1 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c54=['sequelize','exports','STRING'];(function(_0xe24d25,_0x37bb1c){var _0x1be9ee=function(_0x22e4a4){while(--_0x22e4a4){_0xe24d25['push'](_0xe24d25['shift']());}};_0x1be9ee(++_0x37bb1c);}(_0x8c54,0x6c));var _0x48c5=function(_0xc5439c,_0xbc5fe3){_0xc5439c=_0xc5439c-0x0;var _0x35d758=_0x8c54[_0xc5439c];return _0x35d758;};'use strict';var Sequelize=require(_0x48c5('0x0'));module[_0x48c5('0x1')]={'name':{'type':Sequelize[_0x48c5('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9f7e=['exports','STRING'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x9f7e,0x1b6));var _0xe9f7=function(_0x1f330f,_0x16450b){_0x1f330f=_0x1f330f-0x0;var _0x1b2583=_0x9f7e[_0x1f330f];return _0x1b2583;};'use strict';var Sequelize=require('sequelize');module[_0xe9f7('0x0')]={'name':{'type':Sequelize[_0xe9f7('0x1')]},'description':{'type':Sequelize[_0xe9f7('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 49f5dcd..dc57f28 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cfc=['find','create','body','update','params','findOne','VtigerField','getFields','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','limit','undefined','offset','count','Content-Range','json','reject','save','then','destroy','sendStatus','error','stack','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','keys','options'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x6cfc,0x14a));var _0xc6cf=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x6cfc[_0x13b8f3];return _0x1a6d06;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc6cf('0x0'));var zipdir=require(_0xc6cf('0x1'));var jsonpatch=require(_0xc6cf('0x2'));var rp=require(_0xc6cf('0x3'));var moment=require(_0xc6cf('0x4'));var BPromise=require(_0xc6cf('0x5'));var Mustache=require('mustache');var util=require(_0xc6cf('0x6'));var path=require('path');var sox=require(_0xc6cf('0x7'));var csv=require(_0xc6cf('0x8'));var ejs=require(_0xc6cf('0x9'));var fs=require('fs');var fs_extra=require(_0xc6cf('0xa'));var _=require('lodash');var squel=require(_0xc6cf('0xb'));var crypto=require(_0xc6cf('0xc'));var jsforce=require(_0xc6cf('0xd'));var deskjs=require(_0xc6cf('0xe'));var toCsv=require(_0xc6cf('0x8'));var querystring=require(_0xc6cf('0xf'));var Papa=require(_0xc6cf('0x10'));var Redis=require('ioredis');var authService=require(_0xc6cf('0x11'));var qs=require(_0xc6cf('0x12'));var as=require(_0xc6cf('0x13'));var hardwareService=require(_0xc6cf('0x14'));var logger=require(_0xc6cf('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xc6cf('0x16'));var licenseUtil=require(_0xc6cf('0x17'));var db=require(_0xc6cf('0x18'))['db'];function respondWithStatusCode(_0x464561,_0x53e0eb){_0x53e0eb=_0x53e0eb||0xcc;return function(_0x4d2993){if(_0x4d2993){return _0x464561['sendStatus'](_0x53e0eb);}return _0x464561[_0xc6cf('0x19')](_0x53e0eb)[_0xc6cf('0x1a')]();};}function respondWithResult(_0x2276a8,_0x2e4a8e){_0x2e4a8e=_0x2e4a8e||0xc8;return function(_0x1d7b16){if(_0x1d7b16){return _0x2276a8[_0xc6cf('0x19')](_0x2e4a8e)['json'](_0x1d7b16);}};}function respondWithFilteredResult(_0x77674b,_0x245917){return function(_0x175452){if(_0x175452){var _0x2f3c14=typeof _0x245917['offset']==='undefined'&&typeof _0x245917[_0xc6cf('0x1b')]===_0xc6cf('0x1c');var _0x18412b=_0x175452['count'];var _0x36c984=_0x2f3c14?0x0:_0x245917[_0xc6cf('0x1d')];var _0x18a7dc=_0x2f3c14?_0x175452[_0xc6cf('0x1e')]:_0x245917['offset']+_0x245917[_0xc6cf('0x1b')];var _0x5bb87a;if(_0x18a7dc>=_0x18412b){_0x18a7dc=_0x18412b;_0x5bb87a=0xc8;}else{_0x5bb87a=0xce;}_0x77674b[_0xc6cf('0x19')](_0x5bb87a);return _0x77674b['set'](_0xc6cf('0x1f'),_0x36c984+'-'+_0x18a7dc+'/'+_0x18412b)[_0xc6cf('0x20')](_0x175452);}return null;};}function patchUpdates(_0x134e43){return function(_0x5965c2){try{jsonpatch['apply'](_0x5965c2,_0x134e43,!![]);}catch(_0x487697){return BPromise[_0xc6cf('0x21')](_0x487697);}return _0x5965c2[_0xc6cf('0x22')]();};}function saveUpdates(_0x3194d5,_0x25ba2d){return function(_0x3ad7df){if(_0x3ad7df){return _0x3ad7df['update'](_0x3194d5)[_0xc6cf('0x23')](function(_0xfcb496){return _0xfcb496;});}return null;};}function removeEntity(_0x3bbd1d,_0x2f5bbc){return function(_0x25382e){if(_0x25382e){return _0x25382e[_0xc6cf('0x24')]()[_0xc6cf('0x23')](function(){_0x3bbd1d['status'](0xcc)[_0xc6cf('0x1a')]();});}};}function handleEntityNotFound(_0x1bd5d3,_0x415a2b){return function(_0x68c439){if(!_0x68c439){_0x1bd5d3[_0xc6cf('0x25')](0x194);}return _0x68c439;};}function handleError(_0x3bd3a0,_0x36c045){_0x36c045=_0x36c045||0x1f4;return function(_0x590a83){logger[_0xc6cf('0x26')](_0x590a83[_0xc6cf('0x27')]);if(_0x590a83['name']){delete _0x590a83[_0xc6cf('0x28')];}_0x3bd3a0[_0xc6cf('0x19')](_0x36c045)[_0xc6cf('0x29')](_0x590a83);};}exports['index']=function(_0x180207,_0x4e8d1c){var _0x11212d={},_0x19ce8b={},_0x2a1049={'count':0x0,'rows':[]};var _0x33675f=_[_0xc6cf('0x2a')](db[_0xc6cf('0x2b')][_0xc6cf('0x2c')],function(_0x172b46){return{'name':_0x172b46[_0xc6cf('0x2d')],'type':_0x172b46[_0xc6cf('0x2e')][_0xc6cf('0x2f')]};});_0x19ce8b[_0xc6cf('0x30')]=_[_0xc6cf('0x2a')](_0x33675f,_0xc6cf('0x28'));_0x19ce8b[_0xc6cf('0x31')]=_['keys'](_0x180207['query']);_0x19ce8b[_0xc6cf('0x32')]=_[_0xc6cf('0x33')](_0x19ce8b[_0xc6cf('0x30')],_0x19ce8b[_0xc6cf('0x31')]);_0x11212d['attributes']=_[_0xc6cf('0x33')](_0x19ce8b[_0xc6cf('0x30')],qs[_0xc6cf('0x34')](_0x180207[_0xc6cf('0x31')][_0xc6cf('0x34')]));_0x11212d[_0xc6cf('0x35')]=_0x11212d[_0xc6cf('0x35')][_0xc6cf('0x36')]?_0x11212d['attributes']:_0x19ce8b[_0xc6cf('0x30')];if(!_0x180207[_0xc6cf('0x31')][_0xc6cf('0x37')](_0xc6cf('0x38'))){_0x11212d[_0xc6cf('0x1b')]=qs['limit'](_0x180207[_0xc6cf('0x31')]['limit']);_0x11212d[_0xc6cf('0x1d')]=qs[_0xc6cf('0x1d')](_0x180207[_0xc6cf('0x31')][_0xc6cf('0x1d')]);}_0x11212d[_0xc6cf('0x39')]=qs['sort'](_0x180207[_0xc6cf('0x31')][_0xc6cf('0x3a')]);_0x11212d[_0xc6cf('0x3b')]=qs[_0xc6cf('0x32')](_[_0xc6cf('0x3c')](_0x180207[_0xc6cf('0x31')],_0x19ce8b['filters']),_0x33675f);if(_0x180207[_0xc6cf('0x31')][_0xc6cf('0x3d')]){_0x11212d['where']=_['merge'](_0x11212d[_0xc6cf('0x3b')],{'$or':_[_0xc6cf('0x2a')](_0x33675f,function(_0x1ef816){if(_0x1ef816['type']!=='VIRTUAL'){var _0x7db649={};_0x7db649[_0x1ef816['name']]={'$like':'%'+_0x180207[_0xc6cf('0x31')][_0xc6cf('0x3d')]+'%'};return _0x7db649;}})});}_0x11212d=_[_0xc6cf('0x3e')]({},_0x11212d,_0x180207['options']);var _0x25a7a3={'where':_0x11212d['where']};return db[_0xc6cf('0x2b')][_0xc6cf('0x1e')](_0x25a7a3)['then'](function(_0x457797){_0x2a1049['count']=_0x457797;if(_0x180207[_0xc6cf('0x31')][_0xc6cf('0x3f')]){_0x11212d[_0xc6cf('0x40')]=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x11212d);})['then'](function(_0x1d7ff7){_0x2a1049[_0xc6cf('0x41')]=_0x1d7ff7;return _0x2a1049;})['then'](respondWithFilteredResult(_0x4e8d1c,_0x11212d))[_0xc6cf('0x42')](handleError(_0x4e8d1c,null));};exports[_0xc6cf('0x43')]=function(_0x210338,_0x3fd7e0){var _0x4cab5d={'raw':![],'where':{'id':_0x210338['params']['id']}},_0x21c04d={};_0x21c04d[_0xc6cf('0x30')]=_[_0xc6cf('0x44')](db[_0xc6cf('0x2b')][_0xc6cf('0x2c')]);_0x21c04d['query']=_[_0xc6cf('0x44')](_0x210338[_0xc6cf('0x31')]);_0x21c04d[_0xc6cf('0x32')]=_[_0xc6cf('0x33')](_0x21c04d[_0xc6cf('0x30')],_0x21c04d[_0xc6cf('0x31')]);_0x4cab5d[_0xc6cf('0x35')]=_['intersection'](_0x21c04d[_0xc6cf('0x30')],qs[_0xc6cf('0x34')](_0x210338[_0xc6cf('0x31')][_0xc6cf('0x34')]));_0x4cab5d[_0xc6cf('0x35')]=_0x4cab5d[_0xc6cf('0x35')][_0xc6cf('0x36')]?_0x4cab5d[_0xc6cf('0x35')]:_0x21c04d[_0xc6cf('0x30')];if(_0x210338[_0xc6cf('0x31')][_0xc6cf('0x3f')]){_0x4cab5d[_0xc6cf('0x40')]=[{'all':!![]}];}_0x4cab5d=_[_0xc6cf('0x3e')]({},_0x4cab5d,_0x210338[_0xc6cf('0x45')]);return db[_0xc6cf('0x2b')][_0xc6cf('0x46')](_0x4cab5d)[_0xc6cf('0x23')](handleEntityNotFound(_0x3fd7e0,null))[_0xc6cf('0x23')](respondWithResult(_0x3fd7e0,null))['catch'](handleError(_0x3fd7e0,null));};exports[_0xc6cf('0x47')]=function(_0x10de44,_0x194e7e){return db['VtigerConfiguration'][_0xc6cf('0x47')](_0x10de44[_0xc6cf('0x48')],{})[_0xc6cf('0x23')](respondWithResult(_0x194e7e,0xc9))['catch'](handleError(_0x194e7e,null));};exports[_0xc6cf('0x49')]=function(_0x3c9c3a,_0x46b017){if(_0x3c9c3a[_0xc6cf('0x48')]['id']){delete _0x3c9c3a['body']['id'];}return db[_0xc6cf('0x2b')][_0xc6cf('0x46')]({'where':{'id':_0x3c9c3a[_0xc6cf('0x4a')]['id']}})[_0xc6cf('0x23')](handleEntityNotFound(_0x46b017,null))[_0xc6cf('0x23')](saveUpdates(_0x3c9c3a[_0xc6cf('0x48')],null))['then'](respondWithResult(_0x46b017,null))[_0xc6cf('0x42')](handleError(_0x46b017,null));};exports['destroy']=function(_0x3790dc,_0x5bd324){return db['VtigerConfiguration'][_0xc6cf('0x46')]({'where':{'id':_0x3790dc['params']['id']}})[_0xc6cf('0x23')](handleEntityNotFound(_0x5bd324,null))['then'](removeEntity(_0x5bd324,null))[_0xc6cf('0x42')](handleError(_0x5bd324,null));};exports['getFields']=function(_0x1e8b0e,_0x1f74b2,_0x513a54){var _0x19514e={};var _0x277c25={};var _0x1b5019;var _0x26dba8;return db[_0xc6cf('0x2b')][_0xc6cf('0x4b')]({'where':{'id':_0x1e8b0e['params']['id']}})['then'](handleEntityNotFound(_0x1f74b2,null))[_0xc6cf('0x23')](function(_0x4f981a){if(_0x4f981a){_0x1b5019=_0x4f981a;_0x277c25[_0xc6cf('0x30')]=_['keys'](db[_0xc6cf('0x4c')]['rawAttributes']);_0x277c25[_0xc6cf('0x31')]=_[_0xc6cf('0x44')](_0x1e8b0e['query']);_0x277c25['filters']=_[_0xc6cf('0x33')](_0x277c25[_0xc6cf('0x30')],_0x277c25[_0xc6cf('0x31')]);_0x19514e[_0xc6cf('0x35')]=_[_0xc6cf('0x33')](_0x277c25[_0xc6cf('0x30')],qs['fields'](_0x1e8b0e[_0xc6cf('0x31')][_0xc6cf('0x34')]));_0x19514e['attributes']=_0x19514e['attributes']['length']?_0x19514e['attributes']:_0x277c25[_0xc6cf('0x30')];_0x19514e['order']=qs['sort'](_0x1e8b0e['query']['sort']);_0x19514e[_0xc6cf('0x3b')]=qs['filters'](_['pick'](_0x1e8b0e[_0xc6cf('0x31')],_0x277c25[_0xc6cf('0x32')]));if(_0x1e8b0e[_0xc6cf('0x31')][_0xc6cf('0x3d')]){_0x19514e[_0xc6cf('0x3b')]=_[_0xc6cf('0x3e')](_0x19514e[_0xc6cf('0x3b')],{'$or':_[_0xc6cf('0x2a')](_0x19514e[_0xc6cf('0x35')],function(_0xa6dc0b){var _0x18bc54={};_0x18bc54[_0xa6dc0b]={'$like':'%'+_0x1e8b0e[_0xc6cf('0x31')][_0xc6cf('0x3d')]+'%'};return _0x18bc54;})});}_0x19514e=_[_0xc6cf('0x3e')]({},_0x19514e,_0x1e8b0e[_0xc6cf('0x45')]);return _0x1b5019[_0xc6cf('0x4d')](_0x19514e);}})[_0xc6cf('0x23')](function(_0x47eb7e){if(_0x47eb7e){_0x26dba8=_0x47eb7e['length'];if(!_0x1e8b0e[_0xc6cf('0x31')][_0xc6cf('0x37')](_0xc6cf('0x38'))){_0x19514e[_0xc6cf('0x1b')]=qs[_0xc6cf('0x1b')](_0x1e8b0e[_0xc6cf('0x31')][_0xc6cf('0x1b')]);_0x19514e[_0xc6cf('0x1d')]=qs['offset'](_0x1e8b0e[_0xc6cf('0x31')][_0xc6cf('0x1d')]);}return _0x1b5019[_0xc6cf('0x4d')](_0x19514e);}})[_0xc6cf('0x23')](function(_0x499a6a){if(_0x499a6a){return _0x499a6a?{'count':_0x26dba8,'rows':_0x499a6a}:null;}})[_0xc6cf('0x23')](respondWithResult(_0x1f74b2,null))['catch'](handleError(_0x1f74b2,null));};exports['getSubjects']=function(_0x437877,_0x4edfd5,_0x1f3915){var _0x2eb5fc={};var _0x135bf4={};var _0x449ef1;var _0x526746;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x437877['params']['id']}})[_0xc6cf('0x23')](handleEntityNotFound(_0x4edfd5,null))[_0xc6cf('0x23')](function(_0x4cb84d){if(_0x4cb84d){_0x449ef1=_0x4cb84d;_0x135bf4[_0xc6cf('0x30')]=_[_0xc6cf('0x44')](db[_0xc6cf('0x4c')][_0xc6cf('0x2c')]);_0x135bf4['query']=_['keys'](_0x437877[_0xc6cf('0x31')]);_0x135bf4[_0xc6cf('0x32')]=_['intersection'](_0x135bf4[_0xc6cf('0x30')],_0x135bf4[_0xc6cf('0x31')]);_0x2eb5fc['attributes']=_[_0xc6cf('0x33')](_0x135bf4['model'],qs[_0xc6cf('0x34')](_0x437877[_0xc6cf('0x31')][_0xc6cf('0x34')]));_0x2eb5fc[_0xc6cf('0x35')]=_0x2eb5fc[_0xc6cf('0x35')][_0xc6cf('0x36')]?_0x2eb5fc[_0xc6cf('0x35')]:_0x135bf4[_0xc6cf('0x30')];_0x2eb5fc[_0xc6cf('0x39')]=qs['sort'](_0x437877['query'][_0xc6cf('0x3a')]);_0x2eb5fc[_0xc6cf('0x3b')]=qs[_0xc6cf('0x32')](_[_0xc6cf('0x3c')](_0x437877['query'],_0x135bf4['filters']));if(_0x437877[_0xc6cf('0x31')][_0xc6cf('0x3d')]){_0x2eb5fc['where']=_['merge'](_0x2eb5fc[_0xc6cf('0x3b')],{'$or':_['map'](_0x2eb5fc[_0xc6cf('0x35')],function(_0x89c24f){var _0x166fb7={};_0x166fb7[_0x89c24f]={'$like':'%'+_0x437877['query'][_0xc6cf('0x3d')]+'%'};return _0x166fb7;})});}_0x2eb5fc=_[_0xc6cf('0x3e')]({},_0x2eb5fc,_0x437877['options']);return _0x449ef1[_0xc6cf('0x4e')](_0x2eb5fc);}})[_0xc6cf('0x23')](function(_0x403fdf){if(_0x403fdf){_0x526746=_0x403fdf[_0xc6cf('0x36')];if(!_0x437877[_0xc6cf('0x31')][_0xc6cf('0x37')]('nolimit')){_0x2eb5fc[_0xc6cf('0x1b')]=qs[_0xc6cf('0x1b')](_0x437877[_0xc6cf('0x31')][_0xc6cf('0x1b')]);_0x2eb5fc['offset']=qs[_0xc6cf('0x1d')](_0x437877[_0xc6cf('0x31')]['offset']);}return _0x449ef1['getSubjects'](_0x2eb5fc);}})[_0xc6cf('0x23')](function(_0x2b5bad){if(_0x2b5bad){return _0x2b5bad?{'count':_0x526746,'rows':_0x2b5bad}:null;}})[_0xc6cf('0x23')](respondWithResult(_0x4edfd5,null))[_0xc6cf('0x42')](handleError(_0x4edfd5,null));};exports['getDescriptions']=function(_0xfaa8eb,_0x56ea3b,_0x46677f){var _0x100594={};var _0x4f5b8a={};var _0x585302;var _0x4f7f32;return db[_0xc6cf('0x2b')]['findOne']({'where':{'id':_0xfaa8eb[_0xc6cf('0x4a')]['id']}})[_0xc6cf('0x23')](handleEntityNotFound(_0x56ea3b,null))['then'](function(_0x5ca9b6){if(_0x5ca9b6){_0x585302=_0x5ca9b6;_0x4f5b8a[_0xc6cf('0x30')]=_[_0xc6cf('0x44')](db[_0xc6cf('0x4c')][_0xc6cf('0x2c')]);_0x4f5b8a[_0xc6cf('0x31')]=_[_0xc6cf('0x44')](_0xfaa8eb[_0xc6cf('0x31')]);_0x4f5b8a['filters']=_['intersection'](_0x4f5b8a['model'],_0x4f5b8a[_0xc6cf('0x31')]);_0x100594[_0xc6cf('0x35')]=_['intersection'](_0x4f5b8a['model'],qs['fields'](_0xfaa8eb[_0xc6cf('0x31')][_0xc6cf('0x34')]));_0x100594['attributes']=_0x100594[_0xc6cf('0x35')][_0xc6cf('0x36')]?_0x100594[_0xc6cf('0x35')]:_0x4f5b8a[_0xc6cf('0x30')];_0x100594[_0xc6cf('0x39')]=qs[_0xc6cf('0x3a')](_0xfaa8eb[_0xc6cf('0x31')][_0xc6cf('0x3a')]);_0x100594['where']=qs['filters'](_[_0xc6cf('0x3c')](_0xfaa8eb[_0xc6cf('0x31')],_0x4f5b8a['filters']));if(_0xfaa8eb[_0xc6cf('0x31')][_0xc6cf('0x3d')]){_0x100594[_0xc6cf('0x3b')]=_[_0xc6cf('0x3e')](_0x100594[_0xc6cf('0x3b')],{'$or':_[_0xc6cf('0x2a')](_0x100594[_0xc6cf('0x35')],function(_0x33e51f){var _0x50d5aa={};_0x50d5aa[_0x33e51f]={'$like':'%'+_0xfaa8eb[_0xc6cf('0x31')][_0xc6cf('0x3d')]+'%'};return _0x50d5aa;})});}_0x100594=_['merge']({},_0x100594,_0xfaa8eb[_0xc6cf('0x45')]);return _0x585302[_0xc6cf('0x4f')](_0x100594);}})[_0xc6cf('0x23')](function(_0x327a93){if(_0x327a93){_0x4f7f32=_0x327a93[_0xc6cf('0x36')];if(!_0xfaa8eb[_0xc6cf('0x31')][_0xc6cf('0x37')](_0xc6cf('0x38'))){_0x100594['limit']=qs['limit'](_0xfaa8eb[_0xc6cf('0x31')][_0xc6cf('0x1b')]);_0x100594[_0xc6cf('0x1d')]=qs[_0xc6cf('0x1d')](_0xfaa8eb[_0xc6cf('0x31')][_0xc6cf('0x1d')]);}return _0x585302[_0xc6cf('0x4f')](_0x100594);}})[_0xc6cf('0x23')](function(_0x278aa6){if(_0x278aa6){return _0x278aa6?{'count':_0x4f7f32,'rows':_0x278aa6}:null;}})[_0xc6cf('0x23')](respondWithResult(_0x56ea3b,null))[_0xc6cf('0x42')](handleError(_0x56ea3b,null));}; \ No newline at end of file +var _0x8f99=['../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','type','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','VtigerConfiguration','rows','show','params','include','find','catch','create','body','getFields','findOne','VtigerField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','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','../../config/license/util'];(function(_0x4581e7,_0x2bf000){var _0x584bf2=function(_0x467cd5){while(--_0x467cd5){_0x4581e7['push'](_0x4581e7['shift']());}};_0x584bf2(++_0x2bf000);}(_0x8f99,0x184));var _0x98f9=function(_0x2ddd7a,_0x3ebf3a){_0x2ddd7a=_0x2ddd7a-0x0;var _0x25e166=_0x8f99[_0x2ddd7a];return _0x25e166;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x98f9('0x0'));var zipdir=require(_0x98f9('0x1'));var jsonpatch=require(_0x98f9('0x2'));var rp=require(_0x98f9('0x3'));var moment=require(_0x98f9('0x4'));var BPromise=require(_0x98f9('0x5'));var Mustache=require(_0x98f9('0x6'));var util=require(_0x98f9('0x7'));var path=require('path');var sox=require(_0x98f9('0x8'));var csv=require(_0x98f9('0x9'));var ejs=require(_0x98f9('0xa'));var fs=require('fs');var fs_extra=require(_0x98f9('0xb'));var _=require(_0x98f9('0xc'));var squel=require('squel');var crypto=require(_0x98f9('0xd'));var jsforce=require(_0x98f9('0xe'));var deskjs=require(_0x98f9('0xf'));var toCsv=require(_0x98f9('0x9'));var querystring=require(_0x98f9('0x10'));var Papa=require(_0x98f9('0x11'));var Redis=require(_0x98f9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x98f9('0x13'));var as=require(_0x98f9('0x14'));var hardwareService=require(_0x98f9('0x15'));var logger=require(_0x98f9('0x16'))(_0x98f9('0x17'));var utils=require(_0x98f9('0x18'));var config=require(_0x98f9('0x19'));var licenseUtil=require(_0x98f9('0x1a'));var db=require(_0x98f9('0x1b'))['db'];function respondWithStatusCode(_0x147cfd,_0x2b68e4){_0x2b68e4=_0x2b68e4||0xcc;return function(_0x278c82){if(_0x278c82){return _0x147cfd[_0x98f9('0x1c')](_0x2b68e4);}return _0x147cfd[_0x98f9('0x1d')](_0x2b68e4)[_0x98f9('0x1e')]();};}function respondWithResult(_0x301971,_0x9673fc){_0x9673fc=_0x9673fc||0xc8;return function(_0x4885bb){if(_0x4885bb){return _0x301971[_0x98f9('0x1d')](_0x9673fc)['json'](_0x4885bb);}};}function respondWithFilteredResult(_0x49acef,_0x175256){return function(_0x464309){if(_0x464309){var _0x39210d=typeof _0x175256[_0x98f9('0x1f')]==='undefined'&&typeof _0x175256[_0x98f9('0x20')]==='undefined';var _0x4cba88=_0x464309[_0x98f9('0x21')];var _0x1864c3=_0x39210d?0x0:_0x175256[_0x98f9('0x1f')];var _0x5d800d=_0x39210d?_0x464309[_0x98f9('0x21')]:_0x175256[_0x98f9('0x1f')]+_0x175256[_0x98f9('0x20')];var _0x426647;if(_0x5d800d>=_0x4cba88){_0x5d800d=_0x4cba88;_0x426647=0xc8;}else{_0x426647=0xce;}_0x49acef[_0x98f9('0x1d')](_0x426647);return _0x49acef[_0x98f9('0x22')](_0x98f9('0x23'),_0x1864c3+'-'+_0x5d800d+'/'+_0x4cba88)[_0x98f9('0x24')](_0x464309);}return null;};}function patchUpdates(_0x53d012){return function(_0xa01430){try{jsonpatch[_0x98f9('0x25')](_0xa01430,_0x53d012,!![]);}catch(_0x286e1c){return BPromise[_0x98f9('0x26')](_0x286e1c);}return _0xa01430['save']();};}function saveUpdates(_0x3ccdd1,_0x128388){return function(_0x387940){if(_0x387940){return _0x387940[_0x98f9('0x27')](_0x3ccdd1)[_0x98f9('0x28')](function(_0x49c8ec){return _0x49c8ec;});}return null;};}function removeEntity(_0x451b9b,_0x56cb9f){return function(_0x5cbcde){if(_0x5cbcde){return _0x5cbcde[_0x98f9('0x29')]()[_0x98f9('0x28')](function(){_0x451b9b[_0x98f9('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59fd04,_0x11aac1){return function(_0x13612d){if(!_0x13612d){_0x59fd04['sendStatus'](0x194);}return _0x13612d;};}function handleError(_0x4169dc,_0x34d635){_0x34d635=_0x34d635||0x1f4;return function(_0x816b5d){logger[_0x98f9('0x2a')](_0x816b5d[_0x98f9('0x2b')]);if(_0x816b5d['name']){delete _0x816b5d['name'];}_0x4169dc[_0x98f9('0x1d')](_0x34d635)[_0x98f9('0x2c')](_0x816b5d);};}exports[_0x98f9('0x2d')]=function(_0xc3a856,_0x49e2c4){var _0x19f032={},_0x116d87={},_0x2e9100={'count':0x0,'rows':[]};var _0x1ae976=_[_0x98f9('0x2e')](db['VtigerConfiguration'][_0x98f9('0x2f')],function(_0x58cf55){return{'name':_0x58cf55[_0x98f9('0x30')],'type':_0x58cf55[_0x98f9('0x31')]['key']};});_0x116d87[_0x98f9('0x32')]=_[_0x98f9('0x2e')](_0x1ae976,_0x98f9('0x33'));_0x116d87['query']=_[_0x98f9('0x34')](_0xc3a856[_0x98f9('0x35')]);_0x116d87[_0x98f9('0x36')]=_[_0x98f9('0x37')](_0x116d87['model'],_0x116d87[_0x98f9('0x35')]);_0x19f032[_0x98f9('0x38')]=_[_0x98f9('0x37')](_0x116d87[_0x98f9('0x32')],qs[_0x98f9('0x39')](_0xc3a856[_0x98f9('0x35')][_0x98f9('0x39')]));_0x19f032['attributes']=_0x19f032[_0x98f9('0x38')][_0x98f9('0x3a')]?_0x19f032[_0x98f9('0x38')]:_0x116d87[_0x98f9('0x32')];if(!_0xc3a856[_0x98f9('0x35')][_0x98f9('0x3b')](_0x98f9('0x3c'))){_0x19f032[_0x98f9('0x20')]=qs[_0x98f9('0x20')](_0xc3a856[_0x98f9('0x35')][_0x98f9('0x20')]);_0x19f032[_0x98f9('0x1f')]=qs['offset'](_0xc3a856[_0x98f9('0x35')][_0x98f9('0x1f')]);}_0x19f032[_0x98f9('0x3d')]=qs[_0x98f9('0x3e')](_0xc3a856[_0x98f9('0x35')][_0x98f9('0x3e')]);_0x19f032[_0x98f9('0x3f')]=qs['filters'](_[_0x98f9('0x40')](_0xc3a856[_0x98f9('0x35')],_0x116d87[_0x98f9('0x36')]),_0x1ae976);if(_0xc3a856['query'][_0x98f9('0x41')]){_0x19f032[_0x98f9('0x3f')]=_['merge'](_0x19f032[_0x98f9('0x3f')],{'$or':_[_0x98f9('0x2e')](_0x1ae976,function(_0x530a5e){if(_0x530a5e['type']!==_0x98f9('0x42')){var _0x54af4e={};_0x54af4e[_0x530a5e[_0x98f9('0x33')]]={'$like':'%'+_0xc3a856['query']['filter']+'%'};return _0x54af4e;}})});}_0x19f032=_[_0x98f9('0x43')]({},_0x19f032,_0xc3a856[_0x98f9('0x44')]);var _0x24cee7={'where':_0x19f032[_0x98f9('0x3f')]};return db[_0x98f9('0x45')][_0x98f9('0x21')](_0x24cee7)[_0x98f9('0x28')](function(_0x220584){_0x2e9100[_0x98f9('0x21')]=_0x220584;if(_0xc3a856['query']['includeAll']){_0x19f032['include']=[{'all':!![]}];}return db[_0x98f9('0x45')]['findAll'](_0x19f032);})[_0x98f9('0x28')](function(_0x54cb33){_0x2e9100[_0x98f9('0x46')]=_0x54cb33;return _0x2e9100;})[_0x98f9('0x28')](respondWithFilteredResult(_0x49e2c4,_0x19f032))['catch'](handleError(_0x49e2c4,null));};exports[_0x98f9('0x47')]=function(_0x46954b,_0x597725){var _0x1b8b6e={'raw':![],'where':{'id':_0x46954b[_0x98f9('0x48')]['id']}},_0x48220b={};_0x48220b[_0x98f9('0x32')]=_[_0x98f9('0x34')](db[_0x98f9('0x45')]['rawAttributes']);_0x48220b[_0x98f9('0x35')]=_[_0x98f9('0x34')](_0x46954b[_0x98f9('0x35')]);_0x48220b['filters']=_[_0x98f9('0x37')](_0x48220b[_0x98f9('0x32')],_0x48220b['query']);_0x1b8b6e[_0x98f9('0x38')]=_['intersection'](_0x48220b['model'],qs[_0x98f9('0x39')](_0x46954b[_0x98f9('0x35')][_0x98f9('0x39')]));_0x1b8b6e[_0x98f9('0x38')]=_0x1b8b6e[_0x98f9('0x38')][_0x98f9('0x3a')]?_0x1b8b6e['attributes']:_0x48220b[_0x98f9('0x32')];if(_0x46954b[_0x98f9('0x35')]['includeAll']){_0x1b8b6e[_0x98f9('0x49')]=[{'all':!![]}];}_0x1b8b6e=_[_0x98f9('0x43')]({},_0x1b8b6e,_0x46954b[_0x98f9('0x44')]);return db['VtigerConfiguration'][_0x98f9('0x4a')](_0x1b8b6e)[_0x98f9('0x28')](handleEntityNotFound(_0x597725,null))['then'](respondWithResult(_0x597725,null))[_0x98f9('0x4b')](handleError(_0x597725,null));};exports[_0x98f9('0x4c')]=function(_0xebffac,_0x3a6612){return db[_0x98f9('0x45')]['create'](_0xebffac[_0x98f9('0x4d')],{})['then'](respondWithResult(_0x3a6612,0xc9))[_0x98f9('0x4b')](handleError(_0x3a6612,null));};exports[_0x98f9('0x27')]=function(_0x390750,_0x1a4383){if(_0x390750[_0x98f9('0x4d')]['id']){delete _0x390750[_0x98f9('0x4d')]['id'];}return db[_0x98f9('0x45')][_0x98f9('0x4a')]({'where':{'id':_0x390750['params']['id']}})[_0x98f9('0x28')](handleEntityNotFound(_0x1a4383,null))[_0x98f9('0x28')](saveUpdates(_0x390750[_0x98f9('0x4d')],null))['then'](respondWithResult(_0x1a4383,null))['catch'](handleError(_0x1a4383,null));};exports['destroy']=function(_0x45b946,_0x3dda7a){return db[_0x98f9('0x45')]['find']({'where':{'id':_0x45b946[_0x98f9('0x48')]['id']}})[_0x98f9('0x28')](handleEntityNotFound(_0x3dda7a,null))[_0x98f9('0x28')](removeEntity(_0x3dda7a,null))[_0x98f9('0x4b')](handleError(_0x3dda7a,null));};exports[_0x98f9('0x4e')]=function(_0x5975bf,_0x18d1fe,_0x12ae3c){var _0x3c6e1b={};var _0x2d0a14={};var _0x292ae9;var _0x4d00af;return db['VtigerConfiguration'][_0x98f9('0x4f')]({'where':{'id':_0x5975bf[_0x98f9('0x48')]['id']}})['then'](handleEntityNotFound(_0x18d1fe,null))[_0x98f9('0x28')](function(_0x4e2669){if(_0x4e2669){_0x292ae9=_0x4e2669;_0x2d0a14[_0x98f9('0x32')]=_[_0x98f9('0x34')](db[_0x98f9('0x50')][_0x98f9('0x2f')]);_0x2d0a14[_0x98f9('0x35')]=_[_0x98f9('0x34')](_0x5975bf['query']);_0x2d0a14[_0x98f9('0x36')]=_[_0x98f9('0x37')](_0x2d0a14['model'],_0x2d0a14['query']);_0x3c6e1b[_0x98f9('0x38')]=_[_0x98f9('0x37')](_0x2d0a14[_0x98f9('0x32')],qs[_0x98f9('0x39')](_0x5975bf['query'][_0x98f9('0x39')]));_0x3c6e1b[_0x98f9('0x38')]=_0x3c6e1b[_0x98f9('0x38')][_0x98f9('0x3a')]?_0x3c6e1b[_0x98f9('0x38')]:_0x2d0a14[_0x98f9('0x32')];_0x3c6e1b[_0x98f9('0x3d')]=qs[_0x98f9('0x3e')](_0x5975bf['query'][_0x98f9('0x3e')]);_0x3c6e1b[_0x98f9('0x3f')]=qs['filters'](_[_0x98f9('0x40')](_0x5975bf[_0x98f9('0x35')],_0x2d0a14[_0x98f9('0x36')]));if(_0x5975bf[_0x98f9('0x35')][_0x98f9('0x41')]){_0x3c6e1b[_0x98f9('0x3f')]=_[_0x98f9('0x43')](_0x3c6e1b[_0x98f9('0x3f')],{'$or':_[_0x98f9('0x2e')](_0x3c6e1b[_0x98f9('0x38')],function(_0x5cda0c){var _0x4e1054={};_0x4e1054[_0x5cda0c]={'$like':'%'+_0x5975bf[_0x98f9('0x35')]['filter']+'%'};return _0x4e1054;})});}_0x3c6e1b=_['merge']({},_0x3c6e1b,_0x5975bf[_0x98f9('0x44')]);return _0x292ae9['getFields'](_0x3c6e1b);}})[_0x98f9('0x28')](function(_0x5e49ca){if(_0x5e49ca){_0x4d00af=_0x5e49ca['length'];if(!_0x5975bf[_0x98f9('0x35')][_0x98f9('0x3b')](_0x98f9('0x3c'))){_0x3c6e1b['limit']=qs[_0x98f9('0x20')](_0x5975bf['query'][_0x98f9('0x20')]);_0x3c6e1b[_0x98f9('0x1f')]=qs[_0x98f9('0x1f')](_0x5975bf[_0x98f9('0x35')][_0x98f9('0x1f')]);}return _0x292ae9[_0x98f9('0x4e')](_0x3c6e1b);}})[_0x98f9('0x28')](function(_0x509b4c){if(_0x509b4c){return _0x509b4c?{'count':_0x4d00af,'rows':_0x509b4c}:null;}})[_0x98f9('0x28')](respondWithResult(_0x18d1fe,null))[_0x98f9('0x4b')](handleError(_0x18d1fe,null));};exports[_0x98f9('0x51')]=function(_0x26a2c9,_0x406944,_0x55b286){var _0x32b4b4={};var _0x5ac930={};var _0x19209a;var _0x688139;return db[_0x98f9('0x45')][_0x98f9('0x4f')]({'where':{'id':_0x26a2c9['params']['id']}})['then'](handleEntityNotFound(_0x406944,null))[_0x98f9('0x28')](function(_0x5966f4){if(_0x5966f4){_0x19209a=_0x5966f4;_0x5ac930['model']=_[_0x98f9('0x34')](db['VtigerField'][_0x98f9('0x2f')]);_0x5ac930['query']=_['keys'](_0x26a2c9['query']);_0x5ac930[_0x98f9('0x36')]=_['intersection'](_0x5ac930[_0x98f9('0x32')],_0x5ac930[_0x98f9('0x35')]);_0x32b4b4[_0x98f9('0x38')]=_[_0x98f9('0x37')](_0x5ac930[_0x98f9('0x32')],qs[_0x98f9('0x39')](_0x26a2c9['query'][_0x98f9('0x39')]));_0x32b4b4[_0x98f9('0x38')]=_0x32b4b4[_0x98f9('0x38')][_0x98f9('0x3a')]?_0x32b4b4[_0x98f9('0x38')]:_0x5ac930['model'];_0x32b4b4[_0x98f9('0x3d')]=qs[_0x98f9('0x3e')](_0x26a2c9['query'][_0x98f9('0x3e')]);_0x32b4b4['where']=qs[_0x98f9('0x36')](_[_0x98f9('0x40')](_0x26a2c9[_0x98f9('0x35')],_0x5ac930['filters']));if(_0x26a2c9[_0x98f9('0x35')][_0x98f9('0x41')]){_0x32b4b4['where']=_[_0x98f9('0x43')](_0x32b4b4[_0x98f9('0x3f')],{'$or':_['map'](_0x32b4b4[_0x98f9('0x38')],function(_0x21a0a5){var _0x27f1ae={};_0x27f1ae[_0x21a0a5]={'$like':'%'+_0x26a2c9[_0x98f9('0x35')][_0x98f9('0x41')]+'%'};return _0x27f1ae;})});}_0x32b4b4=_[_0x98f9('0x43')]({},_0x32b4b4,_0x26a2c9[_0x98f9('0x44')]);return _0x19209a[_0x98f9('0x51')](_0x32b4b4);}})[_0x98f9('0x28')](function(_0x31fb5c){if(_0x31fb5c){_0x688139=_0x31fb5c['length'];if(!_0x26a2c9[_0x98f9('0x35')][_0x98f9('0x3b')](_0x98f9('0x3c'))){_0x32b4b4['limit']=qs[_0x98f9('0x20')](_0x26a2c9[_0x98f9('0x35')][_0x98f9('0x20')]);_0x32b4b4[_0x98f9('0x1f')]=qs[_0x98f9('0x1f')](_0x26a2c9[_0x98f9('0x35')][_0x98f9('0x1f')]);}return _0x19209a[_0x98f9('0x51')](_0x32b4b4);}})[_0x98f9('0x28')](function(_0x1ffed9){if(_0x1ffed9){return _0x1ffed9?{'count':_0x688139,'rows':_0x1ffed9}:null;}})[_0x98f9('0x28')](respondWithResult(_0x406944,null))['catch'](handleError(_0x406944,null));};exports[_0x98f9('0x52')]=function(_0x4c6432,_0x4dc203,_0x4ed48b){var _0x337b4a={};var _0x4a8396={};var _0x8d481d;var _0x113928;return db[_0x98f9('0x45')][_0x98f9('0x4f')]({'where':{'id':_0x4c6432[_0x98f9('0x48')]['id']}})[_0x98f9('0x28')](handleEntityNotFound(_0x4dc203,null))[_0x98f9('0x28')](function(_0x16bcfc){if(_0x16bcfc){_0x8d481d=_0x16bcfc;_0x4a8396[_0x98f9('0x32')]=_[_0x98f9('0x34')](db[_0x98f9('0x50')]['rawAttributes']);_0x4a8396['query']=_[_0x98f9('0x34')](_0x4c6432['query']);_0x4a8396[_0x98f9('0x36')]=_[_0x98f9('0x37')](_0x4a8396['model'],_0x4a8396[_0x98f9('0x35')]);_0x337b4a[_0x98f9('0x38')]=_[_0x98f9('0x37')](_0x4a8396[_0x98f9('0x32')],qs[_0x98f9('0x39')](_0x4c6432[_0x98f9('0x35')]['fields']));_0x337b4a['attributes']=_0x337b4a['attributes']['length']?_0x337b4a[_0x98f9('0x38')]:_0x4a8396[_0x98f9('0x32')];_0x337b4a[_0x98f9('0x3d')]=qs[_0x98f9('0x3e')](_0x4c6432[_0x98f9('0x35')][_0x98f9('0x3e')]);_0x337b4a[_0x98f9('0x3f')]=qs['filters'](_['pick'](_0x4c6432[_0x98f9('0x35')],_0x4a8396[_0x98f9('0x36')]));if(_0x4c6432[_0x98f9('0x35')]['filter']){_0x337b4a['where']=_['merge'](_0x337b4a[_0x98f9('0x3f')],{'$or':_['map'](_0x337b4a[_0x98f9('0x38')],function(_0x4f07ac){var _0x3aedf7={};_0x3aedf7[_0x4f07ac]={'$like':'%'+_0x4c6432[_0x98f9('0x35')]['filter']+'%'};return _0x3aedf7;})});}_0x337b4a=_[_0x98f9('0x43')]({},_0x337b4a,_0x4c6432['options']);return _0x8d481d[_0x98f9('0x52')](_0x337b4a);}})[_0x98f9('0x28')](function(_0x4bb027){if(_0x4bb027){_0x113928=_0x4bb027[_0x98f9('0x3a')];if(!_0x4c6432[_0x98f9('0x35')][_0x98f9('0x3b')](_0x98f9('0x3c'))){_0x337b4a[_0x98f9('0x20')]=qs[_0x98f9('0x20')](_0x4c6432[_0x98f9('0x35')][_0x98f9('0x20')]);_0x337b4a[_0x98f9('0x1f')]=qs[_0x98f9('0x1f')](_0x4c6432['query'][_0x98f9('0x1f')]);}return _0x8d481d[_0x98f9('0x52')](_0x337b4a);}})[_0x98f9('0x28')](function(_0x4bf40c){if(_0x4bf40c){return _0x4bf40c?{'count':_0x113928,'rows':_0x4bf40c}:null;}})[_0x98f9('0x28')](respondWithResult(_0x4dc203,null))[_0x98f9('0x4b')](handleError(_0x4dc203,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 5cdc9d8..554294c 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdda9=['api','bluebird','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger'];(function(_0x55442f,_0x1d99dc){var _0x359be8=function(_0x49d9d0){while(--_0x49d9d0){_0x55442f['push'](_0x55442f['shift']());}};_0x359be8(++_0x1d99dc);}(_0xdda9,0x196));var _0x9dda=function(_0x22f878,_0x7dd76c){_0x22f878=_0x22f878-0x0;var _0x5582d3=_0xdda9[_0x22f878];return _0x5582d3;};'use strict';var _=require('lodash');var util=require(_0x9dda('0x0'));var logger=require(_0x9dda('0x1'))(_0x9dda('0x2'));var moment=require('moment');var BPromise=require(_0x9dda('0x3'));var rp=require(_0x9dda('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9dda('0x5'));var config=require(_0x9dda('0x6'));var attributes=require(_0x9dda('0x7'));module[_0x9dda('0x8')]=function(_0x235e36,_0x29ec7e){return _0x235e36[_0x9dda('0x9')](_0x9dda('0xa'),attributes,{'tableName':_0x9dda('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63ec=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','VtigerConfiguration'];(function(_0x1a014b,_0x48acae){var _0x462258=function(_0x1473be){while(--_0x1473be){_0x1a014b['push'](_0x1a014b['shift']());}};_0x462258(++_0x48acae);}(_0x63ec,0x1c8));var _0xc63e=function(_0x4ab38a,_0x45ac90){_0x4ab38a=_0x4ab38a-0x0;var _0x5c8f23=_0x63ec[_0x4ab38a];return _0x5c8f23;};'use strict';var _=require(_0xc63e('0x0'));var util=require(_0xc63e('0x1'));var logger=require(_0xc63e('0x2'))(_0xc63e('0x3'));var moment=require(_0xc63e('0x4'));var BPromise=require(_0xc63e('0x5'));var rp=require(_0xc63e('0x6'));var fs=require('fs');var path=require(_0xc63e('0x7'));var rimraf=require(_0xc63e('0x8'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0xc63e('0x9')]=function(_0x358bf7,_0x662564){return _0x358bf7[_0xc63e('0xa')](_0xc63e('0xb'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 2965e98..1c4f907 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e6e=['message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x82583,_0x4f7dea){var _0x4ec2d5=function(_0x108f93){while(--_0x108f93){_0x82583['push'](_0x82583['shift']());}};_0x4ec2d5(++_0x4f7dea);}(_0x2e6e,0xa2));var _0xe2e6=function(_0x1f42bc,_0x208463){_0x1f42bc=_0x1f42bc-0x0;var _0x23f159=_0x2e6e[_0x1f42bc];return _0x23f159;};'use strict';var _=require(_0xe2e6('0x0'));var util=require(_0xe2e6('0x1'));var moment=require('moment');var BPromise=require(_0xe2e6('0x2'));var rs=require(_0xe2e6('0x3'));var fs=require('fs');var Redis=require(_0xe2e6('0x4'));var db=require(_0xe2e6('0x5'))['db'];var utils=require(_0xe2e6('0x6'));var logger=require(_0xe2e6('0x7'))('rpc');var config=require(_0xe2e6('0x8'));var jayson=require(_0xe2e6('0x9'));var client=jayson['client'][_0xe2e6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x212a40,_0x24d67e,_0x1bd2de){return new BPromise(function(_0x403bd6,_0x36923a){return client['request'](_0x212a40,_0x1bd2de)[_0xe2e6('0xb')](function(_0x3f1c14){logger[_0xe2e6('0xc')](_0xe2e6('0xd'),_0x24d67e,_0xe2e6('0xe'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x24d67e,_0xe2e6('0xe'),JSON[_0xe2e6('0xf')](_0x3f1c14));if(_0x3f1c14[_0xe2e6('0x10')]){if(_0x3f1c14[_0xe2e6('0x10')][_0xe2e6('0x11')]===0x1f4){logger[_0xe2e6('0x10')](_0xe2e6('0xd'),_0x24d67e,_0x3f1c14[_0xe2e6('0x10')][_0xe2e6('0x12')]);return _0x36923a(_0x3f1c14['error'][_0xe2e6('0x12')]);}logger[_0xe2e6('0x10')](_0xe2e6('0xd'),_0x24d67e,_0x3f1c14[_0xe2e6('0x10')][_0xe2e6('0x12')]);return _0x403bd6(_0x3f1c14[_0xe2e6('0x10')][_0xe2e6('0x12')]);}else{logger[_0xe2e6('0xc')](_0xe2e6('0xd'),_0x24d67e,_0xe2e6('0xe'));_0x403bd6(_0x3f1c14['result'][_0xe2e6('0x12')]);}})[_0xe2e6('0x13')](function(_0x4f39d1){logger[_0xe2e6('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x24d67e,_0x4f39d1);_0x36923a(_0x4f39d1);});});} \ No newline at end of file +var _0x2483=['bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash'];(function(_0x509083,_0x36dd89){var _0x4f7167=function(_0x13f3d2){while(--_0x13f3d2){_0x509083['push'](_0x509083['shift']());}};_0x4f7167(++_0x36dd89);}(_0x2483,0x131));var _0x3248=function(_0x41974b,_0x2a90b7){_0x41974b=_0x41974b-0x0;var _0x1534e3=_0x2483[_0x41974b];return _0x1534e3;};'use strict';var _=require(_0x3248('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3248('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3248('0x2'));var db=require(_0x3248('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3248('0x4'));var config=require(_0x3248('0x5'));var jayson=require(_0x3248('0x6'));var client=jayson[_0x3248('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e6a24,_0x5c9401,_0x4620f1){return new BPromise(function(_0x4a2b44,_0x1c4ad4){return client[_0x3248('0x8')](_0x2e6a24,_0x4620f1)['then'](function(_0x4423da){logger[_0x3248('0x9')](_0x3248('0xa'),_0x5c9401,_0x3248('0xb'));logger[_0x3248('0xc')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x5c9401,'request\x20sent',JSON[_0x3248('0xd')](_0x4423da));if(_0x4423da[_0x3248('0xe')]){if(_0x4423da[_0x3248('0xe')][_0x3248('0xf')]===0x1f4){logger['error'](_0x3248('0xa'),_0x5c9401,_0x4423da[_0x3248('0xe')]['message']);return _0x1c4ad4(_0x4423da[_0x3248('0xe')]['message']);}logger['error'](_0x3248('0xa'),_0x5c9401,_0x4423da['error'][_0x3248('0x10')]);return _0x4a2b44(_0x4423da[_0x3248('0xe')]['message']);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x5c9401,_0x3248('0xb'));_0x4a2b44(_0x4423da['result'][_0x3248('0x10')]);}})[_0x3248('0x11')](function(_0x47fea5){logger[_0x3248('0xe')](_0x3248('0xa'),_0x5c9401,_0x47fea5);_0x1c4ad4(_0x47fea5);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index f283ab5..7f2a5f6 100644 --- a/server/api/intVtigerField/index.js +++ b/server/api/intVtigerField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x72c9=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x72c9,0x1a6));var _0x972c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72c9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x972c('0x0'));var util=require(_0x972c('0x1'));var path=require('path');var timeout=require(_0x972c('0x2'));var express=require(_0x972c('0x3'));var router=express[_0x972c('0x4')]();var fs_extra=require(_0x972c('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x972c('0x6'));var controller=require(_0x972c('0x7'));router['get']('/',auth[_0x972c('0x8')](),controller[_0x972c('0x9')]);router[_0x972c('0xa')](_0x972c('0xb'),auth[_0x972c('0x8')](),controller[_0x972c('0xc')]);router[_0x972c('0xd')]('/',auth[_0x972c('0x8')](),controller[_0x972c('0xe')]);router[_0x972c('0xf')](_0x972c('0xb'),auth['isAuthenticated'](),controller[_0x972c('0x10')]);router[_0x972c('0x11')]('/:id',auth[_0x972c('0x8')](),controller[_0x972c('0x12')]);module[_0x972c('0x13')]=router; \ No newline at end of file +var _0x6515=['express','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','put','update','multer','util','path','connect-timeout'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6515,0xa1));var _0x5651=function(_0x362b91,_0x480b94){_0x362b91=_0x362b91-0x0;var _0x2e54fd=_0x6515[_0x362b91];return _0x2e54fd;};'use strict';var multer=require(_0x5651('0x0'));var util=require(_0x5651('0x1'));var path=require(_0x5651('0x2'));var timeout=require(_0x5651('0x3'));var express=require(_0x5651('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5651('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5651('0x6'));var controller=require('./intVtigerField.controller');router['get']('/',auth[_0x5651('0x7')](),controller[_0x5651('0x8')]);router[_0x5651('0x9')](_0x5651('0xa'),auth[_0x5651('0x7')](),controller[_0x5651('0xb')]);router[_0x5651('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5651('0xd')](_0x5651('0xa'),auth['isAuthenticated'](),controller[_0x5651('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 2c1df44..737e961 100644 --- a/server/api/intVtigerField/intVtigerField.attributes.js +++ b/server/api/intVtigerField/intVtigerField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8099=['ENUM','string','variable','customVariable','picklist','STRING','exports'];(function(_0x47bb19,_0x17a096){var _0x4ef57a=function(_0x9f35cd){while(--_0x9f35cd){_0x47bb19['push'](_0x47bb19['shift']());}};_0x4ef57a(++_0x17a096);}(_0x8099,0xa7));var _0x9809=function(_0x13482e,_0x32bb80){_0x13482e=_0x13482e-0x0;var _0x3bec51=_0x8099[_0x13482e];return _0x3bec51;};'use strict';var Sequelize=require('sequelize');module[_0x9809('0x0')]={'type':{'type':Sequelize[_0x9809('0x1')](_0x9809('0x2'),_0x9809('0x3'),_0x9809('0x4'),'keyValue',_0x9809('0x5')),'defaultValue':_0x9809('0x2')},'content':{'type':Sequelize[_0x9809('0x6')]},'key':{'type':Sequelize[_0x9809('0x6')]},'keyType':{'type':Sequelize[_0x9809('0x1')]('string',_0x9809('0x3'),_0x9809('0x4'))},'keyContent':{'type':Sequelize[_0x9809('0x6')]},'idField':{'type':Sequelize[_0x9809('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9809('0x6')]}}; \ No newline at end of file +var _0x6e2f=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x54a228,_0x3d27f0){var _0x8b8c13=function(_0x4083a8){while(--_0x4083a8){_0x54a228['push'](_0x54a228['shift']());}};_0x8b8c13(++_0x3d27f0);}(_0x6e2f,0x1af));var _0xf6e2=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x6e2f[_0x4baae2];return _0x1a2285;};'use strict';var Sequelize=require(_0xf6e2('0x0'));module[_0xf6e2('0x1')]={'type':{'type':Sequelize[_0xf6e2('0x2')](_0xf6e2('0x3'),_0xf6e2('0x4'),_0xf6e2('0x5'),_0xf6e2('0x6'),_0xf6e2('0x7')),'defaultValue':_0xf6e2('0x3')},'content':{'type':Sequelize[_0xf6e2('0x8')]},'key':{'type':Sequelize[_0xf6e2('0x8')]},'keyType':{'type':Sequelize[_0xf6e2('0x2')](_0xf6e2('0x3'),'variable',_0xf6e2('0x5'))},'keyContent':{'type':Sequelize[_0xf6e2('0x8')]},'idField':{'type':Sequelize[_0xf6e2('0x8')]},'nameField':{'type':Sequelize[_0xf6e2('0x8')]},'customField':{'type':Sequelize[_0xf6e2('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf6e2('0x8')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index f1da55c..6d2779d 100644 --- a/server/api/intVtigerField/intVtigerField.controller.js +++ b/server/api/intVtigerField/intVtigerField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d41=['attributes','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','intersection','fields','length','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','name','query','keys'];(function(_0x2c3255,_0x4e00ae){var _0x282aba=function(_0x5721d5){while(--_0x5721d5){_0x2c3255['push'](_0x2c3255['shift']());}};_0x282aba(++_0x4e00ae);}(_0x2d41,0x183));var _0x12d4=function(_0x5d984f,_0x1eb3ed){_0x5d984f=_0x5d984f-0x0;var _0x4cb980=_0x2d41[_0x5d984f];return _0x4cb980;};'use strict';var emlformat=require(_0x12d4('0x0'));var rimraf=require(_0x12d4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x12d4('0x2'));var rp=require(_0x12d4('0x3'));var moment=require(_0x12d4('0x4'));var BPromise=require(_0x12d4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x12d4('0x6'));var sox=require(_0x12d4('0x7'));var csv=require(_0x12d4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x12d4('0x9'));var _=require(_0x12d4('0xa'));var squel=require(_0x12d4('0xb'));var crypto=require(_0x12d4('0xc'));var jsforce=require(_0x12d4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x12d4('0x8'));var querystring=require('querystring');var Papa=require(_0x12d4('0xe'));var Redis=require('ioredis');var authService=require(_0x12d4('0xf'));var qs=require(_0x12d4('0x10'));var as=require(_0x12d4('0x11'));var hardwareService=require(_0x12d4('0x12'));var logger=require(_0x12d4('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x12d4('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x12d4('0x15'))['db'];function respondWithStatusCode(_0x4dfb73,_0x98362e){_0x98362e=_0x98362e||0xcc;return function(_0x168880){if(_0x168880){return _0x4dfb73['sendStatus'](_0x98362e);}return _0x4dfb73[_0x12d4('0x16')](_0x98362e)[_0x12d4('0x17')]();};}function respondWithResult(_0x4f510a,_0x39b012){_0x39b012=_0x39b012||0xc8;return function(_0x10ef2a){if(_0x10ef2a){return _0x4f510a[_0x12d4('0x16')](_0x39b012)[_0x12d4('0x18')](_0x10ef2a);}};}function respondWithFilteredResult(_0x8a8a8a,_0x5c38da){return function(_0x525397){if(_0x525397){var _0x193460=typeof _0x5c38da[_0x12d4('0x19')]===_0x12d4('0x1a')&&typeof _0x5c38da[_0x12d4('0x1b')]===_0x12d4('0x1a');var _0x46b681=_0x525397[_0x12d4('0x1c')];var _0x1a9cf8=_0x193460?0x0:_0x5c38da[_0x12d4('0x19')];var _0x34ea8c=_0x193460?_0x525397[_0x12d4('0x1c')]:_0x5c38da[_0x12d4('0x19')]+_0x5c38da['limit'];var _0x3c0e21;if(_0x34ea8c>=_0x46b681){_0x34ea8c=_0x46b681;_0x3c0e21=0xc8;}else{_0x3c0e21=0xce;}_0x8a8a8a[_0x12d4('0x16')](_0x3c0e21);return _0x8a8a8a[_0x12d4('0x1d')](_0x12d4('0x1e'),_0x1a9cf8+'-'+_0x34ea8c+'/'+_0x46b681)[_0x12d4('0x18')](_0x525397);}return null;};}function patchUpdates(_0x2eeeeb){return function(_0x4594d2){try{jsonpatch[_0x12d4('0x1f')](_0x4594d2,_0x2eeeeb,!![]);}catch(_0x2ff082){return BPromise[_0x12d4('0x20')](_0x2ff082);}return _0x4594d2[_0x12d4('0x21')]();};}function saveUpdates(_0x155ebd,_0x11be3d){return function(_0x55b453){if(_0x55b453){return _0x55b453[_0x12d4('0x22')](_0x155ebd)[_0x12d4('0x23')](function(_0x5226eb){return _0x5226eb;});}return null;};}function removeEntity(_0x47a68d,_0x923e7){return function(_0x13d968){if(_0x13d968){return _0x13d968[_0x12d4('0x24')]()[_0x12d4('0x23')](function(){_0x47a68d[_0x12d4('0x16')](0xcc)[_0x12d4('0x17')]();});}};}function handleEntityNotFound(_0x310263,_0x447d5b){return function(_0xf79d8d){if(!_0xf79d8d){_0x310263[_0x12d4('0x25')](0x194);}return _0xf79d8d;};}function handleError(_0x2bdd25,_0xeee6cb){_0xeee6cb=_0xeee6cb||0x1f4;return function(_0x5024e7){logger['error'](_0x5024e7[_0x12d4('0x26')]);if(_0x5024e7['name']){delete _0x5024e7['name'];}_0x2bdd25['status'](_0xeee6cb)[_0x12d4('0x27')](_0x5024e7);};}exports[_0x12d4('0x28')]=function(_0x3a5e40,_0x1ca163){var _0x2e440c={},_0x37a689={},_0x4999ce={'count':0x0,'rows':[]};var _0x10bf58=_[_0x12d4('0x29')](db[_0x12d4('0x2a')][_0x12d4('0x2b')],function(_0x428471){return{'name':_0x428471[_0x12d4('0x2c')],'type':_0x428471[_0x12d4('0x2d')][_0x12d4('0x2e')]};});_0x37a689[_0x12d4('0x2f')]=_[_0x12d4('0x29')](_0x10bf58,_0x12d4('0x30'));_0x37a689[_0x12d4('0x31')]=_[_0x12d4('0x32')](_0x3a5e40['query']);_0x37a689['filters']=_['intersection'](_0x37a689[_0x12d4('0x2f')],_0x37a689['query']);_0x2e440c[_0x12d4('0x33')]=_['intersection'](_0x37a689['model'],qs['fields'](_0x3a5e40[_0x12d4('0x31')]['fields']));_0x2e440c['attributes']=_0x2e440c[_0x12d4('0x33')]['length']?_0x2e440c['attributes']:_0x37a689[_0x12d4('0x2f')];if(!_0x3a5e40[_0x12d4('0x31')][_0x12d4('0x34')]('nolimit')){_0x2e440c[_0x12d4('0x1b')]=qs[_0x12d4('0x1b')](_0x3a5e40['query'][_0x12d4('0x1b')]);_0x2e440c[_0x12d4('0x19')]=qs[_0x12d4('0x19')](_0x3a5e40[_0x12d4('0x31')][_0x12d4('0x19')]);}_0x2e440c[_0x12d4('0x35')]=qs[_0x12d4('0x36')](_0x3a5e40[_0x12d4('0x31')][_0x12d4('0x36')]);_0x2e440c[_0x12d4('0x37')]=qs[_0x12d4('0x38')](_['pick'](_0x3a5e40[_0x12d4('0x31')],_0x37a689[_0x12d4('0x38')]),_0x10bf58);if(_0x3a5e40['query']['filter']){_0x2e440c[_0x12d4('0x37')]=_[_0x12d4('0x39')](_0x2e440c[_0x12d4('0x37')],{'$or':_['map'](_0x10bf58,function(_0x5b3d0b){if(_0x5b3d0b[_0x12d4('0x2d')]!==_0x12d4('0x3a')){var _0x5d0b09={};_0x5d0b09[_0x5b3d0b[_0x12d4('0x30')]]={'$like':'%'+_0x3a5e40[_0x12d4('0x31')][_0x12d4('0x3b')]+'%'};return _0x5d0b09;}})});}_0x2e440c=_[_0x12d4('0x39')]({},_0x2e440c,_0x3a5e40[_0x12d4('0x3c')]);var _0x3b4956={'where':_0x2e440c[_0x12d4('0x37')]};return db['VtigerField'][_0x12d4('0x1c')](_0x3b4956)[_0x12d4('0x23')](function(_0xd80525){_0x4999ce['count']=_0xd80525;if(_0x3a5e40[_0x12d4('0x31')][_0x12d4('0x3d')]){_0x2e440c[_0x12d4('0x3e')]=[{'all':!![]}];}return db[_0x12d4('0x2a')][_0x12d4('0x3f')](_0x2e440c);})[_0x12d4('0x23')](function(_0x3b78bf){_0x4999ce['rows']=_0x3b78bf;return _0x4999ce;})['then'](respondWithFilteredResult(_0x1ca163,_0x2e440c))[_0x12d4('0x40')](handleError(_0x1ca163,null));};exports[_0x12d4('0x41')]=function(_0xd674bd,_0x295ed1){var _0x592178={'raw':!![],'where':{'id':_0xd674bd[_0x12d4('0x42')]['id']}},_0x31ddc0={};_0x31ddc0[_0x12d4('0x2f')]=_[_0x12d4('0x32')](db['VtigerField'][_0x12d4('0x2b')]);_0x31ddc0[_0x12d4('0x31')]=_[_0x12d4('0x32')](_0xd674bd[_0x12d4('0x31')]);_0x31ddc0['filters']=_[_0x12d4('0x43')](_0x31ddc0['model'],_0x31ddc0[_0x12d4('0x31')]);_0x592178[_0x12d4('0x33')]=_['intersection'](_0x31ddc0[_0x12d4('0x2f')],qs[_0x12d4('0x44')](_0xd674bd[_0x12d4('0x31')]['fields']));_0x592178[_0x12d4('0x33')]=_0x592178['attributes'][_0x12d4('0x45')]?_0x592178[_0x12d4('0x33')]:_0x31ddc0[_0x12d4('0x2f')];if(_0xd674bd[_0x12d4('0x31')]['includeAll']){_0x592178[_0x12d4('0x3e')]=[{'all':!![]}];}_0x592178=_[_0x12d4('0x39')]({},_0x592178,_0xd674bd['options']);return db[_0x12d4('0x2a')][_0x12d4('0x46')](_0x592178)[_0x12d4('0x23')](handleEntityNotFound(_0x295ed1,null))[_0x12d4('0x23')](respondWithResult(_0x295ed1,null))[_0x12d4('0x40')](handleError(_0x295ed1,null));};exports[_0x12d4('0x47')]=function(_0x573b05,_0x3283ff){return db[_0x12d4('0x2a')][_0x12d4('0x47')](_0x573b05['body'],{})[_0x12d4('0x23')](respondWithResult(_0x3283ff,0xc9))['catch'](handleError(_0x3283ff,null));};exports['update']=function(_0x466211,_0x49a6e2){if(_0x466211[_0x12d4('0x48')]['id']){delete _0x466211[_0x12d4('0x48')]['id'];}return db[_0x12d4('0x2a')][_0x12d4('0x46')]({'where':{'id':_0x466211[_0x12d4('0x42')]['id']}})[_0x12d4('0x23')](handleEntityNotFound(_0x49a6e2,null))[_0x12d4('0x23')](saveUpdates(_0x466211[_0x12d4('0x48')],null))[_0x12d4('0x23')](respondWithResult(_0x49a6e2,null))[_0x12d4('0x40')](handleError(_0x49a6e2,null));};exports['destroy']=function(_0x499de6,_0x301f76){return db['VtigerField'][_0x12d4('0x46')]({'where':{'id':_0x499de6['params']['id']}})[_0x12d4('0x23')](handleEntityNotFound(_0x301f76,null))['then'](removeEntity(_0x301f76,null))[_0x12d4('0x40')](handleError(_0x301f76,null));}; \ No newline at end of file +var _0x28c7=['to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','set','Content-Range','apply','reject','save','update','end','stack','name','send','map','VtigerField','rawAttributes','fieldName','type','key','keys','filters','intersection','attributes','fields','query','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','then','include','findAll','rows','catch','show','includeAll','find','create','body','destroy','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x60e21b,_0x5bc9bf){var _0x279a12=function(_0x23c0d0){while(--_0x23c0d0){_0x60e21b['push'](_0x60e21b['shift']());}};_0x279a12(++_0x5bc9bf);}(_0x28c7,0x1d2));var _0x728c=function(_0x31e0a6,_0xd2993c){_0x31e0a6=_0x31e0a6-0x0;var _0x33c0a5=_0x28c7[_0x31e0a6];return _0x33c0a5;};'use strict';var emlformat=require(_0x728c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x728c('0x1'));var rp=require(_0x728c('0x2'));var moment=require(_0x728c('0x3'));var BPromise=require(_0x728c('0x4'));var Mustache=require(_0x728c('0x5'));var util=require('util');var path=require(_0x728c('0x6'));var sox=require(_0x728c('0x7'));var csv=require(_0x728c('0x8'));var ejs=require(_0x728c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x728c('0xa'));var squel=require(_0x728c('0xb'));var crypto=require('crypto');var jsforce=require(_0x728c('0xc'));var deskjs=require(_0x728c('0xd'));var toCsv=require(_0x728c('0x8'));var querystring=require(_0x728c('0xe'));var Papa=require(_0x728c('0xf'));var Redis=require(_0x728c('0x10'));var authService=require(_0x728c('0x11'));var qs=require(_0x728c('0x12'));var as=require(_0x728c('0x13'));var hardwareService=require(_0x728c('0x14'));var logger=require(_0x728c('0x15'))('api');var utils=require(_0x728c('0x16'));var config=require(_0x728c('0x17'));var licenseUtil=require(_0x728c('0x18'));var db=require(_0x728c('0x19'))['db'];function respondWithStatusCode(_0x1e8736,_0x19c026){_0x19c026=_0x19c026||0xcc;return function(_0x59b826){if(_0x59b826){return _0x1e8736[_0x728c('0x1a')](_0x19c026);}return _0x1e8736[_0x728c('0x1b')](_0x19c026)['end']();};}function respondWithResult(_0x5bc4b5,_0x4a70ed){_0x4a70ed=_0x4a70ed||0xc8;return function(_0x3aed79){if(_0x3aed79){return _0x5bc4b5['status'](_0x4a70ed)[_0x728c('0x1c')](_0x3aed79);}};}function respondWithFilteredResult(_0x550743,_0x3f607e){return function(_0x36fd3b){if(_0x36fd3b){var _0x39752c=typeof _0x3f607e['offset']==='undefined'&&typeof _0x3f607e[_0x728c('0x1d')]===_0x728c('0x1e');var _0x5f5c3e=_0x36fd3b['count'];var _0x100eca=_0x39752c?0x0:_0x3f607e[_0x728c('0x1f')];var _0x10e310=_0x39752c?_0x36fd3b['count']:_0x3f607e[_0x728c('0x1f')]+_0x3f607e[_0x728c('0x1d')];var _0x55904d;if(_0x10e310>=_0x5f5c3e){_0x10e310=_0x5f5c3e;_0x55904d=0xc8;}else{_0x55904d=0xce;}_0x550743[_0x728c('0x1b')](_0x55904d);return _0x550743[_0x728c('0x20')](_0x728c('0x21'),_0x100eca+'-'+_0x10e310+'/'+_0x5f5c3e)[_0x728c('0x1c')](_0x36fd3b);}return null;};}function patchUpdates(_0x4d9eb9){return function(_0x46396e){try{jsonpatch[_0x728c('0x22')](_0x46396e,_0x4d9eb9,!![]);}catch(_0x1719e5){return BPromise[_0x728c('0x23')](_0x1719e5);}return _0x46396e[_0x728c('0x24')]();};}function saveUpdates(_0x476f89,_0x9352c9){return function(_0x15d424){if(_0x15d424){return _0x15d424[_0x728c('0x25')](_0x476f89)['then'](function(_0x4a0dc2){return _0x4a0dc2;});}return null;};}function removeEntity(_0x616eb6,_0x4cb2be){return function(_0xfee230){if(_0xfee230){return _0xfee230['destroy']()['then'](function(){_0x616eb6[_0x728c('0x1b')](0xcc)[_0x728c('0x26')]();});}};}function handleEntityNotFound(_0x40f92e,_0x1704cf){return function(_0x89c97b){if(!_0x89c97b){_0x40f92e[_0x728c('0x1a')](0x194);}return _0x89c97b;};}function handleError(_0x42d335,_0x695fe0){_0x695fe0=_0x695fe0||0x1f4;return function(_0x5226b2){logger['error'](_0x5226b2[_0x728c('0x27')]);if(_0x5226b2[_0x728c('0x28')]){delete _0x5226b2[_0x728c('0x28')];}_0x42d335[_0x728c('0x1b')](_0x695fe0)[_0x728c('0x29')](_0x5226b2);};}exports['index']=function(_0x357e3e,_0x1187a3){var _0x5ba1dc={},_0x5a81e2={},_0x201ac5={'count':0x0,'rows':[]};var _0x1c6d1f=_[_0x728c('0x2a')](db[_0x728c('0x2b')][_0x728c('0x2c')],function(_0x1b8f27){return{'name':_0x1b8f27[_0x728c('0x2d')],'type':_0x1b8f27[_0x728c('0x2e')][_0x728c('0x2f')]};});_0x5a81e2['model']=_[_0x728c('0x2a')](_0x1c6d1f,_0x728c('0x28'));_0x5a81e2['query']=_[_0x728c('0x30')](_0x357e3e['query']);_0x5a81e2[_0x728c('0x31')]=_[_0x728c('0x32')](_0x5a81e2['model'],_0x5a81e2['query']);_0x5ba1dc[_0x728c('0x33')]=_[_0x728c('0x32')](_0x5a81e2['model'],qs[_0x728c('0x34')](_0x357e3e[_0x728c('0x35')]['fields']));_0x5ba1dc[_0x728c('0x33')]=_0x5ba1dc['attributes'][_0x728c('0x36')]?_0x5ba1dc[_0x728c('0x33')]:_0x5a81e2[_0x728c('0x37')];if(!_0x357e3e[_0x728c('0x35')][_0x728c('0x38')](_0x728c('0x39'))){_0x5ba1dc[_0x728c('0x1d')]=qs[_0x728c('0x1d')](_0x357e3e[_0x728c('0x35')][_0x728c('0x1d')]);_0x5ba1dc['offset']=qs[_0x728c('0x1f')](_0x357e3e[_0x728c('0x35')][_0x728c('0x1f')]);}_0x5ba1dc[_0x728c('0x3a')]=qs[_0x728c('0x3b')](_0x357e3e[_0x728c('0x35')]['sort']);_0x5ba1dc[_0x728c('0x3c')]=qs[_0x728c('0x31')](_[_0x728c('0x3d')](_0x357e3e[_0x728c('0x35')],_0x5a81e2[_0x728c('0x31')]),_0x1c6d1f);if(_0x357e3e[_0x728c('0x35')][_0x728c('0x3e')]){_0x5ba1dc[_0x728c('0x3c')]=_[_0x728c('0x3f')](_0x5ba1dc['where'],{'$or':_[_0x728c('0x2a')](_0x1c6d1f,function(_0xf8977f){if(_0xf8977f[_0x728c('0x2e')]!==_0x728c('0x40')){var _0x127a88={};_0x127a88[_0xf8977f[_0x728c('0x28')]]={'$like':'%'+_0x357e3e['query'][_0x728c('0x3e')]+'%'};return _0x127a88;}})});}_0x5ba1dc=_[_0x728c('0x3f')]({},_0x5ba1dc,_0x357e3e[_0x728c('0x41')]);var _0x5f0ff4={'where':_0x5ba1dc[_0x728c('0x3c')]};return db[_0x728c('0x2b')][_0x728c('0x42')](_0x5f0ff4)[_0x728c('0x43')](function(_0x5af02a){_0x201ac5[_0x728c('0x42')]=_0x5af02a;if(_0x357e3e[_0x728c('0x35')]['includeAll']){_0x5ba1dc[_0x728c('0x44')]=[{'all':!![]}];}return db[_0x728c('0x2b')][_0x728c('0x45')](_0x5ba1dc);})[_0x728c('0x43')](function(_0x467001){_0x201ac5[_0x728c('0x46')]=_0x467001;return _0x201ac5;})[_0x728c('0x43')](respondWithFilteredResult(_0x1187a3,_0x5ba1dc))[_0x728c('0x47')](handleError(_0x1187a3,null));};exports[_0x728c('0x48')]=function(_0x33fa78,_0x49152e){var _0x509d15={'raw':!![],'where':{'id':_0x33fa78['params']['id']}},_0x5c31d5={};_0x5c31d5[_0x728c('0x37')]=_['keys'](db['VtigerField']['rawAttributes']);_0x5c31d5['query']=_[_0x728c('0x30')](_0x33fa78[_0x728c('0x35')]);_0x5c31d5[_0x728c('0x31')]=_[_0x728c('0x32')](_0x5c31d5[_0x728c('0x37')],_0x5c31d5['query']);_0x509d15[_0x728c('0x33')]=_[_0x728c('0x32')](_0x5c31d5[_0x728c('0x37')],qs[_0x728c('0x34')](_0x33fa78['query']['fields']));_0x509d15[_0x728c('0x33')]=_0x509d15[_0x728c('0x33')][_0x728c('0x36')]?_0x509d15[_0x728c('0x33')]:_0x5c31d5[_0x728c('0x37')];if(_0x33fa78['query'][_0x728c('0x49')]){_0x509d15[_0x728c('0x44')]=[{'all':!![]}];}_0x509d15=_[_0x728c('0x3f')]({},_0x509d15,_0x33fa78[_0x728c('0x41')]);return db[_0x728c('0x2b')][_0x728c('0x4a')](_0x509d15)['then'](handleEntityNotFound(_0x49152e,null))[_0x728c('0x43')](respondWithResult(_0x49152e,null))['catch'](handleError(_0x49152e,null));};exports[_0x728c('0x4b')]=function(_0x16c531,_0x838b89){return db[_0x728c('0x2b')][_0x728c('0x4b')](_0x16c531['body'],{})[_0x728c('0x43')](respondWithResult(_0x838b89,0xc9))[_0x728c('0x47')](handleError(_0x838b89,null));};exports[_0x728c('0x25')]=function(_0x3081bd,_0x54a40c){if(_0x3081bd['body']['id']){delete _0x3081bd[_0x728c('0x4c')]['id'];}return db[_0x728c('0x2b')][_0x728c('0x4a')]({'where':{'id':_0x3081bd['params']['id']}})[_0x728c('0x43')](handleEntityNotFound(_0x54a40c,null))['then'](saveUpdates(_0x3081bd[_0x728c('0x4c')],null))[_0x728c('0x43')](respondWithResult(_0x54a40c,null))[_0x728c('0x47')](handleError(_0x54a40c,null));};exports[_0x728c('0x4d')]=function(_0x37b236,_0x2d52c9){return db[_0x728c('0x2b')][_0x728c('0x4a')]({'where':{'id':_0x37b236[_0x728c('0x4e')]['id']}})[_0x728c('0x43')](handleEntityNotFound(_0x2d52c9,null))['then'](removeEntity(_0x2d52c9,null))[_0x728c('0x47')](handleError(_0x2d52c9,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index cabde4d..ff1febf 100644 --- a/server/api/intVtigerField/intVtigerField.model.js +++ b/server/api/intVtigerField/intVtigerField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x08ac=['./intVtigerField.attributes','exports','define','VtigerField','idField','FieldId','lodash','util','moment','bluebird','../../config/environment'];(function(_0x4f2106,_0x3fb5bc){var _0x13d490=function(_0x1b978a){while(--_0x1b978a){_0x4f2106['push'](_0x4f2106['shift']());}};_0x13d490(++_0x3fb5bc);}(_0x08ac,0x95));var _0xc08a=function(_0x4c71d5,_0x206ce4){_0x4c71d5=_0x4c71d5-0x0;var _0x1be35e=_0x08ac[_0x4c71d5];return _0x1be35e;};'use strict';var _=require(_0xc08a('0x0'));var util=require(_0xc08a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc08a('0x2'));var BPromise=require(_0xc08a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc08a('0x4'));var attributes=require(_0xc08a('0x5'));module[_0xc08a('0x6')]=function(_0x31e3b8,_0x434fe9){return _0x31e3b8[_0xc08a('0x7')](_0xc08a('0x8'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0xc08a('0x9'),_0xc08a('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1a66=['./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','idField','FieldId','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3b90ab,_0x174a22){var _0x206e92=function(_0x21fbd3){while(--_0x21fbd3){_0x3b90ab['push'](_0x3b90ab['shift']());}};_0x206e92(++_0x174a22);}(_0x1a66,0x149));var _0x61a6=function(_0x3faeda,_0x482d96){_0x3faeda=_0x3faeda-0x0;var _0x447642=_0x1a66[_0x3faeda];return _0x447642;};'use strict';var _=require('lodash');var util=require(_0x61a6('0x0'));var logger=require('../../config/logger')(_0x61a6('0x1'));var moment=require(_0x61a6('0x2'));var BPromise=require(_0x61a6('0x3'));var rp=require(_0x61a6('0x4'));var fs=require('fs');var path=require(_0x61a6('0x5'));var rimraf=require(_0x61a6('0x6'));var config=require('../../config/environment');var attributes=require(_0x61a6('0x7'));module[_0x61a6('0x8')]=function(_0x3b68fd,_0x19bad4){return _0x3b68fd[_0x61a6('0x9')](_0x61a6('0xa'),attributes,{'tableName':_0x61a6('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x61a6('0xc'),_0x61a6('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 77f71d5..a6a65bc 100644 --- a/server/api/intVtigerField/intVtigerField.rpc.js +++ b/server/api/intVtigerField/intVtigerField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef6d=['request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5026a2,_0x3f608b){var _0x56055e=function(_0x8fc65c){while(--_0x8fc65c){_0x5026a2['push'](_0x5026a2['shift']());}};_0x56055e(++_0x3f608b);}(_0xef6d,0x13f));var _0xdef6=function(_0x587a8e,_0x33ae0a){_0x587a8e=_0x587a8e-0x0;var _0x3e8682=_0xef6d[_0x587a8e];return _0x3e8682;};'use strict';var _=require(_0xdef6('0x0'));var util=require('util');var moment=require(_0xdef6('0x1'));var BPromise=require(_0xdef6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdef6('0x3'));var db=require(_0xdef6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdef6('0x5'))(_0xdef6('0x6'));var config=require(_0xdef6('0x7'));var jayson=require(_0xdef6('0x8'));var client=jayson[_0xdef6('0x9')][_0xdef6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bc5c9,_0x54702a,_0x9231cf){return new BPromise(function(_0x19e36d,_0x47202d){return client[_0xdef6('0xb')](_0x2bc5c9,_0x9231cf)[_0xdef6('0xc')](function(_0x201a7d){logger[_0xdef6('0xd')](_0xdef6('0xe'),_0x54702a,_0xdef6('0xf'));logger[_0xdef6('0x10')](_0xdef6('0x11'),_0x54702a,_0xdef6('0xf'),JSON['stringify'](_0x201a7d));if(_0x201a7d['error']){if(_0x201a7d[_0xdef6('0x12')][_0xdef6('0x13')]===0x1f4){logger[_0xdef6('0x12')](_0xdef6('0xe'),_0x54702a,_0x201a7d[_0xdef6('0x12')][_0xdef6('0x14')]);return _0x47202d(_0x201a7d[_0xdef6('0x12')][_0xdef6('0x14')]);}logger[_0xdef6('0x12')]('VtigerField,\x20%s,\x20%s',_0x54702a,_0x201a7d['error'][_0xdef6('0x14')]);return _0x19e36d(_0x201a7d['error'][_0xdef6('0x14')]);}else{logger[_0xdef6('0xd')](_0xdef6('0xe'),_0x54702a,_0xdef6('0xf'));_0x19e36d(_0x201a7d[_0xdef6('0x15')][_0xdef6('0x14')]);}})['catch'](function(_0x540e40){logger[_0xdef6('0x12')](_0xdef6('0xe'),_0x54702a,_0x540e40);_0x47202d(_0x540e40);});});} \ No newline at end of file +var _0x6ac9=['client','http','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x53de91,_0x2b530e){var _0x249606=function(_0x20e428){while(--_0x20e428){_0x53de91['push'](_0x53de91['shift']());}};_0x249606(++_0x2b530e);}(_0x6ac9,0x112));var _0x96ac=function(_0x2f3fd1,_0xa4f117){_0x2f3fd1=_0x2f3fd1-0x0;var _0x3fc1c1=_0x6ac9[_0x2f3fd1];return _0x3fc1c1;};'use strict';var _=require(_0x96ac('0x0'));var util=require(_0x96ac('0x1'));var moment=require(_0x96ac('0x2'));var BPromise=require(_0x96ac('0x3'));var rs=require(_0x96ac('0x4'));var fs=require('fs');var Redis=require(_0x96ac('0x5'));var db=require(_0x96ac('0x6'))['db'];var utils=require(_0x96ac('0x7'));var logger=require(_0x96ac('0x8'))(_0x96ac('0x9'));var config=require(_0x96ac('0xa'));var jayson=require(_0x96ac('0xb'));var client=jayson[_0x96ac('0xc')][_0x96ac('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x35a26d,_0x2dbbc6,_0x4d1e3e){return new BPromise(function(_0x41c422,_0x314399){return client[_0x96ac('0xe')](_0x35a26d,_0x4d1e3e)[_0x96ac('0xf')](function(_0x593c23){logger[_0x96ac('0x10')](_0x96ac('0x11'),_0x2dbbc6,'request\x20sent');logger[_0x96ac('0x12')](_0x96ac('0x13'),_0x2dbbc6,_0x96ac('0x14'),JSON[_0x96ac('0x15')](_0x593c23));if(_0x593c23[_0x96ac('0x16')]){if(_0x593c23['error'][_0x96ac('0x17')]===0x1f4){logger[_0x96ac('0x16')](_0x96ac('0x11'),_0x2dbbc6,_0x593c23[_0x96ac('0x16')][_0x96ac('0x18')]);return _0x314399(_0x593c23[_0x96ac('0x16')][_0x96ac('0x18')]);}logger[_0x96ac('0x16')](_0x96ac('0x11'),_0x2dbbc6,_0x593c23['error']['message']);return _0x41c422(_0x593c23[_0x96ac('0x16')]['message']);}else{logger['info'](_0x96ac('0x11'),_0x2dbbc6,_0x96ac('0x14'));_0x41c422(_0x593c23[_0x96ac('0x19')][_0x96ac('0x18')]);}})['catch'](function(_0xb9d083){logger['error']('VtigerField,\x20%s,\x20%s',_0x2dbbc6,_0xb9d083);_0x314399(_0xb9d083);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index f2c543e..8529424 100644 --- a/server/api/intZendeskAccount/index.js +++ b/server/api/intZendeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bb4=['exports','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','/:id','show','get','/:id/configurations','getConfigurations','post','addConfiguration','put','delete','destroy'];(function(_0x2e4c2e,_0x1df99e){var _0xf5d858=function(_0x3367c7){while(--_0x3367c7){_0x2e4c2e['push'](_0x2e4c2e['shift']());}};_0xf5d858(++_0x1df99e);}(_0x7bb4,0x191));var _0x47bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7bb4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x47bb('0x0'));var path=require(_0x47bb('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x47bb('0x2')]();var fs_extra=require(_0x47bb('0x3'));var auth=require(_0x47bb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x47bb('0x5'));var controller=require(_0x47bb('0x6'));router['get']('/',auth[_0x47bb('0x7')](),controller[_0x47bb('0x8')]);router['get'](_0x47bb('0x9'),auth[_0x47bb('0x7')](),controller[_0x47bb('0xa')]);router[_0x47bb('0xb')](_0x47bb('0xc'),auth[_0x47bb('0x7')](),controller[_0x47bb('0xd')]);router[_0x47bb('0xb')]('/:id/fields',auth[_0x47bb('0x7')](),controller['getFields']);router[_0x47bb('0xe')]('/',auth[_0x47bb('0x7')](),controller['create']);router['post'](_0x47bb('0xc'),auth[_0x47bb('0x7')](),controller[_0x47bb('0xf')]);router[_0x47bb('0x10')](_0x47bb('0x9'),auth[_0x47bb('0x7')](),controller['update']);router[_0x47bb('0x11')](_0x47bb('0x9'),auth[_0x47bb('0x7')](),controller[_0x47bb('0x12')]);module[_0x47bb('0x13')]=router; \ No newline at end of file +var _0x10c9=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x19a490,_0x4627d9){var _0x52081c=function(_0x418ba5){while(--_0x418ba5){_0x19a490['push'](_0x19a490['shift']());}};_0x52081c(++_0x4627d9);}(_0x10c9,0xc0));var _0x910c=function(_0x3caca9,_0x38f3fe){_0x3caca9=_0x3caca9-0x0;var _0x2a0468=_0x10c9[_0x3caca9];return _0x2a0468;};'use strict';var multer=require(_0x910c('0x0'));var util=require(_0x910c('0x1'));var path=require(_0x910c('0x2'));var timeout=require(_0x910c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x910c('0x4'));var auth=require(_0x910c('0x5'));var interaction=require(_0x910c('0x6'));var config=require(_0x910c('0x7'));var controller=require('./intZendeskAccount.controller');router[_0x910c('0x8')]('/',auth[_0x910c('0x9')](),controller[_0x910c('0xa')]);router['get'](_0x910c('0xb'),auth['isAuthenticated'](),controller[_0x910c('0xc')]);router[_0x910c('0x8')]('/:id/configurations',auth[_0x910c('0x9')](),controller[_0x910c('0xd')]);router['get']('/:id/fields',auth[_0x910c('0x9')](),controller[_0x910c('0xe')]);router[_0x910c('0xf')]('/',auth['isAuthenticated'](),controller[_0x910c('0x10')]);router[_0x910c('0xf')](_0x910c('0x11'),auth['isAuthenticated'](),controller[_0x910c('0x12')]);router[_0x910c('0x13')](_0x910c('0xb'),auth[_0x910c('0x9')](),controller[_0x910c('0x14')]);router[_0x910c('0x15')]('/:id',auth[_0x910c('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 27ddda3..8e7946d 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.attributes.js +++ b/server/api/intZendeskAccount/intZendeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1122=['newTab','sequelize','STRING','username','remoteUri','password','token','ENUM','integrationTab'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1122,0xac));var _0x2112=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1122[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2112('0x0'));module['exports']={'name':{'type':Sequelize[_0x2112('0x1')]},'description':{'type':Sequelize[_0x2112('0x1')]},'username':{'type':Sequelize[_0x2112('0x1')],'unique':_0x2112('0x2')},'password':{'type':Sequelize[_0x2112('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x2112('0x3')},'authType':{'type':Sequelize['ENUM'](_0x2112('0x4'),_0x2112('0x5')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x2112('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x2112('0x6')](_0x2112('0x7'),_0x2112('0x8')),'defaultValue':_0x2112('0x7')}}; \ No newline at end of file +var _0x7524=['username','ENUM','password','token','integrationTab','newTab','exports','STRING'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x7524,0xce));var _0x4752=function(_0x155c31,_0x15c292){_0x155c31=_0x155c31-0x0;var _0x4f503e=_0x7524[_0x155c31];return _0x4f503e;};'use strict';var Sequelize=require('sequelize');module[_0x4752('0x0')]={'name':{'type':Sequelize[_0x4752('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4752('0x1')],'unique':_0x4752('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x4752('0x1')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x4752('0x3')](_0x4752('0x4'),_0x4752('0x5')),'defaultValue':_0x4752('0x4')},'serverUrl':{'type':Sequelize[_0x4752('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4752('0x6'),_0x4752('0x7')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index a669671..4fcdade 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.controller.js +++ b/server/api/intZendeskAccount/intZendeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c76=['findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','username','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:%s','toString','base64','headers','%s/token:%s','Sequelize','ValidationError','subject','description','group','ticket_fields','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','apply','reject','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','ZendeskAccount','count','includeAll','include','findAll','rows','catch','show','params','create','body','find','getConfigurations','ZendeskConfiguration','addConfiguration'];(function(_0x10b33e,_0x31e699){var _0x2d6ee0=function(_0x5a06c7){while(--_0x5a06c7){_0x10b33e['push'](_0x10b33e['shift']());}};_0x2d6ee0(++_0x31e699);}(_0x6c76,0x184));var _0x66c7=function(_0x44c7ca,_0x37a9ed){_0x44c7ca=_0x44c7ca-0x0;var _0x51b2c1=_0x6c76[_0x44c7ca];return _0x51b2c1;};'use strict';var emlformat=require(_0x66c7('0x0'));var rimraf=require(_0x66c7('0x1'));var zipdir=require(_0x66c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x66c7('0x3'));var moment=require(_0x66c7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x66c7('0x5'));var path=require(_0x66c7('0x6'));var sox=require('sox');var csv=require(_0x66c7('0x7'));var ejs=require(_0x66c7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x66c7('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x66c7('0xa'));var deskjs=require(_0x66c7('0xb'));var toCsv=require(_0x66c7('0x7'));var querystring=require('querystring');var Papa=require(_0x66c7('0xc'));var Redis=require(_0x66c7('0xd'));var authService=require(_0x66c7('0xe'));var qs=require(_0x66c7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x66c7('0x10'));var logger=require(_0x66c7('0x11'))(_0x66c7('0x12'));var utils=require(_0x66c7('0x13'));var config=require(_0x66c7('0x14'));var licenseUtil=require(_0x66c7('0x15'));var db=require(_0x66c7('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x18c309,_0x760e36){_0x760e36=_0x760e36||0xcc;return function(_0x35cbc2){if(_0x35cbc2){return _0x18c309[_0x66c7('0x17')](_0x760e36);}return _0x18c309[_0x66c7('0x18')](_0x760e36)[_0x66c7('0x19')]();};}function respondWithResult(_0x618bd7,_0xf3b04){_0xf3b04=_0xf3b04||0xc8;return function(_0x6400fe){if(_0x6400fe){return _0x618bd7['status'](_0xf3b04)[_0x66c7('0x1a')](_0x6400fe);}};}function respondWithFilteredResult(_0x4dd902,_0x208010){return function(_0x39f951){if(_0x39f951){var _0x3c81c0=typeof _0x208010[_0x66c7('0x1b')]===_0x66c7('0x1c')&&typeof _0x208010['limit']==='undefined';var _0x53fb36=_0x39f951['count'];var _0x8ad572=_0x3c81c0?0x0:_0x208010[_0x66c7('0x1b')];var _0x47a299=_0x3c81c0?_0x39f951['count']:_0x208010[_0x66c7('0x1b')]+_0x208010[_0x66c7('0x1d')];var _0x4756f7;if(_0x47a299>=_0x53fb36){_0x47a299=_0x53fb36;_0x4756f7=0xc8;}else{_0x4756f7=0xce;}_0x4dd902[_0x66c7('0x18')](_0x4756f7);return _0x4dd902['set']('Content-Range',_0x8ad572+'-'+_0x47a299+'/'+_0x53fb36)[_0x66c7('0x1a')](_0x39f951);}return null;};}function patchUpdates(_0x237177){return function(_0xf30f9){try{jsonpatch[_0x66c7('0x1e')](_0xf30f9,_0x237177,!![]);}catch(_0x465457){return BPromise[_0x66c7('0x1f')](_0x465457);}return _0xf30f9['save']();};}function saveUpdates(_0x4ddbd2,_0x366e9b){return function(_0x4a2b90){if(_0x4a2b90){return _0x4a2b90[_0x66c7('0x20')](_0x4ddbd2)[_0x66c7('0x21')](function(_0x44bdef){return _0x44bdef;});}return null;};}function removeEntity(_0x1fc9d3,_0x5bfaf6){return function(_0x2736df){if(_0x2736df){return _0x2736df[_0x66c7('0x22')]()['then'](function(){_0x1fc9d3[_0x66c7('0x18')](0xcc)[_0x66c7('0x19')]();});}};}function handleEntityNotFound(_0x2bb86d,_0x2ef6a2){return function(_0x2af0a3){if(!_0x2af0a3){_0x2bb86d['sendStatus'](0x194);}return _0x2af0a3;};}function handleError(_0x5bc4e6,_0x4e514a){_0x4e514a=_0x4e514a||0x1f4;return function(_0x2dd131){logger[_0x66c7('0x23')](_0x2dd131['stack']);if(_0x2dd131[_0x66c7('0x24')]){delete _0x2dd131[_0x66c7('0x24')];}_0x5bc4e6[_0x66c7('0x18')](_0x4e514a)[_0x66c7('0x25')](_0x2dd131);};}exports[_0x66c7('0x26')]=function(_0x27be81,_0x570f0d){var _0xccefb2={},_0x2e2560={},_0xc4b2bf={'count':0x0,'rows':[]};var _0x33be23=_[_0x66c7('0x27')](db['ZendeskAccount'][_0x66c7('0x28')],function(_0x4f1a34){return{'name':_0x4f1a34[_0x66c7('0x29')],'type':_0x4f1a34['type'][_0x66c7('0x2a')]};});_0x2e2560[_0x66c7('0x2b')]=_[_0x66c7('0x27')](_0x33be23,_0x66c7('0x24'));_0x2e2560[_0x66c7('0x2c')]=_[_0x66c7('0x2d')](_0x27be81['query']);_0x2e2560['filters']=_[_0x66c7('0x2e')](_0x2e2560[_0x66c7('0x2b')],_0x2e2560[_0x66c7('0x2c')]);_0xccefb2[_0x66c7('0x2f')]=_[_0x66c7('0x2e')](_0x2e2560[_0x66c7('0x2b')],qs[_0x66c7('0x30')](_0x27be81[_0x66c7('0x2c')][_0x66c7('0x30')]));_0xccefb2[_0x66c7('0x2f')]=_0xccefb2[_0x66c7('0x2f')][_0x66c7('0x31')]?_0xccefb2['attributes']:_0x2e2560['model'];if(!_0x27be81[_0x66c7('0x2c')][_0x66c7('0x32')](_0x66c7('0x33'))){_0xccefb2[_0x66c7('0x1d')]=qs[_0x66c7('0x1d')](_0x27be81[_0x66c7('0x2c')][_0x66c7('0x1d')]);_0xccefb2['offset']=qs[_0x66c7('0x1b')](_0x27be81[_0x66c7('0x2c')][_0x66c7('0x1b')]);}_0xccefb2[_0x66c7('0x34')]=qs[_0x66c7('0x35')](_0x27be81[_0x66c7('0x2c')][_0x66c7('0x35')]);_0xccefb2[_0x66c7('0x36')]=qs[_0x66c7('0x37')](_[_0x66c7('0x38')](_0x27be81[_0x66c7('0x2c')],_0x2e2560['filters']),_0x33be23);if(_0x27be81['query'][_0x66c7('0x39')]){_0xccefb2[_0x66c7('0x36')]=_[_0x66c7('0x3a')](_0xccefb2['where'],{'$or':_['map'](_0x33be23,function(_0x2e31b8){if(_0x2e31b8[_0x66c7('0x3b')]!=='VIRTUAL'){var _0x2d98e4={};_0x2d98e4[_0x2e31b8[_0x66c7('0x24')]]={'$like':'%'+_0x27be81[_0x66c7('0x2c')]['filter']+'%'};return _0x2d98e4;}})});}_0xccefb2=_[_0x66c7('0x3a')]({},_0xccefb2,_0x27be81[_0x66c7('0x3c')]);var _0x9f6ca8={'where':_0xccefb2[_0x66c7('0x36')]};return db[_0x66c7('0x3d')][_0x66c7('0x3e')](_0x9f6ca8)[_0x66c7('0x21')](function(_0x279d27){_0xc4b2bf[_0x66c7('0x3e')]=_0x279d27;if(_0x27be81['query'][_0x66c7('0x3f')]){_0xccefb2[_0x66c7('0x40')]=[{'all':!![]}];}return db[_0x66c7('0x3d')][_0x66c7('0x41')](_0xccefb2);})[_0x66c7('0x21')](function(_0x28983c){_0xc4b2bf[_0x66c7('0x42')]=_0x28983c;return _0xc4b2bf;})[_0x66c7('0x21')](respondWithFilteredResult(_0x570f0d,_0xccefb2))[_0x66c7('0x43')](handleError(_0x570f0d,null));};exports[_0x66c7('0x44')]=function(_0x513317,_0x5bb5fc){var _0x528f5c={'raw':![],'where':{'id':_0x513317[_0x66c7('0x45')]['id']}},_0x209f58={};_0x209f58['model']=_['keys'](db[_0x66c7('0x3d')][_0x66c7('0x28')]);_0x209f58[_0x66c7('0x2c')]=_[_0x66c7('0x2d')](_0x513317[_0x66c7('0x2c')]);_0x209f58['filters']=_[_0x66c7('0x2e')](_0x209f58['model'],_0x209f58['query']);_0x528f5c[_0x66c7('0x2f')]=_[_0x66c7('0x2e')](_0x209f58[_0x66c7('0x2b')],qs[_0x66c7('0x30')](_0x513317['query']['fields']));_0x528f5c[_0x66c7('0x2f')]=_0x528f5c['attributes']['length']?_0x528f5c[_0x66c7('0x2f')]:_0x209f58[_0x66c7('0x2b')];if(_0x513317[_0x66c7('0x2c')][_0x66c7('0x3f')]){_0x528f5c['include']=[{'all':!![]}];}_0x528f5c=_[_0x66c7('0x3a')]({},_0x528f5c,_0x513317[_0x66c7('0x3c')]);return db[_0x66c7('0x3d')]['find'](_0x528f5c)[_0x66c7('0x21')](handleEntityNotFound(_0x5bb5fc,null))[_0x66c7('0x21')](respondWithResult(_0x5bb5fc,null))[_0x66c7('0x43')](handleError(_0x5bb5fc,null));};exports[_0x66c7('0x46')]=function(_0x1b78a6,_0x3b4f34){return db[_0x66c7('0x3d')][_0x66c7('0x46')](_0x1b78a6['body'],{})[_0x66c7('0x21')](respondWithResult(_0x3b4f34,0xc9))[_0x66c7('0x43')](handleError(_0x3b4f34,null));};exports[_0x66c7('0x20')]=function(_0x1386a2,_0x208a15){if(_0x1386a2[_0x66c7('0x47')]['id']){delete _0x1386a2[_0x66c7('0x47')]['id'];}return db[_0x66c7('0x3d')][_0x66c7('0x48')]({'where':{'id':_0x1386a2[_0x66c7('0x45')]['id']}})[_0x66c7('0x21')](handleEntityNotFound(_0x208a15,null))[_0x66c7('0x21')](saveUpdates(_0x1386a2[_0x66c7('0x47')],null))[_0x66c7('0x21')](respondWithResult(_0x208a15,null))['catch'](handleError(_0x208a15,null));};exports[_0x66c7('0x22')]=function(_0x225fb6,_0x27070b){return db[_0x66c7('0x3d')]['find']({'where':{'id':_0x225fb6[_0x66c7('0x45')]['id']}})[_0x66c7('0x21')](handleEntityNotFound(_0x27070b,null))['then'](removeEntity(_0x27070b,null))[_0x66c7('0x43')](handleError(_0x27070b,null));};exports[_0x66c7('0x49')]=function(_0xe4304c,_0x3dee16,_0x17670c){var _0x1c88c0={};var _0x1ed21e={};var _0x5cd4e9;var _0x933dd6;return db[_0x66c7('0x3d')]['findOne']({'where':{'id':_0xe4304c[_0x66c7('0x45')]['id']}})[_0x66c7('0x21')](handleEntityNotFound(_0x3dee16,null))[_0x66c7('0x21')](function(_0x5df6d1){if(_0x5df6d1){_0x5cd4e9=_0x5df6d1;_0x1ed21e[_0x66c7('0x2b')]=_[_0x66c7('0x2d')](db[_0x66c7('0x4a')][_0x66c7('0x28')]);_0x1ed21e[_0x66c7('0x2c')]=_[_0x66c7('0x2d')](_0xe4304c[_0x66c7('0x2c')]);_0x1ed21e[_0x66c7('0x37')]=_['intersection'](_0x1ed21e[_0x66c7('0x2b')],_0x1ed21e[_0x66c7('0x2c')]);_0x1c88c0['attributes']=_[_0x66c7('0x2e')](_0x1ed21e[_0x66c7('0x2b')],qs[_0x66c7('0x30')](_0xe4304c['query']['fields']));_0x1c88c0[_0x66c7('0x2f')]=_0x1c88c0['attributes'][_0x66c7('0x31')]?_0x1c88c0[_0x66c7('0x2f')]:_0x1ed21e[_0x66c7('0x2b')];_0x1c88c0[_0x66c7('0x34')]=qs[_0x66c7('0x35')](_0xe4304c[_0x66c7('0x2c')]['sort']);_0x1c88c0['where']=qs[_0x66c7('0x37')](_[_0x66c7('0x38')](_0xe4304c['query'],_0x1ed21e['filters']));if(_0xe4304c[_0x66c7('0x2c')]['filter']){_0x1c88c0[_0x66c7('0x36')]=_[_0x66c7('0x3a')](_0x1c88c0[_0x66c7('0x36')],{'$or':_[_0x66c7('0x27')](_0x1c88c0['attributes'],function(_0x3b26ac){var _0x1dc6e6={};_0x1dc6e6[_0x3b26ac]={'$like':'%'+_0xe4304c[_0x66c7('0x2c')][_0x66c7('0x39')]+'%'};return _0x1dc6e6;})});}_0x1c88c0=_[_0x66c7('0x3a')]({},_0x1c88c0,_0xe4304c[_0x66c7('0x3c')]);return _0x5cd4e9['getConfigurations'](_0x1c88c0);}})[_0x66c7('0x21')](function(_0x39c18e){if(_0x39c18e){_0x933dd6=_0x39c18e[_0x66c7('0x31')];if(!_0xe4304c['query'][_0x66c7('0x32')]('nolimit')){_0x1c88c0[_0x66c7('0x1d')]=qs[_0x66c7('0x1d')](_0xe4304c[_0x66c7('0x2c')][_0x66c7('0x1d')]);_0x1c88c0[_0x66c7('0x1b')]=qs[_0x66c7('0x1b')](_0xe4304c['query'][_0x66c7('0x1b')]);}return _0x5cd4e9[_0x66c7('0x49')](_0x1c88c0);}})[_0x66c7('0x21')](function(_0x3b24d9){if(_0x3b24d9){return _0x3b24d9?{'count':_0x933dd6,'rows':_0x3b24d9}:null;}})[_0x66c7('0x21')](respondWithResult(_0x3dee16,null))['catch'](handleError(_0x3dee16,null));};exports[_0x66c7('0x4b')]=function(_0x1cb5ef,_0x429096,_0x37f244){if(_0x1cb5ef[_0x66c7('0x47')]['id']){delete _0x1cb5ef[_0x66c7('0x47')]['id'];}return db[_0x66c7('0x3d')][_0x66c7('0x4c')]({'where':{'id':_0x1cb5ef[_0x66c7('0x45')]['id']}})[_0x66c7('0x21')](handleEntityNotFound(_0x429096,null))[_0x66c7('0x21')](function(_0x43b582){if(_0x43b582){_0x1cb5ef['body'][_0x66c7('0x4d')]=_0x43b582['id'];_0x1cb5ef[_0x66c7('0x47')][_0x66c7('0x4e')]=integrations[_0x66c7('0x4f')](_0x1cb5ef[_0x66c7('0x47')][_0x66c7('0x50')],_0x1cb5ef[_0x66c7('0x47')]['type']);_0x1cb5ef[_0x66c7('0x47')][_0x66c7('0x51')]=integrations[_0x66c7('0x52')](_0x1cb5ef[_0x66c7('0x47')][_0x66c7('0x50')],_0x1cb5ef[_0x66c7('0x47')][_0x66c7('0x3b')]);return db[_0x66c7('0x4a')][_0x66c7('0x46')](_0x1cb5ef[_0x66c7('0x47')],{'include':[{'model':db[_0x66c7('0x53')],'as':_0x66c7('0x4e')},{'model':db[_0x66c7('0x53')],'as':_0x66c7('0x51')}]});}return null;})[_0x66c7('0x21')](respondWithResult(_0x429096,null))[_0x66c7('0x43')](handleError(_0x429096,null));};exports['getFields']=function(_0x16d404,_0x31bc19,_0x43a623){var _0x153714='';return db[_0x66c7('0x3d')][_0x66c7('0x4c')]({'where':{'id':_0x16d404[_0x66c7('0x45')]['id']},'attributes':['id',_0x66c7('0x54'),_0x66c7('0x55'),_0x66c7('0x56'),_0x66c7('0x57'),_0x66c7('0x58')]})[_0x66c7('0x21')](handleEntityNotFound(_0x31bc19,null))[_0x66c7('0x21')](function(_0x3263ab){if(_0x3263ab){_0x153714=_0x3263ab[_0x66c7('0x58')];var _0x32a428=_0x153714['slice'](-0x1);if(_0x32a428==='/'){_0x153714=_0x153714[_0x66c7('0x59')](0x0,_0x153714[_0x66c7('0x5a')](_0x32a428));}var _0x188d9c={'method':_0x66c7('0x5b'),'uri':util[_0x66c7('0x5c')](_0x66c7('0x5d'),_0x153714,'ticket_fields'),'json':!![]};switch(_0x3263ab['authType']){case _0x66c7('0x55'):_0x188d9c['headers']={'Authorization':util[_0x66c7('0x5c')](_0x66c7('0x5e'),new Buffer(util[_0x66c7('0x5c')](_0x66c7('0x5f'),_0x3263ab[_0x66c7('0x54')],_0x3263ab[_0x66c7('0x55')]))[_0x66c7('0x60')](_0x66c7('0x61')))};break;case _0x66c7('0x56'):_0x188d9c[_0x66c7('0x62')]={'Authorization':util[_0x66c7('0x5c')](_0x66c7('0x5e'),new Buffer(util['format'](_0x66c7('0x63'),_0x3263ab[_0x66c7('0x54')],_0x3263ab[_0x66c7('0x56')]))[_0x66c7('0x60')]('base64'))};break;default:throw new db[(_0x66c7('0x64'))][(_0x66c7('0x65'))]('Unknown\x20authentication\x20type');}return rp(_0x188d9c);}})[_0x66c7('0x21')](function(_0x3a4fe1){if(_0x3a4fe1){var _0x3f25c0=[_0x66c7('0x66'),_0x66c7('0x67'),_0x66c7('0x68'),'assignee'];_['remove'](_0x3a4fe1[_0x66c7('0x69')],function(_0x549b15){return _0x3f25c0['includes'](_0x549b15[_0x66c7('0x3b')]);});return{'count':_0x3a4fe1[_0x66c7('0x69')][_0x66c7('0x31')],'rows':_[_0x66c7('0x27')](_0x3a4fe1[_0x66c7('0x69')],function(_0x536764){return{'id':_0x536764['id'],'name':_0x536764[_0x66c7('0x6a')]>0x7?_0x536764[_0x66c7('0x6b')]:_0x536764['type'],'custom':_0x536764[_0x66c7('0x6a')]>0x7?!![]:![],'options':_0x536764[_0x66c7('0x6c')]?_0x536764[_0x66c7('0x6c')]:_0x536764[_0x66c7('0x6d')]?_0x536764[_0x66c7('0x6d')]:[]};})};}})[_0x66c7('0x21')](respondWithResult(_0x31bc19,null))[_0x66c7('0x43')](function(_0x44a672){var _0x46b54f=_0x16d404[_0x66c7('0x2c')][_0x66c7('0x6e')]?0x1f4:_0x44a672[_0x66c7('0x6f')]||0x1f4;logger[_0x66c7('0x23')](_0x66c7('0x70'),_0x66c7('0x71'),_0x46b54f,JSON[_0x66c7('0x72')](_0x44a672));delete _0x44a672[_0x66c7('0x24')];if(_0x46b54f===0x191){_0x46b54f=0x190;}_0x31bc19[_0x66c7('0x18')](_0x46b54f)[_0x66c7('0x25')](_0x16d404[_0x66c7('0x2c')][_0x66c7('0x6e')]?{'message':_0x66c7('0x73'),'statusCode':_0x44a672[_0x66c7('0x6f')]}:_0x44a672);});}; \ No newline at end of file +var _0xd87e=['undefined','count','limit','set','Content-Range','reject','update','destroy','error','stack','name','index','ZendeskAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','include','findAll','then','rows','catch','show','params','includeAll','find','create','body','getConfigurations','findOne','order','pick','filter','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskConfiguration','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','headers','format','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','ticket_fields','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x29fefa,_0x3c9ba0){var _0x530b05=function(_0xc21842){while(--_0xc21842){_0x29fefa['push'](_0x29fefa['shift']());}};_0x530b05(++_0x3c9ba0);}(_0xd87e,0x1bf));var _0xed87=function(_0x4b634f,_0x4c0372){_0x4b634f=_0x4b634f-0x0;var _0x302e3c=_0xd87e[_0x4b634f];return _0x302e3c;};'use strict';var emlformat=require(_0xed87('0x0'));var rimraf=require(_0xed87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed87('0x2'));var rp=require(_0xed87('0x3'));var moment=require(_0xed87('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed87('0x5'));var util=require('util');var path=require(_0xed87('0x6'));var sox=require(_0xed87('0x7'));var csv=require('to-csv');var ejs=require(_0xed87('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xed87('0x9'));var crypto=require(_0xed87('0xa'));var jsforce=require(_0xed87('0xb'));var deskjs=require(_0xed87('0xc'));var toCsv=require('to-csv');var querystring=require(_0xed87('0xd'));var Papa=require(_0xed87('0xe'));var Redis=require(_0xed87('0xf'));var authService=require(_0xed87('0x10'));var qs=require(_0xed87('0x11'));var as=require(_0xed87('0x12'));var hardwareService=require(_0xed87('0x13'));var logger=require('../../config/logger')(_0xed87('0x14'));var utils=require(_0xed87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xed87('0x16'));var db=require(_0xed87('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4ffc2d,_0x466f35){_0x466f35=_0x466f35||0xcc;return function(_0x32276e){if(_0x32276e){return _0x4ffc2d[_0xed87('0x18')](_0x466f35);}return _0x4ffc2d[_0xed87('0x19')](_0x466f35)[_0xed87('0x1a')]();};}function respondWithResult(_0x3865c5,_0x52dfe8){_0x52dfe8=_0x52dfe8||0xc8;return function(_0x4494da){if(_0x4494da){return _0x3865c5[_0xed87('0x19')](_0x52dfe8)[_0xed87('0x1b')](_0x4494da);}};}function respondWithFilteredResult(_0x1e9a3d,_0x2f2fd3){return function(_0xd34e0e){if(_0xd34e0e){var _0x173413=typeof _0x2f2fd3[_0xed87('0x1c')]===_0xed87('0x1d')&&typeof _0x2f2fd3['limit']===_0xed87('0x1d');var _0x18ab7d=_0xd34e0e[_0xed87('0x1e')];var _0xfb8a44=_0x173413?0x0:_0x2f2fd3['offset'];var _0x211085=_0x173413?_0xd34e0e[_0xed87('0x1e')]:_0x2f2fd3[_0xed87('0x1c')]+_0x2f2fd3[_0xed87('0x1f')];var _0x98a2ca;if(_0x211085>=_0x18ab7d){_0x211085=_0x18ab7d;_0x98a2ca=0xc8;}else{_0x98a2ca=0xce;}_0x1e9a3d[_0xed87('0x19')](_0x98a2ca);return _0x1e9a3d[_0xed87('0x20')](_0xed87('0x21'),_0xfb8a44+'-'+_0x211085+'/'+_0x18ab7d)[_0xed87('0x1b')](_0xd34e0e);}return null;};}function patchUpdates(_0x52e81c){return function(_0x5a7329){try{jsonpatch['apply'](_0x5a7329,_0x52e81c,!![]);}catch(_0x47c121){return BPromise[_0xed87('0x22')](_0x47c121);}return _0x5a7329['save']();};}function saveUpdates(_0x4191a7,_0x2b0b98){return function(_0x5b1659){if(_0x5b1659){return _0x5b1659[_0xed87('0x23')](_0x4191a7)['then'](function(_0x3d1641){return _0x3d1641;});}return null;};}function removeEntity(_0x24962e,_0x27799a){return function(_0x2a8733){if(_0x2a8733){return _0x2a8733[_0xed87('0x24')]()['then'](function(){_0x24962e[_0xed87('0x19')](0xcc)[_0xed87('0x1a')]();});}};}function handleEntityNotFound(_0x41e0d4,_0x320bcc){return function(_0x31c600){if(!_0x31c600){_0x41e0d4[_0xed87('0x18')](0x194);}return _0x31c600;};}function handleError(_0x25a6f7,_0x4735b3){_0x4735b3=_0x4735b3||0x1f4;return function(_0x40b2fa){logger[_0xed87('0x25')](_0x40b2fa[_0xed87('0x26')]);if(_0x40b2fa[_0xed87('0x27')]){delete _0x40b2fa[_0xed87('0x27')];}_0x25a6f7[_0xed87('0x19')](_0x4735b3)['send'](_0x40b2fa);};}exports[_0xed87('0x28')]=function(_0x1c4a65,_0x4eaa44){var _0x3dff74={},_0x33c367={},_0x21c93b={'count':0x0,'rows':[]};var _0x4b259e=_['map'](db[_0xed87('0x29')][_0xed87('0x2a')],function(_0x21ab8a){return{'name':_0x21ab8a['fieldName'],'type':_0x21ab8a[_0xed87('0x2b')][_0xed87('0x2c')]};});_0x33c367[_0xed87('0x2d')]=_[_0xed87('0x2e')](_0x4b259e,_0xed87('0x27'));_0x33c367[_0xed87('0x2f')]=_[_0xed87('0x30')](_0x1c4a65[_0xed87('0x2f')]);_0x33c367[_0xed87('0x31')]=_['intersection'](_0x33c367[_0xed87('0x2d')],_0x33c367[_0xed87('0x2f')]);_0x3dff74['attributes']=_[_0xed87('0x32')](_0x33c367['model'],qs[_0xed87('0x33')](_0x1c4a65[_0xed87('0x2f')][_0xed87('0x33')]));_0x3dff74[_0xed87('0x34')]=_0x3dff74[_0xed87('0x34')][_0xed87('0x35')]?_0x3dff74[_0xed87('0x34')]:_0x33c367[_0xed87('0x2d')];if(!_0x1c4a65[_0xed87('0x2f')][_0xed87('0x36')](_0xed87('0x37'))){_0x3dff74['limit']=qs[_0xed87('0x1f')](_0x1c4a65[_0xed87('0x2f')]['limit']);_0x3dff74[_0xed87('0x1c')]=qs['offset'](_0x1c4a65[_0xed87('0x2f')][_0xed87('0x1c')]);}_0x3dff74['order']=qs[_0xed87('0x38')](_0x1c4a65[_0xed87('0x2f')][_0xed87('0x38')]);_0x3dff74[_0xed87('0x39')]=qs[_0xed87('0x31')](_['pick'](_0x1c4a65[_0xed87('0x2f')],_0x33c367['filters']),_0x4b259e);if(_0x1c4a65[_0xed87('0x2f')]['filter']){_0x3dff74[_0xed87('0x39')]=_[_0xed87('0x3a')](_0x3dff74[_0xed87('0x39')],{'$or':_[_0xed87('0x2e')](_0x4b259e,function(_0x319f69){if(_0x319f69[_0xed87('0x2b')]!==_0xed87('0x3b')){var _0x161491={};_0x161491[_0x319f69[_0xed87('0x27')]]={'$like':'%'+_0x1c4a65['query']['filter']+'%'};return _0x161491;}})});}_0x3dff74=_[_0xed87('0x3a')]({},_0x3dff74,_0x1c4a65[_0xed87('0x3c')]);var _0x1f16a8={'where':_0x3dff74[_0xed87('0x39')]};return db[_0xed87('0x29')][_0xed87('0x1e')](_0x1f16a8)['then'](function(_0x4398a0){_0x21c93b[_0xed87('0x1e')]=_0x4398a0;if(_0x1c4a65[_0xed87('0x2f')]['includeAll']){_0x3dff74[_0xed87('0x3d')]=[{'all':!![]}];}return db[_0xed87('0x29')][_0xed87('0x3e')](_0x3dff74);})[_0xed87('0x3f')](function(_0x1d1e99){_0x21c93b[_0xed87('0x40')]=_0x1d1e99;return _0x21c93b;})[_0xed87('0x3f')](respondWithFilteredResult(_0x4eaa44,_0x3dff74))[_0xed87('0x41')](handleError(_0x4eaa44,null));};exports[_0xed87('0x42')]=function(_0x406b73,_0x5c6925){var _0x7e6cbb={'raw':![],'where':{'id':_0x406b73[_0xed87('0x43')]['id']}},_0x3c7fcc={};_0x3c7fcc['model']=_['keys'](db[_0xed87('0x29')][_0xed87('0x2a')]);_0x3c7fcc[_0xed87('0x2f')]=_[_0xed87('0x30')](_0x406b73['query']);_0x3c7fcc[_0xed87('0x31')]=_[_0xed87('0x32')](_0x3c7fcc['model'],_0x3c7fcc[_0xed87('0x2f')]);_0x7e6cbb[_0xed87('0x34')]=_[_0xed87('0x32')](_0x3c7fcc[_0xed87('0x2d')],qs[_0xed87('0x33')](_0x406b73[_0xed87('0x2f')][_0xed87('0x33')]));_0x7e6cbb[_0xed87('0x34')]=_0x7e6cbb[_0xed87('0x34')][_0xed87('0x35')]?_0x7e6cbb[_0xed87('0x34')]:_0x3c7fcc['model'];if(_0x406b73[_0xed87('0x2f')][_0xed87('0x44')]){_0x7e6cbb[_0xed87('0x3d')]=[{'all':!![]}];}_0x7e6cbb=_[_0xed87('0x3a')]({},_0x7e6cbb,_0x406b73[_0xed87('0x3c')]);return db[_0xed87('0x29')][_0xed87('0x45')](_0x7e6cbb)[_0xed87('0x3f')](handleEntityNotFound(_0x5c6925,null))[_0xed87('0x3f')](respondWithResult(_0x5c6925,null))[_0xed87('0x41')](handleError(_0x5c6925,null));};exports[_0xed87('0x46')]=function(_0x26c8f4,_0x27ed22){return db[_0xed87('0x29')][_0xed87('0x46')](_0x26c8f4[_0xed87('0x47')],{})[_0xed87('0x3f')](respondWithResult(_0x27ed22,0xc9))['catch'](handleError(_0x27ed22,null));};exports[_0xed87('0x23')]=function(_0x1a68a7,_0x3a91c5){if(_0x1a68a7['body']['id']){delete _0x1a68a7[_0xed87('0x47')]['id'];}return db[_0xed87('0x29')]['find']({'where':{'id':_0x1a68a7[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x3a91c5,null))[_0xed87('0x3f')](saveUpdates(_0x1a68a7[_0xed87('0x47')],null))['then'](respondWithResult(_0x3a91c5,null))[_0xed87('0x41')](handleError(_0x3a91c5,null));};exports[_0xed87('0x24')]=function(_0x3ca34c,_0x272a07){return db[_0xed87('0x29')][_0xed87('0x45')]({'where':{'id':_0x3ca34c[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x272a07,null))[_0xed87('0x3f')](removeEntity(_0x272a07,null))[_0xed87('0x41')](handleError(_0x272a07,null));};exports[_0xed87('0x48')]=function(_0x18846f,_0x2e5a9f,_0x4df105){var _0x43ffa4={};var _0x4ea4e3={};var _0x17cad7;var _0x329973;return db[_0xed87('0x29')][_0xed87('0x49')]({'where':{'id':_0x18846f[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x2e5a9f,null))[_0xed87('0x3f')](function(_0xccdbb6){if(_0xccdbb6){_0x17cad7=_0xccdbb6;_0x4ea4e3[_0xed87('0x2d')]=_[_0xed87('0x30')](db['ZendeskConfiguration'][_0xed87('0x2a')]);_0x4ea4e3[_0xed87('0x2f')]=_[_0xed87('0x30')](_0x18846f[_0xed87('0x2f')]);_0x4ea4e3[_0xed87('0x31')]=_[_0xed87('0x32')](_0x4ea4e3[_0xed87('0x2d')],_0x4ea4e3[_0xed87('0x2f')]);_0x43ffa4[_0xed87('0x34')]=_[_0xed87('0x32')](_0x4ea4e3[_0xed87('0x2d')],qs['fields'](_0x18846f['query'][_0xed87('0x33')]));_0x43ffa4[_0xed87('0x34')]=_0x43ffa4[_0xed87('0x34')][_0xed87('0x35')]?_0x43ffa4[_0xed87('0x34')]:_0x4ea4e3['model'];_0x43ffa4[_0xed87('0x4a')]=qs[_0xed87('0x38')](_0x18846f[_0xed87('0x2f')][_0xed87('0x38')]);_0x43ffa4[_0xed87('0x39')]=qs[_0xed87('0x31')](_[_0xed87('0x4b')](_0x18846f[_0xed87('0x2f')],_0x4ea4e3[_0xed87('0x31')]));if(_0x18846f[_0xed87('0x2f')][_0xed87('0x4c')]){_0x43ffa4[_0xed87('0x39')]=_[_0xed87('0x3a')](_0x43ffa4[_0xed87('0x39')],{'$or':_['map'](_0x43ffa4[_0xed87('0x34')],function(_0x10a19c){var _0x2f03d4={};_0x2f03d4[_0x10a19c]={'$like':'%'+_0x18846f[_0xed87('0x2f')][_0xed87('0x4c')]+'%'};return _0x2f03d4;})});}_0x43ffa4=_[_0xed87('0x3a')]({},_0x43ffa4,_0x18846f[_0xed87('0x3c')]);return _0x17cad7[_0xed87('0x48')](_0x43ffa4);}})['then'](function(_0x4367c3){if(_0x4367c3){_0x329973=_0x4367c3[_0xed87('0x35')];if(!_0x18846f[_0xed87('0x2f')][_0xed87('0x36')](_0xed87('0x37'))){_0x43ffa4[_0xed87('0x1f')]=qs['limit'](_0x18846f['query'][_0xed87('0x1f')]);_0x43ffa4[_0xed87('0x1c')]=qs[_0xed87('0x1c')](_0x18846f[_0xed87('0x2f')][_0xed87('0x1c')]);}return _0x17cad7[_0xed87('0x48')](_0x43ffa4);}})[_0xed87('0x3f')](function(_0x3bdf7c){if(_0x3bdf7c){return _0x3bdf7c?{'count':_0x329973,'rows':_0x3bdf7c}:null;}})['then'](respondWithResult(_0x2e5a9f,null))[_0xed87('0x41')](handleError(_0x2e5a9f,null));};exports['addConfiguration']=function(_0xd3b300,_0x3c82de,_0x4e5055){if(_0xd3b300[_0xed87('0x47')]['id']){delete _0xd3b300[_0xed87('0x47')]['id'];}return db['ZendeskAccount'][_0xed87('0x49')]({'where':{'id':_0xd3b300[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x3c82de,null))[_0xed87('0x3f')](function(_0x112685){if(_0x112685){_0xd3b300['body'][_0xed87('0x4d')]=_0x112685['id'];_0xd3b300[_0xed87('0x47')][_0xed87('0x4e')]=integrations[_0xed87('0x4f')](_0xd3b300['body']['channel'],_0xd3b300[_0xed87('0x47')][_0xed87('0x2b')]);_0xd3b300['body'][_0xed87('0x50')]=integrations[_0xed87('0x51')](_0xd3b300[_0xed87('0x47')][_0xed87('0x52')],_0xd3b300[_0xed87('0x47')][_0xed87('0x2b')]);return db[_0xed87('0x53')][_0xed87('0x46')](_0xd3b300[_0xed87('0x47')],{'include':[{'model':db[_0xed87('0x54')],'as':_0xed87('0x4e')},{'model':db[_0xed87('0x54')],'as':_0xed87('0x50')}]});}return null;})[_0xed87('0x3f')](respondWithResult(_0x3c82de,null))['catch'](handleError(_0x3c82de,null));};exports[_0xed87('0x55')]=function(_0x2686cd,_0x566ace,_0x4f7b92){var _0x5136c9='';return db[_0xed87('0x29')][_0xed87('0x49')]({'where':{'id':_0x2686cd[_0xed87('0x43')]['id']},'attributes':['id',_0xed87('0x56'),_0xed87('0x57'),_0xed87('0x58'),_0xed87('0x59'),'remoteUri']})[_0xed87('0x3f')](handleEntityNotFound(_0x566ace,null))[_0xed87('0x3f')](function(_0x3b6a9b){if(_0x3b6a9b){_0x5136c9=_0x3b6a9b[_0xed87('0x5a')];var _0xc35cab=_0x5136c9[_0xed87('0x5b')](-0x1);if(_0xc35cab==='/'){_0x5136c9=_0x5136c9[_0xed87('0x5c')](0x0,_0x5136c9[_0xed87('0x5d')](_0xc35cab));}var _0x116198={'method':_0xed87('0x5e'),'uri':util['format']('%s/%s',_0x5136c9,'ticket_fields'),'json':!![]};switch(_0x3b6a9b[_0xed87('0x59')]){case _0xed87('0x57'):_0x116198[_0xed87('0x5f')]={'Authorization':util[_0xed87('0x60')](_0xed87('0x61'),new Buffer(util['format'](_0xed87('0x62'),_0x3b6a9b[_0xed87('0x56')],_0x3b6a9b[_0xed87('0x57')]))[_0xed87('0x63')](_0xed87('0x64')))};break;case _0xed87('0x58'):_0x116198['headers']={'Authorization':util['format'](_0xed87('0x61'),new Buffer(util[_0xed87('0x60')](_0xed87('0x65'),_0x3b6a9b[_0xed87('0x56')],_0x3b6a9b[_0xed87('0x58')]))[_0xed87('0x63')](_0xed87('0x64')))};break;default:throw new db[(_0xed87('0x66'))][(_0xed87('0x67'))](_0xed87('0x68'));}return rp(_0x116198);}})[_0xed87('0x3f')](function(_0x1a1f95){if(_0x1a1f95){var _0x52af5c=[_0xed87('0x69'),_0xed87('0x6a'),_0xed87('0x6b'),_0xed87('0x6c')];_[_0xed87('0x6d')](_0x1a1f95[_0xed87('0x6e')],function(_0x4ae84c){return _0x52af5c[_0xed87('0x6f')](_0x4ae84c[_0xed87('0x2b')]);});return{'count':_0x1a1f95[_0xed87('0x6e')][_0xed87('0x35')],'rows':_['map'](_0x1a1f95['ticket_fields'],function(_0x4bfca0){return{'id':_0x4bfca0['id'],'name':_0x4bfca0['position']>0x7?_0x4bfca0['title']:_0x4bfca0[_0xed87('0x2b')],'custom':_0x4bfca0[_0xed87('0x70')]>0x7?!![]:![],'options':_0x4bfca0[_0xed87('0x71')]?_0x4bfca0[_0xed87('0x71')]:_0x4bfca0[_0xed87('0x72')]?_0x4bfca0[_0xed87('0x72')]:[]};})};}})[_0xed87('0x3f')](respondWithResult(_0x566ace,null))[_0xed87('0x41')](function(_0x1b223b){var _0x510066=_0x2686cd['query'][_0xed87('0x73')]?0x1f4:_0x1b223b[_0xed87('0x74')]||0x1f4;logger[_0xed87('0x25')](_0xed87('0x75'),_0xed87('0x55'),_0x510066,JSON['stringify'](_0x1b223b));delete _0x1b223b['name'];if(_0x510066===0x191){_0x510066=0x190;}_0x566ace[_0xed87('0x19')](_0x510066)[_0xed87('0x76')](_0x2686cd['query'][_0xed87('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x1b223b[_0xed87('0x74')]}:_0x1b223b);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index aa04c7b..60d020b 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.model.js +++ b/server/api/intZendeskAccount/intZendeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ccb=['rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x50cd41,_0x4874a7){var _0x399475=function(_0x1946da){while(--_0x1946da){_0x50cd41['push'](_0x50cd41['shift']());}};_0x399475(++_0x4874a7);}(_0x1ccb,0x1d9));var _0xb1cc=function(_0xc7c0ee,_0x1a0e94){_0xc7c0ee=_0xc7c0ee-0x0;var _0x2c9209=_0x1ccb[_0xc7c0ee];return _0x2c9209;};'use strict';var _=require(_0xb1cc('0x0'));var util=require(_0xb1cc('0x1'));var logger=require(_0xb1cc('0x2'))('api');var moment=require(_0xb1cc('0x3'));var BPromise=require(_0xb1cc('0x4'));var rp=require(_0xb1cc('0x5'));var fs=require('fs');var path=require(_0xb1cc('0x6'));var rimraf=require(_0xb1cc('0x7'));var config=require(_0xb1cc('0x8'));var attributes=require(_0xb1cc('0x9'));var integrations=require(_0xb1cc('0xa'));module[_0xb1cc('0xb')]=function(_0x425aff,_0x2ac6dc){return _0x425aff[_0xb1cc('0xc')](_0xb1cc('0xd'),attributes,{'tableName':_0xb1cc('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe131=['../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x17468b,_0x4e5cce){var _0x4d0e42=function(_0x5f24c3){while(--_0x5f24c3){_0x17468b['push'](_0x17468b['shift']());}};_0x4d0e42(++_0x4e5cce);}(_0xe131,0xbc));var _0x1e13=function(_0x5387a3,_0x28ea66){_0x5387a3=_0x5387a3-0x0;var _0x3eb246=_0xe131[_0x5387a3];return _0x3eb246;};'use strict';var _=require(_0x1e13('0x0'));var util=require(_0x1e13('0x1'));var logger=require('../../config/logger')(_0x1e13('0x2'));var moment=require(_0x1e13('0x3'));var BPromise=require('bluebird');var rp=require(_0x1e13('0x4'));var fs=require('fs');var path=require(_0x1e13('0x5'));var rimraf=require(_0x1e13('0x6'));var config=require(_0x1e13('0x7'));var attributes=require(_0x1e13('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x1e13('0x9')]=function(_0xbc8055,_0x3cc33e){return _0xbc8055[_0x1e13('0xa')](_0x1e13('0xb'),attributes,{'tableName':_0x1e13('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 9bfefad..6a2af4b 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.rpc.js +++ b/server/api/intZendeskAccount/intZendeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ce3=['client','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZendeskAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0xf4e030,_0x131199){var _0x30f392=function(_0x584802){while(--_0x584802){_0xf4e030['push'](_0xf4e030['shift']());}};_0x30f392(++_0x131199);}(_0x2ce3,0x87));var _0x32ce=function(_0x117a44,_0xc457e1){_0x117a44=_0x117a44-0x0;var _0x4dacc4=_0x2ce3[_0x117a44];return _0x4dacc4;};'use strict';var _=require(_0x32ce('0x0'));var util=require('util');var moment=require(_0x32ce('0x1'));var BPromise=require(_0x32ce('0x2'));var rs=require(_0x32ce('0x3'));var fs=require('fs');var Redis=require(_0x32ce('0x4'));var db=require(_0x32ce('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x32ce('0x6'))(_0x32ce('0x7'));var config=require('../../config/environment');var jayson=require(_0x32ce('0x8'));var client=jayson[_0x32ce('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2da1c8,_0x448fb8,_0xf768fb){return new BPromise(function(_0x46acd0,_0x1214a6){return client[_0x32ce('0xa')](_0x2da1c8,_0xf768fb)[_0x32ce('0xb')](function(_0x2b9f67){logger[_0x32ce('0xc')](_0x32ce('0xd'),_0x448fb8,_0x32ce('0xe'));logger[_0x32ce('0xf')](_0x32ce('0x10'),_0x448fb8,_0x32ce('0xe'),JSON[_0x32ce('0x11')](_0x2b9f67));if(_0x2b9f67[_0x32ce('0x12')]){if(_0x2b9f67[_0x32ce('0x12')][_0x32ce('0x13')]===0x1f4){logger['error'](_0x32ce('0xd'),_0x448fb8,_0x2b9f67[_0x32ce('0x12')][_0x32ce('0x14')]);return _0x1214a6(_0x2b9f67[_0x32ce('0x12')][_0x32ce('0x14')]);}logger['error'](_0x32ce('0xd'),_0x448fb8,_0x2b9f67[_0x32ce('0x12')]['message']);return _0x46acd0(_0x2b9f67[_0x32ce('0x12')][_0x32ce('0x14')]);}else{logger['info'](_0x32ce('0xd'),_0x448fb8,_0x32ce('0xe'));_0x46acd0(_0x2b9f67[_0x32ce('0x15')]['message']);}})[_0x32ce('0x16')](function(_0x1b28f6){logger[_0x32ce('0x12')](_0x32ce('0xd'),_0x448fb8,_0x1b28f6);_0x1214a6(_0x1b28f6);});});}exports[_0x32ce('0x17')]=function(_0x54d966){var _0x3e01e8=this;return new Promise(function(_0x21406c,_0x3813e9){return db[_0x32ce('0x18')][_0x32ce('0x19')]({'raw':_0x54d966[_0x32ce('0x1a')]?_0x54d966[_0x32ce('0x1a')][_0x32ce('0x1b')]===undefined?!![]:![]:!![],'where':_0x54d966[_0x32ce('0x1a')]?_0x54d966['options'][_0x32ce('0x1c')]||null:null,'attributes':_0x54d966[_0x32ce('0x1a')]?_0x54d966[_0x32ce('0x1a')][_0x32ce('0x1d')]||null:null,'limit':_0x54d966[_0x32ce('0x1a')]?_0x54d966[_0x32ce('0x1a')][_0x32ce('0x1e')]||null:null,'include':_0x54d966[_0x32ce('0x1a')]?_0x54d966[_0x32ce('0x1a')][_0x32ce('0x1f')]?_['map'](_0x54d966[_0x32ce('0x1a')][_0x32ce('0x1f')],function(_0x1c269d){return{'model':db[_0x1c269d['model']],'as':_0x1c269d['as'],'attributes':_0x1c269d[_0x32ce('0x1d')],'include':_0x1c269d[_0x32ce('0x1f')]?_[_0x32ce('0x20')](_0x1c269d[_0x32ce('0x1f')],function(_0x1a8d23){return{'model':db[_0x1a8d23[_0x32ce('0x21')]],'as':_0x1a8d23['as'],'attributes':_0x1a8d23[_0x32ce('0x1d')],'include':_0x1a8d23[_0x32ce('0x1f')]?_[_0x32ce('0x20')](_0x1a8d23[_0x32ce('0x1f')],function(_0x5d275){return{'model':db[_0x5d275[_0x32ce('0x21')]],'as':_0x5d275['as'],'attributes':_0x5d275[_0x32ce('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ea0c2){logger[_0x32ce('0xc')](_0x32ce('0x17'),_0x54d966);logger[_0x32ce('0xf')](_0x32ce('0x17'),_0x54d966,JSON[_0x32ce('0x11')](_0x4ea0c2));_0x21406c(_0x4ea0c2);})['catch'](function(_0x45c742){logger[_0x32ce('0x12')](_0x32ce('0x17'),_0x45c742[_0x32ce('0x14')],_0x54d966);_0x3813e9(_0x3e01e8[_0x32ce('0x12')](0x1f4,_0x45c742[_0x32ce('0x14')]));});});};exports[_0x32ce('0x22')]=function(_0x287961){var _0x5d71dd=this;return new Promise(function(_0x53d16b,_0x1f0af5){return db[_0x32ce('0x18')][_0x32ce('0x23')]({'raw':_0x287961[_0x32ce('0x1a')]?_0x287961[_0x32ce('0x1a')][_0x32ce('0x1b')]===undefined?!![]:![]:!![],'where':_0x287961[_0x32ce('0x1a')]?_0x287961[_0x32ce('0x1a')][_0x32ce('0x1c')]||null:null,'attributes':_0x287961[_0x32ce('0x1a')]?_0x287961['options'][_0x32ce('0x1d')]||null:null,'include':_0x287961[_0x32ce('0x1a')]?_0x287961[_0x32ce('0x1a')][_0x32ce('0x1f')]?_['map'](_0x287961[_0x32ce('0x1a')][_0x32ce('0x1f')],function(_0x8e62c){return{'model':db[_0x8e62c['model']],'as':_0x8e62c['as'],'attributes':_0x8e62c[_0x32ce('0x1d')],'include':_0x8e62c[_0x32ce('0x1f')]?_['map'](_0x8e62c[_0x32ce('0x1f')],function(_0x22a6ef){return{'model':db[_0x22a6ef[_0x32ce('0x21')]],'as':_0x22a6ef['as'],'attributes':_0x22a6ef[_0x32ce('0x1d')],'include':_0x22a6ef[_0x32ce('0x1f')]?_['map'](_0x22a6ef['include'],function(_0xcc1c0a){return{'model':db[_0xcc1c0a[_0x32ce('0x21')]],'as':_0xcc1c0a['as'],'attributes':_0xcc1c0a[_0x32ce('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x32ce('0xb')](function(_0x339366){logger[_0x32ce('0xc')](_0x32ce('0x22'),_0x287961);logger[_0x32ce('0xf')](_0x32ce('0x22'),_0x287961,JSON[_0x32ce('0x11')](_0x339366));_0x53d16b(_0x339366);})['catch'](function(_0x2448df){logger[_0x32ce('0x12')]('ShowZendeskAccount',_0x2448df[_0x32ce('0x14')],_0x287961);_0x1f0af5(_0x5d71dd[_0x32ce('0x12')](0x1f4,_0x2448df[_0x32ce('0x14')]));});});}; \ No newline at end of file +var _0xa477=['message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','find','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','info','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ZendeskAccount,\x20%s,\x20%s'];(function(_0x264f21,_0x5e815a){var _0x78896c=function(_0x4f6e88){while(--_0x4f6e88){_0x264f21['push'](_0x264f21['shift']());}};_0x78896c(++_0x5e815a);}(_0xa477,0x9c));var _0x7a47=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xa477[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x7a47('0x0'));var util=require(_0x7a47('0x1'));var moment=require(_0x7a47('0x2'));var BPromise=require(_0x7a47('0x3'));var rs=require(_0x7a47('0x4'));var fs=require('fs');var Redis=require(_0x7a47('0x5'));var db=require(_0x7a47('0x6'))['db'];var utils=require(_0x7a47('0x7'));var logger=require('../../config/logger')(_0x7a47('0x8'));var config=require('../../config/environment');var jayson=require(_0x7a47('0x9'));var client=jayson[_0x7a47('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fe0a1,_0xe75d1a,_0x5728e5){return new BPromise(function(_0x1940d8,_0x242f63){return client[_0x7a47('0xb')](_0x2fe0a1,_0x5728e5)['then'](function(_0x5b24b4){logger[_0x7a47('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0xe75d1a,'request\x20sent');logger[_0x7a47('0xd')](_0x7a47('0xe'),_0xe75d1a,_0x7a47('0xf'),JSON[_0x7a47('0x10')](_0x5b24b4));if(_0x5b24b4[_0x7a47('0x11')]){if(_0x5b24b4['error']['code']===0x1f4){logger[_0x7a47('0x11')](_0x7a47('0x12'),_0xe75d1a,_0x5b24b4['error']['message']);return _0x242f63(_0x5b24b4['error'][_0x7a47('0x13')]);}logger[_0x7a47('0x11')](_0x7a47('0x12'),_0xe75d1a,_0x5b24b4[_0x7a47('0x11')][_0x7a47('0x13')]);return _0x1940d8(_0x5b24b4[_0x7a47('0x11')]['message']);}else{logger[_0x7a47('0xc')](_0x7a47('0x12'),_0xe75d1a,'request\x20sent');_0x1940d8(_0x5b24b4['result'][_0x7a47('0x13')]);}})[_0x7a47('0x14')](function(_0x3d9671){logger[_0x7a47('0x11')](_0x7a47('0x12'),_0xe75d1a,_0x3d9671);_0x242f63(_0x3d9671);});});}exports[_0x7a47('0x15')]=function(_0x1b9b84){var _0x2c1336=this;return new Promise(function(_0x51880e,_0x315a36){return db[_0x7a47('0x16')][_0x7a47('0x17')]({'raw':_0x1b9b84[_0x7a47('0x18')]?_0x1b9b84[_0x7a47('0x18')][_0x7a47('0x19')]===undefined?!![]:![]:!![],'where':_0x1b9b84[_0x7a47('0x18')]?_0x1b9b84['options'][_0x7a47('0x1a')]||null:null,'attributes':_0x1b9b84[_0x7a47('0x18')]?_0x1b9b84[_0x7a47('0x18')][_0x7a47('0x1b')]||null:null,'limit':_0x1b9b84['options']?_0x1b9b84[_0x7a47('0x18')][_0x7a47('0x1c')]||null:null,'include':_0x1b9b84[_0x7a47('0x18')]?_0x1b9b84[_0x7a47('0x18')][_0x7a47('0x1d')]?_[_0x7a47('0x1e')](_0x1b9b84[_0x7a47('0x18')][_0x7a47('0x1d')],function(_0x4ac746){return{'model':db[_0x4ac746[_0x7a47('0x1f')]],'as':_0x4ac746['as'],'attributes':_0x4ac746[_0x7a47('0x1b')],'include':_0x4ac746[_0x7a47('0x1d')]?_['map'](_0x4ac746[_0x7a47('0x1d')],function(_0x53f777){return{'model':db[_0x53f777[_0x7a47('0x1f')]],'as':_0x53f777['as'],'attributes':_0x53f777['attributes'],'include':_0x53f777[_0x7a47('0x1d')]?_[_0x7a47('0x1e')](_0x53f777[_0x7a47('0x1d')],function(_0x5bc11a){return{'model':db[_0x5bc11a['model']],'as':_0x5bc11a['as'],'attributes':_0x5bc11a[_0x7a47('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7a47('0x20')](function(_0x272499){logger[_0x7a47('0xc')](_0x7a47('0x15'),_0x1b9b84);logger[_0x7a47('0xd')](_0x7a47('0x15'),_0x1b9b84,JSON['stringify'](_0x272499));_0x51880e(_0x272499);})['catch'](function(_0x57480e){logger['error'](_0x7a47('0x15'),_0x57480e[_0x7a47('0x13')],_0x1b9b84);_0x315a36(_0x2c1336[_0x7a47('0x11')](0x1f4,_0x57480e[_0x7a47('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x4d9091){var _0x543351=this;return new Promise(function(_0x3fff9f,_0x2a68a0){return db[_0x7a47('0x16')][_0x7a47('0x21')]({'raw':_0x4d9091[_0x7a47('0x18')]?_0x4d9091[_0x7a47('0x18')][_0x7a47('0x19')]===undefined?!![]:![]:!![],'where':_0x4d9091[_0x7a47('0x18')]?_0x4d9091['options'][_0x7a47('0x1a')]||null:null,'attributes':_0x4d9091[_0x7a47('0x18')]?_0x4d9091[_0x7a47('0x18')][_0x7a47('0x1b')]||null:null,'include':_0x4d9091[_0x7a47('0x18')]?_0x4d9091['options'][_0x7a47('0x1d')]?_[_0x7a47('0x1e')](_0x4d9091['options'][_0x7a47('0x1d')],function(_0x3b0cc5){return{'model':db[_0x3b0cc5[_0x7a47('0x1f')]],'as':_0x3b0cc5['as'],'attributes':_0x3b0cc5[_0x7a47('0x1b')],'include':_0x3b0cc5['include']?_[_0x7a47('0x1e')](_0x3b0cc5[_0x7a47('0x1d')],function(_0x564f4f){return{'model':db[_0x564f4f[_0x7a47('0x1f')]],'as':_0x564f4f['as'],'attributes':_0x564f4f['attributes'],'include':_0x564f4f[_0x7a47('0x1d')]?_[_0x7a47('0x1e')](_0x564f4f[_0x7a47('0x1d')],function(_0x42e357){return{'model':db[_0x42e357['model']],'as':_0x42e357['as'],'attributes':_0x42e357['attributes']};}):[]};}):[]};}):[]:[]})[_0x7a47('0x20')](function(_0x3a9462){logger[_0x7a47('0xc')](_0x7a47('0x22'),_0x4d9091);logger[_0x7a47('0xd')](_0x7a47('0x22'),_0x4d9091,JSON[_0x7a47('0x10')](_0x3a9462));_0x3fff9f(_0x3a9462);})[_0x7a47('0x14')](function(_0x304dd2){logger['error'](_0x7a47('0x22'),_0x304dd2[_0x7a47('0x13')],_0x4d9091);_0x2a68a0(_0x543351[_0x7a47('0x11')](0x1f4,_0x304dd2[_0x7a47('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 41d3609..bc3e28d 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91a7=['util','path','connect-timeout','Router','../../components/auth/service','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','put','update','destroy','exports'];(function(_0x4ea850,_0x2ce4d4){var _0x49a903=function(_0x5ab5c4){while(--_0x5ab5c4){_0x4ea850['push'](_0x4ea850['shift']());}};_0x49a903(++_0x2ce4d4);}(_0x91a7,0xe7));var _0x791a=function(_0xd24275,_0x537b5f){_0xd24275=_0xd24275-0x0;var _0x4735bb=_0x91a7[_0xd24275];return _0x4735bb;};'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['show']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0x6')]('/:id/subjects',auth[_0x791a('0x9')](),controller[_0x791a('0xc')]);router['get'](_0x791a('0xd'),auth[_0x791a('0x9')](),controller[_0x791a('0xe')]);router[_0x791a('0x6')](_0x791a('0xf'),auth[_0x791a('0x9')](),controller['getTags']);router['post']('/',auth[_0x791a('0x9')](),controller[_0x791a('0x10')]);router['post'](_0x791a('0xf'),auth[_0x791a('0x9')](),controller['setTags']);router[_0x791a('0x11')](_0x791a('0x8'),auth[_0x791a('0x9')](),controller[_0x791a('0x12')]);router['delete'](_0x791a('0x8'),auth['isAuthenticated'](),controller[_0x791a('0x13')]);module[_0x791a('0x14')]=router; \ No newline at end of file +var _0x0bb5=['put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags'];(function(_0x5cf4a8,_0x4d4066){var _0x47374d=function(_0x5ce9ee){while(--_0x5ce9ee){_0x5cf4a8['push'](_0x5cf4a8['shift']());}};_0x47374d(++_0x4d4066);}(_0x0bb5,0x148));var _0x50bb=function(_0x1d6e62,_0x56c5cf){_0x1d6e62=_0x1d6e62-0x0;var _0x130000=_0x0bb5[_0x1d6e62];return _0x130000;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id/fields',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0x9')](_0x50bb('0xe'),auth['isAuthenticated'](),controller[_0x50bb('0xf')]);router[_0x50bb('0x9')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x9')](_0x50bb('0x12'),auth['isAuthenticated'](),controller[_0x50bb('0x13')]);router['post']('/',auth[_0x50bb('0xb')](),controller[_0x50bb('0x14')]);router[_0x50bb('0x15')]('/:id/tags',auth[_0x50bb('0xb')](),controller[_0x50bb('0x16')]);router[_0x50bb('0x17')]('/:id',auth[_0x50bb('0xb')](),controller['update']);router[_0x50bb('0x18')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x19')]);module[_0x50bb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 733fd8d..3190578 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe0a4=['exports','STRING'];(function(_0x34a161,_0x52a77b){var _0x4412a1=function(_0x32e665){while(--_0x32e665){_0x34a161['push'](_0x34a161['shift']());}};_0x4412a1(++_0x52a77b);}(_0xe0a4,0x16e));var _0x4e0a=function(_0x4be073,_0x1cadcf){_0x4be073=_0x4be073-0x0;var _0x270989=_0xe0a4[_0x4be073];return _0x270989;};'use strict';var Sequelize=require('sequelize');module[_0x4e0a('0x0')]={'name':{'type':Sequelize[_0x4e0a('0x1')]},'description':{'type':Sequelize[_0x4e0a('0x1')]}}; \ No newline at end of file +var _0xa237=['sequelize','exports'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xa237,0xc8));var _0x7a23=function(_0x347fce,_0x5c5c59){_0x347fce=_0x347fce-0x0;var _0x191ed3=_0xa237[_0x347fce];return _0x191ed3;};'use strict';var Sequelize=require(_0x7a23('0x0'));module[_0x7a23('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 5c82690..49f9d66 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18c7=['pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','ZendeskField','hasOwnProperty','getSubjects','order','getDescriptions','getTags','findOne','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','ZendeskConfiguration','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where'];(function(_0x589c5d,_0x3b6d37){var _0x1f2c6d=function(_0x1d2d24){while(--_0x1d2d24){_0x589c5d['push'](_0x589c5d['shift']());}};_0x1f2c6d(++_0x3b6d37);}(_0x18c7,0x116));var _0x718c=function(_0x5d79a5,_0x23262b){_0x5d79a5=_0x5d79a5-0x0;var _0x3c7ec6=_0x18c7[_0x5d79a5];return _0x3c7ec6;};'use strict';var emlformat=require(_0x718c('0x0'));var rimraf=require(_0x718c('0x1'));var zipdir=require(_0x718c('0x2'));var jsonpatch=require(_0x718c('0x3'));var rp=require(_0x718c('0x4'));var moment=require(_0x718c('0x5'));var BPromise=require(_0x718c('0x6'));var Mustache=require(_0x718c('0x7'));var util=require(_0x718c('0x8'));var path=require('path');var sox=require(_0x718c('0x9'));var csv=require(_0x718c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x718c('0xb'));var squel=require('squel');var crypto=require(_0x718c('0xc'));var jsforce=require(_0x718c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x718c('0xe'));var Papa=require(_0x718c('0xf'));var Redis=require(_0x718c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x718c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x718c('0x12'));var logger=require(_0x718c('0x13'))(_0x718c('0x14'));var utils=require(_0x718c('0x15'));var config=require(_0x718c('0x16'));var licenseUtil=require(_0x718c('0x17'));var db=require(_0x718c('0x18'))['db'];function respondWithStatusCode(_0x41f0a9,_0x354b3e){_0x354b3e=_0x354b3e||0xcc;return function(_0x673a7a){if(_0x673a7a){return _0x41f0a9[_0x718c('0x19')](_0x354b3e);}return _0x41f0a9[_0x718c('0x1a')](_0x354b3e)['end']();};}function respondWithResult(_0x52d955,_0x15030f){_0x15030f=_0x15030f||0xc8;return function(_0x2b1958){if(_0x2b1958){return _0x52d955[_0x718c('0x1a')](_0x15030f)['json'](_0x2b1958);}};}function respondWithFilteredResult(_0x138c9f,_0x7a5368){return function(_0x257dd1){if(_0x257dd1){var _0x4e42e9=typeof _0x7a5368[_0x718c('0x1b')]===_0x718c('0x1c')&&typeof _0x7a5368['limit']===_0x718c('0x1c');var _0x5dff61=_0x257dd1[_0x718c('0x1d')];var _0x17173f=_0x4e42e9?0x0:_0x7a5368['offset'];var _0x24ceb6=_0x4e42e9?_0x257dd1['count']:_0x7a5368[_0x718c('0x1b')]+_0x7a5368[_0x718c('0x1e')];var _0x362db1;if(_0x24ceb6>=_0x5dff61){_0x24ceb6=_0x5dff61;_0x362db1=0xc8;}else{_0x362db1=0xce;}_0x138c9f['status'](_0x362db1);return _0x138c9f[_0x718c('0x1f')](_0x718c('0x20'),_0x17173f+'-'+_0x24ceb6+'/'+_0x5dff61)[_0x718c('0x21')](_0x257dd1);}return null;};}function patchUpdates(_0x206771){return function(_0x1dda66){try{jsonpatch[_0x718c('0x22')](_0x1dda66,_0x206771,!![]);}catch(_0x4afe98){return BPromise['reject'](_0x4afe98);}return _0x1dda66[_0x718c('0x23')]();};}function saveUpdates(_0x2bc86c,_0x503c14){return function(_0x3647ad){if(_0x3647ad){return _0x3647ad[_0x718c('0x24')](_0x2bc86c)[_0x718c('0x25')](function(_0x20102c){return _0x20102c;});}return null;};}function removeEntity(_0x43f74a,_0x167822){return function(_0xc6d976){if(_0xc6d976){return _0xc6d976[_0x718c('0x26')]()[_0x718c('0x25')](function(){_0x43f74a[_0x718c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15437e,_0x781d40){return function(_0x23f6a1){if(!_0x23f6a1){_0x15437e[_0x718c('0x19')](0x194);}return _0x23f6a1;};}function handleError(_0x94b314,_0x708381){_0x708381=_0x708381||0x1f4;return function(_0x51179c){logger['error'](_0x51179c[_0x718c('0x27')]);if(_0x51179c['name']){delete _0x51179c[_0x718c('0x28')];}_0x94b314['status'](_0x708381)[_0x718c('0x29')](_0x51179c);};}exports[_0x718c('0x2a')]=function(_0x11c725,_0x440016){var _0x3077ec={},_0x5e0304={},_0x2d8e68={'count':0x0,'rows':[]};var _0x458929=_['map'](db[_0x718c('0x2b')][_0x718c('0x2c')],function(_0x2674da){return{'name':_0x2674da[_0x718c('0x2d')],'type':_0x2674da['type']['key']};});_0x5e0304[_0x718c('0x2e')]=_[_0x718c('0x2f')](_0x458929,_0x718c('0x28'));_0x5e0304[_0x718c('0x30')]=_[_0x718c('0x31')](_0x11c725[_0x718c('0x30')]);_0x5e0304[_0x718c('0x32')]=_[_0x718c('0x33')](_0x5e0304[_0x718c('0x2e')],_0x5e0304[_0x718c('0x30')]);_0x3077ec[_0x718c('0x34')]=_['intersection'](_0x5e0304[_0x718c('0x2e')],qs[_0x718c('0x35')](_0x11c725['query'][_0x718c('0x35')]));_0x3077ec[_0x718c('0x34')]=_0x3077ec['attributes'][_0x718c('0x36')]?_0x3077ec[_0x718c('0x34')]:_0x5e0304[_0x718c('0x2e')];if(!_0x11c725[_0x718c('0x30')]['hasOwnProperty'](_0x718c('0x37'))){_0x3077ec[_0x718c('0x1e')]=qs[_0x718c('0x1e')](_0x11c725[_0x718c('0x30')]['limit']);_0x3077ec[_0x718c('0x1b')]=qs[_0x718c('0x1b')](_0x11c725[_0x718c('0x30')][_0x718c('0x1b')]);}_0x3077ec['order']=qs[_0x718c('0x38')](_0x11c725[_0x718c('0x30')][_0x718c('0x38')]);_0x3077ec[_0x718c('0x39')]=qs[_0x718c('0x32')](_[_0x718c('0x3a')](_0x11c725['query'],_0x5e0304[_0x718c('0x32')]),_0x458929);if(_0x11c725['query'][_0x718c('0x3b')]){_0x3077ec['where']=_['merge'](_0x3077ec[_0x718c('0x39')],{'$or':_['map'](_0x458929,function(_0x4f01f8){if(_0x4f01f8[_0x718c('0x3c')]!=='VIRTUAL'){var _0x47d400={};_0x47d400[_0x4f01f8[_0x718c('0x28')]]={'$like':'%'+_0x11c725[_0x718c('0x30')][_0x718c('0x3b')]+'%'};return _0x47d400;}})});}_0x3077ec=_[_0x718c('0x3d')]({},_0x3077ec,_0x11c725[_0x718c('0x3e')]);var _0x508bdf={'where':_0x3077ec['where']};return db['ZendeskConfiguration']['count'](_0x508bdf)[_0x718c('0x25')](function(_0xcd99ba){_0x2d8e68[_0x718c('0x1d')]=_0xcd99ba;if(_0x11c725[_0x718c('0x30')][_0x718c('0x3f')]){_0x3077ec[_0x718c('0x40')]=[{'all':!![]}];}return db[_0x718c('0x2b')][_0x718c('0x41')](_0x3077ec);})[_0x718c('0x25')](function(_0x2131d8){_0x2d8e68[_0x718c('0x42')]=_0x2131d8;return _0x2d8e68;})[_0x718c('0x25')](respondWithFilteredResult(_0x440016,_0x3077ec))[_0x718c('0x43')](handleError(_0x440016,null));};exports[_0x718c('0x44')]=function(_0x13c6b6,_0xe7c5c9){var _0x278418={'raw':![],'where':{'id':_0x13c6b6[_0x718c('0x45')]['id']}},_0xc3d43={};_0xc3d43[_0x718c('0x2e')]=_[_0x718c('0x31')](db['ZendeskConfiguration'][_0x718c('0x2c')]);_0xc3d43['query']=_[_0x718c('0x31')](_0x13c6b6['query']);_0xc3d43[_0x718c('0x32')]=_[_0x718c('0x33')](_0xc3d43[_0x718c('0x2e')],_0xc3d43[_0x718c('0x30')]);_0x278418[_0x718c('0x34')]=_[_0x718c('0x33')](_0xc3d43['model'],qs[_0x718c('0x35')](_0x13c6b6[_0x718c('0x30')][_0x718c('0x35')]));_0x278418[_0x718c('0x34')]=_0x278418['attributes'][_0x718c('0x36')]?_0x278418[_0x718c('0x34')]:_0xc3d43['model'];if(_0x13c6b6['query'][_0x718c('0x3f')]){_0x278418[_0x718c('0x40')]=[{'all':!![]}];}_0x278418=_['merge']({},_0x278418,_0x13c6b6[_0x718c('0x3e')]);return db['ZendeskConfiguration'][_0x718c('0x46')](_0x278418)['then'](handleEntityNotFound(_0xe7c5c9,null))[_0x718c('0x25')](respondWithResult(_0xe7c5c9,null))[_0x718c('0x43')](handleError(_0xe7c5c9,null));};exports['create']=function(_0x1b1dc9,_0x28c043){return db['ZendeskConfiguration'][_0x718c('0x47')](_0x1b1dc9[_0x718c('0x48')],{})[_0x718c('0x25')](respondWithResult(_0x28c043,0xc9))['catch'](handleError(_0x28c043,null));};exports['update']=function(_0x4ecf9e,_0x3e9a5c){if(_0x4ecf9e[_0x718c('0x48')]['id']){delete _0x4ecf9e['body']['id'];}return db[_0x718c('0x2b')][_0x718c('0x46')]({'where':{'id':_0x4ecf9e['params']['id']}})[_0x718c('0x25')](handleEntityNotFound(_0x3e9a5c,null))[_0x718c('0x25')](saveUpdates(_0x4ecf9e['body'],null))[_0x718c('0x25')](respondWithResult(_0x3e9a5c,null))[_0x718c('0x43')](handleError(_0x3e9a5c,null));};exports['destroy']=function(_0x2eb2e3,_0x3e1edd){return db[_0x718c('0x2b')][_0x718c('0x46')]({'where':{'id':_0x2eb2e3[_0x718c('0x45')]['id']}})[_0x718c('0x25')](handleEntityNotFound(_0x3e1edd,null))[_0x718c('0x25')](removeEntity(_0x3e1edd,null))[_0x718c('0x43')](handleError(_0x3e1edd,null));};exports[_0x718c('0x49')]=function(_0x182277,_0x5804db,_0x216ae0){var _0x302cf1={};var _0x26d77e={};var _0x5ceb31;var _0x24050e;return db[_0x718c('0x2b')]['findOne']({'where':{'id':_0x182277[_0x718c('0x45')]['id']}})['then'](handleEntityNotFound(_0x5804db,null))[_0x718c('0x25')](function(_0xa769f6){if(_0xa769f6){_0x5ceb31=_0xa769f6;_0x26d77e[_0x718c('0x2e')]=_['keys'](db[_0x718c('0x4a')][_0x718c('0x2c')]);_0x26d77e[_0x718c('0x30')]=_[_0x718c('0x31')](_0x182277['query']);_0x26d77e[_0x718c('0x32')]=_[_0x718c('0x33')](_0x26d77e[_0x718c('0x2e')],_0x26d77e[_0x718c('0x30')]);_0x302cf1[_0x718c('0x34')]=_[_0x718c('0x33')](_0x26d77e[_0x718c('0x2e')],qs[_0x718c('0x35')](_0x182277[_0x718c('0x30')][_0x718c('0x35')]));_0x302cf1['attributes']=_0x302cf1[_0x718c('0x34')][_0x718c('0x36')]?_0x302cf1[_0x718c('0x34')]:_0x26d77e[_0x718c('0x2e')];_0x302cf1['order']=qs['sort'](_0x182277[_0x718c('0x30')]['sort']);_0x302cf1[_0x718c('0x39')]=qs['filters'](_[_0x718c('0x3a')](_0x182277['query'],_0x26d77e[_0x718c('0x32')]));if(_0x182277[_0x718c('0x30')][_0x718c('0x3b')]){_0x302cf1[_0x718c('0x39')]=_[_0x718c('0x3d')](_0x302cf1[_0x718c('0x39')],{'$or':_[_0x718c('0x2f')](_0x302cf1[_0x718c('0x34')],function(_0x37aeff){var _0x3a4c86={};_0x3a4c86[_0x37aeff]={'$like':'%'+_0x182277[_0x718c('0x30')][_0x718c('0x3b')]+'%'};return _0x3a4c86;})});}_0x302cf1=_[_0x718c('0x3d')]({},_0x302cf1,_0x182277[_0x718c('0x3e')]);return _0x5ceb31[_0x718c('0x49')](_0x302cf1);}})[_0x718c('0x25')](function(_0x4faead){if(_0x4faead){_0x24050e=_0x4faead[_0x718c('0x36')];if(!_0x182277['query'][_0x718c('0x4b')](_0x718c('0x37'))){_0x302cf1[_0x718c('0x1e')]=qs[_0x718c('0x1e')](_0x182277[_0x718c('0x30')][_0x718c('0x1e')]);_0x302cf1[_0x718c('0x1b')]=qs[_0x718c('0x1b')](_0x182277[_0x718c('0x30')]['offset']);}return _0x5ceb31[_0x718c('0x49')](_0x302cf1);}})[_0x718c('0x25')](function(_0x4f3640){if(_0x4f3640){return _0x4f3640?{'count':_0x24050e,'rows':_0x4f3640}:null;}})[_0x718c('0x25')](respondWithResult(_0x5804db,null))[_0x718c('0x43')](handleError(_0x5804db,null));};exports[_0x718c('0x4c')]=function(_0x258d27,_0x50487b,_0x1547a5){var _0x4a3232={};var _0x55647c={};var _0x318f9e;var _0x4a93b7;return db[_0x718c('0x2b')]['findOne']({'where':{'id':_0x258d27[_0x718c('0x45')]['id']}})['then'](handleEntityNotFound(_0x50487b,null))[_0x718c('0x25')](function(_0x3049bf){if(_0x3049bf){_0x318f9e=_0x3049bf;_0x55647c[_0x718c('0x2e')]=_['keys'](db[_0x718c('0x4a')]['rawAttributes']);_0x55647c[_0x718c('0x30')]=_['keys'](_0x258d27['query']);_0x55647c[_0x718c('0x32')]=_[_0x718c('0x33')](_0x55647c[_0x718c('0x2e')],_0x55647c[_0x718c('0x30')]);_0x4a3232[_0x718c('0x34')]=_[_0x718c('0x33')](_0x55647c[_0x718c('0x2e')],qs[_0x718c('0x35')](_0x258d27[_0x718c('0x30')][_0x718c('0x35')]));_0x4a3232[_0x718c('0x34')]=_0x4a3232[_0x718c('0x34')][_0x718c('0x36')]?_0x4a3232[_0x718c('0x34')]:_0x55647c['model'];_0x4a3232[_0x718c('0x4d')]=qs[_0x718c('0x38')](_0x258d27['query']['sort']);_0x4a3232[_0x718c('0x39')]=qs['filters'](_['pick'](_0x258d27[_0x718c('0x30')],_0x55647c[_0x718c('0x32')]));if(_0x258d27[_0x718c('0x30')][_0x718c('0x3b')]){_0x4a3232['where']=_[_0x718c('0x3d')](_0x4a3232[_0x718c('0x39')],{'$or':_[_0x718c('0x2f')](_0x4a3232[_0x718c('0x34')],function(_0x404537){var _0xec3be7={};_0xec3be7[_0x404537]={'$like':'%'+_0x258d27['query'][_0x718c('0x3b')]+'%'};return _0xec3be7;})});}_0x4a3232=_[_0x718c('0x3d')]({},_0x4a3232,_0x258d27['options']);return _0x318f9e[_0x718c('0x4c')](_0x4a3232);}})['then'](function(_0x55139e){if(_0x55139e){_0x4a93b7=_0x55139e[_0x718c('0x36')];if(!_0x258d27[_0x718c('0x30')][_0x718c('0x4b')]('nolimit')){_0x4a3232[_0x718c('0x1e')]=qs[_0x718c('0x1e')](_0x258d27[_0x718c('0x30')][_0x718c('0x1e')]);_0x4a3232[_0x718c('0x1b')]=qs[_0x718c('0x1b')](_0x258d27[_0x718c('0x30')]['offset']);}return _0x318f9e[_0x718c('0x4c')](_0x4a3232);}})[_0x718c('0x25')](function(_0x189e20){if(_0x189e20){return _0x189e20?{'count':_0x4a93b7,'rows':_0x189e20}:null;}})[_0x718c('0x25')](respondWithResult(_0x50487b,null))[_0x718c('0x43')](handleError(_0x50487b,null));};exports[_0x718c('0x4e')]=function(_0x2ade62,_0x52f857,_0x5e2bdb){var _0x2c3115={};var _0x36bd98={};var _0x4edc4b;var _0x163c30;return db[_0x718c('0x2b')]['findOne']({'where':{'id':_0x2ade62[_0x718c('0x45')]['id']}})[_0x718c('0x25')](handleEntityNotFound(_0x52f857,null))[_0x718c('0x25')](function(_0x2d196e){if(_0x2d196e){_0x4edc4b=_0x2d196e;_0x36bd98[_0x718c('0x2e')]=_[_0x718c('0x31')](db['ZendeskField'][_0x718c('0x2c')]);_0x36bd98[_0x718c('0x30')]=_[_0x718c('0x31')](_0x2ade62[_0x718c('0x30')]);_0x36bd98[_0x718c('0x32')]=_[_0x718c('0x33')](_0x36bd98['model'],_0x36bd98[_0x718c('0x30')]);_0x2c3115[_0x718c('0x34')]=_['intersection'](_0x36bd98[_0x718c('0x2e')],qs[_0x718c('0x35')](_0x2ade62[_0x718c('0x30')][_0x718c('0x35')]));_0x2c3115[_0x718c('0x34')]=_0x2c3115[_0x718c('0x34')]['length']?_0x2c3115[_0x718c('0x34')]:_0x36bd98[_0x718c('0x2e')];_0x2c3115[_0x718c('0x4d')]=qs['sort'](_0x2ade62[_0x718c('0x30')][_0x718c('0x38')]);_0x2c3115[_0x718c('0x39')]=qs[_0x718c('0x32')](_['pick'](_0x2ade62[_0x718c('0x30')],_0x36bd98[_0x718c('0x32')]));if(_0x2ade62[_0x718c('0x30')][_0x718c('0x3b')]){_0x2c3115[_0x718c('0x39')]=_['merge'](_0x2c3115[_0x718c('0x39')],{'$or':_['map'](_0x2c3115['attributes'],function(_0x19d2f0){var _0x602c53={};_0x602c53[_0x19d2f0]={'$like':'%'+_0x2ade62[_0x718c('0x30')][_0x718c('0x3b')]+'%'};return _0x602c53;})});}_0x2c3115=_[_0x718c('0x3d')]({},_0x2c3115,_0x2ade62[_0x718c('0x3e')]);return _0x4edc4b[_0x718c('0x4e')](_0x2c3115);}})[_0x718c('0x25')](function(_0x326b25){if(_0x326b25){_0x163c30=_0x326b25[_0x718c('0x36')];if(!_0x2ade62[_0x718c('0x30')][_0x718c('0x4b')](_0x718c('0x37'))){_0x2c3115[_0x718c('0x1e')]=qs[_0x718c('0x1e')](_0x2ade62[_0x718c('0x30')][_0x718c('0x1e')]);_0x2c3115[_0x718c('0x1b')]=qs[_0x718c('0x1b')](_0x2ade62[_0x718c('0x30')][_0x718c('0x1b')]);}return _0x4edc4b['getDescriptions'](_0x2c3115);}})[_0x718c('0x25')](function(_0x1b3bd8){if(_0x1b3bd8){return _0x1b3bd8?{'count':_0x163c30,'rows':_0x1b3bd8}:null;}})['then'](respondWithResult(_0x52f857,null))['catch'](handleError(_0x52f857,null));};exports[_0x718c('0x4f')]=function(_0x37cc83,_0x35e933,_0x2902e0){var _0x5b887f={};var _0x1c5ba3={};var _0x787002;var _0x211870;return db['ZendeskConfiguration'][_0x718c('0x50')]({'where':{'id':_0x37cc83[_0x718c('0x45')]['id']}})['then'](handleEntityNotFound(_0x35e933,null))[_0x718c('0x25')](function(_0x24812f){if(_0x24812f){_0x787002=_0x24812f;_0x1c5ba3[_0x718c('0x2e')]=_[_0x718c('0x31')](db[_0x718c('0x51')][_0x718c('0x2c')]);_0x1c5ba3[_0x718c('0x30')]=_[_0x718c('0x31')](_0x37cc83[_0x718c('0x30')]);_0x1c5ba3[_0x718c('0x32')]=_['intersection'](_0x1c5ba3[_0x718c('0x2e')],_0x1c5ba3[_0x718c('0x30')]);_0x5b887f[_0x718c('0x34')]=_[_0x718c('0x33')](_0x1c5ba3[_0x718c('0x2e')],qs[_0x718c('0x35')](_0x37cc83[_0x718c('0x30')][_0x718c('0x35')]));_0x5b887f[_0x718c('0x34')]=_0x5b887f[_0x718c('0x34')][_0x718c('0x36')]?_0x5b887f['attributes']:_0x1c5ba3[_0x718c('0x2e')];_0x5b887f['order']=qs[_0x718c('0x38')](_0x37cc83[_0x718c('0x30')][_0x718c('0x38')]);_0x5b887f['where']=qs[_0x718c('0x32')](_[_0x718c('0x3a')](_0x37cc83[_0x718c('0x30')],_0x1c5ba3['filters']));if(_0x37cc83[_0x718c('0x30')]['filter']){_0x5b887f[_0x718c('0x39')]=_['merge'](_0x5b887f[_0x718c('0x39')],{'$or':_['map'](_0x5b887f[_0x718c('0x34')],function(_0x38eb4e){var _0x1b3f4e={};_0x1b3f4e[_0x38eb4e]={'$like':'%'+_0x37cc83[_0x718c('0x30')][_0x718c('0x3b')]+'%'};return _0x1b3f4e;})});}_0x5b887f=_[_0x718c('0x3d')]({},_0x5b887f,_0x37cc83[_0x718c('0x3e')]);return _0x787002[_0x718c('0x4f')](_0x5b887f);}})[_0x718c('0x25')](function(_0x113cb9){if(_0x113cb9){_0x211870=_0x113cb9[_0x718c('0x36')];if(!_0x37cc83['query'][_0x718c('0x4b')](_0x718c('0x37'))){_0x5b887f[_0x718c('0x1e')]=qs['limit'](_0x37cc83['query'][_0x718c('0x1e')]);_0x5b887f['offset']=qs[_0x718c('0x1b')](_0x37cc83[_0x718c('0x30')][_0x718c('0x1b')]);}return _0x787002[_0x718c('0x4f')](_0x5b887f);}})[_0x718c('0x25')](function(_0x3fa91c){if(_0x3fa91c){return _0x3fa91c?{'count':_0x211870,'rows':_0x3fa91c}:null;}})['then'](respondWithResult(_0x35e933,null))[_0x718c('0x43')](handleError(_0x35e933,null));};exports[_0x718c('0x52')]=function(_0x3b6332,_0xdfd4da,_0x59e6e9){if(_0x3b6332[_0x718c('0x48')]['id']){delete _0x3b6332[_0x718c('0x48')]['id'];}return db[_0x718c('0x2b')][_0x718c('0x50')]({'where':{'id':_0x3b6332['params']['id']}})[_0x718c('0x25')](handleEntityNotFound(_0xdfd4da,null))[_0x718c('0x25')](function(_0x3a6dd9){if(_0x3a6dd9){return _0x3a6dd9[_0x718c('0x52')](_0x3b6332[_0x718c('0x48')][_0x718c('0x53')]||[]);}return null;})[_0x718c('0x25')](respondWithResult(_0xdfd4da,null))[_0x718c('0x43')](handleError(_0xdfd4da,null));}; \ No newline at end of file +var _0xcf11=['status','json','offset','undefined','limit','count','set','Content-Range','save','destroy','then','error','stack','name','index','map','ZendeskConfiguration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','getFields','findOne','ZendeskField','hasOwnProperty','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x312f50,_0x303dce){var _0x4e43b9=function(_0x9ad464){while(--_0x9ad464){_0x312f50['push'](_0x312f50['shift']());}};_0x4e43b9(++_0x303dce);}(_0xcf11,0x1cc));var _0x1cf1=function(_0x596e98,_0xc326c9){_0x596e98=_0x596e98-0x0;var _0x1c09ac=_0xcf11[_0x596e98];return _0x1c09ac;};'use strict';var emlformat=require(_0x1cf1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1cf1('0x1'));var jsonpatch=require(_0x1cf1('0x2'));var rp=require(_0x1cf1('0x3'));var moment=require(_0x1cf1('0x4'));var BPromise=require(_0x1cf1('0x5'));var Mustache=require(_0x1cf1('0x6'));var util=require(_0x1cf1('0x7'));var path=require(_0x1cf1('0x8'));var sox=require(_0x1cf1('0x9'));var csv=require(_0x1cf1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cf1('0xb'));var _=require(_0x1cf1('0xc'));var squel=require(_0x1cf1('0xd'));var crypto=require(_0x1cf1('0xe'));var jsforce=require(_0x1cf1('0xf'));var deskjs=require(_0x1cf1('0x10'));var toCsv=require(_0x1cf1('0xa'));var querystring=require(_0x1cf1('0x11'));var Papa=require('papaparse');var Redis=require(_0x1cf1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1cf1('0x13'));var as=require(_0x1cf1('0x14'));var hardwareService=require(_0x1cf1('0x15'));var logger=require('../../config/logger')(_0x1cf1('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1cf1('0x17'));var db=require(_0x1cf1('0x18'))['db'];function respondWithStatusCode(_0x4589b1,_0x533809){_0x533809=_0x533809||0xcc;return function(_0x489387){if(_0x489387){return _0x4589b1[_0x1cf1('0x19')](_0x533809);}return _0x4589b1[_0x1cf1('0x1a')](_0x533809)['end']();};}function respondWithResult(_0x32e96e,_0x5275b3){_0x5275b3=_0x5275b3||0xc8;return function(_0x4446eb){if(_0x4446eb){return _0x32e96e[_0x1cf1('0x1a')](_0x5275b3)[_0x1cf1('0x1b')](_0x4446eb);}};}function respondWithFilteredResult(_0xbfb7d0,_0x3c10b3){return function(_0x2b7e82){if(_0x2b7e82){var _0x372be0=typeof _0x3c10b3[_0x1cf1('0x1c')]===_0x1cf1('0x1d')&&typeof _0x3c10b3[_0x1cf1('0x1e')]===_0x1cf1('0x1d');var _0x5ad519=_0x2b7e82[_0x1cf1('0x1f')];var _0xd557b1=_0x372be0?0x0:_0x3c10b3[_0x1cf1('0x1c')];var _0x3e0dce=_0x372be0?_0x2b7e82['count']:_0x3c10b3['offset']+_0x3c10b3[_0x1cf1('0x1e')];var _0x337f85;if(_0x3e0dce>=_0x5ad519){_0x3e0dce=_0x5ad519;_0x337f85=0xc8;}else{_0x337f85=0xce;}_0xbfb7d0[_0x1cf1('0x1a')](_0x337f85);return _0xbfb7d0[_0x1cf1('0x20')](_0x1cf1('0x21'),_0xd557b1+'-'+_0x3e0dce+'/'+_0x5ad519)[_0x1cf1('0x1b')](_0x2b7e82);}return null;};}function patchUpdates(_0x31e9b3){return function(_0x4170c8){try{jsonpatch['apply'](_0x4170c8,_0x31e9b3,!![]);}catch(_0x4971b2){return BPromise['reject'](_0x4971b2);}return _0x4170c8[_0x1cf1('0x22')]();};}function saveUpdates(_0x4a9054,_0x549c5b){return function(_0x25db83){if(_0x25db83){return _0x25db83['update'](_0x4a9054)['then'](function(_0x2f189c){return _0x2f189c;});}return null;};}function removeEntity(_0x23fe43,_0x38a7c9){return function(_0x131639){if(_0x131639){return _0x131639[_0x1cf1('0x23')]()[_0x1cf1('0x24')](function(){_0x23fe43[_0x1cf1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a14e3,_0x4b6b38){return function(_0x503115){if(!_0x503115){_0x2a14e3[_0x1cf1('0x19')](0x194);}return _0x503115;};}function handleError(_0x5c3c99,_0x2e48a6){_0x2e48a6=_0x2e48a6||0x1f4;return function(_0x57cd0e){logger[_0x1cf1('0x25')](_0x57cd0e[_0x1cf1('0x26')]);if(_0x57cd0e[_0x1cf1('0x27')]){delete _0x57cd0e[_0x1cf1('0x27')];}_0x5c3c99['status'](_0x2e48a6)['send'](_0x57cd0e);};}exports[_0x1cf1('0x28')]=function(_0x435abb,_0x2be7a0){var _0x12306e={},_0x578c84={},_0x27ac5e={'count':0x0,'rows':[]};var _0x447c16=_[_0x1cf1('0x29')](db[_0x1cf1('0x2a')][_0x1cf1('0x2b')],function(_0x406839){return{'name':_0x406839['fieldName'],'type':_0x406839[_0x1cf1('0x2c')][_0x1cf1('0x2d')]};});_0x578c84[_0x1cf1('0x2e')]=_[_0x1cf1('0x29')](_0x447c16,'name');_0x578c84[_0x1cf1('0x2f')]=_[_0x1cf1('0x30')](_0x435abb[_0x1cf1('0x2f')]);_0x578c84['filters']=_[_0x1cf1('0x31')](_0x578c84['model'],_0x578c84['query']);_0x12306e[_0x1cf1('0x32')]=_['intersection'](_0x578c84[_0x1cf1('0x2e')],qs[_0x1cf1('0x33')](_0x435abb[_0x1cf1('0x2f')][_0x1cf1('0x33')]));_0x12306e[_0x1cf1('0x32')]=_0x12306e[_0x1cf1('0x32')][_0x1cf1('0x34')]?_0x12306e[_0x1cf1('0x32')]:_0x578c84[_0x1cf1('0x2e')];if(!_0x435abb[_0x1cf1('0x2f')]['hasOwnProperty']('nolimit')){_0x12306e[_0x1cf1('0x1e')]=qs[_0x1cf1('0x1e')](_0x435abb[_0x1cf1('0x2f')][_0x1cf1('0x1e')]);_0x12306e[_0x1cf1('0x1c')]=qs['offset'](_0x435abb['query'][_0x1cf1('0x1c')]);}_0x12306e[_0x1cf1('0x35')]=qs[_0x1cf1('0x36')](_0x435abb[_0x1cf1('0x2f')][_0x1cf1('0x36')]);_0x12306e[_0x1cf1('0x37')]=qs[_0x1cf1('0x38')](_[_0x1cf1('0x39')](_0x435abb[_0x1cf1('0x2f')],_0x578c84[_0x1cf1('0x38')]),_0x447c16);if(_0x435abb[_0x1cf1('0x2f')][_0x1cf1('0x3a')]){_0x12306e[_0x1cf1('0x37')]=_[_0x1cf1('0x3b')](_0x12306e['where'],{'$or':_['map'](_0x447c16,function(_0x15fc57){if(_0x15fc57[_0x1cf1('0x2c')]!=='VIRTUAL'){var _0x1194cb={};_0x1194cb[_0x15fc57['name']]={'$like':'%'+_0x435abb[_0x1cf1('0x2f')][_0x1cf1('0x3a')]+'%'};return _0x1194cb;}})});}_0x12306e=_[_0x1cf1('0x3b')]({},_0x12306e,_0x435abb[_0x1cf1('0x3c')]);var _0x236484={'where':_0x12306e[_0x1cf1('0x37')]};return db['ZendeskConfiguration'][_0x1cf1('0x1f')](_0x236484)[_0x1cf1('0x24')](function(_0x237381){_0x27ac5e[_0x1cf1('0x1f')]=_0x237381;if(_0x435abb[_0x1cf1('0x2f')][_0x1cf1('0x3d')]){_0x12306e[_0x1cf1('0x3e')]=[{'all':!![]}];}return db[_0x1cf1('0x2a')][_0x1cf1('0x3f')](_0x12306e);})['then'](function(_0x3f75d1){_0x27ac5e[_0x1cf1('0x40')]=_0x3f75d1;return _0x27ac5e;})['then'](respondWithFilteredResult(_0x2be7a0,_0x12306e))[_0x1cf1('0x41')](handleError(_0x2be7a0,null));};exports[_0x1cf1('0x42')]=function(_0x1daf3f,_0x567ffd){var _0x393c28={'raw':![],'where':{'id':_0x1daf3f[_0x1cf1('0x43')]['id']}},_0x518312={};_0x518312['model']=_[_0x1cf1('0x30')](db['ZendeskConfiguration']['rawAttributes']);_0x518312[_0x1cf1('0x2f')]=_[_0x1cf1('0x30')](_0x1daf3f[_0x1cf1('0x2f')]);_0x518312['filters']=_[_0x1cf1('0x31')](_0x518312[_0x1cf1('0x2e')],_0x518312['query']);_0x393c28[_0x1cf1('0x32')]=_[_0x1cf1('0x31')](_0x518312[_0x1cf1('0x2e')],qs[_0x1cf1('0x33')](_0x1daf3f[_0x1cf1('0x2f')][_0x1cf1('0x33')]));_0x393c28[_0x1cf1('0x32')]=_0x393c28[_0x1cf1('0x32')]['length']?_0x393c28[_0x1cf1('0x32')]:_0x518312[_0x1cf1('0x2e')];if(_0x1daf3f[_0x1cf1('0x2f')]['includeAll']){_0x393c28['include']=[{'all':!![]}];}_0x393c28=_['merge']({},_0x393c28,_0x1daf3f[_0x1cf1('0x3c')]);return db[_0x1cf1('0x2a')]['find'](_0x393c28)[_0x1cf1('0x24')](handleEntityNotFound(_0x567ffd,null))[_0x1cf1('0x24')](respondWithResult(_0x567ffd,null))[_0x1cf1('0x41')](handleError(_0x567ffd,null));};exports[_0x1cf1('0x44')]=function(_0xf8b30b,_0x457b84){return db[_0x1cf1('0x2a')]['create'](_0xf8b30b['body'],{})['then'](respondWithResult(_0x457b84,0xc9))[_0x1cf1('0x41')](handleError(_0x457b84,null));};exports['update']=function(_0x57eb7f,_0x5c2685){if(_0x57eb7f[_0x1cf1('0x45')]['id']){delete _0x57eb7f[_0x1cf1('0x45')]['id'];}return db[_0x1cf1('0x2a')]['find']({'where':{'id':_0x57eb7f[_0x1cf1('0x43')]['id']}})[_0x1cf1('0x24')](handleEntityNotFound(_0x5c2685,null))[_0x1cf1('0x24')](saveUpdates(_0x57eb7f[_0x1cf1('0x45')],null))[_0x1cf1('0x24')](respondWithResult(_0x5c2685,null))[_0x1cf1('0x41')](handleError(_0x5c2685,null));};exports[_0x1cf1('0x23')]=function(_0x16c7ab,_0x4e301a){return db[_0x1cf1('0x2a')][_0x1cf1('0x46')]({'where':{'id':_0x16c7ab[_0x1cf1('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e301a,null))[_0x1cf1('0x24')](removeEntity(_0x4e301a,null))[_0x1cf1('0x41')](handleError(_0x4e301a,null));};exports[_0x1cf1('0x47')]=function(_0x184b19,_0x384fea,_0x52dd2b){var _0x533f4f={};var _0x207069={};var _0xb74f58;var _0x12b5d3;return db[_0x1cf1('0x2a')][_0x1cf1('0x48')]({'where':{'id':_0x184b19[_0x1cf1('0x43')]['id']}})[_0x1cf1('0x24')](handleEntityNotFound(_0x384fea,null))[_0x1cf1('0x24')](function(_0x12e26a){if(_0x12e26a){_0xb74f58=_0x12e26a;_0x207069[_0x1cf1('0x2e')]=_[_0x1cf1('0x30')](db[_0x1cf1('0x49')][_0x1cf1('0x2b')]);_0x207069[_0x1cf1('0x2f')]=_['keys'](_0x184b19['query']);_0x207069[_0x1cf1('0x38')]=_[_0x1cf1('0x31')](_0x207069['model'],_0x207069[_0x1cf1('0x2f')]);_0x533f4f[_0x1cf1('0x32')]=_[_0x1cf1('0x31')](_0x207069['model'],qs[_0x1cf1('0x33')](_0x184b19[_0x1cf1('0x2f')][_0x1cf1('0x33')]));_0x533f4f[_0x1cf1('0x32')]=_0x533f4f[_0x1cf1('0x32')][_0x1cf1('0x34')]?_0x533f4f[_0x1cf1('0x32')]:_0x207069[_0x1cf1('0x2e')];_0x533f4f[_0x1cf1('0x35')]=qs[_0x1cf1('0x36')](_0x184b19[_0x1cf1('0x2f')][_0x1cf1('0x36')]);_0x533f4f[_0x1cf1('0x37')]=qs['filters'](_[_0x1cf1('0x39')](_0x184b19[_0x1cf1('0x2f')],_0x207069['filters']));if(_0x184b19['query'][_0x1cf1('0x3a')]){_0x533f4f['where']=_[_0x1cf1('0x3b')](_0x533f4f[_0x1cf1('0x37')],{'$or':_['map'](_0x533f4f[_0x1cf1('0x32')],function(_0x18be9f){var _0x25e1a4={};_0x25e1a4[_0x18be9f]={'$like':'%'+_0x184b19[_0x1cf1('0x2f')]['filter']+'%'};return _0x25e1a4;})});}_0x533f4f=_[_0x1cf1('0x3b')]({},_0x533f4f,_0x184b19[_0x1cf1('0x3c')]);return _0xb74f58[_0x1cf1('0x47')](_0x533f4f);}})[_0x1cf1('0x24')](function(_0x3f1841){if(_0x3f1841){_0x12b5d3=_0x3f1841[_0x1cf1('0x34')];if(!_0x184b19[_0x1cf1('0x2f')][_0x1cf1('0x4a')](_0x1cf1('0x4b'))){_0x533f4f['limit']=qs[_0x1cf1('0x1e')](_0x184b19['query'][_0x1cf1('0x1e')]);_0x533f4f[_0x1cf1('0x1c')]=qs[_0x1cf1('0x1c')](_0x184b19[_0x1cf1('0x2f')][_0x1cf1('0x1c')]);}return _0xb74f58['getFields'](_0x533f4f);}})[_0x1cf1('0x24')](function(_0x5f00b5){if(_0x5f00b5){return _0x5f00b5?{'count':_0x12b5d3,'rows':_0x5f00b5}:null;}})[_0x1cf1('0x24')](respondWithResult(_0x384fea,null))[_0x1cf1('0x41')](handleError(_0x384fea,null));};exports[_0x1cf1('0x4c')]=function(_0x4ff70f,_0xf7742b,_0x25404f){var _0x4e56f3={};var _0x25b2b2={};var _0x31a370;var _0x18bf6b;return db['ZendeskConfiguration'][_0x1cf1('0x48')]({'where':{'id':_0x4ff70f[_0x1cf1('0x43')]['id']}})['then'](handleEntityNotFound(_0xf7742b,null))['then'](function(_0x4c62c9){if(_0x4c62c9){_0x31a370=_0x4c62c9;_0x25b2b2[_0x1cf1('0x2e')]=_[_0x1cf1('0x30')](db[_0x1cf1('0x49')]['rawAttributes']);_0x25b2b2[_0x1cf1('0x2f')]=_['keys'](_0x4ff70f['query']);_0x25b2b2[_0x1cf1('0x38')]=_[_0x1cf1('0x31')](_0x25b2b2['model'],_0x25b2b2[_0x1cf1('0x2f')]);_0x4e56f3[_0x1cf1('0x32')]=_[_0x1cf1('0x31')](_0x25b2b2[_0x1cf1('0x2e')],qs[_0x1cf1('0x33')](_0x4ff70f[_0x1cf1('0x2f')][_0x1cf1('0x33')]));_0x4e56f3['attributes']=_0x4e56f3[_0x1cf1('0x32')][_0x1cf1('0x34')]?_0x4e56f3[_0x1cf1('0x32')]:_0x25b2b2['model'];_0x4e56f3['order']=qs[_0x1cf1('0x36')](_0x4ff70f[_0x1cf1('0x2f')]['sort']);_0x4e56f3[_0x1cf1('0x37')]=qs[_0x1cf1('0x38')](_[_0x1cf1('0x39')](_0x4ff70f['query'],_0x25b2b2[_0x1cf1('0x38')]));if(_0x4ff70f[_0x1cf1('0x2f')][_0x1cf1('0x3a')]){_0x4e56f3[_0x1cf1('0x37')]=_[_0x1cf1('0x3b')](_0x4e56f3[_0x1cf1('0x37')],{'$or':_[_0x1cf1('0x29')](_0x4e56f3[_0x1cf1('0x32')],function(_0x392b21){var _0x480810={};_0x480810[_0x392b21]={'$like':'%'+_0x4ff70f[_0x1cf1('0x2f')]['filter']+'%'};return _0x480810;})});}_0x4e56f3=_[_0x1cf1('0x3b')]({},_0x4e56f3,_0x4ff70f[_0x1cf1('0x3c')]);return _0x31a370[_0x1cf1('0x4c')](_0x4e56f3);}})[_0x1cf1('0x24')](function(_0x6d36f4){if(_0x6d36f4){_0x18bf6b=_0x6d36f4[_0x1cf1('0x34')];if(!_0x4ff70f[_0x1cf1('0x2f')][_0x1cf1('0x4a')](_0x1cf1('0x4b'))){_0x4e56f3[_0x1cf1('0x1e')]=qs['limit'](_0x4ff70f[_0x1cf1('0x2f')][_0x1cf1('0x1e')]);_0x4e56f3[_0x1cf1('0x1c')]=qs[_0x1cf1('0x1c')](_0x4ff70f[_0x1cf1('0x2f')][_0x1cf1('0x1c')]);}return _0x31a370[_0x1cf1('0x4c')](_0x4e56f3);}})['then'](function(_0x1b65bb){if(_0x1b65bb){return _0x1b65bb?{'count':_0x18bf6b,'rows':_0x1b65bb}:null;}})[_0x1cf1('0x24')](respondWithResult(_0xf7742b,null))[_0x1cf1('0x41')](handleError(_0xf7742b,null));};exports[_0x1cf1('0x4d')]=function(_0x53bda6,_0x1657a6,_0x27ffa0){var _0x3df6d2={};var _0x23a58e={};var _0x2ddde5;var _0x31b530;return db[_0x1cf1('0x2a')][_0x1cf1('0x48')]({'where':{'id':_0x53bda6[_0x1cf1('0x43')]['id']}})['then'](handleEntityNotFound(_0x1657a6,null))['then'](function(_0x375319){if(_0x375319){_0x2ddde5=_0x375319;_0x23a58e['model']=_[_0x1cf1('0x30')](db[_0x1cf1('0x49')][_0x1cf1('0x2b')]);_0x23a58e[_0x1cf1('0x2f')]=_[_0x1cf1('0x30')](_0x53bda6[_0x1cf1('0x2f')]);_0x23a58e[_0x1cf1('0x38')]=_[_0x1cf1('0x31')](_0x23a58e['model'],_0x23a58e[_0x1cf1('0x2f')]);_0x3df6d2[_0x1cf1('0x32')]=_[_0x1cf1('0x31')](_0x23a58e[_0x1cf1('0x2e')],qs[_0x1cf1('0x33')](_0x53bda6[_0x1cf1('0x2f')]['fields']));_0x3df6d2[_0x1cf1('0x32')]=_0x3df6d2[_0x1cf1('0x32')][_0x1cf1('0x34')]?_0x3df6d2[_0x1cf1('0x32')]:_0x23a58e['model'];_0x3df6d2[_0x1cf1('0x35')]=qs[_0x1cf1('0x36')](_0x53bda6[_0x1cf1('0x2f')]['sort']);_0x3df6d2[_0x1cf1('0x37')]=qs[_0x1cf1('0x38')](_[_0x1cf1('0x39')](_0x53bda6['query'],_0x23a58e[_0x1cf1('0x38')]));if(_0x53bda6[_0x1cf1('0x2f')][_0x1cf1('0x3a')]){_0x3df6d2['where']=_[_0x1cf1('0x3b')](_0x3df6d2[_0x1cf1('0x37')],{'$or':_['map'](_0x3df6d2[_0x1cf1('0x32')],function(_0x44a60c){var _0x4ba07a={};_0x4ba07a[_0x44a60c]={'$like':'%'+_0x53bda6[_0x1cf1('0x2f')]['filter']+'%'};return _0x4ba07a;})});}_0x3df6d2=_[_0x1cf1('0x3b')]({},_0x3df6d2,_0x53bda6[_0x1cf1('0x3c')]);return _0x2ddde5[_0x1cf1('0x4d')](_0x3df6d2);}})[_0x1cf1('0x24')](function(_0x1f987b){if(_0x1f987b){_0x31b530=_0x1f987b[_0x1cf1('0x34')];if(!_0x53bda6[_0x1cf1('0x2f')][_0x1cf1('0x4a')](_0x1cf1('0x4b'))){_0x3df6d2['limit']=qs[_0x1cf1('0x1e')](_0x53bda6[_0x1cf1('0x2f')][_0x1cf1('0x1e')]);_0x3df6d2[_0x1cf1('0x1c')]=qs['offset'](_0x53bda6[_0x1cf1('0x2f')]['offset']);}return _0x2ddde5['getDescriptions'](_0x3df6d2);}})[_0x1cf1('0x24')](function(_0x2d0000){if(_0x2d0000){return _0x2d0000?{'count':_0x31b530,'rows':_0x2d0000}:null;}})[_0x1cf1('0x24')](respondWithResult(_0x1657a6,null))[_0x1cf1('0x41')](handleError(_0x1657a6,null));};exports[_0x1cf1('0x4e')]=function(_0xfa3a0,_0x3895d4,_0x568ef3){var _0x389cbd={};var _0x25da60={};var _0xc64ec8;var _0x4f9f14;return db[_0x1cf1('0x2a')]['findOne']({'where':{'id':_0xfa3a0['params']['id']}})[_0x1cf1('0x24')](handleEntityNotFound(_0x3895d4,null))[_0x1cf1('0x24')](function(_0x5c651e){if(_0x5c651e){_0xc64ec8=_0x5c651e;_0x25da60[_0x1cf1('0x2e')]=_[_0x1cf1('0x30')](db[_0x1cf1('0x4f')][_0x1cf1('0x2b')]);_0x25da60['query']=_[_0x1cf1('0x30')](_0xfa3a0[_0x1cf1('0x2f')]);_0x25da60[_0x1cf1('0x38')]=_[_0x1cf1('0x31')](_0x25da60[_0x1cf1('0x2e')],_0x25da60[_0x1cf1('0x2f')]);_0x389cbd[_0x1cf1('0x32')]=_['intersection'](_0x25da60['model'],qs['fields'](_0xfa3a0['query'][_0x1cf1('0x33')]));_0x389cbd[_0x1cf1('0x32')]=_0x389cbd[_0x1cf1('0x32')][_0x1cf1('0x34')]?_0x389cbd[_0x1cf1('0x32')]:_0x25da60[_0x1cf1('0x2e')];_0x389cbd[_0x1cf1('0x35')]=qs[_0x1cf1('0x36')](_0xfa3a0[_0x1cf1('0x2f')][_0x1cf1('0x36')]);_0x389cbd[_0x1cf1('0x37')]=qs['filters'](_[_0x1cf1('0x39')](_0xfa3a0[_0x1cf1('0x2f')],_0x25da60[_0x1cf1('0x38')]));if(_0xfa3a0['query'][_0x1cf1('0x3a')]){_0x389cbd[_0x1cf1('0x37')]=_[_0x1cf1('0x3b')](_0x389cbd[_0x1cf1('0x37')],{'$or':_['map'](_0x389cbd[_0x1cf1('0x32')],function(_0x31d23e){var _0x488d48={};_0x488d48[_0x31d23e]={'$like':'%'+_0xfa3a0['query'][_0x1cf1('0x3a')]+'%'};return _0x488d48;})});}_0x389cbd=_['merge']({},_0x389cbd,_0xfa3a0[_0x1cf1('0x3c')]);return _0xc64ec8[_0x1cf1('0x4e')](_0x389cbd);}})['then'](function(_0xb025b1){if(_0xb025b1){_0x4f9f14=_0xb025b1[_0x1cf1('0x34')];if(!_0xfa3a0[_0x1cf1('0x2f')][_0x1cf1('0x4a')](_0x1cf1('0x4b'))){_0x389cbd['limit']=qs['limit'](_0xfa3a0[_0x1cf1('0x2f')][_0x1cf1('0x1e')]);_0x389cbd[_0x1cf1('0x1c')]=qs[_0x1cf1('0x1c')](_0xfa3a0[_0x1cf1('0x2f')][_0x1cf1('0x1c')]);}return _0xc64ec8[_0x1cf1('0x4e')](_0x389cbd);}})[_0x1cf1('0x24')](function(_0x39d2b0){if(_0x39d2b0){return _0x39d2b0?{'count':_0x4f9f14,'rows':_0x39d2b0}:null;}})['then'](respondWithResult(_0x3895d4,null))[_0x1cf1('0x41')](handleError(_0x3895d4,null));};exports['setTags']=function(_0x43cbc5,_0x849554,_0x419f1c){if(_0x43cbc5[_0x1cf1('0x45')]['id']){delete _0x43cbc5[_0x1cf1('0x45')]['id'];}return db[_0x1cf1('0x2a')][_0x1cf1('0x48')]({'where':{'id':_0x43cbc5['params']['id']}})[_0x1cf1('0x24')](handleEntityNotFound(_0x849554,null))[_0x1cf1('0x24')](function(_0x3654f3){if(_0x3654f3){return _0x3654f3[_0x1cf1('0x50')](_0x43cbc5[_0x1cf1('0x45')]['ids']||[]);}return null;})[_0x1cf1('0x24')](respondWithResult(_0x849554,null))['catch'](handleError(_0x849554,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 5181f92..89e6619 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8603=['util','../../config/logger','api','request-promise','path','rimraf','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x588906,_0xcbb563){var _0x358f21=function(_0x3ab376){while(--_0x3ab376){_0x588906['push'](_0x588906['shift']());}};_0x358f21(++_0xcbb563);}(_0x8603,0x190));var _0x3860=function(_0x495eba,_0x523820){_0x495eba=_0x495eba-0x0;var _0x564c76=_0x8603[_0x495eba];return _0x564c76;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var logger=require(_0x3860('0x1'))(_0x3860('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3860('0x3'));var fs=require('fs');var path=require(_0x3860('0x4'));var rimraf=require(_0x3860('0x5'));var config=require('../../config/environment');var attributes=require(_0x3860('0x6'));module['exports']=function(_0xb0fc24,_0x40739b){return _0xb0fc24[_0x3860('0x7')](_0x3860('0x8'),attributes,{'tableName':_0x3860('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x160f=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','int_zendesk_configurations'];(function(_0x52109d,_0x368d6c){var _0x14485a=function(_0x5ad7c2){while(--_0x5ad7c2){_0x52109d['push'](_0x52109d['shift']());}};_0x14485a(++_0x368d6c);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var logger=require(_0xf160('0x2'))(_0xf160('0x3'));var moment=require('moment');var BPromise=require(_0xf160('0x4'));var rp=require(_0xf160('0x5'));var fs=require('fs');var path=require(_0xf160('0x6'));var rimraf=require(_0xf160('0x7'));var config=require(_0xf160('0x8'));var attributes=require(_0xf160('0x9'));module['exports']=function(_0x311d63,_0x11902f){return _0x311d63['define']('ZendeskConfiguration',attributes,{'tableName':_0xf160('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index ee4e0f0..c6bc8e4 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fed=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ZendeskConfiguration,\x20%s,\x20%s','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x2113d8,_0x5a3232){var _0x1c8538=function(_0x4fc12d){while(--_0x4fc12d){_0x2113d8['push'](_0x2113d8['shift']());}};_0x1c8538(++_0x5a3232);}(_0x4fed,0x12f));var _0xd4fe=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0x4fed[_0x2b5513];return _0x578fd2;};'use strict';var _=require(_0xd4fe('0x0'));var util=require('util');var moment=require(_0xd4fe('0x1'));var BPromise=require('bluebird');var rs=require(_0xd4fe('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4fe('0x3'))['db'];var utils=require(_0xd4fe('0x4'));var logger=require(_0xd4fe('0x5'))('rpc');var config=require(_0xd4fe('0x6'));var jayson=require(_0xd4fe('0x7'));var client=jayson[_0xd4fe('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xff2733,_0x29de19,_0x3d9b82){return new BPromise(function(_0x1ff3ba,_0x41d953){return client[_0xd4fe('0x9')](_0xff2733,_0x3d9b82)[_0xd4fe('0xa')](function(_0x3ead36){logger[_0xd4fe('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x29de19,'request\x20sent');logger[_0xd4fe('0xc')](_0xd4fe('0xd'),_0x29de19,_0xd4fe('0xe'),JSON[_0xd4fe('0xf')](_0x3ead36));if(_0x3ead36[_0xd4fe('0x10')]){if(_0x3ead36[_0xd4fe('0x10')][_0xd4fe('0x11')]===0x1f4){logger[_0xd4fe('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x29de19,_0x3ead36[_0xd4fe('0x10')][_0xd4fe('0x12')]);return _0x41d953(_0x3ead36[_0xd4fe('0x10')][_0xd4fe('0x12')]);}logger[_0xd4fe('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x29de19,_0x3ead36['error'][_0xd4fe('0x12')]);return _0x1ff3ba(_0x3ead36[_0xd4fe('0x10')][_0xd4fe('0x12')]);}else{logger['info'](_0xd4fe('0x13'),_0x29de19,'request\x20sent');_0x1ff3ba(_0x3ead36['result'][_0xd4fe('0x12')]);}})[_0xd4fe('0x14')](function(_0x26de86){logger[_0xd4fe('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x29de19,_0x26de86);_0x41d953(_0x26de86);});});} \ No newline at end of file +var _0x79e5=['lodash','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x103817,_0x17e285){var _0x5998db=function(_0x1a3771){while(--_0x1a3771){_0x103817['push'](_0x103817['shift']());}};_0x5998db(++_0x17e285);}(_0x79e5,0x1a9));var _0x579e=function(_0x210b83,_0x1567a9){_0x210b83=_0x210b83-0x0;var _0x244cec=_0x79e5[_0x210b83];return _0x244cec;};'use strict';var _=require(_0x579e('0x0'));var util=require('util');var moment=require(_0x579e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x579e('0x2'))['db'];var utils=require(_0x579e('0x3'));var logger=require('../../config/logger')(_0x579e('0x4'));var config=require(_0x579e('0x5'));var jayson=require(_0x579e('0x6'));var client=jayson[_0x579e('0x7')][_0x579e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a18ac,_0x3dc630,_0x165c25){return new BPromise(function(_0x4b5851,_0x3ae8cd){return client[_0x579e('0x9')](_0x1a18ac,_0x165c25)['then'](function(_0x3875ad){logger[_0x579e('0xa')](_0x579e('0xb'),_0x3dc630,_0x579e('0xc'));logger[_0x579e('0xd')](_0x579e('0xe'),_0x3dc630,_0x579e('0xc'),JSON['stringify'](_0x3875ad));if(_0x3875ad[_0x579e('0xf')]){if(_0x3875ad[_0x579e('0xf')]['code']===0x1f4){logger[_0x579e('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3dc630,_0x3875ad['error']['message']);return _0x3ae8cd(_0x3875ad[_0x579e('0xf')][_0x579e('0x10')]);}logger['error'](_0x579e('0xb'),_0x3dc630,_0x3875ad[_0x579e('0xf')][_0x579e('0x10')]);return _0x4b5851(_0x3875ad[_0x579e('0xf')][_0x579e('0x10')]);}else{logger['info'](_0x579e('0xb'),_0x3dc630,'request\x20sent');_0x4b5851(_0x3875ad['result'][_0x579e('0x10')]);}})['catch'](function(_0x4c1ff0){logger[_0x579e('0xf')](_0x579e('0xb'),_0x3dc630,_0x4c1ff0);_0x3ae8cd(_0x4c1ff0);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 201e766..95008db 100644 --- a/server/api/intZendeskField/index.js +++ b/server/api/intZendeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef44=['create','put','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x531fde,_0x33597c){var _0x28c7aa=function(_0x359fb6){while(--_0x359fb6){_0x531fde['push'](_0x531fde['shift']());}};_0x28c7aa(++_0x33597c);}(_0xef44,0x1ce));var _0x4ef4=function(_0x5a5a0d,_0x49dc6c){_0x5a5a0d=_0x5a5a0d-0x0;var _0x44c8a6=_0xef44[_0x5a5a0d];return _0x44c8a6;};'use strict';var multer=require(_0x4ef4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4ef4('0x1'));var express=require(_0x4ef4('0x2'));var router=express[_0x4ef4('0x3')]();var fs_extra=require(_0x4ef4('0x4'));var auth=require(_0x4ef4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4ef4('0x6'));var controller=require(_0x4ef4('0x7'));router[_0x4ef4('0x8')]('/',auth[_0x4ef4('0x9')](),controller[_0x4ef4('0xa')]);router[_0x4ef4('0x8')](_0x4ef4('0xb'),auth['isAuthenticated'](),controller[_0x4ef4('0xc')]);router[_0x4ef4('0xd')]('/',auth['isAuthenticated'](),controller[_0x4ef4('0xe')]);router[_0x4ef4('0xf')](_0x4ef4('0xb'),auth[_0x4ef4('0x9')](),controller['update']);router['delete'](_0x4ef4('0xb'),auth['isAuthenticated'](),controller[_0x4ef4('0x10')]);module['exports']=router; \ No newline at end of file +var _0xde9c=['destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','put','delete'];(function(_0x211e3c,_0x479757){var _0x416214=function(_0x4404b4){while(--_0x4404b4){_0x211e3c['push'](_0x211e3c['shift']());}};_0x416214(++_0x479757);}(_0xde9c,0x188));var _0xcde9=function(_0x35a7fc,_0x332673){_0x35a7fc=_0x35a7fc-0x0;var _0x2c0a59=_0xde9c[_0x35a7fc];return _0x2c0a59;};'use strict';var multer=require(_0xcde9('0x0'));var util=require(_0xcde9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcde9('0x2'));var router=express[_0xcde9('0x3')]();var fs_extra=require(_0xcde9('0x4'));var auth=require(_0xcde9('0x5'));var interaction=require(_0xcde9('0x6'));var config=require(_0xcde9('0x7'));var controller=require(_0xcde9('0x8'));router[_0xcde9('0x9')]('/',auth[_0xcde9('0xa')](),controller[_0xcde9('0xb')]);router[_0xcde9('0x9')](_0xcde9('0xc'),auth['isAuthenticated'](),controller[_0xcde9('0xd')]);router['post']('/',auth[_0xcde9('0xa')](),controller['create']);router[_0xcde9('0xe')]('/:id',auth[_0xcde9('0xa')](),controller['update']);router[_0xcde9('0xf')](_0xcde9('0xc'),auth[_0xcde9('0xa')](),controller[_0xcde9('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 58c7473..1b19164 100644 --- a/server/api/intZendeskField/intZendeskField.attributes.js +++ b/server/api/intZendeskField/intZendeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x607f=['BOOLEAN','sequelize','exports','variable','customVariable','picklist','string','STRING','ENUM'];(function(_0x2133a5,_0x221371){var _0x3065fa=function(_0x1acd5d){while(--_0x1acd5d){_0x2133a5['push'](_0x2133a5['shift']());}};_0x3065fa(++_0x221371);}(_0x607f,0x14e));var _0xf607=function(_0xe91974,_0x2c1424){_0xe91974=_0xe91974-0x0;var _0x56740e=_0x607f[_0xe91974];return _0x56740e;};'use strict';var Sequelize=require(_0xf607('0x0'));module[_0xf607('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xf607('0x2'),_0xf607('0x3'),'keyValue',_0xf607('0x4')),'defaultValue':_0xf607('0x5')},'content':{'type':Sequelize[_0xf607('0x6')]},'key':{'type':Sequelize[_0xf607('0x6')]},'keyType':{'type':Sequelize[_0xf607('0x7')](_0xf607('0x5'),'variable',_0xf607('0x3'))},'keyContent':{'type':Sequelize[_0xf607('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf607('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf607('0x6')]}}; \ No newline at end of file +var _0x99dc=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x235369,_0x579504){var _0x52be29=function(_0x470762){while(--_0x470762){_0x235369['push'](_0x235369['shift']());}};_0x52be29(++_0x579504);}(_0x99dc,0x6a));var _0xc99d=function(_0xfb42e6,_0x5f5d4b){_0xfb42e6=_0xfb42e6-0x0;var _0x27265b=_0x99dc[_0xfb42e6];return _0x27265b;};'use strict';var Sequelize=require(_0xc99d('0x0'));module[_0xc99d('0x1')]={'type':{'type':Sequelize[_0xc99d('0x2')](_0xc99d('0x3'),_0xc99d('0x4'),_0xc99d('0x5'),_0xc99d('0x6'),_0xc99d('0x7')),'defaultValue':_0xc99d('0x3')},'content':{'type':Sequelize[_0xc99d('0x8')]},'key':{'type':Sequelize[_0xc99d('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xc99d('0x3'),_0xc99d('0x4'),_0xc99d('0x5'))},'keyContent':{'type':Sequelize[_0xc99d('0x8')]},'idField':{'type':Sequelize[_0xc99d('0x8')]},'nameField':{'type':Sequelize[_0xc99d('0x8')]},'customField':{'type':Sequelize[_0xc99d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc99d('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 13826f3..b2a5c59 100644 --- a/server/api/intZendeskField/intZendeskField.controller.js +++ b/server/api/intZendeskField/intZendeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae8d=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','map','ZendeskField','fieldName','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','length','create','body','find','destroy','zip-dir','fast-json-patch'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0xae8d,0x94));var _0xdae8=function(_0x2deeee,_0x49d4fd){_0x2deeee=_0x2deeee-0x0;var _0x4d3a33=_0xae8d[_0x2deeee];return _0x4d3a33;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdae8('0x0'));var jsonpatch=require(_0xdae8('0x1'));var rp=require(_0xdae8('0x2'));var moment=require(_0xdae8('0x3'));var BPromise=require(_0xdae8('0x4'));var Mustache=require(_0xdae8('0x5'));var util=require(_0xdae8('0x6'));var path=require(_0xdae8('0x7'));var sox=require(_0xdae8('0x8'));var csv=require(_0xdae8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdae8('0xa'));var _=require(_0xdae8('0xb'));var squel=require(_0xdae8('0xc'));var crypto=require('crypto');var jsforce=require(_0xdae8('0xd'));var deskjs=require(_0xdae8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdae8('0xf'));var Papa=require(_0xdae8('0x10'));var Redis=require(_0xdae8('0x11'));var authService=require(_0xdae8('0x12'));var qs=require(_0xdae8('0x13'));var as=require(_0xdae8('0x14'));var hardwareService=require(_0xdae8('0x15'));var logger=require(_0xdae8('0x16'))(_0xdae8('0x17'));var utils=require(_0xdae8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xdae8('0x19'));var db=require(_0xdae8('0x1a'))['db'];function respondWithStatusCode(_0x3872f8,_0x39bf2c){_0x39bf2c=_0x39bf2c||0xcc;return function(_0x2d0783){if(_0x2d0783){return _0x3872f8['sendStatus'](_0x39bf2c);}return _0x3872f8[_0xdae8('0x1b')](_0x39bf2c)[_0xdae8('0x1c')]();};}function respondWithResult(_0x31784e,_0x46a6ea){_0x46a6ea=_0x46a6ea||0xc8;return function(_0x1a20f5){if(_0x1a20f5){return _0x31784e[_0xdae8('0x1b')](_0x46a6ea)[_0xdae8('0x1d')](_0x1a20f5);}};}function respondWithFilteredResult(_0x2d1ab6,_0x301f67){return function(_0x5016af){if(_0x5016af){var _0x58e9ed=typeof _0x301f67[_0xdae8('0x1e')]===_0xdae8('0x1f')&&typeof _0x301f67[_0xdae8('0x20')]===_0xdae8('0x1f');var _0x13e266=_0x5016af[_0xdae8('0x21')];var _0x1a7d42=_0x58e9ed?0x0:_0x301f67[_0xdae8('0x1e')];var _0x1b4225=_0x58e9ed?_0x5016af['count']:_0x301f67[_0xdae8('0x1e')]+_0x301f67['limit'];var _0x514f5e;if(_0x1b4225>=_0x13e266){_0x1b4225=_0x13e266;_0x514f5e=0xc8;}else{_0x514f5e=0xce;}_0x2d1ab6[_0xdae8('0x1b')](_0x514f5e);return _0x2d1ab6['set'](_0xdae8('0x22'),_0x1a7d42+'-'+_0x1b4225+'/'+_0x13e266)[_0xdae8('0x1d')](_0x5016af);}return null;};}function patchUpdates(_0x3413c2){return function(_0x57e69c){try{jsonpatch['apply'](_0x57e69c,_0x3413c2,!![]);}catch(_0x2d7030){return BPromise[_0xdae8('0x23')](_0x2d7030);}return _0x57e69c[_0xdae8('0x24')]();};}function saveUpdates(_0x2aa4ac,_0x55945e){return function(_0x1d8003){if(_0x1d8003){return _0x1d8003[_0xdae8('0x25')](_0x2aa4ac)[_0xdae8('0x26')](function(_0x4986dd){return _0x4986dd;});}return null;};}function removeEntity(_0x11a090,_0x1293c4){return function(_0x461ca3){if(_0x461ca3){return _0x461ca3['destroy']()[_0xdae8('0x26')](function(){_0x11a090[_0xdae8('0x1b')](0xcc)[_0xdae8('0x1c')]();});}};}function handleEntityNotFound(_0x2c3831,_0x38de0b){return function(_0xadd91f){if(!_0xadd91f){_0x2c3831[_0xdae8('0x27')](0x194);}return _0xadd91f;};}function handleError(_0x1be877,_0x1fa137){_0x1fa137=_0x1fa137||0x1f4;return function(_0x1ce801){logger[_0xdae8('0x28')](_0x1ce801[_0xdae8('0x29')]);if(_0x1ce801[_0xdae8('0x2a')]){delete _0x1ce801[_0xdae8('0x2a')];}_0x1be877[_0xdae8('0x1b')](_0x1fa137)[_0xdae8('0x2b')](_0x1ce801);};}exports[_0xdae8('0x2c')]=function(_0x3f9401,_0x447246){var _0x2076c2={},_0x582f3a={},_0x487d24={'count':0x0,'rows':[]};var _0x4010b4=_[_0xdae8('0x2d')](db[_0xdae8('0x2e')]['rawAttributes'],function(_0x168c47){return{'name':_0x168c47[_0xdae8('0x2f')],'type':_0x168c47['type'][_0xdae8('0x30')]};});_0x582f3a[_0xdae8('0x31')]=_['map'](_0x4010b4,'name');_0x582f3a[_0xdae8('0x32')]=_[_0xdae8('0x33')](_0x3f9401[_0xdae8('0x32')]);_0x582f3a['filters']=_['intersection'](_0x582f3a[_0xdae8('0x31')],_0x582f3a['query']);_0x2076c2[_0xdae8('0x34')]=_[_0xdae8('0x35')](_0x582f3a[_0xdae8('0x31')],qs['fields'](_0x3f9401['query'][_0xdae8('0x36')]));_0x2076c2[_0xdae8('0x34')]=_0x2076c2[_0xdae8('0x34')]['length']?_0x2076c2['attributes']:_0x582f3a[_0xdae8('0x31')];if(!_0x3f9401['query'][_0xdae8('0x37')](_0xdae8('0x38'))){_0x2076c2['limit']=qs['limit'](_0x3f9401[_0xdae8('0x32')][_0xdae8('0x20')]);_0x2076c2['offset']=qs[_0xdae8('0x1e')](_0x3f9401[_0xdae8('0x32')][_0xdae8('0x1e')]);}_0x2076c2['order']=qs[_0xdae8('0x39')](_0x3f9401[_0xdae8('0x32')]['sort']);_0x2076c2[_0xdae8('0x3a')]=qs[_0xdae8('0x3b')](_[_0xdae8('0x3c')](_0x3f9401[_0xdae8('0x32')],_0x582f3a[_0xdae8('0x3b')]),_0x4010b4);if(_0x3f9401['query'][_0xdae8('0x3d')]){_0x2076c2['where']=_[_0xdae8('0x3e')](_0x2076c2[_0xdae8('0x3a')],{'$or':_['map'](_0x4010b4,function(_0x3ae529){if(_0x3ae529['type']!==_0xdae8('0x3f')){var _0x13eaa9={};_0x13eaa9[_0x3ae529[_0xdae8('0x2a')]]={'$like':'%'+_0x3f9401['query'][_0xdae8('0x3d')]+'%'};return _0x13eaa9;}})});}_0x2076c2=_['merge']({},_0x2076c2,_0x3f9401[_0xdae8('0x40')]);var _0x381b8a={'where':_0x2076c2[_0xdae8('0x3a')]};return db[_0xdae8('0x2e')][_0xdae8('0x21')](_0x381b8a)[_0xdae8('0x26')](function(_0x2cd7cf){_0x487d24[_0xdae8('0x21')]=_0x2cd7cf;if(_0x3f9401[_0xdae8('0x32')][_0xdae8('0x41')]){_0x2076c2[_0xdae8('0x42')]=[{'all':!![]}];}return db[_0xdae8('0x2e')]['findAll'](_0x2076c2);})[_0xdae8('0x26')](function(_0x51caed){_0x487d24['rows']=_0x51caed;return _0x487d24;})[_0xdae8('0x26')](respondWithFilteredResult(_0x447246,_0x2076c2))[_0xdae8('0x43')](handleError(_0x447246,null));};exports[_0xdae8('0x44')]=function(_0x5cc52d,_0x1dabc5){var _0x313691={'raw':!![],'where':{'id':_0x5cc52d[_0xdae8('0x45')]['id']}},_0x2f8f69={};_0x2f8f69[_0xdae8('0x31')]=_[_0xdae8('0x33')](db[_0xdae8('0x2e')]['rawAttributes']);_0x2f8f69[_0xdae8('0x32')]=_[_0xdae8('0x33')](_0x5cc52d['query']);_0x2f8f69['filters']=_['intersection'](_0x2f8f69[_0xdae8('0x31')],_0x2f8f69['query']);_0x313691['attributes']=_[_0xdae8('0x35')](_0x2f8f69[_0xdae8('0x31')],qs['fields'](_0x5cc52d['query']['fields']));_0x313691[_0xdae8('0x34')]=_0x313691['attributes'][_0xdae8('0x46')]?_0x313691['attributes']:_0x2f8f69[_0xdae8('0x31')];if(_0x5cc52d[_0xdae8('0x32')][_0xdae8('0x41')]){_0x313691[_0xdae8('0x42')]=[{'all':!![]}];}_0x313691=_['merge']({},_0x313691,_0x5cc52d[_0xdae8('0x40')]);return db['ZendeskField']['find'](_0x313691)[_0xdae8('0x26')](handleEntityNotFound(_0x1dabc5,null))[_0xdae8('0x26')](respondWithResult(_0x1dabc5,null))['catch'](handleError(_0x1dabc5,null));};exports[_0xdae8('0x47')]=function(_0x4598f5,_0x1559fe){return db['ZendeskField'][_0xdae8('0x47')](_0x4598f5[_0xdae8('0x48')],{})[_0xdae8('0x26')](respondWithResult(_0x1559fe,0xc9))[_0xdae8('0x43')](handleError(_0x1559fe,null));};exports[_0xdae8('0x25')]=function(_0x2d0e50,_0x4ccaf9){if(_0x2d0e50[_0xdae8('0x48')]['id']){delete _0x2d0e50[_0xdae8('0x48')]['id'];}return db[_0xdae8('0x2e')][_0xdae8('0x49')]({'where':{'id':_0x2d0e50['params']['id']}})[_0xdae8('0x26')](handleEntityNotFound(_0x4ccaf9,null))['then'](saveUpdates(_0x2d0e50[_0xdae8('0x48')],null))['then'](respondWithResult(_0x4ccaf9,null))[_0xdae8('0x43')](handleError(_0x4ccaf9,null));};exports[_0xdae8('0x4a')]=function(_0x3f13a9,_0x596663){return db[_0xdae8('0x2e')][_0xdae8('0x49')]({'where':{'id':_0x3f13a9[_0xdae8('0x45')]['id']}})[_0xdae8('0x26')](handleEntityNotFound(_0x596663,null))['then'](removeEntity(_0x596663,null))[_0xdae8('0x43')](handleError(_0x596663,null));}; \ No newline at end of file +var _0x4c68=['limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','ZendeskField','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','map','count','includeAll','include','rows','catch','show','keys','rawAttributes','options','find','body','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined'];(function(_0x5e0149,_0x4e9ed1){var _0x32a40a=function(_0x4b8125){while(--_0x4b8125){_0x5e0149['push'](_0x5e0149['shift']());}};_0x32a40a(++_0x4e9ed1);}(_0x4c68,0x198));var _0x84c6=function(_0x4f5e67,_0x163a00){_0x4f5e67=_0x4f5e67-0x0;var _0xa8e9dc=_0x4c68[_0x4f5e67];return _0xa8e9dc;};'use strict';var emlformat=require(_0x84c6('0x0'));var rimraf=require(_0x84c6('0x1'));var zipdir=require(_0x84c6('0x2'));var jsonpatch=require(_0x84c6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x84c6('0x4'));var Mustache=require('mustache');var util=require(_0x84c6('0x5'));var path=require(_0x84c6('0x6'));var sox=require(_0x84c6('0x7'));var csv=require('to-csv');var ejs=require(_0x84c6('0x8'));var fs=require('fs');var fs_extra=require(_0x84c6('0x9'));var _=require(_0x84c6('0xa'));var squel=require(_0x84c6('0xb'));var crypto=require(_0x84c6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x84c6('0xd'));var toCsv=require(_0x84c6('0xe'));var querystring=require('querystring');var Papa=require(_0x84c6('0xf'));var Redis=require(_0x84c6('0x10'));var authService=require(_0x84c6('0x11'));var qs=require(_0x84c6('0x12'));var as=require(_0x84c6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84c6('0x14'))('api');var utils=require(_0x84c6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x84c6('0x16'));var db=require(_0x84c6('0x17'))['db'];function respondWithStatusCode(_0x28aaed,_0x8c99ca){_0x8c99ca=_0x8c99ca||0xcc;return function(_0x46ed73){if(_0x46ed73){return _0x28aaed[_0x84c6('0x18')](_0x8c99ca);}return _0x28aaed['status'](_0x8c99ca)[_0x84c6('0x19')]();};}function respondWithResult(_0x3f9902,_0x3a6b46){_0x3a6b46=_0x3a6b46||0xc8;return function(_0x5ab0ce){if(_0x5ab0ce){return _0x3f9902[_0x84c6('0x1a')](_0x3a6b46)[_0x84c6('0x1b')](_0x5ab0ce);}};}function respondWithFilteredResult(_0x52af32,_0x1b980b){return function(_0x995c7b){if(_0x995c7b){var _0x3dd0a1=typeof _0x1b980b[_0x84c6('0x1c')]===_0x84c6('0x1d')&&typeof _0x1b980b[_0x84c6('0x1e')]==='undefined';var _0x48330a=_0x995c7b['count'];var _0x1a78f6=_0x3dd0a1?0x0:_0x1b980b[_0x84c6('0x1c')];var _0x2592db=_0x3dd0a1?_0x995c7b['count']:_0x1b980b[_0x84c6('0x1c')]+_0x1b980b[_0x84c6('0x1e')];var _0x37362b;if(_0x2592db>=_0x48330a){_0x2592db=_0x48330a;_0x37362b=0xc8;}else{_0x37362b=0xce;}_0x52af32['status'](_0x37362b);return _0x52af32[_0x84c6('0x1f')](_0x84c6('0x20'),_0x1a78f6+'-'+_0x2592db+'/'+_0x48330a)[_0x84c6('0x1b')](_0x995c7b);}return null;};}function patchUpdates(_0x267a6d){return function(_0x418486){try{jsonpatch[_0x84c6('0x21')](_0x418486,_0x267a6d,!![]);}catch(_0x3b6cb8){return BPromise[_0x84c6('0x22')](_0x3b6cb8);}return _0x418486[_0x84c6('0x23')]();};}function saveUpdates(_0x32d12f,_0x425ed6){return function(_0x2715bd){if(_0x2715bd){return _0x2715bd[_0x84c6('0x24')](_0x32d12f)[_0x84c6('0x25')](function(_0x41cf39){return _0x41cf39;});}return null;};}function removeEntity(_0x3090dd,_0x22a4c0){return function(_0xd1139b){if(_0xd1139b){return _0xd1139b[_0x84c6('0x26')]()['then'](function(){_0x3090dd[_0x84c6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x470fcd,_0x1bf39d){return function(_0x5ca3a0){if(!_0x5ca3a0){_0x470fcd[_0x84c6('0x18')](0x194);}return _0x5ca3a0;};}function handleError(_0x2a73d4,_0x2c29b0){_0x2c29b0=_0x2c29b0||0x1f4;return function(_0x126a75){logger[_0x84c6('0x27')](_0x126a75['stack']);if(_0x126a75[_0x84c6('0x28')]){delete _0x126a75[_0x84c6('0x28')];}_0x2a73d4[_0x84c6('0x1a')](_0x2c29b0)['send'](_0x126a75);};}exports[_0x84c6('0x29')]=function(_0x490023,_0x48c90c){var _0x1b155e={},_0x2ade17={},_0x666f77={'count':0x0,'rows':[]};var _0x2a7362=_['map'](db[_0x84c6('0x2a')]['rawAttributes'],function(_0x2601fc){return{'name':_0x2601fc[_0x84c6('0x2b')],'type':_0x2601fc[_0x84c6('0x2c')][_0x84c6('0x2d')]};});_0x2ade17['model']=_['map'](_0x2a7362,_0x84c6('0x28'));_0x2ade17['query']=_['keys'](_0x490023[_0x84c6('0x2e')]);_0x2ade17[_0x84c6('0x2f')]=_[_0x84c6('0x30')](_0x2ade17[_0x84c6('0x31')],_0x2ade17[_0x84c6('0x2e')]);_0x1b155e[_0x84c6('0x32')]=_['intersection'](_0x2ade17['model'],qs[_0x84c6('0x33')](_0x490023[_0x84c6('0x2e')]['fields']));_0x1b155e[_0x84c6('0x32')]=_0x1b155e[_0x84c6('0x32')][_0x84c6('0x34')]?_0x1b155e[_0x84c6('0x32')]:_0x2ade17[_0x84c6('0x31')];if(!_0x490023[_0x84c6('0x2e')][_0x84c6('0x35')]('nolimit')){_0x1b155e[_0x84c6('0x1e')]=qs[_0x84c6('0x1e')](_0x490023[_0x84c6('0x2e')][_0x84c6('0x1e')]);_0x1b155e[_0x84c6('0x1c')]=qs[_0x84c6('0x1c')](_0x490023[_0x84c6('0x2e')][_0x84c6('0x1c')]);}_0x1b155e[_0x84c6('0x36')]=qs[_0x84c6('0x37')](_0x490023[_0x84c6('0x2e')][_0x84c6('0x37')]);_0x1b155e['where']=qs[_0x84c6('0x2f')](_[_0x84c6('0x38')](_0x490023[_0x84c6('0x2e')],_0x2ade17[_0x84c6('0x2f')]),_0x2a7362);if(_0x490023['query'][_0x84c6('0x39')]){_0x1b155e['where']=_[_0x84c6('0x3a')](_0x1b155e[_0x84c6('0x3b')],{'$or':_[_0x84c6('0x3c')](_0x2a7362,function(_0x53b636){if(_0x53b636[_0x84c6('0x2c')]!=='VIRTUAL'){var _0x258a03={};_0x258a03[_0x53b636[_0x84c6('0x28')]]={'$like':'%'+_0x490023[_0x84c6('0x2e')][_0x84c6('0x39')]+'%'};return _0x258a03;}})});}_0x1b155e=_[_0x84c6('0x3a')]({},_0x1b155e,_0x490023['options']);var _0x5e0124={'where':_0x1b155e['where']};return db[_0x84c6('0x2a')][_0x84c6('0x3d')](_0x5e0124)[_0x84c6('0x25')](function(_0x2cc9f2){_0x666f77[_0x84c6('0x3d')]=_0x2cc9f2;if(_0x490023[_0x84c6('0x2e')][_0x84c6('0x3e')]){_0x1b155e[_0x84c6('0x3f')]=[{'all':!![]}];}return db[_0x84c6('0x2a')]['findAll'](_0x1b155e);})[_0x84c6('0x25')](function(_0x117544){_0x666f77[_0x84c6('0x40')]=_0x117544;return _0x666f77;})[_0x84c6('0x25')](respondWithFilteredResult(_0x48c90c,_0x1b155e))[_0x84c6('0x41')](handleError(_0x48c90c,null));};exports[_0x84c6('0x42')]=function(_0x17468f,_0x48809e){var _0x20aa40={'raw':!![],'where':{'id':_0x17468f['params']['id']}},_0x719ef3={};_0x719ef3['model']=_[_0x84c6('0x43')](db[_0x84c6('0x2a')][_0x84c6('0x44')]);_0x719ef3[_0x84c6('0x2e')]=_['keys'](_0x17468f[_0x84c6('0x2e')]);_0x719ef3[_0x84c6('0x2f')]=_[_0x84c6('0x30')](_0x719ef3[_0x84c6('0x31')],_0x719ef3[_0x84c6('0x2e')]);_0x20aa40[_0x84c6('0x32')]=_[_0x84c6('0x30')](_0x719ef3[_0x84c6('0x31')],qs[_0x84c6('0x33')](_0x17468f[_0x84c6('0x2e')][_0x84c6('0x33')]));_0x20aa40['attributes']=_0x20aa40[_0x84c6('0x32')][_0x84c6('0x34')]?_0x20aa40[_0x84c6('0x32')]:_0x719ef3['model'];if(_0x17468f[_0x84c6('0x2e')]['includeAll']){_0x20aa40[_0x84c6('0x3f')]=[{'all':!![]}];}_0x20aa40=_[_0x84c6('0x3a')]({},_0x20aa40,_0x17468f[_0x84c6('0x45')]);return db[_0x84c6('0x2a')][_0x84c6('0x46')](_0x20aa40)['then'](handleEntityNotFound(_0x48809e,null))['then'](respondWithResult(_0x48809e,null))[_0x84c6('0x41')](handleError(_0x48809e,null));};exports['create']=function(_0x143a37,_0x364564){return db[_0x84c6('0x2a')]['create'](_0x143a37[_0x84c6('0x47')],{})[_0x84c6('0x25')](respondWithResult(_0x364564,0xc9))[_0x84c6('0x41')](handleError(_0x364564,null));};exports[_0x84c6('0x24')]=function(_0x8738d3,_0x359295){if(_0x8738d3[_0x84c6('0x47')]['id']){delete _0x8738d3['body']['id'];}return db['ZendeskField']['find']({'where':{'id':_0x8738d3[_0x84c6('0x48')]['id']}})[_0x84c6('0x25')](handleEntityNotFound(_0x359295,null))[_0x84c6('0x25')](saveUpdates(_0x8738d3[_0x84c6('0x47')],null))[_0x84c6('0x25')](respondWithResult(_0x359295,null))[_0x84c6('0x41')](handleError(_0x359295,null));};exports['destroy']=function(_0x3dd605,_0x299a15){return db[_0x84c6('0x2a')][_0x84c6('0x46')]({'where':{'id':_0x3dd605['params']['id']}})['then'](handleEntityNotFound(_0x299a15,null))[_0x84c6('0x25')](removeEntity(_0x299a15,null))[_0x84c6('0x41')](handleError(_0x299a15,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 3690b88..5f96431 100644 --- a/server/api/intZendeskField/intZendeskField.model.js +++ b/server/api/intZendeskField/intZendeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0531=['ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes'];(function(_0x5f416b,_0x2d8810){var _0x14c815=function(_0x1fd5d2){while(--_0x1fd5d2){_0x5f416b['push'](_0x5f416b['shift']());}};_0x14c815(++_0x2d8810);}(_0x0531,0x93));var _0x1053=function(_0x3a19d4,_0x3f19a4){_0x3a19d4=_0x3a19d4-0x0;var _0x5b858b=_0x0531[_0x3a19d4];return _0x5b858b;};'use strict';var _=require(_0x1053('0x0'));var util=require(_0x1053('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1053('0x2'));var BPromise=require(_0x1053('0x3'));var rp=require(_0x1053('0x4'));var fs=require('fs');var path=require(_0x1053('0x5'));var rimraf=require(_0x1053('0x6'));var config=require(_0x1053('0x7'));var attributes=require(_0x1053('0x8'));module['exports']=function(_0x2d87e5,_0x318ddb){return _0x2d87e5['define'](_0x1053('0x9'),attributes,{'tableName':_0x1053('0xa'),'paranoid':![],'indexes':[{'name':_0x1053('0xb'),'fields':['idField',_0x1053('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb626=['moment','bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','util','../../config/logger'];(function(_0x485460,_0x54528e){var _0x4db47a=function(_0x553f03){while(--_0x553f03){_0x485460['push'](_0x485460['shift']());}};_0x4db47a(++_0x54528e);}(_0xb626,0x14d));var _0x6b62=function(_0x32161b,_0x3180c0){_0x32161b=_0x32161b-0x0;var _0x5f7598=_0xb626[_0x32161b];return _0x5f7598;};'use strict';var _=require(_0x6b62('0x0'));var util=require(_0x6b62('0x1'));var logger=require(_0x6b62('0x2'))('api');var moment=require(_0x6b62('0x3'));var BPromise=require(_0x6b62('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b62('0x5'));var rimraf=require(_0x6b62('0x6'));var config=require(_0x6b62('0x7'));var attributes=require(_0x6b62('0x8'));module[_0x6b62('0x9')]=function(_0x4f317b,_0x983955){return _0x4f317b[_0x6b62('0xa')]('ZendeskField',attributes,{'tableName':_0x6b62('0xb'),'paranoid':![],'indexes':[{'name':_0x6b62('0xc'),'fields':['idField',_0x6b62('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 2e84037..6f10348 100644 --- a/server/api/intZendeskField/intZendeskField.rpc.js +++ b/server/api/intZendeskField/intZendeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3be=['message','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x2e8909,_0x224f3e){var _0x25b3c3=function(_0x27b2dd){while(--_0x27b2dd){_0x2e8909['push'](_0x2e8909['shift']());}};_0x25b3c3(++_0x224f3e);}(_0xe3be,0x1e3));var _0xee3b=function(_0x415704,_0x541d05){_0x415704=_0x415704-0x0;var _0x4e3047=_0xe3be[_0x415704];return _0x4e3047;};'use strict';var _=require('lodash');var util=require(_0xee3b('0x0'));var moment=require('moment');var BPromise=require(_0xee3b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee3b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xee3b('0x3'));var logger=require(_0xee3b('0x4'))(_0xee3b('0x5'));var config=require(_0xee3b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xee3b('0x7')][_0xee3b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa4ac5d,_0x359307,_0x3a2b2d){return new BPromise(function(_0x4454e9,_0x8cc8f9){return client[_0xee3b('0x9')](_0xa4ac5d,_0x3a2b2d)[_0xee3b('0xa')](function(_0x5be974){logger[_0xee3b('0xb')](_0xee3b('0xc'),_0x359307,_0xee3b('0xd'));logger[_0xee3b('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x359307,_0xee3b('0xd'),JSON[_0xee3b('0xf')](_0x5be974));if(_0x5be974[_0xee3b('0x10')]){if(_0x5be974['error']['code']===0x1f4){logger[_0xee3b('0x10')](_0xee3b('0xc'),_0x359307,_0x5be974[_0xee3b('0x10')][_0xee3b('0x11')]);return _0x8cc8f9(_0x5be974[_0xee3b('0x10')][_0xee3b('0x11')]);}logger['error'](_0xee3b('0xc'),_0x359307,_0x5be974[_0xee3b('0x10')][_0xee3b('0x11')]);return _0x4454e9(_0x5be974['error'][_0xee3b('0x11')]);}else{logger[_0xee3b('0xb')](_0xee3b('0xc'),_0x359307,_0xee3b('0xd'));_0x4454e9(_0x5be974[_0xee3b('0x12')][_0xee3b('0x11')]);}})[_0xee3b('0x13')](function(_0x1720e0){logger[_0xee3b('0x10')](_0xee3b('0xc'),_0x359307,_0x1720e0);_0x8cc8f9(_0x1720e0);});});} \ No newline at end of file +var _0x602b=['request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ZendeskField,\x20%s,\x20%s'];(function(_0x4c2302,_0x367bbb){var _0x20996d=function(_0x29aa94){while(--_0x29aa94){_0x4c2302['push'](_0x4c2302['shift']());}};_0x20996d(++_0x367bbb);}(_0x602b,0x170));var _0xb602=function(_0x183c46,_0x21ce0b){_0x183c46=_0x183c46-0x0;var _0x2bb36a=_0x602b[_0x183c46];return _0x2bb36a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb602('0x0'));var BPromise=require(_0xb602('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb602('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb602('0x3'));var logger=require(_0xb602('0x4'))('rpc');var config=require(_0xb602('0x5'));var jayson=require(_0xb602('0x6'));var client=jayson[_0xb602('0x7')][_0xb602('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23d2fd,_0x19da66,_0x5c0adb){return new BPromise(function(_0x42f7f1,_0x3905ad){return client['request'](_0x23d2fd,_0x5c0adb)[_0xb602('0x9')](function(_0x4e479a){logger[_0xb602('0xa')](_0xb602('0xb'),_0x19da66,_0xb602('0xc'));logger[_0xb602('0xd')](_0xb602('0xe'),_0x19da66,_0xb602('0xc'),JSON[_0xb602('0xf')](_0x4e479a));if(_0x4e479a['error']){if(_0x4e479a[_0xb602('0x10')][_0xb602('0x11')]===0x1f4){logger[_0xb602('0x10')]('ZendeskField,\x20%s,\x20%s',_0x19da66,_0x4e479a[_0xb602('0x10')]['message']);return _0x3905ad(_0x4e479a[_0xb602('0x10')][_0xb602('0x12')]);}logger[_0xb602('0x10')](_0xb602('0xb'),_0x19da66,_0x4e479a[_0xb602('0x10')][_0xb602('0x12')]);return _0x42f7f1(_0x4e479a[_0xb602('0x10')]['message']);}else{logger[_0xb602('0xa')]('ZendeskField,\x20%s,\x20%s',_0x19da66,'request\x20sent');_0x42f7f1(_0x4e479a['result'][_0xb602('0x12')]);}})[_0xb602('0x13')](function(_0x45f6dd){logger[_0xb602('0x10')](_0xb602('0xb'),_0x19da66,_0x45f6dd);_0x3905ad(_0x45f6dd);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index d3f76ef..f9e5825 100644 --- a/server/api/intZohoAccount/index.js +++ b/server/api/intZohoAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9655=['post','create','addConfiguration','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','/:id','show','get','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x371d83,_0xda8af3){var _0xd33c14=function(_0x42ae77){while(--_0x42ae77){_0x371d83['push'](_0x371d83['shift']());}};_0xd33c14(++_0xda8af3);}(_0x9655,0x10f));var _0x5965=function(_0x3a913b,_0x247a82){_0x3a913b=_0x3a913b-0x0;var _0x48f063=_0x9655[_0x3a913b];return _0x48f063;};'use strict';var multer=require(_0x5965('0x0'));var util=require(_0x5965('0x1'));var path=require(_0x5965('0x2'));var timeout=require('connect-timeout');var express=require(_0x5965('0x3'));var router=express['Router']();var fs_extra=require(_0x5965('0x4'));var auth=require(_0x5965('0x5'));var interaction=require(_0x5965('0x6'));var config=require(_0x5965('0x7'));var controller=require(_0x5965('0x8'));router['get']('/',auth[_0x5965('0x9')](),controller[_0x5965('0xa')]);router['get'](_0x5965('0xb'),auth[_0x5965('0x9')](),controller[_0x5965('0xc')]);router[_0x5965('0xd')](_0x5965('0xe'),auth[_0x5965('0x9')](),controller[_0x5965('0xf')]);router[_0x5965('0xd')](_0x5965('0x10'),auth['isAuthenticated'](),controller['getFields']);router[_0x5965('0x11')]('/',auth['isAuthenticated'](),controller[_0x5965('0x12')]);router[_0x5965('0x11')](_0x5965('0xe'),auth[_0x5965('0x9')](),controller[_0x5965('0x13')]);router['put']('/:id',auth[_0x5965('0x9')](),controller[_0x5965('0x14')]);router[_0x5965('0x15')]('/:id',auth[_0x5965('0x9')](),controller[_0x5965('0x16')]);module[_0x5965('0x17')]=router; \ No newline at end of file +var _0xa917=['get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','create','post','addConfiguration','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller'];(function(_0x4c6e97,_0xffe729){var _0x188948=function(_0x36d2bc){while(--_0x36d2bc){_0x4c6e97['push'](_0x4c6e97['shift']());}};_0x188948(++_0xffe729);}(_0xa917,0x168));var _0x7a91=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xa917[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x7a91('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7a91('0x1'));var express=require(_0x7a91('0x2'));var router=express[_0x7a91('0x3')]();var fs_extra=require(_0x7a91('0x4'));var auth=require(_0x7a91('0x5'));var interaction=require(_0x7a91('0x6'));var config=require('../../config/environment');var controller=require(_0x7a91('0x7'));router[_0x7a91('0x8')]('/',auth[_0x7a91('0x9')](),controller[_0x7a91('0xa')]);router[_0x7a91('0x8')](_0x7a91('0xb'),auth[_0x7a91('0x9')](),controller[_0x7a91('0xc')]);router[_0x7a91('0x8')](_0x7a91('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x7a91('0xe'),auth[_0x7a91('0x9')](),controller['getFields']);router['post']('/',auth[_0x7a91('0x9')](),controller[_0x7a91('0xf')]);router[_0x7a91('0x10')](_0x7a91('0xd'),auth['isAuthenticated'](),controller[_0x7a91('0x11')]);router[_0x7a91('0x12')](_0x7a91('0xb'),auth[_0x7a91('0x9')](),controller[_0x7a91('0x13')]);router[_0x7a91('0x14')](_0x7a91('0xb'),auth[_0x7a91('0x9')](),controller[_0x7a91('0x15')]);module[_0x7a91('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 9c96b82..d5bd614 100644 --- a/server/api/intZohoAccount/intZohoAccount.attributes.js +++ b/server/api/intZohoAccount/intZohoAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa88=['exports','STRING','sequelize'];(function(_0x23863e,_0x31f426){var _0x1620ed=function(_0x1d6a71){while(--_0x1d6a71){_0x23863e['push'](_0x23863e['shift']());}};_0x1620ed(++_0x31f426);}(_0xaa88,0x137));var _0x8aa8=function(_0x3f465d,_0xbd2037){_0x3f465d=_0x3f465d-0x0;var _0x121ad1=_0xaa88[_0x3f465d];return _0x121ad1;};'use strict';var Sequelize=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]={'name':{'type':Sequelize[_0x8aa8('0x2')]},'description':{'type':Sequelize[_0x8aa8('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x8aa8('0x2')]},'clientId':{'type':Sequelize[_0x8aa8('0x2')]},'clientSecret':{'type':Sequelize[_0x8aa8('0x2')]},'serverUrl':{'type':Sequelize[_0x8aa8('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x8aa8('0x2')]},'refreshToken':{'type':Sequelize[_0x8aa8('0x2')]}}; \ No newline at end of file +var _0xcb91=['STRING'];(function(_0x574313,_0x2e9363){var _0x36116c=function(_0x43617a){while(--_0x43617a){_0x574313['push'](_0x574313['shift']());}};_0x36116c(++_0x2e9363);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xcb91[_0x4c440b];return _0x2d48cf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1cb9('0x0')]},'description':{'type':Sequelize[_0x1cb9('0x0')]},'host':{'type':Sequelize[_0x1cb9('0x0')]},'zone':{'type':Sequelize[_0x1cb9('0x0')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x1cb9('0x0')]},'serverUrl':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x1cb9('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 90d86f6..276369d 100644 --- a/server/api/intZohoAccount/intZohoAccount.controller.js +++ b/server/api/intZohoAccount/intZohoAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d4f=['format','response','message','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','display_label','custom_field','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','count','Content-Range','json','apply','save','destroy','error','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','ZohoAccount','includeAll','include','findAll','then','rows','catch','show','params','create','body','update','find','getConfigurations','ZohoConfiguration','addConfiguration','findOne','channel','getDescriptions','ZohoField','Descriptions','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','serverUrl','code','zoho.eu','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x0d4f,0x112));var _0xf0d4=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x0d4f[_0x5c3c0b];return _0x52ecd2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf0d4('0x0'));var zipdir=require(_0xf0d4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf0d4('0x2'));var moment=require(_0xf0d4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf0d4('0x4'));var util=require(_0xf0d4('0x5'));var path=require(_0xf0d4('0x6'));var sox=require(_0xf0d4('0x7'));var csv=require(_0xf0d4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf0d4('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf0d4('0xa'));var deskjs=require(_0xf0d4('0xb'));var toCsv=require(_0xf0d4('0x8'));var querystring=require(_0xf0d4('0xc'));var Papa=require(_0xf0d4('0xd'));var Redis=require(_0xf0d4('0xe'));var authService=require(_0xf0d4('0xf'));var qs=require(_0xf0d4('0x10'));var as=require(_0xf0d4('0x11'));var hardwareService=require(_0xf0d4('0x12'));var logger=require('../../config/logger')(_0xf0d4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf0d4('0x14'));var db=require(_0xf0d4('0x15'))['db'];var integrations=require(_0xf0d4('0x16'));function respondWithStatusCode(_0x10b42f,_0x1903e4){_0x1903e4=_0x1903e4||0xcc;return function(_0x4496ba){if(_0x4496ba){return _0x10b42f[_0xf0d4('0x17')](_0x1903e4);}return _0x10b42f[_0xf0d4('0x18')](_0x1903e4)[_0xf0d4('0x19')]();};}function respondWithResult(_0x1f6526,_0x44e234){_0x44e234=_0x44e234||0xc8;return function(_0x2dca92){if(_0x2dca92){return _0x1f6526['status'](_0x44e234)['json'](_0x2dca92);}};}function respondWithFilteredResult(_0x12c821,_0x426144){return function(_0x39a04e){if(_0x39a04e){var _0x3dbd6e=typeof _0x426144[_0xf0d4('0x1a')]==='undefined'&&typeof _0x426144[_0xf0d4('0x1b')]==='undefined';var _0x5dcc73=_0x39a04e[_0xf0d4('0x1c')];var _0x44a4a6=_0x3dbd6e?0x0:_0x426144['offset'];var _0x53da97=_0x3dbd6e?_0x39a04e[_0xf0d4('0x1c')]:_0x426144[_0xf0d4('0x1a')]+_0x426144['limit'];var _0x2f285c;if(_0x53da97>=_0x5dcc73){_0x53da97=_0x5dcc73;_0x2f285c=0xc8;}else{_0x2f285c=0xce;}_0x12c821[_0xf0d4('0x18')](_0x2f285c);return _0x12c821['set'](_0xf0d4('0x1d'),_0x44a4a6+'-'+_0x53da97+'/'+_0x5dcc73)[_0xf0d4('0x1e')](_0x39a04e);}return null;};}function patchUpdates(_0x19aa0a){return function(_0x22a398){try{jsonpatch[_0xf0d4('0x1f')](_0x22a398,_0x19aa0a,!![]);}catch(_0x26dede){return BPromise['reject'](_0x26dede);}return _0x22a398[_0xf0d4('0x20')]();};}function saveUpdates(_0x5cf7ca,_0x104b89){return function(_0x274f5e){if(_0x274f5e){return _0x274f5e['update'](_0x5cf7ca)['then'](function(_0x35e5d0){return _0x35e5d0;});}return null;};}function removeEntity(_0x1f0fd0,_0x2f5744){return function(_0x44d629){if(_0x44d629){return _0x44d629[_0xf0d4('0x21')]()['then'](function(){_0x1f0fd0[_0xf0d4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b698c,_0x552b4c){return function(_0x3b90da){if(!_0x3b90da){_0x5b698c[_0xf0d4('0x17')](0x194);}return _0x3b90da;};}function handleError(_0x33fb7a,_0x556ef6){_0x556ef6=_0x556ef6||0x1f4;return function(_0x3f23bc){logger[_0xf0d4('0x22')](_0x3f23bc['stack']);if(_0x3f23bc[_0xf0d4('0x23')]){delete _0x3f23bc[_0xf0d4('0x23')];}_0x33fb7a[_0xf0d4('0x18')](_0x556ef6)['send'](_0x3f23bc);};}exports[_0xf0d4('0x24')]=function(_0xed741e,_0x5cb6d4){var _0x255f5f={},_0x448339={},_0x72958a={'count':0x0,'rows':[]};var _0x36dfde=_[_0xf0d4('0x25')](db['ZohoAccount'][_0xf0d4('0x26')],function(_0x5a41e3){return{'name':_0x5a41e3[_0xf0d4('0x27')],'type':_0x5a41e3[_0xf0d4('0x28')][_0xf0d4('0x29')]};});_0x448339['model']=_[_0xf0d4('0x25')](_0x36dfde,_0xf0d4('0x23'));_0x448339[_0xf0d4('0x2a')]=_[_0xf0d4('0x2b')](_0xed741e[_0xf0d4('0x2a')]);_0x448339[_0xf0d4('0x2c')]=_['intersection'](_0x448339[_0xf0d4('0x2d')],_0x448339[_0xf0d4('0x2a')]);_0x255f5f[_0xf0d4('0x2e')]=_[_0xf0d4('0x2f')](_0x448339['model'],qs[_0xf0d4('0x30')](_0xed741e[_0xf0d4('0x2a')][_0xf0d4('0x30')]));_0x255f5f[_0xf0d4('0x2e')]=_0x255f5f[_0xf0d4('0x2e')][_0xf0d4('0x31')]?_0x255f5f['attributes']:_0x448339[_0xf0d4('0x2d')];if(!_0xed741e[_0xf0d4('0x2a')][_0xf0d4('0x32')](_0xf0d4('0x33'))){_0x255f5f['limit']=qs[_0xf0d4('0x1b')](_0xed741e[_0xf0d4('0x2a')][_0xf0d4('0x1b')]);_0x255f5f[_0xf0d4('0x1a')]=qs['offset'](_0xed741e[_0xf0d4('0x2a')][_0xf0d4('0x1a')]);}_0x255f5f[_0xf0d4('0x34')]=qs[_0xf0d4('0x35')](_0xed741e[_0xf0d4('0x2a')][_0xf0d4('0x35')]);_0x255f5f[_0xf0d4('0x36')]=qs[_0xf0d4('0x2c')](_[_0xf0d4('0x37')](_0xed741e['query'],_0x448339[_0xf0d4('0x2c')]),_0x36dfde);if(_0xed741e[_0xf0d4('0x2a')]['filter']){_0x255f5f['where']=_['merge'](_0x255f5f[_0xf0d4('0x36')],{'$or':_['map'](_0x36dfde,function(_0x27e536){if(_0x27e536[_0xf0d4('0x28')]!==_0xf0d4('0x38')){var _0x45b2b7={};_0x45b2b7[_0x27e536[_0xf0d4('0x23')]]={'$like':'%'+_0xed741e['query'][_0xf0d4('0x39')]+'%'};return _0x45b2b7;}})});}_0x255f5f=_[_0xf0d4('0x3a')]({},_0x255f5f,_0xed741e[_0xf0d4('0x3b')]);var _0x503535={'where':_0x255f5f[_0xf0d4('0x36')]};return db[_0xf0d4('0x3c')][_0xf0d4('0x1c')](_0x503535)['then'](function(_0x434eb5){_0x72958a[_0xf0d4('0x1c')]=_0x434eb5;if(_0xed741e[_0xf0d4('0x2a')][_0xf0d4('0x3d')]){_0x255f5f[_0xf0d4('0x3e')]=[{'all':!![]}];}return db[_0xf0d4('0x3c')][_0xf0d4('0x3f')](_0x255f5f);})[_0xf0d4('0x40')](function(_0x2e31a8){_0x72958a[_0xf0d4('0x41')]=_0x2e31a8;return _0x72958a;})['then'](respondWithFilteredResult(_0x5cb6d4,_0x255f5f))[_0xf0d4('0x42')](handleError(_0x5cb6d4,null));};exports[_0xf0d4('0x43')]=function(_0x5d824e,_0x3139e4){var _0xb0935={'raw':![],'where':{'id':_0x5d824e[_0xf0d4('0x44')]['id']}},_0x289e26={};_0x289e26['model']=_['keys'](db[_0xf0d4('0x3c')][_0xf0d4('0x26')]);_0x289e26[_0xf0d4('0x2a')]=_[_0xf0d4('0x2b')](_0x5d824e[_0xf0d4('0x2a')]);_0x289e26['filters']=_[_0xf0d4('0x2f')](_0x289e26[_0xf0d4('0x2d')],_0x289e26['query']);_0xb0935[_0xf0d4('0x2e')]=_[_0xf0d4('0x2f')](_0x289e26[_0xf0d4('0x2d')],qs['fields'](_0x5d824e[_0xf0d4('0x2a')][_0xf0d4('0x30')]));_0xb0935['attributes']=_0xb0935[_0xf0d4('0x2e')][_0xf0d4('0x31')]?_0xb0935['attributes']:_0x289e26['model'];if(_0x5d824e[_0xf0d4('0x2a')][_0xf0d4('0x3d')]){_0xb0935['include']=[{'all':!![]}];}_0xb0935=_['merge']({},_0xb0935,_0x5d824e[_0xf0d4('0x3b')]);return db[_0xf0d4('0x3c')]['find'](_0xb0935)[_0xf0d4('0x40')](handleEntityNotFound(_0x3139e4,null))['then'](respondWithResult(_0x3139e4,null))[_0xf0d4('0x42')](handleError(_0x3139e4,null));};exports[_0xf0d4('0x45')]=function(_0x4d322b,_0x5c853e){return db[_0xf0d4('0x3c')][_0xf0d4('0x45')](_0x4d322b[_0xf0d4('0x46')],{})[_0xf0d4('0x40')](respondWithResult(_0x5c853e,0xc9))[_0xf0d4('0x42')](handleError(_0x5c853e,null));};exports[_0xf0d4('0x47')]=function(_0x33bff9,_0x2d9866){if(_0x33bff9[_0xf0d4('0x46')]['id']){delete _0x33bff9[_0xf0d4('0x46')]['id'];}return db[_0xf0d4('0x3c')][_0xf0d4('0x48')]({'where':{'id':_0x33bff9[_0xf0d4('0x44')]['id']}})[_0xf0d4('0x40')](handleEntityNotFound(_0x2d9866,null))[_0xf0d4('0x40')](saveUpdates(_0x33bff9[_0xf0d4('0x46')],null))[_0xf0d4('0x40')](respondWithResult(_0x2d9866,null))[_0xf0d4('0x42')](handleError(_0x2d9866,null));};exports['destroy']=function(_0x49b967,_0x513ad5){return db['ZohoAccount'][_0xf0d4('0x48')]({'where':{'id':_0x49b967[_0xf0d4('0x44')]['id']}})[_0xf0d4('0x40')](handleEntityNotFound(_0x513ad5,null))[_0xf0d4('0x40')](removeEntity(_0x513ad5,null))[_0xf0d4('0x42')](handleError(_0x513ad5,null));};exports[_0xf0d4('0x49')]=function(_0x9f0967,_0xfdb099,_0x581517){var _0x3e86da={};var _0x5b1c5={};var _0x3c49e2;var _0xce39c;return db[_0xf0d4('0x3c')]['findOne']({'where':{'id':_0x9f0967[_0xf0d4('0x44')]['id']}})['then'](handleEntityNotFound(_0xfdb099,null))[_0xf0d4('0x40')](function(_0x23fa89){if(_0x23fa89){_0x3c49e2=_0x23fa89;_0x5b1c5['model']=_[_0xf0d4('0x2b')](db[_0xf0d4('0x4a')][_0xf0d4('0x26')]);_0x5b1c5[_0xf0d4('0x2a')]=_[_0xf0d4('0x2b')](_0x9f0967[_0xf0d4('0x2a')]);_0x5b1c5[_0xf0d4('0x2c')]=_['intersection'](_0x5b1c5[_0xf0d4('0x2d')],_0x5b1c5[_0xf0d4('0x2a')]);_0x3e86da[_0xf0d4('0x2e')]=_[_0xf0d4('0x2f')](_0x5b1c5[_0xf0d4('0x2d')],qs['fields'](_0x9f0967['query'][_0xf0d4('0x30')]));_0x3e86da[_0xf0d4('0x2e')]=_0x3e86da['attributes'][_0xf0d4('0x31')]?_0x3e86da[_0xf0d4('0x2e')]:_0x5b1c5[_0xf0d4('0x2d')];_0x3e86da[_0xf0d4('0x34')]=qs[_0xf0d4('0x35')](_0x9f0967[_0xf0d4('0x2a')][_0xf0d4('0x35')]);_0x3e86da['where']=qs[_0xf0d4('0x2c')](_['pick'](_0x9f0967[_0xf0d4('0x2a')],_0x5b1c5[_0xf0d4('0x2c')]));if(_0x9f0967[_0xf0d4('0x2a')]['filter']){_0x3e86da[_0xf0d4('0x36')]=_['merge'](_0x3e86da['where'],{'$or':_[_0xf0d4('0x25')](_0x3e86da[_0xf0d4('0x2e')],function(_0x782d97){var _0xa480ac={};_0xa480ac[_0x782d97]={'$like':'%'+_0x9f0967[_0xf0d4('0x2a')]['filter']+'%'};return _0xa480ac;})});}_0x3e86da=_[_0xf0d4('0x3a')]({},_0x3e86da,_0x9f0967[_0xf0d4('0x3b')]);return _0x3c49e2['getConfigurations'](_0x3e86da);}})[_0xf0d4('0x40')](function(_0x53a00e){if(_0x53a00e){_0xce39c=_0x53a00e[_0xf0d4('0x31')];if(!_0x9f0967['query'][_0xf0d4('0x32')](_0xf0d4('0x33'))){_0x3e86da[_0xf0d4('0x1b')]=qs[_0xf0d4('0x1b')](_0x9f0967['query']['limit']);_0x3e86da[_0xf0d4('0x1a')]=qs['offset'](_0x9f0967[_0xf0d4('0x2a')][_0xf0d4('0x1a')]);}return _0x3c49e2[_0xf0d4('0x49')](_0x3e86da);}})[_0xf0d4('0x40')](function(_0x661345){if(_0x661345){return _0x661345?{'count':_0xce39c,'rows':_0x661345}:null;}})[_0xf0d4('0x40')](respondWithResult(_0xfdb099,null))[_0xf0d4('0x42')](handleError(_0xfdb099,null));};exports[_0xf0d4('0x4b')]=function(_0x1c26a0,_0x260386,_0x4514b5){if(_0x1c26a0['body']['id']){delete _0x1c26a0['body']['id'];}return db[_0xf0d4('0x3c')][_0xf0d4('0x4c')]({'where':{'id':_0x1c26a0[_0xf0d4('0x44')]['id']}})['then'](handleEntityNotFound(_0x260386,null))['then'](function(_0x49bd6a){if(_0x49bd6a){_0x1c26a0['body']['AccountId']=_0x49bd6a['id'];_0x1c26a0[_0xf0d4('0x46')]['Subjects']=integrations['getSubjects'](_0x1c26a0[_0xf0d4('0x46')][_0xf0d4('0x4d')],_0x1c26a0[_0xf0d4('0x46')][_0xf0d4('0x28')]);_0x1c26a0['body']['Descriptions']=integrations[_0xf0d4('0x4e')](_0x1c26a0[_0xf0d4('0x46')][_0xf0d4('0x4d')],_0x1c26a0[_0xf0d4('0x46')]['type']);return db['ZohoConfiguration'][_0xf0d4('0x45')](_0x1c26a0['body'],{'include':[{'model':db[_0xf0d4('0x4f')],'as':'Subjects'},{'model':db[_0xf0d4('0x4f')],'as':_0xf0d4('0x50')}]});}return null;})[_0xf0d4('0x40')](respondWithResult(_0x260386,null))[_0xf0d4('0x42')](handleError(_0x260386,null));};function getAccessToken(_0x9ef3fe){return new Promise(function(_0x3b691b,_0x5d14be){var _0x1dd9c;switch(_0x9ef3fe['zone']){case'US':_0x1dd9c=_0xf0d4('0x51');break;case'AU':_0x1dd9c='https://accounts.zoho.com.au';break;case'EU':_0x1dd9c='https://accounts.zoho.eu';break;case'IN':_0x1dd9c=_0xf0d4('0x52');break;case'CN':_0x1dd9c=_0xf0d4('0x53');break;default:_0x1dd9c=_0xf0d4('0x54');break;}var _0x1744c6={'method':_0xf0d4('0x55'),'uri':_0x1dd9c+_0xf0d4('0x56'),'qs':{'refresh_token':_0x9ef3fe[_0xf0d4('0x57')],'client_id':_0x9ef3fe[_0xf0d4('0x58')],'client_secret':_0x9ef3fe[_0xf0d4('0x59')],'grant_type':_0xf0d4('0x5a')},'json':!![]};return rp(_0x1744c6)['then'](function(_0x5f4f62){if(_0x5f4f62[_0xf0d4('0x5b')]){_0x3b691b(_0x5f4f62['access_token']);}else{_0x5d14be(_0xf0d4('0x5c'));}})['catch'](function(_0x3956b4){_0x5d14be(_0x3956b4);});});}exports[_0xf0d4('0x5d')]=function(_0x218ae5,_0x470a02,_0x12db81){var _0x3e0fb7,_0x2d12bf,_0x4b9cfe,_0x526859,_0x3bea30;return db['ZohoAccount']['findOne']({'where':{'id':_0x218ae5[_0xf0d4('0x44')]['id']},'attributes':['id',_0xf0d4('0x5e'),_0xf0d4('0x5f'),_0xf0d4('0x58'),_0xf0d4('0x59'),_0xf0d4('0x60'),_0xf0d4('0x61'),_0xf0d4('0x57')]})[_0xf0d4('0x40')](handleEntityNotFound(_0x470a02,null))[_0xf0d4('0x40')](function(_0xf3627a){_0x3bea30=_0xf3627a;_0x3e0fb7=_0x3bea30[_0xf0d4('0x5e')];_0x2d12bf=_0x3e0fb7===_0xf0d4('0x62')?'eu':_0xf0d4('0x63');_0x4b9cfe=_0x3bea30[_0xf0d4('0x60')];var _0x80d547=_0x4b9cfe[_0xf0d4('0x64')](-0x1);if(_0x80d547==='/'||_0x80d547==='\x5c'||_0x80d547===':'){_0x4b9cfe=_0x4b9cfe['substring'](0x0,_0x4b9cfe[_0xf0d4('0x65')](_0x80d547));}if(!_0x3bea30[_0xf0d4('0x57')]){throw new Error(_0xf0d4('0x66'));}return getAccessToken(_0x3bea30);})[_0xf0d4('0x40')](function(_0x171649){if(_0x171649){return rp({'method':_0xf0d4('0x67'),'uri':util[_0xf0d4('0x68')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x2d12bf),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x171649},'json':!![]});}})['then'](function(_0x3beaf1){if(_0x3beaf1){if(_0x3beaf1[_0xf0d4('0x69')]&&_0x3beaf1[_0xf0d4('0x69')][_0xf0d4('0x22')]){throw new Error(_0x3beaf1['response'][_0xf0d4('0x22')][_0xf0d4('0x6a')]);}var _0x45563a=[];var _0x3fb57a=[];var _0x4c4119=['Owner',_0xf0d4('0x6b'),'Description',_0xf0d4('0x6c'),_0xf0d4('0x6d'),_0xf0d4('0x6e'),_0xf0d4('0x6f'),_0xf0d4('0x70')];_0x3fb57a=_[_0xf0d4('0x71')](_0x3beaf1[_0xf0d4('0x30')],function(_0x290a6d){return _0x4c4119[_0xf0d4('0x72')](_0x290a6d[_0xf0d4('0x73')]);});for(var _0x31476e=0x0;_0x31476e<_0x3fb57a['length'];_0x31476e++){if(_0x3fb57a[_0x31476e]['system_mandatory']===![]){_0x45563a['push']({'id':_0x3fb57a[_0x31476e]['id'],'name':_0x3fb57a[_0x31476e][_0xf0d4('0x74')],'custom':_0x3fb57a[_0x31476e][_0xf0d4('0x75')],'options':_0x3fb57a[_0x31476e][_0xf0d4('0x76')]==='picklist'&&_0x3fb57a[_0x31476e][_0xf0d4('0x77')]['length']>-0x1?_[_0xf0d4('0x25')](_0x3fb57a[_0x31476e][_0xf0d4('0x77')],function(_0x5136fe){return{'name':_0x5136fe,'value':_0x5136fe};}):[]});}}return{'count':_0x45563a[_0xf0d4('0x31')],'rows':_0x45563a};}else{return{'count':0x0,'rows':[]};}})[_0xf0d4('0x40')](respondWithResult(_0x470a02,null))[_0xf0d4('0x42')](function(_0x3c8340){var _0x566383=_0x218ae5[_0xf0d4('0x2a')][_0xf0d4('0x78')]?0x1f4:_0x3c8340[_0xf0d4('0x79')]||0x1f4;logger[_0xf0d4('0x22')](_0xf0d4('0x7a'),_0xf0d4('0x5d'),_0x566383,JSON[_0xf0d4('0x7b')](_0x3c8340));delete _0x3c8340['name'];if(_0x566383===0x191){_0x566383=0x190;}_0x470a02[_0xf0d4('0x18')](_0x566383)[_0xf0d4('0x7c')](_0x218ae5['query'][_0xf0d4('0x78')]?{'message':_0xf0d4('0x7d'),'statusCode':_0x3c8340[_0xf0d4('0x79')]}:_0x3c8340);});}; \ No newline at end of file +var _0xf88b=['host','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','display_label','custom_field','data_type','pick_list_values','getFields','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','error','name','send','index','map','fieldName','type','key','model','keys','query','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoAccount','includeAll','include','findAll','show','rawAttributes','intersection','length','find','catch','create','body','params','findOne','ZohoConfiguration','getConfigurations','hasOwnProperty','Subjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','clientId','clientSecret','serverUrl','code'];(function(_0x39575f,_0x37b854){var _0x1a2c5c=function(_0x1ad0d6){while(--_0x1ad0d6){_0x39575f['push'](_0x39575f['shift']());}};_0x1a2c5c(++_0x37b854);}(_0xf88b,0x9b));var _0xbf88=function(_0x459734,_0x3e0440){_0x459734=_0x459734-0x0;var _0x328917=_0xf88b[_0x459734];return _0x328917;};'use strict';var emlformat=require(_0xbf88('0x0'));var rimraf=require(_0xbf88('0x1'));var zipdir=require(_0xbf88('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf88('0x3'));var BPromise=require(_0xbf88('0x4'));var Mustache=require(_0xbf88('0x5'));var util=require('util');var path=require('path');var sox=require(_0xbf88('0x6'));var csv=require(_0xbf88('0x7'));var ejs=require(_0xbf88('0x8'));var fs=require('fs');var fs_extra=require(_0xbf88('0x9'));var _=require(_0xbf88('0xa'));var squel=require(_0xbf88('0xb'));var crypto=require(_0xbf88('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbf88('0xd'));var toCsv=require(_0xbf88('0x7'));var querystring=require('querystring');var Papa=require(_0xbf88('0xe'));var Redis=require('ioredis');var authService=require(_0xbf88('0xf'));var qs=require(_0xbf88('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf88('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xbf88('0x12'));var config=require(_0xbf88('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xbf88('0x14'));function respondWithStatusCode(_0x230575,_0x42d22e){_0x42d22e=_0x42d22e||0xcc;return function(_0x2f990e){if(_0x2f990e){return _0x230575[_0xbf88('0x15')](_0x42d22e);}return _0x230575[_0xbf88('0x16')](_0x42d22e)[_0xbf88('0x17')]();};}function respondWithResult(_0xd52e2a,_0x1fd01d){_0x1fd01d=_0x1fd01d||0xc8;return function(_0x183172){if(_0x183172){return _0xd52e2a[_0xbf88('0x16')](_0x1fd01d)[_0xbf88('0x18')](_0x183172);}};}function respondWithFilteredResult(_0x37e357,_0x530a5a){return function(_0x4cbc70){if(_0x4cbc70){var _0xc0e7b4=typeof _0x530a5a[_0xbf88('0x19')]==='undefined'&&typeof _0x530a5a[_0xbf88('0x1a')]===_0xbf88('0x1b');var _0x2f33d7=_0x4cbc70[_0xbf88('0x1c')];var _0x27a6b9=_0xc0e7b4?0x0:_0x530a5a['offset'];var _0x1cbc4f=_0xc0e7b4?_0x4cbc70[_0xbf88('0x1c')]:_0x530a5a['offset']+_0x530a5a[_0xbf88('0x1a')];var _0x7bd45e;if(_0x1cbc4f>=_0x2f33d7){_0x1cbc4f=_0x2f33d7;_0x7bd45e=0xc8;}else{_0x7bd45e=0xce;}_0x37e357['status'](_0x7bd45e);return _0x37e357[_0xbf88('0x1d')](_0xbf88('0x1e'),_0x27a6b9+'-'+_0x1cbc4f+'/'+_0x2f33d7)['json'](_0x4cbc70);}return null;};}function patchUpdates(_0x2fb060){return function(_0x19e5cb){try{jsonpatch[_0xbf88('0x1f')](_0x19e5cb,_0x2fb060,!![]);}catch(_0x5c854f){return BPromise['reject'](_0x5c854f);}return _0x19e5cb['save']();};}function saveUpdates(_0x57c9a9,_0x35157){return function(_0x47423c){if(_0x47423c){return _0x47423c[_0xbf88('0x20')](_0x57c9a9)[_0xbf88('0x21')](function(_0x1394dd){return _0x1394dd;});}return null;};}function removeEntity(_0x43a03b,_0x66fc35){return function(_0x33f788){if(_0x33f788){return _0x33f788[_0xbf88('0x22')]()['then'](function(){_0x43a03b[_0xbf88('0x16')](0xcc)[_0xbf88('0x17')]();});}};}function handleEntityNotFound(_0x136d4f,_0x2e3c39){return function(_0x5866dc){if(!_0x5866dc){_0x136d4f['sendStatus'](0x194);}return _0x5866dc;};}function handleError(_0xe29391,_0x56c392){_0x56c392=_0x56c392||0x1f4;return function(_0x4db7b7){logger[_0xbf88('0x23')](_0x4db7b7['stack']);if(_0x4db7b7[_0xbf88('0x24')]){delete _0x4db7b7[_0xbf88('0x24')];}_0xe29391[_0xbf88('0x16')](_0x56c392)[_0xbf88('0x25')](_0x4db7b7);};}exports[_0xbf88('0x26')]=function(_0x14f563,_0x447b74){var _0x131c9a={},_0x42b401={},_0x3d757b={'count':0x0,'rows':[]};var _0x1b9c1d=_[_0xbf88('0x27')](db['ZohoAccount']['rawAttributes'],function(_0x388890){return{'name':_0x388890[_0xbf88('0x28')],'type':_0x388890[_0xbf88('0x29')][_0xbf88('0x2a')]};});_0x42b401[_0xbf88('0x2b')]=_[_0xbf88('0x27')](_0x1b9c1d,_0xbf88('0x24'));_0x42b401['query']=_[_0xbf88('0x2c')](_0x14f563[_0xbf88('0x2d')]);_0x42b401[_0xbf88('0x2e')]=_['intersection'](_0x42b401['model'],_0x42b401[_0xbf88('0x2d')]);_0x131c9a[_0xbf88('0x2f')]=_['intersection'](_0x42b401[_0xbf88('0x2b')],qs[_0xbf88('0x30')](_0x14f563[_0xbf88('0x2d')][_0xbf88('0x30')]));_0x131c9a[_0xbf88('0x2f')]=_0x131c9a[_0xbf88('0x2f')]['length']?_0x131c9a[_0xbf88('0x2f')]:_0x42b401['model'];if(!_0x14f563[_0xbf88('0x2d')]['hasOwnProperty'](_0xbf88('0x31'))){_0x131c9a[_0xbf88('0x1a')]=qs['limit'](_0x14f563[_0xbf88('0x2d')][_0xbf88('0x1a')]);_0x131c9a['offset']=qs['offset'](_0x14f563['query'][_0xbf88('0x19')]);}_0x131c9a[_0xbf88('0x32')]=qs['sort'](_0x14f563['query'][_0xbf88('0x33')]);_0x131c9a[_0xbf88('0x34')]=qs[_0xbf88('0x2e')](_[_0xbf88('0x35')](_0x14f563[_0xbf88('0x2d')],_0x42b401[_0xbf88('0x2e')]),_0x1b9c1d);if(_0x14f563[_0xbf88('0x2d')][_0xbf88('0x36')]){_0x131c9a[_0xbf88('0x34')]=_[_0xbf88('0x37')](_0x131c9a[_0xbf88('0x34')],{'$or':_[_0xbf88('0x27')](_0x1b9c1d,function(_0x1b605d){if(_0x1b605d[_0xbf88('0x29')]!==_0xbf88('0x38')){var _0x4a38e9={};_0x4a38e9[_0x1b605d[_0xbf88('0x24')]]={'$like':'%'+_0x14f563['query'][_0xbf88('0x36')]+'%'};return _0x4a38e9;}})});}_0x131c9a=_[_0xbf88('0x37')]({},_0x131c9a,_0x14f563[_0xbf88('0x39')]);var _0x188865={'where':_0x131c9a['where']};return db[_0xbf88('0x3a')][_0xbf88('0x1c')](_0x188865)['then'](function(_0x50ed7f){_0x3d757b[_0xbf88('0x1c')]=_0x50ed7f;if(_0x14f563[_0xbf88('0x2d')][_0xbf88('0x3b')]){_0x131c9a[_0xbf88('0x3c')]=[{'all':!![]}];}return db[_0xbf88('0x3a')][_0xbf88('0x3d')](_0x131c9a);})[_0xbf88('0x21')](function(_0x2ecb65){_0x3d757b['rows']=_0x2ecb65;return _0x3d757b;})[_0xbf88('0x21')](respondWithFilteredResult(_0x447b74,_0x131c9a))['catch'](handleError(_0x447b74,null));};exports[_0xbf88('0x3e')]=function(_0x4697d1,_0x232d9a){var _0x1be62c={'raw':![],'where':{'id':_0x4697d1['params']['id']}},_0x5afb42={};_0x5afb42[_0xbf88('0x2b')]=_[_0xbf88('0x2c')](db[_0xbf88('0x3a')][_0xbf88('0x3f')]);_0x5afb42[_0xbf88('0x2d')]=_[_0xbf88('0x2c')](_0x4697d1['query']);_0x5afb42[_0xbf88('0x2e')]=_['intersection'](_0x5afb42[_0xbf88('0x2b')],_0x5afb42[_0xbf88('0x2d')]);_0x1be62c[_0xbf88('0x2f')]=_[_0xbf88('0x40')](_0x5afb42[_0xbf88('0x2b')],qs[_0xbf88('0x30')](_0x4697d1[_0xbf88('0x2d')][_0xbf88('0x30')]));_0x1be62c[_0xbf88('0x2f')]=_0x1be62c[_0xbf88('0x2f')][_0xbf88('0x41')]?_0x1be62c[_0xbf88('0x2f')]:_0x5afb42['model'];if(_0x4697d1[_0xbf88('0x2d')]['includeAll']){_0x1be62c[_0xbf88('0x3c')]=[{'all':!![]}];}_0x1be62c=_[_0xbf88('0x37')]({},_0x1be62c,_0x4697d1[_0xbf88('0x39')]);return db[_0xbf88('0x3a')][_0xbf88('0x42')](_0x1be62c)[_0xbf88('0x21')](handleEntityNotFound(_0x232d9a,null))[_0xbf88('0x21')](respondWithResult(_0x232d9a,null))[_0xbf88('0x43')](handleError(_0x232d9a,null));};exports[_0xbf88('0x44')]=function(_0x518b16,_0x1f55a5){return db[_0xbf88('0x3a')][_0xbf88('0x44')](_0x518b16['body'],{})['then'](respondWithResult(_0x1f55a5,0xc9))[_0xbf88('0x43')](handleError(_0x1f55a5,null));};exports[_0xbf88('0x20')]=function(_0x493179,_0x4aedb4){if(_0x493179[_0xbf88('0x45')]['id']){delete _0x493179[_0xbf88('0x45')]['id'];}return db[_0xbf88('0x3a')][_0xbf88('0x42')]({'where':{'id':_0x493179[_0xbf88('0x46')]['id']}})['then'](handleEntityNotFound(_0x4aedb4,null))[_0xbf88('0x21')](saveUpdates(_0x493179['body'],null))[_0xbf88('0x21')](respondWithResult(_0x4aedb4,null))[_0xbf88('0x43')](handleError(_0x4aedb4,null));};exports[_0xbf88('0x22')]=function(_0x2e56e9,_0x4aa582){return db['ZohoAccount'][_0xbf88('0x42')]({'where':{'id':_0x2e56e9[_0xbf88('0x46')]['id']}})['then'](handleEntityNotFound(_0x4aa582,null))['then'](removeEntity(_0x4aa582,null))[_0xbf88('0x43')](handleError(_0x4aa582,null));};exports['getConfigurations']=function(_0x209ca,_0x18cbeb,_0x2616e6){var _0x3295ee={};var _0x4c2f5f={};var _0x36223c;var _0x18aac4;return db[_0xbf88('0x3a')][_0xbf88('0x47')]({'where':{'id':_0x209ca[_0xbf88('0x46')]['id']}})[_0xbf88('0x21')](handleEntityNotFound(_0x18cbeb,null))[_0xbf88('0x21')](function(_0x53670f){if(_0x53670f){_0x36223c=_0x53670f;_0x4c2f5f[_0xbf88('0x2b')]=_['keys'](db[_0xbf88('0x48')][_0xbf88('0x3f')]);_0x4c2f5f[_0xbf88('0x2d')]=_['keys'](_0x209ca[_0xbf88('0x2d')]);_0x4c2f5f[_0xbf88('0x2e')]=_['intersection'](_0x4c2f5f[_0xbf88('0x2b')],_0x4c2f5f[_0xbf88('0x2d')]);_0x3295ee[_0xbf88('0x2f')]=_[_0xbf88('0x40')](_0x4c2f5f['model'],qs['fields'](_0x209ca[_0xbf88('0x2d')][_0xbf88('0x30')]));_0x3295ee[_0xbf88('0x2f')]=_0x3295ee[_0xbf88('0x2f')][_0xbf88('0x41')]?_0x3295ee['attributes']:_0x4c2f5f[_0xbf88('0x2b')];_0x3295ee['order']=qs[_0xbf88('0x33')](_0x209ca[_0xbf88('0x2d')]['sort']);_0x3295ee['where']=qs[_0xbf88('0x2e')](_[_0xbf88('0x35')](_0x209ca[_0xbf88('0x2d')],_0x4c2f5f[_0xbf88('0x2e')]));if(_0x209ca[_0xbf88('0x2d')][_0xbf88('0x36')]){_0x3295ee['where']=_[_0xbf88('0x37')](_0x3295ee[_0xbf88('0x34')],{'$or':_[_0xbf88('0x27')](_0x3295ee[_0xbf88('0x2f')],function(_0x3f4667){var _0x4f4148={};_0x4f4148[_0x3f4667]={'$like':'%'+_0x209ca[_0xbf88('0x2d')][_0xbf88('0x36')]+'%'};return _0x4f4148;})});}_0x3295ee=_[_0xbf88('0x37')]({},_0x3295ee,_0x209ca[_0xbf88('0x39')]);return _0x36223c[_0xbf88('0x49')](_0x3295ee);}})[_0xbf88('0x21')](function(_0x1340b8){if(_0x1340b8){_0x18aac4=_0x1340b8['length'];if(!_0x209ca[_0xbf88('0x2d')][_0xbf88('0x4a')]('nolimit')){_0x3295ee[_0xbf88('0x1a')]=qs[_0xbf88('0x1a')](_0x209ca[_0xbf88('0x2d')][_0xbf88('0x1a')]);_0x3295ee[_0xbf88('0x19')]=qs[_0xbf88('0x19')](_0x209ca[_0xbf88('0x2d')][_0xbf88('0x19')]);}return _0x36223c[_0xbf88('0x49')](_0x3295ee);}})[_0xbf88('0x21')](function(_0x13c8ea){if(_0x13c8ea){return _0x13c8ea?{'count':_0x18aac4,'rows':_0x13c8ea}:null;}})[_0xbf88('0x21')](respondWithResult(_0x18cbeb,null))[_0xbf88('0x43')](handleError(_0x18cbeb,null));};exports['addConfiguration']=function(_0x1401ba,_0x391601,_0x34453d){if(_0x1401ba[_0xbf88('0x45')]['id']){delete _0x1401ba[_0xbf88('0x45')]['id'];}return db[_0xbf88('0x3a')][_0xbf88('0x47')]({'where':{'id':_0x1401ba[_0xbf88('0x46')]['id']}})[_0xbf88('0x21')](handleEntityNotFound(_0x391601,null))[_0xbf88('0x21')](function(_0x4389f8){if(_0x4389f8){_0x1401ba[_0xbf88('0x45')]['AccountId']=_0x4389f8['id'];_0x1401ba['body'][_0xbf88('0x4b')]=integrations['getSubjects'](_0x1401ba[_0xbf88('0x45')][_0xbf88('0x4c')],_0x1401ba['body']['type']);_0x1401ba[_0xbf88('0x45')][_0xbf88('0x4d')]=integrations[_0xbf88('0x4e')](_0x1401ba[_0xbf88('0x45')][_0xbf88('0x4c')],_0x1401ba[_0xbf88('0x45')][_0xbf88('0x29')]);return db[_0xbf88('0x48')][_0xbf88('0x44')](_0x1401ba[_0xbf88('0x45')],{'include':[{'model':db[_0xbf88('0x4f')],'as':'Subjects'},{'model':db[_0xbf88('0x4f')],'as':'Descriptions'}]});}return null;})[_0xbf88('0x21')](respondWithResult(_0x391601,null))['catch'](handleError(_0x391601,null));};function getAccessToken(_0x406dea){return new Promise(function(_0x2a0c3e,_0x5bc1fd){var _0x268d89;switch(_0x406dea[_0xbf88('0x50')]){case'US':_0x268d89=_0xbf88('0x51');break;case'AU':_0x268d89=_0xbf88('0x52');break;case'EU':_0x268d89=_0xbf88('0x53');break;case'IN':_0x268d89='https://accounts.zoho.in';break;case'CN':_0x268d89=_0xbf88('0x54');break;default:_0x268d89=_0xbf88('0x53');break;}var _0x252343={'method':_0xbf88('0x55'),'uri':_0x268d89+_0xbf88('0x56'),'qs':{'refresh_token':_0x406dea[_0xbf88('0x57')],'client_id':_0x406dea['clientId'],'client_secret':_0x406dea['clientSecret'],'grant_type':_0xbf88('0x58')},'json':!![]};return rp(_0x252343)[_0xbf88('0x21')](function(_0x4f7819){if(_0x4f7819['access_token']){_0x2a0c3e(_0x4f7819[_0xbf88('0x59')]);}else{_0x5bc1fd(_0xbf88('0x5a'));}})[_0xbf88('0x43')](function(_0xffca7f){_0x5bc1fd(_0xffca7f);});});}exports['getFields']=function(_0x493ef5,_0x385189,_0x29f64d){var _0x2d1d81,_0x3aa3fa,_0x93044d,_0x5b6336,_0x27e17e;return db[_0xbf88('0x3a')][_0xbf88('0x47')]({'where':{'id':_0x493ef5[_0xbf88('0x46')]['id']},'attributes':['id','host',_0xbf88('0x50'),_0xbf88('0x5b'),_0xbf88('0x5c'),_0xbf88('0x5d'),_0xbf88('0x5e'),_0xbf88('0x57')]})[_0xbf88('0x21')](handleEntityNotFound(_0x385189,null))[_0xbf88('0x21')](function(_0x52aafe){_0x27e17e=_0x52aafe;_0x2d1d81=_0x27e17e[_0xbf88('0x5f')];_0x3aa3fa=_0x2d1d81===_0xbf88('0x60')?'eu':_0xbf88('0x61');_0x93044d=_0x27e17e[_0xbf88('0x5d')];var _0xc4cee0=_0x93044d[_0xbf88('0x62')](-0x1);if(_0xc4cee0==='/'||_0xc4cee0==='\x5c'||_0xc4cee0===':'){_0x93044d=_0x93044d[_0xbf88('0x63')](0x0,_0x93044d[_0xbf88('0x64')](_0xc4cee0));}if(!_0x27e17e[_0xbf88('0x57')]){throw new Error(_0xbf88('0x65'));}return getAccessToken(_0x27e17e);})[_0xbf88('0x21')](function(_0x54a34a){if(_0x54a34a){return rp({'method':_0xbf88('0x66'),'uri':util[_0xbf88('0x67')](_0xbf88('0x68'),_0x3aa3fa),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x54a34a},'json':!![]});}})[_0xbf88('0x21')](function(_0x5472b5){if(_0x5472b5){if(_0x5472b5['response']&&_0x5472b5[_0xbf88('0x69')]['error']){throw new Error(_0x5472b5['response'][_0xbf88('0x23')]['message']);}var _0x114ff2=[];var _0x20e564=[];var _0x12e6c2=[_0xbf88('0x6a'),_0xbf88('0x6b'),_0xbf88('0x6c'),_0xbf88('0x6d'),_0xbf88('0x6e'),'Call_Result',_0xbf88('0x6f'),_0xbf88('0x70')];_0x20e564=_[_0xbf88('0x71')](_0x5472b5[_0xbf88('0x30')],function(_0x3cfbb2){return _0x12e6c2[_0xbf88('0x72')](_0x3cfbb2['api_name']);});for(var _0x4d4143=0x0;_0x4d4143<_0x20e564[_0xbf88('0x41')];_0x4d4143++){if(_0x20e564[_0x4d4143][_0xbf88('0x73')]===![]){_0x114ff2[_0xbf88('0x74')]({'id':_0x20e564[_0x4d4143]['id'],'name':_0x20e564[_0x4d4143][_0xbf88('0x75')],'custom':_0x20e564[_0x4d4143][_0xbf88('0x76')],'options':_0x20e564[_0x4d4143][_0xbf88('0x77')]==='picklist'&&_0x20e564[_0x4d4143][_0xbf88('0x78')][_0xbf88('0x41')]>-0x1?_['map'](_0x20e564[_0x4d4143][_0xbf88('0x78')],function(_0x53bb71){return{'name':_0x53bb71,'value':_0x53bb71};}):[]});}}return{'count':_0x114ff2['length'],'rows':_0x114ff2};}else{return{'count':0x0,'rows':[]};}})[_0xbf88('0x21')](respondWithResult(_0x385189,null))[_0xbf88('0x43')](function(_0x3672f5){var _0x2a6306=_0x493ef5[_0xbf88('0x2d')]['test']?0x1f4:_0x3672f5['statusCode']||0x1f4;logger[_0xbf88('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0xbf88('0x79'),_0x2a6306,JSON['stringify'](_0x3672f5));delete _0x3672f5[_0xbf88('0x24')];if(_0x2a6306===0x191){_0x2a6306=0x190;}_0x385189['status'](_0x2a6306)[_0xbf88('0x25')](_0x493ef5[_0xbf88('0x2d')][_0xbf88('0x7a')]?{'message':_0xbf88('0x7b'),'statusCode':_0x3672f5[_0xbf88('0x7c')]}:_0x3672f5);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 1e1ac62..e8b0557 100644 --- a/server/api/intZohoAccount/intZohoAccount.model.js +++ b/server/api/intZohoAccount/intZohoAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd23=['../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','ZohoAccount','changed','zone','serverUrl','clientId','code','host','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','clientSecret','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','catch','inspect','substring','/oauth/v2/token','then','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x42e229,_0x456ecc){var _0x1c27d1=function(_0x3b1edd){while(--_0x3b1edd){_0x42e229['push'](_0x42e229['shift']());}};_0x1c27d1(++_0x456ecc);}(_0xbd23,0x9d));var _0x3bd2=function(_0x1e8194,_0x119f3d){_0x1e8194=_0x1e8194-0x0;var _0x1493e1=_0xbd23[_0x1e8194];return _0x1493e1;};'use strict';var _=require(_0x3bd2('0x0'));var util=require(_0x3bd2('0x1'));var logger=require('../../config/logger')(_0x3bd2('0x2'));var moment=require('moment');var BPromise=require(_0x3bd2('0x3'));var rp=require(_0x3bd2('0x4'));var fs=require('fs');var path=require(_0x3bd2('0x5'));var rimraf=require(_0x3bd2('0x6'));var config=require(_0x3bd2('0x7'));var attributes=require(_0x3bd2('0x8'));var integrations=require(_0x3bd2('0x9'));module[_0x3bd2('0xa')]=function(_0x46eaac,_0x26a33b){return _0x46eaac['define'](_0x3bd2('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x25b5fa,_0x42f9a7,_0x4023a2){if(_0x25b5fa[_0x3bd2('0xc')](_0x3bd2('0xd'))||_0x25b5fa[_0x3bd2('0xc')](_0x3bd2('0xe'))||_0x25b5fa[_0x3bd2('0xc')](_0x3bd2('0xf'))||_0x25b5fa[_0x3bd2('0xc')]('clientSecret')||_0x25b5fa['changed'](_0x3bd2('0x10'))||_0x25b5fa['changed'](_0x3bd2('0x11'))){var _0xfd09f6,_0x1fa26d;_0xfd09f6=_0x25b5fa['serverUrl'];var _0x474e58=_0xfd09f6['slice'](-0x1);if(_0x474e58==='/'||_0x474e58==='\x5c'||_0x474e58===':'){_0xfd09f6=_0xfd09f6['substring'](0x0,_0xfd09f6[_0x3bd2('0x12')](_0x474e58));}switch(_0x25b5fa['zone']){case'US':_0x1fa26d=_0x3bd2('0x13');break;case'AU':_0x1fa26d=_0x3bd2('0x14');break;case'IN':_0x1fa26d=_0x3bd2('0x15');break;case'CN':_0x1fa26d=_0x3bd2('0x16');break;default:_0x1fa26d=_0x3bd2('0x17');break;}var _0x57c78d={'method':_0x3bd2('0x18'),'uri':_0x1fa26d+'/oauth/v2/token','form':{'grant_type':_0x3bd2('0x19'),'client_id':_0x25b5fa[_0x3bd2('0xf')],'client_secret':_0x25b5fa[_0x3bd2('0x1a')],'redirect_uri':_0x25b5fa[_0x3bd2('0xe')],'code':_0x25b5fa['code']},'headers':{'Content-Type':_0x3bd2('0x1b')}};return rp(_0x57c78d)['then'](function(_0x2dee1d){var _0x4b88f9=JSON['parse'](_0x2dee1d);if(_0x4b88f9[_0x3bd2('0x1c')]){_0x25b5fa[_0x3bd2('0x1d')]=_0x4b88f9[_0x3bd2('0x1c')];logger[_0x3bd2('0x1e')](util[_0x3bd2('0x1f')](_0x3bd2('0x20'),_0x25b5fa[_0x3bd2('0x21')],_0x25b5fa['id']));}else{logger[_0x3bd2('0x22')](util['format'](_0x3bd2('0x23'),_0x25b5fa[_0x3bd2('0x21')],_0x25b5fa['id']),util['inspect'](_0x4b88f9,{'showHidden':![],'depth':null}));}return _0x4023a2(null,_0x42f9a7);})[_0x3bd2('0x24')](function(_0x48dd87){logger['error'](util['format'](_0x3bd2('0x23'),_0x25b5fa['name'],_0x25b5fa['id']),util[_0x3bd2('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x4023a2(_0x48dd87);});}else{return _0x4023a2(null,_0x42f9a7);}},'beforeUpdate':function(_0x5614de,_0x32020c,_0x2a9fab){if(_0x5614de[_0x3bd2('0xc')](_0x3bd2('0xd'))||_0x5614de[_0x3bd2('0xc')]('serverUrl')||_0x5614de[_0x3bd2('0xc')](_0x3bd2('0xf'))||_0x5614de[_0x3bd2('0xc')](_0x3bd2('0x1a'))||_0x5614de['changed'](_0x3bd2('0x10'))||_0x5614de[_0x3bd2('0xc')](_0x3bd2('0x11'))){var _0x577d23,_0x3eb0a5;_0x577d23=_0x5614de[_0x3bd2('0xe')];var _0x2cf8ef=_0x577d23['slice'](-0x1);if(_0x2cf8ef==='/'||_0x2cf8ef==='\x5c'||_0x2cf8ef===':'){_0x577d23=_0x577d23[_0x3bd2('0x26')](0x0,_0x577d23[_0x3bd2('0x12')](_0x2cf8ef));}switch(_0x5614de[_0x3bd2('0xd')]){case'US':_0x3eb0a5=_0x3bd2('0x13');break;case'AU':_0x3eb0a5=_0x3bd2('0x14');break;case'IN':_0x3eb0a5='https://accounts.zoho.in';break;case'CN':_0x3eb0a5=_0x3bd2('0x16');break;default:_0x3eb0a5='https://accounts.zoho.eu';break;}var _0x173df0={'method':'POST','uri':_0x3eb0a5+_0x3bd2('0x27'),'form':{'grant_type':_0x3bd2('0x19'),'client_id':_0x5614de[_0x3bd2('0xf')],'client_secret':_0x5614de[_0x3bd2('0x1a')],'redirect_uri':_0x5614de['serverUrl'],'code':_0x5614de[_0x3bd2('0x10')]},'headers':{'Content-Type':_0x3bd2('0x1b')}};return rp(_0x173df0)[_0x3bd2('0x28')](function(_0x398b3b){var _0x464eb2=JSON['parse'](_0x398b3b);if(_0x464eb2[_0x3bd2('0x1c')]){_0x5614de['refreshToken']=_0x464eb2[_0x3bd2('0x1c')];logger[_0x3bd2('0x1e')](util[_0x3bd2('0x1f')](_0x3bd2('0x20'),_0x5614de[_0x3bd2('0x21')],_0x5614de['id']));}else{logger[_0x3bd2('0x22')](util[_0x3bd2('0x1f')](_0x3bd2('0x23'),_0x5614de[_0x3bd2('0x21')],_0x5614de['id']),util['inspect'](_0x464eb2,{'showHidden':![],'depth':null}));}return _0x2a9fab(null,_0x32020c);})['catch'](function(_0x43cd88){logger[_0x3bd2('0x22')](util[_0x3bd2('0x1f')](_0x3bd2('0x23'),_0x5614de[_0x3bd2('0x21')],_0x5614de['id']),util[_0x3bd2('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x2a9fab(_0x43cd88);});}else{return _0x2a9fab(null,_0x32020c);}}}});}; \ No newline at end of file +var _0x7ca6=['format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','inspect','catch','name','https://accounts.zoho.com','https://accounts.zoho.com.cn','https://accounts.zoho.eu','refresh_token','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','changed','zone','clientId','clientSecret','code','host','serverUrl','substring','https://accounts.zoho.com.au','https://accounts.zoho.in','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refreshToken','info'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x7ca6,0x133));var _0x67ca=function(_0x30fca9,_0x12cfb1){_0x30fca9=_0x30fca9-0x0;var _0x25db2a=_0x7ca6[_0x30fca9];return _0x25db2a;};'use strict';var _=require('lodash');var util=require(_0x67ca('0x0'));var logger=require(_0x67ca('0x1'))('api');var moment=require('moment');var BPromise=require(_0x67ca('0x2'));var rp=require(_0x67ca('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x67ca('0x4'));var config=require(_0x67ca('0x5'));var attributes=require(_0x67ca('0x6'));var integrations=require(_0x67ca('0x7'));module['exports']=function(_0x1ba93e,_0x12929f){return _0x1ba93e['define']('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2b45a9,_0x45b6c7,_0x4638cc){if(_0x2b45a9[_0x67ca('0x8')](_0x67ca('0x9'))||_0x2b45a9[_0x67ca('0x8')]('serverUrl')||_0x2b45a9[_0x67ca('0x8')](_0x67ca('0xa'))||_0x2b45a9[_0x67ca('0x8')](_0x67ca('0xb'))||_0x2b45a9[_0x67ca('0x8')](_0x67ca('0xc'))||_0x2b45a9[_0x67ca('0x8')](_0x67ca('0xd'))){var _0x2ea790,_0x420c72;_0x2ea790=_0x2b45a9[_0x67ca('0xe')];var _0x1e0c9a=_0x2ea790['slice'](-0x1);if(_0x1e0c9a==='/'||_0x1e0c9a==='\x5c'||_0x1e0c9a===':'){_0x2ea790=_0x2ea790[_0x67ca('0xf')](0x0,_0x2ea790['lastIndexOf'](_0x1e0c9a));}switch(_0x2b45a9[_0x67ca('0x9')]){case'US':_0x420c72='https://accounts.zoho.com';break;case'AU':_0x420c72=_0x67ca('0x10');break;case'IN':_0x420c72=_0x67ca('0x11');break;case'CN':_0x420c72='https://accounts.zoho.com.cn';break;default:_0x420c72='https://accounts.zoho.eu';break;}var _0x766b5b={'method':_0x67ca('0x12'),'uri':_0x420c72+_0x67ca('0x13'),'form':{'grant_type':_0x67ca('0x14'),'client_id':_0x2b45a9[_0x67ca('0xa')],'client_secret':_0x2b45a9[_0x67ca('0xb')],'redirect_uri':_0x2b45a9[_0x67ca('0xe')],'code':_0x2b45a9['code']},'headers':{'Content-Type':_0x67ca('0x15')}};return rp(_0x766b5b)[_0x67ca('0x16')](function(_0x440196){var _0x3e4a87=JSON[_0x67ca('0x17')](_0x440196);if(_0x3e4a87['refresh_token']){_0x2b45a9[_0x67ca('0x18')]=_0x3e4a87['refresh_token'];logger[_0x67ca('0x19')](util[_0x67ca('0x1a')](_0x67ca('0x1b'),_0x2b45a9['name'],_0x2b45a9['id']));}else{logger[_0x67ca('0x1c')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2b45a9['name'],_0x2b45a9['id']),util[_0x67ca('0x1d')](_0x3e4a87,{'showHidden':![],'depth':null}));}return _0x4638cc(null,_0x45b6c7);})[_0x67ca('0x1e')](function(_0x214c0b){logger['error'](util[_0x67ca('0x1a')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2b45a9[_0x67ca('0x1f')],_0x2b45a9['id']),util[_0x67ca('0x1d')](parsedResult,{'showHidden':![],'depth':null}));return _0x4638cc(_0x214c0b);});}else{return _0x4638cc(null,_0x45b6c7);}},'beforeUpdate':function(_0x259b95,_0x4ebcbc,_0x232896){if(_0x259b95['changed'](_0x67ca('0x9'))||_0x259b95[_0x67ca('0x8')](_0x67ca('0xe'))||_0x259b95['changed']('clientId')||_0x259b95[_0x67ca('0x8')](_0x67ca('0xb'))||_0x259b95[_0x67ca('0x8')](_0x67ca('0xc'))||_0x259b95['changed']('host')){var _0x18c863,_0x50cd72;_0x18c863=_0x259b95[_0x67ca('0xe')];var _0x336e8f=_0x18c863['slice'](-0x1);if(_0x336e8f==='/'||_0x336e8f==='\x5c'||_0x336e8f===':'){_0x18c863=_0x18c863[_0x67ca('0xf')](0x0,_0x18c863['lastIndexOf'](_0x336e8f));}switch(_0x259b95[_0x67ca('0x9')]){case'US':_0x50cd72=_0x67ca('0x20');break;case'AU':_0x50cd72=_0x67ca('0x10');break;case'IN':_0x50cd72=_0x67ca('0x11');break;case'CN':_0x50cd72=_0x67ca('0x21');break;default:_0x50cd72=_0x67ca('0x22');break;}var _0x712aaa={'method':_0x67ca('0x12'),'uri':_0x50cd72+_0x67ca('0x13'),'form':{'grant_type':_0x67ca('0x14'),'client_id':_0x259b95[_0x67ca('0xa')],'client_secret':_0x259b95['clientSecret'],'redirect_uri':_0x259b95['serverUrl'],'code':_0x259b95[_0x67ca('0xc')]},'headers':{'Content-Type':_0x67ca('0x15')}};return rp(_0x712aaa)[_0x67ca('0x16')](function(_0x33e621){var _0x53bdf1=JSON[_0x67ca('0x17')](_0x33e621);if(_0x53bdf1[_0x67ca('0x23')]){_0x259b95[_0x67ca('0x18')]=_0x53bdf1[_0x67ca('0x23')];logger[_0x67ca('0x19')](util[_0x67ca('0x1a')](_0x67ca('0x1b'),_0x259b95[_0x67ca('0x1f')],_0x259b95['id']));}else{logger[_0x67ca('0x1c')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x259b95[_0x67ca('0x1f')],_0x259b95['id']),util['inspect'](_0x53bdf1,{'showHidden':![],'depth':null}));}return _0x232896(null,_0x4ebcbc);})[_0x67ca('0x1e')](function(_0x51e76c){logger[_0x67ca('0x1c')](util['format'](_0x67ca('0x24'),_0x259b95[_0x67ca('0x1f')],_0x259b95['id']),util[_0x67ca('0x1d')](parsedResult,{'showHidden':![],'depth':null}));return _0x232896(_0x51e76c);});}else{return _0x232896(null,_0x4ebcbc);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 42e23d8..2dcd79a 100644 --- a/server/api/intZohoAccount/intZohoAccount.rpc.js +++ b/server/api/intZohoAccount/intZohoAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d68=['randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetZohoAccount','ZohoAccount','findAll','options','limit','include','attributes','map','model','ShowZohoAccount','find','raw','then','lodash','util','moment','bluebird'];(function(_0x641503,_0x170746){var _0x4fb9c1=function(_0x10d299){while(--_0x10d299){_0x641503['push'](_0x641503['shift']());}};_0x4fb9c1(++_0x170746);}(_0x4d68,0x1c3));var _0x84d6=function(_0xdbb6cb,_0x3b8fda){_0xdbb6cb=_0xdbb6cb-0x0;var _0x476b50=_0x4d68[_0xdbb6cb];return _0x476b50;};'use strict';var _=require(_0x84d6('0x0'));var util=require(_0x84d6('0x1'));var moment=require(_0x84d6('0x2'));var BPromise=require(_0x84d6('0x3'));var rs=require(_0x84d6('0x4'));var fs=require('fs');var Redis=require(_0x84d6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x84d6('0x6'));var logger=require('../../config/logger')(_0x84d6('0x7'));var config=require('../../config/environment');var jayson=require(_0x84d6('0x8'));var client=jayson[_0x84d6('0x9')][_0x84d6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x539e34,_0x561dd8,_0x218daf){return new BPromise(function(_0xa64ed3,_0x260859){return client[_0x84d6('0xb')](_0x539e34,_0x218daf)['then'](function(_0x411c7f){logger['info'](_0x84d6('0xc'),_0x561dd8,_0x84d6('0xd'));logger[_0x84d6('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x561dd8,'request\x20sent',JSON[_0x84d6('0xf')](_0x411c7f));if(_0x411c7f['error']){if(_0x411c7f[_0x84d6('0x10')][_0x84d6('0x11')]===0x1f4){logger[_0x84d6('0x10')](_0x84d6('0xc'),_0x561dd8,_0x411c7f[_0x84d6('0x10')]['message']);return _0x260859(_0x411c7f[_0x84d6('0x10')]['message']);}logger[_0x84d6('0x10')](_0x84d6('0xc'),_0x561dd8,_0x411c7f[_0x84d6('0x10')][_0x84d6('0x12')]);return _0xa64ed3(_0x411c7f[_0x84d6('0x10')][_0x84d6('0x12')]);}else{logger[_0x84d6('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x561dd8,_0x84d6('0xd'));_0xa64ed3(_0x411c7f[_0x84d6('0x14')][_0x84d6('0x12')]);}})[_0x84d6('0x15')](function(_0x385e2b){logger['error'](_0x84d6('0xc'),_0x561dd8,_0x385e2b);_0x260859(_0x385e2b);});});}exports[_0x84d6('0x16')]=function(_0x579aa8){var _0x1bd84a=this;return new Promise(function(_0x47a884,_0x309f26){return db[_0x84d6('0x17')][_0x84d6('0x18')]({'raw':_0x579aa8[_0x84d6('0x19')]?_0x579aa8[_0x84d6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x579aa8[_0x84d6('0x19')]?_0x579aa8[_0x84d6('0x19')]['where']||null:null,'attributes':_0x579aa8['options']?_0x579aa8[_0x84d6('0x19')]['attributes']||null:null,'limit':_0x579aa8['options']?_0x579aa8[_0x84d6('0x19')][_0x84d6('0x1a')]||null:null,'include':_0x579aa8[_0x84d6('0x19')]?_0x579aa8['options'][_0x84d6('0x1b')]?_['map'](_0x579aa8['options'][_0x84d6('0x1b')],function(_0x1b86f2){return{'model':db[_0x1b86f2['model']],'as':_0x1b86f2['as'],'attributes':_0x1b86f2[_0x84d6('0x1c')],'include':_0x1b86f2[_0x84d6('0x1b')]?_[_0x84d6('0x1d')](_0x1b86f2[_0x84d6('0x1b')],function(_0x5deaa5){return{'model':db[_0x5deaa5[_0x84d6('0x1e')]],'as':_0x5deaa5['as'],'attributes':_0x5deaa5['attributes'],'include':_0x5deaa5[_0x84d6('0x1b')]?_[_0x84d6('0x1d')](_0x5deaa5['include'],function(_0x500a81){return{'model':db[_0x500a81[_0x84d6('0x1e')]],'as':_0x500a81['as'],'attributes':_0x500a81['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x14eec8){logger['info'](_0x84d6('0x16'),_0x579aa8);logger['debug'](_0x84d6('0x16'),_0x579aa8,JSON[_0x84d6('0xf')](_0x14eec8));_0x47a884(_0x14eec8);})[_0x84d6('0x15')](function(_0x37adf9){logger[_0x84d6('0x10')](_0x84d6('0x16'),_0x37adf9[_0x84d6('0x12')],_0x579aa8);_0x309f26(_0x1bd84a[_0x84d6('0x10')](0x1f4,_0x37adf9[_0x84d6('0x12')]));});});};exports[_0x84d6('0x1f')]=function(_0x20c27b){var _0x1fa278=this;return new Promise(function(_0x56bc23,_0x2f60f1){return db[_0x84d6('0x17')][_0x84d6('0x20')]({'raw':_0x20c27b[_0x84d6('0x19')]?_0x20c27b[_0x84d6('0x19')][_0x84d6('0x21')]===undefined?!![]:![]:!![],'where':_0x20c27b[_0x84d6('0x19')]?_0x20c27b[_0x84d6('0x19')]['where']||null:null,'attributes':_0x20c27b[_0x84d6('0x19')]?_0x20c27b['options'][_0x84d6('0x1c')]||null:null,'include':_0x20c27b[_0x84d6('0x19')]?_0x20c27b['options'][_0x84d6('0x1b')]?_[_0x84d6('0x1d')](_0x20c27b['options'][_0x84d6('0x1b')],function(_0x6c3a2a){return{'model':db[_0x6c3a2a[_0x84d6('0x1e')]],'as':_0x6c3a2a['as'],'attributes':_0x6c3a2a[_0x84d6('0x1c')],'include':_0x6c3a2a[_0x84d6('0x1b')]?_['map'](_0x6c3a2a[_0x84d6('0x1b')],function(_0xf8d313){return{'model':db[_0xf8d313[_0x84d6('0x1e')]],'as':_0xf8d313['as'],'attributes':_0xf8d313['attributes'],'include':_0xf8d313[_0x84d6('0x1b')]?_['map'](_0xf8d313[_0x84d6('0x1b')],function(_0x525b56){return{'model':db[_0x525b56['model']],'as':_0x525b56['as'],'attributes':_0x525b56[_0x84d6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x84d6('0x22')](function(_0x45b55f){logger['info'](_0x84d6('0x1f'),_0x20c27b);logger[_0x84d6('0xe')](_0x84d6('0x1f'),_0x20c27b,JSON['stringify'](_0x45b55f));_0x56bc23(_0x45b55f);})['catch'](function(_0x531a49){logger[_0x84d6('0x10')](_0x84d6('0x1f'),_0x531a49[_0x84d6('0x12')],_0x20c27b);_0x2f60f1(_0x1fa278[_0x84d6('0x10')](0x1f4,_0x531a49[_0x84d6('0x12')]));});});}; \ No newline at end of file +var _0xda2d=['../../config/environment','jayson/promise','client','http','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetZohoAccount','ZohoAccount','findAll','options','raw','attributes','include','map','model','catch','find','where','ShowZohoAccount','util','moment','bluebird','randomstring','ioredis','rpc'];(function(_0x19cd2a,_0x52bf9e){var _0x41f8b7=function(_0x132d14){while(--_0x132d14){_0x19cd2a['push'](_0x19cd2a['shift']());}};_0x41f8b7(++_0x52bf9e);}(_0xda2d,0x102));var _0xdda2=function(_0x48bc95,_0x2b316b){_0x48bc95=_0x48bc95-0x0;var _0x4b4c38=_0xda2d[_0x48bc95];return _0x4b4c38;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});}exports[_0xdda2('0x14')]=function(_0x1a3b35){var _0x335fb5=this;return new Promise(function(_0x2b6ee8,_0x8d44b7){return db[_0xdda2('0x15')][_0xdda2('0x16')]({'raw':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35[_0xdda2('0x17')][_0xdda2('0x18')]===undefined?!![]:![]:!![],'where':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35[_0xdda2('0x17')]['where']||null:null,'attributes':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35['options'][_0xdda2('0x19')]||null:null,'limit':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35[_0xdda2('0x17')]['limit']||null:null,'include':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35['options'][_0xdda2('0x1a')]?_[_0xdda2('0x1b')](_0x1a3b35['options'][_0xdda2('0x1a')],function(_0xfda248){return{'model':db[_0xfda248[_0xdda2('0x1c')]],'as':_0xfda248['as'],'attributes':_0xfda248[_0xdda2('0x19')],'include':_0xfda248[_0xdda2('0x1a')]?_['map'](_0xfda248[_0xdda2('0x1a')],function(_0x4be5ea){return{'model':db[_0x4be5ea[_0xdda2('0x1c')]],'as':_0x4be5ea['as'],'attributes':_0x4be5ea[_0xdda2('0x19')],'include':_0x4be5ea['include']?_['map'](_0x4be5ea[_0xdda2('0x1a')],function(_0x4567e7){return{'model':db[_0x4567e7[_0xdda2('0x1c')]],'as':_0x4567e7['as'],'attributes':_0x4567e7['attributes']};}):[]};}):[]};}):[]:[]})[_0xdda2('0xa')](function(_0x5d26ae){logger[_0xdda2('0x12')](_0xdda2('0x14'),_0x1a3b35);logger[_0xdda2('0xd')](_0xdda2('0x14'),_0x1a3b35,JSON['stringify'](_0x5d26ae));_0x2b6ee8(_0x5d26ae);})[_0xdda2('0x1d')](function(_0x255bbc){logger['error'](_0xdda2('0x14'),_0x255bbc[_0xdda2('0x11')],_0x1a3b35);_0x8d44b7(_0x335fb5[_0xdda2('0x10')](0x1f4,_0x255bbc[_0xdda2('0x11')]));});});};exports['ShowZohoAccount']=function(_0x129eba){var _0x5e107f=this;return new Promise(function(_0x4b19b7,_0x1ca9f3){return db['ZohoAccount'][_0xdda2('0x1e')]({'raw':_0x129eba['options']?_0x129eba['options']['raw']===undefined?!![]:![]:!![],'where':_0x129eba[_0xdda2('0x17')]?_0x129eba['options'][_0xdda2('0x1f')]||null:null,'attributes':_0x129eba['options']?_0x129eba['options']['attributes']||null:null,'include':_0x129eba[_0xdda2('0x17')]?_0x129eba[_0xdda2('0x17')][_0xdda2('0x1a')]?_[_0xdda2('0x1b')](_0x129eba[_0xdda2('0x17')][_0xdda2('0x1a')],function(_0x2bcfba){return{'model':db[_0x2bcfba[_0xdda2('0x1c')]],'as':_0x2bcfba['as'],'attributes':_0x2bcfba[_0xdda2('0x19')],'include':_0x2bcfba[_0xdda2('0x1a')]?_['map'](_0x2bcfba[_0xdda2('0x1a')],function(_0x4212da){return{'model':db[_0x4212da[_0xdda2('0x1c')]],'as':_0x4212da['as'],'attributes':_0x4212da[_0xdda2('0x19')],'include':_0x4212da[_0xdda2('0x1a')]?_[_0xdda2('0x1b')](_0x4212da[_0xdda2('0x1a')],function(_0x5835cd){return{'model':db[_0x5835cd['model']],'as':_0x5835cd['as'],'attributes':_0x5835cd[_0xdda2('0x19')]};}):[]};}):[]};}):[]:[]})[_0xdda2('0xa')](function(_0x40eb19){logger['info']('ShowZohoAccount',_0x129eba);logger[_0xdda2('0xd')](_0xdda2('0x20'),_0x129eba,JSON[_0xdda2('0xf')](_0x40eb19));_0x4b19b7(_0x40eb19);})[_0xdda2('0x1d')](function(_0x246001){logger['error'](_0xdda2('0x20'),_0x246001[_0xdda2('0x11')],_0x129eba);_0x1ca9f3(_0x5e107f['error'](0x1f4,_0x246001['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 7e6d313..4954b0a 100644 --- a/server/api/intZohoConfiguration/index.js +++ b/server/api/intZohoConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc64e=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','update','destroy'];(function(_0x56ddec,_0x527169){var _0x24d44b=function(_0x4e9b44){while(--_0x4e9b44){_0x56ddec['push'](_0x56ddec['shift']());}};_0x24d44b(++_0x527169);}(_0xc64e,0x15a));var _0xec64=function(_0x548f5e,_0x200e33){_0x548f5e=_0x548f5e-0x0;var _0x307750=_0xc64e[_0x548f5e];return _0x307750;};'use strict';var multer=require(_0xec64('0x0'));var util=require(_0xec64('0x1'));var path=require(_0xec64('0x2'));var timeout=require(_0xec64('0x3'));var express=require('express');var router=express[_0xec64('0x4')]();var fs_extra=require(_0xec64('0x5'));var auth=require(_0xec64('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xec64('0x7'));var controller=require(_0xec64('0x8'));router[_0xec64('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xec64('0x9')](_0xec64('0xa'),auth[_0xec64('0xb')](),controller[_0xec64('0xc')]);router[_0xec64('0x9')](_0xec64('0xd'),auth[_0xec64('0xb')](),controller[_0xec64('0xe')]);router[_0xec64('0x9')](_0xec64('0xf'),auth['isAuthenticated'](),controller[_0xec64('0x10')]);router[_0xec64('0x9')](_0xec64('0x11'),auth[_0xec64('0xb')](),controller[_0xec64('0x12')]);router['post']('/',auth[_0xec64('0xb')](),controller[_0xec64('0x13')]);router['put'](_0xec64('0xa'),auth['isAuthenticated'](),controller[_0xec64('0x14')]);router['delete']('/:id',auth[_0xec64('0xb')](),controller[_0xec64('0x15')]);module[_0xec64('0x16')]=router; \ No newline at end of file +var _0xf9a9=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','getFields','getSubjects','/:id/descriptions','getDescriptions','put','update','destroy','exports','multer'];(function(_0x2ad3cb,_0x2f5749){var _0x2d4061=function(_0x450a27){while(--_0x450a27){_0x2ad3cb['push'](_0x2ad3cb['shift']());}};_0x2d4061(++_0x2f5749);}(_0xf9a9,0x153));var _0x9f9a=function(_0x33ba99,_0x400563){_0x33ba99=_0x33ba99-0x0;var _0x3cb623=_0xf9a9[_0x33ba99];return _0x3cb623;};'use strict';var multer=require(_0x9f9a('0x0'));var util=require('util');var path=require(_0x9f9a('0x1'));var timeout=require(_0x9f9a('0x2'));var express=require(_0x9f9a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9f9a('0x4'));var interaction=require(_0x9f9a('0x5'));var config=require(_0x9f9a('0x6'));var controller=require(_0x9f9a('0x7'));router[_0x9f9a('0x8')]('/',auth[_0x9f9a('0x9')](),controller['index']);router[_0x9f9a('0x8')](_0x9f9a('0xa'),auth[_0x9f9a('0x9')](),controller[_0x9f9a('0xb')]);router[_0x9f9a('0x8')]('/:id/fields',auth[_0x9f9a('0x9')](),controller[_0x9f9a('0xc')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x9f9a('0xd')]);router[_0x9f9a('0x8')](_0x9f9a('0xe'),auth[_0x9f9a('0x9')](),controller[_0x9f9a('0xf')]);router['post']('/',auth[_0x9f9a('0x9')](),controller['create']);router[_0x9f9a('0x10')](_0x9f9a('0xa'),auth['isAuthenticated'](),controller[_0x9f9a('0x11')]);router['delete'](_0x9f9a('0xa'),auth[_0x9f9a('0x9')](),controller[_0x9f9a('0x12')]);module[_0x9f9a('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index cc8eaad..70d8eb1 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa970=['exports','STRING','ENUM','lead','contact','nothing','contact_lead','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa970,0x1c7));var _0x0a97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa970[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0a97('0x0'));module[_0x0a97('0x1')]={'name':{'type':Sequelize[_0x0a97('0x2')]},'moduleCreate':{'type':Sequelize[_0x0a97('0x3')](_0x0a97('0x4'),_0x0a97('0x5'),_0x0a97('0x6')),'defaultValue':_0x0a97('0x4')},'moduleSearch':{'type':Sequelize[_0x0a97('0x3')](_0x0a97('0x7'),_0x0a97('0x5'),_0x0a97('0x4')),'defaultValue':_0x0a97('0x7')},'description':{'type':Sequelize[_0x0a97('0x2')]}}; \ No newline at end of file +var _0xa0dd=['sequelize','exports','ENUM','lead','contact','contact_lead'];(function(_0x39187b,_0x2a6214){var _0x2cf25f=function(_0x183c3e){while(--_0x183c3e){_0x39187b['push'](_0x39187b['shift']());}};_0x2cf25f(++_0x2a6214);}(_0xa0dd,0xc0));var _0xda0d=function(_0x1a6dbb,_0x18eca3){_0x1a6dbb=_0x1a6dbb-0x0;var _0x1c546e=_0xa0dd[_0x1a6dbb];return _0x1c546e;};'use strict';var Sequelize=require(_0xda0d('0x0'));module[_0xda0d('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xda0d('0x2')](_0xda0d('0x3'),_0xda0d('0x4'),'nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xda0d('0x2')](_0xda0d('0x5'),_0xda0d('0x4'),_0xda0d('0x3')),'defaultValue':_0xda0d('0x5')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 98ef1f4..d1d0089 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a76=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','ZohoConfiguration','rawAttributes','fieldName','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','include','findAll','catch','params','includeAll','find','create','body','getFields','findOne','nolimit','getSubjects','ZohoField','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x98c64,_0x5d246d){var _0x1201e8=function(_0x4b6f3e){while(--_0x4b6f3e){_0x98c64['push'](_0x98c64['shift']());}};_0x1201e8(++_0x5d246d);}(_0x4a76,0x1cf));var _0x64a7=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x4a76[_0x4baae2];return _0x1a2285;};'use strict';var emlformat=require(_0x64a7('0x0'));var rimraf=require(_0x64a7('0x1'));var zipdir=require(_0x64a7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x64a7('0x3'));var moment=require('moment');var BPromise=require(_0x64a7('0x4'));var Mustache=require('mustache');var util=require(_0x64a7('0x5'));var path=require(_0x64a7('0x6'));var sox=require(_0x64a7('0x7'));var csv=require(_0x64a7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x64a7('0x9'));var _=require(_0x64a7('0xa'));var squel=require(_0x64a7('0xb'));var crypto=require(_0x64a7('0xc'));var jsforce=require(_0x64a7('0xd'));var deskjs=require(_0x64a7('0xe'));var toCsv=require(_0x64a7('0x8'));var querystring=require(_0x64a7('0xf'));var Papa=require('papaparse');var Redis=require(_0x64a7('0x10'));var authService=require(_0x64a7('0x11'));var qs=require(_0x64a7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x64a7('0x13'));var logger=require(_0x64a7('0x14'))(_0x64a7('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x64a7('0x16'));var db=require(_0x64a7('0x17'))['db'];function respondWithStatusCode(_0x105d11,_0x3d13eb){_0x3d13eb=_0x3d13eb||0xcc;return function(_0x518711){if(_0x518711){return _0x105d11['sendStatus'](_0x3d13eb);}return _0x105d11[_0x64a7('0x18')](_0x3d13eb)[_0x64a7('0x19')]();};}function respondWithResult(_0x504285,_0x382aaf){_0x382aaf=_0x382aaf||0xc8;return function(_0x1675cc){if(_0x1675cc){return _0x504285[_0x64a7('0x18')](_0x382aaf)[_0x64a7('0x1a')](_0x1675cc);}};}function respondWithFilteredResult(_0xcce44a,_0x39229a){return function(_0x2359c6){if(_0x2359c6){var _0x2aa98a=typeof _0x39229a[_0x64a7('0x1b')]===_0x64a7('0x1c')&&typeof _0x39229a[_0x64a7('0x1d')]==='undefined';var _0x35a254=_0x2359c6[_0x64a7('0x1e')];var _0x3dbe86=_0x2aa98a?0x0:_0x39229a[_0x64a7('0x1b')];var _0x43db08=_0x2aa98a?_0x2359c6[_0x64a7('0x1e')]:_0x39229a['offset']+_0x39229a[_0x64a7('0x1d')];var _0x472fae;if(_0x43db08>=_0x35a254){_0x43db08=_0x35a254;_0x472fae=0xc8;}else{_0x472fae=0xce;}_0xcce44a[_0x64a7('0x18')](_0x472fae);return _0xcce44a[_0x64a7('0x1f')](_0x64a7('0x20'),_0x3dbe86+'-'+_0x43db08+'/'+_0x35a254)['json'](_0x2359c6);}return null;};}function patchUpdates(_0x239693){return function(_0xb58bfb){try{jsonpatch[_0x64a7('0x21')](_0xb58bfb,_0x239693,!![]);}catch(_0x321764){return BPromise[_0x64a7('0x22')](_0x321764);}return _0xb58bfb[_0x64a7('0x23')]();};}function saveUpdates(_0xa2a7ca,_0x17697a){return function(_0x5c5048){if(_0x5c5048){return _0x5c5048[_0x64a7('0x24')](_0xa2a7ca)[_0x64a7('0x25')](function(_0x1227a4){return _0x1227a4;});}return null;};}function removeEntity(_0x5b9fb5,_0xbaa6ea){return function(_0x19d141){if(_0x19d141){return _0x19d141[_0x64a7('0x26')]()['then'](function(){_0x5b9fb5[_0x64a7('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ee6f0,_0x41ed3a){return function(_0x4166c0){if(!_0x4166c0){_0x2ee6f0[_0x64a7('0x27')](0x194);}return _0x4166c0;};}function handleError(_0x301e3c,_0x57430c){_0x57430c=_0x57430c||0x1f4;return function(_0x50b290){logger['error'](_0x50b290[_0x64a7('0x28')]);if(_0x50b290[_0x64a7('0x29')]){delete _0x50b290[_0x64a7('0x29')];}_0x301e3c[_0x64a7('0x18')](_0x57430c)['send'](_0x50b290);};}exports[_0x64a7('0x2a')]=function(_0x5e5269,_0x1e7301){var _0x13da72={},_0x5efb30={},_0x123860={'count':0x0,'rows':[]};var _0x5514bd=_[_0x64a7('0x2b')](db[_0x64a7('0x2c')][_0x64a7('0x2d')],function(_0x3f9988){return{'name':_0x3f9988[_0x64a7('0x2e')],'type':_0x3f9988['type']['key']};});_0x5efb30[_0x64a7('0x2f')]=_[_0x64a7('0x2b')](_0x5514bd,_0x64a7('0x29'));_0x5efb30['query']=_[_0x64a7('0x30')](_0x5e5269[_0x64a7('0x31')]);_0x5efb30['filters']=_[_0x64a7('0x32')](_0x5efb30['model'],_0x5efb30['query']);_0x13da72[_0x64a7('0x33')]=_['intersection'](_0x5efb30['model'],qs[_0x64a7('0x34')](_0x5e5269[_0x64a7('0x31')][_0x64a7('0x34')]));_0x13da72[_0x64a7('0x33')]=_0x13da72[_0x64a7('0x33')][_0x64a7('0x35')]?_0x13da72[_0x64a7('0x33')]:_0x5efb30[_0x64a7('0x2f')];if(!_0x5e5269[_0x64a7('0x31')][_0x64a7('0x36')]('nolimit')){_0x13da72[_0x64a7('0x1d')]=qs[_0x64a7('0x1d')](_0x5e5269[_0x64a7('0x31')][_0x64a7('0x1d')]);_0x13da72[_0x64a7('0x1b')]=qs['offset'](_0x5e5269[_0x64a7('0x31')][_0x64a7('0x1b')]);}_0x13da72[_0x64a7('0x37')]=qs[_0x64a7('0x38')](_0x5e5269[_0x64a7('0x31')]['sort']);_0x13da72[_0x64a7('0x39')]=qs[_0x64a7('0x3a')](_[_0x64a7('0x3b')](_0x5e5269['query'],_0x5efb30[_0x64a7('0x3a')]),_0x5514bd);if(_0x5e5269['query']['filter']){_0x13da72[_0x64a7('0x39')]=_[_0x64a7('0x3c')](_0x13da72[_0x64a7('0x39')],{'$or':_['map'](_0x5514bd,function(_0x5a10bf){if(_0x5a10bf[_0x64a7('0x3d')]!==_0x64a7('0x3e')){var _0x3d9efb={};_0x3d9efb[_0x5a10bf['name']]={'$like':'%'+_0x5e5269[_0x64a7('0x31')][_0x64a7('0x3f')]+'%'};return _0x3d9efb;}})});}_0x13da72=_[_0x64a7('0x3c')]({},_0x13da72,_0x5e5269[_0x64a7('0x40')]);var _0x24d43f={'where':_0x13da72[_0x64a7('0x39')]};return db['ZohoConfiguration']['count'](_0x24d43f)[_0x64a7('0x25')](function(_0x2629be){_0x123860[_0x64a7('0x1e')]=_0x2629be;if(_0x5e5269[_0x64a7('0x31')]['includeAll']){_0x13da72[_0x64a7('0x41')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x64a7('0x42')](_0x13da72);})[_0x64a7('0x25')](function(_0x3f58c3){_0x123860['rows']=_0x3f58c3;return _0x123860;})['then'](respondWithFilteredResult(_0x1e7301,_0x13da72))[_0x64a7('0x43')](handleError(_0x1e7301,null));};exports['show']=function(_0x49faa0,_0x51b378){var _0x43e1ff={'raw':![],'where':{'id':_0x49faa0[_0x64a7('0x44')]['id']}},_0x31c2c1={};_0x31c2c1['model']=_[_0x64a7('0x30')](db[_0x64a7('0x2c')]['rawAttributes']);_0x31c2c1[_0x64a7('0x31')]=_['keys'](_0x49faa0['query']);_0x31c2c1[_0x64a7('0x3a')]=_['intersection'](_0x31c2c1[_0x64a7('0x2f')],_0x31c2c1[_0x64a7('0x31')]);_0x43e1ff['attributes']=_[_0x64a7('0x32')](_0x31c2c1['model'],qs[_0x64a7('0x34')](_0x49faa0[_0x64a7('0x31')][_0x64a7('0x34')]));_0x43e1ff[_0x64a7('0x33')]=_0x43e1ff[_0x64a7('0x33')]['length']?_0x43e1ff['attributes']:_0x31c2c1[_0x64a7('0x2f')];if(_0x49faa0[_0x64a7('0x31')][_0x64a7('0x45')]){_0x43e1ff[_0x64a7('0x41')]=[{'all':!![]}];}_0x43e1ff=_[_0x64a7('0x3c')]({},_0x43e1ff,_0x49faa0[_0x64a7('0x40')]);return db[_0x64a7('0x2c')][_0x64a7('0x46')](_0x43e1ff)[_0x64a7('0x25')](handleEntityNotFound(_0x51b378,null))['then'](respondWithResult(_0x51b378,null))[_0x64a7('0x43')](handleError(_0x51b378,null));};exports[_0x64a7('0x47')]=function(_0x255d6b,_0x6ab145){return db['ZohoConfiguration'][_0x64a7('0x47')](_0x255d6b['body'],{})['then'](respondWithResult(_0x6ab145,0xc9))[_0x64a7('0x43')](handleError(_0x6ab145,null));};exports[_0x64a7('0x24')]=function(_0x5475d4,_0x4ec98a){if(_0x5475d4[_0x64a7('0x48')]['id']){delete _0x5475d4[_0x64a7('0x48')]['id'];}return db[_0x64a7('0x2c')][_0x64a7('0x46')]({'where':{'id':_0x5475d4[_0x64a7('0x44')]['id']}})[_0x64a7('0x25')](handleEntityNotFound(_0x4ec98a,null))['then'](saveUpdates(_0x5475d4[_0x64a7('0x48')],null))[_0x64a7('0x25')](respondWithResult(_0x4ec98a,null))[_0x64a7('0x43')](handleError(_0x4ec98a,null));};exports[_0x64a7('0x26')]=function(_0x9e77df,_0xbfb827){return db[_0x64a7('0x2c')][_0x64a7('0x46')]({'where':{'id':_0x9e77df['params']['id']}})[_0x64a7('0x25')](handleEntityNotFound(_0xbfb827,null))[_0x64a7('0x25')](removeEntity(_0xbfb827,null))[_0x64a7('0x43')](handleError(_0xbfb827,null));};exports[_0x64a7('0x49')]=function(_0x477d1d,_0x503f6d,_0x1eddf4){var _0x1be5f8={};var _0x510d3c={};var _0x5baf53;var _0x88c7e6;return db[_0x64a7('0x2c')][_0x64a7('0x4a')]({'where':{'id':_0x477d1d['params']['id']}})['then'](handleEntityNotFound(_0x503f6d,null))['then'](function(_0x5e563f){if(_0x5e563f){_0x5baf53=_0x5e563f;_0x510d3c[_0x64a7('0x2f')]=_[_0x64a7('0x30')](db['ZohoField'][_0x64a7('0x2d')]);_0x510d3c['query']=_['keys'](_0x477d1d[_0x64a7('0x31')]);_0x510d3c[_0x64a7('0x3a')]=_['intersection'](_0x510d3c['model'],_0x510d3c[_0x64a7('0x31')]);_0x1be5f8['attributes']=_['intersection'](_0x510d3c[_0x64a7('0x2f')],qs[_0x64a7('0x34')](_0x477d1d[_0x64a7('0x31')][_0x64a7('0x34')]));_0x1be5f8[_0x64a7('0x33')]=_0x1be5f8[_0x64a7('0x33')][_0x64a7('0x35')]?_0x1be5f8['attributes']:_0x510d3c[_0x64a7('0x2f')];_0x1be5f8[_0x64a7('0x37')]=qs[_0x64a7('0x38')](_0x477d1d[_0x64a7('0x31')][_0x64a7('0x38')]);_0x1be5f8[_0x64a7('0x39')]=qs['filters'](_[_0x64a7('0x3b')](_0x477d1d[_0x64a7('0x31')],_0x510d3c[_0x64a7('0x3a')]));if(_0x477d1d[_0x64a7('0x31')][_0x64a7('0x3f')]){_0x1be5f8[_0x64a7('0x39')]=_['merge'](_0x1be5f8[_0x64a7('0x39')],{'$or':_['map'](_0x1be5f8['attributes'],function(_0x56b7ab){var _0x4c1a2b={};_0x4c1a2b[_0x56b7ab]={'$like':'%'+_0x477d1d['query'][_0x64a7('0x3f')]+'%'};return _0x4c1a2b;})});}_0x1be5f8=_['merge']({},_0x1be5f8,_0x477d1d[_0x64a7('0x40')]);return _0x5baf53[_0x64a7('0x49')](_0x1be5f8);}})[_0x64a7('0x25')](function(_0x361459){if(_0x361459){_0x88c7e6=_0x361459[_0x64a7('0x35')];if(!_0x477d1d[_0x64a7('0x31')][_0x64a7('0x36')](_0x64a7('0x4b'))){_0x1be5f8['limit']=qs[_0x64a7('0x1d')](_0x477d1d[_0x64a7('0x31')][_0x64a7('0x1d')]);_0x1be5f8[_0x64a7('0x1b')]=qs['offset'](_0x477d1d[_0x64a7('0x31')]['offset']);}return _0x5baf53[_0x64a7('0x49')](_0x1be5f8);}})[_0x64a7('0x25')](function(_0x11b168){if(_0x11b168){return _0x11b168?{'count':_0x88c7e6,'rows':_0x11b168}:null;}})[_0x64a7('0x25')](respondWithResult(_0x503f6d,null))[_0x64a7('0x43')](handleError(_0x503f6d,null));};exports[_0x64a7('0x4c')]=function(_0x32a17c,_0x496e14,_0x1b8ceb){var _0x2c784a={};var _0x5d683c={};var _0x34b9ef;var _0x378955;return db[_0x64a7('0x2c')][_0x64a7('0x4a')]({'where':{'id':_0x32a17c[_0x64a7('0x44')]['id']}})[_0x64a7('0x25')](handleEntityNotFound(_0x496e14,null))[_0x64a7('0x25')](function(_0x432e2c){if(_0x432e2c){_0x34b9ef=_0x432e2c;_0x5d683c['model']=_[_0x64a7('0x30')](db[_0x64a7('0x4d')][_0x64a7('0x2d')]);_0x5d683c[_0x64a7('0x31')]=_['keys'](_0x32a17c['query']);_0x5d683c[_0x64a7('0x3a')]=_['intersection'](_0x5d683c[_0x64a7('0x2f')],_0x5d683c['query']);_0x2c784a[_0x64a7('0x33')]=_[_0x64a7('0x32')](_0x5d683c['model'],qs['fields'](_0x32a17c[_0x64a7('0x31')][_0x64a7('0x34')]));_0x2c784a[_0x64a7('0x33')]=_0x2c784a[_0x64a7('0x33')]['length']?_0x2c784a['attributes']:_0x5d683c[_0x64a7('0x2f')];_0x2c784a['order']=qs[_0x64a7('0x38')](_0x32a17c[_0x64a7('0x31')]['sort']);_0x2c784a['where']=qs['filters'](_[_0x64a7('0x3b')](_0x32a17c[_0x64a7('0x31')],_0x5d683c['filters']));if(_0x32a17c[_0x64a7('0x31')]['filter']){_0x2c784a[_0x64a7('0x39')]=_[_0x64a7('0x3c')](_0x2c784a[_0x64a7('0x39')],{'$or':_[_0x64a7('0x2b')](_0x2c784a['attributes'],function(_0x1fb194){var _0x1cb2d2={};_0x1cb2d2[_0x1fb194]={'$like':'%'+_0x32a17c[_0x64a7('0x31')]['filter']+'%'};return _0x1cb2d2;})});}_0x2c784a=_[_0x64a7('0x3c')]({},_0x2c784a,_0x32a17c[_0x64a7('0x40')]);return _0x34b9ef['getSubjects'](_0x2c784a);}})[_0x64a7('0x25')](function(_0x5bf234){if(_0x5bf234){_0x378955=_0x5bf234[_0x64a7('0x35')];if(!_0x32a17c['query'][_0x64a7('0x36')]('nolimit')){_0x2c784a[_0x64a7('0x1d')]=qs[_0x64a7('0x1d')](_0x32a17c[_0x64a7('0x31')]['limit']);_0x2c784a['offset']=qs[_0x64a7('0x1b')](_0x32a17c[_0x64a7('0x31')][_0x64a7('0x1b')]);}return _0x34b9ef[_0x64a7('0x4c')](_0x2c784a);}})[_0x64a7('0x25')](function(_0x19620b){if(_0x19620b){return _0x19620b?{'count':_0x378955,'rows':_0x19620b}:null;}})[_0x64a7('0x25')](respondWithResult(_0x496e14,null))[_0x64a7('0x43')](handleError(_0x496e14,null));};exports[_0x64a7('0x4e')]=function(_0x1bb092,_0x318d78,_0x44b11d){var _0x3a4d61={};var _0x508d3b={};var _0x32a422;var _0x26ac43;return db[_0x64a7('0x2c')]['findOne']({'where':{'id':_0x1bb092['params']['id']}})[_0x64a7('0x25')](handleEntityNotFound(_0x318d78,null))['then'](function(_0x37f688){if(_0x37f688){_0x32a422=_0x37f688;_0x508d3b[_0x64a7('0x2f')]=_[_0x64a7('0x30')](db[_0x64a7('0x4d')][_0x64a7('0x2d')]);_0x508d3b[_0x64a7('0x31')]=_['keys'](_0x1bb092[_0x64a7('0x31')]);_0x508d3b[_0x64a7('0x3a')]=_[_0x64a7('0x32')](_0x508d3b['model'],_0x508d3b[_0x64a7('0x31')]);_0x3a4d61[_0x64a7('0x33')]=_[_0x64a7('0x32')](_0x508d3b[_0x64a7('0x2f')],qs[_0x64a7('0x34')](_0x1bb092['query'][_0x64a7('0x34')]));_0x3a4d61[_0x64a7('0x33')]=_0x3a4d61[_0x64a7('0x33')]['length']?_0x3a4d61[_0x64a7('0x33')]:_0x508d3b[_0x64a7('0x2f')];_0x3a4d61[_0x64a7('0x37')]=qs[_0x64a7('0x38')](_0x1bb092[_0x64a7('0x31')][_0x64a7('0x38')]);_0x3a4d61['where']=qs[_0x64a7('0x3a')](_[_0x64a7('0x3b')](_0x1bb092[_0x64a7('0x31')],_0x508d3b['filters']));if(_0x1bb092[_0x64a7('0x31')][_0x64a7('0x3f')]){_0x3a4d61[_0x64a7('0x39')]=_['merge'](_0x3a4d61['where'],{'$or':_['map'](_0x3a4d61[_0x64a7('0x33')],function(_0x106f9e){var _0x1c14b0={};_0x1c14b0[_0x106f9e]={'$like':'%'+_0x1bb092[_0x64a7('0x31')]['filter']+'%'};return _0x1c14b0;})});}_0x3a4d61=_['merge']({},_0x3a4d61,_0x1bb092['options']);return _0x32a422[_0x64a7('0x4e')](_0x3a4d61);}})[_0x64a7('0x25')](function(_0x63128f){if(_0x63128f){_0x26ac43=_0x63128f[_0x64a7('0x35')];if(!_0x1bb092[_0x64a7('0x31')][_0x64a7('0x36')](_0x64a7('0x4b'))){_0x3a4d61[_0x64a7('0x1d')]=qs[_0x64a7('0x1d')](_0x1bb092[_0x64a7('0x31')][_0x64a7('0x1d')]);_0x3a4d61[_0x64a7('0x1b')]=qs['offset'](_0x1bb092[_0x64a7('0x31')][_0x64a7('0x1b')]);}return _0x32a422[_0x64a7('0x4e')](_0x3a4d61);}})[_0x64a7('0x25')](function(_0x2e53ec){if(_0x2e53ec){return _0x2e53ec?{'count':_0x26ac43,'rows':_0x2e53ec}:null;}})['then'](respondWithResult(_0x318d78,null))[_0x64a7('0x43')](handleError(_0x318d78,null));}; \ No newline at end of file +var _0x0c28=['undefined','count','set','Content-Range','reject','save','update','then','stack','name','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','ZohoConfiguration','include','findAll','rows','catch','params','includeAll','find','create','body','findOne','ZohoField','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit'];(function(_0x18ed05,_0x3d7898){var _0x55413f=function(_0x13d97e){while(--_0x13d97e){_0x18ed05['push'](_0x18ed05['shift']());}};_0x55413f(++_0x3d7898);}(_0x0c28,0x7d));var _0x80c2=function(_0x10a14c,_0x4bc3fd){_0x10a14c=_0x10a14c-0x0;var _0x42ec79=_0x0c28[_0x10a14c];return _0x42ec79;};'use strict';var emlformat=require(_0x80c2('0x0'));var rimraf=require(_0x80c2('0x1'));var zipdir=require(_0x80c2('0x2'));var jsonpatch=require(_0x80c2('0x3'));var rp=require(_0x80c2('0x4'));var moment=require(_0x80c2('0x5'));var BPromise=require(_0x80c2('0x6'));var Mustache=require('mustache');var util=require(_0x80c2('0x7'));var path=require('path');var sox=require(_0x80c2('0x8'));var csv=require(_0x80c2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x80c2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x80c2('0x9'));var querystring=require(_0x80c2('0xb'));var Papa=require('papaparse');var Redis=require(_0x80c2('0xc'));var authService=require(_0x80c2('0xd'));var qs=require(_0x80c2('0xe'));var as=require(_0x80c2('0xf'));var hardwareService=require(_0x80c2('0x10'));var logger=require(_0x80c2('0x11'))(_0x80c2('0x12'));var utils=require(_0x80c2('0x13'));var config=require(_0x80c2('0x14'));var licenseUtil=require(_0x80c2('0x15'));var db=require(_0x80c2('0x16'))['db'];function respondWithStatusCode(_0x320ca4,_0x577c07){_0x577c07=_0x577c07||0xcc;return function(_0x36fdc7){if(_0x36fdc7){return _0x320ca4[_0x80c2('0x17')](_0x577c07);}return _0x320ca4[_0x80c2('0x18')](_0x577c07)[_0x80c2('0x19')]();};}function respondWithResult(_0x172436,_0x231777){_0x231777=_0x231777||0xc8;return function(_0x4eaadf){if(_0x4eaadf){return _0x172436[_0x80c2('0x18')](_0x231777)[_0x80c2('0x1a')](_0x4eaadf);}};}function respondWithFilteredResult(_0x3f3189,_0x13c7fb){return function(_0x8939d9){if(_0x8939d9){var _0x536f7a=typeof _0x13c7fb[_0x80c2('0x1b')]==='undefined'&&typeof _0x13c7fb[_0x80c2('0x1c')]===_0x80c2('0x1d');var _0x3615c7=_0x8939d9['count'];var _0x2888b1=_0x536f7a?0x0:_0x13c7fb[_0x80c2('0x1b')];var _0x2d35bb=_0x536f7a?_0x8939d9[_0x80c2('0x1e')]:_0x13c7fb[_0x80c2('0x1b')]+_0x13c7fb['limit'];var _0x3d7722;if(_0x2d35bb>=_0x3615c7){_0x2d35bb=_0x3615c7;_0x3d7722=0xc8;}else{_0x3d7722=0xce;}_0x3f3189[_0x80c2('0x18')](_0x3d7722);return _0x3f3189[_0x80c2('0x1f')](_0x80c2('0x20'),_0x2888b1+'-'+_0x2d35bb+'/'+_0x3615c7)[_0x80c2('0x1a')](_0x8939d9);}return null;};}function patchUpdates(_0x1dc1fc){return function(_0x2f97a4){try{jsonpatch['apply'](_0x2f97a4,_0x1dc1fc,!![]);}catch(_0x10455){return BPromise[_0x80c2('0x21')](_0x10455);}return _0x2f97a4[_0x80c2('0x22')]();};}function saveUpdates(_0x47a205,_0x5a3f2a){return function(_0x3af8b4){if(_0x3af8b4){return _0x3af8b4[_0x80c2('0x23')](_0x47a205)[_0x80c2('0x24')](function(_0x74d088){return _0x74d088;});}return null;};}function removeEntity(_0x39c655,_0x3bbf2b){return function(_0x15ecd7){if(_0x15ecd7){return _0x15ecd7['destroy']()[_0x80c2('0x24')](function(){_0x39c655[_0x80c2('0x18')](0xcc)[_0x80c2('0x19')]();});}};}function handleEntityNotFound(_0x224eee,_0x5f1aa4){return function(_0x176db9){if(!_0x176db9){_0x224eee[_0x80c2('0x17')](0x194);}return _0x176db9;};}function handleError(_0x129311,_0x359963){_0x359963=_0x359963||0x1f4;return function(_0x3e479b){logger['error'](_0x3e479b[_0x80c2('0x25')]);if(_0x3e479b[_0x80c2('0x26')]){delete _0x3e479b[_0x80c2('0x26')];}_0x129311['status'](_0x359963)['send'](_0x3e479b);};}exports[_0x80c2('0x27')]=function(_0x48b635,_0x2dd8e9){var _0x3d2b81={},_0x112870={},_0x47deb3={'count':0x0,'rows':[]};var _0x35f8c9=_[_0x80c2('0x28')](db['ZohoConfiguration'][_0x80c2('0x29')],function(_0x5cdd40){return{'name':_0x5cdd40[_0x80c2('0x2a')],'type':_0x5cdd40['type'][_0x80c2('0x2b')]};});_0x112870[_0x80c2('0x2c')]=_[_0x80c2('0x28')](_0x35f8c9,_0x80c2('0x26'));_0x112870['query']=_[_0x80c2('0x2d')](_0x48b635[_0x80c2('0x2e')]);_0x112870['filters']=_[_0x80c2('0x2f')](_0x112870[_0x80c2('0x2c')],_0x112870[_0x80c2('0x2e')]);_0x3d2b81[_0x80c2('0x30')]=_[_0x80c2('0x2f')](_0x112870['model'],qs[_0x80c2('0x31')](_0x48b635[_0x80c2('0x2e')][_0x80c2('0x31')]));_0x3d2b81[_0x80c2('0x30')]=_0x3d2b81[_0x80c2('0x30')][_0x80c2('0x32')]?_0x3d2b81[_0x80c2('0x30')]:_0x112870[_0x80c2('0x2c')];if(!_0x48b635[_0x80c2('0x2e')][_0x80c2('0x33')]('nolimit')){_0x3d2b81[_0x80c2('0x1c')]=qs[_0x80c2('0x1c')](_0x48b635[_0x80c2('0x2e')][_0x80c2('0x1c')]);_0x3d2b81[_0x80c2('0x1b')]=qs['offset'](_0x48b635[_0x80c2('0x2e')]['offset']);}_0x3d2b81[_0x80c2('0x34')]=qs[_0x80c2('0x35')](_0x48b635[_0x80c2('0x2e')][_0x80c2('0x35')]);_0x3d2b81[_0x80c2('0x36')]=qs['filters'](_[_0x80c2('0x37')](_0x48b635[_0x80c2('0x2e')],_0x112870[_0x80c2('0x38')]),_0x35f8c9);if(_0x48b635['query'][_0x80c2('0x39')]){_0x3d2b81[_0x80c2('0x36')]=_[_0x80c2('0x3a')](_0x3d2b81[_0x80c2('0x36')],{'$or':_['map'](_0x35f8c9,function(_0xd635ef){if(_0xd635ef['type']!==_0x80c2('0x3b')){var _0x18f615={};_0x18f615[_0xd635ef[_0x80c2('0x26')]]={'$like':'%'+_0x48b635[_0x80c2('0x2e')]['filter']+'%'};return _0x18f615;}})});}_0x3d2b81=_[_0x80c2('0x3a')]({},_0x3d2b81,_0x48b635[_0x80c2('0x3c')]);var _0x4227a7={'where':_0x3d2b81[_0x80c2('0x36')]};return db[_0x80c2('0x3d')][_0x80c2('0x1e')](_0x4227a7)[_0x80c2('0x24')](function(_0x39c303){_0x47deb3['count']=_0x39c303;if(_0x48b635[_0x80c2('0x2e')]['includeAll']){_0x3d2b81[_0x80c2('0x3e')]=[{'all':!![]}];}return db[_0x80c2('0x3d')][_0x80c2('0x3f')](_0x3d2b81);})[_0x80c2('0x24')](function(_0x19f0f6){_0x47deb3[_0x80c2('0x40')]=_0x19f0f6;return _0x47deb3;})[_0x80c2('0x24')](respondWithFilteredResult(_0x2dd8e9,_0x3d2b81))[_0x80c2('0x41')](handleError(_0x2dd8e9,null));};exports['show']=function(_0x20e83a,_0x199261){var _0x5233bc={'raw':![],'where':{'id':_0x20e83a[_0x80c2('0x42')]['id']}},_0x240739={};_0x240739['model']=_[_0x80c2('0x2d')](db['ZohoConfiguration'][_0x80c2('0x29')]);_0x240739['query']=_[_0x80c2('0x2d')](_0x20e83a[_0x80c2('0x2e')]);_0x240739[_0x80c2('0x38')]=_['intersection'](_0x240739[_0x80c2('0x2c')],_0x240739['query']);_0x5233bc[_0x80c2('0x30')]=_[_0x80c2('0x2f')](_0x240739['model'],qs[_0x80c2('0x31')](_0x20e83a[_0x80c2('0x2e')]['fields']));_0x5233bc[_0x80c2('0x30')]=_0x5233bc[_0x80c2('0x30')][_0x80c2('0x32')]?_0x5233bc[_0x80c2('0x30')]:_0x240739[_0x80c2('0x2c')];if(_0x20e83a['query'][_0x80c2('0x43')]){_0x5233bc[_0x80c2('0x3e')]=[{'all':!![]}];}_0x5233bc=_[_0x80c2('0x3a')]({},_0x5233bc,_0x20e83a[_0x80c2('0x3c')]);return db['ZohoConfiguration'][_0x80c2('0x44')](_0x5233bc)['then'](handleEntityNotFound(_0x199261,null))['then'](respondWithResult(_0x199261,null))[_0x80c2('0x41')](handleError(_0x199261,null));};exports['create']=function(_0x30416e,_0x3140ce){return db['ZohoConfiguration'][_0x80c2('0x45')](_0x30416e[_0x80c2('0x46')],{})[_0x80c2('0x24')](respondWithResult(_0x3140ce,0xc9))[_0x80c2('0x41')](handleError(_0x3140ce,null));};exports[_0x80c2('0x23')]=function(_0x29209a,_0x51ad07){if(_0x29209a[_0x80c2('0x46')]['id']){delete _0x29209a[_0x80c2('0x46')]['id'];}return db[_0x80c2('0x3d')][_0x80c2('0x44')]({'where':{'id':_0x29209a[_0x80c2('0x42')]['id']}})[_0x80c2('0x24')](handleEntityNotFound(_0x51ad07,null))[_0x80c2('0x24')](saveUpdates(_0x29209a[_0x80c2('0x46')],null))[_0x80c2('0x24')](respondWithResult(_0x51ad07,null))[_0x80c2('0x41')](handleError(_0x51ad07,null));};exports['destroy']=function(_0x79340b,_0x254e24){return db['ZohoConfiguration']['find']({'where':{'id':_0x79340b[_0x80c2('0x42')]['id']}})[_0x80c2('0x24')](handleEntityNotFound(_0x254e24,null))[_0x80c2('0x24')](removeEntity(_0x254e24,null))['catch'](handleError(_0x254e24,null));};exports['getFields']=function(_0x516fbd,_0x1e2846,_0x4e01d7){var _0x35bfb6={};var _0x296d0d={};var _0x2f3ced;var _0xe438f6;return db[_0x80c2('0x3d')][_0x80c2('0x47')]({'where':{'id':_0x516fbd['params']['id']}})['then'](handleEntityNotFound(_0x1e2846,null))[_0x80c2('0x24')](function(_0x136877){if(_0x136877){_0x2f3ced=_0x136877;_0x296d0d['model']=_[_0x80c2('0x2d')](db[_0x80c2('0x48')]['rawAttributes']);_0x296d0d[_0x80c2('0x2e')]=_['keys'](_0x516fbd[_0x80c2('0x2e')]);_0x296d0d[_0x80c2('0x38')]=_[_0x80c2('0x2f')](_0x296d0d[_0x80c2('0x2c')],_0x296d0d[_0x80c2('0x2e')]);_0x35bfb6[_0x80c2('0x30')]=_['intersection'](_0x296d0d[_0x80c2('0x2c')],qs['fields'](_0x516fbd['query'][_0x80c2('0x31')]));_0x35bfb6[_0x80c2('0x30')]=_0x35bfb6[_0x80c2('0x30')][_0x80c2('0x32')]?_0x35bfb6['attributes']:_0x296d0d['model'];_0x35bfb6[_0x80c2('0x34')]=qs[_0x80c2('0x35')](_0x516fbd['query'][_0x80c2('0x35')]);_0x35bfb6[_0x80c2('0x36')]=qs[_0x80c2('0x38')](_[_0x80c2('0x37')](_0x516fbd[_0x80c2('0x2e')],_0x296d0d[_0x80c2('0x38')]));if(_0x516fbd['query'][_0x80c2('0x39')]){_0x35bfb6[_0x80c2('0x36')]=_[_0x80c2('0x3a')](_0x35bfb6[_0x80c2('0x36')],{'$or':_[_0x80c2('0x28')](_0x35bfb6['attributes'],function(_0x13d54c){var _0xc6b54f={};_0xc6b54f[_0x13d54c]={'$like':'%'+_0x516fbd[_0x80c2('0x2e')][_0x80c2('0x39')]+'%'};return _0xc6b54f;})});}_0x35bfb6=_[_0x80c2('0x3a')]({},_0x35bfb6,_0x516fbd[_0x80c2('0x3c')]);return _0x2f3ced[_0x80c2('0x49')](_0x35bfb6);}})[_0x80c2('0x24')](function(_0x2deefe){if(_0x2deefe){_0xe438f6=_0x2deefe[_0x80c2('0x32')];if(!_0x516fbd[_0x80c2('0x2e')][_0x80c2('0x33')](_0x80c2('0x4a'))){_0x35bfb6[_0x80c2('0x1c')]=qs[_0x80c2('0x1c')](_0x516fbd[_0x80c2('0x2e')]['limit']);_0x35bfb6[_0x80c2('0x1b')]=qs[_0x80c2('0x1b')](_0x516fbd[_0x80c2('0x2e')][_0x80c2('0x1b')]);}return _0x2f3ced[_0x80c2('0x49')](_0x35bfb6);}})[_0x80c2('0x24')](function(_0x466cf1){if(_0x466cf1){return _0x466cf1?{'count':_0xe438f6,'rows':_0x466cf1}:null;}})[_0x80c2('0x24')](respondWithResult(_0x1e2846,null))['catch'](handleError(_0x1e2846,null));};exports[_0x80c2('0x4b')]=function(_0x22c71a,_0x51475e,_0x316f5c){var _0x1253a9={};var _0x195ba6={};var _0x196142;var _0x4e4a51;return db[_0x80c2('0x3d')][_0x80c2('0x47')]({'where':{'id':_0x22c71a[_0x80c2('0x42')]['id']}})['then'](handleEntityNotFound(_0x51475e,null))[_0x80c2('0x24')](function(_0x12fc56){if(_0x12fc56){_0x196142=_0x12fc56;_0x195ba6[_0x80c2('0x2c')]=_[_0x80c2('0x2d')](db[_0x80c2('0x48')][_0x80c2('0x29')]);_0x195ba6[_0x80c2('0x2e')]=_['keys'](_0x22c71a[_0x80c2('0x2e')]);_0x195ba6['filters']=_['intersection'](_0x195ba6[_0x80c2('0x2c')],_0x195ba6[_0x80c2('0x2e')]);_0x1253a9[_0x80c2('0x30')]=_[_0x80c2('0x2f')](_0x195ba6[_0x80c2('0x2c')],qs[_0x80c2('0x31')](_0x22c71a[_0x80c2('0x2e')][_0x80c2('0x31')]));_0x1253a9['attributes']=_0x1253a9[_0x80c2('0x30')][_0x80c2('0x32')]?_0x1253a9['attributes']:_0x195ba6[_0x80c2('0x2c')];_0x1253a9[_0x80c2('0x34')]=qs['sort'](_0x22c71a['query'][_0x80c2('0x35')]);_0x1253a9[_0x80c2('0x36')]=qs[_0x80c2('0x38')](_[_0x80c2('0x37')](_0x22c71a[_0x80c2('0x2e')],_0x195ba6[_0x80c2('0x38')]));if(_0x22c71a[_0x80c2('0x2e')][_0x80c2('0x39')]){_0x1253a9[_0x80c2('0x36')]=_[_0x80c2('0x3a')](_0x1253a9[_0x80c2('0x36')],{'$or':_[_0x80c2('0x28')](_0x1253a9['attributes'],function(_0x17eb09){var _0x2bcaaa={};_0x2bcaaa[_0x17eb09]={'$like':'%'+_0x22c71a[_0x80c2('0x2e')][_0x80c2('0x39')]+'%'};return _0x2bcaaa;})});}_0x1253a9=_[_0x80c2('0x3a')]({},_0x1253a9,_0x22c71a['options']);return _0x196142[_0x80c2('0x4b')](_0x1253a9);}})[_0x80c2('0x24')](function(_0xac88b7){if(_0xac88b7){_0x4e4a51=_0xac88b7[_0x80c2('0x32')];if(!_0x22c71a[_0x80c2('0x2e')]['hasOwnProperty']('nolimit')){_0x1253a9['limit']=qs[_0x80c2('0x1c')](_0x22c71a[_0x80c2('0x2e')][_0x80c2('0x1c')]);_0x1253a9[_0x80c2('0x1b')]=qs[_0x80c2('0x1b')](_0x22c71a[_0x80c2('0x2e')][_0x80c2('0x1b')]);}return _0x196142[_0x80c2('0x4b')](_0x1253a9);}})[_0x80c2('0x24')](function(_0x71ffd7){if(_0x71ffd7){return _0x71ffd7?{'count':_0x4e4a51,'rows':_0x71ffd7}:null;}})[_0x80c2('0x24')](respondWithResult(_0x51475e,null))[_0x80c2('0x41')](handleError(_0x51475e,null));};exports[_0x80c2('0x4c')]=function(_0x3d9083,_0x5209f6,_0x4428ec){var _0x2fa521={};var _0x5c7838={};var _0x2e567a;var _0x397777;return db[_0x80c2('0x3d')][_0x80c2('0x47')]({'where':{'id':_0x3d9083['params']['id']}})[_0x80c2('0x24')](handleEntityNotFound(_0x5209f6,null))[_0x80c2('0x24')](function(_0x17bfaa){if(_0x17bfaa){_0x2e567a=_0x17bfaa;_0x5c7838[_0x80c2('0x2c')]=_[_0x80c2('0x2d')](db[_0x80c2('0x48')]['rawAttributes']);_0x5c7838[_0x80c2('0x2e')]=_[_0x80c2('0x2d')](_0x3d9083['query']);_0x5c7838[_0x80c2('0x38')]=_[_0x80c2('0x2f')](_0x5c7838['model'],_0x5c7838['query']);_0x2fa521[_0x80c2('0x30')]=_[_0x80c2('0x2f')](_0x5c7838[_0x80c2('0x2c')],qs[_0x80c2('0x31')](_0x3d9083['query']['fields']));_0x2fa521[_0x80c2('0x30')]=_0x2fa521['attributes']['length']?_0x2fa521[_0x80c2('0x30')]:_0x5c7838[_0x80c2('0x2c')];_0x2fa521[_0x80c2('0x34')]=qs[_0x80c2('0x35')](_0x3d9083[_0x80c2('0x2e')][_0x80c2('0x35')]);_0x2fa521[_0x80c2('0x36')]=qs[_0x80c2('0x38')](_['pick'](_0x3d9083[_0x80c2('0x2e')],_0x5c7838['filters']));if(_0x3d9083[_0x80c2('0x2e')][_0x80c2('0x39')]){_0x2fa521[_0x80c2('0x36')]=_[_0x80c2('0x3a')](_0x2fa521[_0x80c2('0x36')],{'$or':_[_0x80c2('0x28')](_0x2fa521[_0x80c2('0x30')],function(_0x15caea){var _0x2552ee={};_0x2552ee[_0x15caea]={'$like':'%'+_0x3d9083[_0x80c2('0x2e')]['filter']+'%'};return _0x2552ee;})});}_0x2fa521=_[_0x80c2('0x3a')]({},_0x2fa521,_0x3d9083[_0x80c2('0x3c')]);return _0x2e567a[_0x80c2('0x4c')](_0x2fa521);}})[_0x80c2('0x24')](function(_0x29b715){if(_0x29b715){_0x397777=_0x29b715[_0x80c2('0x32')];if(!_0x3d9083['query']['hasOwnProperty'](_0x80c2('0x4a'))){_0x2fa521[_0x80c2('0x1c')]=qs[_0x80c2('0x1c')](_0x3d9083[_0x80c2('0x2e')]['limit']);_0x2fa521[_0x80c2('0x1b')]=qs[_0x80c2('0x1b')](_0x3d9083[_0x80c2('0x2e')][_0x80c2('0x1b')]);}return _0x2e567a[_0x80c2('0x4c')](_0x2fa521);}})[_0x80c2('0x24')](function(_0x3bf44a){if(_0x3bf44a){return _0x3bf44a?{'count':_0x397777,'rows':_0x3bf44a}:null;}})[_0x80c2('0x24')](respondWithResult(_0x5209f6,null))[_0x80c2('0x41')](handleError(_0x5209f6,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 797b95a..b5ed83a 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.model.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce0c=['int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./intZohoConfiguration.attributes','exports','define'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xce0c,0xe8));var _0xcce0=function(_0x1e8bea,_0x47bde9){_0x1e8bea=_0x1e8bea-0x0;var _0x29f756=_0xce0c[_0x1e8bea];return _0x29f756;};'use strict';var _=require(_0xcce0('0x0'));var util=require(_0xcce0('0x1'));var logger=require(_0xcce0('0x2'))(_0xcce0('0x3'));var moment=require(_0xcce0('0x4'));var BPromise=require(_0xcce0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcce0('0x6'));var attributes=require(_0xcce0('0x7'));module[_0xcce0('0x8')]=function(_0x238cd2,_0xf6e1fc){return _0x238cd2[_0xcce0('0x9')]('ZohoConfiguration',attributes,{'tableName':_0xcce0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe71e=['./intZohoConfiguration.attributes','define','ZohoConfiguration','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1fda3c,_0xefd4cb){var _0x1a2d1e=function(_0x31a6c3){while(--_0x31a6c3){_0x1fda3c['push'](_0x1fda3c['shift']());}};_0x1a2d1e(++_0xefd4cb);}(_0xe71e,0x100));var _0xee71=function(_0x4e806d,_0x4cc01d){_0x4e806d=_0x4e806d-0x0;var _0x20821f=_0xe71e[_0x4e806d];return _0x20821f;};'use strict';var _=require(_0xee71('0x0'));var util=require(_0xee71('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xee71('0x2'));var BPromise=require(_0xee71('0x3'));var rp=require(_0xee71('0x4'));var fs=require('fs');var path=require(_0xee71('0x5'));var rimraf=require(_0xee71('0x6'));var config=require(_0xee71('0x7'));var attributes=require(_0xee71('0x8'));module['exports']=function(_0x4df6ab,_0x59c46c){return _0x4df6ab[_0xee71('0x9')](_0xee71('0xa'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 85fda2c..fd27b66 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b82=['client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x8c845,_0x39ded0){var _0x3a9f4a=function(_0x47dae5){while(--_0x47dae5){_0x8c845['push'](_0x8c845['shift']());}};_0x3a9f4a(++_0x39ded0);}(_0x2b82,0x147));var _0x22b8=function(_0x5f4add,_0x4280ae){_0x5f4add=_0x5f4add-0x0;var _0x3f1414=_0x2b82[_0x5f4add];return _0x3f1414;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x22b8('0x0'));var BPromise=require(_0x22b8('0x1'));var rs=require(_0x22b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22b8('0x3'))['db'];var utils=require(_0x22b8('0x4'));var logger=require(_0x22b8('0x5'))(_0x22b8('0x6'));var config=require(_0x22b8('0x7'));var jayson=require(_0x22b8('0x8'));var client=jayson[_0x22b8('0x9')][_0x22b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b4fb4,_0x7f04e4,_0x364bc5){return new BPromise(function(_0x16fb02,_0x42a10c){return client[_0x22b8('0xb')](_0x1b4fb4,_0x364bc5)['then'](function(_0x179363){logger[_0x22b8('0xc')](_0x22b8('0xd'),_0x7f04e4,_0x22b8('0xe'));logger['debug'](_0x22b8('0xf'),_0x7f04e4,'request\x20sent',JSON[_0x22b8('0x10')](_0x179363));if(_0x179363['error']){if(_0x179363['error'][_0x22b8('0x11')]===0x1f4){logger[_0x22b8('0x12')](_0x22b8('0xd'),_0x7f04e4,_0x179363['error'][_0x22b8('0x13')]);return _0x42a10c(_0x179363['error']['message']);}logger[_0x22b8('0x12')](_0x22b8('0xd'),_0x7f04e4,_0x179363[_0x22b8('0x12')][_0x22b8('0x13')]);return _0x16fb02(_0x179363[_0x22b8('0x12')]['message']);}else{logger[_0x22b8('0xc')](_0x22b8('0xd'),_0x7f04e4,_0x22b8('0xe'));_0x16fb02(_0x179363['result'][_0x22b8('0x13')]);}})[_0x22b8('0x14')](function(_0x3882ab){logger['error'](_0x22b8('0xd'),_0x7f04e4,_0x3882ab);_0x42a10c(_0x3882ab);});});} \ No newline at end of file +var _0xbf6f=['rpc','jayson/promise','client','request','then','request\x20sent','stringify','error','ZohoConfiguration,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2122d4,_0x6d3065){var _0x428992=function(_0x230f18){while(--_0x230f18){_0x2122d4['push'](_0x2122d4['shift']());}};_0x428992(++_0x6d3065);}(_0xbf6f,0x91));var _0xfbf6=function(_0x56a7fb,_0xe80bc2){_0x56a7fb=_0x56a7fb-0x0;var _0x536ada=_0xbf6f[_0x56a7fb];return _0x536ada;};'use strict';var _=require(_0xfbf6('0x0'));var util=require(_0xfbf6('0x1'));var moment=require(_0xfbf6('0x2'));var BPromise=require(_0xfbf6('0x3'));var rs=require(_0xfbf6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfbf6('0x5'))['db'];var utils=require(_0xfbf6('0x6'));var logger=require('../../config/logger')(_0xfbf6('0x7'));var config=require('../../config/environment');var jayson=require(_0xfbf6('0x8'));var client=jayson[_0xfbf6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40bd26,_0x3303b4,_0x3ab2c4){return new BPromise(function(_0x217760,_0x6ab1e9){return client[_0xfbf6('0xa')](_0x40bd26,_0x3ab2c4)[_0xfbf6('0xb')](function(_0x5bcaba){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x3303b4,_0xfbf6('0xc'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3303b4,'request\x20sent',JSON[_0xfbf6('0xd')](_0x5bcaba));if(_0x5bcaba['error']){if(_0x5bcaba['error']['code']===0x1f4){logger[_0xfbf6('0xe')](_0xfbf6('0xf'),_0x3303b4,_0x5bcaba[_0xfbf6('0xe')][_0xfbf6('0x10')]);return _0x6ab1e9(_0x5bcaba[_0xfbf6('0xe')][_0xfbf6('0x10')]);}logger[_0xfbf6('0xe')](_0xfbf6('0xf'),_0x3303b4,_0x5bcaba['error']['message']);return _0x217760(_0x5bcaba[_0xfbf6('0xe')][_0xfbf6('0x10')]);}else{logger[_0xfbf6('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x3303b4,_0xfbf6('0xc'));_0x217760(_0x5bcaba['result']['message']);}})[_0xfbf6('0x12')](function(_0x37dd2e){logger[_0xfbf6('0xe')](_0xfbf6('0xf'),_0x3303b4,_0x37dd2e);_0x6ab1e9(_0x37dd2e);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 3af1ff2..59f3e2c 100644 --- a/server/api/intZohoField/index.js +++ b/server/api/intZohoField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ddc=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','/:id','show','post','isAuthenticated','update','delete','exports','multer','util'];(function(_0x3e616a,_0x87cb5c){var _0x15f6bf=function(_0x2f066b){while(--_0x2f066b){_0x3e616a['push'](_0x3e616a['shift']());}};_0x15f6bf(++_0x87cb5c);}(_0x4ddc,0x1de));var _0xc4dd=function(_0x3b79c5,_0x269033){_0x3b79c5=_0x3b79c5-0x0;var _0x487e5=_0x4ddc[_0x3b79c5];return _0x487e5;};'use strict';var multer=require(_0xc4dd('0x0'));var util=require(_0xc4dd('0x1'));var path=require('path');var timeout=require(_0xc4dd('0x2'));var express=require(_0xc4dd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc4dd('0x4'));var interaction=require(_0xc4dd('0x5'));var config=require(_0xc4dd('0x6'));var controller=require(_0xc4dd('0x7'));router[_0xc4dd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc4dd('0x8')](_0xc4dd('0x9'),auth['isAuthenticated'](),controller[_0xc4dd('0xa')]);router[_0xc4dd('0xb')]('/',auth[_0xc4dd('0xc')](),controller['create']);router['put'](_0xc4dd('0x9'),auth['isAuthenticated'](),controller[_0xc4dd('0xd')]);router[_0xc4dd('0xe')](_0xc4dd('0x9'),auth[_0xc4dd('0xc')](),controller['destroy']);module[_0xc4dd('0xf')]=router; \ No newline at end of file +var _0x7870=['../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x1872de,_0x2a2c12){var _0x35b800=function(_0x54d4a4){while(--_0x54d4a4){_0x1872de['push'](_0x1872de['shift']());}};_0x35b800(++_0x2a2c12);}(_0x7870,0xde));var _0x0787=function(_0x2983dd,_0x57d354){_0x2983dd=_0x2983dd-0x0;var _0x11d621=_0x7870[_0x2983dd];return _0x11d621;};'use strict';var multer=require(_0x0787('0x0'));var util=require(_0x0787('0x1'));var path=require('path');var timeout=require(_0x0787('0x2'));var express=require(_0x0787('0x3'));var router=express[_0x0787('0x4')]();var fs_extra=require(_0x0787('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0787('0x6'));var config=require(_0x0787('0x7'));var controller=require(_0x0787('0x8'));router[_0x0787('0x9')]('/',auth[_0x0787('0xa')](),controller[_0x0787('0xb')]);router[_0x0787('0x9')](_0x0787('0xc'),auth[_0x0787('0xa')](),controller[_0x0787('0xd')]);router[_0x0787('0xe')]('/',auth[_0x0787('0xa')](),controller[_0x0787('0xf')]);router[_0x0787('0x10')](_0x0787('0xc'),auth[_0x0787('0xa')](),controller[_0x0787('0x11')]);router['delete']('/:id',auth[_0x0787('0xa')](),controller[_0x0787('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 0062163..cd7e238 100644 --- a/server/api/intZohoField/intZohoField.attributes.js +++ b/server/api/intZohoField/intZohoField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd504=['customVariable','keyValue','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd504,0x1ac));var _0x4d50=function(_0x29c261,_0x3af39a){_0x29c261=_0x29c261-0x0;var _0x1a9335=_0xd504[_0x29c261];return _0x1a9335;};'use strict';var Sequelize=require('sequelize');module[_0x4d50('0x0')]={'type':{'type':Sequelize[_0x4d50('0x1')](_0x4d50('0x2'),_0x4d50('0x3'),_0x4d50('0x4'),_0x4d50('0x5'),'picklist'),'defaultValue':_0x4d50('0x2')},'content':{'type':Sequelize[_0x4d50('0x6')]},'key':{'type':Sequelize[_0x4d50('0x6')]},'keyType':{'type':Sequelize[_0x4d50('0x1')](_0x4d50('0x2'),_0x4d50('0x3'),_0x4d50('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4d50('0x6')]},'nameField':{'type':Sequelize[_0x4d50('0x6')]},'customField':{'type':Sequelize[_0x4d50('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4d50('0x6')]}}; \ No newline at end of file +var _0xb7aa=['STRING','customVariable','sequelize','exports','ENUM','string','variable'];(function(_0x2675da,_0x5a250e){var _0x5e6153=function(_0xf93114){while(--_0xf93114){_0x2675da['push'](_0x2675da['shift']());}};_0x5e6153(++_0x5a250e);}(_0xb7aa,0x6b));var _0xab7a=function(_0x510c60,_0x50247e){_0x510c60=_0x510c60-0x0;var _0x49c4aa=_0xb7aa[_0x510c60];return _0x49c4aa;};'use strict';var Sequelize=require(_0xab7a('0x0'));module[_0xab7a('0x1')]={'type':{'type':Sequelize[_0xab7a('0x2')](_0xab7a('0x3'),_0xab7a('0x4'),'customVariable','keyValue','picklist'),'defaultValue':_0xab7a('0x3')},'content':{'type':Sequelize[_0xab7a('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xab7a('0x3'),'variable',_0xab7a('0x6'))},'keyContent':{'type':Sequelize[_0xab7a('0x5')]},'idField':{'type':Sequelize[_0xab7a('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xab7a('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index af59a02..c531a5c 100644 --- a/server/api/intZohoField/intZohoField.controller.js +++ b/server/api/intZohoField/intZohoField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x098c=['options','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','ZohoField','fieldName','type','key','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL'];(function(_0x288f73,_0x5d378b){var _0x417fe3=function(_0x2ebdc3){while(--_0x2ebdc3){_0x288f73['push'](_0x288f73['shift']());}};_0x417fe3(++_0x5d378b);}(_0x098c,0x133));var _0xc098=function(_0x237b69,_0x221eb2){_0x237b69=_0x237b69-0x0;var _0x4dee15=_0x098c[_0x237b69];return _0x4dee15;};'use strict';var emlformat=require(_0xc098('0x0'));var rimraf=require(_0xc098('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc098('0x2'));var rp=require('request-promise');var moment=require(_0xc098('0x3'));var BPromise=require(_0xc098('0x4'));var Mustache=require(_0xc098('0x5'));var util=require(_0xc098('0x6'));var path=require(_0xc098('0x7'));var sox=require('sox');var csv=require(_0xc098('0x8'));var ejs=require(_0xc098('0x9'));var fs=require('fs');var fs_extra=require(_0xc098('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc098('0xb'));var deskjs=require(_0xc098('0xc'));var toCsv=require(_0xc098('0x8'));var querystring=require(_0xc098('0xd'));var Papa=require(_0xc098('0xe'));var Redis=require(_0xc098('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc098('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc098('0x11'));var logger=require(_0xc098('0x12'))(_0xc098('0x13'));var utils=require(_0xc098('0x14'));var config=require(_0xc098('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc098('0x16'))['db'];function respondWithStatusCode(_0x27295c,_0x4420c1){_0x4420c1=_0x4420c1||0xcc;return function(_0x24c0a5){if(_0x24c0a5){return _0x27295c[_0xc098('0x17')](_0x4420c1);}return _0x27295c['status'](_0x4420c1)['end']();};}function respondWithResult(_0x1ea3b8,_0x3b6ade){_0x3b6ade=_0x3b6ade||0xc8;return function(_0x396420){if(_0x396420){return _0x1ea3b8[_0xc098('0x18')](_0x3b6ade)[_0xc098('0x19')](_0x396420);}};}function respondWithFilteredResult(_0x50bde3,_0xf11043){return function(_0x1b6150){if(_0x1b6150){var _0x34d6a0=typeof _0xf11043[_0xc098('0x1a')]==='undefined'&&typeof _0xf11043[_0xc098('0x1b')]===_0xc098('0x1c');var _0x390255=_0x1b6150[_0xc098('0x1d')];var _0x4ccef9=_0x34d6a0?0x0:_0xf11043[_0xc098('0x1a')];var _0x813b1f=_0x34d6a0?_0x1b6150[_0xc098('0x1d')]:_0xf11043[_0xc098('0x1a')]+_0xf11043['limit'];var _0x426fc5;if(_0x813b1f>=_0x390255){_0x813b1f=_0x390255;_0x426fc5=0xc8;}else{_0x426fc5=0xce;}_0x50bde3['status'](_0x426fc5);return _0x50bde3[_0xc098('0x1e')](_0xc098('0x1f'),_0x4ccef9+'-'+_0x813b1f+'/'+_0x390255)[_0xc098('0x19')](_0x1b6150);}return null;};}function patchUpdates(_0x315bf9){return function(_0x139736){try{jsonpatch[_0xc098('0x20')](_0x139736,_0x315bf9,!![]);}catch(_0x11c8fc){return BPromise[_0xc098('0x21')](_0x11c8fc);}return _0x139736['save']();};}function saveUpdates(_0x4d0328,_0x267891){return function(_0x49fae0){if(_0x49fae0){return _0x49fae0[_0xc098('0x22')](_0x4d0328)[_0xc098('0x23')](function(_0x3ea1f4){return _0x3ea1f4;});}return null;};}function removeEntity(_0x4bd14e,_0x1bbc10){return function(_0x4fd9f8){if(_0x4fd9f8){return _0x4fd9f8[_0xc098('0x24')]()[_0xc098('0x23')](function(){_0x4bd14e[_0xc098('0x18')](0xcc)[_0xc098('0x25')]();});}};}function handleEntityNotFound(_0x5087d0,_0x84405e){return function(_0x3daf22){if(!_0x3daf22){_0x5087d0[_0xc098('0x17')](0x194);}return _0x3daf22;};}function handleError(_0x3b93dc,_0x3986de){_0x3986de=_0x3986de||0x1f4;return function(_0x2e9899){logger[_0xc098('0x26')](_0x2e9899[_0xc098('0x27')]);if(_0x2e9899[_0xc098('0x28')]){delete _0x2e9899['name'];}_0x3b93dc[_0xc098('0x18')](_0x3986de)[_0xc098('0x29')](_0x2e9899);};}exports[_0xc098('0x2a')]=function(_0x37abb0,_0x50b04f){var _0xd06bfa={},_0x487d18={},_0x561cf8={'count':0x0,'rows':[]};var _0x285dfb=_[_0xc098('0x2b')](db[_0xc098('0x2c')]['rawAttributes'],function(_0x277227){return{'name':_0x277227[_0xc098('0x2d')],'type':_0x277227[_0xc098('0x2e')][_0xc098('0x2f')]};});_0x487d18['model']=_[_0xc098('0x2b')](_0x285dfb,_0xc098('0x28'));_0x487d18[_0xc098('0x30')]=_[_0xc098('0x31')](_0x37abb0[_0xc098('0x30')]);_0x487d18[_0xc098('0x32')]=_[_0xc098('0x33')](_0x487d18['model'],_0x487d18[_0xc098('0x30')]);_0xd06bfa['attributes']=_[_0xc098('0x33')](_0x487d18['model'],qs[_0xc098('0x34')](_0x37abb0[_0xc098('0x30')][_0xc098('0x34')]));_0xd06bfa[_0xc098('0x35')]=_0xd06bfa[_0xc098('0x35')][_0xc098('0x36')]?_0xd06bfa[_0xc098('0x35')]:_0x487d18[_0xc098('0x37')];if(!_0x37abb0[_0xc098('0x30')][_0xc098('0x38')]('nolimit')){_0xd06bfa[_0xc098('0x1b')]=qs[_0xc098('0x1b')](_0x37abb0[_0xc098('0x30')][_0xc098('0x1b')]);_0xd06bfa[_0xc098('0x1a')]=qs['offset'](_0x37abb0['query'][_0xc098('0x1a')]);}_0xd06bfa[_0xc098('0x39')]=qs['sort'](_0x37abb0['query']['sort']);_0xd06bfa[_0xc098('0x3a')]=qs[_0xc098('0x32')](_[_0xc098('0x3b')](_0x37abb0[_0xc098('0x30')],_0x487d18['filters']),_0x285dfb);if(_0x37abb0[_0xc098('0x30')][_0xc098('0x3c')]){_0xd06bfa[_0xc098('0x3a')]=_[_0xc098('0x3d')](_0xd06bfa[_0xc098('0x3a')],{'$or':_[_0xc098('0x2b')](_0x285dfb,function(_0x4ff5f2){if(_0x4ff5f2['type']!==_0xc098('0x3e')){var _0x1cacae={};_0x1cacae[_0x4ff5f2[_0xc098('0x28')]]={'$like':'%'+_0x37abb0[_0xc098('0x30')][_0xc098('0x3c')]+'%'};return _0x1cacae;}})});}_0xd06bfa=_[_0xc098('0x3d')]({},_0xd06bfa,_0x37abb0[_0xc098('0x3f')]);var _0x338cba={'where':_0xd06bfa['where']};return db[_0xc098('0x2c')][_0xc098('0x1d')](_0x338cba)[_0xc098('0x23')](function(_0xefc1d3){_0x561cf8['count']=_0xefc1d3;if(_0x37abb0[_0xc098('0x30')][_0xc098('0x40')]){_0xd06bfa[_0xc098('0x41')]=[{'all':!![]}];}return db[_0xc098('0x2c')]['findAll'](_0xd06bfa);})['then'](function(_0x5257a5){_0x561cf8[_0xc098('0x42')]=_0x5257a5;return _0x561cf8;})[_0xc098('0x23')](respondWithFilteredResult(_0x50b04f,_0xd06bfa))['catch'](handleError(_0x50b04f,null));};exports[_0xc098('0x43')]=function(_0x635b9e,_0x5d40d5){var _0x391663={'raw':!![],'where':{'id':_0x635b9e[_0xc098('0x44')]['id']}},_0x28c783={};_0x28c783[_0xc098('0x37')]=_[_0xc098('0x31')](db[_0xc098('0x2c')][_0xc098('0x45')]);_0x28c783[_0xc098('0x30')]=_['keys'](_0x635b9e[_0xc098('0x30')]);_0x28c783['filters']=_[_0xc098('0x33')](_0x28c783['model'],_0x28c783[_0xc098('0x30')]);_0x391663['attributes']=_[_0xc098('0x33')](_0x28c783[_0xc098('0x37')],qs[_0xc098('0x34')](_0x635b9e['query']['fields']));_0x391663[_0xc098('0x35')]=_0x391663[_0xc098('0x35')][_0xc098('0x36')]?_0x391663[_0xc098('0x35')]:_0x28c783['model'];if(_0x635b9e[_0xc098('0x30')]['includeAll']){_0x391663[_0xc098('0x41')]=[{'all':!![]}];}_0x391663=_['merge']({},_0x391663,_0x635b9e['options']);return db['ZohoField'][_0xc098('0x46')](_0x391663)[_0xc098('0x23')](handleEntityNotFound(_0x5d40d5,null))['then'](respondWithResult(_0x5d40d5,null))[_0xc098('0x47')](handleError(_0x5d40d5,null));};exports['create']=function(_0x5056e2,_0x4328f1){return db[_0xc098('0x2c')][_0xc098('0x48')](_0x5056e2[_0xc098('0x49')],{})[_0xc098('0x23')](respondWithResult(_0x4328f1,0xc9))[_0xc098('0x47')](handleError(_0x4328f1,null));};exports['update']=function(_0x2c6e69,_0x25982f){if(_0x2c6e69['body']['id']){delete _0x2c6e69['body']['id'];}return db[_0xc098('0x2c')][_0xc098('0x46')]({'where':{'id':_0x2c6e69[_0xc098('0x44')]['id']}})[_0xc098('0x23')](handleEntityNotFound(_0x25982f,null))[_0xc098('0x23')](saveUpdates(_0x2c6e69[_0xc098('0x49')],null))['then'](respondWithResult(_0x25982f,null))['catch'](handleError(_0x25982f,null));};exports[_0xc098('0x24')]=function(_0x5824ee,_0x17615e){return db[_0xc098('0x2c')]['find']({'where':{'id':_0x5824ee[_0xc098('0x44')]['id']}})['then'](handleEntityNotFound(_0x17615e,null))[_0xc098('0x23')](removeEntity(_0x17615e,null))[_0xc098('0x47')](handleError(_0x17615e,null));}; \ No newline at end of file +var _0x5692=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','options','includeAll','include','findAll','rows','catch','show','ZohoField','merge','find','create','body','destroy','params','rimraf','fast-json-patch','bluebird','util'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x5692,0x1b8));var _0x2569=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5692[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2569('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2569('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2569('0x2'));var Mustache=require('mustache');var util=require(_0x2569('0x3'));var path=require(_0x2569('0x4'));var sox=require(_0x2569('0x5'));var csv=require(_0x2569('0x6'));var ejs=require(_0x2569('0x7'));var fs=require('fs');var fs_extra=require(_0x2569('0x8'));var _=require(_0x2569('0x9'));var squel=require('squel');var crypto=require(_0x2569('0xa'));var jsforce=require(_0x2569('0xb'));var deskjs=require(_0x2569('0xc'));var toCsv=require(_0x2569('0x6'));var querystring=require(_0x2569('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2569('0xe'));var as=require(_0x2569('0xf'));var hardwareService=require(_0x2569('0x10'));var logger=require(_0x2569('0x11'))(_0x2569('0x12'));var utils=require(_0x2569('0x13'));var config=require(_0x2569('0x14'));var licenseUtil=require(_0x2569('0x15'));var db=require(_0x2569('0x16'))['db'];function respondWithStatusCode(_0x47f43d,_0x3a3922){_0x3a3922=_0x3a3922||0xcc;return function(_0x5289c9){if(_0x5289c9){return _0x47f43d['sendStatus'](_0x3a3922);}return _0x47f43d[_0x2569('0x17')](_0x3a3922)[_0x2569('0x18')]();};}function respondWithResult(_0x527edb,_0x1997db){_0x1997db=_0x1997db||0xc8;return function(_0x4eaaa3){if(_0x4eaaa3){return _0x527edb[_0x2569('0x17')](_0x1997db)['json'](_0x4eaaa3);}};}function respondWithFilteredResult(_0x3bd91c,_0xad122c){return function(_0x14efbf){if(_0x14efbf){var _0x3f846b=typeof _0xad122c[_0x2569('0x19')]==='undefined'&&typeof _0xad122c[_0x2569('0x1a')]===_0x2569('0x1b');var _0x4da2c0=_0x14efbf[_0x2569('0x1c')];var _0x333316=_0x3f846b?0x0:_0xad122c[_0x2569('0x19')];var _0x1dda98=_0x3f846b?_0x14efbf[_0x2569('0x1c')]:_0xad122c[_0x2569('0x19')]+_0xad122c['limit'];var _0x48d964;if(_0x1dda98>=_0x4da2c0){_0x1dda98=_0x4da2c0;_0x48d964=0xc8;}else{_0x48d964=0xce;}_0x3bd91c[_0x2569('0x17')](_0x48d964);return _0x3bd91c[_0x2569('0x1d')](_0x2569('0x1e'),_0x333316+'-'+_0x1dda98+'/'+_0x4da2c0)[_0x2569('0x1f')](_0x14efbf);}return null;};}function patchUpdates(_0x5e3f3a){return function(_0x26594a){try{jsonpatch[_0x2569('0x20')](_0x26594a,_0x5e3f3a,!![]);}catch(_0x5172b6){return BPromise[_0x2569('0x21')](_0x5172b6);}return _0x26594a['save']();};}function saveUpdates(_0x3c7a39,_0x204c01){return function(_0x5a22e8){if(_0x5a22e8){return _0x5a22e8[_0x2569('0x22')](_0x3c7a39)['then'](function(_0x285be0){return _0x285be0;});}return null;};}function removeEntity(_0x512fbb,_0x4d1a3c){return function(_0x173c39){if(_0x173c39){return _0x173c39['destroy']()[_0x2569('0x23')](function(){_0x512fbb['status'](0xcc)[_0x2569('0x18')]();});}};}function handleEntityNotFound(_0x492e24,_0x3dd3dc){return function(_0x3d5c59){if(!_0x3d5c59){_0x492e24[_0x2569('0x24')](0x194);}return _0x3d5c59;};}function handleError(_0x70c4e8,_0x2849d8){_0x2849d8=_0x2849d8||0x1f4;return function(_0x360b4c){logger[_0x2569('0x25')](_0x360b4c[_0x2569('0x26')]);if(_0x360b4c[_0x2569('0x27')]){delete _0x360b4c[_0x2569('0x27')];}_0x70c4e8[_0x2569('0x17')](_0x2849d8)[_0x2569('0x28')](_0x360b4c);};}exports[_0x2569('0x29')]=function(_0x5ce3f7,_0x43410c){var _0x3689ed={},_0x2e4ffe={},_0x5b8a45={'count':0x0,'rows':[]};var _0x2b7f78=_[_0x2569('0x2a')](db['ZohoField'][_0x2569('0x2b')],function(_0x49bf01){return{'name':_0x49bf01[_0x2569('0x2c')],'type':_0x49bf01[_0x2569('0x2d')][_0x2569('0x2e')]};});_0x2e4ffe['model']=_[_0x2569('0x2a')](_0x2b7f78,_0x2569('0x27'));_0x2e4ffe[_0x2569('0x2f')]=_[_0x2569('0x30')](_0x5ce3f7[_0x2569('0x2f')]);_0x2e4ffe['filters']=_[_0x2569('0x31')](_0x2e4ffe[_0x2569('0x32')],_0x2e4ffe[_0x2569('0x2f')]);_0x3689ed['attributes']=_['intersection'](_0x2e4ffe[_0x2569('0x32')],qs[_0x2569('0x33')](_0x5ce3f7[_0x2569('0x2f')][_0x2569('0x33')]));_0x3689ed[_0x2569('0x34')]=_0x3689ed[_0x2569('0x34')][_0x2569('0x35')]?_0x3689ed[_0x2569('0x34')]:_0x2e4ffe['model'];if(!_0x5ce3f7[_0x2569('0x2f')]['hasOwnProperty'](_0x2569('0x36'))){_0x3689ed['limit']=qs[_0x2569('0x1a')](_0x5ce3f7[_0x2569('0x2f')]['limit']);_0x3689ed[_0x2569('0x19')]=qs['offset'](_0x5ce3f7[_0x2569('0x2f')][_0x2569('0x19')]);}_0x3689ed[_0x2569('0x37')]=qs[_0x2569('0x38')](_0x5ce3f7[_0x2569('0x2f')][_0x2569('0x38')]);_0x3689ed['where']=qs['filters'](_['pick'](_0x5ce3f7[_0x2569('0x2f')],_0x2e4ffe[_0x2569('0x39')]),_0x2b7f78);if(_0x5ce3f7['query'][_0x2569('0x3a')]){_0x3689ed[_0x2569('0x3b')]=_['merge'](_0x3689ed[_0x2569('0x3b')],{'$or':_[_0x2569('0x2a')](_0x2b7f78,function(_0x4fe776){if(_0x4fe776[_0x2569('0x2d')]!=='VIRTUAL'){var _0xf841fb={};_0xf841fb[_0x4fe776[_0x2569('0x27')]]={'$like':'%'+_0x5ce3f7[_0x2569('0x2f')][_0x2569('0x3a')]+'%'};return _0xf841fb;}})});}_0x3689ed=_['merge']({},_0x3689ed,_0x5ce3f7[_0x2569('0x3c')]);var _0x489492={'where':_0x3689ed[_0x2569('0x3b')]};return db['ZohoField']['count'](_0x489492)[_0x2569('0x23')](function(_0x3b25dc){_0x5b8a45[_0x2569('0x1c')]=_0x3b25dc;if(_0x5ce3f7['query'][_0x2569('0x3d')]){_0x3689ed[_0x2569('0x3e')]=[{'all':!![]}];}return db['ZohoField'][_0x2569('0x3f')](_0x3689ed);})[_0x2569('0x23')](function(_0x1e7c5e){_0x5b8a45[_0x2569('0x40')]=_0x1e7c5e;return _0x5b8a45;})[_0x2569('0x23')](respondWithFilteredResult(_0x43410c,_0x3689ed))[_0x2569('0x41')](handleError(_0x43410c,null));};exports[_0x2569('0x42')]=function(_0x352f6f,_0x3819ce){var _0x14f788={'raw':!![],'where':{'id':_0x352f6f['params']['id']}},_0x7232cc={};_0x7232cc[_0x2569('0x32')]=_[_0x2569('0x30')](db[_0x2569('0x43')]['rawAttributes']);_0x7232cc[_0x2569('0x2f')]=_[_0x2569('0x30')](_0x352f6f[_0x2569('0x2f')]);_0x7232cc[_0x2569('0x39')]=_[_0x2569('0x31')](_0x7232cc[_0x2569('0x32')],_0x7232cc[_0x2569('0x2f')]);_0x14f788[_0x2569('0x34')]=_['intersection'](_0x7232cc[_0x2569('0x32')],qs[_0x2569('0x33')](_0x352f6f[_0x2569('0x2f')]['fields']));_0x14f788[_0x2569('0x34')]=_0x14f788['attributes'][_0x2569('0x35')]?_0x14f788['attributes']:_0x7232cc[_0x2569('0x32')];if(_0x352f6f[_0x2569('0x2f')][_0x2569('0x3d')]){_0x14f788['include']=[{'all':!![]}];}_0x14f788=_[_0x2569('0x44')]({},_0x14f788,_0x352f6f[_0x2569('0x3c')]);return db[_0x2569('0x43')][_0x2569('0x45')](_0x14f788)[_0x2569('0x23')](handleEntityNotFound(_0x3819ce,null))['then'](respondWithResult(_0x3819ce,null))[_0x2569('0x41')](handleError(_0x3819ce,null));};exports[_0x2569('0x46')]=function(_0x112258,_0x1cdbd1){return db['ZohoField']['create'](_0x112258[_0x2569('0x47')],{})[_0x2569('0x23')](respondWithResult(_0x1cdbd1,0xc9))['catch'](handleError(_0x1cdbd1,null));};exports['update']=function(_0x224125,_0x22850b){if(_0x224125[_0x2569('0x47')]['id']){delete _0x224125[_0x2569('0x47')]['id'];}return db['ZohoField'][_0x2569('0x45')]({'where':{'id':_0x224125['params']['id']}})[_0x2569('0x23')](handleEntityNotFound(_0x22850b,null))['then'](saveUpdates(_0x224125[_0x2569('0x47')],null))[_0x2569('0x23')](respondWithResult(_0x22850b,null))['catch'](handleError(_0x22850b,null));};exports[_0x2569('0x48')]=function(_0xfcddc6,_0x5c9e47){return db['ZohoField']['find']({'where':{'id':_0xfcddc6[_0x2569('0x49')]['id']}})['then'](handleEntityNotFound(_0x5c9e47,null))['then'](removeEntity(_0x5c9e47,null))['catch'](handleError(_0x5c9e47,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 7fa46a7..05f70f4 100644 --- a/server/api/intZohoField/intZohoField.model.js +++ b/server/api/intZohoField/intZohoField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9582=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','FieldId','lodash'];(function(_0xcd939d,_0x237853){var _0x87311c=function(_0x583a80){while(--_0x583a80){_0xcd939d['push'](_0xcd939d['shift']());}};_0x87311c(++_0x237853);}(_0x9582,0x95));var _0x2958=function(_0x37725c,_0x28d081){_0x37725c=_0x37725c-0x0;var _0x116628=_0x9582[_0x37725c];return _0x116628;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var logger=require(_0x2958('0x2'))(_0x2958('0x3'));var moment=require(_0x2958('0x4'));var BPromise=require(_0x2958('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2958('0x6'));var rimraf=require(_0x2958('0x7'));var config=require(_0x2958('0x8'));var attributes=require(_0x2958('0x9'));module[_0x2958('0xa')]=function(_0xbde128,_0x88ffaa){return _0xbde128[_0x2958('0xb')](_0x2958('0xc'),attributes,{'tableName':_0x2958('0xd'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField',_0x2958('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa456=['./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa456,0x142));var _0x6a45=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa456[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var logger=require(_0x6a45('0x2'))(_0x6a45('0x3'));var moment=require('moment');var BPromise=require(_0x6a45('0x4'));var rp=require(_0x6a45('0x5'));var fs=require('fs');var path=require(_0x6a45('0x6'));var rimraf=require('rimraf');var config=require(_0x6a45('0x7'));var attributes=require(_0x6a45('0x8'));module[_0x6a45('0x9')]=function(_0x14da6b,_0x4dfbfa){return _0x14da6b[_0x6a45('0xa')](_0x6a45('0xb'),attributes,{'tableName':_0x6a45('0xc'),'paranoid':![],'indexes':[{'name':_0x6a45('0xd'),'fields':[_0x6a45('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index e0b8e10..8f78d68 100644 --- a/server/api/intZohoField/intZohoField.rpc.js +++ b/server/api/intZohoField/intZohoField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb19e=['debug','stringify','error','code','message','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent'];(function(_0x5af851,_0x3bd741){var _0x34017d=function(_0xad419e){while(--_0xad419e){_0x5af851['push'](_0x5af851['shift']());}};_0x34017d(++_0x3bd741);}(_0xb19e,0x1f2));var _0xeb19=function(_0x40927b,_0xf9b0a0){_0x40927b=_0x40927b-0x0;var _0x2635e8=_0xb19e[_0x40927b];return _0x2635e8;};'use strict';var _=require(_0xeb19('0x0'));var util=require(_0xeb19('0x1'));var moment=require('moment');var BPromise=require(_0xeb19('0x2'));var rs=require(_0xeb19('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeb19('0x4'));var logger=require(_0xeb19('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb19('0x6'));var client=jayson['client'][_0xeb19('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2f67ea,_0x58ca0d,_0x18a287){return new BPromise(function(_0x2c4eb3,_0x341336){return client[_0xeb19('0x8')](_0x2f67ea,_0x18a287)['then'](function(_0x4d0438){logger[_0xeb19('0x9')](_0xeb19('0xa'),_0x58ca0d,_0xeb19('0xb'));logger[_0xeb19('0xc')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x58ca0d,_0xeb19('0xb'),JSON[_0xeb19('0xd')](_0x4d0438));if(_0x4d0438[_0xeb19('0xe')]){if(_0x4d0438[_0xeb19('0xe')][_0xeb19('0xf')]===0x1f4){logger[_0xeb19('0xe')](_0xeb19('0xa'),_0x58ca0d,_0x4d0438[_0xeb19('0xe')][_0xeb19('0x10')]);return _0x341336(_0x4d0438['error'][_0xeb19('0x10')]);}logger[_0xeb19('0xe')]('ZohoField,\x20%s,\x20%s',_0x58ca0d,_0x4d0438[_0xeb19('0xe')][_0xeb19('0x10')]);return _0x2c4eb3(_0x4d0438[_0xeb19('0xe')][_0xeb19('0x10')]);}else{logger[_0xeb19('0x9')]('ZohoField,\x20%s,\x20%s',_0x58ca0d,_0xeb19('0xb'));_0x2c4eb3(_0x4d0438['result'][_0xeb19('0x10')]);}})['catch'](function(_0x137240){logger[_0xeb19('0xe')](_0xeb19('0xa'),_0x58ca0d,_0x137240);_0x341336(_0x137240);});});} \ No newline at end of file +var _0x383e=['util','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0x383e,0x179));var _0xe383=function(_0x2fc7ee,_0x1bb152){_0x2fc7ee=_0x2fc7ee-0x0;var _0x174721=_0x383e[_0x2fc7ee];return _0x174721;};'use strict';var _=require(_0xe383('0x0'));var util=require(_0xe383('0x1'));var moment=require('moment');var BPromise=require(_0xe383('0x2'));var rs=require(_0xe383('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe383('0x4'))['db'];var utils=require(_0xe383('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xe383('0x6'));var client=jayson[_0xe383('0x7')][_0xe383('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe16d52,_0xded62,_0x39b513){return new BPromise(function(_0x4ae043,_0x5af014){return client[_0xe383('0x9')](_0xe16d52,_0x39b513)['then'](function(_0x3244e6){logger[_0xe383('0xa')](_0xe383('0xb'),_0xded62,_0xe383('0xc'));logger[_0xe383('0xd')](_0xe383('0xe'),_0xded62,_0xe383('0xc'),JSON[_0xe383('0xf')](_0x3244e6));if(_0x3244e6['error']){if(_0x3244e6[_0xe383('0x10')][_0xe383('0x11')]===0x1f4){logger[_0xe383('0x10')](_0xe383('0xb'),_0xded62,_0x3244e6[_0xe383('0x10')][_0xe383('0x12')]);return _0x5af014(_0x3244e6['error'][_0xe383('0x12')]);}logger[_0xe383('0x10')](_0xe383('0xb'),_0xded62,_0x3244e6[_0xe383('0x10')][_0xe383('0x12')]);return _0x4ae043(_0x3244e6[_0xe383('0x10')][_0xe383('0x12')]);}else{logger[_0xe383('0xa')](_0xe383('0xb'),_0xded62,_0xe383('0xc'));_0x4ae043(_0x3244e6[_0xe383('0x13')][_0xe383('0x12')]);}})[_0xe383('0x14')](function(_0x389583){logger[_0xe383('0x10')]('ZohoField,\x20%s,\x20%s',_0xded62,_0x389583);_0x5af014(_0x389583);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 41271d0..2264de7 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x345710,_0x4d3a23){var _0x25ee01=function(_0x57a037){while(--_0x57a037){_0x345710['push'](_0x345710['shift']());}};_0x25ee01(++_0x4d3a23);}(_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(_0x540dcb,_0x4eacb6){var _0x49353c=function(_0x449bb1){while(--_0x449bb1){_0x540dcb['push'](_0x540dcb['shift']());}};_0x49353c(++_0x4eacb6);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 7c120ed..80d1c6f 100644 --- a/server/api/integration/integration.attributes.js +++ b/server/api/integration/integration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa20=['exports','STRING','unique_name_and_version','app.js','BOOLEAN','state','sequelize'];(function(_0x2de66b,_0x33ae0c){var _0x19c1ea=function(_0x2965d6){while(--_0x2965d6){_0x2de66b['push'](_0x2de66b['shift']());}};_0x19c1ea(++_0x33ae0c);}(_0xfa20,0x141));var _0x0fa2=function(_0x56eefb,_0x1a1c6d){_0x56eefb=_0x56eefb-0x0;var _0x13ed78=_0xfa20[_0x56eefb];return _0x13ed78;};'use strict';var Sequelize=require(_0x0fa2('0x0'));module[_0x0fa2('0x1')]={'name':{'type':Sequelize[_0x0fa2('0x2')],'allowNull':![],'unique':_0x0fa2('0x3')},'version':{'type':Sequelize[_0x0fa2('0x2')],'allowNull':![],'unique':_0x0fa2('0x3')},'main':{'type':Sequelize[_0x0fa2('0x2')],'defaultValue':_0x0fa2('0x4')},'filename':{'type':Sequelize[_0x0fa2('0x2')]},'path':{'type':Sequelize[_0x0fa2('0x2')]},'type':{'type':Sequelize[_0x0fa2('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x0fa2('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x0fa2('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x0fa2('0x2')],'unique':_0x0fa2('0x6')},'description':{'type':Sequelize[_0x0fa2('0x2')]},'title':{'type':Sequelize[_0x0fa2('0x2')]},'remoteUri':{'type':Sequelize[_0x0fa2('0x2')]},'link':{'type':Sequelize[_0x0fa2('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x0f61=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','exports','STRING'];(function(_0x1c136d,_0x2e043f){var _0x211115=function(_0x568341){while(--_0x568341){_0x1c136d['push'](_0x1c136d['shift']());}};_0x211115(++_0x2e043f);}(_0x0f61,0xa6));var _0x10f6=function(_0x19d3ae,_0x28de77){_0x19d3ae=_0x19d3ae-0x0;var _0x3f9ac2=_0x0f61[_0x19d3ae];return _0x3f9ac2;};'use strict';var Sequelize=require('sequelize');module[_0x10f6('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x10f6('0x1')],'allowNull':![],'unique':_0x10f6('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x10f6('0x3')},'filename':{'type':Sequelize[_0x10f6('0x1')]},'path':{'type':Sequelize[_0x10f6('0x1')]},'type':{'type':Sequelize[_0x10f6('0x1')]},'size':{'type':Sequelize[_0x10f6('0x4')]},'active':{'type':Sequelize[_0x10f6('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x10f6('0x1')]},'logo':{'type':Sequelize[_0x10f6('0x1')]},'state':{'type':Sequelize[_0x10f6('0x1')],'unique':_0x10f6('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x10f6('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x10f6('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 5af337d..0c6e4d1 100644 --- a/server/api/integration/integration.controller.js +++ b/server/api/integration/integration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9536=['includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','length','options','find','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','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','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','index','map','Integration','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9536,0x179));var _0x6953=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0x9536[_0x4b6830];return _0x239e4a;};'use strict';var emlformat=require(_0x6953('0x0'));var rimraf=require(_0x6953('0x1'));var zipdir=require(_0x6953('0x2'));var jsonpatch=require(_0x6953('0x3'));var rp=require('request-promise');var moment=require(_0x6953('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6953('0x5'));var util=require(_0x6953('0x6'));var path=require(_0x6953('0x7'));var sox=require(_0x6953('0x8'));var csv=require(_0x6953('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6953('0xa'));var _=require(_0x6953('0xb'));var squel=require(_0x6953('0xc'));var crypto=require(_0x6953('0xd'));var jsforce=require(_0x6953('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6953('0x9'));var querystring=require(_0x6953('0xf'));var Papa=require(_0x6953('0x10'));var Redis=require('ioredis');var authService=require(_0x6953('0x11'));var qs=require(_0x6953('0x12'));var as=require(_0x6953('0x13'));var hardwareService=require(_0x6953('0x14'));var logger=require(_0x6953('0x15'))(_0x6953('0x16'));var utils=require(_0x6953('0x17'));var config=require(_0x6953('0x18'));var licenseUtil=require(_0x6953('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358388,_0x513dd0){_0x513dd0=_0x513dd0||0xcc;return function(_0x8de91e){if(_0x8de91e){return _0x358388[_0x6953('0x1a')](_0x513dd0);}return _0x358388[_0x6953('0x1b')](_0x513dd0)[_0x6953('0x1c')]();};}function respondWithResult(_0x1b5221,_0x244713){_0x244713=_0x244713||0xc8;return function(_0x175fa9){if(_0x175fa9){return _0x1b5221[_0x6953('0x1b')](_0x244713)[_0x6953('0x1d')](_0x175fa9);}};}function respondWithFilteredResult(_0x31d182,_0xae5515){return function(_0x548473){if(_0x548473){var _0x5f49db=typeof _0xae5515[_0x6953('0x1e')]===_0x6953('0x1f')&&typeof _0xae5515[_0x6953('0x20')]===_0x6953('0x1f');var _0x510d46=_0x548473[_0x6953('0x21')];var _0x2da771=_0x5f49db?0x0:_0xae5515['offset'];var _0x10858a=_0x5f49db?_0x548473[_0x6953('0x21')]:_0xae5515[_0x6953('0x1e')]+_0xae5515[_0x6953('0x20')];var _0xc714d3;if(_0x10858a>=_0x510d46){_0x10858a=_0x510d46;_0xc714d3=0xc8;}else{_0xc714d3=0xce;}_0x31d182['status'](_0xc714d3);return _0x31d182[_0x6953('0x22')](_0x6953('0x23'),_0x2da771+'-'+_0x10858a+'/'+_0x510d46)[_0x6953('0x1d')](_0x548473);}return null;};}function patchUpdates(_0x2ba433){return function(_0x41f021){try{jsonpatch['apply'](_0x41f021,_0x2ba433,!![]);}catch(_0xf96d07){return BPromise[_0x6953('0x24')](_0xf96d07);}return _0x41f021['save']();};}function saveUpdates(_0x317979,_0x40c9d1){return function(_0xb92529){if(_0xb92529){return _0xb92529[_0x6953('0x25')](_0x317979)['then'](function(_0x37f339){return _0x37f339;});}return null;};}function removeEntity(_0x231cb2,_0x2a7f6a){return function(_0x508ea7){if(_0x508ea7){return _0x508ea7['destroy']()['then'](function(){_0x231cb2[_0x6953('0x1b')](0xcc)[_0x6953('0x1c')]();});}};}function handleEntityNotFound(_0x550be4,_0x1a32f4){return function(_0x587df0){if(!_0x587df0){_0x550be4[_0x6953('0x1a')](0x194);}return _0x587df0;};}function handleError(_0x2bf39b,_0xcdbce8){_0xcdbce8=_0xcdbce8||0x1f4;return function(_0x2cc01e){logger[_0x6953('0x26')](_0x2cc01e[_0x6953('0x27')]);if(_0x2cc01e['name']){delete _0x2cc01e[_0x6953('0x28')];}_0x2bf39b[_0x6953('0x1b')](_0xcdbce8)['send'](_0x2cc01e);};}exports[_0x6953('0x29')]=function(_0x4af39d,_0x173b3c){var _0x3b1175={},_0x426c7c={},_0x4b0325={'count':0x0,'rows':[]};var _0x131992=_[_0x6953('0x2a')](db[_0x6953('0x2b')]['rawAttributes'],function(_0x4c49fc){return{'name':_0x4c49fc[_0x6953('0x2c')],'type':_0x4c49fc['type']['key']};});_0x426c7c[_0x6953('0x2d')]=_[_0x6953('0x2a')](_0x131992,_0x6953('0x28'));_0x426c7c[_0x6953('0x2e')]=_[_0x6953('0x2f')](_0x4af39d['query']);_0x426c7c[_0x6953('0x30')]=_['intersection'](_0x426c7c[_0x6953('0x2d')],_0x426c7c[_0x6953('0x2e')]);_0x3b1175['attributes']=_['intersection'](_0x426c7c[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x4af39d[_0x6953('0x2e')]['fields']));_0x3b1175[_0x6953('0x32')]=_0x3b1175['attributes']['length']?_0x3b1175['attributes']:_0x426c7c['model'];if(!_0x4af39d[_0x6953('0x2e')][_0x6953('0x33')](_0x6953('0x34'))){_0x3b1175[_0x6953('0x20')]=qs[_0x6953('0x20')](_0x4af39d[_0x6953('0x2e')]['limit']);_0x3b1175[_0x6953('0x1e')]=qs['offset'](_0x4af39d[_0x6953('0x2e')]['offset']);}_0x3b1175[_0x6953('0x35')]=qs[_0x6953('0x36')](_0x4af39d[_0x6953('0x2e')][_0x6953('0x36')]);_0x3b1175['where']=qs[_0x6953('0x30')](_[_0x6953('0x37')](_0x4af39d[_0x6953('0x2e')],_0x426c7c[_0x6953('0x30')]),_0x131992);if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x38')]){_0x3b1175[_0x6953('0x39')]=_[_0x6953('0x3a')](_0x3b1175[_0x6953('0x39')],{'$or':_[_0x6953('0x2a')](_0x131992,function(_0x2d9d81){if(_0x2d9d81['type']!==_0x6953('0x3b')){var _0x3c03ab={};_0x3c03ab[_0x2d9d81[_0x6953('0x28')]]={'$like':'%'+_0x4af39d['query']['filter']+'%'};return _0x3c03ab;}})});}_0x3b1175=_[_0x6953('0x3a')]({},_0x3b1175,_0x4af39d['options']);var _0x5abaf2={'where':_0x3b1175[_0x6953('0x39')]};return db[_0x6953('0x2b')]['count'](_0x5abaf2)[_0x6953('0x3c')](function(_0x263728){_0x4b0325[_0x6953('0x21')]=_0x263728;if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x3d')]){_0x3b1175[_0x6953('0x3e')]=[{'all':!![]}];}return db['Integration'][_0x6953('0x3f')](_0x3b1175);})[_0x6953('0x3c')](function(_0x30a27a){_0x4b0325[_0x6953('0x40')]=_0x30a27a;return _0x4b0325;})[_0x6953('0x3c')](respondWithFilteredResult(_0x173b3c,_0x3b1175))[_0x6953('0x41')](handleError(_0x173b3c,null));};exports['show']=function(_0x5a40de,_0xeef91a){var _0x54d7c2={'raw':![],'where':{'id':_0x5a40de[_0x6953('0x42')]['id']}},_0x588ff8={};_0x588ff8[_0x6953('0x2d')]=_[_0x6953('0x2f')](db[_0x6953('0x2b')][_0x6953('0x43')]);_0x588ff8['query']=_['keys'](_0x5a40de[_0x6953('0x2e')]);_0x588ff8[_0x6953('0x30')]=_['intersection'](_0x588ff8[_0x6953('0x2d')],_0x588ff8['query']);_0x54d7c2[_0x6953('0x32')]=_[_0x6953('0x44')](_0x588ff8[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x5a40de['query'][_0x6953('0x31')]));_0x54d7c2[_0x6953('0x32')]=_0x54d7c2['attributes'][_0x6953('0x45')]?_0x54d7c2[_0x6953('0x32')]:_0x588ff8[_0x6953('0x2d')];if(_0x5a40de[_0x6953('0x2e')][_0x6953('0x3d')]){_0x54d7c2[_0x6953('0x3e')]=[{'all':!![]}];}_0x54d7c2=_[_0x6953('0x3a')]({},_0x54d7c2,_0x5a40de[_0x6953('0x46')]);return db[_0x6953('0x2b')][_0x6953('0x47')](_0x54d7c2)[_0x6953('0x3c')](handleEntityNotFound(_0xeef91a,null))['then'](respondWithResult(_0xeef91a,null))[_0x6953('0x41')](handleError(_0xeef91a,null));};exports['create']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['create'](_0x15c142[_0x6953('0x48')],{})[_0x6953('0x3c')](respondWithResult(_0x1d5979,0xc9))['catch'](handleError(_0x1d5979,null));};exports['update']=function(_0xbf5b61,_0x265b44){if(_0xbf5b61[_0x6953('0x48')]['id']){delete _0xbf5b61[_0x6953('0x48')]['id'];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0xbf5b61[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x265b44,null))[_0x6953('0x3c')](saveUpdates(_0xbf5b61[_0x6953('0x48')],null))[_0x6953('0x3c')](respondWithResult(_0x265b44,null))['catch'](handleError(_0x265b44,null));};exports['destroy']=function(_0x14a7bf,_0x38e3e8){return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0x14a7bf[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x38e3e8,null))[_0x6953('0x3c')](removeEntity(_0x38e3e8,null))[_0x6953('0x41')](handleError(_0x38e3e8,null));}; \ No newline at end of file +var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','Integration','fieldName','type','key'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xadb5,0xad));var _0x5adb=function(_0x220405,_0x2b9051){_0x220405=_0x220405-0x0;var _0x10fc74=_0xadb5[_0x220405];return _0x10fc74;};'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['Integration']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index eb2c42d..f7b419f 100644 --- a/server/api/integration/integration.model.js +++ b/server/api/integration/integration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa3d7=['lodash','util','api','moment','request-promise','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations'];(function(_0xc3398f,_0x2c3d4b){var _0x18615f=function(_0x5cbd60){while(--_0x5cbd60){_0xc3398f['push'](_0xc3398f['shift']());}};_0x18615f(++_0x2c3d4b);}(_0xa3d7,0x1ec));var _0x7a3d=function(_0x2eec1f,_0x1b9987){_0x2eec1f=_0x2eec1f-0x0;var _0x543075=_0xa3d7[_0x2eec1f];return _0x543075;};'use strict';var _=require(_0x7a3d('0x0'));var util=require(_0x7a3d('0x1'));var logger=require('../../config/logger')(_0x7a3d('0x2'));var moment=require(_0x7a3d('0x3'));var BPromise=require('bluebird');var rp=require(_0x7a3d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a3d('0x5'));var config=require(_0x7a3d('0x6'));var attributes=require(_0x7a3d('0x7'));module[_0x7a3d('0x8')]=function(_0x5881c3,_0x43bc2d){return _0x5881c3[_0x7a3d('0x9')](_0x7a3d('0xa'),attributes,{'tableName':_0x7a3d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x904f=['lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./integration.attributes','define','Integration','integrations'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x904f,0x16b));var _0xf904=function(_0x352027,_0xab2d70){_0x352027=_0x352027-0x0;var _0x512181=_0x904f[_0x352027];return _0x512181;};'use strict';var _=require(_0xf904('0x0'));var util=require(_0xf904('0x1'));var logger=require(_0xf904('0x2'))(_0xf904('0x3'));var moment=require('moment');var BPromise=require(_0xf904('0x4'));var rp=require(_0xf904('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf904('0x6'));var attributes=require(_0xf904('0x7'));module['exports']=function(_0x560deb,_0x242812){return _0x560deb[_0xf904('0x8')](_0xf904('0x9'),attributes,{'tableName':_0xf904('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index f4c717c..3ef1349 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xc2c7,0x134));var _0x7c2c=function(_0x1f4619,_0x570e15){_0x1f4619=_0x1f4619-0x0;var _0x17f358=_0xc2c7[_0x1f4619];return _0x17f358;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('Integration,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file +var _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x2d3206,_0x434cf5){var _0x18702d=function(_0x4e0735){while(--_0x4e0735){_0x2d3206['push'](_0x2d3206['shift']());}};_0x18702d(++_0x434cf5);}(_0x524e,0x15e));var _0xe524=function(_0x522e68,_0x73fcb6){_0x522e68=_0x522e68-0x0;var _0x5adc77=_0x524e[_0x522e68];return _0x5adc77;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('Integration,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('Integration,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('Integration,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index a80e41e..1423042 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x896e=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x896e,0x1e9));var _0xe896=function(_0x6ff5a6,_0x3261b8){_0x6ff5a6=_0x6ff5a6-0x0;var _0x382aeb=_0x896e[_0x6ff5a6];return _0x382aeb;};'use strict';var multer=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var path=require(_0xe896('0x2'));var timeout=require(_0xe896('0x3'));var express=require(_0xe896('0x4'));var router=express[_0xe896('0x5')]();var fs_extra=require(_0xe896('0x6'));var auth=require(_0xe896('0x7'));var interaction=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var controller=require(_0xe896('0xa'));router[_0xe896('0xb')]('/',auth['isAuthenticated'](),controller[_0xe896('0xc')]);router[_0xe896('0xb')](_0xe896('0xd'),auth[_0xe896('0xe')](),controller[_0xe896('0xf')]);router['get'](_0xe896('0x10'),auth[_0xe896('0xe')](),controller[_0xe896('0x11')]);router['post']('/',auth[_0xe896('0xe')](),controller['create']);router[_0xe896('0x12')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x13')]);router[_0xe896('0x14')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x15')]);module[_0xe896('0x16')]=router; \ No newline at end of file +var _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2d499a,_0x5b418d){_0x2d499a=_0x2d499a-0x0;var _0xd40101=_0x5f2f[_0x2d499a];return _0xd40101;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')]('/',auth[_0xf5f2('0xa')](),controller['create']);router[_0xf5f2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 67f2972..59acc76 100644 --- a/server/api/integrationReport/integrationReport.attributes.js +++ b/server/api/integrationReport/integrationReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fa3=['SENDING','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM'];(function(_0xc431a4,_0xbdd953){var _0x2654ed=function(_0x5c9279){while(--_0x5c9279){_0xc431a4['push'](_0xc431a4['shift']());}};_0x2654ed(++_0xbdd953);}(_0x5fa3,0x192));var _0x35fa=function(_0x33a9d9,_0x1f5c33){_0x33a9d9=_0x33a9d9-0x0;var _0x990b81=_0x5fa3[_0x33a9d9];return _0x990b81;};'use strict';var Sequelize=require(_0x35fa('0x0'));module[_0x35fa('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x35fa('0x2')]},'ticketId':{'type':Sequelize[_0x35fa('0x2')]},'integrationId':{'type':Sequelize[_0x35fa('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x35fa('0x2')]},'calleridnum':{'type':Sequelize[_0x35fa('0x2')]},'calleridname':{'type':Sequelize[_0x35fa('0x2')]},'queue':{'type':Sequelize[_0x35fa('0x2')]},'interface':{'type':Sequelize[_0x35fa('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x35fa('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x35fa('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x35fa('0x4')]},'talktime':{'type':Sequelize[_0x35fa('0x3')]},'agentacw':{'type':Sequelize[_0x35fa('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x35fa('0x3')]},'reason':{'type':Sequelize[_0x35fa('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x35fa('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x35fa('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x35fa('0x2')]},'channelstate':{'type':Sequelize[_0x35fa('0x3')]},'channelstatedesc':{'type':Sequelize[_0x35fa('0x2')]},'connectedlinenum':{'type':Sequelize[_0x35fa('0x2')]},'connectedlinename':{'type':Sequelize[_0x35fa('0x2')]},'language':{'type':Sequelize[_0x35fa('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x35fa('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x35fa('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x35fa('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x35fa('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x35fa('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x35fa('0x2')]},'destexten':{'type':Sequelize[_0x35fa('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x35fa('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x35fa('0x2')]},'from':{'type':Sequelize[_0x35fa('0x2')]},'to':{'type':Sequelize[_0x35fa('0x2')]},'cc':{'type':Sequelize[_0x35fa('0x2')]},'attachment':{'type':Sequelize[_0x35fa('0x6')]},'html':{'type':Sequelize[_0x35fa('0x6')]},'text':{'type':Sequelize[_0x35fa('0x6')]},'status':{'type':Sequelize[_0x35fa('0x7')]('SENT',_0x35fa('0x8'),'RECEIVED',_0x35fa('0x9'))},'url':{'type':Sequelize[_0x35fa('0x2')]},'app':{'type':Sequelize[_0x35fa('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x35fa('0x3')]}}; \ No newline at end of file +var _0x390a=['SENT','SENDING','RECEIVED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM'];(function(_0x4b162f,_0x343248){var _0x504534=function(_0x222287){while(--_0x222287){_0x4b162f['push'](_0x4b162f['shift']());}};_0x504534(++_0x343248);}(_0x390a,0xbe));var _0xa390=function(_0x2992c9,_0x19341e){_0x2992c9=_0x2992c9-0x0;var _0x262cc6=_0x390a[_0x2992c9];return _0x262cc6;};'use strict';var Sequelize=require(_0xa390('0x0'));module[_0xa390('0x1')]={'integration':{'type':Sequelize[_0xa390('0x2')]},'eventChannel':{'type':Sequelize[_0xa390('0x2')]},'exitStatus':{'type':Sequelize[_0xa390('0x2')]},'ticketId':{'type':Sequelize[_0xa390('0x2')]},'integrationId':{'type':Sequelize[_0xa390('0x3')]},'contacts':{'type':Sequelize[_0xa390('0x2')]},'uniqueid':{'type':Sequelize[_0xa390('0x2')]},'calleridnum':{'type':Sequelize[_0xa390('0x2')]},'calleridname':{'type':Sequelize[_0xa390('0x2')]},'queue':{'type':Sequelize[_0xa390('0x2')]},'interface':{'type':Sequelize[_0xa390('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xa390('0x4')]},'agentconnectAt':{'type':Sequelize[_0xa390('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xa390('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xa390('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xa390('0x3')]},'reason':{'type':Sequelize[_0xa390('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xa390('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xa390('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xa390('0x4')]},'lastevent':{'type':Sequelize[_0xa390('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xa390('0x3')]},'channelstatedesc':{'type':Sequelize[_0xa390('0x2')]},'connectedlinenum':{'type':Sequelize[_0xa390('0x2')]},'connectedlinename':{'type':Sequelize[_0xa390('0x2')]},'language':{'type':Sequelize[_0xa390('0x2')]},'accountcode':{'type':Sequelize[_0xa390('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xa390('0x2')]},'priority':{'type':Sequelize[_0xa390('0x2')]},'destchannel':{'type':Sequelize[_0xa390('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xa390('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xa390('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xa390('0x2')]},'destlanguage':{'type':Sequelize[_0xa390('0x2')]},'destaccountcode':{'type':Sequelize[_0xa390('0x2')]},'destcontext':{'type':Sequelize[_0xa390('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xa390('0x2')]},'inReplyTo':{'type':Sequelize[_0xa390('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xa390('0x2')]},'to':{'type':Sequelize[_0xa390('0x2')]},'cc':{'type':Sequelize[_0xa390('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xa390('0x6')]},'text':{'type':Sequelize[_0xa390('0x6')]},'status':{'type':Sequelize[_0xa390('0x7')](_0xa390('0x8'),_0xa390('0x9'),_0xa390('0xa'),'FAILED')},'url':{'type':Sequelize[_0xa390('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xa390('0x2')]},'projectId':{'type':Sequelize[_0xa390('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index e325129..9eec7e7 100644 --- a/server/api/integrationReport/integrationReport.controller.js +++ b/server/api/integrationReport/integrationReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd030=['end','json','offset','undefined','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','IntegrationReport','rawAttributes','fieldName','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status'];(function(_0xb14fa0,_0x1390d1){var _0xd30f3a=function(_0x10fe9c){while(--_0x10fe9c){_0xb14fa0['push'](_0xb14fa0['shift']());}};_0xd30f3a(++_0x1390d1);}(_0xd030,0x168));var _0x0d03=function(_0x2f4e4b,_0x1bbbdb){_0x2f4e4b=_0x2f4e4b-0x0;var _0x31d9f7=_0xd030[_0x2f4e4b];return _0x31d9f7;};'use strict';var emlformat=require(_0x0d03('0x0'));var rimraf=require(_0x0d03('0x1'));var zipdir=require(_0x0d03('0x2'));var jsonpatch=require(_0x0d03('0x3'));var rp=require(_0x0d03('0x4'));var moment=require('moment');var BPromise=require(_0x0d03('0x5'));var Mustache=require('mustache');var util=require(_0x0d03('0x6'));var path=require('path');var sox=require(_0x0d03('0x7'));var csv=require(_0x0d03('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d03('0x9'));var _=require(_0x0d03('0xa'));var squel=require(_0x0d03('0xb'));var crypto=require(_0x0d03('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0d03('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0d03('0xe'));var Papa=require(_0x0d03('0xf'));var Redis=require(_0x0d03('0x10'));var authService=require(_0x0d03('0x11'));var qs=require(_0x0d03('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d03('0x13'));var logger=require('../../config/logger')(_0x0d03('0x14'));var utils=require(_0x0d03('0x15'));var config=require(_0x0d03('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d09f3,_0x50f682){_0x50f682=_0x50f682||0xcc;return function(_0xa0e443){if(_0xa0e443){return _0x1d09f3[_0x0d03('0x17')](_0x50f682);}return _0x1d09f3[_0x0d03('0x18')](_0x50f682)[_0x0d03('0x19')]();};}function respondWithResult(_0x49ea7d,_0x8f3396){_0x8f3396=_0x8f3396||0xc8;return function(_0x33554a){if(_0x33554a){return _0x49ea7d[_0x0d03('0x18')](_0x8f3396)[_0x0d03('0x1a')](_0x33554a);}};}function respondWithFilteredResult(_0x2e2b44,_0x49b88a){return function(_0x1ccf13){if(_0x1ccf13){var _0x1975e3=typeof _0x49b88a[_0x0d03('0x1b')]===_0x0d03('0x1c')&&typeof _0x49b88a['limit']===_0x0d03('0x1c');var _0x4afaff=_0x1ccf13['count'];var _0x462568=_0x1975e3?0x0:_0x49b88a['offset'];var _0x42b120=_0x1975e3?_0x1ccf13['count']:_0x49b88a[_0x0d03('0x1b')]+_0x49b88a['limit'];var _0x2a8bc8;if(_0x42b120>=_0x4afaff){_0x42b120=_0x4afaff;_0x2a8bc8=0xc8;}else{_0x2a8bc8=0xce;}_0x2e2b44[_0x0d03('0x18')](_0x2a8bc8);return _0x2e2b44[_0x0d03('0x1d')](_0x0d03('0x1e'),_0x462568+'-'+_0x42b120+'/'+_0x4afaff)[_0x0d03('0x1a')](_0x1ccf13);}return null;};}function patchUpdates(_0x45bcdb){return function(_0x25a1a3){try{jsonpatch[_0x0d03('0x1f')](_0x25a1a3,_0x45bcdb,!![]);}catch(_0x3c41d7){return BPromise['reject'](_0x3c41d7);}return _0x25a1a3[_0x0d03('0x20')]();};}function saveUpdates(_0x516000,_0x43cdae){return function(_0xcafd97){if(_0xcafd97){return _0xcafd97[_0x0d03('0x21')](_0x516000)[_0x0d03('0x22')](function(_0x5edfd7){return _0x5edfd7;});}return null;};}function removeEntity(_0x532f86,_0x2cddaf){return function(_0x2dd7b6){if(_0x2dd7b6){return _0x2dd7b6[_0x0d03('0x23')]()[_0x0d03('0x22')](function(){_0x532f86[_0x0d03('0x18')](0xcc)[_0x0d03('0x19')]();});}};}function handleEntityNotFound(_0x1ffaac,_0x4875d4){return function(_0x4ed8df){if(!_0x4ed8df){_0x1ffaac[_0x0d03('0x17')](0x194);}return _0x4ed8df;};}function handleError(_0x50512f,_0x1ab047){_0x1ab047=_0x1ab047||0x1f4;return function(_0xcb9a21){logger[_0x0d03('0x24')](_0xcb9a21[_0x0d03('0x25')]);if(_0xcb9a21['name']){delete _0xcb9a21[_0x0d03('0x26')];}_0x50512f[_0x0d03('0x18')](_0x1ab047)[_0x0d03('0x27')](_0xcb9a21);};}exports[_0x0d03('0x28')]=function(_0x3cc597,_0x529810){var _0x152eb3={},_0x32e222={},_0xfc3a1b={'count':0x0,'rows':[]};var _0x432160=_['map'](db[_0x0d03('0x29')][_0x0d03('0x2a')],function(_0x1b0fa8){return{'name':_0x1b0fa8[_0x0d03('0x2b')],'type':_0x1b0fa8['type'][_0x0d03('0x2c')]};});_0x32e222['model']=_[_0x0d03('0x2d')](_0x432160,_0x0d03('0x26'));_0x32e222[_0x0d03('0x2e')]=_['keys'](_0x3cc597[_0x0d03('0x2e')]);_0x32e222[_0x0d03('0x2f')]=_[_0x0d03('0x30')](_0x32e222[_0x0d03('0x31')],_0x32e222[_0x0d03('0x2e')]);_0x152eb3[_0x0d03('0x32')]=_[_0x0d03('0x30')](_0x32e222['model'],qs['fields'](_0x3cc597[_0x0d03('0x2e')][_0x0d03('0x33')]));_0x152eb3['attributes']=_0x152eb3[_0x0d03('0x32')][_0x0d03('0x34')]?_0x152eb3[_0x0d03('0x32')]:_0x32e222[_0x0d03('0x31')];if(!_0x3cc597[_0x0d03('0x2e')][_0x0d03('0x35')](_0x0d03('0x36'))){_0x152eb3['limit']=qs[_0x0d03('0x37')](_0x3cc597['query'][_0x0d03('0x37')]);_0x152eb3[_0x0d03('0x1b')]=qs['offset'](_0x3cc597[_0x0d03('0x2e')][_0x0d03('0x1b')]);}_0x152eb3[_0x0d03('0x38')]=qs[_0x0d03('0x39')](_0x3cc597[_0x0d03('0x2e')]['sort']);_0x152eb3[_0x0d03('0x3a')]=qs[_0x0d03('0x2f')](_['pick'](_0x3cc597[_0x0d03('0x2e')],_0x32e222[_0x0d03('0x2f')]),_0x432160);if(_0x3cc597[_0x0d03('0x2e')][_0x0d03('0x3b')]){_0x152eb3['where']=_['merge'](_0x152eb3[_0x0d03('0x3a')],{'$or':_[_0x0d03('0x2d')](_0x432160,function(_0x3b0ac8){if(_0x3b0ac8[_0x0d03('0x3c')]!==_0x0d03('0x3d')){var _0x5611e5={};_0x5611e5[_0x3b0ac8[_0x0d03('0x26')]]={'$like':'%'+_0x3cc597[_0x0d03('0x2e')]['filter']+'%'};return _0x5611e5;}})});}_0x152eb3=_['merge']({},_0x152eb3,_0x3cc597[_0x0d03('0x3e')]);var _0x592e1d={'where':_0x152eb3['where']};return db['IntegrationReport'][_0x0d03('0x3f')](_0x592e1d)['then'](function(_0x19dd31){_0xfc3a1b[_0x0d03('0x3f')]=_0x19dd31;if(_0x3cc597[_0x0d03('0x2e')][_0x0d03('0x40')]){_0x152eb3[_0x0d03('0x41')]=[{'all':!![]}];}return db[_0x0d03('0x29')][_0x0d03('0x42')](_0x152eb3);})['then'](function(_0x3bbd2c){_0xfc3a1b[_0x0d03('0x43')]=_0x3bbd2c;return _0xfc3a1b;})['then'](respondWithFilteredResult(_0x529810,_0x152eb3))[_0x0d03('0x44')](handleError(_0x529810,null));};exports[_0x0d03('0x45')]=function(_0x2f827c,_0x2ec694){var _0x2e9ce4={'raw':![],'where':{'id':_0x2f827c[_0x0d03('0x46')]['id']}},_0x23fb71={};_0x23fb71['model']=_[_0x0d03('0x47')](db[_0x0d03('0x29')][_0x0d03('0x2a')]);_0x23fb71[_0x0d03('0x2e')]=_[_0x0d03('0x47')](_0x2f827c[_0x0d03('0x2e')]);_0x23fb71[_0x0d03('0x2f')]=_[_0x0d03('0x30')](_0x23fb71[_0x0d03('0x31')],_0x23fb71['query']);_0x2e9ce4[_0x0d03('0x32')]=_[_0x0d03('0x30')](_0x23fb71[_0x0d03('0x31')],qs[_0x0d03('0x33')](_0x2f827c[_0x0d03('0x2e')][_0x0d03('0x33')]));_0x2e9ce4['attributes']=_0x2e9ce4['attributes'][_0x0d03('0x34')]?_0x2e9ce4['attributes']:_0x23fb71[_0x0d03('0x31')];if(_0x2f827c[_0x0d03('0x2e')][_0x0d03('0x40')]){_0x2e9ce4[_0x0d03('0x41')]=[{'all':!![]}];}_0x2e9ce4=_[_0x0d03('0x48')]({},_0x2e9ce4,_0x2f827c[_0x0d03('0x3e')]);return db[_0x0d03('0x29')][_0x0d03('0x49')](_0x2e9ce4)['then'](handleEntityNotFound(_0x2ec694,null))[_0x0d03('0x22')](respondWithResult(_0x2ec694,null))['catch'](handleError(_0x2ec694,null));};exports[_0x0d03('0x4a')]=function(_0x45a111,_0x2f6fcb){return db[_0x0d03('0x29')][_0x0d03('0x4a')](_0x45a111[_0x0d03('0x4b')],{})[_0x0d03('0x22')](respondWithResult(_0x2f6fcb,0xc9))[_0x0d03('0x44')](handleError(_0x2f6fcb,null));};exports['update']=function(_0x125270,_0x556de9){if(_0x125270[_0x0d03('0x4b')]['id']){delete _0x125270[_0x0d03('0x4b')]['id'];}return db[_0x0d03('0x29')][_0x0d03('0x49')]({'where':{'id':_0x125270[_0x0d03('0x46')]['id']}})[_0x0d03('0x22')](handleEntityNotFound(_0x556de9,null))[_0x0d03('0x22')](saveUpdates(_0x125270['body'],null))[_0x0d03('0x22')](respondWithResult(_0x556de9,null))[_0x0d03('0x44')](handleError(_0x556de9,null));};exports[_0x0d03('0x23')]=function(_0x2d2979,_0x29de3f){return db['IntegrationReport'][_0x0d03('0x49')]({'where':{'id':_0x2d2979[_0x0d03('0x46')]['id']}})[_0x0d03('0x22')](handleEntityNotFound(_0x29de3f,null))['then'](removeEntity(_0x29de3f,null))['catch'](handleError(_0x29de3f,null));};exports[_0x0d03('0x4c')]=function(_0x38ea30,_0x48d57f){return db[_0x0d03('0x29')][_0x0d03('0x4c')]()[_0x0d03('0x22')](respondWithResult(_0x48d57f,null))[_0x0d03('0x44')](handleError(_0x48d57f,null));}; \ No newline at end of file +var _0xfda7=['map','keys','filters','model','attributes','intersection','query','fields','length','nolimit','sort','where','filter','merge','options','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','IntegrationReport','type','key'];(function(_0x23b727,_0x143870){var _0x127e4b=function(_0x5ee1a7){while(--_0x5ee1a7){_0x23b727['push'](_0x23b727['shift']());}};_0x127e4b(++_0x143870);}(_0xfda7,0x13d));var _0x7fda=function(_0x33f105,_0xd34aa6){_0x33f105=_0x33f105-0x0;var _0x1c24b0=_0xfda7[_0x33f105];return _0x1c24b0;};'use strict';var emlformat=require(_0x7fda('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7fda('0x1'));var jsonpatch=require(_0x7fda('0x2'));var rp=require('request-promise');var moment=require(_0x7fda('0x3'));var BPromise=require(_0x7fda('0x4'));var Mustache=require(_0x7fda('0x5'));var util=require(_0x7fda('0x6'));var path=require(_0x7fda('0x7'));var sox=require(_0x7fda('0x8'));var csv=require(_0x7fda('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7fda('0xa'));var _=require(_0x7fda('0xb'));var squel=require(_0x7fda('0xc'));var crypto=require(_0x7fda('0xd'));var jsforce=require(_0x7fda('0xe'));var deskjs=require(_0x7fda('0xf'));var toCsv=require(_0x7fda('0x9'));var querystring=require(_0x7fda('0x10'));var Papa=require(_0x7fda('0x11'));var Redis=require(_0x7fda('0x12'));var authService=require(_0x7fda('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7fda('0x14'));var hardwareService=require(_0x7fda('0x15'));var logger=require('../../config/logger')(_0x7fda('0x16'));var utils=require(_0x7fda('0x17'));var config=require(_0x7fda('0x18'));var licenseUtil=require(_0x7fda('0x19'));var db=require(_0x7fda('0x1a'))['db'];function respondWithStatusCode(_0x1a909d,_0x48d484){_0x48d484=_0x48d484||0xcc;return function(_0x3c7662){if(_0x3c7662){return _0x1a909d[_0x7fda('0x1b')](_0x48d484);}return _0x1a909d[_0x7fda('0x1c')](_0x48d484)[_0x7fda('0x1d')]();};}function respondWithResult(_0x40ebd8,_0x31d442){_0x31d442=_0x31d442||0xc8;return function(_0x283796){if(_0x283796){return _0x40ebd8[_0x7fda('0x1c')](_0x31d442)[_0x7fda('0x1e')](_0x283796);}};}function respondWithFilteredResult(_0xd150ea,_0x50d112){return function(_0x2faa16){if(_0x2faa16){var _0x4ec81d=typeof _0x50d112[_0x7fda('0x1f')]==='undefined'&&typeof _0x50d112[_0x7fda('0x20')]===_0x7fda('0x21');var _0xa39355=_0x2faa16[_0x7fda('0x22')];var _0x1e69a4=_0x4ec81d?0x0:_0x50d112[_0x7fda('0x1f')];var _0x1513c0=_0x4ec81d?_0x2faa16['count']:_0x50d112[_0x7fda('0x1f')]+_0x50d112[_0x7fda('0x20')];var _0x2b9eb3;if(_0x1513c0>=_0xa39355){_0x1513c0=_0xa39355;_0x2b9eb3=0xc8;}else{_0x2b9eb3=0xce;}_0xd150ea[_0x7fda('0x1c')](_0x2b9eb3);return _0xd150ea[_0x7fda('0x23')](_0x7fda('0x24'),_0x1e69a4+'-'+_0x1513c0+'/'+_0xa39355)['json'](_0x2faa16);}return null;};}function patchUpdates(_0x363b38){return function(_0x1f4fa2){try{jsonpatch[_0x7fda('0x25')](_0x1f4fa2,_0x363b38,!![]);}catch(_0x2a1aae){return BPromise[_0x7fda('0x26')](_0x2a1aae);}return _0x1f4fa2['save']();};}function saveUpdates(_0xb399c4,_0x24599e){return function(_0xfa00c6){if(_0xfa00c6){return _0xfa00c6[_0x7fda('0x27')](_0xb399c4)[_0x7fda('0x28')](function(_0x4a70d1){return _0x4a70d1;});}return null;};}function removeEntity(_0x55de40,_0x3b2c4e){return function(_0x5cf472){if(_0x5cf472){return _0x5cf472[_0x7fda('0x29')]()[_0x7fda('0x28')](function(){_0x55de40['status'](0xcc)[_0x7fda('0x1d')]();});}};}function handleEntityNotFound(_0x2fc295,_0x5be3ea){return function(_0xca9fc){if(!_0xca9fc){_0x2fc295[_0x7fda('0x1b')](0x194);}return _0xca9fc;};}function handleError(_0x3ae7d1,_0x527a0f){_0x527a0f=_0x527a0f||0x1f4;return function(_0x21b8bc){logger[_0x7fda('0x2a')](_0x21b8bc['stack']);if(_0x21b8bc[_0x7fda('0x2b')]){delete _0x21b8bc[_0x7fda('0x2b')];}_0x3ae7d1['status'](_0x527a0f)[_0x7fda('0x2c')](_0x21b8bc);};}exports['index']=function(_0x20d629,_0x5991bc){var _0x2ddbcf={},_0x5214b5={},_0x457981={'count':0x0,'rows':[]};var _0x2f2025=_['map'](db[_0x7fda('0x2d')]['rawAttributes'],function(_0x2ba8c7){return{'name':_0x2ba8c7['fieldName'],'type':_0x2ba8c7[_0x7fda('0x2e')][_0x7fda('0x2f')]};});_0x5214b5['model']=_[_0x7fda('0x30')](_0x2f2025,'name');_0x5214b5['query']=_[_0x7fda('0x31')](_0x20d629['query']);_0x5214b5[_0x7fda('0x32')]=_['intersection'](_0x5214b5[_0x7fda('0x33')],_0x5214b5['query']);_0x2ddbcf[_0x7fda('0x34')]=_[_0x7fda('0x35')](_0x5214b5[_0x7fda('0x33')],qs['fields'](_0x20d629[_0x7fda('0x36')][_0x7fda('0x37')]));_0x2ddbcf[_0x7fda('0x34')]=_0x2ddbcf['attributes'][_0x7fda('0x38')]?_0x2ddbcf[_0x7fda('0x34')]:_0x5214b5[_0x7fda('0x33')];if(!_0x20d629['query']['hasOwnProperty'](_0x7fda('0x39'))){_0x2ddbcf[_0x7fda('0x20')]=qs[_0x7fda('0x20')](_0x20d629[_0x7fda('0x36')][_0x7fda('0x20')]);_0x2ddbcf[_0x7fda('0x1f')]=qs['offset'](_0x20d629[_0x7fda('0x36')][_0x7fda('0x1f')]);}_0x2ddbcf['order']=qs[_0x7fda('0x3a')](_0x20d629[_0x7fda('0x36')][_0x7fda('0x3a')]);_0x2ddbcf[_0x7fda('0x3b')]=qs[_0x7fda('0x32')](_['pick'](_0x20d629[_0x7fda('0x36')],_0x5214b5[_0x7fda('0x32')]),_0x2f2025);if(_0x20d629[_0x7fda('0x36')][_0x7fda('0x3c')]){_0x2ddbcf['where']=_[_0x7fda('0x3d')](_0x2ddbcf[_0x7fda('0x3b')],{'$or':_[_0x7fda('0x30')](_0x2f2025,function(_0x1b9fdf){if(_0x1b9fdf[_0x7fda('0x2e')]!=='VIRTUAL'){var _0x49e38a={};_0x49e38a[_0x1b9fdf[_0x7fda('0x2b')]]={'$like':'%'+_0x20d629[_0x7fda('0x36')]['filter']+'%'};return _0x49e38a;}})});}_0x2ddbcf=_[_0x7fda('0x3d')]({},_0x2ddbcf,_0x20d629[_0x7fda('0x3e')]);var _0x5689a9={'where':_0x2ddbcf[_0x7fda('0x3b')]};return db[_0x7fda('0x2d')][_0x7fda('0x22')](_0x5689a9)[_0x7fda('0x28')](function(_0x2897f8){_0x457981[_0x7fda('0x22')]=_0x2897f8;if(_0x20d629[_0x7fda('0x36')]['includeAll']){_0x2ddbcf[_0x7fda('0x3f')]=[{'all':!![]}];}return db[_0x7fda('0x2d')][_0x7fda('0x40')](_0x2ddbcf);})[_0x7fda('0x28')](function(_0x48eed3){_0x457981[_0x7fda('0x41')]=_0x48eed3;return _0x457981;})[_0x7fda('0x28')](respondWithFilteredResult(_0x5991bc,_0x2ddbcf))['catch'](handleError(_0x5991bc,null));};exports[_0x7fda('0x42')]=function(_0x1b0967,_0x383a56){var _0x33fb97={'raw':![],'where':{'id':_0x1b0967[_0x7fda('0x43')]['id']}},_0x369a48={};_0x369a48[_0x7fda('0x33')]=_[_0x7fda('0x31')](db[_0x7fda('0x2d')]['rawAttributes']);_0x369a48['query']=_[_0x7fda('0x31')](_0x1b0967[_0x7fda('0x36')]);_0x369a48[_0x7fda('0x32')]=_[_0x7fda('0x35')](_0x369a48[_0x7fda('0x33')],_0x369a48['query']);_0x33fb97[_0x7fda('0x34')]=_['intersection'](_0x369a48['model'],qs['fields'](_0x1b0967['query'][_0x7fda('0x37')]));_0x33fb97[_0x7fda('0x34')]=_0x33fb97[_0x7fda('0x34')][_0x7fda('0x38')]?_0x33fb97[_0x7fda('0x34')]:_0x369a48[_0x7fda('0x33')];if(_0x1b0967[_0x7fda('0x36')]['includeAll']){_0x33fb97['include']=[{'all':!![]}];}_0x33fb97=_[_0x7fda('0x3d')]({},_0x33fb97,_0x1b0967[_0x7fda('0x3e')]);return db[_0x7fda('0x2d')][_0x7fda('0x44')](_0x33fb97)[_0x7fda('0x28')](handleEntityNotFound(_0x383a56,null))[_0x7fda('0x28')](respondWithResult(_0x383a56,null))[_0x7fda('0x45')](handleError(_0x383a56,null));};exports[_0x7fda('0x46')]=function(_0x5b5a0a,_0x12cb3a){return db[_0x7fda('0x2d')]['create'](_0x5b5a0a[_0x7fda('0x47')],{})['then'](respondWithResult(_0x12cb3a,0xc9))['catch'](handleError(_0x12cb3a,null));};exports['update']=function(_0xd92a8a,_0x225ffc){if(_0xd92a8a[_0x7fda('0x47')]['id']){delete _0xd92a8a[_0x7fda('0x47')]['id'];}return db[_0x7fda('0x2d')][_0x7fda('0x44')]({'where':{'id':_0xd92a8a[_0x7fda('0x43')]['id']}})[_0x7fda('0x28')](handleEntityNotFound(_0x225ffc,null))['then'](saveUpdates(_0xd92a8a['body'],null))[_0x7fda('0x28')](respondWithResult(_0x225ffc,null))[_0x7fda('0x45')](handleError(_0x225ffc,null));};exports['destroy']=function(_0x4b362a,_0x272c26){return db[_0x7fda('0x2d')][_0x7fda('0x44')]({'where':{'id':_0x4b362a[_0x7fda('0x43')]['id']}})[_0x7fda('0x28')](handleEntityNotFound(_0x272c26,null))[_0x7fda('0x28')](removeEntity(_0x272c26,null))['catch'](handleError(_0x272c26,null));};exports[_0x7fda('0x48')]=function(_0x570ab1,_0x195ed1){return db[_0x7fda('0x2d')][_0x7fda('0x48')]()['then'](respondWithResult(_0x195ed1,null))['catch'](handleError(_0x195ed1,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index c62df32..e72d73a 100644 --- a/server/api/integrationReport/integrationReport.model.js +++ b/server/api/integrationReport/integrationReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa266=['path','rimraf','../../config/environment','./integrationReport.attributes','exports','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x41ab73,_0xdc4501){var _0x33c1be=function(_0xc288a6){while(--_0xc288a6){_0x41ab73['push'](_0x41ab73['shift']());}};_0x33c1be(++_0xdc4501);}(_0xa266,0x1ab));var _0x6a26=function(_0x4fbb86,_0x374ed0){_0x4fbb86=_0x4fbb86-0x0;var _0xb141fe=_0xa266[_0x4fbb86];return _0xb141fe;};'use strict';var _=require(_0x6a26('0x0'));var util=require(_0x6a26('0x1'));var logger=require(_0x6a26('0x2'))(_0x6a26('0x3'));var moment=require(_0x6a26('0x4'));var BPromise=require(_0x6a26('0x5'));var rp=require(_0x6a26('0x6'));var fs=require('fs');var path=require(_0x6a26('0x7'));var rimraf=require(_0x6a26('0x8'));var config=require(_0x6a26('0x9'));var attributes=require(_0x6a26('0xa'));module[_0x6a26('0xb')]=function(_0x380541,_0x52bf5d){return _0x380541['define'](_0x6a26('0xc'),attributes,{'tableName':_0x6a26('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x45c8=['./integrationReport.attributes','exports','IntegrationReport','report_integration','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x27a426,_0x5a90a8){var _0x5e05cc=function(_0x732295){while(--_0x732295){_0x27a426['push'](_0x27a426['shift']());}};_0x5e05cc(++_0x5a90a8);}(_0x45c8,0xe5));var _0x845c=function(_0x545d90,_0x110599){_0x545d90=_0x545d90-0x0;var _0x4fee09=_0x45c8[_0x545d90];return _0x4fee09;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x845c('0x0'))(_0x845c('0x1'));var moment=require(_0x845c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x845c('0x3'));var config=require(_0x845c('0x4'));var attributes=require(_0x845c('0x5'));module[_0x845c('0x6')]=function(_0x4587d7,_0x2f95ef){return _0x4587d7['define'](_0x845c('0x7'),attributes,{'tableName':_0x845c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 0a1681b..5c7f9fa 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x20aa35,_0x1241b9){var _0x3d0293=function(_0x5e4a92){while(--_0x5e4a92){_0x20aa35['push'](_0x20aa35['shift']());}};_0x3d0293(++_0x1241b9);}(_0x1261,0x144));var _0x1126=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0x1261[_0x5216e0];return _0x5b3f40;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xda19=['error','message','info','result','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x24b375,_0x1b45e6){var _0x3c9add=function(_0x58ea1b){while(--_0x58ea1b){_0x24b375['push'](_0x24b375['shift']());}};_0x3c9add(++_0x1b45e6);}(_0xda19,0xd5));var _0x9da1=function(_0x1819fe,_0x400990){_0x1819fe=_0x1819fe-0x0;var _0x57ce5b=_0xda19[_0x1819fe];return _0x57ce5b;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var moment=require(_0x9da1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9da1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da1('0x4'))(_0x9da1('0x5'));var config=require(_0x9da1('0x6'));var jayson=require(_0x9da1('0x7'));var client=jayson[_0x9da1('0x8')][_0x9da1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){return client['request'](_0x23e4f7,_0x1c24e6)['then'](function(_0x417312){logger['info'](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));logger[_0x9da1('0xc')](_0x9da1('0xd'),_0x2c3cdd,_0x9da1('0xb'),JSON[_0x9da1('0xe')](_0x417312));if(_0x417312[_0x9da1('0xf')]){if(_0x417312['error']['code']===0x1f4){logger[_0x9da1('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x2c3cdd,_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);return _0x47df89(_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);}logger['error'](_0x9da1('0xa'),_0x2c3cdd,_0x417312['error']['message']);return _0x5e2d18(_0x417312[_0x9da1('0xf')]['message']);}else{logger[_0x9da1('0x11')](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));_0x5e2d18(_0x417312[_0x9da1('0x12')][_0x9da1('0x10')]);}})['catch'](function(_0x16f75a){logger[_0x9da1('0xf')](_0x9da1('0xa'),_0x2c3cdd,_0x16f75a);_0x47df89(_0x16f75a);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index e92927d..a7fa7ab 100644 --- a/server/api/interval/index.js +++ b/server/api/interval/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8185=['destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','update'];(function(_0x263d33,_0x590918){var _0x2aaaad=function(_0x2a83b3){while(--_0x2a83b3){_0x263d33['push'](_0x263d33['shift']());}};_0x2aaaad(++_0x590918);}(_0x8185,0x127));var _0x5818=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x8185[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0x5818('0x0'));var util=require(_0x5818('0x1'));var path=require('path');var timeout=require(_0x5818('0x2'));var express=require(_0x5818('0x3'));var router=express[_0x5818('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5818('0x5'));var config=require(_0x5818('0x6'));var controller=require(_0x5818('0x7'));router[_0x5818('0x8')]('/',auth[_0x5818('0x9')](),controller[_0x5818('0xa')]);router[_0x5818('0x8')](_0x5818('0xb'),auth[_0x5818('0x9')](),controller[_0x5818('0xc')]);router[_0x5818('0x8')](_0x5818('0xd'),auth[_0x5818('0x9')](),controller[_0x5818('0xe')]);router[_0x5818('0xf')]('/',auth[_0x5818('0x9')](),controller['create']);router[_0x5818('0xf')](_0x5818('0xd'),auth[_0x5818('0x9')](),controller[_0x5818('0x10')]);router[_0x5818('0xf')](_0x5818('0x11'),auth[_0x5818('0x9')](),controller[_0x5818('0x12')]);router['put'](_0x5818('0xb'),auth['isAuthenticated'](),controller[_0x5818('0x13')]);router['delete'](_0x5818('0xb'),auth[_0x5818('0x9')](),controller[_0x5818('0x14')]);module['exports']=router; \ No newline at end of file +var _0x960c=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','delete','destroy','exports','multer'];(function(_0x2bbfda,_0x20229b){var _0x599c3a=function(_0x78e4eb){while(--_0x78e4eb){_0x2bbfda['push'](_0x2bbfda['shift']());}};_0x599c3a(++_0x20229b);}(_0x960c,0x113));var _0xc960=function(_0x55c845,_0xfe1405){_0x55c845=_0x55c845-0x0;var _0x5dff7c=_0x960c[_0x55c845];return _0x5dff7c;};'use strict';var multer=require(_0xc960('0x0'));var util=require('util');var path=require(_0xc960('0x1'));var timeout=require('connect-timeout');var express=require(_0xc960('0x2'));var router=express[_0xc960('0x3')]();var fs_extra=require(_0xc960('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc960('0x5'));var config=require(_0xc960('0x6'));var controller=require('./interval.controller');router['get']('/',auth[_0xc960('0x7')](),controller[_0xc960('0x8')]);router[_0xc960('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc960('0xa')]);router[_0xc960('0x9')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0xc960('0xb')]);router[_0xc960('0xc')]('/',auth[_0xc960('0x7')](),controller[_0xc960('0xd')]);router[_0xc960('0xc')]('/:id/sub_intervals',auth[_0xc960('0x7')](),controller[_0xc960('0xe')]);router[_0xc960('0xc')](_0xc960('0xf'),auth[_0xc960('0x7')](),controller[_0xc960('0x10')]);router[_0xc960('0x11')](_0xc960('0x12'),auth[_0xc960('0x7')](),controller[_0xc960('0x13')]);router[_0xc960('0x14')]('/:id',auth[_0xc960('0x7')](),controller[_0xc960('0x15')]);module[_0xc960('0x16')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 81fe691..4824992 100644 --- a/server/api/interval/interval.attributes.js +++ b/server/api/interval/interval.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe563=['exports','STRING','sequelize'];(function(_0x47ccab,_0x1092b2){var _0x3b9cf2=function(_0x1eb4ac){while(--_0x1eb4ac){_0x47ccab['push'](_0x47ccab['shift']());}};_0x3b9cf2(++_0x1092b2);}(_0xe563,0x113));var _0x3e56=function(_0x1a20b5,_0x59dd38){_0x1a20b5=_0x1a20b5-0x0;var _0x29d373=_0xe563[_0x1a20b5];return _0x29d373;};'use strict';var Sequelize=require(_0x3e56('0x0'));module[_0x3e56('0x1')]={'name':{'type':Sequelize[_0x3e56('0x2')]},'description':{'type':Sequelize[_0x3e56('0x2')]},'interval':{'type':Sequelize[_0x3e56('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x9da8=['STRING','sequelize'];(function(_0x561457,_0xe737e9){var _0x2f6342=function(_0x56dd19){while(--_0x56dd19){_0x561457['push'](_0x561457['shift']());}};_0x2f6342(++_0xe737e9);}(_0x9da8,0x83));var _0x89da=function(_0x562d0d,_0x17705c){_0x562d0d=_0x562d0d-0x0;var _0x237f8e=_0x9da8[_0x562d0d];return _0x237f8e;};'use strict';var Sequelize=require(_0x89da('0x0'));module['exports']={'name':{'type':Sequelize[_0x89da('0x1')]},'description':{'type':Sequelize[_0x89da('0x1')]},'interval':{'type':Sequelize[_0x89da('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 574fe08..4188bc6 100644 --- a/server/api/interval/interval.controller.js +++ b/server/api/interval/interval.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x970e=['sequelize','transaction','bulkCreate','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','offset','limit','undefined','json','apply','save','update','destroy','then','get','Intervals','UserProfileResource','end','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','params','getIntervals','nolimit','addIntervals','findOne'];(function(_0x5958d1,_0x2a674f){var _0x45c028=function(_0x107a52){while(--_0x107a52){_0x5958d1['push'](_0x5958d1['shift']());}};_0x45c028(++_0x2a674f);}(_0x970e,0x114));var _0xe970=function(_0x498b60,_0x86568a){_0x498b60=_0x498b60-0x0;var _0x24beab=_0x970e[_0x498b60];return _0x24beab;};'use strict';var emlformat=require(_0xe970('0x0'));var rimraf=require(_0xe970('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe970('0x2'));var rp=require('request-promise');var moment=require(_0xe970('0x3'));var BPromise=require(_0xe970('0x4'));var Mustache=require(_0xe970('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe970('0x6'));var csv=require(_0xe970('0x7'));var ejs=require(_0xe970('0x8'));var fs=require('fs');var fs_extra=require(_0xe970('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe970('0xa'));var jsforce=require(_0xe970('0xb'));var deskjs=require(_0xe970('0xc'));var toCsv=require(_0xe970('0x7'));var querystring=require('querystring');var Papa=require(_0xe970('0xd'));var Redis=require('ioredis');var authService=require(_0xe970('0xe'));var qs=require(_0xe970('0xf'));var as=require(_0xe970('0x10'));var hardwareService=require(_0xe970('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xe970('0x12'));var config=require(_0xe970('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xe970('0x14'))['db'];var extensions=require(_0xe970('0x15'));function respondWithStatusCode(_0xedf345,_0x133d9d){_0x133d9d=_0x133d9d||0xcc;return function(_0x47070d){if(_0x47070d){return _0xedf345[_0xe970('0x16')](_0x133d9d);}return _0xedf345[_0xe970('0x17')](_0x133d9d)['end']();};}function respondWithResult(_0x2b0105,_0x183840){_0x183840=_0x183840||0xc8;return function(_0x1d0b09){if(_0x1d0b09){return _0x2b0105[_0xe970('0x17')](_0x183840)['json'](_0x1d0b09);}};}function respondWithFilteredResult(_0x59ad31,_0x261231){return function(_0x548e0b){if(_0x548e0b){var _0x3aef8e=typeof _0x261231[_0xe970('0x18')]==='undefined'&&typeof _0x261231[_0xe970('0x19')]===_0xe970('0x1a');var _0x53e036=_0x548e0b['count'];var _0xe41ad2=_0x3aef8e?0x0:_0x261231[_0xe970('0x18')];var _0x48419b=_0x3aef8e?_0x548e0b['count']:_0x261231['offset']+_0x261231[_0xe970('0x19')];var _0x2bb352;if(_0x48419b>=_0x53e036){_0x48419b=_0x53e036;_0x2bb352=0xc8;}else{_0x2bb352=0xce;}_0x59ad31[_0xe970('0x17')](_0x2bb352);return _0x59ad31['set']('Content-Range',_0xe41ad2+'-'+_0x48419b+'/'+_0x53e036)[_0xe970('0x1b')](_0x548e0b);}return null;};}function patchUpdates(_0x49eb57){return function(_0x4a4cde){try{jsonpatch[_0xe970('0x1c')](_0x4a4cde,_0x49eb57,!![]);}catch(_0x1125c2){return BPromise['reject'](_0x1125c2);}return _0x4a4cde[_0xe970('0x1d')]();};}function saveUpdates(_0x19a1d5,_0x1472ea){return function(_0x365d37){if(_0x365d37){return _0x365d37[_0xe970('0x1e')](_0x19a1d5)['then'](function(_0x41dceb){return _0x41dceb;});}return null;};}function removeEntity(_0x1e738c,_0xfa1b3f){return function(_0x4d020e){if(_0x4d020e){return _0x4d020e[_0xe970('0x1f')]()[_0xe970('0x20')](function(){var _0x253e1f=_0x4d020e[_0xe970('0x21')]({'plain':!![]});var _0x54e060=_0xe970('0x22');return db[_0xe970('0x23')][_0xe970('0x1f')]({'where':{'type':_0x54e060,'resourceId':_0x253e1f['id']}})[_0xe970('0x20')](function(){return _0x4d020e;});})[_0xe970('0x20')](function(){_0x1e738c[_0xe970('0x17')](0xcc)[_0xe970('0x24')]();});}};}function handleEntityNotFound(_0x10c58c,_0x4edd31){return function(_0x142bb0){if(!_0x142bb0){_0x10c58c[_0xe970('0x16')](0x194);}return _0x142bb0;};}function handleError(_0x20a2ef,_0x2a792a){_0x2a792a=_0x2a792a||0x1f4;return function(_0x2ba6a9){logger['error'](_0x2ba6a9[_0xe970('0x25')]);if(_0x2ba6a9['name']){delete _0x2ba6a9[_0xe970('0x26')];}_0x20a2ef['status'](_0x2a792a)[_0xe970('0x27')](_0x2ba6a9);};}exports[_0xe970('0x28')]=function(_0x77fbd8,_0x5a49bf){var _0x4d3816={},_0x470ef8={},_0x12b0ac={'count':0x0,'rows':[]};var _0xb1ed7f=_[_0xe970('0x29')](db[_0xe970('0x2a')][_0xe970('0x2b')],function(_0x493c91){return{'name':_0x493c91[_0xe970('0x2c')],'type':_0x493c91[_0xe970('0x2d')][_0xe970('0x2e')]};});_0x470ef8[_0xe970('0x2f')]=_[_0xe970('0x29')](_0xb1ed7f,_0xe970('0x26'));_0x470ef8['query']=_[_0xe970('0x30')](_0x77fbd8[_0xe970('0x31')]);_0x470ef8['filters']=_[_0xe970('0x32')](_0x470ef8[_0xe970('0x2f')],_0x470ef8['query']);_0x4d3816[_0xe970('0x33')]=_['intersection'](_0x470ef8[_0xe970('0x2f')],qs['fields'](_0x77fbd8[_0xe970('0x31')]['fields']));_0x4d3816['attributes']=_0x4d3816[_0xe970('0x33')][_0xe970('0x34')]?_0x4d3816[_0xe970('0x33')]:_0x470ef8['model'];if(!_0x77fbd8[_0xe970('0x31')][_0xe970('0x35')]('nolimit')){_0x4d3816[_0xe970('0x19')]=qs['limit'](_0x77fbd8[_0xe970('0x31')]['limit']);_0x4d3816['offset']=qs[_0xe970('0x18')](_0x77fbd8[_0xe970('0x31')][_0xe970('0x18')]);}_0x4d3816[_0xe970('0x36')]=qs[_0xe970('0x37')](_0x77fbd8[_0xe970('0x31')][_0xe970('0x37')]);_0x4d3816[_0xe970('0x38')]=qs[_0xe970('0x39')](_[_0xe970('0x3a')](_0x77fbd8[_0xe970('0x31')],_0x470ef8[_0xe970('0x39')]),_0xb1ed7f);if(_0x77fbd8[_0xe970('0x31')][_0xe970('0x3b')]){_0x4d3816['where']=_[_0xe970('0x3c')](_0x4d3816[_0xe970('0x38')],{'$or':_[_0xe970('0x29')](_0xb1ed7f,function(_0xc5ad25){if(_0xc5ad25[_0xe970('0x2d')]!==_0xe970('0x3d')){var _0x31c6d3={};_0x31c6d3[_0xc5ad25[_0xe970('0x26')]]={'$like':'%'+_0x77fbd8[_0xe970('0x31')][_0xe970('0x3b')]+'%'};return _0x31c6d3;}})});}_0x4d3816=_[_0xe970('0x3c')]({},_0x4d3816,_0x77fbd8[_0xe970('0x3e')]);var _0x3afe04={'where':_0x4d3816[_0xe970('0x38')]};return db[_0xe970('0x2a')][_0xe970('0x3f')](_0x3afe04)['then'](function(_0x4a03cb){_0x12b0ac[_0xe970('0x3f')]=_0x4a03cb;if(_0x77fbd8[_0xe970('0x31')][_0xe970('0x40')]){_0x4d3816[_0xe970('0x41')]=[{'all':!![]}];}return db['Interval'][_0xe970('0x42')](_0x4d3816);})[_0xe970('0x20')](function(_0x85dce0){_0x12b0ac[_0xe970('0x43')]=_0x85dce0;return _0x12b0ac;})[_0xe970('0x20')](respondWithFilteredResult(_0x5a49bf,_0x4d3816))[_0xe970('0x44')](handleError(_0x5a49bf,null));};exports[_0xe970('0x45')]=function(_0x11a8b5,_0x151ad9){var _0x4d55b7={'raw':!![],'where':{'id':_0x11a8b5['params']['id']}},_0x5670f4={};_0x5670f4[_0xe970('0x2f')]=_[_0xe970('0x30')](db[_0xe970('0x2a')][_0xe970('0x2b')]);_0x5670f4[_0xe970('0x31')]=_['keys'](_0x11a8b5[_0xe970('0x31')]);_0x5670f4['filters']=_[_0xe970('0x32')](_0x5670f4[_0xe970('0x2f')],_0x5670f4['query']);_0x4d55b7['attributes']=_[_0xe970('0x32')](_0x5670f4[_0xe970('0x2f')],qs[_0xe970('0x46')](_0x11a8b5['query'][_0xe970('0x46')]));_0x4d55b7[_0xe970('0x33')]=_0x4d55b7[_0xe970('0x33')][_0xe970('0x34')]?_0x4d55b7[_0xe970('0x33')]:_0x5670f4[_0xe970('0x2f')];if(_0x11a8b5['query']['includeAll']){_0x4d55b7[_0xe970('0x41')]=[{'all':!![]}];}_0x4d55b7=_['merge']({},_0x4d55b7,_0x11a8b5[_0xe970('0x3e')]);return db[_0xe970('0x2a')]['find'](_0x4d55b7)[_0xe970('0x20')](handleEntityNotFound(_0x151ad9,null))[_0xe970('0x20')](respondWithResult(_0x151ad9,null))[_0xe970('0x44')](handleError(_0x151ad9,null));};exports[_0xe970('0x47')]=function(_0x5878e0,_0x4eb33f){return db[_0xe970('0x2a')][_0xe970('0x47')](_0x5878e0[_0xe970('0x48')],{})['then'](function(_0x337997){var _0x39fdd1=_0x5878e0[_0xe970('0x49')][_0xe970('0x21')]({'plain':!![]});if(!_0x39fdd1)throw new Error(_0xe970('0x4a'));if(_0x39fdd1[_0xe970('0x4b')]===_0xe970('0x49')){var _0x2d7eec=_0x337997[_0xe970('0x21')]({'plain':!![]});var _0x13277c='Intervals';return db[_0xe970('0x4c')][_0xe970('0x4d')]({'where':{'name':_0x13277c,'userProfileId':_0x39fdd1['userProfileId']},'raw':!![]})[_0xe970('0x20')](function(_0xfb706a){if(_0xfb706a&&_0xfb706a[_0xe970('0x4e')]===0x0){return db[_0xe970('0x23')][_0xe970('0x47')]({'name':_0x2d7eec['name'],'resourceId':_0x2d7eec['id'],'type':_0xfb706a['name'],'sectionId':_0xfb706a['id']},{})[_0xe970('0x20')](function(){return _0x337997;});}else{return _0x337997;}})[_0xe970('0x44')](function(_0x181c50){logger[_0xe970('0x4f')](_0xe970('0x50'),_0x181c50);throw _0x181c50;});}return _0x337997;})[_0xe970('0x20')](respondWithResult(_0x4eb33f,0xc9))[_0xe970('0x44')](handleError(_0x4eb33f,null));};exports[_0xe970('0x1e')]=function(_0x56a837,_0x448e0c){if(_0x56a837[_0xe970('0x48')]['id']){delete _0x56a837[_0xe970('0x48')]['id'];}return db[_0xe970('0x2a')][_0xe970('0x4d')]({'where':{'id':_0x56a837['params']['id']}})[_0xe970('0x20')](handleEntityNotFound(_0x448e0c,null))['then'](saveUpdates(_0x56a837[_0xe970('0x48')],null))[_0xe970('0x20')](respondWithResult(_0x448e0c,null))[_0xe970('0x44')](handleError(_0x448e0c,null));};exports['destroy']=function(_0x47795f,_0x2ef745){return db[_0xe970('0x2a')][_0xe970('0x4d')]({'where':{'id':_0x47795f['params']['id']}})[_0xe970('0x20')](handleEntityNotFound(_0x2ef745,null))[_0xe970('0x20')](removeEntity(_0x2ef745,null))[_0xe970('0x44')](handleError(_0x2ef745,null));};exports[_0xe970('0x51')]=function(_0x29b0f2,_0x3d62c0,_0x58a812){if(_0x29b0f2[_0xe970('0x48')]['id']){delete _0x29b0f2['body']['id'];}return db[_0xe970('0x2a')][_0xe970('0x4d')]({'where':{'id':_0x29b0f2['params']['id']}})[_0xe970('0x20')](handleEntityNotFound(_0x3d62c0,null))[_0xe970('0x20')](function(_0x292aca){if(_0x292aca){_0x29b0f2['body'][_0xe970('0x52')]=_0x292aca['id'];return db[_0xe970('0x2a')][_0xe970('0x47')](_0x29b0f2['body']);}})['then'](respondWithResult(_0x3d62c0,null))[_0xe970('0x44')](handleError(_0x3d62c0,null));};exports['getIntervals']=function(_0x2199be,_0x157c3,_0x356ed4){var _0x4ba2b2={};var _0x45bf0e={};var _0x443e3d;var _0x4e6b44;return db[_0xe970('0x2a')]['findOne']({'where':{'id':_0x2199be[_0xe970('0x53')]['id']}})[_0xe970('0x20')](handleEntityNotFound(_0x157c3,null))[_0xe970('0x20')](function(_0x46d421){if(_0x46d421){_0x443e3d=_0x46d421;_0x45bf0e['model']=_[_0xe970('0x30')](db[_0xe970('0x2a')]['rawAttributes']);_0x45bf0e[_0xe970('0x31')]=_[_0xe970('0x30')](_0x2199be[_0xe970('0x31')]);_0x45bf0e[_0xe970('0x39')]=_[_0xe970('0x32')](_0x45bf0e[_0xe970('0x2f')],_0x45bf0e[_0xe970('0x31')]);_0x4ba2b2['attributes']=_[_0xe970('0x32')](_0x45bf0e[_0xe970('0x2f')],qs[_0xe970('0x46')](_0x2199be[_0xe970('0x31')]['fields']));_0x4ba2b2[_0xe970('0x33')]=_0x4ba2b2['attributes'][_0xe970('0x34')]?_0x4ba2b2[_0xe970('0x33')]:_0x45bf0e[_0xe970('0x2f')];_0x4ba2b2[_0xe970('0x36')]=qs[_0xe970('0x37')](_0x2199be[_0xe970('0x31')][_0xe970('0x37')]);_0x4ba2b2[_0xe970('0x38')]=qs['filters'](_[_0xe970('0x3a')](_0x2199be[_0xe970('0x31')],_0x45bf0e[_0xe970('0x39')]));if(_0x2199be[_0xe970('0x31')][_0xe970('0x3b')]){_0x4ba2b2[_0xe970('0x38')]=_[_0xe970('0x3c')](_0x4ba2b2[_0xe970('0x38')],{'$or':_[_0xe970('0x29')](_0x4ba2b2[_0xe970('0x33')],function(_0x4c45e5){var _0x19cf1c={};_0x19cf1c[_0x4c45e5]={'$like':'%'+_0x2199be[_0xe970('0x31')]['filter']+'%'};return _0x19cf1c;})});}_0x4ba2b2=_[_0xe970('0x3c')]({},_0x4ba2b2,_0x2199be[_0xe970('0x3e')]);return _0x443e3d[_0xe970('0x54')](_0x4ba2b2);}})['then'](function(_0x898359){if(_0x898359){_0x4e6b44=_0x898359[_0xe970('0x34')];if(!_0x2199be[_0xe970('0x31')][_0xe970('0x35')](_0xe970('0x55'))){_0x4ba2b2['limit']=qs[_0xe970('0x19')](_0x2199be[_0xe970('0x31')][_0xe970('0x19')]);_0x4ba2b2[_0xe970('0x18')]=qs[_0xe970('0x18')](_0x2199be[_0xe970('0x31')]['offset']);}return _0x443e3d[_0xe970('0x54')](_0x4ba2b2);}})[_0xe970('0x20')](function(_0x189abd){if(_0x189abd){return _0x189abd?{'count':_0x4e6b44,'rows':_0x189abd}:null;}})[_0xe970('0x20')](respondWithResult(_0x157c3,null))['catch'](handleError(_0x157c3,null));};exports[_0xe970('0x56')]=function(_0x4d9ddd,_0x5f45dd,_0x21c3a6){return db[_0xe970('0x2a')][_0xe970('0x57')]({'where':{'id':_0x4d9ddd[_0xe970('0x53')]['id']}})['then'](handleEntityNotFound(_0x5f45dd,null))[_0xe970('0x20')](function(_0x2c6232){if(_0x2c6232){return db[_0xe970('0x58')][_0xe970('0x59')](function(_0x39a4c8){return db[_0xe970('0x2a')][_0xe970('0x1f')]({'where':{'IntervalId':_0x4d9ddd['params']['id']},'transaction':_0x39a4c8})[_0xe970('0x20')](function(_0x1bea1c){var _0x3b70b4=_[_0xe970('0x29')](_0x4d9ddd[_0xe970('0x48')],function(_0x1da304){delete _0x1da304['id'];_0x1da304[_0xe970('0x52')]=_0x4d9ddd[_0xe970('0x53')]['id'];return _0x1da304;});return db['Interval'][_0xe970('0x5a')](_0x3b70b4,{'transaction':_0x39a4c8});});})[_0xe970('0x20')](function(){return db['Interval'][_0xe970('0x42')]({'where':{'IntervalId':_0x4d9ddd[_0xe970('0x53')]['id']}});});}})[_0xe970('0x20')](respondWithResult(_0x5f45dd,null))['catch'](handleError(_0x5f45dd,null));}; \ No newline at end of file +var _0x9467=['IntervalId','getIntervals','addIntervals','findOne','sequelize','transaction','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','then','destroy','get','UserProfileResource','error','name','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Interval','includeAll','include','findAll','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Intervals','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body'];(function(_0x4da319,_0x3e7cfe){var _0x144e4e=function(_0x2716ae){while(--_0x2716ae){_0x4da319['push'](_0x4da319['shift']());}};_0x144e4e(++_0x3e7cfe);}(_0x9467,0xb7));var _0x7946=function(_0x8bd603,_0xf0161b){_0x8bd603=_0x8bd603-0x0;var _0x3bea9d=_0x9467[_0x8bd603];return _0x3bea9d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7946('0x0'));var zipdir=require(_0x7946('0x1'));var jsonpatch=require(_0x7946('0x2'));var rp=require(_0x7946('0x3'));var moment=require(_0x7946('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7946('0x5'));var sox=require(_0x7946('0x6'));var csv=require(_0x7946('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7946('0x8'));var _=require(_0x7946('0x9'));var squel=require(_0x7946('0xa'));var crypto=require(_0x7946('0xb'));var jsforce=require(_0x7946('0xc'));var deskjs=require(_0x7946('0xd'));var toCsv=require(_0x7946('0x7'));var querystring=require('querystring');var Papa=require(_0x7946('0xe'));var Redis=require(_0x7946('0xf'));var authService=require(_0x7946('0x10'));var qs=require(_0x7946('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7946('0x12'));var logger=require(_0x7946('0x13'))(_0x7946('0x14'));var utils=require('../../config/utils');var config=require(_0x7946('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7946('0x16'))['db'];var extensions=require(_0x7946('0x17'));function respondWithStatusCode(_0x518775,_0x4da187){_0x4da187=_0x4da187||0xcc;return function(_0x112ccd){if(_0x112ccd){return _0x518775[_0x7946('0x18')](_0x4da187);}return _0x518775['status'](_0x4da187)[_0x7946('0x19')]();};}function respondWithResult(_0x410c6e,_0x1e827f){_0x1e827f=_0x1e827f||0xc8;return function(_0x520c39){if(_0x520c39){return _0x410c6e[_0x7946('0x1a')](_0x1e827f)[_0x7946('0x1b')](_0x520c39);}};}function respondWithFilteredResult(_0x56be6b,_0x1266cb){return function(_0x540d27){if(_0x540d27){var _0x42433b=typeof _0x1266cb['offset']===_0x7946('0x1c')&&typeof _0x1266cb[_0x7946('0x1d')]===_0x7946('0x1c');var _0x531fd9=_0x540d27['count'];var _0x499bee=_0x42433b?0x0:_0x1266cb[_0x7946('0x1e')];var _0x445084=_0x42433b?_0x540d27[_0x7946('0x1f')]:_0x1266cb[_0x7946('0x1e')]+_0x1266cb[_0x7946('0x1d')];var _0x5d8c53;if(_0x445084>=_0x531fd9){_0x445084=_0x531fd9;_0x5d8c53=0xc8;}else{_0x5d8c53=0xce;}_0x56be6b[_0x7946('0x1a')](_0x5d8c53);return _0x56be6b[_0x7946('0x20')](_0x7946('0x21'),_0x499bee+'-'+_0x445084+'/'+_0x531fd9)['json'](_0x540d27);}return null;};}function patchUpdates(_0x4a4528){return function(_0x448fb9){try{jsonpatch['apply'](_0x448fb9,_0x4a4528,!![]);}catch(_0x42cee9){return BPromise['reject'](_0x42cee9);}return _0x448fb9['save']();};}function saveUpdates(_0x2637da,_0x5f2632){return function(_0x592f9b){if(_0x592f9b){return _0x592f9b['update'](_0x2637da)[_0x7946('0x22')](function(_0x346c48){return _0x346c48;});}return null;};}function removeEntity(_0x10dec9,_0x4e0a07){return function(_0x2104e1){if(_0x2104e1){return _0x2104e1[_0x7946('0x23')]()[_0x7946('0x22')](function(){var _0x107499=_0x2104e1[_0x7946('0x24')]({'plain':!![]});var _0x2e2433='Intervals';return db[_0x7946('0x25')][_0x7946('0x23')]({'where':{'type':_0x2e2433,'resourceId':_0x107499['id']}})[_0x7946('0x22')](function(){return _0x2104e1;});})[_0x7946('0x22')](function(){_0x10dec9[_0x7946('0x1a')](0xcc)[_0x7946('0x19')]();});}};}function handleEntityNotFound(_0x12ef0d,_0x29963c){return function(_0x438730){if(!_0x438730){_0x12ef0d['sendStatus'](0x194);}return _0x438730;};}function handleError(_0x4586b2,_0x43ffab){_0x43ffab=_0x43ffab||0x1f4;return function(_0x289ded){logger[_0x7946('0x26')](_0x289ded['stack']);if(_0x289ded[_0x7946('0x27')]){delete _0x289ded[_0x7946('0x27')];}_0x4586b2[_0x7946('0x1a')](_0x43ffab)['send'](_0x289ded);};}exports[_0x7946('0x28')]=function(_0x5ec4bc,_0x44dc69){var _0xb7e5c0={},_0x2bfb53={},_0x2c9e3a={'count':0x0,'rows':[]};var _0x2e01bd=_['map'](db['Interval'][_0x7946('0x29')],function(_0x205c70){return{'name':_0x205c70[_0x7946('0x2a')],'type':_0x205c70[_0x7946('0x2b')][_0x7946('0x2c')]};});_0x2bfb53[_0x7946('0x2d')]=_[_0x7946('0x2e')](_0x2e01bd,_0x7946('0x27'));_0x2bfb53['query']=_[_0x7946('0x2f')](_0x5ec4bc[_0x7946('0x30')]);_0x2bfb53[_0x7946('0x31')]=_[_0x7946('0x32')](_0x2bfb53[_0x7946('0x2d')],_0x2bfb53[_0x7946('0x30')]);_0xb7e5c0['attributes']=_[_0x7946('0x32')](_0x2bfb53[_0x7946('0x2d')],qs[_0x7946('0x33')](_0x5ec4bc['query'][_0x7946('0x33')]));_0xb7e5c0[_0x7946('0x34')]=_0xb7e5c0['attributes'][_0x7946('0x35')]?_0xb7e5c0[_0x7946('0x34')]:_0x2bfb53[_0x7946('0x2d')];if(!_0x5ec4bc[_0x7946('0x30')][_0x7946('0x36')](_0x7946('0x37'))){_0xb7e5c0['limit']=qs['limit'](_0x5ec4bc[_0x7946('0x30')][_0x7946('0x1d')]);_0xb7e5c0[_0x7946('0x1e')]=qs[_0x7946('0x1e')](_0x5ec4bc[_0x7946('0x30')]['offset']);}_0xb7e5c0[_0x7946('0x38')]=qs['sort'](_0x5ec4bc[_0x7946('0x30')][_0x7946('0x39')]);_0xb7e5c0[_0x7946('0x3a')]=qs[_0x7946('0x31')](_[_0x7946('0x3b')](_0x5ec4bc[_0x7946('0x30')],_0x2bfb53[_0x7946('0x31')]),_0x2e01bd);if(_0x5ec4bc['query'][_0x7946('0x3c')]){_0xb7e5c0[_0x7946('0x3a')]=_[_0x7946('0x3d')](_0xb7e5c0[_0x7946('0x3a')],{'$or':_['map'](_0x2e01bd,function(_0x535bd2){if(_0x535bd2[_0x7946('0x2b')]!==_0x7946('0x3e')){var _0x243b0b={};_0x243b0b[_0x535bd2[_0x7946('0x27')]]={'$like':'%'+_0x5ec4bc[_0x7946('0x30')][_0x7946('0x3c')]+'%'};return _0x243b0b;}})});}_0xb7e5c0=_[_0x7946('0x3d')]({},_0xb7e5c0,_0x5ec4bc[_0x7946('0x3f')]);var _0x5d31aa={'where':_0xb7e5c0[_0x7946('0x3a')]};return db[_0x7946('0x40')][_0x7946('0x1f')](_0x5d31aa)[_0x7946('0x22')](function(_0x28ade8){_0x2c9e3a['count']=_0x28ade8;if(_0x5ec4bc[_0x7946('0x30')][_0x7946('0x41')]){_0xb7e5c0[_0x7946('0x42')]=[{'all':!![]}];}return db[_0x7946('0x40')][_0x7946('0x43')](_0xb7e5c0);})[_0x7946('0x22')](function(_0x336c51){_0x2c9e3a['rows']=_0x336c51;return _0x2c9e3a;})['then'](respondWithFilteredResult(_0x44dc69,_0xb7e5c0))['catch'](handleError(_0x44dc69,null));};exports[_0x7946('0x44')]=function(_0x1ffca2,_0x580a44){var _0x11dbeb={'raw':!![],'where':{'id':_0x1ffca2[_0x7946('0x45')]['id']}},_0xf4aa74={};_0xf4aa74[_0x7946('0x2d')]=_[_0x7946('0x2f')](db[_0x7946('0x40')][_0x7946('0x29')]);_0xf4aa74[_0x7946('0x30')]=_[_0x7946('0x2f')](_0x1ffca2[_0x7946('0x30')]);_0xf4aa74['filters']=_['intersection'](_0xf4aa74[_0x7946('0x2d')],_0xf4aa74[_0x7946('0x30')]);_0x11dbeb[_0x7946('0x34')]=_[_0x7946('0x32')](_0xf4aa74[_0x7946('0x2d')],qs[_0x7946('0x33')](_0x1ffca2['query']['fields']));_0x11dbeb[_0x7946('0x34')]=_0x11dbeb[_0x7946('0x34')][_0x7946('0x35')]?_0x11dbeb['attributes']:_0xf4aa74[_0x7946('0x2d')];if(_0x1ffca2['query']['includeAll']){_0x11dbeb[_0x7946('0x42')]=[{'all':!![]}];}_0x11dbeb=_[_0x7946('0x3d')]({},_0x11dbeb,_0x1ffca2['options']);return db[_0x7946('0x40')][_0x7946('0x46')](_0x11dbeb)[_0x7946('0x22')](handleEntityNotFound(_0x580a44,null))[_0x7946('0x22')](respondWithResult(_0x580a44,null))['catch'](handleError(_0x580a44,null));};exports['create']=function(_0x287526,_0x5eed7c){return db['Interval'][_0x7946('0x47')](_0x287526['body'],{})[_0x7946('0x22')](function(_0x15be66){var _0xa7a491=_0x287526['user']['get']({'plain':!![]});if(!_0xa7a491)throw new Error(_0x7946('0x48'));if(_0xa7a491['role']===_0x7946('0x49')){var _0x55fc44=_0x15be66[_0x7946('0x24')]({'plain':!![]});var _0x1bd3b5=_0x7946('0x4a');return db[_0x7946('0x4b')][_0x7946('0x46')]({'where':{'name':_0x1bd3b5,'userProfileId':_0xa7a491[_0x7946('0x4c')]},'raw':!![]})[_0x7946('0x22')](function(_0x9e9711){if(_0x9e9711&&_0x9e9711['autoAssociation']===0x0){return db[_0x7946('0x25')][_0x7946('0x47')]({'name':_0x55fc44[_0x7946('0x27')],'resourceId':_0x55fc44['id'],'type':_0x9e9711['name'],'sectionId':_0x9e9711['id']},{})[_0x7946('0x22')](function(){return _0x15be66;});}else{return _0x15be66;}})[_0x7946('0x4d')](function(_0x401266){logger['error'](_0x7946('0x4e'),_0x401266);throw _0x401266;});}return _0x15be66;})[_0x7946('0x22')](respondWithResult(_0x5eed7c,0xc9))['catch'](handleError(_0x5eed7c,null));};exports[_0x7946('0x4f')]=function(_0x5c8287,_0xaec39e){if(_0x5c8287[_0x7946('0x50')]['id']){delete _0x5c8287[_0x7946('0x50')]['id'];}return db['Interval'][_0x7946('0x46')]({'where':{'id':_0x5c8287['params']['id']}})[_0x7946('0x22')](handleEntityNotFound(_0xaec39e,null))[_0x7946('0x22')](saveUpdates(_0x5c8287['body'],null))[_0x7946('0x22')](respondWithResult(_0xaec39e,null))[_0x7946('0x4d')](handleError(_0xaec39e,null));};exports[_0x7946('0x23')]=function(_0x158732,_0x138903){return db['Interval'][_0x7946('0x46')]({'where':{'id':_0x158732[_0x7946('0x45')]['id']}})[_0x7946('0x22')](handleEntityNotFound(_0x138903,null))[_0x7946('0x22')](removeEntity(_0x138903,null))[_0x7946('0x4d')](handleError(_0x138903,null));};exports['addInterval']=function(_0x28b64a,_0x2854d6,_0x756726){if(_0x28b64a[_0x7946('0x50')]['id']){delete _0x28b64a[_0x7946('0x50')]['id'];}return db[_0x7946('0x40')]['find']({'where':{'id':_0x28b64a[_0x7946('0x45')]['id']}})[_0x7946('0x22')](handleEntityNotFound(_0x2854d6,null))['then'](function(_0x3085fe){if(_0x3085fe){_0x28b64a['body'][_0x7946('0x51')]=_0x3085fe['id'];return db[_0x7946('0x40')][_0x7946('0x47')](_0x28b64a[_0x7946('0x50')]);}})[_0x7946('0x22')](respondWithResult(_0x2854d6,null))[_0x7946('0x4d')](handleError(_0x2854d6,null));};exports[_0x7946('0x52')]=function(_0x328311,_0x194dd4,_0xeb6316){var _0x8accf6={};var _0x1ddef1={};var _0x45c9e6;var _0x5d1d78;return db[_0x7946('0x40')]['findOne']({'where':{'id':_0x328311[_0x7946('0x45')]['id']}})['then'](handleEntityNotFound(_0x194dd4,null))['then'](function(_0x476bb4){if(_0x476bb4){_0x45c9e6=_0x476bb4;_0x1ddef1[_0x7946('0x2d')]=_[_0x7946('0x2f')](db[_0x7946('0x40')][_0x7946('0x29')]);_0x1ddef1[_0x7946('0x30')]=_['keys'](_0x328311[_0x7946('0x30')]);_0x1ddef1[_0x7946('0x31')]=_[_0x7946('0x32')](_0x1ddef1[_0x7946('0x2d')],_0x1ddef1[_0x7946('0x30')]);_0x8accf6[_0x7946('0x34')]=_['intersection'](_0x1ddef1['model'],qs['fields'](_0x328311[_0x7946('0x30')][_0x7946('0x33')]));_0x8accf6[_0x7946('0x34')]=_0x8accf6[_0x7946('0x34')][_0x7946('0x35')]?_0x8accf6[_0x7946('0x34')]:_0x1ddef1['model'];_0x8accf6[_0x7946('0x38')]=qs['sort'](_0x328311[_0x7946('0x30')]['sort']);_0x8accf6[_0x7946('0x3a')]=qs[_0x7946('0x31')](_[_0x7946('0x3b')](_0x328311[_0x7946('0x30')],_0x1ddef1[_0x7946('0x31')]));if(_0x328311[_0x7946('0x30')]['filter']){_0x8accf6[_0x7946('0x3a')]=_[_0x7946('0x3d')](_0x8accf6[_0x7946('0x3a')],{'$or':_['map'](_0x8accf6[_0x7946('0x34')],function(_0x5da525){var _0x11cac4={};_0x11cac4[_0x5da525]={'$like':'%'+_0x328311[_0x7946('0x30')][_0x7946('0x3c')]+'%'};return _0x11cac4;})});}_0x8accf6=_['merge']({},_0x8accf6,_0x328311[_0x7946('0x3f')]);return _0x45c9e6[_0x7946('0x52')](_0x8accf6);}})[_0x7946('0x22')](function(_0x29a9fa){if(_0x29a9fa){_0x5d1d78=_0x29a9fa['length'];if(!_0x328311['query'][_0x7946('0x36')]('nolimit')){_0x8accf6[_0x7946('0x1d')]=qs[_0x7946('0x1d')](_0x328311[_0x7946('0x30')][_0x7946('0x1d')]);_0x8accf6['offset']=qs[_0x7946('0x1e')](_0x328311[_0x7946('0x30')][_0x7946('0x1e')]);}return _0x45c9e6[_0x7946('0x52')](_0x8accf6);}})['then'](function(_0x1380f4){if(_0x1380f4){return _0x1380f4?{'count':_0x5d1d78,'rows':_0x1380f4}:null;}})[_0x7946('0x22')](respondWithResult(_0x194dd4,null))[_0x7946('0x4d')](handleError(_0x194dd4,null));};exports[_0x7946('0x53')]=function(_0x514cbb,_0x2b687c,_0x160105){return db[_0x7946('0x40')][_0x7946('0x54')]({'where':{'id':_0x514cbb[_0x7946('0x45')]['id']}})['then'](handleEntityNotFound(_0x2b687c,null))[_0x7946('0x22')](function(_0x241e4f){if(_0x241e4f){return db[_0x7946('0x55')][_0x7946('0x56')](function(_0x424c67){return db[_0x7946('0x40')]['destroy']({'where':{'IntervalId':_0x514cbb[_0x7946('0x45')]['id']},'transaction':_0x424c67})['then'](function(_0x1e2139){var _0x484abc=_[_0x7946('0x2e')](_0x514cbb[_0x7946('0x50')],function(_0x1de83b){delete _0x1de83b['id'];_0x1de83b[_0x7946('0x51')]=_0x514cbb[_0x7946('0x45')]['id'];return _0x1de83b;});return db[_0x7946('0x40')][_0x7946('0x57')](_0x484abc,{'transaction':_0x424c67});});})['then'](function(){return db[_0x7946('0x40')][_0x7946('0x43')]({'where':{'IntervalId':_0x514cbb[_0x7946('0x45')]['id']}});});}})['then'](respondWithResult(_0x2b687c,null))[_0x7946('0x4d')](handleError(_0x2b687c,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index c7c3a93..bff79bb 100644 --- a/server/api/interval/interval.model.js +++ b/server/api/interval/interval.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9922=['interval','string','getIntervals','then','all','./interval.attributes','iftime','exports','define','Interval','rewrite'];(function(_0x432bfe,_0x30c884){var _0x571a52=function(_0x17c4c8){while(--_0x17c4c8){_0x432bfe['push'](_0x432bfe['shift']());}};_0x571a52(++_0x30c884);}(_0x9922,0x170));var _0x2992=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9922[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0x2992('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require('../../utils/iftime')[_0x2992('0x1')];module[_0x2992('0x2')]=function(_0x19f1a5){return _0x19f1a5[_0x2992('0x3')](_0x2992('0x4'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x329d62){extensions['rewrite'](_0x19f1a5,_0x329d62);},'afterBulkCreate':function(_0x66dd28,_0x213c36,_0x57ed15){_0x57ed15();extensions[_0x2992('0x5')](_0x19f1a5,_0x66dd28[0x0]);},'afterUpdate':function(_0x5110a0){extensions['rewrite'](_0x19f1a5,_0x5110a0);},'afterDestroy':function(_0x55d9ae){extensions[_0x2992('0x5')](_0x19f1a5,_0x55d9ae);}},'instanceMethods':{'ifTime':function(_0x3f0f5c=undefined,_0x2d1e4a=new Date()){if(typeof this[_0x2992('0x6')]===_0x2992('0x7')){return iftime(this[_0x2992('0x6')],_0x3f0f5c,_0x2d1e4a);}else{return this[_0x2992('0x8')]()[_0x2992('0x9')](function(_0x1dc7c7){return Promise[_0x2992('0xa')](_0x1dc7c7['map'](function(_0x48d39f){return _0x48d39f['ifTime'](_0x3f0f5c,_0x2d1e4a);}));})[_0x2992('0x9')](function(_0x58be13){return _0x58be13['reduce'](function(_0x3a0253,_0x292922){return _0x3a0253||_0x292922;},![]);});}}}});}; \ No newline at end of file +var _0x1aa1=['then','map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','define','Interval','tools_intervals','rewrite','interval','string','getIntervals'];(function(_0x31880d,_0x4f0ff3){var _0x423823=function(_0x57cc92){while(--_0x57cc92){_0x31880d['push'](_0x31880d['shift']());}};_0x423823(++_0x4f0ff3);}(_0x1aa1,0x90));var _0x11aa=function(_0x33e05,_0x488982){_0x33e05=_0x33e05-0x0;var _0x4956d4=_0x1aa1[_0x33e05];return _0x4956d4;};'use strict';var attributes=require(_0x11aa('0x0'));var extensions=require(_0x11aa('0x1'));var iftime=require(_0x11aa('0x2'))['iftime'];module['exports']=function(_0x5d8d1a){return _0x5d8d1a[_0x11aa('0x3')](_0x11aa('0x4'),attributes,{'tableName':_0x11aa('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x538143){extensions[_0x11aa('0x6')](_0x5d8d1a,_0x538143);},'afterBulkCreate':function(_0x209e41,_0x11adde,_0x22375c){_0x22375c();extensions[_0x11aa('0x6')](_0x5d8d1a,_0x209e41[0x0]);},'afterUpdate':function(_0x4e5c2d){extensions[_0x11aa('0x6')](_0x5d8d1a,_0x4e5c2d);},'afterDestroy':function(_0x163aec){extensions[_0x11aa('0x6')](_0x5d8d1a,_0x163aec);}},'instanceMethods':{'ifTime':function(_0x27cf0a=undefined,_0x21f137=new Date()){if(typeof this[_0x11aa('0x7')]===_0x11aa('0x8')){return iftime(this[_0x11aa('0x7')],_0x27cf0a,_0x21f137);}else{return this[_0x11aa('0x9')]()[_0x11aa('0xa')](function(_0x3c9be9){return Promise['all'](_0x3c9be9[_0x11aa('0xb')](function(_0x1cb59c){return _0x1cb59c[_0x11aa('0xc')](_0x27cf0a,_0x21f137);}));})[_0x11aa('0xa')](function(_0x295021){return _0x295021[_0x11aa('0xd')](function(_0xc8c7da,_0x52ef12){return _0xc8c7da||_0x52ef12;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index f963054..c6b5037 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5093=['IntervalIftime','intervalIds','intervals','string','length','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','then','util','../../mysqldb','../../utils/iftime','rpc','findAll','options','where','limit','include','model','map','attributes','info','GetInterval','catch','error','message','ShowInterval','find','raw','debug','stringify','Interval','all','ifTime','reduce','format','join'];(function(_0x41426b,_0x50113b){var _0x1ec1e2=function(_0x834964){while(--_0x834964){_0x41426b['push'](_0x41426b['shift']());}};_0x1ec1e2(++_0x50113b);}(_0x5093,0x78));var _0x3509=function(_0x53d2d4,_0x1f63eb){_0x53d2d4=_0x53d2d4-0x0;var _0x2128d2=_0x5093[_0x53d2d4];return _0x2128d2;};'use strict';var _=require('lodash');var util=require(_0x3509('0x0'));var db=require(_0x3509('0x1'))['db'];var iftime=require(_0x3509('0x2'))['iftime'];var logger=require('../../config/logger')(_0x3509('0x3'));exports['GetInterval']=function(_0x5c6e29){var _0x2e386a=this;return new Promise(function(_0x38d237,_0x145ae0){return db['Interval'][_0x3509('0x4')]({'raw':_0x5c6e29[_0x3509('0x5')]?_0x5c6e29['options']['raw']===undefined?!![]:![]:!![],'where':_0x5c6e29[_0x3509('0x5')]?_0x5c6e29[_0x3509('0x5')][_0x3509('0x6')]||null:null,'attributes':_0x5c6e29[_0x3509('0x5')]?_0x5c6e29[_0x3509('0x5')]['attributes']||null:null,'limit':_0x5c6e29[_0x3509('0x5')]?_0x5c6e29[_0x3509('0x5')][_0x3509('0x7')]||null:null,'include':_0x5c6e29[_0x3509('0x5')]?_0x5c6e29[_0x3509('0x5')][_0x3509('0x8')]?_['map'](_0x5c6e29['options'][_0x3509('0x8')],function(_0x25288b){return{'model':db[_0x25288b[_0x3509('0x9')]],'as':_0x25288b['as'],'attributes':_0x25288b['attributes'],'include':_0x25288b['include']?_[_0x3509('0xa')](_0x25288b['include'],function(_0x3ce856){return{'model':db[_0x3ce856[_0x3509('0x9')]],'as':_0x3ce856['as'],'attributes':_0x3ce856[_0x3509('0xb')],'include':_0x3ce856[_0x3509('0x8')]?_[_0x3509('0xa')](_0x3ce856['include'],function(_0x12b58d){return{'model':db[_0x12b58d[_0x3509('0x9')]],'as':_0x12b58d['as'],'attributes':_0x12b58d[_0x3509('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4961c9){logger[_0x3509('0xc')](_0x3509('0xd'),_0x5c6e29);logger['debug'](_0x3509('0xd'),_0x5c6e29,JSON['stringify'](_0x4961c9));_0x38d237(_0x4961c9);})[_0x3509('0xe')](function(_0x3d1c74){logger[_0x3509('0xf')]('GetInterval',_0x3d1c74[_0x3509('0x10')],_0x5c6e29);_0x145ae0(_0x2e386a[_0x3509('0xf')](0x1f4,_0x3d1c74['message']));});});};exports[_0x3509('0x11')]=function(_0x56d9b1){var _0x37389f=this;return new Promise(function(_0x12b04d,_0x14b5ca){return db['Interval'][_0x3509('0x12')]({'raw':_0x56d9b1[_0x3509('0x5')]?_0x56d9b1[_0x3509('0x5')][_0x3509('0x13')]===undefined?!![]:![]:!![],'where':_0x56d9b1['options']?_0x56d9b1['options'][_0x3509('0x6')]||null:null,'attributes':_0x56d9b1[_0x3509('0x5')]?_0x56d9b1['options'][_0x3509('0xb')]||null:null,'include':_0x56d9b1[_0x3509('0x5')]?_0x56d9b1[_0x3509('0x5')][_0x3509('0x8')]?_[_0x3509('0xa')](_0x56d9b1[_0x3509('0x5')][_0x3509('0x8')],function(_0x29abde){return{'model':db[_0x29abde[_0x3509('0x9')]],'as':_0x29abde['as'],'attributes':_0x29abde[_0x3509('0xb')],'include':_0x29abde[_0x3509('0x8')]?_[_0x3509('0xa')](_0x29abde['include'],function(_0x3388bb){return{'model':db[_0x3388bb[_0x3509('0x9')]],'as':_0x3388bb['as'],'attributes':_0x3388bb[_0x3509('0xb')],'include':_0x3388bb[_0x3509('0x8')]?_[_0x3509('0xa')](_0x3388bb['include'],function(_0xc60381){return{'model':db[_0xc60381['model']],'as':_0xc60381['as'],'attributes':_0xc60381[_0x3509('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c5f79){logger['info']('ShowInterval',_0x56d9b1);logger[_0x3509('0x14')](_0x3509('0x11'),_0x56d9b1,JSON[_0x3509('0x15')](_0x1c5f79));_0x12b04d(_0x1c5f79);})[_0x3509('0xe')](function(_0x39ed11){logger[_0x3509('0xf')](_0x3509('0x11'),_0x39ed11['message'],_0x56d9b1);_0x14b5ca(_0x37389f[_0x3509('0xf')](0x1f4,_0x39ed11[_0x3509('0x10')]));});});};function checkArrayOfIntervals(_0x34752b,_0x3653b4){var _0x61a4f9=[];return db[_0x3509('0x16')][_0x3509('0x4')]({'where':{'id':_0x34752b}})['then'](function(_0x79d692){_0x61a4f9=_0x79d692;return Promise[_0x3509('0x17')](_0x61a4f9[_0x3509('0xa')](function(_0x3ba395){return _0x3ba395[_0x3509('0x18')](_0x3653b4);}));})['then'](function(_0x55e085){var _0x5a9a72=_0x55e085[_0x3509('0x19')](function(_0xb68dd8,_0x5ccc2f){return _0xb68dd8||_0x5ccc2f;},![]);logger['info'](util[_0x3509('0x1a')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x61a4f9[_0x3509('0xa')](function(_0x458620){return _0x458620['name'];})[_0x3509('0x1b')](',\x20'),_0x61a4f9[_0x3509('0xa')](function(_0x1294ee){return _0x1294ee['id'];})[_0x3509('0x1b')](',\x20')));return _0x5a9a72;});}function checkSingleInterval(_0x1787d0,_0x2d6346){return db['Interval']['findById'](_0x1787d0)['then'](function(_0x106628){if(_0x106628){logger['info'](util['format']('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x106628['name'],_0x106628['id']));return _0x106628[_0x3509('0x18')](_0x2d6346);}});}exports[_0x3509('0x1c')]=function(_0x26fa10){var _0x1d0de7=_0x26fa10[_0x3509('0x1d')];var _0x436865=Array['isArray'](_0x26fa10[_0x3509('0x1e')])?_0x26fa10['intervals']:typeof _0x26fa10[_0x3509('0x1e')]===_0x3509('0x1f')?[_0x26fa10[_0x3509('0x1e')]]:[];var _0x404cc2=_0x26fa10['timezone']||undefined;var _0x1d831e=![];if(_0x436865[_0x3509('0x20')]){logger[_0x3509('0xc')](util[_0x3509('0x1a')]('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x436865['join'](';\x20')));}if(_0x404cc2){logger[_0x3509('0xc')](util[_0x3509('0x1a')](_0x3509('0x21'),_0x404cc2));}logger[_0x3509('0x14')](_0x3509('0x22'),_0x1d831e);logger[_0x3509('0x23')](_0x3509('0x1c'),_0x26fa10);return Promise['resolve']()[_0x3509('0x24')](function(){if(Array['isArray'](_0x1d0de7)){return checkArrayOfIntervals(_0x1d0de7,_0x404cc2);}else if(_0x1d0de7){return checkSingleInterval(_0x1d0de7,_0x404cc2);}})[_0x3509('0x24')](function(_0x2d0d64){var _0x48b68c=_0x436865[_0x3509('0x19')](function(_0x18e980,_0x37f6e9){return _0x18e980||iftime(_0x37f6e9,_0x404cc2);},![]);_0x1d831e=_0x2d0d64||_0x48b68c;return _0x1d831e;})[_0x3509('0xe')](function(_0x4ff7a3){logger[_0x3509('0xf')](_0x3509('0x1c'),_0x26fa10,_0x4ff7a3);throw this['error'](0x1f4,_0x4ff7a3[_0x3509('0x10')]);});}; \ No newline at end of file +var _0xdae0=['Iftime','resolve','isArray','IntervalIftime','util','../../utils/iftime','iftime','../../config/logger','GetInterval','Interval','findAll','options','raw','where','attributes','limit','map','include','model','then','info','debug','stringify','error','message','ShowInterval','find','catch','all','ifTime','reduce','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','intervalIds','intervals','string','timezone','format'];(function(_0x24f151,_0x337581){var _0x25464c=function(_0x250df3){while(--_0x250df3){_0x24f151['push'](_0x24f151['shift']());}};_0x25464c(++_0x337581);}(_0xdae0,0x7c));var _0x0dae=function(_0x2b8b41,_0x18a4b6){_0x2b8b41=_0x2b8b41-0x0;var _0x38d326=_0xdae0[_0x2b8b41];return _0x38d326;};'use strict';var _=require('lodash');var util=require(_0x0dae('0x0'));var db=require('../../mysqldb')['db'];var iftime=require(_0x0dae('0x1'))[_0x0dae('0x2')];var logger=require(_0x0dae('0x3'))('rpc');exports[_0x0dae('0x4')]=function(_0x14b8b6){var _0x1cfacb=this;return new Promise(function(_0xb12296,_0x10aa6b){return db[_0x0dae('0x5')][_0x0dae('0x6')]({'raw':_0x14b8b6[_0x0dae('0x7')]?_0x14b8b6[_0x0dae('0x7')][_0x0dae('0x8')]===undefined?!![]:![]:!![],'where':_0x14b8b6['options']?_0x14b8b6[_0x0dae('0x7')][_0x0dae('0x9')]||null:null,'attributes':_0x14b8b6['options']?_0x14b8b6['options'][_0x0dae('0xa')]||null:null,'limit':_0x14b8b6[_0x0dae('0x7')]?_0x14b8b6[_0x0dae('0x7')][_0x0dae('0xb')]||null:null,'include':_0x14b8b6[_0x0dae('0x7')]?_0x14b8b6[_0x0dae('0x7')]['include']?_[_0x0dae('0xc')](_0x14b8b6[_0x0dae('0x7')][_0x0dae('0xd')],function(_0x4bf9de){return{'model':db[_0x4bf9de[_0x0dae('0xe')]],'as':_0x4bf9de['as'],'attributes':_0x4bf9de['attributes'],'include':_0x4bf9de['include']?_[_0x0dae('0xc')](_0x4bf9de[_0x0dae('0xd')],function(_0x1cd438){return{'model':db[_0x1cd438['model']],'as':_0x1cd438['as'],'attributes':_0x1cd438[_0x0dae('0xa')],'include':_0x1cd438['include']?_['map'](_0x1cd438[_0x0dae('0xd')],function(_0x345288){return{'model':db[_0x345288[_0x0dae('0xe')]],'as':_0x345288['as'],'attributes':_0x345288[_0x0dae('0xa')]};}):[]};}):[]};}):[]:[]})[_0x0dae('0xf')](function(_0x521b63){logger[_0x0dae('0x10')](_0x0dae('0x4'),_0x14b8b6);logger[_0x0dae('0x11')](_0x0dae('0x4'),_0x14b8b6,JSON[_0x0dae('0x12')](_0x521b63));_0xb12296(_0x521b63);})['catch'](function(_0x5a5d54){logger[_0x0dae('0x13')](_0x0dae('0x4'),_0x5a5d54[_0x0dae('0x14')],_0x14b8b6);_0x10aa6b(_0x1cfacb[_0x0dae('0x13')](0x1f4,_0x5a5d54[_0x0dae('0x14')]));});});};exports[_0x0dae('0x15')]=function(_0x2ebf29){var _0x40137e=this;return new Promise(function(_0x3885ee,_0x23851e){return db[_0x0dae('0x5')][_0x0dae('0x16')]({'raw':_0x2ebf29['options']?_0x2ebf29[_0x0dae('0x7')][_0x0dae('0x8')]===undefined?!![]:![]:!![],'where':_0x2ebf29[_0x0dae('0x7')]?_0x2ebf29['options'][_0x0dae('0x9')]||null:null,'attributes':_0x2ebf29['options']?_0x2ebf29[_0x0dae('0x7')][_0x0dae('0xa')]||null:null,'include':_0x2ebf29[_0x0dae('0x7')]?_0x2ebf29[_0x0dae('0x7')][_0x0dae('0xd')]?_[_0x0dae('0xc')](_0x2ebf29['options'][_0x0dae('0xd')],function(_0x244e13){return{'model':db[_0x244e13[_0x0dae('0xe')]],'as':_0x244e13['as'],'attributes':_0x244e13['attributes'],'include':_0x244e13[_0x0dae('0xd')]?_['map'](_0x244e13[_0x0dae('0xd')],function(_0x3ffb18){return{'model':db[_0x3ffb18['model']],'as':_0x3ffb18['as'],'attributes':_0x3ffb18['attributes'],'include':_0x3ffb18[_0x0dae('0xd')]?_[_0x0dae('0xc')](_0x3ffb18[_0x0dae('0xd')],function(_0x194a69){return{'model':db[_0x194a69[_0x0dae('0xe')]],'as':_0x194a69['as'],'attributes':_0x194a69[_0x0dae('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a257e){logger['info'](_0x0dae('0x15'),_0x2ebf29);logger[_0x0dae('0x11')](_0x0dae('0x15'),_0x2ebf29,JSON[_0x0dae('0x12')](_0x2a257e));_0x3885ee(_0x2a257e);})[_0x0dae('0x17')](function(_0x444632){logger['error'](_0x0dae('0x15'),_0x444632[_0x0dae('0x14')],_0x2ebf29);_0x23851e(_0x40137e[_0x0dae('0x13')](0x1f4,_0x444632[_0x0dae('0x14')]));});});};function checkArrayOfIntervals(_0x35f112,_0x531d8e){var _0x1308f5=[];return db['Interval'][_0x0dae('0x6')]({'where':{'id':_0x35f112}})['then'](function(_0x3a1be5){_0x1308f5=_0x3a1be5;return Promise[_0x0dae('0x18')](_0x1308f5['map'](function(_0x6630f9){return _0x6630f9[_0x0dae('0x19')](_0x531d8e);}));})[_0x0dae('0xf')](function(_0x427b4a){var _0x27f508=_0x427b4a[_0x0dae('0x1a')](function(_0x6211f2,_0x4252a9){return _0x6211f2||_0x4252a9;},![]);logger[_0x0dae('0x10')](util['format']('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x1308f5[_0x0dae('0xc')](function(_0x140bfc){return _0x140bfc[_0x0dae('0x1b')];})[_0x0dae('0x1c')](',\x20'),_0x1308f5[_0x0dae('0xc')](function(_0x363e35){return _0x363e35['id'];})[_0x0dae('0x1c')](',\x20')));return _0x27f508;});}function checkSingleInterval(_0x5e6b04,_0x15dea8){return db['Interval'][_0x0dae('0x1d')](_0x5e6b04)[_0x0dae('0xf')](function(_0x2eac23){if(_0x2eac23){logger['info'](util['format'](_0x0dae('0x1e'),_0x2eac23[_0x0dae('0x1b')],_0x2eac23['id']));return _0x2eac23['ifTime'](_0x15dea8);}});}exports['IntervalIftime']=function(_0x511d58){var _0x1b9f7f=_0x511d58[_0x0dae('0x1f')];var _0x23734d=Array['isArray'](_0x511d58[_0x0dae('0x20')])?_0x511d58[_0x0dae('0x20')]:typeof _0x511d58[_0x0dae('0x20')]===_0x0dae('0x21')?[_0x511d58[_0x0dae('0x20')]]:[];var _0x15dc72=_0x511d58[_0x0dae('0x22')]||undefined;var _0x461520=![];if(_0x23734d['length']){logger[_0x0dae('0x10')](util[_0x0dae('0x23')]('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x23734d[_0x0dae('0x1c')](';\x20')));}if(_0x15dc72){logger[_0x0dae('0x10')](util[_0x0dae('0x23')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x15dc72));}logger['debug'](_0x0dae('0x24'),_0x461520);logger['silly']('IntervalIftime',_0x511d58);return Promise[_0x0dae('0x25')]()[_0x0dae('0xf')](function(){if(Array[_0x0dae('0x26')](_0x1b9f7f)){return checkArrayOfIntervals(_0x1b9f7f,_0x15dc72);}else if(_0x1b9f7f){return checkSingleInterval(_0x1b9f7f,_0x15dc72);}})[_0x0dae('0xf')](function(_0x3fe80a){var _0x512dfd=_0x23734d[_0x0dae('0x1a')](function(_0x387f16,_0x2b2770){return _0x387f16||iftime(_0x2b2770,_0x15dc72);},![]);_0x461520=_0x3fe80a||_0x512dfd;return _0x461520;})[_0x0dae('0x17')](function(_0x5ca4be){logger[_0x0dae('0x13')](_0x0dae('0x27'),_0x511d58,_0x5ca4be);throw this[_0x0dae('0x13')](0x1f4,_0x5ca4be[_0x0dae('0x14')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 2d0890e..cdbe55a 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x1114dc,_0x50aed4){var _0x164894=function(_0x40ec33){while(--_0x40ec33){_0x1114dc['push'](_0x1114dc['shift']());}};_0x164894(++_0x50aed4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4f3193,_0x500f84){_0x4f3193=_0x4f3193-0x0;var _0x5f53fa=_0x5f2f[_0x4f3193];return _0x5f53fa;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x1b7ca7,_0x51b242){var _0x160e55=function(_0x9217fe){while(--_0x9217fe){_0x1b7ca7['push'](_0x1b7ca7['shift']());}};_0x160e55(++_0x51b242);}(_0x2ef3,0xba));var _0x32ef=function(_0x34f4c3,_0x1ec223){_0x34f4c3=_0x34f4c3-0x0;var _0x3723a5=_0x2ef3[_0x34f4c3];return _0x3723a5;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index dcd17b6..c9ad5ad 100644 --- a/server/api/jira/jira.controller.js +++ b/server/api/jira/jira.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd67=['../../config/logger','api','support','3eAmWpBVP0','MOTGUI','summary','Report','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','toString','base64','request','setEncoding','utf8','data','end','status','json','parse','write','openIssue','send','headers','x-forwarded-for','connection','remoteAddress','socket','body','bluebird'];(function(_0x33a0bd,_0x2bc749){var _0x1f3187=function(_0x6ceda7){while(--_0x6ceda7){_0x33a0bd['push'](_0x33a0bd['shift']());}};_0x1f3187(++_0x2bc749);}(_0xfd67,0xaf));var _0x7fd6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xfd67[_0x19950b];return _0x3c6b41;};'use strict';var BPromise=require(_0x7fd6('0x0'));var https=require('https');var logger=require(_0x7fd6('0x1'))(_0x7fd6('0x2'));var USERNAME=_0x7fd6('0x3');var PASSWORD=_0x7fd6('0x4');function openIssue(_0x128da7,_0x44759b){var _0x51aa30={'fields':{'project':{'key':_0x128da7['key']||_0x7fd6('0x5')},'summary':(_0x128da7[_0x7fd6('0x6')]||_0x7fd6('0x7'))+'\x20from\x20'+_0x128da7['ip'],'description':_0x128da7[_0x7fd6('0x8')]||JSON[_0x7fd6('0x9')](_0x128da7),'issuetype':{'name':_0x128da7[_0x7fd6('0xa')]||_0x7fd6('0xb')}}};_0x51aa30[_0x7fd6('0xc')][_0x7fd6('0xd')]=_0x128da7[_0x7fd6('0xe')];_0x51aa30['fields'][_0x7fd6('0xf')]=_0x128da7['oldToken'];_0x51aa30[_0x7fd6('0xc')][_0x7fd6('0x10')]=_0x128da7[_0x7fd6('0x11')];_0x51aa30['fields']['customfield_11503']=_0x128da7[_0x7fd6('0x12')];_0x51aa30[_0x7fd6('0xc')][_0x7fd6('0x13')]=_0x128da7[_0x7fd6('0x14')];_0x51aa30[_0x7fd6('0xc')]['customfield_10102']=_0x128da7['ip'];var _0x71f32e={'host':_0x7fd6('0x15'),'port':0x1bb,'path':_0x7fd6('0x16'),'method':_0x7fd6('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x7fd6('0x18'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x7fd6('0x19')](_0x7fd6('0x1a'))}};var _0x1ed938=JSON[_0x7fd6('0x9')](_0x51aa30);var _0x58aebe=https[_0x7fd6('0x1b')](_0x71f32e,function(_0x29f25a){_0x29f25a[_0x7fd6('0x1c')](_0x7fd6('0x1d'));var _0x224fe1='';_0x29f25a['on'](_0x7fd6('0x1e'),function(_0x4cc7e5){_0x224fe1+=_0x4cc7e5;});_0x29f25a['on'](_0x7fd6('0x1f'),function(){if(_0x44759b){return _0x44759b[_0x7fd6('0x20')](_0x29f25a['statusCode'])[_0x7fd6('0x21')](JSON[_0x7fd6('0x22')](_0x224fe1));}});});_0x58aebe['on']('error',function(_0x250407){if(_0x44759b){return _0x44759b[_0x7fd6('0x20')](0x1f4)[_0x7fd6('0x21')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0x58aebe[_0x7fd6('0x23')](_0x1ed938);_0x58aebe[_0x7fd6('0x1f')]();}exports[_0x7fd6('0x24')]=openIssue;exports[_0x7fd6('0x25')]=function(_0x164e68,_0xc834a7){_0x164e68['body']['ip']=_0x164e68[_0x7fd6('0x26')][_0x7fd6('0x27')]||_0x164e68[_0x7fd6('0x28')][_0x7fd6('0x29')]||_0x164e68[_0x7fd6('0x2a')][_0x7fd6('0x29')]||_0x164e68[_0x7fd6('0x28')][_0x7fd6('0x2a')][_0x7fd6('0x29')];return openIssue(_0x164e68[_0x7fd6('0x2b')],_0xc834a7);}; \ No newline at end of file +var _0x904f=['issuetype','Bug','fields','customfield_11500','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','Basic\x20','toString','request','setEncoding','utf8','end','status','statusCode','json','parse','error','api.jira','write','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','api','3eAmWpBVP0','key','summary','\x20from\x20','description','stringify'];(function(_0x3ffb25,_0x5254b1){var _0x1de346=function(_0x5060bf){while(--_0x5060bf){_0x3ffb25['push'](_0x3ffb25['shift']());}};_0x1de346(++_0x5254b1);}(_0x904f,0x11e));var _0xf904=function(_0x2d8813,_0xe1dd20){_0x2d8813=_0x2d8813-0x0;var _0x3049fd=_0x904f[_0x2d8813];return _0x3049fd;};'use strict';var BPromise=require(_0xf904('0x0'));var https=require('https');var logger=require('../../config/logger')(_0xf904('0x1'));var USERNAME='support';var PASSWORD=_0xf904('0x2');function openIssue(_0xacf531,_0x462c71){var _0x21d718={'fields':{'project':{'key':_0xacf531[_0xf904('0x3')]||'MOTGUI'},'summary':(_0xacf531[_0xf904('0x4')]||'Report')+_0xf904('0x5')+_0xacf531['ip'],'description':_0xacf531[_0xf904('0x6')]||JSON[_0xf904('0x7')](_0xacf531),'issuetype':{'name':_0xacf531[_0xf904('0x8')]||_0xf904('0x9')}}};_0x21d718[_0xf904('0xa')][_0xf904('0xb')]=_0xacf531['email'];_0x21d718[_0xf904('0xa')]['customfield_11501']=_0xacf531[_0xf904('0xc')];_0x21d718['fields'][_0xf904('0xd')]=_0xacf531[_0xf904('0xe')];_0x21d718[_0xf904('0xa')][_0xf904('0xf')]=_0xacf531[_0xf904('0x10')];_0x21d718[_0xf904('0xa')][_0xf904('0x11')]=_0xacf531[_0xf904('0x12')];_0x21d718[_0xf904('0xa')][_0xf904('0x13')]=_0xacf531['ip'];var _0x4eee39={'host':_0xf904('0x14'),'port':0x1bb,'path':_0xf904('0x15'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xf904('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0xf904('0x17')]('base64')}};var _0x427283=JSON[_0xf904('0x7')](_0x21d718);var _0x3a8c72=https[_0xf904('0x18')](_0x4eee39,function(_0x5698c9){_0x5698c9[_0xf904('0x19')](_0xf904('0x1a'));var _0x29b397='';_0x5698c9['on']('data',function(_0x29410a){_0x29b397+=_0x29410a;});_0x5698c9['on'](_0xf904('0x1b'),function(){if(_0x462c71){return _0x462c71[_0xf904('0x1c')](_0x5698c9[_0xf904('0x1d')])[_0xf904('0x1e')](JSON[_0xf904('0x1f')](_0x29b397));}});});_0x3a8c72['on'](_0xf904('0x20'),function(_0x365b59){if(_0x462c71){return _0x462c71[_0xf904('0x1c')](0x1f4)[_0xf904('0x1e')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xf904('0x21')}]});}});_0x3a8c72[_0xf904('0x22')](_0x427283);_0x3a8c72[_0xf904('0x1b')]();}exports['openIssue']=openIssue;exports[_0xf904('0x23')]=function(_0x45930d,_0x3a5bfc){_0x45930d[_0xf904('0x24')]['ip']=_0x45930d[_0xf904('0x25')][_0xf904('0x26')]||_0x45930d[_0xf904('0x27')][_0xf904('0x28')]||_0x45930d[_0xf904('0x29')][_0xf904('0x28')]||_0x45930d[_0xf904('0x27')]['socket'][_0xf904('0x28')];return openIssue(_0x45930d[_0xf904('0x24')],_0x3a5bfc);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index a022453..a89a2d2 100644 --- a/server/api/jscriptyAnswerReport/index.js +++ b/server/api/jscriptyAnswerReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b02=['destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete'];(function(_0x535082,_0x52f0a8){var _0x32cdc9=function(_0x354f40){while(--_0x354f40){_0x535082['push'](_0x535082['shift']());}};_0x32cdc9(++_0x52f0a8);}(_0x5b02,0xe9));var _0x25b0=function(_0x6a87f0,_0x4fa8a9){_0x6a87f0=_0x6a87f0-0x0;var _0x2f7e01=_0x5b02[_0x6a87f0];return _0x2f7e01;};'use strict';var multer=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var path=require(_0x25b0('0x2'));var timeout=require(_0x25b0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x25b0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var controller=require(_0x25b0('0x7'));router[_0x25b0('0x8')]('/',auth[_0x25b0('0x9')](),controller['index']);router[_0x25b0('0x8')](_0x25b0('0xa'),auth['isAuthenticated'](),controller[_0x25b0('0xb')]);router['get']('/:id',auth[_0x25b0('0x9')](),controller[_0x25b0('0xc')]);router[_0x25b0('0xd')]('/',auth['isAuthenticated'](),controller[_0x25b0('0xe')]);router[_0x25b0('0xf')](_0x25b0('0x10'),auth[_0x25b0('0x9')](),controller[_0x25b0('0x11')]);router[_0x25b0('0x12')](_0x25b0('0x10'),auth[_0x25b0('0x9')](),controller[_0x25b0('0x13')]);module[_0x25b0('0x14')]=router; \ No newline at end of file +var _0x878f=['./jscriptyAnswerReport.controller','get','/describe','/:id','post','isAuthenticated','create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x19223d,_0x4a5a7a){var _0x33e726=function(_0xe3bdca){while(--_0xe3bdca){_0x19223d['push'](_0x19223d['shift']());}};_0x33e726(++_0x4a5a7a);}(_0x878f,0x173));var _0xf878=function(_0x1f886c,_0x27e619){_0x1f886c=_0x1f886c-0x0;var _0x10fd4b=_0x878f[_0x1f886c];return _0x10fd4b;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var fs_extra=require(_0xf878('0x5'));var auth=require(_0xf878('0x6'));var interaction=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var controller=require(_0xf878('0x9'));router[_0xf878('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf878('0xa')](_0xf878('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xf878('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf878('0xd')]('/',auth[_0xf878('0xe')](),controller[_0xf878('0xf')]);router['put'](_0xf878('0xc'),auth[_0xf878('0xe')](),controller['update']);router[_0xf878('0x10')]('/:id',auth[_0xf878('0xe')](),controller[_0xf878('0x11')]);module[_0xf878('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 527bdc6..7a178fd 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x7a54,0x106));var _0x47a5=function(_0x24732a,_0x4204d5){_0x24732a=_0x24732a-0x0;var _0x1232b0=_0x7a54[_0x24732a];return _0x1232b0;};'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(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x7a54,0x106));var _0x47a5=function(_0x49cf70,_0x32bf99){_0x49cf70=_0x49cf70-0x0;var _0x2cb546=_0x7a54[_0x49cf70];return _0x2cb546;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index fa5b223..c6f000c 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0734=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','index','map','JscriptyAnswerReport','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','set'];(function(_0x29aa6a,_0x337825){var _0x10d518=function(_0x3cd73a){while(--_0x3cd73a){_0x29aa6a['push'](_0x29aa6a['shift']());}};_0x10d518(++_0x337825);}(_0x0734,0xba));var _0x4073=function(_0x1d9615,_0x3f6e94){_0x1d9615=_0x1d9615-0x0;var _0xcc8025=_0x0734[_0x1d9615];return _0xcc8025;};'use strict';var emlformat=require(_0x4073('0x0'));var rimraf=require(_0x4073('0x1'));var zipdir=require(_0x4073('0x2'));var jsonpatch=require(_0x4073('0x3'));var rp=require(_0x4073('0x4'));var moment=require('moment');var BPromise=require(_0x4073('0x5'));var Mustache=require(_0x4073('0x6'));var util=require(_0x4073('0x7'));var path=require(_0x4073('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4073('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4073('0xa'));var squel=require(_0x4073('0xb'));var crypto=require(_0x4073('0xc'));var jsforce=require(_0x4073('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4073('0xe'));var querystring=require('querystring');var Papa=require(_0x4073('0xf'));var Redis=require(_0x4073('0x10'));var authService=require(_0x4073('0x11'));var qs=require(_0x4073('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4073('0x13'))(_0x4073('0x14'));var utils=require('../../config/utils');var config=require(_0x4073('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4073('0x16'))['db'];function respondWithStatusCode(_0x4c496c,_0x1778d8){_0x1778d8=_0x1778d8||0xcc;return function(_0x48e6eb){if(_0x48e6eb){return _0x4c496c['sendStatus'](_0x1778d8);}return _0x4c496c[_0x4073('0x17')](_0x1778d8)[_0x4073('0x18')]();};}function respondWithResult(_0x565576,_0x416322){_0x416322=_0x416322||0xc8;return function(_0x1355f5){if(_0x1355f5){return _0x565576[_0x4073('0x17')](_0x416322)[_0x4073('0x19')](_0x1355f5);}};}function respondWithFilteredResult(_0x3e29e9,_0x45238f){return function(_0x592c8c){if(_0x592c8c){var _0x2bc7c5=typeof _0x45238f['offset']===_0x4073('0x1a')&&typeof _0x45238f[_0x4073('0x1b')]==='undefined';var _0x1339b2=_0x592c8c[_0x4073('0x1c')];var _0x7a6e37=_0x2bc7c5?0x0:_0x45238f['offset'];var _0x35e397=_0x2bc7c5?_0x592c8c[_0x4073('0x1c')]:_0x45238f['offset']+_0x45238f['limit'];var _0x44aa71;if(_0x35e397>=_0x1339b2){_0x35e397=_0x1339b2;_0x44aa71=0xc8;}else{_0x44aa71=0xce;}_0x3e29e9['status'](_0x44aa71);return _0x3e29e9[_0x4073('0x1d')](_0x4073('0x1e'),_0x7a6e37+'-'+_0x35e397+'/'+_0x1339b2)[_0x4073('0x19')](_0x592c8c);}return null;};}function patchUpdates(_0x56d196){return function(_0xa87289){try{jsonpatch[_0x4073('0x1f')](_0xa87289,_0x56d196,!![]);}catch(_0x37b4f3){return BPromise[_0x4073('0x20')](_0x37b4f3);}return _0xa87289[_0x4073('0x21')]();};}function saveUpdates(_0x523c11,_0x1b36b7){return function(_0x5b5977){if(_0x5b5977){return _0x5b5977['update'](_0x523c11)[_0x4073('0x22')](function(_0x3dfed2){return _0x3dfed2;});}return null;};}function removeEntity(_0x37fd2d,_0x531bf4){return function(_0x48c8eb){if(_0x48c8eb){return _0x48c8eb[_0x4073('0x23')]()[_0x4073('0x22')](function(){_0x37fd2d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x765754,_0x477cf6){return function(_0x259234){if(!_0x259234){_0x765754[_0x4073('0x24')](0x194);}return _0x259234;};}function handleError(_0x19a118,_0x20d4a8){_0x20d4a8=_0x20d4a8||0x1f4;return function(_0xf3faf4){logger[_0x4073('0x25')](_0xf3faf4['stack']);if(_0xf3faf4[_0x4073('0x26')]){delete _0xf3faf4[_0x4073('0x26')];}_0x19a118[_0x4073('0x17')](_0x20d4a8)['send'](_0xf3faf4);};}exports[_0x4073('0x27')]=function(_0x35b8d5,_0x512f69){var _0x57fcfd={},_0x465c67={},_0x429f8d={'count':0x0,'rows':[]};var _0x5e958d=_[_0x4073('0x28')](db[_0x4073('0x29')][_0x4073('0x2a')],function(_0x45a36e){return{'name':_0x45a36e['fieldName'],'type':_0x45a36e[_0x4073('0x2b')][_0x4073('0x2c')]};});_0x465c67[_0x4073('0x2d')]=_['map'](_0x5e958d,_0x4073('0x26'));_0x465c67[_0x4073('0x2e')]=_[_0x4073('0x2f')](_0x35b8d5[_0x4073('0x2e')]);_0x465c67[_0x4073('0x30')]=_['intersection'](_0x465c67[_0x4073('0x2d')],_0x465c67[_0x4073('0x2e')]);_0x57fcfd[_0x4073('0x31')]=_[_0x4073('0x32')](_0x465c67[_0x4073('0x2d')],qs['fields'](_0x35b8d5[_0x4073('0x2e')][_0x4073('0x33')]));_0x57fcfd[_0x4073('0x31')]=_0x57fcfd[_0x4073('0x31')][_0x4073('0x34')]?_0x57fcfd[_0x4073('0x31')]:_0x465c67[_0x4073('0x2d')];if(!_0x35b8d5['query'][_0x4073('0x35')](_0x4073('0x36'))){_0x57fcfd[_0x4073('0x1b')]=qs[_0x4073('0x1b')](_0x35b8d5[_0x4073('0x2e')][_0x4073('0x1b')]);_0x57fcfd['offset']=qs['offset'](_0x35b8d5[_0x4073('0x2e')][_0x4073('0x37')]);}_0x57fcfd['order']=qs['sort'](_0x35b8d5['query'][_0x4073('0x38')]);_0x57fcfd[_0x4073('0x39')]=qs['filters'](_[_0x4073('0x3a')](_0x35b8d5[_0x4073('0x2e')],_0x465c67[_0x4073('0x30')]),_0x5e958d);if(_0x35b8d5[_0x4073('0x2e')][_0x4073('0x3b')]){_0x57fcfd[_0x4073('0x39')]=_[_0x4073('0x3c')](_0x57fcfd[_0x4073('0x39')],{'$or':_[_0x4073('0x28')](_0x5e958d,function(_0x4e93a6){if(_0x4e93a6[_0x4073('0x2b')]!==_0x4073('0x3d')){var _0xce192c={};_0xce192c[_0x4e93a6['name']]={'$like':'%'+_0x35b8d5['query'][_0x4073('0x3b')]+'%'};return _0xce192c;}})});}_0x57fcfd=_[_0x4073('0x3c')]({},_0x57fcfd,_0x35b8d5['options']);var _0x5eb108={'where':_0x57fcfd[_0x4073('0x39')]};return db['JscriptyAnswerReport'][_0x4073('0x1c')](_0x5eb108)[_0x4073('0x22')](function(_0x4499ad){_0x429f8d[_0x4073('0x1c')]=_0x4499ad;if(_0x35b8d5[_0x4073('0x2e')][_0x4073('0x3e')]){_0x57fcfd[_0x4073('0x3f')]=[{'all':!![]}];}return db[_0x4073('0x29')][_0x4073('0x40')](_0x57fcfd);})[_0x4073('0x22')](function(_0x214635){_0x429f8d['rows']=_0x214635;return _0x429f8d;})[_0x4073('0x22')](respondWithFilteredResult(_0x512f69,_0x57fcfd))[_0x4073('0x41')](handleError(_0x512f69,null));};exports[_0x4073('0x42')]=function(_0x288055,_0x4d026c){var _0x4d4baf={'raw':!![],'where':{'id':_0x288055[_0x4073('0x43')]['id']}},_0x2d577e={};_0x2d577e[_0x4073('0x2d')]=_[_0x4073('0x2f')](db['JscriptyAnswerReport']['rawAttributes']);_0x2d577e[_0x4073('0x2e')]=_[_0x4073('0x2f')](_0x288055[_0x4073('0x2e')]);_0x2d577e[_0x4073('0x30')]=_[_0x4073('0x32')](_0x2d577e[_0x4073('0x2d')],_0x2d577e[_0x4073('0x2e')]);_0x4d4baf[_0x4073('0x31')]=_[_0x4073('0x32')](_0x2d577e[_0x4073('0x2d')],qs['fields'](_0x288055[_0x4073('0x2e')][_0x4073('0x33')]));_0x4d4baf[_0x4073('0x31')]=_0x4d4baf[_0x4073('0x31')][_0x4073('0x34')]?_0x4d4baf['attributes']:_0x2d577e[_0x4073('0x2d')];if(_0x288055[_0x4073('0x2e')][_0x4073('0x3e')]){_0x4d4baf[_0x4073('0x3f')]=[{'all':!![]}];}_0x4d4baf=_[_0x4073('0x3c')]({},_0x4d4baf,_0x288055['options']);return db[_0x4073('0x29')]['find'](_0x4d4baf)[_0x4073('0x22')](handleEntityNotFound(_0x4d026c,null))[_0x4073('0x22')](respondWithResult(_0x4d026c,null))[_0x4073('0x41')](handleError(_0x4d026c,null));};exports[_0x4073('0x44')]=function(_0x51093e,_0x5a0143){return db['JscriptyAnswerReport'][_0x4073('0x44')](_0x51093e[_0x4073('0x45')],{})[_0x4073('0x22')](respondWithResult(_0x5a0143,0xc9))[_0x4073('0x41')](handleError(_0x5a0143,null));};exports['update']=function(_0x4deee7,_0x49b366){if(_0x4deee7[_0x4073('0x45')]['id']){delete _0x4deee7[_0x4073('0x45')]['id'];}return db[_0x4073('0x29')]['find']({'where':{'id':_0x4deee7[_0x4073('0x43')]['id']}})[_0x4073('0x22')](handleEntityNotFound(_0x49b366,null))[_0x4073('0x22')](saveUpdates(_0x4deee7[_0x4073('0x45')],null))[_0x4073('0x22')](respondWithResult(_0x49b366,null))['catch'](handleError(_0x49b366,null));};exports['destroy']=function(_0x45fd98,_0x104983){return db[_0x4073('0x29')][_0x4073('0x46')]({'where':{'id':_0x45fd98['params']['id']}})[_0x4073('0x22')](handleEntityNotFound(_0x104983,null))[_0x4073('0x22')](removeEntity(_0x104983,null))[_0x4073('0x41')](handleError(_0x104983,null));};exports[_0x4073('0x47')]=function(_0x4ad4ee,_0x58588c){return db['JscriptyAnswerReport'][_0x4073('0x47')]()[_0x4073('0x22')](respondWithResult(_0x58588c,null))[_0x4073('0x41')](handleError(_0x58588c,null));}; \ No newline at end of file +var _0x0fda=['limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','index','map','JscriptyAnswerReport','fieldName','type','key','name','filters','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','rawAttributes','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x1f0b1f,_0x2748d4){var _0xf1ed82=function(_0xde7c35){while(--_0xde7c35){_0x1f0b1f['push'](_0x1f0b1f['shift']());}};_0xf1ed82(++_0x2748d4);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x170fd3,_0x48cc63){_0x170fd3=_0x170fd3-0x0;var _0x5c0937=_0x0fda[_0x170fd3];return _0x5c0937;};'use strict';var emlformat=require(_0xa0fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa0fd('0x1'));var jsonpatch=require(_0xa0fd('0x2'));var rp=require(_0xa0fd('0x3'));var moment=require(_0xa0fd('0x4'));var BPromise=require(_0xa0fd('0x5'));var Mustache=require(_0xa0fd('0x6'));var util=require(_0xa0fd('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa0fd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0fd('0x9'));var squel=require(_0xa0fd('0xa'));var crypto=require(_0xa0fd('0xb'));var jsforce=require(_0xa0fd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa0fd('0x8'));var querystring=require(_0xa0fd('0xd'));var Papa=require(_0xa0fd('0xe'));var Redis=require(_0xa0fd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa0fd('0x10'));var as=require(_0xa0fd('0x11'));var hardwareService=require(_0xa0fd('0x12'));var logger=require('../../config/logger')(_0xa0fd('0x13'));var utils=require(_0xa0fd('0x14'));var config=require(_0xa0fd('0x15'));var licenseUtil=require(_0xa0fd('0x16'));var db=require(_0xa0fd('0x17'))['db'];function respondWithStatusCode(_0x4d5c32,_0x490112){_0x490112=_0x490112||0xcc;return function(_0x32dcee){if(_0x32dcee){return _0x4d5c32[_0xa0fd('0x18')](_0x490112);}return _0x4d5c32['status'](_0x490112)[_0xa0fd('0x19')]();};}function respondWithResult(_0x8a67a5,_0x11e4eb){_0x11e4eb=_0x11e4eb||0xc8;return function(_0x1e4a48){if(_0x1e4a48){return _0x8a67a5[_0xa0fd('0x1a')](_0x11e4eb)[_0xa0fd('0x1b')](_0x1e4a48);}};}function respondWithFilteredResult(_0x2811c0,_0x4fe62c){return function(_0x1c6ffc){if(_0x1c6ffc){var _0x326ba8=typeof _0x4fe62c['offset']==='undefined'&&typeof _0x4fe62c[_0xa0fd('0x1c')]===_0xa0fd('0x1d');var _0x5d2d7b=_0x1c6ffc[_0xa0fd('0x1e')];var _0x22a876=_0x326ba8?0x0:_0x4fe62c[_0xa0fd('0x1f')];var _0x5073a8=_0x326ba8?_0x1c6ffc['count']:_0x4fe62c[_0xa0fd('0x1f')]+_0x4fe62c['limit'];var _0x40e288;if(_0x5073a8>=_0x5d2d7b){_0x5073a8=_0x5d2d7b;_0x40e288=0xc8;}else{_0x40e288=0xce;}_0x2811c0[_0xa0fd('0x1a')](_0x40e288);return _0x2811c0[_0xa0fd('0x20')](_0xa0fd('0x21'),_0x22a876+'-'+_0x5073a8+'/'+_0x5d2d7b)[_0xa0fd('0x1b')](_0x1c6ffc);}return null;};}function patchUpdates(_0x2273f4){return function(_0x113059){try{jsonpatch['apply'](_0x113059,_0x2273f4,!![]);}catch(_0x166934){return BPromise[_0xa0fd('0x22')](_0x166934);}return _0x113059[_0xa0fd('0x23')]();};}function saveUpdates(_0x18eaa8,_0x26e3a4){return function(_0x3af329){if(_0x3af329){return _0x3af329[_0xa0fd('0x24')](_0x18eaa8)[_0xa0fd('0x25')](function(_0xda6f53){return _0xda6f53;});}return null;};}function removeEntity(_0x13fc62,_0x28dbda){return function(_0x310279){if(_0x310279){return _0x310279[_0xa0fd('0x26')]()['then'](function(){_0x13fc62[_0xa0fd('0x1a')](0xcc)[_0xa0fd('0x19')]();});}};}function handleEntityNotFound(_0x541118,_0x197ae5){return function(_0x3cd5b0){if(!_0x3cd5b0){_0x541118['sendStatus'](0x194);}return _0x3cd5b0;};}function handleError(_0x5bb0ee,_0x2e9b0d){_0x2e9b0d=_0x2e9b0d||0x1f4;return function(_0x267899){logger['error'](_0x267899['stack']);if(_0x267899['name']){delete _0x267899['name'];}_0x5bb0ee[_0xa0fd('0x1a')](_0x2e9b0d)['send'](_0x267899);};}exports[_0xa0fd('0x27')]=function(_0x1db300,_0x2f5b0d){var _0x4a307b={},_0x36aaed={},_0x19c352={'count':0x0,'rows':[]};var _0x4feb93=_[_0xa0fd('0x28')](db[_0xa0fd('0x29')]['rawAttributes'],function(_0x366921){return{'name':_0x366921[_0xa0fd('0x2a')],'type':_0x366921[_0xa0fd('0x2b')][_0xa0fd('0x2c')]};});_0x36aaed['model']=_[_0xa0fd('0x28')](_0x4feb93,_0xa0fd('0x2d'));_0x36aaed['query']=_['keys'](_0x1db300['query']);_0x36aaed[_0xa0fd('0x2e')]=_['intersection'](_0x36aaed['model'],_0x36aaed[_0xa0fd('0x2f')]);_0x4a307b['attributes']=_[_0xa0fd('0x30')](_0x36aaed[_0xa0fd('0x31')],qs[_0xa0fd('0x32')](_0x1db300[_0xa0fd('0x2f')][_0xa0fd('0x32')]));_0x4a307b[_0xa0fd('0x33')]=_0x4a307b[_0xa0fd('0x33')][_0xa0fd('0x34')]?_0x4a307b['attributes']:_0x36aaed[_0xa0fd('0x31')];if(!_0x1db300['query'][_0xa0fd('0x35')]('nolimit')){_0x4a307b['limit']=qs[_0xa0fd('0x1c')](_0x1db300['query'][_0xa0fd('0x1c')]);_0x4a307b[_0xa0fd('0x1f')]=qs[_0xa0fd('0x1f')](_0x1db300[_0xa0fd('0x2f')]['offset']);}_0x4a307b[_0xa0fd('0x36')]=qs[_0xa0fd('0x37')](_0x1db300[_0xa0fd('0x2f')][_0xa0fd('0x37')]);_0x4a307b[_0xa0fd('0x38')]=qs[_0xa0fd('0x2e')](_[_0xa0fd('0x39')](_0x1db300['query'],_0x36aaed['filters']),_0x4feb93);if(_0x1db300[_0xa0fd('0x2f')][_0xa0fd('0x3a')]){_0x4a307b[_0xa0fd('0x38')]=_[_0xa0fd('0x3b')](_0x4a307b['where'],{'$or':_[_0xa0fd('0x28')](_0x4feb93,function(_0x3938da){if(_0x3938da[_0xa0fd('0x2b')]!==_0xa0fd('0x3c')){var _0x214094={};_0x214094[_0x3938da['name']]={'$like':'%'+_0x1db300[_0xa0fd('0x2f')][_0xa0fd('0x3a')]+'%'};return _0x214094;}})});}_0x4a307b=_['merge']({},_0x4a307b,_0x1db300['options']);var _0x27082a={'where':_0x4a307b[_0xa0fd('0x38')]};return db[_0xa0fd('0x29')][_0xa0fd('0x1e')](_0x27082a)[_0xa0fd('0x25')](function(_0xbeca16){_0x19c352[_0xa0fd('0x1e')]=_0xbeca16;if(_0x1db300[_0xa0fd('0x2f')][_0xa0fd('0x3d')]){_0x4a307b[_0xa0fd('0x3e')]=[{'all':!![]}];}return db[_0xa0fd('0x29')][_0xa0fd('0x3f')](_0x4a307b);})[_0xa0fd('0x25')](function(_0x466767){_0x19c352[_0xa0fd('0x40')]=_0x466767;return _0x19c352;})['then'](respondWithFilteredResult(_0x2f5b0d,_0x4a307b))['catch'](handleError(_0x2f5b0d,null));};exports['show']=function(_0x241e3e,_0x288a8a){var _0x399eb1={'raw':!![],'where':{'id':_0x241e3e[_0xa0fd('0x41')]['id']}},_0x54fb8c={};_0x54fb8c[_0xa0fd('0x31')]=_[_0xa0fd('0x42')](db['JscriptyAnswerReport'][_0xa0fd('0x43')]);_0x54fb8c[_0xa0fd('0x2f')]=_[_0xa0fd('0x42')](_0x241e3e[_0xa0fd('0x2f')]);_0x54fb8c[_0xa0fd('0x2e')]=_[_0xa0fd('0x30')](_0x54fb8c['model'],_0x54fb8c[_0xa0fd('0x2f')]);_0x399eb1[_0xa0fd('0x33')]=_[_0xa0fd('0x30')](_0x54fb8c[_0xa0fd('0x31')],qs[_0xa0fd('0x32')](_0x241e3e[_0xa0fd('0x2f')]['fields']));_0x399eb1[_0xa0fd('0x33')]=_0x399eb1[_0xa0fd('0x33')][_0xa0fd('0x34')]?_0x399eb1[_0xa0fd('0x33')]:_0x54fb8c[_0xa0fd('0x31')];if(_0x241e3e['query']['includeAll']){_0x399eb1[_0xa0fd('0x3e')]=[{'all':!![]}];}_0x399eb1=_[_0xa0fd('0x3b')]({},_0x399eb1,_0x241e3e[_0xa0fd('0x44')]);return db[_0xa0fd('0x29')][_0xa0fd('0x45')](_0x399eb1)['then'](handleEntityNotFound(_0x288a8a,null))[_0xa0fd('0x25')](respondWithResult(_0x288a8a,null))[_0xa0fd('0x46')](handleError(_0x288a8a,null));};exports[_0xa0fd('0x47')]=function(_0x210a75,_0x93d528){return db[_0xa0fd('0x29')]['create'](_0x210a75['body'],{})['then'](respondWithResult(_0x93d528,0xc9))[_0xa0fd('0x46')](handleError(_0x93d528,null));};exports['update']=function(_0x4e4ce4,_0xcf725e){if(_0x4e4ce4['body']['id']){delete _0x4e4ce4[_0xa0fd('0x48')]['id'];}return db[_0xa0fd('0x29')]['find']({'where':{'id':_0x4e4ce4['params']['id']}})[_0xa0fd('0x25')](handleEntityNotFound(_0xcf725e,null))[_0xa0fd('0x25')](saveUpdates(_0x4e4ce4[_0xa0fd('0x48')],null))[_0xa0fd('0x25')](respondWithResult(_0xcf725e,null))[_0xa0fd('0x46')](handleError(_0xcf725e,null));};exports[_0xa0fd('0x26')]=function(_0x5268ba,_0x5712f2){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x5268ba[_0xa0fd('0x41')]['id']}})[_0xa0fd('0x25')](handleEntityNotFound(_0x5712f2,null))[_0xa0fd('0x25')](removeEntity(_0x5712f2,null))[_0xa0fd('0x46')](handleError(_0x5712f2,null));};exports[_0xa0fd('0x49')]=function(_0x53c1a2,_0x53f51c){return db['JscriptyAnswerReport']['describe']()['then'](respondWithResult(_0x53f51c,null))[_0xa0fd('0x46')](handleError(_0x53f51c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index d3069ff..e1fbcc4 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b97=['../../config/logger','api','bluebird','request-promise','path','rimraf','./jscriptyAnswerReport.attributes','define','report_jscripty_answers','lodash','util'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4b97,0x15e));var _0x74b9=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x4b97[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x74b9('0x0'));var util=require(_0x74b9('0x1'));var logger=require(_0x74b9('0x2'))(_0x74b9('0x3'));var moment=require('moment');var BPromise=require(_0x74b9('0x4'));var rp=require(_0x74b9('0x5'));var fs=require('fs');var path=require(_0x74b9('0x6'));var rimraf=require(_0x74b9('0x7'));var config=require('../../config/environment');var attributes=require(_0x74b9('0x8'));module['exports']=function(_0x441533,_0x849f52){return _0x441533[_0x74b9('0x9')]('JscriptyAnswerReport',attributes,{'tableName':_0x74b9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa878=['request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api','moment','bluebird'];(function(_0x3e0074,_0x4e3476){var _0x88ab2f=function(_0x595955){while(--_0x595955){_0x3e0074['push'](_0x3e0074['shift']());}};_0x88ab2f(++_0x4e3476);}(_0xa878,0x79));var _0x8a87=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa878[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x8a87('0x0'));var logger=require(_0x8a87('0x1'))(_0x8a87('0x2'));var moment=require(_0x8a87('0x3'));var BPromise=require(_0x8a87('0x4'));var rp=require(_0x8a87('0x5'));var fs=require('fs');var path=require(_0x8a87('0x6'));var rimraf=require(_0x8a87('0x7'));var config=require(_0x8a87('0x8'));var attributes=require(_0x8a87('0x9'));module[_0x8a87('0xa')]=function(_0x47ec2,_0x4c4b38){return _0x47ec2[_0x8a87('0xb')](_0x8a87('0xc'),attributes,{'tableName':_0x8a87('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 8221fe2..3075984 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f02=['jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x6f02,0x92));var _0x26f0=function(_0x523973,_0x69c009){_0x523973=_0x523973-0x0;var _0x546838=_0x6f02[_0x523973];return _0x546838;};'use strict';var _=require('lodash');var util=require(_0x26f0('0x0'));var moment=require(_0x26f0('0x1'));var BPromise=require(_0x26f0('0x2'));var rs=require(_0x26f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26f0('0x4'))['db'];var utils=require(_0x26f0('0x5'));var logger=require('../../config/logger')(_0x26f0('0x6'));var config=require(_0x26f0('0x7'));var jayson=require(_0x26f0('0x8'));var client=jayson[_0x26f0('0x9')][_0x26f0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x209297,_0x321732,_0x2e6f61){return new BPromise(function(_0x162fb1,_0xc95b8e){return client[_0x26f0('0xb')](_0x209297,_0x2e6f61)[_0x26f0('0xc')](function(_0x316955){logger[_0x26f0('0xd')](_0x26f0('0xe'),_0x321732,'request\x20sent');logger[_0x26f0('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x321732,_0x26f0('0x10'),JSON[_0x26f0('0x11')](_0x316955));if(_0x316955[_0x26f0('0x12')]){if(_0x316955[_0x26f0('0x12')][_0x26f0('0x13')]===0x1f4){logger[_0x26f0('0x12')](_0x26f0('0xe'),_0x321732,_0x316955[_0x26f0('0x12')]['message']);return _0xc95b8e(_0x316955[_0x26f0('0x12')]['message']);}logger[_0x26f0('0x12')](_0x26f0('0xe'),_0x321732,_0x316955[_0x26f0('0x12')][_0x26f0('0x14')]);return _0x162fb1(_0x316955[_0x26f0('0x12')][_0x26f0('0x14')]);}else{logger['info'](_0x26f0('0xe'),_0x321732,_0x26f0('0x10'));_0x162fb1(_0x316955[_0x26f0('0x15')]['message']);}})['catch'](function(_0x3e3194){logger['error'](_0x26f0('0xe'),_0x321732,_0x3e3194);_0xc95b8e(_0x3e3194);});});} \ No newline at end of file +var _0x670d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x3de87a,_0x3be11d){var _0x288ce3=function(_0x52114b){while(--_0x52114b){_0x3de87a['push'](_0x3de87a['shift']());}};_0x288ce3(++_0x3be11d);}(_0x670d,0x166));var _0xd670=function(_0x48f06c,_0x43536d){_0x48f06c=_0x48f06c-0x0;var _0x1baa84=_0x670d[_0x48f06c];return _0x1baa84;};'use strict';var _=require(_0xd670('0x0'));var util=require(_0xd670('0x1'));var moment=require(_0xd670('0x2'));var BPromise=require(_0xd670('0x3'));var rs=require(_0xd670('0x4'));var fs=require('fs');var Redis=require(_0xd670('0x5'));var db=require(_0xd670('0x6'))['db'];var utils=require(_0xd670('0x7'));var logger=require(_0xd670('0x8'))(_0xd670('0x9'));var config=require(_0xd670('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xd670('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a8b16,_0x579705,_0x3a3dce){return new BPromise(function(_0x5e10f8,_0x44f970){return client[_0xd670('0xc')](_0x3a8b16,_0x3a3dce)[_0xd670('0xd')](function(_0x39d99a){logger[_0xd670('0xe')](_0xd670('0xf'),_0x579705,_0xd670('0x10'));logger[_0xd670('0x11')](_0xd670('0x12'),_0x579705,_0xd670('0x10'),JSON[_0xd670('0x13')](_0x39d99a));if(_0x39d99a[_0xd670('0x14')]){if(_0x39d99a[_0xd670('0x14')]['code']===0x1f4){logger[_0xd670('0x14')](_0xd670('0xf'),_0x579705,_0x39d99a['error']['message']);return _0x44f970(_0x39d99a['error']['message']);}logger[_0xd670('0x14')](_0xd670('0xf'),_0x579705,_0x39d99a[_0xd670('0x14')][_0xd670('0x15')]);return _0x5e10f8(_0x39d99a[_0xd670('0x14')][_0xd670('0x15')]);}else{logger['info'](_0xd670('0xf'),_0x579705,_0xd670('0x10'));_0x5e10f8(_0x39d99a[_0xd670('0x16')][_0xd670('0x15')]);}})[_0xd670('0x17')](function(_0x367bf6){logger[_0xd670('0x14')](_0xd670('0xf'),_0x579705,_0x367bf6);_0x44f970(_0x367bf6);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index a8a2382..d249b7f 100644 --- a/server/api/jscriptyProject/index.js +++ b/server/api/jscriptyProject/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4bc=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./jscriptyProject.controller','isAuthenticated','get','/:id','show','/:id/sessions','getSessions','/:id/answers','/:id/summary','post','create','/:id/clone','clone','put','update','delete','destroy','exports','multer','util'];(function(_0x61afed,_0x3210ce){var _0x371ba2=function(_0x1fb4d4){while(--_0x1fb4d4){_0x61afed['push'](_0x61afed['shift']());}};_0x371ba2(++_0x3210ce);}(_0xf4bc,0xad));var _0xcf4b=function(_0x2d648c,_0x29282a){_0x2d648c=_0x2d648c-0x0;var _0x8d2edb=_0xf4bc[_0x2d648c];return _0x8d2edb;};'use strict';var multer=require(_0xcf4b('0x0'));var util=require(_0xcf4b('0x1'));var path=require('path');var timeout=require(_0xcf4b('0x2'));var express=require(_0xcf4b('0x3'));var router=express[_0xcf4b('0x4')]();var fs_extra=require(_0xcf4b('0x5'));var auth=require(_0xcf4b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcf4b('0x7'));router['get']('/',auth[_0xcf4b('0x8')](),controller['index']);router[_0xcf4b('0x9')](_0xcf4b('0xa'),auth[_0xcf4b('0x8')](),controller[_0xcf4b('0xb')]);router[_0xcf4b('0x9')](_0xcf4b('0xc'),auth[_0xcf4b('0x8')](),controller[_0xcf4b('0xd')]);router['get'](_0xcf4b('0xe'),auth[_0xcf4b('0x8')](),controller['getAnswers']);router[_0xcf4b('0x9')](_0xcf4b('0xf'),auth[_0xcf4b('0x8')](),timeout('30s'),controller['getSummary']);router[_0xcf4b('0x10')]('/',auth[_0xcf4b('0x8')](),controller[_0xcf4b('0x11')]);router['post'](_0xcf4b('0x12'),auth[_0xcf4b('0x8')](),controller[_0xcf4b('0x13')]);router[_0xcf4b('0x14')]('/:id',auth[_0xcf4b('0x8')](),controller[_0xcf4b('0x15')]);router[_0xcf4b('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xcf4b('0x17')]);module[_0xcf4b('0x18')]=router; \ No newline at end of file +var _0x9e0f=['show','/:id/sessions','getSessions','/:id/answers','getAnswers','post','create','/:id/clone','clone','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','index','/:id'];(function(_0x4eaf54,_0x5dca5b){var _0x24d2a7=function(_0x2637c9){while(--_0x2637c9){_0x4eaf54['push'](_0x4eaf54['shift']());}};_0x24d2a7(++_0x5dca5b);}(_0x9e0f,0x84));var _0xf9e0=function(_0x210775,_0x29d4fe){_0x210775=_0x210775-0x0;var _0xbbffde=_0x9e0f[_0x210775];return _0xbbffde;};'use strict';var multer=require('multer');var util=require(_0xf9e0('0x0'));var path=require(_0xf9e0('0x1'));var timeout=require(_0xf9e0('0x2'));var express=require(_0xf9e0('0x3'));var router=express[_0xf9e0('0x4')]();var fs_extra=require(_0xf9e0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf9e0('0x6'));var config=require('../../config/environment');var controller=require(_0xf9e0('0x7'));router[_0xf9e0('0x8')]('/',auth[_0xf9e0('0x9')](),controller[_0xf9e0('0xa')]);router[_0xf9e0('0x8')](_0xf9e0('0xb'),auth[_0xf9e0('0x9')](),controller[_0xf9e0('0xc')]);router[_0xf9e0('0x8')](_0xf9e0('0xd'),auth[_0xf9e0('0x9')](),controller[_0xf9e0('0xe')]);router[_0xf9e0('0x8')](_0xf9e0('0xf'),auth[_0xf9e0('0x9')](),controller[_0xf9e0('0x10')]);router[_0xf9e0('0x8')]('/:id/summary',auth[_0xf9e0('0x9')](),timeout('30s'),controller['getSummary']);router[_0xf9e0('0x11')]('/',auth[_0xf9e0('0x9')](),controller[_0xf9e0('0x12')]);router[_0xf9e0('0x11')](_0xf9e0('0x13'),auth[_0xf9e0('0x9')](),controller[_0xf9e0('0x14')]);router['put'](_0xf9e0('0xb'),auth[_0xf9e0('0x9')](),controller['update']);router[_0xf9e0('0x15')](_0xf9e0('0xb'),auth[_0xf9e0('0x9')](),controller[_0xf9e0('0x16')]);module[_0xf9e0('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 827ed83..412c5c5 100644 --- a/server/api/jscriptyProject/jscriptyProject.attributes.js +++ b/server/api/jscriptyProject/jscriptyProject.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bbd=['getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','formData','isString','setDataValue','format'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x9bbd,0x1b5));var _0xd9bb=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9bbd[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0xd9bb('0x0'));var _=require(_0xd9bb('0x1'));var util=require(_0xd9bb('0x2'));module[_0xd9bb('0x3')]={'name':{'type':Sequelize[_0xd9bb('0x4')],'unique':_0xd9bb('0x5')},'description':{'type':Sequelize[_0xd9bb('0x4')]},'formData':{'type':Sequelize[_0xd9bb('0x6')]('long'),'set':function(_0x281958){if(_['isObjectLike'](_0x281958)){this['setDataValue'](_0xd9bb('0x7'),JSON['stringify'](_0x281958));}else if(_[_0xd9bb('0x8')](_0x281958)){this[_0xd9bb('0x9')](_0xd9bb('0x7'),_0x281958);}else{this[_0xd9bb('0x9')]('formData',util[_0xd9bb('0xa')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue']('name')||'',this[_0xd9bb('0xb')](_0xd9bb('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xd9bb('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x272a=['BOOLEAN','lodash','util','STRING','name','TEXT','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x272a,0x7f));var _0xa272=function(_0x54c51e,_0x2a7547){_0x54c51e=_0x54c51e-0x0;var _0x527506=_0x272a[_0x54c51e];return _0x527506;};'use strict';var Sequelize=require('sequelize');var _=require(_0xa272('0x0'));var util=require(_0xa272('0x1'));module['exports']={'name':{'type':Sequelize[_0xa272('0x2')],'unique':_0xa272('0x3')},'description':{'type':Sequelize[_0xa272('0x2')]},'formData':{'type':Sequelize[_0xa272('0x4')]('long'),'set':function(_0x55a29b){if(_['isObjectLike'](_0x55a29b)){this['setDataValue'](_0xa272('0x5'),JSON[_0xa272('0x6')](_0x55a29b));}else if(_[_0xa272('0x7')](_0x55a29b)){this[_0xa272('0x8')](_0xa272('0x5'),_0x55a29b);}else{this[_0xa272('0x8')](_0xa272('0x5'),util[_0xa272('0x9')](_0xa272('0xa'),this[_0xa272('0xb')](_0xa272('0x3'))||'',this[_0xa272('0xb')](_0xa272('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xa272('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xa272('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index b3d1629..1f3cbdd 100644 --- a/server/api/jscriptyProject/jscriptyProject.controller.js +++ b/server/api/jscriptyProject/jscriptyProject.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98b7=['query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','show','rawAttributes','length','includeAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','include','omit','updatedAt','UserProfileSection','getSessions','findOne','JscriptySessionReport','getAnswers','JscriptyAnswerReport','ProjectId','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','Projects','UserProfileResource','error','stack','name','index','map','JscriptyProject','fieldName','type','key','model'];(function(_0x57869f,_0xc43df4){var _0x4fa1bc=function(_0xb5d076){while(--_0xb5d076){_0x57869f['push'](_0x57869f['shift']());}};_0x4fa1bc(++_0xc43df4);}(_0x98b7,0xc1));var _0x798b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x98b7[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x798b('0x0'));var rimraf=require(_0x798b('0x1'));var zipdir=require(_0x798b('0x2'));var jsonpatch=require(_0x798b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x798b('0x4'));var util=require(_0x798b('0x5'));var path=require(_0x798b('0x6'));var sox=require(_0x798b('0x7'));var csv=require(_0x798b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x798b('0x9'));var _=require('lodash');var squel=require(_0x798b('0xa'));var crypto=require(_0x798b('0xb'));var jsforce=require(_0x798b('0xc'));var deskjs=require(_0x798b('0xd'));var toCsv=require(_0x798b('0x8'));var querystring=require('querystring');var Papa=require(_0x798b('0xe'));var Redis=require('ioredis');var authService=require(_0x798b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x798b('0x10'));var hardwareService=require(_0x798b('0x11'));var logger=require(_0x798b('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x798b('0x13'));var licenseUtil=require(_0x798b('0x14'));var db=require(_0x798b('0x15'))['db'];function respondWithStatusCode(_0x5455a7,_0x18057f){_0x18057f=_0x18057f||0xcc;return function(_0x53b5f1){if(_0x53b5f1){return _0x5455a7[_0x798b('0x16')](_0x18057f);}return _0x5455a7['status'](_0x18057f)[_0x798b('0x17')]();};}function respondWithResult(_0x2aacd7,_0x33cf2e){_0x33cf2e=_0x33cf2e||0xc8;return function(_0x213973){if(_0x213973){return _0x2aacd7[_0x798b('0x18')](_0x33cf2e)[_0x798b('0x19')](_0x213973);}};}function respondWithFilteredResult(_0x36425f,_0x5936fd){return function(_0x511dd3){if(_0x511dd3){var _0x1039fe=typeof _0x5936fd[_0x798b('0x1a')]===_0x798b('0x1b')&&typeof _0x5936fd[_0x798b('0x1c')]===_0x798b('0x1b');var _0x46c7c5=_0x511dd3[_0x798b('0x1d')];var _0x2fa3f6=_0x1039fe?0x0:_0x5936fd[_0x798b('0x1a')];var _0x1af73a=_0x1039fe?_0x511dd3[_0x798b('0x1d')]:_0x5936fd[_0x798b('0x1a')]+_0x5936fd[_0x798b('0x1c')];var _0x327312;if(_0x1af73a>=_0x46c7c5){_0x1af73a=_0x46c7c5;_0x327312=0xc8;}else{_0x327312=0xce;}_0x36425f[_0x798b('0x18')](_0x327312);return _0x36425f['set'](_0x798b('0x1e'),_0x2fa3f6+'-'+_0x1af73a+'/'+_0x46c7c5)[_0x798b('0x19')](_0x511dd3);}return null;};}function patchUpdates(_0x2c36d5){return function(_0x2cb76e){try{jsonpatch[_0x798b('0x1f')](_0x2cb76e,_0x2c36d5,!![]);}catch(_0x2cb7a5){return BPromise[_0x798b('0x20')](_0x2cb7a5);}return _0x2cb76e[_0x798b('0x21')]();};}function saveUpdates(_0x4c1817,_0x2de542){return function(_0x3babb5){if(_0x3babb5){return _0x3babb5[_0x798b('0x22')](_0x4c1817)[_0x798b('0x23')](function(_0x50f66c){return _0x50f66c;});}return null;};}function removeEntity(_0x397092,_0x32c926){return function(_0x36920a){if(_0x36920a){return _0x36920a[_0x798b('0x24')]()['then'](function(){var _0x325c3d=_0x36920a['get']({'plain':!![]});var _0x202398=_0x798b('0x25');return db[_0x798b('0x26')]['destroy']({'where':{'type':_0x202398,'resourceId':_0x325c3d['id']}})[_0x798b('0x23')](function(){return _0x36920a;});})[_0x798b('0x23')](function(){_0x397092[_0x798b('0x18')](0xcc)[_0x798b('0x17')]();});}};}function handleEntityNotFound(_0x2aa507,_0x251d8f){return function(_0x186f26){if(!_0x186f26){_0x2aa507['sendStatus'](0x194);}return _0x186f26;};}function handleError(_0x63c6ed,_0x5a7266){_0x5a7266=_0x5a7266||0x1f4;return function(_0x2ad7b8){logger[_0x798b('0x27')](_0x2ad7b8[_0x798b('0x28')]);if(_0x2ad7b8[_0x798b('0x29')]){delete _0x2ad7b8[_0x798b('0x29')];}_0x63c6ed['status'](_0x5a7266)['send'](_0x2ad7b8);};}exports[_0x798b('0x2a')]=function(_0x40b229,_0x228c44){var _0x1194e6={},_0x5832cc={},_0x27a40d={'count':0x0,'rows':[]};var _0x2c562b=_[_0x798b('0x2b')](db[_0x798b('0x2c')]['rawAttributes'],function(_0x1661e9){return{'name':_0x1661e9[_0x798b('0x2d')],'type':_0x1661e9[_0x798b('0x2e')][_0x798b('0x2f')]};});_0x5832cc[_0x798b('0x30')]=_[_0x798b('0x2b')](_0x2c562b,_0x798b('0x29'));_0x5832cc[_0x798b('0x31')]=_[_0x798b('0x32')](_0x40b229['query']);_0x5832cc[_0x798b('0x33')]=_[_0x798b('0x34')](_0x5832cc[_0x798b('0x30')],_0x5832cc[_0x798b('0x31')]);_0x1194e6['attributes']=_['intersection'](_0x5832cc[_0x798b('0x30')],qs[_0x798b('0x35')](_0x40b229[_0x798b('0x31')][_0x798b('0x35')]));_0x1194e6[_0x798b('0x36')]=_0x1194e6['attributes']['length']?_0x1194e6[_0x798b('0x36')]:_0x5832cc[_0x798b('0x30')];if(!_0x40b229[_0x798b('0x31')][_0x798b('0x37')](_0x798b('0x38'))){_0x1194e6[_0x798b('0x1c')]=qs[_0x798b('0x1c')](_0x40b229[_0x798b('0x31')][_0x798b('0x1c')]);_0x1194e6[_0x798b('0x1a')]=qs[_0x798b('0x1a')](_0x40b229[_0x798b('0x31')][_0x798b('0x1a')]);}_0x1194e6[_0x798b('0x39')]=qs[_0x798b('0x3a')](_0x40b229[_0x798b('0x31')][_0x798b('0x3a')]);_0x1194e6[_0x798b('0x3b')]=qs[_0x798b('0x33')](_[_0x798b('0x3c')](_0x40b229[_0x798b('0x31')],_0x5832cc[_0x798b('0x33')]),_0x2c562b);if(_0x40b229[_0x798b('0x31')][_0x798b('0x3d')]){_0x1194e6[_0x798b('0x3b')]=_[_0x798b('0x3e')](_0x1194e6[_0x798b('0x3b')],{'$or':_[_0x798b('0x2b')](_0x2c562b,function(_0xb63d9c){if(_0xb63d9c[_0x798b('0x2e')]!==_0x798b('0x3f')){var _0x1c34ef={};_0x1c34ef[_0xb63d9c[_0x798b('0x29')]]={'$like':'%'+_0x40b229['query'][_0x798b('0x3d')]+'%'};return _0x1c34ef;}})});}_0x1194e6=_[_0x798b('0x3e')]({},_0x1194e6,_0x40b229['options']);var _0x79daaa={'where':_0x1194e6[_0x798b('0x3b')]};return db[_0x798b('0x2c')]['count'](_0x79daaa)[_0x798b('0x23')](function(_0x2e6148){_0x27a40d[_0x798b('0x1d')]=_0x2e6148;if(_0x40b229[_0x798b('0x31')]['includeAll']){_0x1194e6['include']=[{'all':!![]}];}return db['JscriptyProject'][_0x798b('0x40')](_0x1194e6);})[_0x798b('0x23')](function(_0xdaaf91){_0x27a40d[_0x798b('0x41')]=_0xdaaf91;return _0x27a40d;})['then'](respondWithFilteredResult(_0x228c44,_0x1194e6))['catch'](handleError(_0x228c44,null));};exports[_0x798b('0x42')]=function(_0x4446bd,_0x113d57){var _0x51aa3f={'raw':![],'where':{'id':_0x4446bd['params']['id']}},_0x337c33={};_0x337c33['model']=_['keys'](db[_0x798b('0x2c')][_0x798b('0x43')]);_0x337c33[_0x798b('0x31')]=_['keys'](_0x4446bd[_0x798b('0x31')]);_0x337c33['filters']=_['intersection'](_0x337c33['model'],_0x337c33[_0x798b('0x31')]);_0x51aa3f[_0x798b('0x36')]=_['intersection'](_0x337c33[_0x798b('0x30')],qs[_0x798b('0x35')](_0x4446bd['query'][_0x798b('0x35')]));_0x51aa3f[_0x798b('0x36')]=_0x51aa3f[_0x798b('0x36')][_0x798b('0x44')]?_0x51aa3f['attributes']:_0x337c33[_0x798b('0x30')];if(_0x4446bd[_0x798b('0x31')][_0x798b('0x45')]){_0x51aa3f['include']=[{'all':!![]}];}_0x51aa3f=_[_0x798b('0x3e')]({},_0x51aa3f,_0x4446bd[_0x798b('0x46')]);return db[_0x798b('0x2c')][_0x798b('0x47')](_0x51aa3f)[_0x798b('0x23')](handleEntityNotFound(_0x113d57,null))[_0x798b('0x23')](respondWithResult(_0x113d57,null))[_0x798b('0x48')](handleError(_0x113d57,null));};exports[_0x798b('0x49')]=function(_0x457b60,_0x44007c){return db[_0x798b('0x2c')][_0x798b('0x49')](_0x457b60[_0x798b('0x4a')],{})['then'](function(_0x3451b4){var _0x4b6798=_0x457b60[_0x798b('0x4b')]['get']({'plain':!![]});if(!_0x4b6798)throw new Error(_0x798b('0x4c'));if(_0x4b6798[_0x798b('0x4d')]===_0x798b('0x4b')){var _0x47732f=_0x3451b4[_0x798b('0x4e')]({'plain':!![]});var _0x2c5ba5=_0x798b('0x25');return db['UserProfileSection'][_0x798b('0x47')]({'where':{'name':_0x2c5ba5,'userProfileId':_0x4b6798[_0x798b('0x4f')]},'raw':!![]})[_0x798b('0x23')](function(_0x5dbdd8){if(_0x5dbdd8&&_0x5dbdd8[_0x798b('0x50')]===0x0){return db['UserProfileResource'][_0x798b('0x49')]({'name':_0x47732f[_0x798b('0x29')],'resourceId':_0x47732f['id'],'type':_0x5dbdd8[_0x798b('0x29')],'sectionId':_0x5dbdd8['id']},{})[_0x798b('0x23')](function(){return _0x3451b4;});}else{return _0x3451b4;}})[_0x798b('0x48')](function(_0x45d178){logger[_0x798b('0x27')](_0x798b('0x51'),_0x45d178);throw _0x45d178;});}return _0x3451b4;})[_0x798b('0x23')](respondWithResult(_0x44007c,0xc9))[_0x798b('0x48')](handleError(_0x44007c,null));};exports[_0x798b('0x52')]=function(_0x3ba997,_0x38b576){var _0x16a7d7={'where':{'id':_0x3ba997[_0x798b('0x53')]['id']}},_0x577429={};_0x577429[_0x798b('0x30')]=_[_0x798b('0x32')](db[_0x798b('0x2c')][_0x798b('0x43')]);_0x16a7d7['attributes']=_[_0x798b('0x34')](_0x577429[_0x798b('0x30')],qs['fields'](_0x3ba997[_0x798b('0x31')]['fields']));_0x16a7d7[_0x798b('0x36')]=_0x16a7d7['attributes'][_0x798b('0x44')]?_0x16a7d7[_0x798b('0x36')]:_0x577429[_0x798b('0x30')];if(_0x3ba997[_0x798b('0x31')][_0x798b('0x45')]){_0x16a7d7[_0x798b('0x54')]=[{'all':!![]}];}_0x16a7d7=_[_0x798b('0x3e')]({},_0x16a7d7,_0x3ba997[_0x798b('0x46')]);return db['JscriptyProject'][_0x798b('0x47')](_0x16a7d7)['then'](handleEntityNotFound(_0x38b576,null))[_0x798b('0x23')](function(_0x2c49fe){if(_0x2c49fe){var _0x1f7e69=_0x2c49fe[_0x798b('0x4e')]({'plain':!![]});_0x1f7e69=qs[_0x798b('0x55')](_0x1f7e69,['id','createdAt',_0x798b('0x56')]);_0x3ba997['body']=_[_0x798b('0x55')](_0x3ba997[_0x798b('0x4a')],['id','createdAt','updatedAt']);return db[_0x798b('0x2c')]['create'](_[_0x798b('0x3e')](_0x1f7e69,_0x3ba997[_0x798b('0x4a')]),{'include':_0x3ba997[_0x798b('0x31')]['includeAll']?[{'all':!![]}]:undefined})[_0x798b('0x23')](function(_0x53ad6d){var _0x2ec2a6=_0x3ba997[_0x798b('0x4b')][_0x798b('0x4e')]({'plain':!![]});if(!_0x2ec2a6)throw new Error(_0x798b('0x4c'));if(_0x2ec2a6['role']===_0x798b('0x4b')){var _0x1ca33a=_0x53ad6d[_0x798b('0x4e')]({'plain':!![]});var _0x44a4a5='Projects';return db[_0x798b('0x57')][_0x798b('0x47')]({'where':{'name':_0x44a4a5,'userProfileId':_0x2ec2a6[_0x798b('0x4f')]},'raw':!![]})[_0x798b('0x23')](function(_0xadcf7c){if(_0xadcf7c&&_0xadcf7c[_0x798b('0x50')]===0x0){return db['UserProfileResource'][_0x798b('0x49')]({'name':_0x1ca33a[_0x798b('0x29')],'resourceId':_0x1ca33a['id'],'type':_0xadcf7c[_0x798b('0x29')],'sectionId':_0xadcf7c['id']},{})[_0x798b('0x23')](function(){return _0x53ad6d;});}else{return _0x53ad6d;}})[_0x798b('0x48')](function(_0x5b4986){logger[_0x798b('0x27')](_0x798b('0x51'),_0x5b4986);throw _0x5b4986;});}return _0x53ad6d;});}})[_0x798b('0x23')](respondWithResult(_0x38b576,0xc9))[_0x798b('0x48')](handleError(_0x38b576,null));};exports[_0x798b('0x22')]=function(_0x324308,_0x5d3559){if(_0x324308[_0x798b('0x4a')]['id']){delete _0x324308[_0x798b('0x4a')]['id'];}return db[_0x798b('0x2c')][_0x798b('0x47')]({'where':{'id':_0x324308['params']['id']}})[_0x798b('0x23')](handleEntityNotFound(_0x5d3559,null))[_0x798b('0x23')](saveUpdates(_0x324308['body'],null))[_0x798b('0x23')](respondWithResult(_0x5d3559,null))[_0x798b('0x48')](handleError(_0x5d3559,null));};exports[_0x798b('0x24')]=function(_0x1a95ef,_0xa422c){return db['JscriptyProject'][_0x798b('0x47')]({'where':{'id':_0x1a95ef[_0x798b('0x53')]['id']}})[_0x798b('0x23')](handleEntityNotFound(_0xa422c,null))['then'](removeEntity(_0xa422c,null))[_0x798b('0x48')](handleError(_0xa422c,null));};exports[_0x798b('0x58')]=function(_0x272a76,_0x100509,_0x57a8a1){var _0xcf57f={'raw':!![],'where':{}};var _0x5057fc={};var _0x140aa4={'count':0x0,'rows':[]};return db[_0x798b('0x2c')][_0x798b('0x59')]({'where':{'id':_0x272a76[_0x798b('0x53')]['id']}})[_0x798b('0x23')](handleEntityNotFound(_0x100509,null))['then'](function(_0x411bce){if(_0x411bce){_0x5057fc[_0x798b('0x30')]=_['keys'](db[_0x798b('0x5a')][_0x798b('0x43')]);_0x5057fc[_0x798b('0x31')]=_[_0x798b('0x32')](_0x272a76['query']);_0x5057fc[_0x798b('0x33')]=_[_0x798b('0x34')](_0x5057fc[_0x798b('0x30')],_0x5057fc['query']);_0xcf57f['attributes']=_['intersection'](_0x5057fc[_0x798b('0x30')],qs['fields'](_0x272a76['query'][_0x798b('0x35')]));_0xcf57f[_0x798b('0x36')]=_0xcf57f[_0x798b('0x36')][_0x798b('0x44')]?_0xcf57f[_0x798b('0x36')]:_0x5057fc['model'];if(!_0x272a76[_0x798b('0x31')][_0x798b('0x37')](_0x798b('0x38'))){_0xcf57f[_0x798b('0x1c')]=qs[_0x798b('0x1c')](_0x272a76[_0x798b('0x31')][_0x798b('0x1c')]);_0xcf57f[_0x798b('0x1a')]=qs[_0x798b('0x1a')](_0x272a76['query'][_0x798b('0x1a')]);}_0xcf57f[_0x798b('0x39')]=qs[_0x798b('0x3a')](_0x272a76[_0x798b('0x31')][_0x798b('0x3a')]);_0xcf57f[_0x798b('0x3b')]=qs[_0x798b('0x33')](_['pick'](_0x272a76[_0x798b('0x31')],_0x5057fc[_0x798b('0x33')]));_0xcf57f[_0x798b('0x3b')]['ProjectId']=_0x411bce['id'];if(_0x272a76[_0x798b('0x31')][_0x798b('0x3d')]){_0xcf57f['where']=_[_0x798b('0x3e')](_0xcf57f['where'],{'$or':_[_0x798b('0x2b')](_0xcf57f[_0x798b('0x36')],function(_0x5e191f){var _0x4c86d8={};_0x4c86d8[_0x5e191f]={'$like':'%'+_0x272a76['query'][_0x798b('0x3d')]+'%'};return _0x4c86d8;})});}_0xcf57f=_[_0x798b('0x3e')]({},_0xcf57f,_0x272a76[_0x798b('0x46')]);return db[_0x798b('0x5a')][_0x798b('0x1d')]({'where':_0xcf57f[_0x798b('0x3b')]})[_0x798b('0x23')](function(_0x754404){_0x140aa4[_0x798b('0x1d')]=_0x754404;if(_0x272a76['query']['includeAll']){_0xcf57f[_0x798b('0x54')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x798b('0x40')](_0xcf57f);})[_0x798b('0x23')](function(_0x136595){_0x140aa4['rows']=_0x136595;return _0x140aa4;});}})[_0x798b('0x23')](respondWithFilteredResult(_0x100509,_0xcf57f))[_0x798b('0x48')](handleError(_0x100509,null));};exports[_0x798b('0x5b')]=function(_0x4b8752,_0x54d32e,_0x2f19da){var _0x1cf156={'raw':!![],'where':{}};var _0x437fbb={};var _0xb6abe5={'count':0x0,'rows':[]};return db[_0x798b('0x2c')][_0x798b('0x59')]({'where':{'id':_0x4b8752[_0x798b('0x53')]['id']}})[_0x798b('0x23')](handleEntityNotFound(_0x54d32e,null))['then'](function(_0x3ec70c){if(_0x3ec70c){_0x437fbb[_0x798b('0x30')]=_[_0x798b('0x32')](db[_0x798b('0x5c')][_0x798b('0x43')]);_0x437fbb['query']=_[_0x798b('0x32')](_0x4b8752['query']);_0x437fbb[_0x798b('0x33')]=_[_0x798b('0x34')](_0x437fbb[_0x798b('0x30')],_0x437fbb[_0x798b('0x31')]);_0x1cf156[_0x798b('0x36')]=_[_0x798b('0x34')](_0x437fbb['model'],qs[_0x798b('0x35')](_0x4b8752[_0x798b('0x31')]['fields']));_0x1cf156['attributes']=_0x1cf156['attributes'][_0x798b('0x44')]?_0x1cf156[_0x798b('0x36')]:_0x437fbb[_0x798b('0x30')];if(!_0x4b8752[_0x798b('0x31')][_0x798b('0x37')](_0x798b('0x38'))){_0x1cf156['limit']=qs[_0x798b('0x1c')](_0x4b8752['query'][_0x798b('0x1c')]);_0x1cf156[_0x798b('0x1a')]=qs['offset'](_0x4b8752[_0x798b('0x31')][_0x798b('0x1a')]);}_0x1cf156[_0x798b('0x39')]=qs[_0x798b('0x3a')](_0x4b8752[_0x798b('0x31')][_0x798b('0x3a')]);_0x1cf156[_0x798b('0x3b')]=qs[_0x798b('0x33')](_[_0x798b('0x3c')](_0x4b8752[_0x798b('0x31')],_0x437fbb[_0x798b('0x33')]));_0x1cf156[_0x798b('0x3b')][_0x798b('0x5d')]=_0x3ec70c['id'];if(_0x4b8752['query']['filter']){_0x1cf156[_0x798b('0x3b')]=_[_0x798b('0x3e')](_0x1cf156['where'],{'$or':_[_0x798b('0x2b')](_0x1cf156[_0x798b('0x36')],function(_0x3948af){var _0x3d4507={};_0x3d4507[_0x3948af]={'$like':'%'+_0x4b8752[_0x798b('0x31')][_0x798b('0x3d')]+'%'};return _0x3d4507;})});}_0x1cf156=_[_0x798b('0x3e')]({},_0x1cf156,_0x4b8752['options']);return db[_0x798b('0x5c')][_0x798b('0x1d')]({'where':_0x1cf156['where']})[_0x798b('0x23')](function(_0x33d0f2){_0xb6abe5[_0x798b('0x1d')]=_0x33d0f2;if(_0x4b8752['query'][_0x798b('0x45')]){_0x1cf156[_0x798b('0x54')]=[{'all':!![]}];}return db[_0x798b('0x5c')][_0x798b('0x40')](_0x1cf156);})['then'](function(_0x3826e6){_0xb6abe5['rows']=_0x3826e6;return _0xb6abe5;});}})['then'](respondWithFilteredResult(_0x54d32e,_0x1cf156))[_0x798b('0x48')](handleError(_0x54d32e,null));};function char(_0x32e9b9){return _0x798b('0x5e')===typeof _0x32e9b9?String[_0x798b('0x5f')][_0x798b('0x1f')](null,arguments):_0x32e9b9;}function needsEncapsulation(_0x4e3f1){return!!_0x4e3f1&&(_0x4e3f1[_0x798b('0x60')]()[_0x798b('0x61')](char(0xd))>=0x0||_0x4e3f1[_0x798b('0x60')]()['indexOf'](char(0xa))>=0x0||_0x4e3f1[_0x798b('0x60')]()[_0x798b('0x61')](char(0x2c))>=0x0||_0x4e3f1[_0x798b('0x60')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x4494cb){var _0x381c26=char(0x22),_0x344404='\x5c'+char(0x22),_0x19efc3=_0x4494cb[_0x798b('0x60')]()[_0x798b('0x62')](new RegExp(_0x381c26,'g'),_0x344404);return _0x381c26+_0x19efc3+_0x381c26;}exports[_0x798b('0x63')]=function(_0x12feca,_0x102490,_0x4fd5e9){var _0x51a08a,_0x57d60b;var _0x25d7f8={'where':{'ProjectId':_0x12feca[_0x798b('0x53')]['id']}};if(_0x12feca[_0x798b('0x31')][_0x798b('0x64')]){_0x25d7f8[_0x798b('0x3b')]['starttime']=JSON[_0x798b('0x65')](_0x12feca[_0x798b('0x31')][_0x798b('0x64')]);}return db[_0x798b('0x5a')]['findAll'](_0x25d7f8)[_0x798b('0x23')](handleEntityNotFound(_0x102490,null))[_0x798b('0x23')](function(_0x4cfe9f){if(_0x4cfe9f){_0x51a08a=_0x4cfe9f;return db[_0x798b('0x66')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0x51a08a,'id')},'ProjectId':_0x12feca[_0x798b('0x53')]['id']},'order':_0x798b('0x67')});}})[_0x798b('0x23')](handleEntityNotFound(_0x102490,null))[_0x798b('0x23')](function(_0x53b0a1){if(_0x53b0a1){_0x57d60b=_0x53b0a1;var _0x5e96e4={};for(var _0x23e8c0=0x0,_0x566e55=_0x57d60b[_0x798b('0x44')];_0x23e8c0<_0x566e55;_0x23e8c0++){if(!_0x5e96e4[_0x798b('0x37')](_0x57d60b[_0x23e8c0][_0x798b('0x68')])){_0x5e96e4[_0x57d60b[_0x23e8c0][_0x798b('0x68')]]=needsEncapsulation(_0x57d60b[_0x23e8c0][_0x798b('0x69')])?encapsulate(_0x57d60b[_0x23e8c0][_0x798b('0x69')]):_0x57d60b[_0x23e8c0][_0x798b('0x69')];}}var _0x1ba649=[],_0x22013c={};for(var _0x37c068=0x0,_0x5cd286=_0x51a08a[_0x798b('0x44')];_0x37c068<_0x5cd286;_0x37c068++){_0x22013c={'ProjectId':_0x12feca[_0x798b('0x53')]['id'],'SessionId':_0x51a08a[_0x37c068]['id'],'StartTime':moment(_0x51a08a[_0x37c068][_0x798b('0x6a')])['format'](_0x798b('0x6b'))};for(var _0x210cac=0x0,_0x18dc4b=_0x57d60b[_0x798b('0x44')];_0x210cac<_0x18dc4b;_0x210cac++){if(_0x57d60b[_0x210cac][_0x798b('0x6c')]==_0x51a08a[_0x37c068]['id']&&_0x5e96e4[_0x798b('0x37')](_0x57d60b[_0x210cac][_0x798b('0x68')])){_0x22013c[_0x5e96e4[_0x57d60b[_0x210cac][_0x798b('0x68')]]]=_0x57d60b[_0x210cac][_0x798b('0x6d')];}}for(var _0x32165d in _0x5e96e4){if(!_0x22013c[_0x798b('0x37')](_0x5e96e4[_0x32165d])){_0x22013c[_0x5e96e4[_0x32165d]]=null;}}_0x1ba649[_0x798b('0x6e')](_0x22013c);}return _0x1ba649;}})[_0x798b('0x23')](function(_0x3b50c8){if(!_['isEmpty'](_0x3b50c8)){var _0x135051=toCsv(_0x3b50c8);var _0x26c312=Date[_0x798b('0x6f')]();fs[_0x798b('0x70')](util[_0x798b('0x71')](_0x798b('0x72'),_0x12feca[_0x798b('0x53')]['id'],_0x26c312),_0x135051);_0x102490['setHeader'](_0x798b('0x73'),_0x798b('0x74')+util[_0x798b('0x71')]('Jscripty_Project_%d_Summary_%s.csv',_0x12feca[_0x798b('0x53')]['id'],_0x26c312));_0x102490[_0x798b('0x75')](_0x798b('0x76'),_0x798b('0x77'));return _0x102490[_0x798b('0x78')](util['format'](_0x798b('0x72'),_0x12feca['params']['id'],_0x26c312));}else{return _0x102490[_0x798b('0x16')](0xcc);}})['catch'](handleError(_0x102490,null));}; \ No newline at end of file +var _0xd61e=['json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','error','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','JscriptyProject','findAll','catch','show','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','length','omit','createdAt','updatedAt','userProfileId','UserProfileResource','update','getSessions','findOne','JscriptySessionReport','rawAttributes','ProjectId','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','sendStatus','end','status'];(function(_0x95008f,_0x3eb101){var _0x514c6b=function(_0x5deef8){while(--_0x5deef8){_0x95008f['push'](_0x95008f['shift']());}};_0x514c6b(++_0x3eb101);}(_0xd61e,0x13d));var _0xed61=function(_0xfd26d0,_0xc3b15c){_0xfd26d0=_0xfd26d0-0x0;var _0x2f03c1=_0xd61e[_0xfd26d0];return _0x2f03c1;};'use strict';var emlformat=require(_0xed61('0x0'));var rimraf=require(_0xed61('0x1'));var zipdir=require(_0xed61('0x2'));var jsonpatch=require(_0xed61('0x3'));var rp=require(_0xed61('0x4'));var moment=require(_0xed61('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xed61('0x6'));var util=require(_0xed61('0x7'));var path=require(_0xed61('0x8'));var sox=require(_0xed61('0x9'));var csv=require(_0xed61('0xa'));var ejs=require(_0xed61('0xb'));var fs=require('fs');var fs_extra=require(_0xed61('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xed61('0xa'));var querystring=require(_0xed61('0xd'));var Papa=require(_0xed61('0xe'));var Redis=require(_0xed61('0xf'));var authService=require(_0xed61('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xed61('0x11'))(_0xed61('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xeedb63,_0x21511d){_0x21511d=_0x21511d||0xcc;return function(_0x19c74c){if(_0x19c74c){return _0xeedb63[_0xed61('0x13')](_0x21511d);}return _0xeedb63['status'](_0x21511d)[_0xed61('0x14')]();};}function respondWithResult(_0x28f4cb,_0xe08d33){_0xe08d33=_0xe08d33||0xc8;return function(_0x4ac6e2){if(_0x4ac6e2){return _0x28f4cb[_0xed61('0x15')](_0xe08d33)[_0xed61('0x16')](_0x4ac6e2);}};}function respondWithFilteredResult(_0x16fa20,_0x2ad52a){return function(_0x4d3930){if(_0x4d3930){var _0x15198a=typeof _0x2ad52a[_0xed61('0x17')]===_0xed61('0x18')&&typeof _0x2ad52a[_0xed61('0x19')]==='undefined';var _0x39b1d1=_0x4d3930[_0xed61('0x1a')];var _0x4bd841=_0x15198a?0x0:_0x2ad52a[_0xed61('0x17')];var _0x11a277=_0x15198a?_0x4d3930[_0xed61('0x1a')]:_0x2ad52a['offset']+_0x2ad52a[_0xed61('0x19')];var _0xb7879f;if(_0x11a277>=_0x39b1d1){_0x11a277=_0x39b1d1;_0xb7879f=0xc8;}else{_0xb7879f=0xce;}_0x16fa20[_0xed61('0x15')](_0xb7879f);return _0x16fa20['set'](_0xed61('0x1b'),_0x4bd841+'-'+_0x11a277+'/'+_0x39b1d1)[_0xed61('0x16')](_0x4d3930);}return null;};}function patchUpdates(_0xce408c){return function(_0x5ee0b9){try{jsonpatch[_0xed61('0x1c')](_0x5ee0b9,_0xce408c,!![]);}catch(_0x16d63a){return BPromise['reject'](_0x16d63a);}return _0x5ee0b9[_0xed61('0x1d')]();};}function saveUpdates(_0x315020,_0x864dfa){return function(_0x5f3d0f){if(_0x5f3d0f){return _0x5f3d0f['update'](_0x315020)[_0xed61('0x1e')](function(_0x544d49){return _0x544d49;});}return null;};}function removeEntity(_0xa17a06,_0x217e93){return function(_0x2722d0){if(_0x2722d0){return _0x2722d0[_0xed61('0x1f')]()[_0xed61('0x1e')](function(){var _0x5a71f0=_0x2722d0['get']({'plain':!![]});var _0x4a3e02='Projects';return db['UserProfileResource'][_0xed61('0x1f')]({'where':{'type':_0x4a3e02,'resourceId':_0x5a71f0['id']}})['then'](function(){return _0x2722d0;});})[_0xed61('0x1e')](function(){_0xa17a06[_0xed61('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x503bc7,_0x14d140){return function(_0xca7c0c){if(!_0xca7c0c){_0x503bc7[_0xed61('0x13')](0x194);}return _0xca7c0c;};}function handleError(_0x5b83b2,_0x20de9b){_0x20de9b=_0x20de9b||0x1f4;return function(_0xd809ce){logger[_0xed61('0x20')](_0xd809ce['stack']);if(_0xd809ce[_0xed61('0x21')]){delete _0xd809ce['name'];}_0x5b83b2[_0xed61('0x15')](_0x20de9b)[_0xed61('0x22')](_0xd809ce);};}exports[_0xed61('0x23')]=function(_0x50b19d,_0x260ac4){var _0xa5a8aa={},_0x2f23d5={},_0x690795={'count':0x0,'rows':[]};var _0x4b1294=_[_0xed61('0x24')](db['JscriptyProject']['rawAttributes'],function(_0x2df5b6){return{'name':_0x2df5b6[_0xed61('0x25')],'type':_0x2df5b6[_0xed61('0x26')][_0xed61('0x27')]};});_0x2f23d5['model']=_['map'](_0x4b1294,_0xed61('0x21'));_0x2f23d5[_0xed61('0x28')]=_[_0xed61('0x29')](_0x50b19d[_0xed61('0x28')]);_0x2f23d5[_0xed61('0x2a')]=_[_0xed61('0x2b')](_0x2f23d5[_0xed61('0x2c')],_0x2f23d5['query']);_0xa5a8aa['attributes']=_[_0xed61('0x2b')](_0x2f23d5['model'],qs[_0xed61('0x2d')](_0x50b19d['query']['fields']));_0xa5a8aa['attributes']=_0xa5a8aa['attributes']['length']?_0xa5a8aa[_0xed61('0x2e')]:_0x2f23d5[_0xed61('0x2c')];if(!_0x50b19d[_0xed61('0x28')][_0xed61('0x2f')](_0xed61('0x30'))){_0xa5a8aa[_0xed61('0x19')]=qs[_0xed61('0x19')](_0x50b19d[_0xed61('0x28')]['limit']);_0xa5a8aa['offset']=qs[_0xed61('0x17')](_0x50b19d[_0xed61('0x28')][_0xed61('0x17')]);}_0xa5a8aa[_0xed61('0x31')]=qs['sort'](_0x50b19d[_0xed61('0x28')][_0xed61('0x32')]);_0xa5a8aa['where']=qs[_0xed61('0x2a')](_[_0xed61('0x33')](_0x50b19d[_0xed61('0x28')],_0x2f23d5[_0xed61('0x2a')]),_0x4b1294);if(_0x50b19d['query'][_0xed61('0x34')]){_0xa5a8aa[_0xed61('0x35')]=_[_0xed61('0x36')](_0xa5a8aa[_0xed61('0x35')],{'$or':_[_0xed61('0x24')](_0x4b1294,function(_0x23d66d){if(_0x23d66d[_0xed61('0x26')]!=='VIRTUAL'){var _0x3abfa6={};_0x3abfa6[_0x23d66d[_0xed61('0x21')]]={'$like':'%'+_0x50b19d[_0xed61('0x28')][_0xed61('0x34')]+'%'};return _0x3abfa6;}})});}_0xa5a8aa=_[_0xed61('0x36')]({},_0xa5a8aa,_0x50b19d[_0xed61('0x37')]);var _0x35ad22={'where':_0xa5a8aa[_0xed61('0x35')]};return db[_0xed61('0x38')][_0xed61('0x1a')](_0x35ad22)[_0xed61('0x1e')](function(_0x16720e){_0x690795[_0xed61('0x1a')]=_0x16720e;if(_0x50b19d[_0xed61('0x28')]['includeAll']){_0xa5a8aa['include']=[{'all':!![]}];}return db[_0xed61('0x38')][_0xed61('0x39')](_0xa5a8aa);})['then'](function(_0x5b9bef){_0x690795['rows']=_0x5b9bef;return _0x690795;})['then'](respondWithFilteredResult(_0x260ac4,_0xa5a8aa))[_0xed61('0x3a')](handleError(_0x260ac4,null));};exports[_0xed61('0x3b')]=function(_0xd92795,_0x16ac3f){var _0x434384={'raw':![],'where':{'id':_0xd92795['params']['id']}},_0x41e094={};_0x41e094[_0xed61('0x2c')]=_[_0xed61('0x29')](db[_0xed61('0x38')]['rawAttributes']);_0x41e094[_0xed61('0x28')]=_[_0xed61('0x29')](_0xd92795[_0xed61('0x28')]);_0x41e094[_0xed61('0x2a')]=_[_0xed61('0x2b')](_0x41e094['model'],_0x41e094['query']);_0x434384[_0xed61('0x2e')]=_[_0xed61('0x2b')](_0x41e094[_0xed61('0x2c')],qs[_0xed61('0x2d')](_0xd92795['query'][_0xed61('0x2d')]));_0x434384[_0xed61('0x2e')]=_0x434384[_0xed61('0x2e')]['length']?_0x434384[_0xed61('0x2e')]:_0x41e094[_0xed61('0x2c')];if(_0xd92795['query'][_0xed61('0x3c')]){_0x434384[_0xed61('0x3d')]=[{'all':!![]}];}_0x434384=_[_0xed61('0x36')]({},_0x434384,_0xd92795[_0xed61('0x37')]);return db[_0xed61('0x38')][_0xed61('0x3e')](_0x434384)[_0xed61('0x1e')](handleEntityNotFound(_0x16ac3f,null))[_0xed61('0x1e')](respondWithResult(_0x16ac3f,null))[_0xed61('0x3a')](handleError(_0x16ac3f,null));};exports[_0xed61('0x3f')]=function(_0x2bf758,_0x3a6693){return db[_0xed61('0x38')][_0xed61('0x3f')](_0x2bf758[_0xed61('0x40')],{})[_0xed61('0x1e')](function(_0x38059f){var _0x43031b=_0x2bf758[_0xed61('0x41')][_0xed61('0x42')]({'plain':!![]});if(!_0x43031b)throw new Error(_0xed61('0x43'));if(_0x43031b[_0xed61('0x44')]===_0xed61('0x41')){var _0x4908f3=_0x38059f['get']({'plain':!![]});var _0x28950f=_0xed61('0x45');return db[_0xed61('0x46')][_0xed61('0x3e')]({'where':{'name':_0x28950f,'userProfileId':_0x43031b['userProfileId']},'raw':!![]})[_0xed61('0x1e')](function(_0x3ec791){if(_0x3ec791&&_0x3ec791[_0xed61('0x47')]===0x0){return db['UserProfileResource']['create']({'name':_0x4908f3['name'],'resourceId':_0x4908f3['id'],'type':_0x3ec791[_0xed61('0x21')],'sectionId':_0x3ec791['id']},{})[_0xed61('0x1e')](function(){return _0x38059f;});}else{return _0x38059f;}})[_0xed61('0x3a')](function(_0x1d3b9d){logger[_0xed61('0x20')](_0xed61('0x48'),_0x1d3b9d);throw _0x1d3b9d;});}return _0x38059f;})[_0xed61('0x1e')](respondWithResult(_0x3a6693,0xc9))[_0xed61('0x3a')](handleError(_0x3a6693,null));};exports['clone']=function(_0x2bb9b9,_0x258a40){var _0x4c1762={'where':{'id':_0x2bb9b9[_0xed61('0x49')]['id']}},_0x116eea={};_0x116eea[_0xed61('0x2c')]=_['keys'](db[_0xed61('0x38')]['rawAttributes']);_0x4c1762[_0xed61('0x2e')]=_[_0xed61('0x2b')](_0x116eea[_0xed61('0x2c')],qs[_0xed61('0x2d')](_0x2bb9b9[_0xed61('0x28')][_0xed61('0x2d')]));_0x4c1762[_0xed61('0x2e')]=_0x4c1762['attributes'][_0xed61('0x4a')]?_0x4c1762[_0xed61('0x2e')]:_0x116eea[_0xed61('0x2c')];if(_0x2bb9b9[_0xed61('0x28')][_0xed61('0x3c')]){_0x4c1762[_0xed61('0x3d')]=[{'all':!![]}];}_0x4c1762=_['merge']({},_0x4c1762,_0x2bb9b9[_0xed61('0x37')]);return db['JscriptyProject'][_0xed61('0x3e')](_0x4c1762)['then'](handleEntityNotFound(_0x258a40,null))[_0xed61('0x1e')](function(_0x44588a){if(_0x44588a){var _0x591909=_0x44588a[_0xed61('0x42')]({'plain':!![]});_0x591909=qs[_0xed61('0x4b')](_0x591909,['id',_0xed61('0x4c'),_0xed61('0x4d')]);_0x2bb9b9[_0xed61('0x40')]=_['omit'](_0x2bb9b9[_0xed61('0x40')],['id',_0xed61('0x4c'),_0xed61('0x4d')]);return db[_0xed61('0x38')][_0xed61('0x3f')](_[_0xed61('0x36')](_0x591909,_0x2bb9b9[_0xed61('0x40')]),{'include':_0x2bb9b9['query']['includeAll']?[{'all':!![]}]:undefined})[_0xed61('0x1e')](function(_0x4729f3){var _0xcd868e=_0x2bb9b9[_0xed61('0x41')][_0xed61('0x42')]({'plain':!![]});if(!_0xcd868e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xcd868e[_0xed61('0x44')]===_0xed61('0x41')){var _0x4efb8f=_0x4729f3['get']({'plain':!![]});var _0x22f3d1=_0xed61('0x45');return db[_0xed61('0x46')][_0xed61('0x3e')]({'where':{'name':_0x22f3d1,'userProfileId':_0xcd868e[_0xed61('0x4e')]},'raw':!![]})['then'](function(_0x55ef0b){if(_0x55ef0b&&_0x55ef0b[_0xed61('0x47')]===0x0){return db[_0xed61('0x4f')][_0xed61('0x3f')]({'name':_0x4efb8f[_0xed61('0x21')],'resourceId':_0x4efb8f['id'],'type':_0x55ef0b[_0xed61('0x21')],'sectionId':_0x55ef0b['id']},{})[_0xed61('0x1e')](function(){return _0x4729f3;});}else{return _0x4729f3;}})[_0xed61('0x3a')](function(_0x2882a0){logger[_0xed61('0x20')](_0xed61('0x48'),_0x2882a0);throw _0x2882a0;});}return _0x4729f3;});}})['then'](respondWithResult(_0x258a40,0xc9))[_0xed61('0x3a')](handleError(_0x258a40,null));};exports[_0xed61('0x50')]=function(_0x5aeffd,_0x298a12){if(_0x5aeffd[_0xed61('0x40')]['id']){delete _0x5aeffd[_0xed61('0x40')]['id'];}return db[_0xed61('0x38')][_0xed61('0x3e')]({'where':{'id':_0x5aeffd['params']['id']}})[_0xed61('0x1e')](handleEntityNotFound(_0x298a12,null))['then'](saveUpdates(_0x5aeffd['body'],null))[_0xed61('0x1e')](respondWithResult(_0x298a12,null))[_0xed61('0x3a')](handleError(_0x298a12,null));};exports[_0xed61('0x1f')]=function(_0x5e862d,_0x1dc280){return db[_0xed61('0x38')][_0xed61('0x3e')]({'where':{'id':_0x5e862d[_0xed61('0x49')]['id']}})[_0xed61('0x1e')](handleEntityNotFound(_0x1dc280,null))['then'](removeEntity(_0x1dc280,null))['catch'](handleError(_0x1dc280,null));};exports[_0xed61('0x51')]=function(_0x32f435,_0xb952c,_0x21ab9c){var _0x32db02={'raw':!![],'where':{}};var _0x5d5d15={};var _0xe89a4={'count':0x0,'rows':[]};return db[_0xed61('0x38')][_0xed61('0x52')]({'where':{'id':_0x32f435[_0xed61('0x49')]['id']}})['then'](handleEntityNotFound(_0xb952c,null))[_0xed61('0x1e')](function(_0x2efa4a){if(_0x2efa4a){_0x5d5d15['model']=_[_0xed61('0x29')](db[_0xed61('0x53')][_0xed61('0x54')]);_0x5d5d15[_0xed61('0x28')]=_[_0xed61('0x29')](_0x32f435[_0xed61('0x28')]);_0x5d5d15[_0xed61('0x2a')]=_[_0xed61('0x2b')](_0x5d5d15[_0xed61('0x2c')],_0x5d5d15[_0xed61('0x28')]);_0x32db02['attributes']=_['intersection'](_0x5d5d15[_0xed61('0x2c')],qs[_0xed61('0x2d')](_0x32f435[_0xed61('0x28')]['fields']));_0x32db02['attributes']=_0x32db02[_0xed61('0x2e')][_0xed61('0x4a')]?_0x32db02[_0xed61('0x2e')]:_0x5d5d15[_0xed61('0x2c')];if(!_0x32f435[_0xed61('0x28')][_0xed61('0x2f')](_0xed61('0x30'))){_0x32db02[_0xed61('0x19')]=qs[_0xed61('0x19')](_0x32f435['query'][_0xed61('0x19')]);_0x32db02[_0xed61('0x17')]=qs[_0xed61('0x17')](_0x32f435[_0xed61('0x28')][_0xed61('0x17')]);}_0x32db02[_0xed61('0x31')]=qs[_0xed61('0x32')](_0x32f435[_0xed61('0x28')]['sort']);_0x32db02[_0xed61('0x35')]=qs[_0xed61('0x2a')](_[_0xed61('0x33')](_0x32f435[_0xed61('0x28')],_0x5d5d15[_0xed61('0x2a')]));_0x32db02[_0xed61('0x35')][_0xed61('0x55')]=_0x2efa4a['id'];if(_0x32f435[_0xed61('0x28')][_0xed61('0x34')]){_0x32db02[_0xed61('0x35')]=_[_0xed61('0x36')](_0x32db02[_0xed61('0x35')],{'$or':_[_0xed61('0x24')](_0x32db02[_0xed61('0x2e')],function(_0x11af28){var _0x56d2c2={};_0x56d2c2[_0x11af28]={'$like':'%'+_0x32f435[_0xed61('0x28')][_0xed61('0x34')]+'%'};return _0x56d2c2;})});}_0x32db02=_[_0xed61('0x36')]({},_0x32db02,_0x32f435[_0xed61('0x37')]);return db[_0xed61('0x53')][_0xed61('0x1a')]({'where':_0x32db02['where']})[_0xed61('0x1e')](function(_0x2cfcad){_0xe89a4[_0xed61('0x1a')]=_0x2cfcad;if(_0x32f435[_0xed61('0x28')][_0xed61('0x3c')]){_0x32db02[_0xed61('0x3d')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xed61('0x39')](_0x32db02);})['then'](function(_0x2a67f3){_0xe89a4[_0xed61('0x56')]=_0x2a67f3;return _0xe89a4;});}})[_0xed61('0x1e')](respondWithFilteredResult(_0xb952c,_0x32db02))['catch'](handleError(_0xb952c,null));};exports[_0xed61('0x57')]=function(_0x5f1c64,_0x4fe78d,_0x1b1140){var _0x1dc2a5={'raw':!![],'where':{}};var _0x2d2037={};var _0x3dfa42={'count':0x0,'rows':[]};return db[_0xed61('0x38')][_0xed61('0x52')]({'where':{'id':_0x5f1c64[_0xed61('0x49')]['id']}})[_0xed61('0x1e')](handleEntityNotFound(_0x4fe78d,null))[_0xed61('0x1e')](function(_0x23d06d){if(_0x23d06d){_0x2d2037[_0xed61('0x2c')]=_[_0xed61('0x29')](db[_0xed61('0x58')][_0xed61('0x54')]);_0x2d2037[_0xed61('0x28')]=_[_0xed61('0x29')](_0x5f1c64[_0xed61('0x28')]);_0x2d2037[_0xed61('0x2a')]=_[_0xed61('0x2b')](_0x2d2037[_0xed61('0x2c')],_0x2d2037[_0xed61('0x28')]);_0x1dc2a5[_0xed61('0x2e')]=_[_0xed61('0x2b')](_0x2d2037['model'],qs['fields'](_0x5f1c64['query'][_0xed61('0x2d')]));_0x1dc2a5[_0xed61('0x2e')]=_0x1dc2a5['attributes'][_0xed61('0x4a')]?_0x1dc2a5[_0xed61('0x2e')]:_0x2d2037[_0xed61('0x2c')];if(!_0x5f1c64[_0xed61('0x28')][_0xed61('0x2f')](_0xed61('0x30'))){_0x1dc2a5[_0xed61('0x19')]=qs['limit'](_0x5f1c64[_0xed61('0x28')][_0xed61('0x19')]);_0x1dc2a5[_0xed61('0x17')]=qs[_0xed61('0x17')](_0x5f1c64[_0xed61('0x28')][_0xed61('0x17')]);}_0x1dc2a5[_0xed61('0x31')]=qs[_0xed61('0x32')](_0x5f1c64[_0xed61('0x28')]['sort']);_0x1dc2a5[_0xed61('0x35')]=qs[_0xed61('0x2a')](_[_0xed61('0x33')](_0x5f1c64[_0xed61('0x28')],_0x2d2037[_0xed61('0x2a')]));_0x1dc2a5[_0xed61('0x35')]['ProjectId']=_0x23d06d['id'];if(_0x5f1c64['query']['filter']){_0x1dc2a5[_0xed61('0x35')]=_['merge'](_0x1dc2a5['where'],{'$or':_[_0xed61('0x24')](_0x1dc2a5['attributes'],function(_0x16ebc7){var _0x1cbabc={};_0x1cbabc[_0x16ebc7]={'$like':'%'+_0x5f1c64[_0xed61('0x28')][_0xed61('0x34')]+'%'};return _0x1cbabc;})});}_0x1dc2a5=_[_0xed61('0x36')]({},_0x1dc2a5,_0x5f1c64[_0xed61('0x37')]);return db[_0xed61('0x58')]['count']({'where':_0x1dc2a5[_0xed61('0x35')]})[_0xed61('0x1e')](function(_0xe42f6){_0x3dfa42['count']=_0xe42f6;if(_0x5f1c64[_0xed61('0x28')][_0xed61('0x3c')]){_0x1dc2a5[_0xed61('0x3d')]=[{'all':!![]}];}return db[_0xed61('0x58')][_0xed61('0x39')](_0x1dc2a5);})[_0xed61('0x1e')](function(_0x320285){_0x3dfa42[_0xed61('0x56')]=_0x320285;return _0x3dfa42;});}})[_0xed61('0x1e')](respondWithFilteredResult(_0x4fe78d,_0x1dc2a5))[_0xed61('0x3a')](handleError(_0x4fe78d,null));};function char(_0xe8e904){return _0xed61('0x59')===typeof _0xe8e904?String[_0xed61('0x5a')][_0xed61('0x1c')](null,arguments):_0xe8e904;}function needsEncapsulation(_0x1a7f79){return!!_0x1a7f79&&(_0x1a7f79[_0xed61('0x5b')]()['indexOf'](char(0xd))>=0x0||_0x1a7f79[_0xed61('0x5b')]()['indexOf'](char(0xa))>=0x0||_0x1a7f79[_0xed61('0x5b')]()[_0xed61('0x5c')](char(0x2c))>=0x0||_0x1a7f79[_0xed61('0x5b')]()[_0xed61('0x5c')](char(0x22))>=0x0);}function encapsulate(_0x22a64a){var _0x5a74c5=char(0x22),_0x20aec3='\x5c'+char(0x22),_0x5eef48=_0x22a64a[_0xed61('0x5b')]()[_0xed61('0x5d')](new RegExp(_0x5a74c5,'g'),_0x20aec3);return _0x5a74c5+_0x5eef48+_0x5a74c5;}exports[_0xed61('0x5e')]=function(_0xe460f9,_0x32a763,_0x1cf2d9){var _0x351241,_0x508ed0;var _0x3c600a={'where':{'ProjectId':_0xe460f9[_0xed61('0x49')]['id']}};if(_0xe460f9[_0xed61('0x28')][_0xed61('0x5f')]){_0x3c600a['where']['starttime']=JSON['parse'](_0xe460f9[_0xed61('0x28')][_0xed61('0x5f')]);}return db['JscriptySessionReport']['findAll'](_0x3c600a)[_0xed61('0x1e')](handleEntityNotFound(_0x32a763,null))[_0xed61('0x1e')](function(_0x4313de){if(_0x4313de){_0x351241=_0x4313de;return db[_0xed61('0x60')][_0xed61('0x39')]({'where':{'SessionId':{'$in':_[_0xed61('0x24')](_0x351241,'id')},'ProjectId':_0xe460f9[_0xed61('0x49')]['id']},'order':_0xed61('0x61')});}})['then'](handleEntityNotFound(_0x32a763,null))[_0xed61('0x1e')](function(_0x4313d2){if(_0x4313d2){_0x508ed0=_0x4313d2;var _0x3f7eb1={};for(var _0x416931=0x0,_0x399f30=_0x508ed0['length'];_0x416931<_0x399f30;_0x416931++){if(!_0x3f7eb1['hasOwnProperty'](_0x508ed0[_0x416931]['questionId'])){_0x3f7eb1[_0x508ed0[_0x416931][_0xed61('0x62')]]=needsEncapsulation(_0x508ed0[_0x416931][_0xed61('0x63')])?encapsulate(_0x508ed0[_0x416931][_0xed61('0x63')]):_0x508ed0[_0x416931]['question'];}}var _0x499015=[],_0x10860e={};for(var _0x14a0e5=0x0,_0x1f07fd=_0x351241[_0xed61('0x4a')];_0x14a0e5<_0x1f07fd;_0x14a0e5++){_0x10860e={'ProjectId':_0xe460f9[_0xed61('0x49')]['id'],'SessionId':_0x351241[_0x14a0e5]['id'],'StartTime':moment(_0x351241[_0x14a0e5][_0xed61('0x64')])[_0xed61('0x65')](_0xed61('0x66'))};for(var _0x4f66e6=0x0,_0x47483f=_0x508ed0[_0xed61('0x4a')];_0x4f66e6<_0x47483f;_0x4f66e6++){if(_0x508ed0[_0x4f66e6][_0xed61('0x67')]==_0x351241[_0x14a0e5]['id']&&_0x3f7eb1[_0xed61('0x2f')](_0x508ed0[_0x4f66e6]['questionId'])){_0x10860e[_0x3f7eb1[_0x508ed0[_0x4f66e6][_0xed61('0x62')]]]=_0x508ed0[_0x4f66e6][_0xed61('0x68')];}}for(var _0x5a065c in _0x3f7eb1){if(!_0x10860e[_0xed61('0x2f')](_0x3f7eb1[_0x5a065c])){_0x10860e[_0x3f7eb1[_0x5a065c]]=null;}}_0x499015[_0xed61('0x69')](_0x10860e);}return _0x499015;}})[_0xed61('0x1e')](function(_0x1cd9b9){if(!_[_0xed61('0x6a')](_0x1cd9b9)){var _0x7c4425=toCsv(_0x1cd9b9);var _0xd7ae25=Date[_0xed61('0x6b')]();fs[_0xed61('0x6c')](util[_0xed61('0x65')](_0xed61('0x6d'),_0xe460f9[_0xed61('0x49')]['id'],_0xd7ae25),_0x7c4425);_0x32a763[_0xed61('0x6e')](_0xed61('0x6f'),_0xed61('0x70')+util[_0xed61('0x65')]('Jscripty_Project_%d_Summary_%s.csv',_0xe460f9['params']['id'],_0xd7ae25));_0x32a763[_0xed61('0x6e')]('Content-type','text/csv');return _0x32a763['download'](util[_0xed61('0x65')](_0xed61('0x6d'),_0xe460f9[_0xed61('0x49')]['id'],_0xd7ae25));}else{return _0x32a763[_0xed61('0x13')](0xcc);}})[_0xed61('0x3a')](handleError(_0x32a763,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 4ed8bfb..bb5b12c 100644 --- a/server/api/jscriptyProject/jscriptyProject.model.js +++ b/server/api/jscriptyProject/jscriptyProject.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2cf=['./jscriptyProject.attributes','JscriptyProject','jscripty_projects','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x58a0cb,_0x3db763){var _0x5b8051=function(_0x166a7e){while(--_0x166a7e){_0x58a0cb['push'](_0x58a0cb['shift']());}};_0x5b8051(++_0x3db763);}(_0xf2cf,0xf5));var _0xff2c=function(_0x50fa25,_0x479f71){_0x50fa25=_0x50fa25-0x0;var _0x496129=_0xf2cf[_0x50fa25];return _0x496129;};'use strict';var _=require('lodash');var util=require(_0xff2c('0x0'));var logger=require(_0xff2c('0x1'))(_0xff2c('0x2'));var moment=require('moment');var BPromise=require(_0xff2c('0x3'));var rp=require(_0xff2c('0x4'));var fs=require('fs');var path=require(_0xff2c('0x5'));var rimraf=require(_0xff2c('0x6'));var config=require(_0xff2c('0x7'));var attributes=require(_0xff2c('0x8'));module['exports']=function(_0x8f0f4,_0x68b356){return _0x8f0f4['define'](_0xff2c('0x9'),attributes,{'tableName':_0xff2c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37c5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','define','jscripty_projects','util'];(function(_0xd3a4cb,_0x36f7ed){var _0x2496bb=function(_0x164d1f){while(--_0x164d1f){_0xd3a4cb['push'](_0xd3a4cb['shift']());}};_0x2496bb(++_0x36f7ed);}(_0x37c5,0xa7));var _0x537c=function(_0x5cd34f,_0x52a955){_0x5cd34f=_0x5cd34f-0x0;var _0xbe3a55=_0x37c5[_0x5cd34f];return _0xbe3a55;};'use strict';var _=require('lodash');var util=require(_0x537c('0x0'));var logger=require(_0x537c('0x1'))(_0x537c('0x2'));var moment=require(_0x537c('0x3'));var BPromise=require(_0x537c('0x4'));var rp=require(_0x537c('0x5'));var fs=require('fs');var path=require(_0x537c('0x6'));var rimraf=require(_0x537c('0x7'));var config=require(_0x537c('0x8'));var attributes=require(_0x537c('0x9'));module['exports']=function(_0x42c86a,_0x1156f4){return _0x42c86a[_0x537c('0xa')]('JscriptyProject',attributes,{'tableName':_0x537c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index bc29c4b..ea757e9 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['JscriptyProject,\x20%s,\x20%s','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x5a854c,_0xbaad5e){var _0x3324af=function(_0x57fd1c){while(--_0x57fd1c){_0x5a854c['push'](_0x5a854c['shift']());}};_0x3324af(++_0xbaad5e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xb7e7[_0x17928f];return _0x500b63;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file +var _0xbdb7=['request\x20sent','debug','JscriptyProject,\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','JscriptyProject,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x582965,_0x58da5a){_0x582965=_0x582965-0x0;var _0x361185=_0xbdb7[_0x582965];return _0x361185;};'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 diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 80f5462..4984be2 100644 --- a/server/api/jscriptyQuestionReport/index.js +++ b/server/api/jscriptyQuestionReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x342b=['../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','create','put','update','destroy','multer','util','connect-timeout','fs-extra'];(function(_0x5432c9,_0x14de80){var _0x4bb173=function(_0x1367ac){while(--_0x1367ac){_0x5432c9['push'](_0x5432c9['shift']());}};_0x4bb173(++_0x14de80);}(_0x342b,0x155));var _0xb342=function(_0x30542b,_0x23ef43){_0x30542b=_0x30542b-0x0;var _0x3ac05f=_0x342b[_0x30542b];return _0x3ac05f;};'use strict';var multer=require(_0xb342('0x0'));var util=require(_0xb342('0x1'));var path=require('path');var timeout=require(_0xb342('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb342('0x3'));var auth=require(_0xb342('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb342('0x5'));var controller=require('./jscriptyQuestionReport.controller');router[_0xb342('0x6')]('/',auth[_0xb342('0x7')](),controller['index']);router['get'](_0xb342('0x8'),auth['isAuthenticated'](),controller[_0xb342('0x9')]);router[_0xb342('0x6')](_0xb342('0xa'),auth[_0xb342('0x7')](),controller['show']);router['post']('/',auth[_0xb342('0x7')](),controller[_0xb342('0xb')]);router[_0xb342('0xc')](_0xb342('0xa'),auth['isAuthenticated'](),controller[_0xb342('0xd')]);router['delete']('/:id',auth[_0xb342('0x7')](),controller[_0xb342('0xe')]);module['exports']=router; \ No newline at end of file +var _0x97d5=['isAuthenticated','index','/describe','describe','show','post','put','update','/:id','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get'];(function(_0x28d18e,_0x46a650){var _0x1eef33=function(_0x347409){while(--_0x347409){_0x28d18e['push'](_0x28d18e['shift']());}};_0x1eef33(++_0x46a650);}(_0x97d5,0x83));var _0x597d=function(_0x2abfac,_0x3fc645){_0x2abfac=_0x2abfac-0x0;var _0x18c079=_0x97d5[_0x2abfac];return _0x18c079;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x597d('0x0'));var timeout=require(_0x597d('0x1'));var express=require(_0x597d('0x2'));var router=express[_0x597d('0x3')]();var fs_extra=require(_0x597d('0x4'));var auth=require(_0x597d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x597d('0x6'));var controller=require(_0x597d('0x7'));router[_0x597d('0x8')]('/',auth[_0x597d('0x9')](),controller[_0x597d('0xa')]);router['get'](_0x597d('0xb'),auth[_0x597d('0x9')](),controller[_0x597d('0xc')]);router[_0x597d('0x8')]('/:id',auth[_0x597d('0x9')](),controller[_0x597d('0xd')]);router[_0x597d('0xe')]('/',auth[_0x597d('0x9')](),controller['create']);router[_0x597d('0xf')]('/:id',auth[_0x597d('0x9')](),controller[_0x597d('0x10')]);router['delete'](_0x597d('0x11'),auth[_0x597d('0x9')](),controller[_0x597d('0x12')]);module[_0x597d('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 01d053d..25eae8e 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x7a54,0x106));var _0x47a5=function(_0x3cd272,_0x3e4d86){_0x3cd272=_0x3cd272-0x0;var _0x38f99d=_0x7a54[_0x3cd272];return _0x38f99d;};'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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x7a54,0x106));var _0x47a5=function(_0x230880,_0x265040){_0x230880=_0x230880-0x0;var _0x37d710=_0x7a54[_0x230880];return _0x37d710;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 6b78ac6..28a16a2 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48b6=['offset','set','Content-Range','apply','reject','save','update','then','error','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','merge','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count'];(function(_0x843096,_0x3e7d12){var _0x15e168=function(_0x1af764){while(--_0x1af764){_0x843096['push'](_0x843096['shift']());}};_0x15e168(++_0x3e7d12);}(_0x48b6,0x1b2));var _0x648b=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x48b6[_0x20c9b2];return _0x2c6030;};'use strict';var emlformat=require(_0x648b('0x0'));var rimraf=require(_0x648b('0x1'));var zipdir=require(_0x648b('0x2'));var jsonpatch=require(_0x648b('0x3'));var rp=require('request-promise');var moment=require(_0x648b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x648b('0x5'));var path=require(_0x648b('0x6'));var sox=require(_0x648b('0x7'));var csv=require(_0x648b('0x8'));var ejs=require(_0x648b('0x9'));var fs=require('fs');var fs_extra=require(_0x648b('0xa'));var _=require(_0x648b('0xb'));var squel=require(_0x648b('0xc'));var crypto=require(_0x648b('0xd'));var jsforce=require(_0x648b('0xe'));var deskjs=require(_0x648b('0xf'));var toCsv=require(_0x648b('0x8'));var querystring=require(_0x648b('0x10'));var Papa=require('papaparse');var Redis=require(_0x648b('0x11'));var authService=require(_0x648b('0x12'));var qs=require(_0x648b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x648b('0x14'));var logger=require(_0x648b('0x15'))(_0x648b('0x16'));var utils=require(_0x648b('0x17'));var config=require(_0x648b('0x18'));var licenseUtil=require(_0x648b('0x19'));var db=require(_0x648b('0x1a'))['db'];function respondWithStatusCode(_0x5ab29d,_0x188c7a){_0x188c7a=_0x188c7a||0xcc;return function(_0xdcb314){if(_0xdcb314){return _0x5ab29d[_0x648b('0x1b')](_0x188c7a);}return _0x5ab29d[_0x648b('0x1c')](_0x188c7a)[_0x648b('0x1d')]();};}function respondWithResult(_0x1350db,_0x4beb68){_0x4beb68=_0x4beb68||0xc8;return function(_0x5e1232){if(_0x5e1232){return _0x1350db['status'](_0x4beb68)[_0x648b('0x1e')](_0x5e1232);}};}function respondWithFilteredResult(_0x37e489,_0x3852db){return function(_0x46d077){if(_0x46d077){var _0x10567d=typeof _0x3852db['offset']===_0x648b('0x1f')&&typeof _0x3852db[_0x648b('0x20')]===_0x648b('0x1f');var _0x508747=_0x46d077[_0x648b('0x21')];var _0x2a9bc4=_0x10567d?0x0:_0x3852db[_0x648b('0x22')];var _0x3cede8=_0x10567d?_0x46d077[_0x648b('0x21')]:_0x3852db[_0x648b('0x22')]+_0x3852db[_0x648b('0x20')];var _0x20298b;if(_0x3cede8>=_0x508747){_0x3cede8=_0x508747;_0x20298b=0xc8;}else{_0x20298b=0xce;}_0x37e489[_0x648b('0x1c')](_0x20298b);return _0x37e489[_0x648b('0x23')](_0x648b('0x24'),_0x2a9bc4+'-'+_0x3cede8+'/'+_0x508747)[_0x648b('0x1e')](_0x46d077);}return null;};}function patchUpdates(_0x40eee8){return function(_0x26d839){try{jsonpatch[_0x648b('0x25')](_0x26d839,_0x40eee8,!![]);}catch(_0x2f9b50){return BPromise[_0x648b('0x26')](_0x2f9b50);}return _0x26d839[_0x648b('0x27')]();};}function saveUpdates(_0x504acc,_0x3747df){return function(_0x5a7b45){if(_0x5a7b45){return _0x5a7b45[_0x648b('0x28')](_0x504acc)[_0x648b('0x29')](function(_0x2c6785){return _0x2c6785;});}return null;};}function removeEntity(_0x2b221f,_0x2e7e7a){return function(_0x49e74e){if(_0x49e74e){return _0x49e74e['destroy']()[_0x648b('0x29')](function(){_0x2b221f['status'](0xcc)[_0x648b('0x1d')]();});}};}function handleEntityNotFound(_0x143253,_0x41b794){return function(_0x4b6685){if(!_0x4b6685){_0x143253[_0x648b('0x1b')](0x194);}return _0x4b6685;};}function handleError(_0x17f34,_0xa91597){_0xa91597=_0xa91597||0x1f4;return function(_0x5a7c7f){logger[_0x648b('0x2a')](_0x5a7c7f['stack']);if(_0x5a7c7f['name']){delete _0x5a7c7f[_0x648b('0x2b')];}_0x17f34['status'](_0xa91597)['send'](_0x5a7c7f);};}exports[_0x648b('0x2c')]=function(_0xea5bd1,_0x3187b5){var _0x3aa169={},_0x4effd3={},_0xd53f44={'count':0x0,'rows':[]};var _0x5aebf9=_[_0x648b('0x2d')](db[_0x648b('0x2e')][_0x648b('0x2f')],function(_0x416b3a){return{'name':_0x416b3a[_0x648b('0x30')],'type':_0x416b3a[_0x648b('0x31')][_0x648b('0x32')]};});_0x4effd3[_0x648b('0x33')]=_[_0x648b('0x2d')](_0x5aebf9,_0x648b('0x2b'));_0x4effd3[_0x648b('0x34')]=_[_0x648b('0x35')](_0xea5bd1[_0x648b('0x34')]);_0x4effd3[_0x648b('0x36')]=_[_0x648b('0x37')](_0x4effd3['model'],_0x4effd3[_0x648b('0x34')]);_0x3aa169[_0x648b('0x38')]=_[_0x648b('0x37')](_0x4effd3['model'],qs[_0x648b('0x39')](_0xea5bd1[_0x648b('0x34')][_0x648b('0x39')]));_0x3aa169[_0x648b('0x38')]=_0x3aa169[_0x648b('0x38')]['length']?_0x3aa169[_0x648b('0x38')]:_0x4effd3[_0x648b('0x33')];if(!_0xea5bd1[_0x648b('0x34')][_0x648b('0x3a')]('nolimit')){_0x3aa169[_0x648b('0x20')]=qs['limit'](_0xea5bd1[_0x648b('0x34')][_0x648b('0x20')]);_0x3aa169['offset']=qs['offset'](_0xea5bd1[_0x648b('0x34')][_0x648b('0x22')]);}_0x3aa169[_0x648b('0x3b')]=qs['sort'](_0xea5bd1['query']['sort']);_0x3aa169[_0x648b('0x3c')]=qs['filters'](_[_0x648b('0x3d')](_0xea5bd1[_0x648b('0x34')],_0x4effd3[_0x648b('0x36')]),_0x5aebf9);if(_0xea5bd1[_0x648b('0x34')][_0x648b('0x3e')]){_0x3aa169['where']=_['merge'](_0x3aa169['where'],{'$or':_[_0x648b('0x2d')](_0x5aebf9,function(_0x426b18){if(_0x426b18[_0x648b('0x31')]!==_0x648b('0x3f')){var _0x49ee10={};_0x49ee10[_0x426b18['name']]={'$like':'%'+_0xea5bd1['query']['filter']+'%'};return _0x49ee10;}})});}_0x3aa169=_['merge']({},_0x3aa169,_0xea5bd1[_0x648b('0x40')]);var _0x38a2d1={'where':_0x3aa169[_0x648b('0x3c')]};return db['JscriptyQuestionReport'][_0x648b('0x21')](_0x38a2d1)[_0x648b('0x29')](function(_0x28dcc7){_0xd53f44[_0x648b('0x21')]=_0x28dcc7;if(_0xea5bd1['query'][_0x648b('0x41')]){_0x3aa169[_0x648b('0x42')]=[{'all':!![]}];}return db[_0x648b('0x2e')]['findAll'](_0x3aa169);})[_0x648b('0x29')](function(_0x3e0040){_0xd53f44[_0x648b('0x43')]=_0x3e0040;return _0xd53f44;})[_0x648b('0x29')](respondWithFilteredResult(_0x3187b5,_0x3aa169))[_0x648b('0x44')](handleError(_0x3187b5,null));};exports[_0x648b('0x45')]=function(_0x1918f2,_0x209c31){var _0x318b8a={'raw':!![],'where':{'id':_0x1918f2[_0x648b('0x46')]['id']}},_0x5ba25e={};_0x5ba25e['model']=_['keys'](db[_0x648b('0x2e')][_0x648b('0x2f')]);_0x5ba25e[_0x648b('0x34')]=_[_0x648b('0x35')](_0x1918f2['query']);_0x5ba25e[_0x648b('0x36')]=_['intersection'](_0x5ba25e[_0x648b('0x33')],_0x5ba25e['query']);_0x318b8a[_0x648b('0x38')]=_[_0x648b('0x37')](_0x5ba25e[_0x648b('0x33')],qs[_0x648b('0x39')](_0x1918f2[_0x648b('0x34')][_0x648b('0x39')]));_0x318b8a['attributes']=_0x318b8a[_0x648b('0x38')][_0x648b('0x47')]?_0x318b8a[_0x648b('0x38')]:_0x5ba25e['model'];if(_0x1918f2[_0x648b('0x34')][_0x648b('0x41')]){_0x318b8a[_0x648b('0x42')]=[{'all':!![]}];}_0x318b8a=_[_0x648b('0x48')]({},_0x318b8a,_0x1918f2[_0x648b('0x40')]);return db[_0x648b('0x2e')][_0x648b('0x49')](_0x318b8a)[_0x648b('0x29')](handleEntityNotFound(_0x209c31,null))[_0x648b('0x29')](respondWithResult(_0x209c31,null))[_0x648b('0x44')](handleError(_0x209c31,null));};exports[_0x648b('0x4a')]=function(_0x5cdd8c,_0x5f4ac6){return db['JscriptyQuestionReport'][_0x648b('0x4a')](_0x5cdd8c[_0x648b('0x4b')],{})[_0x648b('0x29')](respondWithResult(_0x5f4ac6,0xc9))[_0x648b('0x44')](handleError(_0x5f4ac6,null));};exports[_0x648b('0x28')]=function(_0x54fba6,_0x1d0036){if(_0x54fba6['body']['id']){delete _0x54fba6[_0x648b('0x4b')]['id'];}return db[_0x648b('0x2e')][_0x648b('0x49')]({'where':{'id':_0x54fba6[_0x648b('0x46')]['id']}})['then'](handleEntityNotFound(_0x1d0036,null))[_0x648b('0x29')](saveUpdates(_0x54fba6[_0x648b('0x4b')],null))[_0x648b('0x29')](respondWithResult(_0x1d0036,null))[_0x648b('0x44')](handleError(_0x1d0036,null));};exports[_0x648b('0x4c')]=function(_0x1d669e,_0x49c36e){return db[_0x648b('0x2e')][_0x648b('0x49')]({'where':{'id':_0x1d669e[_0x648b('0x46')]['id']}})[_0x648b('0x29')](handleEntityNotFound(_0x49c36e,null))['then'](removeEntity(_0x49c36e,null))[_0x648b('0x44')](handleError(_0x49c36e,null));};exports[_0x648b('0x4d')]=function(_0x338cd4,_0x3661c2){return db[_0x648b('0x2e')]['describe']()['then'](respondWithResult(_0x3661c2,null))['catch'](handleError(_0x3661c2,null));}; \ No newline at end of file +var _0xaab2=['mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','apply','reject','save','update','then','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise'];(function(_0x10fa9e,_0x2231eb){var _0x7c0482=function(_0x487115){while(--_0x487115){_0x10fa9e['push'](_0x10fa9e['shift']());}};_0x7c0482(++_0x2231eb);}(_0xaab2,0x15a));var _0x2aab=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xaab2[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x2aab('0x0'));var rimraf=require(_0x2aab('0x1'));var zipdir=require(_0x2aab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2aab('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2aab('0x4'));var util=require('util');var path=require(_0x2aab('0x5'));var sox=require(_0x2aab('0x6'));var csv=require(_0x2aab('0x7'));var ejs=require(_0x2aab('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2aab('0x9'));var squel=require(_0x2aab('0xa'));var crypto=require(_0x2aab('0xb'));var jsforce=require(_0x2aab('0xc'));var deskjs=require(_0x2aab('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2aab('0xe'));var Redis=require(_0x2aab('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2aab('0x10'));var as=require(_0x2aab('0x11'));var hardwareService=require(_0x2aab('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x2aab('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2aab('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x226bcc,_0x135f3c){_0x135f3c=_0x135f3c||0xcc;return function(_0x424735){if(_0x424735){return _0x226bcc[_0x2aab('0x15')](_0x135f3c);}return _0x226bcc[_0x2aab('0x16')](_0x135f3c)[_0x2aab('0x17')]();};}function respondWithResult(_0x5de97b,_0xd73323){_0xd73323=_0xd73323||0xc8;return function(_0x45fb2e){if(_0x45fb2e){return _0x5de97b[_0x2aab('0x16')](_0xd73323)['json'](_0x45fb2e);}};}function respondWithFilteredResult(_0x38ebe6,_0x158c12){return function(_0x39d908){if(_0x39d908){var _0x24aa93=typeof _0x158c12[_0x2aab('0x18')]==='undefined'&&typeof _0x158c12[_0x2aab('0x19')]===_0x2aab('0x1a');var _0x31faea=_0x39d908[_0x2aab('0x1b')];var _0x3a0eb2=_0x24aa93?0x0:_0x158c12[_0x2aab('0x18')];var _0xf77100=_0x24aa93?_0x39d908[_0x2aab('0x1b')]:_0x158c12[_0x2aab('0x18')]+_0x158c12[_0x2aab('0x19')];var _0x5db353;if(_0xf77100>=_0x31faea){_0xf77100=_0x31faea;_0x5db353=0xc8;}else{_0x5db353=0xce;}_0x38ebe6['status'](_0x5db353);return _0x38ebe6['set']('Content-Range',_0x3a0eb2+'-'+_0xf77100+'/'+_0x31faea)['json'](_0x39d908);}return null;};}function patchUpdates(_0x147123){return function(_0x3acb88){try{jsonpatch[_0x2aab('0x1c')](_0x3acb88,_0x147123,!![]);}catch(_0x590c47){return BPromise[_0x2aab('0x1d')](_0x590c47);}return _0x3acb88[_0x2aab('0x1e')]();};}function saveUpdates(_0x37c868,_0x5f5b3c){return function(_0x482789){if(_0x482789){return _0x482789[_0x2aab('0x1f')](_0x37c868)['then'](function(_0x107ee8){return _0x107ee8;});}return null;};}function removeEntity(_0x26c485,_0x1a9a20){return function(_0x52ed10){if(_0x52ed10){return _0x52ed10['destroy']()[_0x2aab('0x20')](function(){_0x26c485['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x27a65b,_0x31d7c9){return function(_0x3e0429){if(!_0x3e0429){_0x27a65b[_0x2aab('0x15')](0x194);}return _0x3e0429;};}function handleError(_0x1e43b4,_0x403a89){_0x403a89=_0x403a89||0x1f4;return function(_0x2b08f5){logger[_0x2aab('0x21')](_0x2b08f5[_0x2aab('0x22')]);if(_0x2b08f5['name']){delete _0x2b08f5[_0x2aab('0x23')];}_0x1e43b4[_0x2aab('0x16')](_0x403a89)[_0x2aab('0x24')](_0x2b08f5);};}exports[_0x2aab('0x25')]=function(_0x598336,_0x4114a3){var _0x26bd49={},_0x13feb2={},_0x33029e={'count':0x0,'rows':[]};var _0x70a1ad=_[_0x2aab('0x26')](db[_0x2aab('0x27')][_0x2aab('0x28')],function(_0x44fdba){return{'name':_0x44fdba[_0x2aab('0x29')],'type':_0x44fdba['type']['key']};});_0x13feb2[_0x2aab('0x2a')]=_[_0x2aab('0x26')](_0x70a1ad,'name');_0x13feb2['query']=_[_0x2aab('0x2b')](_0x598336[_0x2aab('0x2c')]);_0x13feb2[_0x2aab('0x2d')]=_[_0x2aab('0x2e')](_0x13feb2[_0x2aab('0x2a')],_0x13feb2[_0x2aab('0x2c')]);_0x26bd49[_0x2aab('0x2f')]=_[_0x2aab('0x2e')](_0x13feb2[_0x2aab('0x2a')],qs['fields'](_0x598336[_0x2aab('0x2c')][_0x2aab('0x30')]));_0x26bd49[_0x2aab('0x2f')]=_0x26bd49[_0x2aab('0x2f')][_0x2aab('0x31')]?_0x26bd49[_0x2aab('0x2f')]:_0x13feb2[_0x2aab('0x2a')];if(!_0x598336['query'][_0x2aab('0x32')](_0x2aab('0x33'))){_0x26bd49[_0x2aab('0x19')]=qs[_0x2aab('0x19')](_0x598336['query'][_0x2aab('0x19')]);_0x26bd49[_0x2aab('0x18')]=qs[_0x2aab('0x18')](_0x598336['query'][_0x2aab('0x18')]);}_0x26bd49['order']=qs[_0x2aab('0x34')](_0x598336[_0x2aab('0x2c')][_0x2aab('0x34')]);_0x26bd49[_0x2aab('0x35')]=qs[_0x2aab('0x2d')](_[_0x2aab('0x36')](_0x598336['query'],_0x13feb2[_0x2aab('0x2d')]),_0x70a1ad);if(_0x598336[_0x2aab('0x2c')]['filter']){_0x26bd49['where']=_['merge'](_0x26bd49[_0x2aab('0x35')],{'$or':_[_0x2aab('0x26')](_0x70a1ad,function(_0x21b615){if(_0x21b615[_0x2aab('0x37')]!==_0x2aab('0x38')){var _0x28dbba={};_0x28dbba[_0x21b615[_0x2aab('0x23')]]={'$like':'%'+_0x598336[_0x2aab('0x2c')]['filter']+'%'};return _0x28dbba;}})});}_0x26bd49=_[_0x2aab('0x39')]({},_0x26bd49,_0x598336[_0x2aab('0x3a')]);var _0x2fc612={'where':_0x26bd49['where']};return db[_0x2aab('0x27')][_0x2aab('0x1b')](_0x2fc612)[_0x2aab('0x20')](function(_0x2587c5){_0x33029e[_0x2aab('0x1b')]=_0x2587c5;if(_0x598336[_0x2aab('0x2c')]['includeAll']){_0x26bd49[_0x2aab('0x3b')]=[{'all':!![]}];}return db[_0x2aab('0x27')][_0x2aab('0x3c')](_0x26bd49);})[_0x2aab('0x20')](function(_0x4e7ffd){_0x33029e[_0x2aab('0x3d')]=_0x4e7ffd;return _0x33029e;})[_0x2aab('0x20')](respondWithFilteredResult(_0x4114a3,_0x26bd49))[_0x2aab('0x3e')](handleError(_0x4114a3,null));};exports[_0x2aab('0x3f')]=function(_0x66cf44,_0x225c09){var _0x5bc7b9={'raw':!![],'where':{'id':_0x66cf44[_0x2aab('0x40')]['id']}},_0x481f7f={};_0x481f7f[_0x2aab('0x2a')]=_[_0x2aab('0x2b')](db[_0x2aab('0x27')]['rawAttributes']);_0x481f7f[_0x2aab('0x2c')]=_[_0x2aab('0x2b')](_0x66cf44[_0x2aab('0x2c')]);_0x481f7f[_0x2aab('0x2d')]=_[_0x2aab('0x2e')](_0x481f7f[_0x2aab('0x2a')],_0x481f7f[_0x2aab('0x2c')]);_0x5bc7b9[_0x2aab('0x2f')]=_['intersection'](_0x481f7f[_0x2aab('0x2a')],qs[_0x2aab('0x30')](_0x66cf44[_0x2aab('0x2c')][_0x2aab('0x30')]));_0x5bc7b9[_0x2aab('0x2f')]=_0x5bc7b9[_0x2aab('0x2f')][_0x2aab('0x31')]?_0x5bc7b9[_0x2aab('0x2f')]:_0x481f7f[_0x2aab('0x2a')];if(_0x66cf44[_0x2aab('0x2c')][_0x2aab('0x41')]){_0x5bc7b9[_0x2aab('0x3b')]=[{'all':!![]}];}_0x5bc7b9=_[_0x2aab('0x39')]({},_0x5bc7b9,_0x66cf44['options']);return db['JscriptyQuestionReport'][_0x2aab('0x42')](_0x5bc7b9)[_0x2aab('0x20')](handleEntityNotFound(_0x225c09,null))[_0x2aab('0x20')](respondWithResult(_0x225c09,null))[_0x2aab('0x3e')](handleError(_0x225c09,null));};exports[_0x2aab('0x43')]=function(_0x10c69e,_0x2b1b0b){return db[_0x2aab('0x27')][_0x2aab('0x43')](_0x10c69e[_0x2aab('0x44')],{})[_0x2aab('0x20')](respondWithResult(_0x2b1b0b,0xc9))[_0x2aab('0x3e')](handleError(_0x2b1b0b,null));};exports[_0x2aab('0x1f')]=function(_0x2a9312,_0x355b9e){if(_0x2a9312[_0x2aab('0x44')]['id']){delete _0x2a9312[_0x2aab('0x44')]['id'];}return db['JscriptyQuestionReport'][_0x2aab('0x42')]({'where':{'id':_0x2a9312[_0x2aab('0x40')]['id']}})[_0x2aab('0x20')](handleEntityNotFound(_0x355b9e,null))[_0x2aab('0x20')](saveUpdates(_0x2a9312['body'],null))['then'](respondWithResult(_0x355b9e,null))[_0x2aab('0x3e')](handleError(_0x355b9e,null));};exports['destroy']=function(_0x5d03b3,_0x3c6b5e){return db[_0x2aab('0x27')]['find']({'where':{'id':_0x5d03b3[_0x2aab('0x40')]['id']}})[_0x2aab('0x20')](handleEntityNotFound(_0x3c6b5e,null))[_0x2aab('0x20')](removeEntity(_0x3c6b5e,null))[_0x2aab('0x3e')](handleError(_0x3c6b5e,null));};exports[_0x2aab('0x45')]=function(_0x8bcb18,_0x499370){return db[_0x2aab('0x27')][_0x2aab('0x45')]()[_0x2aab('0x20')](respondWithResult(_0x499370,null))['catch'](handleError(_0x499370,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 6f341d0..03686ac 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3600=['api','moment','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x111327,_0x470199){var _0x44e4b4=function(_0x4da178){while(--_0x4da178){_0x111327['push'](_0x111327['shift']());}};_0x44e4b4(++_0x470199);}(_0x3600,0x1e4));var _0x0360=function(_0x33e831,_0x5ec236){_0x33e831=_0x33e831-0x0;var _0x3e64f7=_0x3600[_0x33e831];return _0x3e64f7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0360('0x0'));var moment=require(_0x0360('0x1'));var BPromise=require(_0x0360('0x2'));var rp=require(_0x0360('0x3'));var fs=require('fs');var path=require(_0x0360('0x4'));var rimraf=require('rimraf');var config=require(_0x0360('0x5'));var attributes=require(_0x0360('0x6'));module[_0x0360('0x7')]=function(_0x58bd11,_0x30b38a){return _0x58bd11[_0x0360('0x8')](_0x0360('0x9'),attributes,{'tableName':_0x0360('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf1f=['api','bluebird','path','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','lodash','util','../../config/logger'];(function(_0x208cf0,_0x486665){var _0x372d0d=function(_0x293e01){while(--_0x293e01){_0x208cf0['push'](_0x208cf0['shift']());}};_0x372d0d(++_0x486665);}(_0xdf1f,0xf9));var _0xfdf1=function(_0x3b0966,_0x3fc4ca){_0x3b0966=_0x3b0966-0x0;var _0x18e6b0=_0xdf1f[_0x3b0966];return _0x18e6b0;};'use strict';var _=require(_0xfdf1('0x0'));var util=require(_0xfdf1('0x1'));var logger=require(_0xfdf1('0x2'))(_0xfdf1('0x3'));var moment=require('moment');var BPromise=require(_0xfdf1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdf1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfdf1('0x6'));module[_0xfdf1('0x7')]=function(_0x55c7cf,_0x29b715){return _0x55c7cf['define'](_0xfdf1('0x8'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 1644eee..c1671ef 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a31=['debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x3709d,_0x43bf53){var _0x418d74=function(_0x2cd092){while(--_0x2cd092){_0x3709d['push'](_0x3709d['shift']());}};_0x418d74(++_0x43bf53);}(_0x5a31,0x1e3));var _0x15a3=function(_0x5e334b,_0x2aa45f){_0x5e334b=_0x5e334b-0x0;var _0x2c59f8=_0x5a31[_0x5e334b];return _0x2c59f8;};'use strict';var _=require(_0x15a3('0x0'));var util=require('util');var moment=require(_0x15a3('0x1'));var BPromise=require(_0x15a3('0x2'));var rs=require(_0x15a3('0x3'));var fs=require('fs');var Redis=require(_0x15a3('0x4'));var db=require(_0x15a3('0x5'))['db'];var utils=require(_0x15a3('0x6'));var logger=require(_0x15a3('0x7'))(_0x15a3('0x8'));var config=require(_0x15a3('0x9'));var jayson=require(_0x15a3('0xa'));var client=jayson[_0x15a3('0xb')][_0x15a3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x599afe,_0x33abdf,_0x234d5b){return new BPromise(function(_0x3d4b83,_0x36473b){return client[_0x15a3('0xd')](_0x599afe,_0x234d5b)[_0x15a3('0xe')](function(_0xf1aa52){logger[_0x15a3('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x33abdf,_0x15a3('0x10'));logger[_0x15a3('0x11')](_0x15a3('0x12'),_0x33abdf,_0x15a3('0x10'),JSON[_0x15a3('0x13')](_0xf1aa52));if(_0xf1aa52[_0x15a3('0x14')]){if(_0xf1aa52[_0x15a3('0x14')]['code']===0x1f4){logger[_0x15a3('0x14')](_0x15a3('0x15'),_0x33abdf,_0xf1aa52[_0x15a3('0x14')]['message']);return _0x36473b(_0xf1aa52[_0x15a3('0x14')][_0x15a3('0x16')]);}logger['error'](_0x15a3('0x15'),_0x33abdf,_0xf1aa52['error']['message']);return _0x3d4b83(_0xf1aa52[_0x15a3('0x14')]['message']);}else{logger[_0x15a3('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x33abdf,_0x15a3('0x10'));_0x3d4b83(_0xf1aa52[_0x15a3('0x17')]['message']);}})[_0x15a3('0x18')](function(_0x143463){logger['error'](_0x15a3('0x15'),_0x33abdf,_0x143463);_0x36473b(_0x143463);});});} \ No newline at end of file +var _0x970b=['request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x42f82e,_0x221880){var _0x2d0edd=function(_0x48189f){while(--_0x48189f){_0x42f82e['push'](_0x42f82e['shift']());}};_0x2d0edd(++_0x221880);}(_0x970b,0x146));var _0xb970=function(_0xac0de1,_0x12d3d9){_0xac0de1=_0xac0de1-0x0;var _0x1c1995=_0x970b[_0xac0de1];return _0x1c1995;};'use strict';var _=require(_0xb970('0x0'));var util=require('util');var moment=require(_0xb970('0x1'));var BPromise=require(_0xb970('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb970('0x3'))['db'];var utils=require(_0xb970('0x4'));var logger=require(_0xb970('0x5'))(_0xb970('0x6'));var config=require(_0xb970('0x7'));var jayson=require(_0xb970('0x8'));var client=jayson['client'][_0xb970('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a7411,_0x222dfa,_0x2e9e9f){return new BPromise(function(_0x4b53ad,_0x561db2){return client[_0xb970('0xa')](_0x4a7411,_0x2e9e9f)[_0xb970('0xb')](function(_0x35564f){logger[_0xb970('0xc')](_0xb970('0xd'),_0x222dfa,'request\x20sent');logger[_0xb970('0xe')](_0xb970('0xf'),_0x222dfa,_0xb970('0x10'),JSON[_0xb970('0x11')](_0x35564f));if(_0x35564f['error']){if(_0x35564f[_0xb970('0x12')][_0xb970('0x13')]===0x1f4){logger['error'](_0xb970('0xd'),_0x222dfa,_0x35564f['error'][_0xb970('0x14')]);return _0x561db2(_0x35564f[_0xb970('0x12')][_0xb970('0x14')]);}logger[_0xb970('0x12')](_0xb970('0xd'),_0x222dfa,_0x35564f[_0xb970('0x12')][_0xb970('0x14')]);return _0x4b53ad(_0x35564f[_0xb970('0x12')]['message']);}else{logger[_0xb970('0xc')](_0xb970('0xd'),_0x222dfa,_0xb970('0x10'));_0x4b53ad(_0x35564f['result'][_0xb970('0x14')]);}})['catch'](function(_0xac64e2){logger[_0xb970('0x12')](_0xb970('0xd'),_0x222dfa,_0xac64e2);_0x561db2(_0xac64e2);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index bc200bc..1e4c028 100644 --- a/server/api/jscriptySessionReport/index.js +++ b/server/api/jscriptySessionReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x722a=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','show','/:id/questions','getQuestions','post','put','/:id','update','delete'];(function(_0x1be3b3,_0x4335ee){var _0x4f8b2d=function(_0x1d955f){while(--_0x1d955f){_0x1be3b3['push'](_0x1be3b3['shift']());}};_0x4f8b2d(++_0x4335ee);}(_0x722a,0x1a0));var _0xa722=function(_0x11077d,_0x17024a){_0x11077d=_0x11077d-0x0;var _0x40aa3c=_0x722a[_0x11077d];return _0x40aa3c;};'use strict';var multer=require(_0xa722('0x0'));var util=require(_0xa722('0x1'));var path=require('path');var timeout=require(_0xa722('0x2'));var express=require('express');var router=express[_0xa722('0x3')]();var fs_extra=require(_0xa722('0x4'));var auth=require(_0xa722('0x5'));var interaction=require(_0xa722('0x6'));var config=require(_0xa722('0x7'));var controller=require(_0xa722('0x8'));router[_0xa722('0x9')]('/',auth[_0xa722('0xa')](),controller[_0xa722('0xb')]);router['get']('/describe',auth[_0xa722('0xa')](),controller[_0xa722('0xc')]);router['get']('/:id',auth[_0xa722('0xa')](),controller[_0xa722('0xd')]);router['get'](_0xa722('0xe'),auth[_0xa722('0xa')](),controller[_0xa722('0xf')]);router[_0xa722('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa722('0x11')](_0xa722('0x12'),auth[_0xa722('0xa')](),controller[_0xa722('0x13')]);router[_0xa722('0x14')](_0xa722('0x12'),auth[_0xa722('0xa')](),controller[_0xa722('0x15')]);module[_0xa722('0x16')]=router; \ No newline at end of file +var _0x37b6=['multer','util','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x5b5cfa,_0x1869b3){var _0x214758=function(_0x14688c){while(--_0x14688c){_0x5b5cfa['push'](_0x5b5cfa['shift']());}};_0x214758(++_0x1869b3);}(_0x37b6,0x17c));var _0x637b=function(_0x20afff,_0x5c995e){_0x20afff=_0x20afff-0x0;var _0x304c23=_0x37b6[_0x20afff];return _0x304c23;};'use strict';var multer=require(_0x637b('0x0'));var util=require(_0x637b('0x1'));var path=require('path');var timeout=require(_0x637b('0x2'));var express=require('express');var router=express[_0x637b('0x3')]();var fs_extra=require(_0x637b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x637b('0x5'));var controller=require('./jscriptySessionReport.controller');router[_0x637b('0x6')]('/',auth[_0x637b('0x7')](),controller[_0x637b('0x8')]);router[_0x637b('0x6')](_0x637b('0x9'),auth[_0x637b('0x7')](),controller[_0x637b('0xa')]);router['get'](_0x637b('0xb'),auth[_0x637b('0x7')](),controller[_0x637b('0xc')]);router[_0x637b('0x6')]('/:id/questions',auth['isAuthenticated'](),controller['getQuestions']);router[_0x637b('0xd')]('/',auth['isAuthenticated'](),controller[_0x637b('0xe')]);router[_0x637b('0xf')](_0x637b('0xb'),auth[_0x637b('0x7')](),controller[_0x637b('0x10')]);router[_0x637b('0x11')](_0x637b('0xb'),auth[_0x637b('0x7')](),controller[_0x637b('0x12')]);module[_0x637b('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 416eaf8..46b16a4 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc89=['setDataValue','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','exports','starttime'];(function(_0x4e1d3c,_0x4f9988){var _0x5177b2=function(_0x26109f){while(--_0x26109f){_0x4e1d3c['push'](_0x4e1d3c['shift']());}};_0x5177b2(++_0x4f9988);}(_0xfc89,0xf3));var _0x9fc8=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xfc89[_0x55f8b4];return _0x2475f9;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x9fc8('0x0')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x3bb8e0){this['setDataValue'](_0x9fc8('0x1'),_0x3bb8e0);this[_0x9fc8('0x2')]('endtime',moment()['format'](_0x9fc8('0x3')));}},'endtime':{'type':Sequelize[_0x9fc8('0x4')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x9fc8('0x5')]},'uniqueid':{'type':Sequelize[_0x9fc8('0x5')]},'calleridname':{'type':Sequelize[_0x9fc8('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x9fc8('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x2daa=['STRING','BOOLEAN','sequelize','exports','DATE','setDataValue','format'];(function(_0x3ab652,_0x1b3ad2){var _0x2b2fa6=function(_0x21957d){while(--_0x21957d){_0x3ab652['push'](_0x3ab652['shift']());}};_0x2b2fa6(++_0x1b3ad2);}(_0x2daa,0x167));var _0xa2da=function(_0xdf3db6,_0x2a1952){_0xdf3db6=_0xdf3db6-0x0;var _0x4b7a65=_0x2daa[_0xdf3db6];return _0x4b7a65;};'use strict';var moment=require('moment');var Sequelize=require(_0xa2da('0x0'));module[_0xa2da('0x1')]={'starttime':{'type':Sequelize[_0xa2da('0x2')],'set':function(_0x202c3e){this[_0xa2da('0x3')]('starttime',_0x202c3e);this[_0xa2da('0x3')]('endtime',moment()[_0xa2da('0x4')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xa2da('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xa2da('0x5')]},'queue':{'type':Sequelize[_0xa2da('0x5')]},'uniqueid':{'type':Sequelize[_0xa2da('0x5')]},'calleridname':{'type':Sequelize[_0xa2da('0x5')]},'calleridnum':{'type':Sequelize[_0xa2da('0x5')]},'completed':{'type':Sequelize[_0xa2da('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 2843efe..b0c3cb8 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf178=['map','JscriptySessionReport','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','catch','show','params','rawAttributes','include','find','create','body','update','describe','findOne','JscriptyQuestionReport','nolimit','SessionId','includeAll','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','name','send','index'];(function(_0x427c54,_0x42c11e){var _0x2b8846=function(_0x1c7942){while(--_0x1c7942){_0x427c54['push'](_0x427c54['shift']());}};_0x2b8846(++_0x42c11e);}(_0xf178,0xcb));var _0x8f17=function(_0x54f3e8,_0x3ed493){_0x54f3e8=_0x54f3e8-0x0;var _0x267b37=_0xf178[_0x54f3e8];return _0x267b37;};'use strict';var emlformat=require(_0x8f17('0x0'));var rimraf=require(_0x8f17('0x1'));var zipdir=require(_0x8f17('0x2'));var jsonpatch=require(_0x8f17('0x3'));var rp=require(_0x8f17('0x4'));var moment=require(_0x8f17('0x5'));var BPromise=require(_0x8f17('0x6'));var Mustache=require(_0x8f17('0x7'));var util=require(_0x8f17('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x8f17('0x9'));var ejs=require(_0x8f17('0xa'));var fs=require('fs');var fs_extra=require(_0x8f17('0xb'));var _=require('lodash');var squel=require(_0x8f17('0xc'));var crypto=require(_0x8f17('0xd'));var jsforce=require(_0x8f17('0xe'));var deskjs=require(_0x8f17('0xf'));var toCsv=require(_0x8f17('0x9'));var querystring=require('querystring');var Papa=require(_0x8f17('0x10'));var Redis=require(_0x8f17('0x11'));var authService=require(_0x8f17('0x12'));var qs=require(_0x8f17('0x13'));var as=require(_0x8f17('0x14'));var hardwareService=require(_0x8f17('0x15'));var logger=require(_0x8f17('0x16'))(_0x8f17('0x17'));var utils=require(_0x8f17('0x18'));var config=require(_0x8f17('0x19'));var licenseUtil=require(_0x8f17('0x1a'));var db=require(_0x8f17('0x1b'))['db'];function respondWithStatusCode(_0x5458d5,_0x1f93fb){_0x1f93fb=_0x1f93fb||0xcc;return function(_0x840445){if(_0x840445){return _0x5458d5[_0x8f17('0x1c')](_0x1f93fb);}return _0x5458d5[_0x8f17('0x1d')](_0x1f93fb)['end']();};}function respondWithResult(_0x5cdab0,_0x4b4bff){_0x4b4bff=_0x4b4bff||0xc8;return function(_0xc1e16c){if(_0xc1e16c){return _0x5cdab0[_0x8f17('0x1d')](_0x4b4bff)[_0x8f17('0x1e')](_0xc1e16c);}};}function respondWithFilteredResult(_0x5a0140,_0xfd7535){return function(_0x2e20ad){if(_0x2e20ad){var _0x2ef106=typeof _0xfd7535[_0x8f17('0x1f')]===_0x8f17('0x20')&&typeof _0xfd7535[_0x8f17('0x21')]===_0x8f17('0x20');var _0x3e26c1=_0x2e20ad[_0x8f17('0x22')];var _0x5b771c=_0x2ef106?0x0:_0xfd7535[_0x8f17('0x1f')];var _0x11fec1=_0x2ef106?_0x2e20ad[_0x8f17('0x22')]:_0xfd7535[_0x8f17('0x1f')]+_0xfd7535['limit'];var _0x416b5e;if(_0x11fec1>=_0x3e26c1){_0x11fec1=_0x3e26c1;_0x416b5e=0xc8;}else{_0x416b5e=0xce;}_0x5a0140[_0x8f17('0x1d')](_0x416b5e);return _0x5a0140[_0x8f17('0x23')](_0x8f17('0x24'),_0x5b771c+'-'+_0x11fec1+'/'+_0x3e26c1)[_0x8f17('0x1e')](_0x2e20ad);}return null;};}function patchUpdates(_0x16d646){return function(_0x4a6082){try{jsonpatch[_0x8f17('0x25')](_0x4a6082,_0x16d646,!![]);}catch(_0x4df3e7){return BPromise[_0x8f17('0x26')](_0x4df3e7);}return _0x4a6082[_0x8f17('0x27')]();};}function saveUpdates(_0x3d87de,_0x182b8e){return function(_0xc78363){if(_0xc78363){return _0xc78363['update'](_0x3d87de)[_0x8f17('0x28')](function(_0x561803){return _0x561803;});}return null;};}function removeEntity(_0x2a9557,_0x4a470e){return function(_0x12889d){if(_0x12889d){return _0x12889d[_0x8f17('0x29')]()[_0x8f17('0x28')](function(){_0x2a9557[_0x8f17('0x1d')](0xcc)[_0x8f17('0x2a')]();});}};}function handleEntityNotFound(_0x314e00,_0x45c80d){return function(_0xff67f0){if(!_0xff67f0){_0x314e00[_0x8f17('0x1c')](0x194);}return _0xff67f0;};}function handleError(_0x3a532f,_0x41a92a){_0x41a92a=_0x41a92a||0x1f4;return function(_0x9cc085){logger['error'](_0x9cc085['stack']);if(_0x9cc085['name']){delete _0x9cc085[_0x8f17('0x2b')];}_0x3a532f[_0x8f17('0x1d')](_0x41a92a)[_0x8f17('0x2c')](_0x9cc085);};}exports[_0x8f17('0x2d')]=function(_0x559050,_0x44e396){var _0x1ab28f={},_0x2c96c7={},_0x2b6fd0={'count':0x0,'rows':[]};var _0x33561c=_[_0x8f17('0x2e')](db[_0x8f17('0x2f')]['rawAttributes'],function(_0x2bf256){return{'name':_0x2bf256[_0x8f17('0x30')],'type':_0x2bf256[_0x8f17('0x31')]['key']};});_0x2c96c7[_0x8f17('0x32')]=_[_0x8f17('0x2e')](_0x33561c,_0x8f17('0x2b'));_0x2c96c7[_0x8f17('0x33')]=_[_0x8f17('0x34')](_0x559050['query']);_0x2c96c7['filters']=_['intersection'](_0x2c96c7['model'],_0x2c96c7['query']);_0x1ab28f[_0x8f17('0x35')]=_[_0x8f17('0x36')](_0x2c96c7['model'],qs[_0x8f17('0x37')](_0x559050[_0x8f17('0x33')]['fields']));_0x1ab28f['attributes']=_0x1ab28f[_0x8f17('0x35')][_0x8f17('0x38')]?_0x1ab28f['attributes']:_0x2c96c7[_0x8f17('0x32')];if(!_0x559050[_0x8f17('0x33')][_0x8f17('0x39')]('nolimit')){_0x1ab28f[_0x8f17('0x21')]=qs[_0x8f17('0x21')](_0x559050[_0x8f17('0x33')][_0x8f17('0x21')]);_0x1ab28f['offset']=qs[_0x8f17('0x1f')](_0x559050[_0x8f17('0x33')][_0x8f17('0x1f')]);}_0x1ab28f[_0x8f17('0x3a')]=qs[_0x8f17('0x3b')](_0x559050[_0x8f17('0x33')][_0x8f17('0x3b')]);_0x1ab28f[_0x8f17('0x3c')]=qs[_0x8f17('0x3d')](_['pick'](_0x559050['query'],_0x2c96c7['filters']),_0x33561c);if(_0x559050[_0x8f17('0x33')][_0x8f17('0x3e')]){_0x1ab28f[_0x8f17('0x3c')]=_[_0x8f17('0x3f')](_0x1ab28f[_0x8f17('0x3c')],{'$or':_[_0x8f17('0x2e')](_0x33561c,function(_0x504027){if(_0x504027[_0x8f17('0x31')]!==_0x8f17('0x40')){var _0x4de71c={};_0x4de71c[_0x504027[_0x8f17('0x2b')]]={'$like':'%'+_0x559050[_0x8f17('0x33')][_0x8f17('0x3e')]+'%'};return _0x4de71c;}})});}_0x1ab28f=_[_0x8f17('0x3f')]({},_0x1ab28f,_0x559050[_0x8f17('0x41')]);var _0x4b8ae3={'where':_0x1ab28f[_0x8f17('0x3c')]};return db[_0x8f17('0x2f')]['count'](_0x4b8ae3)[_0x8f17('0x28')](function(_0x2ca819){_0x2b6fd0[_0x8f17('0x22')]=_0x2ca819;if(_0x559050[_0x8f17('0x33')]['includeAll']){_0x1ab28f['include']=[{'all':!![]}];}return db[_0x8f17('0x2f')]['findAll'](_0x1ab28f);})[_0x8f17('0x28')](function(_0x49afca){_0x2b6fd0['rows']=_0x49afca;return _0x2b6fd0;})[_0x8f17('0x28')](respondWithFilteredResult(_0x44e396,_0x1ab28f))[_0x8f17('0x42')](handleError(_0x44e396,null));};exports[_0x8f17('0x43')]=function(_0x41bb17,_0x57966e){var _0x4368d5={'raw':!![],'where':{'id':_0x41bb17[_0x8f17('0x44')]['id']}},_0x29a0bf={};_0x29a0bf['model']=_[_0x8f17('0x34')](db[_0x8f17('0x2f')][_0x8f17('0x45')]);_0x29a0bf[_0x8f17('0x33')]=_[_0x8f17('0x34')](_0x41bb17[_0x8f17('0x33')]);_0x29a0bf[_0x8f17('0x3d')]=_[_0x8f17('0x36')](_0x29a0bf[_0x8f17('0x32')],_0x29a0bf[_0x8f17('0x33')]);_0x4368d5[_0x8f17('0x35')]=_[_0x8f17('0x36')](_0x29a0bf[_0x8f17('0x32')],qs[_0x8f17('0x37')](_0x41bb17['query'][_0x8f17('0x37')]));_0x4368d5[_0x8f17('0x35')]=_0x4368d5[_0x8f17('0x35')][_0x8f17('0x38')]?_0x4368d5[_0x8f17('0x35')]:_0x29a0bf[_0x8f17('0x32')];if(_0x41bb17['query']['includeAll']){_0x4368d5[_0x8f17('0x46')]=[{'all':!![]}];}_0x4368d5=_[_0x8f17('0x3f')]({},_0x4368d5,_0x41bb17[_0x8f17('0x41')]);return db['JscriptySessionReport'][_0x8f17('0x47')](_0x4368d5)['then'](handleEntityNotFound(_0x57966e,null))[_0x8f17('0x28')](respondWithResult(_0x57966e,null))[_0x8f17('0x42')](handleError(_0x57966e,null));};exports[_0x8f17('0x48')]=function(_0x39e95d,_0x5e3d11){return db[_0x8f17('0x2f')][_0x8f17('0x48')](_0x39e95d[_0x8f17('0x49')],{})['then'](respondWithResult(_0x5e3d11,0xc9))['catch'](handleError(_0x5e3d11,null));};exports[_0x8f17('0x4a')]=function(_0xc29657,_0x335f21){if(_0xc29657[_0x8f17('0x49')]['id']){delete _0xc29657[_0x8f17('0x49')]['id'];}return db['JscriptySessionReport'][_0x8f17('0x47')]({'where':{'id':_0xc29657['params']['id']}})['then'](handleEntityNotFound(_0x335f21,null))['then'](saveUpdates(_0xc29657[_0x8f17('0x49')],null))[_0x8f17('0x28')](respondWithResult(_0x335f21,null))['catch'](handleError(_0x335f21,null));};exports[_0x8f17('0x29')]=function(_0xaa617c,_0x42adbb){return db[_0x8f17('0x2f')][_0x8f17('0x47')]({'where':{'id':_0xaa617c[_0x8f17('0x44')]['id']}})[_0x8f17('0x28')](handleEntityNotFound(_0x42adbb,null))['then'](removeEntity(_0x42adbb,null))['catch'](handleError(_0x42adbb,null));};exports[_0x8f17('0x4b')]=function(_0x2a472e,_0x1a882e){return db['JscriptySessionReport'][_0x8f17('0x4b')]()[_0x8f17('0x28')](respondWithResult(_0x1a882e,null))['catch'](handleError(_0x1a882e,null));};exports['getQuestions']=function(_0x5a1792,_0xf9f4e2,_0x142d1e){var _0x4cc2ec={'raw':!![],'where':{}};var _0xcc41ae={};var _0x5cc416={'count':0x0,'rows':[]};return db[_0x8f17('0x2f')][_0x8f17('0x4c')]({'where':{'id':_0x5a1792[_0x8f17('0x44')]['id']}})[_0x8f17('0x28')](handleEntityNotFound(_0xf9f4e2,null))[_0x8f17('0x28')](function(_0x5661c0){if(_0x5661c0){_0xcc41ae[_0x8f17('0x32')]=_[_0x8f17('0x34')](db[_0x8f17('0x4d')][_0x8f17('0x45')]);_0xcc41ae[_0x8f17('0x33')]=_[_0x8f17('0x34')](_0x5a1792[_0x8f17('0x33')]);_0xcc41ae['filters']=_['intersection'](_0xcc41ae[_0x8f17('0x32')],_0xcc41ae['query']);_0x4cc2ec['attributes']=_[_0x8f17('0x36')](_0xcc41ae[_0x8f17('0x32')],qs[_0x8f17('0x37')](_0x5a1792['query'][_0x8f17('0x37')]));_0x4cc2ec['attributes']=_0x4cc2ec[_0x8f17('0x35')][_0x8f17('0x38')]?_0x4cc2ec[_0x8f17('0x35')]:_0xcc41ae[_0x8f17('0x32')];if(!_0x5a1792[_0x8f17('0x33')][_0x8f17('0x39')](_0x8f17('0x4e'))){_0x4cc2ec[_0x8f17('0x21')]=qs['limit'](_0x5a1792[_0x8f17('0x33')][_0x8f17('0x21')]);_0x4cc2ec['offset']=qs[_0x8f17('0x1f')](_0x5a1792[_0x8f17('0x33')]['offset']);}_0x4cc2ec[_0x8f17('0x3a')]=qs[_0x8f17('0x3b')](_0x5a1792[_0x8f17('0x33')][_0x8f17('0x3b')]);_0x4cc2ec[_0x8f17('0x3c')]=qs[_0x8f17('0x3d')](_['pick'](_0x5a1792[_0x8f17('0x33')],_0xcc41ae[_0x8f17('0x3d')]));_0x4cc2ec[_0x8f17('0x3c')][_0x8f17('0x4f')]=_0x5661c0['id'];if(_0x5a1792[_0x8f17('0x33')]['filter']){_0x4cc2ec[_0x8f17('0x3c')]=_[_0x8f17('0x3f')](_0x4cc2ec[_0x8f17('0x3c')],{'$or':_[_0x8f17('0x2e')](_0x4cc2ec[_0x8f17('0x35')],function(_0x3cf3af){var _0x11805c={};_0x11805c[_0x3cf3af]={'$like':'%'+_0x5a1792[_0x8f17('0x33')][_0x8f17('0x3e')]+'%'};return _0x11805c;})});}_0x4cc2ec=_[_0x8f17('0x3f')]({},_0x4cc2ec,_0x5a1792['options']);return db['JscriptyQuestionReport'][_0x8f17('0x22')]({'where':_0x4cc2ec[_0x8f17('0x3c')]})[_0x8f17('0x28')](function(_0x484a19){_0x5cc416[_0x8f17('0x22')]=_0x484a19;if(_0x5a1792[_0x8f17('0x33')][_0x8f17('0x50')]){_0x4cc2ec[_0x8f17('0x46')]=[{'all':!![]}];}return db[_0x8f17('0x4d')][_0x8f17('0x51')](_0x4cc2ec);})[_0x8f17('0x28')](function(_0xd8c94a){_0x5cc416[_0x8f17('0x52')]=_0xd8c94a;return _0x5cc416;});}})['then'](respondWithFilteredResult(_0xf9f4e2,_0x4cc2ec))[_0x8f17('0x42')](handleError(_0xf9f4e2,null));}; \ No newline at end of file +var _0x0047=['../../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','reject','save','update','then','destroy','error','stack','name','index','map','JscriptySessionReport','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','merge','where','type','VIRTUAL','filter','options','includeAll','findAll','rows','show','length','include','find','catch','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','SessionId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x116c01,_0x334818){var _0x3f4c54=function(_0x20aaad){while(--_0x20aaad){_0x116c01['push'](_0x116c01['shift']());}};_0x3f4c54(++_0x334818);}(_0x0047,0x18b));var _0x7004=function(_0x1ed46f,_0x7691d7){_0x1ed46f=_0x1ed46f-0x0;var _0x43b931=_0x0047[_0x1ed46f];return _0x43b931;};'use strict';var emlformat=require(_0x7004('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7004('0x1'));var jsonpatch=require(_0x7004('0x2'));var rp=require(_0x7004('0x3'));var moment=require(_0x7004('0x4'));var BPromise=require(_0x7004('0x5'));var Mustache=require(_0x7004('0x6'));var util=require('util');var path=require(_0x7004('0x7'));var sox=require(_0x7004('0x8'));var csv=require(_0x7004('0x9'));var ejs=require(_0x7004('0xa'));var fs=require('fs');var fs_extra=require(_0x7004('0xb'));var _=require(_0x7004('0xc'));var squel=require('squel');var crypto=require(_0x7004('0xd'));var jsforce=require(_0x7004('0xe'));var deskjs=require(_0x7004('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7004('0x10'));var Papa=require('papaparse');var Redis=require(_0x7004('0x11'));var authService=require(_0x7004('0x12'));var qs=require(_0x7004('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7004('0x14'));var logger=require(_0x7004('0x15'))(_0x7004('0x16'));var utils=require(_0x7004('0x17'));var config=require(_0x7004('0x18'));var licenseUtil=require(_0x7004('0x19'));var db=require(_0x7004('0x1a'))['db'];function respondWithStatusCode(_0xda0b0c,_0x3d1440){_0x3d1440=_0x3d1440||0xcc;return function(_0x1afe87){if(_0x1afe87){return _0xda0b0c[_0x7004('0x1b')](_0x3d1440);}return _0xda0b0c[_0x7004('0x1c')](_0x3d1440)[_0x7004('0x1d')]();};}function respondWithResult(_0x4b455c,_0x484d07){_0x484d07=_0x484d07||0xc8;return function(_0xd17fa4){if(_0xd17fa4){return _0x4b455c['status'](_0x484d07)[_0x7004('0x1e')](_0xd17fa4);}};}function respondWithFilteredResult(_0x404a32,_0x2fdf7c){return function(_0x3d4f0e){if(_0x3d4f0e){var _0x187dc8=typeof _0x2fdf7c[_0x7004('0x1f')]===_0x7004('0x20')&&typeof _0x2fdf7c[_0x7004('0x21')]===_0x7004('0x20');var _0x4986d2=_0x3d4f0e[_0x7004('0x22')];var _0x215e01=_0x187dc8?0x0:_0x2fdf7c[_0x7004('0x1f')];var _0x28737e=_0x187dc8?_0x3d4f0e['count']:_0x2fdf7c['offset']+_0x2fdf7c[_0x7004('0x21')];var _0x5e3791;if(_0x28737e>=_0x4986d2){_0x28737e=_0x4986d2;_0x5e3791=0xc8;}else{_0x5e3791=0xce;}_0x404a32[_0x7004('0x1c')](_0x5e3791);return _0x404a32[_0x7004('0x23')](_0x7004('0x24'),_0x215e01+'-'+_0x28737e+'/'+_0x4986d2)[_0x7004('0x1e')](_0x3d4f0e);}return null;};}function patchUpdates(_0x4b884a){return function(_0x3d903e){try{jsonpatch['apply'](_0x3d903e,_0x4b884a,!![]);}catch(_0x35e2b9){return BPromise[_0x7004('0x25')](_0x35e2b9);}return _0x3d903e[_0x7004('0x26')]();};}function saveUpdates(_0x4f9954,_0x1f5f9e){return function(_0x3d7fe9){if(_0x3d7fe9){return _0x3d7fe9[_0x7004('0x27')](_0x4f9954)[_0x7004('0x28')](function(_0x545a13){return _0x545a13;});}return null;};}function removeEntity(_0x17673e,_0xe95f09){return function(_0x2f1b26){if(_0x2f1b26){return _0x2f1b26[_0x7004('0x29')]()[_0x7004('0x28')](function(){_0x17673e[_0x7004('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46cffb,_0x14b68f){return function(_0x4da1a7){if(!_0x4da1a7){_0x46cffb[_0x7004('0x1b')](0x194);}return _0x4da1a7;};}function handleError(_0x4d947b,_0x5b77db){_0x5b77db=_0x5b77db||0x1f4;return function(_0x5948d2){logger[_0x7004('0x2a')](_0x5948d2[_0x7004('0x2b')]);if(_0x5948d2[_0x7004('0x2c')]){delete _0x5948d2[_0x7004('0x2c')];}_0x4d947b[_0x7004('0x1c')](_0x5b77db)['send'](_0x5948d2);};}exports[_0x7004('0x2d')]=function(_0x4e7849,_0x537fbc){var _0x50468d={},_0x46f3ec={},_0x3b0eb0={'count':0x0,'rows':[]};var _0x3c6997=_[_0x7004('0x2e')](db[_0x7004('0x2f')][_0x7004('0x30')],function(_0x77cd73){return{'name':_0x77cd73['fieldName'],'type':_0x77cd73['type'][_0x7004('0x31')]};});_0x46f3ec['model']=_['map'](_0x3c6997,'name');_0x46f3ec[_0x7004('0x32')]=_[_0x7004('0x33')](_0x4e7849[_0x7004('0x32')]);_0x46f3ec[_0x7004('0x34')]=_[_0x7004('0x35')](_0x46f3ec[_0x7004('0x36')],_0x46f3ec['query']);_0x50468d[_0x7004('0x37')]=_[_0x7004('0x35')](_0x46f3ec[_0x7004('0x36')],qs[_0x7004('0x38')](_0x4e7849[_0x7004('0x32')][_0x7004('0x38')]));_0x50468d[_0x7004('0x37')]=_0x50468d[_0x7004('0x37')]['length']?_0x50468d[_0x7004('0x37')]:_0x46f3ec[_0x7004('0x36')];if(!_0x4e7849[_0x7004('0x32')][_0x7004('0x39')]('nolimit')){_0x50468d[_0x7004('0x21')]=qs[_0x7004('0x21')](_0x4e7849[_0x7004('0x32')][_0x7004('0x21')]);_0x50468d[_0x7004('0x1f')]=qs['offset'](_0x4e7849[_0x7004('0x32')][_0x7004('0x1f')]);}_0x50468d[_0x7004('0x3a')]=qs[_0x7004('0x3b')](_0x4e7849[_0x7004('0x32')][_0x7004('0x3b')]);_0x50468d['where']=qs['filters'](_['pick'](_0x4e7849[_0x7004('0x32')],_0x46f3ec[_0x7004('0x34')]),_0x3c6997);if(_0x4e7849['query']['filter']){_0x50468d['where']=_[_0x7004('0x3c')](_0x50468d[_0x7004('0x3d')],{'$or':_[_0x7004('0x2e')](_0x3c6997,function(_0xbabdbb){if(_0xbabdbb[_0x7004('0x3e')]!==_0x7004('0x3f')){var _0x336e81={};_0x336e81[_0xbabdbb['name']]={'$like':'%'+_0x4e7849[_0x7004('0x32')][_0x7004('0x40')]+'%'};return _0x336e81;}})});}_0x50468d=_['merge']({},_0x50468d,_0x4e7849[_0x7004('0x41')]);var _0x8e33d7={'where':_0x50468d[_0x7004('0x3d')]};return db[_0x7004('0x2f')][_0x7004('0x22')](_0x8e33d7)[_0x7004('0x28')](function(_0x874798){_0x3b0eb0['count']=_0x874798;if(_0x4e7849['query'][_0x7004('0x42')]){_0x50468d['include']=[{'all':!![]}];}return db[_0x7004('0x2f')][_0x7004('0x43')](_0x50468d);})['then'](function(_0x1bd24a){_0x3b0eb0[_0x7004('0x44')]=_0x1bd24a;return _0x3b0eb0;})[_0x7004('0x28')](respondWithFilteredResult(_0x537fbc,_0x50468d))['catch'](handleError(_0x537fbc,null));};exports[_0x7004('0x45')]=function(_0x27bbf5,_0x51eb2d){var _0x551107={'raw':!![],'where':{'id':_0x27bbf5['params']['id']}},_0x2a9c75={};_0x2a9c75[_0x7004('0x36')]=_[_0x7004('0x33')](db['JscriptySessionReport'][_0x7004('0x30')]);_0x2a9c75[_0x7004('0x32')]=_['keys'](_0x27bbf5[_0x7004('0x32')]);_0x2a9c75[_0x7004('0x34')]=_['intersection'](_0x2a9c75[_0x7004('0x36')],_0x2a9c75[_0x7004('0x32')]);_0x551107[_0x7004('0x37')]=_[_0x7004('0x35')](_0x2a9c75['model'],qs[_0x7004('0x38')](_0x27bbf5['query']['fields']));_0x551107['attributes']=_0x551107[_0x7004('0x37')][_0x7004('0x46')]?_0x551107[_0x7004('0x37')]:_0x2a9c75['model'];if(_0x27bbf5[_0x7004('0x32')]['includeAll']){_0x551107[_0x7004('0x47')]=[{'all':!![]}];}_0x551107=_['merge']({},_0x551107,_0x27bbf5['options']);return db[_0x7004('0x2f')][_0x7004('0x48')](_0x551107)[_0x7004('0x28')](handleEntityNotFound(_0x51eb2d,null))[_0x7004('0x28')](respondWithResult(_0x51eb2d,null))[_0x7004('0x49')](handleError(_0x51eb2d,null));};exports[_0x7004('0x4a')]=function(_0x32bf30,_0x1d41db){return db[_0x7004('0x2f')]['create'](_0x32bf30[_0x7004('0x4b')],{})[_0x7004('0x28')](respondWithResult(_0x1d41db,0xc9))[_0x7004('0x49')](handleError(_0x1d41db,null));};exports['update']=function(_0x367a7f,_0x518ea3){if(_0x367a7f[_0x7004('0x4b')]['id']){delete _0x367a7f[_0x7004('0x4b')]['id'];}return db[_0x7004('0x2f')][_0x7004('0x48')]({'where':{'id':_0x367a7f[_0x7004('0x4c')]['id']}})[_0x7004('0x28')](handleEntityNotFound(_0x518ea3,null))[_0x7004('0x28')](saveUpdates(_0x367a7f[_0x7004('0x4b')],null))[_0x7004('0x28')](respondWithResult(_0x518ea3,null))['catch'](handleError(_0x518ea3,null));};exports['destroy']=function(_0x432268,_0x1d6606){return db[_0x7004('0x2f')][_0x7004('0x48')]({'where':{'id':_0x432268[_0x7004('0x4c')]['id']}})[_0x7004('0x28')](handleEntityNotFound(_0x1d6606,null))[_0x7004('0x28')](removeEntity(_0x1d6606,null))['catch'](handleError(_0x1d6606,null));};exports['describe']=function(_0x2c5eb9,_0x3ddd4e){return db[_0x7004('0x2f')][_0x7004('0x4d')]()[_0x7004('0x28')](respondWithResult(_0x3ddd4e,null))['catch'](handleError(_0x3ddd4e,null));};exports[_0x7004('0x4e')]=function(_0x4242ca,_0x413abe,_0x3188f6){var _0x5d7d4f={'raw':!![],'where':{}};var _0x325312={};var _0x37a20a={'count':0x0,'rows':[]};return db[_0x7004('0x2f')][_0x7004('0x4f')]({'where':{'id':_0x4242ca['params']['id']}})[_0x7004('0x28')](handleEntityNotFound(_0x413abe,null))['then'](function(_0x3c6f0d){if(_0x3c6f0d){_0x325312[_0x7004('0x36')]=_[_0x7004('0x33')](db[_0x7004('0x50')]['rawAttributes']);_0x325312[_0x7004('0x32')]=_[_0x7004('0x33')](_0x4242ca['query']);_0x325312[_0x7004('0x34')]=_['intersection'](_0x325312[_0x7004('0x36')],_0x325312[_0x7004('0x32')]);_0x5d7d4f['attributes']=_[_0x7004('0x35')](_0x325312[_0x7004('0x36')],qs[_0x7004('0x38')](_0x4242ca[_0x7004('0x32')][_0x7004('0x38')]));_0x5d7d4f[_0x7004('0x37')]=_0x5d7d4f[_0x7004('0x37')]['length']?_0x5d7d4f[_0x7004('0x37')]:_0x325312['model'];if(!_0x4242ca[_0x7004('0x32')][_0x7004('0x39')](_0x7004('0x51'))){_0x5d7d4f[_0x7004('0x21')]=qs[_0x7004('0x21')](_0x4242ca[_0x7004('0x32')][_0x7004('0x21')]);_0x5d7d4f['offset']=qs['offset'](_0x4242ca[_0x7004('0x32')][_0x7004('0x1f')]);}_0x5d7d4f[_0x7004('0x3a')]=qs[_0x7004('0x3b')](_0x4242ca[_0x7004('0x32')][_0x7004('0x3b')]);_0x5d7d4f[_0x7004('0x3d')]=qs[_0x7004('0x34')](_['pick'](_0x4242ca[_0x7004('0x32')],_0x325312['filters']));_0x5d7d4f[_0x7004('0x3d')][_0x7004('0x52')]=_0x3c6f0d['id'];if(_0x4242ca[_0x7004('0x32')][_0x7004('0x40')]){_0x5d7d4f[_0x7004('0x3d')]=_[_0x7004('0x3c')](_0x5d7d4f['where'],{'$or':_[_0x7004('0x2e')](_0x5d7d4f['attributes'],function(_0x39415c){var _0x46311b={};_0x46311b[_0x39415c]={'$like':'%'+_0x4242ca[_0x7004('0x32')]['filter']+'%'};return _0x46311b;})});}_0x5d7d4f=_[_0x7004('0x3c')]({},_0x5d7d4f,_0x4242ca['options']);return db[_0x7004('0x50')][_0x7004('0x22')]({'where':_0x5d7d4f[_0x7004('0x3d')]})['then'](function(_0x3106cd){_0x37a20a['count']=_0x3106cd;if(_0x4242ca[_0x7004('0x32')]['includeAll']){_0x5d7d4f[_0x7004('0x47')]=[{'all':!![]}];}return db[_0x7004('0x50')]['findAll'](_0x5d7d4f);})[_0x7004('0x28')](function(_0x468a47){_0x37a20a['rows']=_0x468a47;return _0x37a20a;});}})[_0x7004('0x28')](respondWithFilteredResult(_0x413abe,_0x5d7d4f))['catch'](handleError(_0x413abe,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 33a906b..24536f1 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.model.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x323f=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x5cdb4e,_0x4233b2){var _0x30a04d=function(_0x1b5c6a){while(--_0x1b5c6a){_0x5cdb4e['push'](_0x5cdb4e['shift']());}};_0x30a04d(++_0x4233b2);}(_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 logger=require('../../config/logger')(_0xf323('0x1'));var moment=require(_0xf323('0x2'));var BPromise=require(_0xf323('0x3'));var rp=require(_0xf323('0x4'));var fs=require('fs');var path=require(_0xf323('0x5'));var rimraf=require(_0xf323('0x6'));var config=require(_0xf323('0x7'));var attributes=require(_0xf323('0x8'));module[_0xf323('0x9')]=function(_0x371707,_0x5d7d60){return _0x371707[_0xf323('0xa')](_0xf323('0xb'),attributes,{'tableName':_0xf323('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x885a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x885a,0x180));var _0xa885=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x885a[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xa885('0x0'));var logger=require(_0xa885('0x1'))(_0xa885('0x2'));var moment=require(_0xa885('0x3'));var BPromise=require('bluebird');var rp=require(_0xa885('0x4'));var fs=require('fs');var path=require(_0xa885('0x5'));var rimraf=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var attributes=require(_0xa885('0x8'));module[_0xa885('0x9')]=function(_0x5dfd7e,_0x7ac6bd){return _0x5dfd7e[_0xa885('0xa')](_0xa885('0xb'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index b3420df..1c51c84 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4745=['debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x16ec7f,_0x55d7fe){var _0x41dde3=function(_0x474dab){while(--_0x474dab){_0x16ec7f['push'](_0x16ec7f['shift']());}};_0x41dde3(++_0x55d7fe);}(_0x4745,0x1e7));var _0x5474=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x4745[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var moment=require(_0x5474('0x2'));var BPromise=require(_0x5474('0x3'));var rs=require(_0x5474('0x4'));var fs=require('fs');var Redis=require(_0x5474('0x5'));var db=require(_0x5474('0x6'))['db'];var utils=require(_0x5474('0x7'));var logger=require(_0x5474('0x8'))(_0x5474('0x9'));var config=require(_0x5474('0xa'));var jayson=require(_0x5474('0xb'));var client=jayson['client'][_0x5474('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x431f81,_0x57add7,_0x13929f){return new BPromise(function(_0x5d778b,_0x902ba8){return client[_0x5474('0xd')](_0x431f81,_0x13929f)['then'](function(_0xf876f8){logger[_0x5474('0xe')](_0x5474('0xf'),_0x57add7,_0x5474('0x10'));logger[_0x5474('0x11')](_0x5474('0x12'),_0x57add7,_0x5474('0x10'),JSON[_0x5474('0x13')](_0xf876f8));if(_0xf876f8['error']){if(_0xf876f8[_0x5474('0x14')][_0x5474('0x15')]===0x1f4){logger[_0x5474('0x14')](_0x5474('0xf'),_0x57add7,_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);return _0x902ba8(_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);}logger[_0x5474('0x14')]('JscriptySessionReport,\x20%s,\x20%s',_0x57add7,_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);return _0x5d778b(_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x57add7,'request\x20sent');_0x5d778b(_0xf876f8['result'][_0x5474('0x16')]);}})[_0x5474('0x17')](function(_0x2da774){logger['error'](_0x5474('0xf'),_0x57add7,_0x2da774);_0x902ba8(_0x2da774);});});} \ No newline at end of file +var _0x81c6=['stringify','code','error','message','info','result','catch','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x81c6,0x1d5));var _0x681c=function(_0x297d6f,_0x12c8be){_0x297d6f=_0x297d6f-0x0;var _0x4e0852=_0x81c6[_0x297d6f];return _0x4e0852;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x681c('0x1'));var db=require(_0x681c('0x2'))['db'];var utils=require(_0x681c('0x3'));var logger=require('../../config/logger')(_0x681c('0x4'));var config=require(_0x681c('0x5'));var jayson=require(_0x681c('0x6'));var client=jayson[_0x681c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45331,_0xdc57a5,_0x5624d7){return new BPromise(function(_0x5b5f22,_0x1750e2){return client[_0x681c('0x8')](_0x45331,_0x5624d7)[_0x681c('0x9')](function(_0x5de78e){logger['info'](_0x681c('0xa'),_0xdc57a5,'request\x20sent');logger[_0x681c('0xb')](_0x681c('0xc'),_0xdc57a5,_0x681c('0xd'),JSON[_0x681c('0xe')](_0x5de78e));if(_0x5de78e['error']){if(_0x5de78e['error'][_0x681c('0xf')]===0x1f4){logger[_0x681c('0x10')](_0x681c('0xa'),_0xdc57a5,_0x5de78e['error'][_0x681c('0x11')]);return _0x1750e2(_0x5de78e['error'][_0x681c('0x11')]);}logger['error'](_0x681c('0xa'),_0xdc57a5,_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);return _0x5b5f22(_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);}else{logger[_0x681c('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0xdc57a5,_0x681c('0xd'));_0x5b5f22(_0x5de78e[_0x681c('0x13')][_0x681c('0x11')]);}})[_0x681c('0x14')](function(_0x2fce11){logger[_0x681c('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0xdc57a5,_0x2fce11);_0x1750e2(_0x2fce11);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 04c7e6a..f884502 100644 --- a/server/api/license/index.js +++ b/server/api/license/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x51b5=['isAuthenticated','get','downloadLogFile','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','index','put','/:id'];(function(_0xeb7c4b,_0x278027){var _0x110149=function(_0x399cb3){while(--_0x399cb3){_0xeb7c4b['push'](_0xeb7c4b['shift']());}};_0x110149(++_0x278027);}(_0x51b5,0x115));var _0x551b=function(_0x54e1b4,_0xe01f37){_0x54e1b4=_0x54e1b4-0x0;var _0x3f55cd=_0x51b5[_0x54e1b4];return _0x3f55cd;};'use strict';var multer=require(_0x551b('0x0'));var util=require(_0x551b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x551b('0x2'));var router=express['Router']();var fs_extra=require(_0x551b('0x3'));var auth=require(_0x551b('0x4'));var interaction=require(_0x551b('0x5'));var config=require('../../config/environment');var controller=require('./license.controller');router['get']('/',controller[_0x551b('0x6')]);router[_0x551b('0x7')](_0x551b('0x8'),auth[_0x551b('0x9')](),controller['update']);router[_0x551b('0xa')]('/download_log_file',auth[_0x551b('0x9')](),controller[_0x551b('0xb')]);module[_0x551b('0xc')]=router; \ No newline at end of file +var _0xf74a=['update','get','/download_log_file','downloadLogFile','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','put','/:id','isAuthenticated'];(function(_0x2e9a8f,_0x3b09ac){var _0x439855=function(_0x394eae){while(--_0x394eae){_0x2e9a8f['push'](_0x2e9a8f['shift']());}};_0x439855(++_0x3b09ac);}(_0xf74a,0x1ae));var _0xaf74=function(_0x162bb6,_0x1eb9c2){_0x162bb6=_0x162bb6-0x0;var _0x5618e8=_0xf74a[_0x162bb6];return _0x5618e8;};'use strict';var multer=require(_0xaf74('0x0'));var util=require(_0xaf74('0x1'));var path=require('path');var timeout=require(_0xaf74('0x2'));var express=require(_0xaf74('0x3'));var router=express['Router']();var fs_extra=require(_0xaf74('0x4'));var auth=require(_0xaf74('0x5'));var interaction=require(_0xaf74('0x6'));var config=require(_0xaf74('0x7'));var controller=require(_0xaf74('0x8'));router['get']('/',controller['index']);router[_0xaf74('0x9')](_0xaf74('0xa'),auth[_0xaf74('0xb')](),controller[_0xaf74('0xc')]);router[_0xaf74('0xd')](_0xaf74('0xe'),auth[_0xaf74('0xb')](),controller[_0xaf74('0xf')]);module[_0xaf74('0x10')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 0793c8b..0c348c6 100644 --- a/server/api/license/license.attributes.js +++ b/server/api/license/license.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeff7=['sequelize','STRING','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeff7,0xd2));var _0x7eff=function(_0x988781,_0x26c696){_0x988781=_0x988781-0x0;var _0x1d33a7=_0xeff7[_0x988781];return _0x1d33a7;};'use strict';var Sequelize=require(_0x7eff('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x7eff('0x1')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x7eff('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1ed8=['STRING','INTEGER','exports','TEXT'];(function(_0x15299d,_0x16548f){var _0x969422=function(_0x287c0a){while(--_0x287c0a){_0x15299d['push'](_0x15299d['shift']());}};_0x969422(++_0x16548f);}(_0x1ed8,0x112));var _0x81ed=function(_0x212f18,_0xcb14b0){_0x212f18=_0x212f18-0x0;var _0x429484=_0x1ed8[_0x212f18];return _0x429484;};'use strict';var Sequelize=require('sequelize');module[_0x81ed('0x0')]={'license':{'type':Sequelize[_0x81ed('0x1')]},'data1':{'type':Sequelize[_0x81ed('0x2')]},'data2':{'type':Sequelize[_0x81ed('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x81ed('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 4c9685e..7ef0c63 100644 --- a/server/api/license/license.controller.js +++ b/server/api/license/license.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x40ad=['checkLicense','demo','catch','downloadLogFile','license-info.log','join','/var','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','json','offset','undefined','Content-Range','apply','reject','save','update','then','error','stack','name','send','../../config/license/util','model','keys','License','rawAttributes','query','filters','attributes','intersection','fields','length','merge','options','getLicense','body','find','params'];(function(_0x45b6d4,_0x2ec49d){var _0x456012=function(_0x428e93){while(--_0x428e93){_0x45b6d4['push'](_0x45b6d4['shift']());}};_0x456012(++_0x2ec49d);}(_0x40ad,0x18d));var _0xd40a=function(_0x1a393d,_0x203e50){_0x1a393d=_0x1a393d-0x0;var _0x35aecb=_0x40ad[_0x1a393d];return _0x35aecb;};'use strict';var emlformat=require(_0xd40a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd40a('0x1'));var jsonpatch=require(_0xd40a('0x2'));var rp=require(_0xd40a('0x3'));var moment=require(_0xd40a('0x4'));var BPromise=require(_0xd40a('0x5'));var Mustache=require(_0xd40a('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xd40a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd40a('0x8'));var _=require('lodash');var squel=require(_0xd40a('0x9'));var crypto=require('crypto');var jsforce=require(_0xd40a('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xd40a('0x7'));var querystring=require('querystring');var Papa=require(_0xd40a('0xb'));var Redis=require(_0xd40a('0xc'));var authService=require(_0xd40a('0xd'));var qs=require(_0xd40a('0xe'));var as=require(_0xd40a('0xf'));var hardwareService=require(_0xd40a('0x10'));var logger=require(_0xd40a('0x11'))(_0xd40a('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a112b,_0x468a18){_0x468a18=_0x468a18||0xcc;return function(_0x24db40){if(_0x24db40){return _0x5a112b[_0xd40a('0x13')](_0x468a18);}return _0x5a112b[_0xd40a('0x14')](_0x468a18)['end']();};}function respondWithResult(_0x26345d,_0x470c3c){_0x470c3c=_0x470c3c||0xc8;return function(_0x8c508b){if(_0x8c508b){return _0x26345d[_0xd40a('0x14')](_0x470c3c)[_0xd40a('0x15')](_0x8c508b);}};}function respondWithFilteredResult(_0x290ee4,_0x4d7e3f){return function(_0x3673bd){if(_0x3673bd){var _0x56c92d=typeof _0x4d7e3f[_0xd40a('0x16')]==='undefined'&&typeof _0x4d7e3f['limit']===_0xd40a('0x17');var _0x2e301f=_0x3673bd['count'];var _0x19d729=_0x56c92d?0x0:_0x4d7e3f[_0xd40a('0x16')];var _0x52d734=_0x56c92d?_0x3673bd['count']:_0x4d7e3f[_0xd40a('0x16')]+_0x4d7e3f['limit'];var _0x100115;if(_0x52d734>=_0x2e301f){_0x52d734=_0x2e301f;_0x100115=0xc8;}else{_0x100115=0xce;}_0x290ee4[_0xd40a('0x14')](_0x100115);return _0x290ee4['set'](_0xd40a('0x18'),_0x19d729+'-'+_0x52d734+'/'+_0x2e301f)[_0xd40a('0x15')](_0x3673bd);}return null;};}function patchUpdates(_0x35d403){return function(_0x4ad37d){try{jsonpatch[_0xd40a('0x19')](_0x4ad37d,_0x35d403,!![]);}catch(_0x270a2b){return BPromise[_0xd40a('0x1a')](_0x270a2b);}return _0x4ad37d[_0xd40a('0x1b')]();};}function saveUpdates(_0x37a6d1,_0x4a5356){return function(_0x18dbfe){if(_0x18dbfe){return _0x18dbfe[_0xd40a('0x1c')](_0x37a6d1)[_0xd40a('0x1d')](function(_0xe0b8f7){return _0xe0b8f7;});}return null;};}function removeEntity(_0x401f0d,_0x167f00){return function(_0x55f1da){if(_0x55f1da){return _0x55f1da['destroy']()[_0xd40a('0x1d')](function(){_0x401f0d[_0xd40a('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x212749,_0x2e46a3){return function(_0x2f882d){if(!_0x2f882d){_0x212749[_0xd40a('0x13')](0x194);}return _0x2f882d;};}function handleError(_0x3af3c5,_0x4bf74d){_0x4bf74d=_0x4bf74d||0x1f4;return function(_0x5541bb){logger[_0xd40a('0x1e')](_0x5541bb[_0xd40a('0x1f')]);if(_0x5541bb['name']){delete _0x5541bb[_0xd40a('0x20')];}_0x3af3c5['status'](_0x4bf74d)[_0xd40a('0x21')](_0x5541bb);};}var utilLicense=require(_0xd40a('0x22'));exports['index']=function(_0x27a6ea,_0x3d2453){var _0x2808ba={'raw':!![],'where':{'id':0x1}},_0x16b9ac={};_0x16b9ac[_0xd40a('0x23')]=_[_0xd40a('0x24')](db[_0xd40a('0x25')][_0xd40a('0x26')]);_0x16b9ac[_0xd40a('0x27')]=_[_0xd40a('0x24')](_0x27a6ea[_0xd40a('0x27')]);_0x16b9ac[_0xd40a('0x28')]=_['intersection'](_0x16b9ac[_0xd40a('0x23')],_0x16b9ac[_0xd40a('0x27')]);_0x2808ba[_0xd40a('0x29')]=_[_0xd40a('0x2a')](_0x16b9ac[_0xd40a('0x23')],qs[_0xd40a('0x2b')](_0x27a6ea[_0xd40a('0x27')][_0xd40a('0x2b')]));_0x2808ba[_0xd40a('0x29')]=_0x2808ba[_0xd40a('0x29')][_0xd40a('0x2c')]?_0x2808ba['attributes']:_0x16b9ac[_0xd40a('0x23')];_0x2808ba=_[_0xd40a('0x2d')]({},_0x2808ba,_0x27a6ea[_0xd40a('0x2e')]);return utilLicense[_0xd40a('0x2f')](_0x2808ba)[_0xd40a('0x1d')](respondWithResult(_0x3d2453,null))['catch'](handleError(_0x3d2453,null));};exports['update']=function(_0x463f0d,_0x5203c3){if(_0x463f0d[_0xd40a('0x30')]['id']){delete _0x463f0d[_0xd40a('0x30')]['id'];}return db[_0xd40a('0x25')][_0xd40a('0x31')]({'where':{'id':_0x463f0d[_0xd40a('0x32')]['id']}})[_0xd40a('0x1d')](handleEntityNotFound(_0x5203c3,null))[_0xd40a('0x1d')](function(_0x4b6bfb){var _0x34dac3=_0x4b6bfb['get']({'plain':!![]});return utilLicense[_0xd40a('0x33')](_0x34dac3,_0x463f0d['body']['key']);})[_0xd40a('0x1d')](function(_0xf9cff0){if(!_0xf9cff0[_0xd40a('0x34')]){return saveUpdates(_0x463f0d['body'],null);}return _0xf9cff0;})['then'](respondWithResult(_0x5203c3,null))[_0xd40a('0x35')](handleError(_0x5203c3,null));};exports[_0xd40a('0x36')]=function(_0x198cc4,_0x43cb31){var _0x4b08f9=_0xd40a('0x37');var _0x4a17bf=path[_0xd40a('0x38')](_0xd40a('0x39'),'log','xcally',_0x4b08f9);_0x43cb31[_0xd40a('0x3a')](_0xd40a('0x3b'),_0xd40a('0x3c')+_0x4b08f9);_0x43cb31['set'](_0xd40a('0x3d'),_0xd40a('0x3e'));_0x43cb31[_0xd40a('0x3f')](_0x4a17bf);}; \ No newline at end of file +var _0x9f34=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','keys','License','rawAttributes','query','filters','intersection','fields','attributes','length','model','merge','catch','find','params','get','checkLicense','body','key','demo','join','/var','log','xcally','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x17bc8f,_0x4f5c9e){var _0x2ee48e=function(_0x500ae6){while(--_0x500ae6){_0x17bc8f['push'](_0x17bc8f['shift']());}};_0x2ee48e(++_0x4f5c9e);}(_0x9f34,0x193));var _0x49f3=function(_0x380b08,_0x1df63a){_0x380b08=_0x380b08-0x0;var _0x22f65d=_0x9f34[_0x380b08];return _0x22f65d;};'use strict';var emlformat=require(_0x49f3('0x0'));var rimraf=require(_0x49f3('0x1'));var zipdir=require(_0x49f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x49f3('0x3'));var moment=require('moment');var BPromise=require(_0x49f3('0x4'));var Mustache=require(_0x49f3('0x5'));var util=require(_0x49f3('0x6'));var path=require(_0x49f3('0x7'));var sox=require(_0x49f3('0x8'));var csv=require(_0x49f3('0x9'));var ejs=require(_0x49f3('0xa'));var fs=require('fs');var fs_extra=require(_0x49f3('0xb'));var _=require(_0x49f3('0xc'));var squel=require('squel');var crypto=require(_0x49f3('0xd'));var jsforce=require(_0x49f3('0xe'));var deskjs=require(_0x49f3('0xf'));var toCsv=require(_0x49f3('0x9'));var querystring=require(_0x49f3('0x10'));var Papa=require(_0x49f3('0x11'));var Redis=require(_0x49f3('0x12'));var authService=require(_0x49f3('0x13'));var qs=require(_0x49f3('0x14'));var as=require(_0x49f3('0x15'));var hardwareService=require(_0x49f3('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x49f3('0x17'));var licenseUtil=require(_0x49f3('0x18'));var db=require(_0x49f3('0x19'))['db'];function respondWithStatusCode(_0x5c31e9,_0x4caebf){_0x4caebf=_0x4caebf||0xcc;return function(_0x3634a5){if(_0x3634a5){return _0x5c31e9[_0x49f3('0x1a')](_0x4caebf);}return _0x5c31e9[_0x49f3('0x1b')](_0x4caebf)[_0x49f3('0x1c')]();};}function respondWithResult(_0x92b177,_0xa11a2a){_0xa11a2a=_0xa11a2a||0xc8;return function(_0xa5f443){if(_0xa5f443){return _0x92b177[_0x49f3('0x1b')](_0xa11a2a)['json'](_0xa5f443);}};}function respondWithFilteredResult(_0x4fecb7,_0x4d203e){return function(_0x286366){if(_0x286366){var _0x4d352b=typeof _0x4d203e[_0x49f3('0x1d')]==='undefined'&&typeof _0x4d203e[_0x49f3('0x1e')]==='undefined';var _0x202297=_0x286366[_0x49f3('0x1f')];var _0x2e4838=_0x4d352b?0x0:_0x4d203e[_0x49f3('0x1d')];var _0xf239c3=_0x4d352b?_0x286366[_0x49f3('0x1f')]:_0x4d203e[_0x49f3('0x1d')]+_0x4d203e['limit'];var _0x601892;if(_0xf239c3>=_0x202297){_0xf239c3=_0x202297;_0x601892=0xc8;}else{_0x601892=0xce;}_0x4fecb7[_0x49f3('0x1b')](_0x601892);return _0x4fecb7[_0x49f3('0x20')](_0x49f3('0x21'),_0x2e4838+'-'+_0xf239c3+'/'+_0x202297)['json'](_0x286366);}return null;};}function patchUpdates(_0x102b03){return function(_0x1d9459){try{jsonpatch[_0x49f3('0x22')](_0x1d9459,_0x102b03,!![]);}catch(_0x1a3282){return BPromise[_0x49f3('0x23')](_0x1a3282);}return _0x1d9459['save']();};}function saveUpdates(_0x303707,_0x4bbc3f){return function(_0x208f2f){if(_0x208f2f){return _0x208f2f[_0x49f3('0x24')](_0x303707)[_0x49f3('0x25')](function(_0x54bd2b){return _0x54bd2b;});}return null;};}function removeEntity(_0x3585dc,_0x1ac95a){return function(_0x26109f){if(_0x26109f){return _0x26109f[_0x49f3('0x26')]()[_0x49f3('0x25')](function(){_0x3585dc['status'](0xcc)[_0x49f3('0x1c')]();});}};}function handleEntityNotFound(_0x1c0e19,_0x16cf67){return function(_0x78e716){if(!_0x78e716){_0x1c0e19[_0x49f3('0x1a')](0x194);}return _0x78e716;};}function handleError(_0xb14fb,_0x4142f0){_0x4142f0=_0x4142f0||0x1f4;return function(_0x4d7f74){logger[_0x49f3('0x27')](_0x4d7f74[_0x49f3('0x28')]);if(_0x4d7f74['name']){delete _0x4d7f74[_0x49f3('0x29')];}_0xb14fb[_0x49f3('0x1b')](_0x4142f0)['send'](_0x4d7f74);};}var utilLicense=require(_0x49f3('0x18'));exports['index']=function(_0x66f5da,_0x94e4cb){var _0x48f6ef={'raw':!![],'where':{'id':0x1}},_0x1c6a9e={};_0x1c6a9e['model']=_[_0x49f3('0x2a')](db[_0x49f3('0x2b')][_0x49f3('0x2c')]);_0x1c6a9e[_0x49f3('0x2d')]=_['keys'](_0x66f5da[_0x49f3('0x2d')]);_0x1c6a9e[_0x49f3('0x2e')]=_[_0x49f3('0x2f')](_0x1c6a9e['model'],_0x1c6a9e[_0x49f3('0x2d')]);_0x48f6ef['attributes']=_[_0x49f3('0x2f')](_0x1c6a9e['model'],qs['fields'](_0x66f5da[_0x49f3('0x2d')][_0x49f3('0x30')]));_0x48f6ef[_0x49f3('0x31')]=_0x48f6ef[_0x49f3('0x31')][_0x49f3('0x32')]?_0x48f6ef[_0x49f3('0x31')]:_0x1c6a9e[_0x49f3('0x33')];_0x48f6ef=_[_0x49f3('0x34')]({},_0x48f6ef,_0x66f5da['options']);return utilLicense['getLicense'](_0x48f6ef)[_0x49f3('0x25')](respondWithResult(_0x94e4cb,null))[_0x49f3('0x35')](handleError(_0x94e4cb,null));};exports['update']=function(_0x1b0f12,_0x12c661){if(_0x1b0f12['body']['id']){delete _0x1b0f12['body']['id'];}return db[_0x49f3('0x2b')][_0x49f3('0x36')]({'where':{'id':_0x1b0f12[_0x49f3('0x37')]['id']}})[_0x49f3('0x25')](handleEntityNotFound(_0x12c661,null))[_0x49f3('0x25')](function(_0x12e67e){var _0x5b602b=_0x12e67e[_0x49f3('0x38')]({'plain':!![]});return utilLicense[_0x49f3('0x39')](_0x5b602b,_0x1b0f12[_0x49f3('0x3a')][_0x49f3('0x3b')]);})[_0x49f3('0x25')](function(_0x237b58){if(!_0x237b58[_0x49f3('0x3c')]){return saveUpdates(_0x1b0f12['body'],null);}return _0x237b58;})[_0x49f3('0x25')](respondWithResult(_0x12c661,null))['catch'](handleError(_0x12c661,null));};exports['downloadLogFile']=function(_0x40cab1,_0x56f4c1){var _0x42add1='license-info.log';var _0x548062=path[_0x49f3('0x3d')](_0x49f3('0x3e'),_0x49f3('0x3f'),_0x49f3('0x40'),_0x42add1);_0x56f4c1['setHeader'](_0x49f3('0x41'),_0x49f3('0x42')+_0x42add1);_0x56f4c1[_0x49f3('0x20')](_0x49f3('0x43'),_0x49f3('0x44'));_0x56f4c1[_0x49f3('0x45')](_0x548062);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 46cf556..48b5b8e 100644 --- a/server/api/license/license.model.js +++ b/server/api/license/license.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9156=['License','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./license.attributes','define'];(function(_0x52f6f9,_0x3bbb5d){var _0x4f4e22=function(_0x3782fb){while(--_0x3782fb){_0x52f6f9['push'](_0x52f6f9['shift']());}};_0x4f4e22(++_0x3bbb5d);}(_0x9156,0x155));var _0x6915=function(_0x59fb00,_0x22b38e){_0x59fb00=_0x59fb00-0x0;var _0x8d627c=_0x9156[_0x59fb00];return _0x8d627c;};'use strict';var _=require(_0x6915('0x0'));var util=require(_0x6915('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6915('0x2'));var BPromise=require('bluebird');var rp=require(_0x6915('0x3'));var fs=require('fs');var path=require(_0x6915('0x4'));var rimraf=require(_0x6915('0x5'));var config=require(_0x6915('0x6'));var attributes=require(_0x6915('0x7'));module['exports']=function(_0x5eec15,_0x44951f){return _0x5eec15[_0x6915('0x8')](_0x6915('0x9'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74c8=['request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License','license','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4bdf64,_0x27c4c2){var _0x12b580=function(_0x3df42a){while(--_0x3df42a){_0x4bdf64['push'](_0x4bdf64['shift']());}};_0x12b580(++_0x27c4c2);}(_0x74c8,0x126));var _0x874c=function(_0x2a8167,_0x2ce9d0){_0x2a8167=_0x2a8167-0x0;var _0x483e55=_0x74c8[_0x2a8167];return _0x483e55;};'use strict';var _=require(_0x874c('0x0'));var util=require(_0x874c('0x1'));var logger=require(_0x874c('0x2'))(_0x874c('0x3'));var moment=require(_0x874c('0x4'));var BPromise=require(_0x874c('0x5'));var rp=require(_0x874c('0x6'));var fs=require('fs');var path=require(_0x874c('0x7'));var rimraf=require(_0x874c('0x8'));var config=require(_0x874c('0x9'));var attributes=require(_0x874c('0xa'));module[_0x874c('0xb')]=function(_0x56c567,_0x5da609){return _0x56c567[_0x874c('0xc')](_0x874c('0xd'),attributes,{'tableName':_0x874c('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 6f465cf..eb34959 100644 --- a/server/api/license/license.rpc.js +++ b/server/api/license/license.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x468b=['util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x354cb7,_0x158fb7){var _0x1f7fcf=function(_0x38d062){while(--_0x38d062){_0x354cb7['push'](_0x354cb7['shift']());}};_0x1f7fcf(++_0x158fb7);}(_0x468b,0x1a1));var _0xb468=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x468b[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xb468('0x0'));var util=require(_0xb468('0x1'));var moment=require(_0xb468('0x2'));var BPromise=require('bluebird');var rs=require(_0xb468('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb468('0x4'));var logger=require(_0xb468('0x5'))(_0xb468('0x6'));var config=require(_0xb468('0x7'));var jayson=require(_0xb468('0x8'));var client=jayson['client'][_0xb468('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b0cb0,_0x33d6bf,_0x22f569){return new BPromise(function(_0x111a75,_0x36c7fd){return client[_0xb468('0xa')](_0x5b0cb0,_0x22f569)['then'](function(_0x154e9c){logger[_0xb468('0xb')](_0xb468('0xc'),_0x33d6bf,_0xb468('0xd'));logger[_0xb468('0xe')](_0xb468('0xf'),_0x33d6bf,_0xb468('0xd'),JSON[_0xb468('0x10')](_0x154e9c));if(_0x154e9c[_0xb468('0x11')]){if(_0x154e9c[_0xb468('0x11')][_0xb468('0x12')]===0x1f4){logger[_0xb468('0x11')](_0xb468('0xc'),_0x33d6bf,_0x154e9c[_0xb468('0x11')][_0xb468('0x13')]);return _0x36c7fd(_0x154e9c[_0xb468('0x11')][_0xb468('0x13')]);}logger['error'](_0xb468('0xc'),_0x33d6bf,_0x154e9c[_0xb468('0x11')][_0xb468('0x13')]);return _0x111a75(_0x154e9c[_0xb468('0x11')][_0xb468('0x13')]);}else{logger[_0xb468('0xb')](_0xb468('0xc'),_0x33d6bf,_0xb468('0xd'));_0x111a75(_0x154e9c[_0xb468('0x14')][_0xb468('0x13')]);}})[_0xb468('0x15')](function(_0x58af2c){logger[_0xb468('0x11')]('License,\x20%s,\x20%s',_0x33d6bf,_0x58af2c);_0x36c7fd(_0x58af2c);});});} \ No newline at end of file +var _0x20f2=['../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','License,\x20%s,\x20%s','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x423ed1,_0x57e512){var _0x4aa3a4=function(_0x3e04a3){while(--_0x3e04a3){_0x423ed1['push'](_0x423ed1['shift']());}};_0x4aa3a4(++_0x57e512);}(_0x20f2,0xd5));var _0x220f=function(_0x158eb1,_0x4edd1b){_0x158eb1=_0x158eb1-0x0;var _0x29bb95=_0x20f2[_0x158eb1];return _0x29bb95;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x220f('0x0'));var BPromise=require(_0x220f('0x1'));var rs=require(_0x220f('0x2'));var fs=require('fs');var Redis=require(_0x220f('0x3'));var db=require(_0x220f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x220f('0x5'))(_0x220f('0x6'));var config=require(_0x220f('0x7'));var jayson=require(_0x220f('0x8'));var client=jayson[_0x220f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x163a3b,_0x13497c,_0x356d67){return new BPromise(function(_0x3dbbe5,_0x28e876){return client['request'](_0x163a3b,_0x356d67)[_0x220f('0xa')](function(_0xc8dd54){logger[_0x220f('0xb')]('License,\x20%s,\x20%s',_0x13497c,_0x220f('0xc'));logger[_0x220f('0xd')](_0x220f('0xe'),_0x13497c,_0x220f('0xc'),JSON['stringify'](_0xc8dd54));if(_0xc8dd54['error']){if(_0xc8dd54[_0x220f('0xf')][_0x220f('0x10')]===0x1f4){logger['error']('License,\x20%s,\x20%s',_0x13497c,_0xc8dd54['error'][_0x220f('0x11')]);return _0x28e876(_0xc8dd54['error'][_0x220f('0x11')]);}logger[_0x220f('0xf')](_0x220f('0x12'),_0x13497c,_0xc8dd54['error'][_0x220f('0x11')]);return _0x3dbbe5(_0xc8dd54[_0x220f('0xf')][_0x220f('0x11')]);}else{logger[_0x220f('0xb')]('License,\x20%s,\x20%s',_0x13497c,_0x220f('0xc'));_0x3dbbe5(_0xc8dd54[_0x220f('0x13')][_0x220f('0x11')]);}})['catch'](function(_0x56d7d0){logger[_0x220f('0xf')]('License,\x20%s,\x20%s',_0x13497c,_0x56d7d0);_0x28e876(_0x56d7d0);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index f43c0d0..da1d80a 100644 --- a/server/api/mailAccount/index.js +++ b/server/api/mailAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd6f=['getImap','getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','post','/:id/canned_answers','addAnswer','create','addImap','/:id/out_servers','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','send','addAgents','put','update','removeDispositions','delete','removeAnswers','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/in_servers'];(function(_0x5ef161,_0x27d16c){var _0x1c6e9e=function(_0x8fc2a6){while(--_0x8fc2a6){_0x5ef161['push'](_0x5ef161['shift']());}};_0x1c6e9e(++_0x27d16c);}(_0xcd6f,0x112));var _0xfcd6=function(_0x257c25,_0x3a7007){_0x257c25=_0x257c25-0x0;var _0x2eac3e=_0xcd6f[_0x257c25];return _0x2eac3e;};'use strict';var multer=require(_0xfcd6('0x0'));var util=require(_0xfcd6('0x1'));var path=require(_0xfcd6('0x2'));var timeout=require(_0xfcd6('0x3'));var express=require('express');var router=express[_0xfcd6('0x4')]();var fs_extra=require(_0xfcd6('0x5'));var auth=require(_0xfcd6('0x6'));var interaction=require(_0xfcd6('0x7'));var config=require(_0xfcd6('0x8'));var controller=require(_0xfcd6('0x9'));router[_0xfcd6('0xa')]('/',auth[_0xfcd6('0xb')](),controller[_0xfcd6('0xc')]);router[_0xfcd6('0xa')](_0xfcd6('0xd'),auth[_0xfcd6('0xb')](),controller[_0xfcd6('0xe')]);router[_0xfcd6('0xa')](_0xfcd6('0xf'),auth[_0xfcd6('0xb')](),controller[_0xfcd6('0x10')]);router['get'](_0xfcd6('0x11'),auth[_0xfcd6('0xb')](),controller[_0xfcd6('0x12')]);router['get']('/:id/canned_answers',auth[_0xfcd6('0xb')](),controller['getAnswers']);router[_0xfcd6('0xa')](_0xfcd6('0x13'),auth['isAuthenticated'](),controller[_0xfcd6('0x14')]);router['get']('/:id/out_servers',auth['isAuthenticated'](),controller[_0xfcd6('0x15')]);router[_0xfcd6('0xa')]('/:id/interactions',auth[_0xfcd6('0xb')](),controller[_0xfcd6('0x16')]);router['get'](_0xfcd6('0x17'),auth[_0xfcd6('0xb')](),controller[_0xfcd6('0x18')]);router['get'](_0xfcd6('0x19'),auth[_0xfcd6('0xb')](),controller[_0xfcd6('0x1a')]);router[_0xfcd6('0xa')]('/:id/verify',auth['isAuthenticated'](),controller[_0xfcd6('0x1b')]);router[_0xfcd6('0xa')](_0xfcd6('0x1c'),auth[_0xfcd6('0xb')](),controller['getAgents']);router[_0xfcd6('0x1d')](_0xfcd6('0x11'),auth[_0xfcd6('0xb')](),controller['addDisposition']);router['post'](_0xfcd6('0x1e'),auth[_0xfcd6('0xb')](),controller[_0xfcd6('0x1f')]);router[_0xfcd6('0x1d')]('/',auth['isAuthenticated'](),controller[_0xfcd6('0x20')]);router[_0xfcd6('0x1d')](_0xfcd6('0x13'),auth[_0xfcd6('0xb')](),controller[_0xfcd6('0x21')]);router['post'](_0xfcd6('0x22'),auth['isAuthenticated'](),controller[_0xfcd6('0x23')]);router['post'](_0xfcd6('0x24'),auth['isAuthenticated'](),controller[_0xfcd6('0x25')]);router['post'](_0xfcd6('0x17'),auth['isAuthenticated'](),controller[_0xfcd6('0x26')]);router['post'](_0xfcd6('0x27'),auth[_0xfcd6('0xb')](),controller[_0xfcd6('0x28')]);router['post'](_0xfcd6('0x1c'),auth[_0xfcd6('0xb')](),controller[_0xfcd6('0x29')]);router[_0xfcd6('0x2a')](_0xfcd6('0xf'),auth[_0xfcd6('0xb')](),controller[_0xfcd6('0x2b')]);router['delete'](_0xfcd6('0x11'),auth['isAuthenticated'](),controller[_0xfcd6('0x2c')]);router[_0xfcd6('0x2d')]('/:id/canned_answers',auth[_0xfcd6('0xb')](),controller[_0xfcd6('0x2e')]);router['delete'](_0xfcd6('0x13'),auth['isAuthenticated'](),controller['removeImap']);router[_0xfcd6('0x2d')]('/:id/out_servers',auth[_0xfcd6('0xb')](),controller['removeSmtp']);router[_0xfcd6('0x2d')](_0xfcd6('0xf'),auth[_0xfcd6('0xb')](),controller[_0xfcd6('0x2f')]);router[_0xfcd6('0x2d')](_0xfcd6('0x1c'),auth[_0xfcd6('0xb')](),controller['removeAgents']);module[_0xfcd6('0x30')]=router; \ No newline at end of file +var _0x107a=['getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/verify','post','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','/:id/users','addAgents','update','delete','/:id/canned_answers','removeSmtp','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/in_servers'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x107a,0x1a7));var _0xa107=function(_0x46d2a6,_0x43a3b2){_0x46d2a6=_0x46d2a6-0x0;var _0x17752a=_0x107a[_0x46d2a6];return _0x17752a;};'use strict';var multer=require(_0xa107('0x0'));var util=require(_0xa107('0x1'));var path=require(_0xa107('0x2'));var timeout=require(_0xa107('0x3'));var express=require('express');var router=express[_0xa107('0x4')]();var fs_extra=require(_0xa107('0x5'));var auth=require(_0xa107('0x6'));var interaction=require(_0xa107('0x7'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xa107('0x8')]);router[_0xa107('0x9')](_0xa107('0xa'),auth[_0xa107('0xb')](),controller[_0xa107('0xc')]);router['get'](_0xa107('0xd'),auth['isAuthenticated'](),controller[_0xa107('0xe')]);router[_0xa107('0x9')](_0xa107('0xf'),auth[_0xa107('0xb')](),controller['getDispositions']);router[_0xa107('0x9')]('/:id/canned_answers',auth[_0xa107('0xb')](),controller['getAnswers']);router['get'](_0xa107('0x10'),auth[_0xa107('0xb')](),controller[_0xa107('0x11')]);router[_0xa107('0x9')](_0xa107('0x12'),auth['isAuthenticated'](),controller[_0xa107('0x13')]);router['get'](_0xa107('0x14'),auth[_0xa107('0xb')](),controller[_0xa107('0x15')]);router[_0xa107('0x9')](_0xa107('0x16'),auth[_0xa107('0xb')](),controller[_0xa107('0x17')]);router[_0xa107('0x9')](_0xa107('0x18'),auth[_0xa107('0xb')](),controller['getMessages']);router['get'](_0xa107('0x19'),auth[_0xa107('0xb')](),controller['verifySmtp']);router[_0xa107('0x9')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xa107('0x1a')](_0xa107('0xf'),auth[_0xa107('0xb')](),controller['addDisposition']);router[_0xa107('0x1a')]('/:id/canned_answers',auth[_0xa107('0xb')](),controller['addAnswer']);router[_0xa107('0x1a')]('/',auth[_0xa107('0xb')](),controller['create']);router[_0xa107('0x1a')]('/:id/in_servers',auth[_0xa107('0xb')](),controller[_0xa107('0x1b')]);router[_0xa107('0x1a')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0xa107('0x1c')]);router[_0xa107('0x1a')](_0xa107('0x14'),auth[_0xa107('0xb')](),controller[_0xa107('0x1d')]);router[_0xa107('0x1a')](_0xa107('0x16'),auth['isAuthenticated'](),controller[_0xa107('0x1e')]);router[_0xa107('0x1a')](_0xa107('0x1f'),auth[_0xa107('0xb')](),controller[_0xa107('0x20')]);router['post'](_0xa107('0x21'),auth[_0xa107('0xb')](),controller[_0xa107('0x22')]);router['put'](_0xa107('0xd'),auth[_0xa107('0xb')](),controller[_0xa107('0x23')]);router[_0xa107('0x24')](_0xa107('0xf'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xa107('0x24')](_0xa107('0x25'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete']('/:id/in_servers',auth[_0xa107('0xb')](),controller['removeImap']);router[_0xa107('0x24')](_0xa107('0x12'),auth['isAuthenticated'](),controller[_0xa107('0x26')]);router[_0xa107('0x24')](_0xa107('0xd'),auth[_0xa107('0xb')](),controller['destroy']);router[_0xa107('0x24')](_0xa107('0x21'),auth[_0xa107('0xb')](),controller[_0xa107('0x27')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 4b07912..6103990 100644 --- a/server/api/mailAccount/mailAccount.attributes.js +++ b/server/api/mailAccount/mailAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fb3=['custom','provider','sequelize','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','getDataValue'];(function(_0x28b038,_0x49c0e5){var _0x1fc023=function(_0x248190){while(--_0x248190){_0x28b038['push'](_0x28b038['shift']());}};_0x1fc023(++_0x49c0e5);}(_0x5fb3,0x1a0));var _0x35fb=function(_0x597a09,_0x505d07){_0x597a09=_0x597a09-0x0;var _0x49fb54=_0x5fb3[_0x597a09];return _0x49fb54;};'use strict';var Sequelize=require(_0x35fb('0x0'));module[_0x35fb('0x1')]={'description':{'type':Sequelize[_0x35fb('0x2')]},'name':{'type':Sequelize[_0x35fb('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x35fb('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x35fb('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x35fb('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x35fb('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x35fb('0x4')},'fontSize':{'type':Sequelize[_0x35fb('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x35fb('0x6')],'defaultValue':function(){return _0x35fb('0x7');}},'notificationSound':{'type':Sequelize[_0x35fb('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x35fb('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x35fb('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x35fb('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x35fb('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x35fb('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x35fb('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x35fb('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x35fb('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x35fb('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x35fb('0x3')],'defaultValue':![],'comment':_0x35fb('0x9'),'set':function(_0x45297c){if(!_0x45297c)this[_0x35fb('0xa')](_0x35fb('0xb'),null);this[_0x35fb('0xa')](_0x35fb('0xc'),_0x45297c);}},'provider':{'type':Sequelize[_0x35fb('0xd')](_0x35fb('0xe'),'hotmail','yahoo','outlook365'),'defaultValue':null,'get':function(){var _0x434098=this[_0x35fb('0xf')]('provider');return _0x434098||_0x35fb('0x10');},'set':function(_0x30166c){if(_0x30166c===_0x35fb('0x10')){_0x30166c=null;}return this[_0x35fb('0xa')](_0x35fb('0x11'),_0x30166c);}}}; \ No newline at end of file +var _0xf03f=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','ENUM','gmail','hotmail','yahoo','getDataValue','provider','custom','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf03f,0x64));var _0xff03=function(_0x1a12c8,_0x2df4dc){_0x1a12c8=_0x1a12c8-0x0;var _0x305109=_0xf03f[_0x1a12c8];return _0x305109;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0xff03('0x0')]},'name':{'type':Sequelize[_0xff03('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0xff03('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0xff03('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xff03('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0xff03('0x2')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xff03('0x0')],'allowNull':![],'defaultValue':_0xff03('0x3')},'fontSize':{'type':Sequelize[_0xff03('0x4')](0x2)[_0xff03('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xff03('0x2')],'defaultValue':function(){return _0xff03('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xff03('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xff03('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xff03('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0xff03('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xff03('0x1')],'defaultValue':![],'comment':_0xff03('0x8'),'set':function(_0x2b84af){if(!_0x2b84af)this[_0xff03('0x9')](_0xff03('0xa'),null);this[_0xff03('0x9')]('mandatoryDisposition',_0x2b84af);}},'provider':{'type':Sequelize[_0xff03('0xb')](_0xff03('0xc'),_0xff03('0xd'),_0xff03('0xe'),'outlook365'),'defaultValue':null,'get':function(){var _0x113293=this[_0xff03('0xf')](_0xff03('0x10'));return _0x113293||_0xff03('0x11');},'set':function(_0x1bd259){if(_0x1bd259==='custom'){_0x1bd259=null;}return this['setDataValue']('provider',_0x1bd259);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index d6bc141..5bec86c 100644 --- a/server/api/mailAccount/mailAccount.controller.js +++ b/server/api/mailAccount/mailAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8648=['spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','bluebird','util','path','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','destroy','get','MailAccounts','UserProfileResource','stack','name','send','gmail','hotmail','Unknown\x20email\x20service\x20provider','yahoo','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','user','username','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','merge','options','includeAll','findAll','rows','show','params','MailServerOut','Pause','find','update','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','Disposition','getDispositions','findOne','pick','MailAccountId','filter','include','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','removeAnswers','email','active','description','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','MailInteraction','addInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','Contacts','updatedAt','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','SendMail','List','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','CloudProvider','getSmtpOptions','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit'];(function(_0x1b0aa0,_0x4b00ab){var _0x5abafe=function(_0x1a72fe){while(--_0x1a72fe){_0x1b0aa0['push'](_0x1b0aa0['shift']());}};_0x5abafe(++_0x4b00ab);}(_0x8648,0xd1));var _0x8864=function(_0x10e252,_0x30722){_0x10e252=_0x10e252-0x0;var _0x1a7b0f=_0x8648[_0x10e252];return _0x1a7b0f;};'use strict';var moment=require('moment');var BPromise=require(_0x8864('0x0'));var util=require(_0x8864('0x1'));var path=require(_0x8864('0x2'));var _=require('lodash');var juice=require(_0x8864('0x3'));var Redis=require(_0x8864('0x4'));var qs=require(_0x8864('0x5'));var logger=require(_0x8864('0x6'))(_0x8864('0x7'));var config=require(_0x8864('0x8'));var db=require(_0x8864('0x9'))['db'];config['redis']=_[_0x8864('0xa')](config[_0x8864('0xb')],{'host':_0x8864('0xc'),'port':0x18eb});var socket=require(_0x8864('0xd'))(new Redis(config['redis']));require(_0x8864('0xe'))[_0x8864('0xf')](socket);var jayson=require(_0x8864('0x10'));var client=jayson[_0x8864('0x11')][_0x8864('0x12')]({'port':0x232b});function respondWithRpcPromise(_0x5a85e2,_0x47a642,_0x1b5ad6,_0x16351a){return new BPromise(function(_0xc22667,_0x1df210){var _0x380453=_0x16351a||client;return _0x380453[_0x8864('0x13')](_0x5a85e2,_0x1b5ad6)[_0x8864('0x14')](function(_0x22861f){logger[_0x8864('0x15')](_0x8864('0x16'),_0x47a642,_0x8864('0x17'));logger['debug'](_0x8864('0x18'),_0x47a642,_0x8864('0x17'),JSON['stringify'](_0x22861f));if(_0x22861f[_0x8864('0x19')]){if(_0x22861f[_0x8864('0x19')][_0x8864('0x1a')]===0x1f4){logger[_0x8864('0x19')](_0x8864('0x16'),_0x47a642,_0x22861f[_0x8864('0x19')]['message']);return _0x1df210(_0x22861f[_0x8864('0x19')]['message']);}logger[_0x8864('0x19')](_0x8864('0x16'),_0x47a642,_0x22861f['error'][_0x8864('0x1b')]);return _0xc22667(_0x22861f[_0x8864('0x19')]['message']);}else{logger[_0x8864('0x15')]('MailAccount,\x20%s,\x20%s',_0x47a642,'request\x20sent');_0xc22667(_0x22861f[_0x8864('0x1c')][_0x8864('0x1b')]);}})[_0x8864('0x1d')](function(_0x11675c){logger[_0x8864('0x19')](_0x8864('0x16'),_0x47a642,_0x11675c);_0x1df210(_0x11675c);});});}function respondWithStatusCode(_0x4167db,_0x57ffdb){_0x57ffdb=_0x57ffdb||0xcc;return function(_0x5e0744){if(_0x5e0744){return _0x4167db[_0x8864('0x1e')](_0x57ffdb);}return _0x4167db[_0x8864('0x1f')](_0x57ffdb)[_0x8864('0x20')]();};}function respondWithResult(_0x185e00,_0x571791){_0x571791=_0x571791||0xc8;return function(_0x51a244){if(_0x51a244){return _0x185e00['status'](_0x571791)[_0x8864('0x21')](_0x51a244);}};}function respondWithFilteredResult(_0x169773,_0x326f48){return function(_0x12956f){if(_0x12956f){var _0x528d31=typeof _0x326f48['offset']===_0x8864('0x22')&&typeof _0x326f48['limit']===_0x8864('0x22');var _0x29e152=_0x12956f[_0x8864('0x23')];var _0x5557e8=_0x528d31?0x0:_0x326f48[_0x8864('0x24')];var _0x3a489d=_0x528d31?_0x12956f[_0x8864('0x23')]:_0x326f48['offset']+_0x326f48[_0x8864('0x25')];var _0x89a02;if(_0x3a489d>=_0x29e152){_0x3a489d=_0x29e152;_0x89a02=0xc8;}else{_0x89a02=0xce;}_0x169773['status'](_0x89a02);return _0x169773[_0x8864('0x26')](_0x8864('0x27'),_0x5557e8+'-'+_0x3a489d+'/'+_0x29e152)[_0x8864('0x21')](_0x12956f);}return null;};}function saveUpdates(_0x57a03){return function(_0x1bdb76){if(_0x1bdb76){return _0x1bdb76['update'](_0x57a03)['then'](function(_0x3fb73c){return _0x3fb73c;});}return null;};}function removeEntity(_0xd25cd6){return function(_0x59fe94){if(_0x59fe94){return _0x59fe94[_0x8864('0x28')]()[_0x8864('0x14')](function(){var _0x597876=_0x59fe94[_0x8864('0x29')]({'plain':!![]});var _0x38dec0=_0x8864('0x2a');return db[_0x8864('0x2b')][_0x8864('0x28')]({'where':{'type':_0x38dec0,'resourceId':_0x597876['id']}})[_0x8864('0x14')](function(){return _0x59fe94;});})[_0x8864('0x14')](function(){_0xd25cd6['status'](0xcc)[_0x8864('0x20')]();});}};}function handleEntityNotFound(_0x1a797f){return function(_0x50f6fd){if(!_0x50f6fd){_0x1a797f[_0x8864('0x1e')](0x194);}return _0x50f6fd;};}function handleError(_0x3f69cf,_0x443b86){_0x443b86=_0x443b86||0x1f4;return function(_0xd77840){logger[_0x8864('0x19')](_0xd77840[_0x8864('0x2c')]);if(_0xd77840[_0x8864('0x2d')]){delete _0xd77840[_0x8864('0x2d')];}_0x3f69cf[_0x8864('0x1f')](_0x443b86)[_0x8864('0x2e')](_0xd77840);};}function getImapHost(_0x226636){switch(_0x226636){case _0x8864('0x2f'):return'imap.gmail.com';case'yahoo':return'imap.mail.yahoo.com';case _0x8864('0x30'):return'imap-mail.outlook.com';case'outlook365':return'outlook.office365.com';}throw new Error(_0x8864('0x31'),_0x226636);}function getSmtpHost(_0x7b48da){switch(_0x7b48da){case'gmail':return'smtp.gmail.com';case _0x8864('0x32'):return _0x8864('0x33');case'hotmail':return _0x8864('0x34');case _0x8864('0x35'):return _0x8864('0x36');}throw new Error(_0x8864('0x31'),_0x7b48da);}function getAuthenticationOptions(_0x1c6305,_0x2a47dc){var _0xc547fa={};var _0x19fda0={};if(_0x1c6305){_0xc547fa['user']=_0x19fda0[_0x8864('0x37')]=_0x2a47dc[_0x8864('0x38')];_0xc547fa[_0x8864('0x39')]=_0x19fda0['pass']=_0x2a47dc[_0x8864('0x39')];if(_0x2a47dc['modernAuthentication']){_0xc547fa[_0x8864('0x3a')]=_0x19fda0[_0x8864('0x3a')]=!![];_0xc547fa[_0x8864('0x3b')]=_0x19fda0[_0x8864('0x3b')]=_0x2a47dc[_0x8864('0x3b')];_0xc547fa[_0x8864('0x39')]=_0x19fda0[_0x8864('0x3c')]=null;}else{_0xc547fa[_0x8864('0x3b')]=_0x19fda0[_0x8864('0x3b')]=null;}_0xc547fa[_0x8864('0x3d')]=getImapHost(_0x1c6305);_0xc547fa[_0x8864('0x3e')]=0x3e1;_0x19fda0[_0x8864('0x3d')]=getSmtpHost(_0x1c6305);_0x19fda0[_0x8864('0x3e')]=0x24b;_0x19fda0[_0x8864('0x3f')]=![];_0xc547fa[_0x8864('0x40')]=_0x19fda0[_0x8864('0x40')]=null;}else{if(_0x2a47dc[_0x8864('0x41')]){_0xc547fa[_0x8864('0x37')]=_0x19fda0[_0x8864('0x37')]=_0x2a47dc[_0x8864('0x38')];_0xc547fa[_0x8864('0x39')]=_0x19fda0[_0x8864('0x3c')]=_0x2a47dc['password'];}else{_0xc547fa[_0x8864('0x41')]=_0x19fda0[_0x8864('0x41')]=![];_0xc547fa['user']=_0x19fda0[_0x8864('0x37')]=null;_0xc547fa['password']=_0x19fda0[_0x8864('0x3c')]=null;}_0xc547fa[_0x8864('0x3d')]=_0x2a47dc[_0x8864('0x42')][_0x8864('0x3d')];_0xc547fa[_0x8864('0x3e')]=_0x2a47dc[_0x8864('0x42')][_0x8864('0x3e')];_0x19fda0[_0x8864('0x3d')]=_0x2a47dc[_0x8864('0x43')][_0x8864('0x3d')];_0x19fda0[_0x8864('0x3e')]=_0x2a47dc[_0x8864('0x43')][_0x8864('0x3e')];}return{'Imap':_0xc547fa,'Smtp':_0x19fda0};}exports[_0x8864('0x44')]=function(_0x4da316,_0x259dbf){var _0x169348={'include':[{'model':db[_0x8864('0x45')],'as':_0x8864('0x42')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['Pause'],'as':_0x8864('0x46')}]},_0x468719={},_0x2edf9f={'count':0x0,'rows':[]};var _0x3b90ec=_[_0x8864('0x47')](db[_0x8864('0x48')][_0x8864('0x49')],function(_0x90bdf6){return{'name':_0x90bdf6[_0x8864('0x4a')],'type':_0x90bdf6[_0x8864('0x4b')][_0x8864('0x4c')]};});_0x468719['model']=_[_0x8864('0x47')](_0x3b90ec,_0x8864('0x2d'));_0x468719[_0x8864('0x4d')]=_[_0x8864('0x4e')](_0x4da316[_0x8864('0x4d')]);_0x468719[_0x8864('0x4f')]=_[_0x8864('0x50')](_0x468719['model'],_0x468719[_0x8864('0x4d')]);_0x169348['attributes']=_[_0x8864('0x50')](_0x468719['model'],qs[_0x8864('0x51')](_0x4da316[_0x8864('0x4d')][_0x8864('0x51')]));_0x169348['attributes']=_0x169348[_0x8864('0x52')][_0x8864('0x53')]?_0x169348[_0x8864('0x52')]:_0x468719[_0x8864('0x54')];if(!_0x4da316['query'][_0x8864('0x55')](_0x8864('0x56'))){_0x169348[_0x8864('0x25')]=qs['limit'](_0x4da316['query']['limit']);_0x169348['offset']=qs[_0x8864('0x24')](_0x4da316['query'][_0x8864('0x24')]);}_0x169348[_0x8864('0x57')]=qs[_0x8864('0x58')](_0x4da316[_0x8864('0x4d')]['sort']);_0x169348[_0x8864('0x59')]=qs[_0x8864('0x4f')](_['pick'](_0x4da316['query'],_0x468719[_0x8864('0x4f')]),_0x3b90ec);if(_0x4da316[_0x8864('0x4d')]['filter']){_0x169348[_0x8864('0x59')]=_[_0x8864('0x5a')](_0x169348[_0x8864('0x59')],{'$or':_[_0x8864('0x47')](_0x3b90ec,function(_0x4b92c6){if(_0x4b92c6[_0x8864('0x4b')]!=='VIRTUAL'){var _0x1c642d={};_0x1c642d[_0x4b92c6[_0x8864('0x2d')]]={'$like':'%'+_0x4da316[_0x8864('0x4d')]['filter']+'%'};return _0x1c642d;}})});}_0x169348=_[_0x8864('0x5a')]({},_0x169348,_0x4da316[_0x8864('0x5b')]);var _0x5dd795={'where':_0x169348['where']};return db[_0x8864('0x48')][_0x8864('0x23')](_0x5dd795)[_0x8864('0x14')](function(_0x1946d9){_0x2edf9f[_0x8864('0x23')]=_0x1946d9;if(_0x4da316[_0x8864('0x4d')][_0x8864('0x5c')]){_0x169348['include']=[{'all':!![]}];}return db[_0x8864('0x48')][_0x8864('0x5d')](_0x169348);})[_0x8864('0x14')](function(_0x4089c0){_0x2edf9f[_0x8864('0x5e')]=_0x4089c0;return _0x2edf9f;})[_0x8864('0x14')](respondWithFilteredResult(_0x259dbf,_0x169348))['catch'](handleError(_0x259dbf,null));};exports[_0x8864('0x5f')]=function(_0x47eea0,_0x261c7f){var _0x56e49c={'raw':![],'where':{'id':_0x47eea0[_0x8864('0x60')]['id']},'include':[{'model':db[_0x8864('0x45')],'as':_0x8864('0x42')},{'model':db[_0x8864('0x61')],'as':_0x8864('0x43')},{'model':db[_0x8864('0x62')],'as':_0x8864('0x46')}]},_0x6ed6fb={};_0x6ed6fb[_0x8864('0x54')]=_['keys'](db[_0x8864('0x48')][_0x8864('0x49')]);_0x6ed6fb[_0x8864('0x4d')]=_[_0x8864('0x4e')](_0x47eea0[_0x8864('0x4d')]);_0x6ed6fb[_0x8864('0x4f')]=_[_0x8864('0x50')](_0x6ed6fb[_0x8864('0x54')],_0x6ed6fb[_0x8864('0x4d')]);_0x56e49c[_0x8864('0x52')]=_[_0x8864('0x50')](_0x6ed6fb['model'],qs[_0x8864('0x51')](_0x47eea0[_0x8864('0x4d')][_0x8864('0x51')]));_0x56e49c[_0x8864('0x52')]=_0x56e49c[_0x8864('0x52')][_0x8864('0x53')]?_0x56e49c[_0x8864('0x52')]:_0x6ed6fb[_0x8864('0x54')];if(_0x47eea0[_0x8864('0x4d')]['includeAll']){_0x56e49c['include']=[{'all':!![]}];}_0x56e49c=_['merge']({},_0x56e49c,_0x47eea0[_0x8864('0x5b')]);return db[_0x8864('0x48')][_0x8864('0x63')](_0x56e49c)[_0x8864('0x14')](handleEntityNotFound(_0x261c7f,null))[_0x8864('0x14')](respondWithResult(_0x261c7f,null))[_0x8864('0x1d')](handleError(_0x261c7f,null));};exports[_0x8864('0x64')]=function(_0x31ece4,_0x1a8894){if(_0x31ece4['body']['id']){delete _0x31ece4['body']['id'];}var _0x3554ae=_0x31ece4[_0x8864('0x65')][_0x8864('0x66')]===_0x8864('0x67')?null:_0x31ece4[_0x8864('0x65')]['provider'];var _0x18c2d5=_0x31ece4[_0x8864('0x65')]['Imap']||{};var _0x13baea=_0x31ece4['body'][_0x8864('0x43')]||{};if(_0x3554ae){_0x18c2d5[_0x8864('0x3d')]=getImapHost(_0x3554ae);_0x18c2d5[_0x8864('0x3e')]=0x3e1;_0x13baea['host']=getSmtpHost(_0x3554ae);_0x13baea['port']=0x24b;_0x13baea[_0x8864('0x3f')]=![];}if(_0x13baea[_0x8864('0x3a')]){_0x13baea['secure']=![];}else{_0x13baea['CloudProviderId']=null;}if(!_0x18c2d5[_0x8864('0x3a')])_0x18c2d5[_0x8864('0x3b')]=null;_0x31ece4[_0x8864('0x65')]['Imap']=_0x18c2d5;_0x31ece4['body'][_0x8864('0x43')]=_0x13baea;return db[_0x8864('0x48')][_0x8864('0x63')]({'where':{'id':_0x31ece4[_0x8864('0x60')]['id']},'include':[{'model':db[_0x8864('0x45')],'as':_0x8864('0x42')},{'model':db[_0x8864('0x61')],'as':_0x8864('0x43')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x1a8894,null))[_0x8864('0x14')](function(_0x42bed5){if(!_0x42bed5)throw new Error(_0x8864('0x68'));if(_0x42bed5[_0x8864('0x40')])delete _0x31ece4[_0x8864('0x65')][_0x8864('0x42')];return _0x42bed5;})['then'](saveUpdates(_0x31ece4['body'],null))['then'](function(_0x1b1c16){if(!_0x31ece4['body'][_0x8864('0x42')])return _0x1b1c16;return db[_0x8864('0x45')][_0x8864('0x64')](_0x31ece4[_0x8864('0x65')][_0x8864('0x42')],{'where':{'MailAccountId':_0x1b1c16['id']}})['then'](function(){return _0x1b1c16;});})[_0x8864('0x14')](function(_0x50f808){if(!_0x31ece4[_0x8864('0x65')][_0x8864('0x43')])return _0x50f808;return db[_0x8864('0x61')]['update'](_0x31ece4['body'][_0x8864('0x43')],{'where':{'MailAccountId':_0x50f808['id']}})[_0x8864('0x14')](function(){return _0x50f808;});})[_0x8864('0x14')](respondWithResult(_0x1a8894,null))[_0x8864('0x1d')](handleError(_0x1a8894,null));};exports[_0x8864('0x69')]=function(_0x5e8caf,_0x4585f6){return db[_0x8864('0x48')]['describe']()[_0x8864('0x14')](respondWithResult(_0x4585f6,null))['catch'](handleError(_0x4585f6,null));};exports[_0x8864('0x6a')]=function(_0x4caeea,_0x36e7fb){if(_0x4caeea[_0x8864('0x65')]['id']){delete _0x4caeea['body']['id'];}return db[_0x8864('0x48')]['find']({'where':{'id':_0x4caeea['params']['id']}})[_0x8864('0x14')](handleEntityNotFound(_0x36e7fb,null))['then'](function(_0x4ba70f){if(_0x4ba70f){_0x4caeea['body']['MailAccountId']=_0x4ba70f['id'];return db[_0x8864('0x6b')]['create'](_0x4caeea[_0x8864('0x65')]);}})[_0x8864('0x14')](respondWithResult(_0x36e7fb,null))['catch'](handleError(_0x36e7fb,null));};exports[_0x8864('0x6c')]=function(_0x4db141,_0x831028){var _0xc8647e={'raw':![],'where':{}};var _0x21bba4={};var _0x1b497b={'count':0x0,'rows':[]};return db[_0x8864('0x48')][_0x8864('0x6d')]({'where':{'id':_0x4db141[_0x8864('0x60')]['id']}})[_0x8864('0x14')](handleEntityNotFound(_0x831028,null))[_0x8864('0x14')](function(_0x14031a){if(_0x14031a){_0x21bba4[_0x8864('0x54')]=_[_0x8864('0x4e')](db[_0x8864('0x6b')][_0x8864('0x49')]);_0x21bba4[_0x8864('0x4d')]=_[_0x8864('0x4e')](_0x4db141[_0x8864('0x4d')]);_0x21bba4[_0x8864('0x4f')]=_['intersection'](_0x21bba4[_0x8864('0x54')],_0x21bba4[_0x8864('0x4d')]);_0xc8647e[_0x8864('0x52')]=_['intersection'](_0x21bba4[_0x8864('0x54')],qs['fields'](_0x4db141[_0x8864('0x4d')][_0x8864('0x51')]));_0xc8647e[_0x8864('0x52')]=_0xc8647e['attributes'][_0x8864('0x53')]?_0xc8647e['attributes']:_0x21bba4['model'];if(!_0x4db141[_0x8864('0x4d')][_0x8864('0x55')]('nolimit')){_0xc8647e[_0x8864('0x25')]=qs[_0x8864('0x25')](_0x4db141[_0x8864('0x4d')][_0x8864('0x25')]);_0xc8647e[_0x8864('0x24')]=qs[_0x8864('0x24')](_0x4db141['query']['offset']);}_0xc8647e['order']=qs[_0x8864('0x58')](_0x4db141[_0x8864('0x4d')][_0x8864('0x58')]);_0xc8647e[_0x8864('0x59')]=qs[_0x8864('0x4f')](_[_0x8864('0x6e')](_0x4db141['query'],_0x21bba4['filters']));_0xc8647e[_0x8864('0x59')][_0x8864('0x6f')]=_0x14031a['id'];if(_0x4db141[_0x8864('0x4d')][_0x8864('0x70')]){_0xc8647e[_0x8864('0x59')]=_['merge'](_0xc8647e[_0x8864('0x59')],{'$or':_['map'](_0xc8647e[_0x8864('0x52')],function(_0x20e4dc){var _0x12410f={};_0x12410f[_0x20e4dc]={'$like':'%'+_0x4db141[_0x8864('0x4d')][_0x8864('0x70')]+'%'};return _0x12410f;})});}_0xc8647e=_[_0x8864('0x5a')]({},_0xc8647e,_0x4db141[_0x8864('0x5b')]);return db['Disposition'][_0x8864('0x23')]({'where':_0xc8647e[_0x8864('0x59')]})['then'](function(_0x2e7dd5){_0x1b497b['count']=_0x2e7dd5;if(_0x4db141[_0x8864('0x4d')][_0x8864('0x5c')]){_0xc8647e[_0x8864('0x71')]=[{'all':!![]}];}return db[_0x8864('0x6b')][_0x8864('0x5d')](_0xc8647e);})[_0x8864('0x14')](function(_0x2ba036){_0x1b497b[_0x8864('0x5e')]=_0x2ba036;return _0x1b497b;});}})[_0x8864('0x14')](respondWithFilteredResult(_0x831028,_0xc8647e))['catch'](handleError(_0x831028,null));};exports[_0x8864('0x72')]=function(_0x1abf1e,_0x109a39){return db['MailAccount']['find']({'where':{'id':_0x1abf1e['params']['id']}})['then'](handleEntityNotFound(_0x109a39,null))[_0x8864('0x14')](function(_0x154aeb){if(_0x154aeb){return _0x154aeb[_0x8864('0x72')](_0x1abf1e['query'][_0x8864('0x73')]);}})['then'](respondWithStatusCode(_0x109a39,null))[_0x8864('0x1d')](handleError(_0x109a39,null));};exports[_0x8864('0x74')]=function(_0x26e29a,_0x5286f7){if(_0x26e29a[_0x8864('0x65')]['id']){delete _0x26e29a[_0x8864('0x65')]['id'];}return db['MailAccount'][_0x8864('0x63')]({'where':{'id':_0x26e29a[_0x8864('0x60')]['id']}})[_0x8864('0x14')](handleEntityNotFound(_0x5286f7,null))[_0x8864('0x14')](function(_0x30b09e){if(_0x30b09e){_0x26e29a[_0x8864('0x65')][_0x8864('0x6f')]=_0x30b09e['id'];return db[_0x8864('0x75')][_0x8864('0x76')](_0x26e29a['body']);}})[_0x8864('0x14')](respondWithResult(_0x5286f7,null))['catch'](handleError(_0x5286f7,null));};exports[_0x8864('0x77')]=function(_0x3afead,_0x22a0a7){var _0x554d68={'raw':![],'where':{}};var _0x473b98={};var _0x352d84={'count':0x0,'rows':[]};return db[_0x8864('0x48')][_0x8864('0x6d')]({'where':{'id':_0x3afead['params']['id']}})[_0x8864('0x14')](handleEntityNotFound(_0x22a0a7,null))[_0x8864('0x14')](function(_0x31080c){if(_0x31080c){_0x473b98[_0x8864('0x54')]=_[_0x8864('0x4e')](db[_0x8864('0x75')]['rawAttributes']);_0x473b98[_0x8864('0x4d')]=_[_0x8864('0x4e')](_0x3afead[_0x8864('0x4d')]);_0x473b98[_0x8864('0x4f')]=_[_0x8864('0x50')](_0x473b98[_0x8864('0x54')],_0x473b98[_0x8864('0x4d')]);_0x554d68[_0x8864('0x52')]=_[_0x8864('0x50')](_0x473b98[_0x8864('0x54')],qs[_0x8864('0x51')](_0x3afead['query']['fields']));_0x554d68['attributes']=_0x554d68[_0x8864('0x52')][_0x8864('0x53')]?_0x554d68[_0x8864('0x52')]:_0x473b98[_0x8864('0x54')];if(!_0x3afead[_0x8864('0x4d')][_0x8864('0x55')](_0x8864('0x56'))){_0x554d68[_0x8864('0x25')]=qs['limit'](_0x3afead[_0x8864('0x4d')]['limit']);_0x554d68[_0x8864('0x24')]=qs[_0x8864('0x24')](_0x3afead[_0x8864('0x4d')]['offset']);}_0x554d68[_0x8864('0x57')]=qs[_0x8864('0x58')](_0x3afead['query'][_0x8864('0x58')]);_0x554d68['where']=qs['filters'](_[_0x8864('0x6e')](_0x3afead[_0x8864('0x4d')],_0x473b98[_0x8864('0x4f')]));_0x554d68[_0x8864('0x59')][_0x8864('0x6f')]=_0x31080c['id'];if(_0x3afead['query'][_0x8864('0x70')]){_0x554d68[_0x8864('0x59')]=_[_0x8864('0x5a')](_0x554d68['where'],{'$or':_[_0x8864('0x47')](_0x554d68[_0x8864('0x52')],function(_0x3a1566){var _0x230a3d={};_0x230a3d[_0x3a1566]={'$like':'%'+_0x3afead[_0x8864('0x4d')][_0x8864('0x70')]+'%'};return _0x230a3d;})});}_0x554d68=_[_0x8864('0x5a')]({},_0x554d68,_0x3afead[_0x8864('0x5b')]);return db[_0x8864('0x75')]['count']({'where':_0x554d68[_0x8864('0x59')]})[_0x8864('0x14')](function(_0x4bf4e7){_0x352d84[_0x8864('0x23')]=_0x4bf4e7;if(_0x3afead['query']['includeAll']){_0x554d68[_0x8864('0x71')]=[{'all':!![]}];}return db[_0x8864('0x75')][_0x8864('0x5d')](_0x554d68);})[_0x8864('0x14')](function(_0x34c071){_0x352d84[_0x8864('0x5e')]=_0x34c071;return _0x352d84;});}})[_0x8864('0x14')](respondWithFilteredResult(_0x22a0a7,_0x554d68))[_0x8864('0x1d')](handleError(_0x22a0a7,null));};exports['removeAnswers']=function(_0x27e937,_0x3df7a6){return db[_0x8864('0x48')][_0x8864('0x63')]({'where':{'id':_0x27e937[_0x8864('0x60')]['id']}})['then'](handleEntityNotFound(_0x3df7a6,null))[_0x8864('0x14')](function(_0xa73a59){if(_0xa73a59){return _0xa73a59[_0x8864('0x78')](_0x27e937[_0x8864('0x4d')][_0x8864('0x73')]);}})[_0x8864('0x14')](respondWithStatusCode(_0x3df7a6,null))[_0x8864('0x1d')](handleError(_0x3df7a6,null));};exports[_0x8864('0x76')]=function(_0x33843a,_0x9b99d4){var _0xba984e={'name':_0x33843a[_0x8864('0x65')][_0x8864('0x2d')],'key':_0x33843a[_0x8864('0x65')][_0x8864('0x4c')],'provider':_0x33843a[_0x8864('0x65')][_0x8864('0x66')]===_0x8864('0x67')?null:_0x33843a[_0x8864('0x65')][_0x8864('0x66')],'email':_0x33843a[_0x8864('0x65')][_0x8864('0x79')],'ListId':_0x33843a['body']['ListId'],'active':!_['isNil'](_0x33843a[_0x8864('0x65')]['active'])?_0x33843a['body'][_0x8864('0x7a')]:!![],'description':_0x33843a[_0x8864('0x65')][_0x8864('0x7b')]||null};var _0x44a0ce=getAuthenticationOptions(_0xba984e[_0x8864('0x66')],_0x33843a[_0x8864('0x65')]);_0xba984e[_0x8864('0x42')]=_0x44a0ce[_0x8864('0x42')];_0xba984e[_0x8864('0x43')]=_0x44a0ce[_0x8864('0x43')];return db[_0x8864('0x48')]['create'](_0xba984e,{'include':[{'model':db[_0x8864('0x61')],'as':_0x8864('0x43')},{'model':db['MailServerIn'],'as':_0x8864('0x42')}]})[_0x8864('0x14')](function(_0x3da964){var _0x85bfaf=_0x33843a[_0x8864('0x37')][_0x8864('0x29')]({'plain':!![]});if(!_0x85bfaf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x85bfaf[_0x8864('0x7c')]==='user'){var _0x313d1c=_0x3da964[_0x8864('0x29')]({'plain':!![]});return db[_0x8864('0x7d')][_0x8864('0x63')]({'where':{'name':_0x8864('0x2a'),'userProfileId':_0x85bfaf[_0x8864('0x7e')]},'raw':!![]})['then'](function(_0x1e65e2){if(_0x1e65e2&&_0x1e65e2[_0x8864('0x7f')]===0x0){return db[_0x8864('0x2b')][_0x8864('0x76')]({'name':_0x313d1c['name'],'resourceId':_0x313d1c['id'],'type':_0x1e65e2[_0x8864('0x2d')],'sectionId':_0x1e65e2['id']},{})['then'](function(){return _0x3da964;});}else{return _0x3da964;}})[_0x8864('0x1d')](function(_0x294626){logger[_0x8864('0x19')](_0x8864('0x80'),_0x294626);throw _0x294626;});}return _0x3da964;})[_0x8864('0x14')](respondWithResult(_0x9b99d4,0xc9))[_0x8864('0x1d')](handleError(_0x9b99d4,null));};exports['getImap']=function(_0xc4b1e7,_0x5780a9){return db[_0x8864('0x48')][_0x8864('0x6d')]({'where':{'id':_0xc4b1e7[_0x8864('0x60')]['id']}})['then'](handleEntityNotFound(_0x5780a9,null))['then'](function(_0x3f39ac){if(_0x3f39ac){return _0x3f39ac[_0x8864('0x81')]();}return null;})[_0x8864('0x14')](respondWithResult(_0x5780a9,null))[_0x8864('0x1d')](handleError(_0x5780a9,null));};exports[_0x8864('0x82')]=function(_0x353505,_0x1ef4ff){if(_0x353505[_0x8864('0x65')]['id']){delete _0x353505['body']['id'];}return db[_0x8864('0x48')][_0x8864('0x63')]({'where':{'id':_0x353505[_0x8864('0x60')]['id']}})[_0x8864('0x14')](handleEntityNotFound(_0x1ef4ff,null))[_0x8864('0x14')](function(_0x561a72){if(_0x561a72){_0x353505['body'][_0x8864('0x6f')]=_0x561a72['id'];return db[_0x8864('0x45')][_0x8864('0x76')](_0x353505[_0x8864('0x65')]);}})['then'](respondWithResult(_0x1ef4ff,null))[_0x8864('0x1d')](handleError(_0x1ef4ff,null));};exports[_0x8864('0x83')]=function(_0x44176b,_0x2d7f37){return db['MailAccount'][_0x8864('0x6d')]({'where':{'id':_0x44176b[_0x8864('0x60')]['id']}})[_0x8864('0x14')](handleEntityNotFound(_0x2d7f37,null))[_0x8864('0x14')](function(_0x497edd){if(_0x497edd){return _0x497edd[_0x8864('0x84')](null);}return null;})[_0x8864('0x14')](respondWithStatusCode(_0x2d7f37,null))[_0x8864('0x1d')](handleError(_0x2d7f37,null));};exports[_0x8864('0x85')]=function(_0x3ae961,_0x14ebb1){return db[_0x8864('0x48')][_0x8864('0x6d')]({'where':{'id':_0x3ae961[_0x8864('0x60')]['id']}})[_0x8864('0x14')](handleEntityNotFound(_0x14ebb1,null))[_0x8864('0x14')](function(_0x322364){if(_0x322364){return _0x322364[_0x8864('0x85')]();}return null;})[_0x8864('0x14')](respondWithResult(_0x14ebb1,null))[_0x8864('0x1d')](handleError(_0x14ebb1,null));};exports[_0x8864('0x86')]=function(_0x356106,_0x40bf82){if(_0x356106[_0x8864('0x65')]['id']){delete _0x356106[_0x8864('0x65')]['id'];}return db[_0x8864('0x48')][_0x8864('0x63')]({'where':{'id':_0x356106[_0x8864('0x60')]['id']}})[_0x8864('0x14')](handleEntityNotFound(_0x40bf82,null))[_0x8864('0x14')](function(_0x313cd8){if(_0x313cd8){_0x356106[_0x8864('0x65')]['MailAccountId']=_0x313cd8['id'];return db[_0x8864('0x61')][_0x8864('0x76')](_0x356106['body']);}})[_0x8864('0x14')](respondWithResult(_0x40bf82,null))['catch'](handleError(_0x40bf82,null));};exports[_0x8864('0x87')]=function(_0x67d16d,_0x3c2a0d){return db[_0x8864('0x48')][_0x8864('0x6d')]({'where':{'id':_0x67d16d[_0x8864('0x60')]['id']}})[_0x8864('0x14')](handleEntityNotFound(_0x3c2a0d,null))[_0x8864('0x14')](function(_0x3423b6){if(_0x3423b6){return _0x3423b6['setSmtp'](null);}return null;})[_0x8864('0x14')](respondWithStatusCode(_0x3c2a0d,null))['catch'](handleError(_0x3c2a0d,null));};exports['addInteraction']=function(_0x3e4126,_0x2ed48f){return db[_0x8864('0x88')][_0x8864('0x63')]({'where':{'id':_0x3e4126[_0x8864('0x60')]['id']}})['then'](handleEntityNotFound(_0x2ed48f,null))[_0x8864('0x14')](function(_0x37f908){if(_0x37f908){return _0x37f908[_0x8864('0x89')](_0x3e4126[_0x8864('0x65')][_0x8864('0x73')],_['omit'](_0x3e4126[_0x8864('0x65')],[_0x8864('0x73'),'id'])||{});}})[_0x8864('0x14')](respondWithResult(_0x2ed48f,null))[_0x8864('0x1d')](handleError(_0x2ed48f,null));};exports[_0x8864('0x8a')]=function(_0x56a8d1,_0x23231a){var _0x2db09a={'raw':![],'where':{}};var _0x3c32c5={};var _0x31e2cf={'count':0x0,'rows':[]};return db['MailAccount'][_0x8864('0x6d')]({'where':{'id':_0x56a8d1['params']['id']}})['then'](handleEntityNotFound(_0x23231a,null))[_0x8864('0x14')](function(_0xd791df){if(_0xd791df){_0x3c32c5[_0x8864('0x54')]=_['keys'](db[_0x8864('0x88')]['rawAttributes']);_0x3c32c5[_0x8864('0x4d')]=_[_0x8864('0x4e')](_0x56a8d1['query']);_0x3c32c5[_0x8864('0x4f')]=_[_0x8864('0x50')](_0x3c32c5[_0x8864('0x54')],_0x3c32c5['query']);_0x2db09a['attributes']=_[_0x8864('0x50')](_0x3c32c5[_0x8864('0x54')],qs[_0x8864('0x51')](_0x56a8d1[_0x8864('0x4d')][_0x8864('0x51')]));_0x2db09a[_0x8864('0x52')]=_0x2db09a['attributes'][_0x8864('0x53')]?_0x2db09a[_0x8864('0x52')]:_0x3c32c5[_0x8864('0x54')];if(!_0x56a8d1[_0x8864('0x4d')]['hasOwnProperty'](_0x8864('0x56'))){_0x2db09a[_0x8864('0x25')]=qs[_0x8864('0x25')](_0x56a8d1['query'][_0x8864('0x25')]);_0x2db09a[_0x8864('0x24')]=qs['offset'](_0x56a8d1[_0x8864('0x4d')][_0x8864('0x24')]);}_0x2db09a['order']=qs[_0x8864('0x58')](_0x56a8d1['query']['sort']);_0x2db09a[_0x8864('0x59')]=qs[_0x8864('0x4f')](_[_0x8864('0x6e')](_0x56a8d1[_0x8864('0x4d')],_0x3c32c5[_0x8864('0x4f')]));_0x2db09a['where'][_0x8864('0x6f')]=_0xd791df['id'];if(_0x56a8d1[_0x8864('0x4d')][_0x8864('0x70')]){_0x2db09a[_0x8864('0x59')]=_[_0x8864('0x5a')](_0x2db09a[_0x8864('0x59')],{'$or':_[_0x8864('0x47')](_0x2db09a[_0x8864('0x52')],function(_0x269c0a){var _0x12589d={};_0x12589d[_0x269c0a]={'$like':'%'+_0x56a8d1[_0x8864('0x4d')][_0x8864('0x70')]+'%'};return _0x12589d;})});}_0x2db09a=_['merge']({},_0x2db09a,_0x56a8d1[_0x8864('0x5b')]);return db[_0x8864('0x88')]['count']({'where':_0x2db09a[_0x8864('0x59')]})[_0x8864('0x14')](function(_0x1b1c48){_0x31e2cf[_0x8864('0x23')]=_0x1b1c48;if(_0x56a8d1[_0x8864('0x4d')][_0x8864('0x5c')]){_0x2db09a['include']=[{'model':db[_0x8864('0x8b')],'as':_0x8864('0x8c'),'required':![]},{'model':db[_0x8864('0x8d')],'as':_0x8864('0x8e'),'attributes':[_0x8864('0x2d'),_0x8864('0x8f'),_0x8864('0x90')],'required':![]},{'model':db[_0x8864('0x91')],'as':_0x8864('0x92'),'attributes':['id','name',_0x8864('0x93')],'where':_0x56a8d1['query'][_0x8864('0x94')]?{'id':_0x56a8d1['query'][_0x8864('0x94')]}:undefined,'required':_0x56a8d1['query'][_0x8864('0x94')]?!![]:![]}];}return db[_0x8864('0x88')][_0x8864('0x5d')](_0x2db09a);})[_0x8864('0x14')](function(_0x1e72cb){_0x31e2cf[_0x8864('0x5e')]=_0x1e72cb;return _0x31e2cf;});}})[_0x8864('0x14')](respondWithFilteredResult(_0x23231a,_0x2db09a))['catch'](handleError(_0x23231a,null));};exports[_0x8864('0x95')]=function addApplications(_0x10a2d6,_0x18cf3a){var _0x8b43c2=_0x10a2d6[_0x8864('0x60')]['id'];var _0x124665=_0x10a2d6[_0x8864('0x65')];var _0x2a32ab=0xc8;var _0x273d41=null;return db[_0x8864('0x96')][_0x8864('0x97')]({'isolationLevel':db[_0x8864('0x96')][_0x8864('0x98')][_0x8864('0x99')][_0x8864('0x9a')]},function(_0xa0325e){return db[_0x8864('0x48')][_0x8864('0x6d')]({'where':{'id':_0x8b43c2},'transaction':_0xa0325e})['then'](function(_0x347b78){if(_0x347b78){return db['MailApplication'][_0x8864('0x28')]({'where':{'MailAccountId':_0x8b43c2},'transaction':_0xa0325e})[_0x8864('0x14')](function(){var _0x2ebed6=_[_0x8864('0x47')](_0x124665,function(_0x1b4a49){_0x1b4a49[_0x8864('0x6f')]=_0x8b43c2;return _0x1b4a49;});return db['MailApplication']['bulkCreate'](_0x2ebed6,{'transaction':_0xa0325e});});}else{_0x2a32ab=0x194;_0x273d41=[];}});})[_0x8864('0x14')](function(){if(_0x2a32ab!==0x194){return db[_0x8864('0x9b')][_0x8864('0x9c')]({'where':{'MailAccountId':_0x8b43c2},'order':_0x8864('0x9d')})[_0x8864('0x14')](function(_0xac856b){_0x273d41=_0xac856b;});}})[_0x8864('0x1d')](function(_0x49f1be){_0x2a32ab=0x1f4;logger[_0x8864('0x19')](_0x49f1be['stack']);if(_0x49f1be[_0x8864('0x2d')]){delete _0x49f1be[_0x8864('0x2d')];}_0x273d41=_0x49f1be;})[_0x8864('0x9e')](function(){if(_0x273d41===null){_0x18cf3a['sendStatus'](_0x2a32ab);}else{if(_0x2a32ab===0x1f4){_0x18cf3a[_0x8864('0x1f')](_0x2a32ab)[_0x8864('0x2e')](_0x273d41);}else{_0x18cf3a[_0x8864('0x1f')](_0x2a32ab)[_0x8864('0x21')](_0x273d41);}}});};exports[_0x8864('0x9f')]=function(_0x127332,_0x4fda9b){var _0x4d8a70={};var _0x289559={};var _0xc109e8;var _0x5e6f0a;return db[_0x8864('0x48')][_0x8864('0x6d')]({'where':{'id':_0x127332[_0x8864('0x60')]['id']}})['then'](handleEntityNotFound(_0x4fda9b,null))['then'](function(_0x5a3d8c){if(_0x5a3d8c){_0xc109e8=_0x5a3d8c;_0x289559['model']=_['keys'](db['MailApplication'][_0x8864('0x49')]);_0x289559['query']=_[_0x8864('0x4e')](_0x127332[_0x8864('0x4d')]);_0x289559['filters']=_[_0x8864('0x50')](_0x289559[_0x8864('0x54')],_0x289559['query']);_0x4d8a70[_0x8864('0x52')]=_[_0x8864('0x50')](_0x289559[_0x8864('0x54')],qs[_0x8864('0x51')](_0x127332[_0x8864('0x4d')]['fields']));_0x4d8a70[_0x8864('0x52')]=_0x4d8a70[_0x8864('0x52')][_0x8864('0x53')]?_0x4d8a70[_0x8864('0x52')]:_0x289559['model'];_0x4d8a70['order']=qs[_0x8864('0x58')](_0x127332[_0x8864('0x4d')]['sort']);_0x4d8a70[_0x8864('0x59')]=qs[_0x8864('0x4f')](_[_0x8864('0x6e')](_0x127332[_0x8864('0x4d')],_0x289559[_0x8864('0x4f')]));if(_0x127332[_0x8864('0x4d')]['filter']){_0x4d8a70['where']=_[_0x8864('0x5a')](_0x4d8a70[_0x8864('0x59')],{'$or':_['map'](_0x4d8a70[_0x8864('0x52')],function(_0x23bf64){var _0x4debb1={};_0x4debb1[_0x23bf64]={'$like':'%'+_0x127332['query']['filter']+'%'};return _0x4debb1;})});}_0x4d8a70=_['merge']({},_0x4d8a70,_0x127332[_0x8864('0x5b')]);return _0xc109e8[_0x8864('0x9f')](_0x4d8a70);}})[_0x8864('0x14')](function(_0x36e9a8){if(_0x36e9a8){_0x5e6f0a=_0x36e9a8['length'];if(!_0x127332['query'][_0x8864('0x55')](_0x8864('0x56'))){_0x4d8a70[_0x8864('0x25')]=qs[_0x8864('0x25')](_0x127332[_0x8864('0x4d')][_0x8864('0x25')]);_0x4d8a70[_0x8864('0x24')]=qs['offset'](_0x127332[_0x8864('0x4d')][_0x8864('0x24')]);}return _0xc109e8[_0x8864('0x9f')](_0x4d8a70);}})[_0x8864('0x14')](function(_0x184900){if(_0x184900){return _0x184900?{'count':_0x5e6f0a,'rows':_0x184900}:null;}})[_0x8864('0x14')](respondWithResult(_0x4fda9b,null))[_0x8864('0x1d')](handleError(_0x4fda9b,null));};exports[_0x8864('0xa0')]=function(_0x5634dc,_0x59cd57){var _0x27c2f0={'raw':!![],'where':{}};var _0x1f7b58={};var _0x2b8d33={'count':0x0,'rows':[]};return db['MailAccount'][_0x8864('0x6d')]({'where':{'id':_0x5634dc[_0x8864('0x60')]['id']}})[_0x8864('0x14')](handleEntityNotFound(_0x59cd57,null))[_0x8864('0x14')](function(_0x2bfc8c){if(_0x2bfc8c){_0x1f7b58[_0x8864('0x54')]=_[_0x8864('0x4e')](db[_0x8864('0xa1')][_0x8864('0x49')]);_0x1f7b58[_0x8864('0x4d')]=_[_0x8864('0x4e')](_0x5634dc['query']);_0x1f7b58['filters']=_[_0x8864('0x50')](_0x1f7b58[_0x8864('0x54')],_0x1f7b58[_0x8864('0x4d')]);_0x27c2f0[_0x8864('0x52')]=_[_0x8864('0x50')](_0x1f7b58[_0x8864('0x54')],qs[_0x8864('0x51')](_0x5634dc[_0x8864('0x4d')]['fields']));_0x27c2f0[_0x8864('0x52')]=_0x27c2f0[_0x8864('0x52')]['length']?_0x27c2f0['attributes']:_0x1f7b58[_0x8864('0x54')];if(!_0x5634dc[_0x8864('0x4d')][_0x8864('0x55')](_0x8864('0x56'))){_0x27c2f0['limit']=qs[_0x8864('0x25')](_0x5634dc[_0x8864('0x4d')][_0x8864('0x25')]);_0x27c2f0[_0x8864('0x24')]=qs['offset'](_0x5634dc[_0x8864('0x4d')][_0x8864('0x24')]);}_0x27c2f0['order']=qs[_0x8864('0x58')](_0x5634dc['query']['sort']);_0x27c2f0[_0x8864('0x59')]=qs[_0x8864('0x4f')](_['pick'](_0x5634dc['query'],_0x1f7b58[_0x8864('0x4f')]));_0x27c2f0[_0x8864('0x59')][_0x8864('0x6f')]=_0x2bfc8c['id'];if(_0x5634dc[_0x8864('0x4d')][_0x8864('0x70')]){_0x27c2f0[_0x8864('0x59')]=_[_0x8864('0x5a')](_0x27c2f0[_0x8864('0x59')],{'$or':_[_0x8864('0x47')](_0x27c2f0['attributes'],function(_0x5925eb){var _0x195049={};_0x195049[_0x5925eb]={'$like':'%'+_0x5634dc['query'][_0x8864('0x70')]+'%'};return _0x195049;})});}if(_0x5634dc[_0x8864('0x4d')][_0x8864('0xa2')]){var _0x51e4c6=_0x5634dc[_0x8864('0x4d')][_0x8864('0xa2')][_0x8864('0xa3')](',');var _0x570ebf={};_0x570ebf[_0x51e4c6[0x0]]={'$gte':moment(_0x51e4c6[0x1])[_0x8864('0xa4')](_0x8864('0xa5'))};_0x27c2f0['where']=_[_0x8864('0x5a')](_0x27c2f0[_0x8864('0x59')],_0x570ebf);}_0x27c2f0=_[_0x8864('0x5a')]({},_0x27c2f0,_0x5634dc[_0x8864('0x5b')]);return db[_0x8864('0xa1')][_0x8864('0x23')]({'where':_0x27c2f0[_0x8864('0x59')]})[_0x8864('0x14')](function(_0x54d98a){_0x2b8d33['count']=_0x54d98a;if(_0x5634dc['query'][_0x8864('0x5c')]){_0x27c2f0['include']=[{'all':!![]}];}return db['MailMessage'][_0x8864('0x5d')](_0x27c2f0);})[_0x8864('0x14')](function(_0x31ca0f){if(_0x5634dc[_0x8864('0x4d')][_0x8864('0xa6')]===_0x8864('0xa7')){for(var _0x3b1b62=0x0;_0x3b1b62<_0x31ca0f[_0x8864('0x53')];_0x3b1b62++){_0x31ca0f[_0x3b1b62][_0x8864('0x65')]=juice(_0x31ca0f[_0x3b1b62][_0x8864('0x65')]);}}_0x2b8d33[_0x8864('0x5e')]=_0x31ca0f;return _0x2b8d33;});}})[_0x8864('0x14')](respondWithFilteredResult(_0x59cd57,_0x27c2f0))[_0x8864('0x1d')](handleError(_0x59cd57,null));};exports[_0x8864('0x2e')]=function(_0x5ea76b,_0x245e5f){var _0x2ec445,_0x1b5399={},_0x502af3;if(_0x5ea76b['body']['to']){_0x502af3=_0x5ea76b[_0x8864('0x65')]['to'][_0x8864('0xa3')](',')[0x0];}return db['MailAccount'][_0x8864('0x63')]({'where':{'id':_0x5ea76b['params']['id']},'include':[{'model':db[_0x8864('0xa8')],'as':'List','include':[{'model':db['CmContact'],'as':_0x8864('0xa9'),'where':{'email':_0x502af3},'limit':0x1,'order':[[_0x8864('0xaa'),'DESC']]}]},{'model':db[_0x8864('0x61')],'as':_0x8864('0x43'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x245e5f,null))[_0x8864('0x14')](function(_0x248c2a){if(!_0x248c2a)return;_0x2ec445=_0x248c2a;if(!_0x248c2a[_0x8864('0x43')])throw new Error(_0x8864('0xab'));if(_[_0x8864('0xac')](_0x5ea76b[_0x8864('0x65')][_0x8864('0xad')])){_0x5ea76b[_0x8864('0x65')][_0x8864('0xad')]=util[_0x8864('0xa4')](_0x8864('0xae'),_0x248c2a[_0x8864('0x2d')],_0x248c2a[_0x8864('0x79')]||_0x248c2a[_0x8864('0x43')][_0x8864('0x37')]);}if(_0x5ea76b[_0x8864('0x65')][_0x8864('0xaf')]&&_0x5ea76b['body'][_0x8864('0xaf')][_0x8864('0x53')]){for(var _0x5ed2a8=0x0;_0x5ed2a8<_0x5ea76b[_0x8864('0x65')][_0x8864('0xaf')][_0x8864('0x53')];_0x5ed2a8+=0x1){_0x5ea76b[_0x8864('0x65')][_0x8864('0xaf')][_0x5ed2a8]={'filename':_0x5ea76b['body'][_0x8864('0xaf')][_0x5ed2a8]['name'],'path':path[_0x8864('0xb0')](config[_0x8864('0xb1')],_0x8864('0xb2'),_0x5ea76b[_0x8864('0x65')][_0x8864('0xaf')][_0x5ed2a8][_0x8864('0xb3')])};}}var _0x3befc5=_0x248c2a['getSmtpOptions']();return respondWithRpcPromise(_0x8864('0xb4'),'sendMail',{'account':_0x3befc5,'message':_0x5ea76b[_0x8864('0x65')]});})[_0x8864('0x14')](function(_0x5412d4){if(!_0x5412d4)return;_0x1b5399=_0x5412d4;if(!_0x2ec445[_0x8864('0xb5')])throw new Error(_0x8864('0xb6'));if(_0x2ec445[_0x8864('0xb5')][_0x8864('0xa9')]['length'])return _0x2ec445[_0x8864('0xb5')]['Contacts'][0x0];return db['CmContact'][_0x8864('0x76')](_['defaults'](_0x5ea76b['body'],{'firstName':_0x5ea76b[_0x8864('0x65')]['to'],'email':_0x5ea76b[_0x8864('0x65')]['to'],'phone':_0x5ea76b[_0x8864('0x65')]['to'],'ListId':_0x2ec445['ListId']}));})['then'](function(_0x28bb06){if(!_0x28bb06)return;var _0x359de0={'UserId':_0x5ea76b['user']['id'],'ContactId':_0x28bb06['id'],'MailAccountId':_0x2ec445['id'],'inReplyTo':_0x1b5399[_0x8864('0xb7')],'to':_0x5ea76b[_0x8864('0x65')][_0x8864('0xad')],'cc':_0x5ea76b[_0x8864('0x65')]['cc'],'subject':_0x5ea76b[_0x8864('0x65')][_0x8864('0xb8')],'attach':_0x5ea76b[_0x8864('0x65')][_0x8864('0xb9')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x8864('0xa4')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x8864('0xba'),'Messages':[_['merge'](_0x5ea76b[_0x8864('0x65')],{'messageId':_0x1b5399['messageId'],'sentAt':moment()[_0x8864('0xa4')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x2ec445['id'],'UserId':_0x5ea76b[_0x8864('0x37')]['id'],'ContactId':_0x28bb06['id']})]};if(_0x5ea76b[_0x8864('0x65')][_0x8864('0xbb')]){_0x359de0=_[_0x8864('0x5a')](_0x359de0,_0x5ea76b[_0x8864('0x65')][_0x8864('0xbb')]);}return db[_0x8864('0x88')]['create'](_0x359de0,{'include':[{'model':db[_0x8864('0xa1')],'as':_0x8864('0xbc')}]});})[_0x8864('0x14')](respondWithResult(_0x245e5f,null))[_0x8864('0x1d')](handleError(_0x245e5f,null));};exports[_0x8864('0xbd')]=function(_0x1d02f0,_0x40aaa3){return db[_0x8864('0x48')][_0x8864('0x63')]({'where':{'id':_0x1d02f0['params']['id']},'include':[{'model':db[_0x8864('0x61')],'as':_0x8864('0x43'),'raw':!![],'include':[{'model':db[_0x8864('0xbe')],'as':_0x8864('0xbe'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x40aaa3,null))['then'](function(_0x24971b){if(!_0x24971b[_0x8864('0x43')])return;var _0x10fd2c=_0x24971b[_0x8864('0xbf')]();return respondWithRpcPromise(_0x8864('0xc0'),'verifySmtp',{'account':_0x10fd2c});})[_0x8864('0x14')](respondWithResult(_0x40aaa3,null))[_0x8864('0x1d')](handleError(_0x40aaa3,null));};exports[_0x8864('0x28')]=function(_0x25c70b,_0x191fce){return db[_0x8864('0x48')][_0x8864('0x63')]({'where':{'id':_0x25c70b[_0x8864('0x60')]['id']}})[_0x8864('0x14')](handleEntityNotFound(_0x191fce,null))[_0x8864('0x14')](function(_0x411420){if(_0x411420&&_0x411420['service']){throw new db[(_0x8864('0xc1'))]['ValidationError'](_0x8864('0xc2'));}return _0x411420;})[_0x8864('0x14')](removeEntity(_0x191fce,null))[_0x8864('0x1d')](handleError(_0x191fce,null));};exports[_0x8864('0xc3')]=function(_0x3438b0,_0x2f0c05){return db[_0x8864('0x48')][_0x8864('0x63')]({'where':{'id':_0x3438b0[_0x8864('0x60')]['id']}})[_0x8864('0x14')](handleEntityNotFound(_0x2f0c05,null))[_0x8864('0x14')](function(_0x3dd7a4){if(_0x3dd7a4){return _0x3dd7a4[_0x8864('0xc3')](_0x3438b0[_0x8864('0x65')]['ids'],_[_0x8864('0xc4')](_0x3438b0[_0x8864('0x65')],[_0x8864('0x73'),'id'])||{})[_0x8864('0xc5')](function(_0x1d4ed2){for(var _0x5c1bcc=0x0;_0x5c1bcc<_0x3438b0['body']['ids']['length'];_0x5c1bcc+=0x1){socket[_0x8864('0xc6')](_0x8864('0xc7'),{'UserId':Number(_0x3438b0['body']['ids'][_0x5c1bcc]),'MailAccountId':Number(_0x3438b0[_0x8864('0x60')]['id'])});}return _0x1d4ed2;});}})[_0x8864('0x14')](respondWithResult(_0x2f0c05,null))[_0x8864('0x1d')](handleError(_0x2f0c05,null));};exports[_0x8864('0xc8')]=function(_0x4adec6,_0x3dd3e2){return db[_0x8864('0x48')][_0x8864('0x63')]({'where':{'id':_0x4adec6[_0x8864('0x60')]['id']}})['then'](handleEntityNotFound(_0x3dd3e2,null))[_0x8864('0x14')](function(_0x2980d1){if(_0x2980d1){return _0x2980d1[_0x8864('0xc8')](_0x4adec6[_0x8864('0x4d')]['ids'])[_0x8864('0x14')](function(){if(_['isArray'](_0x4adec6[_0x8864('0x4d')][_0x8864('0x73')])){for(var _0x1f999a=0x0;_0x1f999a<_0x4adec6[_0x8864('0x4d')][_0x8864('0x73')]['length'];_0x1f999a+=0x1){socket[_0x8864('0xc6')](_0x8864('0xc9'),{'UserId':Number(_0x4adec6[_0x8864('0x4d')][_0x8864('0x73')][_0x1f999a]),'MailAccountId':Number(_0x4adec6[_0x8864('0x60')]['id'])});}}else{socket['emit'](_0x8864('0xc9'),{'UserId':Number(_0x4adec6['query'][_0x8864('0x73')]),'MailAccountId':Number(_0x4adec6[_0x8864('0x60')]['id'])});}});}})[_0x8864('0x14')](respondWithStatusCode(_0x3dd3e2,null))[_0x8864('0x1d')](handleError(_0x3dd3e2,null));};exports[_0x8864('0xca')]=function(_0x5bf0d5,_0xb24df1){var _0x2ff2ed={};var _0x320744={};var _0x4ef0f5;var _0x4e596a;return db[_0x8864('0x48')][_0x8864('0x6d')]({'where':{'id':_0x5bf0d5[_0x8864('0x60')]['id']}})[_0x8864('0x14')](handleEntityNotFound(_0xb24df1,null))['then'](function(_0x4225e3){if(_0x4225e3){_0x4ef0f5=_0x4225e3;_0x320744[_0x8864('0x54')]=_[_0x8864('0x4e')](db[_0x8864('0x8d')][_0x8864('0x49')]);_0x320744[_0x8864('0x4d')]=_[_0x8864('0x4e')](_0x5bf0d5[_0x8864('0x4d')]);_0x320744[_0x8864('0x4f')]=_[_0x8864('0x50')](_0x320744[_0x8864('0x54')],_0x320744[_0x8864('0x4d')]);_0x2ff2ed[_0x8864('0x52')]=_['intersection'](_0x320744['model'],qs[_0x8864('0x51')](_0x5bf0d5['query'][_0x8864('0x51')]));_0x2ff2ed[_0x8864('0x52')]=_0x2ff2ed[_0x8864('0x52')][_0x8864('0x53')]?_0x2ff2ed[_0x8864('0x52')]:_0x320744[_0x8864('0x54')];_0x2ff2ed[_0x8864('0x57')]=qs['sort'](_0x5bf0d5[_0x8864('0x4d')][_0x8864('0x58')]);_0x2ff2ed[_0x8864('0x59')]=qs[_0x8864('0x4f')](_[_0x8864('0x6e')](_0x5bf0d5[_0x8864('0x4d')],_0x320744[_0x8864('0x4f')]));if(_0x5bf0d5[_0x8864('0x4d')][_0x8864('0x70')]){_0x2ff2ed[_0x8864('0x59')]=_[_0x8864('0x5a')](_0x2ff2ed[_0x8864('0x59')],{'$or':_['map'](_0x2ff2ed[_0x8864('0x52')],function(_0x100683){var _0x27f6f2={};_0x27f6f2[_0x100683]={'$like':'%'+_0x5bf0d5['query'][_0x8864('0x70')]+'%'};return _0x27f6f2;})});}_0x2ff2ed=_[_0x8864('0x5a')]({},_0x2ff2ed,_0x5bf0d5[_0x8864('0x5b')]);return _0x4ef0f5[_0x8864('0xca')](_0x2ff2ed);}})[_0x8864('0x14')](function(_0x280579){if(_0x280579){_0x4e596a=_0x280579[_0x8864('0x53')];if(!_0x5bf0d5[_0x8864('0x4d')]['hasOwnProperty'](_0x8864('0x56'))){_0x2ff2ed['limit']=qs['limit'](_0x5bf0d5[_0x8864('0x4d')][_0x8864('0x25')]);_0x2ff2ed[_0x8864('0x24')]=qs[_0x8864('0x24')](_0x5bf0d5[_0x8864('0x4d')][_0x8864('0x24')]);}return _0x4ef0f5[_0x8864('0xca')](_0x2ff2ed);}})[_0x8864('0x14')](function(_0x37e5de){if(_0x37e5de){return _0x37e5de?{'count':_0x4e596a,'rows':_0x37e5de}:null;}})['then'](respondWithResult(_0xb24df1,null))['catch'](handleError(_0xb24df1,null));}; \ No newline at end of file +var _0x2c83=['inlineCss','true','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','email','attachments','join','root','server/files/attachments','basename','getSmtpOptions','sendMail','List\x20not\x20found','CmContact','messageId','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','moment','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','jayson/promise','client','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','status','end','json','offset','limit','undefined','count','update','destroy','get','MailAccounts','UserProfileResource','sendStatus','stack','name','send','gmail','imap.gmail.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','nolimit','sort','filters','filter','merge','where','VIRTUAL','includeAll','include','findAll','params','MailAccount','length','options','find','catch','body','provider','custom','secure','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','hasOwnProperty','pick','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','key','ListId','isNil','active','description','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2f2745,_0x3bfe1e){var _0x275035=function(_0x2de9d3){while(--_0x2de9d3){_0x2f2745['push'](_0x2f2745['shift']());}};_0x275035(++_0x3bfe1e);}(_0x2c83,0xed));var _0x32c8=function(_0x2ef691,_0x1af14d){_0x2ef691=_0x2ef691-0x0;var _0x399d1a=_0x2c83[_0x2ef691];return _0x399d1a;};'use strict';var moment=require(_0x32c8('0x0'));var BPromise=require('bluebird');var util=require(_0x32c8('0x1'));var path=require(_0x32c8('0x2'));var _=require(_0x32c8('0x3'));var juice=require('juice');var Redis=require(_0x32c8('0x4'));var qs=require(_0x32c8('0x5'));var logger=require(_0x32c8('0x6'))(_0x32c8('0x7'));var config=require(_0x32c8('0x8'));var db=require(_0x32c8('0x9'))['db'];config[_0x32c8('0xa')]=_[_0x32c8('0xb')](config[_0x32c8('0xa')],{'host':_0x32c8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x32c8('0xa')]));require(_0x32c8('0xd'))[_0x32c8('0xe')](socket);var jayson=require(_0x32c8('0xf'));var client=jayson[_0x32c8('0x10')]['http']({'port':0x232b});function respondWithRpcPromise(_0x2602b8,_0x4e32dd,_0x3d832f,_0x214134){return new BPromise(function(_0x4b37e2,_0x687d75){var _0x1e3278=_0x214134||client;return _0x1e3278[_0x32c8('0x11')](_0x2602b8,_0x3d832f)[_0x32c8('0x12')](function(_0x1e8e40){logger['info'](_0x32c8('0x13'),_0x4e32dd,_0x32c8('0x14'));logger[_0x32c8('0x15')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x4e32dd,'request\x20sent',JSON[_0x32c8('0x16')](_0x1e8e40));if(_0x1e8e40[_0x32c8('0x17')]){if(_0x1e8e40['error']['code']===0x1f4){logger[_0x32c8('0x17')](_0x32c8('0x13'),_0x4e32dd,_0x1e8e40[_0x32c8('0x17')]['message']);return _0x687d75(_0x1e8e40[_0x32c8('0x17')][_0x32c8('0x18')]);}logger[_0x32c8('0x17')]('MailAccount,\x20%s,\x20%s',_0x4e32dd,_0x1e8e40[_0x32c8('0x17')][_0x32c8('0x18')]);return _0x4b37e2(_0x1e8e40[_0x32c8('0x17')][_0x32c8('0x18')]);}else{logger[_0x32c8('0x19')](_0x32c8('0x13'),_0x4e32dd,_0x32c8('0x14'));_0x4b37e2(_0x1e8e40[_0x32c8('0x1a')][_0x32c8('0x18')]);}})['catch'](function(_0x440159){logger[_0x32c8('0x17')]('MailAccount,\x20%s,\x20%s',_0x4e32dd,_0x440159);_0x687d75(_0x440159);});});}function respondWithStatusCode(_0x2a1ce8,_0x3f5c67){_0x3f5c67=_0x3f5c67||0xcc;return function(_0x583c39){if(_0x583c39){return _0x2a1ce8['sendStatus'](_0x3f5c67);}return _0x2a1ce8[_0x32c8('0x1b')](_0x3f5c67)[_0x32c8('0x1c')]();};}function respondWithResult(_0x456941,_0x2cdea6){_0x2cdea6=_0x2cdea6||0xc8;return function(_0x4b842e){if(_0x4b842e){return _0x456941[_0x32c8('0x1b')](_0x2cdea6)[_0x32c8('0x1d')](_0x4b842e);}};}function respondWithFilteredResult(_0x1562c4,_0x5d9b23){return function(_0x4b5ced){if(_0x4b5ced){var _0x47ed8d=typeof _0x5d9b23[_0x32c8('0x1e')]==='undefined'&&typeof _0x5d9b23[_0x32c8('0x1f')]===_0x32c8('0x20');var _0x1546ac=_0x4b5ced[_0x32c8('0x21')];var _0x208682=_0x47ed8d?0x0:_0x5d9b23[_0x32c8('0x1e')];var _0x1db03c=_0x47ed8d?_0x4b5ced['count']:_0x5d9b23[_0x32c8('0x1e')]+_0x5d9b23['limit'];var _0x4e950c;if(_0x1db03c>=_0x1546ac){_0x1db03c=_0x1546ac;_0x4e950c=0xc8;}else{_0x4e950c=0xce;}_0x1562c4[_0x32c8('0x1b')](_0x4e950c);return _0x1562c4['set']('Content-Range',_0x208682+'-'+_0x1db03c+'/'+_0x1546ac)[_0x32c8('0x1d')](_0x4b5ced);}return null;};}function saveUpdates(_0x5aa9d3){return function(_0x1b5419){if(_0x1b5419){return _0x1b5419[_0x32c8('0x22')](_0x5aa9d3)[_0x32c8('0x12')](function(_0x2b3b54){return _0x2b3b54;});}return null;};}function removeEntity(_0x3fbeac){return function(_0x227b10){if(_0x227b10){return _0x227b10[_0x32c8('0x23')]()[_0x32c8('0x12')](function(){var _0x5b822a=_0x227b10[_0x32c8('0x24')]({'plain':!![]});var _0x3ff6b2=_0x32c8('0x25');return db[_0x32c8('0x26')][_0x32c8('0x23')]({'where':{'type':_0x3ff6b2,'resourceId':_0x5b822a['id']}})['then'](function(){return _0x227b10;});})[_0x32c8('0x12')](function(){_0x3fbeac[_0x32c8('0x1b')](0xcc)[_0x32c8('0x1c')]();});}};}function handleEntityNotFound(_0x37630d){return function(_0x34a365){if(!_0x34a365){_0x37630d[_0x32c8('0x27')](0x194);}return _0x34a365;};}function handleError(_0x3dda66,_0x39526a){_0x39526a=_0x39526a||0x1f4;return function(_0x55c7b4){logger['error'](_0x55c7b4[_0x32c8('0x28')]);if(_0x55c7b4[_0x32c8('0x29')]){delete _0x55c7b4[_0x32c8('0x29')];}_0x3dda66[_0x32c8('0x1b')](_0x39526a)[_0x32c8('0x2a')](_0x55c7b4);};}function getImapHost(_0x4714ba){switch(_0x4714ba){case _0x32c8('0x2b'):return _0x32c8('0x2c');case'yahoo':return'imap.mail.yahoo.com';case _0x32c8('0x2d'):return _0x32c8('0x2e');case _0x32c8('0x2f'):return _0x32c8('0x30');}throw new Error(_0x32c8('0x31'),_0x4714ba);}function getSmtpHost(_0x5c7642){switch(_0x5c7642){case'gmail':return _0x32c8('0x32');case'yahoo':return'smtp.mail.yahoo.com';case _0x32c8('0x2d'):return _0x32c8('0x33');case _0x32c8('0x2f'):return _0x32c8('0x34');}throw new Error(_0x32c8('0x31'),_0x5c7642);}function getAuthenticationOptions(_0x284389,_0x4693b8){var _0x556550={};var _0x231800={};if(_0x284389){_0x556550[_0x32c8('0x35')]=_0x231800[_0x32c8('0x35')]=_0x4693b8[_0x32c8('0x36')];_0x556550[_0x32c8('0x37')]=_0x231800[_0x32c8('0x38')]=_0x4693b8['password'];if(_0x4693b8[_0x32c8('0x39')]){_0x556550[_0x32c8('0x39')]=_0x231800[_0x32c8('0x39')]=!![];_0x556550[_0x32c8('0x3a')]=_0x231800['CloudProviderId']=_0x4693b8[_0x32c8('0x3a')];_0x556550[_0x32c8('0x37')]=_0x231800[_0x32c8('0x38')]=null;}else{_0x556550[_0x32c8('0x3a')]=_0x231800[_0x32c8('0x3a')]=null;}_0x556550[_0x32c8('0x3b')]=getImapHost(_0x284389);_0x556550[_0x32c8('0x3c')]=0x3e1;_0x231800[_0x32c8('0x3b')]=getSmtpHost(_0x284389);_0x231800[_0x32c8('0x3c')]=0x24b;_0x231800['secure']=![];_0x556550[_0x32c8('0x3d')]=_0x231800[_0x32c8('0x3d')]=null;}else{if(_0x4693b8[_0x32c8('0x3e')]){_0x556550[_0x32c8('0x35')]=_0x231800[_0x32c8('0x35')]=_0x4693b8['username'];_0x556550['password']=_0x231800[_0x32c8('0x38')]=_0x4693b8[_0x32c8('0x37')];}else{_0x556550[_0x32c8('0x3e')]=_0x231800[_0x32c8('0x3e')]=![];_0x556550[_0x32c8('0x35')]=_0x231800[_0x32c8('0x35')]=null;_0x556550[_0x32c8('0x37')]=_0x231800[_0x32c8('0x38')]=null;}_0x556550[_0x32c8('0x3b')]=_0x4693b8[_0x32c8('0x3f')][_0x32c8('0x3b')];_0x556550[_0x32c8('0x3c')]=_0x4693b8['Imap'][_0x32c8('0x3c')];_0x231800['host']=_0x4693b8['Smtp']['host'];_0x231800[_0x32c8('0x3c')]=_0x4693b8[_0x32c8('0x40')][_0x32c8('0x3c')];}return{'Imap':_0x556550,'Smtp':_0x231800};}exports[_0x32c8('0x41')]=function(_0xa9a7c8,_0x93d2e4){var _0x364082={'include':[{'model':db[_0x32c8('0x42')],'as':_0x32c8('0x3f')},{'model':db[_0x32c8('0x43')],'as':_0x32c8('0x40')},{'model':db[_0x32c8('0x44')],'as':_0x32c8('0x45')}]},_0x3c24cf={},_0x1e948b={'count':0x0,'rows':[]};var _0x519feb=_['map'](db['MailAccount'][_0x32c8('0x46')],function(_0xcd40){return{'name':_0xcd40[_0x32c8('0x47')],'type':_0xcd40[_0x32c8('0x48')]['key']};});_0x3c24cf[_0x32c8('0x49')]=_[_0x32c8('0x4a')](_0x519feb,_0x32c8('0x29'));_0x3c24cf[_0x32c8('0x4b')]=_[_0x32c8('0x4c')](_0xa9a7c8[_0x32c8('0x4b')]);_0x3c24cf['filters']=_[_0x32c8('0x4d')](_0x3c24cf['model'],_0x3c24cf[_0x32c8('0x4b')]);_0x364082[_0x32c8('0x4e')]=_[_0x32c8('0x4d')](_0x3c24cf[_0x32c8('0x49')],qs[_0x32c8('0x4f')](_0xa9a7c8[_0x32c8('0x4b')]['fields']));_0x364082[_0x32c8('0x4e')]=_0x364082[_0x32c8('0x4e')]['length']?_0x364082[_0x32c8('0x4e')]:_0x3c24cf[_0x32c8('0x49')];if(!_0xa9a7c8[_0x32c8('0x4b')]['hasOwnProperty'](_0x32c8('0x50'))){_0x364082['limit']=qs[_0x32c8('0x1f')](_0xa9a7c8[_0x32c8('0x4b')][_0x32c8('0x1f')]);_0x364082['offset']=qs[_0x32c8('0x1e')](_0xa9a7c8['query']['offset']);}_0x364082['order']=qs[_0x32c8('0x51')](_0xa9a7c8[_0x32c8('0x4b')][_0x32c8('0x51')]);_0x364082['where']=qs[_0x32c8('0x52')](_['pick'](_0xa9a7c8[_0x32c8('0x4b')],_0x3c24cf[_0x32c8('0x52')]),_0x519feb);if(_0xa9a7c8['query'][_0x32c8('0x53')]){_0x364082['where']=_[_0x32c8('0x54')](_0x364082[_0x32c8('0x55')],{'$or':_[_0x32c8('0x4a')](_0x519feb,function(_0x162d40){if(_0x162d40[_0x32c8('0x48')]!==_0x32c8('0x56')){var _0x4ef655={};_0x4ef655[_0x162d40[_0x32c8('0x29')]]={'$like':'%'+_0xa9a7c8['query'][_0x32c8('0x53')]+'%'};return _0x4ef655;}})});}_0x364082=_['merge']({},_0x364082,_0xa9a7c8['options']);var _0x19d24c={'where':_0x364082[_0x32c8('0x55')]};return db['MailAccount'][_0x32c8('0x21')](_0x19d24c)[_0x32c8('0x12')](function(_0x2f6b4e){_0x1e948b['count']=_0x2f6b4e;if(_0xa9a7c8[_0x32c8('0x4b')][_0x32c8('0x57')]){_0x364082[_0x32c8('0x58')]=[{'all':!![]}];}return db['MailAccount'][_0x32c8('0x59')](_0x364082);})['then'](function(_0x4d01ba){_0x1e948b['rows']=_0x4d01ba;return _0x1e948b;})[_0x32c8('0x12')](respondWithFilteredResult(_0x93d2e4,_0x364082))['catch'](handleError(_0x93d2e4,null));};exports['show']=function(_0xdd3732,_0x370ada){var _0x3bec08={'raw':![],'where':{'id':_0xdd3732[_0x32c8('0x5a')]['id']},'include':[{'model':db[_0x32c8('0x42')],'as':_0x32c8('0x3f')},{'model':db['MailServerOut'],'as':_0x32c8('0x40')},{'model':db[_0x32c8('0x44')],'as':_0x32c8('0x45')}]},_0x16d2fb={};_0x16d2fb[_0x32c8('0x49')]=_[_0x32c8('0x4c')](db[_0x32c8('0x5b')][_0x32c8('0x46')]);_0x16d2fb[_0x32c8('0x4b')]=_[_0x32c8('0x4c')](_0xdd3732[_0x32c8('0x4b')]);_0x16d2fb[_0x32c8('0x52')]=_[_0x32c8('0x4d')](_0x16d2fb[_0x32c8('0x49')],_0x16d2fb[_0x32c8('0x4b')]);_0x3bec08[_0x32c8('0x4e')]=_[_0x32c8('0x4d')](_0x16d2fb[_0x32c8('0x49')],qs[_0x32c8('0x4f')](_0xdd3732[_0x32c8('0x4b')]['fields']));_0x3bec08[_0x32c8('0x4e')]=_0x3bec08[_0x32c8('0x4e')][_0x32c8('0x5c')]?_0x3bec08[_0x32c8('0x4e')]:_0x16d2fb[_0x32c8('0x49')];if(_0xdd3732[_0x32c8('0x4b')]['includeAll']){_0x3bec08[_0x32c8('0x58')]=[{'all':!![]}];}_0x3bec08=_[_0x32c8('0x54')]({},_0x3bec08,_0xdd3732[_0x32c8('0x5d')]);return db[_0x32c8('0x5b')][_0x32c8('0x5e')](_0x3bec08)['then'](handleEntityNotFound(_0x370ada,null))[_0x32c8('0x12')](respondWithResult(_0x370ada,null))[_0x32c8('0x5f')](handleError(_0x370ada,null));};exports[_0x32c8('0x22')]=function(_0x1438fa,_0x5b0f4a){if(_0x1438fa[_0x32c8('0x60')]['id']){delete _0x1438fa['body']['id'];}var _0xd46aa5=_0x1438fa[_0x32c8('0x60')][_0x32c8('0x61')]===_0x32c8('0x62')?null:_0x1438fa[_0x32c8('0x60')]['provider'];var _0x4bebb8=_0x1438fa[_0x32c8('0x60')][_0x32c8('0x3f')]||{};var _0x21a003=_0x1438fa['body'][_0x32c8('0x40')]||{};if(_0xd46aa5){_0x4bebb8['host']=getImapHost(_0xd46aa5);_0x4bebb8[_0x32c8('0x3c')]=0x3e1;_0x21a003[_0x32c8('0x3b')]=getSmtpHost(_0xd46aa5);_0x21a003[_0x32c8('0x3c')]=0x24b;_0x21a003[_0x32c8('0x63')]=![];}if(_0x21a003[_0x32c8('0x39')]){_0x21a003[_0x32c8('0x63')]=![];}else{_0x21a003['CloudProviderId']=null;}if(!_0x4bebb8[_0x32c8('0x39')])_0x4bebb8[_0x32c8('0x3a')]=null;_0x1438fa[_0x32c8('0x60')]['Imap']=_0x4bebb8;_0x1438fa[_0x32c8('0x60')][_0x32c8('0x40')]=_0x21a003;return db[_0x32c8('0x5b')]['find']({'where':{'id':_0x1438fa[_0x32c8('0x5a')]['id']},'include':[{'model':db[_0x32c8('0x42')],'as':_0x32c8('0x3f')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['Pause'],'as':_0x32c8('0x45')}]})['then'](handleEntityNotFound(_0x5b0f4a,null))[_0x32c8('0x12')](function(_0x239b6f){if(!_0x239b6f)throw new Error('Mail\x20Account\x20not\x20found');if(_0x239b6f['service'])delete _0x1438fa['body'][_0x32c8('0x3f')];return _0x239b6f;})[_0x32c8('0x12')](saveUpdates(_0x1438fa[_0x32c8('0x60')],null))['then'](function(_0x229555){if(!_0x1438fa['body'][_0x32c8('0x3f')])return _0x229555;return db['MailServerIn']['update'](_0x1438fa['body'][_0x32c8('0x3f')],{'where':{'MailAccountId':_0x229555['id']}})['then'](function(){return _0x229555;});})['then'](function(_0x41c4c7){if(!_0x1438fa[_0x32c8('0x60')][_0x32c8('0x40')])return _0x41c4c7;return db['MailServerOut'][_0x32c8('0x22')](_0x1438fa[_0x32c8('0x60')][_0x32c8('0x40')],{'where':{'MailAccountId':_0x41c4c7['id']}})[_0x32c8('0x12')](function(){return _0x41c4c7;});})[_0x32c8('0x12')](respondWithResult(_0x5b0f4a,null))[_0x32c8('0x5f')](handleError(_0x5b0f4a,null));};exports['describe']=function(_0x2400bc,_0xf84235){return db[_0x32c8('0x5b')]['describe']()[_0x32c8('0x12')](respondWithResult(_0xf84235,null))[_0x32c8('0x5f')](handleError(_0xf84235,null));};exports[_0x32c8('0x64')]=function(_0x4ed8bd,_0x476606){if(_0x4ed8bd[_0x32c8('0x60')]['id']){delete _0x4ed8bd[_0x32c8('0x60')]['id'];}return db[_0x32c8('0x5b')][_0x32c8('0x5e')]({'where':{'id':_0x4ed8bd[_0x32c8('0x5a')]['id']}})[_0x32c8('0x12')](handleEntityNotFound(_0x476606,null))[_0x32c8('0x12')](function(_0xf6d69){if(_0xf6d69){_0x4ed8bd[_0x32c8('0x60')][_0x32c8('0x65')]=_0xf6d69['id'];return db[_0x32c8('0x66')][_0x32c8('0x67')](_0x4ed8bd[_0x32c8('0x60')]);}})['then'](respondWithResult(_0x476606,null))[_0x32c8('0x5f')](handleError(_0x476606,null));};exports[_0x32c8('0x68')]=function(_0x24ab1c,_0x138ba7){var _0xdc42cf={'raw':![],'where':{}};var _0x459435={};var _0x1a16ec={'count':0x0,'rows':[]};return db[_0x32c8('0x5b')][_0x32c8('0x69')]({'where':{'id':_0x24ab1c['params']['id']}})[_0x32c8('0x12')](handleEntityNotFound(_0x138ba7,null))['then'](function(_0x3857a0){if(_0x3857a0){_0x459435[_0x32c8('0x49')]=_[_0x32c8('0x4c')](db[_0x32c8('0x66')]['rawAttributes']);_0x459435[_0x32c8('0x4b')]=_[_0x32c8('0x4c')](_0x24ab1c['query']);_0x459435['filters']=_['intersection'](_0x459435[_0x32c8('0x49')],_0x459435[_0x32c8('0x4b')]);_0xdc42cf['attributes']=_['intersection'](_0x459435[_0x32c8('0x49')],qs[_0x32c8('0x4f')](_0x24ab1c[_0x32c8('0x4b')][_0x32c8('0x4f')]));_0xdc42cf['attributes']=_0xdc42cf[_0x32c8('0x4e')]['length']?_0xdc42cf[_0x32c8('0x4e')]:_0x459435[_0x32c8('0x49')];if(!_0x24ab1c[_0x32c8('0x4b')][_0x32c8('0x6a')]('nolimit')){_0xdc42cf[_0x32c8('0x1f')]=qs[_0x32c8('0x1f')](_0x24ab1c[_0x32c8('0x4b')][_0x32c8('0x1f')]);_0xdc42cf[_0x32c8('0x1e')]=qs['offset'](_0x24ab1c['query'][_0x32c8('0x1e')]);}_0xdc42cf['order']=qs['sort'](_0x24ab1c[_0x32c8('0x4b')][_0x32c8('0x51')]);_0xdc42cf[_0x32c8('0x55')]=qs[_0x32c8('0x52')](_[_0x32c8('0x6b')](_0x24ab1c[_0x32c8('0x4b')],_0x459435['filters']));_0xdc42cf[_0x32c8('0x55')][_0x32c8('0x65')]=_0x3857a0['id'];if(_0x24ab1c[_0x32c8('0x4b')]['filter']){_0xdc42cf[_0x32c8('0x55')]=_[_0x32c8('0x54')](_0xdc42cf[_0x32c8('0x55')],{'$or':_[_0x32c8('0x4a')](_0xdc42cf[_0x32c8('0x4e')],function(_0x1e2154){var _0x557c65={};_0x557c65[_0x1e2154]={'$like':'%'+_0x24ab1c[_0x32c8('0x4b')][_0x32c8('0x53')]+'%'};return _0x557c65;})});}_0xdc42cf=_[_0x32c8('0x54')]({},_0xdc42cf,_0x24ab1c[_0x32c8('0x5d')]);return db[_0x32c8('0x66')][_0x32c8('0x21')]({'where':_0xdc42cf[_0x32c8('0x55')]})[_0x32c8('0x12')](function(_0x4519aa){_0x1a16ec[_0x32c8('0x21')]=_0x4519aa;if(_0x24ab1c[_0x32c8('0x4b')]['includeAll']){_0xdc42cf[_0x32c8('0x58')]=[{'all':!![]}];}return db[_0x32c8('0x66')][_0x32c8('0x59')](_0xdc42cf);})[_0x32c8('0x12')](function(_0x5287ae){_0x1a16ec[_0x32c8('0x6c')]=_0x5287ae;return _0x1a16ec;});}})[_0x32c8('0x12')](respondWithFilteredResult(_0x138ba7,_0xdc42cf))[_0x32c8('0x5f')](handleError(_0x138ba7,null));};exports[_0x32c8('0x6d')]=function(_0x4fbabd,_0x38a520){return db[_0x32c8('0x5b')][_0x32c8('0x5e')]({'where':{'id':_0x4fbabd['params']['id']}})[_0x32c8('0x12')](handleEntityNotFound(_0x38a520,null))[_0x32c8('0x12')](function(_0x491be2){if(_0x491be2){return _0x491be2[_0x32c8('0x6d')](_0x4fbabd[_0x32c8('0x4b')][_0x32c8('0x6e')]);}})[_0x32c8('0x12')](respondWithStatusCode(_0x38a520,null))[_0x32c8('0x5f')](handleError(_0x38a520,null));};exports[_0x32c8('0x6f')]=function(_0x559790,_0x30314a){if(_0x559790[_0x32c8('0x60')]['id']){delete _0x559790[_0x32c8('0x60')]['id'];}return db[_0x32c8('0x5b')]['find']({'where':{'id':_0x559790[_0x32c8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x30314a,null))[_0x32c8('0x12')](function(_0x27fea3){if(_0x27fea3){_0x559790[_0x32c8('0x60')]['MailAccountId']=_0x27fea3['id'];return db[_0x32c8('0x70')][_0x32c8('0x67')](_0x559790[_0x32c8('0x60')]);}})['then'](respondWithResult(_0x30314a,null))['catch'](handleError(_0x30314a,null));};exports[_0x32c8('0x71')]=function(_0xcc6f6b,_0x1a4ec6){var _0x3ac190={'raw':![],'where':{}};var _0x54bf63={};var _0x4764b3={'count':0x0,'rows':[]};return db[_0x32c8('0x5b')][_0x32c8('0x69')]({'where':{'id':_0xcc6f6b[_0x32c8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1a4ec6,null))[_0x32c8('0x12')](function(_0x11e599){if(_0x11e599){_0x54bf63[_0x32c8('0x49')]=_['keys'](db[_0x32c8('0x70')][_0x32c8('0x46')]);_0x54bf63[_0x32c8('0x4b')]=_[_0x32c8('0x4c')](_0xcc6f6b[_0x32c8('0x4b')]);_0x54bf63[_0x32c8('0x52')]=_[_0x32c8('0x4d')](_0x54bf63[_0x32c8('0x49')],_0x54bf63[_0x32c8('0x4b')]);_0x3ac190['attributes']=_['intersection'](_0x54bf63[_0x32c8('0x49')],qs[_0x32c8('0x4f')](_0xcc6f6b[_0x32c8('0x4b')][_0x32c8('0x4f')]));_0x3ac190[_0x32c8('0x4e')]=_0x3ac190['attributes'][_0x32c8('0x5c')]?_0x3ac190[_0x32c8('0x4e')]:_0x54bf63['model'];if(!_0xcc6f6b[_0x32c8('0x4b')][_0x32c8('0x6a')](_0x32c8('0x50'))){_0x3ac190[_0x32c8('0x1f')]=qs[_0x32c8('0x1f')](_0xcc6f6b[_0x32c8('0x4b')][_0x32c8('0x1f')]);_0x3ac190['offset']=qs['offset'](_0xcc6f6b[_0x32c8('0x4b')]['offset']);}_0x3ac190[_0x32c8('0x72')]=qs[_0x32c8('0x51')](_0xcc6f6b['query']['sort']);_0x3ac190[_0x32c8('0x55')]=qs[_0x32c8('0x52')](_[_0x32c8('0x6b')](_0xcc6f6b[_0x32c8('0x4b')],_0x54bf63['filters']));_0x3ac190['where']['MailAccountId']=_0x11e599['id'];if(_0xcc6f6b[_0x32c8('0x4b')][_0x32c8('0x53')]){_0x3ac190[_0x32c8('0x55')]=_[_0x32c8('0x54')](_0x3ac190[_0x32c8('0x55')],{'$or':_[_0x32c8('0x4a')](_0x3ac190[_0x32c8('0x4e')],function(_0x40ffe4){var _0x74b250={};_0x74b250[_0x40ffe4]={'$like':'%'+_0xcc6f6b[_0x32c8('0x4b')][_0x32c8('0x53')]+'%'};return _0x74b250;})});}_0x3ac190=_[_0x32c8('0x54')]({},_0x3ac190,_0xcc6f6b[_0x32c8('0x5d')]);return db['CannedAnswer']['count']({'where':_0x3ac190['where']})['then'](function(_0xf52da){_0x4764b3['count']=_0xf52da;if(_0xcc6f6b[_0x32c8('0x4b')][_0x32c8('0x57')]){_0x3ac190[_0x32c8('0x58')]=[{'all':!![]}];}return db[_0x32c8('0x70')]['findAll'](_0x3ac190);})[_0x32c8('0x12')](function(_0x2f39d6){_0x4764b3[_0x32c8('0x6c')]=_0x2f39d6;return _0x4764b3;});}})[_0x32c8('0x12')](respondWithFilteredResult(_0x1a4ec6,_0x3ac190))[_0x32c8('0x5f')](handleError(_0x1a4ec6,null));};exports[_0x32c8('0x73')]=function(_0x5ee55c,_0x98853b){return db[_0x32c8('0x5b')][_0x32c8('0x5e')]({'where':{'id':_0x5ee55c[_0x32c8('0x5a')]['id']}})[_0x32c8('0x12')](handleEntityNotFound(_0x98853b,null))[_0x32c8('0x12')](function(_0x2f370a){if(_0x2f370a){return _0x2f370a[_0x32c8('0x73')](_0x5ee55c['query'][_0x32c8('0x6e')]);}})[_0x32c8('0x12')](respondWithStatusCode(_0x98853b,null))['catch'](handleError(_0x98853b,null));};exports['create']=function(_0x5ead58,_0x3a88ec){var _0x3a2ecc={'name':_0x5ead58[_0x32c8('0x60')][_0x32c8('0x29')],'key':_0x5ead58[_0x32c8('0x60')][_0x32c8('0x74')],'provider':_0x5ead58[_0x32c8('0x60')][_0x32c8('0x61')]===_0x32c8('0x62')?null:_0x5ead58[_0x32c8('0x60')][_0x32c8('0x61')],'email':_0x5ead58[_0x32c8('0x60')]['email'],'ListId':_0x5ead58[_0x32c8('0x60')][_0x32c8('0x75')],'active':!_[_0x32c8('0x76')](_0x5ead58[_0x32c8('0x60')][_0x32c8('0x77')])?_0x5ead58[_0x32c8('0x60')]['active']:!![],'description':_0x5ead58[_0x32c8('0x60')][_0x32c8('0x78')]||null};var _0x388e12=getAuthenticationOptions(_0x3a2ecc['provider'],_0x5ead58[_0x32c8('0x60')]);_0x3a2ecc[_0x32c8('0x3f')]=_0x388e12[_0x32c8('0x3f')];_0x3a2ecc[_0x32c8('0x40')]=_0x388e12[_0x32c8('0x40')];return db[_0x32c8('0x5b')][_0x32c8('0x67')](_0x3a2ecc,{'include':[{'model':db[_0x32c8('0x43')],'as':_0x32c8('0x40')},{'model':db[_0x32c8('0x42')],'as':_0x32c8('0x3f')}]})[_0x32c8('0x12')](function(_0x3d8820){var _0x421da6=_0x5ead58[_0x32c8('0x35')][_0x32c8('0x24')]({'plain':!![]});if(!_0x421da6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x421da6[_0x32c8('0x79')]===_0x32c8('0x35')){var _0x247324=_0x3d8820[_0x32c8('0x24')]({'plain':!![]});return db[_0x32c8('0x7a')][_0x32c8('0x5e')]({'where':{'name':'MailAccounts','userProfileId':_0x421da6[_0x32c8('0x7b')]},'raw':!![]})[_0x32c8('0x12')](function(_0x25ec81){if(_0x25ec81&&_0x25ec81['autoAssociation']===0x0){return db[_0x32c8('0x26')]['create']({'name':_0x247324['name'],'resourceId':_0x247324['id'],'type':_0x25ec81[_0x32c8('0x29')],'sectionId':_0x25ec81['id']},{})[_0x32c8('0x12')](function(){return _0x3d8820;});}else{return _0x3d8820;}})['catch'](function(_0x21a22b){logger[_0x32c8('0x17')](_0x32c8('0x7c'),_0x21a22b);throw _0x21a22b;});}return _0x3d8820;})[_0x32c8('0x12')](respondWithResult(_0x3a88ec,0xc9))[_0x32c8('0x5f')](handleError(_0x3a88ec,null));};exports[_0x32c8('0x7d')]=function(_0x17d4b2,_0x2defa0){return db[_0x32c8('0x5b')][_0x32c8('0x69')]({'where':{'id':_0x17d4b2['params']['id']}})[_0x32c8('0x12')](handleEntityNotFound(_0x2defa0,null))[_0x32c8('0x12')](function(_0x545460){if(_0x545460){return _0x545460[_0x32c8('0x7d')]();}return null;})['then'](respondWithResult(_0x2defa0,null))['catch'](handleError(_0x2defa0,null));};exports[_0x32c8('0x7e')]=function(_0x3320f7,_0x4eda93){if(_0x3320f7[_0x32c8('0x60')]['id']){delete _0x3320f7[_0x32c8('0x60')]['id'];}return db['MailAccount'][_0x32c8('0x5e')]({'where':{'id':_0x3320f7[_0x32c8('0x5a')]['id']}})[_0x32c8('0x12')](handleEntityNotFound(_0x4eda93,null))[_0x32c8('0x12')](function(_0x463aac){if(_0x463aac){_0x3320f7['body'][_0x32c8('0x65')]=_0x463aac['id'];return db[_0x32c8('0x42')][_0x32c8('0x67')](_0x3320f7['body']);}})[_0x32c8('0x12')](respondWithResult(_0x4eda93,null))[_0x32c8('0x5f')](handleError(_0x4eda93,null));};exports[_0x32c8('0x7f')]=function(_0xaf348,_0x25ae60){return db['MailAccount'][_0x32c8('0x69')]({'where':{'id':_0xaf348[_0x32c8('0x5a')]['id']}})[_0x32c8('0x12')](handleEntityNotFound(_0x25ae60,null))[_0x32c8('0x12')](function(_0x5c67b0){if(_0x5c67b0){return _0x5c67b0[_0x32c8('0x80')](null);}return null;})['then'](respondWithStatusCode(_0x25ae60,null))['catch'](handleError(_0x25ae60,null));};exports[_0x32c8('0x81')]=function(_0x5238d0,_0x2547b7){return db[_0x32c8('0x5b')][_0x32c8('0x69')]({'where':{'id':_0x5238d0['params']['id']}})[_0x32c8('0x12')](handleEntityNotFound(_0x2547b7,null))['then'](function(_0x2b92bd){if(_0x2b92bd){return _0x2b92bd[_0x32c8('0x81')]();}return null;})[_0x32c8('0x12')](respondWithResult(_0x2547b7,null))['catch'](handleError(_0x2547b7,null));};exports[_0x32c8('0x82')]=function(_0x3155c3,_0x447502){if(_0x3155c3['body']['id']){delete _0x3155c3[_0x32c8('0x60')]['id'];}return db['MailAccount'][_0x32c8('0x5e')]({'where':{'id':_0x3155c3['params']['id']}})['then'](handleEntityNotFound(_0x447502,null))[_0x32c8('0x12')](function(_0x2f6ab){if(_0x2f6ab){_0x3155c3[_0x32c8('0x60')][_0x32c8('0x65')]=_0x2f6ab['id'];return db[_0x32c8('0x43')][_0x32c8('0x67')](_0x3155c3[_0x32c8('0x60')]);}})[_0x32c8('0x12')](respondWithResult(_0x447502,null))[_0x32c8('0x5f')](handleError(_0x447502,null));};exports[_0x32c8('0x83')]=function(_0x1ef48f,_0x256b45){return db['MailAccount'][_0x32c8('0x69')]({'where':{'id':_0x1ef48f['params']['id']}})['then'](handleEntityNotFound(_0x256b45,null))[_0x32c8('0x12')](function(_0x504f95){if(_0x504f95){return _0x504f95['setSmtp'](null);}return null;})[_0x32c8('0x12')](respondWithStatusCode(_0x256b45,null))[_0x32c8('0x5f')](handleError(_0x256b45,null));};exports[_0x32c8('0x84')]=function(_0x51b24d,_0x2a49c5){return db[_0x32c8('0x85')][_0x32c8('0x5e')]({'where':{'id':_0x51b24d['params']['id']}})['then'](handleEntityNotFound(_0x2a49c5,null))['then'](function(_0x23df82){if(_0x23df82){return _0x23df82[_0x32c8('0x84')](_0x51b24d[_0x32c8('0x60')][_0x32c8('0x6e')],_['omit'](_0x51b24d[_0x32c8('0x60')],[_0x32c8('0x6e'),'id'])||{});}})['then'](respondWithResult(_0x2a49c5,null))[_0x32c8('0x5f')](handleError(_0x2a49c5,null));};exports[_0x32c8('0x86')]=function(_0x1e2188,_0x3edb75){var _0xc445fa={'raw':![],'where':{}};var _0x5a4e97={};var _0x490073={'count':0x0,'rows':[]};return db[_0x32c8('0x5b')]['findOne']({'where':{'id':_0x1e2188[_0x32c8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3edb75,null))[_0x32c8('0x12')](function(_0x1e3349){if(_0x1e3349){_0x5a4e97['model']=_[_0x32c8('0x4c')](db['MailInteraction'][_0x32c8('0x46')]);_0x5a4e97['query']=_[_0x32c8('0x4c')](_0x1e2188[_0x32c8('0x4b')]);_0x5a4e97[_0x32c8('0x52')]=_[_0x32c8('0x4d')](_0x5a4e97[_0x32c8('0x49')],_0x5a4e97[_0x32c8('0x4b')]);_0xc445fa['attributes']=_[_0x32c8('0x4d')](_0x5a4e97[_0x32c8('0x49')],qs[_0x32c8('0x4f')](_0x1e2188[_0x32c8('0x4b')][_0x32c8('0x4f')]));_0xc445fa[_0x32c8('0x4e')]=_0xc445fa[_0x32c8('0x4e')]['length']?_0xc445fa[_0x32c8('0x4e')]:_0x5a4e97['model'];if(!_0x1e2188[_0x32c8('0x4b')]['hasOwnProperty']('nolimit')){_0xc445fa['limit']=qs[_0x32c8('0x1f')](_0x1e2188[_0x32c8('0x4b')][_0x32c8('0x1f')]);_0xc445fa[_0x32c8('0x1e')]=qs[_0x32c8('0x1e')](_0x1e2188[_0x32c8('0x4b')][_0x32c8('0x1e')]);}_0xc445fa[_0x32c8('0x72')]=qs[_0x32c8('0x51')](_0x1e2188[_0x32c8('0x4b')]['sort']);_0xc445fa[_0x32c8('0x55')]=qs['filters'](_[_0x32c8('0x6b')](_0x1e2188['query'],_0x5a4e97['filters']));_0xc445fa[_0x32c8('0x55')]['MailAccountId']=_0x1e3349['id'];if(_0x1e2188[_0x32c8('0x4b')][_0x32c8('0x53')]){_0xc445fa[_0x32c8('0x55')]=_[_0x32c8('0x54')](_0xc445fa[_0x32c8('0x55')],{'$or':_[_0x32c8('0x4a')](_0xc445fa['attributes'],function(_0x2f2061){var _0x153b3b={};_0x153b3b[_0x2f2061]={'$like':'%'+_0x1e2188[_0x32c8('0x4b')][_0x32c8('0x53')]+'%'};return _0x153b3b;})});}_0xc445fa=_[_0x32c8('0x54')]({},_0xc445fa,_0x1e2188[_0x32c8('0x5d')]);return db[_0x32c8('0x85')][_0x32c8('0x21')]({'where':_0xc445fa[_0x32c8('0x55')]})[_0x32c8('0x12')](function(_0x424fa9){_0x490073['count']=_0x424fa9;if(_0x1e2188['query'][_0x32c8('0x57')]){_0xc445fa[_0x32c8('0x58')]=[{'model':db['CmContact'],'as':_0x32c8('0x87'),'required':![]},{'model':db['User'],'as':_0x32c8('0x88'),'attributes':['name',_0x32c8('0x89'),_0x32c8('0x8a')],'required':![]},{'model':db[_0x32c8('0x8b')],'as':_0x32c8('0x8c'),'attributes':['id',_0x32c8('0x29'),'color'],'where':_0x1e2188[_0x32c8('0x4b')][_0x32c8('0x8d')]?{'id':_0x1e2188['query'][_0x32c8('0x8d')]}:undefined,'required':_0x1e2188['query'][_0x32c8('0x8d')]?!![]:![]}];}return db[_0x32c8('0x85')][_0x32c8('0x59')](_0xc445fa);})[_0x32c8('0x12')](function(_0x3ac248){_0x490073[_0x32c8('0x6c')]=_0x3ac248;return _0x490073;});}})[_0x32c8('0x12')](respondWithFilteredResult(_0x3edb75,_0xc445fa))[_0x32c8('0x5f')](handleError(_0x3edb75,null));};exports[_0x32c8('0x8e')]=function addApplications(_0x539398,_0x223ccf){var _0x50f837=_0x539398[_0x32c8('0x5a')]['id'];var _0x20b482=_0x539398['body'];var _0x589d17=0xc8;var _0x167631=null;return db[_0x32c8('0x8f')][_0x32c8('0x90')]({'isolationLevel':db['sequelize']['Transaction'][_0x32c8('0x91')][_0x32c8('0x92')]},function(_0x31244d){return db['MailAccount']['findOne']({'where':{'id':_0x50f837},'transaction':_0x31244d})[_0x32c8('0x12')](function(_0x5be410){if(_0x5be410){return db['MailApplication'][_0x32c8('0x23')]({'where':{'MailAccountId':_0x50f837},'transaction':_0x31244d})[_0x32c8('0x12')](function(){var _0x3fc731=_['map'](_0x20b482,function(_0x3ba00f){_0x3ba00f[_0x32c8('0x65')]=_0x50f837;return _0x3ba00f;});return db[_0x32c8('0x93')]['bulkCreate'](_0x3fc731,{'transaction':_0x31244d});});}else{_0x589d17=0x194;_0x167631=[];}});})[_0x32c8('0x12')](function(){if(_0x589d17!==0x194){return db[_0x32c8('0x93')][_0x32c8('0x94')]({'where':{'MailAccountId':_0x50f837},'order':_0x32c8('0x95')})[_0x32c8('0x12')](function(_0x1c46e6){_0x167631=_0x1c46e6;});}})[_0x32c8('0x5f')](function(_0x23ff5d){_0x589d17=0x1f4;logger[_0x32c8('0x17')](_0x23ff5d[_0x32c8('0x28')]);if(_0x23ff5d['name']){delete _0x23ff5d['name'];}_0x167631=_0x23ff5d;})[_0x32c8('0x96')](function(){if(_0x167631===null){_0x223ccf['sendStatus'](_0x589d17);}else{if(_0x589d17===0x1f4){_0x223ccf[_0x32c8('0x1b')](_0x589d17)[_0x32c8('0x2a')](_0x167631);}else{_0x223ccf[_0x32c8('0x1b')](_0x589d17)[_0x32c8('0x1d')](_0x167631);}}});};exports[_0x32c8('0x97')]=function(_0x3a7292,_0x1a31f6){var _0x12add2={};var _0x31b8a1={};var _0x2ef495;var _0x5c5ffa;return db[_0x32c8('0x5b')]['findOne']({'where':{'id':_0x3a7292[_0x32c8('0x5a')]['id']}})[_0x32c8('0x12')](handleEntityNotFound(_0x1a31f6,null))[_0x32c8('0x12')](function(_0x1cc539){if(_0x1cc539){_0x2ef495=_0x1cc539;_0x31b8a1[_0x32c8('0x49')]=_[_0x32c8('0x4c')](db[_0x32c8('0x93')][_0x32c8('0x46')]);_0x31b8a1[_0x32c8('0x4b')]=_[_0x32c8('0x4c')](_0x3a7292[_0x32c8('0x4b')]);_0x31b8a1[_0x32c8('0x52')]=_[_0x32c8('0x4d')](_0x31b8a1['model'],_0x31b8a1['query']);_0x12add2['attributes']=_[_0x32c8('0x4d')](_0x31b8a1['model'],qs[_0x32c8('0x4f')](_0x3a7292[_0x32c8('0x4b')]['fields']));_0x12add2[_0x32c8('0x4e')]=_0x12add2[_0x32c8('0x4e')][_0x32c8('0x5c')]?_0x12add2[_0x32c8('0x4e')]:_0x31b8a1['model'];_0x12add2[_0x32c8('0x72')]=qs['sort'](_0x3a7292[_0x32c8('0x4b')][_0x32c8('0x51')]);_0x12add2['where']=qs['filters'](_[_0x32c8('0x6b')](_0x3a7292['query'],_0x31b8a1['filters']));if(_0x3a7292[_0x32c8('0x4b')]['filter']){_0x12add2[_0x32c8('0x55')]=_['merge'](_0x12add2[_0x32c8('0x55')],{'$or':_['map'](_0x12add2[_0x32c8('0x4e')],function(_0x13aedc){var _0x18faba={};_0x18faba[_0x13aedc]={'$like':'%'+_0x3a7292[_0x32c8('0x4b')][_0x32c8('0x53')]+'%'};return _0x18faba;})});}_0x12add2=_['merge']({},_0x12add2,_0x3a7292['options']);return _0x2ef495['getApplications'](_0x12add2);}})[_0x32c8('0x12')](function(_0x1a0712){if(_0x1a0712){_0x5c5ffa=_0x1a0712[_0x32c8('0x5c')];if(!_0x3a7292['query'][_0x32c8('0x6a')](_0x32c8('0x50'))){_0x12add2[_0x32c8('0x1f')]=qs[_0x32c8('0x1f')](_0x3a7292[_0x32c8('0x4b')][_0x32c8('0x1f')]);_0x12add2[_0x32c8('0x1e')]=qs[_0x32c8('0x1e')](_0x3a7292['query']['offset']);}return _0x2ef495[_0x32c8('0x97')](_0x12add2);}})[_0x32c8('0x12')](function(_0x4ef88a){if(_0x4ef88a){return _0x4ef88a?{'count':_0x5c5ffa,'rows':_0x4ef88a}:null;}})[_0x32c8('0x12')](respondWithResult(_0x1a31f6,null))['catch'](handleError(_0x1a31f6,null));};exports[_0x32c8('0x98')]=function(_0x6aa29f,_0x3cded6){var _0x382f46={'raw':!![],'where':{}};var _0x137128={};var _0x5c8e50={'count':0x0,'rows':[]};return db[_0x32c8('0x5b')][_0x32c8('0x69')]({'where':{'id':_0x6aa29f[_0x32c8('0x5a')]['id']}})[_0x32c8('0x12')](handleEntityNotFound(_0x3cded6,null))[_0x32c8('0x12')](function(_0x371bb6){if(_0x371bb6){_0x137128[_0x32c8('0x49')]=_['keys'](db[_0x32c8('0x99')][_0x32c8('0x46')]);_0x137128['query']=_[_0x32c8('0x4c')](_0x6aa29f['query']);_0x137128[_0x32c8('0x52')]=_[_0x32c8('0x4d')](_0x137128[_0x32c8('0x49')],_0x137128[_0x32c8('0x4b')]);_0x382f46[_0x32c8('0x4e')]=_[_0x32c8('0x4d')](_0x137128[_0x32c8('0x49')],qs['fields'](_0x6aa29f[_0x32c8('0x4b')][_0x32c8('0x4f')]));_0x382f46[_0x32c8('0x4e')]=_0x382f46[_0x32c8('0x4e')][_0x32c8('0x5c')]?_0x382f46['attributes']:_0x137128[_0x32c8('0x49')];if(!_0x6aa29f[_0x32c8('0x4b')][_0x32c8('0x6a')](_0x32c8('0x50'))){_0x382f46['limit']=qs['limit'](_0x6aa29f['query'][_0x32c8('0x1f')]);_0x382f46['offset']=qs['offset'](_0x6aa29f['query'][_0x32c8('0x1e')]);}_0x382f46[_0x32c8('0x72')]=qs[_0x32c8('0x51')](_0x6aa29f['query'][_0x32c8('0x51')]);_0x382f46['where']=qs['filters'](_[_0x32c8('0x6b')](_0x6aa29f[_0x32c8('0x4b')],_0x137128[_0x32c8('0x52')]));_0x382f46[_0x32c8('0x55')][_0x32c8('0x65')]=_0x371bb6['id'];if(_0x6aa29f[_0x32c8('0x4b')][_0x32c8('0x53')]){_0x382f46[_0x32c8('0x55')]=_[_0x32c8('0x54')](_0x382f46[_0x32c8('0x55')],{'$or':_[_0x32c8('0x4a')](_0x382f46[_0x32c8('0x4e')],function(_0x3d3b58){var _0x548819={};_0x548819[_0x3d3b58]={'$like':'%'+_0x6aa29f[_0x32c8('0x4b')]['filter']+'%'};return _0x548819;})});}if(_0x6aa29f[_0x32c8('0x4b')][_0x32c8('0x9a')]){var _0x22a38c=_0x6aa29f[_0x32c8('0x4b')]['$gte'][_0x32c8('0x9b')](',');var _0x199fa2={};_0x199fa2[_0x22a38c[0x0]]={'$gte':moment(_0x22a38c[0x1])['format'](_0x32c8('0x9c'))};_0x382f46[_0x32c8('0x55')]=_[_0x32c8('0x54')](_0x382f46[_0x32c8('0x55')],_0x199fa2);}_0x382f46=_[_0x32c8('0x54')]({},_0x382f46,_0x6aa29f[_0x32c8('0x5d')]);return db[_0x32c8('0x99')][_0x32c8('0x21')]({'where':_0x382f46[_0x32c8('0x55')]})[_0x32c8('0x12')](function(_0x2b9ff7){_0x5c8e50[_0x32c8('0x21')]=_0x2b9ff7;if(_0x6aa29f[_0x32c8('0x4b')][_0x32c8('0x57')]){_0x382f46['include']=[{'all':!![]}];}return db[_0x32c8('0x99')][_0x32c8('0x59')](_0x382f46);})[_0x32c8('0x12')](function(_0x282dcf){if(_0x6aa29f[_0x32c8('0x4b')][_0x32c8('0x9d')]===_0x32c8('0x9e')){for(var _0x34ea17=0x0;_0x34ea17<_0x282dcf['length'];_0x34ea17++){_0x282dcf[_0x34ea17][_0x32c8('0x60')]=juice(_0x282dcf[_0x34ea17][_0x32c8('0x60')]);}}_0x5c8e50[_0x32c8('0x6c')]=_0x282dcf;return _0x5c8e50;});}})[_0x32c8('0x12')](respondWithFilteredResult(_0x3cded6,_0x382f46))[_0x32c8('0x5f')](handleError(_0x3cded6,null));};exports['send']=function(_0x50beb6,_0x290cf0){var _0x3a6b42,_0x12d53c={},_0x1a995d;if(_0x50beb6[_0x32c8('0x60')]['to']){_0x1a995d=_0x50beb6['body']['to'][_0x32c8('0x9b')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x50beb6[_0x32c8('0x5a')]['id']},'include':[{'model':db[_0x32c8('0x9f')],'as':_0x32c8('0xa0'),'include':[{'model':db['CmContact'],'as':_0x32c8('0xa1'),'where':{'email':_0x1a995d},'limit':0x1,'order':[[_0x32c8('0xa2'),_0x32c8('0xa3')]]}]},{'model':db[_0x32c8('0x43')],'as':_0x32c8('0x40'),'raw':!![],'include':[{'model':db[_0x32c8('0xa4')],'as':'CloudProvider','raw':!![]}]}]})[_0x32c8('0x12')](handleEntityNotFound(_0x290cf0,null))[_0x32c8('0x12')](function(_0x6bd37e){if(!_0x6bd37e)return;_0x3a6b42=_0x6bd37e;if(!_0x6bd37e[_0x32c8('0x40')])throw new Error(_0x32c8('0xa5'));if(_['isNil'](_0x50beb6[_0x32c8('0x60')][_0x32c8('0xa6')])){_0x50beb6['body'][_0x32c8('0xa6')]=util[_0x32c8('0xa7')]('%s\x20<%s>',_0x6bd37e['name'],_0x6bd37e[_0x32c8('0xa8')]||_0x6bd37e['Smtp'][_0x32c8('0x35')]);}if(_0x50beb6['body'][_0x32c8('0xa9')]&&_0x50beb6['body'][_0x32c8('0xa9')][_0x32c8('0x5c')]){for(var _0x1899ee=0x0;_0x1899ee<_0x50beb6[_0x32c8('0x60')][_0x32c8('0xa9')]['length'];_0x1899ee+=0x1){_0x50beb6[_0x32c8('0x60')]['attachments'][_0x1899ee]={'filename':_0x50beb6['body'][_0x32c8('0xa9')][_0x1899ee][_0x32c8('0x29')],'path':path[_0x32c8('0xaa')](config[_0x32c8('0xab')],_0x32c8('0xac'),_0x50beb6[_0x32c8('0x60')][_0x32c8('0xa9')][_0x1899ee][_0x32c8('0xad')])};}}var _0xbe5103=_0x6bd37e[_0x32c8('0xae')]();return respondWithRpcPromise('SendMail',_0x32c8('0xaf'),{'account':_0xbe5103,'message':_0x50beb6[_0x32c8('0x60')]});})[_0x32c8('0x12')](function(_0xd8f5db){if(!_0xd8f5db)return;_0x12d53c=_0xd8f5db;if(!_0x3a6b42['List'])throw new Error(_0x32c8('0xb0'));if(_0x3a6b42['List']['Contacts'][_0x32c8('0x5c')])return _0x3a6b42[_0x32c8('0xa0')][_0x32c8('0xa1')][0x0];return db[_0x32c8('0xb1')][_0x32c8('0x67')](_[_0x32c8('0xb')](_0x50beb6[_0x32c8('0x60')],{'firstName':_0x50beb6[_0x32c8('0x60')]['to'],'email':_0x50beb6[_0x32c8('0x60')]['to'],'phone':_0x50beb6['body']['to'],'ListId':_0x3a6b42['ListId']}));})[_0x32c8('0x12')](function(_0x5e7fc3){if(!_0x5e7fc3)return;var _0x553506={'UserId':_0x50beb6[_0x32c8('0x35')]['id'],'ContactId':_0x5e7fc3['id'],'MailAccountId':_0x3a6b42['id'],'inReplyTo':_0x12d53c[_0x32c8('0xb2')],'to':_0x50beb6['body']['from'],'cc':_0x50beb6[_0x32c8('0x60')]['cc'],'subject':_0x50beb6[_0x32c8('0x60')]['subject'],'attach':_0x50beb6['body'][_0x32c8('0xb3')],'firstMsgDirection':_0x32c8('0xb4'),'lastMsgAt':moment()[_0x32c8('0xa7')](_0x32c8('0x9c')),'lastMsgDirection':_0x32c8('0xb4'),'Messages':[_[_0x32c8('0x54')](_0x50beb6['body'],{'messageId':_0x12d53c[_0x32c8('0xb2')],'sentAt':moment()[_0x32c8('0xa7')](_0x32c8('0x9c')),'read':!![],'MailAccountId':_0x3a6b42['id'],'UserId':_0x50beb6[_0x32c8('0x35')]['id'],'ContactId':_0x5e7fc3['id']})]};if(_0x50beb6[_0x32c8('0x60')][_0x32c8('0xb5')]){_0x553506=_[_0x32c8('0x54')](_0x553506,_0x50beb6[_0x32c8('0x60')][_0x32c8('0xb5')]);}return db[_0x32c8('0x85')][_0x32c8('0x67')](_0x553506,{'include':[{'model':db[_0x32c8('0x99')],'as':_0x32c8('0xb6')}]});})[_0x32c8('0x12')](respondWithResult(_0x290cf0,null))[_0x32c8('0x5f')](handleError(_0x290cf0,null));};exports[_0x32c8('0xb7')]=function(_0x2d0253,_0x35e645){return db[_0x32c8('0x5b')][_0x32c8('0x5e')]({'where':{'id':_0x2d0253[_0x32c8('0x5a')]['id']},'include':[{'model':db[_0x32c8('0x43')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x32c8('0xa4')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x35e645,null))[_0x32c8('0x12')](function(_0x108780){if(!_0x108780['Smtp'])return;var _0xa5acf4=_0x108780[_0x32c8('0xae')]();return respondWithRpcPromise(_0x32c8('0xb8'),'verifySmtp',{'account':_0xa5acf4});})[_0x32c8('0x12')](respondWithResult(_0x35e645,null))['catch'](handleError(_0x35e645,null));};exports[_0x32c8('0x23')]=function(_0x1174d2,_0x1a6373){return db[_0x32c8('0x5b')][_0x32c8('0x5e')]({'where':{'id':_0x1174d2[_0x32c8('0x5a')]['id']}})[_0x32c8('0x12')](handleEntityNotFound(_0x1a6373,null))[_0x32c8('0x12')](function(_0x2b9108){if(_0x2b9108&&_0x2b9108[_0x32c8('0x3d')]){throw new db[(_0x32c8('0xb9'))][(_0x32c8('0xba'))](_0x32c8('0xbb'));}return _0x2b9108;})['then'](removeEntity(_0x1a6373,null))[_0x32c8('0x5f')](handleError(_0x1a6373,null));};exports['addAgents']=function(_0x5856b7,_0x3c7605){return db[_0x32c8('0x5b')]['find']({'where':{'id':_0x5856b7[_0x32c8('0x5a')]['id']}})[_0x32c8('0x12')](handleEntityNotFound(_0x3c7605,null))[_0x32c8('0x12')](function(_0x1529a2){if(_0x1529a2){return _0x1529a2['addAgents'](_0x5856b7[_0x32c8('0x60')][_0x32c8('0x6e')],_[_0x32c8('0xbc')](_0x5856b7[_0x32c8('0x60')],[_0x32c8('0x6e'),'id'])||{})[_0x32c8('0xbd')](function(_0x52be45){for(var _0x5ca186=0x0;_0x5ca186<_0x5856b7[_0x32c8('0x60')][_0x32c8('0x6e')][_0x32c8('0x5c')];_0x5ca186+=0x1){socket[_0x32c8('0xbe')](_0x32c8('0xbf'),{'UserId':Number(_0x5856b7[_0x32c8('0x60')][_0x32c8('0x6e')][_0x5ca186]),'MailAccountId':Number(_0x5856b7[_0x32c8('0x5a')]['id'])});}return _0x52be45;});}})[_0x32c8('0x12')](respondWithResult(_0x3c7605,null))[_0x32c8('0x5f')](handleError(_0x3c7605,null));};exports['removeAgents']=function(_0x4ae7d1,_0x1269b0){return db['MailAccount'][_0x32c8('0x5e')]({'where':{'id':_0x4ae7d1[_0x32c8('0x5a')]['id']}})[_0x32c8('0x12')](handleEntityNotFound(_0x1269b0,null))[_0x32c8('0x12')](function(_0x4ab307){if(_0x4ab307){return _0x4ab307[_0x32c8('0xc0')](_0x4ae7d1[_0x32c8('0x4b')][_0x32c8('0x6e')])[_0x32c8('0x12')](function(){if(_[_0x32c8('0xc1')](_0x4ae7d1[_0x32c8('0x4b')]['ids'])){for(var _0x340bf5=0x0;_0x340bf5<_0x4ae7d1[_0x32c8('0x4b')][_0x32c8('0x6e')]['length'];_0x340bf5+=0x1){socket[_0x32c8('0xbe')](_0x32c8('0xc2'),{'UserId':Number(_0x4ae7d1[_0x32c8('0x4b')][_0x32c8('0x6e')][_0x340bf5]),'MailAccountId':Number(_0x4ae7d1[_0x32c8('0x5a')]['id'])});}}else{socket['emit'](_0x32c8('0xc2'),{'UserId':Number(_0x4ae7d1[_0x32c8('0x4b')]['ids']),'MailAccountId':Number(_0x4ae7d1[_0x32c8('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x1269b0,null))[_0x32c8('0x5f')](handleError(_0x1269b0,null));};exports[_0x32c8('0xc3')]=function(_0x817ce5,_0x25f1c7){var _0x39b717={};var _0x176288={};var _0x281933;var _0x36daed;return db[_0x32c8('0x5b')][_0x32c8('0x69')]({'where':{'id':_0x817ce5['params']['id']}})[_0x32c8('0x12')](handleEntityNotFound(_0x25f1c7,null))[_0x32c8('0x12')](function(_0x418240){if(_0x418240){_0x281933=_0x418240;_0x176288[_0x32c8('0x49')]=_[_0x32c8('0x4c')](db[_0x32c8('0xc4')][_0x32c8('0x46')]);_0x176288[_0x32c8('0x4b')]=_['keys'](_0x817ce5[_0x32c8('0x4b')]);_0x176288['filters']=_[_0x32c8('0x4d')](_0x176288['model'],_0x176288[_0x32c8('0x4b')]);_0x39b717[_0x32c8('0x4e')]=_[_0x32c8('0x4d')](_0x176288[_0x32c8('0x49')],qs['fields'](_0x817ce5[_0x32c8('0x4b')][_0x32c8('0x4f')]));_0x39b717[_0x32c8('0x4e')]=_0x39b717[_0x32c8('0x4e')][_0x32c8('0x5c')]?_0x39b717[_0x32c8('0x4e')]:_0x176288[_0x32c8('0x49')];_0x39b717[_0x32c8('0x72')]=qs[_0x32c8('0x51')](_0x817ce5[_0x32c8('0x4b')][_0x32c8('0x51')]);_0x39b717[_0x32c8('0x55')]=qs[_0x32c8('0x52')](_[_0x32c8('0x6b')](_0x817ce5[_0x32c8('0x4b')],_0x176288[_0x32c8('0x52')]));if(_0x817ce5[_0x32c8('0x4b')]['filter']){_0x39b717[_0x32c8('0x55')]=_[_0x32c8('0x54')](_0x39b717[_0x32c8('0x55')],{'$or':_['map'](_0x39b717[_0x32c8('0x4e')],function(_0x2914de){var _0x4b25ab={};_0x4b25ab[_0x2914de]={'$like':'%'+_0x817ce5[_0x32c8('0x4b')][_0x32c8('0x53')]+'%'};return _0x4b25ab;})});}_0x39b717=_[_0x32c8('0x54')]({},_0x39b717,_0x817ce5[_0x32c8('0x5d')]);return _0x281933[_0x32c8('0xc3')](_0x39b717);}})[_0x32c8('0x12')](function(_0x546f50){if(_0x546f50){_0x36daed=_0x546f50[_0x32c8('0x5c')];if(!_0x817ce5[_0x32c8('0x4b')][_0x32c8('0x6a')](_0x32c8('0x50'))){_0x39b717[_0x32c8('0x1f')]=qs[_0x32c8('0x1f')](_0x817ce5[_0x32c8('0x4b')][_0x32c8('0x1f')]);_0x39b717[_0x32c8('0x1e')]=qs[_0x32c8('0x1e')](_0x817ce5[_0x32c8('0x4b')]['offset']);}return _0x281933[_0x32c8('0xc3')](_0x39b717);}})[_0x32c8('0x12')](function(_0x333570){if(_0x333570){return _0x333570?{'count':_0x36daed,'rows':_0x333570}:null;}})[_0x32c8('0x12')](respondWithResult(_0x25f1c7,null))['catch'](handleError(_0x25f1c7,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 506d2be..9da816d 100644 --- a/server/api/mailAccount/mailAccount.events.js +++ b/server/api/mailAccount/mailAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c25=['save','update','emit','hasOwnProperty','../../mysqldb','setMaxListeners'];(function(_0x1002f9,_0x11fc2d){var _0x94fbc=function(_0x17bbc5){while(--_0x17bbc5){_0x1002f9['push'](_0x1002f9['shift']());}};_0x94fbc(++_0x11fc2d);}(_0x8c25,0xe2));var _0x58c2=function(_0x3ef010,_0x4350a3){_0x3ef010=_0x3ef010-0x0;var _0x520e9d=_0x8c25[_0x3ef010];return _0x520e9d;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x58c2('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x58c2('0x1')](0x0);var events={'afterCreate':_0x58c2('0x2'),'afterUpdate':_0x58c2('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4e5048){return function(_0x42cae6,_0xa7d84d,_0x2af6b8){MailAccountEvents['emit'](_0x4e5048+':'+_0x42cae6['id'],_0x42cae6);MailAccountEvents[_0x58c2('0x4')](_0x4e5048,_0x42cae6);_0x2af6b8(null);};}for(var e in events){if(events[_0x58c2('0x5')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0xa8f3=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save'];(function(_0x162048,_0x411f1b){var _0x2339bf=function(_0x4101a2){while(--_0x4101a2){_0x162048['push'](_0x162048['shift']());}};_0x2339bf(++_0x411f1b);}(_0xa8f3,0xc1));var _0x3a8f=function(_0x5de4db,_0x538ff7){_0x5de4db=_0x5de4db-0x0;var _0x55dfc1=_0xa8f3[_0x5de4db];return _0x55dfc1;};'use strict';var EventEmitter=require(_0x3a8f('0x0'));var MailAccount=require(_0x3a8f('0x1'))['db'][_0x3a8f('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3a8f('0x3')](0x0);var events={'afterCreate':_0x3a8f('0x4'),'afterUpdate':_0x3a8f('0x5'),'afterDestroy':_0x3a8f('0x6')};function emitEvent(_0x16c044){return function(_0x14bd62,_0x341a8f,_0x714540){MailAccountEvents[_0x3a8f('0x7')](_0x16c044+':'+_0x14bd62['id'],_0x14bd62);MailAccountEvents[_0x3a8f('0x7')](_0x16c044,_0x14bd62);_0x714540(null);};}for(var e in events){if(events[_0x3a8f('0x8')](e)){var event=events[e];MailAccount[_0x3a8f('0x9')](e,emitEvent(event));}}module[_0x3a8f('0xa')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 6ce3197..2209cdb 100644 --- a/server/api/mailAccount/mailAccount.model.js +++ b/server/api/mailAccount/mailAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x601a=['provider','custom','service','host','Smtp','port','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','data5','auth','pass','exports','define','MailAccount','mail_accounts'];(function(_0x3b38f4,_0x1458e4){var _0x5a56b9=function(_0x404d28){while(--_0x404d28){_0x3b38f4['push'](_0x3b38f4['shift']());}};_0x5a56b9(++_0x1458e4);}(_0x601a,0x81));var _0xa601=function(_0x41b94b,_0x252e4e){_0x41b94b=_0x41b94b-0x0;var _0xb78bf9=_0x601a[_0x41b94b];return _0xb78bf9;};'use strict';var attributes=require('./mailAccount.attributes');module[_0xa601('0x0')]=function(_0x1f947a){return _0x1f947a[_0xa601('0x1')](_0xa601('0x2'),attributes,{'tableName':_0xa601('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x11d213=this;var _0x880aa1={'id':_0x11d213['id'],'tls':{'rejectUnauthorized':![]}};if(_0x11d213[_0xa601('0x4')]!==_0xa601('0x5')){_0x880aa1[_0xa601('0x6')]=_0x11d213[_0xa601('0x4')];}else{_0x880aa1[_0xa601('0x7')]=_0x11d213[_0xa601('0x8')][_0xa601('0x7')];_0x880aa1['port']=_0x11d213['Smtp'][_0xa601('0x9')];_0x880aa1['secure']=_0x11d213[_0xa601('0x8')]['secure'];}if(_0x11d213['Smtp'][_0xa601('0xa')]){if(_0x11d213[_0xa601('0x8')][_0xa601('0xb')]){if(!_0x11d213[_0xa601('0x8')][_0xa601('0xc')])throw new Error(_0xa601('0xd'));_0x880aa1['auth']={'type':_0xa601('0xe'),'user':_0x11d213[_0xa601('0x8')][_0xa601('0xf')],'accessToken':_0x11d213['Smtp'][_0xa601('0xc')][_0xa601('0x10')]};}else{_0x880aa1[_0xa601('0x11')]={'user':_0x11d213[_0xa601('0x8')][_0xa601('0xf')],'pass':_0x11d213[_0xa601('0x8')][_0xa601('0x12')]};}}return _0x880aa1;}}});}; \ No newline at end of file +var _0x2cba=['CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','pass','./mailAccount.attributes','define','MailAccount','provider','custom','service','host','Smtp','port','secure','authentication','modernAuthentication'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2cba,0x79));var _0xa2cb=function(_0x452757,_0x176162){_0x452757=_0x452757-0x0;var _0xb1fbfa=_0x2cba[_0x452757];return _0xb1fbfa;};'use strict';var attributes=require(_0xa2cb('0x0'));module['exports']=function(_0x430576){return _0x430576[_0xa2cb('0x1')](_0xa2cb('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x293b21=this;var _0x26cca9={'id':_0x293b21['id'],'tls':{'rejectUnauthorized':![]}};if(_0x293b21[_0xa2cb('0x3')]!==_0xa2cb('0x4')){_0x26cca9[_0xa2cb('0x5')]=_0x293b21[_0xa2cb('0x3')];}else{_0x26cca9[_0xa2cb('0x6')]=_0x293b21[_0xa2cb('0x7')][_0xa2cb('0x6')];_0x26cca9['port']=_0x293b21[_0xa2cb('0x7')][_0xa2cb('0x8')];_0x26cca9[_0xa2cb('0x9')]=_0x293b21['Smtp'][_0xa2cb('0x9')];}if(_0x293b21[_0xa2cb('0x7')][_0xa2cb('0xa')]){if(_0x293b21[_0xa2cb('0x7')][_0xa2cb('0xb')]){if(!_0x293b21['Smtp'][_0xa2cb('0xc')])throw new Error(_0xa2cb('0xd'));_0x26cca9[_0xa2cb('0xe')]={'type':_0xa2cb('0xf'),'user':_0x293b21['Smtp'][_0xa2cb('0x10')],'accessToken':_0x293b21[_0xa2cb('0x7')][_0xa2cb('0xc')][_0xa2cb('0x11')]};}else{_0x26cca9[_0xa2cb('0xe')]={'user':_0x293b21[_0xa2cb('0x7')][_0xa2cb('0x10')],'pass':_0x293b21[_0xa2cb('0x7')][_0xa2cb('0x12')]};}}return _0x26cca9;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 3a0a850..2f9ef9b 100644 --- a/server/api/mailAccount/mailAccount.rpc.js +++ b/server/api/mailAccount/mailAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd51=['message','info','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','model','map','catch','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','CmContact','rawAttributes','createdAt','CompanyId','ListId','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','CmList','Contacts','updatedAt','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','List','get','omit','account','applications','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','defaults','from','create','List\x20not\x20found','contact','messageId','generate','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inReplyTo','Contact\x20not\x20found','update','subject','attach','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','UserId','User','name','waitForTheAssignedAgent','queueId','unshift','queue','waitForTheAssignedQueue','Start','lodash','bluebird','randomstring','ioredis','../../mysqldb','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','request','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3de8d6,_0xfd3225){_0x3de8d6=_0x3de8d6-0x0;var _0x56c117=_0xbd51[_0x3de8d6];return _0x56c117;};'use strict';var _=require(_0x1bd5('0x0'));var moment=require('moment');var BPromise=require(_0x1bd5('0x1'));var rs=require(_0x1bd5('0x2'));var Redis=require(_0x1bd5('0x3'));var db=require(_0x1bd5('0x4'))['db'];var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1bd5('0x5')][_0x1bd5('0x6')]({'port':0x232c});config[_0x1bd5('0x7')]=_['defaults'](config[_0x1bd5('0x7')],{'host':_0x1bd5('0x8'),'port':0x18eb});var socket=require(_0x1bd5('0x9'))(new Redis(config[_0x1bd5('0x7')]));require(_0x1bd5('0xa'))['register'](socket);function respondWithRpcPromise(_0x36ef1a,_0x5c8e0d,_0x2bd975){return new BPromise(function(_0x28df8e,_0x3b868a){return client[_0x1bd5('0xb')](_0x36ef1a,_0x2bd975)[_0x1bd5('0xc')](function(_0x3e3d06){logger['info'](_0x1bd5('0xd'),_0x5c8e0d,'request\x20sent');logger[_0x1bd5('0xe')](_0x1bd5('0xf'),_0x5c8e0d,_0x1bd5('0x10'),JSON[_0x1bd5('0x11')](_0x3e3d06));if(_0x3e3d06[_0x1bd5('0x12')]){if(_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x13')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x5c8e0d,_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);return _0x3b868a(_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x5c8e0d,_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);return _0x28df8e(_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);}else{logger[_0x1bd5('0x15')](_0x1bd5('0xd'),_0x5c8e0d,_0x1bd5('0x10'));_0x28df8e(_0x3e3d06[_0x1bd5('0x16')][_0x1bd5('0x14')]);}})['catch'](function(_0x53ad5e){logger[_0x1bd5('0x12')](_0x1bd5('0xd'),_0x5c8e0d,_0x53ad5e);_0x3b868a(_0x53ad5e);});});}exports[_0x1bd5('0x17')]=function(_0xb95d4e){var _0x459649=this;return new Promise(function(_0x2ff39a,_0x3fbb39){return db[_0x1bd5('0x18')][_0x1bd5('0x19')]({'raw':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1b')]===undefined?!![]:![]:!![],'where':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1c')]||null:null,'attributes':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1d')]||null:null,'limit':_0xb95d4e['options']?_0xb95d4e[_0x1bd5('0x1a')]['limit']||null:null,'include':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1e')]?_['map'](_0xb95d4e[_0x1bd5('0x1a')]['include'],function(_0x2ed551){return{'model':db[_0x2ed551[_0x1bd5('0x1f')]],'as':_0x2ed551['as'],'attributes':_0x2ed551[_0x1bd5('0x1d')],'include':_0x2ed551[_0x1bd5('0x1e')]?_['map'](_0x2ed551[_0x1bd5('0x1e')],function(_0x69bb17){return{'model':db[_0x69bb17[_0x1bd5('0x1f')]],'as':_0x69bb17['as'],'attributes':_0x69bb17[_0x1bd5('0x1d')],'include':_0x69bb17['include']?_[_0x1bd5('0x20')](_0x69bb17[_0x1bd5('0x1e')],function(_0x3595e9){return{'model':db[_0x3595e9[_0x1bd5('0x1f')]],'as':_0x3595e9['as'],'attributes':_0x3595e9[_0x1bd5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1bd5('0xc')](function(_0x4e72b2){logger[_0x1bd5('0x15')](_0x1bd5('0x17'),_0xb95d4e);logger[_0x1bd5('0xe')]('GetMailAccount',_0xb95d4e,JSON[_0x1bd5('0x11')](_0x4e72b2));_0x2ff39a(_0x4e72b2);})[_0x1bd5('0x21')](function(_0x345181){logger[_0x1bd5('0x12')](_0x1bd5('0x17'),_0x345181[_0x1bd5('0x14')],_0xb95d4e);_0x3fbb39(_0x459649['error'](0x1f4,_0x345181['message']));});});};exports[_0x1bd5('0x22')]=function(_0x305126){var _0x5542aa=this;return new Promise(function(_0x36649d,_0x198b88){return db[_0x1bd5('0x18')][_0x1bd5('0x23')]({'raw':_0x305126['options']?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1b')]===undefined?!![]:![]:!![],'where':_0x305126[_0x1bd5('0x1a')]?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1c')]||null:null,'attributes':_0x305126[_0x1bd5('0x1a')]?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1d')]||null:null,'include':_0x305126['options']?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1e')]?_[_0x1bd5('0x20')](_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1e')],function(_0x18a9db){return{'model':db[_0x18a9db[_0x1bd5('0x1f')]],'as':_0x18a9db['as'],'attributes':_0x18a9db['attributes'],'include':_0x18a9db[_0x1bd5('0x1e')]?_[_0x1bd5('0x20')](_0x18a9db[_0x1bd5('0x1e')],function(_0x2f5a48){return{'model':db[_0x2f5a48[_0x1bd5('0x1f')]],'as':_0x2f5a48['as'],'attributes':_0x2f5a48[_0x1bd5('0x1d')],'include':_0x2f5a48[_0x1bd5('0x1e')]?_['map'](_0x2f5a48['include'],function(_0x155e4c){return{'model':db[_0x155e4c[_0x1bd5('0x1f')]],'as':_0x155e4c['as'],'attributes':_0x155e4c[_0x1bd5('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4595a0){if(_0x305126['options'][_0x1bd5('0x24')]===!![])_0x4595a0[_0x1bd5('0x25')](_0x1bd5('0x26'),_0x4595a0[_0x1bd5('0x27')]());logger[_0x1bd5('0x15')](_0x1bd5('0x22'),_0x305126);logger[_0x1bd5('0xe')](_0x1bd5('0x22'),_0x305126,JSON['stringify'](_0x4595a0));_0x36649d(_0x4595a0);})[_0x1bd5('0x21')](function(_0x2978d8){logger['error'](_0x1bd5('0x22'),_0x2978d8[_0x1bd5('0x14')],_0x305126);_0x198b88(_0x5542aa[_0x1bd5('0x12')](0x1f4,_0x2978d8['message']));});});};exports[_0x1bd5('0x28')]=function(_0x53482){var _0x2997a2=this;return new Promise(function(_0x4074f1,_0x4e8ff7){var _0x305720={'body':_0x53482[_0x1bd5('0x29')],'channel':_0x1bd5('0x2a')};var _0x11e996=_['difference'](_['keys'](db[_0x1bd5('0x2b')][_0x1bd5('0x2c')]),[_0x1bd5('0x2d'),'updatedAt',_0x1bd5('0x2e'),_0x1bd5('0x2f')]);var _0x574d95=![];if(_0x53482[_0x1bd5('0x29')]['id']){delete _0x53482['body']['id'];}if(_[_0x1bd5('0x30')](_0x53482[_0x1bd5('0x29')]['from'])){return _0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x1bd5('0x31')));}if(_[_0x1bd5('0x30')](_0x53482[_0x1bd5('0x29')][_0x1bd5('0x29')])||_0x53482[_0x1bd5('0x29')][_0x1bd5('0x29')]===''){return _0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x1bd5('0x32')));}if(_[_0x1bd5('0x30')](_0x53482[_0x1bd5('0x29')][_0x1bd5('0x33')])){return _0x4e8ff7(_0x2997a2['error'](0x1f4,_0x1bd5('0x34')+_0x11e996));}if(!_[_0x1bd5('0x35')](_0x11e996,_0x53482[_0x1bd5('0x29')]['mapKey'])){return _0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x1bd5('0x36')+_0x11e996));}var _0x5bb8a6={};_0x5bb8a6[_0x53482[_0x1bd5('0x29')]['mapKey']]=_0x53482[_0x1bd5('0x29')]['from'];return db[_0x1bd5('0x18')][_0x1bd5('0x23')]({'where':{'id':_0x53482['account']['id']},'include':[{'model':db[_0x1bd5('0x37')],'as':'List','include':[{'model':db[_0x1bd5('0x2b')],'as':_0x1bd5('0x38'),'where':_0x5bb8a6,'limit':0x1,'order':[[_0x1bd5('0x39'),_0x1bd5('0x3a')]]}]},{'model':db[_0x1bd5('0x3b')],'as':_0x1bd5('0x3c')},{'model':db[_0x1bd5('0x3d')],'as':_0x1bd5('0x3e'),'include':[{'model':db['CloudProvider'],'as':_0x1bd5('0x3f')}]}]})[_0x1bd5('0xc')](function(_0x2a1ece){if(_0x2a1ece&&_0x2a1ece[_0x1bd5('0x40')]){var _0x34452a=_0x2a1ece[_0x1bd5('0x41')]({'plain':!![]});_0x305720['account']=_[_0x1bd5('0x42')](_0x34452a,[_0x1bd5('0x3c'),_0x1bd5('0x40')]);_0x305720[_0x1bd5('0x43')][_0x1bd5('0x26')]=_0x2a1ece[_0x1bd5('0x27')]();_0x305720[_0x1bd5('0x44')]=_0x34452a['Applications'];_0x305720['list']=_0x34452a[_0x1bd5('0x40')];_0x305720[_0x1bd5('0x44')]=_[_0x1bd5('0x45')](_0x305720['applications'],[_0x1bd5('0x46')],[_0x1bd5('0x47')]);if(_0x305720[_0x1bd5('0x43')]&&_0x305720[_0x1bd5('0x43')][_0x1bd5('0x48')]){_0x305720[_0x1bd5('0x44')][_0x1bd5('0x49')]({'id':0x0,'priority':_0x305720['applications'][_0x1bd5('0x4a')]+0x1,'app':_0x1bd5('0x4b'),'appdata':'autoclose','interval':_0x1bd5('0x4c')});}if(_0x305720['account'][_0x1bd5('0x3c')]){delete _0x305720['account'][_0x1bd5('0x3c')];}if(_0x305720[_0x1bd5('0x43')]['List']){delete _0x305720[_0x1bd5('0x43')][_0x1bd5('0x40')];}if(_0x34452a[_0x1bd5('0x40')][_0x1bd5('0x38')][_0x1bd5('0x4a')]){return _0x34452a[_0x1bd5('0x40')][_0x1bd5('0x38')][0x0];}var _0x51aebe=_[_0x1bd5('0x4d')](_0x53482['body'],{'firstName':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x4e')],'ListId':_0x34452a[_0x1bd5('0x2f')]});_0x51aebe[_0x53482['body']['mapKey']]=_0x53482[_0x1bd5('0x29')][_0x1bd5('0x4e')];return db[_0x1bd5('0x2b')][_0x1bd5('0x4f')](_0x51aebe);}else{throw new Error(_0x1bd5('0x50'));}})[_0x1bd5('0xc')](function(_0x46e36c){_0x305720[_0x1bd5('0x51')]=_0x46e36c;if(_0x46e36c){if(!_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['messageId']){_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x52')]=rs[_0x1bd5('0x53')]()+'\x20'+_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x4e')];}var _0x17b3a9={'ContactId':_0x46e36c['id'],'MailAccountId':_0x53482[_0x1bd5('0x43')]['id'],'inReplyTo':_0x53482['body'][_0x1bd5('0x14')][_0x1bd5('0x52')],'to':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['from'],'cc':_0x53482['body'][_0x1bd5('0x14')]['cc'],'subject':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['subject'],'attach':_0x53482['body'][_0x1bd5('0x14')]['attach'],'lastMsgAt':moment()[_0x1bd5('0x54')](_0x1bd5('0x55')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x1bd5('0x23')]({'where':{'closed':![],'MailAccountId':_0x53482['account']['id']},'include':[{'model':db[_0x1bd5('0x56')],'as':'Messages','attributes':[_0x1bd5('0x52')],'where':{'messageId':_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x57')]}}]})[_0x1bd5('0xc')](function(_0x47ca3f){if(_0x47ca3f){return[_0x47ca3f,![]];}return db['MailInteraction'][_0x1bd5('0x4f')](_0x17b3a9)[_0x1bd5('0xc')](function(_0x1a9ad2){return[_0x1a9ad2,!![]];});});}else{throw new Error(_0x1bd5('0x58'));}})['spread'](function(_0x551f22,_0x14dd41){if(_0x551f22){_0x574d95=_0x14dd41;if(!_0x14dd41){return _0x551f22[_0x1bd5('0x59')]({'inReplyTo':_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x52')],'to':_0x53482[_0x1bd5('0x29')]['message']['from'],'cc':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['cc'],'subject':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x5a')],'attach':_0x551f22['attach']?_0x551f22[_0x1bd5('0x5b')]:_0x53482['body'][_0x1bd5('0x14')][_0x1bd5('0x5b')],'substatus':null,'substatusAt':moment()[_0x1bd5('0x54')](_0x1bd5('0x55')),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x551f22;}}})[_0x1bd5('0xc')](function(_0x36d62e){_0x305720[_0x1bd5('0x5c')]=_0x36d62e[_0x1bd5('0x41')]({'plain':!![]});_0x305720[_0x1bd5('0x5c')][_0x1bd5('0x5d')]=_0x574d95;return db[_0x1bd5('0x56')][_0x1bd5('0x4f')]({'body':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x29')],'MailAccountId':_0x53482[_0x1bd5('0x43')]['id'],'MailInteractionId':_0x36d62e['id'],'direction':'in','ContactId':_0x305720[_0x1bd5('0x51')]['id'],'messageId':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x52')],'from':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x4e')],'to':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['to'],'cc':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['cc'],'subject':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['subject'],'attach':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x5b')],'Attachments':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x5e')],'originTo':_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x5f')],'originCc':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x60')],'bcc':_0x53482['body'][_0x1bd5('0x14')][_0x1bd5('0x61')],'ChatWebsiteId':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x62')]||null,'originChannel':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['originChannel']||_0x1bd5('0x63'),'ChatOfflineMessageId':_0x53482['body']['message'][_0x1bd5('0x64')]||null},{'include':[{'model':db['Attachment'],'as':_0x1bd5('0x65')}]});})[_0x1bd5('0xc')](function(_0x560f20){_0x305720[_0x1bd5('0x14')]=_0x560f20;if(!_0x305720[_0x1bd5('0x5c')][_0x1bd5('0x66')]){return;}return db[_0x1bd5('0x67')][_0x1bd5('0x23')]({'attributes':['id',_0x1bd5('0x68')],'where':{'id':_0x305720['interaction'][_0x1bd5('0x66')]}});})[_0x1bd5('0xc')](function(_0xdd5183){if(_0xdd5183){_0x305720[_0x1bd5('0x44')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xdd5183[_0x1bd5('0x68')]+','+(_0x305720[_0x1bd5('0x43')][_0x1bd5('0x69')]||0xa),'interval':_0x1bd5('0x4c')});}if(!_0x305720['interaction'][_0x1bd5('0x6a')]){return;}return db['MailQueue']['find']({'attributes':['id',_0x1bd5('0x68')],'where':{'id':_0x305720['interaction'][_0x1bd5('0x6a')]}});})[_0x1bd5('0xc')](function(_0x231556){if(_0x231556){_0x305720[_0x1bd5('0x44')][_0x1bd5('0x6b')]({'id':0x0,'priority':0x1,'app':_0x1bd5('0x6c'),'appdata':_0x231556[_0x1bd5('0x68')]+','+(_0x305720[_0x1bd5('0x43')][_0x1bd5('0x6d')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x1bd5('0x6e'),'startRouting',_0x305720);})['then'](function(_0x59b491){_0x4074f1(_0x59b491);})[_0x1bd5('0x21')](function(_0x524b86){_0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x524b86[_0x1bd5('0x14')]));});});}; \ No newline at end of file +var _0x23f4=['create','contact','attachments','originCc','bcc','ChatWebsiteId','originChannel','Email','Attachment','Attachments','UserId','User','name','unshift','agent','*,*,*,*','queueId','MailQueue','queue','waitForTheAssignedQueue','Start','startRouting','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./mailAccount.socket','register','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','limit','include','map','model','attributes','catch','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','body','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','get','omit','List','applications','list','priority','asc','account','autoclose','push','close','length','defaults','ListId','List\x20not\x20found','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','Contact\x20not\x20found','spread','update','format','interaction','created','MailMessage'];(function(_0x4333f6,_0x153433){var _0x41f795=function(_0x4a8993){while(--_0x4a8993){_0x4333f6['push'](_0x4333f6['shift']());}};_0x41f795(++_0x153433);}(_0x23f4,0x1ee));var _0x423f=function(_0x4795e1,_0x2e0a02){_0x4795e1=_0x4795e1-0x0;var _0x570754=_0x23f4[_0x4795e1];return _0x570754;};'use strict';var _=require('lodash');var moment=require(_0x423f('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var Redis=require(_0x423f('0x1'));var db=require(_0x423f('0x2'))['db'];var logger=require(_0x423f('0x3'))(_0x423f('0x4'));var config=require(_0x423f('0x5'));var jayson=require(_0x423f('0x6'));var client=jayson[_0x423f('0x7')][_0x423f('0x8')]({'port':0x232c});config[_0x423f('0x9')]=_['defaults'](config[_0x423f('0x9')],{'host':_0x423f('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x423f('0x9')]));require(_0x423f('0xb'))[_0x423f('0xc')](socket);function respondWithRpcPromise(_0x50301a,_0x5b5ee6,_0x4b8a90){return new BPromise(function(_0x4143a0,_0x481c41){return client[_0x423f('0xd')](_0x50301a,_0x4b8a90)[_0x423f('0xe')](function(_0x3ea013){logger[_0x423f('0xf')]('MailAccount,\x20%s,\x20%s',_0x5b5ee6,_0x423f('0x10'));logger[_0x423f('0x11')](_0x423f('0x12'),_0x5b5ee6,_0x423f('0x10'),JSON[_0x423f('0x13')](_0x3ea013));if(_0x3ea013['error']){if(_0x3ea013[_0x423f('0x14')][_0x423f('0x15')]===0x1f4){logger[_0x423f('0x14')](_0x423f('0x16'),_0x5b5ee6,_0x3ea013[_0x423f('0x14')][_0x423f('0x17')]);return _0x481c41(_0x3ea013[_0x423f('0x14')][_0x423f('0x17')]);}logger[_0x423f('0x14')](_0x423f('0x16'),_0x5b5ee6,_0x3ea013[_0x423f('0x14')][_0x423f('0x17')]);return _0x4143a0(_0x3ea013[_0x423f('0x14')][_0x423f('0x17')]);}else{logger[_0x423f('0xf')](_0x423f('0x16'),_0x5b5ee6,_0x423f('0x10'));_0x4143a0(_0x3ea013[_0x423f('0x18')][_0x423f('0x17')]);}})['catch'](function(_0x99435f){logger['error']('MailAccount,\x20%s,\x20%s',_0x5b5ee6,_0x99435f);_0x481c41(_0x99435f);});});}exports[_0x423f('0x19')]=function(_0x4956e0){var _0x181ff7=this;return new Promise(function(_0xd7b80e,_0x4f6960){return db[_0x423f('0x1a')][_0x423f('0x1b')]({'raw':_0x4956e0['options']?_0x4956e0[_0x423f('0x1c')][_0x423f('0x1d')]===undefined?!![]:![]:!![],'where':_0x4956e0['options']?_0x4956e0[_0x423f('0x1c')][_0x423f('0x1e')]||null:null,'attributes':_0x4956e0['options']?_0x4956e0[_0x423f('0x1c')]['attributes']||null:null,'limit':_0x4956e0[_0x423f('0x1c')]?_0x4956e0[_0x423f('0x1c')][_0x423f('0x1f')]||null:null,'include':_0x4956e0[_0x423f('0x1c')]?_0x4956e0[_0x423f('0x1c')][_0x423f('0x20')]?_[_0x423f('0x21')](_0x4956e0[_0x423f('0x1c')][_0x423f('0x20')],function(_0x36f57f){return{'model':db[_0x36f57f[_0x423f('0x22')]],'as':_0x36f57f['as'],'attributes':_0x36f57f[_0x423f('0x23')],'include':_0x36f57f[_0x423f('0x20')]?_[_0x423f('0x21')](_0x36f57f['include'],function(_0x3308dd){return{'model':db[_0x3308dd[_0x423f('0x22')]],'as':_0x3308dd['as'],'attributes':_0x3308dd[_0x423f('0x23')],'include':_0x3308dd['include']?_['map'](_0x3308dd[_0x423f('0x20')],function(_0x496c25){return{'model':db[_0x496c25[_0x423f('0x22')]],'as':_0x496c25['as'],'attributes':_0x496c25['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ca28d){logger[_0x423f('0xf')]('GetMailAccount',_0x4956e0);logger[_0x423f('0x11')](_0x423f('0x19'),_0x4956e0,JSON[_0x423f('0x13')](_0x3ca28d));_0xd7b80e(_0x3ca28d);})[_0x423f('0x24')](function(_0x518c1e){logger[_0x423f('0x14')](_0x423f('0x19'),_0x518c1e[_0x423f('0x17')],_0x4956e0);_0x4f6960(_0x181ff7[_0x423f('0x14')](0x1f4,_0x518c1e['message']));});});};exports[_0x423f('0x25')]=function(_0x150846){var _0x200cfa=this;return new Promise(function(_0x8e7bcb,_0x341728){return db[_0x423f('0x1a')][_0x423f('0x26')]({'raw':_0x150846[_0x423f('0x1c')]?_0x150846[_0x423f('0x1c')][_0x423f('0x1d')]===undefined?!![]:![]:!![],'where':_0x150846['options']?_0x150846[_0x423f('0x1c')][_0x423f('0x1e')]||null:null,'attributes':_0x150846[_0x423f('0x1c')]?_0x150846['options'][_0x423f('0x23')]||null:null,'include':_0x150846['options']?_0x150846[_0x423f('0x1c')][_0x423f('0x20')]?_[_0x423f('0x21')](_0x150846[_0x423f('0x1c')][_0x423f('0x20')],function(_0x4a5134){return{'model':db[_0x4a5134['model']],'as':_0x4a5134['as'],'attributes':_0x4a5134[_0x423f('0x23')],'include':_0x4a5134[_0x423f('0x20')]?_[_0x423f('0x21')](_0x4a5134[_0x423f('0x20')],function(_0x3e4c9f){return{'model':db[_0x3e4c9f[_0x423f('0x22')]],'as':_0x3e4c9f['as'],'attributes':_0x3e4c9f[_0x423f('0x23')],'include':_0x3e4c9f[_0x423f('0x20')]?_[_0x423f('0x21')](_0x3e4c9f[_0x423f('0x20')],function(_0x3aeb17){return{'model':db[_0x3aeb17[_0x423f('0x22')]],'as':_0x3aeb17['as'],'attributes':_0x3aeb17[_0x423f('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bd9b2){if(_0x150846[_0x423f('0x1c')][_0x423f('0x27')]===!![])_0x5bd9b2[_0x423f('0x28')](_0x423f('0x29'),_0x5bd9b2[_0x423f('0x2a')]());logger['info'](_0x423f('0x25'),_0x150846);logger[_0x423f('0x11')](_0x423f('0x25'),_0x150846,JSON[_0x423f('0x13')](_0x5bd9b2));_0x8e7bcb(_0x5bd9b2);})[_0x423f('0x24')](function(_0x24628e){logger[_0x423f('0x14')](_0x423f('0x25'),_0x24628e[_0x423f('0x17')],_0x150846);_0x341728(_0x200cfa[_0x423f('0x14')](0x1f4,_0x24628e['message']));});});};exports['NotifyMailAccount']=function(_0xb19847){var _0xd42ce9=this;return new Promise(function(_0x81bd62,_0x390a8f){var _0x2316e8={'body':_0xb19847[_0x423f('0x2b')],'channel':'mail'};var _0x36ad04=_[_0x423f('0x2c')](_[_0x423f('0x2d')](db[_0x423f('0x2e')][_0x423f('0x2f')]),[_0x423f('0x30'),_0x423f('0x31'),_0x423f('0x32'),'ListId']);var _0x4165e0=![];if(_0xb19847[_0x423f('0x2b')]['id']){delete _0xb19847[_0x423f('0x2b')]['id'];}if(_[_0x423f('0x33')](_0xb19847[_0x423f('0x2b')][_0x423f('0x34')])){return _0x390a8f(_0xd42ce9[_0x423f('0x14')](0x1f4,_0x423f('0x35')));}if(_[_0x423f('0x33')](_0xb19847['body'][_0x423f('0x2b')])||_0xb19847['body'][_0x423f('0x2b')]===''){return _0x390a8f(_0xd42ce9[_0x423f('0x14')](0x1f4,_0x423f('0x36')));}if(_[_0x423f('0x33')](_0xb19847[_0x423f('0x2b')][_0x423f('0x37')])){return _0x390a8f(_0xd42ce9[_0x423f('0x14')](0x1f4,_0x423f('0x38')+_0x36ad04));}if(!_[_0x423f('0x39')](_0x36ad04,_0xb19847[_0x423f('0x2b')][_0x423f('0x37')])){return _0x390a8f(_0xd42ce9[_0x423f('0x14')](0x1f4,_0x423f('0x3a')+_0x36ad04));}var _0x350e11={};_0x350e11[_0xb19847[_0x423f('0x2b')][_0x423f('0x37')]]=_0xb19847[_0x423f('0x2b')][_0x423f('0x34')];return db[_0x423f('0x1a')][_0x423f('0x26')]({'where':{'id':_0xb19847['account']['id']},'include':[{'model':db[_0x423f('0x3b')],'as':'List','include':[{'model':db[_0x423f('0x2e')],'as':_0x423f('0x3c'),'where':_0x350e11,'limit':0x1,'order':[[_0x423f('0x31'),_0x423f('0x3d')]]}]},{'model':db[_0x423f('0x3e')],'as':_0x423f('0x3f')},{'model':db[_0x423f('0x40')],'as':_0x423f('0x41'),'include':[{'model':db[_0x423f('0x42')],'as':_0x423f('0x42')}]}]})[_0x423f('0xe')](function(_0x2dcbec){if(_0x2dcbec&&_0x2dcbec['List']){var _0x1e2b9f=_0x2dcbec[_0x423f('0x43')]({'plain':!![]});_0x2316e8['account']=_[_0x423f('0x44')](_0x1e2b9f,['Applications',_0x423f('0x45')]);_0x2316e8['account']['smtpOptions']=_0x2dcbec[_0x423f('0x2a')]();_0x2316e8[_0x423f('0x46')]=_0x1e2b9f[_0x423f('0x3f')];_0x2316e8[_0x423f('0x47')]=_0x1e2b9f['List'];_0x2316e8[_0x423f('0x46')]=_['orderBy'](_0x2316e8[_0x423f('0x46')],[_0x423f('0x48')],[_0x423f('0x49')]);if(_0x2316e8[_0x423f('0x4a')]&&_0x2316e8[_0x423f('0x4a')][_0x423f('0x4b')]){_0x2316e8[_0x423f('0x46')][_0x423f('0x4c')]({'id':0x0,'priority':_0x2316e8[_0x423f('0x46')]['length']+0x1,'app':_0x423f('0x4d'),'appdata':_0x423f('0x4b'),'interval':'*,*,*,*'});}if(_0x2316e8[_0x423f('0x4a')]['Applications']){delete _0x2316e8[_0x423f('0x4a')][_0x423f('0x3f')];}if(_0x2316e8[_0x423f('0x4a')][_0x423f('0x45')]){delete _0x2316e8[_0x423f('0x4a')][_0x423f('0x45')];}if(_0x1e2b9f['List']['Contacts'][_0x423f('0x4e')]){return _0x1e2b9f[_0x423f('0x45')][_0x423f('0x3c')][0x0];}var _0x3959ce=_[_0x423f('0x4f')](_0xb19847[_0x423f('0x2b')],{'firstName':_0xb19847[_0x423f('0x2b')][_0x423f('0x34')],'ListId':_0x1e2b9f[_0x423f('0x50')]});_0x3959ce[_0xb19847['body'][_0x423f('0x37')]]=_0xb19847[_0x423f('0x2b')]['from'];return db[_0x423f('0x2e')]['create'](_0x3959ce);}else{throw new Error(_0x423f('0x51'));}})[_0x423f('0xe')](function(_0x5affd5){_0x2316e8['contact']=_0x5affd5;if(_0x5affd5){if(!_0xb19847['body'][_0x423f('0x17')][_0x423f('0x52')]){_0xb19847[_0x423f('0x2b')]['message'][_0x423f('0x52')]=rs[_0x423f('0x53')]()+'\x20'+_0xb19847[_0x423f('0x2b')][_0x423f('0x17')][_0x423f('0x34')];}var _0x3ffe6f={'ContactId':_0x5affd5['id'],'MailAccountId':_0xb19847[_0x423f('0x4a')]['id'],'inReplyTo':_0xb19847['body'][_0x423f('0x17')]['messageId'],'to':_0xb19847[_0x423f('0x2b')][_0x423f('0x17')][_0x423f('0x34')],'cc':_0xb19847[_0x423f('0x2b')]['message']['cc'],'subject':_0xb19847[_0x423f('0x2b')][_0x423f('0x17')][_0x423f('0x54')],'attach':_0xb19847['body'][_0x423f('0x17')][_0x423f('0x55')],'lastMsgAt':moment()['format'](_0x423f('0x56')),'lastMsgDirection':'in'};return db[_0x423f('0x57')]['find']({'where':{'closed':![],'MailAccountId':_0xb19847['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x423f('0x58'),'attributes':[_0x423f('0x52')],'where':{'messageId':_0xb19847[_0x423f('0x2b')][_0x423f('0x17')]['inReplyTo']}}]})['then'](function(_0x124afa){if(_0x124afa){return[_0x124afa,![]];}return db[_0x423f('0x57')]['create'](_0x3ffe6f)[_0x423f('0xe')](function(_0x13ed0b){return[_0x13ed0b,!![]];});});}else{throw new Error(_0x423f('0x59'));}})[_0x423f('0x5a')](function(_0x18b549,_0xb67c1d){if(_0x18b549){_0x4165e0=_0xb67c1d;if(!_0xb67c1d){return _0x18b549[_0x423f('0x5b')]({'inReplyTo':_0xb19847['body'][_0x423f('0x17')][_0x423f('0x52')],'to':_0xb19847['body'][_0x423f('0x17')][_0x423f('0x34')],'cc':_0xb19847[_0x423f('0x2b')]['message']['cc'],'subject':_0xb19847[_0x423f('0x2b')][_0x423f('0x17')][_0x423f('0x54')],'attach':_0x18b549[_0x423f('0x55')]?_0x18b549[_0x423f('0x55')]:_0xb19847[_0x423f('0x2b')][_0x423f('0x17')][_0x423f('0x55')],'substatus':null,'substatusAt':moment()[_0x423f('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x423f('0x5c')](_0x423f('0x56')),'lastMsgDirection':'in'});}else{return _0x18b549;}}})[_0x423f('0xe')](function(_0x4633f0){_0x2316e8['interaction']=_0x4633f0[_0x423f('0x43')]({'plain':!![]});_0x2316e8[_0x423f('0x5d')][_0x423f('0x5e')]=_0x4165e0;return db[_0x423f('0x5f')][_0x423f('0x60')]({'body':_0xb19847[_0x423f('0x2b')][_0x423f('0x2b')],'MailAccountId':_0xb19847['account']['id'],'MailInteractionId':_0x4633f0['id'],'direction':'in','ContactId':_0x2316e8[_0x423f('0x61')]['id'],'messageId':_0xb19847[_0x423f('0x2b')][_0x423f('0x17')][_0x423f('0x52')],'from':_0xb19847['body'][_0x423f('0x17')][_0x423f('0x34')],'to':_0xb19847['body']['message']['to'],'cc':_0xb19847[_0x423f('0x2b')][_0x423f('0x17')]['cc'],'subject':_0xb19847[_0x423f('0x2b')]['message'][_0x423f('0x54')],'attach':_0xb19847[_0x423f('0x2b')][_0x423f('0x17')]['attach'],'Attachments':_0xb19847[_0x423f('0x2b')][_0x423f('0x17')][_0x423f('0x62')],'originTo':_0xb19847['body'][_0x423f('0x17')]['originTo'],'originCc':_0xb19847['body'][_0x423f('0x17')][_0x423f('0x63')],'bcc':_0xb19847[_0x423f('0x2b')][_0x423f('0x17')][_0x423f('0x64')],'ChatWebsiteId':_0xb19847['body'][_0x423f('0x17')][_0x423f('0x65')]||null,'originChannel':_0xb19847[_0x423f('0x2b')][_0x423f('0x17')][_0x423f('0x66')]||_0x423f('0x67'),'ChatOfflineMessageId':_0xb19847[_0x423f('0x2b')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x423f('0x68')],'as':_0x423f('0x69')}]});})[_0x423f('0xe')](function(_0x2789e4){_0x2316e8[_0x423f('0x17')]=_0x2789e4;if(!_0x2316e8['interaction'][_0x423f('0x6a')]){return;}return db[_0x423f('0x6b')][_0x423f('0x26')]({'attributes':['id',_0x423f('0x6c')],'where':{'id':_0x2316e8[_0x423f('0x5d')][_0x423f('0x6a')]}});})[_0x423f('0xe')](function(_0x1db383){if(_0x1db383){_0x2316e8[_0x423f('0x46')][_0x423f('0x6d')]({'id':0x0,'priority':0x0,'app':_0x423f('0x6e'),'appdata':_0x1db383[_0x423f('0x6c')]+','+(_0x2316e8[_0x423f('0x4a')]['waitForTheAssignedAgent']||0xa),'interval':_0x423f('0x6f')});}if(!_0x2316e8[_0x423f('0x5d')][_0x423f('0x70')]){return;}return db[_0x423f('0x71')][_0x423f('0x26')]({'attributes':['id','name'],'where':{'id':_0x2316e8[_0x423f('0x5d')][_0x423f('0x70')]}});})[_0x423f('0xe')](function(_0x2310e3){if(_0x2310e3){_0x2316e8['applications'][_0x423f('0x6d')]({'id':0x0,'priority':0x1,'app':_0x423f('0x72'),'appdata':_0x2310e3[_0x423f('0x6c')]+','+(_0x2316e8[_0x423f('0x4a')][_0x423f('0x73')]||0x12c),'interval':_0x423f('0x6f')});}return respondWithRpcPromise(_0x423f('0x74'),_0x423f('0x75'),_0x2316e8);})[_0x423f('0xe')](function(_0x22f2af){_0x81bd62(_0x22f2af);})[_0x423f('0x24')](function(_0xdbe8c3){_0x390a8f(_0xd42ce9[_0x423f('0x14')](0x1f4,_0xdbe8c3[_0x423f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 48a1d35..e97fa41 100644 --- a/server/api/mailAccount/mailAccount.socket.js +++ b/server/api/mailAccount/mailAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f74=['mailAccount:','./mailAccount.events','save','remove','update','emit','removeListener','length'];(function(_0x53a82e,_0x4be9d0){var _0x5394b5=function(_0x563b69){while(--_0x563b69){_0x53a82e['push'](_0x53a82e['shift']());}};_0x5394b5(++_0x4be9d0);}(_0x3f74,0x121));var _0x43f7=function(_0x380ae6,_0x595c84){_0x380ae6=_0x380ae6-0x0;var _0x2c9324=_0x3f74[_0x380ae6];return _0x2c9324;};'use strict';var MailAccountEvents=require(_0x43f7('0x0'));var events=[_0x43f7('0x1'),_0x43f7('0x2'),_0x43f7('0x3')];function createListener(_0x20bda0,_0x90cc42){return function(_0x19286c){_0x90cc42[_0x43f7('0x4')](_0x20bda0,_0x19286c);};}function removeListener(_0x591452,_0x1f5e13){return function(){MailAccountEvents[_0x43f7('0x5')](_0x591452,_0x1f5e13);};}exports['register']=function(_0x4fa0e1){for(var _0x37e991=0x0,_0x4f64a6=events[_0x43f7('0x6')];_0x37e991<_0x4f64a6;_0x37e991++){var _0x574b8a=events[_0x37e991];var _0x115f89=createListener(_0x43f7('0x7')+_0x574b8a,_0x4fa0e1);MailAccountEvents['on'](_0x574b8a,_0x115f89);}}; \ No newline at end of file +var _0xded4=['mailAccount:','remove','update','emit','removeListener','register'];(function(_0x52096b,_0x20bab4){var _0x2b1cc7=function(_0x3f7021){while(--_0x3f7021){_0x52096b['push'](_0x52096b['shift']());}};_0x2b1cc7(++_0x20bab4);}(_0xded4,0x1bd));var _0x4ded=function(_0x68513f,_0x108e8d){_0x68513f=_0x68513f-0x0;var _0x554665=_0xded4[_0x68513f];return _0x554665;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0x4ded('0x0'),_0x4ded('0x1')];function createListener(_0x18bf91,_0x2cae27){return function(_0x577049){_0x2cae27[_0x4ded('0x2')](_0x18bf91,_0x577049);};}function removeListener(_0x4c8a12,_0xf5f598){return function(){MailAccountEvents[_0x4ded('0x3')](_0x4c8a12,_0xf5f598);};}exports[_0x4ded('0x4')]=function(_0x17491a){for(var _0x23cc0f=0x0,_0x6a0d15=events['length'];_0x23cc0f<_0x6a0d15;_0x23cc0f++){var _0x51ea60=events[_0x23cc0f];var _0x1a2eeb=createListener(_0x4ded('0x5')+_0x51ea60,_0x17491a);MailAccountEvents['on'](_0x51ea60,_0x1a2eeb);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 10ae706..0346851 100644 --- a/server/api/mailApplication/index.js +++ b/server/api/mailApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc5b8=['connect-timeout','express','Router','fs-extra','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','path'];(function(_0x52598d,_0x10fb73){var _0x170309=function(_0x30c9f7){while(--_0x30c9f7){_0x52598d['push'](_0x52598d['shift']());}};_0x170309(++_0x10fb73);}(_0xc5b8,0x8e));var _0x8c5b=function(_0x14e27a,_0x3b4136){_0x14e27a=_0x14e27a-0x0;var _0x288688=_0xc5b8[_0x14e27a];return _0x288688;};'use strict';var multer=require(_0x8c5b('0x0'));var util=require('util');var path=require(_0x8c5b('0x1'));var timeout=require(_0x8c5b('0x2'));var express=require(_0x8c5b('0x3'));var router=express[_0x8c5b('0x4')]();var fs_extra=require(_0x8c5b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8c5b('0x6'));var controller=require(_0x8c5b('0x7'));router[_0x8c5b('0x8')](_0x8c5b('0x9'),auth[_0x8c5b('0xa')](),controller[_0x8c5b('0xb')]);router[_0x8c5b('0xc')](_0x8c5b('0x9'),auth[_0x8c5b('0xa')](),controller[_0x8c5b('0xd')]);router['delete'](_0x8c5b('0x9'),auth[_0x8c5b('0xa')](),controller[_0x8c5b('0xe')]);module[_0x8c5b('0xf')]=router; \ No newline at end of file +var _0x8c69=['../../components/interaction/service','./mailApplication.controller','get','/:id','show','put','destroy','exports','multer','connect-timeout','express','../../components/auth/service'];(function(_0x3f105a,_0x459d89){var _0x41a968=function(_0x18eb8a){while(--_0x18eb8a){_0x3f105a['push'](_0x3f105a['shift']());}};_0x41a968(++_0x459d89);}(_0x8c69,0x1a0));var _0x98c6=function(_0x314788,_0x3b0a25){_0x314788=_0x314788-0x0;var _0x373c3f=_0x8c69[_0x314788];return _0x373c3f;};'use strict';var multer=require(_0x98c6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x98c6('0x1'));var express=require(_0x98c6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x98c6('0x3'));var interaction=require(_0x98c6('0x4'));var config=require('../../config/environment');var controller=require(_0x98c6('0x5'));router[_0x98c6('0x6')](_0x98c6('0x7'),auth['isAuthenticated'](),controller[_0x98c6('0x8')]);router[_0x98c6('0x9')](_0x98c6('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x98c6('0x7'),auth['isAuthenticated'](),controller[_0x98c6('0xa')]);module[_0x98c6('0xb')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index afa1a8e..f79a4f5 100644 --- a/server/api/mailApplication/mailApplication.attributes.js +++ b/server/api/mailApplication/mailApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c4d=['STRING','sequelize','exports','INTEGER'];(function(_0x2dc7c9,_0x3a15f8){var _0x3e6536=function(_0x312829){while(--_0x312829){_0x2dc7c9['push'](_0x2dc7c9['shift']());}};_0x3e6536(++_0x3a15f8);}(_0x9c4d,0xd1));var _0xd9c4=function(_0x1d94b7,_0xacda53){_0x1d94b7=_0x1d94b7-0x0;var _0xa0e293=_0x9c4d[_0x1d94b7];return _0xa0e293;};'use strict';var Sequelize=require(_0xd9c4('0x0'));module[_0xd9c4('0x1')]={'priority':{'type':Sequelize[_0xd9c4('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd9c4('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd9c4('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x4a5b=['INTEGER','STRING','*,*,*,*','exports'];(function(_0x66acd9,_0x1c172f){var _0xb3d35b=function(_0x4ea05a){while(--_0x4ea05a){_0x66acd9['push'](_0x66acd9['shift']());}};_0xb3d35b(++_0x1c172f);}(_0x4a5b,0x67));var _0xb4a5=function(_0x1f6dde,_0x4de47f){_0x1f6dde=_0x1f6dde-0x0;var _0x19b827=_0x4a5b[_0x1f6dde];return _0x19b827;};'use strict';var Sequelize=require('sequelize');module[_0xb4a5('0x0')]={'priority':{'type':Sequelize[_0xb4a5('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb4a5('0x2')]},'interval':{'type':Sequelize[_0xb4a5('0x2')],'defaultValue':_0xb4a5('0x3')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 8524a9d..3cb4335 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x41642e,_0x97f901){var _0x39ec15=function(_0x2056b9){while(--_0x2056b9){_0x41642e['push'](_0x41642e['shift']());}};_0x39ec15(++_0x97f901);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'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 _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','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','sendStatus','status','undefined'];(function(_0x40570e,_0x53df30){var _0x16336a=function(_0x227e0b){while(--_0x227e0b){_0x40570e['push'](_0x40570e['shift']());}};_0x16336a(++_0x53df30);}(_0xe706,0xa3));var _0x6e70=function(_0x329dd0,_0x47e04f){_0x329dd0=_0x329dd0-0x0;var _0x4f5b90=_0xe706[_0x329dd0];return _0x4f5b90;};'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'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 677324c..ca1771a 100644 --- a/server/api/mailApplication/mailApplication.model.js +++ b/server/api/mailApplication/mailApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4680=['../../config/logger','api','moment','bluebird','path','../../config/environment','exports','utf8mb4','util'];(function(_0x54f102,_0x546c8d){var _0x138b8c=function(_0x58f93a){while(--_0x58f93a){_0x54f102['push'](_0x54f102['shift']());}};_0x138b8c(++_0x546c8d);}(_0x4680,0xc5));var _0x0468=function(_0x84906e,_0x40c110){_0x84906e=_0x84906e-0x0;var _0x5cfe6a=_0x4680[_0x84906e];return _0x5cfe6a;};'use strict';var _=require('lodash');var util=require(_0x0468('0x0'));var logger=require(_0x0468('0x1'))(_0x0468('0x2'));var moment=require(_0x0468('0x3'));var BPromise=require(_0x0468('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0468('0x5'));var rimraf=require('rimraf');var config=require(_0x0468('0x6'));var attributes=require('./mailApplication.attributes');module[_0x0468('0x7')]=function(_0xeef4ae,_0x49dae9){return _0xeef4ae['define']('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0468('0x8'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x360b=['define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports'];(function(_0x42be97,_0x28f818){var _0x48176b=function(_0x2215a0){while(--_0x2215a0){_0x42be97['push'](_0x42be97['shift']());}};_0x48176b(++_0x28f818);}(_0x360b,0x73));var _0xb360=function(_0x510e62,_0x558120){_0x510e62=_0x510e62-0x0;var _0x47e3d1=_0x360b[_0x510e62];return _0x47e3d1;};'use strict';var _=require('lodash');var util=require(_0xb360('0x0'));var logger=require(_0xb360('0x1'))(_0xb360('0x2'));var moment=require(_0xb360('0x3'));var BPromise=require(_0xb360('0x4'));var rp=require(_0xb360('0x5'));var fs=require('fs');var path=require(_0xb360('0x6'));var rimraf=require(_0xb360('0x7'));var config=require(_0xb360('0x8'));var attributes=require(_0xb360('0x9'));module[_0xb360('0xa')]=function(_0x1bdb96,_0x42419d){return _0x1bdb96[_0xb360('0xb')]('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb360('0xc'),'collate':_0xb360('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index e93536a..8272912 100644 --- a/server/api/mailApplication/mailApplication.rpc.js +++ b/server/api/mailApplication/mailApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x13b1=['then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','update','body','options','raw','where','attributes','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x15b7a9,_0x2fd84a){var _0x1ae32d=function(_0x508191){while(--_0x508191){_0x15b7a9['push'](_0x15b7a9['shift']());}};_0x1ae32d(++_0x2fd84a);}(_0x13b1,0xda));var _0x113b=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0x13b1[_0x146a97];return _0x259d5c;};'use strict';var _=require('lodash');var util=require(_0x113b('0x0'));var moment=require(_0x113b('0x1'));var BPromise=require('bluebird');var rs=require(_0x113b('0x2'));var fs=require('fs');var Redis=require(_0x113b('0x3'));var db=require(_0x113b('0x4'))['db'];var utils=require(_0x113b('0x5'));var logger=require(_0x113b('0x6'))(_0x113b('0x7'));var config=require(_0x113b('0x8'));var jayson=require(_0x113b('0x9'));var client=jayson[_0x113b('0xa')][_0x113b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x473bd6,_0xd05115,_0x122fe2){return new BPromise(function(_0x306f99,_0x42d4da){return client[_0x113b('0xc')](_0x473bd6,_0x122fe2)[_0x113b('0xd')](function(_0x5473da){logger[_0x113b('0xe')](_0x113b('0xf'),_0xd05115,_0x113b('0x10'));logger[_0x113b('0x11')](_0x113b('0x12'),_0xd05115,_0x113b('0x10'),JSON[_0x113b('0x13')](_0x5473da));if(_0x5473da[_0x113b('0x14')]){if(_0x5473da[_0x113b('0x14')][_0x113b('0x15')]===0x1f4){logger[_0x113b('0x14')]('MailApplication,\x20%s,\x20%s',_0xd05115,_0x5473da['error'][_0x113b('0x16')]);return _0x42d4da(_0x5473da[_0x113b('0x14')][_0x113b('0x16')]);}logger[_0x113b('0x14')](_0x113b('0xf'),_0xd05115,_0x5473da[_0x113b('0x14')]['message']);return _0x306f99(_0x5473da[_0x113b('0x14')]['message']);}else{logger[_0x113b('0xe')]('MailApplication,\x20%s,\x20%s',_0xd05115,'request\x20sent');_0x306f99(_0x5473da[_0x113b('0x17')]['message']);}})[_0x113b('0x18')](function(_0x4380a2){logger['error'](_0x113b('0xf'),_0xd05115,_0x4380a2);_0x42d4da(_0x4380a2);});});}exports[_0x113b('0x19')]=function(_0xb63175){var _0x1e9ddd=this;return new Promise(function(_0x40d938,_0x59883a){return db['MailApplication'][_0x113b('0x1a')](_0xb63175[_0x113b('0x1b')],{'raw':_0xb63175[_0x113b('0x1c')]?_0xb63175[_0x113b('0x1c')][_0x113b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb63175[_0x113b('0x1c')]?_0xb63175['options'][_0x113b('0x1e')]||null:null,'attributes':_0xb63175['options']?_0xb63175[_0x113b('0x1c')][_0x113b('0x1f')]||null:null,'limit':_0xb63175[_0x113b('0x1c')]?_0xb63175[_0x113b('0x1c')][_0x113b('0x20')]||null:null})[_0x113b('0xd')](function(_0x23cc6e){logger['info'](_0x113b('0x19'),_0xb63175);logger['debug']('UpdateMailApplication',_0xb63175,JSON[_0x113b('0x13')](_0x23cc6e));_0x40d938(_0x23cc6e);})[_0x113b('0x18')](function(_0x5c171a){logger[_0x113b('0x14')](_0x113b('0x19'),_0x5c171a[_0x113b('0x16')],_0xb63175);_0x59883a(_0x1e9ddd[_0x113b('0x14')](0x1f4,_0x5c171a[_0x113b('0x16')]));});});}; \ No newline at end of file +var _0xf630=['info','catch','UpdateMailApplication','MailApplication','update','body','options','raw','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xf630,0xf0));var _0x0f63=function(_0x238281,_0x2e4cd0){_0x238281=_0x238281-0x0;var _0x22c358=_0xf630[_0x238281];return _0x22c358;};'use strict';var _=require(_0x0f63('0x0'));var util=require(_0x0f63('0x1'));var moment=require(_0x0f63('0x2'));var BPromise=require(_0x0f63('0x3'));var rs=require(_0x0f63('0x4'));var fs=require('fs');var Redis=require(_0x0f63('0x5'));var db=require(_0x0f63('0x6'))['db'];var utils=require(_0x0f63('0x7'));var logger=require(_0x0f63('0x8'))(_0x0f63('0x9'));var config=require(_0x0f63('0xa'));var jayson=require(_0x0f63('0xb'));var client=jayson[_0x0f63('0xc')][_0x0f63('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x39e858,_0x56f48f,_0x59deb6){return new BPromise(function(_0x3e4b52,_0x3f1981){return client[_0x0f63('0xe')](_0x39e858,_0x59deb6)[_0x0f63('0xf')](function(_0x16713d){logger['info'](_0x0f63('0x10'),_0x56f48f,_0x0f63('0x11'));logger[_0x0f63('0x12')](_0x0f63('0x13'),_0x56f48f,_0x0f63('0x11'),JSON[_0x0f63('0x14')](_0x16713d));if(_0x16713d[_0x0f63('0x15')]){if(_0x16713d[_0x0f63('0x15')][_0x0f63('0x16')]===0x1f4){logger[_0x0f63('0x15')]('MailApplication,\x20%s,\x20%s',_0x56f48f,_0x16713d['error'][_0x0f63('0x17')]);return _0x3f1981(_0x16713d['error'][_0x0f63('0x17')]);}logger['error'](_0x0f63('0x10'),_0x56f48f,_0x16713d[_0x0f63('0x15')][_0x0f63('0x17')]);return _0x3e4b52(_0x16713d[_0x0f63('0x15')][_0x0f63('0x17')]);}else{logger[_0x0f63('0x18')]('MailApplication,\x20%s,\x20%s',_0x56f48f,_0x0f63('0x11'));_0x3e4b52(_0x16713d['result'][_0x0f63('0x17')]);}})[_0x0f63('0x19')](function(_0x35f4a7){logger[_0x0f63('0x15')](_0x0f63('0x10'),_0x56f48f,_0x35f4a7);_0x3f1981(_0x35f4a7);});});}exports[_0x0f63('0x1a')]=function(_0x42d363){var _0x39caef=this;return new Promise(function(_0x4470b2,_0x1495b8){return db[_0x0f63('0x1b')][_0x0f63('0x1c')](_0x42d363[_0x0f63('0x1d')],{'raw':_0x42d363[_0x0f63('0x1e')]?_0x42d363[_0x0f63('0x1e')][_0x0f63('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42d363[_0x0f63('0x1e')]?_0x42d363[_0x0f63('0x1e')]['where']||null:null,'attributes':_0x42d363[_0x0f63('0x1e')]?_0x42d363['options']['attributes']||null:null,'limit':_0x42d363[_0x0f63('0x1e')]?_0x42d363[_0x0f63('0x1e')][_0x0f63('0x20')]||null:null})[_0x0f63('0xf')](function(_0x365f73){logger[_0x0f63('0x18')](_0x0f63('0x1a'),_0x42d363);logger[_0x0f63('0x12')]('UpdateMailApplication',_0x42d363,JSON['stringify'](_0x365f73));_0x4470b2(_0x365f73);})['catch'](function(_0x23f754){logger[_0x0f63('0x15')]('UpdateMailApplication',_0x23f754[_0x0f63('0x17')],_0x42d363);_0x1495b8(_0x39caef[_0x0f63('0x15')](0x1f4,_0x23f754[_0x0f63('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index b39659e..93f8466 100644 --- a/server/api/mailInteraction/index.js +++ b/server/api/mailInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa0d=['put','mailinteraction:update','update','delete','mail','mailinteraction:destroy','destroy','exports','express','Router','./mailInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','/:id/tags','tracked','mailinteraction:addtags','addTags'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xaa0d,0x19d));var _0xdaa0=function(_0xe2e71a,_0x12a51e){_0xe2e71a=_0xe2e71a-0x0;var _0x5e535b=_0xaa0d[_0xe2e71a];return _0x5e535b;};'use strict';var express=require(_0xdaa0('0x0'));var router=express[_0xdaa0('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require(_0xdaa0('0x2'));router[_0xdaa0('0x3')]('/',auth[_0xdaa0('0x4')](),controller[_0xdaa0('0x5')]);router[_0xdaa0('0x3')](_0xdaa0('0x6'),auth[_0xdaa0('0x4')](),controller['describe']);router['get'](_0xdaa0('0x7'),auth[_0xdaa0('0x4')](),controller[_0xdaa0('0x8')]);router[_0xdaa0('0x3')](_0xdaa0('0x9'),auth[_0xdaa0('0x4')](),controller[_0xdaa0('0xa')]);router[_0xdaa0('0x3')](_0xdaa0('0xb'),auth[_0xdaa0('0x4')](),controller[_0xdaa0('0xc')]);router['post']('/',auth[_0xdaa0('0x4')](),controller[_0xdaa0('0xd')]);router[_0xdaa0('0xe')]('/:id/messages',auth[_0xdaa0('0x4')](),controller['addMessage']);router[_0xdaa0('0xe')](_0xdaa0('0xf'),auth[_0xdaa0('0x4')](),interaction[_0xdaa0('0x10')]('mail',_0xdaa0('0x11')),controller[_0xdaa0('0x12')]);router[_0xdaa0('0x13')]('/:id',auth[_0xdaa0('0x4')](),interaction[_0xdaa0('0x10')]('mail',_0xdaa0('0x14')),controller[_0xdaa0('0x15')]);router[_0xdaa0('0x16')]('/:id',auth[_0xdaa0('0x4')](),interaction[_0xdaa0('0x10')](_0xdaa0('0x17'),_0xdaa0('0x18')),controller[_0xdaa0('0x19')]);router['delete'](_0xdaa0('0xf'),auth['isAuthenticated'](),controller['removeTags']);module[_0xdaa0('0x1a')]=router; \ No newline at end of file +var _0x457f=['isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','delete','mailinteraction:destroy','destroy','removeTags','express','Router','../../components/interaction/service','./mailInteraction.controller','get'];(function(_0x1b1bd5,_0xf50a3){var _0x12bf17=function(_0x5a1a9f){while(--_0x5a1a9f){_0x1b1bd5['push'](_0x1b1bd5['shift']());}};_0x12bf17(++_0xf50a3);}(_0x457f,0x6b));var _0xf457=function(_0x2fc10f,_0x5ca4c0){_0x2fc10f=_0x2fc10f-0x0;var _0x280dfe=_0x457f[_0x2fc10f];return _0x280dfe;};'use strict';var express=require(_0xf457('0x0'));var router=express[_0xf457('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xf457('0x2'));var controller=require(_0xf457('0x3'));router[_0xf457('0x4')]('/',auth[_0xf457('0x5')](),controller[_0xf457('0x6')]);router[_0xf457('0x4')](_0xf457('0x7'),auth['isAuthenticated'](),controller[_0xf457('0x8')]);router[_0xf457('0x4')](_0xf457('0x9'),auth[_0xf457('0x5')](),controller[_0xf457('0xa')]);router[_0xf457('0x4')](_0xf457('0xb'),auth[_0xf457('0x5')](),controller[_0xf457('0xc')]);router[_0xf457('0x4')](_0xf457('0xd'),auth[_0xf457('0x5')](),controller[_0xf457('0xe')]);router[_0xf457('0xf')]('/',auth[_0xf457('0x5')](),controller[_0xf457('0x10')]);router[_0xf457('0xf')](_0xf457('0xb'),auth[_0xf457('0x5')](),controller[_0xf457('0x11')]);router[_0xf457('0xf')](_0xf457('0x12'),auth['isAuthenticated'](),interaction[_0xf457('0x13')](_0xf457('0x14'),_0xf457('0x15')),controller[_0xf457('0x16')]);router[_0xf457('0x17')](_0xf457('0x9'),auth[_0xf457('0x5')](),interaction['tracked'](_0xf457('0x14'),'mailinteraction:update'),controller['update']);router[_0xf457('0x18')]('/:id',auth[_0xf457('0x5')](),interaction[_0xf457('0x13')](_0xf457('0x14'),_0xf457('0x19')),controller[_0xf457('0x1a')]);router['delete'](_0xf457('0x12'),auth[_0xf457('0x5')](),controller[_0xf457('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 3912d59..fd44716 100644 --- a/server/api/mailInteraction/mailInteraction.attributes.js +++ b/server/api/mailInteraction/mailInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6b1=['out','sequelize','iconv','exports','BOOLEAN','DATE','STRING','long','TEXT','ENUM'];(function(_0x703492,_0x46e583){var _0xfe28da=function(_0x575e9b){while(--_0x575e9b){_0x703492['push'](_0x703492['shift']());}};_0xfe28da(++_0x46e583);}(_0xc6b1,0xb5));var _0x1c6b=function(_0x4d3157,_0x318604){_0x4d3157=_0x4d3157-0x0;var _0x56ef95=_0xc6b1[_0x4d3157];return _0x56ef95;};'use strict';var Sequelize=require(_0x1c6b('0x0'));var iconv=require(_0x1c6b('0x1'));module[_0x1c6b('0x2')]={'closed':{'type':Sequelize[_0x1c6b('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1c6b('0x4')]},'disposition':{'type':Sequelize[_0x1c6b('0x5')]},'secondDisposition':{'type':Sequelize[_0x1c6b('0x5')]},'thirdDisposition':{'type':Sequelize[_0x1c6b('0x5')]},'note':{'type':Sequelize[_0x1c6b('0x5')]},'inReplyTo':{'type':Sequelize[_0x1c6b('0x5')](0x1fe)},'to':{'type':Sequelize[_0x1c6b('0x5')]},'cc':{'type':Sequelize['TEXT'](_0x1c6b('0x6'))},'subject':{'type':Sequelize[_0x1c6b('0x7')]()},'attach':{'type':Sequelize[_0x1c6b('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x1c6b('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x1c6b('0x8')]('in',_0x1c6b('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x1c6b('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x42b8=['out','INTEGER','iconv','exports','BOOLEAN','STRING','long','DATE','ENUM'];(function(_0x357cbe,_0x36bace){var _0x1b4edd=function(_0x3e3be3){while(--_0x3e3be3){_0x357cbe['push'](_0x357cbe['shift']());}};_0x1b4edd(++_0x36bace);}(_0x42b8,0x173));var _0x842b=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x42b8[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x842b('0x0'));module[_0x842b('0x1')]={'closed':{'type':Sequelize[_0x842b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x842b('0x3')]},'note':{'type':Sequelize[_0x842b('0x3')]},'inReplyTo':{'type':Sequelize[_0x842b('0x3')](0x1fe)},'to':{'type':Sequelize[_0x842b('0x3')]},'cc':{'type':Sequelize['TEXT'](_0x842b('0x4'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x842b('0x5')]},'substatus':{'type':Sequelize[_0x842b('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x842b('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x842b('0x6')]('in',_0x842b('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x842b('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x842b('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index fdbb848..4b77913 100644 --- a/server/api/mailInteraction/mailInteraction.controller.js +++ b/server/api/mailInteraction/mailInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b1f=['addTags','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','unix','toString','join','server','tmp','root','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','from','bcc','createdAt','get','mkdirSync','each','missing.recipient@your.company.com','headers','Bcc','basename','existsSync','push','readFileSync','build','message%d.eml','download','unlinkSync','eml-format','rimraf','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','update','then','error','stack','name','send','index','map','MailInteraction','rawAttributes','type','getOptions','findAll','mail','user','catch','model','query','keys','intersection','attributes','fields','options','create','body','find','params','destroy','describe','addMessage','ids','omit','getMessages','findOne','filters','length','hasOwnProperty','nolimit','order','sort','where','MailInteractionId','filter','format','YYYY-MM-DD\x20HH:mm:ss','merge','MailMessage','include','inlineCss','true'];(function(_0x419919,_0xc4d1ea){var _0x249673=function(_0x52fd3b){while(--_0x52fd3b){_0x419919['push'](_0x419919['shift']());}};_0x249673(++_0xc4d1ea);}(_0x0b1f,0x1e0));var _0xf0b1=function(_0x2a35df,_0x4ff008){_0x2a35df=_0x2a35df-0x0;var _0x50dd48=_0x0b1f[_0x2a35df];return _0x50dd48;};'use strict';var emlformat=require(_0xf0b1('0x0'));var rimraf=require(_0xf0b1('0x1'));var zipdir=require('zip-dir');var moment=require(_0xf0b1('0x2'));var BPromise=require(_0xf0b1('0x3'));var util=require(_0xf0b1('0x4'));var path=require(_0xf0b1('0x5'));var fs=require('fs');var _=require(_0xf0b1('0x6'));var juice=require('juice');var Redis=require(_0xf0b1('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0xf0b1('0x8'));var logger=require(_0xf0b1('0x9'))(_0xf0b1('0xa'));var config=require('../../config/environment');var db=require(_0xf0b1('0xb'))['db'];var htmlEntities=require('html-entities');config['redis']=_[_0xf0b1('0xc')](config['redis'],{'host':_0xf0b1('0xd'),'port':0x18eb});var socket=require(_0xf0b1('0xe'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0xf0b1('0xf')](socket);function respondWithStatusCode(_0x419f6a,_0x38e7d7){_0x38e7d7=_0x38e7d7||0xcc;return function(_0x24cc85){if(_0x24cc85){return _0x419f6a[_0xf0b1('0x10')](_0x38e7d7);}return _0x419f6a['status'](_0x38e7d7)[_0xf0b1('0x11')]();};}function respondWithResult(_0x4e008b,_0x8781e0){_0x8781e0=_0x8781e0||0xc8;return function(_0x3f00f2){if(_0x3f00f2){return _0x4e008b[_0xf0b1('0x12')](_0x8781e0)[_0xf0b1('0x13')](_0x3f00f2);}};}function respondWithFilteredResult(_0x36374d,_0x3fed93){return function(_0x424261){if(_0x424261){var _0x49da2e=typeof _0x3fed93[_0xf0b1('0x14')]===_0xf0b1('0x15')&&typeof _0x3fed93[_0xf0b1('0x16')]===_0xf0b1('0x15');var _0x5bebc6=_0x424261[_0xf0b1('0x17')];var _0x31580a=_0x49da2e?0x0:_0x3fed93['offset'];var _0x1d305c=_0x49da2e?_0x424261['count']:_0x3fed93['offset']+_0x3fed93[_0xf0b1('0x16')];var _0x286af3;if(_0x1d305c>=_0x5bebc6){_0x1d305c=_0x5bebc6;_0x286af3=0xc8;}else{_0x286af3=0xce;}_0x36374d['status'](_0x286af3);return _0x36374d[_0xf0b1('0x18')]('Content-Range',_0x31580a+'-'+_0x1d305c+'/'+_0x5bebc6)[_0xf0b1('0x13')](_0x424261);}return null;};}function saveUpdates(_0x5b0c83){return function(_0x56623d){if(_0x56623d){return _0x56623d[_0xf0b1('0x19')](_0x5b0c83)[_0xf0b1('0x1a')](function(_0x20e93f){return _0x20e93f;});}return null;};}function removeEntity(_0x413017){return function(_0x3e0d33){if(_0x3e0d33){return _0x3e0d33['destroy']()['then'](function(){_0x413017[_0xf0b1('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35f771){return function(_0x1163b4){if(!_0x1163b4){_0x35f771[_0xf0b1('0x10')](0x194);}return _0x1163b4;};}function handleError(_0x482bc1,_0x40eebc){_0x40eebc=_0x40eebc||0x1f4;return function(_0x595756){logger[_0xf0b1('0x1b')](_0x595756[_0xf0b1('0x1c')]);if(_0x595756['name']){delete _0x595756[_0xf0b1('0x1d')];}_0x482bc1[_0xf0b1('0x12')](_0x40eebc)[_0xf0b1('0x1e')](_0x595756);};}exports[_0xf0b1('0x1f')]=function(_0x30dc27,_0x2c9038){var _0x9e8fdf={};var _0x57e498=_[_0xf0b1('0x20')](db[_0xf0b1('0x21')][_0xf0b1('0x22')],function(_0x2a13f3){return{'name':_0x2a13f3['fieldName'],'type':_0x2a13f3[_0xf0b1('0x23')]['key']};});_0x9e8fdf=qs[_0xf0b1('0x24')](_0x57e498,_0x30dc27);return interaction[_0xf0b1('0x25')](_0xf0b1('0x26'),_0x30dc27['query'],_0x30dc27[_0xf0b1('0x27')],_0x9e8fdf,_0x57e498)['then'](respondWithFilteredResult(_0x2c9038,_0x9e8fdf))[_0xf0b1('0x28')](handleError(_0x2c9038,null));};exports['show']=function(_0x5f0945,_0x8f94a5){var _0x2f3255={'raw':![],'where':{'id':_0x5f0945['params']['id']}},_0xcd3531={};_0xcd3531[_0xf0b1('0x29')]=_['keys'](db[_0xf0b1('0x21')][_0xf0b1('0x22')]);_0xcd3531[_0xf0b1('0x2a')]=_[_0xf0b1('0x2b')](_0x5f0945['query']);_0xcd3531['filters']=_[_0xf0b1('0x2c')](_0xcd3531[_0xf0b1('0x29')],_0xcd3531[_0xf0b1('0x2a')]);_0x2f3255[_0xf0b1('0x2d')]=_[_0xf0b1('0x2c')](_0xcd3531[_0xf0b1('0x29')],qs[_0xf0b1('0x2e')](_0x5f0945[_0xf0b1('0x2a')][_0xf0b1('0x2e')]));_0x2f3255['attributes']=_0x2f3255[_0xf0b1('0x2d')]['length']?_0x2f3255[_0xf0b1('0x2d')]:_0xcd3531['model'];if(_0x5f0945['query']['includeAll']){_0x2f3255['include']=[{'all':!![]}];}_0x2f3255=_['merge']({},_0x2f3255,_0x5f0945[_0xf0b1('0x2f')]);return db[_0xf0b1('0x21')]['find'](_0x2f3255)['then'](handleEntityNotFound(_0x8f94a5,null))['then'](respondWithResult(_0x8f94a5,null))['catch'](handleError(_0x8f94a5,null));};exports[_0xf0b1('0x30')]=function(_0x1e5ab8,_0xf7e908){return db[_0xf0b1('0x21')][_0xf0b1('0x30')](_0x1e5ab8[_0xf0b1('0x31')],{})[_0xf0b1('0x1a')](respondWithResult(_0xf7e908,0xc9))[_0xf0b1('0x28')](handleError(_0xf7e908,null));};exports[_0xf0b1('0x19')]=function(_0x50183e,_0x1122b4){if(_0x50183e['body']['id']){delete _0x50183e[_0xf0b1('0x31')]['id'];}return db['MailInteraction'][_0xf0b1('0x32')]({'where':{'id':_0x50183e[_0xf0b1('0x33')]['id']}})[_0xf0b1('0x1a')](handleEntityNotFound(_0x1122b4,null))[_0xf0b1('0x1a')](saveUpdates(_0x50183e[_0xf0b1('0x31')],null))['then'](respondWithResult(_0x1122b4,null))[_0xf0b1('0x28')](handleError(_0x1122b4,null));};exports[_0xf0b1('0x34')]=function(_0x17b238,_0x2571c3){return db[_0xf0b1('0x21')]['find']({'where':{'id':_0x17b238[_0xf0b1('0x33')]['id']}})[_0xf0b1('0x1a')](handleEntityNotFound(_0x2571c3,null))['then'](removeEntity(_0x2571c3,null))[_0xf0b1('0x28')](handleError(_0x2571c3,null));};exports[_0xf0b1('0x35')]=function(_0x10bd71,_0x13dde3){return db[_0xf0b1('0x21')][_0xf0b1('0x35')]()[_0xf0b1('0x1a')](respondWithResult(_0x13dde3,null))[_0xf0b1('0x28')](handleError(_0x13dde3,null));};exports[_0xf0b1('0x36')]=function(_0xc34170,_0xef0532){return db['MailMessage'][_0xf0b1('0x32')]({'where':{'id':_0xc34170[_0xf0b1('0x33')]['id']}})[_0xf0b1('0x1a')](handleEntityNotFound(_0xef0532,null))[_0xf0b1('0x1a')](function(_0x50b202){if(_0x50b202){return _0x50b202[_0xf0b1('0x36')](_0xc34170[_0xf0b1('0x31')][_0xf0b1('0x37')],_[_0xf0b1('0x38')](_0xc34170[_0xf0b1('0x31')],[_0xf0b1('0x37'),'id'])||{});}})[_0xf0b1('0x1a')](respondWithResult(_0xef0532,null))[_0xf0b1('0x28')](handleError(_0xef0532,null));};exports[_0xf0b1('0x39')]=function(_0x15cd1b,_0x165f0b){var _0x4ba697={'raw':![],'where':{}};var _0x43f1db={};var _0x4a227b={'count':0x0,'rows':[]};return db['MailInteraction'][_0xf0b1('0x3a')]({'where':{'id':_0x15cd1b['params']['id']}})[_0xf0b1('0x1a')](handleEntityNotFound(_0x165f0b,null))[_0xf0b1('0x1a')](function(_0x592277){if(_0x592277){_0x43f1db[_0xf0b1('0x29')]=_[_0xf0b1('0x2b')](db['MailMessage']['rawAttributes']);_0x43f1db['query']=_['keys'](_0x15cd1b[_0xf0b1('0x2a')]);_0x43f1db[_0xf0b1('0x3b')]=_[_0xf0b1('0x2c')](_0x43f1db[_0xf0b1('0x29')],_0x43f1db['query']);_0x4ba697['attributes']=_[_0xf0b1('0x2c')](_0x43f1db[_0xf0b1('0x29')],qs['fields'](_0x15cd1b['query'][_0xf0b1('0x2e')]));_0x4ba697['attributes']=_0x4ba697[_0xf0b1('0x2d')][_0xf0b1('0x3c')]?_0x4ba697[_0xf0b1('0x2d')]:_0x43f1db[_0xf0b1('0x29')];if(!_0x15cd1b[_0xf0b1('0x2a')][_0xf0b1('0x3d')](_0xf0b1('0x3e'))){_0x4ba697[_0xf0b1('0x16')]=qs[_0xf0b1('0x16')](_0x15cd1b[_0xf0b1('0x2a')][_0xf0b1('0x16')]);_0x4ba697[_0xf0b1('0x14')]=qs[_0xf0b1('0x14')](_0x15cd1b['query']['offset']);}_0x4ba697[_0xf0b1('0x3f')]=qs['sort'](_0x15cd1b[_0xf0b1('0x2a')][_0xf0b1('0x40')]);_0x4ba697[_0xf0b1('0x41')]=qs[_0xf0b1('0x3b')](_['pick'](_0x15cd1b[_0xf0b1('0x2a')],_0x43f1db[_0xf0b1('0x3b')]));_0x4ba697[_0xf0b1('0x41')][_0xf0b1('0x42')]=_0x592277['id'];if(_0x15cd1b['query'][_0xf0b1('0x43')]){_0x4ba697[_0xf0b1('0x41')]=_['merge'](_0x4ba697[_0xf0b1('0x41')],{'$or':_[_0xf0b1('0x20')](_0x4ba697['attributes'],function(_0x23af07){var _0x49fb66={};_0x49fb66[_0x23af07]={'$like':'%'+_0x15cd1b['query'][_0xf0b1('0x43')]+'%'};return _0x49fb66;})});}if(_0x15cd1b[_0xf0b1('0x2a')]['$gte']){var _0x4c897f=_0x15cd1b[_0xf0b1('0x2a')]['$gte']['split'](',');var _0x4bce68={};_0x4bce68[_0x4c897f[0x0]]={'$gte':moment(_0x4c897f[0x1])[_0xf0b1('0x44')](_0xf0b1('0x45'))};_0x4ba697[_0xf0b1('0x41')]=_[_0xf0b1('0x46')](_0x4ba697[_0xf0b1('0x41')],_0x4bce68);}_0x4ba697=_[_0xf0b1('0x46')]({},_0x4ba697,_0x15cd1b[_0xf0b1('0x2f')]);return db[_0xf0b1('0x47')][_0xf0b1('0x17')]({'where':_0x4ba697[_0xf0b1('0x41')]})['then'](function(_0x2d6c09){_0x4a227b[_0xf0b1('0x17')]=_0x2d6c09;if(_0x15cd1b[_0xf0b1('0x2a')]['includeAll']){_0x4ba697[_0xf0b1('0x48')]=[{'all':!![]}];}return db[_0xf0b1('0x47')][_0xf0b1('0x25')](_0x4ba697);})['then'](function(_0x5317ec){if(_0x15cd1b[_0xf0b1('0x2a')][_0xf0b1('0x49')]===_0xf0b1('0x4a')){for(var _0x28c532=0x0;_0x28c532<_0x5317ec['length'];_0x28c532++){_0x5317ec[_0x28c532][_0xf0b1('0x31')]=juice(_0x5317ec[_0x28c532][_0xf0b1('0x31')]);}}_0x4a227b['rows']=_0x5317ec;return _0x4a227b;});}})[_0xf0b1('0x1a')](respondWithFilteredResult(_0x165f0b,_0x4ba697))[_0xf0b1('0x28')](handleError(_0x165f0b,null));};exports[_0xf0b1('0x4b')]=function(_0x2bc0ef,_0x2bd927){return db[_0xf0b1('0x21')][_0xf0b1('0x32')]({'where':{'id':_0x2bc0ef[_0xf0b1('0x33')]['id']}})[_0xf0b1('0x1a')](handleEntityNotFound(_0x2bd927,null))[_0xf0b1('0x1a')](function(_0x4954cc){if(_0x4954cc){return _0x4954cc[_0xf0b1('0x4c')](_0x2bc0ef[_0xf0b1('0x31')][_0xf0b1('0x37')],_['omit'](_0x2bc0ef[_0xf0b1('0x31')],[_0xf0b1('0x37'),'id'])||{})[_0xf0b1('0x4d')](function(){return db[_0xf0b1('0x4e')][_0xf0b1('0x25')]({'attributes':['id',_0xf0b1('0x1d'),_0xf0b1('0x4f')],'where':{'id':_0x2bc0ef[_0xf0b1('0x31')][_0xf0b1('0x37')]}});})[_0xf0b1('0x1a')](function(_0x2cf335){socket[_0xf0b1('0x50')](_0xf0b1('0x51'),{'id':Number(_0x2bc0ef[_0xf0b1('0x33')]['id']),'tags':_0x2cf335||[]});return{'id':Number(_0x2bc0ef['params']['id']),'tags':_0x2cf335||[]};});}})['then'](respondWithResult(_0x2bd927,null))[_0xf0b1('0x28')](handleError(_0x2bd927,null));};exports[_0xf0b1('0x52')]=function(_0x13ac45,_0x2ec49d){return db['MailInteraction'][_0xf0b1('0x32')]({'where':{'id':_0x13ac45['params']['id']}})[_0xf0b1('0x1a')](handleEntityNotFound(_0x2ec49d,null))[_0xf0b1('0x1a')](function(_0x350716){if(_0x350716){return _0x350716['removeTags'](_0x13ac45[_0xf0b1('0x2a')][_0xf0b1('0x37')]);}})[_0xf0b1('0x1a')](respondWithStatusCode(_0x2ec49d,null))[_0xf0b1('0x28')](handleError(_0x2ec49d,null));};exports['download']=function(_0x2db55e,_0x149314){var _0x28def1=moment()[_0xf0b1('0x53')]()[_0xf0b1('0x54')]();var _0x40448c=path[_0xf0b1('0x55')](config['root'],_0xf0b1('0x56'),'files',_0xf0b1('0x57'));var _0x31e701=path[_0xf0b1('0x55')](config[_0xf0b1('0x58')],'server','files',_0xf0b1('0x59'));var _0x2d8afe=path[_0xf0b1('0x55')](_0x40448c,_0x28def1);var _0xfcd924=util[_0xf0b1('0x44')](_0xf0b1('0x5a'),_0x2db55e[_0xf0b1('0x33')]['id'],_0x28def1);var _0x42dcce=path[_0xf0b1('0x55')](_0x40448c,_0xfcd924);var _0x3e0137=[];if(_0x2db55e['query'][_0xf0b1('0x59')]){_0x3e0137['push']({'model':db[_0xf0b1('0x5b')],'as':_0xf0b1('0x5c'),'raw':!![]});}var _0x52198f=[{'model':db[_0xf0b1('0x47')],'as':_0xf0b1('0x5d'),'attributes':['id',_0xf0b1('0x31'),_0xf0b1('0x5e'),'to','cc',_0xf0b1('0x5f'),'subject',_0xf0b1('0x60')],'where':{'secret':![]},'order':qs[_0xf0b1('0x40')]('id'),'include':_0x3e0137}];return db[_0xf0b1('0x21')][_0xf0b1('0x32')]({'where':{'id':_0x2db55e['params']['id']},'include':_0x52198f})[_0xf0b1('0x1a')](handleEntityNotFound(_0x149314,null))[_0xf0b1('0x1a')](function(_0x5a6d24){if(_0x5a6d24&&_0x5a6d24[_0xf0b1('0x5d')]){var _0x3e35c1=_0x5a6d24[_0xf0b1('0x61')]({'plain':!![]});fs[_0xf0b1('0x62')](_0x2d8afe);return BPromise[_0xf0b1('0x63')](_0x3e35c1[_0xf0b1('0x5d')],function(_0x840948,_0x5b851a){var _0x5a0780={'from':_0x840948['from'],'to':_0x840948['to']||_0xf0b1('0x64'),'subject':_0x840948['subject'],'html':htmlEntities['decode'](_0x840948[_0xf0b1('0x31')]),'headers':{'Date':moment(_0x840948['createdAt'])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x840948['cc']){_0x5a0780['headers']['Cc']=_0x840948['cc'];}if(_0x840948[_0xf0b1('0x5f')]){_0x5a0780[_0xf0b1('0x65')][_0xf0b1('0x66')]=_0x840948[_0xf0b1('0x5f')];}return new BPromise(function(_0x5a7478,_0x2e33f9){if(_0x840948[_0xf0b1('0x5c')]){for(var _0x3c7753=0x0;_0x3c7753<_0x840948[_0xf0b1('0x5c')][_0xf0b1('0x3c')];_0x3c7753++){var _0x95eb20=_0x840948[_0xf0b1('0x5c')][_0x3c7753];var _0x12c425=path[_0xf0b1('0x55')](_0x31e701,_0x95eb20[_0xf0b1('0x67')]);if(fs[_0xf0b1('0x68')](_0x12c425)){_0x5a0780[_0xf0b1('0x59')][_0xf0b1('0x69')]({'name':_0x95eb20[_0xf0b1('0x1d')],'contentType':_0x95eb20[_0xf0b1('0x23')],'data':fs[_0xf0b1('0x6a')](_0x12c425)});}}}emlformat[_0xf0b1('0x6b')](_0x5a0780,function(_0x43939c,_0x4f16b5){if(_0x43939c)return _0x2e33f9(_0x43939c);fs['writeFileSync'](path[_0xf0b1('0x55')](_0x2d8afe,util[_0xf0b1('0x44')](_0xf0b1('0x6c'),_0x5b851a)),_0x4f16b5);return _0x5a7478(_0x4f16b5);});});})['then'](function(){return new BPromise(function(_0x4003bb,_0x5b86ea){zipdir(_0x2d8afe,{'saveTo':_0x42dcce},function(_0x5df8ae,_0x585e5d){if(_0x5df8ae)return _0x5b86ea(_0x5df8ae);return _0x4003bb(_0x585e5d);});})['then'](function(){return new BPromise(function(_0x5e3965,_0x373e5f){rimraf(_0x2d8afe,function(_0x4b9b51){if(_0x4b9b51)_0x373e5f(_0x4b9b51);return _0x5e3965();});});})['then'](function(){return _0x149314[_0xf0b1('0x6d')](_0x42dcce,_0xfcd924,function(_0x276fa2){if(!_0x276fa2)fs[_0xf0b1('0x6e')](_0x42dcce);});});});}else{return _0x149314[_0xf0b1('0x10')](0xc8);}})[_0xf0b1('0x28')](handleError(_0x149314,null));}; \ No newline at end of file +var _0x637a=['mailInteractionTags:save','removeTags','download','unix','toString','join','root','files','attachments','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','from','bcc','subject','get','mkdirSync','each','missing.recipient@your.company.com','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','bluebird','util','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','limit','count','Content-Range','update','error','name','index','map','MailInteraction','rawAttributes','fieldName','type','key','getOptions','query','user','then','catch','params','model','keys','intersection','attributes','fields','includeAll','include','merge','options','find','create','body','destroy','describe','addMessage','ids','omit','getMessages','findOne','MailMessage','filters','hasOwnProperty','sort','where','pick','filter','$gte','split','format','true','length','rows','spread','Tag','findAll'];(function(_0x121b1f,_0x514e81){var _0x33652a=function(_0x1555ac){while(--_0x1555ac){_0x121b1f['push'](_0x121b1f['shift']());}};_0x33652a(++_0x514e81);}(_0x637a,0x8a));var _0xa637=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x637a[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0xa637('0x0'));var rimraf=require(_0xa637('0x1'));var zipdir=require(_0xa637('0x2'));var moment=require('moment');var BPromise=require(_0xa637('0x3'));var util=require(_0xa637('0x4'));var path=require('path');var fs=require('fs');var _=require(_0xa637('0x5'));var juice=require(_0xa637('0x6'));var Redis=require(_0xa637('0x7'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require(_0xa637('0x8'))(_0xa637('0x9'));var config=require(_0xa637('0xa'));var db=require(_0xa637('0xb'))['db'];var htmlEntities=require(_0xa637('0xc'));config[_0xa637('0xd')]=_[_0xa637('0xe')](config[_0xa637('0xd')],{'host':_0xa637('0xf'),'port':0x18eb});var socket=require(_0xa637('0x10'))(new Redis(config[_0xa637('0xd')]));require(_0xa637('0x11'))[_0xa637('0x12')](socket);function respondWithStatusCode(_0x18e497,_0xcd7344){_0xcd7344=_0xcd7344||0xcc;return function(_0x152a98){if(_0x152a98){return _0x18e497[_0xa637('0x13')](_0xcd7344);}return _0x18e497[_0xa637('0x14')](_0xcd7344)[_0xa637('0x15')]();};}function respondWithResult(_0x3074a5,_0x196c47){_0x196c47=_0x196c47||0xc8;return function(_0x52207f){if(_0x52207f){return _0x3074a5[_0xa637('0x14')](_0x196c47)[_0xa637('0x16')](_0x52207f);}};}function respondWithFilteredResult(_0x2c1bb3,_0xb1c23f){return function(_0x557db3){if(_0x557db3){var _0x2228cd=typeof _0xb1c23f[_0xa637('0x17')]==='undefined'&&typeof _0xb1c23f[_0xa637('0x18')]==='undefined';var _0x3ebc06=_0x557db3[_0xa637('0x19')];var _0xd229a5=_0x2228cd?0x0:_0xb1c23f[_0xa637('0x17')];var _0x3a4e65=_0x2228cd?_0x557db3[_0xa637('0x19')]:_0xb1c23f[_0xa637('0x17')]+_0xb1c23f[_0xa637('0x18')];var _0x5c8c1c;if(_0x3a4e65>=_0x3ebc06){_0x3a4e65=_0x3ebc06;_0x5c8c1c=0xc8;}else{_0x5c8c1c=0xce;}_0x2c1bb3[_0xa637('0x14')](_0x5c8c1c);return _0x2c1bb3['set'](_0xa637('0x1a'),_0xd229a5+'-'+_0x3a4e65+'/'+_0x3ebc06)[_0xa637('0x16')](_0x557db3);}return null;};}function saveUpdates(_0x4af45b){return function(_0x5aa58e){if(_0x5aa58e){return _0x5aa58e[_0xa637('0x1b')](_0x4af45b)['then'](function(_0x3270c4){return _0x3270c4;});}return null;};}function removeEntity(_0x1bf9a0){return function(_0x2c3f19){if(_0x2c3f19){return _0x2c3f19['destroy']()['then'](function(){_0x1bf9a0['status'](0xcc)[_0xa637('0x15')]();});}};}function handleEntityNotFound(_0x294105){return function(_0x3260ac){if(!_0x3260ac){_0x294105[_0xa637('0x13')](0x194);}return _0x3260ac;};}function handleError(_0x1ad675,_0x2c3d19){_0x2c3d19=_0x2c3d19||0x1f4;return function(_0xa68b3d){logger[_0xa637('0x1c')](_0xa68b3d['stack']);if(_0xa68b3d[_0xa637('0x1d')]){delete _0xa68b3d['name'];}_0x1ad675['status'](_0x2c3d19)['send'](_0xa68b3d);};}exports[_0xa637('0x1e')]=function(_0x512a52,_0x27534d){var _0x5b64a6={};var _0x467d9e=_[_0xa637('0x1f')](db[_0xa637('0x20')][_0xa637('0x21')],function(_0x1d9044){return{'name':_0x1d9044[_0xa637('0x22')],'type':_0x1d9044[_0xa637('0x23')][_0xa637('0x24')]};});_0x5b64a6=qs[_0xa637('0x25')](_0x467d9e,_0x512a52);return interaction['findAll']('mail',_0x512a52[_0xa637('0x26')],_0x512a52[_0xa637('0x27')],_0x5b64a6,_0x467d9e)[_0xa637('0x28')](respondWithFilteredResult(_0x27534d,_0x5b64a6))[_0xa637('0x29')](handleError(_0x27534d,null));};exports['show']=function(_0x22a1fc,_0x10e550){var _0x24cd6d={'raw':![],'where':{'id':_0x22a1fc[_0xa637('0x2a')]['id']}},_0x48aaaa={};_0x48aaaa[_0xa637('0x2b')]=_[_0xa637('0x2c')](db[_0xa637('0x20')][_0xa637('0x21')]);_0x48aaaa[_0xa637('0x26')]=_[_0xa637('0x2c')](_0x22a1fc['query']);_0x48aaaa['filters']=_[_0xa637('0x2d')](_0x48aaaa[_0xa637('0x2b')],_0x48aaaa[_0xa637('0x26')]);_0x24cd6d[_0xa637('0x2e')]=_['intersection'](_0x48aaaa['model'],qs[_0xa637('0x2f')](_0x22a1fc['query'][_0xa637('0x2f')]));_0x24cd6d['attributes']=_0x24cd6d[_0xa637('0x2e')]['length']?_0x24cd6d[_0xa637('0x2e')]:_0x48aaaa[_0xa637('0x2b')];if(_0x22a1fc[_0xa637('0x26')][_0xa637('0x30')]){_0x24cd6d[_0xa637('0x31')]=[{'all':!![]}];}_0x24cd6d=_[_0xa637('0x32')]({},_0x24cd6d,_0x22a1fc[_0xa637('0x33')]);return db[_0xa637('0x20')][_0xa637('0x34')](_0x24cd6d)[_0xa637('0x28')](handleEntityNotFound(_0x10e550,null))['then'](respondWithResult(_0x10e550,null))[_0xa637('0x29')](handleError(_0x10e550,null));};exports[_0xa637('0x35')]=function(_0x21f13d,_0x33c544){return db[_0xa637('0x20')][_0xa637('0x35')](_0x21f13d[_0xa637('0x36')],{})[_0xa637('0x28')](respondWithResult(_0x33c544,0xc9))['catch'](handleError(_0x33c544,null));};exports[_0xa637('0x1b')]=function(_0x1c94c7,_0x5a3855){if(_0x1c94c7[_0xa637('0x36')]['id']){delete _0x1c94c7[_0xa637('0x36')]['id'];}return db[_0xa637('0x20')][_0xa637('0x34')]({'where':{'id':_0x1c94c7[_0xa637('0x2a')]['id']}})['then'](handleEntityNotFound(_0x5a3855,null))['then'](saveUpdates(_0x1c94c7[_0xa637('0x36')],null))[_0xa637('0x28')](respondWithResult(_0x5a3855,null))[_0xa637('0x29')](handleError(_0x5a3855,null));};exports[_0xa637('0x37')]=function(_0x42e44d,_0x12ec22){return db[_0xa637('0x20')]['find']({'where':{'id':_0x42e44d[_0xa637('0x2a')]['id']}})[_0xa637('0x28')](handleEntityNotFound(_0x12ec22,null))['then'](removeEntity(_0x12ec22,null))[_0xa637('0x29')](handleError(_0x12ec22,null));};exports[_0xa637('0x38')]=function(_0x4f1dce,_0x2ec755){return db[_0xa637('0x20')][_0xa637('0x38')]()[_0xa637('0x28')](respondWithResult(_0x2ec755,null))[_0xa637('0x29')](handleError(_0x2ec755,null));};exports[_0xa637('0x39')]=function(_0x39087f,_0x4df12f){return db['MailMessage'][_0xa637('0x34')]({'where':{'id':_0x39087f[_0xa637('0x2a')]['id']}})[_0xa637('0x28')](handleEntityNotFound(_0x4df12f,null))['then'](function(_0x1e2271){if(_0x1e2271){return _0x1e2271[_0xa637('0x39')](_0x39087f[_0xa637('0x36')][_0xa637('0x3a')],_[_0xa637('0x3b')](_0x39087f['body'],[_0xa637('0x3a'),'id'])||{});}})['then'](respondWithResult(_0x4df12f,null))[_0xa637('0x29')](handleError(_0x4df12f,null));};exports[_0xa637('0x3c')]=function(_0xce4429,_0x13a128){var _0x24be77={'raw':![],'where':{}};var _0x43d84e={};var _0x4330b3={'count':0x0,'rows':[]};return db[_0xa637('0x20')][_0xa637('0x3d')]({'where':{'id':_0xce4429['params']['id']}})[_0xa637('0x28')](handleEntityNotFound(_0x13a128,null))[_0xa637('0x28')](function(_0xc16640){if(_0xc16640){_0x43d84e[_0xa637('0x2b')]=_[_0xa637('0x2c')](db[_0xa637('0x3e')]['rawAttributes']);_0x43d84e[_0xa637('0x26')]=_[_0xa637('0x2c')](_0xce4429[_0xa637('0x26')]);_0x43d84e[_0xa637('0x3f')]=_[_0xa637('0x2d')](_0x43d84e['model'],_0x43d84e[_0xa637('0x26')]);_0x24be77[_0xa637('0x2e')]=_[_0xa637('0x2d')](_0x43d84e['model'],qs[_0xa637('0x2f')](_0xce4429[_0xa637('0x26')][_0xa637('0x2f')]));_0x24be77[_0xa637('0x2e')]=_0x24be77[_0xa637('0x2e')]['length']?_0x24be77['attributes']:_0x43d84e[_0xa637('0x2b')];if(!_0xce4429[_0xa637('0x26')][_0xa637('0x40')]('nolimit')){_0x24be77['limit']=qs[_0xa637('0x18')](_0xce4429['query'][_0xa637('0x18')]);_0x24be77['offset']=qs[_0xa637('0x17')](_0xce4429[_0xa637('0x26')]['offset']);}_0x24be77['order']=qs[_0xa637('0x41')](_0xce4429[_0xa637('0x26')][_0xa637('0x41')]);_0x24be77[_0xa637('0x42')]=qs['filters'](_[_0xa637('0x43')](_0xce4429['query'],_0x43d84e[_0xa637('0x3f')]));_0x24be77['where']['MailInteractionId']=_0xc16640['id'];if(_0xce4429[_0xa637('0x26')][_0xa637('0x44')]){_0x24be77['where']=_[_0xa637('0x32')](_0x24be77['where'],{'$or':_[_0xa637('0x1f')](_0x24be77[_0xa637('0x2e')],function(_0x3de4b1){var _0x3c904d={};_0x3c904d[_0x3de4b1]={'$like':'%'+_0xce4429['query']['filter']+'%'};return _0x3c904d;})});}if(_0xce4429[_0xa637('0x26')][_0xa637('0x45')]){var _0x267c0c=_0xce4429['query'][_0xa637('0x45')][_0xa637('0x46')](',');var _0x28edb5={};_0x28edb5[_0x267c0c[0x0]]={'$gte':moment(_0x267c0c[0x1])[_0xa637('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x24be77[_0xa637('0x42')]=_[_0xa637('0x32')](_0x24be77[_0xa637('0x42')],_0x28edb5);}_0x24be77=_[_0xa637('0x32')]({},_0x24be77,_0xce4429['options']);return db[_0xa637('0x3e')][_0xa637('0x19')]({'where':_0x24be77[_0xa637('0x42')]})[_0xa637('0x28')](function(_0x1d3e7f){_0x4330b3[_0xa637('0x19')]=_0x1d3e7f;if(_0xce4429['query'][_0xa637('0x30')]){_0x24be77['include']=[{'all':!![]}];}return db[_0xa637('0x3e')]['findAll'](_0x24be77);})['then'](function(_0x1416f0){if(_0xce4429[_0xa637('0x26')]['inlineCss']===_0xa637('0x48')){for(var _0x28e4ca=0x0;_0x28e4ca<_0x1416f0[_0xa637('0x49')];_0x28e4ca++){_0x1416f0[_0x28e4ca][_0xa637('0x36')]=juice(_0x1416f0[_0x28e4ca][_0xa637('0x36')]);}}_0x4330b3[_0xa637('0x4a')]=_0x1416f0;return _0x4330b3;});}})['then'](respondWithFilteredResult(_0x13a128,_0x24be77))[_0xa637('0x29')](handleError(_0x13a128,null));};exports['addTags']=function(_0x9e6020,_0x53eeb4){return db['MailInteraction'][_0xa637('0x34')]({'where':{'id':_0x9e6020[_0xa637('0x2a')]['id']}})[_0xa637('0x28')](handleEntityNotFound(_0x53eeb4,null))[_0xa637('0x28')](function(_0x54a7b3){if(_0x54a7b3){return _0x54a7b3['setTags'](_0x9e6020['body']['ids'],_['omit'](_0x9e6020['body'],[_0xa637('0x3a'),'id'])||{})[_0xa637('0x4b')](function(){return db[_0xa637('0x4c')][_0xa637('0x4d')]({'attributes':['id',_0xa637('0x1d'),'color'],'where':{'id':_0x9e6020['body']['ids']}});})[_0xa637('0x28')](function(_0x1555b4){socket['emit'](_0xa637('0x4e'),{'id':Number(_0x9e6020[_0xa637('0x2a')]['id']),'tags':_0x1555b4||[]});return{'id':Number(_0x9e6020[_0xa637('0x2a')]['id']),'tags':_0x1555b4||[]};});}})[_0xa637('0x28')](respondWithResult(_0x53eeb4,null))[_0xa637('0x29')](handleError(_0x53eeb4,null));};exports[_0xa637('0x4f')]=function(_0x5e6884,_0x1a002a){return db[_0xa637('0x20')][_0xa637('0x34')]({'where':{'id':_0x5e6884['params']['id']}})[_0xa637('0x28')](handleEntityNotFound(_0x1a002a,null))['then'](function(_0x446724){if(_0x446724){return _0x446724[_0xa637('0x4f')](_0x5e6884['query'][_0xa637('0x3a')]);}})[_0xa637('0x28')](respondWithStatusCode(_0x1a002a,null))[_0xa637('0x29')](handleError(_0x1a002a,null));};exports[_0xa637('0x50')]=function(_0x4db631,_0x195482){var _0x4f83e7=moment()[_0xa637('0x51')]()[_0xa637('0x52')]();var _0x2e7e90=path[_0xa637('0x53')](config[_0xa637('0x54')],'server',_0xa637('0x55'),'tmp');var _0x5a7a47=path['join'](config[_0xa637('0x54')],'server','files',_0xa637('0x56'));var _0x500a74=path[_0xa637('0x53')](_0x2e7e90,_0x4f83e7);var _0xc8ec35=util['format'](_0xa637('0x57'),_0x4db631[_0xa637('0x2a')]['id'],_0x4f83e7);var _0x1f01f5=path[_0xa637('0x53')](_0x2e7e90,_0xc8ec35);var _0x242b59=[];if(_0x4db631[_0xa637('0x26')][_0xa637('0x56')]){_0x242b59[_0xa637('0x58')]({'model':db[_0xa637('0x59')],'as':_0xa637('0x5a'),'raw':!![]});}var _0x1c62a7=[{'model':db[_0xa637('0x3e')],'as':_0xa637('0x5b'),'attributes':['id',_0xa637('0x36'),_0xa637('0x5c'),'to','cc',_0xa637('0x5d'),_0xa637('0x5e'),'createdAt'],'where':{'secret':![]},'order':qs[_0xa637('0x41')]('id'),'include':_0x242b59}];return db[_0xa637('0x20')][_0xa637('0x34')]({'where':{'id':_0x4db631[_0xa637('0x2a')]['id']},'include':_0x1c62a7})['then'](handleEntityNotFound(_0x195482,null))[_0xa637('0x28')](function(_0x2c8336){if(_0x2c8336&&_0x2c8336[_0xa637('0x5b')]){var _0x145f92=_0x2c8336[_0xa637('0x5f')]({'plain':!![]});fs[_0xa637('0x60')](_0x500a74);return BPromise[_0xa637('0x61')](_0x145f92[_0xa637('0x5b')],function(_0x2d3b9e,_0x2ed93e){var _0xb05d3d={'from':_0x2d3b9e['from'],'to':_0x2d3b9e['to']||_0xa637('0x62'),'subject':_0x2d3b9e[_0xa637('0x5e')],'html':htmlEntities['decode'](_0x2d3b9e[_0xa637('0x36')]),'headers':{'Date':moment(_0x2d3b9e['createdAt'])['format'](_0xa637('0x63'))},'attachments':[]};if(_0x2d3b9e['cc']){_0xb05d3d[_0xa637('0x64')]['Cc']=_0x2d3b9e['cc'];}if(_0x2d3b9e[_0xa637('0x5d')]){_0xb05d3d['headers'][_0xa637('0x65')]=_0x2d3b9e[_0xa637('0x5d')];}return new BPromise(function(_0x8e6c19,_0x5e1264){if(_0x2d3b9e['Attachments']){for(var _0x37c00f=0x0;_0x37c00f<_0x2d3b9e['Attachments'][_0xa637('0x49')];_0x37c00f++){var _0xd1e4e=_0x2d3b9e[_0xa637('0x5a')][_0x37c00f];var _0x23e372=path[_0xa637('0x53')](_0x5a7a47,_0xd1e4e[_0xa637('0x66')]);if(fs[_0xa637('0x67')](_0x23e372)){_0xb05d3d[_0xa637('0x56')]['push']({'name':_0xd1e4e[_0xa637('0x1d')],'contentType':_0xd1e4e[_0xa637('0x23')],'data':fs[_0xa637('0x68')](_0x23e372)});}}}emlformat[_0xa637('0x69')](_0xb05d3d,function(_0x26af88,_0x565f3c){if(_0x26af88)return _0x5e1264(_0x26af88);fs['writeFileSync'](path['join'](_0x500a74,util[_0xa637('0x47')](_0xa637('0x6a'),_0x2ed93e)),_0x565f3c);return _0x8e6c19(_0x565f3c);});});})[_0xa637('0x28')](function(){return new BPromise(function(_0x144d72,_0x5d2438){zipdir(_0x500a74,{'saveTo':_0x1f01f5},function(_0x1d37b7,_0x3e25a0){if(_0x1d37b7)return _0x5d2438(_0x1d37b7);return _0x144d72(_0x3e25a0);});})[_0xa637('0x28')](function(){return new BPromise(function(_0x15558b,_0x51845d){rimraf(_0x500a74,function(_0x41d94a){if(_0x41d94a)_0x51845d(_0x41d94a);return _0x15558b();});});})[_0xa637('0x28')](function(){return _0x195482[_0xa637('0x50')](_0x1f01f5,_0xc8ec35,function(_0x297fbb){if(!_0x297fbb)fs[_0xa637('0x6b')](_0x1f01f5);});});});}else{return _0x195482[_0xa637('0x13')](0xc8);}})[_0xa637('0x29')](handleError(_0x195482,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 36d28a5..d6db8be 100644 --- a/server/api/mailInteraction/mailInteraction.events.js +++ b/server/api/mailInteraction/mailInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe55d=['then','setDataValue','map','findAll','unreadMessages','emit','hasOwnProperty','hook','exports','../../mysqldb','MailInteraction','MailMessage','save','remove','getUsers'];(function(_0x3141f8,_0xc7e547){var _0x5b3d1f=function(_0x493866){while(--_0x493866){_0x3141f8['push'](_0x3141f8['shift']());}};_0x5b3d1f(++_0xc7e547);}(_0xe55d,0x81));var _0xde55=function(_0x1b1211,_0x25a3ec){_0x1b1211=_0x1b1211-0x0;var _0x458eea=_0xe55d[_0x1b1211];return _0x458eea;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xde55('0x0'))['db'][_0xde55('0x1')];var MailMessage=require(_0xde55('0x0'))['db'][_0xde55('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xde55('0x3'),'afterUpdate':'update','afterDestroy':_0xde55('0x4')};function emitEvent(_0x3097a3){return function(_0x48b6ab,_0x5b7168,_0x1b5471){_0x48b6ab[_0xde55('0x5')]({'attributes':['id'],'raw':!![]})[_0xde55('0x6')](function(_0x5c0382){_0x48b6ab[_0xde55('0x7')]('Users',_0x5c0382[_0xde55('0x8')](function(_0x4bc355){return{'id':_0x4bc355['id']};}));return MailMessage[_0xde55('0x9')]({'where':{'MailInteractionId':_0x48b6ab['id'],'direction':'in','read':![]},'raw':!![]});})[_0xde55('0x6')](function(_0x2141c1){_0x48b6ab[_0xde55('0x7')](_0xde55('0xa'),_0x2141c1['length']);MailInteractionEvents[_0xde55('0xb')](_0x3097a3+':'+_0x48b6ab['id'],_0x48b6ab);MailInteractionEvents[_0xde55('0xb')](_0x3097a3,_0x48b6ab);_0x1b5471(null);})['catch'](_0x1b5471(null));};}for(var e in events){if(events[_0xde55('0xc')](e)){var event=events[e];MailInteraction[_0xde55('0xd')](e,emitEvent(event));}}module[_0xde55('0xe')]=MailInteractionEvents; \ No newline at end of file +var _0xd648=['events','../../mysqldb','MailInteraction','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','exports'];(function(_0x1a0cda,_0x302fe1){var _0x4d2dca=function(_0x193849){while(--_0x193849){_0x1a0cda['push'](_0x1a0cda['shift']());}};_0x4d2dca(++_0x302fe1);}(_0xd648,0x9a));var _0x8d64=function(_0x5d9caf,_0x467f88){_0x5d9caf=_0x5d9caf-0x0;var _0x36a9db=_0xd648[_0x5d9caf];return _0x36a9db;};'use strict';var EventEmitter=require(_0x8d64('0x0'));var MailInteraction=require(_0x8d64('0x1'))['db'][_0x8d64('0x2')];var MailMessage=require(_0x8d64('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x425a14){return function(_0x30ac39,_0x20e236,_0xd3cdc8){_0x30ac39[_0x8d64('0x3')]({'attributes':['id'],'raw':!![]})[_0x8d64('0x4')](function(_0x7abbc3){_0x30ac39[_0x8d64('0x5')](_0x8d64('0x6'),_0x7abbc3[_0x8d64('0x7')](function(_0x2b3c52){return{'id':_0x2b3c52['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x30ac39['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3b9f96){_0x30ac39['setDataValue'](_0x8d64('0x8'),_0x3b9f96[_0x8d64('0x9')]);MailInteractionEvents[_0x8d64('0xa')](_0x425a14+':'+_0x30ac39['id'],_0x30ac39);MailInteractionEvents[_0x8d64('0xa')](_0x425a14,_0x30ac39);_0xd3cdc8(null);})[_0x8d64('0xb')](_0xd3cdc8(null));};}for(var e in events){if(events[_0x8d64('0xc')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x8d64('0xd')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index eff2744..a11a31c 100644 --- a/server/api/mailInteraction/mailInteraction.model.js +++ b/server/api/mailInteraction/mailInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2389=['./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','subject','substatus','substatusAt','format','closed','YYYY-MM-DD\x20HH:mm:ss','changed','closedAt','models','get','MailMessage','update','then','catch','utf8mb4','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xff7025,_0x237d34){var _0x10fc95=function(_0x4adc7a){while(--_0x4adc7a){_0xff7025['push'](_0xff7025['shift']());}};_0x10fc95(++_0x237d34);}(_0x2389,0x1f0));var _0x9238=function(_0x275983,_0x2e8bb0){_0x275983=_0x275983-0x0;var _0x234332=_0x2389[_0x275983];return _0x234332;};'use strict';var _=require('lodash');var util=require(_0x9238('0x0'));var logger=require(_0x9238('0x1'))(_0x9238('0x2'));var moment=require(_0x9238('0x3'));var BPromise=require('bluebird');var rp=require(_0x9238('0x4'));var fs=require('fs');var path=require(_0x9238('0x5'));var rimraf=require(_0x9238('0x6'));var config=require(_0x9238('0x7'));var attributes=require(_0x9238('0x8'));module[_0x9238('0x9')]=function(_0x516217,_0x575206){return _0x516217[_0x9238('0xa')](_0x9238('0xb'),attributes,{'tableName':_0x9238('0xc'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x9238('0xd'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x101ba9,_0x55fa4a,_0x501da1){if(_0x101ba9[_0x9238('0xe')]){_0x101ba9[_0x9238('0xf')]=moment()[_0x9238('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x101ba9[_0x9238('0x11')]){_0x101ba9['closedAt']=moment()[_0x9238('0x10')](_0x9238('0x12'));}_0x501da1(null,_0x55fa4a);},'beforeUpdate':function(_0x44c398,_0x37f5f7,_0x44b1fa){if(_0x44c398['changed'](_0x9238('0xe'))){_0x44c398[_0x9238('0xf')]=_0x44c398['substatus']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x44c398[_0x9238('0x13')](_0x9238('0x11'))){_0x44c398[_0x9238('0x14')]=moment()[_0x9238('0x10')](_0x9238('0x12'));_0x44c398[_0x9238('0xe')]=null;_0x44c398[_0x9238('0xf')]=null;}_0x44b1fa(null,_0x44c398);},'afterUpdate':function(_0x4ab046,_0x147be3,_0x462dac){var _0x405d7c=_0x516217[_0x9238('0x15')];var _0x34e056=_0x4ab046[_0x9238('0x16')]({'plain':!![]});if(_0x34e056[_0x9238('0x11')]){return _0x405d7c[_0x9238('0x17')][_0x9238('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x34e056['id']}})[_0x9238('0x19')](function(){_0x462dac();})[_0x9238('0x1a')](function(_0x31674e){_0x462dac(_0x31674e);});}else{_0x462dac();}}},'charset':_0x9238('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1911=['then','catch','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','get','MailMessage'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x1911,0x12c));var _0x1191=function(_0x21ac06,_0x40dd86){_0x21ac06=_0x21ac06-0x0;var _0x327865=_0x1911[_0x21ac06];return _0x327865;};'use strict';var _=require(_0x1191('0x0'));var util=require(_0x1191('0x1'));var logger=require(_0x1191('0x2'))(_0x1191('0x3'));var moment=require(_0x1191('0x4'));var BPromise=require(_0x1191('0x5'));var rp=require(_0x1191('0x6'));var fs=require('fs');var path=require(_0x1191('0x7'));var rimraf=require(_0x1191('0x8'));var config=require(_0x1191('0x9'));var attributes=require(_0x1191('0xa'));module['exports']=function(_0x11d4ae,_0x587d12){return _0x11d4ae[_0x1191('0xb')](_0x1191('0xc'),attributes,{'tableName':_0x1191('0xd'),'paranoid':![],'indexes':[{'name':_0x1191('0xe'),'fields':['subject','to'],'type':_0x1191('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4cfc80,_0x190ef9,_0x3e05d1){if(_0x4cfc80[_0x1191('0x10')]){_0x4cfc80[_0x1191('0x11')]=moment()[_0x1191('0x12')](_0x1191('0x13'));}if(_0x4cfc80[_0x1191('0x14')]){_0x4cfc80[_0x1191('0x15')]=moment()[_0x1191('0x12')](_0x1191('0x13'));}_0x3e05d1(null,_0x190ef9);},'beforeUpdate':function(_0x5c991d,_0x594a74,_0x42e82e){if(_0x5c991d['changed'](_0x1191('0x10'))){_0x5c991d['substatusAt']=_0x5c991d[_0x1191('0x10')]?moment()[_0x1191('0x12')](_0x1191('0x13')):null;}if(_0x5c991d['changed'](_0x1191('0x14'))){_0x5c991d[_0x1191('0x15')]=moment()[_0x1191('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x5c991d[_0x1191('0x10')]=null;_0x5c991d[_0x1191('0x11')]=null;}_0x42e82e(null,_0x5c991d);},'afterUpdate':function(_0x28ce26,_0x392b39,_0x1770f5){var _0x56a95b=_0x11d4ae['models'];var _0x188d4c=_0x28ce26[_0x1191('0x16')]({'plain':!![]});if(_0x188d4c[_0x1191('0x14')]){return _0x56a95b[_0x1191('0x17')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x188d4c['id']}})[_0x1191('0x18')](function(){_0x1770f5();})[_0x1191('0x19')](function(_0x314b03){_0x1770f5(_0x314b03);});}else{_0x1770f5();}}},'charset':_0x1191('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index efc358b..df4e59d 100644 --- a/server/api/mailInteraction/mailInteraction.rpc.js +++ b/server/api/mailInteraction/mailInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5186=['find','addTags','ids','omit','AddTags','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction'];(function(_0x7072c1,_0x264b9e){var _0x10a0bf=function(_0x5e6ae8){while(--_0x5e6ae8){_0x7072c1['push'](_0x7072c1['shift']());}};_0x10a0bf(++_0x264b9e);}(_0x5186,0x180));var _0x6518=function(_0x1694e4,_0x555d67){_0x1694e4=_0x1694e4-0x0;var _0x3c087d=_0x5186[_0x1694e4];return _0x3c087d;};'use strict';var _=require(_0x6518('0x0'));var util=require(_0x6518('0x1'));var moment=require(_0x6518('0x2'));var BPromise=require(_0x6518('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6518('0x4'));var db=require(_0x6518('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6518('0x6'));var config=require('../../config/environment');var jayson=require(_0x6518('0x7'));var client=jayson[_0x6518('0x8')][_0x6518('0x9')]({'port':0x232a});config['redis']=_[_0x6518('0xa')](config['redis'],{'host':_0x6518('0xb'),'port':0x18eb});var socket=require(_0x6518('0xc'))(new Redis(config[_0x6518('0xd')]));require(_0x6518('0xe'))['register'](socket);function respondWithRpcPromise(_0x3414ff,_0x3b2e34,_0x2ba042){return new BPromise(function(_0x3e42dd,_0x3ea3d7){return client[_0x6518('0xf')](_0x3414ff,_0x2ba042)[_0x6518('0x10')](function(_0xaa4c87){logger[_0x6518('0x11')](_0x6518('0x12'),_0x3b2e34,_0x6518('0x13'));logger['debug'](_0x6518('0x14'),_0x3b2e34,_0x6518('0x13'),JSON[_0x6518('0x15')](_0xaa4c87));if(_0xaa4c87['error']){if(_0xaa4c87['error'][_0x6518('0x16')]===0x1f4){logger[_0x6518('0x17')]('MailInteraction,\x20%s,\x20%s',_0x3b2e34,_0xaa4c87[_0x6518('0x17')][_0x6518('0x18')]);return _0x3ea3d7(_0xaa4c87['error'][_0x6518('0x18')]);}logger[_0x6518('0x17')](_0x6518('0x12'),_0x3b2e34,_0xaa4c87['error']['message']);return _0x3e42dd(_0xaa4c87[_0x6518('0x17')][_0x6518('0x18')]);}else{logger[_0x6518('0x11')](_0x6518('0x12'),_0x3b2e34,_0x6518('0x13'));_0x3e42dd(_0xaa4c87['result'][_0x6518('0x18')]);}})[_0x6518('0x19')](function(_0x53f49a){logger[_0x6518('0x17')](_0x6518('0x12'),_0x3b2e34,_0x53f49a);_0x3ea3d7(_0x53f49a);});});}exports[_0x6518('0x1a')]=function(_0x29302e){var _0x486a0f=this;return new Promise(function(_0x2fa8a9,_0x5785ff){return db[_0x6518('0x1b')][_0x6518('0x1c')](_0x29302e[_0x6518('0x1d')],{'raw':_0x29302e['options']?_0x29302e[_0x6518('0x1e')][_0x6518('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29302e[_0x6518('0x1e')]?_0x29302e[_0x6518('0x1e')][_0x6518('0x20')]||null:null,'attributes':_0x29302e[_0x6518('0x1e')]?_0x29302e[_0x6518('0x1e')][_0x6518('0x21')]||null:null,'limit':_0x29302e['options']?_0x29302e[_0x6518('0x1e')][_0x6518('0x22')]||null:null})[_0x6518('0x10')](function(_0x466c05){logger[_0x6518('0x11')](_0x6518('0x1a'),_0x29302e);logger['debug']('UpdateMailInteraction',_0x29302e,JSON[_0x6518('0x15')](_0x466c05));_0x2fa8a9(_0x466c05);})['catch'](function(_0x463f49){logger[_0x6518('0x17')](_0x6518('0x1a'),_0x463f49[_0x6518('0x18')],_0x29302e);_0x5785ff(_0x486a0f[_0x6518('0x17')](0x1f4,_0x463f49['message']));});});};exports[_0x6518('0x23')]=function(_0x3b0553){return new Promise(function(_0x4f231e,_0x37d183){return db[_0x6518('0x1b')][_0x6518('0x24')]({'where':_0x3b0553[_0x6518('0x1e')]?_0x3b0553[_0x6518('0x1e')][_0x6518('0x20')]||null:null})[_0x6518('0x10')](function(_0x38eba9){if(_0x38eba9){return _0x38eba9[_0x6518('0x25')](_0x3b0553['body'][_0x6518('0x26')],_[_0x6518('0x27')](_0x3b0553[_0x6518('0x1d')],[_0x6518('0x26'),'id'])||{});}})['spread'](function(_0x314957){logger[_0x6518('0x11')](_0x6518('0x28'),_0x3b0553);logger[_0x6518('0x29')](_0x6518('0x28'),_0x3b0553,JSON[_0x6518('0x15')](_0x314957));_0x4f231e(_0x314957);})[_0x6518('0x19')](function(_0x5d3dc9){logger[_0x6518('0x17')](_0x6518('0x28'),_0x5d3dc9['message'],_0x3b0553);_0x37d183(_this[_0x6518('0x17')](0x1f4,_0x5d3dc9[_0x6518('0x18')]));});});}; \ No newline at end of file +var _0x3c21=['result','catch','UpdateMailInteraction','MailInteraction','update','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','addTags','body','omit','ids','spread','AddTags','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5cbdeb,_0x54a8fd){var _0x5bbbb1=function(_0x5a099d){while(--_0x5a099d){_0x5cbdeb['push'](_0x5cbdeb['shift']());}};_0x5bbbb1(++_0x54a8fd);}(_0x3c21,0x19e));var _0x13c2=function(_0x2a23e6,_0x1781f3){_0x2a23e6=_0x2a23e6-0x0;var _0x13abb2=_0x3c21[_0x2a23e6];return _0x13abb2;};'use strict';var _=require('lodash');var util=require(_0x13c2('0x0'));var moment=require('moment');var BPromise=require(_0x13c2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c2('0x2'));var db=require(_0x13c2('0x3'))['db'];var utils=require(_0x13c2('0x4'));var logger=require(_0x13c2('0x5'))('rpc');var config=require(_0x13c2('0x6'));var jayson=require(_0x13c2('0x7'));var client=jayson[_0x13c2('0x8')][_0x13c2('0x9')]({'port':0x232a});config[_0x13c2('0xa')]=_[_0x13c2('0xb')](config[_0x13c2('0xa')],{'host':_0x13c2('0xc'),'port':0x18eb});var socket=require(_0x13c2('0xd'))(new Redis(config[_0x13c2('0xa')]));require(_0x13c2('0xe'))[_0x13c2('0xf')](socket);function respondWithRpcPromise(_0x2798fd,_0x56d82b,_0x5de0f9){return new BPromise(function(_0x48969a,_0x520710){return client[_0x13c2('0x10')](_0x2798fd,_0x5de0f9)['then'](function(_0x3b7e96){logger[_0x13c2('0x11')](_0x13c2('0x12'),_0x56d82b,_0x13c2('0x13'));logger[_0x13c2('0x14')](_0x13c2('0x15'),_0x56d82b,_0x13c2('0x13'),JSON[_0x13c2('0x16')](_0x3b7e96));if(_0x3b7e96[_0x13c2('0x17')]){if(_0x3b7e96[_0x13c2('0x17')][_0x13c2('0x18')]===0x1f4){logger['error'](_0x13c2('0x12'),_0x56d82b,_0x3b7e96['error'][_0x13c2('0x19')]);return _0x520710(_0x3b7e96[_0x13c2('0x17')]['message']);}logger[_0x13c2('0x17')](_0x13c2('0x12'),_0x56d82b,_0x3b7e96['error'][_0x13c2('0x19')]);return _0x48969a(_0x3b7e96['error'][_0x13c2('0x19')]);}else{logger[_0x13c2('0x11')](_0x13c2('0x12'),_0x56d82b,_0x13c2('0x13'));_0x48969a(_0x3b7e96[_0x13c2('0x1a')][_0x13c2('0x19')]);}})[_0x13c2('0x1b')](function(_0x26a756){logger[_0x13c2('0x17')]('MailInteraction,\x20%s,\x20%s',_0x56d82b,_0x26a756);_0x520710(_0x26a756);});});}exports[_0x13c2('0x1c')]=function(_0x31ed09){var _0x53baff=this;return new Promise(function(_0x2bef69,_0x5aa153){return db[_0x13c2('0x1d')][_0x13c2('0x1e')](_0x31ed09['body'],{'raw':_0x31ed09[_0x13c2('0x1f')]?_0x31ed09[_0x13c2('0x1f')][_0x13c2('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31ed09['options']?_0x31ed09[_0x13c2('0x1f')][_0x13c2('0x21')]||null:null,'attributes':_0x31ed09[_0x13c2('0x1f')]?_0x31ed09[_0x13c2('0x1f')][_0x13c2('0x22')]||null:null,'limit':_0x31ed09['options']?_0x31ed09['options'][_0x13c2('0x23')]||null:null})['then'](function(_0x4294f2){logger[_0x13c2('0x11')]('UpdateMailInteraction',_0x31ed09);logger[_0x13c2('0x14')](_0x13c2('0x1c'),_0x31ed09,JSON[_0x13c2('0x16')](_0x4294f2));_0x2bef69(_0x4294f2);})[_0x13c2('0x1b')](function(_0x2ac497){logger[_0x13c2('0x17')](_0x13c2('0x1c'),_0x2ac497[_0x13c2('0x19')],_0x31ed09);_0x5aa153(_0x53baff[_0x13c2('0x17')](0x1f4,_0x2ac497[_0x13c2('0x19')]));});});};exports[_0x13c2('0x24')]=function(_0x1ac1d6){return new Promise(function(_0x35b788,_0x432d82){return db[_0x13c2('0x1d')][_0x13c2('0x25')]({'where':_0x1ac1d6['options']?_0x1ac1d6[_0x13c2('0x1f')][_0x13c2('0x21')]||null:null})['then'](function(_0xbe8d97){if(_0xbe8d97){return _0xbe8d97[_0x13c2('0x26')](_0x1ac1d6[_0x13c2('0x27')]['ids'],_[_0x13c2('0x28')](_0x1ac1d6['body'],[_0x13c2('0x29'),'id'])||{});}})[_0x13c2('0x2a')](function(_0x58279d){logger[_0x13c2('0x11')](_0x13c2('0x2b'),_0x1ac1d6);logger[_0x13c2('0x14')](_0x13c2('0x2b'),_0x1ac1d6,JSON['stringify'](_0x58279d));_0x35b788(_0x58279d);})[_0x13c2('0x1b')](function(_0x31685c){logger[_0x13c2('0x17')](_0x13c2('0x2b'),_0x31685c[_0x13c2('0x19')],_0x1ac1d6);_0x432d82(_this[_0x13c2('0x17')](0x1f4,_0x31685c[_0x13c2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 2751c05..3394c6f 100644 --- a/server/api/mailInteraction/mailInteraction.socket.js +++ b/server/api/mailInteraction/mailInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3238=['emit','removeListener','mailInteraction:','./mailInteraction.events','save','update'];(function(_0x985f24,_0x467140){var _0x75236e=function(_0x212320){while(--_0x212320){_0x985f24['push'](_0x985f24['shift']());}};_0x75236e(++_0x467140);}(_0x3238,0x81));var _0x8323=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3238[_0x321bb2];return _0x9c12ed;};'use strict';var MailInteractionEvents=require(_0x8323('0x0'));var events=[_0x8323('0x1'),'remove',_0x8323('0x2')];function createListener(_0x2b3766,_0x14f1c6){return function(_0x69ca19){_0x14f1c6[_0x8323('0x3')](_0x2b3766,_0x69ca19);};}function removeListener(_0x164551,_0x4d0416){return function(){MailInteractionEvents[_0x8323('0x4')](_0x164551,_0x4d0416);};}exports['register']=function(_0x425d73){for(var _0xc463d8=0x0,_0x690e38=events['length'];_0xc463d8<_0x690e38;_0xc463d8++){var _0x566d35=events[_0xc463d8];var _0x2f817b=createListener(_0x8323('0x5')+_0x566d35,_0x425d73);MailInteractionEvents['on'](_0x566d35,_0x2f817b);}}; \ No newline at end of file +var _0x4a96=['removeListener','register','length','mailInteraction:','./mailInteraction.events','remove','emit'];(function(_0x99e2f0,_0x509fbd){var _0x1ca7c1=function(_0x1a5fb9){while(--_0x1a5fb9){_0x99e2f0['push'](_0x99e2f0['shift']());}};_0x1ca7c1(++_0x509fbd);}(_0x4a96,0x10e));var _0x64a9=function(_0x5089bb,_0x314042){_0x5089bb=_0x5089bb-0x0;var _0x2b519e=_0x4a96[_0x5089bb];return _0x2b519e;};'use strict';var MailInteractionEvents=require(_0x64a9('0x0'));var events=['save',_0x64a9('0x1'),'update'];function createListener(_0xf18a4b,_0x1849bd){return function(_0x490f85){_0x1849bd[_0x64a9('0x2')](_0xf18a4b,_0x490f85);};}function removeListener(_0x5358d3,_0x40b7f0){return function(){MailInteractionEvents[_0x64a9('0x3')](_0x5358d3,_0x40b7f0);};}exports[_0x64a9('0x4')]=function(_0x11a273){for(var _0x1e38f5=0x0,_0x37e2bf=events[_0x64a9('0x5')];_0x1e38f5<_0x37e2bf;_0x1e38f5++){var _0x44b995=events[_0x1e38f5];var _0x425eb6=createListener(_0x64a9('0x6')+_0x44b995,_0x11a273);MailInteractionEvents['on'](_0x44b995,_0x425eb6);}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/index.js b/server/api/mailInteractionHasTag/index.js index 0882158..c482a25 100644 --- a/server/api/mailInteractionHasTag/index.js +++ b/server/api/mailInteractionHasTag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb145=['isAuthenticated','describe','exports','Router','../../components/auth/service','./mailInteractionHasTag.controller','get','/describe'];(function(_0xafff94,_0x4f2efc){var _0xe841dc=function(_0xc00050){while(--_0xc00050){_0xafff94['push'](_0xafff94['shift']());}};_0xe841dc(++_0x4f2efc);}(_0xb145,0xa3));var _0x5b14=function(_0x5a5f1f,_0x31326c){_0x5a5f1f=_0x5a5f1f-0x0;var _0x5ad1e3=_0xb145[_0x5a5f1f];return _0x5ad1e3;};'use strict';var express=require('express');var router=express[_0x5b14('0x0')]();var auth=require(_0x5b14('0x1'));var controller=require(_0x5b14('0x2'));router[_0x5b14('0x3')](_0x5b14('0x4'),auth[_0x5b14('0x5')](),controller[_0x5b14('0x6')]);module[_0x5b14('0x7')]=router; \ No newline at end of file +var _0x0f36=['/describe','isAuthenticated','describe','exports','express','Router','../../components/auth/service','./mailInteractionHasTag.controller','get'];(function(_0x5017c0,_0x1a6afd){var _0x58962d=function(_0x328195){while(--_0x328195){_0x5017c0['push'](_0x5017c0['shift']());}};_0x58962d(++_0x1a6afd);}(_0x0f36,0x8b));var _0x60f3=function(_0x461c9e,_0x9a67cd){_0x461c9e=_0x461c9e-0x0;var _0x144e35=_0x0f36[_0x461c9e];return _0x144e35;};'use strict';var express=require(_0x60f3('0x0'));var router=express[_0x60f3('0x1')]();var auth=require(_0x60f3('0x2'));var controller=require(_0x60f3('0x3'));router[_0x60f3('0x4')](_0x60f3('0x5'),auth[_0x60f3('0x6')](),controller[_0x60f3('0x7')]);module[_0x60f3('0x8')]=router; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js index ba25f27..f3877be 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x266027,_0x2c6226){var _0x5cedda=function(_0x4c1686){while(--_0x4c1686){_0x266027['push'](_0x266027['shift']());}};_0x5cedda(++_0x2c6226);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file +var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x1ddf0f,_0x133ead){var _0xd388ae=function(_0x17b4d7){while(--_0x17b4d7){_0x1ddf0f['push'](_0x1ddf0f['shift']());}};_0xd388ae(++_0x133ead);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.js index 9f6ccff..12590de 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x99b7=['sequelize','exports','INTEGER'];(function(_0x52b2ad,_0x252541){var _0x5d0a09=function(_0x5f508b){while(--_0x5f508b){_0x52b2ad['push'](_0x52b2ad['shift']());}};_0x5d0a09(++_0x252541);}(_0x99b7,0x180));var _0x799b=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0x99b7[_0xf73c09];return _0xa8923c;};'use strict';var Sequelize=require(_0x799b('0x0'));module[_0x799b('0x1')]={'MailInteractionId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'TagId':{'type':Sequelize[_0x799b('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0x453c=['sequelize','exports','INTEGER'];(function(_0x9a3bf5,_0x3d28fa){var _0x3f5959=function(_0x2a05b9){while(--_0x2a05b9){_0x9a3bf5['push'](_0x9a3bf5['shift']());}};_0x3f5959(++_0x3d28fa);}(_0x453c,0x10b));var _0xc453=function(_0x5d07ff,_0x1f976f){_0x5d07ff=_0x5d07ff-0x0;var _0x5226ad=_0x453c[_0x5d07ff];return _0x5226ad;};'use strict';var Sequelize=require(_0xc453('0x0'));module[_0xc453('0x1')]={'MailInteractionId':{'type':Sequelize[_0xc453('0x2')],'primaryKey':!![]},'TagId':{'type':Sequelize[_0xc453('0x2')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js index cdd3c0f..0d1fcb7 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x846f=['MailInteractionHasTag','mail_interaction_has_tags','./mailInteractionHasTag'];(function(_0x48e954,_0x4546e8){var _0x124016=function(_0x61a956){while(--_0x61a956){_0x48e954['push'](_0x48e954['shift']());}};_0x124016(++_0x4546e8);}(_0x846f,0xc8));var _0xf846=function(_0x4c76c6,_0x235057){_0x4c76c6=_0x4c76c6-0x0;var _0x32e7f3=_0x846f[_0x4c76c6];return _0x32e7f3;};'use strict';var attributes=require(_0xf846('0x0'));module['exports']=function(_0x17b60d){return _0x17b60d['define'](_0xf846('0x1'),attributes,{'tableName':_0xf846('0x2'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd39=['define','mail_interaction_has_tags','exports'];(function(_0x5d25de,_0x417686){var _0x3e7a19=function(_0x2e73b2){while(--_0x2e73b2){_0x5d25de['push'](_0x5d25de['shift']());}};_0x3e7a19(++_0x417686);}(_0xbd39,0xf5));var _0x9bd3=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xbd39[_0x1d1779];return _0x2377e9;};'use strict';var attributes=require('./mailInteractionHasTag');module[_0x9bd3('0x0')]=function(_0x3a050c){return _0x3a050c[_0x9bd3('0x1')]('MailInteractionHasTag',attributes,{'tableName':_0x9bd3('0x2'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 42f377b..7893b68 100644 --- a/server/api/mailMessage/index.js +++ b/server/api/mailMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d90=['path','express','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','get','index','/describe','describe','isAuthenticated','show','download','post','tracked','mail','mailmessage:create','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer'];(function(_0x5bc57b,_0x7698b4){var _0x56333f=function(_0x336303){while(--_0x336303){_0x5bc57b['push'](_0x5bc57b['shift']());}};_0x56333f(++_0x7698b4);}(_0x1d90,0x13e));var _0x01d9=function(_0x54fbcb,_0x21a10f){_0x54fbcb=_0x54fbcb-0x0;var _0x58e047=_0x1d90[_0x54fbcb];return _0x58e047;};'use strict';var multer=require(_0x01d9('0x0'));var util=require('util');var path=require(_0x01d9('0x1'));var timeout=require('connect-timeout');var express=require(_0x01d9('0x2'));var router=express['Router']();var fs_extra=require(_0x01d9('0x3'));var auth=require(_0x01d9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x01d9('0x5'));var controller=require(_0x01d9('0x6'));router[_0x01d9('0x7')]('/',auth['isAuthenticated'](),controller[_0x01d9('0x8')]);router[_0x01d9('0x7')](_0x01d9('0x9'),auth['isAuthenticated'](),controller[_0x01d9('0xa')]);router['get']('/:id',auth[_0x01d9('0xb')](),controller[_0x01d9('0xc')]);router[_0x01d9('0x7')]('/:id/download',auth[_0x01d9('0xb')](),controller[_0x01d9('0xd')]);router[_0x01d9('0xe')]('/',auth['isAuthenticated'](),interaction[_0x01d9('0xf')](_0x01d9('0x10'),_0x01d9('0x11')),controller[_0x01d9('0x12')]);router[_0x01d9('0x13')](_0x01d9('0x14'),auth[_0x01d9('0xb')](),controller[_0x01d9('0x15')]);router[_0x01d9('0x13')](_0x01d9('0x16'),auth[_0x01d9('0xb')](),controller[_0x01d9('0x17')]);router['put'](_0x01d9('0x18'),auth[_0x01d9('0xb')](),controller[_0x01d9('0x19')]);router[_0x01d9('0x1a')]('/:id',auth[_0x01d9('0xb')](),controller[_0x01d9('0x1b')]);module[_0x01d9('0x1c')]=router; \ No newline at end of file +var _0x5df3=['/:id/download','download','tracked','mail','mailmessage:create','create','update','put','/:id/accept','accept','reject','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x221a0f,_0x3970f6){var _0x30309e=function(_0x2a6cf4){while(--_0x2a6cf4){_0x221a0f['push'](_0x221a0f['shift']());}};_0x30309e(++_0x3970f6);}(_0x5df3,0x15f));var _0x35df=function(_0x2215d2,_0x563782){_0x2215d2=_0x2215d2-0x0;var _0x2bb13a=_0x5df3[_0x2215d2];return _0x2bb13a;};'use strict';var multer=require(_0x35df('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x35df('0x1'));var express=require(_0x35df('0x2'));var router=express[_0x35df('0x3')]();var fs_extra=require(_0x35df('0x4'));var auth=require(_0x35df('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x35df('0x6'));router[_0x35df('0x7')]('/',auth[_0x35df('0x8')](),controller['index']);router[_0x35df('0x7')](_0x35df('0x9'),auth[_0x35df('0x8')](),controller[_0x35df('0xa')]);router[_0x35df('0x7')](_0x35df('0xb'),auth[_0x35df('0x8')](),controller[_0x35df('0xc')]);router[_0x35df('0x7')](_0x35df('0xd'),auth[_0x35df('0x8')](),controller[_0x35df('0xe')]);router['post']('/',auth[_0x35df('0x8')](),interaction[_0x35df('0xf')](_0x35df('0x10'),_0x35df('0x11')),controller[_0x35df('0x12')]);router['put'](_0x35df('0xb'),auth[_0x35df('0x8')](),controller[_0x35df('0x13')]);router[_0x35df('0x14')](_0x35df('0x15'),auth[_0x35df('0x8')](),controller[_0x35df('0x16')]);router[_0x35df('0x14')]('/:id/reject',auth[_0x35df('0x8')](),controller[_0x35df('0x17')]);router[_0x35df('0x18')](_0x35df('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x35df('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index b5e4979..5aec468 100644 --- a/server/api/mailMessage/mailMessage.attributes.js +++ b/server/api/mailMessage/mailMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32e0=['Chat','sequelize','exports','TEXT','long','ENUM','out','STRING','DATE','INTEGER','BOOLEAN','Email'];(function(_0x27bfed,_0x270908){var _0x4add5a=function(_0x452fb3){while(--_0x452fb3){_0x27bfed['push'](_0x27bfed['shift']());}};_0x4add5a(++_0x270908);}(_0x32e0,0x15d));var _0x032e=function(_0x2459fd,_0x575d9b){_0x2459fd=_0x2459fd-0x0;var _0x364cd2=_0x32e0[_0x2459fd];return _0x364cd2;};'use strict';var Sequelize=require(_0x032e('0x0'));var _=require('lodash');module[_0x032e('0x1')]={'body':{'type':Sequelize[_0x032e('0x2')](_0x032e('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x032e('0x4')]('in',_0x032e('0x5')),'defaultValue':_0x032e('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x032e('0x6')](0x1fe)},'from':{'type':Sequelize[_0x032e('0x6')]},'to':{'type':Sequelize[_0x032e('0x2')](_0x032e('0x3'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0x032e('0x2')]('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x032e('0x7')]},'attach':{'type':Sequelize[_0x032e('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x032e('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x032e('0x2')](_0x032e('0x3'))},'originCc':{'type':Sequelize[_0x032e('0x2')]('long')},'originChannel':{'type':Sequelize[_0x032e('0x4')](_0x032e('0xa'),_0x032e('0xb')),'defaultValue':_0x032e('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x972d=['out','STRING','long','DATE','Chat','lodash','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x3c715a,_0x632b85){var _0x5737a3=function(_0x24496c){while(--_0x24496c){_0x3c715a['push'](_0x3c715a['shift']());}};_0x5737a3(++_0x632b85);}(_0x972d,0x1a7));var _0xd972=function(_0x2041a7,_0x5a8d5c){_0x2041a7=_0x2041a7-0x0;var _0x141669=_0x972d[_0x2041a7];return _0x141669;};'use strict';var Sequelize=require('sequelize');var _=require(_0xd972('0x0'));module[_0xd972('0x1')]={'body':{'type':Sequelize[_0xd972('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xd972('0x2')](_0xd972('0x3'))},'read':{'type':Sequelize[_0xd972('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd972('0x5')]('in',_0xd972('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xd972('0x7')](0x1fe)},'from':{'type':Sequelize[_0xd972('0x7')]},'to':{'type':Sequelize['TEXT'](_0xd972('0x8'))},'cc':{'type':Sequelize[_0xd972('0x2')](_0xd972('0x8'))},'bcc':{'type':Sequelize[_0xd972('0x2')](_0xd972('0x8'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xd972('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xd972('0x9')]},'originTo':{'type':Sequelize[_0xd972('0x2')]('long')},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0xd972('0x5')]('Email',_0xd972('0xa')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 244ca7f..8d18056 100644 --- a/server/api/mailMessage/mailMessage.controller.js +++ b/server/api/mailMessage/mailMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x715d=['then','includeAll','rows','show','params','intersection','include','update','body','find','describe','create','out','secret','MailAccount','findOne','CmList','List','CmContact','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','Contacts','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','event','rejectmessage','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','readFileSync','build','writeFileSync','download','unlinkSync','eml-format','moment','path','lodash','ioredis','html-to-text','api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','client','http','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','offset','undefined','limit','count','Content-Range','json','destroy','end','sendStatus','stack','name','send','map','MailMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x2bae8b,_0x58af3f){var _0x1db3bc=function(_0x4c1c5f){while(--_0x4c1c5f){_0x2bae8b['push'](_0x2bae8b['shift']());}};_0x1db3bc(++_0x58af3f);}(_0x715d,0xff));var _0xd715=function(_0xedf2de,_0xdc5858){_0xedf2de=_0xedf2de-0x0;var _0x5674a5=_0x715d[_0xedf2de];return _0x5674a5;};'use strict';var emlformat=require(_0xd715('0x0'));var moment=require(_0xd715('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xd715('0x2'));var fs=require('fs');var _=require(_0xd715('0x3'));var Redis=require(_0xd715('0x4'));var htmlToText=require(_0xd715('0x5'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xd715('0x6'));var interaction_log=require(_0xd715('0x7'))(_0xd715('0x8'));var config=require(_0xd715('0x9'));var db=require(_0xd715('0xa'))['db'];config['redis']=_[_0xd715('0xb')](config[_0xd715('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd715('0xd'))(new Redis(config[_0xd715('0xc')]));var htmlEntities=require(_0xd715('0xe'));require(_0xd715('0xf'))['register'](socket);var jayson=require(_0xd715('0x10'));var client=jayson[_0xd715('0x11')][_0xd715('0x12')]({'port':0x232c});var client9003=jayson[_0xd715('0x11')][_0xd715('0x12')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3387b8,_0x532544,_0x5df406,_0x397ab7){return new BPromise(function(_0x4caee2,_0x46a934){var _0x2e5c02=_0x397ab7||client;return _0x2e5c02['request'](_0x3387b8,_0x5df406)['then'](function(_0x214868){logger[_0xd715('0x13')](_0xd715('0x14'),_0x532544,_0xd715('0x15'));logger['debug'](_0xd715('0x16'),_0x532544,_0xd715('0x15'),JSON['stringify'](_0x214868));if(_0x214868[_0xd715('0x17')]){if(_0x214868[_0xd715('0x17')][_0xd715('0x18')]===0x1f4){logger['error'](_0xd715('0x14'),_0x532544,_0x214868['error'][_0xd715('0x19')]);return _0x46a934(_0x214868[_0xd715('0x17')][_0xd715('0x19')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x532544,_0x214868[_0xd715('0x17')][_0xd715('0x19')]);return _0x4caee2(_0x214868[_0xd715('0x17')][_0xd715('0x19')]);}else{logger[_0xd715('0x13')]('MailMessage,\x20%s,\x20%s',_0x532544,_0xd715('0x15'));_0x4caee2(_0x214868[_0xd715('0x1a')][_0xd715('0x19')]);}})[_0xd715('0x1b')](function(_0x13d123){logger[_0xd715('0x17')](_0xd715('0x14'),_0x532544,_0x13d123);_0x46a934(_0x13d123);});});}function respondWithResult(_0x5787d4,_0x28fbef){_0x28fbef=_0x28fbef||0xc8;return function(_0x56030c){if(_0x56030c){return _0x5787d4[_0xd715('0x1c')](_0x28fbef)['json'](_0x56030c);}};}function respondWithFilteredResult(_0x226e46,_0x5750c5){return function(_0x278503){if(_0x278503){var _0x241073=typeof _0x5750c5[_0xd715('0x1d')]===_0xd715('0x1e')&&typeof _0x5750c5[_0xd715('0x1f')]===_0xd715('0x1e');var _0x3160ef=_0x278503[_0xd715('0x20')];var _0x36c2e0=_0x241073?0x0:_0x5750c5[_0xd715('0x1d')];var _0x1b15bb=_0x241073?_0x278503[_0xd715('0x20')]:_0x5750c5[_0xd715('0x1d')]+_0x5750c5[_0xd715('0x1f')];var _0x3c5dea;if(_0x1b15bb>=_0x3160ef){_0x1b15bb=_0x3160ef;_0x3c5dea=0xc8;}else{_0x3c5dea=0xce;}_0x226e46['status'](_0x3c5dea);return _0x226e46['set'](_0xd715('0x21'),_0x36c2e0+'-'+_0x1b15bb+'/'+_0x3160ef)[_0xd715('0x22')](_0x278503);}return null;};}function saveUpdates(_0x26d8e2){return function(_0x1b4c86){if(_0x1b4c86){return _0x1b4c86['update'](_0x26d8e2)['then'](function(_0x1f1d1c){return _0x1f1d1c;});}return null;};}function removeEntity(_0x338a47){return function(_0x1ef810){if(_0x1ef810){return _0x1ef810[_0xd715('0x23')]()['then'](function(){_0x338a47[_0xd715('0x1c')](0xcc)[_0xd715('0x24')]();});}};}function handleEntityNotFound(_0x4d2b5f){return function(_0x384d33){if(!_0x384d33){_0x4d2b5f[_0xd715('0x25')](0x194);}return _0x384d33;};}function handleError(_0x146585,_0x566265){_0x566265=_0x566265||0x1f4;return function(_0x79f6cc){logger[_0xd715('0x17')](_0x79f6cc[_0xd715('0x26')]);if(_0x79f6cc[_0xd715('0x27')]){delete _0x79f6cc[_0xd715('0x27')];}_0x146585[_0xd715('0x1c')](_0x566265)[_0xd715('0x28')](_0x79f6cc);};}exports['index']=function(_0x6fcf96,_0x59618e){var _0x5a00c5={},_0xcbfde6={},_0x2e0d07={'count':0x0,'rows':[]};var _0x48727a=_[_0xd715('0x29')](db[_0xd715('0x2a')][_0xd715('0x2b')],function(_0x1498d3){return{'name':_0x1498d3[_0xd715('0x2c')],'type':_0x1498d3[_0xd715('0x2d')][_0xd715('0x2e')]};});_0xcbfde6[_0xd715('0x2f')]=_[_0xd715('0x29')](_0x48727a,_0xd715('0x27'));_0xcbfde6['query']=_[_0xd715('0x30')](_0x6fcf96[_0xd715('0x31')]);_0xcbfde6[_0xd715('0x32')]=_['intersection'](_0xcbfde6[_0xd715('0x2f')],_0xcbfde6[_0xd715('0x31')]);_0x5a00c5[_0xd715('0x33')]=_['intersection'](_0xcbfde6[_0xd715('0x2f')],qs[_0xd715('0x34')](_0x6fcf96[_0xd715('0x31')][_0xd715('0x34')]));_0x5a00c5[_0xd715('0x33')]=_0x5a00c5[_0xd715('0x33')][_0xd715('0x35')]?_0x5a00c5[_0xd715('0x33')]:_0xcbfde6[_0xd715('0x2f')];if(!_0x6fcf96['query'][_0xd715('0x36')]('nolimit')){_0x5a00c5[_0xd715('0x1f')]=qs['limit'](_0x6fcf96['query'][_0xd715('0x1f')]);_0x5a00c5['offset']=qs[_0xd715('0x1d')](_0x6fcf96[_0xd715('0x31')][_0xd715('0x1d')]);}_0x5a00c5[_0xd715('0x37')]=qs[_0xd715('0x38')](_0x6fcf96[_0xd715('0x31')]['sort']);_0x5a00c5[_0xd715('0x39')]=qs[_0xd715('0x32')](_[_0xd715('0x3a')](_0x6fcf96['query'],_0xcbfde6[_0xd715('0x32')]),_0x48727a);if(_0x6fcf96[_0xd715('0x31')][_0xd715('0x3b')]){_0x5a00c5['where']=_['merge'](_0x5a00c5['where'],{'$or':_[_0xd715('0x29')](_0x48727a,function(_0x34bb8b){if(_0x34bb8b[_0xd715('0x2d')]!=='VIRTUAL'){var _0x3b977d={};_0x3b977d[_0x34bb8b['name']]={'$like':'%'+_0x6fcf96[_0xd715('0x31')]['filter']+'%'};return _0x3b977d;}})});}_0x5a00c5=_[_0xd715('0x3c')]({},_0x5a00c5,_0x6fcf96['options']);var _0x29cf04={'where':_0x5a00c5[_0xd715('0x39')]};return db[_0xd715('0x2a')][_0xd715('0x20')](_0x29cf04)[_0xd715('0x3d')](function(_0x4c0608){_0x2e0d07[_0xd715('0x20')]=_0x4c0608;if(_0x6fcf96[_0xd715('0x31')][_0xd715('0x3e')]){_0x5a00c5['include']=[{'all':!![]}];}return db[_0xd715('0x2a')]['findAll'](_0x5a00c5);})[_0xd715('0x3d')](function(_0x5f40ec){_0x2e0d07[_0xd715('0x3f')]=_0x5f40ec;return _0x2e0d07;})[_0xd715('0x3d')](respondWithFilteredResult(_0x59618e,_0x5a00c5))[_0xd715('0x1b')](handleError(_0x59618e,null));};exports[_0xd715('0x40')]=function(_0x137ec3,_0x54b466){var _0x34cfbe={'raw':!![],'where':{'id':_0x137ec3[_0xd715('0x41')]['id']}},_0x4fab58={};_0x4fab58[_0xd715('0x2f')]=_[_0xd715('0x30')](db[_0xd715('0x2a')]['rawAttributes']);_0x4fab58[_0xd715('0x31')]=_[_0xd715('0x30')](_0x137ec3[_0xd715('0x31')]);_0x4fab58['filters']=_['intersection'](_0x4fab58['model'],_0x4fab58[_0xd715('0x31')]);_0x34cfbe[_0xd715('0x33')]=_[_0xd715('0x42')](_0x4fab58[_0xd715('0x2f')],qs[_0xd715('0x34')](_0x137ec3[_0xd715('0x31')]['fields']));_0x34cfbe[_0xd715('0x33')]=_0x34cfbe[_0xd715('0x33')]['length']?_0x34cfbe[_0xd715('0x33')]:_0x4fab58[_0xd715('0x2f')];if(_0x137ec3[_0xd715('0x31')][_0xd715('0x3e')]){_0x34cfbe[_0xd715('0x43')]=[{'all':!![]}];}_0x34cfbe=_[_0xd715('0x3c')]({},_0x34cfbe,_0x137ec3['options']);return db[_0xd715('0x2a')]['find'](_0x34cfbe)[_0xd715('0x3d')](handleEntityNotFound(_0x54b466,null))[_0xd715('0x3d')](respondWithResult(_0x54b466,null))[_0xd715('0x1b')](handleError(_0x54b466,null));};exports[_0xd715('0x44')]=function(_0x347b4e,_0x421e07){if(_0x347b4e[_0xd715('0x45')]['id']){delete _0x347b4e[_0xd715('0x45')]['id'];}return db['MailMessage'][_0xd715('0x46')]({'where':{'id':_0x347b4e[_0xd715('0x41')]['id']}})[_0xd715('0x3d')](handleEntityNotFound(_0x421e07,null))['then'](saveUpdates(_0x347b4e[_0xd715('0x45')],null))[_0xd715('0x3d')](respondWithResult(_0x421e07,null))[_0xd715('0x1b')](handleError(_0x421e07,null));};exports['destroy']=function(_0x1d7e22,_0x51fcf0){return db[_0xd715('0x2a')][_0xd715('0x46')]({'where':{'id':_0x1d7e22[_0xd715('0x41')]['id']}})[_0xd715('0x3d')](handleEntityNotFound(_0x51fcf0,null))[_0xd715('0x3d')](removeEntity(_0x51fcf0,null))['catch'](handleError(_0x51fcf0,null));};exports[_0xd715('0x47')]=function(_0x5f0114,_0x48e879){return db[_0xd715('0x2a')][_0xd715('0x47')]()[_0xd715('0x3d')](respondWithResult(_0x48e879,null))[_0xd715('0x1b')](handleError(_0x48e879,null));};exports[_0xd715('0x48')]=function(_0x20b804,_0x52fe30){return db[_0xd715('0x2a')][_0xd715('0x48')](_0x20b804[_0xd715('0x45')])[_0xd715('0x3d')](function(_0x55efdc){if(_0x55efdc){if(_0x55efdc['direction']===_0xd715('0x49')&&!_0x55efdc[_0xd715('0x4a')]){var _0x178a37,_0x299582,_0x579322;if(_0x20b804[_0xd715('0x45')]['to']){_0x299582=_0x20b804[_0xd715('0x45')]['to']['split'](',')[0x0];}return db[_0xd715('0x4b')][_0xd715('0x4c')]({'where':{'id':_0x55efdc['MailAccountId']},'include':[{'model':db[_0xd715('0x4d')],'as':_0xd715('0x4e'),'include':[{'model':db[_0xd715('0x4f')],'as':'Contacts','where':{'email':_0x299582},'limit':0x1,'order':[['updatedAt',_0xd715('0x50')]]}]},{'model':db[_0xd715('0x51')],'as':_0xd715('0x52'),'raw':!![],'include':[{'model':db[_0xd715('0x53')],'as':'CloudProvider','raw':!![]}]}]})['then'](function(_0x450667){_0x178a37=_0x450667;if(!_0x178a37||!_0x178a37[_0xd715('0x52')])return;var _0x297387=_0x178a37[_0xd715('0x54')]();if(_0x20b804['body'][_0xd715('0x55')]&&_0x20b804[_0xd715('0x45')]['attachments']['length']){for(var _0x48b343=0x0;_0x48b343<_0x20b804['body'][_0xd715('0x55')][_0xd715('0x35')];_0x48b343+=0x1){_0x20b804['body'][_0xd715('0x55')][_0x48b343]={'filename':_0x20b804[_0xd715('0x45')]['attachments'][_0x48b343]['name'],'path':path[_0xd715('0x56')](config[_0xd715('0x57')],_0xd715('0x58'),_0x20b804[_0xd715('0x45')][_0xd715('0x55')][_0x48b343][_0xd715('0x59')])};}}_0x579322={'account':_0x297387,'message':_0x20b804[_0xd715('0x45')]};return;})[_0xd715('0x3d')](function(){if(_0x178a37[_0xd715('0x4e')]){if(_0x178a37[_0xd715('0x4e')][_0xd715('0x5a')]['length']){return _0x178a37[_0xd715('0x4e')][_0xd715('0x5a')][0x0];}else{return db[_0xd715('0x4f')][_0xd715('0x48')](_[_0xd715('0xb')](_0x20b804[_0xd715('0x45')],{'firstName':_0x20b804['body']['to'],'email':_0x20b804[_0xd715('0x45')]['to'],'phone':_0x20b804[_0xd715('0x45')]['to'],'ListId':_0x178a37[_0xd715('0x5b')]}));}}else{throw new Error(_0xd715('0x5c'));}})[_0xd715('0x3d')](function(){if(_0x579322){return respondWithRpcPromise(_0xd715('0x5d'),_0xd715('0x5e'),_0x579322,client9003)[_0xd715('0x3d')](function(_0x38def3){return _0x55efdc[_0xd715('0x44')]({'read':!![],'messageId':_0x38def3[_0xd715('0x5f')],'sentAt':moment()[_0xd715('0x60')](_0xd715('0x61'))});})['catch'](function(_0x2caaec){logger['error']('%s',JSON[_0xd715('0x62')](_0x2caaec));return _0x55efdc;});}return _0x55efdc;});}return _0x55efdc;}})['then'](respondWithResult(_0x52fe30,0xc9))['catch'](handleError(_0x52fe30,null));};exports[_0xd715('0x63')]=function(_0x2e29f2,_0x3a421e){var _0x24f80b={'agent':{},'channel':_0xd715('0x64')};if(_0x2e29f2['body']['id']){delete _0x2e29f2['body']['id'];}_0x2e29f2['body'][_0xd715('0x65')]=!![];_0x2e29f2[_0xd715('0x45')]['readAt']=moment()[_0xd715('0x60')](_0xd715('0x61'));_0x2e29f2['body'][_0xd715('0x66')]=_0x2e29f2[_0xd715('0x45')]['UserId']||_0x2e29f2[_0xd715('0x67')]['id'];_0x24f80b[_0xd715('0x68')]['id']=_0x2e29f2[_0xd715('0x45')][_0xd715('0x66')];return db[_0xd715('0x2a')][_0xd715('0x46')]({'where':{'id':_0x2e29f2[_0xd715('0x41')]['id'],'UserId':null}})[_0xd715('0x3d')](handleEntityNotFound(_0x3a421e,null))[_0xd715('0x3d')](saveUpdates(_0x2e29f2[_0xd715('0x45')],null))[_0xd715('0x3d')](function(_0x184d85){if(_0x184d85){_0x24f80b[_0xd715('0x19')]=_0x184d85[_0xd715('0x69')]({'plain':!![]});return db[_0xd715('0x6a')][_0xd715('0x46')]({'where':{'id':_0x184d85[_0xd715('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x3a421e,null))[_0xd715('0x3d')](function(_0x26bcd4){if(_0x26bcd4){return _0x26bcd4[_0xd715('0x44')]({'UserId':_0x2e29f2[_0xd715('0x45')]['UserId'],'read1stAt':_[_0xd715('0x6c')](_0x26bcd4[_0xd715('0x6d')])?moment()[_0xd715('0x60')](_0xd715('0x61')):undefined});}return null;})[_0xd715('0x3d')](function(_0x47b95e){if(_0x47b95e){_0x24f80b['interaction']=_0x47b95e[_0xd715('0x69')]({'plain':!![]});interaction_log[_0xd715('0x13')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2e29f2['user']['id'],_0x2e29f2[_0xd715('0x67')][_0xd715('0x27')],_0x2e29f2['user']['role'],_0x24f80b[_0xd715('0x6e')]['id'],_0x2e29f2[_0xd715('0x45')]?JSON['stringify'](_0x2e29f2[_0xd715('0x45')]):_0xd715('0x6f'));return respondWithRpcPromise('AcceptMessage',_0xd715('0x70'),_0x24f80b);}return null;})['then'](function(_0x52853e){var _0x3787c1=_0xd715('0x71')+_0x52853e[_0xd715('0x19')][_0xd715('0x72')];return db[_0xd715('0x73')][_0xd715('0x31')](_0x3787c1,{'type':db['Sequelize'][_0xd715('0x74')][_0xd715('0x75')],'raw':!![]})['then'](function(_0x3534f8){return _0x3534f8;});})[_0xd715('0x3d')](function(_0x58beb9){if(_0x58beb9){_0x24f80b[_0xd715('0x19')][_0xd715('0x76')]=_0x58beb9[0x0];if(!_0x2e29f2[_0xd715('0x45')][_0xd715('0x66')])return;return db[_0xd715('0x77')][_0xd715('0x46')]({'where':{'id':_0x2e29f2['body'][_0xd715('0x66')],'role':_0xd715('0x68')},'attributes':['id','name',_0xd715('0x78'),_0xd715('0x79'),_0xd715('0x7a')],'raw':!![]});}return null;})['then'](function(_0x571ce0){if(!_0x571ce0)return null;_0x24f80b[_0xd715('0x19')]['agent']=_0x571ce0;return _0x24f80b;})['then'](function(_0x24abdf){if(_0x24abdf){if(_0x2e29f2[_0xd715('0x45')]['manual']){_0x24f80b[_0xd715('0x19')][_0xd715('0x7b')]=util[_0xd715('0x60')](_0xd715('0x7c'),_0x2e29f2[_0xd715('0x67')][_0xd715('0x27')]);_0x24f80b[_0xd715('0x19')]['channel']=_0x24f80b[_0xd715('0x7d')];_0x24f80b[_0xd715('0x19')][_0xd715('0x7e')]=_0x24f80b['channel'];_0x24f80b[_0xd715('0x19')]['event']=_0xd715('0x63');_0x24f80b[_0xd715('0x19')]['body']=htmlToText[_0xd715('0x7f')](_0x24f80b[_0xd715('0x19')][_0xd715('0x45')]);return respondWithRpcPromise(_0xd715('0x80'),_0xd715('0x80'),{'event':_0xd715('0x81'),'message':_0x24f80b[_0xd715('0x19')]},client9002)[_0xd715('0x3d')](function(){return _0x24f80b;});}return _0x24f80b;}return null;})['then'](respondWithResult(_0x3a421e,null))[_0xd715('0x1b')](handleError(_0x3a421e,null));};exports[_0xd715('0x82')]=function(_0x1a6a1e,_0x1f0225){var _0x996718={'agent':{},'channel':'mail'};if(_0x1a6a1e[_0xd715('0x45')]['id']){delete _0x1a6a1e[_0xd715('0x45')]['id'];}_0x1a6a1e['body'][_0xd715('0x66')]=_0x1a6a1e['body'][_0xd715('0x66')]||_0x1a6a1e['user']['id'];_0x996718['agent']['id']=_0x1a6a1e['body'][_0xd715('0x66')];return db[_0xd715('0x2a')][_0xd715('0x46')]({'where':{'id':_0x1a6a1e[_0xd715('0x41')]['id'],'UserId':null}})[_0xd715('0x3d')](handleEntityNotFound(_0x1f0225,null))[_0xd715('0x3d')](function(_0x3b42e7){if(_0x3b42e7){_0x996718[_0xd715('0x19')]=_0x3b42e7[_0xd715('0x69')]({'plain':!![]});return db[_0xd715('0x6a')][_0xd715('0x46')]({'where':{'id':_0x3b42e7[_0xd715('0x6b')]}});}return null;})[_0xd715('0x3d')](handleEntityNotFound(_0x1f0225,null))['then'](function(_0x51c1da){if(_0x51c1da){_0x996718[_0xd715('0x6e')]=_0x51c1da[_0xd715('0x69')]({'plain':!![]});interaction_log[_0xd715('0x13')](_0xd715('0x83'),_0x1a6a1e[_0xd715('0x67')]['id'],_0x1a6a1e[_0xd715('0x67')][_0xd715('0x27')],_0x1a6a1e['user'][_0xd715('0x84')],_0x996718[_0xd715('0x6e')]['id'],_0x1a6a1e[_0xd715('0x45')]?JSON[_0xd715('0x62')](_0x1a6a1e[_0xd715('0x45')]):_0xd715('0x6f'));return respondWithRpcPromise(_0xd715('0x85'),_0xd715('0x86'),_0x996718);}return null;})[_0xd715('0x3d')](function(_0x21837f){var _0x157ae6=_0xd715('0x71')+_0x21837f['message'][_0xd715('0x72')];return db['sequelize'][_0xd715('0x31')](_0x157ae6,{'type':db['Sequelize'][_0xd715('0x74')][_0xd715('0x75')],'raw':!![]})[_0xd715('0x3d')](function(_0x5dd72f){return _0x5dd72f;});})[_0xd715('0x3d')](function(_0x43ab05){if(_0x43ab05){_0x996718[_0xd715('0x19')][_0xd715('0x76')]=_0x43ab05[0x0];if(!_0x1a6a1e[_0xd715('0x45')][_0xd715('0x66')])return;return db[_0xd715('0x77')][_0xd715('0x46')]({'where':{'id':_0x1a6a1e[_0xd715('0x45')][_0xd715('0x66')],'role':_0xd715('0x68')},'attributes':['id',_0xd715('0x27'),'fullname',_0xd715('0x79'),'internal'],'raw':!![]});}return null;})[_0xd715('0x3d')](function(_0x166ba5){if(!_0x166ba5)return null;_0x996718[_0xd715('0x19')]['agent']=_0x166ba5;return _0x996718;})['then'](function(_0x470c7c){if(_0x470c7c){_0x470c7c['message'][_0xd715('0x7b')]=util[_0xd715('0x60')]('SIP/%s',_0x1a6a1e['user'][_0xd715('0x27')]);_0x470c7c[_0xd715('0x19')][_0xd715('0x7d')]=_0x996718[_0xd715('0x7d')];_0x470c7c[_0xd715('0x19')][_0xd715('0x7e')]=_0x996718[_0xd715('0x7d')];_0x470c7c[_0xd715('0x19')][_0xd715('0x87')]=_0xd715('0x82');_0x470c7c['message'][_0xd715('0x45')]=htmlToText['fromString'](_0x996718['message']['body']);respondWithRpcPromise(_0xd715('0x80'),'EventManager',{'event':_0xd715('0x88'),'message':_0x470c7c[_0xd715('0x19')]},client9002);return _0x996718;}return null;})[_0xd715('0x3d')](respondWithResult(_0x1f0225,null))[_0xd715('0x1b')](handleError(_0x1f0225,null));};exports['download']=function(_0x2020de,_0x3ec31f){var _0x429861=moment()[_0xd715('0x89')]()[_0xd715('0x8a')]();var _0x533b37=path['join'](config[_0xd715('0x57')],_0xd715('0x8b'),_0xd715('0x8c'),_0xd715('0x8d'));var _0x393562=path['join'](config[_0xd715('0x57')],_0xd715('0x8b'),_0xd715('0x8c'),_0xd715('0x55'));var _0x3e6f2c=util['format'](_0xd715('0x8e'),_0x429861);return db[_0xd715('0x2a')][_0xd715('0x46')]({'where':{'id':_0x2020de[_0xd715('0x41')]['id']},'attributes':['id',_0xd715('0x45'),_0xd715('0x8f'),'to','cc',_0xd715('0x90'),_0xd715('0x91'),_0xd715('0x92')],'include':_0x2020de[_0xd715('0x31')][_0xd715('0x55')]?[{'model':db[_0xd715('0x93')],'as':_0xd715('0x94')}]:undefined})[_0xd715('0x3d')](handleEntityNotFound(_0x3ec31f,null))[_0xd715('0x3d')](function(_0x89821d){if(_0x89821d){var _0x1140ae=_0x89821d;var _0x5ec025={'from':_0x1140ae[_0xd715('0x8f')],'to':_0x1140ae['to'],'subject':_0x1140ae[_0xd715('0x91')],'html':htmlEntities['decode'](_0x1140ae[_0xd715('0x45')]),'headers':{'Date':moment(_0x1140ae['createdAt'])[_0xd715('0x60')](_0xd715('0x95'))},'attachments':[]};if(_0x89821d['cc']){_0x5ec025[_0xd715('0x96')]['Cc']=_0x89821d['cc'];}if(_0x89821d[_0xd715('0x90')]){_0x5ec025[_0xd715('0x96')]['Bcc']=_0x89821d['bcc'];}return new BPromise(function(_0x54f406,_0xf73b5c){if(_0x89821d[_0xd715('0x94')]){for(var _0x255b2d=0x0;_0x255b2d<_0x89821d[_0xd715('0x94')][_0xd715('0x35')];_0x255b2d++){var _0xd3420b=_0x89821d[_0xd715('0x94')][_0x255b2d];var _0x5c124f=path[_0xd715('0x56')](_0x393562,_0xd3420b['basename']);if(fs[_0xd715('0x97')](_0x5c124f)){_0x5ec025[_0xd715('0x55')][_0xd715('0x98')]({'name':_0xd3420b[_0xd715('0x27')],'contentType':_0xd3420b[_0xd715('0x2d')],'data':fs[_0xd715('0x99')](_0x5c124f)});}}}emlformat[_0xd715('0x9a')](_0x5ec025,function(_0x7ab7a2,_0x500e86){if(_0x7ab7a2)return _0xf73b5c(_0x7ab7a2);fs[_0xd715('0x9b')](path[_0xd715('0x56')](_0x533b37,_0x3e6f2c),_0x500e86);return _0x54f406(_0x500e86);});});}})[_0xd715('0x3d')](function(_0x5e7036){if(_0x5e7036){return _0x3ec31f[_0xd715('0x9c')](path['join'](_0x533b37,_0x3e6f2c),_0x3e6f2c,function(_0x1cc583){if(!_0x1cc583)fs[_0xd715('0x9d')](path[_0xd715('0x56')](_0x533b37,_0x3e6f2c));});}})[_0xd715('0x1b')](handleError(_0x3ec31f,null));}; \ No newline at end of file +var _0xa67e=['event','rejectmessage','download','unix','server','files','tmp','root','message-%s.eml','from','bcc','createdAt','Attachment','Attachments','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','moment','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','client','http','request','info','request\x20sent','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','json','offset','undefined','limit','count','status','set','update','then','destroy','end','sendStatus','name','send','index','MailMessage','fieldName','type','query','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','options','includeAll','include','show','params','keys','rawAttributes','length','body','find','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','attachments','join','basename','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','readAt','UserId','user','agent','MailInteraction','MailInteractionId','isNil','read1stAt','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','SIP/%s','channel','motionChannel','fromString','EventManager','acceptmessage','reject','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','User'];(function(_0x2c4ddc,_0x588329){var _0x479593=function(_0x3d66be){while(--_0x3d66be){_0x2c4ddc['push'](_0x2c4ddc['shift']());}};_0x479593(++_0x588329);}(_0xa67e,0x150));var _0xea67=function(_0xbfda63,_0x2bd321){_0xbfda63=_0xbfda63-0x0;var _0x25cf03=_0xa67e[_0xbfda63];return _0x25cf03;};'use strict';var emlformat=require('eml-format');var moment=require(_0xea67('0x0'));var BPromise=require(_0xea67('0x1'));var util=require('util');var path=require(_0xea67('0x2'));var fs=require('fs');var _=require(_0xea67('0x3'));var Redis=require(_0xea67('0x4'));var htmlToText=require(_0xea67('0x5'));var qs=require(_0xea67('0x6'));var logger=require(_0xea67('0x7'))('api');var interaction_log=require(_0xea67('0x7'))(_0xea67('0x8'));var config=require('../../config/environment');var db=require(_0xea67('0x9'))['db'];config[_0xea67('0xa')]=_[_0xea67('0xb')](config[_0xea67('0xa')],{'host':_0xea67('0xc'),'port':0x18eb});var socket=require(_0xea67('0xd'))(new Redis(config[_0xea67('0xa')]));var htmlEntities=require(_0xea67('0xe'));require(_0xea67('0xf'))['register'](socket);var jayson=require(_0xea67('0x10'));var client=jayson[_0xea67('0x11')]['http']({'port':0x232c});var client9003=jayson[_0xea67('0x11')]['http']({'port':0x232b});var client9002=jayson[_0xea67('0x11')][_0xea67('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x2e0981,_0x46c84f,_0x15bd43,_0xf2d345){return new BPromise(function(_0x1a9083,_0x34a891){var _0x125c84=_0xf2d345||client;return _0x125c84[_0xea67('0x13')](_0x2e0981,_0x15bd43)['then'](function(_0x55422b){logger[_0xea67('0x14')]('MailMessage,\x20%s,\x20%s',_0x46c84f,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x46c84f,_0xea67('0x15'),JSON['stringify'](_0x55422b));if(_0x55422b[_0xea67('0x16')]){if(_0x55422b['error'][_0xea67('0x17')]===0x1f4){logger[_0xea67('0x16')](_0xea67('0x18'),_0x46c84f,_0x55422b['error']['message']);return _0x34a891(_0x55422b[_0xea67('0x16')]['message']);}logger['error'](_0xea67('0x18'),_0x46c84f,_0x55422b[_0xea67('0x16')]['message']);return _0x1a9083(_0x55422b[_0xea67('0x16')][_0xea67('0x19')]);}else{logger[_0xea67('0x14')](_0xea67('0x18'),_0x46c84f,_0xea67('0x15'));_0x1a9083(_0x55422b[_0xea67('0x1a')][_0xea67('0x19')]);}})[_0xea67('0x1b')](function(_0x280083){logger[_0xea67('0x16')](_0xea67('0x18'),_0x46c84f,_0x280083);_0x34a891(_0x280083);});});}function respondWithResult(_0x54cae6,_0x24be4e){_0x24be4e=_0x24be4e||0xc8;return function(_0x49ee9e){if(_0x49ee9e){return _0x54cae6['status'](_0x24be4e)[_0xea67('0x1c')](_0x49ee9e);}};}function respondWithFilteredResult(_0x4e96e2,_0x40b8dc){return function(_0x5a1299){if(_0x5a1299){var _0xa869c5=typeof _0x40b8dc[_0xea67('0x1d')]===_0xea67('0x1e')&&typeof _0x40b8dc[_0xea67('0x1f')]===_0xea67('0x1e');var _0x5e7d32=_0x5a1299[_0xea67('0x20')];var _0x13ec2c=_0xa869c5?0x0:_0x40b8dc[_0xea67('0x1d')];var _0x1afd6d=_0xa869c5?_0x5a1299[_0xea67('0x20')]:_0x40b8dc['offset']+_0x40b8dc['limit'];var _0xb4d727;if(_0x1afd6d>=_0x5e7d32){_0x1afd6d=_0x5e7d32;_0xb4d727=0xc8;}else{_0xb4d727=0xce;}_0x4e96e2[_0xea67('0x21')](_0xb4d727);return _0x4e96e2[_0xea67('0x22')]('Content-Range',_0x13ec2c+'-'+_0x1afd6d+'/'+_0x5e7d32)[_0xea67('0x1c')](_0x5a1299);}return null;};}function saveUpdates(_0x3507d4){return function(_0x33ede7){if(_0x33ede7){return _0x33ede7[_0xea67('0x23')](_0x3507d4)[_0xea67('0x24')](function(_0x31bac9){return _0x31bac9;});}return null;};}function removeEntity(_0x3df622){return function(_0xbd0085){if(_0xbd0085){return _0xbd0085[_0xea67('0x25')]()[_0xea67('0x24')](function(){_0x3df622['status'](0xcc)[_0xea67('0x26')]();});}};}function handleEntityNotFound(_0x41c221){return function(_0x3186a2){if(!_0x3186a2){_0x41c221[_0xea67('0x27')](0x194);}return _0x3186a2;};}function handleError(_0x50ca76,_0x37177e){_0x37177e=_0x37177e||0x1f4;return function(_0xc84795){logger[_0xea67('0x16')](_0xc84795['stack']);if(_0xc84795['name']){delete _0xc84795[_0xea67('0x28')];}_0x50ca76['status'](_0x37177e)[_0xea67('0x29')](_0xc84795);};}exports[_0xea67('0x2a')]=function(_0x404fc7,_0x1f68bf){var _0x55403d={},_0xdd86ee={},_0x375913={'count':0x0,'rows':[]};var _0x8a1e17=_['map'](db[_0xea67('0x2b')]['rawAttributes'],function(_0x5bab49){return{'name':_0x5bab49[_0xea67('0x2c')],'type':_0x5bab49[_0xea67('0x2d')]['key']};});_0xdd86ee['model']=_['map'](_0x8a1e17,_0xea67('0x28'));_0xdd86ee[_0xea67('0x2e')]=_['keys'](_0x404fc7[_0xea67('0x2e')]);_0xdd86ee['filters']=_['intersection'](_0xdd86ee[_0xea67('0x2f')],_0xdd86ee[_0xea67('0x2e')]);_0x55403d['attributes']=_[_0xea67('0x30')](_0xdd86ee['model'],qs['fields'](_0x404fc7[_0xea67('0x2e')][_0xea67('0x31')]));_0x55403d[_0xea67('0x32')]=_0x55403d[_0xea67('0x32')]['length']?_0x55403d[_0xea67('0x32')]:_0xdd86ee['model'];if(!_0x404fc7['query'][_0xea67('0x33')](_0xea67('0x34'))){_0x55403d[_0xea67('0x1f')]=qs[_0xea67('0x1f')](_0x404fc7[_0xea67('0x2e')][_0xea67('0x1f')]);_0x55403d[_0xea67('0x1d')]=qs[_0xea67('0x1d')](_0x404fc7[_0xea67('0x2e')][_0xea67('0x1d')]);}_0x55403d[_0xea67('0x35')]=qs[_0xea67('0x36')](_0x404fc7['query']['sort']);_0x55403d[_0xea67('0x37')]=qs[_0xea67('0x38')](_['pick'](_0x404fc7['query'],_0xdd86ee[_0xea67('0x38')]),_0x8a1e17);if(_0x404fc7[_0xea67('0x2e')][_0xea67('0x39')]){_0x55403d['where']=_[_0xea67('0x3a')](_0x55403d[_0xea67('0x37')],{'$or':_[_0xea67('0x3b')](_0x8a1e17,function(_0x46404e){if(_0x46404e[_0xea67('0x2d')]!=='VIRTUAL'){var _0x55516a={};_0x55516a[_0x46404e[_0xea67('0x28')]]={'$like':'%'+_0x404fc7[_0xea67('0x2e')][_0xea67('0x39')]+'%'};return _0x55516a;}})});}_0x55403d=_[_0xea67('0x3a')]({},_0x55403d,_0x404fc7[_0xea67('0x3c')]);var _0x58223f={'where':_0x55403d[_0xea67('0x37')]};return db[_0xea67('0x2b')][_0xea67('0x20')](_0x58223f)[_0xea67('0x24')](function(_0x4c35df){_0x375913[_0xea67('0x20')]=_0x4c35df;if(_0x404fc7[_0xea67('0x2e')][_0xea67('0x3d')]){_0x55403d[_0xea67('0x3e')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x55403d);})[_0xea67('0x24')](function(_0x294c9b){_0x375913['rows']=_0x294c9b;return _0x375913;})[_0xea67('0x24')](respondWithFilteredResult(_0x1f68bf,_0x55403d))[_0xea67('0x1b')](handleError(_0x1f68bf,null));};exports[_0xea67('0x3f')]=function(_0x4cd3d0,_0x3a461c){var _0x4b0d94={'raw':!![],'where':{'id':_0x4cd3d0[_0xea67('0x40')]['id']}},_0x40869a={};_0x40869a[_0xea67('0x2f')]=_[_0xea67('0x41')](db[_0xea67('0x2b')][_0xea67('0x42')]);_0x40869a[_0xea67('0x2e')]=_[_0xea67('0x41')](_0x4cd3d0[_0xea67('0x2e')]);_0x40869a[_0xea67('0x38')]=_[_0xea67('0x30')](_0x40869a[_0xea67('0x2f')],_0x40869a['query']);_0x4b0d94[_0xea67('0x32')]=_[_0xea67('0x30')](_0x40869a[_0xea67('0x2f')],qs[_0xea67('0x31')](_0x4cd3d0['query'][_0xea67('0x31')]));_0x4b0d94['attributes']=_0x4b0d94[_0xea67('0x32')][_0xea67('0x43')]?_0x4b0d94[_0xea67('0x32')]:_0x40869a['model'];if(_0x4cd3d0[_0xea67('0x2e')][_0xea67('0x3d')]){_0x4b0d94[_0xea67('0x3e')]=[{'all':!![]}];}_0x4b0d94=_['merge']({},_0x4b0d94,_0x4cd3d0[_0xea67('0x3c')]);return db[_0xea67('0x2b')]['find'](_0x4b0d94)[_0xea67('0x24')](handleEntityNotFound(_0x3a461c,null))['then'](respondWithResult(_0x3a461c,null))['catch'](handleError(_0x3a461c,null));};exports[_0xea67('0x23')]=function(_0x3714df,_0x1123e3){if(_0x3714df[_0xea67('0x44')]['id']){delete _0x3714df[_0xea67('0x44')]['id'];}return db['MailMessage'][_0xea67('0x45')]({'where':{'id':_0x3714df[_0xea67('0x40')]['id']}})[_0xea67('0x24')](handleEntityNotFound(_0x1123e3,null))[_0xea67('0x24')](saveUpdates(_0x3714df['body'],null))[_0xea67('0x24')](respondWithResult(_0x1123e3,null))[_0xea67('0x1b')](handleError(_0x1123e3,null));};exports[_0xea67('0x25')]=function(_0x32628d,_0x301c57){return db['MailMessage'][_0xea67('0x45')]({'where':{'id':_0x32628d[_0xea67('0x40')]['id']}})['then'](handleEntityNotFound(_0x301c57,null))[_0xea67('0x24')](removeEntity(_0x301c57,null))[_0xea67('0x1b')](handleError(_0x301c57,null));};exports[_0xea67('0x46')]=function(_0x405419,_0x178875){return db['MailMessage']['describe']()['then'](respondWithResult(_0x178875,null))[_0xea67('0x1b')](handleError(_0x178875,null));};exports[_0xea67('0x47')]=function(_0x247f32,_0x21c835){return db[_0xea67('0x2b')][_0xea67('0x47')](_0x247f32['body'])[_0xea67('0x24')](function(_0x2069b4){if(_0x2069b4){if(_0x2069b4[_0xea67('0x48')]===_0xea67('0x49')&&!_0x2069b4[_0xea67('0x4a')]){var _0x3744b5,_0x23160f,_0x37bc45;if(_0x247f32[_0xea67('0x44')]['to']){_0x23160f=_0x247f32[_0xea67('0x44')]['to']['split'](',')[0x0];}return db[_0xea67('0x4b')][_0xea67('0x4c')]({'where':{'id':_0x2069b4[_0xea67('0x4d')]},'include':[{'model':db[_0xea67('0x4e')],'as':_0xea67('0x4f'),'include':[{'model':db[_0xea67('0x50')],'as':_0xea67('0x51'),'where':{'email':_0x23160f},'limit':0x1,'order':[[_0xea67('0x52'),_0xea67('0x53')]]}]},{'model':db[_0xea67('0x54')],'as':_0xea67('0x55'),'raw':!![],'include':[{'model':db[_0xea67('0x56')],'as':_0xea67('0x56'),'raw':!![]}]}]})[_0xea67('0x24')](function(_0x2f1b5d){_0x3744b5=_0x2f1b5d;if(!_0x3744b5||!_0x3744b5['Smtp'])return;var _0xf959a2=_0x3744b5['getSmtpOptions']();if(_0x247f32[_0xea67('0x44')]['attachments']&&_0x247f32[_0xea67('0x44')]['attachments'][_0xea67('0x43')]){for(var _0x36cc7d=0x0;_0x36cc7d<_0x247f32[_0xea67('0x44')][_0xea67('0x57')][_0xea67('0x43')];_0x36cc7d+=0x1){_0x247f32[_0xea67('0x44')][_0xea67('0x57')][_0x36cc7d]={'filename':_0x247f32[_0xea67('0x44')][_0xea67('0x57')][_0x36cc7d][_0xea67('0x28')],'path':path[_0xea67('0x58')](config['root'],'server/files/attachments',_0x247f32[_0xea67('0x44')][_0xea67('0x57')][_0x36cc7d][_0xea67('0x59')])};}}_0x37bc45={'account':_0xf959a2,'message':_0x247f32[_0xea67('0x44')]};return;})[_0xea67('0x24')](function(){if(_0x3744b5[_0xea67('0x4f')]){if(_0x3744b5[_0xea67('0x4f')][_0xea67('0x51')][_0xea67('0x43')]){return _0x3744b5[_0xea67('0x4f')]['Contacts'][0x0];}else{return db[_0xea67('0x50')][_0xea67('0x47')](_['defaults'](_0x247f32[_0xea67('0x44')],{'firstName':_0x247f32[_0xea67('0x44')]['to'],'email':_0x247f32[_0xea67('0x44')]['to'],'phone':_0x247f32[_0xea67('0x44')]['to'],'ListId':_0x3744b5['ListId']}));}}else{throw new Error('List\x20not\x20found');}})[_0xea67('0x24')](function(){if(_0x37bc45){return respondWithRpcPromise(_0xea67('0x5a'),'sendMail',_0x37bc45,client9003)[_0xea67('0x24')](function(_0x49f0b7){return _0x2069b4[_0xea67('0x23')]({'read':!![],'messageId':_0x49f0b7[_0xea67('0x5b')],'sentAt':moment()[_0xea67('0x5c')](_0xea67('0x5d'))});})['catch'](function(_0x11ed2d){logger['error']('%s',JSON['stringify'](_0x11ed2d));return _0x2069b4;});}return _0x2069b4;});}return _0x2069b4;}})['then'](respondWithResult(_0x21c835,0xc9))[_0xea67('0x1b')](handleError(_0x21c835,null));};exports[_0xea67('0x5e')]=function(_0x4bacb6,_0x274cdd){var _0x1bd374={'agent':{},'channel':'mail'};if(_0x4bacb6[_0xea67('0x44')]['id']){delete _0x4bacb6[_0xea67('0x44')]['id'];}_0x4bacb6[_0xea67('0x44')][_0xea67('0x5f')]=!![];_0x4bacb6[_0xea67('0x44')][_0xea67('0x60')]=moment()[_0xea67('0x5c')](_0xea67('0x5d'));_0x4bacb6[_0xea67('0x44')][_0xea67('0x61')]=_0x4bacb6['body'][_0xea67('0x61')]||_0x4bacb6[_0xea67('0x62')]['id'];_0x1bd374[_0xea67('0x63')]['id']=_0x4bacb6[_0xea67('0x44')][_0xea67('0x61')];return db['MailMessage'][_0xea67('0x45')]({'where':{'id':_0x4bacb6['params']['id'],'UserId':null}})[_0xea67('0x24')](handleEntityNotFound(_0x274cdd,null))[_0xea67('0x24')](saveUpdates(_0x4bacb6[_0xea67('0x44')],null))[_0xea67('0x24')](function(_0xaf9191){if(_0xaf9191){_0x1bd374[_0xea67('0x19')]=_0xaf9191['get']({'plain':!![]});return db[_0xea67('0x64')][_0xea67('0x45')]({'where':{'id':_0xaf9191[_0xea67('0x65')]}});}return null;})[_0xea67('0x24')](handleEntityNotFound(_0x274cdd,null))['then'](function(_0x3f30fc){if(_0x3f30fc){return _0x3f30fc['update']({'UserId':_0x4bacb6['body'][_0xea67('0x61')],'read1stAt':_[_0xea67('0x66')](_0x3f30fc[_0xea67('0x67')])?moment()['format'](_0xea67('0x5d')):undefined});}return null;})['then'](function(_0x4190c2){if(_0x4190c2){_0x1bd374['interaction']=_0x4190c2[_0xea67('0x68')]({'plain':!![]});interaction_log[_0xea67('0x14')](_0xea67('0x69'),_0x4bacb6[_0xea67('0x62')]['id'],_0x4bacb6['user'][_0xea67('0x28')],_0x4bacb6[_0xea67('0x62')]['role'],_0x1bd374['interaction']['id'],_0x4bacb6[_0xea67('0x44')]?JSON[_0xea67('0x6a')](_0x4bacb6[_0xea67('0x44')]):'null');return respondWithRpcPromise('AcceptMessage',_0xea67('0x6b'),_0x1bd374);}return null;})['then'](function(_0x12c7f8){var _0x3af049=_0xea67('0x6c')+_0x12c7f8[_0xea67('0x19')][_0xea67('0x6d')];return db[_0xea67('0x6e')][_0xea67('0x2e')](_0x3af049,{'type':db[_0xea67('0x6f')][_0xea67('0x70')][_0xea67('0x71')],'raw':!![]})[_0xea67('0x24')](function(_0x479436){return _0x479436;});})[_0xea67('0x24')](function(_0x27ba75){if(_0x27ba75){_0x1bd374[_0xea67('0x19')][_0xea67('0x72')]=_0x27ba75[0x0];if(!_0x4bacb6[_0xea67('0x44')]['UserId'])return;return db['User'][_0xea67('0x45')]({'where':{'id':_0x4bacb6[_0xea67('0x44')][_0xea67('0x61')],'role':_0xea67('0x63')},'attributes':['id',_0xea67('0x28'),_0xea67('0x73'),_0xea67('0x74'),_0xea67('0x75')],'raw':!![]});}return null;})['then'](function(_0x265f67){if(!_0x265f67)return null;_0x1bd374[_0xea67('0x19')][_0xea67('0x63')]=_0x265f67;return _0x1bd374;})['then'](function(_0x365f03){if(_0x365f03){if(_0x4bacb6['body']['manual']){_0x1bd374['message']['interface']=util['format'](_0xea67('0x76'),_0x4bacb6[_0xea67('0x62')]['name']);_0x1bd374[_0xea67('0x19')][_0xea67('0x77')]=_0x1bd374[_0xea67('0x77')];_0x1bd374['message'][_0xea67('0x78')]=_0x1bd374['channel'];_0x1bd374[_0xea67('0x19')]['event']=_0xea67('0x5e');_0x1bd374[_0xea67('0x19')][_0xea67('0x44')]=htmlToText[_0xea67('0x79')](_0x1bd374[_0xea67('0x19')][_0xea67('0x44')]);return respondWithRpcPromise('EventManager',_0xea67('0x7a'),{'event':_0xea67('0x7b'),'message':_0x1bd374['message']},client9002)['then'](function(){return _0x1bd374;});}return _0x1bd374;}return null;})[_0xea67('0x24')](respondWithResult(_0x274cdd,null))[_0xea67('0x1b')](handleError(_0x274cdd,null));};exports[_0xea67('0x7c')]=function(_0x532120,_0x19ff74){var _0x15f224={'agent':{},'channel':_0xea67('0x7d')};if(_0x532120[_0xea67('0x44')]['id']){delete _0x532120[_0xea67('0x44')]['id'];}_0x532120[_0xea67('0x44')][_0xea67('0x61')]=_0x532120[_0xea67('0x44')]['UserId']||_0x532120[_0xea67('0x62')]['id'];_0x15f224[_0xea67('0x63')]['id']=_0x532120[_0xea67('0x44')][_0xea67('0x61')];return db[_0xea67('0x2b')][_0xea67('0x45')]({'where':{'id':_0x532120[_0xea67('0x40')]['id'],'UserId':null}})[_0xea67('0x24')](handleEntityNotFound(_0x19ff74,null))['then'](function(_0x34bcad){if(_0x34bcad){_0x15f224['message']=_0x34bcad[_0xea67('0x68')]({'plain':!![]});return db[_0xea67('0x64')][_0xea67('0x45')]({'where':{'id':_0x34bcad[_0xea67('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x19ff74,null))['then'](function(_0x224705){if(_0x224705){_0x15f224['interaction']=_0x224705[_0xea67('0x68')]({'plain':!![]});interaction_log['info'](_0xea67('0x7e'),_0x532120[_0xea67('0x62')]['id'],_0x532120[_0xea67('0x62')][_0xea67('0x28')],_0x532120[_0xea67('0x62')][_0xea67('0x7f')],_0x15f224['interaction']['id'],_0x532120[_0xea67('0x44')]?JSON[_0xea67('0x6a')](_0x532120[_0xea67('0x44')]):_0xea67('0x80'));return respondWithRpcPromise(_0xea67('0x81'),_0xea67('0x82'),_0x15f224);}return null;})[_0xea67('0x24')](function(_0x3e7707){var _0x17740d=_0xea67('0x6c')+_0x3e7707[_0xea67('0x19')][_0xea67('0x6d')];return db[_0xea67('0x6e')][_0xea67('0x2e')](_0x17740d,{'type':db[_0xea67('0x6f')][_0xea67('0x70')][_0xea67('0x71')],'raw':!![]})[_0xea67('0x24')](function(_0x4ebec0){return _0x4ebec0;});})[_0xea67('0x24')](function(_0x5edd4c){if(_0x5edd4c){_0x15f224[_0xea67('0x19')][_0xea67('0x72')]=_0x5edd4c[0x0];if(!_0x532120[_0xea67('0x44')]['UserId'])return;return db[_0xea67('0x83')][_0xea67('0x45')]({'where':{'id':_0x532120[_0xea67('0x44')][_0xea67('0x61')],'role':_0xea67('0x63')},'attributes':['id',_0xea67('0x28'),_0xea67('0x73'),_0xea67('0x74'),_0xea67('0x75')],'raw':!![]});}return null;})['then'](function(_0x61ffb4){if(!_0x61ffb4)return null;_0x15f224[_0xea67('0x19')][_0xea67('0x63')]=_0x61ffb4;return _0x15f224;})['then'](function(_0x2e3d64){if(_0x2e3d64){_0x2e3d64[_0xea67('0x19')]['interface']=util[_0xea67('0x5c')]('SIP/%s',_0x532120[_0xea67('0x62')][_0xea67('0x28')]);_0x2e3d64['message'][_0xea67('0x77')]=_0x15f224[_0xea67('0x77')];_0x2e3d64[_0xea67('0x19')][_0xea67('0x78')]=_0x15f224[_0xea67('0x77')];_0x2e3d64[_0xea67('0x19')][_0xea67('0x84')]=_0xea67('0x7c');_0x2e3d64['message'][_0xea67('0x44')]=htmlToText[_0xea67('0x79')](_0x15f224[_0xea67('0x19')]['body']);respondWithRpcPromise(_0xea67('0x7a'),'EventManager',{'event':_0xea67('0x85'),'message':_0x2e3d64[_0xea67('0x19')]},client9002);return _0x15f224;}return null;})[_0xea67('0x24')](respondWithResult(_0x19ff74,null))['catch'](handleError(_0x19ff74,null));};exports[_0xea67('0x86')]=function(_0x2c3452,_0x3012cf){var _0x51cc4f=moment()[_0xea67('0x87')]()['toString']();var _0x1a94ee=path[_0xea67('0x58')](config['root'],_0xea67('0x88'),_0xea67('0x89'),_0xea67('0x8a'));var _0x21034d=path[_0xea67('0x58')](config[_0xea67('0x8b')],_0xea67('0x88'),_0xea67('0x89'),_0xea67('0x57'));var _0x4fb39f=util[_0xea67('0x5c')](_0xea67('0x8c'),_0x51cc4f);return db['MailMessage'][_0xea67('0x45')]({'where':{'id':_0x2c3452[_0xea67('0x40')]['id']},'attributes':['id',_0xea67('0x44'),_0xea67('0x8d'),'to','cc',_0xea67('0x8e'),'subject',_0xea67('0x8f')],'include':_0x2c3452[_0xea67('0x2e')]['attachments']?[{'model':db[_0xea67('0x90')],'as':_0xea67('0x91')}]:undefined})['then'](handleEntityNotFound(_0x3012cf,null))[_0xea67('0x24')](function(_0x4ca47b){if(_0x4ca47b){var _0x5f2fdb=_0x4ca47b;var _0x5525aa={'from':_0x5f2fdb[_0xea67('0x8d')],'to':_0x5f2fdb['to'],'subject':_0x5f2fdb[_0xea67('0x92')],'html':htmlEntities['decode'](_0x5f2fdb[_0xea67('0x44')]),'headers':{'Date':moment(_0x5f2fdb[_0xea67('0x8f')])['format'](_0xea67('0x93'))},'attachments':[]};if(_0x4ca47b['cc']){_0x5525aa[_0xea67('0x94')]['Cc']=_0x4ca47b['cc'];}if(_0x4ca47b[_0xea67('0x8e')]){_0x5525aa[_0xea67('0x94')][_0xea67('0x95')]=_0x4ca47b[_0xea67('0x8e')];}return new BPromise(function(_0x3d4953,_0xb38c17){if(_0x4ca47b[_0xea67('0x91')]){for(var _0x43bc4f=0x0;_0x43bc4f<_0x4ca47b[_0xea67('0x91')]['length'];_0x43bc4f++){var _0x213f93=_0x4ca47b[_0xea67('0x91')][_0x43bc4f];var _0x2971cf=path['join'](_0x21034d,_0x213f93[_0xea67('0x59')]);if(fs[_0xea67('0x96')](_0x2971cf)){_0x5525aa[_0xea67('0x57')][_0xea67('0x97')]({'name':_0x213f93[_0xea67('0x28')],'contentType':_0x213f93[_0xea67('0x2d')],'data':fs[_0xea67('0x98')](_0x2971cf)});}}}emlformat[_0xea67('0x99')](_0x5525aa,function(_0x2d0e29,_0x2d1805){if(_0x2d0e29)return _0xb38c17(_0x2d0e29);fs[_0xea67('0x9a')](path[_0xea67('0x58')](_0x1a94ee,_0x4fb39f),_0x2d1805);return _0x3d4953(_0x2d1805);});});}})[_0xea67('0x24')](function(_0x239cf4){if(_0x239cf4){return _0x3012cf['download'](path[_0xea67('0x58')](_0x1a94ee,_0x4fb39f),_0x4fb39f,function(_0x187a5e){if(!_0x187a5e)fs[_0xea67('0x9b')](path[_0xea67('0x58')](_0x1a94ee,_0x4fb39f));});}})['catch'](handleError(_0x3012cf,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index ce70a49..a9e9490 100644 --- a/server/api/mailMessage/mailMessage.events.js +++ b/server/api/mailMessage/mailMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc205=['events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x55a4ec,_0x4d7610){var _0x2ded12=function(_0x14fd4f){while(--_0x14fd4f){_0x55a4ec['push'](_0x55a4ec['shift']());}};_0x2ded12(++_0x4d7610);}(_0xc205,0x14d));var _0x5c20=function(_0x54a436,_0x2ada8a){_0x54a436=_0x54a436-0x0;var _0x48d867=_0xc205[_0x54a436];return _0x48d867;};'use strict';var EventEmitter=require(_0x5c20('0x0'));var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x5c20('0x1')](0x0);var events={'afterCreate':_0x5c20('0x2'),'afterUpdate':_0x5c20('0x3'),'afterDestroy':_0x5c20('0x4')};function emitEvent(_0x37ab35){return function(_0x2ac2eb,_0x6c36b8,_0xd6a6ad){MailMessageEvents[_0x5c20('0x5')](_0x37ab35+':'+_0x2ac2eb['id'],_0x2ac2eb);MailMessageEvents[_0x5c20('0x5')](_0x37ab35,_0x2ac2eb);_0xd6a6ad(null);};}for(var e in events){if(events[_0x5c20('0x6')](e)){var event=events[e];MailMessage[_0x5c20('0x7')](e,emitEvent(event));}}module[_0x5c20('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x1823=['../../mysqldb','MailMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0x1823,0x194));var _0x3182=function(_0x36e19f,_0x3c7511){_0x36e19f=_0x36e19f-0x0;var _0x2a1f77=_0x1823[_0x36e19f];return _0x2a1f77;};'use strict';var EventEmitter=require(_0x3182('0x0'));var MailMessage=require(_0x3182('0x1'))['db'][_0x3182('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x3182('0x3')](0x0);var events={'afterCreate':_0x3182('0x4'),'afterUpdate':'update','afterDestroy':_0x3182('0x5')};function emitEvent(_0x3106b4){return function(_0x4cc31d,_0x2fabd8,_0x1fb843){MailMessageEvents[_0x3182('0x6')](_0x3106b4+':'+_0x4cc31d['id'],_0x4cc31d);MailMessageEvents[_0x3182('0x6')](_0x3106b4,_0x4cc31d);_0x1fb843(null);};}for(var e in events){if(events[_0x3182('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x3182('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 70710e5..a315296 100644 --- a/server/api/mailMessage/mailMessage.model.js +++ b/server/api/mailMessage/mailMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cf3=['api','moment','bluebird','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','get','toLowerCase','direction','out','secret','UserId','findOne','MailInteractionId','then','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger'];(function(_0x4e3292,_0x2e25ae){var _0x151ea7=function(_0x456edb){while(--_0x456edb){_0x4e3292['push'](_0x4e3292['shift']());}};_0x151ea7(++_0x2e25ae);}(_0x5cf3,0x195));var _0x35cf=function(_0x4884a7,_0x18e38a){_0x4884a7=_0x4884a7-0x0;var _0x56b60e=_0x5cf3[_0x4884a7];return _0x56b60e;};'use strict';var _=require(_0x35cf('0x0'));var util=require(_0x35cf('0x1'));var logger=require(_0x35cf('0x2'))(_0x35cf('0x3'));var moment=require(_0x35cf('0x4'));var BPromise=require(_0x35cf('0x5'));var rp=require('request-promise');var htmlToText=require(_0x35cf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x35cf('0x7'));var config=require(_0x35cf('0x8'));var attributes=require(_0x35cf('0x9'));module[_0x35cf('0xa')]=function(_0xabea3d,_0x2073d8){return _0xabea3d[_0x35cf('0xb')](_0x35cf('0xc'),attributes,{'tableName':_0x35cf('0xd'),'paranoid':![],'indexes':[{'name':_0x35cf('0xe'),'fields':['messageId']},{'name':_0x35cf('0xf'),'fields':[_0x35cf('0x10'),_0x35cf('0x11')],'type':_0x35cf('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x176cf8,_0x57c815,_0x576981){if(_0x176cf8[_0x35cf('0x13')]){_0x176cf8[_0x35cf('0x10')]=htmlToText[_0x35cf('0x14')](_0x176cf8['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x576981(null,_0x57c815);},'afterCreate':function(_0x428a65,_0x55f05d,_0x13d76f){var _0x542864=_0xabea3d['models'];var _0x10ce08=_0x428a65[_0x35cf('0x15')]({'plain':!![]});if(_0x10ce08['direction'][_0x35cf('0x16')]()==='in'||_0x10ce08[_0x35cf('0x17')]['toLowerCase']()===_0x35cf('0x18')&&!_0x10ce08[_0x35cf('0x19')]&&!_['isNil'](_0x10ce08[_0x35cf('0x1a')])){_0x542864['MailInteraction'][_0x35cf('0x1b')]({'where':{'id':_0x10ce08[_0x35cf('0x1c')]}})[_0x35cf('0x1d')](function(_0x359874){if(_0x359874){_0x359874['update']({'lastMsgAt':_0x10ce08[_0x35cf('0x1e')],'lastMsgDirection':_0x10ce08[_0x35cf('0x17')][_0x35cf('0x16')]()});}})[_0x35cf('0x1f')](function(_0x489035){console[_0x35cf('0x20')](_0x489035);});}_0x13d76f();}},'charset':_0x35cf('0x21'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe9cc=['body','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','catch','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT'];(function(_0x1bb58c,_0x2c8a4d){var _0x277586=function(_0x11fd4c){while(--_0x11fd4c){_0x1bb58c['push'](_0x1bb58c['shift']());}};_0x277586(++_0x2c8a4d);}(_0xe9cc,0x139));var _0xce9c=function(_0x5fd7e5,_0x1ff905){_0x5fd7e5=_0x5fd7e5-0x0;var _0x19c265=_0xe9cc[_0x5fd7e5];return _0x19c265;};'use strict';var _=require(_0xce9c('0x0'));var util=require('util');var logger=require(_0xce9c('0x1'))(_0xce9c('0x2'));var moment=require(_0xce9c('0x3'));var BPromise=require(_0xce9c('0x4'));var rp=require(_0xce9c('0x5'));var htmlToText=require(_0xce9c('0x6'));var fs=require('fs');var path=require(_0xce9c('0x7'));var rimraf=require(_0xce9c('0x8'));var config=require(_0xce9c('0x9'));var attributes=require(_0xce9c('0xa'));module[_0xce9c('0xb')]=function(_0x4a8959,_0x140c73){return _0x4a8959[_0xce9c('0xc')](_0xce9c('0xd'),attributes,{'tableName':_0xce9c('0xe'),'paranoid':![],'indexes':[{'name':_0xce9c('0xf'),'fields':[_0xce9c('0xf')]},{'name':_0xce9c('0x10'),'fields':[_0xce9c('0x11'),_0xce9c('0x12')],'type':_0xce9c('0x13')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3d9554,_0x1ab233,_0x371be4){if(_0x3d9554[_0xce9c('0x14')]){_0x3d9554['plainBody']=htmlToText[_0xce9c('0x15')](_0x3d9554[_0xce9c('0x14')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x371be4(null,_0x1ab233);},'afterCreate':function(_0x493901,_0x2fc547,_0x1271da){var _0x49ab9e=_0x4a8959[_0xce9c('0x16')];var _0x447a4a=_0x493901[_0xce9c('0x17')]({'plain':!![]});if(_0x447a4a[_0xce9c('0x18')][_0xce9c('0x19')]()==='in'||_0x447a4a[_0xce9c('0x18')][_0xce9c('0x19')]()===_0xce9c('0x1a')&&!_0x447a4a[_0xce9c('0x1b')]&&!_[_0xce9c('0x1c')](_0x447a4a[_0xce9c('0x1d')])){_0x49ab9e[_0xce9c('0x1e')][_0xce9c('0x1f')]({'where':{'id':_0x447a4a[_0xce9c('0x20')]}})[_0xce9c('0x21')](function(_0x4dde12){if(_0x4dde12){_0x4dde12[_0xce9c('0x22')]({'lastMsgAt':_0x447a4a['createdAt'],'lastMsgDirection':_0x447a4a[_0xce9c('0x18')][_0xce9c('0x19')]()});}})[_0xce9c('0x23')](function(_0x1c24f0){console['error'](_0x1c24f0);});}_0x1271da();}},'charset':'utf8mb4','collate':_0xce9c('0x24')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 6cc5c1b..e40e05a 100644 --- a/server/api/mailMessage/mailMessage.rpc.js +++ b/server/api/mailMessage/mailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4888=['code','message','request\x20sent','result','catch','CreateMailMessage','MailMessage','create','body','options','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x53f9a8,_0x43c7ea){var _0x27b839=function(_0x5b75b0){while(--_0x5b75b0){_0x53f9a8['push'](_0x53f9a8['shift']());}};_0x27b839(++_0x43c7ea);}(_0x4888,0x198));var _0x8488=function(_0x5ecbe8,_0x42522f){_0x5ecbe8=_0x5ecbe8-0x0;var _0x1c6e21=_0x4888[_0x5ecbe8];return _0x1c6e21;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var moment=require(_0x8488('0x1'));var BPromise=require(_0x8488('0x2'));var rs=require(_0x8488('0x3'));var fs=require('fs');var Redis=require(_0x8488('0x4'));var db=require(_0x8488('0x5'))['db'];var utils=require(_0x8488('0x6'));var logger=require('../../config/logger')(_0x8488('0x7'));var config=require(_0x8488('0x8'));var jayson=require(_0x8488('0x9'));var client=jayson[_0x8488('0xa')][_0x8488('0xb')]({'port':0x232a});config[_0x8488('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8488('0xc')]));require(_0x8488('0xd'))['register'](socket);function respondWithRpcPromise(_0x19c994,_0x1334fe,_0x98223){return new BPromise(function(_0x19a2ee,_0x515ea8){return client[_0x8488('0xe')](_0x19c994,_0x98223)[_0x8488('0xf')](function(_0x468896){logger[_0x8488('0x10')](_0x8488('0x11'),_0x1334fe,'request\x20sent');logger[_0x8488('0x12')](_0x8488('0x13'),_0x1334fe,'request\x20sent',JSON['stringify'](_0x468896));if(_0x468896[_0x8488('0x14')]){if(_0x468896['error'][_0x8488('0x15')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x1334fe,_0x468896[_0x8488('0x14')][_0x8488('0x16')]);return _0x515ea8(_0x468896[_0x8488('0x14')][_0x8488('0x16')]);}logger[_0x8488('0x14')](_0x8488('0x11'),_0x1334fe,_0x468896[_0x8488('0x14')]['message']);return _0x19a2ee(_0x468896[_0x8488('0x14')][_0x8488('0x16')]);}else{logger[_0x8488('0x10')](_0x8488('0x11'),_0x1334fe,_0x8488('0x17'));_0x19a2ee(_0x468896[_0x8488('0x18')][_0x8488('0x16')]);}})[_0x8488('0x19')](function(_0x514c31){logger[_0x8488('0x14')](_0x8488('0x11'),_0x1334fe,_0x514c31);_0x515ea8(_0x514c31);});});}exports[_0x8488('0x1a')]=function(_0x3dd93e){var _0x554ec6=this;return new Promise(function(_0x4a1b45,_0x340d6b){return db[_0x8488('0x1b')][_0x8488('0x1c')](_0x3dd93e[_0x8488('0x1d')],{'raw':_0x3dd93e[_0x8488('0x1e')]?_0x3dd93e[_0x8488('0x1e')][_0x8488('0x1f')]===undefined?!![]:![]:!![]})[_0x8488('0xf')](function(_0x39dd43){logger['info'](_0x8488('0x1a'),_0x3dd93e);logger[_0x8488('0x12')](_0x8488('0x1a'),_0x3dd93e,JSON[_0x8488('0x20')](_0x39dd43));_0x4a1b45(_0x39dd43);})[_0x8488('0x19')](function(_0x54ecda){logger['error']('CreateMailMessage',_0x54ecda['message'],_0x3dd93e);_0x340d6b(_0x554ec6[_0x8488('0x14')](0x1f4,_0x54ecda['message']));});});}; \ No newline at end of file +var _0xb44a=['then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateMailMessage','MailMessage','body','options','raw','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register'];(function(_0x4a1303,_0x4660ed){var _0x493775=function(_0x3b9881){while(--_0x3b9881){_0x4a1303['push'](_0x4a1303['shift']());}};_0x493775(++_0x4660ed);}(_0xb44a,0x1c2));var _0xab44=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xb44a[_0x491a7f];return _0x3d8f44;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab44('0x0'));var BPromise=require('bluebird');var rs=require(_0xab44('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab44('0x2'));var logger=require('../../config/logger')(_0xab44('0x3'));var config=require(_0xab44('0x4'));var jayson=require(_0xab44('0x5'));var client=jayson[_0xab44('0x6')][_0xab44('0x7')]({'port':0x232a});config[_0xab44('0x8')]=_[_0xab44('0x9')](config[_0xab44('0x8')],{'host':_0xab44('0xa'),'port':0x18eb});var socket=require(_0xab44('0xb'))(new Redis(config[_0xab44('0x8')]));require(_0xab44('0xc'))[_0xab44('0xd')](socket);function respondWithRpcPromise(_0x55c7d2,_0x2a670e,_0x500a9f){return new BPromise(function(_0x15e64e,_0x5168fa){return client['request'](_0x55c7d2,_0x500a9f)[_0xab44('0xe')](function(_0x6746cc){logger[_0xab44('0xf')](_0xab44('0x10'),_0x2a670e,_0xab44('0x11'));logger[_0xab44('0x12')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2a670e,'request\x20sent',JSON[_0xab44('0x13')](_0x6746cc));if(_0x6746cc['error']){if(_0x6746cc[_0xab44('0x14')]['code']===0x1f4){logger[_0xab44('0x14')](_0xab44('0x10'),_0x2a670e,_0x6746cc[_0xab44('0x14')][_0xab44('0x15')]);return _0x5168fa(_0x6746cc[_0xab44('0x14')][_0xab44('0x15')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x2a670e,_0x6746cc[_0xab44('0x14')][_0xab44('0x15')]);return _0x15e64e(_0x6746cc[_0xab44('0x14')][_0xab44('0x15')]);}else{logger[_0xab44('0xf')](_0xab44('0x10'),_0x2a670e,_0xab44('0x11'));_0x15e64e(_0x6746cc[_0xab44('0x16')][_0xab44('0x15')]);}})[_0xab44('0x17')](function(_0x27fc7f){logger['error'](_0xab44('0x10'),_0x2a670e,_0x27fc7f);_0x5168fa(_0x27fc7f);});});}exports[_0xab44('0x18')]=function(_0x101a1b){var _0x2902ca=this;return new Promise(function(_0x29bb73,_0x5123b1){return db[_0xab44('0x19')]['create'](_0x101a1b[_0xab44('0x1a')],{'raw':_0x101a1b[_0xab44('0x1b')]?_0x101a1b[_0xab44('0x1b')][_0xab44('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x3a2b1d){logger[_0xab44('0xf')](_0xab44('0x18'),_0x101a1b);logger[_0xab44('0x12')](_0xab44('0x18'),_0x101a1b,JSON[_0xab44('0x13')](_0x3a2b1d));_0x29bb73(_0x3a2b1d);})[_0xab44('0x17')](function(_0x554955){logger['error'](_0xab44('0x18'),_0x554955['message'],_0x101a1b);_0x5123b1(_0x2902ca[_0xab44('0x14')](0x1f4,_0x554955['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 1d65d9a..2bae94a 100644 --- a/server/api/mailMessage/mailMessage.socket.js +++ b/server/api/mailMessage/mailMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7aa=['mailMessage:','save','remove','update'];(function(_0x40d627,_0x1276e4){var _0x4c3ab7=function(_0x55e71c){while(--_0x55e71c){_0x40d627['push'](_0x40d627['shift']());}};_0x4c3ab7(++_0x1276e4);}(_0xa7aa,0x8d));var _0xaa7a=function(_0x117ec3,_0x4cff4b){_0x117ec3=_0x117ec3-0x0;var _0x1a2e59=_0xa7aa[_0x117ec3];return _0x1a2e59;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xaa7a('0x0'),_0xaa7a('0x1'),_0xaa7a('0x2')];function createListener(_0x40303d,_0x23fcbd){return function(_0x252dc2){_0x23fcbd['emit'](_0x40303d,_0x252dc2);};}function removeListener(_0x53edc8,_0x428169){return function(){MailMessageEvents['removeListener'](_0x53edc8,_0x428169);};}exports['register']=function(_0x5675f3){for(var _0x4159ec=0x0,_0x4e5615=events['length'];_0x4159ec<_0x4e5615;_0x4159ec++){var _0xc1585f=events[_0x4159ec];var _0x2d77b3=createListener(_0xaa7a('0x3')+_0xc1585f,_0x5675f3);MailMessageEvents['on'](_0xc1585f,_0x2d77b3);}}; \ No newline at end of file +var _0x11f7=['emit','removeListener','mailMessage:','save','update'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x11f7,0xda));var _0x711f=function(_0x137e24,_0x3a0b1c){_0x137e24=_0x137e24-0x0;var _0x2bb1e7=_0x11f7[_0x137e24];return _0x2bb1e7;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x711f('0x0'),'remove',_0x711f('0x1')];function createListener(_0xd7c148,_0xbc5be8){return function(_0x5827de){_0xbc5be8[_0x711f('0x2')](_0xd7c148,_0x5827de);};}function removeListener(_0x5bf289,_0x59a5ae){return function(){MailMessageEvents[_0x711f('0x3')](_0x5bf289,_0x59a5ae);};}exports['register']=function(_0x4d8a3c){for(var _0x3e2520=0x0,_0x2bea7c=events['length'];_0x3e2520<_0x2bea7c;_0x3e2520++){var _0x374458=events[_0x3e2520];var _0x26b15d=createListener(_0x711f('0x4')+_0x374458,_0x4d8a3c);MailMessageEvents['on'](_0x374458,_0x26b15d);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index bf55c89..78cbf23 100644 --- a/server/api/mailQueue/index.js +++ b/server/api/mailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2512=['index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeTeams','removeAgents','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated'];(function(_0x4a6a4c,_0x5149d1){var _0xdb0e5b=function(_0x319640){while(--_0x319640){_0x4a6a4c['push'](_0x4a6a4c['shift']());}};_0xdb0e5b(++_0x5149d1);}(_0x2512,0xa9));var _0x2251=function(_0x3a351d,_0x5bb577){_0x3a351d=_0x3a351d-0x0;var _0x370d12=_0x2512[_0x3a351d];return _0x370d12;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2251('0x0'));var timeout=require(_0x2251('0x1'));var express=require(_0x2251('0x2'));var router=express[_0x2251('0x3')]();var fs_extra=require(_0x2251('0x4'));var auth=require(_0x2251('0x5'));var interaction=require(_0x2251('0x6'));var config=require(_0x2251('0x7'));var controller=require(_0x2251('0x8'));router[_0x2251('0x9')]('/',auth[_0x2251('0xa')](),controller[_0x2251('0xb')]);router['get'](_0x2251('0xc'),auth[_0x2251('0xa')](),controller[_0x2251('0xd')]);router[_0x2251('0x9')](_0x2251('0xe'),auth[_0x2251('0xa')](),controller[_0x2251('0xf')]);router[_0x2251('0x9')]('/:id/members',auth[_0x2251('0xa')](),controller[_0x2251('0x10')]);router[_0x2251('0x9')](_0x2251('0x11'),auth[_0x2251('0xa')](),controller[_0x2251('0x12')]);router[_0x2251('0x9')](_0x2251('0x13'),auth[_0x2251('0xa')](),controller[_0x2251('0x14')]);router[_0x2251('0x15')]('/',auth[_0x2251('0xa')](),controller[_0x2251('0x16')]);router[_0x2251('0x15')](_0x2251('0x11'),auth[_0x2251('0xa')](),controller['addTeams']);router[_0x2251('0x15')](_0x2251('0x13'),auth[_0x2251('0xa')](),controller[_0x2251('0x17')]);router[_0x2251('0x18')]('/:id',auth[_0x2251('0xa')](),controller[_0x2251('0x19')]);router[_0x2251('0x1a')](_0x2251('0xe'),auth[_0x2251('0xa')](),controller[_0x2251('0x1b')]);router[_0x2251('0x1a')](_0x2251('0x11'),auth['isAuthenticated'](),controller[_0x2251('0x1c')]);router['delete'](_0x2251('0x13'),auth[_0x2251('0xa')](),controller[_0x2251('0x1d')]);module['exports']=router; \ No newline at end of file +var _0xaefd=['isAuthenticated','index','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0xaefd,0xa3));var _0xdaef=function(_0x5d6d7b,_0x5268bb){_0x5d6d7b=_0x5d6d7b-0x0;var _0x1691fe=_0xaefd[_0x5d6d7b];return _0x1691fe;};'use strict';var multer=require(_0xdaef('0x0'));var util=require(_0xdaef('0x1'));var path=require(_0xdaef('0x2'));var timeout=require('connect-timeout');var express=require(_0xdaef('0x3'));var router=express[_0xdaef('0x4')]();var fs_extra=require(_0xdaef('0x5'));var auth=require(_0xdaef('0x6'));var interaction=require(_0xdaef('0x7'));var config=require(_0xdaef('0x8'));var controller=require(_0xdaef('0x9'));router[_0xdaef('0xa')]('/',auth[_0xdaef('0xb')](),controller[_0xdaef('0xc')]);router[_0xdaef('0xa')]('/describe',auth[_0xdaef('0xb')](),controller['describe']);router[_0xdaef('0xa')](_0xdaef('0xd'),auth[_0xdaef('0xb')](),controller[_0xdaef('0xe')]);router[_0xdaef('0xa')](_0xdaef('0xf'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0xdaef('0x10'),auth[_0xdaef('0xb')](),controller['getTeams']);router['get'](_0xdaef('0x11'),auth['isAuthenticated'](),controller[_0xdaef('0x12')]);router[_0xdaef('0x13')]('/',auth['isAuthenticated'](),controller[_0xdaef('0x14')]);router['post'](_0xdaef('0x10'),auth[_0xdaef('0xb')](),controller[_0xdaef('0x15')]);router[_0xdaef('0x13')](_0xdaef('0x11'),auth[_0xdaef('0xb')](),controller[_0xdaef('0x16')]);router['put'](_0xdaef('0xd'),auth[_0xdaef('0xb')](),controller[_0xdaef('0x17')]);router[_0xdaef('0x18')](_0xdaef('0xd'),auth[_0xdaef('0xb')](),controller[_0xdaef('0x19')]);router[_0xdaef('0x18')](_0xdaef('0x10'),auth[_0xdaef('0xb')](),controller[_0xdaef('0x1a')]);router[_0xdaef('0x18')](_0xdaef('0x11'),auth[_0xdaef('0xb')](),controller[_0xdaef('0x1b')]);module[_0xdaef('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index bd54481..6d3d58f 100644 --- a/server/api/mailQueue/mailQueue.attributes.js +++ b/server/api/mailQueue/mailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9849=['roundrobin','exports','name','STRING','INTEGER','ENUM','beepall'];(function(_0x25fa5c,_0x421141){var _0x1bade2=function(_0x3faf20){while(--_0x3faf20){_0x25fa5c['push'](_0x25fa5c['shift']());}};_0x1bade2(++_0x421141);}(_0x9849,0x151));var _0x9984=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x9849[_0x1e3c16];return _0x47a0c9;};'use strict';var Sequelize=require('sequelize');module[_0x9984('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x9984('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9984('0x2')]},'timeout':{'type':Sequelize[_0x9984('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9984('0x4')]('rrmemory',_0x9984('0x5'),_0x9984('0x6'))}}; \ No newline at end of file +var _0x16b2=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','name'];(function(_0x2a4dda,_0x394a1b){var _0xe725e=function(_0x5c005c){while(--_0x5c005c){_0x2a4dda['push'](_0x2a4dda['shift']());}};_0xe725e(++_0x394a1b);}(_0x16b2,0x89));var _0x216b=function(_0x5c6022,_0x5cd10b){_0x5c6022=_0x5c6022-0x0;var _0x4ab5af=_0x16b2[_0x5c6022];return _0x4ab5af;};'use strict';var Sequelize=require(_0x216b('0x0'));module[_0x216b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x216b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x216b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x216b('0x4')](_0x216b('0x5'),_0x216b('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 19b24c9..4713e9f 100644 --- a/server/api/mailQueue/mailQueue.controller.js +++ b/server/api/mailQueue/mailQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fde=['pick','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','redis','./mailQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','then','destroy','get','error','name','send','index','map','MailQueue','key','getOptions','where','include','query','findAll','rows','catch','params','model','keys','rawAttributes','filters','intersection','fields','attributes','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','nolimit','order','sort','MailQueueId','filter','User','findAndCountAll','UserId','agent','createdAt','%s/%s','SIP','mailPause','updatedAt','getTeams','Team','addTeams','ids','online','interface','flatMap','sequelize','each','emit','userMailQueue:save','removeTeams','select','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','union','value','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents'];(function(_0x2d0716,_0x2b1a42){var _0x2567e2=function(_0x3a421e){while(--_0x3a421e){_0x2d0716['push'](_0x2d0716['shift']());}};_0x2567e2(++_0x2b1a42);}(_0x0fde,0x78));var _0xe0fd=function(_0x2688bb,_0x2ebb9c){_0x2688bb=_0x2688bb-0x0;var _0x417ae8=_0x0fde[_0x2688bb];return _0x417ae8;};'use strict';var BPromise=require(_0xe0fd('0x0'));var util=require(_0xe0fd('0x1'));var _=require(_0xe0fd('0x2'));var squel=require(_0xe0fd('0x3'));var Redis=require('ioredis');var qs=require(_0xe0fd('0x4'));var logger=require(_0xe0fd('0x5'))('api');var config=require(_0xe0fd('0x6'));var db=require(_0xe0fd('0x7'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe0fd('0x8'))(new Redis(config[_0xe0fd('0x9')]));require(_0xe0fd('0xa'))[_0xe0fd('0xb')](socket);function respondWithStatusCode(_0x1726b9,_0x147989){_0x147989=_0x147989||0xcc;return function(_0x104d07){if(_0x104d07){return _0x1726b9[_0xe0fd('0xc')](_0x147989);}return _0x1726b9['status'](_0x147989)['end']();};}function respondWithResult(_0xbac418,_0x444c68){_0x444c68=_0x444c68||0xc8;return function(_0x16afa0){if(_0x16afa0){return _0xbac418[_0xe0fd('0xd')](_0x444c68)[_0xe0fd('0xe')](_0x16afa0);}};}function respondWithFilteredResult(_0x5b83d5,_0xa87b13){return function(_0x2f8c3f){if(_0x2f8c3f){var _0x5588fb=typeof _0xa87b13['offset']===_0xe0fd('0xf')&&typeof _0xa87b13[_0xe0fd('0x10')]==='undefined';var _0x1c109e=_0x2f8c3f[_0xe0fd('0x11')];var _0x91b4d7=_0x5588fb?0x0:_0xa87b13[_0xe0fd('0x12')];var _0x307e05=_0x5588fb?_0x2f8c3f[_0xe0fd('0x11')]:_0xa87b13['offset']+_0xa87b13[_0xe0fd('0x10')];var _0xcd20a8;if(_0x307e05>=_0x1c109e){_0x307e05=_0x1c109e;_0xcd20a8=0xc8;}else{_0xcd20a8=0xce;}_0x5b83d5[_0xe0fd('0xd')](_0xcd20a8);return _0x5b83d5[_0xe0fd('0x13')](_0xe0fd('0x14'),_0x91b4d7+'-'+_0x307e05+'/'+_0x1c109e)[_0xe0fd('0xe')](_0x2f8c3f);}return null;};}function saveUpdates(_0x2b3374){return function(_0xc57379){if(_0xc57379){return _0xc57379['update'](_0x2b3374)[_0xe0fd('0x15')](function(_0x1797dc){return _0x1797dc;});}return null;};}function removeEntity(_0x25f0d9){return function(_0x2d3f2d){if(_0x2d3f2d){return _0x2d3f2d[_0xe0fd('0x16')]()[_0xe0fd('0x15')](function(){var _0xdeb2e1=_0x2d3f2d[_0xe0fd('0x17')]({'plain':!![]});var _0x503055='MailQueues';return db['UserProfileResource'][_0xe0fd('0x16')]({'where':{'type':_0x503055,'resourceId':_0xdeb2e1['id']}})[_0xe0fd('0x15')](function(){return _0x2d3f2d;});})[_0xe0fd('0x15')](function(){_0x25f0d9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x434524){return function(_0x167897){if(!_0x167897){_0x434524['sendStatus'](0x194);}return _0x167897;};}function handleError(_0x42ff3b,_0x352bdc){_0x352bdc=_0x352bdc||0x1f4;return function(_0x3976b9){logger[_0xe0fd('0x18')](_0x3976b9['stack']);if(_0x3976b9[_0xe0fd('0x19')]){delete _0x3976b9[_0xe0fd('0x19')];}_0x42ff3b['status'](_0x352bdc)[_0xe0fd('0x1a')](_0x3976b9);};}exports[_0xe0fd('0x1b')]=function(_0x1c9755,_0x1da6c3){var _0x88e0f0={};var _0x16ceca={'count':0x0,'rows':[]};var _0x529d13=_[_0xe0fd('0x1c')](db[_0xe0fd('0x1d')]['rawAttributes'],function(_0x464b06){return{'name':_0x464b06['fieldName'],'type':_0x464b06['type'][_0xe0fd('0x1e')]};});_0x88e0f0=qs[_0xe0fd('0x1f')](_0x529d13,_0x1c9755);var _0x4e5445={'where':_0x88e0f0[_0xe0fd('0x20')]};return db['MailQueue'][_0xe0fd('0x11')](_0x4e5445)[_0xe0fd('0x15')](function(_0x45948e){_0x16ceca[_0xe0fd('0x11')]=_0x45948e;_0x88e0f0[_0xe0fd('0x21')]=qs['include'](_0x1c9755[_0xe0fd('0x22')]);return db['MailQueue'][_0xe0fd('0x23')](_0x88e0f0);})[_0xe0fd('0x15')](function(_0x122be0){_0x16ceca[_0xe0fd('0x24')]=_0x122be0;return _0x16ceca;})[_0xe0fd('0x15')](respondWithFilteredResult(_0x1da6c3,_0x88e0f0))[_0xe0fd('0x25')](handleError(_0x1da6c3,null));};exports['show']=function(_0x165999,_0x14fc45){var _0x2b2d65={'raw':!![],'where':{'id':_0x165999[_0xe0fd('0x26')]['id']}},_0x283257={};_0x283257[_0xe0fd('0x27')]=_[_0xe0fd('0x28')](db[_0xe0fd('0x1d')][_0xe0fd('0x29')]);_0x283257['query']=_[_0xe0fd('0x28')](_0x165999['query']);_0x283257[_0xe0fd('0x2a')]=_[_0xe0fd('0x2b')](_0x283257[_0xe0fd('0x27')],_0x283257['query']);_0x2b2d65['attributes']=_[_0xe0fd('0x2b')](_0x283257[_0xe0fd('0x27')],qs[_0xe0fd('0x2c')](_0x165999[_0xe0fd('0x22')][_0xe0fd('0x2c')]));_0x2b2d65[_0xe0fd('0x2d')]=_0x2b2d65['attributes'][_0xe0fd('0x2e')]?_0x2b2d65[_0xe0fd('0x2d')]:_0x283257[_0xe0fd('0x27')];if(_0x165999['query'][_0xe0fd('0x2f')]){_0x2b2d65[_0xe0fd('0x21')]=[{'all':!![]}];}_0x2b2d65=_[_0xe0fd('0x30')]({},_0x2b2d65,_0x165999[_0xe0fd('0x31')]);return db[_0xe0fd('0x1d')][_0xe0fd('0x32')](_0x2b2d65)['then'](handleEntityNotFound(_0x14fc45,null))['then'](respondWithResult(_0x14fc45,null))[_0xe0fd('0x25')](handleError(_0x14fc45,null));};exports[_0xe0fd('0x33')]=function(_0x1713d7,_0x5511b7){return db[_0xe0fd('0x1d')][_0xe0fd('0x33')](_0x1713d7[_0xe0fd('0x34')],{})[_0xe0fd('0x15')](function(_0x237626){var _0x127fbb=_0x1713d7[_0xe0fd('0x35')][_0xe0fd('0x17')]({'plain':!![]});if(!_0x127fbb)throw new Error(_0xe0fd('0x36'));if(_0x127fbb[_0xe0fd('0x37')]==='user'){var _0x17fb5d=_0x237626[_0xe0fd('0x17')]({'plain':!![]});var _0x4e594f=_0xe0fd('0x38');return db[_0xe0fd('0x39')][_0xe0fd('0x32')]({'where':{'name':_0x4e594f,'userProfileId':_0x127fbb['userProfileId']},'raw':!![]})[_0xe0fd('0x15')](function(_0x4fff91){if(_0x4fff91&&_0x4fff91[_0xe0fd('0x3a')]===0x0){return db[_0xe0fd('0x3b')][_0xe0fd('0x33')]({'name':_0x17fb5d['name'],'resourceId':_0x17fb5d['id'],'type':_0x4fff91[_0xe0fd('0x19')],'sectionId':_0x4fff91['id']},{})[_0xe0fd('0x15')](function(){return _0x237626;});}else{return _0x237626;}})[_0xe0fd('0x25')](function(_0x5d1179){logger[_0xe0fd('0x18')](_0xe0fd('0x3c'),_0x5d1179);throw _0x5d1179;});}return _0x237626;})[_0xe0fd('0x15')](respondWithResult(_0x5511b7,0xc9))[_0xe0fd('0x25')](handleError(_0x5511b7,null));};exports[_0xe0fd('0x3d')]=function(_0x38d764,_0x3f628d){if(_0x38d764[_0xe0fd('0x34')]['id']){delete _0x38d764[_0xe0fd('0x34')]['id'];}return db[_0xe0fd('0x1d')]['find']({'where':{'id':_0x38d764[_0xe0fd('0x26')]['id']}})[_0xe0fd('0x15')](handleEntityNotFound(_0x3f628d,null))['then'](saveUpdates(_0x38d764['body'],null))[_0xe0fd('0x15')](respondWithResult(_0x3f628d,null))[_0xe0fd('0x25')](handleError(_0x3f628d,null));};exports[_0xe0fd('0x16')]=function(_0x4e51d0,_0x5102ef){return db['MailQueue']['find']({'where':{'id':_0x4e51d0[_0xe0fd('0x26')]['id']}})['then'](handleEntityNotFound(_0x5102ef,null))[_0xe0fd('0x15')](removeEntity(_0x5102ef,null))['catch'](handleError(_0x5102ef,null));};exports[_0xe0fd('0x3e')]=function(_0x2c0558,_0x3b3204){return db[_0xe0fd('0x1d')]['describe']()['then'](respondWithResult(_0x3b3204,null))[_0xe0fd('0x25')](handleError(_0x3b3204,null));};exports[_0xe0fd('0x3f')]=function(_0x594aa3,_0x22af25){var _0x124e7f={'raw':!![],'where':{}},_0x196503={},_0x519d78;return db['MailQueue'][_0xe0fd('0x40')]({'where':{'id':_0x594aa3[_0xe0fd('0x26')]['id']}})[_0xe0fd('0x15')](handleEntityNotFound(_0x22af25,null))['then'](function(_0x35df18){if(_0x35df18){_0x519d78=_0x35df18[_0xe0fd('0x17')]({'plain':!![]});_0x196503[_0xe0fd('0x27')]=_['keys'](db[_0xe0fd('0x41')][_0xe0fd('0x29')]);_0x196503['query']=_['keys'](_0x594aa3[_0xe0fd('0x22')]);_0x196503[_0xe0fd('0x2a')]=_[_0xe0fd('0x2b')](_0x196503['model'],_0x196503[_0xe0fd('0x22')]);_0x124e7f[_0xe0fd('0x2d')]=_['intersection'](_0x196503['model'],qs[_0xe0fd('0x2c')](_0x594aa3[_0xe0fd('0x22')][_0xe0fd('0x2c')]));_0x124e7f[_0xe0fd('0x2d')]=_0x124e7f['attributes'][_0xe0fd('0x2e')]?_0x124e7f[_0xe0fd('0x2d')]:_0x196503[_0xe0fd('0x27')];if(!_0x594aa3[_0xe0fd('0x22')][_0xe0fd('0x42')](_0xe0fd('0x43'))){_0x124e7f[_0xe0fd('0x10')]=qs['limit'](_0x594aa3['query'][_0xe0fd('0x10')]);_0x124e7f['offset']=qs['offset'](_0x594aa3[_0xe0fd('0x22')]['offset']);}_0x124e7f[_0xe0fd('0x44')]=qs[_0xe0fd('0x45')](_0x594aa3[_0xe0fd('0x22')][_0xe0fd('0x45')]);_0x124e7f[_0xe0fd('0x20')]=qs['filters'](_['pick'](_0x594aa3[_0xe0fd('0x22')],_0x196503[_0xe0fd('0x2a')]));_0x124e7f['where'][_0xe0fd('0x46')]=_0x35df18['id'];if(_0x594aa3[_0xe0fd('0x22')][_0xe0fd('0x47')]){_0x124e7f[_0xe0fd('0x20')]=_[_0xe0fd('0x30')](_0x124e7f[_0xe0fd('0x20')],{'$or':_[_0xe0fd('0x1c')](_0x124e7f[_0xe0fd('0x2d')],function(_0x1e6627){var _0x570b2a={};_0x570b2a[_0x1e6627]={'$like':'%'+_0x594aa3[_0xe0fd('0x22')][_0xe0fd('0x47')]+'%'};return _0x570b2a;})});}_0x124e7f=_[_0xe0fd('0x30')]({},_0x124e7f,_0x594aa3[_0xe0fd('0x31')]);return db[_0xe0fd('0x41')][_0xe0fd('0x23')](_0x124e7f);}})[_0xe0fd('0x15')](function(_0x12d918){if(_0x12d918){return db[_0xe0fd('0x48')][_0xe0fd('0x49')]({'where':{'id':_[_0xe0fd('0x1c')](_0x12d918,_0xe0fd('0x4a')),'role':_0xe0fd('0x4b')},'attributes':['id','name','mailPause','updatedAt',_0xe0fd('0x4c')]});}})[_0xe0fd('0x15')](function(_0x3bad3f){if(_0x3bad3f){return{'count':_0x3bad3f[_0xe0fd('0x11')],'rows':_[_0xe0fd('0x1c')](_0x3bad3f[_0xe0fd('0x24')],function(_0x530fd4){return{'membername':_0x530fd4[_0xe0fd('0x19')],'UserId':_0x530fd4['id'],'queue_name':_0x519d78[_0xe0fd('0x19')],'MailQueueId':_0x519d78['id'],'interface':util['format'](_0xe0fd('0x4d'),_0xe0fd('0x4e'),_0x530fd4['name']),'penalty':0x0,'paused':_0x530fd4[_0xe0fd('0x4f')],'createdAt':_0x530fd4[_0xe0fd('0x4c')],'updatedAt':_0x530fd4[_0xe0fd('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe0fd('0x15')](respondWithFilteredResult(_0x22af25,_0x124e7f))[_0xe0fd('0x25')](handleError(_0x22af25,null));};exports[_0xe0fd('0x51')]=function(_0x201256,_0x5bf4b4){var _0x58504c={};var _0x41486b={};var _0x56993e;var _0x2cd73f;return db[_0xe0fd('0x1d')]['findOne']({'where':{'id':_0x201256['params']['id']}})['then'](handleEntityNotFound(_0x5bf4b4,null))[_0xe0fd('0x15')](function(_0x3ef11a){if(_0x3ef11a){_0x56993e=_0x3ef11a;_0x41486b[_0xe0fd('0x27')]=_['keys'](db[_0xe0fd('0x52')][_0xe0fd('0x29')]);_0x41486b[_0xe0fd('0x22')]=_[_0xe0fd('0x28')](_0x201256[_0xe0fd('0x22')]);_0x41486b[_0xe0fd('0x2a')]=_[_0xe0fd('0x2b')](_0x41486b['model'],_0x41486b['query']);_0x58504c[_0xe0fd('0x2d')]=_[_0xe0fd('0x2b')](_0x41486b[_0xe0fd('0x27')],qs['fields'](_0x201256[_0xe0fd('0x22')][_0xe0fd('0x2c')]));_0x58504c[_0xe0fd('0x2d')]=_0x58504c['attributes'][_0xe0fd('0x2e')]?_0x58504c[_0xe0fd('0x2d')]:_0x41486b[_0xe0fd('0x27')];_0x58504c[_0xe0fd('0x44')]=qs[_0xe0fd('0x45')](_0x201256['query'][_0xe0fd('0x45')]);_0x58504c[_0xe0fd('0x20')]=qs[_0xe0fd('0x2a')](_['pick'](_0x201256[_0xe0fd('0x22')],_0x41486b[_0xe0fd('0x2a')]));if(_0x201256[_0xe0fd('0x22')]['filter']){_0x58504c[_0xe0fd('0x20')]=_[_0xe0fd('0x30')](_0x58504c['where'],{'$or':_['map'](_0x58504c[_0xe0fd('0x2d')],function(_0x52f541){var _0x2d49fe={};_0x2d49fe[_0x52f541]={'$like':'%'+_0x201256[_0xe0fd('0x22')][_0xe0fd('0x47')]+'%'};return _0x2d49fe;})});}_0x58504c=_[_0xe0fd('0x30')]({},_0x58504c,_0x201256[_0xe0fd('0x31')]);return _0x56993e[_0xe0fd('0x51')](_0x58504c);}})[_0xe0fd('0x15')](function(_0x28ba6c){if(_0x28ba6c){_0x2cd73f=_0x28ba6c[_0xe0fd('0x2e')];if(!_0x201256[_0xe0fd('0x22')][_0xe0fd('0x42')](_0xe0fd('0x43'))){_0x58504c[_0xe0fd('0x10')]=qs[_0xe0fd('0x10')](_0x201256[_0xe0fd('0x22')]['limit']);_0x58504c['offset']=qs[_0xe0fd('0x12')](_0x201256[_0xe0fd('0x22')]['offset']);}return _0x56993e['getTeams'](_0x58504c);}})[_0xe0fd('0x15')](function(_0x20871d){if(_0x20871d){return _0x20871d?{'count':_0x2cd73f,'rows':_0x20871d}:null;}})[_0xe0fd('0x15')](respondWithResult(_0x5bf4b4,null))[_0xe0fd('0x25')](handleError(_0x5bf4b4,null));};exports[_0xe0fd('0x53')]=function(_0x149ae4,_0x2f179d){var _0x250edf=_0x149ae4[_0xe0fd('0x34')][_0xe0fd('0x54')];return db[_0xe0fd('0x52')][_0xe0fd('0x23')]({'where':{'id':_0x250edf},'attributes':['id'],'include':[{'model':db[_0xe0fd('0x48')],'as':'Agents','attributes':['id',_0xe0fd('0x19'),_0xe0fd('0x55'),'voicePause',_0xe0fd('0x56')],'raw':!![]}]})[_0xe0fd('0x15')](function(_0xe0ed8d){if(_0xe0ed8d){var _0x5c8006=_[_0xe0fd('0x57')](_0xe0ed8d,function(_0x9013c4){var _0x2d0f17=_0x9013c4[_0xe0fd('0x17')]({'plain':!![]});return _0x2d0f17['Agents'];});return db['MailQueue']['find']({'where':{'id':_0x149ae4[_0xe0fd('0x26')]['id']}})[_0xe0fd('0x15')](function(_0x288a68){return db[_0xe0fd('0x58')]['transaction'](function(_0x34c2da){return _0x288a68[_0xe0fd('0x53')](_0x250edf,{'transaction':_0x34c2da})[_0xe0fd('0x15')](function(){return BPromise[_0xe0fd('0x59')](_0x5c8006,function(_0x2f4195){return db[_0xe0fd('0x41')]['findOrCreate']({'where':{'UserId':_0x2f4195['id'],'MailQueueId':_0x149ae4[_0xe0fd('0x26')]['id']},'transaction':_0x34c2da});});})[_0xe0fd('0x15')](function(){_0x5c8006['forEach'](function(_0x1ceefb){socket[_0xe0fd('0x5a')](_0xe0fd('0x5b'),{'UserId':_0x1ceefb['id'],'MailQueueId':_0x288a68['id']});});});});});}})[_0xe0fd('0x15')](respondWithStatusCode(_0x2f179d,null))[_0xe0fd('0x25')](handleError(_0x2f179d,null));};exports[_0xe0fd('0x5c')]=function(_0x492246,_0x2bcb64){return db['Team'][_0xe0fd('0x23')]({'where':{'id':_0x492246[_0xe0fd('0x22')][_0xe0fd('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe0fd('0x15')](handleEntityNotFound(_0x2bcb64,null))[_0xe0fd('0x15')](function(_0x3c0a89){var _0x24fe08=_['map'](_0x3c0a89,'id');var _0x20b701=[];var _0x3fd833=[];var _0x5a7ce3=squel[_0xe0fd('0x5d')]();_0x5a7ce3['field']('tq.TeamId')[_0xe0fd('0x5e')](_0xe0fd('0x5f'),'tq')[_0xe0fd('0x60')](_0xe0fd('0x61'),'ut',_0xe0fd('0x62'))[_0xe0fd('0x20')](_0xe0fd('0x63'),_0x492246['params']['id']);for(var _0x838631=0x0;_0x838631<_0x3c0a89['length'];_0x838631+=0x1){let _0x275253=_0x3c0a89[_0x838631];for(var _0xe82bd4=0x0;_0xe82bd4<_0x275253['Agents'][_0xe0fd('0x2e')];_0xe82bd4+=0x1){let _0x2f5469=_0x275253['Agents'][_0xe82bd4];var _0x3893d2=_0x5a7ce3[_0xe0fd('0x64')]();_0x3893d2[_0xe0fd('0x20')](_0xe0fd('0x65'),_0x2f5469['id']);_0x3fd833['push'](db[_0xe0fd('0x58')][_0xe0fd('0x22')](_0x3893d2[_0xe0fd('0x66')](),{'type':db[_0xe0fd('0x58')][_0xe0fd('0x67')][_0xe0fd('0x68')]})[_0xe0fd('0x15')](function(_0x219c2e){if(_0x219c2e[_0xe0fd('0x2e')]===0x1){return _0x2f5469['id'];}else{var _0x379d92=_['every'](_['map'](_0x219c2e,_0xe0fd('0x69')),function(_0x56bbfd){return _[_0xe0fd('0x6a')](_0x24fe08,_0x56bbfd);});if(_0x379d92){return _0x2f5469['id'];}}}));}}return BPromise['all'](_0x3fd833)[_0xe0fd('0x15')](function(_0x40ed1e){_0x20b701=_(_0x20b701)[_0xe0fd('0x6b')](_0x40ed1e)['compact']()[_0xe0fd('0x6c')]();return db[_0xe0fd('0x1d')]['find']({'where':{'id':_0x492246['params']['id']}})[_0xe0fd('0x15')](function(_0x5e379f){return db['sequelize']['transaction'](function(_0x5cfe4d){return _0x5e379f[_0xe0fd('0x5c')](_0x492246[_0xe0fd('0x22')]['ids'],{'transaction':_0x5cfe4d})[_0xe0fd('0x15')](function(){if(!_[_0xe0fd('0x6d')](_0x20b701)){return _0x5e379f[_0xe0fd('0x6e')](_0x20b701,{'transaction':_0x5cfe4d});}})[_0xe0fd('0x15')](function(){_0x20b701[_0xe0fd('0x6f')](function(_0x29105f){socket[_0xe0fd('0x5a')](_0xe0fd('0x70'),{'UserId':_0x29105f,'MailQueueId':_0x5e379f['id']});});});});});});})[_0xe0fd('0x15')](respondWithStatusCode(_0x2bcb64,null))[_0xe0fd('0x25')](handleError(_0x2bcb64,null));};exports[_0xe0fd('0x71')]=function(_0x270bb2,_0x3809ad){return db['MailQueue'][_0xe0fd('0x32')]({'where':{'id':_0x270bb2[_0xe0fd('0x26')]['id']}})[_0xe0fd('0x15')](handleEntityNotFound(_0x3809ad,null))[_0xe0fd('0x15')](function(_0xd2f4c4){if(_0xd2f4c4){return _0xd2f4c4[_0xe0fd('0x71')](_0x270bb2[_0xe0fd('0x34')]['ids'],_[_0xe0fd('0x72')](_0x270bb2[_0xe0fd('0x34')],[_0xe0fd('0x54'),'id'])||{})[_0xe0fd('0x73')](function(_0x467526){for(var _0x1a9aaf=0x0;_0x1a9aaf<_0x270bb2[_0xe0fd('0x34')][_0xe0fd('0x54')][_0xe0fd('0x2e')];_0x1a9aaf+=0x1){socket[_0xe0fd('0x5a')](_0xe0fd('0x5b'),{'UserId':Number(_0x270bb2[_0xe0fd('0x34')]['ids'][_0x1a9aaf]),'MailQueueId':Number(_0x270bb2['params']['id'])});}return _0x467526;});}})[_0xe0fd('0x15')](respondWithResult(_0x3809ad,null))['catch'](handleError(_0x3809ad,null));};exports[_0xe0fd('0x6e')]=function(_0x450338,_0x53158f){return db[_0xe0fd('0x1d')][_0xe0fd('0x32')]({'where':{'id':_0x450338[_0xe0fd('0x26')]['id']}})[_0xe0fd('0x15')](handleEntityNotFound(_0x53158f,null))[_0xe0fd('0x15')](function(_0x404c1c){if(_0x404c1c){return _0x404c1c[_0xe0fd('0x6e')](_0x450338[_0xe0fd('0x22')][_0xe0fd('0x54')])[_0xe0fd('0x15')](function(){if(_[_0xe0fd('0x74')](_0x450338[_0xe0fd('0x22')]['ids'])){for(var _0x1366cd=0x0;_0x1366cd<_0x450338[_0xe0fd('0x22')][_0xe0fd('0x54')][_0xe0fd('0x2e')];_0x1366cd+=0x1){socket[_0xe0fd('0x5a')](_0xe0fd('0x70'),{'UserId':Number(_0x450338[_0xe0fd('0x22')][_0xe0fd('0x54')][_0x1366cd]),'MailQueueId':Number(_0x450338['params']['id'])});}}else{socket['emit'](_0xe0fd('0x70'),{'UserId':Number(_0x450338[_0xe0fd('0x22')][_0xe0fd('0x54')]),'MailQueueId':Number(_0x450338[_0xe0fd('0x26')]['id'])});}});}})[_0xe0fd('0x15')](respondWithStatusCode(_0x53158f,null))[_0xe0fd('0x25')](handleError(_0x53158f,null));};exports[_0xe0fd('0x75')]=function(_0x12797b,_0x4c942c){var _0x1a66c5={};var _0x39d27e={};var _0x5b5335;var _0x1d7306;return db[_0xe0fd('0x1d')][_0xe0fd('0x40')]({'where':{'id':_0x12797b[_0xe0fd('0x26')]['id']}})[_0xe0fd('0x15')](handleEntityNotFound(_0x4c942c,null))[_0xe0fd('0x15')](function(_0x23add4){if(_0x23add4){_0x5b5335=_0x23add4;_0x39d27e[_0xe0fd('0x27')]=_[_0xe0fd('0x28')](db[_0xe0fd('0x48')]['rawAttributes']);_0x39d27e[_0xe0fd('0x22')]=_['keys'](_0x12797b[_0xe0fd('0x22')]);_0x39d27e[_0xe0fd('0x2a')]=_['intersection'](_0x39d27e[_0xe0fd('0x27')],_0x39d27e['query']);_0x1a66c5['attributes']=_[_0xe0fd('0x2b')](_0x39d27e[_0xe0fd('0x27')],qs[_0xe0fd('0x2c')](_0x12797b[_0xe0fd('0x22')]['fields']));_0x1a66c5[_0xe0fd('0x2d')]=_0x1a66c5[_0xe0fd('0x2d')][_0xe0fd('0x2e')]?_0x1a66c5[_0xe0fd('0x2d')]:_0x39d27e[_0xe0fd('0x27')];_0x1a66c5[_0xe0fd('0x44')]=qs[_0xe0fd('0x45')](_0x12797b['query']['sort']);_0x1a66c5['where']=qs[_0xe0fd('0x2a')](_[_0xe0fd('0x76')](_0x12797b[_0xe0fd('0x22')],_0x39d27e[_0xe0fd('0x2a')]));if(_0x12797b[_0xe0fd('0x22')][_0xe0fd('0x47')]){_0x1a66c5['where']=_[_0xe0fd('0x30')](_0x1a66c5[_0xe0fd('0x20')],{'$or':_['map'](_0x1a66c5[_0xe0fd('0x2d')],function(_0x210a71){var _0x283e7a={};_0x283e7a[_0x210a71]={'$like':'%'+_0x12797b[_0xe0fd('0x22')][_0xe0fd('0x47')]+'%'};return _0x283e7a;})});}_0x1a66c5=_[_0xe0fd('0x30')]({},_0x1a66c5,_0x12797b[_0xe0fd('0x31')]);return _0x5b5335[_0xe0fd('0x75')](_0x1a66c5);}})['then'](function(_0x12213a){if(_0x12213a){_0x1d7306=_0x12213a[_0xe0fd('0x2e')];if(!_0x12797b['query']['hasOwnProperty']('nolimit')){_0x1a66c5['limit']=qs['limit'](_0x12797b['query'][_0xe0fd('0x10')]);_0x1a66c5['offset']=qs[_0xe0fd('0x12')](_0x12797b['query'][_0xe0fd('0x12')]);}return _0x5b5335[_0xe0fd('0x75')](_0x1a66c5);}})[_0xe0fd('0x15')](function(_0x4c7e24){if(_0x4c7e24){return _0x4c7e24?{'count':_0x1d7306,'rows':_0x4c7e24}:null;}})[_0xe0fd('0x15')](respondWithResult(_0x4c942c,null))[_0xe0fd('0x25')](handleError(_0x4c942c,null));}; \ No newline at end of file +var _0xd2c8=['catch','show','keys','filters','intersection','model','fields','attributes','length','includeAll','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserMailQueue','nolimit','order','sort','MailQueueId','filter','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','mailPause','getTeams','pick','addTeams','ids','Team','Agents','voicePause','sequelize','transaction','each','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','MailQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','all','union','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray','getAgents','hasOwnProperty','util','squel','ioredis','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','update','destroy','then','get','MailQueues','UserProfileResource','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','key','getOptions','where','include','query','findAll','rows'];(function(_0x113e32,_0x5339f0){var _0x4ff939=function(_0x2be9ca){while(--_0x2be9ca){_0x113e32['push'](_0x113e32['shift']());}};_0x4ff939(++_0x5339f0);}(_0xd2c8,0x1b7));var _0x8d2c=function(_0x11b64a,_0x2d722d){_0x11b64a=_0x11b64a-0x0;var _0x5d6a33=_0xd2c8[_0x11b64a];return _0x5d6a33;};'use strict';var BPromise=require('bluebird');var util=require(_0x8d2c('0x0'));var _=require('lodash');var squel=require(_0x8d2c('0x1'));var Redis=require(_0x8d2c('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x8d2c('0x3'));var config=require(_0x8d2c('0x4'));var db=require(_0x8d2c('0x5'))['db'];config[_0x8d2c('0x6')]=_['defaults'](config['redis'],{'host':_0x8d2c('0x7'),'port':0x18eb});var socket=require(_0x8d2c('0x8'))(new Redis(config['redis']));require(_0x8d2c('0x9'))['register'](socket);function respondWithStatusCode(_0x1ac0f2,_0x32f72e){_0x32f72e=_0x32f72e||0xcc;return function(_0x5a614a){if(_0x5a614a){return _0x1ac0f2[_0x8d2c('0xa')](_0x32f72e);}return _0x1ac0f2[_0x8d2c('0xb')](_0x32f72e)[_0x8d2c('0xc')]();};}function respondWithResult(_0x3d41e1,_0x103455){_0x103455=_0x103455||0xc8;return function(_0xbaee83){if(_0xbaee83){return _0x3d41e1[_0x8d2c('0xb')](_0x103455)[_0x8d2c('0xd')](_0xbaee83);}};}function respondWithFilteredResult(_0x547e43,_0x4f92f2){return function(_0x5e170f){if(_0x5e170f){var _0x10aa20=typeof _0x4f92f2[_0x8d2c('0xe')]===_0x8d2c('0xf')&&typeof _0x4f92f2['limit']==='undefined';var _0x27d9a0=_0x5e170f[_0x8d2c('0x10')];var _0x595a01=_0x10aa20?0x0:_0x4f92f2['offset'];var _0x94f461=_0x10aa20?_0x5e170f[_0x8d2c('0x10')]:_0x4f92f2['offset']+_0x4f92f2[_0x8d2c('0x11')];var _0x550cdd;if(_0x94f461>=_0x27d9a0){_0x94f461=_0x27d9a0;_0x550cdd=0xc8;}else{_0x550cdd=0xce;}_0x547e43['status'](_0x550cdd);return _0x547e43[_0x8d2c('0x12')]('Content-Range',_0x595a01+'-'+_0x94f461+'/'+_0x27d9a0)['json'](_0x5e170f);}return null;};}function saveUpdates(_0x3153f1){return function(_0xa3b0e8){if(_0xa3b0e8){return _0xa3b0e8[_0x8d2c('0x13')](_0x3153f1)['then'](function(_0x34b914){return _0x34b914;});}return null;};}function removeEntity(_0xefd7e0){return function(_0x5b4f9a){if(_0x5b4f9a){return _0x5b4f9a[_0x8d2c('0x14')]()[_0x8d2c('0x15')](function(){var _0x9c8e34=_0x5b4f9a[_0x8d2c('0x16')]({'plain':!![]});var _0x55afba=_0x8d2c('0x17');return db[_0x8d2c('0x18')][_0x8d2c('0x14')]({'where':{'type':_0x55afba,'resourceId':_0x9c8e34['id']}})[_0x8d2c('0x15')](function(){return _0x5b4f9a;});})[_0x8d2c('0x15')](function(){_0xefd7e0[_0x8d2c('0xb')](0xcc)[_0x8d2c('0xc')]();});}};}function handleEntityNotFound(_0x10e81e){return function(_0x31a109){if(!_0x31a109){_0x10e81e['sendStatus'](0x194);}return _0x31a109;};}function handleError(_0x450bc5,_0x27de3a){_0x27de3a=_0x27de3a||0x1f4;return function(_0x959de6){logger[_0x8d2c('0x19')](_0x959de6[_0x8d2c('0x1a')]);if(_0x959de6[_0x8d2c('0x1b')]){delete _0x959de6[_0x8d2c('0x1b')];}_0x450bc5[_0x8d2c('0xb')](_0x27de3a)[_0x8d2c('0x1c')](_0x959de6);};}exports[_0x8d2c('0x1d')]=function(_0x466478,_0x4b02d5){var _0x3fb93e={};var _0x376d2a={'count':0x0,'rows':[]};var _0x24bbe0=_[_0x8d2c('0x1e')](db[_0x8d2c('0x1f')][_0x8d2c('0x20')],function(_0x2ce8b3){return{'name':_0x2ce8b3[_0x8d2c('0x21')],'type':_0x2ce8b3['type'][_0x8d2c('0x22')]};});_0x3fb93e=qs[_0x8d2c('0x23')](_0x24bbe0,_0x466478);var _0xd606ae={'where':_0x3fb93e[_0x8d2c('0x24')]};return db[_0x8d2c('0x1f')]['count'](_0xd606ae)[_0x8d2c('0x15')](function(_0x110f24){_0x376d2a['count']=_0x110f24;_0x3fb93e[_0x8d2c('0x25')]=qs[_0x8d2c('0x25')](_0x466478[_0x8d2c('0x26')]);return db['MailQueue'][_0x8d2c('0x27')](_0x3fb93e);})[_0x8d2c('0x15')](function(_0x4e5c85){_0x376d2a[_0x8d2c('0x28')]=_0x4e5c85;return _0x376d2a;})['then'](respondWithFilteredResult(_0x4b02d5,_0x3fb93e))[_0x8d2c('0x29')](handleError(_0x4b02d5,null));};exports[_0x8d2c('0x2a')]=function(_0x129eb2,_0x148a3b){var _0x22dc31={'raw':!![],'where':{'id':_0x129eb2['params']['id']}},_0x20c66a={};_0x20c66a['model']=_['keys'](db[_0x8d2c('0x1f')]['rawAttributes']);_0x20c66a[_0x8d2c('0x26')]=_[_0x8d2c('0x2b')](_0x129eb2[_0x8d2c('0x26')]);_0x20c66a[_0x8d2c('0x2c')]=_[_0x8d2c('0x2d')](_0x20c66a[_0x8d2c('0x2e')],_0x20c66a[_0x8d2c('0x26')]);_0x22dc31['attributes']=_[_0x8d2c('0x2d')](_0x20c66a[_0x8d2c('0x2e')],qs[_0x8d2c('0x2f')](_0x129eb2[_0x8d2c('0x26')]['fields']));_0x22dc31[_0x8d2c('0x30')]=_0x22dc31[_0x8d2c('0x30')][_0x8d2c('0x31')]?_0x22dc31['attributes']:_0x20c66a['model'];if(_0x129eb2[_0x8d2c('0x26')][_0x8d2c('0x32')]){_0x22dc31[_0x8d2c('0x25')]=[{'all':!![]}];}_0x22dc31=_[_0x8d2c('0x33')]({},_0x22dc31,_0x129eb2[_0x8d2c('0x34')]);return db[_0x8d2c('0x1f')]['find'](_0x22dc31)[_0x8d2c('0x15')](handleEntityNotFound(_0x148a3b,null))[_0x8d2c('0x15')](respondWithResult(_0x148a3b,null))[_0x8d2c('0x29')](handleError(_0x148a3b,null));};exports[_0x8d2c('0x35')]=function(_0x39b044,_0xa45150){return db[_0x8d2c('0x1f')][_0x8d2c('0x35')](_0x39b044[_0x8d2c('0x36')],{})['then'](function(_0x62de10){var _0x519539=_0x39b044[_0x8d2c('0x37')][_0x8d2c('0x16')]({'plain':!![]});if(!_0x519539)throw new Error(_0x8d2c('0x38'));if(_0x519539[_0x8d2c('0x39')]===_0x8d2c('0x37')){var _0x3e37fe=_0x62de10['get']({'plain':!![]});var _0x332fce=_0x8d2c('0x17');return db[_0x8d2c('0x3a')][_0x8d2c('0x3b')]({'where':{'name':_0x332fce,'userProfileId':_0x519539[_0x8d2c('0x3c')]},'raw':!![]})[_0x8d2c('0x15')](function(_0x50a147){if(_0x50a147&&_0x50a147[_0x8d2c('0x3d')]===0x0){return db[_0x8d2c('0x18')][_0x8d2c('0x35')]({'name':_0x3e37fe[_0x8d2c('0x1b')],'resourceId':_0x3e37fe['id'],'type':_0x50a147[_0x8d2c('0x1b')],'sectionId':_0x50a147['id']},{})[_0x8d2c('0x15')](function(){return _0x62de10;});}else{return _0x62de10;}})[_0x8d2c('0x29')](function(_0x200e33){logger[_0x8d2c('0x19')](_0x8d2c('0x3e'),_0x200e33);throw _0x200e33;});}return _0x62de10;})[_0x8d2c('0x15')](respondWithResult(_0xa45150,0xc9))['catch'](handleError(_0xa45150,null));};exports['update']=function(_0x5ce4e7,_0x3c6f39){if(_0x5ce4e7[_0x8d2c('0x36')]['id']){delete _0x5ce4e7[_0x8d2c('0x36')]['id'];}return db[_0x8d2c('0x1f')][_0x8d2c('0x3b')]({'where':{'id':_0x5ce4e7[_0x8d2c('0x3f')]['id']}})[_0x8d2c('0x15')](handleEntityNotFound(_0x3c6f39,null))[_0x8d2c('0x15')](saveUpdates(_0x5ce4e7[_0x8d2c('0x36')],null))[_0x8d2c('0x15')](respondWithResult(_0x3c6f39,null))[_0x8d2c('0x29')](handleError(_0x3c6f39,null));};exports[_0x8d2c('0x14')]=function(_0x507448,_0x5c0c5c){return db[_0x8d2c('0x1f')][_0x8d2c('0x3b')]({'where':{'id':_0x507448[_0x8d2c('0x3f')]['id']}})[_0x8d2c('0x15')](handleEntityNotFound(_0x5c0c5c,null))['then'](removeEntity(_0x5c0c5c,null))[_0x8d2c('0x29')](handleError(_0x5c0c5c,null));};exports['describe']=function(_0x266437,_0x10e765){return db[_0x8d2c('0x1f')][_0x8d2c('0x40')]()['then'](respondWithResult(_0x10e765,null))[_0x8d2c('0x29')](handleError(_0x10e765,null));};exports[_0x8d2c('0x41')]=function(_0xad904e,_0x5d0378){var _0x553cd1={'raw':!![],'where':{}},_0x5bad93={},_0xe7220c;return db[_0x8d2c('0x1f')][_0x8d2c('0x42')]({'where':{'id':_0xad904e[_0x8d2c('0x3f')]['id']}})[_0x8d2c('0x15')](handleEntityNotFound(_0x5d0378,null))[_0x8d2c('0x15')](function(_0x84885a){if(_0x84885a){_0xe7220c=_0x84885a['get']({'plain':!![]});_0x5bad93['model']=_[_0x8d2c('0x2b')](db[_0x8d2c('0x43')][_0x8d2c('0x20')]);_0x5bad93[_0x8d2c('0x26')]=_[_0x8d2c('0x2b')](_0xad904e[_0x8d2c('0x26')]);_0x5bad93[_0x8d2c('0x2c')]=_[_0x8d2c('0x2d')](_0x5bad93['model'],_0x5bad93[_0x8d2c('0x26')]);_0x553cd1[_0x8d2c('0x30')]=_[_0x8d2c('0x2d')](_0x5bad93[_0x8d2c('0x2e')],qs['fields'](_0xad904e[_0x8d2c('0x26')]['fields']));_0x553cd1['attributes']=_0x553cd1[_0x8d2c('0x30')][_0x8d2c('0x31')]?_0x553cd1[_0x8d2c('0x30')]:_0x5bad93['model'];if(!_0xad904e[_0x8d2c('0x26')]['hasOwnProperty'](_0x8d2c('0x44'))){_0x553cd1[_0x8d2c('0x11')]=qs['limit'](_0xad904e[_0x8d2c('0x26')]['limit']);_0x553cd1[_0x8d2c('0xe')]=qs[_0x8d2c('0xe')](_0xad904e[_0x8d2c('0x26')]['offset']);}_0x553cd1[_0x8d2c('0x45')]=qs[_0x8d2c('0x46')](_0xad904e[_0x8d2c('0x26')][_0x8d2c('0x46')]);_0x553cd1[_0x8d2c('0x24')]=qs[_0x8d2c('0x2c')](_['pick'](_0xad904e[_0x8d2c('0x26')],_0x5bad93[_0x8d2c('0x2c')]));_0x553cd1[_0x8d2c('0x24')][_0x8d2c('0x47')]=_0x84885a['id'];if(_0xad904e[_0x8d2c('0x26')][_0x8d2c('0x48')]){_0x553cd1[_0x8d2c('0x24')]=_[_0x8d2c('0x33')](_0x553cd1[_0x8d2c('0x24')],{'$or':_[_0x8d2c('0x1e')](_0x553cd1[_0x8d2c('0x30')],function(_0x27ffab){var _0x4b9219={};_0x4b9219[_0x27ffab]={'$like':'%'+_0xad904e[_0x8d2c('0x26')]['filter']+'%'};return _0x4b9219;})});}_0x553cd1=_[_0x8d2c('0x33')]({},_0x553cd1,_0xad904e['options']);return db['UserMailQueue']['findAll'](_0x553cd1);}})[_0x8d2c('0x15')](function(_0x569c85){if(_0x569c85){return db['User'][_0x8d2c('0x49')]({'where':{'id':_[_0x8d2c('0x1e')](_0x569c85,_0x8d2c('0x4a')),'role':_0x8d2c('0x4b')},'attributes':['id','name','mailPause',_0x8d2c('0x4c'),_0x8d2c('0x4d')]});}})[_0x8d2c('0x15')](function(_0x300e26){if(_0x300e26){return{'count':_0x300e26[_0x8d2c('0x10')],'rows':_[_0x8d2c('0x1e')](_0x300e26[_0x8d2c('0x28')],function(_0x1940f7){return{'membername':_0x1940f7['name'],'UserId':_0x1940f7['id'],'queue_name':_0xe7220c[_0x8d2c('0x1b')],'MailQueueId':_0xe7220c['id'],'interface':util[_0x8d2c('0x4e')](_0x8d2c('0x4f'),'SIP',_0x1940f7[_0x8d2c('0x1b')]),'penalty':0x0,'paused':_0x1940f7[_0x8d2c('0x50')],'createdAt':_0x1940f7['createdAt'],'updatedAt':_0x1940f7[_0x8d2c('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8d2c('0x15')](respondWithFilteredResult(_0x5d0378,_0x553cd1))[_0x8d2c('0x29')](handleError(_0x5d0378,null));};exports[_0x8d2c('0x51')]=function(_0x3fd832,_0x53cce8){var _0x1da148={};var _0x4c796f={};var _0x2f02d7;var _0xae0799;return db[_0x8d2c('0x1f')][_0x8d2c('0x42')]({'where':{'id':_0x3fd832['params']['id']}})[_0x8d2c('0x15')](handleEntityNotFound(_0x53cce8,null))[_0x8d2c('0x15')](function(_0x2040c6){if(_0x2040c6){_0x2f02d7=_0x2040c6;_0x4c796f[_0x8d2c('0x2e')]=_[_0x8d2c('0x2b')](db['Team']['rawAttributes']);_0x4c796f[_0x8d2c('0x26')]=_['keys'](_0x3fd832[_0x8d2c('0x26')]);_0x4c796f[_0x8d2c('0x2c')]=_[_0x8d2c('0x2d')](_0x4c796f['model'],_0x4c796f['query']);_0x1da148[_0x8d2c('0x30')]=_[_0x8d2c('0x2d')](_0x4c796f[_0x8d2c('0x2e')],qs['fields'](_0x3fd832[_0x8d2c('0x26')][_0x8d2c('0x2f')]));_0x1da148['attributes']=_0x1da148[_0x8d2c('0x30')][_0x8d2c('0x31')]?_0x1da148[_0x8d2c('0x30')]:_0x4c796f['model'];_0x1da148[_0x8d2c('0x45')]=qs[_0x8d2c('0x46')](_0x3fd832['query'][_0x8d2c('0x46')]);_0x1da148[_0x8d2c('0x24')]=qs[_0x8d2c('0x2c')](_[_0x8d2c('0x52')](_0x3fd832[_0x8d2c('0x26')],_0x4c796f[_0x8d2c('0x2c')]));if(_0x3fd832[_0x8d2c('0x26')][_0x8d2c('0x48')]){_0x1da148[_0x8d2c('0x24')]=_[_0x8d2c('0x33')](_0x1da148[_0x8d2c('0x24')],{'$or':_[_0x8d2c('0x1e')](_0x1da148['attributes'],function(_0x1cfc66){var _0x44da42={};_0x44da42[_0x1cfc66]={'$like':'%'+_0x3fd832[_0x8d2c('0x26')][_0x8d2c('0x48')]+'%'};return _0x44da42;})});}_0x1da148=_[_0x8d2c('0x33')]({},_0x1da148,_0x3fd832[_0x8d2c('0x34')]);return _0x2f02d7[_0x8d2c('0x51')](_0x1da148);}})['then'](function(_0x30d9ec){if(_0x30d9ec){_0xae0799=_0x30d9ec[_0x8d2c('0x31')];if(!_0x3fd832['query']['hasOwnProperty'](_0x8d2c('0x44'))){_0x1da148[_0x8d2c('0x11')]=qs[_0x8d2c('0x11')](_0x3fd832['query'][_0x8d2c('0x11')]);_0x1da148[_0x8d2c('0xe')]=qs['offset'](_0x3fd832['query'][_0x8d2c('0xe')]);}return _0x2f02d7[_0x8d2c('0x51')](_0x1da148);}})[_0x8d2c('0x15')](function(_0x194184){if(_0x194184){return _0x194184?{'count':_0xae0799,'rows':_0x194184}:null;}})[_0x8d2c('0x15')](respondWithResult(_0x53cce8,null))['catch'](handleError(_0x53cce8,null));};exports[_0x8d2c('0x53')]=function(_0x47e09e,_0xf894f){var _0xa3cda7=_0x47e09e['body'][_0x8d2c('0x54')];return db[_0x8d2c('0x55')]['findAll']({'where':{'id':_0xa3cda7},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8d2c('0x56'),'attributes':['id',_0x8d2c('0x1b'),'online',_0x8d2c('0x57'),'interface'],'raw':!![]}]})[_0x8d2c('0x15')](function(_0x441db8){if(_0x441db8){var _0x19ebfb=_['flatMap'](_0x441db8,function(_0x3599a8){var _0x3d3755=_0x3599a8['get']({'plain':!![]});return _0x3d3755[_0x8d2c('0x56')];});return db[_0x8d2c('0x1f')][_0x8d2c('0x3b')]({'where':{'id':_0x47e09e[_0x8d2c('0x3f')]['id']}})[_0x8d2c('0x15')](function(_0x3f3843){return db[_0x8d2c('0x58')][_0x8d2c('0x59')](function(_0x4e05d8){return _0x3f3843[_0x8d2c('0x53')](_0xa3cda7,{'transaction':_0x4e05d8})[_0x8d2c('0x15')](function(){return BPromise[_0x8d2c('0x5a')](_0x19ebfb,function(_0xc9b386){return db[_0x8d2c('0x43')][_0x8d2c('0x5b')]({'where':{'UserId':_0xc9b386['id'],'MailQueueId':_0x47e09e[_0x8d2c('0x3f')]['id']},'transaction':_0x4e05d8});});})['then'](function(){_0x19ebfb[_0x8d2c('0x5c')](function(_0x56bebb){socket['emit']('userMailQueue:save',{'UserId':_0x56bebb['id'],'MailQueueId':_0x3f3843['id']});});});});});}})[_0x8d2c('0x15')](respondWithStatusCode(_0xf894f,null))[_0x8d2c('0x29')](handleError(_0xf894f,null));};exports[_0x8d2c('0x5d')]=function(_0x48dd81,_0x54a72d){return db[_0x8d2c('0x55')][_0x8d2c('0x27')]({'where':{'id':_0x48dd81[_0x8d2c('0x26')][_0x8d2c('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8d2c('0x56'),'attributes':['id'],'raw':!![]}]})[_0x8d2c('0x15')](handleEntityNotFound(_0x54a72d,null))[_0x8d2c('0x15')](function(_0x12e746){var _0x119503=_[_0x8d2c('0x1e')](_0x12e746,'id');var _0x1a8b9a=[];var _0x4704e7=[];var _0x41986a=squel[_0x8d2c('0x5e')]();_0x41986a[_0x8d2c('0x5f')](_0x8d2c('0x60'))[_0x8d2c('0x61')]('team_has_mail_queues','tq')[_0x8d2c('0x62')](_0x8d2c('0x63'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x8d2c('0x24')](_0x8d2c('0x64'),_0x48dd81['params']['id']);for(var _0x4b07d3=0x0;_0x4b07d3<_0x12e746[_0x8d2c('0x31')];_0x4b07d3+=0x1){let _0x476ca9=_0x12e746[_0x4b07d3];for(var _0x3fd413=0x0;_0x3fd413<_0x476ca9[_0x8d2c('0x56')][_0x8d2c('0x31')];_0x3fd413+=0x1){let _0x450f2e=_0x476ca9[_0x8d2c('0x56')][_0x3fd413];var _0x5a33e2=_0x41986a[_0x8d2c('0x65')]();_0x5a33e2[_0x8d2c('0x24')]('ut.UserId\x20=\x20?',_0x450f2e['id']);_0x4704e7[_0x8d2c('0x66')](db['sequelize'][_0x8d2c('0x26')](_0x5a33e2[_0x8d2c('0x67')](),{'type':db[_0x8d2c('0x58')][_0x8d2c('0x68')][_0x8d2c('0x69')]})['then'](function(_0x138186){if(_0x138186[_0x8d2c('0x31')]===0x1){return _0x450f2e['id'];}else{var _0x58ece0=_[_0x8d2c('0x6a')](_[_0x8d2c('0x1e')](_0x138186,'TeamId'),function(_0x5a239d){return _['includes'](_0x119503,_0x5a239d);});if(_0x58ece0){return _0x450f2e['id'];}}}));}}return BPromise[_0x8d2c('0x6b')](_0x4704e7)[_0x8d2c('0x15')](function(_0x14fe27){_0x1a8b9a=_(_0x1a8b9a)[_0x8d2c('0x6c')](_0x14fe27)['compact']()['value']();return db['MailQueue'][_0x8d2c('0x3b')]({'where':{'id':_0x48dd81[_0x8d2c('0x3f')]['id']}})[_0x8d2c('0x15')](function(_0x3f1895){return db[_0x8d2c('0x58')][_0x8d2c('0x59')](function(_0xf3652a){return _0x3f1895['removeTeams'](_0x48dd81[_0x8d2c('0x26')]['ids'],{'transaction':_0xf3652a})[_0x8d2c('0x15')](function(){if(!_[_0x8d2c('0x6d')](_0x1a8b9a)){return _0x3f1895[_0x8d2c('0x6e')](_0x1a8b9a,{'transaction':_0xf3652a});}})[_0x8d2c('0x15')](function(){_0x1a8b9a[_0x8d2c('0x5c')](function(_0x59937f){socket[_0x8d2c('0x6f')](_0x8d2c('0x70'),{'UserId':_0x59937f,'MailQueueId':_0x3f1895['id']});});});});});});})['then'](respondWithStatusCode(_0x54a72d,null))['catch'](handleError(_0x54a72d,null));};exports[_0x8d2c('0x71')]=function(_0x51e0fe,_0x3494f3){return db[_0x8d2c('0x1f')][_0x8d2c('0x3b')]({'where':{'id':_0x51e0fe[_0x8d2c('0x3f')]['id']}})[_0x8d2c('0x15')](handleEntityNotFound(_0x3494f3,null))[_0x8d2c('0x15')](function(_0x1d6408){if(_0x1d6408){return _0x1d6408[_0x8d2c('0x71')](_0x51e0fe['body'][_0x8d2c('0x54')],_[_0x8d2c('0x72')](_0x51e0fe[_0x8d2c('0x36')],[_0x8d2c('0x54'),'id'])||{})[_0x8d2c('0x73')](function(_0x5cef2a){for(var _0x20534b=0x0;_0x20534b<_0x51e0fe['body']['ids'][_0x8d2c('0x31')];_0x20534b+=0x1){socket[_0x8d2c('0x6f')](_0x8d2c('0x74'),{'UserId':Number(_0x51e0fe[_0x8d2c('0x36')][_0x8d2c('0x54')][_0x20534b]),'MailQueueId':Number(_0x51e0fe[_0x8d2c('0x3f')]['id'])});}return _0x5cef2a;});}})[_0x8d2c('0x15')](respondWithResult(_0x3494f3,null))[_0x8d2c('0x29')](handleError(_0x3494f3,null));};exports[_0x8d2c('0x6e')]=function(_0x4cae4c,_0x590dca){return db['MailQueue'][_0x8d2c('0x3b')]({'where':{'id':_0x4cae4c[_0x8d2c('0x3f')]['id']}})[_0x8d2c('0x15')](handleEntityNotFound(_0x590dca,null))[_0x8d2c('0x15')](function(_0x16b05d){if(_0x16b05d){return _0x16b05d[_0x8d2c('0x6e')](_0x4cae4c[_0x8d2c('0x26')][_0x8d2c('0x54')])['then'](function(){if(_[_0x8d2c('0x75')](_0x4cae4c[_0x8d2c('0x26')][_0x8d2c('0x54')])){for(var _0x11f7bb=0x0;_0x11f7bb<_0x4cae4c['query']['ids']['length'];_0x11f7bb+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x4cae4c[_0x8d2c('0x26')][_0x8d2c('0x54')][_0x11f7bb]),'MailQueueId':Number(_0x4cae4c[_0x8d2c('0x3f')]['id'])});}}else{socket[_0x8d2c('0x6f')](_0x8d2c('0x70'),{'UserId':Number(_0x4cae4c[_0x8d2c('0x26')]['ids']),'MailQueueId':Number(_0x4cae4c[_0x8d2c('0x3f')]['id'])});}});}})[_0x8d2c('0x15')](respondWithStatusCode(_0x590dca,null))[_0x8d2c('0x29')](handleError(_0x590dca,null));};exports[_0x8d2c('0x76')]=function(_0x136f70,_0x5b4690){var _0x18f2d1={};var _0x139f9a={};var _0x298de3;var _0x46b6df;return db['MailQueue'][_0x8d2c('0x42')]({'where':{'id':_0x136f70['params']['id']}})[_0x8d2c('0x15')](handleEntityNotFound(_0x5b4690,null))[_0x8d2c('0x15')](function(_0x3ca381){if(_0x3ca381){_0x298de3=_0x3ca381;_0x139f9a[_0x8d2c('0x2e')]=_['keys'](db['User'][_0x8d2c('0x20')]);_0x139f9a[_0x8d2c('0x26')]=_[_0x8d2c('0x2b')](_0x136f70['query']);_0x139f9a[_0x8d2c('0x2c')]=_[_0x8d2c('0x2d')](_0x139f9a[_0x8d2c('0x2e')],_0x139f9a[_0x8d2c('0x26')]);_0x18f2d1['attributes']=_[_0x8d2c('0x2d')](_0x139f9a[_0x8d2c('0x2e')],qs[_0x8d2c('0x2f')](_0x136f70[_0x8d2c('0x26')][_0x8d2c('0x2f')]));_0x18f2d1[_0x8d2c('0x30')]=_0x18f2d1[_0x8d2c('0x30')][_0x8d2c('0x31')]?_0x18f2d1[_0x8d2c('0x30')]:_0x139f9a[_0x8d2c('0x2e')];_0x18f2d1[_0x8d2c('0x45')]=qs[_0x8d2c('0x46')](_0x136f70[_0x8d2c('0x26')][_0x8d2c('0x46')]);_0x18f2d1[_0x8d2c('0x24')]=qs[_0x8d2c('0x2c')](_[_0x8d2c('0x52')](_0x136f70[_0x8d2c('0x26')],_0x139f9a[_0x8d2c('0x2c')]));if(_0x136f70[_0x8d2c('0x26')][_0x8d2c('0x48')]){_0x18f2d1[_0x8d2c('0x24')]=_[_0x8d2c('0x33')](_0x18f2d1[_0x8d2c('0x24')],{'$or':_['map'](_0x18f2d1['attributes'],function(_0x5a499d){var _0x4423aa={};_0x4423aa[_0x5a499d]={'$like':'%'+_0x136f70[_0x8d2c('0x26')][_0x8d2c('0x48')]+'%'};return _0x4423aa;})});}_0x18f2d1=_[_0x8d2c('0x33')]({},_0x18f2d1,_0x136f70[_0x8d2c('0x34')]);return _0x298de3[_0x8d2c('0x76')](_0x18f2d1);}})[_0x8d2c('0x15')](function(_0x2d94e7){if(_0x2d94e7){_0x46b6df=_0x2d94e7[_0x8d2c('0x31')];if(!_0x136f70[_0x8d2c('0x26')][_0x8d2c('0x77')](_0x8d2c('0x44'))){_0x18f2d1[_0x8d2c('0x11')]=qs[_0x8d2c('0x11')](_0x136f70[_0x8d2c('0x26')]['limit']);_0x18f2d1[_0x8d2c('0xe')]=qs[_0x8d2c('0xe')](_0x136f70[_0x8d2c('0x26')][_0x8d2c('0xe')]);}return _0x298de3['getAgents'](_0x18f2d1);}})[_0x8d2c('0x15')](function(_0x59fc3c){if(_0x59fc3c){return _0x59fc3c?{'count':_0x46b6df,'rows':_0x59fc3c}:null;}})['then'](respondWithResult(_0x5b4690,null))[_0x8d2c('0x29')](handleError(_0x5b4690,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index c91380d..c3df746 100644 --- a/server/api/mailQueue/mailQueue.events.js +++ b/server/api/mailQueue/mailQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x484e=['save','remove','hasOwnProperty','exports','../../mysqldb','MailQueue'];(function(_0x3e9e62,_0x16d198){var _0xb8a42d=function(_0x308bbb){while(--_0x308bbb){_0x3e9e62['push'](_0x3e9e62['shift']());}};_0xb8a42d(++_0x16d198);}(_0x484e,0x130));var _0xe484=function(_0x55e95d,_0x73f423){_0x55e95d=_0x55e95d-0x0;var _0x5895cf=_0x484e[_0x55e95d];return _0x5895cf;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xe484('0x0'))['db'][_0xe484('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe484('0x2'),'afterUpdate':'update','afterDestroy':_0xe484('0x3')};function emitEvent(_0x2fb6e9){return function(_0x1ac18c,_0x4f6431,_0x534836){MailQueueEvents['emit'](_0x2fb6e9+':'+_0x1ac18c['id'],_0x1ac18c);MailQueueEvents['emit'](_0x2fb6e9,_0x1ac18c);_0x534836(null);};}for(var e in events){if(events[_0xe484('0x4')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xe484('0x5')]=MailQueueEvents; \ No newline at end of file +var _0x8f67=['../../mysqldb','MailQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x120eba,_0x358742){var _0x11a9bf=function(_0xdf2112){while(--_0xdf2112){_0x120eba['push'](_0x120eba['shift']());}};_0x11a9bf(++_0x358742);}(_0x8f67,0x10d));var _0x78f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f67[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x78f6('0x0'));var MailQueue=require(_0x78f6('0x1'))['db'][_0x78f6('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x78f6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x78f6('0x4'),'afterDestroy':_0x78f6('0x5')};function emitEvent(_0x2952f8){return function(_0x1dc23d,_0x14bfd9,_0x2b0a57){MailQueueEvents[_0x78f6('0x6')](_0x2952f8+':'+_0x1dc23d['id'],_0x1dc23d);MailQueueEvents['emit'](_0x2952f8,_0x1dc23d);_0x2b0a57(null);};}for(var e in events){if(events[_0x78f6('0x7')](e)){var event=events[e];MailQueue[_0x78f6('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 7e33698..e114790 100644 --- a/server/api/mailQueue/mailQueue.model.js +++ b/server/api/mailQueue/mailQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97a6=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','MailQueue','lodash'];(function(_0xc587ed,_0x11cbc2){var _0x41d137=function(_0x2d288f){while(--_0x2d288f){_0xc587ed['push'](_0xc587ed['shift']());}};_0x41d137(++_0x11cbc2);}(_0x97a6,0x83));var _0x697a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x97a6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x697a('0x0'));var util=require(_0x697a('0x1'));var logger=require(_0x697a('0x2'))(_0x697a('0x3'));var moment=require('moment');var BPromise=require(_0x697a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x697a('0x5'));var rimraf=require(_0x697a('0x6'));var config=require(_0x697a('0x7'));var attributes=require('./mailQueue.attributes');module[_0x697a('0x8')]=function(_0x2b5d94,_0x42b670){return _0x2b5d94[_0x697a('0x9')](_0x697a('0xa'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ce2=['define','MailQueue','mail_queues','api','moment','rimraf','../../config/environment','./mailQueue.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1ce2,0x18f));var _0x21ce=function(_0x361ad3,_0x3dfa81){_0x361ad3=_0x361ad3-0x0;var _0x4e54c1=_0x1ce2[_0x361ad3];return _0x4e54c1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x21ce('0x0'));var moment=require(_0x21ce('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x21ce('0x2'));var config=require(_0x21ce('0x3'));var attributes=require(_0x21ce('0x4'));module[_0x21ce('0x5')]=function(_0x19bb5f,_0x1bf6cd){return _0x19bb5f[_0x21ce('0x6')](_0x21ce('0x7'),attributes,{'tableName':_0x21ce('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index b61c2cd..246844a 100644 --- a/server/api/mailQueue/mailQueue.rpc.js +++ b/server/api/mailQueue/mailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x82b0=['include','model','attributes','debug','stringify','ShowMailQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','GetMailQueue','MailQueue','findAll','options','raw','limit','map'];(function(_0x2682a4,_0x5db558){var _0x3489ea=function(_0x1bc19f){while(--_0x1bc19f){_0x2682a4['push'](_0x2682a4['shift']());}};_0x3489ea(++_0x5db558);}(_0x82b0,0x81));var _0x082b=function(_0x169f86,_0xadf81f){_0x169f86=_0x169f86-0x0;var _0x30cced=_0x82b0[_0x169f86];return _0x30cced;};'use strict';var _=require(_0x082b('0x0'));var util=require(_0x082b('0x1'));var moment=require(_0x082b('0x2'));var BPromise=require('bluebird');var rs=require(_0x082b('0x3'));var fs=require('fs');var Redis=require(_0x082b('0x4'));var db=require(_0x082b('0x5'))['db'];var utils=require(_0x082b('0x6'));var logger=require('../../config/logger')(_0x082b('0x7'));var config=require(_0x082b('0x8'));var jayson=require(_0x082b('0x9'));var client=jayson[_0x082b('0xa')][_0x082b('0xb')]({'port':0x232a});config['redis']=_[_0x082b('0xc')](config[_0x082b('0xd')],{'host':_0x082b('0xe'),'port':0x18eb});var socket=require(_0x082b('0xf'))(new Redis(config[_0x082b('0xd')]));require(_0x082b('0x10'))[_0x082b('0x11')](socket);function respondWithRpcPromise(_0x303c1e,_0x1483c3,_0x1066e8){return new BPromise(function(_0x18a27f,_0x181a6e){return client[_0x082b('0x12')](_0x303c1e,_0x1066e8)[_0x082b('0x13')](function(_0x4e9133){logger['info'](_0x082b('0x14'),_0x1483c3,'request\x20sent');logger['debug'](_0x082b('0x15'),_0x1483c3,_0x082b('0x16'),JSON['stringify'](_0x4e9133));if(_0x4e9133[_0x082b('0x17')]){if(_0x4e9133[_0x082b('0x17')][_0x082b('0x18')]===0x1f4){logger[_0x082b('0x17')](_0x082b('0x14'),_0x1483c3,_0x4e9133['error'][_0x082b('0x19')]);return _0x181a6e(_0x4e9133[_0x082b('0x17')]['message']);}logger[_0x082b('0x17')]('MailQueue,\x20%s,\x20%s',_0x1483c3,_0x4e9133[_0x082b('0x17')][_0x082b('0x19')]);return _0x18a27f(_0x4e9133['error'][_0x082b('0x19')]);}else{logger[_0x082b('0x1a')](_0x082b('0x14'),_0x1483c3,_0x082b('0x16'));_0x18a27f(_0x4e9133['result'][_0x082b('0x19')]);}})[_0x082b('0x1b')](function(_0x7d188d){logger[_0x082b('0x17')](_0x082b('0x14'),_0x1483c3,_0x7d188d);_0x181a6e(_0x7d188d);});});}exports[_0x082b('0x1c')]=function(_0x101654){var _0x18074e=this;return new Promise(function(_0x5dee52,_0x9faf2){return db[_0x082b('0x1d')][_0x082b('0x1e')]({'raw':_0x101654['options']?_0x101654[_0x082b('0x1f')][_0x082b('0x20')]===undefined?!![]:![]:!![],'where':_0x101654[_0x082b('0x1f')]?_0x101654['options']['where']||null:null,'attributes':_0x101654[_0x082b('0x1f')]?_0x101654['options']['attributes']||null:null,'limit':_0x101654[_0x082b('0x1f')]?_0x101654[_0x082b('0x1f')][_0x082b('0x21')]||null:null,'include':_0x101654[_0x082b('0x1f')]?_0x101654[_0x082b('0x1f')]['include']?_[_0x082b('0x22')](_0x101654[_0x082b('0x1f')][_0x082b('0x23')],function(_0x1082bf){return{'model':db[_0x1082bf[_0x082b('0x24')]],'as':_0x1082bf['as'],'attributes':_0x1082bf[_0x082b('0x25')],'include':_0x1082bf[_0x082b('0x23')]?_['map'](_0x1082bf[_0x082b('0x23')],function(_0x5ee68e){return{'model':db[_0x5ee68e[_0x082b('0x24')]],'as':_0x5ee68e['as'],'attributes':_0x5ee68e['attributes'],'include':_0x5ee68e[_0x082b('0x23')]?_[_0x082b('0x22')](_0x5ee68e['include'],function(_0x2279d7){return{'model':db[_0x2279d7['model']],'as':_0x2279d7['as'],'attributes':_0x2279d7[_0x082b('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x528e52){logger[_0x082b('0x1a')](_0x082b('0x1c'),_0x101654);logger[_0x082b('0x26')](_0x082b('0x1c'),_0x101654,JSON[_0x082b('0x27')](_0x528e52));_0x5dee52(_0x528e52);})[_0x082b('0x1b')](function(_0x2c9197){logger[_0x082b('0x17')](_0x082b('0x1c'),_0x2c9197[_0x082b('0x19')],_0x101654);_0x9faf2(_0x18074e[_0x082b('0x17')](0x1f4,_0x2c9197['message']));});});};exports[_0x082b('0x28')]=function(_0x32e57d){var _0x43244b=this;return new Promise(function(_0x2ede9f,_0x3189ac){return db['MailQueue']['find']({'raw':_0x32e57d[_0x082b('0x1f')]?_0x32e57d[_0x082b('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x32e57d[_0x082b('0x1f')]?_0x32e57d[_0x082b('0x1f')]['where']||null:null,'attributes':_0x32e57d[_0x082b('0x1f')]?_0x32e57d['options'][_0x082b('0x25')]||null:null,'include':_0x32e57d[_0x082b('0x1f')]?_0x32e57d['options'][_0x082b('0x23')]?_[_0x082b('0x22')](_0x32e57d[_0x082b('0x1f')][_0x082b('0x23')],function(_0x171bd8){return{'model':db[_0x171bd8['model']],'as':_0x171bd8['as'],'attributes':_0x171bd8[_0x082b('0x25')],'include':_0x171bd8['include']?_[_0x082b('0x22')](_0x171bd8[_0x082b('0x23')],function(_0x40e422){return{'model':db[_0x40e422[_0x082b('0x24')]],'as':_0x40e422['as'],'attributes':_0x40e422[_0x082b('0x25')],'include':_0x40e422[_0x082b('0x23')]?_[_0x082b('0x22')](_0x40e422[_0x082b('0x23')],function(_0x56f15c){return{'model':db[_0x56f15c[_0x082b('0x24')]],'as':_0x56f15c['as'],'attributes':_0x56f15c[_0x082b('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x129f19){logger[_0x082b('0x1a')](_0x082b('0x28'),_0x32e57d);logger[_0x082b('0x26')](_0x082b('0x28'),_0x32e57d,JSON[_0x082b('0x27')](_0x129f19));_0x2ede9f(_0x129f19);})[_0x082b('0x1b')](function(_0x65836e){logger['error'](_0x082b('0x28'),_0x65836e[_0x082b('0x19')],_0x32e57d);_0x3189ac(_0x43244b[_0x082b('0x17')](0x1f4,_0x65836e[_0x082b('0x19')]));});});}; \ No newline at end of file +var _0xd60b=['debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','limit','include','map','attributes','model','then','stringify','find','where','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailQueue.socket','request','info','MailQueue,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd60b,0x6f));var _0xbd60=function(_0x577832,_0x34ed82){_0x577832=_0x577832-0x0;var _0x376511=_0xd60b[_0x577832];return _0x376511;};'use strict';var _=require(_0xbd60('0x0'));var util=require(_0xbd60('0x1'));var moment=require(_0xbd60('0x2'));var BPromise=require(_0xbd60('0x3'));var rs=require(_0xbd60('0x4'));var fs=require('fs');var Redis=require(_0xbd60('0x5'));var db=require(_0xbd60('0x6'))['db'];var utils=require(_0xbd60('0x7'));var logger=require(_0xbd60('0x8'))(_0xbd60('0x9'));var config=require(_0xbd60('0xa'));var jayson=require(_0xbd60('0xb'));var client=jayson[_0xbd60('0xc')][_0xbd60('0xd')]({'port':0x232a});config[_0xbd60('0xe')]=_[_0xbd60('0xf')](config[_0xbd60('0xe')],{'host':_0xbd60('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbd60('0xe')]));require(_0xbd60('0x11'))['register'](socket);function respondWithRpcPromise(_0x293f97,_0x2e8eb9,_0x3f907a){return new BPromise(function(_0x5e8bfc,_0x4841a8){return client[_0xbd60('0x12')](_0x293f97,_0x3f907a)['then'](function(_0xd08de1){logger[_0xbd60('0x13')](_0xbd60('0x14'),_0x2e8eb9,'request\x20sent');logger[_0xbd60('0x15')](_0xbd60('0x16'),_0x2e8eb9,_0xbd60('0x17'),JSON['stringify'](_0xd08de1));if(_0xd08de1[_0xbd60('0x18')]){if(_0xd08de1[_0xbd60('0x18')][_0xbd60('0x19')]===0x1f4){logger[_0xbd60('0x18')](_0xbd60('0x14'),_0x2e8eb9,_0xd08de1['error'][_0xbd60('0x1a')]);return _0x4841a8(_0xd08de1[_0xbd60('0x18')][_0xbd60('0x1a')]);}logger[_0xbd60('0x18')](_0xbd60('0x14'),_0x2e8eb9,_0xd08de1[_0xbd60('0x18')][_0xbd60('0x1a')]);return _0x5e8bfc(_0xd08de1[_0xbd60('0x18')][_0xbd60('0x1a')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x2e8eb9,_0xbd60('0x17'));_0x5e8bfc(_0xd08de1[_0xbd60('0x1b')][_0xbd60('0x1a')]);}})[_0xbd60('0x1c')](function(_0x50d2eb){logger['error']('MailQueue,\x20%s,\x20%s',_0x2e8eb9,_0x50d2eb);_0x4841a8(_0x50d2eb);});});}exports[_0xbd60('0x1d')]=function(_0x578505){var _0x439a31=this;return new Promise(function(_0x2f545f,_0x499396){return db[_0xbd60('0x1e')][_0xbd60('0x1f')]({'raw':_0x578505[_0xbd60('0x20')]?_0x578505[_0xbd60('0x20')][_0xbd60('0x21')]===undefined?!![]:![]:!![],'where':_0x578505[_0xbd60('0x20')]?_0x578505[_0xbd60('0x20')]['where']||null:null,'attributes':_0x578505['options']?_0x578505[_0xbd60('0x20')]['attributes']||null:null,'limit':_0x578505['options']?_0x578505[_0xbd60('0x20')][_0xbd60('0x22')]||null:null,'include':_0x578505['options']?_0x578505[_0xbd60('0x20')][_0xbd60('0x23')]?_[_0xbd60('0x24')](_0x578505[_0xbd60('0x20')]['include'],function(_0x1d4be7){return{'model':db[_0x1d4be7['model']],'as':_0x1d4be7['as'],'attributes':_0x1d4be7[_0xbd60('0x25')],'include':_0x1d4be7['include']?_[_0xbd60('0x24')](_0x1d4be7[_0xbd60('0x23')],function(_0x3b4800){return{'model':db[_0x3b4800[_0xbd60('0x26')]],'as':_0x3b4800['as'],'attributes':_0x3b4800[_0xbd60('0x25')],'include':_0x3b4800[_0xbd60('0x23')]?_['map'](_0x3b4800[_0xbd60('0x23')],function(_0x31a485){return{'model':db[_0x31a485['model']],'as':_0x31a485['as'],'attributes':_0x31a485[_0xbd60('0x25')]};}):[]};}):[]};}):[]:[]})[_0xbd60('0x27')](function(_0x50c4b4){logger['info']('GetMailQueue',_0x578505);logger['debug'](_0xbd60('0x1d'),_0x578505,JSON[_0xbd60('0x28')](_0x50c4b4));_0x2f545f(_0x50c4b4);})['catch'](function(_0x4a207d){logger[_0xbd60('0x18')](_0xbd60('0x1d'),_0x4a207d[_0xbd60('0x1a')],_0x578505);_0x499396(_0x439a31[_0xbd60('0x18')](0x1f4,_0x4a207d[_0xbd60('0x1a')]));});});};exports['ShowMailQueue']=function(_0x35529a){var _0xcbeeb4=this;return new Promise(function(_0xd0d32b,_0x519088){return db[_0xbd60('0x1e')][_0xbd60('0x29')]({'raw':_0x35529a[_0xbd60('0x20')]?_0x35529a[_0xbd60('0x20')][_0xbd60('0x21')]===undefined?!![]:![]:!![],'where':_0x35529a[_0xbd60('0x20')]?_0x35529a[_0xbd60('0x20')][_0xbd60('0x2a')]||null:null,'attributes':_0x35529a[_0xbd60('0x20')]?_0x35529a[_0xbd60('0x20')][_0xbd60('0x25')]||null:null,'include':_0x35529a[_0xbd60('0x20')]?_0x35529a[_0xbd60('0x20')]['include']?_[_0xbd60('0x24')](_0x35529a[_0xbd60('0x20')][_0xbd60('0x23')],function(_0x2e4b5d){return{'model':db[_0x2e4b5d['model']],'as':_0x2e4b5d['as'],'attributes':_0x2e4b5d[_0xbd60('0x25')],'include':_0x2e4b5d[_0xbd60('0x23')]?_[_0xbd60('0x24')](_0x2e4b5d[_0xbd60('0x23')],function(_0x5be308){return{'model':db[_0x5be308[_0xbd60('0x26')]],'as':_0x5be308['as'],'attributes':_0x5be308[_0xbd60('0x25')],'include':_0x5be308[_0xbd60('0x23')]?_[_0xbd60('0x24')](_0x5be308[_0xbd60('0x23')],function(_0x2ce33e){return{'model':db[_0x2ce33e[_0xbd60('0x26')]],'as':_0x2ce33e['as'],'attributes':_0x2ce33e[_0xbd60('0x25')]};}):[]};}):[]};}):[]:[]})[_0xbd60('0x27')](function(_0xe2f6fb){logger[_0xbd60('0x13')]('ShowMailQueue',_0x35529a);logger[_0xbd60('0x15')](_0xbd60('0x2b'),_0x35529a,JSON['stringify'](_0xe2f6fb));_0xd0d32b(_0xe2f6fb);})[_0xbd60('0x1c')](function(_0x18eff1){logger[_0xbd60('0x18')]('ShowMailQueue',_0x18eff1['message'],_0x35529a);_0x519088(_0xcbeeb4[_0xbd60('0x18')](0x1f4,_0x18eff1[_0xbd60('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 6d816de..c0d8a94 100644 --- a/server/api/mailQueue/mailQueue.socket.js +++ b/server/api/mailQueue/mailQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47a0=['length','mailQueue:','./mailQueue.events','remove','update','emit','removeListener','register'];(function(_0x1a1b49,_0x4c6d15){var _0x336d48=function(_0x5993be){while(--_0x5993be){_0x1a1b49['push'](_0x1a1b49['shift']());}};_0x336d48(++_0x4c6d15);}(_0x47a0,0x15a));var _0x047a=function(_0x15320e,_0x3c9cce){_0x15320e=_0x15320e-0x0;var _0x21fe36=_0x47a0[_0x15320e];return _0x21fe36;};'use strict';var MailQueueEvents=require(_0x047a('0x0'));var events=['save',_0x047a('0x1'),_0x047a('0x2')];function createListener(_0x449dc5,_0x4e76e9){return function(_0xc38132){_0x4e76e9[_0x047a('0x3')](_0x449dc5,_0xc38132);};}function removeListener(_0x5ceee8,_0x4c9941){return function(){MailQueueEvents[_0x047a('0x4')](_0x5ceee8,_0x4c9941);};}exports[_0x047a('0x5')]=function(_0x1d60e1){for(var _0x56908d=0x0,_0x176f33=events[_0x047a('0x6')];_0x56908d<_0x176f33;_0x56908d++){var _0x2967b9=events[_0x56908d];var _0x138c00=createListener(_0x047a('0x7')+_0x2967b9,_0x1d60e1);MailQueueEvents['on'](_0x2967b9,_0x138c00);}}; \ No newline at end of file +var _0x97a8=['removeListener','length','mailQueue:','save','remove','update','emit'];(function(_0x2e85fd,_0x1ce95a){var _0x4615c2=function(_0x1c351f){while(--_0x1c351f){_0x2e85fd['push'](_0x2e85fd['shift']());}};_0x4615c2(++_0x1ce95a);}(_0x97a8,0xe3));var _0x897a=function(_0x3d86fb,_0x51313f){_0x3d86fb=_0x3d86fb-0x0;var _0x3b2019=_0x97a8[_0x3d86fb];return _0x3b2019;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x897a('0x0'),_0x897a('0x1'),_0x897a('0x2')];function createListener(_0x329208,_0x3d8ec0){return function(_0x1b50b0){_0x3d8ec0[_0x897a('0x3')](_0x329208,_0x1b50b0);};}function removeListener(_0x48203b,_0x2131d0){return function(){MailQueueEvents[_0x897a('0x4')](_0x48203b,_0x2131d0);};}exports['register']=function(_0x5adcfd){for(var _0x55e647=0x0,_0x59b9f1=events[_0x897a('0x5')];_0x55e647<_0x59b9f1;_0x55e647++){var _0x128644=events[_0x55e647];var _0x3cd748=createListener(_0x897a('0x6')+_0x128644,_0x5adcfd);MailQueueEvents['on'](_0x128644,_0x3cd748);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 57a8170..6ea6b5c 100644 --- a/server/api/mailQueueReport/index.js +++ b/server/api/mailQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc986=['create','put','delete','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','/describe','describe','get','/:id','post'];(function(_0xb9f3ae,_0x4016b8){var _0x1a2e76=function(_0xbf200b){while(--_0xbf200b){_0xb9f3ae['push'](_0xb9f3ae['shift']());}};_0x1a2e76(++_0x4016b8);}(_0xc986,0x16d));var _0x6c98=function(_0x1e753b,_0x209149){_0x1e753b=_0x1e753b-0x0;var _0x13d34e=_0xc986[_0x1e753b];return _0x13d34e;};'use strict';var multer=require(_0x6c98('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6c98('0x1'));var express=require(_0x6c98('0x2'));var router=express['Router']();var fs_extra=require(_0x6c98('0x3'));var auth=require(_0x6c98('0x4'));var interaction=require(_0x6c98('0x5'));var config=require(_0x6c98('0x6'));var controller=require(_0x6c98('0x7'));router['get']('/',auth[_0x6c98('0x8')](),controller[_0x6c98('0x9')]);router['get'](_0x6c98('0xa'),auth[_0x6c98('0x8')](),controller[_0x6c98('0xb')]);router[_0x6c98('0xc')](_0x6c98('0xd'),auth[_0x6c98('0x8')](),controller['show']);router[_0x6c98('0xe')]('/',auth[_0x6c98('0x8')](),controller[_0x6c98('0xf')]);router[_0x6c98('0x10')](_0x6c98('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x6c98('0x11')](_0x6c98('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x6c98('0x12')]=router; \ No newline at end of file +var _0x407c=['util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','describe','/:id','show','update','delete','destroy','exports'];(function(_0x312e81,_0x1cf1ad){var _0x248437=function(_0x12277e){while(--_0x12277e){_0x312e81['push'](_0x312e81['shift']());}};_0x248437(++_0x1cf1ad);}(_0x407c,0xc0));var _0xc407=function(_0x9cb7df,_0x32a897){_0x9cb7df=_0x9cb7df-0x0;var _0x356666=_0x407c[_0x9cb7df];return _0x356666;};'use strict';var multer=require('multer');var util=require(_0xc407('0x0'));var path=require(_0xc407('0x1'));var timeout=require(_0xc407('0x2'));var express=require('express');var router=express[_0xc407('0x3')]();var fs_extra=require(_0xc407('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc407('0x5'));var config=require('../../config/environment');var controller=require(_0xc407('0x6'));router[_0xc407('0x7')]('/',auth[_0xc407('0x8')](),controller['index']);router[_0xc407('0x7')]('/describe',auth[_0xc407('0x8')](),controller[_0xc407('0x9')]);router[_0xc407('0x7')](_0xc407('0xa'),auth[_0xc407('0x8')](),controller[_0xc407('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc407('0xa'),auth[_0xc407('0x8')](),controller[_0xc407('0xc')]);router[_0xc407('0xd')]('/:id',auth[_0xc407('0x8')](),controller[_0xc407('0xe')]);module[_0xc407('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 12e3057..9f5d693 100644 --- a/server/api/mailQueueReport/mailQueueReport.attributes.js +++ b/server/api/mailQueueReport/mailQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f2d=['STRING','DATE','moment','sequelize'];(function(_0x4c5ae3,_0x34c645){var _0x6148a2=function(_0x2f2523){while(--_0x2f2523){_0x4c5ae3['push'](_0x4c5ae3['shift']());}};_0x6148a2(++_0x34c645);}(_0x7f2d,0x1ea));var _0xd7f2=function(_0x3acb0f,_0x422e6f){_0x3acb0f=_0x3acb0f-0x0;var _0x5bdb4f=_0x7f2d[_0x3acb0f];return _0x5bdb4f;};'use strict';var moment=require(_0xd7f2('0x0'));var Sequelize=require(_0xd7f2('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xd7f2('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd7f2('0x2')]},'joinAt':{'type':Sequelize[_0xd7f2('0x3')]},'leaveAt':{'type':Sequelize[_0xd7f2('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x959e=['DATE','sequelize','STRING'];(function(_0x3626ce,_0x33effa){var _0x455327=function(_0x4eee88){while(--_0x4eee88){_0x3626ce['push'](_0x3626ce['shift']());}};_0x455327(++_0x33effa);}(_0x959e,0x18a));var _0xe959=function(_0x7d62cb,_0x7622c){_0x7d62cb=_0x7d62cb-0x0;var _0x3a6266=_0x959e[_0x7d62cb];return _0x3a6266;};'use strict';var moment=require('moment');var Sequelize=require(_0xe959('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe959('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xe959('0x1')]},'joinAt':{'type':Sequelize[_0xe959('0x2')]},'leaveAt':{'type':Sequelize[_0xe959('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe959('0x2')]},'reason':{'type':Sequelize[_0xe959('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index dd8dca1..7780d5f 100644 --- a/server/api/mailQueueReport/mailQueueReport.controller.js +++ b/server/api/mailQueueReport/mailQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d04=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','MailQueueReport','rows','catch','show','params','rawAttributes','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset'];(function(_0x39befc,_0x45628d){var _0x1ff165=function(_0x4d617e){while(--_0x4d617e){_0x39befc['push'](_0x39befc['shift']());}};_0x1ff165(++_0x45628d);}(_0x3d04,0xbe));var _0x43d0=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3d04[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x43d0('0x0'));var rimraf=require(_0x43d0('0x1'));var zipdir=require(_0x43d0('0x2'));var jsonpatch=require(_0x43d0('0x3'));var rp=require(_0x43d0('0x4'));var moment=require(_0x43d0('0x5'));var BPromise=require(_0x43d0('0x6'));var Mustache=require(_0x43d0('0x7'));var util=require('util');var path=require(_0x43d0('0x8'));var sox=require(_0x43d0('0x9'));var csv=require(_0x43d0('0xa'));var ejs=require(_0x43d0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x43d0('0xc'));var deskjs=require(_0x43d0('0xd'));var toCsv=require(_0x43d0('0xa'));var querystring=require(_0x43d0('0xe'));var Papa=require(_0x43d0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43d0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x43d0('0x11'))(_0x43d0('0x12'));var utils=require(_0x43d0('0x13'));var config=require(_0x43d0('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x43d0('0x15'))['db'];function respondWithStatusCode(_0x23daaa,_0x546b23){_0x546b23=_0x546b23||0xcc;return function(_0x29773b){if(_0x29773b){return _0x23daaa[_0x43d0('0x16')](_0x546b23);}return _0x23daaa[_0x43d0('0x17')](_0x546b23)['end']();};}function respondWithResult(_0xd262a8,_0x2454fa){_0x2454fa=_0x2454fa||0xc8;return function(_0x436130){if(_0x436130){return _0xd262a8['status'](_0x2454fa)[_0x43d0('0x18')](_0x436130);}};}function respondWithFilteredResult(_0x357f87,_0x44e6ec){return function(_0x1218b5){if(_0x1218b5){var _0x91b4a1=typeof _0x44e6ec['offset']==='undefined'&&typeof _0x44e6ec[_0x43d0('0x19')]===_0x43d0('0x1a');var _0x35decf=_0x1218b5['count'];var _0x2c641e=_0x91b4a1?0x0:_0x44e6ec['offset'];var _0x2c9d06=_0x91b4a1?_0x1218b5[_0x43d0('0x1b')]:_0x44e6ec[_0x43d0('0x1c')]+_0x44e6ec['limit'];var _0x3d7dcc;if(_0x2c9d06>=_0x35decf){_0x2c9d06=_0x35decf;_0x3d7dcc=0xc8;}else{_0x3d7dcc=0xce;}_0x357f87[_0x43d0('0x17')](_0x3d7dcc);return _0x357f87['set'](_0x43d0('0x1d'),_0x2c641e+'-'+_0x2c9d06+'/'+_0x35decf)[_0x43d0('0x18')](_0x1218b5);}return null;};}function patchUpdates(_0x348429){return function(_0x248622){try{jsonpatch[_0x43d0('0x1e')](_0x248622,_0x348429,!![]);}catch(_0x28381b){return BPromise[_0x43d0('0x1f')](_0x28381b);}return _0x248622[_0x43d0('0x20')]();};}function saveUpdates(_0x30febc,_0xc8a644){return function(_0xec5f07){if(_0xec5f07){return _0xec5f07[_0x43d0('0x21')](_0x30febc)[_0x43d0('0x22')](function(_0xbc72e6){return _0xbc72e6;});}return null;};}function removeEntity(_0x2efd77,_0x48aa18){return function(_0x2c7b24){if(_0x2c7b24){return _0x2c7b24[_0x43d0('0x23')]()['then'](function(){_0x2efd77[_0x43d0('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29c111,_0x44497b){return function(_0x5dd310){if(!_0x5dd310){_0x29c111[_0x43d0('0x16')](0x194);}return _0x5dd310;};}function handleError(_0x238c64,_0x5ac4c0){_0x5ac4c0=_0x5ac4c0||0x1f4;return function(_0x12df30){logger[_0x43d0('0x24')](_0x12df30[_0x43d0('0x25')]);if(_0x12df30['name']){delete _0x12df30[_0x43d0('0x26')];}_0x238c64[_0x43d0('0x17')](_0x5ac4c0)[_0x43d0('0x27')](_0x12df30);};}exports[_0x43d0('0x28')]=function(_0x37d78f,_0x440ecb){var _0x31a057={},_0x4a3cd4={},_0x2b0784={'count':0x0,'rows':[]};var _0x2f5bc5=_[_0x43d0('0x29')](db['MailQueueReport']['rawAttributes'],function(_0x52c37b){return{'name':_0x52c37b[_0x43d0('0x2a')],'type':_0x52c37b[_0x43d0('0x2b')][_0x43d0('0x2c')]};});_0x4a3cd4[_0x43d0('0x2d')]=_[_0x43d0('0x29')](_0x2f5bc5,_0x43d0('0x26'));_0x4a3cd4['query']=_[_0x43d0('0x2e')](_0x37d78f[_0x43d0('0x2f')]);_0x4a3cd4[_0x43d0('0x30')]=_[_0x43d0('0x31')](_0x4a3cd4[_0x43d0('0x2d')],_0x4a3cd4[_0x43d0('0x2f')]);_0x31a057[_0x43d0('0x32')]=_[_0x43d0('0x31')](_0x4a3cd4[_0x43d0('0x2d')],qs[_0x43d0('0x33')](_0x37d78f[_0x43d0('0x2f')]['fields']));_0x31a057[_0x43d0('0x32')]=_0x31a057[_0x43d0('0x32')][_0x43d0('0x34')]?_0x31a057[_0x43d0('0x32')]:_0x4a3cd4['model'];if(!_0x37d78f[_0x43d0('0x2f')]['hasOwnProperty'](_0x43d0('0x35'))){_0x31a057[_0x43d0('0x19')]=qs['limit'](_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x19')]);_0x31a057[_0x43d0('0x1c')]=qs[_0x43d0('0x1c')](_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x1c')]);}_0x31a057[_0x43d0('0x36')]=qs[_0x43d0('0x37')](_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x37')]);_0x31a057[_0x43d0('0x38')]=qs['filters'](_[_0x43d0('0x39')](_0x37d78f[_0x43d0('0x2f')],_0x4a3cd4[_0x43d0('0x30')]),_0x2f5bc5);if(_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x3a')]){_0x31a057[_0x43d0('0x38')]=_[_0x43d0('0x3b')](_0x31a057[_0x43d0('0x38')],{'$or':_[_0x43d0('0x29')](_0x2f5bc5,function(_0x43bcc5){if(_0x43bcc5[_0x43d0('0x2b')]!==_0x43d0('0x3c')){var _0x19843c={};_0x19843c[_0x43bcc5[_0x43d0('0x26')]]={'$like':'%'+_0x37d78f['query'][_0x43d0('0x3a')]+'%'};return _0x19843c;}})});}_0x31a057=_[_0x43d0('0x3b')]({},_0x31a057,_0x37d78f[_0x43d0('0x3d')]);var _0xc3f9c7={'where':_0x31a057[_0x43d0('0x38')]};return db[_0x43d0('0x3e')][_0x43d0('0x1b')](_0xc3f9c7)[_0x43d0('0x22')](function(_0x4ae965){_0x2b0784['count']=_0x4ae965;if(_0x37d78f[_0x43d0('0x2f')]['includeAll']){_0x31a057['include']=[{'all':!![]}];}return db[_0x43d0('0x3e')]['findAll'](_0x31a057);})[_0x43d0('0x22')](function(_0x5027d0){_0x2b0784[_0x43d0('0x3f')]=_0x5027d0;return _0x2b0784;})['then'](respondWithFilteredResult(_0x440ecb,_0x31a057))[_0x43d0('0x40')](handleError(_0x440ecb,null));};exports[_0x43d0('0x41')]=function(_0x468b32,_0x4e817e){var _0x3eb2e9={'raw':!![],'where':{'id':_0x468b32[_0x43d0('0x42')]['id']}},_0x520406={};_0x520406['model']=_['keys'](db[_0x43d0('0x3e')][_0x43d0('0x43')]);_0x520406['query']=_[_0x43d0('0x2e')](_0x468b32[_0x43d0('0x2f')]);_0x520406[_0x43d0('0x30')]=_[_0x43d0('0x31')](_0x520406[_0x43d0('0x2d')],_0x520406['query']);_0x3eb2e9[_0x43d0('0x32')]=_[_0x43d0('0x31')](_0x520406[_0x43d0('0x2d')],qs[_0x43d0('0x33')](_0x468b32['query'][_0x43d0('0x33')]));_0x3eb2e9[_0x43d0('0x32')]=_0x3eb2e9[_0x43d0('0x32')][_0x43d0('0x34')]?_0x3eb2e9[_0x43d0('0x32')]:_0x520406['model'];if(_0x468b32[_0x43d0('0x2f')][_0x43d0('0x44')]){_0x3eb2e9['include']=[{'all':!![]}];}_0x3eb2e9=_[_0x43d0('0x3b')]({},_0x3eb2e9,_0x468b32[_0x43d0('0x3d')]);return db[_0x43d0('0x3e')]['find'](_0x3eb2e9)[_0x43d0('0x22')](handleEntityNotFound(_0x4e817e,null))['then'](respondWithResult(_0x4e817e,null))[_0x43d0('0x40')](handleError(_0x4e817e,null));};exports['create']=function(_0x1f55e9,_0x269d99){return db[_0x43d0('0x3e')][_0x43d0('0x45')](_0x1f55e9[_0x43d0('0x46')],{})['then'](respondWithResult(_0x269d99,0xc9))[_0x43d0('0x40')](handleError(_0x269d99,null));};exports['update']=function(_0x5a6364,_0x3e7392){if(_0x5a6364[_0x43d0('0x46')]['id']){delete _0x5a6364[_0x43d0('0x46')]['id'];}return db[_0x43d0('0x3e')][_0x43d0('0x47')]({'where':{'id':_0x5a6364[_0x43d0('0x42')]['id']}})[_0x43d0('0x22')](handleEntityNotFound(_0x3e7392,null))[_0x43d0('0x22')](saveUpdates(_0x5a6364[_0x43d0('0x46')],null))[_0x43d0('0x22')](respondWithResult(_0x3e7392,null))[_0x43d0('0x40')](handleError(_0x3e7392,null));};exports['destroy']=function(_0x338203,_0xd78af1){return db[_0x43d0('0x3e')]['find']({'where':{'id':_0x338203[_0x43d0('0x42')]['id']}})['then'](handleEntityNotFound(_0xd78af1,null))['then'](removeEntity(_0xd78af1,null))[_0x43d0('0x40')](handleError(_0xd78af1,null));};exports[_0x43d0('0x48')]=function(_0x234571,_0x127815){return db[_0x43d0('0x3e')]['describe']()['then'](respondWithResult(_0x127815,null))[_0x43d0('0x40')](handleError(_0x127815,null));}; \ No newline at end of file +var _0xa456=['where','filters','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','keys','options','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','undefined','count','offset','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','limit','order','sort'];(function(_0x3c4062,_0x3767fc){var _0x3f5bf3=function(_0x105e55){while(--_0x105e55){_0x3c4062['push'](_0x3c4062['shift']());}};_0x3f5bf3(++_0x3767fc);}(_0xa456,0x142));var _0x6a45=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xa456[_0x1d24eb];return _0x1dc576;};'use strict';var emlformat=require(_0x6a45('0x0'));var rimraf=require(_0x6a45('0x1'));var zipdir=require(_0x6a45('0x2'));var jsonpatch=require(_0x6a45('0x3'));var rp=require('request-promise');var moment=require(_0x6a45('0x4'));var BPromise=require(_0x6a45('0x5'));var Mustache=require(_0x6a45('0x6'));var util=require('util');var path=require(_0x6a45('0x7'));var sox=require(_0x6a45('0x8'));var csv=require(_0x6a45('0x9'));var ejs=require(_0x6a45('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a45('0xb'));var squel=require(_0x6a45('0xc'));var crypto=require(_0x6a45('0xd'));var jsforce=require(_0x6a45('0xe'));var deskjs=require(_0x6a45('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6a45('0x10'));var Papa=require('papaparse');var Redis=require(_0x6a45('0x11'));var authService=require(_0x6a45('0x12'));var qs=require(_0x6a45('0x13'));var as=require(_0x6a45('0x14'));var hardwareService=require(_0x6a45('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x6a45('0x16'));var config=require(_0x6a45('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x511b92,_0x1aa4b4){_0x1aa4b4=_0x1aa4b4||0xcc;return function(_0x25a8b9){if(_0x25a8b9){return _0x511b92[_0x6a45('0x18')](_0x1aa4b4);}return _0x511b92[_0x6a45('0x19')](_0x1aa4b4)[_0x6a45('0x1a')]();};}function respondWithResult(_0x5a9f29,_0x563c3b){_0x563c3b=_0x563c3b||0xc8;return function(_0x3a5d94){if(_0x3a5d94){return _0x5a9f29[_0x6a45('0x19')](_0x563c3b)['json'](_0x3a5d94);}};}function respondWithFilteredResult(_0x2c20db,_0x171176){return function(_0x3fab82){if(_0x3fab82){var _0x13adc0=typeof _0x171176['offset']==='undefined'&&typeof _0x171176['limit']===_0x6a45('0x1b');var _0x391f81=_0x3fab82[_0x6a45('0x1c')];var _0x52a055=_0x13adc0?0x0:_0x171176[_0x6a45('0x1d')];var _0x102981=_0x13adc0?_0x3fab82[_0x6a45('0x1c')]:_0x171176['offset']+_0x171176['limit'];var _0x573453;if(_0x102981>=_0x391f81){_0x102981=_0x391f81;_0x573453=0xc8;}else{_0x573453=0xce;}_0x2c20db[_0x6a45('0x19')](_0x573453);return _0x2c20db[_0x6a45('0x1e')]('Content-Range',_0x52a055+'-'+_0x102981+'/'+_0x391f81)[_0x6a45('0x1f')](_0x3fab82);}return null;};}function patchUpdates(_0x1be485){return function(_0x4f7000){try{jsonpatch[_0x6a45('0x20')](_0x4f7000,_0x1be485,!![]);}catch(_0xdf10c6){return BPromise[_0x6a45('0x21')](_0xdf10c6);}return _0x4f7000[_0x6a45('0x22')]();};}function saveUpdates(_0x15ad0e,_0x487666){return function(_0x5d990e){if(_0x5d990e){return _0x5d990e[_0x6a45('0x23')](_0x15ad0e)[_0x6a45('0x24')](function(_0x11290c){return _0x11290c;});}return null;};}function removeEntity(_0x22373c,_0x25a380){return function(_0x3ad898){if(_0x3ad898){return _0x3ad898[_0x6a45('0x25')]()[_0x6a45('0x24')](function(){_0x22373c[_0x6a45('0x19')](0xcc)[_0x6a45('0x1a')]();});}};}function handleEntityNotFound(_0x1310d7,_0x46587a){return function(_0x5cd761){if(!_0x5cd761){_0x1310d7[_0x6a45('0x18')](0x194);}return _0x5cd761;};}function handleError(_0x5a0389,_0x1b83fa){_0x1b83fa=_0x1b83fa||0x1f4;return function(_0x25467d){logger[_0x6a45('0x26')](_0x25467d[_0x6a45('0x27')]);if(_0x25467d[_0x6a45('0x28')]){delete _0x25467d['name'];}_0x5a0389[_0x6a45('0x19')](_0x1b83fa)[_0x6a45('0x29')](_0x25467d);};}exports[_0x6a45('0x2a')]=function(_0x1ccff0,_0x8265d9){var _0x227b6f={},_0x3fac9b={},_0x313c13={'count':0x0,'rows':[]};var _0x54286d=_[_0x6a45('0x2b')](db[_0x6a45('0x2c')][_0x6a45('0x2d')],function(_0x201369){return{'name':_0x201369[_0x6a45('0x2e')],'type':_0x201369['type'][_0x6a45('0x2f')]};});_0x3fac9b[_0x6a45('0x30')]=_[_0x6a45('0x2b')](_0x54286d,_0x6a45('0x28'));_0x3fac9b['query']=_['keys'](_0x1ccff0[_0x6a45('0x31')]);_0x3fac9b['filters']=_[_0x6a45('0x32')](_0x3fac9b['model'],_0x3fac9b[_0x6a45('0x31')]);_0x227b6f[_0x6a45('0x33')]=_[_0x6a45('0x32')](_0x3fac9b[_0x6a45('0x30')],qs[_0x6a45('0x34')](_0x1ccff0[_0x6a45('0x31')][_0x6a45('0x34')]));_0x227b6f[_0x6a45('0x33')]=_0x227b6f[_0x6a45('0x33')][_0x6a45('0x35')]?_0x227b6f[_0x6a45('0x33')]:_0x3fac9b[_0x6a45('0x30')];if(!_0x1ccff0[_0x6a45('0x31')]['hasOwnProperty'](_0x6a45('0x36'))){_0x227b6f['limit']=qs[_0x6a45('0x37')](_0x1ccff0[_0x6a45('0x31')][_0x6a45('0x37')]);_0x227b6f[_0x6a45('0x1d')]=qs[_0x6a45('0x1d')](_0x1ccff0[_0x6a45('0x31')]['offset']);}_0x227b6f[_0x6a45('0x38')]=qs[_0x6a45('0x39')](_0x1ccff0[_0x6a45('0x31')][_0x6a45('0x39')]);_0x227b6f[_0x6a45('0x3a')]=qs[_0x6a45('0x3b')](_['pick'](_0x1ccff0[_0x6a45('0x31')],_0x3fac9b[_0x6a45('0x3b')]),_0x54286d);if(_0x1ccff0['query'][_0x6a45('0x3c')]){_0x227b6f[_0x6a45('0x3a')]=_[_0x6a45('0x3d')](_0x227b6f[_0x6a45('0x3a')],{'$or':_[_0x6a45('0x2b')](_0x54286d,function(_0x50ebe0){if(_0x50ebe0[_0x6a45('0x3e')]!==_0x6a45('0x3f')){var _0x205afd={};_0x205afd[_0x50ebe0[_0x6a45('0x28')]]={'$like':'%'+_0x1ccff0[_0x6a45('0x31')][_0x6a45('0x3c')]+'%'};return _0x205afd;}})});}_0x227b6f=_[_0x6a45('0x3d')]({},_0x227b6f,_0x1ccff0['options']);var _0x1c941a={'where':_0x227b6f['where']};return db[_0x6a45('0x2c')][_0x6a45('0x1c')](_0x1c941a)[_0x6a45('0x24')](function(_0x2715dc){_0x313c13['count']=_0x2715dc;if(_0x1ccff0['query'][_0x6a45('0x40')]){_0x227b6f[_0x6a45('0x41')]=[{'all':!![]}];}return db['MailQueueReport'][_0x6a45('0x42')](_0x227b6f);})[_0x6a45('0x24')](function(_0x3bd926){_0x313c13[_0x6a45('0x43')]=_0x3bd926;return _0x313c13;})['then'](respondWithFilteredResult(_0x8265d9,_0x227b6f))['catch'](handleError(_0x8265d9,null));};exports['show']=function(_0x5b9798,_0xe90201){var _0xb5d191={'raw':!![],'where':{'id':_0x5b9798[_0x6a45('0x44')]['id']}},_0x328d9f={};_0x328d9f[_0x6a45('0x30')]=_[_0x6a45('0x45')](db[_0x6a45('0x2c')][_0x6a45('0x2d')]);_0x328d9f['query']=_[_0x6a45('0x45')](_0x5b9798['query']);_0x328d9f['filters']=_[_0x6a45('0x32')](_0x328d9f[_0x6a45('0x30')],_0x328d9f['query']);_0xb5d191[_0x6a45('0x33')]=_['intersection'](_0x328d9f[_0x6a45('0x30')],qs[_0x6a45('0x34')](_0x5b9798[_0x6a45('0x31')][_0x6a45('0x34')]));_0xb5d191['attributes']=_0xb5d191[_0x6a45('0x33')][_0x6a45('0x35')]?_0xb5d191[_0x6a45('0x33')]:_0x328d9f[_0x6a45('0x30')];if(_0x5b9798[_0x6a45('0x31')]['includeAll']){_0xb5d191[_0x6a45('0x41')]=[{'all':!![]}];}_0xb5d191=_['merge']({},_0xb5d191,_0x5b9798[_0x6a45('0x46')]);return db[_0x6a45('0x2c')]['find'](_0xb5d191)[_0x6a45('0x24')](handleEntityNotFound(_0xe90201,null))[_0x6a45('0x24')](respondWithResult(_0xe90201,null))[_0x6a45('0x47')](handleError(_0xe90201,null));};exports[_0x6a45('0x48')]=function(_0x524296,_0x34bbb7){return db['MailQueueReport'][_0x6a45('0x48')](_0x524296['body'],{})[_0x6a45('0x24')](respondWithResult(_0x34bbb7,0xc9))[_0x6a45('0x47')](handleError(_0x34bbb7,null));};exports[_0x6a45('0x23')]=function(_0x2bf8d3,_0x5d9f52){if(_0x2bf8d3[_0x6a45('0x49')]['id']){delete _0x2bf8d3[_0x6a45('0x49')]['id'];}return db[_0x6a45('0x2c')][_0x6a45('0x4a')]({'where':{'id':_0x2bf8d3[_0x6a45('0x44')]['id']}})[_0x6a45('0x24')](handleEntityNotFound(_0x5d9f52,null))[_0x6a45('0x24')](saveUpdates(_0x2bf8d3[_0x6a45('0x49')],null))[_0x6a45('0x24')](respondWithResult(_0x5d9f52,null))[_0x6a45('0x47')](handleError(_0x5d9f52,null));};exports['destroy']=function(_0x3ea4a7,_0x8877c7){return db[_0x6a45('0x2c')][_0x6a45('0x4a')]({'where':{'id':_0x3ea4a7['params']['id']}})[_0x6a45('0x24')](handleEntityNotFound(_0x8877c7,null))[_0x6a45('0x24')](removeEntity(_0x8877c7,null))[_0x6a45('0x47')](handleError(_0x8877c7,null));};exports['describe']=function(_0x4e7967,_0x5a17b8){return db[_0x6a45('0x2c')][_0x6a45('0x4b')]()[_0x6a45('0x24')](respondWithResult(_0x5a17b8,null))[_0x6a45('0x47')](handleError(_0x5a17b8,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 449d946..bcc4d97 100644 --- a/server/api/mailQueueReport/mailQueueReport.model.js +++ b/server/api/mailQueueReport/mailQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3482=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x26db64,_0x459628){var _0x45dc7b=function(_0x223a18){while(--_0x223a18){_0x26db64['push'](_0x26db64['shift']());}};_0x45dc7b(++_0x459628);}(_0x3482,0x1cd));var _0x2348=function(_0x3d4ef1,_0x5a957c){_0x3d4ef1=_0x3d4ef1-0x0;var _0x409423=_0x3482[_0x3d4ef1];return _0x409423;};'use strict';var _=require(_0x2348('0x0'));var util=require(_0x2348('0x1'));var logger=require(_0x2348('0x2'))(_0x2348('0x3'));var moment=require(_0x2348('0x4'));var BPromise=require(_0x2348('0x5'));var rp=require(_0x2348('0x6'));var fs=require('fs');var path=require(_0x2348('0x7'));var rimraf=require(_0x2348('0x8'));var config=require(_0x2348('0x9'));var attributes=require(_0x2348('0xa'));module[_0x2348('0xb')]=function(_0x136cae,_0x204527){return _0x136cae[_0x2348('0xc')](_0x2348('0xd'),attributes,{'tableName':_0x2348('0xe'),'paranoid':![],'indexes':[{'name':_0x2348('0xf'),'fields':[_0x2348('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcdcb=['bluebird','path','rimraf','exports','define','MailQueueReport','uniqueid','util','../../config/logger','api','moment'];(function(_0x440b8c,_0x49c31a){var _0x40b249=function(_0x62fbe7){while(--_0x62fbe7){_0x440b8c['push'](_0x440b8c['shift']());}};_0x40b249(++_0x49c31a);}(_0xcdcb,0x75));var _0xbcdc=function(_0xe69aed,_0x295338){_0xe69aed=_0xe69aed-0x0;var _0x101cab=_0xcdcb[_0xe69aed];return _0x101cab;};'use strict';var _=require('lodash');var util=require(_0xbcdc('0x0'));var logger=require(_0xbcdc('0x1'))(_0xbcdc('0x2'));var moment=require(_0xbcdc('0x3'));var BPromise=require(_0xbcdc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbcdc('0x5'));var rimraf=require(_0xbcdc('0x6'));var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module[_0xbcdc('0x7')]=function(_0x5b5143,_0x48a0ab){return _0x5b5143[_0xbcdc('0x8')](_0xbcdc('0x9'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xbcdc('0xa'),'fields':[_0xbcdc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index ae7d628..a5bc8e2 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x310aed,_0x3ae910){var _0x3208f2=function(_0x28d372){while(--_0x28d372){_0x310aed['push'](_0x310aed['shift']());}};_0x3208f2(++_0x3ae910);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xc4aa[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x15bce3,_0x313900){var _0x5db551=function(_0x5c33a8){while(--_0x5c33a8){_0x15bce3['push'](_0x15bce3['shift']());}};_0x5db551(++_0x313900);}(_0x326f,0xd1));var _0xf326=function(_0x4aacf3,_0x36404e){_0x4aacf3=_0x4aacf3-0x0;var _0x125f06=_0x326f[_0x4aacf3];return _0x125f06;};'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 diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 78f997e..ec6aa51 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x59145a,_0x1f60f1){var _0xf04d7=function(_0x247581){while(--_0x247581){_0x59145a['push'](_0x59145a['shift']());}};_0xf04d7(++_0x1f60f1);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x538484,_0x373398){var _0x1f5f6f=function(_0x4c10c5){while(--_0x4c10c5){_0x538484['push'](_0x538484['shift']());}};_0x1f5f6f(++_0x373398);}(_0x70e0,0x17b));var _0x070e=function(_0x4bfa7d,_0x4c0552){_0x4bfa7d=_0x4bfa7d-0x0;var _0x46cefd=_0x70e0[_0x4bfa7d];return _0x46cefd;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 17e4320..b987950 100644 --- a/server/api/mailServerIn/mailServerIn.attributes.js +++ b/server/api/mailServerIn/mailServerIn.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2929=['sequelize','exports','STRING','INTEGER','BOOLEAN','INBOX'];(function(_0x20bd9d,_0xdcc206){var _0x117cab=function(_0x51f6a3){while(--_0x51f6a3){_0x20bd9d['push'](_0x20bd9d['shift']());}};_0x117cab(++_0xdcc206);}(_0x2929,0xd8));var _0x9292=function(_0x1ef1d5,_0x82bb06){_0x1ef1d5=_0x1ef1d5-0x0;var _0x3672de=_0x2929[_0x1ef1d5];return _0x3672de;};'use strict';var Sequelize=require(_0x9292('0x0'));module[_0x9292('0x1')]={'description':{'type':Sequelize[_0x9292('0x2')]},'host':{'type':Sequelize[_0x9292('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x9292('0x2')]},'password':{'type':Sequelize[_0x9292('0x2')]},'port':{'type':Sequelize[_0x9292('0x3')]},'tls':{'type':Sequelize[_0x9292('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x9292('0x2')],'defaultValue':_0x9292('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x9292('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1a0a=['INBOX','sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x21b232,_0x1b9b77){var _0x54a541=function(_0x466d43){while(--_0x466d43){_0x21b232['push'](_0x21b232['shift']());}};_0x54a541(++_0x1b9b77);}(_0x1a0a,0xcd));var _0xa1a0=function(_0x3f47bd,_0xa1b88c){_0x3f47bd=_0x3f47bd-0x0;var _0x133064=_0x1a0a[_0x3f47bd];return _0x133064;};'use strict';var Sequelize=require(_0xa1a0('0x0'));module[_0xa1a0('0x1')]={'description':{'type':Sequelize[_0xa1a0('0x2')]},'host':{'type':Sequelize[_0xa1a0('0x2')]},'authentication':{'type':Sequelize[_0xa1a0('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xa1a0('0x2')]},'password':{'type':Sequelize[_0xa1a0('0x2')]},'port':{'type':Sequelize[_0xa1a0('0x4')]},'tls':{'type':Sequelize[_0xa1a0('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xa1a0('0x2')],'defaultValue':_0xa1a0('0x5')},'connTimeout':{'type':Sequelize[_0xa1a0('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xa1a0('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xa1a0('0x2')]},'modernAuthentication':{'type':Sequelize[_0xa1a0('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index c713fe8..d29761a 100644 --- a/server/api/mailServerIn/mailServerIn.model.js +++ b/server/api/mailServerIn/mailServerIn.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c8b=['moment','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8c8b,0x159));var _0xb8c8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8c8b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb8c8('0x0'));var util=require(_0xb8c8('0x1'));var logger=require(_0xb8c8('0x2'))('api');var moment=require(_0xb8c8('0x3'));var BPromise=require('bluebird');var rp=require(_0xb8c8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb8c8('0x5'));var config=require(_0xb8c8('0x6'));var attributes=require(_0xb8c8('0x7'));module[_0xb8c8('0x8')]=function(_0x5b5052,_0x5b9441){return _0x5b5052[_0xb8c8('0x9')](_0xb8c8('0xa'),attributes,{'tableName':_0xb8c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbc6=['../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','MailServerIn','lodash','util'];(function(_0x453d39,_0x3f30a8){var _0x180696=function(_0x2f549b){while(--_0x2f549b){_0x453d39['push'](_0x453d39['shift']());}};_0x180696(++_0x3f30a8);}(_0xbbc6,0x8d));var _0x6bbc=function(_0x570d8d,_0x583e9a){_0x570d8d=_0x570d8d-0x0;var _0x3cdb8d=_0xbbc6[_0x570d8d];return _0x3cdb8d;};'use strict';var _=require(_0x6bbc('0x0'));var util=require(_0x6bbc('0x1'));var logger=require(_0x6bbc('0x2'))(_0x6bbc('0x3'));var moment=require(_0x6bbc('0x4'));var BPromise=require(_0x6bbc('0x5'));var rp=require(_0x6bbc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6bbc('0x7'));var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module[_0x6bbc('0x8')]=function(_0x927219,_0x25c269){return _0x927219[_0x6bbc('0x9')](_0x6bbc('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 5cd467f..cf67a1b 100644 --- a/server/api/mailServerIn/mailServerIn.rpc.js +++ b/server/api/mailServerIn/mailServerIn.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98fc=['http','request','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','findAll','options','raw','limit','map','include','model','attributes','then','GetMailServerIn','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x34bf20,_0x292acb){var _0xc1ba1b=function(_0x2519bc){while(--_0x2519bc){_0x34bf20['push'](_0x34bf20['shift']());}};_0xc1ba1b(++_0x292acb);}(_0x98fc,0x156));var _0xc98f=function(_0x625a73,_0x50ae08){_0x625a73=_0x625a73-0x0;var _0x3eceb5=_0x98fc[_0x625a73];return _0x3eceb5;};'use strict';var _=require(_0xc98f('0x0'));var util=require(_0xc98f('0x1'));var moment=require(_0xc98f('0x2'));var BPromise=require(_0xc98f('0x3'));var rs=require(_0xc98f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc98f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc98f('0x6'))('rpc');var config=require(_0xc98f('0x7'));var jayson=require(_0xc98f('0x8'));var client=jayson[_0xc98f('0x9')][_0xc98f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3237e1,_0x1a8812,_0x28f276){return new BPromise(function(_0x191b3f,_0x12bdba){return client[_0xc98f('0xb')](_0x3237e1,_0x28f276)['then'](function(_0xb21d1a){logger['info'](_0xc98f('0xc'),_0x1a8812,_0xc98f('0xd'));logger[_0xc98f('0xe')](_0xc98f('0xf'),_0x1a8812,_0xc98f('0xd'),JSON['stringify'](_0xb21d1a));if(_0xb21d1a['error']){if(_0xb21d1a[_0xc98f('0x10')][_0xc98f('0x11')]===0x1f4){logger[_0xc98f('0x10')](_0xc98f('0xc'),_0x1a8812,_0xb21d1a[_0xc98f('0x10')]['message']);return _0x12bdba(_0xb21d1a[_0xc98f('0x10')][_0xc98f('0x12')]);}logger['error'](_0xc98f('0xc'),_0x1a8812,_0xb21d1a[_0xc98f('0x10')][_0xc98f('0x12')]);return _0x191b3f(_0xb21d1a[_0xc98f('0x10')][_0xc98f('0x12')]);}else{logger[_0xc98f('0x13')]('MailServerIn,\x20%s,\x20%s',_0x1a8812,_0xc98f('0xd'));_0x191b3f(_0xb21d1a[_0xc98f('0x14')]['message']);}})[_0xc98f('0x15')](function(_0x5ef39c){logger[_0xc98f('0x10')](_0xc98f('0xc'),_0x1a8812,_0x5ef39c);_0x12bdba(_0x5ef39c);});});}exports['GetMailServerIn']=function(_0xbed285){var _0x838572=this;return new Promise(function(_0x19e873,_0x53b2e5){return db['MailServerIn'][_0xc98f('0x16')]({'raw':_0xbed285[_0xc98f('0x17')]?_0xbed285[_0xc98f('0x17')][_0xc98f('0x18')]===undefined?!![]:![]:!![],'where':_0xbed285[_0xc98f('0x17')]?_0xbed285[_0xc98f('0x17')]['where']||null:null,'attributes':_0xbed285[_0xc98f('0x17')]?_0xbed285[_0xc98f('0x17')]['attributes']||null:null,'limit':_0xbed285[_0xc98f('0x17')]?_0xbed285[_0xc98f('0x17')][_0xc98f('0x19')]||null:null,'include':_0xbed285[_0xc98f('0x17')]?_0xbed285[_0xc98f('0x17')]['include']?_[_0xc98f('0x1a')](_0xbed285[_0xc98f('0x17')][_0xc98f('0x1b')],function(_0x433576){return{'model':db[_0x433576[_0xc98f('0x1c')]],'as':_0x433576['as'],'attributes':_0x433576[_0xc98f('0x1d')],'include':_0x433576[_0xc98f('0x1b')]?_[_0xc98f('0x1a')](_0x433576[_0xc98f('0x1b')],function(_0x13c9c9){return{'model':db[_0x13c9c9[_0xc98f('0x1c')]],'as':_0x13c9c9['as'],'attributes':_0x13c9c9['attributes'],'include':_0x13c9c9[_0xc98f('0x1b')]?_[_0xc98f('0x1a')](_0x13c9c9[_0xc98f('0x1b')],function(_0x13f9e0){return{'model':db[_0x13f9e0[_0xc98f('0x1c')]],'as':_0x13f9e0['as'],'attributes':_0x13f9e0[_0xc98f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc98f('0x1e')](function(_0x297429){logger['info'](_0xc98f('0x1f'),_0xbed285);logger[_0xc98f('0xe')](_0xc98f('0x1f'),_0xbed285,JSON['stringify'](_0x297429));_0x19e873(_0x297429);})[_0xc98f('0x15')](function(_0x202500){logger[_0xc98f('0x10')](_0xc98f('0x1f'),_0x202500['message'],_0xbed285);_0x53b2e5(_0x838572[_0xc98f('0x10')](0x1f4,_0x202500['message']));});});}; \ No newline at end of file +var _0xf9ec=['debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetMailServerIn','MailServerIn','options','attributes','limit','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','MailServerIn,\x20%s,\x20%s'];(function(_0x234d60,_0x5de6ee){var _0x5e8d45=function(_0x57d6a4){while(--_0x57d6a4){_0x234d60['push'](_0x234d60['shift']());}};_0x5e8d45(++_0x5de6ee);}(_0xf9ec,0x128));var _0xcf9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf9ec[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xcf9e('0x0'));var util=require(_0xcf9e('0x1'));var moment=require(_0xcf9e('0x2'));var BPromise=require(_0xcf9e('0x3'));var rs=require(_0xcf9e('0x4'));var fs=require('fs');var Redis=require(_0xcf9e('0x5'));var db=require(_0xcf9e('0x6'))['db'];var utils=require(_0xcf9e('0x7'));var logger=require('../../config/logger')(_0xcf9e('0x8'));var config=require('../../config/environment');var jayson=require(_0xcf9e('0x9'));var client=jayson['client'][_0xcf9e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15f596,_0x2abc78,_0x18a02a){return new BPromise(function(_0x28be63,_0x5d4b23){return client[_0xcf9e('0xb')](_0x15f596,_0x18a02a)['then'](function(_0x4b2935){logger[_0xcf9e('0xc')](_0xcf9e('0xd'),_0x2abc78,'request\x20sent');logger[_0xcf9e('0xe')](_0xcf9e('0xf'),_0x2abc78,_0xcf9e('0x10'),JSON[_0xcf9e('0x11')](_0x4b2935));if(_0x4b2935[_0xcf9e('0x12')]){if(_0x4b2935[_0xcf9e('0x12')][_0xcf9e('0x13')]===0x1f4){logger[_0xcf9e('0x12')](_0xcf9e('0xd'),_0x2abc78,_0x4b2935[_0xcf9e('0x12')][_0xcf9e('0x14')]);return _0x5d4b23(_0x4b2935[_0xcf9e('0x12')][_0xcf9e('0x14')]);}logger[_0xcf9e('0x12')](_0xcf9e('0xd'),_0x2abc78,_0x4b2935[_0xcf9e('0x12')][_0xcf9e('0x14')]);return _0x28be63(_0x4b2935[_0xcf9e('0x12')]['message']);}else{logger['info'](_0xcf9e('0xd'),_0x2abc78,'request\x20sent');_0x28be63(_0x4b2935['result'][_0xcf9e('0x14')]);}})[_0xcf9e('0x15')](function(_0x4d307a){logger['error']('MailServerIn,\x20%s,\x20%s',_0x2abc78,_0x4d307a);_0x5d4b23(_0x4d307a);});});}exports[_0xcf9e('0x16')]=function(_0x3a9e24){var _0x5e9cc7=this;return new Promise(function(_0x1c3852,_0x9e46ce){return db[_0xcf9e('0x17')]['findAll']({'raw':_0x3a9e24[_0xcf9e('0x18')]?_0x3a9e24[_0xcf9e('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3a9e24[_0xcf9e('0x18')]?_0x3a9e24['options']['where']||null:null,'attributes':_0x3a9e24[_0xcf9e('0x18')]?_0x3a9e24['options'][_0xcf9e('0x19')]||null:null,'limit':_0x3a9e24[_0xcf9e('0x18')]?_0x3a9e24[_0xcf9e('0x18')][_0xcf9e('0x1a')]||null:null,'include':_0x3a9e24[_0xcf9e('0x18')]?_0x3a9e24[_0xcf9e('0x18')][_0xcf9e('0x1b')]?_[_0xcf9e('0x1c')](_0x3a9e24[_0xcf9e('0x18')][_0xcf9e('0x1b')],function(_0x161aca){return{'model':db[_0x161aca['model']],'as':_0x161aca['as'],'attributes':_0x161aca[_0xcf9e('0x19')],'include':_0x161aca[_0xcf9e('0x1b')]?_[_0xcf9e('0x1c')](_0x161aca[_0xcf9e('0x1b')],function(_0x42e2fc){return{'model':db[_0x42e2fc[_0xcf9e('0x1d')]],'as':_0x42e2fc['as'],'attributes':_0x42e2fc[_0xcf9e('0x19')],'include':_0x42e2fc[_0xcf9e('0x1b')]?_['map'](_0x42e2fc[_0xcf9e('0x1b')],function(_0x340e4f){return{'model':db[_0x340e4f[_0xcf9e('0x1d')]],'as':_0x340e4f['as'],'attributes':_0x340e4f[_0xcf9e('0x19')]};}):[]};}):[]};}):[]:[]})[_0xcf9e('0x1e')](function(_0x36c188){logger['info'](_0xcf9e('0x16'),_0x3a9e24);logger[_0xcf9e('0xe')]('GetMailServerIn',_0x3a9e24,JSON[_0xcf9e('0x11')](_0x36c188));_0x1c3852(_0x36c188);})[_0xcf9e('0x15')](function(_0xf1f32b){logger[_0xcf9e('0x12')](_0xcf9e('0x16'),_0xf1f32b[_0xcf9e('0x14')],_0x3a9e24);_0x9e46ce(_0x5e9cc7['error'](0x1f4,_0xf1f32b[_0xcf9e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 484fc87..0988932 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x7a54,0x106));var _0x47a5=function(_0x394243,_0x5715f0){_0x394243=_0x394243-0x0;var _0x106fbc=_0x7a54[_0x394243];return _0x106fbc;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x7a54,0x106));var _0x47a5=function(_0x2f563c,_0x55f4df){_0x2f563c=_0x2f563c-0x0;var _0x4d7d1f=_0x7a54[_0x2f563c];return _0x4d7d1f;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 47057a8..5b5f43e 100644 --- a/server/api/mailServerOut/mailServerOut.attributes.js +++ b/server/api/mailServerOut/mailServerOut.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cf8=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x5618a9,_0x2654f8){var _0x16ba86=function(_0x4924a5){while(--_0x4924a5){_0x5618a9['push'](_0x5618a9['shift']());}};_0x16ba86(++_0x2654f8);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x499d15,_0x5376c1){_0x499d15=_0x499d15-0x0;var _0x189291=_0x4cf8[_0x499d15];return _0x189291;};'use strict';var Sequelize=require(_0x84cf('0x0'));module[_0x84cf('0x1')]={'description':{'type':Sequelize[_0x84cf('0x2')]},'host':{'type':Sequelize[_0x84cf('0x2')]},'user':{'type':Sequelize[_0x84cf('0x2')]},'pass':{'type':Sequelize[_0x84cf('0x2')]},'port':{'type':Sequelize[_0x84cf('0x3')]},'secure':{'type':Sequelize[_0x84cf('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x84cf('0x2')]},'authentication':{'type':Sequelize[_0x84cf('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x84cf('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xe820=['INTEGER','BOOLEAN','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe820,0xd2));var _0x0e82=function(_0x2c6175,_0x3c50a6){_0x2c6175=_0x2c6175-0x0;var _0x5148d0=_0xe820[_0x2c6175];return _0x5148d0;};'use strict';var Sequelize=require(_0x0e82('0x0'));module['exports']={'description':{'type':Sequelize[_0x0e82('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x0e82('0x1')]},'port':{'type':Sequelize[_0x0e82('0x2')]},'secure':{'type':Sequelize[_0x0e82('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x0e82('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 7eb8d7a..d203eca 100644 --- a/server/api/mailServerOut/mailServerOut.controller.js +++ b/server/api/mailServerOut/mailServerOut.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc18=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','map','MailServerOut','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x5877ec,_0x1b418b){var _0x37b1b9=function(_0x25bf9d){while(--_0x25bf9d){_0x5877ec['push'](_0x5877ec['shift']());}};_0x37b1b9(++_0x1b418b);}(_0xfc18,0x17f));var _0x8fc1=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xfc18[_0xa8883];return _0x479426;};'use strict';var emlformat=require(_0x8fc1('0x0'));var rimraf=require(_0x8fc1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8fc1('0x2'));var rp=require(_0x8fc1('0x3'));var moment=require(_0x8fc1('0x4'));var BPromise=require(_0x8fc1('0x5'));var Mustache=require(_0x8fc1('0x6'));var util=require(_0x8fc1('0x7'));var path=require(_0x8fc1('0x8'));var sox=require(_0x8fc1('0x9'));var csv=require(_0x8fc1('0xa'));var ejs=require(_0x8fc1('0xb'));var fs=require('fs');var fs_extra=require(_0x8fc1('0xc'));var _=require(_0x8fc1('0xd'));var squel=require(_0x8fc1('0xe'));var crypto=require(_0x8fc1('0xf'));var jsforce=require(_0x8fc1('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x8fc1('0xa'));var querystring=require(_0x8fc1('0x11'));var Papa=require('papaparse');var Redis=require(_0x8fc1('0x12'));var authService=require(_0x8fc1('0x13'));var qs=require(_0x8fc1('0x14'));var as=require(_0x8fc1('0x15'));var hardwareService=require(_0x8fc1('0x16'));var logger=require(_0x8fc1('0x17'))('api');var utils=require(_0x8fc1('0x18'));var config=require(_0x8fc1('0x19'));var licenseUtil=require(_0x8fc1('0x1a'));var db=require(_0x8fc1('0x1b'))['db'];function respondWithStatusCode(_0x563539,_0x4b89dd){_0x4b89dd=_0x4b89dd||0xcc;return function(_0xac268a){if(_0xac268a){return _0x563539[_0x8fc1('0x1c')](_0x4b89dd);}return _0x563539['status'](_0x4b89dd)[_0x8fc1('0x1d')]();};}function respondWithResult(_0x2b6df6,_0x122fd7){_0x122fd7=_0x122fd7||0xc8;return function(_0x506a4b){if(_0x506a4b){return _0x2b6df6[_0x8fc1('0x1e')](_0x122fd7)[_0x8fc1('0x1f')](_0x506a4b);}};}function respondWithFilteredResult(_0x4d458b,_0x3ce63e){return function(_0x406094){if(_0x406094){var _0x1cca61=typeof _0x3ce63e[_0x8fc1('0x20')]===_0x8fc1('0x21')&&typeof _0x3ce63e[_0x8fc1('0x22')]===_0x8fc1('0x21');var _0x572aa3=_0x406094[_0x8fc1('0x23')];var _0x8c076c=_0x1cca61?0x0:_0x3ce63e[_0x8fc1('0x20')];var _0x471b20=_0x1cca61?_0x406094[_0x8fc1('0x23')]:_0x3ce63e[_0x8fc1('0x20')]+_0x3ce63e[_0x8fc1('0x22')];var _0x2601da;if(_0x471b20>=_0x572aa3){_0x471b20=_0x572aa3;_0x2601da=0xc8;}else{_0x2601da=0xce;}_0x4d458b[_0x8fc1('0x1e')](_0x2601da);return _0x4d458b[_0x8fc1('0x24')](_0x8fc1('0x25'),_0x8c076c+'-'+_0x471b20+'/'+_0x572aa3)[_0x8fc1('0x1f')](_0x406094);}return null;};}function patchUpdates(_0x57bca7){return function(_0x4fd68b){try{jsonpatch[_0x8fc1('0x26')](_0x4fd68b,_0x57bca7,!![]);}catch(_0x424f05){return BPromise[_0x8fc1('0x27')](_0x424f05);}return _0x4fd68b['save']();};}function saveUpdates(_0x5c5731,_0x3c2885){return function(_0x5da326){if(_0x5da326){return _0x5da326[_0x8fc1('0x28')](_0x5c5731)[_0x8fc1('0x29')](function(_0x41cb26){return _0x41cb26;});}return null;};}function removeEntity(_0x5f3e23,_0x289797){return function(_0x3f17fa){if(_0x3f17fa){return _0x3f17fa['destroy']()[_0x8fc1('0x29')](function(){_0x5f3e23[_0x8fc1('0x1e')](0xcc)[_0x8fc1('0x1d')]();});}};}function handleEntityNotFound(_0x166051,_0x31afe3){return function(_0x16670e){if(!_0x16670e){_0x166051['sendStatus'](0x194);}return _0x16670e;};}function handleError(_0x1be6ba,_0x73d0ca){_0x73d0ca=_0x73d0ca||0x1f4;return function(_0x5efb03){logger[_0x8fc1('0x2a')](_0x5efb03[_0x8fc1('0x2b')]);if(_0x5efb03[_0x8fc1('0x2c')]){delete _0x5efb03[_0x8fc1('0x2c')];}_0x1be6ba[_0x8fc1('0x1e')](_0x73d0ca)[_0x8fc1('0x2d')](_0x5efb03);};}exports['index']=function(_0x19e942,_0x789224){var _0x128e5a={},_0x4faa4a={},_0x47d887={'count':0x0,'rows':[]};var _0x1a4c2a=_[_0x8fc1('0x2e')](db[_0x8fc1('0x2f')][_0x8fc1('0x30')],function(_0x4e38a1){return{'name':_0x4e38a1[_0x8fc1('0x31')],'type':_0x4e38a1['type'][_0x8fc1('0x32')]};});_0x4faa4a[_0x8fc1('0x33')]=_[_0x8fc1('0x2e')](_0x1a4c2a,'name');_0x4faa4a[_0x8fc1('0x34')]=_[_0x8fc1('0x35')](_0x19e942['query']);_0x4faa4a['filters']=_[_0x8fc1('0x36')](_0x4faa4a[_0x8fc1('0x33')],_0x4faa4a[_0x8fc1('0x34')]);_0x128e5a[_0x8fc1('0x37')]=_[_0x8fc1('0x36')](_0x4faa4a[_0x8fc1('0x33')],qs[_0x8fc1('0x38')](_0x19e942[_0x8fc1('0x34')]['fields']));_0x128e5a[_0x8fc1('0x37')]=_0x128e5a['attributes'][_0x8fc1('0x39')]?_0x128e5a['attributes']:_0x4faa4a[_0x8fc1('0x33')];if(!_0x19e942[_0x8fc1('0x34')]['hasOwnProperty'](_0x8fc1('0x3a'))){_0x128e5a[_0x8fc1('0x22')]=qs['limit'](_0x19e942['query'][_0x8fc1('0x22')]);_0x128e5a[_0x8fc1('0x20')]=qs[_0x8fc1('0x20')](_0x19e942[_0x8fc1('0x34')]['offset']);}_0x128e5a[_0x8fc1('0x3b')]=qs[_0x8fc1('0x3c')](_0x19e942[_0x8fc1('0x34')][_0x8fc1('0x3c')]);_0x128e5a[_0x8fc1('0x3d')]=qs[_0x8fc1('0x3e')](_[_0x8fc1('0x3f')](_0x19e942[_0x8fc1('0x34')],_0x4faa4a[_0x8fc1('0x3e')]),_0x1a4c2a);if(_0x19e942['query'][_0x8fc1('0x40')]){_0x128e5a['where']=_[_0x8fc1('0x41')](_0x128e5a[_0x8fc1('0x3d')],{'$or':_[_0x8fc1('0x2e')](_0x1a4c2a,function(_0x2d4970){if(_0x2d4970[_0x8fc1('0x42')]!=='VIRTUAL'){var _0xf469d7={};_0xf469d7[_0x2d4970[_0x8fc1('0x2c')]]={'$like':'%'+_0x19e942[_0x8fc1('0x34')]['filter']+'%'};return _0xf469d7;}})});}_0x128e5a=_[_0x8fc1('0x41')]({},_0x128e5a,_0x19e942['options']);var _0x53ba3c={'where':_0x128e5a[_0x8fc1('0x3d')]};return db[_0x8fc1('0x2f')][_0x8fc1('0x23')](_0x53ba3c)[_0x8fc1('0x29')](function(_0x250d1b){_0x47d887['count']=_0x250d1b;if(_0x19e942['query'][_0x8fc1('0x43')]){_0x128e5a[_0x8fc1('0x44')]=[{'all':!![]}];}return db[_0x8fc1('0x2f')][_0x8fc1('0x45')](_0x128e5a);})['then'](function(_0x2bda00){_0x47d887[_0x8fc1('0x46')]=_0x2bda00;return _0x47d887;})[_0x8fc1('0x29')](respondWithFilteredResult(_0x789224,_0x128e5a))[_0x8fc1('0x47')](handleError(_0x789224,null));};exports[_0x8fc1('0x48')]=function(_0x284147,_0x47cac3){var _0x10f32f={'raw':!![],'where':{'id':_0x284147[_0x8fc1('0x49')]['id']}},_0x1c31b7={};_0x1c31b7[_0x8fc1('0x33')]=_['keys'](db[_0x8fc1('0x2f')][_0x8fc1('0x30')]);_0x1c31b7[_0x8fc1('0x34')]=_['keys'](_0x284147[_0x8fc1('0x34')]);_0x1c31b7[_0x8fc1('0x3e')]=_[_0x8fc1('0x36')](_0x1c31b7['model'],_0x1c31b7[_0x8fc1('0x34')]);_0x10f32f[_0x8fc1('0x37')]=_[_0x8fc1('0x36')](_0x1c31b7['model'],qs['fields'](_0x284147[_0x8fc1('0x34')][_0x8fc1('0x38')]));_0x10f32f['attributes']=_0x10f32f['attributes']['length']?_0x10f32f[_0x8fc1('0x37')]:_0x1c31b7[_0x8fc1('0x33')];if(_0x284147[_0x8fc1('0x34')][_0x8fc1('0x43')]){_0x10f32f['include']=[{'all':!![]}];}_0x10f32f=_[_0x8fc1('0x41')]({},_0x10f32f,_0x284147['options']);return db['MailServerOut'][_0x8fc1('0x4a')](_0x10f32f)[_0x8fc1('0x29')](handleEntityNotFound(_0x47cac3,null))[_0x8fc1('0x29')](respondWithResult(_0x47cac3,null))[_0x8fc1('0x47')](handleError(_0x47cac3,null));};exports[_0x8fc1('0x4b')]=function(_0x104e35,_0x7918d5){return db['MailServerOut'][_0x8fc1('0x4b')](_0x104e35[_0x8fc1('0x4c')],{})['then'](respondWithResult(_0x7918d5,0xc9))[_0x8fc1('0x47')](handleError(_0x7918d5,null));};exports['update']=function(_0x767991,_0x292bf7){if(_0x767991[_0x8fc1('0x4c')]['id']){delete _0x767991[_0x8fc1('0x4c')]['id'];}return db['MailServerOut'][_0x8fc1('0x4a')]({'where':{'id':_0x767991[_0x8fc1('0x49')]['id']}})[_0x8fc1('0x29')](handleEntityNotFound(_0x292bf7,null))['then'](saveUpdates(_0x767991[_0x8fc1('0x4c')],null))[_0x8fc1('0x29')](respondWithResult(_0x292bf7,null))[_0x8fc1('0x47')](handleError(_0x292bf7,null));};exports[_0x8fc1('0x4d')]=function(_0x1e5685,_0x30decd){return db['MailServerOut']['find']({'where':{'id':_0x1e5685[_0x8fc1('0x49')]['id']}})[_0x8fc1('0x29')](handleEntityNotFound(_0x30decd,null))[_0x8fc1('0x29')](removeEntity(_0x30decd,null))[_0x8fc1('0x47')](handleError(_0x30decd,null));}; \ No newline at end of file +var _0xf95e=['offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','includeAll','rows','catch','show','include','options','find','create','body','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x405f28,_0x3ea99f){var _0x1a6075=function(_0x1d8d30){while(--_0x1d8d30){_0x405f28['push'](_0x405f28['shift']());}};_0x1a6075(++_0x3ea99f);}(_0xf95e,0x106));var _0xef95=function(_0x5e4d4c,_0x329d62){_0x5e4d4c=_0x5e4d4c-0x0;var _0x431016=_0xf95e[_0x5e4d4c];return _0x431016;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef95('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xef95('0x1'));var rp=require(_0xef95('0x2'));var moment=require(_0xef95('0x3'));var BPromise=require(_0xef95('0x4'));var Mustache=require(_0xef95('0x5'));var util=require('util');var path=require(_0xef95('0x6'));var sox=require(_0xef95('0x7'));var csv=require(_0xef95('0x8'));var ejs=require(_0xef95('0x9'));var fs=require('fs');var fs_extra=require(_0xef95('0xa'));var _=require('lodash');var squel=require(_0xef95('0xb'));var crypto=require(_0xef95('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xef95('0xd'));var Papa=require(_0xef95('0xe'));var Redis=require(_0xef95('0xf'));var authService=require(_0xef95('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xef95('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xef95('0x12'))(_0xef95('0x13'));var utils=require(_0xef95('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xef95('0x15'));var db=require(_0xef95('0x16'))['db'];function respondWithStatusCode(_0x4b7185,_0x4a557b){_0x4a557b=_0x4a557b||0xcc;return function(_0x55b73b){if(_0x55b73b){return _0x4b7185[_0xef95('0x17')](_0x4a557b);}return _0x4b7185[_0xef95('0x18')](_0x4a557b)['end']();};}function respondWithResult(_0x14a2e1,_0x223a0c){_0x223a0c=_0x223a0c||0xc8;return function(_0x296aae){if(_0x296aae){return _0x14a2e1[_0xef95('0x18')](_0x223a0c)[_0xef95('0x19')](_0x296aae);}};}function respondWithFilteredResult(_0x21c87e,_0x41144f){return function(_0x1d7ae5){if(_0x1d7ae5){var _0x3086c9=typeof _0x41144f[_0xef95('0x1a')]===_0xef95('0x1b')&&typeof _0x41144f[_0xef95('0x1c')]==='undefined';var _0x4d2302=_0x1d7ae5['count'];var _0x571482=_0x3086c9?0x0:_0x41144f[_0xef95('0x1a')];var _0xd21790=_0x3086c9?_0x1d7ae5[_0xef95('0x1d')]:_0x41144f['offset']+_0x41144f[_0xef95('0x1c')];var _0x1af518;if(_0xd21790>=_0x4d2302){_0xd21790=_0x4d2302;_0x1af518=0xc8;}else{_0x1af518=0xce;}_0x21c87e[_0xef95('0x18')](_0x1af518);return _0x21c87e[_0xef95('0x1e')](_0xef95('0x1f'),_0x571482+'-'+_0xd21790+'/'+_0x4d2302)[_0xef95('0x19')](_0x1d7ae5);}return null;};}function patchUpdates(_0x8bb33f){return function(_0x442460){try{jsonpatch[_0xef95('0x20')](_0x442460,_0x8bb33f,!![]);}catch(_0x4fa710){return BPromise[_0xef95('0x21')](_0x4fa710);}return _0x442460['save']();};}function saveUpdates(_0x2dca59,_0x391e7f){return function(_0x1383ac){if(_0x1383ac){return _0x1383ac[_0xef95('0x22')](_0x2dca59)[_0xef95('0x23')](function(_0x5387f9){return _0x5387f9;});}return null;};}function removeEntity(_0x79f3d2,_0x57d6f4){return function(_0x32e2f5){if(_0x32e2f5){return _0x32e2f5[_0xef95('0x24')]()[_0xef95('0x23')](function(){_0x79f3d2[_0xef95('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25e755,_0x1de27c){return function(_0x3cd240){if(!_0x3cd240){_0x25e755[_0xef95('0x17')](0x194);}return _0x3cd240;};}function handleError(_0xa71ae,_0x982021){_0x982021=_0x982021||0x1f4;return function(_0x5096d0){logger[_0xef95('0x25')](_0x5096d0[_0xef95('0x26')]);if(_0x5096d0[_0xef95('0x27')]){delete _0x5096d0['name'];}_0xa71ae[_0xef95('0x18')](_0x982021)[_0xef95('0x28')](_0x5096d0);};}exports[_0xef95('0x29')]=function(_0x18846e,_0x57d32e){var _0x1d7c43={},_0x49c37c={},_0x2e3d8f={'count':0x0,'rows':[]};var _0x1ea19f=_[_0xef95('0x2a')](db[_0xef95('0x2b')][_0xef95('0x2c')],function(_0x4ead5c){return{'name':_0x4ead5c[_0xef95('0x2d')],'type':_0x4ead5c[_0xef95('0x2e')][_0xef95('0x2f')]};});_0x49c37c[_0xef95('0x30')]=_[_0xef95('0x2a')](_0x1ea19f,_0xef95('0x27'));_0x49c37c[_0xef95('0x31')]=_[_0xef95('0x32')](_0x18846e[_0xef95('0x31')]);_0x49c37c[_0xef95('0x33')]=_[_0xef95('0x34')](_0x49c37c[_0xef95('0x30')],_0x49c37c[_0xef95('0x31')]);_0x1d7c43['attributes']=_[_0xef95('0x34')](_0x49c37c[_0xef95('0x30')],qs[_0xef95('0x35')](_0x18846e[_0xef95('0x31')][_0xef95('0x35')]));_0x1d7c43[_0xef95('0x36')]=_0x1d7c43['attributes'][_0xef95('0x37')]?_0x1d7c43['attributes']:_0x49c37c[_0xef95('0x30')];if(!_0x18846e['query'][_0xef95('0x38')]('nolimit')){_0x1d7c43[_0xef95('0x1c')]=qs[_0xef95('0x1c')](_0x18846e['query'][_0xef95('0x1c')]);_0x1d7c43[_0xef95('0x1a')]=qs['offset'](_0x18846e[_0xef95('0x31')][_0xef95('0x1a')]);}_0x1d7c43['order']=qs[_0xef95('0x39')](_0x18846e[_0xef95('0x31')]['sort']);_0x1d7c43[_0xef95('0x3a')]=qs[_0xef95('0x33')](_[_0xef95('0x3b')](_0x18846e['query'],_0x49c37c[_0xef95('0x33')]),_0x1ea19f);if(_0x18846e['query'][_0xef95('0x3c')]){_0x1d7c43['where']=_[_0xef95('0x3d')](_0x1d7c43[_0xef95('0x3a')],{'$or':_[_0xef95('0x2a')](_0x1ea19f,function(_0x429fe0){if(_0x429fe0[_0xef95('0x2e')]!=='VIRTUAL'){var _0x280c73={};_0x280c73[_0x429fe0['name']]={'$like':'%'+_0x18846e[_0xef95('0x31')][_0xef95('0x3c')]+'%'};return _0x280c73;}})});}_0x1d7c43=_['merge']({},_0x1d7c43,_0x18846e['options']);var _0x49ea99={'where':_0x1d7c43[_0xef95('0x3a')]};return db[_0xef95('0x2b')][_0xef95('0x1d')](_0x49ea99)[_0xef95('0x23')](function(_0x3a9ceb){_0x2e3d8f['count']=_0x3a9ceb;if(_0x18846e[_0xef95('0x31')][_0xef95('0x3e')]){_0x1d7c43['include']=[{'all':!![]}];}return db[_0xef95('0x2b')]['findAll'](_0x1d7c43);})[_0xef95('0x23')](function(_0x4d9b5d){_0x2e3d8f[_0xef95('0x3f')]=_0x4d9b5d;return _0x2e3d8f;})[_0xef95('0x23')](respondWithFilteredResult(_0x57d32e,_0x1d7c43))[_0xef95('0x40')](handleError(_0x57d32e,null));};exports[_0xef95('0x41')]=function(_0x22043b,_0x59869c){var _0x552d80={'raw':!![],'where':{'id':_0x22043b['params']['id']}},_0x52cf28={};_0x52cf28[_0xef95('0x30')]=_[_0xef95('0x32')](db[_0xef95('0x2b')][_0xef95('0x2c')]);_0x52cf28['query']=_[_0xef95('0x32')](_0x22043b[_0xef95('0x31')]);_0x52cf28[_0xef95('0x33')]=_['intersection'](_0x52cf28[_0xef95('0x30')],_0x52cf28[_0xef95('0x31')]);_0x552d80[_0xef95('0x36')]=_['intersection'](_0x52cf28[_0xef95('0x30')],qs['fields'](_0x22043b[_0xef95('0x31')][_0xef95('0x35')]));_0x552d80[_0xef95('0x36')]=_0x552d80[_0xef95('0x36')][_0xef95('0x37')]?_0x552d80[_0xef95('0x36')]:_0x52cf28['model'];if(_0x22043b[_0xef95('0x31')]['includeAll']){_0x552d80[_0xef95('0x42')]=[{'all':!![]}];}_0x552d80=_[_0xef95('0x3d')]({},_0x552d80,_0x22043b[_0xef95('0x43')]);return db[_0xef95('0x2b')][_0xef95('0x44')](_0x552d80)[_0xef95('0x23')](handleEntityNotFound(_0x59869c,null))[_0xef95('0x23')](respondWithResult(_0x59869c,null))['catch'](handleError(_0x59869c,null));};exports[_0xef95('0x45')]=function(_0x522324,_0x314384){return db[_0xef95('0x2b')]['create'](_0x522324[_0xef95('0x46')],{})[_0xef95('0x23')](respondWithResult(_0x314384,0xc9))[_0xef95('0x40')](handleError(_0x314384,null));};exports[_0xef95('0x22')]=function(_0x1f4edd,_0xe85078){if(_0x1f4edd[_0xef95('0x46')]['id']){delete _0x1f4edd[_0xef95('0x46')]['id'];}return db[_0xef95('0x2b')][_0xef95('0x44')]({'where':{'id':_0x1f4edd[_0xef95('0x47')]['id']}})[_0xef95('0x23')](handleEntityNotFound(_0xe85078,null))[_0xef95('0x23')](saveUpdates(_0x1f4edd['body'],null))[_0xef95('0x23')](respondWithResult(_0xe85078,null))['catch'](handleError(_0xe85078,null));};exports['destroy']=function(_0x1a64d0,_0x4d5d30){return db[_0xef95('0x2b')][_0xef95('0x44')]({'where':{'id':_0x1a64d0[_0xef95('0x47')]['id']}})[_0xef95('0x23')](handleEntityNotFound(_0x4d5d30,null))[_0xef95('0x23')](removeEntity(_0x4d5d30,null))['catch'](handleError(_0x4d5d30,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 39e9228..1631c53 100644 --- a/server/api/mailServerOut/mailServerOut.model.js +++ b/server/api/mailServerOut/mailServerOut.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ad4=['api','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger'];(function(_0x1fbb56,_0x22b4f8){var _0x562df4=function(_0x3f6958){while(--_0x3f6958){_0x1fbb56['push'](_0x1fbb56['shift']());}};_0x562df4(++_0x22b4f8);}(_0x9ad4,0x190));var _0x49ad=function(_0x526298,_0x2ec3ba){_0x526298=_0x526298-0x0;var _0x467835=_0x9ad4[_0x526298];return _0x467835;};'use strict';var _=require(_0x49ad('0x0'));var util=require(_0x49ad('0x1'));var logger=require(_0x49ad('0x2'))(_0x49ad('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x49ad('0x4'));var fs=require('fs');var path=require(_0x49ad('0x5'));var rimraf=require(_0x49ad('0x6'));var config=require(_0x49ad('0x7'));var attributes=require(_0x49ad('0x8'));module[_0x49ad('0x9')]=function(_0x52f25f,_0x1af052){return _0x52f25f[_0x49ad('0xa')](_0x49ad('0xb'),attributes,{'tableName':_0x49ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb45c=['lodash','api','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','define','MailServerOut','mail_servers_out'];(function(_0x290cdc,_0x24138b){var _0x516668=function(_0x3e04ae){while(--_0x3e04ae){_0x290cdc['push'](_0x290cdc['shift']());}};_0x516668(++_0x24138b);}(_0xb45c,0x140));var _0xcb45=function(_0x5da2d6,_0x28ab1a){_0x5da2d6=_0x5da2d6-0x0;var _0x390b81=_0xb45c[_0x5da2d6];return _0x390b81;};'use strict';var _=require(_0xcb45('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcb45('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcb45('0x2'));var fs=require('fs');var path=require(_0xcb45('0x3'));var rimraf=require(_0xcb45('0x4'));var config=require(_0xcb45('0x5'));var attributes=require(_0xcb45('0x6'));module['exports']=function(_0x5092dd,_0x139f44){return _0x5092dd[_0xcb45('0x7')](_0xcb45('0x8'),attributes,{'tableName':_0xcb45('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index c4572de..9e9bae4 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x5017a2,_0x17f919){_0x5017a2=_0x5017a2-0x0;var _0x11449a=_0x7a54[_0x5017a2];return _0x11449a;};'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')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x35505b,_0x1cf27c){var _0x3bff78=function(_0x2158bf){while(--_0x2158bf){_0x35505b['push'](_0x35505b['shift']());}};_0x3bff78(++_0x1cf27c);}(_0x1261,0x144));var _0x1126=function(_0x1e4177,_0x26a73a){_0x1e4177=_0x1e4177-0x0;var _0xa6e76c=_0x1261[_0x1e4177];return _0xa6e76c;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 020e6ce..c7f25f4 100644 --- a/server/api/mailSubstatus/index.js +++ b/server/api/mailSubstatus/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50c5=['destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','describe','/:id','show','post','create'];(function(_0x478c8a,_0x9afc92){var _0x3b6b3e=function(_0x37634e){while(--_0x37634e){_0x478c8a['push'](_0x478c8a['shift']());}};_0x3b6b3e(++_0x9afc92);}(_0x50c5,0xbd));var _0x550c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x50c5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x550c('0x0'));var path=require('path');var timeout=require(_0x550c('0x1'));var express=require('express');var router=express[_0x550c('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x550c('0x3'));var interaction=require(_0x550c('0x4'));var config=require(_0x550c('0x5'));var controller=require(_0x550c('0x6'));router['get']('/',auth[_0x550c('0x7')](),controller[_0x550c('0x8')]);router[_0x550c('0x9')]('/describe',auth[_0x550c('0x7')](),controller[_0x550c('0xa')]);router[_0x550c('0x9')](_0x550c('0xb'),auth[_0x550c('0x7')](),controller[_0x550c('0xc')]);router[_0x550c('0xd')]('/',auth[_0x550c('0x7')](),controller[_0x550c('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x550c('0xb'),auth[_0x550c('0x7')](),controller[_0x550c('0xf')]);module[_0x550c('0x10')]=router; \ No newline at end of file +var _0xec7e=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete'];(function(_0x4ba380,_0x259bee){var _0x4b111b=function(_0x2bf227){while(--_0x2bf227){_0x4ba380['push'](_0x4ba380['shift']());}};_0x4b111b(++_0x259bee);}(_0xec7e,0x144));var _0xeec7=function(_0x4d2d79,_0x4c0494){_0x4d2d79=_0x4d2d79-0x0;var _0x176ed6=_0xec7e[_0x4d2d79];return _0x176ed6;};'use strict';var multer=require(_0xeec7('0x0'));var util=require(_0xeec7('0x1'));var path=require(_0xeec7('0x2'));var timeout=require(_0xeec7('0x3'));var express=require(_0xeec7('0x4'));var router=express[_0xeec7('0x5')]();var fs_extra=require(_0xeec7('0x6'));var auth=require(_0xeec7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xeec7('0x8'));var controller=require(_0xeec7('0x9'));router[_0xeec7('0xa')]('/',auth['isAuthenticated'](),controller[_0xeec7('0xb')]);router[_0xeec7('0xa')](_0xeec7('0xc'),auth[_0xeec7('0xd')](),controller[_0xeec7('0xe')]);router['get'](_0xeec7('0xf'),auth['isAuthenticated'](),controller[_0xeec7('0x10')]);router['post']('/',auth[_0xeec7('0xd')](),controller[_0xeec7('0x11')]);router[_0xeec7('0x12')](_0xeec7('0xf'),auth['isAuthenticated'](),controller[_0xeec7('0x13')]);router[_0xeec7('0x14')](_0xeec7('0xf'),auth['isAuthenticated'](),controller[_0xeec7('0x15')]);module[_0xeec7('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 5d47f75..79081a0 100644 --- a/server/api/mailSubstatus/mailSubstatus.attributes.js +++ b/server/api/mailSubstatus/mailSubstatus.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x885a=['exports','STRING','name'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x885a,0x180));var _0xa885=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x885a[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require('sequelize');module[_0xa885('0x0')]={'name':{'type':Sequelize[_0xa885('0x1')],'unique':_0xa885('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa885('0x1')]}}; \ No newline at end of file +var _0xe2bc=['sequelize','STRING'];(function(_0x20cff7,_0x47a279){var _0x593346=function(_0x11913b){while(--_0x11913b){_0x20cff7['push'](_0x20cff7['shift']());}};_0x593346(++_0x47a279);}(_0xe2bc,0x1a6));var _0xce2b=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xe2bc[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require(_0xce2b('0x0'));module['exports']={'name':{'type':Sequelize[_0xce2b('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xce2b('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 0f33e6a..9829ee1 100644 --- a/server/api/mailSubstatus/mailSubstatus.controller.js +++ b/server/api/mailSubstatus/mailSubstatus.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc144=['index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','map','merge','options','MailSubstatus','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','lodash','squel','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send'];(function(_0x34933a,_0x327378){var _0x36abb4=function(_0x2d6814){while(--_0x2d6814){_0x34933a['push'](_0x34933a['shift']());}};_0x36abb4(++_0x327378);}(_0xc144,0x66));var _0x4c14=function(_0x452aa7,_0x15ec35){_0x452aa7=_0x452aa7-0x0;var _0x11d929=_0xc144[_0x452aa7];return _0x11d929;};'use strict';var emlformat=require(_0x4c14('0x0'));var rimraf=require(_0x4c14('0x1'));var zipdir=require(_0x4c14('0x2'));var jsonpatch=require(_0x4c14('0x3'));var rp=require(_0x4c14('0x4'));var moment=require(_0x4c14('0x5'));var BPromise=require(_0x4c14('0x6'));var Mustache=require('mustache');var util=require(_0x4c14('0x7'));var path=require(_0x4c14('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(_0x4c14('0x9'));var squel=require(_0x4c14('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4c14('0xb'));var querystring=require('querystring');var Papa=require(_0x4c14('0xc'));var Redis=require(_0x4c14('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4c14('0xe'));var as=require(_0x4c14('0xf'));var hardwareService=require(_0x4c14('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4c14('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x431665,_0x446eb9){_0x446eb9=_0x446eb9||0xcc;return function(_0x139276){if(_0x139276){return _0x431665[_0x4c14('0x12')](_0x446eb9);}return _0x431665[_0x4c14('0x13')](_0x446eb9)['end']();};}function respondWithResult(_0x555740,_0xe5c106){_0xe5c106=_0xe5c106||0xc8;return function(_0x456e17){if(_0x456e17){return _0x555740[_0x4c14('0x13')](_0xe5c106)[_0x4c14('0x14')](_0x456e17);}};}function respondWithFilteredResult(_0x12fa86,_0x2a2e81){return function(_0x11d20e){if(_0x11d20e){var _0x14a983=typeof _0x2a2e81[_0x4c14('0x15')]===_0x4c14('0x16')&&typeof _0x2a2e81[_0x4c14('0x17')]===_0x4c14('0x16');var _0x57b21d=_0x11d20e[_0x4c14('0x18')];var _0x1da59a=_0x14a983?0x0:_0x2a2e81['offset'];var _0x4a0352=_0x14a983?_0x11d20e[_0x4c14('0x18')]:_0x2a2e81[_0x4c14('0x15')]+_0x2a2e81[_0x4c14('0x17')];var _0x222851;if(_0x4a0352>=_0x57b21d){_0x4a0352=_0x57b21d;_0x222851=0xc8;}else{_0x222851=0xce;}_0x12fa86[_0x4c14('0x13')](_0x222851);return _0x12fa86[_0x4c14('0x19')](_0x4c14('0x1a'),_0x1da59a+'-'+_0x4a0352+'/'+_0x57b21d)['json'](_0x11d20e);}return null;};}function patchUpdates(_0x1aea42){return function(_0x338e3d){try{jsonpatch['apply'](_0x338e3d,_0x1aea42,!![]);}catch(_0x2319ce){return BPromise[_0x4c14('0x1b')](_0x2319ce);}return _0x338e3d['save']();};}function saveUpdates(_0x33cd84,_0x2f69cf){return function(_0x523b67){if(_0x523b67){return _0x523b67[_0x4c14('0x1c')](_0x33cd84)[_0x4c14('0x1d')](function(_0x241d2a){return _0x241d2a;});}return null;};}function removeEntity(_0x383a49,_0x1470e4){return function(_0x29cc6e){if(_0x29cc6e){return _0x29cc6e[_0x4c14('0x1e')]()[_0x4c14('0x1d')](function(){_0x383a49[_0x4c14('0x13')](0xcc)[_0x4c14('0x1f')]();});}};}function handleEntityNotFound(_0x15ad98,_0x203da9){return function(_0x3be584){if(!_0x3be584){_0x15ad98[_0x4c14('0x12')](0x194);}return _0x3be584;};}function handleError(_0x39189e,_0x219f5a){_0x219f5a=_0x219f5a||0x1f4;return function(_0x182dcd){logger[_0x4c14('0x20')](_0x182dcd[_0x4c14('0x21')]);if(_0x182dcd[_0x4c14('0x22')]){delete _0x182dcd[_0x4c14('0x22')];}_0x39189e['status'](_0x219f5a)[_0x4c14('0x23')](_0x182dcd);};}exports[_0x4c14('0x24')]=function(_0x420d90,_0x16e2c8){var _0x5e9b7e={},_0x50b723={},_0x155a99={'count':0x0,'rows':[]};var _0x157e28=_['map'](db['MailSubstatus'][_0x4c14('0x25')],function(_0x447f6e){return{'name':_0x447f6e[_0x4c14('0x26')],'type':_0x447f6e[_0x4c14('0x27')][_0x4c14('0x28')]};});_0x50b723[_0x4c14('0x29')]=_['map'](_0x157e28,'name');_0x50b723[_0x4c14('0x2a')]=_[_0x4c14('0x2b')](_0x420d90[_0x4c14('0x2a')]);_0x50b723[_0x4c14('0x2c')]=_[_0x4c14('0x2d')](_0x50b723[_0x4c14('0x29')],_0x50b723[_0x4c14('0x2a')]);_0x5e9b7e[_0x4c14('0x2e')]=_[_0x4c14('0x2d')](_0x50b723[_0x4c14('0x29')],qs[_0x4c14('0x2f')](_0x420d90[_0x4c14('0x2a')][_0x4c14('0x2f')]));_0x5e9b7e[_0x4c14('0x2e')]=_0x5e9b7e['attributes'][_0x4c14('0x30')]?_0x5e9b7e[_0x4c14('0x2e')]:_0x50b723[_0x4c14('0x29')];if(!_0x420d90[_0x4c14('0x2a')]['hasOwnProperty']('nolimit')){_0x5e9b7e[_0x4c14('0x17')]=qs[_0x4c14('0x17')](_0x420d90[_0x4c14('0x2a')][_0x4c14('0x17')]);_0x5e9b7e[_0x4c14('0x15')]=qs[_0x4c14('0x15')](_0x420d90[_0x4c14('0x2a')][_0x4c14('0x15')]);}_0x5e9b7e[_0x4c14('0x31')]=qs[_0x4c14('0x32')](_0x420d90[_0x4c14('0x2a')][_0x4c14('0x32')]);_0x5e9b7e[_0x4c14('0x33')]=qs[_0x4c14('0x2c')](_[_0x4c14('0x34')](_0x420d90[_0x4c14('0x2a')],_0x50b723['filters']),_0x157e28);if(_0x420d90[_0x4c14('0x2a')][_0x4c14('0x35')]){_0x5e9b7e[_0x4c14('0x33')]=_['merge'](_0x5e9b7e[_0x4c14('0x33')],{'$or':_[_0x4c14('0x36')](_0x157e28,function(_0x3736bf){if(_0x3736bf[_0x4c14('0x27')]!=='VIRTUAL'){var _0x346221={};_0x346221[_0x3736bf[_0x4c14('0x22')]]={'$like':'%'+_0x420d90['query']['filter']+'%'};return _0x346221;}})});}_0x5e9b7e=_[_0x4c14('0x37')]({},_0x5e9b7e,_0x420d90[_0x4c14('0x38')]);var _0x12610e={'where':_0x5e9b7e[_0x4c14('0x33')]};return db[_0x4c14('0x39')][_0x4c14('0x18')](_0x12610e)[_0x4c14('0x1d')](function(_0x14d6fc){_0x155a99[_0x4c14('0x18')]=_0x14d6fc;if(_0x420d90[_0x4c14('0x2a')][_0x4c14('0x3a')]){_0x5e9b7e[_0x4c14('0x3b')]=[{'all':!![]}];}return db[_0x4c14('0x39')][_0x4c14('0x3c')](_0x5e9b7e);})[_0x4c14('0x1d')](function(_0x412daf){_0x155a99[_0x4c14('0x3d')]=_0x412daf;return _0x155a99;})[_0x4c14('0x1d')](respondWithFilteredResult(_0x16e2c8,_0x5e9b7e))[_0x4c14('0x3e')](handleError(_0x16e2c8,null));};exports[_0x4c14('0x3f')]=function(_0x572e86,_0x280aa5){var _0x5e0034={'raw':!![],'where':{'id':_0x572e86['params']['id']}},_0x5562ef={};_0x5562ef['model']=_[_0x4c14('0x2b')](db['MailSubstatus'][_0x4c14('0x25')]);_0x5562ef[_0x4c14('0x2a')]=_['keys'](_0x572e86[_0x4c14('0x2a')]);_0x5562ef[_0x4c14('0x2c')]=_['intersection'](_0x5562ef[_0x4c14('0x29')],_0x5562ef[_0x4c14('0x2a')]);_0x5e0034['attributes']=_[_0x4c14('0x2d')](_0x5562ef['model'],qs[_0x4c14('0x2f')](_0x572e86[_0x4c14('0x2a')][_0x4c14('0x2f')]));_0x5e0034[_0x4c14('0x2e')]=_0x5e0034[_0x4c14('0x2e')][_0x4c14('0x30')]?_0x5e0034[_0x4c14('0x2e')]:_0x5562ef[_0x4c14('0x29')];if(_0x572e86['query'][_0x4c14('0x3a')]){_0x5e0034[_0x4c14('0x3b')]=[{'all':!![]}];}_0x5e0034=_['merge']({},_0x5e0034,_0x572e86[_0x4c14('0x38')]);return db['MailSubstatus']['find'](_0x5e0034)[_0x4c14('0x1d')](handleEntityNotFound(_0x280aa5,null))[_0x4c14('0x1d')](respondWithResult(_0x280aa5,null))[_0x4c14('0x3e')](handleError(_0x280aa5,null));};exports[_0x4c14('0x40')]=function(_0x414876,_0xd65ba7){return db[_0x4c14('0x39')][_0x4c14('0x40')](_0x414876[_0x4c14('0x41')],{})[_0x4c14('0x1d')](respondWithResult(_0xd65ba7,0xc9))[_0x4c14('0x3e')](handleError(_0xd65ba7,null));};exports['update']=function(_0x549cf2,_0x1ebd91){if(_0x549cf2['body']['id']){delete _0x549cf2[_0x4c14('0x41')]['id'];}return db['MailSubstatus'][_0x4c14('0x42')]({'where':{'id':_0x549cf2[_0x4c14('0x43')]['id']}})[_0x4c14('0x1d')](handleEntityNotFound(_0x1ebd91,null))['then'](saveUpdates(_0x549cf2[_0x4c14('0x41')],null))[_0x4c14('0x1d')](respondWithResult(_0x1ebd91,null))[_0x4c14('0x3e')](handleError(_0x1ebd91,null));};exports[_0x4c14('0x1e')]=function(_0x1fa218,_0x4c8c82){return db[_0x4c14('0x39')]['find']({'where':{'id':_0x1fa218[_0x4c14('0x43')]['id']}})[_0x4c14('0x1d')](handleEntityNotFound(_0x4c8c82,null))[_0x4c14('0x1d')](removeEntity(_0x4c8c82,null))['catch'](handleError(_0x4c8c82,null));};exports[_0x4c14('0x44')]=function(_0x462150,_0x163813){return db[_0x4c14('0x39')][_0x4c14('0x44')]()[_0x4c14('0x1d')](respondWithResult(_0x163813,null))[_0x4c14('0x3e')](handleError(_0x163813,null));}; \ No newline at end of file +var _0x1141=['path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','index','map','MailSubstatus','fieldName','type','model','query','keys','attributes','intersection','fields','nolimit','sort','where','filters','merge','name','filter','findAll','rows','catch','params','rawAttributes','length','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x295a92,_0x7d70dc){var _0x3f5dac=function(_0x47b9e8){while(--_0x47b9e8){_0x295a92['push'](_0x295a92['shift']());}};_0x3f5dac(++_0x7d70dc);}(_0x1141,0x15a));var _0x1114=function(_0x39fba9,_0x245311){_0x39fba9=_0x39fba9-0x0;var _0x3078c5=_0x1141[_0x39fba9];return _0x3078c5;};'use strict';var emlformat=require(_0x1114('0x0'));var rimraf=require(_0x1114('0x1'));var zipdir=require(_0x1114('0x2'));var jsonpatch=require(_0x1114('0x3'));var rp=require(_0x1114('0x4'));var moment=require(_0x1114('0x5'));var BPromise=require(_0x1114('0x6'));var Mustache=require(_0x1114('0x7'));var util=require(_0x1114('0x8'));var path=require(_0x1114('0x9'));var sox=require('sox');var csv=require(_0x1114('0xa'));var ejs=require(_0x1114('0xb'));var fs=require('fs');var fs_extra=require(_0x1114('0xc'));var _=require(_0x1114('0xd'));var squel=require('squel');var crypto=require(_0x1114('0xe'));var jsforce=require(_0x1114('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1114('0x10'));var Papa=require('papaparse');var Redis=require(_0x1114('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1114('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1114('0x13'));var logger=require(_0x1114('0x14'))(_0x1114('0x15'));var utils=require(_0x1114('0x16'));var config=require(_0x1114('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1114('0x18'))['db'];function respondWithStatusCode(_0x4c4be1,_0x491cc0){_0x491cc0=_0x491cc0||0xcc;return function(_0x26ada7){if(_0x26ada7){return _0x4c4be1[_0x1114('0x19')](_0x491cc0);}return _0x4c4be1[_0x1114('0x1a')](_0x491cc0)['end']();};}function respondWithResult(_0x4898e1,_0x33fdbc){_0x33fdbc=_0x33fdbc||0xc8;return function(_0x4f6ddf){if(_0x4f6ddf){return _0x4898e1[_0x1114('0x1a')](_0x33fdbc)['json'](_0x4f6ddf);}};}function respondWithFilteredResult(_0x9e09f5,_0x1d6d4c){return function(_0x4f8c32){if(_0x4f8c32){var _0x4a4022=typeof _0x1d6d4c[_0x1114('0x1b')]===_0x1114('0x1c')&&typeof _0x1d6d4c[_0x1114('0x1d')]==='undefined';var _0x26e522=_0x4f8c32[_0x1114('0x1e')];var _0x560159=_0x4a4022?0x0:_0x1d6d4c[_0x1114('0x1b')];var _0x23ba11=_0x4a4022?_0x4f8c32[_0x1114('0x1e')]:_0x1d6d4c[_0x1114('0x1b')]+_0x1d6d4c[_0x1114('0x1d')];var _0x1cb91e;if(_0x23ba11>=_0x26e522){_0x23ba11=_0x26e522;_0x1cb91e=0xc8;}else{_0x1cb91e=0xce;}_0x9e09f5[_0x1114('0x1a')](_0x1cb91e);return _0x9e09f5[_0x1114('0x1f')](_0x1114('0x20'),_0x560159+'-'+_0x23ba11+'/'+_0x26e522)[_0x1114('0x21')](_0x4f8c32);}return null;};}function patchUpdates(_0x559fb2){return function(_0xfab9e4){try{jsonpatch[_0x1114('0x22')](_0xfab9e4,_0x559fb2,!![]);}catch(_0x5f4535){return BPromise['reject'](_0x5f4535);}return _0xfab9e4[_0x1114('0x23')]();};}function saveUpdates(_0x5975cf,_0x412aee){return function(_0x34948f){if(_0x34948f){return _0x34948f[_0x1114('0x24')](_0x5975cf)[_0x1114('0x25')](function(_0x158c73){return _0x158c73;});}return null;};}function removeEntity(_0x499ec4,_0x235499){return function(_0x4dbd92){if(_0x4dbd92){return _0x4dbd92[_0x1114('0x26')]()[_0x1114('0x25')](function(){_0x499ec4[_0x1114('0x1a')](0xcc)[_0x1114('0x27')]();});}};}function handleEntityNotFound(_0x4d762f,_0x279e32){return function(_0x2a0a73){if(!_0x2a0a73){_0x4d762f[_0x1114('0x19')](0x194);}return _0x2a0a73;};}function handleError(_0x53b9e4,_0x21846c){_0x21846c=_0x21846c||0x1f4;return function(_0xbd68b3){logger[_0x1114('0x28')](_0xbd68b3[_0x1114('0x29')]);if(_0xbd68b3['name']){delete _0xbd68b3['name'];}_0x53b9e4[_0x1114('0x1a')](_0x21846c)['send'](_0xbd68b3);};}exports[_0x1114('0x2a')]=function(_0x1235bf,_0x4f4503){var _0x569901={},_0x29a438={},_0x5a9c1c={'count':0x0,'rows':[]};var _0x38908a=_[_0x1114('0x2b')](db[_0x1114('0x2c')]['rawAttributes'],function(_0x47d9fa){return{'name':_0x47d9fa[_0x1114('0x2d')],'type':_0x47d9fa[_0x1114('0x2e')]['key']};});_0x29a438[_0x1114('0x2f')]=_[_0x1114('0x2b')](_0x38908a,'name');_0x29a438[_0x1114('0x30')]=_[_0x1114('0x31')](_0x1235bf[_0x1114('0x30')]);_0x29a438['filters']=_['intersection'](_0x29a438[_0x1114('0x2f')],_0x29a438[_0x1114('0x30')]);_0x569901[_0x1114('0x32')]=_[_0x1114('0x33')](_0x29a438[_0x1114('0x2f')],qs[_0x1114('0x34')](_0x1235bf['query'][_0x1114('0x34')]));_0x569901[_0x1114('0x32')]=_0x569901[_0x1114('0x32')]['length']?_0x569901[_0x1114('0x32')]:_0x29a438[_0x1114('0x2f')];if(!_0x1235bf[_0x1114('0x30')]['hasOwnProperty'](_0x1114('0x35'))){_0x569901[_0x1114('0x1d')]=qs[_0x1114('0x1d')](_0x1235bf['query'][_0x1114('0x1d')]);_0x569901['offset']=qs['offset'](_0x1235bf['query'][_0x1114('0x1b')]);}_0x569901['order']=qs[_0x1114('0x36')](_0x1235bf[_0x1114('0x30')][_0x1114('0x36')]);_0x569901[_0x1114('0x37')]=qs[_0x1114('0x38')](_['pick'](_0x1235bf[_0x1114('0x30')],_0x29a438[_0x1114('0x38')]),_0x38908a);if(_0x1235bf[_0x1114('0x30')]['filter']){_0x569901[_0x1114('0x37')]=_[_0x1114('0x39')](_0x569901[_0x1114('0x37')],{'$or':_[_0x1114('0x2b')](_0x38908a,function(_0x56a7a0){if(_0x56a7a0[_0x1114('0x2e')]!=='VIRTUAL'){var _0x5b00ed={};_0x5b00ed[_0x56a7a0[_0x1114('0x3a')]]={'$like':'%'+_0x1235bf[_0x1114('0x30')][_0x1114('0x3b')]+'%'};return _0x5b00ed;}})});}_0x569901=_[_0x1114('0x39')]({},_0x569901,_0x1235bf['options']);var _0x3b28ab={'where':_0x569901[_0x1114('0x37')]};return db[_0x1114('0x2c')][_0x1114('0x1e')](_0x3b28ab)[_0x1114('0x25')](function(_0x36a514){_0x5a9c1c[_0x1114('0x1e')]=_0x36a514;if(_0x1235bf[_0x1114('0x30')]['includeAll']){_0x569901['include']=[{'all':!![]}];}return db[_0x1114('0x2c')][_0x1114('0x3c')](_0x569901);})[_0x1114('0x25')](function(_0x515785){_0x5a9c1c[_0x1114('0x3d')]=_0x515785;return _0x5a9c1c;})[_0x1114('0x25')](respondWithFilteredResult(_0x4f4503,_0x569901))[_0x1114('0x3e')](handleError(_0x4f4503,null));};exports['show']=function(_0x480cf7,_0x411817){var _0x374a6c={'raw':!![],'where':{'id':_0x480cf7[_0x1114('0x3f')]['id']}},_0x119042={};_0x119042[_0x1114('0x2f')]=_[_0x1114('0x31')](db['MailSubstatus'][_0x1114('0x40')]);_0x119042[_0x1114('0x30')]=_[_0x1114('0x31')](_0x480cf7['query']);_0x119042[_0x1114('0x38')]=_[_0x1114('0x33')](_0x119042[_0x1114('0x2f')],_0x119042[_0x1114('0x30')]);_0x374a6c[_0x1114('0x32')]=_[_0x1114('0x33')](_0x119042[_0x1114('0x2f')],qs[_0x1114('0x34')](_0x480cf7['query']['fields']));_0x374a6c[_0x1114('0x32')]=_0x374a6c[_0x1114('0x32')][_0x1114('0x41')]?_0x374a6c['attributes']:_0x119042['model'];if(_0x480cf7[_0x1114('0x30')][_0x1114('0x42')]){_0x374a6c['include']=[{'all':!![]}];}_0x374a6c=_[_0x1114('0x39')]({},_0x374a6c,_0x480cf7['options']);return db[_0x1114('0x2c')][_0x1114('0x43')](_0x374a6c)[_0x1114('0x25')](handleEntityNotFound(_0x411817,null))['then'](respondWithResult(_0x411817,null))[_0x1114('0x3e')](handleError(_0x411817,null));};exports[_0x1114('0x44')]=function(_0xfb5d8c,_0x1c625c){return db['MailSubstatus'][_0x1114('0x44')](_0xfb5d8c[_0x1114('0x45')],{})[_0x1114('0x25')](respondWithResult(_0x1c625c,0xc9))[_0x1114('0x3e')](handleError(_0x1c625c,null));};exports[_0x1114('0x24')]=function(_0x6965aa,_0x4d76a7){if(_0x6965aa['body']['id']){delete _0x6965aa[_0x1114('0x45')]['id'];}return db[_0x1114('0x2c')]['find']({'where':{'id':_0x6965aa[_0x1114('0x3f')]['id']}})[_0x1114('0x25')](handleEntityNotFound(_0x4d76a7,null))[_0x1114('0x25')](saveUpdates(_0x6965aa[_0x1114('0x45')],null))[_0x1114('0x25')](respondWithResult(_0x4d76a7,null))[_0x1114('0x3e')](handleError(_0x4d76a7,null));};exports[_0x1114('0x26')]=function(_0x463bf6,_0x5cbc0c){return db[_0x1114('0x2c')]['find']({'where':{'id':_0x463bf6[_0x1114('0x3f')]['id']}})[_0x1114('0x25')](handleEntityNotFound(_0x5cbc0c,null))['then'](removeEntity(_0x5cbc0c,null))[_0x1114('0x3e')](handleError(_0x5cbc0c,null));};exports[_0x1114('0x46')]=function(_0x5b75cf,_0x43ab77){return db[_0x1114('0x2c')][_0x1114('0x46')]()[_0x1114('0x25')](respondWithResult(_0x43ab77,null))[_0x1114('0x3e')](handleError(_0x43ab77,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index b4c898d..6abaf82 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf675=['hasOwnProperty','hook','exports','events','MailSubstatus','setMaxListeners','update','emit'];(function(_0x221ba2,_0x79208){var _0x47d08e=function(_0xaf14ee){while(--_0xaf14ee){_0x221ba2['push'](_0x221ba2['shift']());}};_0x47d08e(++_0x79208);}(_0xf675,0x18b));var _0x5f67=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xf675[_0x18a79d];return _0x4f8848;};'use strict';var EventEmitter=require(_0x5f67('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x5f67('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x5f67('0x2')](0x0);var events={'afterUpdate':_0x5f67('0x3')};function emitEvent(_0x3214d2){return function(_0x53a2f1,_0x427ac3,_0xa664da){MailSubstatusEvents['emit'](_0x3214d2+':'+_0x53a2f1['id'],_0x53a2f1);MailSubstatusEvents[_0x5f67('0x4')](_0x3214d2,_0x53a2f1);_0xa664da(null);};}for(var e in events){if(events[_0x5f67('0x5')](e)){var event=events[e];MailSubstatus[_0x5f67('0x6')](e,emitEvent(event));}}module[_0x5f67('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x386a=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailSubstatus','setMaxListeners','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x386a,0x187));var _0xa386=function(_0x496fd5,_0x454006){_0x496fd5=_0x496fd5-0x0;var _0x3545ce=_0x386a[_0x496fd5];return _0x3545ce;};'use strict';var EventEmitter=require(_0xa386('0x0'));var MailSubstatus=require(_0xa386('0x1'))['db'][_0xa386('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xa386('0x3')](0x0);var events={'afterUpdate':_0xa386('0x4')};function emitEvent(_0x58399a){return function(_0x18e100,_0xf2192f,_0x20cdf2){MailSubstatusEvents[_0xa386('0x5')](_0x58399a+':'+_0x18e100['id'],_0x18e100);MailSubstatusEvents[_0xa386('0x5')](_0x58399a,_0x18e100);_0x20cdf2(null);};}for(var e in events){if(events[_0xa386('0x6')](e)){var event=events[e];MailSubstatus[_0xa386('0x7')](e,emitEvent(event));}}module[_0xa386('0x8')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 96c5095..55d597c 100644 --- a/server/api/mailSubstatus/mailSubstatus.model.js +++ b/server/api/mailSubstatus/mailSubstatus.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c11=['exports','models','MailSubstatus','mail_substatuses','Condition','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c11,0x196));var _0x13c1=function(_0x448061,_0x2debfd){_0x448061=_0x448061-0x0;var _0x3a9247=_0x3c11[_0x448061];return _0x3a9247;};'use strict';var attributes=require(_0x13c1('0x0'));module[_0x13c1('0x1')]=function(_0x1a8dea){var _0x28c218=_0x1a8dea[_0x13c1('0x2')];return _0x1a8dea['define'](_0x13c1('0x3'),attributes,{'tableName':_0x13c1('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x35d589,_0x5e78fc,_0x494e3e){return _0x28c218[_0x13c1('0x5')]['update']({'value':_0x35d589[_0x13c1('0x6')]},{'where':{'field':_0x13c1('0x7'),'value':_0x35d589[_0x13c1('0x8')][_0x13c1('0x6')]}})[_0x13c1('0x9')](function(){_0x494e3e();})[_0x13c1('0xa')](function(_0x4e692d){_0x494e3e(_0x4e692d);});}}});}; \ No newline at end of file +var _0xb9ca=['define','MailSubstatus','Condition','update','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','models'];(function(_0x515be2,_0x51b3ff){var _0x514679=function(_0x562c51){while(--_0x562c51){_0x515be2['push'](_0x515be2['shift']());}};_0x514679(++_0x51b3ff);}(_0xb9ca,0x11d));var _0xab9c=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xb9ca[_0x47b58b];return _0x46bebe;};'use strict';var attributes=require(_0xab9c('0x0'));module[_0xab9c('0x1')]=function(_0x3679a0){var _0x1d3ef5=_0x3679a0[_0xab9c('0x2')];return _0x3679a0[_0xab9c('0x3')](_0xab9c('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1cb040,_0x4d7d3a,_0x327fbc){return _0x1d3ef5[_0xab9c('0x5')][_0xab9c('0x6')]({'value':_0x1cb040[_0xab9c('0x7')]},{'where':{'field':_0xab9c('0x8'),'value':_0x1cb040[_0xab9c('0x9')]['name']}})[_0xab9c('0xa')](function(){_0x327fbc();})[_0xab9c('0xb')](function(_0x4511ef){_0x327fbc(_0x4511ef);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 61a802e..b2e505d 100644 --- a/server/api/mailSubstatus/mailSubstatus.rpc.js +++ b/server/api/mailSubstatus/mailSubstatus.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18c8=['lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0xcf3595,_0x5a91f2){var _0xd052e8=function(_0x3c0175){while(--_0x3c0175){_0xcf3595['push'](_0xcf3595['shift']());}};_0xd052e8(++_0x5a91f2);}(_0x18c8,0x160));var _0x818c=function(_0x507cbd,_0x4402cc){_0x507cbd=_0x507cbd-0x0;var _0x2274ab=_0x18c8[_0x507cbd];return _0x2274ab;};'use strict';var _=require(_0x818c('0x0'));var util=require(_0x818c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x818c('0x2'));var fs=require('fs');var Redis=require(_0x818c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x818c('0x4'));var logger=require(_0x818c('0x5'))(_0x818c('0x6'));var config=require(_0x818c('0x7'));var jayson=require(_0x818c('0x8'));var client=jayson['client'][_0x818c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x568e2,_0x1b8c5f,_0x54dcfe){return new BPromise(function(_0x1641ad,_0x105c74){return client[_0x818c('0xa')](_0x568e2,_0x54dcfe)['then'](function(_0x4e74a3){logger[_0x818c('0xb')](_0x818c('0xc'),_0x1b8c5f,'request\x20sent');logger[_0x818c('0xd')](_0x818c('0xe'),_0x1b8c5f,_0x818c('0xf'),JSON[_0x818c('0x10')](_0x4e74a3));if(_0x4e74a3[_0x818c('0x11')]){if(_0x4e74a3[_0x818c('0x11')][_0x818c('0x12')]===0x1f4){logger[_0x818c('0x11')](_0x818c('0xc'),_0x1b8c5f,_0x4e74a3[_0x818c('0x11')]['message']);return _0x105c74(_0x4e74a3[_0x818c('0x11')][_0x818c('0x13')]);}logger[_0x818c('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x1b8c5f,_0x4e74a3[_0x818c('0x11')][_0x818c('0x13')]);return _0x1641ad(_0x4e74a3[_0x818c('0x11')][_0x818c('0x13')]);}else{logger[_0x818c('0xb')](_0x818c('0xc'),_0x1b8c5f,_0x818c('0xf'));_0x1641ad(_0x4e74a3[_0x818c('0x14')][_0x818c('0x13')]);}})[_0x818c('0x15')](function(_0x5936b9){logger[_0x818c('0x11')](_0x818c('0xc'),_0x1b8c5f,_0x5936b9);_0x105c74(_0x5936b9);});});} \ No newline at end of file +var _0x6f8f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x469eac,_0x5ea831){var _0x36dd7d=function(_0x225c90){while(--_0x225c90){_0x469eac['push'](_0x469eac['shift']());}};_0x36dd7d(++_0x5ea831);}(_0x6f8f,0x192));var _0xf6f8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f8f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf6f8('0x0'));var util=require(_0xf6f8('0x1'));var moment=require(_0xf6f8('0x2'));var BPromise=require(_0xf6f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6f8('0x4'))['db'];var utils=require(_0xf6f8('0x5'));var logger=require(_0xf6f8('0x6'))(_0xf6f8('0x7'));var config=require(_0xf6f8('0x8'));var jayson=require(_0xf6f8('0x9'));var client=jayson[_0xf6f8('0xa')][_0xf6f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc53535,_0x25882c,_0x3c29a1){return new BPromise(function(_0x5a441b,_0x35d497){return client[_0xf6f8('0xc')](_0xc53535,_0x3c29a1)[_0xf6f8('0xd')](function(_0x3e98cb){logger[_0xf6f8('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x25882c,_0xf6f8('0xf'));logger[_0xf6f8('0x10')](_0xf6f8('0x11'),_0x25882c,_0xf6f8('0xf'),JSON[_0xf6f8('0x12')](_0x3e98cb));if(_0x3e98cb[_0xf6f8('0x13')]){if(_0x3e98cb['error'][_0xf6f8('0x14')]===0x1f4){logger[_0xf6f8('0x13')](_0xf6f8('0x15'),_0x25882c,_0x3e98cb[_0xf6f8('0x13')][_0xf6f8('0x16')]);return _0x35d497(_0x3e98cb[_0xf6f8('0x13')][_0xf6f8('0x16')]);}logger[_0xf6f8('0x13')](_0xf6f8('0x15'),_0x25882c,_0x3e98cb[_0xf6f8('0x13')][_0xf6f8('0x16')]);return _0x5a441b(_0x3e98cb[_0xf6f8('0x13')]['message']);}else{logger['info'](_0xf6f8('0x15'),_0x25882c,_0xf6f8('0xf'));_0x5a441b(_0x3e98cb['result'][_0xf6f8('0x16')]);}})[_0xf6f8('0x17')](function(_0x4871d7){logger[_0xf6f8('0x13')](_0xf6f8('0x15'),_0x25882c,_0x4871d7);_0x35d497(_0x4871d7);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 2dcd2ba..6f775c9 100644 --- a/server/api/mailTransferReport/index.js +++ b/server/api/mailTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46c6=['/describe','describe','/:id','post','create','put','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x46c6,0x170));var _0x646c=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x46c6[_0x819464];return _0x49dcc0;};'use strict';var multer=require(_0x646c('0x0'));var util=require('util');var path=require(_0x646c('0x1'));var timeout=require(_0x646c('0x2'));var express=require(_0x646c('0x3'));var router=express[_0x646c('0x4')]();var fs_extra=require(_0x646c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x646c('0x6'));var config=require(_0x646c('0x7'));var controller=require(_0x646c('0x8'));router[_0x646c('0x9')]('/',auth[_0x646c('0xa')](),controller[_0x646c('0xb')]);router['get'](_0x646c('0xc'),auth[_0x646c('0xa')](),controller[_0x646c('0xd')]);router['get'](_0x646c('0xe'),auth[_0x646c('0xa')](),controller['show']);router[_0x646c('0xf')]('/',auth['isAuthenticated'](),controller[_0x646c('0x10')]);router[_0x646c('0x11')](_0x646c('0xe'),auth['isAuthenticated'](),controller[_0x646c('0x12')]);router[_0x646c('0x13')](_0x646c('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc39d=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','update','delete','exports','multer'];(function(_0xb3ed0b,_0x4d238a){var _0x5b6013=function(_0x2bcf1c){while(--_0x2bcf1c){_0xb3ed0b['push'](_0xb3ed0b['shift']());}};_0x5b6013(++_0x4d238a);}(_0xc39d,0xef));var _0xdc39=function(_0x335136,_0x131d00){_0x335136=_0x335136-0x0;var _0x234b60=_0xc39d[_0x335136];return _0x234b60;};'use strict';var multer=require(_0xdc39('0x0'));var util=require(_0xdc39('0x1'));var path=require(_0xdc39('0x2'));var timeout=require(_0xdc39('0x3'));var express=require(_0xdc39('0x4'));var router=express[_0xdc39('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdc39('0x6'));var config=require(_0xdc39('0x7'));var controller=require(_0xdc39('0x8'));router['get']('/',auth[_0xdc39('0x9')](),controller[_0xdc39('0xa')]);router[_0xdc39('0xb')](_0xdc39('0xc'),auth['isAuthenticated'](),controller[_0xdc39('0xd')]);router[_0xdc39('0xb')](_0xdc39('0xe'),auth[_0xdc39('0x9')](),controller[_0xdc39('0xf')]);router[_0xdc39('0x10')]('/',auth[_0xdc39('0x9')](),controller['create']);router['put']('/:id',auth[_0xdc39('0x9')](),controller[_0xdc39('0x11')]);router[_0xdc39('0x12')](_0xdc39('0xe'),auth[_0xdc39('0x9')](),controller['destroy']);module[_0xdc39('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index d8f33af..c8f397d 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x346aec,_0x121bb2){var _0x3bc5f3=function(_0x3ba5f6){while(--_0x3ba5f6){_0x346aec['push'](_0x346aec['shift']());}};_0x3bc5f3(++_0x121bb2);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1034ca,_0x14ecd6){_0x1034ca=_0x1034ca-0x0;var _0x1a023a=_0x4b84[_0x1034ca];return _0x1a023a;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x3e665d,_0xef863d){var _0x24a155=function(_0x1343e7){while(--_0x1343e7){_0x3e665d['push'](_0x3e665d['shift']());}};_0x24a155(++_0xef863d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 2f363c9..a17ad86 100644 --- a/server/api/mailTransferReport/mailTransferReport.controller.js +++ b/server/api/mailTransferReport/mailTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2107=['stack','name','send','MailTransferReport','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','fields','include','find','create','body','params','describe','eml-format','zip-dir','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy'];(function(_0x3b404a,_0x5c049d){var _0x6c464d=function(_0x345eb5){while(--_0x345eb5){_0x3b404a['push'](_0x3b404a['shift']());}};_0x6c464d(++_0x5c049d);}(_0x2107,0xa7));var _0x7210=function(_0x5179a5,_0x419746){_0x5179a5=_0x5179a5-0x0;var _0x15c8ce=_0x2107[_0x5179a5];return _0x15c8ce;};'use strict';var emlformat=require(_0x7210('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7210('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7210('0x2'));var util=require(_0x7210('0x3'));var path=require('path');var sox=require(_0x7210('0x4'));var csv=require(_0x7210('0x5'));var ejs=require(_0x7210('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7210('0x7'));var squel=require(_0x7210('0x8'));var crypto=require(_0x7210('0x9'));var jsforce=require(_0x7210('0xa'));var deskjs=require(_0x7210('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7210('0xc'));var Papa=require(_0x7210('0xd'));var Redis=require(_0x7210('0xe'));var authService=require(_0x7210('0xf'));var qs=require(_0x7210('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7210('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7210('0x12'));var db=require(_0x7210('0x13'))['db'];function respondWithStatusCode(_0x1af0c3,_0x47f2b5){_0x47f2b5=_0x47f2b5||0xcc;return function(_0x466682){if(_0x466682){return _0x1af0c3[_0x7210('0x14')](_0x47f2b5);}return _0x1af0c3[_0x7210('0x15')](_0x47f2b5)[_0x7210('0x16')]();};}function respondWithResult(_0x230c9b,_0x59d5ea){_0x59d5ea=_0x59d5ea||0xc8;return function(_0x15be55){if(_0x15be55){return _0x230c9b[_0x7210('0x15')](_0x59d5ea)[_0x7210('0x17')](_0x15be55);}};}function respondWithFilteredResult(_0x229fd2,_0x2992b0){return function(_0x62d9c9){if(_0x62d9c9){var _0x1edb2e=typeof _0x2992b0[_0x7210('0x18')]===_0x7210('0x19')&&typeof _0x2992b0['limit']===_0x7210('0x19');var _0x427f71=_0x62d9c9[_0x7210('0x1a')];var _0x4a2eec=_0x1edb2e?0x0:_0x2992b0[_0x7210('0x18')];var _0x42b7f3=_0x1edb2e?_0x62d9c9['count']:_0x2992b0[_0x7210('0x18')]+_0x2992b0[_0x7210('0x1b')];var _0x56f351;if(_0x42b7f3>=_0x427f71){_0x42b7f3=_0x427f71;_0x56f351=0xc8;}else{_0x56f351=0xce;}_0x229fd2[_0x7210('0x15')](_0x56f351);return _0x229fd2['set'](_0x7210('0x1c'),_0x4a2eec+'-'+_0x42b7f3+'/'+_0x427f71)[_0x7210('0x17')](_0x62d9c9);}return null;};}function patchUpdates(_0x5332c0){return function(_0x4de8bd){try{jsonpatch[_0x7210('0x1d')](_0x4de8bd,_0x5332c0,!![]);}catch(_0x154d2e){return BPromise['reject'](_0x154d2e);}return _0x4de8bd[_0x7210('0x1e')]();};}function saveUpdates(_0x4b0178,_0x242ffc){return function(_0x5800db){if(_0x5800db){return _0x5800db[_0x7210('0x1f')](_0x4b0178)[_0x7210('0x20')](function(_0x9ada81){return _0x9ada81;});}return null;};}function removeEntity(_0x28b806,_0x2505bb){return function(_0x503ee6){if(_0x503ee6){return _0x503ee6[_0x7210('0x21')]()[_0x7210('0x20')](function(){_0x28b806['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23efd5,_0x119738){return function(_0x41db02){if(!_0x41db02){_0x23efd5[_0x7210('0x14')](0x194);}return _0x41db02;};}function handleError(_0xabbeca,_0x474f77){_0x474f77=_0x474f77||0x1f4;return function(_0x1b2133){logger['error'](_0x1b2133[_0x7210('0x22')]);if(_0x1b2133['name']){delete _0x1b2133[_0x7210('0x23')];}_0xabbeca['status'](_0x474f77)[_0x7210('0x24')](_0x1b2133);};}exports['index']=function(_0x65c507,_0x471f40){var _0xe511c1={},_0xf96dc0={},_0x4956e7={'count':0x0,'rows':[]};var _0x5d0015=_['map'](db[_0x7210('0x25')][_0x7210('0x26')],function(_0x18022d){return{'name':_0x18022d[_0x7210('0x27')],'type':_0x18022d[_0x7210('0x28')]['key']};});_0xf96dc0['model']=_[_0x7210('0x29')](_0x5d0015,_0x7210('0x23'));_0xf96dc0['query']=_[_0x7210('0x2a')](_0x65c507[_0x7210('0x2b')]);_0xf96dc0[_0x7210('0x2c')]=_[_0x7210('0x2d')](_0xf96dc0[_0x7210('0x2e')],_0xf96dc0[_0x7210('0x2b')]);_0xe511c1[_0x7210('0x2f')]=_['intersection'](_0xf96dc0[_0x7210('0x2e')],qs['fields'](_0x65c507[_0x7210('0x2b')]['fields']));_0xe511c1[_0x7210('0x2f')]=_0xe511c1['attributes']['length']?_0xe511c1[_0x7210('0x2f')]:_0xf96dc0[_0x7210('0x2e')];if(!_0x65c507['query'][_0x7210('0x30')](_0x7210('0x31'))){_0xe511c1[_0x7210('0x1b')]=qs['limit'](_0x65c507[_0x7210('0x2b')][_0x7210('0x1b')]);_0xe511c1[_0x7210('0x18')]=qs[_0x7210('0x18')](_0x65c507['query']['offset']);}_0xe511c1['order']=qs[_0x7210('0x32')](_0x65c507['query'][_0x7210('0x32')]);_0xe511c1[_0x7210('0x33')]=qs[_0x7210('0x2c')](_['pick'](_0x65c507[_0x7210('0x2b')],_0xf96dc0['filters']),_0x5d0015);if(_0x65c507[_0x7210('0x2b')][_0x7210('0x34')]){_0xe511c1[_0x7210('0x33')]=_[_0x7210('0x35')](_0xe511c1[_0x7210('0x33')],{'$or':_[_0x7210('0x29')](_0x5d0015,function(_0x3f1f7c){if(_0x3f1f7c[_0x7210('0x28')]!=='VIRTUAL'){var _0x182b52={};_0x182b52[_0x3f1f7c['name']]={'$like':'%'+_0x65c507[_0x7210('0x2b')][_0x7210('0x34')]+'%'};return _0x182b52;}})});}_0xe511c1=_[_0x7210('0x35')]({},_0xe511c1,_0x65c507[_0x7210('0x36')]);var _0x1e4c2e={'where':_0xe511c1[_0x7210('0x33')]};return db[_0x7210('0x25')][_0x7210('0x1a')](_0x1e4c2e)['then'](function(_0x1a1237){_0x4956e7[_0x7210('0x1a')]=_0x1a1237;if(_0x65c507[_0x7210('0x2b')][_0x7210('0x37')]){_0xe511c1['include']=[{'all':!![]}];}return db[_0x7210('0x25')][_0x7210('0x38')](_0xe511c1);})['then'](function(_0x3d60c5){_0x4956e7[_0x7210('0x39')]=_0x3d60c5;return _0x4956e7;})[_0x7210('0x20')](respondWithFilteredResult(_0x471f40,_0xe511c1))[_0x7210('0x3a')](handleError(_0x471f40,null));};exports[_0x7210('0x3b')]=function(_0x31c10f,_0x12efcc){var _0x5a97d2={'raw':!![],'where':{'id':_0x31c10f['params']['id']}},_0x1eec69={};_0x1eec69[_0x7210('0x2e')]=_[_0x7210('0x2a')](db['MailTransferReport']['rawAttributes']);_0x1eec69['query']=_[_0x7210('0x2a')](_0x31c10f[_0x7210('0x2b')]);_0x1eec69[_0x7210('0x2c')]=_['intersection'](_0x1eec69['model'],_0x1eec69['query']);_0x5a97d2[_0x7210('0x2f')]=_['intersection'](_0x1eec69[_0x7210('0x2e')],qs[_0x7210('0x3c')](_0x31c10f['query'][_0x7210('0x3c')]));_0x5a97d2['attributes']=_0x5a97d2[_0x7210('0x2f')]['length']?_0x5a97d2[_0x7210('0x2f')]:_0x1eec69[_0x7210('0x2e')];if(_0x31c10f[_0x7210('0x2b')][_0x7210('0x37')]){_0x5a97d2[_0x7210('0x3d')]=[{'all':!![]}];}_0x5a97d2=_[_0x7210('0x35')]({},_0x5a97d2,_0x31c10f[_0x7210('0x36')]);return db[_0x7210('0x25')][_0x7210('0x3e')](_0x5a97d2)[_0x7210('0x20')](handleEntityNotFound(_0x12efcc,null))[_0x7210('0x20')](respondWithResult(_0x12efcc,null))[_0x7210('0x3a')](handleError(_0x12efcc,null));};exports[_0x7210('0x3f')]=function(_0x322521,_0x354ae0){return db[_0x7210('0x25')]['create'](_0x322521[_0x7210('0x40')],{})[_0x7210('0x20')](respondWithResult(_0x354ae0,0xc9))[_0x7210('0x3a')](handleError(_0x354ae0,null));};exports['update']=function(_0x38136b,_0x59f4ff){if(_0x38136b[_0x7210('0x40')]['id']){delete _0x38136b[_0x7210('0x40')]['id'];}return db[_0x7210('0x25')][_0x7210('0x3e')]({'where':{'id':_0x38136b[_0x7210('0x41')]['id']}})[_0x7210('0x20')](handleEntityNotFound(_0x59f4ff,null))[_0x7210('0x20')](saveUpdates(_0x38136b[_0x7210('0x40')],null))['then'](respondWithResult(_0x59f4ff,null))[_0x7210('0x3a')](handleError(_0x59f4ff,null));};exports['destroy']=function(_0x123de8,_0x253a4f){return db[_0x7210('0x25')][_0x7210('0x3e')]({'where':{'id':_0x123de8['params']['id']}})[_0x7210('0x20')](handleEntityNotFound(_0x253a4f,null))[_0x7210('0x20')](removeEntity(_0x253a4f,null))[_0x7210('0x3a')](handleError(_0x253a4f,null));};exports[_0x7210('0x42')]=function(_0x3790d4,_0x3b7c1e){return db[_0x7210('0x25')][_0x7210('0x42')]()['then'](respondWithResult(_0x3b7c1e,null))[_0x7210('0x3a')](handleError(_0x3b7c1e,null));}; \ No newline at end of file +var _0x062d=['limit','count','set','Content-Range','apply','update','destroy','error','stack','name','send','index','MailTransferReport','rawAttributes','fieldName','type','map','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','then','includeAll','include','catch','params','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x546aaf,_0x1ed138){var _0x1cbf6d=function(_0x36c837){while(--_0x36c837){_0x546aaf['push'](_0x546aaf['shift']());}};_0x1cbf6d(++_0x1ed138);}(_0x062d,0x143));var _0xd062=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x062d[_0x26b80e];return _0x84a8a8;};'use strict';var emlformat=require(_0xd062('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd062('0x1'));var jsonpatch=require(_0xd062('0x2'));var rp=require('request-promise');var moment=require(_0xd062('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd062('0x4'));var util=require('util');var path=require(_0xd062('0x5'));var sox=require(_0xd062('0x6'));var csv=require('to-csv');var ejs=require(_0xd062('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd062('0x8'));var crypto=require(_0xd062('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd062('0xa'));var querystring=require(_0xd062('0xb'));var Papa=require('papaparse');var Redis=require(_0xd062('0xc'));var authService=require(_0xd062('0xd'));var qs=require(_0xd062('0xe'));var as=require(_0xd062('0xf'));var hardwareService=require(_0xd062('0x10'));var logger=require('../../config/logger')(_0xd062('0x11'));var utils=require(_0xd062('0x12'));var config=require(_0xd062('0x13'));var licenseUtil=require(_0xd062('0x14'));var db=require(_0xd062('0x15'))['db'];function respondWithStatusCode(_0x506848,_0xf28327){_0xf28327=_0xf28327||0xcc;return function(_0x3d5dea){if(_0x3d5dea){return _0x506848[_0xd062('0x16')](_0xf28327);}return _0x506848[_0xd062('0x17')](_0xf28327)[_0xd062('0x18')]();};}function respondWithResult(_0x1467ce,_0x5d31d2){_0x5d31d2=_0x5d31d2||0xc8;return function(_0x14404d){if(_0x14404d){return _0x1467ce['status'](_0x5d31d2)['json'](_0x14404d);}};}function respondWithFilteredResult(_0x8bce41,_0x19fd75){return function(_0x2b6446){if(_0x2b6446){var _0x683e3=typeof _0x19fd75[_0xd062('0x19')]===_0xd062('0x1a')&&typeof _0x19fd75[_0xd062('0x1b')]==='undefined';var _0x334e97=_0x2b6446[_0xd062('0x1c')];var _0x5cb17d=_0x683e3?0x0:_0x19fd75['offset'];var _0x18a576=_0x683e3?_0x2b6446[_0xd062('0x1c')]:_0x19fd75['offset']+_0x19fd75[_0xd062('0x1b')];var _0x28905b;if(_0x18a576>=_0x334e97){_0x18a576=_0x334e97;_0x28905b=0xc8;}else{_0x28905b=0xce;}_0x8bce41[_0xd062('0x17')](_0x28905b);return _0x8bce41[_0xd062('0x1d')](_0xd062('0x1e'),_0x5cb17d+'-'+_0x18a576+'/'+_0x334e97)['json'](_0x2b6446);}return null;};}function patchUpdates(_0x1e5302){return function(_0x1b2d2b){try{jsonpatch[_0xd062('0x1f')](_0x1b2d2b,_0x1e5302,!![]);}catch(_0x4395ed){return BPromise['reject'](_0x4395ed);}return _0x1b2d2b['save']();};}function saveUpdates(_0x211a75,_0x5102ea){return function(_0x566958){if(_0x566958){return _0x566958[_0xd062('0x20')](_0x211a75)['then'](function(_0x1b1b1a){return _0x1b1b1a;});}return null;};}function removeEntity(_0x45f273,_0x3a4cd6){return function(_0x36a816){if(_0x36a816){return _0x36a816[_0xd062('0x21')]()['then'](function(){_0x45f273['status'](0xcc)[_0xd062('0x18')]();});}};}function handleEntityNotFound(_0xb1dccb,_0x231835){return function(_0x27c7f9){if(!_0x27c7f9){_0xb1dccb['sendStatus'](0x194);}return _0x27c7f9;};}function handleError(_0x2945a7,_0x2593a8){_0x2593a8=_0x2593a8||0x1f4;return function(_0x2da3eb){logger[_0xd062('0x22')](_0x2da3eb[_0xd062('0x23')]);if(_0x2da3eb[_0xd062('0x24')]){delete _0x2da3eb[_0xd062('0x24')];}_0x2945a7['status'](_0x2593a8)[_0xd062('0x25')](_0x2da3eb);};}exports[_0xd062('0x26')]=function(_0x2e48e6,_0x14b82f){var _0x4ad3e1={},_0x466dd6={},_0x4eb384={'count':0x0,'rows':[]};var _0x160b5c=_['map'](db[_0xd062('0x27')][_0xd062('0x28')],function(_0x3ee5e6){return{'name':_0x3ee5e6[_0xd062('0x29')],'type':_0x3ee5e6[_0xd062('0x2a')]['key']};});_0x466dd6['model']=_[_0xd062('0x2b')](_0x160b5c,_0xd062('0x24'));_0x466dd6['query']=_[_0xd062('0x2c')](_0x2e48e6['query']);_0x466dd6[_0xd062('0x2d')]=_[_0xd062('0x2e')](_0x466dd6[_0xd062('0x2f')],_0x466dd6['query']);_0x4ad3e1[_0xd062('0x30')]=_[_0xd062('0x2e')](_0x466dd6[_0xd062('0x2f')],qs[_0xd062('0x31')](_0x2e48e6[_0xd062('0x32')][_0xd062('0x31')]));_0x4ad3e1[_0xd062('0x30')]=_0x4ad3e1[_0xd062('0x30')][_0xd062('0x33')]?_0x4ad3e1[_0xd062('0x30')]:_0x466dd6[_0xd062('0x2f')];if(!_0x2e48e6[_0xd062('0x32')][_0xd062('0x34')](_0xd062('0x35'))){_0x4ad3e1[_0xd062('0x1b')]=qs['limit'](_0x2e48e6[_0xd062('0x32')][_0xd062('0x1b')]);_0x4ad3e1[_0xd062('0x19')]=qs[_0xd062('0x19')](_0x2e48e6['query']['offset']);}_0x4ad3e1['order']=qs[_0xd062('0x36')](_0x2e48e6[_0xd062('0x32')][_0xd062('0x36')]);_0x4ad3e1[_0xd062('0x37')]=qs[_0xd062('0x2d')](_[_0xd062('0x38')](_0x2e48e6['query'],_0x466dd6['filters']),_0x160b5c);if(_0x2e48e6[_0xd062('0x32')][_0xd062('0x39')]){_0x4ad3e1[_0xd062('0x37')]=_['merge'](_0x4ad3e1['where'],{'$or':_[_0xd062('0x2b')](_0x160b5c,function(_0x193232){if(_0x193232['type']!==_0xd062('0x3a')){var _0x300540={};_0x300540[_0x193232['name']]={'$like':'%'+_0x2e48e6[_0xd062('0x32')][_0xd062('0x39')]+'%'};return _0x300540;}})});}_0x4ad3e1=_[_0xd062('0x3b')]({},_0x4ad3e1,_0x2e48e6['options']);var _0x2b8ce8={'where':_0x4ad3e1[_0xd062('0x37')]};return db[_0xd062('0x27')]['count'](_0x2b8ce8)[_0xd062('0x3c')](function(_0x1402bd){_0x4eb384[_0xd062('0x1c')]=_0x1402bd;if(_0x2e48e6['query'][_0xd062('0x3d')]){_0x4ad3e1[_0xd062('0x3e')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x4ad3e1);})['then'](function(_0x4e2726){_0x4eb384['rows']=_0x4e2726;return _0x4eb384;})[_0xd062('0x3c')](respondWithFilteredResult(_0x14b82f,_0x4ad3e1))[_0xd062('0x3f')](handleError(_0x14b82f,null));};exports['show']=function(_0x142ee2,_0x5f41c8){var _0x8d4782={'raw':!![],'where':{'id':_0x142ee2[_0xd062('0x40')]['id']}},_0x24119c={};_0x24119c[_0xd062('0x2f')]=_[_0xd062('0x2c')](db[_0xd062('0x27')][_0xd062('0x28')]);_0x24119c[_0xd062('0x32')]=_['keys'](_0x142ee2[_0xd062('0x32')]);_0x24119c[_0xd062('0x2d')]=_[_0xd062('0x2e')](_0x24119c[_0xd062('0x2f')],_0x24119c['query']);_0x8d4782['attributes']=_[_0xd062('0x2e')](_0x24119c[_0xd062('0x2f')],qs[_0xd062('0x31')](_0x142ee2[_0xd062('0x32')]['fields']));_0x8d4782['attributes']=_0x8d4782['attributes']['length']?_0x8d4782[_0xd062('0x30')]:_0x24119c[_0xd062('0x2f')];if(_0x142ee2[_0xd062('0x32')][_0xd062('0x3d')]){_0x8d4782[_0xd062('0x3e')]=[{'all':!![]}];}_0x8d4782=_['merge']({},_0x8d4782,_0x142ee2[_0xd062('0x41')]);return db[_0xd062('0x27')][_0xd062('0x42')](_0x8d4782)['then'](handleEntityNotFound(_0x5f41c8,null))[_0xd062('0x3c')](respondWithResult(_0x5f41c8,null))[_0xd062('0x3f')](handleError(_0x5f41c8,null));};exports[_0xd062('0x43')]=function(_0x2c15a5,_0x5f5ce5){return db['MailTransferReport'][_0xd062('0x43')](_0x2c15a5[_0xd062('0x44')],{})['then'](respondWithResult(_0x5f5ce5,0xc9))['catch'](handleError(_0x5f5ce5,null));};exports[_0xd062('0x20')]=function(_0x371db1,_0x238226){if(_0x371db1['body']['id']){delete _0x371db1[_0xd062('0x44')]['id'];}return db[_0xd062('0x27')][_0xd062('0x42')]({'where':{'id':_0x371db1[_0xd062('0x40')]['id']}})['then'](handleEntityNotFound(_0x238226,null))[_0xd062('0x3c')](saveUpdates(_0x371db1['body'],null))[_0xd062('0x3c')](respondWithResult(_0x238226,null))[_0xd062('0x3f')](handleError(_0x238226,null));};exports['destroy']=function(_0x3016e4,_0x1aeba3){return db[_0xd062('0x27')]['find']({'where':{'id':_0x3016e4[_0xd062('0x40')]['id']}})['then'](handleEntityNotFound(_0x1aeba3,null))[_0xd062('0x3c')](removeEntity(_0x1aeba3,null))[_0xd062('0x3f')](handleError(_0x1aeba3,null));};exports[_0xd062('0x45')]=function(_0xca71e1,_0x5465b7){return db[_0xd062('0x27')][_0xd062('0x45')]()[_0xd062('0x3c')](respondWithResult(_0x5465b7,null))['catch'](handleError(_0x5465b7,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index dcb493d..8c6a0d3 100644 --- a/server/api/mailTransferReport/mailTransferReport.model.js +++ b/server/api/mailTransferReport/mailTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x851e=['request-promise','path','rimraf','../../config/environment','exports','define','MailTransferReport','uniqueid','lodash','util','../../config/logger','bluebird'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x851e,0x1e8));var _0xe851=function(_0x3aff64,_0x55b017){_0x3aff64=_0x3aff64-0x0;var _0x1343d9=_0x851e[_0x3aff64];return _0x1343d9;};'use strict';var _=require(_0xe851('0x0'));var util=require(_0xe851('0x1'));var logger=require(_0xe851('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe851('0x3'));var rp=require(_0xe851('0x4'));var fs=require('fs');var path=require(_0xe851('0x5'));var rimraf=require(_0xe851('0x6'));var config=require(_0xe851('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0xe851('0x8')]=function(_0x2b36b5,_0xba0648){return _0x2b36b5[_0xe851('0x9')](_0xe851('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xe851('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcee8=['api','moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','report_mail_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x47d5c3,_0x2b43f){var _0x4d15fa=function(_0x25dd89){while(--_0x25dd89){_0x47d5c3['push'](_0x47d5c3['shift']());}};_0x4d15fa(++_0x2b43f);}(_0xcee8,0xb1));var _0x8cee=function(_0x43ac30,_0x451a5a){_0x43ac30=_0x43ac30-0x0;var _0xd805ed=_0xcee8[_0x43ac30];return _0xd805ed;};'use strict';var _=require(_0x8cee('0x0'));var util=require(_0x8cee('0x1'));var logger=require(_0x8cee('0x2'))(_0x8cee('0x3'));var moment=require(_0x8cee('0x4'));var BPromise=require(_0x8cee('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8cee('0x6'));var rimraf=require(_0x8cee('0x7'));var config=require(_0x8cee('0x8'));var attributes=require(_0x8cee('0x9'));module['exports']=function(_0x295471,_0xfea4e3){return _0x295471['define']('MailTransferReport',attributes,{'tableName':_0x8cee('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8cee('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 46fef11..0da6e26 100644 --- a/server/api/mailTransferReport/mailTransferReport.rpc.js +++ b/server/api/mailTransferReport/mailTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc63d=['debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x338a1d,_0x5ad84c){var _0x58e4b7=function(_0x28939c){while(--_0x28939c){_0x338a1d['push'](_0x338a1d['shift']());}};_0x58e4b7(++_0x5ad84c);}(_0xc63d,0x101));var _0xdc63=function(_0x2d5338,_0x4fac2e){_0x2d5338=_0x2d5338-0x0;var _0x2053c1=_0xc63d[_0x2d5338];return _0x2053c1;};'use strict';var _=require(_0xdc63('0x0'));var util=require(_0xdc63('0x1'));var moment=require(_0xdc63('0x2'));var BPromise=require(_0xdc63('0x3'));var rs=require(_0xdc63('0x4'));var fs=require('fs');var Redis=require(_0xdc63('0x5'));var db=require(_0xdc63('0x6'))['db'];var utils=require(_0xdc63('0x7'));var logger=require(_0xdc63('0x8'))(_0xdc63('0x9'));var config=require(_0xdc63('0xa'));var jayson=require(_0xdc63('0xb'));var client=jayson[_0xdc63('0xc')][_0xdc63('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2fb32f,_0x17afa1,_0x173600){return new BPromise(function(_0xc0df0f,_0x28619a){return client[_0xdc63('0xe')](_0x2fb32f,_0x173600)['then'](function(_0x210ea9){logger[_0xdc63('0xf')](_0xdc63('0x10'),_0x17afa1,_0xdc63('0x11'));logger[_0xdc63('0x12')](_0xdc63('0x13'),_0x17afa1,'request\x20sent',JSON[_0xdc63('0x14')](_0x210ea9));if(_0x210ea9['error']){if(_0x210ea9[_0xdc63('0x15')]['code']===0x1f4){logger[_0xdc63('0x15')](_0xdc63('0x10'),_0x17afa1,_0x210ea9[_0xdc63('0x15')][_0xdc63('0x16')]);return _0x28619a(_0x210ea9[_0xdc63('0x15')][_0xdc63('0x16')]);}logger[_0xdc63('0x15')](_0xdc63('0x10'),_0x17afa1,_0x210ea9[_0xdc63('0x15')][_0xdc63('0x16')]);return _0xc0df0f(_0x210ea9[_0xdc63('0x15')]['message']);}else{logger[_0xdc63('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x17afa1,_0xdc63('0x11'));_0xc0df0f(_0x210ea9[_0xdc63('0x17')][_0xdc63('0x16')]);}})[_0xdc63('0x18')](function(_0xf4ff8f){logger[_0xdc63('0x15')](_0xdc63('0x10'),_0x17afa1,_0xf4ff8f);_0x28619a(_0xf4ff8f);});});} \ No newline at end of file +var _0xc767=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0x1cb84c,_0x576b00){var _0x1ff4ed=function(_0x27e6b4){while(--_0x27e6b4){_0x1cb84c['push'](_0x1cb84c['shift']());}};_0x1ff4ed(++_0x576b00);}(_0xc767,0x108));var _0x7c76=function(_0x2a0e45,_0x370c5d){_0x2a0e45=_0x2a0e45-0x0;var _0x3595b8=_0xc767[_0x2a0e45];return _0x3595b8;};'use strict';var _=require(_0x7c76('0x0'));var util=require(_0x7c76('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7c76('0x2'));var fs=require('fs');var Redis=require(_0x7c76('0x3'));var db=require(_0x7c76('0x4'))['db'];var utils=require(_0x7c76('0x5'));var logger=require('../../config/logger')(_0x7c76('0x6'));var config=require(_0x7c76('0x7'));var jayson=require(_0x7c76('0x8'));var client=jayson[_0x7c76('0x9')][_0x7c76('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x987e4,_0x37424b,_0x4450d8){return new BPromise(function(_0x12d013,_0x4e6ca0){return client[_0x7c76('0xb')](_0x987e4,_0x4450d8)[_0x7c76('0xc')](function(_0x532244){logger[_0x7c76('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x37424b,_0x7c76('0xe'));logger['debug'](_0x7c76('0xf'),_0x37424b,_0x7c76('0xe'),JSON['stringify'](_0x532244));if(_0x532244[_0x7c76('0x10')]){if(_0x532244['error'][_0x7c76('0x11')]===0x1f4){logger['error'](_0x7c76('0x12'),_0x37424b,_0x532244['error'][_0x7c76('0x13')]);return _0x4e6ca0(_0x532244[_0x7c76('0x10')][_0x7c76('0x13')]);}logger[_0x7c76('0x10')](_0x7c76('0x12'),_0x37424b,_0x532244[_0x7c76('0x10')][_0x7c76('0x13')]);return _0x12d013(_0x532244[_0x7c76('0x10')][_0x7c76('0x13')]);}else{logger[_0x7c76('0xd')](_0x7c76('0x12'),_0x37424b,_0x7c76('0xe'));_0x12d013(_0x532244[_0x7c76('0x14')][_0x7c76('0x13')]);}})[_0x7c76('0x15')](function(_0x54ec38){logger[_0x7c76('0x10')](_0x7c76('0x12'),_0x37424b,_0x54ec38);_0x4e6ca0(_0x54ec38);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 46facbd..4c9b8cd 100644 --- a/server/api/memberReport/index.js +++ b/server/api/memberReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdfa=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete'];(function(_0x302d1a,_0x387081){var _0xd82ca=function(_0x24912b){while(--_0x24912b){_0x302d1a['push'](_0x302d1a['shift']());}};_0xd82ca(++_0x387081);}(_0xfdfa,0x1b8));var _0xafdf=function(_0x31da2c,_0x276d4d){_0x31da2c=_0x31da2c-0x0;var _0x191df1=_0xfdfa[_0x31da2c];return _0x191df1;};'use strict';var multer=require(_0xafdf('0x0'));var util=require('util');var path=require(_0xafdf('0x1'));var timeout=require(_0xafdf('0x2'));var express=require(_0xafdf('0x3'));var router=express[_0xafdf('0x4')]();var fs_extra=require(_0xafdf('0x5'));var auth=require(_0xafdf('0x6'));var interaction=require(_0xafdf('0x7'));var config=require(_0xafdf('0x8'));var controller=require(_0xafdf('0x9'));router[_0xafdf('0xa')]('/',auth['isAuthenticated'](),controller[_0xafdf('0xb')]);router[_0xafdf('0xa')](_0xafdf('0xc'),auth[_0xafdf('0xd')](),controller[_0xafdf('0xe')]);router[_0xafdf('0xa')](_0xafdf('0xf'),auth['isAuthenticated'](),controller[_0xafdf('0x10')]);router[_0xafdf('0x11')]('/',auth[_0xafdf('0xd')](),controller[_0xafdf('0x12')]);router[_0xafdf('0x13')](_0xafdf('0xf'),auth[_0xafdf('0xd')](),controller[_0xafdf('0x14')]);router[_0xafdf('0x15')](_0xafdf('0xf'),auth[_0xafdf('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6333=['/:id','delete','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x543341,_0x25271a){var _0x59362b=function(_0x29a265){while(--_0x29a265){_0x543341['push'](_0x543341['shift']());}};_0x59362b(++_0x25271a);}(_0x6333,0x1df));var _0x3633=function(_0x508a8e,_0x14eec6){_0x508a8e=_0x508a8e-0x0;var _0x3840b3=_0x6333[_0x508a8e];return _0x3840b3;};'use strict';var multer=require(_0x3633('0x0'));var util=require(_0x3633('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3633('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3633('0x3'));var interaction=require(_0x3633('0x4'));var config=require(_0x3633('0x5'));var controller=require(_0x3633('0x6'));router[_0x3633('0x7')]('/',auth[_0x3633('0x8')](),controller[_0x3633('0x9')]);router[_0x3633('0x7')](_0x3633('0xa'),auth['isAuthenticated'](),controller[_0x3633('0xb')]);router[_0x3633('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x3633('0xc')]);router[_0x3633('0xd')]('/',auth[_0x3633('0x8')](),controller[_0x3633('0xe')]);router['put'](_0x3633('0xf'),auth[_0x3633('0x8')](),controller['update']);router[_0x3633('0x10')](_0x3633('0xf'),auth[_0x3633('0x8')](),controller[_0x3633('0x11')]);module[_0x3633('0x12')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index ac88c14..33959de 100644 --- a/server/api/memberReport/memberReport.attributes.js +++ b/server/api/memberReport/memberReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36f4=['duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','seconds','setDataValue','exitAt'];(function(_0x57a6ca,_0x4fa1e4){var _0x3d2d2c=function(_0x48efd9){while(--_0x48efd9){_0x57a6ca['push'](_0x57a6ca['shift']());}};_0x3d2d2c(++_0x4fa1e4);}(_0x36f4,0x8d));var _0x436f=function(_0x1c7fa6,_0x401777){_0x1c7fa6=_0x1c7fa6-0x0;var _0x5dce05=_0x36f4[_0x1c7fa6];return _0x5dce05;};'use strict';var Sequelize=require(_0x436f('0x0'));var moment=require(_0x436f('0x1'));module[_0x436f('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x436f('0x3')]},'interface':{'type':Sequelize[_0x436f('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x436f('0x4'),'comment':_0x436f('0x5')},'duration':{'type':Sequelize[_0x436f('0x6')]},'enterAt':{'type':Sequelize[_0x436f('0x7')]},'exitAt':{'type':Sequelize[_0x436f('0x7')],'set':function(_0x2cdc94){var _0xcaa108=moment(_0x2cdc94);var _0x1f9f94=moment(this[_0x436f('0x8')]('enterAt'));var _0x228421=_0xcaa108['diff'](_0x1f9f94,_0x436f('0x9'));this[_0x436f('0xa')](_0x436f('0xb'),_0x2cdc94);this[_0x436f('0xa')](_0x436f('0xc'),_0x228421>=0x0?_0x228421:null);}},'data1':{'type':Sequelize[_0x436f('0x3')],'comment':_0x436f('0xd')},'data2':{'type':Sequelize['STRING'],'comment':_0x436f('0xe')},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x436f('0x3')],'comment':_0x436f('0xf')},'data5':{'type':Sequelize['STRING'],'comment':_0x436f('0x10')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x436f('0x6')]},'uniqueid':{'type':Sequelize[_0x436f('0x3')]}}; \ No newline at end of file +var _0x110c=['STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports'];(function(_0x48b6ef,_0x55bc21){var _0x4838cd=function(_0x1c4636){while(--_0x1c4636){_0x48b6ef['push'](_0x48b6ef['shift']());}};_0x4838cd(++_0x55bc21);}(_0x110c,0x10b));var _0xc110=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x110c[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0xc110('0x0'));var moment=require(_0xc110('0x1'));module[_0xc110('0x2')]={'channel':{'type':Sequelize[_0xc110('0x3')]},'membername':{'type':Sequelize[_0xc110('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0xc110('0x4'),'comment':_0xc110('0x5')},'duration':{'type':Sequelize[_0xc110('0x6')]},'enterAt':{'type':Sequelize[_0xc110('0x7')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x1dbc90){var _0x52b043=moment(_0x1dbc90);var _0xa653c7=moment(this['getDataValue'](_0xc110('0x8')));var _0x204b06=_0x52b043[_0xc110('0x9')](_0xa653c7,_0xc110('0xa'));this[_0xc110('0xb')](_0xc110('0xc'),_0x1dbc90);this[_0xc110('0xb')](_0xc110('0xd'),_0x204b06>=0x0?_0x204b06:null);}},'data1':{'type':Sequelize[_0xc110('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xc110('0x3')],'comment':_0xc110('0xe')},'data3':{'type':Sequelize[_0xc110('0x3')],'comment':_0xc110('0xf')},'data4':{'type':Sequelize['STRING'],'comment':_0xc110('0x10')},'data5':{'type':Sequelize[_0xc110('0x3')],'comment':_0xc110('0x11')},'role':{'type':Sequelize[_0xc110('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 3f8625f..c6abb50 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','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','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x1ae46e,_0x55dd9e){var _0x208f0d=function(_0x498133){while(--_0x498133){_0x1ae46e['push'](_0x1ae46e['shift']());}};_0x208f0d(++_0x55dd9e);}(_0x008c,0x188));var _0xc008=function(_0x263a0a,_0x2aebeb){_0x263a0a=_0x263a0a-0x0;var _0x9fdcb=_0x008c[_0x263a0a];return _0x9fdcb;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file +var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','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','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x1f00df,_0x28f546){var _0x2b7a64=function(_0x246ab7){while(--_0x246ab7){_0x1f00df['push'](_0x1f00df['shift']());}};_0x2b7a64(++_0x28f546);}(_0x008c,0x188));var _0xc008=function(_0x3f4891,_0x4e6f62){_0x3f4891=_0x3f4891-0x0;var _0x54f2d8=_0x008c[_0x3f4891];return _0x54f2d8;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 0e28a49..fb7afe3 100644 --- a/server/api/memberReport/memberReport.model.js +++ b/server/api/memberReport/memberReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x71fb=['lodash','util','../../config/logger','bluebird','path','rimraf','./memberReport.attributes','exports','define','report_member','membername_interface','membername','interface'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x71fb,0xd0));var _0xb71f=function(_0x1556cc,_0x5547de){_0x1556cc=_0x1556cc-0x0;var _0x566cba=_0x71fb[_0x1556cc];return _0x566cba;};'use strict';var _=require(_0xb71f('0x0'));var util=require(_0xb71f('0x1'));var logger=require(_0xb71f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb71f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb71f('0x4'));var rimraf=require(_0xb71f('0x5'));var config=require('../../config/environment');var attributes=require(_0xb71f('0x6'));module[_0xb71f('0x7')]=function(_0x3b0450,_0x5a4552){return _0x3b0450[_0xb71f('0x8')]('MemberReport',attributes,{'tableName':_0xb71f('0x9'),'paranoid':![],'indexes':[{'name':_0xb71f('0xa'),'fields':[_0xb71f('0xb'),_0xb71f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9075=['membername','interface','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','MemberReport','membername_interface'];(function(_0x39554a,_0x33a4a0){var _0xd2a67a=function(_0x1ee86a){while(--_0x1ee86a){_0x39554a['push'](_0x39554a['shift']());}};_0xd2a67a(++_0x33a4a0);}(_0x9075,0x7a));var _0x5907=function(_0x1a697e,_0x130466){_0x1a697e=_0x1a697e-0x0;var _0x40e871=_0x9075[_0x1a697e];return _0x40e871;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5907('0x0'))(_0x5907('0x1'));var moment=require(_0x5907('0x2'));var BPromise=require(_0x5907('0x3'));var rp=require(_0x5907('0x4'));var fs=require('fs');var path=require(_0x5907('0x5'));var rimraf=require(_0x5907('0x6'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0x5907('0x7')]=function(_0x1354f3,_0x5bc440){return _0x1354f3['define'](_0x5907('0x8'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x5907('0x9'),'fields':[_0x5907('0xa'),_0x5907('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 0d35466..4350512 100644 --- a/server/api/memberReport/memberReport.rpc.js +++ b/server/api/memberReport/memberReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9303=['create','body','raw','UpdateMemberReport','update','lodash','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','GetMemberReport','MemberReport','findAll','options','where','attributes','limit','include','map','model','debug','catch','CreateMemberReport'];(function(_0x5c30f0,_0x1d9f11){var _0x501e8f=function(_0x38bc5a){while(--_0x38bc5a){_0x5c30f0['push'](_0x5c30f0['shift']());}};_0x501e8f(++_0x1d9f11);}(_0x9303,0xd7));var _0x3930=function(_0x380b08,_0x1df63a){_0x380b08=_0x380b08-0x0;var _0x22f65d=_0x9303[_0x380b08];return _0x22f65d;};'use strict';var _=require(_0x3930('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3930('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3930('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3930('0x3'))(_0x3930('0x4'));var config=require(_0x3930('0x5'));var jayson=require(_0x3930('0x6'));var client=jayson['client'][_0x3930('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x55af25,_0x47d206,_0x20f2d8){return new BPromise(function(_0x4397b0,_0x20ba32){return client[_0x3930('0x8')](_0x55af25,_0x20f2d8)[_0x3930('0x9')](function(_0x58e723){logger['info'](_0x3930('0xa'),_0x47d206,'request\x20sent');logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x47d206,_0x3930('0xb'),JSON[_0x3930('0xc')](_0x58e723));if(_0x58e723[_0x3930('0xd')]){if(_0x58e723[_0x3930('0xd')][_0x3930('0xe')]===0x1f4){logger['error'](_0x3930('0xa'),_0x47d206,_0x58e723['error'][_0x3930('0xf')]);return _0x20ba32(_0x58e723[_0x3930('0xd')][_0x3930('0xf')]);}logger['error'](_0x3930('0xa'),_0x47d206,_0x58e723[_0x3930('0xd')]['message']);return _0x4397b0(_0x58e723[_0x3930('0xd')][_0x3930('0xf')]);}else{logger[_0x3930('0x10')](_0x3930('0xa'),_0x47d206,'request\x20sent');_0x4397b0(_0x58e723['result'][_0x3930('0xf')]);}})['catch'](function(_0x2a2562){logger['error'](_0x3930('0xa'),_0x47d206,_0x2a2562);_0x20ba32(_0x2a2562);});});}exports[_0x3930('0x11')]=function(_0x5a1c39){var _0x4a1405=this;return new Promise(function(_0x4b02b6,_0x1427f6){return db[_0x3930('0x12')][_0x3930('0x13')]({'raw':_0x5a1c39['options']?_0x5a1c39['options']['raw']===undefined?!![]:![]:!![],'where':_0x5a1c39['options']?_0x5a1c39[_0x3930('0x14')][_0x3930('0x15')]||null:null,'attributes':_0x5a1c39[_0x3930('0x14')]?_0x5a1c39[_0x3930('0x14')][_0x3930('0x16')]||null:null,'limit':_0x5a1c39['options']?_0x5a1c39[_0x3930('0x14')][_0x3930('0x17')]||null:null,'include':_0x5a1c39[_0x3930('0x14')]?_0x5a1c39['options'][_0x3930('0x18')]?_[_0x3930('0x19')](_0x5a1c39[_0x3930('0x14')][_0x3930('0x18')],function(_0x2bcc3b){return{'model':db[_0x2bcc3b[_0x3930('0x1a')]],'as':_0x2bcc3b['as'],'attributes':_0x2bcc3b[_0x3930('0x16')],'include':_0x2bcc3b[_0x3930('0x18')]?_['map'](_0x2bcc3b[_0x3930('0x18')],function(_0x1dcdcd){return{'model':db[_0x1dcdcd[_0x3930('0x1a')]],'as':_0x1dcdcd['as'],'attributes':_0x1dcdcd[_0x3930('0x16')],'include':_0x1dcdcd[_0x3930('0x18')]?_['map'](_0x1dcdcd[_0x3930('0x18')],function(_0x7b6825){return{'model':db[_0x7b6825[_0x3930('0x1a')]],'as':_0x7b6825['as'],'attributes':_0x7b6825['attributes']};}):[]};}):[]};}):[]:[]})[_0x3930('0x9')](function(_0x306d5b){logger[_0x3930('0x10')](_0x3930('0x11'),_0x5a1c39);logger[_0x3930('0x1b')]('GetMemberReport',_0x5a1c39,JSON[_0x3930('0xc')](_0x306d5b));_0x4b02b6(_0x306d5b);})[_0x3930('0x1c')](function(_0xca904a){logger['error'](_0x3930('0x11'),_0xca904a[_0x3930('0xf')],_0x5a1c39);_0x1427f6(_0x4a1405[_0x3930('0xd')](0x1f4,_0xca904a[_0x3930('0xf')]));});});};exports[_0x3930('0x1d')]=function(_0x8fdd26){var _0xcd21b7=this;return new Promise(function(_0xc4a53e,_0x148f4e){return db[_0x3930('0x12')][_0x3930('0x1e')](_0x8fdd26[_0x3930('0x1f')],{'raw':_0x8fdd26[_0x3930('0x14')]?_0x8fdd26[_0x3930('0x14')][_0x3930('0x20')]===undefined?!![]:![]:!![]})[_0x3930('0x9')](function(_0x3c9fb3){logger[_0x3930('0x10')](_0x3930('0x1d'),_0x8fdd26);logger[_0x3930('0x1b')]('CreateMemberReport',_0x8fdd26,JSON['stringify'](_0x3c9fb3));_0xc4a53e(_0x3c9fb3);})['catch'](function(_0x298387){logger[_0x3930('0xd')]('CreateMemberReport',_0x298387[_0x3930('0xf')],_0x8fdd26);_0x148f4e(_0xcd21b7[_0x3930('0xd')](0x1f4,_0x298387['message']));});});};exports[_0x3930('0x21')]=function(_0x587492){var _0x476e6e=this;return new Promise(function(_0x3aee1f,_0xbb5110){return db[_0x3930('0x12')][_0x3930('0x22')](_0x587492[_0x3930('0x1f')],{'raw':_0x587492[_0x3930('0x14')]?_0x587492[_0x3930('0x14')][_0x3930('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x587492[_0x3930('0x14')]?_0x587492[_0x3930('0x14')][_0x3930('0x15')]||null:null,'attributes':_0x587492[_0x3930('0x14')]?_0x587492[_0x3930('0x14')][_0x3930('0x16')]||null:null,'limit':_0x587492[_0x3930('0x14')]?_0x587492['options'][_0x3930('0x17')]||null:null})['then'](function(_0x33c7d2){logger['info'](_0x3930('0x21'),_0x587492);logger['debug']('UpdateMemberReport',_0x587492,JSON[_0x3930('0xc')](_0x33c7d2));_0x3aee1f(_0x33c7d2);})[_0x3930('0x1c')](function(_0x504cd6){logger['error'](_0x3930('0x21'),_0x504cd6['message'],_0x587492);_0xbb5110(_0x476e6e[_0x3930('0xd')](0x1f4,_0x504cd6[_0x3930('0xf')]));});});}; \ No newline at end of file +var _0x6808=['create','body','MemberReport','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MemberReport,\x20%s,\x20%s','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','debug','GetMemberReport','CreateMemberReport'];(function(_0x5d7a5e,_0x1f5d31){var _0x3aa67c=function(_0x4e557e){while(--_0x4e557e){_0x5d7a5e['push'](_0x5d7a5e['shift']());}};_0x3aa67c(++_0x1f5d31);}(_0x6808,0xd1));var _0x8680=function(_0x174d53,_0x3abb7e){_0x174d53=_0x174d53-0x0;var _0x14363b=_0x6808[_0x174d53];return _0x14363b;};'use strict';var _=require(_0x8680('0x0'));var util=require(_0x8680('0x1'));var moment=require(_0x8680('0x2'));var BPromise=require(_0x8680('0x3'));var rs=require(_0x8680('0x4'));var fs=require('fs');var Redis=require(_0x8680('0x5'));var db=require(_0x8680('0x6'))['db'];var utils=require(_0x8680('0x7'));var logger=require('../../config/logger')(_0x8680('0x8'));var config=require(_0x8680('0x9'));var jayson=require(_0x8680('0xa'));var client=jayson[_0x8680('0xb')][_0x8680('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ea2c7,_0xb588b7,_0x1b8e2c){return new BPromise(function(_0x4d7b13,_0x4d1c84){return client[_0x8680('0xd')](_0x5ea2c7,_0x1b8e2c)[_0x8680('0xe')](function(_0x5c49c9){logger[_0x8680('0xf')]('MemberReport,\x20%s,\x20%s',_0xb588b7,'request\x20sent');logger['debug'](_0x8680('0x10'),_0xb588b7,_0x8680('0x11'),JSON[_0x8680('0x12')](_0x5c49c9));if(_0x5c49c9[_0x8680('0x13')]){if(_0x5c49c9[_0x8680('0x13')][_0x8680('0x14')]===0x1f4){logger[_0x8680('0x13')]('MemberReport,\x20%s,\x20%s',_0xb588b7,_0x5c49c9['error'][_0x8680('0x15')]);return _0x4d1c84(_0x5c49c9[_0x8680('0x13')][_0x8680('0x15')]);}logger['error'](_0x8680('0x16'),_0xb588b7,_0x5c49c9[_0x8680('0x13')][_0x8680('0x15')]);return _0x4d7b13(_0x5c49c9[_0x8680('0x13')][_0x8680('0x15')]);}else{logger[_0x8680('0xf')](_0x8680('0x16'),_0xb588b7,'request\x20sent');_0x4d7b13(_0x5c49c9[_0x8680('0x17')]['message']);}})[_0x8680('0x18')](function(_0x5b9ad3){logger[_0x8680('0x13')](_0x8680('0x16'),_0xb588b7,_0x5b9ad3);_0x4d1c84(_0x5b9ad3);});});}exports['GetMemberReport']=function(_0x2b1d1f){var _0x90fbd7=this;return new Promise(function(_0x2345ee,_0x580491){return db['MemberReport'][_0x8680('0x19')]({'raw':_0x2b1d1f[_0x8680('0x1a')]?_0x2b1d1f[_0x8680('0x1a')][_0x8680('0x1b')]===undefined?!![]:![]:!![],'where':_0x2b1d1f[_0x8680('0x1a')]?_0x2b1d1f[_0x8680('0x1a')][_0x8680('0x1c')]||null:null,'attributes':_0x2b1d1f[_0x8680('0x1a')]?_0x2b1d1f['options'][_0x8680('0x1d')]||null:null,'limit':_0x2b1d1f['options']?_0x2b1d1f[_0x8680('0x1a')][_0x8680('0x1e')]||null:null,'include':_0x2b1d1f[_0x8680('0x1a')]?_0x2b1d1f['options'][_0x8680('0x1f')]?_[_0x8680('0x20')](_0x2b1d1f[_0x8680('0x1a')][_0x8680('0x1f')],function(_0x235099){return{'model':db[_0x235099[_0x8680('0x21')]],'as':_0x235099['as'],'attributes':_0x235099[_0x8680('0x1d')],'include':_0x235099[_0x8680('0x1f')]?_[_0x8680('0x20')](_0x235099[_0x8680('0x1f')],function(_0xd6b559){return{'model':db[_0xd6b559[_0x8680('0x21')]],'as':_0xd6b559['as'],'attributes':_0xd6b559[_0x8680('0x1d')],'include':_0xd6b559[_0x8680('0x1f')]?_['map'](_0xd6b559[_0x8680('0x1f')],function(_0x5cb33c){return{'model':db[_0x5cb33c[_0x8680('0x21')]],'as':_0x5cb33c['as'],'attributes':_0x5cb33c[_0x8680('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8680('0xe')](function(_0xbc82ac){logger[_0x8680('0xf')]('GetMemberReport',_0x2b1d1f);logger[_0x8680('0x22')]('GetMemberReport',_0x2b1d1f,JSON[_0x8680('0x12')](_0xbc82ac));_0x2345ee(_0xbc82ac);})['catch'](function(_0x295bce){logger[_0x8680('0x13')](_0x8680('0x23'),_0x295bce[_0x8680('0x15')],_0x2b1d1f);_0x580491(_0x90fbd7[_0x8680('0x13')](0x1f4,_0x295bce[_0x8680('0x15')]));});});};exports[_0x8680('0x24')]=function(_0x1c98f3){var _0x11cbb7=this;return new Promise(function(_0xe8064e,_0x26dbf1){return db['MemberReport'][_0x8680('0x25')](_0x1c98f3[_0x8680('0x26')],{'raw':_0x1c98f3[_0x8680('0x1a')]?_0x1c98f3[_0x8680('0x1a')][_0x8680('0x1b')]===undefined?!![]:![]:!![]})[_0x8680('0xe')](function(_0x3bd116){logger['info']('CreateMemberReport',_0x1c98f3);logger[_0x8680('0x22')](_0x8680('0x24'),_0x1c98f3,JSON[_0x8680('0x12')](_0x3bd116));_0xe8064e(_0x3bd116);})[_0x8680('0x18')](function(_0x2db6bb){logger[_0x8680('0x13')](_0x8680('0x24'),_0x2db6bb[_0x8680('0x15')],_0x1c98f3);_0x26dbf1(_0x11cbb7[_0x8680('0x13')](0x1f4,_0x2db6bb[_0x8680('0x15')]));});});};exports['UpdateMemberReport']=function(_0x25cd62){var _0x4dc990=this;return new Promise(function(_0x22c92d,_0x1087b9){return db[_0x8680('0x27')]['update'](_0x25cd62['body'],{'raw':_0x25cd62[_0x8680('0x1a')]?_0x25cd62[_0x8680('0x1a')][_0x8680('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25cd62[_0x8680('0x1a')]?_0x25cd62[_0x8680('0x1a')][_0x8680('0x1c')]||null:null,'attributes':_0x25cd62[_0x8680('0x1a')]?_0x25cd62['options'][_0x8680('0x1d')]||null:null,'limit':_0x25cd62[_0x8680('0x1a')]?_0x25cd62['options']['limit']||null:null})[_0x8680('0xe')](function(_0x3f300a){logger[_0x8680('0xf')](_0x8680('0x28'),_0x25cd62);logger[_0x8680('0x22')](_0x8680('0x28'),_0x25cd62,JSON[_0x8680('0x12')](_0x3f300a));_0x22c92d(_0x3f300a);})[_0x8680('0x18')](function(_0xaa1647){logger['error']('UpdateMemberReport',_0xaa1647['message'],_0x25cd62);_0x1087b9(_0x4dc990[_0x8680('0x13')](0x1f4,_0xaa1647['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 0339fa5..5d7600c 100644 --- a/server/api/migration/index.js +++ b/server/api/migration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58f0=['index','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./migration.controller','get'];(function(_0x4af78d,_0x10b5e1){var _0x1892da=function(_0x45d2a9){while(--_0x45d2a9){_0x4af78d['push'](_0x4af78d['shift']());}};_0x1892da(++_0x10b5e1);}(_0x58f0,0x1a6));var _0x058f=function(_0x256fb6,_0xe8343b){_0x256fb6=_0x256fb6-0x0;var _0x35e3be=_0x58f0[_0x256fb6];return _0x35e3be;};'use strict';var multer=require(_0x058f('0x0'));var util=require(_0x058f('0x1'));var path=require(_0x058f('0x2'));var timeout=require(_0x058f('0x3'));var express=require(_0x058f('0x4'));var router=express[_0x058f('0x5')]();var fs_extra=require(_0x058f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x058f('0x7'));var config=require('../../config/environment');var controller=require(_0x058f('0x8'));router[_0x058f('0x9')]('/',controller[_0x058f('0xa')]);module[_0x058f('0xb')]=router; \ No newline at end of file +var _0xc556=['get','index','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller'];(function(_0x23d21a,_0x4507d5){var _0x3c0fbb=function(_0x29923c){while(--_0x29923c){_0x23d21a['push'](_0x23d21a['shift']());}};_0x3c0fbb(++_0x4507d5);}(_0xc556,0xc3));var _0x6c55=function(_0x35c2fc,_0xabea37){_0x35c2fc=_0x35c2fc-0x0;var _0x4727fd=_0xc556[_0x35c2fc];return _0x4727fd;};'use strict';var multer=require(_0x6c55('0x0'));var util=require('util');var path=require(_0x6c55('0x1'));var timeout=require(_0x6c55('0x2'));var express=require(_0x6c55('0x3'));var router=express['Router']();var fs_extra=require(_0x6c55('0x4'));var auth=require(_0x6c55('0x5'));var interaction=require(_0x6c55('0x6'));var config=require(_0x6c55('0x7'));var controller=require(_0x6c55('0x8'));router[_0x6c55('0x9')]('/',controller[_0x6c55('0xa')]);module[_0x6c55('0xb')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 9aa91aa..b7aa123 100644 --- a/server/api/migration/migration.attributes.js +++ b/server/api/migration/migration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f58=['exports','version','sequelize'];(function(_0x7b39b5,_0x24375c){var _0x1e54fd=function(_0x34ec67){while(--_0x34ec67){_0x7b39b5['push'](_0x7b39b5['shift']());}};_0x1e54fd(++_0x24375c);}(_0x2f58,0x1d0));var _0x82f5=function(_0x527112,_0x56a4d5){_0x527112=_0x527112-0x0;var _0x7a7df3=_0x2f58[_0x527112];return _0x7a7df3;};'use strict';var Sequelize=require(_0x82f5('0x0'));module[_0x82f5('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x82f5('0x2')}}; \ No newline at end of file +var _0x6351=['exports','sequelize'];(function(_0x4e7cc3,_0x47ff4){var _0x42e46d=function(_0x43bd6e){while(--_0x43bd6e){_0x4e7cc3['push'](_0x4e7cc3['shift']());}};_0x42e46d(++_0x47ff4);}(_0x6351,0x1b7));var _0x1635=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0x6351[_0x1bbc08];return _0x5d825b;};'use strict';var Sequelize=require(_0x1635('0x0'));module[_0x1635('0x1')]={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index d30bf44..eb8f029 100644 --- a/server/api/migration/migration.controller.js +++ b/server/api/migration/migration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef0c=['count','offset','set','apply','update','then','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','options','includeAll','findAll','catch','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','limit','undefined'];(function(_0x451dd4,_0x451e98){var _0x383b12=function(_0x103dbe){while(--_0x103dbe){_0x451dd4['push'](_0x451dd4['shift']());}};_0x383b12(++_0x451e98);}(_0xef0c,0x11a));var _0xcef0=function(_0x1ef701,_0x1bf366){_0x1ef701=_0x1ef701-0x0;var _0x448d94=_0xef0c[_0x1ef701];return _0x448d94;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcef0('0x0'));var zipdir=require(_0xcef0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcef0('0x2'));var moment=require('moment');var BPromise=require(_0xcef0('0x3'));var Mustache=require('mustache');var util=require(_0xcef0('0x4'));var path=require('path');var sox=require(_0xcef0('0x5'));var csv=require(_0xcef0('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcef0('0x7'));var _=require(_0xcef0('0x8'));var squel=require(_0xcef0('0x9'));var crypto=require('crypto');var jsforce=require(_0xcef0('0xa'));var deskjs=require(_0xcef0('0xb'));var toCsv=require(_0xcef0('0x6'));var querystring=require(_0xcef0('0xc'));var Papa=require('papaparse');var Redis=require(_0xcef0('0xd'));var authService=require(_0xcef0('0xe'));var qs=require(_0xcef0('0xf'));var as=require(_0xcef0('0x10'));var hardwareService=require(_0xcef0('0x11'));var logger=require(_0xcef0('0x12'))(_0xcef0('0x13'));var utils=require(_0xcef0('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcef0('0x15'))['db'];function respondWithStatusCode(_0x49c5b3,_0x289dbb){_0x289dbb=_0x289dbb||0xcc;return function(_0x4ed577){if(_0x4ed577){return _0x49c5b3[_0xcef0('0x16')](_0x289dbb);}return _0x49c5b3[_0xcef0('0x17')](_0x289dbb)[_0xcef0('0x18')]();};}function respondWithResult(_0x5e7187,_0x2e9de2){_0x2e9de2=_0x2e9de2||0xc8;return function(_0x5cab73){if(_0x5cab73){return _0x5e7187[_0xcef0('0x17')](_0x2e9de2)[_0xcef0('0x19')](_0x5cab73);}};}function respondWithFilteredResult(_0x4dab69,_0xb01ab9){return function(_0x2fe7d4){if(_0x2fe7d4){var _0x5e9c52=typeof _0xb01ab9['offset']==='undefined'&&typeof _0xb01ab9[_0xcef0('0x1a')]===_0xcef0('0x1b');var _0x481da2=_0x2fe7d4[_0xcef0('0x1c')];var _0x15753a=_0x5e9c52?0x0:_0xb01ab9['offset'];var _0x4817f1=_0x5e9c52?_0x2fe7d4[_0xcef0('0x1c')]:_0xb01ab9[_0xcef0('0x1d')]+_0xb01ab9[_0xcef0('0x1a')];var _0x3072b2;if(_0x4817f1>=_0x481da2){_0x4817f1=_0x481da2;_0x3072b2=0xc8;}else{_0x3072b2=0xce;}_0x4dab69[_0xcef0('0x17')](_0x3072b2);return _0x4dab69[_0xcef0('0x1e')]('Content-Range',_0x15753a+'-'+_0x4817f1+'/'+_0x481da2)[_0xcef0('0x19')](_0x2fe7d4);}return null;};}function patchUpdates(_0x35208c){return function(_0x1f5756){try{jsonpatch[_0xcef0('0x1f')](_0x1f5756,_0x35208c,!![]);}catch(_0x3f1936){return BPromise['reject'](_0x3f1936);}return _0x1f5756['save']();};}function saveUpdates(_0x2bfb37,_0x59c8a7){return function(_0x1b5aea){if(_0x1b5aea){return _0x1b5aea[_0xcef0('0x20')](_0x2bfb37)[_0xcef0('0x21')](function(_0x2a60c0){return _0x2a60c0;});}return null;};}function removeEntity(_0xe875a1,_0x1b1118){return function(_0x2384fa){if(_0x2384fa){return _0x2384fa['destroy']()['then'](function(){_0xe875a1[_0xcef0('0x17')](0xcc)[_0xcef0('0x18')]();});}};}function handleEntityNotFound(_0x1d960e,_0x2b731d){return function(_0x461e28){if(!_0x461e28){_0x1d960e[_0xcef0('0x16')](0x194);}return _0x461e28;};}function handleError(_0x2d5578,_0x1ac6ba){_0x1ac6ba=_0x1ac6ba||0x1f4;return function(_0x5aa40a){logger['error'](_0x5aa40a[_0xcef0('0x22')]);if(_0x5aa40a[_0xcef0('0x23')]){delete _0x5aa40a[_0xcef0('0x23')];}_0x2d5578[_0xcef0('0x17')](_0x1ac6ba)[_0xcef0('0x24')](_0x5aa40a);};}exports[_0xcef0('0x25')]=function(_0x4dc171,_0x22d5f7){var _0x599964={},_0x4b7399={},_0x35fb32={'count':0x0,'rows':[]};var _0x2a6a2c=_[_0xcef0('0x26')](db[_0xcef0('0x27')][_0xcef0('0x28')],function(_0x592732){return{'name':_0x592732[_0xcef0('0x29')],'type':_0x592732[_0xcef0('0x2a')]['key']};});_0x4b7399[_0xcef0('0x2b')]=_['map'](_0x2a6a2c,_0xcef0('0x23'));_0x4b7399[_0xcef0('0x2c')]=_[_0xcef0('0x2d')](_0x4dc171[_0xcef0('0x2c')]);_0x4b7399[_0xcef0('0x2e')]=_[_0xcef0('0x2f')](_0x4b7399[_0xcef0('0x2b')],_0x4b7399[_0xcef0('0x2c')]);_0x599964[_0xcef0('0x30')]=_[_0xcef0('0x2f')](_0x4b7399['model'],qs[_0xcef0('0x31')](_0x4dc171[_0xcef0('0x2c')][_0xcef0('0x31')]));_0x599964[_0xcef0('0x30')]=_0x599964['attributes'][_0xcef0('0x32')]?_0x599964[_0xcef0('0x30')]:_0x4b7399[_0xcef0('0x2b')];if(!_0x4dc171[_0xcef0('0x2c')][_0xcef0('0x33')](_0xcef0('0x34'))){_0x599964[_0xcef0('0x1a')]=qs[_0xcef0('0x1a')](_0x4dc171[_0xcef0('0x2c')]['limit']);_0x599964[_0xcef0('0x1d')]=qs[_0xcef0('0x1d')](_0x4dc171[_0xcef0('0x2c')][_0xcef0('0x1d')]);}_0x599964['order']=qs['sort'](_0x4dc171['query'][_0xcef0('0x35')]);_0x599964['where']=qs['filters'](_[_0xcef0('0x36')](_0x4dc171['query'],_0x4b7399['filters']),_0x2a6a2c);if(_0x4dc171[_0xcef0('0x2c')][_0xcef0('0x37')]){_0x599964[_0xcef0('0x38')]=_['merge'](_0x599964[_0xcef0('0x38')],{'$or':_[_0xcef0('0x26')](_0x2a6a2c,function(_0x1d0d3e){if(_0x1d0d3e[_0xcef0('0x2a')]!==_0xcef0('0x39')){var _0x17fe7f={};_0x17fe7f[_0x1d0d3e[_0xcef0('0x23')]]={'$like':'%'+_0x4dc171['query'][_0xcef0('0x37')]+'%'};return _0x17fe7f;}})});}_0x599964=_['merge']({},_0x599964,_0x4dc171[_0xcef0('0x3a')]);var _0x3a1140={'where':_0x599964[_0xcef0('0x38')]};return db[_0xcef0('0x27')][_0xcef0('0x1c')](_0x3a1140)[_0xcef0('0x21')](function(_0x445a8c){_0x35fb32[_0xcef0('0x1c')]=_0x445a8c;if(_0x4dc171[_0xcef0('0x2c')][_0xcef0('0x3b')]){_0x599964['include']=[{'all':!![]}];}return db[_0xcef0('0x27')][_0xcef0('0x3c')](_0x599964);})[_0xcef0('0x21')](function(_0x46b207){_0x35fb32['rows']=_0x46b207;return _0x35fb32;})[_0xcef0('0x21')](respondWithFilteredResult(_0x22d5f7,_0x599964))[_0xcef0('0x3d')](handleError(_0x22d5f7,null));}; \ No newline at end of file +var _0xd910=['name','send','map','Migration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','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','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error'];(function(_0x2c8350,_0x3bb4a6){var _0x5a41fb=function(_0x343b55){while(--_0x343b55){_0x2c8350['push'](_0x2c8350['shift']());}};_0x5a41fb(++_0x3bb4a6);}(_0xd910,0xf2));var _0x0d91=function(_0x4f765e,_0x4b3f01){_0x4f765e=_0x4f765e-0x0;var _0x234457=_0xd910[_0x4f765e];return _0x234457;};'use strict';var emlformat=require(_0x0d91('0x0'));var rimraf=require(_0x0d91('0x1'));var zipdir=require(_0x0d91('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0d91('0x3'));var moment=require(_0x0d91('0x4'));var BPromise=require(_0x0d91('0x5'));var Mustache=require(_0x0d91('0x6'));var util=require(_0x0d91('0x7'));var path=require(_0x0d91('0x8'));var sox=require(_0x0d91('0x9'));var csv=require(_0x0d91('0xa'));var ejs=require(_0x0d91('0xb'));var fs=require('fs');var fs_extra=require(_0x0d91('0xc'));var _=require(_0x0d91('0xd'));var squel=require(_0x0d91('0xe'));var crypto=require(_0x0d91('0xf'));var jsforce=require(_0x0d91('0x10'));var deskjs=require(_0x0d91('0x11'));var toCsv=require(_0x0d91('0xa'));var querystring=require(_0x0d91('0x12'));var Papa=require('papaparse');var Redis=require(_0x0d91('0x13'));var authService=require(_0x0d91('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x0d91('0x15'));var hardwareService=require(_0x0d91('0x16'));var logger=require(_0x0d91('0x17'))(_0x0d91('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0d91('0x19'))['db'];function respondWithStatusCode(_0x3c611c,_0x86bbe0){_0x86bbe0=_0x86bbe0||0xcc;return function(_0x46606c){if(_0x46606c){return _0x3c611c[_0x0d91('0x1a')](_0x86bbe0);}return _0x3c611c[_0x0d91('0x1b')](_0x86bbe0)[_0x0d91('0x1c')]();};}function respondWithResult(_0x3475f0,_0x507f95){_0x507f95=_0x507f95||0xc8;return function(_0x19d23e){if(_0x19d23e){return _0x3475f0[_0x0d91('0x1b')](_0x507f95)[_0x0d91('0x1d')](_0x19d23e);}};}function respondWithFilteredResult(_0x33d6a5,_0x1d800b){return function(_0x44bfd4){if(_0x44bfd4){var _0x3f9732=typeof _0x1d800b['offset']===_0x0d91('0x1e')&&typeof _0x1d800b[_0x0d91('0x1f')]===_0x0d91('0x1e');var _0x2e4e96=_0x44bfd4[_0x0d91('0x20')];var _0x525d6c=_0x3f9732?0x0:_0x1d800b[_0x0d91('0x21')];var _0x26d3b9=_0x3f9732?_0x44bfd4[_0x0d91('0x20')]:_0x1d800b['offset']+_0x1d800b[_0x0d91('0x1f')];var _0x5d38c9;if(_0x26d3b9>=_0x2e4e96){_0x26d3b9=_0x2e4e96;_0x5d38c9=0xc8;}else{_0x5d38c9=0xce;}_0x33d6a5[_0x0d91('0x1b')](_0x5d38c9);return _0x33d6a5[_0x0d91('0x22')](_0x0d91('0x23'),_0x525d6c+'-'+_0x26d3b9+'/'+_0x2e4e96)[_0x0d91('0x1d')](_0x44bfd4);}return null;};}function patchUpdates(_0x5914a7){return function(_0x38a108){try{jsonpatch[_0x0d91('0x24')](_0x38a108,_0x5914a7,!![]);}catch(_0x4c761a){return BPromise[_0x0d91('0x25')](_0x4c761a);}return _0x38a108[_0x0d91('0x26')]();};}function saveUpdates(_0x46ce3e,_0x2c59af){return function(_0x1b2690){if(_0x1b2690){return _0x1b2690['update'](_0x46ce3e)[_0x0d91('0x27')](function(_0x10d14f){return _0x10d14f;});}return null;};}function removeEntity(_0x250c79,_0x50a86b){return function(_0xb95dcc){if(_0xb95dcc){return _0xb95dcc[_0x0d91('0x28')]()[_0x0d91('0x27')](function(){_0x250c79[_0x0d91('0x1b')](0xcc)[_0x0d91('0x1c')]();});}};}function handleEntityNotFound(_0x3a0598,_0x3637b4){return function(_0x28d98c){if(!_0x28d98c){_0x3a0598[_0x0d91('0x1a')](0x194);}return _0x28d98c;};}function handleError(_0x1e44bc,_0x426a4e){_0x426a4e=_0x426a4e||0x1f4;return function(_0x5239b7){logger[_0x0d91('0x29')](_0x5239b7['stack']);if(_0x5239b7[_0x0d91('0x2a')]){delete _0x5239b7['name'];}_0x1e44bc['status'](_0x426a4e)[_0x0d91('0x2b')](_0x5239b7);};}exports['index']=function(_0x274009,_0x3eadda){var _0x382f18={},_0x5299f3={},_0x448901={'count':0x0,'rows':[]};var _0x725be8=_[_0x0d91('0x2c')](db[_0x0d91('0x2d')][_0x0d91('0x2e')],function(_0x14fcea){return{'name':_0x14fcea['fieldName'],'type':_0x14fcea[_0x0d91('0x2f')][_0x0d91('0x30')]};});_0x5299f3[_0x0d91('0x31')]=_[_0x0d91('0x2c')](_0x725be8,_0x0d91('0x2a'));_0x5299f3[_0x0d91('0x32')]=_[_0x0d91('0x33')](_0x274009[_0x0d91('0x32')]);_0x5299f3[_0x0d91('0x34')]=_[_0x0d91('0x35')](_0x5299f3['model'],_0x5299f3[_0x0d91('0x32')]);_0x382f18[_0x0d91('0x36')]=_[_0x0d91('0x35')](_0x5299f3[_0x0d91('0x31')],qs[_0x0d91('0x37')](_0x274009['query'][_0x0d91('0x37')]));_0x382f18['attributes']=_0x382f18[_0x0d91('0x36')][_0x0d91('0x38')]?_0x382f18['attributes']:_0x5299f3[_0x0d91('0x31')];if(!_0x274009[_0x0d91('0x32')]['hasOwnProperty'](_0x0d91('0x39'))){_0x382f18[_0x0d91('0x1f')]=qs[_0x0d91('0x1f')](_0x274009[_0x0d91('0x32')][_0x0d91('0x1f')]);_0x382f18[_0x0d91('0x21')]=qs['offset'](_0x274009['query'][_0x0d91('0x21')]);}_0x382f18[_0x0d91('0x3a')]=qs[_0x0d91('0x3b')](_0x274009[_0x0d91('0x32')]['sort']);_0x382f18[_0x0d91('0x3c')]=qs[_0x0d91('0x34')](_[_0x0d91('0x3d')](_0x274009[_0x0d91('0x32')],_0x5299f3[_0x0d91('0x34')]),_0x725be8);if(_0x274009[_0x0d91('0x32')][_0x0d91('0x3e')]){_0x382f18[_0x0d91('0x3c')]=_[_0x0d91('0x3f')](_0x382f18[_0x0d91('0x3c')],{'$or':_['map'](_0x725be8,function(_0x4b9bb0){if(_0x4b9bb0[_0x0d91('0x2f')]!==_0x0d91('0x40')){var _0x21efc8={};_0x21efc8[_0x4b9bb0[_0x0d91('0x2a')]]={'$like':'%'+_0x274009[_0x0d91('0x32')]['filter']+'%'};return _0x21efc8;}})});}_0x382f18=_['merge']({},_0x382f18,_0x274009[_0x0d91('0x41')]);var _0x492ab4={'where':_0x382f18[_0x0d91('0x3c')]};return db[_0x0d91('0x2d')]['count'](_0x492ab4)[_0x0d91('0x27')](function(_0x120af2){_0x448901[_0x0d91('0x20')]=_0x120af2;if(_0x274009[_0x0d91('0x32')][_0x0d91('0x42')]){_0x382f18[_0x0d91('0x43')]=[{'all':!![]}];}return db[_0x0d91('0x2d')][_0x0d91('0x44')](_0x382f18);})[_0x0d91('0x27')](function(_0x5abc1d){_0x448901[_0x0d91('0x45')]=_0x5abc1d;return _0x448901;})[_0x0d91('0x27')](respondWithFilteredResult(_0x3eadda,_0x382f18))[_0x0d91('0x46')](handleError(_0x3eadda,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index a7eb086..f0660c7 100644 --- a/server/api/migration/migration.model.js +++ b/server/api/migration/migration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe0d8=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./migration.attributes','exports','define','migrations','util'];(function(_0x1c4ad0,_0x11cf55){var _0x421d71=function(_0x29a683){while(--_0x29a683){_0x1c4ad0['push'](_0x1c4ad0['shift']());}};_0x421d71(++_0x11cf55);}(_0xe0d8,0x1a1));var _0x8e0d=function(_0x1c34e7,_0x33f9a8){_0x1c34e7=_0x1c34e7-0x0;var _0x378cb1=_0xe0d8[_0x1c34e7];return _0x378cb1;};'use strict';var _=require('lodash');var util=require(_0x8e0d('0x0'));var logger=require(_0x8e0d('0x1'))(_0x8e0d('0x2'));var moment=require(_0x8e0d('0x3'));var BPromise=require('bluebird');var rp=require(_0x8e0d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e0d('0x5'));var config=require(_0x8e0d('0x6'));var attributes=require(_0x8e0d('0x7'));module[_0x8e0d('0x8')]=function(_0x56ba7f,_0x47c038){return _0x56ba7f[_0x8e0d('0x9')]('Migration',attributes,{'tableName':_0x8e0d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc78=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Migration','migrations','lodash','util','../../config/logger'];(function(_0x111c17,_0x275184){var _0x5ff50a=function(_0x4ebc34){while(--_0x4ebc34){_0x111c17['push'](_0x111c17['shift']());}};_0x5ff50a(++_0x275184);}(_0xdc78,0x142));var _0x8dc7=function(_0x288efd,_0x86ff6b){_0x288efd=_0x288efd-0x0;var _0x7466bb=_0xdc78[_0x288efd];return _0x7466bb;};'use strict';var _=require(_0x8dc7('0x0'));var util=require(_0x8dc7('0x1'));var logger=require(_0x8dc7('0x2'))('api');var moment=require(_0x8dc7('0x3'));var BPromise=require(_0x8dc7('0x4'));var rp=require(_0x8dc7('0x5'));var fs=require('fs');var path=require(_0x8dc7('0x6'));var rimraf=require(_0x8dc7('0x7'));var config=require(_0x8dc7('0x8'));var attributes=require('./migration.attributes');module[_0x8dc7('0x9')]=function(_0x4593d4,_0xa965ed){return _0x4593d4[_0x8dc7('0xa')](_0x8dc7('0xb'),attributes,{'tableName':_0x8dc7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 1202b20..95bfc0c 100644 --- a/server/api/migration/migration.rpc.js +++ b/server/api/migration/migration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb921=['info','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xa35eb5,_0xc91775){var _0x4371f7=function(_0x589ab5){while(--_0x589ab5){_0xa35eb5['push'](_0xa35eb5['shift']());}};_0x4371f7(++_0xc91775);}(_0xb921,0x16a));var _0x1b92=function(_0x1efa08,_0x2633ad){_0x1efa08=_0x1efa08-0x0;var _0x11c3da=_0xb921[_0x1efa08];return _0x11c3da;};'use strict';var _=require(_0x1b92('0x0'));var util=require(_0x1b92('0x1'));var moment=require(_0x1b92('0x2'));var BPromise=require(_0x1b92('0x3'));var rs=require(_0x1b92('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1b92('0x5'));var logger=require(_0x1b92('0x6'))(_0x1b92('0x7'));var config=require(_0x1b92('0x8'));var jayson=require(_0x1b92('0x9'));var client=jayson[_0x1b92('0xa')][_0x1b92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8a6282,_0x7973df,_0x352406){return new BPromise(function(_0x1545f9,_0x64a3ed){return client[_0x1b92('0xc')](_0x8a6282,_0x352406)[_0x1b92('0xd')](function(_0x4567ab){logger['info'](_0x1b92('0xe'),_0x7973df,_0x1b92('0xf'));logger[_0x1b92('0x10')](_0x1b92('0x11'),_0x7973df,_0x1b92('0xf'),JSON[_0x1b92('0x12')](_0x4567ab));if(_0x4567ab[_0x1b92('0x13')]){if(_0x4567ab['error'][_0x1b92('0x14')]===0x1f4){logger[_0x1b92('0x13')]('Migration,\x20%s,\x20%s',_0x7973df,_0x4567ab[_0x1b92('0x13')][_0x1b92('0x15')]);return _0x64a3ed(_0x4567ab[_0x1b92('0x13')][_0x1b92('0x15')]);}logger[_0x1b92('0x13')](_0x1b92('0xe'),_0x7973df,_0x4567ab[_0x1b92('0x13')]['message']);return _0x1545f9(_0x4567ab[_0x1b92('0x13')]['message']);}else{logger[_0x1b92('0x16')]('Migration,\x20%s,\x20%s',_0x7973df,_0x1b92('0xf'));_0x1545f9(_0x4567ab['result'][_0x1b92('0x15')]);}})[_0x1b92('0x17')](function(_0x688aef){logger['error'](_0x1b92('0xe'),_0x7973df,_0x688aef);_0x64a3ed(_0x688aef);});});} \ No newline at end of file +var _0x7d5a=['request','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','Migration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2ba9b7,_0x171d3a){var _0x2adc3b=function(_0x893c53){while(--_0x893c53){_0x2ba9b7['push'](_0x2ba9b7['shift']());}};_0x2adc3b(++_0x171d3a);}(_0x7d5a,0x17b));var _0xa7d5=function(_0x1b76b5,_0x13416e){_0x1b76b5=_0x1b76b5-0x0;var _0x214e01=_0x7d5a[_0x1b76b5];return _0x214e01;};'use strict';var _=require(_0xa7d5('0x0'));var util=require(_0xa7d5('0x1'));var moment=require(_0xa7d5('0x2'));var BPromise=require(_0xa7d5('0x3'));var rs=require(_0xa7d5('0x4'));var fs=require('fs');var Redis=require(_0xa7d5('0x5'));var db=require(_0xa7d5('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa7d5('0x7'));var config=require(_0xa7d5('0x8'));var jayson=require(_0xa7d5('0x9'));var client=jayson[_0xa7d5('0xa')][_0xa7d5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x80431a,_0x5a8f8a,_0x21ccfa){return new BPromise(function(_0xb5bcd2,_0x2c2c25){return client[_0xa7d5('0xc')](_0x80431a,_0x21ccfa)[_0xa7d5('0xd')](function(_0xf40c67){logger[_0xa7d5('0xe')]('Migration,\x20%s,\x20%s',_0x5a8f8a,_0xa7d5('0xf'));logger[_0xa7d5('0x10')](_0xa7d5('0x11'),_0x5a8f8a,'request\x20sent',JSON[_0xa7d5('0x12')](_0xf40c67));if(_0xf40c67[_0xa7d5('0x13')]){if(_0xf40c67[_0xa7d5('0x13')]['code']===0x1f4){logger[_0xa7d5('0x13')](_0xa7d5('0x14'),_0x5a8f8a,_0xf40c67[_0xa7d5('0x13')][_0xa7d5('0x15')]);return _0x2c2c25(_0xf40c67[_0xa7d5('0x13')]['message']);}logger[_0xa7d5('0x13')](_0xa7d5('0x14'),_0x5a8f8a,_0xf40c67[_0xa7d5('0x13')][_0xa7d5('0x15')]);return _0xb5bcd2(_0xf40c67[_0xa7d5('0x13')]['message']);}else{logger[_0xa7d5('0xe')](_0xa7d5('0x14'),_0x5a8f8a,_0xa7d5('0xf'));_0xb5bcd2(_0xf40c67['result']['message']);}})[_0xa7d5('0x16')](function(_0x53d884){logger[_0xa7d5('0x13')](_0xa7d5('0x14'),_0x5a8f8a,_0x53d884);_0x2c2c25(_0x53d884);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 1cdce3e..48135dc 100644 --- a/server/api/network/index.js +++ b/server/api/network/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc029=['show','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id'];(function(_0x32209e,_0x4838f0){var _0x374861=function(_0x362fab){while(--_0x362fab){_0x32209e['push'](_0x32209e['shift']());}};_0x374861(++_0x4838f0);}(_0xc029,0x1df));var _0x9c02=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0xc029[_0x424501];return _0xb719af;};'use strict';var multer=require(_0x9c02('0x0'));var util=require(_0x9c02('0x1'));var path=require(_0x9c02('0x2'));var timeout=require(_0x9c02('0x3'));var express=require(_0x9c02('0x4'));var router=express[_0x9c02('0x5')]();var fs_extra=require(_0x9c02('0x6'));var auth=require(_0x9c02('0x7'));var interaction=require(_0x9c02('0x8'));var config=require(_0x9c02('0x9'));var controller=require(_0x9c02('0xa'));router[_0x9c02('0xb')]('/',auth[_0x9c02('0xc')](),controller[_0x9c02('0xd')]);router[_0x9c02('0xb')](_0x9c02('0xe'),auth[_0x9c02('0xc')](),controller[_0x9c02('0xf')]);router['post']('/',auth[_0x9c02('0xc')](),controller['create']);router[_0x9c02('0x10')](_0x9c02('0xe'),auth[_0x9c02('0xc')](),controller[_0x9c02('0x11')]);router['delete'](_0x9c02('0xe'),auth['isAuthenticated'](),controller[_0x9c02('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9fe7=['put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','index','/:id','show','post','isAuthenticated','create'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x9fe7,0x1df));var _0x79fe=function(_0x202939,_0x4a1063){_0x202939=_0x202939-0x0;var _0x243aec=_0x9fe7[_0x202939];return _0x243aec;};'use strict';var multer=require(_0x79fe('0x0'));var util=require(_0x79fe('0x1'));var path=require('path');var timeout=require(_0x79fe('0x2'));var express=require('express');var router=express[_0x79fe('0x3')]();var fs_extra=require(_0x79fe('0x4'));var auth=require(_0x79fe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x79fe('0x6'));var controller=require(_0x79fe('0x7'));router[_0x79fe('0x8')]('/',auth['isAuthenticated'](),controller[_0x79fe('0x9')]);router[_0x79fe('0x8')](_0x79fe('0xa'),auth['isAuthenticated'](),controller[_0x79fe('0xb')]);router[_0x79fe('0xc')]('/',auth[_0x79fe('0xd')](),controller[_0x79fe('0xe')]);router[_0x79fe('0xf')]('/:id',auth[_0x79fe('0xd')](),controller[_0x79fe('0x10')]);router['delete'](_0x79fe('0xa'),auth[_0x79fe('0xd')](),controller[_0x79fe('0x11')]);module[_0x79fe('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index a3c0bb2..d5779d0 100644 --- a/server/api/network/network.attributes.js +++ b/server/api/network/network.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f48=['STRING','sequelize','exports','ENUM','externip','stun'];(function(_0x56aa4e,_0x4be1ae){var _0x4c588f=function(_0x58c7a7){while(--_0x58c7a7){_0x56aa4e['push'](_0x56aa4e['shift']());}};_0x4c588f(++_0x4be1ae);}(_0x2f48,0x1a5));var _0x82f4=function(_0x473329,_0x3294d0){_0x473329=_0x473329-0x0;var _0x23148f=_0x2f48[_0x473329];return _0x23148f;};'use strict';var Sequelize=require(_0x82f4('0x0'));module[_0x82f4('0x1')]={'type':{'type':Sequelize[_0x82f4('0x2')]('localnet',_0x82f4('0x3'),_0x82f4('0x4'),'turn')},'value':{'type':Sequelize[_0x82f4('0x5')]},'username':{'type':Sequelize[_0x82f4('0x5')]},'password':{'type':Sequelize[_0x82f4('0x5')]}}; \ No newline at end of file +var _0xcecb=['turn','STRING','sequelize','exports','ENUM','localnet','externip','stun'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xcecb,0xda));var _0xbcec=function(_0x355251,_0x2e0b1f){_0x355251=_0x355251-0x0;var _0x3b6bb9=_0xcecb[_0x355251];return _0x3b6bb9;};'use strict';var Sequelize=require(_0xbcec('0x0'));module[_0xbcec('0x1')]={'type':{'type':Sequelize[_0xbcec('0x2')](_0xbcec('0x3'),_0xbcec('0x4'),_0xbcec('0x5'),_0xbcec('0x6'))},'value':{'type':Sequelize[_0xbcec('0x7')]},'username':{'type':Sequelize[_0xbcec('0x7')]},'password':{'type':Sequelize[_0xbcec('0x7')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 121f7d4..b08119c 100644 --- a/server/api/network/network.controller.js +++ b/server/api/network/network.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4980=['body','toUpperCase','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','STUN','toLowerCase','update','params','destroy','util','path','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','limit','undefined','offset','count','set','Content-Range','json','end','sendStatus','name','send','index','map','Network','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','show','includeAll','include','find','create'];(function(_0x4e71f7,_0x147594){var _0x29970b=function(_0x42d937){while(--_0x42d937){_0x4e71f7['push'](_0x4e71f7['shift']());}};_0x29970b(++_0x147594);}(_0x4980,0x11d));var _0x0498=function(_0x58ee61,_0x41f78f){_0x58ee61=_0x58ee61-0x0;var _0x1b8825=_0x4980[_0x58ee61];return _0x1b8825;};'use strict';var util=require(_0x0498('0x0'));var path=require(_0x0498('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var qs=require(_0x0498('0x2'));var logger=require(_0x0498('0x3'))('api');var config=require(_0x0498('0x4'));var db=require(_0x0498('0x5'))['db'];var jayson=require(_0x0498('0x6'));var client=jayson[_0x0498('0x7')][_0x0498('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26f583,_0x453c2b,_0x169233,_0x39c8e2){return new Promise(function(_0x20695c,_0x2e5bfa){var _0x39154e=_0x39c8e2||client;return _0x39154e[_0x0498('0x9')](_0x26f583,_0x169233)[_0x0498('0xa')](function(_0x488e4){logger[_0x0498('0xb')](_0x0498('0xc'),_0x453c2b,_0x0498('0xd'));logger[_0x0498('0xe')](_0x0498('0xf'),_0x453c2b,_0x0498('0xd'),JSON['stringify'](_0x488e4));if(_0x488e4[_0x0498('0x10')]){if(_0x488e4['error'][_0x0498('0x11')]===0x1f4){logger[_0x0498('0x10')](_0x0498('0xc'),_0x453c2b,_0x488e4[_0x0498('0x10')][_0x0498('0x12')]);return _0x2e5bfa(_0x488e4[_0x0498('0x10')][_0x0498('0x12')]);}logger[_0x0498('0x10')](_0x0498('0xc'),_0x453c2b,_0x488e4['error']['message']);return _0x20695c(_0x488e4['error'][_0x0498('0x12')]);}else{logger[_0x0498('0xb')](_0x0498('0xc'),_0x453c2b,_0x0498('0xd'));_0x20695c(_0x488e4[_0x0498('0x13')][_0x0498('0x12')]);}})[_0x0498('0x14')](function(_0x388033){logger[_0x0498('0x10')](_0x0498('0xc'),_0x453c2b,_0x388033);_0x2e5bfa(_0x388033);});});}function respondWithResult(_0x39c731,_0x47eb6d){_0x47eb6d=_0x47eb6d||0xc8;return function(_0x2e33ec){if(_0x2e33ec){return _0x39c731[_0x0498('0x15')](_0x47eb6d)['json'](_0x2e33ec);}};}function respondWithFilteredResult(_0x1ccc14,_0x2262de){return function(_0x3942d4){if(_0x3942d4){var _0x35e786=typeof _0x2262de['offset']==='undefined'&&typeof _0x2262de[_0x0498('0x16')]===_0x0498('0x17');var _0x2f6ba5=_0x3942d4['count'];var _0x13becb=_0x35e786?0x0:_0x2262de[_0x0498('0x18')];var _0x29f2ae=_0x35e786?_0x3942d4[_0x0498('0x19')]:_0x2262de[_0x0498('0x18')]+_0x2262de[_0x0498('0x16')];var _0x17873b;if(_0x29f2ae>=_0x2f6ba5){_0x29f2ae=_0x2f6ba5;_0x17873b=0xc8;}else{_0x17873b=0xce;}_0x1ccc14['status'](_0x17873b);return _0x1ccc14[_0x0498('0x1a')](_0x0498('0x1b'),_0x13becb+'-'+_0x29f2ae+'/'+_0x2f6ba5)[_0x0498('0x1c')](_0x3942d4);}return null;};}function saveUpdates(_0x3ed3eb){return function(_0x1493eb){if(_0x1493eb){return _0x1493eb['update'](_0x3ed3eb)['then'](function(_0x3f4ae4){return _0x3f4ae4;});}return null;};}function removeEntity(_0x33ee88){return function(_0x1d6f80){if(_0x1d6f80){return _0x1d6f80['destroy']()['then'](function(){_0x33ee88[_0x0498('0x15')](0xcc)[_0x0498('0x1d')]();});}};}function handleEntityNotFound(_0xe268da){return function(_0x34c6c1){if(!_0x34c6c1){_0xe268da[_0x0498('0x1e')](0x194);}return _0x34c6c1;};}function handleError(_0x5a4c3f,_0x84bd91){_0x84bd91=_0x84bd91||0x1f4;return function(_0x4ac096){logger[_0x0498('0x10')](_0x4ac096['stack']);if(_0x4ac096['name']){delete _0x4ac096[_0x0498('0x1f')];}_0x5a4c3f[_0x0498('0x15')](_0x84bd91)[_0x0498('0x20')](_0x4ac096);};}exports[_0x0498('0x21')]=function(_0x12e6be,_0x13232c){var _0xbc917e={},_0x4e3464={},_0x19a579={'count':0x0,'rows':[]};var _0x2d6517=_[_0x0498('0x22')](db[_0x0498('0x23')][_0x0498('0x24')],function(_0x5d5413){return{'name':_0x5d5413['fieldName'],'type':_0x5d5413[_0x0498('0x25')][_0x0498('0x26')]};});_0x4e3464[_0x0498('0x27')]=_[_0x0498('0x22')](_0x2d6517,_0x0498('0x1f'));_0x4e3464[_0x0498('0x28')]=_[_0x0498('0x29')](_0x12e6be[_0x0498('0x28')]);_0x4e3464[_0x0498('0x2a')]=_[_0x0498('0x2b')](_0x4e3464['model'],_0x4e3464[_0x0498('0x28')]);_0xbc917e[_0x0498('0x2c')]=_[_0x0498('0x2b')](_0x4e3464[_0x0498('0x27')],qs[_0x0498('0x2d')](_0x12e6be[_0x0498('0x28')][_0x0498('0x2d')]));_0xbc917e['attributes']=_0xbc917e[_0x0498('0x2c')][_0x0498('0x2e')]?_0xbc917e['attributes']:_0x4e3464['model'];if(!_0x12e6be[_0x0498('0x28')][_0x0498('0x2f')](_0x0498('0x30'))){_0xbc917e[_0x0498('0x16')]=qs[_0x0498('0x16')](_0x12e6be['query'][_0x0498('0x16')]);_0xbc917e[_0x0498('0x18')]=qs[_0x0498('0x18')](_0x12e6be[_0x0498('0x28')][_0x0498('0x18')]);}_0xbc917e['order']=qs[_0x0498('0x31')](_0x12e6be[_0x0498('0x28')][_0x0498('0x31')]);_0xbc917e['where']=qs[_0x0498('0x2a')](_[_0x0498('0x32')](_0x12e6be[_0x0498('0x28')],_0x4e3464[_0x0498('0x2a')]),_0x2d6517);if(_0x12e6be['query'][_0x0498('0x33')]){_0xbc917e[_0x0498('0x34')]=_[_0x0498('0x35')](_0xbc917e[_0x0498('0x34')],{'$or':_[_0x0498('0x22')](_0x2d6517,function(_0x1f6f3e){if(_0x1f6f3e[_0x0498('0x25')]!==_0x0498('0x36')){var _0x4ed605={};_0x4ed605[_0x1f6f3e[_0x0498('0x1f')]]={'$like':'%'+_0x12e6be[_0x0498('0x28')][_0x0498('0x33')]+'%'};return _0x4ed605;}})});}_0xbc917e=_[_0x0498('0x35')]({},_0xbc917e,_0x12e6be[_0x0498('0x37')]);var _0x47cd15={'where':_0xbc917e[_0x0498('0x34')]};return db[_0x0498('0x23')][_0x0498('0x19')](_0x47cd15)[_0x0498('0xa')](function(_0x541869){_0x19a579[_0x0498('0x19')]=_0x541869;if(_0x12e6be['query']['includeAll']){_0xbc917e['include']=[{'all':!![]}];}return db[_0x0498('0x23')][_0x0498('0x38')](_0xbc917e);})[_0x0498('0xa')](function(_0x553216){_0x19a579[_0x0498('0x39')]=_0x553216;return _0x19a579;})[_0x0498('0xa')](respondWithFilteredResult(_0x13232c,_0xbc917e))[_0x0498('0x14')](handleError(_0x13232c,null));};exports[_0x0498('0x3a')]=function(_0x1145a7,_0xebae8c){var _0xdbf8e2={'raw':!![],'where':{'id':_0x1145a7['params']['id']}},_0x33483a={};_0x33483a['model']=_[_0x0498('0x29')](db[_0x0498('0x23')][_0x0498('0x24')]);_0x33483a[_0x0498('0x28')]=_['keys'](_0x1145a7['query']);_0x33483a[_0x0498('0x2a')]=_[_0x0498('0x2b')](_0x33483a[_0x0498('0x27')],_0x33483a['query']);_0xdbf8e2['attributes']=_['intersection'](_0x33483a[_0x0498('0x27')],qs[_0x0498('0x2d')](_0x1145a7[_0x0498('0x28')]['fields']));_0xdbf8e2['attributes']=_0xdbf8e2[_0x0498('0x2c')][_0x0498('0x2e')]?_0xdbf8e2['attributes']:_0x33483a[_0x0498('0x27')];if(_0x1145a7[_0x0498('0x28')][_0x0498('0x3b')]){_0xdbf8e2[_0x0498('0x3c')]=[{'all':!![]}];}_0xdbf8e2=_['merge']({},_0xdbf8e2,_0x1145a7['options']);return db[_0x0498('0x23')][_0x0498('0x3d')](_0xdbf8e2)[_0x0498('0xa')](handleEntityNotFound(_0xebae8c,null))[_0x0498('0xa')](respondWithResult(_0xebae8c,null))[_0x0498('0x14')](handleError(_0xebae8c,null));};exports['create']=function(_0x31eed1,_0x5289bf){var _0x12d425;return db[_0x0498('0x23')][_0x0498('0x3e')](_0x31eed1['body'],{'raw':!![]})['then'](function(_0x13306b){_0x12d425=_0x13306b;return db[_0x0498('0x23')][_0x0498('0x38')]({'where':{'type':_0x31eed1[_0x0498('0x3f')][_0x0498('0x25')]},'raw':!![]});})['then'](function(_0x187d78){if(_0x12d425[_0x0498('0x25')][_0x0498('0x40')]()=='STUN'){var _0x3e3b75=fs['readFileSync'](path[_0x0498('0x41')](config[_0x0498('0x42')],_0x0498('0x43')),_0x0498('0x44'));var _0x12221a=ejs[_0x0498('0x45')](_0x3e3b75,{'networks':_0x187d78||[]});fs['writeFileSync'](_0x0498('0x46'),_0x12221a);return respondWithRpcPromise(_0x0498('0x47'),_0x0498('0x3e'),{'module':_0x0498('0x48')});}else if(_0x12d425[_0x0498('0x25')][_0x0498('0x40')]()==_0x0498('0x49')){var _0x165137=fs[_0x0498('0x4a')](path['join'](config[_0x0498('0x42')],_0x0498('0x4b')),_0x0498('0x44'));var _0x57ce95=ejs[_0x0498('0x45')](_0x165137,{'networks':_0x187d78||[]});fs[_0x0498('0x4c')](_0x0498('0x4d'),_0x57ce95);return respondWithRpcPromise('Reload',_0x0498('0x3e'),{'module':'res_stun_monitor.so'});}else{var _0x3a0e68=fs[_0x0498('0x4a')](path['join'](config[_0x0498('0x42')],_0x0498('0x4e')),_0x0498('0x44'));var _0x788a5e=ejs[_0x0498('0x45')](_0x3a0e68,{'networks':_0x187d78||[]});fs[_0x0498('0x4c')](util[_0x0498('0x4f')](_0x0498('0x50'),_0x31eed1[_0x0498('0x3f')][_0x0498('0x25')]['toLowerCase']()),_0x788a5e);return respondWithRpcPromise('Reload',_0x0498('0x3e'),{'module':_0x0498('0x51')});}})[_0x0498('0xa')](function(){return _0x12d425;})['then'](respondWithResult(_0x5289bf,0xc9))[_0x0498('0x14')](handleError(_0x5289bf,null));};exports['update']=function(_0x45d32b,_0x55ee5f){var _0x3a0e9d;return db[_0x0498('0x23')][_0x0498('0x3d')]({'where':{'id':_0x45d32b['params']['id']}})[_0x0498('0xa')](handleEntityNotFound(_0x55ee5f,null))[_0x0498('0xa')](saveUpdates(_0x45d32b['body'],null))[_0x0498('0xa')](function(_0x5add79){if(_0x5add79){_0x3a0e9d=_0x5add79;return db[_0x0498('0x23')][_0x0498('0x38')]({'where':{'type':_0x3a0e9d[_0x0498('0x25')]},'raw':!![]});}return null;})[_0x0498('0xa')](function(_0x3396b6){if(_0x3a0e9d[_0x0498('0x25')][_0x0498('0x40')]()==_0x0498('0x52')){var _0x217ac8=fs[_0x0498('0x4a')](path['join'](config[_0x0498('0x42')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0xd04be2=ejs['render'](_0x217ac8,{'networks':_0x3396b6||[]});fs[_0x0498('0x4c')](_0x0498('0x46'),_0xd04be2);return respondWithRpcPromise(_0x0498('0x47'),'update',{'module':'res_stun_monitor.so'});}else if(_0x3a0e9d[_0x0498('0x25')]['toUpperCase']()==_0x0498('0x49')){var _0x3eefe0=fs['readFileSync'](path['join'](config['root'],'server/files/templates/turn_multiple.ejs'),_0x0498('0x44'));var _0x1da10d=ejs['render'](_0x3eefe0,{'networks':_0x3396b6||[]});fs['writeFileSync'](_0x0498('0x4d'),_0x1da10d);return respondWithRpcPromise(_0x0498('0x47'),'update',{'module':_0x0498('0x48')});}else{var _0x4ea630=fs[_0x0498('0x4a')](path['join'](config[_0x0498('0x42')],_0x0498('0x4e')),_0x0498('0x44'));var _0x518a4e=ejs[_0x0498('0x45')](_0x4ea630,{'networks':_0x3396b6||[]});fs['writeFileSync'](util[_0x0498('0x4f')]('/etc/asterisk/sip_xcally_%s.conf',_0x45d32b['body'][_0x0498('0x25')][_0x0498('0x53')]()),_0x518a4e);return respondWithRpcPromise(_0x0498('0x47'),_0x0498('0x54'),{'module':_0x0498('0x51')});}})[_0x0498('0xa')](function(_0xd24707){if(_0xd24707){return _0x3a0e9d;}return null;})[_0x0498('0xa')](respondWithResult(_0x55ee5f,null))['catch'](handleError(_0x55ee5f,null));};exports['destroy']=function(_0x2e1a51,_0x3832b8){var _0x83b3db;return db['Network'][_0x0498('0x3d')]({'where':{'id':_0x2e1a51[_0x0498('0x55')]['id']}})[_0x0498('0xa')](function(_0x4251fe){_0x83b3db=_0x4251fe;return _0x4251fe;})['then'](handleEntityNotFound(_0x3832b8,null))[_0x0498('0xa')](removeEntity(_0x3832b8,null))['then'](function(){if(_0x83b3db){return db[_0x0498('0x23')][_0x0498('0x38')]({'where':{'type':_0x83b3db['type']},'raw':!![]});}})['then'](function(_0x3eaa91){if(_0x83b3db[_0x0498('0x25')][_0x0498('0x40')]()==_0x0498('0x52')){var _0x590b1f=fs[_0x0498('0x4a')](path[_0x0498('0x41')](config[_0x0498('0x42')],_0x0498('0x43')),_0x0498('0x44'));var _0x4d76ca=ejs['render'](_0x590b1f,{'networks':_0x3eaa91||[]});fs[_0x0498('0x4c')]('/etc/asterisk/stun_xcally.conf',_0x4d76ca);return respondWithRpcPromise(_0x0498('0x47'),_0x0498('0x56'),{'module':_0x0498('0x48')});}else if(_0x83b3db[_0x0498('0x25')][_0x0498('0x40')]()==_0x0498('0x49')){var _0x2bef97=fs[_0x0498('0x4a')](path[_0x0498('0x41')](config[_0x0498('0x42')],_0x0498('0x4b')),'utf8');var _0x4c062f=ejs[_0x0498('0x45')](_0x2bef97,{'networks':_0x3eaa91||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x4c062f);return respondWithRpcPromise(_0x0498('0x47'),_0x0498('0x56'),{'module':_0x0498('0x48')});}else{var _0x47cfe3=fs[_0x0498('0x4a')](path[_0x0498('0x41')](config['root'],_0x0498('0x4e')),_0x0498('0x44'));var _0x54006b=ejs[_0x0498('0x45')](_0x47cfe3,{'networks':_0x3eaa91||[]});fs['writeFileSync'](util['format'](_0x0498('0x50'),_0x83b3db[_0x0498('0x25')]['toLowerCase']()),_0x54006b);return respondWithRpcPromise(_0x0498('0x47'),_0x0498('0x56'),{'module':'chan_sip.so'});}})[_0x0498('0x14')](handleError(_0x3832b8,null));}; \ No newline at end of file +var _0x6624=['limit','sort','where','pick','filter','merge','VIRTUAL','options','Network','include','rows','params','includeAll','find','create','body','toUpperCase','readFileSync','join','root','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','utf8','writeFileSync','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','STUN','/etc/asterisk/turn_xcally.conf','format','toLowerCase','TURN','util','path','ejs','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','client','http','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','offset','undefined','count','status','set','Content-Range','json','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x3daa8c,_0x388a87){var _0x2b1bd7=function(_0xdb2963){while(--_0xdb2963){_0x3daa8c['push'](_0x3daa8c['shift']());}};_0x2b1bd7(++_0x388a87);}(_0x6624,0xcd));var _0x4662=function(_0x260ed9,_0x18152f){_0x260ed9=_0x260ed9-0x0;var _0x47b0b0=_0x6624[_0x260ed9];return _0x47b0b0;};'use strict';var util=require(_0x4662('0x0'));var path=require(_0x4662('0x1'));var ejs=require(_0x4662('0x2'));var fs=require('fs');var _=require('lodash');var qs=require(_0x4662('0x3'));var logger=require(_0x4662('0x4'))(_0x4662('0x5'));var config=require(_0x4662('0x6'));var db=require(_0x4662('0x7'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x4662('0x8')][_0x4662('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bdfeb,_0x257aaf,_0x58ace7,_0x378002){return new Promise(function(_0x2020c4,_0x52f37f){var _0x1db79e=_0x378002||client;return _0x1db79e['request'](_0x3bdfeb,_0x58ace7)['then'](function(_0x46ac55){logger[_0x4662('0xa')](_0x4662('0xb'),_0x257aaf,'request\x20sent');logger[_0x4662('0xc')](_0x4662('0xd'),_0x257aaf,_0x4662('0xe'),JSON[_0x4662('0xf')](_0x46ac55));if(_0x46ac55['error']){if(_0x46ac55[_0x4662('0x10')][_0x4662('0x11')]===0x1f4){logger[_0x4662('0x10')](_0x4662('0xb'),_0x257aaf,_0x46ac55[_0x4662('0x10')][_0x4662('0x12')]);return _0x52f37f(_0x46ac55[_0x4662('0x10')][_0x4662('0x12')]);}logger[_0x4662('0x10')](_0x4662('0xb'),_0x257aaf,_0x46ac55[_0x4662('0x10')]['message']);return _0x2020c4(_0x46ac55[_0x4662('0x10')]['message']);}else{logger[_0x4662('0xa')](_0x4662('0xb'),_0x257aaf,_0x4662('0xe'));_0x2020c4(_0x46ac55[_0x4662('0x13')][_0x4662('0x12')]);}})[_0x4662('0x14')](function(_0xd861b1){logger[_0x4662('0x10')]('Network,\x20%s,\x20%s',_0x257aaf,_0xd861b1);_0x52f37f(_0xd861b1);});});}function respondWithResult(_0x3ba172,_0x371946){_0x371946=_0x371946||0xc8;return function(_0x207b3d){if(_0x207b3d){return _0x3ba172['status'](_0x371946)['json'](_0x207b3d);}};}function respondWithFilteredResult(_0xb107d,_0x3aa30a){return function(_0x57d49c){if(_0x57d49c){var _0x3a7e76=typeof _0x3aa30a[_0x4662('0x15')]===_0x4662('0x16')&&typeof _0x3aa30a['limit']===_0x4662('0x16');var _0x7e8743=_0x57d49c[_0x4662('0x17')];var _0x28692d=_0x3a7e76?0x0:_0x3aa30a[_0x4662('0x15')];var _0x304824=_0x3a7e76?_0x57d49c[_0x4662('0x17')]:_0x3aa30a['offset']+_0x3aa30a['limit'];var _0x384869;if(_0x304824>=_0x7e8743){_0x304824=_0x7e8743;_0x384869=0xc8;}else{_0x384869=0xce;}_0xb107d[_0x4662('0x18')](_0x384869);return _0xb107d[_0x4662('0x19')](_0x4662('0x1a'),_0x28692d+'-'+_0x304824+'/'+_0x7e8743)[_0x4662('0x1b')](_0x57d49c);}return null;};}function saveUpdates(_0x36de99){return function(_0x38da25){if(_0x38da25){return _0x38da25[_0x4662('0x1c')](_0x36de99)[_0x4662('0x1d')](function(_0x518f4e){return _0x518f4e;});}return null;};}function removeEntity(_0x310fbc){return function(_0x3bd75c){if(_0x3bd75c){return _0x3bd75c[_0x4662('0x1e')]()[_0x4662('0x1d')](function(){_0x310fbc[_0x4662('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53c6cf){return function(_0xfb73b1){if(!_0xfb73b1){_0x53c6cf['sendStatus'](0x194);}return _0xfb73b1;};}function handleError(_0x341f1c,_0x4f19d3){_0x4f19d3=_0x4f19d3||0x1f4;return function(_0x203d2c){logger[_0x4662('0x10')](_0x203d2c[_0x4662('0x1f')]);if(_0x203d2c[_0x4662('0x20')]){delete _0x203d2c['name'];}_0x341f1c[_0x4662('0x18')](_0x4f19d3)[_0x4662('0x21')](_0x203d2c);};}exports[_0x4662('0x22')]=function(_0x427dc0,_0x5b88f4){var _0x468ffc={},_0x4af663={},_0x4e3c4a={'count':0x0,'rows':[]};var _0x5bad13=_[_0x4662('0x23')](db['Network'][_0x4662('0x24')],function(_0x24ee41){return{'name':_0x24ee41[_0x4662('0x25')],'type':_0x24ee41[_0x4662('0x26')][_0x4662('0x27')]};});_0x4af663['model']=_[_0x4662('0x23')](_0x5bad13,_0x4662('0x20'));_0x4af663[_0x4662('0x28')]=_[_0x4662('0x29')](_0x427dc0[_0x4662('0x28')]);_0x4af663[_0x4662('0x2a')]=_[_0x4662('0x2b')](_0x4af663['model'],_0x4af663[_0x4662('0x28')]);_0x468ffc['attributes']=_[_0x4662('0x2b')](_0x4af663[_0x4662('0x2c')],qs[_0x4662('0x2d')](_0x427dc0[_0x4662('0x28')]['fields']));_0x468ffc[_0x4662('0x2e')]=_0x468ffc[_0x4662('0x2e')][_0x4662('0x2f')]?_0x468ffc[_0x4662('0x2e')]:_0x4af663[_0x4662('0x2c')];if(!_0x427dc0[_0x4662('0x28')][_0x4662('0x30')](_0x4662('0x31'))){_0x468ffc[_0x4662('0x32')]=qs[_0x4662('0x32')](_0x427dc0[_0x4662('0x28')]['limit']);_0x468ffc[_0x4662('0x15')]=qs[_0x4662('0x15')](_0x427dc0[_0x4662('0x28')][_0x4662('0x15')]);}_0x468ffc['order']=qs[_0x4662('0x33')](_0x427dc0[_0x4662('0x28')]['sort']);_0x468ffc[_0x4662('0x34')]=qs['filters'](_[_0x4662('0x35')](_0x427dc0[_0x4662('0x28')],_0x4af663[_0x4662('0x2a')]),_0x5bad13);if(_0x427dc0['query'][_0x4662('0x36')]){_0x468ffc['where']=_[_0x4662('0x37')](_0x468ffc[_0x4662('0x34')],{'$or':_['map'](_0x5bad13,function(_0x4b6040){if(_0x4b6040[_0x4662('0x26')]!==_0x4662('0x38')){var _0x29e34f={};_0x29e34f[_0x4b6040[_0x4662('0x20')]]={'$like':'%'+_0x427dc0[_0x4662('0x28')]['filter']+'%'};return _0x29e34f;}})});}_0x468ffc=_[_0x4662('0x37')]({},_0x468ffc,_0x427dc0[_0x4662('0x39')]);var _0xc53510={'where':_0x468ffc['where']};return db[_0x4662('0x3a')][_0x4662('0x17')](_0xc53510)['then'](function(_0x470d59){_0x4e3c4a['count']=_0x470d59;if(_0x427dc0[_0x4662('0x28')]['includeAll']){_0x468ffc[_0x4662('0x3b')]=[{'all':!![]}];}return db['Network']['findAll'](_0x468ffc);})[_0x4662('0x1d')](function(_0x2ffd45){_0x4e3c4a[_0x4662('0x3c')]=_0x2ffd45;return _0x4e3c4a;})['then'](respondWithFilteredResult(_0x5b88f4,_0x468ffc))['catch'](handleError(_0x5b88f4,null));};exports['show']=function(_0x145b18,_0x4c1933){var _0x20a849={'raw':!![],'where':{'id':_0x145b18[_0x4662('0x3d')]['id']}},_0x3fb5ed={};_0x3fb5ed['model']=_[_0x4662('0x29')](db[_0x4662('0x3a')][_0x4662('0x24')]);_0x3fb5ed[_0x4662('0x28')]=_['keys'](_0x145b18['query']);_0x3fb5ed[_0x4662('0x2a')]=_[_0x4662('0x2b')](_0x3fb5ed[_0x4662('0x2c')],_0x3fb5ed['query']);_0x20a849[_0x4662('0x2e')]=_['intersection'](_0x3fb5ed['model'],qs['fields'](_0x145b18[_0x4662('0x28')]['fields']));_0x20a849[_0x4662('0x2e')]=_0x20a849['attributes'][_0x4662('0x2f')]?_0x20a849[_0x4662('0x2e')]:_0x3fb5ed[_0x4662('0x2c')];if(_0x145b18[_0x4662('0x28')][_0x4662('0x3e')]){_0x20a849[_0x4662('0x3b')]=[{'all':!![]}];}_0x20a849=_[_0x4662('0x37')]({},_0x20a849,_0x145b18['options']);return db['Network'][_0x4662('0x3f')](_0x20a849)[_0x4662('0x1d')](handleEntityNotFound(_0x4c1933,null))[_0x4662('0x1d')](respondWithResult(_0x4c1933,null))['catch'](handleError(_0x4c1933,null));};exports['create']=function(_0x4c13ed,_0x151e79){var _0x27fb40;return db['Network'][_0x4662('0x40')](_0x4c13ed[_0x4662('0x41')],{'raw':!![]})[_0x4662('0x1d')](function(_0xe179c1){_0x27fb40=_0xe179c1;return db['Network']['findAll']({'where':{'type':_0x4c13ed[_0x4662('0x41')]['type']},'raw':!![]});})['then'](function(_0x5ecb8b){if(_0x27fb40[_0x4662('0x26')][_0x4662('0x42')]()=='STUN'){var _0x522e5f=fs[_0x4662('0x43')](path[_0x4662('0x44')](config[_0x4662('0x45')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x19d992=ejs[_0x4662('0x46')](_0x522e5f,{'networks':_0x5ecb8b||[]});fs['writeFileSync'](_0x4662('0x47'),_0x19d992);return respondWithRpcPromise(_0x4662('0x48'),_0x4662('0x40'),{'module':_0x4662('0x49')});}else if(_0x27fb40[_0x4662('0x26')]['toUpperCase']()=='TURN'){var _0x1d78d7=fs[_0x4662('0x43')](path[_0x4662('0x44')](config['root'],_0x4662('0x4a')),_0x4662('0x4b'));var _0x81cfc8=ejs[_0x4662('0x46')](_0x1d78d7,{'networks':_0x5ecb8b||[]});fs[_0x4662('0x4c')]('/etc/asterisk/turn_xcally.conf',_0x81cfc8);return respondWithRpcPromise('Reload','create',{'module':_0x4662('0x49')});}else{var _0x46a54e=fs[_0x4662('0x43')](path['join'](config[_0x4662('0x45')],_0x4662('0x4d')),_0x4662('0x4b'));var _0x27944a=ejs['render'](_0x46a54e,{'networks':_0x5ecb8b||[]});fs['writeFileSync'](util['format'](_0x4662('0x4e'),_0x4c13ed[_0x4662('0x41')][_0x4662('0x26')]['toLowerCase']()),_0x27944a);return respondWithRpcPromise(_0x4662('0x48'),_0x4662('0x40'),{'module':_0x4662('0x4f')});}})[_0x4662('0x1d')](function(){return _0x27fb40;})[_0x4662('0x1d')](respondWithResult(_0x151e79,0xc9))[_0x4662('0x14')](handleError(_0x151e79,null));};exports[_0x4662('0x1c')]=function(_0x4e3aeb,_0x317ef0){var _0x2e7bb9;return db[_0x4662('0x3a')][_0x4662('0x3f')]({'where':{'id':_0x4e3aeb[_0x4662('0x3d')]['id']}})[_0x4662('0x1d')](handleEntityNotFound(_0x317ef0,null))[_0x4662('0x1d')](saveUpdates(_0x4e3aeb['body'],null))[_0x4662('0x1d')](function(_0x5b4f79){if(_0x5b4f79){_0x2e7bb9=_0x5b4f79;return db['Network']['findAll']({'where':{'type':_0x2e7bb9['type']},'raw':!![]});}return null;})[_0x4662('0x1d')](function(_0x56120d){if(_0x2e7bb9[_0x4662('0x26')][_0x4662('0x42')]()==_0x4662('0x50')){var _0x595841=fs[_0x4662('0x43')](path[_0x4662('0x44')](config[_0x4662('0x45')],'server/files/templates/stun_multiple.ejs'),_0x4662('0x4b'));var _0x1a35bf=ejs[_0x4662('0x46')](_0x595841,{'networks':_0x56120d||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x1a35bf);return respondWithRpcPromise(_0x4662('0x48'),_0x4662('0x1c'),{'module':_0x4662('0x49')});}else if(_0x2e7bb9['type'][_0x4662('0x42')]()=='TURN'){var _0x2405a2=fs[_0x4662('0x43')](path[_0x4662('0x44')](config[_0x4662('0x45')],_0x4662('0x4a')),_0x4662('0x4b'));var _0x5dc2f5=ejs[_0x4662('0x46')](_0x2405a2,{'networks':_0x56120d||[]});fs[_0x4662('0x4c')](_0x4662('0x51'),_0x5dc2f5);return respondWithRpcPromise(_0x4662('0x48'),_0x4662('0x1c'),{'module':_0x4662('0x49')});}else{var _0x32dd77=fs[_0x4662('0x43')](path['join'](config[_0x4662('0x45')],'server/files/templates/network.ejs'),'utf8');var _0xab92dc=ejs[_0x4662('0x46')](_0x32dd77,{'networks':_0x56120d||[]});fs[_0x4662('0x4c')](util[_0x4662('0x52')]('/etc/asterisk/sip_xcally_%s.conf',_0x4e3aeb['body']['type'][_0x4662('0x53')]()),_0xab92dc);return respondWithRpcPromise(_0x4662('0x48'),_0x4662('0x1c'),{'module':_0x4662('0x4f')});}})[_0x4662('0x1d')](function(_0x421564){if(_0x421564){return _0x2e7bb9;}return null;})[_0x4662('0x1d')](respondWithResult(_0x317ef0,null))[_0x4662('0x14')](handleError(_0x317ef0,null));};exports[_0x4662('0x1e')]=function(_0x2fcac7,_0xe1ead5){var _0x5c5280;return db[_0x4662('0x3a')][_0x4662('0x3f')]({'where':{'id':_0x2fcac7[_0x4662('0x3d')]['id']}})[_0x4662('0x1d')](function(_0x34eddd){_0x5c5280=_0x34eddd;return _0x34eddd;})[_0x4662('0x1d')](handleEntityNotFound(_0xe1ead5,null))[_0x4662('0x1d')](removeEntity(_0xe1ead5,null))[_0x4662('0x1d')](function(){if(_0x5c5280){return db[_0x4662('0x3a')]['findAll']({'where':{'type':_0x5c5280[_0x4662('0x26')]},'raw':!![]});}})['then'](function(_0x2f81d2){if(_0x5c5280['type']['toUpperCase']()==_0x4662('0x50')){var _0x21e024=fs[_0x4662('0x43')](path[_0x4662('0x44')](config[_0x4662('0x45')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x2be63e=ejs['render'](_0x21e024,{'networks':_0x2f81d2||[]});fs[_0x4662('0x4c')](_0x4662('0x47'),_0x2be63e);return respondWithRpcPromise('Reload',_0x4662('0x1e'),{'module':_0x4662('0x49')});}else if(_0x5c5280[_0x4662('0x26')]['toUpperCase']()==_0x4662('0x54')){var _0x158dcb=fs[_0x4662('0x43')](path['join'](config[_0x4662('0x45')],_0x4662('0x4a')),_0x4662('0x4b'));var _0x4c78dd=ejs[_0x4662('0x46')](_0x158dcb,{'networks':_0x2f81d2||[]});fs[_0x4662('0x4c')](_0x4662('0x51'),_0x4c78dd);return respondWithRpcPromise(_0x4662('0x48'),_0x4662('0x1e'),{'module':'res_stun_monitor.so'});}else{var _0x5ea21c=fs['readFileSync'](path[_0x4662('0x44')](config[_0x4662('0x45')],'server/files/templates/network.ejs'),_0x4662('0x4b'));var _0x44ace3=ejs['render'](_0x5ea21c,{'networks':_0x2f81d2||[]});fs[_0x4662('0x4c')](util[_0x4662('0x52')](_0x4662('0x4e'),_0x5c5280['type'][_0x4662('0x53')]()),_0x44ace3);return respondWithRpcPromise(_0x4662('0x48'),_0x4662('0x1e'),{'module':_0x4662('0x4f')});}})[_0x4662('0x14')](handleError(_0xe1ead5,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 1a3a201..f3c7249 100644 --- a/server/api/network/network.model.js +++ b/server/api/network/network.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb28a=['moment','rimraf','../../config/environment','./network.attributes','exports','define','Network','util','../../config/logger'];(function(_0x497d39,_0x2fef30){var _0x4a9d8f=function(_0x98eaa4){while(--_0x98eaa4){_0x497d39['push'](_0x497d39['shift']());}};_0x4a9d8f(++_0x2fef30);}(_0xb28a,0x166));var _0xab28=function(_0x50af94,_0x2af691){_0x50af94=_0x50af94-0x0;var _0x2c54a0=_0xb28a[_0x50af94];return _0x2c54a0;};'use strict';var _=require('lodash');var util=require(_0xab28('0x0'));var logger=require(_0xab28('0x1'))('api');var moment=require(_0xab28('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xab28('0x3'));var config=require(_0xab28('0x4'));var attributes=require(_0xab28('0x5'));module[_0xab28('0x6')]=function(_0x133169,_0x128a13){return _0x133169[_0xab28('0x7')](_0xab28('0x8'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6953=['../../config/environment','exports','define','Network','network','lodash','util','bluebird','path','rimraf'];(function(_0x25c506,_0x190e68){var _0xef74dd=function(_0x355a5e){while(--_0x355a5e){_0x25c506['push'](_0x25c506['shift']());}};_0xef74dd(++_0x190e68);}(_0x6953,0x91));var _0x3695=function(_0x2d1018,_0x2f6a78){_0x2d1018=_0x2d1018-0x0;var _0x553d19=_0x6953[_0x2d1018];return _0x553d19;};'use strict';var _=require(_0x3695('0x0'));var util=require(_0x3695('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3695('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3695('0x3'));var rimraf=require(_0x3695('0x4'));var config=require(_0x3695('0x5'));var attributes=require('./network.attributes');module[_0x3695('0x6')]=function(_0x558026,_0x2d7d98){return _0x558026[_0x3695('0x7')](_0x3695('0x8'),attributes,{'tableName':_0x3695('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 0df411b..c277da9 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5b2541,_0x207b8d){var _0x463431=function(_0x30d867){while(--_0x30d867){_0x5b2541['push'](_0x5b2541['shift']());}};_0x463431(++_0x207b8d);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x12450f,_0x3d6a49){_0x12450f=_0x12450f-0x0;var _0xd32aa=_0x7a54[_0x12450f];return _0xd32aa;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index bbd700a..d0a0bf9 100644 --- a/server/api/openchannelAccount/index.js +++ b/server/api/openchannelAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','addAgents','/:id/send','put','update','delete','destroy','removeDispositions','removeAnswers','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x3e169e,_0x2f983f){var _0x5587ff=function(_0x2100d1){while(--_0x2100d1){_0x3e169e['push'](_0x3e169e['shift']());}};_0x5587ff(++_0x2f983f);}(_0xadb5,0xad));var _0x5adb=function(_0xd55e8c,_0x3d37e2){_0xd55e8c=_0xd55e8c-0x0;var _0x320330=_0xadb5[_0xd55e8c];return _0x320330;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./openchannelAccount.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getDispositions']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['get'](_0x5adb('0x11'),auth['isAuthenticated'](),controller[_0x5adb('0x12')]);router['get'](_0x5adb('0x13'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);router['get'](_0x5adb('0x15'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x16')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x17')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x18')]);router[_0x5adb('0x17')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);router[_0x5adb('0x17')]('/:id/notify',controller[_0x5adb('0x1a')]);router['post'](_0x5adb('0x11'),auth['isAuthenticated'](),controller[_0x5adb('0x1b')]);router['post']('/:id/users',auth[_0x5adb('0x8')](),controller[_0x5adb('0x1c')]);router[_0x5adb('0x17')](_0x5adb('0x1d'),auth[_0x5adb('0x8')](),controller['send']);router[_0x5adb('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0x5adb('0x1f')]);router[_0x5adb('0x20')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x21')]);router[_0x5adb('0x20')](_0x5adb('0xe'),auth['isAuthenticated'](),controller[_0x5adb('0x22')]);router[_0x5adb('0x20')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x23')]);router['delete'](_0x5adb('0x15'),auth[_0x5adb('0x8')](),controller['removeAgents']);module[_0x5adb('0x24')]=router; \ No newline at end of file +var _0x2a07=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send','send','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller'];(function(_0x265191,_0x479156){var _0x3f8436=function(_0x49a46f){while(--_0x49a46f){_0x265191['push'](_0x265191['shift']());}};_0x3f8436(++_0x479156);}(_0x2a07,0x74));var _0x72a0=function(_0x3ed4d7,_0x3783e0){_0x3ed4d7=_0x3ed4d7-0x0;var _0x2be1a4=_0x2a07[_0x3ed4d7];return _0x2be1a4;};'use strict';var multer=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var timeout=require(_0x72a0('0x3'));var express=require(_0x72a0('0x4'));var router=express['Router']();var fs_extra=require(_0x72a0('0x5'));var auth=require(_0x72a0('0x6'));var interaction=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var controller=require(_0x72a0('0x9'));router[_0x72a0('0xa')]('/',auth[_0x72a0('0xb')](),controller[_0x72a0('0xc')]);router[_0x72a0('0xa')](_0x72a0('0xd'),auth[_0x72a0('0xb')](),controller[_0x72a0('0xe')]);router[_0x72a0('0xa')](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x10')]);router['get'](_0x72a0('0x11'),auth[_0x72a0('0xb')](),controller['getDispositions']);router[_0x72a0('0xa')](_0x72a0('0x12'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x13')]);router[_0x72a0('0xa')]('/:id/applications',auth[_0x72a0('0xb')](),controller[_0x72a0('0x14')]);router[_0x72a0('0xa')](_0x72a0('0x15'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x16')]);router[_0x72a0('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0x72a0('0x17')]);router[_0x72a0('0x18')]('/',auth[_0x72a0('0xb')](),controller[_0x72a0('0x19')]);router[_0x72a0('0x18')](_0x72a0('0x11'),auth['isAuthenticated'](),controller[_0x72a0('0x1a')]);router[_0x72a0('0x18')](_0x72a0('0x12'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x1b')]);router['post'](_0x72a0('0x1c'),controller[_0x72a0('0x1d')]);router[_0x72a0('0x18')]('/:id/applications',auth[_0x72a0('0xb')](),controller[_0x72a0('0x1e')]);router[_0x72a0('0x18')](_0x72a0('0x1f'),auth['isAuthenticated'](),controller[_0x72a0('0x20')]);router['post'](_0x72a0('0x21'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x22')]);router['put'](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x23')]);router[_0x72a0('0x24')]('/:id',auth[_0x72a0('0xb')](),controller[_0x72a0('0x25')]);router[_0x72a0('0x24')](_0x72a0('0x11'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x26')]);router['delete']('/:id/canned_answers',auth[_0x72a0('0xb')](),controller[_0x72a0('0x27')]);router[_0x72a0('0x24')](_0x72a0('0x1f'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x28')]);module[_0x72a0('0x29')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 0190eb9..368b28a 100644 --- a/server/api/openchannelAccount/openchannelAccount.attributes.js +++ b/server/api/openchannelAccount/openchannelAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a1d=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING','name','generate'];(function(_0x4236d8,_0x12a9ac){var _0x39a29b=function(_0x1575df){while(--_0x1575df){_0x4236d8['push'](_0x4236d8['shift']());}};_0x39a29b(++_0x12a9ac);}(_0x5a1d,0xe5));var _0xd5a1=function(_0x2832e2,_0x209a7a){_0x2832e2=_0x2832e2-0x0;var _0x5183f3=_0x5a1d[_0x2832e2];return _0x5183f3;};'use strict';var Sequelize=require(_0xd5a1('0x0'));var rs=require('randomstring');module[_0xd5a1('0x1')]={'name':{'type':Sequelize[_0xd5a1('0x2')],'unique':_0xd5a1('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xd5a1('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xd5a1('0x4')]();}},'replyUri':{'type':Sequelize[_0xd5a1('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xd5a1('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd5a1('0x5')],'defaultValue':function(){return _0xd5a1('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd5a1('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd5a1('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd5a1('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xd5a1('0x2')]},'queueTransfer':{'type':Sequelize[_0xd5a1('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd5a1('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd5a1('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd5a1('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xd5a1('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xd5a1('0x7')],'defaultValue':![],'comment':_0xd5a1('0xa'),'set':function(_0x2bdd33){if(!_0x2bdd33)this['setDataValue'](_0xd5a1('0xb'),null);this[_0xd5a1('0xc')]('mandatoryDisposition',_0x2bdd33);}}}; \ No newline at end of file +var _0x896d=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x214434,_0x3facc0){var _0x309f3b=function(_0x139657){while(--_0x139657){_0x214434['push'](_0x214434['shift']());}};_0x309f3b(++_0x3facc0);}(_0x896d,0x1d9));var _0xd896=function(_0x345f71,_0x3ecc55){_0x345f71=_0x345f71-0x0;var _0x268ce5=_0x896d[_0x345f71];return _0x268ce5;};'use strict';var Sequelize=require(_0xd896('0x0'));var rs=require(_0xd896('0x1'));module[_0xd896('0x2')]={'name':{'type':Sequelize[_0xd896('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xd896('0x3')],'defaultValue':function(){return rs[_0xd896('0x4')]();}},'replyUri':{'type':Sequelize[_0xd896('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xd896('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd896('0x5')],'defaultValue':function(){return _0xd896('0x6');}},'notificationSound':{'type':Sequelize[_0xd896('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd896('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd896('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd896('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xd896('0x3')]},'queueTransfer':{'type':Sequelize[_0xd896('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd896('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd896('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd896('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xd896('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd896('0xa'),'set':function(_0x4fea10){if(!_0x4fea10)this['setDataValue'](_0xd896('0xb'),null);this['setDataValue'](_0xd896('0xc'),_0x4fea10);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index ef2d615..0b85005 100644 --- a/server/api/openchannelAccount/openchannelAccount.controller.js +++ b/server/api/openchannelAccount/openchannelAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe740=['json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','end','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','body','user','role','get','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','length','removeDispositions','ids','CannedAnswer','removeAnswers','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','DESC','OpenchannelApplication','Applications','List','account','applications','orderBy','asc','Contacts','CmContact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','created','push','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','queueId','OpenchannelQueue','queue','startRouting','EventManager','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','getInteractions','Contact','User','Owner','Tag','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status'];(function(_0xcb9904,_0x3fa20c){var _0xf6d3d=function(_0x3c81aa){while(--_0x3c81aa){_0xcb9904['push'](_0xcb9904['shift']());}};_0xf6d3d(++_0x3fa20c);}(_0xe740,0x14b));var _0x0e74=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0xe740[_0x37a79c];return _0x561d89;};'use strict';var emlformat=require(_0x0e74('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e74('0x1'));var jsonpatch=require(_0x0e74('0x2'));var rp=require('request-promise');var moment=require(_0x0e74('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0e74('0x4'));var util=require('util');var path=require(_0x0e74('0x5'));var sox=require(_0x0e74('0x6'));var csv=require('to-csv');var ejs=require(_0x0e74('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e74('0x8'));var squel=require(_0x0e74('0x9'));var crypto=require(_0x0e74('0xa'));var jsforce=require(_0x0e74('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0e74('0xc'));var querystring=require(_0x0e74('0xd'));var Papa=require(_0x0e74('0xe'));var Redis=require(_0x0e74('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0e74('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e74('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x0e74('0x12'));var config=require(_0x0e74('0x13'));var licenseUtil=require(_0x0e74('0x14'));var db=require(_0x0e74('0x15'))['db'];config['redis']=_[_0x0e74('0x16')](config['redis'],{'host':_0x0e74('0x17'),'port':0x18eb});var socket=require(_0x0e74('0x18'))(new Redis(config[_0x0e74('0x19')]));require(_0x0e74('0x1a'))[_0x0e74('0x1b')](socket);var jayson=require(_0x0e74('0x1c'));var client=jayson[_0x0e74('0x1d')][_0x0e74('0x1e')]({'port':0x232c});var client9002=jayson[_0x0e74('0x1d')][_0x0e74('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1c9156,_0x205272,_0x2421a9,_0x5972a0){return new BPromise(function(_0x5a754e,_0x3c3c9c){var _0x472a49=_0x5972a0||client;return _0x472a49[_0x0e74('0x1f')](_0x1c9156,_0x2421a9)[_0x0e74('0x20')](function(_0x44c74e){logger[_0x0e74('0x21')](_0x0e74('0x22'),_0x205272,_0x0e74('0x23'));logger[_0x0e74('0x24')](_0x0e74('0x25'),_0x205272,_0x0e74('0x23'),JSON['stringify'](_0x44c74e));if(_0x44c74e[_0x0e74('0x26')]){if(_0x44c74e[_0x0e74('0x26')][_0x0e74('0x27')]===0x1f4){logger[_0x0e74('0x26')](_0x0e74('0x22'),_0x205272,_0x44c74e[_0x0e74('0x26')]['message']);return _0x3c3c9c(_0x44c74e[_0x0e74('0x26')][_0x0e74('0x28')]);}logger[_0x0e74('0x26')](_0x0e74('0x22'),_0x205272,_0x44c74e['error'][_0x0e74('0x28')]);return _0x5a754e(_0x44c74e[_0x0e74('0x26')][_0x0e74('0x28')]);}else{logger[_0x0e74('0x21')](_0x0e74('0x22'),_0x205272,_0x0e74('0x23'));_0x5a754e(_0x44c74e[_0x0e74('0x29')][_0x0e74('0x28')]);}})[_0x0e74('0x2a')](function(_0x12de91){logger[_0x0e74('0x26')](_0x0e74('0x22'),_0x205272,_0x12de91);_0x3c3c9c(_0x12de91);});});}function respondWithStatusCode(_0x37eb6f,_0x536143){_0x536143=_0x536143||0xcc;return function(_0x2709be){if(_0x2709be){return _0x37eb6f[_0x0e74('0x2b')](_0x536143);}return _0x37eb6f[_0x0e74('0x2c')](_0x536143)['end']();};}function respondWithResult(_0x9d1248,_0x24db44){_0x24db44=_0x24db44||0xc8;return function(_0x1e35e4){if(_0x1e35e4){return _0x9d1248[_0x0e74('0x2c')](_0x24db44)[_0x0e74('0x2d')](_0x1e35e4);}};}function respondWithFilteredResult(_0x4a895d,_0x100950){return function(_0x172870){if(_0x172870){var _0x18064a=typeof _0x100950[_0x0e74('0x2e')]==='undefined'&&typeof _0x100950[_0x0e74('0x2f')]===_0x0e74('0x30');var _0x58a822=_0x172870[_0x0e74('0x31')];var _0x4df6c1=_0x18064a?0x0:_0x100950[_0x0e74('0x2e')];var _0x1fe6af=_0x18064a?_0x172870['count']:_0x100950[_0x0e74('0x2e')]+_0x100950[_0x0e74('0x2f')];var _0xaac9a6;if(_0x1fe6af>=_0x58a822){_0x1fe6af=_0x58a822;_0xaac9a6=0xc8;}else{_0xaac9a6=0xce;}_0x4a895d[_0x0e74('0x2c')](_0xaac9a6);return _0x4a895d[_0x0e74('0x32')](_0x0e74('0x33'),_0x4df6c1+'-'+_0x1fe6af+'/'+_0x58a822)['json'](_0x172870);}return null;};}function patchUpdates(_0x49f341){return function(_0x36c055){try{jsonpatch[_0x0e74('0x34')](_0x36c055,_0x49f341,!![]);}catch(_0x47bd97){return BPromise['reject'](_0x47bd97);}return _0x36c055[_0x0e74('0x35')]();};}function saveUpdates(_0x51ddbe,_0x43a9e1){return function(_0x32c120){if(_0x32c120){return _0x32c120[_0x0e74('0x36')](_0x51ddbe)[_0x0e74('0x20')](function(_0x1f4ccd){return _0x1f4ccd;});}return null;};}function removeEntity(_0x4ce64c,_0x5b529c){return function(_0x24c55b){if(_0x24c55b){return _0x24c55b[_0x0e74('0x37')]()[_0x0e74('0x20')](function(){var _0x45f0b9=_0x24c55b['get']({'plain':!![]});var _0x3a8a58='OpenchannelAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x3a8a58,'resourceId':_0x45f0b9['id']}})['then'](function(){return _0x24c55b;});})[_0x0e74('0x20')](function(){_0x4ce64c[_0x0e74('0x2c')](0xcc)[_0x0e74('0x38')]();});}};}function handleEntityNotFound(_0x12cb2d,_0x345046){return function(_0xf8f525){if(!_0xf8f525){_0x12cb2d[_0x0e74('0x2b')](0x194);}return _0xf8f525;};}function handleError(_0x43a482,_0x3fc00c){_0x3fc00c=_0x3fc00c||0x1f4;return function(_0x533271){logger[_0x0e74('0x26')](_0x533271['stack']);if(_0x533271[_0x0e74('0x39')]){delete _0x533271[_0x0e74('0x39')];}_0x43a482[_0x0e74('0x2c')](_0x3fc00c)[_0x0e74('0x3a')](_0x533271);};}exports[_0x0e74('0x3b')]=function(_0x1d6c2d,_0x3b46da){var _0x42eab1={'include':[{'model':db[_0x0e74('0x3c')],'as':_0x0e74('0x3d')}]},_0xe7e4ad={},_0x4b446a={'count':0x0,'rows':[]};var _0x1e1dd2=_[_0x0e74('0x3e')](db[_0x0e74('0x3f')][_0x0e74('0x40')],function(_0xb1108e){return{'name':_0xb1108e[_0x0e74('0x41')],'type':_0xb1108e[_0x0e74('0x42')]['key']};});_0xe7e4ad['model']=_[_0x0e74('0x3e')](_0x1e1dd2,'name');_0xe7e4ad['query']=_[_0x0e74('0x43')](_0x1d6c2d[_0x0e74('0x44')]);_0xe7e4ad[_0x0e74('0x45')]=_[_0x0e74('0x46')](_0xe7e4ad[_0x0e74('0x47')],_0xe7e4ad[_0x0e74('0x44')]);_0x42eab1[_0x0e74('0x48')]=_['intersection'](_0xe7e4ad[_0x0e74('0x47')],qs['fields'](_0x1d6c2d[_0x0e74('0x44')][_0x0e74('0x49')]));_0x42eab1[_0x0e74('0x48')]=_0x42eab1['attributes']['length']?_0x42eab1['attributes']:_0xe7e4ad[_0x0e74('0x47')];if(!_0x1d6c2d[_0x0e74('0x44')][_0x0e74('0x4a')](_0x0e74('0x4b'))){_0x42eab1[_0x0e74('0x2f')]=qs[_0x0e74('0x2f')](_0x1d6c2d[_0x0e74('0x44')][_0x0e74('0x2f')]);_0x42eab1['offset']=qs['offset'](_0x1d6c2d['query'][_0x0e74('0x2e')]);}_0x42eab1[_0x0e74('0x4c')]=qs[_0x0e74('0x4d')](_0x1d6c2d[_0x0e74('0x44')][_0x0e74('0x4d')]);_0x42eab1[_0x0e74('0x4e')]=qs[_0x0e74('0x45')](_[_0x0e74('0x4f')](_0x1d6c2d[_0x0e74('0x44')],_0xe7e4ad['filters']),_0x1e1dd2);if(_0x1d6c2d[_0x0e74('0x44')][_0x0e74('0x50')]){_0x42eab1[_0x0e74('0x4e')]=_[_0x0e74('0x51')](_0x42eab1[_0x0e74('0x4e')],{'$or':_[_0x0e74('0x3e')](_0x1e1dd2,function(_0x1f6714){if(_0x1f6714[_0x0e74('0x42')]!==_0x0e74('0x52')){var _0x29b1ac={};_0x29b1ac[_0x1f6714['name']]={'$like':'%'+_0x1d6c2d['query'][_0x0e74('0x50')]+'%'};return _0x29b1ac;}})});}_0x42eab1=_[_0x0e74('0x51')]({},_0x42eab1,_0x1d6c2d[_0x0e74('0x53')]);var _0x4cfeff={'where':_0x42eab1[_0x0e74('0x4e')]};return db[_0x0e74('0x3f')][_0x0e74('0x31')](_0x4cfeff)[_0x0e74('0x20')](function(_0x4569cd){_0x4b446a[_0x0e74('0x31')]=_0x4569cd;if(_0x1d6c2d[_0x0e74('0x44')][_0x0e74('0x54')]){_0x42eab1[_0x0e74('0x55')]=[{'all':!![]}];}return db[_0x0e74('0x3f')][_0x0e74('0x56')](_0x42eab1);})['then'](function(_0x352735){_0x4b446a[_0x0e74('0x57')]=_0x352735;return _0x4b446a;})['then'](respondWithFilteredResult(_0x3b46da,_0x42eab1))[_0x0e74('0x2a')](handleError(_0x3b46da,null));};exports[_0x0e74('0x58')]=function(_0x1dd9e4,_0x704361){var _0x39cb75={'raw':![],'where':{'id':_0x1dd9e4['params']['id']},'include':[{'model':db['Pause'],'as':_0x0e74('0x3d')}]},_0x5d33a2={};_0x5d33a2[_0x0e74('0x47')]=_[_0x0e74('0x43')](db['OpenchannelAccount']['rawAttributes']);_0x5d33a2[_0x0e74('0x44')]=_[_0x0e74('0x43')](_0x1dd9e4['query']);_0x5d33a2['filters']=_[_0x0e74('0x46')](_0x5d33a2[_0x0e74('0x47')],_0x5d33a2['query']);_0x39cb75[_0x0e74('0x48')]=_[_0x0e74('0x46')](_0x5d33a2[_0x0e74('0x47')],qs[_0x0e74('0x49')](_0x1dd9e4['query'][_0x0e74('0x49')]));_0x39cb75[_0x0e74('0x48')]=_0x39cb75[_0x0e74('0x48')]['length']?_0x39cb75[_0x0e74('0x48')]:_0x5d33a2[_0x0e74('0x47')];if(_0x1dd9e4[_0x0e74('0x44')][_0x0e74('0x54')]){_0x39cb75[_0x0e74('0x55')]=[{'all':!![]}];}_0x39cb75=_[_0x0e74('0x51')]({},_0x39cb75,_0x1dd9e4[_0x0e74('0x53')]);return db[_0x0e74('0x3f')][_0x0e74('0x59')](_0x39cb75)[_0x0e74('0x20')](handleEntityNotFound(_0x704361,null))[_0x0e74('0x20')](respondWithResult(_0x704361,null))['catch'](handleError(_0x704361,null));};exports['create']=function(_0x254f04,_0x10b114){return db[_0x0e74('0x3f')]['create'](_0x254f04[_0x0e74('0x5a')],{})['then'](function(_0x3cc322){var _0xd45d19=_0x254f04[_0x0e74('0x5b')]['get']({'plain':!![]});if(!_0xd45d19)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd45d19[_0x0e74('0x5c')]===_0x0e74('0x5b')){var _0x4ba19f=_0x3cc322[_0x0e74('0x5d')]({'plain':!![]});var _0x247c00=_0x0e74('0x5e');return db[_0x0e74('0x5f')][_0x0e74('0x59')]({'where':{'name':_0x247c00,'userProfileId':_0xd45d19[_0x0e74('0x60')]},'raw':!![]})['then'](function(_0x5ebb97){if(_0x5ebb97&&_0x5ebb97[_0x0e74('0x61')]===0x0){return db['UserProfileResource'][_0x0e74('0x62')]({'name':_0x4ba19f[_0x0e74('0x39')],'resourceId':_0x4ba19f['id'],'type':_0x5ebb97['name'],'sectionId':_0x5ebb97['id']},{})[_0x0e74('0x20')](function(){return _0x3cc322;});}else{return _0x3cc322;}})[_0x0e74('0x2a')](function(_0x1e1b4){logger[_0x0e74('0x26')](_0x0e74('0x63'),_0x1e1b4);throw _0x1e1b4;});}return _0x3cc322;})[_0x0e74('0x20')](respondWithResult(_0x10b114,0xc9))[_0x0e74('0x2a')](handleError(_0x10b114,null));};exports[_0x0e74('0x36')]=function(_0x3cbaaf,_0x16a77e){if(_0x3cbaaf[_0x0e74('0x5a')]['id']){delete _0x3cbaaf['body']['id'];}return db[_0x0e74('0x3f')][_0x0e74('0x59')]({'where':{'id':_0x3cbaaf['params']['id']},'include':[{'model':db[_0x0e74('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x0e74('0x20')](handleEntityNotFound(_0x16a77e,null))[_0x0e74('0x20')](saveUpdates(_0x3cbaaf[_0x0e74('0x5a')],null))[_0x0e74('0x20')](respondWithResult(_0x16a77e,null))[_0x0e74('0x2a')](handleError(_0x16a77e,null));};exports[_0x0e74('0x37')]=function(_0x1fadfb,_0x4100dd){return db['OpenchannelAccount'][_0x0e74('0x59')]({'where':{'id':_0x1fadfb[_0x0e74('0x64')]['id']}})[_0x0e74('0x20')](handleEntityNotFound(_0x4100dd,null))['then'](removeEntity(_0x4100dd,null))[_0x0e74('0x2a')](handleError(_0x4100dd,null));};exports[_0x0e74('0x65')]=function(_0xffeddd,_0x52a295){return db[_0x0e74('0x3f')][_0x0e74('0x65')]()[_0x0e74('0x20')](respondWithResult(_0x52a295,null))[_0x0e74('0x2a')](handleError(_0x52a295,null));};exports[_0x0e74('0x66')]=function(_0x49ee10,_0x28d5a2,_0x2a8547){if(_0x49ee10[_0x0e74('0x5a')]['id']){delete _0x49ee10[_0x0e74('0x5a')]['id'];}return db['OpenchannelAccount'][_0x0e74('0x59')]({'where':{'id':_0x49ee10['params']['id']}})[_0x0e74('0x20')](handleEntityNotFound(_0x28d5a2,null))[_0x0e74('0x20')](function(_0x43cac4){if(_0x43cac4){_0x49ee10[_0x0e74('0x5a')][_0x0e74('0x67')]=_0x43cac4['id'];return db['Disposition'][_0x0e74('0x62')](_0x49ee10['body']);}})[_0x0e74('0x20')](respondWithResult(_0x28d5a2,null))[_0x0e74('0x2a')](handleError(_0x28d5a2,null));};exports[_0x0e74('0x68')]=function(_0x448643,_0x449163,_0x483ecf){var _0x95589a={'raw':![],'where':{}};var _0x4f4902={};var _0x1072f3={'count':0x0,'rows':[]};return db[_0x0e74('0x3f')][_0x0e74('0x69')]({'where':{'id':_0x448643[_0x0e74('0x64')]['id']}})[_0x0e74('0x20')](handleEntityNotFound(_0x449163,null))[_0x0e74('0x20')](function(_0x3ba09d){if(_0x3ba09d){_0x4f4902['model']=_[_0x0e74('0x43')](db[_0x0e74('0x6a')][_0x0e74('0x40')]);_0x4f4902[_0x0e74('0x44')]=_[_0x0e74('0x43')](_0x448643[_0x0e74('0x44')]);_0x4f4902['filters']=_[_0x0e74('0x46')](_0x4f4902[_0x0e74('0x47')],_0x4f4902[_0x0e74('0x44')]);_0x95589a[_0x0e74('0x48')]=_[_0x0e74('0x46')](_0x4f4902[_0x0e74('0x47')],qs[_0x0e74('0x49')](_0x448643[_0x0e74('0x44')][_0x0e74('0x49')]));_0x95589a[_0x0e74('0x48')]=_0x95589a[_0x0e74('0x48')][_0x0e74('0x6b')]?_0x95589a['attributes']:_0x4f4902[_0x0e74('0x47')];if(!_0x448643[_0x0e74('0x44')]['hasOwnProperty']('nolimit')){_0x95589a[_0x0e74('0x2f')]=qs[_0x0e74('0x2f')](_0x448643[_0x0e74('0x44')][_0x0e74('0x2f')]);_0x95589a[_0x0e74('0x2e')]=qs[_0x0e74('0x2e')](_0x448643['query'][_0x0e74('0x2e')]);}_0x95589a[_0x0e74('0x4c')]=qs[_0x0e74('0x4d')](_0x448643[_0x0e74('0x44')][_0x0e74('0x4d')]);_0x95589a[_0x0e74('0x4e')]=qs[_0x0e74('0x45')](_['pick'](_0x448643['query'],_0x4f4902[_0x0e74('0x45')]));_0x95589a[_0x0e74('0x4e')]['OpenchannelAccountId']=_0x3ba09d['id'];if(_0x448643[_0x0e74('0x44')][_0x0e74('0x50')]){_0x95589a[_0x0e74('0x4e')]=_[_0x0e74('0x51')](_0x95589a[_0x0e74('0x4e')],{'$or':_[_0x0e74('0x3e')](_0x95589a['attributes'],function(_0x5e1fe6){var _0x387dae={};_0x387dae[_0x5e1fe6]={'$like':'%'+_0x448643[_0x0e74('0x44')]['filter']+'%'};return _0x387dae;})});}_0x95589a=_[_0x0e74('0x51')]({},_0x95589a,_0x448643['options']);return db[_0x0e74('0x6a')]['count']({'where':_0x95589a['where']})[_0x0e74('0x20')](function(_0x149fcd){_0x1072f3[_0x0e74('0x31')]=_0x149fcd;if(_0x448643[_0x0e74('0x44')]['includeAll']){_0x95589a[_0x0e74('0x55')]=[{'all':!![]}];}return db['Disposition'][_0x0e74('0x56')](_0x95589a);})[_0x0e74('0x20')](function(_0x19ee28){_0x1072f3[_0x0e74('0x57')]=_0x19ee28;return _0x1072f3;});}})[_0x0e74('0x20')](respondWithFilteredResult(_0x449163,_0x95589a))[_0x0e74('0x2a')](handleError(_0x449163,null));};exports[_0x0e74('0x6c')]=function(_0x143106,_0x4cb0c2,_0x2c96b7){return db[_0x0e74('0x3f')][_0x0e74('0x59')]({'where':{'id':_0x143106[_0x0e74('0x64')]['id']}})[_0x0e74('0x20')](handleEntityNotFound(_0x4cb0c2,null))[_0x0e74('0x20')](function(_0xa2699f){if(_0xa2699f){return _0xa2699f[_0x0e74('0x6c')](_0x143106[_0x0e74('0x44')][_0x0e74('0x6d')]);}})[_0x0e74('0x20')](respondWithStatusCode(_0x4cb0c2,null))[_0x0e74('0x2a')](handleError(_0x4cb0c2,null));};exports['addAnswer']=function(_0x20a431,_0x2920a4,_0x5aac94){if(_0x20a431[_0x0e74('0x5a')]['id']){delete _0x20a431[_0x0e74('0x5a')]['id'];}return db[_0x0e74('0x3f')][_0x0e74('0x59')]({'where':{'id':_0x20a431[_0x0e74('0x64')]['id']}})[_0x0e74('0x20')](handleEntityNotFound(_0x2920a4,null))['then'](function(_0x5721d8){if(_0x5721d8){_0x20a431[_0x0e74('0x5a')]['OpenchannelAccountId']=_0x5721d8['id'];return db[_0x0e74('0x6e')][_0x0e74('0x62')](_0x20a431['body']);}})[_0x0e74('0x20')](respondWithResult(_0x2920a4,null))['catch'](handleError(_0x2920a4,null));};exports['getAnswers']=function(_0x39b77e,_0x1c7500,_0x1e0b35){var _0x5c36d2={'raw':![],'where':{}};var _0x9b770c={};var _0x508754={'count':0x0,'rows':[]};return db[_0x0e74('0x3f')][_0x0e74('0x69')]({'where':{'id':_0x39b77e[_0x0e74('0x64')]['id']}})[_0x0e74('0x20')](handleEntityNotFound(_0x1c7500,null))['then'](function(_0x404293){if(_0x404293){_0x9b770c[_0x0e74('0x47')]=_[_0x0e74('0x43')](db[_0x0e74('0x6e')]['rawAttributes']);_0x9b770c['query']=_[_0x0e74('0x43')](_0x39b77e[_0x0e74('0x44')]);_0x9b770c[_0x0e74('0x45')]=_[_0x0e74('0x46')](_0x9b770c[_0x0e74('0x47')],_0x9b770c['query']);_0x5c36d2[_0x0e74('0x48')]=_[_0x0e74('0x46')](_0x9b770c[_0x0e74('0x47')],qs[_0x0e74('0x49')](_0x39b77e[_0x0e74('0x44')][_0x0e74('0x49')]));_0x5c36d2[_0x0e74('0x48')]=_0x5c36d2['attributes'][_0x0e74('0x6b')]?_0x5c36d2[_0x0e74('0x48')]:_0x9b770c[_0x0e74('0x47')];if(!_0x39b77e[_0x0e74('0x44')][_0x0e74('0x4a')](_0x0e74('0x4b'))){_0x5c36d2[_0x0e74('0x2f')]=qs[_0x0e74('0x2f')](_0x39b77e['query']['limit']);_0x5c36d2[_0x0e74('0x2e')]=qs['offset'](_0x39b77e['query'][_0x0e74('0x2e')]);}_0x5c36d2[_0x0e74('0x4c')]=qs[_0x0e74('0x4d')](_0x39b77e['query']['sort']);_0x5c36d2[_0x0e74('0x4e')]=qs['filters'](_['pick'](_0x39b77e[_0x0e74('0x44')],_0x9b770c[_0x0e74('0x45')]));_0x5c36d2[_0x0e74('0x4e')][_0x0e74('0x67')]=_0x404293['id'];if(_0x39b77e[_0x0e74('0x44')][_0x0e74('0x50')]){_0x5c36d2['where']=_[_0x0e74('0x51')](_0x5c36d2['where'],{'$or':_['map'](_0x5c36d2[_0x0e74('0x48')],function(_0x5eca3c){var _0x35175e={};_0x35175e[_0x5eca3c]={'$like':'%'+_0x39b77e['query'][_0x0e74('0x50')]+'%'};return _0x35175e;})});}_0x5c36d2=_[_0x0e74('0x51')]({},_0x5c36d2,_0x39b77e['options']);return db[_0x0e74('0x6e')][_0x0e74('0x31')]({'where':_0x5c36d2['where']})['then'](function(_0x50037a){_0x508754[_0x0e74('0x31')]=_0x50037a;if(_0x39b77e[_0x0e74('0x44')][_0x0e74('0x54')]){_0x5c36d2[_0x0e74('0x55')]=[{'all':!![]}];}return db[_0x0e74('0x6e')]['findAll'](_0x5c36d2);})[_0x0e74('0x20')](function(_0x3b298e){_0x508754[_0x0e74('0x57')]=_0x3b298e;return _0x508754;});}})[_0x0e74('0x20')](respondWithFilteredResult(_0x1c7500,_0x5c36d2))['catch'](handleError(_0x1c7500,null));};exports[_0x0e74('0x6f')]=function(_0x4781f7,_0x5f2f33,_0x38f06d){return db[_0x0e74('0x3f')][_0x0e74('0x59')]({'where':{'id':_0x4781f7[_0x0e74('0x64')]['id']}})[_0x0e74('0x20')](handleEntityNotFound(_0x5f2f33,null))[_0x0e74('0x20')](function(_0x90c053){if(_0x90c053){return _0x90c053['removeAnswers'](_0x4781f7[_0x0e74('0x44')][_0x0e74('0x6d')]);}})[_0x0e74('0x20')](respondWithStatusCode(_0x5f2f33,null))['catch'](handleError(_0x5f2f33,null));};exports[_0x0e74('0x70')]=function(_0x6dc359,_0x17a22a,_0x55321a){var _0x5ac9e6={'body':_0x6dc359[_0x0e74('0x5a')],'channel':_0x0e74('0x71')};var _0x212188=[];var _0x5cd9cc=[];var _0x394afc={};var _0x3dac21=![];return db['CmContact'][_0x0e74('0x65')]()['then'](function(_0x5d600e){if(!_0x5d600e){throw new db[(_0x0e74('0x72'))][(_0x0e74('0x73'))](_0x0e74('0x74'));}_0x212188=_[_0x0e74('0x75')](_['keys'](_0x5d600e),[_0x0e74('0x76'),_0x0e74('0x77')]);_0x5cd9cc=_['difference'](_[_0x0e74('0x43')](_0x5d600e),[_0x0e74('0x76'),'updatedAt',_0x0e74('0x78'),_0x0e74('0x79')]);if(_0x6dc359[_0x0e74('0x5a')]['id']){delete _0x6dc359[_0x0e74('0x5a')]['id'];}if(_['isNil'](_0x6dc359[_0x0e74('0x5a')]['from'])){throw new db[(_0x0e74('0x72'))][(_0x0e74('0x73'))](_0x0e74('0x7a'));}if(_[_0x0e74('0x7b')](_0x6dc359[_0x0e74('0x5a')]['body'])||_0x6dc359['body'][_0x0e74('0x5a')]===''){throw new db[(_0x0e74('0x72'))][(_0x0e74('0x73'))](_0x0e74('0x7c'));}if(_[_0x0e74('0x7b')](_0x6dc359['body'][_0x0e74('0x7d')])){throw new db[(_0x0e74('0x72'))]['ValidationError'](_0x0e74('0x7e')+_0x5cd9cc);}if(!_['includes'](_0x5cd9cc,_0x6dc359['body'][_0x0e74('0x7d')])){throw new db['Sequelize'][(_0x0e74('0x73'))](_0x0e74('0x7f')+_0x5cd9cc);}_0x394afc[_0x6dc359[_0x0e74('0x5a')][_0x0e74('0x7d')]]=_0x6dc359[_0x0e74('0x5a')][_0x0e74('0x80')];})[_0x0e74('0x20')](function(){return db[_0x0e74('0x3f')]['find']({'where':{'id':_0x6dc359[_0x0e74('0x64')]['id']},'include':[{'model':db[_0x0e74('0x81')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x394afc,'limit':0x1,'order':[['updatedAt',_0x0e74('0x82')]]}]},{'model':db[_0x0e74('0x83')],'as':_0x0e74('0x84')}]});})[_0x0e74('0x20')](handleEntityNotFound(_0x17a22a,null))['then'](function(_0x284ad0){if(_0x284ad0&&_0x284ad0[_0x0e74('0x85')]){_0x5ac9e6[_0x0e74('0x86')]=_0x284ad0;_0x5ac9e6[_0x0e74('0x87')]=_0x284ad0[_0x0e74('0x84')];_0x5ac9e6['list']=_0x284ad0['List'];_0x5ac9e6[_0x0e74('0x87')]=_[_0x0e74('0x88')](_0x5ac9e6[_0x0e74('0x87')],['priority'],[_0x0e74('0x89')]);if(_0x5ac9e6[_0x0e74('0x86')][_0x0e74('0x84')]){delete _0x5ac9e6['account'][_0x0e74('0x84')];}if(_0x5ac9e6['account']['List']&&_0x5ac9e6[_0x0e74('0x86')][_0x0e74('0x85')]['Contacts'][_0x0e74('0x6b')]){return _0x5ac9e6[_0x0e74('0x86')][_0x0e74('0x85')][_0x0e74('0x8a')][0x0];}var _0x3761f7=_[_0x0e74('0x16')](_0x6dc359[_0x0e74('0x5a')],{'firstName':_0x6dc359[_0x0e74('0x5a')][_0x0e74('0x80')],'ListId':_0x284ad0[_0x0e74('0x79')]});_0x3761f7[_0x6dc359[_0x0e74('0x5a')][_0x0e74('0x7d')]]=_0x6dc359[_0x0e74('0x5a')][_0x0e74('0x80')];return db[_0x0e74('0x8b')][_0x0e74('0x62')](_0x3761f7,{'fields':_0x212188,'raw':!![]});}})['then'](handleEntityNotFound(_0x17a22a,null))[_0x0e74('0x20')](function(_0x249a65){_0x5ac9e6['contact']=_0x249a65;if(_0x249a65){var _0x279cd8={'ContactId':_0x249a65['id'],'OpenchannelAccountId':_0x6dc359['params']['id'],'from':(_0x249a65[_0x0e74('0x8c')]||'')+'\x20'+(_0x249a65['lastName']||'')};var _0x2d8fad={'OpenchannelAccountId':_0x6dc359[_0x0e74('0x64')]['id'],'closed':![]};if(_0x6dc359[_0x0e74('0x5a')][_0x0e74('0x8d')]){_0x2d8fad[_0x0e74('0x8d')]=_0x6dc359['body'][_0x0e74('0x8d')];return db[_0x0e74('0x8e')][_0x0e74('0x59')]({'where':_0x2d8fad})['then'](function(_0x31cd78){if(_0x31cd78){return[_0x31cd78,![]];}_0x279cd8[_0x0e74('0x8d')]=_0x6dc359[_0x0e74('0x5a')][_0x0e74('0x8d')];_0x279cd8[_0x0e74('0x8f')]=_0x6dc359[_0x0e74('0x5a')][_0x0e74('0x8f')];return db[_0x0e74('0x8e')][_0x0e74('0x62')](_0x279cd8)[_0x0e74('0x20')](function(_0x468567){return[_0x468567,!![]];});});}else{_0x2d8fad[_0x0e74('0x8d')]=null;}_0x2d8fad[_0x0e74('0x90')]=_0x249a65['id'];return db['OpenchannelInteraction'][_0x0e74('0x59')]({'where':_0x2d8fad})[_0x0e74('0x20')](function(_0x1cfb91){if(_0x1cfb91){return[_0x1cfb91,![]];}return db[_0x0e74('0x8e')]['create'](_0x279cd8)[_0x0e74('0x20')](function(_0x28a01a){return[_0x28a01a,!![]];});});}})[_0x0e74('0x91')](function(_0x48a39a,_0x17ee84){if(_0x48a39a){_0x3dac21=_0x17ee84;if(!_0x17ee84){var _0x115ed8={'from':(_0x5ac9e6[_0x0e74('0x92')]['firstName']||'')+'\x20'+(_0x5ac9e6[_0x0e74('0x92')]['lastName']||'')};if(_0x6dc359[_0x0e74('0x5a')][_0x0e74('0x8d')]&&_0x6dc359[_0x0e74('0x5a')][_0x0e74('0x93')]&&_0x6dc359[_0x0e74('0x5a')][_0x0e74('0x8d')]!=_0x6dc359['body']['messageId']){_0x115ed8[_0x0e74('0x8d')]=_0x6dc359[_0x0e74('0x5a')][_0x0e74('0x93')];}return _0x48a39a[_0x0e74('0x36')](_0x115ed8);}else{return _0x48a39a;}}})[_0x0e74('0x20')](function(_0x3d2347){_0x5ac9e6[_0x0e74('0x94')]=_0x3d2347[_0x0e74('0x5d')]({'plain':!![]});_0x5ac9e6[_0x0e74('0x94')]['created']=_0x3dac21;if(_0x5ac9e6[_0x0e74('0x94')][_0x0e74('0x95')]){if(_0x5ac9e6[_0x0e74('0x86')]['autoclose']){_0x5ac9e6['applications'][_0x0e74('0x96')]({'id':0x0,'priority':_0x5ac9e6['applications'][_0x0e74('0x6b')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x0e74('0x97')});}}return db[_0x0e74('0x98')]['create']({'body':_0x6dc359[_0x0e74('0x5a')][_0x0e74('0x5a')],'OpenchannelAccountId':_0x6dc359[_0x0e74('0x64')]['id'],'OpenchannelInteractionId':_0x3d2347['id'],'direction':'in','ContactId':_0x5ac9e6[_0x0e74('0x92')]['id'],'AttachmentId':_0x6dc359['body'][_0x0e74('0x99')]});})['then'](function(_0x114e6b){_0x5ac9e6[_0x0e74('0x28')]=_0x114e6b;if(!_0x5ac9e6['interaction'][_0x0e74('0x9a')])return;return db['User'][_0x0e74('0x59')]({'attributes':['id',_0x0e74('0x39')],'where':{'id':_0x5ac9e6[_0x0e74('0x94')][_0x0e74('0x9a')]}});})[_0x0e74('0x20')](function(_0x44f849){if(_0x44f849){_0x5ac9e6[_0x0e74('0x87')][_0x0e74('0x9b')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x44f849['name']+','+(_0x5ac9e6['account'][_0x0e74('0x9c')]||0xa),'interval':'*,*,*,*'});}if(!_0x5ac9e6[_0x0e74('0x94')][_0x0e74('0x9d')])return;return db[_0x0e74('0x9e')][_0x0e74('0x59')]({'attributes':['id',_0x0e74('0x39')],'where':{'id':_0x5ac9e6['interaction']['queueId']}});})[_0x0e74('0x20')](function(_0x1679e1){if(_0x1679e1){_0x5ac9e6[_0x0e74('0x87')][_0x0e74('0x9b')]({'id':0x0,'priority':0x1,'app':_0x0e74('0x9f'),'appdata':_0x1679e1[_0x0e74('0x39')]+','+(_0x5ac9e6[_0x0e74('0x86')]['waitForTheAssignedQueue']||0x12c),'interval':_0x0e74('0x97')});}return respondWithRpcPromise('Start',_0x0e74('0xa0'),_0x5ac9e6);})[_0x0e74('0x20')](function(_0x4cda33){respondWithRpcPromise(_0x0e74('0xa1'),_0x0e74('0xa1'),{'event':_0x0e74('0x70'),'message':_0x4cda33},client9002);return _0x4cda33;})[_0x0e74('0x20')](respondWithResult(_0x17a22a,null))[_0x0e74('0x2a')](handleError(_0x17a22a,null));};exports[_0x0e74('0xa2')]=function(_0x2f2097,_0x557f42){var _0x1a8233=_0x2f2097['params']['id'];var _0x575e2b=_0x2f2097[_0x0e74('0x5a')];var _0x11f999=0xc8;var _0x3ea5d8=null;return db['sequelize'][_0x0e74('0xa3')]({'isolationLevel':db[_0x0e74('0xa4')][_0x0e74('0xa5')][_0x0e74('0xa6')][_0x0e74('0xa7')]},function(_0x5f318e){return db[_0x0e74('0x3f')]['findOne']({'where':{'id':_0x1a8233},'transaction':_0x5f318e})[_0x0e74('0x20')](function(_0x5900b4){if(_0x5900b4){return db[_0x0e74('0x83')][_0x0e74('0x37')]({'where':{'OpenchannelAccountId':_0x1a8233},'transaction':_0x5f318e})[_0x0e74('0x20')](function(){var _0x302eca=_[_0x0e74('0x3e')](_0x575e2b,function(_0x1205f7){_0x1205f7['OpenchannelAccountId']=_0x1a8233;return _0x1205f7;});return db[_0x0e74('0x83')]['bulkCreate'](_0x302eca,{'transaction':_0x5f318e});});}else{_0x11f999=0x194;_0x3ea5d8=[];}});})[_0x0e74('0x20')](function(){if(_0x11f999!==0x194){return db[_0x0e74('0x83')][_0x0e74('0xa8')]({'where':{'OpenchannelAccountId':_0x1a8233},'order':'priority'})[_0x0e74('0x20')](function(_0x3ddf90){_0x3ea5d8=_0x3ddf90;});}})[_0x0e74('0x2a')](function(_0x5169a3){_0x11f999=0x1f4;logger[_0x0e74('0x26')](_0x5169a3['stack']);if(_0x5169a3[_0x0e74('0x39')]){delete _0x5169a3['name'];}_0x3ea5d8=_0x5169a3;})[_0x0e74('0xa9')](function(){if(_0x3ea5d8===null){_0x557f42[_0x0e74('0x2b')](_0x11f999);}else{if(_0x11f999===0x1f4){_0x557f42[_0x0e74('0x2c')](_0x11f999)['send'](_0x3ea5d8);}else{_0x557f42[_0x0e74('0x2c')](_0x11f999)[_0x0e74('0x2d')](_0x3ea5d8);}}});};exports[_0x0e74('0xaa')]=function(_0x289f15,_0x3e797d,_0x50ac70){var _0x4fc188={};var _0x57d0f2={};var _0xccdd69;var _0x264c3f;return db[_0x0e74('0x3f')][_0x0e74('0x69')]({'where':{'id':_0x289f15['params']['id']}})['then'](handleEntityNotFound(_0x3e797d,null))[_0x0e74('0x20')](function(_0xa35cd2){if(_0xa35cd2){_0xccdd69=_0xa35cd2;_0x57d0f2['model']=_[_0x0e74('0x43')](db[_0x0e74('0x83')][_0x0e74('0x40')]);_0x57d0f2[_0x0e74('0x44')]=_[_0x0e74('0x43')](_0x289f15[_0x0e74('0x44')]);_0x57d0f2[_0x0e74('0x45')]=_['intersection'](_0x57d0f2[_0x0e74('0x47')],_0x57d0f2['query']);_0x4fc188[_0x0e74('0x48')]=_[_0x0e74('0x46')](_0x57d0f2[_0x0e74('0x47')],qs[_0x0e74('0x49')](_0x289f15[_0x0e74('0x44')][_0x0e74('0x49')]));_0x4fc188[_0x0e74('0x48')]=_0x4fc188[_0x0e74('0x48')]['length']?_0x4fc188[_0x0e74('0x48')]:_0x57d0f2[_0x0e74('0x47')];_0x4fc188[_0x0e74('0x4c')]=qs[_0x0e74('0x4d')](_0x289f15[_0x0e74('0x44')]['sort']);_0x4fc188[_0x0e74('0x4e')]=qs[_0x0e74('0x45')](_[_0x0e74('0x4f')](_0x289f15[_0x0e74('0x44')],_0x57d0f2['filters']));if(_0x289f15['query']['filter']){_0x4fc188[_0x0e74('0x4e')]=_['merge'](_0x4fc188[_0x0e74('0x4e')],{'$or':_[_0x0e74('0x3e')](_0x4fc188['attributes'],function(_0x591856){var _0x511214={};_0x511214[_0x591856]={'$like':'%'+_0x289f15[_0x0e74('0x44')][_0x0e74('0x50')]+'%'};return _0x511214;})});}_0x4fc188=_[_0x0e74('0x51')]({},_0x4fc188,_0x289f15[_0x0e74('0x53')]);return _0xccdd69[_0x0e74('0xaa')](_0x4fc188);}})[_0x0e74('0x20')](function(_0x1c57ae){if(_0x1c57ae){_0x264c3f=_0x1c57ae[_0x0e74('0x6b')];if(!_0x289f15[_0x0e74('0x44')]['hasOwnProperty'](_0x0e74('0x4b'))){_0x4fc188['limit']=qs[_0x0e74('0x2f')](_0x289f15['query'][_0x0e74('0x2f')]);_0x4fc188[_0x0e74('0x2e')]=qs[_0x0e74('0x2e')](_0x289f15[_0x0e74('0x44')][_0x0e74('0x2e')]);}return _0xccdd69[_0x0e74('0xaa')](_0x4fc188);}})[_0x0e74('0x20')](function(_0x2a9d78){if(_0x2a9d78){return _0x2a9d78?{'count':_0x264c3f,'rows':_0x2a9d78}:null;}})[_0x0e74('0x20')](respondWithResult(_0x3e797d,null))[_0x0e74('0x2a')](handleError(_0x3e797d,null));};exports[_0x0e74('0xab')]=function(_0x4d1966,_0x47b0c1,_0xc45121){var _0x234c8e={'raw':![],'where':{}};var _0x283ab8={};var _0x4d9abb={'count':0x0,'rows':[]};return db[_0x0e74('0x3f')][_0x0e74('0x69')]({'where':{'id':_0x4d1966[_0x0e74('0x64')]['id']}})[_0x0e74('0x20')](handleEntityNotFound(_0x47b0c1,null))[_0x0e74('0x20')](function(_0x20c3d8){if(_0x20c3d8){_0x283ab8['model']=_[_0x0e74('0x43')](db[_0x0e74('0x8e')][_0x0e74('0x40')]);_0x283ab8[_0x0e74('0x44')]=_[_0x0e74('0x43')](_0x4d1966['query']);_0x283ab8[_0x0e74('0x45')]=_['intersection'](_0x283ab8[_0x0e74('0x47')],_0x283ab8['query']);_0x234c8e[_0x0e74('0x48')]=_[_0x0e74('0x46')](_0x283ab8[_0x0e74('0x47')],qs[_0x0e74('0x49')](_0x4d1966[_0x0e74('0x44')][_0x0e74('0x49')]));_0x234c8e['attributes']=_0x234c8e[_0x0e74('0x48')][_0x0e74('0x6b')]?_0x234c8e[_0x0e74('0x48')]:_0x283ab8['model'];if(!_0x4d1966[_0x0e74('0x44')][_0x0e74('0x4a')]('nolimit')){_0x234c8e['limit']=qs[_0x0e74('0x2f')](_0x4d1966[_0x0e74('0x44')]['limit']);_0x234c8e[_0x0e74('0x2e')]=qs['offset'](_0x4d1966[_0x0e74('0x44')]['offset']);}_0x234c8e[_0x0e74('0x4c')]=qs['sort'](_0x4d1966[_0x0e74('0x44')][_0x0e74('0x4d')]);_0x234c8e[_0x0e74('0x4e')]=qs['filters'](_['pick'](_0x4d1966[_0x0e74('0x44')],_0x283ab8['filters']));_0x234c8e[_0x0e74('0x4e')][_0x0e74('0x67')]=_0x20c3d8['id'];if(_0x4d1966[_0x0e74('0x44')][_0x0e74('0x50')]){_0x234c8e[_0x0e74('0x4e')]=_[_0x0e74('0x51')](_0x234c8e[_0x0e74('0x4e')],{'$or':_[_0x0e74('0x3e')](_0x234c8e[_0x0e74('0x48')],function(_0x54160c){var _0x28d08a={};_0x28d08a[_0x54160c]={'$like':'%'+_0x4d1966[_0x0e74('0x44')][_0x0e74('0x50')]+'%'};return _0x28d08a;})});}_0x234c8e=_[_0x0e74('0x51')]({},_0x234c8e,_0x4d1966[_0x0e74('0x53')]);return db[_0x0e74('0x8e')][_0x0e74('0x31')]({'where':_0x234c8e[_0x0e74('0x4e')]})[_0x0e74('0x20')](function(_0x2e8506){_0x4d9abb['count']=_0x2e8506;if(_0x4d1966['query'][_0x0e74('0x54')]){_0x234c8e[_0x0e74('0x55')]=[{'model':db[_0x0e74('0x8b')],'as':_0x0e74('0xac'),'required':![]},{'model':db[_0x0e74('0xad')],'as':_0x0e74('0xae'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0x0e74('0xaf')],'as':'Tags','attributes':['id',_0x0e74('0x39'),'color'],'where':_0x4d1966[_0x0e74('0x44')]['tag']?{'id':_0x4d1966[_0x0e74('0x44')][_0x0e74('0xb0')]}:undefined,'required':_0x4d1966[_0x0e74('0x44')][_0x0e74('0xb0')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x0e74('0x56')](_0x234c8e);})[_0x0e74('0x20')](function(_0x529fd5){_0x4d9abb[_0x0e74('0x57')]=_0x529fd5;return _0x4d9abb;});}})[_0x0e74('0x20')](respondWithFilteredResult(_0x47b0c1,_0x234c8e))['catch'](handleError(_0x47b0c1,null));};exports['addAgents']=function(_0x3f8edd,_0x1a807c,_0xade667){return db[_0x0e74('0x3f')][_0x0e74('0x59')]({'where':{'id':_0x3f8edd[_0x0e74('0x64')]['id']}})[_0x0e74('0x20')](handleEntityNotFound(_0x1a807c,null))[_0x0e74('0x20')](function(_0x56cea2){if(_0x56cea2){return _0x56cea2[_0x0e74('0xb1')](_0x3f8edd[_0x0e74('0x5a')][_0x0e74('0x6d')],_[_0x0e74('0xb2')](_0x3f8edd[_0x0e74('0x5a')],['ids','id'])||{})[_0x0e74('0x91')](function(_0x5d61ca){for(var _0x1d1a0f=0x0;_0x1d1a0f<_0x3f8edd['body'][_0x0e74('0x6d')][_0x0e74('0x6b')];_0x1d1a0f+=0x1){socket[_0x0e74('0xb3')](_0x0e74('0xb4'),{'UserId':Number(_0x3f8edd[_0x0e74('0x5a')][_0x0e74('0x6d')][_0x1d1a0f]),'OpenchannelAccountId':Number(_0x3f8edd['params']['id'])});}return _0x5d61ca;});}})['then'](respondWithResult(_0x1a807c,null))[_0x0e74('0x2a')](handleError(_0x1a807c,null));};exports[_0x0e74('0xb5')]=function(_0x315abd,_0x51c035,_0x36d19c){return db[_0x0e74('0x3f')][_0x0e74('0x59')]({'where':{'id':_0x315abd[_0x0e74('0x64')]['id']}})[_0x0e74('0x20')](handleEntityNotFound(_0x51c035,null))['then'](function(_0x162b8e){if(_0x162b8e){return _0x162b8e['removeAgents'](_0x315abd[_0x0e74('0x44')][_0x0e74('0x6d')])[_0x0e74('0x20')](function(){if(_[_0x0e74('0xb6')](_0x315abd['query']['ids'])){for(var _0x54c03a=0x0;_0x54c03a<_0x315abd[_0x0e74('0x44')][_0x0e74('0x6d')][_0x0e74('0x6b')];_0x54c03a+=0x1){socket[_0x0e74('0xb3')](_0x0e74('0xb7'),{'UserId':Number(_0x315abd[_0x0e74('0x44')][_0x0e74('0x6d')][_0x54c03a]),'OpenchannelAccountId':Number(_0x315abd['params']['id'])});}}else{socket[_0x0e74('0xb3')](_0x0e74('0xb7'),{'UserId':Number(_0x315abd['query'][_0x0e74('0x6d')]),'OpenchannelAccountId':Number(_0x315abd[_0x0e74('0x64')]['id'])});}});}})[_0x0e74('0x20')](respondWithStatusCode(_0x51c035,null))[_0x0e74('0x2a')](handleError(_0x51c035,null));};exports[_0x0e74('0xb8')]=function(_0x1d0a7d,_0x51b9a4,_0x45f794){var _0x26fb74={};var _0x58e3bf={};var _0x1adbcf;var _0x5625a0;return db[_0x0e74('0x3f')][_0x0e74('0x69')]({'where':{'id':_0x1d0a7d[_0x0e74('0x64')]['id']}})['then'](handleEntityNotFound(_0x51b9a4,null))[_0x0e74('0x20')](function(_0x8b2734){if(_0x8b2734){_0x1adbcf=_0x8b2734;_0x58e3bf[_0x0e74('0x47')]=_[_0x0e74('0x43')](db['User'][_0x0e74('0x40')]);_0x58e3bf[_0x0e74('0x44')]=_[_0x0e74('0x43')](_0x1d0a7d[_0x0e74('0x44')]);_0x58e3bf[_0x0e74('0x45')]=_[_0x0e74('0x46')](_0x58e3bf['model'],_0x58e3bf[_0x0e74('0x44')]);_0x26fb74['attributes']=_[_0x0e74('0x46')](_0x58e3bf[_0x0e74('0x47')],qs['fields'](_0x1d0a7d['query'][_0x0e74('0x49')]));_0x26fb74[_0x0e74('0x48')]=_0x26fb74[_0x0e74('0x48')][_0x0e74('0x6b')]?_0x26fb74[_0x0e74('0x48')]:_0x58e3bf[_0x0e74('0x47')];_0x26fb74[_0x0e74('0x4c')]=qs[_0x0e74('0x4d')](_0x1d0a7d['query'][_0x0e74('0x4d')]);_0x26fb74['where']=qs[_0x0e74('0x45')](_['pick'](_0x1d0a7d[_0x0e74('0x44')],_0x58e3bf['filters']));if(_0x1d0a7d[_0x0e74('0x44')][_0x0e74('0x50')]){_0x26fb74[_0x0e74('0x4e')]=_[_0x0e74('0x51')](_0x26fb74[_0x0e74('0x4e')],{'$or':_[_0x0e74('0x3e')](_0x26fb74[_0x0e74('0x48')],function(_0x3a9e05){var _0xeb42e8={};_0xeb42e8[_0x3a9e05]={'$like':'%'+_0x1d0a7d['query'][_0x0e74('0x50')]+'%'};return _0xeb42e8;})});}_0x26fb74=_[_0x0e74('0x51')]({},_0x26fb74,_0x1d0a7d[_0x0e74('0x53')]);return _0x1adbcf[_0x0e74('0xb8')](_0x26fb74);}})[_0x0e74('0x20')](function(_0x2417a1){if(_0x2417a1){_0x5625a0=_0x2417a1['length'];if(!_0x1d0a7d[_0x0e74('0x44')]['hasOwnProperty'](_0x0e74('0x4b'))){_0x26fb74[_0x0e74('0x2f')]=qs['limit'](_0x1d0a7d[_0x0e74('0x44')]['limit']);_0x26fb74[_0x0e74('0x2e')]=qs[_0x0e74('0x2e')](_0x1d0a7d[_0x0e74('0x44')][_0x0e74('0x2e')]);}return _0x1adbcf['getAgents'](_0x26fb74);}})[_0x0e74('0x20')](function(_0x3c97b0){if(_0x3c97b0){return _0x3c97b0?{'count':_0x5625a0,'rows':_0x3c97b0}:null;}})[_0x0e74('0x20')](respondWithResult(_0x51b9a4,null))['catch'](handleError(_0x51b9a4,null));};exports['send']=function(_0x821165,_0x3846b7,_0x1db933){var _0x200045,_0x4af72a,_0x3c0254;if(_[_0x0e74('0x7b')](_0x821165[_0x0e74('0x5a')][_0x0e74('0x5a')])||_0x821165[_0x0e74('0x5a')][_0x0e74('0x5a')]===''){throw new db[(_0x0e74('0x72'))]['ValidationError'](_0x0e74('0x7c'));}if(_[_0x0e74('0x7b')](_0x821165[_0x0e74('0x5a')]['to'])){}_0x200045=_0x821165[_0x0e74('0x5a')]['to'];return db[_0x0e74('0x3f')][_0x0e74('0x69')]({'where':{'id':_0x821165[_0x0e74('0x64')]['id']}})[_0x0e74('0x20')](handleEntityNotFound(_0x3846b7,null))[_0x0e74('0x20')](function(_0x46669b){if(_0x46669b){return db[_0x0e74('0x3f')][_0x0e74('0x59')]({'where':{'id':_0x46669b['id']},'include':[{'model':db[_0x0e74('0x81')],'as':_0x0e74('0x85'),'include':[{'model':db['CmContact'],'as':_0x0e74('0x8a'),'where':{[_0x46669b[_0x0e74('0x7d')]]:_0x200045},'limit':0x1,'order':[[_0x0e74('0x77'),_0x0e74('0x82')]]}]}]})[_0x0e74('0x20')](handleEntityNotFound(_0x3846b7,null))[_0x0e74('0x20')](function(_0x431fc5){if(_0x431fc5&&_0x431fc5['List']){_0x4af72a=_0x431fc5['get']({'plain':!![]});if(_0x4af72a[_0x0e74('0x85')]&&_0x4af72a[_0x0e74('0x85')][_0x0e74('0x8a')][_0x0e74('0x6b')]){return _0x4af72a['List'][_0x0e74('0x8a')][0x0];}return db['CmContact'][_0x0e74('0x62')](_[_0x0e74('0x16')](_0x821165[_0x0e74('0x5a')],{'firstName':_0x200045,[_0x431fc5[_0x0e74('0x7d')]]:_0x200045,'phone':_0x200045,'ListId':_0x4af72a[_0x0e74('0x79')]}));}})[_0x0e74('0x20')](handleEntityNotFound(_0x3846b7,null))['then'](function(_0x316b0a){if(_0x316b0a){_0x3c0254=_0x316b0a;return db[_0x0e74('0x8e')][_0x0e74('0x59')]({'where':{'ContactId':_0x3c0254['id'],'closed':![],'OpenchannelAccountId':_0x4af72a['id']}})[_0x0e74('0x20')](function(_0x45b094){if(_0x45b094){return[_0x45b094,![]];}return db[_0x0e74('0x8e')]['create']({'UserId':_0x821165[_0x0e74('0x5b')]['id'],'ContactId':_0x3c0254['id'],'OpenchannelAccountId':_0x4af72a['id'],'lastMsgDirection':'out','firstMsgDirection':_0x0e74('0xb9'),'Messages':[_['merge'](_0x821165[_0x0e74('0x5a')],{'read':![],'body':_0x821165[_0x0e74('0x5a')]['body'],'OpenchannelAccountId':_0x4af72a['id'],'UserId':_0x821165[_0x0e74('0x5b')]['id'],'ContactId':_0x3c0254['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x0e74('0xba')}]})[_0x0e74('0x20')](function(_0x515907){return[_0x515907,!![]];});});}})[_0x0e74('0x91')](function(_0x5799b8,_0x54e5ad){if(_0x54e5ad){return _0x5799b8;}return db[_0x0e74('0x98')][_0x0e74('0x62')](_[_0x0e74('0x51')](_0x821165['body'],{'read':![],'body':_0x821165[_0x0e74('0x5a')][_0x0e74('0x5a')],'OpenchannelAccountId':_0x4af72a['id'],'OpenchannelInteractionId':_0x5799b8['id'],'UserId':_0x821165['user']['id'],'ContactId':_0x3c0254['id']}))[_0x0e74('0x20')](function(_0x48b17a){_0x5799b8[_0x0e74('0xbb')][_0x0e74('0xba')]=[];_0x5799b8['dataValues'][_0x0e74('0xba')][_0x0e74('0x96')](_0x48b17a[_0x0e74('0xbb')]);return _0x5799b8;});});}})[_0x0e74('0x20')](respondWithResult(_0x3846b7,null))[_0x0e74('0x2a')](handleError(_0x3846b7,null));}; \ No newline at end of file +var _0xbe2a=['CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','OpenchannelApplication','account','applications','Applications','List','orderBy','priority','asc','from','contact','firstName','lastName','OpenchannelInteraction','externalUrl','spread','threadId','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','DESC','defaults','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','destroy','OpenchannelAccounts','UserProfileResource','stack','send','mandatoryDispositionPause','rawAttributes','type','key','model','map','name','filters','attributes','intersection','query','fields','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','OpenchannelAccount','count','includeAll','findAll','show','params','Pause','keys','length','include','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','nolimit','pick','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','openchannel'];(function(_0x2ed634,_0x474eb2){var _0x23a7bf=function(_0x55901c){while(--_0x55901c){_0x2ed634['push'](_0x2ed634['shift']());}};_0x23a7bf(++_0x474eb2);}(_0xbe2a,0x1d9));var _0xabe2=function(_0x48b840,_0x2513dd){_0x48b840=_0x48b840-0x0;var _0x556044=_0xbe2a[_0x48b840];return _0x556044;};'use strict';var emlformat=require(_0xabe2('0x0'));var rimraf=require(_0xabe2('0x1'));var zipdir=require(_0xabe2('0x2'));var jsonpatch=require(_0xabe2('0x3'));var rp=require(_0xabe2('0x4'));var moment=require(_0xabe2('0x5'));var BPromise=require(_0xabe2('0x6'));var Mustache=require('mustache');var util=require(_0xabe2('0x7'));var path=require('path');var sox=require(_0xabe2('0x8'));var csv=require(_0xabe2('0x9'));var ejs=require(_0xabe2('0xa'));var fs=require('fs');var fs_extra=require(_0xabe2('0xb'));var _=require(_0xabe2('0xc'));var squel=require(_0xabe2('0xd'));var crypto=require('crypto');var jsforce=require(_0xabe2('0xe'));var deskjs=require(_0xabe2('0xf'));var toCsv=require(_0xabe2('0x9'));var querystring=require(_0xabe2('0x10'));var Papa=require(_0xabe2('0x11'));var Redis=require(_0xabe2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xabe2('0x13'));var as=require(_0xabe2('0x14'));var hardwareService=require(_0xabe2('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xabe2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xabe2('0x17'))['db'];config[_0xabe2('0x18')]=_['defaults'](config['redis'],{'host':_0xabe2('0x19'),'port':0x18eb});var socket=require(_0xabe2('0x1a'))(new Redis(config[_0xabe2('0x18')]));require(_0xabe2('0x1b'))[_0xabe2('0x1c')](socket);var jayson=require(_0xabe2('0x1d'));var client=jayson[_0xabe2('0x1e')][_0xabe2('0x1f')]({'port':0x232c});var client9002=jayson[_0xabe2('0x1e')][_0xabe2('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5320d9,_0x3dd6d9,_0x3ba203,_0x3eb2b2){return new BPromise(function(_0x50f335,_0x333f33){var _0x59d667=_0x3eb2b2||client;return _0x59d667[_0xabe2('0x20')](_0x5320d9,_0x3ba203)[_0xabe2('0x21')](function(_0x49c4c3){logger[_0xabe2('0x22')](_0xabe2('0x23'),_0x3dd6d9,'request\x20sent');logger[_0xabe2('0x24')](_0xabe2('0x25'),_0x3dd6d9,'request\x20sent',JSON[_0xabe2('0x26')](_0x49c4c3));if(_0x49c4c3[_0xabe2('0x27')]){if(_0x49c4c3[_0xabe2('0x27')]['code']===0x1f4){logger[_0xabe2('0x27')](_0xabe2('0x23'),_0x3dd6d9,_0x49c4c3[_0xabe2('0x27')][_0xabe2('0x28')]);return _0x333f33(_0x49c4c3[_0xabe2('0x27')][_0xabe2('0x28')]);}logger['error'](_0xabe2('0x23'),_0x3dd6d9,_0x49c4c3[_0xabe2('0x27')]['message']);return _0x50f335(_0x49c4c3['error'][_0xabe2('0x28')]);}else{logger[_0xabe2('0x22')](_0xabe2('0x23'),_0x3dd6d9,_0xabe2('0x29'));_0x50f335(_0x49c4c3['result'][_0xabe2('0x28')]);}})[_0xabe2('0x2a')](function(_0x2c0c92){logger['error'](_0xabe2('0x23'),_0x3dd6d9,_0x2c0c92);_0x333f33(_0x2c0c92);});});}function respondWithStatusCode(_0x467365,_0x4904d9){_0x4904d9=_0x4904d9||0xcc;return function(_0x7b1d){if(_0x7b1d){return _0x467365[_0xabe2('0x2b')](_0x4904d9);}return _0x467365['status'](_0x4904d9)[_0xabe2('0x2c')]();};}function respondWithResult(_0x519805,_0x402c91){_0x402c91=_0x402c91||0xc8;return function(_0x18f7b3){if(_0x18f7b3){return _0x519805[_0xabe2('0x2d')](_0x402c91)[_0xabe2('0x2e')](_0x18f7b3);}};}function respondWithFilteredResult(_0x302919,_0x2b2535){return function(_0x293e3e){if(_0x293e3e){var _0x4a8738=typeof _0x2b2535[_0xabe2('0x2f')]===_0xabe2('0x30')&&typeof _0x2b2535[_0xabe2('0x31')]===_0xabe2('0x30');var _0x29ef25=_0x293e3e['count'];var _0x2824a2=_0x4a8738?0x0:_0x2b2535[_0xabe2('0x2f')];var _0x464a01=_0x4a8738?_0x293e3e['count']:_0x2b2535[_0xabe2('0x2f')]+_0x2b2535[_0xabe2('0x31')];var _0x3d8d04;if(_0x464a01>=_0x29ef25){_0x464a01=_0x29ef25;_0x3d8d04=0xc8;}else{_0x3d8d04=0xce;}_0x302919[_0xabe2('0x2d')](_0x3d8d04);return _0x302919[_0xabe2('0x32')](_0xabe2('0x33'),_0x2824a2+'-'+_0x464a01+'/'+_0x29ef25)['json'](_0x293e3e);}return null;};}function patchUpdates(_0x573d7a){return function(_0x4c7782){try{jsonpatch['apply'](_0x4c7782,_0x573d7a,!![]);}catch(_0x667d0b){return BPromise[_0xabe2('0x34')](_0x667d0b);}return _0x4c7782['save']();};}function saveUpdates(_0x18451a,_0x550740){return function(_0x95beda){if(_0x95beda){return _0x95beda['update'](_0x18451a)['then'](function(_0x264e25){return _0x264e25;});}return null;};}function removeEntity(_0xffa094,_0x2c0c9f){return function(_0x343329){if(_0x343329){return _0x343329[_0xabe2('0x35')]()[_0xabe2('0x21')](function(){var _0x4dcdcb=_0x343329['get']({'plain':!![]});var _0x58bd72=_0xabe2('0x36');return db[_0xabe2('0x37')]['destroy']({'where':{'type':_0x58bd72,'resourceId':_0x4dcdcb['id']}})[_0xabe2('0x21')](function(){return _0x343329;});})['then'](function(){_0xffa094['status'](0xcc)[_0xabe2('0x2c')]();});}};}function handleEntityNotFound(_0x4fd7c2,_0x25f4c6){return function(_0x97363a){if(!_0x97363a){_0x4fd7c2[_0xabe2('0x2b')](0x194);}return _0x97363a;};}function handleError(_0x123275,_0x40a1a0){_0x40a1a0=_0x40a1a0||0x1f4;return function(_0x170940){logger[_0xabe2('0x27')](_0x170940[_0xabe2('0x38')]);if(_0x170940['name']){delete _0x170940['name'];}_0x123275[_0xabe2('0x2d')](_0x40a1a0)[_0xabe2('0x39')](_0x170940);};}exports['index']=function(_0x43b6eb,_0x38b31f){var _0x300b3b={'include':[{'model':db['Pause'],'as':_0xabe2('0x3a')}]},_0x7f4e70={},_0x2aac84={'count':0x0,'rows':[]};var _0x1c38e3=_['map'](db['OpenchannelAccount'][_0xabe2('0x3b')],function(_0x498289){return{'name':_0x498289['fieldName'],'type':_0x498289[_0xabe2('0x3c')][_0xabe2('0x3d')]};});_0x7f4e70[_0xabe2('0x3e')]=_[_0xabe2('0x3f')](_0x1c38e3,_0xabe2('0x40'));_0x7f4e70['query']=_['keys'](_0x43b6eb['query']);_0x7f4e70[_0xabe2('0x41')]=_['intersection'](_0x7f4e70[_0xabe2('0x3e')],_0x7f4e70['query']);_0x300b3b[_0xabe2('0x42')]=_[_0xabe2('0x43')](_0x7f4e70['model'],qs['fields'](_0x43b6eb[_0xabe2('0x44')][_0xabe2('0x45')]));_0x300b3b[_0xabe2('0x42')]=_0x300b3b[_0xabe2('0x42')]['length']?_0x300b3b[_0xabe2('0x42')]:_0x7f4e70[_0xabe2('0x3e')];if(!_0x43b6eb[_0xabe2('0x44')][_0xabe2('0x46')]('nolimit')){_0x300b3b[_0xabe2('0x31')]=qs[_0xabe2('0x31')](_0x43b6eb[_0xabe2('0x44')]['limit']);_0x300b3b[_0xabe2('0x2f')]=qs[_0xabe2('0x2f')](_0x43b6eb[_0xabe2('0x44')][_0xabe2('0x2f')]);}_0x300b3b[_0xabe2('0x47')]=qs[_0xabe2('0x48')](_0x43b6eb['query'][_0xabe2('0x48')]);_0x300b3b[_0xabe2('0x49')]=qs[_0xabe2('0x41')](_['pick'](_0x43b6eb['query'],_0x7f4e70[_0xabe2('0x41')]),_0x1c38e3);if(_0x43b6eb['query'][_0xabe2('0x4a')]){_0x300b3b[_0xabe2('0x49')]=_['merge'](_0x300b3b['where'],{'$or':_[_0xabe2('0x3f')](_0x1c38e3,function(_0x28927c){if(_0x28927c['type']!==_0xabe2('0x4b')){var _0x45aa10={};_0x45aa10[_0x28927c['name']]={'$like':'%'+_0x43b6eb['query']['filter']+'%'};return _0x45aa10;}})});}_0x300b3b=_[_0xabe2('0x4c')]({},_0x300b3b,_0x43b6eb[_0xabe2('0x4d')]);var _0x1fa5fd={'where':_0x300b3b['where']};return db[_0xabe2('0x4e')][_0xabe2('0x4f')](_0x1fa5fd)[_0xabe2('0x21')](function(_0x3f8293){_0x2aac84[_0xabe2('0x4f')]=_0x3f8293;if(_0x43b6eb[_0xabe2('0x44')][_0xabe2('0x50')]){_0x300b3b['include']=[{'all':!![]}];}return db[_0xabe2('0x4e')][_0xabe2('0x51')](_0x300b3b);})[_0xabe2('0x21')](function(_0x5c124f){_0x2aac84['rows']=_0x5c124f;return _0x2aac84;})[_0xabe2('0x21')](respondWithFilteredResult(_0x38b31f,_0x300b3b))[_0xabe2('0x2a')](handleError(_0x38b31f,null));};exports[_0xabe2('0x52')]=function(_0x14ce62,_0x22af6e){var _0x48031a={'raw':![],'where':{'id':_0x14ce62[_0xabe2('0x53')]['id']},'include':[{'model':db[_0xabe2('0x54')],'as':_0xabe2('0x3a')}]},_0x91f7df={};_0x91f7df[_0xabe2('0x3e')]=_[_0xabe2('0x55')](db['OpenchannelAccount'][_0xabe2('0x3b')]);_0x91f7df[_0xabe2('0x44')]=_['keys'](_0x14ce62[_0xabe2('0x44')]);_0x91f7df['filters']=_['intersection'](_0x91f7df['model'],_0x91f7df[_0xabe2('0x44')]);_0x48031a[_0xabe2('0x42')]=_[_0xabe2('0x43')](_0x91f7df[_0xabe2('0x3e')],qs['fields'](_0x14ce62[_0xabe2('0x44')][_0xabe2('0x45')]));_0x48031a[_0xabe2('0x42')]=_0x48031a['attributes'][_0xabe2('0x56')]?_0x48031a[_0xabe2('0x42')]:_0x91f7df[_0xabe2('0x3e')];if(_0x14ce62[_0xabe2('0x44')][_0xabe2('0x50')]){_0x48031a[_0xabe2('0x57')]=[{'all':!![]}];}_0x48031a=_[_0xabe2('0x4c')]({},_0x48031a,_0x14ce62[_0xabe2('0x4d')]);return db[_0xabe2('0x4e')][_0xabe2('0x58')](_0x48031a)[_0xabe2('0x21')](handleEntityNotFound(_0x22af6e,null))['then'](respondWithResult(_0x22af6e,null))[_0xabe2('0x2a')](handleError(_0x22af6e,null));};exports['create']=function(_0x201fa6,_0x6ad87a){return db[_0xabe2('0x4e')][_0xabe2('0x59')](_0x201fa6[_0xabe2('0x5a')],{})[_0xabe2('0x21')](function(_0x1d8652){var _0xab6dfb=_0x201fa6['user']['get']({'plain':!![]});if(!_0xab6dfb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xab6dfb[_0xabe2('0x5b')]===_0xabe2('0x5c')){var _0x5cd31e=_0x1d8652['get']({'plain':!![]});var _0x288d6e=_0xabe2('0x36');return db[_0xabe2('0x5d')][_0xabe2('0x58')]({'where':{'name':_0x288d6e,'userProfileId':_0xab6dfb[_0xabe2('0x5e')]},'raw':!![]})['then'](function(_0x237cb9){if(_0x237cb9&&_0x237cb9[_0xabe2('0x5f')]===0x0){return db['UserProfileResource'][_0xabe2('0x59')]({'name':_0x5cd31e['name'],'resourceId':_0x5cd31e['id'],'type':_0x237cb9[_0xabe2('0x40')],'sectionId':_0x237cb9['id']},{})[_0xabe2('0x21')](function(){return _0x1d8652;});}else{return _0x1d8652;}})[_0xabe2('0x2a')](function(_0x3c40ad){logger[_0xabe2('0x27')](_0xabe2('0x60'),_0x3c40ad);throw _0x3c40ad;});}return _0x1d8652;})[_0xabe2('0x21')](respondWithResult(_0x6ad87a,0xc9))[_0xabe2('0x2a')](handleError(_0x6ad87a,null));};exports[_0xabe2('0x61')]=function(_0x450032,_0x6eacb6){if(_0x450032[_0xabe2('0x5a')]['id']){delete _0x450032[_0xabe2('0x5a')]['id'];}return db['OpenchannelAccount'][_0xabe2('0x58')]({'where':{'id':_0x450032[_0xabe2('0x53')]['id']},'include':[{'model':db[_0xabe2('0x54')],'as':_0xabe2('0x3a')}]})[_0xabe2('0x21')](handleEntityNotFound(_0x6eacb6,null))[_0xabe2('0x21')](saveUpdates(_0x450032[_0xabe2('0x5a')],null))[_0xabe2('0x21')](respondWithResult(_0x6eacb6,null))[_0xabe2('0x2a')](handleError(_0x6eacb6,null));};exports[_0xabe2('0x35')]=function(_0x3d306d,_0xa6a5db){return db['OpenchannelAccount'][_0xabe2('0x58')]({'where':{'id':_0x3d306d['params']['id']}})[_0xabe2('0x21')](handleEntityNotFound(_0xa6a5db,null))['then'](removeEntity(_0xa6a5db,null))['catch'](handleError(_0xa6a5db,null));};exports[_0xabe2('0x62')]=function(_0x2ba6d0,_0x3c7798){return db['OpenchannelAccount']['describe']()['then'](respondWithResult(_0x3c7798,null))[_0xabe2('0x2a')](handleError(_0x3c7798,null));};exports[_0xabe2('0x63')]=function(_0x417f2a,_0x835f69,_0x33b89f){if(_0x417f2a[_0xabe2('0x5a')]['id']){delete _0x417f2a['body']['id'];}return db[_0xabe2('0x4e')][_0xabe2('0x58')]({'where':{'id':_0x417f2a[_0xabe2('0x53')]['id']}})[_0xabe2('0x21')](handleEntityNotFound(_0x835f69,null))[_0xabe2('0x21')](function(_0x59b3a2){if(_0x59b3a2){_0x417f2a['body'][_0xabe2('0x64')]=_0x59b3a2['id'];return db[_0xabe2('0x65')]['create'](_0x417f2a[_0xabe2('0x5a')]);}})[_0xabe2('0x21')](respondWithResult(_0x835f69,null))[_0xabe2('0x2a')](handleError(_0x835f69,null));};exports[_0xabe2('0x66')]=function(_0x23750a,_0x536bf2,_0x1a6909){var _0xcb2573={'raw':![],'where':{}};var _0x29d85d={};var _0x1ea1b5={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x23750a[_0xabe2('0x53')]['id']}})[_0xabe2('0x21')](handleEntityNotFound(_0x536bf2,null))[_0xabe2('0x21')](function(_0x3229f3){if(_0x3229f3){_0x29d85d[_0xabe2('0x3e')]=_[_0xabe2('0x55')](db['Disposition'][_0xabe2('0x3b')]);_0x29d85d[_0xabe2('0x44')]=_[_0xabe2('0x55')](_0x23750a[_0xabe2('0x44')]);_0x29d85d[_0xabe2('0x41')]=_[_0xabe2('0x43')](_0x29d85d['model'],_0x29d85d[_0xabe2('0x44')]);_0xcb2573[_0xabe2('0x42')]=_[_0xabe2('0x43')](_0x29d85d[_0xabe2('0x3e')],qs[_0xabe2('0x45')](_0x23750a['query'][_0xabe2('0x45')]));_0xcb2573[_0xabe2('0x42')]=_0xcb2573['attributes'][_0xabe2('0x56')]?_0xcb2573[_0xabe2('0x42')]:_0x29d85d[_0xabe2('0x3e')];if(!_0x23750a[_0xabe2('0x44')]['hasOwnProperty'](_0xabe2('0x67'))){_0xcb2573[_0xabe2('0x31')]=qs[_0xabe2('0x31')](_0x23750a[_0xabe2('0x44')][_0xabe2('0x31')]);_0xcb2573['offset']=qs[_0xabe2('0x2f')](_0x23750a[_0xabe2('0x44')]['offset']);}_0xcb2573[_0xabe2('0x47')]=qs[_0xabe2('0x48')](_0x23750a[_0xabe2('0x44')][_0xabe2('0x48')]);_0xcb2573[_0xabe2('0x49')]=qs[_0xabe2('0x41')](_[_0xabe2('0x68')](_0x23750a[_0xabe2('0x44')],_0x29d85d[_0xabe2('0x41')]));_0xcb2573['where'][_0xabe2('0x64')]=_0x3229f3['id'];if(_0x23750a['query']['filter']){_0xcb2573[_0xabe2('0x49')]=_['merge'](_0xcb2573[_0xabe2('0x49')],{'$or':_[_0xabe2('0x3f')](_0xcb2573[_0xabe2('0x42')],function(_0x1769ed){var _0x23ea89={};_0x23ea89[_0x1769ed]={'$like':'%'+_0x23750a[_0xabe2('0x44')][_0xabe2('0x4a')]+'%'};return _0x23ea89;})});}_0xcb2573=_[_0xabe2('0x4c')]({},_0xcb2573,_0x23750a[_0xabe2('0x4d')]);return db[_0xabe2('0x65')]['count']({'where':_0xcb2573[_0xabe2('0x49')]})[_0xabe2('0x21')](function(_0x176c02){_0x1ea1b5[_0xabe2('0x4f')]=_0x176c02;if(_0x23750a['query'][_0xabe2('0x50')]){_0xcb2573[_0xabe2('0x57')]=[{'all':!![]}];}return db[_0xabe2('0x65')][_0xabe2('0x51')](_0xcb2573);})[_0xabe2('0x21')](function(_0x1c0b82){_0x1ea1b5[_0xabe2('0x69')]=_0x1c0b82;return _0x1ea1b5;});}})['then'](respondWithFilteredResult(_0x536bf2,_0xcb2573))[_0xabe2('0x2a')](handleError(_0x536bf2,null));};exports[_0xabe2('0x6a')]=function(_0x3e7427,_0x4ca071,_0x346331){return db[_0xabe2('0x4e')][_0xabe2('0x58')]({'where':{'id':_0x3e7427[_0xabe2('0x53')]['id']}})[_0xabe2('0x21')](handleEntityNotFound(_0x4ca071,null))[_0xabe2('0x21')](function(_0xbb36f8){if(_0xbb36f8){return _0xbb36f8[_0xabe2('0x6a')](_0x3e7427[_0xabe2('0x44')][_0xabe2('0x6b')]);}})[_0xabe2('0x21')](respondWithStatusCode(_0x4ca071,null))[_0xabe2('0x2a')](handleError(_0x4ca071,null));};exports[_0xabe2('0x6c')]=function(_0x574158,_0x14707b,_0x24f855){if(_0x574158[_0xabe2('0x5a')]['id']){delete _0x574158[_0xabe2('0x5a')]['id'];}return db['OpenchannelAccount'][_0xabe2('0x58')]({'where':{'id':_0x574158[_0xabe2('0x53')]['id']}})[_0xabe2('0x21')](handleEntityNotFound(_0x14707b,null))[_0xabe2('0x21')](function(_0x5afb9e){if(_0x5afb9e){_0x574158[_0xabe2('0x5a')][_0xabe2('0x64')]=_0x5afb9e['id'];return db[_0xabe2('0x6d')][_0xabe2('0x59')](_0x574158[_0xabe2('0x5a')]);}})[_0xabe2('0x21')](respondWithResult(_0x14707b,null))[_0xabe2('0x2a')](handleError(_0x14707b,null));};exports[_0xabe2('0x6e')]=function(_0x259a4c,_0x4825ff,_0x3133e5){var _0x12e5ef={'raw':![],'where':{}};var _0x31c6dc={};var _0x15a318={'count':0x0,'rows':[]};return db[_0xabe2('0x4e')][_0xabe2('0x6f')]({'where':{'id':_0x259a4c[_0xabe2('0x53')]['id']}})[_0xabe2('0x21')](handleEntityNotFound(_0x4825ff,null))[_0xabe2('0x21')](function(_0xd9346f){if(_0xd9346f){_0x31c6dc[_0xabe2('0x3e')]=_[_0xabe2('0x55')](db[_0xabe2('0x6d')][_0xabe2('0x3b')]);_0x31c6dc[_0xabe2('0x44')]=_[_0xabe2('0x55')](_0x259a4c[_0xabe2('0x44')]);_0x31c6dc[_0xabe2('0x41')]=_[_0xabe2('0x43')](_0x31c6dc['model'],_0x31c6dc[_0xabe2('0x44')]);_0x12e5ef[_0xabe2('0x42')]=_[_0xabe2('0x43')](_0x31c6dc['model'],qs[_0xabe2('0x45')](_0x259a4c[_0xabe2('0x44')][_0xabe2('0x45')]));_0x12e5ef['attributes']=_0x12e5ef['attributes'][_0xabe2('0x56')]?_0x12e5ef[_0xabe2('0x42')]:_0x31c6dc['model'];if(!_0x259a4c['query'][_0xabe2('0x46')](_0xabe2('0x67'))){_0x12e5ef[_0xabe2('0x31')]=qs['limit'](_0x259a4c[_0xabe2('0x44')][_0xabe2('0x31')]);_0x12e5ef[_0xabe2('0x2f')]=qs['offset'](_0x259a4c[_0xabe2('0x44')][_0xabe2('0x2f')]);}_0x12e5ef[_0xabe2('0x47')]=qs[_0xabe2('0x48')](_0x259a4c['query'][_0xabe2('0x48')]);_0x12e5ef[_0xabe2('0x49')]=qs[_0xabe2('0x41')](_['pick'](_0x259a4c[_0xabe2('0x44')],_0x31c6dc[_0xabe2('0x41')]));_0x12e5ef['where'][_0xabe2('0x64')]=_0xd9346f['id'];if(_0x259a4c[_0xabe2('0x44')][_0xabe2('0x4a')]){_0x12e5ef['where']=_[_0xabe2('0x4c')](_0x12e5ef[_0xabe2('0x49')],{'$or':_[_0xabe2('0x3f')](_0x12e5ef[_0xabe2('0x42')],function(_0xdaffe6){var _0x553f63={};_0x553f63[_0xdaffe6]={'$like':'%'+_0x259a4c['query'][_0xabe2('0x4a')]+'%'};return _0x553f63;})});}_0x12e5ef=_[_0xabe2('0x4c')]({},_0x12e5ef,_0x259a4c['options']);return db[_0xabe2('0x6d')][_0xabe2('0x4f')]({'where':_0x12e5ef[_0xabe2('0x49')]})[_0xabe2('0x21')](function(_0x257d5e){_0x15a318['count']=_0x257d5e;if(_0x259a4c[_0xabe2('0x44')][_0xabe2('0x50')]){_0x12e5ef['include']=[{'all':!![]}];}return db[_0xabe2('0x6d')][_0xabe2('0x51')](_0x12e5ef);})[_0xabe2('0x21')](function(_0x5f1d69){_0x15a318[_0xabe2('0x69')]=_0x5f1d69;return _0x15a318;});}})[_0xabe2('0x21')](respondWithFilteredResult(_0x4825ff,_0x12e5ef))[_0xabe2('0x2a')](handleError(_0x4825ff,null));};exports[_0xabe2('0x70')]=function(_0x29a516,_0x5adb0f,_0x39b92c){return db[_0xabe2('0x4e')][_0xabe2('0x58')]({'where':{'id':_0x29a516[_0xabe2('0x53')]['id']}})[_0xabe2('0x21')](handleEntityNotFound(_0x5adb0f,null))[_0xabe2('0x21')](function(_0x3dee19){if(_0x3dee19){return _0x3dee19[_0xabe2('0x70')](_0x29a516[_0xabe2('0x44')][_0xabe2('0x6b')]);}})[_0xabe2('0x21')](respondWithStatusCode(_0x5adb0f,null))[_0xabe2('0x2a')](handleError(_0x5adb0f,null));};exports[_0xabe2('0x71')]=function(_0x19cd5f,_0xf1f5c0,_0x52f779){var _0x44fb09={'body':_0x19cd5f[_0xabe2('0x5a')],'channel':_0xabe2('0x72')};var _0x45d31b=[];var _0x3d7513=[];var _0x3374d7={};var _0x2b4a86=![];return db[_0xabe2('0x73')][_0xabe2('0x62')]()[_0xabe2('0x21')](function(_0x3946c8){if(!_0x3946c8){throw new db[(_0xabe2('0x74'))]['ValidationError'](_0xabe2('0x75'));}_0x45d31b=_[_0xabe2('0x76')](_['keys'](_0x3946c8),[_0xabe2('0x77'),_0xabe2('0x78')]);_0x3d7513=_['difference'](_[_0xabe2('0x55')](_0x3946c8),[_0xabe2('0x77'),_0xabe2('0x78'),_0xabe2('0x79'),_0xabe2('0x7a')]);if(_0x19cd5f[_0xabe2('0x5a')]['id']){delete _0x19cd5f[_0xabe2('0x5a')]['id'];}if(_[_0xabe2('0x7b')](_0x19cd5f[_0xabe2('0x5a')]['from'])){throw new db['Sequelize'][(_0xabe2('0x7c'))](_0xabe2('0x7d'));}if(_[_0xabe2('0x7b')](_0x19cd5f['body']['body'])||_0x19cd5f[_0xabe2('0x5a')][_0xabe2('0x5a')]===''){throw new db['Sequelize'][(_0xabe2('0x7c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xabe2('0x7b')](_0x19cd5f[_0xabe2('0x5a')][_0xabe2('0x7e')])){throw new db[(_0xabe2('0x74'))][(_0xabe2('0x7c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3d7513);}if(!_['includes'](_0x3d7513,_0x19cd5f[_0xabe2('0x5a')][_0xabe2('0x7e')])){throw new db[(_0xabe2('0x74'))]['ValidationError'](_0xabe2('0x7f')+_0x3d7513);}_0x3374d7[_0x19cd5f[_0xabe2('0x5a')][_0xabe2('0x7e')]]=_0x19cd5f[_0xabe2('0x5a')]['from'];})[_0xabe2('0x21')](function(){return db[_0xabe2('0x4e')][_0xabe2('0x58')]({'where':{'id':_0x19cd5f[_0xabe2('0x53')]['id']},'include':[{'model':db[_0xabe2('0x80')],'as':'List','include':[{'model':db[_0xabe2('0x73')],'as':_0xabe2('0x81'),'where':_0x3374d7,'limit':0x1,'order':[[_0xabe2('0x78'),'DESC']]}]},{'model':db[_0xabe2('0x82')],'as':'Applications'}]});})[_0xabe2('0x21')](handleEntityNotFound(_0xf1f5c0,null))[_0xabe2('0x21')](function(_0x50ab19){if(_0x50ab19&&_0x50ab19['List']){_0x44fb09[_0xabe2('0x83')]=_0x50ab19;_0x44fb09[_0xabe2('0x84')]=_0x50ab19[_0xabe2('0x85')];_0x44fb09['list']=_0x50ab19[_0xabe2('0x86')];_0x44fb09[_0xabe2('0x84')]=_[_0xabe2('0x87')](_0x44fb09['applications'],[_0xabe2('0x88')],[_0xabe2('0x89')]);if(_0x44fb09['account'][_0xabe2('0x85')]){delete _0x44fb09['account']['Applications'];}if(_0x44fb09[_0xabe2('0x83')]['List']&&_0x44fb09[_0xabe2('0x83')][_0xabe2('0x86')][_0xabe2('0x81')]['length']){return _0x44fb09[_0xabe2('0x83')][_0xabe2('0x86')][_0xabe2('0x81')][0x0];}var _0x314fc2=_['defaults'](_0x19cd5f[_0xabe2('0x5a')],{'firstName':_0x19cd5f[_0xabe2('0x5a')]['from'],'ListId':_0x50ab19[_0xabe2('0x7a')]});_0x314fc2[_0x19cd5f[_0xabe2('0x5a')]['mapKey']]=_0x19cd5f[_0xabe2('0x5a')][_0xabe2('0x8a')];return db['CmContact'][_0xabe2('0x59')](_0x314fc2,{'fields':_0x45d31b,'raw':!![]});}})[_0xabe2('0x21')](handleEntityNotFound(_0xf1f5c0,null))[_0xabe2('0x21')](function(_0x420691){_0x44fb09[_0xabe2('0x8b')]=_0x420691;if(_0x420691){var _0x1600b1={'ContactId':_0x420691['id'],'OpenchannelAccountId':_0x19cd5f[_0xabe2('0x53')]['id'],'from':(_0x420691[_0xabe2('0x8c')]||'')+'\x20'+(_0x420691[_0xabe2('0x8d')]||'')};var _0x16baa3={'OpenchannelAccountId':_0x19cd5f[_0xabe2('0x53')]['id'],'closed':![]};if(_0x19cd5f[_0xabe2('0x5a')]['threadId']){_0x16baa3['threadId']=_0x19cd5f['body']['threadId'];return db[_0xabe2('0x8e')][_0xabe2('0x58')]({'where':_0x16baa3})[_0xabe2('0x21')](function(_0x2c387d){if(_0x2c387d){return[_0x2c387d,![]];}_0x1600b1['threadId']=_0x19cd5f[_0xabe2('0x5a')]['threadId'];_0x1600b1['externalUrl']=_0x19cd5f[_0xabe2('0x5a')][_0xabe2('0x8f')];return db[_0xabe2('0x8e')][_0xabe2('0x59')](_0x1600b1)[_0xabe2('0x21')](function(_0x1dae15){return[_0x1dae15,!![]];});});}else{_0x16baa3['threadId']=null;}_0x16baa3['ContactId']=_0x420691['id'];return db[_0xabe2('0x8e')][_0xabe2('0x58')]({'where':_0x16baa3})['then'](function(_0x13d180){if(_0x13d180){return[_0x13d180,![]];}return db[_0xabe2('0x8e')][_0xabe2('0x59')](_0x1600b1)['then'](function(_0x4ae7fc){return[_0x4ae7fc,!![]];});});}})[_0xabe2('0x90')](function(_0x595c52,_0x9eaabc){if(_0x595c52){_0x2b4a86=_0x9eaabc;if(!_0x9eaabc){var _0xc4c457={'from':(_0x44fb09[_0xabe2('0x8b')][_0xabe2('0x8c')]||'')+'\x20'+(_0x44fb09[_0xabe2('0x8b')][_0xabe2('0x8d')]||'')};if(_0x19cd5f['body'][_0xabe2('0x91')]&&_0x19cd5f['body']['messageId']&&_0x19cd5f['body'][_0xabe2('0x91')]!=_0x19cd5f[_0xabe2('0x5a')][_0xabe2('0x92')]){_0xc4c457[_0xabe2('0x91')]=_0x19cd5f['body'][_0xabe2('0x92')];}return _0x595c52[_0xabe2('0x61')](_0xc4c457);}else{return _0x595c52;}}})[_0xabe2('0x21')](function(_0x490873){_0x44fb09[_0xabe2('0x93')]=_0x490873['get']({'plain':!![]});_0x44fb09['interaction'][_0xabe2('0x94')]=_0x2b4a86;if(_0x44fb09['interaction']['created']){if(_0x44fb09[_0xabe2('0x83')][_0xabe2('0x95')]){_0x44fb09[_0xabe2('0x84')][_0xabe2('0x96')]({'id':0x0,'priority':_0x44fb09[_0xabe2('0x84')]['length']+0x1,'app':'close','appdata':_0xabe2('0x97'),'interval':_0xabe2('0x98')});}}return db[_0xabe2('0x99')][_0xabe2('0x59')]({'body':_0x19cd5f[_0xabe2('0x5a')][_0xabe2('0x5a')],'OpenchannelAccountId':_0x19cd5f[_0xabe2('0x53')]['id'],'OpenchannelInteractionId':_0x490873['id'],'direction':'in','ContactId':_0x44fb09['contact']['id'],'AttachmentId':_0x19cd5f[_0xabe2('0x5a')][_0xabe2('0x9a')]});})[_0xabe2('0x21')](function(_0x333f4a){_0x44fb09[_0xabe2('0x28')]=_0x333f4a;if(!_0x44fb09[_0xabe2('0x93')][_0xabe2('0x9b')])return;return db[_0xabe2('0x9c')][_0xabe2('0x58')]({'attributes':['id',_0xabe2('0x40')],'where':{'id':_0x44fb09[_0xabe2('0x93')][_0xabe2('0x9b')]}});})[_0xabe2('0x21')](function(_0x246e10){if(_0x246e10){_0x44fb09['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xabe2('0x9d'),'appdata':_0x246e10[_0xabe2('0x40')]+','+(_0x44fb09[_0xabe2('0x83')][_0xabe2('0x9e')]||0xa),'interval':'*,*,*,*'});}if(!_0x44fb09[_0xabe2('0x93')][_0xabe2('0x9f')])return;return db[_0xabe2('0xa0')][_0xabe2('0x58')]({'attributes':['id',_0xabe2('0x40')],'where':{'id':_0x44fb09[_0xabe2('0x93')][_0xabe2('0x9f')]}});})[_0xabe2('0x21')](function(_0x32ae87){if(_0x32ae87){_0x44fb09[_0xabe2('0x84')][_0xabe2('0xa1')]({'id':0x0,'priority':0x1,'app':_0xabe2('0xa2'),'appdata':_0x32ae87['name']+','+(_0x44fb09[_0xabe2('0x83')][_0xabe2('0xa3')]||0x12c),'interval':_0xabe2('0x98')});}return respondWithRpcPromise(_0xabe2('0xa4'),_0xabe2('0xa5'),_0x44fb09);})[_0xabe2('0x21')](function(_0x3c116d){respondWithRpcPromise(_0xabe2('0xa6'),_0xabe2('0xa6'),{'event':_0xabe2('0x71'),'message':_0x3c116d},client9002);return _0x3c116d;})['then'](respondWithResult(_0xf1f5c0,null))['catch'](handleError(_0xf1f5c0,null));};exports[_0xabe2('0xa7')]=function(_0x5c3cb6,_0x5de15c){var _0x4727f3=_0x5c3cb6['params']['id'];var _0x571b18=_0x5c3cb6[_0xabe2('0x5a')];var _0xb0fdf2=0xc8;var _0x33d5da=null;return db[_0xabe2('0xa8')][_0xabe2('0xa9')]({'isolationLevel':db[_0xabe2('0xa8')][_0xabe2('0xaa')][_0xabe2('0xab')][_0xabe2('0xac')]},function(_0x6007d0){return db[_0xabe2('0x4e')][_0xabe2('0x6f')]({'where':{'id':_0x4727f3},'transaction':_0x6007d0})[_0xabe2('0x21')](function(_0x44a492){if(_0x44a492){return db[_0xabe2('0x82')][_0xabe2('0x35')]({'where':{'OpenchannelAccountId':_0x4727f3},'transaction':_0x6007d0})[_0xabe2('0x21')](function(){var _0x4f5097=_[_0xabe2('0x3f')](_0x571b18,function(_0x30c253){_0x30c253[_0xabe2('0x64')]=_0x4727f3;return _0x30c253;});return db[_0xabe2('0x82')][_0xabe2('0xad')](_0x4f5097,{'transaction':_0x6007d0});});}else{_0xb0fdf2=0x194;_0x33d5da=[];}});})['then'](function(){if(_0xb0fdf2!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x4727f3},'order':'priority'})[_0xabe2('0x21')](function(_0x2a79b2){_0x33d5da=_0x2a79b2;});}})[_0xabe2('0x2a')](function(_0x5d9f1a){_0xb0fdf2=0x1f4;logger[_0xabe2('0x27')](_0x5d9f1a['stack']);if(_0x5d9f1a[_0xabe2('0x40')]){delete _0x5d9f1a[_0xabe2('0x40')];}_0x33d5da=_0x5d9f1a;})[_0xabe2('0xae')](function(){if(_0x33d5da===null){_0x5de15c[_0xabe2('0x2b')](_0xb0fdf2);}else{if(_0xb0fdf2===0x1f4){_0x5de15c['status'](_0xb0fdf2)[_0xabe2('0x39')](_0x33d5da);}else{_0x5de15c[_0xabe2('0x2d')](_0xb0fdf2)['json'](_0x33d5da);}}});};exports['getApplications']=function(_0x4d523a,_0x4692a6,_0x28d7aa){var _0x18bd82={};var _0x3424ad={};var _0x4cd7d8;var _0x45bd47;return db[_0xabe2('0x4e')][_0xabe2('0x6f')]({'where':{'id':_0x4d523a[_0xabe2('0x53')]['id']}})[_0xabe2('0x21')](handleEntityNotFound(_0x4692a6,null))[_0xabe2('0x21')](function(_0x59f400){if(_0x59f400){_0x4cd7d8=_0x59f400;_0x3424ad[_0xabe2('0x3e')]=_[_0xabe2('0x55')](db[_0xabe2('0x82')][_0xabe2('0x3b')]);_0x3424ad['query']=_[_0xabe2('0x55')](_0x4d523a[_0xabe2('0x44')]);_0x3424ad['filters']=_[_0xabe2('0x43')](_0x3424ad[_0xabe2('0x3e')],_0x3424ad[_0xabe2('0x44')]);_0x18bd82[_0xabe2('0x42')]=_[_0xabe2('0x43')](_0x3424ad[_0xabe2('0x3e')],qs[_0xabe2('0x45')](_0x4d523a[_0xabe2('0x44')]['fields']));_0x18bd82[_0xabe2('0x42')]=_0x18bd82['attributes'][_0xabe2('0x56')]?_0x18bd82[_0xabe2('0x42')]:_0x3424ad[_0xabe2('0x3e')];_0x18bd82['order']=qs[_0xabe2('0x48')](_0x4d523a[_0xabe2('0x44')][_0xabe2('0x48')]);_0x18bd82['where']=qs[_0xabe2('0x41')](_[_0xabe2('0x68')](_0x4d523a[_0xabe2('0x44')],_0x3424ad[_0xabe2('0x41')]));if(_0x4d523a[_0xabe2('0x44')][_0xabe2('0x4a')]){_0x18bd82[_0xabe2('0x49')]=_[_0xabe2('0x4c')](_0x18bd82['where'],{'$or':_[_0xabe2('0x3f')](_0x18bd82[_0xabe2('0x42')],function(_0x4e5685){var _0x36a4bc={};_0x36a4bc[_0x4e5685]={'$like':'%'+_0x4d523a[_0xabe2('0x44')]['filter']+'%'};return _0x36a4bc;})});}_0x18bd82=_[_0xabe2('0x4c')]({},_0x18bd82,_0x4d523a['options']);return _0x4cd7d8[_0xabe2('0xaf')](_0x18bd82);}})[_0xabe2('0x21')](function(_0x30e517){if(_0x30e517){_0x45bd47=_0x30e517[_0xabe2('0x56')];if(!_0x4d523a['query'][_0xabe2('0x46')](_0xabe2('0x67'))){_0x18bd82[_0xabe2('0x31')]=qs[_0xabe2('0x31')](_0x4d523a[_0xabe2('0x44')]['limit']);_0x18bd82[_0xabe2('0x2f')]=qs[_0xabe2('0x2f')](_0x4d523a[_0xabe2('0x44')][_0xabe2('0x2f')]);}return _0x4cd7d8[_0xabe2('0xaf')](_0x18bd82);}})[_0xabe2('0x21')](function(_0x1356ff){if(_0x1356ff){return _0x1356ff?{'count':_0x45bd47,'rows':_0x1356ff}:null;}})[_0xabe2('0x21')](respondWithResult(_0x4692a6,null))[_0xabe2('0x2a')](handleError(_0x4692a6,null));};exports[_0xabe2('0xb0')]=function(_0x418fbb,_0x1c1c8f,_0x1ecbf6){var _0x4faff5={'raw':![],'where':{}};var _0x3a69a7={};var _0x54cbec={'count':0x0,'rows':[]};return db[_0xabe2('0x4e')][_0xabe2('0x6f')]({'where':{'id':_0x418fbb[_0xabe2('0x53')]['id']}})[_0xabe2('0x21')](handleEntityNotFound(_0x1c1c8f,null))['then'](function(_0x4e5af2){if(_0x4e5af2){_0x3a69a7['model']=_[_0xabe2('0x55')](db[_0xabe2('0x8e')][_0xabe2('0x3b')]);_0x3a69a7['query']=_[_0xabe2('0x55')](_0x418fbb[_0xabe2('0x44')]);_0x3a69a7['filters']=_[_0xabe2('0x43')](_0x3a69a7[_0xabe2('0x3e')],_0x3a69a7[_0xabe2('0x44')]);_0x4faff5['attributes']=_[_0xabe2('0x43')](_0x3a69a7[_0xabe2('0x3e')],qs[_0xabe2('0x45')](_0x418fbb[_0xabe2('0x44')]['fields']));_0x4faff5[_0xabe2('0x42')]=_0x4faff5[_0xabe2('0x42')][_0xabe2('0x56')]?_0x4faff5[_0xabe2('0x42')]:_0x3a69a7[_0xabe2('0x3e')];if(!_0x418fbb[_0xabe2('0x44')]['hasOwnProperty'](_0xabe2('0x67'))){_0x4faff5[_0xabe2('0x31')]=qs[_0xabe2('0x31')](_0x418fbb[_0xabe2('0x44')][_0xabe2('0x31')]);_0x4faff5[_0xabe2('0x2f')]=qs[_0xabe2('0x2f')](_0x418fbb[_0xabe2('0x44')][_0xabe2('0x2f')]);}_0x4faff5[_0xabe2('0x47')]=qs[_0xabe2('0x48')](_0x418fbb[_0xabe2('0x44')][_0xabe2('0x48')]);_0x4faff5[_0xabe2('0x49')]=qs[_0xabe2('0x41')](_[_0xabe2('0x68')](_0x418fbb[_0xabe2('0x44')],_0x3a69a7['filters']));_0x4faff5['where'][_0xabe2('0x64')]=_0x4e5af2['id'];if(_0x418fbb['query'][_0xabe2('0x4a')]){_0x4faff5['where']=_['merge'](_0x4faff5[_0xabe2('0x49')],{'$or':_[_0xabe2('0x3f')](_0x4faff5[_0xabe2('0x42')],function(_0x3238ba){var _0x187505={};_0x187505[_0x3238ba]={'$like':'%'+_0x418fbb['query'][_0xabe2('0x4a')]+'%'};return _0x187505;})});}_0x4faff5=_[_0xabe2('0x4c')]({},_0x4faff5,_0x418fbb['options']);return db[_0xabe2('0x8e')][_0xabe2('0x4f')]({'where':_0x4faff5[_0xabe2('0x49')]})[_0xabe2('0x21')](function(_0x54a778){_0x54cbec['count']=_0x54a778;if(_0x418fbb[_0xabe2('0x44')]['includeAll']){_0x4faff5[_0xabe2('0x57')]=[{'model':db[_0xabe2('0x73')],'as':_0xabe2('0xb1'),'required':![]},{'model':db[_0xabe2('0x9c')],'as':_0xabe2('0xb2'),'attributes':[_0xabe2('0x40'),_0xabe2('0xb3'),_0xabe2('0xb4')],'required':![]},{'model':db[_0xabe2('0xb5')],'as':_0xabe2('0xb6'),'attributes':['id',_0xabe2('0x40'),'color'],'where':_0x418fbb['query'][_0xabe2('0xb7')]?{'id':_0x418fbb['query'][_0xabe2('0xb7')]}:undefined,'required':_0x418fbb['query'][_0xabe2('0xb7')]?!![]:![]}];}return db[_0xabe2('0x8e')][_0xabe2('0x51')](_0x4faff5);})[_0xabe2('0x21')](function(_0x4cafd9){_0x54cbec['rows']=_0x4cafd9;return _0x54cbec;});}})[_0xabe2('0x21')](respondWithFilteredResult(_0x1c1c8f,_0x4faff5))[_0xabe2('0x2a')](handleError(_0x1c1c8f,null));};exports['addAgents']=function(_0x2ddff7,_0x3e297e,_0x1473a5){return db['OpenchannelAccount']['find']({'where':{'id':_0x2ddff7[_0xabe2('0x53')]['id']}})['then'](handleEntityNotFound(_0x3e297e,null))['then'](function(_0x2e4935){if(_0x2e4935){return _0x2e4935[_0xabe2('0xb8')](_0x2ddff7[_0xabe2('0x5a')]['ids'],_['omit'](_0x2ddff7[_0xabe2('0x5a')],['ids','id'])||{})[_0xabe2('0x90')](function(_0x55e2a3){for(var _0x252d61=0x0;_0x252d61<_0x2ddff7[_0xabe2('0x5a')][_0xabe2('0x6b')]['length'];_0x252d61+=0x1){socket[_0xabe2('0xb9')](_0xabe2('0xba'),{'UserId':Number(_0x2ddff7['body'][_0xabe2('0x6b')][_0x252d61]),'OpenchannelAccountId':Number(_0x2ddff7['params']['id'])});}return _0x55e2a3;});}})['then'](respondWithResult(_0x3e297e,null))[_0xabe2('0x2a')](handleError(_0x3e297e,null));};exports[_0xabe2('0xbb')]=function(_0x35b1c9,_0x34be43,_0x4ee51a){return db['OpenchannelAccount'][_0xabe2('0x58')]({'where':{'id':_0x35b1c9[_0xabe2('0x53')]['id']}})[_0xabe2('0x21')](handleEntityNotFound(_0x34be43,null))[_0xabe2('0x21')](function(_0x4dae66){if(_0x4dae66){return _0x4dae66[_0xabe2('0xbb')](_0x35b1c9[_0xabe2('0x44')][_0xabe2('0x6b')])['then'](function(){if(_[_0xabe2('0xbc')](_0x35b1c9['query'][_0xabe2('0x6b')])){for(var _0x1aad0b=0x0;_0x1aad0b<_0x35b1c9[_0xabe2('0x44')][_0xabe2('0x6b')][_0xabe2('0x56')];_0x1aad0b+=0x1){socket[_0xabe2('0xb9')](_0xabe2('0xbd'),{'UserId':Number(_0x35b1c9[_0xabe2('0x44')][_0xabe2('0x6b')][_0x1aad0b]),'OpenchannelAccountId':Number(_0x35b1c9[_0xabe2('0x53')]['id'])});}}else{socket['emit'](_0xabe2('0xbd'),{'UserId':Number(_0x35b1c9[_0xabe2('0x44')][_0xabe2('0x6b')]),'OpenchannelAccountId':Number(_0x35b1c9[_0xabe2('0x53')]['id'])});}});}})[_0xabe2('0x21')](respondWithStatusCode(_0x34be43,null))[_0xabe2('0x2a')](handleError(_0x34be43,null));};exports['getAgents']=function(_0x6e5811,_0x16ec26,_0x24abd6){var _0x4f3324={};var _0x18b7bf={};var _0x422b17;var _0x2743c6;return db[_0xabe2('0x4e')][_0xabe2('0x6f')]({'where':{'id':_0x6e5811['params']['id']}})[_0xabe2('0x21')](handleEntityNotFound(_0x16ec26,null))[_0xabe2('0x21')](function(_0x36cba7){if(_0x36cba7){_0x422b17=_0x36cba7;_0x18b7bf[_0xabe2('0x3e')]=_[_0xabe2('0x55')](db[_0xabe2('0x9c')][_0xabe2('0x3b')]);_0x18b7bf[_0xabe2('0x44')]=_['keys'](_0x6e5811[_0xabe2('0x44')]);_0x18b7bf[_0xabe2('0x41')]=_[_0xabe2('0x43')](_0x18b7bf[_0xabe2('0x3e')],_0x18b7bf['query']);_0x4f3324[_0xabe2('0x42')]=_['intersection'](_0x18b7bf[_0xabe2('0x3e')],qs[_0xabe2('0x45')](_0x6e5811[_0xabe2('0x44')][_0xabe2('0x45')]));_0x4f3324[_0xabe2('0x42')]=_0x4f3324['attributes'][_0xabe2('0x56')]?_0x4f3324['attributes']:_0x18b7bf[_0xabe2('0x3e')];_0x4f3324['order']=qs[_0xabe2('0x48')](_0x6e5811[_0xabe2('0x44')]['sort']);_0x4f3324[_0xabe2('0x49')]=qs[_0xabe2('0x41')](_[_0xabe2('0x68')](_0x6e5811[_0xabe2('0x44')],_0x18b7bf[_0xabe2('0x41')]));if(_0x6e5811[_0xabe2('0x44')]['filter']){_0x4f3324['where']=_[_0xabe2('0x4c')](_0x4f3324[_0xabe2('0x49')],{'$or':_[_0xabe2('0x3f')](_0x4f3324[_0xabe2('0x42')],function(_0x3fc519){var _0xd6b29={};_0xd6b29[_0x3fc519]={'$like':'%'+_0x6e5811[_0xabe2('0x44')]['filter']+'%'};return _0xd6b29;})});}_0x4f3324=_['merge']({},_0x4f3324,_0x6e5811[_0xabe2('0x4d')]);return _0x422b17[_0xabe2('0xbe')](_0x4f3324);}})['then'](function(_0x572795){if(_0x572795){_0x2743c6=_0x572795['length'];if(!_0x6e5811[_0xabe2('0x44')][_0xabe2('0x46')]('nolimit')){_0x4f3324[_0xabe2('0x31')]=qs[_0xabe2('0x31')](_0x6e5811[_0xabe2('0x44')][_0xabe2('0x31')]);_0x4f3324['offset']=qs[_0xabe2('0x2f')](_0x6e5811['query'][_0xabe2('0x2f')]);}return _0x422b17[_0xabe2('0xbe')](_0x4f3324);}})[_0xabe2('0x21')](function(_0x214698){if(_0x214698){return _0x214698?{'count':_0x2743c6,'rows':_0x214698}:null;}})[_0xabe2('0x21')](respondWithResult(_0x16ec26,null))[_0xabe2('0x2a')](handleError(_0x16ec26,null));};exports[_0xabe2('0x39')]=function(_0xb0511f,_0x806225,_0x22d5ee){var _0xd134f9,_0xb25626,_0x3ead3f;if(_[_0xabe2('0x7b')](_0xb0511f['body'][_0xabe2('0x5a')])||_0xb0511f[_0xabe2('0x5a')][_0xabe2('0x5a')]===''){throw new db[(_0xabe2('0x74'))][(_0xabe2('0x7c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xabe2('0x7b')](_0xb0511f[_0xabe2('0x5a')]['to'])){}_0xd134f9=_0xb0511f['body']['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0xb0511f[_0xabe2('0x53')]['id']}})[_0xabe2('0x21')](handleEntityNotFound(_0x806225,null))[_0xabe2('0x21')](function(_0xcb1e1d){if(_0xcb1e1d){return db['OpenchannelAccount'][_0xabe2('0x58')]({'where':{'id':_0xcb1e1d['id']},'include':[{'model':db[_0xabe2('0x80')],'as':_0xabe2('0x86'),'include':[{'model':db['CmContact'],'as':_0xabe2('0x81'),'where':{[_0xcb1e1d[_0xabe2('0x7e')]]:_0xd134f9},'limit':0x1,'order':[[_0xabe2('0x78'),_0xabe2('0xbf')]]}]}]})[_0xabe2('0x21')](handleEntityNotFound(_0x806225,null))[_0xabe2('0x21')](function(_0x112cb5){if(_0x112cb5&&_0x112cb5[_0xabe2('0x86')]){_0xb25626=_0x112cb5['get']({'plain':!![]});if(_0xb25626[_0xabe2('0x86')]&&_0xb25626[_0xabe2('0x86')]['Contacts'][_0xabe2('0x56')]){return _0xb25626[_0xabe2('0x86')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0xabe2('0xc0')](_0xb0511f[_0xabe2('0x5a')],{'firstName':_0xd134f9,[_0x112cb5[_0xabe2('0x7e')]]:_0xd134f9,'phone':_0xd134f9,'ListId':_0xb25626[_0xabe2('0x7a')]}));}})[_0xabe2('0x21')](handleEntityNotFound(_0x806225,null))['then'](function(_0x11f53a){if(_0x11f53a){_0x3ead3f=_0x11f53a;return db[_0xabe2('0x8e')][_0xabe2('0x58')]({'where':{'ContactId':_0x3ead3f['id'],'closed':![],'OpenchannelAccountId':_0xb25626['id']}})[_0xabe2('0x21')](function(_0x37c45b){if(_0x37c45b){return[_0x37c45b,![]];}return db[_0xabe2('0x8e')][_0xabe2('0x59')]({'UserId':_0xb0511f[_0xabe2('0x5c')]['id'],'ContactId':_0x3ead3f['id'],'OpenchannelAccountId':_0xb25626['id'],'lastMsgDirection':_0xabe2('0xc1'),'firstMsgDirection':_0xabe2('0xc1'),'Messages':[_[_0xabe2('0x4c')](_0xb0511f['body'],{'read':![],'body':_0xb0511f[_0xabe2('0x5a')]['body'],'OpenchannelAccountId':_0xb25626['id'],'UserId':_0xb0511f[_0xabe2('0x5c')]['id'],'ContactId':_0x3ead3f['id']})]},{'include':[{'model':db[_0xabe2('0x99')],'as':_0xabe2('0xc2')}]})['then'](function(_0x306fdd){return[_0x306fdd,!![]];});});}})['spread'](function(_0x2c03c8,_0x55dd02){if(_0x55dd02){return _0x2c03c8;}return db[_0xabe2('0x99')][_0xabe2('0x59')](_[_0xabe2('0x4c')](_0xb0511f[_0xabe2('0x5a')],{'read':![],'body':_0xb0511f['body'][_0xabe2('0x5a')],'OpenchannelAccountId':_0xb25626['id'],'OpenchannelInteractionId':_0x2c03c8['id'],'UserId':_0xb0511f[_0xabe2('0x5c')]['id'],'ContactId':_0x3ead3f['id']}))['then'](function(_0xe4fd94){_0x2c03c8[_0xabe2('0xc3')][_0xabe2('0xc2')]=[];_0x2c03c8[_0xabe2('0xc3')][_0xabe2('0xc2')][_0xabe2('0x96')](_0xe4fd94[_0xabe2('0xc3')]);return _0x2c03c8;});});}})[_0xabe2('0x21')](respondWithResult(_0x806225,null))[_0xabe2('0x2a')](handleError(_0x806225,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 7de8051..8b17e4d 100644 --- a/server/api/openchannelAccount/openchannelAccount.events.js +++ b/server/api/openchannelAccount/openchannelAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['save','update','remove','emit','hasOwnProperty','hook','exports','OpenchannelAccount','setMaxListeners'];(function(_0x38cffe,_0x130745){var _0x4152ea=function(_0x5e5f16){while(--_0x5e5f16){_0x38cffe['push'](_0x38cffe['shift']());}};_0x4152ea(++_0x130745);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x49c4('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x49c4('0x1')](0x0);var events={'afterCreate':_0x49c4('0x2'),'afterUpdate':_0x49c4('0x3'),'afterDestroy':_0x49c4('0x4')};function emitEvent(_0x2ad237){return function(_0x4e0313,_0x4941f1,_0x41a183){OpenchannelAccountEvents['emit'](_0x2ad237+':'+_0x4e0313['id'],_0x4e0313);OpenchannelAccountEvents[_0x49c4('0x5')](_0x2ad237,_0x4e0313);_0x41a183(null);};}for(var e in events){if(events[_0x49c4('0x6')](e)){var event=events[e];OpenchannelAccount[_0x49c4('0x7')](e,emitEvent(event));}}module[_0x49c4('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x5b02=['exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','remove','emit','hook'];(function(_0x2c86c8,_0x22ad0d){var _0x1cca4f=function(_0x298d77){while(--_0x298d77){_0x2c86c8['push'](_0x2c86c8['shift']());}};_0x1cca4f(++_0x22ad0d);}(_0x5b02,0xe9));var _0x25b0=function(_0x10fff4,_0x32783b){_0x10fff4=_0x10fff4-0x0;var _0x4d7dda=_0x5b02[_0x10fff4];return _0x4d7dda;};'use strict';var EventEmitter=require(_0x25b0('0x0'));var OpenchannelAccount=require(_0x25b0('0x1'))['db'][_0x25b0('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x25b0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x25b0('0x4')};function emitEvent(_0x53493e){return function(_0x3e1d20,_0x31c9c2,_0x38dc14){OpenchannelAccountEvents[_0x25b0('0x5')](_0x53493e+':'+_0x3e1d20['id'],_0x3e1d20);OpenchannelAccountEvents[_0x25b0('0x5')](_0x53493e,_0x3e1d20);_0x38dc14(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x25b0('0x6')](e,emitEvent(event));}}module[_0x25b0('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 9cf892c..4560488 100644 --- a/server/api/openchannelAccount/openchannelAccount.model.js +++ b/server/api/openchannelAccount/openchannelAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x207e92,_0x3fb511){var _0x1b23e0=function(_0x3b6b41){while(--_0x3b6b41){_0x207e92['push'](_0x207e92['shift']());}};_0x1b23e0(++_0x3fb511);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x3ee789,_0x540fd2){var _0x5d94d9=function(_0x3a98e3){while(--_0x3a98e3){_0x3ee789['push'](_0x3ee789['shift']());}};_0x5d94d9(++_0x540fd2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index 43c4f65..e01a68e 100644 --- a/server/api/openchannelAccount/openchannelAccount.rpc.js +++ b/server/api/openchannelAccount/openchannelAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x593e=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x3f7c01,_0x14de50){var _0x4f0d13=function(_0x23849e){while(--_0x23849e){_0x3f7c01['push'](_0x3f7c01['shift']());}};_0x4f0d13(++_0x14de50);}(_0x593e,0xcb));var _0xe593=function(_0x10e530,_0x50961e){_0x10e530=_0x10e530-0x0;var _0x5332e3=_0x593e[_0x10e530];return _0x5332e3;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var moment=require(_0xe593('0x2'));var BPromise=require(_0xe593('0x3'));var rs=require(_0xe593('0x4'));var fs=require('fs');var Redis=require(_0xe593('0x5'));var db=require(_0xe593('0x6'))['db'];var utils=require(_0xe593('0x7'));var logger=require('../../config/logger')(_0xe593('0x8'));var config=require(_0xe593('0x9'));var jayson=require(_0xe593('0xa'));var client=jayson[_0xe593('0xb')][_0xe593('0xc')]({'port':0x232a});config[_0xe593('0xd')]=_[_0xe593('0xe')](config[_0xe593('0xd')],{'host':_0xe593('0xf'),'port':0x18eb});var socket=require(_0xe593('0x10'))(new Redis(config['redis']));require(_0xe593('0x11'))[_0xe593('0x12')](socket);function respondWithRpcPromise(_0x38d977,_0x5ba75c,_0x5f1222){return new BPromise(function(_0x3032ee,_0xeefe30){return client[_0xe593('0x13')](_0x38d977,_0x5f1222)['then'](function(_0x6a5d4f){logger[_0xe593('0x14')](_0xe593('0x15'),_0x5ba75c,_0xe593('0x16'));logger[_0xe593('0x17')](_0xe593('0x18'),_0x5ba75c,_0xe593('0x16'),JSON[_0xe593('0x19')](_0x6a5d4f));if(_0x6a5d4f[_0xe593('0x1a')]){if(_0x6a5d4f[_0xe593('0x1a')]['code']===0x1f4){logger[_0xe593('0x1a')](_0xe593('0x15'),_0x5ba75c,_0x6a5d4f['error'][_0xe593('0x1b')]);return _0xeefe30(_0x6a5d4f[_0xe593('0x1a')]['message']);}logger[_0xe593('0x1a')](_0xe593('0x15'),_0x5ba75c,_0x6a5d4f[_0xe593('0x1a')][_0xe593('0x1b')]);return _0x3032ee(_0x6a5d4f[_0xe593('0x1a')][_0xe593('0x1b')]);}else{logger['info'](_0xe593('0x15'),_0x5ba75c,_0xe593('0x16'));_0x3032ee(_0x6a5d4f['result'][_0xe593('0x1b')]);}})[_0xe593('0x1c')](function(_0x56b4ff){logger[_0xe593('0x1a')](_0xe593('0x15'),_0x5ba75c,_0x56b4ff);_0xeefe30(_0x56b4ff);});});} \ No newline at end of file +var _0x0102=['debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x2a03d5,_0x318ac3){var _0x4204e5=function(_0x53a977){while(--_0x53a977){_0x2a03d5['push'](_0x2a03d5['shift']());}};_0x4204e5(++_0x318ac3);}(_0x0102,0x186));var _0x2010=function(_0x49c69f,_0x1e0f6a){_0x49c69f=_0x49c69f-0x0;var _0x1b2a78=_0x0102[_0x49c69f];return _0x1b2a78;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var moment=require(_0x2010('0x1'));var BPromise=require(_0x2010('0x2'));var rs=require(_0x2010('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2010('0x4'));var jayson=require(_0x2010('0x5'));var client=jayson[_0x2010('0x6')][_0x2010('0x7')]({'port':0x232a});config['redis']=_[_0x2010('0x8')](config['redis'],{'host':_0x2010('0x9'),'port':0x18eb});var socket=require(_0x2010('0xa'))(new Redis(config['redis']));require(_0x2010('0xb'))[_0x2010('0xc')](socket);function respondWithRpcPromise(_0x3d34d4,_0x3acdbb,_0x1aedbb){return new BPromise(function(_0x2a27b0,_0x289ad4){return client[_0x2010('0xd')](_0x3d34d4,_0x1aedbb)[_0x2010('0xe')](function(_0x39a821){logger[_0x2010('0xf')](_0x2010('0x10'),_0x3acdbb,_0x2010('0x11'));logger[_0x2010('0x12')](_0x2010('0x13'),_0x3acdbb,_0x2010('0x11'),JSON['stringify'](_0x39a821));if(_0x39a821['error']){if(_0x39a821[_0x2010('0x14')][_0x2010('0x15')]===0x1f4){logger[_0x2010('0x14')](_0x2010('0x10'),_0x3acdbb,_0x39a821[_0x2010('0x14')][_0x2010('0x16')]);return _0x289ad4(_0x39a821['error'][_0x2010('0x16')]);}logger[_0x2010('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x3acdbb,_0x39a821[_0x2010('0x14')][_0x2010('0x16')]);return _0x2a27b0(_0x39a821[_0x2010('0x14')][_0x2010('0x16')]);}else{logger[_0x2010('0xf')](_0x2010('0x10'),_0x3acdbb,_0x2010('0x11'));_0x2a27b0(_0x39a821[_0x2010('0x17')][_0x2010('0x16')]);}})['catch'](function(_0x559ed6){logger[_0x2010('0x14')](_0x2010('0x10'),_0x3acdbb,_0x559ed6);_0x289ad4(_0x559ed6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 30ce8ea..16d9621 100644 --- a/server/api/openchannelAccount/openchannelAccount.socket.js +++ b/server/api/openchannelAccount/openchannelAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21a3=['update','emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','remove'];(function(_0x2c3255,_0x4e00ae){var _0x282aba=function(_0x5721d5){while(--_0x5721d5){_0x2c3255['push'](_0x2c3255['shift']());}};_0x282aba(++_0x4e00ae);}(_0x21a3,0x66));var _0x321a=function(_0x3b08de,_0x63ddd0){_0x3b08de=_0x3b08de-0x0;var _0x53fbe4=_0x21a3[_0x3b08de];return _0x53fbe4;};'use strict';var OpenchannelAccountEvents=require(_0x321a('0x0'));var events=['save',_0x321a('0x1'),_0x321a('0x2')];function createListener(_0x1070a2,_0x401ef1){return function(_0x3ad15d){_0x401ef1[_0x321a('0x3')](_0x1070a2,_0x3ad15d);};}function removeListener(_0x5df495,_0x536b51){return function(){OpenchannelAccountEvents[_0x321a('0x4')](_0x5df495,_0x536b51);};}exports[_0x321a('0x5')]=function(_0x467682){for(var _0x28e166=0x0,_0x5f3b81=events[_0x321a('0x6')];_0x28e166<_0x5f3b81;_0x28e166++){var _0x24a04c=events[_0x28e166];var _0x10c1d3=createListener(_0x321a('0x7')+_0x24a04c,_0x467682);OpenchannelAccountEvents['on'](_0x24a04c,_0x10c1d3);}}; \ No newline at end of file +var _0x1cc7=['remove','emit','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x46aceb,_0x18a842){var _0x2b2230=function(_0x3e3ab0){while(--_0x3e3ab0){_0x46aceb['push'](_0x46aceb['shift']());}};_0x2b2230(++_0x18a842);}(_0x1cc7,0x15a));var _0x71cc=function(_0x59a0cf,_0x5623d3){_0x59a0cf=_0x59a0cf-0x0;var _0x56177e=_0x1cc7[_0x59a0cf];return _0x56177e;};'use strict';var OpenchannelAccountEvents=require(_0x71cc('0x0'));var events=[_0x71cc('0x1'),_0x71cc('0x2'),'update'];function createListener(_0x4db9cd,_0x547fe6){return function(_0xe5d54e){_0x547fe6[_0x71cc('0x3')](_0x4db9cd,_0xe5d54e);};}function removeListener(_0x402191,_0x5431e1){return function(){OpenchannelAccountEvents['removeListener'](_0x402191,_0x5431e1);};}exports['register']=function(_0x27a175){for(var _0x4ecf81=0x0,_0xc0444e=events[_0x71cc('0x4')];_0x4ecf81<_0xc0444e;_0x4ecf81++){var _0x4039ce=events[_0x4ecf81];var _0x2e70f0=createListener(_0x71cc('0x5')+_0x4039ce,_0x27a175);OpenchannelAccountEvents['on'](_0x4039ce,_0x2e70f0);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index c9d60a7..1731a8f 100644 --- a/server/api/openchannelApplication/index.js +++ b/server/api/openchannelApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x11ea=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','/:id','show','post','put','update','destroy','multer','util','path','connect-timeout','express'];(function(_0x2d66b4,_0x5ccdbe){var _0x17fc0b=function(_0x2d7228){while(--_0x2d7228){_0x2d66b4['push'](_0x2d66b4['shift']());}};_0x17fc0b(++_0x5ccdbe);}(_0x11ea,0x19d));var _0xa11e=function(_0x1e2058,_0x4daf37){_0x1e2058=_0x1e2058-0x0;var _0x1db307=_0x11ea[_0x1e2058];return _0x1db307;};'use strict';var multer=require(_0xa11e('0x0'));var util=require(_0xa11e('0x1'));var path=require(_0xa11e('0x2'));var timeout=require(_0xa11e('0x3'));var express=require(_0xa11e('0x4'));var router=express[_0xa11e('0x5')]();var fs_extra=require(_0xa11e('0x6'));var auth=require(_0xa11e('0x7'));var interaction=require(_0xa11e('0x8'));var config=require(_0xa11e('0x9'));var controller=require(_0xa11e('0xa'));router['get']('/',auth[_0xa11e('0xb')](),controller[_0xa11e('0xc')]);router['get'](_0xa11e('0xd'),auth['isAuthenticated'](),controller[_0xa11e('0xe')]);router[_0xa11e('0xf')]('/',auth[_0xa11e('0xb')](),controller['create']);router[_0xa11e('0x10')](_0xa11e('0xd'),auth[_0xa11e('0xb')](),controller[_0xa11e('0x11')]);router['delete'](_0xa11e('0xd'),auth[_0xa11e('0xb')](),controller[_0xa11e('0x12')]);module['exports']=router; \ No newline at end of file +var _0x06af=['exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy'];(function(_0x1b9b98,_0x480eec){var _0x2b6c46=function(_0x2b14a9){while(--_0x2b14a9){_0x1b9b98['push'](_0x1b9b98['shift']());}};_0x2b6c46(++_0x480eec);}(_0x06af,0x10b));var _0xf06a=function(_0x167e28,_0x88d4d3){_0x167e28=_0x167e28-0x0;var _0x3c7329=_0x06af[_0x167e28];return _0x3c7329;};'use strict';var multer=require(_0xf06a('0x0'));var util=require(_0xf06a('0x1'));var path=require(_0xf06a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf06a('0x3')]();var fs_extra=require(_0xf06a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf06a('0x5'));var config=require(_0xf06a('0x6'));var controller=require(_0xf06a('0x7'));router[_0xf06a('0x8')]('/',auth[_0xf06a('0x9')](),controller[_0xf06a('0xa')]);router['get'](_0xf06a('0xb'),auth[_0xf06a('0x9')](),controller[_0xf06a('0xc')]);router[_0xf06a('0xd')]('/',auth[_0xf06a('0x9')](),controller[_0xf06a('0xe')]);router[_0xf06a('0xf')]('/:id',auth[_0xf06a('0x9')](),controller[_0xf06a('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf06a('0x11')]);module[_0xf06a('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 699edfa..a8026dc 100644 --- a/server/api/openchannelApplication/openchannelApplication.attributes.js +++ b/server/api/openchannelApplication/openchannelApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84f5=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x179805,_0x17d188){var _0x5654fa=function(_0x2083bb){while(--_0x2083bb){_0x179805['push'](_0x179805['shift']());}};_0x5654fa(++_0x17d188);}(_0x84f5,0xa0));var _0x584f=function(_0x3b8774,_0x301a46){_0x3b8774=_0x3b8774-0x0;var _0x5bcfcc=_0x84f5[_0x3b8774];return _0x5bcfcc;};'use strict';var Sequelize=require('sequelize');module[_0x584f('0x0')]={'priority':{'type':Sequelize[_0x584f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x584f('0x2')],'allowNull':![],'defaultValue':_0x584f('0x3')},'appdata':{'type':Sequelize[_0x584f('0x4')]()},'description':{'type':Sequelize[_0x584f('0x2')]},'interval':{'type':Sequelize[_0x584f('0x2')],'defaultValue':_0x584f('0x5')}}; \ No newline at end of file +var _0x6af7=['STRING','*,*,*,*','sequelize','INTEGER'];(function(_0x415a9e,_0xf52f2f){var _0x33d04c=function(_0x5ee153){while(--_0x5ee153){_0x415a9e['push'](_0x415a9e['shift']());}};_0x33d04c(++_0xf52f2f);}(_0x6af7,0x19e));var _0x76af=function(_0x174295,_0x58f38c){_0x174295=_0x174295-0x0;var _0x5eb7a2=_0x6af7[_0x174295];return _0x5eb7a2;};'use strict';var Sequelize=require(_0x76af('0x0'));module['exports']={'priority':{'type':Sequelize[_0x76af('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x76af('0x2')],'defaultValue':_0x76af('0x3')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 4903e57..6a9df1c 100644 --- a/server/api/openchannelApplication/openchannelApplication.controller.js +++ b/server/api/openchannelApplication/openchannelApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x720f=['hasOwnProperty','nolimit','sort','where','filter','merge','options','OpenchannelApplication','includeAll','findAll','rows','show','fields','include','catch','create','body','find','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','filters','query','intersection','attributes','length'];(function(_0xe075e8,_0x4fe11a){var _0x240582=function(_0xdf5765){while(--_0xdf5765){_0xe075e8['push'](_0xe075e8['shift']());}};_0x240582(++_0x4fe11a);}(_0x720f,0x13b));var _0xf720=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x720f[_0xbe200f];return _0x192597;};'use strict';var emlformat=require(_0xf720('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf720('0x1'));var rp=require(_0xf720('0x2'));var moment=require(_0xf720('0x3'));var BPromise=require(_0xf720('0x4'));var Mustache=require(_0xf720('0x5'));var util=require(_0xf720('0x6'));var path=require('path');var sox=require(_0xf720('0x7'));var csv=require(_0xf720('0x8'));var ejs=require(_0xf720('0x9'));var fs=require('fs');var fs_extra=require(_0xf720('0xa'));var _=require(_0xf720('0xb'));var squel=require('squel');var crypto=require(_0xf720('0xc'));var jsforce=require(_0xf720('0xd'));var deskjs=require(_0xf720('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf720('0xf'));var Papa=require('papaparse');var Redis=require(_0xf720('0x10'));var authService=require(_0xf720('0x11'));var qs=require(_0xf720('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf720('0x13'))(_0xf720('0x14'));var utils=require(_0xf720('0x15'));var config=require(_0xf720('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf720('0x17'))['db'];function respondWithStatusCode(_0x1ffdd9,_0x41afd0){_0x41afd0=_0x41afd0||0xcc;return function(_0x33f369){if(_0x33f369){return _0x1ffdd9[_0xf720('0x18')](_0x41afd0);}return _0x1ffdd9[_0xf720('0x19')](_0x41afd0)['end']();};}function respondWithResult(_0x1be1af,_0x1e3652){_0x1e3652=_0x1e3652||0xc8;return function(_0xe573b9){if(_0xe573b9){return _0x1be1af['status'](_0x1e3652)[_0xf720('0x1a')](_0xe573b9);}};}function respondWithFilteredResult(_0x2f3d71,_0x2ad2db){return function(_0x1d3b7f){if(_0x1d3b7f){var _0xced92=typeof _0x2ad2db[_0xf720('0x1b')]===_0xf720('0x1c')&&typeof _0x2ad2db[_0xf720('0x1d')]==='undefined';var _0x1feba5=_0x1d3b7f[_0xf720('0x1e')];var _0x174841=_0xced92?0x0:_0x2ad2db['offset'];var _0xef4793=_0xced92?_0x1d3b7f[_0xf720('0x1e')]:_0x2ad2db[_0xf720('0x1b')]+_0x2ad2db[_0xf720('0x1d')];var _0x53c75d;if(_0xef4793>=_0x1feba5){_0xef4793=_0x1feba5;_0x53c75d=0xc8;}else{_0x53c75d=0xce;}_0x2f3d71[_0xf720('0x19')](_0x53c75d);return _0x2f3d71[_0xf720('0x1f')](_0xf720('0x20'),_0x174841+'-'+_0xef4793+'/'+_0x1feba5)[_0xf720('0x1a')](_0x1d3b7f);}return null;};}function patchUpdates(_0x26fa26){return function(_0x2a9388){try{jsonpatch['apply'](_0x2a9388,_0x26fa26,!![]);}catch(_0x490344){return BPromise[_0xf720('0x21')](_0x490344);}return _0x2a9388[_0xf720('0x22')]();};}function saveUpdates(_0x176d49,_0x57e18b){return function(_0x5a49bd){if(_0x5a49bd){return _0x5a49bd[_0xf720('0x23')](_0x176d49)[_0xf720('0x24')](function(_0x26993d){return _0x26993d;});}return null;};}function removeEntity(_0x14bab4,_0x5471a0){return function(_0xbcd26a){if(_0xbcd26a){return _0xbcd26a[_0xf720('0x25')]()[_0xf720('0x24')](function(){_0x14bab4[_0xf720('0x19')](0xcc)[_0xf720('0x26')]();});}};}function handleEntityNotFound(_0x1972b9,_0x5b1e4a){return function(_0x4cd164){if(!_0x4cd164){_0x1972b9[_0xf720('0x18')](0x194);}return _0x4cd164;};}function handleError(_0x21820a,_0x5059ee){_0x5059ee=_0x5059ee||0x1f4;return function(_0x4f1d1d){logger[_0xf720('0x27')](_0x4f1d1d[_0xf720('0x28')]);if(_0x4f1d1d[_0xf720('0x29')]){delete _0x4f1d1d['name'];}_0x21820a[_0xf720('0x19')](_0x5059ee)[_0xf720('0x2a')](_0x4f1d1d);};}exports[_0xf720('0x2b')]=function(_0x333f00,_0xf42fe2){var _0x5c8428={},_0x5aa116={},_0x5f335e={'count':0x0,'rows':[]};var _0x5243ef=_[_0xf720('0x2c')](db['OpenchannelApplication'][_0xf720('0x2d')],function(_0xd1ecfc){return{'name':_0xd1ecfc['fieldName'],'type':_0xd1ecfc[_0xf720('0x2e')][_0xf720('0x2f')]};});_0x5aa116[_0xf720('0x30')]=_[_0xf720('0x2c')](_0x5243ef,_0xf720('0x29'));_0x5aa116['query']=_[_0xf720('0x31')](_0x333f00['query']);_0x5aa116[_0xf720('0x32')]=_['intersection'](_0x5aa116[_0xf720('0x30')],_0x5aa116[_0xf720('0x33')]);_0x5c8428['attributes']=_[_0xf720('0x34')](_0x5aa116['model'],qs['fields'](_0x333f00['query']['fields']));_0x5c8428[_0xf720('0x35')]=_0x5c8428[_0xf720('0x35')][_0xf720('0x36')]?_0x5c8428[_0xf720('0x35')]:_0x5aa116[_0xf720('0x30')];if(!_0x333f00[_0xf720('0x33')][_0xf720('0x37')](_0xf720('0x38'))){_0x5c8428[_0xf720('0x1d')]=qs[_0xf720('0x1d')](_0x333f00[_0xf720('0x33')][_0xf720('0x1d')]);_0x5c8428['offset']=qs[_0xf720('0x1b')](_0x333f00['query'][_0xf720('0x1b')]);}_0x5c8428['order']=qs[_0xf720('0x39')](_0x333f00[_0xf720('0x33')]['sort']);_0x5c8428[_0xf720('0x3a')]=qs[_0xf720('0x32')](_['pick'](_0x333f00['query'],_0x5aa116[_0xf720('0x32')]),_0x5243ef);if(_0x333f00['query'][_0xf720('0x3b')]){_0x5c8428[_0xf720('0x3a')]=_[_0xf720('0x3c')](_0x5c8428[_0xf720('0x3a')],{'$or':_[_0xf720('0x2c')](_0x5243ef,function(_0x1bc3c1){if(_0x1bc3c1[_0xf720('0x2e')]!=='VIRTUAL'){var _0x3a5d2c={};_0x3a5d2c[_0x1bc3c1[_0xf720('0x29')]]={'$like':'%'+_0x333f00[_0xf720('0x33')][_0xf720('0x3b')]+'%'};return _0x3a5d2c;}})});}_0x5c8428=_[_0xf720('0x3c')]({},_0x5c8428,_0x333f00[_0xf720('0x3d')]);var _0x2b43f0={'where':_0x5c8428[_0xf720('0x3a')]};return db[_0xf720('0x3e')]['count'](_0x2b43f0)[_0xf720('0x24')](function(_0x4d1095){_0x5f335e[_0xf720('0x1e')]=_0x4d1095;if(_0x333f00[_0xf720('0x33')][_0xf720('0x3f')]){_0x5c8428['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0xf720('0x40')](_0x5c8428);})['then'](function(_0x1319c5){_0x5f335e[_0xf720('0x41')]=_0x1319c5;return _0x5f335e;})[_0xf720('0x24')](respondWithFilteredResult(_0xf42fe2,_0x5c8428))['catch'](handleError(_0xf42fe2,null));};exports[_0xf720('0x42')]=function(_0x1cce91,_0x3360a6){var _0x129c1b={'raw':!![],'where':{'id':_0x1cce91['params']['id']}},_0x3f6c6e={};_0x3f6c6e[_0xf720('0x30')]=_[_0xf720('0x31')](db[_0xf720('0x3e')][_0xf720('0x2d')]);_0x3f6c6e['query']=_[_0xf720('0x31')](_0x1cce91[_0xf720('0x33')]);_0x3f6c6e[_0xf720('0x32')]=_[_0xf720('0x34')](_0x3f6c6e[_0xf720('0x30')],_0x3f6c6e['query']);_0x129c1b['attributes']=_['intersection'](_0x3f6c6e[_0xf720('0x30')],qs[_0xf720('0x43')](_0x1cce91['query'][_0xf720('0x43')]));_0x129c1b[_0xf720('0x35')]=_0x129c1b[_0xf720('0x35')][_0xf720('0x36')]?_0x129c1b[_0xf720('0x35')]:_0x3f6c6e['model'];if(_0x1cce91['query'][_0xf720('0x3f')]){_0x129c1b[_0xf720('0x44')]=[{'all':!![]}];}_0x129c1b=_[_0xf720('0x3c')]({},_0x129c1b,_0x1cce91[_0xf720('0x3d')]);return db[_0xf720('0x3e')]['find'](_0x129c1b)[_0xf720('0x24')](handleEntityNotFound(_0x3360a6,null))[_0xf720('0x24')](respondWithResult(_0x3360a6,null))[_0xf720('0x45')](handleError(_0x3360a6,null));};exports['create']=function(_0x1b7f65,_0x4e3232){return db[_0xf720('0x3e')][_0xf720('0x46')](_0x1b7f65[_0xf720('0x47')],{})[_0xf720('0x24')](respondWithResult(_0x4e3232,0xc9))[_0xf720('0x45')](handleError(_0x4e3232,null));};exports[_0xf720('0x23')]=function(_0x48cb42,_0x522c56){if(_0x48cb42['body']['id']){delete _0x48cb42['body']['id'];}return db[_0xf720('0x3e')][_0xf720('0x48')]({'where':{'id':_0x48cb42[_0xf720('0x49')]['id']}})[_0xf720('0x24')](handleEntityNotFound(_0x522c56,null))[_0xf720('0x24')](saveUpdates(_0x48cb42[_0xf720('0x47')],null))['then'](respondWithResult(_0x522c56,null))[_0xf720('0x45')](handleError(_0x522c56,null));};exports[_0xf720('0x25')]=function(_0x3e7cc9,_0xc99381){return db['OpenchannelApplication'][_0xf720('0x48')]({'where':{'id':_0x3e7cc9[_0xf720('0x49')]['id']}})[_0xf720('0x24')](handleEntityNotFound(_0xc99381,null))[_0xf720('0x24')](removeEntity(_0xc99381,null))['catch'](handleError(_0xc99381,null));}; \ No newline at end of file +var _0x4024=['findAll','rows','catch','show','params','length','include','find','create','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','set','Content-Range','json','reject','save','then','destroy','stack','name','send','index','map','OpenchannelApplication','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','options','count'];(function(_0x2cbc6d,_0x2f5826){var _0x1527f0=function(_0x577a0c){while(--_0x577a0c){_0x2cbc6d['push'](_0x2cbc6d['shift']());}};_0x1527f0(++_0x2f5826);}(_0x4024,0xec));var _0x4402=function(_0x321815,_0x5a3407){_0x321815=_0x321815-0x0;var _0x31ebcd=_0x4024[_0x321815];return _0x31ebcd;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4402('0x1'));var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require(_0x4402('0x4'));var BPromise=require(_0x4402('0x5'));var Mustache=require(_0x4402('0x6'));var util=require(_0x4402('0x7'));var path=require('path');var sox=require(_0x4402('0x8'));var csv=require(_0x4402('0x9'));var ejs=require(_0x4402('0xa'));var fs=require('fs');var fs_extra=require(_0x4402('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4402('0xc'));var jsforce=require(_0x4402('0xd'));var deskjs=require(_0x4402('0xe'));var toCsv=require(_0x4402('0x9'));var querystring=require(_0x4402('0xf'));var Papa=require(_0x4402('0x10'));var Redis=require(_0x4402('0x11'));var authService=require(_0x4402('0x12'));var qs=require(_0x4402('0x13'));var as=require(_0x4402('0x14'));var hardwareService=require(_0x4402('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4402('0x16'));var licenseUtil=require(_0x4402('0x17'));var db=require(_0x4402('0x18'))['db'];function respondWithStatusCode(_0x14be5b,_0x23081c){_0x23081c=_0x23081c||0xcc;return function(_0x39db85){if(_0x39db85){return _0x14be5b[_0x4402('0x19')](_0x23081c);}return _0x14be5b[_0x4402('0x1a')](_0x23081c)[_0x4402('0x1b')]();};}function respondWithResult(_0x2c1da2,_0x1b9ddc){_0x1b9ddc=_0x1b9ddc||0xc8;return function(_0x50ca28){if(_0x50ca28){return _0x2c1da2['status'](_0x1b9ddc)['json'](_0x50ca28);}};}function respondWithFilteredResult(_0x387a54,_0x86a723){return function(_0x58c249){if(_0x58c249){var _0x4cc11a=typeof _0x86a723['offset']===_0x4402('0x1c')&&typeof _0x86a723[_0x4402('0x1d')]===_0x4402('0x1c');var _0x2ac13b=_0x58c249['count'];var _0x2b768a=_0x4cc11a?0x0:_0x86a723['offset'];var _0x5d0b3c=_0x4cc11a?_0x58c249['count']:_0x86a723['offset']+_0x86a723[_0x4402('0x1d')];var _0x46d55d;if(_0x5d0b3c>=_0x2ac13b){_0x5d0b3c=_0x2ac13b;_0x46d55d=0xc8;}else{_0x46d55d=0xce;}_0x387a54[_0x4402('0x1a')](_0x46d55d);return _0x387a54[_0x4402('0x1e')](_0x4402('0x1f'),_0x2b768a+'-'+_0x5d0b3c+'/'+_0x2ac13b)[_0x4402('0x20')](_0x58c249);}return null;};}function patchUpdates(_0x1b0a77){return function(_0x13268e){try{jsonpatch['apply'](_0x13268e,_0x1b0a77,!![]);}catch(_0x18fce7){return BPromise[_0x4402('0x21')](_0x18fce7);}return _0x13268e[_0x4402('0x22')]();};}function saveUpdates(_0x594385,_0x54f269){return function(_0x475c5b){if(_0x475c5b){return _0x475c5b['update'](_0x594385)[_0x4402('0x23')](function(_0x219460){return _0x219460;});}return null;};}function removeEntity(_0x128a23,_0x1df16a){return function(_0x4eea06){if(_0x4eea06){return _0x4eea06[_0x4402('0x24')]()[_0x4402('0x23')](function(){_0x128a23[_0x4402('0x1a')](0xcc)[_0x4402('0x1b')]();});}};}function handleEntityNotFound(_0x15b7a1,_0x1139e9){return function(_0x211006){if(!_0x211006){_0x15b7a1[_0x4402('0x19')](0x194);}return _0x211006;};}function handleError(_0x5eaa35,_0x4f1af8){_0x4f1af8=_0x4f1af8||0x1f4;return function(_0x16c66a){logger['error'](_0x16c66a[_0x4402('0x25')]);if(_0x16c66a[_0x4402('0x26')]){delete _0x16c66a[_0x4402('0x26')];}_0x5eaa35[_0x4402('0x1a')](_0x4f1af8)[_0x4402('0x27')](_0x16c66a);};}exports[_0x4402('0x28')]=function(_0x54060e,_0x1e94b6){var _0x18e597={},_0x2933d4={},_0x4efe5c={'count':0x0,'rows':[]};var _0x5dd54e=_[_0x4402('0x29')](db[_0x4402('0x2a')][_0x4402('0x2b')],function(_0x253fa5){return{'name':_0x253fa5['fieldName'],'type':_0x253fa5[_0x4402('0x2c')]['key']};});_0x2933d4['model']=_['map'](_0x5dd54e,_0x4402('0x26'));_0x2933d4[_0x4402('0x2d')]=_[_0x4402('0x2e')](_0x54060e[_0x4402('0x2d')]);_0x2933d4[_0x4402('0x2f')]=_[_0x4402('0x30')](_0x2933d4[_0x4402('0x31')],_0x2933d4[_0x4402('0x2d')]);_0x18e597[_0x4402('0x32')]=_['intersection'](_0x2933d4['model'],qs[_0x4402('0x33')](_0x54060e['query'][_0x4402('0x33')]));_0x18e597[_0x4402('0x32')]=_0x18e597[_0x4402('0x32')]['length']?_0x18e597[_0x4402('0x32')]:_0x2933d4['model'];if(!_0x54060e[_0x4402('0x2d')][_0x4402('0x34')](_0x4402('0x35'))){_0x18e597[_0x4402('0x1d')]=qs['limit'](_0x54060e['query'][_0x4402('0x1d')]);_0x18e597[_0x4402('0x36')]=qs['offset'](_0x54060e['query']['offset']);}_0x18e597[_0x4402('0x37')]=qs[_0x4402('0x38')](_0x54060e[_0x4402('0x2d')][_0x4402('0x38')]);_0x18e597['where']=qs['filters'](_[_0x4402('0x39')](_0x54060e[_0x4402('0x2d')],_0x2933d4[_0x4402('0x2f')]),_0x5dd54e);if(_0x54060e['query'][_0x4402('0x3a')]){_0x18e597[_0x4402('0x3b')]=_[_0x4402('0x3c')](_0x18e597[_0x4402('0x3b')],{'$or':_[_0x4402('0x29')](_0x5dd54e,function(_0x7e660a){if(_0x7e660a[_0x4402('0x2c')]!==_0x4402('0x3d')){var _0xb0d100={};_0xb0d100[_0x7e660a['name']]={'$like':'%'+_0x54060e[_0x4402('0x2d')][_0x4402('0x3a')]+'%'};return _0xb0d100;}})});}_0x18e597=_['merge']({},_0x18e597,_0x54060e[_0x4402('0x3e')]);var _0x5787af={'where':_0x18e597[_0x4402('0x3b')]};return db[_0x4402('0x2a')][_0x4402('0x3f')](_0x5787af)[_0x4402('0x23')](function(_0x1de4f2){_0x4efe5c[_0x4402('0x3f')]=_0x1de4f2;if(_0x54060e[_0x4402('0x2d')]['includeAll']){_0x18e597['include']=[{'all':!![]}];}return db[_0x4402('0x2a')][_0x4402('0x40')](_0x18e597);})['then'](function(_0x54cb75){_0x4efe5c[_0x4402('0x41')]=_0x54cb75;return _0x4efe5c;})['then'](respondWithFilteredResult(_0x1e94b6,_0x18e597))[_0x4402('0x42')](handleError(_0x1e94b6,null));};exports[_0x4402('0x43')]=function(_0x100d9f,_0x2ad458){var _0x5a0f3f={'raw':!![],'where':{'id':_0x100d9f[_0x4402('0x44')]['id']}},_0x37ff3f={};_0x37ff3f['model']=_['keys'](db[_0x4402('0x2a')][_0x4402('0x2b')]);_0x37ff3f[_0x4402('0x2d')]=_[_0x4402('0x2e')](_0x100d9f[_0x4402('0x2d')]);_0x37ff3f[_0x4402('0x2f')]=_[_0x4402('0x30')](_0x37ff3f[_0x4402('0x31')],_0x37ff3f[_0x4402('0x2d')]);_0x5a0f3f[_0x4402('0x32')]=_['intersection'](_0x37ff3f[_0x4402('0x31')],qs[_0x4402('0x33')](_0x100d9f[_0x4402('0x2d')][_0x4402('0x33')]));_0x5a0f3f[_0x4402('0x32')]=_0x5a0f3f[_0x4402('0x32')][_0x4402('0x45')]?_0x5a0f3f['attributes']:_0x37ff3f[_0x4402('0x31')];if(_0x100d9f[_0x4402('0x2d')]['includeAll']){_0x5a0f3f[_0x4402('0x46')]=[{'all':!![]}];}_0x5a0f3f=_[_0x4402('0x3c')]({},_0x5a0f3f,_0x100d9f[_0x4402('0x3e')]);return db[_0x4402('0x2a')][_0x4402('0x47')](_0x5a0f3f)[_0x4402('0x23')](handleEntityNotFound(_0x2ad458,null))[_0x4402('0x23')](respondWithResult(_0x2ad458,null))[_0x4402('0x42')](handleError(_0x2ad458,null));};exports[_0x4402('0x48')]=function(_0x2822cd,_0x39e55d){return db[_0x4402('0x2a')]['create'](_0x2822cd['body'],{})[_0x4402('0x23')](respondWithResult(_0x39e55d,0xc9))[_0x4402('0x42')](handleError(_0x39e55d,null));};exports[_0x4402('0x49')]=function(_0x5d5244,_0x50a526){if(_0x5d5244[_0x4402('0x4a')]['id']){delete _0x5d5244[_0x4402('0x4a')]['id'];}return db[_0x4402('0x2a')]['find']({'where':{'id':_0x5d5244[_0x4402('0x44')]['id']}})[_0x4402('0x23')](handleEntityNotFound(_0x50a526,null))[_0x4402('0x23')](saveUpdates(_0x5d5244[_0x4402('0x4a')],null))[_0x4402('0x23')](respondWithResult(_0x50a526,null))['catch'](handleError(_0x50a526,null));};exports[_0x4402('0x24')]=function(_0x2e0d63,_0x382cf5){return db[_0x4402('0x2a')][_0x4402('0x47')]({'where':{'id':_0x2e0d63[_0x4402('0x44')]['id']}})[_0x4402('0x23')](handleEntityNotFound(_0x382cf5,null))[_0x4402('0x23')](removeEntity(_0x382cf5,null))[_0x4402('0x42')](handleError(_0x382cf5,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index fe323a0..1f53757 100644 --- a/server/api/openchannelApplication/openchannelApplication.model.js +++ b/server/api/openchannelApplication/openchannelApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb56c=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x2eb35d,_0x4a7a45){var _0x1f9854=function(_0x5eb6f9){while(--_0x5eb6f9){_0x2eb35d['push'](_0x2eb35d['shift']());}};_0x1f9854(++_0x4a7a45);}(_0xb56c,0x94));var _0xcb56=function(_0x2ecb67,_0x8ec62d){_0x2ecb67=_0x2ecb67-0x0;var _0x168079=_0xb56c[_0x2ecb67];return _0x168079;};'use strict';var _=require(_0xcb56('0x0'));var util=require(_0xcb56('0x1'));var logger=require(_0xcb56('0x2'))(_0xcb56('0x3'));var moment=require(_0xcb56('0x4'));var BPromise=require(_0xcb56('0x5'));var rp=require(_0xcb56('0x6'));var fs=require('fs');var path=require(_0xcb56('0x7'));var rimraf=require(_0xcb56('0x8'));var config=require(_0xcb56('0x9'));var attributes=require(_0xcb56('0xa'));module[_0xcb56('0xb')]=function(_0x4afc55,_0x4206e4){return _0x4afc55[_0xcb56('0xc')](_0xcb56('0xd'),attributes,{'tableName':_0xcb56('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcb56('0xf'),'collate':_0xcb56('0x10')});}; \ No newline at end of file +var _0x5aeb=['lodash','../../config/logger','api','bluebird','path','rimraf','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci'];(function(_0x522233,_0x164305){var _0x119914=function(_0x4ad447){while(--_0x4ad447){_0x522233['push'](_0x522233['shift']());}};_0x119914(++_0x164305);}(_0x5aeb,0x198));var _0xb5ae=function(_0xf2c0e7,_0x3ff74e){_0xf2c0e7=_0xf2c0e7-0x0;var _0x3add48=_0x5aeb[_0xf2c0e7];return _0x3add48;};'use strict';var _=require(_0xb5ae('0x0'));var util=require('util');var logger=require(_0xb5ae('0x1'))(_0xb5ae('0x2'));var moment=require('moment');var BPromise=require(_0xb5ae('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb5ae('0x4'));var rimraf=require(_0xb5ae('0x5'));var config=require('../../config/environment');var attributes=require(_0xb5ae('0x6'));module[_0xb5ae('0x7')]=function(_0x1706eb,_0x4d18b7){return _0x1706eb[_0xb5ae('0x8')](_0xb5ae('0x9'),attributes,{'tableName':_0xb5ae('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb5ae('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index d559df9..b2070c0 100644 --- a/server/api/openchannelApplication/openchannelApplication.rpc.js +++ b/server/api/openchannelApplication/openchannelApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf9d5=['code','error','message','result','catch','OpenchannelApplication','update','body','options','raw','where','attributes','limit','UpdateOpenchannelApplication','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0xf9d5,0x1e0));var _0x5f9d=function(_0x4bc873,_0x2e2c33){_0x4bc873=_0x4bc873-0x0;var _0x1faa4e=_0xf9d5[_0x4bc873];return _0x1faa4e;};'use strict';var _=require('lodash');var util=require(_0x5f9d('0x0'));var moment=require(_0x5f9d('0x1'));var BPromise=require(_0x5f9d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f9d('0x3'));var db=require(_0x5f9d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f9d('0x5'))(_0x5f9d('0x6'));var config=require(_0x5f9d('0x7'));var jayson=require(_0x5f9d('0x8'));var client=jayson[_0x5f9d('0x9')][_0x5f9d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29f40d,_0xe5b654,_0x2ad682){return new BPromise(function(_0x2c3152,_0x10047d){return client[_0x5f9d('0xb')](_0x29f40d,_0x2ad682)['then'](function(_0x1a4f7c){logger[_0x5f9d('0xc')](_0x5f9d('0xd'),_0xe5b654,_0x5f9d('0xe'));logger[_0x5f9d('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0xe5b654,_0x5f9d('0xe'),JSON['stringify'](_0x1a4f7c));if(_0x1a4f7c['error']){if(_0x1a4f7c['error'][_0x5f9d('0x10')]===0x1f4){logger[_0x5f9d('0x11')](_0x5f9d('0xd'),_0xe5b654,_0x1a4f7c[_0x5f9d('0x11')][_0x5f9d('0x12')]);return _0x10047d(_0x1a4f7c[_0x5f9d('0x11')][_0x5f9d('0x12')]);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0xe5b654,_0x1a4f7c['error'][_0x5f9d('0x12')]);return _0x2c3152(_0x1a4f7c[_0x5f9d('0x11')][_0x5f9d('0x12')]);}else{logger[_0x5f9d('0xc')](_0x5f9d('0xd'),_0xe5b654,_0x5f9d('0xe'));_0x2c3152(_0x1a4f7c[_0x5f9d('0x13')]['message']);}})[_0x5f9d('0x14')](function(_0x58852c){logger[_0x5f9d('0x11')](_0x5f9d('0xd'),_0xe5b654,_0x58852c);_0x10047d(_0x58852c);});});}exports['UpdateOpenchannelApplication']=function(_0x3f79a0){var _0xb40727=this;return new Promise(function(_0x4ee6b1,_0x102b26){return db[_0x5f9d('0x15')][_0x5f9d('0x16')](_0x3f79a0[_0x5f9d('0x17')],{'raw':_0x3f79a0[_0x5f9d('0x18')]?_0x3f79a0[_0x5f9d('0x18')][_0x5f9d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f79a0[_0x5f9d('0x18')]?_0x3f79a0[_0x5f9d('0x18')][_0x5f9d('0x1a')]||null:null,'attributes':_0x3f79a0[_0x5f9d('0x18')]?_0x3f79a0[_0x5f9d('0x18')][_0x5f9d('0x1b')]||null:null,'limit':_0x3f79a0['options']?_0x3f79a0[_0x5f9d('0x18')][_0x5f9d('0x1c')]||null:null})['then'](function(_0x234abe){logger[_0x5f9d('0xc')](_0x5f9d('0x1d'),_0x3f79a0);logger[_0x5f9d('0xf')](_0x5f9d('0x1d'),_0x3f79a0,JSON[_0x5f9d('0x1e')](_0x234abe));_0x4ee6b1(_0x234abe);})[_0x5f9d('0x14')](function(_0x145fa2){logger['error'](_0x5f9d('0x1d'),_0x145fa2[_0x5f9d('0x12')],_0x3f79a0);_0x102b26(_0xb40727[_0x5f9d('0x11')](0x1f4,_0x145fa2[_0x5f9d('0x12')]));});});}; \ No newline at end of file +var _0x272d=['error','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x561794,_0xe1a33e){var _0x1ccaaf=function(_0x1eb185){while(--_0x1eb185){_0x561794['push'](_0x561794['shift']());}};_0x1ccaaf(++_0xe1a33e);}(_0x272d,0x88));var _0xd272=function(_0x496793,_0x30065b){_0x496793=_0x496793-0x0;var _0x1a775c=_0x272d[_0x496793];return _0x1a775c;};'use strict';var _=require(_0xd272('0x0'));var util=require(_0xd272('0x1'));var moment=require(_0xd272('0x2'));var BPromise=require(_0xd272('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd272('0x4'))['db'];var utils=require(_0xd272('0x5'));var logger=require(_0xd272('0x6'))('rpc');var config=require(_0xd272('0x7'));var jayson=require(_0xd272('0x8'));var client=jayson[_0xd272('0x9')][_0xd272('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32bc5f,_0x25c54f,_0x31178a){return new BPromise(function(_0x2334fb,_0x28f5c5){return client[_0xd272('0xb')](_0x32bc5f,_0x31178a)[_0xd272('0xc')](function(_0x116730){logger[_0xd272('0xd')](_0xd272('0xe'),_0x25c54f,'request\x20sent');logger[_0xd272('0xf')](_0xd272('0x10'),_0x25c54f,_0xd272('0x11'),JSON[_0xd272('0x12')](_0x116730));if(_0x116730[_0xd272('0x13')]){if(_0x116730['error']['code']===0x1f4){logger[_0xd272('0x13')](_0xd272('0xe'),_0x25c54f,_0x116730['error'][_0xd272('0x14')]);return _0x28f5c5(_0x116730[_0xd272('0x13')]['message']);}logger[_0xd272('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x25c54f,_0x116730[_0xd272('0x13')][_0xd272('0x14')]);return _0x2334fb(_0x116730['error'][_0xd272('0x14')]);}else{logger[_0xd272('0xd')](_0xd272('0xe'),_0x25c54f,_0xd272('0x11'));_0x2334fb(_0x116730[_0xd272('0x15')][_0xd272('0x14')]);}})[_0xd272('0x16')](function(_0x112a06){logger[_0xd272('0x13')](_0xd272('0xe'),_0x25c54f,_0x112a06);_0x28f5c5(_0x112a06);});});}exports[_0xd272('0x17')]=function(_0x220b56){var _0x1a267d=this;return new Promise(function(_0x314234,_0x42be01){return db[_0xd272('0x18')][_0xd272('0x19')](_0x220b56[_0xd272('0x1a')],{'raw':_0x220b56[_0xd272('0x1b')]?_0x220b56['options'][_0xd272('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x220b56[_0xd272('0x1b')]?_0x220b56['options']['where']||null:null,'attributes':_0x220b56[_0xd272('0x1b')]?_0x220b56[_0xd272('0x1b')][_0xd272('0x1d')]||null:null,'limit':_0x220b56[_0xd272('0x1b')]?_0x220b56[_0xd272('0x1b')][_0xd272('0x1e')]||null:null})[_0xd272('0xc')](function(_0x356381){logger[_0xd272('0xd')]('UpdateOpenchannelApplication',_0x220b56);logger['debug']('UpdateOpenchannelApplication',_0x220b56,JSON['stringify'](_0x356381));_0x314234(_0x356381);})[_0xd272('0x16')](function(_0x3837fc){logger[_0xd272('0x13')](_0xd272('0x17'),_0x3837fc[_0xd272('0x14')],_0x220b56);_0x42be01(_0x1a267d['error'](0x1f4,_0x3837fc[_0xd272('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 05cffea..fdfaa5f 100644 --- a/server/api/openchannelInteraction/index.js +++ b/server/api/openchannelInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7ad=['download','post','addMessage','tracked','openchannel','put','update','delete','destroy','/:id/tags','removeTags','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download'];(function(_0x30198a,_0x4a4407){var _0x127066=function(_0x3650ec){while(--_0x3650ec){_0x30198a['push'](_0x30198a['shift']());}};_0x127066(++_0x4a4407);}(_0xf7ad,0x107));var _0xdf7a=function(_0x5073e6,_0x56b79d){_0x5073e6=_0x5073e6-0x0;var _0x247776=_0xf7ad[_0x5073e6];return _0x247776;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdf7a('0x0'));var timeout=require(_0xdf7a('0x1'));var express=require(_0xdf7a('0x2'));var router=express[_0xdf7a('0x3')]();var fs_extra=require(_0xdf7a('0x4'));var auth=require(_0xdf7a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdf7a('0x6'));var controller=require(_0xdf7a('0x7'));router['get']('/',auth[_0xdf7a('0x8')](),controller['index']);router[_0xdf7a('0x9')](_0xdf7a('0xa'),auth[_0xdf7a('0x8')](),controller[_0xdf7a('0xb')]);router['get'](_0xdf7a('0xc'),auth['isAuthenticated'](),controller[_0xdf7a('0xd')]);router['get'](_0xdf7a('0xe'),auth[_0xdf7a('0x8')](),controller[_0xdf7a('0xf')]);router[_0xdf7a('0x9')](_0xdf7a('0x10'),auth[_0xdf7a('0x8')](),controller[_0xdf7a('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdf7a('0x12')](_0xdf7a('0xe'),auth[_0xdf7a('0x8')](),controller[_0xdf7a('0x13')]);router[_0xdf7a('0x12')]('/:id/tags',auth[_0xdf7a('0x8')](),interaction[_0xdf7a('0x14')](_0xdf7a('0x15'),'openchannelinteraction:addtags'),controller['addTags']);router[_0xdf7a('0x16')](_0xdf7a('0xc'),auth[_0xdf7a('0x8')](),interaction['tracked'](_0xdf7a('0x15'),'openchannelinteraction:update'),controller[_0xdf7a('0x17')]);router[_0xdf7a('0x18')](_0xdf7a('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0xdf7a('0x15'),'openchannelinteraction:destroy'),controller[_0xdf7a('0x19')]);router[_0xdf7a('0x18')](_0xdf7a('0x1a'),auth['isAuthenticated'](),controller[_0xdf7a('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x3043=['express','Router','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','post','create','/:id/messages','addMessage','tracked','openchannel','openchannelinteraction:addtags','addTags','update','delete','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout'];(function(_0x50b739,_0x13275f){var _0x192627=function(_0x2db4bd){while(--_0x2db4bd){_0x50b739['push'](_0x50b739['shift']());}};_0x192627(++_0x13275f);}(_0x3043,0x1e9));var _0x3304=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x3043[_0xda464c];return _0x19e222;};'use strict';var multer=require(_0x3304('0x0'));var util=require(_0x3304('0x1'));var path=require(_0x3304('0x2'));var timeout=require(_0x3304('0x3'));var express=require(_0x3304('0x4'));var router=express[_0x3304('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3304('0x6'));router[_0x3304('0x7')]('/',auth[_0x3304('0x8')](),controller[_0x3304('0x9')]);router[_0x3304('0x7')](_0x3304('0xa'),auth[_0x3304('0x8')](),controller['describe']);router[_0x3304('0x7')](_0x3304('0xb'),auth[_0x3304('0x8')](),controller[_0x3304('0xc')]);router['get']('/:id/messages',auth[_0x3304('0x8')](),controller['getMessages']);router[_0x3304('0x7')](_0x3304('0xd'),auth[_0x3304('0x8')](),controller[_0x3304('0xe')]);router[_0x3304('0xf')]('/',auth['isAuthenticated'](),controller[_0x3304('0x10')]);router['post'](_0x3304('0x11'),auth['isAuthenticated'](),controller[_0x3304('0x12')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0x3304('0x13')](_0x3304('0x14'),_0x3304('0x15')),controller[_0x3304('0x16')]);router['put'](_0x3304('0xb'),auth[_0x3304('0x8')](),interaction[_0x3304('0x13')]('openchannel','openchannelinteraction:update'),controller[_0x3304('0x17')]);router[_0x3304('0x18')](_0x3304('0xb'),auth[_0x3304('0x8')](),interaction[_0x3304('0x13')](_0x3304('0x14'),'openchannelinteraction:destroy'),controller[_0x3304('0x19')]);router[_0x3304('0x18')](_0x3304('0x1a'),auth[_0x3304('0x8')](),controller[_0x3304('0x1b')]);module[_0x3304('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index b70ef39..ec702b4 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.attributes.js +++ b/server/api/openchannelInteraction/openchannelInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d6d=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x236374,_0x1c10c0){var _0x3fdd32=function(_0x49afe0){while(--_0x49afe0){_0x236374['push'](_0x236374['shift']());}};_0x3fdd32(++_0x1c10c0);}(_0x2d6d,0x66));var _0xd2d6=function(_0x99facc,_0x548cd6){_0x99facc=_0x99facc-0x0;var _0xd39ed0=_0x2d6d[_0x99facc];return _0xd39ed0;};'use strict';var Sequelize=require(_0xd2d6('0x0'));module[_0xd2d6('0x1')]={'closed':{'type':Sequelize[_0xd2d6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd2d6('0x3')]},'disposition':{'type':Sequelize[_0xd2d6('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd2d6('0x4')]},'read1stAt':{'type':Sequelize[_0xd2d6('0x3')]},'threadId':{'type':Sequelize[_0xd2d6('0x4')]},'externalUrl':{'type':Sequelize[_0xd2d6('0x4')]},'lastMsgAt':{'type':Sequelize[_0xd2d6('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xd2d6('0x5')]('in',_0xd2d6('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xd2d6('0x5')]('in',_0xd2d6('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xd2d6('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x3d3b=['BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3d3b,0x1af));var _0xb3d3=function(_0x213721,_0xc41653){_0x213721=_0x213721-0x0;var _0x6435ee=_0x3d3b[_0x213721];return _0x6435ee;};'use strict';var Sequelize=require(_0xb3d3('0x0'));module['exports']={'closed':{'type':Sequelize[_0xb3d3('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb3d3('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb3d3('0x3')]},'note':{'type':Sequelize[_0xb3d3('0x3')]},'read1stAt':{'type':Sequelize[_0xb3d3('0x2')]},'threadId':{'type':Sequelize[_0xb3d3('0x3')]},'externalUrl':{'type':Sequelize[_0xb3d3('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xb3d3('0x4')]('in',_0xb3d3('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xb3d3('0x4')]('in',_0xb3d3('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xb3d3('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 9e8492f..3b78f49 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.controller.js +++ b/server/api/openchannelInteraction/openchannelInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe7f7=['sendStatus','status','end','json','offset','limit','count','set','Content-Range','update','destroy','then','error','stack','name','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','query','user','catch','show','from','params','model','keys','filters','intersection','fields','attributes','length','includeAll','options','find','create','body','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','merge','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','spread','Tag','color','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','createdAt','secret','read','OpenchannelAccount','Account','Owner','mkdirSync','Openchannel','N.A.','closed','disposition','threadId','Public','Private','map','existsSync','pipe','createWriteStream','direction','out','System','basename','value','transcript-','createPdfFromHTML','unlinkSync','rimraf','zip-dir','path','lodash','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./openchannelInteraction.socket','register'];(function(_0xce93c,_0x555be5){var _0x230720=function(_0x6d5428){while(--_0x6d5428){_0xce93c['push'](_0xce93c['shift']());}};_0x230720(++_0x555be5);}(_0xe7f7,0x168));var _0x7e7f=function(_0x5c7e53,_0x174ce5){_0x5c7e53=_0x5c7e53-0x0;var _0x1c9af9=_0xe7f7[_0x5c7e53];return _0x1c9af9;};'use strict';var rimraf=require(_0x7e7f('0x0'));var zipdir=require(_0x7e7f('0x1'));var moment=require('moment');var util=require('util');var path=require(_0x7e7f('0x2'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7e7f('0x3'));var Redis=require('ioredis');var interaction=require(_0x7e7f('0x4'));var qs=require('../../components/parsers/qs');var pdf=require(_0x7e7f('0x5'));var logger=require(_0x7e7f('0x6'))(_0x7e7f('0x7'));var config=require(_0x7e7f('0x8'));var db=require(_0x7e7f('0x9'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x7e7f('0xa'),'port':0x18eb});var socket=require(_0x7e7f('0xb'))(new Redis(config[_0x7e7f('0xc')]));require(_0x7e7f('0xd'))[_0x7e7f('0xe')](socket);function respondWithStatusCode(_0x2e6f50,_0x3cf1a0){_0x3cf1a0=_0x3cf1a0||0xcc;return function(_0x492841){if(_0x492841){return _0x2e6f50[_0x7e7f('0xf')](_0x3cf1a0);}return _0x2e6f50[_0x7e7f('0x10')](_0x3cf1a0)[_0x7e7f('0x11')]();};}function respondWithResult(_0x11fcc3,_0x4a0f22){_0x4a0f22=_0x4a0f22||0xc8;return function(_0x170d03){if(_0x170d03){return _0x11fcc3[_0x7e7f('0x10')](_0x4a0f22)[_0x7e7f('0x12')](_0x170d03);}};}function respondWithFilteredResult(_0xa07ecb,_0x5a49aa){return function(_0x4ac193){if(_0x4ac193){var _0x96b27d=typeof _0x5a49aa[_0x7e7f('0x13')]==='undefined'&&typeof _0x5a49aa[_0x7e7f('0x14')]==='undefined';var _0x37b19b=_0x4ac193[_0x7e7f('0x15')];var _0x598135=_0x96b27d?0x0:_0x5a49aa[_0x7e7f('0x13')];var _0x213ce3=_0x96b27d?_0x4ac193[_0x7e7f('0x15')]:_0x5a49aa[_0x7e7f('0x13')]+_0x5a49aa[_0x7e7f('0x14')];var _0x27301c;if(_0x213ce3>=_0x37b19b){_0x213ce3=_0x37b19b;_0x27301c=0xc8;}else{_0x27301c=0xce;}_0xa07ecb['status'](_0x27301c);return _0xa07ecb[_0x7e7f('0x16')](_0x7e7f('0x17'),_0x598135+'-'+_0x213ce3+'/'+_0x37b19b)[_0x7e7f('0x12')](_0x4ac193);}return null;};}function saveUpdates(_0x10e7b9){return function(_0x344fd0){if(_0x344fd0){return _0x344fd0[_0x7e7f('0x18')](_0x10e7b9)['then'](function(_0x27f170){return _0x27f170;});}return null;};}function removeEntity(_0x22889f){return function(_0x649eea){if(_0x649eea){return _0x649eea[_0x7e7f('0x19')]()[_0x7e7f('0x1a')](function(){_0x22889f['status'](0xcc)[_0x7e7f('0x11')]();});}};}function handleEntityNotFound(_0x13075b){return function(_0x267ff9){if(!_0x267ff9){_0x13075b['sendStatus'](0x194);}return _0x267ff9;};}function handleError(_0x3385ba,_0x33e769){_0x33e769=_0x33e769||0x1f4;return function(_0x3fcf0d){logger[_0x7e7f('0x1b')](_0x3fcf0d[_0x7e7f('0x1c')]);if(_0x3fcf0d['name']){delete _0x3fcf0d[_0x7e7f('0x1d')];}_0x3385ba[_0x7e7f('0x10')](_0x33e769)['send'](_0x3fcf0d);};}exports[_0x7e7f('0x1e')]=function(_0x530709,_0x327149){var _0x53750c={};var _0x27b483=_['map'](db[_0x7e7f('0x1f')][_0x7e7f('0x20')],function(_0xf64684){return{'name':_0xf64684[_0x7e7f('0x21')],'type':_0xf64684[_0x7e7f('0x22')][_0x7e7f('0x23')]};});_0x53750c=qs[_0x7e7f('0x24')](_0x27b483,_0x530709);return interaction[_0x7e7f('0x25')](_0x7e7f('0x26'),_0x530709[_0x7e7f('0x27')],_0x530709[_0x7e7f('0x28')],_0x53750c,_0x27b483)['then'](respondWithFilteredResult(_0x327149,_0x53750c))[_0x7e7f('0x29')](handleError(_0x327149,null));};exports[_0x7e7f('0x2a')]=function(_0x4a32cc,_0x247f9f){var _0x3d7b2d={};if(_0x4a32cc[_0x7e7f('0x27')][_0x7e7f('0x22')]&&_0x4a32cc['query'][_0x7e7f('0x22')]===_0x7e7f('0x2b')){_0x3d7b2d[_0x7e7f('0x2b')]=_0x4a32cc['params']['id'];}else{_0x3d7b2d['id']=_0x4a32cc[_0x7e7f('0x2c')]['id'];}var _0x4ef2cf={'raw':![],'where':_0x3d7b2d},_0x5dbd69={};_0x5dbd69[_0x7e7f('0x2d')]=_[_0x7e7f('0x2e')](db[_0x7e7f('0x1f')][_0x7e7f('0x20')]);_0x5dbd69[_0x7e7f('0x27')]=_[_0x7e7f('0x2e')](_0x4a32cc[_0x7e7f('0x27')]);_0x5dbd69[_0x7e7f('0x2f')]=_['intersection'](_0x5dbd69['model'],_0x5dbd69['query']);_0x4ef2cf['attributes']=_[_0x7e7f('0x30')](_0x5dbd69[_0x7e7f('0x2d')],qs[_0x7e7f('0x31')](_0x4a32cc[_0x7e7f('0x27')][_0x7e7f('0x31')]));_0x4ef2cf['attributes']=_0x4ef2cf[_0x7e7f('0x32')][_0x7e7f('0x33')]?_0x4ef2cf[_0x7e7f('0x32')]:_0x5dbd69[_0x7e7f('0x2d')];if(_0x4a32cc[_0x7e7f('0x27')][_0x7e7f('0x34')]){_0x4ef2cf['include']=[{'all':!![]}];}_0x4ef2cf=_['merge']({},_0x4ef2cf,_0x4a32cc[_0x7e7f('0x35')]);return db[_0x7e7f('0x1f')][_0x7e7f('0x36')](_0x4ef2cf)[_0x7e7f('0x1a')](handleEntityNotFound(_0x247f9f,null))[_0x7e7f('0x1a')](respondWithResult(_0x247f9f,null))['catch'](handleError(_0x247f9f,null));};exports['create']=function(_0x2da434,_0x4d29d0){return db[_0x7e7f('0x1f')][_0x7e7f('0x37')](_0x2da434[_0x7e7f('0x38')],{})['then'](respondWithResult(_0x4d29d0,0xc9))[_0x7e7f('0x29')](handleError(_0x4d29d0,null));};exports[_0x7e7f('0x18')]=function(_0x326df5,_0x49c776){if(_0x326df5['body']['id']){delete _0x326df5[_0x7e7f('0x38')]['id'];}return db[_0x7e7f('0x1f')][_0x7e7f('0x36')]({'where':{'id':_0x326df5[_0x7e7f('0x2c')]['id']}})['then'](handleEntityNotFound(_0x49c776,null))[_0x7e7f('0x1a')](saveUpdates(_0x326df5[_0x7e7f('0x38')],null))[_0x7e7f('0x1a')](respondWithResult(_0x49c776,null))[_0x7e7f('0x29')](handleError(_0x49c776,null));};exports[_0x7e7f('0x19')]=function(_0x3b97b3,_0x35425b){return db['OpenchannelInteraction'][_0x7e7f('0x36')]({'where':{'id':_0x3b97b3[_0x7e7f('0x2c')]['id']}})['then'](handleEntityNotFound(_0x35425b,null))['then'](removeEntity(_0x35425b,null))[_0x7e7f('0x29')](handleError(_0x35425b,null));};exports[_0x7e7f('0x39')]=function(_0x13ac2e,_0x1e34fd){return db[_0x7e7f('0x1f')]['describe']()[_0x7e7f('0x1a')](respondWithResult(_0x1e34fd,null))[_0x7e7f('0x29')](handleError(_0x1e34fd,null));};exports[_0x7e7f('0x3a')]=function(_0xc55342,_0x985633){return db[_0x7e7f('0x3b')][_0x7e7f('0x36')]({'where':{'id':_0xc55342[_0x7e7f('0x2c')]['id']}})[_0x7e7f('0x1a')](handleEntityNotFound(_0x985633,null))['then'](function(_0x2b4db2){if(_0x2b4db2){return _0x2b4db2[_0x7e7f('0x3a')](_0xc55342['body']['ids'],_[_0x7e7f('0x3c')](_0xc55342[_0x7e7f('0x38')],[_0x7e7f('0x3d'),'id'])||{});}})[_0x7e7f('0x1a')](respondWithResult(_0x985633,null))['catch'](handleError(_0x985633,null));};exports[_0x7e7f('0x3e')]=function(_0x547e0a,_0x13f0a3){var _0x46d7a3={'raw':![],'where':{}};var _0x343d81={};var _0x5a6932={'count':0x0,'rows':[]};return db[_0x7e7f('0x1f')][_0x7e7f('0x3f')]({'where':{'id':_0x547e0a[_0x7e7f('0x2c')]['id']}})['then'](handleEntityNotFound(_0x13f0a3,null))[_0x7e7f('0x1a')](function(_0x2a656f){if(_0x2a656f){_0x343d81[_0x7e7f('0x2d')]=_[_0x7e7f('0x2e')](db['OpenchannelMessage'][_0x7e7f('0x20')]);_0x343d81['query']=_[_0x7e7f('0x2e')](_0x547e0a[_0x7e7f('0x27')]);_0x343d81[_0x7e7f('0x2f')]=_[_0x7e7f('0x30')](_0x343d81[_0x7e7f('0x2d')],_0x343d81[_0x7e7f('0x27')]);_0x46d7a3[_0x7e7f('0x32')]=_[_0x7e7f('0x30')](_0x343d81['model'],qs[_0x7e7f('0x31')](_0x547e0a[_0x7e7f('0x27')]['fields']));_0x46d7a3[_0x7e7f('0x32')]=_0x46d7a3[_0x7e7f('0x32')]['length']?_0x46d7a3['attributes']:_0x343d81['model'];if(!_0x547e0a['query'][_0x7e7f('0x40')](_0x7e7f('0x41'))){_0x46d7a3['limit']=qs[_0x7e7f('0x14')](_0x547e0a['query'][_0x7e7f('0x14')]);_0x46d7a3[_0x7e7f('0x13')]=qs['offset'](_0x547e0a['query']['offset']);}_0x46d7a3[_0x7e7f('0x42')]=qs[_0x7e7f('0x43')](_0x547e0a['query'][_0x7e7f('0x43')]);_0x46d7a3[_0x7e7f('0x44')]=qs[_0x7e7f('0x2f')](_['pick'](_0x547e0a[_0x7e7f('0x27')],_0x343d81[_0x7e7f('0x2f')]));_0x46d7a3['where']['OpenchannelInteractionId']=_0x2a656f['id'];if(_0x547e0a[_0x7e7f('0x27')]['filter']){_0x46d7a3['where']=_[_0x7e7f('0x45')](_0x46d7a3[_0x7e7f('0x44')],{'$or':_['map'](_0x46d7a3[_0x7e7f('0x32')],function(_0x3f1447){var _0x36e3c7={};_0x36e3c7[_0x3f1447]={'$like':'%'+_0x547e0a[_0x7e7f('0x27')][_0x7e7f('0x46')]+'%'};return _0x36e3c7;})});}if(_0x547e0a[_0x7e7f('0x27')]['$gte']){var _0x231a95=_0x547e0a[_0x7e7f('0x27')][_0x7e7f('0x47')][_0x7e7f('0x48')](',');var _0x619088={};_0x619088[_0x231a95[0x0]]={'$gte':moment(_0x231a95[0x1])[_0x7e7f('0x49')](_0x7e7f('0x4a'))};_0x46d7a3[_0x7e7f('0x44')]=_[_0x7e7f('0x45')](_0x46d7a3[_0x7e7f('0x44')],_0x619088);}_0x46d7a3=_[_0x7e7f('0x45')]({},_0x46d7a3,_0x547e0a[_0x7e7f('0x35')]);return db[_0x7e7f('0x3b')][_0x7e7f('0x15')]({'where':_0x46d7a3['where']})['then'](function(_0x4ae5cb){_0x5a6932[_0x7e7f('0x15')]=_0x4ae5cb;if(_0x547e0a[_0x7e7f('0x27')][_0x7e7f('0x34')]){_0x46d7a3['include']=[{'all':!![]}];}return db[_0x7e7f('0x3b')]['findAll'](_0x46d7a3);})[_0x7e7f('0x1a')](function(_0x262fc8){_0x5a6932[_0x7e7f('0x4b')]=_0x262fc8;return _0x5a6932;});}})[_0x7e7f('0x1a')](respondWithFilteredResult(_0x13f0a3,_0x46d7a3))[_0x7e7f('0x29')](handleError(_0x13f0a3,null));};exports['addTags']=function(_0x2bc8ba,_0x34bdee){return db['OpenchannelInteraction']['find']({'where':{'id':_0x2bc8ba['params']['id']}})[_0x7e7f('0x1a')](handleEntityNotFound(_0x34bdee,null))[_0x7e7f('0x1a')](function(_0x483fc2){if(_0x483fc2){return _0x483fc2[_0x7e7f('0x4c')](_0x2bc8ba[_0x7e7f('0x38')]['ids'],_[_0x7e7f('0x3c')](_0x2bc8ba[_0x7e7f('0x38')],['ids','id'])||{})[_0x7e7f('0x4d')](function(){return db[_0x7e7f('0x4e')]['findAll']({'attributes':['id',_0x7e7f('0x1d'),_0x7e7f('0x4f')],'where':{'id':_0x2bc8ba[_0x7e7f('0x38')][_0x7e7f('0x3d')]}});})[_0x7e7f('0x1a')](function(_0x1078f2){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x2bc8ba[_0x7e7f('0x2c')]['id']),'tags':_0x1078f2||[]});return{'id':Number(_0x2bc8ba[_0x7e7f('0x2c')]['id']),'tags':_0x1078f2||[]};});}})[_0x7e7f('0x1a')](respondWithResult(_0x34bdee,null))[_0x7e7f('0x29')](handleError(_0x34bdee,null));};exports['removeTags']=function(_0x292b9c,_0xbae81){return db['OpenchannelInteraction']['find']({'where':{'id':_0x292b9c[_0x7e7f('0x2c')]['id']}})[_0x7e7f('0x1a')](handleEntityNotFound(_0xbae81,null))[_0x7e7f('0x1a')](function(_0xb96bdd){if(_0xb96bdd){return _0xb96bdd[_0x7e7f('0x50')](_0x292b9c['query'][_0x7e7f('0x3d')]);}})[_0x7e7f('0x1a')](respondWithStatusCode(_0xbae81,null))[_0x7e7f('0x29')](handleError(_0xbae81,null));};exports[_0x7e7f('0x51')]=function(_0x59ff7c,_0x1490af){var _0x27426a=moment()[_0x7e7f('0x52')]()[_0x7e7f('0x53')]();var _0x2062fa=path[_0x7e7f('0x54')](config[_0x7e7f('0x55')],_0x7e7f('0x56'),_0x7e7f('0x57'),_0x7e7f('0x58'));var _0x550965=path[_0x7e7f('0x54')](config['root'],_0x7e7f('0x56'),_0x7e7f('0x57'),_0x7e7f('0x59'));var _0x4f2e0e=path[_0x7e7f('0x54')](_0x2062fa,_0x27426a);var _0x548d3f=util[_0x7e7f('0x49')](_0x7e7f('0x5a'),_0x59ff7c[_0x7e7f('0x2c')]['id'],_0x27426a);var _0x536dc2=path[_0x7e7f('0x54')](_0x2062fa,_0x548d3f);var _0x1e1ea4=[];_0x1e1ea4[_0x7e7f('0x5b')]({'model':db[_0x7e7f('0x5c')],'as':'User','attributes':['id',_0x7e7f('0x5d')],'raw':!![]});_0x1e1ea4[_0x7e7f('0x5b')]({'model':db[_0x7e7f('0x5e')],'as':_0x7e7f('0x5f'),'attributes':['id',_0x7e7f('0x60'),_0x7e7f('0x61')],'raw':!![]});if(_0x59ff7c[_0x7e7f('0x27')][_0x7e7f('0x59')]){_0x1e1ea4[_0x7e7f('0x5b')]({'model':db[_0x7e7f('0x62')],'as':_0x7e7f('0x62'),'raw':!![]});}var _0x482f0e=[{'model':db[_0x7e7f('0x3b')],'as':'Messages','attributes':['id',_0x7e7f('0x38'),_0x7e7f('0x63'),'direction',_0x7e7f('0x64'),_0x7e7f('0x65')],'include':_0x1e1ea4}];_0x482f0e[_0x7e7f('0x5b')]({'model':db[_0x7e7f('0x66')],'as':_0x7e7f('0x67'),'attributes':['id',_0x7e7f('0x1d')]});_0x482f0e[_0x7e7f('0x5b')]({'model':db['User'],'as':_0x7e7f('0x68'),'attributes':['id',_0x7e7f('0x5d')]});return db[_0x7e7f('0x1f')][_0x7e7f('0x36')]({'where':{'id':_0x59ff7c[_0x7e7f('0x2c')]['id']},'include':_0x482f0e})[_0x7e7f('0x1a')](handleEntityNotFound(_0x1490af,null))['then'](function(_0x4e4401){if(_0x4e4401){var _0x5e00e0=_0x4e4401['get']({'plain':!![]});fs[_0x7e7f('0x69')](_0x4f2e0e);var _0x2b5c0f={'channel':_0x7e7f('0x6a'),'account':_0x5e00e0[_0x7e7f('0x67')][_0x7e7f('0x1d')],'agent':_0x5e00e0['Owner']?_0x5e00e0[_0x7e7f('0x68')]['fullname']:_0x7e7f('0x6b'),'createdAt':moment(_0x5e00e0[_0x7e7f('0x63')])[_0x7e7f('0x49')](_0x7e7f('0x4a'))[_0x7e7f('0x53')](),'closedAt':_0x5e00e0[_0x7e7f('0x6c')]?moment(_0x5e00e0['closedAt'])[_0x7e7f('0x49')](_0x7e7f('0x4a'))['toString']():'','disposition':_0x5e00e0[_0x7e7f('0x6d')],'visibility':_0x5e00e0[_0x7e7f('0x6e')]?_0x7e7f('0x6f'):_0x7e7f('0x70'),'messages':_(_0x5e00e0['Messages'])[_0x7e7f('0x46')]({'secret':![]})[_0x7e7f('0x71')](function(_0x34ac8a){if(_0x34ac8a[_0x7e7f('0x62')]){var _0x59793d=path[_0x7e7f('0x54')](_0x550965,_0x34ac8a[_0x7e7f('0x62')]['basename']);if(fs[_0x7e7f('0x72')](_0x59793d)){fs['createReadStream'](_0x59793d)[_0x7e7f('0x73')](fs[_0x7e7f('0x74')](path[_0x7e7f('0x54')](_0x4f2e0e,_0x34ac8a[_0x7e7f('0x62')]['basename'])));}}return{'date':moment(_0x34ac8a[_0x7e7f('0x63')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x34ac8a[_0x7e7f('0x75')]===_0x7e7f('0x76')?_0x34ac8a['User']?_0x34ac8a[_0x7e7f('0x5c')]['fullname']:_0x7e7f('0x77'):_0x34ac8a['Contact'][_0x7e7f('0x60')]+(_0x34ac8a[_0x7e7f('0x5f')][_0x7e7f('0x61')]?'\x20'+_0x34ac8a['Contact']['lastName']:''),'body':_0x34ac8a['Attachment']?_0x34ac8a[_0x7e7f('0x62')][_0x7e7f('0x78')]:_0x34ac8a[_0x7e7f('0x38')],'direction':_0x34ac8a[_0x7e7f('0x75')]===_0x7e7f('0x76')?'A':'C','secret':_0x34ac8a[_0x7e7f('0x64')],'read':_0x34ac8a['read'],'attachment':_0x34ac8a['Attachment']};})[_0x7e7f('0x79')]()};return ejs['renderFile'](path[_0x7e7f('0x54')](config[_0x7e7f('0x55')],_0x7e7f('0x56'),'views','downloadInteraction.ejs'),{'interaction':_0x2b5c0f})[_0x7e7f('0x1a')](function(_0x29c8ae){var _0x12cc10=path[_0x7e7f('0x54')](_0x4f2e0e,_0x7e7f('0x7a')+_0x5e00e0['id']+'-'+_0x27426a+'.pdf');var _0x3023eb={'path':_0x12cc10,'channel':_0x7e7f('0x6a'),'interactionId':_0x5e00e0['id']};return pdf[_0x7e7f('0x7b')](_0x29c8ae,_0x3023eb);})[_0x7e7f('0x1a')](function(){return new Promise(function(_0x378ad2,_0x239c68){zipdir(_0x4f2e0e,{'saveTo':_0x536dc2},function(_0x497f3e,_0x4b8ff1){if(_0x497f3e)return _0x239c68(_0x497f3e);return _0x378ad2(_0x4b8ff1);});})[_0x7e7f('0x1a')](function(){return new Promise(function(_0x5c099a,_0x253ddc){rimraf(_0x4f2e0e,function(_0x5921e5){if(_0x5921e5)_0x253ddc(_0x5921e5);return _0x5c099a();});});})[_0x7e7f('0x1a')](function(){return _0x1490af[_0x7e7f('0x51')](_0x536dc2,_0x548d3f,function(_0x49f82d){if(_0x49f82d){logger[_0x7e7f('0x1b')]('Unable\x20to\x20delete\x20zip\x20file',_0x49f82d);}else{fs[_0x7e7f('0x7c')](_0x536dc2);}});});});}else{return _0x1490af[_0x7e7f('0xf')](0xc8);}})[_0x7e7f('0x29')](handleError(_0x1490af,null));}; \ No newline at end of file +var _0x6696=['addTags','setTags','Tag','emit','openchannelInteractionTags:save','removeTags','unix','toString','root','server','tmp','join','files','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','lastName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','Owner','get','Openchannel','N.A.','closed','closedAt','disposition','threadId','Public','Private','filter','basename','existsSync','createReadStream','pipe','out','System','firstName','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','error','unlinkSync','zip-dir','moment','util','path','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../mysqldb','redis','defaults','./openchannelInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','send','map','OpenchannelInteraction','rawAttributes','fieldName','key','getOptions','openchannel','query','catch','show','type','from','params','keys','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','filters','nolimit','order','sort','where','pick','OpenchannelInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x6696,0x1bd));var _0x6669=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x6696[_0x525c7b];return _0x27b33e;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x6669('0x0'));var moment=require(_0x6669('0x1'));var util=require(_0x6669('0x2'));var path=require(_0x6669('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6669('0x4'));var Redis=require(_0x6669('0x5'));var interaction=require(_0x6669('0x6'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x6669('0x7'))(_0x6669('0x8'));var config=require('../../config/environment');var db=require(_0x6669('0x9'))['db'];config[_0x6669('0xa')]=_[_0x6669('0xb')](config[_0x6669('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6669('0xa')]));require(_0x6669('0xc'))[_0x6669('0xd')](socket);function respondWithStatusCode(_0x343697,_0x342b18){_0x342b18=_0x342b18||0xcc;return function(_0x496637){if(_0x496637){return _0x343697['sendStatus'](_0x342b18);}return _0x343697[_0x6669('0xe')](_0x342b18)[_0x6669('0xf')]();};}function respondWithResult(_0x4eee6c,_0x469395){_0x469395=_0x469395||0xc8;return function(_0x4e8050){if(_0x4e8050){return _0x4eee6c[_0x6669('0xe')](_0x469395)[_0x6669('0x10')](_0x4e8050);}};}function respondWithFilteredResult(_0x5a35e6,_0x5d7df9){return function(_0x1d6f94){if(_0x1d6f94){var _0x3d3a62=typeof _0x5d7df9[_0x6669('0x11')]===_0x6669('0x12')&&typeof _0x5d7df9[_0x6669('0x13')]===_0x6669('0x12');var _0x2d36bc=_0x1d6f94[_0x6669('0x14')];var _0x4ae7c5=_0x3d3a62?0x0:_0x5d7df9[_0x6669('0x11')];var _0x5b444f=_0x3d3a62?_0x1d6f94[_0x6669('0x14')]:_0x5d7df9[_0x6669('0x11')]+_0x5d7df9['limit'];var _0x12f760;if(_0x5b444f>=_0x2d36bc){_0x5b444f=_0x2d36bc;_0x12f760=0xc8;}else{_0x12f760=0xce;}_0x5a35e6['status'](_0x12f760);return _0x5a35e6[_0x6669('0x15')](_0x6669('0x16'),_0x4ae7c5+'-'+_0x5b444f+'/'+_0x2d36bc)[_0x6669('0x10')](_0x1d6f94);}return null;};}function saveUpdates(_0x164edd){return function(_0x1ed382){if(_0x1ed382){return _0x1ed382[_0x6669('0x17')](_0x164edd)[_0x6669('0x18')](function(_0x38877e){return _0x38877e;});}return null;};}function removeEntity(_0x2a8f7f){return function(_0x100716){if(_0x100716){return _0x100716[_0x6669('0x19')]()[_0x6669('0x18')](function(){_0x2a8f7f['status'](0xcc)[_0x6669('0xf')]();});}};}function handleEntityNotFound(_0x172964){return function(_0x38b0da){if(!_0x38b0da){_0x172964['sendStatus'](0x194);}return _0x38b0da;};}function handleError(_0x45ea05,_0x11064e){_0x11064e=_0x11064e||0x1f4;return function(_0xcebb70){logger['error'](_0xcebb70[_0x6669('0x1a')]);if(_0xcebb70[_0x6669('0x1b')]){delete _0xcebb70[_0x6669('0x1b')];}_0x45ea05[_0x6669('0xe')](_0x11064e)[_0x6669('0x1c')](_0xcebb70);};}exports['index']=function(_0x4193f9,_0x4c0f72){var _0xdac647={};var _0x531eab=_[_0x6669('0x1d')](db[_0x6669('0x1e')][_0x6669('0x1f')],function(_0x52122c){return{'name':_0x52122c[_0x6669('0x20')],'type':_0x52122c['type'][_0x6669('0x21')]};});_0xdac647=qs[_0x6669('0x22')](_0x531eab,_0x4193f9);return interaction['findAll'](_0x6669('0x23'),_0x4193f9[_0x6669('0x24')],_0x4193f9['user'],_0xdac647,_0x531eab)[_0x6669('0x18')](respondWithFilteredResult(_0x4c0f72,_0xdac647))[_0x6669('0x25')](handleError(_0x4c0f72,null));};exports[_0x6669('0x26')]=function(_0x25a4db,_0x295ee0){var _0x2f2204={};if(_0x25a4db[_0x6669('0x24')][_0x6669('0x27')]&&_0x25a4db['query'][_0x6669('0x27')]===_0x6669('0x28')){_0x2f2204[_0x6669('0x28')]=_0x25a4db[_0x6669('0x29')]['id'];}else{_0x2f2204['id']=_0x25a4db[_0x6669('0x29')]['id'];}var _0xfba6c4={'raw':![],'where':_0x2f2204},_0x131e3a={};_0x131e3a['model']=_[_0x6669('0x2a')](db[_0x6669('0x1e')][_0x6669('0x1f')]);_0x131e3a[_0x6669('0x24')]=_[_0x6669('0x2a')](_0x25a4db['query']);_0x131e3a['filters']=_[_0x6669('0x2b')](_0x131e3a[_0x6669('0x2c')],_0x131e3a[_0x6669('0x24')]);_0xfba6c4[_0x6669('0x2d')]=_[_0x6669('0x2b')](_0x131e3a['model'],qs[_0x6669('0x2e')](_0x25a4db[_0x6669('0x24')][_0x6669('0x2e')]));_0xfba6c4[_0x6669('0x2d')]=_0xfba6c4['attributes'][_0x6669('0x2f')]?_0xfba6c4[_0x6669('0x2d')]:_0x131e3a[_0x6669('0x2c')];if(_0x25a4db[_0x6669('0x24')][_0x6669('0x30')]){_0xfba6c4[_0x6669('0x31')]=[{'all':!![]}];}_0xfba6c4=_[_0x6669('0x32')]({},_0xfba6c4,_0x25a4db[_0x6669('0x33')]);return db[_0x6669('0x1e')][_0x6669('0x34')](_0xfba6c4)['then'](handleEntityNotFound(_0x295ee0,null))[_0x6669('0x18')](respondWithResult(_0x295ee0,null))['catch'](handleError(_0x295ee0,null));};exports[_0x6669('0x35')]=function(_0x3ae557,_0xee536){return db[_0x6669('0x1e')][_0x6669('0x35')](_0x3ae557['body'],{})[_0x6669('0x18')](respondWithResult(_0xee536,0xc9))[_0x6669('0x25')](handleError(_0xee536,null));};exports['update']=function(_0x15381d,_0x4a5afa){if(_0x15381d['body']['id']){delete _0x15381d[_0x6669('0x36')]['id'];}return db[_0x6669('0x1e')]['find']({'where':{'id':_0x15381d[_0x6669('0x29')]['id']}})[_0x6669('0x18')](handleEntityNotFound(_0x4a5afa,null))[_0x6669('0x18')](saveUpdates(_0x15381d[_0x6669('0x36')],null))[_0x6669('0x18')](respondWithResult(_0x4a5afa,null))[_0x6669('0x25')](handleError(_0x4a5afa,null));};exports[_0x6669('0x19')]=function(_0x76f88d,_0x1ebc0c){return db[_0x6669('0x1e')][_0x6669('0x34')]({'where':{'id':_0x76f88d[_0x6669('0x29')]['id']}})[_0x6669('0x18')](handleEntityNotFound(_0x1ebc0c,null))[_0x6669('0x18')](removeEntity(_0x1ebc0c,null))['catch'](handleError(_0x1ebc0c,null));};exports['describe']=function(_0x3a5097,_0x431e5f){return db['OpenchannelInteraction'][_0x6669('0x37')]()[_0x6669('0x18')](respondWithResult(_0x431e5f,null))[_0x6669('0x25')](handleError(_0x431e5f,null));};exports[_0x6669('0x38')]=function(_0xe9381c,_0x79d5bf){return db['OpenchannelMessage'][_0x6669('0x34')]({'where':{'id':_0xe9381c['params']['id']}})[_0x6669('0x18')](handleEntityNotFound(_0x79d5bf,null))[_0x6669('0x18')](function(_0x27df37){if(_0x27df37){return _0x27df37[_0x6669('0x38')](_0xe9381c['body'][_0x6669('0x39')],_[_0x6669('0x3a')](_0xe9381c[_0x6669('0x36')],[_0x6669('0x39'),'id'])||{});}})[_0x6669('0x18')](respondWithResult(_0x79d5bf,null))[_0x6669('0x25')](handleError(_0x79d5bf,null));};exports[_0x6669('0x3b')]=function(_0x573675,_0x38134a){var _0x42e888={'raw':![],'where':{}};var _0x3e870e={};var _0x1c3d99={'count':0x0,'rows':[]};return db[_0x6669('0x1e')][_0x6669('0x3c')]({'where':{'id':_0x573675[_0x6669('0x29')]['id']}})['then'](handleEntityNotFound(_0x38134a,null))['then'](function(_0x1d7a7d){if(_0x1d7a7d){_0x3e870e[_0x6669('0x2c')]=_[_0x6669('0x2a')](db[_0x6669('0x3d')][_0x6669('0x1f')]);_0x3e870e['query']=_[_0x6669('0x2a')](_0x573675[_0x6669('0x24')]);_0x3e870e[_0x6669('0x3e')]=_[_0x6669('0x2b')](_0x3e870e[_0x6669('0x2c')],_0x3e870e[_0x6669('0x24')]);_0x42e888[_0x6669('0x2d')]=_['intersection'](_0x3e870e[_0x6669('0x2c')],qs[_0x6669('0x2e')](_0x573675[_0x6669('0x24')]['fields']));_0x42e888['attributes']=_0x42e888[_0x6669('0x2d')][_0x6669('0x2f')]?_0x42e888[_0x6669('0x2d')]:_0x3e870e[_0x6669('0x2c')];if(!_0x573675[_0x6669('0x24')]['hasOwnProperty'](_0x6669('0x3f'))){_0x42e888['limit']=qs['limit'](_0x573675[_0x6669('0x24')][_0x6669('0x13')]);_0x42e888['offset']=qs[_0x6669('0x11')](_0x573675[_0x6669('0x24')]['offset']);}_0x42e888[_0x6669('0x40')]=qs[_0x6669('0x41')](_0x573675[_0x6669('0x24')][_0x6669('0x41')]);_0x42e888[_0x6669('0x42')]=qs[_0x6669('0x3e')](_[_0x6669('0x43')](_0x573675[_0x6669('0x24')],_0x3e870e[_0x6669('0x3e')]));_0x42e888[_0x6669('0x42')][_0x6669('0x44')]=_0x1d7a7d['id'];if(_0x573675['query']['filter']){_0x42e888[_0x6669('0x42')]=_[_0x6669('0x32')](_0x42e888[_0x6669('0x42')],{'$or':_[_0x6669('0x1d')](_0x42e888[_0x6669('0x2d')],function(_0x4d4e1e){var _0x14f41e={};_0x14f41e[_0x4d4e1e]={'$like':'%'+_0x573675['query']['filter']+'%'};return _0x14f41e;})});}if(_0x573675[_0x6669('0x24')][_0x6669('0x45')]){var _0x18a48a=_0x573675[_0x6669('0x24')][_0x6669('0x45')][_0x6669('0x46')](',');var _0x4f39ce={};_0x4f39ce[_0x18a48a[0x0]]={'$gte':moment(_0x18a48a[0x1])[_0x6669('0x47')](_0x6669('0x48'))};_0x42e888['where']=_[_0x6669('0x32')](_0x42e888['where'],_0x4f39ce);}_0x42e888=_[_0x6669('0x32')]({},_0x42e888,_0x573675[_0x6669('0x33')]);return db['OpenchannelMessage'][_0x6669('0x14')]({'where':_0x42e888['where']})[_0x6669('0x18')](function(_0x529f8f){_0x1c3d99[_0x6669('0x14')]=_0x529f8f;if(_0x573675[_0x6669('0x24')][_0x6669('0x30')]){_0x42e888[_0x6669('0x31')]=[{'all':!![]}];}return db[_0x6669('0x3d')][_0x6669('0x49')](_0x42e888);})[_0x6669('0x18')](function(_0x4ac6a4){_0x1c3d99[_0x6669('0x4a')]=_0x4ac6a4;return _0x1c3d99;});}})[_0x6669('0x18')](respondWithFilteredResult(_0x38134a,_0x42e888))[_0x6669('0x25')](handleError(_0x38134a,null));};exports[_0x6669('0x4b')]=function(_0x31c55e,_0x27713a){return db['OpenchannelInteraction'][_0x6669('0x34')]({'where':{'id':_0x31c55e[_0x6669('0x29')]['id']}})[_0x6669('0x18')](handleEntityNotFound(_0x27713a,null))[_0x6669('0x18')](function(_0x380427){if(_0x380427){return _0x380427[_0x6669('0x4c')](_0x31c55e[_0x6669('0x36')][_0x6669('0x39')],_[_0x6669('0x3a')](_0x31c55e[_0x6669('0x36')],[_0x6669('0x39'),'id'])||{})['spread'](function(){return db[_0x6669('0x4d')]['findAll']({'attributes':['id',_0x6669('0x1b'),'color'],'where':{'id':_0x31c55e['body'][_0x6669('0x39')]}});})[_0x6669('0x18')](function(_0x1b0089){socket[_0x6669('0x4e')](_0x6669('0x4f'),{'id':Number(_0x31c55e[_0x6669('0x29')]['id']),'tags':_0x1b0089||[]});return{'id':Number(_0x31c55e[_0x6669('0x29')]['id']),'tags':_0x1b0089||[]};});}})[_0x6669('0x18')](respondWithResult(_0x27713a,null))[_0x6669('0x25')](handleError(_0x27713a,null));};exports[_0x6669('0x50')]=function(_0x1c8588,_0xb2d36b){return db['OpenchannelInteraction'][_0x6669('0x34')]({'where':{'id':_0x1c8588[_0x6669('0x29')]['id']}})[_0x6669('0x18')](handleEntityNotFound(_0xb2d36b,null))[_0x6669('0x18')](function(_0x24dfac){if(_0x24dfac){return _0x24dfac['removeTags'](_0x1c8588[_0x6669('0x24')]['ids']);}})[_0x6669('0x18')](respondWithStatusCode(_0xb2d36b,null))['catch'](handleError(_0xb2d36b,null));};exports['download']=function(_0x11b947,_0x14ad66){var _0x22fc9c=moment()[_0x6669('0x51')]()[_0x6669('0x52')]();var _0x27ff9a=path['join'](config[_0x6669('0x53')],_0x6669('0x54'),'files',_0x6669('0x55'));var _0x2c3275=path[_0x6669('0x56')](config[_0x6669('0x53')],_0x6669('0x54'),_0x6669('0x57'),_0x6669('0x58'));var _0x57ce3b=path[_0x6669('0x56')](_0x27ff9a,_0x22fc9c);var _0xd8f119=util[_0x6669('0x47')](_0x6669('0x59'),_0x11b947['params']['id'],_0x22fc9c);var _0x117b18=path[_0x6669('0x56')](_0x27ff9a,_0xd8f119);var _0x17e4ab=[];_0x17e4ab[_0x6669('0x5a')]({'model':db[_0x6669('0x5b')],'as':_0x6669('0x5b'),'attributes':['id',_0x6669('0x5c')],'raw':!![]});_0x17e4ab[_0x6669('0x5a')]({'model':db[_0x6669('0x5d')],'as':_0x6669('0x5e'),'attributes':['id','firstName',_0x6669('0x5f')],'raw':!![]});if(_0x11b947[_0x6669('0x24')]['attachments']){_0x17e4ab['push']({'model':db[_0x6669('0x60')],'as':_0x6669('0x60'),'raw':!![]});}var _0x5c9ddf=[{'model':db[_0x6669('0x3d')],'as':_0x6669('0x61'),'attributes':['id',_0x6669('0x36'),_0x6669('0x62'),_0x6669('0x63'),_0x6669('0x64'),_0x6669('0x65')],'include':_0x17e4ab}];_0x5c9ddf[_0x6669('0x5a')]({'model':db[_0x6669('0x66')],'as':_0x6669('0x67'),'attributes':['id',_0x6669('0x1b')]});_0x5c9ddf['push']({'model':db['User'],'as':_0x6669('0x68'),'attributes':['id',_0x6669('0x5c')]});return db[_0x6669('0x1e')][_0x6669('0x34')]({'where':{'id':_0x11b947[_0x6669('0x29')]['id']},'include':_0x5c9ddf})['then'](handleEntityNotFound(_0x14ad66,null))[_0x6669('0x18')](function(_0xebef75){if(_0xebef75){var _0x1734f8=_0xebef75[_0x6669('0x69')]({'plain':!![]});fs['mkdirSync'](_0x57ce3b);var _0x2e6b0c={'channel':_0x6669('0x6a'),'account':_0x1734f8[_0x6669('0x67')][_0x6669('0x1b')],'agent':_0x1734f8[_0x6669('0x68')]?_0x1734f8[_0x6669('0x68')][_0x6669('0x5c')]:_0x6669('0x6b'),'createdAt':moment(_0x1734f8['createdAt'])[_0x6669('0x47')](_0x6669('0x48'))[_0x6669('0x52')](),'closedAt':_0x1734f8[_0x6669('0x6c')]?moment(_0x1734f8[_0x6669('0x6d')])[_0x6669('0x47')](_0x6669('0x48'))[_0x6669('0x52')]():'','disposition':_0x1734f8[_0x6669('0x6e')],'visibility':_0x1734f8[_0x6669('0x6f')]?_0x6669('0x70'):_0x6669('0x71'),'messages':_(_0x1734f8['Messages'])[_0x6669('0x72')]({'secret':![]})[_0x6669('0x1d')](function(_0x9ad534){if(_0x9ad534[_0x6669('0x60')]){var _0x48aed0=path['join'](_0x2c3275,_0x9ad534[_0x6669('0x60')][_0x6669('0x73')]);if(fs[_0x6669('0x74')](_0x48aed0)){fs[_0x6669('0x75')](_0x48aed0)[_0x6669('0x76')](fs['createWriteStream'](path['join'](_0x57ce3b,_0x9ad534[_0x6669('0x60')]['basename'])));}}return{'date':moment(_0x9ad534[_0x6669('0x62')])[_0x6669('0x47')](_0x6669('0x48'))['toString'](),'sender':_0x9ad534[_0x6669('0x63')]===_0x6669('0x77')?_0x9ad534[_0x6669('0x5b')]?_0x9ad534[_0x6669('0x5b')][_0x6669('0x5c')]:_0x6669('0x78'):_0x9ad534[_0x6669('0x5e')][_0x6669('0x79')]+(_0x9ad534[_0x6669('0x5e')][_0x6669('0x5f')]?'\x20'+_0x9ad534[_0x6669('0x5e')][_0x6669('0x5f')]:''),'body':_0x9ad534[_0x6669('0x60')]?_0x9ad534['Attachment'][_0x6669('0x73')]:_0x9ad534[_0x6669('0x36')],'direction':_0x9ad534['direction']===_0x6669('0x77')?'A':'C','secret':_0x9ad534[_0x6669('0x64')],'read':_0x9ad534['read'],'attachment':_0x9ad534[_0x6669('0x60')]};})[_0x6669('0x7a')]()};return ejs[_0x6669('0x7b')](path[_0x6669('0x56')](config['root'],_0x6669('0x54'),'views',_0x6669('0x7c')),{'interaction':_0x2e6b0c})[_0x6669('0x18')](function(_0x539c6a){var _0x4ddc60=path[_0x6669('0x56')](_0x57ce3b,_0x6669('0x7d')+_0x1734f8['id']+'-'+_0x22fc9c+_0x6669('0x7e'));var _0x170df4={'path':_0x4ddc60,'channel':_0x6669('0x6a'),'interactionId':_0x1734f8['id']};return pdf[_0x6669('0x7f')](_0x539c6a,_0x170df4);})['then'](function(){return new Promise(function(_0x42ad04,_0x56bc0d){zipdir(_0x57ce3b,{'saveTo':_0x117b18},function(_0x1382b5,_0x5c4be9){if(_0x1382b5)return _0x56bc0d(_0x1382b5);return _0x42ad04(_0x5c4be9);});})[_0x6669('0x18')](function(){return new Promise(function(_0x286cfd,_0x2a4205){rimraf(_0x57ce3b,function(_0x4e24a9){if(_0x4e24a9)_0x2a4205(_0x4e24a9);return _0x286cfd();});});})[_0x6669('0x18')](function(){return _0x14ad66['download'](_0x117b18,_0xd8f119,function(_0x5023a8){if(_0x5023a8){logger[_0x6669('0x80')]('Unable\x20to\x20delete\x20zip\x20file',_0x5023a8);}else{fs[_0x6669('0x81')](_0x117b18);}});});});}else{return _0x14ad66['sendStatus'](0xc8);}})[_0x6669('0x25')](handleError(_0x14ad66,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 441fede..991c22a 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.events.js +++ b/server/api/openchannelInteraction/openchannelInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf1c=['update','getUsers','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x464f27,_0x39d03f){var _0x249738=function(_0x5d6b3f){while(--_0x5d6b3f){_0x464f27['push'](_0x464f27['shift']());}};_0x249738(++_0x39d03f);}(_0xaf1c,0x10c));var _0xcaf1=function(_0x1ea713,_0x3b81ff){_0x1ea713=_0x1ea713-0x0;var _0x30f58b=_0xaf1c[_0x1ea713];return _0x30f58b;};'use strict';var EventEmitter=require(_0xcaf1('0x0'));var OpenchannelInteraction=require(_0xcaf1('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xcaf1('0x1'))['db'][_0xcaf1('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xcaf1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcaf1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3e750c){return function(_0xabea5e,_0x18de0a,_0x3c775a){_0xabea5e[_0xcaf1('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0xf3f37b){_0xabea5e['setDataValue'](_0xcaf1('0x6'),_0xf3f37b[_0xcaf1('0x7')](function(_0x2fcd80){return{'id':_0x2fcd80['id']};}));return OpenchannelMessage[_0xcaf1('0x8')]({'where':{'OpenchannelInteractionId':_0xabea5e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcaf1('0x9')](function(_0xe6ce32){_0xabea5e['setDataValue'](_0xcaf1('0xa'),_0xe6ce32[_0xcaf1('0xb')]);OpenchannelInteractionEvents[_0xcaf1('0xc')](_0x3e750c+':'+_0xabea5e['id'],_0xabea5e);OpenchannelInteractionEvents[_0xcaf1('0xc')](_0x3e750c,_0xabea5e);_0x3c775a(null);})[_0xcaf1('0xd')](_0x3c775a(null));};}for(var e in events){if(events[_0xcaf1('0xe')](e)){var event=events[e];OpenchannelInteraction[_0xcaf1('0xf')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x0fd7=['hook','exports','events','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','then','unreadMessages','emit','catch','hasOwnProperty'];(function(_0x1079d7,_0x39dfab){var _0x3c1c8b=function(_0x32c1d6){while(--_0x32c1d6){_0x1079d7['push'](_0x1079d7['shift']());}};_0x3c1c8b(++_0x39dfab);}(_0x0fd7,0x162));var _0x70fd=function(_0x20d4d2,_0x187b32){_0x20d4d2=_0x20d4d2-0x0;var _0x186d54=_0x0fd7[_0x20d4d2];return _0x186d54;};'use strict';var EventEmitter=require(_0x70fd('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x70fd('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x70fd('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x70fd('0x3')](0x0);var events={'afterCreate':_0x70fd('0x4'),'afterUpdate':_0x70fd('0x5'),'afterDestroy':_0x70fd('0x6')};function emitEvent(_0x3e8f04){return function(_0x5e6e34,_0x59b8a5,_0x4c8fd4){_0x5e6e34[_0x70fd('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2b629e){_0x5e6e34[_0x70fd('0x8')]('Users',_0x2b629e['map'](function(_0x50f0e1){return{'id':_0x50f0e1['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x5e6e34['id'],'direction':'in','read':![]},'raw':!![]});})[_0x70fd('0x9')](function(_0x4c607d){_0x5e6e34[_0x70fd('0x8')](_0x70fd('0xa'),_0x4c607d['length']);OpenchannelInteractionEvents['emit'](_0x3e8f04+':'+_0x5e6e34['id'],_0x5e6e34);OpenchannelInteractionEvents[_0x70fd('0xb')](_0x3e8f04,_0x5e6e34);_0x4c8fd4(null);})[_0x70fd('0xc')](_0x4c8fd4(null));};}for(var e in events){if(events[_0x70fd('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x70fd('0xe')](e,emitEvent(event));}}module[_0x70fd('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 0474816..44b251d 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.model.js +++ b/server/api/openchannelInteraction/openchannelInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38ed=['OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define'];(function(_0x968d3,_0x426f06){var _0x581696=function(_0x60c8ef){while(--_0x60c8ef){_0x968d3['push'](_0x968d3['shift']());}};_0x581696(++_0x426f06);}(_0x38ed,0xbd));var _0xd38e=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x38ed[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xd38e('0x0'));var util=require('util');var logger=require(_0xd38e('0x1'))(_0xd38e('0x2'));var moment=require(_0xd38e('0x3'));var BPromise=require(_0xd38e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd38e('0x5'));var rimraf=require(_0xd38e('0x6'));var config=require(_0xd38e('0x7'));var attributes=require(_0xd38e('0x8'));module[_0xd38e('0x9')]=function(_0x2363db,_0x3b1cce){return _0x2363db[_0xd38e('0xa')](_0xd38e('0xb'),attributes,{'tableName':_0xd38e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd38e('0xd'),'collate':_0xd38e('0xe'),'hooks':{'beforeUpdate':function(_0x4510c4,_0x3053ae,_0xe85f19){if(_0x4510c4[_0xd38e('0xf')](_0xd38e('0x10'))){_0x4510c4[_0xd38e('0x11')]=moment()[_0xd38e('0x12')](_0xd38e('0x13'));}_0xe85f19(null,_0x4510c4);}}});}; \ No newline at end of file +var _0x3177=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util'];(function(_0x2cc6b2,_0x59b23e){var _0x1e24eb=function(_0x40aba9){while(--_0x40aba9){_0x2cc6b2['push'](_0x2cc6b2['shift']());}};_0x1e24eb(++_0x59b23e);}(_0x3177,0x149));var _0x7317=function(_0x21eb10,_0x4837ee){_0x21eb10=_0x21eb10-0x0;var _0x2be61d=_0x3177[_0x21eb10];return _0x2be61d;};'use strict';var _=require('lodash');var util=require(_0x7317('0x0'));var logger=require(_0x7317('0x1'))(_0x7317('0x2'));var moment=require('moment');var BPromise=require(_0x7317('0x3'));var rp=require(_0x7317('0x4'));var fs=require('fs');var path=require(_0x7317('0x5'));var rimraf=require('rimraf');var config=require(_0x7317('0x6'));var attributes=require(_0x7317('0x7'));module['exports']=function(_0x5877a7,_0x152366){return _0x5877a7[_0x7317('0x8')]('OpenchannelInteraction',attributes,{'tableName':_0x7317('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7317('0xa'),'collate':_0x7317('0xb'),'hooks':{'beforeUpdate':function(_0x48acd9,_0x584974,_0x293234){if(_0x48acd9['changed']('closed')){_0x48acd9[_0x7317('0xc')]=moment()[_0x7317('0xd')](_0x7317('0xe'));}_0x293234(null,_0x48acd9);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 799ef13..beb4ccd 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.rpc.js +++ b/server/api/openchannelInteraction/openchannelInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe36a=['omit','body','ids','spread','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','OpenchannelInteraction','update','options','raw','where','attributes','limit','UpdateOpenchannelInteraction','find','addTags'];(function(_0x5321e9,_0xfa0270){var _0xe4c457=function(_0x4d46f0){while(--_0x4d46f0){_0x5321e9['push'](_0x5321e9['shift']());}};_0xe4c457(++_0xfa0270);}(_0xe36a,0x191));var _0xae36=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0xe36a[_0x31a576];return _0x30b1d3;};'use strict';var _=require(_0xae36('0x0'));var util=require('util');var moment=require(_0xae36('0x1'));var BPromise=require(_0xae36('0x2'));var rs=require(_0xae36('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae36('0x4'))['db'];var utils=require(_0xae36('0x5'));var logger=require(_0xae36('0x6'))(_0xae36('0x7'));var config=require(_0xae36('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xae36('0x9')][_0xae36('0xa')]({'port':0x232a});config[_0xae36('0xb')]=_['defaults'](config[_0xae36('0xb')],{'host':_0xae36('0xc'),'port':0x18eb});var socket=require(_0xae36('0xd'))(new Redis(config['redis']));require(_0xae36('0xe'))[_0xae36('0xf')](socket);function respondWithRpcPromise(_0xe321f7,_0x1a70c7,_0x502f7c){return new BPromise(function(_0x5e341b,_0x1b94dd){return client[_0xae36('0x10')](_0xe321f7,_0x502f7c)[_0xae36('0x11')](function(_0x76cf27){logger[_0xae36('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1a70c7,_0xae36('0x13'));logger[_0xae36('0x14')](_0xae36('0x15'),_0x1a70c7,_0xae36('0x13'),JSON[_0xae36('0x16')](_0x76cf27));if(_0x76cf27[_0xae36('0x17')]){if(_0x76cf27[_0xae36('0x17')][_0xae36('0x18')]===0x1f4){logger[_0xae36('0x17')](_0xae36('0x19'),_0x1a70c7,_0x76cf27['error'][_0xae36('0x1a')]);return _0x1b94dd(_0x76cf27[_0xae36('0x17')]['message']);}logger[_0xae36('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1a70c7,_0x76cf27[_0xae36('0x17')][_0xae36('0x1a')]);return _0x5e341b(_0x76cf27[_0xae36('0x17')][_0xae36('0x1a')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x1a70c7,_0xae36('0x13'));_0x5e341b(_0x76cf27[_0xae36('0x1b')][_0xae36('0x1a')]);}})[_0xae36('0x1c')](function(_0x40525c){logger[_0xae36('0x17')](_0xae36('0x19'),_0x1a70c7,_0x40525c);_0x1b94dd(_0x40525c);});});}exports['UpdateOpenchannelInteraction']=function(_0x2b514b){var _0x5ebb0c=this;return new Promise(function(_0x2c47cb,_0x353ea3){return db[_0xae36('0x1d')][_0xae36('0x1e')](_0x2b514b['body'],{'raw':_0x2b514b['options']?_0x2b514b[_0xae36('0x1f')][_0xae36('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b514b[_0xae36('0x1f')]?_0x2b514b['options'][_0xae36('0x21')]||null:null,'attributes':_0x2b514b[_0xae36('0x1f')]?_0x2b514b[_0xae36('0x1f')][_0xae36('0x22')]||null:null,'limit':_0x2b514b[_0xae36('0x1f')]?_0x2b514b[_0xae36('0x1f')][_0xae36('0x23')]||null:null})[_0xae36('0x11')](function(_0x3228fb){logger[_0xae36('0x12')](_0xae36('0x24'),_0x2b514b);logger[_0xae36('0x14')](_0xae36('0x24'),_0x2b514b,JSON[_0xae36('0x16')](_0x3228fb));_0x2c47cb(_0x3228fb);})[_0xae36('0x1c')](function(_0x1228fb){logger[_0xae36('0x17')]('UpdateOpenchannelInteraction',_0x1228fb[_0xae36('0x1a')],_0x2b514b);_0x353ea3(_0x5ebb0c['error'](0x1f4,_0x1228fb[_0xae36('0x1a')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x551852){return new Promise(function(_0x26a953,_0x4cdf77){return db['OpenchannelInteraction'][_0xae36('0x25')]({'where':_0x551852[_0xae36('0x1f')]?_0x551852['options'][_0xae36('0x21')]||null:null})[_0xae36('0x11')](function(_0xd6d5b4){if(_0xd6d5b4){return _0xd6d5b4[_0xae36('0x26')](_0x551852['body']['ids'],_[_0xae36('0x27')](_0x551852[_0xae36('0x28')],[_0xae36('0x29'),'id'])||{});}})[_0xae36('0x2a')](function(_0x2808e6){logger[_0xae36('0x12')]('AddTags',_0x551852);logger[_0xae36('0x14')](_0xae36('0x2b'),_0x551852,JSON['stringify'](_0x2808e6));_0x26a953(_0x2808e6);})[_0xae36('0x1c')](function(_0x95c05c){logger[_0xae36('0x17')]('AddTags',_0x95c05c[_0xae36('0x1a')],_0x551852);_0x4cdf77(_this[_0xae36('0x17')](0x1f4,_0x95c05c[_0xae36('0x1a')]));});});}; \ No newline at end of file +var _0x5b97=['raw','where','limit','UpdateOpenchannelInteraction','stringify','AddTagsToOpenchannelInteraction','find','addTags','omit','ids','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','OpenchannelInteraction','update','body','options'];(function(_0xc70602,_0x531f15){var _0x338b62=function(_0x47bec1){while(--_0x47bec1){_0xc70602['push'](_0xc70602['shift']());}};_0x338b62(++_0x531f15);}(_0x5b97,0xe3));var _0x75b9=function(_0x2300c7,_0x255f74){_0x2300c7=_0x2300c7-0x0;var _0x23f720=_0x5b97[_0x2300c7];return _0x23f720;};'use strict';var _=require('lodash');var util=require(_0x75b9('0x0'));var moment=require('moment');var BPromise=require(_0x75b9('0x1'));var rs=require(_0x75b9('0x2'));var fs=require('fs');var Redis=require(_0x75b9('0x3'));var db=require(_0x75b9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x75b9('0x5'));var config=require(_0x75b9('0x6'));var jayson=require(_0x75b9('0x7'));var client=jayson[_0x75b9('0x8')][_0x75b9('0x9')]({'port':0x232a});config['redis']=_[_0x75b9('0xa')](config[_0x75b9('0xb')],{'host':_0x75b9('0xc'),'port':0x18eb});var socket=require(_0x75b9('0xd'))(new Redis(config['redis']));require(_0x75b9('0xe'))[_0x75b9('0xf')](socket);function respondWithRpcPromise(_0x53e3f9,_0x3f2844,_0x52183a){return new BPromise(function(_0x1fa64f,_0x22e0bf){return client[_0x75b9('0x10')](_0x53e3f9,_0x52183a)[_0x75b9('0x11')](function(_0x2e2907){logger[_0x75b9('0x12')](_0x75b9('0x13'),_0x3f2844,'request\x20sent');logger[_0x75b9('0x14')](_0x75b9('0x15'),_0x3f2844,_0x75b9('0x16'),JSON['stringify'](_0x2e2907));if(_0x2e2907[_0x75b9('0x17')]){if(_0x2e2907[_0x75b9('0x17')][_0x75b9('0x18')]===0x1f4){logger[_0x75b9('0x17')](_0x75b9('0x13'),_0x3f2844,_0x2e2907[_0x75b9('0x17')][_0x75b9('0x19')]);return _0x22e0bf(_0x2e2907['error'][_0x75b9('0x19')]);}logger[_0x75b9('0x17')](_0x75b9('0x13'),_0x3f2844,_0x2e2907[_0x75b9('0x17')][_0x75b9('0x19')]);return _0x1fa64f(_0x2e2907['error'][_0x75b9('0x19')]);}else{logger['info'](_0x75b9('0x13'),_0x3f2844,_0x75b9('0x16'));_0x1fa64f(_0x2e2907['result'][_0x75b9('0x19')]);}})[_0x75b9('0x1a')](function(_0x3664c2){logger[_0x75b9('0x17')](_0x75b9('0x13'),_0x3f2844,_0x3664c2);_0x22e0bf(_0x3664c2);});});}exports['UpdateOpenchannelInteraction']=function(_0x2542e3){var _0x3af3df=this;return new Promise(function(_0x21929c,_0x3393be){return db[_0x75b9('0x1b')][_0x75b9('0x1c')](_0x2542e3[_0x75b9('0x1d')],{'raw':_0x2542e3[_0x75b9('0x1e')]?_0x2542e3['options'][_0x75b9('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2542e3[_0x75b9('0x1e')]?_0x2542e3[_0x75b9('0x1e')][_0x75b9('0x20')]||null:null,'attributes':_0x2542e3[_0x75b9('0x1e')]?_0x2542e3[_0x75b9('0x1e')]['attributes']||null:null,'limit':_0x2542e3[_0x75b9('0x1e')]?_0x2542e3[_0x75b9('0x1e')][_0x75b9('0x21')]||null:null})[_0x75b9('0x11')](function(_0x5c1538){logger[_0x75b9('0x12')](_0x75b9('0x22'),_0x2542e3);logger['debug']('UpdateOpenchannelInteraction',_0x2542e3,JSON[_0x75b9('0x23')](_0x5c1538));_0x21929c(_0x5c1538);})[_0x75b9('0x1a')](function(_0x13ae39){logger[_0x75b9('0x17')](_0x75b9('0x22'),_0x13ae39['message'],_0x2542e3);_0x3393be(_0x3af3df[_0x75b9('0x17')](0x1f4,_0x13ae39[_0x75b9('0x19')]));});});};exports[_0x75b9('0x24')]=function(_0x199d29){return new Promise(function(_0x426fae,_0x2df16c){return db[_0x75b9('0x1b')][_0x75b9('0x25')]({'where':_0x199d29[_0x75b9('0x1e')]?_0x199d29[_0x75b9('0x1e')][_0x75b9('0x20')]||null:null})[_0x75b9('0x11')](function(_0x9152f4){if(_0x9152f4){return _0x9152f4[_0x75b9('0x26')](_0x199d29[_0x75b9('0x1d')]['ids'],_[_0x75b9('0x27')](_0x199d29[_0x75b9('0x1d')],[_0x75b9('0x28'),'id'])||{});}})[_0x75b9('0x29')](function(_0x27d593){logger['info'](_0x75b9('0x2a'),_0x199d29);logger['debug'](_0x75b9('0x2a'),_0x199d29,JSON[_0x75b9('0x23')](_0x27d593));_0x426fae(_0x27d593);})[_0x75b9('0x1a')](function(_0x5752cd){logger['error'](_0x75b9('0x2a'),_0x5752cd[_0x75b9('0x19')],_0x199d29);_0x2df16c(_this[_0x75b9('0x17')](0x1f4,_0x5752cd[_0x75b9('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index f445045..688ce93 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.socket.js +++ b/server/api/openchannelInteraction/openchannelInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa3e=['emit','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x23f8e7,_0x1af059){var _0x455632=function(_0x2017ed){while(--_0x2017ed){_0x23f8e7['push'](_0x23f8e7['shift']());}};_0x455632(++_0x1af059);}(_0xaa3e,0x170));var _0xeaa3=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xaa3e[_0x4b369d];return _0x571a98;};'use strict';var OpenchannelInteractionEvents=require(_0xeaa3('0x0'));var events=[_0xeaa3('0x1'),_0xeaa3('0x2'),'update'];function createListener(_0x20f492,_0x306849){return function(_0x52844b){_0x306849[_0xeaa3('0x3')](_0x20f492,_0x52844b);};}function removeListener(_0x5b816a,_0x1f90df){return function(){OpenchannelInteractionEvents['removeListener'](_0x5b816a,_0x1f90df);};}exports[_0xeaa3('0x4')]=function(_0x3a0de7){for(var _0x82ba34=0x0,_0xdc03f9=events[_0xeaa3('0x5')];_0x82ba34<_0xdc03f9;_0x82ba34++){var _0x47515f=events[_0x82ba34];var _0x8c3741=createListener(_0xeaa3('0x6')+_0x47515f,_0x3a0de7);OpenchannelInteractionEvents['on'](_0x47515f,_0x8c3741);}}; \ No newline at end of file +var _0x0106=['remove','update','emit','register','length','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x3622ca,_0x40568f){var _0x5e7e67=function(_0x3848bb){while(--_0x3848bb){_0x3622ca['push'](_0x3622ca['shift']());}};_0x5e7e67(++_0x40568f);}(_0x0106,0x1be));var _0x6010=function(_0x152c78,_0x53d665){_0x152c78=_0x152c78-0x0;var _0x42e82e=_0x0106[_0x152c78];return _0x42e82e;};'use strict';var OpenchannelInteractionEvents=require(_0x6010('0x0'));var events=[_0x6010('0x1'),_0x6010('0x2'),_0x6010('0x3')];function createListener(_0x425b90,_0x319b78){return function(_0x50cb40){_0x319b78[_0x6010('0x4')](_0x425b90,_0x50cb40);};}function removeListener(_0x2fb196,_0x2660eb){return function(){OpenchannelInteractionEvents['removeListener'](_0x2fb196,_0x2660eb);};}exports[_0x6010('0x5')]=function(_0x5bf498){for(var _0x1a8b6a=0x0,_0x2552bc=events[_0x6010('0x6')];_0x1a8b6a<_0x2552bc;_0x1a8b6a++){var _0x48fc58=events[_0x1a8b6a];var _0x57b237=createListener(_0x6010('0x7')+_0x48fc58,_0x5bf498);OpenchannelInteractionEvents['on'](_0x48fc58,_0x57b237);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 78f4f2d..06c4ca7 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x229a9d,_0x4d3229){var _0x5bd600=function(_0x5f5af9){while(--_0x5f5af9){_0x229a9d['push'](_0x229a9d['shift']());}};_0x5bd600(++_0x4d3229);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0xcb91[_0x57add2];return _0x4e3670;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file +var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x57970b,_0x45c7c7){_0x57970b=_0x57970b-0x0;var _0x328a3c=_0x70e0[_0x57970b];return _0x328a3c;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 9562341..06a45bb 100644 --- a/server/api/openchannelMessage/openchannelMessage.attributes.js +++ b/server/api/openchannelMessage/openchannelMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3cae=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x31c19c,_0xbe4b70){var _0x1a87f7=function(_0x23cf92){while(--_0x23cf92){_0x31c19c['push'](_0x31c19c['shift']());}};_0x1a87f7(++_0xbe4b70);}(_0x3cae,0x117));var _0xe3ca=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x3cae[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0xe3ca('0x0'));module[_0xe3ca('0x1')]={'body':{'type':Sequelize[_0xe3ca('0x2')](_0xe3ca('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe3ca('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe3ca('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe3ca('0x5')]('in','out'),'defaultValue':_0xe3ca('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe3ca('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xe3ca('0x2')]}}; \ No newline at end of file +var _0x38c9=['STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x3492c8,_0x5a40aa){var _0xf3e965=function(_0x4f7ee9){while(--_0x4f7ee9){_0x3492c8['push'](_0x3492c8['shift']());}};_0xf3e965(++_0x5a40aa);}(_0x38c9,0x199));var _0x938c=function(_0x393d69,_0x3a8c83){_0x393d69=_0x393d69-0x0;var _0x3cee37=_0x38c9[_0x393d69];return _0x3cee37;};'use strict';var Sequelize=require(_0x938c('0x0'));module[_0x938c('0x1')]={'body':{'type':Sequelize[_0x938c('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x938c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x938c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x938c('0x4')]('in',_0x938c('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x938c('0x6')]},'providerName':{'type':Sequelize[_0x938c('0x7')]},'providerResponse':{'type':Sequelize[_0x938c('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 2c86d13..e1c5651 100644 --- a/server/api/openchannelMessage/openchannelMessage.controller.js +++ b/server/api/openchannelMessage/openchannelMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f50=['user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','interface','motionChannel','channel','accept','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','rejectMessage','contact','User','SIP/%s','event','rejectmessage','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','where','type','VIRTUAL','options','includeAll','include','findAll','rows','params','merge','find','create','body','describe','../../config/logger','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId'];(function(_0x3f477c,_0x52b7ff){var _0x4c36b3=function(_0x3b47bb){while(--_0x3b47bb){_0x3f477c['push'](_0x3f477c['shift']());}};_0x4c36b3(++_0x52b7ff);}(_0x0f50,0x123));var _0x00f5=function(_0x1cd389,_0xe31783){_0x1cd389=_0x1cd389-0x0;var _0x114696=_0x0f50[_0x1cd389];return _0x114696;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x00f5('0x0'));var zipdir=require(_0x00f5('0x1'));var jsonpatch=require(_0x00f5('0x2'));var rp=require('request-promise');var moment=require(_0x00f5('0x3'));var BPromise=require(_0x00f5('0x4'));var Mustache=require(_0x00f5('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x00f5('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x00f5('0x7'));var _=require(_0x00f5('0x8'));var squel=require(_0x00f5('0x9'));var crypto=require(_0x00f5('0xa'));var jsforce=require(_0x00f5('0xb'));var deskjs=require(_0x00f5('0xc'));var toCsv=require(_0x00f5('0x6'));var querystring=require(_0x00f5('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x00f5('0xe'));var qs=require(_0x00f5('0xf'));var as=require(_0x00f5('0x10'));var hardwareService=require(_0x00f5('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x00f5('0x12'));var config=require(_0x00f5('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x00f5('0x14'))['db'];config[_0x00f5('0x15')]=_['defaults'](config[_0x00f5('0x15')],{'host':_0x00f5('0x16'),'port':0x18eb});var socket=require(_0x00f5('0x17'))(new Redis(config[_0x00f5('0x15')]));require(_0x00f5('0x18'))[_0x00f5('0x19')](socket);var jayson=require(_0x00f5('0x1a'));var client=jayson[_0x00f5('0x1b')][_0x00f5('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x00f5('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x50e2a8,_0x538168,_0x4417b3,_0x24c391){return new BPromise(function(_0x3d03d1,_0x301fe2){var _0xad93fb=_0x24c391||client;return _0xad93fb['request'](_0x50e2a8,_0x4417b3)['then'](function(_0x13f4b2){logger[_0x00f5('0x1d')]('OpenchannelMessage,\x20%s,\x20%s',_0x538168,_0x00f5('0x1e'));logger[_0x00f5('0x1f')](_0x00f5('0x20'),_0x538168,_0x00f5('0x1e'),JSON['stringify'](_0x13f4b2));if(_0x13f4b2[_0x00f5('0x21')]){if(_0x13f4b2[_0x00f5('0x21')]['code']===0x1f4){logger['error'](_0x00f5('0x22'),_0x538168,_0x13f4b2[_0x00f5('0x21')][_0x00f5('0x23')]);return _0x301fe2(_0x13f4b2['error'][_0x00f5('0x23')]);}logger[_0x00f5('0x21')](_0x00f5('0x22'),_0x538168,_0x13f4b2[_0x00f5('0x21')][_0x00f5('0x23')]);return _0x3d03d1(_0x13f4b2[_0x00f5('0x21')][_0x00f5('0x23')]);}else{logger[_0x00f5('0x1d')](_0x00f5('0x22'),_0x538168,_0x00f5('0x1e'));_0x3d03d1(_0x13f4b2[_0x00f5('0x24')][_0x00f5('0x23')]);}})[_0x00f5('0x25')](function(_0x54eed8){logger[_0x00f5('0x21')](_0x00f5('0x22'),_0x538168,_0x54eed8);_0x301fe2(_0x54eed8);});});}function respondWithStatusCode(_0x1b7359,_0x23157f){_0x23157f=_0x23157f||0xcc;return function(_0x1ca226){if(_0x1ca226){return _0x1b7359[_0x00f5('0x26')](_0x23157f);}return _0x1b7359['status'](_0x23157f)[_0x00f5('0x27')]();};}function respondWithResult(_0x44ce14,_0x18990d){_0x18990d=_0x18990d||0xc8;return function(_0x1f79c1){if(_0x1f79c1){return _0x44ce14[_0x00f5('0x28')](_0x18990d)[_0x00f5('0x29')](_0x1f79c1);}};}function respondWithFilteredResult(_0x54f4f8,_0x79dd74){return function(_0x3c62b2){if(_0x3c62b2){var _0x49afca=typeof _0x79dd74[_0x00f5('0x2a')]===_0x00f5('0x2b')&&typeof _0x79dd74['limit']===_0x00f5('0x2b');var _0x1916e7=_0x3c62b2[_0x00f5('0x2c')];var _0x341d16=_0x49afca?0x0:_0x79dd74['offset'];var _0x48f98f=_0x49afca?_0x3c62b2[_0x00f5('0x2c')]:_0x79dd74[_0x00f5('0x2a')]+_0x79dd74['limit'];var _0x35aa9a;if(_0x48f98f>=_0x1916e7){_0x48f98f=_0x1916e7;_0x35aa9a=0xc8;}else{_0x35aa9a=0xce;}_0x54f4f8['status'](_0x35aa9a);return _0x54f4f8[_0x00f5('0x2d')](_0x00f5('0x2e'),_0x341d16+'-'+_0x48f98f+'/'+_0x1916e7)[_0x00f5('0x29')](_0x3c62b2);}return null;};}function patchUpdates(_0x3c58db){return function(_0x208eee){try{jsonpatch['apply'](_0x208eee,_0x3c58db,!![]);}catch(_0x232b9c){return BPromise[_0x00f5('0x2f')](_0x232b9c);}return _0x208eee[_0x00f5('0x30')]();};}function saveUpdates(_0x4e11a4,_0x5f593c){return function(_0x2268a2){if(_0x2268a2){return _0x2268a2[_0x00f5('0x31')](_0x4e11a4)[_0x00f5('0x32')](function(_0x2bb1f7){return _0x2bb1f7;});}return null;};}function removeEntity(_0x2f2849,_0x986aee){return function(_0x31e711){if(_0x31e711){return _0x31e711[_0x00f5('0x33')]()['then'](function(){_0x2f2849['status'](0xcc)[_0x00f5('0x27')]();});}};}function handleEntityNotFound(_0x1789a0,_0x5e1ecc){return function(_0x11e7e0){if(!_0x11e7e0){_0x1789a0[_0x00f5('0x26')](0x194);}return _0x11e7e0;};}function handleError(_0x115033,_0x1e03e3){_0x1e03e3=_0x1e03e3||0x1f4;return function(_0x26b5f9){logger['error'](_0x26b5f9[_0x00f5('0x34')]);if(_0x26b5f9[_0x00f5('0x35')]){delete _0x26b5f9[_0x00f5('0x35')];}_0x115033[_0x00f5('0x28')](_0x1e03e3)[_0x00f5('0x36')](_0x26b5f9);};}exports[_0x00f5('0x37')]=function(_0x1afe3e,_0x14e09a){var _0x5b821d={},_0x3f9086={},_0x4cdccf={'count':0x0,'rows':[]};var _0x5881ac=_[_0x00f5('0x38')](db[_0x00f5('0x39')][_0x00f5('0x3a')],function(_0x508104){return{'name':_0x508104[_0x00f5('0x3b')],'type':_0x508104['type']['key']};});_0x3f9086[_0x00f5('0x3c')]=_[_0x00f5('0x38')](_0x5881ac,_0x00f5('0x35'));_0x3f9086[_0x00f5('0x3d')]=_[_0x00f5('0x3e')](_0x1afe3e[_0x00f5('0x3d')]);_0x3f9086['filters']=_[_0x00f5('0x3f')](_0x3f9086['model'],_0x3f9086[_0x00f5('0x3d')]);_0x5b821d[_0x00f5('0x40')]=_[_0x00f5('0x3f')](_0x3f9086[_0x00f5('0x3c')],qs[_0x00f5('0x41')](_0x1afe3e['query'][_0x00f5('0x41')]));_0x5b821d[_0x00f5('0x40')]=_0x5b821d[_0x00f5('0x40')][_0x00f5('0x42')]?_0x5b821d[_0x00f5('0x40')]:_0x3f9086[_0x00f5('0x3c')];if(!_0x1afe3e[_0x00f5('0x3d')][_0x00f5('0x43')](_0x00f5('0x44'))){_0x5b821d[_0x00f5('0x45')]=qs['limit'](_0x1afe3e[_0x00f5('0x3d')][_0x00f5('0x45')]);_0x5b821d['offset']=qs[_0x00f5('0x2a')](_0x1afe3e[_0x00f5('0x3d')]['offset']);}_0x5b821d[_0x00f5('0x46')]=qs[_0x00f5('0x47')](_0x1afe3e['query'][_0x00f5('0x47')]);_0x5b821d['where']=qs[_0x00f5('0x48')](_[_0x00f5('0x49')](_0x1afe3e[_0x00f5('0x3d')],_0x3f9086[_0x00f5('0x48')]),_0x5881ac);if(_0x1afe3e['query']['filter']){_0x5b821d[_0x00f5('0x4a')]=_['merge'](_0x5b821d['where'],{'$or':_[_0x00f5('0x38')](_0x5881ac,function(_0x2821f7){if(_0x2821f7[_0x00f5('0x4b')]!==_0x00f5('0x4c')){var _0x4cda9a={};_0x4cda9a[_0x2821f7['name']]={'$like':'%'+_0x1afe3e['query']['filter']+'%'};return _0x4cda9a;}})});}_0x5b821d=_['merge']({},_0x5b821d,_0x1afe3e[_0x00f5('0x4d')]);var _0x14a2ad={'where':_0x5b821d[_0x00f5('0x4a')]};return db[_0x00f5('0x39')][_0x00f5('0x2c')](_0x14a2ad)['then'](function(_0x4206b0){_0x4cdccf[_0x00f5('0x2c')]=_0x4206b0;if(_0x1afe3e[_0x00f5('0x3d')][_0x00f5('0x4e')]){_0x5b821d[_0x00f5('0x4f')]=[{'all':!![]}];}return db[_0x00f5('0x39')][_0x00f5('0x50')](_0x5b821d);})[_0x00f5('0x32')](function(_0x4d9e2e){_0x4cdccf[_0x00f5('0x51')]=_0x4d9e2e;return _0x4cdccf;})[_0x00f5('0x32')](respondWithFilteredResult(_0x14e09a,_0x5b821d))[_0x00f5('0x25')](handleError(_0x14e09a,null));};exports['show']=function(_0xb90ea6,_0x26b632){var _0x303ef2={'raw':!![],'where':{'id':_0xb90ea6[_0x00f5('0x52')]['id']}},_0x15f978={};_0x15f978[_0x00f5('0x3c')]=_['keys'](db['OpenchannelMessage'][_0x00f5('0x3a')]);_0x15f978[_0x00f5('0x3d')]=_[_0x00f5('0x3e')](_0xb90ea6[_0x00f5('0x3d')]);_0x15f978[_0x00f5('0x48')]=_[_0x00f5('0x3f')](_0x15f978['model'],_0x15f978['query']);_0x303ef2[_0x00f5('0x40')]=_[_0x00f5('0x3f')](_0x15f978[_0x00f5('0x3c')],qs[_0x00f5('0x41')](_0xb90ea6[_0x00f5('0x3d')]['fields']));_0x303ef2[_0x00f5('0x40')]=_0x303ef2[_0x00f5('0x40')][_0x00f5('0x42')]?_0x303ef2[_0x00f5('0x40')]:_0x15f978['model'];if(_0xb90ea6[_0x00f5('0x3d')]['includeAll']){_0x303ef2[_0x00f5('0x4f')]=[{'all':!![]}];}_0x303ef2=_[_0x00f5('0x53')]({},_0x303ef2,_0xb90ea6[_0x00f5('0x4d')]);return db[_0x00f5('0x39')][_0x00f5('0x54')](_0x303ef2)[_0x00f5('0x32')](handleEntityNotFound(_0x26b632,null))['then'](respondWithResult(_0x26b632,null))[_0x00f5('0x25')](handleError(_0x26b632,null));};exports[_0x00f5('0x55')]=function(_0x2c60a9,_0x54d48b){return db['OpenchannelMessage']['create'](_0x2c60a9[_0x00f5('0x56')],{})['then'](respondWithResult(_0x54d48b,0xc9))['catch'](handleError(_0x54d48b,null));};exports['update']=function(_0x2e8cac,_0x20288e){if(_0x2e8cac[_0x00f5('0x56')]['id']){delete _0x2e8cac[_0x00f5('0x56')]['id'];}return db['OpenchannelMessage'][_0x00f5('0x54')]({'where':{'id':_0x2e8cac[_0x00f5('0x52')]['id']}})['then'](handleEntityNotFound(_0x20288e,null))[_0x00f5('0x32')](saveUpdates(_0x2e8cac[_0x00f5('0x56')],null))['then'](respondWithResult(_0x20288e,null))['catch'](handleError(_0x20288e,null));};exports['destroy']=function(_0x5d5844,_0x137217){return db[_0x00f5('0x39')][_0x00f5('0x54')]({'where':{'id':_0x5d5844[_0x00f5('0x52')]['id']}})[_0x00f5('0x32')](handleEntityNotFound(_0x137217,null))['then'](removeEntity(_0x137217,null))[_0x00f5('0x25')](handleError(_0x137217,null));};exports[_0x00f5('0x57')]=function(_0x9fddc4,_0x5b34fd){return db[_0x00f5('0x39')][_0x00f5('0x57')]()[_0x00f5('0x32')](respondWithResult(_0x5b34fd,null))[_0x00f5('0x25')](handleError(_0x5b34fd,null));};var interaction_log=require(_0x00f5('0x58'))(_0x00f5('0x59'));exports['accept']=function(_0x305a8d,_0x4d9322,_0x316ff8){var _0x1ecc93={'agent':{},'channel':_0x00f5('0x5a')};if(_0x305a8d[_0x00f5('0x56')]['id']){delete _0x305a8d[_0x00f5('0x56')]['id'];}_0x305a8d['body'][_0x00f5('0x5b')]=!![];_0x305a8d[_0x00f5('0x56')][_0x00f5('0x5c')]=moment()[_0x00f5('0x5d')](_0x00f5('0x5e'));_0x305a8d[_0x00f5('0x56')][_0x00f5('0x5f')]=_0x305a8d['body']['UserId']||_0x305a8d[_0x00f5('0x60')]['id'];_0x1ecc93[_0x00f5('0x61')]['id']=_0x305a8d['body'][_0x00f5('0x5f')];return db[_0x00f5('0x39')][_0x00f5('0x54')]({'where':{'id':_0x305a8d[_0x00f5('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4d9322,null))[_0x00f5('0x32')](saveUpdates(_0x305a8d['body'],null))[_0x00f5('0x32')](function(_0x20ec67){if(_0x20ec67){_0x1ecc93[_0x00f5('0x23')]=_0x20ec67[_0x00f5('0x62')]({'plain':!![]});return db[_0x00f5('0x63')][_0x00f5('0x54')]({'where':{'id':_0x20ec67[_0x00f5('0x64')]}});}return null;})[_0x00f5('0x32')](handleEntityNotFound(_0x4d9322,null))[_0x00f5('0x32')](function(_0x285ec1){if(_0x285ec1){return _0x285ec1[_0x00f5('0x31')]({'UserId':_0x305a8d['body'][_0x00f5('0x5f')],'read1stAt':_['isNil'](_0x285ec1[_0x00f5('0x65')])?moment()[_0x00f5('0x5d')](_0x00f5('0x5e')):undefined});}return null;})[_0x00f5('0x32')](function(_0x15de8c){if(_0x15de8c){_0x1ecc93[_0x00f5('0x66')]=_0x15de8c[_0x00f5('0x62')]({'plain':!![]});interaction_log[_0x00f5('0x1d')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x305a8d['user']['id'],_0x305a8d[_0x00f5('0x60')]['name'],_0x305a8d[_0x00f5('0x60')][_0x00f5('0x67')],_0x1ecc93[_0x00f5('0x66')]['id'],_0x305a8d[_0x00f5('0x56')]?JSON['stringify'](_0x305a8d[_0x00f5('0x56')]):'null');return respondWithRpcPromise('AcceptMessage',_0x00f5('0x68'),_0x1ecc93);}return null;})['then'](function(_0x39b8dc){var _0x13dcb4=_0x00f5('0x69')+_0x39b8dc[_0x00f5('0x23')][_0x00f5('0x6a')];return db[_0x00f5('0x6b')][_0x00f5('0x3d')](_0x13dcb4,{'type':db[_0x00f5('0x6c')][_0x00f5('0x6d')][_0x00f5('0x6e')],'raw':!![]})[_0x00f5('0x32')](function(_0xfd3a84){return _0xfd3a84;});})[_0x00f5('0x32')](function(_0x419688){if(_0x419688){_0x1ecc93[_0x00f5('0x23')]['contact']=_0x419688[0x0];if(!_0x305a8d[_0x00f5('0x56')][_0x00f5('0x5f')])return;return db['User'][_0x00f5('0x54')]({'where':{'id':_0x305a8d[_0x00f5('0x56')][_0x00f5('0x5f')],'role':_0x00f5('0x61')},'attributes':['id',_0x00f5('0x35'),_0x00f5('0x6f'),_0x00f5('0x70'),_0x00f5('0x71')],'raw':!![]});}return null;})[_0x00f5('0x32')](function(_0x45ace8){if(!_0x45ace8)return null;_0x1ecc93[_0x00f5('0x23')][_0x00f5('0x61')]=_0x45ace8;return _0x1ecc93;})[_0x00f5('0x32')](function(_0x1ae0e0){if(_0x1ae0e0){if(_0x305a8d[_0x00f5('0x56')]['manual']){_0x1ecc93[_0x00f5('0x23')][_0x00f5('0x72')]=util[_0x00f5('0x5d')]('SIP/%s',_0x305a8d['user'][_0x00f5('0x35')]);_0x1ecc93[_0x00f5('0x23')]['channel']=_0x1ecc93['channel'];_0x1ecc93['message'][_0x00f5('0x73')]=_0x1ecc93[_0x00f5('0x74')];_0x1ecc93[_0x00f5('0x23')]['event']=_0x00f5('0x75');return respondWithRpcPromise(_0x00f5('0x76'),_0x00f5('0x76'),{'event':_0x00f5('0x77'),'message':_0x1ecc93[_0x00f5('0x23')]},client9002)[_0x00f5('0x32')](function(){return _0x1ecc93;});}return _0x1ecc93;}return null;})[_0x00f5('0x32')](respondWithResult(_0x4d9322,null))[_0x00f5('0x25')](handleError(_0x4d9322,null));};var interaction_log=require('../../config/logger')(_0x00f5('0x59'));exports[_0x00f5('0x2f')]=function(_0x358ba7,_0x30fadf,_0x19a5f1){var _0x2f4908={'agent':{},'channel':_0x00f5('0x5a')};if(_0x358ba7[_0x00f5('0x56')]['id']){delete _0x358ba7[_0x00f5('0x56')]['id'];}_0x358ba7[_0x00f5('0x56')][_0x00f5('0x5f')]=_0x358ba7[_0x00f5('0x56')][_0x00f5('0x5f')]||_0x358ba7[_0x00f5('0x60')]['id'];_0x2f4908[_0x00f5('0x61')]['id']=_0x358ba7[_0x00f5('0x56')][_0x00f5('0x5f')];return db['OpenchannelMessage'][_0x00f5('0x54')]({'where':{'id':_0x358ba7[_0x00f5('0x52')]['id'],'UserId':null}})[_0x00f5('0x32')](handleEntityNotFound(_0x30fadf,null))[_0x00f5('0x32')](function(_0x193079){if(_0x193079){_0x2f4908[_0x00f5('0x23')]=_0x193079[_0x00f5('0x62')]({'plain':!![]});return db[_0x00f5('0x63')]['find']({'where':{'id':_0x193079[_0x00f5('0x64')]}});}return null;})[_0x00f5('0x32')](handleEntityNotFound(_0x30fadf,null))['then'](function(_0x3281f7){if(_0x3281f7){_0x2f4908[_0x00f5('0x66')]=_0x3281f7[_0x00f5('0x62')]({'plain':!![]});interaction_log[_0x00f5('0x1d')](_0x00f5('0x78'),_0x358ba7['user']['id'],_0x358ba7['user'][_0x00f5('0x35')],_0x358ba7[_0x00f5('0x60')][_0x00f5('0x67')],_0x2f4908[_0x00f5('0x66')]['id'],_0x358ba7[_0x00f5('0x56')]?JSON[_0x00f5('0x79')](_0x358ba7['body']):_0x00f5('0x7a'));return respondWithRpcPromise('RejectMessage',_0x00f5('0x7b'),_0x2f4908);}return null;})['then'](function(_0x34db91){var _0xca2343=_0x00f5('0x69')+_0x34db91[_0x00f5('0x23')][_0x00f5('0x6a')];return db[_0x00f5('0x6b')][_0x00f5('0x3d')](_0xca2343,{'type':db[_0x00f5('0x6c')][_0x00f5('0x6d')][_0x00f5('0x6e')],'raw':!![]})[_0x00f5('0x32')](function(_0xb9852){return _0xb9852;});})[_0x00f5('0x32')](function(_0x2c0c48){if(_0x2c0c48){_0x2f4908['message'][_0x00f5('0x7c')]=_0x2c0c48[0x0];if(!_0x358ba7[_0x00f5('0x56')][_0x00f5('0x5f')])return;return db[_0x00f5('0x7d')][_0x00f5('0x54')]({'where':{'id':_0x358ba7[_0x00f5('0x56')][_0x00f5('0x5f')],'role':_0x00f5('0x61')},'attributes':['id',_0x00f5('0x35'),_0x00f5('0x6f'),_0x00f5('0x70'),_0x00f5('0x71')],'raw':!![]});}return null;})[_0x00f5('0x32')](function(_0x5227bd){if(!_0x5227bd)return null;_0x2f4908[_0x00f5('0x23')][_0x00f5('0x61')]=_0x5227bd;return _0x2f4908;})[_0x00f5('0x32')](function(_0x3ae5c3){if(_0x3ae5c3){_0x3ae5c3[_0x00f5('0x23')][_0x00f5('0x72')]=util['format'](_0x00f5('0x7e'),_0x358ba7[_0x00f5('0x60')]['name']);_0x3ae5c3[_0x00f5('0x23')]['channel']=_0x2f4908[_0x00f5('0x74')];_0x3ae5c3[_0x00f5('0x23')][_0x00f5('0x73')]=_0x2f4908['channel'];_0x3ae5c3['message'][_0x00f5('0x7f')]=_0x00f5('0x2f');respondWithRpcPromise('EventManager',_0x00f5('0x76'),{'event':_0x00f5('0x80'),'message':_0x3ae5c3[_0x00f5('0x23')]},client9002);return _0x2f4908;}return null;})[_0x00f5('0x32')](respondWithResult(_0x30fadf,null))['catch'](handleError(_0x30fadf,null));}; \ No newline at end of file +var _0xfb90=['motionChannel','event','rejectmessage','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','destroy','status','stack','name','send','index','map','OpenchannelMessage','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','rawAttributes','find','create','body','update','describe','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','role','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','channel','EventManager','acceptmessage','openchannel-interactions','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','ContactId','internal'];(function(_0x4e2379,_0x4167ef){var _0x432580=function(_0x50fcef){while(--_0x50fcef){_0x4e2379['push'](_0x4e2379['shift']());}};_0x432580(++_0x4167ef);}(_0xfb90,0x18f));var _0x0fb9=function(_0xac3027,_0x59d1d9){_0xac3027=_0xac3027-0x0;var _0x4cc775=_0xfb90[_0xac3027];return _0x4cc775;};'use strict';var emlformat=require(_0x0fb9('0x0'));var rimraf=require(_0x0fb9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fb9('0x2'));var rp=require('request-promise');var moment=require(_0x0fb9('0x3'));var BPromise=require(_0x0fb9('0x4'));var Mustache=require(_0x0fb9('0x5'));var util=require(_0x0fb9('0x6'));var path=require('path');var sox=require(_0x0fb9('0x7'));var csv=require(_0x0fb9('0x8'));var ejs=require(_0x0fb9('0x9'));var fs=require('fs');var fs_extra=require(_0x0fb9('0xa'));var _=require(_0x0fb9('0xb'));var squel=require('squel');var crypto=require(_0x0fb9('0xc'));var jsforce=require(_0x0fb9('0xd'));var deskjs=require(_0x0fb9('0xe'));var toCsv=require(_0x0fb9('0x8'));var querystring=require(_0x0fb9('0xf'));var Papa=require('papaparse');var Redis=require(_0x0fb9('0x10'));var authService=require(_0x0fb9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0fb9('0x12'));var hardwareService=require(_0x0fb9('0x13'));var logger=require(_0x0fb9('0x14'))(_0x0fb9('0x15'));var utils=require(_0x0fb9('0x16'));var config=require(_0x0fb9('0x17'));var licenseUtil=require(_0x0fb9('0x18'));var db=require('../../mysqldb')['db'];config[_0x0fb9('0x19')]=_[_0x0fb9('0x1a')](config['redis'],{'host':_0x0fb9('0x1b'),'port':0x18eb});var socket=require(_0x0fb9('0x1c'))(new Redis(config[_0x0fb9('0x19')]));require(_0x0fb9('0x1d'))[_0x0fb9('0x1e')](socket);var jayson=require(_0x0fb9('0x1f'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x0fb9('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ae91f,_0x5d616e,_0x481801,_0x42b870){return new BPromise(function(_0x1025c7,_0xcc5c20){var _0x5002bb=_0x42b870||client;return _0x5002bb[_0x0fb9('0x21')](_0x3ae91f,_0x481801)[_0x0fb9('0x22')](function(_0x4132e7){logger[_0x0fb9('0x23')](_0x0fb9('0x24'),_0x5d616e,'request\x20sent');logger[_0x0fb9('0x25')](_0x0fb9('0x26'),_0x5d616e,_0x0fb9('0x27'),JSON[_0x0fb9('0x28')](_0x4132e7));if(_0x4132e7['error']){if(_0x4132e7[_0x0fb9('0x29')]['code']===0x1f4){logger[_0x0fb9('0x29')](_0x0fb9('0x24'),_0x5d616e,_0x4132e7['error']['message']);return _0xcc5c20(_0x4132e7[_0x0fb9('0x29')][_0x0fb9('0x2a')]);}logger[_0x0fb9('0x29')](_0x0fb9('0x24'),_0x5d616e,_0x4132e7[_0x0fb9('0x29')][_0x0fb9('0x2a')]);return _0x1025c7(_0x4132e7[_0x0fb9('0x29')]['message']);}else{logger[_0x0fb9('0x23')](_0x0fb9('0x24'),_0x5d616e,_0x0fb9('0x27'));_0x1025c7(_0x4132e7[_0x0fb9('0x2b')][_0x0fb9('0x2a')]);}})[_0x0fb9('0x2c')](function(_0x4fbdf0){logger[_0x0fb9('0x29')](_0x0fb9('0x24'),_0x5d616e,_0x4fbdf0);_0xcc5c20(_0x4fbdf0);});});}function respondWithStatusCode(_0x583d9c,_0x54bccf){_0x54bccf=_0x54bccf||0xcc;return function(_0x473bf3){if(_0x473bf3){return _0x583d9c['sendStatus'](_0x54bccf);}return _0x583d9c['status'](_0x54bccf)[_0x0fb9('0x2d')]();};}function respondWithResult(_0x1ed1bb,_0xa354f6){_0xa354f6=_0xa354f6||0xc8;return function(_0x32cc26){if(_0x32cc26){return _0x1ed1bb['status'](_0xa354f6)[_0x0fb9('0x2e')](_0x32cc26);}};}function respondWithFilteredResult(_0x52aa24,_0x4a7af6){return function(_0x508d12){if(_0x508d12){var _0x35928d=typeof _0x4a7af6['offset']==='undefined'&&typeof _0x4a7af6['limit']===_0x0fb9('0x2f');var _0x23c781=_0x508d12[_0x0fb9('0x30')];var _0x397ef2=_0x35928d?0x0:_0x4a7af6['offset'];var _0x50b158=_0x35928d?_0x508d12[_0x0fb9('0x30')]:_0x4a7af6[_0x0fb9('0x31')]+_0x4a7af6[_0x0fb9('0x32')];var _0xead15c;if(_0x50b158>=_0x23c781){_0x50b158=_0x23c781;_0xead15c=0xc8;}else{_0xead15c=0xce;}_0x52aa24['status'](_0xead15c);return _0x52aa24[_0x0fb9('0x33')](_0x0fb9('0x34'),_0x397ef2+'-'+_0x50b158+'/'+_0x23c781)[_0x0fb9('0x2e')](_0x508d12);}return null;};}function patchUpdates(_0x409465){return function(_0x3a0245){try{jsonpatch[_0x0fb9('0x35')](_0x3a0245,_0x409465,!![]);}catch(_0x5f38be){return BPromise[_0x0fb9('0x36')](_0x5f38be);}return _0x3a0245['save']();};}function saveUpdates(_0x30cf43,_0x826a1){return function(_0x484084){if(_0x484084){return _0x484084['update'](_0x30cf43)[_0x0fb9('0x22')](function(_0x374085){return _0x374085;});}return null;};}function removeEntity(_0x5e82bf,_0x2df607){return function(_0x49ccd1){if(_0x49ccd1){return _0x49ccd1[_0x0fb9('0x37')]()['then'](function(){_0x5e82bf[_0x0fb9('0x38')](0xcc)[_0x0fb9('0x2d')]();});}};}function handleEntityNotFound(_0x4296d0,_0x45e9ac){return function(_0x448842){if(!_0x448842){_0x4296d0['sendStatus'](0x194);}return _0x448842;};}function handleError(_0x4dd908,_0x1ee32b){_0x1ee32b=_0x1ee32b||0x1f4;return function(_0x157c56){logger[_0x0fb9('0x29')](_0x157c56[_0x0fb9('0x39')]);if(_0x157c56[_0x0fb9('0x3a')]){delete _0x157c56[_0x0fb9('0x3a')];}_0x4dd908['status'](_0x1ee32b)[_0x0fb9('0x3b')](_0x157c56);};}exports[_0x0fb9('0x3c')]=function(_0x349ed8,_0x5ab0eb){var _0x32e4c4={},_0x35b64b={},_0x41afe1={'count':0x0,'rows':[]};var _0x158b00=_[_0x0fb9('0x3d')](db[_0x0fb9('0x3e')]['rawAttributes'],function(_0x3fb900){return{'name':_0x3fb900[_0x0fb9('0x3f')],'type':_0x3fb900[_0x0fb9('0x40')][_0x0fb9('0x41')]};});_0x35b64b[_0x0fb9('0x42')]=_[_0x0fb9('0x3d')](_0x158b00,_0x0fb9('0x3a'));_0x35b64b['query']=_[_0x0fb9('0x43')](_0x349ed8[_0x0fb9('0x44')]);_0x35b64b['filters']=_[_0x0fb9('0x45')](_0x35b64b[_0x0fb9('0x42')],_0x35b64b[_0x0fb9('0x44')]);_0x32e4c4[_0x0fb9('0x46')]=_[_0x0fb9('0x45')](_0x35b64b[_0x0fb9('0x42')],qs['fields'](_0x349ed8[_0x0fb9('0x44')][_0x0fb9('0x47')]));_0x32e4c4['attributes']=_0x32e4c4[_0x0fb9('0x46')][_0x0fb9('0x48')]?_0x32e4c4['attributes']:_0x35b64b[_0x0fb9('0x42')];if(!_0x349ed8[_0x0fb9('0x44')][_0x0fb9('0x49')]('nolimit')){_0x32e4c4['limit']=qs[_0x0fb9('0x32')](_0x349ed8[_0x0fb9('0x44')][_0x0fb9('0x32')]);_0x32e4c4['offset']=qs[_0x0fb9('0x31')](_0x349ed8[_0x0fb9('0x44')]['offset']);}_0x32e4c4[_0x0fb9('0x4a')]=qs['sort'](_0x349ed8[_0x0fb9('0x44')][_0x0fb9('0x4b')]);_0x32e4c4[_0x0fb9('0x4c')]=qs[_0x0fb9('0x4d')](_[_0x0fb9('0x4e')](_0x349ed8[_0x0fb9('0x44')],_0x35b64b['filters']),_0x158b00);if(_0x349ed8[_0x0fb9('0x44')][_0x0fb9('0x4f')]){_0x32e4c4[_0x0fb9('0x4c')]=_[_0x0fb9('0x50')](_0x32e4c4[_0x0fb9('0x4c')],{'$or':_[_0x0fb9('0x3d')](_0x158b00,function(_0x1db7c4){if(_0x1db7c4[_0x0fb9('0x40')]!==_0x0fb9('0x51')){var _0xc22daa={};_0xc22daa[_0x1db7c4[_0x0fb9('0x3a')]]={'$like':'%'+_0x349ed8['query'][_0x0fb9('0x4f')]+'%'};return _0xc22daa;}})});}_0x32e4c4=_[_0x0fb9('0x50')]({},_0x32e4c4,_0x349ed8[_0x0fb9('0x52')]);var _0x265b60={'where':_0x32e4c4[_0x0fb9('0x4c')]};return db[_0x0fb9('0x3e')]['count'](_0x265b60)['then'](function(_0x212270){_0x41afe1['count']=_0x212270;if(_0x349ed8['query'][_0x0fb9('0x53')]){_0x32e4c4[_0x0fb9('0x54')]=[{'all':!![]}];}return db[_0x0fb9('0x3e')]['findAll'](_0x32e4c4);})[_0x0fb9('0x22')](function(_0x284b90){_0x41afe1[_0x0fb9('0x55')]=_0x284b90;return _0x41afe1;})[_0x0fb9('0x22')](respondWithFilteredResult(_0x5ab0eb,_0x32e4c4))[_0x0fb9('0x2c')](handleError(_0x5ab0eb,null));};exports['show']=function(_0x2bc3eb,_0x1ffe05){var _0x2350a0={'raw':!![],'where':{'id':_0x2bc3eb[_0x0fb9('0x56')]['id']}},_0x40a0e3={};_0x40a0e3['model']=_[_0x0fb9('0x43')](db['OpenchannelMessage'][_0x0fb9('0x57')]);_0x40a0e3['query']=_['keys'](_0x2bc3eb[_0x0fb9('0x44')]);_0x40a0e3[_0x0fb9('0x4d')]=_[_0x0fb9('0x45')](_0x40a0e3['model'],_0x40a0e3[_0x0fb9('0x44')]);_0x2350a0[_0x0fb9('0x46')]=_[_0x0fb9('0x45')](_0x40a0e3[_0x0fb9('0x42')],qs['fields'](_0x2bc3eb[_0x0fb9('0x44')]['fields']));_0x2350a0[_0x0fb9('0x46')]=_0x2350a0[_0x0fb9('0x46')]['length']?_0x2350a0[_0x0fb9('0x46')]:_0x40a0e3['model'];if(_0x2bc3eb['query']['includeAll']){_0x2350a0[_0x0fb9('0x54')]=[{'all':!![]}];}_0x2350a0=_[_0x0fb9('0x50')]({},_0x2350a0,_0x2bc3eb[_0x0fb9('0x52')]);return db[_0x0fb9('0x3e')][_0x0fb9('0x58')](_0x2350a0)['then'](handleEntityNotFound(_0x1ffe05,null))[_0x0fb9('0x22')](respondWithResult(_0x1ffe05,null))[_0x0fb9('0x2c')](handleError(_0x1ffe05,null));};exports[_0x0fb9('0x59')]=function(_0x5f46a6,_0x2a2097){return db[_0x0fb9('0x3e')][_0x0fb9('0x59')](_0x5f46a6[_0x0fb9('0x5a')],{})[_0x0fb9('0x22')](respondWithResult(_0x2a2097,0xc9))['catch'](handleError(_0x2a2097,null));};exports[_0x0fb9('0x5b')]=function(_0x56d30e,_0x3c5d4e){if(_0x56d30e['body']['id']){delete _0x56d30e[_0x0fb9('0x5a')]['id'];}return db[_0x0fb9('0x3e')][_0x0fb9('0x58')]({'where':{'id':_0x56d30e['params']['id']}})[_0x0fb9('0x22')](handleEntityNotFound(_0x3c5d4e,null))['then'](saveUpdates(_0x56d30e['body'],null))[_0x0fb9('0x22')](respondWithResult(_0x3c5d4e,null))[_0x0fb9('0x2c')](handleError(_0x3c5d4e,null));};exports[_0x0fb9('0x37')]=function(_0xa5a8ea,_0x54f663){return db[_0x0fb9('0x3e')][_0x0fb9('0x58')]({'where':{'id':_0xa5a8ea['params']['id']}})['then'](handleEntityNotFound(_0x54f663,null))[_0x0fb9('0x22')](removeEntity(_0x54f663,null))[_0x0fb9('0x2c')](handleError(_0x54f663,null));};exports[_0x0fb9('0x5c')]=function(_0x80fffa,_0x59698f){return db[_0x0fb9('0x3e')][_0x0fb9('0x5c')]()[_0x0fb9('0x22')](respondWithResult(_0x59698f,null))[_0x0fb9('0x2c')](handleError(_0x59698f,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x0fb9('0x5d')]=function(_0x7aff55,_0x1cee88,_0x3ab581){var _0xb23119={'agent':{},'channel':'openchannel'};if(_0x7aff55[_0x0fb9('0x5a')]['id']){delete _0x7aff55[_0x0fb9('0x5a')]['id'];}_0x7aff55[_0x0fb9('0x5a')][_0x0fb9('0x5e')]=!![];_0x7aff55['body']['readAt']=moment()[_0x0fb9('0x5f')](_0x0fb9('0x60'));_0x7aff55[_0x0fb9('0x5a')]['UserId']=_0x7aff55[_0x0fb9('0x5a')][_0x0fb9('0x61')]||_0x7aff55[_0x0fb9('0x62')]['id'];_0xb23119[_0x0fb9('0x63')]['id']=_0x7aff55[_0x0fb9('0x5a')][_0x0fb9('0x61')];return db[_0x0fb9('0x3e')][_0x0fb9('0x58')]({'where':{'id':_0x7aff55[_0x0fb9('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1cee88,null))['then'](saveUpdates(_0x7aff55[_0x0fb9('0x5a')],null))[_0x0fb9('0x22')](function(_0x722fd0){if(_0x722fd0){_0xb23119[_0x0fb9('0x2a')]=_0x722fd0[_0x0fb9('0x64')]({'plain':!![]});return db[_0x0fb9('0x65')][_0x0fb9('0x58')]({'where':{'id':_0x722fd0[_0x0fb9('0x66')]}});}return null;})[_0x0fb9('0x22')](handleEntityNotFound(_0x1cee88,null))[_0x0fb9('0x22')](function(_0x282a36){if(_0x282a36){return _0x282a36[_0x0fb9('0x5b')]({'UserId':_0x7aff55[_0x0fb9('0x5a')][_0x0fb9('0x61')],'read1stAt':_[_0x0fb9('0x67')](_0x282a36[_0x0fb9('0x68')])?moment()[_0x0fb9('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0fb9('0x22')](function(_0xcbc617){if(_0xcbc617){_0xb23119[_0x0fb9('0x69')]=_0xcbc617[_0x0fb9('0x64')]({'plain':!![]});interaction_log[_0x0fb9('0x23')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x7aff55[_0x0fb9('0x62')]['id'],_0x7aff55[_0x0fb9('0x62')][_0x0fb9('0x3a')],_0x7aff55[_0x0fb9('0x62')][_0x0fb9('0x6a')],_0xb23119[_0x0fb9('0x69')]['id'],_0x7aff55['body']?JSON['stringify'](_0x7aff55[_0x0fb9('0x5a')]):'null');return respondWithRpcPromise(_0x0fb9('0x6b'),_0x0fb9('0x6c'),_0xb23119);}return null;})['then'](function(_0x325ee2){var _0x5121e4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x325ee2[_0x0fb9('0x2a')]['ContactId'];return db[_0x0fb9('0x6d')][_0x0fb9('0x44')](_0x5121e4,{'type':db[_0x0fb9('0x6e')][_0x0fb9('0x6f')][_0x0fb9('0x70')],'raw':!![]})[_0x0fb9('0x22')](function(_0x2c75a3){return _0x2c75a3;});})['then'](function(_0x43d0e7){if(_0x43d0e7){_0xb23119[_0x0fb9('0x2a')][_0x0fb9('0x71')]=_0x43d0e7[0x0];if(!_0x7aff55['body'][_0x0fb9('0x61')])return;return db[_0x0fb9('0x72')][_0x0fb9('0x58')]({'where':{'id':_0x7aff55['body'][_0x0fb9('0x61')],'role':_0x0fb9('0x63')},'attributes':['id','name',_0x0fb9('0x73'),_0x0fb9('0x74'),'internal'],'raw':!![]});}return null;})[_0x0fb9('0x22')](function(_0xe2e11){if(!_0xe2e11)return null;_0xb23119[_0x0fb9('0x2a')][_0x0fb9('0x63')]=_0xe2e11;return _0xb23119;})[_0x0fb9('0x22')](function(_0x58e099){if(_0x58e099){if(_0x7aff55[_0x0fb9('0x5a')][_0x0fb9('0x75')]){_0xb23119[_0x0fb9('0x2a')][_0x0fb9('0x76')]=util[_0x0fb9('0x5f')]('SIP/%s',_0x7aff55[_0x0fb9('0x62')][_0x0fb9('0x3a')]);_0xb23119[_0x0fb9('0x2a')][_0x0fb9('0x77')]=_0xb23119[_0x0fb9('0x77')];_0xb23119['message']['motionChannel']=_0xb23119[_0x0fb9('0x77')];_0xb23119[_0x0fb9('0x2a')]['event']='accept';return respondWithRpcPromise('EventManager',_0x0fb9('0x78'),{'event':_0x0fb9('0x79'),'message':_0xb23119[_0x0fb9('0x2a')]},client9002)[_0x0fb9('0x22')](function(){return _0xb23119;});}return _0xb23119;}return null;})[_0x0fb9('0x22')](respondWithResult(_0x1cee88,null))[_0x0fb9('0x2c')](handleError(_0x1cee88,null));};var interaction_log=require('../../config/logger')(_0x0fb9('0x7a'));exports[_0x0fb9('0x36')]=function(_0x2703b0,_0x4c8e8f,_0x5b35ef){var _0x5efd9c={'agent':{},'channel':_0x0fb9('0x7b')};if(_0x2703b0[_0x0fb9('0x5a')]['id']){delete _0x2703b0[_0x0fb9('0x5a')]['id'];}_0x2703b0[_0x0fb9('0x5a')][_0x0fb9('0x61')]=_0x2703b0['body']['UserId']||_0x2703b0[_0x0fb9('0x62')]['id'];_0x5efd9c[_0x0fb9('0x63')]['id']=_0x2703b0[_0x0fb9('0x5a')][_0x0fb9('0x61')];return db[_0x0fb9('0x3e')]['find']({'where':{'id':_0x2703b0[_0x0fb9('0x56')]['id'],'UserId':null}})[_0x0fb9('0x22')](handleEntityNotFound(_0x4c8e8f,null))[_0x0fb9('0x22')](function(_0x25c5ea){if(_0x25c5ea){_0x5efd9c[_0x0fb9('0x2a')]=_0x25c5ea[_0x0fb9('0x64')]({'plain':!![]});return db[_0x0fb9('0x65')]['find']({'where':{'id':_0x25c5ea['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4c8e8f,null))[_0x0fb9('0x22')](function(_0x22f79d){if(_0x22f79d){_0x5efd9c[_0x0fb9('0x69')]=_0x22f79d['get']({'plain':!![]});interaction_log['info'](_0x0fb9('0x7c'),_0x2703b0['user']['id'],_0x2703b0[_0x0fb9('0x62')][_0x0fb9('0x3a')],_0x2703b0['user'][_0x0fb9('0x6a')],_0x5efd9c[_0x0fb9('0x69')]['id'],_0x2703b0[_0x0fb9('0x5a')]?JSON['stringify'](_0x2703b0['body']):_0x0fb9('0x7d'));return respondWithRpcPromise(_0x0fb9('0x7e'),'rejectMessage',_0x5efd9c);}return null;})[_0x0fb9('0x22')](function(_0x24d4a4){var _0x243f35='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x24d4a4['message'][_0x0fb9('0x7f')];return db[_0x0fb9('0x6d')][_0x0fb9('0x44')](_0x243f35,{'type':db[_0x0fb9('0x6e')]['QueryTypes'][_0x0fb9('0x70')],'raw':!![]})['then'](function(_0x123794){return _0x123794;});})[_0x0fb9('0x22')](function(_0x3a5b5a){if(_0x3a5b5a){_0x5efd9c[_0x0fb9('0x2a')][_0x0fb9('0x71')]=_0x3a5b5a[0x0];if(!_0x2703b0[_0x0fb9('0x5a')][_0x0fb9('0x61')])return;return db[_0x0fb9('0x72')][_0x0fb9('0x58')]({'where':{'id':_0x2703b0[_0x0fb9('0x5a')]['UserId'],'role':_0x0fb9('0x63')},'attributes':['id',_0x0fb9('0x3a'),_0x0fb9('0x73'),'email',_0x0fb9('0x80')],'raw':!![]});}return null;})[_0x0fb9('0x22')](function(_0x554e5e){if(!_0x554e5e)return null;_0x5efd9c['message'][_0x0fb9('0x63')]=_0x554e5e;return _0x5efd9c;})[_0x0fb9('0x22')](function(_0x27b263){if(_0x27b263){_0x27b263['message']['interface']=util[_0x0fb9('0x5f')]('SIP/%s',_0x2703b0[_0x0fb9('0x62')][_0x0fb9('0x3a')]);_0x27b263[_0x0fb9('0x2a')][_0x0fb9('0x77')]=_0x5efd9c[_0x0fb9('0x77')];_0x27b263[_0x0fb9('0x2a')][_0x0fb9('0x81')]=_0x5efd9c[_0x0fb9('0x77')];_0x27b263[_0x0fb9('0x2a')][_0x0fb9('0x82')]=_0x0fb9('0x36');respondWithRpcPromise(_0x0fb9('0x78'),_0x0fb9('0x78'),{'event':_0x0fb9('0x83'),'message':_0x27b263[_0x0fb9('0x2a')]},client9002);return _0x5efd9c;}return null;})['then'](respondWithResult(_0x4c8e8f,null))['catch'](handleError(_0x4c8e8f,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index c2c804e..13a82b1 100644 --- a/server/api/openchannelMessage/openchannelMessage.events.js +++ b/server/api/openchannelMessage/openchannelMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x37dd=['save','update','remove','emit','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x37dd,0x1d0));var _0xd37d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x37dd[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd37d('0x0'));var OpenchannelMessage=require(_0xd37d('0x1'))['db'][_0xd37d('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xd37d('0x3')](0x0);var events={'afterCreate':_0xd37d('0x4'),'afterUpdate':_0xd37d('0x5'),'afterDestroy':_0xd37d('0x6')};function emitEvent(_0x47e279){return function(_0x547556,_0x45859c,_0x3444e8){OpenchannelMessageEvents[_0xd37d('0x7')](_0x47e279+':'+_0x547556['id'],_0x547556);OpenchannelMessageEvents[_0xd37d('0x7')](_0x47e279,_0x547556);_0x3444e8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xd37d('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0xb266=['events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x5941f9,_0x1261f1){var _0xbdc9f9=function(_0xcc6abe){while(--_0xcc6abe){_0x5941f9['push'](_0x5941f9['shift']());}};_0xbdc9f9(++_0x1261f1);}(_0xb266,0x18c));var _0x6b26=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xb266[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0x6b26('0x0'));var OpenchannelMessage=require(_0x6b26('0x1'))['db'][_0x6b26('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x6b26('0x3')](0x0);var events={'afterCreate':_0x6b26('0x4'),'afterUpdate':_0x6b26('0x5'),'afterDestroy':'remove'};function emitEvent(_0x57a235){return function(_0x48a723,_0x256482,_0xac7bd0){OpenchannelMessageEvents[_0x6b26('0x6')](_0x57a235+':'+_0x48a723['id'],_0x48a723);OpenchannelMessageEvents['emit'](_0x57a235,_0x48a723);_0xac7bd0(null);};}for(var e in events){if(events[_0x6b26('0x7')](e)){var event=events[e];OpenchannelMessage[_0x6b26('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 3e23bce..e54b591 100644 --- a/server/api/openchannelMessage/openchannelMessage.model.js +++ b/server/api/openchannelMessage/openchannelMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd753=['find','OpenchannelAccountId','Interactions','Contact','replyUri','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','models','toLowerCase','direction','out','secret','isNil','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount'];(function(_0x3013fb,_0x5017dc){var _0x1951f2=function(_0x19f057){while(--_0x19f057){_0x3013fb['push'](_0x3013fb['shift']());}};_0x1951f2(++_0x5017dc);}(_0xd753,0x191));var _0x3d75=function(_0x446bd3,_0x4b4cca){_0x446bd3=_0x446bd3-0x0;var _0x4a2216=_0xd753[_0x446bd3];return _0x4a2216;};'use strict';var _=require(_0x3d75('0x0'));var util=require(_0x3d75('0x1'));var logger=require('../../config/logger')(_0x3d75('0x2'));var moment=require(_0x3d75('0x3'));var BPromise=require(_0x3d75('0x4'));var rp=require(_0x3d75('0x5'));var fs=require('fs');var path=require(_0x3d75('0x6'));var rimraf=require(_0x3d75('0x7'));var config=require('../../config/environment');var attributes=require(_0x3d75('0x8'));module[_0x3d75('0x9')]=function(_0x2a657e,_0x47e8fc){return _0x2a657e[_0x3d75('0xa')](_0x3d75('0xb'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x3d75('0xc'),'fields':[_0x3d75('0xd')],'type':_0x3d75('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5960c3,_0x117242,_0x4f6150){var _0x268f80=_0x2a657e[_0x3d75('0xf')];var _0x292e5d=_0x5960c3['get']({'plain':!![]});if(_0x292e5d['direction'][_0x3d75('0x10')]()==='in'||_0x292e5d[_0x3d75('0x11')][_0x3d75('0x10')]()===_0x3d75('0x12')&&!_0x292e5d[_0x3d75('0x13')]&&!_[_0x3d75('0x14')](_0x292e5d['UserId'])){_0x268f80[_0x3d75('0x15')]['findOne']({'where':{'id':_0x292e5d[_0x3d75('0x16')]}})[_0x3d75('0x17')](function(_0x466026){if(_0x466026){_0x466026[_0x3d75('0x18')]({'lastMsgAt':_0x292e5d[_0x3d75('0x19')],'lastMsgDirection':_0x292e5d[_0x3d75('0x11')][_0x3d75('0x10')]()});}})[_0x3d75('0x1a')](function(_0x9d4f04){console[_0x3d75('0x1b')](_0x9d4f04);});}if(_0x292e5d[_0x3d75('0x11')]==='out'&&!_0x292e5d[_0x3d75('0x13')]){var _0xa64be9;_0x268f80[_0x3d75('0x1c')][_0x3d75('0x1d')]()[_0x3d75('0x17')](function(_0x4b59a1){return _0x268f80[_0x3d75('0x1e')][_0x3d75('0x1f')]({'where':{'id':_0x292e5d[_0x3d75('0x20')]},'include':[{'model':_0x268f80[_0x3d75('0x15')],'as':_0x3d75('0x21'),'where':{'id':_0x292e5d[_0x3d75('0x16')]},'limit':0x1,'include':[{'model':_0x268f80[_0x3d75('0x1c')],'as':_0x3d75('0x22'),'attributes':_['keys'](_0x4b59a1)}]}]});})[_0x3d75('0x17')](function(_0x34a546){_0xa64be9=_0x34a546['get']({'plain':!![]});if(_0xa64be9&&_0xa64be9[_0x3d75('0x23')]){logger['info'](_0x3d75('0x24'),'afterCreate',util[_0x3d75('0x25')](_0x3d75('0x26'),_0x292e5d['id'],_0xa64be9['replyUri']));if(_0xa64be9[_0x3d75('0x21')]&&_0xa64be9[_0x3d75('0x21')]['length']){_0x292e5d[_0x3d75('0x27')]=_['omit'](_0xa64be9[_0x3d75('0x21')][0x0],'Contact');_0x292e5d[_0x3d75('0x22')]=_0xa64be9[_0x3d75('0x21')][0x0][_0x3d75('0x22')];}var _0x117242={'method':_0x3d75('0x28'),'uri':encodeURI(_0xa64be9[_0x3d75('0x23')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x117242[_0x3d75('0x29')]){case _0x3d75('0x2a'):_0x117242['qs']=_0x292e5d;break;case _0x3d75('0x28'):_0x117242['body']=_0x292e5d;break;}return rp(_0x117242)[_0x3d75('0x17')](function(_0x1524f5){logger['info'](_0x3d75('0x24'),'afterCreate',util[_0x3d75('0x25')](_0x3d75('0x2b'),_0x292e5d['id'],_0xa64be9['replyUri']));if(_0x1524f5['body'][_0x3d75('0x2c')]&&_0x1524f5['body']['threadId']!=_0x292e5d[_0x3d75('0x27')][_0x3d75('0x2c')]){return _0x268f80[_0x3d75('0x15')][_0x3d75('0x18')]({'threadId':_0x1524f5[_0x3d75('0xd')][_0x3d75('0x2c')]},{'where':{'id':_0x292e5d[_0x3d75('0x27')]['id']}});}else{return;}})['then'](function(){return _0x5960c3[_0x3d75('0x18')]({'read':!![]});})[_0x3d75('0x1a')](function(_0x1930e1){logger[_0x3d75('0x1b')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x3d75('0x2d')](_0x1930e1,{'showHidden':![],'depth':null}));_0x4f6150();});}else{_0x4f6150();}})['finally'](function(){_0x4f6150();});}else{_0x4f6150();}}},'charset':_0x3d75('0x2e'),'collate':_0x3d75('0x2f')});}; \ No newline at end of file +var _0x840e=['isNil','UserId','findOne','OpenchannelInteractionId','createdAt','catch','secret','CmContact','describe','then','OpenchannelAccount','OpenchannelAccountId','OpenchannelInteraction','Interactions','keys','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','Contact','replyUri','GET','body','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','inspect','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','toLowerCase','direction','out'];(function(_0x2a14fb,_0x6f1e5d){var _0x2a9180=function(_0x5b21b2){while(--_0x5b21b2){_0x2a14fb['push'](_0x2a14fb['shift']());}};_0x2a9180(++_0x6f1e5d);}(_0x840e,0xba));var _0xe840=function(_0x3a331e,_0x7db48b){_0x3a331e=_0x3a331e-0x0;var _0x2684a6=_0x840e[_0x3a331e];return _0x2684a6;};'use strict';var _=require('lodash');var util=require(_0xe840('0x0'));var logger=require('../../config/logger')(_0xe840('0x1'));var moment=require(_0xe840('0x2'));var BPromise=require(_0xe840('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe840('0x4'));var rimraf=require(_0xe840('0x5'));var config=require(_0xe840('0x6'));var attributes=require(_0xe840('0x7'));module[_0xe840('0x8')]=function(_0x5f9777,_0x14f9a4){return _0x5f9777[_0xe840('0x9')]('OpenchannelMessage',attributes,{'tableName':_0xe840('0xa'),'paranoid':![],'indexes':[{'name':_0xe840('0xb'),'fields':['body'],'type':_0xe840('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x372192,_0x4cc36d,_0x4219e2){var _0x4be5a0=_0x5f9777[_0xe840('0xd')];var _0x3a6200=_0x372192[_0xe840('0xe')]({'plain':!![]});if(_0x3a6200['direction'][_0xe840('0xf')]()==='in'||_0x3a6200[_0xe840('0x10')]['toLowerCase']()===_0xe840('0x11')&&!_0x3a6200['secret']&&!_[_0xe840('0x12')](_0x3a6200[_0xe840('0x13')])){_0x4be5a0['OpenchannelInteraction'][_0xe840('0x14')]({'where':{'id':_0x3a6200[_0xe840('0x15')]}})['then'](function(_0x4955a2){if(_0x4955a2){_0x4955a2['update']({'lastMsgAt':_0x3a6200[_0xe840('0x16')],'lastMsgDirection':_0x3a6200[_0xe840('0x10')]['toLowerCase']()});}})[_0xe840('0x17')](function(_0x6fb269){console['error'](_0x6fb269);});}if(_0x3a6200[_0xe840('0x10')]===_0xe840('0x11')&&!_0x3a6200[_0xe840('0x18')]){var _0x204b82;_0x4be5a0[_0xe840('0x19')][_0xe840('0x1a')]()[_0xe840('0x1b')](function(_0x339fe6){return _0x4be5a0[_0xe840('0x1c')]['find']({'where':{'id':_0x3a6200[_0xe840('0x1d')]},'include':[{'model':_0x4be5a0[_0xe840('0x1e')],'as':_0xe840('0x1f'),'where':{'id':_0x3a6200[_0xe840('0x15')]},'limit':0x1,'include':[{'model':_0x4be5a0[_0xe840('0x19')],'as':'Contact','attributes':_[_0xe840('0x20')](_0x339fe6)}]}]});})[_0xe840('0x1b')](function(_0xc91ad2){_0x204b82=_0xc91ad2[_0xe840('0xe')]({'plain':!![]});if(_0x204b82&&_0x204b82['replyUri']){logger[_0xe840('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0xe840('0x22'),util[_0xe840('0x23')](_0xe840('0x24'),_0x3a6200['id'],_0x204b82['replyUri']));if(_0x204b82['Interactions']&&_0x204b82['Interactions'][_0xe840('0x25')]){_0x3a6200[_0xe840('0x26')]=_[_0xe840('0x27')](_0x204b82[_0xe840('0x1f')][0x0],_0xe840('0x28'));_0x3a6200['Contact']=_0x204b82[_0xe840('0x1f')][0x0]['Contact'];}var _0x4cc36d={'method':'POST','uri':encodeURI(_0x204b82[_0xe840('0x29')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4cc36d['method']){case _0xe840('0x2a'):_0x4cc36d['qs']=_0x3a6200;break;case'POST':_0x4cc36d[_0xe840('0x2b')]=_0x3a6200;break;}return rp(_0x4cc36d)[_0xe840('0x1b')](function(_0xbbe6d1){logger[_0xe840('0x21')](_0xe840('0x2c'),_0xe840('0x22'),util[_0xe840('0x23')](_0xe840('0x2d'),_0x3a6200['id'],_0x204b82['replyUri']));if(_0xbbe6d1[_0xe840('0x2b')][_0xe840('0x2e')]&&_0xbbe6d1[_0xe840('0x2b')][_0xe840('0x2e')]!=_0x3a6200['Interaction'][_0xe840('0x2e')]){return _0x4be5a0[_0xe840('0x1e')][_0xe840('0x2f')]({'threadId':_0xbbe6d1[_0xe840('0x2b')][_0xe840('0x2e')]},{'where':{'id':_0x3a6200['Interaction']['id']}});}else{return;}})[_0xe840('0x1b')](function(){return _0x372192[_0xe840('0x2f')]({'read':!![]});})[_0xe840('0x17')](function(_0x28790c){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0xe840('0x22'),util[_0xe840('0x30')](_0x28790c,{'showHidden':![],'depth':null}));_0x4219e2();});}else{_0x4219e2();}})['finally'](function(){_0x4219e2();});}else{_0x4219e2();}}},'charset':_0xe840('0x31'),'collate':_0xe840('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 71a4c02..f68ef60 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x45aca3,_0x2dc880){var _0x540d06=function(_0x1ca425){while(--_0x1ca425){_0x45aca3['push'](_0x45aca3['shift']());}};_0x540d06(++_0x2dc880);}(_0xdb28,0x106));var _0x8db2=function(_0x3215ff,_0x349c84){_0x3215ff=_0x3215ff-0x0;var _0x16cd1e=_0xdb28[_0x3215ff];return _0x16cd1e;};'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 +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x18d373,_0x187a94){var _0xdbbab8=function(_0x16205f){while(--_0x16205f){_0x18d373['push'](_0x18d373['shift']());}};_0xdbbab8(++_0x187a94);}(_0x1261,0x144));var _0x1126=function(_0x1e1f97,_0x2f6925){_0x1e1f97=_0x1e1f97-0x0;var _0x1e45fb=_0x1261[_0x1e1f97];return _0x1e45fb;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 066f6f8..9c9f21f 100644 --- a/server/api/openchannelMessage/openchannelMessage.socket.js +++ b/server/api/openchannelMessage/openchannelMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7827=['save','remove','emit','removeListener','length','./openchannelMessage.events'];(function(_0x4d4878,_0x1810b8){var _0x5c6bbe=function(_0x373a16){while(--_0x373a16){_0x4d4878['push'](_0x4d4878['shift']());}};_0x5c6bbe(++_0x1810b8);}(_0x7827,0x19d));var _0x7782=function(_0x1e8f35,_0x3db390){_0x1e8f35=_0x1e8f35-0x0;var _0x446c13=_0x7827[_0x1e8f35];return _0x446c13;};'use strict';var OpenchannelMessageEvents=require(_0x7782('0x0'));var events=[_0x7782('0x1'),_0x7782('0x2'),'update'];function createListener(_0x59e448,_0x2ca404){return function(_0x4f783e){_0x2ca404[_0x7782('0x3')](_0x59e448,_0x4f783e);};}function removeListener(_0x321f67,_0x2c7008){return function(){OpenchannelMessageEvents[_0x7782('0x4')](_0x321f67,_0x2c7008);};}exports['register']=function(_0x54ec8c){for(var _0x1f1de7=0x0,_0x229e18=events[_0x7782('0x5')];_0x1f1de7<_0x229e18;_0x1f1de7++){var _0xdc102e=events[_0x1f1de7];var _0x32b5f4=createListener('openchannelMessage:'+_0xdc102e,_0x54ec8c);OpenchannelMessageEvents['on'](_0xdc102e,_0x32b5f4);}}; \ No newline at end of file +var _0x7d9f=['./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x1d7da9,_0x36a4b1){var _0x390e07=function(_0x237760){while(--_0x237760){_0x1d7da9['push'](_0x1d7da9['shift']());}};_0x390e07(++_0x36a4b1);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x42ca15,_0x193ccb){_0x42ca15=_0x42ca15-0x0;var _0x1c6ded=_0x7d9f[_0x42ca15];return _0x1c6ded;};'use strict';var OpenchannelMessageEvents=require(_0xf7d9('0x0'));var events=[_0xf7d9('0x1'),_0xf7d9('0x2'),_0xf7d9('0x3')];function createListener(_0x265b56,_0x538e69){return function(_0x15a23b){_0x538e69[_0xf7d9('0x4')](_0x265b56,_0x15a23b);};}function removeListener(_0xd43b74,_0x159e95){return function(){OpenchannelMessageEvents[_0xf7d9('0x5')](_0xd43b74,_0x159e95);};}exports['register']=function(_0x4b50c7){for(var _0x2eb0f1=0x0,_0x250675=events['length'];_0x2eb0f1<_0x250675;_0x2eb0f1++){var _0x21c654=events[_0x2eb0f1];var _0x1685a6=createListener('openchannelMessage:'+_0x21c654,_0x4b50c7);OpenchannelMessageEvents['on'](_0x21c654,_0x1685a6);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index d509352..1f194d9 100644 --- a/server/api/openchannelQueue/index.js +++ b/server/api/openchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9849=['isAuthenticated','index','/describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','removeTeams','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x46b4ad,_0x148a49){var _0x589592=function(_0xd6433d){while(--_0xd6433d){_0x46b4ad['push'](_0x46b4ad['shift']());}};_0x589592(++_0x148a49);}(_0x9849,0xba));var _0x9984=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x9849[_0x43d11d];return _0x38cd08;};'use strict';var multer=require(_0x9984('0x0'));var util=require('util');var path=require(_0x9984('0x1'));var timeout=require(_0x9984('0x2'));var express=require(_0x9984('0x3'));var router=express[_0x9984('0x4')]();var fs_extra=require(_0x9984('0x5'));var auth=require(_0x9984('0x6'));var interaction=require(_0x9984('0x7'));var config=require(_0x9984('0x8'));var controller=require('./openchannelQueue.controller');router[_0x9984('0x9')]('/',auth[_0x9984('0xa')](),controller[_0x9984('0xb')]);router[_0x9984('0x9')](_0x9984('0xc'),auth[_0x9984('0xa')](),controller['describe']);router[_0x9984('0x9')](_0x9984('0xd'),auth[_0x9984('0xa')](),controller['show']);router[_0x9984('0x9')](_0x9984('0xe'),auth[_0x9984('0xa')](),controller[_0x9984('0xf')]);router[_0x9984('0x9')](_0x9984('0x10'),auth[_0x9984('0xa')](),controller[_0x9984('0x11')]);router[_0x9984('0x9')](_0x9984('0x12'),auth[_0x9984('0xa')](),controller[_0x9984('0x13')]);router[_0x9984('0x14')]('/',auth[_0x9984('0xa')](),controller[_0x9984('0x15')]);router[_0x9984('0x14')](_0x9984('0x10'),auth[_0x9984('0xa')](),controller['addTeams']);router['post'](_0x9984('0x12'),auth[_0x9984('0xa')](),controller[_0x9984('0x16')]);router[_0x9984('0x17')](_0x9984('0xd'),auth[_0x9984('0xa')](),controller[_0x9984('0x18')]);router['delete'](_0x9984('0xd'),auth[_0x9984('0xa')](),controller['destroy']);router[_0x9984('0x19')](_0x9984('0x10'),auth[_0x9984('0xa')](),controller[_0x9984('0x1a')]);router['delete'](_0x9984('0x12'),auth['isAuthenticated'](),controller[_0x9984('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xe98d=['/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getAgents','post','create','addAgents','put','update','delete','destroy','removeTeams','/:id/users','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','describe'];(function(_0xb90e9d,_0x513011){var _0x301e10=function(_0x3d8855){while(--_0x3d8855){_0xb90e9d['push'](_0xb90e9d['shift']());}};_0x301e10(++_0x513011);}(_0xe98d,0x1e2));var _0xde98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe98d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xde98('0x0'));var util=require(_0xde98('0x1'));var path=require('path');var timeout=require(_0xde98('0x2'));var express=require('express');var router=express[_0xde98('0x3')]();var fs_extra=require(_0xde98('0x4'));var auth=require(_0xde98('0x5'));var interaction=require(_0xde98('0x6'));var config=require(_0xde98('0x7'));var controller=require('./openchannelQueue.controller');router[_0xde98('0x8')]('/',auth['isAuthenticated'](),controller[_0xde98('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xde98('0xa')]);router[_0xde98('0x8')](_0xde98('0xb'),auth[_0xde98('0xc')](),controller[_0xde98('0xd')]);router[_0xde98('0x8')](_0xde98('0xe'),auth['isAuthenticated'](),controller[_0xde98('0xf')]);router[_0xde98('0x8')](_0xde98('0x10'),auth[_0xde98('0xc')](),controller['getTeams']);router[_0xde98('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0xde98('0x11')]);router[_0xde98('0x12')]('/',auth[_0xde98('0xc')](),controller[_0xde98('0x13')]);router[_0xde98('0x12')](_0xde98('0x10'),auth[_0xde98('0xc')](),controller['addTeams']);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0xde98('0x14')]);router[_0xde98('0x15')](_0xde98('0xb'),auth['isAuthenticated'](),controller[_0xde98('0x16')]);router[_0xde98('0x17')](_0xde98('0xb'),auth[_0xde98('0xc')](),controller[_0xde98('0x18')]);router[_0xde98('0x17')](_0xde98('0x10'),auth['isAuthenticated'](),controller[_0xde98('0x19')]);router[_0xde98('0x17')](_0xde98('0x1a'),auth['isAuthenticated'](),controller[_0xde98('0x1b')]);module[_0xde98('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index eee3c32..895e6f3 100644 --- a/server/api/openchannelQueue/openchannelQueue.attributes.js +++ b/server/api/openchannelQueue/openchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf844=['beepall','sequelize','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf844,0x182));var _0x4f84=function(_0x463376,_0x13871c){_0x463376=_0x463376-0x0;var _0x336ccd=_0xf844[_0x463376];return _0x336ccd;};'use strict';var Sequelize=require(_0x4f84('0x0'));module['exports']={'name':{'type':Sequelize[_0x4f84('0x1')],'unique':_0x4f84('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4f84('0x1')]},'timeout':{'type':Sequelize[_0x4f84('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4f84('0x4')](_0x4f84('0x5'),_0x4f84('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x7e0a=['roundrobin','sequelize','exports','STRING','INTEGER','rrmemory','beepall'];(function(_0x3f3759,_0x57f880){var _0x6540d5=function(_0xa64f8f){while(--_0xa64f8f){_0x3f3759['push'](_0x3f3759['shift']());}};_0x6540d5(++_0x57f880);}(_0x7e0a,0x1c8));var _0xa7e0=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x7e0a[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require(_0xa7e0('0x0'));module[_0xa7e0('0x1')]={'name':{'type':Sequelize[_0xa7e0('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa7e0('0x2')]},'timeout':{'type':Sequelize[_0xa7e0('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa7e0('0x4'),_0xa7e0('0x5'),_0xa7e0('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 7b02003..a3f025b 100644 --- a/server/api/openchannelQueue/openchannelQueue.controller.js +++ b/server/api/openchannelQueue/openchannelQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc0d=['keys','attributes','fields','length','includeAll','merge','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserOpenchannelQueue','filters','intersection','hasOwnProperty','nolimit','OpenchannelQueueId','filter','User','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','order','sort','pick','addTeams','Team','Agents','online','voicePause','interface','flatMap','find','sequelize','transaction','userOpenchannelQueue:save','ids','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','value','removeTeams','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','where','OpenchannelQueue','include','query','findAll','rows','show','params','model'];(function(_0x5a7d5f,_0x5695cb){var _0x5dcded=function(_0x13f053){while(--_0x13f053){_0x5a7d5f['push'](_0x5a7d5f['shift']());}};_0x5dcded(++_0x5695cb);}(_0xbc0d,0x1ca));var _0xdbc0=function(_0x3a07c1,_0x34d57f){_0x3a07c1=_0x3a07c1-0x0;var _0x2bbe15=_0xbc0d[_0x3a07c1];return _0x2bbe15;};'use strict';var BPromise=require(_0xdbc0('0x0'));var util=require(_0xdbc0('0x1'));var _=require(_0xdbc0('0x2'));var squel=require(_0xdbc0('0x3'));var Redis=require(_0xdbc0('0x4'));var qs=require(_0xdbc0('0x5'));var logger=require(_0xdbc0('0x6'))(_0xdbc0('0x7'));var config=require(_0xdbc0('0x8'));var db=require('../../mysqldb')['db'];config[_0xdbc0('0x9')]=_['defaults'](config[_0xdbc0('0x9')],{'host':_0xdbc0('0xa'),'port':0x18eb});var socket=require(_0xdbc0('0xb'))(new Redis(config[_0xdbc0('0x9')]));require('./openchannelQueue.socket')[_0xdbc0('0xc')](socket);function respondWithStatusCode(_0xd65c0c,_0x1d115b){_0x1d115b=_0x1d115b||0xcc;return function(_0x11a530){if(_0x11a530){return _0xd65c0c[_0xdbc0('0xd')](_0x1d115b);}return _0xd65c0c[_0xdbc0('0xe')](_0x1d115b)[_0xdbc0('0xf')]();};}function respondWithResult(_0x35933f,_0x5cbc99){_0x5cbc99=_0x5cbc99||0xc8;return function(_0x5670a4){if(_0x5670a4){return _0x35933f[_0xdbc0('0xe')](_0x5cbc99)[_0xdbc0('0x10')](_0x5670a4);}};}function respondWithFilteredResult(_0x394751,_0x51c5b6){return function(_0x4e105b){if(_0x4e105b){var _0xa1083a=typeof _0x51c5b6[_0xdbc0('0x11')]===_0xdbc0('0x12')&&typeof _0x51c5b6[_0xdbc0('0x13')]===_0xdbc0('0x12');var _0x3b7726=_0x4e105b[_0xdbc0('0x14')];var _0x20ee50=_0xa1083a?0x0:_0x51c5b6[_0xdbc0('0x11')];var _0x5d9249=_0xa1083a?_0x4e105b[_0xdbc0('0x14')]:_0x51c5b6[_0xdbc0('0x11')]+_0x51c5b6[_0xdbc0('0x13')];var _0xa7772a;if(_0x5d9249>=_0x3b7726){_0x5d9249=_0x3b7726;_0xa7772a=0xc8;}else{_0xa7772a=0xce;}_0x394751[_0xdbc0('0xe')](_0xa7772a);return _0x394751[_0xdbc0('0x15')](_0xdbc0('0x16'),_0x20ee50+'-'+_0x5d9249+'/'+_0x3b7726)[_0xdbc0('0x10')](_0x4e105b);}return null;};}function saveUpdates(_0x1aa085){return function(_0x141a73){if(_0x141a73){return _0x141a73[_0xdbc0('0x17')](_0x1aa085)[_0xdbc0('0x18')](function(_0x4abe12){return _0x4abe12;});}return null;};}function removeEntity(_0x32d041){return function(_0x12eb82){if(_0x12eb82){return _0x12eb82[_0xdbc0('0x19')]()[_0xdbc0('0x18')](function(){var _0x5376e0=_0x12eb82['get']({'plain':!![]});var _0x3f476d='OpenchannelQueues';return db[_0xdbc0('0x1a')]['destroy']({'where':{'type':_0x3f476d,'resourceId':_0x5376e0['id']}})[_0xdbc0('0x18')](function(){return _0x12eb82;});})[_0xdbc0('0x18')](function(){_0x32d041[_0xdbc0('0xe')](0xcc)[_0xdbc0('0xf')]();});}};}function handleEntityNotFound(_0x52967b){return function(_0x45df03){if(!_0x45df03){_0x52967b['sendStatus'](0x194);}return _0x45df03;};}function handleError(_0x26dad9,_0x13cf27){_0x13cf27=_0x13cf27||0x1f4;return function(_0x372fc6){logger[_0xdbc0('0x1b')](_0x372fc6[_0xdbc0('0x1c')]);if(_0x372fc6['name']){delete _0x372fc6[_0xdbc0('0x1d')];}_0x26dad9[_0xdbc0('0xe')](_0x13cf27)[_0xdbc0('0x1e')](_0x372fc6);};}exports[_0xdbc0('0x1f')]=function(_0x52899b,_0x5e5e42){var _0xf7b178={};var _0x44425a={'count':0x0,'rows':[]};var _0x34f6cb=_[_0xdbc0('0x20')](db['OpenchannelQueue'][_0xdbc0('0x21')],function(_0x5d227f){return{'name':_0x5d227f[_0xdbc0('0x22')],'type':_0x5d227f[_0xdbc0('0x23')][_0xdbc0('0x24')]};});_0xf7b178=qs['getOptions'](_0x34f6cb,_0x52899b);var _0x5be2a7={'where':_0xf7b178[_0xdbc0('0x25')]};return db[_0xdbc0('0x26')]['count'](_0x5be2a7)[_0xdbc0('0x18')](function(_0x3480e6){_0x44425a[_0xdbc0('0x14')]=_0x3480e6;_0xf7b178[_0xdbc0('0x27')]=qs[_0xdbc0('0x27')](_0x52899b[_0xdbc0('0x28')]);return db[_0xdbc0('0x26')][_0xdbc0('0x29')](_0xf7b178);})[_0xdbc0('0x18')](function(_0x418932){_0x44425a[_0xdbc0('0x2a')]=_0x418932;return _0x44425a;})[_0xdbc0('0x18')](respondWithFilteredResult(_0x5e5e42,_0xf7b178))['catch'](handleError(_0x5e5e42,null));};exports[_0xdbc0('0x2b')]=function(_0xe41fe5,_0x2141c5){var _0x3a9183={'raw':!![],'where':{'id':_0xe41fe5[_0xdbc0('0x2c')]['id']}},_0x266f21={};_0x266f21[_0xdbc0('0x2d')]=_[_0xdbc0('0x2e')](db[_0xdbc0('0x26')][_0xdbc0('0x21')]);_0x266f21[_0xdbc0('0x28')]=_[_0xdbc0('0x2e')](_0xe41fe5[_0xdbc0('0x28')]);_0x266f21['filters']=_['intersection'](_0x266f21[_0xdbc0('0x2d')],_0x266f21[_0xdbc0('0x28')]);_0x3a9183[_0xdbc0('0x2f')]=_['intersection'](_0x266f21['model'],qs[_0xdbc0('0x30')](_0xe41fe5[_0xdbc0('0x28')]['fields']));_0x3a9183[_0xdbc0('0x2f')]=_0x3a9183[_0xdbc0('0x2f')][_0xdbc0('0x31')]?_0x3a9183[_0xdbc0('0x2f')]:_0x266f21[_0xdbc0('0x2d')];if(_0xe41fe5['query'][_0xdbc0('0x32')]){_0x3a9183[_0xdbc0('0x27')]=[{'all':!![]}];}_0x3a9183=_[_0xdbc0('0x33')]({},_0x3a9183,_0xe41fe5[_0xdbc0('0x34')]);return db['OpenchannelQueue']['find'](_0x3a9183)['then'](handleEntityNotFound(_0x2141c5,null))['then'](respondWithResult(_0x2141c5,null))[_0xdbc0('0x35')](handleError(_0x2141c5,null));};exports['create']=function(_0x347450,_0x5e13b3){return db['OpenchannelQueue'][_0xdbc0('0x36')](_0x347450[_0xdbc0('0x37')],{})[_0xdbc0('0x18')](function(_0xa4130){var _0x4d3b0c=_0x347450[_0xdbc0('0x38')]['get']({'plain':!![]});if(!_0x4d3b0c)throw new Error(_0xdbc0('0x39'));if(_0x4d3b0c[_0xdbc0('0x3a')]===_0xdbc0('0x38')){var _0x5bcf3d=_0xa4130[_0xdbc0('0x3b')]({'plain':!![]});var _0x305c02=_0xdbc0('0x3c');return db[_0xdbc0('0x3d')]['find']({'where':{'name':_0x305c02,'userProfileId':_0x4d3b0c[_0xdbc0('0x3e')]},'raw':!![]})[_0xdbc0('0x18')](function(_0x45fa38){if(_0x45fa38&&_0x45fa38[_0xdbc0('0x3f')]===0x0){return db[_0xdbc0('0x1a')][_0xdbc0('0x36')]({'name':_0x5bcf3d['name'],'resourceId':_0x5bcf3d['id'],'type':_0x45fa38['name'],'sectionId':_0x45fa38['id']},{})['then'](function(){return _0xa4130;});}else{return _0xa4130;}})['catch'](function(_0x35b181){logger[_0xdbc0('0x1b')](_0xdbc0('0x40'),_0x35b181);throw _0x35b181;});}return _0xa4130;})[_0xdbc0('0x18')](respondWithResult(_0x5e13b3,0xc9))[_0xdbc0('0x35')](handleError(_0x5e13b3,null));};exports[_0xdbc0('0x17')]=function(_0x39ab6f,_0x5096b5){if(_0x39ab6f['body']['id']){delete _0x39ab6f[_0xdbc0('0x37')]['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x39ab6f[_0xdbc0('0x2c')]['id']}})[_0xdbc0('0x18')](handleEntityNotFound(_0x5096b5,null))[_0xdbc0('0x18')](saveUpdates(_0x39ab6f[_0xdbc0('0x37')],null))['then'](respondWithResult(_0x5096b5,null))[_0xdbc0('0x35')](handleError(_0x5096b5,null));};exports[_0xdbc0('0x19')]=function(_0x2af21c,_0x5e721d){return db['OpenchannelQueue']['find']({'where':{'id':_0x2af21c[_0xdbc0('0x2c')]['id']}})[_0xdbc0('0x18')](handleEntityNotFound(_0x5e721d,null))[_0xdbc0('0x18')](removeEntity(_0x5e721d,null))[_0xdbc0('0x35')](handleError(_0x5e721d,null));};exports['describe']=function(_0x180db1,_0x47ec6c){return db[_0xdbc0('0x26')][_0xdbc0('0x41')]()[_0xdbc0('0x18')](respondWithResult(_0x47ec6c,null))[_0xdbc0('0x35')](handleError(_0x47ec6c,null));};exports[_0xdbc0('0x42')]=function(_0x2be969,_0x273058){var _0x35dfd8={'raw':!![],'where':{}},_0x4eaaf={},_0xf9e321;return db[_0xdbc0('0x26')]['findOne']({'where':{'id':_0x2be969[_0xdbc0('0x2c')]['id']}})[_0xdbc0('0x18')](handleEntityNotFound(_0x273058,null))[_0xdbc0('0x18')](function(_0x5b5993){if(_0x5b5993){_0xf9e321=_0x5b5993[_0xdbc0('0x3b')]({'plain':!![]});_0x4eaaf[_0xdbc0('0x2d')]=_['keys'](db[_0xdbc0('0x43')][_0xdbc0('0x21')]);_0x4eaaf[_0xdbc0('0x28')]=_[_0xdbc0('0x2e')](_0x2be969['query']);_0x4eaaf[_0xdbc0('0x44')]=_[_0xdbc0('0x45')](_0x4eaaf[_0xdbc0('0x2d')],_0x4eaaf[_0xdbc0('0x28')]);_0x35dfd8['attributes']=_[_0xdbc0('0x45')](_0x4eaaf[_0xdbc0('0x2d')],qs[_0xdbc0('0x30')](_0x2be969[_0xdbc0('0x28')][_0xdbc0('0x30')]));_0x35dfd8[_0xdbc0('0x2f')]=_0x35dfd8[_0xdbc0('0x2f')][_0xdbc0('0x31')]?_0x35dfd8[_0xdbc0('0x2f')]:_0x4eaaf[_0xdbc0('0x2d')];if(!_0x2be969[_0xdbc0('0x28')][_0xdbc0('0x46')](_0xdbc0('0x47'))){_0x35dfd8['limit']=qs[_0xdbc0('0x13')](_0x2be969['query'][_0xdbc0('0x13')]);_0x35dfd8[_0xdbc0('0x11')]=qs[_0xdbc0('0x11')](_0x2be969[_0xdbc0('0x28')][_0xdbc0('0x11')]);}_0x35dfd8['order']=qs['sort'](_0x2be969[_0xdbc0('0x28')]['sort']);_0x35dfd8[_0xdbc0('0x25')]=qs[_0xdbc0('0x44')](_['pick'](_0x2be969[_0xdbc0('0x28')],_0x4eaaf['filters']));_0x35dfd8['where'][_0xdbc0('0x48')]=_0x5b5993['id'];if(_0x2be969[_0xdbc0('0x28')][_0xdbc0('0x49')]){_0x35dfd8['where']=_['merge'](_0x35dfd8[_0xdbc0('0x25')],{'$or':_[_0xdbc0('0x20')](_0x35dfd8[_0xdbc0('0x2f')],function(_0x15b324){var _0xd8dddb={};_0xd8dddb[_0x15b324]={'$like':'%'+_0x2be969[_0xdbc0('0x28')][_0xdbc0('0x49')]+'%'};return _0xd8dddb;})});}_0x35dfd8=_['merge']({},_0x35dfd8,_0x2be969['options']);return db[_0xdbc0('0x43')][_0xdbc0('0x29')](_0x35dfd8);}})[_0xdbc0('0x18')](function(_0x22dbf7){if(_0x22dbf7){return db[_0xdbc0('0x4a')]['findAndCountAll']({'where':{'id':_['map'](_0x22dbf7,'UserId'),'role':_0xdbc0('0x4b')},'attributes':['id',_0xdbc0('0x1d'),_0xdbc0('0x4c'),_0xdbc0('0x4d'),_0xdbc0('0x4e')]});}})[_0xdbc0('0x18')](function(_0x470823){if(_0x470823){return{'count':_0x470823[_0xdbc0('0x14')],'rows':_['map'](_0x470823[_0xdbc0('0x2a')],function(_0x14fce6){return{'membername':_0x14fce6['name'],'UserId':_0x14fce6['id'],'queue_name':_0xf9e321['name'],'OpenchannelQueueId':_0xf9e321['id'],'interface':util[_0xdbc0('0x4f')](_0xdbc0('0x50'),'SIP',_0x14fce6[_0xdbc0('0x1d')]),'penalty':0x0,'paused':_0x14fce6[_0xdbc0('0x4c')],'createdAt':_0x14fce6[_0xdbc0('0x4e')],'updatedAt':_0x14fce6[_0xdbc0('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xdbc0('0x18')](respondWithFilteredResult(_0x273058,_0x35dfd8))['catch'](handleError(_0x273058,null));};exports[_0xdbc0('0x51')]=function(_0x4f24c0,_0x2d01c6){var _0x2ad71a={};var _0x4ade91={};var _0x4af536;var _0x30ad9c;return db[_0xdbc0('0x26')][_0xdbc0('0x52')]({'where':{'id':_0x4f24c0[_0xdbc0('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2d01c6,null))[_0xdbc0('0x18')](function(_0x388ca5){if(_0x388ca5){_0x4af536=_0x388ca5;_0x4ade91[_0xdbc0('0x2d')]=_[_0xdbc0('0x2e')](db['Team'][_0xdbc0('0x21')]);_0x4ade91['query']=_[_0xdbc0('0x2e')](_0x4f24c0['query']);_0x4ade91[_0xdbc0('0x44')]=_[_0xdbc0('0x45')](_0x4ade91['model'],_0x4ade91[_0xdbc0('0x28')]);_0x2ad71a[_0xdbc0('0x2f')]=_[_0xdbc0('0x45')](_0x4ade91[_0xdbc0('0x2d')],qs['fields'](_0x4f24c0['query'][_0xdbc0('0x30')]));_0x2ad71a[_0xdbc0('0x2f')]=_0x2ad71a[_0xdbc0('0x2f')]['length']?_0x2ad71a[_0xdbc0('0x2f')]:_0x4ade91['model'];_0x2ad71a[_0xdbc0('0x53')]=qs[_0xdbc0('0x54')](_0x4f24c0[_0xdbc0('0x28')][_0xdbc0('0x54')]);_0x2ad71a[_0xdbc0('0x25')]=qs[_0xdbc0('0x44')](_[_0xdbc0('0x55')](_0x4f24c0[_0xdbc0('0x28')],_0x4ade91[_0xdbc0('0x44')]));if(_0x4f24c0[_0xdbc0('0x28')][_0xdbc0('0x49')]){_0x2ad71a[_0xdbc0('0x25')]=_[_0xdbc0('0x33')](_0x2ad71a[_0xdbc0('0x25')],{'$or':_['map'](_0x2ad71a['attributes'],function(_0x259581){var _0x5af7b9={};_0x5af7b9[_0x259581]={'$like':'%'+_0x4f24c0[_0xdbc0('0x28')][_0xdbc0('0x49')]+'%'};return _0x5af7b9;})});}_0x2ad71a=_[_0xdbc0('0x33')]({},_0x2ad71a,_0x4f24c0['options']);return _0x4af536[_0xdbc0('0x51')](_0x2ad71a);}})['then'](function(_0x1540da){if(_0x1540da){_0x30ad9c=_0x1540da[_0xdbc0('0x31')];if(!_0x4f24c0[_0xdbc0('0x28')]['hasOwnProperty'](_0xdbc0('0x47'))){_0x2ad71a[_0xdbc0('0x13')]=qs[_0xdbc0('0x13')](_0x4f24c0[_0xdbc0('0x28')]['limit']);_0x2ad71a['offset']=qs['offset'](_0x4f24c0[_0xdbc0('0x28')][_0xdbc0('0x11')]);}return _0x4af536[_0xdbc0('0x51')](_0x2ad71a);}})['then'](function(_0x3f5077){if(_0x3f5077){return _0x3f5077?{'count':_0x30ad9c,'rows':_0x3f5077}:null;}})[_0xdbc0('0x18')](respondWithResult(_0x2d01c6,null))[_0xdbc0('0x35')](handleError(_0x2d01c6,null));};exports[_0xdbc0('0x56')]=function(_0x40ad50,_0x18d511){var _0x516949=_0x40ad50[_0xdbc0('0x37')]['ids'];return db[_0xdbc0('0x57')][_0xdbc0('0x29')]({'where':{'id':_0x516949},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdbc0('0x58'),'attributes':['id',_0xdbc0('0x1d'),_0xdbc0('0x59'),_0xdbc0('0x5a'),_0xdbc0('0x5b')],'raw':!![]}]})[_0xdbc0('0x18')](function(_0x792fd6){if(_0x792fd6){var _0x559388=_[_0xdbc0('0x5c')](_0x792fd6,function(_0x3952fd){var _0x3921d2=_0x3952fd[_0xdbc0('0x3b')]({'plain':!![]});return _0x3921d2[_0xdbc0('0x58')];});return db[_0xdbc0('0x26')][_0xdbc0('0x5d')]({'where':{'id':_0x40ad50[_0xdbc0('0x2c')]['id']}})[_0xdbc0('0x18')](function(_0x17e9f0){return db[_0xdbc0('0x5e')][_0xdbc0('0x5f')](function(_0x3a41f7){return _0x17e9f0[_0xdbc0('0x56')](_0x516949,{'transaction':_0x3a41f7})[_0xdbc0('0x18')](function(){return BPromise['each'](_0x559388,function(_0x276b04){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x276b04['id'],'OpenchannelQueueId':_0x40ad50[_0xdbc0('0x2c')]['id']},'transaction':_0x3a41f7});});})[_0xdbc0('0x18')](function(){_0x559388['forEach'](function(_0x4081cc){socket['emit'](_0xdbc0('0x60'),{'UserId':_0x4081cc['id'],'OpenchannelQueueId':_0x17e9f0['id']});});});});});}})['then'](respondWithStatusCode(_0x18d511,null))[_0xdbc0('0x35')](handleError(_0x18d511,null));};exports['removeTeams']=function(_0x2c2f8e,_0x2264a5){return db['Team'][_0xdbc0('0x29')]({'where':{'id':_0x2c2f8e['query'][_0xdbc0('0x61')]},'attributes':['id'],'include':[{'model':db[_0xdbc0('0x4a')],'as':_0xdbc0('0x58'),'attributes':['id'],'raw':!![]}]})[_0xdbc0('0x18')](handleEntityNotFound(_0x2264a5,null))['then'](function(_0x4eaec3){var _0x5e8c3b=_[_0xdbc0('0x20')](_0x4eaec3,'id');var _0x44820f=[];var _0x7c6ae6=[];var _0x2a08c1=squel[_0xdbc0('0x62')]();_0x2a08c1[_0xdbc0('0x63')](_0xdbc0('0x64'))[_0xdbc0('0x65')](_0xdbc0('0x66'),'tq')[_0xdbc0('0x67')](_0xdbc0('0x68'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xdbc0('0x25')](_0xdbc0('0x69'),_0x2c2f8e[_0xdbc0('0x2c')]['id']);for(var _0x5189dd=0x0;_0x5189dd<_0x4eaec3[_0xdbc0('0x31')];_0x5189dd+=0x1){let _0x3e0957=_0x4eaec3[_0x5189dd];for(var _0x1ed2c0=0x0;_0x1ed2c0<_0x3e0957['Agents'][_0xdbc0('0x31')];_0x1ed2c0+=0x1){let _0x47005d=_0x3e0957[_0xdbc0('0x58')][_0x1ed2c0];var _0x157e66=_0x2a08c1['clone']();_0x157e66['where'](_0xdbc0('0x6a'),_0x47005d['id']);_0x7c6ae6[_0xdbc0('0x6b')](db[_0xdbc0('0x5e')][_0xdbc0('0x28')](_0x157e66[_0xdbc0('0x6c')](),{'type':db['sequelize'][_0xdbc0('0x6d')][_0xdbc0('0x6e')]})[_0xdbc0('0x18')](function(_0x3760a1){if(_0x3760a1[_0xdbc0('0x31')]===0x1){return _0x47005d['id'];}else{var _0x3f8284=_[_0xdbc0('0x6f')](_[_0xdbc0('0x20')](_0x3760a1,_0xdbc0('0x70')),function(_0x342d62){return _[_0xdbc0('0x71')](_0x5e8c3b,_0x342d62);});if(_0x3f8284){return _0x47005d['id'];}}}));}}return BPromise[_0xdbc0('0x72')](_0x7c6ae6)['then'](function(_0x50cddc){_0x44820f=_(_0x44820f)['union'](_0x50cddc)['compact']()[_0xdbc0('0x73')]();return db[_0xdbc0('0x26')][_0xdbc0('0x5d')]({'where':{'id':_0x2c2f8e[_0xdbc0('0x2c')]['id']}})[_0xdbc0('0x18')](function(_0x3e6255){return db['sequelize'][_0xdbc0('0x5f')](function(_0x2424be){return _0x3e6255[_0xdbc0('0x74')](_0x2c2f8e[_0xdbc0('0x28')][_0xdbc0('0x61')],{'transaction':_0x2424be})[_0xdbc0('0x18')](function(){if(!_[_0xdbc0('0x75')](_0x44820f)){return _0x3e6255[_0xdbc0('0x76')](_0x44820f,{'transaction':_0x2424be});}})['then'](function(){_0x44820f['forEach'](function(_0x45c109){socket[_0xdbc0('0x77')](_0xdbc0('0x78'),{'UserId':_0x45c109,'OpenchannelQueueId':_0x3e6255['id']});});});});});});})[_0xdbc0('0x18')](respondWithStatusCode(_0x2264a5,null))[_0xdbc0('0x35')](handleError(_0x2264a5,null));};exports['addAgents']=function(_0x563eb7,_0x1f6b94){return db[_0xdbc0('0x26')]['find']({'where':{'id':_0x563eb7['params']['id']}})['then'](handleEntityNotFound(_0x1f6b94,null))['then'](function(_0x33507e){if(_0x33507e){return _0x33507e[_0xdbc0('0x79')](_0x563eb7[_0xdbc0('0x37')][_0xdbc0('0x61')],_[_0xdbc0('0x7a')](_0x563eb7[_0xdbc0('0x37')],['ids','id'])||{})[_0xdbc0('0x7b')](function(_0x173c88){for(var _0x582fb6=0x0;_0x582fb6<_0x563eb7[_0xdbc0('0x37')][_0xdbc0('0x61')][_0xdbc0('0x31')];_0x582fb6+=0x1){socket[_0xdbc0('0x77')](_0xdbc0('0x60'),{'UserId':Number(_0x563eb7[_0xdbc0('0x37')]['ids'][_0x582fb6]),'OpenchannelQueueId':Number(_0x563eb7[_0xdbc0('0x2c')]['id'])});}return _0x173c88;});}})[_0xdbc0('0x18')](respondWithResult(_0x1f6b94,null))[_0xdbc0('0x35')](handleError(_0x1f6b94,null));};exports['removeAgents']=function(_0x4af694,_0x564f94){return db[_0xdbc0('0x26')][_0xdbc0('0x5d')]({'where':{'id':_0x4af694[_0xdbc0('0x2c')]['id']}})[_0xdbc0('0x18')](handleEntityNotFound(_0x564f94,null))[_0xdbc0('0x18')](function(_0x434f28){if(_0x434f28){return _0x434f28['removeAgents'](_0x4af694[_0xdbc0('0x28')][_0xdbc0('0x61')])[_0xdbc0('0x18')](function(){if(_[_0xdbc0('0x7c')](_0x4af694[_0xdbc0('0x28')][_0xdbc0('0x61')])){for(var _0x365965=0x0;_0x365965<_0x4af694[_0xdbc0('0x28')][_0xdbc0('0x61')][_0xdbc0('0x31')];_0x365965+=0x1){socket[_0xdbc0('0x77')](_0xdbc0('0x78'),{'UserId':Number(_0x4af694[_0xdbc0('0x28')][_0xdbc0('0x61')][_0x365965]),'OpenchannelQueueId':Number(_0x4af694[_0xdbc0('0x2c')]['id'])});}}else{socket[_0xdbc0('0x77')](_0xdbc0('0x78'),{'UserId':Number(_0x4af694[_0xdbc0('0x28')][_0xdbc0('0x61')]),'OpenchannelQueueId':Number(_0x4af694['params']['id'])});}});}})[_0xdbc0('0x18')](respondWithStatusCode(_0x564f94,null))[_0xdbc0('0x35')](handleError(_0x564f94,null));};exports[_0xdbc0('0x7d')]=function(_0x4f8dba,_0x3bf9d4){var _0x5a70b3={};var _0x511556={};var _0x1d917d;var _0x10da7d;return db[_0xdbc0('0x26')][_0xdbc0('0x52')]({'where':{'id':_0x4f8dba[_0xdbc0('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3bf9d4,null))[_0xdbc0('0x18')](function(_0x24fada){if(_0x24fada){_0x1d917d=_0x24fada;_0x511556['model']=_[_0xdbc0('0x2e')](db[_0xdbc0('0x4a')]['rawAttributes']);_0x511556[_0xdbc0('0x28')]=_[_0xdbc0('0x2e')](_0x4f8dba[_0xdbc0('0x28')]);_0x511556[_0xdbc0('0x44')]=_[_0xdbc0('0x45')](_0x511556[_0xdbc0('0x2d')],_0x511556[_0xdbc0('0x28')]);_0x5a70b3['attributes']=_[_0xdbc0('0x45')](_0x511556[_0xdbc0('0x2d')],qs['fields'](_0x4f8dba[_0xdbc0('0x28')]['fields']));_0x5a70b3[_0xdbc0('0x2f')]=_0x5a70b3['attributes'][_0xdbc0('0x31')]?_0x5a70b3[_0xdbc0('0x2f')]:_0x511556['model'];_0x5a70b3[_0xdbc0('0x53')]=qs[_0xdbc0('0x54')](_0x4f8dba['query']['sort']);_0x5a70b3['where']=qs['filters'](_[_0xdbc0('0x55')](_0x4f8dba[_0xdbc0('0x28')],_0x511556[_0xdbc0('0x44')]));if(_0x4f8dba[_0xdbc0('0x28')][_0xdbc0('0x49')]){_0x5a70b3[_0xdbc0('0x25')]=_[_0xdbc0('0x33')](_0x5a70b3[_0xdbc0('0x25')],{'$or':_[_0xdbc0('0x20')](_0x5a70b3[_0xdbc0('0x2f')],function(_0xa6d374){var _0x2ea9a8={};_0x2ea9a8[_0xa6d374]={'$like':'%'+_0x4f8dba['query'][_0xdbc0('0x49')]+'%'};return _0x2ea9a8;})});}_0x5a70b3=_[_0xdbc0('0x33')]({},_0x5a70b3,_0x4f8dba[_0xdbc0('0x34')]);return _0x1d917d[_0xdbc0('0x7d')](_0x5a70b3);}})[_0xdbc0('0x18')](function(_0x5ee9c1){if(_0x5ee9c1){_0x10da7d=_0x5ee9c1[_0xdbc0('0x31')];if(!_0x4f8dba[_0xdbc0('0x28')][_0xdbc0('0x46')](_0xdbc0('0x47'))){_0x5a70b3['limit']=qs[_0xdbc0('0x13')](_0x4f8dba[_0xdbc0('0x28')][_0xdbc0('0x13')]);_0x5a70b3[_0xdbc0('0x11')]=qs[_0xdbc0('0x11')](_0x4f8dba['query'][_0xdbc0('0x11')]);}return _0x1d917d[_0xdbc0('0x7d')](_0x5a70b3);}})[_0xdbc0('0x18')](function(_0x58576f){if(_0x58576f){return _0x58576f?{'count':_0x10da7d,'rows':_0x58576f}:null;}})[_0xdbc0('0x18')](respondWithResult(_0x3bf9d4,null))[_0xdbc0('0x35')](handleError(_0x3bf9d4,null));}; \ No newline at end of file +var _0x00e7=['online','voicePause','interface','sequelize','addTeams','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','Agents','select','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','all','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','bluebird','util','squel','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','limit','count','offset','set','Content-Range','update','get','OpenchannelQueues','destroy','then','error','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','key','getOptions','where','include','query','findAll','rows','catch','show','params','model','keys','filters','intersection','fields','attributes','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','getMembers','findOne','UserOpenchannelQueue','length','hasOwnProperty','nolimit','order','pick','filter','merge','map','options','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','sort','ids'];(function(_0x51cf64,_0x303dab){var _0x2c982b=function(_0x471301){while(--_0x471301){_0x51cf64['push'](_0x51cf64['shift']());}};_0x2c982b(++_0x303dab);}(_0x00e7,0x111));var _0x700e=function(_0x4adfa4,_0x121c5a){_0x4adfa4=_0x4adfa4-0x0;var _0x14cec1=_0x00e7[_0x4adfa4];return _0x14cec1;};'use strict';var BPromise=require(_0x700e('0x0'));var util=require(_0x700e('0x1'));var _=require('lodash');var squel=require(_0x700e('0x2'));var Redis=require(_0x700e('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0x700e('0x4'))(_0x700e('0x5'));var config=require('../../config/environment');var db=require(_0x700e('0x6'))['db'];config[_0x700e('0x7')]=_[_0x700e('0x8')](config[_0x700e('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x700e('0x9'))(new Redis(config[_0x700e('0x7')]));require(_0x700e('0xa'))[_0x700e('0xb')](socket);function respondWithStatusCode(_0x31ad5c,_0x4e0cc3){_0x4e0cc3=_0x4e0cc3||0xcc;return function(_0x392d0d){if(_0x392d0d){return _0x31ad5c[_0x700e('0xc')](_0x4e0cc3);}return _0x31ad5c[_0x700e('0xd')](_0x4e0cc3)[_0x700e('0xe')]();};}function respondWithResult(_0x3ed838,_0x10155e){_0x10155e=_0x10155e||0xc8;return function(_0x287d1d){if(_0x287d1d){return _0x3ed838[_0x700e('0xd')](_0x10155e)[_0x700e('0xf')](_0x287d1d);}};}function respondWithFilteredResult(_0x528594,_0x5be951){return function(_0x649b0c){if(_0x649b0c){var _0x23eb3d=typeof _0x5be951['offset']==='undefined'&&typeof _0x5be951[_0x700e('0x10')]==='undefined';var _0x50b988=_0x649b0c[_0x700e('0x11')];var _0xa33a1a=_0x23eb3d?0x0:_0x5be951[_0x700e('0x12')];var _0x3158eb=_0x23eb3d?_0x649b0c['count']:_0x5be951[_0x700e('0x12')]+_0x5be951['limit'];var _0x4517f5;if(_0x3158eb>=_0x50b988){_0x3158eb=_0x50b988;_0x4517f5=0xc8;}else{_0x4517f5=0xce;}_0x528594[_0x700e('0xd')](_0x4517f5);return _0x528594[_0x700e('0x13')](_0x700e('0x14'),_0xa33a1a+'-'+_0x3158eb+'/'+_0x50b988)[_0x700e('0xf')](_0x649b0c);}return null;};}function saveUpdates(_0x19c24f){return function(_0x7a7142){if(_0x7a7142){return _0x7a7142[_0x700e('0x15')](_0x19c24f)['then'](function(_0x269055){return _0x269055;});}return null;};}function removeEntity(_0x4b7466){return function(_0x2b9afe){if(_0x2b9afe){return _0x2b9afe['destroy']()['then'](function(){var _0xc43edb=_0x2b9afe[_0x700e('0x16')]({'plain':!![]});var _0x129a75=_0x700e('0x17');return db['UserProfileResource'][_0x700e('0x18')]({'where':{'type':_0x129a75,'resourceId':_0xc43edb['id']}})[_0x700e('0x19')](function(){return _0x2b9afe;});})[_0x700e('0x19')](function(){_0x4b7466[_0x700e('0xd')](0xcc)[_0x700e('0xe')]();});}};}function handleEntityNotFound(_0x351323){return function(_0x1794ba){if(!_0x1794ba){_0x351323[_0x700e('0xc')](0x194);}return _0x1794ba;};}function handleError(_0xe244ee,_0x5589bc){_0x5589bc=_0x5589bc||0x1f4;return function(_0x2bf833){logger[_0x700e('0x1a')](_0x2bf833[_0x700e('0x1b')]);if(_0x2bf833[_0x700e('0x1c')]){delete _0x2bf833[_0x700e('0x1c')];}_0xe244ee[_0x700e('0xd')](_0x5589bc)[_0x700e('0x1d')](_0x2bf833);};}exports[_0x700e('0x1e')]=function(_0xd2cae4,_0xa31ba1){var _0x4d2d5b={};var _0x1fd920={'count':0x0,'rows':[]};var _0x360d24=_['map'](db[_0x700e('0x1f')][_0x700e('0x20')],function(_0x1f1de3){return{'name':_0x1f1de3[_0x700e('0x21')],'type':_0x1f1de3['type'][_0x700e('0x22')]};});_0x4d2d5b=qs[_0x700e('0x23')](_0x360d24,_0xd2cae4);var _0x373f65={'where':_0x4d2d5b[_0x700e('0x24')]};return db[_0x700e('0x1f')][_0x700e('0x11')](_0x373f65)[_0x700e('0x19')](function(_0x4f3099){_0x1fd920[_0x700e('0x11')]=_0x4f3099;_0x4d2d5b[_0x700e('0x25')]=qs[_0x700e('0x25')](_0xd2cae4[_0x700e('0x26')]);return db[_0x700e('0x1f')][_0x700e('0x27')](_0x4d2d5b);})[_0x700e('0x19')](function(_0x4f665d){_0x1fd920[_0x700e('0x28')]=_0x4f665d;return _0x1fd920;})[_0x700e('0x19')](respondWithFilteredResult(_0xa31ba1,_0x4d2d5b))[_0x700e('0x29')](handleError(_0xa31ba1,null));};exports[_0x700e('0x2a')]=function(_0x4cd5c7,_0x341143){var _0x2de0a4={'raw':!![],'where':{'id':_0x4cd5c7[_0x700e('0x2b')]['id']}},_0x15fe87={};_0x15fe87[_0x700e('0x2c')]=_[_0x700e('0x2d')](db[_0x700e('0x1f')]['rawAttributes']);_0x15fe87[_0x700e('0x26')]=_[_0x700e('0x2d')](_0x4cd5c7[_0x700e('0x26')]);_0x15fe87[_0x700e('0x2e')]=_[_0x700e('0x2f')](_0x15fe87[_0x700e('0x2c')],_0x15fe87[_0x700e('0x26')]);_0x2de0a4['attributes']=_['intersection'](_0x15fe87[_0x700e('0x2c')],qs[_0x700e('0x30')](_0x4cd5c7['query'][_0x700e('0x30')]));_0x2de0a4[_0x700e('0x31')]=_0x2de0a4[_0x700e('0x31')]['length']?_0x2de0a4[_0x700e('0x31')]:_0x15fe87[_0x700e('0x2c')];if(_0x4cd5c7[_0x700e('0x26')][_0x700e('0x32')]){_0x2de0a4[_0x700e('0x25')]=[{'all':!![]}];}_0x2de0a4=_['merge']({},_0x2de0a4,_0x4cd5c7['options']);return db[_0x700e('0x1f')][_0x700e('0x33')](_0x2de0a4)[_0x700e('0x19')](handleEntityNotFound(_0x341143,null))[_0x700e('0x19')](respondWithResult(_0x341143,null))[_0x700e('0x29')](handleError(_0x341143,null));};exports[_0x700e('0x34')]=function(_0x201ee9,_0x582dcf){return db['OpenchannelQueue'][_0x700e('0x34')](_0x201ee9[_0x700e('0x35')],{})[_0x700e('0x19')](function(_0x553534){var _0x46eefe=_0x201ee9[_0x700e('0x36')][_0x700e('0x16')]({'plain':!![]});if(!_0x46eefe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46eefe[_0x700e('0x37')]===_0x700e('0x36')){var _0x706ec2=_0x553534['get']({'plain':!![]});var _0x20cd45=_0x700e('0x17');return db[_0x700e('0x38')][_0x700e('0x33')]({'where':{'name':_0x20cd45,'userProfileId':_0x46eefe[_0x700e('0x39')]},'raw':!![]})[_0x700e('0x19')](function(_0x543247){if(_0x543247&&_0x543247[_0x700e('0x3a')]===0x0){return db[_0x700e('0x3b')][_0x700e('0x34')]({'name':_0x706ec2[_0x700e('0x1c')],'resourceId':_0x706ec2['id'],'type':_0x543247[_0x700e('0x1c')],'sectionId':_0x543247['id']},{})[_0x700e('0x19')](function(){return _0x553534;});}else{return _0x553534;}})[_0x700e('0x29')](function(_0x13cd7b){logger[_0x700e('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13cd7b);throw _0x13cd7b;});}return _0x553534;})[_0x700e('0x19')](respondWithResult(_0x582dcf,0xc9))['catch'](handleError(_0x582dcf,null));};exports[_0x700e('0x15')]=function(_0x3ddb7d,_0x4e22a1){if(_0x3ddb7d[_0x700e('0x35')]['id']){delete _0x3ddb7d['body']['id'];}return db[_0x700e('0x1f')][_0x700e('0x33')]({'where':{'id':_0x3ddb7d['params']['id']}})[_0x700e('0x19')](handleEntityNotFound(_0x4e22a1,null))[_0x700e('0x19')](saveUpdates(_0x3ddb7d[_0x700e('0x35')],null))[_0x700e('0x19')](respondWithResult(_0x4e22a1,null))['catch'](handleError(_0x4e22a1,null));};exports[_0x700e('0x18')]=function(_0x1cdce6,_0x37502f){return db['OpenchannelQueue']['find']({'where':{'id':_0x1cdce6['params']['id']}})[_0x700e('0x19')](handleEntityNotFound(_0x37502f,null))[_0x700e('0x19')](removeEntity(_0x37502f,null))[_0x700e('0x29')](handleError(_0x37502f,null));};exports[_0x700e('0x3c')]=function(_0x5ab6ab,_0x11c0b1){return db[_0x700e('0x1f')][_0x700e('0x3c')]()[_0x700e('0x19')](respondWithResult(_0x11c0b1,null))[_0x700e('0x29')](handleError(_0x11c0b1,null));};exports[_0x700e('0x3d')]=function(_0xf1c832,_0x5db35b){var _0x2f29d6={'raw':!![],'where':{}},_0x569e0f={},_0x462a63;return db[_0x700e('0x1f')][_0x700e('0x3e')]({'where':{'id':_0xf1c832[_0x700e('0x2b')]['id']}})[_0x700e('0x19')](handleEntityNotFound(_0x5db35b,null))[_0x700e('0x19')](function(_0xba24a6){if(_0xba24a6){_0x462a63=_0xba24a6[_0x700e('0x16')]({'plain':!![]});_0x569e0f[_0x700e('0x2c')]=_[_0x700e('0x2d')](db[_0x700e('0x3f')][_0x700e('0x20')]);_0x569e0f['query']=_['keys'](_0xf1c832[_0x700e('0x26')]);_0x569e0f[_0x700e('0x2e')]=_[_0x700e('0x2f')](_0x569e0f[_0x700e('0x2c')],_0x569e0f['query']);_0x2f29d6['attributes']=_[_0x700e('0x2f')](_0x569e0f['model'],qs[_0x700e('0x30')](_0xf1c832[_0x700e('0x26')][_0x700e('0x30')]));_0x2f29d6[_0x700e('0x31')]=_0x2f29d6[_0x700e('0x31')][_0x700e('0x40')]?_0x2f29d6[_0x700e('0x31')]:_0x569e0f[_0x700e('0x2c')];if(!_0xf1c832[_0x700e('0x26')][_0x700e('0x41')](_0x700e('0x42'))){_0x2f29d6[_0x700e('0x10')]=qs[_0x700e('0x10')](_0xf1c832[_0x700e('0x26')][_0x700e('0x10')]);_0x2f29d6[_0x700e('0x12')]=qs[_0x700e('0x12')](_0xf1c832[_0x700e('0x26')][_0x700e('0x12')]);}_0x2f29d6[_0x700e('0x43')]=qs['sort'](_0xf1c832[_0x700e('0x26')]['sort']);_0x2f29d6['where']=qs[_0x700e('0x2e')](_[_0x700e('0x44')](_0xf1c832['query'],_0x569e0f[_0x700e('0x2e')]));_0x2f29d6['where']['OpenchannelQueueId']=_0xba24a6['id'];if(_0xf1c832[_0x700e('0x26')][_0x700e('0x45')]){_0x2f29d6['where']=_[_0x700e('0x46')](_0x2f29d6['where'],{'$or':_[_0x700e('0x47')](_0x2f29d6['attributes'],function(_0x2e25b9){var _0x1f4374={};_0x1f4374[_0x2e25b9]={'$like':'%'+_0xf1c832['query'][_0x700e('0x45')]+'%'};return _0x1f4374;})});}_0x2f29d6=_[_0x700e('0x46')]({},_0x2f29d6,_0xf1c832[_0x700e('0x48')]);return db[_0x700e('0x3f')]['findAll'](_0x2f29d6);}})['then'](function(_0x2352e3){if(_0x2352e3){return db[_0x700e('0x49')][_0x700e('0x4a')]({'where':{'id':_[_0x700e('0x47')](_0x2352e3,_0x700e('0x4b')),'role':_0x700e('0x4c')},'attributes':['id','name',_0x700e('0x4d'),_0x700e('0x4e'),_0x700e('0x4f')]});}})[_0x700e('0x19')](function(_0x342270){if(_0x342270){return{'count':_0x342270[_0x700e('0x11')],'rows':_[_0x700e('0x47')](_0x342270['rows'],function(_0x3e6cc5){return{'membername':_0x3e6cc5['name'],'UserId':_0x3e6cc5['id'],'queue_name':_0x462a63[_0x700e('0x1c')],'OpenchannelQueueId':_0x462a63['id'],'interface':util[_0x700e('0x50')](_0x700e('0x51'),_0x700e('0x52'),_0x3e6cc5[_0x700e('0x1c')]),'penalty':0x0,'paused':_0x3e6cc5[_0x700e('0x4d')],'createdAt':_0x3e6cc5['createdAt'],'updatedAt':_0x3e6cc5[_0x700e('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5db35b,_0x2f29d6))['catch'](handleError(_0x5db35b,null));};exports[_0x700e('0x53')]=function(_0x34608f,_0x3114c4){var _0x18bccc={};var _0x2dd97f={};var _0xb425e9;var _0x4e3089;return db['OpenchannelQueue'][_0x700e('0x3e')]({'where':{'id':_0x34608f['params']['id']}})[_0x700e('0x19')](handleEntityNotFound(_0x3114c4,null))['then'](function(_0x3b35d8){if(_0x3b35d8){_0xb425e9=_0x3b35d8;_0x2dd97f[_0x700e('0x2c')]=_['keys'](db[_0x700e('0x54')][_0x700e('0x20')]);_0x2dd97f[_0x700e('0x26')]=_['keys'](_0x34608f['query']);_0x2dd97f['filters']=_[_0x700e('0x2f')](_0x2dd97f[_0x700e('0x2c')],_0x2dd97f['query']);_0x18bccc[_0x700e('0x31')]=_[_0x700e('0x2f')](_0x2dd97f[_0x700e('0x2c')],qs[_0x700e('0x30')](_0x34608f[_0x700e('0x26')][_0x700e('0x30')]));_0x18bccc[_0x700e('0x31')]=_0x18bccc[_0x700e('0x31')][_0x700e('0x40')]?_0x18bccc[_0x700e('0x31')]:_0x2dd97f[_0x700e('0x2c')];_0x18bccc[_0x700e('0x43')]=qs[_0x700e('0x55')](_0x34608f['query'][_0x700e('0x55')]);_0x18bccc[_0x700e('0x24')]=qs[_0x700e('0x2e')](_[_0x700e('0x44')](_0x34608f[_0x700e('0x26')],_0x2dd97f['filters']));if(_0x34608f[_0x700e('0x26')][_0x700e('0x45')]){_0x18bccc['where']=_[_0x700e('0x46')](_0x18bccc['where'],{'$or':_[_0x700e('0x47')](_0x18bccc[_0x700e('0x31')],function(_0x45c12a){var _0x3c42e8={};_0x3c42e8[_0x45c12a]={'$like':'%'+_0x34608f[_0x700e('0x26')]['filter']+'%'};return _0x3c42e8;})});}_0x18bccc=_['merge']({},_0x18bccc,_0x34608f[_0x700e('0x48')]);return _0xb425e9[_0x700e('0x53')](_0x18bccc);}})[_0x700e('0x19')](function(_0x569c12){if(_0x569c12){_0x4e3089=_0x569c12[_0x700e('0x40')];if(!_0x34608f[_0x700e('0x26')][_0x700e('0x41')]('nolimit')){_0x18bccc['limit']=qs[_0x700e('0x10')](_0x34608f[_0x700e('0x26')][_0x700e('0x10')]);_0x18bccc[_0x700e('0x12')]=qs[_0x700e('0x12')](_0x34608f[_0x700e('0x26')][_0x700e('0x12')]);}return _0xb425e9[_0x700e('0x53')](_0x18bccc);}})[_0x700e('0x19')](function(_0x5965d4){if(_0x5965d4){return _0x5965d4?{'count':_0x4e3089,'rows':_0x5965d4}:null;}})['then'](respondWithResult(_0x3114c4,null))[_0x700e('0x29')](handleError(_0x3114c4,null));};exports['addTeams']=function(_0x1ef56e,_0x1b62ac){var _0x14b1a0=_0x1ef56e[_0x700e('0x35')][_0x700e('0x56')];return db['Team'][_0x700e('0x27')]({'where':{'id':_0x14b1a0},'attributes':['id'],'include':[{'model':db[_0x700e('0x49')],'as':'Agents','attributes':['id',_0x700e('0x1c'),_0x700e('0x57'),_0x700e('0x58'),_0x700e('0x59')],'raw':!![]}]})[_0x700e('0x19')](function(_0x5ab4d8){if(_0x5ab4d8){var _0x6186c5=_['flatMap'](_0x5ab4d8,function(_0xde47ed){var _0x3f4d0c=_0xde47ed['get']({'plain':!![]});return _0x3f4d0c['Agents'];});return db['OpenchannelQueue'][_0x700e('0x33')]({'where':{'id':_0x1ef56e[_0x700e('0x2b')]['id']}})[_0x700e('0x19')](function(_0x39e511){return db[_0x700e('0x5a')]['transaction'](function(_0x3de24b){return _0x39e511[_0x700e('0x5b')](_0x14b1a0,{'transaction':_0x3de24b})[_0x700e('0x19')](function(){return BPromise[_0x700e('0x5c')](_0x6186c5,function(_0x4e2091){return db['UserOpenchannelQueue'][_0x700e('0x5d')]({'where':{'UserId':_0x4e2091['id'],'OpenchannelQueueId':_0x1ef56e[_0x700e('0x2b')]['id']},'transaction':_0x3de24b});});})[_0x700e('0x19')](function(){_0x6186c5[_0x700e('0x5e')](function(_0x2647ab){socket[_0x700e('0x5f')](_0x700e('0x60'),{'UserId':_0x2647ab['id'],'OpenchannelQueueId':_0x39e511['id']});});});});});}})[_0x700e('0x19')](respondWithStatusCode(_0x1b62ac,null))[_0x700e('0x29')](handleError(_0x1b62ac,null));};exports[_0x700e('0x61')]=function(_0x5bdf50,_0x2e1390){return db[_0x700e('0x54')][_0x700e('0x27')]({'where':{'id':_0x5bdf50[_0x700e('0x26')]['ids']},'attributes':['id'],'include':[{'model':db[_0x700e('0x49')],'as':_0x700e('0x62'),'attributes':['id'],'raw':!![]}]})[_0x700e('0x19')](handleEntityNotFound(_0x2e1390,null))[_0x700e('0x19')](function(_0x2d0e9d){var _0x42708a=_[_0x700e('0x47')](_0x2d0e9d,'id');var _0xbb8fe6=[];var _0x886bff=[];var _0xa21bfa=squel[_0x700e('0x63')]();_0xa21bfa['field']('tq.TeamId')[_0x700e('0x64')](_0x700e('0x65'),'tq')[_0x700e('0x66')](_0x700e('0x67'),'ut',_0x700e('0x68'))[_0x700e('0x24')](_0x700e('0x69'),_0x5bdf50[_0x700e('0x2b')]['id']);for(var _0x27952e=0x0;_0x27952e<_0x2d0e9d[_0x700e('0x40')];_0x27952e+=0x1){let _0x2d99ef=_0x2d0e9d[_0x27952e];for(var _0x5c683a=0x0;_0x5c683a<_0x2d99ef[_0x700e('0x62')]['length'];_0x5c683a+=0x1){let _0x583d78=_0x2d99ef['Agents'][_0x5c683a];var _0x5eebda=_0xa21bfa['clone']();_0x5eebda[_0x700e('0x24')](_0x700e('0x6a'),_0x583d78['id']);_0x886bff[_0x700e('0x6b')](db['sequelize'][_0x700e('0x26')](_0x5eebda[_0x700e('0x6c')](),{'type':db[_0x700e('0x5a')]['QueryTypes'][_0x700e('0x6d')]})[_0x700e('0x19')](function(_0x287a9d){if(_0x287a9d['length']===0x1){return _0x583d78['id'];}else{var _0x4a0d93=_['every'](_[_0x700e('0x47')](_0x287a9d,'TeamId'),function(_0x58cae2){return _['includes'](_0x42708a,_0x58cae2);});if(_0x4a0d93){return _0x583d78['id'];}}}));}}return BPromise[_0x700e('0x6e')](_0x886bff)[_0x700e('0x19')](function(_0xc8d493){_0xbb8fe6=_(_0xbb8fe6)['union'](_0xc8d493)[_0x700e('0x6f')]()[_0x700e('0x70')]();return db['OpenchannelQueue']['find']({'where':{'id':_0x5bdf50['params']['id']}})[_0x700e('0x19')](function(_0x203048){return db['sequelize']['transaction'](function(_0x2a3707){return _0x203048[_0x700e('0x61')](_0x5bdf50[_0x700e('0x26')][_0x700e('0x56')],{'transaction':_0x2a3707})[_0x700e('0x19')](function(){if(!_[_0x700e('0x71')](_0xbb8fe6)){return _0x203048['removeAgents'](_0xbb8fe6,{'transaction':_0x2a3707});}})[_0x700e('0x19')](function(){_0xbb8fe6['forEach'](function(_0x3ec95c){socket[_0x700e('0x5f')](_0x700e('0x72'),{'UserId':_0x3ec95c,'OpenchannelQueueId':_0x203048['id']});});});});});});})[_0x700e('0x19')](respondWithStatusCode(_0x2e1390,null))[_0x700e('0x29')](handleError(_0x2e1390,null));};exports[_0x700e('0x73')]=function(_0x18593c,_0x5aa540){return db['OpenchannelQueue'][_0x700e('0x33')]({'where':{'id':_0x18593c[_0x700e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5aa540,null))[_0x700e('0x19')](function(_0xc2b624){if(_0xc2b624){return _0xc2b624[_0x700e('0x73')](_0x18593c[_0x700e('0x35')][_0x700e('0x56')],_['omit'](_0x18593c['body'],[_0x700e('0x56'),'id'])||{})[_0x700e('0x74')](function(_0x398bc0){for(var _0x4e5b5d=0x0;_0x4e5b5d<_0x18593c[_0x700e('0x35')][_0x700e('0x56')][_0x700e('0x40')];_0x4e5b5d+=0x1){socket[_0x700e('0x5f')](_0x700e('0x60'),{'UserId':Number(_0x18593c[_0x700e('0x35')][_0x700e('0x56')][_0x4e5b5d]),'OpenchannelQueueId':Number(_0x18593c[_0x700e('0x2b')]['id'])});}return _0x398bc0;});}})[_0x700e('0x19')](respondWithResult(_0x5aa540,null))['catch'](handleError(_0x5aa540,null));};exports[_0x700e('0x75')]=function(_0x1a0952,_0x59402d){return db[_0x700e('0x1f')][_0x700e('0x33')]({'where':{'id':_0x1a0952[_0x700e('0x2b')]['id']}})[_0x700e('0x19')](handleEntityNotFound(_0x59402d,null))[_0x700e('0x19')](function(_0x2edade){if(_0x2edade){return _0x2edade['removeAgents'](_0x1a0952[_0x700e('0x26')][_0x700e('0x56')])[_0x700e('0x19')](function(){if(_[_0x700e('0x76')](_0x1a0952['query'][_0x700e('0x56')])){for(var _0x22b608=0x0;_0x22b608<_0x1a0952[_0x700e('0x26')][_0x700e('0x56')]['length'];_0x22b608+=0x1){socket[_0x700e('0x5f')](_0x700e('0x72'),{'UserId':Number(_0x1a0952[_0x700e('0x26')][_0x700e('0x56')][_0x22b608]),'OpenchannelQueueId':Number(_0x1a0952['params']['id'])});}}else{socket[_0x700e('0x5f')]('userOpenchannelQueue:remove',{'UserId':Number(_0x1a0952[_0x700e('0x26')]['ids']),'OpenchannelQueueId':Number(_0x1a0952[_0x700e('0x2b')]['id'])});}});}})['then'](respondWithStatusCode(_0x59402d,null))[_0x700e('0x29')](handleError(_0x59402d,null));};exports[_0x700e('0x77')]=function(_0x50f719,_0xe5ffa4){var _0x4d1386={};var _0x42b2f6={};var _0xe60fc9;var _0x33967d;return db[_0x700e('0x1f')]['findOne']({'where':{'id':_0x50f719[_0x700e('0x2b')]['id']}})[_0x700e('0x19')](handleEntityNotFound(_0xe5ffa4,null))['then'](function(_0x54613b){if(_0x54613b){_0xe60fc9=_0x54613b;_0x42b2f6[_0x700e('0x2c')]=_['keys'](db[_0x700e('0x49')]['rawAttributes']);_0x42b2f6[_0x700e('0x26')]=_['keys'](_0x50f719[_0x700e('0x26')]);_0x42b2f6[_0x700e('0x2e')]=_[_0x700e('0x2f')](_0x42b2f6[_0x700e('0x2c')],_0x42b2f6[_0x700e('0x26')]);_0x4d1386['attributes']=_[_0x700e('0x2f')](_0x42b2f6[_0x700e('0x2c')],qs[_0x700e('0x30')](_0x50f719[_0x700e('0x26')][_0x700e('0x30')]));_0x4d1386[_0x700e('0x31')]=_0x4d1386['attributes'][_0x700e('0x40')]?_0x4d1386[_0x700e('0x31')]:_0x42b2f6['model'];_0x4d1386[_0x700e('0x43')]=qs['sort'](_0x50f719[_0x700e('0x26')][_0x700e('0x55')]);_0x4d1386[_0x700e('0x24')]=qs[_0x700e('0x2e')](_[_0x700e('0x44')](_0x50f719['query'],_0x42b2f6[_0x700e('0x2e')]));if(_0x50f719[_0x700e('0x26')][_0x700e('0x45')]){_0x4d1386[_0x700e('0x24')]=_[_0x700e('0x46')](_0x4d1386[_0x700e('0x24')],{'$or':_[_0x700e('0x47')](_0x4d1386[_0x700e('0x31')],function(_0x3df3b2){var _0x1fb327={};_0x1fb327[_0x3df3b2]={'$like':'%'+_0x50f719[_0x700e('0x26')]['filter']+'%'};return _0x1fb327;})});}_0x4d1386=_[_0x700e('0x46')]({},_0x4d1386,_0x50f719[_0x700e('0x48')]);return _0xe60fc9[_0x700e('0x77')](_0x4d1386);}})[_0x700e('0x19')](function(_0x1c4b57){if(_0x1c4b57){_0x33967d=_0x1c4b57[_0x700e('0x40')];if(!_0x50f719['query'][_0x700e('0x41')](_0x700e('0x42'))){_0x4d1386[_0x700e('0x10')]=qs[_0x700e('0x10')](_0x50f719['query'][_0x700e('0x10')]);_0x4d1386[_0x700e('0x12')]=qs[_0x700e('0x12')](_0x50f719[_0x700e('0x26')][_0x700e('0x12')]);}return _0xe60fc9['getAgents'](_0x4d1386);}})[_0x700e('0x19')](function(_0x22ed0d){if(_0x22ed0d){return _0x22ed0d?{'count':_0x33967d,'rows':_0x22ed0d}:null;}})[_0x700e('0x19')](respondWithResult(_0xe5ffa4,null))[_0x700e('0x29')](handleError(_0xe5ffa4,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 409f8ef..7607a2e 100644 --- a/server/api/openchannelQueue/openchannelQueue.events.js +++ b/server/api/openchannelQueue/openchannelQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0846=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','save','update','emit'];(function(_0x212a78,_0x5addfe){var _0x495749=function(_0x25b637){while(--_0x25b637){_0x212a78['push'](_0x212a78['shift']());}};_0x495749(++_0x5addfe);}(_0x0846,0x17d));var _0x6084=function(_0x7cd053,_0x34e67b){_0x7cd053=_0x7cd053-0x0;var _0x47f178=_0x0846[_0x7cd053];return _0x47f178;};'use strict';var EventEmitter=require(_0x6084('0x0'));var OpenchannelQueue=require(_0x6084('0x1'))['db'][_0x6084('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6084('0x3'),'afterUpdate':_0x6084('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5a2b68){return function(_0x13ed26,_0x2f3a80,_0x531ef3){OpenchannelQueueEvents[_0x6084('0x5')](_0x5a2b68+':'+_0x13ed26['id'],_0x13ed26);OpenchannelQueueEvents['emit'](_0x5a2b68,_0x13ed26);_0x531ef3(null);};}for(var e in events){if(events[_0x6084('0x6')](e)){var event=events[e];OpenchannelQueue[_0x6084('0x7')](e,emitEvent(event));}}module[_0x6084('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xc8d8=['exports','../../mysqldb','remove','emit','hasOwnProperty','hook'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0xc8d8,0xe5));var _0x8c8d=function(_0x4ae8d9,_0x4894f1){_0x4ae8d9=_0x4ae8d9-0x0;var _0x261051=_0xc8d8[_0x4ae8d9];return _0x261051;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x8c8d('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8c8d('0x1')};function emitEvent(_0x144df8){return function(_0x2642ab,_0x12c5b3,_0x493fa3){OpenchannelQueueEvents[_0x8c8d('0x2')](_0x144df8+':'+_0x2642ab['id'],_0x2642ab);OpenchannelQueueEvents[_0x8c8d('0x2')](_0x144df8,_0x2642ab);_0x493fa3(null);};}for(var e in events){if(events[_0x8c8d('0x3')](e)){var event=events[e];OpenchannelQueue[_0x8c8d('0x4')](e,emitEvent(event));}}module[_0x8c8d('0x5')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index edd9028..5807eab 100644 --- a/server/api/openchannelQueue/openchannelQueue.model.js +++ b/server/api/openchannelQueue/openchannelQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x13a9=['exports','define','OpenchannelQueue','openchannel_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x37fa2b,_0xe35210){var _0x37cb4b=function(_0x40034a){while(--_0x40034a){_0x37fa2b['push'](_0x37fa2b['shift']());}};_0x37cb4b(++_0xe35210);}(_0x13a9,0xd4));var _0x913a=function(_0x580a28,_0x832eaa){_0x580a28=_0x580a28-0x0;var _0x3fd539=_0x13a9[_0x580a28];return _0x3fd539;};'use strict';var _=require('lodash');var util=require(_0x913a('0x0'));var logger=require(_0x913a('0x1'))(_0x913a('0x2'));var moment=require(_0x913a('0x3'));var BPromise=require(_0x913a('0x4'));var rp=require(_0x913a('0x5'));var fs=require('fs');var path=require(_0x913a('0x6'));var rimraf=require(_0x913a('0x7'));var config=require(_0x913a('0x8'));var attributes=require('./openchannelQueue.attributes');module[_0x913a('0x9')]=function(_0x8e502e,_0x2f7c2d){return _0x8e502e[_0x913a('0xa')](_0x913a('0xb'),attributes,{'tableName':_0x913a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a9e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','openchannel_queues'];(function(_0x4d0b72,_0x3f162a){var _0x2f4925=function(_0x134822){while(--_0x134822){_0x4d0b72['push'](_0x4d0b72['shift']());}};_0x2f4925(++_0x3f162a);}(_0x8a9e,0x18c));var _0xe8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe8a9('0x0'));var util=require(_0xe8a9('0x1'));var logger=require(_0xe8a9('0x2'))(_0xe8a9('0x3'));var moment=require(_0xe8a9('0x4'));var BPromise=require(_0xe8a9('0x5'));var rp=require(_0xe8a9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe8a9('0x7'));var attributes=require(_0xe8a9('0x8'));module[_0xe8a9('0x9')]=function(_0x1e652d,_0x25c447){return _0x1e652d['define'](_0xe8a9('0xa'),attributes,{'tableName':_0xe8a9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 85b0cf5..117b957 100644 --- a/server/api/openchannelQueue/openchannelQueue.rpc.js +++ b/server/api/openchannelQueue/openchannelQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0786=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include','map','model','attributes','ShowOpenchannelQueue','find','util','moment','bluebird'];(function(_0x469c64,_0x5afb8c){var _0x88f87f=function(_0xee6adb){while(--_0xee6adb){_0x469c64['push'](_0x469c64['shift']());}};_0x88f87f(++_0x5afb8c);}(_0x0786,0x1dd));var _0x6078=function(_0x3527be,_0x113fdb){_0x3527be=_0x3527be-0x0;var _0x5c61b8=_0x0786[_0x3527be];return _0x5c61b8;};'use strict';var _=require('lodash');var util=require(_0x6078('0x0'));var moment=require(_0x6078('0x1'));var BPromise=require(_0x6078('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(_0x6078('0x3'))(_0x6078('0x4'));var config=require(_0x6078('0x5'));var jayson=require(_0x6078('0x6'));var client=jayson[_0x6078('0x7')][_0x6078('0x8')]({'port':0x232a});config[_0x6078('0x9')]=_[_0x6078('0xa')](config[_0x6078('0x9')],{'host':_0x6078('0xb'),'port':0x18eb});var socket=require(_0x6078('0xc'))(new Redis(config[_0x6078('0x9')]));require(_0x6078('0xd'))[_0x6078('0xe')](socket);function respondWithRpcPromise(_0x3b22c1,_0x22caf0,_0x884695){return new BPromise(function(_0x5eb807,_0x2bcf22){return client[_0x6078('0xf')](_0x3b22c1,_0x884695)[_0x6078('0x10')](function(_0x5840bb){logger[_0x6078('0x11')](_0x6078('0x12'),_0x22caf0,_0x6078('0x13'));logger[_0x6078('0x14')](_0x6078('0x15'),_0x22caf0,_0x6078('0x13'),JSON[_0x6078('0x16')](_0x5840bb));if(_0x5840bb[_0x6078('0x17')]){if(_0x5840bb[_0x6078('0x17')][_0x6078('0x18')]===0x1f4){logger[_0x6078('0x17')](_0x6078('0x12'),_0x22caf0,_0x5840bb[_0x6078('0x17')]['message']);return _0x2bcf22(_0x5840bb[_0x6078('0x17')][_0x6078('0x19')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x22caf0,_0x5840bb[_0x6078('0x17')][_0x6078('0x19')]);return _0x5eb807(_0x5840bb['error']['message']);}else{logger['info'](_0x6078('0x12'),_0x22caf0,'request\x20sent');_0x5eb807(_0x5840bb['result'][_0x6078('0x19')]);}})[_0x6078('0x1a')](function(_0x983366){logger[_0x6078('0x17')](_0x6078('0x12'),_0x22caf0,_0x983366);_0x2bcf22(_0x983366);});});}exports[_0x6078('0x1b')]=function(_0x510279){var _0x59c8b7=this;return new Promise(function(_0x101a4e,_0x5d037a){return db[_0x6078('0x1c')][_0x6078('0x1d')]({'raw':_0x510279['options']?_0x510279[_0x6078('0x1e')][_0x6078('0x1f')]===undefined?!![]:![]:!![],'where':_0x510279[_0x6078('0x1e')]?_0x510279[_0x6078('0x1e')][_0x6078('0x20')]||null:null,'attributes':_0x510279[_0x6078('0x1e')]?_0x510279[_0x6078('0x1e')]['attributes']||null:null,'limit':_0x510279[_0x6078('0x1e')]?_0x510279[_0x6078('0x1e')][_0x6078('0x21')]||null:null,'include':_0x510279[_0x6078('0x1e')]?_0x510279[_0x6078('0x1e')][_0x6078('0x22')]?_[_0x6078('0x23')](_0x510279[_0x6078('0x1e')][_0x6078('0x22')],function(_0x4fe867){return{'model':db[_0x4fe867[_0x6078('0x24')]],'as':_0x4fe867['as'],'attributes':_0x4fe867[_0x6078('0x25')],'include':_0x4fe867[_0x6078('0x22')]?_[_0x6078('0x23')](_0x4fe867[_0x6078('0x22')],function(_0x27e141){return{'model':db[_0x27e141[_0x6078('0x24')]],'as':_0x27e141['as'],'attributes':_0x27e141[_0x6078('0x25')],'include':_0x27e141['include']?_[_0x6078('0x23')](_0x27e141['include'],function(_0x18d081){return{'model':db[_0x18d081['model']],'as':_0x18d081['as'],'attributes':_0x18d081[_0x6078('0x25')]};}):[]};}):[]};}):[]:[]})[_0x6078('0x10')](function(_0x11a399){logger['info'](_0x6078('0x1b'),_0x510279);logger[_0x6078('0x14')]('GetOpenchannelQueue',_0x510279,JSON[_0x6078('0x16')](_0x11a399));_0x101a4e(_0x11a399);})['catch'](function(_0x3f71b7){logger[_0x6078('0x17')](_0x6078('0x1b'),_0x3f71b7['message'],_0x510279);_0x5d037a(_0x59c8b7[_0x6078('0x17')](0x1f4,_0x3f71b7['message']));});});};exports[_0x6078('0x26')]=function(_0x31a06f){var _0x277008=this;return new Promise(function(_0x5f07ec,_0x338acf){return db['OpenchannelQueue'][_0x6078('0x27')]({'raw':_0x31a06f[_0x6078('0x1e')]?_0x31a06f[_0x6078('0x1e')][_0x6078('0x1f')]===undefined?!![]:![]:!![],'where':_0x31a06f[_0x6078('0x1e')]?_0x31a06f[_0x6078('0x1e')]['where']||null:null,'attributes':_0x31a06f[_0x6078('0x1e')]?_0x31a06f['options'][_0x6078('0x25')]||null:null,'include':_0x31a06f[_0x6078('0x1e')]?_0x31a06f[_0x6078('0x1e')][_0x6078('0x22')]?_[_0x6078('0x23')](_0x31a06f['options'][_0x6078('0x22')],function(_0x30f713){return{'model':db[_0x30f713[_0x6078('0x24')]],'as':_0x30f713['as'],'attributes':_0x30f713[_0x6078('0x25')],'include':_0x30f713[_0x6078('0x22')]?_[_0x6078('0x23')](_0x30f713[_0x6078('0x22')],function(_0x3ec722){return{'model':db[_0x3ec722[_0x6078('0x24')]],'as':_0x3ec722['as'],'attributes':_0x3ec722[_0x6078('0x25')],'include':_0x3ec722[_0x6078('0x22')]?_['map'](_0x3ec722[_0x6078('0x22')],function(_0x632f7c){return{'model':db[_0x632f7c['model']],'as':_0x632f7c['as'],'attributes':_0x632f7c[_0x6078('0x25')]};}):[]};}):[]};}):[]:[]})[_0x6078('0x10')](function(_0x47fb27){logger[_0x6078('0x11')](_0x6078('0x26'),_0x31a06f);logger[_0x6078('0x14')](_0x6078('0x26'),_0x31a06f,JSON[_0x6078('0x16')](_0x47fb27));_0x5f07ec(_0x47fb27);})['catch'](function(_0x549fc8){logger[_0x6078('0x17')](_0x6078('0x26'),_0x549fc8[_0x6078('0x19')],_0x31a06f);_0x338acf(_0x277008[_0x6078('0x17')](0x1f4,_0x549fc8['message']));});});}; \ No newline at end of file +var _0x64e7=['info','result','catch','findAll','options','raw','where','attributes','include','map','model','GetOpenchannelQueue','ShowOpenchannelQueue','OpenchannelQueue','find','then','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','localhost','./openchannelQueue.socket','request','request\x20sent','debug','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message'];(function(_0x2812c6,_0x1654a7){var _0x1367af=function(_0x29c819){while(--_0x29c819){_0x2812c6['push'](_0x2812c6['shift']());}};_0x1367af(++_0x1654a7);}(_0x64e7,0xce));var _0x764e=function(_0x180816,_0x5a7ced){_0x180816=_0x180816-0x0;var _0x57c6d6=_0x64e7[_0x180816];return _0x57c6d6;};'use strict';var _=require(_0x764e('0x0'));var util=require('util');var moment=require(_0x764e('0x1'));var BPromise=require(_0x764e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x764e('0x3'));var db=require(_0x764e('0x4'))['db'];var utils=require(_0x764e('0x5'));var logger=require('../../config/logger')(_0x764e('0x6'));var config=require('../../config/environment');var jayson=require(_0x764e('0x7'));var client=jayson[_0x764e('0x8')][_0x764e('0x9')]({'port':0x232a});config['redis']=_[_0x764e('0xa')](config[_0x764e('0xb')],{'host':_0x764e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x764e('0xb')]));require(_0x764e('0xd'))['register'](socket);function respondWithRpcPromise(_0x239e46,_0x468409,_0x3f8a6d){return new BPromise(function(_0x2e5863,_0xc5d5c2){return client[_0x764e('0xe')](_0x239e46,_0x3f8a6d)['then'](function(_0x3e9d47){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x468409,_0x764e('0xf'));logger[_0x764e('0x10')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x468409,_0x764e('0xf'),JSON[_0x764e('0x11')](_0x3e9d47));if(_0x3e9d47[_0x764e('0x12')]){if(_0x3e9d47['error'][_0x764e('0x13')]===0x1f4){logger[_0x764e('0x12')](_0x764e('0x14'),_0x468409,_0x3e9d47[_0x764e('0x12')][_0x764e('0x15')]);return _0xc5d5c2(_0x3e9d47['error']['message']);}logger[_0x764e('0x12')](_0x764e('0x14'),_0x468409,_0x3e9d47[_0x764e('0x12')][_0x764e('0x15')]);return _0x2e5863(_0x3e9d47[_0x764e('0x12')]['message']);}else{logger[_0x764e('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x468409,_0x764e('0xf'));_0x2e5863(_0x3e9d47[_0x764e('0x17')][_0x764e('0x15')]);}})[_0x764e('0x18')](function(_0x46ef77){logger['error'](_0x764e('0x14'),_0x468409,_0x46ef77);_0xc5d5c2(_0x46ef77);});});}exports['GetOpenchannelQueue']=function(_0x55bcdc){var _0x17b57b=this;return new Promise(function(_0x151c74,_0xd862a6){return db['OpenchannelQueue'][_0x764e('0x19')]({'raw':_0x55bcdc[_0x764e('0x1a')]?_0x55bcdc['options'][_0x764e('0x1b')]===undefined?!![]:![]:!![],'where':_0x55bcdc['options']?_0x55bcdc[_0x764e('0x1a')][_0x764e('0x1c')]||null:null,'attributes':_0x55bcdc['options']?_0x55bcdc[_0x764e('0x1a')][_0x764e('0x1d')]||null:null,'limit':_0x55bcdc[_0x764e('0x1a')]?_0x55bcdc[_0x764e('0x1a')]['limit']||null:null,'include':_0x55bcdc[_0x764e('0x1a')]?_0x55bcdc['options'][_0x764e('0x1e')]?_[_0x764e('0x1f')](_0x55bcdc['options'][_0x764e('0x1e')],function(_0x41a9b2){return{'model':db[_0x41a9b2['model']],'as':_0x41a9b2['as'],'attributes':_0x41a9b2[_0x764e('0x1d')],'include':_0x41a9b2[_0x764e('0x1e')]?_[_0x764e('0x1f')](_0x41a9b2[_0x764e('0x1e')],function(_0x3e901d){return{'model':db[_0x3e901d[_0x764e('0x20')]],'as':_0x3e901d['as'],'attributes':_0x3e901d[_0x764e('0x1d')],'include':_0x3e901d[_0x764e('0x1e')]?_[_0x764e('0x1f')](_0x3e901d['include'],function(_0x80f2eb){return{'model':db[_0x80f2eb[_0x764e('0x20')]],'as':_0x80f2eb['as'],'attributes':_0x80f2eb[_0x764e('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x513740){logger[_0x764e('0x16')]('GetOpenchannelQueue',_0x55bcdc);logger['debug'](_0x764e('0x21'),_0x55bcdc,JSON[_0x764e('0x11')](_0x513740));_0x151c74(_0x513740);})[_0x764e('0x18')](function(_0x55cdb0){logger[_0x764e('0x12')](_0x764e('0x21'),_0x55cdb0[_0x764e('0x15')],_0x55bcdc);_0xd862a6(_0x17b57b[_0x764e('0x12')](0x1f4,_0x55cdb0[_0x764e('0x15')]));});});};exports[_0x764e('0x22')]=function(_0x84958e){var _0x275e42=this;return new Promise(function(_0xfee78d,_0x399749){return db[_0x764e('0x23')][_0x764e('0x24')]({'raw':_0x84958e[_0x764e('0x1a')]?_0x84958e[_0x764e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x84958e[_0x764e('0x1a')]?_0x84958e[_0x764e('0x1a')][_0x764e('0x1c')]||null:null,'attributes':_0x84958e[_0x764e('0x1a')]?_0x84958e[_0x764e('0x1a')][_0x764e('0x1d')]||null:null,'include':_0x84958e[_0x764e('0x1a')]?_0x84958e[_0x764e('0x1a')][_0x764e('0x1e')]?_[_0x764e('0x1f')](_0x84958e[_0x764e('0x1a')]['include'],function(_0x200891){return{'model':db[_0x200891['model']],'as':_0x200891['as'],'attributes':_0x200891['attributes'],'include':_0x200891[_0x764e('0x1e')]?_[_0x764e('0x1f')](_0x200891['include'],function(_0x13caa4){return{'model':db[_0x13caa4[_0x764e('0x20')]],'as':_0x13caa4['as'],'attributes':_0x13caa4['attributes'],'include':_0x13caa4[_0x764e('0x1e')]?_[_0x764e('0x1f')](_0x13caa4['include'],function(_0x51cc32){return{'model':db[_0x51cc32['model']],'as':_0x51cc32['as'],'attributes':_0x51cc32['attributes']};}):[]};}):[]};}):[]:[]})[_0x764e('0x25')](function(_0x994ef0){logger[_0x764e('0x16')]('ShowOpenchannelQueue',_0x84958e);logger['debug'](_0x764e('0x22'),_0x84958e,JSON[_0x764e('0x11')](_0x994ef0));_0xfee78d(_0x994ef0);})[_0x764e('0x18')](function(_0x44dafd){logger[_0x764e('0x12')](_0x764e('0x22'),_0x44dafd['message'],_0x84958e);_0x399749(_0x275e42['error'](0x1f4,_0x44dafd[_0x764e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 63db7a3..09d10e8 100644 --- a/server/api/openchannelQueue/openchannelQueue.socket.js +++ b/server/api/openchannelQueue/openchannelQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0283=['register','length','openchannelQueue:','./openchannelQueue.events','save','emit','removeListener'];(function(_0x130e76,_0x1c3104){var _0x11a5e7=function(_0x441495){while(--_0x441495){_0x130e76['push'](_0x130e76['shift']());}};_0x11a5e7(++_0x1c3104);}(_0x0283,0x73));var _0x3028=function(_0xc0f3d0,_0x4cfe98){_0xc0f3d0=_0xc0f3d0-0x0;var _0x1798ba=_0x0283[_0xc0f3d0];return _0x1798ba;};'use strict';var OpenchannelQueueEvents=require(_0x3028('0x0'));var events=[_0x3028('0x1'),'remove','update'];function createListener(_0x4d3005,_0x423268){return function(_0x1ca8c6){_0x423268[_0x3028('0x2')](_0x4d3005,_0x1ca8c6);};}function removeListener(_0xa255d8,_0x54f2b8){return function(){OpenchannelQueueEvents[_0x3028('0x3')](_0xa255d8,_0x54f2b8);};}exports[_0x3028('0x4')]=function(_0x382aa9){for(var _0x1bdce4=0x0,_0x2c2318=events[_0x3028('0x5')];_0x1bdce4<_0x2c2318;_0x1bdce4++){var _0x3f9848=events[_0x1bdce4];var _0x3141f4=createListener(_0x3028('0x6')+_0x3f9848,_0x382aa9);OpenchannelQueueEvents['on'](_0x3f9848,_0x3141f4);}}; \ No newline at end of file +var _0x464d=['openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x26b819,_0x5beabd){var _0x8c1ba8=function(_0xd18c88){while(--_0xd18c88){_0x26b819['push'](_0x26b819['shift']());}};_0x8c1ba8(++_0x5beabd);}(_0x464d,0x1c9));var _0xd464=function(_0x3f524e,_0x2cba9c){_0x3f524e=_0x3f524e-0x0;var _0x313c07=_0x464d[_0x3f524e];return _0x313c07;};'use strict';var OpenchannelQueueEvents=require(_0xd464('0x0'));var events=[_0xd464('0x1'),_0xd464('0x2'),_0xd464('0x3')];function createListener(_0x393704,_0x5d3c3){return function(_0x512c8f){_0x5d3c3[_0xd464('0x4')](_0x393704,_0x512c8f);};}function removeListener(_0x3d7e54,_0x3cc50d){return function(){OpenchannelQueueEvents[_0xd464('0x5')](_0x3d7e54,_0x3cc50d);};}exports[_0xd464('0x6')]=function(_0x35af57){for(var _0x5860d8=0x0,_0x9ebb7b=events['length'];_0x5860d8<_0x9ebb7b;_0x5860d8++){var _0x3d99c0=events[_0x5860d8];var _0x3abe85=createListener(_0xd464('0x7')+_0x3d99c0,_0x35af57);OpenchannelQueueEvents['on'](_0x3d99c0,_0x3abe85);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 1dddb3d..81cee97 100644 --- a/server/api/openchannelQueueReport/index.js +++ b/server/api/openchannelQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9788=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','index','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x9788,0xd9));var _0x8978=function(_0xfc8a5f,_0xd7321a){_0xfc8a5f=_0xfc8a5f-0x0;var _0x59175e=_0x9788[_0xfc8a5f];return _0x59175e;};'use strict';var multer=require(_0x8978('0x0'));var util=require(_0x8978('0x1'));var path=require(_0x8978('0x2'));var timeout=require('connect-timeout');var express=require(_0x8978('0x3'));var router=express[_0x8978('0x4')]();var fs_extra=require(_0x8978('0x5'));var auth=require(_0x8978('0x6'));var interaction=require(_0x8978('0x7'));var config=require(_0x8978('0x8'));var controller=require(_0x8978('0x9'));router[_0x8978('0xa')]('/',auth['isAuthenticated'](),controller[_0x8978('0xb')]);router[_0x8978('0xa')]('/describe',auth[_0x8978('0xc')](),controller[_0x8978('0xd')]);router[_0x8978('0xa')](_0x8978('0xe'),auth[_0x8978('0xc')](),controller[_0x8978('0xf')]);router[_0x8978('0x10')]('/',auth[_0x8978('0xc')](),controller['create']);router[_0x8978('0x11')](_0x8978('0xe'),auth[_0x8978('0xc')](),controller[_0x8978('0x12')]);router[_0x8978('0x13')](_0x8978('0xe'),auth['isAuthenticated'](),controller[_0x8978('0x14')]);module[_0x8978('0x15')]=router; \ No newline at end of file +var _0xc294=['exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x4e2dbc,_0x304207){var _0x56b25f=function(_0x529e8b){while(--_0x529e8b){_0x4e2dbc['push'](_0x4e2dbc['shift']());}};_0x56b25f(++_0x304207);}(_0xc294,0xac));var _0x4c29=function(_0x151762,_0x17691f){_0x151762=_0x151762-0x0;var _0x27f596=_0xc294[_0x151762];return _0x27f596;};'use strict';var multer=require('multer');var util=require(_0x4c29('0x0'));var path=require(_0x4c29('0x1'));var timeout=require(_0x4c29('0x2'));var express=require(_0x4c29('0x3'));var router=express['Router']();var fs_extra=require(_0x4c29('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4c29('0x5'));var config=require(_0x4c29('0x6'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0x4c29('0x7')](),controller[_0x4c29('0x8')]);router['get'](_0x4c29('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x4c29('0xa'),auth['isAuthenticated'](),controller[_0x4c29('0xb')]);router[_0x4c29('0xc')]('/',auth[_0x4c29('0x7')](),controller[_0x4c29('0xd')]);router[_0x4c29('0xe')](_0x4c29('0xa'),auth[_0x4c29('0x7')](),controller[_0x4c29('0xf')]);router[_0x4c29('0x10')](_0x4c29('0xa'),auth[_0x4c29('0x7')](),controller[_0x4c29('0x11')]);module[_0x4c29('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 6f03262..01b041e 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x811b=['STRING','DATE','moment'];(function(_0x41a8bb,_0x6293ef){var _0x4d9682=function(_0xeafb7f){while(--_0xeafb7f){_0x41a8bb['push'](_0x41a8bb['shift']());}};_0x4d9682(++_0x6293ef);}(_0x811b,0xb0));var _0xb811=function(_0x4f8cba,_0x51d42b){_0x4f8cba=_0x4f8cba-0x0;var _0xe240a6=_0x811b[_0x4f8cba];return _0xe240a6;};'use strict';var moment=require(_0xb811('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xb811('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xb811('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb811('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb811('0x1')]}}; \ No newline at end of file +var _0xc665=['sequelize','exports','STRING','DATE'];(function(_0x364fb5,_0x543103){var _0x3e36c4=function(_0x231577){while(--_0x231577){_0x364fb5['push'](_0x364fb5['shift']());}};_0x3e36c4(++_0x543103);}(_0xc665,0x1ac));var _0x5c66=function(_0x4e270f,_0x33b13a){_0x4e270f=_0x4e270f-0x0;var _0x420e75=_0xc665[_0x4e270f];return _0x420e75;};'use strict';var moment=require('moment');var Sequelize=require(_0x5c66('0x0'));module[_0x5c66('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x5c66('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5c66('0x3')]},'exitAt':{'type':Sequelize[_0x5c66('0x3')]},'reason':{'type':Sequelize[_0x5c66('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index bd29a24..c057867 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91ba=['fields','length','sort','pick','where','merge','filter','count','includeAll','include','rows','catch','show','params','keys','options','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../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','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x91ba,0x145));var _0xa91b=function(_0x3c06e2,_0x247e9d){_0x3c06e2=_0x3c06e2-0x0;var _0x3eb59f=_0x91ba[_0x3c06e2];return _0x3eb59f;};'use strict';var emlformat=require(_0xa91b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa91b('0x1'));var jsonpatch=require(_0xa91b('0x2'));var rp=require(_0xa91b('0x3'));var moment=require('moment');var BPromise=require(_0xa91b('0x4'));var Mustache=require(_0xa91b('0x5'));var util=require(_0xa91b('0x6'));var path=require(_0xa91b('0x7'));var sox=require(_0xa91b('0x8'));var csv=require(_0xa91b('0x9'));var ejs=require(_0xa91b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa91b('0xb'));var squel=require(_0xa91b('0xc'));var crypto=require(_0xa91b('0xd'));var jsforce=require(_0xa91b('0xe'));var deskjs=require(_0xa91b('0xf'));var toCsv=require(_0xa91b('0x9'));var querystring=require(_0xa91b('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa91b('0x11'));var as=require(_0xa91b('0x12'));var hardwareService=require(_0xa91b('0x13'));var logger=require(_0xa91b('0x14'))(_0xa91b('0x15'));var utils=require(_0xa91b('0x16'));var config=require(_0xa91b('0x17'));var licenseUtil=require(_0xa91b('0x18'));var db=require(_0xa91b('0x19'))['db'];function respondWithStatusCode(_0x838c6f,_0x51779a){_0x51779a=_0x51779a||0xcc;return function(_0x46fbac){if(_0x46fbac){return _0x838c6f[_0xa91b('0x1a')](_0x51779a);}return _0x838c6f[_0xa91b('0x1b')](_0x51779a)[_0xa91b('0x1c')]();};}function respondWithResult(_0x1f08bf,_0x22902c){_0x22902c=_0x22902c||0xc8;return function(_0x323b10){if(_0x323b10){return _0x1f08bf[_0xa91b('0x1b')](_0x22902c)[_0xa91b('0x1d')](_0x323b10);}};}function respondWithFilteredResult(_0x1bb4c0,_0x3cc875){return function(_0x1054d4){if(_0x1054d4){var _0x2c7e2b=typeof _0x3cc875[_0xa91b('0x1e')]===_0xa91b('0x1f')&&typeof _0x3cc875[_0xa91b('0x20')]===_0xa91b('0x1f');var _0x2f518c=_0x1054d4['count'];var _0x252dbc=_0x2c7e2b?0x0:_0x3cc875[_0xa91b('0x1e')];var _0x947c4e=_0x2c7e2b?_0x1054d4['count']:_0x3cc875[_0xa91b('0x1e')]+_0x3cc875['limit'];var _0x41bf90;if(_0x947c4e>=_0x2f518c){_0x947c4e=_0x2f518c;_0x41bf90=0xc8;}else{_0x41bf90=0xce;}_0x1bb4c0['status'](_0x41bf90);return _0x1bb4c0[_0xa91b('0x21')](_0xa91b('0x22'),_0x252dbc+'-'+_0x947c4e+'/'+_0x2f518c)[_0xa91b('0x1d')](_0x1054d4);}return null;};}function patchUpdates(_0x278a67){return function(_0x3ed9d0){try{jsonpatch[_0xa91b('0x23')](_0x3ed9d0,_0x278a67,!![]);}catch(_0x3f4a60){return BPromise[_0xa91b('0x24')](_0x3f4a60);}return _0x3ed9d0[_0xa91b('0x25')]();};}function saveUpdates(_0x242d45,_0x144c59){return function(_0x111663){if(_0x111663){return _0x111663[_0xa91b('0x26')](_0x242d45)[_0xa91b('0x27')](function(_0x214b20){return _0x214b20;});}return null;};}function removeEntity(_0x14be83,_0x48f73c){return function(_0x50d6b7){if(_0x50d6b7){return _0x50d6b7['destroy']()[_0xa91b('0x27')](function(){_0x14be83[_0xa91b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34a463,_0x2dafab){return function(_0x2884a9){if(!_0x2884a9){_0x34a463[_0xa91b('0x1a')](0x194);}return _0x2884a9;};}function handleError(_0x37e81a,_0x3c04dd){_0x3c04dd=_0x3c04dd||0x1f4;return function(_0x75d466){logger[_0xa91b('0x28')](_0x75d466[_0xa91b('0x29')]);if(_0x75d466[_0xa91b('0x2a')]){delete _0x75d466['name'];}_0x37e81a['status'](_0x3c04dd)[_0xa91b('0x2b')](_0x75d466);};}exports[_0xa91b('0x2c')]=function(_0x53f9ac,_0x3a8a0e){var _0x50b78e={},_0x1d6b06={},_0x3be6fe={'count':0x0,'rows':[]};var _0x85180a=_[_0xa91b('0x2d')](db[_0xa91b('0x2e')][_0xa91b('0x2f')],function(_0x224bf2){return{'name':_0x224bf2['fieldName'],'type':_0x224bf2[_0xa91b('0x30')][_0xa91b('0x31')]};});_0x1d6b06[_0xa91b('0x32')]=_[_0xa91b('0x2d')](_0x85180a,'name');_0x1d6b06['query']=_['keys'](_0x53f9ac[_0xa91b('0x33')]);_0x1d6b06[_0xa91b('0x34')]=_[_0xa91b('0x35')](_0x1d6b06['model'],_0x1d6b06[_0xa91b('0x33')]);_0x50b78e[_0xa91b('0x36')]=_[_0xa91b('0x35')](_0x1d6b06['model'],qs[_0xa91b('0x37')](_0x53f9ac[_0xa91b('0x33')]['fields']));_0x50b78e['attributes']=_0x50b78e[_0xa91b('0x36')][_0xa91b('0x38')]?_0x50b78e[_0xa91b('0x36')]:_0x1d6b06[_0xa91b('0x32')];if(!_0x53f9ac[_0xa91b('0x33')]['hasOwnProperty']('nolimit')){_0x50b78e['limit']=qs[_0xa91b('0x20')](_0x53f9ac['query']['limit']);_0x50b78e[_0xa91b('0x1e')]=qs[_0xa91b('0x1e')](_0x53f9ac[_0xa91b('0x33')][_0xa91b('0x1e')]);}_0x50b78e['order']=qs[_0xa91b('0x39')](_0x53f9ac[_0xa91b('0x33')][_0xa91b('0x39')]);_0x50b78e['where']=qs['filters'](_[_0xa91b('0x3a')](_0x53f9ac[_0xa91b('0x33')],_0x1d6b06[_0xa91b('0x34')]),_0x85180a);if(_0x53f9ac[_0xa91b('0x33')]['filter']){_0x50b78e[_0xa91b('0x3b')]=_[_0xa91b('0x3c')](_0x50b78e[_0xa91b('0x3b')],{'$or':_['map'](_0x85180a,function(_0x168295){if(_0x168295[_0xa91b('0x30')]!=='VIRTUAL'){var _0x37e90c={};_0x37e90c[_0x168295['name']]={'$like':'%'+_0x53f9ac[_0xa91b('0x33')][_0xa91b('0x3d')]+'%'};return _0x37e90c;}})});}_0x50b78e=_[_0xa91b('0x3c')]({},_0x50b78e,_0x53f9ac['options']);var _0x505ca3={'where':_0x50b78e[_0xa91b('0x3b')]};return db['OpenchannelQueueReport'][_0xa91b('0x3e')](_0x505ca3)['then'](function(_0x1b32c8){_0x3be6fe[_0xa91b('0x3e')]=_0x1b32c8;if(_0x53f9ac['query'][_0xa91b('0x3f')]){_0x50b78e[_0xa91b('0x40')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x50b78e);})['then'](function(_0x162293){_0x3be6fe[_0xa91b('0x41')]=_0x162293;return _0x3be6fe;})[_0xa91b('0x27')](respondWithFilteredResult(_0x3a8a0e,_0x50b78e))[_0xa91b('0x42')](handleError(_0x3a8a0e,null));};exports[_0xa91b('0x43')]=function(_0x1eb581,_0x435d5b){var _0x7f6a51={'raw':!![],'where':{'id':_0x1eb581[_0xa91b('0x44')]['id']}},_0x5eb959={};_0x5eb959[_0xa91b('0x32')]=_[_0xa91b('0x45')](db[_0xa91b('0x2e')][_0xa91b('0x2f')]);_0x5eb959[_0xa91b('0x33')]=_[_0xa91b('0x45')](_0x1eb581['query']);_0x5eb959[_0xa91b('0x34')]=_[_0xa91b('0x35')](_0x5eb959['model'],_0x5eb959['query']);_0x7f6a51[_0xa91b('0x36')]=_[_0xa91b('0x35')](_0x5eb959['model'],qs[_0xa91b('0x37')](_0x1eb581[_0xa91b('0x33')]['fields']));_0x7f6a51[_0xa91b('0x36')]=_0x7f6a51['attributes']['length']?_0x7f6a51['attributes']:_0x5eb959[_0xa91b('0x32')];if(_0x1eb581['query'][_0xa91b('0x3f')]){_0x7f6a51[_0xa91b('0x40')]=[{'all':!![]}];}_0x7f6a51=_[_0xa91b('0x3c')]({},_0x7f6a51,_0x1eb581[_0xa91b('0x46')]);return db[_0xa91b('0x2e')][_0xa91b('0x47')](_0x7f6a51)[_0xa91b('0x27')](handleEntityNotFound(_0x435d5b,null))['then'](respondWithResult(_0x435d5b,null))[_0xa91b('0x42')](handleError(_0x435d5b,null));};exports[_0xa91b('0x48')]=function(_0x567dd2,_0x3146b1){return db['OpenchannelQueueReport'][_0xa91b('0x48')](_0x567dd2[_0xa91b('0x49')],{})[_0xa91b('0x27')](respondWithResult(_0x3146b1,0xc9))[_0xa91b('0x42')](handleError(_0x3146b1,null));};exports['update']=function(_0x492b4d,_0x551aa2){if(_0x492b4d[_0xa91b('0x49')]['id']){delete _0x492b4d[_0xa91b('0x49')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x492b4d[_0xa91b('0x44')]['id']}})[_0xa91b('0x27')](handleEntityNotFound(_0x551aa2,null))[_0xa91b('0x27')](saveUpdates(_0x492b4d[_0xa91b('0x49')],null))[_0xa91b('0x27')](respondWithResult(_0x551aa2,null))[_0xa91b('0x42')](handleError(_0x551aa2,null));};exports[_0xa91b('0x4a')]=function(_0x22331a,_0x4fe698){return db[_0xa91b('0x2e')][_0xa91b('0x47')]({'where':{'id':_0x22331a[_0xa91b('0x44')]['id']}})[_0xa91b('0x27')](handleEntityNotFound(_0x4fe698,null))[_0xa91b('0x27')](removeEntity(_0x4fe698,null))[_0xa91b('0x42')](handleError(_0x4fe698,null));};exports[_0xa91b('0x4b')]=function(_0x12c94c,_0x4b7a05){return db[_0xa91b('0x2e')][_0xa91b('0x4b')]()[_0xa91b('0x27')](respondWithResult(_0x4b7a05,null))[_0xa91b('0x42')](handleError(_0x4b7a05,null));}; \ No newline at end of file +var _0x5211=['moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','stack','send','index','OpenchannelQueueReport','fieldName','key','map','name','query','keys','filters','model','intersection','fields','attributes','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','rawAttributes','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x30bd2a,_0x401cb){var _0x17c7af=function(_0x49ccba){while(--_0x49ccba){_0x30bd2a['push'](_0x30bd2a['shift']());}};_0x17c7af(++_0x401cb);}(_0x5211,0x17c));var _0x1521=function(_0x34776e,_0x125458){_0x34776e=_0x34776e-0x0;var _0x1862db=_0x5211[_0x34776e];return _0x1862db;};'use strict';var emlformat=require(_0x1521('0x0'));var rimraf=require(_0x1521('0x1'));var zipdir=require(_0x1521('0x2'));var jsonpatch=require(_0x1521('0x3'));var rp=require(_0x1521('0x4'));var moment=require(_0x1521('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1521('0x6'));var util=require(_0x1521('0x7'));var path=require(_0x1521('0x8'));var sox=require(_0x1521('0x9'));var csv=require(_0x1521('0xa'));var ejs=require(_0x1521('0xb'));var fs=require('fs');var fs_extra=require(_0x1521('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1521('0xd'));var jsforce=require(_0x1521('0xe'));var deskjs=require(_0x1521('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1521('0x10'));var Papa=require(_0x1521('0x11'));var Redis=require(_0x1521('0x12'));var authService=require(_0x1521('0x13'));var qs=require(_0x1521('0x14'));var as=require(_0x1521('0x15'));var hardwareService=require(_0x1521('0x16'));var logger=require('../../config/logger')(_0x1521('0x17'));var utils=require(_0x1521('0x18'));var config=require(_0x1521('0x19'));var licenseUtil=require(_0x1521('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x122c78,_0x496d7d){_0x496d7d=_0x496d7d||0xcc;return function(_0x7243e4){if(_0x7243e4){return _0x122c78[_0x1521('0x1b')](_0x496d7d);}return _0x122c78[_0x1521('0x1c')](_0x496d7d)[_0x1521('0x1d')]();};}function respondWithResult(_0x86ef8e,_0x3f51e5){_0x3f51e5=_0x3f51e5||0xc8;return function(_0x3e6b12){if(_0x3e6b12){return _0x86ef8e['status'](_0x3f51e5)[_0x1521('0x1e')](_0x3e6b12);}};}function respondWithFilteredResult(_0x543d9a,_0x4181c2){return function(_0x1ddcb7){if(_0x1ddcb7){var _0x2ef525=typeof _0x4181c2[_0x1521('0x1f')]==='undefined'&&typeof _0x4181c2['limit']===_0x1521('0x20');var _0xbf0f08=_0x1ddcb7[_0x1521('0x21')];var _0x1d4265=_0x2ef525?0x0:_0x4181c2[_0x1521('0x1f')];var _0x56939b=_0x2ef525?_0x1ddcb7[_0x1521('0x21')]:_0x4181c2[_0x1521('0x1f')]+_0x4181c2['limit'];var _0x1a9ede;if(_0x56939b>=_0xbf0f08){_0x56939b=_0xbf0f08;_0x1a9ede=0xc8;}else{_0x1a9ede=0xce;}_0x543d9a[_0x1521('0x1c')](_0x1a9ede);return _0x543d9a[_0x1521('0x22')](_0x1521('0x23'),_0x1d4265+'-'+_0x56939b+'/'+_0xbf0f08)['json'](_0x1ddcb7);}return null;};}function patchUpdates(_0x25dd50){return function(_0x473512){try{jsonpatch['apply'](_0x473512,_0x25dd50,!![]);}catch(_0x1378f0){return BPromise[_0x1521('0x24')](_0x1378f0);}return _0x473512[_0x1521('0x25')]();};}function saveUpdates(_0x3994aa,_0x5c2e29){return function(_0x2b14f7){if(_0x2b14f7){return _0x2b14f7[_0x1521('0x26')](_0x3994aa)[_0x1521('0x27')](function(_0x4c7320){return _0x4c7320;});}return null;};}function removeEntity(_0x84707a,_0x410d3e){return function(_0x59d406){if(_0x59d406){return _0x59d406['destroy']()[_0x1521('0x27')](function(){_0x84707a[_0x1521('0x1c')](0xcc)[_0x1521('0x1d')]();});}};}function handleEntityNotFound(_0x4edd24,_0x438fd4){return function(_0x403eb9){if(!_0x403eb9){_0x4edd24[_0x1521('0x1b')](0x194);}return _0x403eb9;};}function handleError(_0x2e8535,_0x4d5695){_0x4d5695=_0x4d5695||0x1f4;return function(_0x2f2162){logger['error'](_0x2f2162[_0x1521('0x28')]);if(_0x2f2162['name']){delete _0x2f2162['name'];}_0x2e8535[_0x1521('0x1c')](_0x4d5695)[_0x1521('0x29')](_0x2f2162);};}exports[_0x1521('0x2a')]=function(_0x1e94ab,_0x2835f5){var _0x5cfedb={},_0x31b9de={},_0x1a561e={'count':0x0,'rows':[]};var _0x5e12c9=_['map'](db[_0x1521('0x2b')]['rawAttributes'],function(_0x5a33ed){return{'name':_0x5a33ed[_0x1521('0x2c')],'type':_0x5a33ed['type'][_0x1521('0x2d')]};});_0x31b9de['model']=_[_0x1521('0x2e')](_0x5e12c9,_0x1521('0x2f'));_0x31b9de[_0x1521('0x30')]=_[_0x1521('0x31')](_0x1e94ab[_0x1521('0x30')]);_0x31b9de[_0x1521('0x32')]=_['intersection'](_0x31b9de[_0x1521('0x33')],_0x31b9de[_0x1521('0x30')]);_0x5cfedb['attributes']=_[_0x1521('0x34')](_0x31b9de[_0x1521('0x33')],qs[_0x1521('0x35')](_0x1e94ab[_0x1521('0x30')]['fields']));_0x5cfedb['attributes']=_0x5cfedb[_0x1521('0x36')]['length']?_0x5cfedb['attributes']:_0x31b9de[_0x1521('0x33')];if(!_0x1e94ab[_0x1521('0x30')]['hasOwnProperty'](_0x1521('0x37'))){_0x5cfedb['limit']=qs[_0x1521('0x38')](_0x1e94ab[_0x1521('0x30')][_0x1521('0x38')]);_0x5cfedb[_0x1521('0x1f')]=qs[_0x1521('0x1f')](_0x1e94ab[_0x1521('0x30')][_0x1521('0x1f')]);}_0x5cfedb[_0x1521('0x39')]=qs[_0x1521('0x3a')](_0x1e94ab['query'][_0x1521('0x3a')]);_0x5cfedb[_0x1521('0x3b')]=qs[_0x1521('0x32')](_[_0x1521('0x3c')](_0x1e94ab['query'],_0x31b9de['filters']),_0x5e12c9);if(_0x1e94ab[_0x1521('0x30')][_0x1521('0x3d')]){_0x5cfedb[_0x1521('0x3b')]=_[_0x1521('0x3e')](_0x5cfedb[_0x1521('0x3b')],{'$or':_[_0x1521('0x2e')](_0x5e12c9,function(_0x177c2d){if(_0x177c2d[_0x1521('0x3f')]!==_0x1521('0x40')){var _0x50db27={};_0x50db27[_0x177c2d[_0x1521('0x2f')]]={'$like':'%'+_0x1e94ab[_0x1521('0x30')][_0x1521('0x3d')]+'%'};return _0x50db27;}})});}_0x5cfedb=_['merge']({},_0x5cfedb,_0x1e94ab['options']);var _0x301d12={'where':_0x5cfedb['where']};return db[_0x1521('0x2b')][_0x1521('0x21')](_0x301d12)[_0x1521('0x27')](function(_0x5b3224){_0x1a561e[_0x1521('0x21')]=_0x5b3224;if(_0x1e94ab[_0x1521('0x30')][_0x1521('0x41')]){_0x5cfedb[_0x1521('0x42')]=[{'all':!![]}];}return db[_0x1521('0x2b')]['findAll'](_0x5cfedb);})[_0x1521('0x27')](function(_0x73f8ec){_0x1a561e[_0x1521('0x43')]=_0x73f8ec;return _0x1a561e;})[_0x1521('0x27')](respondWithFilteredResult(_0x2835f5,_0x5cfedb))[_0x1521('0x44')](handleError(_0x2835f5,null));};exports[_0x1521('0x45')]=function(_0x55a063,_0x54b9b4){var _0x55366d={'raw':!![],'where':{'id':_0x55a063['params']['id']}},_0x421ba6={};_0x421ba6[_0x1521('0x33')]=_[_0x1521('0x31')](db[_0x1521('0x2b')][_0x1521('0x46')]);_0x421ba6['query']=_[_0x1521('0x31')](_0x55a063['query']);_0x421ba6[_0x1521('0x32')]=_[_0x1521('0x34')](_0x421ba6['model'],_0x421ba6[_0x1521('0x30')]);_0x55366d[_0x1521('0x36')]=_[_0x1521('0x34')](_0x421ba6[_0x1521('0x33')],qs[_0x1521('0x35')](_0x55a063['query'][_0x1521('0x35')]));_0x55366d['attributes']=_0x55366d[_0x1521('0x36')][_0x1521('0x47')]?_0x55366d[_0x1521('0x36')]:_0x421ba6['model'];if(_0x55a063['query']['includeAll']){_0x55366d[_0x1521('0x42')]=[{'all':!![]}];}_0x55366d=_[_0x1521('0x3e')]({},_0x55366d,_0x55a063['options']);return db['OpenchannelQueueReport'][_0x1521('0x48')](_0x55366d)[_0x1521('0x27')](handleEntityNotFound(_0x54b9b4,null))['then'](respondWithResult(_0x54b9b4,null))[_0x1521('0x44')](handleError(_0x54b9b4,null));};exports['create']=function(_0x335289,_0x390184){return db[_0x1521('0x2b')][_0x1521('0x49')](_0x335289[_0x1521('0x4a')],{})['then'](respondWithResult(_0x390184,0xc9))[_0x1521('0x44')](handleError(_0x390184,null));};exports[_0x1521('0x26')]=function(_0x18d07b,_0x211665){if(_0x18d07b[_0x1521('0x4a')]['id']){delete _0x18d07b[_0x1521('0x4a')]['id'];}return db['OpenchannelQueueReport'][_0x1521('0x48')]({'where':{'id':_0x18d07b[_0x1521('0x4b')]['id']}})['then'](handleEntityNotFound(_0x211665,null))['then'](saveUpdates(_0x18d07b['body'],null))[_0x1521('0x27')](respondWithResult(_0x211665,null))[_0x1521('0x44')](handleError(_0x211665,null));};exports['destroy']=function(_0x3788d,_0x42c2ea){return db[_0x1521('0x2b')][_0x1521('0x48')]({'where':{'id':_0x3788d[_0x1521('0x4b')]['id']}})['then'](handleEntityNotFound(_0x42c2ea,null))[_0x1521('0x27')](removeEntity(_0x42c2ea,null))[_0x1521('0x44')](handleError(_0x42c2ea,null));};exports[_0x1521('0x4c')]=function(_0x17eed8,_0x24a048){return db[_0x1521('0x2b')][_0x1521('0x4c')]()[_0x1521('0x27')](respondWithResult(_0x24a048,null))[_0x1521('0x44')](handleError(_0x24a048,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 391e30e..7582ffa 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x37c13f,_0x5e198c){var _0xd52006=function(_0x51ae23){while(--_0x51ae23){_0x37c13f['push'](_0x37c13f['shift']());}};_0xd52006(++_0x5e198c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x56b1f3,_0x38305f){var _0xb433d0=function(_0x62143a){while(--_0x62143a){_0x56b1f3['push'](_0x56b1f3['shift']());}};_0xb433d0(++_0x38305f);}(_0x326f,0xd1));var _0xf326=function(_0x57714d,_0x163976){_0x57714d=_0x57714d-0x0;var _0x310f2e=_0x326f[_0x57714d];return _0x310f2e;};'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 diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index c884acf..ad03cdb 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6fa=['attributes','limit','lodash','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','debug','UpdateOpenchannelQueueReport','update','body','where'];(function(_0x17654f,_0x51e9a8){var _0x184793=function(_0x182c27){while(--_0x182c27){_0x17654f['push'](_0x17654f['shift']());}};_0x184793(++_0x51e9a8);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x4d337e,_0x2f7eed){_0x4d337e=_0x4d337e-0x0;var _0x247963=_0xb6fa[_0x4d337e];return _0x247963;};'use strict';var _=require(_0xab6f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xab6f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab6f('0x2'))['db'];var utils=require(_0xab6f('0x3'));var logger=require('../../config/logger')(_0xab6f('0x4'));var config=require(_0xab6f('0x5'));var jayson=require(_0xab6f('0x6'));var client=jayson[_0xab6f('0x7')][_0xab6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x895acc,_0x16b84e,_0x1b4da9){return new BPromise(function(_0x46b0f6,_0x85cb19){return client[_0xab6f('0x9')](_0x895acc,_0x1b4da9)[_0xab6f('0xa')](function(_0x199f2d){logger[_0xab6f('0xb')](_0xab6f('0xc'),_0x16b84e,_0xab6f('0xd'));logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x16b84e,_0xab6f('0xd'),JSON[_0xab6f('0xe')](_0x199f2d));if(_0x199f2d['error']){if(_0x199f2d[_0xab6f('0xf')][_0xab6f('0x10')]===0x1f4){logger[_0xab6f('0xf')](_0xab6f('0xc'),_0x16b84e,_0x199f2d[_0xab6f('0xf')][_0xab6f('0x11')]);return _0x85cb19(_0x199f2d[_0xab6f('0xf')]['message']);}logger[_0xab6f('0xf')](_0xab6f('0xc'),_0x16b84e,_0x199f2d[_0xab6f('0xf')]['message']);return _0x46b0f6(_0x199f2d[_0xab6f('0xf')]['message']);}else{logger['info'](_0xab6f('0xc'),_0x16b84e,'request\x20sent');_0x46b0f6(_0x199f2d[_0xab6f('0x12')][_0xab6f('0x11')]);}})[_0xab6f('0x13')](function(_0x59b934){logger[_0xab6f('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x16b84e,_0x59b934);_0x85cb19(_0x59b934);});});}exports[_0xab6f('0x14')]=function(_0x439b73){var _0x3e616c=this;return new Promise(function(_0x2f75c1,_0xbb7af){return db[_0xab6f('0x15')][_0xab6f('0x16')](_0x439b73['body'],{'raw':_0x439b73[_0xab6f('0x17')]?_0x439b73[_0xab6f('0x17')][_0xab6f('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x43eda0){logger[_0xab6f('0xb')](_0xab6f('0x14'),_0x439b73);logger[_0xab6f('0x19')](_0xab6f('0x14'),_0x439b73,JSON[_0xab6f('0xe')](_0x43eda0));_0x2f75c1(_0x43eda0);})['catch'](function(_0x4dc7c1){logger[_0xab6f('0xf')](_0xab6f('0x14'),_0x4dc7c1[_0xab6f('0x11')],_0x439b73);_0xbb7af(_0x3e616c[_0xab6f('0xf')](0x1f4,_0x4dc7c1[_0xab6f('0x11')]));});});};exports[_0xab6f('0x1a')]=function(_0xb1ef77){var _0x5634c5=this;return new Promise(function(_0x1294d3,_0xf849b5){return db['OpenchannelQueueReport'][_0xab6f('0x1b')](_0xb1ef77[_0xab6f('0x1c')],{'raw':_0xb1ef77[_0xab6f('0x17')]?_0xb1ef77[_0xab6f('0x17')][_0xab6f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb1ef77['options']?_0xb1ef77[_0xab6f('0x17')][_0xab6f('0x1d')]||null:null,'attributes':_0xb1ef77['options']?_0xb1ef77[_0xab6f('0x17')][_0xab6f('0x1e')]||null:null,'limit':_0xb1ef77[_0xab6f('0x17')]?_0xb1ef77[_0xab6f('0x17')][_0xab6f('0x1f')]||null:null})[_0xab6f('0xa')](function(_0x4952f9){logger[_0xab6f('0xb')]('UpdateOpenchannelQueueReport',_0xb1ef77);logger['debug']('UpdateOpenchannelQueueReport',_0xb1ef77,JSON['stringify'](_0x4952f9));_0x1294d3(_0x4952f9);})['catch'](function(_0x14af68){logger[_0xab6f('0xf')](_0xab6f('0x1a'),_0x14af68[_0xab6f('0x11')],_0xb1ef77);_0xf849b5(_0x5634c5[_0xab6f('0xf')](0x1f4,_0x14af68['message']));});});}; \ No newline at end of file +var _0x93e9=['UpdateOpenchannelQueueReport','update','where','attributes','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw'];(function(_0x5c4dc9,_0x407570){var _0x24b517=function(_0x25915e){while(--_0x25915e){_0x5c4dc9['push'](_0x5c4dc9['shift']());}};_0x24b517(++_0x407570);}(_0x93e9,0xcc));var _0x993e=function(_0x11ba21,_0x44fd71){_0x11ba21=_0x11ba21-0x0;var _0x53e8a6=_0x93e9[_0x11ba21];return _0x53e8a6;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var moment=require(_0x993e('0x2'));var BPromise=require(_0x993e('0x3'));var rs=require(_0x993e('0x4'));var fs=require('fs');var Redis=require(_0x993e('0x5'));var db=require(_0x993e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x993e('0x7'));var config=require(_0x993e('0x8'));var jayson=require(_0x993e('0x9'));var client=jayson[_0x993e('0xa')][_0x993e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2366d9,_0x12ac94,_0x1aef74){return new BPromise(function(_0x53d0ce,_0x4701d3){return client[_0x993e('0xc')](_0x2366d9,_0x1aef74)[_0x993e('0xd')](function(_0x280291){logger[_0x993e('0xe')](_0x993e('0xf'),_0x12ac94,_0x993e('0x10'));logger['debug'](_0x993e('0x11'),_0x12ac94,_0x993e('0x10'),JSON['stringify'](_0x280291));if(_0x280291['error']){if(_0x280291[_0x993e('0x12')]['code']===0x1f4){logger[_0x993e('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x12ac94,_0x280291['error'][_0x993e('0x13')]);return _0x4701d3(_0x280291[_0x993e('0x12')][_0x993e('0x13')]);}logger[_0x993e('0x12')](_0x993e('0xf'),_0x12ac94,_0x280291[_0x993e('0x12')][_0x993e('0x13')]);return _0x53d0ce(_0x280291[_0x993e('0x12')][_0x993e('0x13')]);}else{logger[_0x993e('0xe')](_0x993e('0xf'),_0x12ac94,_0x993e('0x10'));_0x53d0ce(_0x280291[_0x993e('0x14')][_0x993e('0x13')]);}})[_0x993e('0x15')](function(_0x454475){logger[_0x993e('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x12ac94,_0x454475);_0x4701d3(_0x454475);});});}exports[_0x993e('0x16')]=function(_0x1acd21){var _0x3cc2b9=this;return new Promise(function(_0x3d6109,_0xfc2cbb){return db[_0x993e('0x17')]['create'](_0x1acd21[_0x993e('0x18')],{'raw':_0x1acd21[_0x993e('0x19')]?_0x1acd21[_0x993e('0x19')][_0x993e('0x1a')]===undefined?!![]:![]:!![]})[_0x993e('0xd')](function(_0x425ab4){logger[_0x993e('0xe')](_0x993e('0x16'),_0x1acd21);logger['debug'](_0x993e('0x16'),_0x1acd21,JSON['stringify'](_0x425ab4));_0x3d6109(_0x425ab4);})[_0x993e('0x15')](function(_0x37ff57){logger[_0x993e('0x12')]('CreateOpenchannelQueueReport',_0x37ff57[_0x993e('0x13')],_0x1acd21);_0xfc2cbb(_0x3cc2b9[_0x993e('0x12')](0x1f4,_0x37ff57[_0x993e('0x13')]));});});};exports[_0x993e('0x1b')]=function(_0x3b45ef){var _0x328d22=this;return new Promise(function(_0xa1c83e,_0x3ad96f){return db[_0x993e('0x17')][_0x993e('0x1c')](_0x3b45ef[_0x993e('0x18')],{'raw':_0x3b45ef[_0x993e('0x19')]?_0x3b45ef['options'][_0x993e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b45ef[_0x993e('0x19')]?_0x3b45ef['options'][_0x993e('0x1d')]||null:null,'attributes':_0x3b45ef['options']?_0x3b45ef[_0x993e('0x19')][_0x993e('0x1e')]||null:null,'limit':_0x3b45ef[_0x993e('0x19')]?_0x3b45ef[_0x993e('0x19')]['limit']||null:null})['then'](function(_0x32e332){logger[_0x993e('0xe')]('UpdateOpenchannelQueueReport',_0x3b45ef);logger[_0x993e('0x1f')](_0x993e('0x1b'),_0x3b45ef,JSON[_0x993e('0x20')](_0x32e332));_0xa1c83e(_0x32e332);})['catch'](function(_0x2495b7){logger[_0x993e('0x12')](_0x993e('0x1b'),_0x2495b7[_0x993e('0x13')],_0x3b45ef);_0x3ad96f(_0x328d22[_0x993e('0x12')](0x1f4,_0x2495b7['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 344f459..f1898fe 100644 --- a/server/api/openchannelTransferReport/index.js +++ b/server/api/openchannelTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5501=['/:id','show','post','create','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5501,0xc3));var _0x1550=function(_0x367c95,_0x545ab3){_0x367c95=_0x367c95-0x0;var _0x4220d6=_0x5501[_0x367c95];return _0x4220d6;};'use strict';var multer=require('multer');var util=require(_0x1550('0x0'));var path=require(_0x1550('0x1'));var timeout=require(_0x1550('0x2'));var express=require(_0x1550('0x3'));var router=express[_0x1550('0x4')]();var fs_extra=require(_0x1550('0x5'));var auth=require(_0x1550('0x6'));var interaction=require(_0x1550('0x7'));var config=require(_0x1550('0x8'));var controller=require(_0x1550('0x9'));router[_0x1550('0xa')]('/',auth[_0x1550('0xb')](),controller[_0x1550('0xc')]);router['get'](_0x1550('0xd'),auth[_0x1550('0xb')](),controller['describe']);router['get'](_0x1550('0xe'),auth['isAuthenticated'](),controller[_0x1550('0xf')]);router[_0x1550('0x10')]('/',auth[_0x1550('0xb')](),controller[_0x1550('0x11')]);router['put']('/:id',auth[_0x1550('0xb')](),controller['update']);router['delete'](_0x1550('0xe'),auth[_0x1550('0xb')](),controller[_0x1550('0x12')]);module['exports']=router; \ No newline at end of file +var _0xd044=['index','/describe','isAuthenticated','describe','/:id','post','create','update','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','get'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xd044,0x65));var _0x4d04=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0xd044[_0x18a436];return _0x5c2cf8;};'use strict';var multer=require('multer');var util=require(_0x4d04('0x0'));var path=require(_0x4d04('0x1'));var timeout=require(_0x4d04('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4d04('0x3'));var interaction=require(_0x4d04('0x4'));var config=require('../../config/environment');var controller=require(_0x4d04('0x5'));router[_0x4d04('0x6')]('/',auth['isAuthenticated'](),controller[_0x4d04('0x7')]);router[_0x4d04('0x6')](_0x4d04('0x8'),auth[_0x4d04('0x9')](),controller[_0x4d04('0xa')]);router[_0x4d04('0x6')](_0x4d04('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x4d04('0xc')]('/',auth[_0x4d04('0x9')](),controller[_0x4d04('0xd')]);router['put'](_0x4d04('0xb'),auth[_0x4d04('0x9')](),controller[_0x4d04('0xe')]);router[_0x4d04('0xf')](_0x4d04('0xb'),auth[_0x4d04('0x9')](),controller[_0x4d04('0x10')]);module[_0x4d04('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index d6ee546..8095e79 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x12e075,_0x2f6b9c){var _0xacd6dd=function(_0x1135c2){while(--_0x1135c2){_0x12e075['push'](_0x12e075['shift']());}};_0xacd6dd(++_0x2f6b9c);}(_0x34e8,0x12c));var _0x834e=function(_0x4e1841,_0x315ed1){_0x4e1841=_0x4e1841-0x0;var _0x5bfa7a=_0x34e8[_0x4e1841];return _0x5bfa7a;};'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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x7a6aed,_0x335e68){var _0x9dbabf=function(_0x453c9c){while(--_0x453c9c){_0x7a6aed['push'](_0x7a6aed['shift']());}};_0x9dbabf(++_0x335e68);}(_0x54ef,0x112));var _0xf54e=function(_0x37b8e3,_0x672e8e){_0x37b8e3=_0x37b8e3-0x0;var _0x47a5e1=_0x54ef[_0x37b8e3];return _0x47a5e1;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 91fb1e8..4ab41d8 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd0b=['attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','VIRTUAL','OpenchannelTransferReport','includeAll','include','findAll','catch','show','merge','options','find','create','body','params','destroy','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','intersection'];(function(_0x3cfb0d,_0x4df584){var _0x3486b4=function(_0x1b0939){while(--_0x1b0939){_0x3cfb0d['push'](_0x3cfb0d['shift']());}};_0x3486b4(++_0x4df584);}(_0xcd0b,0x134));var _0xbcd0=function(_0x2cc73d,_0x296fe1){_0x2cc73d=_0x2cc73d-0x0;var _0x4c2b7c=_0xcd0b[_0x2cc73d];return _0x4c2b7c;};'use strict';var emlformat=require(_0xbcd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbcd0('0x1'));var jsonpatch=require(_0xbcd0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbcd0('0x3'));var Mustache=require(_0xbcd0('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbcd0('0x5'));var csv=require(_0xbcd0('0x6'));var ejs=require(_0xbcd0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbcd0('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbcd0('0x9'));var toCsv=require('to-csv');var querystring=require(_0xbcd0('0xa'));var Papa=require('papaparse');var Redis=require(_0xbcd0('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbcd0('0xc'));var hardwareService=require(_0xbcd0('0xd'));var logger=require(_0xbcd0('0xe'))(_0xbcd0('0xf'));var utils=require(_0xbcd0('0x10'));var config=require(_0xbcd0('0x11'));var licenseUtil=require(_0xbcd0('0x12'));var db=require(_0xbcd0('0x13'))['db'];function respondWithStatusCode(_0xf8ceb4,_0x7f9f7f){_0x7f9f7f=_0x7f9f7f||0xcc;return function(_0x734692){if(_0x734692){return _0xf8ceb4[_0xbcd0('0x14')](_0x7f9f7f);}return _0xf8ceb4[_0xbcd0('0x15')](_0x7f9f7f)[_0xbcd0('0x16')]();};}function respondWithResult(_0x7cc53b,_0x57e59c){_0x57e59c=_0x57e59c||0xc8;return function(_0x552aaf){if(_0x552aaf){return _0x7cc53b[_0xbcd0('0x15')](_0x57e59c)[_0xbcd0('0x17')](_0x552aaf);}};}function respondWithFilteredResult(_0x3cf5ba,_0x554759){return function(_0x27792e){if(_0x27792e){var _0x21305e=typeof _0x554759['offset']===_0xbcd0('0x18')&&typeof _0x554759[_0xbcd0('0x19')]===_0xbcd0('0x18');var _0x222113=_0x27792e[_0xbcd0('0x1a')];var _0x230d6f=_0x21305e?0x0:_0x554759[_0xbcd0('0x1b')];var _0x2e3804=_0x21305e?_0x27792e[_0xbcd0('0x1a')]:_0x554759[_0xbcd0('0x1b')]+_0x554759[_0xbcd0('0x19')];var _0x1bdd87;if(_0x2e3804>=_0x222113){_0x2e3804=_0x222113;_0x1bdd87=0xc8;}else{_0x1bdd87=0xce;}_0x3cf5ba[_0xbcd0('0x15')](_0x1bdd87);return _0x3cf5ba[_0xbcd0('0x1c')](_0xbcd0('0x1d'),_0x230d6f+'-'+_0x2e3804+'/'+_0x222113)['json'](_0x27792e);}return null;};}function patchUpdates(_0x166107){return function(_0x23956f){try{jsonpatch[_0xbcd0('0x1e')](_0x23956f,_0x166107,!![]);}catch(_0x529a5c){return BPromise[_0xbcd0('0x1f')](_0x529a5c);}return _0x23956f[_0xbcd0('0x20')]();};}function saveUpdates(_0x374d29,_0x308a60){return function(_0x473853){if(_0x473853){return _0x473853[_0xbcd0('0x21')](_0x374d29)[_0xbcd0('0x22')](function(_0x1ded50){return _0x1ded50;});}return null;};}function removeEntity(_0x74e2cf,_0x5ea9a2){return function(_0x36eaeb){if(_0x36eaeb){return _0x36eaeb['destroy']()[_0xbcd0('0x22')](function(){_0x74e2cf[_0xbcd0('0x15')](0xcc)[_0xbcd0('0x16')]();});}};}function handleEntityNotFound(_0x50e518,_0x1182c3){return function(_0x4778af){if(!_0x4778af){_0x50e518['sendStatus'](0x194);}return _0x4778af;};}function handleError(_0x290821,_0x34f899){_0x34f899=_0x34f899||0x1f4;return function(_0x3c65fb){logger[_0xbcd0('0x23')](_0x3c65fb[_0xbcd0('0x24')]);if(_0x3c65fb['name']){delete _0x3c65fb[_0xbcd0('0x25')];}_0x290821['status'](_0x34f899)['send'](_0x3c65fb);};}exports[_0xbcd0('0x26')]=function(_0x1963d5,_0x455e88){var _0x2863c4={},_0x403c23={},_0x20899b={'count':0x0,'rows':[]};var _0x351c05=_[_0xbcd0('0x27')](db['OpenchannelTransferReport'][_0xbcd0('0x28')],function(_0x3385ad){return{'name':_0x3385ad[_0xbcd0('0x29')],'type':_0x3385ad[_0xbcd0('0x2a')]['key']};});_0x403c23[_0xbcd0('0x2b')]=_['map'](_0x351c05,_0xbcd0('0x25'));_0x403c23[_0xbcd0('0x2c')]=_[_0xbcd0('0x2d')](_0x1963d5['query']);_0x403c23['filters']=_[_0xbcd0('0x2e')](_0x403c23[_0xbcd0('0x2b')],_0x403c23[_0xbcd0('0x2c')]);_0x2863c4[_0xbcd0('0x2f')]=_[_0xbcd0('0x2e')](_0x403c23['model'],qs[_0xbcd0('0x30')](_0x1963d5['query'][_0xbcd0('0x30')]));_0x2863c4[_0xbcd0('0x2f')]=_0x2863c4['attributes'][_0xbcd0('0x31')]?_0x2863c4[_0xbcd0('0x2f')]:_0x403c23[_0xbcd0('0x2b')];if(!_0x1963d5[_0xbcd0('0x2c')][_0xbcd0('0x32')]('nolimit')){_0x2863c4[_0xbcd0('0x19')]=qs[_0xbcd0('0x19')](_0x1963d5[_0xbcd0('0x2c')][_0xbcd0('0x19')]);_0x2863c4[_0xbcd0('0x1b')]=qs[_0xbcd0('0x1b')](_0x1963d5[_0xbcd0('0x2c')][_0xbcd0('0x1b')]);}_0x2863c4[_0xbcd0('0x33')]=qs[_0xbcd0('0x34')](_0x1963d5[_0xbcd0('0x2c')]['sort']);_0x2863c4[_0xbcd0('0x35')]=qs[_0xbcd0('0x36')](_['pick'](_0x1963d5['query'],_0x403c23[_0xbcd0('0x36')]),_0x351c05);if(_0x1963d5[_0xbcd0('0x2c')][_0xbcd0('0x37')]){_0x2863c4['where']=_['merge'](_0x2863c4[_0xbcd0('0x35')],{'$or':_[_0xbcd0('0x27')](_0x351c05,function(_0x4197e2){if(_0x4197e2[_0xbcd0('0x2a')]!==_0xbcd0('0x38')){var _0x1f5830={};_0x1f5830[_0x4197e2[_0xbcd0('0x25')]]={'$like':'%'+_0x1963d5['query'][_0xbcd0('0x37')]+'%'};return _0x1f5830;}})});}_0x2863c4=_['merge']({},_0x2863c4,_0x1963d5['options']);var _0x186717={'where':_0x2863c4[_0xbcd0('0x35')]};return db[_0xbcd0('0x39')]['count'](_0x186717)[_0xbcd0('0x22')](function(_0x210e4a){_0x20899b[_0xbcd0('0x1a')]=_0x210e4a;if(_0x1963d5[_0xbcd0('0x2c')][_0xbcd0('0x3a')]){_0x2863c4[_0xbcd0('0x3b')]=[{'all':!![]}];}return db[_0xbcd0('0x39')][_0xbcd0('0x3c')](_0x2863c4);})['then'](function(_0x62ac3a){_0x20899b['rows']=_0x62ac3a;return _0x20899b;})['then'](respondWithFilteredResult(_0x455e88,_0x2863c4))[_0xbcd0('0x3d')](handleError(_0x455e88,null));};exports[_0xbcd0('0x3e')]=function(_0x4670f9,_0x1313fc){var _0x6d759c={'raw':!![],'where':{'id':_0x4670f9['params']['id']}},_0x544b96={};_0x544b96['model']=_[_0xbcd0('0x2d')](db[_0xbcd0('0x39')][_0xbcd0('0x28')]);_0x544b96['query']=_[_0xbcd0('0x2d')](_0x4670f9[_0xbcd0('0x2c')]);_0x544b96['filters']=_[_0xbcd0('0x2e')](_0x544b96[_0xbcd0('0x2b')],_0x544b96[_0xbcd0('0x2c')]);_0x6d759c[_0xbcd0('0x2f')]=_['intersection'](_0x544b96[_0xbcd0('0x2b')],qs[_0xbcd0('0x30')](_0x4670f9[_0xbcd0('0x2c')][_0xbcd0('0x30')]));_0x6d759c[_0xbcd0('0x2f')]=_0x6d759c[_0xbcd0('0x2f')][_0xbcd0('0x31')]?_0x6d759c[_0xbcd0('0x2f')]:_0x544b96[_0xbcd0('0x2b')];if(_0x4670f9[_0xbcd0('0x2c')]['includeAll']){_0x6d759c[_0xbcd0('0x3b')]=[{'all':!![]}];}_0x6d759c=_[_0xbcd0('0x3f')]({},_0x6d759c,_0x4670f9[_0xbcd0('0x40')]);return db[_0xbcd0('0x39')][_0xbcd0('0x41')](_0x6d759c)['then'](handleEntityNotFound(_0x1313fc,null))[_0xbcd0('0x22')](respondWithResult(_0x1313fc,null))[_0xbcd0('0x3d')](handleError(_0x1313fc,null));};exports[_0xbcd0('0x42')]=function(_0x43228a,_0x496164){return db[_0xbcd0('0x39')][_0xbcd0('0x42')](_0x43228a[_0xbcd0('0x43')],{})['then'](respondWithResult(_0x496164,0xc9))[_0xbcd0('0x3d')](handleError(_0x496164,null));};exports[_0xbcd0('0x21')]=function(_0x3c9503,_0x18d603){if(_0x3c9503[_0xbcd0('0x43')]['id']){delete _0x3c9503[_0xbcd0('0x43')]['id'];}return db[_0xbcd0('0x39')][_0xbcd0('0x41')]({'where':{'id':_0x3c9503[_0xbcd0('0x44')]['id']}})[_0xbcd0('0x22')](handleEntityNotFound(_0x18d603,null))[_0xbcd0('0x22')](saveUpdates(_0x3c9503[_0xbcd0('0x43')],null))[_0xbcd0('0x22')](respondWithResult(_0x18d603,null))[_0xbcd0('0x3d')](handleError(_0x18d603,null));};exports[_0xbcd0('0x45')]=function(_0x56eaa2,_0x1af9a8){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x56eaa2[_0xbcd0('0x44')]['id']}})[_0xbcd0('0x22')](handleEntityNotFound(_0x1af9a8,null))[_0xbcd0('0x22')](removeEntity(_0x1af9a8,null))[_0xbcd0('0x3d')](handleError(_0x1af9a8,null));};exports['describe']=function(_0x376db1,_0x4fc5c4){return db[_0xbcd0('0x39')][_0xbcd0('0x46')]()['then'](respondWithResult(_0x4fc5c4,null))['catch'](handleError(_0x4fc5c4,null));}; \ No newline at end of file +var _0xf0c7=['query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0xf0c7,0x6b));var _0x7f0c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf0c7[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x7f0c('0x0'));var rimraf=require(_0x7f0c('0x1'));var zipdir=require(_0x7f0c('0x2'));var jsonpatch=require(_0x7f0c('0x3'));var rp=require(_0x7f0c('0x4'));var moment=require('moment');var BPromise=require(_0x7f0c('0x5'));var Mustache=require(_0x7f0c('0x6'));var util=require(_0x7f0c('0x7'));var path=require('path');var sox=require(_0x7f0c('0x8'));var csv=require(_0x7f0c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f0c('0xa'));var _=require(_0x7f0c('0xb'));var squel=require(_0x7f0c('0xc'));var crypto=require(_0x7f0c('0xd'));var jsforce=require(_0x7f0c('0xe'));var deskjs=require(_0x7f0c('0xf'));var toCsv=require(_0x7f0c('0x9'));var querystring=require(_0x7f0c('0x10'));var Papa=require(_0x7f0c('0x11'));var Redis=require(_0x7f0c('0x12'));var authService=require(_0x7f0c('0x13'));var qs=require(_0x7f0c('0x14'));var as=require(_0x7f0c('0x15'));var hardwareService=require(_0x7f0c('0x16'));var logger=require(_0x7f0c('0x17'))(_0x7f0c('0x18'));var utils=require(_0x7f0c('0x19'));var config=require(_0x7f0c('0x1a'));var licenseUtil=require(_0x7f0c('0x1b'));var db=require(_0x7f0c('0x1c'))['db'];function respondWithStatusCode(_0x574868,_0x22c27e){_0x22c27e=_0x22c27e||0xcc;return function(_0x392f9e){if(_0x392f9e){return _0x574868[_0x7f0c('0x1d')](_0x22c27e);}return _0x574868['status'](_0x22c27e)[_0x7f0c('0x1e')]();};}function respondWithResult(_0x34f8fb,_0x4492a6){_0x4492a6=_0x4492a6||0xc8;return function(_0x1bb806){if(_0x1bb806){return _0x34f8fb[_0x7f0c('0x1f')](_0x4492a6)[_0x7f0c('0x20')](_0x1bb806);}};}function respondWithFilteredResult(_0x432c7e,_0x33f0d6){return function(_0x30d2c2){if(_0x30d2c2){var _0x447272=typeof _0x33f0d6[_0x7f0c('0x21')]==='undefined'&&typeof _0x33f0d6['limit']===_0x7f0c('0x22');var _0x1ca46a=_0x30d2c2[_0x7f0c('0x23')];var _0x4394c8=_0x447272?0x0:_0x33f0d6['offset'];var _0x1c3479=_0x447272?_0x30d2c2[_0x7f0c('0x23')]:_0x33f0d6[_0x7f0c('0x21')]+_0x33f0d6['limit'];var _0x58954d;if(_0x1c3479>=_0x1ca46a){_0x1c3479=_0x1ca46a;_0x58954d=0xc8;}else{_0x58954d=0xce;}_0x432c7e[_0x7f0c('0x1f')](_0x58954d);return _0x432c7e['set'](_0x7f0c('0x24'),_0x4394c8+'-'+_0x1c3479+'/'+_0x1ca46a)['json'](_0x30d2c2);}return null;};}function patchUpdates(_0x56d7c5){return function(_0x3004bb){try{jsonpatch[_0x7f0c('0x25')](_0x3004bb,_0x56d7c5,!![]);}catch(_0x2fa77e){return BPromise['reject'](_0x2fa77e);}return _0x3004bb[_0x7f0c('0x26')]();};}function saveUpdates(_0x4bec7c,_0x46a9c5){return function(_0xddf8e4){if(_0xddf8e4){return _0xddf8e4[_0x7f0c('0x27')](_0x4bec7c)[_0x7f0c('0x28')](function(_0x53ac88){return _0x53ac88;});}return null;};}function removeEntity(_0x5ee101,_0xc0164d){return function(_0x1fe785){if(_0x1fe785){return _0x1fe785[_0x7f0c('0x29')]()[_0x7f0c('0x28')](function(){_0x5ee101[_0x7f0c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39f125,_0x2ce3bc){return function(_0x19d294){if(!_0x19d294){_0x39f125['sendStatus'](0x194);}return _0x19d294;};}function handleError(_0x263508,_0x539332){_0x539332=_0x539332||0x1f4;return function(_0x5883a8){logger[_0x7f0c('0x2a')](_0x5883a8[_0x7f0c('0x2b')]);if(_0x5883a8[_0x7f0c('0x2c')]){delete _0x5883a8[_0x7f0c('0x2c')];}_0x263508[_0x7f0c('0x1f')](_0x539332)[_0x7f0c('0x2d')](_0x5883a8);};}exports[_0x7f0c('0x2e')]=function(_0x5d7e84,_0x2a04ad){var _0x450440={},_0x5e18ae={},_0x50eab8={'count':0x0,'rows':[]};var _0x55eec9=_[_0x7f0c('0x2f')](db[_0x7f0c('0x30')][_0x7f0c('0x31')],function(_0x23c00a){return{'name':_0x23c00a[_0x7f0c('0x32')],'type':_0x23c00a[_0x7f0c('0x33')][_0x7f0c('0x34')]};});_0x5e18ae['model']=_['map'](_0x55eec9,_0x7f0c('0x2c'));_0x5e18ae['query']=_['keys'](_0x5d7e84[_0x7f0c('0x35')]);_0x5e18ae['filters']=_[_0x7f0c('0x36')](_0x5e18ae[_0x7f0c('0x37')],_0x5e18ae[_0x7f0c('0x35')]);_0x450440[_0x7f0c('0x38')]=_[_0x7f0c('0x36')](_0x5e18ae['model'],qs[_0x7f0c('0x39')](_0x5d7e84['query'][_0x7f0c('0x39')]));_0x450440[_0x7f0c('0x38')]=_0x450440[_0x7f0c('0x38')][_0x7f0c('0x3a')]?_0x450440[_0x7f0c('0x38')]:_0x5e18ae['model'];if(!_0x5d7e84[_0x7f0c('0x35')][_0x7f0c('0x3b')](_0x7f0c('0x3c'))){_0x450440['limit']=qs[_0x7f0c('0x3d')](_0x5d7e84[_0x7f0c('0x35')][_0x7f0c('0x3d')]);_0x450440[_0x7f0c('0x21')]=qs[_0x7f0c('0x21')](_0x5d7e84[_0x7f0c('0x35')][_0x7f0c('0x21')]);}_0x450440['order']=qs[_0x7f0c('0x3e')](_0x5d7e84['query'][_0x7f0c('0x3e')]);_0x450440[_0x7f0c('0x3f')]=qs[_0x7f0c('0x40')](_[_0x7f0c('0x41')](_0x5d7e84[_0x7f0c('0x35')],_0x5e18ae[_0x7f0c('0x40')]),_0x55eec9);if(_0x5d7e84['query'][_0x7f0c('0x42')]){_0x450440['where']=_['merge'](_0x450440['where'],{'$or':_[_0x7f0c('0x2f')](_0x55eec9,function(_0x34a066){if(_0x34a066[_0x7f0c('0x33')]!==_0x7f0c('0x43')){var _0x192fb9={};_0x192fb9[_0x34a066['name']]={'$like':'%'+_0x5d7e84['query']['filter']+'%'};return _0x192fb9;}})});}_0x450440=_[_0x7f0c('0x44')]({},_0x450440,_0x5d7e84[_0x7f0c('0x45')]);var _0x20a3cd={'where':_0x450440[_0x7f0c('0x3f')]};return db[_0x7f0c('0x30')][_0x7f0c('0x23')](_0x20a3cd)[_0x7f0c('0x28')](function(_0x2b6759){_0x50eab8[_0x7f0c('0x23')]=_0x2b6759;if(_0x5d7e84[_0x7f0c('0x35')][_0x7f0c('0x46')]){_0x450440['include']=[{'all':!![]}];}return db[_0x7f0c('0x30')][_0x7f0c('0x47')](_0x450440);})['then'](function(_0x3d6767){_0x50eab8['rows']=_0x3d6767;return _0x50eab8;})[_0x7f0c('0x28')](respondWithFilteredResult(_0x2a04ad,_0x450440))['catch'](handleError(_0x2a04ad,null));};exports[_0x7f0c('0x48')]=function(_0x11f482,_0x27e038){var _0x3595a1={'raw':!![],'where':{'id':_0x11f482[_0x7f0c('0x49')]['id']}},_0x525b29={};_0x525b29[_0x7f0c('0x37')]=_['keys'](db['OpenchannelTransferReport'][_0x7f0c('0x31')]);_0x525b29[_0x7f0c('0x35')]=_[_0x7f0c('0x4a')](_0x11f482[_0x7f0c('0x35')]);_0x525b29['filters']=_[_0x7f0c('0x36')](_0x525b29[_0x7f0c('0x37')],_0x525b29['query']);_0x3595a1[_0x7f0c('0x38')]=_[_0x7f0c('0x36')](_0x525b29['model'],qs[_0x7f0c('0x39')](_0x11f482[_0x7f0c('0x35')][_0x7f0c('0x39')]));_0x3595a1[_0x7f0c('0x38')]=_0x3595a1[_0x7f0c('0x38')][_0x7f0c('0x3a')]?_0x3595a1['attributes']:_0x525b29[_0x7f0c('0x37')];if(_0x11f482[_0x7f0c('0x35')][_0x7f0c('0x46')]){_0x3595a1['include']=[{'all':!![]}];}_0x3595a1=_[_0x7f0c('0x44')]({},_0x3595a1,_0x11f482[_0x7f0c('0x45')]);return db[_0x7f0c('0x30')][_0x7f0c('0x4b')](_0x3595a1)['then'](handleEntityNotFound(_0x27e038,null))[_0x7f0c('0x28')](respondWithResult(_0x27e038,null))[_0x7f0c('0x4c')](handleError(_0x27e038,null));};exports[_0x7f0c('0x4d')]=function(_0x5481d1,_0x75a32b){return db[_0x7f0c('0x30')][_0x7f0c('0x4d')](_0x5481d1[_0x7f0c('0x4e')],{})['then'](respondWithResult(_0x75a32b,0xc9))[_0x7f0c('0x4c')](handleError(_0x75a32b,null));};exports[_0x7f0c('0x27')]=function(_0x3dad77,_0x235d07){if(_0x3dad77[_0x7f0c('0x4e')]['id']){delete _0x3dad77['body']['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x3dad77['params']['id']}})['then'](handleEntityNotFound(_0x235d07,null))[_0x7f0c('0x28')](saveUpdates(_0x3dad77[_0x7f0c('0x4e')],null))[_0x7f0c('0x28')](respondWithResult(_0x235d07,null))[_0x7f0c('0x4c')](handleError(_0x235d07,null));};exports[_0x7f0c('0x29')]=function(_0x2afc16,_0x201dc7){return db[_0x7f0c('0x30')][_0x7f0c('0x4b')]({'where':{'id':_0x2afc16[_0x7f0c('0x49')]['id']}})[_0x7f0c('0x28')](handleEntityNotFound(_0x201dc7,null))[_0x7f0c('0x28')](removeEntity(_0x201dc7,null))[_0x7f0c('0x4c')](handleError(_0x201dc7,null));};exports['describe']=function(_0x21ecfb,_0xe06e48){return db[_0x7f0c('0x30')][_0x7f0c('0x4f')]()['then'](respondWithResult(_0xe06e48,null))[_0x7f0c('0x4c')](handleError(_0xe06e48,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 6e42990..011ce69 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.model.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d32=['util','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash'];(function(_0x22377a,_0x3397cb){var _0x36f105=function(_0x2174cc){while(--_0x2174cc){_0x22377a['push'](_0x22377a['shift']());}};_0x36f105(++_0x3397cb);}(_0x6d32,0xdc));var _0x26d3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6d32[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x26d3('0x0'));var util=require(_0x26d3('0x1'));var logger=require('../../config/logger')(_0x26d3('0x2'));var moment=require(_0x26d3('0x3'));var BPromise=require(_0x26d3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x26d3('0x5'));var rimraf=require(_0x26d3('0x6'));var config=require(_0x26d3('0x7'));var attributes=require(_0x26d3('0x8'));module['exports']=function(_0x53198a,_0x101aec){return _0x53198a[_0x26d3('0x9')](_0x26d3('0xa'),attributes,{'tableName':_0x26d3('0xb'),'paranoid':![],'indexes':[{'name':_0x26d3('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9bbd=['report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelTransferReport.attributes','define'];(function(_0x48d45c,_0x31de4c){var _0x3e4185=function(_0x4de002){while(--_0x4de002){_0x48d45c['push'](_0x48d45c['shift']());}};_0x3e4185(++_0x31de4c);}(_0x9bbd,0x13a));var _0xd9bb=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9bbd[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xd9bb('0x0'));var util=require(_0xd9bb('0x1'));var logger=require(_0xd9bb('0x2'))(_0xd9bb('0x3'));var moment=require(_0xd9bb('0x4'));var BPromise=require(_0xd9bb('0x5'));var rp=require(_0xd9bb('0x6'));var fs=require('fs');var path=require(_0xd9bb('0x7'));var rimraf=require(_0xd9bb('0x8'));var config=require('../../config/environment');var attributes=require(_0xd9bb('0x9'));module['exports']=function(_0x4476ea,_0x451550){return _0x4476ea[_0xd9bb('0xa')]('OpenchannelTransferReport',attributes,{'tableName':_0xd9bb('0xb'),'paranoid':![],'indexes':[{'name':_0xd9bb('0xc'),'fields':[_0xd9bb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 8080c42..843ef08 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0734=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3f6f3c,_0xda03ca){var _0x3c5c4=function(_0x2d867c){while(--_0x2d867c){_0x3f6f3c['push'](_0x3f6f3c['shift']());}};_0x3c5c4(++_0xda03ca);}(_0x0734,0xba));var _0x4073=function(_0x2906c2,_0x2eb2d9){_0x2906c2=_0x2906c2-0x0;var _0x1bb1aa=_0x0734[_0x2906c2];return _0x1bb1aa;};'use strict';var _=require(_0x4073('0x0'));var util=require(_0x4073('0x1'));var moment=require(_0x4073('0x2'));var BPromise=require(_0x4073('0x3'));var rs=require(_0x4073('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4073('0x5'))['db'];var utils=require(_0x4073('0x6'));var logger=require(_0x4073('0x7'))(_0x4073('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4073('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c3c14,_0x2195e0,_0x1251bd){return new BPromise(function(_0x22a33d,_0x51515d){return client[_0x4073('0xa')](_0x2c3c14,_0x1251bd)['then'](function(_0x5432c4){logger[_0x4073('0xb')](_0x4073('0xc'),_0x2195e0,_0x4073('0xd'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2195e0,_0x4073('0xd'),JSON[_0x4073('0xe')](_0x5432c4));if(_0x5432c4['error']){if(_0x5432c4[_0x4073('0xf')]['code']===0x1f4){logger[_0x4073('0xf')](_0x4073('0xc'),_0x2195e0,_0x5432c4[_0x4073('0xf')][_0x4073('0x10')]);return _0x51515d(_0x5432c4['error'][_0x4073('0x10')]);}logger[_0x4073('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2195e0,_0x5432c4[_0x4073('0xf')][_0x4073('0x10')]);return _0x22a33d(_0x5432c4[_0x4073('0xf')][_0x4073('0x10')]);}else{logger[_0x4073('0xb')](_0x4073('0xc'),_0x2195e0,'request\x20sent');_0x22a33d(_0x5432c4[_0x4073('0x11')]['message']);}})[_0x4073('0x12')](function(_0x38ea09){logger['error'](_0x4073('0xc'),_0x2195e0,_0x38ea09);_0x51515d(_0x38ea09);});});} \ No newline at end of file +var _0x68f5=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x445101,_0x2414bf){var _0x3c3d04=function(_0x249067){while(--_0x249067){_0x445101['push'](_0x445101['shift']());}};_0x3c3d04(++_0x2414bf);}(_0x68f5,0x11a));var _0x568f=function(_0x19ddd9,_0x4351de){_0x19ddd9=_0x19ddd9-0x0;var _0x13ab97=_0x68f5[_0x19ddd9];return _0x13ab97;};'use strict';var _=require(_0x568f('0x0'));var util=require(_0x568f('0x1'));var moment=require(_0x568f('0x2'));var BPromise=require('bluebird');var rs=require(_0x568f('0x3'));var fs=require('fs');var Redis=require(_0x568f('0x4'));var db=require(_0x568f('0x5'))['db'];var utils=require(_0x568f('0x6'));var logger=require(_0x568f('0x7'))('rpc');var config=require(_0x568f('0x8'));var jayson=require(_0x568f('0x9'));var client=jayson[_0x568f('0xa')][_0x568f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ca62c,_0x541fd2,_0x953f02){return new BPromise(function(_0x3568a0,_0x2492fc){return client['request'](_0x4ca62c,_0x953f02)[_0x568f('0xc')](function(_0x48fe85){logger[_0x568f('0xd')](_0x568f('0xe'),_0x541fd2,'request\x20sent');logger[_0x568f('0xf')](_0x568f('0x10'),_0x541fd2,_0x568f('0x11'),JSON[_0x568f('0x12')](_0x48fe85));if(_0x48fe85[_0x568f('0x13')]){if(_0x48fe85[_0x568f('0x13')][_0x568f('0x14')]===0x1f4){logger[_0x568f('0x13')](_0x568f('0xe'),_0x541fd2,_0x48fe85['error'][_0x568f('0x15')]);return _0x2492fc(_0x48fe85[_0x568f('0x13')][_0x568f('0x15')]);}logger[_0x568f('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x541fd2,_0x48fe85[_0x568f('0x13')]['message']);return _0x3568a0(_0x48fe85['error'][_0x568f('0x15')]);}else{logger[_0x568f('0xd')](_0x568f('0xe'),_0x541fd2,_0x568f('0x11'));_0x3568a0(_0x48fe85[_0x568f('0x16')][_0x568f('0x15')]);}})[_0x568f('0x17')](function(_0x1060cb){logger[_0x568f('0x13')](_0x568f('0xe'),_0x541fd2,_0x1060cb);_0x2492fc(_0x1060cb);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index f352ec3..1535bed 100644 --- a/server/api/pause/index.js +++ b/server/api/pause/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c72=['isAuthenticated','update','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','index','/:id','show','post'];(function(_0x5d0724,_0x582a4c){var _0x172ef7=function(_0x2fa7a8){while(--_0x2fa7a8){_0x5d0724['push'](_0x5d0724['shift']());}};_0x172ef7(++_0x582a4c);}(_0x4c72,0x179));var _0x24c7=function(_0x137fd9,_0x1d793a){_0x137fd9=_0x137fd9-0x0;var _0x30fa13=_0x4c72[_0x137fd9];return _0x30fa13;};'use strict';var multer=require(_0x24c7('0x0'));var util=require(_0x24c7('0x1'));var path=require(_0x24c7('0x2'));var timeout=require(_0x24c7('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x24c7('0x4'));var auth=require(_0x24c7('0x5'));var interaction=require(_0x24c7('0x6'));var config=require(_0x24c7('0x7'));var controller=require(_0x24c7('0x8'));router[_0x24c7('0x9')]('/',auth['isAuthenticated'](),controller[_0x24c7('0xa')]);router['get'](_0x24c7('0xb'),auth['isAuthenticated'](),controller[_0x24c7('0xc')]);router[_0x24c7('0xd')]('/',auth[_0x24c7('0xe')](),controller['create']);router['put'](_0x24c7('0xb'),auth[_0x24c7('0xe')](),controller[_0x24c7('0xf')]);router['delete'](_0x24c7('0xb'),auth[_0x24c7('0xe')](),controller[_0x24c7('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6345=['../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5794af,_0xd27f04){var _0x5ae2d0=function(_0x482e17){while(--_0x482e17){_0x5794af['push'](_0x5794af['shift']());}};_0x5ae2d0(++_0xd27f04);}(_0x6345,0xa4));var _0x5634=function(_0x1018b2,_0x3dd5e4){_0x1018b2=_0x1018b2-0x0;var _0x45bbad=_0x6345[_0x1018b2];return _0x45bbad;};'use strict';var multer=require(_0x5634('0x0'));var util=require('util');var path=require(_0x5634('0x1'));var timeout=require('connect-timeout');var express=require(_0x5634('0x2'));var router=express[_0x5634('0x3')]();var fs_extra=require(_0x5634('0x4'));var auth=require(_0x5634('0x5'));var interaction=require(_0x5634('0x6'));var config=require(_0x5634('0x7'));var controller=require(_0x5634('0x8'));router[_0x5634('0x9')]('/',auth[_0x5634('0xa')](),controller[_0x5634('0xb')]);router['get'](_0x5634('0xc'),auth[_0x5634('0xa')](),controller[_0x5634('0xd')]);router['post']('/',auth[_0x5634('0xa')](),controller[_0x5634('0xe')]);router['put'](_0x5634('0xc'),auth[_0x5634('0xa')](),controller[_0x5634('0xf')]);router[_0x5634('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5634('0x11')]);module[_0x5634('0x12')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index f7447ee..bd5cde8 100644 --- a/server/api/pause/pause.attributes.js +++ b/server/api/pause/pause.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91ed=['STRING','name','sequelize'];(function(_0x197ffa,_0x5548f2){var _0x12b819=function(_0x3e7b60){while(--_0x3e7b60){_0x197ffa['push'](_0x197ffa['shift']());}};_0x12b819(++_0x5548f2);}(_0x91ed,0x1a6));var _0xd91e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x91ed[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0xd91e('0x0'));module['exports']={'name':{'type':Sequelize[_0xd91e('0x1')],'unique':_0xd91e('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xd91e('0x1')]}}; \ No newline at end of file +var _0xadd3=['sequelize','exports','STRING','name'];(function(_0x574dea,_0x4cf209){var _0x3ed444=function(_0x3423a2){while(--_0x3423a2){_0x574dea['push'](_0x574dea['shift']());}};_0x3ed444(++_0x4cf209);}(_0xadd3,0xa8));var _0x3add=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xadd3[_0x346737];return _0x1ade2e;};'use strict';var Sequelize=require(_0x3add('0x0'));module[_0x3add('0x1')]={'name':{'type':Sequelize[_0x3add('0x2')],'unique':_0x3add('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3add('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index c037887..f4a9034 100644 --- a/server/api/pause/pause.controller.js +++ b/server/api/pause/pause.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2be6=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','update','then','destroy','get','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Pauses','UserProfileSection','UserProfileResource','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2be6,0x93));var _0x62be=function(_0x326675,_0x13448f){_0x326675=_0x326675-0x0;var _0x1d1248=_0x2be6[_0x326675];return _0x1d1248;};'use strict';var emlformat=require(_0x62be('0x0'));var rimraf=require(_0x62be('0x1'));var zipdir=require(_0x62be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x62be('0x3'));var BPromise=require(_0x62be('0x4'));var Mustache=require(_0x62be('0x5'));var util=require(_0x62be('0x6'));var path=require(_0x62be('0x7'));var sox=require(_0x62be('0x8'));var csv=require(_0x62be('0x9'));var ejs=require(_0x62be('0xa'));var fs=require('fs');var fs_extra=require(_0x62be('0xb'));var _=require('lodash');var squel=require(_0x62be('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x62be('0xd'));var toCsv=require(_0x62be('0x9'));var querystring=require(_0x62be('0xe'));var Papa=require(_0x62be('0xf'));var Redis=require(_0x62be('0x10'));var authService=require(_0x62be('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x62be('0x12'));var hardwareService=require(_0x62be('0x13'));var logger=require(_0x62be('0x14'))(_0x62be('0x15'));var utils=require(_0x62be('0x16'));var config=require(_0x62be('0x17'));var licenseUtil=require(_0x62be('0x18'));var db=require(_0x62be('0x19'))['db'];function respondWithStatusCode(_0x17b015,_0x9468d0){_0x9468d0=_0x9468d0||0xcc;return function(_0x314fb3){if(_0x314fb3){return _0x17b015[_0x62be('0x1a')](_0x9468d0);}return _0x17b015[_0x62be('0x1b')](_0x9468d0)[_0x62be('0x1c')]();};}function respondWithResult(_0x8942b8,_0x363197){_0x363197=_0x363197||0xc8;return function(_0x38d6ee){if(_0x38d6ee){return _0x8942b8[_0x62be('0x1b')](_0x363197)['json'](_0x38d6ee);}};}function respondWithFilteredResult(_0x23adc0,_0x273f89){return function(_0x253aef){if(_0x253aef){var _0x3e2cd5=typeof _0x273f89['offset']===_0x62be('0x1d')&&typeof _0x273f89[_0x62be('0x1e')]===_0x62be('0x1d');var _0x12d943=_0x253aef[_0x62be('0x1f')];var _0xe44a58=_0x3e2cd5?0x0:_0x273f89[_0x62be('0x20')];var _0x1da723=_0x3e2cd5?_0x253aef[_0x62be('0x1f')]:_0x273f89[_0x62be('0x20')]+_0x273f89[_0x62be('0x1e')];var _0x236b6c;if(_0x1da723>=_0x12d943){_0x1da723=_0x12d943;_0x236b6c=0xc8;}else{_0x236b6c=0xce;}_0x23adc0['status'](_0x236b6c);return _0x23adc0[_0x62be('0x21')](_0x62be('0x22'),_0xe44a58+'-'+_0x1da723+'/'+_0x12d943)[_0x62be('0x23')](_0x253aef);}return null;};}function patchUpdates(_0x17faee){return function(_0x4b0054){try{jsonpatch[_0x62be('0x24')](_0x4b0054,_0x17faee,!![]);}catch(_0xecf4d8){return BPromise['reject'](_0xecf4d8);}return _0x4b0054['save']();};}function saveUpdates(_0xe0f627,_0x36645b){return function(_0x482864){if(_0x482864){return _0x482864[_0x62be('0x25')](_0xe0f627)[_0x62be('0x26')](function(_0x132ef9){return _0x132ef9;});}return null;};}function removeEntity(_0x20288a,_0x384dfa){return function(_0x111175){if(_0x111175){return _0x111175[_0x62be('0x27')]()[_0x62be('0x26')](function(){var _0x2e5bfd=_0x111175[_0x62be('0x28')]({'plain':!![]});var _0x43edd1='Pauses';return db['UserProfileResource'][_0x62be('0x27')]({'where':{'type':_0x43edd1,'resourceId':_0x2e5bfd['id']}})['then'](function(){return _0x111175;});})[_0x62be('0x26')](function(){_0x20288a[_0x62be('0x1b')](0xcc)[_0x62be('0x1c')]();});}};}function handleEntityNotFound(_0x314246,_0x5c0c23){return function(_0x2c5de7){if(!_0x2c5de7){_0x314246[_0x62be('0x1a')](0x194);}return _0x2c5de7;};}function handleError(_0x5523ff,_0x19a5e6){_0x19a5e6=_0x19a5e6||0x1f4;return function(_0x4226d7){logger[_0x62be('0x29')](_0x4226d7[_0x62be('0x2a')]);if(_0x4226d7[_0x62be('0x2b')]){delete _0x4226d7['name'];}_0x5523ff[_0x62be('0x1b')](_0x19a5e6)[_0x62be('0x2c')](_0x4226d7);};}exports[_0x62be('0x2d')]=function(_0x351a5e,_0x40184e){var _0x90b747={},_0x5523c0={},_0xe7c9e7={'count':0x0,'rows':[]};var _0x3e93cf=_[_0x62be('0x2e')](db[_0x62be('0x2f')][_0x62be('0x30')],function(_0x5947b5){return{'name':_0x5947b5[_0x62be('0x31')],'type':_0x5947b5[_0x62be('0x32')][_0x62be('0x33')]};});_0x5523c0[_0x62be('0x34')]=_['map'](_0x3e93cf,'name');_0x5523c0[_0x62be('0x35')]=_[_0x62be('0x36')](_0x351a5e[_0x62be('0x35')]);_0x5523c0[_0x62be('0x37')]=_[_0x62be('0x38')](_0x5523c0[_0x62be('0x34')],_0x5523c0[_0x62be('0x35')]);_0x90b747[_0x62be('0x39')]=_[_0x62be('0x38')](_0x5523c0['model'],qs[_0x62be('0x3a')](_0x351a5e['query'][_0x62be('0x3a')]));_0x90b747[_0x62be('0x39')]=_0x90b747['attributes'][_0x62be('0x3b')]?_0x90b747[_0x62be('0x39')]:_0x5523c0[_0x62be('0x34')];if(!_0x351a5e['query'][_0x62be('0x3c')](_0x62be('0x3d'))){_0x90b747[_0x62be('0x1e')]=qs[_0x62be('0x1e')](_0x351a5e[_0x62be('0x35')][_0x62be('0x1e')]);_0x90b747['offset']=qs[_0x62be('0x20')](_0x351a5e[_0x62be('0x35')]['offset']);}_0x90b747[_0x62be('0x3e')]=qs[_0x62be('0x3f')](_0x351a5e[_0x62be('0x35')][_0x62be('0x3f')]);_0x90b747[_0x62be('0x40')]=qs['filters'](_[_0x62be('0x41')](_0x351a5e[_0x62be('0x35')],_0x5523c0[_0x62be('0x37')]),_0x3e93cf);if(_0x351a5e['query'][_0x62be('0x42')]){_0x90b747[_0x62be('0x40')]=_[_0x62be('0x43')](_0x90b747[_0x62be('0x40')],{'$or':_[_0x62be('0x2e')](_0x3e93cf,function(_0x4677ae){if(_0x4677ae[_0x62be('0x32')]!==_0x62be('0x44')){var _0x2a0e90={};_0x2a0e90[_0x4677ae[_0x62be('0x2b')]]={'$like':'%'+_0x351a5e[_0x62be('0x35')][_0x62be('0x42')]+'%'};return _0x2a0e90;}})});}_0x90b747=_['merge']({},_0x90b747,_0x351a5e[_0x62be('0x45')]);var _0x365d12={'where':_0x90b747[_0x62be('0x40')]};return db[_0x62be('0x2f')][_0x62be('0x1f')](_0x365d12)[_0x62be('0x26')](function(_0x41ac24){_0xe7c9e7[_0x62be('0x1f')]=_0x41ac24;if(_0x351a5e[_0x62be('0x35')][_0x62be('0x46')]){_0x90b747['include']=[{'all':!![]}];}return db[_0x62be('0x2f')][_0x62be('0x47')](_0x90b747);})[_0x62be('0x26')](function(_0x58ddbf){_0xe7c9e7['rows']=_0x58ddbf;return _0xe7c9e7;})[_0x62be('0x26')](respondWithFilteredResult(_0x40184e,_0x90b747))[_0x62be('0x48')](handleError(_0x40184e,null));};exports['show']=function(_0x5c6a9a,_0x418cfc){var _0x4032bd={'raw':!![],'where':{'id':_0x5c6a9a[_0x62be('0x49')]['id']}},_0xa0917e={};_0xa0917e[_0x62be('0x34')]=_[_0x62be('0x36')](db[_0x62be('0x2f')]['rawAttributes']);_0xa0917e[_0x62be('0x35')]=_[_0x62be('0x36')](_0x5c6a9a[_0x62be('0x35')]);_0xa0917e['filters']=_[_0x62be('0x38')](_0xa0917e[_0x62be('0x34')],_0xa0917e[_0x62be('0x35')]);_0x4032bd[_0x62be('0x39')]=_[_0x62be('0x38')](_0xa0917e[_0x62be('0x34')],qs['fields'](_0x5c6a9a[_0x62be('0x35')][_0x62be('0x3a')]));_0x4032bd['attributes']=_0x4032bd[_0x62be('0x39')][_0x62be('0x3b')]?_0x4032bd[_0x62be('0x39')]:_0xa0917e['model'];if(_0x5c6a9a[_0x62be('0x35')][_0x62be('0x46')]){_0x4032bd[_0x62be('0x4a')]=[{'all':!![]}];}_0x4032bd=_['merge']({},_0x4032bd,_0x5c6a9a[_0x62be('0x45')]);return db[_0x62be('0x2f')][_0x62be('0x4b')](_0x4032bd)['then'](handleEntityNotFound(_0x418cfc,null))[_0x62be('0x26')](respondWithResult(_0x418cfc,null))[_0x62be('0x48')](handleError(_0x418cfc,null));};exports[_0x62be('0x4c')]=function(_0x327730,_0x262cdf){return db['Pause'][_0x62be('0x4c')](_0x327730[_0x62be('0x4d')],{})[_0x62be('0x26')](function(_0x5370d0){var _0x131e87=_0x327730[_0x62be('0x4e')][_0x62be('0x28')]({'plain':!![]});if(!_0x131e87)throw new Error(_0x62be('0x4f'));if(_0x131e87['role']===_0x62be('0x4e')){var _0x2bb22e=_0x5370d0[_0x62be('0x28')]({'plain':!![]});var _0x48810a=_0x62be('0x50');return db[_0x62be('0x51')][_0x62be('0x4b')]({'where':{'name':_0x48810a,'userProfileId':_0x131e87['userProfileId']},'raw':!![]})['then'](function(_0x228f49){if(_0x228f49&&_0x228f49['autoAssociation']===0x0){return db[_0x62be('0x52')]['create']({'name':_0x2bb22e[_0x62be('0x2b')],'resourceId':_0x2bb22e['id'],'type':_0x228f49[_0x62be('0x2b')],'sectionId':_0x228f49['id']},{})[_0x62be('0x26')](function(){return _0x5370d0;});}else{return _0x5370d0;}})[_0x62be('0x48')](function(_0x556539){logger[_0x62be('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x556539);throw _0x556539;});}return _0x5370d0;})[_0x62be('0x26')](respondWithResult(_0x262cdf,0xc9))[_0x62be('0x48')](handleError(_0x262cdf,null));};exports[_0x62be('0x25')]=function(_0x582d9a,_0x43ac2e){if(_0x582d9a['body']['id']){delete _0x582d9a[_0x62be('0x4d')]['id'];}return db['Pause']['find']({'where':{'id':_0x582d9a[_0x62be('0x49')]['id']}})['then'](handleEntityNotFound(_0x43ac2e,null))[_0x62be('0x26')](saveUpdates(_0x582d9a[_0x62be('0x4d')],null))[_0x62be('0x26')](respondWithResult(_0x43ac2e,null))['catch'](handleError(_0x43ac2e,null));};exports[_0x62be('0x27')]=function(_0x5b74db,_0x1f7dae){return db[_0x62be('0x2f')][_0x62be('0x4b')]({'where':{'id':_0x5b74db[_0x62be('0x49')]['id']}})[_0x62be('0x26')](handleEntityNotFound(_0x1f7dae,null))[_0x62be('0x26')](removeEntity(_0x1f7dae,null))[_0x62be('0x48')](handleError(_0x1f7dae,null));}; \ No newline at end of file +var _0x63b2=['UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','Pauses','send','index','map','Pause','rawAttributes','fieldName','type','key','name','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','role','user','get','UserProfileSection','userProfileId','autoAssociation'];(function(_0x3de167,_0x1ef0fd){var _0x1ea3d=function(_0x3b3eee){while(--_0x3b3eee){_0x3de167['push'](_0x3de167['shift']());}};_0x1ea3d(++_0x1ef0fd);}(_0x63b2,0x157));var _0x263b=function(_0x4c40e6,_0x5adfe8){_0x4c40e6=_0x4c40e6-0x0;var _0x55528b=_0x63b2[_0x4c40e6];return _0x55528b;};'use strict';var emlformat=require(_0x263b('0x0'));var rimraf=require(_0x263b('0x1'));var zipdir=require(_0x263b('0x2'));var jsonpatch=require(_0x263b('0x3'));var rp=require(_0x263b('0x4'));var moment=require('moment');var BPromise=require(_0x263b('0x5'));var Mustache=require(_0x263b('0x6'));var util=require(_0x263b('0x7'));var path=require('path');var sox=require(_0x263b('0x8'));var csv=require(_0x263b('0x9'));var ejs=require(_0x263b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x263b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x263b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x263b('0xd'));var Papa=require('papaparse');var Redis=require(_0x263b('0xe'));var authService=require(_0x263b('0xf'));var qs=require(_0x263b('0x10'));var as=require(_0x263b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x263b('0x12'))(_0x263b('0x13'));var utils=require(_0x263b('0x14'));var config=require(_0x263b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x263b('0x16'))['db'];function respondWithStatusCode(_0x5a9a8e,_0x3f37c0){_0x3f37c0=_0x3f37c0||0xcc;return function(_0x49f6c5){if(_0x49f6c5){return _0x5a9a8e[_0x263b('0x17')](_0x3f37c0);}return _0x5a9a8e['status'](_0x3f37c0)[_0x263b('0x18')]();};}function respondWithResult(_0x5b6df3,_0x2b1fbd){_0x2b1fbd=_0x2b1fbd||0xc8;return function(_0x1f7f5e){if(_0x1f7f5e){return _0x5b6df3['status'](_0x2b1fbd)[_0x263b('0x19')](_0x1f7f5e);}};}function respondWithFilteredResult(_0x4956b5,_0x5ae208){return function(_0x171793){if(_0x171793){var _0x3afee4=typeof _0x5ae208[_0x263b('0x1a')]===_0x263b('0x1b')&&typeof _0x5ae208[_0x263b('0x1c')]===_0x263b('0x1b');var _0x149d9=_0x171793[_0x263b('0x1d')];var _0x21fc6c=_0x3afee4?0x0:_0x5ae208[_0x263b('0x1a')];var _0xe8d0fe=_0x3afee4?_0x171793[_0x263b('0x1d')]:_0x5ae208[_0x263b('0x1a')]+_0x5ae208['limit'];var _0x16712e;if(_0xe8d0fe>=_0x149d9){_0xe8d0fe=_0x149d9;_0x16712e=0xc8;}else{_0x16712e=0xce;}_0x4956b5[_0x263b('0x1e')](_0x16712e);return _0x4956b5[_0x263b('0x1f')](_0x263b('0x20'),_0x21fc6c+'-'+_0xe8d0fe+'/'+_0x149d9)[_0x263b('0x19')](_0x171793);}return null;};}function patchUpdates(_0x443e27){return function(_0x16f2cc){try{jsonpatch[_0x263b('0x21')](_0x16f2cc,_0x443e27,!![]);}catch(_0x36495c){return BPromise[_0x263b('0x22')](_0x36495c);}return _0x16f2cc[_0x263b('0x23')]();};}function saveUpdates(_0x12518a,_0x5a160e){return function(_0x80a7ff){if(_0x80a7ff){return _0x80a7ff[_0x263b('0x24')](_0x12518a)[_0x263b('0x25')](function(_0x5a4033){return _0x5a4033;});}return null;};}function removeEntity(_0xf9af14,_0x4d2e6f){return function(_0x4d68bf){if(_0x4d68bf){return _0x4d68bf[_0x263b('0x26')]()['then'](function(){var _0x5b461e=_0x4d68bf['get']({'plain':!![]});var _0x3163a2=_0x263b('0x27');return db['UserProfileResource'][_0x263b('0x26')]({'where':{'type':_0x3163a2,'resourceId':_0x5b461e['id']}})[_0x263b('0x25')](function(){return _0x4d68bf;});})['then'](function(){_0xf9af14[_0x263b('0x1e')](0xcc)[_0x263b('0x18')]();});}};}function handleEntityNotFound(_0x587e96,_0x49ebbc){return function(_0x24d33b){if(!_0x24d33b){_0x587e96[_0x263b('0x17')](0x194);}return _0x24d33b;};}function handleError(_0x34bfcb,_0x1defcf){_0x1defcf=_0x1defcf||0x1f4;return function(_0x502d49){logger['error'](_0x502d49['stack']);if(_0x502d49['name']){delete _0x502d49['name'];}_0x34bfcb[_0x263b('0x1e')](_0x1defcf)[_0x263b('0x28')](_0x502d49);};}exports[_0x263b('0x29')]=function(_0x28bd0b,_0x59d6e1){var _0x48e639={},_0x129214={},_0x549dcf={'count':0x0,'rows':[]};var _0xca71b8=_[_0x263b('0x2a')](db[_0x263b('0x2b')][_0x263b('0x2c')],function(_0x3bd7ea){return{'name':_0x3bd7ea[_0x263b('0x2d')],'type':_0x3bd7ea[_0x263b('0x2e')][_0x263b('0x2f')]};});_0x129214['model']=_[_0x263b('0x2a')](_0xca71b8,_0x263b('0x30'));_0x129214[_0x263b('0x31')]=_[_0x263b('0x32')](_0x28bd0b[_0x263b('0x31')]);_0x129214['filters']=_[_0x263b('0x33')](_0x129214[_0x263b('0x34')],_0x129214[_0x263b('0x31')]);_0x48e639['attributes']=_[_0x263b('0x33')](_0x129214['model'],qs[_0x263b('0x35')](_0x28bd0b[_0x263b('0x31')][_0x263b('0x35')]));_0x48e639[_0x263b('0x36')]=_0x48e639[_0x263b('0x36')][_0x263b('0x37')]?_0x48e639['attributes']:_0x129214[_0x263b('0x34')];if(!_0x28bd0b[_0x263b('0x31')][_0x263b('0x38')](_0x263b('0x39'))){_0x48e639[_0x263b('0x1c')]=qs[_0x263b('0x1c')](_0x28bd0b[_0x263b('0x31')][_0x263b('0x1c')]);_0x48e639[_0x263b('0x1a')]=qs[_0x263b('0x1a')](_0x28bd0b[_0x263b('0x31')][_0x263b('0x1a')]);}_0x48e639[_0x263b('0x3a')]=qs[_0x263b('0x3b')](_0x28bd0b['query'][_0x263b('0x3b')]);_0x48e639[_0x263b('0x3c')]=qs['filters'](_[_0x263b('0x3d')](_0x28bd0b[_0x263b('0x31')],_0x129214[_0x263b('0x3e')]),_0xca71b8);if(_0x28bd0b[_0x263b('0x31')][_0x263b('0x3f')]){_0x48e639['where']=_[_0x263b('0x40')](_0x48e639[_0x263b('0x3c')],{'$or':_['map'](_0xca71b8,function(_0x42783b){if(_0x42783b[_0x263b('0x2e')]!==_0x263b('0x41')){var _0x2d71f5={};_0x2d71f5[_0x42783b[_0x263b('0x30')]]={'$like':'%'+_0x28bd0b[_0x263b('0x31')][_0x263b('0x3f')]+'%'};return _0x2d71f5;}})});}_0x48e639=_[_0x263b('0x40')]({},_0x48e639,_0x28bd0b[_0x263b('0x42')]);var _0x3daf31={'where':_0x48e639[_0x263b('0x3c')]};return db['Pause'][_0x263b('0x1d')](_0x3daf31)['then'](function(_0x12e8e8){_0x549dcf['count']=_0x12e8e8;if(_0x28bd0b[_0x263b('0x31')]['includeAll']){_0x48e639[_0x263b('0x43')]=[{'all':!![]}];}return db[_0x263b('0x2b')][_0x263b('0x44')](_0x48e639);})[_0x263b('0x25')](function(_0x30027e){_0x549dcf['rows']=_0x30027e;return _0x549dcf;})[_0x263b('0x25')](respondWithFilteredResult(_0x59d6e1,_0x48e639))[_0x263b('0x45')](handleError(_0x59d6e1,null));};exports[_0x263b('0x46')]=function(_0x341eeb,_0x2c9a95){var _0x42e475={'raw':!![],'where':{'id':_0x341eeb[_0x263b('0x47')]['id']}},_0x4c84ee={};_0x4c84ee[_0x263b('0x34')]=_[_0x263b('0x32')](db[_0x263b('0x2b')][_0x263b('0x2c')]);_0x4c84ee[_0x263b('0x31')]=_['keys'](_0x341eeb[_0x263b('0x31')]);_0x4c84ee[_0x263b('0x3e')]=_['intersection'](_0x4c84ee[_0x263b('0x34')],_0x4c84ee[_0x263b('0x31')]);_0x42e475[_0x263b('0x36')]=_[_0x263b('0x33')](_0x4c84ee[_0x263b('0x34')],qs[_0x263b('0x35')](_0x341eeb[_0x263b('0x31')][_0x263b('0x35')]));_0x42e475[_0x263b('0x36')]=_0x42e475['attributes'][_0x263b('0x37')]?_0x42e475[_0x263b('0x36')]:_0x4c84ee[_0x263b('0x34')];if(_0x341eeb[_0x263b('0x31')][_0x263b('0x48')]){_0x42e475[_0x263b('0x43')]=[{'all':!![]}];}_0x42e475=_[_0x263b('0x40')]({},_0x42e475,_0x341eeb[_0x263b('0x42')]);return db[_0x263b('0x2b')][_0x263b('0x49')](_0x42e475)[_0x263b('0x25')](handleEntityNotFound(_0x2c9a95,null))['then'](respondWithResult(_0x2c9a95,null))['catch'](handleError(_0x2c9a95,null));};exports[_0x263b('0x4a')]=function(_0x581429,_0x3120c6){return db[_0x263b('0x2b')][_0x263b('0x4a')](_0x581429[_0x263b('0x4b')],{})[_0x263b('0x25')](function(_0x3597c1){var _0x1bf3a=_0x581429['user']['get']({'plain':!![]});if(!_0x1bf3a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bf3a[_0x263b('0x4c')]===_0x263b('0x4d')){var _0xfe13df=_0x3597c1[_0x263b('0x4e')]({'plain':!![]});var _0x5c7ed0=_0x263b('0x27');return db[_0x263b('0x4f')][_0x263b('0x49')]({'where':{'name':_0x5c7ed0,'userProfileId':_0x1bf3a[_0x263b('0x50')]},'raw':!![]})[_0x263b('0x25')](function(_0x32d7e5){if(_0x32d7e5&&_0x32d7e5[_0x263b('0x51')]===0x0){return db[_0x263b('0x52')][_0x263b('0x4a')]({'name':_0xfe13df['name'],'resourceId':_0xfe13df['id'],'type':_0x32d7e5[_0x263b('0x30')],'sectionId':_0x32d7e5['id']},{})['then'](function(){return _0x3597c1;});}else{return _0x3597c1;}})[_0x263b('0x45')](function(_0x5094d3){logger[_0x263b('0x53')](_0x263b('0x54'),_0x5094d3);throw _0x5094d3;});}return _0x3597c1;})[_0x263b('0x25')](respondWithResult(_0x3120c6,0xc9))[_0x263b('0x45')](handleError(_0x3120c6,null));};exports['update']=function(_0x24efd7,_0x30dd52){if(_0x24efd7['body']['id']){delete _0x24efd7[_0x263b('0x4b')]['id'];}return db[_0x263b('0x2b')][_0x263b('0x49')]({'where':{'id':_0x24efd7['params']['id']}})[_0x263b('0x25')](handleEntityNotFound(_0x30dd52,null))[_0x263b('0x25')](saveUpdates(_0x24efd7[_0x263b('0x4b')],null))[_0x263b('0x25')](respondWithResult(_0x30dd52,null))[_0x263b('0x45')](handleError(_0x30dd52,null));};exports['destroy']=function(_0x47add8,_0x22c99d){return db[_0x263b('0x2b')][_0x263b('0x49')]({'where':{'id':_0x47add8[_0x263b('0x47')]['id']}})[_0x263b('0x25')](handleEntityNotFound(_0x22c99d,null))['then'](removeEntity(_0x22c99d,null))[_0x263b('0x45')](handleError(_0x22c99d,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 581383b..91af928 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x929116,_0x4966ed){var _0x256d27=function(_0x24a2eb){while(--_0x24a2eb){_0x929116['push'](_0x929116['shift']());}};_0x256d27(++_0x4966ed);}(_0xe14b,0x93));var _0xbe14=function(_0x2ce94c,_0x4c3509){_0x2ce94c=_0x2ce94c-0x0;var _0x18ad94=_0xe14b[_0x2ce94c];return _0x18ad94;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xc4aa[_0x11005e];return _0x29338f;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index f2aa8c3..0ddfe42 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x520845,_0x1a79e9){var _0x4bd2e1=function(_0x1aebe7){while(--_0x1aebe7){_0x520845['push'](_0x520845['shift']());}};_0x4bd2e1(++_0x1a79e9);}(_0xb10b,0x12a));var _0xbb10=function(_0x25ccbe,_0xc935c0){_0x25ccbe=_0x25ccbe-0x0;var _0x289529=_0xb10b[_0x25ccbe];return _0x289529;};'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(_0x1d015f,_0xfab938){var _0x1e34e4=function(_0x531da7){while(--_0x531da7){_0x1d015f['push'](_0x1d015f['shift']());}};_0x1e34e4(++_0xfab938);}(_0xb10b,0x12a));var _0xbb10=function(_0x5f4ec0,_0x1092e7){_0x5f4ec0=_0x5f4ec0-0x0;var _0xa57cc6=_0xb10b[_0x5f4ec0];return _0xa57cc6;};'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 diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 97bef6b..e2718ff 100644 --- a/server/api/plugin/index.js +++ b/server/api/plugin/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3937=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','show','/:id/download','download','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','now','single','upload','post','webhookPost','update','delete','/:id','exports','multer'];(function(_0x437d83,_0x300f7b){var _0x345fb3=function(_0x1cacfc){while(--_0x1cacfc){_0x437d83['push'](_0x437d83['shift']());}};_0x345fb3(++_0x300f7b);}(_0x3937,0xbf));var _0x7393=function(_0x5915a3,_0x3d2e12){_0x5915a3=_0x5915a3-0x0;var _0x46e89b=_0x3937[_0x5915a3];return _0x46e89b;};'use strict';var multer=require(_0x7393('0x0'));var util=require('util');var path=require(_0x7393('0x1'));var timeout=require(_0x7393('0x2'));var express=require('express');var router=express[_0x7393('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7393('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7393('0x5'));var controller=require(_0x7393('0x6'));router[_0x7393('0x7')]('/',auth[_0x7393('0x8')](),controller[_0x7393('0x9')]);router[_0x7393('0x7')](_0x7393('0xa'),controller[_0x7393('0xb')]);router[_0x7393('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x7393('0xc')]);router[_0x7393('0x7')](_0x7393('0xd'),auth['isAuthenticated'](),controller[_0x7393('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x56ed4c,_0x47c5c6,_0x497b6b){_0x497b6b(null,path[_0x7393('0xf')](config[_0x7393('0x10')],_0x7393('0x11')));},'filename':function(_0x4fb764,_0x79fc4e,_0x470f09){_0x79fc4e[_0x7393('0x12')]=_0x79fc4e[_0x7393('0x12')][_0x7393('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x470f09(null,util[_0x7393('0x14')](_0x7393('0x15'),path[_0x7393('0x16')](_0x79fc4e[_0x7393('0x12')],path['extname'](_0x79fc4e['originalname'])),Date[_0x7393('0x17')](),path['extname'](_0x79fc4e['originalname'])));}})});router['post']('/',upload[_0x7393('0x18')]('file'),controller[_0x7393('0x19')]);router[_0x7393('0x1a')]('/webhook',controller[_0x7393('0x1b')]);router['put']('/:id',auth[_0x7393('0x8')](),controller[_0x7393('0x1c')]);router[_0x7393('0x1d')](_0x7393('0x1e'),auth[_0x7393('0x8')](),controller[_0x7393('0x1d')]);module[_0x7393('0x1f')]=router; \ No newline at end of file +var _0x579c=['../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','webhookGet','/:id','show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','replace','%s-%s%s','extname','file','upload','post','/webhook','webhookPost','put','update','delete','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x20777b,_0x5f30df){var _0x43a237=function(_0x15d149){while(--_0x15d149){_0x20777b['push'](_0x20777b['shift']());}};_0x43a237(++_0x5f30df);}(_0x579c,0xda));var _0xc579=function(_0x1debb4,_0x5d05d4){_0x1debb4=_0x1debb4-0x0;var _0x419b76=_0x579c[_0x1debb4];return _0x419b76;};'use strict';var multer=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var path=require(_0xc579('0x2'));var timeout=require(_0xc579('0x3'));var express=require(_0xc579('0x4'));var router=express['Router']();var fs_extra=require(_0xc579('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc579('0x6'));var config=require(_0xc579('0x7'));var controller=require(_0xc579('0x8'));router[_0xc579('0x9')]('/',auth[_0xc579('0xa')](),controller[_0xc579('0xb')]);router[_0xc579('0x9')]('/webhook',controller[_0xc579('0xc')]);router[_0xc579('0x9')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0xe')]);router[_0xc579('0x9')](_0xc579('0xf'),auth[_0xc579('0xa')](),controller['download']);var upload=multer({'storage':multer[_0xc579('0x10')]({'destination':function(_0x2048bc,_0x17e37f,_0x3684b7){_0x3684b7(null,path[_0xc579('0x11')](config[_0xc579('0x12')],_0xc579('0x13')));},'filename':function(_0x1905b7,_0x421812,_0x441028){_0x421812[_0xc579('0x14')]=_0x421812['originalname'][_0xc579('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x441028(null,util['format'](_0xc579('0x16'),path['basename'](_0x421812[_0xc579('0x14')],path['extname'](_0x421812[_0xc579('0x14')])),Date['now'](),path[_0xc579('0x17')](_0x421812[_0xc579('0x14')])));}})});router['post']('/',upload['single'](_0xc579('0x18')),controller[_0xc579('0x19')]);router[_0xc579('0x1a')](_0xc579('0x1b'),controller[_0xc579('0x1c')]);router[_0xc579('0x1d')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0x1e')]);router[_0xc579('0x1f')]('/:id',auth[_0xc579('0xa')](),controller[_0xc579('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index cce5c0c..e09c167 100644 --- a/server/api/plugin/plugin.attributes.js +++ b/server/api/plugin/plugin.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f79=['always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','never'];(function(_0x2ea8f2,_0x14aab7){var _0x398b05=function(_0x4b2d6f){while(--_0x4b2d6f){_0x2ea8f2['push'](_0x2ea8f2['shift']());}};_0x398b05(++_0x14aab7);}(_0x5f79,0x146));var _0x95f7=function(_0x516927,_0xb4aad0){_0x516927=_0x516927-0x0;var _0x30749b=_0x5f79[_0x516927];return _0x30749b;};'use strict';var Sequelize=require(_0x95f7('0x0'));module['exports']={'name':{'type':Sequelize[_0x95f7('0x1')]},'type':{'type':Sequelize[_0x95f7('0x2')](_0x95f7('0x3'),_0x95f7('0x4'))},'description':{'type':Sequelize[_0x95f7('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0x95f7('0x6')},'active':{'type':Sequelize[_0x95f7('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x95f7('0x2')](_0x95f7('0x8'),'agentOnly','always',_0x95f7('0x9')),'defaultValue':_0x95f7('0xa'),'comment':_0x95f7('0xb')},'icon':{'type':Sequelize[_0x95f7('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x95f7('0x1')]},'scriptPath':{'type':Sequelize[_0x95f7('0x1')]}}; \ No newline at end of file +var _0x9663=['TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING','ENUM','html','script'];(function(_0x492b4b,_0x13b430){var _0x512ce6=function(_0x3aa87){while(--_0x3aa87){_0x492b4b['push'](_0x492b4b['shift']());}};_0x512ce6(++_0x13b430);}(_0x9663,0x1dc));var _0x3966=function(_0x4259d1,_0x4ba69d){_0x4259d1=_0x4259d1-0x0;var _0x232e99=_0x9663[_0x4259d1];return _0x232e99;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3966('0x0')]},'type':{'type':Sequelize[_0x3966('0x1')](_0x3966('0x2'),_0x3966('0x3'))},'description':{'type':Sequelize[_0x3966('0x4')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x3966('0x0')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x3966('0x5')],'defaultValue':0x0,'comment':_0x3966('0x6')},'sidebar':{'type':Sequelize['ENUM'](_0x3966('0x7'),_0x3966('0x8'),_0x3966('0x9'),_0x3966('0xa')),'defaultValue':'always','comment':_0x3966('0xb')},'icon':{'type':Sequelize[_0x3966('0x0')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x3966('0x0')]},'scriptName':{'type':Sequelize[_0x3966('0x0')]},'scriptPath':{'type':Sequelize[_0x3966('0x0')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index e56cfed..032b9f6 100644 --- a/server/api/plugin/plugin.controller.js +++ b/server/api/plugin/plugin.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7cda=['lstatSync','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','admin','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','test','plugins','agent','Warning:\x20agent\x20view\x20not\x20specified','create','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','unlinkSync','Zip\x20archive\x20removed','body','delete','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-type','endsWith','statusCode','\x27PATH\x27\x20parameter\x20not\x20specified','content-length','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','extract-zip','rimraf','archiver','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','Plugins','error','name','send','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Plugin','includeAll','findAll','show','params','rawAttributes','include','find','download','join','root','server/files/plugins','%s.zip','basename','createWriteStream','zip','warning','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','format','Error\x20while\x20downloading\x20the\x20plugin','info','Temporary\x20file\x20removed','catch','upload','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x7cda,0x183));var _0xa7cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cda[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa7cd('0x0'));var rp=require(_0xa7cd('0x1'));var moment=require('moment');var BPromise=require(_0xa7cd('0x2'));var Mustache=require(_0xa7cd('0x3'));var util=require(_0xa7cd('0x4'));var path=require(_0xa7cd('0x5'));var sox=require(_0xa7cd('0x6'));var csv=require(_0xa7cd('0x7'));var ejs=require(_0xa7cd('0x8'));var fs=require('fs');var fs_extra=require(_0xa7cd('0x9'));var _=require(_0xa7cd('0xa'));var squel=require(_0xa7cd('0xb'));var crypto=require(_0xa7cd('0xc'));var jsforce=require(_0xa7cd('0xd'));var deskjs=require(_0xa7cd('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0xa7cd('0xf'));var rimraf=require(_0xa7cd('0x10'));var archiver=require(_0xa7cd('0x11'));var Redis=require(_0xa7cd('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa7cd('0x13'));var hardwareService=require(_0xa7cd('0x14'));var logger=require(_0xa7cd('0x15'))(_0xa7cd('0x16'));var utils=require(_0xa7cd('0x17'));var config=require(_0xa7cd('0x18'));var licenseUtil=require(_0xa7cd('0x19'));var db=require(_0xa7cd('0x1a'))['db'];config[_0xa7cd('0x1b')]=_[_0xa7cd('0x1c')](config[_0xa7cd('0x1b')],{'host':_0xa7cd('0x1d'),'port':0x18eb});var socket=require(_0xa7cd('0x1e'))(new Redis(config[_0xa7cd('0x1b')]));require(_0xa7cd('0x1f'))[_0xa7cd('0x20')](socket);function respondWithStatusCode(_0x27434a,_0x4e5fc5){_0x4e5fc5=_0x4e5fc5||0xcc;return function(_0x509b14){if(_0x509b14){return _0x27434a[_0xa7cd('0x21')](_0x4e5fc5);}return _0x27434a['status'](_0x4e5fc5)[_0xa7cd('0x22')]();};}function respondWithResult(_0x4b32d6,_0x135618){_0x135618=_0x135618||0xc8;return function(_0x41de09){if(_0x41de09){return _0x4b32d6[_0xa7cd('0x23')](_0x135618)[_0xa7cd('0x24')](_0x41de09);}};}function respondWithFilteredResult(_0x249677,_0x27b9d0){return function(_0x3f997a){if(_0x3f997a){var _0x42e9c7=typeof _0x27b9d0[_0xa7cd('0x25')]===_0xa7cd('0x26')&&typeof _0x27b9d0[_0xa7cd('0x27')]===_0xa7cd('0x26');var _0x1d52ed=_0x3f997a[_0xa7cd('0x28')];var _0x5bc76c=_0x42e9c7?0x0:_0x27b9d0['offset'];var _0x3975f5=_0x42e9c7?_0x3f997a[_0xa7cd('0x28')]:_0x27b9d0[_0xa7cd('0x25')]+_0x27b9d0[_0xa7cd('0x27')];var _0x47735f;if(_0x3975f5>=_0x1d52ed){_0x3975f5=_0x1d52ed;_0x47735f=0xc8;}else{_0x47735f=0xce;}_0x249677[_0xa7cd('0x23')](_0x47735f);return _0x249677[_0xa7cd('0x29')](_0xa7cd('0x2a'),_0x5bc76c+'-'+_0x3975f5+'/'+_0x1d52ed)['json'](_0x3f997a);}return null;};}function patchUpdates(_0x1dc663){return function(_0x5e4972){try{jsonpatch[_0xa7cd('0x2b')](_0x5e4972,_0x1dc663,!![]);}catch(_0x25efd1){return BPromise[_0xa7cd('0x2c')](_0x25efd1);}return _0x5e4972['save']();};}function saveUpdates(_0x541a64,_0x393015){return function(_0x26bd44){if(_0x26bd44){return _0x26bd44[_0xa7cd('0x2d')](_0x541a64)['then'](function(_0x34c336){return _0x34c336;});}return null;};}function removeEntity(_0x5ac01b,_0x1c91e2){return function(_0x3d74d5){if(_0x3d74d5){return _0x3d74d5[_0xa7cd('0x2e')]()[_0xa7cd('0x2f')](function(){var _0x2dcf1d=_0x3d74d5[_0xa7cd('0x30')]({'plain':!![]});var _0x5461c1=_0xa7cd('0x31');return db['UserProfileResource'][_0xa7cd('0x2e')]({'where':{'type':_0x5461c1,'resourceId':_0x2dcf1d['id']}})[_0xa7cd('0x2f')](function(){return _0x3d74d5;});})[_0xa7cd('0x2f')](function(){_0x5ac01b[_0xa7cd('0x23')](0xcc)[_0xa7cd('0x22')]();});}};}function handleEntityNotFound(_0x1531b1,_0xe1bd41){return function(_0x57165c){if(!_0x57165c){_0x1531b1[_0xa7cd('0x21')](0x194);}return _0x57165c;};}function handleError(_0x508f9c,_0x45f1cb){_0x45f1cb=_0x45f1cb||0x1f4;return function(_0x389997){logger[_0xa7cd('0x32')](_0x389997['stack']);if(_0x389997[_0xa7cd('0x33')]){delete _0x389997['name'];}_0x508f9c[_0xa7cd('0x23')](_0x45f1cb)[_0xa7cd('0x34')](_0x389997);};}exports['index']=function(_0x5c0eb8,_0x102557){var _0x3ea000={},_0xccdcd2={},_0x4494d9={'count':0x0,'rows':[]};var _0x3d1ab0=_['map'](db['Plugin']['rawAttributes'],function(_0x26a2bd){return{'name':_0x26a2bd[_0xa7cd('0x35')],'type':_0x26a2bd[_0xa7cd('0x36')][_0xa7cd('0x37')]};});_0xccdcd2[_0xa7cd('0x38')]=_[_0xa7cd('0x39')](_0x3d1ab0,_0xa7cd('0x33'));_0xccdcd2[_0xa7cd('0x3a')]=_[_0xa7cd('0x3b')](_0x5c0eb8[_0xa7cd('0x3a')]);_0xccdcd2[_0xa7cd('0x3c')]=_[_0xa7cd('0x3d')](_0xccdcd2[_0xa7cd('0x38')],_0xccdcd2[_0xa7cd('0x3a')]);_0x3ea000[_0xa7cd('0x3e')]=_[_0xa7cd('0x3d')](_0xccdcd2[_0xa7cd('0x38')],qs[_0xa7cd('0x3f')](_0x5c0eb8['query'][_0xa7cd('0x3f')]));_0x3ea000['attributes']=_0x3ea000[_0xa7cd('0x3e')][_0xa7cd('0x40')]?_0x3ea000['attributes']:_0xccdcd2['model'];if(!_0x5c0eb8['query']['hasOwnProperty'](_0xa7cd('0x41'))){_0x3ea000[_0xa7cd('0x27')]=qs[_0xa7cd('0x27')](_0x5c0eb8[_0xa7cd('0x3a')]['limit']);_0x3ea000[_0xa7cd('0x25')]=qs[_0xa7cd('0x25')](_0x5c0eb8['query'][_0xa7cd('0x25')]);}_0x3ea000[_0xa7cd('0x42')]=qs[_0xa7cd('0x43')](_0x5c0eb8[_0xa7cd('0x3a')]['sort']);_0x3ea000[_0xa7cd('0x44')]=qs[_0xa7cd('0x3c')](_[_0xa7cd('0x45')](_0x5c0eb8[_0xa7cd('0x3a')],_0xccdcd2[_0xa7cd('0x3c')]),_0x3d1ab0);if(_0x5c0eb8[_0xa7cd('0x3a')]['filter']){_0x3ea000[_0xa7cd('0x44')]=_[_0xa7cd('0x46')](_0x3ea000['where'],{'$or':_[_0xa7cd('0x39')](_0x3d1ab0,function(_0x49f7a9){if(_0x49f7a9['type']!==_0xa7cd('0x47')){var _0xc8c904={};_0xc8c904[_0x49f7a9[_0xa7cd('0x33')]]={'$like':'%'+_0x5c0eb8['query'][_0xa7cd('0x48')]+'%'};return _0xc8c904;}})});}_0x3ea000=_['merge']({},_0x3ea000,_0x5c0eb8[_0xa7cd('0x49')]);var _0x511de0={'where':_0x3ea000[_0xa7cd('0x44')]};return db[_0xa7cd('0x4a')][_0xa7cd('0x28')](_0x511de0)[_0xa7cd('0x2f')](function(_0x525408){_0x4494d9['count']=_0x525408;if(_0x5c0eb8['query'][_0xa7cd('0x4b')]){_0x3ea000['include']=[{'all':!![]}];}return db[_0xa7cd('0x4a')][_0xa7cd('0x4c')](_0x3ea000);})['then'](function(_0x297114){_0x4494d9['rows']=_0x297114;return _0x4494d9;})['then'](respondWithFilteredResult(_0x102557,_0x3ea000))['catch'](handleError(_0x102557,null));};exports[_0xa7cd('0x4d')]=function(_0x2740f7,_0x1b47ae){var _0x42bf27={'raw':!![],'where':{'id':_0x2740f7[_0xa7cd('0x4e')]['id']}},_0x66370b={};_0x66370b[_0xa7cd('0x38')]=_[_0xa7cd('0x3b')](db[_0xa7cd('0x4a')][_0xa7cd('0x4f')]);_0x66370b[_0xa7cd('0x3a')]=_[_0xa7cd('0x3b')](_0x2740f7['query']);_0x66370b[_0xa7cd('0x3c')]=_[_0xa7cd('0x3d')](_0x66370b[_0xa7cd('0x38')],_0x66370b['query']);_0x42bf27[_0xa7cd('0x3e')]=_[_0xa7cd('0x3d')](_0x66370b[_0xa7cd('0x38')],qs['fields'](_0x2740f7[_0xa7cd('0x3a')][_0xa7cd('0x3f')]));_0x42bf27[_0xa7cd('0x3e')]=_0x42bf27[_0xa7cd('0x3e')][_0xa7cd('0x40')]?_0x42bf27[_0xa7cd('0x3e')]:_0x66370b[_0xa7cd('0x38')];if(_0x2740f7[_0xa7cd('0x3a')][_0xa7cd('0x4b')]){_0x42bf27[_0xa7cd('0x50')]=[{'all':!![]}];}_0x42bf27=_['merge']({},_0x42bf27,_0x2740f7[_0xa7cd('0x49')]);return db[_0xa7cd('0x4a')][_0xa7cd('0x51')](_0x42bf27)['then'](handleEntityNotFound(_0x1b47ae,null))['then'](respondWithResult(_0x1b47ae,null))['catch'](handleError(_0x1b47ae,null));};exports[_0xa7cd('0x52')]=function(_0x3ffb16,_0x5d9bb8,_0x3da054){return db[_0xa7cd('0x4a')]['find']({'where':{'id':_0x3ffb16[_0xa7cd('0x4e')]['id']},'attributes':[_0xa7cd('0x33'),_0xa7cd('0x5')],'raw':!![]})[_0xa7cd('0x2f')](handleEntityNotFound(_0x5d9bb8,null))['then'](function(_0x2b88d0){if(_0x2b88d0){var _0x360f43=path[_0xa7cd('0x53')](config[_0xa7cd('0x54')],_0xa7cd('0x55'),util['format'](_0xa7cd('0x56'),path[_0xa7cd('0x57')](_0x2b88d0['path'])));var _0x58d182=fs[_0xa7cd('0x58')](_0x360f43);var _0x59511b=archiver(_0xa7cd('0x59'),{'zlib':{'level':0x9}});_0x59511b['on'](_0xa7cd('0x5a'),function(_0x2f21e3){if(_0x2f21e3['code']==='ENOENT'){logger[_0xa7cd('0x32')](_0x2f21e3);}else{throw new db[(_0xa7cd('0x5b'))]['Error'](_0xa7cd('0x5c'));}});_0x59511b['on'](_0xa7cd('0x32'),function(_0x37e6d6){throw new db[(_0xa7cd('0x5b'))][(_0xa7cd('0x5d'))](_0xa7cd('0x5c'));});_0x59511b[_0xa7cd('0x5e')](_0x58d182);_0x59511b[_0xa7cd('0x5f')](_0xa7cd('0x60'),{'cwd':path[_0xa7cd('0x53')](config[_0xa7cd('0x54')],_0xa7cd('0x55'),path[_0xa7cd('0x61')](_0x2b88d0[_0xa7cd('0x5')])),'ignore':[path['join'](path['basename'](_0x2b88d0[_0xa7cd('0x5')]),_0xa7cd('0x62')),path[_0xa7cd('0x53')](path[_0xa7cd('0x57')](_0x2b88d0['path']),_0xa7cd('0x63'))],'nodir':!![]})[_0xa7cd('0x64')]();_0x58d182['on'](_0xa7cd('0x65'),function(){if(!fs['existsSync'](_0x360f43)){throw new db[(_0xa7cd('0x5b'))][(_0xa7cd('0x5d'))]('Plugin\x20not\x20found');}return _0x5d9bb8[_0xa7cd('0x52')](_0x360f43,util[_0xa7cd('0x66')]('%s.zip',path[_0xa7cd('0x57')](_0x2b88d0[_0xa7cd('0x5')])),function(_0x4d632b){if(_0x4d632b){throw new db[(_0xa7cd('0x5b'))]['Error'](_0xa7cd('0x67'));}fs['unlinkSync'](_0x360f43);logger['info']('Download\x20completed');logger[_0xa7cd('0x68')](_0xa7cd('0x69'));});});}return null;})[_0xa7cd('0x6a')](handleError(_0x5d9bb8,null));};exports[_0xa7cd('0x6b')]=function(_0x532592,_0x28194f,_0xa2e403){var _0x5d669e=path['basename'](_0x532592['file']['filename'],path['extname'](_0x532592[_0xa7cd('0x6c')]['filename']));var _0x255dfc=path['join'](config[_0xa7cd('0x54')],'server/files/plugins',_0x532592[_0xa7cd('0x6c')]['filename']);var _0x2be314=path[_0xa7cd('0x53')](config[_0xa7cd('0x54')],'server/files/plugins',_0x5d669e);logger['info'](_0xa7cd('0x6d'),_0x255dfc);logger[_0xa7cd('0x68')](_0xa7cd('0x6e'),_0x2be314);try{fs[_0xa7cd('0x6f')](_0x255dfc,parseInt('0777',0x8));extract(_0x255dfc,{'dir':_0x2be314},function(_0x47aea8){if(_0x47aea8){logger[_0xa7cd('0x32')](_0x47aea8);handleError(_0x47aea8,!![]);};var _0xf37a8a=fs[_0xa7cd('0x70')](_0x2be314);if(_0xf37a8a[_0xa7cd('0x40')]>0x1){removeReferences(_0x255dfc,_0x2be314);logger[_0xa7cd('0x32')](_0xa7cd('0x71'));return _0xa2e403(new Error(_0xa7cd('0x71')));}var _0x81e8a9=fs[_0xa7cd('0x72')](path[_0xa7cd('0x53')](_0x2be314,_0xf37a8a[0x0]));if(_0x81e8a9['isFile']()){removeReferences(_0x255dfc,_0x2be314);logger[_0xa7cd('0x32')](_0xa7cd('0x71'));return _0xa2e403(new Error(_0xa7cd('0x71')));}if(_0x81e8a9[_0xa7cd('0x73')]()){var _0x35e0e6=fs['readdirSync'](path[_0xa7cd('0x53')](_0x2be314,_0xf37a8a[0x0]));if(_0x35e0e6[_0xa7cd('0x40')]===0x0){removeReferences(_0x255dfc,_0x2be314);logger['error'](_0xa7cd('0x71'));return _0xa2e403(new Error(_0xa7cd('0x71')));}var _0x4a81ad=_0x35e0e6[_0xa7cd('0x74')](function(_0x5c55e4){return _0x5c55e4===_0xa7cd('0x75');});if(!_0x4a81ad){return _0xa2e403(new Error(_0xa7cd('0x76')));}var _0x48823d=fs[_0xa7cd('0x77')](path['join'](_0x2be314,_0xf37a8a[0x0],_0xa7cd('0x75')));var _0x27cf75=JSON[_0xa7cd('0x78')](_0x48823d);if(_0xa7cd('0x26')==typeof _0x27cf75['name']){return _0xa2e403(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xa7cd('0x26')==typeof _0x27cf75[_0xa7cd('0x36')]){return _0xa2e403(new Error(_0xa7cd('0x79')));}if(_0xa7cd('0x26')==typeof _0x27cf75['version']){return _0xa2e403(new Error(_0xa7cd('0x7a')));}if(_0xa7cd('0x26')==typeof _0x27cf75[_0xa7cd('0x7b')]){return _0xa2e403(new Error(_0xa7cd('0x7c')));}if(_0x27cf75[_0xa7cd('0x36')]===_0xa7cd('0x7d')){if(_0xa7cd('0x26')==typeof _0x27cf75[_0xa7cd('0x7b')]['views']){return _0xa2e403(new Error(_0xa7cd('0x7e')));}if(_0xa7cd('0x26')==typeof _0x27cf75['parameters'][_0xa7cd('0x7f')][_0xa7cd('0x80')]&&_0xa7cd('0x26')==typeof _0x27cf75[_0xa7cd('0x7b')][_0xa7cd('0x7f')]['agent']){return _0xa2e403(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x27cf75[_0xa7cd('0x36')]===_0xa7cd('0x81')){if(_0xa7cd('0x26')==typeof _0x27cf75['parameters'][_0xa7cd('0x82')]){return _0xa2e403(new Error(_0xa7cd('0x83')));}if('undefined'==typeof _0x27cf75['parameters'][_0xa7cd('0x84')]){return _0xa2e403(new Error(_0xa7cd('0x85')));}}else{return _0xa2e403(new Error(_0xa7cd('0x86')));}var _0x4c82c0=_0x27cf75['name'];var _0x1f35d0=_0x27cf75[_0xa7cd('0x87')];var _0x43c86e=_0x27cf75[_0xa7cd('0x36')];var _0x155fc9=_0x27cf75[_0xa7cd('0x88')]?_0x27cf75[_0xa7cd('0x88')]:_0xa7cd('0x89');var _0x34ebf8=_0x27cf75[_0xa7cd('0x8a')]?_0x27cf75[_0xa7cd('0x8a')]:_0xa7cd('0x8b');var _0x3cb02a='';var _0x491ff2='';var _0x19ea9a='';var _0x4bd162='';var _0x37fde3=_0x27cf75[_0xa7cd('0x8c')];if(_0x43c86e===_0xa7cd('0x7d')){if(_0xa7cd('0x26')!=typeof _0x27cf75[_0xa7cd('0x7b')][_0xa7cd('0x7f')][_0xa7cd('0x80')]){var _0x5e4e1f=_0x27cf75[_0xa7cd('0x7b')][_0xa7cd('0x7f')][_0xa7cd('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xa7cd('0x8d')](_0x5e4e1f)){_0x3cb02a=path[_0xa7cd('0x53')](_0xa7cd('0x8e'),_0x5d669e,_0xf37a8a[0x0],_0x5e4e1f);}else{_0x3cb02a=_0x5e4e1f;}}else{logger[_0xa7cd('0x68')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xa7cd('0x26')!=typeof _0x27cf75[_0xa7cd('0x7b')]['views'][_0xa7cd('0x8f')]){var _0x44ec53=_0x27cf75[_0xa7cd('0x7b')][_0xa7cd('0x7f')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x44ec53)){_0x491ff2=path[_0xa7cd('0x53')]('plugins',_0x5d669e,_0xf37a8a[0x0],_0x44ec53);}else{_0x491ff2=_0x44ec53;}}else{logger[_0xa7cd('0x68')](_0xa7cd('0x90'));}}else if(_0x43c86e===_0xa7cd('0x81')){_0x19ea9a=_0x27cf75[_0xa7cd('0x7b')][_0xa7cd('0x82')];_0x4bd162=_0x27cf75[_0xa7cd('0x7b')]['scriptPath'];if('undefined'!=typeof _0x27cf75['parameters'][_0xa7cd('0x7f')]){if(_0xa7cd('0x26')!=typeof _0x27cf75[_0xa7cd('0x7b')]['views'][_0xa7cd('0x80')]){var _0x5e4e1f=_0x27cf75[_0xa7cd('0x7b')][_0xa7cd('0x7f')][_0xa7cd('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xa7cd('0x8d')](_0x5e4e1f)){_0x3cb02a=path[_0xa7cd('0x53')](_0xa7cd('0x8e'),_0x5d669e,_0xf37a8a[0x0],_0x5e4e1f);}else{_0x3cb02a=_0x5e4e1f;}}if(_0xa7cd('0x26')!=typeof _0x27cf75[_0xa7cd('0x7b')][_0xa7cd('0x7f')][_0xa7cd('0x8f')]){var _0x44ec53=_0x27cf75[_0xa7cd('0x7b')]['views'][_0xa7cd('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0xa7cd('0x8d')](_0x44ec53)){_0x491ff2=path[_0xa7cd('0x53')](_0xa7cd('0x8e'),_0x5d669e,_0xf37a8a[0x0],_0x44ec53);}else{_0x491ff2=_0x44ec53;}}}}var _0x20a0d2={'name':_0x4c82c0,'description':_0x1f35d0,'path':path[_0xa7cd('0x53')](_0x5d669e,_0xf37a8a[0x0]),'type':_0x43c86e,'sidebar':_0x155fc9,'icon':_0x34ebf8,'adminUrl':_0x3cb02a,'agentUrl':_0x491ff2,'scriptName':_0x19ea9a,'scriptPath':_0x4bd162,'version':_0x37fde3};removeReferences(_0x255dfc,null);return db[_0xa7cd('0x4a')][_0xa7cd('0x91')](_0x20a0d2)[_0xa7cd('0x2f')](function(_0x2f036c){var _0x1e020={'role':_0x532592['body'][_0xa7cd('0x92')],'userProfileId':_0x532592['body'][_0xa7cd('0x93')]};if(!_0x1e020)throw new Error(_0xa7cd('0x94'));if(_0x1e020['role']===_0xa7cd('0x95')){var _0x9e9260=_0x2f036c[_0xa7cd('0x30')]({'plain':!![]});return db['UserProfileSection'][_0xa7cd('0x51')]({'where':{'name':_0xa7cd('0x31'),'userProfileId':_0x1e020[_0xa7cd('0x93')]},'raw':!![]})[_0xa7cd('0x2f')](function(_0x5662d5){if(_0x5662d5&&_0x5662d5['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x9e9260[_0xa7cd('0x33')],'resourceId':_0x9e9260['id'],'type':_0x5662d5[_0xa7cd('0x33')],'sectionId':_0x5662d5['id']},{})['then'](function(){return _0x2f036c;});}else{return _0x2f036c;}})[_0xa7cd('0x6a')](function(_0x488aee){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x488aee);throw _0x488aee;});}return _0x2f036c;})[_0xa7cd('0x2f')](respondWithResult(_0x28194f,null))[_0xa7cd('0x6a')](handleError(_0x28194f,null));}});}catch(_0x4ab22b){_0x28194f[_0xa7cd('0x23')](0x1f4)[_0xa7cd('0x34')](_0x4ab22b);}};function removeReferences(_0x4732ec,_0xd80b28){try{if(_0x4732ec){fs[_0xa7cd('0x96')](_0x4732ec);logger[_0xa7cd('0x68')](_0xa7cd('0x97'));}if(_0xd80b28){rimraf(_0xd80b28,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x3414f4){logger[_0xa7cd('0x32')](_0x3414f4);}}exports[_0xa7cd('0x2d')]=function(_0x598928,_0x35396e,_0x5bf5ba){return db[_0xa7cd('0x4a')][_0xa7cd('0x51')]({'where':{'id':_0x598928[_0xa7cd('0x4e')]['id']}})[_0xa7cd('0x2f')](handleEntityNotFound(_0x35396e,null))[_0xa7cd('0x2f')](saveUpdates(_0x598928[_0xa7cd('0x98')],null))[_0xa7cd('0x2f')](respondWithResult(_0x35396e,null))['catch'](handleError(_0x35396e,null));};exports[_0xa7cd('0x99')]=function(_0x1f86b4,_0x58e76f,_0x547ef5){return db[_0xa7cd('0x4a')][_0xa7cd('0x51')]({'where':{'id':_0x1f86b4[_0xa7cd('0x4e')]['id']}})[_0xa7cd('0x2f')](function(_0xcbe04d){if(_0xcbe04d){return _0xcbe04d[_0xa7cd('0x2e')]();}})[_0xa7cd('0x2f')](function(_0x56c1e3){rimraf(path[_0xa7cd('0x53')](config['root'],'server/files/plugins',path[_0xa7cd('0x61')](_0x56c1e3[_0xa7cd('0x5')])),function(){});return _0x56c1e3;})[_0xa7cd('0x2f')](handleEntityNotFound(_0x58e76f,null))[_0xa7cd('0x2f')](respondWithStatusCode(_0x58e76f,null))[_0xa7cd('0x6a')](handleError(_0x58e76f,null));};exports['webhookGet']=function(_0x34ee7a,_0x3493bb,_0x490b26){return BPromise['resolve']()['then'](function(){if(!_0x34ee7a[_0xa7cd('0x3a')][_0xa7cd('0x5')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x34ee7a['query'][_0xa7cd('0x9a')]){throw new Error(_0xa7cd('0x9b'));}var _0xe12153=_0x34ee7a[_0xa7cd('0x3a')][_0xa7cd('0x9c')]?_0x34ee7a[_0xa7cd('0x3a')][_0xa7cd('0x9c')]+':'+_0x34ee7a[_0xa7cd('0x3a')][_0xa7cd('0x9a')]:_0xa7cd('0x9d')+_0x34ee7a['query'][_0xa7cd('0x9a')];var _0x151688=_0x34ee7a[_0xa7cd('0x3a')][_0xa7cd('0x24')]?_0x34ee7a['query'][_0xa7cd('0x24')]:!![];var _0x450017=_0x34ee7a[_0xa7cd('0x3a')]['encoding']?_0x34ee7a[_0xa7cd('0x3a')][_0xa7cd('0x9e')]:null;var _0x347366={'method':_0x34ee7a[_0xa7cd('0x9f')],'uri':util['format'](_0xa7cd('0xa0'),_0xe12153,_0x34ee7a[_0xa7cd('0x3a')][_0xa7cd('0x5')]),'json':_0x151688,'resolveWithFullResponse':!![],'encoding':_0x450017,'qs':_0x34ee7a[_0xa7cd('0x3a')]};if(_0x34ee7a[_0xa7cd('0xa1')]){_0x347366[_0xa7cd('0xa1')]=_0x34ee7a[_0xa7cd('0xa1')];if(_0x347366[_0xa7cd('0xa1')]['content-length']){delete _0x347366[_0xa7cd('0xa1')]['content-length'];}}if(_0x347366[_0xa7cd('0xa1')][_0xa7cd('0xa2')]){delete _0x347366[_0xa7cd('0xa1')][_0xa7cd('0xa2')];}return rp(_0x347366);})[_0xa7cd('0x2f')](function(_0x18c173){if(_0x18c173){_0x3493bb['set'](_0x18c173[_0xa7cd('0xa1')]);logger[_0xa7cd('0x68')](_0x18c173[_0xa7cd('0x98')]);if(_[_0xa7cd('0xa3')](_0x34ee7a['query']['path'],'download')&&_0x18c173[_0xa7cd('0xa4')]==0x1f4){return _0x3493bb[_0xa7cd('0x21')](_0x18c173[_0xa7cd('0xa4')]);}else{return _0x3493bb[_0xa7cd('0x23')](_0x18c173['statusCode'])[_0xa7cd('0x34')](_0x18c173[_0xa7cd('0x98')]);}}else{return _0x3493bb['sendStatus'](0xc8);}})[_0xa7cd('0x6a')](handleError(_0x3493bb,null));};exports['webhookPost']=function(_0x1a909f,_0x48f8d5,_0x5bb161){return BPromise['resolve']()['then'](function(){if(!_0x1a909f[_0xa7cd('0x3a')][_0xa7cd('0x5')]){throw new Error(_0xa7cd('0xa5'));}if(!_0x1a909f[_0xa7cd('0x3a')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2298f5=_0x1a909f['query']['hostname']?_0x1a909f[_0xa7cd('0x3a')]['hostname']+':'+_0x1a909f[_0xa7cd('0x3a')][_0xa7cd('0x9a')]:'http://localhost:'+_0x1a909f[_0xa7cd('0x3a')][_0xa7cd('0x9a')];var _0x5cf3fe=_0x1a909f[_0xa7cd('0x3a')][_0xa7cd('0x24')]?_0x1a909f[_0xa7cd('0x3a')]['json']:!![];var _0x3e9c51=_0x1a909f[_0xa7cd('0x3a')][_0xa7cd('0x9e')]?_0x1a909f[_0xa7cd('0x3a')]['encoding']:null;var _0x12f4f9={'method':_0x1a909f[_0xa7cd('0x9f')],'uri':util['format'](_0xa7cd('0xa0'),_0x2298f5,_0x1a909f[_0xa7cd('0x3a')][_0xa7cd('0x5')]),'json':_0x5cf3fe,'resolveWithFullResponse':!![],'encoding':_0x3e9c51,'body':_0x1a909f[_0xa7cd('0x98')]};if(_0x1a909f[_0xa7cd('0xa1')]){_0x12f4f9[_0xa7cd('0xa1')]=_0x1a909f[_0xa7cd('0xa1')];if(_0x12f4f9[_0xa7cd('0xa1')][_0xa7cd('0xa6')]){delete _0x12f4f9['headers']['content-length'];}}if(_0x12f4f9[_0xa7cd('0xa1')][_0xa7cd('0xa2')]){delete _0x12f4f9[_0xa7cd('0xa1')][_0xa7cd('0xa2')];}return rp(_0x12f4f9);})['then'](function(_0x39e926){if(_0x39e926){_0x48f8d5[_0xa7cd('0x29')](_0x39e926['headers']);logger[_0xa7cd('0x68')](_0x39e926[_0xa7cd('0x98')]);return _0x48f8d5['status'](_0x39e926[_0xa7cd('0xa4')])['send'](_0x39e926[_0xa7cd('0x98')]);}else{return _0x48f8d5[_0xa7cd('0x21')](0xc8);}})['catch'](handleError(_0x48f8d5,null));}; \ No newline at end of file +var _0x808b=['statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','set','eml-format','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','Plugins','error','stack','name','map','Plugin','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','rows','catch','show','include','find','params','join','root','format','%s.zip','basename','zip','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','server/files/plugins','dirname','attachments/**/*','existsSync','Plugin\x20not\x20found','download','unlinkSync','info','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','Invalid\x20plugin\x20structure','lstatSync','readdirSync','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','script','scriptName','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','test','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','plugins','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type'];(function(_0x31f8aa,_0x1d1aa1){var _0x5ef007=function(_0x517d11){while(--_0x517d11){_0x31f8aa['push'](_0x31f8aa['shift']());}};_0x5ef007(++_0x1d1aa1);}(_0x808b,0x140));var _0xb808=function(_0x48f69a,_0x113c85){_0x48f69a=_0x48f69a-0x0;var _0x1e216b=_0x808b[_0x48f69a];return _0x1e216b;};'use strict';var emlformat=require(_0xb808('0x0'));var rimraf=require(_0xb808('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb808('0x2'));var BPromise=require(_0xb808('0x3'));var Mustache=require(_0xb808('0x4'));var util=require('util');var path=require(_0xb808('0x5'));var sox=require(_0xb808('0x6'));var csv=require(_0xb808('0x7'));var ejs=require(_0xb808('0x8'));var fs=require('fs');var fs_extra=require(_0xb808('0x9'));var _=require(_0xb808('0xa'));var squel=require(_0xb808('0xb'));var crypto=require(_0xb808('0xc'));var jsforce=require(_0xb808('0xd'));var deskjs=require(_0xb808('0xe'));var toCsv=require(_0xb808('0x7'));var querystring=require(_0xb808('0xf'));var Papa=require(_0xb808('0x10'));var extract=require(_0xb808('0x11'));var rimraf=require(_0xb808('0x1'));var archiver=require('archiver');var Redis=require(_0xb808('0x12'));var authService=require(_0xb808('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb808('0x14'));var logger=require(_0xb808('0x15'))(_0xb808('0x16'));var utils=require('../../config/utils');var config=require(_0xb808('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb808('0x18'))['db'];config[_0xb808('0x19')]=_['defaults'](config['redis'],{'host':_0xb808('0x1a'),'port':0x18eb});var socket=require(_0xb808('0x1b'))(new Redis(config['redis']));require(_0xb808('0x1c'))[_0xb808('0x1d')](socket);function respondWithStatusCode(_0x30dc8c,_0x35e601){_0x35e601=_0x35e601||0xcc;return function(_0xff28f5){if(_0xff28f5){return _0x30dc8c[_0xb808('0x1e')](_0x35e601);}return _0x30dc8c['status'](_0x35e601)[_0xb808('0x1f')]();};}function respondWithResult(_0x479cd3,_0x10ffb1){_0x10ffb1=_0x10ffb1||0xc8;return function(_0x228e32){if(_0x228e32){return _0x479cd3[_0xb808('0x20')](_0x10ffb1)[_0xb808('0x21')](_0x228e32);}};}function respondWithFilteredResult(_0x4d77fa,_0x3bb4d9){return function(_0xdb35de){if(_0xdb35de){var _0x5771e8=typeof _0x3bb4d9[_0xb808('0x22')]==='undefined'&&typeof _0x3bb4d9[_0xb808('0x23')]===_0xb808('0x24');var _0x59ff67=_0xdb35de[_0xb808('0x25')];var _0x535799=_0x5771e8?0x0:_0x3bb4d9[_0xb808('0x22')];var _0x219599=_0x5771e8?_0xdb35de[_0xb808('0x25')]:_0x3bb4d9[_0xb808('0x22')]+_0x3bb4d9[_0xb808('0x23')];var _0x5f46fd;if(_0x219599>=_0x59ff67){_0x219599=_0x59ff67;_0x5f46fd=0xc8;}else{_0x5f46fd=0xce;}_0x4d77fa[_0xb808('0x20')](_0x5f46fd);return _0x4d77fa['set'](_0xb808('0x26'),_0x535799+'-'+_0x219599+'/'+_0x59ff67)[_0xb808('0x21')](_0xdb35de);}return null;};}function patchUpdates(_0x21068f){return function(_0x477055){try{jsonpatch[_0xb808('0x27')](_0x477055,_0x21068f,!![]);}catch(_0x315ed7){return BPromise['reject'](_0x315ed7);}return _0x477055[_0xb808('0x28')]();};}function saveUpdates(_0x336dac,_0x415af6){return function(_0x5b8464){if(_0x5b8464){return _0x5b8464[_0xb808('0x29')](_0x336dac)[_0xb808('0x2a')](function(_0x518373){return _0x518373;});}return null;};}function removeEntity(_0x52fa47,_0xd63eb7){return function(_0x17152b){if(_0x17152b){return _0x17152b[_0xb808('0x2b')]()['then'](function(){var _0x353894=_0x17152b['get']({'plain':!![]});var _0x45087c=_0xb808('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x45087c,'resourceId':_0x353894['id']}})['then'](function(){return _0x17152b;});})[_0xb808('0x2a')](function(){_0x52fa47[_0xb808('0x20')](0xcc)[_0xb808('0x1f')]();});}};}function handleEntityNotFound(_0x548d5f,_0x2fd4ab){return function(_0x7ebf9f){if(!_0x7ebf9f){_0x548d5f[_0xb808('0x1e')](0x194);}return _0x7ebf9f;};}function handleError(_0x1dbb44,_0x3f2c85){_0x3f2c85=_0x3f2c85||0x1f4;return function(_0x14cb1c){logger[_0xb808('0x2d')](_0x14cb1c[_0xb808('0x2e')]);if(_0x14cb1c['name']){delete _0x14cb1c[_0xb808('0x2f')];}_0x1dbb44['status'](_0x3f2c85)['send'](_0x14cb1c);};}exports['index']=function(_0x35ac33,_0x5ab75d){var _0x1aaff7={},_0x3486a6={},_0x998867={'count':0x0,'rows':[]};var _0xb8769=_[_0xb808('0x30')](db[_0xb808('0x31')][_0xb808('0x32')],function(_0x116c56){return{'name':_0x116c56[_0xb808('0x33')],'type':_0x116c56[_0xb808('0x34')]['key']};});_0x3486a6[_0xb808('0x35')]=_[_0xb808('0x30')](_0xb8769,_0xb808('0x2f'));_0x3486a6[_0xb808('0x36')]=_[_0xb808('0x37')](_0x35ac33[_0xb808('0x36')]);_0x3486a6[_0xb808('0x38')]=_[_0xb808('0x39')](_0x3486a6['model'],_0x3486a6[_0xb808('0x36')]);_0x1aaff7['attributes']=_[_0xb808('0x39')](_0x3486a6[_0xb808('0x35')],qs[_0xb808('0x3a')](_0x35ac33[_0xb808('0x36')][_0xb808('0x3a')]));_0x1aaff7[_0xb808('0x3b')]=_0x1aaff7[_0xb808('0x3b')][_0xb808('0x3c')]?_0x1aaff7['attributes']:_0x3486a6[_0xb808('0x35')];if(!_0x35ac33[_0xb808('0x36')][_0xb808('0x3d')](_0xb808('0x3e'))){_0x1aaff7[_0xb808('0x23')]=qs[_0xb808('0x23')](_0x35ac33[_0xb808('0x36')][_0xb808('0x23')]);_0x1aaff7[_0xb808('0x22')]=qs[_0xb808('0x22')](_0x35ac33[_0xb808('0x36')][_0xb808('0x22')]);}_0x1aaff7[_0xb808('0x3f')]=qs['sort'](_0x35ac33[_0xb808('0x36')][_0xb808('0x40')]);_0x1aaff7['where']=qs[_0xb808('0x38')](_['pick'](_0x35ac33[_0xb808('0x36')],_0x3486a6[_0xb808('0x38')]),_0xb8769);if(_0x35ac33['query'][_0xb808('0x41')]){_0x1aaff7['where']=_[_0xb808('0x42')](_0x1aaff7[_0xb808('0x43')],{'$or':_['map'](_0xb8769,function(_0xfe2c25){if(_0xfe2c25[_0xb808('0x34')]!==_0xb808('0x44')){var _0x11b0e9={};_0x11b0e9[_0xfe2c25['name']]={'$like':'%'+_0x35ac33['query'][_0xb808('0x41')]+'%'};return _0x11b0e9;}})});}_0x1aaff7=_['merge']({},_0x1aaff7,_0x35ac33[_0xb808('0x45')]);var _0x1b3c94={'where':_0x1aaff7[_0xb808('0x43')]};return db[_0xb808('0x31')][_0xb808('0x25')](_0x1b3c94)['then'](function(_0x5e2c27){_0x998867[_0xb808('0x25')]=_0x5e2c27;if(_0x35ac33[_0xb808('0x36')][_0xb808('0x46')]){_0x1aaff7['include']=[{'all':!![]}];}return db[_0xb808('0x31')]['findAll'](_0x1aaff7);})[_0xb808('0x2a')](function(_0x1808ca){_0x998867[_0xb808('0x47')]=_0x1808ca;return _0x998867;})['then'](respondWithFilteredResult(_0x5ab75d,_0x1aaff7))[_0xb808('0x48')](handleError(_0x5ab75d,null));};exports[_0xb808('0x49')]=function(_0x403b83,_0x4dd181){var _0x197590={'raw':!![],'where':{'id':_0x403b83['params']['id']}},_0x1e8463={};_0x1e8463[_0xb808('0x35')]=_['keys'](db['Plugin'][_0xb808('0x32')]);_0x1e8463[_0xb808('0x36')]=_[_0xb808('0x37')](_0x403b83[_0xb808('0x36')]);_0x1e8463[_0xb808('0x38')]=_['intersection'](_0x1e8463[_0xb808('0x35')],_0x1e8463[_0xb808('0x36')]);_0x197590['attributes']=_[_0xb808('0x39')](_0x1e8463[_0xb808('0x35')],qs['fields'](_0x403b83[_0xb808('0x36')]['fields']));_0x197590[_0xb808('0x3b')]=_0x197590[_0xb808('0x3b')][_0xb808('0x3c')]?_0x197590[_0xb808('0x3b')]:_0x1e8463[_0xb808('0x35')];if(_0x403b83[_0xb808('0x36')]['includeAll']){_0x197590[_0xb808('0x4a')]=[{'all':!![]}];}_0x197590=_[_0xb808('0x42')]({},_0x197590,_0x403b83[_0xb808('0x45')]);return db['Plugin'][_0xb808('0x4b')](_0x197590)[_0xb808('0x2a')](handleEntityNotFound(_0x4dd181,null))[_0xb808('0x2a')](respondWithResult(_0x4dd181,null))[_0xb808('0x48')](handleError(_0x4dd181,null));};exports['download']=function(_0x3df877,_0x1573b9,_0x164b52){return db[_0xb808('0x31')]['find']({'where':{'id':_0x3df877[_0xb808('0x4c')]['id']},'attributes':[_0xb808('0x2f'),'path'],'raw':!![]})[_0xb808('0x2a')](handleEntityNotFound(_0x1573b9,null))[_0xb808('0x2a')](function(_0x2dea0f){if(_0x2dea0f){var _0x677d7e=path[_0xb808('0x4d')](config[_0xb808('0x4e')],'server/files/plugins',util[_0xb808('0x4f')](_0xb808('0x50'),path[_0xb808('0x51')](_0x2dea0f[_0xb808('0x5')])));var _0x1c7ebd=fs['createWriteStream'](_0x677d7e);var _0x4b0a31=archiver(_0xb808('0x52'),{'zlib':{'level':0x9}});_0x4b0a31['on']('warning',function(_0x267b57){if(_0x267b57[_0xb808('0x53')]==='ENOENT'){logger['error'](_0x267b57);}else{throw new db[(_0xb808('0x54'))][(_0xb808('0x55'))](_0xb808('0x56'));}});_0x4b0a31['on'](_0xb808('0x2d'),function(_0x1de38c){throw new db[(_0xb808('0x54'))][(_0xb808('0x55'))](_0xb808('0x56'));});_0x4b0a31['pipe'](_0x1c7ebd);_0x4b0a31[_0xb808('0x57')]('**/*',{'cwd':path['join'](config['root'],_0xb808('0x58'),path[_0xb808('0x59')](_0x2dea0f[_0xb808('0x5')])),'ignore':[path['join'](path[_0xb808('0x51')](_0x2dea0f[_0xb808('0x5')]),'node_modules/**/*'),path['join'](path[_0xb808('0x51')](_0x2dea0f[_0xb808('0x5')]),_0xb808('0x5a'))],'nodir':!![]})['finalize']();_0x1c7ebd['on']('close',function(){if(!fs[_0xb808('0x5b')](_0x677d7e)){throw new db[(_0xb808('0x54'))][(_0xb808('0x55'))](_0xb808('0x5c'));}return _0x1573b9[_0xb808('0x5d')](_0x677d7e,util[_0xb808('0x4f')](_0xb808('0x50'),path['basename'](_0x2dea0f['path'])),function(_0x57aa1d){if(_0x57aa1d){throw new db['Sequelize'][(_0xb808('0x55'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xb808('0x5e')](_0x677d7e);logger[_0xb808('0x5f')]('Download\x20completed');logger[_0xb808('0x5f')](_0xb808('0x60'));});});}return null;})['catch'](handleError(_0x1573b9,null));};exports['upload']=function(_0xf620e2,_0xd4166c,_0x427d96){var _0x179a96=path[_0xb808('0x51')](_0xf620e2[_0xb808('0x61')][_0xb808('0x62')],path[_0xb808('0x63')](_0xf620e2[_0xb808('0x61')][_0xb808('0x62')]));var _0x5609ca=path[_0xb808('0x4d')](config['root'],_0xb808('0x58'),_0xf620e2[_0xb808('0x61')][_0xb808('0x62')]);var _0x5e05e6=path[_0xb808('0x4d')](config[_0xb808('0x4e')],_0xb808('0x58'),_0x179a96);logger[_0xb808('0x5f')](_0xb808('0x64'),_0x5609ca);logger[_0xb808('0x5f')](_0xb808('0x65'),_0x5e05e6);try{fs[_0xb808('0x66')](_0x5609ca,parseInt('0777',0x8));extract(_0x5609ca,{'dir':_0x5e05e6},function(_0x1e8cec){if(_0x1e8cec){logger[_0xb808('0x2d')](_0x1e8cec);handleError(_0x1e8cec,!![]);};var _0x7a80c7=fs['readdirSync'](_0x5e05e6);if(_0x7a80c7[_0xb808('0x3c')]>0x1){removeReferences(_0x5609ca,_0x5e05e6);logger[_0xb808('0x2d')](_0xb808('0x67'));return _0x427d96(new Error(_0xb808('0x67')));}var _0x266abb=fs[_0xb808('0x68')](path[_0xb808('0x4d')](_0x5e05e6,_0x7a80c7[0x0]));if(_0x266abb['isFile']()){removeReferences(_0x5609ca,_0x5e05e6);logger[_0xb808('0x2d')](_0xb808('0x67'));return _0x427d96(new Error(_0xb808('0x67')));}if(_0x266abb['isDirectory']()){var _0x2a00e7=fs[_0xb808('0x69')](path[_0xb808('0x4d')](_0x5e05e6,_0x7a80c7[0x0]));if(_0x2a00e7[_0xb808('0x3c')]===0x0){removeReferences(_0x5609ca,_0x5e05e6);logger[_0xb808('0x2d')](_0xb808('0x67'));return _0x427d96(new Error('Invalid\x20plugin\x20structure'));}var _0x2a3c83=_0x2a00e7[_0xb808('0x6a')](function(_0x4e8a82){return _0x4e8a82===_0xb808('0x6b');});if(!_0x2a3c83){return _0x427d96(new Error('Plugin\x20manifest\x20missing'));}var _0x990425=fs[_0xb808('0x6c')](path[_0xb808('0x4d')](_0x5e05e6,_0x7a80c7[0x0],_0xb808('0x6b')));var _0x1d29d7=JSON[_0xb808('0x6d')](_0x990425);if(_0xb808('0x24')==typeof _0x1d29d7['name']){return _0x427d96(new Error(_0xb808('0x6e')));}if(_0xb808('0x24')==typeof _0x1d29d7[_0xb808('0x34')]){return _0x427d96(new Error(_0xb808('0x6f')));}if(_0xb808('0x24')==typeof _0x1d29d7[_0xb808('0x70')]){return _0x427d96(new Error(_0xb808('0x71')));}if('undefined'==typeof _0x1d29d7[_0xb808('0x72')]){return _0x427d96(new Error(_0xb808('0x73')));}if(_0x1d29d7['type']===_0xb808('0x74')){if(_0xb808('0x24')==typeof _0x1d29d7[_0xb808('0x72')][_0xb808('0x75')]){return _0x427d96(new Error(_0xb808('0x76')));}if(_0xb808('0x24')==typeof _0x1d29d7[_0xb808('0x72')][_0xb808('0x75')][_0xb808('0x77')]&&_0xb808('0x24')==typeof _0x1d29d7[_0xb808('0x72')][_0xb808('0x75')][_0xb808('0x78')]){return _0x427d96(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x1d29d7[_0xb808('0x34')]===_0xb808('0x79')){if('undefined'==typeof _0x1d29d7[_0xb808('0x72')][_0xb808('0x7a')]){return _0x427d96(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xb808('0x24')==typeof _0x1d29d7['parameters']['scriptPath']){return _0x427d96(new Error(_0xb808('0x7b')));}}else{return _0x427d96(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x2e582d=_0x1d29d7[_0xb808('0x2f')];var _0x4867bd=_0x1d29d7[_0xb808('0x7c')];var _0x2d822a=_0x1d29d7['type'];var _0x13e552=_0x1d29d7[_0xb808('0x7d')]?_0x1d29d7[_0xb808('0x7d')]:_0xb808('0x7e');var _0x1f2c2a=_0x1d29d7[_0xb808('0x7f')]?_0x1d29d7['icon']:'icon-apps';var _0x1036ed='';var _0x1f36d4='';var _0x186f21='';var _0x164964='';var _0x5520e4=_0x1d29d7[_0xb808('0x70')];if(_0x2d822a==='html'){if(_0xb808('0x24')!=typeof _0x1d29d7[_0xb808('0x72')][_0xb808('0x75')][_0xb808('0x77')]){var _0x2b10fa=_0x1d29d7[_0xb808('0x72')][_0xb808('0x75')][_0xb808('0x77')];if(!/^(f|ht)tps?:\/\//i[_0xb808('0x80')](_0x2b10fa)){_0x1036ed=path[_0xb808('0x4d')]('plugins',_0x179a96,_0x7a80c7[0x0],_0x2b10fa);}else{_0x1036ed=_0x2b10fa;}}else{logger[_0xb808('0x5f')](_0xb808('0x81'));}if(_0xb808('0x24')!=typeof _0x1d29d7[_0xb808('0x72')][_0xb808('0x75')]['agent']){var _0x47ca04=_0x1d29d7[_0xb808('0x72')][_0xb808('0x75')][_0xb808('0x78')];if(!/^(f|ht)tps?:\/\//i['test'](_0x47ca04)){_0x1f36d4=path[_0xb808('0x4d')]('plugins',_0x179a96,_0x7a80c7[0x0],_0x47ca04);}else{_0x1f36d4=_0x47ca04;}}else{logger[_0xb808('0x5f')](_0xb808('0x82'));}}else if(_0x2d822a==='script'){_0x186f21=_0x1d29d7[_0xb808('0x72')]['scriptName'];_0x164964=_0x1d29d7[_0xb808('0x72')][_0xb808('0x83')];if('undefined'!=typeof _0x1d29d7['parameters'][_0xb808('0x75')]){if(_0xb808('0x24')!=typeof _0x1d29d7[_0xb808('0x72')][_0xb808('0x75')][_0xb808('0x77')]){var _0x2b10fa=_0x1d29d7['parameters']['views'][_0xb808('0x77')];if(!/^(f|ht)tps?:\/\//i[_0xb808('0x80')](_0x2b10fa)){_0x1036ed=path[_0xb808('0x4d')](_0xb808('0x84'),_0x179a96,_0x7a80c7[0x0],_0x2b10fa);}else{_0x1036ed=_0x2b10fa;}}if('undefined'!=typeof _0x1d29d7[_0xb808('0x72')][_0xb808('0x75')]['agent']){var _0x47ca04=_0x1d29d7[_0xb808('0x72')][_0xb808('0x75')][_0xb808('0x78')];if(!/^(f|ht)tps?:\/\//i[_0xb808('0x80')](_0x47ca04)){_0x1f36d4=path['join'](_0xb808('0x84'),_0x179a96,_0x7a80c7[0x0],_0x47ca04);}else{_0x1f36d4=_0x47ca04;}}}}var _0x35b7e1={'name':_0x2e582d,'description':_0x4867bd,'path':path[_0xb808('0x4d')](_0x179a96,_0x7a80c7[0x0]),'type':_0x2d822a,'sidebar':_0x13e552,'icon':_0x1f2c2a,'adminUrl':_0x1036ed,'agentUrl':_0x1f36d4,'scriptName':_0x186f21,'scriptPath':_0x164964,'version':_0x5520e4};removeReferences(_0x5609ca,null);return db[_0xb808('0x31')]['create'](_0x35b7e1)[_0xb808('0x2a')](function(_0x78cf3f){var _0x3caf0d={'role':_0xf620e2['body'][_0xb808('0x85')],'userProfileId':_0xf620e2[_0xb808('0x86')][_0xb808('0x87')]};if(!_0x3caf0d)throw new Error(_0xb808('0x88'));if(_0x3caf0d['role']==='user'){var _0x34ce0a=_0x78cf3f['get']({'plain':!![]});return db['UserProfileSection'][_0xb808('0x4b')]({'where':{'name':'Plugins','userProfileId':_0x3caf0d[_0xb808('0x87')]},'raw':!![]})['then'](function(_0x3331d6){if(_0x3331d6&&_0x3331d6[_0xb808('0x89')]===0x0){return db['UserProfileResource'][_0xb808('0x8a')]({'name':_0x34ce0a[_0xb808('0x2f')],'resourceId':_0x34ce0a['id'],'type':_0x3331d6[_0xb808('0x2f')],'sectionId':_0x3331d6['id']},{})['then'](function(){return _0x78cf3f;});}else{return _0x78cf3f;}})[_0xb808('0x48')](function(_0xe9deb8){logger[_0xb808('0x2d')](_0xb808('0x8b'),_0xe9deb8);throw _0xe9deb8;});}return _0x78cf3f;})[_0xb808('0x2a')](respondWithResult(_0xd4166c,null))[_0xb808('0x48')](handleError(_0xd4166c,null));}});}catch(_0x14f2ee){_0xd4166c[_0xb808('0x20')](0x1f4)[_0xb808('0x8c')](_0x14f2ee);}};function removeReferences(_0xa660e4,_0x52ff49){try{if(_0xa660e4){fs[_0xb808('0x5e')](_0xa660e4);logger[_0xb808('0x5f')]('Zip\x20archive\x20removed');}if(_0x52ff49){rimraf(_0x52ff49,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x3f5cd3){logger['error'](_0x3f5cd3);}}exports[_0xb808('0x29')]=function(_0x335bef,_0xc4c20b,_0x4a5f90){return db[_0xb808('0x31')][_0xb808('0x4b')]({'where':{'id':_0x335bef['params']['id']}})[_0xb808('0x2a')](handleEntityNotFound(_0xc4c20b,null))[_0xb808('0x2a')](saveUpdates(_0x335bef[_0xb808('0x86')],null))['then'](respondWithResult(_0xc4c20b,null))[_0xb808('0x48')](handleError(_0xc4c20b,null));};exports[_0xb808('0x8d')]=function(_0x25cbc0,_0x4f7da8,_0xb146b){return db['Plugin'][_0xb808('0x4b')]({'where':{'id':_0x25cbc0[_0xb808('0x4c')]['id']}})[_0xb808('0x2a')](function(_0x5165b3){if(_0x5165b3){return _0x5165b3[_0xb808('0x2b')]();}})['then'](function(_0xd744d3){rimraf(path['join'](config[_0xb808('0x4e')],'server/files/plugins',path[_0xb808('0x59')](_0xd744d3[_0xb808('0x5')])),function(){});return _0xd744d3;})[_0xb808('0x2a')](handleEntityNotFound(_0x4f7da8,null))['then'](respondWithStatusCode(_0x4f7da8,null))['catch'](handleError(_0x4f7da8,null));};exports[_0xb808('0x8e')]=function(_0x248d90,_0x136851,_0x3b8af9){return BPromise[_0xb808('0x8f')]()['then'](function(){if(!_0x248d90['query'][_0xb808('0x5')]){throw new Error(_0xb808('0x90'));}if(!_0x248d90[_0xb808('0x36')][_0xb808('0x91')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x230f8f=_0x248d90[_0xb808('0x36')][_0xb808('0x92')]?_0x248d90[_0xb808('0x36')][_0xb808('0x92')]+':'+_0x248d90[_0xb808('0x36')][_0xb808('0x91')]:_0xb808('0x93')+_0x248d90[_0xb808('0x36')]['port'];var _0x55b9fc=_0x248d90[_0xb808('0x36')][_0xb808('0x21')]?_0x248d90[_0xb808('0x36')][_0xb808('0x21')]:!![];var _0x1a9d83=_0x248d90[_0xb808('0x36')][_0xb808('0x94')]?_0x248d90[_0xb808('0x36')][_0xb808('0x94')]:null;var _0x537901={'method':_0x248d90[_0xb808('0x95')],'uri':util['format'](_0xb808('0x96'),_0x230f8f,_0x248d90[_0xb808('0x36')][_0xb808('0x5')]),'json':_0x55b9fc,'resolveWithFullResponse':!![],'encoding':_0x1a9d83,'qs':_0x248d90['query']};if(_0x248d90['headers']){_0x537901[_0xb808('0x97')]=_0x248d90['headers'];if(_0x537901[_0xb808('0x97')]['content-length']){delete _0x537901[_0xb808('0x97')][_0xb808('0x98')];}}if(_0x537901[_0xb808('0x97')][_0xb808('0x99')]){delete _0x537901[_0xb808('0x97')][_0xb808('0x99')];}return rp(_0x537901);})[_0xb808('0x2a')](function(_0xf90c3f){if(_0xf90c3f){_0x136851['set'](_0xf90c3f[_0xb808('0x97')]);logger['info'](_0xf90c3f[_0xb808('0x86')]);if(_['endsWith'](_0x248d90[_0xb808('0x36')][_0xb808('0x5')],'download')&&_0xf90c3f[_0xb808('0x9a')]==0x1f4){return _0x136851[_0xb808('0x1e')](_0xf90c3f[_0xb808('0x9a')]);}else{return _0x136851[_0xb808('0x20')](_0xf90c3f[_0xb808('0x9a')])[_0xb808('0x8c')](_0xf90c3f[_0xb808('0x86')]);}}else{return _0x136851[_0xb808('0x1e')](0xc8);}})[_0xb808('0x48')](handleError(_0x136851,null));};exports[_0xb808('0x9b')]=function(_0x2ef43e,_0x3e9f42,_0x26bed4){return BPromise[_0xb808('0x8f')]()[_0xb808('0x2a')](function(){if(!_0x2ef43e[_0xb808('0x36')][_0xb808('0x5')]){throw new Error(_0xb808('0x90'));}if(!_0x2ef43e[_0xb808('0x36')][_0xb808('0x91')]){throw new Error(_0xb808('0x9c'));}var _0x5ed058=_0x2ef43e[_0xb808('0x36')]['hostname']?_0x2ef43e['query'][_0xb808('0x92')]+':'+_0x2ef43e[_0xb808('0x36')][_0xb808('0x91')]:_0xb808('0x93')+_0x2ef43e[_0xb808('0x36')][_0xb808('0x91')];var _0x5b772a=_0x2ef43e['query']['json']?_0x2ef43e['query'][_0xb808('0x21')]:!![];var _0x1978d9=_0x2ef43e[_0xb808('0x36')][_0xb808('0x94')]?_0x2ef43e[_0xb808('0x36')][_0xb808('0x94')]:null;var _0x465df6={'method':_0x2ef43e[_0xb808('0x95')],'uri':util[_0xb808('0x4f')](_0xb808('0x96'),_0x5ed058,_0x2ef43e[_0xb808('0x36')][_0xb808('0x5')]),'json':_0x5b772a,'resolveWithFullResponse':!![],'encoding':_0x1978d9,'body':_0x2ef43e[_0xb808('0x86')]};if(_0x2ef43e[_0xb808('0x97')]){_0x465df6[_0xb808('0x97')]=_0x2ef43e[_0xb808('0x97')];if(_0x465df6[_0xb808('0x97')]['content-length']){delete _0x465df6['headers'][_0xb808('0x98')];}}if(_0x465df6['headers']['content-type']){delete _0x465df6[_0xb808('0x97')][_0xb808('0x99')];}return rp(_0x465df6);})[_0xb808('0x2a')](function(_0x3a3a79){if(_0x3a3a79){_0x3e9f42[_0xb808('0x9d')](_0x3a3a79[_0xb808('0x97')]);logger[_0xb808('0x5f')](_0x3a3a79['body']);return _0x3e9f42['status'](_0x3a3a79['statusCode'])['send'](_0x3a3a79['body']);}else{return _0x3e9f42[_0xb808('0x1e')](0xc8);}})[_0xb808('0x48')](handleError(_0x3e9f42,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index f592569..efb6431 100644 --- a/server/api/plugin/plugin.events.js +++ b/server/api/plugin/plugin.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c94=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners'];(function(_0x2fb866,_0x59bc0c){var _0x5d310f=function(_0x13bf75){while(--_0x13bf75){_0x2fb866['push'](_0x2fb866['shift']());}};_0x5d310f(++_0x59bc0c);}(_0x3c94,0xcd));var _0x43c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3c94[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x43c9('0x0'));var Plugin=require(_0x43c9('0x1'))['db'][_0x43c9('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x43c9('0x3')](0x0);var events={'afterCreate':_0x43c9('0x4'),'afterUpdate':_0x43c9('0x5'),'afterDestroy':_0x43c9('0x6')};function emitEvent(_0x18159f){return function(_0x170a0d,_0x44fc3,_0x15ef71){PluginEvents[_0x43c9('0x7')](_0x18159f+':'+_0x170a0d['id'],_0x170a0d);PluginEvents['emit'](_0x18159f,_0x170a0d);_0x15ef71(null);};}for(var e in events){if(events[_0x43c9('0x8')](e)){var event=events[e];Plugin[_0x43c9('0x9')](e,emitEvent(event));}}module[_0x43c9('0xa')]=PluginEvents; \ No newline at end of file +var _0x6455=['exports','events','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1e1937,_0x594a86){var _0x55a29f=function(_0x9c9307){while(--_0x9c9307){_0x1e1937['push'](_0x1e1937['shift']());}};_0x55a29f(++_0x594a86);}(_0x6455,0x97));var _0x5645=function(_0x152508,_0x51e42a){_0x152508=_0x152508-0x0;var _0x49ab27=_0x6455[_0x152508];return _0x49ab27;};'use strict';var EventEmitter=require(_0x5645('0x0'));var Plugin=require('../../mysqldb')['db'][_0x5645('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x5645('0x2')](0x0);var events={'afterCreate':_0x5645('0x3'),'afterUpdate':_0x5645('0x4'),'afterDestroy':_0x5645('0x5')};function emitEvent(_0x35c21e){return function(_0x5388ff,_0x233875,_0x29cefe){PluginEvents[_0x5645('0x6')](_0x35c21e+':'+_0x5388ff['id'],_0x5388ff);PluginEvents[_0x5645('0x6')](_0x35c21e,_0x5388ff);_0x29cefe(null);};}for(var e in events){if(events[_0x5645('0x7')](e)){var event=events[e];Plugin[_0x5645('0x8')](e,emitEvent(event));}}module[_0x5645('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 55a0f1e..cd7aa60 100644 --- a/server/api/plugin/plugin.model.js +++ b/server/api/plugin/plugin.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46b7=['rimraf','../../config/environment','./plugin.attributes','define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x24e886,_0x117e1b){var _0x1aeea4=function(_0x56f8ca){while(--_0x56f8ca){_0x24e886['push'](_0x24e886['shift']());}};_0x1aeea4(++_0x117e1b);}(_0x46b7,0xf0));var _0x746b=function(_0x4e487c,_0x2f3e77){_0x4e487c=_0x4e487c-0x0;var _0x3acb9e=_0x46b7[_0x4e487c];return _0x3acb9e;};'use strict';var _=require(_0x746b('0x0'));var util=require(_0x746b('0x1'));var logger=require(_0x746b('0x2'))(_0x746b('0x3'));var moment=require(_0x746b('0x4'));var BPromise=require(_0x746b('0x5'));var rp=require(_0x746b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x746b('0x7'));var config=require(_0x746b('0x8'));var attributes=require(_0x746b('0x9'));module['exports']=function(_0x2e60b7,_0x4e6a0b){return _0x2e60b7[_0x746b('0xa')](_0x746b('0xb'),attributes,{'tableName':_0x746b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x45fd=['exports','define','Plugin','plugins','util','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x45fd,0xa4));var _0xd45f=function(_0x4e14ea,_0x596bdf){_0x4e14ea=_0x4e14ea-0x0;var _0x468a6c=_0x45fd[_0x4e14ea];return _0x468a6c;};'use strict';var _=require('lodash');var util=require(_0xd45f('0x0'));var logger=require(_0xd45f('0x1'))('api');var moment=require(_0xd45f('0x2'));var BPromise=require('bluebird');var rp=require(_0xd45f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd45f('0x4'));var config=require(_0xd45f('0x5'));var attributes=require('./plugin.attributes');module[_0xd45f('0x6')]=function(_0x2e762a,_0x474cdb){return _0x2e762a[_0xd45f('0x7')](_0xd45f('0x8'),attributes,{'tableName':_0xd45f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 559570a..ddfeb68 100644 --- a/server/api/plugin/plugin.rpc.js +++ b/server/api/plugin/plugin.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd21b=['stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','options','raw','then','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x119722,_0x3ae79c){var _0x4b0e0e=function(_0xcf7283){while(--_0xcf7283){_0x119722['push'](_0x119722['shift']());}};_0x4b0e0e(++_0x3ae79c);}(_0xd21b,0x9d));var _0xbd21=function(_0x2a9197,_0x5225eb){_0x2a9197=_0x2a9197-0x0;var _0x588c8a=_0xd21b[_0x2a9197];return _0x588c8a;};'use strict';var _=require('lodash');var util=require(_0xbd21('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbd21('0x1'));var fs=require('fs');var Redis=require(_0xbd21('0x2'));var db=require(_0xbd21('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd21('0x4'))(_0xbd21('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbd21('0x6')][_0xbd21('0x7')]({'port':0x232a});config[_0xbd21('0x8')]=_[_0xbd21('0x9')](config[_0xbd21('0x8')],{'host':_0xbd21('0xa'),'port':0x18eb});var socket=require(_0xbd21('0xb'))(new Redis(config[_0xbd21('0x8')]));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x1cf3dd,_0x110a45,_0x4f79c0){return new BPromise(function(_0x566a36,_0x361dc1){return client[_0xbd21('0xc')](_0x1cf3dd,_0x4f79c0)['then'](function(_0x828aad){logger[_0xbd21('0xd')](_0xbd21('0xe'),_0x110a45,_0xbd21('0xf'));logger[_0xbd21('0x10')]('Plugin,\x20%s,\x20%s,\x20%s',_0x110a45,_0xbd21('0xf'),JSON[_0xbd21('0x11')](_0x828aad));if(_0x828aad[_0xbd21('0x12')]){if(_0x828aad[_0xbd21('0x12')][_0xbd21('0x13')]===0x1f4){logger[_0xbd21('0x12')](_0xbd21('0xe'),_0x110a45,_0x828aad[_0xbd21('0x12')][_0xbd21('0x14')]);return _0x361dc1(_0x828aad[_0xbd21('0x12')][_0xbd21('0x14')]);}logger[_0xbd21('0x12')](_0xbd21('0xe'),_0x110a45,_0x828aad[_0xbd21('0x12')][_0xbd21('0x14')]);return _0x566a36(_0x828aad[_0xbd21('0x12')][_0xbd21('0x14')]);}else{logger[_0xbd21('0xd')]('Plugin,\x20%s,\x20%s',_0x110a45,_0xbd21('0xf'));_0x566a36(_0x828aad[_0xbd21('0x15')][_0xbd21('0x14')]);}})[_0xbd21('0x16')](function(_0x50714c){logger[_0xbd21('0x12')]('Plugin,\x20%s,\x20%s',_0x110a45,_0x50714c);_0x361dc1(_0x50714c);});});}exports[_0xbd21('0x17')]=function(_0x4c6321){var _0x4967d0=this;return new Promise(function(_0x53ba6a,_0x345dd6){return db[_0xbd21('0x18')][_0xbd21('0x19')](_0x4c6321['body'],{'raw':_0x4c6321['options']?_0x4c6321[_0xbd21('0x1a')][_0xbd21('0x1b')]===undefined?!![]:![]:!![]})[_0xbd21('0x1c')](function(_0x31129e){logger[_0xbd21('0xd')](_0xbd21('0x17'),_0x4c6321);logger['debug'](_0xbd21('0x17'),_0x4c6321,JSON[_0xbd21('0x11')](_0x31129e));_0x53ba6a(_0x31129e);})[_0xbd21('0x16')](function(_0x235ef9){logger[_0xbd21('0x12')](_0xbd21('0x17'),_0x235ef9[_0xbd21('0x14')],_0x4c6321);_0x345dd6(_0x4967d0[_0xbd21('0x12')](0x1f4,_0x235ef9[_0xbd21('0x14')]));});});}; \ No newline at end of file +var _0x22d7=['debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','stringify','lodash','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent'];(function(_0x3ba748,_0x4b8fb9){var _0x5b04e2=function(_0x16bb9e){while(--_0x16bb9e){_0x3ba748['push'](_0x3ba748['shift']());}};_0x5b04e2(++_0x4b8fb9);}(_0x22d7,0x158));var _0x722d=function(_0x43c223,_0x2d61d9){_0x43c223=_0x43c223-0x0;var _0x2299a7=_0x22d7[_0x43c223];return _0x2299a7;};'use strict';var _=require(_0x722d('0x0'));var util=require('util');var moment=require(_0x722d('0x1'));var BPromise=require(_0x722d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x722d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x722d('0x4'));var config=require(_0x722d('0x5'));var jayson=require(_0x722d('0x6'));var client=jayson[_0x722d('0x7')][_0x722d('0x8')]({'port':0x232a});config[_0x722d('0x9')]=_[_0x722d('0xa')](config[_0x722d('0x9')],{'host':_0x722d('0xb'),'port':0x18eb});var socket=require(_0x722d('0xc'))(new Redis(config[_0x722d('0x9')]));require('./plugin.socket')[_0x722d('0xd')](socket);function respondWithRpcPromise(_0x1dec24,_0x5c9de6,_0x25fe7f){return new BPromise(function(_0x4757f3,_0x307a16){return client[_0x722d('0xe')](_0x1dec24,_0x25fe7f)[_0x722d('0xf')](function(_0x63fcdc){logger[_0x722d('0x10')](_0x722d('0x11'),_0x5c9de6,_0x722d('0x12'));logger[_0x722d('0x13')](_0x722d('0x14'),_0x5c9de6,'request\x20sent',JSON['stringify'](_0x63fcdc));if(_0x63fcdc[_0x722d('0x15')]){if(_0x63fcdc[_0x722d('0x15')][_0x722d('0x16')]===0x1f4){logger['error'](_0x722d('0x11'),_0x5c9de6,_0x63fcdc[_0x722d('0x15')][_0x722d('0x17')]);return _0x307a16(_0x63fcdc[_0x722d('0x15')][_0x722d('0x17')]);}logger[_0x722d('0x15')]('Plugin,\x20%s,\x20%s',_0x5c9de6,_0x63fcdc[_0x722d('0x15')][_0x722d('0x17')]);return _0x4757f3(_0x63fcdc['error'][_0x722d('0x17')]);}else{logger[_0x722d('0x10')](_0x722d('0x11'),_0x5c9de6,'request\x20sent');_0x4757f3(_0x63fcdc[_0x722d('0x18')][_0x722d('0x17')]);}})[_0x722d('0x19')](function(_0x3544d0){logger[_0x722d('0x15')](_0x722d('0x11'),_0x5c9de6,_0x3544d0);_0x307a16(_0x3544d0);});});}exports[_0x722d('0x1a')]=function(_0x38912f){var _0x23524e=this;return new Promise(function(_0x37d318,_0x1b51a2){return db[_0x722d('0x1b')][_0x722d('0x1c')](_0x38912f[_0x722d('0x1d')],{'raw':_0x38912f[_0x722d('0x1e')]?_0x38912f[_0x722d('0x1e')][_0x722d('0x1f')]===undefined?!![]:![]:!![]})[_0x722d('0xf')](function(_0x59a8ac){logger[_0x722d('0x10')](_0x722d('0x1a'),_0x38912f);logger['debug'](_0x722d('0x1a'),_0x38912f,JSON[_0x722d('0x20')](_0x59a8ac));_0x37d318(_0x59a8ac);})[_0x722d('0x19')](function(_0x509bac){logger[_0x722d('0x15')](_0x722d('0x1a'),_0x509bac[_0x722d('0x17')],_0x38912f);_0x1b51a2(_0x23524e['error'](0x1f4,_0x509bac[_0x722d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 2f3da69..2e8bb6f 100644 --- a/server/api/plugin/plugin.socket.js +++ b/server/api/plugin/plugin.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe68c=['./plugin.events','save','remove','update','removeListener','register','length'];(function(_0x331447,_0x7c0eea){var _0x397521=function(_0x4fd489){while(--_0x4fd489){_0x331447['push'](_0x331447['shift']());}};_0x397521(++_0x7c0eea);}(_0xe68c,0x118));var _0xce68=function(_0x10a7b2,_0x37587c){_0x10a7b2=_0x10a7b2-0x0;var _0x5cf00e=_0xe68c[_0x10a7b2];return _0x5cf00e;};'use strict';var PluginEvents=require(_0xce68('0x0'));var events=[_0xce68('0x1'),_0xce68('0x2'),_0xce68('0x3')];function createListener(_0x2d4b6b,_0x23862d){return function(_0x1c10be){_0x23862d['emit'](_0x2d4b6b,_0x1c10be);};}function removeListener(_0x53e07f,_0x3453d7){return function(){PluginEvents[_0xce68('0x4')](_0x53e07f,_0x3453d7);};}exports[_0xce68('0x5')]=function(_0x5a0743){for(var _0x2e37ae=0x0,_0x453a19=events[_0xce68('0x6')];_0x2e37ae<_0x453a19;_0x2e37ae++){var _0x465e83=events[_0x2e37ae];var _0x4aaec6=createListener('plugin:'+_0x465e83,_0x5a0743);PluginEvents['on'](_0x465e83,_0x4aaec6);}}; \ No newline at end of file +var _0xa0e0=['update','emit','removeListener','length','plugin:','./plugin.events','save','remove'];(function(_0x2c30dc,_0x4800ce){var _0x47ce7d=function(_0x21ecca){while(--_0x21ecca){_0x2c30dc['push'](_0x2c30dc['shift']());}};_0x47ce7d(++_0x4800ce);}(_0xa0e0,0x1d5));var _0x0a0e=function(_0x2b3ddc,_0x24cd5b){_0x2b3ddc=_0x2b3ddc-0x0;var _0x55f672=_0xa0e0[_0x2b3ddc];return _0x55f672;};'use strict';var PluginEvents=require(_0x0a0e('0x0'));var events=[_0x0a0e('0x1'),_0x0a0e('0x2'),_0x0a0e('0x3')];function createListener(_0x4533e0,_0x54e863){return function(_0xfb27e7){_0x54e863[_0x0a0e('0x4')](_0x4533e0,_0xfb27e7);};}function removeListener(_0x518af4,_0x5f4742){return function(){PluginEvents[_0x0a0e('0x5')](_0x518af4,_0x5f4742);};}exports['register']=function(_0x12c5e4){for(var _0x457158=0x0,_0x3dd4ce=events[_0x0a0e('0x6')];_0x457158<_0x3dd4ce;_0x457158++){var _0x3086e2=events[_0x457158];var _0x46cbd5=createListener(_0x0a0e('0x7')+_0x3086e2,_0x12c5e4);PluginEvents['on'](_0x3086e2,_0x46cbd5);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index ac2c711..cac07b0 100644 --- a/server/api/pm2/index.js +++ b/server/api/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x217e8d,_0x6c599f){var _0x44d7e6=function(_0x351cee){while(--_0x351cee){_0x217e8d['push'](_0x217e8d['shift']());}};_0x44d7e6(++_0x6c599f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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(_0x827cc1,_0x2bb68b){var _0x22d273=function(_0x2b93c3){while(--_0x2b93c3){_0x827cc1['push'](_0x827cc1['shift']());}};_0x22d273(++_0x2bb68b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index f7823bc..4ffdafc 100644 --- a/server/api/pm2/pm2.controller.js +++ b/server/api/pm2/pm2.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55e0=['hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','exec','bluebird','sendStatus','json','error','name','status','send','info','index','then','reject','express','motion2','catch','show','params','body','script','join','../../files/plugins','cwd','dirname','chdir','dump','Missing\x20name\x20and/or\x20path','update','restart'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x55e0,0xdc));var _0x055e=function(_0x566715,_0x1d45c3){_0x566715=_0x566715-0x0;var _0xf089e7=_0x55e0[_0x566715];return _0xf089e7;};'use strict';var _=require(_0x055e('0x0'));var pm2=require(_0x055e('0x1'));var logger=require(_0x055e('0x2'))(_0x055e('0x3'));var path=require('path');var exec=require('child_process')[_0x055e('0x4')];var BPromise=require(_0x055e('0x5'));function handleEntityNotFound(_0x33cd7b,_0x2773e4){return function(_0x157473){if(!_0x157473){_0x33cd7b[_0x055e('0x6')](0x194);;}return _0x157473;};}function respondWithResult(_0x490ee1,_0x5239f6){_0x5239f6=_0x5239f6||0xc8;return function(_0x4384ff){if(_0x4384ff){return _0x490ee1['status'](_0x5239f6)[_0x055e('0x7')](_0x4384ff);}return null;};}function handleError(_0x3c4cf,_0x376618){_0x376618=_0x376618||0x1f4;return function(_0x230c32){logger[_0x055e('0x8')](_0x230c32['stack']);if(_0x230c32[_0x055e('0x9')]){delete _0x230c32[_0x055e('0x9')];}_0x3c4cf[_0x055e('0xa')](_0x376618)[_0x055e('0xb')](_0x230c32);};}function execChildProcess(){return new BPromise(function(_0x238068,_0x5237d9){exec('npm\x20install',function(_0x187cce,_0x51c524,_0x3c44b2){logger[_0x055e('0xc')](_0x51c524);logger[_0x055e('0xc')](_0x3c44b2);if(_0x187cce){logger[_0x055e('0x8')](_0x187cce);return _0x5237d9(_0x187cce);}return _0x238068(_0x51c524);});});}exports[_0x055e('0xd')]=function(_0x31c649,_0x236a2b){return pm2['list']()[_0x055e('0xe')](function(_0xb80d83){if(_0xb80d83){var _0x3cfd14=_[_0x055e('0xf')](_0xb80d83,function(_0x222817){return _0x222817['name']===_0x055e('0x10')||_0x222817[_0x055e('0x9')]===_0x055e('0x11');});return{'rows':_0x3cfd14,'count':_0x3cfd14['length']};}return null;})[_0x055e('0xe')](respondWithResult(_0x236a2b,null))[_0x055e('0x12')](handleError(_0x236a2b,null));};exports[_0x055e('0x13')]=function(_0x2bad86,_0x2cc84e){return pm2['describe'](_0x2bad86[_0x055e('0x14')]['id'])[_0x055e('0xe')](respondWithResult(_0x2cc84e,null))[_0x055e('0xe')](handleEntityNotFound(_0x2cc84e,null))[_0x055e('0x12')](handleError(_0x2cc84e,null));};exports['create']=function(_0x4004ce,_0x3cdd68){if(_0x4004ce['body'][_0x055e('0x9')]&&_0x4004ce[_0x055e('0x15')][_0x055e('0x16')]){var _0x124d86=path[_0x055e('0x17')](__dirname,_0x055e('0x18'),_0x4004ce['body'][_0x055e('0x16')]);var _0x2f0346=process[_0x055e('0x19')]();process['chdir'](path[_0x055e('0x1a')](_0x124d86));return execChildProcess()[_0x055e('0xe')](function(_0x32c64e){process[_0x055e('0x1b')](_0x2f0346);return pm2['start']({'name':_0x4004ce[_0x055e('0x15')]['name'],'script':_0x124d86});})[_0x055e('0xe')](function(_0x42a6aa){pm2[_0x055e('0x1c')]();return _0x42a6aa[0x0];})[_0x055e('0xe')](respondWithResult(_0x3cdd68,0xc9))[_0x055e('0x12')](handleError(_0x3cdd68,null));}else{return _0x3cdd68[_0x055e('0xa')](0x1f4)['send']({'message':_0x055e('0x1d')});}};exports[_0x055e('0x1e')]=function(_0x2a82f8,_0x4b5891){if(_0x2a82f8[_0x055e('0x15')]['id']){delete _0x2a82f8[_0x055e('0x15')]['id'];}var _0x42f2df={'online':_0x055e('0x1f'),'stopped':'stop'};if(_0x42f2df[_0x055e('0x20')](_0x2a82f8['body'][_0x055e('0xa')])){return pm2[_0x42f2df[_0x2a82f8[_0x055e('0x15')][_0x055e('0xa')]]](_0x2a82f8[_0x055e('0x14')]['id'])[_0x055e('0xe')](respondWithResult(_0x4b5891,0xc8))['catch'](handleError(_0x4b5891,null));}else{return _0x4b5891[_0x055e('0xa')](0x1f4)[_0x055e('0xb')]({'message':_0x055e('0x21')});}};exports[_0x055e('0x22')]=function(_0x36abb2,_0x225c88){if(_0x36abb2[_0x055e('0x15')]['id']){delete _0x36abb2[_0x055e('0x15')]['id'];}if(_0x36abb2['params']['id']){return pm2[_0x055e('0x23')](_0x36abb2[_0x055e('0x14')]['id'])['then'](function(_0xd9298d){pm2[_0x055e('0x1c')]();return _0xd9298d[0x0];})[_0x055e('0xe')](respondWithResult(_0x225c88,null))[_0x055e('0x12')](handleError(_0x225c88,null));}else{return _0x225c88[_0x055e('0xa')](0x1f4)[_0x055e('0xb')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x2750=['exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','list','then','motion2','catch','body','script','../../files/plugins','cwd','dirname','chdir','dump','Missing\x20name\x20and/or\x20path','stop','hasOwnProperty','params','Unknown\x20status','destroy','lodash','../../config/logger','api','path','child_process'];(function(_0x3ede90,_0xbb015f){var _0x3a34ef=function(_0x2025b0){while(--_0x2025b0){_0x3ede90['push'](_0x3ede90['shift']());}};_0x3a34ef(++_0xbb015f);}(_0x2750,0x13b));var _0x0275=function(_0x472dfd,_0x207c94){_0x472dfd=_0x472dfd-0x0;var _0x7f80a8=_0x2750[_0x472dfd];return _0x7f80a8;};'use strict';var _=require(_0x0275('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var path=require(_0x0275('0x3'));var exec=require(_0x0275('0x4'))[_0x0275('0x5')];var BPromise=require(_0x0275('0x6'));function handleEntityNotFound(_0x20273d,_0x4960){return function(_0x3d0c9c){if(!_0x3d0c9c){_0x20273d[_0x0275('0x7')](0x194);;}return _0x3d0c9c;};}function respondWithResult(_0x5953f9,_0x3f645f){_0x3f645f=_0x3f645f||0xc8;return function(_0x2421fd){if(_0x2421fd){return _0x5953f9[_0x0275('0x8')](_0x3f645f)[_0x0275('0x9')](_0x2421fd);}return null;};}function handleError(_0x4dffd1,_0x1f7c4a){_0x1f7c4a=_0x1f7c4a||0x1f4;return function(_0x30632d){logger[_0x0275('0xa')](_0x30632d['stack']);if(_0x30632d['name']){delete _0x30632d[_0x0275('0xb')];}_0x4dffd1['status'](_0x1f7c4a)[_0x0275('0xc')](_0x30632d);};}function execChildProcess(){return new BPromise(function(_0x377087,_0x14f68c){exec(_0x0275('0xd'),function(_0x14bc3e,_0x5ae208,_0x2e8723){logger[_0x0275('0xe')](_0x5ae208);logger[_0x0275('0xe')](_0x2e8723);if(_0x14bc3e){logger['error'](_0x14bc3e);return _0x14f68c(_0x14bc3e);}return _0x377087(_0x5ae208);});});}exports['index']=function(_0x292f93,_0x395398){return pm2[_0x0275('0xf')]()[_0x0275('0x10')](function(_0x28827b){if(_0x28827b){var _0x36921c=_['reject'](_0x28827b,function(_0x3e0791){return _0x3e0791[_0x0275('0xb')]==='express'||_0x3e0791[_0x0275('0xb')]===_0x0275('0x11');});return{'rows':_0x36921c,'count':_0x36921c['length']};}return null;})[_0x0275('0x10')](respondWithResult(_0x395398,null))[_0x0275('0x12')](handleError(_0x395398,null));};exports['show']=function(_0x5e7466,_0x56e719){return pm2['describe'](_0x5e7466['params']['id'])[_0x0275('0x10')](respondWithResult(_0x56e719,null))[_0x0275('0x10')](handleEntityNotFound(_0x56e719,null))[_0x0275('0x12')](handleError(_0x56e719,null));};exports['create']=function(_0x7075c9,_0x30730a){if(_0x7075c9[_0x0275('0x13')]['name']&&_0x7075c9[_0x0275('0x13')][_0x0275('0x14')]){var _0x575786=path['join'](__dirname,_0x0275('0x15'),_0x7075c9[_0x0275('0x13')][_0x0275('0x14')]);var _0x592a53=process[_0x0275('0x16')]();process['chdir'](path[_0x0275('0x17')](_0x575786));return execChildProcess()['then'](function(_0x26f2c2){process[_0x0275('0x18')](_0x592a53);return pm2['start']({'name':_0x7075c9[_0x0275('0x13')][_0x0275('0xb')],'script':_0x575786});})[_0x0275('0x10')](function(_0x52946b){pm2[_0x0275('0x19')]();return _0x52946b[0x0];})[_0x0275('0x10')](respondWithResult(_0x30730a,0xc9))[_0x0275('0x12')](handleError(_0x30730a,null));}else{return _0x30730a[_0x0275('0x8')](0x1f4)[_0x0275('0xc')]({'message':_0x0275('0x1a')});}};exports['update']=function(_0x35343c,_0x14d7d8){if(_0x35343c[_0x0275('0x13')]['id']){delete _0x35343c[_0x0275('0x13')]['id'];}var _0x4689a3={'online':'restart','stopped':_0x0275('0x1b')};if(_0x4689a3[_0x0275('0x1c')](_0x35343c[_0x0275('0x13')][_0x0275('0x8')])){return pm2[_0x4689a3[_0x35343c[_0x0275('0x13')]['status']]](_0x35343c[_0x0275('0x1d')]['id'])[_0x0275('0x10')](respondWithResult(_0x14d7d8,0xc8))[_0x0275('0x12')](handleError(_0x14d7d8,null));}else{return _0x14d7d8['status'](0x1f4)['send']({'message':_0x0275('0x1e')});}};exports[_0x0275('0x1f')]=function(_0x5dc2bc,_0x7eff96){if(_0x5dc2bc[_0x0275('0x13')]['id']){delete _0x5dc2bc[_0x0275('0x13')]['id'];}if(_0x5dc2bc[_0x0275('0x1d')]['id']){return pm2['delete'](_0x5dc2bc[_0x0275('0x1d')]['id'])[_0x0275('0x10')](function(_0x3bba47){pm2[_0x0275('0x19')]();return _0x3bba47[0x0];})['then'](respondWithResult(_0x7eff96,null))[_0x0275('0x12')](handleError(_0x7eff96,null));}else{return _0x7eff96['status'](0x1f4)[_0x0275('0xc')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index faca8e3..e00e053 100644 --- a/server/api/realtime/index.js +++ b/server/api/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4770=['get','/agents','isAuthenticated','getAgents','/queues','express','Router','../../components/auth/service','./realtime.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4770,0xe6));var _0x0477=function(_0x3e1362,_0x44d880){_0x3e1362=_0x3e1362-0x0;var _0xad09b8=_0x4770[_0x3e1362];return _0xad09b8;};'use strict';var express=require(_0x0477('0x0'));var router=express[_0x0477('0x1')]();var auth=require(_0x0477('0x2'));var controller=require(_0x0477('0x3'));router[_0x0477('0x4')](_0x0477('0x5'),auth[_0x0477('0x6')](),controller[_0x0477('0x7')]);router[_0x0477('0x4')](_0x0477('0x8'),auth[_0x0477('0x6')](),controller['getQueues']);module['exports']=router; \ No newline at end of file +var _0x8a0c=['Router','../../components/auth/service','./realtime.controller','get','/agents','getAgents','/queues','isAuthenticated','getQueues','exports','express'];(function(_0x2d4f4b,_0x4cb227){var _0x48c35d=function(_0x43e6ab){while(--_0x43e6ab){_0x2d4f4b['push'](_0x2d4f4b['shift']());}};_0x48c35d(++_0x4cb227);}(_0x8a0c,0x1ac));var _0xc8a0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8a0c[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0xc8a0('0x0'));var router=express[_0xc8a0('0x1')]();var auth=require(_0xc8a0('0x2'));var controller=require(_0xc8a0('0x3'));router[_0xc8a0('0x4')](_0xc8a0('0x5'),auth['isAuthenticated'](),controller[_0xc8a0('0x6')]);router[_0xc8a0('0x4')](_0xc8a0('0x7'),auth[_0xc8a0('0x8')](),controller[_0xc8a0('0x9')]);module[_0xc8a0('0xa')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 854bfcc..9423719 100644 --- a/server/api/realtime/realtime.controller.js +++ b/server/api/realtime/realtime.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea82=['userProfileId','Agents','online','extraQueryConditions','omit','UserProfile','getResources','map','find','filterAgentAttributes','voice','voiceStatus','talking','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch','fields','name','outbound','dialActive','dialMethod','join','getOptions','QueueCampaigns','startCase','assign','findAndCountAll','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','handleError','undefined','count','offset','status','set','Content-Range','json','getAgents','query','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','order','then','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','User','rawAttributes','fieldName','type','key','role','raw','push','sequelize','FIELD(id,','forEach','Pause','where','merge','user'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xea82,0xc4));var _0x2ea8=function(_0x2980d0,_0x5265db){_0x2980d0=_0x2980d0-0x0;var _0x16da7d=_0xea82[_0x2980d0];return _0x16da7d;};'use strict';var _=require(_0x2ea8('0x0'));var util=require(_0x2ea8('0x1'));var rta=require(_0x2ea8('0x2'));var rtq=require(_0x2ea8('0x3'));var qs=require(_0x2ea8('0x4'));var utils=require(_0x2ea8('0x5'));var db=require(_0x2ea8('0x6'))['db'];var APIBadRequestError=require('../../errors/api')['APIBadRequestError'];var APIHandleError=require(_0x2ea8('0x7'))[_0x2ea8('0x8')];function respondWithFilteredResult(_0x30de81,_0x94a80){return function(_0x3c8f9f){if(_0x3c8f9f){var _0x5e1f4c=typeof _0x94a80['offset']===_0x2ea8('0x9')&&typeof _0x94a80['limit']===_0x2ea8('0x9');var _0x2117ed=_0x3c8f9f[_0x2ea8('0xa')];var _0x5d19f0=_0x5e1f4c?0x0:_0x94a80['offset'];var _0x239dc2=_0x5e1f4c?_0x3c8f9f[_0x2ea8('0xa')]:_0x94a80[_0x2ea8('0xb')]+_0x94a80['limit'];var _0x1c843e;if(_0x239dc2>=_0x2117ed){_0x239dc2=_0x2117ed;_0x1c843e=0xc8;}else{_0x1c843e=0xce;}_0x30de81[_0x2ea8('0xc')](_0x1c843e);return _0x30de81[_0x2ea8('0xd')](_0x2ea8('0xe'),_0x5d19f0+'-'+_0x239dc2+'/'+_0x2117ed)[_0x2ea8('0xf')](_0x3c8f9f);}return null;};}exports[_0x2ea8('0x10')]=function(_0x559a0d,_0x3af1c9){var _0xc93c9={'count':0x0,'rows':[]};var _0x16af22={};var _0x14676b;var _0x1144c1=utils['getChannels']();var _0x2401e3;var _0xd3b8ac;var _0x1e49af=_0x559a0d[_0x2ea8('0x11')]['globalQueueFilter'];var _0x2f6049=_0x559a0d[_0x2ea8('0x11')][_0x2ea8('0x12')];var _0x3324da=_0x559a0d['query'][_0x2ea8('0x13')];var _0x330532=_0x2f6049===_0x2ea8('0x14')||_0x2f6049===_0x2ea8('0x15')?!![]:![];var _0x54ca77=[];var _0x4c04aa;var _0x26dbe9;Promise[_0x2ea8('0x16')]()['then'](function(){if(_0x559a0d[_0x2ea8('0x11')]['channel']){if(!utils['isValidChannel'](_0x559a0d['query'][_0x2ea8('0x17')])){throw new APIBadRequestError(util[_0x2ea8('0x18')](_0x2ea8('0x19'),_0x559a0d[_0x2ea8('0x11')][_0x2ea8('0x17')]));}_0x14676b=_0x559a0d[_0x2ea8('0x11')][_0x2ea8('0x17')][_0x2ea8('0x1a')]();}if(!_0x559a0d[_0x2ea8('0x11')][_0x2ea8('0x1b')]||!_0x559a0d[_0x2ea8('0x11')][_0x2ea8('0x1b')][_0x2ea8('0x1c')](_0x2ea8('0x1d'))){_0x559a0d[_0x2ea8('0x11')][_0x2ea8('0x1b')]=rta[_0x2ea8('0x1e')](_0x559a0d[_0x2ea8('0x11')][_0x2ea8('0x1b')]);return;}var _0x5cdf6f=rta[_0x2ea8('0x1f')](_0x559a0d[_0x2ea8('0x11')][_0x2ea8('0x1b')]);_0x559a0d[_0x2ea8('0x11')]['sort']=_0x5cdf6f['fields']['join'](',');_0x4c04aa=_0x5cdf6f[_0x2ea8('0x20')];})[_0x2ea8('0x21')](function(){if(!_0x1e49af){return[];}return rta['getAgentIdsByQueues'](_0x1e49af,_0x14676b);})[_0x2ea8('0x21')](function(_0x448e2a){_0x54ca77=_0x448e2a;return rta['getRealtimeAgents']();})['then'](function(_0x3f8ad6){_0xd3b8ac=_0x3f8ad6[_0x2ea8('0x22')];if((!_0x2f6049||_0x330532)&&!_0x4c04aa){return _0x54ca77;}if(_0x4c04aa&&!_0x2f6049){return rta[_0x2ea8('0x23')](_0xd3b8ac,_0x54ca77,_0x4c04aa);}else{return rta[_0x2ea8('0x24')](_0xd3b8ac,_0x54ca77,_0x2f6049);}})[_0x2ea8('0x21')](function(_0x28eba4){_0x54ca77=_0x28eba4;var _0x40c66a=![];if(_0x54ca77[_0x2ea8('0x25')]===0x0){if(_0x1e49af||_0x2f6049){_0x40c66a=!![];}if(_0x330532){_0x40c66a=![];}}if(_0x40c66a){return _0xc93c9;}var _0x14d7fe=_['map'](db[_0x2ea8('0x26')][_0x2ea8('0x27')],function(_0x4c14bf){return{'name':_0x4c14bf[_0x2ea8('0x28')],'type':_0x4c14bf[_0x2ea8('0x29')][_0x2ea8('0x2a')]};});_0x559a0d[_0x2ea8('0x11')][_0x2ea8('0x2b')]='agent';_0x16af22=qs['getOptions'](_0x14d7fe,_0x559a0d);_0x16af22[_0x2ea8('0x2c')]=!![];var _0x5cb314=[];if(_0x54ca77[_0x2ea8('0x25')]>0x0){_0x5cb314[_0x2ea8('0x2d')]({'id':{'$in':_0x54ca77}});if(_0x4c04aa&&!_0x2f6049){_0x26dbe9=[db[_0x2ea8('0x2e')]['literal'](_0x2ea8('0x2f')+_0x54ca77+')')];_0x16af22[_0x2ea8('0x20')]=_0x26dbe9;}}if(_0x330532){_0x1144c1[_0x2ea8('0x30')](function(_0x2af0e8){var _0x49b761=!![];if(_0x2f6049===_0x2ea8('0x15')&&_0x14676b!==_0x2af0e8){_0x49b761=![];}_0x5cb314[_0x2ea8('0x2d')]({[_0x2af0e8+_0x2ea8('0x31')]:_0x49b761});});if(_0x3324da){_0x5cb314['push']({'pauseType':_0x3324da});}}else if(_0x2f6049){_0x1144c1['forEach'](function(_0x27bc89){_0x5cb314[_0x2ea8('0x2d')]({[_0x27bc89+_0x2ea8('0x31')]:![]});});}_0x16af22[_0x2ea8('0x32')]=_[_0x2ea8('0x33')](_0x16af22[_0x2ea8('0x32')],{'$and':_0x5cb314});if(_0x559a0d[_0x2ea8('0x34')][_0x2ea8('0x2b')]===_0x2ea8('0x34')){var _0x141d94={'params':{'id':_0x559a0d[_0x2ea8('0x34')][_0x2ea8('0x35')]},'query':{'section':_0x2ea8('0x36'),'role':'agent','raw':!![],'ids':_0x54ca77,'customSorting':_0x26dbe9}};if(_0x559a0d['query'][_0x2ea8('0x37')]){_0x141d94[_0x2ea8('0x11')][_0x2ea8('0x37')]=!![];}if(_0x330532){_0x141d94[_0x2ea8('0x11')][_0x2ea8('0x38')]=_0x5cb314;}_0x141d94[_0x2ea8('0x11')]=Object['assign'](_0x141d94['query'],_[_0x2ea8('0x39')](_0x559a0d[_0x2ea8('0x11')],'id'));return db[_0x2ea8('0x3a')][_0x2ea8('0x3b')](_0x141d94);}return db['User']['findAndCountAll'](_0x16af22);})[_0x2ea8('0x21')](function(_0x189fc4){_0xc93c9[_0x2ea8('0xa')]=_0x189fc4[_0x2ea8('0xa')];_0x2401e3=_0x189fc4[_0x2ea8('0x22')];return _0x2401e3[_0x2ea8('0x3c')](function(_0xe21b9d){var _0x55391f=_[_0x2ea8('0x3d')](_0xd3b8ac,['id',_0xe21b9d['id']]);if(_0x55391f){var _0x4d5fe2=rta[_0x2ea8('0x3e')](_0x55391f);_[_0x2ea8('0x33')](_0xe21b9d,_0x4d5fe2);}_0xe21b9d[_0x2ea8('0x1d')]=rta['getAgentStatus'](_0xe21b9d);if(_0xe21b9d[_0x2ea8('0x1d')][_0x2ea8('0x1c')](_0x2ea8('0x14'))){_0x1144c1['forEach'](function(_0x55423d){if(_0xe21b9d[_0x55423d+_0x2ea8('0x31')]){if(_0x55423d===_0x2ea8('0x3f')){if(_0xe21b9d[_0x2ea8('0x40')]!==_0x2ea8('0x41')){_0xe21b9d[_0x2ea8('0x40')]=_0x2ea8('0x14');}}else{_0xe21b9d[_0x55423d+'Status']='pause';}}});}return _0xe21b9d;});})[_0x2ea8('0x21')](function(_0x2f973e){if(!_0x4c04aa||_0x26dbe9){return _0x2f973e;}return rta[_0x2ea8('0x42')](_0x2f973e,_0x4c04aa);})['then'](function(_0x20f5bc){var _0x42fdfe=rta[_0x2ea8('0x43')]();_0xc93c9['rows']=_0x20f5bc['map'](function(_0x271c0b){return _[_0x2ea8('0x44')](_0x271c0b,_0x42fdfe);});return _0xc93c9;})[_0x2ea8('0x21')](respondWithFilteredResult(_0x3af1c9,_0x16af22))[_0x2ea8('0x45')](APIHandleError(_0x3af1c9));};exports['getQueues']=function(_0x35201e,_0x3d20b2){var _0x1a52d2={'count':0x0,'rows':[]};var _0x5457c9={};var _0x22d08a;var _0x545842;var _0x58f81c;Promise['resolve']()[_0x2ea8('0x21')](function(){if(_0x35201e[_0x2ea8('0x11')]['channel']){if(!utils['isValidChannel'](_0x35201e[_0x2ea8('0x11')][_0x2ea8('0x17')])){throw new APIBadRequestError(util['format'](_0x2ea8('0x19'),_0x35201e[_0x2ea8('0x11')]['channel']));}_0x22d08a=_0x35201e['query'][_0x2ea8('0x17')][_0x2ea8('0x1a')]();}var _0xcd760=_['startCase'](_0x22d08a)+'Queue';var _0x1d949c=_[_0x2ea8('0x3c')](db[_0xcd760][_0x2ea8('0x27')],function(_0x644b30){return{'name':_0x644b30['fieldName'],'type':_0x644b30[_0x2ea8('0x29')]['key']};});if(!_0x35201e['query'][_0x2ea8('0x46')]){var _0xde8c6f=['id',_0x2ea8('0x47')];if(_0x22d08a===_0x2ea8('0x3f')){_0xde8c6f[_0x2ea8('0x2d')](_0x2ea8('0x29'));if(_0x35201e[_0x2ea8('0x11')][_0x2ea8('0x29')]===_0x2ea8('0x48')){_0xde8c6f[_0x2ea8('0x2d')]([_0x2ea8('0x49'),_0x2ea8('0x4a')]);}}_0x35201e[_0x2ea8('0x11')][_0x2ea8('0x46')]=_0xde8c6f[_0x2ea8('0x4b')](',');}_0x5457c9=qs[_0x2ea8('0x4c')](_0x1d949c,_0x35201e);if(_0x35201e[_0x2ea8('0x34')][_0x2ea8('0x2b')]===_0x2ea8('0x34')){var _0x2100a7={'params':{'id':_0x35201e['user'][_0x2ea8('0x35')]},'query':{'section':_0x22d08a===_0x2ea8('0x3f')&&_0x35201e['query']['type']==='outbound'?_0x2ea8('0x4d'):_[_0x2ea8('0x4e')](_0x22d08a)+'Queues','type':_0x35201e[_0x2ea8('0x11')]['type'],'nolimit':!![],'sort':_0x2ea8('0x47'),'filter':_0x35201e[_0x2ea8('0x11')]['filter']}};_0x2100a7[_0x2ea8('0x11')]=Object[_0x2ea8('0x4f')](_0x2100a7[_0x2ea8('0x11')],_0x35201e[_0x2ea8('0x11')]);delete _0x2100a7[_0x2ea8('0x11')]['id'];return db['UserProfile'][_0x2ea8('0x3b')](_0x2100a7);}return db[_0xcd760][_0x2ea8('0x50')](_0x5457c9);})[_0x2ea8('0x21')](function(_0x2d0ffe){_0x1a52d2['count']=_0x2d0ffe[_0x2ea8('0xa')];_0x545842=_0x2d0ffe['rows'];return rtq[_0x2ea8('0x51')](_0x35201e,_0x22d08a);})['then'](function(_0x5bb2c0){_0x58f81c=_0x5bb2c0[_0x2ea8('0x22')];return rtq[_0x2ea8('0x52')](_0x545842,_0x58f81c,_0x22d08a,_0x35201e[_0x2ea8('0x11')][_0x2ea8('0x29')]);})['then'](function(_0x1bbed4){_0x1a52d2[_0x2ea8('0x22')]=_0x1bbed4;return _0x1a52d2;})[_0x2ea8('0x21')](respondWithFilteredResult(_0x3d20b2,_0x5457c9))[_0x2ea8('0x45')](APIHandleError(_0x3d20b2));}; \ No newline at end of file +var _0xc66f=['isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','channel','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','rawAttributes','fieldName','type','agent','push','literal','FIELD(id,','forEach','Pause','where','merge','user','role','userProfileId','Agents','online','extraQueryConditions','assign','UserProfile','getResources','find','filterAgentAttributes','getAgentStatus','voice','voiceStatus','talking','Status','getRealtimeAgentsQueryFields','pick','catch','getQueues','toLowerCase','startCase','Queue','key','name','outbound','dialActive','dialMethod','getOptions','QueueCampaigns','Queues','filter','getRealtimeQueues','initializeQueues','util','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','status','set','Content-Range','json','getAgents','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','then'];(function(_0x5ee81a,_0xa9594){var _0x45fc94=function(_0x58ce35){while(--_0x58ce35){_0x5ee81a['push'](_0x5ee81a['shift']());}};_0x45fc94(++_0xa9594);}(_0xc66f,0x96));var _0xfc66=function(_0x75a7d,_0x4f22ac){_0x75a7d=_0x75a7d-0x0;var _0xd209cf=_0xc66f[_0x75a7d];return _0xd209cf;};'use strict';var _=require('lodash');var util=require(_0xfc66('0x0'));var rta=require(_0xfc66('0x1'));var rtq=require('../../components/realtime/queues');var qs=require(_0xfc66('0x2'));var utils=require(_0xfc66('0x3'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0xfc66('0x4'))[_0xfc66('0x5')];var APIHandleError=require(_0xfc66('0x4'))[_0xfc66('0x6')];function respondWithFilteredResult(_0x283931,_0x3aedc7){return function(_0x4045d3){if(_0x4045d3){var _0x48a52a=typeof _0x3aedc7[_0xfc66('0x7')]===_0xfc66('0x8')&&typeof _0x3aedc7['limit']===_0xfc66('0x8');var _0x2dc7e4=_0x4045d3['count'];var _0x4d4341=_0x48a52a?0x0:_0x3aedc7[_0xfc66('0x7')];var _0x3cb5d4=_0x48a52a?_0x4045d3[_0xfc66('0x9')]:_0x3aedc7[_0xfc66('0x7')]+_0x3aedc7[_0xfc66('0xa')];var _0x97b2bf;if(_0x3cb5d4>=_0x2dc7e4){_0x3cb5d4=_0x2dc7e4;_0x97b2bf=0xc8;}else{_0x97b2bf=0xce;}_0x283931[_0xfc66('0xb')](_0x97b2bf);return _0x283931[_0xfc66('0xc')](_0xfc66('0xd'),_0x4d4341+'-'+_0x3cb5d4+'/'+_0x2dc7e4)[_0xfc66('0xe')](_0x4045d3);}return null;};}exports[_0xfc66('0xf')]=function(_0x169487,_0x33d7bc){var _0x4796a7={'count':0x0,'rows':[]};var _0x2329d2={};var _0x21f2bc;var _0x5ab1bf=utils['getChannels']();var _0x28616d;var _0x18f0c3;var _0x210105=_0x169487[_0xfc66('0x10')][_0xfc66('0x11')];var _0xd40e7a=_0x169487[_0xfc66('0x10')][_0xfc66('0x12')];var _0x555af8=_0x169487[_0xfc66('0x10')][_0xfc66('0x13')];var _0x314726=_0xd40e7a===_0xfc66('0x14')||_0xd40e7a===_0xfc66('0x15')?!![]:![];var _0x529db8=[];var _0x29b45a;var _0x337191;Promise[_0xfc66('0x16')]()[_0xfc66('0x17')](function(){if(_0x169487[_0xfc66('0x10')]['channel']){if(!utils[_0xfc66('0x18')](_0x169487['query']['channel'])){throw new APIBadRequestError(util['format'](_0xfc66('0x19'),_0x169487['query'][_0xfc66('0x1a')]));}_0x21f2bc=_0x169487[_0xfc66('0x10')][_0xfc66('0x1a')]['toLowerCase']();}if(!_0x169487['query']['sort']||!_0x169487[_0xfc66('0x10')][_0xfc66('0x1b')][_0xfc66('0x1c')](_0xfc66('0x1d'))){_0x169487[_0xfc66('0x10')]['sort']=rta[_0xfc66('0x1e')](_0x169487['query'][_0xfc66('0x1b')]);return;}var _0x5dc15a=rta[_0xfc66('0x1f')](_0x169487[_0xfc66('0x10')][_0xfc66('0x1b')]);_0x169487[_0xfc66('0x10')][_0xfc66('0x1b')]=_0x5dc15a[_0xfc66('0x20')][_0xfc66('0x21')](',');_0x29b45a=_0x5dc15a[_0xfc66('0x22')];})['then'](function(){if(!_0x210105){return[];}return rta[_0xfc66('0x23')](_0x210105,_0x21f2bc);})[_0xfc66('0x17')](function(_0x4757bb){_0x529db8=_0x4757bb;return rta[_0xfc66('0x24')]();})['then'](function(_0x139d09){_0x18f0c3=_0x139d09[_0xfc66('0x25')];if((!_0xd40e7a||_0x314726)&&!_0x29b45a){return _0x529db8;}if(_0x29b45a&&!_0xd40e7a){return rta[_0xfc66('0x26')](_0x18f0c3,_0x529db8,_0x29b45a);}else{return rta[_0xfc66('0x27')](_0x18f0c3,_0x529db8,_0xd40e7a);}})[_0xfc66('0x17')](function(_0x47c911){_0x529db8=_0x47c911;var _0x3fbe9d=![];if(_0x529db8[_0xfc66('0x28')]===0x0){if(_0x210105||_0xd40e7a){_0x3fbe9d=!![];}if(_0x314726){_0x3fbe9d=![];}}if(_0x3fbe9d){return _0x4796a7;}var _0x5bae50=_[_0xfc66('0x29')](db['User'][_0xfc66('0x2a')],function(_0x4ad792){return{'name':_0x4ad792[_0xfc66('0x2b')],'type':_0x4ad792[_0xfc66('0x2c')]['key']};});_0x169487[_0xfc66('0x10')]['role']=_0xfc66('0x2d');_0x2329d2=qs['getOptions'](_0x5bae50,_0x169487);_0x2329d2['raw']=!![];var _0x712db5=[];if(_0x529db8['length']>0x0){_0x712db5[_0xfc66('0x2e')]({'id':{'$in':_0x529db8}});if(_0x29b45a&&!_0xd40e7a){_0x337191=[db['sequelize'][_0xfc66('0x2f')](_0xfc66('0x30')+_0x529db8+')')];_0x2329d2[_0xfc66('0x22')]=_0x337191;}}if(_0x314726){_0x5ab1bf[_0xfc66('0x31')](function(_0x2d2863){var _0x46c8cf=!![];if(_0xd40e7a===_0xfc66('0x15')&&_0x21f2bc!==_0x2d2863){_0x46c8cf=![];}_0x712db5['push']({[_0x2d2863+_0xfc66('0x32')]:_0x46c8cf});});if(_0x555af8){_0x712db5[_0xfc66('0x2e')]({'pauseType':_0x555af8});}}else if(_0xd40e7a){_0x5ab1bf[_0xfc66('0x31')](function(_0x33aab7){_0x712db5[_0xfc66('0x2e')]({[_0x33aab7+'Pause']:![]});});}_0x2329d2[_0xfc66('0x33')]=_[_0xfc66('0x34')](_0x2329d2['where'],{'$and':_0x712db5});if(_0x169487[_0xfc66('0x35')][_0xfc66('0x36')]===_0xfc66('0x35')){var _0x42e6af={'params':{'id':_0x169487[_0xfc66('0x35')][_0xfc66('0x37')]},'query':{'section':_0xfc66('0x38'),'role':'agent','raw':!![],'ids':_0x529db8,'customSorting':_0x337191}};if(_0x169487[_0xfc66('0x10')]['online']){_0x42e6af['query'][_0xfc66('0x39')]=!![];}if(_0x314726){_0x42e6af[_0xfc66('0x10')][_0xfc66('0x3a')]=_0x712db5;}_0x42e6af[_0xfc66('0x10')]=Object[_0xfc66('0x3b')](_0x42e6af[_0xfc66('0x10')],_0x169487['query']);return db[_0xfc66('0x3c')][_0xfc66('0x3d')](_0x42e6af);}return db['User']['findAndCountAll'](_0x2329d2);})[_0xfc66('0x17')](function(_0x78408f){_0x4796a7['count']=_0x78408f['count'];_0x28616d=_0x78408f[_0xfc66('0x25')];return _0x28616d[_0xfc66('0x29')](function(_0x31b3a6){var _0x5e7620=_[_0xfc66('0x3e')](_0x18f0c3,['id',_0x31b3a6['id']]);if(_0x5e7620){var _0x58504b=rta[_0xfc66('0x3f')](_0x5e7620);_[_0xfc66('0x34')](_0x31b3a6,_0x58504b);}_0x31b3a6[_0xfc66('0x1d')]=rta[_0xfc66('0x40')](_0x31b3a6);if(_0x31b3a6[_0xfc66('0x1d')][_0xfc66('0x1c')]('pause')){_0x5ab1bf[_0xfc66('0x31')](function(_0xacf6cd){if(_0x31b3a6[_0xacf6cd+'Pause']){if(_0xacf6cd===_0xfc66('0x41')){if(_0x31b3a6[_0xfc66('0x42')]!==_0xfc66('0x43')){_0x31b3a6[_0xfc66('0x42')]=_0xfc66('0x14');}}else{_0x31b3a6[_0xacf6cd+_0xfc66('0x44')]=_0xfc66('0x14');}}});}return _0x31b3a6;});})[_0xfc66('0x17')](function(_0x55be17){if(!_0x29b45a||_0x337191){return _0x55be17;}return rta['sortAgentsByStatus'](_0x55be17,_0x29b45a);})[_0xfc66('0x17')](function(_0x19b51a){var _0x446cae=rta[_0xfc66('0x45')]();_0x4796a7['rows']=_0x19b51a['map'](function(_0x1ec15a){return _[_0xfc66('0x46')](_0x1ec15a,_0x446cae);});return _0x4796a7;})['then'](respondWithFilteredResult(_0x33d7bc,_0x2329d2))[_0xfc66('0x47')](APIHandleError(_0x33d7bc));};exports[_0xfc66('0x48')]=function(_0x3ad6f0,_0x28c70b){var _0x26ec00={'count':0x0,'rows':[]};var _0x3c454e={};var _0x10308c;var _0xb76aa5;var _0xf9a602;Promise[_0xfc66('0x16')]()['then'](function(){if(_0x3ad6f0[_0xfc66('0x10')][_0xfc66('0x1a')]){if(!utils[_0xfc66('0x18')](_0x3ad6f0[_0xfc66('0x10')][_0xfc66('0x1a')])){throw new APIBadRequestError(util['format'](_0xfc66('0x19'),_0x3ad6f0[_0xfc66('0x10')]['channel']));}_0x10308c=_0x3ad6f0[_0xfc66('0x10')][_0xfc66('0x1a')][_0xfc66('0x49')]();}var _0x27db34=_[_0xfc66('0x4a')](_0x10308c)+_0xfc66('0x4b');var _0x17b41e=_['map'](db[_0x27db34][_0xfc66('0x2a')],function(_0x37ab66){return{'name':_0x37ab66[_0xfc66('0x2b')],'type':_0x37ab66[_0xfc66('0x2c')][_0xfc66('0x4c')]};});if(!_0x3ad6f0[_0xfc66('0x10')][_0xfc66('0x20')]){var _0x57b06a=['id',_0xfc66('0x4d')];if(_0x10308c===_0xfc66('0x41')){_0x57b06a[_0xfc66('0x2e')](_0xfc66('0x2c'));if(_0x3ad6f0[_0xfc66('0x10')][_0xfc66('0x2c')]===_0xfc66('0x4e')){_0x57b06a[_0xfc66('0x2e')]([_0xfc66('0x4f'),_0xfc66('0x50')]);}}_0x3ad6f0[_0xfc66('0x10')][_0xfc66('0x20')]=_0x57b06a[_0xfc66('0x21')](',');}_0x3c454e=qs[_0xfc66('0x51')](_0x17b41e,_0x3ad6f0);if(_0x3ad6f0['user']['role']===_0xfc66('0x35')){var _0x5a4f22={'params':{'id':_0x3ad6f0[_0xfc66('0x35')][_0xfc66('0x37')]},'query':{'section':_0x10308c==='voice'&&_0x3ad6f0[_0xfc66('0x10')][_0xfc66('0x2c')]===_0xfc66('0x4e')?_0xfc66('0x52'):_[_0xfc66('0x4a')](_0x10308c)+_0xfc66('0x53'),'type':_0x3ad6f0[_0xfc66('0x10')][_0xfc66('0x2c')],'nolimit':!![],'sort':_0xfc66('0x4d'),'filter':_0x3ad6f0[_0xfc66('0x10')][_0xfc66('0x54')]}};_0x5a4f22[_0xfc66('0x10')]=Object['assign'](_0x5a4f22[_0xfc66('0x10')],_0x3ad6f0[_0xfc66('0x10')]);delete _0x5a4f22[_0xfc66('0x10')]['id'];return db[_0xfc66('0x3c')][_0xfc66('0x3d')](_0x5a4f22);}return db[_0x27db34]['findAndCountAll'](_0x3c454e);})[_0xfc66('0x17')](function(_0x5b7281){_0x26ec00[_0xfc66('0x9')]=_0x5b7281['count'];_0xb76aa5=_0x5b7281['rows'];return rtq[_0xfc66('0x55')](_0x3ad6f0,_0x10308c);})[_0xfc66('0x17')](function(_0x41d21c){_0xf9a602=_0x41d21c[_0xfc66('0x25')];return rtq[_0xfc66('0x56')](_0xb76aa5,_0xf9a602,_0x10308c,_0x3ad6f0[_0xfc66('0x10')][_0xfc66('0x2c')]);})[_0xfc66('0x17')](function(_0x378ffb){_0x26ec00[_0xfc66('0x25')]=_0x378ffb;return _0x26ec00;})[_0xfc66('0x17')](respondWithFilteredResult(_0x28c70b,_0x3c454e))[_0xfc66('0x47')](APIHandleError(_0x28c70b));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 52eb582..7f6b2cf 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2a2cd6,_0x529961){var _0x1bbe2b=function(_0x23d9fb){while(--_0x23d9fb){_0x2a2cd6['push'](_0x2a2cd6['shift']());}};_0x1bbe2b(++_0x529961);}(_0x70e0,0x17b));var _0x070e=function(_0x25a4bc,_0x2f0877){_0x25a4bc=_0x25a4bc-0x0;var _0x1b0c55=_0x70e0[_0x25a4bc];return _0x1b0c55;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x45739c,_0x2c1b21){var _0x3f6299=function(_0x62edfb){while(--_0x62edfb){_0x45739c['push'](_0x45739c['shift']());}};_0x3f6299(++_0x2c1b21);}(_0x70e0,0x17b));var _0x070e=function(_0x1da28d,_0x387f05){_0x1da28d=_0x1da28d-0x0;var _0x39b9fd=_0x70e0[_0x1da28d];return _0x39b9fd;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 2ad529b..a1769ff 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.attributes.js +++ b/server/api/reportAgentPreview/reportAgentPreview.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53ec=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x20efe6,_0x2d6285){var _0x2680c2=function(_0x1c969b){while(--_0x1c969b){_0x20efe6['push'](_0x20efe6['shift']());}};_0x2680c2(++_0x2d6285);}(_0x53ec,0x192));var _0xc53e=function(_0x21f70b,_0x47501e){_0x21f70b=_0x21f70b-0x0;var _0x153b64=_0x53ec[_0x21f70b];return _0x153b64;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'state':{'type':Sequelize[_0xc53e('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xc53e('0x3')]},'scheduledat':{'type':Sequelize[_0xc53e('0x4')]},'uniqueid':{'type':Sequelize[_0xc53e('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xc53e('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xc53e('0x3')]},'campaigntype':{'type':Sequelize[_0xc53e('0x3')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x71ad=['STRING','DATE','INTEGER','sequelize','exports'];(function(_0x5014df,_0x45f897){var _0x13e73e=function(_0x398368){while(--_0x398368){_0x5014df['push'](_0x5014df['shift']());}};_0x13e73e(++_0x45f897);}(_0x71ad,0xee));var _0xd71a=function(_0x471a11,_0x42d1c5){_0x471a11=_0x471a11-0x0;var _0x223d60=_0x71ad[_0x471a11];return _0x223d60;};'use strict';var Sequelize=require(_0xd71a('0x0'));module[_0xd71a('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xd71a('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xd71a('0x2')]},'starttime':{'type':Sequelize[_0xd71a('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xd71a('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xd71a('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 0ad0cb5..3e307d5 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.model.js +++ b/server/api/reportAgentPreview/reportAgentPreview.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbde5=['request-promise','path','rimraf','report_agent_preview','lodash','util','moment'];(function(_0x1b98f8,_0x2db035){var _0x1baf40=function(_0x43b514){while(--_0x43b514){_0x1b98f8['push'](_0x1b98f8['shift']());}};_0x1baf40(++_0x2db035);}(_0xbde5,0x107));var _0x5bde=function(_0x26c4cd,_0x509321){_0x26c4cd=_0x26c4cd-0x0;var _0x19b3e9=_0xbde5[_0x26c4cd];return _0x19b3e9;};'use strict';var _=require(_0x5bde('0x0'));var util=require(_0x5bde('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5bde('0x2'));var BPromise=require('bluebird');var rp=require(_0x5bde('0x3'));var fs=require('fs');var path=require(_0x5bde('0x4'));var rimraf=require(_0x5bde('0x5'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x4357bd,_0x8e17d9){return _0x4357bd['define']('ReportAgentPreview',attributes,{'tableName':_0x5bde('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x188f=['../../config/logger','moment','bluebird','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','util'];(function(_0x354bd6,_0x4a7c74){var _0x39bf52=function(_0x585791){while(--_0x585791){_0x354bd6['push'](_0x354bd6['shift']());}};_0x39bf52(++_0x4a7c74);}(_0x188f,0x81));var _0xf188=function(_0x30b613,_0x519322){_0x30b613=_0x30b613-0x0;var _0x5a5282=_0x188f[_0x30b613];return _0x5a5282;};'use strict';var _=require('lodash');var util=require(_0xf188('0x0'));var logger=require(_0xf188('0x1'))('api');var moment=require(_0xf188('0x2'));var BPromise=require(_0xf188('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf188('0x4'));var attributes=require(_0xf188('0x5'));module[_0xf188('0x6')]=function(_0x463b05,_0x1804f3){return _0x463b05[_0xf188('0x7')](_0xf188('0x8'),attributes,{'tableName':_0xf188('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index d134666..4f42d04 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.rpc.js +++ b/server/api/reportAgentPreview/reportAgentPreview.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2da7=['request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','create','body','options','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http'];(function(_0x338c8c,_0x19df14){var _0x371a9a=function(_0x4da3fe){while(--_0x4da3fe){_0x338c8c['push'](_0x338c8c['shift']());}};_0x371a9a(++_0x19df14);}(_0x2da7,0x99));var _0x72da=function(_0x2bb004,_0x324a3f){_0x2bb004=_0x2bb004-0x0;var _0x1b0c1e=_0x2da7[_0x2bb004];return _0x1b0c1e;};'use strict';var _=require(_0x72da('0x0'));var util=require('util');var moment=require(_0x72da('0x1'));var BPromise=require(_0x72da('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x72da('0x3'));var db=require(_0x72da('0x4'))['db'];var utils=require(_0x72da('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x72da('0x6'));var client=jayson[_0x72da('0x7')][_0x72da('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8e3d2,_0x71f805,_0x203301){return new BPromise(function(_0x2ec9bb,_0x2fbbe3){return client[_0x72da('0x9')](_0x8e3d2,_0x203301)[_0x72da('0xa')](function(_0x5165e2){logger[_0x72da('0xb')](_0x72da('0xc'),_0x71f805,_0x72da('0xd'));logger[_0x72da('0xe')](_0x72da('0xf'),_0x71f805,'request\x20sent',JSON[_0x72da('0x10')](_0x5165e2));if(_0x5165e2[_0x72da('0x11')]){if(_0x5165e2[_0x72da('0x11')][_0x72da('0x12')]===0x1f4){logger[_0x72da('0x11')](_0x72da('0xc'),_0x71f805,_0x5165e2[_0x72da('0x11')][_0x72da('0x13')]);return _0x2fbbe3(_0x5165e2['error'][_0x72da('0x13')]);}logger[_0x72da('0x11')](_0x72da('0xc'),_0x71f805,_0x5165e2[_0x72da('0x11')][_0x72da('0x13')]);return _0x2ec9bb(_0x5165e2['error']['message']);}else{logger[_0x72da('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x71f805,_0x72da('0xd'));_0x2ec9bb(_0x5165e2[_0x72da('0x14')][_0x72da('0x13')]);}})[_0x72da('0x15')](function(_0x135b9c){logger[_0x72da('0x11')](_0x72da('0xc'),_0x71f805,_0x135b9c);_0x2fbbe3(_0x135b9c);});});}exports[_0x72da('0x16')]=function(_0x2ad242){var _0x3bc6b1=this;return new Promise(function(_0x541767,_0x1e1795){return db['ReportAgentPreview'][_0x72da('0x17')](_0x2ad242[_0x72da('0x18')],{'raw':_0x2ad242['options']?_0x2ad242[_0x72da('0x19')][_0x72da('0x1a')]===undefined?!![]:![]:!![]})[_0x72da('0xa')](function(_0xc2252d){logger['info']('CreateReportAgentPreview',_0x2ad242);logger[_0x72da('0xe')](_0x72da('0x16'),_0x2ad242,JSON[_0x72da('0x10')](_0xc2252d));_0x541767(_0xc2252d);})['catch'](function(_0x5a30f5){logger[_0x72da('0x11')]('CreateReportAgentPreview',_0x5a30f5[_0x72da('0x13')],_0x2ad242);_0x1e1795(_0x3bc6b1[_0x72da('0x11')](0x1f4,_0x5a30f5['message']));});});}; \ No newline at end of file +var _0x24ba=['code','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x53914,_0x30eb24){var _0x4b3463=function(_0x413678){while(--_0x413678){_0x53914['push'](_0x53914['shift']());}};_0x4b3463(++_0x30eb24);}(_0x24ba,0xf2));var _0xa24b=function(_0x41ed4f,_0x4a76db){_0x41ed4f=_0x41ed4f-0x0;var _0x1585d4=_0x24ba[_0x41ed4f];return _0x1585d4;};'use strict';var _=require(_0xa24b('0x0'));var util=require('util');var moment=require(_0xa24b('0x1'));var BPromise=require('bluebird');var rs=require(_0xa24b('0x2'));var fs=require('fs');var Redis=require(_0xa24b('0x3'));var db=require(_0xa24b('0x4'))['db'];var utils=require(_0xa24b('0x5'));var logger=require(_0xa24b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa24b('0x7'));var client=jayson[_0xa24b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x527b57,_0xb331bd,_0x4a2e5f){return new BPromise(function(_0x5ed953,_0x4e255f){return client[_0xa24b('0x9')](_0x527b57,_0x4a2e5f)[_0xa24b('0xa')](function(_0x5df61f){logger[_0xa24b('0xb')](_0xa24b('0xc'),_0xb331bd,_0xa24b('0xd'));logger[_0xa24b('0xe')](_0xa24b('0xf'),_0xb331bd,_0xa24b('0xd'),JSON[_0xa24b('0x10')](_0x5df61f));if(_0x5df61f[_0xa24b('0x11')]){if(_0x5df61f[_0xa24b('0x11')][_0xa24b('0x12')]===0x1f4){logger['error'](_0xa24b('0xc'),_0xb331bd,_0x5df61f[_0xa24b('0x11')][_0xa24b('0x13')]);return _0x4e255f(_0x5df61f[_0xa24b('0x11')][_0xa24b('0x13')]);}logger[_0xa24b('0x11')](_0xa24b('0xc'),_0xb331bd,_0x5df61f[_0xa24b('0x11')][_0xa24b('0x13')]);return _0x5ed953(_0x5df61f[_0xa24b('0x11')]['message']);}else{logger[_0xa24b('0xb')](_0xa24b('0xc'),_0xb331bd,_0xa24b('0xd'));_0x5ed953(_0x5df61f['result'][_0xa24b('0x13')]);}})[_0xa24b('0x14')](function(_0x27726f){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0xb331bd,_0x27726f);_0x4e255f(_0x27726f);});});}exports[_0xa24b('0x15')]=function(_0x56ecd0){var _0x2f4bbd=this;return new Promise(function(_0x4fe40b,_0x5c11ca){return db[_0xa24b('0x16')][_0xa24b('0x17')](_0x56ecd0['body'],{'raw':_0x56ecd0[_0xa24b('0x18')]?_0x56ecd0[_0xa24b('0x18')][_0xa24b('0x19')]===undefined?!![]:![]:!![]})[_0xa24b('0xa')](function(_0x5bfbbc){logger[_0xa24b('0xb')](_0xa24b('0x15'),_0x56ecd0);logger['debug'](_0xa24b('0x15'),_0x56ecd0,JSON[_0xa24b('0x10')](_0x5bfbbc));_0x4fe40b(_0x5bfbbc);})[_0xa24b('0x14')](function(_0x58b6f2){logger['error'](_0xa24b('0x15'),_0x58b6f2['message'],_0x56ecd0);_0x5c11ca(_0x2f4bbd['error'](0x1f4,_0x58b6f2[_0xa24b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index f48d287..7d0b3a0 100644 --- a/server/api/rpc/index.js +++ b/server/api/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb505=['showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/agents/:id/notify','agentNotify','exports','multer','util','express','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','get','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','/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','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/fax/queues/:id/notify','/fax/queues/:id'];(function(_0x17ac27,_0x75d9a){var _0x1271b2=function(_0x843ef7){while(--_0x843ef7){_0x17ac27['push'](_0x17ac27['shift']());}};_0x1271b2(++_0x75d9a);}(_0xb505,0x1a8));var _0x5b50=function(_0x26e4e2,_0x5a41b9){_0x26e4e2=_0x26e4e2-0x0;var _0x399743=_0xb505[_0x26e4e2];return _0x399743;};'use strict';var multer=require(_0x5b50('0x0'));var util=require(_0x5b50('0x1'));var path=require('path');var express=require(_0x5b50('0x2'));var router=express['Router']();var auth=require(_0x5b50('0x3'));var controller=require(_0x5b50('0x4'));router['get'](_0x5b50('0x5'),auth[_0x5b50('0x6')](),controller['voiceChannels']);router[_0x5b50('0x7')](_0x5b50('0x8'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0x5b50('0x7')](_0x5b50('0x9'),auth['isAuthenticated'](),controller[_0x5b50('0xa')]);router[_0x5b50('0x7')](_0x5b50('0xb'),auth[_0x5b50('0x6')](),controller[_0x5b50('0xc')]);router[_0x5b50('0x7')](_0x5b50('0xd'),auth[_0x5b50('0x6')](),controller['chatQueues']);router[_0x5b50('0x7')](_0x5b50('0xe'),auth['isAuthenticated'](),controller[_0x5b50('0xf')]);router[_0x5b50('0x7')](_0x5b50('0x10'),auth[_0x5b50('0x6')](),controller['mailAccounts']);router[_0x5b50('0x7')](_0x5b50('0x11'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x12')]);router[_0x5b50('0x7')](_0x5b50('0x13'),auth['isAuthenticated'](),controller['smsQueues']);router[_0x5b50('0x7')](_0x5b50('0x14'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x15')]);router[_0x5b50('0x7')](_0x5b50('0x16'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x17')]);router[_0x5b50('0x7')](_0x5b50('0x18'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x19')]);router['get'](_0x5b50('0x1a'),auth['isAuthenticated'](),controller[_0x5b50('0x1b')]);router[_0x5b50('0x7')](_0x5b50('0x1c'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x1d')]);router[_0x5b50('0x7')](_0x5b50('0x1e'),auth[_0x5b50('0x6')](),controller['voiceQueuesChannelHangup']);router[_0x5b50('0x7')](_0x5b50('0x1f'),auth['isAuthenticated'](),controller[_0x5b50('0x20')]);router[_0x5b50('0x7')](_0x5b50('0x21'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x22')]);router[_0x5b50('0x23')](_0x5b50('0x21'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x24')]);router[_0x5b50('0x7')](_0x5b50('0x25'),auth['isAuthenticated'](),controller[_0x5b50('0x26')]);router['get'](_0x5b50('0x27'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x28')]);router[_0x5b50('0x7')](_0x5b50('0x29'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x2a')]);router['put'](_0x5b50('0x2b'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x2c')]);router[_0x5b50('0x7')](_0x5b50('0x2d'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x2e')]);router[_0x5b50('0x7')]('/trunks',auth[_0x5b50('0x6')](),controller['trunks']);router[_0x5b50('0x7')]('/campaigns',auth[_0x5b50('0x6')](),controller[_0x5b50('0x2f')]);router[_0x5b50('0x7')]('/fax/accounts',auth[_0x5b50('0x6')](),controller[_0x5b50('0x30')]);router[_0x5b50('0x7')](_0x5b50('0x31'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x32')]);router[_0x5b50('0x7')](_0x5b50('0x33'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x34')]);router['get'](_0x5b50('0x35'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x36')]);router[_0x5b50('0x7')](_0x5b50('0x37'),auth[_0x5b50('0x6')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x5b50('0x7')]('/sms/queues/waitinginteractions',auth[_0x5b50('0x6')](),controller['smsQueuesWaitingInteractions']);router[_0x5b50('0x7')](_0x5b50('0x38'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x39')]);router['get'](_0x5b50('0x3a'),auth['isAuthenticated'](),controller[_0x5b50('0x3b')]);router[_0x5b50('0x3c')](_0x5b50('0x3d'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x3e')](_0x5b50('0x3f')));router[_0x5b50('0x7')](_0x5b50('0x40'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x41')]);router[_0x5b50('0x3c')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller[_0x5b50('0x3e')]('chat'));router[_0x5b50('0x7')]('/chat/queues/:id',auth['isAuthenticated'](),controller['showChatQueues']);router[_0x5b50('0x3c')](_0x5b50('0x42'),auth['isAuthenticated'](),controller['queueNotify']('fax'));router[_0x5b50('0x7')](_0x5b50('0x43'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x44')]);router[_0x5b50('0x3c')](_0x5b50('0x45'),auth['isAuthenticated'](),controller['queueNotify'](_0x5b50('0x46')));router[_0x5b50('0x7')](_0x5b50('0x47'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x48')]);router['post'](_0x5b50('0x49'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x3e')](_0x5b50('0x4a')));router['post'](_0x5b50('0x4b'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x3e')](_0x5b50('0x4c')));router[_0x5b50('0x7')](_0x5b50('0x4d'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x4e')]);router['get']('/whatsapp/queues/:id',auth[_0x5b50('0x6')](),controller['showWhatsappQueues']);router[_0x5b50('0x3c')](_0x5b50('0x4f'),auth[_0x5b50('0x6')](),controller[_0x5b50('0x50')]);module[_0x5b50('0x51')]=router; \ No newline at end of file +var _0xecaf=['voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','outbound','outboundChannels','agents','put','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','chat','showChatQueues','/fax/queues/:id/notify','fax','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','sms','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xecaf,0x127));var _0xfeca=function(_0x1093a5,_0x2a7d40){_0x1093a5=_0x1093a5-0x0;var _0x230985=_0xecaf[_0x1093a5];return _0x230985;};'use strict';var multer=require('multer');var util=require(_0xfeca('0x0'));var path=require(_0xfeca('0x1'));var express=require(_0xfeca('0x2'));var router=express['Router']();var auth=require(_0xfeca('0x3'));var controller=require(_0xfeca('0x4'));router[_0xfeca('0x5')](_0xfeca('0x6'),auth['isAuthenticated'](),controller[_0xfeca('0x7')]);router[_0xfeca('0x5')](_0xfeca('0x8'),auth[_0xfeca('0x9')](),controller[_0xfeca('0xa')]);router[_0xfeca('0x5')](_0xfeca('0xb'),auth[_0xfeca('0x9')](),controller[_0xfeca('0xc')]);router[_0xfeca('0x5')]('/voice/queues',auth[_0xfeca('0x9')](),controller[_0xfeca('0xd')]);router[_0xfeca('0x5')]('/chat/queues',auth[_0xfeca('0x9')](),controller[_0xfeca('0xe')]);router[_0xfeca('0x5')](_0xfeca('0xf'),auth['isAuthenticated'](),controller[_0xfeca('0x10')]);router[_0xfeca('0x5')](_0xfeca('0x11'),auth[_0xfeca('0x9')](),controller[_0xfeca('0x12')]);router['get'](_0xfeca('0x13'),auth[_0xfeca('0x9')](),controller[_0xfeca('0x14')]);router[_0xfeca('0x5')]('/sms/queues',auth[_0xfeca('0x9')](),controller['smsQueues']);router['get'](_0xfeca('0x15'),auth[_0xfeca('0x9')](),controller[_0xfeca('0x16')]);router[_0xfeca('0x5')](_0xfeca('0x17'),auth[_0xfeca('0x9')](),controller['faxQueues']);router[_0xfeca('0x5')](_0xfeca('0x18'),auth[_0xfeca('0x9')](),controller['voiceQueuesPreview']);router['get'](_0xfeca('0x19'),auth['isAuthenticated'](),controller[_0xfeca('0x1a')]);router['get']('/voice/queues/channels/:uniqueid',auth[_0xfeca('0x9')](),controller[_0xfeca('0x1b')]);router['get'](_0xfeca('0x1c'),auth['isAuthenticated'](),controller[_0xfeca('0x1d')]);router[_0xfeca('0x5')](_0xfeca('0x1e'),auth['isAuthenticated'](),controller[_0xfeca('0x1f')]);router['get'](_0xfeca('0x20'),auth['isAuthenticated'](),controller[_0xfeca('0x21')]);router['put'](_0xfeca('0x20'),auth[_0xfeca('0x9')](),controller[_0xfeca('0x22')]);router[_0xfeca('0x5')]('/outbound',auth[_0xfeca('0x9')](),controller[_0xfeca('0x23')]);router[_0xfeca('0x5')]('/outbound/channels',auth['isAuthenticated'](),controller[_0xfeca('0x24')]);router[_0xfeca('0x5')]('/agents',auth['isAuthenticated'](),controller[_0xfeca('0x25')]);router[_0xfeca('0x26')]('/agents/:id/capacity',auth[_0xfeca('0x9')](),controller[_0xfeca('0x27')]);router[_0xfeca('0x5')](_0xfeca('0x28'),auth[_0xfeca('0x9')](),controller['telephones']);router[_0xfeca('0x5')](_0xfeca('0x29'),auth[_0xfeca('0x9')](),controller[_0xfeca('0x2a')]);router[_0xfeca('0x5')](_0xfeca('0x2b'),auth[_0xfeca('0x9')](),controller[_0xfeca('0x2c')]);router[_0xfeca('0x5')]('/fax/accounts',auth['isAuthenticated'](),controller['faxAccounts']);router['get']('/chat/queues/waitinginteractions',auth[_0xfeca('0x9')](),controller[_0xfeca('0x2d')]);router[_0xfeca('0x5')](_0xfeca('0x2e'),auth[_0xfeca('0x9')](),controller[_0xfeca('0x2f')]);router[_0xfeca('0x5')](_0xfeca('0x30'),auth['isAuthenticated'](),controller[_0xfeca('0x31')]);router[_0xfeca('0x5')](_0xfeca('0x32'),auth[_0xfeca('0x9')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0xfeca('0x5')](_0xfeca('0x33'),auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0xfeca('0x5')](_0xfeca('0x34'),auth[_0xfeca('0x9')](),controller[_0xfeca('0x35')]);router[_0xfeca('0x5')](_0xfeca('0x36'),auth[_0xfeca('0x9')](),controller[_0xfeca('0x37')]);router[_0xfeca('0x38')](_0xfeca('0x39'),auth[_0xfeca('0x9')](),controller[_0xfeca('0x3a')](_0xfeca('0x3b')));router[_0xfeca('0x5')]('/mail/queues/:id',auth['isAuthenticated'](),controller[_0xfeca('0x3c')]);router[_0xfeca('0x38')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller[_0xfeca('0x3a')](_0xfeca('0x3d')));router[_0xfeca('0x5')]('/chat/queues/:id',auth[_0xfeca('0x9')](),controller[_0xfeca('0x3e')]);router[_0xfeca('0x38')](_0xfeca('0x3f'),auth[_0xfeca('0x9')](),controller[_0xfeca('0x3a')](_0xfeca('0x40')));router[_0xfeca('0x5')]('/fax/queues/:id',auth[_0xfeca('0x9')](),controller['showFaxQueues']);router['post'](_0xfeca('0x41'),auth[_0xfeca('0x9')](),controller[_0xfeca('0x3a')](_0xfeca('0x42')));router[_0xfeca('0x5')](_0xfeca('0x43'),auth[_0xfeca('0x9')](),controller['showOpenchannelQueues']);router[_0xfeca('0x38')]('/sms/queues/:id/notify',auth[_0xfeca('0x9')](),controller[_0xfeca('0x3a')](_0xfeca('0x44')));router[_0xfeca('0x38')]('/whatsapp/queues/:id/notify',auth[_0xfeca('0x9')](),controller['queueNotify'](_0xfeca('0x45')));router[_0xfeca('0x5')](_0xfeca('0x46'),auth[_0xfeca('0x9')](),controller[_0xfeca('0x47')]);router[_0xfeca('0x5')](_0xfeca('0x48'),auth[_0xfeca('0x9')](),controller[_0xfeca('0x49')]);router[_0xfeca('0x38')](_0xfeca('0x4a'),auth[_0xfeca('0x9')](),controller[_0xfeca('0x4b')]);module[_0xfeca('0x4c')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 61d1734..4942b43 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','TransferReport','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','chat','agent','Message','create','Start','agentTransferTimeout','bluebird','moment','../../config/logger','api','jayson/promise','client','http','request','then','error','code','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','findAll','user','length','format','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','internal','capacity','campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues'];(function(_0x197782,_0x55d213){var _0x110fe0=function(_0x5846c3){while(--_0x5846c3){_0x197782['push'](_0x197782['shift']());}};_0x110fe0(++_0x55d213);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var jayson=require(_0x0d8b('0x4'));var amiClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){var _0x129310=_0x413284?_0x413284:amiClient;return _0x129310[_0x0d8b('0x7')](_0x39f43a,_0x4a4470)[_0x0d8b('0x8')](function(_0x1f4800){if(_0x1f4800[_0x0d8b('0x9')]){if(_0x1f4800[_0x0d8b('0x9')][_0x0d8b('0xa')]===0x1f4){return _0x58e4e2(_0x1f4800[_0x0d8b('0x9')]['message']);}return _0x284169(_0x1f4800[_0x0d8b('0x9')]['message']);}else{_0x284169(_0x1f4800[_0x0d8b('0xb')]);}})[_0x0d8b('0xc')](function(_0x340cc4){_0x58e4e2(_0x340cc4);});});}function respondWithResult(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xc8;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0xe')](_0x32bb1a);}return _0x92cdd8[_0x0d8b('0xf')](0x194);};}function handleError(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0x1f4;return function(_0xe65334){logger[_0x0d8b('0x9')](_0xe65334[_0x0d8b('0x10')]);if(_0xe65334['name']){delete _0xe65334[_0x0d8b('0x11')];}_0x2ce75e[_0x0d8b('0xd')](_0x5ad086)[_0x0d8b('0x12')](_0xe65334);};}function findById(_0xe2e167){return function(_0x2cb03c){if(!_['isNil'](_0xe2e167)&&!_[_0x0d8b('0x13')](_0x2cb03c)&&!_[_0x0d8b('0x13')](_0x2cb03c[_0x0d8b('0x14')])){return _[_0x0d8b('0x15')](_0x2cb03c[_0x0d8b('0x14')],function(_0x18dd2d){return _0x18dd2d['id']==_0xe2e167;});}return null;};}exports[_0x0d8b('0x16')]=function(_0xa3612a,_0x4a15bf){return respondWithRpcPromise(_0x0d8b('0x17'),_0xa3612a[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4a15bf,null))[_0x0d8b('0xc')](handleError(_0x4a15bf,null));};exports[_0x0d8b('0x19')]=function(_0x5b709c,_0x393beb){return respondWithRpcPromise(_0x0d8b('0x1a'),_['merge'](_0x5b709c['query'],_0x5b709c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x393beb,null))['catch'](handleError(_0x393beb,null));};exports['voiceChannelStopMixMonitor']=function(_0x238728,_0x2b924f){return respondWithRpcPromise(_0x0d8b('0x1c'),_[_0x0d8b('0x1d')](_0x238728[_0x0d8b('0x18')],_0x238728[_0x0d8b('0x1b')]))[_0x0d8b('0x8')](respondWithResult(_0x2b924f,null))[_0x0d8b('0xc')](handleError(_0x2b924f,null));};exports[_0x0d8b('0x1e')]=function(_0x5e5bc3,_0xe8bbee){return respondWithRpcPromise(_0x0d8b('0x1f'),_0x5e5bc3['query'])[_0x0d8b('0x8')](respondWithResult(_0xe8bbee,null))['catch'](handleError(_0xe8bbee,null));};exports[_0x0d8b('0x20')]=function(_0x234bdd,_0xa2af02){return respondWithRpcPromise('VoiceQueues',_0x234bdd['query'])[_0x0d8b('0x8')](findById(_0x234bdd[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0xa2af02,null))[_0x0d8b('0xc')](handleError(_0xa2af02,null));};exports['updateVoiceQueue']=function(_0x1b2b59,_0x4b59e5){return respondWithRpcPromise(_0x0d8b('0x21'),_['merge'](_0x1b2b59[_0x0d8b('0x22')],_0x1b2b59['params']))[_0x0d8b('0x8')](respondWithResult(_0x4b59e5,null))['catch'](handleError(_0x4b59e5,null));};exports[_0x0d8b('0x23')]=function(_0x106e4c,_0x2c058d){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x106e4c['query'],_0x106e4c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x2c058d,null))[_0x0d8b('0xc')](handleError(_0x2c058d,null));};exports['voiceQueuesChannels']=function(_0x5d05fc,_0x36017a){return respondWithRpcPromise(_0x0d8b('0x24'),_0x5d05fc[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x36017a,null))[_0x0d8b('0xc')](handleError(_0x36017a,null));};exports[_0x0d8b('0x25')]=function(_0x4a99d3,_0x6f93c7){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0d8b('0x1d')](_0x4a99d3[_0x0d8b('0x18')],_0x4a99d3['params']))[_0x0d8b('0x8')](respondWithResult(_0x6f93c7,null))[_0x0d8b('0xc')](handleError(_0x6f93c7,null));};exports[_0x0d8b('0x26')]=function(_0x4f2ed2,_0x113318){return respondWithRpcPromise(_0x0d8b('0x27'),_[_0x0d8b('0x1d')](_0x4f2ed2[_0x0d8b('0x18')],_0x4f2ed2[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x113318,null))[_0x0d8b('0xc')](handleError(_0x113318,null));};exports[_0x0d8b('0x28')]=function(_0x5ad0fe,_0x1180ac){return respondWithRpcPromise(_0x0d8b('0x29'),_[_0x0d8b('0x1d')](_0x5ad0fe[_0x0d8b('0x18')],_0x5ad0fe[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x1180ac,null))['catch'](handleError(_0x1180ac,null));};exports[_0x0d8b('0x2a')]=function(_0x5c2c04,_0x531c55){return respondWithRpcPromise(_0x0d8b('0x2b'),_0x5c2c04[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x531c55,null))[_0x0d8b('0xc')](handleError(_0x531c55,null));};exports[_0x0d8b('0x2c')]=function(_0x24c789,_0x579324){return respondWithRpcPromise(_0x0d8b('0x2d'),_0x24c789[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x579324,null))[_0x0d8b('0xc')](handleError(_0x579324,null));};exports[_0x0d8b('0x2e')]=function(_0x1a39ad,_0xf1680e){var _0x5c980b;return respondWithRpcPromise(_0x0d8b('0x2f'),_0x1a39ad[_0x0d8b('0x18')])[_0x0d8b('0x8')](function(_0x1f196d){_0x5c980b=_0x1f196d;return respondWithRpcPromise('Agents',_0x1a39ad[_0x0d8b('0x18')],routingClient);})['then'](function(_0x37b26c){return _[_0x0d8b('0x1d')]({},_0x37b26c,_0x5c980b);})[_0x0d8b('0x8')](respondWithResult(_0xf1680e,null))[_0x0d8b('0xc')](handleError(_0xf1680e,null));};exports[_0x0d8b('0x30')]=function(_0x3e632e,_0x1ff17d){if(_0x3e632e[_0x0d8b('0x22')]&&_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]&&_0x3e632e['user']&&_0x3e632e['user']['name']){for(var _0x4d0811 in _0x3e632e['body'][_0x0d8b('0x31')]){if(_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]['hasOwnProperty'](_0x4d0811)){db['MemberReport'][_0x0d8b('0x32')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811]&&_0x3e632e['body']['interaction'][_0x4d0811][_0x0d8b('0x34')]?{'$notIn':_0x3e632e['body'][_0x0d8b('0x31')][_0x4d0811]}:{'$ne':null}}})['then'](function(_0x53f643){var _0x30ccee=moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5ebe8a=0x0,_0x59b8e9=_0x53f643['length'];_0x5ebe8a<_0x59b8e9;_0x5ebe8a+=0x1){_0x53f643[_0x5ebe8a][_0x0d8b('0x36')]({'exitAt':_0x30ccee});}});for(var _0x1e0498=0x0;_0x1e0498<_0x3e632e[_0x0d8b('0x22')]['interaction'][_0x4d0811][_0x0d8b('0x34')];_0x1e0498+=0x1){db[_0x0d8b('0x37')][_0x0d8b('0x38')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':_0x0d8b('0x39'),'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498],'exitAt':null},'defaults':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'interface':_[_0x0d8b('0x13')](_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')])?util[_0x0d8b('0x35')](_0x0d8b('0x3b'),_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')]):_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')],'type':'INTERACTION','enterAt':moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3c')],'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3e632e[_0x0d8b('0x1b')]['id'],'capacity':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x3d')]},routingClient)[_0x0d8b('0x8')](respondWithResult(_0x1ff17d,null))[_0x0d8b('0xc')](handleError(_0x1ff17d,null));};exports['telephones']=function(_0x5c0824,_0x4e4d5f){return respondWithRpcPromise('Telephones',_0x5c0824[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4e4d5f,null))['catch'](handleError(_0x4e4d5f,null));};exports['trunks']=function(_0x44c5c1,_0x3d3cb6){return respondWithRpcPromise('Trunks',_0x44c5c1['query'])[_0x0d8b('0x8')](respondWithResult(_0x3d3cb6,null))[_0x0d8b('0xc')](handleError(_0x3d3cb6,null));};exports[_0x0d8b('0x3e')]=function(_0x346c0d,_0x2d5519){return respondWithRpcPromise('Campaigns',_0x346c0d[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x2d5519,null))['catch'](handleError(_0x2d5519,null));};exports['chatQueues']=function(_0xf6a773,_0x3f2d95){return respondWithRpcPromise('ChatQueues',_0xf6a773['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f2d95,null))[_0x0d8b('0xc')](handleError(_0x3f2d95,null));};exports[_0x0d8b('0x3f')]=function(_0xb58818,_0x4a2989){return respondWithRpcPromise(_0x0d8b('0x40'),_0xb58818['query'],routingClient)['then'](findById(_0xb58818[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x4a2989,null))['catch'](handleError(_0x4a2989,null));};exports['mailQueues']=function(_0x44ed23,_0x3d7161){return respondWithRpcPromise(_0x0d8b('0x41'),_0x44ed23[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3d7161,null))[_0x0d8b('0xc')](handleError(_0x3d7161,null));};exports[_0x0d8b('0x42')]=function(_0x3bead7,_0x5418d8){return respondWithRpcPromise(_0x0d8b('0x41'),_0x3bead7[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x3bead7[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x5418d8,null))[_0x0d8b('0xc')](handleError(_0x5418d8,null));};exports[_0x0d8b('0x43')]=function(_0x1c78b6,_0x375684){return respondWithRpcPromise('MailAccounts',_0x1c78b6[_0x0d8b('0x18')],mailClient)[_0x0d8b('0x8')](respondWithResult(_0x375684,null))[_0x0d8b('0xc')](handleError(_0x375684,null));};exports[_0x0d8b('0x44')]=function(_0x43ad22,_0x577951){return respondWithRpcPromise(_0x0d8b('0x45'),_0x43ad22[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x577951,null))[_0x0d8b('0xc')](handleError(_0x577951,null));};exports[_0x0d8b('0x46')]=function(_0x59ada2,_0x4d0e7c){return respondWithRpcPromise(_0x0d8b('0x45'),_0x59ada2[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x59ada2[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0x4d0e7c,null))[_0x0d8b('0xc')](handleError(_0x4d0e7c,null));};exports[_0x0d8b('0x47')]=function(_0x8c0bbe,_0x5952dd){return respondWithRpcPromise(_0x0d8b('0x48'),_0x8c0bbe['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5952dd,null))[_0x0d8b('0xc')](handleError(_0x5952dd,null));};exports[_0x0d8b('0x49')]=function(_0x26ccf0,_0x2b6eb6){return respondWithRpcPromise(_0x0d8b('0x48'),_0x26ccf0['query'],routingClient)[_0x0d8b('0x8')](findById(_0x26ccf0['params']['id']))[_0x0d8b('0x8')](respondWithResult(_0x2b6eb6,null))[_0x0d8b('0xc')](handleError(_0x2b6eb6,null));};exports[_0x0d8b('0x4a')]=function(_0x33a614,_0x48025e){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x33a614[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x48025e,null))[_0x0d8b('0xc')](handleError(_0x48025e,null));};exports[_0x0d8b('0x4c')]=function(_0x273aef,_0x223fd8){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x273aef[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x273aef['params']['id']))['then'](respondWithResult(_0x223fd8,null))[_0x0d8b('0xc')](handleError(_0x223fd8,null));};exports[_0x0d8b('0x4d')]=function(_0x53e399,_0xb1aa96){return respondWithRpcPromise('FaxQueues',_0x53e399['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0xb1aa96,null))[_0x0d8b('0xc')](handleError(_0xb1aa96,null));};exports['showFaxQueues']=function(_0x587128,_0x1900e3){return respondWithRpcPromise(_0x0d8b('0x4e'),_0x587128[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x587128[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x1900e3,null))[_0x0d8b('0xc')](handleError(_0x1900e3,null));};exports['faxAccounts']=function(_0x1ca60c,_0x5878c2){return respondWithRpcPromise(_0x0d8b('0x4f'),_0x1ca60c[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x5878c2,null))[_0x0d8b('0xc')](handleError(_0x5878c2,null));};exports['chatQueuesWaitingInteractions']=function(_0x3fe47d,_0x4a1c4a){return respondWithRpcPromise(_0x0d8b('0x50'),_0x3fe47d[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x4a1c4a,null))[_0x0d8b('0xc')](handleError(_0x4a1c4a,null));};exports[_0x0d8b('0x51')]=function(_0x2b44e5,_0x3e927c){return respondWithRpcPromise(_0x0d8b('0x52'),_0x2b44e5[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e927c,null))['catch'](handleError(_0x3e927c,null));};exports[_0x0d8b('0x53')]=function(_0x54c28b,_0x3e4121){return respondWithRpcPromise(_0x0d8b('0x54'),_0x54c28b['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e4121,null))['catch'](handleError(_0x3e4121,null));};exports[_0x0d8b('0x55')]=function(_0x445a00,_0x24f75){return respondWithRpcPromise(_0x0d8b('0x54'),_0x445a00[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](function(_0x3a073b){if(_0x445a00[_0x0d8b('0x18')]['type']!==undefined){var _0x10eca6=_(_0x3a073b[_0x0d8b('0x14')])['filter']([_0x445a00[_0x0d8b('0x18')][_0x0d8b('0x56')],_0x445a00[_0x0d8b('0x1b')]['id']])[_0x0d8b('0x57')](_0x0d8b('0x58'))[_0x0d8b('0x59')]()[_0x0d8b('0x5a')]();return _0x3a073b[_0x0d8b('0x14')][_0x0d8b('0x5b')](function(_0x5007c0){return _0x10eca6[_0x0d8b('0x5c')](_0x5007c0[_0x0d8b('0x58')])>-0x1;});}else{return _0x3a073b['rows'][_0x0d8b('0x5b')](function(_0x93fc55){return _0x93fc55[_0x0d8b('0x58')]===parseInt(_0x445a00['params']['id']);});}})['then'](respondWithResult(_0x24f75,null))[_0x0d8b('0xc')](handleError(_0x24f75,null));};exports[_0x0d8b('0x5d')]=function(_0x2c55bc,_0x5b76af){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2c55bc[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5b76af,null))[_0x0d8b('0xc')](handleError(_0x5b76af,null));};exports[_0x0d8b('0x5e')]=function(_0x2a2b58,_0x3f7895){return respondWithRpcPromise(_0x0d8b('0x5f'),_0x2a2b58[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f7895,null))[_0x0d8b('0xc')](handleError(_0x3f7895,null));};exports[_0x0d8b('0x60')]=function(_0x291336,_0x3b060e){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x291336[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3b060e,null))['catch'](handleError(_0x3b060e,null));};exports['queueNotify']=function(_0x1a1029){return function(_0x1dad9f,_0x3573b4){var _0x14b1b8,_0x23e2e0;var _0x354208=_['capitalize'](_0x1a1029);var _0x502715=_0x1a1029==='chat'?_0x0d8b('0x61'):_0x0d8b('0x62');return db[_0x354208+_0x0d8b('0x63')][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x1dad9f[_0x0d8b('0x1b')]['id']}})[_0x0d8b('0x8')](function(_0x5ef461){if(_[_0x0d8b('0x13')](_0x5ef461)){throw new Error(_0x354208+_0x0d8b('0x65'));}_0x14b1b8=_0x5ef461;return db[_0x354208+'Message'][_0x0d8b('0x64')]({'where':{'id':_0x1dad9f['body'][_0x0d8b('0x66')]},'include':[{'model':db[_0x354208+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x354208+_0x502715],'as':_0x0d8b('0x62')}]});})[_0x0d8b('0x8')](function(_0x8fae7f){if(_[_0x0d8b('0x13')](_0x8fae7f)){throw new Error(_0x354208+_0x0d8b('0x68'));}_0x23e2e0=_0x8fae7f;return _0x8fae7f[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x276558={'uniqueid':_0x1a1029+'.'+_0x23e2e0['id']+'.'+_0x23e2e0[_0x0d8b('0x67')]['id'],'FromUserId':_0x1dad9f['user']['id'],'type':'queue'};_0x276558[_0x354208+_0x0d8b('0x6a')]=_0x23e2e0['id'];_0x276558[_0x354208+_0x0d8b('0x6b')]=_0x23e2e0[_0x0d8b('0x67')]['id'];_0x276558[_0x0d8b('0x6c')+_0x354208+_0x502715+'Id']=_0x23e2e0[_0x0d8b('0x62')]['id'];_0x276558['To'+_0x354208+_0x0d8b('0x6d')]=_0x14b1b8['id'];return db[_0x354208+_0x0d8b('0x6e')]['create'](_0x276558);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a1029,'interaction':_0x23e2e0[_0x0d8b('0x67')],'message':_0x23e2e0,'account':_0x23e2e0['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x14b1b8[_0x0d8b('0x11')]+','+(_0x23e2e0[_0x0d8b('0x62')][_0x0d8b('0x6f')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})[_0x0d8b('0x8')](respondWithResult(_0x3573b4,null))[_0x0d8b('0xc')](handleError(_0x3573b4,null));};};exports[_0x0d8b('0x71')]=function(_0x180eda,_0x35267a){var _0x20a8b6,_0x3a6014;if(_[_0x0d8b('0x13')](_0x180eda['body'][_0x0d8b('0x72')])){throw new Error(_0x0d8b('0x73'));}var _0x8be77c=_0x180eda['body']['channel'];var _0x2db144=_[_0x0d8b('0x74')](_0x8be77c);var _0x36d6ca=_0x8be77c===_0x0d8b('0x75')?_0x0d8b('0x61'):_0x0d8b('0x62');return db['User'][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x180eda[_0x0d8b('0x1b')]['id'],'role':_0x0d8b('0x76')}})[_0x0d8b('0x8')](function(_0x4350ee){if(_['isNil'](_0x4350ee)){throw new Error('Agent\x20not\x20found');}_0x20a8b6=_0x4350ee;return db[_0x2db144+_0x0d8b('0x77')][_0x0d8b('0x64')]({'where':{'id':_0x180eda[_0x0d8b('0x22')]['messageId']},'include':[{'model':db[_0x2db144+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x2db144+_0x36d6ca],'as':_0x0d8b('0x62')}]});})['then'](function(_0xb61d4b){if(_[_0x0d8b('0x13')](_0xb61d4b)){throw new Error(_0x2db144+_0x0d8b('0x68'));}_0x3a6014=_0xb61d4b;return _0xb61d4b[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x150e9f={'uniqueid':_0x8be77c+'.'+_0x3a6014['id']+'.'+_0x3a6014[_0x0d8b('0x67')]['id'],'FromUserId':_0x180eda[_0x0d8b('0x33')]['id'],'type':_0x0d8b('0x76'),'ToUserId':_0x20a8b6['id']};_0x150e9f[_0x2db144+'MessageId']=_0x3a6014['id'];_0x150e9f[_0x2db144+_0x0d8b('0x6b')]=_0x3a6014[_0x0d8b('0x67')]['id'];_0x150e9f[_0x0d8b('0x6c')+_0x2db144+_0x36d6ca+'Id']=_0x3a6014[_0x0d8b('0x62')]['id'];return db[_0x2db144+_0x0d8b('0x6e')][_0x0d8b('0x78')](_0x150e9f);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise(_0x0d8b('0x79'),{'channel':_0x8be77c,'interaction':_0x3a6014[_0x0d8b('0x67')],'message':_0x3a6014,'account':_0x3a6014['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x20a8b6[_0x0d8b('0x11')]+','+(_0x3a6014[_0x0d8b('0x62')][_0x0d8b('0x7a')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x35267a,null))[_0x0d8b('0xc')](handleError(_0x35267a,null));}; \ No newline at end of file +var _0xbaf0=['MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','InteractionId','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','status','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions'];(function(_0x477e4b,_0x37dc1a){var _0x4c736c=function(_0x4c26b8){while(--_0x4c26b8){_0x477e4b['push'](_0x477e4b['shift']());}};_0x4c736c(++_0x37dc1a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var BPromise=require('bluebird');var moment=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var db=require(_0x0baf('0x3'))['db'];var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232a});var mailClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232b});var routingClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){var _0x5f20aa=_0x1d0a0d?_0x1d0a0d:amiClient;return _0x5f20aa[_0x0baf('0x8')](_0x1a10b1,_0x2dcaac)[_0x0baf('0x9')](function(_0x465528){if(_0x465528[_0x0baf('0xa')]){if(_0x465528[_0x0baf('0xa')][_0x0baf('0xb')]===0x1f4){return _0x11b947(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}return _0x5f5030(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}else{_0x5f5030(_0x465528[_0x0baf('0xd')]);}})['catch'](function(_0x5a53e2){_0x11b947(_0x5a53e2);});});}function respondWithResult(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xc8;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0xe')](_0xe4378c)['json'](_0x5db689);}return _0x465dd7[_0x0baf('0xf')](0x194);};}function handleError(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0x1f4;return function(_0x1f50c3){logger[_0x0baf('0xa')](_0x1f50c3[_0x0baf('0x10')]);if(_0x1f50c3[_0x0baf('0x11')]){delete _0x1f50c3[_0x0baf('0x11')];}_0x49e44b['status'](_0x1c76a8)['send'](_0x1f50c3);};}function findById(_0x2312c7){return function(_0x38395b){if(!_[_0x0baf('0x12')](_0x2312c7)&&!_[_0x0baf('0x12')](_0x38395b)&&!_[_0x0baf('0x12')](_0x38395b[_0x0baf('0x13')])){return _['find'](_0x38395b[_0x0baf('0x13')],function(_0xfbecec){return _0xfbecec['id']==_0x2312c7;});}return null;};}exports[_0x0baf('0x14')]=function(_0x3e9cb4,_0x47070d){return respondWithRpcPromise(_0x0baf('0x15'),_0x3e9cb4['query'])['then'](respondWithResult(_0x47070d,null))[_0x0baf('0x16')](handleError(_0x47070d,null));};exports[_0x0baf('0x17')]=function(_0x32e839,_0x1848e8){return respondWithRpcPromise(_0x0baf('0x18'),_[_0x0baf('0x19')](_0x32e839[_0x0baf('0x1a')],_0x32e839[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1848e8,null))[_0x0baf('0x16')](handleError(_0x1848e8,null));};exports['voiceChannelStopMixMonitor']=function(_0x334bd6,_0x482522){return respondWithRpcPromise(_0x0baf('0x1c'),_['merge'](_0x334bd6['query'],_0x334bd6[_0x0baf('0x1b')]))['then'](respondWithResult(_0x482522,null))['catch'](handleError(_0x482522,null));};exports[_0x0baf('0x1d')]=function(_0x27b59c,_0x34e264){return respondWithRpcPromise(_0x0baf('0x1e'),_0x27b59c[_0x0baf('0x1a')])['then'](respondWithResult(_0x34e264,null))[_0x0baf('0x16')](handleError(_0x34e264,null));};exports[_0x0baf('0x1f')]=function(_0x1ca35a,_0x366e71){return respondWithRpcPromise(_0x0baf('0x1e'),_0x1ca35a[_0x0baf('0x1a')])[_0x0baf('0x9')](findById(_0x1ca35a['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x366e71,null))[_0x0baf('0x16')](handleError(_0x366e71,null));};exports[_0x0baf('0x20')]=function(_0x265915,_0x55c715){return respondWithRpcPromise(_0x0baf('0x21'),_[_0x0baf('0x19')](_0x265915['body'],_0x265915[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x55c715,null))[_0x0baf('0x16')](handleError(_0x55c715,null));};exports[_0x0baf('0x22')]=function(_0xd14f0f,_0x366924){return respondWithRpcPromise(_0x0baf('0x23'),_['merge'](_0xd14f0f[_0x0baf('0x1a')],_0xd14f0f[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x366924,null))[_0x0baf('0x16')](handleError(_0x366924,null));};exports[_0x0baf('0x24')]=function(_0x275ea1,_0x2fc983){return respondWithRpcPromise(_0x0baf('0x25'),_0x275ea1[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x2fc983,null))[_0x0baf('0x16')](handleError(_0x2fc983,null));};exports[_0x0baf('0x26')]=function(_0x45294a,_0x3a3353){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0baf('0x19')](_0x45294a['query'],_0x45294a[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x3a3353,null))[_0x0baf('0x16')](handleError(_0x3a3353,null));};exports[_0x0baf('0x27')]=function(_0x5300a5,_0x1a2b03){return respondWithRpcPromise(_0x0baf('0x28'),_['merge'](_0x5300a5[_0x0baf('0x1a')],_0x5300a5[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1a2b03,null))[_0x0baf('0x16')](handleError(_0x1a2b03,null));};exports[_0x0baf('0x29')]=function(_0x1b0991,_0xe03d82){return respondWithRpcPromise(_0x0baf('0x2a'),_['merge'](_0x1b0991[_0x0baf('0x1a')],_0x1b0991[_0x0baf('0x1b')]))['then'](respondWithResult(_0xe03d82,null))[_0x0baf('0x16')](handleError(_0xe03d82,null));};exports['outbound']=function(_0x5c545f,_0x11bc49){return respondWithRpcPromise(_0x0baf('0x2b'),_0x5c545f['query'])['then'](respondWithResult(_0x11bc49,null))[_0x0baf('0x16')](handleError(_0x11bc49,null));};exports[_0x0baf('0x2c')]=function(_0x3412bc,_0xb2d9ab){return respondWithRpcPromise(_0x0baf('0x2d'),_0x3412bc[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0xb2d9ab,null))[_0x0baf('0x16')](handleError(_0xb2d9ab,null));};exports[_0x0baf('0x2e')]=function(_0x36c6d2,_0x200864){var _0x148540;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2[_0x0baf('0x1a')])['then'](function(_0x3573ce){_0x148540=_0x3573ce;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2['query'],routingClient);})[_0x0baf('0x9')](function(_0x324369){return _[_0x0baf('0x19')]({},_0x324369,_0x148540);})[_0x0baf('0x9')](respondWithResult(_0x200864,null))[_0x0baf('0x16')](handleError(_0x200864,null));};exports[_0x0baf('0x30')]=function(_0x57b581,_0x23ad34){if(_0x57b581[_0x0baf('0x31')]&&_0x57b581['body'][_0x0baf('0x32')]&&_0x57b581[_0x0baf('0x33')]&&_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]){for(var _0x504031 in _0x57b581[_0x0baf('0x31')][_0x0baf('0x32')]){if(_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x0baf('0x34')](_0x504031)){db[_0x0baf('0x35')][_0x0baf('0x36')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':_0x0baf('0x37'),'exitAt':null,'uniqueid':_0x57b581['body'][_0x0baf('0x32')][_0x504031]&&_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')]?{'$notIn':_0x57b581[_0x0baf('0x31')]['interaction'][_0x504031]}:{'$ne':null}}})[_0x0baf('0x9')](function(_0x310240){var _0x27c3ee=moment()[_0x0baf('0x39')](_0x0baf('0x3a'));for(var _0x54ed41=0x0,_0x2a0924=_0x310240[_0x0baf('0x38')];_0x54ed41<_0x2a0924;_0x54ed41+=0x1){_0x310240[_0x54ed41][_0x0baf('0x3b')]({'exitAt':_0x27c3ee});}});for(var _0x1522b0=0x0;_0x1522b0<_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')];_0x1522b0+=0x1){db['MemberReport'][_0x0baf('0x3c')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':'INTERACTION','uniqueid':_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x1522b0],'exitAt':null},'defaults':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'interface':_[_0x0baf('0x12')](_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')])?util['format'](_0x0baf('0x3e'),_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]):_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')],'type':_0x0baf('0x37'),'enterAt':moment()[_0x0baf('0x39')](_0x0baf('0x3a')),'role':_0x0baf('0x3f'),'internal':_0x57b581[_0x0baf('0x33')][_0x0baf('0x40')],'uniqueid':_0x57b581['body']['interaction'][_0x504031][_0x1522b0]}});}}}}return respondWithRpcPromise(_0x0baf('0x41'),{'id':_0x57b581[_0x0baf('0x1b')]['id'],'capacity':_0x57b581[_0x0baf('0x31')][_0x0baf('0x42')]},routingClient)[_0x0baf('0x9')](respondWithResult(_0x23ad34,null))[_0x0baf('0x16')](handleError(_0x23ad34,null));};exports[_0x0baf('0x43')]=function(_0x4b492c,_0x3fe534){return respondWithRpcPromise(_0x0baf('0x44'),_0x4b492c[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x3fe534,null))[_0x0baf('0x16')](handleError(_0x3fe534,null));};exports[_0x0baf('0x45')]=function(_0x5e1849,_0x3eebe5){return respondWithRpcPromise('Trunks',_0x5e1849[_0x0baf('0x1a')])['then'](respondWithResult(_0x3eebe5,null))[_0x0baf('0x16')](handleError(_0x3eebe5,null));};exports['campaigns']=function(_0x35b1a5,_0x4c035b){return respondWithRpcPromise(_0x0baf('0x46'),_0x35b1a5[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x4c035b,null))[_0x0baf('0x16')](handleError(_0x4c035b,null));};exports[_0x0baf('0x47')]=function(_0x576475,_0x21f179){return respondWithRpcPromise(_0x0baf('0x48'),_0x576475[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21f179,null))[_0x0baf('0x16')](handleError(_0x21f179,null));};exports[_0x0baf('0x49')]=function(_0x480834,_0x402f4d){return respondWithRpcPromise(_0x0baf('0x48'),_0x480834[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x480834[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x402f4d,null))[_0x0baf('0x16')](handleError(_0x402f4d,null));};exports['mailQueues']=function(_0x48e855,_0x23f6ea){return respondWithRpcPromise(_0x0baf('0x4a'),_0x48e855[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x23f6ea,null))[_0x0baf('0x16')](handleError(_0x23f6ea,null));};exports[_0x0baf('0x4b')]=function(_0xaa4293,_0x14a667){return respondWithRpcPromise(_0x0baf('0x4a'),_0xaa4293['query'],routingClient)[_0x0baf('0x9')](findById(_0xaa4293[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x14a667,null))[_0x0baf('0x16')](handleError(_0x14a667,null));};exports[_0x0baf('0x4c')]=function(_0xebfc0c,_0x26f5c9){return respondWithRpcPromise('MailAccounts',_0xebfc0c[_0x0baf('0x1a')],mailClient)[_0x0baf('0x9')](respondWithResult(_0x26f5c9,null))[_0x0baf('0x16')](handleError(_0x26f5c9,null));};exports[_0x0baf('0x4d')]=function(_0x1c7d88,_0x1a6d22){return respondWithRpcPromise(_0x0baf('0x4e'),_0x1c7d88[_0x0baf('0x1a')],routingClient)['then'](respondWithResult(_0x1a6d22,null))[_0x0baf('0x16')](handleError(_0x1a6d22,null));};exports['showOpenchannelQueues']=function(_0x3c00e7,_0x5f2fbe){return respondWithRpcPromise('OpenchannelQueues',_0x3c00e7[_0x0baf('0x1a')],routingClient)['then'](findById(_0x3c00e7[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x5f2fbe,null))['catch'](handleError(_0x5f2fbe,null));};exports[_0x0baf('0x4f')]=function(_0xfb6708,_0x156572){return respondWithRpcPromise('SmsQueues',_0xfb6708['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x156572,null))[_0x0baf('0x16')](handleError(_0x156572,null));};exports[_0x0baf('0x50')]=function(_0x7f49e,_0x784e1a){return respondWithRpcPromise('SmsQueues',_0x7f49e[_0x0baf('0x1a')],routingClient)['then'](findById(_0x7f49e['params']['id']))['then'](respondWithResult(_0x784e1a,null))[_0x0baf('0x16')](handleError(_0x784e1a,null));};exports['whatsappQueues']=function(_0x4946d4,_0x11a81e){return respondWithRpcPromise(_0x0baf('0x51'),_0x4946d4[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x11a81e,null))[_0x0baf('0x16')](handleError(_0x11a81e,null));};exports[_0x0baf('0x52')]=function(_0x4c05d6,_0xec3b32){return respondWithRpcPromise(_0x0baf('0x51'),_0x4c05d6[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x4c05d6[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0xec3b32,null))['catch'](handleError(_0xec3b32,null));};exports[_0x0baf('0x53')]=function(_0x468363,_0x29fd46){return respondWithRpcPromise('FaxQueues',_0x468363[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x29fd46,null))[_0x0baf('0x16')](handleError(_0x29fd46,null));};exports[_0x0baf('0x54')]=function(_0x125906,_0x27a959){return respondWithRpcPromise(_0x0baf('0x55'),_0x125906['query'],routingClient)['then'](findById(_0x125906['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x27a959,null))[_0x0baf('0x16')](handleError(_0x27a959,null));};exports[_0x0baf('0x56')]=function(_0x12b9b5,_0x3e65d4){return respondWithRpcPromise(_0x0baf('0x57'),_0x12b9b5['query'])['then'](respondWithResult(_0x3e65d4,null))[_0x0baf('0x16')](handleError(_0x3e65d4,null));};exports['chatQueuesWaitingInteractions']=function(_0x22cd07,_0x3e9b79){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x22cd07[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x3e9b79,null))[_0x0baf('0x16')](handleError(_0x3e9b79,null));};exports[_0x0baf('0x58')]=function(_0x115ff5,_0x33a5af){return respondWithRpcPromise(_0x0baf('0x59'),_0x115ff5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x33a5af,null))['catch'](handleError(_0x33a5af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x58a079,_0x493784){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x58a079[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x493784,null))[_0x0baf('0x16')](handleError(_0x493784,null));};exports[_0x0baf('0x5a')]=function(_0x5093f5,_0x1be7f2){return respondWithRpcPromise(_0x0baf('0x5b'),_0x5093f5['query'],routingClient)['then'](function(_0x43aecd){if(_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')]!==undefined){var _0x442e5f=_(_0x43aecd[_0x0baf('0x13')])[_0x0baf('0x5d')]([_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')],_0x5093f5['params']['id']])[_0x0baf('0x5e')](_0x0baf('0x5f'))['uniq']()[_0x0baf('0x60')]();return _0x43aecd[_0x0baf('0x13')]['filter'](function(_0x97d385){return _0x442e5f[_0x0baf('0x61')](_0x97d385[_0x0baf('0x5f')])>-0x1;});}else{return _0x43aecd[_0x0baf('0x13')][_0x0baf('0x5d')](function(_0x4fc5af){return _0x4fc5af['queue_id']===parseInt(_0x5093f5[_0x0baf('0x1b')]['id']);});}})[_0x0baf('0x9')](respondWithResult(_0x1be7f2,null))['catch'](handleError(_0x1be7f2,null));};exports[_0x0baf('0x62')]=function(_0x59dad5,_0x21ad25){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x59dad5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21ad25,null))[_0x0baf('0x16')](handleError(_0x21ad25,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3c2bc1,_0x5008c5){return respondWithRpcPromise(_0x0baf('0x63'),_0x3c2bc1[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x5008c5,null))[_0x0baf('0x16')](handleError(_0x5008c5,null));};exports[_0x0baf('0x64')]=function(_0x52e845,_0x866e6e){return respondWithRpcPromise(_0x0baf('0x65'),_0x52e845['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x866e6e,null))[_0x0baf('0x16')](handleError(_0x866e6e,null));};exports[_0x0baf('0x66')]=function(_0x379c54){return function(_0x1cbbcc,_0x250df2){var _0xa4fd1b,_0x1cda78;var _0x44ef57=_[_0x0baf('0x67')](_0x379c54);var _0x3b7abf=_0x379c54===_0x0baf('0x68')?'Website':'Account';return db[_0x44ef57+_0x0baf('0x69')][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1cbbcc[_0x0baf('0x1b')]['id']}})['then'](function(_0x507783){if(_[_0x0baf('0x12')](_0x507783)){throw new Error(_0x44ef57+_0x0baf('0x6b'));}_0xa4fd1b=_0x507783;return db[_0x44ef57+_0x0baf('0x6c')][_0x0baf('0x6a')]({'where':{'id':_0x1cbbcc[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x44ef57+_0x0baf('0x6e')],'as':_0x0baf('0x6e')},{'model':db[_0x44ef57+_0x3b7abf],'as':_0x0baf('0x6f')}]});})['then'](function(_0x1590a5){if(_[_0x0baf('0x12')](_0x1590a5)){throw new Error(_0x44ef57+_0x0baf('0x70'));}_0x1cda78=_0x1590a5;return _0x1590a5[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5d26e6={'uniqueid':_0x379c54+'.'+_0x1cda78['id']+'.'+_0x1cda78['Interaction']['id'],'FromUserId':_0x1cbbcc[_0x0baf('0x33')]['id'],'type':_0x0baf('0x72')};_0x5d26e6[_0x44ef57+'MessageId']=_0x1cda78['id'];_0x5d26e6[_0x44ef57+'InteractionId']=_0x1cda78[_0x0baf('0x6e')]['id'];_0x5d26e6[_0x0baf('0x73')+_0x44ef57+_0x3b7abf+'Id']=_0x1cda78['Account']['id'];_0x5d26e6['To'+_0x44ef57+_0x0baf('0x74')]=_0xa4fd1b['id'];return db[_0x44ef57+_0x0baf('0x75')][_0x0baf('0x76')](_0x5d26e6);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x379c54,'interaction':_0x1cda78[_0x0baf('0x6e')],'message':_0x1cda78,'account':_0x1cda78[_0x0baf('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0baf('0x72'),'appdata':_0xa4fd1b[_0x0baf('0x11')]+','+(_0x1cda78[_0x0baf('0x6f')][_0x0baf('0x78')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x250df2,null))[_0x0baf('0x16')](handleError(_0x250df2,null));};};exports[_0x0baf('0x7a')]=function(_0x1e1adb,_0x3bd15b){var _0x3c37b4,_0x195303;if(_['isNil'](_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x7b')])){throw new Error(_0x0baf('0x7c'));}var _0x457ae8=_0x1e1adb[_0x0baf('0x31')]['channel'];var _0x3761b5=_[_0x0baf('0x67')](_0x457ae8);var _0x2eae1b=_0x457ae8===_0x0baf('0x68')?_0x0baf('0x7d'):'Account';return db['User'][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1e1adb['params']['id'],'role':_0x0baf('0x3f')}})['then'](function(_0x32d8b6){if(_[_0x0baf('0x12')](_0x32d8b6)){throw new Error(_0x0baf('0x7e'));}_0x3c37b4=_0x32d8b6;return db[_0x3761b5+_0x0baf('0x6c')]['findOne']({'where':{'id':_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x3761b5+_0x0baf('0x6e')],'as':'Interaction'},{'model':db[_0x3761b5+_0x2eae1b],'as':'Account'}]});})['then'](function(_0x4d4884){if(_[_0x0baf('0x12')](_0x4d4884)){throw new Error(_0x3761b5+_0x0baf('0x70'));}_0x195303=_0x4d4884;return _0x4d4884[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0baf('0x9')](function(){var _0x597830={'uniqueid':_0x457ae8+'.'+_0x195303['id']+'.'+_0x195303[_0x0baf('0x6e')]['id'],'FromUserId':_0x1e1adb[_0x0baf('0x33')]['id'],'type':_0x0baf('0x3f'),'ToUserId':_0x3c37b4['id']};_0x597830[_0x3761b5+'MessageId']=_0x195303['id'];_0x597830[_0x3761b5+_0x0baf('0x7f')]=_0x195303[_0x0baf('0x6e')]['id'];_0x597830['From'+_0x3761b5+_0x2eae1b+'Id']=_0x195303[_0x0baf('0x6f')]['id'];return db[_0x3761b5+'TransferReport'][_0x0baf('0x76')](_0x597830);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x457ae8,'interaction':_0x195303[_0x0baf('0x6e')],'message':_0x195303,'account':_0x195303['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x3c37b4[_0x0baf('0x11')]+','+(_0x195303['Account'][_0x0baf('0x80')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})[_0x0baf('0x9')](respondWithResult(_0x3bd15b,null))[_0x0baf('0x16')](handleError(_0x3bd15b,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index cf1fc65..7066e43 100644 --- a/server/api/schedule/index.js +++ b/server/api/schedule/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc575=['put','update','delete','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','run','post','create'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc575,0xe8));var _0x5c57=function(_0x5880ad,_0x4da2dc){_0x5880ad=_0x5880ad-0x0;var _0x5b3222=_0xc575[_0x5880ad];return _0x5b3222;};'use strict';var multer=require(_0x5c57('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5c57('0x1'));var express=require(_0x5c57('0x2'));var router=express['Router']();var fs_extra=require(_0x5c57('0x3'));var auth=require(_0x5c57('0x4'));var interaction=require(_0x5c57('0x5'));var config=require(_0x5c57('0x6'));var controller=require('./schedule.controller');router[_0x5c57('0x7')]('/',auth[_0x5c57('0x8')](),controller[_0x5c57('0x9')]);router['get'](_0x5c57('0xa'),auth[_0x5c57('0x8')](),controller[_0x5c57('0xb')]);router[_0x5c57('0x7')]('/:id/run',auth['isAuthenticated'](),controller[_0x5c57('0xc')]);router[_0x5c57('0xd')]('/',auth['isAuthenticated'](),controller[_0x5c57('0xe')]);router[_0x5c57('0xf')](_0x5c57('0xa'),auth['isAuthenticated'](),controller[_0x5c57('0x10')]);router[_0x5c57('0x11')](_0x5c57('0xa'),auth[_0x5c57('0x8')](),controller['destroy']);module[_0x5c57('0x12')]=router; \ No newline at end of file +var _0x1399=['show','/:id/run','post','create','put','/:id','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./schedule.controller','get','isAuthenticated','index'];(function(_0x1702dc,_0x11ca50){var _0x98513c=function(_0x38c927){while(--_0x38c927){_0x1702dc['push'](_0x1702dc['shift']());}};_0x98513c(++_0x11ca50);}(_0x1399,0xe5));var _0x9139=function(_0x11d486,_0x275600){_0x11d486=_0x11d486-0x0;var _0x24695b=_0x1399[_0x11d486];return _0x24695b;};'use strict';var multer=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var path=require(_0x9139('0x2'));var timeout=require('connect-timeout');var express=require(_0x9139('0x3'));var router=express[_0x9139('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9139('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9139('0x6'));var controller=require(_0x9139('0x7'));router[_0x9139('0x8')]('/',auth[_0x9139('0x9')](),controller[_0x9139('0xa')]);router[_0x9139('0x8')]('/:id',auth[_0x9139('0x9')](),controller[_0x9139('0xb')]);router[_0x9139('0x8')](_0x9139('0xc'),auth['isAuthenticated'](),controller['run']);router[_0x9139('0xd')]('/',auth[_0x9139('0x9')](),controller[_0x9139('0xe')]);router[_0x9139('0xf')](_0x9139('0x10'),auth[_0x9139('0x9')](),controller[_0x9139('0x11')]);router[_0x9139('0x12')](_0x9139('0x10'),auth[_0x9139('0x9')](),controller[_0x9139('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 65eed15..0d1c29b 100644 --- a/server/api/schedule/schedule.attributes.js +++ b/server/api/schedule/schedule.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ed1=['weeks','days','hours','minutes','csv','pdf','xlsx','ENUM','custom','TEXT','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','quarters','months'];(function(_0x2c50b7,_0x7604fb){var _0x46b5a9=function(_0x4a5ba3){while(--_0x4a5ba3){_0x2c50b7['push'](_0x2c50b7['shift']());}};_0x46b5a9(++_0x7604fb);}(_0x0ed1,0x9a));var _0x10ed=function(_0x572b5d,_0x4bfb90){_0x572b5d=_0x572b5d-0x0;var _0x4268f2=_0x0ed1[_0x572b5d];return _0x4268f2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x10ed('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x10ed('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x10ed('0x2')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x10ed('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x10ed('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x10ed('0x5'),_0x10ed('0x6'),_0x10ed('0x7'),_0x10ed('0x8'),_0x10ed('0x9'),_0x10ed('0xa'),_0x10ed('0xb')),'allowNull':![],'defaultValue':_0x10ed('0x9')},'output':{'type':Sequelize['ENUM'](_0x10ed('0xc'),_0x10ed('0xd'),_0x10ed('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x10ed('0xf')](_0x10ed('0x10'),'default'),'allowNull':![],'defaultValue':_0x10ed('0x10')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x10ed('0x11')]},'bcc':{'type':Sequelize[_0x10ed('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x10ed('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4069=['BOOLEAN','0\x200\x20*\x20*\x20*','INTEGER','ENUM','years','quarters','months','weeks','days','hours','minutes','pdf','xlsx','csv','custom','TEXT','sequelize','exports','STRING'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x4069,0xbb));var _0x9406=function(_0x1cf3ae,_0x575e5d){_0x1cf3ae=_0x1cf3ae-0x0;var _0x5dbeb6=_0x4069[_0x1cf3ae];return _0x5dbeb6;};'use strict';var Sequelize=require(_0x9406('0x0'));module[_0x9406('0x1')]={'name':{'type':Sequelize[_0x9406('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9406('0x2')]},'active':{'type':Sequelize[_0x9406('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x9406('0x2')],'allowNull':![],'defaultValue':_0x9406('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x9406('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x9406('0x6')](_0x9406('0x7'),_0x9406('0x8'),_0x9406('0x9'),_0x9406('0xa'),_0x9406('0xb'),_0x9406('0xc'),_0x9406('0xd')),'allowNull':![],'defaultValue':_0x9406('0xb')},'output':{'type':Sequelize['ENUM']('csv',_0x9406('0xe'),_0x9406('0xf')),'allowNull':![],'defaultValue':_0x9406('0x10')},'type':{'type':Sequelize[_0x9406('0x6')]('custom','default'),'allowNull':![],'defaultValue':_0x9406('0x11')},'sendMail':{'type':Sequelize[_0x9406('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x9406('0x2')]},'cc':{'type':Sequelize[_0x9406('0x12')]},'bcc':{'type':Sequelize[_0x9406('0x12')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index cfa1303..d8529e8 100644 --- a/server/api/schedule/schedule.controller.js +++ b/server/api/schedule/schedule.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x220f=['run','../../config/schedule','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','json','apply','reject','then','destroy','Scheduler','UserProfileResource','error','stack','name','map','Schedule','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','catch','params','options','find','create','user','get','role','userProfileId','autoAssociation','update','body'];(function(_0x69eff8,_0x598f44){var _0x3706a5=function(_0x1ec4af){while(--_0x1ec4af){_0x69eff8['push'](_0x69eff8['shift']());}};_0x3706a5(++_0x598f44);}(_0x220f,0x101));var _0xf220=function(_0x76be49,_0x1fc18e){_0x76be49=_0x76be49-0x0;var _0x42886d=_0x220f[_0x76be49];return _0x42886d;};'use strict';var emlformat=require(_0xf220('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf220('0x1'));var jsonpatch=require(_0xf220('0x2'));var rp=require(_0xf220('0x3'));var moment=require('moment');var BPromise=require(_0xf220('0x4'));var Mustache=require(_0xf220('0x5'));var util=require(_0xf220('0x6'));var path=require(_0xf220('0x7'));var sox=require(_0xf220('0x8'));var csv=require(_0xf220('0x9'));var ejs=require(_0xf220('0xa'));var fs=require('fs');var fs_extra=require(_0xf220('0xb'));var _=require(_0xf220('0xc'));var squel=require(_0xf220('0xd'));var crypto=require(_0xf220('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf220('0xf'));var toCsv=require(_0xf220('0x9'));var querystring=require(_0xf220('0x10'));var Papa=require(_0xf220('0x11'));var Redis=require('ioredis');var authService=require(_0xf220('0x12'));var qs=require(_0xf220('0x13'));var as=require(_0xf220('0x14'));var hardwareService=require(_0xf220('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xf220('0x16'));var config=require(_0xf220('0x17'));var licenseUtil=require(_0xf220('0x18'));var db=require(_0xf220('0x19'))['db'];function respondWithStatusCode(_0x5604e1,_0x329694){_0x329694=_0x329694||0xcc;return function(_0x30a771){if(_0x30a771){return _0x5604e1[_0xf220('0x1a')](_0x329694);}return _0x5604e1['status'](_0x329694)[_0xf220('0x1b')]();};}function respondWithResult(_0xd2841d,_0x25f5e0){_0x25f5e0=_0x25f5e0||0xc8;return function(_0xb9a630){if(_0xb9a630){return _0xd2841d['status'](_0x25f5e0)['json'](_0xb9a630);}};}function respondWithFilteredResult(_0x51be62,_0x239332){return function(_0x1ec5ce){if(_0x1ec5ce){var _0x160c08=typeof _0x239332[_0xf220('0x1c')]===_0xf220('0x1d')&&typeof _0x239332['limit']==='undefined';var _0x44a0e2=_0x1ec5ce['count'];var _0x5dc893=_0x160c08?0x0:_0x239332['offset'];var _0x5833eb=_0x160c08?_0x1ec5ce[_0xf220('0x1e')]:_0x239332[_0xf220('0x1c')]+_0x239332[_0xf220('0x1f')];var _0x217fcd;if(_0x5833eb>=_0x44a0e2){_0x5833eb=_0x44a0e2;_0x217fcd=0xc8;}else{_0x217fcd=0xce;}_0x51be62[_0xf220('0x20')](_0x217fcd);return _0x51be62[_0xf220('0x21')](_0xf220('0x22'),_0x5dc893+'-'+_0x5833eb+'/'+_0x44a0e2)[_0xf220('0x23')](_0x1ec5ce);}return null;};}function patchUpdates(_0x44432c){return function(_0x5ed29b){try{jsonpatch[_0xf220('0x24')](_0x5ed29b,_0x44432c,!![]);}catch(_0x47b9cc){return BPromise[_0xf220('0x25')](_0x47b9cc);}return _0x5ed29b['save']();};}function saveUpdates(_0x66fc5c,_0x3fcb51){return function(_0x2ab72c){if(_0x2ab72c){return _0x2ab72c['update'](_0x66fc5c)[_0xf220('0x26')](function(_0x33c1a7){return _0x33c1a7;});}return null;};}function removeEntity(_0x44f48c,_0x2622e3){return function(_0x1d4c57){if(_0x1d4c57){return _0x1d4c57[_0xf220('0x27')]()[_0xf220('0x26')](function(){var _0x28c038=_0x1d4c57['get']({'plain':!![]});var _0x38c121=_0xf220('0x28');return db[_0xf220('0x29')]['destroy']({'where':{'type':_0x38c121,'resourceId':_0x28c038['id']}})[_0xf220('0x26')](function(){return _0x1d4c57;});})[_0xf220('0x26')](function(){_0x44f48c[_0xf220('0x20')](0xcc)[_0xf220('0x1b')]();});}};}function handleEntityNotFound(_0x3d9d3e,_0x389199){return function(_0x5bccad){if(!_0x5bccad){_0x3d9d3e[_0xf220('0x1a')](0x194);}return _0x5bccad;};}function handleError(_0x92916b,_0x43e283){_0x43e283=_0x43e283||0x1f4;return function(_0x19a850){logger[_0xf220('0x2a')](_0x19a850[_0xf220('0x2b')]);if(_0x19a850[_0xf220('0x2c')]){delete _0x19a850[_0xf220('0x2c')];}_0x92916b[_0xf220('0x20')](_0x43e283)['send'](_0x19a850);};}exports['index']=function(_0x26a9b7,_0x53538e){var _0x2b1970={},_0x3ef2bc={},_0x435581={'count':0x0,'rows':[]};var _0x37a8fa=_[_0xf220('0x2d')](db[_0xf220('0x2e')][_0xf220('0x2f')],function(_0x2efdac){return{'name':_0x2efdac[_0xf220('0x30')],'type':_0x2efdac['type'][_0xf220('0x31')]};});_0x3ef2bc[_0xf220('0x32')]=_[_0xf220('0x2d')](_0x37a8fa,_0xf220('0x2c'));_0x3ef2bc['query']=_[_0xf220('0x33')](_0x26a9b7[_0xf220('0x34')]);_0x3ef2bc[_0xf220('0x35')]=_[_0xf220('0x36')](_0x3ef2bc[_0xf220('0x32')],_0x3ef2bc[_0xf220('0x34')]);_0x2b1970[_0xf220('0x37')]=_[_0xf220('0x36')](_0x3ef2bc[_0xf220('0x32')],qs[_0xf220('0x38')](_0x26a9b7[_0xf220('0x34')][_0xf220('0x38')]));_0x2b1970[_0xf220('0x37')]=_0x2b1970[_0xf220('0x37')][_0xf220('0x39')]?_0x2b1970[_0xf220('0x37')]:_0x3ef2bc[_0xf220('0x32')];if(!_0x26a9b7[_0xf220('0x34')][_0xf220('0x3a')](_0xf220('0x3b'))){_0x2b1970[_0xf220('0x1f')]=qs[_0xf220('0x1f')](_0x26a9b7[_0xf220('0x34')][_0xf220('0x1f')]);_0x2b1970['offset']=qs[_0xf220('0x1c')](_0x26a9b7['query']['offset']);}_0x2b1970[_0xf220('0x3c')]=qs[_0xf220('0x3d')](_0x26a9b7[_0xf220('0x34')][_0xf220('0x3d')]);_0x2b1970[_0xf220('0x3e')]=qs['filters'](_[_0xf220('0x3f')](_0x26a9b7[_0xf220('0x34')],_0x3ef2bc[_0xf220('0x35')]),_0x37a8fa);if(_0x26a9b7[_0xf220('0x34')]['filter']){_0x2b1970[_0xf220('0x3e')]=_[_0xf220('0x40')](_0x2b1970['where'],{'$or':_[_0xf220('0x2d')](_0x37a8fa,function(_0x2ef08d){if(_0x2ef08d[_0xf220('0x41')]!==_0xf220('0x42')){var _0x2b878d={};_0x2b878d[_0x2ef08d[_0xf220('0x2c')]]={'$like':'%'+_0x26a9b7[_0xf220('0x34')][_0xf220('0x43')]+'%'};return _0x2b878d;}})});}_0x2b1970=_[_0xf220('0x40')]({},_0x2b1970,_0x26a9b7['options']);var _0x1a0e88={'where':_0x2b1970[_0xf220('0x3e')]};return db[_0xf220('0x2e')][_0xf220('0x1e')](_0x1a0e88)[_0xf220('0x26')](function(_0x31ecd4){_0x435581['count']=_0x31ecd4;if(_0x26a9b7[_0xf220('0x34')][_0xf220('0x44')]){_0x2b1970[_0xf220('0x45')]=[{'all':!![]}];}return db[_0xf220('0x2e')][_0xf220('0x46')](_0x2b1970);})[_0xf220('0x26')](function(_0x1635b5){_0x435581['rows']=_0x1635b5;return _0x435581;})[_0xf220('0x26')](respondWithFilteredResult(_0x53538e,_0x2b1970))[_0xf220('0x47')](handleError(_0x53538e,null));};exports['show']=function(_0x46a6c7,_0x1d34db){var _0x270dd4={'raw':![],'where':{'id':_0x46a6c7[_0xf220('0x48')]['id']}},_0x43eef5={};_0x43eef5[_0xf220('0x32')]=_['keys'](db[_0xf220('0x2e')][_0xf220('0x2f')]);_0x43eef5[_0xf220('0x34')]=_[_0xf220('0x33')](_0x46a6c7[_0xf220('0x34')]);_0x43eef5[_0xf220('0x35')]=_[_0xf220('0x36')](_0x43eef5['model'],_0x43eef5[_0xf220('0x34')]);_0x270dd4[_0xf220('0x37')]=_['intersection'](_0x43eef5[_0xf220('0x32')],qs[_0xf220('0x38')](_0x46a6c7['query']['fields']));_0x270dd4[_0xf220('0x37')]=_0x270dd4[_0xf220('0x37')][_0xf220('0x39')]?_0x270dd4[_0xf220('0x37')]:_0x43eef5['model'];if(_0x46a6c7[_0xf220('0x34')][_0xf220('0x44')]){_0x270dd4[_0xf220('0x45')]=[{'all':!![]}];}_0x270dd4=_[_0xf220('0x40')]({},_0x270dd4,_0x46a6c7[_0xf220('0x49')]);return db[_0xf220('0x2e')][_0xf220('0x4a')](_0x270dd4)[_0xf220('0x26')](handleEntityNotFound(_0x1d34db,null))['then'](respondWithResult(_0x1d34db,null))[_0xf220('0x47')](handleError(_0x1d34db,null));};exports[_0xf220('0x4b')]=function(_0x21466e,_0x2e0ccc){return db[_0xf220('0x2e')][_0xf220('0x4b')](_0x21466e['body'],{})[_0xf220('0x26')](function(_0x374d21){var _0x29ffc2=_0x21466e[_0xf220('0x4c')][_0xf220('0x4d')]({'plain':!![]});if(!_0x29ffc2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29ffc2[_0xf220('0x4e')]===_0xf220('0x4c')){var _0x2aec43=_0x374d21[_0xf220('0x4d')]({'plain':!![]});var _0x4aa4d8=_0xf220('0x28');return db['UserProfileSection'][_0xf220('0x4a')]({'where':{'name':_0x4aa4d8,'userProfileId':_0x29ffc2[_0xf220('0x4f')]},'raw':!![]})[_0xf220('0x26')](function(_0x5e5431){if(_0x5e5431&&_0x5e5431[_0xf220('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x2aec43['name'],'resourceId':_0x2aec43['id'],'type':_0x5e5431['name'],'sectionId':_0x5e5431['id']},{})['then'](function(){return _0x374d21;});}else{return _0x374d21;}})[_0xf220('0x47')](function(_0x579704){logger[_0xf220('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x579704);throw _0x579704;});}return _0x374d21;})[_0xf220('0x26')](respondWithResult(_0x2e0ccc,0xc9))[_0xf220('0x47')](handleError(_0x2e0ccc,null));};exports[_0xf220('0x51')]=function(_0x3313f2,_0x1023a8){if(_0x3313f2['body']['id']){delete _0x3313f2['body']['id'];}return db[_0xf220('0x2e')][_0xf220('0x4a')]({'where':{'id':_0x3313f2[_0xf220('0x48')]['id']}})[_0xf220('0x26')](handleEntityNotFound(_0x1023a8,null))[_0xf220('0x26')](saveUpdates(_0x3313f2[_0xf220('0x52')],null))[_0xf220('0x26')](respondWithResult(_0x1023a8,null))[_0xf220('0x47')](handleError(_0x1023a8,null));};exports['destroy']=function(_0x1193f6,_0x3377bc){return db['Schedule'][_0xf220('0x4a')]({'where':{'id':_0x1193f6[_0xf220('0x48')]['id']}})['then'](handleEntityNotFound(_0x3377bc,null))['then'](removeEntity(_0x3377bc,null))['catch'](handleError(_0x3377bc,null));};exports[_0xf220('0x53')]=function(_0xf6fb9c,_0x2dab45,_0x185c52){var _0x14da98=require(_0xf220('0x54'));return db[_0xf220('0x2e')][_0xf220('0x4a')]({'where':{'id':_0xf6fb9c['params']['id']},'raw':!![]})[_0xf220('0x26')](handleEntityNotFound(_0x2dab45,null))[_0xf220('0x26')](function(){_0x14da98[_0xf220('0x53')](_0xf6fb9c[_0xf220('0x48')]['id']);})[_0xf220('0x26')](respondWithStatusCode(_0x2dab45,null))['catch'](handleError(_0x2dab45,null));}; \ No newline at end of file +var _0xd94d=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','options','includeAll','include','Schedule','findAll','show','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','catch','run','../../config/schedule','eml-format','rimraf'];(function(_0x34dc67,_0x441d43){var _0xda21a1=function(_0x141eb6){while(--_0x141eb6){_0x34dc67['push'](_0x34dc67['shift']());}};_0xda21a1(++_0x441d43);}(_0xd94d,0x156));var _0xdd94=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd94d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xdd94('0x0'));var rimraf=require(_0xdd94('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd94('0x2'));var rp=require(_0xdd94('0x3'));var moment=require(_0xdd94('0x4'));var BPromise=require(_0xdd94('0x5'));var Mustache=require(_0xdd94('0x6'));var util=require('util');var path=require(_0xdd94('0x7'));var sox=require(_0xdd94('0x8'));var csv=require('to-csv');var ejs=require(_0xdd94('0x9'));var fs=require('fs');var fs_extra=require(_0xdd94('0xa'));var _=require(_0xdd94('0xb'));var squel=require('squel');var crypto=require(_0xdd94('0xc'));var jsforce=require(_0xdd94('0xd'));var deskjs=require(_0xdd94('0xe'));var toCsv=require(_0xdd94('0xf'));var querystring=require(_0xdd94('0x10'));var Papa=require(_0xdd94('0x11'));var Redis=require(_0xdd94('0x12'));var authService=require(_0xdd94('0x13'));var qs=require(_0xdd94('0x14'));var as=require(_0xdd94('0x15'));var hardwareService=require(_0xdd94('0x16'));var logger=require('../../config/logger')(_0xdd94('0x17'));var utils=require(_0xdd94('0x18'));var config=require(_0xdd94('0x19'));var licenseUtil=require(_0xdd94('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x316cc5,_0x4abbc8){_0x4abbc8=_0x4abbc8||0xcc;return function(_0x1a231a){if(_0x1a231a){return _0x316cc5['sendStatus'](_0x4abbc8);}return _0x316cc5[_0xdd94('0x1b')](_0x4abbc8)[_0xdd94('0x1c')]();};}function respondWithResult(_0x285fb3,_0x5f5ce8){_0x5f5ce8=_0x5f5ce8||0xc8;return function(_0x20c5af){if(_0x20c5af){return _0x285fb3['status'](_0x5f5ce8)['json'](_0x20c5af);}};}function respondWithFilteredResult(_0x5ddd38,_0x2c4504){return function(_0xb344da){if(_0xb344da){var _0x275dda=typeof _0x2c4504[_0xdd94('0x1d')]===_0xdd94('0x1e')&&typeof _0x2c4504['limit']==='undefined';var _0x1950b5=_0xb344da[_0xdd94('0x1f')];var _0x45af19=_0x275dda?0x0:_0x2c4504[_0xdd94('0x1d')];var _0x5d11df=_0x275dda?_0xb344da['count']:_0x2c4504[_0xdd94('0x1d')]+_0x2c4504[_0xdd94('0x20')];var _0x4c3242;if(_0x5d11df>=_0x1950b5){_0x5d11df=_0x1950b5;_0x4c3242=0xc8;}else{_0x4c3242=0xce;}_0x5ddd38[_0xdd94('0x1b')](_0x4c3242);return _0x5ddd38[_0xdd94('0x21')](_0xdd94('0x22'),_0x45af19+'-'+_0x5d11df+'/'+_0x1950b5)['json'](_0xb344da);}return null;};}function patchUpdates(_0x5f4d02){return function(_0x48ba87){try{jsonpatch[_0xdd94('0x23')](_0x48ba87,_0x5f4d02,!![]);}catch(_0x1e2f7f){return BPromise['reject'](_0x1e2f7f);}return _0x48ba87[_0xdd94('0x24')]();};}function saveUpdates(_0x4abc13,_0x31270e){return function(_0x1b304d){if(_0x1b304d){return _0x1b304d[_0xdd94('0x25')](_0x4abc13)[_0xdd94('0x26')](function(_0x1c99a6){return _0x1c99a6;});}return null;};}function removeEntity(_0xf022ee,_0x5ba362){return function(_0x18271a){if(_0x18271a){return _0x18271a[_0xdd94('0x27')]()[_0xdd94('0x26')](function(){var _0x4011d5=_0x18271a[_0xdd94('0x28')]({'plain':!![]});var _0x316e4e='Scheduler';return db[_0xdd94('0x29')][_0xdd94('0x27')]({'where':{'type':_0x316e4e,'resourceId':_0x4011d5['id']}})[_0xdd94('0x26')](function(){return _0x18271a;});})['then'](function(){_0xf022ee['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20b105,_0x333860){return function(_0x4bf0d7){if(!_0x4bf0d7){_0x20b105[_0xdd94('0x2a')](0x194);}return _0x4bf0d7;};}function handleError(_0x114e1e,_0x20abe6){_0x20abe6=_0x20abe6||0x1f4;return function(_0x2ba1e3){logger[_0xdd94('0x2b')](_0x2ba1e3[_0xdd94('0x2c')]);if(_0x2ba1e3[_0xdd94('0x2d')]){delete _0x2ba1e3['name'];}_0x114e1e[_0xdd94('0x1b')](_0x20abe6)['send'](_0x2ba1e3);};}exports[_0xdd94('0x2e')]=function(_0x27ff2e,_0x3bf2f0){var _0x11f1ba={},_0x41a0c5={},_0xcb76ad={'count':0x0,'rows':[]};var _0x4205dc=_[_0xdd94('0x2f')](db['Schedule'][_0xdd94('0x30')],function(_0xe5e10c){return{'name':_0xe5e10c[_0xdd94('0x31')],'type':_0xe5e10c[_0xdd94('0x32')][_0xdd94('0x33')]};});_0x41a0c5[_0xdd94('0x34')]=_[_0xdd94('0x2f')](_0x4205dc,'name');_0x41a0c5[_0xdd94('0x35')]=_['keys'](_0x27ff2e[_0xdd94('0x35')]);_0x41a0c5['filters']=_[_0xdd94('0x36')](_0x41a0c5[_0xdd94('0x34')],_0x41a0c5[_0xdd94('0x35')]);_0x11f1ba[_0xdd94('0x37')]=_['intersection'](_0x41a0c5[_0xdd94('0x34')],qs[_0xdd94('0x38')](_0x27ff2e['query'][_0xdd94('0x38')]));_0x11f1ba['attributes']=_0x11f1ba[_0xdd94('0x37')][_0xdd94('0x39')]?_0x11f1ba[_0xdd94('0x37')]:_0x41a0c5[_0xdd94('0x34')];if(!_0x27ff2e[_0xdd94('0x35')][_0xdd94('0x3a')](_0xdd94('0x3b'))){_0x11f1ba[_0xdd94('0x20')]=qs[_0xdd94('0x20')](_0x27ff2e['query'][_0xdd94('0x20')]);_0x11f1ba[_0xdd94('0x1d')]=qs['offset'](_0x27ff2e[_0xdd94('0x35')][_0xdd94('0x1d')]);}_0x11f1ba['order']=qs[_0xdd94('0x3c')](_0x27ff2e[_0xdd94('0x35')][_0xdd94('0x3c')]);_0x11f1ba['where']=qs[_0xdd94('0x3d')](_[_0xdd94('0x3e')](_0x27ff2e['query'],_0x41a0c5[_0xdd94('0x3d')]),_0x4205dc);if(_0x27ff2e[_0xdd94('0x35')][_0xdd94('0x3f')]){_0x11f1ba[_0xdd94('0x40')]=_[_0xdd94('0x41')](_0x11f1ba['where'],{'$or':_[_0xdd94('0x2f')](_0x4205dc,function(_0x482ffd){if(_0x482ffd[_0xdd94('0x32')]!=='VIRTUAL'){var _0x274197={};_0x274197[_0x482ffd[_0xdd94('0x2d')]]={'$like':'%'+_0x27ff2e[_0xdd94('0x35')][_0xdd94('0x3f')]+'%'};return _0x274197;}})});}_0x11f1ba=_[_0xdd94('0x41')]({},_0x11f1ba,_0x27ff2e[_0xdd94('0x42')]);var _0x2a3445={'where':_0x11f1ba[_0xdd94('0x40')]};return db['Schedule'][_0xdd94('0x1f')](_0x2a3445)['then'](function(_0x3d61ee){_0xcb76ad[_0xdd94('0x1f')]=_0x3d61ee;if(_0x27ff2e[_0xdd94('0x35')][_0xdd94('0x43')]){_0x11f1ba[_0xdd94('0x44')]=[{'all':!![]}];}return db[_0xdd94('0x45')][_0xdd94('0x46')](_0x11f1ba);})[_0xdd94('0x26')](function(_0x5cb21b){_0xcb76ad['rows']=_0x5cb21b;return _0xcb76ad;})['then'](respondWithFilteredResult(_0x3bf2f0,_0x11f1ba))['catch'](handleError(_0x3bf2f0,null));};exports[_0xdd94('0x47')]=function(_0x18ef02,_0x3a82bf){var _0x249820={'raw':![],'where':{'id':_0x18ef02['params']['id']}},_0xd4104f={};_0xd4104f[_0xdd94('0x34')]=_[_0xdd94('0x48')](db[_0xdd94('0x45')]['rawAttributes']);_0xd4104f[_0xdd94('0x35')]=_[_0xdd94('0x48')](_0x18ef02[_0xdd94('0x35')]);_0xd4104f[_0xdd94('0x3d')]=_['intersection'](_0xd4104f[_0xdd94('0x34')],_0xd4104f['query']);_0x249820[_0xdd94('0x37')]=_[_0xdd94('0x36')](_0xd4104f['model'],qs[_0xdd94('0x38')](_0x18ef02['query'][_0xdd94('0x38')]));_0x249820['attributes']=_0x249820[_0xdd94('0x37')][_0xdd94('0x39')]?_0x249820[_0xdd94('0x37')]:_0xd4104f[_0xdd94('0x34')];if(_0x18ef02[_0xdd94('0x35')][_0xdd94('0x43')]){_0x249820['include']=[{'all':!![]}];}_0x249820=_[_0xdd94('0x41')]({},_0x249820,_0x18ef02[_0xdd94('0x42')]);return db[_0xdd94('0x45')][_0xdd94('0x49')](_0x249820)['then'](handleEntityNotFound(_0x3a82bf,null))[_0xdd94('0x26')](respondWithResult(_0x3a82bf,null))['catch'](handleError(_0x3a82bf,null));};exports[_0xdd94('0x4a')]=function(_0x2b3ddd,_0x2f36a2){return db['Schedule']['create'](_0x2b3ddd['body'],{})[_0xdd94('0x26')](function(_0x30eea3){var _0x11be3a=_0x2b3ddd[_0xdd94('0x4b')][_0xdd94('0x28')]({'plain':!![]});if(!_0x11be3a)throw new Error(_0xdd94('0x4c'));if(_0x11be3a[_0xdd94('0x4d')]===_0xdd94('0x4b')){var _0x3f7019=_0x30eea3[_0xdd94('0x28')]({'plain':!![]});var _0x51a4b4=_0xdd94('0x4e');return db['UserProfileSection'][_0xdd94('0x49')]({'where':{'name':_0x51a4b4,'userProfileId':_0x11be3a['userProfileId']},'raw':!![]})[_0xdd94('0x26')](function(_0x3f8db0){if(_0x3f8db0&&_0x3f8db0[_0xdd94('0x4f')]===0x0){return db['UserProfileResource'][_0xdd94('0x4a')]({'name':_0x3f7019[_0xdd94('0x2d')],'resourceId':_0x3f7019['id'],'type':_0x3f8db0[_0xdd94('0x2d')],'sectionId':_0x3f8db0['id']},{})[_0xdd94('0x26')](function(){return _0x30eea3;});}else{return _0x30eea3;}})['catch'](function(_0x5b9e4c){logger[_0xdd94('0x2b')](_0xdd94('0x50'),_0x5b9e4c);throw _0x5b9e4c;});}return _0x30eea3;})[_0xdd94('0x26')](respondWithResult(_0x2f36a2,0xc9))['catch'](handleError(_0x2f36a2,null));};exports[_0xdd94('0x25')]=function(_0x510ff4,_0x5a17f2){if(_0x510ff4[_0xdd94('0x51')]['id']){delete _0x510ff4[_0xdd94('0x51')]['id'];}return db['Schedule'][_0xdd94('0x49')]({'where':{'id':_0x510ff4[_0xdd94('0x52')]['id']}})[_0xdd94('0x26')](handleEntityNotFound(_0x5a17f2,null))[_0xdd94('0x26')](saveUpdates(_0x510ff4[_0xdd94('0x51')],null))[_0xdd94('0x26')](respondWithResult(_0x5a17f2,null))[_0xdd94('0x53')](handleError(_0x5a17f2,null));};exports[_0xdd94('0x27')]=function(_0x411960,_0x303b42){return db[_0xdd94('0x45')]['find']({'where':{'id':_0x411960[_0xdd94('0x52')]['id']}})[_0xdd94('0x26')](handleEntityNotFound(_0x303b42,null))['then'](removeEntity(_0x303b42,null))['catch'](handleError(_0x303b42,null));};exports[_0xdd94('0x54')]=function(_0x3e543a,_0x1c9120,_0x54089c){var _0x5a1f89=require(_0xdd94('0x55'));return db['Schedule'][_0xdd94('0x49')]({'where':{'id':_0x3e543a['params']['id']},'raw':!![]})[_0xdd94('0x26')](handleEntityNotFound(_0x1c9120,null))[_0xdd94('0x26')](function(){_0x5a1f89['run'](_0x3e543a[_0xdd94('0x52')]['id']);})['then'](respondWithStatusCode(_0x1c9120,null))[_0xdd94('0x53')](handleError(_0x1c9120,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 90b89f9..e3e2b2b 100644 --- a/server/api/schedule/schedule.model.js +++ b/server/api/schedule/schedule.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x328d=['path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','lodash','util','api','bluebird','request-promise'];(function(_0x2cad2f,_0xed8e71){var _0x572af7=function(_0x68d9f7){while(--_0x68d9f7){_0x2cad2f['push'](_0x2cad2f['shift']());}};_0x572af7(++_0xed8e71);}(_0x328d,0x127));var _0xd328=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x328d[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xd328('0x0'));var util=require(_0xd328('0x1'));var logger=require('../../config/logger')(_0xd328('0x2'));var moment=require('moment');var BPromise=require(_0xd328('0x3'));var rp=require(_0xd328('0x4'));var fs=require('fs');var path=require(_0xd328('0x5'));var rimraf=require(_0xd328('0x6'));var config=require(_0xd328('0x7'));var attributes=require(_0xd328('0x8'));module[_0xd328('0x9')]=function(_0x2194d6,_0x3f8fd7){return _0x2194d6[_0xd328('0xa')](_0xd328('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac92=['bluebird','request-promise','path','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api'];(function(_0x1ebae9,_0x38f134){var _0xb9fc5f=function(_0x1a85ca){while(--_0x1a85ca){_0x1ebae9['push'](_0x1ebae9['shift']());}};_0xb9fc5f(++_0x38f134);}(_0xac92,0x1dd));var _0x2ac9=function(_0xe09751,_0xe960e8){_0xe09751=_0xe09751-0x0;var _0xd33a4b=_0xac92[_0xe09751];return _0xd33a4b;};'use strict';var _=require(_0x2ac9('0x0'));var util=require(_0x2ac9('0x1'));var logger=require(_0x2ac9('0x2'))(_0x2ac9('0x3'));var moment=require('moment');var BPromise=require(_0x2ac9('0x4'));var rp=require(_0x2ac9('0x5'));var fs=require('fs');var path=require(_0x2ac9('0x6'));var rimraf=require('rimraf');var config=require(_0x2ac9('0x7'));var attributes=require(_0x2ac9('0x8'));module[_0x2ac9('0x9')]=function(_0x2311ed,_0x50a0fe){return _0x2311ed[_0x2ac9('0xa')](_0x2ac9('0xb'),attributes,{'tableName':_0x2ac9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 1118b4e..18ee3cf 100644 --- a/server/api/schedule/schedule.rpc.js +++ b/server/api/schedule/schedule.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0401=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','Schedule,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0401,0x17c));var _0x1040=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0401[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x1040('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1040('0x1'));var rs=require(_0x1040('0x2'));var fs=require('fs');var Redis=require(_0x1040('0x3'));var db=require(_0x1040('0x4'))['db'];var utils=require(_0x1040('0x5'));var logger=require(_0x1040('0x6'))(_0x1040('0x7'));var config=require(_0x1040('0x8'));var jayson=require(_0x1040('0x9'));var client=jayson[_0x1040('0xa')][_0x1040('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9ab4d9,_0x19be88,_0x1c904b){return new BPromise(function(_0x65302a,_0x341b53){return client[_0x1040('0xc')](_0x9ab4d9,_0x1c904b)[_0x1040('0xd')](function(_0x31dd3e){logger[_0x1040('0xe')]('Schedule,\x20%s,\x20%s',_0x19be88,_0x1040('0xf'));logger[_0x1040('0x10')](_0x1040('0x11'),_0x19be88,_0x1040('0xf'),JSON['stringify'](_0x31dd3e));if(_0x31dd3e['error']){if(_0x31dd3e[_0x1040('0x12')][_0x1040('0x13')]===0x1f4){logger[_0x1040('0x12')]('Schedule,\x20%s,\x20%s',_0x19be88,_0x31dd3e[_0x1040('0x12')]['message']);return _0x341b53(_0x31dd3e['error']['message']);}logger['error'](_0x1040('0x14'),_0x19be88,_0x31dd3e[_0x1040('0x12')][_0x1040('0x15')]);return _0x65302a(_0x31dd3e[_0x1040('0x12')][_0x1040('0x15')]);}else{logger[_0x1040('0xe')](_0x1040('0x14'),_0x19be88,'request\x20sent');_0x65302a(_0x31dd3e[_0x1040('0x16')]['message']);}})[_0x1040('0x17')](function(_0x3229f8){logger[_0x1040('0x12')](_0x1040('0x14'),_0x19be88,_0x3229f8);_0x341b53(_0x3229f8);});});} \ No newline at end of file +var _0xee8c=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','Schedule,\x20%s,\x20%s','message','info','catch','lodash'];(function(_0x396bae,_0x2b5bb0){var _0x481bda=function(_0x1dd156){while(--_0x1dd156){_0x396bae['push'](_0x396bae['shift']());}};_0x481bda(++_0x2b5bb0);}(_0xee8c,0x1a1));var _0xcee8=function(_0x16068b,_0x3c2737){_0x16068b=_0x16068b-0x0;var _0x55fa62=_0xee8c[_0x16068b];return _0x55fa62;};'use strict';var _=require(_0xcee8('0x0'));var util=require(_0xcee8('0x1'));var moment=require(_0xcee8('0x2'));var BPromise=require('bluebird');var rs=require(_0xcee8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcee8('0x4'))['db'];var utils=require(_0xcee8('0x5'));var logger=require(_0xcee8('0x6'))('rpc');var config=require(_0xcee8('0x7'));var jayson=require(_0xcee8('0x8'));var client=jayson[_0xcee8('0x9')][_0xcee8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c5079,_0x2bc384,_0x58a1ce){return new BPromise(function(_0xb0eff6,_0x276678){return client[_0xcee8('0xb')](_0x3c5079,_0x58a1ce)[_0xcee8('0xc')](function(_0x4d0863){logger['info']('Schedule,\x20%s,\x20%s',_0x2bc384,_0xcee8('0xd'));logger[_0xcee8('0xe')](_0xcee8('0xf'),_0x2bc384,_0xcee8('0xd'),JSON['stringify'](_0x4d0863));if(_0x4d0863[_0xcee8('0x10')]){if(_0x4d0863[_0xcee8('0x10')][_0xcee8('0x11')]===0x1f4){logger[_0xcee8('0x10')](_0xcee8('0x12'),_0x2bc384,_0x4d0863['error'][_0xcee8('0x13')]);return _0x276678(_0x4d0863[_0xcee8('0x10')][_0xcee8('0x13')]);}logger[_0xcee8('0x10')]('Schedule,\x20%s,\x20%s',_0x2bc384,_0x4d0863[_0xcee8('0x10')]['message']);return _0xb0eff6(_0x4d0863[_0xcee8('0x10')][_0xcee8('0x13')]);}else{logger[_0xcee8('0x14')](_0xcee8('0x12'),_0x2bc384,_0xcee8('0xd'));_0xb0eff6(_0x4d0863['result'][_0xcee8('0x13')]);}})[_0xcee8('0x15')](function(_0xae7def){logger[_0xcee8('0x10')](_0xcee8('0x12'),_0x2bc384,_0xae7def);_0x276678(_0xae7def);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 59246ce..b2c62ee 100644 --- a/server/api/screenRecording/index.js +++ b/server/api/screenRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18b1=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','index','isAuthenticated','describe','/:id','show','/:id/download','post','create','delete','destroy'];(function(_0x4b3c5d,_0x481607){var _0x441426=function(_0x1e7e02){while(--_0x1e7e02){_0x4b3c5d['push'](_0x4b3c5d['shift']());}};_0x441426(++_0x481607);}(_0x18b1,0x9a));var _0x118b=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x18b1[_0x1d9aa0];return _0x226868;};'use strict';var multer=require(_0x118b('0x0'));var util=require(_0x118b('0x1'));var path=require(_0x118b('0x2'));var timeout=require(_0x118b('0x3'));var express=require(_0x118b('0x4'));var router=express[_0x118b('0x5')]();var fs_extra=require(_0x118b('0x6'));var auth=require(_0x118b('0x7'));var interaction=require(_0x118b('0x8'));var config=require(_0x118b('0x9'));var controller=require(_0x118b('0xa'));router[_0x118b('0xb')]('/',auth['isAuthenticated'](),controller[_0x118b('0xc')]);router[_0x118b('0xb')]('/describe',auth[_0x118b('0xd')](),controller[_0x118b('0xe')]);router[_0x118b('0xb')](_0x118b('0xf'),auth[_0x118b('0xd')](),controller[_0x118b('0x10')]);router[_0x118b('0xb')](_0x118b('0x11'),auth[_0x118b('0xd')](),controller['download']);router[_0x118b('0x12')]('/',auth[_0x118b('0xd')](),controller[_0x118b('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x118b('0x14')](_0x118b('0xf'),auth[_0x118b('0xd')](),controller[_0x118b('0x15')]);module['exports']=router; \ No newline at end of file +var _0xf144=['/describe','describe','/:id','isAuthenticated','show','download','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','index','get'];(function(_0x1ac6ec,_0x1f81fc){var _0x48a489=function(_0xf38b04){while(--_0xf38b04){_0x1ac6ec['push'](_0x1ac6ec['shift']());}};_0x48a489(++_0x1f81fc);}(_0xf144,0x192));var _0x4f14=function(_0x13c7a7,_0x4cb89b){_0x13c7a7=_0x13c7a7-0x0;var _0x71f76f=_0xf144[_0x13c7a7];return _0x71f76f;};'use strict';var multer=require(_0x4f14('0x0'));var util=require(_0x4f14('0x1'));var path=require(_0x4f14('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f14('0x3'));var router=express[_0x4f14('0x4')]();var fs_extra=require(_0x4f14('0x5'));var auth=require(_0x4f14('0x6'));var interaction=require(_0x4f14('0x7'));var config=require(_0x4f14('0x8'));var controller=require(_0x4f14('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4f14('0xa')]);router[_0x4f14('0xb')](_0x4f14('0xc'),auth['isAuthenticated'](),controller[_0x4f14('0xd')]);router['get'](_0x4f14('0xe'),auth[_0x4f14('0xf')](),controller[_0x4f14('0x10')]);router[_0x4f14('0xb')]('/:id/download',auth[_0x4f14('0xf')](),controller[_0x4f14('0x11')]);router['post']('/',auth[_0x4f14('0xf')](),controller[_0x4f14('0x12')]);router[_0x4f14('0x13')](_0x4f14('0xe'),auth['isAuthenticated'](),controller[_0x4f14('0x14')]);router[_0x4f14('0x15')](_0x4f14('0xe'),auth[_0x4f14('0xf')](),controller[_0x4f14('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 693ff9f..712fe13 100644 --- a/server/api/screenRecording/screenRecording.attributes.js +++ b/server/api/screenRecording/screenRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62f1=['INTEGER','startedAt','closedAt','MM-DD-YYYY\x20HH:mm','toString','DATE','format','createdAt','sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue'];(function(_0x3eddeb,_0x3ebda6){var _0x1bd68e=function(_0x16b46d){while(--_0x16b46d){_0x3eddeb['push'](_0x3eddeb['shift']());}};_0x1bd68e(++_0x3ebda6);}(_0x62f1,0x112));var _0x162f=function(_0x248dc8,_0x10c027){_0x248dc8=_0x248dc8-0x0;var _0x15aaee=_0x62f1[_0x248dc8];return _0x15aaee;};'use strict';var Sequelize=require(_0x162f('0x0'));var moment=require('moment');var path=require(_0x162f('0x1'));var config=require(_0x162f('0x2'));module[_0x162f('0x3')]={'format':{'type':Sequelize[_0x162f('0x4')],'get':function(){return this[_0x162f('0x5')](_0x162f('0x6'))?path[_0x162f('0x7')](this[_0x162f('0x5')](_0x162f('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x162f('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x162f('0x8')],'set':function(_0x2e763a){var _0x593029=_0x2e763a[_0x162f('0x9')](/\\/g,'/');this[_0x162f('0xa')](_0x162f('0x6'),_0x593029);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x162f('0xb')],'set':function(_0x3d795c){this[_0x162f('0xa')](_0x162f('0xc'),moment()['subtract'](_0x3d795c,'ms'));this[_0x162f('0xa')](_0x162f('0xd'),moment());this[_0x162f('0xa')]('duration',_0x3d795c);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x162f('0xc')))['format'](_0x162f('0xe'))[_0x162f('0xf')]();}},'closedAt':{'type':Sequelize[_0x162f('0x10')],'get':function(){return moment(this[_0x162f('0x5')]('closedAt'))[_0x162f('0x11')](_0x162f('0xe'))[_0x162f('0xf')]();}},'createdAt':{'type':Sequelize[_0x162f('0x10')],'get':function(){return moment(this['getDataValue'](_0x162f('0x12')))['format'](_0x162f('0xe'))[_0x162f('0xf')]();}},'updatedAt':{'type':Sequelize[_0x162f('0x10')],'get':function(){return moment(this[_0x162f('0x5')]('updatedAt'))['format'](_0x162f('0xe'))[_0x162f('0xf')]();}}}; \ No newline at end of file +var _0xaf6e=['subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','../../config/environment','exports','VIRTUAL','getDataValue','extname','value','STRING','replace','INTEGER','setDataValue','startedAt'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xaf6e,0x16e));var _0xeaf6=function(_0x528f77,_0x5138fe){_0x528f77=_0x528f77-0x0;var _0x21cd3b=_0xaf6e[_0x528f77];return _0x21cd3b;};'use strict';var Sequelize=require(_0xeaf6('0x0'));var moment=require('moment');var path=require('path');var config=require(_0xeaf6('0x1'));module[_0xeaf6('0x2')]={'format':{'type':Sequelize[_0xeaf6('0x3')],'get':function(){return this[_0xeaf6('0x4')]('value')?path[_0xeaf6('0x5')](this[_0xeaf6('0x4')](_0xeaf6('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xeaf6('0x7')]},'channel':{'type':Sequelize[_0xeaf6('0x7')]},'value':{'type':Sequelize['STRING'],'set':function(_0x595fc8){var _0x4f82d1=_0x595fc8[_0xeaf6('0x8')](/\\/g,'/');this['setDataValue'](_0xeaf6('0x6'),_0x4f82d1);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xeaf6('0x9')],'set':function(_0x3d5ac7){this[_0xeaf6('0xa')](_0xeaf6('0xb'),moment()[_0xeaf6('0xc')](_0x3d5ac7,'ms'));this[_0xeaf6('0xa')](_0xeaf6('0xd'),moment());this[_0xeaf6('0xa')](_0xeaf6('0xe'),_0x3d5ac7);}},'startedAt':{'type':Sequelize[_0xeaf6('0xf')],'get':function(){return moment(this[_0xeaf6('0x4')]('startedAt'))[_0xeaf6('0x10')](_0xeaf6('0x11'))[_0xeaf6('0x12')]();}},'closedAt':{'type':Sequelize[_0xeaf6('0xf')],'get':function(){return moment(this[_0xeaf6('0x4')](_0xeaf6('0xd')))[_0xeaf6('0x10')](_0xeaf6('0x11'))['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xeaf6('0x4')](_0xeaf6('0x13')))[_0xeaf6('0x10')](_0xeaf6('0x11'))[_0xeaf6('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xeaf6('0x4')](_0xeaf6('0x14')))[_0xeaf6('0x10')](_0xeaf6('0x11'))[_0xeaf6('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 20219de..1836012 100644 --- a/server/api/screenRecording/screenRecording.controller.js +++ b/server/api/screenRecording/screenRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bae=['zip-dir','fast-json-patch','moment','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','includeAll','findAll','rows','catch','params','options','find','create','body','duration','createdAt','value','describe','download','../../components/encryptor','uniqueid','join','root','format','%s.cypher','existsSync','secrets','recording','server/files/screen_recordings','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','send','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x39e85c,_0x3bca61){var _0xf96780=function(_0x3b0708){while(--_0x3b0708){_0x39e85c['push'](_0x39e85c['shift']());}};_0xf96780(++_0x3bca61);}(_0x7bae,0x13b));var _0xe7ba=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x7bae[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7ba('0x0'));var jsonpatch=require(_0xe7ba('0x1'));var rp=require('request-promise');var moment=require(_0xe7ba('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe7ba('0x3'));var util=require(_0xe7ba('0x4'));var path=require(_0xe7ba('0x5'));var sox=require(_0xe7ba('0x6'));var csv=require(_0xe7ba('0x7'));var ejs=require(_0xe7ba('0x8'));var fs=require('fs');var fs_extra=require(_0xe7ba('0x9'));var _=require(_0xe7ba('0xa'));var squel=require(_0xe7ba('0xb'));var crypto=require(_0xe7ba('0xc'));var jsforce=require(_0xe7ba('0xd'));var deskjs=require(_0xe7ba('0xe'));var toCsv=require(_0xe7ba('0x7'));var querystring=require(_0xe7ba('0xf'));var Papa=require('papaparse');var Redis=require(_0xe7ba('0x10'));var authService=require(_0xe7ba('0x11'));var qs=require(_0xe7ba('0x12'));var as=require(_0xe7ba('0x13'));var hardwareService=require(_0xe7ba('0x14'));var logger=require(_0xe7ba('0x15'))(_0xe7ba('0x16'));var utils=require(_0xe7ba('0x17'));var config=require(_0xe7ba('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7ba('0x19'))['db'];function respondWithStatusCode(_0x588c8b,_0x602b1){_0x602b1=_0x602b1||0xcc;return function(_0x45229c){if(_0x45229c){return _0x588c8b[_0xe7ba('0x1a')](_0x602b1);}return _0x588c8b[_0xe7ba('0x1b')](_0x602b1)[_0xe7ba('0x1c')]();};}function respondWithResult(_0x41369f,_0x561dbb){_0x561dbb=_0x561dbb||0xc8;return function(_0x561c48){if(_0x561c48){return _0x41369f[_0xe7ba('0x1b')](_0x561dbb)[_0xe7ba('0x1d')](_0x561c48);}};}function respondWithFilteredResult(_0x359f6f,_0x5d1d03){return function(_0x4390e3){if(_0x4390e3){var _0x4b20fd=typeof _0x5d1d03['offset']==='undefined'&&typeof _0x5d1d03[_0xe7ba('0x1e')]==='undefined';var _0x41a773=_0x4390e3['count'];var _0x4e3021=_0x4b20fd?0x0:_0x5d1d03['offset'];var _0x3f326a=_0x4b20fd?_0x4390e3[_0xe7ba('0x1f')]:_0x5d1d03[_0xe7ba('0x20')]+_0x5d1d03[_0xe7ba('0x1e')];var _0x1c8b5b;if(_0x3f326a>=_0x41a773){_0x3f326a=_0x41a773;_0x1c8b5b=0xc8;}else{_0x1c8b5b=0xce;}_0x359f6f['status'](_0x1c8b5b);return _0x359f6f[_0xe7ba('0x21')](_0xe7ba('0x22'),_0x4e3021+'-'+_0x3f326a+'/'+_0x41a773)[_0xe7ba('0x1d')](_0x4390e3);}return null;};}function patchUpdates(_0x136ec6){return function(_0x4aaf35){try{jsonpatch[_0xe7ba('0x23')](_0x4aaf35,_0x136ec6,!![]);}catch(_0x2936b7){return BPromise['reject'](_0x2936b7);}return _0x4aaf35[_0xe7ba('0x24')]();};}function saveUpdates(_0x4514e8,_0x27c882){return function(_0x7ab9e4){if(_0x7ab9e4){return _0x7ab9e4[_0xe7ba('0x25')](_0x4514e8)[_0xe7ba('0x26')](function(_0x293b14){return _0x293b14;});}return null;};}function removeEntity(_0x2b29f0,_0x41cbd9){return function(_0xa72f1c){if(_0xa72f1c){return _0xa72f1c['destroy']()['then'](function(){_0x2b29f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4363a8,_0x576513){return function(_0x4ecc0d){if(!_0x4ecc0d){_0x4363a8['sendStatus'](0x194);}return _0x4ecc0d;};}function handleError(_0x255def,_0x32cc00){_0x32cc00=_0x32cc00||0x1f4;return function(_0xe32862){logger[_0xe7ba('0x27')](_0xe32862[_0xe7ba('0x28')]);if(_0xe32862[_0xe7ba('0x29')]){delete _0xe32862[_0xe7ba('0x29')];}_0x255def[_0xe7ba('0x1b')](_0x32cc00)['send'](_0xe32862);};}exports[_0xe7ba('0x2a')]=function(_0x48c869,_0x102925){var _0x92fe7={},_0x369451={},_0x4bf5f9={'count':0x0,'rows':[]};var _0x587c7d=_[_0xe7ba('0x2b')](db[_0xe7ba('0x2c')][_0xe7ba('0x2d')],function(_0x20b6cd){return{'name':_0x20b6cd[_0xe7ba('0x2e')],'type':_0x20b6cd['type'][_0xe7ba('0x2f')]};});_0x369451[_0xe7ba('0x30')]=_['differenceBy'](_[_0xe7ba('0x2b')](_0x587c7d,'name'),['format']);_0x369451[_0xe7ba('0x31')]=_[_0xe7ba('0x32')](_0x48c869[_0xe7ba('0x31')]);_0x369451['filters']=_[_0xe7ba('0x33')](_0x369451['model'],_0x369451[_0xe7ba('0x31')]);_0x92fe7[_0xe7ba('0x34')]=_[_0xe7ba('0x33')](_0x369451[_0xe7ba('0x30')],qs[_0xe7ba('0x35')](_0x48c869['query'][_0xe7ba('0x35')]));_0x92fe7[_0xe7ba('0x34')]=_0x92fe7['attributes'][_0xe7ba('0x36')]?_0x92fe7[_0xe7ba('0x34')]:_0x369451[_0xe7ba('0x30')];if(!_0x48c869['query'][_0xe7ba('0x37')](_0xe7ba('0x38'))){_0x92fe7['limit']=qs[_0xe7ba('0x1e')](_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x1e')]);_0x92fe7['offset']=qs[_0xe7ba('0x20')](_0x48c869[_0xe7ba('0x31')]['offset']);}_0x92fe7[_0xe7ba('0x39')]=qs[_0xe7ba('0x3a')](_0x48c869[_0xe7ba('0x31')]['sort']);_0x92fe7['where']=qs[_0xe7ba('0x3b')](_[_0xe7ba('0x3c')](_0x48c869[_0xe7ba('0x31')],_0x369451[_0xe7ba('0x3b')]),_0x587c7d);if(_0x48c869[_0xe7ba('0x31')]['filter']){_0x92fe7[_0xe7ba('0x3d')]=_[_0xe7ba('0x3e')](_0x92fe7[_0xe7ba('0x3d')],{'$or':_[_0xe7ba('0x2b')](_0x587c7d,function(_0x5e9619){if(_0x5e9619[_0xe7ba('0x3f')]!==_0xe7ba('0x40')){var _0x46e31a={};_0x46e31a[_0x5e9619[_0xe7ba('0x29')]]={'$like':'%'+_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x41')]+'%'};return _0x46e31a;}})});}_0x92fe7=_[_0xe7ba('0x3e')]({},_0x92fe7,_0x48c869['options']);var _0x3429fa={'where':_0x92fe7[_0xe7ba('0x3d')]};return db[_0xe7ba('0x2c')][_0xe7ba('0x1f')](_0x3429fa)[_0xe7ba('0x26')](function(_0x3b3abe){_0x4bf5f9[_0xe7ba('0x1f')]=_0x3b3abe;if(_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x42')]){_0x92fe7['include']=[{'all':!![]}];}return db[_0xe7ba('0x2c')][_0xe7ba('0x43')](_0x92fe7);})['then'](function(_0x5dae52){_0x4bf5f9[_0xe7ba('0x44')]=_0x5dae52;return _0x4bf5f9;})[_0xe7ba('0x26')](respondWithFilteredResult(_0x102925,_0x92fe7))[_0xe7ba('0x45')](handleError(_0x102925,null));};exports['show']=function(_0x249e1d,_0x82246e){var _0x3569b6={'raw':![],'where':{'id':_0x249e1d[_0xe7ba('0x46')]['id']}},_0x12770d={};_0x12770d['model']=_[_0xe7ba('0x32')](db['ScreenRecording'][_0xe7ba('0x2d')]);_0x12770d[_0xe7ba('0x31')]=_[_0xe7ba('0x32')](_0x249e1d[_0xe7ba('0x31')]);_0x12770d[_0xe7ba('0x3b')]=_[_0xe7ba('0x33')](_0x12770d[_0xe7ba('0x30')],_0x12770d[_0xe7ba('0x31')]);_0x3569b6['attributes']=_[_0xe7ba('0x33')](_0x12770d[_0xe7ba('0x30')],qs[_0xe7ba('0x35')](_0x249e1d[_0xe7ba('0x31')][_0xe7ba('0x35')]));_0x3569b6[_0xe7ba('0x34')]=_0x3569b6[_0xe7ba('0x34')][_0xe7ba('0x36')]?_0x3569b6[_0xe7ba('0x34')]:_0x12770d[_0xe7ba('0x30')];if(_0x249e1d['query'][_0xe7ba('0x42')]){_0x3569b6['include']=[{'all':!![]}];}_0x3569b6=_[_0xe7ba('0x3e')]({},_0x3569b6,_0x249e1d[_0xe7ba('0x47')]);return db[_0xe7ba('0x2c')][_0xe7ba('0x48')](_0x3569b6)[_0xe7ba('0x26')](handleEntityNotFound(_0x82246e,null))[_0xe7ba('0x26')](respondWithResult(_0x82246e,null))['catch'](handleError(_0x82246e,null));};exports[_0xe7ba('0x49')]=function(_0x1cc668,_0x3f17ed){return db[_0xe7ba('0x2c')][_0xe7ba('0x49')](_0x1cc668[_0xe7ba('0x4a')],{})[_0xe7ba('0x26')](respondWithResult(_0x3f17ed,0xc9))[_0xe7ba('0x45')](handleError(_0x3f17ed,null));};exports[_0xe7ba('0x25')]=function(_0x1189bd,_0xbe2a32){if(_0x1189bd['body']['id']){delete _0x1189bd[_0xe7ba('0x4a')]['id'];}delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4b')];delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4c')];delete _0x1189bd[_0xe7ba('0x4a')]['closedAt'];delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4d')];return db['ScreenRecording'][_0xe7ba('0x48')]({'where':{'id':_0x1189bd[_0xe7ba('0x46')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0xbe2a32,null))[_0xe7ba('0x26')](saveUpdates(_0x1189bd['body'],null))['then'](respondWithResult(_0xbe2a32,null))[_0xe7ba('0x45')](handleError(_0xbe2a32,null));};exports[_0xe7ba('0x4e')]=function(_0x285743,_0x5af106){return db[_0xe7ba('0x2c')][_0xe7ba('0x4e')]()[_0xe7ba('0x26')](respondWithResult(_0x5af106,null))[_0xe7ba('0x45')](handleError(_0x5af106,null));};exports[_0xe7ba('0x4f')]=function(_0x6b6f1,_0xf3a41f,_0x5e6612){var _0x2a6fdd=require(_0xe7ba('0x50'));var _0x316b51=![];var _0x5863c8={};if(_0x6b6f1[_0xe7ba('0x31')][_0xe7ba('0x3f')]&&_0x6b6f1['query'][_0xe7ba('0x3f')]===_0xe7ba('0x51')){_0x5863c8['uniqueid']=_0x6b6f1[_0xe7ba('0x46')]['id'];}else{_0x5863c8['id']=_0x6b6f1['params']['id'];}return db[_0xe7ba('0x2c')][_0xe7ba('0x48')]({'where':_0x5863c8,'attributes':['id',_0xe7ba('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0xf3a41f,null))[_0xe7ba('0x26')](function(_0x1128be){if(_0x1128be){var _0x314549=path[_0xe7ba('0x52')](config[_0xe7ba('0x53')],'server/files/screen_recordings',_0x1128be[_0xe7ba('0x4d')]);var _0x455e50=util[_0xe7ba('0x54')](_0xe7ba('0x55'),_0x314549);if(fs[_0xe7ba('0x56')](_0x455e50)){_0x316b51=!![];return _0x2a6fdd['decryptFile'](_0x455e50,_0x314549,config[_0xe7ba('0x57')][_0xe7ba('0x58')])[_0xe7ba('0x26')](function(){return _0x1128be;});}return _0x1128be;}})[_0xe7ba('0x26')](function(_0x57b23e){if(_0x57b23e){var _0x3e31c1=path[_0xe7ba('0x52')](config[_0xe7ba('0x53')],_0xe7ba('0x59'),_0x57b23e[_0xe7ba('0x4d')]);if(!fs[_0xe7ba('0x56')](_0x3e31c1)){throw new db['Sequelize'][(_0xe7ba('0x5a'))](_0xe7ba('0x5b'));}if(_0x57b23e[_0xe7ba('0x5c')]){return _0xf3a41f['download'](_0x3e31c1,_0x57b23e[_0xe7ba('0x5c')]+path[_0xe7ba('0x5d')](_0x3e31c1),function(){if(_0x316b51){fs[_0xe7ba('0x5e')](_0x3e31c1);}});}else{return _0xf3a41f[_0xe7ba('0x4f')](_0x3e31c1,function(_0x45fb0f){if(_0x316b51){fs[_0xe7ba('0x5e')](_0x3e31c1);}});}}})[_0xe7ba('0x45')](function(_0x3351d5){if(_0x3351d5[_0xe7ba('0x5f')]===_0xe7ba('0x5b')){_0xf3a41f[_0xe7ba('0x1b')](0x194)[_0xe7ba('0x60')]('Not\x20found');}else{return handleError(_0xf3a41f,null);}});};exports[_0xe7ba('0x61')]=function(_0x384cea,_0x357af4){return db['ScreenRecording'][_0xe7ba('0x48')]({'where':{'id':_0x384cea['params']['id']}})[_0xe7ba('0x26')](function(_0x194dff){if(_[_0xe7ba('0x62')](_0x194dff)){throw new ReferenceError('Entity\x20not\x20found');}return _0x194dff;})['then'](function(_0x46d06e){var _0x2812af=path[_0xe7ba('0x52')](config['root'],_0xe7ba('0x59'),_0x46d06e[_0xe7ba('0x4d')]);logger[_0xe7ba('0x63')](_0xe7ba('0x64'),_0x2812af);if(!_[_0xe7ba('0x62')](_0x46d06e['value'])&&fs[_0xe7ba('0x56')](_0x2812af)){logger[_0xe7ba('0x63')](_0xe7ba('0x65')+_0x2812af+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe7ba('0x66')](_0x2812af);}_0x2812af=_0x2812af+_0xe7ba('0x67');if(!_[_0xe7ba('0x62')](_0x46d06e[_0xe7ba('0x4d')])&&fs[_0xe7ba('0x56')](_0x2812af)){logger[_0xe7ba('0x63')](_0xe7ba('0x65')+_0x2812af+_0xe7ba('0x68'));fs[_0xe7ba('0x66')](_0x2812af);}return _0x46d06e;})[_0xe7ba('0x26')](function(_0x5a5394){if(!_0x5a5394)throw new InternalError();return _0x5a5394[_0xe7ba('0x61')]();})[_0xe7ba('0x26')](function(){_0x357af4[_0xe7ba('0x1b')](0xcc)[_0xe7ba('0x1c')]();})['catch'](handleError(_0x357af4,null));}; \ No newline at end of file +var _0x7dfd=['../../components/encryptor','uniqueid','join','%s.cypher','existsSync','decryptFile','secrets','root','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','stack','name','send','index','ScreenRecording','fieldName','key','model','map','format','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','length','catch','create','body','duration','createdAt','closedAt','value','find','describe','download'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd7df('0x0'));var rimraf=require(_0xd7df('0x1'));var zipdir=require(_0xd7df('0x2'));var jsonpatch=require(_0xd7df('0x3'));var rp=require(_0xd7df('0x4'));var moment=require(_0xd7df('0x5'));var BPromise=require(_0xd7df('0x6'));var Mustache=require(_0xd7df('0x7'));var util=require(_0xd7df('0x8'));var path=require(_0xd7df('0x9'));var sox=require(_0xd7df('0xa'));var csv=require(_0xd7df('0xb'));var ejs=require(_0xd7df('0xc'));var fs=require('fs');var fs_extra=require(_0xd7df('0xd'));var _=require(_0xd7df('0xe'));var squel=require(_0xd7df('0xf'));var crypto=require(_0xd7df('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xd7df('0x11'));var toCsv=require(_0xd7df('0xb'));var querystring=require(_0xd7df('0x12'));var Papa=require(_0xd7df('0x13'));var Redis=require('ioredis');var authService=require(_0xd7df('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd7df('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7df('0x16'))(_0xd7df('0x17'));var utils=require(_0xd7df('0x18'));var config=require(_0xd7df('0x19'));var licenseUtil=require(_0xd7df('0x1a'));var db=require(_0xd7df('0x1b'))['db'];function respondWithStatusCode(_0x2e8187,_0x3da618){_0x3da618=_0x3da618||0xcc;return function(_0x7ba3c){if(_0x7ba3c){return _0x2e8187[_0xd7df('0x1c')](_0x3da618);}return _0x2e8187[_0xd7df('0x1d')](_0x3da618)[_0xd7df('0x1e')]();};}function respondWithResult(_0xe1595f,_0x196632){_0x196632=_0x196632||0xc8;return function(_0x3b2559){if(_0x3b2559){return _0xe1595f[_0xd7df('0x1d')](_0x196632)[_0xd7df('0x1f')](_0x3b2559);}};}function respondWithFilteredResult(_0x57b8be,_0x4c5cf){return function(_0x23cdbc){if(_0x23cdbc){var _0x513b13=typeof _0x4c5cf[_0xd7df('0x20')]===_0xd7df('0x21')&&typeof _0x4c5cf['limit']===_0xd7df('0x21');var _0x30ee65=_0x23cdbc[_0xd7df('0x22')];var _0x5210e5=_0x513b13?0x0:_0x4c5cf[_0xd7df('0x20')];var _0x471621=_0x513b13?_0x23cdbc[_0xd7df('0x22')]:_0x4c5cf['offset']+_0x4c5cf[_0xd7df('0x23')];var _0x20dc3e;if(_0x471621>=_0x30ee65){_0x471621=_0x30ee65;_0x20dc3e=0xc8;}else{_0x20dc3e=0xce;}_0x57b8be[_0xd7df('0x1d')](_0x20dc3e);return _0x57b8be['set'](_0xd7df('0x24'),_0x5210e5+'-'+_0x471621+'/'+_0x30ee65)['json'](_0x23cdbc);}return null;};}function patchUpdates(_0x225e33){return function(_0x5ab737){try{jsonpatch[_0xd7df('0x25')](_0x5ab737,_0x225e33,!![]);}catch(_0x342b54){return BPromise[_0xd7df('0x26')](_0x342b54);}return _0x5ab737['save']();};}function saveUpdates(_0xc50077,_0x502ae8){return function(_0x44079b){if(_0x44079b){return _0x44079b[_0xd7df('0x27')](_0xc50077)[_0xd7df('0x28')](function(_0x29f354){return _0x29f354;});}return null;};}function removeEntity(_0x1c774b,_0xa80cbf){return function(_0x1e3bf3){if(_0x1e3bf3){return _0x1e3bf3['destroy']()['then'](function(){_0x1c774b[_0xd7df('0x1d')](0xcc)[_0xd7df('0x1e')]();});}};}function handleEntityNotFound(_0x26047f,_0x459f11){return function(_0x13f190){if(!_0x13f190){_0x26047f[_0xd7df('0x1c')](0x194);}return _0x13f190;};}function handleError(_0x373359,_0x2b6fde){_0x2b6fde=_0x2b6fde||0x1f4;return function(_0x163904){logger['error'](_0x163904[_0xd7df('0x29')]);if(_0x163904[_0xd7df('0x2a')]){delete _0x163904[_0xd7df('0x2a')];}_0x373359[_0xd7df('0x1d')](_0x2b6fde)[_0xd7df('0x2b')](_0x163904);};}exports[_0xd7df('0x2c')]=function(_0x3f78fa,_0x36de76){var _0x5195cf={},_0x4ba779={},_0x52b56a={'count':0x0,'rows':[]};var _0x58584d=_['map'](db[_0xd7df('0x2d')]['rawAttributes'],function(_0xd366b){return{'name':_0xd366b[_0xd7df('0x2e')],'type':_0xd366b['type'][_0xd7df('0x2f')]};});_0x4ba779[_0xd7df('0x30')]=_['differenceBy'](_[_0xd7df('0x31')](_0x58584d,_0xd7df('0x2a')),[_0xd7df('0x32')]);_0x4ba779[_0xd7df('0x33')]=_[_0xd7df('0x34')](_0x3f78fa[_0xd7df('0x33')]);_0x4ba779['filters']=_[_0xd7df('0x35')](_0x4ba779[_0xd7df('0x30')],_0x4ba779[_0xd7df('0x33')]);_0x5195cf[_0xd7df('0x36')]=_[_0xd7df('0x35')](_0x4ba779[_0xd7df('0x30')],qs[_0xd7df('0x37')](_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x37')]));_0x5195cf[_0xd7df('0x36')]=_0x5195cf[_0xd7df('0x36')]['length']?_0x5195cf['attributes']:_0x4ba779[_0xd7df('0x30')];if(!_0x3f78fa['query'][_0xd7df('0x38')](_0xd7df('0x39'))){_0x5195cf[_0xd7df('0x23')]=qs[_0xd7df('0x23')](_0x3f78fa['query']['limit']);_0x5195cf['offset']=qs[_0xd7df('0x20')](_0x3f78fa[_0xd7df('0x33')]['offset']);}_0x5195cf[_0xd7df('0x3a')]=qs[_0xd7df('0x3b')](_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x3b')]);_0x5195cf['where']=qs[_0xd7df('0x3c')](_[_0xd7df('0x3d')](_0x3f78fa['query'],_0x4ba779[_0xd7df('0x3c')]),_0x58584d);if(_0x3f78fa['query'][_0xd7df('0x3e')]){_0x5195cf[_0xd7df('0x3f')]=_[_0xd7df('0x40')](_0x5195cf['where'],{'$or':_[_0xd7df('0x31')](_0x58584d,function(_0x2a7252){if(_0x2a7252[_0xd7df('0x41')]!==_0xd7df('0x42')){var _0x54ea42={};_0x54ea42[_0x2a7252[_0xd7df('0x2a')]]={'$like':'%'+_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x3e')]+'%'};return _0x54ea42;}})});}_0x5195cf=_['merge']({},_0x5195cf,_0x3f78fa[_0xd7df('0x43')]);var _0x207852={'where':_0x5195cf[_0xd7df('0x3f')]};return db['ScreenRecording'][_0xd7df('0x22')](_0x207852)[_0xd7df('0x28')](function(_0x4910cb){_0x52b56a['count']=_0x4910cb;if(_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x44')]){_0x5195cf[_0xd7df('0x45')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x5195cf);})[_0xd7df('0x28')](function(_0x4ebdbe){_0x52b56a[_0xd7df('0x46')]=_0x4ebdbe;return _0x52b56a;})['then'](respondWithFilteredResult(_0x36de76,_0x5195cf))['catch'](handleError(_0x36de76,null));};exports[_0xd7df('0x47')]=function(_0x579d0f,_0x18ef10){var _0x5302f4={'raw':![],'where':{'id':_0x579d0f[_0xd7df('0x48')]['id']}},_0xad2d69={};_0xad2d69[_0xd7df('0x30')]=_[_0xd7df('0x34')](db[_0xd7df('0x2d')][_0xd7df('0x49')]);_0xad2d69[_0xd7df('0x33')]=_['keys'](_0x579d0f[_0xd7df('0x33')]);_0xad2d69['filters']=_[_0xd7df('0x35')](_0xad2d69[_0xd7df('0x30')],_0xad2d69[_0xd7df('0x33')]);_0x5302f4[_0xd7df('0x36')]=_[_0xd7df('0x35')](_0xad2d69[_0xd7df('0x30')],qs[_0xd7df('0x37')](_0x579d0f[_0xd7df('0x33')][_0xd7df('0x37')]));_0x5302f4['attributes']=_0x5302f4[_0xd7df('0x36')][_0xd7df('0x4a')]?_0x5302f4['attributes']:_0xad2d69['model'];if(_0x579d0f[_0xd7df('0x33')][_0xd7df('0x44')]){_0x5302f4[_0xd7df('0x45')]=[{'all':!![]}];}_0x5302f4=_['merge']({},_0x5302f4,_0x579d0f['options']);return db[_0xd7df('0x2d')]['find'](_0x5302f4)[_0xd7df('0x28')](handleEntityNotFound(_0x18ef10,null))[_0xd7df('0x28')](respondWithResult(_0x18ef10,null))[_0xd7df('0x4b')](handleError(_0x18ef10,null));};exports[_0xd7df('0x4c')]=function(_0x1838aa,_0x28c13f){return db[_0xd7df('0x2d')][_0xd7df('0x4c')](_0x1838aa[_0xd7df('0x4d')],{})[_0xd7df('0x28')](respondWithResult(_0x28c13f,0xc9))[_0xd7df('0x4b')](handleError(_0x28c13f,null));};exports[_0xd7df('0x27')]=function(_0x54222c,_0x1f2f99){if(_0x54222c[_0xd7df('0x4d')]['id']){delete _0x54222c[_0xd7df('0x4d')]['id'];}delete _0x54222c[_0xd7df('0x4d')][_0xd7df('0x4e')];delete _0x54222c['body'][_0xd7df('0x4f')];delete _0x54222c[_0xd7df('0x4d')][_0xd7df('0x50')];delete _0x54222c['body'][_0xd7df('0x51')];return db['ScreenRecording'][_0xd7df('0x52')]({'where':{'id':_0x54222c[_0xd7df('0x48')]['id']}})[_0xd7df('0x28')](handleEntityNotFound(_0x1f2f99,null))[_0xd7df('0x28')](saveUpdates(_0x54222c[_0xd7df('0x4d')],null))['then'](respondWithResult(_0x1f2f99,null))['catch'](handleError(_0x1f2f99,null));};exports['describe']=function(_0xe4b221,_0x4a6cf5){return db[_0xd7df('0x2d')][_0xd7df('0x53')]()[_0xd7df('0x28')](respondWithResult(_0x4a6cf5,null))[_0xd7df('0x4b')](handleError(_0x4a6cf5,null));};exports[_0xd7df('0x54')]=function(_0x418da,_0xf72803,_0xb054d7){var _0x453876=require(_0xd7df('0x55'));var _0x382d11=![];var _0x327365={};if(_0x418da[_0xd7df('0x33')][_0xd7df('0x41')]&&_0x418da[_0xd7df('0x33')][_0xd7df('0x41')]==='uniqueid'){_0x327365[_0xd7df('0x56')]=_0x418da[_0xd7df('0x48')]['id'];}else{_0x327365['id']=_0x418da['params']['id'];}return db['ScreenRecording'][_0xd7df('0x52')]({'where':_0x327365,'attributes':['id','value'],'raw':!![]})[_0xd7df('0x28')](handleEntityNotFound(_0xf72803,null))['then'](function(_0x1f34c2){if(_0x1f34c2){var _0x28151a=path[_0xd7df('0x57')](config['root'],'server/files/screen_recordings',_0x1f34c2['value']);var _0x3666ba=util[_0xd7df('0x32')](_0xd7df('0x58'),_0x28151a);if(fs[_0xd7df('0x59')](_0x3666ba)){_0x382d11=!![];return _0x453876[_0xd7df('0x5a')](_0x3666ba,_0x28151a,config[_0xd7df('0x5b')]['recording'])[_0xd7df('0x28')](function(){return _0x1f34c2;});}return _0x1f34c2;}})[_0xd7df('0x28')](function(_0x35204f){if(_0x35204f){var _0x25d187=path[_0xd7df('0x57')](config[_0xd7df('0x5c')],_0xd7df('0x5d'),_0x35204f[_0xd7df('0x51')]);if(!fs[_0xd7df('0x59')](_0x25d187)){throw new db[(_0xd7df('0x5e'))][(_0xd7df('0x5f'))](_0xd7df('0x60'));}if(_0x35204f[_0xd7df('0x61')]){return _0xf72803[_0xd7df('0x54')](_0x25d187,_0x35204f[_0xd7df('0x61')]+path[_0xd7df('0x62')](_0x25d187),function(){if(_0x382d11){fs[_0xd7df('0x63')](_0x25d187);}});}else{return _0xf72803[_0xd7df('0x54')](_0x25d187,function(_0x3f2775){if(_0x382d11){fs[_0xd7df('0x63')](_0x25d187);}});}}})[_0xd7df('0x4b')](function(_0x393a3a){if(_0x393a3a[_0xd7df('0x64')]===_0xd7df('0x60')){_0xf72803[_0xd7df('0x1d')](0x194)[_0xd7df('0x2b')]('Not\x20found');}else{return handleError(_0xf72803,null);}});};exports['destroy']=function(_0x327402,_0x28f550){return db[_0xd7df('0x2d')]['find']({'where':{'id':_0x327402[_0xd7df('0x48')]['id']}})[_0xd7df('0x28')](function(_0x1e87aa){if(_[_0xd7df('0x65')](_0x1e87aa)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1e87aa;})[_0xd7df('0x28')](function(_0x20ad50){var _0xb06a56=path[_0xd7df('0x57')](config[_0xd7df('0x5c')],_0xd7df('0x5d'),_0x20ad50[_0xd7df('0x51')]);logger[_0xd7df('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0xb06a56);if(!_[_0xd7df('0x65')](_0x20ad50[_0xd7df('0x51')])&&fs['existsSync'](_0xb06a56)){logger['info']('File:\x20\x22'+_0xb06a56+_0xd7df('0x67'));fs[_0xd7df('0x68')](_0xb06a56);}_0xb06a56=_0xb06a56+_0xd7df('0x69');if(!_[_0xd7df('0x65')](_0x20ad50['value'])&&fs[_0xd7df('0x59')](_0xb06a56)){logger[_0xd7df('0x66')](_0xd7df('0x6a')+_0xb06a56+_0xd7df('0x67'));fs[_0xd7df('0x68')](_0xb06a56);}return _0x20ad50;})[_0xd7df('0x28')](function(_0x4124b8){if(!_0x4124b8)throw new InternalError();return _0x4124b8['destroy']();})['then'](function(){_0x28f550[_0xd7df('0x1d')](0xcc)['end']();})[_0xd7df('0x4b')](handleError(_0x28f550,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index c3e3a4e..b965207 100644 --- a/server/api/screenRecording/screenRecording.model.js +++ b/server/api/screenRecording/screenRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x71b2=['moment','request-promise','path','rimraf','../../config/environment','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','api'];(function(_0x2781c1,_0x45a2aa){var _0x4bf4a9=function(_0x2cc579){while(--_0x2cc579){_0x2781c1['push'](_0x2781c1['shift']());}};_0x4bf4a9(++_0x45a2aa);}(_0x71b2,0x183));var _0x271b=function(_0x2f8140,_0x37076b){_0x2f8140=_0x2f8140-0x0;var _0x21bd12=_0x71b2[_0x2f8140];return _0x21bd12;};'use strict';var _=require(_0x271b('0x0'));var util=require(_0x271b('0x1'));var logger=require('../../config/logger')(_0x271b('0x2'));var moment=require(_0x271b('0x3'));var BPromise=require('bluebird');var rp=require(_0x271b('0x4'));var fs=require('fs');var path=require(_0x271b('0x5'));var rimraf=require(_0x271b('0x6'));var config=require(_0x271b('0x7'));var attributes=require('./screenRecording.attributes');module[_0x271b('0x8')]=function(_0x5f5959,_0x574a3e){return _0x5f5959[_0x271b('0x9')](_0x271b('0xa'),attributes,{'tableName':_0x271b('0xb'),'paranoid':![],'indexes':[{'name':_0x271b('0xc'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3fda=['define','ScreenRecording','screen_recordings','interactionid','util','moment','bluebird','path','rimraf','../../config/environment','./screenRecording.attributes','exports'];(function(_0x2f5592,_0x3e145){var _0x57bbba=function(_0x4c2b7d){while(--_0x4c2b7d){_0x2f5592['push'](_0x2f5592['shift']());}};_0x57bbba(++_0x3e145);}(_0x3fda,0xd0));var _0xa3fd=function(_0x372882,_0x2695a6){_0x372882=_0x372882-0x0;var _0x395600=_0x3fda[_0x372882];return _0x395600;};'use strict';var _=require('lodash');var util=require(_0xa3fd('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa3fd('0x1'));var BPromise=require(_0xa3fd('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa3fd('0x3'));var rimraf=require(_0xa3fd('0x4'));var config=require(_0xa3fd('0x5'));var attributes=require(_0xa3fd('0x6'));module[_0xa3fd('0x7')]=function(_0x25ca57,_0x52a8b9){return _0x25ca57[_0xa3fd('0x8')](_0xa3fd('0x9'),attributes,{'tableName':_0xa3fd('0xa'),'paranoid':![],'indexes':[{'name':_0xa3fd('0xb'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 7f58241..5e6578a 100644 --- a/server/api/screenRecording/screenRecording.rpc.js +++ b/server/api/screenRecording/screenRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa91f=['result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x17c68b,_0x45f9b4){var _0x8005b3=function(_0x428964){while(--_0x428964){_0x17c68b['push'](_0x17c68b['shift']());}};_0x8005b3(++_0x45f9b4);}(_0xa91f,0x16b));var _0xfa91=function(_0x1e6cbc,_0x5410c3){_0x1e6cbc=_0x1e6cbc-0x0;var _0x9852ab=_0xa91f[_0x1e6cbc];return _0x9852ab;};'use strict';var _=require(_0xfa91('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfa91('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa91('0x2'));var db=require(_0xfa91('0x3'))['db'];var utils=require(_0xfa91('0x4'));var logger=require('../../config/logger')(_0xfa91('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfa91('0x6')][_0xfa91('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x9d5396,_0x2e2e25,_0x24e641){return new BPromise(function(_0x507c71,_0x4e0532){return client['request'](_0x9d5396,_0x24e641)[_0xfa91('0x8')](function(_0x56e413){logger['info'](_0xfa91('0x9'),_0x2e2e25,_0xfa91('0xa'));logger[_0xfa91('0xb')](_0xfa91('0xc'),_0x2e2e25,_0xfa91('0xa'),JSON[_0xfa91('0xd')](_0x56e413));if(_0x56e413[_0xfa91('0xe')]){if(_0x56e413[_0xfa91('0xe')]['code']===0x1f4){logger[_0xfa91('0xe')](_0xfa91('0x9'),_0x2e2e25,_0x56e413[_0xfa91('0xe')][_0xfa91('0xf')]);return _0x4e0532(_0x56e413[_0xfa91('0xe')][_0xfa91('0xf')]);}logger[_0xfa91('0xe')](_0xfa91('0x9'),_0x2e2e25,_0x56e413[_0xfa91('0xe')][_0xfa91('0xf')]);return _0x507c71(_0x56e413[_0xfa91('0xe')][_0xfa91('0xf')]);}else{logger[_0xfa91('0x10')](_0xfa91('0x9'),_0x2e2e25,_0xfa91('0xa'));_0x507c71(_0x56e413[_0xfa91('0x11')]['message']);}})[_0xfa91('0x12')](function(_0x5a4409){logger['error'](_0xfa91('0x9'),_0x2e2e25,_0x5a4409);_0x4e0532(_0x5a4409);});});} \ No newline at end of file +var _0x015a=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util'];(function(_0x2a2938,_0x2dea11){var _0x144585=function(_0x582ab6){while(--_0x582ab6){_0x2a2938['push'](_0x2a2938['shift']());}};_0x144585(++_0x2dea11);}(_0x015a,0x1cc));var _0xa015=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x015a[_0x35885a];return _0xe86249;};'use strict';var _=require(_0xa015('0x0'));var util=require(_0xa015('0x1'));var moment=require(_0xa015('0x2'));var BPromise=require(_0xa015('0x3'));var rs=require(_0xa015('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa015('0x5'))['db'];var utils=require(_0xa015('0x6'));var logger=require(_0xa015('0x7'))(_0xa015('0x8'));var config=require('../../config/environment');var jayson=require(_0xa015('0x9'));var client=jayson[_0xa015('0xa')][_0xa015('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37c9d6,_0x207d31,_0x520686){return new BPromise(function(_0x170e48,_0x43edee){return client[_0xa015('0xc')](_0x37c9d6,_0x520686)[_0xa015('0xd')](function(_0x3db85d){logger['info'](_0xa015('0xe'),_0x207d31,_0xa015('0xf'));logger[_0xa015('0x10')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x207d31,_0xa015('0xf'),JSON[_0xa015('0x11')](_0x3db85d));if(_0x3db85d[_0xa015('0x12')]){if(_0x3db85d[_0xa015('0x12')][_0xa015('0x13')]===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x207d31,_0x3db85d['error']['message']);return _0x43edee(_0x3db85d['error'][_0xa015('0x14')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x207d31,_0x3db85d[_0xa015('0x12')][_0xa015('0x14')]);return _0x170e48(_0x3db85d[_0xa015('0x12')]['message']);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x207d31,_0xa015('0xf'));_0x170e48(_0x3db85d['result']['message']);}})[_0xa015('0x15')](function(_0x47745a){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x207d31,_0x47745a);_0x43edee(_0x47745a);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 070a485..7bfd549 100644 --- a/server/api/setting/index.js +++ b/server/api/setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb32=['single','file','addLogo','logologin','originalname','addLogoLogin','join','addPreferred','favicon','/:id/favicon','addFavicon','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/now','getDate','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','post'];(function(_0x401b47,_0x5c1964){var _0x8ba713=function(_0x4b6b0b){while(--_0x4b6b0b){_0x401b47['push'](_0x401b47['shift']());}};_0x8ba713(++_0x5c1964);}(_0xdb32,0xde));var _0x2db3=function(_0x378aa6,_0x30e8e5){_0x378aa6=_0x378aa6-0x0;var _0x72610=_0xdb32[_0x378aa6];return _0x72610;};'use strict';var multer=require(_0x2db3('0x0'));var util=require(_0x2db3('0x1'));var path=require('path');var timeout=require(_0x2db3('0x2'));var express=require(_0x2db3('0x3'));var router=express[_0x2db3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2db3('0x5'));var interaction=require(_0x2db3('0x6'));var config=require(_0x2db3('0x7'));var controller=require(_0x2db3('0x8'));router[_0x2db3('0x9')]('/',auth[_0x2db3('0xa')](),controller['index']);router[_0x2db3('0x9')](_0x2db3('0xb'),controller[_0x2db3('0xc')]);router[_0x2db3('0x9')](_0x2db3('0xd'),controller[_0x2db3('0xe')]);router[_0x2db3('0x9')](_0x2db3('0xf'),controller['getLogo']);router['get'](_0x2db3('0x10'),controller[_0x2db3('0x11')]);router[_0x2db3('0x9')]('/:id/gdpr',controller[_0x2db3('0x12')]);router['get'](_0x2db3('0x13'),controller[_0x2db3('0x14')]);router[_0x2db3('0x9')]('/:id/favicon',controller[_0x2db3('0x15')]);var upload=multer({'storage':multer[_0x2db3('0x16')]({'destination':function(_0x5821fa,_0x5a265f,_0x4c599c){_0x4c599c(null,path['join'](config[_0x2db3('0x17')],_0x2db3('0x18')));},'filename':function(_0x1ead1d,_0x4f44ec,_0x137be4){_0x137be4(null,util[_0x2db3('0x19')](_0x2db3('0x1a'),_0x2db3('0x1b'),path[_0x2db3('0x1c')](_0x4f44ec['originalname'])));}})});router[_0x2db3('0x1d')]('/:id/logo',upload[_0x2db3('0x1e')](_0x2db3('0x1f')),controller[_0x2db3('0x20')]);var upload=multer({'storage':multer[_0x2db3('0x16')]({'destination':function(_0x1c9b81,_0xc3a726,_0x4f8d87){_0x4f8d87(null,path['join'](config[_0x2db3('0x17')],_0x2db3('0x18')));},'filename':function(_0x43ab21,_0x7318f8,_0x493a62){_0x493a62(null,util['format'](_0x2db3('0x1a'),_0x2db3('0x21'),path[_0x2db3('0x1c')](_0x7318f8[_0x2db3('0x22')])));}})});router['post'](_0x2db3('0x10'),upload[_0x2db3('0x1e')]('file'),controller[_0x2db3('0x23')]);var upload=multer({'storage':multer[_0x2db3('0x16')]({'destination':function(_0x23c423,_0x1ae7d9,_0x1b7229){_0x1b7229(null,path[_0x2db3('0x24')](config[_0x2db3('0x17')],_0x2db3('0x18')));},'filename':function(_0x4d8804,_0x510ec9,_0x4d7132){_0x4d7132(null,util[_0x2db3('0x19')]('%s%s','preferred',path[_0x2db3('0x1c')](_0x510ec9[_0x2db3('0x22')])));}})});router[_0x2db3('0x1d')](_0x2db3('0x13'),upload['single'](_0x2db3('0x1f')),controller[_0x2db3('0x25')]);var upload=multer({'storage':multer[_0x2db3('0x16')]({'destination':function(_0x573847,_0x56e9c5,_0x586fbf){_0x586fbf(null,path[_0x2db3('0x24')](config[_0x2db3('0x17')],'server/files/images/logos/'));},'filename':function(_0x17b874,_0x5a7856,_0x1a9380){_0x1a9380(null,util[_0x2db3('0x19')](_0x2db3('0x1a'),_0x2db3('0x26'),path[_0x2db3('0x1c')](_0x5a7856[_0x2db3('0x22')])));}})});router[_0x2db3('0x1d')](_0x2db3('0x27'),upload['single']('file'),controller[_0x2db3('0x28')]);router['put'](_0x2db3('0xd'),auth['isAuthenticated'](),controller['update']);module[_0x2db3('0x29')]=router; \ No newline at end of file +var _0xc0bf=['isAuthenticated','index','/now','getDate','/:id','show','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','/:id/logo','single','file','logologin','addPreferred','addFavicon','put','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','get'];(function(_0x30f3c3,_0x2db7b1){var _0x3327ab=function(_0x1bc7ad){while(--_0x1bc7ad){_0x30f3c3['push'](_0x30f3c3['shift']());}};_0x3327ab(++_0x2db7b1);}(_0xc0bf,0xc4));var _0xfc0b=function(_0x566587,_0x1be561){_0x566587=_0x566587-0x0;var _0x27d817=_0xc0bf[_0x566587];return _0x27d817;};'use strict';var multer=require('multer');var util=require(_0xfc0b('0x0'));var path=require(_0xfc0b('0x1'));var timeout=require(_0xfc0b('0x2'));var express=require('express');var router=express[_0xfc0b('0x3')]();var fs_extra=require(_0xfc0b('0x4'));var auth=require(_0xfc0b('0x5'));var interaction=require(_0xfc0b('0x6'));var config=require('../../config/environment');var controller=require(_0xfc0b('0x7'));router[_0xfc0b('0x8')]('/',auth[_0xfc0b('0x9')](),controller[_0xfc0b('0xa')]);router[_0xfc0b('0x8')](_0xfc0b('0xb'),controller[_0xfc0b('0xc')]);router[_0xfc0b('0x8')](_0xfc0b('0xd'),controller[_0xfc0b('0xe')]);router[_0xfc0b('0x8')]('/:id/logo',controller['getLogo']);router[_0xfc0b('0x8')](_0xfc0b('0xf'),controller[_0xfc0b('0x10')]);router[_0xfc0b('0x8')](_0xfc0b('0x11'),controller[_0xfc0b('0x12')]);router['get'](_0xfc0b('0x13'),controller[_0xfc0b('0x14')]);router[_0xfc0b('0x8')](_0xfc0b('0x15'),controller[_0xfc0b('0x16')]);var upload=multer({'storage':multer[_0xfc0b('0x17')]({'destination':function(_0x3f69a1,_0x792f46,_0x34ecab){_0x34ecab(null,path[_0xfc0b('0x18')](config[_0xfc0b('0x19')],_0xfc0b('0x1a')));},'filename':function(_0x2bb957,_0xd3d899,_0x5641a9){_0x5641a9(null,util[_0xfc0b('0x1b')](_0xfc0b('0x1c'),_0xfc0b('0x1d'),path[_0xfc0b('0x1e')](_0xd3d899[_0xfc0b('0x1f')])));}})});router[_0xfc0b('0x20')](_0xfc0b('0x21'),upload[_0xfc0b('0x22')](_0xfc0b('0x23')),controller['addLogo']);var upload=multer({'storage':multer[_0xfc0b('0x17')]({'destination':function(_0x23807f,_0x29a7b2,_0x5ed212){_0x5ed212(null,path[_0xfc0b('0x18')](config[_0xfc0b('0x19')],_0xfc0b('0x1a')));},'filename':function(_0x18ebf7,_0x32af29,_0x4e0415){_0x4e0415(null,util[_0xfc0b('0x1b')]('%s%s',_0xfc0b('0x24'),path['extname'](_0x32af29[_0xfc0b('0x1f')])));}})});router[_0xfc0b('0x20')](_0xfc0b('0xf'),upload['single'](_0xfc0b('0x23')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xfc0b('0x17')]({'destination':function(_0x1fdd96,_0x370650,_0x543947){_0x543947(null,path[_0xfc0b('0x18')](config[_0xfc0b('0x19')],_0xfc0b('0x1a')));},'filename':function(_0x4fe970,_0x1cc849,_0x8eed7a){_0x8eed7a(null,util['format']('%s%s','preferred',path[_0xfc0b('0x1e')](_0x1cc849[_0xfc0b('0x1f')])));}})});router[_0xfc0b('0x20')](_0xfc0b('0x13'),upload[_0xfc0b('0x22')](_0xfc0b('0x23')),controller[_0xfc0b('0x25')]);var upload=multer({'storage':multer[_0xfc0b('0x17')]({'destination':function(_0x487f96,_0x20abe0,_0x382401){_0x382401(null,path[_0xfc0b('0x18')](config[_0xfc0b('0x19')],'server/files/images/logos/'));},'filename':function(_0x54013f,_0x2f698c,_0xdde56b){_0xdde56b(null,util[_0xfc0b('0x1b')]('%s%s','favicon',path['extname'](_0x2f698c[_0xfc0b('0x1f')])));}})});router[_0xfc0b('0x20')](_0xfc0b('0x15'),upload[_0xfc0b('0x22')](_0xfc0b('0x23')),controller[_0xfc0b('0x26')]);router[_0xfc0b('0x27')]('/:id',auth[_0xfc0b('0x9')](),controller['update']);module[_0xfc0b('0x28')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 6b6a2d8..afe3728 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x835b=['BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','min_internal','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x4d9108,_0x4b2c2c){var _0x5b31bd=function(_0x3a8baf){while(--_0x3a8baf){_0x4d9108['push'](_0x4d9108['shift']());}};_0x5b31bd(++_0x4b2c2c);}(_0x835b,0x9a));var _0xb835=function(_0xf8b0d4,_0x13cdd2){_0xf8b0d4=_0xf8b0d4-0x0;var _0x323c68=_0x835b[_0xf8b0d4];return _0x323c68;};'use strict';var Sequelize=require(_0xb835('0x0'));module['exports']={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0xb835('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xb835('0x2')](0xb),'unique':_0xb835('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xb835('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xb835('0x4')],'defaultValue':_0xb835('0x5')},'logo':{'type':Sequelize[_0xb835('0x4')]},'defaultLogo':{'type':Sequelize[_0xb835('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xb835('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0xb835('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xb835('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xb835('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xb835('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xb835('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0xb835('0x4')]},'turnusername':{'type':Sequelize[_0xb835('0x4')]},'turnpassword':{'type':Sequelize[_0xb835('0x4')]},'pageTitle':{'type':Sequelize[_0xb835('0x4')]},'defaultPageTitle':{'type':Sequelize[_0xb835('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xb835('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xb835('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xb835('0x4')],'defaultValue':_0xb835('0x7')},'enableEmailPreview':{'type':Sequelize[_0xb835('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xb835('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xb835('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xb835('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xb835('0x4')],'defaultValue':_0xb835('0x8')},'chatTimeout':{'type':Sequelize[_0xb835('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xb835('0x4')]},'defaultPreferred':{'type':Sequelize[_0xb835('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xb835('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0xb835('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xb835('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xb835('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xb835('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xb835('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xb835('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xb835('0x2')]},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0xb835('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xb835('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xb835('0x2')]},'sentimentRegion':{'type':Sequelize[_0xb835('0x4')]},'language':{'type':Sequelize[_0xb835('0x4')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xb835('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xb835('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xb835('0x2')](0x2)[_0xb835('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xb835('0x2')](0x2)[_0xb835('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xb835('0x2')](0x2)[_0xb835('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xb835('0x2')](0x2)[_0xb835('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xb835('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xb835('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xb835('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xb835('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xb835('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xb835('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xb835('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0xb835('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xb835('0x2')],'defaultValue':0x14},'filterFullName':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xd131=['UNSIGNED','sequelize','exports','INTEGER','min_internal','min_mailbox','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0x14a513,_0x3239f){var _0x47236c=function(_0x394191){while(--_0x394191){_0x14a513['push'](_0x14a513['shift']());}};_0x47236c(++_0x3239f);}(_0xd131,0x1b9));var _0x1d13=function(_0x30f1e2,_0x3814c3){_0x30f1e2=_0x30f1e2-0x0;var _0x141b56=_0xd131[_0x30f1e2];return _0x141b56;};'use strict';var Sequelize=require(_0x1d13('0x0'));module[_0x1d13('0x1')]={'min_internal':{'type':Sequelize[_0x1d13('0x2')](0xb),'unique':_0x1d13('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x1d13('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x1d13('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x1d13('0x5')},'logo':{'type':Sequelize[_0x1d13('0x6')]},'defaultLogo':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x1d13('0x6')]},'defaultLoginLogo':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x1d13('0x6')]},'turnaddr':{'type':Sequelize[_0x1d13('0x6')]},'turnusername':{'type':Sequelize[_0x1d13('0x6')]},'turnpassword':{'type':Sequelize[_0x1d13('0x6')]},'pageTitle':{'type':Sequelize[_0x1d13('0x6')]},'defaultPageTitle':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x1d13('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x1d13('0x8')},'enableEmailPreview':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x1d13('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x1d13('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x1d13('0x6')],'defaultValue':_0x1d13('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x1d13('0x6')]},'defaultPreferred':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x1d13('0x6')]},'allowedLoginAttempts':{'type':Sequelize[_0x1d13('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x1d13('0x6')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x1d13('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x1d13('0x2')]},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x1d13('0x2')]},'sentimentRegion':{'type':Sequelize[_0x1d13('0x6')]},'language':{'type':Sequelize[_0x1d13('0x6')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x1d13('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)[_0x1d13('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x1d13('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x1d13('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x1d13('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x1d13('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x1d13('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x1d13('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x1d13('0x7')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14},'filterFullName':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 71948f9..e2966c1 100644 --- a/server/api/setting/setting.controller.js +++ b/server/api/setting/setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa0e5=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','set','Content-Range','apply','save','destroy','stack','name','Setting','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','limit','sort','pick','merge','where','map','VIRTUAL','filter','options','count','includeAll','findAll','rows','show','params','rawAttributes','include','find','update','body','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','toLower','logo','root','upperFirst','custom','default_logo.svg','existsSync','Sequelize','ValidationError','\x20not\x20found','server/files/images/logos','favicon','default_loginLogo.svg','download','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','default','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x1efdf9,_0x725098){var _0x24f74d=function(_0x4e1f64){while(--_0x4e1f64){_0x1efdf9['push'](_0x1efdf9['shift']());}};_0x24f74d(++_0x725098);}(_0xa0e5,0x6f));var _0x5a0e=function(_0x4d9098,_0x4eaeeb){_0x4d9098=_0x4d9098-0x0;var _0x464b68=_0xa0e5[_0x4d9098];return _0x464b68;};'use strict';var emlformat=require(_0x5a0e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a0e('0x1'));var jsonpatch=require(_0x5a0e('0x2'));var rp=require(_0x5a0e('0x3'));var moment=require('moment');var BPromise=require(_0x5a0e('0x4'));var Mustache=require(_0x5a0e('0x5'));var util=require('util');var path=require(_0x5a0e('0x6'));var sox=require(_0x5a0e('0x7'));var csv=require(_0x5a0e('0x8'));var ejs=require(_0x5a0e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a0e('0xa'));var squel=require(_0x5a0e('0xb'));var crypto=require(_0x5a0e('0xc'));var jsforce=require(_0x5a0e('0xd'));var deskjs=require(_0x5a0e('0xe'));var toCsv=require(_0x5a0e('0x8'));var querystring=require('querystring');var Papa=require(_0x5a0e('0xf'));var Redis=require(_0x5a0e('0x10'));var authService=require(_0x5a0e('0x11'));var qs=require(_0x5a0e('0x12'));var as=require(_0x5a0e('0x13'));var hardwareService=require(_0x5a0e('0x14'));var logger=require(_0x5a0e('0x15'))(_0x5a0e('0x16'));var utils=require(_0x5a0e('0x17'));var config=require(_0x5a0e('0x18'));var licenseUtil=require(_0x5a0e('0x19'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x5a0e('0x1a')][_0x5a0e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xfd12de,_0x4fb36d,_0x51c9cc,_0x2a3fef){return new BPromise(function(_0x2bca67,_0x540655){var _0x59230e=_0x2a3fef||client;return _0x59230e[_0x5a0e('0x1c')](_0xfd12de,_0x51c9cc)[_0x5a0e('0x1d')](function(_0xc4865c){logger['info'](_0x5a0e('0x1e'),_0x4fb36d,_0x5a0e('0x1f'));logger[_0x5a0e('0x20')](_0x5a0e('0x21'),_0x4fb36d,_0x5a0e('0x1f'),JSON[_0x5a0e('0x22')](_0xc4865c));if(_0xc4865c['error']){if(_0xc4865c[_0x5a0e('0x23')][_0x5a0e('0x24')]===0x1f4){logger[_0x5a0e('0x23')](_0x5a0e('0x1e'),_0x4fb36d,_0xc4865c[_0x5a0e('0x23')][_0x5a0e('0x25')]);return _0x540655(_0xc4865c[_0x5a0e('0x23')][_0x5a0e('0x25')]);}logger[_0x5a0e('0x23')]('Setting,\x20%s,\x20%s',_0x4fb36d,_0xc4865c[_0x5a0e('0x23')][_0x5a0e('0x25')]);return _0x2bca67(_0xc4865c['error'][_0x5a0e('0x25')]);}else{logger[_0x5a0e('0x26')](_0x5a0e('0x1e'),_0x4fb36d,_0x5a0e('0x1f'));_0x2bca67(_0xc4865c[_0x5a0e('0x27')][_0x5a0e('0x25')]);}})[_0x5a0e('0x28')](function(_0x2ecb2a){logger[_0x5a0e('0x23')](_0x5a0e('0x1e'),_0x4fb36d,_0x2ecb2a);_0x540655(_0x2ecb2a);});});}function respondWithStatusCode(_0x333956,_0x5e45cb){_0x5e45cb=_0x5e45cb||0xcc;return function(_0x223192){if(_0x223192){return _0x333956[_0x5a0e('0x29')](_0x5e45cb);}return _0x333956[_0x5a0e('0x2a')](_0x5e45cb)[_0x5a0e('0x2b')]();};}function respondWithResult(_0x4378db,_0x377e37){_0x377e37=_0x377e37||0xc8;return function(_0x20848d){if(_0x20848d){return _0x4378db['status'](_0x377e37)[_0x5a0e('0x2c')](_0x20848d);}};}function respondWithFilteredResult(_0x1ea1ab,_0x4aacfa){return function(_0x4dd32e){if(_0x4dd32e){var _0x1e5703=typeof _0x4aacfa[_0x5a0e('0x2d')]===_0x5a0e('0x2e')&&typeof _0x4aacfa['limit']===_0x5a0e('0x2e');var _0x390627=_0x4dd32e['count'];var _0x5ca1e0=_0x1e5703?0x0:_0x4aacfa['offset'];var _0x608792=_0x1e5703?_0x4dd32e['count']:_0x4aacfa[_0x5a0e('0x2d')]+_0x4aacfa['limit'];var _0xbf9ff3;if(_0x608792>=_0x390627){_0x608792=_0x390627;_0xbf9ff3=0xc8;}else{_0xbf9ff3=0xce;}_0x1ea1ab['status'](_0xbf9ff3);return _0x1ea1ab[_0x5a0e('0x2f')](_0x5a0e('0x30'),_0x5ca1e0+'-'+_0x608792+'/'+_0x390627)['json'](_0x4dd32e);}return null;};}function patchUpdates(_0x5adcae){return function(_0xf96aa5){try{jsonpatch[_0x5a0e('0x31')](_0xf96aa5,_0x5adcae,!![]);}catch(_0x1a29c1){return BPromise['reject'](_0x1a29c1);}return _0xf96aa5[_0x5a0e('0x32')]();};}function saveUpdates(_0x16d19c,_0x534647){return function(_0x1420ea){if(_0x1420ea){return _0x1420ea['update'](_0x16d19c)[_0x5a0e('0x1d')](function(_0x712346){return _0x712346;});}return null;};}function removeEntity(_0x171ae4,_0x5a6203){return function(_0x1f6114){if(_0x1f6114){return _0x1f6114[_0x5a0e('0x33')]()['then'](function(){_0x171ae4[_0x5a0e('0x2a')](0xcc)[_0x5a0e('0x2b')]();});}};}function handleEntityNotFound(_0x14f375,_0x362f02){return function(_0x55d101){if(!_0x55d101){_0x14f375['sendStatus'](0x194);}return _0x55d101;};}function handleError(_0x448fea,_0x4459bc){_0x4459bc=_0x4459bc||0x1f4;return function(_0xb5c74e){logger['error'](_0xb5c74e[_0x5a0e('0x34')]);if(_0xb5c74e[_0x5a0e('0x35')]){delete _0xb5c74e['name'];}_0x448fea[_0x5a0e('0x2a')](_0x4459bc)['send'](_0xb5c74e);};}exports['index']=function(_0x429969,_0x3d117c){var _0x7f92ea={},_0x1e24a6={},_0x3914eb={'count':0x0,'rows':[]};var _0x2575ea=_['map'](db[_0x5a0e('0x36')]['rawAttributes'],function(_0x113862){return{'name':_0x113862['fieldName'],'type':_0x113862[_0x5a0e('0x37')][_0x5a0e('0x38')]};});_0x1e24a6['model']=_['map'](_0x2575ea,_0x5a0e('0x35'));_0x1e24a6[_0x5a0e('0x39')]=_[_0x5a0e('0x3a')](_0x429969['query']);_0x1e24a6[_0x5a0e('0x3b')]=_[_0x5a0e('0x3c')](_0x1e24a6['model'],_0x1e24a6['query']);_0x7f92ea[_0x5a0e('0x3d')]=_[_0x5a0e('0x3c')](_0x1e24a6['model'],qs[_0x5a0e('0x3e')](_0x429969[_0x5a0e('0x39')]['fields']));_0x7f92ea[_0x5a0e('0x3d')]=_0x7f92ea['attributes'][_0x5a0e('0x3f')]?_0x7f92ea[_0x5a0e('0x3d')]:_0x1e24a6[_0x5a0e('0x40')];if(!_0x429969[_0x5a0e('0x39')][_0x5a0e('0x41')]('nolimit')){_0x7f92ea[_0x5a0e('0x42')]=qs['limit'](_0x429969[_0x5a0e('0x39')][_0x5a0e('0x42')]);_0x7f92ea[_0x5a0e('0x2d')]=qs['offset'](_0x429969['query'][_0x5a0e('0x2d')]);}_0x7f92ea['order']=qs[_0x5a0e('0x43')](_0x429969[_0x5a0e('0x39')][_0x5a0e('0x43')]);_0x7f92ea['where']=qs[_0x5a0e('0x3b')](_[_0x5a0e('0x44')](_0x429969['query'],_0x1e24a6['filters']),_0x2575ea);if(_0x429969[_0x5a0e('0x39')]['filter']){_0x7f92ea['where']=_[_0x5a0e('0x45')](_0x7f92ea[_0x5a0e('0x46')],{'$or':_[_0x5a0e('0x47')](_0x2575ea,function(_0x5c4870){if(_0x5c4870[_0x5a0e('0x37')]!==_0x5a0e('0x48')){var _0x9c0d2f={};_0x9c0d2f[_0x5c4870[_0x5a0e('0x35')]]={'$like':'%'+_0x429969[_0x5a0e('0x39')][_0x5a0e('0x49')]+'%'};return _0x9c0d2f;}})});}_0x7f92ea=_['merge']({},_0x7f92ea,_0x429969[_0x5a0e('0x4a')]);var _0x25e006={'where':_0x7f92ea['where']};return db[_0x5a0e('0x36')]['count'](_0x25e006)[_0x5a0e('0x1d')](function(_0x3c6189){_0x3914eb[_0x5a0e('0x4b')]=_0x3c6189;if(_0x429969[_0x5a0e('0x39')][_0x5a0e('0x4c')]){_0x7f92ea['include']=[{'all':!![]}];}return db[_0x5a0e('0x36')][_0x5a0e('0x4d')](_0x7f92ea);})['then'](function(_0x2731d0){_0x3914eb[_0x5a0e('0x4e')]=_0x2731d0;return _0x3914eb;})[_0x5a0e('0x1d')](respondWithFilteredResult(_0x3d117c,_0x7f92ea))[_0x5a0e('0x28')](handleError(_0x3d117c,null));};exports[_0x5a0e('0x4f')]=function(_0x3e0b8d,_0x41eefe){var _0x287e4b={'raw':![],'where':{'id':_0x3e0b8d[_0x5a0e('0x50')]['id']}},_0x56214b={};_0x56214b['model']=_[_0x5a0e('0x3a')](db['Setting'][_0x5a0e('0x51')]);_0x56214b[_0x5a0e('0x39')]=_[_0x5a0e('0x3a')](_0x3e0b8d[_0x5a0e('0x39')]);_0x56214b[_0x5a0e('0x3b')]=_[_0x5a0e('0x3c')](_0x56214b[_0x5a0e('0x40')],_0x56214b[_0x5a0e('0x39')]);_0x287e4b[_0x5a0e('0x3d')]=_[_0x5a0e('0x3c')](_0x56214b[_0x5a0e('0x40')],qs[_0x5a0e('0x3e')](_0x3e0b8d[_0x5a0e('0x39')][_0x5a0e('0x3e')]));_0x287e4b[_0x5a0e('0x3d')]=_0x287e4b[_0x5a0e('0x3d')][_0x5a0e('0x3f')]?_0x287e4b[_0x5a0e('0x3d')]:_0x56214b[_0x5a0e('0x40')];if(_0x3e0b8d[_0x5a0e('0x39')][_0x5a0e('0x4c')]){_0x287e4b[_0x5a0e('0x52')]=[{'all':!![]}];}_0x287e4b=_[_0x5a0e('0x45')]({},_0x287e4b,_0x3e0b8d[_0x5a0e('0x4a')]);return db[_0x5a0e('0x36')][_0x5a0e('0x53')](_0x287e4b)[_0x5a0e('0x1d')](handleEntityNotFound(_0x41eefe,null))['then'](respondWithResult(_0x41eefe,null))[_0x5a0e('0x28')](handleError(_0x41eefe,null));};exports[_0x5a0e('0x54')]=function(_0x227a4b,_0x1cdf41){if(_0x227a4b['body']['id']){delete _0x227a4b[_0x5a0e('0x55')]['id'];}return db[_0x5a0e('0x36')][_0x5a0e('0x53')]({'where':{'id':_0x227a4b[_0x5a0e('0x50')]['id']}})['then'](handleEntityNotFound(_0x1cdf41,null))[_0x5a0e('0x1d')](saveUpdates(_0x227a4b[_0x5a0e('0x55')],null))[_0x5a0e('0x1d')](respondWithResult(_0x1cdf41,null))[_0x5a0e('0x28')](handleError(_0x1cdf41,null));};exports[_0x5a0e('0x56')]=function(_0x2018eb,_0x4655d3,_0x4aab96){if(_0x2018eb[_0x5a0e('0x57')]&&_0x2018eb[_0x5a0e('0x57')][_0x5a0e('0x58')]){_0x2018eb[_0x5a0e('0x55')]['logo']=_0x2018eb[_0x5a0e('0x57')]['filename'];}return db[_0x5a0e('0x36')][_0x5a0e('0x53')]({'where':{'id':_0x2018eb[_0x5a0e('0x50')]['id']}})['then'](handleEntityNotFound(_0x4655d3,null))[_0x5a0e('0x1d')](saveUpdates(_0x2018eb[_0x5a0e('0x55')],null))['then'](respondWithResult(_0x4655d3,null))[_0x5a0e('0x28')](handleError(_0x4655d3,null));};exports[_0x5a0e('0x59')]=function(_0x2508ad,_0x54abd0,_0x58a6e9){if(_0x2508ad[_0x5a0e('0x57')]&&_0x2508ad['file'][_0x5a0e('0x58')]){_0x2508ad[_0x5a0e('0x55')][_0x5a0e('0x5a')]=_0x2508ad['file']['filename'];}return db['Setting'][_0x5a0e('0x53')]({'where':{'id':_0x2508ad[_0x5a0e('0x50')]['id']}})['then'](handleEntityNotFound(_0x54abd0,null))[_0x5a0e('0x1d')](saveUpdates(_0x2508ad[_0x5a0e('0x55')],null))[_0x5a0e('0x1d')](respondWithResult(_0x54abd0,null))[_0x5a0e('0x28')](handleError(_0x54abd0,null));};var utilLicense=require(_0x5a0e('0x19'));exports[_0x5a0e('0x5b')]=function(_0x10702d,_0x246910,_0x1f24fc){var _0x39e708='server/files/images/logos';var _0xdef473={'custom':![]};return utilLicense[_0x5a0e('0x5c')]()['then'](function(_0x4f9cfb){if(_0x4f9cfb){_0xdef473=_0x4f9cfb;}return db['Setting'][_0x5a0e('0x53')]({'where':{'id':_0x10702d['params']['id']},'attributes':['logo',_0x5a0e('0x5a'),_0x5a0e('0x5d'),'favicon',_0x5a0e('0x5e'),_0x5a0e('0x5f'),_0x5a0e('0x60'),_0x5a0e('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x246910,null))[_0x5a0e('0x1d')](function(_0x3ab3d2){if(_0x3ab3d2){var _0x15dbb1=_0x3ab3d2['logo']&&fs['existsSync'](path[_0x5a0e('0x62')](config['root'],_0x39e708,_[_0x5a0e('0x63')](_0x3ab3d2[_0x5a0e('0x64')])))?path[_0x5a0e('0x62')](config['root'],_0x39e708,_[_0x5a0e('0x63')](_0x3ab3d2[_0x5a0e('0x64')])):path['join'](config[_0x5a0e('0x65')],_0x39e708,_[_0x5a0e('0x63')]('default_logo.svg'));var _0xf4a84c='default'+_[_0x5a0e('0x66')](_0x5a0e('0x64'));if(_0x3ab3d2[_0xf4a84c]||!_0xdef473[_0x5a0e('0x67')]){_0x15dbb1=path[_0x5a0e('0x62')](config[_0x5a0e('0x65')],_0x39e708,_[_0x5a0e('0x63')](_0x5a0e('0x68')));}if(!fs[_0x5a0e('0x69')](_0x15dbb1)){throw new db[(_0x5a0e('0x6a'))][(_0x5a0e('0x6b'))](_[_0x5a0e('0x66')]('logo')+_0x5a0e('0x6c'));}return _0x246910['download'](_0x15dbb1);}})[_0x5a0e('0x28')](handleError(_0x246910,null));};var utilLicense=require(_0x5a0e('0x19'));exports['getLogoLogin']=function(_0x36c5ac,_0x514d37,_0x528bd2){var _0x2fb88a=_0x5a0e('0x6d');var _0x179987={'custom':![]};return utilLicense[_0x5a0e('0x5c')]()[_0x5a0e('0x1d')](function(_0x2b049f){if(_0x2b049f){_0x179987=_0x2b049f;}return db['Setting'][_0x5a0e('0x53')]({'where':{'id':_0x36c5ac[_0x5a0e('0x50')]['id']},'attributes':[_0x5a0e('0x64'),'loginLogo',_0x5a0e('0x5d'),_0x5a0e('0x6e'),_0x5a0e('0x5e'),_0x5a0e('0x5f'),_0x5a0e('0x60'),_0x5a0e('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x514d37,null))['then'](function(_0xff7cd0){if(_0xff7cd0){var _0x1dee6b=_0xff7cd0[_0x5a0e('0x5a')]&&fs[_0x5a0e('0x69')](path['join'](config['root'],_0x2fb88a,_['toLower'](_0xff7cd0[_0x5a0e('0x5a')])))?path[_0x5a0e('0x62')](config['root'],_0x2fb88a,_[_0x5a0e('0x63')](_0xff7cd0['loginLogo'])):path[_0x5a0e('0x62')](config['root'],_0x2fb88a,_[_0x5a0e('0x63')](_0x5a0e('0x6f')));var _0x24ea4e='default'+_[_0x5a0e('0x66')](_0x5a0e('0x5a'));if(_0xff7cd0[_0x24ea4e]||!_0x179987[_0x5a0e('0x67')]){_0x1dee6b=path['join'](config[_0x5a0e('0x65')],_0x2fb88a,_['toLower'](_0x5a0e('0x6f')));}if(!fs[_0x5a0e('0x69')](_0x1dee6b)){throw new db[(_0x5a0e('0x6a'))][(_0x5a0e('0x6b'))](_['upperFirst'](_0x5a0e('0x5a'))+_0x5a0e('0x6c'));}return _0x514d37[_0x5a0e('0x70')](_0x1dee6b);}})[_0x5a0e('0x28')](handleError(_0x514d37,null));};exports[_0x5a0e('0x71')]=function(_0x57a770,_0x25da6f){return db[_0x5a0e('0x36')][_0x5a0e('0x53')]({'where':{'id':_0x57a770[_0x5a0e('0x50')]['id']},'attributes':[_0x5a0e('0x72')]})[_0x5a0e('0x1d')](respondWithResult(_0x25da6f,null))[_0x5a0e('0x28')](handleError(_0x25da6f,null));};exports[_0x5a0e('0x73')]=function(_0x3c8822,_0x54abe3,_0x22dbf3){if(_0x3c8822[_0x5a0e('0x57')]&&_0x3c8822[_0x5a0e('0x57')][_0x5a0e('0x58')]){_0x3c8822[_0x5a0e('0x55')][_0x5a0e('0x5d')]=_0x3c8822['file']['filename'];}return db[_0x5a0e('0x36')][_0x5a0e('0x53')]({'where':{'id':_0x3c8822[_0x5a0e('0x50')]['id']}})['then'](handleEntityNotFound(_0x54abe3,null))['then'](saveUpdates(_0x3c8822['body'],null))[_0x5a0e('0x1d')](respondWithResult(_0x54abe3,null))[_0x5a0e('0x28')](handleError(_0x54abe3,null));};var utilLicense=require('../../config/license/util');exports[_0x5a0e('0x74')]=function(_0x120383,_0x317e1f,_0x4534fe){var _0x3c2569=_0x5a0e('0x6d');var _0x358093={'custom':![]};return utilLicense[_0x5a0e('0x5c')]()['then'](function(_0x4a2559){if(_0x4a2559){_0x358093=_0x4a2559;}return db[_0x5a0e('0x36')][_0x5a0e('0x53')]({'where':{'id':_0x120383['params']['id']},'attributes':['logo','loginLogo',_0x5a0e('0x5d'),'favicon',_0x5a0e('0x5e'),_0x5a0e('0x5f'),_0x5a0e('0x60'),_0x5a0e('0x61')],'raw':!![]});})[_0x5a0e('0x1d')](handleEntityNotFound(_0x317e1f,null))[_0x5a0e('0x1d')](function(_0x1b5293){if(_0x1b5293){var _0x300f2f=_0x1b5293['preferred']&&fs['existsSync'](path[_0x5a0e('0x62')](config[_0x5a0e('0x65')],_0x3c2569,_[_0x5a0e('0x63')](_0x1b5293['preferred'])))?path[_0x5a0e('0x62')](config[_0x5a0e('0x65')],_0x3c2569,_[_0x5a0e('0x63')](_0x1b5293[_0x5a0e('0x5d')])):path[_0x5a0e('0x62')](config['root'],_0x3c2569,_['toLower'](_0x5a0e('0x75')));var _0x2a22aa=_0x5a0e('0x76')+_[_0x5a0e('0x66')](_0x5a0e('0x5d'));if(_0x1b5293[_0x2a22aa]||!_0x358093[_0x5a0e('0x67')]||!_0x358093[_0x5a0e('0x5d')]){_0x300f2f=path[_0x5a0e('0x62')](config['root'],_0x3c2569,_[_0x5a0e('0x63')](_0x5a0e('0x75')));}if(!fs[_0x5a0e('0x69')](_0x300f2f)){throw new db[(_0x5a0e('0x6a'))][(_0x5a0e('0x6b'))](_[_0x5a0e('0x66')](_0x5a0e('0x5d'))+_0x5a0e('0x6c'));}return _0x317e1f['download'](_0x300f2f);}})['catch'](handleError(_0x317e1f,null));};exports[_0x5a0e('0x77')]=function(_0x4499a7,_0x5e0537,_0x8eb9bf){if(_0x4499a7[_0x5a0e('0x57')]&&_0x4499a7[_0x5a0e('0x57')][_0x5a0e('0x58')]){_0x4499a7[_0x5a0e('0x55')]['favicon']=_0x4499a7[_0x5a0e('0x57')][_0x5a0e('0x58')];}return db[_0x5a0e('0x36')][_0x5a0e('0x53')]({'where':{'id':_0x4499a7[_0x5a0e('0x50')]['id']}})['then'](handleEntityNotFound(_0x5e0537,null))[_0x5a0e('0x1d')](saveUpdates(_0x4499a7['body'],null))[_0x5a0e('0x1d')](respondWithResult(_0x5e0537,null))[_0x5a0e('0x28')](handleError(_0x5e0537,null));};var utilLicense=require(_0x5a0e('0x19'));exports[_0x5a0e('0x78')]=function(_0x3ca7c5,_0x4842bc,_0x3be88d){var _0x5f3adc=_0x5a0e('0x6d');var _0x281813={'custom':![]};return utilLicense[_0x5a0e('0x5c')]()['then'](function(_0x48d56f){if(_0x48d56f){_0x281813=_0x48d56f;}return db[_0x5a0e('0x36')][_0x5a0e('0x53')]({'where':{'id':_0x3ca7c5[_0x5a0e('0x50')]['id']},'attributes':[_0x5a0e('0x64'),_0x5a0e('0x5a'),_0x5a0e('0x5d'),_0x5a0e('0x6e'),_0x5a0e('0x5e'),'defaultLoginLogo',_0x5a0e('0x60'),'defaultFavicon'],'raw':!![]});})[_0x5a0e('0x1d')](handleEntityNotFound(_0x4842bc,null))['then'](function(_0x24693f){if(_0x24693f){var _0x7da9b0=_0x24693f[_0x5a0e('0x6e')]&&fs['existsSync'](path[_0x5a0e('0x62')](config['root'],_0x5f3adc,_['toLower'](_0x24693f['favicon'])))?path['join'](config[_0x5a0e('0x65')],_0x5f3adc,_[_0x5a0e('0x63')](_0x24693f[_0x5a0e('0x6e')])):path[_0x5a0e('0x62')](config[_0x5a0e('0x65')],_0x5f3adc,_[_0x5a0e('0x63')](_0x5a0e('0x79')));var _0x61256='default'+_[_0x5a0e('0x66')](_0x5a0e('0x6e'));if(_0x24693f[_0x61256]||!_0x281813[_0x5a0e('0x67')]){_0x7da9b0=path[_0x5a0e('0x62')](config[_0x5a0e('0x65')],_0x5f3adc,_[_0x5a0e('0x63')]('default_favicon.ico'));}if(!fs[_0x5a0e('0x69')](_0x7da9b0)){throw new db[(_0x5a0e('0x6a'))][(_0x5a0e('0x6b'))](_[_0x5a0e('0x66')](_0x5a0e('0x6e'))+_0x5a0e('0x6c'));}return _0x4842bc[_0x5a0e('0x70')](_0x7da9b0);}})[_0x5a0e('0x28')](handleError(_0x4842bc,null));};exports[_0x5a0e('0x7a')]=function(_0x542e58,_0x2672bb){var _0x94b452={'offset':moment()[_0x5a0e('0x7b')]()};_0x94b452['now']=moment()['utcOffset'](_0x94b452['offset'])[_0x5a0e('0x7c')](_0x5a0e('0x7d'));return _0x2672bb['status'](0xc8)[_0x5a0e('0x7e')](_0x94b452);}; \ No newline at end of file +var _0xd2ba=['getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','end','undefined','limit','count','offset','Content-Range','reject','save','update','destroy','sendStatus','stack','name','index','map','Setting','type','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','options','find','body','params','addLogo','file','filename','logo','addLogoLogin','getLogo','server/files/images/logos','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','defaultFavicon','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xd2ba,0x108));var _0xad2b=function(_0x4523db,_0x3dcac5){_0x4523db=_0x4523db-0x0;var _0x481dd7=_0xd2ba[_0x4523db];return _0x481dd7;};'use strict';var emlformat=require(_0xad2b('0x0'));var rimraf=require(_0xad2b('0x1'));var zipdir=require(_0xad2b('0x2'));var jsonpatch=require(_0xad2b('0x3'));var rp=require('request-promise');var moment=require(_0xad2b('0x4'));var BPromise=require(_0xad2b('0x5'));var Mustache=require(_0xad2b('0x6'));var util=require(_0xad2b('0x7'));var path=require(_0xad2b('0x8'));var sox=require('sox');var csv=require(_0xad2b('0x9'));var ejs=require(_0xad2b('0xa'));var fs=require('fs');var fs_extra=require(_0xad2b('0xb'));var _=require(_0xad2b('0xc'));var squel=require(_0xad2b('0xd'));var crypto=require(_0xad2b('0xe'));var jsforce=require(_0xad2b('0xf'));var deskjs=require(_0xad2b('0x10'));var toCsv=require(_0xad2b('0x9'));var querystring=require(_0xad2b('0x11'));var Papa=require('papaparse');var Redis=require(_0xad2b('0x12'));var authService=require(_0xad2b('0x13'));var qs=require(_0xad2b('0x14'));var as=require(_0xad2b('0x15'));var hardwareService=require(_0xad2b('0x16'));var logger=require(_0xad2b('0x17'))(_0xad2b('0x18'));var utils=require(_0xad2b('0x19'));var config=require(_0xad2b('0x1a'));var licenseUtil=require(_0xad2b('0x1b'));var db=require('../../mysqldb')['db'];var jayson=require(_0xad2b('0x1c'));var client=jayson[_0xad2b('0x1d')][_0xad2b('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xfaaca6,_0x14511a,_0x6d430f,_0x2fcfd3){return new BPromise(function(_0x476041,_0x514f6e){var _0x58f3f3=_0x2fcfd3||client;return _0x58f3f3[_0xad2b('0x1f')](_0xfaaca6,_0x6d430f)[_0xad2b('0x20')](function(_0x443d79){logger['info'](_0xad2b('0x21'),_0x14511a,_0xad2b('0x22'));logger['debug'](_0xad2b('0x23'),_0x14511a,_0xad2b('0x22'),JSON['stringify'](_0x443d79));if(_0x443d79[_0xad2b('0x24')]){if(_0x443d79[_0xad2b('0x24')][_0xad2b('0x25')]===0x1f4){logger[_0xad2b('0x24')](_0xad2b('0x21'),_0x14511a,_0x443d79[_0xad2b('0x24')]['message']);return _0x514f6e(_0x443d79['error'][_0xad2b('0x26')]);}logger['error'](_0xad2b('0x21'),_0x14511a,_0x443d79[_0xad2b('0x24')]['message']);return _0x476041(_0x443d79[_0xad2b('0x24')][_0xad2b('0x26')]);}else{logger[_0xad2b('0x27')]('Setting,\x20%s,\x20%s',_0x14511a,_0xad2b('0x22'));_0x476041(_0x443d79[_0xad2b('0x28')][_0xad2b('0x26')]);}})[_0xad2b('0x29')](function(_0x1a15dc){logger[_0xad2b('0x24')]('Setting,\x20%s,\x20%s',_0x14511a,_0x1a15dc);_0x514f6e(_0x1a15dc);});});}function respondWithStatusCode(_0x120412,_0x2f140a){_0x2f140a=_0x2f140a||0xcc;return function(_0x2b46d){if(_0x2b46d){return _0x120412['sendStatus'](_0x2f140a);}return _0x120412[_0xad2b('0x2a')](_0x2f140a)[_0xad2b('0x2b')]();};}function respondWithResult(_0x1e973a,_0x5b2165){_0x5b2165=_0x5b2165||0xc8;return function(_0x85c7fd){if(_0x85c7fd){return _0x1e973a[_0xad2b('0x2a')](_0x5b2165)['json'](_0x85c7fd);}};}function respondWithFilteredResult(_0x4a778e,_0x3f00ad){return function(_0x559be5){if(_0x559be5){var _0x328147=typeof _0x3f00ad['offset']===_0xad2b('0x2c')&&typeof _0x3f00ad[_0xad2b('0x2d')]===_0xad2b('0x2c');var _0x1652e6=_0x559be5[_0xad2b('0x2e')];var _0x3fd9dd=_0x328147?0x0:_0x3f00ad[_0xad2b('0x2f')];var _0x396b06=_0x328147?_0x559be5['count']:_0x3f00ad['offset']+_0x3f00ad[_0xad2b('0x2d')];var _0x492385;if(_0x396b06>=_0x1652e6){_0x396b06=_0x1652e6;_0x492385=0xc8;}else{_0x492385=0xce;}_0x4a778e[_0xad2b('0x2a')](_0x492385);return _0x4a778e['set'](_0xad2b('0x30'),_0x3fd9dd+'-'+_0x396b06+'/'+_0x1652e6)['json'](_0x559be5);}return null;};}function patchUpdates(_0x21a3ee){return function(_0x132dc9){try{jsonpatch['apply'](_0x132dc9,_0x21a3ee,!![]);}catch(_0x5a6d5b){return BPromise[_0xad2b('0x31')](_0x5a6d5b);}return _0x132dc9[_0xad2b('0x32')]();};}function saveUpdates(_0x4844fb,_0x4d7e4d){return function(_0x3e334b){if(_0x3e334b){return _0x3e334b[_0xad2b('0x33')](_0x4844fb)[_0xad2b('0x20')](function(_0x4a2405){return _0x4a2405;});}return null;};}function removeEntity(_0x1b50a0,_0x4549b3){return function(_0x1f6f51){if(_0x1f6f51){return _0x1f6f51[_0xad2b('0x34')]()[_0xad2b('0x20')](function(){_0x1b50a0[_0xad2b('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f1ea1,_0x3ebed9){return function(_0x173085){if(!_0x173085){_0x1f1ea1[_0xad2b('0x35')](0x194);}return _0x173085;};}function handleError(_0x336bb0,_0x3a91a7){_0x3a91a7=_0x3a91a7||0x1f4;return function(_0x475d6e){logger[_0xad2b('0x24')](_0x475d6e[_0xad2b('0x36')]);if(_0x475d6e[_0xad2b('0x37')]){delete _0x475d6e['name'];}_0x336bb0[_0xad2b('0x2a')](_0x3a91a7)['send'](_0x475d6e);};}exports[_0xad2b('0x38')]=function(_0x54f1bb,_0xe03a35){var _0x48848a={},_0x5dd4b3={},_0x23cb38={'count':0x0,'rows':[]};var _0x4a604e=_[_0xad2b('0x39')](db[_0xad2b('0x3a')]['rawAttributes'],function(_0x3705e9){return{'name':_0x3705e9['fieldName'],'type':_0x3705e9[_0xad2b('0x3b')][_0xad2b('0x3c')]};});_0x5dd4b3[_0xad2b('0x3d')]=_['map'](_0x4a604e,'name');_0x5dd4b3['query']=_[_0xad2b('0x3e')](_0x54f1bb[_0xad2b('0x3f')]);_0x5dd4b3[_0xad2b('0x40')]=_[_0xad2b('0x41')](_0x5dd4b3['model'],_0x5dd4b3[_0xad2b('0x3f')]);_0x48848a[_0xad2b('0x42')]=_['intersection'](_0x5dd4b3[_0xad2b('0x3d')],qs[_0xad2b('0x43')](_0x54f1bb[_0xad2b('0x3f')][_0xad2b('0x43')]));_0x48848a[_0xad2b('0x42')]=_0x48848a[_0xad2b('0x42')][_0xad2b('0x44')]?_0x48848a['attributes']:_0x5dd4b3[_0xad2b('0x3d')];if(!_0x54f1bb[_0xad2b('0x3f')]['hasOwnProperty']('nolimit')){_0x48848a[_0xad2b('0x2d')]=qs['limit'](_0x54f1bb['query'][_0xad2b('0x2d')]);_0x48848a[_0xad2b('0x2f')]=qs[_0xad2b('0x2f')](_0x54f1bb[_0xad2b('0x3f')][_0xad2b('0x2f')]);}_0x48848a[_0xad2b('0x45')]=qs[_0xad2b('0x46')](_0x54f1bb[_0xad2b('0x3f')][_0xad2b('0x46')]);_0x48848a[_0xad2b('0x47')]=qs['filters'](_[_0xad2b('0x48')](_0x54f1bb[_0xad2b('0x3f')],_0x5dd4b3[_0xad2b('0x40')]),_0x4a604e);if(_0x54f1bb[_0xad2b('0x3f')][_0xad2b('0x49')]){_0x48848a['where']=_[_0xad2b('0x4a')](_0x48848a[_0xad2b('0x47')],{'$or':_['map'](_0x4a604e,function(_0x36d7ad){if(_0x36d7ad['type']!==_0xad2b('0x4b')){var _0x127042={};_0x127042[_0x36d7ad[_0xad2b('0x37')]]={'$like':'%'+_0x54f1bb[_0xad2b('0x3f')][_0xad2b('0x49')]+'%'};return _0x127042;}})});}_0x48848a=_[_0xad2b('0x4a')]({},_0x48848a,_0x54f1bb['options']);var _0x467128={'where':_0x48848a['where']};return db[_0xad2b('0x3a')][_0xad2b('0x2e')](_0x467128)[_0xad2b('0x20')](function(_0x771a4e){_0x23cb38[_0xad2b('0x2e')]=_0x771a4e;if(_0x54f1bb['query'][_0xad2b('0x4c')]){_0x48848a[_0xad2b('0x4d')]=[{'all':!![]}];}return db[_0xad2b('0x3a')][_0xad2b('0x4e')](_0x48848a);})[_0xad2b('0x20')](function(_0x3d507e){_0x23cb38[_0xad2b('0x4f')]=_0x3d507e;return _0x23cb38;})[_0xad2b('0x20')](respondWithFilteredResult(_0xe03a35,_0x48848a))[_0xad2b('0x29')](handleError(_0xe03a35,null));};exports[_0xad2b('0x50')]=function(_0x2ded34,_0x1477ef){var _0x42bac9={'raw':![],'where':{'id':_0x2ded34['params']['id']}},_0x53b64e={};_0x53b64e['model']=_[_0xad2b('0x3e')](db['Setting'][_0xad2b('0x51')]);_0x53b64e[_0xad2b('0x3f')]=_[_0xad2b('0x3e')](_0x2ded34[_0xad2b('0x3f')]);_0x53b64e[_0xad2b('0x40')]=_[_0xad2b('0x41')](_0x53b64e[_0xad2b('0x3d')],_0x53b64e[_0xad2b('0x3f')]);_0x42bac9[_0xad2b('0x42')]=_['intersection'](_0x53b64e['model'],qs[_0xad2b('0x43')](_0x2ded34[_0xad2b('0x3f')][_0xad2b('0x43')]));_0x42bac9[_0xad2b('0x42')]=_0x42bac9[_0xad2b('0x42')][_0xad2b('0x44')]?_0x42bac9[_0xad2b('0x42')]:_0x53b64e[_0xad2b('0x3d')];if(_0x2ded34[_0xad2b('0x3f')]['includeAll']){_0x42bac9[_0xad2b('0x4d')]=[{'all':!![]}];}_0x42bac9=_[_0xad2b('0x4a')]({},_0x42bac9,_0x2ded34[_0xad2b('0x52')]);return db[_0xad2b('0x3a')][_0xad2b('0x53')](_0x42bac9)[_0xad2b('0x20')](handleEntityNotFound(_0x1477ef,null))['then'](respondWithResult(_0x1477ef,null))[_0xad2b('0x29')](handleError(_0x1477ef,null));};exports[_0xad2b('0x33')]=function(_0x3e2771,_0x8a4fac){if(_0x3e2771[_0xad2b('0x54')]['id']){delete _0x3e2771[_0xad2b('0x54')]['id'];}return db[_0xad2b('0x3a')][_0xad2b('0x53')]({'where':{'id':_0x3e2771[_0xad2b('0x55')]['id']}})['then'](handleEntityNotFound(_0x8a4fac,null))[_0xad2b('0x20')](saveUpdates(_0x3e2771[_0xad2b('0x54')],null))[_0xad2b('0x20')](respondWithResult(_0x8a4fac,null))['catch'](handleError(_0x8a4fac,null));};exports[_0xad2b('0x56')]=function(_0xe4eead,_0x4f0e04,_0x1a3c52){if(_0xe4eead[_0xad2b('0x57')]&&_0xe4eead['file'][_0xad2b('0x58')]){_0xe4eead[_0xad2b('0x54')][_0xad2b('0x59')]=_0xe4eead[_0xad2b('0x57')][_0xad2b('0x58')];}return db[_0xad2b('0x3a')][_0xad2b('0x53')]({'where':{'id':_0xe4eead[_0xad2b('0x55')]['id']}})[_0xad2b('0x20')](handleEntityNotFound(_0x4f0e04,null))[_0xad2b('0x20')](saveUpdates(_0xe4eead[_0xad2b('0x54')],null))[_0xad2b('0x20')](respondWithResult(_0x4f0e04,null))['catch'](handleError(_0x4f0e04,null));};exports[_0xad2b('0x5a')]=function(_0x308867,_0x327906,_0x35f6be){if(_0x308867[_0xad2b('0x57')]&&_0x308867[_0xad2b('0x57')][_0xad2b('0x58')]){_0x308867[_0xad2b('0x54')]['loginLogo']=_0x308867[_0xad2b('0x57')][_0xad2b('0x58')];}return db[_0xad2b('0x3a')][_0xad2b('0x53')]({'where':{'id':_0x308867[_0xad2b('0x55')]['id']}})[_0xad2b('0x20')](handleEntityNotFound(_0x327906,null))[_0xad2b('0x20')](saveUpdates(_0x308867[_0xad2b('0x54')],null))['then'](respondWithResult(_0x327906,null))[_0xad2b('0x29')](handleError(_0x327906,null));};var utilLicense=require(_0xad2b('0x1b'));exports[_0xad2b('0x5b')]=function(_0x49e70f,_0x1a6260,_0x475510){var _0x13f50a=_0xad2b('0x5c');var _0x3dedcd={'custom':![]};return utilLicense['getLicense']()[_0xad2b('0x20')](function(_0x386630){if(_0x386630){_0x3dedcd=_0x386630;}return db['Setting'][_0xad2b('0x53')]({'where':{'id':_0x49e70f[_0xad2b('0x55')]['id']},'attributes':['logo',_0xad2b('0x5d'),_0xad2b('0x5e'),_0xad2b('0x5f'),_0xad2b('0x60'),_0xad2b('0x61'),_0xad2b('0x62'),'defaultFavicon'],'raw':!![]});})[_0xad2b('0x20')](handleEntityNotFound(_0x1a6260,null))['then'](function(_0x1dd718){if(_0x1dd718){var _0x27719d=_0x1dd718['logo']&&fs[_0xad2b('0x63')](path[_0xad2b('0x64')](config[_0xad2b('0x65')],_0x13f50a,_[_0xad2b('0x66')](_0x1dd718[_0xad2b('0x59')])))?path['join'](config[_0xad2b('0x65')],_0x13f50a,_[_0xad2b('0x66')](_0x1dd718[_0xad2b('0x59')])):path[_0xad2b('0x64')](config['root'],_0x13f50a,_[_0xad2b('0x66')](_0xad2b('0x67')));var _0x49aa51=_0xad2b('0x68')+_[_0xad2b('0x69')]('logo');if(_0x1dd718[_0x49aa51]||!_0x3dedcd[_0xad2b('0x6a')]){_0x27719d=path[_0xad2b('0x64')](config[_0xad2b('0x65')],_0x13f50a,_['toLower'](_0xad2b('0x67')));}if(!fs[_0xad2b('0x63')](_0x27719d)){throw new db[(_0xad2b('0x6b'))][(_0xad2b('0x6c'))](_[_0xad2b('0x69')](_0xad2b('0x59'))+_0xad2b('0x6d'));}return _0x1a6260[_0xad2b('0x6e')](_0x27719d);}})[_0xad2b('0x29')](handleError(_0x1a6260,null));};var utilLicense=require('../../config/license/util');exports[_0xad2b('0x6f')]=function(_0x591f54,_0x556e58,_0x1ce12e){var _0x5d8080='server/files/images/logos';var _0xfe36bb={'custom':![]};return utilLicense[_0xad2b('0x70')]()[_0xad2b('0x20')](function(_0x145d6f){if(_0x145d6f){_0xfe36bb=_0x145d6f;}return db['Setting'][_0xad2b('0x53')]({'where':{'id':_0x591f54['params']['id']},'attributes':[_0xad2b('0x59'),_0xad2b('0x5d'),_0xad2b('0x5e'),_0xad2b('0x5f'),_0xad2b('0x60'),'defaultLoginLogo',_0xad2b('0x62'),_0xad2b('0x71')],'raw':!![]});})[_0xad2b('0x20')](handleEntityNotFound(_0x556e58,null))[_0xad2b('0x20')](function(_0x5c1c2b){if(_0x5c1c2b){var _0x2ca29c=_0x5c1c2b[_0xad2b('0x5d')]&&fs['existsSync'](path[_0xad2b('0x64')](config[_0xad2b('0x65')],_0x5d8080,_[_0xad2b('0x66')](_0x5c1c2b[_0xad2b('0x5d')])))?path['join'](config[_0xad2b('0x65')],_0x5d8080,_[_0xad2b('0x66')](_0x5c1c2b['loginLogo'])):path[_0xad2b('0x64')](config[_0xad2b('0x65')],_0x5d8080,_['toLower'](_0xad2b('0x72')));var _0x2d3d5c=_0xad2b('0x68')+_[_0xad2b('0x69')]('loginLogo');if(_0x5c1c2b[_0x2d3d5c]||!_0xfe36bb[_0xad2b('0x6a')]){_0x2ca29c=path[_0xad2b('0x64')](config[_0xad2b('0x65')],_0x5d8080,_[_0xad2b('0x66')]('default_loginLogo.svg'));}if(!fs[_0xad2b('0x63')](_0x2ca29c)){throw new db['Sequelize'][(_0xad2b('0x6c'))](_['upperFirst'](_0xad2b('0x5d'))+_0xad2b('0x6d'));}return _0x556e58[_0xad2b('0x6e')](_0x2ca29c);}})[_0xad2b('0x29')](handleError(_0x556e58,null));};exports[_0xad2b('0x73')]=function(_0x2daaa8,_0x5c3385){return db[_0xad2b('0x3a')]['find']({'where':{'id':_0x2daaa8[_0xad2b('0x55')]['id']},'attributes':[_0xad2b('0x74')]})[_0xad2b('0x20')](respondWithResult(_0x5c3385,null))[_0xad2b('0x29')](handleError(_0x5c3385,null));};exports[_0xad2b('0x75')]=function(_0x12baa8,_0x509f7d,_0x45a291){if(_0x12baa8[_0xad2b('0x57')]&&_0x12baa8[_0xad2b('0x57')][_0xad2b('0x58')]){_0x12baa8[_0xad2b('0x54')][_0xad2b('0x5e')]=_0x12baa8['file'][_0xad2b('0x58')];}return db[_0xad2b('0x3a')][_0xad2b('0x53')]({'where':{'id':_0x12baa8['params']['id']}})[_0xad2b('0x20')](handleEntityNotFound(_0x509f7d,null))[_0xad2b('0x20')](saveUpdates(_0x12baa8[_0xad2b('0x54')],null))[_0xad2b('0x20')](respondWithResult(_0x509f7d,null))[_0xad2b('0x29')](handleError(_0x509f7d,null));};var utilLicense=require(_0xad2b('0x1b'));exports[_0xad2b('0x76')]=function(_0x4d9bad,_0x8f2e3f,_0x3e5c4c){var _0x2c9011=_0xad2b('0x5c');var _0x1059cf={'custom':![]};return utilLicense[_0xad2b('0x70')]()[_0xad2b('0x20')](function(_0x5a1f6c){if(_0x5a1f6c){_0x1059cf=_0x5a1f6c;}return db[_0xad2b('0x3a')][_0xad2b('0x53')]({'where':{'id':_0x4d9bad[_0xad2b('0x55')]['id']},'attributes':[_0xad2b('0x59'),'loginLogo',_0xad2b('0x5e'),_0xad2b('0x5f'),_0xad2b('0x60'),_0xad2b('0x61'),'defaultPreferred',_0xad2b('0x71')],'raw':!![]});})['then'](handleEntityNotFound(_0x8f2e3f,null))['then'](function(_0x1e9336){if(_0x1e9336){var _0x2f5d6d=_0x1e9336[_0xad2b('0x5e')]&&fs[_0xad2b('0x63')](path[_0xad2b('0x64')](config['root'],_0x2c9011,_[_0xad2b('0x66')](_0x1e9336['preferred'])))?path[_0xad2b('0x64')](config[_0xad2b('0x65')],_0x2c9011,_[_0xad2b('0x66')](_0x1e9336[_0xad2b('0x5e')])):path[_0xad2b('0x64')](config[_0xad2b('0x65')],_0x2c9011,_[_0xad2b('0x66')](_0xad2b('0x77')));var _0x1eefea=_0xad2b('0x68')+_[_0xad2b('0x69')](_0xad2b('0x5e'));if(_0x1e9336[_0x1eefea]||!_0x1059cf[_0xad2b('0x6a')]||!_0x1059cf[_0xad2b('0x5e')]){_0x2f5d6d=path[_0xad2b('0x64')](config[_0xad2b('0x65')],_0x2c9011,_[_0xad2b('0x66')](_0xad2b('0x77')));}if(!fs[_0xad2b('0x63')](_0x2f5d6d)){throw new db[(_0xad2b('0x6b'))][(_0xad2b('0x6c'))](_[_0xad2b('0x69')]('preferred')+_0xad2b('0x6d'));}return _0x8f2e3f['download'](_0x2f5d6d);}})['catch'](handleError(_0x8f2e3f,null));};exports['addFavicon']=function(_0x113ccf,_0x488f6c,_0x58516b){if(_0x113ccf['file']&&_0x113ccf[_0xad2b('0x57')][_0xad2b('0x58')]){_0x113ccf[_0xad2b('0x54')]['favicon']=_0x113ccf[_0xad2b('0x57')]['filename'];}return db[_0xad2b('0x3a')][_0xad2b('0x53')]({'where':{'id':_0x113ccf[_0xad2b('0x55')]['id']}})[_0xad2b('0x20')](handleEntityNotFound(_0x488f6c,null))[_0xad2b('0x20')](saveUpdates(_0x113ccf[_0xad2b('0x54')],null))[_0xad2b('0x20')](respondWithResult(_0x488f6c,null))[_0xad2b('0x29')](handleError(_0x488f6c,null));};var utilLicense=require('../../config/license/util');exports[_0xad2b('0x78')]=function(_0x383baf,_0x2575d9,_0x474a72){var _0x27c008=_0xad2b('0x5c');var _0x24768d={'custom':![]};return utilLicense[_0xad2b('0x70')]()[_0xad2b('0x20')](function(_0x167f41){if(_0x167f41){_0x24768d=_0x167f41;}return db['Setting'][_0xad2b('0x53')]({'where':{'id':_0x383baf[_0xad2b('0x55')]['id']},'attributes':[_0xad2b('0x59'),'loginLogo','preferred',_0xad2b('0x5f'),_0xad2b('0x60'),_0xad2b('0x61'),_0xad2b('0x62'),_0xad2b('0x71')],'raw':!![]});})[_0xad2b('0x20')](handleEntityNotFound(_0x2575d9,null))[_0xad2b('0x20')](function(_0x5a4614){if(_0x5a4614){var _0x59a486=_0x5a4614['favicon']&&fs['existsSync'](path[_0xad2b('0x64')](config['root'],_0x27c008,_[_0xad2b('0x66')](_0x5a4614[_0xad2b('0x5f')])))?path[_0xad2b('0x64')](config[_0xad2b('0x65')],_0x27c008,_[_0xad2b('0x66')](_0x5a4614[_0xad2b('0x5f')])):path['join'](config['root'],_0x27c008,_[_0xad2b('0x66')]('default_favicon.ico'));var _0x118382='default'+_[_0xad2b('0x69')](_0xad2b('0x5f'));if(_0x5a4614[_0x118382]||!_0x24768d[_0xad2b('0x6a')]){_0x59a486=path[_0xad2b('0x64')](config[_0xad2b('0x65')],_0x27c008,_['toLower'](_0xad2b('0x79')));}if(!fs[_0xad2b('0x63')](_0x59a486)){throw new db[(_0xad2b('0x6b'))][(_0xad2b('0x6c'))](_[_0xad2b('0x69')]('favicon')+_0xad2b('0x6d'));}return _0x2575d9[_0xad2b('0x6e')](_0x59a486);}})[_0xad2b('0x29')](handleError(_0x2575d9,null));};exports[_0xad2b('0x7a')]=function(_0x3da34a,_0x487301){var _0x113aa7={'offset':moment()[_0xad2b('0x7b')]()};_0x113aa7[_0xad2b('0x7c')]=moment()[_0xad2b('0x7b')](_0x113aa7[_0xad2b('0x2f')])[_0xad2b('0x7d')](_0xad2b('0x7e'));return _0x487301[_0xad2b('0x2a')](0xc8)[_0xad2b('0x7f')](_0x113aa7);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index c976b7c..92e9c45 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x57408b,_0xb7cbc5){var _0x31a897=function(_0x5810ac){while(--_0x5810ac){_0x57408b['push'](_0x57408b['shift']());}};_0x31a897(++_0xb7cbc5);}(_0x008c,0x188));var _0xc008=function(_0x770f7,_0x3af003){_0x770f7=_0x770f7-0x0;var _0xe797c6=_0x008c[_0x770f7];return _0xe797c6;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x514260,_0x1891e1){var _0x4ac81b=function(_0x53cab1){while(--_0x53cab1){_0x514260['push'](_0x514260['shift']());}};_0x4ac81b(++_0x1891e1);}(_0x7217,0x19e));var _0x7721=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x7217[_0x1b828b];return _0x98da1a;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 22f692e..e22e158 100644 --- a/server/api/setting/setting.rpc.js +++ b/server/api/setting/setting.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61c1=['then','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','attributes','include','map','model','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x41249e,_0x275d84){var _0x2bff48=function(_0x33a84d){while(--_0x33a84d){_0x41249e['push'](_0x41249e['shift']());}};_0x2bff48(++_0x275d84);}(_0x61c1,0x82));var _0x161c=function(_0x3ec10d,_0x292ab5){_0x3ec10d=_0x3ec10d-0x0;var _0x9b5ebf=_0x61c1[_0x3ec10d];return _0x9b5ebf;};'use strict';var _=require(_0x161c('0x0'));var util=require(_0x161c('0x1'));var moment=require('moment');var BPromise=require(_0x161c('0x2'));var rs=require(_0x161c('0x3'));var fs=require('fs');var Redis=require(_0x161c('0x4'));var db=require(_0x161c('0x5'))['db'];var utils=require(_0x161c('0x6'));var logger=require(_0x161c('0x7'))(_0x161c('0x8'));var config=require(_0x161c('0x9'));var jayson=require(_0x161c('0xa'));var client=jayson[_0x161c('0xb')][_0x161c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c83fb,_0x530910,_0x1a5060){return new BPromise(function(_0x184010,_0xf3d8fc){return client[_0x161c('0xd')](_0x5c83fb,_0x1a5060)[_0x161c('0xe')](function(_0x583aed){logger[_0x161c('0xf')](_0x161c('0x10'),_0x530910,_0x161c('0x11'));logger['debug'](_0x161c('0x12'),_0x530910,'request\x20sent',JSON[_0x161c('0x13')](_0x583aed));if(_0x583aed[_0x161c('0x14')]){if(_0x583aed[_0x161c('0x14')][_0x161c('0x15')]===0x1f4){logger[_0x161c('0x14')](_0x161c('0x10'),_0x530910,_0x583aed[_0x161c('0x14')][_0x161c('0x16')]);return _0xf3d8fc(_0x583aed[_0x161c('0x14')][_0x161c('0x16')]);}logger[_0x161c('0x14')](_0x161c('0x10'),_0x530910,_0x583aed[_0x161c('0x14')][_0x161c('0x16')]);return _0x184010(_0x583aed[_0x161c('0x14')][_0x161c('0x16')]);}else{logger[_0x161c('0xf')]('Setting,\x20%s,\x20%s',_0x530910,'request\x20sent');_0x184010(_0x583aed[_0x161c('0x17')][_0x161c('0x16')]);}})[_0x161c('0x18')](function(_0x14bfa1){logger[_0x161c('0x14')](_0x161c('0x10'),_0x530910,_0x14bfa1);_0xf3d8fc(_0x14bfa1);});});}exports[_0x161c('0x19')]=function(_0xd70cb7){var _0xe66493=this;return new Promise(function(_0x6105ed,_0x64a602){return db[_0x161c('0x1a')][_0x161c('0x1b')]({'raw':_0xd70cb7[_0x161c('0x1c')]?_0xd70cb7[_0x161c('0x1c')][_0x161c('0x1d')]===undefined?!![]:![]:!![],'where':_0xd70cb7['options']?_0xd70cb7[_0x161c('0x1c')][_0x161c('0x1e')]||null:null,'attributes':_0xd70cb7['options']?_0xd70cb7[_0x161c('0x1c')][_0x161c('0x1f')]||null:null,'include':_0xd70cb7[_0x161c('0x1c')]?_0xd70cb7[_0x161c('0x1c')][_0x161c('0x20')]?_[_0x161c('0x21')](_0xd70cb7[_0x161c('0x1c')][_0x161c('0x20')],function(_0x52eac0){return{'model':db[_0x52eac0[_0x161c('0x22')]],'as':_0x52eac0['as'],'attributes':_0x52eac0[_0x161c('0x1f')],'include':_0x52eac0[_0x161c('0x20')]?_[_0x161c('0x21')](_0x52eac0[_0x161c('0x20')],function(_0x477683){return{'model':db[_0x477683[_0x161c('0x22')]],'as':_0x477683['as'],'attributes':_0x477683['attributes'],'include':_0x477683[_0x161c('0x20')]?_[_0x161c('0x21')](_0x477683[_0x161c('0x20')],function(_0x55bf76){return{'model':db[_0x55bf76[_0x161c('0x22')]],'as':_0x55bf76['as'],'attributes':_0x55bf76[_0x161c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x161c('0xe')](function(_0x498d4d){logger[_0x161c('0xf')]('ShowSetting',_0xd70cb7);logger[_0x161c('0x23')](_0x161c('0x19'),_0xd70cb7,JSON['stringify'](_0x498d4d));_0x6105ed(_0x498d4d);})['catch'](function(_0x2ff9c8){logger[_0x161c('0x14')](_0x161c('0x19'),_0x2ff9c8[_0x161c('0x16')],_0xd70cb7);_0x64a602(_0xe66493[_0x161c('0x14')](0x1f4,_0x2ff9c8['message']));});});}; \ No newline at end of file +var _0x7c44=['Setting','find','options','raw','where','include','map','attributes','model','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSetting'];(function(_0x328e46,_0x22dc8e){var _0x43a5cc=function(_0x1b6b76){while(--_0x1b6b76){_0x328e46['push'](_0x328e46['shift']());}};_0x43a5cc(++_0x22dc8e);}(_0x7c44,0x1e6));var _0x47c4=function(_0x57f323,_0x1d9114){_0x57f323=_0x57f323-0x0;var _0x51b83e=_0x7c44[_0x57f323];return _0x51b83e;};'use strict';var _=require(_0x47c4('0x0'));var util=require(_0x47c4('0x1'));var moment=require(_0x47c4('0x2'));var BPromise=require(_0x47c4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x47c4('0x4'));var db=require(_0x47c4('0x5'))['db'];var utils=require(_0x47c4('0x6'));var logger=require('../../config/logger')(_0x47c4('0x7'));var config=require(_0x47c4('0x8'));var jayson=require(_0x47c4('0x9'));var client=jayson[_0x47c4('0xa')][_0x47c4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5371d3,_0x40755f,_0x3aed73){return new BPromise(function(_0x2dec24,_0x365ca1){return client[_0x47c4('0xc')](_0x5371d3,_0x3aed73)['then'](function(_0x3560b6){logger[_0x47c4('0xd')](_0x47c4('0xe'),_0x40755f,_0x47c4('0xf'));logger[_0x47c4('0x10')](_0x47c4('0x11'),_0x40755f,_0x47c4('0xf'),JSON[_0x47c4('0x12')](_0x3560b6));if(_0x3560b6['error']){if(_0x3560b6[_0x47c4('0x13')][_0x47c4('0x14')]===0x1f4){logger[_0x47c4('0x13')](_0x47c4('0xe'),_0x40755f,_0x3560b6['error'][_0x47c4('0x15')]);return _0x365ca1(_0x3560b6[_0x47c4('0x13')]['message']);}logger[_0x47c4('0x13')](_0x47c4('0xe'),_0x40755f,_0x3560b6[_0x47c4('0x13')][_0x47c4('0x15')]);return _0x2dec24(_0x3560b6[_0x47c4('0x13')]['message']);}else{logger['info']('Setting,\x20%s,\x20%s',_0x40755f,_0x47c4('0xf'));_0x2dec24(_0x3560b6['result'][_0x47c4('0x15')]);}})[_0x47c4('0x16')](function(_0x56205e){logger[_0x47c4('0x13')](_0x47c4('0xe'),_0x40755f,_0x56205e);_0x365ca1(_0x56205e);});});}exports[_0x47c4('0x17')]=function(_0x9c3545){var _0x1186d1=this;return new Promise(function(_0x4bbbf9,_0x571a96){return db[_0x47c4('0x18')][_0x47c4('0x19')]({'raw':_0x9c3545[_0x47c4('0x1a')]?_0x9c3545['options'][_0x47c4('0x1b')]===undefined?!![]:![]:!![],'where':_0x9c3545[_0x47c4('0x1a')]?_0x9c3545['options'][_0x47c4('0x1c')]||null:null,'attributes':_0x9c3545[_0x47c4('0x1a')]?_0x9c3545['options']['attributes']||null:null,'include':_0x9c3545['options']?_0x9c3545['options'][_0x47c4('0x1d')]?_[_0x47c4('0x1e')](_0x9c3545['options'][_0x47c4('0x1d')],function(_0x46a8c2){return{'model':db[_0x46a8c2['model']],'as':_0x46a8c2['as'],'attributes':_0x46a8c2[_0x47c4('0x1f')],'include':_0x46a8c2[_0x47c4('0x1d')]?_[_0x47c4('0x1e')](_0x46a8c2[_0x47c4('0x1d')],function(_0x2e8df7){return{'model':db[_0x2e8df7[_0x47c4('0x20')]],'as':_0x2e8df7['as'],'attributes':_0x2e8df7[_0x47c4('0x1f')],'include':_0x2e8df7[_0x47c4('0x1d')]?_[_0x47c4('0x1e')](_0x2e8df7[_0x47c4('0x1d')],function(_0x8d779a){return{'model':db[_0x8d779a[_0x47c4('0x20')]],'as':_0x8d779a['as'],'attributes':_0x8d779a['attributes']};}):[]};}):[]};}):[]:[]})[_0x47c4('0x21')](function(_0x290b96){logger[_0x47c4('0xd')](_0x47c4('0x17'),_0x9c3545);logger['debug'](_0x47c4('0x17'),_0x9c3545,JSON[_0x47c4('0x12')](_0x290b96));_0x4bbbf9(_0x290b96);})[_0x47c4('0x16')](function(_0x5b7dd1){logger[_0x47c4('0x13')]('ShowSetting',_0x5b7dd1[_0x47c4('0x15')],_0x9c3545);_0x571a96(_0x1186d1[_0x47c4('0x13')](0x1f4,_0x5b7dd1[_0x47c4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index a88269d..2742ce7 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x41935b,_0x34c738){var _0xb4518=function(_0x1baf6f){while(--_0x1baf6f){_0x41935b['push'](_0x41935b['shift']());}};_0xb4518(++_0x34c738);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x3dfbc3,_0x41a601){var _0x53fc9e=function(_0xaeae50){while(--_0xaeae50){_0x3dfbc3['push'](_0x3dfbc3['shift']());}};_0x53fc9e(++_0x41a601);}(_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',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 896b5de..474d594 100644 --- a/server/api/smsAccount/smsAccount.attributes.js +++ b/server/api/smsAccount/smsAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0046=['clicksend','clickatell','bandwidth','csc','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','generate','twilio','skebby','connectel'];(function(_0x5f25e6,_0x4b1319){var _0x29c892=function(_0x274d7c){while(--_0x274d7c){_0x5f25e6['push'](_0x5f25e6['shift']());}};_0x29c892(++_0x4b1319);}(_0x0046,0x161));var _0x6004=function(_0x16311d,_0x3563ed){_0x16311d=_0x16311d-0x0;var _0x21bf6d=_0x0046[_0x16311d];return _0x21bf6d;};'use strict';var Sequelize=require(_0x6004('0x0'));var rs=require('randomstring');module[_0x6004('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x6004('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x6004('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x6004('0x2')],'defaultValue':function(){return rs[_0x6004('0x3')]();}},'phone':{'type':Sequelize[_0x6004('0x2')]},'type':{'type':Sequelize['ENUM'](_0x6004('0x4'),_0x6004('0x5'),_0x6004('0x6'),_0x6004('0x7'),'plivo',_0x6004('0x8'),_0x6004('0x9'),_0x6004('0xa'),'infobip','intelepeer')},'accountSid':{'type':Sequelize[_0x6004('0x2')]},'authId':{'type':Sequelize[_0x6004('0x2')]},'authToken':{'type':Sequelize[_0x6004('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x6004('0x2')]},'apiKey':{'type':Sequelize[_0x6004('0x2')]},'applicationId':{'type':Sequelize[_0x6004('0x2')]},'accountId':{'type':Sequelize[_0x6004('0x2')]},'senderString':{'type':Sequelize[_0x6004('0x2')]},'deliveryReport':{'type':Sequelize[_0x6004('0xb')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6004('0xc')],'defaultValue':function(){return _0x6004('0xd');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6004('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6004('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x6004('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6004('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6004('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6004('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6004('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x6004('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x6004('0xb')],'defaultValue':![],'comment':_0x6004('0x10'),'set':function(_0xa6bd14){if(!_0xa6bd14)this[_0x6004('0x11')](_0x6004('0x12'),null);this['setDataValue'](_0x6004('0x13'),_0xa6bd14);}}}; \ No newline at end of file +var _0xbce1=['twilio','connectel','clicksend','plivo','bandwidth','infobip','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM'];(function(_0x2ddafd,_0x1a89ac){var _0xa98df2=function(_0x2e2f59){while(--_0x2e2f59){_0x2ddafd['push'](_0x2ddafd['shift']());}};_0xa98df2(++_0x1a89ac);}(_0xbce1,0x112));var _0x1bce=function(_0x489d29,_0x57bb79){_0x489d29=_0x489d29-0x0;var _0x2cb1ca=_0xbce1[_0x489d29];return _0x2cb1ca;};'use strict';var Sequelize=require(_0x1bce('0x0'));var rs=require(_0x1bce('0x1'));module[_0x1bce('0x2')]={'name':{'type':Sequelize[_0x1bce('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x1bce('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x1bce('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x1bce('0x4')]();}},'phone':{'type':Sequelize[_0x1bce('0x3')]},'type':{'type':Sequelize[_0x1bce('0x5')](_0x1bce('0x6'),'skebby',_0x1bce('0x7'),_0x1bce('0x8'),_0x1bce('0x9'),'clickatell',_0x1bce('0xa'),'csc',_0x1bce('0xb'),'intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x1bce('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x1bce('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x1bce('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x1bce('0x3')]},'deliveryReport':{'type':Sequelize[_0x1bce('0xc')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1bce('0xd');}},'notificationSound':{'type':Sequelize[_0x1bce('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1bce('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1bce('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x1bce('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1bce('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1bce('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1bce('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x1bce('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x1bce('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x1bce('0xc')],'defaultValue':![],'comment':_0x1bce('0x10'),'set':function(_0x2d634b){if(!_0x2d634b)this[_0x1bce('0x11')](_0x1bce('0x12'),null);this[_0x1bce('0x11')](_0x1bce('0x13'),_0x2d634b);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 26c209f..9b0ae73 100644 --- a/server/api/smsAccount/smsAccount.controller.js +++ b/server/api/smsAccount/smsAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7171=['describe','addDisposition','SmsAccountId','Disposition','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','SmsApplication','Applications','applications','orderBy','priority','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','Body','messageId','MessageSid','skebby','from','sender','text','connectel','clicksend','plivo','MessageUUID','infobip','results','csc','originatingAddress','fromNumber','replyMessageId','bandwidth','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','spread','interaction','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','UserId','waitForTheAssignedAgent','queueId','unshift','queue','waitForTheAssignedQueue','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','SmsInteraction','User','Owner','fullname','internal','Tag','tag','List','out','Messages','dataValues','push','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','skebby_dispatch_id','requestid','statusInt','message_id','status_code','groupName','DELIVERED','intelepeer','redif','error_code','clickatell','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','http','request','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','get','UserProfileResource','destroy','stack','name','send','map','SmsAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','params','Pause','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause'];(function(_0x1427e5,_0x34526e){var _0x59bb5f=function(_0x353365){while(--_0x353365){_0x1427e5['push'](_0x1427e5['shift']());}};_0x59bb5f(++_0x34526e);}(_0x7171,0x160));var _0x1717=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x7171[_0x15bc81];return _0x59440e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1717('0x0'));var zipdir=require(_0x1717('0x1'));var jsonpatch=require(_0x1717('0x2'));var rp=require(_0x1717('0x3'));var moment=require('moment');var BPromise=require(_0x1717('0x4'));var Mustache=require('mustache');var util=require(_0x1717('0x5'));var path=require(_0x1717('0x6'));var sox=require(_0x1717('0x7'));var csv=require(_0x1717('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1717('0x9'));var _=require(_0x1717('0xa'));var squel=require(_0x1717('0xb'));var crypto=require(_0x1717('0xc'));var jsforce=require(_0x1717('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1717('0x8'));var querystring=require(_0x1717('0xe'));var Papa=require(_0x1717('0xf'));var Redis=require('ioredis');var authService=require(_0x1717('0x10'));var qs=require(_0x1717('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1717('0x12'));var logger=require('../../config/logger')(_0x1717('0x13'));var utils=require('../../config/utils');var config=require(_0x1717('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1717('0x15'))['db'];config[_0x1717('0x16')]=_[_0x1717('0x17')](config[_0x1717('0x16')],{'host':_0x1717('0x18'),'port':0x18eb});var socket=require(_0x1717('0x19'))(new Redis(config[_0x1717('0x16')]));require(_0x1717('0x1a'))[_0x1717('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x1717('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x5ee618,_0x30dd82,_0x4c7b73,_0x443956){return new BPromise(function(_0x42d291,_0x4dc855){var _0x3147af=_0x443956||client;return _0x3147af[_0x1717('0x1d')](_0x5ee618,_0x4c7b73)['then'](function(_0x3572ad){logger['info'](_0x1717('0x1e'),_0x30dd82,_0x1717('0x1f'));logger[_0x1717('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x30dd82,'request\x20sent',JSON[_0x1717('0x21')](_0x3572ad));if(_0x3572ad['error']){if(_0x3572ad[_0x1717('0x22')][_0x1717('0x23')]===0x1f4){logger[_0x1717('0x22')](_0x1717('0x1e'),_0x30dd82,_0x3572ad[_0x1717('0x22')][_0x1717('0x24')]);return _0x4dc855(_0x3572ad['error'][_0x1717('0x24')]);}logger['error'](_0x1717('0x1e'),_0x30dd82,_0x3572ad[_0x1717('0x22')][_0x1717('0x24')]);return _0x42d291(_0x3572ad[_0x1717('0x22')][_0x1717('0x24')]);}else{logger[_0x1717('0x25')](_0x1717('0x1e'),_0x30dd82,_0x1717('0x1f'));_0x42d291(_0x3572ad[_0x1717('0x26')]['message']);}})[_0x1717('0x27')](function(_0x1bfca1){logger[_0x1717('0x22')]('SmsAccount,\x20%s,\x20%s',_0x30dd82,_0x1bfca1);_0x4dc855(_0x1bfca1);});});}function respondWithStatusCode(_0x4f765d,_0x403bf4){_0x403bf4=_0x403bf4||0xcc;return function(_0x24cd63){if(_0x24cd63){return _0x4f765d[_0x1717('0x28')](_0x403bf4);}return _0x4f765d[_0x1717('0x29')](_0x403bf4)[_0x1717('0x2a')]();};}function respondWithResult(_0x416d35,_0x2337ee){_0x2337ee=_0x2337ee||0xc8;return function(_0xd8d4e8){if(_0xd8d4e8){return _0x416d35[_0x1717('0x29')](_0x2337ee)[_0x1717('0x2b')](_0xd8d4e8);}};}function respondWithFilteredResult(_0x36bbf8,_0x336146){return function(_0x4c7aa4){if(_0x4c7aa4){var _0xc53c38=typeof _0x336146[_0x1717('0x2c')]===_0x1717('0x2d')&&typeof _0x336146['limit']===_0x1717('0x2d');var _0x8f9934=_0x4c7aa4[_0x1717('0x2e')];var _0x5c76d9=_0xc53c38?0x0:_0x336146[_0x1717('0x2c')];var _0x41f385=_0xc53c38?_0x4c7aa4[_0x1717('0x2e')]:_0x336146[_0x1717('0x2c')]+_0x336146[_0x1717('0x2f')];var _0x15e05b;if(_0x41f385>=_0x8f9934){_0x41f385=_0x8f9934;_0x15e05b=0xc8;}else{_0x15e05b=0xce;}_0x36bbf8['status'](_0x15e05b);return _0x36bbf8[_0x1717('0x30')](_0x1717('0x31'),_0x5c76d9+'-'+_0x41f385+'/'+_0x8f9934)[_0x1717('0x2b')](_0x4c7aa4);}return null;};}function patchUpdates(_0x3fef67){return function(_0x1e918a){try{jsonpatch['apply'](_0x1e918a,_0x3fef67,!![]);}catch(_0x26cd97){return BPromise['reject'](_0x26cd97);}return _0x1e918a[_0x1717('0x32')]();};}function saveUpdates(_0x5346a5,_0x33dbf1){return function(_0xb68b64){if(_0xb68b64){return _0xb68b64[_0x1717('0x33')](_0x5346a5)[_0x1717('0x34')](function(_0x514ae1){return _0x514ae1;});}return null;};}function removeEntity(_0x1bade0,_0x5c6f6e){return function(_0x2e9ac9){if(_0x2e9ac9){return _0x2e9ac9['destroy']()[_0x1717('0x34')](function(){var _0x543170=_0x2e9ac9[_0x1717('0x35')]({'plain':!![]});var _0x571ade='SmsAccounts';return db[_0x1717('0x36')][_0x1717('0x37')]({'where':{'type':_0x571ade,'resourceId':_0x543170['id']}})[_0x1717('0x34')](function(){return _0x2e9ac9;});})[_0x1717('0x34')](function(){_0x1bade0[_0x1717('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x111475,_0x207435){return function(_0x1524c1){if(!_0x1524c1){_0x111475[_0x1717('0x28')](0x194);}return _0x1524c1;};}function handleError(_0x10decb,_0x2a85e3){_0x2a85e3=_0x2a85e3||0x1f4;return function(_0x15457c){logger[_0x1717('0x22')](_0x15457c[_0x1717('0x38')]);if(_0x15457c['name']){delete _0x15457c[_0x1717('0x39')];}_0x10decb[_0x1717('0x29')](_0x2a85e3)[_0x1717('0x3a')](_0x15457c);};}exports['index']=function(_0x48949e,_0xa1e8e1){var _0x1d9684={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0xa118a9={},_0x4c8bc4={'count':0x0,'rows':[]};var _0x3678fd=_[_0x1717('0x3b')](db[_0x1717('0x3c')][_0x1717('0x3d')],function(_0x1883f9){return{'name':_0x1883f9[_0x1717('0x3e')],'type':_0x1883f9[_0x1717('0x3f')][_0x1717('0x40')]};});_0xa118a9['model']=_[_0x1717('0x3b')](_0x3678fd,_0x1717('0x39'));_0xa118a9[_0x1717('0x41')]=_[_0x1717('0x42')](_0x48949e['query']);_0xa118a9[_0x1717('0x43')]=_[_0x1717('0x44')](_0xa118a9[_0x1717('0x45')],_0xa118a9[_0x1717('0x41')]);_0x1d9684[_0x1717('0x46')]=_['intersection'](_0xa118a9[_0x1717('0x45')],qs['fields'](_0x48949e[_0x1717('0x41')][_0x1717('0x47')]));_0x1d9684[_0x1717('0x46')]=_0x1d9684['attributes'][_0x1717('0x48')]?_0x1d9684[_0x1717('0x46')]:_0xa118a9['model'];if(!_0x48949e[_0x1717('0x41')]['hasOwnProperty'](_0x1717('0x49'))){_0x1d9684[_0x1717('0x2f')]=qs[_0x1717('0x2f')](_0x48949e[_0x1717('0x41')][_0x1717('0x2f')]);_0x1d9684[_0x1717('0x2c')]=qs['offset'](_0x48949e[_0x1717('0x41')]['offset']);}_0x1d9684[_0x1717('0x4a')]=qs[_0x1717('0x4b')](_0x48949e[_0x1717('0x41')][_0x1717('0x4b')]);_0x1d9684[_0x1717('0x4c')]=qs['filters'](_[_0x1717('0x4d')](_0x48949e[_0x1717('0x41')],_0xa118a9[_0x1717('0x43')]),_0x3678fd);if(_0x48949e['query'][_0x1717('0x4e')]){_0x1d9684[_0x1717('0x4c')]=_[_0x1717('0x4f')](_0x1d9684[_0x1717('0x4c')],{'$or':_[_0x1717('0x3b')](_0x3678fd,function(_0x524061){if(_0x524061[_0x1717('0x3f')]!=='VIRTUAL'){var _0x523cb5={};_0x523cb5[_0x524061[_0x1717('0x39')]]={'$like':'%'+_0x48949e[_0x1717('0x41')]['filter']+'%'};return _0x523cb5;}})});}_0x1d9684=_[_0x1717('0x4f')]({},_0x1d9684,_0x48949e['options']);var _0x13bf6d={'where':_0x1d9684[_0x1717('0x4c')]};return db[_0x1717('0x3c')][_0x1717('0x2e')](_0x13bf6d)['then'](function(_0x175bac){_0x4c8bc4[_0x1717('0x2e')]=_0x175bac;if(_0x48949e[_0x1717('0x41')][_0x1717('0x50')]){_0x1d9684[_0x1717('0x51')]=[{'all':!![]}];}return db['SmsAccount'][_0x1717('0x52')](_0x1d9684);})['then'](function(_0x333f86){_0x4c8bc4[_0x1717('0x53')]=_0x333f86;return _0x4c8bc4;})['then'](respondWithFilteredResult(_0xa1e8e1,_0x1d9684))[_0x1717('0x27')](handleError(_0xa1e8e1,null));};exports['show']=function(_0x52b075,_0x24207b){var _0x4c2809={'raw':![],'where':{'id':_0x52b075[_0x1717('0x54')]['id']},'include':[{'model':db[_0x1717('0x55')],'as':'mandatoryDispositionPause'}]},_0x3cf5f2={};_0x3cf5f2[_0x1717('0x45')]=_[_0x1717('0x42')](db['SmsAccount'][_0x1717('0x3d')]);_0x3cf5f2['query']=_[_0x1717('0x42')](_0x52b075[_0x1717('0x41')]);_0x3cf5f2[_0x1717('0x43')]=_['intersection'](_0x3cf5f2[_0x1717('0x45')],_0x3cf5f2[_0x1717('0x41')]);_0x4c2809[_0x1717('0x46')]=_['intersection'](_0x3cf5f2['model'],qs[_0x1717('0x47')](_0x52b075[_0x1717('0x41')][_0x1717('0x47')]));_0x4c2809[_0x1717('0x46')]=_0x4c2809[_0x1717('0x46')][_0x1717('0x48')]?_0x4c2809[_0x1717('0x46')]:_0x3cf5f2['model'];if(_0x52b075[_0x1717('0x41')]['includeAll']){_0x4c2809[_0x1717('0x51')]=[{'all':!![]}];}_0x4c2809=_[_0x1717('0x4f')]({},_0x4c2809,_0x52b075[_0x1717('0x56')]);return db[_0x1717('0x3c')][_0x1717('0x57')](_0x4c2809)[_0x1717('0x34')](handleEntityNotFound(_0x24207b,null))[_0x1717('0x34')](respondWithResult(_0x24207b,null))[_0x1717('0x27')](handleError(_0x24207b,null));};exports[_0x1717('0x58')]=function(_0x26b9d9,_0x413316){return db[_0x1717('0x3c')][_0x1717('0x58')](_0x26b9d9[_0x1717('0x59')],{})[_0x1717('0x34')](function(_0x4d29e0){var _0x280505=_0x26b9d9[_0x1717('0x5a')][_0x1717('0x35')]({'plain':!![]});if(!_0x280505)throw new Error(_0x1717('0x5b'));if(_0x280505[_0x1717('0x5c')]===_0x1717('0x5a')){var _0x4ab57b=_0x4d29e0[_0x1717('0x35')]({'plain':!![]});var _0x1c013a='SmsAccounts';return db[_0x1717('0x5d')][_0x1717('0x57')]({'where':{'name':_0x1c013a,'userProfileId':_0x280505[_0x1717('0x5e')]},'raw':!![]})[_0x1717('0x34')](function(_0x4353a3){if(_0x4353a3&&_0x4353a3[_0x1717('0x5f')]===0x0){return db[_0x1717('0x36')][_0x1717('0x58')]({'name':_0x4ab57b[_0x1717('0x39')],'resourceId':_0x4ab57b['id'],'type':_0x4353a3[_0x1717('0x39')],'sectionId':_0x4353a3['id']},{})[_0x1717('0x34')](function(){return _0x4d29e0;});}else{return _0x4d29e0;}})[_0x1717('0x27')](function(_0x1ffd03){logger[_0x1717('0x22')](_0x1717('0x60'),_0x1ffd03);throw _0x1ffd03;});}return _0x4d29e0;})['then'](respondWithResult(_0x413316,0xc9))[_0x1717('0x27')](handleError(_0x413316,null));};exports[_0x1717('0x33')]=function(_0x20fafc,_0x239813){if(_0x20fafc[_0x1717('0x59')]['id']){delete _0x20fafc[_0x1717('0x59')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x20fafc[_0x1717('0x54')]['id']},'include':[{'model':db[_0x1717('0x55')],'as':_0x1717('0x61')}]})[_0x1717('0x34')](handleEntityNotFound(_0x239813,null))[_0x1717('0x34')](saveUpdates(_0x20fafc[_0x1717('0x59')],null))[_0x1717('0x34')](respondWithResult(_0x239813,null))[_0x1717('0x27')](handleError(_0x239813,null));};exports[_0x1717('0x37')]=function(_0x3c734d,_0x2a1653){return db['SmsAccount'][_0x1717('0x57')]({'where':{'id':_0x3c734d[_0x1717('0x54')]['id']}})[_0x1717('0x34')](handleEntityNotFound(_0x2a1653,null))['then'](removeEntity(_0x2a1653,null))[_0x1717('0x27')](handleError(_0x2a1653,null));};exports[_0x1717('0x62')]=function(_0x780082,_0x5e8cc5){return db[_0x1717('0x3c')][_0x1717('0x62')]()[_0x1717('0x34')](respondWithResult(_0x5e8cc5,null))['catch'](handleError(_0x5e8cc5,null));};exports[_0x1717('0x63')]=function(_0x53edf0,_0x43a644,_0xfc470c){if(_0x53edf0[_0x1717('0x59')]['id']){delete _0x53edf0[_0x1717('0x59')]['id'];}return db[_0x1717('0x3c')][_0x1717('0x57')]({'where':{'id':_0x53edf0[_0x1717('0x54')]['id']}})['then'](handleEntityNotFound(_0x43a644,null))['then'](function(_0x300c8a){if(_0x300c8a){_0x53edf0['body'][_0x1717('0x64')]=_0x300c8a['id'];return db[_0x1717('0x65')][_0x1717('0x58')](_0x53edf0[_0x1717('0x59')]);}})['then'](respondWithResult(_0x43a644,null))['catch'](handleError(_0x43a644,null));};exports['getDispositions']=function(_0x2e0c74,_0x4b1eb7,_0x13194a){var _0x5801b8={'raw':![],'where':{}};var _0x4529cb={};var _0xb9cd52={'count':0x0,'rows':[]};return db[_0x1717('0x3c')][_0x1717('0x66')]({'where':{'id':_0x2e0c74['params']['id']}})[_0x1717('0x34')](handleEntityNotFound(_0x4b1eb7,null))[_0x1717('0x34')](function(_0x5c2fe6){if(_0x5c2fe6){_0x4529cb['model']=_['keys'](db[_0x1717('0x65')][_0x1717('0x3d')]);_0x4529cb[_0x1717('0x41')]=_[_0x1717('0x42')](_0x2e0c74[_0x1717('0x41')]);_0x4529cb[_0x1717('0x43')]=_[_0x1717('0x44')](_0x4529cb[_0x1717('0x45')],_0x4529cb['query']);_0x5801b8[_0x1717('0x46')]=_[_0x1717('0x44')](_0x4529cb[_0x1717('0x45')],qs['fields'](_0x2e0c74[_0x1717('0x41')][_0x1717('0x47')]));_0x5801b8[_0x1717('0x46')]=_0x5801b8['attributes'][_0x1717('0x48')]?_0x5801b8[_0x1717('0x46')]:_0x4529cb[_0x1717('0x45')];if(!_0x2e0c74[_0x1717('0x41')][_0x1717('0x67')](_0x1717('0x49'))){_0x5801b8['limit']=qs[_0x1717('0x2f')](_0x2e0c74['query'][_0x1717('0x2f')]);_0x5801b8['offset']=qs[_0x1717('0x2c')](_0x2e0c74[_0x1717('0x41')][_0x1717('0x2c')]);}_0x5801b8['order']=qs[_0x1717('0x4b')](_0x2e0c74['query'][_0x1717('0x4b')]);_0x5801b8[_0x1717('0x4c')]=qs[_0x1717('0x43')](_[_0x1717('0x4d')](_0x2e0c74[_0x1717('0x41')],_0x4529cb[_0x1717('0x43')]));_0x5801b8['where']['SmsAccountId']=_0x5c2fe6['id'];if(_0x2e0c74[_0x1717('0x41')]['filter']){_0x5801b8[_0x1717('0x4c')]=_['merge'](_0x5801b8['where'],{'$or':_[_0x1717('0x3b')](_0x5801b8[_0x1717('0x46')],function(_0xa6681){var _0x3c8082={};_0x3c8082[_0xa6681]={'$like':'%'+_0x2e0c74[_0x1717('0x41')][_0x1717('0x4e')]+'%'};return _0x3c8082;})});}_0x5801b8=_['merge']({},_0x5801b8,_0x2e0c74[_0x1717('0x56')]);return db[_0x1717('0x65')]['count']({'where':_0x5801b8['where']})[_0x1717('0x34')](function(_0x59b691){_0xb9cd52[_0x1717('0x2e')]=_0x59b691;if(_0x2e0c74['query'][_0x1717('0x50')]){_0x5801b8[_0x1717('0x51')]=[{'all':!![]}];}return db['Disposition'][_0x1717('0x52')](_0x5801b8);})['then'](function(_0x45f343){_0xb9cd52['rows']=_0x45f343;return _0xb9cd52;});}})[_0x1717('0x34')](respondWithFilteredResult(_0x4b1eb7,_0x5801b8))[_0x1717('0x27')](handleError(_0x4b1eb7,null));};exports[_0x1717('0x68')]=function(_0x5b45e5,_0x39a4d0,_0x20302c){return db[_0x1717('0x3c')][_0x1717('0x57')]({'where':{'id':_0x5b45e5[_0x1717('0x54')]['id']}})[_0x1717('0x34')](handleEntityNotFound(_0x39a4d0,null))[_0x1717('0x34')](function(_0x2a32e7){if(_0x2a32e7){return _0x2a32e7[_0x1717('0x68')](_0x5b45e5['query'][_0x1717('0x69')]);}})['then'](respondWithStatusCode(_0x39a4d0,null))[_0x1717('0x27')](handleError(_0x39a4d0,null));};exports[_0x1717('0x6a')]=function(_0x24f7ea,_0x24c1ec,_0x17e99e){if(_0x24f7ea[_0x1717('0x59')]['id']){delete _0x24f7ea[_0x1717('0x59')]['id'];}return db[_0x1717('0x3c')][_0x1717('0x57')]({'where':{'id':_0x24f7ea[_0x1717('0x54')]['id']}})[_0x1717('0x34')](handleEntityNotFound(_0x24c1ec,null))[_0x1717('0x34')](function(_0x3e0e6d){if(_0x3e0e6d){_0x24f7ea[_0x1717('0x59')][_0x1717('0x64')]=_0x3e0e6d['id'];return db[_0x1717('0x6b')][_0x1717('0x58')](_0x24f7ea[_0x1717('0x59')]);}})[_0x1717('0x34')](respondWithResult(_0x24c1ec,null))[_0x1717('0x27')](handleError(_0x24c1ec,null));};exports['getAnswers']=function(_0x3fc9ac,_0x33c0f6,_0x5cb38e){var _0xbfee07={'raw':![],'where':{}};var _0x167421={};var _0x3be832={'count':0x0,'rows':[]};return db[_0x1717('0x3c')][_0x1717('0x66')]({'where':{'id':_0x3fc9ac[_0x1717('0x54')]['id']}})['then'](handleEntityNotFound(_0x33c0f6,null))[_0x1717('0x34')](function(_0x1c8db0){if(_0x1c8db0){_0x167421[_0x1717('0x45')]=_['keys'](db[_0x1717('0x6b')]['rawAttributes']);_0x167421[_0x1717('0x41')]=_[_0x1717('0x42')](_0x3fc9ac[_0x1717('0x41')]);_0x167421['filters']=_[_0x1717('0x44')](_0x167421[_0x1717('0x45')],_0x167421[_0x1717('0x41')]);_0xbfee07[_0x1717('0x46')]=_['intersection'](_0x167421[_0x1717('0x45')],qs[_0x1717('0x47')](_0x3fc9ac['query'][_0x1717('0x47')]));_0xbfee07['attributes']=_0xbfee07[_0x1717('0x46')]['length']?_0xbfee07[_0x1717('0x46')]:_0x167421[_0x1717('0x45')];if(!_0x3fc9ac[_0x1717('0x41')][_0x1717('0x67')](_0x1717('0x49'))){_0xbfee07[_0x1717('0x2f')]=qs[_0x1717('0x2f')](_0x3fc9ac[_0x1717('0x41')][_0x1717('0x2f')]);_0xbfee07[_0x1717('0x2c')]=qs['offset'](_0x3fc9ac[_0x1717('0x41')][_0x1717('0x2c')]);}_0xbfee07[_0x1717('0x4a')]=qs['sort'](_0x3fc9ac[_0x1717('0x41')][_0x1717('0x4b')]);_0xbfee07[_0x1717('0x4c')]=qs[_0x1717('0x43')](_[_0x1717('0x4d')](_0x3fc9ac[_0x1717('0x41')],_0x167421[_0x1717('0x43')]));_0xbfee07[_0x1717('0x4c')][_0x1717('0x64')]=_0x1c8db0['id'];if(_0x3fc9ac['query'][_0x1717('0x4e')]){_0xbfee07['where']=_[_0x1717('0x4f')](_0xbfee07[_0x1717('0x4c')],{'$or':_[_0x1717('0x3b')](_0xbfee07[_0x1717('0x46')],function(_0x3e5095){var _0x5c9cbc={};_0x5c9cbc[_0x3e5095]={'$like':'%'+_0x3fc9ac[_0x1717('0x41')][_0x1717('0x4e')]+'%'};return _0x5c9cbc;})});}_0xbfee07=_[_0x1717('0x4f')]({},_0xbfee07,_0x3fc9ac[_0x1717('0x56')]);return db[_0x1717('0x6b')][_0x1717('0x2e')]({'where':_0xbfee07[_0x1717('0x4c')]})['then'](function(_0x2dcb88){_0x3be832[_0x1717('0x2e')]=_0x2dcb88;if(_0x3fc9ac['query']['includeAll']){_0xbfee07['include']=[{'all':!![]}];}return db[_0x1717('0x6b')][_0x1717('0x52')](_0xbfee07);})[_0x1717('0x34')](function(_0x1d9c77){_0x3be832[_0x1717('0x53')]=_0x1d9c77;return _0x3be832;});}})[_0x1717('0x34')](respondWithFilteredResult(_0x33c0f6,_0xbfee07))[_0x1717('0x27')](handleError(_0x33c0f6,null));};exports[_0x1717('0x6c')]=function(_0x3ab613,_0x4f5202,_0x61aa12){return db['SmsAccount']['find']({'where':{'id':_0x3ab613[_0x1717('0x54')]['id']}})[_0x1717('0x34')](handleEntityNotFound(_0x4f5202,null))[_0x1717('0x34')](function(_0x252b76){if(_0x252b76){return _0x252b76[_0x1717('0x6c')](_0x3ab613[_0x1717('0x41')][_0x1717('0x69')]);}})[_0x1717('0x34')](respondWithStatusCode(_0x4f5202,null))[_0x1717('0x27')](handleError(_0x4f5202,null));};exports[_0x1717('0x6d')]=function(_0x478f46,_0x5cfff0,_0x2c2cba){var _0x1ae63e={'channel':'sms'};var _0xcf2735=[];var _0xd4d4b=[];var _0x329166={};return db[_0x1717('0x3c')]['find']({'where':{'id':_0x478f46[_0x1717('0x54')]['id']},'include':[{'model':db[_0x1717('0x6e')],'as':_0x1717('0x6f')}]})['then'](handleEntityNotFound(_0x5cfff0,null))[_0x1717('0x34')](function(_0x5d29a8){_0x1ae63e['account']=_0x5d29a8;_0x1ae63e[_0x1717('0x70')]=_[_0x1717('0x71')](_0x5d29a8[_0x1717('0x6f')],[_0x1717('0x72')],['asc']);if(_0x1ae63e['account'][_0x1717('0x6f')]){delete _0x1ae63e[_0x1717('0x73')][_0x1717('0x6f')];}return db[_0x1717('0x74')][_0x1717('0x62')]();})[_0x1717('0x34')](function(_0x25b9fe){if(!_0x25b9fe){throw new db[(_0x1717('0x75'))][(_0x1717('0x76'))](_0x1717('0x77'));}_0xcf2735=_[_0x1717('0x78')](_[_0x1717('0x42')](_0x25b9fe),[_0x1717('0x79'),'updatedAt']);_0xd4d4b=_[_0x1717('0x78')](_[_0x1717('0x42')](_0x25b9fe),['createdAt',_0x1717('0x7a'),_0x1717('0x7b'),_0x1717('0x7c')]);_0x1ae63e['body']={'mapKey':_0x1717('0x7d')};if(_0x1ae63e[_0x1717('0x73')][_0x1717('0x3f')]){switch(_0x1ae63e[_0x1717('0x73')][_0x1717('0x3f')]){case _0x1717('0x7e'):_0x1ae63e[_0x1717('0x59')]['from']=_0x478f46[_0x1717('0x59')][_0x1717('0x7f')];_0x1ae63e[_0x1717('0x59')][_0x1717('0x59')]=_0x478f46['body'][_0x1717('0x80')];_0x1ae63e[_0x1717('0x59')][_0x1717('0x81')]=_0x478f46[_0x1717('0x59')][_0x1717('0x82')];break;case _0x1717('0x83'):_0x1ae63e[_0x1717('0x59')][_0x1717('0x84')]='+'+_0x478f46[_0x1717('0x59')][_0x1717('0x85')];_0x1ae63e[_0x1717('0x59')]['body']=_0x478f46['body'][_0x1717('0x86')];break;case _0x1717('0x87'):_0x1ae63e[_0x1717('0x59')][_0x1717('0x84')]=_0x478f46[_0x1717('0x59')][_0x1717('0x84')];_0x1ae63e[_0x1717('0x59')][_0x1717('0x59')]=_0x478f46[_0x1717('0x59')][_0x1717('0x24')];break;case _0x1717('0x88'):_0x1ae63e[_0x1717('0x59')][_0x1717('0x84')]=_0x478f46[_0x1717('0x59')]['from'];_0x1ae63e[_0x1717('0x59')]['body']=_0x478f46[_0x1717('0x59')][_0x1717('0x59')];_0x1ae63e[_0x1717('0x59')][_0x1717('0x81')]=_0x478f46[_0x1717('0x59')]['message_id'];break;case _0x1717('0x89'):_0x1ae63e[_0x1717('0x59')][_0x1717('0x84')]=_0x478f46[_0x1717('0x59')][_0x1717('0x7f')];_0x1ae63e['body']['body']=_0x478f46[_0x1717('0x59')]['Text'];_0x1ae63e[_0x1717('0x59')][_0x1717('0x81')]=_0x478f46[_0x1717('0x59')][_0x1717('0x8a')];break;case _0x1717('0x8b'):_0x1ae63e['body'][_0x1717('0x84')]='+'+_0x478f46[_0x1717('0x59')][_0x1717('0x8c')][0x0][_0x1717('0x84')];_0x1ae63e[_0x1717('0x59')]['body']=_0x478f46[_0x1717('0x59')][_0x1717('0x8c')][0x0][_0x1717('0x86')];_0x1ae63e[_0x1717('0x59')]['messageId']=_0x478f46['body'][_0x1717('0x8c')][0x0][_0x1717('0x81')];break;case _0x1717('0x8d'):_0x1ae63e['body'][_0x1717('0x84')]=_0x478f46['body'][_0x1717('0x8e')];_0x1ae63e[_0x1717('0x59')][_0x1717('0x59')]=_0x478f46[_0x1717('0x59')]['segmentedMessage'][_0x1717('0x24')];break;case'clickatell':_0x1ae63e['body'][_0x1717('0x84')]=_0x478f46[_0x1717('0x59')][_0x1717('0x8f')];_0x1ae63e[_0x1717('0x59')][_0x1717('0x59')]=_0x478f46[_0x1717('0x59')]['text'];_0x1ae63e['body'][_0x1717('0x81')]=_0x478f46[_0x1717('0x59')][_0x1717('0x90')];break;case _0x1717('0x91'):_0x1ae63e[_0x1717('0x59')]['messageId']=_0x478f46[_0x1717('0x59')][0x0][_0x1717('0x24')]['id'];_0x1ae63e['body'][_0x1717('0x84')]=_0x478f46['body'][0x0]['message']['from'];_0x1ae63e[_0x1717('0x59')]['body']=_0x478f46['body'][0x0][_0x1717('0x24')]['text'];break;case'intelepeer':_0x1ae63e[_0x1717('0x59')][_0x1717('0x84')]=_0x478f46[_0x1717('0x59')][_0x1717('0x84')];_0x1ae63e[_0x1717('0x59')]['body']=_0x478f46[_0x1717('0x59')][_0x1717('0x24')];_0x1ae63e[_0x1717('0x59')][_0x1717('0x81')]=_0x478f46['body'][_0x1717('0x92')];break;}}if(_0x1ae63e[_0x1717('0x59')]['id']){delete _0x1ae63e[_0x1717('0x59')]['id'];}if(_[_0x1717('0x93')](_0x1ae63e['body'][_0x1717('0x84')])){throw new db[(_0x1717('0x75'))][(_0x1717('0x76'))](_0x1717('0x94'));}if(_['isNil'](_0x1ae63e[_0x1717('0x59')][_0x1717('0x59')])||_0x1ae63e['body'][_0x1717('0x59')]===''){throw new db['Sequelize'][(_0x1717('0x76'))](_0x1717('0x95'));}if(_[_0x1717('0x93')](_0x1ae63e[_0x1717('0x59')][_0x1717('0x96')])){throw new db[(_0x1717('0x75'))][(_0x1717('0x76'))](_0x1717('0x97')+_0xd4d4b);}if(!_['includes'](_0xd4d4b,_0x1ae63e[_0x1717('0x59')]['mapKey'])){throw new db[(_0x1717('0x75'))][(_0x1717('0x76'))](_0x1717('0x98')+_0xd4d4b);}_0x329166[_0x1ae63e[_0x1717('0x59')][_0x1717('0x96')]]=_0x1ae63e[_0x1717('0x59')][_0x1717('0x84')];return db[_0x1717('0x99')]['find']({'where':{'id':_0x1ae63e[_0x1717('0x73')][_0x1717('0x7c')]},'include':[{'model':db[_0x1717('0x74')],'as':_0x1717('0x9a'),'where':_0x329166,'limit':0x1,'order':[[_0x1717('0x7a'),_0x1717('0x9b')]]}]});})[_0x1717('0x34')](handleEntityNotFound(_0x5cfff0,null))[_0x1717('0x34')](function(_0x716906){if(_0x716906){_0x1ae63e[_0x1717('0x9c')]=_[_0x1717('0x9d')](_0x716906,['Contacts']);if(_0x716906[_0x1717('0x9a')][_0x1717('0x48')]){return _0x716906[_0x1717('0x9a')][0x0];}var _0xdec6ae=_[_0x1717('0x17')](_0x1ae63e[_0x1717('0x59')],{'firstName':_0x1ae63e[_0x1717('0x59')][_0x1717('0x84')],'ListId':_0x716906['id']});_0xdec6ae[_0x1ae63e[_0x1717('0x59')]['mapKey']]=_0x1ae63e[_0x1717('0x59')][_0x1717('0x84')];return db[_0x1717('0x74')]['create'](_0xdec6ae,{'fields':_0xcf2735,'raw':!![]});}})['then'](handleEntityNotFound(_0x5cfff0,null))[_0x1717('0x34')](function(_0x53681b){if(_0x53681b){_0x1ae63e['contact']=_0x53681b;var _0x139b11={'ContactId':_0x53681b['id'],'phone':_0x1ae63e[_0x1717('0x59')][_0x1717('0x84')],'SmsAccountId':_0x478f46['params']['id']};var _0x52a63a={'ContactId':_0x53681b['id'],'SmsAccountId':_0x478f46[_0x1717('0x54')]['id'],'closed':![]};return db['SmsInteraction'][_0x1717('0x57')]({'where':_0x52a63a})[_0x1717('0x34')](function(_0x27ae1b){if(_0x27ae1b){return[_0x27ae1b,![]];}return db['SmsInteraction'][_0x1717('0x58')](_0x139b11)[_0x1717('0x34')](function(_0x4556e0){return[_0x4556e0,!![]];});});}})[_0x1717('0x9e')](function(_0x4bef8a,_0x16bd7c){_0x1ae63e[_0x1717('0x9f')]=_0x4bef8a['get']({'plain':!![]});_0x1ae63e[_0x1717('0x9f')]['created']=![];if(_0x16bd7c){if(_0x1ae63e[_0x1717('0x73')]['autoclose']){_0x1ae63e[_0x1717('0x70')]['push']({'id':0x0,'priority':_0x1ae63e[_0x1717('0x70')][_0x1717('0x48')]+0x1,'app':'close','appdata':_0x1717('0xa0'),'interval':_0x1717('0xa1')});}_0x1ae63e[_0x1717('0x9f')][_0x1717('0xa2')]=!![];}return db[_0x1717('0xa3')][_0x1717('0x58')]({'phone':_0x1ae63e[_0x1717('0x59')][_0x1717('0x84')],'messageId':_0x1ae63e[_0x1717('0x59')][_0x1717('0x81')],'body':_0x1ae63e[_0x1717('0x59')][_0x1717('0x59')],'SmsAccountId':_0x478f46['params']['id'],'SmsInteractionId':_0x4bef8a['id'],'direction':'in','ContactId':_0x4bef8a[_0x1717('0xa4')],'AttachmentId':_0x1ae63e[_0x1717('0x59')][_0x1717('0xa5')]});})[_0x1717('0x34')](function(_0xc88d27){_0x1ae63e['message']=_0xc88d27;if(!_0x1ae63e[_0x1717('0x9f')][_0x1717('0xa6')])return;return db['User'][_0x1717('0x57')]({'attributes':['id',_0x1717('0x39')],'where':{'id':_0x1ae63e[_0x1717('0x9f')]['UserId']}});})['then'](function(_0x233a51){if(_0x233a51){_0x1ae63e[_0x1717('0x70')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x233a51[_0x1717('0x39')]+','+(_0x1ae63e['account'][_0x1717('0xa7')]||0xa),'interval':_0x1717('0xa1')});}if(!_0x1ae63e['interaction'][_0x1717('0xa8')])return;return db['SmsQueue']['find']({'attributes':['id',_0x1717('0x39')],'where':{'id':_0x1ae63e[_0x1717('0x9f')]['queueId']}});})['then'](function(_0xa2fa1c){if(_0xa2fa1c){_0x1ae63e[_0x1717('0x70')][_0x1717('0xa9')]({'id':0x0,'priority':0x1,'app':_0x1717('0xaa'),'appdata':_0xa2fa1c['name']+','+(_0x1ae63e['account'][_0x1717('0xab')]||0x12c),'interval':_0x1717('0xa1')});}return respondWithRpcPromise('Start',_0x1717('0xac'),_0x1ae63e);})[_0x1717('0x34')](function(_0x52004b){if(_0x52004b){var _0x47fb2d=0xc8;var _0x52539c=_0x1717('0xad');logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x52539c,_0x47fb2d,_0x1717('0xae'));logger[_0x1717('0x20')](_0x1717('0xaf'),_0x52539c,_0x47fb2d,'entity\x20found',JSON['stringify'](_0x52004b));if(_0x1ae63e['account']['type']===_0x1717('0x7e')){return _0x5cfff0[_0x1717('0x29')](_0x47fb2d)[_0x1717('0x30')](_0x1717('0xb0'),_0x1717('0xb1'))['send'](_0x1717('0xb2'));}else{return _0x5cfff0[_0x1717('0x29')](_0x47fb2d)['json'](_0x52004b);}}})['catch'](handleError(_0x5cfff0,null));};exports['addApplications']=function(_0x4ccfed,_0x7fe5e8){var _0x14bf23=_0x4ccfed[_0x1717('0x54')]['id'];var _0x272c48=_0x4ccfed[_0x1717('0x59')];var _0x2dbe2a=0xc8;var _0x162afa=null;return db[_0x1717('0xb3')][_0x1717('0xb4')]({'isolationLevel':db['sequelize'][_0x1717('0xb5')][_0x1717('0xb6')][_0x1717('0xb7')]},function(_0x313605){return db[_0x1717('0x3c')][_0x1717('0x66')]({'where':{'id':_0x14bf23},'transaction':_0x313605})[_0x1717('0x34')](function(_0x15ce27){if(_0x15ce27){return db[_0x1717('0x6e')][_0x1717('0x37')]({'where':{'SmsAccountId':_0x14bf23},'transaction':_0x313605})[_0x1717('0x34')](function(){var _0x257b3e=_['map'](_0x272c48,function(_0x59f404){_0x59f404[_0x1717('0x64')]=_0x14bf23;return _0x59f404;});return db[_0x1717('0x6e')][_0x1717('0xb8')](_0x257b3e,{'transaction':_0x313605});});}else{_0x2dbe2a=0x194;_0x162afa=[];}});})['then'](function(){if(_0x2dbe2a!==0x194){return db[_0x1717('0x6e')][_0x1717('0xb9')]({'where':{'SmsAccountId':_0x14bf23},'order':_0x1717('0x72')})[_0x1717('0x34')](function(_0x554e26){_0x162afa=_0x554e26;});}})['catch'](function(_0x55373f){_0x2dbe2a=0x1f4;logger[_0x1717('0x22')](_0x55373f['stack']);if(_0x55373f[_0x1717('0x39')]){delete _0x55373f['name'];}_0x162afa=_0x55373f;})[_0x1717('0xba')](function(){if(_0x162afa===null){_0x7fe5e8[_0x1717('0x28')](_0x2dbe2a);}else{if(_0x2dbe2a===0x1f4){_0x7fe5e8['status'](_0x2dbe2a)[_0x1717('0x3a')](_0x162afa);}else{_0x7fe5e8[_0x1717('0x29')](_0x2dbe2a)[_0x1717('0x2b')](_0x162afa);}}});};exports[_0x1717('0xbb')]=function(_0x59fbc1,_0x31e712,_0x50aae7){var _0x1c2906={};var _0x4b56ac={};var _0x47987d;var _0x20abad;return db[_0x1717('0x3c')][_0x1717('0x66')]({'where':{'id':_0x59fbc1[_0x1717('0x54')]['id']}})[_0x1717('0x34')](handleEntityNotFound(_0x31e712,null))[_0x1717('0x34')](function(_0x225dcb){if(_0x225dcb){_0x47987d=_0x225dcb;_0x4b56ac[_0x1717('0x45')]=_[_0x1717('0x42')](db[_0x1717('0x6e')][_0x1717('0x3d')]);_0x4b56ac[_0x1717('0x41')]=_[_0x1717('0x42')](_0x59fbc1[_0x1717('0x41')]);_0x4b56ac[_0x1717('0x43')]=_[_0x1717('0x44')](_0x4b56ac['model'],_0x4b56ac[_0x1717('0x41')]);_0x1c2906[_0x1717('0x46')]=_[_0x1717('0x44')](_0x4b56ac[_0x1717('0x45')],qs[_0x1717('0x47')](_0x59fbc1[_0x1717('0x41')][_0x1717('0x47')]));_0x1c2906[_0x1717('0x46')]=_0x1c2906['attributes'][_0x1717('0x48')]?_0x1c2906['attributes']:_0x4b56ac[_0x1717('0x45')];_0x1c2906['order']=qs[_0x1717('0x4b')](_0x59fbc1[_0x1717('0x41')][_0x1717('0x4b')]);_0x1c2906[_0x1717('0x4c')]=qs[_0x1717('0x43')](_['pick'](_0x59fbc1[_0x1717('0x41')],_0x4b56ac[_0x1717('0x43')]));if(_0x59fbc1[_0x1717('0x41')][_0x1717('0x4e')]){_0x1c2906['where']=_['merge'](_0x1c2906[_0x1717('0x4c')],{'$or':_[_0x1717('0x3b')](_0x1c2906[_0x1717('0x46')],function(_0x1df629){var _0x3fa5b9={};_0x3fa5b9[_0x1df629]={'$like':'%'+_0x59fbc1[_0x1717('0x41')]['filter']+'%'};return _0x3fa5b9;})});}_0x1c2906=_[_0x1717('0x4f')]({},_0x1c2906,_0x59fbc1[_0x1717('0x56')]);return _0x47987d[_0x1717('0xbb')](_0x1c2906);}})['then'](function(_0x24f5d2){if(_0x24f5d2){_0x20abad=_0x24f5d2[_0x1717('0x48')];if(!_0x59fbc1[_0x1717('0x41')][_0x1717('0x67')](_0x1717('0x49'))){_0x1c2906[_0x1717('0x2f')]=qs[_0x1717('0x2f')](_0x59fbc1['query']['limit']);_0x1c2906['offset']=qs[_0x1717('0x2c')](_0x59fbc1['query']['offset']);}return _0x47987d[_0x1717('0xbb')](_0x1c2906);}})[_0x1717('0x34')](function(_0x2ec2b0){if(_0x2ec2b0){return _0x2ec2b0?{'count':_0x20abad,'rows':_0x2ec2b0}:null;}})[_0x1717('0x34')](respondWithResult(_0x31e712,null))[_0x1717('0x27')](handleError(_0x31e712,null));};exports['getInteractions']=function(_0x174006,_0x121c7b,_0x2df06e){var _0x332edc={'raw':![],'where':{}};var _0xb4003a={};var _0x232e27={'count':0x0,'rows':[]};return db[_0x1717('0x3c')][_0x1717('0x66')]({'where':{'id':_0x174006[_0x1717('0x54')]['id']}})[_0x1717('0x34')](handleEntityNotFound(_0x121c7b,null))[_0x1717('0x34')](function(_0x32d844){if(_0x32d844){_0xb4003a[_0x1717('0x45')]=_[_0x1717('0x42')](db[_0x1717('0xbc')][_0x1717('0x3d')]);_0xb4003a['query']=_[_0x1717('0x42')](_0x174006[_0x1717('0x41')]);_0xb4003a['filters']=_[_0x1717('0x44')](_0xb4003a[_0x1717('0x45')],_0xb4003a[_0x1717('0x41')]);_0x332edc[_0x1717('0x46')]=_[_0x1717('0x44')](_0xb4003a[_0x1717('0x45')],qs[_0x1717('0x47')](_0x174006[_0x1717('0x41')][_0x1717('0x47')]));_0x332edc[_0x1717('0x46')]=_0x332edc[_0x1717('0x46')]['length']?_0x332edc[_0x1717('0x46')]:_0xb4003a[_0x1717('0x45')];if(!_0x174006[_0x1717('0x41')]['hasOwnProperty']('nolimit')){_0x332edc[_0x1717('0x2f')]=qs[_0x1717('0x2f')](_0x174006[_0x1717('0x41')][_0x1717('0x2f')]);_0x332edc[_0x1717('0x2c')]=qs[_0x1717('0x2c')](_0x174006[_0x1717('0x41')]['offset']);}_0x332edc[_0x1717('0x4a')]=qs[_0x1717('0x4b')](_0x174006[_0x1717('0x41')]['sort']);_0x332edc[_0x1717('0x4c')]=qs['filters'](_[_0x1717('0x4d')](_0x174006[_0x1717('0x41')],_0xb4003a[_0x1717('0x43')]));_0x332edc[_0x1717('0x4c')][_0x1717('0x64')]=_0x32d844['id'];if(_0x174006[_0x1717('0x41')][_0x1717('0x4e')]){_0x332edc[_0x1717('0x4c')]=_[_0x1717('0x4f')](_0x332edc[_0x1717('0x4c')],{'$or':_['map'](_0x332edc[_0x1717('0x46')],function(_0x405b32){var _0x587060={};_0x587060[_0x405b32]={'$like':'%'+_0x174006['query'][_0x1717('0x4e')]+'%'};return _0x587060;})});}_0x332edc=_['merge']({},_0x332edc,_0x174006[_0x1717('0x56')]);return db[_0x1717('0xbc')][_0x1717('0x2e')]({'where':_0x332edc[_0x1717('0x4c')]})[_0x1717('0x34')](function(_0x26046e){_0x232e27[_0x1717('0x2e')]=_0x26046e;if(_0x174006[_0x1717('0x41')]['includeAll']){_0x332edc[_0x1717('0x51')]=[{'model':db[_0x1717('0x74')],'as':'Contact','required':![]},{'model':db[_0x1717('0xbd')],'as':_0x1717('0xbe'),'attributes':[_0x1717('0x39'),_0x1717('0xbf'),_0x1717('0xc0')],'required':![]},{'model':db[_0x1717('0xc1')],'as':'Tags','attributes':['id',_0x1717('0x39'),'color'],'where':_0x174006[_0x1717('0x41')]['tag']?{'id':_0x174006[_0x1717('0x41')][_0x1717('0xc2')]}:undefined,'required':_0x174006[_0x1717('0x41')][_0x1717('0xc2')]?!![]:![]}];}return db[_0x1717('0xbc')][_0x1717('0x52')](_0x332edc);})['then'](function(_0x5a0f46){_0x232e27[_0x1717('0x53')]=_0x5a0f46;return _0x232e27;});}})[_0x1717('0x34')](respondWithFilteredResult(_0x121c7b,_0x332edc))[_0x1717('0x27')](handleError(_0x121c7b,null));};exports[_0x1717('0x3a')]=function(_0x3c088a,_0x46e4d3,_0x5eadf2){var _0x3f2a10,_0x3a03b4,_0x734c61;if(_[_0x1717('0x93')](_0x3c088a[_0x1717('0x59')][_0x1717('0x59')])||_0x3c088a['body'][_0x1717('0x59')]===''){throw new db['Sequelize']['ValidationError'](_0x1717('0x95'));}if(_[_0x1717('0x93')](_0x3c088a[_0x1717('0x59')]['to'])){throw new db[(_0x1717('0x75'))][(_0x1717('0x76'))]('to\x20is\x20mandatory');}_0x3f2a10=_0x3c088a[_0x1717('0x59')]['to'];return db[_0x1717('0x3c')]['find']({'where':{'id':_0x3c088a[_0x1717('0x54')]['id']},'include':[{'model':db[_0x1717('0x99')],'as':_0x1717('0xc3'),'include':[{'model':db[_0x1717('0x74')],'as':_0x1717('0x9a'),'where':{'mobile':_0x3f2a10},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x1717('0x34')](handleEntityNotFound(_0x46e4d3,null))[_0x1717('0x34')](function(_0x3cf8ac){if(_0x3cf8ac&&_0x3cf8ac[_0x1717('0xc3')]){_0x3a03b4=_0x3cf8ac[_0x1717('0x35')]({'plain':!![]});if(_0x3a03b4[_0x1717('0xc3')]&&_0x3a03b4[_0x1717('0xc3')]['Contacts']['length']){return _0x3a03b4[_0x1717('0xc3')][_0x1717('0x9a')][0x0];}return db['CmContact'][_0x1717('0x58')](_[_0x1717('0x17')](_0x3c088a[_0x1717('0x59')],{'firstName':_0x3f2a10,'mobile':_0x3f2a10,'phone':_0x3f2a10,'ListId':_0x3a03b4['ListId']}));}})[_0x1717('0x34')](handleEntityNotFound(_0x46e4d3,null))[_0x1717('0x34')](function(_0x24beae){if(_0x24beae){_0x734c61=_0x24beae;return db['SmsInteraction'][_0x1717('0x57')]({'where':{'ContactId':_0x734c61['id'],'closed':![],'SmsAccountId':_0x3a03b4['id']}})['then'](function(_0x1d0257){if(_0x1d0257){return[_0x1d0257,![]];}return db[_0x1717('0xbc')][_0x1717('0x58')]({'UserId':_0x3c088a[_0x1717('0x5a')]['id'],'ContactId':_0x734c61['id'],'SmsAccountId':_0x3a03b4['id'],'phone':_0x3f2a10,'firstMsgDirection':_0x1717('0xc4'),'Messages':[_[_0x1717('0x4f')](_0x3c088a['body'],{'read':![],'body':_0x3c088a['body'][_0x1717('0x59')],'phone':_0x3f2a10,'SmsAccountId':_0x3a03b4['id'],'UserId':_0x3c088a[_0x1717('0x5a')]['id'],'ContactId':_0x734c61['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x1717('0xc5')}]})[_0x1717('0x34')](function(_0x4bf95b){return[_0x4bf95b,!![]];});});}})[_0x1717('0x9e')](function(_0x39753e,_0x13cb2d){if(_0x13cb2d){return _0x39753e;}return db[_0x1717('0xa3')][_0x1717('0x58')](_[_0x1717('0x4f')](_0x3c088a[_0x1717('0x59')],{'read':![],'body':_0x3c088a[_0x1717('0x59')][_0x1717('0x59')],'phone':_0x3f2a10,'SmsAccountId':_0x3a03b4['id'],'SmsInteractionId':_0x39753e['id'],'UserId':_0x3c088a[_0x1717('0x5a')]['id'],'ContactId':_0x734c61['id']}))['then'](function(_0x43670c){_0x39753e[_0x1717('0xc6')]['Messages']=[];_0x39753e['dataValues'][_0x1717('0xc5')][_0x1717('0xc7')](_0x43670c['dataValues']);return _0x39753e;});})[_0x1717('0x34')](respondWithResult(_0x46e4d3,null))[_0x1717('0x27')](handleError(_0x46e4d3,null));};exports[_0x1717('0x29')]=function(_0x51379e,_0x2556dd,_0x387b89){if(_0x51379e[_0x1717('0x59')]['id']){delete _0x51379e[_0x1717('0x59')]['id'];}var _0x2d5aa0,_0x29655e,_0x42460e;return db['SmsAccount']['find']({'where':{'id':_0x51379e[_0x1717('0x54')]['id']}})['then'](handleEntityNotFound(_0x2556dd,null))[_0x1717('0x34')](function(_0x4d5b5f){if(_0x4d5b5f){_0x42460e=_0x4d5b5f;logger['debug'](_0x1717('0xc8'),'status','received\x20delivery\x20report\x20from',_0x4d5b5f[_0x1717('0x3f')],util[_0x1717('0xc9')](_0x51379e[_0x1717('0x59')],{'showHidden':![],'depth':null}));switch(_0x4d5b5f[_0x1717('0x3f')]){case'skebby':if(_0x51379e[_0x1717('0x59')]['skebby_dispatch_id']&&_0x51379e[_0x1717('0x59')][_0x1717('0x29')]){_0x29655e=_0x51379e['body'][_0x1717('0x29')];return db[_0x1717('0xa3')]['find']({'where':{'messageId':_0x51379e[_0x1717('0x59')][_0x1717('0xca')]}});}break;case _0x1717('0x87'):if(_0x51379e[_0x1717('0x59')][_0x1717('0xcb')]&&_0x51379e[_0x1717('0x59')][_0x1717('0xcc')]){_0x29655e=_0x51379e['body'][_0x1717('0xcc')];return db['SmsMessage'][_0x1717('0x57')]({'where':{'messageId':_0x51379e[_0x1717('0x59')][_0x1717('0xcb')]}});}break;case _0x1717('0x88'):if(_0x51379e['body'][_0x1717('0xcd')]&&_0x51379e[_0x1717('0x59')][_0x1717('0xce')]){_0x29655e=_0x51379e[_0x1717('0x59')][_0x1717('0xce')];return db[_0x1717('0xa3')][_0x1717('0x57')]({'where':{'messageId':_0x51379e['body'][_0x1717('0xcd')]}});}break;case _0x1717('0x8b'):var _0x245598=_0x51379e[_0x1717('0x59')]['results'][0x0];if(_0x245598[_0x1717('0x81')]&&_0x245598[_0x1717('0x29')][_0x1717('0xcf')]===_0x1717('0xd0')){_0x29655e=_0x245598[_0x1717('0x29')]['groupName'];return db[_0x1717('0xa3')][_0x1717('0x57')]({'where':{'messageId':_0x245598[_0x1717('0x81')]}});}break;case'clickatell':if(_0x51379e['body'][_0x1717('0x81')]&&_0x51379e[_0x1717('0x59')][_0x1717('0x29')]){_0x29655e=_0x51379e[_0x1717('0x59')][_0x1717('0x29')];return db['SmsMessage'][_0x1717('0x57')]({'where':{'messageId':_0x51379e[_0x1717('0x59')][_0x1717('0x81')]}});}break;case _0x1717('0x91'):if(_0x51379e[_0x1717('0x59')][0x0][_0x1717('0x24')]['id']){_0x29655e=_0x51379e['body'][0x0][_0x1717('0x3f')];return db[_0x1717('0xa3')][_0x1717('0x57')]({'where':{'messageId':_0x51379e[_0x1717('0x59')][0x0][_0x1717('0x24')]['id']}});}break;case _0x1717('0xd1'):if(_0x51379e[_0x1717('0x59')][_0x1717('0xd2')]&&_0x51379e[_0x1717('0x59')][_0x1717('0x29')]){_0x29655e=_0x51379e['body'][_0x1717('0x29')];return db[_0x1717('0xa3')][_0x1717('0x57')]({'where':{'messageId':_0x51379e[_0x1717('0x59')][_0x1717('0xd2')]}});}break;}}})[_0x1717('0x34')](handleEntityNotFound(_0x2556dd,null))[_0x1717('0x34')](function(_0x5acec6){if(_0x5acec6){_0x2d5aa0=_0x5acec6;switch(_0x42460e[_0x1717('0x3f')]){case _0x1717('0x83'):if(_0x29655e==='DELIVERED'){return _0x2d5aa0[_0x1717('0x33')]({'read':!![]});}else{logger[_0x1717('0x22')](_0x1717('0xc8'),_0x1717('0x29'),'skebby',util['inspect'](_0x51379e['body'],{'showHidden':![],'depth':null}));}break;case _0x1717('0x87'):if(_0x29655e==='1'){return _0x2d5aa0[_0x1717('0x33')]({'read':!![]});}else{logger[_0x1717('0x22')](_0x1717('0xc8'),_0x1717('0x29'),_0x1717('0x83'),util[_0x1717('0xc9')](_0x51379e[_0x1717('0x59')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x51379e[_0x1717('0x59')][_0x1717('0xd3')]&&_0x29655e>=0xc8&&_0x29655e<=0xce){return _0x2d5aa0[_0x1717('0x33')]({'read':!![]});}else{logger[_0x1717('0x22')](_0x1717('0xc8'),'status',_0x1717('0x88'),util['inspect'](_0x51379e[_0x1717('0x59')],{'showHidden':![],'depth':null}));}break;case _0x1717('0x8b'):var _0x54ac29=_0x51379e['body'][_0x1717('0x8c')][0x0];if(_0x54ac29[_0x1717('0x29')][_0x1717('0xcf')]==='DELIVERED'){return _0x2d5aa0['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1717('0x29'),_0x1717('0x8b'),util[_0x1717('0xc9')](_0x51379e[_0x1717('0x59')],{'showHidden':![],'depth':null}));}break;case _0x1717('0xd4'):if(_0x29655e==_0x1717('0xd5')||_0x29655e=='RECEIVED_BY_RECIPIENT'){return _0x2d5aa0[_0x1717('0x33')]({'read':!![]});}else{logger[_0x1717('0x22')](_0x1717('0xc8'),'status',_0x1717('0xd4'),util[_0x1717('0xc9')](_0x51379e['body'],{'showHidden':![],'depth':null}));}break;case _0x1717('0x91'):if(_0x29655e==_0x1717('0xd6')){return _0x2d5aa0['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1717('0x29'),_0x1717('0x91'),util[_0x1717('0xc9')](_0x51379e[_0x1717('0x59')],{'showHidden':![],'depth':null}));}break;case _0x1717('0xd1'):if(_0x29655e===_0x1717('0xd7')||_0x29655e===_0x1717('0xd8')){return _0x2d5aa0[_0x1717('0x33')]({'read':!![]});}else{logger[_0x1717('0x22')](_0x1717('0xc8'),_0x1717('0x29'),_0x1717('0xd1'),util['inspect'](_0x51379e[_0x1717('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x2d5aa0;}})[_0x1717('0x34')](respondWithResult(_0x2556dd,null))[_0x1717('0x27')](handleError(_0x2556dd,null));};exports['statusGet']=function(_0xe66783,_0x292540,_0x4c07e0){var _0x187c87,_0x277c90,_0x524c3b;return db[_0x1717('0x3c')][_0x1717('0x57')]({'where':{'id':_0xe66783[_0x1717('0x54')]['id']}})[_0x1717('0x34')](handleEntityNotFound(_0x292540,null))[_0x1717('0x34')](function(_0x34d976){if(_0x34d976){_0x524c3b=_0x34d976;logger[_0x1717('0x20')](_0x1717('0xc8'),_0x1717('0x29'),'received\x20delivery\x20report\x20from',_0x34d976['type'],util[_0x1717('0xc9')](_0xe66783['query'],{'showHidden':![],'depth':null}));switch(_0x34d976[_0x1717('0x3f')]){case _0x1717('0x8d'):if(_0xe66783[_0x1717('0x41')]['message-id']&&_0xe66783['query'][_0x1717('0xd9')]){_0x277c90=_0xe66783[_0x1717('0x41')][_0x1717('0xd9')];return db[_0x1717('0xa3')][_0x1717('0x57')]({'where':{'messageId':_0xe66783[_0x1717('0x41')][_0x1717('0xda')]}});}break;}}})[_0x1717('0x34')](handleEntityNotFound(_0x292540,null))[_0x1717('0x34')](function(_0x4e5270){if(_0x4e5270){_0x187c87=_0x4e5270;switch(_0x524c3b['type']){case _0x1717('0x8d'):if(_0x277c90==='2'||_0x277c90==='6'){return _0x187c87[_0x1717('0x33')]({'read':!![]});}else{logger[_0x1717('0x22')](_0x1717('0xc8'),'status',_0x1717('0x8d'),util['inspect'](_0xe66783[_0x1717('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x187c87;}})['then'](respondWithResult(_0x292540,null))['catch'](handleError(_0x292540,null));};exports[_0x1717('0xdb')]=function(_0x1201d1,_0x466745,_0xce1daa){return db['SmsAccount'][_0x1717('0x57')]({'where':{'id':_0x1201d1[_0x1717('0x54')]['id']}})[_0x1717('0x34')](handleEntityNotFound(_0x466745,null))[_0x1717('0x34')](function(_0x3303c9){if(_0x3303c9){return _0x3303c9['addAgents'](_0x1201d1[_0x1717('0x59')][_0x1717('0x69')],_['omit'](_0x1201d1['body'],['ids','id'])||{})['spread'](function(_0x5aaaf6){for(var _0x2fa104=0x0;_0x2fa104<_0x1201d1['body'][_0x1717('0x69')]['length'];_0x2fa104+=0x1){socket[_0x1717('0xdc')](_0x1717('0xdd'),{'UserId':Number(_0x1201d1[_0x1717('0x59')]['ids'][_0x2fa104]),'SmsAccountId':Number(_0x1201d1[_0x1717('0x54')]['id'])});}return _0x5aaaf6;});}})['then'](respondWithResult(_0x466745,null))[_0x1717('0x27')](handleError(_0x466745,null));};exports['removeAgents']=function(_0x2ccaf2,_0xffe11d,_0x1bb886){return db['SmsAccount']['find']({'where':{'id':_0x2ccaf2['params']['id']}})[_0x1717('0x34')](handleEntityNotFound(_0xffe11d,null))[_0x1717('0x34')](function(_0x8737ca){if(_0x8737ca){return _0x8737ca[_0x1717('0xde')](_0x2ccaf2[_0x1717('0x41')][_0x1717('0x69')])[_0x1717('0x34')](function(){if(_['isArray'](_0x2ccaf2[_0x1717('0x41')][_0x1717('0x69')])){for(var _0x4895bb=0x0;_0x4895bb<_0x2ccaf2[_0x1717('0x41')][_0x1717('0x69')][_0x1717('0x48')];_0x4895bb+=0x1){socket[_0x1717('0xdc')](_0x1717('0xdf'),{'UserId':Number(_0x2ccaf2[_0x1717('0x41')][_0x1717('0x69')][_0x4895bb]),'SmsAccountId':Number(_0x2ccaf2[_0x1717('0x54')]['id'])});}}else{socket[_0x1717('0xdc')](_0x1717('0xdf'),{'UserId':Number(_0x2ccaf2[_0x1717('0x41')][_0x1717('0x69')]),'SmsAccountId':Number(_0x2ccaf2[_0x1717('0x54')]['id'])});}});}})[_0x1717('0x34')](respondWithStatusCode(_0xffe11d,null))[_0x1717('0x27')](handleError(_0xffe11d,null));};exports[_0x1717('0xe0')]=function(_0x58a83a,_0x2e2985,_0x14b909){var _0x6b5d49={};var _0x13bc32={};var _0x53c8b1;var _0x436ddf;return db['SmsAccount'][_0x1717('0x66')]({'where':{'id':_0x58a83a[_0x1717('0x54')]['id']}})[_0x1717('0x34')](handleEntityNotFound(_0x2e2985,null))[_0x1717('0x34')](function(_0x26aab5){if(_0x26aab5){_0x53c8b1=_0x26aab5;_0x13bc32['model']=_[_0x1717('0x42')](db[_0x1717('0xbd')]['rawAttributes']);_0x13bc32['query']=_[_0x1717('0x42')](_0x58a83a[_0x1717('0x41')]);_0x13bc32[_0x1717('0x43')]=_[_0x1717('0x44')](_0x13bc32[_0x1717('0x45')],_0x13bc32[_0x1717('0x41')]);_0x6b5d49[_0x1717('0x46')]=_['intersection'](_0x13bc32[_0x1717('0x45')],qs['fields'](_0x58a83a['query']['fields']));_0x6b5d49[_0x1717('0x46')]=_0x6b5d49[_0x1717('0x46')][_0x1717('0x48')]?_0x6b5d49[_0x1717('0x46')]:_0x13bc32['model'];_0x6b5d49[_0x1717('0x4a')]=qs['sort'](_0x58a83a[_0x1717('0x41')][_0x1717('0x4b')]);_0x6b5d49[_0x1717('0x4c')]=qs['filters'](_[_0x1717('0x4d')](_0x58a83a['query'],_0x13bc32[_0x1717('0x43')]));if(_0x58a83a[_0x1717('0x41')]['filter']){_0x6b5d49['where']=_[_0x1717('0x4f')](_0x6b5d49[_0x1717('0x4c')],{'$or':_['map'](_0x6b5d49[_0x1717('0x46')],function(_0x9f6d94){var _0x3b7c30={};_0x3b7c30[_0x9f6d94]={'$like':'%'+_0x58a83a[_0x1717('0x41')]['filter']+'%'};return _0x3b7c30;})});}_0x6b5d49=_[_0x1717('0x4f')]({},_0x6b5d49,_0x58a83a[_0x1717('0x56')]);return _0x53c8b1[_0x1717('0xe0')](_0x6b5d49);}})['then'](function(_0x2deedc){if(_0x2deedc){_0x436ddf=_0x2deedc[_0x1717('0x48')];if(!_0x58a83a[_0x1717('0x41')][_0x1717('0x67')]('nolimit')){_0x6b5d49[_0x1717('0x2f')]=qs[_0x1717('0x2f')](_0x58a83a[_0x1717('0x41')][_0x1717('0x2f')]);_0x6b5d49[_0x1717('0x2c')]=qs['offset'](_0x58a83a[_0x1717('0x41')][_0x1717('0x2c')]);}return _0x53c8b1[_0x1717('0xe0')](_0x6b5d49);}})[_0x1717('0x34')](function(_0x34d6cf){if(_0x34d6cf){return _0x34d6cf?{'count':_0x436ddf,'rows':_0x34d6cf}:null;}})[_0x1717('0x34')](respondWithResult(_0x2e2985,null))['catch'](handleError(_0x2e2985,null));}; \ No newline at end of file +var _0xfd39=['addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','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','redis','localhost','socket.io-emitter','./smsAccount.socket','register','client','http','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','destroy','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','sort','SmsAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','notify','sms','SmsApplication','Applications','account','priority','asc','CmContact','updatedAt','CompanyId','ListId','mobile','twilio','from','Body','messageId','sender','text','connectel','clicksend','message_id','plivo','From','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','isNil','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','DESC','omit','Contacts','defaults','contact','SmsInteraction','interaction','autoclose','applications','push','close','*,*,*,*','created','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','queueId','SmsQueue','queue','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','getInteractions','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','SmsMessage','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','groupName','DELIVERED','bandwidth','intelepeer','redif','skebby','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','state','message-id'];(function(_0x102d14,_0x1fc703){var _0x461d97=function(_0x126ebd){while(--_0x126ebd){_0x102d14['push'](_0x102d14['shift']());}};_0x461d97(++_0x1fc703);}(_0xfd39,0x1d3));var _0x9fd3=function(_0x22c098,_0x268c6a){_0x22c098=_0x22c098-0x0;var _0x259541=_0xfd39[_0x22c098];return _0x259541;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9fd3('0x0'));var rp=require(_0x9fd3('0x1'));var moment=require(_0x9fd3('0x2'));var BPromise=require(_0x9fd3('0x3'));var Mustache=require(_0x9fd3('0x4'));var util=require(_0x9fd3('0x5'));var path=require('path');var sox=require(_0x9fd3('0x6'));var csv=require('to-csv');var ejs=require(_0x9fd3('0x7'));var fs=require('fs');var fs_extra=require(_0x9fd3('0x8'));var _=require(_0x9fd3('0x9'));var squel=require('squel');var crypto=require(_0x9fd3('0xa'));var jsforce=require(_0x9fd3('0xb'));var deskjs=require(_0x9fd3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9fd3('0xd'));var Papa=require(_0x9fd3('0xe'));var Redis=require(_0x9fd3('0xf'));var authService=require(_0x9fd3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9fd3('0x11'));var hardwareService=require(_0x9fd3('0x12'));var logger=require(_0x9fd3('0x13'))('api');var utils=require(_0x9fd3('0x14'));var config=require(_0x9fd3('0x15'));var licenseUtil=require(_0x9fd3('0x16'));var db=require('../../mysqldb')['db'];config[_0x9fd3('0x17')]=_['defaults'](config['redis'],{'host':_0x9fd3('0x18'),'port':0x18eb});var socket=require(_0x9fd3('0x19'))(new Redis(config[_0x9fd3('0x17')]));require(_0x9fd3('0x1a'))[_0x9fd3('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9fd3('0x1c')][_0x9fd3('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x12bc27,_0x15cd29,_0x2e8b55,_0xf74513){return new BPromise(function(_0x3e6b12,_0x92d38f){var _0x467199=_0xf74513||client;return _0x467199[_0x9fd3('0x1e')](_0x12bc27,_0x2e8b55)[_0x9fd3('0x1f')](function(_0xffca7d){logger[_0x9fd3('0x20')]('SmsAccount,\x20%s,\x20%s',_0x15cd29,_0x9fd3('0x21'));logger[_0x9fd3('0x22')](_0x9fd3('0x23'),_0x15cd29,'request\x20sent',JSON[_0x9fd3('0x24')](_0xffca7d));if(_0xffca7d[_0x9fd3('0x25')]){if(_0xffca7d[_0x9fd3('0x25')][_0x9fd3('0x26')]===0x1f4){logger[_0x9fd3('0x25')]('SmsAccount,\x20%s,\x20%s',_0x15cd29,_0xffca7d[_0x9fd3('0x25')]['message']);return _0x92d38f(_0xffca7d[_0x9fd3('0x25')][_0x9fd3('0x27')]);}logger[_0x9fd3('0x25')](_0x9fd3('0x28'),_0x15cd29,_0xffca7d['error'][_0x9fd3('0x27')]);return _0x3e6b12(_0xffca7d[_0x9fd3('0x25')][_0x9fd3('0x27')]);}else{logger[_0x9fd3('0x20')](_0x9fd3('0x28'),_0x15cd29,_0x9fd3('0x21'));_0x3e6b12(_0xffca7d[_0x9fd3('0x29')][_0x9fd3('0x27')]);}})[_0x9fd3('0x2a')](function(_0x233a4b){logger['error'](_0x9fd3('0x28'),_0x15cd29,_0x233a4b);_0x92d38f(_0x233a4b);});});}function respondWithStatusCode(_0x3e2a55,_0x419f36){_0x419f36=_0x419f36||0xcc;return function(_0x2a3adb){if(_0x2a3adb){return _0x3e2a55[_0x9fd3('0x2b')](_0x419f36);}return _0x3e2a55['status'](_0x419f36)[_0x9fd3('0x2c')]();};}function respondWithResult(_0x18a985,_0x1715da){_0x1715da=_0x1715da||0xc8;return function(_0x2db45c){if(_0x2db45c){return _0x18a985['status'](_0x1715da)[_0x9fd3('0x2d')](_0x2db45c);}};}function respondWithFilteredResult(_0x2a920f,_0x5c85a5){return function(_0x27ca16){if(_0x27ca16){var _0xe43c27=typeof _0x5c85a5[_0x9fd3('0x2e')]===_0x9fd3('0x2f')&&typeof _0x5c85a5[_0x9fd3('0x30')]===_0x9fd3('0x2f');var _0x3782f8=_0x27ca16['count'];var _0x323fdb=_0xe43c27?0x0:_0x5c85a5['offset'];var _0x131772=_0xe43c27?_0x27ca16[_0x9fd3('0x31')]:_0x5c85a5[_0x9fd3('0x2e')]+_0x5c85a5[_0x9fd3('0x30')];var _0x536312;if(_0x131772>=_0x3782f8){_0x131772=_0x3782f8;_0x536312=0xc8;}else{_0x536312=0xce;}_0x2a920f[_0x9fd3('0x32')](_0x536312);return _0x2a920f[_0x9fd3('0x33')](_0x9fd3('0x34'),_0x323fdb+'-'+_0x131772+'/'+_0x3782f8)[_0x9fd3('0x2d')](_0x27ca16);}return null;};}function patchUpdates(_0x1df2f9){return function(_0x11c342){try{jsonpatch['apply'](_0x11c342,_0x1df2f9,!![]);}catch(_0x57046f){return BPromise[_0x9fd3('0x35')](_0x57046f);}return _0x11c342[_0x9fd3('0x36')]();};}function saveUpdates(_0x197b45,_0x33cbcb){return function(_0x1801f9){if(_0x1801f9){return _0x1801f9[_0x9fd3('0x37')](_0x197b45)['then'](function(_0x2e9c50){return _0x2e9c50;});}return null;};}function removeEntity(_0x5e6770,_0x681c2c){return function(_0x205ce3){if(_0x205ce3){return _0x205ce3[_0x9fd3('0x38')]()[_0x9fd3('0x1f')](function(){var _0x343a50=_0x205ce3['get']({'plain':!![]});var _0xec9d3e=_0x9fd3('0x39');return db['UserProfileResource'][_0x9fd3('0x38')]({'where':{'type':_0xec9d3e,'resourceId':_0x343a50['id']}})[_0x9fd3('0x1f')](function(){return _0x205ce3;});})['then'](function(){_0x5e6770[_0x9fd3('0x32')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5787c7,_0x417d06){return function(_0x4d4342){if(!_0x4d4342){_0x5787c7['sendStatus'](0x194);}return _0x4d4342;};}function handleError(_0x21aa64,_0x2128cc){_0x2128cc=_0x2128cc||0x1f4;return function(_0x415fc1){logger['error'](_0x415fc1[_0x9fd3('0x3a')]);if(_0x415fc1[_0x9fd3('0x3b')]){delete _0x415fc1['name'];}_0x21aa64['status'](_0x2128cc)[_0x9fd3('0x3c')](_0x415fc1);};}exports[_0x9fd3('0x3d')]=function(_0x4630c7,_0x17093c){var _0xfa41b5={'include':[{'model':db[_0x9fd3('0x3e')],'as':_0x9fd3('0x3f')}]},_0x1b8df1={},_0x59696b={'count':0x0,'rows':[]};var _0x29fea8=_[_0x9fd3('0x40')](db[_0x9fd3('0x41')][_0x9fd3('0x42')],function(_0x443c71){return{'name':_0x443c71['fieldName'],'type':_0x443c71[_0x9fd3('0x43')][_0x9fd3('0x44')]};});_0x1b8df1[_0x9fd3('0x45')]=_[_0x9fd3('0x40')](_0x29fea8,_0x9fd3('0x3b'));_0x1b8df1['query']=_[_0x9fd3('0x46')](_0x4630c7['query']);_0x1b8df1[_0x9fd3('0x47')]=_[_0x9fd3('0x48')](_0x1b8df1['model'],_0x1b8df1[_0x9fd3('0x49')]);_0xfa41b5['attributes']=_[_0x9fd3('0x48')](_0x1b8df1['model'],qs[_0x9fd3('0x4a')](_0x4630c7[_0x9fd3('0x49')][_0x9fd3('0x4a')]));_0xfa41b5[_0x9fd3('0x4b')]=_0xfa41b5[_0x9fd3('0x4b')][_0x9fd3('0x4c')]?_0xfa41b5[_0x9fd3('0x4b')]:_0x1b8df1['model'];if(!_0x4630c7[_0x9fd3('0x49')][_0x9fd3('0x4d')](_0x9fd3('0x4e'))){_0xfa41b5['limit']=qs[_0x9fd3('0x30')](_0x4630c7[_0x9fd3('0x49')][_0x9fd3('0x30')]);_0xfa41b5[_0x9fd3('0x2e')]=qs[_0x9fd3('0x2e')](_0x4630c7[_0x9fd3('0x49')][_0x9fd3('0x2e')]);}_0xfa41b5[_0x9fd3('0x4f')]=qs['sort'](_0x4630c7['query']['sort']);_0xfa41b5['where']=qs['filters'](_[_0x9fd3('0x50')](_0x4630c7[_0x9fd3('0x49')],_0x1b8df1[_0x9fd3('0x47')]),_0x29fea8);if(_0x4630c7[_0x9fd3('0x49')][_0x9fd3('0x51')]){_0xfa41b5['where']=_[_0x9fd3('0x52')](_0xfa41b5[_0x9fd3('0x53')],{'$or':_[_0x9fd3('0x40')](_0x29fea8,function(_0x10a3ec){if(_0x10a3ec['type']!==_0x9fd3('0x54')){var _0x51f01e={};_0x51f01e[_0x10a3ec[_0x9fd3('0x3b')]]={'$like':'%'+_0x4630c7['query'][_0x9fd3('0x51')]+'%'};return _0x51f01e;}})});}_0xfa41b5=_[_0x9fd3('0x52')]({},_0xfa41b5,_0x4630c7[_0x9fd3('0x55')]);var _0x1f3135={'where':_0xfa41b5['where']};return db['SmsAccount'][_0x9fd3('0x31')](_0x1f3135)[_0x9fd3('0x1f')](function(_0x449a5e){_0x59696b[_0x9fd3('0x31')]=_0x449a5e;if(_0x4630c7[_0x9fd3('0x49')][_0x9fd3('0x56')]){_0xfa41b5[_0x9fd3('0x57')]=[{'all':!![]}];}return db[_0x9fd3('0x41')][_0x9fd3('0x58')](_0xfa41b5);})[_0x9fd3('0x1f')](function(_0x3c0f1c){_0x59696b[_0x9fd3('0x59')]=_0x3c0f1c;return _0x59696b;})[_0x9fd3('0x1f')](respondWithFilteredResult(_0x17093c,_0xfa41b5))[_0x9fd3('0x2a')](handleError(_0x17093c,null));};exports['show']=function(_0x59a53d,_0x40d400){var _0x1a3703={'raw':![],'where':{'id':_0x59a53d[_0x9fd3('0x5a')]['id']},'include':[{'model':db[_0x9fd3('0x3e')],'as':_0x9fd3('0x3f')}]},_0x20be03={};_0x20be03[_0x9fd3('0x45')]=_[_0x9fd3('0x46')](db['SmsAccount'][_0x9fd3('0x42')]);_0x20be03[_0x9fd3('0x49')]=_[_0x9fd3('0x46')](_0x59a53d[_0x9fd3('0x49')]);_0x20be03[_0x9fd3('0x47')]=_[_0x9fd3('0x48')](_0x20be03[_0x9fd3('0x45')],_0x20be03[_0x9fd3('0x49')]);_0x1a3703[_0x9fd3('0x4b')]=_[_0x9fd3('0x48')](_0x20be03['model'],qs['fields'](_0x59a53d[_0x9fd3('0x49')][_0x9fd3('0x4a')]));_0x1a3703[_0x9fd3('0x4b')]=_0x1a3703[_0x9fd3('0x4b')]['length']?_0x1a3703[_0x9fd3('0x4b')]:_0x20be03[_0x9fd3('0x45')];if(_0x59a53d[_0x9fd3('0x49')]['includeAll']){_0x1a3703[_0x9fd3('0x57')]=[{'all':!![]}];}_0x1a3703=_[_0x9fd3('0x52')]({},_0x1a3703,_0x59a53d[_0x9fd3('0x55')]);return db[_0x9fd3('0x41')][_0x9fd3('0x5b')](_0x1a3703)[_0x9fd3('0x1f')](handleEntityNotFound(_0x40d400,null))[_0x9fd3('0x1f')](respondWithResult(_0x40d400,null))['catch'](handleError(_0x40d400,null));};exports['create']=function(_0xccf863,_0x5d4e16){return db[_0x9fd3('0x41')][_0x9fd3('0x5c')](_0xccf863[_0x9fd3('0x5d')],{})['then'](function(_0x2d6bb1){var _0x2044f8=_0xccf863['user'][_0x9fd3('0x5e')]({'plain':!![]});if(!_0x2044f8)throw new Error(_0x9fd3('0x5f'));if(_0x2044f8[_0x9fd3('0x60')]===_0x9fd3('0x61')){var _0x122143=_0x2d6bb1[_0x9fd3('0x5e')]({'plain':!![]});var _0x292a20=_0x9fd3('0x39');return db[_0x9fd3('0x62')][_0x9fd3('0x5b')]({'where':{'name':_0x292a20,'userProfileId':_0x2044f8[_0x9fd3('0x63')]},'raw':!![]})[_0x9fd3('0x1f')](function(_0x14831e){if(_0x14831e&&_0x14831e[_0x9fd3('0x64')]===0x0){return db[_0x9fd3('0x65')]['create']({'name':_0x122143[_0x9fd3('0x3b')],'resourceId':_0x122143['id'],'type':_0x14831e[_0x9fd3('0x3b')],'sectionId':_0x14831e['id']},{})[_0x9fd3('0x1f')](function(){return _0x2d6bb1;});}else{return _0x2d6bb1;}})[_0x9fd3('0x2a')](function(_0x306baa){logger[_0x9fd3('0x25')](_0x9fd3('0x66'),_0x306baa);throw _0x306baa;});}return _0x2d6bb1;})[_0x9fd3('0x1f')](respondWithResult(_0x5d4e16,0xc9))['catch'](handleError(_0x5d4e16,null));};exports[_0x9fd3('0x37')]=function(_0x27034c,_0xdb881d){if(_0x27034c[_0x9fd3('0x5d')]['id']){delete _0x27034c['body']['id'];}return db['SmsAccount'][_0x9fd3('0x5b')]({'where':{'id':_0x27034c[_0x9fd3('0x5a')]['id']},'include':[{'model':db[_0x9fd3('0x3e')],'as':'mandatoryDispositionPause'}]})[_0x9fd3('0x1f')](handleEntityNotFound(_0xdb881d,null))['then'](saveUpdates(_0x27034c[_0x9fd3('0x5d')],null))['then'](respondWithResult(_0xdb881d,null))[_0x9fd3('0x2a')](handleError(_0xdb881d,null));};exports[_0x9fd3('0x38')]=function(_0x10610a,_0x4e47be){return db[_0x9fd3('0x41')]['find']({'where':{'id':_0x10610a['params']['id']}})[_0x9fd3('0x1f')](handleEntityNotFound(_0x4e47be,null))[_0x9fd3('0x1f')](removeEntity(_0x4e47be,null))[_0x9fd3('0x2a')](handleError(_0x4e47be,null));};exports[_0x9fd3('0x67')]=function(_0x1ec334,_0x504bb5){return db['SmsAccount']['describe']()[_0x9fd3('0x1f')](respondWithResult(_0x504bb5,null))['catch'](handleError(_0x504bb5,null));};exports[_0x9fd3('0x68')]=function(_0x2e3e2f,_0x54f472,_0x1b2cd1){if(_0x2e3e2f['body']['id']){delete _0x2e3e2f[_0x9fd3('0x5d')]['id'];}return db[_0x9fd3('0x41')]['find']({'where':{'id':_0x2e3e2f[_0x9fd3('0x5a')]['id']}})[_0x9fd3('0x1f')](handleEntityNotFound(_0x54f472,null))['then'](function(_0x40dd91){if(_0x40dd91){_0x2e3e2f[_0x9fd3('0x5d')]['SmsAccountId']=_0x40dd91['id'];return db[_0x9fd3('0x69')][_0x9fd3('0x5c')](_0x2e3e2f['body']);}})[_0x9fd3('0x1f')](respondWithResult(_0x54f472,null))[_0x9fd3('0x2a')](handleError(_0x54f472,null));};exports['getDispositions']=function(_0x53c9a9,_0x2b8359,_0x4db538){var _0x48216f={'raw':![],'where':{}};var _0x2d799e={};var _0x2346b5={'count':0x0,'rows':[]};return db[_0x9fd3('0x41')][_0x9fd3('0x6a')]({'where':{'id':_0x53c9a9[_0x9fd3('0x5a')]['id']}})[_0x9fd3('0x1f')](handleEntityNotFound(_0x2b8359,null))[_0x9fd3('0x1f')](function(_0x14fb14){if(_0x14fb14){_0x2d799e[_0x9fd3('0x45')]=_[_0x9fd3('0x46')](db[_0x9fd3('0x69')][_0x9fd3('0x42')]);_0x2d799e[_0x9fd3('0x49')]=_[_0x9fd3('0x46')](_0x53c9a9[_0x9fd3('0x49')]);_0x2d799e[_0x9fd3('0x47')]=_[_0x9fd3('0x48')](_0x2d799e['model'],_0x2d799e[_0x9fd3('0x49')]);_0x48216f[_0x9fd3('0x4b')]=_[_0x9fd3('0x48')](_0x2d799e[_0x9fd3('0x45')],qs['fields'](_0x53c9a9['query']['fields']));_0x48216f[_0x9fd3('0x4b')]=_0x48216f[_0x9fd3('0x4b')]['length']?_0x48216f[_0x9fd3('0x4b')]:_0x2d799e[_0x9fd3('0x45')];if(!_0x53c9a9[_0x9fd3('0x49')]['hasOwnProperty'](_0x9fd3('0x4e'))){_0x48216f['limit']=qs['limit'](_0x53c9a9[_0x9fd3('0x49')][_0x9fd3('0x30')]);_0x48216f[_0x9fd3('0x2e')]=qs['offset'](_0x53c9a9['query'][_0x9fd3('0x2e')]);}_0x48216f['order']=qs['sort'](_0x53c9a9[_0x9fd3('0x49')][_0x9fd3('0x6b')]);_0x48216f['where']=qs['filters'](_[_0x9fd3('0x50')](_0x53c9a9[_0x9fd3('0x49')],_0x2d799e[_0x9fd3('0x47')]));_0x48216f[_0x9fd3('0x53')][_0x9fd3('0x6c')]=_0x14fb14['id'];if(_0x53c9a9['query'][_0x9fd3('0x51')]){_0x48216f[_0x9fd3('0x53')]=_['merge'](_0x48216f['where'],{'$or':_['map'](_0x48216f[_0x9fd3('0x4b')],function(_0x248c6c){var _0x21c815={};_0x21c815[_0x248c6c]={'$like':'%'+_0x53c9a9[_0x9fd3('0x49')][_0x9fd3('0x51')]+'%'};return _0x21c815;})});}_0x48216f=_['merge']({},_0x48216f,_0x53c9a9[_0x9fd3('0x55')]);return db['Disposition'][_0x9fd3('0x31')]({'where':_0x48216f[_0x9fd3('0x53')]})[_0x9fd3('0x1f')](function(_0x5ab996){_0x2346b5[_0x9fd3('0x31')]=_0x5ab996;if(_0x53c9a9[_0x9fd3('0x49')]['includeAll']){_0x48216f['include']=[{'all':!![]}];}return db[_0x9fd3('0x69')][_0x9fd3('0x58')](_0x48216f);})[_0x9fd3('0x1f')](function(_0x116a0b){_0x2346b5[_0x9fd3('0x59')]=_0x116a0b;return _0x2346b5;});}})[_0x9fd3('0x1f')](respondWithFilteredResult(_0x2b8359,_0x48216f))[_0x9fd3('0x2a')](handleError(_0x2b8359,null));};exports[_0x9fd3('0x6d')]=function(_0x17c1f2,_0x25009a,_0x1e80f8){return db[_0x9fd3('0x41')]['find']({'where':{'id':_0x17c1f2[_0x9fd3('0x5a')]['id']}})[_0x9fd3('0x1f')](handleEntityNotFound(_0x25009a,null))['then'](function(_0x3c9cf4){if(_0x3c9cf4){return _0x3c9cf4['removeDispositions'](_0x17c1f2[_0x9fd3('0x49')][_0x9fd3('0x6e')]);}})[_0x9fd3('0x1f')](respondWithStatusCode(_0x25009a,null))[_0x9fd3('0x2a')](handleError(_0x25009a,null));};exports[_0x9fd3('0x6f')]=function(_0x5f18fc,_0x210caa,_0x3cbab9){if(_0x5f18fc[_0x9fd3('0x5d')]['id']){delete _0x5f18fc[_0x9fd3('0x5d')]['id'];}return db['SmsAccount'][_0x9fd3('0x5b')]({'where':{'id':_0x5f18fc['params']['id']}})[_0x9fd3('0x1f')](handleEntityNotFound(_0x210caa,null))[_0x9fd3('0x1f')](function(_0x22736b){if(_0x22736b){_0x5f18fc[_0x9fd3('0x5d')][_0x9fd3('0x6c')]=_0x22736b['id'];return db[_0x9fd3('0x70')][_0x9fd3('0x5c')](_0x5f18fc[_0x9fd3('0x5d')]);}})[_0x9fd3('0x1f')](respondWithResult(_0x210caa,null))['catch'](handleError(_0x210caa,null));};exports[_0x9fd3('0x71')]=function(_0x5165a7,_0x2cdb36,_0x476d22){var _0x1e2afb={'raw':![],'where':{}};var _0x13fed0={};var _0x2204f3={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x5165a7[_0x9fd3('0x5a')]['id']}})[_0x9fd3('0x1f')](handleEntityNotFound(_0x2cdb36,null))[_0x9fd3('0x1f')](function(_0x2f97e4){if(_0x2f97e4){_0x13fed0[_0x9fd3('0x45')]=_[_0x9fd3('0x46')](db[_0x9fd3('0x70')][_0x9fd3('0x42')]);_0x13fed0[_0x9fd3('0x49')]=_[_0x9fd3('0x46')](_0x5165a7[_0x9fd3('0x49')]);_0x13fed0[_0x9fd3('0x47')]=_['intersection'](_0x13fed0[_0x9fd3('0x45')],_0x13fed0['query']);_0x1e2afb[_0x9fd3('0x4b')]=_[_0x9fd3('0x48')](_0x13fed0['model'],qs[_0x9fd3('0x4a')](_0x5165a7[_0x9fd3('0x49')][_0x9fd3('0x4a')]));_0x1e2afb[_0x9fd3('0x4b')]=_0x1e2afb[_0x9fd3('0x4b')]['length']?_0x1e2afb[_0x9fd3('0x4b')]:_0x13fed0[_0x9fd3('0x45')];if(!_0x5165a7[_0x9fd3('0x49')]['hasOwnProperty'](_0x9fd3('0x4e'))){_0x1e2afb[_0x9fd3('0x30')]=qs[_0x9fd3('0x30')](_0x5165a7['query']['limit']);_0x1e2afb['offset']=qs['offset'](_0x5165a7[_0x9fd3('0x49')][_0x9fd3('0x2e')]);}_0x1e2afb[_0x9fd3('0x4f')]=qs['sort'](_0x5165a7[_0x9fd3('0x49')]['sort']);_0x1e2afb[_0x9fd3('0x53')]=qs[_0x9fd3('0x47')](_[_0x9fd3('0x50')](_0x5165a7[_0x9fd3('0x49')],_0x13fed0[_0x9fd3('0x47')]));_0x1e2afb[_0x9fd3('0x53')][_0x9fd3('0x6c')]=_0x2f97e4['id'];if(_0x5165a7[_0x9fd3('0x49')][_0x9fd3('0x51')]){_0x1e2afb[_0x9fd3('0x53')]=_[_0x9fd3('0x52')](_0x1e2afb['where'],{'$or':_[_0x9fd3('0x40')](_0x1e2afb[_0x9fd3('0x4b')],function(_0x561e1e){var _0x2f0027={};_0x2f0027[_0x561e1e]={'$like':'%'+_0x5165a7['query']['filter']+'%'};return _0x2f0027;})});}_0x1e2afb=_[_0x9fd3('0x52')]({},_0x1e2afb,_0x5165a7['options']);return db[_0x9fd3('0x70')][_0x9fd3('0x31')]({'where':_0x1e2afb[_0x9fd3('0x53')]})[_0x9fd3('0x1f')](function(_0x1010e8){_0x2204f3[_0x9fd3('0x31')]=_0x1010e8;if(_0x5165a7[_0x9fd3('0x49')][_0x9fd3('0x56')]){_0x1e2afb[_0x9fd3('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0x9fd3('0x58')](_0x1e2afb);})[_0x9fd3('0x1f')](function(_0x1d938b){_0x2204f3[_0x9fd3('0x59')]=_0x1d938b;return _0x2204f3;});}})['then'](respondWithFilteredResult(_0x2cdb36,_0x1e2afb))['catch'](handleError(_0x2cdb36,null));};exports['removeAnswers']=function(_0x17fa20,_0x5111d9,_0x5bba6c){return db[_0x9fd3('0x41')]['find']({'where':{'id':_0x17fa20[_0x9fd3('0x5a')]['id']}})[_0x9fd3('0x1f')](handleEntityNotFound(_0x5111d9,null))[_0x9fd3('0x1f')](function(_0x1957f2){if(_0x1957f2){return _0x1957f2['removeAnswers'](_0x17fa20[_0x9fd3('0x49')]['ids']);}})[_0x9fd3('0x1f')](respondWithStatusCode(_0x5111d9,null))['catch'](handleError(_0x5111d9,null));};exports[_0x9fd3('0x72')]=function(_0x5bf31e,_0x3ae71c,_0x101681){var _0x3a1ab4={'channel':_0x9fd3('0x73')};var _0xe0d144=[];var _0x18c39f=[];var _0x3c6d0c={};return db['SmsAccount']['find']({'where':{'id':_0x5bf31e[_0x9fd3('0x5a')]['id']},'include':[{'model':db[_0x9fd3('0x74')],'as':_0x9fd3('0x75')}]})[_0x9fd3('0x1f')](handleEntityNotFound(_0x3ae71c,null))[_0x9fd3('0x1f')](function(_0x151b2d){_0x3a1ab4[_0x9fd3('0x76')]=_0x151b2d;_0x3a1ab4['applications']=_['orderBy'](_0x151b2d[_0x9fd3('0x75')],[_0x9fd3('0x77')],[_0x9fd3('0x78')]);if(_0x3a1ab4[_0x9fd3('0x76')][_0x9fd3('0x75')]){delete _0x3a1ab4[_0x9fd3('0x76')][_0x9fd3('0x75')];}return db[_0x9fd3('0x79')][_0x9fd3('0x67')]();})['then'](function(_0x5017b8){if(!_0x5017b8){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0xe0d144=_['difference'](_['keys'](_0x5017b8),['createdAt',_0x9fd3('0x7a')]);_0x18c39f=_['difference'](_['keys'](_0x5017b8),['createdAt',_0x9fd3('0x7a'),_0x9fd3('0x7b'),_0x9fd3('0x7c')]);_0x3a1ab4[_0x9fd3('0x5d')]={'mapKey':_0x9fd3('0x7d')};if(_0x3a1ab4['account'][_0x9fd3('0x43')]){switch(_0x3a1ab4[_0x9fd3('0x76')][_0x9fd3('0x43')]){case _0x9fd3('0x7e'):_0x3a1ab4['body'][_0x9fd3('0x7f')]=_0x5bf31e[_0x9fd3('0x5d')]['From'];_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x5d')]=_0x5bf31e['body'][_0x9fd3('0x80')];_0x3a1ab4['body'][_0x9fd3('0x81')]=_0x5bf31e[_0x9fd3('0x5d')]['MessageSid'];break;case'skebby':_0x3a1ab4['body']['from']='+'+_0x5bf31e[_0x9fd3('0x5d')][_0x9fd3('0x82')];_0x3a1ab4['body'][_0x9fd3('0x5d')]=_0x5bf31e['body'][_0x9fd3('0x83')];break;case _0x9fd3('0x84'):_0x3a1ab4['body']['from']=_0x5bf31e[_0x9fd3('0x5d')]['from'];_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x5d')]=_0x5bf31e[_0x9fd3('0x5d')]['message'];break;case _0x9fd3('0x85'):_0x3a1ab4[_0x9fd3('0x5d')]['from']=_0x5bf31e[_0x9fd3('0x5d')][_0x9fd3('0x7f')];_0x3a1ab4['body'][_0x9fd3('0x5d')]=_0x5bf31e[_0x9fd3('0x5d')][_0x9fd3('0x5d')];_0x3a1ab4['body'][_0x9fd3('0x81')]=_0x5bf31e['body'][_0x9fd3('0x86')];break;case _0x9fd3('0x87'):_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x7f')]=_0x5bf31e['body'][_0x9fd3('0x88')];_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x5d')]=_0x5bf31e[_0x9fd3('0x5d')]['Text'];_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x81')]=_0x5bf31e[_0x9fd3('0x5d')][_0x9fd3('0x89')];break;case _0x9fd3('0x8a'):_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x7f')]='+'+_0x5bf31e[_0x9fd3('0x5d')][_0x9fd3('0x8b')][0x0]['from'];_0x3a1ab4[_0x9fd3('0x5d')]['body']=_0x5bf31e['body'][_0x9fd3('0x8b')][0x0][_0x9fd3('0x83')];_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x81')]=_0x5bf31e[_0x9fd3('0x5d')][_0x9fd3('0x8b')][0x0]['messageId'];break;case _0x9fd3('0x8c'):_0x3a1ab4['body'][_0x9fd3('0x7f')]=_0x5bf31e['body'][_0x9fd3('0x8d')];_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x5d')]=_0x5bf31e[_0x9fd3('0x5d')]['segmentedMessage'][_0x9fd3('0x27')];break;case _0x9fd3('0x8e'):_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x7f')]=_0x5bf31e[_0x9fd3('0x5d')][_0x9fd3('0x8f')];_0x3a1ab4[_0x9fd3('0x5d')]['body']=_0x5bf31e[_0x9fd3('0x5d')][_0x9fd3('0x83')];_0x3a1ab4['body'][_0x9fd3('0x81')]=_0x5bf31e[_0x9fd3('0x5d')]['replyMessageId'];break;case'bandwidth':_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x81')]=_0x5bf31e[_0x9fd3('0x5d')][0x0][_0x9fd3('0x27')]['id'];_0x3a1ab4[_0x9fd3('0x5d')]['from']=_0x5bf31e['body'][0x0][_0x9fd3('0x27')][_0x9fd3('0x7f')];_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x5d')]=_0x5bf31e['body'][0x0]['message']['text'];break;case'intelepeer':_0x3a1ab4['body'][_0x9fd3('0x7f')]=_0x5bf31e[_0x9fd3('0x5d')][_0x9fd3('0x7f')];_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x5d')]=_0x5bf31e[_0x9fd3('0x5d')][_0x9fd3('0x27')];_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x81')]=_0x5bf31e[_0x9fd3('0x5d')]['refid'];break;}}if(_0x3a1ab4[_0x9fd3('0x5d')]['id']){delete _0x3a1ab4[_0x9fd3('0x5d')]['id'];}if(_[_0x9fd3('0x90')](_0x3a1ab4[_0x9fd3('0x5d')]['from'])){throw new db[(_0x9fd3('0x91'))][(_0x9fd3('0x92'))](_0x9fd3('0x93'));}if(_['isNil'](_0x3a1ab4['body']['body'])||_0x3a1ab4['body'][_0x9fd3('0x5d')]===''){throw new db['Sequelize'][(_0x9fd3('0x92'))](_0x9fd3('0x94'));}if(_[_0x9fd3('0x90')](_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x95')])){throw new db[(_0x9fd3('0x91'))][(_0x9fd3('0x92'))](_0x9fd3('0x96')+_0x18c39f);}if(!_[_0x9fd3('0x97')](_0x18c39f,_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x95')])){throw new db['Sequelize'][(_0x9fd3('0x92'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x18c39f);}_0x3c6d0c[_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x95')]]=_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x7f')];return db[_0x9fd3('0x98')]['find']({'where':{'id':_0x3a1ab4[_0x9fd3('0x76')][_0x9fd3('0x7c')]},'include':[{'model':db[_0x9fd3('0x79')],'as':'Contacts','where':_0x3c6d0c,'limit':0x1,'order':[[_0x9fd3('0x7a'),_0x9fd3('0x99')]]}]});})[_0x9fd3('0x1f')](handleEntityNotFound(_0x3ae71c,null))['then'](function(_0x2b3790){if(_0x2b3790){_0x3a1ab4['list']=_[_0x9fd3('0x9a')](_0x2b3790,[_0x9fd3('0x9b')]);if(_0x2b3790[_0x9fd3('0x9b')][_0x9fd3('0x4c')]){return _0x2b3790[_0x9fd3('0x9b')][0x0];}var _0x4435e4=_[_0x9fd3('0x9c')](_0x3a1ab4['body'],{'firstName':_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x7f')],'ListId':_0x2b3790['id']});_0x4435e4[_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x95')]]=_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x7f')];return db[_0x9fd3('0x79')][_0x9fd3('0x5c')](_0x4435e4,{'fields':_0xe0d144,'raw':!![]});}})['then'](handleEntityNotFound(_0x3ae71c,null))[_0x9fd3('0x1f')](function(_0x5f0e31){if(_0x5f0e31){_0x3a1ab4[_0x9fd3('0x9d')]=_0x5f0e31;var _0x222f78={'ContactId':_0x5f0e31['id'],'phone':_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x7f')],'SmsAccountId':_0x5bf31e[_0x9fd3('0x5a')]['id']};var _0x4559c0={'ContactId':_0x5f0e31['id'],'SmsAccountId':_0x5bf31e[_0x9fd3('0x5a')]['id'],'closed':![]};return db[_0x9fd3('0x9e')][_0x9fd3('0x5b')]({'where':_0x4559c0})[_0x9fd3('0x1f')](function(_0x3e9303){if(_0x3e9303){return[_0x3e9303,![]];}return db[_0x9fd3('0x9e')][_0x9fd3('0x5c')](_0x222f78)[_0x9fd3('0x1f')](function(_0x19e550){return[_0x19e550,!![]];});});}})['spread'](function(_0x20e494,_0x3d2aa5){_0x3a1ab4[_0x9fd3('0x9f')]=_0x20e494[_0x9fd3('0x5e')]({'plain':!![]});_0x3a1ab4['interaction']['created']=![];if(_0x3d2aa5){if(_0x3a1ab4[_0x9fd3('0x76')][_0x9fd3('0xa0')]){_0x3a1ab4[_0x9fd3('0xa1')][_0x9fd3('0xa2')]({'id':0x0,'priority':_0x3a1ab4[_0x9fd3('0xa1')][_0x9fd3('0x4c')]+0x1,'app':_0x9fd3('0xa3'),'appdata':'unmanaged','interval':_0x9fd3('0xa4')});}_0x3a1ab4[_0x9fd3('0x9f')][_0x9fd3('0xa5')]=!![];}return db['SmsMessage'][_0x9fd3('0x5c')]({'phone':_0x3a1ab4[_0x9fd3('0x5d')]['from'],'messageId':_0x3a1ab4[_0x9fd3('0x5d')]['messageId'],'body':_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0x5d')],'SmsAccountId':_0x5bf31e[_0x9fd3('0x5a')]['id'],'SmsInteractionId':_0x20e494['id'],'direction':'in','ContactId':_0x20e494['ContactId'],'AttachmentId':_0x3a1ab4[_0x9fd3('0x5d')][_0x9fd3('0xa6')]});})[_0x9fd3('0x1f')](function(_0x4baf20){_0x3a1ab4['message']=_0x4baf20;if(!_0x3a1ab4[_0x9fd3('0x9f')][_0x9fd3('0xa7')])return;return db[_0x9fd3('0xa8')][_0x9fd3('0x5b')]({'attributes':['id',_0x9fd3('0x3b')],'where':{'id':_0x3a1ab4[_0x9fd3('0x9f')][_0x9fd3('0xa7')]}});})['then'](function(_0x52e0db){if(_0x52e0db){_0x3a1ab4['applications'][_0x9fd3('0xa9')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x52e0db[_0x9fd3('0x3b')]+','+(_0x3a1ab4[_0x9fd3('0x76')][_0x9fd3('0xaa')]||0xa),'interval':_0x9fd3('0xa4')});}if(!_0x3a1ab4[_0x9fd3('0x9f')][_0x9fd3('0xab')])return;return db[_0x9fd3('0xac')][_0x9fd3('0x5b')]({'attributes':['id','name'],'where':{'id':_0x3a1ab4['interaction'][_0x9fd3('0xab')]}});})[_0x9fd3('0x1f')](function(_0x7dff72){if(_0x7dff72){_0x3a1ab4['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0x9fd3('0xad'),'appdata':_0x7dff72['name']+','+(_0x3a1ab4[_0x9fd3('0x76')]['waitForTheAssignedQueue']||0x12c),'interval':_0x9fd3('0xa4')});}return respondWithRpcPromise(_0x9fd3('0xae'),_0x9fd3('0xaf'),_0x3a1ab4);})['then'](function(_0xcff043){if(_0xcff043){var _0x50d357=0xc8;var _0x41fd16=_0x9fd3('0xb0');logger[_0x9fd3('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x41fd16,_0x50d357,_0x9fd3('0xb1'));logger[_0x9fd3('0x22')](_0x9fd3('0xb2'),_0x41fd16,_0x50d357,_0x9fd3('0xb1'),JSON[_0x9fd3('0x24')](_0xcff043));if(_0x3a1ab4[_0x9fd3('0x76')]['type']===_0x9fd3('0x7e')){return _0x3ae71c['status'](_0x50d357)[_0x9fd3('0x33')](_0x9fd3('0xb3'),'text/xml')['send'](_0x9fd3('0xb4'));}else{return _0x3ae71c['status'](_0x50d357)[_0x9fd3('0x2d')](_0xcff043);}}})[_0x9fd3('0x2a')](handleError(_0x3ae71c,null));};exports[_0x9fd3('0xb5')]=function(_0x1c35bd,_0x25ed74){var _0x4ab13f=_0x1c35bd['params']['id'];var _0x3c954c=_0x1c35bd['body'];var _0x1bb174=0xc8;var _0x2406ef=null;return db[_0x9fd3('0xb6')][_0x9fd3('0xb7')]({'isolationLevel':db[_0x9fd3('0xb6')][_0x9fd3('0xb8')][_0x9fd3('0xb9')][_0x9fd3('0xba')]},function(_0x5846ef){return db['SmsAccount'][_0x9fd3('0x6a')]({'where':{'id':_0x4ab13f},'transaction':_0x5846ef})['then'](function(_0x115c3a){if(_0x115c3a){return db[_0x9fd3('0x74')][_0x9fd3('0x38')]({'where':{'SmsAccountId':_0x4ab13f},'transaction':_0x5846ef})[_0x9fd3('0x1f')](function(){var _0x29b02b=_[_0x9fd3('0x40')](_0x3c954c,function(_0x5c33e1){_0x5c33e1[_0x9fd3('0x6c')]=_0x4ab13f;return _0x5c33e1;});return db[_0x9fd3('0x74')]['bulkCreate'](_0x29b02b,{'transaction':_0x5846ef});});}else{_0x1bb174=0x194;_0x2406ef=[];}});})[_0x9fd3('0x1f')](function(){if(_0x1bb174!==0x194){return db[_0x9fd3('0x74')][_0x9fd3('0xbb')]({'where':{'SmsAccountId':_0x4ab13f},'order':'priority'})['then'](function(_0x426347){_0x2406ef=_0x426347;});}})[_0x9fd3('0x2a')](function(_0x5f3daf){_0x1bb174=0x1f4;logger[_0x9fd3('0x25')](_0x5f3daf[_0x9fd3('0x3a')]);if(_0x5f3daf[_0x9fd3('0x3b')]){delete _0x5f3daf[_0x9fd3('0x3b')];}_0x2406ef=_0x5f3daf;})[_0x9fd3('0xbc')](function(){if(_0x2406ef===null){_0x25ed74['sendStatus'](_0x1bb174);}else{if(_0x1bb174===0x1f4){_0x25ed74[_0x9fd3('0x32')](_0x1bb174)[_0x9fd3('0x3c')](_0x2406ef);}else{_0x25ed74['status'](_0x1bb174)[_0x9fd3('0x2d')](_0x2406ef);}}});};exports[_0x9fd3('0xbd')]=function(_0x5dcd3f,_0x521c8d,_0x3dde83){var _0x425cec={};var _0x3b6acb={};var _0x485ef9;var _0x1c4a03;return db['SmsAccount'][_0x9fd3('0x6a')]({'where':{'id':_0x5dcd3f[_0x9fd3('0x5a')]['id']}})[_0x9fd3('0x1f')](handleEntityNotFound(_0x521c8d,null))[_0x9fd3('0x1f')](function(_0x3e27ac){if(_0x3e27ac){_0x485ef9=_0x3e27ac;_0x3b6acb[_0x9fd3('0x45')]=_['keys'](db[_0x9fd3('0x74')]['rawAttributes']);_0x3b6acb['query']=_[_0x9fd3('0x46')](_0x5dcd3f[_0x9fd3('0x49')]);_0x3b6acb[_0x9fd3('0x47')]=_[_0x9fd3('0x48')](_0x3b6acb[_0x9fd3('0x45')],_0x3b6acb[_0x9fd3('0x49')]);_0x425cec[_0x9fd3('0x4b')]=_[_0x9fd3('0x48')](_0x3b6acb[_0x9fd3('0x45')],qs[_0x9fd3('0x4a')](_0x5dcd3f['query'][_0x9fd3('0x4a')]));_0x425cec[_0x9fd3('0x4b')]=_0x425cec[_0x9fd3('0x4b')][_0x9fd3('0x4c')]?_0x425cec[_0x9fd3('0x4b')]:_0x3b6acb[_0x9fd3('0x45')];_0x425cec[_0x9fd3('0x4f')]=qs[_0x9fd3('0x6b')](_0x5dcd3f['query'][_0x9fd3('0x6b')]);_0x425cec[_0x9fd3('0x53')]=qs['filters'](_[_0x9fd3('0x50')](_0x5dcd3f[_0x9fd3('0x49')],_0x3b6acb[_0x9fd3('0x47')]));if(_0x5dcd3f['query']['filter']){_0x425cec[_0x9fd3('0x53')]=_[_0x9fd3('0x52')](_0x425cec[_0x9fd3('0x53')],{'$or':_[_0x9fd3('0x40')](_0x425cec[_0x9fd3('0x4b')],function(_0x5636df){var _0x4dd329={};_0x4dd329[_0x5636df]={'$like':'%'+_0x5dcd3f[_0x9fd3('0x49')]['filter']+'%'};return _0x4dd329;})});}_0x425cec=_['merge']({},_0x425cec,_0x5dcd3f[_0x9fd3('0x55')]);return _0x485ef9[_0x9fd3('0xbd')](_0x425cec);}})['then'](function(_0x31a1d3){if(_0x31a1d3){_0x1c4a03=_0x31a1d3[_0x9fd3('0x4c')];if(!_0x5dcd3f[_0x9fd3('0x49')][_0x9fd3('0x4d')](_0x9fd3('0x4e'))){_0x425cec[_0x9fd3('0x30')]=qs[_0x9fd3('0x30')](_0x5dcd3f[_0x9fd3('0x49')][_0x9fd3('0x30')]);_0x425cec[_0x9fd3('0x2e')]=qs[_0x9fd3('0x2e')](_0x5dcd3f[_0x9fd3('0x49')]['offset']);}return _0x485ef9[_0x9fd3('0xbd')](_0x425cec);}})[_0x9fd3('0x1f')](function(_0xb60f00){if(_0xb60f00){return _0xb60f00?{'count':_0x1c4a03,'rows':_0xb60f00}:null;}})[_0x9fd3('0x1f')](respondWithResult(_0x521c8d,null))['catch'](handleError(_0x521c8d,null));};exports[_0x9fd3('0xbe')]=function(_0x39eea9,_0x805159,_0x447e3d){var _0x3aaf48={'raw':![],'where':{}};var _0x2931b7={};var _0x276994={'count':0x0,'rows':[]};return db['SmsAccount'][_0x9fd3('0x6a')]({'where':{'id':_0x39eea9[_0x9fd3('0x5a')]['id']}})['then'](handleEntityNotFound(_0x805159,null))['then'](function(_0x533ad7){if(_0x533ad7){_0x2931b7['model']=_[_0x9fd3('0x46')](db[_0x9fd3('0x9e')][_0x9fd3('0x42')]);_0x2931b7[_0x9fd3('0x49')]=_[_0x9fd3('0x46')](_0x39eea9[_0x9fd3('0x49')]);_0x2931b7[_0x9fd3('0x47')]=_['intersection'](_0x2931b7[_0x9fd3('0x45')],_0x2931b7[_0x9fd3('0x49')]);_0x3aaf48[_0x9fd3('0x4b')]=_[_0x9fd3('0x48')](_0x2931b7['model'],qs[_0x9fd3('0x4a')](_0x39eea9[_0x9fd3('0x49')][_0x9fd3('0x4a')]));_0x3aaf48['attributes']=_0x3aaf48[_0x9fd3('0x4b')][_0x9fd3('0x4c')]?_0x3aaf48[_0x9fd3('0x4b')]:_0x2931b7[_0x9fd3('0x45')];if(!_0x39eea9[_0x9fd3('0x49')][_0x9fd3('0x4d')](_0x9fd3('0x4e'))){_0x3aaf48[_0x9fd3('0x30')]=qs['limit'](_0x39eea9['query']['limit']);_0x3aaf48[_0x9fd3('0x2e')]=qs[_0x9fd3('0x2e')](_0x39eea9[_0x9fd3('0x49')]['offset']);}_0x3aaf48[_0x9fd3('0x4f')]=qs[_0x9fd3('0x6b')](_0x39eea9[_0x9fd3('0x49')][_0x9fd3('0x6b')]);_0x3aaf48['where']=qs['filters'](_[_0x9fd3('0x50')](_0x39eea9[_0x9fd3('0x49')],_0x2931b7[_0x9fd3('0x47')]));_0x3aaf48[_0x9fd3('0x53')][_0x9fd3('0x6c')]=_0x533ad7['id'];if(_0x39eea9[_0x9fd3('0x49')][_0x9fd3('0x51')]){_0x3aaf48[_0x9fd3('0x53')]=_['merge'](_0x3aaf48[_0x9fd3('0x53')],{'$or':_[_0x9fd3('0x40')](_0x3aaf48[_0x9fd3('0x4b')],function(_0x683bfb){var _0x1393f6={};_0x1393f6[_0x683bfb]={'$like':'%'+_0x39eea9[_0x9fd3('0x49')][_0x9fd3('0x51')]+'%'};return _0x1393f6;})});}_0x3aaf48=_[_0x9fd3('0x52')]({},_0x3aaf48,_0x39eea9[_0x9fd3('0x55')]);return db['SmsInteraction'][_0x9fd3('0x31')]({'where':_0x3aaf48[_0x9fd3('0x53')]})[_0x9fd3('0x1f')](function(_0x395706){_0x276994[_0x9fd3('0x31')]=_0x395706;if(_0x39eea9[_0x9fd3('0x49')][_0x9fd3('0x56')]){_0x3aaf48[_0x9fd3('0x57')]=[{'model':db[_0x9fd3('0x79')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x9fd3('0x3b'),'fullname',_0x9fd3('0xbf')],'required':![]},{'model':db[_0x9fd3('0xc0')],'as':_0x9fd3('0xc1'),'attributes':['id',_0x9fd3('0x3b'),_0x9fd3('0xc2')],'where':_0x39eea9[_0x9fd3('0x49')]['tag']?{'id':_0x39eea9['query'][_0x9fd3('0xc3')]}:undefined,'required':_0x39eea9[_0x9fd3('0x49')]['tag']?!![]:![]}];}return db[_0x9fd3('0x9e')][_0x9fd3('0x58')](_0x3aaf48);})[_0x9fd3('0x1f')](function(_0x13817a){_0x276994[_0x9fd3('0x59')]=_0x13817a;return _0x276994;});}})['then'](respondWithFilteredResult(_0x805159,_0x3aaf48))[_0x9fd3('0x2a')](handleError(_0x805159,null));};exports[_0x9fd3('0x3c')]=function(_0xf17caa,_0x553fc7,_0x11ced7){var _0x2de45d,_0x4a8dd1,_0x29dfd0;if(_[_0x9fd3('0x90')](_0xf17caa[_0x9fd3('0x5d')]['body'])||_0xf17caa['body'][_0x9fd3('0x5d')]===''){throw new db['Sequelize'][(_0x9fd3('0x92'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9fd3('0x90')](_0xf17caa[_0x9fd3('0x5d')]['to'])){throw new db['Sequelize'][(_0x9fd3('0x92'))](_0x9fd3('0xc4'));}_0x2de45d=_0xf17caa[_0x9fd3('0x5d')]['to'];return db[_0x9fd3('0x41')][_0x9fd3('0x5b')]({'where':{'id':_0xf17caa[_0x9fd3('0x5a')]['id']},'include':[{'model':db[_0x9fd3('0x98')],'as':_0x9fd3('0xc5'),'include':[{'model':db[_0x9fd3('0x79')],'as':_0x9fd3('0x9b'),'where':{'mobile':_0x2de45d},'limit':0x1,'order':[['updatedAt',_0x9fd3('0x99')]]}]}]})[_0x9fd3('0x1f')](handleEntityNotFound(_0x553fc7,null))['then'](function(_0x4060a6){if(_0x4060a6&&_0x4060a6['List']){_0x4a8dd1=_0x4060a6[_0x9fd3('0x5e')]({'plain':!![]});if(_0x4a8dd1[_0x9fd3('0xc5')]&&_0x4a8dd1[_0x9fd3('0xc5')][_0x9fd3('0x9b')][_0x9fd3('0x4c')]){return _0x4a8dd1['List']['Contacts'][0x0];}return db[_0x9fd3('0x79')][_0x9fd3('0x5c')](_[_0x9fd3('0x9c')](_0xf17caa[_0x9fd3('0x5d')],{'firstName':_0x2de45d,'mobile':_0x2de45d,'phone':_0x2de45d,'ListId':_0x4a8dd1[_0x9fd3('0x7c')]}));}})[_0x9fd3('0x1f')](handleEntityNotFound(_0x553fc7,null))[_0x9fd3('0x1f')](function(_0x2fa48f){if(_0x2fa48f){_0x29dfd0=_0x2fa48f;return db['SmsInteraction'][_0x9fd3('0x5b')]({'where':{'ContactId':_0x29dfd0['id'],'closed':![],'SmsAccountId':_0x4a8dd1['id']}})[_0x9fd3('0x1f')](function(_0x20c678){if(_0x20c678){return[_0x20c678,![]];}return db[_0x9fd3('0x9e')][_0x9fd3('0x5c')]({'UserId':_0xf17caa[_0x9fd3('0x61')]['id'],'ContactId':_0x29dfd0['id'],'SmsAccountId':_0x4a8dd1['id'],'phone':_0x2de45d,'firstMsgDirection':_0x9fd3('0xc6'),'Messages':[_[_0x9fd3('0x52')](_0xf17caa[_0x9fd3('0x5d')],{'read':![],'body':_0xf17caa['body'][_0x9fd3('0x5d')],'phone':_0x2de45d,'SmsAccountId':_0x4a8dd1['id'],'UserId':_0xf17caa[_0x9fd3('0x61')]['id'],'ContactId':_0x29dfd0['id']})]},{'include':[{'model':db[_0x9fd3('0xc7')],'as':_0x9fd3('0xc8')}]})[_0x9fd3('0x1f')](function(_0x294166){return[_0x294166,!![]];});});}})[_0x9fd3('0xc9')](function(_0x3fe93d,_0x1c8862){if(_0x1c8862){return _0x3fe93d;}return db[_0x9fd3('0xc7')][_0x9fd3('0x5c')](_[_0x9fd3('0x52')](_0xf17caa[_0x9fd3('0x5d')],{'read':![],'body':_0xf17caa['body']['body'],'phone':_0x2de45d,'SmsAccountId':_0x4a8dd1['id'],'SmsInteractionId':_0x3fe93d['id'],'UserId':_0xf17caa[_0x9fd3('0x61')]['id'],'ContactId':_0x29dfd0['id']}))['then'](function(_0x19ac86){_0x3fe93d[_0x9fd3('0xca')]['Messages']=[];_0x3fe93d[_0x9fd3('0xca')][_0x9fd3('0xc8')][_0x9fd3('0xa2')](_0x19ac86[_0x9fd3('0xca')]);return _0x3fe93d;});})[_0x9fd3('0x1f')](respondWithResult(_0x553fc7,null))[_0x9fd3('0x2a')](handleError(_0x553fc7,null));};exports[_0x9fd3('0x32')]=function(_0x5913c4,_0x120adc,_0x2f15ae){if(_0x5913c4[_0x9fd3('0x5d')]['id']){delete _0x5913c4[_0x9fd3('0x5d')]['id'];}var _0x50c300,_0x56c5b8,_0x2017c5;return db[_0x9fd3('0x41')][_0x9fd3('0x5b')]({'where':{'id':_0x5913c4[_0x9fd3('0x5a')]['id']}})[_0x9fd3('0x1f')](handleEntityNotFound(_0x120adc,null))['then'](function(_0x4b7089){if(_0x4b7089){_0x2017c5=_0x4b7089;logger[_0x9fd3('0x22')](_0x9fd3('0x23'),_0x9fd3('0x32'),_0x9fd3('0xcb'),_0x4b7089[_0x9fd3('0x43')],util[_0x9fd3('0xcc')](_0x5913c4[_0x9fd3('0x5d')],{'showHidden':![],'depth':null}));switch(_0x4b7089[_0x9fd3('0x43')]){case'skebby':if(_0x5913c4['body'][_0x9fd3('0xcd')]&&_0x5913c4['body']['status']){_0x56c5b8=_0x5913c4['body']['status'];return db[_0x9fd3('0xc7')][_0x9fd3('0x5b')]({'where':{'messageId':_0x5913c4[_0x9fd3('0x5d')][_0x9fd3('0xcd')]}});}break;case'connectel':if(_0x5913c4[_0x9fd3('0x5d')]['requestid']&&_0x5913c4[_0x9fd3('0x5d')][_0x9fd3('0xce')]){_0x56c5b8=_0x5913c4[_0x9fd3('0x5d')][_0x9fd3('0xce')];return db[_0x9fd3('0xc7')][_0x9fd3('0x5b')]({'where':{'messageId':_0x5913c4[_0x9fd3('0x5d')][_0x9fd3('0xcf')]}});}break;case'clicksend':if(_0x5913c4[_0x9fd3('0x5d')][_0x9fd3('0x86')]&&_0x5913c4['body']['status_code']){_0x56c5b8=_0x5913c4[_0x9fd3('0x5d')]['status_code'];return db['SmsMessage'][_0x9fd3('0x5b')]({'where':{'messageId':_0x5913c4[_0x9fd3('0x5d')][_0x9fd3('0x86')]}});}break;case _0x9fd3('0x8a'):var _0x24e946=_0x5913c4['body'][_0x9fd3('0x8b')][0x0];if(_0x24e946[_0x9fd3('0x81')]&&_0x24e946['status'][_0x9fd3('0xd0')]===_0x9fd3('0xd1')){_0x56c5b8=_0x24e946[_0x9fd3('0x32')][_0x9fd3('0xd0')];return db[_0x9fd3('0xc7')][_0x9fd3('0x5b')]({'where':{'messageId':_0x24e946['messageId']}});}break;case _0x9fd3('0x8e'):if(_0x5913c4[_0x9fd3('0x5d')][_0x9fd3('0x81')]&&_0x5913c4[_0x9fd3('0x5d')][_0x9fd3('0x32')]){_0x56c5b8=_0x5913c4[_0x9fd3('0x5d')][_0x9fd3('0x32')];return db[_0x9fd3('0xc7')][_0x9fd3('0x5b')]({'where':{'messageId':_0x5913c4[_0x9fd3('0x5d')]['messageId']}});}break;case _0x9fd3('0xd2'):if(_0x5913c4[_0x9fd3('0x5d')][0x0][_0x9fd3('0x27')]['id']){_0x56c5b8=_0x5913c4['body'][0x0][_0x9fd3('0x43')];return db['SmsMessage'][_0x9fd3('0x5b')]({'where':{'messageId':_0x5913c4[_0x9fd3('0x5d')][0x0][_0x9fd3('0x27')]['id']}});}break;case _0x9fd3('0xd3'):if(_0x5913c4['body'][_0x9fd3('0xd4')]&&_0x5913c4[_0x9fd3('0x5d')][_0x9fd3('0x32')]){_0x56c5b8=_0x5913c4[_0x9fd3('0x5d')]['status'];return db[_0x9fd3('0xc7')][_0x9fd3('0x5b')]({'where':{'messageId':_0x5913c4[_0x9fd3('0x5d')][_0x9fd3('0xd4')]}});}break;}}})[_0x9fd3('0x1f')](handleEntityNotFound(_0x120adc,null))[_0x9fd3('0x1f')](function(_0x5537d1){if(_0x5537d1){_0x50c300=_0x5537d1;switch(_0x2017c5[_0x9fd3('0x43')]){case _0x9fd3('0xd5'):if(_0x56c5b8==='DELIVERED'){return _0x50c300[_0x9fd3('0x37')]({'read':!![]});}else{logger[_0x9fd3('0x25')](_0x9fd3('0x23'),_0x9fd3('0x32'),_0x9fd3('0xd5'),util[_0x9fd3('0xcc')](_0x5913c4[_0x9fd3('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x9fd3('0x84'):if(_0x56c5b8==='1'){return _0x50c300[_0x9fd3('0x37')]({'read':!![]});}else{logger[_0x9fd3('0x25')](_0x9fd3('0x23'),_0x9fd3('0x32'),_0x9fd3('0xd5'),util[_0x9fd3('0xcc')](_0x5913c4[_0x9fd3('0x5d')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x5913c4[_0x9fd3('0x5d')][_0x9fd3('0xd6')]&&_0x56c5b8>=0xc8&&_0x56c5b8<=0xce){return _0x50c300[_0x9fd3('0x37')]({'read':!![]});}else{logger[_0x9fd3('0x25')](_0x9fd3('0x23'),'status',_0x9fd3('0x85'),util[_0x9fd3('0xcc')](_0x5913c4['body'],{'showHidden':![],'depth':null}));}break;case _0x9fd3('0x8a'):var _0x5e8b95=_0x5913c4['body'][_0x9fd3('0x8b')][0x0];if(_0x5e8b95[_0x9fd3('0x32')][_0x9fd3('0xd0')]===_0x9fd3('0xd1')){return _0x50c300[_0x9fd3('0x37')]({'read':!![]});}else{logger['error'](_0x9fd3('0x23'),'status',_0x9fd3('0x8a'),util['inspect'](_0x5913c4['body'],{'showHidden':![],'depth':null}));}break;case _0x9fd3('0x8e'):if(_0x56c5b8==_0x9fd3('0xd7')||_0x56c5b8==_0x9fd3('0xd8')){return _0x50c300['update']({'read':!![]});}else{logger[_0x9fd3('0x25')](_0x9fd3('0x23'),'status','clickatell',util['inspect'](_0x5913c4[_0x9fd3('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x9fd3('0xd2'):if(_0x56c5b8==_0x9fd3('0xd9')){return _0x50c300[_0x9fd3('0x37')]({'read':!![]});}else{logger[_0x9fd3('0x25')](_0x9fd3('0x23'),_0x9fd3('0x32'),_0x9fd3('0xd2'),util[_0x9fd3('0xcc')](_0x5913c4[_0x9fd3('0x5d')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x56c5b8===_0x9fd3('0xda')||_0x56c5b8===_0x9fd3('0xdb')){return _0x50c300['update']({'read':!![]});}else{logger[_0x9fd3('0x25')](_0x9fd3('0x23'),_0x9fd3('0x32'),_0x9fd3('0xd3'),util[_0x9fd3('0xcc')](_0x5913c4[_0x9fd3('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x50c300;}})[_0x9fd3('0x1f')](respondWithResult(_0x120adc,null))[_0x9fd3('0x2a')](handleError(_0x120adc,null));};exports[_0x9fd3('0xdc')]=function(_0x5a553f,_0x2e2e1a,_0x41cf1a){var _0x375378,_0x18353d,_0x208675;return db[_0x9fd3('0x41')]['find']({'where':{'id':_0x5a553f[_0x9fd3('0x5a')]['id']}})[_0x9fd3('0x1f')](handleEntityNotFound(_0x2e2e1a,null))[_0x9fd3('0x1f')](function(_0xee59de){if(_0xee59de){_0x208675=_0xee59de;logger[_0x9fd3('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9fd3('0x32'),_0x9fd3('0xcb'),_0xee59de[_0x9fd3('0x43')],util[_0x9fd3('0xcc')](_0x5a553f[_0x9fd3('0x49')],{'showHidden':![],'depth':null}));switch(_0xee59de[_0x9fd3('0x43')]){case'csc':if(_0x5a553f[_0x9fd3('0x49')]['message-id']&&_0x5a553f[_0x9fd3('0x49')]['state']){_0x18353d=_0x5a553f[_0x9fd3('0x49')][_0x9fd3('0xdd')];return db[_0x9fd3('0xc7')][_0x9fd3('0x5b')]({'where':{'messageId':_0x5a553f[_0x9fd3('0x49')][_0x9fd3('0xde')]}});}break;}}})[_0x9fd3('0x1f')](handleEntityNotFound(_0x2e2e1a,null))['then'](function(_0x2bcd57){if(_0x2bcd57){_0x375378=_0x2bcd57;switch(_0x208675[_0x9fd3('0x43')]){case _0x9fd3('0x8c'):if(_0x18353d==='2'||_0x18353d==='6'){return _0x375378[_0x9fd3('0x37')]({'read':!![]});}else{logger[_0x9fd3('0x25')](_0x9fd3('0x23'),_0x9fd3('0x32'),'csc',util[_0x9fd3('0xcc')](_0x5a553f[_0x9fd3('0x49')],{'showHidden':![],'depth':null}));};break;}return _0x375378;}})['then'](respondWithResult(_0x2e2e1a,null))['catch'](handleError(_0x2e2e1a,null));};exports[_0x9fd3('0xdf')]=function(_0x40767f,_0x5f20f7,_0x1117cd){return db[_0x9fd3('0x41')]['find']({'where':{'id':_0x40767f[_0x9fd3('0x5a')]['id']}})[_0x9fd3('0x1f')](handleEntityNotFound(_0x5f20f7,null))[_0x9fd3('0x1f')](function(_0xa6e87){if(_0xa6e87){return _0xa6e87[_0x9fd3('0xdf')](_0x40767f['body'][_0x9fd3('0x6e')],_['omit'](_0x40767f[_0x9fd3('0x5d')],[_0x9fd3('0x6e'),'id'])||{})[_0x9fd3('0xc9')](function(_0xcd9d61){for(var _0x4a8a58=0x0;_0x4a8a58<_0x40767f[_0x9fd3('0x5d')][_0x9fd3('0x6e')][_0x9fd3('0x4c')];_0x4a8a58+=0x1){socket[_0x9fd3('0xe0')](_0x9fd3('0xe1'),{'UserId':Number(_0x40767f[_0x9fd3('0x5d')]['ids'][_0x4a8a58]),'SmsAccountId':Number(_0x40767f[_0x9fd3('0x5a')]['id'])});}return _0xcd9d61;});}})[_0x9fd3('0x1f')](respondWithResult(_0x5f20f7,null))['catch'](handleError(_0x5f20f7,null));};exports[_0x9fd3('0xe2')]=function(_0x556cd5,_0x187f4c,_0x43ea51){return db['SmsAccount'][_0x9fd3('0x5b')]({'where':{'id':_0x556cd5[_0x9fd3('0x5a')]['id']}})[_0x9fd3('0x1f')](handleEntityNotFound(_0x187f4c,null))['then'](function(_0x392f2b){if(_0x392f2b){return _0x392f2b[_0x9fd3('0xe2')](_0x556cd5[_0x9fd3('0x49')][_0x9fd3('0x6e')])[_0x9fd3('0x1f')](function(){if(_[_0x9fd3('0xe3')](_0x556cd5[_0x9fd3('0x49')][_0x9fd3('0x6e')])){for(var _0x4583b9=0x0;_0x4583b9<_0x556cd5[_0x9fd3('0x49')]['ids'][_0x9fd3('0x4c')];_0x4583b9+=0x1){socket['emit'](_0x9fd3('0xe4'),{'UserId':Number(_0x556cd5[_0x9fd3('0x49')]['ids'][_0x4583b9]),'SmsAccountId':Number(_0x556cd5['params']['id'])});}}else{socket[_0x9fd3('0xe0')](_0x9fd3('0xe4'),{'UserId':Number(_0x556cd5[_0x9fd3('0x49')][_0x9fd3('0x6e')]),'SmsAccountId':Number(_0x556cd5[_0x9fd3('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x187f4c,null))['catch'](handleError(_0x187f4c,null));};exports[_0x9fd3('0xe5')]=function(_0x224430,_0x5e352a,_0x4f0b9b){var _0x16424f={};var _0x436dc5={};var _0x5905b4;var _0x585ff0;return db[_0x9fd3('0x41')][_0x9fd3('0x6a')]({'where':{'id':_0x224430[_0x9fd3('0x5a')]['id']}})[_0x9fd3('0x1f')](handleEntityNotFound(_0x5e352a,null))[_0x9fd3('0x1f')](function(_0x5c7ec9){if(_0x5c7ec9){_0x5905b4=_0x5c7ec9;_0x436dc5[_0x9fd3('0x45')]=_[_0x9fd3('0x46')](db[_0x9fd3('0xa8')]['rawAttributes']);_0x436dc5[_0x9fd3('0x49')]=_[_0x9fd3('0x46')](_0x224430[_0x9fd3('0x49')]);_0x436dc5[_0x9fd3('0x47')]=_[_0x9fd3('0x48')](_0x436dc5['model'],_0x436dc5[_0x9fd3('0x49')]);_0x16424f[_0x9fd3('0x4b')]=_[_0x9fd3('0x48')](_0x436dc5[_0x9fd3('0x45')],qs[_0x9fd3('0x4a')](_0x224430[_0x9fd3('0x49')]['fields']));_0x16424f[_0x9fd3('0x4b')]=_0x16424f[_0x9fd3('0x4b')]['length']?_0x16424f[_0x9fd3('0x4b')]:_0x436dc5[_0x9fd3('0x45')];_0x16424f[_0x9fd3('0x4f')]=qs[_0x9fd3('0x6b')](_0x224430[_0x9fd3('0x49')][_0x9fd3('0x6b')]);_0x16424f['where']=qs[_0x9fd3('0x47')](_['pick'](_0x224430['query'],_0x436dc5['filters']));if(_0x224430[_0x9fd3('0x49')][_0x9fd3('0x51')]){_0x16424f[_0x9fd3('0x53')]=_[_0x9fd3('0x52')](_0x16424f[_0x9fd3('0x53')],{'$or':_['map'](_0x16424f['attributes'],function(_0x4badfe){var _0xe40f82={};_0xe40f82[_0x4badfe]={'$like':'%'+_0x224430[_0x9fd3('0x49')][_0x9fd3('0x51')]+'%'};return _0xe40f82;})});}_0x16424f=_['merge']({},_0x16424f,_0x224430[_0x9fd3('0x55')]);return _0x5905b4[_0x9fd3('0xe5')](_0x16424f);}})[_0x9fd3('0x1f')](function(_0x3d311f){if(_0x3d311f){_0x585ff0=_0x3d311f[_0x9fd3('0x4c')];if(!_0x224430[_0x9fd3('0x49')][_0x9fd3('0x4d')]('nolimit')){_0x16424f['limit']=qs[_0x9fd3('0x30')](_0x224430['query']['limit']);_0x16424f[_0x9fd3('0x2e')]=qs[_0x9fd3('0x2e')](_0x224430[_0x9fd3('0x49')][_0x9fd3('0x2e')]);}return _0x5905b4[_0x9fd3('0xe5')](_0x16424f);}})[_0x9fd3('0x1f')](function(_0x3273ee){if(_0x3273ee){return _0x3273ee?{'count':_0x585ff0,'rows':_0x3273ee}:null;}})[_0x9fd3('0x1f')](respondWithResult(_0x5e352a,null))[_0x9fd3('0x2a')](handleError(_0x5e352a,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 6595930..b776c7c 100644 --- a/server/api/smsAccount/smsAccount.events.js +++ b/server/api/smsAccount/smsAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc019=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x41e5f5,_0xd56249){var _0x58560a=function(_0x2db89c){while(--_0x2db89c){_0x41e5f5['push'](_0x41e5f5['shift']());}};_0x58560a(++_0xd56249);}(_0xc019,0x1b6));var _0x9c01=function(_0x2d5392,_0xc4f707){_0x2d5392=_0x2d5392-0x0;var _0x4bd3fb=_0xc019[_0x2d5392];return _0x4bd3fb;};'use strict';var EventEmitter=require(_0x9c01('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x9c01('0x1')](0x0);var events={'afterCreate':_0x9c01('0x2'),'afterUpdate':_0x9c01('0x3'),'afterDestroy':_0x9c01('0x4')};function emitEvent(_0x53cf8d){return function(_0x262f03,_0x16720c,_0x46708f){SmsAccountEvents[_0x9c01('0x5')](_0x53cf8d+':'+_0x262f03['id'],_0x262f03);SmsAccountEvents[_0x9c01('0x5')](_0x53cf8d,_0x262f03);_0x46708f(null);};}for(var e in events){if(events[_0x9c01('0x6')](e)){var event=events[e];SmsAccount[_0x9c01('0x7')](e,emitEvent(event));}}module[_0x9c01('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x56de=['events','SmsAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x56de,0x1b8));var _0xe56d=function(_0x95413e,_0x2dc48f){_0x95413e=_0x95413e-0x0;var _0x4976c1=_0x56de[_0x95413e];return _0x4976c1;};'use strict';var EventEmitter=require(_0xe56d('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xe56d('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe56d('0x2')](0x0);var events={'afterCreate':_0xe56d('0x3'),'afterUpdate':'update','afterDestroy':_0xe56d('0x4')};function emitEvent(_0x3de2ed){return function(_0x23f205,_0x3a7d44,_0x5865bf){SmsAccountEvents[_0xe56d('0x5')](_0x3de2ed+':'+_0x23f205['id'],_0x23f205);SmsAccountEvents[_0xe56d('0x5')](_0x3de2ed,_0x23f205);_0x5865bf(null);};}for(var e in events){if(events[_0xe56d('0x6')](e)){var event=events[e];SmsAccount[_0xe56d('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 6ed122c..60074fc 100644 --- a/server/api/smsAccount/smsAccount.model.js +++ b/server/api/smsAccount/smsAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5600=['SmsAccount','sms_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x398e75,_0x515ea9){var _0x277712=function(_0x4e3ab1){while(--_0x4e3ab1){_0x398e75['push'](_0x398e75['shift']());}};_0x277712(++_0x515ea9);}(_0x5600,0xe6));var _0x0560=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0x5600[_0x4bacb6];return _0x58c029;};'use strict';var _=require(_0x0560('0x0'));var util=require(_0x0560('0x1'));var logger=require(_0x0560('0x2'))('api');var moment=require(_0x0560('0x3'));var BPromise=require(_0x0560('0x4'));var rp=require(_0x0560('0x5'));var fs=require('fs');var path=require(_0x0560('0x6'));var rimraf=require(_0x0560('0x7'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x0560('0x8')]=function(_0x2d40b8,_0x2f80e3){return _0x2d40b8[_0x0560('0x9')](_0x0560('0xa'),attributes,{'tableName':_0x0560('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ca1=['../../config/logger','moment','bluebird','rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount','lodash','util'];(function(_0x40a775,_0x2f986b){var _0x5950c5=function(_0xeb32a3){while(--_0xeb32a3){_0x40a775['push'](_0x40a775['shift']());}};_0x5950c5(++_0x2f986b);}(_0x7ca1,0xda));var _0x17ca=function(_0x5a5a93,_0x35f60a){_0x5a5a93=_0x5a5a93-0x0;var _0x4393be=_0x7ca1[_0x5a5a93];return _0x4393be;};'use strict';var _=require(_0x17ca('0x0'));var util=require(_0x17ca('0x1'));var logger=require(_0x17ca('0x2'))('api');var moment=require(_0x17ca('0x3'));var BPromise=require(_0x17ca('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x17ca('0x5'));var config=require(_0x17ca('0x6'));var attributes=require(_0x17ca('0x7'));module[_0x17ca('0x8')]=function(_0x22d11f,_0x60a2ed){return _0x22d11f['define'](_0x17ca('0x9'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index f4764c7..cf157ed 100644 --- a/server/api/smsAccount/smsAccount.rpc.js +++ b/server/api/smsAccount/smsAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19d8=['redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','catch','ShowSmsAccount','SmsAccount','find','options','raw','include','map','attributes','model','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x5c78d9,_0x2736c7){var _0x69ae1f=function(_0x4b31ac){while(--_0x4b31ac){_0x5c78d9['push'](_0x5c78d9['shift']());}};_0x69ae1f(++_0x2736c7);}(_0x19d8,0x182));var _0x819d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x19d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x819d('0x0'));var moment=require(_0x819d('0x1'));var BPromise=require('bluebird');var rs=require(_0x819d('0x2'));var fs=require('fs');var Redis=require(_0x819d('0x3'));var db=require(_0x819d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x819d('0x5'))('rpc');var config=require(_0x819d('0x6'));var jayson=require(_0x819d('0x7'));var client=jayson[_0x819d('0x8')][_0x819d('0x9')]({'port':0x232a});config[_0x819d('0xa')]=_[_0x819d('0xb')](config['redis'],{'host':_0x819d('0xc'),'port':0x18eb});var socket=require(_0x819d('0xd'))(new Redis(config['redis']));require(_0x819d('0xe'))[_0x819d('0xf')](socket);function respondWithRpcPromise(_0x30f559,_0x64f07,_0x3c2c4c){return new BPromise(function(_0x11ad9e,_0x2f5224){return client['request'](_0x30f559,_0x3c2c4c)[_0x819d('0x10')](function(_0xd579b7){logger[_0x819d('0x11')]('SmsAccount,\x20%s,\x20%s',_0x64f07,_0x819d('0x12'));logger[_0x819d('0x13')](_0x819d('0x14'),_0x64f07,'request\x20sent',JSON[_0x819d('0x15')](_0xd579b7));if(_0xd579b7['error']){if(_0xd579b7[_0x819d('0x16')][_0x819d('0x17')]===0x1f4){logger[_0x819d('0x16')](_0x819d('0x18'),_0x64f07,_0xd579b7[_0x819d('0x16')][_0x819d('0x19')]);return _0x2f5224(_0xd579b7[_0x819d('0x16')][_0x819d('0x19')]);}logger['error'](_0x819d('0x18'),_0x64f07,_0xd579b7[_0x819d('0x16')]['message']);return _0x11ad9e(_0xd579b7[_0x819d('0x16')][_0x819d('0x19')]);}else{logger[_0x819d('0x11')](_0x819d('0x18'),_0x64f07,_0x819d('0x12'));_0x11ad9e(_0xd579b7['result']['message']);}})[_0x819d('0x1a')](function(_0x41bbc9){logger[_0x819d('0x16')]('SmsAccount,\x20%s,\x20%s',_0x64f07,_0x41bbc9);_0x2f5224(_0x41bbc9);});});}exports[_0x819d('0x1b')]=function(_0x175dbf){var _0x2faa07=this;return new Promise(function(_0x1dec0b,_0x7b7394){return db[_0x819d('0x1c')][_0x819d('0x1d')]({'raw':_0x175dbf[_0x819d('0x1e')]?_0x175dbf[_0x819d('0x1e')][_0x819d('0x1f')]===undefined?!![]:![]:!![],'where':_0x175dbf[_0x819d('0x1e')]?_0x175dbf['options']['where']||null:null,'attributes':_0x175dbf['options']?_0x175dbf['options']['attributes']||null:null,'include':_0x175dbf[_0x819d('0x1e')]?_0x175dbf[_0x819d('0x1e')][_0x819d('0x20')]?_[_0x819d('0x21')](_0x175dbf[_0x819d('0x1e')][_0x819d('0x20')],function(_0x1c19ec){return{'model':db[_0x1c19ec['model']],'as':_0x1c19ec['as'],'attributes':_0x1c19ec[_0x819d('0x22')],'include':_0x1c19ec[_0x819d('0x20')]?_[_0x819d('0x21')](_0x1c19ec[_0x819d('0x20')],function(_0x475816){return{'model':db[_0x475816[_0x819d('0x23')]],'as':_0x475816['as'],'attributes':_0x475816[_0x819d('0x22')],'include':_0x475816[_0x819d('0x20')]?_[_0x819d('0x21')](_0x475816[_0x819d('0x20')],function(_0x17bf6c){return{'model':db[_0x17bf6c[_0x819d('0x23')]],'as':_0x17bf6c['as'],'attributes':_0x17bf6c[_0x819d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x819d('0x10')](function(_0xa34d8){logger['info']('ShowSmsAccount',_0x175dbf);logger[_0x819d('0x13')](_0x819d('0x1b'),_0x175dbf,JSON[_0x819d('0x15')](_0xa34d8));_0x1dec0b(_0xa34d8);})[_0x819d('0x1a')](function(_0x10a4da){logger['error'](_0x819d('0x1b'),_0x10a4da[_0x819d('0x19')],_0x175dbf);_0x7b7394(_0x2faa07[_0x819d('0x16')](0x1f4,_0x10a4da['message']));});});}; \ No newline at end of file +var _0xd070=['./smsAccount.socket','register','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','SmsAccount,\x20%s,\x20%s','result','catch','ShowSmsAccount','find','options','raw','where','attributes','map','model','include','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost'];(function(_0xcd1036,_0x300dde){var _0x4d4ad8=function(_0x254f7d){while(--_0x254f7d){_0xcd1036['push'](_0xcd1036['shift']());}};_0x4d4ad8(++_0x300dde);}(_0xd070,0xab));var _0x0d07=function(_0x5a8e7c,_0x57f990){_0x5a8e7c=_0x5a8e7c-0x0;var _0x4474ac=_0xd070[_0x5a8e7c];return _0x4474ac;};'use strict';var _=require(_0x0d07('0x0'));var util=require(_0x0d07('0x1'));var moment=require(_0x0d07('0x2'));var BPromise=require(_0x0d07('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d07('0x4'));var db=require(_0x0d07('0x5'))['db'];var utils=require(_0x0d07('0x6'));var logger=require('../../config/logger')(_0x0d07('0x7'));var config=require(_0x0d07('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0d07('0x9')][_0x0d07('0xa')]({'port':0x232a});config['redis']=_[_0x0d07('0xb')](config[_0x0d07('0xc')],{'host':_0x0d07('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0d07('0xe'))[_0x0d07('0xf')](socket);function respondWithRpcPromise(_0x19415e,_0x3b001,_0x529a92){return new BPromise(function(_0x3b4d70,_0x184cba){return client[_0x0d07('0x10')](_0x19415e,_0x529a92)[_0x0d07('0x11')](function(_0x62d914){logger[_0x0d07('0x12')]('SmsAccount,\x20%s,\x20%s',_0x3b001,_0x0d07('0x13'));logger[_0x0d07('0x14')](_0x0d07('0x15'),_0x3b001,'request\x20sent',JSON['stringify'](_0x62d914));if(_0x62d914[_0x0d07('0x16')]){if(_0x62d914[_0x0d07('0x16')][_0x0d07('0x17')]===0x1f4){logger[_0x0d07('0x16')]('SmsAccount,\x20%s,\x20%s',_0x3b001,_0x62d914[_0x0d07('0x16')]['message']);return _0x184cba(_0x62d914['error'][_0x0d07('0x18')]);}logger[_0x0d07('0x16')](_0x0d07('0x19'),_0x3b001,_0x62d914[_0x0d07('0x16')][_0x0d07('0x18')]);return _0x3b4d70(_0x62d914[_0x0d07('0x16')]['message']);}else{logger[_0x0d07('0x12')]('SmsAccount,\x20%s,\x20%s',_0x3b001,'request\x20sent');_0x3b4d70(_0x62d914[_0x0d07('0x1a')][_0x0d07('0x18')]);}})[_0x0d07('0x1b')](function(_0xa7748d){logger[_0x0d07('0x16')](_0x0d07('0x19'),_0x3b001,_0xa7748d);_0x184cba(_0xa7748d);});});}exports[_0x0d07('0x1c')]=function(_0x453ac1){var _0x3344c4=this;return new Promise(function(_0xc0f8ca,_0x4b6af6){return db['SmsAccount'][_0x0d07('0x1d')]({'raw':_0x453ac1[_0x0d07('0x1e')]?_0x453ac1[_0x0d07('0x1e')][_0x0d07('0x1f')]===undefined?!![]:![]:!![],'where':_0x453ac1[_0x0d07('0x1e')]?_0x453ac1['options'][_0x0d07('0x20')]||null:null,'attributes':_0x453ac1[_0x0d07('0x1e')]?_0x453ac1[_0x0d07('0x1e')][_0x0d07('0x21')]||null:null,'include':_0x453ac1[_0x0d07('0x1e')]?_0x453ac1['options']['include']?_[_0x0d07('0x22')](_0x453ac1['options']['include'],function(_0x2052aa){return{'model':db[_0x2052aa[_0x0d07('0x23')]],'as':_0x2052aa['as'],'attributes':_0x2052aa['attributes'],'include':_0x2052aa[_0x0d07('0x24')]?_['map'](_0x2052aa[_0x0d07('0x24')],function(_0x37e1aa){return{'model':db[_0x37e1aa['model']],'as':_0x37e1aa['as'],'attributes':_0x37e1aa['attributes'],'include':_0x37e1aa[_0x0d07('0x24')]?_[_0x0d07('0x22')](_0x37e1aa[_0x0d07('0x24')],function(_0x1c033f){return{'model':db[_0x1c033f[_0x0d07('0x23')]],'as':_0x1c033f['as'],'attributes':_0x1c033f[_0x0d07('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a1b81){logger[_0x0d07('0x12')](_0x0d07('0x1c'),_0x453ac1);logger['debug'](_0x0d07('0x1c'),_0x453ac1,JSON['stringify'](_0x4a1b81));_0xc0f8ca(_0x4a1b81);})[_0x0d07('0x1b')](function(_0x13b589){logger['error'](_0x0d07('0x1c'),_0x13b589[_0x0d07('0x18')],_0x453ac1);_0x4b6af6(_0x3344c4[_0x0d07('0x16')](0x1f4,_0x13b589[_0x0d07('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index e35c6db..7a38af4 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index f9dc8ac..843218e 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['/:id','create','put','exports','multer','util','express','Router','../../components/auth/service','./smsApplication.controller','get','isAuthenticated','index'];(function(_0x38e9c1,_0x4f5575){var _0x247488=function(_0x2577f0){while(--_0x2577f0){_0x38e9c1['push'](_0x38e9c1['shift']());}};_0x247488(++_0x4f5575);}(_0xe14b,0x93));var _0xbe14=function(_0x29c007,_0x3d788b){_0x29c007=_0x29c007-0x0;var _0x54b5ac=_0xe14b[_0x29c007];return _0x54b5ac;};'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['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router['delete'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['destroy']);module[_0xbe14('0xc')]=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(_0x5a3bb9,_0xe19115){var _0x4afe4d=function(_0x2e6ca4){while(--_0x2e6ca4){_0x5a3bb9['push'](_0x5a3bb9['shift']());}};_0x4afe4d(++_0xe19115);}(_0x7217,0x19e));var _0x7721=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x7217[_0x521929];return _0x632436;};'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 diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 96b5fbd..384f7b5 100644 --- a/server/api/smsApplication/smsApplication.attributes.js +++ b/server/api/smsApplication/smsApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32cd=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x3c281b,_0x16dabf){var _0x4a7287=function(_0x3c89b9){while(--_0x3c89b9){_0x3c281b['push'](_0x3c281b['shift']());}};_0x4a7287(++_0x16dabf);}(_0x32cd,0x1be));var _0xd32c=function(_0x23d7a3,_0x2e7d2b){_0x23d7a3=_0x23d7a3-0x0;var _0x47a0a8=_0x32cd[_0x23d7a3];return _0x47a0a8;};'use strict';var Sequelize=require(_0xd32c('0x0'));module[_0xd32c('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xd32c('0x2')],'allowNull':![],'defaultValue':_0xd32c('0x3')},'appdata':{'type':Sequelize[_0xd32c('0x4')]()},'description':{'type':Sequelize[_0xd32c('0x2')]},'interval':{'type':Sequelize[_0xd32c('0x2')],'defaultValue':_0xd32c('0x5')}}; \ No newline at end of file +var _0xfa43=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x21080b,_0x4e267e){var _0x59de05=function(_0x3983ac){while(--_0x3983ac){_0x21080b['push'](_0x21080b['shift']());}};_0x59de05(++_0x4e267e);}(_0xfa43,0x19c));var _0x3fa4=function(_0xb0c64,_0x490a3e){_0xb0c64=_0xb0c64-0x0;var _0x501be8=_0xfa43[_0xb0c64];return _0x501be8;};'use strict';var Sequelize=require(_0x3fa4('0x0'));module[_0x3fa4('0x1')]={'priority':{'type':Sequelize[_0x3fa4('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3fa4('0x3')],'allowNull':![],'defaultValue':_0x3fa4('0x4')},'appdata':{'type':Sequelize[_0x3fa4('0x5')]()},'description':{'type':Sequelize[_0x3fa4('0x3')]},'interval':{'type':Sequelize[_0x3fa4('0x3')],'defaultValue':_0x3fa4('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 2208b5c..21e2bf2 100644 --- a/server/api/smsApplication/smsApplication.controller.js +++ b/server/api/smsApplication/smsApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ba4=['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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','error','stack','name','send','index','SmsApplication','fieldName','type','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','filters','filter','where','merge','options','findAll','then','catch','show','params','rawAttributes','includeAll','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x11a55c,_0x4eced9){var _0x26c390=function(_0x5b0662){while(--_0x5b0662){_0x11a55c['push'](_0x11a55c['shift']());}};_0x26c390(++_0x4eced9);}(_0x2ba4,0x90));var _0x42ba=function(_0x3403d4,_0x568aa6){_0x3403d4=_0x3403d4-0x0;var _0x4d764c=_0x2ba4[_0x3403d4];return _0x4d764c;};'use strict';var emlformat=require(_0x42ba('0x0'));var rimraf=require(_0x42ba('0x1'));var zipdir=require(_0x42ba('0x2'));var jsonpatch=require(_0x42ba('0x3'));var rp=require('request-promise');var moment=require(_0x42ba('0x4'));var BPromise=require(_0x42ba('0x5'));var Mustache=require(_0x42ba('0x6'));var util=require(_0x42ba('0x7'));var path=require(_0x42ba('0x8'));var sox=require(_0x42ba('0x9'));var csv=require(_0x42ba('0xa'));var ejs=require(_0x42ba('0xb'));var fs=require('fs');var fs_extra=require(_0x42ba('0xc'));var _=require(_0x42ba('0xd'));var squel=require(_0x42ba('0xe'));var crypto=require(_0x42ba('0xf'));var jsforce=require(_0x42ba('0x10'));var deskjs=require(_0x42ba('0x11'));var toCsv=require(_0x42ba('0xa'));var querystring=require(_0x42ba('0x12'));var Papa=require(_0x42ba('0x13'));var Redis=require(_0x42ba('0x14'));var authService=require(_0x42ba('0x15'));var qs=require(_0x42ba('0x16'));var as=require(_0x42ba('0x17'));var hardwareService=require(_0x42ba('0x18'));var logger=require('../../config/logger')('api');var utils=require(_0x42ba('0x19'));var config=require(_0x42ba('0x1a'));var licenseUtil=require(_0x42ba('0x1b'));var db=require(_0x42ba('0x1c'))['db'];function respondWithStatusCode(_0x23d074,_0x4e0854){_0x4e0854=_0x4e0854||0xcc;return function(_0x5c5d21){if(_0x5c5d21){return _0x23d074[_0x42ba('0x1d')](_0x4e0854);}return _0x23d074['status'](_0x4e0854)[_0x42ba('0x1e')]();};}function respondWithResult(_0x2f5da0,_0xd37309){_0xd37309=_0xd37309||0xc8;return function(_0x3a0669){if(_0x3a0669){return _0x2f5da0[_0x42ba('0x1f')](_0xd37309)[_0x42ba('0x20')](_0x3a0669);}};}function respondWithFilteredResult(_0x4f20ae,_0x347f77){return function(_0x6e5aeb){if(_0x6e5aeb){var _0x3c2b2f=typeof _0x347f77[_0x42ba('0x21')]===_0x42ba('0x22')&&typeof _0x347f77[_0x42ba('0x23')]===_0x42ba('0x22');var _0x2bacc9=_0x6e5aeb[_0x42ba('0x24')];var _0x363ae6=_0x3c2b2f?0x0:_0x347f77[_0x42ba('0x21')];var _0x72773a=_0x3c2b2f?_0x6e5aeb['count']:_0x347f77[_0x42ba('0x21')]+_0x347f77[_0x42ba('0x23')];var _0x4e8b1b;if(_0x72773a>=_0x2bacc9){_0x72773a=_0x2bacc9;_0x4e8b1b=0xc8;}else{_0x4e8b1b=0xce;}_0x4f20ae['status'](_0x4e8b1b);return _0x4f20ae[_0x42ba('0x25')]('Content-Range',_0x363ae6+'-'+_0x72773a+'/'+_0x2bacc9)[_0x42ba('0x20')](_0x6e5aeb);}return null;};}function patchUpdates(_0x6977b2){return function(_0x3ed875){try{jsonpatch[_0x42ba('0x26')](_0x3ed875,_0x6977b2,!![]);}catch(_0x1e875b){return BPromise[_0x42ba('0x27')](_0x1e875b);}return _0x3ed875[_0x42ba('0x28')]();};}function saveUpdates(_0x2658cb,_0x1797bb){return function(_0x1a6779){if(_0x1a6779){return _0x1a6779['update'](_0x2658cb)['then'](function(_0x4504d0){return _0x4504d0;});}return null;};}function removeEntity(_0x37ed1f,_0x4e0dda){return function(_0x176532){if(_0x176532){return _0x176532[_0x42ba('0x29')]()['then'](function(){_0x37ed1f[_0x42ba('0x1f')](0xcc)[_0x42ba('0x1e')]();});}};}function handleEntityNotFound(_0x2b0423,_0x20eb70){return function(_0x5545e1){if(!_0x5545e1){_0x2b0423[_0x42ba('0x1d')](0x194);}return _0x5545e1;};}function handleError(_0x292e10,_0xbc578c){_0xbc578c=_0xbc578c||0x1f4;return function(_0x4aadb2){logger[_0x42ba('0x2a')](_0x4aadb2[_0x42ba('0x2b')]);if(_0x4aadb2[_0x42ba('0x2c')]){delete _0x4aadb2[_0x42ba('0x2c')];}_0x292e10['status'](_0xbc578c)[_0x42ba('0x2d')](_0x4aadb2);};}exports[_0x42ba('0x2e')]=function(_0x2c1ab7,_0x4106b3){var _0x395ef4={},_0x531399={},_0x360f64={'count':0x0,'rows':[]};var _0x3db4c1=_['map'](db[_0x42ba('0x2f')]['rawAttributes'],function(_0x4ca3ae){return{'name':_0x4ca3ae[_0x42ba('0x30')],'type':_0x4ca3ae[_0x42ba('0x31')]['key']};});_0x531399[_0x42ba('0x32')]=_[_0x42ba('0x33')](_0x3db4c1,'name');_0x531399[_0x42ba('0x34')]=_[_0x42ba('0x35')](_0x2c1ab7[_0x42ba('0x34')]);_0x531399['filters']=_[_0x42ba('0x36')](_0x531399[_0x42ba('0x32')],_0x531399[_0x42ba('0x34')]);_0x395ef4[_0x42ba('0x37')]=_['intersection'](_0x531399[_0x42ba('0x32')],qs[_0x42ba('0x38')](_0x2c1ab7[_0x42ba('0x34')][_0x42ba('0x38')]));_0x395ef4[_0x42ba('0x37')]=_0x395ef4[_0x42ba('0x37')]['length']?_0x395ef4[_0x42ba('0x37')]:_0x531399[_0x42ba('0x32')];if(!_0x2c1ab7['query'][_0x42ba('0x39')](_0x42ba('0x3a'))){_0x395ef4['limit']=qs[_0x42ba('0x23')](_0x2c1ab7[_0x42ba('0x34')]['limit']);_0x395ef4[_0x42ba('0x21')]=qs[_0x42ba('0x21')](_0x2c1ab7['query'][_0x42ba('0x21')]);}_0x395ef4['order']=qs['sort'](_0x2c1ab7[_0x42ba('0x34')]['sort']);_0x395ef4['where']=qs[_0x42ba('0x3b')](_['pick'](_0x2c1ab7[_0x42ba('0x34')],_0x531399[_0x42ba('0x3b')]),_0x3db4c1);if(_0x2c1ab7[_0x42ba('0x34')][_0x42ba('0x3c')]){_0x395ef4[_0x42ba('0x3d')]=_[_0x42ba('0x3e')](_0x395ef4[_0x42ba('0x3d')],{'$or':_[_0x42ba('0x33')](_0x3db4c1,function(_0x2a7bf7){if(_0x2a7bf7[_0x42ba('0x31')]!=='VIRTUAL'){var _0x2d94cc={};_0x2d94cc[_0x2a7bf7[_0x42ba('0x2c')]]={'$like':'%'+_0x2c1ab7[_0x42ba('0x34')][_0x42ba('0x3c')]+'%'};return _0x2d94cc;}})});}_0x395ef4=_[_0x42ba('0x3e')]({},_0x395ef4,_0x2c1ab7[_0x42ba('0x3f')]);var _0x2e4854={'where':_0x395ef4[_0x42ba('0x3d')]};return db[_0x42ba('0x2f')][_0x42ba('0x24')](_0x2e4854)['then'](function(_0x5649f1){_0x360f64[_0x42ba('0x24')]=_0x5649f1;if(_0x2c1ab7['query']['includeAll']){_0x395ef4['include']=[{'all':!![]}];}return db[_0x42ba('0x2f')][_0x42ba('0x40')](_0x395ef4);})[_0x42ba('0x41')](function(_0x6b82f4){_0x360f64['rows']=_0x6b82f4;return _0x360f64;})['then'](respondWithFilteredResult(_0x4106b3,_0x395ef4))[_0x42ba('0x42')](handleError(_0x4106b3,null));};exports[_0x42ba('0x43')]=function(_0x30721b,_0x5dee59){var _0x5d6b9a={'raw':!![],'where':{'id':_0x30721b[_0x42ba('0x44')]['id']}},_0x3030bd={};_0x3030bd[_0x42ba('0x32')]=_[_0x42ba('0x35')](db[_0x42ba('0x2f')][_0x42ba('0x45')]);_0x3030bd[_0x42ba('0x34')]=_[_0x42ba('0x35')](_0x30721b['query']);_0x3030bd[_0x42ba('0x3b')]=_[_0x42ba('0x36')](_0x3030bd['model'],_0x3030bd[_0x42ba('0x34')]);_0x5d6b9a['attributes']=_['intersection'](_0x3030bd[_0x42ba('0x32')],qs[_0x42ba('0x38')](_0x30721b[_0x42ba('0x34')][_0x42ba('0x38')]));_0x5d6b9a[_0x42ba('0x37')]=_0x5d6b9a[_0x42ba('0x37')]['length']?_0x5d6b9a[_0x42ba('0x37')]:_0x3030bd[_0x42ba('0x32')];if(_0x30721b[_0x42ba('0x34')][_0x42ba('0x46')]){_0x5d6b9a['include']=[{'all':!![]}];}_0x5d6b9a=_[_0x42ba('0x3e')]({},_0x5d6b9a,_0x30721b[_0x42ba('0x3f')]);return db[_0x42ba('0x2f')][_0x42ba('0x47')](_0x5d6b9a)['then'](handleEntityNotFound(_0x5dee59,null))[_0x42ba('0x41')](respondWithResult(_0x5dee59,null))[_0x42ba('0x42')](handleError(_0x5dee59,null));};exports[_0x42ba('0x48')]=function(_0x166267,_0x1b0073){return db['SmsApplication']['create'](_0x166267[_0x42ba('0x49')],{})['then'](respondWithResult(_0x1b0073,0xc9))[_0x42ba('0x42')](handleError(_0x1b0073,null));};exports[_0x42ba('0x4a')]=function(_0x3cbf2c,_0x3c920f){if(_0x3cbf2c[_0x42ba('0x49')]['id']){delete _0x3cbf2c[_0x42ba('0x49')]['id'];}return db['SmsApplication']['find']({'where':{'id':_0x3cbf2c['params']['id']}})[_0x42ba('0x41')](handleEntityNotFound(_0x3c920f,null))[_0x42ba('0x41')](saveUpdates(_0x3cbf2c['body'],null))[_0x42ba('0x41')](respondWithResult(_0x3c920f,null))[_0x42ba('0x42')](handleError(_0x3c920f,null));};exports[_0x42ba('0x29')]=function(_0x40ee10,_0x33f6b1){return db[_0x42ba('0x2f')]['find']({'where':{'id':_0x40ee10[_0x42ba('0x44')]['id']}})[_0x42ba('0x41')](handleEntityNotFound(_0x33f6b1,null))[_0x42ba('0x41')](removeEntity(_0x33f6b1,null))['catch'](handleError(_0x33f6b1,null));}; \ No newline at end of file +var _0x6040=['mustache','path','sox','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','json','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','SmsApplication','includeAll','findAll','rows','catch','show','params','keys','length','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x6040,0x170));var _0x0604=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x6040[_0x13ce0c];return _0x4388fb;};'use strict';var emlformat=require(_0x0604('0x0'));var rimraf=require(_0x0604('0x1'));var zipdir=require(_0x0604('0x2'));var jsonpatch=require(_0x0604('0x3'));var rp=require(_0x0604('0x4'));var moment=require(_0x0604('0x5'));var BPromise=require(_0x0604('0x6'));var Mustache=require(_0x0604('0x7'));var util=require('util');var path=require(_0x0604('0x8'));var sox=require(_0x0604('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0604('0xa'));var squel=require(_0x0604('0xb'));var crypto=require('crypto');var jsforce=require(_0x0604('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0604('0xd'));var querystring=require('querystring');var Papa=require(_0x0604('0xe'));var Redis=require(_0x0604('0xf'));var authService=require(_0x0604('0x10'));var qs=require(_0x0604('0x11'));var as=require(_0x0604('0x12'));var hardwareService=require(_0x0604('0x13'));var logger=require(_0x0604('0x14'))(_0x0604('0x15'));var utils=require(_0x0604('0x16'));var config=require(_0x0604('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0604('0x18'))['db'];function respondWithStatusCode(_0x2071bc,_0x462132){_0x462132=_0x462132||0xcc;return function(_0x4e7bd2){if(_0x4e7bd2){return _0x2071bc[_0x0604('0x19')](_0x462132);}return _0x2071bc['status'](_0x462132)[_0x0604('0x1a')]();};}function respondWithResult(_0x39e16d,_0x511c55){_0x511c55=_0x511c55||0xc8;return function(_0x51eb3b){if(_0x51eb3b){return _0x39e16d[_0x0604('0x1b')](_0x511c55)['json'](_0x51eb3b);}};}function respondWithFilteredResult(_0x39791d,_0x2656ff){return function(_0x451f36){if(_0x451f36){var _0x992899=typeof _0x2656ff[_0x0604('0x1c')]===_0x0604('0x1d')&&typeof _0x2656ff['limit']===_0x0604('0x1d');var _0x32f60e=_0x451f36[_0x0604('0x1e')];var _0x21f2d0=_0x992899?0x0:_0x2656ff['offset'];var _0x5cb162=_0x992899?_0x451f36['count']:_0x2656ff[_0x0604('0x1c')]+_0x2656ff[_0x0604('0x1f')];var _0x11b770;if(_0x5cb162>=_0x32f60e){_0x5cb162=_0x32f60e;_0x11b770=0xc8;}else{_0x11b770=0xce;}_0x39791d['status'](_0x11b770);return _0x39791d[_0x0604('0x20')]('Content-Range',_0x21f2d0+'-'+_0x5cb162+'/'+_0x32f60e)[_0x0604('0x21')](_0x451f36);}return null;};}function patchUpdates(_0x4bc4c2){return function(_0x1b5ad5){try{jsonpatch[_0x0604('0x22')](_0x1b5ad5,_0x4bc4c2,!![]);}catch(_0x511a1e){return BPromise[_0x0604('0x23')](_0x511a1e);}return _0x1b5ad5[_0x0604('0x24')]();};}function saveUpdates(_0x5d125a,_0x83d0f6){return function(_0x1a8e3f){if(_0x1a8e3f){return _0x1a8e3f[_0x0604('0x25')](_0x5d125a)[_0x0604('0x26')](function(_0x49b226){return _0x49b226;});}return null;};}function removeEntity(_0x509d25,_0x564857){return function(_0x15ec8e){if(_0x15ec8e){return _0x15ec8e['destroy']()[_0x0604('0x26')](function(){_0x509d25[_0x0604('0x1b')](0xcc)[_0x0604('0x1a')]();});}};}function handleEntityNotFound(_0x2977f5,_0x5dd835){return function(_0x1ead09){if(!_0x1ead09){_0x2977f5['sendStatus'](0x194);}return _0x1ead09;};}function handleError(_0x2debed,_0x609f2e){_0x609f2e=_0x609f2e||0x1f4;return function(_0x252a3e){logger[_0x0604('0x27')](_0x252a3e[_0x0604('0x28')]);if(_0x252a3e['name']){delete _0x252a3e[_0x0604('0x29')];}_0x2debed[_0x0604('0x1b')](_0x609f2e)[_0x0604('0x2a')](_0x252a3e);};}exports[_0x0604('0x2b')]=function(_0x5875d7,_0x471558){var _0x1cb5df={},_0x2bfab7={},_0x509688={'count':0x0,'rows':[]};var _0x5a3a73=_[_0x0604('0x2c')](db['SmsApplication'][_0x0604('0x2d')],function(_0x80f1c9){return{'name':_0x80f1c9[_0x0604('0x2e')],'type':_0x80f1c9[_0x0604('0x2f')]['key']};});_0x2bfab7[_0x0604('0x30')]=_[_0x0604('0x2c')](_0x5a3a73,_0x0604('0x29'));_0x2bfab7[_0x0604('0x31')]=_['keys'](_0x5875d7['query']);_0x2bfab7[_0x0604('0x32')]=_['intersection'](_0x2bfab7[_0x0604('0x30')],_0x2bfab7[_0x0604('0x31')]);_0x1cb5df[_0x0604('0x33')]=_[_0x0604('0x34')](_0x2bfab7[_0x0604('0x30')],qs['fields'](_0x5875d7[_0x0604('0x31')][_0x0604('0x35')]));_0x1cb5df[_0x0604('0x33')]=_0x1cb5df[_0x0604('0x33')]['length']?_0x1cb5df[_0x0604('0x33')]:_0x2bfab7[_0x0604('0x30')];if(!_0x5875d7['query'][_0x0604('0x36')](_0x0604('0x37'))){_0x1cb5df[_0x0604('0x1f')]=qs[_0x0604('0x1f')](_0x5875d7[_0x0604('0x31')][_0x0604('0x1f')]);_0x1cb5df['offset']=qs['offset'](_0x5875d7[_0x0604('0x31')][_0x0604('0x1c')]);}_0x1cb5df[_0x0604('0x38')]=qs[_0x0604('0x39')](_0x5875d7[_0x0604('0x31')][_0x0604('0x39')]);_0x1cb5df['where']=qs[_0x0604('0x32')](_['pick'](_0x5875d7['query'],_0x2bfab7[_0x0604('0x32')]),_0x5a3a73);if(_0x5875d7[_0x0604('0x31')][_0x0604('0x3a')]){_0x1cb5df[_0x0604('0x3b')]=_[_0x0604('0x3c')](_0x1cb5df[_0x0604('0x3b')],{'$or':_['map'](_0x5a3a73,function(_0x1a26e4){if(_0x1a26e4[_0x0604('0x2f')]!=='VIRTUAL'){var _0x1a57e3={};_0x1a57e3[_0x1a26e4[_0x0604('0x29')]]={'$like':'%'+_0x5875d7[_0x0604('0x31')][_0x0604('0x3a')]+'%'};return _0x1a57e3;}})});}_0x1cb5df=_['merge']({},_0x1cb5df,_0x5875d7['options']);var _0xdd2264={'where':_0x1cb5df[_0x0604('0x3b')]};return db[_0x0604('0x3d')][_0x0604('0x1e')](_0xdd2264)[_0x0604('0x26')](function(_0x43131b){_0x509688[_0x0604('0x1e')]=_0x43131b;if(_0x5875d7[_0x0604('0x31')][_0x0604('0x3e')]){_0x1cb5df['include']=[{'all':!![]}];}return db[_0x0604('0x3d')][_0x0604('0x3f')](_0x1cb5df);})[_0x0604('0x26')](function(_0x220fd3){_0x509688[_0x0604('0x40')]=_0x220fd3;return _0x509688;})[_0x0604('0x26')](respondWithFilteredResult(_0x471558,_0x1cb5df))[_0x0604('0x41')](handleError(_0x471558,null));};exports[_0x0604('0x42')]=function(_0x4476d2,_0x462231){var _0x3871e2={'raw':!![],'where':{'id':_0x4476d2[_0x0604('0x43')]['id']}},_0x173944={};_0x173944['model']=_[_0x0604('0x44')](db['SmsApplication'][_0x0604('0x2d')]);_0x173944['query']=_[_0x0604('0x44')](_0x4476d2[_0x0604('0x31')]);_0x173944[_0x0604('0x32')]=_[_0x0604('0x34')](_0x173944['model'],_0x173944[_0x0604('0x31')]);_0x3871e2[_0x0604('0x33')]=_['intersection'](_0x173944[_0x0604('0x30')],qs[_0x0604('0x35')](_0x4476d2['query'][_0x0604('0x35')]));_0x3871e2[_0x0604('0x33')]=_0x3871e2[_0x0604('0x33')][_0x0604('0x45')]?_0x3871e2[_0x0604('0x33')]:_0x173944[_0x0604('0x30')];if(_0x4476d2[_0x0604('0x31')]['includeAll']){_0x3871e2['include']=[{'all':!![]}];}_0x3871e2=_[_0x0604('0x3c')]({},_0x3871e2,_0x4476d2[_0x0604('0x46')]);return db['SmsApplication'][_0x0604('0x47')](_0x3871e2)[_0x0604('0x26')](handleEntityNotFound(_0x462231,null))[_0x0604('0x26')](respondWithResult(_0x462231,null))[_0x0604('0x41')](handleError(_0x462231,null));};exports[_0x0604('0x48')]=function(_0x4e6503,_0x57b2c3){return db['SmsApplication']['create'](_0x4e6503[_0x0604('0x49')],{})[_0x0604('0x26')](respondWithResult(_0x57b2c3,0xc9))['catch'](handleError(_0x57b2c3,null));};exports[_0x0604('0x25')]=function(_0x247b92,_0x43fbbc){if(_0x247b92[_0x0604('0x49')]['id']){delete _0x247b92[_0x0604('0x49')]['id'];}return db[_0x0604('0x3d')][_0x0604('0x47')]({'where':{'id':_0x247b92[_0x0604('0x43')]['id']}})[_0x0604('0x26')](handleEntityNotFound(_0x43fbbc,null))[_0x0604('0x26')](saveUpdates(_0x247b92[_0x0604('0x49')],null))[_0x0604('0x26')](respondWithResult(_0x43fbbc,null))[_0x0604('0x41')](handleError(_0x43fbbc,null));};exports[_0x0604('0x4a')]=function(_0x4da7a3,_0x3385e6){return db[_0x0604('0x3d')][_0x0604('0x47')]({'where':{'id':_0x4da7a3[_0x0604('0x43')]['id']}})[_0x0604('0x26')](handleEntityNotFound(_0x3385e6,null))['then'](removeEntity(_0x3385e6,null))[_0x0604('0x41')](handleError(_0x3385e6,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 39c6353..b9b8620 100644 --- a/server/api/smsApplication/smsApplication.model.js +++ b/server/api/smsApplication/smsApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa363=['define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4820b5,_0x37e7fa){var _0x280668=function(_0x2ce41c){while(--_0x2ce41c){_0x4820b5['push'](_0x4820b5['shift']());}};_0x280668(++_0x37e7fa);}(_0xa363,0x19b));var _0x3a36=function(_0x3269b8,_0x24cf8c){_0x3269b8=_0x3269b8-0x0;var _0x513aa2=_0xa363[_0x3269b8];return _0x513aa2;};'use strict';var _=require(_0x3a36('0x0'));var util=require(_0x3a36('0x1'));var logger=require(_0x3a36('0x2'))('api');var moment=require(_0x3a36('0x3'));var BPromise=require(_0x3a36('0x4'));var rp=require(_0x3a36('0x5'));var fs=require('fs');var path=require(_0x3a36('0x6'));var rimraf=require(_0x3a36('0x7'));var config=require(_0x3a36('0x8'));var attributes=require('./smsApplication.attributes');module['exports']=function(_0x228667,_0x4365dd){return _0x228667[_0x3a36('0x9')](_0x3a36('0xa'),attributes,{'tableName':_0x3a36('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3a36('0xc'),'collate':_0x3a36('0xd')});}; \ No newline at end of file +var _0x32c2=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','path','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4'];(function(_0x477873,_0x56864d){var _0x40cb30=function(_0x3302d2){while(--_0x3302d2){_0x477873['push'](_0x477873['shift']());}};_0x40cb30(++_0x56864d);}(_0x32c2,0x90));var _0x232c=function(_0x54420e,_0x19d678){_0x54420e=_0x54420e-0x0;var _0x54c4ef=_0x32c2[_0x54420e];return _0x54c4ef;};'use strict';var _=require(_0x232c('0x0'));var util=require(_0x232c('0x1'));var logger=require(_0x232c('0x2'))(_0x232c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x232c('0x4'));var rimraf=require('rimraf');var config=require(_0x232c('0x5'));var attributes=require(_0x232c('0x6'));module[_0x232c('0x7')]=function(_0xa72963,_0x15375d){return _0xa72963[_0x232c('0x8')](_0x232c('0x9'),attributes,{'tableName':_0x232c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x232c('0xb'),'collate':_0x232c('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 2345e46..319b679 100644 --- a/server/api/smsApplication/smsApplication.rpc.js +++ b/server/api/smsApplication/smsApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a55=['SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','randomstring','../../config/utils','rpc','jayson/promise','client','http','then','info'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x6a55,0xdb));var _0x56a5=function(_0x4d8666,_0x2ff19d){_0x4d8666=_0x4d8666-0x0;var _0x37175b=_0x6a55[_0x4d8666];return _0x37175b;};'use strict';var _=require(_0x56a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x56a5('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x56a5('0x2'));var logger=require('../../config/logger')(_0x56a5('0x3'));var config=require('../../config/environment');var jayson=require(_0x56a5('0x4'));var client=jayson[_0x56a5('0x5')][_0x56a5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x293ea1,_0x444c65,_0x2272d9){return new BPromise(function(_0x2b8f57,_0x387dcb){return client['request'](_0x293ea1,_0x2272d9)[_0x56a5('0x7')](function(_0xf15490){logger[_0x56a5('0x8')](_0x56a5('0x9'),_0x444c65,_0x56a5('0xa'));logger[_0x56a5('0xb')](_0x56a5('0xc'),_0x444c65,_0x56a5('0xa'),JSON[_0x56a5('0xd')](_0xf15490));if(_0xf15490['error']){if(_0xf15490['error'][_0x56a5('0xe')]===0x1f4){logger[_0x56a5('0xf')](_0x56a5('0x9'),_0x444c65,_0xf15490[_0x56a5('0xf')][_0x56a5('0x10')]);return _0x387dcb(_0xf15490[_0x56a5('0xf')]['message']);}logger['error'](_0x56a5('0x9'),_0x444c65,_0xf15490[_0x56a5('0xf')][_0x56a5('0x10')]);return _0x2b8f57(_0xf15490[_0x56a5('0xf')][_0x56a5('0x10')]);}else{logger[_0x56a5('0x8')](_0x56a5('0x9'),_0x444c65,'request\x20sent');_0x2b8f57(_0xf15490[_0x56a5('0x11')]['message']);}})[_0x56a5('0x12')](function(_0x51d031){logger[_0x56a5('0xf')](_0x56a5('0x9'),_0x444c65,_0x51d031);_0x387dcb(_0x51d031);});});} \ No newline at end of file +var _0x5bc1=['jayson/promise','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x24a822,_0x1bc633){var _0x43a04b=function(_0x751190){while(--_0x751190){_0x24a822['push'](_0x24a822['shift']());}};_0x43a04b(++_0x1bc633);}(_0x5bc1,0xb5));var _0x15bc=function(_0x137fdc,_0x350ef5){_0x137fdc=_0x137fdc-0x0;var _0x4594b8=_0x5bc1[_0x137fdc];return _0x4594b8;};'use strict';var _=require('lodash');var util=require(_0x15bc('0x0'));var moment=require(_0x15bc('0x1'));var BPromise=require(_0x15bc('0x2'));var rs=require(_0x15bc('0x3'));var fs=require('fs');var Redis=require(_0x15bc('0x4'));var db=require(_0x15bc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x15bc('0x6'));var config=require(_0x15bc('0x7'));var jayson=require(_0x15bc('0x8'));var client=jayson['client'][_0x15bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x483c6d,_0x344121,_0x3eff99){return new BPromise(function(_0x44f66d,_0x382bd9){return client[_0x15bc('0xa')](_0x483c6d,_0x3eff99)[_0x15bc('0xb')](function(_0x2bc60a){logger[_0x15bc('0xc')](_0x15bc('0xd'),_0x344121,_0x15bc('0xe'));logger['debug'](_0x15bc('0xf'),_0x344121,_0x15bc('0xe'),JSON[_0x15bc('0x10')](_0x2bc60a));if(_0x2bc60a['error']){if(_0x2bc60a[_0x15bc('0x11')][_0x15bc('0x12')]===0x1f4){logger[_0x15bc('0x11')](_0x15bc('0xd'),_0x344121,_0x2bc60a['error'][_0x15bc('0x13')]);return _0x382bd9(_0x2bc60a[_0x15bc('0x11')][_0x15bc('0x13')]);}logger[_0x15bc('0x11')](_0x15bc('0xd'),_0x344121,_0x2bc60a[_0x15bc('0x11')][_0x15bc('0x13')]);return _0x44f66d(_0x2bc60a[_0x15bc('0x11')][_0x15bc('0x13')]);}else{logger[_0x15bc('0xc')](_0x15bc('0xd'),_0x344121,_0x15bc('0xe'));_0x44f66d(_0x2bc60a[_0x15bc('0x14')][_0x15bc('0x13')]);}})['catch'](function(_0x2a9b3b){logger[_0x15bc('0x11')](_0x15bc('0xd'),_0x344121,_0x2a9b3b);_0x382bd9(_0x2a9b3b);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 43bcd02..e8ae6a4 100644 --- a/server/api/smsInteraction/index.js +++ b/server/api/smsInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe605=['./smsInteraction.controller','get','isAuthenticated','index','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','/:id','update','delete','smsinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2b71f3,_0x10c08d){var _0x5d7ac5=function(_0x233598){while(--_0x233598){_0x2b71f3['push'](_0x2b71f3['shift']());}};_0x5d7ac5(++_0x10c08d);}(_0xe605,0x92));var _0x5e60=function(_0x53690a,_0x40fe64){_0x53690a=_0x53690a-0x0;var _0x2b7a16=_0xe605[_0x53690a];return _0x2b7a16;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/describe',auth[_0x5e60('0xb')](),controller['describe']);router['get']('/:id',auth[_0x5e60('0xb')](),controller[_0x5e60('0xd')]);router[_0x5e60('0xa')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0xf')]);router['get'](_0x5e60('0x10'),auth['isAuthenticated'](),controller[_0x5e60('0x11')]);router[_0x5e60('0x12')]('/',auth[_0x5e60('0xb')](),controller['create']);router[_0x5e60('0x12')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x13')]);router[_0x5e60('0x12')](_0x5e60('0x14'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),_0x5e60('0x17')),controller[_0x5e60('0x18')]);router['put'](_0x5e60('0x19'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),'smsinteraction:update'),controller[_0x5e60('0x1a')]);router[_0x5e60('0x1b')](_0x5e60('0x19'),auth[_0x5e60('0xb')](),interaction['tracked'](_0x5e60('0x16'),_0x5e60('0x1c')),controller['destroy']);router[_0x5e60('0x1b')](_0x5e60('0x14'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x1d')]);module[_0x5e60('0x1e')]=router; \ No newline at end of file +var _0x36ee=['../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','smsinteraction:addtags','addTags','put','tracked','sms','smsinteraction:update','update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x54c238,_0x126f3a){var _0x2edef5=function(_0x2f2f82){while(--_0x2f2f82){_0x54c238['push'](_0x54c238['shift']());}};_0x2edef5(++_0x126f3a);}(_0x36ee,0xe8));var _0xe36e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x36ee[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['get'](_0xe36e('0xd'),auth[_0xe36e('0x9')](),controller[_0xe36e('0xe')]);router['get'](_0xe36e('0xf'),auth['isAuthenticated'](),controller[_0xe36e('0x10')]);router[_0xe36e('0x8')](_0xe36e('0x11'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x12')]);router[_0xe36e('0x13')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0x14')]);router['post'](_0xe36e('0xf'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x15')]);router[_0xe36e('0x13')]('/:id/tags',auth[_0xe36e('0x9')](),interaction['tracked']('sms',_0xe36e('0x16')),controller[_0xe36e('0x17')]);router[_0xe36e('0x18')](_0xe36e('0xd'),auth[_0xe36e('0x9')](),interaction[_0xe36e('0x19')](_0xe36e('0x1a'),_0xe36e('0x1b')),controller[_0xe36e('0x1c')]);router[_0xe36e('0x1d')]('/:id',auth[_0xe36e('0x9')](),interaction[_0xe36e('0x19')]('sms',_0xe36e('0x1e')),controller['destroy']);router[_0xe36e('0x1d')](_0xe36e('0x1f'),auth['isAuthenticated'](),controller[_0xe36e('0x20')]);module[_0xe36e('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 8549bff..4635929 100644 --- a/server/api/smsInteraction/smsInteraction.attributes.js +++ b/server/api/smsInteraction/smsInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c1a=['out','INTEGER','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3c1a,0xda));var _0xa3c1=function(_0x81dcac,_0x8ff7db){_0x81dcac=_0x81dcac-0x0;var _0xc7803b=_0x3c1a[_0x81dcac];return _0xc7803b;};'use strict';var Sequelize=require(_0xa3c1('0x0'));var moment=require(_0xa3c1('0x1'));module[_0xa3c1('0x2')]={'closed':{'type':Sequelize[_0xa3c1('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa3c1('0x4')]},'disposition':{'type':Sequelize[_0xa3c1('0x5')]},'secondDisposition':{'type':Sequelize[_0xa3c1('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa3c1('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xa3c1('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xa3c1('0x6')]('in',_0xa3c1('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa3c1('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa3c1('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xa3c1('0x8')]}}; \ No newline at end of file +var _0x45d8=['DATE','STRING','out','INTEGER','sequelize','moment','exports','BOOLEAN'];(function(_0x461613,_0x357dd2){var _0x1338d6=function(_0x46c881){while(--_0x46c881){_0x461613['push'](_0x461613['shift']());}};_0x1338d6(++_0x357dd2);}(_0x45d8,0x174));var _0x845d=function(_0x5857a7,_0x3f8601){_0x5857a7=_0x5857a7-0x0;var _0x2c35e4=_0x45d8[_0x5857a7];return _0x2c35e4;};'use strict';var Sequelize=require(_0x845d('0x0'));var moment=require(_0x845d('0x1'));module[_0x845d('0x2')]={'closed':{'type':Sequelize[_0x845d('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x845d('0x4')]},'disposition':{'type':Sequelize[_0x845d('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x845d('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x845d('0x5')]},'read1stAt':{'type':Sequelize[_0x845d('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x845d('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x845d('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x845d('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x845d('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index c0240ff..b4a9215 100644 --- a/server/api/smsInteraction/smsInteraction.controller.js +++ b/server/api/smsInteraction/smsInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f3a=['SmsMessage','omit','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','SmsInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','emit','removeTags','download','unix','join','server','tmp','format','transcript-%d-%s.zip','User','fullname','CmContact','Contact','lastName','createdAt','direction','secret','read','SmsAccount','push','Owner','Account','N.A.','toString','closedAt','disposition','out','firstName','value','renderFile','root','transcript-','Sms','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','update','then','error','stack','name','send','index','map','SmsInteraction','type','getOptions','findAll','query','user','catch','show','keys','rawAttributes','filters','intersection','model','attributes','fields','length','includeAll','merge','find','create','body','params','describe','addMessage'];(function(_0x4cf067,_0x443e1e){var _0x548c96=function(_0x2fa683){while(--_0x2fa683){_0x4cf067['push'](_0x4cf067['shift']());}};_0x548c96(++_0x443e1e);}(_0x8f3a,0xa9));var _0xa8f3=function(_0x103692,_0x50f2dd){_0x103692=_0x103692-0x0;var _0x553218=_0x8f3a[_0x103692];return _0x553218;};'use strict';var rimraf=require(_0xa8f3('0x0'));var zipdir=require(_0xa8f3('0x1'));var moment=require(_0xa8f3('0x2'));var BPromise=require(_0xa8f3('0x3'));var util=require(_0xa8f3('0x4'));var path=require(_0xa8f3('0x5'));var ejs=require(_0xa8f3('0x6'));var fs=require('fs');var _=require(_0xa8f3('0x7'));var Redis=require(_0xa8f3('0x8'));var interaction=require('../../components/interaction/service');var qs=require(_0xa8f3('0x9'));var pdf=require(_0xa8f3('0xa'));var logger=require(_0xa8f3('0xb'))('api');var config=require(_0xa8f3('0xc'));var db=require('../../mysqldb')['db'];config[_0xa8f3('0xd')]=_[_0xa8f3('0xe')](config[_0xa8f3('0xd')],{'host':_0xa8f3('0xf'),'port':0x18eb});var socket=require(_0xa8f3('0x10'))(new Redis(config['redis']));require(_0xa8f3('0x11'))[_0xa8f3('0x12')](socket);function respondWithStatusCode(_0x215804,_0x425f0c){_0x425f0c=_0x425f0c||0xcc;return function(_0x3e6c40){if(_0x3e6c40){return _0x215804[_0xa8f3('0x13')](_0x425f0c);}return _0x215804[_0xa8f3('0x14')](_0x425f0c)[_0xa8f3('0x15')]();};}function respondWithResult(_0xf04fb6,_0x24309d){_0x24309d=_0x24309d||0xc8;return function(_0x4b74ca){if(_0x4b74ca){return _0xf04fb6[_0xa8f3('0x14')](_0x24309d)[_0xa8f3('0x16')](_0x4b74ca);}};}function respondWithFilteredResult(_0x544f18,_0x33045f){return function(_0x36a872){if(_0x36a872){var _0x25e870=typeof _0x33045f[_0xa8f3('0x17')]===_0xa8f3('0x18')&&typeof _0x33045f[_0xa8f3('0x19')]===_0xa8f3('0x18');var _0x416eef=_0x36a872[_0xa8f3('0x1a')];var _0x572822=_0x25e870?0x0:_0x33045f[_0xa8f3('0x17')];var _0x2c1229=_0x25e870?_0x36a872['count']:_0x33045f[_0xa8f3('0x17')]+_0x33045f['limit'];var _0x42b168;if(_0x2c1229>=_0x416eef){_0x2c1229=_0x416eef;_0x42b168=0xc8;}else{_0x42b168=0xce;}_0x544f18[_0xa8f3('0x14')](_0x42b168);return _0x544f18['set']('Content-Range',_0x572822+'-'+_0x2c1229+'/'+_0x416eef)[_0xa8f3('0x16')](_0x36a872);}return null;};}function saveUpdates(_0x3c67de){return function(_0x19c287){if(_0x19c287){return _0x19c287[_0xa8f3('0x1b')](_0x3c67de)[_0xa8f3('0x1c')](function(_0x416ee7){return _0x416ee7;});}return null;};}function removeEntity(_0x3fe662){return function(_0x5a856e){if(_0x5a856e){return _0x5a856e['destroy']()[_0xa8f3('0x1c')](function(){_0x3fe662['status'](0xcc)[_0xa8f3('0x15')]();});}};}function handleEntityNotFound(_0x41794f){return function(_0x586523){if(!_0x586523){_0x41794f[_0xa8f3('0x13')](0x194);}return _0x586523;};}function handleError(_0x5e2da4,_0x2ea4cf){_0x2ea4cf=_0x2ea4cf||0x1f4;return function(_0x280a9c){logger[_0xa8f3('0x1d')](_0x280a9c[_0xa8f3('0x1e')]);if(_0x280a9c[_0xa8f3('0x1f')]){delete _0x280a9c[_0xa8f3('0x1f')];}_0x5e2da4[_0xa8f3('0x14')](_0x2ea4cf)[_0xa8f3('0x20')](_0x280a9c);};}exports[_0xa8f3('0x21')]=function(_0x4b9bd1,_0x583248){var _0x4c0162={};var _0x35c302=_[_0xa8f3('0x22')](db[_0xa8f3('0x23')]['rawAttributes'],function(_0x5b1e70){return{'name':_0x5b1e70['fieldName'],'type':_0x5b1e70[_0xa8f3('0x24')]['key']};});_0x4c0162=qs[_0xa8f3('0x25')](_0x35c302,_0x4b9bd1);return interaction[_0xa8f3('0x26')]('sms',_0x4b9bd1[_0xa8f3('0x27')],_0x4b9bd1[_0xa8f3('0x28')],_0x4c0162,_0x35c302)[_0xa8f3('0x1c')](respondWithFilteredResult(_0x583248,_0x4c0162))[_0xa8f3('0x29')](handleError(_0x583248,null));};exports[_0xa8f3('0x2a')]=function(_0x2c03ab,_0x2aeee9){var _0x2a2fa4={'raw':![],'where':{'id':_0x2c03ab['params']['id']}},_0x11df00={};_0x11df00['model']=_[_0xa8f3('0x2b')](db[_0xa8f3('0x23')][_0xa8f3('0x2c')]);_0x11df00[_0xa8f3('0x27')]=_[_0xa8f3('0x2b')](_0x2c03ab['query']);_0x11df00[_0xa8f3('0x2d')]=_[_0xa8f3('0x2e')](_0x11df00[_0xa8f3('0x2f')],_0x11df00['query']);_0x2a2fa4[_0xa8f3('0x30')]=_[_0xa8f3('0x2e')](_0x11df00['model'],qs[_0xa8f3('0x31')](_0x2c03ab[_0xa8f3('0x27')][_0xa8f3('0x31')]));_0x2a2fa4[_0xa8f3('0x30')]=_0x2a2fa4[_0xa8f3('0x30')][_0xa8f3('0x32')]?_0x2a2fa4[_0xa8f3('0x30')]:_0x11df00[_0xa8f3('0x2f')];if(_0x2c03ab[_0xa8f3('0x27')][_0xa8f3('0x33')]){_0x2a2fa4['include']=[{'all':!![]}];}_0x2a2fa4=_[_0xa8f3('0x34')]({},_0x2a2fa4,_0x2c03ab['options']);return db[_0xa8f3('0x23')][_0xa8f3('0x35')](_0x2a2fa4)[_0xa8f3('0x1c')](handleEntityNotFound(_0x2aeee9,null))['then'](respondWithResult(_0x2aeee9,null))[_0xa8f3('0x29')](handleError(_0x2aeee9,null));};exports[_0xa8f3('0x36')]=function(_0x16bf40,_0x540858){return db[_0xa8f3('0x23')][_0xa8f3('0x36')](_0x16bf40[_0xa8f3('0x37')],{})[_0xa8f3('0x1c')](respondWithResult(_0x540858,0xc9))['catch'](handleError(_0x540858,null));};exports[_0xa8f3('0x1b')]=function(_0x30ebeb,_0x2acf75){if(_0x30ebeb['body']['id']){delete _0x30ebeb[_0xa8f3('0x37')]['id'];}return db[_0xa8f3('0x23')]['find']({'where':{'id':_0x30ebeb['params']['id']}})[_0xa8f3('0x1c')](handleEntityNotFound(_0x2acf75,null))['then'](saveUpdates(_0x30ebeb[_0xa8f3('0x37')],null))[_0xa8f3('0x1c')](respondWithResult(_0x2acf75,null))[_0xa8f3('0x29')](handleError(_0x2acf75,null));};exports['destroy']=function(_0x97225c,_0x271fd7){return db[_0xa8f3('0x23')][_0xa8f3('0x35')]({'where':{'id':_0x97225c[_0xa8f3('0x38')]['id']}})[_0xa8f3('0x1c')](handleEntityNotFound(_0x271fd7,null))['then'](removeEntity(_0x271fd7,null))['catch'](handleError(_0x271fd7,null));};exports[_0xa8f3('0x39')]=function(_0xcb4360,_0x40b8b2){return db[_0xa8f3('0x23')]['describe']()[_0xa8f3('0x1c')](respondWithResult(_0x40b8b2,null))[_0xa8f3('0x29')](handleError(_0x40b8b2,null));};exports[_0xa8f3('0x3a')]=function(_0x16ad52,_0x161d69){return db[_0xa8f3('0x3b')][_0xa8f3('0x35')]({'where':{'id':_0x16ad52[_0xa8f3('0x38')]['id']}})[_0xa8f3('0x1c')](handleEntityNotFound(_0x161d69,null))[_0xa8f3('0x1c')](function(_0x3c48ff){if(_0x3c48ff){return _0x3c48ff[_0xa8f3('0x3a')](_0x16ad52[_0xa8f3('0x37')]['ids'],_[_0xa8f3('0x3c')](_0x16ad52['body'],[_0xa8f3('0x3d'),'id'])||{});}})[_0xa8f3('0x1c')](respondWithResult(_0x161d69,null))[_0xa8f3('0x29')](handleError(_0x161d69,null));};exports[_0xa8f3('0x3e')]=function(_0x25c7fa,_0x253363){var _0x443e17={'raw':![],'where':{}};var _0x569b51={};var _0x30b957={'count':0x0,'rows':[]};return db[_0xa8f3('0x23')][_0xa8f3('0x3f')]({'where':{'id':_0x25c7fa[_0xa8f3('0x38')]['id']}})[_0xa8f3('0x1c')](handleEntityNotFound(_0x253363,null))[_0xa8f3('0x1c')](function(_0x508cf1){if(_0x508cf1){_0x569b51[_0xa8f3('0x2f')]=_[_0xa8f3('0x2b')](db[_0xa8f3('0x3b')]['rawAttributes']);_0x569b51[_0xa8f3('0x27')]=_[_0xa8f3('0x2b')](_0x25c7fa[_0xa8f3('0x27')]);_0x569b51[_0xa8f3('0x2d')]=_[_0xa8f3('0x2e')](_0x569b51[_0xa8f3('0x2f')],_0x569b51[_0xa8f3('0x27')]);_0x443e17[_0xa8f3('0x30')]=_['intersection'](_0x569b51[_0xa8f3('0x2f')],qs[_0xa8f3('0x31')](_0x25c7fa[_0xa8f3('0x27')]['fields']));_0x443e17[_0xa8f3('0x30')]=_0x443e17[_0xa8f3('0x30')][_0xa8f3('0x32')]?_0x443e17[_0xa8f3('0x30')]:_0x569b51[_0xa8f3('0x2f')];if(!_0x25c7fa[_0xa8f3('0x27')][_0xa8f3('0x40')](_0xa8f3('0x41'))){_0x443e17[_0xa8f3('0x19')]=qs['limit'](_0x25c7fa[_0xa8f3('0x27')][_0xa8f3('0x19')]);_0x443e17['offset']=qs[_0xa8f3('0x17')](_0x25c7fa[_0xa8f3('0x27')][_0xa8f3('0x17')]);}_0x443e17[_0xa8f3('0x42')]=qs[_0xa8f3('0x43')](_0x25c7fa[_0xa8f3('0x27')][_0xa8f3('0x43')]);_0x443e17[_0xa8f3('0x44')]=qs[_0xa8f3('0x2d')](_[_0xa8f3('0x45')](_0x25c7fa['query'],_0x569b51[_0xa8f3('0x2d')]));_0x443e17[_0xa8f3('0x44')][_0xa8f3('0x46')]=_0x508cf1['id'];if(_0x25c7fa['query'][_0xa8f3('0x47')]){_0x443e17['where']=_[_0xa8f3('0x34')](_0x443e17['where'],{'$or':_[_0xa8f3('0x22')](_0x443e17['attributes'],function(_0x11b93f){var _0x234fd7={};_0x234fd7[_0x11b93f]={'$like':'%'+_0x25c7fa[_0xa8f3('0x27')][_0xa8f3('0x47')]+'%'};return _0x234fd7;})});}if(_0x25c7fa['query'][_0xa8f3('0x48')]){var _0x42dce7=_0x25c7fa[_0xa8f3('0x27')][_0xa8f3('0x48')]['split'](',');var _0x22e7a4={};_0x22e7a4[_0x42dce7[0x0]]={'$gte':moment(_0x42dce7[0x1])['format'](_0xa8f3('0x49'))};_0x443e17['where']=_['merge'](_0x443e17['where'],_0x22e7a4);}_0x443e17=_[_0xa8f3('0x34')]({},_0x443e17,_0x25c7fa[_0xa8f3('0x4a')]);return db[_0xa8f3('0x3b')]['count']({'where':_0x443e17[_0xa8f3('0x44')]})[_0xa8f3('0x1c')](function(_0x110823){_0x30b957['count']=_0x110823;if(_0x25c7fa[_0xa8f3('0x27')][_0xa8f3('0x33')]){_0x443e17['include']=[{'all':!![]}];}return db[_0xa8f3('0x3b')][_0xa8f3('0x26')](_0x443e17);})[_0xa8f3('0x1c')](function(_0x10e03b){_0x30b957[_0xa8f3('0x4b')]=_0x10e03b;return _0x30b957;});}})[_0xa8f3('0x1c')](respondWithFilteredResult(_0x253363,_0x443e17))[_0xa8f3('0x29')](handleError(_0x253363,null));};exports[_0xa8f3('0x4c')]=function(_0x3f0d1a,_0xe20550){return db['SmsInteraction'][_0xa8f3('0x35')]({'where':{'id':_0x3f0d1a[_0xa8f3('0x38')]['id']}})[_0xa8f3('0x1c')](handleEntityNotFound(_0xe20550,null))['then'](function(_0x43e7c2){if(_0x43e7c2){return _0x43e7c2[_0xa8f3('0x4d')](_0x3f0d1a[_0xa8f3('0x37')][_0xa8f3('0x3d')],_[_0xa8f3('0x3c')](_0x3f0d1a[_0xa8f3('0x37')],[_0xa8f3('0x3d'),'id'])||{})['spread'](function(){return db['Tag'][_0xa8f3('0x26')]({'attributes':['id',_0xa8f3('0x1f'),'color'],'where':{'id':_0x3f0d1a['body'][_0xa8f3('0x3d')]}});})[_0xa8f3('0x1c')](function(_0x16f232){socket[_0xa8f3('0x4e')]('smsInteractionTags:save',{'id':Number(_0x3f0d1a[_0xa8f3('0x38')]['id']),'tags':_0x16f232||[]});return{'id':Number(_0x3f0d1a[_0xa8f3('0x38')]['id']),'tags':_0x16f232||[]};});}})[_0xa8f3('0x1c')](respondWithResult(_0xe20550,null))[_0xa8f3('0x29')](handleError(_0xe20550,null));};exports[_0xa8f3('0x4f')]=function(_0x161511,_0x168575){return db[_0xa8f3('0x23')]['find']({'where':{'id':_0x161511['params']['id']}})[_0xa8f3('0x1c')](handleEntityNotFound(_0x168575,null))['then'](function(_0x1125ce){if(_0x1125ce){return _0x1125ce['removeTags'](_0x161511['query'][_0xa8f3('0x3d')]);}})[_0xa8f3('0x1c')](respondWithStatusCode(_0x168575,null))[_0xa8f3('0x29')](handleError(_0x168575,null));};exports[_0xa8f3('0x50')]=function(_0x4fb8d2,_0x1ea3d5){var _0x438802=moment()[_0xa8f3('0x51')]()['toString']();var _0x278bf5=path[_0xa8f3('0x52')](config['root'],_0xa8f3('0x53'),'files',_0xa8f3('0x54'));var _0x1df98f=path[_0xa8f3('0x52')](_0x278bf5,_0x438802);var _0x39814e=util[_0xa8f3('0x55')](_0xa8f3('0x56'),_0x4fb8d2[_0xa8f3('0x38')]['id'],_0x438802);var _0x538ca8=path[_0xa8f3('0x52')](_0x278bf5,_0x39814e);var _0x4d5f9d=[];_0x4d5f9d['push']({'model':db[_0xa8f3('0x57')],'as':_0xa8f3('0x57'),'attributes':['id',_0xa8f3('0x58')],'raw':!![]});_0x4d5f9d['push']({'model':db[_0xa8f3('0x59')],'as':_0xa8f3('0x5a'),'attributes':['id','firstName',_0xa8f3('0x5b')],'raw':!![]});var _0x49c630=[{'model':db[_0xa8f3('0x3b')],'as':'Messages','attributes':['id',_0xa8f3('0x37'),_0xa8f3('0x5c'),_0xa8f3('0x5d'),_0xa8f3('0x5e'),_0xa8f3('0x5f')],'include':_0x4d5f9d}];_0x49c630['push']({'model':db[_0xa8f3('0x60')],'as':'Account','attributes':['id',_0xa8f3('0x1f')]});_0x49c630[_0xa8f3('0x61')]({'model':db[_0xa8f3('0x57')],'as':_0xa8f3('0x62'),'attributes':['id','fullname']});return db[_0xa8f3('0x23')][_0xa8f3('0x35')]({'where':{'id':_0x4fb8d2[_0xa8f3('0x38')]['id']},'include':_0x49c630})[_0xa8f3('0x1c')](handleEntityNotFound(_0x1ea3d5,null))[_0xa8f3('0x1c')](function(_0x5086ae){if(_0x5086ae){var _0x25e3e2=_0x5086ae['get']({'plain':!![]});fs['mkdirSync'](_0x1df98f);var _0x24eeec={'channel':'Sms','account':_0x25e3e2[_0xa8f3('0x63')][_0xa8f3('0x1f')],'agent':_0x25e3e2[_0xa8f3('0x62')]?_0x25e3e2[_0xa8f3('0x62')]['fullname']:_0xa8f3('0x64'),'createdAt':moment(_0x25e3e2[_0xa8f3('0x5c')])[_0xa8f3('0x55')](_0xa8f3('0x49'))[_0xa8f3('0x65')](),'closedAt':_0x25e3e2['closed']?moment(_0x25e3e2[_0xa8f3('0x66')])[_0xa8f3('0x55')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa8f3('0x65')]():'','disposition':_0x25e3e2[_0xa8f3('0x67')],'messages':_(_0x25e3e2['Messages'])[_0xa8f3('0x47')]({'secret':![]})[_0xa8f3('0x22')](function(_0x2e42a1){return{'date':moment(_0x2e42a1[_0xa8f3('0x5c')])[_0xa8f3('0x55')](_0xa8f3('0x49'))[_0xa8f3('0x65')](),'sender':_0x2e42a1[_0xa8f3('0x5d')]===_0xa8f3('0x68')?_0x2e42a1[_0xa8f3('0x57')]?_0x2e42a1['User'][_0xa8f3('0x58')]:'System':_0x2e42a1[_0xa8f3('0x5a')][_0xa8f3('0x69')]+(_0x2e42a1[_0xa8f3('0x5a')][_0xa8f3('0x5b')]?'\x20'+_0x2e42a1['Contact']['lastName']:''),'body':_0x2e42a1[_0xa8f3('0x37')],'direction':_0x2e42a1[_0xa8f3('0x5d')]===_0xa8f3('0x68')?'A':'C','secret':_0x2e42a1[_0xa8f3('0x5e')],'read':_0x2e42a1[_0xa8f3('0x5f')]};})[_0xa8f3('0x6a')]()};return ejs[_0xa8f3('0x6b')](path[_0xa8f3('0x52')](config[_0xa8f3('0x6c')],_0xa8f3('0x53'),'views','downloadInteraction.ejs'),{'interaction':_0x24eeec})[_0xa8f3('0x1c')](function(_0x3af63d){var _0x14f030=path[_0xa8f3('0x52')](_0x1df98f,_0xa8f3('0x6d')+_0x25e3e2['id']+'-'+_0x438802+'.pdf');var _0x2a4f77={'path':_0x14f030,'channel':_0xa8f3('0x6e'),'interactionId':_0x25e3e2['id']};return pdf[_0xa8f3('0x6f')](_0x3af63d,_0x2a4f77);})[_0xa8f3('0x1c')](function(){return new BPromise(function(_0x2840e0,_0x2fb465){zipdir(_0x1df98f,{'saveTo':_0x538ca8},function(_0x376c3a,_0x3c6af0){if(_0x376c3a)return _0x2fb465(_0x376c3a);return _0x2840e0(_0x3c6af0);});})[_0xa8f3('0x1c')](function(){return new BPromise(function(_0x34ac07,_0x233268){rimraf(_0x1df98f,function(_0x4bbeaf){if(_0x4bbeaf)_0x233268(_0x4bbeaf);return _0x34ac07();});});})['then'](function(){return _0x1ea3d5[_0xa8f3('0x50')](_0x538ca8,_0x39814e,function(_0xfac4ad){if(_0xfac4ad){console['log'](_0xa8f3('0x70'),_0xfac4ad);}else{fs[_0xa8f3('0x71')](_0x538ca8);}});});});}else{return _0x1ea3d5['sendStatus'](0xc8);}})[_0xa8f3('0x29')](handleError(_0x1ea3d5,null));}; \ No newline at end of file +var _0x10f3=['SmsMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','where','count','rows','addTags','setTags','spread','Tag','color','removeTags','download','unix','toString','root','files','tmp','join','User','fullname','firstName','lastName','Messages','direction','secret','read','SmsAccount','Account','push','Owner','get','Sms','N.A.','createdAt','closedAt','disposition','System','Contact','out','value','renderFile','server','views','transcript-','.pdf','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','undefined','limit','offset','Content-Range','then','error','name','index','map','SmsInteraction','rawAttributes','fieldName','type','getOptions','findAll','sms','user','catch','show','params','keys','query','filters','model','attributes','intersection','fields','length','includeAll','merge','options','find','create','body','update','destroy','describe'];(function(_0x3b86df,_0x4111f1){var _0x21a1c5=function(_0x592dc5){while(--_0x592dc5){_0x3b86df['push'](_0x3b86df['shift']());}};_0x21a1c5(++_0x4111f1);}(_0x10f3,0xb1));var _0x310f=function(_0x433fed,_0x33e872){_0x433fed=_0x433fed-0x0;var _0x435cab=_0x10f3[_0x433fed];return _0x435cab;};'use strict';var rimraf=require(_0x310f('0x0'));var zipdir=require(_0x310f('0x1'));var moment=require(_0x310f('0x2'));var BPromise=require(_0x310f('0x3'));var util=require(_0x310f('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x310f('0x5'));var Redis=require('ioredis');var interaction=require(_0x310f('0x6'));var qs=require(_0x310f('0x7'));var pdf=require(_0x310f('0x8'));var logger=require(_0x310f('0x9'))('api');var config=require(_0x310f('0xa'));var db=require(_0x310f('0xb'))['db'];config['redis']=_[_0x310f('0xc')](config[_0x310f('0xd')],{'host':_0x310f('0xe'),'port':0x18eb});var socket=require(_0x310f('0xf'))(new Redis(config['redis']));require(_0x310f('0x10'))[_0x310f('0x11')](socket);function respondWithStatusCode(_0x4f3f14,_0x1235f1){_0x1235f1=_0x1235f1||0xcc;return function(_0x20b162){if(_0x20b162){return _0x4f3f14[_0x310f('0x12')](_0x1235f1);}return _0x4f3f14[_0x310f('0x13')](_0x1235f1)[_0x310f('0x14')]();};}function respondWithResult(_0x47fd2d,_0x1582d9){_0x1582d9=_0x1582d9||0xc8;return function(_0x2c328c){if(_0x2c328c){return _0x47fd2d[_0x310f('0x13')](_0x1582d9)[_0x310f('0x15')](_0x2c328c);}};}function respondWithFilteredResult(_0x4701e5,_0x554d42){return function(_0x1b4d2f){if(_0x1b4d2f){var _0x15291e=typeof _0x554d42['offset']===_0x310f('0x16')&&typeof _0x554d42[_0x310f('0x17')]==='undefined';var _0x2ba381=_0x1b4d2f['count'];var _0x51a4a2=_0x15291e?0x0:_0x554d42['offset'];var _0x145011=_0x15291e?_0x1b4d2f['count']:_0x554d42[_0x310f('0x18')]+_0x554d42['limit'];var _0x2927cf;if(_0x145011>=_0x2ba381){_0x145011=_0x2ba381;_0x2927cf=0xc8;}else{_0x2927cf=0xce;}_0x4701e5[_0x310f('0x13')](_0x2927cf);return _0x4701e5['set'](_0x310f('0x19'),_0x51a4a2+'-'+_0x145011+'/'+_0x2ba381)[_0x310f('0x15')](_0x1b4d2f);}return null;};}function saveUpdates(_0xdeabb5){return function(_0x44f395){if(_0x44f395){return _0x44f395['update'](_0xdeabb5)['then'](function(_0x4dbb9b){return _0x4dbb9b;});}return null;};}function removeEntity(_0x24f655){return function(_0x4491db){if(_0x4491db){return _0x4491db['destroy']()[_0x310f('0x1a')](function(){_0x24f655[_0x310f('0x13')](0xcc)[_0x310f('0x14')]();});}};}function handleEntityNotFound(_0xe7cf4a){return function(_0x52db69){if(!_0x52db69){_0xe7cf4a[_0x310f('0x12')](0x194);}return _0x52db69;};}function handleError(_0x240149,_0x10fadd){_0x10fadd=_0x10fadd||0x1f4;return function(_0x1170e5){logger[_0x310f('0x1b')](_0x1170e5['stack']);if(_0x1170e5[_0x310f('0x1c')]){delete _0x1170e5['name'];}_0x240149['status'](_0x10fadd)['send'](_0x1170e5);};}exports[_0x310f('0x1d')]=function(_0x224131,_0x6b5168){var _0x4ee1e7={};var _0x21c232=_[_0x310f('0x1e')](db[_0x310f('0x1f')][_0x310f('0x20')],function(_0xd721a4){return{'name':_0xd721a4[_0x310f('0x21')],'type':_0xd721a4[_0x310f('0x22')]['key']};});_0x4ee1e7=qs[_0x310f('0x23')](_0x21c232,_0x224131);return interaction[_0x310f('0x24')](_0x310f('0x25'),_0x224131['query'],_0x224131[_0x310f('0x26')],_0x4ee1e7,_0x21c232)['then'](respondWithFilteredResult(_0x6b5168,_0x4ee1e7))[_0x310f('0x27')](handleError(_0x6b5168,null));};exports[_0x310f('0x28')]=function(_0x864b1d,_0x1e2dc1){var _0x2a6d50={'raw':![],'where':{'id':_0x864b1d[_0x310f('0x29')]['id']}},_0x1fc920={};_0x1fc920['model']=_[_0x310f('0x2a')](db[_0x310f('0x1f')][_0x310f('0x20')]);_0x1fc920[_0x310f('0x2b')]=_['keys'](_0x864b1d['query']);_0x1fc920[_0x310f('0x2c')]=_['intersection'](_0x1fc920[_0x310f('0x2d')],_0x1fc920['query']);_0x2a6d50[_0x310f('0x2e')]=_[_0x310f('0x2f')](_0x1fc920[_0x310f('0x2d')],qs['fields'](_0x864b1d[_0x310f('0x2b')][_0x310f('0x30')]));_0x2a6d50[_0x310f('0x2e')]=_0x2a6d50[_0x310f('0x2e')][_0x310f('0x31')]?_0x2a6d50[_0x310f('0x2e')]:_0x1fc920[_0x310f('0x2d')];if(_0x864b1d['query'][_0x310f('0x32')]){_0x2a6d50['include']=[{'all':!![]}];}_0x2a6d50=_[_0x310f('0x33')]({},_0x2a6d50,_0x864b1d[_0x310f('0x34')]);return db[_0x310f('0x1f')][_0x310f('0x35')](_0x2a6d50)[_0x310f('0x1a')](handleEntityNotFound(_0x1e2dc1,null))['then'](respondWithResult(_0x1e2dc1,null))[_0x310f('0x27')](handleError(_0x1e2dc1,null));};exports[_0x310f('0x36')]=function(_0x48b9c7,_0x1d5509){return db[_0x310f('0x1f')][_0x310f('0x36')](_0x48b9c7[_0x310f('0x37')],{})[_0x310f('0x1a')](respondWithResult(_0x1d5509,0xc9))[_0x310f('0x27')](handleError(_0x1d5509,null));};exports[_0x310f('0x38')]=function(_0x7beb80,_0x40f3d7){if(_0x7beb80[_0x310f('0x37')]['id']){delete _0x7beb80[_0x310f('0x37')]['id'];}return db[_0x310f('0x1f')][_0x310f('0x35')]({'where':{'id':_0x7beb80['params']['id']}})[_0x310f('0x1a')](handleEntityNotFound(_0x40f3d7,null))[_0x310f('0x1a')](saveUpdates(_0x7beb80[_0x310f('0x37')],null))[_0x310f('0x1a')](respondWithResult(_0x40f3d7,null))[_0x310f('0x27')](handleError(_0x40f3d7,null));};exports[_0x310f('0x39')]=function(_0x45688c,_0x45b1c1){return db[_0x310f('0x1f')]['find']({'where':{'id':_0x45688c['params']['id']}})['then'](handleEntityNotFound(_0x45b1c1,null))[_0x310f('0x1a')](removeEntity(_0x45b1c1,null))['catch'](handleError(_0x45b1c1,null));};exports[_0x310f('0x3a')]=function(_0x506c0d,_0x4d11a0){return db[_0x310f('0x1f')][_0x310f('0x3a')]()['then'](respondWithResult(_0x4d11a0,null))[_0x310f('0x27')](handleError(_0x4d11a0,null));};exports['addMessage']=function(_0x2ed3af,_0x2d772d){return db[_0x310f('0x3b')][_0x310f('0x35')]({'where':{'id':_0x2ed3af[_0x310f('0x29')]['id']}})['then'](handleEntityNotFound(_0x2d772d,null))['then'](function(_0x43867c){if(_0x43867c){return _0x43867c[_0x310f('0x3c')](_0x2ed3af[_0x310f('0x37')][_0x310f('0x3d')],_[_0x310f('0x3e')](_0x2ed3af['body'],['ids','id'])||{});}})[_0x310f('0x1a')](respondWithResult(_0x2d772d,null))['catch'](handleError(_0x2d772d,null));};exports[_0x310f('0x3f')]=function(_0x184b10,_0x5979f5){var _0x53200b={'raw':![],'where':{}};var _0x2ac2ff={};var _0x599fe3={'count':0x0,'rows':[]};return db[_0x310f('0x1f')][_0x310f('0x40')]({'where':{'id':_0x184b10[_0x310f('0x29')]['id']}})[_0x310f('0x1a')](handleEntityNotFound(_0x5979f5,null))[_0x310f('0x1a')](function(_0x548c5d){if(_0x548c5d){_0x2ac2ff['model']=_['keys'](db['SmsMessage'][_0x310f('0x20')]);_0x2ac2ff[_0x310f('0x2b')]=_[_0x310f('0x2a')](_0x184b10[_0x310f('0x2b')]);_0x2ac2ff[_0x310f('0x2c')]=_[_0x310f('0x2f')](_0x2ac2ff['model'],_0x2ac2ff[_0x310f('0x2b')]);_0x53200b[_0x310f('0x2e')]=_[_0x310f('0x2f')](_0x2ac2ff['model'],qs[_0x310f('0x30')](_0x184b10[_0x310f('0x2b')][_0x310f('0x30')]));_0x53200b[_0x310f('0x2e')]=_0x53200b[_0x310f('0x2e')]['length']?_0x53200b[_0x310f('0x2e')]:_0x2ac2ff[_0x310f('0x2d')];if(!_0x184b10[_0x310f('0x2b')][_0x310f('0x41')](_0x310f('0x42'))){_0x53200b['limit']=qs[_0x310f('0x17')](_0x184b10[_0x310f('0x2b')][_0x310f('0x17')]);_0x53200b[_0x310f('0x18')]=qs[_0x310f('0x18')](_0x184b10[_0x310f('0x2b')][_0x310f('0x18')]);}_0x53200b[_0x310f('0x43')]=qs['sort'](_0x184b10[_0x310f('0x2b')][_0x310f('0x44')]);_0x53200b['where']=qs[_0x310f('0x2c')](_['pick'](_0x184b10['query'],_0x2ac2ff['filters']));_0x53200b['where']['SmsInteractionId']=_0x548c5d['id'];if(_0x184b10[_0x310f('0x2b')][_0x310f('0x45')]){_0x53200b['where']=_[_0x310f('0x33')](_0x53200b['where'],{'$or':_[_0x310f('0x1e')](_0x53200b[_0x310f('0x2e')],function(_0x8daaef){var _0x3502e9={};_0x3502e9[_0x8daaef]={'$like':'%'+_0x184b10[_0x310f('0x2b')][_0x310f('0x45')]+'%'};return _0x3502e9;})});}if(_0x184b10[_0x310f('0x2b')]['$gte']){var _0x5d1ac7=_0x184b10['query'][_0x310f('0x46')]['split'](',');var _0x1f996e={};_0x1f996e[_0x5d1ac7[0x0]]={'$gte':moment(_0x5d1ac7[0x1])[_0x310f('0x47')](_0x310f('0x48'))};_0x53200b['where']=_[_0x310f('0x33')](_0x53200b[_0x310f('0x49')],_0x1f996e);}_0x53200b=_[_0x310f('0x33')]({},_0x53200b,_0x184b10['options']);return db[_0x310f('0x3b')][_0x310f('0x4a')]({'where':_0x53200b['where']})[_0x310f('0x1a')](function(_0x53fc0b){_0x599fe3[_0x310f('0x4a')]=_0x53fc0b;if(_0x184b10['query']['includeAll']){_0x53200b['include']=[{'all':!![]}];}return db[_0x310f('0x3b')]['findAll'](_0x53200b);})[_0x310f('0x1a')](function(_0x2d50ab){_0x599fe3[_0x310f('0x4b')]=_0x2d50ab;return _0x599fe3;});}})[_0x310f('0x1a')](respondWithFilteredResult(_0x5979f5,_0x53200b))[_0x310f('0x27')](handleError(_0x5979f5,null));};exports[_0x310f('0x4c')]=function(_0x5a1280,_0x3226b9){return db['SmsInteraction'][_0x310f('0x35')]({'where':{'id':_0x5a1280['params']['id']}})[_0x310f('0x1a')](handleEntityNotFound(_0x3226b9,null))['then'](function(_0x578512){if(_0x578512){return _0x578512[_0x310f('0x4d')](_0x5a1280[_0x310f('0x37')][_0x310f('0x3d')],_['omit'](_0x5a1280[_0x310f('0x37')],[_0x310f('0x3d'),'id'])||{})[_0x310f('0x4e')](function(){return db[_0x310f('0x4f')][_0x310f('0x24')]({'attributes':['id',_0x310f('0x1c'),_0x310f('0x50')],'where':{'id':_0x5a1280[_0x310f('0x37')][_0x310f('0x3d')]}});})[_0x310f('0x1a')](function(_0x3b55db){socket['emit']('smsInteractionTags:save',{'id':Number(_0x5a1280[_0x310f('0x29')]['id']),'tags':_0x3b55db||[]});return{'id':Number(_0x5a1280[_0x310f('0x29')]['id']),'tags':_0x3b55db||[]};});}})[_0x310f('0x1a')](respondWithResult(_0x3226b9,null))[_0x310f('0x27')](handleError(_0x3226b9,null));};exports['removeTags']=function(_0x57d6e6,_0x52490b){return db['SmsInteraction'][_0x310f('0x35')]({'where':{'id':_0x57d6e6[_0x310f('0x29')]['id']}})['then'](handleEntityNotFound(_0x52490b,null))[_0x310f('0x1a')](function(_0x4f21da){if(_0x4f21da){return _0x4f21da[_0x310f('0x51')](_0x57d6e6[_0x310f('0x2b')][_0x310f('0x3d')]);}})[_0x310f('0x1a')](respondWithStatusCode(_0x52490b,null))[_0x310f('0x27')](handleError(_0x52490b,null));};exports[_0x310f('0x52')]=function(_0x376cf3,_0x1c2dc9){var _0x1ea025=moment()[_0x310f('0x53')]()[_0x310f('0x54')]();var _0x1c01a0=path['join'](config[_0x310f('0x55')],'server',_0x310f('0x56'),_0x310f('0x57'));var _0x4feccc=path['join'](_0x1c01a0,_0x1ea025);var _0x5d5c40=util[_0x310f('0x47')]('transcript-%d-%s.zip',_0x376cf3[_0x310f('0x29')]['id'],_0x1ea025);var _0x265599=path[_0x310f('0x58')](_0x1c01a0,_0x5d5c40);var _0x1db4b8=[];_0x1db4b8['push']({'model':db['User'],'as':_0x310f('0x59'),'attributes':['id',_0x310f('0x5a')],'raw':!![]});_0x1db4b8['push']({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x310f('0x5b'),_0x310f('0x5c')],'raw':!![]});var _0xa4eba=[{'model':db[_0x310f('0x3b')],'as':_0x310f('0x5d'),'attributes':['id',_0x310f('0x37'),'createdAt',_0x310f('0x5e'),_0x310f('0x5f'),_0x310f('0x60')],'include':_0x1db4b8}];_0xa4eba['push']({'model':db[_0x310f('0x61')],'as':_0x310f('0x62'),'attributes':['id',_0x310f('0x1c')]});_0xa4eba[_0x310f('0x63')]({'model':db[_0x310f('0x59')],'as':_0x310f('0x64'),'attributes':['id','fullname']});return db[_0x310f('0x1f')][_0x310f('0x35')]({'where':{'id':_0x376cf3['params']['id']},'include':_0xa4eba})[_0x310f('0x1a')](handleEntityNotFound(_0x1c2dc9,null))[_0x310f('0x1a')](function(_0x4ad0c9){if(_0x4ad0c9){var _0x54725b=_0x4ad0c9[_0x310f('0x65')]({'plain':!![]});fs['mkdirSync'](_0x4feccc);var _0x5ddd3f={'channel':_0x310f('0x66'),'account':_0x54725b[_0x310f('0x62')][_0x310f('0x1c')],'agent':_0x54725b['Owner']?_0x54725b[_0x310f('0x64')]['fullname']:_0x310f('0x67'),'createdAt':moment(_0x54725b[_0x310f('0x68')])['format'](_0x310f('0x48'))[_0x310f('0x54')](),'closedAt':_0x54725b['closed']?moment(_0x54725b[_0x310f('0x69')])['format'](_0x310f('0x48'))[_0x310f('0x54')]():'','disposition':_0x54725b[_0x310f('0x6a')],'messages':_(_0x54725b[_0x310f('0x5d')])['filter']({'secret':![]})['map'](function(_0x311d1d){return{'date':moment(_0x311d1d['createdAt'])[_0x310f('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0x310f('0x54')](),'sender':_0x311d1d['direction']==='out'?_0x311d1d[_0x310f('0x59')]?_0x311d1d[_0x310f('0x59')][_0x310f('0x5a')]:_0x310f('0x6b'):_0x311d1d['Contact'][_0x310f('0x5b')]+(_0x311d1d[_0x310f('0x6c')][_0x310f('0x5c')]?'\x20'+_0x311d1d['Contact'][_0x310f('0x5c')]:''),'body':_0x311d1d[_0x310f('0x37')],'direction':_0x311d1d[_0x310f('0x5e')]===_0x310f('0x6d')?'A':'C','secret':_0x311d1d[_0x310f('0x5f')],'read':_0x311d1d[_0x310f('0x60')]};})[_0x310f('0x6e')]()};return ejs[_0x310f('0x6f')](path[_0x310f('0x58')](config[_0x310f('0x55')],_0x310f('0x70'),_0x310f('0x71'),'downloadInteraction.ejs'),{'interaction':_0x5ddd3f})[_0x310f('0x1a')](function(_0x29cece){var _0x557cb7=path['join'](_0x4feccc,_0x310f('0x72')+_0x54725b['id']+'-'+_0x1ea025+_0x310f('0x73'));var _0x544c7e={'path':_0x557cb7,'channel':_0x310f('0x66'),'interactionId':_0x54725b['id']};return pdf['createPdfFromHTML'](_0x29cece,_0x544c7e);})['then'](function(){return new BPromise(function(_0x215d83,_0x419d84){zipdir(_0x4feccc,{'saveTo':_0x265599},function(_0x4b989e,_0x204243){if(_0x4b989e)return _0x419d84(_0x4b989e);return _0x215d83(_0x204243);});})['then'](function(){return new BPromise(function(_0x487f1b,_0x43c4fe){rimraf(_0x4feccc,function(_0x4903b0){if(_0x4903b0)_0x43c4fe(_0x4903b0);return _0x487f1b();});});})[_0x310f('0x1a')](function(){return _0x1c2dc9[_0x310f('0x52')](_0x265599,_0x5d5c40,function(_0x24b79b){if(_0x24b79b){console['log'](_0x310f('0x74'),_0x24b79b);}else{fs[_0x310f('0x75')](_0x265599);}});});});}else{return _0x1c2dc9[_0x310f('0x12')](0xc8);}})['catch'](handleError(_0x1c2dc9,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 3ddb95d..72d94bd 100644 --- a/server/api/smsInteraction/smsInteraction.events.js +++ b/server/api/smsInteraction/smsInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd4f=['setMaxListeners','update','remove','getUsers','then','Users','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook','exports','events','SmsMessage'];(function(_0x32f562,_0x4d4dd8){var _0x29ba85=function(_0x44f318){while(--_0x44f318){_0x32f562['push'](_0x32f562['shift']());}};_0x29ba85(++_0x4d4dd8);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x29156a,_0x4f04c4){_0x29156a=_0x29156a-0x0;var _0x53ad8c=_0xdd4f[_0x29156a];return _0x53ad8c;};'use strict';var EventEmitter=require(_0xfdd4('0x0'));var SmsInteraction=require('../../mysqldb')['db']['SmsInteraction'];var SmsMessage=require('../../mysqldb')['db'][_0xfdd4('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xfdd4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfdd4('0x3'),'afterDestroy':_0xfdd4('0x4')};function emitEvent(_0x6b2b0d){return function(_0x554e44,_0x398015,_0x43cbcf){_0x554e44[_0xfdd4('0x5')]({'attributes':['id'],'raw':!![]})[_0xfdd4('0x6')](function(_0x3c72d4){_0x554e44['setDataValue'](_0xfdd4('0x7'),_0x3c72d4['map'](function(_0x4181d6){return{'id':_0x4181d6['id']};}));return SmsMessage[_0xfdd4('0x8')]({'where':{'SmsInteractionId':_0x554e44['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfdd4('0x6')](function(_0x4ee02f){_0x554e44[_0xfdd4('0x9')]('unreadMessages',_0x4ee02f[_0xfdd4('0xa')]);SmsInteractionEvents[_0xfdd4('0xb')](_0x6b2b0d+':'+_0x554e44['id'],_0x554e44);SmsInteractionEvents[_0xfdd4('0xb')](_0x6b2b0d,_0x554e44);_0x43cbcf(null);})[_0xfdd4('0xc')](_0x43cbcf(null));};}for(var e in events){if(events[_0xfdd4('0xd')](e)){var event=events[e];SmsInteraction[_0xfdd4('0xe')](e,emitEvent(event));}}module[_0xfdd4('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0xadb5=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','SmsMessage','setMaxListeners'];(function(_0xcb8666,_0x49d6e9){var _0x56db39=function(_0x24620c){while(--_0x24620c){_0xcb8666['push'](_0xcb8666['shift']());}};_0x56db39(++_0x49d6e9);}(_0xadb5,0xad));var _0x5adb=function(_0x47c6de,_0x176a43){_0x47c6de=_0x47c6de-0x0;var _0x405b93=_0xadb5[_0x47c6de];return _0x405b93;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x5adb('0x0'))['db']['SmsInteraction'];var SmsMessage=require(_0x5adb('0x0'))['db'][_0x5adb('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x5adb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5adb('0x3'),'afterDestroy':_0x5adb('0x4')};function emitEvent(_0x2e3ef4){return function(_0x4cb1d1,_0x35a5d3,_0x168d89){_0x4cb1d1[_0x5adb('0x5')]({'attributes':['id'],'raw':!![]})[_0x5adb('0x6')](function(_0xdf3776){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0x8'),_0xdf3776[_0x5adb('0x9')](function(_0x41261c){return{'id':_0x41261c['id']};}));return SmsMessage[_0x5adb('0xa')]({'where':{'SmsInteractionId':_0x4cb1d1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5adb('0x6')](function(_0x336bad){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0xb'),_0x336bad['length']);SmsInteractionEvents['emit'](_0x2e3ef4+':'+_0x4cb1d1['id'],_0x4cb1d1);SmsInteractionEvents[_0x5adb('0xc')](_0x2e3ef4,_0x4cb1d1);_0x168d89(null);})[_0x5adb('0xd')](_0x168d89(null));};}for(var e in events){if(events[_0x5adb('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x5adb('0xf')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 42cf8d4..c62bb27 100644 --- a/server/api/smsInteraction/smsInteraction.model.js +++ b/server/api/smsInteraction/smsInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9931=['./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x9931,0x19d));var _0x1993=function(_0x5ddef2,_0x43c7c8){_0x5ddef2=_0x5ddef2-0x0;var _0x502902=_0x9931[_0x5ddef2];return _0x502902;};'use strict';var _=require(_0x1993('0x0'));var util=require(_0x1993('0x1'));var logger=require(_0x1993('0x2'))(_0x1993('0x3'));var moment=require('moment');var BPromise=require(_0x1993('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1993('0x5'));var config=require(_0x1993('0x6'));var attributes=require(_0x1993('0x7'));module[_0x1993('0x8')]=function(_0x31103a,_0x189373){return _0x31103a[_0x1993('0x9')](_0x1993('0xa'),attributes,{'tableName':_0x1993('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a5b83,_0x586e41,_0x3cd732){if(_0x5a5b83['changed']('closed')){_0x5a5b83['closedAt']=moment()[_0x1993('0xc')](_0x1993('0xd'));}_0x3cd732(null,_0x5a5b83);}}});}; \ No newline at end of file +var _0x8769=['define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./smsInteraction.attributes','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8769,0x104));var _0x9876=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x8769[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x9876('0x0'));var util=require(_0x9876('0x1'));var logger=require(_0x9876('0x2'))(_0x9876('0x3'));var moment=require(_0x9876('0x4'));var BPromise=require(_0x9876('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9876('0x6'));var rimraf=require(_0x9876('0x7'));var config=require('../../config/environment');var attributes=require(_0x9876('0x8'));module[_0x9876('0x9')]=function(_0xfa30a1,_0x3f98e0){return _0xfa30a1[_0x9876('0xa')](_0x9876('0xb'),attributes,{'tableName':_0x9876('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x24aebf,_0x2c6fea,_0x5de092){if(_0x24aebf[_0x9876('0xd')](_0x9876('0xe'))){_0x24aebf[_0x9876('0xf')]=moment()[_0x9876('0x10')](_0x9876('0x11'));}_0x5de092(null,_0x24aebf);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 988dcfe..32e9b20 100644 --- a/server/api/smsInteraction/smsInteraction.rpc.js +++ b/server/api/smsInteraction/smsInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f91=['attributes','limit','info','AddTagsToSmsInteraction','SmsInteraction','addTags','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateSmsInteraction','update','body','options'];(function(_0x813a92,_0x464efd){var _0x2bd26=function(_0x20704d){while(--_0x20704d){_0x813a92['push'](_0x813a92['shift']());}};_0x2bd26(++_0x464efd);}(_0x6f91,0xd6));var _0x16f9=function(_0x2d72ab,_0x5a97f5){_0x2d72ab=_0x2d72ab-0x0;var _0x256423=_0x6f91[_0x2d72ab];return _0x256423;};'use strict';var _=require(_0x16f9('0x0'));var util=require(_0x16f9('0x1'));var moment=require('moment');var BPromise=require(_0x16f9('0x2'));var rs=require(_0x16f9('0x3'));var fs=require('fs');var Redis=require(_0x16f9('0x4'));var db=require(_0x16f9('0x5'))['db'];var utils=require(_0x16f9('0x6'));var logger=require(_0x16f9('0x7'))(_0x16f9('0x8'));var config=require(_0x16f9('0x9'));var jayson=require(_0x16f9('0xa'));var client=jayson[_0x16f9('0xb')][_0x16f9('0xc')]({'port':0x232a});config[_0x16f9('0xd')]=_[_0x16f9('0xe')](config[_0x16f9('0xd')],{'host':_0x16f9('0xf'),'port':0x18eb});var socket=require(_0x16f9('0x10'))(new Redis(config[_0x16f9('0xd')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0xc16d03,_0x6048f,_0x429cf4){return new BPromise(function(_0x47b82b,_0xc842a2){return client[_0x16f9('0x11')](_0xc16d03,_0x429cf4)[_0x16f9('0x12')](function(_0x503f0f){logger['info'](_0x16f9('0x13'),_0x6048f,_0x16f9('0x14'));logger[_0x16f9('0x15')](_0x16f9('0x16'),_0x6048f,'request\x20sent',JSON[_0x16f9('0x17')](_0x503f0f));if(_0x503f0f[_0x16f9('0x18')]){if(_0x503f0f['error'][_0x16f9('0x19')]===0x1f4){logger['error'](_0x16f9('0x13'),_0x6048f,_0x503f0f[_0x16f9('0x18')][_0x16f9('0x1a')]);return _0xc842a2(_0x503f0f[_0x16f9('0x18')][_0x16f9('0x1a')]);}logger[_0x16f9('0x18')](_0x16f9('0x13'),_0x6048f,_0x503f0f[_0x16f9('0x18')][_0x16f9('0x1a')]);return _0x47b82b(_0x503f0f[_0x16f9('0x18')][_0x16f9('0x1a')]);}else{logger['info'](_0x16f9('0x13'),_0x6048f,_0x16f9('0x14'));_0x47b82b(_0x503f0f['result'][_0x16f9('0x1a')]);}})[_0x16f9('0x1b')](function(_0x1f4681){logger[_0x16f9('0x18')](_0x16f9('0x13'),_0x6048f,_0x1f4681);_0xc842a2(_0x1f4681);});});}exports[_0x16f9('0x1c')]=function(_0x10eae0){var _0x113712=this;return new Promise(function(_0x2a4913,_0x49932c){return db['SmsInteraction'][_0x16f9('0x1d')](_0x10eae0[_0x16f9('0x1e')],{'raw':_0x10eae0[_0x16f9('0x1f')]?_0x10eae0[_0x16f9('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10eae0[_0x16f9('0x1f')]?_0x10eae0['options']['where']||null:null,'attributes':_0x10eae0[_0x16f9('0x1f')]?_0x10eae0[_0x16f9('0x1f')][_0x16f9('0x20')]||null:null,'limit':_0x10eae0[_0x16f9('0x1f')]?_0x10eae0[_0x16f9('0x1f')][_0x16f9('0x21')]||null:null})['then'](function(_0x5f4116){logger[_0x16f9('0x22')](_0x16f9('0x1c'),_0x10eae0);logger[_0x16f9('0x15')](_0x16f9('0x1c'),_0x10eae0,JSON[_0x16f9('0x17')](_0x5f4116));_0x2a4913(_0x5f4116);})[_0x16f9('0x1b')](function(_0x23d07e){logger['error'](_0x16f9('0x1c'),_0x23d07e['message'],_0x10eae0);_0x49932c(_0x113712['error'](0x1f4,_0x23d07e[_0x16f9('0x1a')]));});});};exports[_0x16f9('0x23')]=function(_0x4c2255){return new Promise(function(_0x388a11,_0x435c9d){return db[_0x16f9('0x24')]['find']({'where':_0x4c2255['options']?_0x4c2255['options']['where']||null:null})[_0x16f9('0x12')](function(_0x5497e9){if(_0x5497e9){return _0x5497e9[_0x16f9('0x25')](_0x4c2255[_0x16f9('0x1e')][_0x16f9('0x26')],_['omit'](_0x4c2255['body'],[_0x16f9('0x26'),'id'])||{});}})[_0x16f9('0x27')](function(_0x989fa6){logger[_0x16f9('0x22')]('AddTags',_0x4c2255);logger[_0x16f9('0x15')](_0x16f9('0x28'),_0x4c2255,JSON['stringify'](_0x989fa6));_0x388a11(_0x989fa6);})[_0x16f9('0x1b')](function(_0x2dfaf0){logger[_0x16f9('0x18')](_0x16f9('0x28'),_0x2dfaf0[_0x16f9('0x1a')],_0x4c2255);_0x435c9d(_this[_0x16f9('0x18')](0x1f4,_0x2dfaf0[_0x16f9('0x1a')]));});});}; \ No newline at end of file +var _0x7132=['omit','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','then','addTags','ids'];(function(_0x10345e,_0x4f4ff4){var _0x19e40a=function(_0x23b7b1){while(--_0x23b7b1){_0x10345e['push'](_0x10345e['shift']());}};_0x19e40a(++_0x4f4ff4);}(_0x7132,0xc6));var _0x2713=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0x7132[_0x3cea78];return _0x33b66b;};'use strict';var _=require('lodash');var util=require(_0x2713('0x0'));var moment=require('moment');var BPromise=require(_0x2713('0x1'));var rs=require(_0x2713('0x2'));var fs=require('fs');var Redis=require(_0x2713('0x3'));var db=require(_0x2713('0x4'))['db'];var utils=require(_0x2713('0x5'));var logger=require(_0x2713('0x6'))('rpc');var config=require(_0x2713('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2713('0x8')][_0x2713('0x9')]({'port':0x232a});config[_0x2713('0xa')]=_[_0x2713('0xb')](config[_0x2713('0xa')],{'host':_0x2713('0xc'),'port':0x18eb});var socket=require(_0x2713('0xd'))(new Redis(config[_0x2713('0xa')]));require('./smsInteraction.socket')[_0x2713('0xe')](socket);function respondWithRpcPromise(_0x1e3caf,_0x382d26,_0x1a88b8){return new BPromise(function(_0x46fca5,_0x358e9b){return client[_0x2713('0xf')](_0x1e3caf,_0x1a88b8)['then'](function(_0x4599db){logger['info'](_0x2713('0x10'),_0x382d26,_0x2713('0x11'));logger[_0x2713('0x12')](_0x2713('0x13'),_0x382d26,_0x2713('0x11'),JSON[_0x2713('0x14')](_0x4599db));if(_0x4599db[_0x2713('0x15')]){if(_0x4599db[_0x2713('0x15')][_0x2713('0x16')]===0x1f4){logger['error'](_0x2713('0x10'),_0x382d26,_0x4599db[_0x2713('0x15')][_0x2713('0x17')]);return _0x358e9b(_0x4599db[_0x2713('0x15')][_0x2713('0x17')]);}logger[_0x2713('0x15')](_0x2713('0x10'),_0x382d26,_0x4599db[_0x2713('0x15')][_0x2713('0x17')]);return _0x46fca5(_0x4599db[_0x2713('0x15')]['message']);}else{logger[_0x2713('0x18')]('SmsInteraction,\x20%s,\x20%s',_0x382d26,'request\x20sent');_0x46fca5(_0x4599db[_0x2713('0x19')][_0x2713('0x17')]);}})[_0x2713('0x1a')](function(_0x9729b6){logger['error'](_0x2713('0x10'),_0x382d26,_0x9729b6);_0x358e9b(_0x9729b6);});});}exports[_0x2713('0x1b')]=function(_0x45619a){var _0x5b0a01=this;return new Promise(function(_0xebb05b,_0x333089){return db[_0x2713('0x1c')][_0x2713('0x1d')](_0x45619a[_0x2713('0x1e')],{'raw':_0x45619a[_0x2713('0x1f')]?_0x45619a[_0x2713('0x1f')][_0x2713('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45619a['options']?_0x45619a['options']['where']||null:null,'attributes':_0x45619a[_0x2713('0x1f')]?_0x45619a[_0x2713('0x1f')]['attributes']||null:null,'limit':_0x45619a[_0x2713('0x1f')]?_0x45619a['options']['limit']||null:null})[_0x2713('0x21')](function(_0x4c11b0){logger[_0x2713('0x18')](_0x2713('0x1b'),_0x45619a);logger[_0x2713('0x12')]('UpdateSmsInteraction',_0x45619a,JSON[_0x2713('0x14')](_0x4c11b0));_0xebb05b(_0x4c11b0);})['catch'](function(_0x4db178){logger[_0x2713('0x15')](_0x2713('0x1b'),_0x4db178[_0x2713('0x17')],_0x45619a);_0x333089(_0x5b0a01[_0x2713('0x15')](0x1f4,_0x4db178[_0x2713('0x17')]));});});};exports['AddTagsToSmsInteraction']=function(_0x5359f7){return new Promise(function(_0x3e409d,_0x1e37a2){return db[_0x2713('0x1c')]['find']({'where':_0x5359f7['options']?_0x5359f7[_0x2713('0x1f')]['where']||null:null})[_0x2713('0x21')](function(_0x3b9191){if(_0x3b9191){return _0x3b9191[_0x2713('0x22')](_0x5359f7[_0x2713('0x1e')][_0x2713('0x23')],_[_0x2713('0x24')](_0x5359f7[_0x2713('0x1e')],['ids','id'])||{});}})[_0x2713('0x25')](function(_0x35671a){logger[_0x2713('0x18')](_0x2713('0x26'),_0x5359f7);logger[_0x2713('0x12')](_0x2713('0x26'),_0x5359f7,JSON[_0x2713('0x14')](_0x35671a));_0x3e409d(_0x35671a);})[_0x2713('0x1a')](function(_0x21c1f5){logger[_0x2713('0x15')](_0x2713('0x26'),_0x21c1f5[_0x2713('0x17')],_0x5359f7);_0x1e37a2(_this[_0x2713('0x15')](0x1f4,_0x21c1f5[_0x2713('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index ba56cc6..055bde4 100644 --- a/server/api/smsInteraction/smsInteraction.socket.js +++ b/server/api/smsInteraction/smsInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f11=['update','emit','register','./smsInteraction.events','remove'];(function(_0x1b2fb8,_0x579a7d){var _0x576932=function(_0x320b0e){while(--_0x320b0e){_0x1b2fb8['push'](_0x1b2fb8['shift']());}};_0x576932(++_0x579a7d);}(_0x6f11,0xda));var _0x16f1=function(_0x2946c2,_0x4b07d7){_0x2946c2=_0x2946c2-0x0;var _0x5a4e52=_0x6f11[_0x2946c2];return _0x5a4e52;};'use strict';var SmsInteractionEvents=require(_0x16f1('0x0'));var events=['save',_0x16f1('0x1'),_0x16f1('0x2')];function createListener(_0x30072b,_0x4b8cda){return function(_0x21c955){_0x4b8cda[_0x16f1('0x3')](_0x30072b,_0x21c955);};}function removeListener(_0x1bdccd,_0x4fbae0){return function(){SmsInteractionEvents['removeListener'](_0x1bdccd,_0x4fbae0);};}exports[_0x16f1('0x4')]=function(_0x2dd2ec){for(var _0xab5bf0=0x0,_0x2efb62=events['length'];_0xab5bf0<_0x2efb62;_0xab5bf0++){var _0x33b7f0=events[_0xab5bf0];var _0x24853b=createListener('smsInteraction:'+_0x33b7f0,_0x2dd2ec);SmsInteractionEvents['on'](_0x33b7f0,_0x24853b);}}; \ No newline at end of file +var _0xe4bf=['save','remove','update','emit','register','length','smsInteraction:'];(function(_0x23c196,_0x5242ac){var _0x768c56=function(_0x1c258b){while(--_0x1c258b){_0x23c196['push'](_0x23c196['shift']());}};_0x768c56(++_0x5242ac);}(_0xe4bf,0x1dc));var _0xfe4b=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0xe4bf[_0x1406ae];return _0x23a076;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xfe4b('0x0'),_0xfe4b('0x1'),_0xfe4b('0x2')];function createListener(_0x3f30d4,_0x1adb0d){return function(_0x2a4481){_0x1adb0d[_0xfe4b('0x3')](_0x3f30d4,_0x2a4481);};}function removeListener(_0x3978d5,_0x4a05e8){return function(){SmsInteractionEvents['removeListener'](_0x3978d5,_0x4a05e8);};}exports[_0xfe4b('0x4')]=function(_0x2525dd){for(var _0x7e812=0x0,_0x250cf1=events[_0xfe4b('0x5')];_0x7e812<_0x250cf1;_0x7e812++){var _0x4dddb4=events[_0x7e812];var _0x26fbd0=createListener(_0xfe4b('0x6')+_0x4dddb4,_0x2525dd);SmsInteractionEvents['on'](_0x4dddb4,_0x26fbd0);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 15a81a8..a3c9fbe 100644 --- a/server/api/smsMessage/index.js +++ b/server/api/smsMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f34=['/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/:id','show','post','tracked','sms','/:id/status','status','update','put'];(function(_0x4137c0,_0x41d82e){var _0x59d01f=function(_0x4b80ed){while(--_0x4b80ed){_0x4137c0['push'](_0x4137c0['shift']());}};_0x59d01f(++_0x41d82e);}(_0x4f34,0xae));var _0x44f3=function(_0x34000d,_0x40af78){_0x34000d=_0x34000d-0x0;var _0x1661f3=_0x4f34[_0x34000d];return _0x1661f3;};'use strict';var multer=require(_0x44f3('0x0'));var util=require(_0x44f3('0x1'));var path=require(_0x44f3('0x2'));var timeout=require(_0x44f3('0x3'));var express=require(_0x44f3('0x4'));var router=express[_0x44f3('0x5')]();var fs_extra=require(_0x44f3('0x6'));var auth=require(_0x44f3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x44f3('0x8'));var controller=require(_0x44f3('0x9'));router[_0x44f3('0xa')]('/',auth[_0x44f3('0xb')](),controller[_0x44f3('0xc')]);router[_0x44f3('0xa')]('/describe',auth[_0x44f3('0xb')](),controller['describe']);router[_0x44f3('0xa')](_0x44f3('0xd'),auth[_0x44f3('0xb')](),controller[_0x44f3('0xe')]);router[_0x44f3('0xf')]('/',auth[_0x44f3('0xb')](),interaction[_0x44f3('0x10')](_0x44f3('0x11'),'smsmessage:create'),controller['create']);router['post'](_0x44f3('0x12'),controller[_0x44f3('0x13')]);router['put'](_0x44f3('0xd'),auth[_0x44f3('0xb')](),controller[_0x44f3('0x14')]);router[_0x44f3('0x15')](_0x44f3('0x16'),auth[_0x44f3('0xb')](),controller[_0x44f3('0x17')]);router['put'](_0x44f3('0x18'),auth[_0x44f3('0xb')](),controller['reject']);router[_0x44f3('0x19')](_0x44f3('0xd'),auth[_0x44f3('0xb')](),controller[_0x44f3('0x1a')]);module[_0x44f3('0x1b')]=router; \ No newline at end of file +var _0x0f6c=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','isAuthenticated','describe','show','post','tracked','smsmessage:create','status','put','/:id','update','accept','delete','destroy'];(function(_0x3f41da,_0x2b2a3d){var _0x3a7dee=function(_0x127528){while(--_0x127528){_0x3f41da['push'](_0x3f41da['shift']());}};_0x3a7dee(++_0x2b2a3d);}(_0x0f6c,0xe1));var _0xc0f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x0f6c[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0xc0f6('0x0'));var util=require('util');var path=require(_0xc0f6('0x1'));var timeout=require(_0xc0f6('0x2'));var express=require(_0xc0f6('0x3'));var router=express[_0xc0f6('0x4')]();var fs_extra=require(_0xc0f6('0x5'));var auth=require(_0xc0f6('0x6'));var interaction=require(_0xc0f6('0x7'));var config=require(_0xc0f6('0x8'));var controller=require(_0xc0f6('0x9'));router[_0xc0f6('0xa')]('/',auth['isAuthenticated'](),controller[_0xc0f6('0xb')]);router[_0xc0f6('0xa')]('/describe',auth[_0xc0f6('0xc')](),controller[_0xc0f6('0xd')]);router[_0xc0f6('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc0f6('0xe')]);router[_0xc0f6('0xf')]('/',auth[_0xc0f6('0xc')](),interaction[_0xc0f6('0x10')]('sms',_0xc0f6('0x11')),controller['create']);router[_0xc0f6('0xf')]('/:id/status',controller[_0xc0f6('0x12')]);router[_0xc0f6('0x13')](_0xc0f6('0x14'),auth[_0xc0f6('0xc')](),controller[_0xc0f6('0x15')]);router[_0xc0f6('0x13')]('/:id/accept',auth['isAuthenticated'](),controller[_0xc0f6('0x16')]);router[_0xc0f6('0x13')]('/:id/reject',auth[_0xc0f6('0xc')](),controller['reject']);router[_0xc0f6('0x17')](_0xc0f6('0x14'),auth[_0xc0f6('0xc')](),controller[_0xc0f6('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 917c7b1..49053b7 100644 --- a/server/api/smsMessage/smsMessage.attributes.js +++ b/server/api/smsMessage/smsMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3604=['DATE','exports','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x47a7dc,_0x560171){var _0x2cf138=function(_0x598784){while(--_0x598784){_0x47a7dc['push'](_0x47a7dc['shift']());}};_0x2cf138(++_0x560171);}(_0x3604,0x174));var _0x4360=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x3604[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require('sequelize');module[_0x4360('0x0')]={'body':{'type':Sequelize[_0x4360('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x4360('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4360('0x3')]('in',_0x4360('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x4360('0x5')](0xbe)},'phone':{'type':Sequelize[_0x4360('0x5')]},'readAt':{'type':Sequelize[_0x4360('0x6')]},'secret':{'type':Sequelize[_0x4360('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x4360('0x1')]}}; \ No newline at end of file +var _0xc213=['ENUM','out','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc213,0x19b));var _0x3c21=function(_0x4088f8,_0x104a54){_0x4088f8=_0x4088f8-0x0;var _0x159ef6=_0xc213[_0x4088f8];return _0x159ef6;};'use strict';var Sequelize=require(_0x3c21('0x0'));module[_0x3c21('0x1')]={'body':{'type':Sequelize[_0x3c21('0x2')](_0x3c21('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3c21('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3c21('0x5')]('in',_0x3c21('0x6')),'defaultValue':_0x3c21('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3c21('0x7')](0xbe)},'phone':{'type':Sequelize[_0x3c21('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x3c21('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3c21('0x7')]},'providerResponse':{'type':Sequelize[_0x3c21('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index eece974..068de12 100644 --- a/server/api/smsMessage/smsMessage.controller.js +++ b/server/api/smsMessage/smsMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15da=['SmsAccount,\x20%s,\x20%s,\x20%s','plivo','indexOf','Status','plivio','inspect','infobip','results','groupName','DELIVERED','rimraf','zip-dir','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','create','body','find','params','describe','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','interaction','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','email','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','internal','event','rejectmessage','SmsAccount','SmsAccountId','twilio','MessageSid','messageId'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x15da,0x98));var _0xa15d=function(_0x5a6f32,_0x58b204){_0x5a6f32=_0x5a6f32-0x0;var _0x18c961=_0x15da[_0x5a6f32];return _0x18c961;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa15d('0x0'));var zipdir=require(_0xa15d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa15d('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa15d('0x3'));var path=require(_0xa15d('0x4'));var sox=require(_0xa15d('0x5'));var csv=require(_0xa15d('0x6'));var ejs=require(_0xa15d('0x7'));var fs=require('fs');var fs_extra=require(_0xa15d('0x8'));var _=require(_0xa15d('0x9'));var squel=require('squel');var crypto=require(_0xa15d('0xa'));var jsforce=require(_0xa15d('0xb'));var deskjs=require(_0xa15d('0xc'));var toCsv=require(_0xa15d('0x6'));var querystring=require(_0xa15d('0xd'));var Papa=require(_0xa15d('0xe'));var Redis=require(_0xa15d('0xf'));var authService=require(_0xa15d('0x10'));var qs=require(_0xa15d('0x11'));var as=require(_0xa15d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa15d('0x13'))(_0xa15d('0x14'));var utils=require(_0xa15d('0x15'));var config=require(_0xa15d('0x16'));var licenseUtil=require(_0xa15d('0x17'));var db=require(_0xa15d('0x18'))['db'];config['redis']=_['defaults'](config[_0xa15d('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xa15d('0x1a'))(new Redis(config['redis']));require('./smsMessage.socket')[_0xa15d('0x1b')](socket);var jayson=require(_0xa15d('0x1c'));var client=jayson['client'][_0xa15d('0x1d')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x540865,_0x2b4845,_0x4a0bea,_0x1e32ac){return new BPromise(function(_0x14e95f,_0x21d678){var _0x45ebb0=_0x1e32ac||client;return _0x45ebb0[_0xa15d('0x1e')](_0x540865,_0x4a0bea)[_0xa15d('0x1f')](function(_0x2f1353){logger[_0xa15d('0x20')](_0xa15d('0x21'),_0x2b4845,'request\x20sent');logger[_0xa15d('0x22')](_0xa15d('0x23'),_0x2b4845,_0xa15d('0x24'),JSON['stringify'](_0x2f1353));if(_0x2f1353[_0xa15d('0x25')]){if(_0x2f1353[_0xa15d('0x25')]['code']===0x1f4){logger[_0xa15d('0x25')](_0xa15d('0x21'),_0x2b4845,_0x2f1353['error'][_0xa15d('0x26')]);return _0x21d678(_0x2f1353['error'][_0xa15d('0x26')]);}logger[_0xa15d('0x25')](_0xa15d('0x21'),_0x2b4845,_0x2f1353['error'][_0xa15d('0x26')]);return _0x14e95f(_0x2f1353['error'][_0xa15d('0x26')]);}else{logger[_0xa15d('0x20')](_0xa15d('0x21'),_0x2b4845,_0xa15d('0x24'));_0x14e95f(_0x2f1353[_0xa15d('0x27')]['message']);}})[_0xa15d('0x28')](function(_0x553025){logger[_0xa15d('0x25')](_0xa15d('0x21'),_0x2b4845,_0x553025);_0x21d678(_0x553025);});});}function respondWithStatusCode(_0x2cfe62,_0x9deb29){_0x9deb29=_0x9deb29||0xcc;return function(_0x39047d){if(_0x39047d){return _0x2cfe62['sendStatus'](_0x9deb29);}return _0x2cfe62[_0xa15d('0x29')](_0x9deb29)[_0xa15d('0x2a')]();};}function respondWithResult(_0x1fa4c1,_0x1f7e30){_0x1f7e30=_0x1f7e30||0xc8;return function(_0xce6c74){if(_0xce6c74){return _0x1fa4c1['status'](_0x1f7e30)[_0xa15d('0x2b')](_0xce6c74);}};}function respondWithFilteredResult(_0x26499e,_0x4edd0e){return function(_0x3a60ae){if(_0x3a60ae){var _0x150b08=typeof _0x4edd0e['offset']===_0xa15d('0x2c')&&typeof _0x4edd0e[_0xa15d('0x2d')]===_0xa15d('0x2c');var _0x3d54bd=_0x3a60ae['count'];var _0x32c593=_0x150b08?0x0:_0x4edd0e[_0xa15d('0x2e')];var _0x259ea9=_0x150b08?_0x3a60ae['count']:_0x4edd0e[_0xa15d('0x2e')]+_0x4edd0e[_0xa15d('0x2d')];var _0x5ba3a3;if(_0x259ea9>=_0x3d54bd){_0x259ea9=_0x3d54bd;_0x5ba3a3=0xc8;}else{_0x5ba3a3=0xce;}_0x26499e[_0xa15d('0x29')](_0x5ba3a3);return _0x26499e[_0xa15d('0x2f')](_0xa15d('0x30'),_0x32c593+'-'+_0x259ea9+'/'+_0x3d54bd)[_0xa15d('0x2b')](_0x3a60ae);}return null;};}function patchUpdates(_0x7d4dac){return function(_0x3a3bf5){try{jsonpatch[_0xa15d('0x31')](_0x3a3bf5,_0x7d4dac,!![]);}catch(_0x4810af){return BPromise[_0xa15d('0x32')](_0x4810af);}return _0x3a3bf5[_0xa15d('0x33')]();};}function saveUpdates(_0x5526c6,_0x197bd0){return function(_0x1ff3fb){if(_0x1ff3fb){return _0x1ff3fb[_0xa15d('0x34')](_0x5526c6)[_0xa15d('0x1f')](function(_0x3f15bd){return _0x3f15bd;});}return null;};}function removeEntity(_0x17225c,_0x38c782){return function(_0x4481bd){if(_0x4481bd){return _0x4481bd[_0xa15d('0x35')]()['then'](function(){_0x17225c[_0xa15d('0x29')](0xcc)[_0xa15d('0x2a')]();});}};}function handleEntityNotFound(_0x5cdb2b,_0x401144){return function(_0xe9e81d){if(!_0xe9e81d){_0x5cdb2b[_0xa15d('0x36')](0x194);}return _0xe9e81d;};}function handleError(_0x570c50,_0x9e57a7){_0x9e57a7=_0x9e57a7||0x1f4;return function(_0x35182c){logger[_0xa15d('0x25')](_0x35182c['stack']);if(_0x35182c[_0xa15d('0x37')]){delete _0x35182c[_0xa15d('0x37')];}_0x570c50[_0xa15d('0x29')](_0x9e57a7)[_0xa15d('0x38')](_0x35182c);};}exports[_0xa15d('0x39')]=function(_0x15d84b,_0x1a7d3f){var _0x198b89={},_0x3d3ee2={},_0x641cec={'count':0x0,'rows':[]};var _0x2bbbb2=_[_0xa15d('0x3a')](db[_0xa15d('0x3b')][_0xa15d('0x3c')],function(_0x5a1edb){return{'name':_0x5a1edb[_0xa15d('0x3d')],'type':_0x5a1edb[_0xa15d('0x3e')][_0xa15d('0x3f')]};});_0x3d3ee2[_0xa15d('0x40')]=_[_0xa15d('0x3a')](_0x2bbbb2,_0xa15d('0x37'));_0x3d3ee2['query']=_[_0xa15d('0x41')](_0x15d84b[_0xa15d('0x42')]);_0x3d3ee2[_0xa15d('0x43')]=_[_0xa15d('0x44')](_0x3d3ee2['model'],_0x3d3ee2[_0xa15d('0x42')]);_0x198b89[_0xa15d('0x45')]=_[_0xa15d('0x44')](_0x3d3ee2['model'],qs[_0xa15d('0x46')](_0x15d84b[_0xa15d('0x42')][_0xa15d('0x46')]));_0x198b89[_0xa15d('0x45')]=_0x198b89[_0xa15d('0x45')][_0xa15d('0x47')]?_0x198b89[_0xa15d('0x45')]:_0x3d3ee2[_0xa15d('0x40')];if(!_0x15d84b[_0xa15d('0x42')][_0xa15d('0x48')](_0xa15d('0x49'))){_0x198b89['limit']=qs['limit'](_0x15d84b['query'][_0xa15d('0x2d')]);_0x198b89[_0xa15d('0x2e')]=qs['offset'](_0x15d84b[_0xa15d('0x42')]['offset']);}_0x198b89[_0xa15d('0x4a')]=qs['sort'](_0x15d84b['query'][_0xa15d('0x4b')]);_0x198b89[_0xa15d('0x4c')]=qs[_0xa15d('0x43')](_[_0xa15d('0x4d')](_0x15d84b[_0xa15d('0x42')],_0x3d3ee2['filters']),_0x2bbbb2);if(_0x15d84b[_0xa15d('0x42')][_0xa15d('0x4e')]){_0x198b89[_0xa15d('0x4c')]=_['merge'](_0x198b89[_0xa15d('0x4c')],{'$or':_[_0xa15d('0x3a')](_0x2bbbb2,function(_0x2e8098){if(_0x2e8098[_0xa15d('0x3e')]!=='VIRTUAL'){var _0x4a4c1c={};_0x4a4c1c[_0x2e8098['name']]={'$like':'%'+_0x15d84b[_0xa15d('0x42')][_0xa15d('0x4e')]+'%'};return _0x4a4c1c;}})});}_0x198b89=_[_0xa15d('0x4f')]({},_0x198b89,_0x15d84b[_0xa15d('0x50')]);var _0x308cfc={'where':_0x198b89['where']};return db[_0xa15d('0x3b')][_0xa15d('0x51')](_0x308cfc)[_0xa15d('0x1f')](function(_0x9bbd6d){_0x641cec['count']=_0x9bbd6d;if(_0x15d84b[_0xa15d('0x42')][_0xa15d('0x52')]){_0x198b89[_0xa15d('0x53')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x198b89);})['then'](function(_0x2a8dcb){_0x641cec['rows']=_0x2a8dcb;return _0x641cec;})[_0xa15d('0x1f')](respondWithFilteredResult(_0x1a7d3f,_0x198b89))[_0xa15d('0x28')](handleError(_0x1a7d3f,null));};exports['show']=function(_0x34813f,_0x430ed5){var _0x37b905={'raw':!![],'where':{'id':_0x34813f['params']['id']}},_0x12632d={};_0x12632d[_0xa15d('0x40')]=_['keys'](db[_0xa15d('0x3b')][_0xa15d('0x3c')]);_0x12632d[_0xa15d('0x42')]=_[_0xa15d('0x41')](_0x34813f['query']);_0x12632d[_0xa15d('0x43')]=_['intersection'](_0x12632d['model'],_0x12632d[_0xa15d('0x42')]);_0x37b905[_0xa15d('0x45')]=_[_0xa15d('0x44')](_0x12632d[_0xa15d('0x40')],qs[_0xa15d('0x46')](_0x34813f[_0xa15d('0x42')][_0xa15d('0x46')]));_0x37b905[_0xa15d('0x45')]=_0x37b905[_0xa15d('0x45')]['length']?_0x37b905[_0xa15d('0x45')]:_0x12632d['model'];if(_0x34813f[_0xa15d('0x42')][_0xa15d('0x52')]){_0x37b905[_0xa15d('0x53')]=[{'all':!![]}];}_0x37b905=_[_0xa15d('0x4f')]({},_0x37b905,_0x34813f['options']);return db[_0xa15d('0x3b')]['find'](_0x37b905)['then'](handleEntityNotFound(_0x430ed5,null))[_0xa15d('0x1f')](respondWithResult(_0x430ed5,null))[_0xa15d('0x28')](handleError(_0x430ed5,null));};exports[_0xa15d('0x54')]=function(_0x575963,_0x1995fd){return db['SmsMessage'][_0xa15d('0x54')](_0x575963[_0xa15d('0x55')],{})[_0xa15d('0x1f')](respondWithResult(_0x1995fd,0xc9))['catch'](handleError(_0x1995fd,null));};exports['update']=function(_0x570500,_0x26181c){if(_0x570500['body']['id']){delete _0x570500[_0xa15d('0x55')]['id'];}return db[_0xa15d('0x3b')][_0xa15d('0x56')]({'where':{'id':_0x570500[_0xa15d('0x57')]['id']}})[_0xa15d('0x1f')](handleEntityNotFound(_0x26181c,null))[_0xa15d('0x1f')](saveUpdates(_0x570500[_0xa15d('0x55')],null))[_0xa15d('0x1f')](respondWithResult(_0x26181c,null))[_0xa15d('0x28')](handleError(_0x26181c,null));};exports[_0xa15d('0x35')]=function(_0x57e250,_0x101a6c){return db[_0xa15d('0x3b')][_0xa15d('0x56')]({'where':{'id':_0x57e250['params']['id']}})[_0xa15d('0x1f')](handleEntityNotFound(_0x101a6c,null))[_0xa15d('0x1f')](removeEntity(_0x101a6c,null))[_0xa15d('0x28')](handleError(_0x101a6c,null));};exports['describe']=function(_0x4ae081,_0x14fbb7){return db[_0xa15d('0x3b')][_0xa15d('0x58')]()['then'](respondWithResult(_0x14fbb7,null))[_0xa15d('0x28')](handleError(_0x14fbb7,null));};var interaction_log=require(_0xa15d('0x13'))('sms-interactions');exports[_0xa15d('0x59')]=function(_0xf54fc,_0xbe32e0,_0x394cb6){var _0x427e71={'agent':{},'channel':_0xa15d('0x5a')};if(_0xf54fc[_0xa15d('0x55')]['id']){delete _0xf54fc[_0xa15d('0x55')]['id'];}_0xf54fc[_0xa15d('0x55')][_0xa15d('0x5b')]=!![];_0xf54fc[_0xa15d('0x55')]['readAt']=moment()[_0xa15d('0x5c')](_0xa15d('0x5d'));_0xf54fc['body'][_0xa15d('0x5e')]=_0xf54fc[_0xa15d('0x55')]['UserId']||_0xf54fc[_0xa15d('0x5f')]['id'];_0x427e71[_0xa15d('0x60')]['id']=_0xf54fc[_0xa15d('0x55')][_0xa15d('0x5e')];return db[_0xa15d('0x3b')][_0xa15d('0x56')]({'where':{'id':_0xf54fc[_0xa15d('0x57')]['id'],'UserId':null}})[_0xa15d('0x1f')](handleEntityNotFound(_0xbe32e0,null))['then'](saveUpdates(_0xf54fc['body'],null))[_0xa15d('0x1f')](function(_0x4bd56f){if(_0x4bd56f){_0x427e71[_0xa15d('0x26')]=_0x4bd56f[_0xa15d('0x61')]({'plain':!![]});return db[_0xa15d('0x62')][_0xa15d('0x56')]({'where':{'id':_0x4bd56f[_0xa15d('0x63')]}});}return null;})[_0xa15d('0x1f')](handleEntityNotFound(_0xbe32e0,null))['then'](function(_0x17ceb3){if(_0x17ceb3){return _0x17ceb3[_0xa15d('0x34')]({'UserId':_0xf54fc['body'][_0xa15d('0x5e')],'read1stAt':_['isNil'](_0x17ceb3['read1stAt'])?moment()[_0xa15d('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xa15d('0x1f')](function(_0x5705fb){if(_0x5705fb){_0x427e71[_0xa15d('0x64')]=_0x5705fb[_0xa15d('0x61')]({'plain':!![]});interaction_log[_0xa15d('0x20')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xf54fc[_0xa15d('0x5f')]['id'],_0xf54fc[_0xa15d('0x5f')][_0xa15d('0x37')],_0xf54fc['user']['role'],_0x427e71['interaction']['id'],_0xf54fc['body']?JSON[_0xa15d('0x65')](_0xf54fc[_0xa15d('0x55')]):_0xa15d('0x66'));return respondWithRpcPromise(_0xa15d('0x67'),'acceptMessage',_0x427e71);}return null;})[_0xa15d('0x1f')](function(_0x44c448){var _0x1a140f=_0xa15d('0x68')+_0x44c448[_0xa15d('0x26')][_0xa15d('0x69')];return db[_0xa15d('0x6a')][_0xa15d('0x42')](_0x1a140f,{'type':db['Sequelize'][_0xa15d('0x6b')][_0xa15d('0x6c')],'raw':!![]})['then'](function(_0x2c4da5){return _0x2c4da5;});})[_0xa15d('0x1f')](function(_0x542d58){if(_0x542d58){_0x427e71[_0xa15d('0x26')][_0xa15d('0x6d')]=_0x542d58[0x0];if(!_0xf54fc[_0xa15d('0x55')][_0xa15d('0x5e')])return;return db['User'][_0xa15d('0x56')]({'where':{'id':_0xf54fc[_0xa15d('0x55')][_0xa15d('0x5e')],'role':_0xa15d('0x60')},'attributes':['id','name',_0xa15d('0x6e'),_0xa15d('0x6f'),'internal'],'raw':!![]});}return null;})[_0xa15d('0x1f')](function(_0x405a7a){if(!_0x405a7a)return null;_0x427e71['message'][_0xa15d('0x60')]=_0x405a7a;return _0x427e71;})[_0xa15d('0x1f')](function(_0x5384af){if(_0x5384af){if(_0xf54fc[_0xa15d('0x55')][_0xa15d('0x70')]){_0x427e71[_0xa15d('0x26')][_0xa15d('0x71')]=util['format'](_0xa15d('0x72'),_0xf54fc[_0xa15d('0x5f')][_0xa15d('0x37')]);_0x427e71[_0xa15d('0x26')][_0xa15d('0x73')]=_0x427e71[_0xa15d('0x73')];_0x427e71[_0xa15d('0x26')][_0xa15d('0x74')]=_0x427e71[_0xa15d('0x73')];_0x427e71[_0xa15d('0x26')]['event']=_0xa15d('0x59');return respondWithRpcPromise(_0xa15d('0x75'),_0xa15d('0x75'),{'event':_0xa15d('0x76'),'message':_0x427e71[_0xa15d('0x26')]},client9002)[_0xa15d('0x1f')](function(){return _0x427e71;});}return _0x427e71;}return null;})[_0xa15d('0x1f')](respondWithResult(_0xbe32e0,null))['catch'](handleError(_0xbe32e0,null));};var interaction_log=require(_0xa15d('0x13'))(_0xa15d('0x77'));exports[_0xa15d('0x32')]=function(_0x4eac72,_0x3313f4,_0x51b915){var _0x357132={'agent':{},'channel':_0xa15d('0x5a')};if(_0x4eac72['body']['id']){delete _0x4eac72[_0xa15d('0x55')]['id'];}_0x4eac72[_0xa15d('0x55')][_0xa15d('0x5e')]=_0x4eac72[_0xa15d('0x55')][_0xa15d('0x5e')]||_0x4eac72['user']['id'];_0x357132[_0xa15d('0x60')]['id']=_0x4eac72[_0xa15d('0x55')][_0xa15d('0x5e')];return db[_0xa15d('0x3b')][_0xa15d('0x56')]({'where':{'id':_0x4eac72[_0xa15d('0x57')]['id'],'UserId':null}})[_0xa15d('0x1f')](handleEntityNotFound(_0x3313f4,null))[_0xa15d('0x1f')](function(_0x33f9b3){if(_0x33f9b3){_0x357132['message']=_0x33f9b3['get']({'plain':!![]});return db[_0xa15d('0x62')]['find']({'where':{'id':_0x33f9b3[_0xa15d('0x63')]}});}return null;})[_0xa15d('0x1f')](handleEntityNotFound(_0x3313f4,null))[_0xa15d('0x1f')](function(_0x34003d){if(_0x34003d){_0x357132['interaction']=_0x34003d[_0xa15d('0x61')]({'plain':!![]});interaction_log['info'](_0xa15d('0x78'),_0x4eac72[_0xa15d('0x5f')]['id'],_0x4eac72[_0xa15d('0x5f')][_0xa15d('0x37')],_0x4eac72['user']['role'],_0x357132[_0xa15d('0x64')]['id'],_0x4eac72['body']?JSON[_0xa15d('0x65')](_0x4eac72[_0xa15d('0x55')]):_0xa15d('0x66'));return respondWithRpcPromise(_0xa15d('0x79'),_0xa15d('0x7a'),_0x357132);}return null;})[_0xa15d('0x1f')](function(_0x20276b){var _0x10f85e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x20276b['message']['ContactId'];return db['sequelize'][_0xa15d('0x42')](_0x10f85e,{'type':db['Sequelize'][_0xa15d('0x6b')]['SELECT'],'raw':!![]})['then'](function(_0x33fcc6){return _0x33fcc6;});})['then'](function(_0x59527c){if(_0x59527c){_0x357132[_0xa15d('0x26')][_0xa15d('0x6d')]=_0x59527c[0x0];if(!_0x4eac72['body'][_0xa15d('0x5e')])return;return db[_0xa15d('0x7b')][_0xa15d('0x56')]({'where':{'id':_0x4eac72['body'][_0xa15d('0x5e')],'role':'agent'},'attributes':['id',_0xa15d('0x37'),_0xa15d('0x6e'),'email',_0xa15d('0x7c')],'raw':!![]});}return null;})[_0xa15d('0x1f')](function(_0x39f0e7){if(!_0x39f0e7)return null;_0x357132[_0xa15d('0x26')][_0xa15d('0x60')]=_0x39f0e7;return _0x357132;})[_0xa15d('0x1f')](function(_0x10f000){if(_0x10f000){_0x10f000[_0xa15d('0x26')][_0xa15d('0x71')]=util['format'](_0xa15d('0x72'),_0x4eac72[_0xa15d('0x5f')]['name']);_0x10f000[_0xa15d('0x26')][_0xa15d('0x73')]=_0x357132[_0xa15d('0x73')];_0x10f000[_0xa15d('0x26')][_0xa15d('0x74')]=_0x357132[_0xa15d('0x73')];_0x10f000['message'][_0xa15d('0x7d')]=_0xa15d('0x32');respondWithRpcPromise(_0xa15d('0x75'),_0xa15d('0x75'),{'event':_0xa15d('0x7e'),'message':_0x10f000[_0xa15d('0x26')]},client9002);return _0x357132;}return null;})[_0xa15d('0x1f')](respondWithResult(_0x3313f4,null))[_0xa15d('0x28')](handleError(_0x3313f4,null));};exports['status']=function(_0x3bc328,_0x434888,_0x3d1f94){if(_0x3bc328['body']['id']){delete _0x3bc328[_0xa15d('0x55')]['id'];}var _0x2def71;return db[_0xa15d('0x3b')][_0xa15d('0x56')]({'where':{'id':_0x3bc328[_0xa15d('0x57')]['id']}})[_0xa15d('0x1f')](handleEntityNotFound(_0x434888,null))[_0xa15d('0x1f')](function(_0x3e3fc3){if(_0x3e3fc3){_0x2def71=_0x3e3fc3;return db[_0xa15d('0x7f')][_0xa15d('0x56')]({'where':{'id':_0x3e3fc3[_0xa15d('0x80')]}});}})[_0xa15d('0x1f')](handleEntityNotFound(_0x434888,null))[_0xa15d('0x1f')](function(_0x37bc7b){if(_0x37bc7b){logger[_0xa15d('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa15d('0x29'),'received\x20delivery\x20report\x20from',_0x37bc7b[_0xa15d('0x3e')],util['inspect'](_0x3bc328[_0xa15d('0x55')],{'showHidden':![],'depth':null}));switch(_0x37bc7b[_0xa15d('0x3e')]){case _0xa15d('0x81'):if(_0x3bc328[_0xa15d('0x55')][_0xa15d('0x82')]&&_0x3bc328[_0xa15d('0x55')]['MessageSid']===_0x2def71[_0xa15d('0x83')]){return _0x2def71[_0xa15d('0x34')]({'read':!![]});}else{logger[_0xa15d('0x25')](_0xa15d('0x84'),_0xa15d('0x29'),_0xa15d('0x81'),util['inspect'](_0x3bc328['body'],{'showHidden':![],'depth':null}));}break;case _0xa15d('0x85'):if(_0x3bc328['body']['MessageUUID']&&_0x3bc328['body']['MessageUUID']===_0x2def71['messageId']&&_[_0xa15d('0x86')](['sent','delivered'],_0x3bc328[_0xa15d('0x55')][_0xa15d('0x87')])>=0x0){return _0x2def71[_0xa15d('0x34')]({'read':!![]});}else{logger[_0xa15d('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa15d('0x29'),_0xa15d('0x88'),util[_0xa15d('0x89')](_0x3bc328['body'],{'showHidden':![],'depth':null}));}break;case _0xa15d('0x8a'):var _0x452158=_0x3bc328[_0xa15d('0x55')][_0xa15d('0x8b')][0x0];if(_0x452158[_0xa15d('0x29')][_0xa15d('0x8c')]===_0xa15d('0x8d')){return _0x2def71['update']({'read':!![]});}else{logger[_0xa15d('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa15d('0x29'),_0xa15d('0x8a'),util[_0xa15d('0x89')](_0x3bc328[_0xa15d('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x2def71;}})[_0xa15d('0x1f')](respondWithResult(_0x434888,null))[_0xa15d('0x28')](handleError(_0x434888,null));}; \ No newline at end of file +var _0x1867=['fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','sms-interactions','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','Sequelize','contact','email','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','delivered','Status','plivio','infobip','results','groupName','DELIVERED','inspect','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','SmsMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','name','index','SmsMessage','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','find','body','params','destroy','describe','accept','sms','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','get','role','interaction','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User'];(function(_0x585310,_0x536d07){var _0xa454d3=function(_0x2624f1){while(--_0x2624f1){_0x585310['push'](_0x585310['shift']());}};_0xa454d3(++_0x536d07);}(_0x1867,0xb5));var _0x7186=function(_0x485a5b,_0x1a03a5){_0x485a5b=_0x485a5b-0x0;var _0x3d99c4=_0x1867[_0x485a5b];return _0x3d99c4;};'use strict';var emlformat=require(_0x7186('0x0'));var rimraf=require(_0x7186('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7186('0x2'));var rp=require('request-promise');var moment=require(_0x7186('0x3'));var BPromise=require(_0x7186('0x4'));var Mustache=require(_0x7186('0x5'));var util=require(_0x7186('0x6'));var path=require(_0x7186('0x7'));var sox=require(_0x7186('0x8'));var csv=require(_0x7186('0x9'));var ejs=require(_0x7186('0xa'));var fs=require('fs');var fs_extra=require(_0x7186('0xb'));var _=require('lodash');var squel=require(_0x7186('0xc'));var crypto=require(_0x7186('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7186('0xe'));var toCsv=require(_0x7186('0x9'));var querystring=require(_0x7186('0xf'));var Papa=require(_0x7186('0x10'));var Redis=require('ioredis');var authService=require(_0x7186('0x11'));var qs=require(_0x7186('0x12'));var as=require(_0x7186('0x13'));var hardwareService=require(_0x7186('0x14'));var logger=require(_0x7186('0x15'))('api');var utils=require(_0x7186('0x16'));var config=require(_0x7186('0x17'));var licenseUtil=require(_0x7186('0x18'));var db=require(_0x7186('0x19'))['db'];config['redis']=_[_0x7186('0x1a')](config[_0x7186('0x1b')],{'host':_0x7186('0x1c'),'port':0x18eb});var socket=require(_0x7186('0x1d'))(new Redis(config['redis']));require('./smsMessage.socket')['register'](socket);var jayson=require(_0x7186('0x1e'));var client=jayson[_0x7186('0x1f')][_0x7186('0x20')]({'port':0x232c});var client9002=jayson[_0x7186('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a8de4,_0x1cc347,_0x915126,_0x396e13){return new BPromise(function(_0x6508f5,_0x332bfd){var _0x38524d=_0x396e13||client;return _0x38524d[_0x7186('0x21')](_0x2a8de4,_0x915126)['then'](function(_0x24a877){logger[_0x7186('0x22')]('SmsMessage,\x20%s,\x20%s',_0x1cc347,_0x7186('0x23'));logger[_0x7186('0x24')](_0x7186('0x25'),_0x1cc347,'request\x20sent',JSON['stringify'](_0x24a877));if(_0x24a877[_0x7186('0x26')]){if(_0x24a877['error'][_0x7186('0x27')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x1cc347,_0x24a877['error'][_0x7186('0x28')]);return _0x332bfd(_0x24a877[_0x7186('0x26')]['message']);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x1cc347,_0x24a877['error'][_0x7186('0x28')]);return _0x6508f5(_0x24a877[_0x7186('0x26')][_0x7186('0x28')]);}else{logger['info'](_0x7186('0x29'),_0x1cc347,_0x7186('0x23'));_0x6508f5(_0x24a877[_0x7186('0x2a')][_0x7186('0x28')]);}})[_0x7186('0x2b')](function(_0x52aecc){logger[_0x7186('0x26')](_0x7186('0x29'),_0x1cc347,_0x52aecc);_0x332bfd(_0x52aecc);});});}function respondWithStatusCode(_0x4782ca,_0x142bde){_0x142bde=_0x142bde||0xcc;return function(_0x321bec){if(_0x321bec){return _0x4782ca[_0x7186('0x2c')](_0x142bde);}return _0x4782ca[_0x7186('0x2d')](_0x142bde)[_0x7186('0x2e')]();};}function respondWithResult(_0x53c3fe,_0x29d231){_0x29d231=_0x29d231||0xc8;return function(_0x463f1e){if(_0x463f1e){return _0x53c3fe['status'](_0x29d231)[_0x7186('0x2f')](_0x463f1e);}};}function respondWithFilteredResult(_0x4e61c6,_0x19b109){return function(_0xa909b0){if(_0xa909b0){var _0x3eae35=typeof _0x19b109[_0x7186('0x30')]===_0x7186('0x31')&&typeof _0x19b109['limit']===_0x7186('0x31');var _0x2b6003=_0xa909b0[_0x7186('0x32')];var _0xd709e=_0x3eae35?0x0:_0x19b109[_0x7186('0x30')];var _0x59eba3=_0x3eae35?_0xa909b0[_0x7186('0x32')]:_0x19b109[_0x7186('0x30')]+_0x19b109[_0x7186('0x33')];var _0x4f0b44;if(_0x59eba3>=_0x2b6003){_0x59eba3=_0x2b6003;_0x4f0b44=0xc8;}else{_0x4f0b44=0xce;}_0x4e61c6[_0x7186('0x2d')](_0x4f0b44);return _0x4e61c6[_0x7186('0x34')](_0x7186('0x35'),_0xd709e+'-'+_0x59eba3+'/'+_0x2b6003)[_0x7186('0x2f')](_0xa909b0);}return null;};}function patchUpdates(_0x25a75a){return function(_0x4da477){try{jsonpatch['apply'](_0x4da477,_0x25a75a,!![]);}catch(_0x443dd6){return BPromise['reject'](_0x443dd6);}return _0x4da477[_0x7186('0x36')]();};}function saveUpdates(_0x850b87,_0x3f7927){return function(_0x49a6c2){if(_0x49a6c2){return _0x49a6c2[_0x7186('0x37')](_0x850b87)[_0x7186('0x38')](function(_0x1de2e1){return _0x1de2e1;});}return null;};}function removeEntity(_0x24d64c,_0x572083){return function(_0x4ff69b){if(_0x4ff69b){return _0x4ff69b['destroy']()[_0x7186('0x38')](function(){_0x24d64c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x57039a,_0xe4807d){return function(_0x390f82){if(!_0x390f82){_0x57039a[_0x7186('0x2c')](0x194);}return _0x390f82;};}function handleError(_0x2df1b9,_0x1a1e41){_0x1a1e41=_0x1a1e41||0x1f4;return function(_0x3a120d){logger[_0x7186('0x26')](_0x3a120d['stack']);if(_0x3a120d['name']){delete _0x3a120d[_0x7186('0x39')];}_0x2df1b9[_0x7186('0x2d')](_0x1a1e41)['send'](_0x3a120d);};}exports[_0x7186('0x3a')]=function(_0x347748,_0x2a834e){var _0x1e32b5={},_0x50255c={},_0x6c0109={'count':0x0,'rows':[]};var _0x5563d9=_['map'](db[_0x7186('0x3b')][_0x7186('0x3c')],function(_0x43b57d){return{'name':_0x43b57d[_0x7186('0x3d')],'type':_0x43b57d['type'][_0x7186('0x3e')]};});_0x50255c[_0x7186('0x3f')]=_[_0x7186('0x40')](_0x5563d9,'name');_0x50255c[_0x7186('0x41')]=_[_0x7186('0x42')](_0x347748['query']);_0x50255c[_0x7186('0x43')]=_[_0x7186('0x44')](_0x50255c['model'],_0x50255c[_0x7186('0x41')]);_0x1e32b5[_0x7186('0x45')]=_[_0x7186('0x44')](_0x50255c[_0x7186('0x3f')],qs[_0x7186('0x46')](_0x347748[_0x7186('0x41')][_0x7186('0x46')]));_0x1e32b5[_0x7186('0x45')]=_0x1e32b5[_0x7186('0x45')][_0x7186('0x47')]?_0x1e32b5['attributes']:_0x50255c[_0x7186('0x3f')];if(!_0x347748[_0x7186('0x41')]['hasOwnProperty'](_0x7186('0x48'))){_0x1e32b5[_0x7186('0x33')]=qs['limit'](_0x347748[_0x7186('0x41')][_0x7186('0x33')]);_0x1e32b5[_0x7186('0x30')]=qs[_0x7186('0x30')](_0x347748['query'][_0x7186('0x30')]);}_0x1e32b5[_0x7186('0x49')]=qs[_0x7186('0x4a')](_0x347748[_0x7186('0x41')][_0x7186('0x4a')]);_0x1e32b5[_0x7186('0x4b')]=qs[_0x7186('0x43')](_[_0x7186('0x4c')](_0x347748[_0x7186('0x41')],_0x50255c[_0x7186('0x43')]),_0x5563d9);if(_0x347748[_0x7186('0x41')][_0x7186('0x4d')]){_0x1e32b5[_0x7186('0x4b')]=_[_0x7186('0x4e')](_0x1e32b5['where'],{'$or':_['map'](_0x5563d9,function(_0x1f7a56){if(_0x1f7a56[_0x7186('0x4f')]!=='VIRTUAL'){var _0x2a5f6b={};_0x2a5f6b[_0x1f7a56['name']]={'$like':'%'+_0x347748[_0x7186('0x41')][_0x7186('0x4d')]+'%'};return _0x2a5f6b;}})});}_0x1e32b5=_['merge']({},_0x1e32b5,_0x347748[_0x7186('0x50')]);var _0x4debc3={'where':_0x1e32b5['where']};return db[_0x7186('0x3b')][_0x7186('0x32')](_0x4debc3)['then'](function(_0x38d776){_0x6c0109[_0x7186('0x32')]=_0x38d776;if(_0x347748[_0x7186('0x41')][_0x7186('0x51')]){_0x1e32b5[_0x7186('0x52')]=[{'all':!![]}];}return db[_0x7186('0x3b')]['findAll'](_0x1e32b5);})[_0x7186('0x38')](function(_0x3ed72a){_0x6c0109[_0x7186('0x53')]=_0x3ed72a;return _0x6c0109;})[_0x7186('0x38')](respondWithFilteredResult(_0x2a834e,_0x1e32b5))[_0x7186('0x2b')](handleError(_0x2a834e,null));};exports['show']=function(_0x1125b5,_0x3a90bf){var _0x4dafb0={'raw':!![],'where':{'id':_0x1125b5['params']['id']}},_0x2fe86f={};_0x2fe86f[_0x7186('0x3f')]=_[_0x7186('0x42')](db[_0x7186('0x3b')][_0x7186('0x3c')]);_0x2fe86f[_0x7186('0x41')]=_['keys'](_0x1125b5[_0x7186('0x41')]);_0x2fe86f[_0x7186('0x43')]=_[_0x7186('0x44')](_0x2fe86f[_0x7186('0x3f')],_0x2fe86f['query']);_0x4dafb0['attributes']=_[_0x7186('0x44')](_0x2fe86f[_0x7186('0x3f')],qs['fields'](_0x1125b5[_0x7186('0x41')][_0x7186('0x46')]));_0x4dafb0['attributes']=_0x4dafb0['attributes']['length']?_0x4dafb0[_0x7186('0x45')]:_0x2fe86f[_0x7186('0x3f')];if(_0x1125b5['query']['includeAll']){_0x4dafb0[_0x7186('0x52')]=[{'all':!![]}];}_0x4dafb0=_[_0x7186('0x4e')]({},_0x4dafb0,_0x1125b5['options']);return db['SmsMessage'][_0x7186('0x54')](_0x4dafb0)['then'](handleEntityNotFound(_0x3a90bf,null))['then'](respondWithResult(_0x3a90bf,null))[_0x7186('0x2b')](handleError(_0x3a90bf,null));};exports['create']=function(_0x1bfe25,_0x5f1c28){return db[_0x7186('0x3b')]['create'](_0x1bfe25['body'],{})[_0x7186('0x38')](respondWithResult(_0x5f1c28,0xc9))['catch'](handleError(_0x5f1c28,null));};exports['update']=function(_0x4dd5fb,_0x2304f1){if(_0x4dd5fb[_0x7186('0x55')]['id']){delete _0x4dd5fb['body']['id'];}return db[_0x7186('0x3b')][_0x7186('0x54')]({'where':{'id':_0x4dd5fb[_0x7186('0x56')]['id']}})[_0x7186('0x38')](handleEntityNotFound(_0x2304f1,null))[_0x7186('0x38')](saveUpdates(_0x4dd5fb['body'],null))[_0x7186('0x38')](respondWithResult(_0x2304f1,null))['catch'](handleError(_0x2304f1,null));};exports[_0x7186('0x57')]=function(_0x2e3b7c,_0x55d212){return db[_0x7186('0x3b')][_0x7186('0x54')]({'where':{'id':_0x2e3b7c[_0x7186('0x56')]['id']}})['then'](handleEntityNotFound(_0x55d212,null))['then'](removeEntity(_0x55d212,null))[_0x7186('0x2b')](handleError(_0x55d212,null));};exports[_0x7186('0x58')]=function(_0x33598c,_0x306cad){return db['SmsMessage'][_0x7186('0x58')]()[_0x7186('0x38')](respondWithResult(_0x306cad,null))['catch'](handleError(_0x306cad,null));};var interaction_log=require(_0x7186('0x15'))('sms-interactions');exports[_0x7186('0x59')]=function(_0x156592,_0x3ca471,_0x57adc1){var _0x1573e7={'agent':{},'channel':_0x7186('0x5a')};if(_0x156592[_0x7186('0x55')]['id']){delete _0x156592[_0x7186('0x55')]['id'];}_0x156592['body']['read']=!![];_0x156592[_0x7186('0x55')][_0x7186('0x5b')]=moment()[_0x7186('0x5c')](_0x7186('0x5d'));_0x156592[_0x7186('0x55')]['UserId']=_0x156592[_0x7186('0x55')][_0x7186('0x5e')]||_0x156592[_0x7186('0x5f')]['id'];_0x1573e7[_0x7186('0x60')]['id']=_0x156592[_0x7186('0x55')][_0x7186('0x5e')];return db[_0x7186('0x3b')][_0x7186('0x54')]({'where':{'id':_0x156592[_0x7186('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3ca471,null))[_0x7186('0x38')](saveUpdates(_0x156592[_0x7186('0x55')],null))[_0x7186('0x38')](function(_0x41bbb6){if(_0x41bbb6){_0x1573e7[_0x7186('0x28')]=_0x41bbb6['get']({'plain':!![]});return db[_0x7186('0x61')][_0x7186('0x54')]({'where':{'id':_0x41bbb6[_0x7186('0x62')]}});}return null;})[_0x7186('0x38')](handleEntityNotFound(_0x3ca471,null))[_0x7186('0x38')](function(_0xba99a7){if(_0xba99a7){return _0xba99a7['update']({'UserId':_0x156592['body'][_0x7186('0x5e')],'read1stAt':_[_0x7186('0x63')](_0xba99a7[_0x7186('0x64')])?moment()['format'](_0x7186('0x5d')):undefined});}return null;})[_0x7186('0x38')](function(_0x5a857f){if(_0x5a857f){_0x1573e7['interaction']=_0x5a857f[_0x7186('0x65')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x156592[_0x7186('0x5f')]['id'],_0x156592['user'][_0x7186('0x39')],_0x156592[_0x7186('0x5f')][_0x7186('0x66')],_0x1573e7[_0x7186('0x67')]['id'],_0x156592[_0x7186('0x55')]?JSON[_0x7186('0x68')](_0x156592[_0x7186('0x55')]):'null');return respondWithRpcPromise(_0x7186('0x69'),_0x7186('0x6a'),_0x1573e7);}return null;})['then'](function(_0x22c62f){var _0x7b3bcc=_0x7186('0x6b')+_0x22c62f[_0x7186('0x28')][_0x7186('0x6c')];return db[_0x7186('0x6d')][_0x7186('0x41')](_0x7b3bcc,{'type':db['Sequelize'][_0x7186('0x6e')][_0x7186('0x6f')],'raw':!![]})[_0x7186('0x38')](function(_0x5422e2){return _0x5422e2;});})[_0x7186('0x38')](function(_0x4c1578){if(_0x4c1578){_0x1573e7['message']['contact']=_0x4c1578[0x0];if(!_0x156592['body'][_0x7186('0x5e')])return;return db[_0x7186('0x70')][_0x7186('0x54')]({'where':{'id':_0x156592['body'][_0x7186('0x5e')],'role':_0x7186('0x60')},'attributes':['id','name',_0x7186('0x71'),'email',_0x7186('0x72')],'raw':!![]});}return null;})[_0x7186('0x38')](function(_0x37f523){if(!_0x37f523)return null;_0x1573e7[_0x7186('0x28')][_0x7186('0x60')]=_0x37f523;return _0x1573e7;})[_0x7186('0x38')](function(_0x3ce353){if(_0x3ce353){if(_0x156592['body'][_0x7186('0x73')]){_0x1573e7[_0x7186('0x28')][_0x7186('0x74')]=util[_0x7186('0x5c')](_0x7186('0x75'),_0x156592[_0x7186('0x5f')][_0x7186('0x39')]);_0x1573e7[_0x7186('0x28')][_0x7186('0x76')]=_0x1573e7[_0x7186('0x76')];_0x1573e7['message'][_0x7186('0x77')]=_0x1573e7[_0x7186('0x76')];_0x1573e7[_0x7186('0x28')][_0x7186('0x78')]=_0x7186('0x59');return respondWithRpcPromise(_0x7186('0x79'),_0x7186('0x79'),{'event':'acceptmessage','message':_0x1573e7['message']},client9002)[_0x7186('0x38')](function(){return _0x1573e7;});}return _0x1573e7;}return null;})[_0x7186('0x38')](respondWithResult(_0x3ca471,null))[_0x7186('0x2b')](handleError(_0x3ca471,null));};var interaction_log=require('../../config/logger')(_0x7186('0x7a'));exports[_0x7186('0x7b')]=function(_0x325b17,_0xc436ed,_0x5e2738){var _0x32d433={'agent':{},'channel':'sms'};if(_0x325b17[_0x7186('0x55')]['id']){delete _0x325b17[_0x7186('0x55')]['id'];}_0x325b17[_0x7186('0x55')][_0x7186('0x5e')]=_0x325b17[_0x7186('0x55')]['UserId']||_0x325b17[_0x7186('0x5f')]['id'];_0x32d433[_0x7186('0x60')]['id']=_0x325b17['body'][_0x7186('0x5e')];return db[_0x7186('0x3b')][_0x7186('0x54')]({'where':{'id':_0x325b17[_0x7186('0x56')]['id'],'UserId':null}})[_0x7186('0x38')](handleEntityNotFound(_0xc436ed,null))[_0x7186('0x38')](function(_0x19c203){if(_0x19c203){_0x32d433[_0x7186('0x28')]=_0x19c203[_0x7186('0x65')]({'plain':!![]});return db[_0x7186('0x61')][_0x7186('0x54')]({'where':{'id':_0x19c203[_0x7186('0x62')]}});}return null;})[_0x7186('0x38')](handleEntityNotFound(_0xc436ed,null))[_0x7186('0x38')](function(_0x5b5585){if(_0x5b5585){_0x32d433[_0x7186('0x67')]=_0x5b5585[_0x7186('0x65')]({'plain':!![]});interaction_log[_0x7186('0x22')](_0x7186('0x7c'),_0x325b17[_0x7186('0x5f')]['id'],_0x325b17[_0x7186('0x5f')][_0x7186('0x39')],_0x325b17[_0x7186('0x5f')][_0x7186('0x66')],_0x32d433[_0x7186('0x67')]['id'],_0x325b17[_0x7186('0x55')]?JSON['stringify'](_0x325b17[_0x7186('0x55')]):'null');return respondWithRpcPromise(_0x7186('0x7d'),'rejectMessage',_0x32d433);}return null;})[_0x7186('0x38')](function(_0x9dafa2){var _0x218480=_0x7186('0x6b')+_0x9dafa2[_0x7186('0x28')][_0x7186('0x6c')];return db[_0x7186('0x6d')][_0x7186('0x41')](_0x218480,{'type':db[_0x7186('0x7e')][_0x7186('0x6e')][_0x7186('0x6f')],'raw':!![]})['then'](function(_0x224a6e){return _0x224a6e;});})[_0x7186('0x38')](function(_0x161135){if(_0x161135){_0x32d433['message'][_0x7186('0x7f')]=_0x161135[0x0];if(!_0x325b17['body']['UserId'])return;return db[_0x7186('0x70')][_0x7186('0x54')]({'where':{'id':_0x325b17[_0x7186('0x55')]['UserId'],'role':_0x7186('0x60')},'attributes':['id',_0x7186('0x39'),_0x7186('0x71'),_0x7186('0x80'),_0x7186('0x72')],'raw':!![]});}return null;})['then'](function(_0x3154e4){if(!_0x3154e4)return null;_0x32d433[_0x7186('0x28')]['agent']=_0x3154e4;return _0x32d433;})[_0x7186('0x38')](function(_0x2312c4){if(_0x2312c4){_0x2312c4[_0x7186('0x28')]['interface']=util[_0x7186('0x5c')]('SIP/%s',_0x325b17[_0x7186('0x5f')][_0x7186('0x39')]);_0x2312c4[_0x7186('0x28')][_0x7186('0x76')]=_0x32d433[_0x7186('0x76')];_0x2312c4[_0x7186('0x28')][_0x7186('0x77')]=_0x32d433[_0x7186('0x76')];_0x2312c4[_0x7186('0x28')][_0x7186('0x78')]=_0x7186('0x7b');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x2312c4['message']},client9002);return _0x32d433;}return null;})['then'](respondWithResult(_0xc436ed,null))[_0x7186('0x2b')](handleError(_0xc436ed,null));};exports[_0x7186('0x2d')]=function(_0x43e675,_0x20bca1,_0x2fc641){if(_0x43e675[_0x7186('0x55')]['id']){delete _0x43e675[_0x7186('0x55')]['id'];}var _0x4b9172;return db[_0x7186('0x3b')][_0x7186('0x54')]({'where':{'id':_0x43e675[_0x7186('0x56')]['id']}})[_0x7186('0x38')](handleEntityNotFound(_0x20bca1,null))[_0x7186('0x38')](function(_0x3cd857){if(_0x3cd857){_0x4b9172=_0x3cd857;return db[_0x7186('0x81')]['find']({'where':{'id':_0x3cd857[_0x7186('0x82')]}});}})[_0x7186('0x38')](handleEntityNotFound(_0x20bca1,null))[_0x7186('0x38')](function(_0x1f8cf3){if(_0x1f8cf3){logger[_0x7186('0x24')](_0x7186('0x25'),'status',_0x7186('0x83'),_0x1f8cf3[_0x7186('0x4f')],util['inspect'](_0x43e675[_0x7186('0x55')],{'showHidden':![],'depth':null}));switch(_0x1f8cf3['type']){case _0x7186('0x84'):if(_0x43e675[_0x7186('0x55')]['MessageSid']&&_0x43e675[_0x7186('0x55')][_0x7186('0x85')]===_0x4b9172[_0x7186('0x86')]){return _0x4b9172[_0x7186('0x37')]({'read':!![]});}else{logger[_0x7186('0x26')](_0x7186('0x87'),'status','twilio',util['inspect'](_0x43e675[_0x7186('0x55')],{'showHidden':![],'depth':null}));}break;case _0x7186('0x88'):if(_0x43e675[_0x7186('0x55')][_0x7186('0x89')]&&_0x43e675[_0x7186('0x55')][_0x7186('0x89')]===_0x4b9172['messageId']&&_[_0x7186('0x8a')](['sent',_0x7186('0x8b')],_0x43e675[_0x7186('0x55')][_0x7186('0x8c')])>=0x0){return _0x4b9172[_0x7186('0x37')]({'read':!![]});}else{logger[_0x7186('0x26')](_0x7186('0x87'),_0x7186('0x2d'),_0x7186('0x8d'),util['inspect'](_0x43e675['body'],{'showHidden':![],'depth':null}));}break;case _0x7186('0x8e'):var _0x2dc2d0=_0x43e675[_0x7186('0x55')][_0x7186('0x8f')][0x0];if(_0x2dc2d0['status'][_0x7186('0x90')]===_0x7186('0x91')){return _0x4b9172['update']({'read':!![]});}else{logger[_0x7186('0x26')](_0x7186('0x87'),_0x7186('0x2d'),_0x7186('0x8e'),util[_0x7186('0x92')](_0x43e675[_0x7186('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x4b9172;}})[_0x7186('0x38')](respondWithResult(_0x20bca1,null))[_0x7186('0x2b')](handleError(_0x20bca1,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 119f764..fc88888 100644 --- a/server/api/smsMessage/smsMessage.events.js +++ b/server/api/smsMessage/smsMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4227=['hook','events','../../mysqldb','SmsMessage','setMaxListeners','save','remove','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4227,0xe9));var _0x7422=function(_0x30364d,_0x5124b4){_0x30364d=_0x30364d-0x0;var _0x56d5fd=_0x4227[_0x30364d];return _0x56d5fd;};'use strict';var EventEmitter=require(_0x7422('0x0'));var SmsMessage=require(_0x7422('0x1'))['db'][_0x7422('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x7422('0x3')](0x0);var events={'afterCreate':_0x7422('0x4'),'afterUpdate':'update','afterDestroy':_0x7422('0x5')};function emitEvent(_0xa8e009){return function(_0x570f00,_0x1e0ab1,_0x271f41){SmsMessageEvents['emit'](_0xa8e009+':'+_0x570f00['id'],_0x570f00);SmsMessageEvents[_0x7422('0x6')](_0xa8e009,_0x570f00);_0x271f41(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x7422('0x7')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xa7c2=['save','update','remove','emit','hook','events','../../mysqldb','SmsMessage','setMaxListeners'];(function(_0x3110d7,_0x1a9b39){var _0x21c07a=function(_0x59d4f6){while(--_0x59d4f6){_0x3110d7['push'](_0x3110d7['shift']());}};_0x21c07a(++_0x1a9b39);}(_0xa7c2,0x17f));var _0x2a7c=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xa7c2[_0x243b2f];return _0xcb3c2d;};'use strict';var EventEmitter=require(_0x2a7c('0x0'));var SmsMessage=require(_0x2a7c('0x1'))['db'][_0x2a7c('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x2a7c('0x3')](0x0);var events={'afterCreate':_0x2a7c('0x4'),'afterUpdate':_0x2a7c('0x5'),'afterDestroy':_0x2a7c('0x6')};function emitEvent(_0x1ec875){return function(_0x501f66,_0x5bbee,_0x1feec0){SmsMessageEvents[_0x2a7c('0x7')](_0x1ec875+':'+_0x501f66['id'],_0x501f66);SmsMessageEvents[_0x2a7c('0x7')](_0x1ec875,_0x501f66);_0x1feec0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x2a7c('0x8')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 7f2c284..e8db114 100644 --- a/server/api/smsMessage/smsMessage.model.js +++ b/server/api/smsMessage/smsMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadc4=['/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','api','request-promise','path','rimraf','./smsMessage.attributes','exports','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','error','SmsAccount','find','type','twilio','accountSid','authToken','phone','messages','create','body','remote','/api/sms/messages/','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','password','smsMethod','login?username=','username','&password=','GET','split','POST','user_key','session_key','total_sent','internal_order_id','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','head','clickSend','plivo','authId','token','%s:%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','infobip','csc','crypto','apiKey','login','sender','text','timestamp','length','md5','digest','hex','signature=','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadc4,0x82));var _0x4adc=function(_0x20f841,_0x1c2da7){_0x20f841=_0x20f841-0x0;var _0x3264c6=_0xadc4[_0x20f841];return _0x3264c6;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4adc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4adc('0x1'));var fs=require('fs');var path=require(_0x4adc('0x2'));var rimraf=require(_0x4adc('0x3'));var config=require('../../config/environment');var attributes=require(_0x4adc('0x4'));module[_0x4adc('0x5')]=function(_0xa442ed,_0x500e24){return _0xa442ed['define']('SmsMessage',attributes,{'tableName':_0x4adc('0x6'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x4adc('0x7')]},{'name':_0x4adc('0x8'),'fields':['body'],'type':_0x4adc('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3df003,_0x4bc52f,_0x5eb5ff){var _0x430957=_0xa442ed[_0x4adc('0xa')];var _0x5c007c=_0x3df003['get']({'plain':!![]});if(_0x5c007c[_0x4adc('0xb')][_0x4adc('0xc')]()==='in'||_0x5c007c[_0x4adc('0xb')][_0x4adc('0xc')]()===_0x4adc('0xd')&&!_0x5c007c[_0x4adc('0xe')]&&!_[_0x4adc('0xf')](_0x5c007c['UserId'])&&!_[_0x4adc('0xf')](_0x5c007c[_0x4adc('0x10')])){_0x430957[_0x4adc('0x11')][_0x4adc('0x12')]({'where':{'id':_0x5c007c[_0x4adc('0x10')]}})[_0x4adc('0x13')](function(_0x406c0b){if(_0x406c0b){_0x406c0b[_0x4adc('0x14')]({'lastMsgAt':_0x5c007c[_0x4adc('0x15')],'lastMsgDirection':_0x5c007c[_0x4adc('0xb')][_0x4adc('0xc')]()});}})[_0x4adc('0x16')](function(_0x54759c){console[_0x4adc('0x17')](_0x54759c);});}if(_0x5c007c['direction']===_0x4adc('0xd')&&!_0x5c007c[_0x4adc('0xe')]){var _0x4335e3;_0x430957[_0x4adc('0x18')][_0x4adc('0x19')]({'where':{'id':_0x5c007c['SmsAccountId']},'raw':!![]})[_0x4adc('0x13')](function(_0x2df093){_0x4335e3=_0x2df093;if(_0x4335e3&&_0x4335e3[_0x4adc('0x1a')]){switch(_0x4335e3[_0x4adc('0x1a')]){case _0x4adc('0x1b'):var _0x938540=require(_0x4adc('0x1b'));if(_0x4335e3[_0x4adc('0x1c')]&&_0x4335e3[_0x4adc('0x1d')]&&_0x4335e3[_0x4adc('0x1e')]){var _0x578477=new _0x938540(_0x4335e3[_0x4adc('0x1c')],_0x4335e3['authToken']);_0x578477[_0x4adc('0x1f')][_0x4adc('0x20')]({'body':_0x5c007c[_0x4adc('0x21')],'to':_0x5c007c[_0x4adc('0x1e')],'from':_0x4335e3['phone'],'statusCallback':_0x4335e3[_0x4adc('0x22')]+_0x4adc('0x23')+_0x5c007c['id']+_0x4adc('0x24')+_0x4335e3['token']})['then'](function(_0x22d288){if(_0x22d288[_0x4adc('0x25')]){return _0x3df003[_0x4adc('0x14')]({'messageId':_0x22d288[_0x4adc('0x25')]});}})[_0x4adc('0x16')](function(_0x6cfaab){logger[_0x4adc('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4adc('0x1b'),util['inspect'](_0x6cfaab,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4adc('0x26'),_0x4adc('0x27'),_0x4adc('0x1b'),_0x4adc('0x28'));}break;case _0x4adc('0x29'):var _0x2b493a='https://api.skebby.it/API/v1.0/REST/';if(_0x4335e3['username']&&_0x4335e3[_0x4adc('0x2a')]){var _0x235beb={'recipient':[_0x5c007c[_0x4adc('0x1e')]],'message':_0x5c007c[_0x4adc('0x21')],'message_type':_0x4335e3['smsMethod']};if(_0x4335e3[_0x4adc('0x2b')]&&_0x4335e3[_0x4adc('0x2b')]!=='SI'){_0x235beb['sender']=_0x4335e3[_0x4adc('0x1e')];}var _0x2be556={'url':_0x2b493a+_0x4adc('0x2c')+_0x4335e3[_0x4adc('0x2d')]+_0x4adc('0x2e')+_0x4335e3['password'],'method':_0x4adc('0x2f')};rp(_0x2be556)[_0x4adc('0x13')](function(_0x2ba723){var _0x34c1a6=_0x2ba723[_0x4adc('0x30')](';');var _0x50d053={'user_key':_0x34c1a6[0x0],'session_key':_0x34c1a6[0x1]};_0x2be556={'url':_0x2b493a+'sms','method':_0x4adc('0x31'),'headers':{'user_key':_0x50d053[_0x4adc('0x32')],'Session_key':_0x50d053[_0x4adc('0x33')]},'json':!![],'body':_0x235beb};return rp(_0x2be556);})['then'](function(_0xdce6a9){if(_0xdce6a9[_0x4adc('0x34')]>=0x1){var _0x323b06={'messageId':_0xdce6a9[_0x4adc('0x35')]};if(_0x4335e3[_0x4adc('0x2b')]!=='GP'||!_0x4335e3['deliveryReport']){_0x323b06[_0x4adc('0x36')]=!![];}return _0x3df003[_0x4adc('0x14')](_0x323b06);}else{return logger['error'](_0x4adc('0x26'),_0x4adc('0x27'),'skebby',util[_0x4adc('0x37')](_0xdce6a9,{'showHidden':![],'depth':null}));}})[_0x4adc('0x16')](function(_0x43740c){return logger[_0x4adc('0x17')](_0x4adc('0x26'),_0x4adc('0x27'),'skebby',util[_0x4adc('0x37')](_0x43740c,{'showHidden':![],'depth':null}));});}else{logger[_0x4adc('0x17')](_0x4adc('0x26'),_0x4adc('0x27'),'skebby',_0x4adc('0x38'));}break;case _0x4adc('0x39'):if(_0x4335e3['authToken']){var _0x4cce1e={'recipient':_0x5c007c['phone'],'message':_0x5c007c[_0x4adc('0x21')],'sender':_0x4335e3[_0x4adc('0x3a')]||_0x4335e3['phone'],'authorization':_0x4335e3[_0x4adc('0x1d')]};var _0x4bc52f={'method':'POST','uri':_0x4adc('0x3b'),'body':_0x4cce1e,'json':!![]};rp(_0x4bc52f)[_0x4adc('0x13')](function(_0x25b730){var _0x364675={'messageId':_0x25b730[_0x4adc('0x3c')]};if(!_0x4335e3[_0x4adc('0x3d')]){_0x364675['read']=!![];}return _0x3df003[_0x4adc('0x14')](_0x364675);})[_0x4adc('0x16')](function(_0x42af71){logger['error'](_0x4adc('0x26'),_0x4adc('0x27'),_0x4adc('0x39'),util['inspect'](_0x42af71,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4adc('0x26'),_0x4adc('0x27'),_0x4adc('0x39'),_0x4adc('0x3e'));}break;case'clicksend':if(_0x4335e3['username']&&_0x4335e3[_0x4adc('0x2a')]){var _0x4cce1e={'messages':[{'source':'xCALLY\x20Motion','to':_0x5c007c['phone'],'body':_0x5c007c[_0x4adc('0x21')],'from':_0x4335e3[_0x4adc('0x3a')]||_0x4335e3[_0x4adc('0x1e')]}]};var _0x14a4a0=util[_0x4adc('0x3f')]('%s:%s',_0x4335e3[_0x4adc('0x2d')],_0x4335e3[_0x4adc('0x2a')]);var _0x4bc52f={'method':_0x4adc('0x31'),'uri':_0x4adc('0x40'),'body':_0x4cce1e,'headers':{'Authorization':util['format'](_0x4adc('0x41'),new Buffer(_0x14a4a0)[_0x4adc('0x42')](_0x4adc('0x43')))},'json':!![]};rp(_0x4bc52f)[_0x4adc('0x13')](function(_0xf53bed){if(_0xf53bed[_0x4adc('0x44')]>=0xc8&&_0xf53bed[_0x4adc('0x44')]<=0xce){if(_0xf53bed[_0x4adc('0x45')]&&_0xf53bed[_0x4adc('0x45')]['queued_count']>0x0){var _0x312c4c=_[_0x4adc('0x46')](_0xf53bed[_0x4adc('0x45')][_0x4adc('0x1f')]);var _0x5d6218={'messageId':_0x312c4c['message_id']};if(!_0x4335e3[_0x4adc('0x3d')]){_0x5d6218[_0x4adc('0x36')]=!![];}return _0x3df003[_0x4adc('0x14')](_0x5d6218);}else{logger['error'](_0x4adc('0x26'),_0x4adc('0x27'),_0x4adc('0x47'),util[_0x4adc('0x37')](_0xf53bed,{'showHidden':![],'depth':null}));}}else{logger[_0x4adc('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4adc('0x27'),_0x4adc('0x47'),util[_0x4adc('0x37')](_0xf53bed,{'showHidden':![],'depth':null}));}})[_0x4adc('0x16')](function(_0x21f808){logger[_0x4adc('0x17')](_0x4adc('0x26'),_0x4adc('0x27'),_0x4adc('0x47'),util['inspect'](_0x21f808,{'showHidden':![],'depth':null}));});}else{logger[_0x4adc('0x17')](_0x4adc('0x26'),_0x4adc('0x27'),_0x4adc('0x47'),_0x4adc('0x38'));}break;case _0x4adc('0x48'):if(_0x4335e3[_0x4adc('0x49')]&&_0x4335e3[_0x4adc('0x1d')]){var _0x4cce1e={'dst':_0x5c007c['phone'],'text':_0x5c007c['body'],'src':_0x4335e3['senderString']||_0x4335e3[_0x4adc('0x1e')],'url':_0x4335e3['remote']+_0x4adc('0x23')+_0x5c007c['id']+'/status?token='+_0x4335e3[_0x4adc('0x4a')]};var _0x14a4a0=util['format'](_0x4adc('0x4b'),_0x4335e3[_0x4adc('0x49')],_0x4335e3['authToken']);var _0x4bc52f={'method':_0x4adc('0x31'),'uri':util[_0x4adc('0x3f')]('https://api.plivo.com/v1/Account/%s/Message/',_0x4335e3[_0x4adc('0x49')]),'body':_0x4cce1e,'headers':{'Authorization':util['format'](_0x4adc('0x41'),new Buffer(_0x14a4a0)[_0x4adc('0x42')](_0x4adc('0x43')))},'json':!![]};rp(_0x4bc52f)[_0x4adc('0x13')](function(_0x1d9969){var _0x225977={'messageId':_0x1d9969[_0x4adc('0x4c')][0x0]};return _0x3df003['update'](_0x225977);})[_0x4adc('0x16')](function(_0x281e34){logger['error'](_0x4adc('0x26'),_0x4adc('0x27'),_0x4adc('0x48'),util[_0x4adc('0x37')](_0x281e34,{'showHidden':![],'depth':null}));});}else{logger[_0x4adc('0x17')](_0x4adc('0x26'),_0x4adc('0x27'),_0x4adc('0x48'),_0x4adc('0x4d'));}break;case'infobip':if(_0x4335e3[_0x4adc('0x2d')]&&_0x4335e3[_0x4adc('0x2a')]){if(_0x4335e3['baseUrl']){var _0x10a2c2={'method':'POST','uri':_0x4335e3[_0x4adc('0x4e')]+_0x4adc('0x4f'),'body':{'username':_0x4335e3['username'],'password':_0x4335e3['password']},'json':!![]};return rp(_0x10a2c2)['then'](function(_0x2d71d5){var _0x4fa21b={'method':_0x4adc('0x31'),'uri':_0x4335e3[_0x4adc('0x4e')]+_0x4adc('0x50'),'body':{'messages':[{'from':_0x4335e3[_0x4adc('0x1e')],'destinations':[{'to':_0x5c007c[_0x4adc('0x1e')]}],'text':_0x5c007c[_0x4adc('0x21')],'notifyUrl':_0x4335e3[_0x4adc('0x22')]+_0x4adc('0x23')+_0x5c007c['id']+'/status?token='+_0x4335e3[_0x4adc('0x4a')],'notifyContentType':_0x4adc('0x51'),'callbackData':_0x4335e3[_0x4adc('0x1e')]+';'+_0x5c007c['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x2d71d5[_0x4adc('0x4a')]},'json':!![]};return rp(_0x4fa21b)[_0x4adc('0x13')](function(_0x37af23){if(_0x37af23[_0x4adc('0x1f')]){var _0x46d755={'messageId':_0x37af23['messages'][0x0][_0x4adc('0x7')]};if(!_0x4335e3[_0x4adc('0x3d')]){_0x46d755[_0x4adc('0x36')]=!![];}return _0x3df003[_0x4adc('0x14')](_0x46d755);}else{return logger[_0x4adc('0x17')](_0x4adc('0x26'),_0x4adc('0x27'),_0x4adc('0x52'),util['inspect'](_0x37af23,{'showHidden':![],'depth':null}));}});})[_0x4adc('0x16')](function(_0x1604f5){return logger[_0x4adc('0x17')](_0x4adc('0x26'),_0x4adc('0x27'),_0x4adc('0x52'),util[_0x4adc('0x37')](_0x1604f5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4adc('0x26'),_0x4adc('0x27'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0x4adc('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4adc('0x27'),'infobip',_0x4adc('0x38'));}break;case _0x4adc('0x53'):var _0x44bde6=require(_0x4adc('0x54'));if(_0x4335e3[_0x4adc('0x55')]){var _0x1f1ff1={};_0x1f1ff1[_0x4adc('0x56')]=_0x4335e3[_0x4adc('0x2d')];_0x1f1ff1[_0x4adc('0x1e')]=_0x5c007c[_0x4adc('0x1e')];_0x1f1ff1[_0x4adc('0x57')]=_0x4335e3[_0x4adc('0x1e')];_0x1f1ff1[_0x4adc('0x58')]=_0x5c007c[_0x4adc('0x21')];_0x1f1ff1[_0x4adc('0x59')]=+new Date();var _0x5663e7='';var _0x55aff6='';var _0x15ca43=Object['keys'](_0x1f1ff1);_0x15ca43['sort']();for(var _0x10e4b0=0x0;_0x10e4b0<_0x15ca43[_0x4adc('0x5a')];_0x10e4b0++){if(_0x5663e7!=''){_0x5663e7+='&';}_0x5663e7+=_0x15ca43[_0x10e4b0]+'='+encodeURIComponent(_0x1f1ff1[_0x15ca43[_0x10e4b0]]);_0x55aff6+=_0x1f1ff1[_0x15ca43[_0x10e4b0]];}_0x55aff6+=_0x4335e3[_0x4adc('0x55')];_0x55aff6=_0x44bde6['createHash'](_0x4adc('0x5b'))['update'](_0x55aff6)[_0x4adc('0x5c')](_0x4adc('0x5d'));if(_0x5663e7!==''){_0x5663e7+='&';}_0x5663e7+=_0x4adc('0x5e')+_0x55aff6;var _0x2be556={'method':_0x4adc('0x2f'),'uri':_0x4335e3[_0x4adc('0x4e')]+'/external/get/send.php?'+_0x5663e7,'json':!![]};return rp(_0x2be556)[_0x4adc('0x13')](function(_0x21a5ee){var _0x3875f6=Object[_0x4adc('0x5f')](_0x21a5ee);if(_0x21a5ee[_0x3875f6[0x0]]['error']&&parseInt(_0x21a5ee[_0x3875f6[0x0]]['error'])===0x0){var _0x13a2d8={'messageId':_0x21a5ee[_0x3875f6[0x0]][_0x4adc('0x60')]};if(!_0x4335e3['deliveryReport']){_0x13a2d8[_0x4adc('0x36')]=!![];}return _0x3df003[_0x4adc('0x14')](_0x13a2d8);}else{return logger['error'](_0x4adc('0x26'),_0x4adc('0x27'),_0x4adc('0x53'),util[_0x4adc('0x37')](_0x21a5ee[_0x4adc('0x17')],{'showHidden':![],'depth':null}));}})[_0x4adc('0x16')](function(_0x5c92f1){return logger[_0x4adc('0x17')](_0x4adc('0x26'),_0x4adc('0x27'),_0x4adc('0x53'),util[_0x4adc('0x37')](_0x5c92f1,{'showHidden':![],'depth':null}));});}else{logger[_0x4adc('0x17')](_0x4adc('0x26'),_0x4adc('0x27'),_0x4adc('0x53'),_0x4adc('0x61'));}break;case _0x4adc('0x62'):if(_0x4335e3['apiKey']){var _0x519837={'method':'POST','uri':_0x4adc('0x63'),'headers':{'Authorization':_0x4335e3[_0x4adc('0x55')]},'body':{'content':_0x5c007c[_0x4adc('0x21')],'to':[_0x5c007c[_0x4adc('0x1e')]],'from':_0x4335e3['phone'],'binary':![],'clientMessageId':_0x4adc('0x64'),'charset':_0x4adc('0x65')},'json':!![]};rp(_0x519837)[_0x4adc('0x13')](function(_0x487835){if(!_0x487835[_0x4adc('0x17')]){var _0x11ed05={'messageId':_0x487835[_0x4adc('0x1f')][0x0][_0x4adc('0x66')]};if(!_0x4335e3[_0x4adc('0x3d')]){_0x11ed05[_0x4adc('0x36')]=!![];}return _0x3df003[_0x4adc('0x14')](_0x11ed05);}else{return logger[_0x4adc('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4adc('0x27'),'clickatell',util[_0x4adc('0x37')](_0x487835[_0x4adc('0x17')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x1b8d4d){return logger[_0x4adc('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickatell',util[_0x4adc('0x37')](_0x1b8d4d,{'showHidden':![],'depth':null}));});}else{logger[_0x4adc('0x17')](_0x4adc('0x26'),_0x4adc('0x27'),_0x4adc('0x62'),_0x4adc('0x61'));}break;case _0x4adc('0x67'):if(_0x4335e3['username']&&_0x4335e3[_0x4adc('0x2a')]){var _0x14a4a0=util[_0x4adc('0x3f')]('%s:%s',_0x4335e3['username'],_0x4335e3[_0x4adc('0x2a')]);var _0x4bc52f={'method':_0x4adc('0x31'),'uri':_0x4adc('0x68')+_0x4335e3[_0x4adc('0x69')]+_0x4adc('0x6a'),'body':{'to':[_0x5c007c[_0x4adc('0x1e')]],'text':_0x5c007c['body'],'from':_0x4335e3['phone'],'applicationId':_0x4335e3['applicationId']},'headers':{'Authorization':util[_0x4adc('0x3f')](_0x4adc('0x41'),new Buffer(_0x14a4a0)[_0x4adc('0x42')](_0x4adc('0x43')))},'json':!![]};rp(_0x4bc52f)[_0x4adc('0x13')](function(_0x2fa4ad){if(_0x2fa4ad['id']){var _0x54c8f6={'messageId':_0x2fa4ad['id']};return _0x3df003[_0x4adc('0x14')](_0x54c8f6);}else{logger['error'](_0x4adc('0x26'),_0x4adc('0x27'),_0x4adc('0x67'),util[_0x4adc('0x37')](_0x2fa4ad,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5806d9){logger[_0x4adc('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4adc('0x27'),_0x4adc('0x67'),util[_0x4adc('0x37')](_0x5806d9,{'showHidden':![],'depth':null}));});}else{logger[_0x4adc('0x17')](_0x4adc('0x26'),'afterCreate','bandwidth',_0x4adc('0x38'));}break;case _0x4adc('0x6b'):if(_0x4335e3[_0x4adc('0x55')]){var _0x5baefb={};var _0x2be556={'method':_0x4adc('0x31'),'uri':_0x4adc('0x6c'),'headers':{'Authorization':_0x4adc('0x6d')+_0x4335e3['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x4335e3['phone'],'to':_0x5c007c[_0x4adc('0x1e')],'text':_0x5c007c[_0x4adc('0x21')]},'json':!![]};return rp(_0x2be556)[_0x4adc('0x13')](function(_0x5b06d0){if(_0x5b06d0[_0x4adc('0x6e')]==0xca){_0x5baefb[_0x4adc('0x6f')]=_0x5b06d0;var _0x4e7552={'method':_0x4adc('0x31'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x4adc('0x6d')+_0x4335e3[_0x4adc('0x55')],'Content-Type':'application/json'},'body':{'refid':_0x5baefb[_0x4adc('0x6f')][_0x4adc('0x70')]},'json':!![]};return rp(_0x4e7552)[_0x4adc('0x13')](function(_0x2894d8){_0x5baefb[_0x4adc('0x71')]=_0x2894d8;var _0x428d2b={'messageId':_0x5baefb[_0x4adc('0x6f')]['refid'],'read':!![]};return _0x3df003['update'](_0x428d2b);});}else{return logger[_0x4adc('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4adc('0x27'),_0x4adc('0x6b'),util['inspect'](_0x5b06d0,{'showHidden':![],'depth':null}));}})[_0x4adc('0x16')](function(_0x930cb8){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4adc('0x27'),_0x4adc('0x6b'),util[_0x4adc('0x37')](_0x930cb8,{'showHidden':![],'depth':null}));});}else{return logger[_0x4adc('0x17')](_0x4adc('0x26'),_0x4adc('0x27'),'intelepeer',_0x4adc('0x72'));}break;}}})[_0x4adc('0x73')](function(){_0x5eb5ff();});}else{_0x5eb5ff();}}},'charset':_0x4adc('0x74'),'collate':_0x4adc('0x75')});}; \ No newline at end of file +var _0x1d53=['afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20username,\x20password','connectel','requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','%s:%s','https://rest.clicksend.com/v3/sms/send','http_code','data','queued_count','head','clickSend','plivo','format','https://api.plivo.com/v1/Account/%s/Message/','authId','toString','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','length','createHash','md5','/external/get/send.php?','id_sms','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','/messages','applicationId','Basic\x20%s','intelepeer','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','message','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsMessage','messageId','fti_sms_messages','body','get','direction','toLowerCase','secret','isNil','UserId','SmsInteractionId','SmsInteraction','then','createdAt','catch','error','out','find','type','twilio','authToken','messages','create','phone','remote','/api/sms/messages/','/status?token=','token','sid','update'];(function(_0x1cb7d7,_0x24a966){var _0x4904b9=function(_0x104213){while(--_0x104213){_0x1cb7d7['push'](_0x1cb7d7['shift']());}};_0x4904b9(++_0x24a966);}(_0x1d53,0x140));var _0x31d5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1d53[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x31d5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x31d5('0x1'));var moment=require(_0x31d5('0x2'));var BPromise=require(_0x31d5('0x3'));var rp=require(_0x31d5('0x4'));var fs=require('fs');var path=require(_0x31d5('0x5'));var rimraf=require(_0x31d5('0x6'));var config=require(_0x31d5('0x7'));var attributes=require('./smsMessage.attributes');module[_0x31d5('0x8')]=function(_0x3768a6,_0x284a2e){return _0x3768a6[_0x31d5('0x9')](_0x31d5('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x31d5('0xb'),'fields':[_0x31d5('0xb')]},{'name':_0x31d5('0xc'),'fields':[_0x31d5('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xf3d60e,_0x1896e6,_0x55ba93){var _0x5400ff=_0x3768a6['models'];var _0x3de821=_0xf3d60e[_0x31d5('0xe')]({'plain':!![]});if(_0x3de821[_0x31d5('0xf')]['toLowerCase']()==='in'||_0x3de821['direction'][_0x31d5('0x10')]()==='out'&&!_0x3de821[_0x31d5('0x11')]&&!_[_0x31d5('0x12')](_0x3de821[_0x31d5('0x13')])&&!_[_0x31d5('0x12')](_0x3de821[_0x31d5('0x14')])){_0x5400ff[_0x31d5('0x15')]['findOne']({'where':{'id':_0x3de821['SmsInteractionId']}})[_0x31d5('0x16')](function(_0xa024d3){if(_0xa024d3){_0xa024d3['update']({'lastMsgAt':_0x3de821[_0x31d5('0x17')],'lastMsgDirection':_0x3de821[_0x31d5('0xf')][_0x31d5('0x10')]()});}})[_0x31d5('0x18')](function(_0x5ecca4){console[_0x31d5('0x19')](_0x5ecca4);});}if(_0x3de821[_0x31d5('0xf')]===_0x31d5('0x1a')&&!_0x3de821['secret']){var _0x3f309e;_0x5400ff['SmsAccount'][_0x31d5('0x1b')]({'where':{'id':_0x3de821['SmsAccountId']},'raw':!![]})['then'](function(_0x77b7b9){_0x3f309e=_0x77b7b9;if(_0x3f309e&&_0x3f309e[_0x31d5('0x1c')]){switch(_0x3f309e['type']){case _0x31d5('0x1d'):var _0x3f0fbb=require('twilio');if(_0x3f309e['accountSid']&&_0x3f309e[_0x31d5('0x1e')]&&_0x3f309e['phone']){var _0x1fa7e2=new _0x3f0fbb(_0x3f309e['accountSid'],_0x3f309e[_0x31d5('0x1e')]);_0x1fa7e2[_0x31d5('0x1f')][_0x31d5('0x20')]({'body':_0x3de821[_0x31d5('0xd')],'to':_0x3de821[_0x31d5('0x21')],'from':_0x3f309e[_0x31d5('0x21')],'statusCallback':_0x3f309e[_0x31d5('0x22')]+_0x31d5('0x23')+_0x3de821['id']+_0x31d5('0x24')+_0x3f309e[_0x31d5('0x25')]})['then'](function(_0x1ec541){if(_0x1ec541[_0x31d5('0x26')]){return _0xf3d60e[_0x31d5('0x27')]({'messageId':_0x1ec541[_0x31d5('0x26')]});}})[_0x31d5('0x18')](function(_0x5633b7){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31d5('0x28'),'twilio',util[_0x31d5('0x29')](_0x5633b7,{'showHidden':![],'depth':null}));});}else{logger[_0x31d5('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31d5('0x28'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x31d5('0x2a'):var _0x237289=_0x31d5('0x2b');if(_0x3f309e[_0x31d5('0x2c')]&&_0x3f309e[_0x31d5('0x2d')]){var _0x5a0c7f={'recipient':[_0x3de821['phone']],'message':_0x3de821[_0x31d5('0xd')],'message_type':_0x3f309e['smsMethod']};if(_0x3f309e[_0x31d5('0x2e')]&&_0x3f309e[_0x31d5('0x2e')]!=='SI'){_0x5a0c7f[_0x31d5('0x2f')]=_0x3f309e['phone'];}var _0x125306={'url':_0x237289+_0x31d5('0x30')+_0x3f309e['username']+_0x31d5('0x31')+_0x3f309e[_0x31d5('0x2d')],'method':_0x31d5('0x32')};rp(_0x125306)['then'](function(_0x4bf853){var _0x1dda14=_0x4bf853[_0x31d5('0x33')](';');var _0x1d1ed4={'user_key':_0x1dda14[0x0],'session_key':_0x1dda14[0x1]};_0x125306={'url':_0x237289+_0x31d5('0x34'),'method':_0x31d5('0x35'),'headers':{'user_key':_0x1d1ed4[_0x31d5('0x36')],'Session_key':_0x1d1ed4['session_key']},'json':!![],'body':_0x5a0c7f};return rp(_0x125306);})['then'](function(_0x1a1e55){if(_0x1a1e55[_0x31d5('0x37')]>=0x1){var _0x17b0e7={'messageId':_0x1a1e55[_0x31d5('0x38')]};if(_0x3f309e[_0x31d5('0x2e')]!=='GP'||!_0x3f309e[_0x31d5('0x39')]){_0x17b0e7['read']=!![];}return _0xf3d60e['update'](_0x17b0e7);}else{return logger[_0x31d5('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31d5('0x28'),_0x31d5('0x2a'),util[_0x31d5('0x29')](_0x1a1e55,{'showHidden':![],'depth':null}));}})[_0x31d5('0x18')](function(_0x4dd0fc){return logger[_0x31d5('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31d5('0x28'),_0x31d5('0x2a'),util[_0x31d5('0x29')](_0x4dd0fc,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x31d5('0x3a'),_0x31d5('0x28'),'skebby',_0x31d5('0x3b'));}break;case _0x31d5('0x3c'):if(_0x3f309e[_0x31d5('0x1e')]){var _0x437dc5={'recipient':_0x3de821[_0x31d5('0x21')],'message':_0x3de821[_0x31d5('0xd')],'sender':_0x3f309e['senderString']||_0x3f309e['phone'],'authorization':_0x3f309e['authToken']};var _0x1896e6={'method':_0x31d5('0x35'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x437dc5,'json':!![]};rp(_0x1896e6)[_0x31d5('0x16')](function(_0x9ae0d1){var _0x3251b9={'messageId':_0x9ae0d1[_0x31d5('0x3d')]};if(!_0x3f309e[_0x31d5('0x39')]){_0x3251b9[_0x31d5('0x3e')]=!![];}return _0xf3d60e[_0x31d5('0x27')](_0x3251b9);})[_0x31d5('0x18')](function(_0x418b4c){logger[_0x31d5('0x19')](_0x31d5('0x3a'),_0x31d5('0x28'),_0x31d5('0x3c'),util[_0x31d5('0x29')](_0x418b4c,{'showHidden':![],'depth':null}));});}else{logger[_0x31d5('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31d5('0x28'),'connectel',_0x31d5('0x3f'));}break;case _0x31d5('0x40'):if(_0x3f309e['username']&&_0x3f309e[_0x31d5('0x2d')]){var _0x437dc5={'messages':[{'source':_0x31d5('0x41'),'to':_0x3de821['phone'],'body':_0x3de821[_0x31d5('0xd')],'from':_0x3f309e[_0x31d5('0x42')]||_0x3f309e[_0x31d5('0x21')]}]};var _0x397b3e=util['format'](_0x31d5('0x43'),_0x3f309e[_0x31d5('0x2c')],_0x3f309e[_0x31d5('0x2d')]);var _0x1896e6={'method':_0x31d5('0x35'),'uri':_0x31d5('0x44'),'body':_0x437dc5,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x397b3e)['toString']('base64'))},'json':!![]};rp(_0x1896e6)[_0x31d5('0x16')](function(_0x59d7b2){if(_0x59d7b2[_0x31d5('0x45')]>=0xc8&&_0x59d7b2[_0x31d5('0x45')]<=0xce){if(_0x59d7b2[_0x31d5('0x46')]&&_0x59d7b2['data'][_0x31d5('0x47')]>0x0){var _0x2b6dda=_[_0x31d5('0x48')](_0x59d7b2[_0x31d5('0x46')][_0x31d5('0x1f')]);var _0xc1de84={'messageId':_0x2b6dda['message_id']};if(!_0x3f309e['deliveryReport']){_0xc1de84[_0x31d5('0x3e')]=!![];}return _0xf3d60e[_0x31d5('0x27')](_0xc1de84);}else{logger[_0x31d5('0x19')](_0x31d5('0x3a'),_0x31d5('0x28'),_0x31d5('0x49'),util[_0x31d5('0x29')](_0x59d7b2,{'showHidden':![],'depth':null}));}}else{logger[_0x31d5('0x19')](_0x31d5('0x3a'),_0x31d5('0x28'),'clickSend',util[_0x31d5('0x29')](_0x59d7b2,{'showHidden':![],'depth':null}));}})[_0x31d5('0x18')](function(_0x2cdb15){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31d5('0x28'),_0x31d5('0x49'),util[_0x31d5('0x29')](_0x2cdb15,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31d5('0x28'),_0x31d5('0x49'),_0x31d5('0x3b'));}break;case _0x31d5('0x4a'):if(_0x3f309e['authId']&&_0x3f309e[_0x31d5('0x1e')]){var _0x437dc5={'dst':_0x3de821[_0x31d5('0x21')],'text':_0x3de821[_0x31d5('0xd')],'src':_0x3f309e[_0x31d5('0x42')]||_0x3f309e[_0x31d5('0x21')],'url':_0x3f309e[_0x31d5('0x22')]+_0x31d5('0x23')+_0x3de821['id']+_0x31d5('0x24')+_0x3f309e[_0x31d5('0x25')]};var _0x397b3e=util['format'](_0x31d5('0x43'),_0x3f309e['authId'],_0x3f309e[_0x31d5('0x1e')]);var _0x1896e6={'method':'POST','uri':util[_0x31d5('0x4b')](_0x31d5('0x4c'),_0x3f309e[_0x31d5('0x4d')]),'body':_0x437dc5,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x397b3e)[_0x31d5('0x4e')](_0x31d5('0x4f')))},'json':!![]};rp(_0x1896e6)['then'](function(_0x27eb9f){var _0xf84af={'messageId':_0x27eb9f[_0x31d5('0x50')][0x0]};return _0xf3d60e[_0x31d5('0x27')](_0xf84af);})[_0x31d5('0x18')](function(_0xb9c191){logger[_0x31d5('0x19')](_0x31d5('0x3a'),_0x31d5('0x28'),_0x31d5('0x4a'),util['inspect'](_0xb9c191,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x31d5('0x3a'),_0x31d5('0x28'),_0x31d5('0x4a'),_0x31d5('0x51'));}break;case _0x31d5('0x52'):if(_0x3f309e[_0x31d5('0x2c')]&&_0x3f309e[_0x31d5('0x2d')]){if(_0x3f309e[_0x31d5('0x53')]){var _0x18fcc7={'method':'POST','uri':_0x3f309e[_0x31d5('0x53')]+_0x31d5('0x54'),'body':{'username':_0x3f309e['username'],'password':_0x3f309e['password']},'json':!![]};return rp(_0x18fcc7)[_0x31d5('0x16')](function(_0x32e816){var _0x48038e={'method':_0x31d5('0x35'),'uri':_0x3f309e[_0x31d5('0x53')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x3f309e[_0x31d5('0x21')],'destinations':[{'to':_0x3de821[_0x31d5('0x21')]}],'text':_0x3de821[_0x31d5('0xd')],'notifyUrl':_0x3f309e[_0x31d5('0x22')]+_0x31d5('0x23')+_0x3de821['id']+'/status?token='+_0x3f309e['token'],'notifyContentType':_0x31d5('0x55'),'callbackData':_0x3f309e[_0x31d5('0x21')]+';'+_0x3de821[_0x31d5('0xd')]}]},'headers':{'Authorization':_0x31d5('0x56')+_0x32e816[_0x31d5('0x25')]},'json':!![]};return rp(_0x48038e)[_0x31d5('0x16')](function(_0x34357b){if(_0x34357b[_0x31d5('0x1f')]){var _0x3309e8={'messageId':_0x34357b[_0x31d5('0x1f')][0x0][_0x31d5('0xb')]};if(!_0x3f309e[_0x31d5('0x39')]){_0x3309e8[_0x31d5('0x3e')]=!![];}return _0xf3d60e[_0x31d5('0x27')](_0x3309e8);}else{return logger[_0x31d5('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31d5('0x28'),'infobip',util[_0x31d5('0x29')](_0x34357b,{'showHidden':![],'depth':null}));}});})[_0x31d5('0x18')](function(_0x19226c){return logger[_0x31d5('0x19')](_0x31d5('0x3a'),_0x31d5('0x28'),_0x31d5('0x52'),util[_0x31d5('0x29')](_0x19226c,{'showHidden':![],'depth':null}));});}else{logger[_0x31d5('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',_0x31d5('0x57'));}}else{logger[_0x31d5('0x19')](_0x31d5('0x3a'),_0x31d5('0x28'),_0x31d5('0x52'),_0x31d5('0x3b'));}break;case _0x31d5('0x58'):var _0x3fcc01=require(_0x31d5('0x59'));if(_0x3f309e[_0x31d5('0x5a')]){var _0x7a89d4={};_0x7a89d4[_0x31d5('0x5b')]=_0x3f309e[_0x31d5('0x2c')];_0x7a89d4[_0x31d5('0x21')]=_0x3de821[_0x31d5('0x21')];_0x7a89d4[_0x31d5('0x2f')]=_0x3f309e[_0x31d5('0x21')];_0x7a89d4[_0x31d5('0x5c')]=_0x3de821[_0x31d5('0xd')];_0x7a89d4[_0x31d5('0x5d')]=+new Date();var _0x5f35d0='';var _0x2761c9='';var _0x47ee1b=Object[_0x31d5('0x5e')](_0x7a89d4);_0x47ee1b['sort']();for(var _0x27f31b=0x0;_0x27f31b<_0x47ee1b[_0x31d5('0x5f')];_0x27f31b++){if(_0x5f35d0!=''){_0x5f35d0+='&';}_0x5f35d0+=_0x47ee1b[_0x27f31b]+'='+encodeURIComponent(_0x7a89d4[_0x47ee1b[_0x27f31b]]);_0x2761c9+=_0x7a89d4[_0x47ee1b[_0x27f31b]];}_0x2761c9+=_0x3f309e[_0x31d5('0x5a')];_0x2761c9=_0x3fcc01[_0x31d5('0x60')](_0x31d5('0x61'))[_0x31d5('0x27')](_0x2761c9)['digest']('hex');if(_0x5f35d0!==''){_0x5f35d0+='&';}_0x5f35d0+='signature='+_0x2761c9;var _0x125306={'method':'GET','uri':_0x3f309e[_0x31d5('0x53')]+_0x31d5('0x62')+_0x5f35d0,'json':!![]};return rp(_0x125306)[_0x31d5('0x16')](function(_0x492383){var _0x490478=Object[_0x31d5('0x5e')](_0x492383);if(_0x492383[_0x490478[0x0]][_0x31d5('0x19')]&&parseInt(_0x492383[_0x490478[0x0]]['error'])===0x0){var _0x104284={'messageId':_0x492383[_0x490478[0x0]][_0x31d5('0x63')]};if(!_0x3f309e[_0x31d5('0x39')]){_0x104284[_0x31d5('0x3e')]=!![];}return _0xf3d60e[_0x31d5('0x27')](_0x104284);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util[_0x31d5('0x29')](_0x492383[_0x31d5('0x19')],{'showHidden':![],'depth':null}));}})[_0x31d5('0x18')](function(_0x1f0744){return logger[_0x31d5('0x19')](_0x31d5('0x3a'),'afterCreate','csc',util[_0x31d5('0x29')](_0x1f0744,{'showHidden':![],'depth':null}));});}else{logger[_0x31d5('0x19')](_0x31d5('0x3a'),_0x31d5('0x28'),_0x31d5('0x58'),'Missing\x20parameters:\x20apiKey');}break;case _0x31d5('0x64'):if(_0x3f309e[_0x31d5('0x5a')]){var _0x120dd4={'method':_0x31d5('0x35'),'uri':_0x31d5('0x65'),'headers':{'Authorization':_0x3f309e[_0x31d5('0x5a')]},'body':{'content':_0x3de821[_0x31d5('0xd')],'to':[_0x3de821['phone']],'from':_0x3f309e['phone'],'binary':![],'clientMessageId':_0x31d5('0x66'),'charset':_0x31d5('0x67')},'json':!![]};rp(_0x120dd4)[_0x31d5('0x16')](function(_0x3ba050){if(!_0x3ba050['error']){var _0x261ae4={'messageId':_0x3ba050[_0x31d5('0x1f')][0x0][_0x31d5('0x68')]};if(!_0x3f309e[_0x31d5('0x39')]){_0x261ae4[_0x31d5('0x3e')]=!![];}return _0xf3d60e[_0x31d5('0x27')](_0x261ae4);}else{return logger[_0x31d5('0x19')](_0x31d5('0x3a'),_0x31d5('0x28'),_0x31d5('0x64'),util[_0x31d5('0x29')](_0x3ba050[_0x31d5('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x556c7b){return logger['error'](_0x31d5('0x3a'),_0x31d5('0x28'),'clickatell',util[_0x31d5('0x29')](_0x556c7b,{'showHidden':![],'depth':null}));});}else{logger[_0x31d5('0x19')](_0x31d5('0x3a'),_0x31d5('0x28'),_0x31d5('0x64'),_0x31d5('0x69'));}break;case _0x31d5('0x6a'):if(_0x3f309e[_0x31d5('0x2c')]&&_0x3f309e[_0x31d5('0x2d')]){var _0x397b3e=util[_0x31d5('0x4b')](_0x31d5('0x43'),_0x3f309e[_0x31d5('0x2c')],_0x3f309e[_0x31d5('0x2d')]);var _0x1896e6={'method':_0x31d5('0x35'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x3f309e['accountId']+_0x31d5('0x6b'),'body':{'to':[_0x3de821[_0x31d5('0x21')]],'text':_0x3de821['body'],'from':_0x3f309e[_0x31d5('0x21')],'applicationId':_0x3f309e[_0x31d5('0x6c')]},'headers':{'Authorization':util[_0x31d5('0x4b')](_0x31d5('0x6d'),new Buffer(_0x397b3e)[_0x31d5('0x4e')]('base64'))},'json':!![]};rp(_0x1896e6)[_0x31d5('0x16')](function(_0x135af6){if(_0x135af6['id']){var _0x4278c0={'messageId':_0x135af6['id']};return _0xf3d60e['update'](_0x4278c0);}else{logger[_0x31d5('0x19')](_0x31d5('0x3a'),_0x31d5('0x28'),_0x31d5('0x6a'),util[_0x31d5('0x29')](_0x135af6,{'showHidden':![],'depth':null}));}})[_0x31d5('0x18')](function(_0xdb80c2){logger[_0x31d5('0x19')](_0x31d5('0x3a'),_0x31d5('0x28'),'bandwidth',util[_0x31d5('0x29')](_0xdb80c2,{'showHidden':![],'depth':null}));});}else{logger[_0x31d5('0x19')](_0x31d5('0x3a'),_0x31d5('0x28'),_0x31d5('0x6a'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x31d5('0x6e'):if(_0x3f309e[_0x31d5('0x5a')]){var _0x4431a2={};var _0x125306={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x3f309e[_0x31d5('0x5a')],'Content-Type':_0x31d5('0x55')},'body':{'from':_0x3f309e[_0x31d5('0x21')],'to':_0x3de821[_0x31d5('0x21')],'text':_0x3de821[_0x31d5('0xd')]},'json':!![]};return rp(_0x125306)[_0x31d5('0x16')](function(_0x18d555){if(_0x18d555[_0x31d5('0x6f')]==0xca){_0x4431a2['message']=_0x18d555;var _0x4aeae7={'method':_0x31d5('0x35'),'uri':_0x31d5('0x70'),'headers':{'Authorization':'Bearer\x20'+_0x3f309e[_0x31d5('0x5a')],'Content-Type':_0x31d5('0x55')},'body':{'refid':_0x4431a2['message'][_0x31d5('0x71')]},'json':!![]};return rp(_0x4aeae7)[_0x31d5('0x16')](function(_0x73c4f5){_0x4431a2[_0x31d5('0x72')]=_0x73c4f5;var _0x34733c={'messageId':_0x4431a2[_0x31d5('0x73')][_0x31d5('0x71')],'read':!![]};return _0xf3d60e['update'](_0x34733c);});}else{return logger['error'](_0x31d5('0x3a'),_0x31d5('0x28'),_0x31d5('0x6e'),util[_0x31d5('0x29')](_0x18d555,{'showHidden':![],'depth':null}));}})[_0x31d5('0x18')](function(_0x2c8f81){return logger[_0x31d5('0x19')](_0x31d5('0x3a'),_0x31d5('0x28'),_0x31d5('0x6e'),util[_0x31d5('0x29')](_0x2c8f81,{'showHidden':![],'depth':null}));});}else{return logger[_0x31d5('0x19')](_0x31d5('0x3a'),_0x31d5('0x28'),'intelepeer',_0x31d5('0x74'));}break;}}})[_0x31d5('0x75')](function(){_0x55ba93();});}else{_0x55ba93();}}},'charset':_0x31d5('0x76'),'collate':_0x31d5('0x77')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index be8c2d5..4e1b46a 100644 --- a/server/api/smsMessage/smsMessage.rpc.js +++ b/server/api/smsMessage/smsMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfcaa=['rpc','jayson/promise','client','http','redis','localhost','./smsMessage.socket','register','request','then','SmsMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','CreateSmsMessage','SmsMessage','options','raw','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xfcaa,0x1cb));var _0xafca=function(_0x306735,_0x1df060){_0x306735=_0x306735-0x0;var _0x224671=_0xfcaa[_0x306735];return _0x224671;};'use strict';var _=require(_0xafca('0x0'));var util=require('util');var moment=require(_0xafca('0x1'));var BPromise=require('bluebird');var rs=require(_0xafca('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xafca('0x3'))['db'];var utils=require(_0xafca('0x4'));var logger=require('../../config/logger')(_0xafca('0x5'));var config=require('../../config/environment');var jayson=require(_0xafca('0x6'));var client=jayson[_0xafca('0x7')][_0xafca('0x8')]({'port':0x232a});config[_0xafca('0x9')]=_['defaults'](config[_0xafca('0x9')],{'host':_0xafca('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xafca('0xb'))[_0xafca('0xc')](socket);function respondWithRpcPromise(_0x403f03,_0x210161,_0x1a6acf){return new BPromise(function(_0x4c8cf9,_0x2e5cb3){return client[_0xafca('0xd')](_0x403f03,_0x1a6acf)[_0xafca('0xe')](function(_0x50b6f1){logger['info'](_0xafca('0xf'),_0x210161,'request\x20sent');logger[_0xafca('0x10')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x210161,_0xafca('0x11'),JSON[_0xafca('0x12')](_0x50b6f1));if(_0x50b6f1[_0xafca('0x13')]){if(_0x50b6f1[_0xafca('0x13')][_0xafca('0x14')]===0x1f4){logger[_0xafca('0x13')](_0xafca('0xf'),_0x210161,_0x50b6f1['error'][_0xafca('0x15')]);return _0x2e5cb3(_0x50b6f1[_0xafca('0x13')][_0xafca('0x15')]);}logger['error'](_0xafca('0xf'),_0x210161,_0x50b6f1[_0xafca('0x13')][_0xafca('0x15')]);return _0x4c8cf9(_0x50b6f1[_0xafca('0x13')][_0xafca('0x15')]);}else{logger[_0xafca('0x16')](_0xafca('0xf'),_0x210161,_0xafca('0x11'));_0x4c8cf9(_0x50b6f1[_0xafca('0x17')][_0xafca('0x15')]);}})['catch'](function(_0x518348){logger[_0xafca('0x13')](_0xafca('0xf'),_0x210161,_0x518348);_0x2e5cb3(_0x518348);});});}exports[_0xafca('0x18')]=function(_0x1ed34b){var _0x5395e3=this;return new Promise(function(_0x5c9846,_0x14fd24){return db[_0xafca('0x19')]['create'](_0x1ed34b['body'],{'raw':_0x1ed34b['options']?_0x1ed34b[_0xafca('0x1a')][_0xafca('0x1b')]===undefined?!![]:![]:!![]})[_0xafca('0xe')](function(_0x5bc497){logger[_0xafca('0x16')](_0xafca('0x18'),_0x1ed34b);logger[_0xafca('0x10')](_0xafca('0x18'),_0x1ed34b,JSON[_0xafca('0x12')](_0x5bc497));_0x5c9846(_0x5bc497);})[_0xafca('0x1c')](function(_0x338004){logger[_0xafca('0x13')]('CreateSmsMessage',_0x338004[_0xafca('0x15')],_0x1ed34b);_0x14fd24(_0x5395e3[_0xafca('0x13')](0x1f4,_0x338004[_0xafca('0x15')]));});});}; \ No newline at end of file +var _0xf114=['http','redis','defaults','localhost','socket.io-emitter','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','CreateSmsMessage','SmsMessage','body','options','raw','stringify','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4ea571,_0x524bc2){var _0x122eba=function(_0x2b82be){while(--_0x2b82be){_0x4ea571['push'](_0x4ea571['shift']());}};_0x122eba(++_0x524bc2);}(_0xf114,0x1e5));var _0x4f11=function(_0x16838d,_0x44ba72){_0x16838d=_0x16838d-0x0;var _0x2fa9fe=_0xf114[_0x16838d];return _0x2fa9fe;};'use strict';var _=require(_0x4f11('0x0'));var util=require(_0x4f11('0x1'));var moment=require(_0x4f11('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f11('0x3'));var fs=require('fs');var Redis=require(_0x4f11('0x4'));var db=require(_0x4f11('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f11('0x6'))(_0x4f11('0x7'));var config=require(_0x4f11('0x8'));var jayson=require(_0x4f11('0x9'));var client=jayson[_0x4f11('0xa')][_0x4f11('0xb')]({'port':0x232a});config[_0x4f11('0xc')]=_[_0x4f11('0xd')](config['redis'],{'host':_0x4f11('0xe'),'port':0x18eb});var socket=require(_0x4f11('0xf'))(new Redis(config[_0x4f11('0xc')]));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x44d686,_0x5b7c7b,_0x2bb045){return new BPromise(function(_0x2c4bb8,_0x23746d){return client['request'](_0x44d686,_0x2bb045)[_0x4f11('0x10')](function(_0x2f0f56){logger[_0x4f11('0x11')](_0x4f11('0x12'),_0x5b7c7b,'request\x20sent');logger[_0x4f11('0x13')](_0x4f11('0x14'),_0x5b7c7b,'request\x20sent',JSON['stringify'](_0x2f0f56));if(_0x2f0f56[_0x4f11('0x15')]){if(_0x2f0f56['error']['code']===0x1f4){logger[_0x4f11('0x15')]('SmsMessage,\x20%s,\x20%s',_0x5b7c7b,_0x2f0f56['error'][_0x4f11('0x16')]);return _0x23746d(_0x2f0f56[_0x4f11('0x15')][_0x4f11('0x16')]);}logger[_0x4f11('0x15')](_0x4f11('0x12'),_0x5b7c7b,_0x2f0f56[_0x4f11('0x15')][_0x4f11('0x16')]);return _0x2c4bb8(_0x2f0f56[_0x4f11('0x15')][_0x4f11('0x16')]);}else{logger[_0x4f11('0x11')]('SmsMessage,\x20%s,\x20%s',_0x5b7c7b,_0x4f11('0x17'));_0x2c4bb8(_0x2f0f56['result'][_0x4f11('0x16')]);}})['catch'](function(_0x2cdbe0){logger['error'](_0x4f11('0x12'),_0x5b7c7b,_0x2cdbe0);_0x23746d(_0x2cdbe0);});});}exports[_0x4f11('0x18')]=function(_0x4c0d9){var _0xc8224e=this;return new Promise(function(_0x21c269,_0x5ad311){return db[_0x4f11('0x19')]['create'](_0x4c0d9[_0x4f11('0x1a')],{'raw':_0x4c0d9[_0x4f11('0x1b')]?_0x4c0d9[_0x4f11('0x1b')][_0x4f11('0x1c')]===undefined?!![]:![]:!![]})[_0x4f11('0x10')](function(_0x32c1c9){logger[_0x4f11('0x11')](_0x4f11('0x18'),_0x4c0d9);logger[_0x4f11('0x13')](_0x4f11('0x18'),_0x4c0d9,JSON[_0x4f11('0x1d')](_0x32c1c9));_0x21c269(_0x32c1c9);})[_0x4f11('0x1e')](function(_0x31e954){logger['error'](_0x4f11('0x18'),_0x31e954[_0x4f11('0x16')],_0x4c0d9);_0x5ad311(_0xc8224e[_0x4f11('0x15')](0x1f4,_0x31e954[_0x4f11('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index f387f11..d296cdc 100644 --- a/server/api/smsMessage/smsMessage.socket.js +++ b/server/api/smsMessage/smsMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1682=['update','emit','removeListener','length','smsMessage:','./smsMessage.events','remove'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x1682,0x1e1));var _0x2168=function(_0x3639d8,_0xb47e14){_0x3639d8=_0x3639d8-0x0;var _0x32dbc1=_0x1682[_0x3639d8];return _0x32dbc1;};'use strict';var SmsMessageEvents=require(_0x2168('0x0'));var events=['save',_0x2168('0x1'),_0x2168('0x2')];function createListener(_0xc73080,_0x44a84e){return function(_0x229aaf){_0x44a84e[_0x2168('0x3')](_0xc73080,_0x229aaf);};}function removeListener(_0x134734,_0x5139c3){return function(){SmsMessageEvents[_0x2168('0x4')](_0x134734,_0x5139c3);};}exports['register']=function(_0x1790c1){for(var _0x402bcb=0x0,_0x12bcc0=events[_0x2168('0x5')];_0x402bcb<_0x12bcc0;_0x402bcb++){var _0x55bd33=events[_0x402bcb];var _0xfbf0c7=createListener(_0x2168('0x6')+_0x55bd33,_0x1790c1);SmsMessageEvents['on'](_0x55bd33,_0xfbf0c7);}}; \ No newline at end of file +var _0xd97a=['remove','update','emit','removeListener','length','smsMessage:','./smsMessage.events'];(function(_0x2f0162,_0x561c38){var _0x4becec=function(_0xea2491){while(--_0xea2491){_0x2f0162['push'](_0x2f0162['shift']());}};_0x4becec(++_0x561c38);}(_0xd97a,0x164));var _0xad97=function(_0x4516c8,_0x6bada6){_0x4516c8=_0x4516c8-0x0;var _0x24954e=_0xd97a[_0x4516c8];return _0x24954e;};'use strict';var SmsMessageEvents=require(_0xad97('0x0'));var events=['save',_0xad97('0x1'),_0xad97('0x2')];function createListener(_0x24b0d0,_0x48bdd3){return function(_0x4ccd79){_0x48bdd3[_0xad97('0x3')](_0x24b0d0,_0x4ccd79);};}function removeListener(_0x240fad,_0x4bd4a5){return function(){SmsMessageEvents[_0xad97('0x4')](_0x240fad,_0x4bd4a5);};}exports['register']=function(_0x55a8bd){for(var _0x4c2e10=0x0,_0x40d9cb=events[_0xad97('0x5')];_0x4c2e10<_0x40d9cb;_0x4c2e10++){var _0x258cb9=events[_0x4c2e10];var _0x819874=createListener(_0xad97('0x6')+_0x258cb9,_0x55a8bd);SmsMessageEvents['on'](_0x258cb9,_0x819874);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 4d0b1f2..78ece47 100644 --- a/server/api/smsQueue/index.js +++ b/server/api/smsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa41d=['../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','destroy','removeTeams','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1b3b41,_0x107e39){var _0x1e39d1=function(_0x4dead0){while(--_0x4dead0){_0x1b3b41['push'](_0x1b3b41['shift']());}};_0x1e39d1(++_0x107e39);}(_0xa41d,0xad));var _0xda41=function(_0x408358,_0x911a82){_0x408358=_0x408358-0x0;var _0x50cea0=_0xa41d[_0x408358];return _0x50cea0;};'use strict';var multer=require(_0xda41('0x0'));var util=require(_0xda41('0x1'));var path=require(_0xda41('0x2'));var timeout=require(_0xda41('0x3'));var express=require(_0xda41('0x4'));var router=express[_0xda41('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xda41('0x6'));var interaction=require(_0xda41('0x7'));var config=require('../../config/environment');var controller=require(_0xda41('0x8'));router[_0xda41('0x9')]('/',auth[_0xda41('0xa')](),controller[_0xda41('0xb')]);router[_0xda41('0x9')](_0xda41('0xc'),auth[_0xda41('0xa')](),controller['describe']);router['get'](_0xda41('0xd'),auth[_0xda41('0xa')](),controller[_0xda41('0xe')]);router[_0xda41('0x9')]('/:id/members',auth[_0xda41('0xa')](),controller[_0xda41('0xf')]);router[_0xda41('0x9')](_0xda41('0x10'),auth[_0xda41('0xa')](),controller[_0xda41('0x11')]);router[_0xda41('0x9')]('/:id/users',auth[_0xda41('0xa')](),controller[_0xda41('0x12')]);router[_0xda41('0x13')]('/',auth[_0xda41('0xa')](),controller[_0xda41('0x14')]);router['post']('/:id/teams',auth[_0xda41('0xa')](),controller[_0xda41('0x15')]);router[_0xda41('0x13')](_0xda41('0x16'),auth['isAuthenticated'](),controller[_0xda41('0x17')]);router[_0xda41('0x18')](_0xda41('0xd'),auth['isAuthenticated'](),controller[_0xda41('0x19')]);router['delete'](_0xda41('0xd'),auth['isAuthenticated'](),controller[_0xda41('0x1a')]);router['delete'](_0xda41('0x10'),auth[_0xda41('0xa')](),controller[_0xda41('0x1b')]);router[_0xda41('0x1c')](_0xda41('0x16'),auth[_0xda41('0xa')](),controller['removeAgents']);module[_0xda41('0x1d')]=router; \ No newline at end of file +var _0xf969=['addAgents','put','destroy','delete','/:id/users','removeAgents','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/:id','show','/:id/members','/:id/teams','getAgents','create','post'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf969,0x1a5));var _0x9f96=function(_0x27391f,_0x2752df){_0x27391f=_0x27391f-0x0;var _0x910922=_0xf969[_0x27391f];return _0x910922;};'use strict';var multer=require(_0x9f96('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9f96('0x1'));var express=require(_0x9f96('0x2'));var router=express['Router']();var fs_extra=require(_0x9f96('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9f96('0x4'));var config=require('../../config/environment');var controller=require(_0x9f96('0x5'));router[_0x9f96('0x6')]('/',auth[_0x9f96('0x7')](),controller[_0x9f96('0x8')]);router[_0x9f96('0x6')]('/describe',auth[_0x9f96('0x7')](),controller['describe']);router['get'](_0x9f96('0x9'),auth[_0x9f96('0x7')](),controller[_0x9f96('0xa')]);router[_0x9f96('0x6')](_0x9f96('0xb'),auth[_0x9f96('0x7')](),controller['getMembers']);router[_0x9f96('0x6')](_0x9f96('0xc'),auth[_0x9f96('0x7')](),controller['getTeams']);router[_0x9f96('0x6')]('/:id/users',auth[_0x9f96('0x7')](),controller[_0x9f96('0xd')]);router['post']('/',auth[_0x9f96('0x7')](),controller[_0x9f96('0xe')]);router[_0x9f96('0xf')]('/:id/teams',auth[_0x9f96('0x7')](),controller['addTeams']);router[_0x9f96('0xf')]('/:id/users',auth['isAuthenticated'](),controller[_0x9f96('0x10')]);router[_0x9f96('0x11')]('/:id',auth[_0x9f96('0x7')](),controller['update']);router['delete']('/:id',auth[_0x9f96('0x7')](),controller[_0x9f96('0x12')]);router[_0x9f96('0x13')]('/:id/teams',auth[_0x9f96('0x7')](),controller['removeTeams']);router[_0x9f96('0x13')](_0x9f96('0x14'),auth[_0x9f96('0x7')](),controller[_0x9f96('0x15')]);module[_0x9f96('0x16')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index f143600..e036b4b 100644 --- a/server/api/smsQueue/smsQueue.attributes.js +++ b/server/api/smsQueue/smsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87c6=['ENUM','rrmemory','beepall','sequelize','exports','STRING','INTEGER'];(function(_0x31060c,_0x302713){var _0x5e3f63=function(_0x19b53c){while(--_0x19b53c){_0x31060c['push'](_0x31060c['shift']());}};_0x5e3f63(++_0x302713);}(_0x87c6,0x1df));var _0x687c=function(_0x8d3471,_0x3393e3){_0x8d3471=_0x8d3471-0x0;var _0x1d2d06=_0x87c6[_0x8d3471];return _0x1d2d06;};'use strict';var Sequelize=require(_0x687c('0x0'));module[_0x687c('0x1')]={'name':{'type':Sequelize[_0x687c('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x687c('0x2')]},'timeout':{'type':Sequelize[_0x687c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x687c('0x4')](_0x687c('0x5'),_0x687c('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x3889=['INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x25bca9,_0x13d2bf){var _0x319615=function(_0x2d95c4){while(--_0x2d95c4){_0x25bca9['push'](_0x25bca9['shift']());}};_0x319615(++_0x13d2bf);}(_0x3889,0x11c));var _0x9388=function(_0xb16d3d,_0x2be85e){_0xb16d3d=_0xb16d3d-0x0;var _0xf2fbf=_0x3889[_0xb16d3d];return _0xf2fbf;};'use strict';var Sequelize=require(_0x9388('0x0'));module[_0x9388('0x1')]={'name':{'type':Sequelize[_0x9388('0x2')],'unique':_0x9388('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9388('0x2')]},'timeout':{'type':Sequelize[_0x9388('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9388('0x5')](_0x9388('0x6'),'beepall',_0x9388('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 85db943..3700b5a 100644 --- a/server/api/smsQueue/smsQueue.controller.js +++ b/server/api/smsQueue/smsQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['intersection','attributes','model','fields','length','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','update','describe','getMembers','findOne','UserSmsQueue','filters','hasOwnProperty','order','sort','pick','SmsQueueId','filter','User','findAndCountAll','agent','updatedAt','createdAt','SIP','getTeams','Team','nolimit','addTeams','ids','online','voicePause','flatMap','each','findOrCreate','removeTeams','Agents','select','field','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','sequelize','toString','QueryTypes','TeamId','union','compact','value','transaction','isEmpty','emit','addAgents','spread','userSmsQueue:save','removeAgents','isArray','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','then','destroy','get','SmsQueues','UserProfileResource','name','map','SmsQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','keys'];(function(_0x195e0f,_0x339f4b){var _0x3029d8=function(_0x38e062){while(--_0x38e062){_0x195e0f['push'](_0x195e0f['shift']());}};_0x3029d8(++_0x339f4b);}(_0x2ef3,0xba));var _0x32ef=function(_0x76fd26,_0x1667ea){_0x76fd26=_0x76fd26-0x0;var _0x204ec5=_0x2ef3[_0x76fd26];return _0x204ec5;};'use strict';var BPromise=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var _=require(_0x32ef('0x2'));var squel=require(_0x32ef('0x3'));var Redis=require(_0x32ef('0x4'));var qs=require(_0x32ef('0x5'));var logger=require('../../config/logger')(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var db=require('../../mysqldb')['db'];config[_0x32ef('0x8')]=_[_0x32ef('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x32ef('0xa'))(new Redis(config[_0x32ef('0x8')]));require(_0x32ef('0xb'))[_0x32ef('0xc')](socket);function respondWithStatusCode(_0x234863,_0x298066){_0x298066=_0x298066||0xcc;return function(_0x2484a0){if(_0x2484a0){return _0x234863[_0x32ef('0xd')](_0x298066);}return _0x234863[_0x32ef('0xe')](_0x298066)[_0x32ef('0xf')]();};}function respondWithResult(_0x56eb42,_0x5780e9){_0x5780e9=_0x5780e9||0xc8;return function(_0x401d0b){if(_0x401d0b){return _0x56eb42[_0x32ef('0xe')](_0x5780e9)[_0x32ef('0x10')](_0x401d0b);}};}function respondWithFilteredResult(_0x1499c2,_0x5af651){return function(_0x193714){if(_0x193714){var _0x5afcc2=typeof _0x5af651[_0x32ef('0x11')]==='undefined'&&typeof _0x5af651[_0x32ef('0x12')]===_0x32ef('0x13');var _0x5c3eb9=_0x193714['count'];var _0x19ce1=_0x5afcc2?0x0:_0x5af651['offset'];var _0x326fce=_0x5afcc2?_0x193714[_0x32ef('0x14')]:_0x5af651[_0x32ef('0x11')]+_0x5af651[_0x32ef('0x12')];var _0x57aff1;if(_0x326fce>=_0x5c3eb9){_0x326fce=_0x5c3eb9;_0x57aff1=0xc8;}else{_0x57aff1=0xce;}_0x1499c2['status'](_0x57aff1);return _0x1499c2['set'](_0x32ef('0x15'),_0x19ce1+'-'+_0x326fce+'/'+_0x5c3eb9)[_0x32ef('0x10')](_0x193714);}return null;};}function saveUpdates(_0xb5aed2){return function(_0x53a5ca){if(_0x53a5ca){return _0x53a5ca['update'](_0xb5aed2)[_0x32ef('0x16')](function(_0x1a9476){return _0x1a9476;});}return null;};}function removeEntity(_0x286bfb){return function(_0x57863c){if(_0x57863c){return _0x57863c[_0x32ef('0x17')]()[_0x32ef('0x16')](function(){var _0x4f4c98=_0x57863c[_0x32ef('0x18')]({'plain':!![]});var _0x314ef1=_0x32ef('0x19');return db[_0x32ef('0x1a')][_0x32ef('0x17')]({'where':{'type':_0x314ef1,'resourceId':_0x4f4c98['id']}})[_0x32ef('0x16')](function(){return _0x57863c;});})['then'](function(){_0x286bfb[_0x32ef('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x309866){return function(_0x3a20ca){if(!_0x3a20ca){_0x309866['sendStatus'](0x194);}return _0x3a20ca;};}function handleError(_0x1af371,_0x97780){_0x97780=_0x97780||0x1f4;return function(_0x5e8898){logger['error'](_0x5e8898['stack']);if(_0x5e8898[_0x32ef('0x1b')]){delete _0x5e8898[_0x32ef('0x1b')];}_0x1af371[_0x32ef('0xe')](_0x97780)['send'](_0x5e8898);};}exports['index']=function(_0x19ea6,_0x4d584b){var _0x51a412={};var _0x278495={'count':0x0,'rows':[]};var _0x14d4b3=_[_0x32ef('0x1c')](db[_0x32ef('0x1d')][_0x32ef('0x1e')],function(_0x234175){return{'name':_0x234175[_0x32ef('0x1f')],'type':_0x234175[_0x32ef('0x20')][_0x32ef('0x21')]};});_0x51a412=qs[_0x32ef('0x22')](_0x14d4b3,_0x19ea6);var _0x1335e2={'where':_0x51a412[_0x32ef('0x23')]};return db['SmsQueue'][_0x32ef('0x14')](_0x1335e2)[_0x32ef('0x16')](function(_0x5a04cd){_0x278495[_0x32ef('0x14')]=_0x5a04cd;_0x51a412[_0x32ef('0x24')]=qs[_0x32ef('0x24')](_0x19ea6[_0x32ef('0x25')]);return db['SmsQueue'][_0x32ef('0x26')](_0x51a412);})[_0x32ef('0x16')](function(_0x31dbc3){_0x278495[_0x32ef('0x27')]=_0x31dbc3;return _0x278495;})[_0x32ef('0x16')](respondWithFilteredResult(_0x4d584b,_0x51a412))[_0x32ef('0x28')](handleError(_0x4d584b,null));};exports[_0x32ef('0x29')]=function(_0x575f3e,_0x36ac37){var _0x537214={'raw':!![],'where':{'id':_0x575f3e[_0x32ef('0x2a')]['id']}},_0x38bf73={};_0x38bf73['model']=_[_0x32ef('0x2b')](db[_0x32ef('0x1d')][_0x32ef('0x1e')]);_0x38bf73[_0x32ef('0x25')]=_[_0x32ef('0x2b')](_0x575f3e['query']);_0x38bf73['filters']=_[_0x32ef('0x2c')](_0x38bf73['model'],_0x38bf73[_0x32ef('0x25')]);_0x537214[_0x32ef('0x2d')]=_[_0x32ef('0x2c')](_0x38bf73[_0x32ef('0x2e')],qs[_0x32ef('0x2f')](_0x575f3e[_0x32ef('0x25')]['fields']));_0x537214['attributes']=_0x537214['attributes'][_0x32ef('0x30')]?_0x537214[_0x32ef('0x2d')]:_0x38bf73[_0x32ef('0x2e')];if(_0x575f3e['query']['includeAll']){_0x537214[_0x32ef('0x24')]=[{'all':!![]}];}_0x537214=_[_0x32ef('0x31')]({},_0x537214,_0x575f3e[_0x32ef('0x32')]);return db['SmsQueue']['find'](_0x537214)[_0x32ef('0x16')](handleEntityNotFound(_0x36ac37,null))[_0x32ef('0x16')](respondWithResult(_0x36ac37,null))[_0x32ef('0x28')](handleError(_0x36ac37,null));};exports[_0x32ef('0x33')]=function(_0x3a7c49,_0x211c79){return db[_0x32ef('0x1d')][_0x32ef('0x33')](_0x3a7c49[_0x32ef('0x34')],{})['then'](function(_0x3a4a99){var _0x36e374=_0x3a7c49[_0x32ef('0x35')]['get']({'plain':!![]});if(!_0x36e374)throw new Error(_0x32ef('0x36'));if(_0x36e374[_0x32ef('0x37')]===_0x32ef('0x35')){var _0x393a89=_0x3a4a99[_0x32ef('0x18')]({'plain':!![]});var _0x33a0fb=_0x32ef('0x19');return db[_0x32ef('0x38')][_0x32ef('0x39')]({'where':{'name':_0x33a0fb,'userProfileId':_0x36e374[_0x32ef('0x3a')]},'raw':!![]})[_0x32ef('0x16')](function(_0x4615b4){if(_0x4615b4&&_0x4615b4['autoAssociation']===0x0){return db[_0x32ef('0x1a')][_0x32ef('0x33')]({'name':_0x393a89[_0x32ef('0x1b')],'resourceId':_0x393a89['id'],'type':_0x4615b4[_0x32ef('0x1b')],'sectionId':_0x4615b4['id']},{})[_0x32ef('0x16')](function(){return _0x3a4a99;});}else{return _0x3a4a99;}})[_0x32ef('0x28')](function(_0x3c0e44){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c0e44);throw _0x3c0e44;});}return _0x3a4a99;})[_0x32ef('0x16')](respondWithResult(_0x211c79,0xc9))[_0x32ef('0x28')](handleError(_0x211c79,null));};exports[_0x32ef('0x3b')]=function(_0x765c63,_0x5dca14){if(_0x765c63[_0x32ef('0x34')]['id']){delete _0x765c63[_0x32ef('0x34')]['id'];}return db['SmsQueue'][_0x32ef('0x39')]({'where':{'id':_0x765c63['params']['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x5dca14,null))[_0x32ef('0x16')](saveUpdates(_0x765c63[_0x32ef('0x34')],null))[_0x32ef('0x16')](respondWithResult(_0x5dca14,null))[_0x32ef('0x28')](handleError(_0x5dca14,null));};exports[_0x32ef('0x17')]=function(_0x321ef7,_0x3d35a1){return db[_0x32ef('0x1d')][_0x32ef('0x39')]({'where':{'id':_0x321ef7['params']['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x3d35a1,null))['then'](removeEntity(_0x3d35a1,null))[_0x32ef('0x28')](handleError(_0x3d35a1,null));};exports[_0x32ef('0x3c')]=function(_0x2dd94f,_0x4d8393){return db[_0x32ef('0x1d')][_0x32ef('0x3c')]()[_0x32ef('0x16')](respondWithResult(_0x4d8393,null))[_0x32ef('0x28')](handleError(_0x4d8393,null));};exports[_0x32ef('0x3d')]=function(_0x40bf12,_0x12c9e6){var _0x47dbe1={'raw':!![],'where':{}},_0x5cb6fc={},_0x36252c;return db[_0x32ef('0x1d')][_0x32ef('0x3e')]({'where':{'id':_0x40bf12[_0x32ef('0x2a')]['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x12c9e6,null))[_0x32ef('0x16')](function(_0x44ad11){if(_0x44ad11){_0x36252c=_0x44ad11[_0x32ef('0x18')]({'plain':!![]});_0x5cb6fc[_0x32ef('0x2e')]=_[_0x32ef('0x2b')](db[_0x32ef('0x3f')][_0x32ef('0x1e')]);_0x5cb6fc[_0x32ef('0x25')]=_['keys'](_0x40bf12[_0x32ef('0x25')]);_0x5cb6fc[_0x32ef('0x40')]=_[_0x32ef('0x2c')](_0x5cb6fc[_0x32ef('0x2e')],_0x5cb6fc[_0x32ef('0x25')]);_0x47dbe1[_0x32ef('0x2d')]=_[_0x32ef('0x2c')](_0x5cb6fc[_0x32ef('0x2e')],qs[_0x32ef('0x2f')](_0x40bf12[_0x32ef('0x25')][_0x32ef('0x2f')]));_0x47dbe1[_0x32ef('0x2d')]=_0x47dbe1[_0x32ef('0x2d')][_0x32ef('0x30')]?_0x47dbe1[_0x32ef('0x2d')]:_0x5cb6fc[_0x32ef('0x2e')];if(!_0x40bf12[_0x32ef('0x25')][_0x32ef('0x41')]('nolimit')){_0x47dbe1['limit']=qs[_0x32ef('0x12')](_0x40bf12[_0x32ef('0x25')][_0x32ef('0x12')]);_0x47dbe1[_0x32ef('0x11')]=qs[_0x32ef('0x11')](_0x40bf12[_0x32ef('0x25')][_0x32ef('0x11')]);}_0x47dbe1[_0x32ef('0x42')]=qs[_0x32ef('0x43')](_0x40bf12[_0x32ef('0x25')][_0x32ef('0x43')]);_0x47dbe1['where']=qs[_0x32ef('0x40')](_[_0x32ef('0x44')](_0x40bf12[_0x32ef('0x25')],_0x5cb6fc[_0x32ef('0x40')]));_0x47dbe1[_0x32ef('0x23')][_0x32ef('0x45')]=_0x44ad11['id'];if(_0x40bf12['query'][_0x32ef('0x46')]){_0x47dbe1[_0x32ef('0x23')]=_[_0x32ef('0x31')](_0x47dbe1['where'],{'$or':_[_0x32ef('0x1c')](_0x47dbe1['attributes'],function(_0x2ee3dd){var _0xbe35b={};_0xbe35b[_0x2ee3dd]={'$like':'%'+_0x40bf12['query'][_0x32ef('0x46')]+'%'};return _0xbe35b;})});}_0x47dbe1=_['merge']({},_0x47dbe1,_0x40bf12[_0x32ef('0x32')]);return db[_0x32ef('0x3f')][_0x32ef('0x26')](_0x47dbe1);}})[_0x32ef('0x16')](function(_0x2c7bee){if(_0x2c7bee){return db[_0x32ef('0x47')][_0x32ef('0x48')]({'where':{'id':_['map'](_0x2c7bee,'UserId'),'role':_0x32ef('0x49')},'attributes':['id','name','smsPause',_0x32ef('0x4a'),_0x32ef('0x4b')]});}})[_0x32ef('0x16')](function(_0x6aae59){if(_0x6aae59){return{'count':_0x6aae59[_0x32ef('0x14')],'rows':_[_0x32ef('0x1c')](_0x6aae59[_0x32ef('0x27')],function(_0x4249c3){return{'membername':_0x4249c3[_0x32ef('0x1b')],'UserId':_0x4249c3['id'],'queue_name':_0x36252c[_0x32ef('0x1b')],'SmsQueueId':_0x36252c['id'],'interface':util['format']('%s/%s',_0x32ef('0x4c'),_0x4249c3[_0x32ef('0x1b')]),'penalty':0x0,'paused':_0x4249c3['smsPause'],'createdAt':_0x4249c3[_0x32ef('0x4b')],'updatedAt':_0x4249c3[_0x32ef('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x32ef('0x16')](respondWithFilteredResult(_0x12c9e6,_0x47dbe1))['catch'](handleError(_0x12c9e6,null));};exports[_0x32ef('0x4d')]=function(_0x3c31d0,_0x20dcc5){var _0x52dfe0={};var _0x5e6030={};var _0x13ea1a;var _0x47d8bf;return db[_0x32ef('0x1d')]['findOne']({'where':{'id':_0x3c31d0['params']['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x20dcc5,null))[_0x32ef('0x16')](function(_0x10cb37){if(_0x10cb37){_0x13ea1a=_0x10cb37;_0x5e6030['model']=_[_0x32ef('0x2b')](db[_0x32ef('0x4e')][_0x32ef('0x1e')]);_0x5e6030['query']=_[_0x32ef('0x2b')](_0x3c31d0[_0x32ef('0x25')]);_0x5e6030['filters']=_['intersection'](_0x5e6030[_0x32ef('0x2e')],_0x5e6030[_0x32ef('0x25')]);_0x52dfe0[_0x32ef('0x2d')]=_[_0x32ef('0x2c')](_0x5e6030[_0x32ef('0x2e')],qs[_0x32ef('0x2f')](_0x3c31d0['query'][_0x32ef('0x2f')]));_0x52dfe0[_0x32ef('0x2d')]=_0x52dfe0[_0x32ef('0x2d')][_0x32ef('0x30')]?_0x52dfe0[_0x32ef('0x2d')]:_0x5e6030[_0x32ef('0x2e')];_0x52dfe0[_0x32ef('0x42')]=qs[_0x32ef('0x43')](_0x3c31d0[_0x32ef('0x25')]['sort']);_0x52dfe0[_0x32ef('0x23')]=qs[_0x32ef('0x40')](_[_0x32ef('0x44')](_0x3c31d0[_0x32ef('0x25')],_0x5e6030[_0x32ef('0x40')]));if(_0x3c31d0['query']['filter']){_0x52dfe0[_0x32ef('0x23')]=_[_0x32ef('0x31')](_0x52dfe0[_0x32ef('0x23')],{'$or':_[_0x32ef('0x1c')](_0x52dfe0[_0x32ef('0x2d')],function(_0x526fb1){var _0x3372d9={};_0x3372d9[_0x526fb1]={'$like':'%'+_0x3c31d0['query'][_0x32ef('0x46')]+'%'};return _0x3372d9;})});}_0x52dfe0=_[_0x32ef('0x31')]({},_0x52dfe0,_0x3c31d0['options']);return _0x13ea1a['getTeams'](_0x52dfe0);}})[_0x32ef('0x16')](function(_0x1538d0){if(_0x1538d0){_0x47d8bf=_0x1538d0[_0x32ef('0x30')];if(!_0x3c31d0['query']['hasOwnProperty'](_0x32ef('0x4f'))){_0x52dfe0[_0x32ef('0x12')]=qs[_0x32ef('0x12')](_0x3c31d0[_0x32ef('0x25')]['limit']);_0x52dfe0[_0x32ef('0x11')]=qs[_0x32ef('0x11')](_0x3c31d0[_0x32ef('0x25')][_0x32ef('0x11')]);}return _0x13ea1a[_0x32ef('0x4d')](_0x52dfe0);}})[_0x32ef('0x16')](function(_0x43b176){if(_0x43b176){return _0x43b176?{'count':_0x47d8bf,'rows':_0x43b176}:null;}})[_0x32ef('0x16')](respondWithResult(_0x20dcc5,null))[_0x32ef('0x28')](handleError(_0x20dcc5,null));};exports[_0x32ef('0x50')]=function(_0x132d9f,_0x3978cb){var _0x52b32f=_0x132d9f['body'][_0x32ef('0x51')];return db[_0x32ef('0x4e')]['findAll']({'where':{'id':_0x52b32f},'attributes':['id'],'include':[{'model':db[_0x32ef('0x47')],'as':'Agents','attributes':['id',_0x32ef('0x1b'),_0x32ef('0x52'),_0x32ef('0x53'),'interface'],'raw':!![]}]})[_0x32ef('0x16')](function(_0x4978a6){if(_0x4978a6){var _0x141fec=_[_0x32ef('0x54')](_0x4978a6,function(_0x47e3cc){var _0x4c70e0=_0x47e3cc[_0x32ef('0x18')]({'plain':!![]});return _0x4c70e0['Agents'];});return db[_0x32ef('0x1d')]['find']({'where':{'id':_0x132d9f[_0x32ef('0x2a')]['id']}})[_0x32ef('0x16')](function(_0x1adcb8){return db['sequelize']['transaction'](function(_0x4f1b94){return _0x1adcb8[_0x32ef('0x50')](_0x52b32f,{'transaction':_0x4f1b94})['then'](function(){return BPromise[_0x32ef('0x55')](_0x141fec,function(_0x13a374){return db[_0x32ef('0x3f')][_0x32ef('0x56')]({'where':{'UserId':_0x13a374['id'],'SmsQueueId':_0x132d9f[_0x32ef('0x2a')]['id']},'transaction':_0x4f1b94});});})[_0x32ef('0x16')](function(){_0x141fec['forEach'](function(_0x3d9245){socket['emit']('userSmsQueue:save',{'UserId':_0x3d9245['id'],'SmsQueueId':_0x1adcb8['id']});});});});});}})[_0x32ef('0x16')](respondWithStatusCode(_0x3978cb,null))['catch'](handleError(_0x3978cb,null));};exports[_0x32ef('0x57')]=function(_0x313798,_0x4d64ec){return db[_0x32ef('0x4e')][_0x32ef('0x26')]({'where':{'id':_0x313798[_0x32ef('0x25')][_0x32ef('0x51')]},'attributes':['id'],'include':[{'model':db[_0x32ef('0x47')],'as':_0x32ef('0x58'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4d64ec,null))['then'](function(_0x35b10d){var _0x5e0b55=_[_0x32ef('0x1c')](_0x35b10d,'id');var _0x266688=[];var _0x114d8e=[];var _0x1782a5=squel[_0x32ef('0x59')]();_0x1782a5[_0x32ef('0x5a')]('tq.TeamId')[_0x32ef('0x5b')](_0x32ef('0x5c'),'tq')[_0x32ef('0x5d')](_0x32ef('0x5e'),'ut',_0x32ef('0x5f'))['where']('SmsQueueId\x20=\x20?',_0x313798[_0x32ef('0x2a')]['id']);for(var _0x904a4f=0x0;_0x904a4f<_0x35b10d['length'];_0x904a4f+=0x1){let _0x211fb1=_0x35b10d[_0x904a4f];for(var _0x2e333d=0x0;_0x2e333d<_0x211fb1[_0x32ef('0x58')][_0x32ef('0x30')];_0x2e333d+=0x1){let _0xc3664d=_0x211fb1[_0x32ef('0x58')][_0x2e333d];var _0xfb4845=_0x1782a5[_0x32ef('0x60')]();_0xfb4845[_0x32ef('0x23')]('ut.UserId\x20=\x20?',_0xc3664d['id']);_0x114d8e[_0x32ef('0x61')](db[_0x32ef('0x62')]['query'](_0xfb4845[_0x32ef('0x63')](),{'type':db['sequelize'][_0x32ef('0x64')]['SELECT']})[_0x32ef('0x16')](function(_0x39300f){if(_0x39300f[_0x32ef('0x30')]===0x1){return _0xc3664d['id'];}else{var _0x3e000c=_['every'](_[_0x32ef('0x1c')](_0x39300f,_0x32ef('0x65')),function(_0x31f99f){return _['includes'](_0x5e0b55,_0x31f99f);});if(_0x3e000c){return _0xc3664d['id'];}}}));}}return BPromise['all'](_0x114d8e)['then'](function(_0x1aff33){_0x266688=_(_0x266688)[_0x32ef('0x66')](_0x1aff33)[_0x32ef('0x67')]()[_0x32ef('0x68')]();return db[_0x32ef('0x1d')]['find']({'where':{'id':_0x313798[_0x32ef('0x2a')]['id']}})['then'](function(_0x471de6){return db[_0x32ef('0x62')][_0x32ef('0x69')](function(_0x4baa7a){return _0x471de6[_0x32ef('0x57')](_0x313798[_0x32ef('0x25')][_0x32ef('0x51')],{'transaction':_0x4baa7a})[_0x32ef('0x16')](function(){if(!_[_0x32ef('0x6a')](_0x266688)){return _0x471de6['removeAgents'](_0x266688,{'transaction':_0x4baa7a});}})[_0x32ef('0x16')](function(){_0x266688['forEach'](function(_0x4f0433){socket[_0x32ef('0x6b')]('userSmsQueue:remove',{'UserId':_0x4f0433,'SmsQueueId':_0x471de6['id']});});});});});});})['then'](respondWithStatusCode(_0x4d64ec,null))[_0x32ef('0x28')](handleError(_0x4d64ec,null));};exports[_0x32ef('0x6c')]=function(_0xf6bc02,_0x3b9896){return db['SmsQueue'][_0x32ef('0x39')]({'where':{'id':_0xf6bc02['params']['id']}})['then'](handleEntityNotFound(_0x3b9896,null))[_0x32ef('0x16')](function(_0x56aede){if(_0x56aede){return _0x56aede[_0x32ef('0x6c')](_0xf6bc02[_0x32ef('0x34')][_0x32ef('0x51')],_['omit'](_0xf6bc02['body'],[_0x32ef('0x51'),'id'])||{})[_0x32ef('0x6d')](function(_0x2c4a3c){for(var _0x3741f8=0x0;_0x3741f8<_0xf6bc02[_0x32ef('0x34')][_0x32ef('0x51')][_0x32ef('0x30')];_0x3741f8+=0x1){socket['emit'](_0x32ef('0x6e'),{'UserId':Number(_0xf6bc02[_0x32ef('0x34')][_0x32ef('0x51')][_0x3741f8]),'SmsQueueId':Number(_0xf6bc02[_0x32ef('0x2a')]['id'])});}return _0x2c4a3c;});}})['then'](respondWithResult(_0x3b9896,null))['catch'](handleError(_0x3b9896,null));};exports[_0x32ef('0x6f')]=function(_0x5eb320,_0x116951){return db[_0x32ef('0x1d')]['find']({'where':{'id':_0x5eb320['params']['id']}})['then'](handleEntityNotFound(_0x116951,null))[_0x32ef('0x16')](function(_0x33f6c3){if(_0x33f6c3){return _0x33f6c3[_0x32ef('0x6f')](_0x5eb320[_0x32ef('0x25')]['ids'])[_0x32ef('0x16')](function(){if(_[_0x32ef('0x70')](_0x5eb320[_0x32ef('0x25')]['ids'])){for(var _0x2895ad=0x0;_0x2895ad<_0x5eb320['query'][_0x32ef('0x51')][_0x32ef('0x30')];_0x2895ad+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x5eb320[_0x32ef('0x25')][_0x32ef('0x51')][_0x2895ad]),'SmsQueueId':Number(_0x5eb320[_0x32ef('0x2a')]['id'])});}}else{socket[_0x32ef('0x6b')](_0x32ef('0x71'),{'UserId':Number(_0x5eb320[_0x32ef('0x25')][_0x32ef('0x51')]),'SmsQueueId':Number(_0x5eb320[_0x32ef('0x2a')]['id'])});}});}})[_0x32ef('0x16')](respondWithStatusCode(_0x116951,null))['catch'](handleError(_0x116951,null));};exports[_0x32ef('0x72')]=function(_0x583290,_0x22d657){var _0x7e47b9={};var _0x1d9d57={};var _0x18cf5d;var _0x102f2f;return db['SmsQueue'][_0x32ef('0x3e')]({'where':{'id':_0x583290[_0x32ef('0x2a')]['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x22d657,null))[_0x32ef('0x16')](function(_0x1db74d){if(_0x1db74d){_0x18cf5d=_0x1db74d;_0x1d9d57[_0x32ef('0x2e')]=_[_0x32ef('0x2b')](db[_0x32ef('0x47')][_0x32ef('0x1e')]);_0x1d9d57['query']=_['keys'](_0x583290['query']);_0x1d9d57[_0x32ef('0x40')]=_[_0x32ef('0x2c')](_0x1d9d57['model'],_0x1d9d57[_0x32ef('0x25')]);_0x7e47b9['attributes']=_[_0x32ef('0x2c')](_0x1d9d57['model'],qs['fields'](_0x583290[_0x32ef('0x25')][_0x32ef('0x2f')]));_0x7e47b9[_0x32ef('0x2d')]=_0x7e47b9[_0x32ef('0x2d')][_0x32ef('0x30')]?_0x7e47b9['attributes']:_0x1d9d57[_0x32ef('0x2e')];_0x7e47b9['order']=qs[_0x32ef('0x43')](_0x583290['query']['sort']);_0x7e47b9['where']=qs['filters'](_['pick'](_0x583290[_0x32ef('0x25')],_0x1d9d57[_0x32ef('0x40')]));if(_0x583290['query'][_0x32ef('0x46')]){_0x7e47b9[_0x32ef('0x23')]=_[_0x32ef('0x31')](_0x7e47b9[_0x32ef('0x23')],{'$or':_[_0x32ef('0x1c')](_0x7e47b9[_0x32ef('0x2d')],function(_0x59f0aa){var _0x2ac861={};_0x2ac861[_0x59f0aa]={'$like':'%'+_0x583290['query'][_0x32ef('0x46')]+'%'};return _0x2ac861;})});}_0x7e47b9=_[_0x32ef('0x31')]({},_0x7e47b9,_0x583290['options']);return _0x18cf5d[_0x32ef('0x72')](_0x7e47b9);}})['then'](function(_0x4557b0){if(_0x4557b0){_0x102f2f=_0x4557b0[_0x32ef('0x30')];if(!_0x583290[_0x32ef('0x25')][_0x32ef('0x41')]('nolimit')){_0x7e47b9[_0x32ef('0x12')]=qs[_0x32ef('0x12')](_0x583290[_0x32ef('0x25')][_0x32ef('0x12')]);_0x7e47b9['offset']=qs[_0x32ef('0x11')](_0x583290['query'][_0x32ef('0x11')]);}return _0x18cf5d[_0x32ef('0x72')](_0x7e47b9);}})[_0x32ef('0x16')](function(_0x28ef17){if(_0x28ef17){return _0x28ef17?{'count':_0x102f2f,'rows':_0x28ef17}:null;}})[_0x32ef('0x16')](respondWithResult(_0x22d657,null))[_0x32ef('0x28')](handleError(_0x22d657,null));}; \ No newline at end of file +var _0x7a54=['transaction','addTeams','each','findOrCreate','userSmsQueue:save','removeTeams','Team','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','QueryTypes','SELECT','every','includes','all','compact','isEmpty','forEach','userSmsQueue:remove','addAgents','omit','emit','removeAgents','isArray','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','then','get','SmsQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','SmsQueue','include','rows','catch','show','params','model','query','intersection','fields','attributes','includeAll','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','limit','order','sort','filters','pick','filter','User','UserId','createdAt','format','%s/%s','smsPause','getTeams','keys','nolimit','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize'];(function(_0x10770a,_0x177f6b){var _0x3431de=function(_0x4d845e){while(--_0x4d845e){_0x10770a['push'](_0x10770a['shift']());}};_0x3431de(++_0x177f6b);}(_0x7a54,0x106));var _0x47a5=function(_0x94e2d1,_0x2e9525){_0x94e2d1=_0x94e2d1-0x0;var _0x2046d2=_0x7a54[_0x94e2d1];return _0x2046d2;};'use strict';var BPromise=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var squel=require('squel');var Redis=require(_0x47a5('0x3'));var qs=require(_0x47a5('0x4'));var logger=require('../../config/logger')(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var db=require(_0x47a5('0x7'))['db'];config[_0x47a5('0x8')]=_[_0x47a5('0x9')](config['redis'],{'host':_0x47a5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x8')]));require(_0x47a5('0xb'))['register'](socket);function respondWithStatusCode(_0x194fb0,_0x5077f3){_0x5077f3=_0x5077f3||0xcc;return function(_0x5d90b3){if(_0x5d90b3){return _0x194fb0['sendStatus'](_0x5077f3);}return _0x194fb0[_0x47a5('0xc')](_0x5077f3)[_0x47a5('0xd')]();};}function respondWithResult(_0x5e31dd,_0x2eb0dd){_0x2eb0dd=_0x2eb0dd||0xc8;return function(_0x49e844){if(_0x49e844){return _0x5e31dd['status'](_0x2eb0dd)[_0x47a5('0xe')](_0x49e844);}};}function respondWithFilteredResult(_0x69e4d4,_0x2f399b){return function(_0x250fad){if(_0x250fad){var _0xd612dd=typeof _0x2f399b[_0x47a5('0xf')]===_0x47a5('0x10')&&typeof _0x2f399b['limit']===_0x47a5('0x10');var _0x221b54=_0x250fad[_0x47a5('0x11')];var _0x711793=_0xd612dd?0x0:_0x2f399b[_0x47a5('0xf')];var _0x620ee9=_0xd612dd?_0x250fad[_0x47a5('0x11')]:_0x2f399b[_0x47a5('0xf')]+_0x2f399b['limit'];var _0x362359;if(_0x620ee9>=_0x221b54){_0x620ee9=_0x221b54;_0x362359=0xc8;}else{_0x362359=0xce;}_0x69e4d4[_0x47a5('0xc')](_0x362359);return _0x69e4d4[_0x47a5('0x12')](_0x47a5('0x13'),_0x711793+'-'+_0x620ee9+'/'+_0x221b54)[_0x47a5('0xe')](_0x250fad);}return null;};}function saveUpdates(_0x574af6){return function(_0x549de3){if(_0x549de3){return _0x549de3[_0x47a5('0x14')](_0x574af6)['then'](function(_0x5247fd){return _0x5247fd;});}return null;};}function removeEntity(_0x423a81){return function(_0xaf70a6){if(_0xaf70a6){return _0xaf70a6[_0x47a5('0x15')]()[_0x47a5('0x16')](function(){var _0x477b1d=_0xaf70a6[_0x47a5('0x17')]({'plain':!![]});var _0x2763d6=_0x47a5('0x18');return db[_0x47a5('0x19')]['destroy']({'where':{'type':_0x2763d6,'resourceId':_0x477b1d['id']}})[_0x47a5('0x16')](function(){return _0xaf70a6;});})[_0x47a5('0x16')](function(){_0x423a81['status'](0xcc)[_0x47a5('0xd')]();});}};}function handleEntityNotFound(_0x1f03f7){return function(_0x36874d){if(!_0x36874d){_0x1f03f7['sendStatus'](0x194);}return _0x36874d;};}function handleError(_0xb8ae6c,_0x2f142b){_0x2f142b=_0x2f142b||0x1f4;return function(_0x23db32){logger[_0x47a5('0x1a')](_0x23db32['stack']);if(_0x23db32[_0x47a5('0x1b')]){delete _0x23db32[_0x47a5('0x1b')];}_0xb8ae6c['status'](_0x2f142b)[_0x47a5('0x1c')](_0x23db32);};}exports[_0x47a5('0x1d')]=function(_0x4437f1,_0x129ce5){var _0x3abd6a={};var _0x50bf17={'count':0x0,'rows':[]};var _0x53078a=_[_0x47a5('0x1e')](db['SmsQueue'][_0x47a5('0x1f')],function(_0x5b6c4e){return{'name':_0x5b6c4e[_0x47a5('0x20')],'type':_0x5b6c4e[_0x47a5('0x21')][_0x47a5('0x22')]};});_0x3abd6a=qs[_0x47a5('0x23')](_0x53078a,_0x4437f1);var _0x21f296={'where':_0x3abd6a[_0x47a5('0x24')]};return db[_0x47a5('0x25')][_0x47a5('0x11')](_0x21f296)[_0x47a5('0x16')](function(_0x361bfa){_0x50bf17[_0x47a5('0x11')]=_0x361bfa;_0x3abd6a[_0x47a5('0x26')]=qs[_0x47a5('0x26')](_0x4437f1['query']);return db[_0x47a5('0x25')]['findAll'](_0x3abd6a);})[_0x47a5('0x16')](function(_0x9ac908){_0x50bf17[_0x47a5('0x27')]=_0x9ac908;return _0x50bf17;})['then'](respondWithFilteredResult(_0x129ce5,_0x3abd6a))[_0x47a5('0x28')](handleError(_0x129ce5,null));};exports[_0x47a5('0x29')]=function(_0x39b50b,_0x1f1c68){var _0x51cc81={'raw':!![],'where':{'id':_0x39b50b[_0x47a5('0x2a')]['id']}},_0x50d875={};_0x50d875[_0x47a5('0x2b')]=_['keys'](db['SmsQueue'][_0x47a5('0x1f')]);_0x50d875[_0x47a5('0x2c')]=_['keys'](_0x39b50b[_0x47a5('0x2c')]);_0x50d875['filters']=_[_0x47a5('0x2d')](_0x50d875[_0x47a5('0x2b')],_0x50d875['query']);_0x51cc81['attributes']=_[_0x47a5('0x2d')](_0x50d875['model'],qs[_0x47a5('0x2e')](_0x39b50b[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x51cc81['attributes']=_0x51cc81[_0x47a5('0x2f')]['length']?_0x51cc81['attributes']:_0x50d875[_0x47a5('0x2b')];if(_0x39b50b['query'][_0x47a5('0x30')]){_0x51cc81['include']=[{'all':!![]}];}_0x51cc81=_[_0x47a5('0x31')]({},_0x51cc81,_0x39b50b[_0x47a5('0x32')]);return db[_0x47a5('0x25')][_0x47a5('0x33')](_0x51cc81)[_0x47a5('0x16')](handleEntityNotFound(_0x1f1c68,null))[_0x47a5('0x16')](respondWithResult(_0x1f1c68,null))[_0x47a5('0x28')](handleError(_0x1f1c68,null));};exports[_0x47a5('0x34')]=function(_0x1a0d23,_0x4caed5){return db[_0x47a5('0x25')][_0x47a5('0x34')](_0x1a0d23['body'],{})[_0x47a5('0x16')](function(_0x2bf53d){var _0x1d4348=_0x1a0d23['user'][_0x47a5('0x17')]({'plain':!![]});if(!_0x1d4348)throw new Error(_0x47a5('0x35'));if(_0x1d4348['role']===_0x47a5('0x36')){var _0x19218a=_0x2bf53d['get']({'plain':!![]});var _0x55c5eb='SmsQueues';return db[_0x47a5('0x37')]['find']({'where':{'name':_0x55c5eb,'userProfileId':_0x1d4348[_0x47a5('0x38')]},'raw':!![]})[_0x47a5('0x16')](function(_0x301a85){if(_0x301a85&&_0x301a85[_0x47a5('0x39')]===0x0){return db[_0x47a5('0x19')][_0x47a5('0x34')]({'name':_0x19218a[_0x47a5('0x1b')],'resourceId':_0x19218a['id'],'type':_0x301a85[_0x47a5('0x1b')],'sectionId':_0x301a85['id']},{})[_0x47a5('0x16')](function(){return _0x2bf53d;});}else{return _0x2bf53d;}})[_0x47a5('0x28')](function(_0x280500){logger[_0x47a5('0x1a')](_0x47a5('0x3a'),_0x280500);throw _0x280500;});}return _0x2bf53d;})['then'](respondWithResult(_0x4caed5,0xc9))[_0x47a5('0x28')](handleError(_0x4caed5,null));};exports[_0x47a5('0x14')]=function(_0x331474,_0x23bd8d){if(_0x331474['body']['id']){delete _0x331474[_0x47a5('0x3b')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x331474['params']['id']}})['then'](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x16')](saveUpdates(_0x331474['body'],null))[_0x47a5('0x16')](respondWithResult(_0x23bd8d,null))[_0x47a5('0x28')](handleError(_0x23bd8d,null));};exports[_0x47a5('0x15')]=function(_0x494526,_0x3805fd){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x494526['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3805fd,null))['then'](removeEntity(_0x3805fd,null))[_0x47a5('0x28')](handleError(_0x3805fd,null));};exports[_0x47a5('0x3c')]=function(_0x188614,_0xd75ca3){return db[_0x47a5('0x25')][_0x47a5('0x3c')]()[_0x47a5('0x16')](respondWithResult(_0xd75ca3,null))[_0x47a5('0x28')](handleError(_0xd75ca3,null));};exports[_0x47a5('0x3d')]=function(_0x162fa0,_0x24ecb1){var _0x3c3ebf={'raw':!![],'where':{}},_0xe28d76={},_0x3574d4;return db[_0x47a5('0x25')][_0x47a5('0x3e')]({'where':{'id':_0x162fa0['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x24ecb1,null))[_0x47a5('0x16')](function(_0x49eab1){if(_0x49eab1){_0x3574d4=_0x49eab1['get']({'plain':!![]});_0xe28d76[_0x47a5('0x2b')]=_['keys'](db[_0x47a5('0x3f')][_0x47a5('0x1f')]);_0xe28d76['query']=_['keys'](_0x162fa0[_0x47a5('0x2c')]);_0xe28d76['filters']=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],_0xe28d76[_0x47a5('0x2c')]);_0x3c3ebf[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x162fa0['query']['fields']));_0x3c3ebf[_0x47a5('0x2f')]=_0x3c3ebf[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x3c3ebf[_0x47a5('0x2f')]:_0xe28d76[_0x47a5('0x2b')];if(!_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x41')]('nolimit')){_0x3c3ebf[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x162fa0[_0x47a5('0x2c')]['limit']);_0x3c3ebf[_0x47a5('0xf')]=qs['offset'](_0x162fa0[_0x47a5('0x2c')][_0x47a5('0xf')]);}_0x3c3ebf[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x162fa0['query'][_0x47a5('0x44')]);_0x3c3ebf[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_[_0x47a5('0x46')](_0x162fa0[_0x47a5('0x2c')],_0xe28d76[_0x47a5('0x45')]));_0x3c3ebf[_0x47a5('0x24')]['SmsQueueId']=_0x49eab1['id'];if(_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x3c3ebf[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x3c3ebf[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x3c3ebf['attributes'],function(_0x1ad6a9){var _0x245a15={};_0x245a15[_0x1ad6a9]={'$like':'%'+_0x162fa0[_0x47a5('0x2c')]['filter']+'%'};return _0x245a15;})});}_0x3c3ebf=_[_0x47a5('0x31')]({},_0x3c3ebf,_0x162fa0[_0x47a5('0x32')]);return db[_0x47a5('0x3f')]['findAll'](_0x3c3ebf);}})['then'](function(_0x274e38){if(_0x274e38){return db[_0x47a5('0x48')]['findAndCountAll']({'where':{'id':_['map'](_0x274e38,_0x47a5('0x49')),'role':'agent'},'attributes':['id',_0x47a5('0x1b'),'smsPause','updatedAt',_0x47a5('0x4a')]});}})[_0x47a5('0x16')](function(_0x53eedf){if(_0x53eedf){return{'count':_0x53eedf[_0x47a5('0x11')],'rows':_[_0x47a5('0x1e')](_0x53eedf['rows'],function(_0x5b6127){return{'membername':_0x5b6127[_0x47a5('0x1b')],'UserId':_0x5b6127['id'],'queue_name':_0x3574d4[_0x47a5('0x1b')],'SmsQueueId':_0x3574d4['id'],'interface':util[_0x47a5('0x4b')](_0x47a5('0x4c'),'SIP',_0x5b6127[_0x47a5('0x1b')]),'penalty':0x0,'paused':_0x5b6127[_0x47a5('0x4d')],'createdAt':_0x5b6127[_0x47a5('0x4a')],'updatedAt':_0x5b6127['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x47a5('0x16')](respondWithFilteredResult(_0x24ecb1,_0x3c3ebf))['catch'](handleError(_0x24ecb1,null));};exports[_0x47a5('0x4e')]=function(_0x470da6,_0x943a15){var _0x1c485b={};var _0x3603b7={};var _0x4966af;var _0x144af9;return db['SmsQueue']['findOne']({'where':{'id':_0x470da6['params']['id']}})['then'](handleEntityNotFound(_0x943a15,null))[_0x47a5('0x16')](function(_0x6cd4ea){if(_0x6cd4ea){_0x4966af=_0x6cd4ea;_0x3603b7[_0x47a5('0x2b')]=_['keys'](db['Team'][_0x47a5('0x1f')]);_0x3603b7[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x470da6[_0x47a5('0x2c')]);_0x3603b7[_0x47a5('0x45')]=_['intersection'](_0x3603b7[_0x47a5('0x2b')],_0x3603b7['query']);_0x1c485b[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0x3603b7['model'],qs[_0x47a5('0x2e')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x1c485b[_0x47a5('0x2f')]=_0x1c485b[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x1c485b[_0x47a5('0x2f')]:_0x3603b7[_0x47a5('0x2b')];_0x1c485b['order']=qs[_0x47a5('0x44')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x44')]);_0x1c485b[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x470da6[_0x47a5('0x2c')],_0x3603b7[_0x47a5('0x45')]));if(_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x1c485b[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x1c485b[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x1c485b[_0x47a5('0x2f')],function(_0x44cb90){var _0x1d56f3={};_0x1d56f3[_0x44cb90]={'$like':'%'+_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x1d56f3;})});}_0x1c485b=_[_0x47a5('0x31')]({},_0x1c485b,_0x470da6[_0x47a5('0x32')]);return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x284fb8){if(_0x284fb8){_0x144af9=_0x284fb8[_0x47a5('0x40')];if(!_0x470da6['query'][_0x47a5('0x41')](_0x47a5('0x50'))){_0x1c485b[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x470da6['query'][_0x47a5('0x42')]);_0x1c485b['offset']=qs[_0x47a5('0xf')](_0x470da6['query'][_0x47a5('0xf')]);}return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x2f27c3){if(_0x2f27c3){return _0x2f27c3?{'count':_0x144af9,'rows':_0x2f27c3}:null;}})[_0x47a5('0x16')](respondWithResult(_0x943a15,null))['catch'](handleError(_0x943a15,null));};exports['addTeams']=function(_0x4b8084,_0x4164a3){var _0x2b1303=_0x4b8084[_0x47a5('0x3b')][_0x47a5('0x51')];return db['Team'][_0x47a5('0x52')]({'where':{'id':_0x2b1303},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id',_0x47a5('0x1b'),_0x47a5('0x54'),_0x47a5('0x55'),_0x47a5('0x56')],'raw':!![]}]})[_0x47a5('0x16')](function(_0x4618a0){if(_0x4618a0){var _0xc69a68=_[_0x47a5('0x57')](_0x4618a0,function(_0x463e5e){var _0x49d3dc=_0x463e5e[_0x47a5('0x17')]({'plain':!![]});return _0x49d3dc['Agents'];});return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x4b8084[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x40e584){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x448981){return _0x40e584[_0x47a5('0x5a')](_0x2b1303,{'transaction':_0x448981})[_0x47a5('0x16')](function(){return BPromise[_0x47a5('0x5b')](_0xc69a68,function(_0x1f07ac){return db[_0x47a5('0x3f')][_0x47a5('0x5c')]({'where':{'UserId':_0x1f07ac['id'],'SmsQueueId':_0x4b8084[_0x47a5('0x2a')]['id']},'transaction':_0x448981});});})['then'](function(){_0xc69a68['forEach'](function(_0x5ccc89){socket['emit'](_0x47a5('0x5d'),{'UserId':_0x5ccc89['id'],'SmsQueueId':_0x40e584['id']});});});});});}})[_0x47a5('0x16')](respondWithStatusCode(_0x4164a3,null))['catch'](handleError(_0x4164a3,null));};exports[_0x47a5('0x5e')]=function(_0x44dda2,_0x1baa5a){return db[_0x47a5('0x5f')][_0x47a5('0x52')]({'where':{'id':_0x44dda2[_0x47a5('0x2c')][_0x47a5('0x51')]},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id'],'raw':!![]}]})[_0x47a5('0x16')](handleEntityNotFound(_0x1baa5a,null))[_0x47a5('0x16')](function(_0x5e5f16){var _0x18fa31=_[_0x47a5('0x1e')](_0x5e5f16,'id');var _0x420671=[];var _0x4f35ff=[];var _0x340846=squel[_0x47a5('0x60')]();_0x340846[_0x47a5('0x61')]('tq.TeamId')[_0x47a5('0x62')]('team_has_sms_queues','tq')['join'](_0x47a5('0x63'),'ut',_0x47a5('0x64'))[_0x47a5('0x24')](_0x47a5('0x65'),_0x44dda2[_0x47a5('0x2a')]['id']);for(var _0xea50f3=0x0;_0xea50f3<_0x5e5f16['length'];_0xea50f3+=0x1){let _0x592322=_0x5e5f16[_0xea50f3];for(var _0x3e0dbd=0x0;_0x3e0dbd<_0x592322['Agents'][_0x47a5('0x40')];_0x3e0dbd+=0x1){let _0x3fffd1=_0x592322[_0x47a5('0x53')][_0x3e0dbd];var _0xb16bdd=_0x340846['clone']();_0xb16bdd[_0x47a5('0x24')]('ut.UserId\x20=\x20?',_0x3fffd1['id']);_0x4f35ff['push'](db[_0x47a5('0x58')][_0x47a5('0x2c')](_0xb16bdd['toString'](),{'type':db[_0x47a5('0x58')][_0x47a5('0x66')][_0x47a5('0x67')]})['then'](function(_0x280372){if(_0x280372['length']===0x1){return _0x3fffd1['id'];}else{var _0x2307da=_[_0x47a5('0x68')](_[_0x47a5('0x1e')](_0x280372,'TeamId'),function(_0x2e0af1){return _[_0x47a5('0x69')](_0x18fa31,_0x2e0af1);});if(_0x2307da){return _0x3fffd1['id'];}}}));}}return BPromise[_0x47a5('0x6a')](_0x4f35ff)['then'](function(_0x3525e7){_0x420671=_(_0x420671)['union'](_0x3525e7)[_0x47a5('0x6b')]()['value']();return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x44dda2[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x51738b){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x23c393){return _0x51738b[_0x47a5('0x5e')](_0x44dda2[_0x47a5('0x2c')]['ids'],{'transaction':_0x23c393})['then'](function(){if(!_[_0x47a5('0x6c')](_0x420671)){return _0x51738b['removeAgents'](_0x420671,{'transaction':_0x23c393});}})[_0x47a5('0x16')](function(){_0x420671[_0x47a5('0x6d')](function(_0x216402){socket['emit'](_0x47a5('0x6e'),{'UserId':_0x216402,'SmsQueueId':_0x51738b['id']});});});});});});})[_0x47a5('0x16')](respondWithStatusCode(_0x1baa5a,null))['catch'](handleError(_0x1baa5a,null));};exports[_0x47a5('0x6f')]=function(_0x8a9dea,_0x19acfa){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x8a9dea['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x19acfa,null))[_0x47a5('0x16')](function(_0x48e7f3){if(_0x48e7f3){return _0x48e7f3[_0x47a5('0x6f')](_0x8a9dea[_0x47a5('0x3b')]['ids'],_[_0x47a5('0x70')](_0x8a9dea[_0x47a5('0x3b')],[_0x47a5('0x51'),'id'])||{})['spread'](function(_0x3f2ad9){for(var _0x59b4a5=0x0;_0x59b4a5<_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x47a5('0x40')];_0x59b4a5+=0x1){socket[_0x47a5('0x71')]('userSmsQueue:save',{'UserId':Number(_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x59b4a5]),'SmsQueueId':Number(_0x8a9dea[_0x47a5('0x2a')]['id'])});}return _0x3f2ad9;});}})[_0x47a5('0x16')](respondWithResult(_0x19acfa,null))[_0x47a5('0x28')](handleError(_0x19acfa,null));};exports[_0x47a5('0x72')]=function(_0x49b76a,_0x3eb5c1){return db['SmsQueue']['find']({'where':{'id':_0x49b76a[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3eb5c1,null))[_0x47a5('0x16')](function(_0x96fb22){if(_0x96fb22){return _0x96fb22[_0x47a5('0x72')](_0x49b76a['query'][_0x47a5('0x51')])[_0x47a5('0x16')](function(){if(_[_0x47a5('0x73')](_0x49b76a[_0x47a5('0x2c')]['ids'])){for(var _0x240db9=0x0;_0x240db9<_0x49b76a['query'][_0x47a5('0x51')][_0x47a5('0x40')];_0x240db9+=0x1){socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a[_0x47a5('0x2c')][_0x47a5('0x51')][_0x240db9]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}}else{socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a['query'][_0x47a5('0x51')]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3eb5c1,null))[_0x47a5('0x28')](handleError(_0x3eb5c1,null));};exports[_0x47a5('0x74')]=function(_0x6d6a5,_0x5b85cd){var _0x4bf1f5={};var _0x126bb1={};var _0x3d7371;var _0x47fbb6;return db['SmsQueue'][_0x47a5('0x3e')]({'where':{'id':_0x6d6a5[_0x47a5('0x2a')]['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x16')](function(_0x269ff6){if(_0x269ff6){_0x3d7371=_0x269ff6;_0x126bb1['model']=_[_0x47a5('0x4f')](db[_0x47a5('0x48')][_0x47a5('0x1f')]);_0x126bb1[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x6d6a5[_0x47a5('0x2c')]);_0x126bb1['filters']=_['intersection'](_0x126bb1['model'],_0x126bb1[_0x47a5('0x2c')]);_0x4bf1f5[_0x47a5('0x2f')]=_['intersection'](_0x126bb1[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x4bf1f5[_0x47a5('0x2f')]=_0x4bf1f5['attributes'][_0x47a5('0x40')]?_0x4bf1f5['attributes']:_0x126bb1['model'];_0x4bf1f5['order']=qs[_0x47a5('0x44')](_0x6d6a5['query'][_0x47a5('0x44')]);_0x4bf1f5[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x6d6a5[_0x47a5('0x2c')],_0x126bb1[_0x47a5('0x45')]));if(_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x4bf1f5[_0x47a5('0x24')]=_['merge'](_0x4bf1f5[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x4bf1f5['attributes'],function(_0x42ba59){var _0x419870={};_0x419870[_0x42ba59]={'$like':'%'+_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x419870;})});}_0x4bf1f5=_[_0x47a5('0x31')]({},_0x4bf1f5,_0x6d6a5[_0x47a5('0x32')]);return _0x3d7371['getAgents'](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x2e418d){if(_0x2e418d){_0x47fbb6=_0x2e418d['length'];if(!_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x41')](_0x47a5('0x50'))){_0x4bf1f5[_0x47a5('0x42')]=qs['limit'](_0x6d6a5['query']['limit']);_0x4bf1f5['offset']=qs[_0x47a5('0xf')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0xf')]);}return _0x3d7371[_0x47a5('0x74')](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x6bc37b){if(_0x6bc37b){return _0x6bc37b?{'count':_0x47fbb6,'rows':_0x6bc37b}:null;}})[_0x47a5('0x16')](respondWithResult(_0x5b85cd,null))[_0x47a5('0x28')](handleError(_0x5b85cd,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 2f72794..0493f1d 100644 --- a/server/api/smsQueue/smsQueue.events.js +++ b/server/api/smsQueue/smsQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd407=['../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xd407,0xa4));var _0x7d40=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd407[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x7d40('0x0'));var SmsQueue=require(_0x7d40('0x1'))['db'][_0x7d40('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7d40('0x3')](0x0);var events={'afterCreate':_0x7d40('0x4'),'afterUpdate':_0x7d40('0x5'),'afterDestroy':_0x7d40('0x6')};function emitEvent(_0x26f91b){return function(_0x5b41d5,_0x238897,_0x45b2ca){SmsQueueEvents[_0x7d40('0x7')](_0x26f91b+':'+_0x5b41d5['id'],_0x5b41d5);SmsQueueEvents['emit'](_0x26f91b,_0x5b41d5);_0x45b2ca(null);};}for(var e in events){if(events[_0x7d40('0x8')](e)){var event=events[e];SmsQueue[_0x7d40('0x9')](e,emitEvent(event));}}module[_0x7d40('0xa')]=SmsQueueEvents; \ No newline at end of file +var _0xb278=['hasOwnProperty','hook','exports','../../mysqldb','SmsQueue','setMaxListeners','save','update','emit'];(function(_0x9e2e0e,_0xd249fd){var _0x10df60=function(_0x13c659){while(--_0x13c659){_0x9e2e0e['push'](_0x9e2e0e['shift']());}};_0x10df60(++_0xd249fd);}(_0xb278,0x1e9));var _0x8b27=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xb278[_0x3b0731];return _0x4204d7;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x8b27('0x0'))['db'][_0x8b27('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x8b27('0x2')](0x0);var events={'afterCreate':_0x8b27('0x3'),'afterUpdate':_0x8b27('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4b69dd){return function(_0x32706f,_0x21f618,_0x158304){SmsQueueEvents['emit'](_0x4b69dd+':'+_0x32706f['id'],_0x32706f);SmsQueueEvents[_0x8b27('0x5')](_0x4b69dd,_0x32706f);_0x158304(null);};}for(var e in events){if(events[_0x8b27('0x6')](e)){var event=events[e];SmsQueue[_0x8b27('0x7')](e,emitEvent(event));}}module[_0x8b27('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index a052d1a..5d80e4d 100644 --- a/server/api/smsQueue/smsQueue.model.js +++ b/server/api/smsQueue/smsQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81c8=['../../config/environment','./smsQueue.attributes','exports','define','sms_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x4b70cc,_0x1033a8){var _0x5a00af=function(_0x442e67){while(--_0x442e67){_0x4b70cc['push'](_0x4b70cc['shift']());}};_0x5a00af(++_0x1033a8);}(_0x81c8,0x1bf));var _0x881c=function(_0x370f26,_0x2ebdab){_0x370f26=_0x370f26-0x0;var _0x466030=_0x81c8[_0x370f26];return _0x466030;};'use strict';var _=require(_0x881c('0x0'));var util=require(_0x881c('0x1'));var logger=require(_0x881c('0x2'))(_0x881c('0x3'));var moment=require(_0x881c('0x4'));var BPromise=require('bluebird');var rp=require(_0x881c('0x5'));var fs=require('fs');var path=require(_0x881c('0x6'));var rimraf=require(_0x881c('0x7'));var config=require(_0x881c('0x8'));var attributes=require(_0x881c('0x9'));module[_0x881c('0xa')]=function(_0x3e3572,_0x2d1a32){return _0x3e3572[_0x881c('0xb')]('SmsQueue',attributes,{'tableName':_0x881c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e4a=['SmsQueue','sms_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./smsQueue.attributes','exports'];(function(_0x1afb78,_0xcc1e7d){var _0x2dcbf8=function(_0x2f702b){while(--_0x2f702b){_0x1afb78['push'](_0x1afb78['shift']());}};_0x2dcbf8(++_0xcc1e7d);}(_0x3e4a,0x182));var _0xa3e4=function(_0x27fadc,_0x594112){_0x27fadc=_0x27fadc-0x0;var _0x2cc531=_0x3e4a[_0x27fadc];return _0x2cc531;};'use strict';var _=require(_0xa3e4('0x0'));var util=require(_0xa3e4('0x1'));var logger=require('../../config/logger')(_0xa3e4('0x2'));var moment=require(_0xa3e4('0x3'));var BPromise=require(_0xa3e4('0x4'));var rp=require(_0xa3e4('0x5'));var fs=require('fs');var path=require(_0xa3e4('0x6'));var rimraf=require(_0xa3e4('0x7'));var config=require('../../config/environment');var attributes=require(_0xa3e4('0x8'));module[_0xa3e4('0x9')]=function(_0xac76e5,_0xda103){return _0xac76e5['define'](_0xa3e4('0xa'),attributes,{'tableName':_0xa3e4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 5d12a88..13b150a 100644 --- a/server/api/smsQueue/smsQueue.rpc.js +++ b/server/api/smsQueue/smsQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc66=['options','raw','attributes','limit','map','include','model','debug','catch','ShowSmsQueue','find','where','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsQueue,\x20%s,\x20%s','GetSmsQueue','SmsQueue'];(function(_0x1057cd,_0x4fe93d){var _0x149799=function(_0xf97388){while(--_0xf97388){_0x1057cd['push'](_0x1057cd['shift']());}};_0x149799(++_0x4fe93d);}(_0xbc66,0x192));var _0x6bc6=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbc66[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x6bc6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6bc6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6bc6('0x2'));var db=require(_0x6bc6('0x3'))['db'];var utils=require(_0x6bc6('0x4'));var logger=require('../../config/logger')(_0x6bc6('0x5'));var config=require(_0x6bc6('0x6'));var jayson=require(_0x6bc6('0x7'));var client=jayson[_0x6bc6('0x8')][_0x6bc6('0x9')]({'port':0x232a});config[_0x6bc6('0xa')]=_['defaults'](config[_0x6bc6('0xa')],{'host':_0x6bc6('0xb'),'port':0x18eb});var socket=require(_0x6bc6('0xc'))(new Redis(config[_0x6bc6('0xa')]));require(_0x6bc6('0xd'))[_0x6bc6('0xe')](socket);function respondWithRpcPromise(_0x5e8fd1,_0x111e32,_0x3ab2d6){return new BPromise(function(_0x4d6bd8,_0x55834a){return client[_0x6bc6('0xf')](_0x5e8fd1,_0x3ab2d6)[_0x6bc6('0x10')](function(_0xdeeb7){logger[_0x6bc6('0x11')]('SmsQueue,\x20%s,\x20%s',_0x111e32,_0x6bc6('0x12'));logger['debug'](_0x6bc6('0x13'),_0x111e32,_0x6bc6('0x12'),JSON[_0x6bc6('0x14')](_0xdeeb7));if(_0xdeeb7[_0x6bc6('0x15')]){if(_0xdeeb7['error'][_0x6bc6('0x16')]===0x1f4){logger[_0x6bc6('0x15')]('SmsQueue,\x20%s,\x20%s',_0x111e32,_0xdeeb7[_0x6bc6('0x15')][_0x6bc6('0x17')]);return _0x55834a(_0xdeeb7['error'][_0x6bc6('0x17')]);}logger['error'](_0x6bc6('0x18'),_0x111e32,_0xdeeb7[_0x6bc6('0x15')][_0x6bc6('0x17')]);return _0x4d6bd8(_0xdeeb7[_0x6bc6('0x15')][_0x6bc6('0x17')]);}else{logger[_0x6bc6('0x11')]('SmsQueue,\x20%s,\x20%s',_0x111e32,_0x6bc6('0x12'));_0x4d6bd8(_0xdeeb7['result'][_0x6bc6('0x17')]);}})['catch'](function(_0x2c1c15){logger[_0x6bc6('0x15')](_0x6bc6('0x18'),_0x111e32,_0x2c1c15);_0x55834a(_0x2c1c15);});});}exports[_0x6bc6('0x19')]=function(_0x101db7){var _0x20f081=this;return new Promise(function(_0x2f7cb5,_0x260256){return db[_0x6bc6('0x1a')]['findAll']({'raw':_0x101db7[_0x6bc6('0x1b')]?_0x101db7[_0x6bc6('0x1b')][_0x6bc6('0x1c')]===undefined?!![]:![]:!![],'where':_0x101db7[_0x6bc6('0x1b')]?_0x101db7[_0x6bc6('0x1b')]['where']||null:null,'attributes':_0x101db7[_0x6bc6('0x1b')]?_0x101db7[_0x6bc6('0x1b')][_0x6bc6('0x1d')]||null:null,'limit':_0x101db7[_0x6bc6('0x1b')]?_0x101db7[_0x6bc6('0x1b')][_0x6bc6('0x1e')]||null:null,'include':_0x101db7[_0x6bc6('0x1b')]?_0x101db7[_0x6bc6('0x1b')]['include']?_[_0x6bc6('0x1f')](_0x101db7[_0x6bc6('0x1b')][_0x6bc6('0x20')],function(_0x1fd3eb){return{'model':db[_0x1fd3eb[_0x6bc6('0x21')]],'as':_0x1fd3eb['as'],'attributes':_0x1fd3eb[_0x6bc6('0x1d')],'include':_0x1fd3eb[_0x6bc6('0x20')]?_[_0x6bc6('0x1f')](_0x1fd3eb['include'],function(_0xe97ef4){return{'model':db[_0xe97ef4['model']],'as':_0xe97ef4['as'],'attributes':_0xe97ef4['attributes'],'include':_0xe97ef4[_0x6bc6('0x20')]?_['map'](_0xe97ef4[_0x6bc6('0x20')],function(_0x60e2){return{'model':db[_0x60e2[_0x6bc6('0x21')]],'as':_0x60e2['as'],'attributes':_0x60e2[_0x6bc6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6bc6('0x10')](function(_0x504974){logger['info'](_0x6bc6('0x19'),_0x101db7);logger[_0x6bc6('0x22')](_0x6bc6('0x19'),_0x101db7,JSON[_0x6bc6('0x14')](_0x504974));_0x2f7cb5(_0x504974);})[_0x6bc6('0x23')](function(_0x2a4e55){logger[_0x6bc6('0x15')](_0x6bc6('0x19'),_0x2a4e55[_0x6bc6('0x17')],_0x101db7);_0x260256(_0x20f081[_0x6bc6('0x15')](0x1f4,_0x2a4e55['message']));});});};exports[_0x6bc6('0x24')]=function(_0x3598c6){var _0x448e22=this;return new Promise(function(_0x5106d1,_0x965375){return db[_0x6bc6('0x1a')][_0x6bc6('0x25')]({'raw':_0x3598c6[_0x6bc6('0x1b')]?_0x3598c6['options'][_0x6bc6('0x1c')]===undefined?!![]:![]:!![],'where':_0x3598c6['options']?_0x3598c6['options'][_0x6bc6('0x26')]||null:null,'attributes':_0x3598c6['options']?_0x3598c6[_0x6bc6('0x1b')]['attributes']||null:null,'include':_0x3598c6[_0x6bc6('0x1b')]?_0x3598c6[_0x6bc6('0x1b')][_0x6bc6('0x20')]?_[_0x6bc6('0x1f')](_0x3598c6[_0x6bc6('0x1b')][_0x6bc6('0x20')],function(_0x325c67){return{'model':db[_0x325c67[_0x6bc6('0x21')]],'as':_0x325c67['as'],'attributes':_0x325c67[_0x6bc6('0x1d')],'include':_0x325c67['include']?_[_0x6bc6('0x1f')](_0x325c67['include'],function(_0x2548f7){return{'model':db[_0x2548f7[_0x6bc6('0x21')]],'as':_0x2548f7['as'],'attributes':_0x2548f7[_0x6bc6('0x1d')],'include':_0x2548f7[_0x6bc6('0x20')]?_['map'](_0x2548f7[_0x6bc6('0x20')],function(_0xbf0e6f){return{'model':db[_0xbf0e6f[_0x6bc6('0x21')]],'as':_0xbf0e6f['as'],'attributes':_0xbf0e6f[_0x6bc6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6bc6('0x10')](function(_0x56e9ed){logger[_0x6bc6('0x11')](_0x6bc6('0x24'),_0x3598c6);logger[_0x6bc6('0x22')](_0x6bc6('0x24'),_0x3598c6,JSON['stringify'](_0x56e9ed));_0x5106d1(_0x56e9ed);})[_0x6bc6('0x23')](function(_0x246386){logger['error'](_0x6bc6('0x24'),_0x246386[_0x6bc6('0x17')],_0x3598c6);_0x965375(_0x448e22[_0x6bc6('0x15')](0x1f4,_0x246386['message']));});});}; \ No newline at end of file +var _0xca19=['jayson/promise','client','redis','defaults','socket.io-emitter','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSmsQueue','SmsQueue','findAll','options','raw','attributes','limit','map','include','model','where','ShowSmsQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x491ae4,_0x1b356c){var _0xd8ab05=function(_0xd1c165){while(--_0xd1c165){_0x491ae4['push'](_0x491ae4['shift']());}};_0xd8ab05(++_0x1b356c);}(_0xca19,0x1c0));var _0x9ca1=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xca19[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x9ca1('0x0'));var util=require('util');var moment=require(_0x9ca1('0x1'));var BPromise=require(_0x9ca1('0x2'));var rs=require(_0x9ca1('0x3'));var fs=require('fs');var Redis=require(_0x9ca1('0x4'));var db=require(_0x9ca1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ca1('0x6'))('rpc');var config=require(_0x9ca1('0x7'));var jayson=require(_0x9ca1('0x8'));var client=jayson[_0x9ca1('0x9')]['http']({'port':0x232a});config[_0x9ca1('0xa')]=_[_0x9ca1('0xb')](config[_0x9ca1('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9ca1('0xc'))(new Redis(config[_0x9ca1('0xa')]));require(_0x9ca1('0xd'))[_0x9ca1('0xe')](socket);function respondWithRpcPromise(_0x8559d6,_0x4af523,_0x3f684f){return new BPromise(function(_0x2f5889,_0x2fc8f9){return client[_0x9ca1('0xf')](_0x8559d6,_0x3f684f)['then'](function(_0x47b417){logger[_0x9ca1('0x10')](_0x9ca1('0x11'),_0x4af523,_0x9ca1('0x12'));logger[_0x9ca1('0x13')](_0x9ca1('0x14'),_0x4af523,_0x9ca1('0x12'),JSON[_0x9ca1('0x15')](_0x47b417));if(_0x47b417['error']){if(_0x47b417[_0x9ca1('0x16')][_0x9ca1('0x17')]===0x1f4){logger[_0x9ca1('0x16')](_0x9ca1('0x11'),_0x4af523,_0x47b417[_0x9ca1('0x16')][_0x9ca1('0x18')]);return _0x2fc8f9(_0x47b417[_0x9ca1('0x16')]['message']);}logger[_0x9ca1('0x16')]('SmsQueue,\x20%s,\x20%s',_0x4af523,_0x47b417[_0x9ca1('0x16')][_0x9ca1('0x18')]);return _0x2f5889(_0x47b417['error'][_0x9ca1('0x18')]);}else{logger['info']('SmsQueue,\x20%s,\x20%s',_0x4af523,_0x9ca1('0x12'));_0x2f5889(_0x47b417['result'][_0x9ca1('0x18')]);}})[_0x9ca1('0x19')](function(_0x2d86b0){logger['error'](_0x9ca1('0x11'),_0x4af523,_0x2d86b0);_0x2fc8f9(_0x2d86b0);});});}exports[_0x9ca1('0x1a')]=function(_0x586b7b){var _0x38791d=this;return new Promise(function(_0x5e1b00,_0x84a69f){return db[_0x9ca1('0x1b')][_0x9ca1('0x1c')]({'raw':_0x586b7b[_0x9ca1('0x1d')]?_0x586b7b[_0x9ca1('0x1d')][_0x9ca1('0x1e')]===undefined?!![]:![]:!![],'where':_0x586b7b[_0x9ca1('0x1d')]?_0x586b7b[_0x9ca1('0x1d')]['where']||null:null,'attributes':_0x586b7b[_0x9ca1('0x1d')]?_0x586b7b['options'][_0x9ca1('0x1f')]||null:null,'limit':_0x586b7b[_0x9ca1('0x1d')]?_0x586b7b[_0x9ca1('0x1d')][_0x9ca1('0x20')]||null:null,'include':_0x586b7b[_0x9ca1('0x1d')]?_0x586b7b['options']['include']?_[_0x9ca1('0x21')](_0x586b7b[_0x9ca1('0x1d')][_0x9ca1('0x22')],function(_0x54da6f){return{'model':db[_0x54da6f[_0x9ca1('0x23')]],'as':_0x54da6f['as'],'attributes':_0x54da6f['attributes'],'include':_0x54da6f[_0x9ca1('0x22')]?_[_0x9ca1('0x21')](_0x54da6f['include'],function(_0x3980b2){return{'model':db[_0x3980b2[_0x9ca1('0x23')]],'as':_0x3980b2['as'],'attributes':_0x3980b2['attributes'],'include':_0x3980b2[_0x9ca1('0x22')]?_[_0x9ca1('0x21')](_0x3980b2[_0x9ca1('0x22')],function(_0x35b755){return{'model':db[_0x35b755[_0x9ca1('0x23')]],'as':_0x35b755['as'],'attributes':_0x35b755[_0x9ca1('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4759e3){logger[_0x9ca1('0x10')](_0x9ca1('0x1a'),_0x586b7b);logger['debug'](_0x9ca1('0x1a'),_0x586b7b,JSON[_0x9ca1('0x15')](_0x4759e3));_0x5e1b00(_0x4759e3);})[_0x9ca1('0x19')](function(_0x14d553){logger[_0x9ca1('0x16')](_0x9ca1('0x1a'),_0x14d553[_0x9ca1('0x18')],_0x586b7b);_0x84a69f(_0x38791d[_0x9ca1('0x16')](0x1f4,_0x14d553[_0x9ca1('0x18')]));});});};exports['ShowSmsQueue']=function(_0x3591c1){var _0x278eda=this;return new Promise(function(_0x45e239,_0x54f31a){return db[_0x9ca1('0x1b')]['find']({'raw':_0x3591c1[_0x9ca1('0x1d')]?_0x3591c1['options'][_0x9ca1('0x1e')]===undefined?!![]:![]:!![],'where':_0x3591c1[_0x9ca1('0x1d')]?_0x3591c1[_0x9ca1('0x1d')][_0x9ca1('0x24')]||null:null,'attributes':_0x3591c1[_0x9ca1('0x1d')]?_0x3591c1['options']['attributes']||null:null,'include':_0x3591c1[_0x9ca1('0x1d')]?_0x3591c1[_0x9ca1('0x1d')][_0x9ca1('0x22')]?_[_0x9ca1('0x21')](_0x3591c1[_0x9ca1('0x1d')]['include'],function(_0x130dea){return{'model':db[_0x130dea[_0x9ca1('0x23')]],'as':_0x130dea['as'],'attributes':_0x130dea[_0x9ca1('0x1f')],'include':_0x130dea[_0x9ca1('0x22')]?_[_0x9ca1('0x21')](_0x130dea['include'],function(_0x851ba7){return{'model':db[_0x851ba7[_0x9ca1('0x23')]],'as':_0x851ba7['as'],'attributes':_0x851ba7['attributes'],'include':_0x851ba7[_0x9ca1('0x22')]?_[_0x9ca1('0x21')](_0x851ba7[_0x9ca1('0x22')],function(_0xd45581){return{'model':db[_0xd45581[_0x9ca1('0x23')]],'as':_0xd45581['as'],'attributes':_0xd45581['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f229d){logger['info']('ShowSmsQueue',_0x3591c1);logger[_0x9ca1('0x13')]('ShowSmsQueue',_0x3591c1,JSON[_0x9ca1('0x15')](_0x5f229d));_0x45e239(_0x5f229d);})[_0x9ca1('0x19')](function(_0x517b48){logger[_0x9ca1('0x16')](_0x9ca1('0x25'),_0x517b48['message'],_0x3591c1);_0x54f31a(_0x278eda[_0x9ca1('0x16')](0x1f4,_0x517b48[_0x9ca1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 353a191..2bb44e0 100644 --- a/server/api/smsQueue/smsQueue.socket.js +++ b/server/api/smsQueue/smsQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a42=['length','smsQueue:','./smsQueue.events','update','emit'];(function(_0x3135a2,_0x2ba376){var _0x3bc420=function(_0x5c3e37){while(--_0x5c3e37){_0x3135a2['push'](_0x3135a2['shift']());}};_0x3bc420(++_0x2ba376);}(_0x1a42,0x18d));var _0x21a4=function(_0x3f787e,_0x951303){_0x3f787e=_0x3f787e-0x0;var _0x26242d=_0x1a42[_0x3f787e];return _0x26242d;};'use strict';var SmsQueueEvents=require(_0x21a4('0x0'));var events=['save','remove',_0x21a4('0x1')];function createListener(_0x3c74d7,_0x4d9a15){return function(_0x1492ae){_0x4d9a15[_0x21a4('0x2')](_0x3c74d7,_0x1492ae);};}function removeListener(_0x3403ca,_0x46380d){return function(){SmsQueueEvents['removeListener'](_0x3403ca,_0x46380d);};}exports['register']=function(_0x570099){for(var _0x5cee81=0x0,_0x3da1dd=events[_0x21a4('0x3')];_0x5cee81<_0x3da1dd;_0x5cee81++){var _0x48f63b=events[_0x5cee81];var _0x271cc1=createListener(_0x21a4('0x4')+_0x48f63b,_0x570099);SmsQueueEvents['on'](_0x48f63b,_0x271cc1);}}; \ No newline at end of file +var _0x5b2e=['remove','update','emit','removeListener','register','length','smsQueue:','./smsQueue.events'];(function(_0x5a4c10,_0x1db485){var _0x214f0b=function(_0x4e0f5e){while(--_0x4e0f5e){_0x5a4c10['push'](_0x5a4c10['shift']());}};_0x214f0b(++_0x1db485);}(_0x5b2e,0x157));var _0xe5b2=function(_0x53c753,_0x2efd82){_0x53c753=_0x53c753-0x0;var _0xa4b6cd=_0x5b2e[_0x53c753];return _0xa4b6cd;};'use strict';var SmsQueueEvents=require(_0xe5b2('0x0'));var events=['save',_0xe5b2('0x1'),_0xe5b2('0x2')];function createListener(_0xeaa397,_0x253deb){return function(_0x5b80ff){_0x253deb[_0xe5b2('0x3')](_0xeaa397,_0x5b80ff);};}function removeListener(_0x3f2f17,_0xbfa5d2){return function(){SmsQueueEvents[_0xe5b2('0x4')](_0x3f2f17,_0xbfa5d2);};}exports[_0xe5b2('0x5')]=function(_0x30076d){for(var _0x46ac48=0x0,_0x259b87=events[_0xe5b2('0x6')];_0x46ac48<_0x259b87;_0x46ac48++){var _0x52239e=events[_0x46ac48];var _0x552951=createListener(_0xe5b2('0x7')+_0x52239e,_0x30076d);SmsQueueEvents['on'](_0x52239e,_0x552951);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index d586d39..9244c34 100644 --- a/server/api/smsQueueReport/index.js +++ b/server/api/smsQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33ac=['post','create','put','/:id','update','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/describe','show'];(function(_0x4a3f5e,_0x2ed7d7){var _0x4f448f=function(_0x632ed8){while(--_0x632ed8){_0x4a3f5e['push'](_0x4a3f5e['shift']());}};_0x4f448f(++_0x2ed7d7);}(_0x33ac,0x1f2));var _0xc33a=function(_0x23c896,_0x13bc03){_0x23c896=_0x23c896-0x0;var _0x579b27=_0x33ac[_0x23c896];return _0x579b27;};'use strict';var multer=require('multer');var util=require(_0xc33a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc33a('0x1'));var router=express[_0xc33a('0x2')]();var fs_extra=require(_0xc33a('0x3'));var auth=require(_0xc33a('0x4'));var interaction=require(_0xc33a('0x5'));var config=require(_0xc33a('0x6'));var controller=require(_0xc33a('0x7'));router[_0xc33a('0x8')]('/',auth[_0xc33a('0x9')](),controller['index']);router['get'](_0xc33a('0xa'),auth[_0xc33a('0x9')](),controller['describe']);router[_0xc33a('0x8')]('/:id',auth[_0xc33a('0x9')](),controller[_0xc33a('0xb')]);router[_0xc33a('0xc')]('/',auth[_0xc33a('0x9')](),controller[_0xc33a('0xd')]);router[_0xc33a('0xe')](_0xc33a('0xf'),auth[_0xc33a('0x9')](),controller[_0xc33a('0x10')]);router['delete']('/:id',auth[_0xc33a('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe300=['put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x3ae6aa,_0x53ad57){var _0xf24a3d=function(_0x43e3d9){while(--_0x43e3d9){_0x3ae6aa['push'](_0x3ae6aa['shift']());}};_0xf24a3d(++_0x53ad57);}(_0xe300,0xa4));var _0x0e30=function(_0x491efe,_0x2b9d7d){_0x491efe=_0x491efe-0x0;var _0x3998f8=_0xe300[_0x491efe];return _0x3998f8;};'use strict';var multer=require(_0x0e30('0x0'));var util=require(_0x0e30('0x1'));var path=require('path');var timeout=require(_0x0e30('0x2'));var express=require(_0x0e30('0x3'));var router=express[_0x0e30('0x4')]();var fs_extra=require(_0x0e30('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0e30('0x6'));var config=require(_0x0e30('0x7'));var controller=require(_0x0e30('0x8'));router[_0x0e30('0x9')]('/',auth[_0x0e30('0xa')](),controller[_0x0e30('0xb')]);router['get'](_0x0e30('0xc'),auth[_0x0e30('0xa')](),controller[_0x0e30('0xd')]);router[_0x0e30('0x9')](_0x0e30('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x0e30('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0e30('0x10')](_0x0e30('0xe'),auth[_0x0e30('0xa')](),controller[_0x0e30('0x11')]);router[_0x0e30('0x12')]('/:id',auth[_0x0e30('0xa')](),controller['destroy']);module[_0x0e30('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index f4a9579..5334fb3 100644 --- a/server/api/smsQueueReport/smsQueueReport.attributes.js +++ b/server/api/smsQueueReport/smsQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf26f=['STRING','DATE','moment','sequelize','exports'];(function(_0x471545,_0x261a18){var _0x197b39=function(_0x5602fd){while(--_0x5602fd){_0x471545['push'](_0x471545['shift']());}};_0x197b39(++_0x261a18);}(_0xf26f,0x142));var _0xff26=function(_0x54c81d,_0x47cd3e){_0x54c81d=_0x54c81d-0x0;var _0x1301c3=_0xf26f[_0x54c81d];return _0x1301c3;};'use strict';var moment=require(_0xff26('0x0'));var Sequelize=require(_0xff26('0x1'));module[_0xff26('0x2')]={'uniqueid':{'type':Sequelize[_0xff26('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xff26('0x3')]},'joinAt':{'type':Sequelize[_0xff26('0x4')]},'leaveAt':{'type':Sequelize[_0xff26('0x4')]},'acceptAt':{'type':Sequelize[_0xff26('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xff26('0x3')]}}; \ No newline at end of file +var _0x50e9=['STRING','DATE','sequelize'];(function(_0x3e3c83,_0x37e92f){var _0x2b602c=function(_0x3e5955){while(--_0x3e5955){_0x3e3c83['push'](_0x3e3c83['shift']());}};_0x2b602c(++_0x37e92f);}(_0x50e9,0x89));var _0x950e=function(_0x80ba9d,_0x476f63){_0x80ba9d=_0x80ba9d-0x0;var _0x58ddb5=_0x50e9[_0x80ba9d];return _0x58ddb5;};'use strict';var moment=require('moment');var Sequelize=require(_0x950e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x950e('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x950e('0x2')]},'exitAt':{'type':Sequelize[_0x950e('0x2')]},'reason':{'type':Sequelize[_0x950e('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index d82f786..2089616 100644 --- a/server/api/smsQueueReport/smsQueueReport.controller.js +++ b/server/api/smsQueueReport/smsQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e49=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','SmsQueueReport','rawAttributes','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','keys','create','body','find','describe','eml-format'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6e49,0xd7));var _0x96e4=function(_0x5b60b1,_0x54d588){_0x5b60b1=_0x5b60b1-0x0;var _0x34ada9=_0x6e49[_0x5b60b1];return _0x34ada9;};'use strict';var emlformat=require(_0x96e4('0x0'));var rimraf=require(_0x96e4('0x1'));var zipdir=require(_0x96e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96e4('0x3'));var moment=require(_0x96e4('0x4'));var BPromise=require(_0x96e4('0x5'));var Mustache=require(_0x96e4('0x6'));var util=require('util');var path=require(_0x96e4('0x7'));var sox=require(_0x96e4('0x8'));var csv=require(_0x96e4('0x9'));var ejs=require(_0x96e4('0xa'));var fs=require('fs');var fs_extra=require(_0x96e4('0xb'));var _=require(_0x96e4('0xc'));var squel=require(_0x96e4('0xd'));var crypto=require(_0x96e4('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x96e4('0xf'));var toCsv=require(_0x96e4('0x9'));var querystring=require('querystring');var Papa=require(_0x96e4('0x10'));var Redis=require('ioredis');var authService=require(_0x96e4('0x11'));var qs=require(_0x96e4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x96e4('0x13'));var logger=require('../../config/logger')(_0x96e4('0x14'));var utils=require(_0x96e4('0x15'));var config=require(_0x96e4('0x16'));var licenseUtil=require(_0x96e4('0x17'));var db=require(_0x96e4('0x18'))['db'];function respondWithStatusCode(_0xa6325,_0x9ccf6){_0x9ccf6=_0x9ccf6||0xcc;return function(_0x4060bf){if(_0x4060bf){return _0xa6325[_0x96e4('0x19')](_0x9ccf6);}return _0xa6325[_0x96e4('0x1a')](_0x9ccf6)[_0x96e4('0x1b')]();};}function respondWithResult(_0x5913fd,_0x49f96d){_0x49f96d=_0x49f96d||0xc8;return function(_0x8c5b9d){if(_0x8c5b9d){return _0x5913fd[_0x96e4('0x1a')](_0x49f96d)['json'](_0x8c5b9d);}};}function respondWithFilteredResult(_0x7714e1,_0x3fdfdb){return function(_0x24d46b){if(_0x24d46b){var _0x808efc=typeof _0x3fdfdb[_0x96e4('0x1c')]==='undefined'&&typeof _0x3fdfdb[_0x96e4('0x1d')]===_0x96e4('0x1e');var _0x1da512=_0x24d46b[_0x96e4('0x1f')];var _0x7448ff=_0x808efc?0x0:_0x3fdfdb[_0x96e4('0x1c')];var _0x95102=_0x808efc?_0x24d46b['count']:_0x3fdfdb[_0x96e4('0x1c')]+_0x3fdfdb['limit'];var _0x2c9bef;if(_0x95102>=_0x1da512){_0x95102=_0x1da512;_0x2c9bef=0xc8;}else{_0x2c9bef=0xce;}_0x7714e1[_0x96e4('0x1a')](_0x2c9bef);return _0x7714e1[_0x96e4('0x20')](_0x96e4('0x21'),_0x7448ff+'-'+_0x95102+'/'+_0x1da512)['json'](_0x24d46b);}return null;};}function patchUpdates(_0x1ab19d){return function(_0x2e4fc5){try{jsonpatch[_0x96e4('0x22')](_0x2e4fc5,_0x1ab19d,!![]);}catch(_0x20f737){return BPromise[_0x96e4('0x23')](_0x20f737);}return _0x2e4fc5[_0x96e4('0x24')]();};}function saveUpdates(_0x23725b,_0x1f4858){return function(_0x419224){if(_0x419224){return _0x419224[_0x96e4('0x25')](_0x23725b)['then'](function(_0x1129be){return _0x1129be;});}return null;};}function removeEntity(_0x3b1b2a,_0x4c8fb6){return function(_0xb7792d){if(_0xb7792d){return _0xb7792d[_0x96e4('0x26')]()[_0x96e4('0x27')](function(){_0x3b1b2a[_0x96e4('0x1a')](0xcc)[_0x96e4('0x1b')]();});}};}function handleEntityNotFound(_0x41745c,_0x14ea1a){return function(_0x8890ec){if(!_0x8890ec){_0x41745c[_0x96e4('0x19')](0x194);}return _0x8890ec;};}function handleError(_0x180bcd,_0x57c861){_0x57c861=_0x57c861||0x1f4;return function(_0x44560a){logger[_0x96e4('0x28')](_0x44560a['stack']);if(_0x44560a[_0x96e4('0x29')]){delete _0x44560a[_0x96e4('0x29')];}_0x180bcd[_0x96e4('0x1a')](_0x57c861)['send'](_0x44560a);};}exports['index']=function(_0x22fead,_0xbc712d){var _0x445eb4={},_0x3fa5bb={},_0x1e2912={'count':0x0,'rows':[]};var _0x86e8c5=_['map'](db[_0x96e4('0x2a')][_0x96e4('0x2b')],function(_0x2e8802){return{'name':_0x2e8802['fieldName'],'type':_0x2e8802[_0x96e4('0x2c')]['key']};});_0x3fa5bb['model']=_[_0x96e4('0x2d')](_0x86e8c5,_0x96e4('0x29'));_0x3fa5bb[_0x96e4('0x2e')]=_['keys'](_0x22fead['query']);_0x3fa5bb[_0x96e4('0x2f')]=_[_0x96e4('0x30')](_0x3fa5bb[_0x96e4('0x31')],_0x3fa5bb[_0x96e4('0x2e')]);_0x445eb4[_0x96e4('0x32')]=_[_0x96e4('0x30')](_0x3fa5bb[_0x96e4('0x31')],qs[_0x96e4('0x33')](_0x22fead[_0x96e4('0x2e')][_0x96e4('0x33')]));_0x445eb4['attributes']=_0x445eb4['attributes'][_0x96e4('0x34')]?_0x445eb4[_0x96e4('0x32')]:_0x3fa5bb[_0x96e4('0x31')];if(!_0x22fead['query'][_0x96e4('0x35')](_0x96e4('0x36'))){_0x445eb4[_0x96e4('0x1d')]=qs['limit'](_0x22fead['query'][_0x96e4('0x1d')]);_0x445eb4['offset']=qs['offset'](_0x22fead['query'][_0x96e4('0x1c')]);}_0x445eb4['order']=qs[_0x96e4('0x37')](_0x22fead['query'][_0x96e4('0x37')]);_0x445eb4[_0x96e4('0x38')]=qs[_0x96e4('0x2f')](_[_0x96e4('0x39')](_0x22fead[_0x96e4('0x2e')],_0x3fa5bb[_0x96e4('0x2f')]),_0x86e8c5);if(_0x22fead[_0x96e4('0x2e')]['filter']){_0x445eb4[_0x96e4('0x38')]=_[_0x96e4('0x3a')](_0x445eb4[_0x96e4('0x38')],{'$or':_['map'](_0x86e8c5,function(_0x528cee){if(_0x528cee[_0x96e4('0x2c')]!==_0x96e4('0x3b')){var _0x3af861={};_0x3af861[_0x528cee[_0x96e4('0x29')]]={'$like':'%'+_0x22fead[_0x96e4('0x2e')][_0x96e4('0x3c')]+'%'};return _0x3af861;}})});}_0x445eb4=_[_0x96e4('0x3a')]({},_0x445eb4,_0x22fead[_0x96e4('0x3d')]);var _0x2f3716={'where':_0x445eb4[_0x96e4('0x38')]};return db['SmsQueueReport'][_0x96e4('0x1f')](_0x2f3716)[_0x96e4('0x27')](function(_0x234f4b){_0x1e2912[_0x96e4('0x1f')]=_0x234f4b;if(_0x22fead[_0x96e4('0x2e')]['includeAll']){_0x445eb4[_0x96e4('0x3e')]=[{'all':!![]}];}return db[_0x96e4('0x2a')][_0x96e4('0x3f')](_0x445eb4);})['then'](function(_0x134da0){_0x1e2912[_0x96e4('0x40')]=_0x134da0;return _0x1e2912;})['then'](respondWithFilteredResult(_0xbc712d,_0x445eb4))[_0x96e4('0x41')](handleError(_0xbc712d,null));};exports['show']=function(_0x1bbfc3,_0xc9f519){var _0x501159={'raw':!![],'where':{'id':_0x1bbfc3[_0x96e4('0x42')]['id']}},_0x5e88c9={};_0x5e88c9[_0x96e4('0x31')]=_['keys'](db[_0x96e4('0x2a')][_0x96e4('0x2b')]);_0x5e88c9[_0x96e4('0x2e')]=_[_0x96e4('0x43')](_0x1bbfc3[_0x96e4('0x2e')]);_0x5e88c9[_0x96e4('0x2f')]=_[_0x96e4('0x30')](_0x5e88c9[_0x96e4('0x31')],_0x5e88c9[_0x96e4('0x2e')]);_0x501159[_0x96e4('0x32')]=_['intersection'](_0x5e88c9[_0x96e4('0x31')],qs[_0x96e4('0x33')](_0x1bbfc3[_0x96e4('0x2e')][_0x96e4('0x33')]));_0x501159[_0x96e4('0x32')]=_0x501159['attributes'][_0x96e4('0x34')]?_0x501159[_0x96e4('0x32')]:_0x5e88c9[_0x96e4('0x31')];if(_0x1bbfc3[_0x96e4('0x2e')]['includeAll']){_0x501159['include']=[{'all':!![]}];}_0x501159=_[_0x96e4('0x3a')]({},_0x501159,_0x1bbfc3[_0x96e4('0x3d')]);return db[_0x96e4('0x2a')]['find'](_0x501159)[_0x96e4('0x27')](handleEntityNotFound(_0xc9f519,null))[_0x96e4('0x27')](respondWithResult(_0xc9f519,null))[_0x96e4('0x41')](handleError(_0xc9f519,null));};exports[_0x96e4('0x44')]=function(_0x5adab0,_0x5053ed){return db['SmsQueueReport'][_0x96e4('0x44')](_0x5adab0[_0x96e4('0x45')],{})[_0x96e4('0x27')](respondWithResult(_0x5053ed,0xc9))[_0x96e4('0x41')](handleError(_0x5053ed,null));};exports['update']=function(_0x3f6266,_0x5bf25c){if(_0x3f6266[_0x96e4('0x45')]['id']){delete _0x3f6266[_0x96e4('0x45')]['id'];}return db['SmsQueueReport'][_0x96e4('0x46')]({'where':{'id':_0x3f6266[_0x96e4('0x42')]['id']}})[_0x96e4('0x27')](handleEntityNotFound(_0x5bf25c,null))[_0x96e4('0x27')](saveUpdates(_0x3f6266['body'],null))[_0x96e4('0x27')](respondWithResult(_0x5bf25c,null))[_0x96e4('0x41')](handleError(_0x5bf25c,null));};exports[_0x96e4('0x26')]=function(_0x391657,_0x511287){return db['SmsQueueReport'][_0x96e4('0x46')]({'where':{'id':_0x391657[_0x96e4('0x42')]['id']}})['then'](handleEntityNotFound(_0x511287,null))['then'](removeEntity(_0x511287,null))['catch'](handleError(_0x511287,null));};exports[_0x96e4('0x47')]=function(_0x34579c,_0x1e7980){return db[_0x96e4('0x2a')][_0x96e4('0x47')]()[_0x96e4('0x27')](respondWithResult(_0x1e7980,null))[_0x96e4('0x41')](handleError(_0x1e7980,null));}; \ No newline at end of file +var _0x86af=['error','stack','name','send','index','map','SmsQueueReport','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','show','include','find','create','body','catch','params','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','destroy','then'];(function(_0x32a5f,_0x32de4a){var _0xf4608=function(_0x37589f){while(--_0x37589f){_0x32a5f['push'](_0x32a5f['shift']());}};_0xf4608(++_0x32de4a);}(_0x86af,0x149));var _0xf86a=function(_0x2dcbdf,_0x2a134f){_0x2dcbdf=_0x2dcbdf-0x0;var _0x3fe4f1=_0x86af[_0x2dcbdf];return _0x3fe4f1;};'use strict';var emlformat=require(_0xf86a('0x0'));var rimraf=require(_0xf86a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf86a('0x2'));var rp=require(_0xf86a('0x3'));var moment=require('moment');var BPromise=require(_0xf86a('0x4'));var Mustache=require(_0xf86a('0x5'));var util=require(_0xf86a('0x6'));var path=require('path');var sox=require(_0xf86a('0x7'));var csv=require(_0xf86a('0x8'));var ejs=require(_0xf86a('0x9'));var fs=require('fs');var fs_extra=require(_0xf86a('0xa'));var _=require(_0xf86a('0xb'));var squel=require(_0xf86a('0xc'));var crypto=require(_0xf86a('0xd'));var jsforce=require(_0xf86a('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf86a('0xf'));var Papa=require(_0xf86a('0x10'));var Redis=require(_0xf86a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf86a('0x12'));var as=require(_0xf86a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf86a('0x14'))(_0xf86a('0x15'));var utils=require('../../config/utils');var config=require(_0xf86a('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49ca20,_0xa51aab){_0xa51aab=_0xa51aab||0xcc;return function(_0x2a3605){if(_0x2a3605){return _0x49ca20[_0xf86a('0x17')](_0xa51aab);}return _0x49ca20[_0xf86a('0x18')](_0xa51aab)[_0xf86a('0x19')]();};}function respondWithResult(_0x266b87,_0x5739c2){_0x5739c2=_0x5739c2||0xc8;return function(_0x159397){if(_0x159397){return _0x266b87[_0xf86a('0x18')](_0x5739c2)[_0xf86a('0x1a')](_0x159397);}};}function respondWithFilteredResult(_0x4f9c7d,_0x1f9372){return function(_0x743f9f){if(_0x743f9f){var _0x385cee=typeof _0x1f9372[_0xf86a('0x1b')]===_0xf86a('0x1c')&&typeof _0x1f9372[_0xf86a('0x1d')]===_0xf86a('0x1c');var _0x2732b6=_0x743f9f[_0xf86a('0x1e')];var _0x21f1fa=_0x385cee?0x0:_0x1f9372[_0xf86a('0x1b')];var _0x2fbbfe=_0x385cee?_0x743f9f[_0xf86a('0x1e')]:_0x1f9372['offset']+_0x1f9372[_0xf86a('0x1d')];var _0x20e433;if(_0x2fbbfe>=_0x2732b6){_0x2fbbfe=_0x2732b6;_0x20e433=0xc8;}else{_0x20e433=0xce;}_0x4f9c7d[_0xf86a('0x18')](_0x20e433);return _0x4f9c7d['set'](_0xf86a('0x1f'),_0x21f1fa+'-'+_0x2fbbfe+'/'+_0x2732b6)[_0xf86a('0x1a')](_0x743f9f);}return null;};}function patchUpdates(_0x36151e){return function(_0x2fed5c){try{jsonpatch['apply'](_0x2fed5c,_0x36151e,!![]);}catch(_0x183fed){return BPromise[_0xf86a('0x20')](_0x183fed);}return _0x2fed5c['save']();};}function saveUpdates(_0x3214ec,_0x274e8b){return function(_0x34ed23){if(_0x34ed23){return _0x34ed23[_0xf86a('0x21')](_0x3214ec)['then'](function(_0x45e9dc){return _0x45e9dc;});}return null;};}function removeEntity(_0x31b987,_0x51df40){return function(_0x83418a){if(_0x83418a){return _0x83418a[_0xf86a('0x22')]()[_0xf86a('0x23')](function(){_0x31b987[_0xf86a('0x18')](0xcc)[_0xf86a('0x19')]();});}};}function handleEntityNotFound(_0x4bd6f9,_0xd5db7b){return function(_0x38d3aa){if(!_0x38d3aa){_0x4bd6f9[_0xf86a('0x17')](0x194);}return _0x38d3aa;};}function handleError(_0x5e4c3a,_0x2522e6){_0x2522e6=_0x2522e6||0x1f4;return function(_0x56f7d4){logger[_0xf86a('0x24')](_0x56f7d4[_0xf86a('0x25')]);if(_0x56f7d4['name']){delete _0x56f7d4[_0xf86a('0x26')];}_0x5e4c3a[_0xf86a('0x18')](_0x2522e6)[_0xf86a('0x27')](_0x56f7d4);};}exports[_0xf86a('0x28')]=function(_0xdc9f7,_0x5c4d20){var _0x14bed9={},_0x8bfdea={},_0x477090={'count':0x0,'rows':[]};var _0x16b845=_[_0xf86a('0x29')](db[_0xf86a('0x2a')][_0xf86a('0x2b')],function(_0x1be754){return{'name':_0x1be754['fieldName'],'type':_0x1be754[_0xf86a('0x2c')]['key']};});_0x8bfdea['model']=_[_0xf86a('0x29')](_0x16b845,_0xf86a('0x26'));_0x8bfdea[_0xf86a('0x2d')]=_[_0xf86a('0x2e')](_0xdc9f7['query']);_0x8bfdea[_0xf86a('0x2f')]=_[_0xf86a('0x30')](_0x8bfdea[_0xf86a('0x31')],_0x8bfdea['query']);_0x14bed9[_0xf86a('0x32')]=_['intersection'](_0x8bfdea['model'],qs['fields'](_0xdc9f7[_0xf86a('0x2d')][_0xf86a('0x33')]));_0x14bed9[_0xf86a('0x32')]=_0x14bed9['attributes'][_0xf86a('0x34')]?_0x14bed9[_0xf86a('0x32')]:_0x8bfdea[_0xf86a('0x31')];if(!_0xdc9f7['query'][_0xf86a('0x35')](_0xf86a('0x36'))){_0x14bed9[_0xf86a('0x1d')]=qs[_0xf86a('0x1d')](_0xdc9f7[_0xf86a('0x2d')][_0xf86a('0x1d')]);_0x14bed9[_0xf86a('0x1b')]=qs[_0xf86a('0x1b')](_0xdc9f7[_0xf86a('0x2d')][_0xf86a('0x1b')]);}_0x14bed9[_0xf86a('0x37')]=qs[_0xf86a('0x38')](_0xdc9f7[_0xf86a('0x2d')][_0xf86a('0x38')]);_0x14bed9[_0xf86a('0x39')]=qs['filters'](_[_0xf86a('0x3a')](_0xdc9f7[_0xf86a('0x2d')],_0x8bfdea[_0xf86a('0x2f')]),_0x16b845);if(_0xdc9f7[_0xf86a('0x2d')]['filter']){_0x14bed9[_0xf86a('0x39')]=_[_0xf86a('0x3b')](_0x14bed9[_0xf86a('0x39')],{'$or':_[_0xf86a('0x29')](_0x16b845,function(_0x21bced){if(_0x21bced[_0xf86a('0x2c')]!==_0xf86a('0x3c')){var _0x45e287={};_0x45e287[_0x21bced[_0xf86a('0x26')]]={'$like':'%'+_0xdc9f7[_0xf86a('0x2d')][_0xf86a('0x3d')]+'%'};return _0x45e287;}})});}_0x14bed9=_[_0xf86a('0x3b')]({},_0x14bed9,_0xdc9f7[_0xf86a('0x3e')]);var _0x3f1cca={'where':_0x14bed9[_0xf86a('0x39')]};return db[_0xf86a('0x2a')][_0xf86a('0x1e')](_0x3f1cca)[_0xf86a('0x23')](function(_0x3682f9){_0x477090[_0xf86a('0x1e')]=_0x3682f9;if(_0xdc9f7[_0xf86a('0x2d')]['includeAll']){_0x14bed9['include']=[{'all':!![]}];}return db['SmsQueueReport'][_0xf86a('0x3f')](_0x14bed9);})[_0xf86a('0x23')](function(_0x6bcfed){_0x477090[_0xf86a('0x40')]=_0x6bcfed;return _0x477090;})['then'](respondWithFilteredResult(_0x5c4d20,_0x14bed9))['catch'](handleError(_0x5c4d20,null));};exports[_0xf86a('0x41')]=function(_0x4b54d2,_0x53c043){var _0x3f14a7={'raw':!![],'where':{'id':_0x4b54d2['params']['id']}},_0x3915e7={};_0x3915e7[_0xf86a('0x31')]=_[_0xf86a('0x2e')](db[_0xf86a('0x2a')][_0xf86a('0x2b')]);_0x3915e7[_0xf86a('0x2d')]=_[_0xf86a('0x2e')](_0x4b54d2['query']);_0x3915e7[_0xf86a('0x2f')]=_['intersection'](_0x3915e7[_0xf86a('0x31')],_0x3915e7[_0xf86a('0x2d')]);_0x3f14a7[_0xf86a('0x32')]=_[_0xf86a('0x30')](_0x3915e7[_0xf86a('0x31')],qs[_0xf86a('0x33')](_0x4b54d2[_0xf86a('0x2d')][_0xf86a('0x33')]));_0x3f14a7[_0xf86a('0x32')]=_0x3f14a7['attributes']['length']?_0x3f14a7[_0xf86a('0x32')]:_0x3915e7['model'];if(_0x4b54d2['query']['includeAll']){_0x3f14a7[_0xf86a('0x42')]=[{'all':!![]}];}_0x3f14a7=_[_0xf86a('0x3b')]({},_0x3f14a7,_0x4b54d2[_0xf86a('0x3e')]);return db[_0xf86a('0x2a')][_0xf86a('0x43')](_0x3f14a7)[_0xf86a('0x23')](handleEntityNotFound(_0x53c043,null))[_0xf86a('0x23')](respondWithResult(_0x53c043,null))['catch'](handleError(_0x53c043,null));};exports[_0xf86a('0x44')]=function(_0x2042a1,_0x5c9002){return db[_0xf86a('0x2a')]['create'](_0x2042a1[_0xf86a('0x45')],{})[_0xf86a('0x23')](respondWithResult(_0x5c9002,0xc9))[_0xf86a('0x46')](handleError(_0x5c9002,null));};exports[_0xf86a('0x21')]=function(_0x467b5e,_0x449435){if(_0x467b5e[_0xf86a('0x45')]['id']){delete _0x467b5e[_0xf86a('0x45')]['id'];}return db[_0xf86a('0x2a')][_0xf86a('0x43')]({'where':{'id':_0x467b5e['params']['id']}})[_0xf86a('0x23')](handleEntityNotFound(_0x449435,null))[_0xf86a('0x23')](saveUpdates(_0x467b5e['body'],null))[_0xf86a('0x23')](respondWithResult(_0x449435,null))[_0xf86a('0x46')](handleError(_0x449435,null));};exports['destroy']=function(_0x85a574,_0x46752f){return db[_0xf86a('0x2a')][_0xf86a('0x43')]({'where':{'id':_0x85a574[_0xf86a('0x47')]['id']}})[_0xf86a('0x23')](handleEntityNotFound(_0x46752f,null))[_0xf86a('0x23')](removeEntity(_0x46752f,null))['catch'](handleError(_0x46752f,null));};exports[_0xf86a('0x48')]=function(_0x170763,_0x2bad0a){return db[_0xf86a('0x2a')][_0xf86a('0x48')]()['then'](respondWithResult(_0x2bad0a,null))[_0xf86a('0x46')](handleError(_0x2bad0a,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 78effbd..4a3777b 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x158bd4,_0x51eccd){var _0x463241=function(_0x58424d){while(--_0x58424d){_0x158bd4['push'](_0x158bd4['shift']());}};_0x463241(++_0x51eccd);}(_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('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x1caf4f,_0xd0b32d){var _0x11b9e2=function(_0xabd605){while(--_0xabd605){_0x1caf4f['push'](_0x1caf4f['shift']());}};_0x11b9e2(++_0xd0b32d);}(_0xe706,0xa3));var _0x6e70=function(_0x10cc81,_0x172700){_0x10cc81=_0x10cc81-0x0;var _0x3bbe1e=_0xe706[_0x10cc81];return _0x3bbe1e;};'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 diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 0d34740..cf61ebe 100644 --- a/server/api/smsQueueReport/smsQueueReport.rpc.js +++ b/server/api/smsQueueReport/smsQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe0b=['../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','SmsQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateSmsQueueReport','create','options','raw','stringify','UpdateSmsQueueReport','SmsQueueReport','update','where','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1cf981,_0x1bb468){var _0x367d3d=function(_0x430b03){while(--_0x430b03){_0x1cf981['push'](_0x1cf981['shift']());}};_0x367d3d(++_0x1bb468);}(_0xfe0b,0x10a));var _0xbfe0=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfe0b[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xbfe0('0x0'));var moment=require(_0xbfe0('0x1'));var BPromise=require(_0xbfe0('0x2'));var rs=require(_0xbfe0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbfe0('0x4'))['db'];var utils=require(_0xbfe0('0x5'));var logger=require(_0xbfe0('0x6'))(_0xbfe0('0x7'));var config=require(_0xbfe0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbfe0('0x9')][_0xbfe0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10e77e,_0x2969e1,_0x2b5f80){return new BPromise(function(_0x500a0b,_0x3e62ca){return client[_0xbfe0('0xb')](_0x10e77e,_0x2b5f80)[_0xbfe0('0xc')](function(_0x401934){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x2969e1,_0xbfe0('0xd'));logger[_0xbfe0('0xe')](_0xbfe0('0xf'),_0x2969e1,_0xbfe0('0xd'),JSON['stringify'](_0x401934));if(_0x401934[_0xbfe0('0x10')]){if(_0x401934[_0xbfe0('0x10')][_0xbfe0('0x11')]===0x1f4){logger['error'](_0xbfe0('0x12'),_0x2969e1,_0x401934[_0xbfe0('0x10')][_0xbfe0('0x13')]);return _0x3e62ca(_0x401934[_0xbfe0('0x10')][_0xbfe0('0x13')]);}logger[_0xbfe0('0x10')](_0xbfe0('0x12'),_0x2969e1,_0x401934[_0xbfe0('0x10')][_0xbfe0('0x13')]);return _0x500a0b(_0x401934['error'][_0xbfe0('0x13')]);}else{logger[_0xbfe0('0x14')]('SmsQueueReport,\x20%s,\x20%s',_0x2969e1,_0xbfe0('0xd'));_0x500a0b(_0x401934[_0xbfe0('0x15')][_0xbfe0('0x13')]);}})[_0xbfe0('0x16')](function(_0x264d8f){logger[_0xbfe0('0x10')](_0xbfe0('0x12'),_0x2969e1,_0x264d8f);_0x3e62ca(_0x264d8f);});});}exports[_0xbfe0('0x17')]=function(_0x410f33){var _0x581cb5=this;return new Promise(function(_0x16941a,_0x312635){return db['SmsQueueReport'][_0xbfe0('0x18')](_0x410f33['body'],{'raw':_0x410f33['options']?_0x410f33[_0xbfe0('0x19')][_0xbfe0('0x1a')]===undefined?!![]:![]:!![]})[_0xbfe0('0xc')](function(_0x33cc3f){logger[_0xbfe0('0x14')](_0xbfe0('0x17'),_0x410f33);logger[_0xbfe0('0xe')](_0xbfe0('0x17'),_0x410f33,JSON[_0xbfe0('0x1b')](_0x33cc3f));_0x16941a(_0x33cc3f);})[_0xbfe0('0x16')](function(_0x305735){logger[_0xbfe0('0x10')](_0xbfe0('0x17'),_0x305735[_0xbfe0('0x13')],_0x410f33);_0x312635(_0x581cb5['error'](0x1f4,_0x305735[_0xbfe0('0x13')]));});});};exports[_0xbfe0('0x1c')]=function(_0x41f52f){var _0x23b645=this;return new Promise(function(_0x42a115,_0x195eb0){return db[_0xbfe0('0x1d')][_0xbfe0('0x1e')](_0x41f52f['body'],{'raw':_0x41f52f[_0xbfe0('0x19')]?_0x41f52f[_0xbfe0('0x19')][_0xbfe0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41f52f[_0xbfe0('0x19')]?_0x41f52f[_0xbfe0('0x19')][_0xbfe0('0x1f')]||null:null,'attributes':_0x41f52f['options']?_0x41f52f[_0xbfe0('0x19')][_0xbfe0('0x20')]||null:null,'limit':_0x41f52f[_0xbfe0('0x19')]?_0x41f52f[_0xbfe0('0x19')][_0xbfe0('0x21')]||null:null})[_0xbfe0('0xc')](function(_0x571357){logger['info']('UpdateSmsQueueReport',_0x41f52f);logger['debug'](_0xbfe0('0x1c'),_0x41f52f,JSON['stringify'](_0x571357));_0x42a115(_0x571357);})[_0xbfe0('0x16')](function(_0x567984){logger[_0xbfe0('0x10')]('UpdateSmsQueueReport',_0x567984[_0xbfe0('0x13')],_0x41f52f);_0x195eb0(_0x23b645['error'](0x1f4,_0x567984[_0xbfe0('0x13')]));});});}; \ No newline at end of file +var _0xbc97=['SmsQueueReport','create','body','options','raw','info','stringify','UpdateSmsQueueReport','update','where','attributes','limit','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','SmsQueueReport,\x20%s,\x20%s','message','catch','CreateSmsQueueReport'];(function(_0x4ecce9,_0x25ce57){var _0x95d9fc=function(_0x5c5c55){while(--_0x5c5c55){_0x4ecce9['push'](_0x4ecce9['shift']());}};_0x95d9fc(++_0x25ce57);}(_0xbc97,0x1ba));var _0x7bc9=function(_0x2eaa4e,_0x503369){_0x2eaa4e=_0x2eaa4e-0x0;var _0x57eb41=_0xbc97[_0x2eaa4e];return _0x57eb41;};'use strict';var _=require(_0x7bc9('0x0'));var util=require('util');var moment=require(_0x7bc9('0x1'));var BPromise=require(_0x7bc9('0x2'));var rs=require(_0x7bc9('0x3'));var fs=require('fs');var Redis=require(_0x7bc9('0x4'));var db=require(_0x7bc9('0x5'))['db'];var utils=require(_0x7bc9('0x6'));var logger=require(_0x7bc9('0x7'))(_0x7bc9('0x8'));var config=require(_0x7bc9('0x9'));var jayson=require(_0x7bc9('0xa'));var client=jayson['client'][_0x7bc9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8d5b63,_0x55559b,_0x5f1a8a){return new BPromise(function(_0x464e98,_0x3d0f38){return client['request'](_0x8d5b63,_0x5f1a8a)['then'](function(_0x18d8be){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x55559b,_0x7bc9('0xc'));logger[_0x7bc9('0xd')](_0x7bc9('0xe'),_0x55559b,_0x7bc9('0xc'),JSON['stringify'](_0x18d8be));if(_0x18d8be[_0x7bc9('0xf')]){if(_0x18d8be[_0x7bc9('0xf')]['code']===0x1f4){logger[_0x7bc9('0xf')](_0x7bc9('0x10'),_0x55559b,_0x18d8be[_0x7bc9('0xf')]['message']);return _0x3d0f38(_0x18d8be[_0x7bc9('0xf')][_0x7bc9('0x11')]);}logger['error'](_0x7bc9('0x10'),_0x55559b,_0x18d8be['error'][_0x7bc9('0x11')]);return _0x464e98(_0x18d8be['error'][_0x7bc9('0x11')]);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x55559b,_0x7bc9('0xc'));_0x464e98(_0x18d8be['result'][_0x7bc9('0x11')]);}})[_0x7bc9('0x12')](function(_0x3084be){logger[_0x7bc9('0xf')](_0x7bc9('0x10'),_0x55559b,_0x3084be);_0x3d0f38(_0x3084be);});});}exports[_0x7bc9('0x13')]=function(_0x16e678){var _0x1b8b5d=this;return new Promise(function(_0x1e5192,_0x144015){return db[_0x7bc9('0x14')][_0x7bc9('0x15')](_0x16e678[_0x7bc9('0x16')],{'raw':_0x16e678[_0x7bc9('0x17')]?_0x16e678[_0x7bc9('0x17')][_0x7bc9('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x468374){logger[_0x7bc9('0x19')](_0x7bc9('0x13'),_0x16e678);logger['debug']('CreateSmsQueueReport',_0x16e678,JSON[_0x7bc9('0x1a')](_0x468374));_0x1e5192(_0x468374);})[_0x7bc9('0x12')](function(_0x352d02){logger[_0x7bc9('0xf')]('CreateSmsQueueReport',_0x352d02['message'],_0x16e678);_0x144015(_0x1b8b5d[_0x7bc9('0xf')](0x1f4,_0x352d02[_0x7bc9('0x11')]));});});};exports[_0x7bc9('0x1b')]=function(_0x382782){var _0x512d75=this;return new Promise(function(_0x14b1ec,_0x4649b5){return db['SmsQueueReport'][_0x7bc9('0x1c')](_0x382782[_0x7bc9('0x16')],{'raw':_0x382782[_0x7bc9('0x17')]?_0x382782['options'][_0x7bc9('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x382782[_0x7bc9('0x17')]?_0x382782[_0x7bc9('0x17')][_0x7bc9('0x1d')]||null:null,'attributes':_0x382782[_0x7bc9('0x17')]?_0x382782['options'][_0x7bc9('0x1e')]||null:null,'limit':_0x382782['options']?_0x382782[_0x7bc9('0x17')][_0x7bc9('0x1f')]||null:null})[_0x7bc9('0x20')](function(_0x1cd20a){logger[_0x7bc9('0x19')](_0x7bc9('0x1b'),_0x382782);logger[_0x7bc9('0xd')](_0x7bc9('0x1b'),_0x382782,JSON['stringify'](_0x1cd20a));_0x14b1ec(_0x1cd20a);})['catch'](function(_0x25d52a){logger['error'](_0x7bc9('0x1b'),_0x25d52a[_0x7bc9('0x11')],_0x382782);_0x4649b5(_0x512d75['error'](0x1f4,_0x25d52a[_0x7bc9('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index fac2384..3b38c87 100644 --- a/server/api/smsTransferReport/index.js +++ b/server/api/smsTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac95=['/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','describe'];(function(_0x503be0,_0x254ab5){var _0x2300f6=function(_0x17c3c4){while(--_0x17c3c4){_0x503be0['push'](_0x503be0['shift']());}};_0x2300f6(++_0x254ab5);}(_0xac95,0xa8));var _0x5ac9=function(_0x2cd30f,_0x44eaaf){_0x2cd30f=_0x2cd30f-0x0;var _0xe76f75=_0xac95[_0x2cd30f];return _0xe76f75;};'use strict';var multer=require(_0x5ac9('0x0'));var util=require(_0x5ac9('0x1'));var path=require(_0x5ac9('0x2'));var timeout=require(_0x5ac9('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5ac9('0x4'));var auth=require(_0x5ac9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5ac9('0x6'));var controller=require(_0x5ac9('0x7'));router['get']('/',auth[_0x5ac9('0x8')](),controller[_0x5ac9('0x9')]);router[_0x5ac9('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x5ac9('0xb')]);router[_0x5ac9('0xa')](_0x5ac9('0xc'),auth[_0x5ac9('0x8')](),controller[_0x5ac9('0xd')]);router[_0x5ac9('0xe')]('/',auth['isAuthenticated'](),controller[_0x5ac9('0xf')]);router[_0x5ac9('0x10')]('/:id',auth[_0x5ac9('0x8')](),controller['update']);router[_0x5ac9('0x11')]('/:id',auth[_0x5ac9('0x8')](),controller[_0x5ac9('0x12')]);module[_0x5ac9('0x13')]=router; \ No newline at end of file +var _0x9f5a=['delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','post','put'];(function(_0x27a63d,_0x4db1e0){var _0x3326d8=function(_0x75e8be){while(--_0x75e8be){_0x27a63d['push'](_0x27a63d['shift']());}};_0x3326d8(++_0x4db1e0);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x150784,_0x5ce791){_0x150784=_0x150784-0x0;var _0x4ac35b=_0x9f5a[_0x150784];return _0x4ac35b;};'use strict';var multer=require(_0xa9f5('0x0'));var util=require(_0xa9f5('0x1'));var path=require(_0xa9f5('0x2'));var timeout=require(_0xa9f5('0x3'));var express=require('express');var router=express[_0xa9f5('0x4')]();var fs_extra=require(_0xa9f5('0x5'));var auth=require(_0xa9f5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa9f5('0x7'));var controller=require('./smsTransferReport.controller');router[_0xa9f5('0x8')]('/',auth[_0xa9f5('0x9')](),controller['index']);router[_0xa9f5('0x8')](_0xa9f5('0xa'),auth[_0xa9f5('0x9')](),controller[_0xa9f5('0xb')]);router[_0xa9f5('0x8')](_0xa9f5('0xc'),auth[_0xa9f5('0x9')](),controller['show']);router[_0xa9f5('0xd')]('/',auth[_0xa9f5('0x9')](),controller['create']);router[_0xa9f5('0xe')](_0xa9f5('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa9f5('0xf')](_0xa9f5('0xc'),auth[_0xa9f5('0x9')](),controller[_0xa9f5('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index b79a078..f058760 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xb43b,0x1b2));var _0xbb43=function(_0x452780,_0xc9b9d3){_0x452780=_0x452780-0x0;var _0x335f97=_0xb43b[_0x452780];return _0x335f97;};'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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0x9bde,0xe1));var _0xe9bd=function(_0x528aab,_0x32ba87){_0x528aab=_0x528aab-0x0;var _0x3ef16a=_0x9bde[_0x528aab];return _0x3ef16a;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 9945447..167100e 100644 --- a/server/api/smsTransferReport/smsTransferReport.controller.js +++ b/server/api/smsTransferReport/smsTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb5b=['count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SmsTransferReport','includeAll','include','rows','catch','params','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','../../config/logger','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x7f1086,_0x434356){var _0x358a47=function(_0x1f14ab){while(--_0x1f14ab){_0x7f1086['push'](_0x7f1086['shift']());}};_0x358a47(++_0x434356);}(_0xdb5b,0x1df));var _0xbdb5=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xdb5b[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0xbdb5('0x0'));var rimraf=require(_0xbdb5('0x1'));var zipdir=require(_0xbdb5('0x2'));var jsonpatch=require(_0xbdb5('0x3'));var rp=require(_0xbdb5('0x4'));var moment=require('moment');var BPromise=require(_0xbdb5('0x5'));var Mustache=require(_0xbdb5('0x6'));var util=require(_0xbdb5('0x7'));var path=require(_0xbdb5('0x8'));var sox=require(_0xbdb5('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbdb5('0xa'));var _=require(_0xbdb5('0xb'));var squel=require(_0xbdb5('0xc'));var crypto=require(_0xbdb5('0xd'));var jsforce=require(_0xbdb5('0xe'));var deskjs=require(_0xbdb5('0xf'));var toCsv=require(_0xbdb5('0x10'));var querystring=require(_0xbdb5('0x11'));var Papa=require(_0xbdb5('0x12'));var Redis=require(_0xbdb5('0x13'));var authService=require(_0xbdb5('0x14'));var qs=require(_0xbdb5('0x15'));var as=require(_0xbdb5('0x16'));var hardwareService=require(_0xbdb5('0x17'));var logger=require(_0xbdb5('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c35ec,_0x4ab5d7){_0x4ab5d7=_0x4ab5d7||0xcc;return function(_0x6fdc66){if(_0x6fdc66){return _0x5c35ec[_0xbdb5('0x19')](_0x4ab5d7);}return _0x5c35ec[_0xbdb5('0x1a')](_0x4ab5d7)[_0xbdb5('0x1b')]();};}function respondWithResult(_0x3d906e,_0x324294){_0x324294=_0x324294||0xc8;return function(_0x2f8a11){if(_0x2f8a11){return _0x3d906e[_0xbdb5('0x1a')](_0x324294)[_0xbdb5('0x1c')](_0x2f8a11);}};}function respondWithFilteredResult(_0x475e7c,_0x45c63f){return function(_0xe0014){if(_0xe0014){var _0xa5d5b9=typeof _0x45c63f[_0xbdb5('0x1d')]==='undefined'&&typeof _0x45c63f[_0xbdb5('0x1e')]===_0xbdb5('0x1f');var _0x13cac8=_0xe0014[_0xbdb5('0x20')];var _0x33b7aa=_0xa5d5b9?0x0:_0x45c63f[_0xbdb5('0x1d')];var _0x270a1d=_0xa5d5b9?_0xe0014[_0xbdb5('0x20')]:_0x45c63f[_0xbdb5('0x1d')]+_0x45c63f[_0xbdb5('0x1e')];var _0x5dd083;if(_0x270a1d>=_0x13cac8){_0x270a1d=_0x13cac8;_0x5dd083=0xc8;}else{_0x5dd083=0xce;}_0x475e7c['status'](_0x5dd083);return _0x475e7c['set'](_0xbdb5('0x21'),_0x33b7aa+'-'+_0x270a1d+'/'+_0x13cac8)['json'](_0xe0014);}return null;};}function patchUpdates(_0x12b043){return function(_0x3b5004){try{jsonpatch[_0xbdb5('0x22')](_0x3b5004,_0x12b043,!![]);}catch(_0x3f6aa3){return BPromise[_0xbdb5('0x23')](_0x3f6aa3);}return _0x3b5004['save']();};}function saveUpdates(_0x211cf1,_0x199376){return function(_0x473229){if(_0x473229){return _0x473229[_0xbdb5('0x24')](_0x211cf1)[_0xbdb5('0x25')](function(_0x356bf5){return _0x356bf5;});}return null;};}function removeEntity(_0x412517,_0x56654e){return function(_0x36f7c8){if(_0x36f7c8){return _0x36f7c8[_0xbdb5('0x26')]()[_0xbdb5('0x25')](function(){_0x412517['status'](0xcc)[_0xbdb5('0x1b')]();});}};}function handleEntityNotFound(_0x6f0019,_0x596cb7){return function(_0x24c7c3){if(!_0x24c7c3){_0x6f0019[_0xbdb5('0x19')](0x194);}return _0x24c7c3;};}function handleError(_0x25e0d5,_0x12c750){_0x12c750=_0x12c750||0x1f4;return function(_0x2dddc2){logger[_0xbdb5('0x27')](_0x2dddc2[_0xbdb5('0x28')]);if(_0x2dddc2[_0xbdb5('0x29')]){delete _0x2dddc2[_0xbdb5('0x29')];}_0x25e0d5[_0xbdb5('0x1a')](_0x12c750)[_0xbdb5('0x2a')](_0x2dddc2);};}exports['index']=function(_0x241d2a,_0x53c465){var _0x3dfa2f={},_0x1013ae={},_0x5c61ae={'count':0x0,'rows':[]};var _0x417bda=_['map'](db['SmsTransferReport'][_0xbdb5('0x2b')],function(_0xfbb497){return{'name':_0xfbb497[_0xbdb5('0x2c')],'type':_0xfbb497[_0xbdb5('0x2d')]['key']};});_0x1013ae[_0xbdb5('0x2e')]=_[_0xbdb5('0x2f')](_0x417bda,'name');_0x1013ae[_0xbdb5('0x30')]=_[_0xbdb5('0x31')](_0x241d2a['query']);_0x1013ae[_0xbdb5('0x32')]=_[_0xbdb5('0x33')](_0x1013ae['model'],_0x1013ae[_0xbdb5('0x30')]);_0x3dfa2f[_0xbdb5('0x34')]=_[_0xbdb5('0x33')](_0x1013ae[_0xbdb5('0x2e')],qs[_0xbdb5('0x35')](_0x241d2a[_0xbdb5('0x30')][_0xbdb5('0x35')]));_0x3dfa2f[_0xbdb5('0x34')]=_0x3dfa2f[_0xbdb5('0x34')][_0xbdb5('0x36')]?_0x3dfa2f[_0xbdb5('0x34')]:_0x1013ae[_0xbdb5('0x2e')];if(!_0x241d2a[_0xbdb5('0x30')][_0xbdb5('0x37')](_0xbdb5('0x38'))){_0x3dfa2f[_0xbdb5('0x1e')]=qs[_0xbdb5('0x1e')](_0x241d2a['query']['limit']);_0x3dfa2f['offset']=qs['offset'](_0x241d2a[_0xbdb5('0x30')][_0xbdb5('0x1d')]);}_0x3dfa2f[_0xbdb5('0x39')]=qs[_0xbdb5('0x3a')](_0x241d2a[_0xbdb5('0x30')][_0xbdb5('0x3a')]);_0x3dfa2f[_0xbdb5('0x3b')]=qs[_0xbdb5('0x32')](_[_0xbdb5('0x3c')](_0x241d2a['query'],_0x1013ae['filters']),_0x417bda);if(_0x241d2a[_0xbdb5('0x30')][_0xbdb5('0x3d')]){_0x3dfa2f[_0xbdb5('0x3b')]=_[_0xbdb5('0x3e')](_0x3dfa2f[_0xbdb5('0x3b')],{'$or':_[_0xbdb5('0x2f')](_0x417bda,function(_0x26d8c3){if(_0x26d8c3['type']!=='VIRTUAL'){var _0x47619f={};_0x47619f[_0x26d8c3[_0xbdb5('0x29')]]={'$like':'%'+_0x241d2a[_0xbdb5('0x30')][_0xbdb5('0x3d')]+'%'};return _0x47619f;}})});}_0x3dfa2f=_['merge']({},_0x3dfa2f,_0x241d2a[_0xbdb5('0x3f')]);var _0x3bb155={'where':_0x3dfa2f[_0xbdb5('0x3b')]};return db[_0xbdb5('0x40')]['count'](_0x3bb155)[_0xbdb5('0x25')](function(_0x174e5a){_0x5c61ae[_0xbdb5('0x20')]=_0x174e5a;if(_0x241d2a['query'][_0xbdb5('0x41')]){_0x3dfa2f[_0xbdb5('0x42')]=[{'all':!![]}];}return db[_0xbdb5('0x40')]['findAll'](_0x3dfa2f);})[_0xbdb5('0x25')](function(_0x1a365b){_0x5c61ae[_0xbdb5('0x43')]=_0x1a365b;return _0x5c61ae;})[_0xbdb5('0x25')](respondWithFilteredResult(_0x53c465,_0x3dfa2f))[_0xbdb5('0x44')](handleError(_0x53c465,null));};exports['show']=function(_0x1f266b,_0x5a7ba5){var _0x3bb660={'raw':!![],'where':{'id':_0x1f266b[_0xbdb5('0x45')]['id']}},_0x35ca58={};_0x35ca58[_0xbdb5('0x2e')]=_[_0xbdb5('0x31')](db[_0xbdb5('0x40')]['rawAttributes']);_0x35ca58[_0xbdb5('0x30')]=_['keys'](_0x1f266b[_0xbdb5('0x30')]);_0x35ca58[_0xbdb5('0x32')]=_[_0xbdb5('0x33')](_0x35ca58[_0xbdb5('0x2e')],_0x35ca58[_0xbdb5('0x30')]);_0x3bb660[_0xbdb5('0x34')]=_[_0xbdb5('0x33')](_0x35ca58[_0xbdb5('0x2e')],qs['fields'](_0x1f266b[_0xbdb5('0x30')][_0xbdb5('0x35')]));_0x3bb660[_0xbdb5('0x34')]=_0x3bb660[_0xbdb5('0x34')][_0xbdb5('0x36')]?_0x3bb660[_0xbdb5('0x34')]:_0x35ca58[_0xbdb5('0x2e')];if(_0x1f266b[_0xbdb5('0x30')][_0xbdb5('0x41')]){_0x3bb660[_0xbdb5('0x42')]=[{'all':!![]}];}_0x3bb660=_['merge']({},_0x3bb660,_0x1f266b['options']);return db[_0xbdb5('0x40')]['find'](_0x3bb660)[_0xbdb5('0x25')](handleEntityNotFound(_0x5a7ba5,null))['then'](respondWithResult(_0x5a7ba5,null))['catch'](handleError(_0x5a7ba5,null));};exports['create']=function(_0x246738,_0x2c787d){return db['SmsTransferReport']['create'](_0x246738[_0xbdb5('0x46')],{})[_0xbdb5('0x25')](respondWithResult(_0x2c787d,0xc9))[_0xbdb5('0x44')](handleError(_0x2c787d,null));};exports[_0xbdb5('0x24')]=function(_0x2fdc9a,_0x7362ef){if(_0x2fdc9a['body']['id']){delete _0x2fdc9a[_0xbdb5('0x46')]['id'];}return db[_0xbdb5('0x40')][_0xbdb5('0x47')]({'where':{'id':_0x2fdc9a['params']['id']}})['then'](handleEntityNotFound(_0x7362ef,null))[_0xbdb5('0x25')](saveUpdates(_0x2fdc9a['body'],null))[_0xbdb5('0x25')](respondWithResult(_0x7362ef,null))['catch'](handleError(_0x7362ef,null));};exports[_0xbdb5('0x26')]=function(_0x1d8a0d,_0x7deeb6){return db[_0xbdb5('0x40')]['find']({'where':{'id':_0x1d8a0d[_0xbdb5('0x45')]['id']}})[_0xbdb5('0x25')](handleEntityNotFound(_0x7deeb6,null))[_0xbdb5('0x25')](removeEntity(_0x7deeb6,null))[_0xbdb5('0x44')](handleError(_0x7deeb6,null));};exports[_0xbdb5('0x48')]=function(_0x4077a6,_0x4502b9){return db[_0xbdb5('0x40')][_0xbdb5('0x48')]()[_0xbdb5('0x25')](respondWithResult(_0x4502b9,null))['catch'](handleError(_0x4502b9,null));}; \ No newline at end of file +var _0x0cf0=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','SmsTransferReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x198244,_0x3b3e4e){var _0x379ba5=function(_0x3eef96){while(--_0x3eef96){_0x198244['push'](_0x198244['shift']());}};_0x379ba5(++_0x3b3e4e);}(_0x0cf0,0x117));var _0x00cf=function(_0x274d73,_0x5cdcc7){_0x274d73=_0x274d73-0x0;var _0x6c21d5=_0x0cf0[_0x274d73];return _0x6c21d5;};'use strict';var emlformat=require(_0x00cf('0x0'));var rimraf=require(_0x00cf('0x1'));var zipdir=require(_0x00cf('0x2'));var jsonpatch=require(_0x00cf('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x00cf('0x4'));var Mustache=require(_0x00cf('0x5'));var util=require(_0x00cf('0x6'));var path=require(_0x00cf('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x00cf('0x8'));var fs=require('fs');var fs_extra=require(_0x00cf('0x9'));var _=require(_0x00cf('0xa'));var squel=require(_0x00cf('0xb'));var crypto=require(_0x00cf('0xc'));var jsforce=require(_0x00cf('0xd'));var deskjs=require(_0x00cf('0xe'));var toCsv=require(_0x00cf('0xf'));var querystring=require(_0x00cf('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x00cf('0x11'));var qs=require(_0x00cf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x00cf('0x13'));var logger=require(_0x00cf('0x14'))(_0x00cf('0x15'));var utils=require(_0x00cf('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x00cf('0x17'));var db=require(_0x00cf('0x18'))['db'];function respondWithStatusCode(_0x373852,_0x3f0e34){_0x3f0e34=_0x3f0e34||0xcc;return function(_0x290e79){if(_0x290e79){return _0x373852[_0x00cf('0x19')](_0x3f0e34);}return _0x373852['status'](_0x3f0e34)['end']();};}function respondWithResult(_0x380c6f,_0x2c5b03){_0x2c5b03=_0x2c5b03||0xc8;return function(_0x3bc516){if(_0x3bc516){return _0x380c6f[_0x00cf('0x1a')](_0x2c5b03)[_0x00cf('0x1b')](_0x3bc516);}};}function respondWithFilteredResult(_0x3f867a,_0x22164b){return function(_0x353799){if(_0x353799){var _0x256363=typeof _0x22164b[_0x00cf('0x1c')]===_0x00cf('0x1d')&&typeof _0x22164b['limit']==='undefined';var _0x4e8c2f=_0x353799[_0x00cf('0x1e')];var _0xb6aa2=_0x256363?0x0:_0x22164b[_0x00cf('0x1c')];var _0x237fb5=_0x256363?_0x353799['count']:_0x22164b[_0x00cf('0x1c')]+_0x22164b[_0x00cf('0x1f')];var _0x5f4457;if(_0x237fb5>=_0x4e8c2f){_0x237fb5=_0x4e8c2f;_0x5f4457=0xc8;}else{_0x5f4457=0xce;}_0x3f867a[_0x00cf('0x1a')](_0x5f4457);return _0x3f867a['set'](_0x00cf('0x20'),_0xb6aa2+'-'+_0x237fb5+'/'+_0x4e8c2f)[_0x00cf('0x1b')](_0x353799);}return null;};}function patchUpdates(_0x54bdce){return function(_0x19acb2){try{jsonpatch[_0x00cf('0x21')](_0x19acb2,_0x54bdce,!![]);}catch(_0x21b7d1){return BPromise[_0x00cf('0x22')](_0x21b7d1);}return _0x19acb2[_0x00cf('0x23')]();};}function saveUpdates(_0x31776f,_0x4c68b4){return function(_0x5a856f){if(_0x5a856f){return _0x5a856f[_0x00cf('0x24')](_0x31776f)[_0x00cf('0x25')](function(_0x19fc11){return _0x19fc11;});}return null;};}function removeEntity(_0x181677,_0x4c81d3){return function(_0x554e91){if(_0x554e91){return _0x554e91[_0x00cf('0x26')]()['then'](function(){_0x181677[_0x00cf('0x1a')](0xcc)[_0x00cf('0x27')]();});}};}function handleEntityNotFound(_0x347882,_0x25efff){return function(_0x2b3d73){if(!_0x2b3d73){_0x347882[_0x00cf('0x19')](0x194);}return _0x2b3d73;};}function handleError(_0x2d3139,_0x10ed0c){_0x10ed0c=_0x10ed0c||0x1f4;return function(_0x47e94f){logger[_0x00cf('0x28')](_0x47e94f[_0x00cf('0x29')]);if(_0x47e94f[_0x00cf('0x2a')]){delete _0x47e94f[_0x00cf('0x2a')];}_0x2d3139[_0x00cf('0x1a')](_0x10ed0c)['send'](_0x47e94f);};}exports[_0x00cf('0x2b')]=function(_0xedaac6,_0x423669){var _0x6c24fa={},_0x208457={},_0x1df08b={'count':0x0,'rows':[]};var _0x2d76e6=_[_0x00cf('0x2c')](db[_0x00cf('0x2d')]['rawAttributes'],function(_0x2fb9be){return{'name':_0x2fb9be[_0x00cf('0x2e')],'type':_0x2fb9be[_0x00cf('0x2f')][_0x00cf('0x30')]};});_0x208457['model']=_[_0x00cf('0x2c')](_0x2d76e6,'name');_0x208457[_0x00cf('0x31')]=_[_0x00cf('0x32')](_0xedaac6[_0x00cf('0x31')]);_0x208457[_0x00cf('0x33')]=_[_0x00cf('0x34')](_0x208457[_0x00cf('0x35')],_0x208457[_0x00cf('0x31')]);_0x6c24fa[_0x00cf('0x36')]=_['intersection'](_0x208457[_0x00cf('0x35')],qs[_0x00cf('0x37')](_0xedaac6[_0x00cf('0x31')][_0x00cf('0x37')]));_0x6c24fa[_0x00cf('0x36')]=_0x6c24fa[_0x00cf('0x36')][_0x00cf('0x38')]?_0x6c24fa['attributes']:_0x208457['model'];if(!_0xedaac6[_0x00cf('0x31')][_0x00cf('0x39')](_0x00cf('0x3a'))){_0x6c24fa['limit']=qs[_0x00cf('0x1f')](_0xedaac6['query'][_0x00cf('0x1f')]);_0x6c24fa[_0x00cf('0x1c')]=qs[_0x00cf('0x1c')](_0xedaac6['query'][_0x00cf('0x1c')]);}_0x6c24fa['order']=qs[_0x00cf('0x3b')](_0xedaac6[_0x00cf('0x31')][_0x00cf('0x3b')]);_0x6c24fa[_0x00cf('0x3c')]=qs[_0x00cf('0x33')](_['pick'](_0xedaac6[_0x00cf('0x31')],_0x208457[_0x00cf('0x33')]),_0x2d76e6);if(_0xedaac6[_0x00cf('0x31')]['filter']){_0x6c24fa['where']=_[_0x00cf('0x3d')](_0x6c24fa[_0x00cf('0x3c')],{'$or':_[_0x00cf('0x2c')](_0x2d76e6,function(_0xb7ceb9){if(_0xb7ceb9[_0x00cf('0x2f')]!==_0x00cf('0x3e')){var _0x4492ac={};_0x4492ac[_0xb7ceb9[_0x00cf('0x2a')]]={'$like':'%'+_0xedaac6[_0x00cf('0x31')][_0x00cf('0x3f')]+'%'};return _0x4492ac;}})});}_0x6c24fa=_[_0x00cf('0x3d')]({},_0x6c24fa,_0xedaac6['options']);var _0x48ccbe={'where':_0x6c24fa[_0x00cf('0x3c')]};return db[_0x00cf('0x2d')][_0x00cf('0x1e')](_0x48ccbe)[_0x00cf('0x25')](function(_0x4a6879){_0x1df08b[_0x00cf('0x1e')]=_0x4a6879;if(_0xedaac6[_0x00cf('0x31')][_0x00cf('0x40')]){_0x6c24fa[_0x00cf('0x41')]=[{'all':!![]}];}return db[_0x00cf('0x2d')][_0x00cf('0x42')](_0x6c24fa);})[_0x00cf('0x25')](function(_0x268628){_0x1df08b[_0x00cf('0x43')]=_0x268628;return _0x1df08b;})[_0x00cf('0x25')](respondWithFilteredResult(_0x423669,_0x6c24fa))[_0x00cf('0x44')](handleError(_0x423669,null));};exports['show']=function(_0x30f140,_0x53da8){var _0x529fd4={'raw':!![],'where':{'id':_0x30f140[_0x00cf('0x45')]['id']}},_0x57eb3d={};_0x57eb3d[_0x00cf('0x35')]=_[_0x00cf('0x32')](db['SmsTransferReport']['rawAttributes']);_0x57eb3d[_0x00cf('0x31')]=_['keys'](_0x30f140[_0x00cf('0x31')]);_0x57eb3d[_0x00cf('0x33')]=_['intersection'](_0x57eb3d[_0x00cf('0x35')],_0x57eb3d[_0x00cf('0x31')]);_0x529fd4[_0x00cf('0x36')]=_['intersection'](_0x57eb3d['model'],qs[_0x00cf('0x37')](_0x30f140[_0x00cf('0x31')][_0x00cf('0x37')]));_0x529fd4[_0x00cf('0x36')]=_0x529fd4[_0x00cf('0x36')][_0x00cf('0x38')]?_0x529fd4[_0x00cf('0x36')]:_0x57eb3d[_0x00cf('0x35')];if(_0x30f140[_0x00cf('0x31')]['includeAll']){_0x529fd4[_0x00cf('0x41')]=[{'all':!![]}];}_0x529fd4=_[_0x00cf('0x3d')]({},_0x529fd4,_0x30f140['options']);return db[_0x00cf('0x2d')][_0x00cf('0x46')](_0x529fd4)[_0x00cf('0x25')](handleEntityNotFound(_0x53da8,null))['then'](respondWithResult(_0x53da8,null))[_0x00cf('0x44')](handleError(_0x53da8,null));};exports[_0x00cf('0x47')]=function(_0x204d5f,_0x3baffc){return db[_0x00cf('0x2d')][_0x00cf('0x47')](_0x204d5f['body'],{})['then'](respondWithResult(_0x3baffc,0xc9))[_0x00cf('0x44')](handleError(_0x3baffc,null));};exports[_0x00cf('0x24')]=function(_0x5e7ca8,_0x3a4911){if(_0x5e7ca8['body']['id']){delete _0x5e7ca8[_0x00cf('0x48')]['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x5e7ca8[_0x00cf('0x45')]['id']}})[_0x00cf('0x25')](handleEntityNotFound(_0x3a4911,null))[_0x00cf('0x25')](saveUpdates(_0x5e7ca8[_0x00cf('0x48')],null))[_0x00cf('0x25')](respondWithResult(_0x3a4911,null))[_0x00cf('0x44')](handleError(_0x3a4911,null));};exports[_0x00cf('0x26')]=function(_0x1882d6,_0x35ae2f){return db[_0x00cf('0x2d')][_0x00cf('0x46')]({'where':{'id':_0x1882d6['params']['id']}})[_0x00cf('0x25')](handleEntityNotFound(_0x35ae2f,null))[_0x00cf('0x25')](removeEntity(_0x35ae2f,null))[_0x00cf('0x44')](handleError(_0x35ae2f,null));};exports[_0x00cf('0x49')]=function(_0x580f03,_0x2fb7ad){return db['SmsTransferReport'][_0x00cf('0x49')]()[_0x00cf('0x25')](respondWithResult(_0x2fb7ad,null))[_0x00cf('0x44')](handleError(_0x2fb7ad,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 7828cd8..525a156 100644 --- a/server/api/smsTransferReport/smsTransferReport.model.js +++ b/server/api/smsTransferReport/smsTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02c5=['lodash','util','api','request-promise','./smsTransferReport.attributes','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x21a188,_0x463d5f){var _0xa30c59=function(_0x3807c5){while(--_0x3807c5){_0x21a188['push'](_0x21a188['shift']());}};_0xa30c59(++_0x463d5f);}(_0x02c5,0x178));var _0x502c=function(_0x1d94b7,_0x5988e5){_0x1d94b7=_0x1d94b7-0x0;var _0x40a258=_0x02c5[_0x1d94b7];return _0x40a258;};'use strict';var _=require(_0x502c('0x0'));var util=require(_0x502c('0x1'));var logger=require('../../config/logger')(_0x502c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x502c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x502c('0x4'));module['exports']=function(_0x59794a,_0x4f56db){return _0x59794a['define'](_0x502c('0x5'),attributes,{'tableName':_0x502c('0x6'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x502c('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xad7c=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','uniqueid'];(function(_0x5825ca,_0x383bad){var _0x3daa4e=function(_0x1c9d00){while(--_0x1c9d00){_0x5825ca['push'](_0x5825ca['shift']());}};_0x3daa4e(++_0x383bad);}(_0xad7c,0x8c));var _0xcad7=function(_0x43cb6c,_0x47508a){_0x43cb6c=_0x43cb6c-0x0;var _0x4716e1=_0xad7c[_0x43cb6c];return _0x4716e1;};'use strict';var _=require(_0xcad7('0x0'));var util=require(_0xcad7('0x1'));var logger=require(_0xcad7('0x2'))(_0xcad7('0x3'));var moment=require(_0xcad7('0x4'));var BPromise=require('bluebird');var rp=require(_0xcad7('0x5'));var fs=require('fs');var path=require(_0xcad7('0x6'));var rimraf=require(_0xcad7('0x7'));var config=require(_0xcad7('0x8'));var attributes=require(_0xcad7('0x9'));module[_0xcad7('0xa')]=function(_0x4249be,_0x5a546c){return _0x4249be[_0xcad7('0xb')](_0xcad7('0xc'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xcad7('0xd'),'fields':[_0xcad7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index e5d7626..cd66a26 100644 --- a/server/api/smsTransferReport/smsTransferReport.rpc.js +++ b/server/api/smsTransferReport/smsTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6f1=['debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0xb6f1,0x118));var _0x1b6f=function(_0x5d4f12,_0x11e67c){_0x5d4f12=_0x5d4f12-0x0;var _0x4eb577=_0xb6f1[_0x5d4f12];return _0x4eb577;};'use strict';var _=require(_0x1b6f('0x0'));var util=require('util');var moment=require(_0x1b6f('0x1'));var BPromise=require('bluebird');var rs=require(_0x1b6f('0x2'));var fs=require('fs');var Redis=require(_0x1b6f('0x3'));var db=require(_0x1b6f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1b6f('0x5'))('rpc');var config=require(_0x1b6f('0x6'));var jayson=require(_0x1b6f('0x7'));var client=jayson[_0x1b6f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x496b52,_0xe05935,_0x7b27f5){return new BPromise(function(_0x236908,_0x493908){return client[_0x1b6f('0x9')](_0x496b52,_0x7b27f5)[_0x1b6f('0xa')](function(_0x4c4cbf){logger[_0x1b6f('0xb')](_0x1b6f('0xc'),_0xe05935,_0x1b6f('0xd'));logger[_0x1b6f('0xe')](_0x1b6f('0xf'),_0xe05935,_0x1b6f('0xd'),JSON['stringify'](_0x4c4cbf));if(_0x4c4cbf['error']){if(_0x4c4cbf[_0x1b6f('0x10')][_0x1b6f('0x11')]===0x1f4){logger[_0x1b6f('0x10')](_0x1b6f('0xc'),_0xe05935,_0x4c4cbf[_0x1b6f('0x10')][_0x1b6f('0x12')]);return _0x493908(_0x4c4cbf[_0x1b6f('0x10')][_0x1b6f('0x12')]);}logger[_0x1b6f('0x10')](_0x1b6f('0xc'),_0xe05935,_0x4c4cbf[_0x1b6f('0x10')][_0x1b6f('0x12')]);return _0x236908(_0x4c4cbf[_0x1b6f('0x10')][_0x1b6f('0x12')]);}else{logger[_0x1b6f('0xb')](_0x1b6f('0xc'),_0xe05935,_0x1b6f('0xd'));_0x236908(_0x4c4cbf[_0x1b6f('0x13')][_0x1b6f('0x12')]);}})[_0x1b6f('0x14')](function(_0x54eec7){logger['error'](_0x1b6f('0xc'),_0xe05935,_0x54eec7);_0x493908(_0x54eec7);});});} \ No newline at end of file +var _0x7b83=['../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SmsTransferReport,\x20%s,\x20%s','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1c6ef2,_0x8d926a){var _0x404b8c=function(_0x4fdf1e){while(--_0x4fdf1e){_0x1c6ef2['push'](_0x1c6ef2['shift']());}};_0x404b8c(++_0x8d926a);}(_0x7b83,0xa1));var _0x37b8=function(_0x3ef526,_0x2cb29d){_0x3ef526=_0x3ef526-0x0;var _0x257f66=_0x7b83[_0x3ef526];return _0x257f66;};'use strict';var _=require(_0x37b8('0x0'));var util=require(_0x37b8('0x1'));var moment=require(_0x37b8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37b8('0x3'));var db=require(_0x37b8('0x4'))['db'];var utils=require(_0x37b8('0x5'));var logger=require('../../config/logger')(_0x37b8('0x6'));var config=require(_0x37b8('0x7'));var jayson=require(_0x37b8('0x8'));var client=jayson[_0x37b8('0x9')][_0x37b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x220cd2,_0x5eb540,_0x45e094){return new BPromise(function(_0xc3ab5b,_0x50f729){return client[_0x37b8('0xb')](_0x220cd2,_0x45e094)['then'](function(_0x548dfd){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x5eb540,_0x37b8('0xc'));logger[_0x37b8('0xd')](_0x37b8('0xe'),_0x5eb540,_0x37b8('0xc'),JSON[_0x37b8('0xf')](_0x548dfd));if(_0x548dfd['error']){if(_0x548dfd[_0x37b8('0x10')]['code']===0x1f4){logger[_0x37b8('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x5eb540,_0x548dfd[_0x37b8('0x10')][_0x37b8('0x11')]);return _0x50f729(_0x548dfd[_0x37b8('0x10')][_0x37b8('0x11')]);}logger[_0x37b8('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x5eb540,_0x548dfd['error'][_0x37b8('0x11')]);return _0xc3ab5b(_0x548dfd[_0x37b8('0x10')][_0x37b8('0x11')]);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x5eb540,_0x37b8('0xc'));_0xc3ab5b(_0x548dfd[_0x37b8('0x12')][_0x37b8('0x11')]);}})[_0x37b8('0x13')](function(_0x290068){logger[_0x37b8('0x10')](_0x37b8('0x14'),_0x5eb540,_0x290068);_0x50f729(_0x290068);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index d6153d8..92dd2f7 100644 --- a/server/api/sound/index.js +++ b/server/api/sound/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35b0=['post','file','put','/:id','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/download','diskStorage','join','root','server/files/sounds/original/','originalname','%s-%s%s','basename','extname','now'];(function(_0xd2bea6,_0x1f1d4a){var _0x1d2439=function(_0x51f3f2){while(--_0x51f3f2){_0xd2bea6['push'](_0xd2bea6['shift']());}};_0x1d2439(++_0x1f1d4a);}(_0x35b0,0xcb));var _0x035b=function(_0x4b1685,_0x570158){_0x4b1685=_0x4b1685-0x0;var _0x447511=_0x35b0[_0x4b1685];return _0x447511;};'use strict';var multer=require(_0x035b('0x0'));var util=require('util');var path=require(_0x035b('0x1'));var timeout=require(_0x035b('0x2'));var express=require(_0x035b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x035b('0x4'));var interaction=require(_0x035b('0x5'));var config=require(_0x035b('0x6'));var controller=require('./sound.controller');router[_0x035b('0x7')]('/',auth[_0x035b('0x8')](),controller[_0x035b('0x9')]);router['get']('/:id',auth[_0x035b('0x8')](),controller[_0x035b('0xa')]);router['get'](_0x035b('0xb'),auth[_0x035b('0x8')](),controller['download']);var upload=multer({'storage':multer[_0x035b('0xc')]({'destination':function(_0x2311a8,_0x2e63bf,_0x4bec50){_0x4bec50(null,path[_0x035b('0xd')](config[_0x035b('0xe')],_0x035b('0xf')));},'filename':function(_0x5ba847,_0x60c0fa,_0x175b92){_0x60c0fa[_0x035b('0x10')]=_0x60c0fa[_0x035b('0x10')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x175b92(null,util['format'](_0x035b('0x11'),path[_0x035b('0x12')](_0x60c0fa[_0x035b('0x10')],path[_0x035b('0x13')](_0x60c0fa['originalname'])),Date[_0x035b('0x14')](),path[_0x035b('0x13')](_0x60c0fa[_0x035b('0x10')])));}})});router[_0x035b('0x15')]('/',upload['single'](_0x035b('0x16')),controller['create']);router[_0x035b('0x17')](_0x035b('0x18'),auth['isAuthenticated'](),controller[_0x035b('0x19')]);router[_0x035b('0x1a')]('/:id',auth[_0x035b('0x8')](),controller[_0x035b('0x1a')]);module[_0x035b('0x1b')]=router; \ No newline at end of file +var _0xef34=['isAuthenticated','index','/:id','show','download','diskStorage','join','root','server/files/sounds/original/','originalname','format','basename','extname','now','post','single','create','update','delete','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','get'];(function(_0x5f49bc,_0x548555){var _0x44bbb9=function(_0x5e2caf){while(--_0x5e2caf){_0x5f49bc['push'](_0x5f49bc['shift']());}};_0x44bbb9(++_0x548555);}(_0xef34,0x88));var _0x4ef3=function(_0x30ff8d,_0x5307af){_0x30ff8d=_0x30ff8d-0x0;var _0x5d5df6=_0xef34[_0x30ff8d];return _0x5d5df6;};'use strict';var multer=require(_0x4ef3('0x0'));var util=require('util');var path=require(_0x4ef3('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ef3('0x2'));var router=express[_0x4ef3('0x3')]();var fs_extra=require(_0x4ef3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4ef3('0x5'));var config=require(_0x4ef3('0x6'));var controller=require(_0x4ef3('0x7'));router[_0x4ef3('0x8')]('/',auth[_0x4ef3('0x9')](),controller[_0x4ef3('0xa')]);router[_0x4ef3('0x8')](_0x4ef3('0xb'),auth[_0x4ef3('0x9')](),controller[_0x4ef3('0xc')]);router[_0x4ef3('0x8')]('/:id/download',auth[_0x4ef3('0x9')](),controller[_0x4ef3('0xd')]);var upload=multer({'storage':multer[_0x4ef3('0xe')]({'destination':function(_0x4bdc8d,_0x5109b6,_0x550066){_0x550066(null,path[_0x4ef3('0xf')](config[_0x4ef3('0x10')],_0x4ef3('0x11')));},'filename':function(_0xb63f96,_0x586bfd,_0x22f5b6){_0x586bfd[_0x4ef3('0x12')]=_0x586bfd[_0x4ef3('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x22f5b6(null,util[_0x4ef3('0x13')]('%s-%s%s',path[_0x4ef3('0x14')](_0x586bfd[_0x4ef3('0x12')],path[_0x4ef3('0x15')](_0x586bfd[_0x4ef3('0x12')])),Date[_0x4ef3('0x16')](),path[_0x4ef3('0x15')](_0x586bfd['originalname'])));}})});router[_0x4ef3('0x17')]('/',upload[_0x4ef3('0x18')]('file'),controller[_0x4ef3('0x19')]);router['put'](_0x4ef3('0xb'),auth[_0x4ef3('0x9')](),controller[_0x4ef3('0x1a')]);router['delete'](_0x4ef3('0xb'),auth[_0x4ef3('0x9')](),controller[_0x4ef3('0x1b')]);module[_0x4ef3('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 4e18992..3c6d8dd 100644 --- a/server/api/sound/sound.attributes.js +++ b/server/api/sound/sound.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x435b=['INTEGER','sequelize','exports','STRING','name','FLOAT','BIGINT'];(function(_0x302771,_0x336b33){var _0x30a9e1=function(_0x114ba5){while(--_0x114ba5){_0x302771['push'](_0x302771['shift']());}};_0x30a9e1(++_0x336b33);}(_0x435b,0x174));var _0xb435=function(_0x1c7f2b,_0x303af2){_0x1c7f2b=_0x1c7f2b-0x0;var _0x5e6e19=_0x435b[_0x1c7f2b];return _0x5e6e19;};'use strict';var Sequelize=require(_0xb435('0x0'));module[_0xb435('0x1')]={'name':{'type':Sequelize[_0xb435('0x2')],'unique':_0xb435('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xb435('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xb435('0x2')]},'original_format':{'type':Sequelize[_0xb435('0x2')]},'original_duration':{'type':Sequelize[_0xb435('0x4')]},'original_sampleCount':{'type':Sequelize[_0xb435('0x5')]},'original_channelCount':{'type':Sequelize[_0xb435('0x6')]},'original_bitRate':{'type':Sequelize[_0xb435('0x5')]},'original_sampleRate':{'type':Sequelize[_0xb435('0x6')]},'converted_format':{'type':Sequelize[_0xb435('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xb435('0x5')]},'converted_channelCount':{'type':Sequelize[_0xb435('0x6')]},'converted_bitRate':{'type':Sequelize[_0xb435('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xb435('0x6')]}}; \ No newline at end of file +var _0x568a=['BIGINT','INTEGER','sequelize','STRING','FLOAT'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x568a,0x1c9));var _0xa568=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x568a[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xa568('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xa568('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xa568('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xa568('0x2')]},'original_sampleCount':{'type':Sequelize[_0xa568('0x3')]},'original_channelCount':{'type':Sequelize[_0xa568('0x4')]},'original_bitRate':{'type':Sequelize[_0xa568('0x3')]},'original_sampleRate':{'type':Sequelize[_0xa568('0x4')]},'converted_format':{'type':Sequelize[_0xa568('0x1')]},'converted_duration':{'type':Sequelize[_0xa568('0x2')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xa568('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xa568('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index b464aba..1ac9992 100644 --- a/server/api/sound/sound.controller.js +++ b/server/api/sound/sound.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa94c=['where','merge','options','includeAll','include','show','find','catch','download','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','chmodSync','transcode','error','unlinkSync','src','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','duration','converted_sampleCount','converted_bitRate','converted_sampleRate','role','userProfileId','user','UserProfileSection','autoAssociation','start','body','description','delete','original_format','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Sounds','sendStatus','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0xa94c,0xb7));var _0xca94=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa94c[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require(_0xca94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xca94('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca94('0x2'));var moment=require(_0xca94('0x3'));var BPromise=require(_0xca94('0x4'));var Mustache=require(_0xca94('0x5'));var util=require('util');var path=require(_0xca94('0x6'));var sox=require(_0xca94('0x7'));var csv=require(_0xca94('0x8'));var ejs=require(_0xca94('0x9'));var fs=require('fs');var fs_extra=require(_0xca94('0xa'));var _=require(_0xca94('0xb'));var squel=require(_0xca94('0xc'));var crypto=require(_0xca94('0xd'));var jsforce=require(_0xca94('0xe'));var deskjs=require(_0xca94('0xf'));var toCsv=require('to-csv');var querystring=require(_0xca94('0x10'));var Papa=require(_0xca94('0x11'));var Redis=require(_0xca94('0x12'));var authService=require(_0xca94('0x13'));var qs=require(_0xca94('0x14'));var as=require(_0xca94('0x15'));var hardwareService=require(_0xca94('0x16'));var logger=require(_0xca94('0x17'))('api');var utils=require(_0xca94('0x18'));var config=require(_0xca94('0x19'));var licenseUtil=require(_0xca94('0x1a'));var db=require(_0xca94('0x1b'))['db'];function respondWithStatusCode(_0x723a92,_0x3cbf01){_0x3cbf01=_0x3cbf01||0xcc;return function(_0x657d13){if(_0x657d13){return _0x723a92['sendStatus'](_0x3cbf01);}return _0x723a92[_0xca94('0x1c')](_0x3cbf01)[_0xca94('0x1d')]();};}function respondWithResult(_0x1c8af2,_0xd94984){_0xd94984=_0xd94984||0xc8;return function(_0x69a239){if(_0x69a239){return _0x1c8af2[_0xca94('0x1c')](_0xd94984)[_0xca94('0x1e')](_0x69a239);}};}function respondWithFilteredResult(_0x2966a8,_0x3ee368){return function(_0xf0a33c){if(_0xf0a33c){var _0x1c7f26=typeof _0x3ee368[_0xca94('0x1f')]===_0xca94('0x20')&&typeof _0x3ee368[_0xca94('0x21')]===_0xca94('0x20');var _0x1e69cc=_0xf0a33c[_0xca94('0x22')];var _0x1179f3=_0x1c7f26?0x0:_0x3ee368[_0xca94('0x1f')];var _0x1244c1=_0x1c7f26?_0xf0a33c['count']:_0x3ee368['offset']+_0x3ee368[_0xca94('0x21')];var _0x2c941b;if(_0x1244c1>=_0x1e69cc){_0x1244c1=_0x1e69cc;_0x2c941b=0xc8;}else{_0x2c941b=0xce;}_0x2966a8[_0xca94('0x1c')](_0x2c941b);return _0x2966a8[_0xca94('0x23')](_0xca94('0x24'),_0x1179f3+'-'+_0x1244c1+'/'+_0x1e69cc)[_0xca94('0x1e')](_0xf0a33c);}return null;};}function patchUpdates(_0x4d9ab2){return function(_0x12b025){try{jsonpatch[_0xca94('0x25')](_0x12b025,_0x4d9ab2,!![]);}catch(_0x57c6e4){return BPromise[_0xca94('0x26')](_0x57c6e4);}return _0x12b025[_0xca94('0x27')]();};}function saveUpdates(_0x5539a4,_0x33b25c){return function(_0x63fc37){if(_0x63fc37){return _0x63fc37[_0xca94('0x28')](_0x5539a4)['then'](function(_0x310e7f){return _0x310e7f;});}return null;};}function removeEntity(_0x292122,_0x490212){return function(_0x1df379){if(_0x1df379){return _0x1df379[_0xca94('0x29')]()[_0xca94('0x2a')](function(){var _0x25f8ce=_0x1df379[_0xca94('0x2b')]({'plain':!![]});var _0x263d17=_0xca94('0x2c');return db['UserProfileResource'][_0xca94('0x29')]({'where':{'type':_0x263d17,'resourceId':_0x25f8ce['id']}})[_0xca94('0x2a')](function(){return _0x1df379;});})[_0xca94('0x2a')](function(){_0x292122[_0xca94('0x1c')](0xcc)[_0xca94('0x1d')]();});}};}function handleEntityNotFound(_0x5220f6,_0x1250e5){return function(_0x1be50b){if(!_0x1be50b){_0x5220f6[_0xca94('0x2d')](0x194);}return _0x1be50b;};}function handleError(_0x18c4b4,_0x4a2a20){_0x4a2a20=_0x4a2a20||0x1f4;return function(_0x2f5e57){logger['error'](_0x2f5e57[_0xca94('0x2e')]);if(_0x2f5e57[_0xca94('0x2f')]){delete _0x2f5e57[_0xca94('0x2f')];}_0x18c4b4[_0xca94('0x1c')](_0x4a2a20)[_0xca94('0x30')](_0x2f5e57);};}exports[_0xca94('0x31')]=function(_0x15a8d9,_0x1598c0){var _0x4ba19f={},_0x168f5d={},_0x9b8deb={'count':0x0,'rows':[]};var _0x380709=_[_0xca94('0x32')](db[_0xca94('0x33')][_0xca94('0x34')],function(_0x28350f){return{'name':_0x28350f[_0xca94('0x35')],'type':_0x28350f[_0xca94('0x36')]['key']};});_0x168f5d[_0xca94('0x37')]=_['map'](_0x380709,_0xca94('0x2f'));_0x168f5d[_0xca94('0x38')]=_[_0xca94('0x39')](_0x15a8d9[_0xca94('0x38')]);_0x168f5d['filters']=_[_0xca94('0x3a')](_0x168f5d[_0xca94('0x37')],_0x168f5d[_0xca94('0x38')]);_0x4ba19f[_0xca94('0x3b')]=_[_0xca94('0x3a')](_0x168f5d[_0xca94('0x37')],qs['fields'](_0x15a8d9['query'][_0xca94('0x3c')]));_0x4ba19f[_0xca94('0x3b')]=_0x4ba19f[_0xca94('0x3b')][_0xca94('0x3d')]?_0x4ba19f[_0xca94('0x3b')]:_0x168f5d['model'];if(!_0x15a8d9['query'][_0xca94('0x3e')](_0xca94('0x3f'))){_0x4ba19f[_0xca94('0x21')]=qs[_0xca94('0x21')](_0x15a8d9[_0xca94('0x38')][_0xca94('0x21')]);_0x4ba19f[_0xca94('0x1f')]=qs[_0xca94('0x1f')](_0x15a8d9[_0xca94('0x38')][_0xca94('0x1f')]);}_0x4ba19f[_0xca94('0x40')]=qs[_0xca94('0x41')](_0x15a8d9[_0xca94('0x38')]['sort']);_0x4ba19f['where']=qs[_0xca94('0x42')](_[_0xca94('0x43')](_0x15a8d9['query'],_0x168f5d[_0xca94('0x42')]),_0x380709);if(_0x15a8d9['query'][_0xca94('0x44')]){_0x4ba19f[_0xca94('0x45')]=_[_0xca94('0x46')](_0x4ba19f['where'],{'$or':_[_0xca94('0x32')](_0x380709,function(_0x23c13d){if(_0x23c13d[_0xca94('0x36')]!=='VIRTUAL'){var _0xcb1b51={};_0xcb1b51[_0x23c13d[_0xca94('0x2f')]]={'$like':'%'+_0x15a8d9[_0xca94('0x38')]['filter']+'%'};return _0xcb1b51;}})});}_0x4ba19f=_[_0xca94('0x46')]({},_0x4ba19f,_0x15a8d9[_0xca94('0x47')]);var _0x24e772={'where':_0x4ba19f['where']};return db[_0xca94('0x33')][_0xca94('0x22')](_0x24e772)[_0xca94('0x2a')](function(_0x32064b){_0x9b8deb[_0xca94('0x22')]=_0x32064b;if(_0x15a8d9[_0xca94('0x38')][_0xca94('0x48')]){_0x4ba19f[_0xca94('0x49')]=[{'all':!![]}];}return db[_0xca94('0x33')]['findAll'](_0x4ba19f);})[_0xca94('0x2a')](function(_0x5d9cc4){_0x9b8deb['rows']=_0x5d9cc4;return _0x9b8deb;})[_0xca94('0x2a')](respondWithFilteredResult(_0x1598c0,_0x4ba19f))['catch'](handleError(_0x1598c0,null));};exports[_0xca94('0x4a')]=function(_0x278c2a,_0x5daf02){var _0x309875={'raw':!![],'where':{'id':_0x278c2a['params']['id']}},_0x1e0b67={};_0x1e0b67['model']=_[_0xca94('0x39')](db[_0xca94('0x33')][_0xca94('0x34')]);_0x1e0b67[_0xca94('0x38')]=_[_0xca94('0x39')](_0x278c2a['query']);_0x1e0b67[_0xca94('0x42')]=_[_0xca94('0x3a')](_0x1e0b67[_0xca94('0x37')],_0x1e0b67[_0xca94('0x38')]);_0x309875['attributes']=_[_0xca94('0x3a')](_0x1e0b67['model'],qs[_0xca94('0x3c')](_0x278c2a[_0xca94('0x38')][_0xca94('0x3c')]));_0x309875[_0xca94('0x3b')]=_0x309875[_0xca94('0x3b')][_0xca94('0x3d')]?_0x309875[_0xca94('0x3b')]:_0x1e0b67[_0xca94('0x37')];if(_0x278c2a['query'][_0xca94('0x48')]){_0x309875[_0xca94('0x49')]=[{'all':!![]}];}_0x309875=_[_0xca94('0x46')]({},_0x309875,_0x278c2a['options']);return db[_0xca94('0x33')][_0xca94('0x4b')](_0x309875)[_0xca94('0x2a')](handleEntityNotFound(_0x5daf02,null))[_0xca94('0x2a')](respondWithResult(_0x5daf02,null))[_0xca94('0x4c')](handleError(_0x5daf02,null));};exports[_0xca94('0x4d')]=function(_0x3633af,_0x219cd1,_0x3a4c72){return db[_0xca94('0x33')][_0xca94('0x4b')]({'where':{'id':_0x3633af['params']['id']},'attributes':['name',_0xca94('0x4e'),_0xca94('0x4f')],'raw':!![]})[_0xca94('0x2a')](handleEntityNotFound(_0x219cd1,null))[_0xca94('0x2a')](function(_0x4f9b02){if(_0x4f9b02){if(!fs[_0xca94('0x50')](path[_0xca94('0x51')](config[_0xca94('0x52')],'server/files/sounds/converted',_0x4f9b02[_0xca94('0x4e')]+'.'+_0x4f9b02[_0xca94('0x4f')]))){throw new db[(_0xca94('0x53'))][(_0xca94('0x54'))](_0xca94('0x55'));}return _0x219cd1[_0xca94('0x4d')](path[_0xca94('0x51')](config[_0xca94('0x52')],_0xca94('0x56'),util[_0xca94('0x57')](_0xca94('0x58'),_0x4f9b02[_0xca94('0x4e')],_0x4f9b02[_0xca94('0x4f')])),util['format'](_0xca94('0x58'),_0x4f9b02['name'],_0x4f9b02[_0xca94('0x4f')]));}return null;})[_0xca94('0x4c')](handleError(_0x219cd1,null));};exports[_0xca94('0x59')]=function(_0x5494f9,_0x4dc73e,_0x3f1631){var _0x2322d0={'name':path[_0xca94('0x5a')](_0x5494f9[_0xca94('0x5b')][_0xca94('0x5c')],path[_0xca94('0x5d')](_0x5494f9[_0xca94('0x5b')][_0xca94('0x5c')])),'save_name':path[_0xca94('0x5a')](_0x5494f9[_0xca94('0x5b')][_0xca94('0x5e')],path[_0xca94('0x5d')](_0x5494f9[_0xca94('0x5b')][_0xca94('0x5e')])),'original_format':path[_0xca94('0x5d')](_0x5494f9[_0xca94('0x5b')][_0xca94('0x5c')])[_0xca94('0x5f')](0x1),'converted_format':_0xca94('0x60')};var _0x56077d=path[_0xca94('0x51')](config[_0xca94('0x52')],_0xca94('0x61'),_0x5494f9[_0xca94('0x5b')]['filename']);var _0x3b14f2=path['join'](config['root'],_0xca94('0x56'),util[_0xca94('0x57')](_0xca94('0x58'),path[_0xca94('0x5a')](_0x5494f9[_0xca94('0x5b')]['filename'],path[_0xca94('0x5d')](_0x5494f9[_0xca94('0x5b')]['filename'])),_0x2322d0[_0xca94('0x4f')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x56077d);logger[_0xca94('0x62')]('Sound\x20upload\x20destination:\x20%s',_0x3b14f2);try{fs[_0xca94('0x63')](_0x56077d,parseInt('0777',0x8));var _0xf08929=sox[_0xca94('0x64')](_0x56077d,_0x3b14f2,{'sampleRate':0x1f40,'format':_0xca94('0x60'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xf08929['on'](_0xca94('0x65'),function(_0x314131){fs[_0xca94('0x66')](_0x56077d);_0x4dc73e[_0xca94('0x1c')](0x1f4)[_0xca94('0x30')](_0x314131);});_0xf08929['on'](_0xca94('0x67'),function(_0x572a58){_0x2322d0['original_duration']=isNaN(_0x572a58['duration'])?null:_0x572a58['duration']*0x3e8;_0x2322d0[_0xca94('0x68')]=isNaN(_0x572a58[_0xca94('0x69')])?null:_0x572a58[_0xca94('0x69')];_0x2322d0[_0xca94('0x6a')]=isNaN(_0x572a58[_0xca94('0x6b')])?null:_0x572a58['channelCount'];_0x2322d0[_0xca94('0x6c')]=isNaN(_0x572a58[_0xca94('0x6d')])?null:_0x572a58[_0xca94('0x6d')];_0x2322d0[_0xca94('0x6e')]=isNaN(_0x572a58[_0xca94('0x6f')])?null:_0x572a58[_0xca94('0x6f')];});_0xf08929['on']('dest',function(_0x24e227){_0x2322d0['converted_duration']=isNaN(_0x24e227['duration'])?null:_0x24e227[_0xca94('0x70')]*0x3e8;_0x2322d0[_0xca94('0x71')]=isNaN(_0x24e227[_0xca94('0x69')])?null:_0x24e227[_0xca94('0x69')];_0x2322d0['converted_channelCount']=isNaN(_0x24e227[_0xca94('0x6b')])?null:_0x24e227[_0xca94('0x6b')];_0x2322d0[_0xca94('0x72')]=isNaN(_0x24e227['bitRate'])?null:_0x24e227['bitRate'];_0x2322d0[_0xca94('0x73')]=isNaN(_0x24e227[_0xca94('0x6f')])?null:_0x24e227[_0xca94('0x6f')];});_0xf08929['on'](_0xca94('0x1d'),function(){fs[_0xca94('0x63')](_0x3b14f2,parseInt('0777',0x8));return db[_0xca94('0x33')][_0xca94('0x59')](_0x2322d0)[_0xca94('0x2a')](function(_0x26f38b){var _0x5c095e={'role':_0x5494f9['body'][_0xca94('0x74')],'userProfileId':_0x5494f9['body'][_0xca94('0x75')]};if(!_0x5c095e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c095e[_0xca94('0x74')]===_0xca94('0x76')){var _0x3db9fd=_0x26f38b[_0xca94('0x2b')]({'plain':!![]});return db[_0xca94('0x77')][_0xca94('0x4b')]({'where':{'name':_0xca94('0x2c'),'userProfileId':_0x5c095e[_0xca94('0x75')]},'raw':!![]})[_0xca94('0x2a')](function(_0x2a0f97){if(_0x2a0f97&&_0x2a0f97[_0xca94('0x78')]===0x0){return db['UserProfileResource'][_0xca94('0x59')]({'name':_0x3db9fd[_0xca94('0x2f')],'resourceId':_0x3db9fd['id'],'type':_0x2a0f97['name'],'sectionId':_0x2a0f97['id']},{})[_0xca94('0x2a')](function(){return _0x26f38b;});}else{return _0x26f38b;}})[_0xca94('0x4c')](function(_0x63be7a){logger[_0xca94('0x65')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x63be7a);throw _0x63be7a;});}return _0x26f38b;})['then'](respondWithResult(_0x4dc73e,null))[_0xca94('0x4c')](handleError(_0x4dc73e,null));});_0xf08929[_0xca94('0x79')]();}catch(_0x5b4e30){_0x4dc73e[_0xca94('0x1c')](0x1f4)[_0xca94('0x30')](_0x5b4e30);}};exports['update']=function(_0x1f04f2,_0x4be668,_0x597a80){return db[_0xca94('0x33')][_0xca94('0x4b')]({'where':{'id':_0x1f04f2['params']['id']}})['then'](handleEntityNotFound(_0x4be668,null))['then'](saveUpdates(_[_0xca94('0x43')](_0x1f04f2[_0xca94('0x7a')],[_0xca94('0x2f'),_0xca94('0x7b')]),null))[_0xca94('0x2a')](respondWithResult(_0x4be668,null))['catch'](handleError(_0x4be668,null));};exports[_0xca94('0x7c')]=function(_0x3f6f7e,_0x346bdf,_0xbc0986){return db['Sound'][_0xca94('0x4b')]({'where':{'id':_0x3f6f7e['params']['id']}})[_0xca94('0x2a')](function(_0x23995e){if(_0x23995e){return _0x23995e[_0xca94('0x29')]();}})[_0xca94('0x2a')](function(_0x369585){var _0x23a104=path[_0xca94('0x51')](config[_0xca94('0x52')],_0xca94('0x61'),util[_0xca94('0x57')](_0xca94('0x58'),_0x369585[_0xca94('0x4e')],_0x369585[_0xca94('0x7d')]));var _0x37f18e=path[_0xca94('0x51')](config[_0xca94('0x52')],_0xca94('0x56'),util[_0xca94('0x57')](_0xca94('0x58'),_0x369585[_0xca94('0x4e')],_0x369585[_0xca94('0x4f')]));fs[_0xca94('0x66')](_0x23a104);fs['unlinkSync'](_0x37f18e);return _0x369585;})[_0xca94('0x2a')](function(_0xc5a105){if(_0xc5a105){return _0x346bdf[_0xca94('0x1c')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x346bdf,null))[_0xca94('0x4c')](handleError(_0x346bdf,null));}; \ No newline at end of file +var _0x5401=['rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','format','%s.%s','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_sampleRate','create','body','userProfileId','role','user','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','update','destroy','then','Sounds','error','stack','name','send','Sound'];(function(_0x356771,_0x3f33dc){var _0x1aa5bd=function(_0x5eaf5f){while(--_0x5eaf5f){_0x356771['push'](_0x356771['shift']());}};_0x1aa5bd(++_0x3f33dc);}(_0x5401,0x140));var _0x1540=function(_0x81fe53,_0x5b8f05){_0x81fe53=_0x81fe53-0x0;var _0x56f7a7=_0x5401[_0x81fe53];return _0x56f7a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1540('0x0'));var zipdir=require(_0x1540('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1540('0x2'));var BPromise=require(_0x1540('0x3'));var Mustache=require(_0x1540('0x4'));var util=require('util');var path=require(_0x1540('0x5'));var sox=require('sox');var csv=require(_0x1540('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1540('0x7'));var _=require('lodash');var squel=require(_0x1540('0x8'));var crypto=require(_0x1540('0x9'));var jsforce=require(_0x1540('0xa'));var deskjs=require(_0x1540('0xb'));var toCsv=require(_0x1540('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1540('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x1540('0xd'));var hardwareService=require(_0x1540('0xe'));var logger=require('../../config/logger')(_0x1540('0xf'));var utils=require(_0x1540('0x10'));var config=require(_0x1540('0x11'));var licenseUtil=require(_0x1540('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ff076,_0x17789e){_0x17789e=_0x17789e||0xcc;return function(_0x2ac21e){if(_0x2ac21e){return _0x4ff076[_0x1540('0x13')](_0x17789e);}return _0x4ff076['status'](_0x17789e)[_0x1540('0x14')]();};}function respondWithResult(_0x16b31f,_0x1e41cc){_0x1e41cc=_0x1e41cc||0xc8;return function(_0x4042d1){if(_0x4042d1){return _0x16b31f['status'](_0x1e41cc)[_0x1540('0x15')](_0x4042d1);}};}function respondWithFilteredResult(_0x223c82,_0x4af0ea){return function(_0x170ec8){if(_0x170ec8){var _0xedf322=typeof _0x4af0ea[_0x1540('0x16')]==='undefined'&&typeof _0x4af0ea['limit']===_0x1540('0x17');var _0x3ba0d4=_0x170ec8[_0x1540('0x18')];var _0x200191=_0xedf322?0x0:_0x4af0ea[_0x1540('0x16')];var _0x4baef9=_0xedf322?_0x170ec8['count']:_0x4af0ea[_0x1540('0x16')]+_0x4af0ea[_0x1540('0x19')];var _0x1deb1e;if(_0x4baef9>=_0x3ba0d4){_0x4baef9=_0x3ba0d4;_0x1deb1e=0xc8;}else{_0x1deb1e=0xce;}_0x223c82[_0x1540('0x1a')](_0x1deb1e);return _0x223c82[_0x1540('0x1b')](_0x1540('0x1c'),_0x200191+'-'+_0x4baef9+'/'+_0x3ba0d4)[_0x1540('0x15')](_0x170ec8);}return null;};}function patchUpdates(_0x450449){return function(_0x509dad){try{jsonpatch[_0x1540('0x1d')](_0x509dad,_0x450449,!![]);}catch(_0x5a62c4){return BPromise[_0x1540('0x1e')](_0x5a62c4);}return _0x509dad['save']();};}function saveUpdates(_0x6899ae,_0x55eaaf){return function(_0x11b60d){if(_0x11b60d){return _0x11b60d[_0x1540('0x1f')](_0x6899ae)['then'](function(_0x4fd5ce){return _0x4fd5ce;});}return null;};}function removeEntity(_0x47d02b,_0x1bbac1){return function(_0x7fa1a7){if(_0x7fa1a7){return _0x7fa1a7[_0x1540('0x20')]()[_0x1540('0x21')](function(){var _0x494c8f=_0x7fa1a7['get']({'plain':!![]});var _0x21ca23=_0x1540('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x21ca23,'resourceId':_0x494c8f['id']}})[_0x1540('0x21')](function(){return _0x7fa1a7;});})['then'](function(){_0x47d02b[_0x1540('0x1a')](0xcc)[_0x1540('0x14')]();});}};}function handleEntityNotFound(_0x326cce,_0x1c68ef){return function(_0x4df3c1){if(!_0x4df3c1){_0x326cce[_0x1540('0x13')](0x194);}return _0x4df3c1;};}function handleError(_0x899361,_0x40cca8){_0x40cca8=_0x40cca8||0x1f4;return function(_0x1d9521){logger[_0x1540('0x23')](_0x1d9521[_0x1540('0x24')]);if(_0x1d9521['name']){delete _0x1d9521[_0x1540('0x25')];}_0x899361['status'](_0x40cca8)[_0x1540('0x26')](_0x1d9521);};}exports['index']=function(_0x2f8738,_0x55331f){var _0x125c6d={},_0x4ac96f={},_0xcb89e5={'count':0x0,'rows':[]};var _0x61ef2f=_['map'](db[_0x1540('0x27')][_0x1540('0x28')],function(_0x53c2f2){return{'name':_0x53c2f2[_0x1540('0x29')],'type':_0x53c2f2[_0x1540('0x2a')][_0x1540('0x2b')]};});_0x4ac96f[_0x1540('0x2c')]=_[_0x1540('0x2d')](_0x61ef2f,_0x1540('0x25'));_0x4ac96f['query']=_['keys'](_0x2f8738[_0x1540('0x2e')]);_0x4ac96f[_0x1540('0x2f')]=_[_0x1540('0x30')](_0x4ac96f[_0x1540('0x2c')],_0x4ac96f[_0x1540('0x2e')]);_0x125c6d[_0x1540('0x31')]=_[_0x1540('0x30')](_0x4ac96f[_0x1540('0x2c')],qs[_0x1540('0x32')](_0x2f8738[_0x1540('0x2e')][_0x1540('0x32')]));_0x125c6d[_0x1540('0x31')]=_0x125c6d[_0x1540('0x31')][_0x1540('0x33')]?_0x125c6d['attributes']:_0x4ac96f[_0x1540('0x2c')];if(!_0x2f8738[_0x1540('0x2e')]['hasOwnProperty'](_0x1540('0x34'))){_0x125c6d['limit']=qs['limit'](_0x2f8738['query'][_0x1540('0x19')]);_0x125c6d[_0x1540('0x16')]=qs[_0x1540('0x16')](_0x2f8738[_0x1540('0x2e')]['offset']);}_0x125c6d[_0x1540('0x35')]=qs[_0x1540('0x36')](_0x2f8738['query'][_0x1540('0x36')]);_0x125c6d[_0x1540('0x37')]=qs[_0x1540('0x2f')](_[_0x1540('0x38')](_0x2f8738[_0x1540('0x2e')],_0x4ac96f[_0x1540('0x2f')]),_0x61ef2f);if(_0x2f8738['query'][_0x1540('0x39')]){_0x125c6d[_0x1540('0x37')]=_[_0x1540('0x3a')](_0x125c6d['where'],{'$or':_[_0x1540('0x2d')](_0x61ef2f,function(_0x38de29){if(_0x38de29['type']!=='VIRTUAL'){var _0x271c13={};_0x271c13[_0x38de29[_0x1540('0x25')]]={'$like':'%'+_0x2f8738[_0x1540('0x2e')][_0x1540('0x39')]+'%'};return _0x271c13;}})});}_0x125c6d=_[_0x1540('0x3a')]({},_0x125c6d,_0x2f8738[_0x1540('0x3b')]);var _0x3f9869={'where':_0x125c6d['where']};return db[_0x1540('0x27')][_0x1540('0x18')](_0x3f9869)[_0x1540('0x21')](function(_0x17d115){_0xcb89e5[_0x1540('0x18')]=_0x17d115;if(_0x2f8738[_0x1540('0x2e')][_0x1540('0x3c')]){_0x125c6d['include']=[{'all':!![]}];}return db[_0x1540('0x27')][_0x1540('0x3d')](_0x125c6d);})[_0x1540('0x21')](function(_0x842ded){_0xcb89e5[_0x1540('0x3e')]=_0x842ded;return _0xcb89e5;})[_0x1540('0x21')](respondWithFilteredResult(_0x55331f,_0x125c6d))[_0x1540('0x3f')](handleError(_0x55331f,null));};exports[_0x1540('0x40')]=function(_0x439ef2,_0x434394){var _0x5c7eb4={'raw':!![],'where':{'id':_0x439ef2[_0x1540('0x41')]['id']}},_0x120d0e={};_0x120d0e[_0x1540('0x2c')]=_[_0x1540('0x42')](db[_0x1540('0x27')][_0x1540('0x28')]);_0x120d0e['query']=_[_0x1540('0x42')](_0x439ef2[_0x1540('0x2e')]);_0x120d0e[_0x1540('0x2f')]=_[_0x1540('0x30')](_0x120d0e['model'],_0x120d0e[_0x1540('0x2e')]);_0x5c7eb4[_0x1540('0x31')]=_['intersection'](_0x120d0e[_0x1540('0x2c')],qs[_0x1540('0x32')](_0x439ef2['query']['fields']));_0x5c7eb4[_0x1540('0x31')]=_0x5c7eb4[_0x1540('0x31')]['length']?_0x5c7eb4[_0x1540('0x31')]:_0x120d0e[_0x1540('0x2c')];if(_0x439ef2[_0x1540('0x2e')]['includeAll']){_0x5c7eb4[_0x1540('0x43')]=[{'all':!![]}];}_0x5c7eb4=_[_0x1540('0x3a')]({},_0x5c7eb4,_0x439ef2[_0x1540('0x3b')]);return db['Sound'][_0x1540('0x44')](_0x5c7eb4)[_0x1540('0x21')](handleEntityNotFound(_0x434394,null))[_0x1540('0x21')](respondWithResult(_0x434394,null))[_0x1540('0x3f')](handleError(_0x434394,null));};exports[_0x1540('0x45')]=function(_0x266ba2,_0x95c1f1,_0x1ca634){return db[_0x1540('0x27')]['find']({'where':{'id':_0x266ba2[_0x1540('0x41')]['id']},'attributes':[_0x1540('0x25'),_0x1540('0x46'),_0x1540('0x47')],'raw':!![]})[_0x1540('0x21')](handleEntityNotFound(_0x95c1f1,null))[_0x1540('0x21')](function(_0x3762ee){if(_0x3762ee){if(!fs[_0x1540('0x48')](path[_0x1540('0x49')](config[_0x1540('0x4a')],_0x1540('0x4b'),_0x3762ee[_0x1540('0x46')]+'.'+_0x3762ee[_0x1540('0x47')]))){throw new db[(_0x1540('0x4c'))]['ValidationError'](_0x1540('0x4d'));}return _0x95c1f1['download'](path[_0x1540('0x49')](config[_0x1540('0x4a')],_0x1540('0x4b'),util[_0x1540('0x4e')]('%s.%s',_0x3762ee[_0x1540('0x46')],_0x3762ee[_0x1540('0x47')])),util[_0x1540('0x4e')](_0x1540('0x4f'),_0x3762ee[_0x1540('0x25')],_0x3762ee[_0x1540('0x47')]));}return null;})[_0x1540('0x3f')](handleError(_0x95c1f1,null));};exports['create']=function(_0x34c988,_0x1017b1,_0x5b4bfd){var _0x4a16da={'name':path[_0x1540('0x50')](_0x34c988[_0x1540('0x51')][_0x1540('0x52')],path[_0x1540('0x53')](_0x34c988['file'][_0x1540('0x52')])),'save_name':path[_0x1540('0x50')](_0x34c988[_0x1540('0x51')]['filename'],path['extname'](_0x34c988[_0x1540('0x51')][_0x1540('0x54')])),'original_format':path[_0x1540('0x53')](_0x34c988[_0x1540('0x51')][_0x1540('0x52')])[_0x1540('0x55')](0x1),'converted_format':_0x1540('0x56')};var _0x326d02=path[_0x1540('0x49')](config['root'],_0x1540('0x57'),_0x34c988[_0x1540('0x51')]['filename']);var _0x24504d=path['join'](config[_0x1540('0x4a')],'server/files/sounds/converted',util[_0x1540('0x4e')](_0x1540('0x4f'),path[_0x1540('0x50')](_0x34c988['file'][_0x1540('0x54')],path[_0x1540('0x53')](_0x34c988[_0x1540('0x51')][_0x1540('0x54')])),_0x4a16da['converted_format']));logger['info'](_0x1540('0x58'),_0x326d02);logger[_0x1540('0x59')](_0x1540('0x5a'),_0x24504d);try{fs[_0x1540('0x5b')](_0x326d02,parseInt(_0x1540('0x5c'),0x8));var _0x25101f=sox[_0x1540('0x5d')](_0x326d02,_0x24504d,{'sampleRate':0x1f40,'format':_0x1540('0x56'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x25101f['on']('error',function(_0x30532f){fs[_0x1540('0x5e')](_0x326d02);_0x1017b1['status'](0x1f4)['send'](_0x30532f);});_0x25101f['on'](_0x1540('0x5f'),function(_0x4fa4b1){_0x4a16da['original_duration']=isNaN(_0x4fa4b1['duration'])?null:_0x4fa4b1[_0x1540('0x60')]*0x3e8;_0x4a16da['original_sampleCount']=isNaN(_0x4fa4b1['sampleCount'])?null:_0x4fa4b1[_0x1540('0x61')];_0x4a16da[_0x1540('0x62')]=isNaN(_0x4fa4b1[_0x1540('0x63')])?null:_0x4fa4b1[_0x1540('0x63')];_0x4a16da[_0x1540('0x64')]=isNaN(_0x4fa4b1[_0x1540('0x65')])?null:_0x4fa4b1[_0x1540('0x65')];_0x4a16da[_0x1540('0x66')]=isNaN(_0x4fa4b1[_0x1540('0x67')])?null:_0x4fa4b1[_0x1540('0x67')];});_0x25101f['on'](_0x1540('0x68'),function(_0x3a9b45){_0x4a16da[_0x1540('0x69')]=isNaN(_0x3a9b45['duration'])?null:_0x3a9b45[_0x1540('0x60')]*0x3e8;_0x4a16da[_0x1540('0x6a')]=isNaN(_0x3a9b45[_0x1540('0x61')])?null:_0x3a9b45['sampleCount'];_0x4a16da['converted_channelCount']=isNaN(_0x3a9b45[_0x1540('0x63')])?null:_0x3a9b45[_0x1540('0x63')];_0x4a16da['converted_bitRate']=isNaN(_0x3a9b45[_0x1540('0x65')])?null:_0x3a9b45[_0x1540('0x65')];_0x4a16da[_0x1540('0x6b')]=isNaN(_0x3a9b45[_0x1540('0x67')])?null:_0x3a9b45[_0x1540('0x67')];});_0x25101f['on']('end',function(){fs[_0x1540('0x5b')](_0x24504d,parseInt(_0x1540('0x5c'),0x8));return db[_0x1540('0x27')][_0x1540('0x6c')](_0x4a16da)[_0x1540('0x21')](function(_0x368c50){var _0x4755e1={'role':_0x34c988[_0x1540('0x6d')]['role'],'userProfileId':_0x34c988[_0x1540('0x6d')][_0x1540('0x6e')]};if(!_0x4755e1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4755e1[_0x1540('0x6f')]===_0x1540('0x70')){var _0xf1f68f=_0x368c50[_0x1540('0x71')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x1540('0x22'),'userProfileId':_0x4755e1[_0x1540('0x6e')]},'raw':!![]})[_0x1540('0x21')](function(_0x3e333d){if(_0x3e333d&&_0x3e333d[_0x1540('0x72')]===0x0){return db['UserProfileResource'][_0x1540('0x6c')]({'name':_0xf1f68f[_0x1540('0x25')],'resourceId':_0xf1f68f['id'],'type':_0x3e333d['name'],'sectionId':_0x3e333d['id']},{})[_0x1540('0x21')](function(){return _0x368c50;});}else{return _0x368c50;}})['catch'](function(_0x384f02){logger['error'](_0x1540('0x73'),_0x384f02);throw _0x384f02;});}return _0x368c50;})[_0x1540('0x21')](respondWithResult(_0x1017b1,null))['catch'](handleError(_0x1017b1,null));});_0x25101f[_0x1540('0x74')]();}catch(_0x73aaef){_0x1017b1['status'](0x1f4)[_0x1540('0x26')](_0x73aaef);}};exports[_0x1540('0x1f')]=function(_0x21732c,_0x2b891a,_0x5bebc5){return db['Sound'][_0x1540('0x44')]({'where':{'id':_0x21732c[_0x1540('0x41')]['id']}})['then'](handleEntityNotFound(_0x2b891a,null))[_0x1540('0x21')](saveUpdates(_[_0x1540('0x38')](_0x21732c[_0x1540('0x6d')],[_0x1540('0x25'),_0x1540('0x75')]),null))[_0x1540('0x21')](respondWithResult(_0x2b891a,null))[_0x1540('0x3f')](handleError(_0x2b891a,null));};exports[_0x1540('0x76')]=function(_0x264cd8,_0xc102f2,_0x349d28){return db[_0x1540('0x27')][_0x1540('0x44')]({'where':{'id':_0x264cd8[_0x1540('0x41')]['id']}})[_0x1540('0x21')](function(_0xf06de8){if(_0xf06de8){return _0xf06de8['destroy']();}})[_0x1540('0x21')](function(_0x62927c){var _0x1776da=path[_0x1540('0x49')](config[_0x1540('0x4a')],_0x1540('0x57'),util[_0x1540('0x4e')](_0x1540('0x4f'),_0x62927c[_0x1540('0x46')],_0x62927c[_0x1540('0x77')]));var _0xf1d426=path['join'](config[_0x1540('0x4a')],_0x1540('0x4b'),util[_0x1540('0x4e')](_0x1540('0x4f'),_0x62927c['save_name'],_0x62927c['converted_format']));fs['unlinkSync'](_0x1776da);fs[_0x1540('0x5e')](_0xf1d426);return _0x62927c;})[_0x1540('0x21')](function(_0x208344){if(_0x208344){return _0xc102f2[_0x1540('0x1a')](0xcc)[_0x1540('0x14')]();}})[_0x1540('0x21')](handleEntityNotFound(_0xc102f2,null))[_0x1540('0x3f')](handleError(_0xc102f2,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 93c5645..7b84863 100644 --- a/server/api/sound/sound.model.js +++ b/server/api/sound/sound.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89cf=['api','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','util','../../config/logger'];(function(_0x4512c6,_0x1940e8){var _0x35e1fa=function(_0x3bb6b2){while(--_0x3bb6b2){_0x4512c6['push'](_0x4512c6['shift']());}};_0x35e1fa(++_0x1940e8);}(_0x89cf,0x1d9));var _0xf89c=function(_0x328ac8,_0x10b008){_0x328ac8=_0x328ac8-0x0;var _0x1de83d=_0x89cf[_0x328ac8];return _0x1de83d;};'use strict';var _=require(_0xf89c('0x0'));var util=require(_0xf89c('0x1'));var logger=require(_0xf89c('0x2'))(_0xf89c('0x3'));var moment=require('moment');var BPromise=require(_0xf89c('0x4'));var rp=require(_0xf89c('0x5'));var fs=require('fs');var path=require(_0xf89c('0x6'));var rimraf=require(_0xf89c('0x7'));var config=require(_0xf89c('0x8'));var attributes=require(_0xf89c('0x9'));module[_0xf89c('0xa')]=function(_0x2ef69d,_0x46750b){return _0x2ef69d[_0xf89c('0xb')](_0xf89c('0xc'),attributes,{'tableName':_0xf89c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50f1=['util','../../config/logger','moment','request-promise','path','./sound.attributes','exports','Sound','tools_sounds'];(function(_0x30c187,_0x1a4d55){var _0x4ba7bc=function(_0x2c1801){while(--_0x2c1801){_0x30c187['push'](_0x30c187['shift']());}};_0x4ba7bc(++_0x1a4d55);}(_0x50f1,0x99));var _0x150f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x50f1[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x150f('0x0'));var logger=require(_0x150f('0x1'))('api');var moment=require(_0x150f('0x2'));var BPromise=require('bluebird');var rp=require(_0x150f('0x3'));var fs=require('fs');var path=require(_0x150f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x150f('0x5'));module[_0x150f('0x6')]=function(_0x276cd6,_0x39dc1b){return _0x276cd6['define'](_0x150f('0x7'),attributes,{'tableName':_0x150f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 31e5b7c..5e0d536 100644 --- a/server/api/sound/sound.rpc.js +++ b/server/api/sound/sound.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc66=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','lodash','moment','bluebird'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xdc66,0x189));var _0x6dc6=function(_0x6054be,_0x2f4ffa){_0x6054be=_0x6054be-0x0;var _0xd1d697=_0xdc66[_0x6054be];return _0xd1d697;};'use strict';var _=require(_0x6dc6('0x0'));var util=require('util');var moment=require(_0x6dc6('0x1'));var BPromise=require(_0x6dc6('0x2'));var rs=require(_0x6dc6('0x3'));var fs=require('fs');var Redis=require(_0x6dc6('0x4'));var db=require(_0x6dc6('0x5'))['db'];var utils=require(_0x6dc6('0x6'));var logger=require(_0x6dc6('0x7'))(_0x6dc6('0x8'));var config=require(_0x6dc6('0x9'));var jayson=require(_0x6dc6('0xa'));var client=jayson[_0x6dc6('0xb')][_0x6dc6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x170ff6,_0x24f229,_0x594d70){return new BPromise(function(_0x4ee662,_0x5e512f){return client[_0x6dc6('0xd')](_0x170ff6,_0x594d70)[_0x6dc6('0xe')](function(_0x3b39de){logger['info'](_0x6dc6('0xf'),_0x24f229,_0x6dc6('0x10'));logger[_0x6dc6('0x11')](_0x6dc6('0x12'),_0x24f229,_0x6dc6('0x10'),JSON[_0x6dc6('0x13')](_0x3b39de));if(_0x3b39de[_0x6dc6('0x14')]){if(_0x3b39de['error'][_0x6dc6('0x15')]===0x1f4){logger[_0x6dc6('0x14')](_0x6dc6('0xf'),_0x24f229,_0x3b39de['error'][_0x6dc6('0x16')]);return _0x5e512f(_0x3b39de[_0x6dc6('0x14')][_0x6dc6('0x16')]);}logger[_0x6dc6('0x14')](_0x6dc6('0xf'),_0x24f229,_0x3b39de[_0x6dc6('0x14')][_0x6dc6('0x16')]);return _0x4ee662(_0x3b39de[_0x6dc6('0x14')][_0x6dc6('0x16')]);}else{logger[_0x6dc6('0x17')]('Sound,\x20%s,\x20%s',_0x24f229,_0x6dc6('0x10'));_0x4ee662(_0x3b39de[_0x6dc6('0x18')][_0x6dc6('0x16')]);}})[_0x6dc6('0x19')](function(_0x2b631c){logger['error'](_0x6dc6('0xf'),_0x24f229,_0x2b631c);_0x5e512f(_0x2b631c);});});}exports[_0x6dc6('0x1a')]=function(_0xb60233){var _0x527d03=this;return new Promise(function(_0x929797,_0x3aafd0){return db[_0x6dc6('0x1b')][_0x6dc6('0x1c')]({'raw':_0xb60233[_0x6dc6('0x1d')]?_0xb60233[_0x6dc6('0x1d')][_0x6dc6('0x1e')]===undefined?!![]:![]:!![],'where':_0xb60233[_0x6dc6('0x1d')]?_0xb60233[_0x6dc6('0x1d')][_0x6dc6('0x1f')]||null:null,'attributes':_0xb60233[_0x6dc6('0x1d')]?_0xb60233['options'][_0x6dc6('0x20')]||null:null,'include':_0xb60233[_0x6dc6('0x1d')]?_0xb60233[_0x6dc6('0x1d')][_0x6dc6('0x21')]?_[_0x6dc6('0x22')](_0xb60233[_0x6dc6('0x1d')][_0x6dc6('0x21')],function(_0x3b7e77){return{'model':db[_0x3b7e77['model']],'as':_0x3b7e77['as'],'attributes':_0x3b7e77[_0x6dc6('0x20')],'include':_0x3b7e77[_0x6dc6('0x21')]?_[_0x6dc6('0x22')](_0x3b7e77[_0x6dc6('0x21')],function(_0x4b00e6){return{'model':db[_0x4b00e6['model']],'as':_0x4b00e6['as'],'attributes':_0x4b00e6['attributes'],'include':_0x4b00e6['include']?_['map'](_0x4b00e6[_0x6dc6('0x21')],function(_0x29919f){return{'model':db[_0x29919f[_0x6dc6('0x23')]],'as':_0x29919f['as'],'attributes':_0x29919f['attributes']};}):[]};}):[]};}):[]:[]})[_0x6dc6('0xe')](function(_0x5e584d){logger[_0x6dc6('0x17')](_0x6dc6('0x1a'),_0xb60233);logger['debug'](_0x6dc6('0x1a'),_0xb60233,JSON[_0x6dc6('0x13')](_0x5e584d));_0x929797(_0x5e584d);})['catch'](function(_0x573dec){logger['error'](_0x6dc6('0x1a'),_0x573dec[_0x6dc6('0x16')],_0xb60233);_0x3aafd0(_0x527d03[_0x6dc6('0x14')](0x1f4,_0x573dec[_0x6dc6('0x16')]));});});}; \ No newline at end of file +var _0xd3a2=['Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','ShowSound','find','options','raw','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x501b4b,_0x4c6b11){var _0x91e1f3=function(_0x111dce){while(--_0x111dce){_0x501b4b['push'](_0x501b4b['shift']());}};_0x91e1f3(++_0x4c6b11);}(_0xd3a2,0x166));var _0x2d3a=function(_0x5b9d91,_0x4e9e87){_0x5b9d91=_0x5b9d91-0x0;var _0x469037=_0xd3a2[_0x5b9d91];return _0x469037;};'use strict';var _=require(_0x2d3a('0x0'));var util=require(_0x2d3a('0x1'));var moment=require(_0x2d3a('0x2'));var BPromise=require(_0x2d3a('0x3'));var rs=require(_0x2d3a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d3a('0x5'))['db'];var utils=require(_0x2d3a('0x6'));var logger=require(_0x2d3a('0x7'))(_0x2d3a('0x8'));var config=require('../../config/environment');var jayson=require(_0x2d3a('0x9'));var client=jayson[_0x2d3a('0xa')][_0x2d3a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x164bc9,_0x3d7fd9,_0x37ed3e){return new BPromise(function(_0x4566a2,_0x31e81d){return client[_0x2d3a('0xc')](_0x164bc9,_0x37ed3e)[_0x2d3a('0xd')](function(_0x126e6e){logger['info'](_0x2d3a('0xe'),_0x3d7fd9,'request\x20sent');logger[_0x2d3a('0xf')](_0x2d3a('0x10'),_0x3d7fd9,_0x2d3a('0x11'),JSON['stringify'](_0x126e6e));if(_0x126e6e[_0x2d3a('0x12')]){if(_0x126e6e['error'][_0x2d3a('0x13')]===0x1f4){logger[_0x2d3a('0x12')](_0x2d3a('0xe'),_0x3d7fd9,_0x126e6e[_0x2d3a('0x12')][_0x2d3a('0x14')]);return _0x31e81d(_0x126e6e[_0x2d3a('0x12')][_0x2d3a('0x14')]);}logger[_0x2d3a('0x12')](_0x2d3a('0xe'),_0x3d7fd9,_0x126e6e[_0x2d3a('0x12')][_0x2d3a('0x14')]);return _0x4566a2(_0x126e6e['error'][_0x2d3a('0x14')]);}else{logger[_0x2d3a('0x15')](_0x2d3a('0xe'),_0x3d7fd9,_0x2d3a('0x11'));_0x4566a2(_0x126e6e['result'][_0x2d3a('0x14')]);}})[_0x2d3a('0x16')](function(_0x656b3c){logger['error'](_0x2d3a('0xe'),_0x3d7fd9,_0x656b3c);_0x31e81d(_0x656b3c);});});}exports[_0x2d3a('0x17')]=function(_0x4690d6){var _0x567d86=this;return new Promise(function(_0x5c0760,_0x2d4f60){return db['Sound'][_0x2d3a('0x18')]({'raw':_0x4690d6[_0x2d3a('0x19')]?_0x4690d6['options'][_0x2d3a('0x1a')]===undefined?!![]:![]:!![],'where':_0x4690d6['options']?_0x4690d6[_0x2d3a('0x19')]['where']||null:null,'attributes':_0x4690d6[_0x2d3a('0x19')]?_0x4690d6['options']['attributes']||null:null,'include':_0x4690d6[_0x2d3a('0x19')]?_0x4690d6[_0x2d3a('0x19')][_0x2d3a('0x1b')]?_[_0x2d3a('0x1c')](_0x4690d6[_0x2d3a('0x19')][_0x2d3a('0x1b')],function(_0x1e38f3){return{'model':db[_0x1e38f3[_0x2d3a('0x1d')]],'as':_0x1e38f3['as'],'attributes':_0x1e38f3[_0x2d3a('0x1e')],'include':_0x1e38f3[_0x2d3a('0x1b')]?_[_0x2d3a('0x1c')](_0x1e38f3[_0x2d3a('0x1b')],function(_0x2776ea){return{'model':db[_0x2776ea[_0x2d3a('0x1d')]],'as':_0x2776ea['as'],'attributes':_0x2776ea[_0x2d3a('0x1e')],'include':_0x2776ea[_0x2d3a('0x1b')]?_['map'](_0x2776ea[_0x2d3a('0x1b')],function(_0x1f7f36){return{'model':db[_0x1f7f36[_0x2d3a('0x1d')]],'as':_0x1f7f36['as'],'attributes':_0x1f7f36[_0x2d3a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2d3a('0xd')](function(_0x2bba8e){logger[_0x2d3a('0x15')](_0x2d3a('0x17'),_0x4690d6);logger[_0x2d3a('0xf')](_0x2d3a('0x17'),_0x4690d6,JSON['stringify'](_0x2bba8e));_0x5c0760(_0x2bba8e);})[_0x2d3a('0x16')](function(_0x4b55f2){logger['error'](_0x2d3a('0x17'),_0x4b55f2[_0x2d3a('0x14')],_0x4690d6);_0x2d4f60(_0x567d86[_0x2d3a('0x12')](0x1f4,_0x4b55f2['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index db37bf7..372fc29 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x20c290,_0x47e736){var _0x3d7b3b=function(_0x5d837f){while(--_0x5d837f){_0x20c290['push'](_0x20c290['shift']());}};_0x3d7b3b(++_0x47e736);}(_0x4fc2,0x111));var _0x24fc=function(_0x3b6c2e,_0xb4d3ce){_0x3b6c2e=_0x3b6c2e-0x0;var _0x4e4e3f=_0x4fc2[_0x3b6c2e];return _0x4e4e3f;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file +var _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x24a654,_0x2ca441){var _0x458651=function(_0x1ecda1){while(--_0x1ecda1){_0x24a654['push'](_0x24a654['shift']());}};_0x458651(++_0x2ca441);}(_0x8603,0x190));var _0x3860=function(_0x38eca5,_0x51010f){_0x38eca5=_0x38eca5-0x0;var _0x29c733=_0x8603[_0x38eca5];return _0x29c733;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 34f013c..1a104b3 100644 --- a/server/api/squareMessage/squareMessage.attributes.js +++ b/server/api/squareMessage/squareMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8949=['STRING','exports','TEXT','medium','out'];(function(_0xa4448d,_0x394342){var _0x58bcf8=function(_0x7f5037){while(--_0x7f5037){_0xa4448d['push'](_0xa4448d['shift']());}};_0x58bcf8(++_0x394342);}(_0x8949,0x18c));var _0x9894=function(_0x1489ef,_0x275d93){_0x1489ef=_0x1489ef-0x0;var _0x20e0e6=_0x8949[_0x1489ef];return _0x20e0e6;};'use strict';var Sequelize=require('sequelize');module[_0x9894('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x9894('0x1')](_0x9894('0x2')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x9894('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0x9894('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x7973=['STRING','ENUM','out','TEXT','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7973,0x153));var _0x3797=function(_0x3ab14e,_0x2f9b98){_0x3ab14e=_0x3ab14e-0x0;var _0x38f5b6=_0x7973[_0x3ab14e];return _0x38f5b6;};'use strict';var Sequelize=require(_0x3797('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3797('0x1')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x3797('0x2')]('in',_0x3797('0x3')),'defaultValue':_0x3797('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0x3797('0x1')]},'providerResponse':{'type':Sequelize[_0x3797('0x4')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 4b01a1a..2220b40 100644 --- a/server/api/squareMessage/squareMessage.controller.js +++ b/server/api/squareMessage/squareMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbbb=['../../config/environment','../../config/license/util','undefined','limit','count','offset','Content-Range','json','apply','save','update','then','destroy','status','sendStatus','stack','name','index','map','SquareMessage','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x21e79a,_0x5a7990){var _0x506c02=function(_0x566c95){while(--_0x566c95){_0x21e79a['push'](_0x21e79a['shift']());}};_0x506c02(++_0x5a7990);}(_0xcbbb,0x1ee));var _0xbcbb=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0xcbbb[_0x5eb22e];return _0x27fed5;};'use strict';var emlformat=require(_0xbcbb('0x0'));var rimraf=require(_0xbcbb('0x1'));var zipdir=require(_0xbcbb('0x2'));var jsonpatch=require(_0xbcbb('0x3'));var rp=require(_0xbcbb('0x4'));var moment=require(_0xbcbb('0x5'));var BPromise=require(_0xbcbb('0x6'));var Mustache=require(_0xbcbb('0x7'));var util=require(_0xbcbb('0x8'));var path=require(_0xbcbb('0x9'));var sox=require(_0xbcbb('0xa'));var csv=require(_0xbcbb('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbcbb('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbcbb('0xd'));var jsforce=require(_0xbcbb('0xe'));var deskjs=require(_0xbcbb('0xf'));var toCsv=require(_0xbcbb('0xb'));var querystring=require(_0xbcbb('0x10'));var Papa=require('papaparse');var Redis=require(_0xbcbb('0x11'));var authService=require(_0xbcbb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbcbb('0x13'));var hardwareService=require(_0xbcbb('0x14'));var logger=require(_0xbcbb('0x15'))(_0xbcbb('0x16'));var utils=require(_0xbcbb('0x17'));var config=require(_0xbcbb('0x18'));var licenseUtil=require(_0xbcbb('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dda36,_0x2722eb){_0x2722eb=_0x2722eb||0xcc;return function(_0x125a27){if(_0x125a27){return _0x5dda36['sendStatus'](_0x2722eb);}return _0x5dda36['status'](_0x2722eb)['end']();};}function respondWithResult(_0x5baf93,_0x1b28cc){_0x1b28cc=_0x1b28cc||0xc8;return function(_0x12a8c4){if(_0x12a8c4){return _0x5baf93['status'](_0x1b28cc)['json'](_0x12a8c4);}};}function respondWithFilteredResult(_0x25f177,_0x341ea3){return function(_0x518216){if(_0x518216){var _0x207602=typeof _0x341ea3['offset']===_0xbcbb('0x1a')&&typeof _0x341ea3[_0xbcbb('0x1b')]==='undefined';var _0x498466=_0x518216[_0xbcbb('0x1c')];var _0x556ec9=_0x207602?0x0:_0x341ea3['offset'];var _0x3a7644=_0x207602?_0x518216[_0xbcbb('0x1c')]:_0x341ea3[_0xbcbb('0x1d')]+_0x341ea3[_0xbcbb('0x1b')];var _0x342b7f;if(_0x3a7644>=_0x498466){_0x3a7644=_0x498466;_0x342b7f=0xc8;}else{_0x342b7f=0xce;}_0x25f177['status'](_0x342b7f);return _0x25f177['set'](_0xbcbb('0x1e'),_0x556ec9+'-'+_0x3a7644+'/'+_0x498466)[_0xbcbb('0x1f')](_0x518216);}return null;};}function patchUpdates(_0x1b804f){return function(_0x3629a6){try{jsonpatch[_0xbcbb('0x20')](_0x3629a6,_0x1b804f,!![]);}catch(_0x2819f4){return BPromise['reject'](_0x2819f4);}return _0x3629a6[_0xbcbb('0x21')]();};}function saveUpdates(_0x48021e,_0x30ebb9){return function(_0x19e78c){if(_0x19e78c){return _0x19e78c[_0xbcbb('0x22')](_0x48021e)[_0xbcbb('0x23')](function(_0x1e8fca){return _0x1e8fca;});}return null;};}function removeEntity(_0x518b02,_0x3a4c4f){return function(_0x46b924){if(_0x46b924){return _0x46b924[_0xbcbb('0x24')]()[_0xbcbb('0x23')](function(){_0x518b02[_0xbcbb('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x89acb2,_0x5e36ce){return function(_0x2166c8){if(!_0x2166c8){_0x89acb2[_0xbcbb('0x26')](0x194);}return _0x2166c8;};}function handleError(_0x6ba897,_0x295a1d){_0x295a1d=_0x295a1d||0x1f4;return function(_0x595713){logger['error'](_0x595713[_0xbcbb('0x27')]);if(_0x595713[_0xbcbb('0x28')]){delete _0x595713[_0xbcbb('0x28')];}_0x6ba897[_0xbcbb('0x25')](_0x295a1d)['send'](_0x595713);};}exports[_0xbcbb('0x29')]=function(_0x997655,_0x5677c9){var _0x35e541={},_0x5c21cf={},_0x19a236={'count':0x0,'rows':[]};var _0x27052a=_[_0xbcbb('0x2a')](db[_0xbcbb('0x2b')][_0xbcbb('0x2c')],function(_0x49cda0){return{'name':_0x49cda0[_0xbcbb('0x2d')],'type':_0x49cda0['type']['key']};});_0x5c21cf[_0xbcbb('0x2e')]=_[_0xbcbb('0x2a')](_0x27052a,_0xbcbb('0x28'));_0x5c21cf[_0xbcbb('0x2f')]=_['keys'](_0x997655[_0xbcbb('0x2f')]);_0x5c21cf[_0xbcbb('0x30')]=_['intersection'](_0x5c21cf['model'],_0x5c21cf[_0xbcbb('0x2f')]);_0x35e541[_0xbcbb('0x31')]=_[_0xbcbb('0x32')](_0x5c21cf[_0xbcbb('0x2e')],qs[_0xbcbb('0x33')](_0x997655[_0xbcbb('0x2f')][_0xbcbb('0x33')]));_0x35e541[_0xbcbb('0x31')]=_0x35e541[_0xbcbb('0x31')][_0xbcbb('0x34')]?_0x35e541[_0xbcbb('0x31')]:_0x5c21cf[_0xbcbb('0x2e')];if(!_0x997655['query'][_0xbcbb('0x35')](_0xbcbb('0x36'))){_0x35e541['limit']=qs[_0xbcbb('0x1b')](_0x997655['query'][_0xbcbb('0x1b')]);_0x35e541[_0xbcbb('0x1d')]=qs[_0xbcbb('0x1d')](_0x997655['query'][_0xbcbb('0x1d')]);}_0x35e541[_0xbcbb('0x37')]=qs[_0xbcbb('0x38')](_0x997655[_0xbcbb('0x2f')][_0xbcbb('0x38')]);_0x35e541[_0xbcbb('0x39')]=qs[_0xbcbb('0x30')](_[_0xbcbb('0x3a')](_0x997655[_0xbcbb('0x2f')],_0x5c21cf[_0xbcbb('0x30')]),_0x27052a);if(_0x997655[_0xbcbb('0x2f')][_0xbcbb('0x3b')]){_0x35e541['where']=_[_0xbcbb('0x3c')](_0x35e541[_0xbcbb('0x39')],{'$or':_[_0xbcbb('0x2a')](_0x27052a,function(_0x3b4bb){if(_0x3b4bb[_0xbcbb('0x3d')]!==_0xbcbb('0x3e')){var _0x14a0b4={};_0x14a0b4[_0x3b4bb['name']]={'$like':'%'+_0x997655[_0xbcbb('0x2f')]['filter']+'%'};return _0x14a0b4;}})});}_0x35e541=_[_0xbcbb('0x3c')]({},_0x35e541,_0x997655[_0xbcbb('0x3f')]);var _0x311d97={'where':_0x35e541[_0xbcbb('0x39')]};return db[_0xbcbb('0x2b')][_0xbcbb('0x1c')](_0x311d97)[_0xbcbb('0x23')](function(_0x941075){_0x19a236[_0xbcbb('0x1c')]=_0x941075;if(_0x997655[_0xbcbb('0x2f')]['includeAll']){_0x35e541[_0xbcbb('0x40')]=[{'all':!![]}];}return db['SquareMessage'][_0xbcbb('0x41')](_0x35e541);})['then'](function(_0x5aee78){_0x19a236[_0xbcbb('0x42')]=_0x5aee78;return _0x19a236;})['then'](respondWithFilteredResult(_0x5677c9,_0x35e541))[_0xbcbb('0x43')](handleError(_0x5677c9,null));};exports[_0xbcbb('0x44')]=function(_0x28a32a,_0x195151){var _0xa30c48={'raw':!![],'where':{'id':_0x28a32a['params']['id']}},_0x3dd671={};_0x3dd671[_0xbcbb('0x2e')]=_[_0xbcbb('0x45')](db[_0xbcbb('0x2b')][_0xbcbb('0x2c')]);_0x3dd671[_0xbcbb('0x2f')]=_[_0xbcbb('0x45')](_0x28a32a['query']);_0x3dd671[_0xbcbb('0x30')]=_['intersection'](_0x3dd671[_0xbcbb('0x2e')],_0x3dd671['query']);_0xa30c48[_0xbcbb('0x31')]=_[_0xbcbb('0x32')](_0x3dd671[_0xbcbb('0x2e')],qs[_0xbcbb('0x33')](_0x28a32a[_0xbcbb('0x2f')][_0xbcbb('0x33')]));_0xa30c48[_0xbcbb('0x31')]=_0xa30c48[_0xbcbb('0x31')][_0xbcbb('0x34')]?_0xa30c48['attributes']:_0x3dd671['model'];if(_0x28a32a[_0xbcbb('0x2f')]['includeAll']){_0xa30c48['include']=[{'all':!![]}];}_0xa30c48=_[_0xbcbb('0x3c')]({},_0xa30c48,_0x28a32a[_0xbcbb('0x3f')]);return db['SquareMessage'][_0xbcbb('0x46')](_0xa30c48)[_0xbcbb('0x23')](handleEntityNotFound(_0x195151,null))[_0xbcbb('0x23')](respondWithResult(_0x195151,null))[_0xbcbb('0x43')](handleError(_0x195151,null));};exports[_0xbcbb('0x47')]=function(_0x2e0077,_0x768fc8){return db['SquareMessage'][_0xbcbb('0x47')](_0x2e0077[_0xbcbb('0x48')],{})['then'](respondWithResult(_0x768fc8,0xc9))[_0xbcbb('0x43')](handleError(_0x768fc8,null));};exports[_0xbcbb('0x22')]=function(_0x10b764,_0xef4214){if(_0x10b764['body']['id']){delete _0x10b764['body']['id'];}return db[_0xbcbb('0x2b')][_0xbcbb('0x46')]({'where':{'id':_0x10b764['params']['id']}})['then'](handleEntityNotFound(_0xef4214,null))[_0xbcbb('0x23')](saveUpdates(_0x10b764['body'],null))[_0xbcbb('0x23')](respondWithResult(_0xef4214,null))[_0xbcbb('0x43')](handleError(_0xef4214,null));};exports[_0xbcbb('0x24')]=function(_0x28d80e,_0x590b05){return db[_0xbcbb('0x2b')][_0xbcbb('0x46')]({'where':{'id':_0x28d80e[_0xbcbb('0x49')]['id']}})['then'](handleEntityNotFound(_0x590b05,null))[_0xbcbb('0x23')](removeEntity(_0x590b05,null))[_0xbcbb('0x43')](handleError(_0x590b05,null));}; \ No newline at end of file +var _0x09a1=['rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','catch','show','keys','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','map','SquareMessage'];(function(_0x470b14,_0x23a860){var _0x5011dc=function(_0x118a6b){while(--_0x118a6b){_0x470b14['push'](_0x470b14['shift']());}};_0x5011dc(++_0x23a860);}(_0x09a1,0xf0));var _0x109a=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x09a1[_0xbeb808];return _0x5d6909;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x109a('0x0'));var jsonpatch=require(_0x109a('0x1'));var rp=require(_0x109a('0x2'));var moment=require(_0x109a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x109a('0x4'));var util=require(_0x109a('0x5'));var path=require(_0x109a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x109a('0x7'));var fs=require('fs');var fs_extra=require(_0x109a('0x8'));var _=require(_0x109a('0x9'));var squel=require(_0x109a('0xa'));var crypto=require('crypto');var jsforce=require(_0x109a('0xb'));var deskjs=require(_0x109a('0xc'));var toCsv=require(_0x109a('0xd'));var querystring=require('querystring');var Papa=require(_0x109a('0xe'));var Redis=require(_0x109a('0xf'));var authService=require(_0x109a('0x10'));var qs=require(_0x109a('0x11'));var as=require(_0x109a('0x12'));var hardwareService=require(_0x109a('0x13'));var logger=require(_0x109a('0x14'))(_0x109a('0x15'));var utils=require(_0x109a('0x16'));var config=require(_0x109a('0x17'));var licenseUtil=require(_0x109a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x101355,_0x3d0bb3){_0x3d0bb3=_0x3d0bb3||0xcc;return function(_0x57606f){if(_0x57606f){return _0x101355['sendStatus'](_0x3d0bb3);}return _0x101355[_0x109a('0x19')](_0x3d0bb3)[_0x109a('0x1a')]();};}function respondWithResult(_0x2149c0,_0x4e9b6f){_0x4e9b6f=_0x4e9b6f||0xc8;return function(_0x43431){if(_0x43431){return _0x2149c0[_0x109a('0x19')](_0x4e9b6f)[_0x109a('0x1b')](_0x43431);}};}function respondWithFilteredResult(_0x5152b1,_0xf61eee){return function(_0x3ae0e9){if(_0x3ae0e9){var _0x3c0f39=typeof _0xf61eee[_0x109a('0x1c')]==='undefined'&&typeof _0xf61eee[_0x109a('0x1d')]===_0x109a('0x1e');var _0x150eee=_0x3ae0e9[_0x109a('0x1f')];var _0x45d231=_0x3c0f39?0x0:_0xf61eee[_0x109a('0x1c')];var _0x431366=_0x3c0f39?_0x3ae0e9['count']:_0xf61eee['offset']+_0xf61eee[_0x109a('0x1d')];var _0x1ddfa3;if(_0x431366>=_0x150eee){_0x431366=_0x150eee;_0x1ddfa3=0xc8;}else{_0x1ddfa3=0xce;}_0x5152b1[_0x109a('0x19')](_0x1ddfa3);return _0x5152b1['set'](_0x109a('0x20'),_0x45d231+'-'+_0x431366+'/'+_0x150eee)['json'](_0x3ae0e9);}return null;};}function patchUpdates(_0x398013){return function(_0x5e8697){try{jsonpatch[_0x109a('0x21')](_0x5e8697,_0x398013,!![]);}catch(_0x20b103){return BPromise[_0x109a('0x22')](_0x20b103);}return _0x5e8697[_0x109a('0x23')]();};}function saveUpdates(_0x3a34b6,_0x210432){return function(_0x51fb5f){if(_0x51fb5f){return _0x51fb5f[_0x109a('0x24')](_0x3a34b6)[_0x109a('0x25')](function(_0xa6f2f7){return _0xa6f2f7;});}return null;};}function removeEntity(_0x2a0b06,_0x836149){return function(_0x59875e){if(_0x59875e){return _0x59875e[_0x109a('0x26')]()['then'](function(){_0x2a0b06[_0x109a('0x19')](0xcc)[_0x109a('0x1a')]();});}};}function handleEntityNotFound(_0xe66291,_0x1597a1){return function(_0x29e2ed){if(!_0x29e2ed){_0xe66291[_0x109a('0x27')](0x194);}return _0x29e2ed;};}function handleError(_0x32a050,_0x58c32c){_0x58c32c=_0x58c32c||0x1f4;return function(_0x24b1bc){logger[_0x109a('0x28')](_0x24b1bc['stack']);if(_0x24b1bc[_0x109a('0x29')]){delete _0x24b1bc[_0x109a('0x29')];}_0x32a050[_0x109a('0x19')](_0x58c32c)['send'](_0x24b1bc);};}exports['index']=function(_0x2a881e,_0x5bb661){var _0x23cf4e={},_0x3e43ed={},_0x4397a8={'count':0x0,'rows':[]};var _0xda7ea=_[_0x109a('0x2a')](db[_0x109a('0x2b')][_0x109a('0x2c')],function(_0x3e9f6c){return{'name':_0x3e9f6c['fieldName'],'type':_0x3e9f6c[_0x109a('0x2d')][_0x109a('0x2e')]};});_0x3e43ed[_0x109a('0x2f')]=_['map'](_0xda7ea,_0x109a('0x29'));_0x3e43ed[_0x109a('0x30')]=_['keys'](_0x2a881e[_0x109a('0x30')]);_0x3e43ed[_0x109a('0x31')]=_[_0x109a('0x32')](_0x3e43ed[_0x109a('0x2f')],_0x3e43ed[_0x109a('0x30')]);_0x23cf4e['attributes']=_[_0x109a('0x32')](_0x3e43ed[_0x109a('0x2f')],qs[_0x109a('0x33')](_0x2a881e['query'][_0x109a('0x33')]));_0x23cf4e['attributes']=_0x23cf4e[_0x109a('0x34')][_0x109a('0x35')]?_0x23cf4e[_0x109a('0x34')]:_0x3e43ed[_0x109a('0x2f')];if(!_0x2a881e[_0x109a('0x30')][_0x109a('0x36')](_0x109a('0x37'))){_0x23cf4e[_0x109a('0x1d')]=qs[_0x109a('0x1d')](_0x2a881e['query'][_0x109a('0x1d')]);_0x23cf4e[_0x109a('0x1c')]=qs[_0x109a('0x1c')](_0x2a881e[_0x109a('0x30')][_0x109a('0x1c')]);}_0x23cf4e[_0x109a('0x38')]=qs['sort'](_0x2a881e[_0x109a('0x30')]['sort']);_0x23cf4e[_0x109a('0x39')]=qs[_0x109a('0x31')](_[_0x109a('0x3a')](_0x2a881e[_0x109a('0x30')],_0x3e43ed[_0x109a('0x31')]),_0xda7ea);if(_0x2a881e['query'][_0x109a('0x3b')]){_0x23cf4e['where']=_[_0x109a('0x3c')](_0x23cf4e['where'],{'$or':_[_0x109a('0x2a')](_0xda7ea,function(_0x2d067d){if(_0x2d067d[_0x109a('0x2d')]!=='VIRTUAL'){var _0x2587cf={};_0x2587cf[_0x2d067d['name']]={'$like':'%'+_0x2a881e['query']['filter']+'%'};return _0x2587cf;}})});}_0x23cf4e=_['merge']({},_0x23cf4e,_0x2a881e[_0x109a('0x3d')]);var _0x25ba78={'where':_0x23cf4e[_0x109a('0x39')]};return db[_0x109a('0x2b')]['count'](_0x25ba78)[_0x109a('0x25')](function(_0x1245bd){_0x4397a8[_0x109a('0x1f')]=_0x1245bd;if(_0x2a881e[_0x109a('0x30')][_0x109a('0x3e')]){_0x23cf4e[_0x109a('0x3f')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x23cf4e);})[_0x109a('0x25')](function(_0x38ef27){_0x4397a8['rows']=_0x38ef27;return _0x4397a8;})[_0x109a('0x25')](respondWithFilteredResult(_0x5bb661,_0x23cf4e))[_0x109a('0x40')](handleError(_0x5bb661,null));};exports[_0x109a('0x41')]=function(_0x1e0377,_0x36877e){var _0x188791={'raw':!![],'where':{'id':_0x1e0377['params']['id']}},_0x59287c={};_0x59287c['model']=_[_0x109a('0x42')](db[_0x109a('0x2b')][_0x109a('0x2c')]);_0x59287c[_0x109a('0x30')]=_[_0x109a('0x42')](_0x1e0377[_0x109a('0x30')]);_0x59287c[_0x109a('0x31')]=_[_0x109a('0x32')](_0x59287c[_0x109a('0x2f')],_0x59287c[_0x109a('0x30')]);_0x188791[_0x109a('0x34')]=_['intersection'](_0x59287c[_0x109a('0x2f')],qs['fields'](_0x1e0377['query']['fields']));_0x188791[_0x109a('0x34')]=_0x188791['attributes'][_0x109a('0x35')]?_0x188791[_0x109a('0x34')]:_0x59287c['model'];if(_0x1e0377[_0x109a('0x30')][_0x109a('0x3e')]){_0x188791[_0x109a('0x3f')]=[{'all':!![]}];}_0x188791=_[_0x109a('0x3c')]({},_0x188791,_0x1e0377[_0x109a('0x3d')]);return db['SquareMessage'][_0x109a('0x43')](_0x188791)[_0x109a('0x25')](handleEntityNotFound(_0x36877e,null))['then'](respondWithResult(_0x36877e,null))[_0x109a('0x40')](handleError(_0x36877e,null));};exports[_0x109a('0x44')]=function(_0x3eebde,_0xbb946){return db[_0x109a('0x2b')][_0x109a('0x44')](_0x3eebde[_0x109a('0x45')],{})[_0x109a('0x25')](respondWithResult(_0xbb946,0xc9))['catch'](handleError(_0xbb946,null));};exports[_0x109a('0x24')]=function(_0x1fe096,_0x38a74a){if(_0x1fe096['body']['id']){delete _0x1fe096[_0x109a('0x45')]['id'];}return db[_0x109a('0x2b')]['find']({'where':{'id':_0x1fe096[_0x109a('0x46')]['id']}})['then'](handleEntityNotFound(_0x38a74a,null))[_0x109a('0x25')](saveUpdates(_0x1fe096['body'],null))[_0x109a('0x25')](respondWithResult(_0x38a74a,null))['catch'](handleError(_0x38a74a,null));};exports[_0x109a('0x26')]=function(_0x5e82f3,_0x557d05){return db[_0x109a('0x2b')][_0x109a('0x43')]({'where':{'id':_0x5e82f3[_0x109a('0x46')]['id']}})[_0x109a('0x25')](handleEntityNotFound(_0x557d05,null))[_0x109a('0x25')](removeEntity(_0x557d05,null))[_0x109a('0x40')](handleError(_0x557d05,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index f66fb08..1c0db1f 100644 --- a/server/api/squareMessage/squareMessage.model.js +++ b/server/api/squareMessage/squareMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3245=['path','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','lodash','api','request-promise'];(function(_0x25fe5f,_0x553196){var _0x50a435=function(_0x211634){while(--_0x211634){_0x25fe5f['push'](_0x25fe5f['shift']());}};_0x50a435(++_0x553196);}(_0x3245,0x10b));var _0x5324=function(_0x145340,_0x5ce236){_0x145340=_0x145340-0x0;var _0xbbf004=_0x3245[_0x145340];return _0xbbf004;};'use strict';var _=require(_0x5324('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5324('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5324('0x2'));var fs=require('fs');var path=require(_0x5324('0x3'));var rimraf=require('rimraf');var config=require(_0x5324('0x4'));var attributes=require(_0x5324('0x5'));module[_0x5324('0x6')]=function(_0x516ef7,_0x489ba3){return _0x516ef7[_0x5324('0x7')](_0x5324('0x8'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd660=['./squareMessage.attributes','exports','SquareMessage','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x11a962,_0x3cc338){var _0x55d423=function(_0xf4b236){while(--_0xf4b236){_0x11a962['push'](_0x11a962['shift']());}};_0x55d423(++_0x3cc338);}(_0xd660,0xe9));var _0x0d66=function(_0xf9f239,_0x30c0df){_0xf9f239=_0xf9f239-0x0;var _0x536d3d=_0xd660[_0xf9f239];return _0x536d3d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0d66('0x0'))(_0x0d66('0x1'));var moment=require(_0x0d66('0x2'));var BPromise=require('bluebird');var rp=require(_0x0d66('0x3'));var fs=require('fs');var path=require(_0x0d66('0x4'));var rimraf=require(_0x0d66('0x5'));var config=require(_0x0d66('0x6'));var attributes=require(_0x0d66('0x7'));module[_0x0d66('0x8')]=function(_0x51fd77,_0x3558f0){return _0x51fd77['define'](_0x0d66('0x9'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index f3f6051..91ad191 100644 --- a/server/api/squareMessage/squareMessage.rpc.js +++ b/server/api/squareMessage/squareMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ddd=['request\x20sent','stringify','error','message','SquareMessage,\x20%s,\x20%s','result','catch','CreateSquareMessage','SquareMessage','body','raw','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SquareMessage,\x20%s,\x20%s,\x20%s'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x2ddd,0xa7));var _0xd2dd=function(_0x2d9535,_0x4bc592){_0x2d9535=_0x2d9535-0x0;var _0xb4e710=_0x2ddd[_0x2d9535];return _0xb4e710;};'use strict';var _=require(_0xd2dd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd2dd('0x1'));var fs=require('fs');var Redis=require(_0xd2dd('0x2'));var db=require(_0xd2dd('0x3'))['db'];var utils=require(_0xd2dd('0x4'));var logger=require('../../config/logger')(_0xd2dd('0x5'));var config=require(_0xd2dd('0x6'));var jayson=require(_0xd2dd('0x7'));var client=jayson[_0xd2dd('0x8')][_0xd2dd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cb634,_0x5595af,_0x45bd57){return new BPromise(function(_0x4aa334,_0x4b03a4){return client[_0xd2dd('0xa')](_0x3cb634,_0x45bd57)[_0xd2dd('0xb')](function(_0x28520f){logger[_0xd2dd('0xc')]('SquareMessage,\x20%s,\x20%s',_0x5595af,'request\x20sent');logger[_0xd2dd('0xd')](_0xd2dd('0xe'),_0x5595af,_0xd2dd('0xf'),JSON[_0xd2dd('0x10')](_0x28520f));if(_0x28520f['error']){if(_0x28520f[_0xd2dd('0x11')]['code']===0x1f4){logger[_0xd2dd('0x11')]('SquareMessage,\x20%s,\x20%s',_0x5595af,_0x28520f[_0xd2dd('0x11')][_0xd2dd('0x12')]);return _0x4b03a4(_0x28520f[_0xd2dd('0x11')][_0xd2dd('0x12')]);}logger[_0xd2dd('0x11')](_0xd2dd('0x13'),_0x5595af,_0x28520f[_0xd2dd('0x11')]['message']);return _0x4aa334(_0x28520f[_0xd2dd('0x11')][_0xd2dd('0x12')]);}else{logger[_0xd2dd('0xc')](_0xd2dd('0x13'),_0x5595af,_0xd2dd('0xf'));_0x4aa334(_0x28520f[_0xd2dd('0x14')][_0xd2dd('0x12')]);}})[_0xd2dd('0x15')](function(_0x1dfc81){logger[_0xd2dd('0x11')](_0xd2dd('0x13'),_0x5595af,_0x1dfc81);_0x4b03a4(_0x1dfc81);});});}exports[_0xd2dd('0x16')]=function(_0x1e480e){var _0x4658b2=this;return new Promise(function(_0x233bf3,_0x372c77){return db[_0xd2dd('0x17')]['create'](_0x1e480e[_0xd2dd('0x18')],{'raw':_0x1e480e['options']?_0x1e480e['options'][_0xd2dd('0x19')]===undefined?!![]:![]:!![]})[_0xd2dd('0xb')](function(_0x560ffa){logger[_0xd2dd('0xc')](_0xd2dd('0x16'),_0x1e480e);logger['debug']('CreateSquareMessage',_0x1e480e,JSON['stringify'](_0x560ffa));_0x233bf3(_0x560ffa);})[_0xd2dd('0x15')](function(_0x38b1dc){logger['error'](_0xd2dd('0x16'),_0x38b1dc[_0xd2dd('0x12')],_0x1e480e);_0x372c77(_0x4658b2[_0xd2dd('0x11')](0x1f4,_0x38b1dc[_0xd2dd('0x12')]));});});}; \ No newline at end of file +var _0xbe78=['create','body','options','raw','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateSquareMessage','SquareMessage'];(function(_0x3dd822,_0x3b9fed){var _0x4f58d0=function(_0x41be33){while(--_0x41be33){_0x3dd822['push'](_0x3dd822['shift']());}};_0x4f58d0(++_0x3b9fed);}(_0xbe78,0x1c7));var _0x8be7=function(_0x3007a3,_0x4206f8){_0x3007a3=_0x3007a3-0x0;var _0x4f7d4c=_0xbe78[_0x3007a3];return _0x4f7d4c;};'use strict';var _=require(_0x8be7('0x0'));var util=require(_0x8be7('0x1'));var moment=require(_0x8be7('0x2'));var BPromise=require(_0x8be7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8be7('0x4'));var db=require(_0x8be7('0x5'))['db'];var utils=require(_0x8be7('0x6'));var logger=require(_0x8be7('0x7'))(_0x8be7('0x8'));var config=require(_0x8be7('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8be7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cc884,_0x38cf4a,_0xd5e5a5){return new BPromise(function(_0x36367b,_0x66c43c){return client[_0x8be7('0xb')](_0x5cc884,_0xd5e5a5)[_0x8be7('0xc')](function(_0x4766f3){logger['info'](_0x8be7('0xd'),_0x38cf4a,'request\x20sent');logger[_0x8be7('0xe')](_0x8be7('0xf'),_0x38cf4a,'request\x20sent',JSON[_0x8be7('0x10')](_0x4766f3));if(_0x4766f3[_0x8be7('0x11')]){if(_0x4766f3[_0x8be7('0x11')][_0x8be7('0x12')]===0x1f4){logger[_0x8be7('0x11')](_0x8be7('0xd'),_0x38cf4a,_0x4766f3[_0x8be7('0x11')][_0x8be7('0x13')]);return _0x66c43c(_0x4766f3[_0x8be7('0x11')][_0x8be7('0x13')]);}logger[_0x8be7('0x11')]('SquareMessage,\x20%s,\x20%s',_0x38cf4a,_0x4766f3[_0x8be7('0x11')]['message']);return _0x36367b(_0x4766f3['error']['message']);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x38cf4a,_0x8be7('0x14'));_0x36367b(_0x4766f3[_0x8be7('0x15')][_0x8be7('0x13')]);}})[_0x8be7('0x16')](function(_0x393e62){logger[_0x8be7('0x11')](_0x8be7('0xd'),_0x38cf4a,_0x393e62);_0x66c43c(_0x393e62);});});}exports[_0x8be7('0x17')]=function(_0x2b7aa7){var _0x39bd42=this;return new Promise(function(_0x716079,_0x157c56){return db[_0x8be7('0x18')][_0x8be7('0x19')](_0x2b7aa7[_0x8be7('0x1a')],{'raw':_0x2b7aa7[_0x8be7('0x1b')]?_0x2b7aa7['options'][_0x8be7('0x1c')]===undefined?!![]:![]:!![]})[_0x8be7('0xc')](function(_0x30a6a6){logger[_0x8be7('0x1d')]('CreateSquareMessage',_0x2b7aa7);logger[_0x8be7('0xe')](_0x8be7('0x17'),_0x2b7aa7,JSON[_0x8be7('0x10')](_0x30a6a6));_0x716079(_0x30a6a6);})[_0x8be7('0x16')](function(_0x3a9fb5){logger[_0x8be7('0x11')](_0x8be7('0x17'),_0x3a9fb5[_0x8be7('0x13')],_0x2b7aa7);_0x157c56(_0x39bd42[_0x8be7('0x11')](0x1f4,_0x3a9fb5[_0x8be7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index ec27020..ec44d35 100644 --- a/server/api/squareOdbc/index.js +++ b/server/api/squareOdbc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa06a=['../../config/environment','./squareOdbc.controller','get','index','/:id','isAuthenticated','show','/:id/test','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2a276d,_0x482b0c){var _0x2914cd=function(_0x452b8b){while(--_0x452b8b){_0x2a276d['push'](_0x2a276d['shift']());}};_0x2914cd(++_0x482b0c);}(_0xa06a,0x158));var _0xaa06=function(_0xb8cd0a,_0x52d523){_0xb8cd0a=_0xb8cd0a-0x0;var _0x598b11=_0xa06a[_0xb8cd0a];return _0x598b11;};'use strict';var multer=require('multer');var util=require(_0xaa06('0x0'));var path=require(_0xaa06('0x1'));var timeout=require(_0xaa06('0x2'));var express=require(_0xaa06('0x3'));var router=express[_0xaa06('0x4')]();var fs_extra=require(_0xaa06('0x5'));var auth=require(_0xaa06('0x6'));var interaction=require(_0xaa06('0x7'));var config=require(_0xaa06('0x8'));var controller=require(_0xaa06('0x9'));router[_0xaa06('0xa')]('/',auth['isAuthenticated'](),controller[_0xaa06('0xb')]);router[_0xaa06('0xa')](_0xaa06('0xc'),auth[_0xaa06('0xd')](),controller[_0xaa06('0xe')]);router['get'](_0xaa06('0xf'),auth[_0xaa06('0xd')](),timeout('15s'),controller['test']);router[_0xaa06('0x10')]('/',auth[_0xaa06('0xd')](),controller[_0xaa06('0x11')]);router[_0xaa06('0x12')](_0xaa06('0xc'),auth[_0xaa06('0xd')](),controller['update']);router[_0xaa06('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xaa06('0x14')]);module[_0xaa06('0x15')]=router; \ No newline at end of file +var _0x5313=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index','/:id','isAuthenticated','show','/:id/test','post','create','put','update','delete','destroy','exports'];(function(_0x52c33c,_0x423b38){var _0x3c7a84=function(_0x503345){while(--_0x503345){_0x52c33c['push'](_0x52c33c['shift']());}};_0x3c7a84(++_0x423b38);}(_0x5313,0x108));var _0x3531=function(_0xb7b284,_0xa1131e){_0xb7b284=_0xb7b284-0x0;var _0x825f3a=_0x5313[_0xb7b284];return _0x825f3a;};'use strict';var multer=require('multer');var util=require(_0x3531('0x0'));var path=require(_0x3531('0x1'));var timeout=require('connect-timeout');var express=require(_0x3531('0x2'));var router=express[_0x3531('0x3')]();var fs_extra=require(_0x3531('0x4'));var auth=require(_0x3531('0x5'));var interaction=require(_0x3531('0x6'));var config=require(_0x3531('0x7'));var controller=require(_0x3531('0x8'));router[_0x3531('0x9')]('/',auth['isAuthenticated'](),controller[_0x3531('0xa')]);router[_0x3531('0x9')](_0x3531('0xb'),auth[_0x3531('0xc')](),controller[_0x3531('0xd')]);router[_0x3531('0x9')](_0x3531('0xe'),auth[_0x3531('0xc')](),timeout('15s'),controller['test']);router[_0x3531('0xf')]('/',auth[_0x3531('0xc')](),controller[_0x3531('0x10')]);router[_0x3531('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3531('0x12')]);router[_0x3531('0x13')](_0x3531('0xb'),auth[_0x3531('0xc')](),controller[_0x3531('0x14')]);module[_0x3531('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 9e69a8a..dae80fe 100644 --- a/server/api/squareOdbc/squareOdbc.attributes.js +++ b/server/api/squareOdbc/squareOdbc.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf167=['STRING','name','sequelize'];(function(_0x5d8631,_0x44944b){var _0x34c15e=function(_0x4448f8){while(--_0x4448f8){_0x5d8631['push'](_0x5d8631['shift']());}};_0x34c15e(++_0x44944b);}(_0xf167,0x146));var _0x7f16=function(_0x1d603a,_0x2b814e){_0x1d603a=_0x1d603a-0x0;var _0x4b76b4=_0xf167[_0x1d603a];return _0x4b76b4;};'use strict';var Sequelize=require(_0x7f16('0x0'));module['exports']={'name':{'type':Sequelize[_0x7f16('0x1')],'unique':_0x7f16('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x7f16('0x1')]},'description':{'type':Sequelize[_0x7f16('0x1')]}}; \ No newline at end of file +var _0xae7a=['STRING','name','exports'];(function(_0x283ab2,_0x504c73){var _0x2e501c=function(_0x1a30dd){while(--_0x1a30dd){_0x283ab2['push'](_0x283ab2['shift']());}};_0x2e501c(++_0x504c73);}(_0xae7a,0x98));var _0xaae7=function(_0x19dd8a,_0x449861){_0x19dd8a=_0x19dd8a-0x0;var _0x212ccc=_0xae7a[_0x19dd8a];return _0x212ccc;};'use strict';var Sequelize=require('sequelize');module[_0xaae7('0x0')]={'name':{'type':Sequelize[_0xaae7('0x1')],'unique':_0xaae7('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xaae7('0x1')]},'description':{'type':Sequelize[_0xaae7('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 822ddac..8447d84 100644 --- a/server/api/squareOdbc/squareOdbc.controller.js +++ b/server/api/squareOdbc/squareOdbc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe898=['filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','SquareOdbc','filters','create','body','user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','dsn','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick'];(function(_0x339cbe,_0x38a898){var _0x2fe6d2=function(_0x1c4645){while(--_0x1c4645){_0x339cbe['push'](_0x339cbe['shift']());}};_0x2fe6d2(++_0x38a898);}(_0xe898,0x175));var _0x8e89=function(_0x29bfbe,_0x37060a){_0x29bfbe=_0x29bfbe-0x0;var _0x230663=_0xe898[_0x29bfbe];return _0x230663;};'use strict';var emlformat=require(_0x8e89('0x0'));var rimraf=require(_0x8e89('0x1'));var zipdir=require(_0x8e89('0x2'));var jsonpatch=require(_0x8e89('0x3'));var rp=require(_0x8e89('0x4'));var moment=require('moment');var BPromise=require(_0x8e89('0x5'));var Mustache=require(_0x8e89('0x6'));var util=require(_0x8e89('0x7'));var path=require(_0x8e89('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8e89('0x9'));var fs=require('fs');var fs_extra=require(_0x8e89('0xa'));var _=require(_0x8e89('0xb'));var squel=require(_0x8e89('0xc'));var crypto=require('crypto');var jsforce=require(_0x8e89('0xd'));var deskjs=require(_0x8e89('0xe'));var toCsv=require(_0x8e89('0xf'));var querystring=require(_0x8e89('0x10'));var Papa=require(_0x8e89('0x11'));var Redis=require(_0x8e89('0x12'));var authService=require(_0x8e89('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8e89('0x14'));var hardwareService=require(_0x8e89('0x15'));var logger=require(_0x8e89('0x16'))('api');var utils=require(_0x8e89('0x17'));var config=require(_0x8e89('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c0e48,_0x23401b){_0x23401b=_0x23401b||0xcc;return function(_0x18e0a6){if(_0x18e0a6){return _0x1c0e48[_0x8e89('0x19')](_0x23401b);}return _0x1c0e48[_0x8e89('0x1a')](_0x23401b)[_0x8e89('0x1b')]();};}function respondWithResult(_0x4866df,_0x55b9c8){_0x55b9c8=_0x55b9c8||0xc8;return function(_0x5aa619){if(_0x5aa619){return _0x4866df[_0x8e89('0x1a')](_0x55b9c8)['json'](_0x5aa619);}};}function respondWithFilteredResult(_0x1787b8,_0x458500){return function(_0x18375a){if(_0x18375a){var _0x1130b0=typeof _0x458500['offset']===_0x8e89('0x1c')&&typeof _0x458500[_0x8e89('0x1d')]===_0x8e89('0x1c');var _0x43d8fb=_0x18375a['count'];var _0x2373d3=_0x1130b0?0x0:_0x458500[_0x8e89('0x1e')];var _0x4a57c5=_0x1130b0?_0x18375a[_0x8e89('0x1f')]:_0x458500['offset']+_0x458500['limit'];var _0x38065a;if(_0x4a57c5>=_0x43d8fb){_0x4a57c5=_0x43d8fb;_0x38065a=0xc8;}else{_0x38065a=0xce;}_0x1787b8[_0x8e89('0x1a')](_0x38065a);return _0x1787b8[_0x8e89('0x20')](_0x8e89('0x21'),_0x2373d3+'-'+_0x4a57c5+'/'+_0x43d8fb)[_0x8e89('0x22')](_0x18375a);}return null;};}function patchUpdates(_0x15fd1b){return function(_0x11509d){try{jsonpatch[_0x8e89('0x23')](_0x11509d,_0x15fd1b,!![]);}catch(_0x5d3e56){return BPromise[_0x8e89('0x24')](_0x5d3e56);}return _0x11509d[_0x8e89('0x25')]();};}function saveUpdates(_0x3708b2,_0x35668b){return function(_0xf8743f){if(_0xf8743f){return _0xf8743f[_0x8e89('0x26')](_0x3708b2)[_0x8e89('0x27')](function(_0x135324){return _0x135324;});}return null;};}function removeEntity(_0x7ba3a2,_0x675559){return function(_0x5c9685){if(_0x5c9685){return _0x5c9685['destroy']()[_0x8e89('0x27')](function(){var _0x599ccc=_0x5c9685[_0x8e89('0x28')]({'plain':!![]});var _0x51e61b='ODBC';return db['UserProfileResource'][_0x8e89('0x29')]({'where':{'type':_0x51e61b,'resourceId':_0x599ccc['id']}})['then'](function(){return _0x5c9685;});})[_0x8e89('0x27')](function(){_0x7ba3a2[_0x8e89('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51bc3c,_0xc77a37){return function(_0xbcfa8e){if(!_0xbcfa8e){_0x51bc3c[_0x8e89('0x19')](0x194);}return _0xbcfa8e;};}function handleError(_0x2a90fd,_0x395004){_0x395004=_0x395004||0x1f4;return function(_0x495e94){logger[_0x8e89('0x2a')](_0x495e94[_0x8e89('0x2b')]);if(_0x495e94['name']){delete _0x495e94[_0x8e89('0x2c')];}_0x2a90fd[_0x8e89('0x1a')](_0x395004)[_0x8e89('0x2d')](_0x495e94);};}exports[_0x8e89('0x2e')]=function(_0x164a64,_0x54607c){var _0x5c137c={},_0x252c4a={},_0x20f84={'count':0x0,'rows':[]};var _0x50032d=_[_0x8e89('0x2f')](db['SquareOdbc'][_0x8e89('0x30')],function(_0x173688){return{'name':_0x173688['fieldName'],'type':_0x173688[_0x8e89('0x31')][_0x8e89('0x32')]};});_0x252c4a['model']=_[_0x8e89('0x2f')](_0x50032d,'name');_0x252c4a[_0x8e89('0x33')]=_[_0x8e89('0x34')](_0x164a64['query']);_0x252c4a['filters']=_[_0x8e89('0x35')](_0x252c4a[_0x8e89('0x36')],_0x252c4a[_0x8e89('0x33')]);_0x5c137c[_0x8e89('0x37')]=_[_0x8e89('0x35')](_0x252c4a[_0x8e89('0x36')],qs[_0x8e89('0x38')](_0x164a64['query'][_0x8e89('0x38')]));_0x5c137c[_0x8e89('0x37')]=_0x5c137c[_0x8e89('0x37')][_0x8e89('0x39')]?_0x5c137c[_0x8e89('0x37')]:_0x252c4a['model'];if(!_0x164a64['query'][_0x8e89('0x3a')](_0x8e89('0x3b'))){_0x5c137c[_0x8e89('0x1d')]=qs['limit'](_0x164a64['query'][_0x8e89('0x1d')]);_0x5c137c[_0x8e89('0x1e')]=qs[_0x8e89('0x1e')](_0x164a64['query']['offset']);}_0x5c137c['order']=qs[_0x8e89('0x3c')](_0x164a64[_0x8e89('0x33')][_0x8e89('0x3c')]);_0x5c137c['where']=qs['filters'](_[_0x8e89('0x3d')](_0x164a64[_0x8e89('0x33')],_0x252c4a['filters']),_0x50032d);if(_0x164a64['query'][_0x8e89('0x3e')]){_0x5c137c[_0x8e89('0x3f')]=_[_0x8e89('0x40')](_0x5c137c[_0x8e89('0x3f')],{'$or':_[_0x8e89('0x2f')](_0x50032d,function(_0x3a7e24){if(_0x3a7e24[_0x8e89('0x31')]!==_0x8e89('0x41')){var _0x11e4e6={};_0x11e4e6[_0x3a7e24['name']]={'$like':'%'+_0x164a64[_0x8e89('0x33')][_0x8e89('0x3e')]+'%'};return _0x11e4e6;}})});}_0x5c137c=_[_0x8e89('0x40')]({},_0x5c137c,_0x164a64[_0x8e89('0x42')]);var _0x48837f={'where':_0x5c137c[_0x8e89('0x3f')]};return db['SquareOdbc']['count'](_0x48837f)[_0x8e89('0x27')](function(_0x81715){_0x20f84[_0x8e89('0x1f')]=_0x81715;if(_0x164a64['query'][_0x8e89('0x43')]){_0x5c137c[_0x8e89('0x44')]=[{'all':!![]}];}return db['SquareOdbc'][_0x8e89('0x45')](_0x5c137c);})[_0x8e89('0x27')](function(_0xcf200d){_0x20f84[_0x8e89('0x46')]=_0xcf200d;return _0x20f84;})['then'](respondWithFilteredResult(_0x54607c,_0x5c137c))[_0x8e89('0x47')](handleError(_0x54607c,null));};exports[_0x8e89('0x48')]=function(_0x508f1e,_0x47dd87){var _0x388489={'raw':!![],'where':{'id':_0x508f1e[_0x8e89('0x49')]['id']}},_0x530c63={};_0x530c63[_0x8e89('0x36')]=_['keys'](db[_0x8e89('0x4a')][_0x8e89('0x30')]);_0x530c63[_0x8e89('0x33')]=_[_0x8e89('0x34')](_0x508f1e[_0x8e89('0x33')]);_0x530c63[_0x8e89('0x4b')]=_[_0x8e89('0x35')](_0x530c63[_0x8e89('0x36')],_0x530c63['query']);_0x388489['attributes']=_[_0x8e89('0x35')](_0x530c63[_0x8e89('0x36')],qs['fields'](_0x508f1e[_0x8e89('0x33')][_0x8e89('0x38')]));_0x388489[_0x8e89('0x37')]=_0x388489[_0x8e89('0x37')][_0x8e89('0x39')]?_0x388489[_0x8e89('0x37')]:_0x530c63[_0x8e89('0x36')];if(_0x508f1e['query'][_0x8e89('0x43')]){_0x388489['include']=[{'all':!![]}];}_0x388489=_[_0x8e89('0x40')]({},_0x388489,_0x508f1e[_0x8e89('0x42')]);return db[_0x8e89('0x4a')]['find'](_0x388489)[_0x8e89('0x27')](handleEntityNotFound(_0x47dd87,null))['then'](respondWithResult(_0x47dd87,null))[_0x8e89('0x47')](handleError(_0x47dd87,null));};exports[_0x8e89('0x4c')]=function(_0x3ee90f,_0x6f7d0e){return db[_0x8e89('0x4a')][_0x8e89('0x4c')](_0x3ee90f[_0x8e89('0x4d')],{})['then'](function(_0x2a37e1){var _0x7d1eb7=_0x3ee90f[_0x8e89('0x4e')][_0x8e89('0x28')]({'plain':!![]});if(!_0x7d1eb7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7d1eb7[_0x8e89('0x4f')]===_0x8e89('0x4e')){var _0x4080d4=_0x2a37e1[_0x8e89('0x28')]({'plain':!![]});var _0x629394='ODBC';return db[_0x8e89('0x50')][_0x8e89('0x51')]({'where':{'name':_0x629394,'userProfileId':_0x7d1eb7['userProfileId']},'raw':!![]})[_0x8e89('0x27')](function(_0x3b7a05){if(_0x3b7a05&&_0x3b7a05[_0x8e89('0x52')]===0x0){return db[_0x8e89('0x53')][_0x8e89('0x4c')]({'name':_0x4080d4[_0x8e89('0x2c')],'resourceId':_0x4080d4['id'],'type':_0x3b7a05[_0x8e89('0x2c')],'sectionId':_0x3b7a05['id']},{})['then'](function(){return _0x2a37e1;});}else{return _0x2a37e1;}})[_0x8e89('0x47')](function(_0x18a07d){logger[_0x8e89('0x2a')](_0x8e89('0x54'),_0x18a07d);throw _0x18a07d;});}return _0x2a37e1;})[_0x8e89('0x27')](respondWithResult(_0x6f7d0e,0xc9))[_0x8e89('0x47')](handleError(_0x6f7d0e,null));};exports['update']=function(_0x108b49,_0x2c1999){if(_0x108b49[_0x8e89('0x4d')]['id']){delete _0x108b49[_0x8e89('0x4d')]['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x108b49[_0x8e89('0x49')]['id']}})['then'](handleEntityNotFound(_0x2c1999,null))['then'](saveUpdates(_0x108b49['body'],null))[_0x8e89('0x27')](respondWithResult(_0x2c1999,null))['catch'](handleError(_0x2c1999,null));};exports[_0x8e89('0x29')]=function(_0x477aca,_0x38c254){return db['SquareOdbc'][_0x8e89('0x51')]({'where':{'id':_0x477aca[_0x8e89('0x49')]['id']}})['then'](handleEntityNotFound(_0x38c254,null))[_0x8e89('0x27')](removeEntity(_0x38c254,null))[_0x8e89('0x47')](handleError(_0x38c254,null));};exports['test']=function(_0x124b7a,_0x1fb913,_0x2f7257){var _0x22fef9;return db['SquareOdbc'][_0x8e89('0x51')]({'where':{'id':_0x124b7a[_0x8e89('0x49')]['id']},'attributes':['id',_0x8e89('0x55')]})['then'](handleEntityNotFound(_0x1fb913,null))[_0x8e89('0x27')](function(_0x296103){if(_0x296103){var _0x11d7ec=require('odbc')();_0x11d7ec['openSync'](_0x296103[_0x8e89('0x55')]);_0x11d7ec[_0x8e89('0x56')]();return _0x296103;}})[_0x8e89('0x27')](respondWithResult(_0x1fb913,null))[_0x8e89('0x47')](handleError(_0x1fb913,null));}; \ No newline at end of file +var _0x909e=['index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','test','openSync','dsn','closeSync','eml-format','rimraf','fast-json-patch','moment','mustache','util','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','set','json','reject','save','destroy','then','get','ODBC','error','name','send'];(function(_0x3140da,_0x36f1fe){var _0xcc825a=function(_0x580484){while(--_0x580484){_0x3140da['push'](_0x3140da['shift']());}};_0xcc825a(++_0x36f1fe);}(_0x909e,0x131));var _0xe909=function(_0xe5865c,_0x14ceb2){_0xe5865c=_0xe5865c-0x0;var _0x95f84a=_0x909e[_0xe5865c];return _0x95f84a;};'use strict';var emlformat=require(_0xe909('0x0'));var rimraf=require(_0xe909('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe909('0x2'));var rp=require('request-promise');var moment=require(_0xe909('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe909('0x4'));var util=require(_0xe909('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe909('0x6'));var fs=require('fs');var fs_extra=require(_0xe909('0x7'));var _=require(_0xe909('0x8'));var squel=require(_0xe909('0x9'));var crypto=require(_0xe909('0xa'));var jsforce=require(_0xe909('0xb'));var deskjs=require(_0xe909('0xc'));var toCsv=require(_0xe909('0xd'));var querystring=require('querystring');var Papa=require(_0xe909('0xe'));var Redis=require('ioredis');var authService=require(_0xe909('0xf'));var qs=require(_0xe909('0x10'));var as=require(_0xe909('0x11'));var hardwareService=require(_0xe909('0x12'));var logger=require(_0xe909('0x13'))(_0xe909('0x14'));var utils=require(_0xe909('0x15'));var config=require(_0xe909('0x16'));var licenseUtil=require(_0xe909('0x17'));var db=require(_0xe909('0x18'))['db'];function respondWithStatusCode(_0x18e470,_0x58e579){_0x58e579=_0x58e579||0xcc;return function(_0x4fbe85){if(_0x4fbe85){return _0x18e470[_0xe909('0x19')](_0x58e579);}return _0x18e470['status'](_0x58e579)[_0xe909('0x1a')]();};}function respondWithResult(_0x2940ae,_0x14630a){_0x14630a=_0x14630a||0xc8;return function(_0x1aca1e){if(_0x1aca1e){return _0x2940ae['status'](_0x14630a)['json'](_0x1aca1e);}};}function respondWithFilteredResult(_0x48408d,_0x3f1c44){return function(_0xdf5748){if(_0xdf5748){var _0x48f817=typeof _0x3f1c44[_0xe909('0x1b')]==='undefined'&&typeof _0x3f1c44[_0xe909('0x1c')]===_0xe909('0x1d');var _0x3bcb2a=_0xdf5748[_0xe909('0x1e')];var _0x20ba1d=_0x48f817?0x0:_0x3f1c44['offset'];var _0x4c8f96=_0x48f817?_0xdf5748[_0xe909('0x1e')]:_0x3f1c44[_0xe909('0x1b')]+_0x3f1c44[_0xe909('0x1c')];var _0x31f070;if(_0x4c8f96>=_0x3bcb2a){_0x4c8f96=_0x3bcb2a;_0x31f070=0xc8;}else{_0x31f070=0xce;}_0x48408d[_0xe909('0x1f')](_0x31f070);return _0x48408d[_0xe909('0x20')]('Content-Range',_0x20ba1d+'-'+_0x4c8f96+'/'+_0x3bcb2a)[_0xe909('0x21')](_0xdf5748);}return null;};}function patchUpdates(_0x3497c7){return function(_0x4e1975){try{jsonpatch['apply'](_0x4e1975,_0x3497c7,!![]);}catch(_0x16f7fc){return BPromise[_0xe909('0x22')](_0x16f7fc);}return _0x4e1975[_0xe909('0x23')]();};}function saveUpdates(_0x3ef5b9,_0x53ada3){return function(_0x39cea4){if(_0x39cea4){return _0x39cea4['update'](_0x3ef5b9)['then'](function(_0x262752){return _0x262752;});}return null;};}function removeEntity(_0x2e150b,_0x30f030){return function(_0x21d793){if(_0x21d793){return _0x21d793[_0xe909('0x24')]()[_0xe909('0x25')](function(){var _0x357513=_0x21d793[_0xe909('0x26')]({'plain':!![]});var _0x450d77=_0xe909('0x27');return db['UserProfileResource'][_0xe909('0x24')]({'where':{'type':_0x450d77,'resourceId':_0x357513['id']}})['then'](function(){return _0x21d793;});})[_0xe909('0x25')](function(){_0x2e150b[_0xe909('0x1f')](0xcc)[_0xe909('0x1a')]();});}};}function handleEntityNotFound(_0x3eef62,_0x4e3a1e){return function(_0x1ac0c9){if(!_0x1ac0c9){_0x3eef62[_0xe909('0x19')](0x194);}return _0x1ac0c9;};}function handleError(_0x11d9ef,_0x23a831){_0x23a831=_0x23a831||0x1f4;return function(_0x5c07f4){logger[_0xe909('0x28')](_0x5c07f4['stack']);if(_0x5c07f4[_0xe909('0x29')]){delete _0x5c07f4[_0xe909('0x29')];}_0x11d9ef[_0xe909('0x1f')](_0x23a831)[_0xe909('0x2a')](_0x5c07f4);};}exports[_0xe909('0x2b')]=function(_0x41b4ff,_0x2243e9){var _0x5e8c35={},_0x54ee0f={},_0x43c9e5={'count':0x0,'rows':[]};var _0x273dca=_[_0xe909('0x2c')](db[_0xe909('0x2d')][_0xe909('0x2e')],function(_0x1c7900){return{'name':_0x1c7900[_0xe909('0x2f')],'type':_0x1c7900[_0xe909('0x30')][_0xe909('0x31')]};});_0x54ee0f[_0xe909('0x32')]=_[_0xe909('0x2c')](_0x273dca,_0xe909('0x29'));_0x54ee0f[_0xe909('0x33')]=_[_0xe909('0x34')](_0x41b4ff[_0xe909('0x33')]);_0x54ee0f[_0xe909('0x35')]=_[_0xe909('0x36')](_0x54ee0f[_0xe909('0x32')],_0x54ee0f['query']);_0x5e8c35[_0xe909('0x37')]=_['intersection'](_0x54ee0f['model'],qs[_0xe909('0x38')](_0x41b4ff[_0xe909('0x33')][_0xe909('0x38')]));_0x5e8c35[_0xe909('0x37')]=_0x5e8c35[_0xe909('0x37')][_0xe909('0x39')]?_0x5e8c35[_0xe909('0x37')]:_0x54ee0f[_0xe909('0x32')];if(!_0x41b4ff[_0xe909('0x33')]['hasOwnProperty']('nolimit')){_0x5e8c35[_0xe909('0x1c')]=qs[_0xe909('0x1c')](_0x41b4ff[_0xe909('0x33')]['limit']);_0x5e8c35['offset']=qs[_0xe909('0x1b')](_0x41b4ff[_0xe909('0x33')][_0xe909('0x1b')]);}_0x5e8c35[_0xe909('0x3a')]=qs[_0xe909('0x3b')](_0x41b4ff[_0xe909('0x33')]['sort']);_0x5e8c35[_0xe909('0x3c')]=qs['filters'](_[_0xe909('0x3d')](_0x41b4ff[_0xe909('0x33')],_0x54ee0f[_0xe909('0x35')]),_0x273dca);if(_0x41b4ff[_0xe909('0x33')][_0xe909('0x3e')]){_0x5e8c35[_0xe909('0x3c')]=_[_0xe909('0x3f')](_0x5e8c35['where'],{'$or':_[_0xe909('0x2c')](_0x273dca,function(_0x1455e1){if(_0x1455e1['type']!==_0xe909('0x40')){var _0x14bf86={};_0x14bf86[_0x1455e1[_0xe909('0x29')]]={'$like':'%'+_0x41b4ff[_0xe909('0x33')]['filter']+'%'};return _0x14bf86;}})});}_0x5e8c35=_[_0xe909('0x3f')]({},_0x5e8c35,_0x41b4ff[_0xe909('0x41')]);var _0x1f4fc3={'where':_0x5e8c35[_0xe909('0x3c')]};return db['SquareOdbc'][_0xe909('0x1e')](_0x1f4fc3)[_0xe909('0x25')](function(_0x3ecefc){_0x43c9e5[_0xe909('0x1e')]=_0x3ecefc;if(_0x41b4ff[_0xe909('0x33')][_0xe909('0x42')]){_0x5e8c35[_0xe909('0x43')]=[{'all':!![]}];}return db[_0xe909('0x2d')][_0xe909('0x44')](_0x5e8c35);})[_0xe909('0x25')](function(_0x49eea6){_0x43c9e5[_0xe909('0x45')]=_0x49eea6;return _0x43c9e5;})[_0xe909('0x25')](respondWithFilteredResult(_0x2243e9,_0x5e8c35))[_0xe909('0x46')](handleError(_0x2243e9,null));};exports[_0xe909('0x47')]=function(_0x304dfb,_0x276254){var _0x49f41f={'raw':!![],'where':{'id':_0x304dfb['params']['id']}},_0x5ebb00={};_0x5ebb00[_0xe909('0x32')]=_[_0xe909('0x34')](db[_0xe909('0x2d')][_0xe909('0x2e')]);_0x5ebb00[_0xe909('0x33')]=_[_0xe909('0x34')](_0x304dfb['query']);_0x5ebb00['filters']=_[_0xe909('0x36')](_0x5ebb00[_0xe909('0x32')],_0x5ebb00['query']);_0x49f41f[_0xe909('0x37')]=_[_0xe909('0x36')](_0x5ebb00[_0xe909('0x32')],qs[_0xe909('0x38')](_0x304dfb[_0xe909('0x33')][_0xe909('0x38')]));_0x49f41f['attributes']=_0x49f41f[_0xe909('0x37')][_0xe909('0x39')]?_0x49f41f[_0xe909('0x37')]:_0x5ebb00[_0xe909('0x32')];if(_0x304dfb['query'][_0xe909('0x42')]){_0x49f41f[_0xe909('0x43')]=[{'all':!![]}];}_0x49f41f=_['merge']({},_0x49f41f,_0x304dfb['options']);return db[_0xe909('0x2d')][_0xe909('0x48')](_0x49f41f)[_0xe909('0x25')](handleEntityNotFound(_0x276254,null))[_0xe909('0x25')](respondWithResult(_0x276254,null))['catch'](handleError(_0x276254,null));};exports[_0xe909('0x49')]=function(_0x4e2294,_0x48314d){return db['SquareOdbc'][_0xe909('0x49')](_0x4e2294[_0xe909('0x4a')],{})['then'](function(_0x47bc80){var _0x2283a1=_0x4e2294[_0xe909('0x4b')]['get']({'plain':!![]});if(!_0x2283a1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2283a1[_0xe909('0x4c')]==='user'){var _0x1a9923=_0x47bc80[_0xe909('0x26')]({'plain':!![]});var _0x58ffc8='ODBC';return db[_0xe909('0x4d')][_0xe909('0x48')]({'where':{'name':_0x58ffc8,'userProfileId':_0x2283a1[_0xe909('0x4e')]},'raw':!![]})[_0xe909('0x25')](function(_0x4eb58a){if(_0x4eb58a&&_0x4eb58a['autoAssociation']===0x0){return db[_0xe909('0x4f')][_0xe909('0x49')]({'name':_0x1a9923[_0xe909('0x29')],'resourceId':_0x1a9923['id'],'type':_0x4eb58a[_0xe909('0x29')],'sectionId':_0x4eb58a['id']},{})['then'](function(){return _0x47bc80;});}else{return _0x47bc80;}})['catch'](function(_0x2ad155){logger[_0xe909('0x28')](_0xe909('0x50'),_0x2ad155);throw _0x2ad155;});}return _0x47bc80;})[_0xe909('0x25')](respondWithResult(_0x48314d,0xc9))['catch'](handleError(_0x48314d,null));};exports[_0xe909('0x51')]=function(_0x47229a,_0x1b52ad){if(_0x47229a['body']['id']){delete _0x47229a[_0xe909('0x4a')]['id'];}return db['SquareOdbc'][_0xe909('0x48')]({'where':{'id':_0x47229a['params']['id']}})[_0xe909('0x25')](handleEntityNotFound(_0x1b52ad,null))['then'](saveUpdates(_0x47229a[_0xe909('0x4a')],null))[_0xe909('0x25')](respondWithResult(_0x1b52ad,null))[_0xe909('0x46')](handleError(_0x1b52ad,null));};exports[_0xe909('0x24')]=function(_0x1f265f,_0x690750){return db[_0xe909('0x2d')]['find']({'where':{'id':_0x1f265f[_0xe909('0x52')]['id']}})[_0xe909('0x25')](handleEntityNotFound(_0x690750,null))['then'](removeEntity(_0x690750,null))[_0xe909('0x46')](handleError(_0x690750,null));};exports[_0xe909('0x53')]=function(_0x117eb2,_0x386e75,_0x571d1f){var _0x11152c;return db[_0xe909('0x2d')][_0xe909('0x48')]({'where':{'id':_0x117eb2[_0xe909('0x52')]['id']},'attributes':['id','dsn']})[_0xe909('0x25')](handleEntityNotFound(_0x386e75,null))[_0xe909('0x25')](function(_0x34b3b6){if(_0x34b3b6){var _0xe9bd87=require('odbc')();_0xe9bd87[_0xe909('0x54')](_0x34b3b6[_0xe909('0x55')]);_0xe9bd87[_0xe909('0x56')]();return _0x34b3b6;}})[_0xe909('0x25')](respondWithResult(_0x386e75,null))['catch'](handleError(_0x386e75,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 6ab3f94..06334a2 100644 --- a/server/api/squareOdbc/squareOdbc.model.js +++ b/server/api/squareOdbc/squareOdbc.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa685=['path','rimraf','./squareOdbc.attributes','exports','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4aba15,_0x4e90aa){var _0x1c8122=function(_0x568dba){while(--_0x568dba){_0x4aba15['push'](_0x4aba15['shift']());}};_0x1c8122(++_0x4e90aa);}(_0xa685,0x1cd));var _0x5a68=function(_0x5a7618,_0x3f44c2){_0x5a7618=_0x5a7618-0x0;var _0x12dc65=_0xa685[_0x5a7618];return _0x12dc65;};'use strict';var _=require(_0x5a68('0x0'));var util=require(_0x5a68('0x1'));var logger=require(_0x5a68('0x2'))(_0x5a68('0x3'));var moment=require(_0x5a68('0x4'));var BPromise=require(_0x5a68('0x5'));var rp=require(_0x5a68('0x6'));var fs=require('fs');var path=require(_0x5a68('0x7'));var rimraf=require(_0x5a68('0x8'));var config=require('../../config/environment');var attributes=require(_0x5a68('0x9'));module[_0x5a68('0xa')]=function(_0x289d0c,_0x172da5){return _0x289d0c['define'](_0x5a68('0xb'),attributes,{'tableName':_0x5a68('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d9b=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','define','lodash'];(function(_0x1df2f5,_0x1f7f66){var _0x3850d8=function(_0x810a8e){while(--_0x810a8e){_0x1df2f5['push'](_0x1df2f5['shift']());}};_0x3850d8(++_0x1f7f66);}(_0x3d9b,0x1ee));var _0xb3d9=function(_0x2ba218,_0x504da8){_0x2ba218=_0x2ba218-0x0;var _0x4ef0df=_0x3d9b[_0x2ba218];return _0x4ef0df;};'use strict';var _=require(_0xb3d9('0x0'));var util=require('util');var logger=require(_0xb3d9('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb3d9('0x2'));var rp=require(_0xb3d9('0x3'));var fs=require('fs');var path=require(_0xb3d9('0x4'));var rimraf=require(_0xb3d9('0x5'));var config=require(_0xb3d9('0x6'));var attributes=require(_0xb3d9('0x7'));module['exports']=function(_0x3caff1,_0x348993){return _0x3caff1[_0xb3d9('0x8')]('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 93607c9..85f55da 100644 --- a/server/api/squareOdbc/squareOdbc.rpc.js +++ b/server/api/squareOdbc/squareOdbc.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e85=['message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','info','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareOdbc,\x20%s,\x20%s'];(function(_0x3906d2,_0x4b3aab){var _0x5d74c8=function(_0x2ab97c){while(--_0x2ab97c){_0x3906d2['push'](_0x3906d2['shift']());}};_0x5d74c8(++_0x4b3aab);}(_0x6e85,0x14d));var _0x56e8=function(_0x150079,_0x2326a7){_0x150079=_0x150079-0x0;var _0x47fded=_0x6e85[_0x150079];return _0x47fded;};'use strict';var _=require('lodash');var util=require(_0x56e8('0x0'));var moment=require(_0x56e8('0x1'));var BPromise=require(_0x56e8('0x2'));var rs=require(_0x56e8('0x3'));var fs=require('fs');var Redis=require(_0x56e8('0x4'));var db=require(_0x56e8('0x5'))['db'];var utils=require(_0x56e8('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x56e8('0x7'));var jayson=require(_0x56e8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5506a7,_0x24d41c,_0x4de142){return new BPromise(function(_0xf3a541,_0x226edf){return client[_0x56e8('0x9')](_0x5506a7,_0x4de142)[_0x56e8('0xa')](function(_0x750421){logger[_0x56e8('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x24d41c,'request\x20sent');logger[_0x56e8('0xc')](_0x56e8('0xd'),_0x24d41c,_0x56e8('0xe'),JSON[_0x56e8('0xf')](_0x750421));if(_0x750421[_0x56e8('0x10')]){if(_0x750421[_0x56e8('0x10')][_0x56e8('0x11')]===0x1f4){logger[_0x56e8('0x10')](_0x56e8('0x12'),_0x24d41c,_0x750421['error']['message']);return _0x226edf(_0x750421[_0x56e8('0x10')]['message']);}logger[_0x56e8('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x24d41c,_0x750421[_0x56e8('0x10')][_0x56e8('0x13')]);return _0xf3a541(_0x750421[_0x56e8('0x10')][_0x56e8('0x13')]);}else{logger[_0x56e8('0xb')](_0x56e8('0x12'),_0x24d41c,_0x56e8('0xe'));_0xf3a541(_0x750421[_0x56e8('0x14')][_0x56e8('0x13')]);}})[_0x56e8('0x15')](function(_0x4bc6b6){logger[_0x56e8('0x10')](_0x56e8('0x12'),_0x24d41c,_0x4bc6b6);_0x226edf(_0x4bc6b6);});});}exports[_0x56e8('0x16')]=function(_0x1dd598){var _0x504ffd=this;return new Promise(function(_0x8e960a,_0xeae7fc){return db[_0x56e8('0x17')][_0x56e8('0x18')]({'raw':_0x1dd598[_0x56e8('0x19')]?_0x1dd598['options'][_0x56e8('0x1a')]===undefined?!![]:![]:!![],'where':_0x1dd598[_0x56e8('0x19')]?_0x1dd598[_0x56e8('0x19')][_0x56e8('0x1b')]||null:null,'attributes':_0x1dd598[_0x56e8('0x19')]?_0x1dd598[_0x56e8('0x19')][_0x56e8('0x1c')]||null:null,'include':_0x1dd598['options']?_0x1dd598[_0x56e8('0x19')][_0x56e8('0x1d')]?_[_0x56e8('0x1e')](_0x1dd598[_0x56e8('0x19')]['include'],function(_0x23fa69){return{'model':db[_0x23fa69[_0x56e8('0x1f')]],'as':_0x23fa69['as'],'attributes':_0x23fa69[_0x56e8('0x1c')],'include':_0x23fa69[_0x56e8('0x1d')]?_['map'](_0x23fa69['include'],function(_0x4f27f0){return{'model':db[_0x4f27f0['model']],'as':_0x4f27f0['as'],'attributes':_0x4f27f0['attributes'],'include':_0x4f27f0[_0x56e8('0x1d')]?_['map'](_0x4f27f0[_0x56e8('0x1d')],function(_0x33272a){return{'model':db[_0x33272a[_0x56e8('0x1f')]],'as':_0x33272a['as'],'attributes':_0x33272a[_0x56e8('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x37cb3e){logger[_0x56e8('0xb')]('ShowSquareOdbc',_0x1dd598);logger[_0x56e8('0xc')](_0x56e8('0x16'),_0x1dd598,JSON['stringify'](_0x37cb3e));_0x8e960a(_0x37cb3e);})[_0x56e8('0x15')](function(_0x53d456){logger[_0x56e8('0x10')](_0x56e8('0x16'),_0x53d456[_0x56e8('0x13')],_0x1dd598);_0xeae7fc(_0x504ffd[_0x56e8('0x10')](0x1f4,_0x53d456[_0x56e8('0x13')]));});});}; \ No newline at end of file +var _0x594b=['SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','SquareOdbc','options','raw','include','map','model','attributes','debug','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','request\x20sent','stringify','error','code'];(function(_0x2b8816,_0x2c5dac){var _0x4da4a3=function(_0x28baac){while(--_0x28baac){_0x2b8816['push'](_0x2b8816['shift']());}};_0x4da4a3(++_0x2c5dac);}(_0x594b,0x79));var _0xb594=function(_0xc359dc,_0x2e48f3){_0xc359dc=_0xc359dc-0x0;var _0x2c94e3=_0x594b[_0xc359dc];return _0x2c94e3;};'use strict';var _=require('lodash');var util=require(_0xb594('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb594('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb594('0x2'))['db'];var utils=require(_0xb594('0x3'));var logger=require(_0xb594('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb594('0x5'));var client=jayson[_0xb594('0x6')][_0xb594('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1140fa,_0x580500,_0x3a6546){return new BPromise(function(_0x52a70f,_0x5a7ebf){return client['request'](_0x1140fa,_0x3a6546)[_0xb594('0x8')](function(_0x9bd155){logger[_0xb594('0x9')]('SquareOdbc,\x20%s,\x20%s',_0x580500,_0xb594('0xa'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x580500,_0xb594('0xa'),JSON[_0xb594('0xb')](_0x9bd155));if(_0x9bd155[_0xb594('0xc')]){if(_0x9bd155[_0xb594('0xc')][_0xb594('0xd')]===0x1f4){logger['error'](_0xb594('0xe'),_0x580500,_0x9bd155['error']['message']);return _0x5a7ebf(_0x9bd155[_0xb594('0xc')][_0xb594('0xf')]);}logger['error'](_0xb594('0xe'),_0x580500,_0x9bd155[_0xb594('0xc')][_0xb594('0xf')]);return _0x52a70f(_0x9bd155[_0xb594('0xc')]['message']);}else{logger[_0xb594('0x9')](_0xb594('0xe'),_0x580500,_0xb594('0xa'));_0x52a70f(_0x9bd155[_0xb594('0x10')][_0xb594('0xf')]);}})[_0xb594('0x11')](function(_0xf7b7f8){logger['error'](_0xb594('0xe'),_0x580500,_0xf7b7f8);_0x5a7ebf(_0xf7b7f8);});});}exports[_0xb594('0x12')]=function(_0x492b75){var _0x437fcb=this;return new Promise(function(_0x3b6ec8,_0x391ccb){return db[_0xb594('0x13')]['find']({'raw':_0x492b75[_0xb594('0x14')]?_0x492b75[_0xb594('0x14')][_0xb594('0x15')]===undefined?!![]:![]:!![],'where':_0x492b75[_0xb594('0x14')]?_0x492b75['options']['where']||null:null,'attributes':_0x492b75['options']?_0x492b75[_0xb594('0x14')]['attributes']||null:null,'include':_0x492b75[_0xb594('0x14')]?_0x492b75[_0xb594('0x14')][_0xb594('0x16')]?_[_0xb594('0x17')](_0x492b75[_0xb594('0x14')][_0xb594('0x16')],function(_0x52b33f){return{'model':db[_0x52b33f[_0xb594('0x18')]],'as':_0x52b33f['as'],'attributes':_0x52b33f[_0xb594('0x19')],'include':_0x52b33f[_0xb594('0x16')]?_[_0xb594('0x17')](_0x52b33f['include'],function(_0xe94efb){return{'model':db[_0xe94efb['model']],'as':_0xe94efb['as'],'attributes':_0xe94efb[_0xb594('0x19')],'include':_0xe94efb['include']?_['map'](_0xe94efb[_0xb594('0x16')],function(_0x34583f){return{'model':db[_0x34583f[_0xb594('0x18')]],'as':_0x34583f['as'],'attributes':_0x34583f[_0xb594('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb594('0x8')](function(_0x1b7e7f){logger[_0xb594('0x9')](_0xb594('0x12'),_0x492b75);logger[_0xb594('0x1a')](_0xb594('0x12'),_0x492b75,JSON[_0xb594('0xb')](_0x1b7e7f));_0x3b6ec8(_0x1b7e7f);})[_0xb594('0x11')](function(_0x514839){logger[_0xb594('0xc')](_0xb594('0x12'),_0x514839['message'],_0x492b75);_0x391ccb(_0x437fcb[_0xb594('0xc')](0x1f4,_0x514839[_0xb594('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 82eb109..d667398 100644 --- a/server/api/squareProject/index.js +++ b/server/api/squareProject/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e99=['../../config/environment','./squareProject.controller','get','show','create','put','/:id','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x18928d,_0x457833){var _0x4520f1=function(_0x507c94){while(--_0x507c94){_0x18928d['push'](_0x18928d['shift']());}};_0x4520f1(++_0x457833);}(_0x7e99,0x81));var _0x97e9=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x7e99[_0x513aa5];return _0x1a1a7c;};'use strict';var multer=require(_0x97e9('0x0'));var util=require(_0x97e9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x97e9('0x2'));var router=express[_0x97e9('0x3')]();var fs_extra=require(_0x97e9('0x4'));var auth=require(_0x97e9('0x5'));var interaction=require(_0x97e9('0x6'));var config=require(_0x97e9('0x7'));var controller=require(_0x97e9('0x8'));router[_0x97e9('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x97e9('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x97e9('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x97e9('0xb')]);router[_0x97e9('0xc')](_0x97e9('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x97e9('0xe')](_0x97e9('0xd'),auth['isAuthenticated'](),controller[_0x97e9('0xf')]);module[_0x97e9('0x10')]=router; \ No newline at end of file +var _0xab6a=['show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id'];(function(_0x264bb5,_0x106b82){var _0x519516=function(_0xe1341f){while(--_0xe1341f){_0x264bb5['push'](_0x264bb5['shift']());}};_0x519516(++_0x106b82);}(_0xab6a,0x1ab));var _0xaab6=function(_0x22e3ec,_0x45c741){_0x22e3ec=_0x22e3ec-0x0;var _0xad2ecf=_0xab6a[_0x22e3ec];return _0xad2ecf;};'use strict';var multer=require(_0xaab6('0x0'));var util=require(_0xaab6('0x1'));var path=require('path');var timeout=require(_0xaab6('0x2'));var express=require(_0xaab6('0x3'));var router=express[_0xaab6('0x4')]();var fs_extra=require(_0xaab6('0x5'));var auth=require(_0xaab6('0x6'));var interaction=require(_0xaab6('0x7'));var config=require(_0xaab6('0x8'));var controller=require(_0xaab6('0x9'));router[_0xaab6('0xa')]('/',auth[_0xaab6('0xb')](),controller['index']);router[_0xaab6('0xa')](_0xaab6('0xc'),auth[_0xaab6('0xb')](),controller[_0xaab6('0xd')]);router[_0xaab6('0xe')]('/',auth[_0xaab6('0xb')](),controller[_0xaab6('0xf')]);router[_0xaab6('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xaab6('0x11')]);router[_0xaab6('0x12')](_0xaab6('0xc'),auth[_0xaab6('0xb')](),controller[_0xaab6('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 408b047..4a3caad 100644 --- a/server/api/squareProject/squareProject.attributes.js +++ b/server/api/squareProject/squareProject.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x514d=['toString','long','production','utf8','DATE','sequelize','exports','STRING','name','TEXT','BLOB','preproduction','getDataValue'];(function(_0x27ff27,_0x47898e){var _0x20fe26=function(_0x36f39e){while(--_0x36f39e){_0x27ff27['push'](_0x27ff27['shift']());}};_0x20fe26(++_0x47898e);}(_0x514d,0x87));var _0xd514=function(_0x5d314f,_0x349994){_0x5d314f=_0x5d314f-0x0;var _0xf2f268=_0x514d[_0x5d314f];return _0xf2f268;};'use strict';var Sequelize=require(_0xd514('0x0'));module[_0xd514('0x1')]={'name':{'type':Sequelize[_0xd514('0x2')],'unique':_0xd514('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xd514('0x2')]},'notes':{'type':Sequelize[_0xd514('0x4')]},'preproduction':{'type':Sequelize[_0xd514('0x5')]('long'),'get':function(){if(this['getDataValue'](_0xd514('0x6'))){return this[_0xd514('0x7')](_0xd514('0x6'))[_0xd514('0x8')]('utf8');}}},'production':{'type':Sequelize[_0xd514('0x5')](_0xd514('0x9')),'get':function(){if(this['getDataValue'](_0xd514('0xa'))){return this[_0xd514('0x7')](_0xd514('0xa'))[_0xd514('0x8')](_0xd514('0xb'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xd514('0xc')]}}; \ No newline at end of file +var _0x5f14=['utf8','getDataValue','production','toString','DATE','sequelize','exports','STRING','name','TEXT','BLOB','long','preproduction'];(function(_0x397019,_0x3bdb46){var _0x53a935=function(_0x43e19c){while(--_0x43e19c){_0x397019['push'](_0x397019['shift']());}};_0x53a935(++_0x3bdb46);}(_0x5f14,0x157));var _0x45f1=function(_0x2ba740,_0x62a305){_0x2ba740=_0x2ba740-0x0;var _0x358bda=_0x5f14[_0x2ba740];return _0x358bda;};'use strict';var Sequelize=require(_0x45f1('0x0'));module[_0x45f1('0x1')]={'name':{'type':Sequelize[_0x45f1('0x2')],'unique':_0x45f1('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x45f1('0x2')]},'notes':{'type':Sequelize[_0x45f1('0x4')]},'preproduction':{'type':Sequelize[_0x45f1('0x5')](_0x45f1('0x6')),'get':function(){if(this['getDataValue']('preproduction')){return this['getDataValue'](_0x45f1('0x7'))['toString'](_0x45f1('0x8'));}}},'production':{'type':Sequelize[_0x45f1('0x5')]('long'),'get':function(){if(this[_0x45f1('0x9')]('production')){return this[_0x45f1('0x9')](_0x45f1('0xa'))[_0x45f1('0xb')](_0x45f1('0x8'));}}},'savedAt':{'type':Sequelize[_0x45f1('0xc')]},'publishedAt':{'type':Sequelize[_0x45f1('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 90a366e..2f097c5 100644 --- a/server/api/squareProject/squareProject.controller.js +++ b/server/api/squareProject/squareProject.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x478a=['model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','rawAttributes','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SquareProjects','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','agi','stringify','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','undefined','limit','count','offset','set','then','destroy','get','UserProfileResource','publish','sendStatus','stack','name','send','SquareProject','fieldName','type','key'];(function(_0x282a31,_0x3db803){var _0x152786=function(_0x466b7b){while(--_0x466b7b){_0x282a31['push'](_0x282a31['shift']());}};_0x152786(++_0x3db803);}(_0x478a,0x180));var _0xa478=function(_0x1064f3,_0x1bd224){_0x1064f3=_0x1064f3-0x0;var _0x4889aa=_0x478a[_0x1064f3];return _0x4889aa;};'use strict';var _=require(_0xa478('0x0'));var Redis=require('ioredis');var qs=require(_0xa478('0x1'));var logger=require(_0xa478('0x2'))(_0xa478('0x3'));var config=require(_0xa478('0x4'));var db=require(_0xa478('0x5'))['db'];config[_0xa478('0x6')]=_[_0xa478('0x7')](config['redis'],{'host':_0xa478('0x8'),'port':0x18eb});var socket=require(_0xa478('0x9'))(new Redis(config[_0xa478('0x6')]));require('./squareProject.socket')[_0xa478('0xa')](socket);function respondWithResult(_0x288f8d,_0x3222b9){_0x3222b9=_0x3222b9||0xc8;return function(_0x4c87d8){if(_0x4c87d8){return _0x288f8d[_0xa478('0xb')](_0x3222b9)['json'](_0x4c87d8);}};}function respondWithFilteredResult(_0x47cbae,_0x1c4ecd){return function(_0x46fde6){if(_0x46fde6){var _0x38e7fd=typeof _0x1c4ecd['offset']===_0xa478('0xc')&&typeof _0x1c4ecd[_0xa478('0xd')]==='undefined';var _0xf35837=_0x46fde6[_0xa478('0xe')];var _0x3b30ab=_0x38e7fd?0x0:_0x1c4ecd[_0xa478('0xf')];var _0x1cfb55=_0x38e7fd?_0x46fde6[_0xa478('0xe')]:_0x1c4ecd['offset']+_0x1c4ecd[_0xa478('0xd')];var _0x22a086;if(_0x1cfb55>=_0xf35837){_0x1cfb55=_0xf35837;_0x22a086=0xc8;}else{_0x22a086=0xce;}_0x47cbae[_0xa478('0xb')](_0x22a086);return _0x47cbae[_0xa478('0x10')]('Content-Range',_0x3b30ab+'-'+_0x1cfb55+'/'+_0xf35837)['json'](_0x46fde6);}return null;};}function saveUpdates(_0x250421){return function(_0xcf90c9){if(_0xcf90c9){return _0xcf90c9['update'](_0x250421)[_0xa478('0x11')](function(_0x3e3d99){return _0x3e3d99;});}return null;};}function removeEntity(_0x329709){return function(_0x2aa340){if(_0x2aa340){return _0x2aa340[_0xa478('0x12')]()[_0xa478('0x11')](function(){var _0x436990=_0x2aa340[_0xa478('0x13')]({'plain':!![]});var _0x3e8bd6='SquareProjects';return db[_0xa478('0x14')][_0xa478('0x12')]({'where':{'type':_0x3e8bd6,'resourceId':_0x436990['id']}})[_0xa478('0x11')](function(){return _0x2aa340;});})[_0xa478('0x11')](function(){var _0x505fd0=new Redis(config[_0xa478('0x6')]);_0x505fd0[_0xa478('0x15')]('agi',JSON['stringify']({'id':_0x2aa340['id'],'deleted':!![]}));})[_0xa478('0x11')](function(){_0x329709[_0xa478('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bbce2){return function(_0x132381){if(!_0x132381){_0x5bbce2[_0xa478('0x16')](0x194);}return _0x132381;};}function handleError(_0x309b4a,_0x356482){_0x356482=_0x356482||0x1f4;return function(_0x2aaddd){logger['error'](_0x2aaddd[_0xa478('0x17')]);if(_0x2aaddd[_0xa478('0x18')]){delete _0x2aaddd['name'];}_0x309b4a[_0xa478('0xb')](_0x356482)[_0xa478('0x19')](_0x2aaddd);};}exports['index']=function(_0x5e0939,_0x39c759){var _0x2f91aa={},_0x5985b7={},_0x22d3c4={'count':0x0,'rows':[]};var _0x10f1ed=_['map'](db[_0xa478('0x1a')]['rawAttributes'],function(_0x594325){return{'name':_0x594325[_0xa478('0x1b')],'type':_0x594325[_0xa478('0x1c')][_0xa478('0x1d')]};});_0x5985b7[_0xa478('0x1e')]=_[_0xa478('0x1f')](_0x10f1ed,'name');_0x5985b7[_0xa478('0x20')]=_[_0xa478('0x21')](_0x5e0939['query']);_0x5985b7[_0xa478('0x22')]=_[_0xa478('0x23')](_0x5985b7[_0xa478('0x1e')],_0x5985b7[_0xa478('0x20')]);_0x2f91aa[_0xa478('0x24')]=_['intersection'](_0x5985b7['model'],qs[_0xa478('0x25')](_0x5e0939[_0xa478('0x20')][_0xa478('0x25')]));_0x2f91aa[_0xa478('0x24')]=_0x2f91aa[_0xa478('0x24')][_0xa478('0x26')]?_0x2f91aa[_0xa478('0x24')]:_0x5985b7['model'];if(!_0x5e0939['query']['hasOwnProperty'](_0xa478('0x27'))){_0x2f91aa[_0xa478('0xd')]=qs[_0xa478('0xd')](_0x5e0939[_0xa478('0x20')][_0xa478('0xd')]);_0x2f91aa['offset']=qs['offset'](_0x5e0939[_0xa478('0x20')][_0xa478('0xf')]);}_0x2f91aa[_0xa478('0x28')]=qs[_0xa478('0x29')](_0x5e0939['query'][_0xa478('0x29')]);_0x2f91aa[_0xa478('0x2a')]=qs[_0xa478('0x22')](_[_0xa478('0x2b')](_0x5e0939['query'],_0x5985b7[_0xa478('0x22')]),_0x10f1ed);if(_0x5e0939[_0xa478('0x20')]['filter']){_0x2f91aa['where']=_[_0xa478('0x2c')](_0x2f91aa[_0xa478('0x2a')],{'$or':_[_0xa478('0x1f')](_0x10f1ed,function(_0x2e9ad6){if(_0x2e9ad6[_0xa478('0x1c')]!==_0xa478('0x2d')){var _0x2135df={};_0x2135df[_0x2e9ad6[_0xa478('0x18')]]={'$like':'%'+_0x5e0939['query'][_0xa478('0x2e')]+'%'};return _0x2135df;}})});}_0x2f91aa=_[_0xa478('0x2c')]({},_0x2f91aa,_0x5e0939['options']);var _0x33ac38={'where':_0x2f91aa[_0xa478('0x2a')]};return db[_0xa478('0x1a')]['count'](_0x33ac38)[_0xa478('0x11')](function(_0x57a7e2){_0x22d3c4[_0xa478('0xe')]=_0x57a7e2;if(_0x5e0939[_0xa478('0x20')][_0xa478('0x2f')]){_0x2f91aa['include']=[{'all':!![]}];}return db[_0xa478('0x1a')][_0xa478('0x30')](_0x2f91aa);})[_0xa478('0x11')](function(_0x38c844){_0x22d3c4[_0xa478('0x31')]=_0x38c844;return _0x22d3c4;})[_0xa478('0x11')](respondWithFilteredResult(_0x39c759,_0x2f91aa))[_0xa478('0x32')](handleError(_0x39c759,null));};exports[_0xa478('0x33')]=function(_0x3917ab,_0x22417d){var _0x1aa4ee={'raw':![],'where':{'id':_0x3917ab['params']['id']}},_0x323610={};_0x323610[_0xa478('0x1e')]=_[_0xa478('0x21')](db[_0xa478('0x1a')][_0xa478('0x34')]);_0x323610[_0xa478('0x20')]=_[_0xa478('0x21')](_0x3917ab['query']);_0x323610[_0xa478('0x22')]=_[_0xa478('0x23')](_0x323610[_0xa478('0x1e')],_0x323610[_0xa478('0x20')]);_0x1aa4ee[_0xa478('0x24')]=_[_0xa478('0x23')](_0x323610[_0xa478('0x1e')],qs[_0xa478('0x25')](_0x3917ab[_0xa478('0x20')][_0xa478('0x25')]));_0x1aa4ee[_0xa478('0x24')]=_0x1aa4ee['attributes'][_0xa478('0x26')]?_0x1aa4ee[_0xa478('0x24')]:_0x323610[_0xa478('0x1e')];if(_0x3917ab[_0xa478('0x20')][_0xa478('0x2f')]){_0x1aa4ee[_0xa478('0x35')]=[{'all':!![]}];}_0x1aa4ee=_['merge']({},_0x1aa4ee,_0x3917ab[_0xa478('0x36')]);return db[_0xa478('0x1a')][_0xa478('0x37')](_0x1aa4ee)[_0xa478('0x11')](handleEntityNotFound(_0x22417d,null))[_0xa478('0x11')](respondWithResult(_0x22417d,null))['catch'](handleError(_0x22417d,null));};exports[_0xa478('0x38')]=function(_0x60a2b3,_0x1a35db){return db[_0xa478('0x1a')][_0xa478('0x38')](_0x60a2b3[_0xa478('0x39')],{})['then'](function(_0x1417ce){var _0x14c632=_0x60a2b3[_0xa478('0x3a')][_0xa478('0x13')]({'plain':!![]});if(!_0x14c632)throw new Error(_0xa478('0x3b'));if(_0x14c632['role']==='user'){var _0x4e12a2=_0x1417ce[_0xa478('0x13')]({'plain':!![]});var _0x3dd27d=_0xa478('0x3c');return db['UserProfileSection'][_0xa478('0x37')]({'where':{'name':_0x3dd27d,'userProfileId':_0x14c632[_0xa478('0x3d')]},'raw':!![]})[_0xa478('0x11')](function(_0x1181d4){if(_0x1181d4&&_0x1181d4[_0xa478('0x3e')]===0x0){return db[_0xa478('0x14')][_0xa478('0x38')]({'name':_0x4e12a2[_0xa478('0x18')],'resourceId':_0x4e12a2['id'],'type':_0x1181d4['name'],'sectionId':_0x1181d4['id']},{})[_0xa478('0x11')](function(){return _0x1417ce;});}else{return _0x1417ce;}})['catch'](function(_0x24381b){logger[_0xa478('0x3f')](_0xa478('0x40'),_0x24381b);throw _0x24381b;});}return _0x1417ce;})[_0xa478('0x11')](respondWithResult(_0x1a35db,0xc9))[_0xa478('0x32')](handleError(_0x1a35db,null));};exports[_0xa478('0x41')]=function(_0x28ae94,_0x21c28c){if(_0x28ae94[_0xa478('0x39')]['id']){delete _0x28ae94[_0xa478('0x39')]['id'];}return db[_0xa478('0x1a')][_0xa478('0x37')]({'where':{'id':_0x28ae94[_0xa478('0x42')]['id']}})['then'](handleEntityNotFound(_0x21c28c,null))['then'](saveUpdates(_0x28ae94[_0xa478('0x39')],null))[_0xa478('0x11')](function(_0x97b977){if(!_0x97b977)return;var _0x2cabcf=_0x97b977[_0xa478('0x13')]({'plain':!![]});return _0x2cabcf;})[_0xa478('0x11')](function(_0x52983a){var _0x1c9ee5=new Redis(config['redis']);_0x1c9ee5[_0xa478('0x15')](_0xa478('0x43'),JSON[_0xa478('0x44')](_[_0xa478('0x2b')](_0x52983a,['id',_0xa478('0x18'),'production'])));return _0x52983a;})[_0xa478('0x11')](respondWithResult(_0x21c28c,null))[_0xa478('0x32')](handleError(_0x21c28c,null));};exports[_0xa478('0x12')]=function(_0x1e0fa0,_0x1a9143){return db[_0xa478('0x1a')]['find']({'where':{'id':_0x1e0fa0[_0xa478('0x42')]['id']}})[_0xa478('0x11')](handleEntityNotFound(_0x1a9143,null))[_0xa478('0x11')](removeEntity(_0x1a9143,null))[_0xa478('0x32')](handleError(_0x1a9143,null));}; \ No newline at end of file +var _0x325b=['redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','json','offset','undefined','limit','count','then','destroy','SquareProjects','UserProfileResource','publish','agi','error','stack','name','index','SquareProject','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','show','params','rawAttributes','keys','length','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','production','ioredis','../../config/logger','../../config/environment','../../mysqldb'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x325b,0xc5));var _0xb325=function(_0x3f3e79,_0x4a07c5){_0x3f3e79=_0x3f3e79-0x0;var _0x3106de=_0x325b[_0x3f3e79];return _0x3106de;};'use strict';var _=require('lodash');var Redis=require(_0xb325('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0xb325('0x1'))('api');var config=require(_0xb325('0x2'));var db=require(_0xb325('0x3'))['db'];config[_0xb325('0x4')]=_[_0xb325('0x5')](config[_0xb325('0x4')],{'host':_0xb325('0x6'),'port':0x18eb});var socket=require(_0xb325('0x7'))(new Redis(config[_0xb325('0x4')]));require(_0xb325('0x8'))[_0xb325('0x9')](socket);function respondWithResult(_0x14712b,_0x595577){_0x595577=_0x595577||0xc8;return function(_0x33a092){if(_0x33a092){return _0x14712b[_0xb325('0xa')](_0x595577)[_0xb325('0xb')](_0x33a092);}};}function respondWithFilteredResult(_0x3cc56c,_0x2aafb5){return function(_0x44dba6){if(_0x44dba6){var _0x235bc3=typeof _0x2aafb5[_0xb325('0xc')]===_0xb325('0xd')&&typeof _0x2aafb5[_0xb325('0xe')]===_0xb325('0xd');var _0x3c5435=_0x44dba6[_0xb325('0xf')];var _0x154b01=_0x235bc3?0x0:_0x2aafb5[_0xb325('0xc')];var _0x30bb2d=_0x235bc3?_0x44dba6[_0xb325('0xf')]:_0x2aafb5[_0xb325('0xc')]+_0x2aafb5['limit'];var _0x3d66ff;if(_0x30bb2d>=_0x3c5435){_0x30bb2d=_0x3c5435;_0x3d66ff=0xc8;}else{_0x3d66ff=0xce;}_0x3cc56c[_0xb325('0xa')](_0x3d66ff);return _0x3cc56c['set']('Content-Range',_0x154b01+'-'+_0x30bb2d+'/'+_0x3c5435)[_0xb325('0xb')](_0x44dba6);}return null;};}function saveUpdates(_0x3738d6){return function(_0x4f4110){if(_0x4f4110){return _0x4f4110['update'](_0x3738d6)[_0xb325('0x10')](function(_0x433e60){return _0x433e60;});}return null;};}function removeEntity(_0x1f33c6){return function(_0x2cc859){if(_0x2cc859){return _0x2cc859[_0xb325('0x11')]()[_0xb325('0x10')](function(){var _0x1a4574=_0x2cc859['get']({'plain':!![]});var _0x39e378=_0xb325('0x12');return db[_0xb325('0x13')][_0xb325('0x11')]({'where':{'type':_0x39e378,'resourceId':_0x1a4574['id']}})[_0xb325('0x10')](function(){return _0x2cc859;});})[_0xb325('0x10')](function(){var _0x279092=new Redis(config[_0xb325('0x4')]);_0x279092[_0xb325('0x14')](_0xb325('0x15'),JSON['stringify']({'id':_0x2cc859['id'],'deleted':!![]}));})[_0xb325('0x10')](function(){_0x1f33c6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe23e58){return function(_0x506a9f){if(!_0x506a9f){_0xe23e58['sendStatus'](0x194);}return _0x506a9f;};}function handleError(_0x2a0834,_0x3310b0){_0x3310b0=_0x3310b0||0x1f4;return function(_0x122220){logger[_0xb325('0x16')](_0x122220[_0xb325('0x17')]);if(_0x122220[_0xb325('0x18')]){delete _0x122220['name'];}_0x2a0834[_0xb325('0xa')](_0x3310b0)['send'](_0x122220);};}exports[_0xb325('0x19')]=function(_0x38f8dc,_0x2469c5){var _0x324ff0={},_0x321f1e={},_0x4dd761={'count':0x0,'rows':[]};var _0xf38217=_['map'](db[_0xb325('0x1a')]['rawAttributes'],function(_0x171a82){return{'name':_0x171a82[_0xb325('0x1b')],'type':_0x171a82[_0xb325('0x1c')][_0xb325('0x1d')]};});_0x321f1e[_0xb325('0x1e')]=_[_0xb325('0x1f')](_0xf38217,_0xb325('0x18'));_0x321f1e['query']=_['keys'](_0x38f8dc[_0xb325('0x20')]);_0x321f1e[_0xb325('0x21')]=_[_0xb325('0x22')](_0x321f1e[_0xb325('0x1e')],_0x321f1e[_0xb325('0x20')]);_0x324ff0[_0xb325('0x23')]=_[_0xb325('0x22')](_0x321f1e['model'],qs[_0xb325('0x24')](_0x38f8dc['query'][_0xb325('0x24')]));_0x324ff0[_0xb325('0x23')]=_0x324ff0['attributes']['length']?_0x324ff0[_0xb325('0x23')]:_0x321f1e[_0xb325('0x1e')];if(!_0x38f8dc[_0xb325('0x20')][_0xb325('0x25')]('nolimit')){_0x324ff0['limit']=qs['limit'](_0x38f8dc[_0xb325('0x20')]['limit']);_0x324ff0[_0xb325('0xc')]=qs[_0xb325('0xc')](_0x38f8dc['query']['offset']);}_0x324ff0[_0xb325('0x26')]=qs[_0xb325('0x27')](_0x38f8dc[_0xb325('0x20')][_0xb325('0x27')]);_0x324ff0['where']=qs[_0xb325('0x21')](_[_0xb325('0x28')](_0x38f8dc[_0xb325('0x20')],_0x321f1e[_0xb325('0x21')]),_0xf38217);if(_0x38f8dc['query'][_0xb325('0x29')]){_0x324ff0[_0xb325('0x2a')]=_[_0xb325('0x2b')](_0x324ff0[_0xb325('0x2a')],{'$or':_[_0xb325('0x1f')](_0xf38217,function(_0x27582e){if(_0x27582e[_0xb325('0x1c')]!==_0xb325('0x2c')){var _0x4a09c8={};_0x4a09c8[_0x27582e[_0xb325('0x18')]]={'$like':'%'+_0x38f8dc[_0xb325('0x20')][_0xb325('0x29')]+'%'};return _0x4a09c8;}})});}_0x324ff0=_[_0xb325('0x2b')]({},_0x324ff0,_0x38f8dc[_0xb325('0x2d')]);var _0x26f310={'where':_0x324ff0[_0xb325('0x2a')]};return db[_0xb325('0x1a')][_0xb325('0xf')](_0x26f310)[_0xb325('0x10')](function(_0x7fd6e6){_0x4dd761[_0xb325('0xf')]=_0x7fd6e6;if(_0x38f8dc['query']['includeAll']){_0x324ff0[_0xb325('0x2e')]=[{'all':!![]}];}return db[_0xb325('0x1a')]['findAll'](_0x324ff0);})[_0xb325('0x10')](function(_0x3685f8){_0x4dd761[_0xb325('0x2f')]=_0x3685f8;return _0x4dd761;})[_0xb325('0x10')](respondWithFilteredResult(_0x2469c5,_0x324ff0))['catch'](handleError(_0x2469c5,null));};exports[_0xb325('0x30')]=function(_0x215572,_0x79c3a){var _0x42a33e={'raw':![],'where':{'id':_0x215572[_0xb325('0x31')]['id']}},_0x28a925={};_0x28a925[_0xb325('0x1e')]=_['keys'](db[_0xb325('0x1a')][_0xb325('0x32')]);_0x28a925[_0xb325('0x20')]=_[_0xb325('0x33')](_0x215572['query']);_0x28a925['filters']=_[_0xb325('0x22')](_0x28a925[_0xb325('0x1e')],_0x28a925['query']);_0x42a33e['attributes']=_[_0xb325('0x22')](_0x28a925[_0xb325('0x1e')],qs[_0xb325('0x24')](_0x215572[_0xb325('0x20')]['fields']));_0x42a33e['attributes']=_0x42a33e[_0xb325('0x23')][_0xb325('0x34')]?_0x42a33e[_0xb325('0x23')]:_0x28a925[_0xb325('0x1e')];if(_0x215572[_0xb325('0x20')]['includeAll']){_0x42a33e[_0xb325('0x2e')]=[{'all':!![]}];}_0x42a33e=_[_0xb325('0x2b')]({},_0x42a33e,_0x215572[_0xb325('0x2d')]);return db[_0xb325('0x1a')][_0xb325('0x35')](_0x42a33e)[_0xb325('0x10')](handleEntityNotFound(_0x79c3a,null))[_0xb325('0x10')](respondWithResult(_0x79c3a,null))[_0xb325('0x36')](handleError(_0x79c3a,null));};exports[_0xb325('0x37')]=function(_0x22bbee,_0x558d64){return db[_0xb325('0x1a')][_0xb325('0x37')](_0x22bbee[_0xb325('0x38')],{})[_0xb325('0x10')](function(_0x31fc97){var _0x3eb9cc=_0x22bbee[_0xb325('0x39')][_0xb325('0x3a')]({'plain':!![]});if(!_0x3eb9cc)throw new Error(_0xb325('0x3b'));if(_0x3eb9cc[_0xb325('0x3c')]==='user'){var _0x343707=_0x31fc97['get']({'plain':!![]});var _0x24528a=_0xb325('0x12');return db[_0xb325('0x3d')][_0xb325('0x35')]({'where':{'name':_0x24528a,'userProfileId':_0x3eb9cc[_0xb325('0x3e')]},'raw':!![]})['then'](function(_0x34063f){if(_0x34063f&&_0x34063f[_0xb325('0x3f')]===0x0){return db[_0xb325('0x13')][_0xb325('0x37')]({'name':_0x343707[_0xb325('0x18')],'resourceId':_0x343707['id'],'type':_0x34063f[_0xb325('0x18')],'sectionId':_0x34063f['id']},{})[_0xb325('0x10')](function(){return _0x31fc97;});}else{return _0x31fc97;}})[_0xb325('0x36')](function(_0x5e1e36){logger[_0xb325('0x16')](_0xb325('0x40'),_0x5e1e36);throw _0x5e1e36;});}return _0x31fc97;})['then'](respondWithResult(_0x558d64,0xc9))[_0xb325('0x36')](handleError(_0x558d64,null));};exports[_0xb325('0x41')]=function(_0x267721,_0x5dc2fe){if(_0x267721[_0xb325('0x38')]['id']){delete _0x267721[_0xb325('0x38')]['id'];}return db[_0xb325('0x1a')][_0xb325('0x35')]({'where':{'id':_0x267721[_0xb325('0x31')]['id']}})[_0xb325('0x10')](handleEntityNotFound(_0x5dc2fe,null))[_0xb325('0x10')](saveUpdates(_0x267721[_0xb325('0x38')],null))[_0xb325('0x10')](function(_0x568cc4){if(!_0x568cc4)return;var _0x5e4b5d=_0x568cc4[_0xb325('0x3a')]({'plain':!![]});return _0x5e4b5d;})[_0xb325('0x10')](function(_0x145098){var _0x2a381c=new Redis(config[_0xb325('0x4')]);_0x2a381c[_0xb325('0x14')]('agi',JSON['stringify'](_[_0xb325('0x28')](_0x145098,['id',_0xb325('0x18'),_0xb325('0x42')])));return _0x145098;})[_0xb325('0x10')](respondWithResult(_0x5dc2fe,null))['catch'](handleError(_0x5dc2fe,null));};exports[_0xb325('0x11')]=function(_0x5e2507,_0x387d35){return db['SquareProject']['find']({'where':{'id':_0x5e2507[_0xb325('0x31')]['id']}})[_0xb325('0x10')](handleEntityNotFound(_0x387d35,null))[_0xb325('0x10')](removeEntity(_0x387d35,null))['catch'](handleError(_0x387d35,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index c109132..fe84df2 100644 --- a/server/api/squareProject/squareProject.events.js +++ b/server/api/squareProject/squareProject.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedfe=['SquareProject','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2b7df2,_0xab7af5){var _0x2a32fe=function(_0x53e147){while(--_0x53e147){_0x2b7df2['push'](_0x2b7df2['shift']());}};_0x2a32fe(++_0xab7af5);}(_0xedfe,0x1be));var _0xeedf=function(_0x5b656f,_0x72fcd6){_0x5b656f=_0x5b656f-0x0;var _0x2875c3=_0xedfe[_0x5b656f];return _0x2875c3;};'use strict';var EventEmitter=require(_0xeedf('0x0'));var SquareProject=require(_0xeedf('0x1'))['db'][_0xeedf('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x426378){return function(_0x22d342,_0x2b0e70,_0x3813e6){SquareProjectEvents['emit'](_0x426378+':'+_0x22d342['id'],_0x22d342);SquareProjectEvents[_0xeedf('0x3')](_0x426378,_0x22d342);_0x3813e6(null);};}for(var e in events){if(events[_0xeedf('0x4')](e)){var event=events[e];SquareProject[_0xeedf('0x5')](e,emitEvent(event));}}module[_0xeedf('0x6')]=SquareProjectEvents; \ No newline at end of file +var _0x72b3=['exports','events','SquareProject','setMaxListeners','update','remove','emit','hook'];(function(_0x2055cf,_0x3b4900){var _0x4293b7=function(_0x23b50f){while(--_0x23b50f){_0x2055cf['push'](_0x2055cf['shift']());}};_0x4293b7(++_0x3b4900);}(_0x72b3,0x1c1));var _0x372b=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x72b3[_0x4c6d6f];return _0x2d4478;};'use strict';var EventEmitter=require(_0x372b('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x372b('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x372b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x372b('0x3'),'afterDestroy':_0x372b('0x4')};function emitEvent(_0x216112){return function(_0x7d6820,_0x3653a2,_0x5e4a99){SquareProjectEvents[_0x372b('0x5')](_0x216112+':'+_0x7d6820['id'],_0x7d6820);SquareProjectEvents[_0x372b('0x5')](_0x216112,_0x7d6820);_0x5e4a99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x372b('0x6')](e,emitEvent(event));}}module[_0x372b('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 387b189..03ae3bf 100644 --- a/server/api/squareProject/squareProject.model.js +++ b/server/api/squareProject/squareProject.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbbf2=['changed','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareProject.attributes','exports','SquareProject','square_projects','preproduction','format'];(function(_0x49f9aa,_0x22ac9d){var _0xf0189=function(_0xfc9040){while(--_0xfc9040){_0x49f9aa['push'](_0x49f9aa['shift']());}};_0xf0189(++_0x22ac9d);}(_0xbbf2,0xd5));var _0x2bbf=function(_0x5cabfd,_0x5dea47){_0x5cabfd=_0x5cabfd-0x0;var _0x4bc06c=_0xbbf2[_0x5cabfd];return _0x4bc06c;};'use strict';var _=require(_0x2bbf('0x0'));var util=require(_0x2bbf('0x1'));var logger=require(_0x2bbf('0x2'))(_0x2bbf('0x3'));var moment=require(_0x2bbf('0x4'));var BPromise=require(_0x2bbf('0x5'));var rp=require(_0x2bbf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2bbf('0x7'));var config=require(_0x2bbf('0x8'));var attributes=require(_0x2bbf('0x9'));module[_0x2bbf('0xa')]=function(_0x1d24f4,_0xa8382c){return _0x1d24f4['define'](_0x2bbf('0xb'),attributes,{'tableName':_0x2bbf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3bb4a9,_0x32bb52,_0x591280){if(_0x3bb4a9['changed'](_0x2bbf('0xd'))){_0x3bb4a9['savedAt']=moment()[_0x2bbf('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3bb4a9[_0x2bbf('0xf')](_0x2bbf('0x10'))){_0x3bb4a9[_0x2bbf('0x11')]=moment()[_0x2bbf('0xe')](_0x2bbf('0x12'));}_0x591280(null,_0x3bb4a9);}}});}; \ No newline at end of file +var _0x4bba=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareProject.attributes','define','SquareProject','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x2b9969,_0x2bb700){var _0x18e493=function(_0x5ae29c){while(--_0x5ae29c){_0x2b9969['push'](_0x2b9969['shift']());}};_0x18e493(++_0x2bb700);}(_0x4bba,0x131));var _0xa4bb=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x4bba[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0xa4bb('0x0'));var util=require(_0xa4bb('0x1'));var logger=require(_0xa4bb('0x2'))(_0xa4bb('0x3'));var moment=require(_0xa4bb('0x4'));var BPromise=require(_0xa4bb('0x5'));var rp=require(_0xa4bb('0x6'));var fs=require('fs');var path=require(_0xa4bb('0x7'));var rimraf=require('rimraf');var config=require(_0xa4bb('0x8'));var attributes=require(_0xa4bb('0x9'));module['exports']=function(_0x3ccaae,_0x32a59b){return _0x3ccaae[_0xa4bb('0xa')](_0xa4bb('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x841e0c,_0x4a1a39,_0x5b2c75){if(_0x841e0c[_0xa4bb('0xc')](_0xa4bb('0xd'))){_0x841e0c[_0xa4bb('0xe')]=moment()[_0xa4bb('0xf')](_0xa4bb('0x10'));}if(_0x841e0c['changed']('production')){_0x841e0c['publishedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5b2c75(null,_0x841e0c);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index b644720..e61647b 100644 --- a/server/api/squareProject/squareProject.rpc.js +++ b/server/api/squareProject/squareProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7edc=['limit','include','map','model','info','GetSquareProjects','catch','error','message','ShowSquareProject','find','then','debug','stringify','lodash','ioredis','../../mysqldb','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','SquareProject','findAll','options','raw','where','attributes'];(function(_0x4e8022,_0x53229d){var _0xf5e73f=function(_0x3a1309){while(--_0x3a1309){_0x4e8022['push'](_0x4e8022['shift']());}};_0xf5e73f(++_0x53229d);}(_0x7edc,0x13a));var _0xc7ed=function(_0x5a8aa3,_0x2294d5){_0x5a8aa3=_0x5a8aa3-0x0;var _0x5d0458=_0x7edc[_0x5a8aa3];return _0x5d0458;};'use strict';var _=require(_0xc7ed('0x0'));var Redis=require(_0xc7ed('0x1'));var db=require(_0xc7ed('0x2'))['db'];var logger=require(_0xc7ed('0x3'))(_0xc7ed('0x4'));var config=require('../../config/environment');config[_0xc7ed('0x5')]=_[_0xc7ed('0x6')](config['redis'],{'host':_0xc7ed('0x7'),'port':0x18eb});var socket=require(_0xc7ed('0x8'))(new Redis(config[_0xc7ed('0x5')]));require(_0xc7ed('0x9'))['register'](socket);exports['GetSquareProjects']=function(_0x155dd7){var _0x47c504=this;return new Promise(function(_0x41c6be,_0x566b5f){return db[_0xc7ed('0xa')][_0xc7ed('0xb')]({'raw':_0x155dd7[_0xc7ed('0xc')]?_0x155dd7['options'][_0xc7ed('0xd')]===undefined?!![]:![]:!![],'where':_0x155dd7[_0xc7ed('0xc')]?_0x155dd7[_0xc7ed('0xc')][_0xc7ed('0xe')]||null:null,'attributes':_0x155dd7[_0xc7ed('0xc')]?_0x155dd7[_0xc7ed('0xc')][_0xc7ed('0xf')]||null:null,'limit':_0x155dd7[_0xc7ed('0xc')]?_0x155dd7[_0xc7ed('0xc')][_0xc7ed('0x10')]||null:null,'include':_0x155dd7[_0xc7ed('0xc')]?_0x155dd7[_0xc7ed('0xc')][_0xc7ed('0x11')]?_[_0xc7ed('0x12')](_0x155dd7['options']['include'],function(_0x2cb99a){return{'model':db[_0x2cb99a[_0xc7ed('0x13')]],'as':_0x2cb99a['as'],'attributes':_0x2cb99a['attributes'],'include':_0x2cb99a[_0xc7ed('0x11')]?_[_0xc7ed('0x12')](_0x2cb99a['include'],function(_0x19e8f3){return{'model':db[_0x19e8f3[_0xc7ed('0x13')]],'as':_0x19e8f3['as'],'attributes':_0x19e8f3[_0xc7ed('0xf')],'include':_0x19e8f3[_0xc7ed('0x11')]?_[_0xc7ed('0x12')](_0x19e8f3[_0xc7ed('0x11')],function(_0x4b56be){return{'model':db[_0x4b56be[_0xc7ed('0x13')]],'as':_0x4b56be['as'],'attributes':_0x4b56be[_0xc7ed('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x290a51){logger[_0xc7ed('0x14')](_0xc7ed('0x15'),_0x155dd7);logger['debug']('GetSquareProjects',_0x155dd7,JSON['stringify'](_0x290a51));_0x41c6be(_0x290a51);})[_0xc7ed('0x16')](function(_0x2bae12){logger[_0xc7ed('0x17')](_0xc7ed('0x15'),_0x2bae12[_0xc7ed('0x18')],_0x155dd7);_0x566b5f(_0x47c504[_0xc7ed('0x17')](0x1f4,_0x2bae12[_0xc7ed('0x18')]));});});};exports[_0xc7ed('0x19')]=function(_0x43241e){var _0x37a2ff=this;return new Promise(function(_0x74a4ca,_0x43a645){return db[_0xc7ed('0xa')][_0xc7ed('0x1a')]({'raw':_0x43241e[_0xc7ed('0xc')]?_0x43241e[_0xc7ed('0xc')][_0xc7ed('0xd')]===undefined?!![]:![]:!![],'where':_0x43241e[_0xc7ed('0xc')]?_0x43241e['options'][_0xc7ed('0xe')]||null:null,'attributes':_0x43241e[_0xc7ed('0xc')]?_0x43241e[_0xc7ed('0xc')][_0xc7ed('0xf')]||null:null,'include':_0x43241e[_0xc7ed('0xc')]?_0x43241e['options'][_0xc7ed('0x11')]?_[_0xc7ed('0x12')](_0x43241e[_0xc7ed('0xc')][_0xc7ed('0x11')],function(_0x39e789){return{'model':db[_0x39e789['model']],'as':_0x39e789['as'],'attributes':_0x39e789[_0xc7ed('0xf')],'include':_0x39e789[_0xc7ed('0x11')]?_[_0xc7ed('0x12')](_0x39e789['include'],function(_0x1aa83e){return{'model':db[_0x1aa83e[_0xc7ed('0x13')]],'as':_0x1aa83e['as'],'attributes':_0x1aa83e[_0xc7ed('0xf')],'include':_0x1aa83e[_0xc7ed('0x11')]?_[_0xc7ed('0x12')](_0x1aa83e[_0xc7ed('0x11')],function(_0x5af224){return{'model':db[_0x5af224['model']],'as':_0x5af224['as'],'attributes':_0x5af224[_0xc7ed('0xf')]};}):[]};}):[]};}):[]:[]})[_0xc7ed('0x1b')](function(_0x338d63){logger[_0xc7ed('0x14')](_0xc7ed('0x19'),_0x43241e);logger[_0xc7ed('0x1c')](_0xc7ed('0x19'),_0x43241e,JSON[_0xc7ed('0x1d')](_0x338d63));_0x74a4ca(_0x338d63);})['catch'](function(_0x40184b){logger[_0xc7ed('0x17')](_0xc7ed('0x19'),_0x40184b[_0xc7ed('0x18')],_0x43241e);_0x43a645(_0x37a2ff['error'](0x1f4,_0x40184b[_0xc7ed('0x18')]));});});}; \ No newline at end of file +var _0x497c=['SquareProject','options','raw','attributes','limit','include','map','model','then','info','stringify','catch','error','message','find','where','debug','ShowSquareProject','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','GetSquareProjects'];(function(_0x309e4c,_0xe50b68){var _0x18e3ae=function(_0x3a189b){while(--_0x3a189b){_0x309e4c['push'](_0x309e4c['shift']());}};_0x18e3ae(++_0xe50b68);}(_0x497c,0x13e));var _0xc497=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x497c[_0x4b7895];return _0x264180;};'use strict';var _=require(_0xc497('0x0'));var Redis=require(_0xc497('0x1'));var db=require(_0xc497('0x2'))['db'];var logger=require(_0xc497('0x3'))(_0xc497('0x4'));var config=require(_0xc497('0x5'));config['redis']=_[_0xc497('0x6')](config[_0xc497('0x7')],{'host':_0xc497('0x8'),'port':0x18eb});var socket=require(_0xc497('0x9'))(new Redis(config[_0xc497('0x7')]));require(_0xc497('0xa'))['register'](socket);exports[_0xc497('0xb')]=function(_0x1accf0){var _0xb031c=this;return new Promise(function(_0x5400e8,_0x4d36aa){return db[_0xc497('0xc')]['findAll']({'raw':_0x1accf0[_0xc497('0xd')]?_0x1accf0[_0xc497('0xd')][_0xc497('0xe')]===undefined?!![]:![]:!![],'where':_0x1accf0[_0xc497('0xd')]?_0x1accf0[_0xc497('0xd')]['where']||null:null,'attributes':_0x1accf0[_0xc497('0xd')]?_0x1accf0[_0xc497('0xd')][_0xc497('0xf')]||null:null,'limit':_0x1accf0[_0xc497('0xd')]?_0x1accf0[_0xc497('0xd')][_0xc497('0x10')]||null:null,'include':_0x1accf0['options']?_0x1accf0[_0xc497('0xd')][_0xc497('0x11')]?_[_0xc497('0x12')](_0x1accf0[_0xc497('0xd')][_0xc497('0x11')],function(_0x36a89d){return{'model':db[_0x36a89d[_0xc497('0x13')]],'as':_0x36a89d['as'],'attributes':_0x36a89d[_0xc497('0xf')],'include':_0x36a89d[_0xc497('0x11')]?_[_0xc497('0x12')](_0x36a89d[_0xc497('0x11')],function(_0x457962){return{'model':db[_0x457962['model']],'as':_0x457962['as'],'attributes':_0x457962[_0xc497('0xf')],'include':_0x457962[_0xc497('0x11')]?_['map'](_0x457962[_0xc497('0x11')],function(_0x4a58ec){return{'model':db[_0x4a58ec[_0xc497('0x13')]],'as':_0x4a58ec['as'],'attributes':_0x4a58ec[_0xc497('0xf')]};}):[]};}):[]};}):[]:[]})[_0xc497('0x14')](function(_0x1a5434){logger[_0xc497('0x15')]('GetSquareProjects',_0x1accf0);logger['debug'](_0xc497('0xb'),_0x1accf0,JSON[_0xc497('0x16')](_0x1a5434));_0x5400e8(_0x1a5434);})[_0xc497('0x17')](function(_0x91c3e2){logger[_0xc497('0x18')]('GetSquareProjects',_0x91c3e2['message'],_0x1accf0);_0x4d36aa(_0xb031c['error'](0x1f4,_0x91c3e2[_0xc497('0x19')]));});});};exports['ShowSquareProject']=function(_0x3f6a57){var _0x264a67=this;return new Promise(function(_0x4f6fd4,_0x52d6cd){return db['SquareProject'][_0xc497('0x1a')]({'raw':_0x3f6a57[_0xc497('0xd')]?_0x3f6a57[_0xc497('0xd')][_0xc497('0xe')]===undefined?!![]:![]:!![],'where':_0x3f6a57[_0xc497('0xd')]?_0x3f6a57[_0xc497('0xd')][_0xc497('0x1b')]||null:null,'attributes':_0x3f6a57[_0xc497('0xd')]?_0x3f6a57[_0xc497('0xd')][_0xc497('0xf')]||null:null,'include':_0x3f6a57[_0xc497('0xd')]?_0x3f6a57[_0xc497('0xd')][_0xc497('0x11')]?_[_0xc497('0x12')](_0x3f6a57[_0xc497('0xd')][_0xc497('0x11')],function(_0x5aadfb){return{'model':db[_0x5aadfb[_0xc497('0x13')]],'as':_0x5aadfb['as'],'attributes':_0x5aadfb[_0xc497('0xf')],'include':_0x5aadfb[_0xc497('0x11')]?_[_0xc497('0x12')](_0x5aadfb[_0xc497('0x11')],function(_0x514431){return{'model':db[_0x514431[_0xc497('0x13')]],'as':_0x514431['as'],'attributes':_0x514431[_0xc497('0xf')],'include':_0x514431[_0xc497('0x11')]?_[_0xc497('0x12')](_0x514431[_0xc497('0x11')],function(_0x1d6ea2){return{'model':db[_0x1d6ea2['model']],'as':_0x1d6ea2['as'],'attributes':_0x1d6ea2[_0xc497('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9b8ba2){logger['info']('ShowSquareProject',_0x3f6a57);logger[_0xc497('0x1c')](_0xc497('0x1d'),_0x3f6a57,JSON[_0xc497('0x16')](_0x9b8ba2));_0x4f6fd4(_0x9b8ba2);})['catch'](function(_0x191626){logger[_0xc497('0x18')](_0xc497('0x1d'),_0x191626[_0xc497('0x19')],_0x3f6a57);_0x52d6cd(_0x264a67[_0xc497('0x18')](0x1f4,_0x191626[_0xc497('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 7a98af7..b0cb807 100644 --- a/server/api/squareProject/squareProject.socket.js +++ b/server/api/squareProject/squareProject.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9071=['squareProject:','./squareProject.events','save','remove','update','removeListener','length'];(function(_0x43b58d,_0x41835a){var _0x21cf20=function(_0x428661){while(--_0x428661){_0x43b58d['push'](_0x43b58d['shift']());}};_0x21cf20(++_0x41835a);}(_0x9071,0xcc));var _0x1907=function(_0x566ce0,_0x3fd9fd){_0x566ce0=_0x566ce0-0x0;var _0xac3743=_0x9071[_0x566ce0];return _0xac3743;};'use strict';var SquareProjectEvents=require(_0x1907('0x0'));var events=[_0x1907('0x1'),_0x1907('0x2'),_0x1907('0x3')];function createListener(_0x6f621c,_0x401b48){return function(_0x12039c){_0x401b48['emit'](_0x6f621c,_0x12039c);};}function removeListener(_0x294004,_0x1f56f1){return function(){SquareProjectEvents[_0x1907('0x4')](_0x294004,_0x1f56f1);};}exports['register']=function(_0x5ae0e0){for(var _0x227c3d=0x0,_0x254ca2=events[_0x1907('0x5')];_0x227c3d<_0x254ca2;_0x227c3d++){var _0x4609ad=events[_0x227c3d];var _0x3b26a4=createListener(_0x1907('0x6')+_0x4609ad,_0x5ae0e0);SquareProjectEvents['on'](_0x4609ad,_0x3b26a4);}}; \ No newline at end of file +var _0xe62f=['update','removeListener','length','squareProject:','./squareProject.events'];(function(_0x191dba,_0x47cb00){var _0x3441eb=function(_0x51ee2c){while(--_0x51ee2c){_0x191dba['push'](_0x191dba['shift']());}};_0x3441eb(++_0x47cb00);}(_0xe62f,0xf9));var _0xfe62=function(_0x26c6c4,_0x12bdab){_0x26c6c4=_0x26c6c4-0x0;var _0x1ff6de=_0xe62f[_0x26c6c4];return _0x1ff6de;};'use strict';var SquareProjectEvents=require(_0xfe62('0x0'));var events=['save','remove',_0xfe62('0x1')];function createListener(_0x17a890,_0x55a411){return function(_0x3cd170){_0x55a411['emit'](_0x17a890,_0x3cd170);};}function removeListener(_0x1cc091,_0x57865b){return function(){SquareProjectEvents[_0xfe62('0x2')](_0x1cc091,_0x57865b);};}exports['register']=function(_0x5c9700){for(var _0x5ceb97=0x0,_0x2f940a=events[_0xfe62('0x3')];_0x5ceb97<_0x2f940a;_0x5ceb97++){var _0x461e45=events[_0x5ceb97];var _0x23f07c=createListener(_0xfe62('0x4')+_0x461e45,_0x5c9700);SquareProjectEvents['on'](_0x461e45,_0x23f07c);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 89b170b..a6277c1 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x1b21b4,_0x429bbe){var _0x507956=function(_0x480a0d){while(--_0x480a0d){_0x1b21b4['push'](_0x1b21b4['shift']());}};_0x507956(++_0x429bbe);}(_0x1261,0x144));var _0x1126=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x1261[_0x310504];return _0x5b36d0;};'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 +var _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareRecording.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','create','put'];(function(_0x5d01a,_0x56cf87){var _0xaecd8c=function(_0x296f41){while(--_0x296f41){_0x5d01a['push'](_0x5d01a['shift']());}};_0xaecd8c(++_0x56cf87);}(_0x53ec,0x192));var _0xc53e=function(_0x30631b,_0x50799b){_0x30631b=_0x30631b-0x0;var _0x3d57c6=_0x53ec[_0x30631b];return _0x3d57c6;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index b4e6f87..d82248b 100644 --- a/server/api/squareRecording/squareRecording.attributes.js +++ b/server/api/squareRecording/squareRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee14=['VIRTUAL','getDataValue','savePath','substring','STRING'];(function(_0x2f98e1,_0x4273e6){var _0x5261ad=function(_0x187383){while(--_0x187383){_0x2f98e1['push'](_0x2f98e1['shift']());}};_0x5261ad(++_0x4273e6);}(_0xee14,0x13a));var _0x4ee1=function(_0x5f469f,_0x4c3d85){_0x5f469f=_0x5f469f-0x0;var _0x511617=_0xee14[_0x5f469f];return _0x511617;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x4ee1('0x0')]},'callerid':{'type':Sequelize[_0x4ee1('0x0')]},'calleridname':{'type':Sequelize[_0x4ee1('0x0')]},'context':{'type':Sequelize[_0x4ee1('0x0')]},'extension':{'type':Sequelize[_0x4ee1('0x0')]},'priority':{'type':Sequelize[_0x4ee1('0x0')]},'accountcode':{'type':Sequelize[_0x4ee1('0x0')]},'dnid':{'type':Sequelize[_0x4ee1('0x0')]},'projectName':{'type':Sequelize[_0x4ee1('0x0')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x4ee1('0x0')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x4ee1('0x1')],'get':function(){var _0x3a45a3='';var _0x187656=this[_0x4ee1('0x2')](_0x4ee1('0x3'));if(_0x187656){_0x3a45a3=_0x187656[_0x4ee1('0x4')](_0x187656['lastIndexOf']('.'));}return _0x3a45a3;}}}; \ No newline at end of file +var _0x7dfd=['substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','savePath'];(function(_0x46db46,_0x54e664){var _0x4a4d81=function(_0x1e1465){while(--_0x1e1465){_0x46db46['push'](_0x46db46['shift']());}};_0x4a4d81(++_0x54e664);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'uniqueid':{'type':Sequelize[_0xd7df('0x2')]},'callerid':{'type':Sequelize[_0xd7df('0x2')]},'calleridname':{'type':Sequelize[_0xd7df('0x2')]},'context':{'type':Sequelize[_0xd7df('0x2')]},'extension':{'type':Sequelize[_0xd7df('0x2')]},'priority':{'type':Sequelize[_0xd7df('0x2')]},'accountcode':{'type':Sequelize[_0xd7df('0x2')]},'dnid':{'type':Sequelize[_0xd7df('0x2')]},'projectName':{'type':Sequelize[_0xd7df('0x2')]},'saveName':{'type':Sequelize[_0xd7df('0x2')]},'filename':{'type':Sequelize[_0xd7df('0x2')]},'savePath':{'type':Sequelize[_0xd7df('0x2')]},'format':{'type':Sequelize[_0xd7df('0x3')],'get':function(){var _0x16e50='';var _0x2c48a4=this['getDataValue'](_0xd7df('0x4'));if(_0x2c48a4){_0x16e50=_0x2c48a4[_0xd7df('0x5')](_0x2c48a4[_0xd7df('0x6')]('.'));}return _0x16e50;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 7d50846..6b549c7 100644 --- a/server/api/squareRecording/squareRecording.controller.js +++ b/server/api/squareRecording/squareRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50c0=['hasOwnProperty','nolimit','order','sort','filter','where','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','update','download','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','extname','message','Not\x20found','destroy','isNil','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','json','offset','undefined','limit','count','Content-Range','reject','save','then','sendStatus','error','name','send','map','SquareRecording','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x2c130e,_0x522b91){var _0x41534b=function(_0x560686){while(--_0x560686){_0x2c130e['push'](_0x2c130e['shift']());}};_0x41534b(++_0x522b91);}(_0x50c0,0xde));var _0x050c=function(_0x345087,_0x53b1e6){_0x345087=_0x345087-0x0;var _0x453863=_0x50c0[_0x345087];return _0x453863;};'use strict';var emlformat=require(_0x050c('0x0'));var rimraf=require(_0x050c('0x1'));var zipdir=require(_0x050c('0x2'));var jsonpatch=require(_0x050c('0x3'));var rp=require(_0x050c('0x4'));var moment=require('moment');var BPromise=require(_0x050c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x050c('0x6'));var sox=require(_0x050c('0x7'));var csv=require(_0x050c('0x8'));var ejs=require(_0x050c('0x9'));var fs=require('fs');var fs_extra=require(_0x050c('0xa'));var _=require('lodash');var squel=require(_0x050c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x050c('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x050c('0xd'));var Redis=require(_0x050c('0xe'));var authService=require(_0x050c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x050c('0x10'));var hardwareService=require(_0x050c('0x11'));var logger=require(_0x050c('0x12'))(_0x050c('0x13'));var utils=require(_0x050c('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x151fef,_0x39980e){_0x39980e=_0x39980e||0xcc;return function(_0x5146e6){if(_0x5146e6){return _0x151fef['sendStatus'](_0x39980e);}return _0x151fef[_0x050c('0x15')](_0x39980e)['end']();};}function respondWithResult(_0x379837,_0x3da34d){_0x3da34d=_0x3da34d||0xc8;return function(_0x1e0f36){if(_0x1e0f36){return _0x379837[_0x050c('0x15')](_0x3da34d)[_0x050c('0x16')](_0x1e0f36);}};}function respondWithFilteredResult(_0x20117f,_0x1e744e){return function(_0x4808dd){if(_0x4808dd){var _0x1201ab=typeof _0x1e744e[_0x050c('0x17')]===_0x050c('0x18')&&typeof _0x1e744e[_0x050c('0x19')]===_0x050c('0x18');var _0x59533b=_0x4808dd['count'];var _0x56c59c=_0x1201ab?0x0:_0x1e744e['offset'];var _0x471534=_0x1201ab?_0x4808dd[_0x050c('0x1a')]:_0x1e744e['offset']+_0x1e744e[_0x050c('0x19')];var _0x1ba98d;if(_0x471534>=_0x59533b){_0x471534=_0x59533b;_0x1ba98d=0xc8;}else{_0x1ba98d=0xce;}_0x20117f[_0x050c('0x15')](_0x1ba98d);return _0x20117f['set'](_0x050c('0x1b'),_0x56c59c+'-'+_0x471534+'/'+_0x59533b)[_0x050c('0x16')](_0x4808dd);}return null;};}function patchUpdates(_0x324e66){return function(_0x157085){try{jsonpatch['apply'](_0x157085,_0x324e66,!![]);}catch(_0x524440){return BPromise[_0x050c('0x1c')](_0x524440);}return _0x157085[_0x050c('0x1d')]();};}function saveUpdates(_0x17dc57,_0x3ecd9c){return function(_0x2c652e){if(_0x2c652e){return _0x2c652e['update'](_0x17dc57)[_0x050c('0x1e')](function(_0x225ab7){return _0x225ab7;});}return null;};}function removeEntity(_0x16e31e,_0x3c2e30){return function(_0x39516a){if(_0x39516a){return _0x39516a['destroy']()['then'](function(){_0x16e31e[_0x050c('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16f410,_0x5d320d){return function(_0x3bde8a){if(!_0x3bde8a){_0x16f410[_0x050c('0x1f')](0x194);}return _0x3bde8a;};}function handleError(_0x21b3e5,_0x48c2c8){_0x48c2c8=_0x48c2c8||0x1f4;return function(_0x43b2b1){logger[_0x050c('0x20')](_0x43b2b1['stack']);if(_0x43b2b1[_0x050c('0x21')]){delete _0x43b2b1[_0x050c('0x21')];}_0x21b3e5[_0x050c('0x15')](_0x48c2c8)[_0x050c('0x22')](_0x43b2b1);};}exports['index']=function(_0x3d6b1c,_0x1ae894){var _0x31f674={},_0x5d5fc5={},_0x208e15={'count':0x0,'rows':[]};var _0x139b24=_[_0x050c('0x23')](db[_0x050c('0x24')][_0x050c('0x25')],function(_0x527335){return{'name':_0x527335[_0x050c('0x26')],'type':_0x527335['type'][_0x050c('0x27')]};});_0x5d5fc5[_0x050c('0x28')]=_['map'](_0x139b24,_0x050c('0x21'));_0x5d5fc5[_0x050c('0x29')]=_[_0x050c('0x2a')](_0x3d6b1c['query']);_0x5d5fc5[_0x050c('0x2b')]=_[_0x050c('0x2c')](_0x5d5fc5[_0x050c('0x28')],_0x5d5fc5[_0x050c('0x29')]);_0x31f674[_0x050c('0x2d')]=_[_0x050c('0x2c')](_0x5d5fc5[_0x050c('0x28')],qs[_0x050c('0x2e')](_0x3d6b1c[_0x050c('0x29')][_0x050c('0x2e')]));_0x31f674[_0x050c('0x2d')]=_0x31f674[_0x050c('0x2d')][_0x050c('0x2f')]?_0x31f674[_0x050c('0x2d')]:_0x5d5fc5['model'];if(!_0x3d6b1c['query'][_0x050c('0x30')](_0x050c('0x31'))){_0x31f674[_0x050c('0x19')]=qs[_0x050c('0x19')](_0x3d6b1c[_0x050c('0x29')][_0x050c('0x19')]);_0x31f674[_0x050c('0x17')]=qs[_0x050c('0x17')](_0x3d6b1c[_0x050c('0x29')][_0x050c('0x17')]);}_0x31f674[_0x050c('0x32')]=qs[_0x050c('0x33')](_0x3d6b1c[_0x050c('0x29')][_0x050c('0x33')]);_0x31f674['where']=qs['filters'](_['pick'](_0x3d6b1c[_0x050c('0x29')],_0x5d5fc5[_0x050c('0x2b')]),_0x139b24);if(_0x3d6b1c[_0x050c('0x29')][_0x050c('0x34')]){_0x31f674[_0x050c('0x35')]=_['merge'](_0x31f674[_0x050c('0x35')],{'$or':_[_0x050c('0x23')](_0x139b24,function(_0x35ab74){if(_0x35ab74[_0x050c('0x36')]!==_0x050c('0x37')){var _0x4770d3={};_0x4770d3[_0x35ab74[_0x050c('0x21')]]={'$like':'%'+_0x3d6b1c['query'][_0x050c('0x34')]+'%'};return _0x4770d3;}})});}_0x31f674=_[_0x050c('0x38')]({},_0x31f674,_0x3d6b1c[_0x050c('0x39')]);var _0x397a28={'where':_0x31f674['where']};return db[_0x050c('0x24')][_0x050c('0x1a')](_0x397a28)[_0x050c('0x1e')](function(_0x1c8c64){_0x208e15[_0x050c('0x1a')]=_0x1c8c64;if(_0x3d6b1c[_0x050c('0x29')][_0x050c('0x3a')]){_0x31f674[_0x050c('0x3b')]=[{'all':!![]}];}return db[_0x050c('0x24')]['findAll'](_0x31f674);})[_0x050c('0x1e')](function(_0x208423){_0x208e15[_0x050c('0x3c')]=_0x208423;return _0x208e15;})[_0x050c('0x1e')](respondWithFilteredResult(_0x1ae894,_0x31f674))[_0x050c('0x3d')](handleError(_0x1ae894,null));};exports[_0x050c('0x3e')]=function(_0x3855fb,_0x3258d8){var _0x49b3b9={'raw':!![],'where':{'id':_0x3855fb[_0x050c('0x3f')]['id']}},_0x108ea9={};_0x108ea9[_0x050c('0x28')]=_[_0x050c('0x2a')](db[_0x050c('0x24')][_0x050c('0x25')]);_0x108ea9[_0x050c('0x29')]=_['keys'](_0x3855fb[_0x050c('0x29')]);_0x108ea9[_0x050c('0x2b')]=_[_0x050c('0x2c')](_0x108ea9[_0x050c('0x28')],_0x108ea9[_0x050c('0x29')]);_0x49b3b9[_0x050c('0x2d')]=_[_0x050c('0x2c')](_0x108ea9['model'],qs[_0x050c('0x2e')](_0x3855fb['query']['fields']));_0x49b3b9[_0x050c('0x2d')]=_0x49b3b9[_0x050c('0x2d')]['length']?_0x49b3b9[_0x050c('0x2d')]:_0x108ea9['model'];if(_0x3855fb[_0x050c('0x29')][_0x050c('0x3a')]){_0x49b3b9[_0x050c('0x3b')]=[{'all':!![]}];}_0x49b3b9=_[_0x050c('0x38')]({},_0x49b3b9,_0x3855fb['options']);return db[_0x050c('0x24')][_0x050c('0x40')](_0x49b3b9)[_0x050c('0x1e')](handleEntityNotFound(_0x3258d8,null))[_0x050c('0x1e')](respondWithResult(_0x3258d8,null))[_0x050c('0x3d')](handleError(_0x3258d8,null));};exports[_0x050c('0x41')]=function(_0x251ac5,_0x58809c){return db['SquareRecording'][_0x050c('0x41')](_0x251ac5[_0x050c('0x42')],{})['then'](respondWithResult(_0x58809c,0xc9))[_0x050c('0x3d')](handleError(_0x58809c,null));};exports[_0x050c('0x43')]=function(_0x41ba8e,_0x5e071d){if(_0x41ba8e[_0x050c('0x42')]['id']){delete _0x41ba8e['body']['id'];}return db['SquareRecording']['find']({'where':{'id':_0x41ba8e['params']['id']}})[_0x050c('0x1e')](handleEntityNotFound(_0x5e071d,null))['then'](saveUpdates(_0x41ba8e[_0x050c('0x42')],null))[_0x050c('0x1e')](respondWithResult(_0x5e071d,null))[_0x050c('0x3d')](handleError(_0x5e071d,null));};exports[_0x050c('0x44')]=function(_0x5aa1a8,_0x2894bb,_0x1897ce){var _0x59fd2c=require('../../components/encryptor');var _0x5d693c=![];var _0x3b91b7={};if(_0x5aa1a8[_0x050c('0x29')][_0x050c('0x36')]&&_0x5aa1a8[_0x050c('0x29')][_0x050c('0x36')]==='uniqueid'){_0x3b91b7[_0x050c('0x45')]=_0x5aa1a8[_0x050c('0x3f')]['id'];}else{_0x3b91b7['id']=_0x5aa1a8[_0x050c('0x3f')]['id'];}return db[_0x050c('0x24')][_0x050c('0x40')]({'where':_0x3b91b7,'attributes':['id',_0x050c('0x46'),_0x050c('0x47')],'raw':!![]})[_0x050c('0x1e')](handleEntityNotFound(_0x2894bb,null))[_0x050c('0x1e')](function(_0x5a9165){if(_0x5a9165){var _0x2ddfc1=_0x5a9165['savePath'];var _0x197227=util[_0x050c('0x48')](_0x050c('0x49'),_0x2ddfc1);if(fs[_0x050c('0x4a')](_0x197227)){_0x5d693c=!![];return _0x59fd2c[_0x050c('0x4b')](_0x197227,_0x2ddfc1,config[_0x050c('0x4c')][_0x050c('0x4d')])['then'](function(){return _0x5a9165;});}return _0x5a9165;}})['then'](function(_0x2f586a){if(_0x2f586a){var _0x43de16=_0x2f586a[_0x050c('0x46')];if(!fs[_0x050c('0x4a')](_0x43de16)){throw new db[(_0x050c('0x4e'))]['ValidationError'](_0x050c('0x4f'));}if(_0x2f586a[_0x050c('0x47')]){return _0x2894bb[_0x050c('0x44')](_0x43de16,_0x2f586a[_0x050c('0x47')]+path[_0x050c('0x50')](_0x43de16),function(){if(_0x5d693c){fs['unlink'](_0x43de16);}});}else{return _0x2894bb['download'](_0x43de16,function(_0x323d5d){if(_0x5d693c){fs['unlink'](_0x43de16);}});}}})['catch'](function(_0x5398fb){if(_0x5398fb[_0x050c('0x51')]==='SquareRecording\x20not\x20found'){_0x2894bb[_0x050c('0x15')](0x194)[_0x050c('0x22')](_0x050c('0x52'));}else{return handleError(_0x2894bb,null);}});};exports[_0x050c('0x53')]=function(_0x52a906,_0xfc1aa4){return db[_0x050c('0x24')]['find']({'where':{'id':_0x52a906['params']['id']}})[_0x050c('0x1e')](function(_0x6f77fc){if(_[_0x050c('0x54')](_0x6f77fc)){throw new ReferenceError('Entity\x20not\x20found');}return _0x6f77fc;})[_0x050c('0x1e')](function(_0x25cbfc){var _0x3dad5d=_0x25cbfc[_0x050c('0x46')];logger[_0x050c('0x55')]('cancellazione\x20fisica\x20documento\x20%s',_0x3dad5d);if(!_['isNil'](_0x25cbfc['savePath'])&&fs[_0x050c('0x4a')](_0x3dad5d)){logger[_0x050c('0x55')](_0x050c('0x56')+_0x3dad5d+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x050c('0x57')](_0x3dad5d);}_0x3dad5d=_0x3dad5d+_0x050c('0x58');if(!_[_0x050c('0x54')](_0x25cbfc['savePath'])&&fs[_0x050c('0x4a')](_0x3dad5d)){logger['info']('File:\x20\x22'+_0x3dad5d+_0x050c('0x59'));fs[_0x050c('0x57')](_0x3dad5d);}return _0x25cbfc;})[_0x050c('0x1e')](function(_0x1d8900){if(!_0x1d8900)throw new InternalError();return _0x1d8900[_0x050c('0x53')]();})['then'](function(){_0xfc1aa4[_0x050c('0x15')](0xcc)['end']();})[_0x050c('0x3d')](handleError(_0xfc1aa4,null));}; \ No newline at end of file +var _0xbb4e=['../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','decryptFile','secrets','existsSync','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','info','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','apply','reject','save','then','destroy','end','error','stack','name','index','map','SquareRecording','fieldName','type','key','model','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','fields','find','create','body','update','download'];(function(_0x11ba46,_0x1d6752){var _0x1c8c6f=function(_0x4cf96f){while(--_0x4cf96f){_0x11ba46['push'](_0x11ba46['shift']());}};_0x1c8c6f(++_0x1d6752);}(_0xbb4e,0x1e2));var _0xebb4=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0xbb4e[_0x2341c6];return _0x54c34d;};'use strict';var emlformat=require(_0xebb4('0x0'));var rimraf=require(_0xebb4('0x1'));var zipdir=require(_0xebb4('0x2'));var jsonpatch=require(_0xebb4('0x3'));var rp=require('request-promise');var moment=require(_0xebb4('0x4'));var BPromise=require(_0xebb4('0x5'));var Mustache=require(_0xebb4('0x6'));var util=require(_0xebb4('0x7'));var path=require(_0xebb4('0x8'));var sox=require(_0xebb4('0x9'));var csv=require('to-csv');var ejs=require(_0xebb4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xebb4('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xebb4('0xc'));var querystring=require(_0xebb4('0xd'));var Papa=require('papaparse');var Redis=require(_0xebb4('0xe'));var authService=require(_0xebb4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xebb4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xebb4('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xebb4('0x12'));var db=require(_0xebb4('0x13'))['db'];function respondWithStatusCode(_0x1f96fe,_0x3fdea1){_0x3fdea1=_0x3fdea1||0xcc;return function(_0x5dab8a){if(_0x5dab8a){return _0x1f96fe[_0xebb4('0x14')](_0x3fdea1);}return _0x1f96fe[_0xebb4('0x15')](_0x3fdea1)['end']();};}function respondWithResult(_0x2012ac,_0x1bc07d){_0x1bc07d=_0x1bc07d||0xc8;return function(_0x21dc71){if(_0x21dc71){return _0x2012ac[_0xebb4('0x15')](_0x1bc07d)[_0xebb4('0x16')](_0x21dc71);}};}function respondWithFilteredResult(_0x14f2d0,_0x177ea2){return function(_0x42da14){if(_0x42da14){var _0x553af4=typeof _0x177ea2['offset']===_0xebb4('0x17')&&typeof _0x177ea2[_0xebb4('0x18')]===_0xebb4('0x17');var _0x3600b6=_0x42da14['count'];var _0x7650e0=_0x553af4?0x0:_0x177ea2[_0xebb4('0x19')];var _0x4c045f=_0x553af4?_0x42da14[_0xebb4('0x1a')]:_0x177ea2[_0xebb4('0x19')]+_0x177ea2[_0xebb4('0x18')];var _0x4acef7;if(_0x4c045f>=_0x3600b6){_0x4c045f=_0x3600b6;_0x4acef7=0xc8;}else{_0x4acef7=0xce;}_0x14f2d0[_0xebb4('0x15')](_0x4acef7);return _0x14f2d0[_0xebb4('0x1b')]('Content-Range',_0x7650e0+'-'+_0x4c045f+'/'+_0x3600b6)[_0xebb4('0x16')](_0x42da14);}return null;};}function patchUpdates(_0xf53a87){return function(_0x5add85){try{jsonpatch[_0xebb4('0x1c')](_0x5add85,_0xf53a87,!![]);}catch(_0x285530){return BPromise[_0xebb4('0x1d')](_0x285530);}return _0x5add85[_0xebb4('0x1e')]();};}function saveUpdates(_0x36319e,_0x582067){return function(_0x41316a){if(_0x41316a){return _0x41316a['update'](_0x36319e)[_0xebb4('0x1f')](function(_0x209382){return _0x209382;});}return null;};}function removeEntity(_0x5dbaee,_0x4e1d4c){return function(_0x46b5b6){if(_0x46b5b6){return _0x46b5b6[_0xebb4('0x20')]()[_0xebb4('0x1f')](function(){_0x5dbaee[_0xebb4('0x15')](0xcc)[_0xebb4('0x21')]();});}};}function handleEntityNotFound(_0x45bb47,_0x4bb5ec){return function(_0x20b968){if(!_0x20b968){_0x45bb47[_0xebb4('0x14')](0x194);}return _0x20b968;};}function handleError(_0x16f460,_0x2e956a){_0x2e956a=_0x2e956a||0x1f4;return function(_0x5a6727){logger[_0xebb4('0x22')](_0x5a6727[_0xebb4('0x23')]);if(_0x5a6727[_0xebb4('0x24')]){delete _0x5a6727[_0xebb4('0x24')];}_0x16f460[_0xebb4('0x15')](_0x2e956a)['send'](_0x5a6727);};}exports[_0xebb4('0x25')]=function(_0xdd3466,_0x26359f){var _0x4980fa={},_0x12d6b0={},_0x402b5f={'count':0x0,'rows':[]};var _0x5357b0=_[_0xebb4('0x26')](db[_0xebb4('0x27')]['rawAttributes'],function(_0x3cec0d){return{'name':_0x3cec0d[_0xebb4('0x28')],'type':_0x3cec0d[_0xebb4('0x29')][_0xebb4('0x2a')]};});_0x12d6b0[_0xebb4('0x2b')]=_[_0xebb4('0x26')](_0x5357b0,_0xebb4('0x24'));_0x12d6b0[_0xebb4('0x2c')]=_['keys'](_0xdd3466['query']);_0x12d6b0[_0xebb4('0x2d')]=_['intersection'](_0x12d6b0[_0xebb4('0x2b')],_0x12d6b0[_0xebb4('0x2c')]);_0x4980fa[_0xebb4('0x2e')]=_[_0xebb4('0x2f')](_0x12d6b0[_0xebb4('0x2b')],qs['fields'](_0xdd3466[_0xebb4('0x2c')]['fields']));_0x4980fa[_0xebb4('0x2e')]=_0x4980fa[_0xebb4('0x2e')][_0xebb4('0x30')]?_0x4980fa[_0xebb4('0x2e')]:_0x12d6b0['model'];if(!_0xdd3466[_0xebb4('0x2c')][_0xebb4('0x31')](_0xebb4('0x32'))){_0x4980fa[_0xebb4('0x18')]=qs[_0xebb4('0x18')](_0xdd3466[_0xebb4('0x2c')][_0xebb4('0x18')]);_0x4980fa[_0xebb4('0x19')]=qs['offset'](_0xdd3466[_0xebb4('0x2c')][_0xebb4('0x19')]);}_0x4980fa['order']=qs['sort'](_0xdd3466[_0xebb4('0x2c')]['sort']);_0x4980fa['where']=qs[_0xebb4('0x2d')](_[_0xebb4('0x33')](_0xdd3466[_0xebb4('0x2c')],_0x12d6b0[_0xebb4('0x2d')]),_0x5357b0);if(_0xdd3466[_0xebb4('0x2c')][_0xebb4('0x34')]){_0x4980fa[_0xebb4('0x35')]=_[_0xebb4('0x36')](_0x4980fa[_0xebb4('0x35')],{'$or':_[_0xebb4('0x26')](_0x5357b0,function(_0x679750){if(_0x679750[_0xebb4('0x29')]!==_0xebb4('0x37')){var _0x27907b={};_0x27907b[_0x679750[_0xebb4('0x24')]]={'$like':'%'+_0xdd3466[_0xebb4('0x2c')][_0xebb4('0x34')]+'%'};return _0x27907b;}})});}_0x4980fa=_['merge']({},_0x4980fa,_0xdd3466['options']);var _0x3836d9={'where':_0x4980fa[_0xebb4('0x35')]};return db[_0xebb4('0x27')][_0xebb4('0x1a')](_0x3836d9)['then'](function(_0x3859de){_0x402b5f[_0xebb4('0x1a')]=_0x3859de;if(_0xdd3466[_0xebb4('0x2c')][_0xebb4('0x38')]){_0x4980fa[_0xebb4('0x39')]=[{'all':!![]}];}return db[_0xebb4('0x27')][_0xebb4('0x3a')](_0x4980fa);})['then'](function(_0x40eb6c){_0x402b5f[_0xebb4('0x3b')]=_0x40eb6c;return _0x402b5f;})[_0xebb4('0x1f')](respondWithFilteredResult(_0x26359f,_0x4980fa))[_0xebb4('0x3c')](handleError(_0x26359f,null));};exports['show']=function(_0x3d8c33,_0x524036){var _0x29fa33={'raw':!![],'where':{'id':_0x3d8c33[_0xebb4('0x3d')]['id']}},_0x53e1b7={};_0x53e1b7[_0xebb4('0x2b')]=_[_0xebb4('0x3e')](db[_0xebb4('0x27')][_0xebb4('0x3f')]);_0x53e1b7[_0xebb4('0x2c')]=_[_0xebb4('0x3e')](_0x3d8c33['query']);_0x53e1b7[_0xebb4('0x2d')]=_['intersection'](_0x53e1b7[_0xebb4('0x2b')],_0x53e1b7[_0xebb4('0x2c')]);_0x29fa33['attributes']=_[_0xebb4('0x2f')](_0x53e1b7[_0xebb4('0x2b')],qs[_0xebb4('0x40')](_0x3d8c33[_0xebb4('0x2c')][_0xebb4('0x40')]));_0x29fa33[_0xebb4('0x2e')]=_0x29fa33[_0xebb4('0x2e')][_0xebb4('0x30')]?_0x29fa33[_0xebb4('0x2e')]:_0x53e1b7[_0xebb4('0x2b')];if(_0x3d8c33[_0xebb4('0x2c')][_0xebb4('0x38')]){_0x29fa33[_0xebb4('0x39')]=[{'all':!![]}];}_0x29fa33=_[_0xebb4('0x36')]({},_0x29fa33,_0x3d8c33['options']);return db[_0xebb4('0x27')][_0xebb4('0x41')](_0x29fa33)[_0xebb4('0x1f')](handleEntityNotFound(_0x524036,null))['then'](respondWithResult(_0x524036,null))[_0xebb4('0x3c')](handleError(_0x524036,null));};exports[_0xebb4('0x42')]=function(_0x2b611c,_0x228307){return db['SquareRecording']['create'](_0x2b611c[_0xebb4('0x43')],{})['then'](respondWithResult(_0x228307,0xc9))[_0xebb4('0x3c')](handleError(_0x228307,null));};exports[_0xebb4('0x44')]=function(_0x30c229,_0x584245){if(_0x30c229['body']['id']){delete _0x30c229[_0xebb4('0x43')]['id'];}return db['SquareRecording'][_0xebb4('0x41')]({'where':{'id':_0x30c229[_0xebb4('0x3d')]['id']}})[_0xebb4('0x1f')](handleEntityNotFound(_0x584245,null))['then'](saveUpdates(_0x30c229[_0xebb4('0x43')],null))['then'](respondWithResult(_0x584245,null))[_0xebb4('0x3c')](handleError(_0x584245,null));};exports[_0xebb4('0x45')]=function(_0x300a90,_0x33ba69,_0x3ab99d){var _0x9ddf92=require(_0xebb4('0x46'));var _0x5876ce=![];var _0x3f6ce4={};if(_0x300a90[_0xebb4('0x2c')]['type']&&_0x300a90[_0xebb4('0x2c')][_0xebb4('0x29')]===_0xebb4('0x47')){_0x3f6ce4['uniqueid']=_0x300a90['params']['id'];}else{_0x3f6ce4['id']=_0x300a90[_0xebb4('0x3d')]['id'];}return db['SquareRecording'][_0xebb4('0x41')]({'where':_0x3f6ce4,'attributes':['id','savePath',_0xebb4('0x48')],'raw':!![]})[_0xebb4('0x1f')](handleEntityNotFound(_0x33ba69,null))['then'](function(_0x507f25){if(_0x507f25){var _0x4dc5a1=_0x507f25[_0xebb4('0x49')];var _0x3095e7=util[_0xebb4('0x4a')](_0xebb4('0x4b'),_0x4dc5a1);if(fs['existsSync'](_0x3095e7)){_0x5876ce=!![];return _0x9ddf92[_0xebb4('0x4c')](_0x3095e7,_0x4dc5a1,config[_0xebb4('0x4d')]['recording'])[_0xebb4('0x1f')](function(){return _0x507f25;});}return _0x507f25;}})[_0xebb4('0x1f')](function(_0x29d046){if(_0x29d046){var _0x21a03f=_0x29d046[_0xebb4('0x49')];if(!fs[_0xebb4('0x4e')](_0x21a03f)){throw new db['Sequelize']['ValidationError']('SquareRecording\x20not\x20found');}if(_0x29d046['filename']){return _0x33ba69[_0xebb4('0x45')](_0x21a03f,_0x29d046[_0xebb4('0x48')]+path[_0xebb4('0x4f')](_0x21a03f),function(){if(_0x5876ce){fs[_0xebb4('0x50')](_0x21a03f);}});}else{return _0x33ba69[_0xebb4('0x45')](_0x21a03f,function(_0x2463b1){if(_0x5876ce){fs['unlink'](_0x21a03f);}});}}})[_0xebb4('0x3c')](function(_0x2494ab){if(_0x2494ab[_0xebb4('0x51')]===_0xebb4('0x52')){_0x33ba69[_0xebb4('0x15')](0x194)['send'](_0xebb4('0x53'));}else{return handleError(_0x33ba69,null);}});};exports[_0xebb4('0x20')]=function(_0x4f6733,_0x4f5f99){return db[_0xebb4('0x27')][_0xebb4('0x41')]({'where':{'id':_0x4f6733['params']['id']}})[_0xebb4('0x1f')](function(_0x18963b){if(_[_0xebb4('0x54')](_0x18963b)){throw new ReferenceError(_0xebb4('0x55'));}return _0x18963b;})[_0xebb4('0x1f')](function(_0x67dd15){var _0x4c6332=_0x67dd15[_0xebb4('0x49')];logger['info'](_0xebb4('0x56'),_0x4c6332);if(!_[_0xebb4('0x54')](_0x67dd15[_0xebb4('0x49')])&&fs['existsSync'](_0x4c6332)){logger['info'](_0xebb4('0x57')+_0x4c6332+_0xebb4('0x58'));fs[_0xebb4('0x59')](_0x4c6332);}_0x4c6332=_0x4c6332+_0xebb4('0x5a');if(!_[_0xebb4('0x54')](_0x67dd15[_0xebb4('0x49')])&&fs[_0xebb4('0x4e')](_0x4c6332)){logger[_0xebb4('0x5b')](_0xebb4('0x57')+_0x4c6332+_0xebb4('0x58'));fs['unlinkSync'](_0x4c6332);}return _0x67dd15;})[_0xebb4('0x1f')](function(_0x1867a4){if(!_0x1867a4)throw new InternalError();return _0x1867a4[_0xebb4('0x20')]();})['then'](function(){_0x4f5f99['status'](0xcc)[_0xebb4('0x21')]();})[_0xebb4('0x3c')](handleError(_0x4f5f99,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 54718f8..510dfbc 100644 --- a/server/api/squareRecording/squareRecording.model.js +++ b/server/api/squareRecording/squareRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4813=['../../config/environment','./squareRecording.attributes','exports','define','lodash','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x3c99d6,_0x4127f5){var _0x261ba0=function(_0x276311){while(--_0x276311){_0x3c99d6['push'](_0x3c99d6['shift']());}};_0x261ba0(++_0x4127f5);}(_0x4813,0xdc));var _0x3481=function(_0x3fc994,_0x1d539e){_0x3fc994=_0x3fc994-0x0;var _0x212d47=_0x4813[_0x3fc994];return _0x212d47;};'use strict';var _=require(_0x3481('0x0'));var util=require('util');var logger=require(_0x3481('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3481('0x2'));var rp=require(_0x3481('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3481('0x4'));var config=require(_0x3481('0x5'));var attributes=require(_0x3481('0x6'));module[_0x3481('0x7')]=function(_0x42114d,_0x322ab3){return _0x42114d[_0x3481('0x8')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbbb=['exports','define','SquareRecording','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2fedda,_0x1b8df7){var _0x19ffc2=function(_0x2ac171){while(--_0x2ac171){_0x2fedda['push'](_0x2fedda['shift']());}};_0x19ffc2(++_0x1b8df7);}(_0xfbbb,0x1b3));var _0xbfbb=function(_0x13beb9,_0x1f14c9){_0x13beb9=_0x13beb9-0x0;var _0xa3df3d=_0xfbbb[_0x13beb9];return _0xa3df3d;};'use strict';var _=require(_0xbfbb('0x0'));var util=require(_0xbfbb('0x1'));var logger=require(_0xbfbb('0x2'))(_0xbfbb('0x3'));var moment=require(_0xbfbb('0x4'));var BPromise=require(_0xbfbb('0x5'));var rp=require(_0xbfbb('0x6'));var fs=require('fs');var path=require(_0xbfbb('0x7'));var rimraf=require(_0xbfbb('0x8'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module[_0xbfbb('0x9')]=function(_0x568492,_0x89ee36){return _0x568492[_0xbfbb('0xa')](_0xbfbb('0xb'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index e348c2d..2cfdcb2 100644 --- a/server/api/squareRecording/squareRecording.rpc.js +++ b/server/api/squareRecording/squareRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a1d=['stringify','error','message','info','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s'];(function(_0x112296,_0x56d20b){var _0xed360f=function(_0x5f5169){while(--_0x5f5169){_0x112296['push'](_0x112296['shift']());}};_0xed360f(++_0x56d20b);}(_0x7a1d,0x1e8));var _0xd7a1=function(_0x224ded,_0x1b2757){_0x224ded=_0x224ded-0x0;var _0x3f2c61=_0x7a1d[_0x224ded];return _0x3f2c61;};'use strict';var _=require('lodash');var util=require(_0xd7a1('0x0'));var moment=require(_0xd7a1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd7a1('0x2'));var db=require(_0xd7a1('0x3'))['db'];var utils=require(_0xd7a1('0x4'));var logger=require(_0xd7a1('0x5'))(_0xd7a1('0x6'));var config=require(_0xd7a1('0x7'));var jayson=require(_0xd7a1('0x8'));var client=jayson[_0xd7a1('0x9')][_0xd7a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2281ad,_0x11d410,_0x3abef8){return new BPromise(function(_0xb6a203,_0x14e2d6){return client[_0xd7a1('0xb')](_0x2281ad,_0x3abef8)['then'](function(_0x4f63d6){logger['info'](_0xd7a1('0xc'),_0x11d410,_0xd7a1('0xd'));logger[_0xd7a1('0xe')](_0xd7a1('0xf'),_0x11d410,'request\x20sent',JSON[_0xd7a1('0x10')](_0x4f63d6));if(_0x4f63d6[_0xd7a1('0x11')]){if(_0x4f63d6[_0xd7a1('0x11')]['code']===0x1f4){logger[_0xd7a1('0x11')](_0xd7a1('0xc'),_0x11d410,_0x4f63d6['error'][_0xd7a1('0x12')]);return _0x14e2d6(_0x4f63d6[_0xd7a1('0x11')][_0xd7a1('0x12')]);}logger[_0xd7a1('0x11')](_0xd7a1('0xc'),_0x11d410,_0x4f63d6['error'][_0xd7a1('0x12')]);return _0xb6a203(_0x4f63d6[_0xd7a1('0x11')][_0xd7a1('0x12')]);}else{logger[_0xd7a1('0x13')](_0xd7a1('0xc'),_0x11d410,_0xd7a1('0xd'));_0xb6a203(_0x4f63d6[_0xd7a1('0x14')][_0xd7a1('0x12')]);}})[_0xd7a1('0x15')](function(_0x2ae32a){logger[_0xd7a1('0x11')](_0xd7a1('0xc'),_0x11d410,_0x2ae32a);_0x14e2d6(_0x2ae32a);});});}exports[_0xd7a1('0x16')]=function(_0x538f3a){var _0x5218fa=this;return new Promise(function(_0x1666b4,_0x85bce5){return db[_0xd7a1('0x17')][_0xd7a1('0x18')](_0x538f3a[_0xd7a1('0x19')],{'raw':_0x538f3a[_0xd7a1('0x1a')]?_0x538f3a[_0xd7a1('0x1a')][_0xd7a1('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x39e22e){logger[_0xd7a1('0x13')](_0xd7a1('0x16'),_0x538f3a);logger[_0xd7a1('0xe')](_0xd7a1('0x16'),_0x538f3a,JSON[_0xd7a1('0x10')](_0x39e22e));_0x1666b4(_0x39e22e);})[_0xd7a1('0x15')](function(_0x370fbe){logger[_0xd7a1('0x11')]('CreateSquareRecording',_0x370fbe['message'],_0x538f3a);_0x85bce5(_0x5218fa['error'](0x1f4,_0x370fbe[_0xd7a1('0x12')]));});});}; \ No newline at end of file +var _0x8d9f=['client','then','info','SquareRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','CreateSquareRecording','create','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2422ca,_0x5b4fac){var _0x23d310=function(_0x1e4c50){while(--_0x1e4c50){_0x2422ca['push'](_0x2422ca['shift']());}};_0x23d310(++_0x5b4fac);}(_0x8d9f,0xb6));var _0xf8d9=function(_0x400401,_0x30dbcf){_0x400401=_0x400401-0x0;var _0x345c39=_0x8d9f[_0x400401];return _0x345c39;};'use strict';var _=require('lodash');var util=require(_0xf8d9('0x0'));var moment=require(_0xf8d9('0x1'));var BPromise=require(_0xf8d9('0x2'));var rs=require(_0xf8d9('0x3'));var fs=require('fs');var Redis=require(_0xf8d9('0x4'));var db=require(_0xf8d9('0x5'))['db'];var utils=require(_0xf8d9('0x6'));var logger=require(_0xf8d9('0x7'))('rpc');var config=require(_0xf8d9('0x8'));var jayson=require(_0xf8d9('0x9'));var client=jayson[_0xf8d9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5246bd,_0x19ef3d,_0xe88ebb){return new BPromise(function(_0x571719,_0x2b1ee8){return client['request'](_0x5246bd,_0xe88ebb)[_0xf8d9('0xb')](function(_0x50636c){logger[_0xf8d9('0xc')](_0xf8d9('0xd'),_0x19ef3d,'request\x20sent');logger[_0xf8d9('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x19ef3d,_0xf8d9('0xf'),JSON[_0xf8d9('0x10')](_0x50636c));if(_0x50636c[_0xf8d9('0x11')]){if(_0x50636c[_0xf8d9('0x11')]['code']===0x1f4){logger[_0xf8d9('0x11')](_0xf8d9('0xd'),_0x19ef3d,_0x50636c[_0xf8d9('0x11')]['message']);return _0x2b1ee8(_0x50636c['error'][_0xf8d9('0x12')]);}logger[_0xf8d9('0x11')]('SquareRecording,\x20%s,\x20%s',_0x19ef3d,_0x50636c[_0xf8d9('0x11')][_0xf8d9('0x12')]);return _0x571719(_0x50636c[_0xf8d9('0x11')][_0xf8d9('0x12')]);}else{logger[_0xf8d9('0xc')](_0xf8d9('0xd'),_0x19ef3d,_0xf8d9('0xf'));_0x571719(_0x50636c[_0xf8d9('0x13')][_0xf8d9('0x12')]);}})['catch'](function(_0xf08bdf){logger['error'](_0xf8d9('0xd'),_0x19ef3d,_0xf08bdf);_0x2b1ee8(_0xf08bdf);});});}exports[_0xf8d9('0x14')]=function(_0x594c46){var _0x467940=this;return new Promise(function(_0x450efb,_0x13a213){return db['SquareRecording'][_0xf8d9('0x15')](_0x594c46['body'],{'raw':_0x594c46[_0xf8d9('0x16')]?_0x594c46['options'][_0xf8d9('0x17')]===undefined?!![]:![]:!![]})[_0xf8d9('0xb')](function(_0x1961b1){logger[_0xf8d9('0xc')]('CreateSquareRecording',_0x594c46);logger['debug'](_0xf8d9('0x14'),_0x594c46,JSON[_0xf8d9('0x10')](_0x1961b1));_0x450efb(_0x1961b1);})['catch'](function(_0x3b97e1){logger[_0xf8d9('0x11')](_0xf8d9('0x14'),_0x3b97e1[_0xf8d9('0x12')],_0x594c46);_0x13a213(_0x467940[_0xf8d9('0x11')](0x1f4,_0x3b97e1[_0xf8d9('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index a5c47de..4e7e52c 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x125c20,_0xed483f){var _0x3f32cc=function(_0x597857){while(--_0x597857){_0x125c20['push'](_0x125c20['shift']());}};_0x3f32cc(++_0xed483f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0xedf0ce,_0x1f1114){var _0x2afffc=function(_0x523c4e){while(--_0x523c4e){_0xedf0ce['push'](_0xedf0ce['shift']());}};_0x2afffc(++_0x1f1114);}(_0xe706,0xa3));var _0x6e70=function(_0x3fbb91,_0x5ec106){_0x3fbb91=_0x3fbb91-0x0;var _0x3eb213=_0xe706[_0x3fbb91];return _0x3eb213;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 58e9930..3de195f 100644 --- a/server/api/squareReport/squareReport.attributes.js +++ b/server/api/squareReport/squareReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe455=['DATE','BOOLEAN','exports','STRING'];(function(_0x29246e,_0x4b8409){var _0x1bc568=function(_0x5506aa){while(--_0x5506aa){_0x29246e['push'](_0x29246e['shift']());}};_0x1bc568(++_0x4b8409);}(_0xe455,0x1ca));var _0x5e45=function(_0x454612,_0x3a2e0b){_0x454612=_0x454612-0x0;var _0x5d3a47=_0xe455[_0x454612];return _0x5d3a47;};'use strict';var Sequelize=require('sequelize');module[_0x5e45('0x0')]={'network':{'type':Sequelize[_0x5e45('0x1')]},'network_script':{'type':Sequelize[_0x5e45('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x5e45('0x1')]},'type':{'type':Sequelize[_0x5e45('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x5e45('0x1')]},'callerid':{'type':Sequelize[_0x5e45('0x1')]},'calleridname':{'type':Sequelize[_0x5e45('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x5e45('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x5e45('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5e45('0x1')]},'threadid':{'type':Sequelize[_0x5e45('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5e45('0x2')]},'bot':{'type':Sequelize[_0x5e45('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xae21=['DATE','BOOLEAN','exports','STRING'];(function(_0x4bd489,_0x559d05){var _0x48eaf1=function(_0x5143d0){while(--_0x5143d0){_0x4bd489['push'](_0x4bd489['shift']());}};_0x48eaf1(++_0x559d05);}(_0xae21,0x142));var _0x1ae2=function(_0x15edb3,_0x4f4dc3){_0x15edb3=_0x15edb3-0x0;var _0x3a0e7b=_0xae21[_0x15edb3];return _0x3a0e7b;};'use strict';var Sequelize=require('sequelize');module[_0x1ae2('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x1ae2('0x1')]},'request':{'type':Sequelize[_0x1ae2('0x1')]},'channel':{'type':Sequelize[_0x1ae2('0x1')]},'language':{'type':Sequelize[_0x1ae2('0x1')]},'type':{'type':Sequelize[_0x1ae2('0x1')]},'uniqueid':{'type':Sequelize[_0x1ae2('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x1ae2('0x1')]},'calleridname':{'type':Sequelize[_0x1ae2('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x1ae2('0x1')]},'callington':{'type':Sequelize[_0x1ae2('0x1')]},'callingtns':{'type':Sequelize[_0x1ae2('0x1')]},'dnid':{'type':Sequelize[_0x1ae2('0x1')]},'rdnis':{'type':Sequelize[_0x1ae2('0x1')]},'context':{'type':Sequelize[_0x1ae2('0x1')]},'extension':{'type':Sequelize[_0x1ae2('0x1')]},'priority':{'type':Sequelize[_0x1ae2('0x1')]},'enhanced':{'type':Sequelize[_0x1ae2('0x1')]},'accountcode':{'type':Sequelize[_0x1ae2('0x1')]},'threadid':{'type':Sequelize[_0x1ae2('0x1')]},'project_name':{'type':Sequelize[_0x1ae2('0x1')]},'joinAt':{'type':Sequelize[_0x1ae2('0x2')]},'leaveAt':{'type':Sequelize[_0x1ae2('0x2')]},'bot':{'type':Sequelize[_0x1ae2('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 0b01246..00045f9 100644 --- a/server/api/squareReport/squareReport.controller.js +++ b/server/api/squareReport/squareReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b0f=['includeAll','create','body','describe','eml-format','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','index','SquareReport','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','include','rows','catch','show','params'];(function(_0x591a1d,_0x173809){var _0x16fc20=function(_0x409cc0){while(--_0x409cc0){_0x591a1d['push'](_0x591a1d['shift']());}};_0x16fc20(++_0x173809);}(_0x6b0f,0x1e7));var _0xf6b0=function(_0x19befd,_0x2ffbb6){_0x19befd=_0x19befd-0x0;var _0x2913e9=_0x6b0f[_0x19befd];return _0x2913e9;};'use strict';var emlformat=require(_0xf6b0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf6b0('0x1'));var moment=require(_0xf6b0('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf6b0('0x3'));var path=require(_0xf6b0('0x4'));var sox=require(_0xf6b0('0x5'));var csv=require(_0xf6b0('0x6'));var ejs=require(_0xf6b0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf6b0('0x8'));var squel=require(_0xf6b0('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf6b0('0xa'));var toCsv=require(_0xf6b0('0x6'));var querystring=require(_0xf6b0('0xb'));var Papa=require(_0xf6b0('0xc'));var Redis=require(_0xf6b0('0xd'));var authService=require(_0xf6b0('0xe'));var qs=require(_0xf6b0('0xf'));var as=require(_0xf6b0('0x10'));var hardwareService=require(_0xf6b0('0x11'));var logger=require(_0xf6b0('0x12'))(_0xf6b0('0x13'));var utils=require('../../config/utils');var config=require(_0xf6b0('0x14'));var licenseUtil=require(_0xf6b0('0x15'));var db=require(_0xf6b0('0x16'))['db'];function respondWithStatusCode(_0x41c5c9,_0x42d1cd){_0x42d1cd=_0x42d1cd||0xcc;return function(_0x6f260b){if(_0x6f260b){return _0x41c5c9['sendStatus'](_0x42d1cd);}return _0x41c5c9[_0xf6b0('0x17')](_0x42d1cd)[_0xf6b0('0x18')]();};}function respondWithResult(_0x1c30f7,_0x464f7f){_0x464f7f=_0x464f7f||0xc8;return function(_0x13e167){if(_0x13e167){return _0x1c30f7[_0xf6b0('0x17')](_0x464f7f)[_0xf6b0('0x19')](_0x13e167);}};}function respondWithFilteredResult(_0x295f34,_0x1124fa){return function(_0x564d7f){if(_0x564d7f){var _0x13f54d=typeof _0x1124fa['offset']==='undefined'&&typeof _0x1124fa[_0xf6b0('0x1a')]===_0xf6b0('0x1b');var _0x4ad8f1=_0x564d7f[_0xf6b0('0x1c')];var _0x20f938=_0x13f54d?0x0:_0x1124fa[_0xf6b0('0x1d')];var _0x165a89=_0x13f54d?_0x564d7f[_0xf6b0('0x1c')]:_0x1124fa[_0xf6b0('0x1d')]+_0x1124fa[_0xf6b0('0x1a')];var _0x580a5a;if(_0x165a89>=_0x4ad8f1){_0x165a89=_0x4ad8f1;_0x580a5a=0xc8;}else{_0x580a5a=0xce;}_0x295f34[_0xf6b0('0x17')](_0x580a5a);return _0x295f34[_0xf6b0('0x1e')](_0xf6b0('0x1f'),_0x20f938+'-'+_0x165a89+'/'+_0x4ad8f1)[_0xf6b0('0x19')](_0x564d7f);}return null;};}function patchUpdates(_0x251ef0){return function(_0x5ceca5){try{jsonpatch[_0xf6b0('0x20')](_0x5ceca5,_0x251ef0,!![]);}catch(_0x5042a0){return BPromise[_0xf6b0('0x21')](_0x5042a0);}return _0x5ceca5['save']();};}function saveUpdates(_0x59b0c8,_0x47e61c){return function(_0x2403a2){if(_0x2403a2){return _0x2403a2[_0xf6b0('0x22')](_0x59b0c8)[_0xf6b0('0x23')](function(_0x389e86){return _0x389e86;});}return null;};}function removeEntity(_0x559fa4,_0x347057){return function(_0x304f8f){if(_0x304f8f){return _0x304f8f[_0xf6b0('0x24')]()[_0xf6b0('0x23')](function(){_0x559fa4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e93a0,_0x1c57b6){return function(_0x31384b){if(!_0x31384b){_0x5e93a0[_0xf6b0('0x25')](0x194);}return _0x31384b;};}function handleError(_0x6a5e6a,_0x6d6100){_0x6d6100=_0x6d6100||0x1f4;return function(_0x1334bc){logger['error'](_0x1334bc[_0xf6b0('0x26')]);if(_0x1334bc['name']){delete _0x1334bc[_0xf6b0('0x27')];}_0x6a5e6a[_0xf6b0('0x17')](_0x6d6100)['send'](_0x1334bc);};}exports[_0xf6b0('0x28')]=function(_0x4f8a75,_0x49c17d){var _0x1731a2={},_0x2fb447={},_0x55de05={'count':0x0,'rows':[]};var _0x5ccd4f=_['map'](db[_0xf6b0('0x29')][_0xf6b0('0x2a')],function(_0x24b275){return{'name':_0x24b275[_0xf6b0('0x2b')],'type':_0x24b275['type'][_0xf6b0('0x2c')]};});_0x2fb447['model']=_[_0xf6b0('0x2d')](_0x5ccd4f,'name');_0x2fb447[_0xf6b0('0x2e')]=_[_0xf6b0('0x2f')](_0x4f8a75[_0xf6b0('0x2e')]);_0x2fb447[_0xf6b0('0x30')]=_[_0xf6b0('0x31')](_0x2fb447[_0xf6b0('0x32')],_0x2fb447[_0xf6b0('0x2e')]);_0x1731a2[_0xf6b0('0x33')]=_[_0xf6b0('0x31')](_0x2fb447[_0xf6b0('0x32')],qs[_0xf6b0('0x34')](_0x4f8a75['query'][_0xf6b0('0x34')]));_0x1731a2[_0xf6b0('0x33')]=_0x1731a2[_0xf6b0('0x33')][_0xf6b0('0x35')]?_0x1731a2[_0xf6b0('0x33')]:_0x2fb447['model'];if(!_0x4f8a75['query'][_0xf6b0('0x36')](_0xf6b0('0x37'))){_0x1731a2[_0xf6b0('0x1a')]=qs['limit'](_0x4f8a75[_0xf6b0('0x2e')][_0xf6b0('0x1a')]);_0x1731a2[_0xf6b0('0x1d')]=qs[_0xf6b0('0x1d')](_0x4f8a75[_0xf6b0('0x2e')]['offset']);}_0x1731a2[_0xf6b0('0x38')]=qs[_0xf6b0('0x39')](_0x4f8a75[_0xf6b0('0x2e')][_0xf6b0('0x39')]);_0x1731a2['where']=qs[_0xf6b0('0x30')](_['pick'](_0x4f8a75[_0xf6b0('0x2e')],_0x2fb447[_0xf6b0('0x30')]),_0x5ccd4f);if(_0x4f8a75[_0xf6b0('0x2e')]['filter']){_0x1731a2[_0xf6b0('0x3a')]=_[_0xf6b0('0x3b')](_0x1731a2[_0xf6b0('0x3a')],{'$or':_[_0xf6b0('0x2d')](_0x5ccd4f,function(_0x1bd13e){if(_0x1bd13e['type']!=='VIRTUAL'){var _0x35e153={};_0x35e153[_0x1bd13e[_0xf6b0('0x27')]]={'$like':'%'+_0x4f8a75['query']['filter']+'%'};return _0x35e153;}})});}_0x1731a2=_['merge']({},_0x1731a2,_0x4f8a75['options']);var _0x4b2589={'where':_0x1731a2[_0xf6b0('0x3a')]};return db['SquareReport'][_0xf6b0('0x1c')](_0x4b2589)[_0xf6b0('0x23')](function(_0x5698e6){_0x55de05[_0xf6b0('0x1c')]=_0x5698e6;if(_0x4f8a75[_0xf6b0('0x2e')]['includeAll']){_0x1731a2[_0xf6b0('0x3c')]=[{'all':!![]}];}return db[_0xf6b0('0x29')]['findAll'](_0x1731a2);})[_0xf6b0('0x23')](function(_0x26a15d){_0x55de05[_0xf6b0('0x3d')]=_0x26a15d;return _0x55de05;})[_0xf6b0('0x23')](respondWithFilteredResult(_0x49c17d,_0x1731a2))[_0xf6b0('0x3e')](handleError(_0x49c17d,null));};exports[_0xf6b0('0x3f')]=function(_0x11a238,_0x17b9a6){var _0x4324fb={'raw':!![],'where':{'id':_0x11a238[_0xf6b0('0x40')]['id']}},_0x1774be={};_0x1774be[_0xf6b0('0x32')]=_[_0xf6b0('0x2f')](db[_0xf6b0('0x29')][_0xf6b0('0x2a')]);_0x1774be[_0xf6b0('0x2e')]=_[_0xf6b0('0x2f')](_0x11a238[_0xf6b0('0x2e')]);_0x1774be['filters']=_[_0xf6b0('0x31')](_0x1774be['model'],_0x1774be['query']);_0x4324fb[_0xf6b0('0x33')]=_[_0xf6b0('0x31')](_0x1774be[_0xf6b0('0x32')],qs[_0xf6b0('0x34')](_0x11a238[_0xf6b0('0x2e')][_0xf6b0('0x34')]));_0x4324fb[_0xf6b0('0x33')]=_0x4324fb[_0xf6b0('0x33')][_0xf6b0('0x35')]?_0x4324fb[_0xf6b0('0x33')]:_0x1774be['model'];if(_0x11a238[_0xf6b0('0x2e')][_0xf6b0('0x41')]){_0x4324fb[_0xf6b0('0x3c')]=[{'all':!![]}];}_0x4324fb=_[_0xf6b0('0x3b')]({},_0x4324fb,_0x11a238['options']);return db[_0xf6b0('0x29')]['find'](_0x4324fb)[_0xf6b0('0x23')](handleEntityNotFound(_0x17b9a6,null))['then'](respondWithResult(_0x17b9a6,null))[_0xf6b0('0x3e')](handleError(_0x17b9a6,null));};exports[_0xf6b0('0x42')]=function(_0x2cf17c,_0x5eb076){return db[_0xf6b0('0x29')]['create'](_0x2cf17c[_0xf6b0('0x43')],{})[_0xf6b0('0x23')](respondWithResult(_0x5eb076,0xc9))[_0xf6b0('0x3e')](handleError(_0x5eb076,null));};exports[_0xf6b0('0x22')]=function(_0x12482,_0xdc7b68){if(_0x12482[_0xf6b0('0x43')]['id']){delete _0x12482[_0xf6b0('0x43')]['id'];}return db[_0xf6b0('0x29')]['find']({'where':{'id':_0x12482[_0xf6b0('0x40')]['id']}})['then'](handleEntityNotFound(_0xdc7b68,null))[_0xf6b0('0x23')](saveUpdates(_0x12482[_0xf6b0('0x43')],null))[_0xf6b0('0x23')](respondWithResult(_0xdc7b68,null))[_0xf6b0('0x3e')](handleError(_0xdc7b68,null));};exports[_0xf6b0('0x24')]=function(_0x177f46,_0x11ae70){return db['SquareReport']['find']({'where':{'id':_0x177f46[_0xf6b0('0x40')]['id']}})[_0xf6b0('0x23')](handleEntityNotFound(_0x11ae70,null))[_0xf6b0('0x23')](removeEntity(_0x11ae70,null))[_0xf6b0('0x3e')](handleError(_0x11ae70,null));};exports['describe']=function(_0x566ba9,_0x3dfa4d){return db['SquareReport'][_0xf6b0('0x44')]()[_0xf6b0('0x23')](respondWithResult(_0x3dfa4d,null))[_0xf6b0('0x3e')](handleError(_0x3dfa4d,null));}; \ No newline at end of file +var _0x3476=['merge','include','findAll','rows','catch','params','includeAll','options','find','create','body','destroy','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','status','error','stack','name','send','index','map','SquareReport','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','VIRTUAL','filter'];(function(_0xd6bb26,_0x63ff2){var _0x122866=function(_0x4e0feb){while(--_0x4e0feb){_0xd6bb26['push'](_0xd6bb26['shift']());}};_0x122866(++_0x63ff2);}(_0x3476,0x1ce));var _0x6347=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x3476[_0x1b4b23];return _0x2a325b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6347('0x0'));var rp=require('request-promise');var moment=require(_0x6347('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x6347('0x2'));var util=require(_0x6347('0x3'));var path=require(_0x6347('0x4'));var sox=require(_0x6347('0x5'));var csv=require(_0x6347('0x6'));var ejs=require(_0x6347('0x7'));var fs=require('fs');var fs_extra=require(_0x6347('0x8'));var _=require(_0x6347('0x9'));var squel=require(_0x6347('0xa'));var crypto=require(_0x6347('0xb'));var jsforce=require(_0x6347('0xc'));var deskjs=require(_0x6347('0xd'));var toCsv=require(_0x6347('0x6'));var querystring=require(_0x6347('0xe'));var Papa=require('papaparse');var Redis=require(_0x6347('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6347('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6347('0x11'));var logger=require(_0x6347('0x12'))(_0x6347('0x13'));var utils=require(_0x6347('0x14'));var config=require(_0x6347('0x15'));var licenseUtil=require(_0x6347('0x16'));var db=require(_0x6347('0x17'))['db'];function respondWithStatusCode(_0x155f55,_0xbe8aff){_0xbe8aff=_0xbe8aff||0xcc;return function(_0x5399f7){if(_0x5399f7){return _0x155f55[_0x6347('0x18')](_0xbe8aff);}return _0x155f55['status'](_0xbe8aff)['end']();};}function respondWithResult(_0x36dd35,_0x42262f){_0x42262f=_0x42262f||0xc8;return function(_0x52e088){if(_0x52e088){return _0x36dd35['status'](_0x42262f)[_0x6347('0x19')](_0x52e088);}};}function respondWithFilteredResult(_0x37db90,_0x31ece6){return function(_0xcec8f9){if(_0xcec8f9){var _0x241044=typeof _0x31ece6[_0x6347('0x1a')]===_0x6347('0x1b')&&typeof _0x31ece6[_0x6347('0x1c')]===_0x6347('0x1b');var _0x25f010=_0xcec8f9[_0x6347('0x1d')];var _0x3a1678=_0x241044?0x0:_0x31ece6['offset'];var _0x5aeccd=_0x241044?_0xcec8f9[_0x6347('0x1d')]:_0x31ece6['offset']+_0x31ece6[_0x6347('0x1c')];var _0x190d56;if(_0x5aeccd>=_0x25f010){_0x5aeccd=_0x25f010;_0x190d56=0xc8;}else{_0x190d56=0xce;}_0x37db90['status'](_0x190d56);return _0x37db90[_0x6347('0x1e')](_0x6347('0x1f'),_0x3a1678+'-'+_0x5aeccd+'/'+_0x25f010)[_0x6347('0x19')](_0xcec8f9);}return null;};}function patchUpdates(_0x5e61b8){return function(_0x1043a0){try{jsonpatch[_0x6347('0x20')](_0x1043a0,_0x5e61b8,!![]);}catch(_0x373b35){return BPromise[_0x6347('0x21')](_0x373b35);}return _0x1043a0[_0x6347('0x22')]();};}function saveUpdates(_0x8ccf2b,_0x54accc){return function(_0x32a66d){if(_0x32a66d){return _0x32a66d[_0x6347('0x23')](_0x8ccf2b)['then'](function(_0x47abb6){return _0x47abb6;});}return null;};}function removeEntity(_0x348ee6,_0x1214f9){return function(_0x37e728){if(_0x37e728){return _0x37e728['destroy']()[_0x6347('0x24')](function(){_0x348ee6[_0x6347('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d6d06,_0x193e7d){return function(_0x1d81ad){if(!_0x1d81ad){_0x2d6d06['sendStatus'](0x194);}return _0x1d81ad;};}function handleError(_0x30de95,_0x229dcd){_0x229dcd=_0x229dcd||0x1f4;return function(_0x1fe181){logger[_0x6347('0x26')](_0x1fe181[_0x6347('0x27')]);if(_0x1fe181[_0x6347('0x28')]){delete _0x1fe181['name'];}_0x30de95[_0x6347('0x25')](_0x229dcd)[_0x6347('0x29')](_0x1fe181);};}exports[_0x6347('0x2a')]=function(_0x5dadca,_0x5a9ab9){var _0x19d192={},_0x55515d={},_0x25b698={'count':0x0,'rows':[]};var _0x16398c=_[_0x6347('0x2b')](db[_0x6347('0x2c')]['rawAttributes'],function(_0x56439f){return{'name':_0x56439f[_0x6347('0x2d')],'type':_0x56439f[_0x6347('0x2e')]['key']};});_0x55515d[_0x6347('0x2f')]=_[_0x6347('0x2b')](_0x16398c,_0x6347('0x28'));_0x55515d[_0x6347('0x30')]=_[_0x6347('0x31')](_0x5dadca[_0x6347('0x30')]);_0x55515d['filters']=_[_0x6347('0x32')](_0x55515d['model'],_0x55515d[_0x6347('0x30')]);_0x19d192[_0x6347('0x33')]=_[_0x6347('0x32')](_0x55515d['model'],qs[_0x6347('0x34')](_0x5dadca[_0x6347('0x30')][_0x6347('0x34')]));_0x19d192[_0x6347('0x33')]=_0x19d192[_0x6347('0x33')][_0x6347('0x35')]?_0x19d192[_0x6347('0x33')]:_0x55515d[_0x6347('0x2f')];if(!_0x5dadca[_0x6347('0x30')][_0x6347('0x36')](_0x6347('0x37'))){_0x19d192['limit']=qs[_0x6347('0x1c')](_0x5dadca[_0x6347('0x30')][_0x6347('0x1c')]);_0x19d192[_0x6347('0x1a')]=qs[_0x6347('0x1a')](_0x5dadca[_0x6347('0x30')][_0x6347('0x1a')]);}_0x19d192[_0x6347('0x38')]=qs[_0x6347('0x39')](_0x5dadca[_0x6347('0x30')][_0x6347('0x39')]);_0x19d192['where']=qs[_0x6347('0x3a')](_[_0x6347('0x3b')](_0x5dadca[_0x6347('0x30')],_0x55515d['filters']),_0x16398c);if(_0x5dadca[_0x6347('0x30')]['filter']){_0x19d192[_0x6347('0x3c')]=_['merge'](_0x19d192[_0x6347('0x3c')],{'$or':_[_0x6347('0x2b')](_0x16398c,function(_0x166d7d){if(_0x166d7d[_0x6347('0x2e')]!==_0x6347('0x3d')){var _0x570911={};_0x570911[_0x166d7d[_0x6347('0x28')]]={'$like':'%'+_0x5dadca[_0x6347('0x30')][_0x6347('0x3e')]+'%'};return _0x570911;}})});}_0x19d192=_[_0x6347('0x3f')]({},_0x19d192,_0x5dadca['options']);var _0x596e07={'where':_0x19d192[_0x6347('0x3c')]};return db[_0x6347('0x2c')][_0x6347('0x1d')](_0x596e07)[_0x6347('0x24')](function(_0x45b482){_0x25b698[_0x6347('0x1d')]=_0x45b482;if(_0x5dadca[_0x6347('0x30')]['includeAll']){_0x19d192[_0x6347('0x40')]=[{'all':!![]}];}return db['SquareReport'][_0x6347('0x41')](_0x19d192);})[_0x6347('0x24')](function(_0x50946e){_0x25b698[_0x6347('0x42')]=_0x50946e;return _0x25b698;})[_0x6347('0x24')](respondWithFilteredResult(_0x5a9ab9,_0x19d192))[_0x6347('0x43')](handleError(_0x5a9ab9,null));};exports['show']=function(_0x4d5dd3,_0x2bbebe){var _0x1563a9={'raw':!![],'where':{'id':_0x4d5dd3[_0x6347('0x44')]['id']}},_0x14c6d3={};_0x14c6d3[_0x6347('0x2f')]=_['keys'](db[_0x6347('0x2c')]['rawAttributes']);_0x14c6d3[_0x6347('0x30')]=_[_0x6347('0x31')](_0x4d5dd3[_0x6347('0x30')]);_0x14c6d3[_0x6347('0x3a')]=_['intersection'](_0x14c6d3[_0x6347('0x2f')],_0x14c6d3[_0x6347('0x30')]);_0x1563a9[_0x6347('0x33')]=_['intersection'](_0x14c6d3[_0x6347('0x2f')],qs['fields'](_0x4d5dd3[_0x6347('0x30')]['fields']));_0x1563a9[_0x6347('0x33')]=_0x1563a9[_0x6347('0x33')][_0x6347('0x35')]?_0x1563a9[_0x6347('0x33')]:_0x14c6d3[_0x6347('0x2f')];if(_0x4d5dd3['query'][_0x6347('0x45')]){_0x1563a9[_0x6347('0x40')]=[{'all':!![]}];}_0x1563a9=_[_0x6347('0x3f')]({},_0x1563a9,_0x4d5dd3[_0x6347('0x46')]);return db['SquareReport'][_0x6347('0x47')](_0x1563a9)[_0x6347('0x24')](handleEntityNotFound(_0x2bbebe,null))[_0x6347('0x24')](respondWithResult(_0x2bbebe,null))[_0x6347('0x43')](handleError(_0x2bbebe,null));};exports[_0x6347('0x48')]=function(_0x3f6e04,_0x1d404c){return db['SquareReport']['create'](_0x3f6e04[_0x6347('0x49')],{})[_0x6347('0x24')](respondWithResult(_0x1d404c,0xc9))[_0x6347('0x43')](handleError(_0x1d404c,null));};exports[_0x6347('0x23')]=function(_0x200865,_0x2cb6a9){if(_0x200865[_0x6347('0x49')]['id']){delete _0x200865[_0x6347('0x49')]['id'];}return db[_0x6347('0x2c')][_0x6347('0x47')]({'where':{'id':_0x200865[_0x6347('0x44')]['id']}})[_0x6347('0x24')](handleEntityNotFound(_0x2cb6a9,null))['then'](saveUpdates(_0x200865[_0x6347('0x49')],null))[_0x6347('0x24')](respondWithResult(_0x2cb6a9,null))[_0x6347('0x43')](handleError(_0x2cb6a9,null));};exports[_0x6347('0x4a')]=function(_0x4aa308,_0x3beb62){return db[_0x6347('0x2c')][_0x6347('0x47')]({'where':{'id':_0x4aa308[_0x6347('0x44')]['id']}})[_0x6347('0x24')](handleEntityNotFound(_0x3beb62,null))[_0x6347('0x24')](removeEntity(_0x3beb62,null))[_0x6347('0x43')](handleError(_0x3beb62,null));};exports['describe']=function(_0x6598c6,_0x238291){return db[_0x6347('0x2c')]['describe']()[_0x6347('0x24')](respondWithResult(_0x238291,null))['catch'](handleError(_0x238291,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index a858bcb..cb6d385 100644 --- a/server/api/squareReport/squareReport.model.js +++ b/server/api/squareReport/squareReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bd5=['../../config/environment','./squareReport.attributes','define','SquareReport','report_square','uid_pname','project_name','leaveAt','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x214393,_0x243463){var _0x38be1a=function(_0x3e46b0){while(--_0x3e46b0){_0x214393['push'](_0x214393['shift']());}};_0x38be1a(++_0x243463);}(_0x4bd5,0x1bb));var _0x54bd=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x4bd5[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x54bd('0x0'));var util=require(_0x54bd('0x1'));var logger=require('../../config/logger')(_0x54bd('0x2'));var moment=require('moment');var BPromise=require(_0x54bd('0x3'));var rp=require(_0x54bd('0x4'));var fs=require('fs');var path=require(_0x54bd('0x5'));var rimraf=require(_0x54bd('0x6'));var config=require(_0x54bd('0x7'));var attributes=require(_0x54bd('0x8'));module['exports']=function(_0xbaae23,_0x14fc13){return _0xbaae23[_0x54bd('0x9')](_0x54bd('0xa'),attributes,{'tableName':_0x54bd('0xb'),'paranoid':![],'indexes':[{'name':_0x54bd('0xc'),'fields':['uniqueid',_0x54bd('0xd')]},{'name':_0x54bd('0xe'),'fields':[_0x54bd('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda90=['rimraf','../../config/environment','exports','define','SquareReport','report_square','uniqueid','leaveAt','util','api','moment','bluebird','request-promise','path'];(function(_0x1d593b,_0x3f675a){var _0x5e0082=function(_0x410bd7){while(--_0x410bd7){_0x1d593b['push'](_0x1d593b['shift']());}};_0x5e0082(++_0x3f675a);}(_0xda90,0x1e4));var _0x0da9=function(_0x46b24f,_0x3cc2e9){_0x46b24f=_0x46b24f-0x0;var _0x246927=_0xda90[_0x46b24f];return _0x246927;};'use strict';var _=require('lodash');var util=require(_0x0da9('0x0'));var logger=require('../../config/logger')(_0x0da9('0x1'));var moment=require(_0x0da9('0x2'));var BPromise=require(_0x0da9('0x3'));var rp=require(_0x0da9('0x4'));var fs=require('fs');var path=require(_0x0da9('0x5'));var rimraf=require(_0x0da9('0x6'));var config=require(_0x0da9('0x7'));var attributes=require('./squareReport.attributes');module[_0x0da9('0x8')]=function(_0x132d81,_0x4700ce){return _0x132d81[_0x0da9('0x9')](_0x0da9('0xa'),attributes,{'tableName':_0x0da9('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x0da9('0xc'),'project_name']},{'name':_0x0da9('0xd'),'fields':[_0x0da9('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 2c59363..494ae2a 100644 --- a/server/api/squareReport/squareReport.rpc.js +++ b/server/api/squareReport/squareReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4b8=['limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','CreateSquareReport','SquareReport','create','body','options','raw','debug','UpdateSquareReport','update','attributes'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xc4b8,0xa1));var _0x8c4b=function(_0x598d84,_0xbc4d91){_0x598d84=_0x598d84-0x0;var _0x4f01b2=_0xc4b8[_0x598d84];return _0x4f01b2;};'use strict';var _=require(_0x8c4b('0x0'));var util=require(_0x8c4b('0x1'));var moment=require('moment');var BPromise=require(_0x8c4b('0x2'));var rs=require(_0x8c4b('0x3'));var fs=require('fs');var Redis=require(_0x8c4b('0x4'));var db=require(_0x8c4b('0x5'))['db'];var utils=require(_0x8c4b('0x6'));var logger=require('../../config/logger')(_0x8c4b('0x7'));var config=require(_0x8c4b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8c4b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cde00,_0x5608c0,_0x1ec10a){return new BPromise(function(_0x2c1c1f,_0xbab2ea){return client[_0x8c4b('0xa')](_0x3cde00,_0x1ec10a)[_0x8c4b('0xb')](function(_0x1dee69){logger[_0x8c4b('0xc')](_0x8c4b('0xd'),_0x5608c0,'request\x20sent');logger['debug'](_0x8c4b('0xe'),_0x5608c0,'request\x20sent',JSON[_0x8c4b('0xf')](_0x1dee69));if(_0x1dee69['error']){if(_0x1dee69[_0x8c4b('0x10')][_0x8c4b('0x11')]===0x1f4){logger[_0x8c4b('0x10')](_0x8c4b('0xd'),_0x5608c0,_0x1dee69[_0x8c4b('0x10')][_0x8c4b('0x12')]);return _0xbab2ea(_0x1dee69['error'][_0x8c4b('0x12')]);}logger[_0x8c4b('0x10')]('SquareReport,\x20%s,\x20%s',_0x5608c0,_0x1dee69['error'][_0x8c4b('0x12')]);return _0x2c1c1f(_0x1dee69[_0x8c4b('0x10')]['message']);}else{logger[_0x8c4b('0xc')](_0x8c4b('0xd'),_0x5608c0,_0x8c4b('0x13'));_0x2c1c1f(_0x1dee69['result'][_0x8c4b('0x12')]);}})[_0x8c4b('0x14')](function(_0x459507){logger['error']('SquareReport,\x20%s,\x20%s',_0x5608c0,_0x459507);_0xbab2ea(_0x459507);});});}exports[_0x8c4b('0x15')]=function(_0x3e35ba){var _0x61b65=this;return new Promise(function(_0x6842b8,_0x1fe6bc){return db[_0x8c4b('0x16')][_0x8c4b('0x17')](_0x3e35ba[_0x8c4b('0x18')],{'raw':_0x3e35ba[_0x8c4b('0x19')]?_0x3e35ba[_0x8c4b('0x19')][_0x8c4b('0x1a')]===undefined?!![]:![]:!![]})[_0x8c4b('0xb')](function(_0x4fa7f1){logger[_0x8c4b('0xc')]('CreateSquareReport',_0x3e35ba);logger[_0x8c4b('0x1b')]('CreateSquareReport',_0x3e35ba,JSON[_0x8c4b('0xf')](_0x4fa7f1));_0x6842b8(_0x4fa7f1);})[_0x8c4b('0x14')](function(_0x1f9ba9){logger['error']('CreateSquareReport',_0x1f9ba9[_0x8c4b('0x12')],_0x3e35ba);_0x1fe6bc(_0x61b65[_0x8c4b('0x10')](0x1f4,_0x1f9ba9['message']));});});};exports[_0x8c4b('0x1c')]=function(_0x469245){var _0x51ebdc=this;return new Promise(function(_0x4ef5d3,_0x456f7e){return db[_0x8c4b('0x16')][_0x8c4b('0x1d')](_0x469245[_0x8c4b('0x18')],{'raw':_0x469245[_0x8c4b('0x19')]?_0x469245[_0x8c4b('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x469245[_0x8c4b('0x19')]?_0x469245[_0x8c4b('0x19')]['where']||null:null,'attributes':_0x469245[_0x8c4b('0x19')]?_0x469245[_0x8c4b('0x19')][_0x8c4b('0x1e')]||null:null,'limit':_0x469245[_0x8c4b('0x19')]?_0x469245[_0x8c4b('0x19')][_0x8c4b('0x1f')]||null:null})[_0x8c4b('0xb')](function(_0x3a0cb0){logger[_0x8c4b('0xc')](_0x8c4b('0x1c'),_0x469245);logger['debug'](_0x8c4b('0x1c'),_0x469245,JSON[_0x8c4b('0xf')](_0x3a0cb0));_0x4ef5d3(_0x3a0cb0);})[_0x8c4b('0x14')](function(_0x11ff66){logger[_0x8c4b('0x10')](_0x8c4b('0x1c'),_0x11ff66[_0x8c4b('0x12')],_0x469245);_0x456f7e(_0x51ebdc[_0x8c4b('0x10')](0x1f4,_0x11ff66[_0x8c4b('0x12')]));});});}; \ No newline at end of file +var _0x733d=['raw','info','update','where','attributes','limit','UpdateSquareReport','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','SquareReport','create','body','options'];(function(_0x1d4f8f,_0x1c6522){var _0x472d6a=function(_0x5e2892){while(--_0x5e2892){_0x1d4f8f['push'](_0x1d4f8f['shift']());}};_0x472d6a(++_0x1c6522);}(_0x733d,0x1e7));var _0xd733=function(_0x3621e6,_0x281545){_0x3621e6=_0x3621e6-0x0;var _0x4f3d3c=_0x733d[_0x3621e6];return _0x4f3d3c;};'use strict';var _=require(_0xd733('0x0'));var util=require(_0xd733('0x1'));var moment=require(_0xd733('0x2'));var BPromise=require('bluebird');var rs=require(_0xd733('0x3'));var fs=require('fs');var Redis=require(_0xd733('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd733('0x5'));var config=require(_0xd733('0x6'));var jayson=require(_0xd733('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe1c711,_0x5b26f4,_0x2d3dea){return new BPromise(function(_0x347230,_0x1f32c1){return client[_0xd733('0x8')](_0xe1c711,_0x2d3dea)[_0xd733('0x9')](function(_0x5824a9){logger['info'](_0xd733('0xa'),_0x5b26f4,_0xd733('0xb'));logger[_0xd733('0xc')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x5b26f4,'request\x20sent',JSON[_0xd733('0xd')](_0x5824a9));if(_0x5824a9[_0xd733('0xe')]){if(_0x5824a9[_0xd733('0xe')][_0xd733('0xf')]===0x1f4){logger[_0xd733('0xe')](_0xd733('0xa'),_0x5b26f4,_0x5824a9[_0xd733('0xe')][_0xd733('0x10')]);return _0x1f32c1(_0x5824a9[_0xd733('0xe')]['message']);}logger['error'](_0xd733('0xa'),_0x5b26f4,_0x5824a9[_0xd733('0xe')][_0xd733('0x10')]);return _0x347230(_0x5824a9[_0xd733('0xe')][_0xd733('0x10')]);}else{logger['info'](_0xd733('0xa'),_0x5b26f4,_0xd733('0xb'));_0x347230(_0x5824a9[_0xd733('0x11')][_0xd733('0x10')]);}})[_0xd733('0x12')](function(_0x137ac1){logger[_0xd733('0xe')](_0xd733('0xa'),_0x5b26f4,_0x137ac1);_0x1f32c1(_0x137ac1);});});}exports['CreateSquareReport']=function(_0x44fac5){var _0x996fed=this;return new Promise(function(_0x63140e,_0xbb3d0c){return db[_0xd733('0x13')][_0xd733('0x14')](_0x44fac5[_0xd733('0x15')],{'raw':_0x44fac5[_0xd733('0x16')]?_0x44fac5[_0xd733('0x16')][_0xd733('0x17')]===undefined?!![]:![]:!![]})[_0xd733('0x9')](function(_0x3dee1b){logger[_0xd733('0x18')]('CreateSquareReport',_0x44fac5);logger[_0xd733('0xc')]('CreateSquareReport',_0x44fac5,JSON[_0xd733('0xd')](_0x3dee1b));_0x63140e(_0x3dee1b);})[_0xd733('0x12')](function(_0x46b719){logger['error']('CreateSquareReport',_0x46b719[_0xd733('0x10')],_0x44fac5);_0xbb3d0c(_0x996fed[_0xd733('0xe')](0x1f4,_0x46b719[_0xd733('0x10')]));});});};exports['UpdateSquareReport']=function(_0x17b184){var _0x5a987a=this;return new Promise(function(_0xbdf2ac,_0x29669b){return db[_0xd733('0x13')][_0xd733('0x19')](_0x17b184[_0xd733('0x15')],{'raw':_0x17b184['options']?_0x17b184[_0xd733('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17b184['options']?_0x17b184[_0xd733('0x16')][_0xd733('0x1a')]||null:null,'attributes':_0x17b184[_0xd733('0x16')]?_0x17b184[_0xd733('0x16')][_0xd733('0x1b')]||null:null,'limit':_0x17b184[_0xd733('0x16')]?_0x17b184[_0xd733('0x16')][_0xd733('0x1c')]||null:null})['then'](function(_0x436ed7){logger[_0xd733('0x18')](_0xd733('0x1d'),_0x17b184);logger['debug'](_0xd733('0x1d'),_0x17b184,JSON[_0xd733('0xd')](_0x436ed7));_0xbdf2ac(_0x436ed7);})[_0xd733('0x12')](function(_0x2ed572){logger['error'](_0xd733('0x1d'),_0x2ed572[_0xd733('0x10')],_0x17b184);_0x29669b(_0x5a987a[_0xd733('0xe')](0x1f4,_0x2ed572[_0xd733('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 12f7279..4aeffdf 100644 --- a/server/api/squareReportDetail/index.js +++ b/server/api/squareReportDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba76=['index','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x3f420f,_0x2a7664){var _0x3ee07f=function(_0x47df1d){while(--_0x47df1d){_0x3f420f['push'](_0x3f420f['shift']());}};_0x3ee07f(++_0x2a7664);}(_0xba76,0x122));var _0x6ba7=function(_0x4ef425,_0x5c3c5d){_0x4ef425=_0x4ef425-0x0;var _0x4e7ddd=_0xba76[_0x4ef425];return _0x4e7ddd;};'use strict';var multer=require(_0x6ba7('0x0'));var util=require(_0x6ba7('0x1'));var path=require(_0x6ba7('0x2'));var timeout=require(_0x6ba7('0x3'));var express=require(_0x6ba7('0x4'));var router=express[_0x6ba7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6ba7('0x6'));var interaction=require(_0x6ba7('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0x6ba7('0x8')]('/',auth[_0x6ba7('0x9')](),controller[_0x6ba7('0xa')]);router[_0x6ba7('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x6ba7('0xb')]);router[_0x6ba7('0x8')](_0x6ba7('0xc'),auth[_0x6ba7('0x9')](),controller[_0x6ba7('0xd')]);router[_0x6ba7('0xe')]('/',auth['isAuthenticated'](),controller[_0x6ba7('0xf')]);router[_0x6ba7('0x10')]('/:id',auth[_0x6ba7('0x9')](),controller[_0x6ba7('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6ba7('0x12')]);module[_0x6ba7('0x13')]=router; \ No newline at end of file +var _0x3718=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','/describe','isAuthenticated','describe','/:id','show','post','update','delete','destroy','exports','multer','util','Router','fs-extra'];(function(_0x5e5ecb,_0x2b519b){var _0x322b22=function(_0x47bbf2){while(--_0x47bbf2){_0x5e5ecb['push'](_0x5e5ecb['shift']());}};_0x322b22(++_0x2b519b);}(_0x3718,0x13f));var _0x8371=function(_0x874f5c,_0x3fad97){_0x874f5c=_0x874f5c-0x0;var _0x4c83d4=_0x3718[_0x874f5c];return _0x4c83d4;};'use strict';var multer=require(_0x8371('0x0'));var util=require(_0x8371('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8371('0x2')]();var fs_extra=require(_0x8371('0x3'));var auth=require(_0x8371('0x4'));var interaction=require(_0x8371('0x5'));var config=require(_0x8371('0x6'));var controller=require(_0x8371('0x7'));router[_0x8371('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8371('0x8')](_0x8371('0x9'),auth[_0x8371('0xa')](),controller[_0x8371('0xb')]);router[_0x8371('0x8')](_0x8371('0xc'),auth[_0x8371('0xa')](),controller[_0x8371('0xd')]);router[_0x8371('0xe')]('/',auth[_0x8371('0xa')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8371('0xf')]);router[_0x8371('0x10')](_0x8371('0xc'),auth[_0x8371('0xa')](),controller[_0x8371('0x11')]);module[_0x8371('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index b91bbef..5a0a5c9 100644 --- a/server/api/squareReportDetail/squareReportDetail.attributes.js +++ b/server/api/squareReportDetail/squareReportDetail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc560=['TEXT','sequelize','exports','STRING'];(function(_0xc810df,_0x54e865){var _0x4ef5e1=function(_0x443a38){while(--_0x443a38){_0xc810df['push'](_0xc810df['shift']());}};_0x4ef5e1(++_0x54e865);}(_0xc560,0x1c5));var _0x0c56=function(_0x525450,_0x6e0978){_0x525450=_0x525450-0x0;var _0x355ad2=_0xc560[_0x525450];return _0x355ad2;};'use strict';var Sequelize=require(_0x0c56('0x0'));module[_0x0c56('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x0c56('0x2')]},'application':{'type':Sequelize[_0x0c56('0x2')]},'data':{'type':Sequelize[_0x0c56('0x3')]},'project_name':{'type':Sequelize[_0x0c56('0x2')]},'callerid':{'type':Sequelize[_0x0c56('0x2')]}}; \ No newline at end of file +var _0xfa10=['exports','STRING','TEXT'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xfa10,0x10b));var _0x0fa1=function(_0x66913e,_0x4d930d){_0x66913e=_0x66913e-0x0;var _0x939ae0=_0xfa10[_0x66913e];return _0x939ae0;};'use strict';var Sequelize=require('sequelize');module[_0x0fa1('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x0fa1('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x0fa1('0x2')]},'project_name':{'type':Sequelize[_0x0fa1('0x1')]},'callerid':{'type':Sequelize[_0x0fa1('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 6bf207d..4247675 100644 --- a/server/api/squareReportDetail/squareReportDetail.controller.js +++ b/server/api/squareReportDetail/squareReportDetail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x142c=['lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','stack','name','send','map','SquareDetailsReport','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x5a6a6a,_0x2fb4b1){var _0x5144ac=function(_0x2388ca){while(--_0x2388ca){_0x5a6a6a['push'](_0x5a6a6a['shift']());}};_0x5144ac(++_0x2fb4b1);}(_0x142c,0x8a));var _0xc142=function(_0x1a7c0e,_0x2bbe44){_0x1a7c0e=_0x1a7c0e-0x0;var _0x2f601e=_0x142c[_0x1a7c0e];return _0x2f601e;};'use strict';var emlformat=require(_0xc142('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc142('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc142('0x2'));var BPromise=require(_0xc142('0x3'));var Mustache=require(_0xc142('0x4'));var util=require(_0xc142('0x5'));var path=require(_0xc142('0x6'));var sox=require('sox');var csv=require(_0xc142('0x7'));var ejs=require(_0xc142('0x8'));var fs=require('fs');var fs_extra=require(_0xc142('0x9'));var _=require(_0xc142('0xa'));var squel=require(_0xc142('0xb'));var crypto=require(_0xc142('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc142('0xd'));var Papa=require(_0xc142('0xe'));var Redis=require(_0xc142('0xf'));var authService=require(_0xc142('0x10'));var qs=require(_0xc142('0x11'));var as=require(_0xc142('0x12'));var hardwareService=require(_0xc142('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xc142('0x14'));var config=require(_0xc142('0x15'));var licenseUtil=require(_0xc142('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50c763,_0x69f982){_0x69f982=_0x69f982||0xcc;return function(_0x13885f){if(_0x13885f){return _0x50c763['sendStatus'](_0x69f982);}return _0x50c763['status'](_0x69f982)['end']();};}function respondWithResult(_0x1a7b7b,_0x4925b4){_0x4925b4=_0x4925b4||0xc8;return function(_0x466356){if(_0x466356){return _0x1a7b7b['status'](_0x4925b4)[_0xc142('0x17')](_0x466356);}};}function respondWithFilteredResult(_0xc47540,_0xbf13ed){return function(_0x4aab4e){if(_0x4aab4e){var _0x4baa87=typeof _0xbf13ed[_0xc142('0x18')]===_0xc142('0x19')&&typeof _0xbf13ed[_0xc142('0x1a')]===_0xc142('0x19');var _0x1bd50a=_0x4aab4e['count'];var _0x2a5fee=_0x4baa87?0x0:_0xbf13ed[_0xc142('0x18')];var _0x178093=_0x4baa87?_0x4aab4e[_0xc142('0x1b')]:_0xbf13ed['offset']+_0xbf13ed['limit'];var _0x24ff60;if(_0x178093>=_0x1bd50a){_0x178093=_0x1bd50a;_0x24ff60=0xc8;}else{_0x24ff60=0xce;}_0xc47540[_0xc142('0x1c')](_0x24ff60);return _0xc47540[_0xc142('0x1d')](_0xc142('0x1e'),_0x2a5fee+'-'+_0x178093+'/'+_0x1bd50a)[_0xc142('0x17')](_0x4aab4e);}return null;};}function patchUpdates(_0x5be093){return function(_0x1f4d15){try{jsonpatch['apply'](_0x1f4d15,_0x5be093,!![]);}catch(_0xc69901){return BPromise[_0xc142('0x1f')](_0xc69901);}return _0x1f4d15[_0xc142('0x20')]();};}function saveUpdates(_0x5d8cf1,_0x2ac726){return function(_0x18256d){if(_0x18256d){return _0x18256d[_0xc142('0x21')](_0x5d8cf1)[_0xc142('0x22')](function(_0x162c55){return _0x162c55;});}return null;};}function removeEntity(_0x3fbfac,_0x5e898a){return function(_0x2677bd){if(_0x2677bd){return _0x2677bd[_0xc142('0x23')]()[_0xc142('0x22')](function(){_0x3fbfac[_0xc142('0x1c')](0xcc)[_0xc142('0x24')]();});}};}function handleEntityNotFound(_0xd73f9e,_0x2a2888){return function(_0x2b8b09){if(!_0x2b8b09){_0xd73f9e[_0xc142('0x25')](0x194);}return _0x2b8b09;};}function handleError(_0x1c4a9a,_0x119ad9){_0x119ad9=_0x119ad9||0x1f4;return function(_0xf2058d){logger['error'](_0xf2058d[_0xc142('0x26')]);if(_0xf2058d[_0xc142('0x27')]){delete _0xf2058d[_0xc142('0x27')];}_0x1c4a9a[_0xc142('0x1c')](_0x119ad9)[_0xc142('0x28')](_0xf2058d);};}exports['index']=function(_0x168090,_0x56195b){var _0x3a5902={},_0x2ad441={},_0x1b7c41={'count':0x0,'rows':[]};var _0x5dff25=_[_0xc142('0x29')](db[_0xc142('0x2a')][_0xc142('0x2b')],function(_0x5bc799){return{'name':_0x5bc799[_0xc142('0x2c')],'type':_0x5bc799['type'][_0xc142('0x2d')]};});_0x2ad441[_0xc142('0x2e')]=_[_0xc142('0x29')](_0x5dff25,'name');_0x2ad441['query']=_[_0xc142('0x2f')](_0x168090['query']);_0x2ad441[_0xc142('0x30')]=_[_0xc142('0x31')](_0x2ad441['model'],_0x2ad441[_0xc142('0x32')]);_0x3a5902[_0xc142('0x33')]=_[_0xc142('0x31')](_0x2ad441['model'],qs[_0xc142('0x34')](_0x168090[_0xc142('0x32')][_0xc142('0x34')]));_0x3a5902[_0xc142('0x33')]=_0x3a5902[_0xc142('0x33')][_0xc142('0x35')]?_0x3a5902[_0xc142('0x33')]:_0x2ad441[_0xc142('0x2e')];if(!_0x168090[_0xc142('0x32')][_0xc142('0x36')](_0xc142('0x37'))){_0x3a5902['limit']=qs['limit'](_0x168090[_0xc142('0x32')]['limit']);_0x3a5902[_0xc142('0x18')]=qs['offset'](_0x168090[_0xc142('0x32')][_0xc142('0x18')]);}_0x3a5902[_0xc142('0x38')]=qs[_0xc142('0x39')](_0x168090[_0xc142('0x32')]['sort']);_0x3a5902[_0xc142('0x3a')]=qs[_0xc142('0x30')](_[_0xc142('0x3b')](_0x168090['query'],_0x2ad441[_0xc142('0x30')]),_0x5dff25);if(_0x168090[_0xc142('0x32')][_0xc142('0x3c')]){_0x3a5902[_0xc142('0x3a')]=_[_0xc142('0x3d')](_0x3a5902['where'],{'$or':_['map'](_0x5dff25,function(_0x5620de){if(_0x5620de['type']!=='VIRTUAL'){var _0x2e5a0a={};_0x2e5a0a[_0x5620de[_0xc142('0x27')]]={'$like':'%'+_0x168090[_0xc142('0x32')][_0xc142('0x3c')]+'%'};return _0x2e5a0a;}})});}_0x3a5902=_['merge']({},_0x3a5902,_0x168090[_0xc142('0x3e')]);var _0xd9f258={'where':_0x3a5902[_0xc142('0x3a')]};return db[_0xc142('0x2a')][_0xc142('0x1b')](_0xd9f258)[_0xc142('0x22')](function(_0x4c1145){_0x1b7c41[_0xc142('0x1b')]=_0x4c1145;if(_0x168090[_0xc142('0x32')][_0xc142('0x3f')]){_0x3a5902[_0xc142('0x40')]=[{'all':!![]}];}return db[_0xc142('0x2a')][_0xc142('0x41')](_0x3a5902);})['then'](function(_0x4663d2){_0x1b7c41[_0xc142('0x42')]=_0x4663d2;return _0x1b7c41;})[_0xc142('0x22')](respondWithFilteredResult(_0x56195b,_0x3a5902))[_0xc142('0x43')](handleError(_0x56195b,null));};exports[_0xc142('0x44')]=function(_0x510825,_0x9b1e5f){var _0x1be371={'raw':!![],'where':{'id':_0x510825['params']['id']}},_0x55dab8={};_0x55dab8[_0xc142('0x2e')]=_['keys'](db[_0xc142('0x2a')][_0xc142('0x2b')]);_0x55dab8[_0xc142('0x32')]=_[_0xc142('0x2f')](_0x510825[_0xc142('0x32')]);_0x55dab8[_0xc142('0x30')]=_[_0xc142('0x31')](_0x55dab8[_0xc142('0x2e')],_0x55dab8[_0xc142('0x32')]);_0x1be371[_0xc142('0x33')]=_[_0xc142('0x31')](_0x55dab8['model'],qs[_0xc142('0x34')](_0x510825['query'][_0xc142('0x34')]));_0x1be371['attributes']=_0x1be371[_0xc142('0x33')][_0xc142('0x35')]?_0x1be371[_0xc142('0x33')]:_0x55dab8[_0xc142('0x2e')];if(_0x510825[_0xc142('0x32')]['includeAll']){_0x1be371[_0xc142('0x40')]=[{'all':!![]}];}_0x1be371=_[_0xc142('0x3d')]({},_0x1be371,_0x510825[_0xc142('0x3e')]);return db[_0xc142('0x2a')][_0xc142('0x45')](_0x1be371)[_0xc142('0x22')](handleEntityNotFound(_0x9b1e5f,null))[_0xc142('0x22')](respondWithResult(_0x9b1e5f,null))['catch'](handleError(_0x9b1e5f,null));};exports[_0xc142('0x46')]=function(_0x26abae,_0x4e7fd4){return db[_0xc142('0x2a')][_0xc142('0x46')](_0x26abae[_0xc142('0x47')],{})[_0xc142('0x22')](respondWithResult(_0x4e7fd4,0xc9))[_0xc142('0x43')](handleError(_0x4e7fd4,null));};exports[_0xc142('0x21')]=function(_0x4cd60d,_0x4f1f29){if(_0x4cd60d[_0xc142('0x47')]['id']){delete _0x4cd60d[_0xc142('0x47')]['id'];}return db[_0xc142('0x2a')][_0xc142('0x45')]({'where':{'id':_0x4cd60d['params']['id']}})[_0xc142('0x22')](handleEntityNotFound(_0x4f1f29,null))[_0xc142('0x22')](saveUpdates(_0x4cd60d[_0xc142('0x47')],null))[_0xc142('0x22')](respondWithResult(_0x4f1f29,null))[_0xc142('0x43')](handleError(_0x4f1f29,null));};exports['destroy']=function(_0x5207b2,_0x803641){return db[_0xc142('0x2a')][_0xc142('0x45')]({'where':{'id':_0x5207b2[_0xc142('0x48')]['id']}})[_0xc142('0x22')](handleEntityNotFound(_0x803641,null))[_0xc142('0x22')](removeEntity(_0x803641,null))['catch'](handleError(_0x803641,null));};exports[_0xc142('0x49')]=function(_0x2933f1,_0x43d9b3){return db['SquareDetailsReport'][_0xc142('0x49')]()[_0xc142('0x22')](respondWithResult(_0x43d9b3,null))[_0xc142('0x43')](handleError(_0x43d9b3,null));}; \ No newline at end of file +var _0xc131=['nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','rows','catch','show','params','attributes','length','find','create','body','describe','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','update','then','destroy','sendStatus','error','name','send','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields'];(function(_0x4774b4,_0x46fc5f){var _0x5d64a5=function(_0x2cb85d){while(--_0x2cb85d){_0x4774b4['push'](_0x4774b4['shift']());}};_0x5d64a5(++_0x46fc5f);}(_0xc131,0x162));var _0x1c13=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc131[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c13('0x0'));var zipdir=require(_0x1c13('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1c13('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1c13('0x3'));var util=require(_0x1c13('0x4'));var path=require(_0x1c13('0x5'));var sox=require('sox');var csv=require(_0x1c13('0x6'));var ejs=require(_0x1c13('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1c13('0x8'));var squel=require(_0x1c13('0x9'));var crypto=require(_0x1c13('0xa'));var jsforce=require(_0x1c13('0xb'));var deskjs=require(_0x1c13('0xc'));var toCsv=require(_0x1c13('0x6'));var querystring=require('querystring');var Papa=require(_0x1c13('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1c13('0xe'));var as=require(_0x1c13('0xf'));var hardwareService=require(_0x1c13('0x10'));var logger=require('../../config/logger')(_0x1c13('0x11'));var utils=require(_0x1c13('0x12'));var config=require(_0x1c13('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x1c13('0x14'))['db'];function respondWithStatusCode(_0x58795f,_0x4b04c){_0x4b04c=_0x4b04c||0xcc;return function(_0x109a95){if(_0x109a95){return _0x58795f['sendStatus'](_0x4b04c);}return _0x58795f[_0x1c13('0x15')](_0x4b04c)[_0x1c13('0x16')]();};}function respondWithResult(_0x5af459,_0x1f3760){_0x1f3760=_0x1f3760||0xc8;return function(_0x6759a2){if(_0x6759a2){return _0x5af459[_0x1c13('0x15')](_0x1f3760)[_0x1c13('0x17')](_0x6759a2);}};}function respondWithFilteredResult(_0x5efe3a,_0x35b64d){return function(_0xd1c3c6){if(_0xd1c3c6){var _0x12b957=typeof _0x35b64d[_0x1c13('0x18')]===_0x1c13('0x19')&&typeof _0x35b64d[_0x1c13('0x1a')]===_0x1c13('0x19');var _0x1dc061=_0xd1c3c6[_0x1c13('0x1b')];var _0x599338=_0x12b957?0x0:_0x35b64d[_0x1c13('0x18')];var _0x3a494c=_0x12b957?_0xd1c3c6['count']:_0x35b64d[_0x1c13('0x18')]+_0x35b64d[_0x1c13('0x1a')];var _0x500ec9;if(_0x3a494c>=_0x1dc061){_0x3a494c=_0x1dc061;_0x500ec9=0xc8;}else{_0x500ec9=0xce;}_0x5efe3a[_0x1c13('0x15')](_0x500ec9);return _0x5efe3a[_0x1c13('0x1c')]('Content-Range',_0x599338+'-'+_0x3a494c+'/'+_0x1dc061)[_0x1c13('0x17')](_0xd1c3c6);}return null;};}function patchUpdates(_0x565448){return function(_0x218cc4){try{jsonpatch['apply'](_0x218cc4,_0x565448,!![]);}catch(_0x24e5c1){return BPromise['reject'](_0x24e5c1);}return _0x218cc4['save']();};}function saveUpdates(_0x4cfc62,_0x174b9c){return function(_0x3881ec){if(_0x3881ec){return _0x3881ec[_0x1c13('0x1d')](_0x4cfc62)[_0x1c13('0x1e')](function(_0x236bb6){return _0x236bb6;});}return null;};}function removeEntity(_0x4e8aff,_0x5a47d2){return function(_0x54bebd){if(_0x54bebd){return _0x54bebd[_0x1c13('0x1f')]()[_0x1c13('0x1e')](function(){_0x4e8aff[_0x1c13('0x15')](0xcc)[_0x1c13('0x16')]();});}};}function handleEntityNotFound(_0x20faec,_0x1d7dfa){return function(_0x311ed6){if(!_0x311ed6){_0x20faec[_0x1c13('0x20')](0x194);}return _0x311ed6;};}function handleError(_0x4d27ac,_0x196872){_0x196872=_0x196872||0x1f4;return function(_0x3da9b8){logger[_0x1c13('0x21')](_0x3da9b8['stack']);if(_0x3da9b8[_0x1c13('0x22')]){delete _0x3da9b8[_0x1c13('0x22')];}_0x4d27ac['status'](_0x196872)[_0x1c13('0x23')](_0x3da9b8);};}exports['index']=function(_0x2584c1,_0x1f40ce){var _0x5afd18={},_0x597ad6={},_0x293695={'count':0x0,'rows':[]};var _0x6b0779=_[_0x1c13('0x24')](db[_0x1c13('0x25')][_0x1c13('0x26')],function(_0x3734e8){return{'name':_0x3734e8[_0x1c13('0x27')],'type':_0x3734e8[_0x1c13('0x28')][_0x1c13('0x29')]};});_0x597ad6[_0x1c13('0x2a')]=_[_0x1c13('0x24')](_0x6b0779,_0x1c13('0x22'));_0x597ad6[_0x1c13('0x2b')]=_[_0x1c13('0x2c')](_0x2584c1[_0x1c13('0x2b')]);_0x597ad6[_0x1c13('0x2d')]=_[_0x1c13('0x2e')](_0x597ad6[_0x1c13('0x2a')],_0x597ad6['query']);_0x5afd18['attributes']=_[_0x1c13('0x2e')](_0x597ad6[_0x1c13('0x2a')],qs[_0x1c13('0x2f')](_0x2584c1[_0x1c13('0x2b')][_0x1c13('0x2f')]));_0x5afd18['attributes']=_0x5afd18['attributes']['length']?_0x5afd18['attributes']:_0x597ad6[_0x1c13('0x2a')];if(!_0x2584c1[_0x1c13('0x2b')]['hasOwnProperty'](_0x1c13('0x30'))){_0x5afd18[_0x1c13('0x1a')]=qs[_0x1c13('0x1a')](_0x2584c1[_0x1c13('0x2b')][_0x1c13('0x1a')]);_0x5afd18['offset']=qs[_0x1c13('0x18')](_0x2584c1[_0x1c13('0x2b')]['offset']);}_0x5afd18['order']=qs[_0x1c13('0x31')](_0x2584c1[_0x1c13('0x2b')][_0x1c13('0x31')]);_0x5afd18[_0x1c13('0x32')]=qs[_0x1c13('0x2d')](_[_0x1c13('0x33')](_0x2584c1[_0x1c13('0x2b')],_0x597ad6['filters']),_0x6b0779);if(_0x2584c1[_0x1c13('0x2b')]['filter']){_0x5afd18['where']=_[_0x1c13('0x34')](_0x5afd18['where'],{'$or':_[_0x1c13('0x24')](_0x6b0779,function(_0x42f456){if(_0x42f456['type']!==_0x1c13('0x35')){var _0x53e978={};_0x53e978[_0x42f456[_0x1c13('0x22')]]={'$like':'%'+_0x2584c1[_0x1c13('0x2b')][_0x1c13('0x36')]+'%'};return _0x53e978;}})});}_0x5afd18=_['merge']({},_0x5afd18,_0x2584c1[_0x1c13('0x37')]);var _0x5bbd5a={'where':_0x5afd18[_0x1c13('0x32')]};return db[_0x1c13('0x25')][_0x1c13('0x1b')](_0x5bbd5a)[_0x1c13('0x1e')](function(_0x2ea03f){_0x293695[_0x1c13('0x1b')]=_0x2ea03f;if(_0x2584c1[_0x1c13('0x2b')]['includeAll']){_0x5afd18[_0x1c13('0x38')]=[{'all':!![]}];}return db[_0x1c13('0x25')]['findAll'](_0x5afd18);})[_0x1c13('0x1e')](function(_0xe43edf){_0x293695[_0x1c13('0x39')]=_0xe43edf;return _0x293695;})[_0x1c13('0x1e')](respondWithFilteredResult(_0x1f40ce,_0x5afd18))[_0x1c13('0x3a')](handleError(_0x1f40ce,null));};exports[_0x1c13('0x3b')]=function(_0x3495a3,_0x4ae7db){var _0x2b11b6={'raw':!![],'where':{'id':_0x3495a3[_0x1c13('0x3c')]['id']}},_0x4859dc={};_0x4859dc[_0x1c13('0x2a')]=_[_0x1c13('0x2c')](db[_0x1c13('0x25')][_0x1c13('0x26')]);_0x4859dc[_0x1c13('0x2b')]=_[_0x1c13('0x2c')](_0x3495a3[_0x1c13('0x2b')]);_0x4859dc[_0x1c13('0x2d')]=_[_0x1c13('0x2e')](_0x4859dc[_0x1c13('0x2a')],_0x4859dc['query']);_0x2b11b6[_0x1c13('0x3d')]=_[_0x1c13('0x2e')](_0x4859dc[_0x1c13('0x2a')],qs[_0x1c13('0x2f')](_0x3495a3[_0x1c13('0x2b')]['fields']));_0x2b11b6[_0x1c13('0x3d')]=_0x2b11b6[_0x1c13('0x3d')][_0x1c13('0x3e')]?_0x2b11b6[_0x1c13('0x3d')]:_0x4859dc['model'];if(_0x3495a3['query']['includeAll']){_0x2b11b6[_0x1c13('0x38')]=[{'all':!![]}];}_0x2b11b6=_[_0x1c13('0x34')]({},_0x2b11b6,_0x3495a3['options']);return db[_0x1c13('0x25')][_0x1c13('0x3f')](_0x2b11b6)[_0x1c13('0x1e')](handleEntityNotFound(_0x4ae7db,null))[_0x1c13('0x1e')](respondWithResult(_0x4ae7db,null))[_0x1c13('0x3a')](handleError(_0x4ae7db,null));};exports[_0x1c13('0x40')]=function(_0x199acc,_0x3b3fac){return db[_0x1c13('0x25')][_0x1c13('0x40')](_0x199acc[_0x1c13('0x41')],{})[_0x1c13('0x1e')](respondWithResult(_0x3b3fac,0xc9))[_0x1c13('0x3a')](handleError(_0x3b3fac,null));};exports[_0x1c13('0x1d')]=function(_0x492c7d,_0x388585){if(_0x492c7d[_0x1c13('0x41')]['id']){delete _0x492c7d[_0x1c13('0x41')]['id'];}return db[_0x1c13('0x25')][_0x1c13('0x3f')]({'where':{'id':_0x492c7d['params']['id']}})[_0x1c13('0x1e')](handleEntityNotFound(_0x388585,null))['then'](saveUpdates(_0x492c7d['body'],null))[_0x1c13('0x1e')](respondWithResult(_0x388585,null))['catch'](handleError(_0x388585,null));};exports['destroy']=function(_0x506056,_0x427ed0){return db['SquareDetailsReport']['find']({'where':{'id':_0x506056[_0x1c13('0x3c')]['id']}})[_0x1c13('0x1e')](handleEntityNotFound(_0x427ed0,null))[_0x1c13('0x1e')](removeEntity(_0x427ed0,null))[_0x1c13('0x3a')](handleError(_0x427ed0,null));};exports[_0x1c13('0x42')]=function(_0x23adbf,_0x237eee){return db[_0x1c13('0x25')][_0x1c13('0x42')]()[_0x1c13('0x1e')](respondWithResult(_0x237eee,null))[_0x1c13('0x3a')](handleError(_0x237eee,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 9228b5c..44a5271 100644 --- a/server/api/squareReportDetail/squareReportDetail.model.js +++ b/server/api/squareReportDetail/squareReportDetail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e16=['path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xd24dc3,_0x305f5d){var _0xa4697f=function(_0x18b679){while(--_0x18b679){_0xd24dc3['push'](_0xd24dc3['shift']());}};_0xa4697f(++_0x305f5d);}(_0x3e16,0x1c8));var _0x63e1=function(_0x3be82c,_0x3307d7){_0x3be82c=_0x3be82c-0x0;var _0x40d25a=_0x3e16[_0x3be82c];return _0x40d25a;};'use strict';var _=require(_0x63e1('0x0'));var util=require('util');var logger=require(_0x63e1('0x1'))(_0x63e1('0x2'));var moment=require(_0x63e1('0x3'));var BPromise=require(_0x63e1('0x4'));var rp=require(_0x63e1('0x5'));var fs=require('fs');var path=require(_0x63e1('0x6'));var rimraf=require(_0x63e1('0x7'));var config=require(_0x63e1('0x8'));var attributes=require(_0x63e1('0x9'));module[_0x63e1('0xa')]=function(_0x55f09a,_0x33db22){return _0x55f09a[_0x63e1('0xb')](_0x63e1('0xc'),attributes,{'tableName':_0x63e1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x961c=['define','SquareDetailsReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareReportDetail.attributes','exports'];(function(_0x5c401e,_0x462df1){var _0x59f112=function(_0x362b64){while(--_0x362b64){_0x5c401e['push'](_0x5c401e['shift']());}};_0x59f112(++_0x462df1);}(_0x961c,0x6a));var _0xc961=function(_0x2e2b6c,_0x2a38fd){_0x2e2b6c=_0x2e2b6c-0x0;var _0xea6865=_0x961c[_0x2e2b6c];return _0xea6865;};'use strict';var _=require(_0xc961('0x0'));var util=require(_0xc961('0x1'));var logger=require(_0xc961('0x2'))(_0xc961('0x3'));var moment=require(_0xc961('0x4'));var BPromise=require(_0xc961('0x5'));var rp=require(_0xc961('0x6'));var fs=require('fs');var path=require(_0xc961('0x7'));var rimraf=require(_0xc961('0x8'));var config=require('../../config/environment');var attributes=require(_0xc961('0x9'));module[_0xc961('0xa')]=function(_0x5669bb,_0x59ea68){return _0x5669bb[_0xc961('0xb')](_0xc961('0xc'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 05c084f..988d149 100644 --- a/server/api/squareReportDetail/squareReportDetail.rpc.js +++ b/server/api/squareReportDetail/squareReportDetail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b0e=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareDetailsReport','create','options','raw','stringify','lodash','util'];(function(_0x361bd3,_0x6dd8fa){var _0x344bee=function(_0x14bb22){while(--_0x14bb22){_0x361bd3['push'](_0x361bd3['shift']());}};_0x344bee(++_0x6dd8fa);}(_0x1b0e,0x132));var _0xe1b0=function(_0xf76138,_0x3ee58b){_0xf76138=_0xf76138-0x0;var _0xdb57d0=_0x1b0e[_0xf76138];return _0xdb57d0;};'use strict';var _=require(_0xe1b0('0x0'));var util=require(_0xe1b0('0x1'));var moment=require(_0xe1b0('0x2'));var BPromise=require(_0xe1b0('0x3'));var rs=require(_0xe1b0('0x4'));var fs=require('fs');var Redis=require(_0xe1b0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe1b0('0x6'))(_0xe1b0('0x7'));var config=require('../../config/environment');var jayson=require(_0xe1b0('0x8'));var client=jayson[_0xe1b0('0x9')][_0xe1b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52e806,_0x36f5cd,_0x1eef2a){return new BPromise(function(_0x5aacc2,_0x123268){return client[_0xe1b0('0xb')](_0x52e806,_0x1eef2a)[_0xe1b0('0xc')](function(_0x400eee){logger[_0xe1b0('0xd')](_0xe1b0('0xe'),_0x36f5cd,_0xe1b0('0xf'));logger[_0xe1b0('0x10')](_0xe1b0('0x11'),_0x36f5cd,_0xe1b0('0xf'),JSON['stringify'](_0x400eee));if(_0x400eee[_0xe1b0('0x12')]){if(_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x13')]===0x1f4){logger[_0xe1b0('0x12')](_0xe1b0('0xe'),_0x36f5cd,_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);return _0x123268(_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);}logger['error'](_0xe1b0('0xe'),_0x36f5cd,_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);return _0x5aacc2(_0x400eee['error']['message']);}else{logger[_0xe1b0('0xd')](_0xe1b0('0xe'),_0x36f5cd,_0xe1b0('0xf'));_0x5aacc2(_0x400eee[_0xe1b0('0x15')][_0xe1b0('0x14')]);}})[_0xe1b0('0x16')](function(_0x5dfd78){logger[_0xe1b0('0x12')](_0xe1b0('0xe'),_0x36f5cd,_0x5dfd78);_0x123268(_0x5dfd78);});});}exports[_0xe1b0('0x17')]=function(_0x2928b6){var _0x349f90=this;return new Promise(function(_0x5c195f,_0x5b300e){return db['SquareDetailsReport'][_0xe1b0('0x18')](_0x2928b6['body'],{'raw':_0x2928b6[_0xe1b0('0x19')]?_0x2928b6[_0xe1b0('0x19')][_0xe1b0('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3e0a89){logger[_0xe1b0('0xd')]('CreateSquareDetailsReport',_0x2928b6);logger[_0xe1b0('0x10')](_0xe1b0('0x17'),_0x2928b6,JSON[_0xe1b0('0x1b')](_0x3e0a89));_0x5c195f(_0x3e0a89);})['catch'](function(_0x3c0824){logger['error']('CreateSquareDetailsReport',_0x3c0824['message'],_0x2928b6);_0x5b300e(_0x349f90['error'](0x1f4,_0x3c0824[_0xe1b0('0x14')]));});});}; \ No newline at end of file +var _0xd7d1=['debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','create','body','options','raw'];(function(_0x5dda63,_0x1c96a2){var _0xb53e0c=function(_0x5befd4){while(--_0x5befd4){_0x5dda63['push'](_0x5dda63['shift']());}};_0xb53e0c(++_0x1c96a2);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x5f49d5,_0x48ee22){_0x5f49d5=_0x5f49d5-0x0;var _0x1a8f01=_0xd7d1[_0x5f49d5];return _0x1a8f01;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});}exports[_0x1d7d('0x19')]=function(_0x4db4f2){var _0x664e3f=this;return new Promise(function(_0x191024,_0x5cbb8f){return db['SquareDetailsReport'][_0x1d7d('0x1a')](_0x4db4f2[_0x1d7d('0x1b')],{'raw':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2[_0x1d7d('0x1c')][_0x1d7d('0x1d')]===undefined?!![]:![]:!![]})[_0x1d7d('0xe')](function(_0x54d401){logger[_0x1d7d('0xf')](_0x1d7d('0x19'),_0x4db4f2);logger[_0x1d7d('0x1e')]('CreateSquareDetailsReport',_0x4db4f2,JSON[_0x1d7d('0x13')](_0x54d401));_0x191024(_0x54d401);})[_0x1d7d('0x18')](function(_0x4a1cdc){logger['error'](_0x1d7d('0x19'),_0x4a1cdc[_0x1d7d('0x16')],_0x4db4f2);_0x5cbb8f(_0x664e3f[_0x1d7d('0x14')](0x1f4,_0x4a1cdc['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 91d4f8f..9616d17 100644 --- a/server/api/system/index.js +++ b/server/api/system/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb43=['/process/:pid/kill','isAuthenticated','exports','express','Router','../../components/auth/service','get','index'];(function(_0x14aee9,_0x596a94){var _0x6de2f7=function(_0x4561e3){while(--_0x4561e3){_0x14aee9['push'](_0x14aee9['shift']());}};_0x6de2f7(++_0x596a94);}(_0xfb43,0xfb));var _0x3fb4=function(_0x11536c,_0x5dd752){_0x11536c=_0x11536c-0x0;var _0x14cb23=_0xfb43[_0x11536c];return _0x14cb23;};'use strict';var express=require(_0x3fb4('0x0'));var router=express[_0x3fb4('0x1')]();var auth=require(_0x3fb4('0x2'));var controller=require('./system.controller');router[_0x3fb4('0x3')]('/',auth['isAuthenticated'](),controller[_0x3fb4('0x4')]);router['get'](_0x3fb4('0x5'),auth[_0x3fb4('0x6')](),controller['killProcess']);module[_0x3fb4('0x7')]=router; \ No newline at end of file +var _0x630a=['Router','../../components/auth/service','./system.controller','get','isAuthenticated','killProcess','exports','express'];(function(_0x13992d,_0x3029ea){var _0x3d15bf=function(_0x3444f7){while(--_0x3444f7){_0x13992d['push'](_0x13992d['shift']());}};_0x3d15bf(++_0x3029ea);}(_0x630a,0x10f));var _0xa630=function(_0x2f3794,_0x3c3bec){_0x2f3794=_0x2f3794-0x0;var _0x1c9fbe=_0x630a[_0x2f3794];return _0x1c9fbe;};'use strict';var express=require(_0xa630('0x0'));var router=express[_0xa630('0x1')]();var auth=require(_0xa630('0x2'));var controller=require(_0xa630('0x3'));router[_0xa630('0x4')]('/',auth[_0xa630('0x5')](),controller['index']);router[_0xa630('0x4')]('/process/:pid/kill',auth[_0xa630('0x5')](),controller[_0xa630('0x6')]);module[_0xa630('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index c5749ac..6bd6b2f 100644 --- a/server/api/system/system.controller.js +++ b/server/api/system/system.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee57=['lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','api','util'];(function(_0x4db79a,_0x153490){var _0x1c6cb1=function(_0x4ddd11){while(--_0x4ddd11){_0x4db79a['push'](_0x4db79a['shift']());}};_0x1c6cb1(++_0x153490);}(_0xee57,0xc6));var _0x7ee5=function(_0x3f11d6,_0x5ed626){_0x3f11d6=_0x3f11d6-0x0;var _0x133d2e=_0xee57[_0x3f11d6];return _0x133d2e;};'use strict';var info=require(_0x7ee5('0x0'));var exec=require(_0x7ee5('0x1'))['exec'];var logger=require(_0x7ee5('0x2'))(_0x7ee5('0x3'));var util=require(_0x7ee5('0x4'));var BPromise=require('bluebird');var _=require(_0x7ee5('0x5'));function handleError(_0xb160b,_0x5c10eb,_0x376806){_0x5c10eb=_0x5c10eb||0x1f4;return function(_0x14a85e){logger[_0x7ee5('0x6')](_0x7ee5('0x7'),_0x376806,_0x5c10eb,util[_0x7ee5('0x8')](_0x14a85e,{'showHidden':![],'depth':null}));delete _0x14a85e[_0x7ee5('0x9')];_0xb160b[_0x7ee5('0xa')](_0x5c10eb)[_0x7ee5('0xb')](_0x14a85e);};}exports[_0x7ee5('0xc')]=function(_0x255051,_0x17ad6f){return info[_0x7ee5('0xd')]()[_0x7ee5('0xe')](function(_0x1b35c4){return _0x17ad6f['status'](0xc8)[_0x7ee5('0xf')](_0x1b35c4);})[_0x7ee5('0x10')](function(_0x1a2028){return _0x17ad6f['status'](0x1f4)['json'](_0x1a2028);});};exports[_0x7ee5('0x11')]=function(_0x1834a8,_0xa8e301){var _0x580ee0=[_0x7ee5('0x12')];return new BPromise(function(_0x22a59f,_0x411ecc){return exec(util[_0x7ee5('0x13')](_0x7ee5('0x14'),_0x1834a8['params'][_0x7ee5('0x15')]),function(_0x289478,_0x29fcc6,_0x27f214){if(_0x289478){return _0x411ecc(_0x289478);}return _0x22a59f(_0x29fcc6);});})[_0x7ee5('0xe')](function(_0x3b4abf){var _0x39dc2=![];var _0x3c287d=_0x3b4abf[_0x7ee5('0x16')](/\n/);for(var _0x6e7f7=0x0,_0x4ab703=_0x580ee0['length'];_0x6e7f7<_0x4ab703,_0x39dc2===![];_0x6e7f7+=0x1){if(_0x3b4abf[_0x7ee5('0x17')](_0x580ee0[_0x6e7f7])>=0x0){_0x39dc2=!![];}}if(!_0x39dc2){throw new Error(util[_0x7ee5('0x13')](_0x7ee5('0x18'),_0x1834a8[_0x7ee5('0x19')][_0x7ee5('0x15')]));}process[_0x7ee5('0x1a')](_0x1834a8[_0x7ee5('0x19')][_0x7ee5('0x15')],_0x7ee5('0x1b'));return _0xa8e301[_0x7ee5('0xa')](0xc8)['json']({'message':util[_0x7ee5('0x13')](_0x7ee5('0x1c'),_0x1834a8[_0x7ee5('0x19')][_0x7ee5('0x15')])});})['catch'](handleError(_0xa8e301,null,_0x7ee5('0x11')));}; \ No newline at end of file +var _0xd669=['send','index','getAllData','then','status','json','catch','killProcess','format','params','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name'];(function(_0x380084,_0x43c3b5){var _0x239cc7=function(_0x32d40a){while(--_0x32d40a){_0x380084['push'](_0x380084['shift']());}};_0x239cc7(++_0x43c3b5);}(_0xd669,0xcd));var _0x9d66=function(_0x25b5c1,_0x15f706){_0x25b5c1=_0x25b5c1-0x0;var _0x15cb0d=_0xd669[_0x25b5c1];return _0x15cb0d;};'use strict';var info=require(_0x9d66('0x0'));var exec=require(_0x9d66('0x1'))[_0x9d66('0x2')];var logger=require(_0x9d66('0x3'))(_0x9d66('0x4'));var util=require(_0x9d66('0x5'));var BPromise=require(_0x9d66('0x6'));var _=require('lodash');function handleError(_0x4d6f2e,_0x5383d6,_0x58ac43){_0x5383d6=_0x5383d6||0x1f4;return function(_0x36892a){logger[_0x9d66('0x7')](_0x9d66('0x8'),_0x58ac43,_0x5383d6,util[_0x9d66('0x9')](_0x36892a,{'showHidden':![],'depth':null}));delete _0x36892a[_0x9d66('0xa')];_0x4d6f2e['status'](_0x5383d6)[_0x9d66('0xb')](_0x36892a);};}exports[_0x9d66('0xc')]=function(_0x350da0,_0x38078d){return info[_0x9d66('0xd')]()[_0x9d66('0xe')](function(_0x34d52e){return _0x38078d[_0x9d66('0xf')](0xc8)[_0x9d66('0x10')](_0x34d52e);})[_0x9d66('0x11')](function(_0x214180){return _0x38078d[_0x9d66('0xf')](0x1f4)[_0x9d66('0x10')](_0x214180);});};exports[_0x9d66('0x12')]=function(_0x43f403,_0x157177){var _0x33ef45=['components/import/cm'];return new BPromise(function(_0x4dfc92,_0x19c780){return exec(util[_0x9d66('0x13')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x43f403[_0x9d66('0x14')]['pid']),function(_0x4d4ba9,_0x1a3bb2,_0x52a041){if(_0x4d4ba9){return _0x19c780(_0x4d4ba9);}return _0x4dfc92(_0x1a3bb2);});})[_0x9d66('0xe')](function(_0x2954ef){var _0x2674c8=![];var _0x4af838=_0x2954ef[_0x9d66('0x15')](/\n/);for(var _0x363083=0x0,_0x2dd07f=_0x33ef45[_0x9d66('0x16')];_0x363083<_0x2dd07f,_0x2674c8===![];_0x363083+=0x1){if(_0x2954ef['indexOf'](_0x33ef45[_0x363083])>=0x0){_0x2674c8=!![];}}if(!_0x2674c8){throw new Error(util[_0x9d66('0x13')](_0x9d66('0x17'),_0x43f403[_0x9d66('0x14')][_0x9d66('0x18')]));}process[_0x9d66('0x19')](_0x43f403['params'][_0x9d66('0x18')],'SIGINT');return _0x157177[_0x9d66('0xf')](0xc8)[_0x9d66('0x10')]({'message':util[_0x9d66('0x13')](_0x9d66('0x1a'),_0x43f403[_0x9d66('0x14')][_0x9d66('0x18')])});})[_0x9d66('0x11')](handleError(_0x157177,null,_0x9d66('0x12')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 78e49d4..ccdcb34 100644 --- a/server/api/tag/index.js +++ b/server/api/tag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['../../components/interaction/service','../../config/environment','./tag.controller','index','/describe','isAuthenticated','describe','get','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x13aebb,_0x7a3a){var _0x4fa276=function(_0x7e58ba){while(--_0x7e58ba){_0x13aebb['push'](_0x13aebb['shift']());}};_0x4fa276(++_0x7a3a);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1dc5db,_0x4597c8){_0x1dc5db=_0x1dc5db-0x0;var _0x2b9523=_0xb43b[_0x1dc5db];return _0x2b9523;};'use strict';var multer=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var path=require('path');var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb43('0x5'));var interaction=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var controller=require(_0xbb43('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbb43('0x9')]);router['get'](_0xbb43('0xa'),auth[_0xbb43('0xb')](),controller[_0xbb43('0xc')]);router[_0xbb43('0xd')](_0xbb43('0xe'),auth['isAuthenticated'](),controller[_0xbb43('0xf')]);router[_0xbb43('0x10')]('/',auth['isAuthenticated'](),controller[_0xbb43('0x11')]);router[_0xbb43('0x12')](_0xbb43('0xe'),auth[_0xbb43('0xb')](),controller[_0xbb43('0x13')]);router[_0xbb43('0x14')]('/:id',auth[_0xbb43('0xb')](),controller[_0xbb43('0x15')]);module['exports']=router; \ No newline at end of file +var _0x5636=['isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','get'];(function(_0x59222e,_0x1a800e){var _0x5a53a0=function(_0x472797){while(--_0x472797){_0x59222e['push'](_0x59222e['shift']());}};_0x5a53a0(++_0x1a800e);}(_0x5636,0x102));var _0x6563=function(_0x6ec9,_0x5bc3ed){_0x6ec9=_0x6ec9-0x0;var _0x74259c=_0x5636[_0x6ec9];return _0x74259c;};'use strict';var multer=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6563('0x2')]();var fs_extra=require(_0x6563('0x3'));var auth=require(_0x6563('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6563('0x5'));var controller=require(_0x6563('0x6'));router[_0x6563('0x7')]('/',auth[_0x6563('0x8')](),controller[_0x6563('0x9')]);router[_0x6563('0x7')](_0x6563('0xa'),auth[_0x6563('0x8')](),controller[_0x6563('0xb')]);router[_0x6563('0x7')](_0x6563('0xc'),auth[_0x6563('0x8')](),controller[_0x6563('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6563('0xe')]);router[_0x6563('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6563('0x10')](_0x6563('0xc'),auth[_0x6563('0x8')](),controller[_0x6563('0x11')]);module[_0x6563('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 6550ac5..ec437c5 100644 --- a/server/api/tag/tag.attributes.js +++ b/server/api/tag/tag.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17d1=['#0091EA','sequelize','exports','STRING'];(function(_0x519f9f,_0x55d3b2){var _0x242097=function(_0x525474){while(--_0x525474){_0x519f9f['push'](_0x519f9f['shift']());}};_0x242097(++_0x55d3b2);}(_0x17d1,0xc9));var _0x117d=function(_0xc0b99b,_0xf5632){_0xc0b99b=_0xc0b99b-0x0;var _0x2da8e0=_0x17d1[_0xc0b99b];return _0x2da8e0;};'use strict';var Sequelize=require(_0x117d('0x0'));module[_0x117d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x117d('0x2')],'defaultValue':_0x117d('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7d06=['sequelize','exports','STRING','name'];(function(_0x154958,_0x5e3440){var _0x36bd13=function(_0x32b6d9){while(--_0x32b6d9){_0x154958['push'](_0x154958['shift']());}};_0x36bd13(++_0x5e3440);}(_0x7d06,0x158));var _0x67d0=function(_0x4a55c4,_0x5c0679){_0x4a55c4=_0x4a55c4-0x0;var _0x446b53=_0x7d06[_0x4a55c4];return _0x446b53;};'use strict';var Sequelize=require(_0x67d0('0x0'));module[_0x67d0('0x1')]={'name':{'type':Sequelize[_0x67d0('0x2')],'unique':_0x67d0('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x67d0('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x67d0('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 4f3f0f6..49933a8 100644 --- a/server/api/tag/tag.controller.js +++ b/server/api/tag/tag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe182=['zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','findAll','catch','show','params','keys','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','rimraf'];(function(_0x20bc10,_0x35bed9){var _0x3bd5ce=function(_0x8d1e4c){while(--_0x8d1e4c){_0x20bc10['push'](_0x20bc10['shift']());}};_0x3bd5ce(++_0x35bed9);}(_0xe182,0xf8));var _0x2e18=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xe182[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2e18('0x0'));var zipdir=require(_0x2e18('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2e18('0x2'));var BPromise=require(_0x2e18('0x3'));var Mustache=require(_0x2e18('0x4'));var util=require(_0x2e18('0x5'));var path=require(_0x2e18('0x6'));var sox=require(_0x2e18('0x7'));var csv=require(_0x2e18('0x8'));var ejs=require(_0x2e18('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e18('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2e18('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2e18('0x8'));var querystring=require(_0x2e18('0xc'));var Papa=require(_0x2e18('0xd'));var Redis=require(_0x2e18('0xe'));var authService=require(_0x2e18('0xf'));var qs=require(_0x2e18('0x10'));var as=require(_0x2e18('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e18('0x12'))(_0x2e18('0x13'));var utils=require('../../config/utils');var config=require(_0x2e18('0x14'));var licenseUtil=require(_0x2e18('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xac2cc,_0x2def99){_0x2def99=_0x2def99||0xcc;return function(_0x158608){if(_0x158608){return _0xac2cc[_0x2e18('0x16')](_0x2def99);}return _0xac2cc['status'](_0x2def99)[_0x2e18('0x17')]();};}function respondWithResult(_0x1e4688,_0xaaa192){_0xaaa192=_0xaaa192||0xc8;return function(_0x148a5b){if(_0x148a5b){return _0x1e4688['status'](_0xaaa192)[_0x2e18('0x18')](_0x148a5b);}};}function respondWithFilteredResult(_0x273096,_0x3d1f38){return function(_0x31e644){if(_0x31e644){var _0x157850=typeof _0x3d1f38[_0x2e18('0x19')]===_0x2e18('0x1a')&&typeof _0x3d1f38[_0x2e18('0x1b')]==='undefined';var _0x828c35=_0x31e644[_0x2e18('0x1c')];var _0x448e90=_0x157850?0x0:_0x3d1f38['offset'];var _0x79024f=_0x157850?_0x31e644[_0x2e18('0x1c')]:_0x3d1f38['offset']+_0x3d1f38[_0x2e18('0x1b')];var _0xc7067;if(_0x79024f>=_0x828c35){_0x79024f=_0x828c35;_0xc7067=0xc8;}else{_0xc7067=0xce;}_0x273096[_0x2e18('0x1d')](_0xc7067);return _0x273096[_0x2e18('0x1e')](_0x2e18('0x1f'),_0x448e90+'-'+_0x79024f+'/'+_0x828c35)['json'](_0x31e644);}return null;};}function patchUpdates(_0x44a4a3){return function(_0x14217c){try{jsonpatch[_0x2e18('0x20')](_0x14217c,_0x44a4a3,!![]);}catch(_0x31b77a){return BPromise[_0x2e18('0x21')](_0x31b77a);}return _0x14217c[_0x2e18('0x22')]();};}function saveUpdates(_0x223700,_0x5bc3b8){return function(_0xf41e0d){if(_0xf41e0d){return _0xf41e0d[_0x2e18('0x23')](_0x223700)[_0x2e18('0x24')](function(_0x6b4c83){return _0x6b4c83;});}return null;};}function removeEntity(_0x2c07b6,_0x9b42f5){return function(_0x3153b9){if(_0x3153b9){return _0x3153b9[_0x2e18('0x25')]()[_0x2e18('0x24')](function(){var _0x65fd9d=_0x3153b9[_0x2e18('0x26')]({'plain':!![]});var _0x3f4673=_0x2e18('0x27');return db[_0x2e18('0x28')]['destroy']({'where':{'type':_0x3f4673,'resourceId':_0x65fd9d['id']}})['then'](function(){return _0x3153b9;});})[_0x2e18('0x24')](function(){_0x2c07b6['status'](0xcc)[_0x2e18('0x17')]();});}};}function handleEntityNotFound(_0x44edf7,_0x2660b4){return function(_0x58f18e){if(!_0x58f18e){_0x44edf7[_0x2e18('0x16')](0x194);}return _0x58f18e;};}function handleError(_0x4936c1,_0x85f8df){_0x85f8df=_0x85f8df||0x1f4;return function(_0x324bbb){logger[_0x2e18('0x29')](_0x324bbb[_0x2e18('0x2a')]);if(_0x324bbb[_0x2e18('0x2b')]){delete _0x324bbb['name'];}_0x4936c1[_0x2e18('0x1d')](_0x85f8df)[_0x2e18('0x2c')](_0x324bbb);};}exports[_0x2e18('0x2d')]=function(_0x1f9f6f,_0xd7e2){var _0x1e6a38={},_0x356046={},_0xf4820b={'count':0x0,'rows':[]};var _0x334e74=_[_0x2e18('0x2e')](db[_0x2e18('0x2f')][_0x2e18('0x30')],function(_0x10b8a3){return{'name':_0x10b8a3[_0x2e18('0x31')],'type':_0x10b8a3[_0x2e18('0x32')][_0x2e18('0x33')]};});_0x356046[_0x2e18('0x34')]=_[_0x2e18('0x2e')](_0x334e74,_0x2e18('0x2b'));_0x356046[_0x2e18('0x35')]=_['keys'](_0x1f9f6f[_0x2e18('0x35')]);_0x356046[_0x2e18('0x36')]=_['intersection'](_0x356046[_0x2e18('0x34')],_0x356046['query']);_0x1e6a38[_0x2e18('0x37')]=_[_0x2e18('0x38')](_0x356046[_0x2e18('0x34')],qs[_0x2e18('0x39')](_0x1f9f6f[_0x2e18('0x35')]['fields']));_0x1e6a38['attributes']=_0x1e6a38[_0x2e18('0x37')][_0x2e18('0x3a')]?_0x1e6a38[_0x2e18('0x37')]:_0x356046['model'];if(!_0x1f9f6f[_0x2e18('0x35')][_0x2e18('0x3b')](_0x2e18('0x3c'))){_0x1e6a38[_0x2e18('0x1b')]=qs[_0x2e18('0x1b')](_0x1f9f6f[_0x2e18('0x35')]['limit']);_0x1e6a38[_0x2e18('0x19')]=qs[_0x2e18('0x19')](_0x1f9f6f['query'][_0x2e18('0x19')]);}_0x1e6a38[_0x2e18('0x3d')]=qs[_0x2e18('0x3e')](_0x1f9f6f[_0x2e18('0x35')][_0x2e18('0x3e')]);_0x1e6a38[_0x2e18('0x3f')]=qs[_0x2e18('0x36')](_[_0x2e18('0x40')](_0x1f9f6f[_0x2e18('0x35')],_0x356046[_0x2e18('0x36')]),_0x334e74);if(_0x1f9f6f[_0x2e18('0x35')]['filter']){_0x1e6a38[_0x2e18('0x3f')]=_[_0x2e18('0x41')](_0x1e6a38[_0x2e18('0x3f')],{'$or':_[_0x2e18('0x2e')](_0x334e74,function(_0x5830d9){if(_0x5830d9[_0x2e18('0x32')]!==_0x2e18('0x42')){var _0x19629f={};_0x19629f[_0x5830d9[_0x2e18('0x2b')]]={'$like':'%'+_0x1f9f6f[_0x2e18('0x35')]['filter']+'%'};return _0x19629f;}})});}_0x1e6a38=_[_0x2e18('0x41')]({},_0x1e6a38,_0x1f9f6f[_0x2e18('0x43')]);var _0x48862d={'where':_0x1e6a38[_0x2e18('0x3f')]};return db[_0x2e18('0x2f')]['count'](_0x48862d)['then'](function(_0x569d5e){_0xf4820b[_0x2e18('0x1c')]=_0x569d5e;if(_0x1f9f6f[_0x2e18('0x35')]['includeAll']){_0x1e6a38['include']=[{'all':!![]}];}return db[_0x2e18('0x2f')][_0x2e18('0x44')](_0x1e6a38);})[_0x2e18('0x24')](function(_0x5629f4){_0xf4820b['rows']=_0x5629f4;return _0xf4820b;})['then'](respondWithFilteredResult(_0xd7e2,_0x1e6a38))[_0x2e18('0x45')](handleError(_0xd7e2,null));};exports[_0x2e18('0x46')]=function(_0x4ab039,_0x40989e){var _0x2e6bd5={'raw':!![],'where':{'id':_0x4ab039[_0x2e18('0x47')]['id']}},_0x5bfaba={};_0x5bfaba[_0x2e18('0x34')]=_[_0x2e18('0x48')](db['Tag']['rawAttributes']);_0x5bfaba['query']=_[_0x2e18('0x48')](_0x4ab039[_0x2e18('0x35')]);_0x5bfaba[_0x2e18('0x36')]=_[_0x2e18('0x38')](_0x5bfaba['model'],_0x5bfaba[_0x2e18('0x35')]);_0x2e6bd5[_0x2e18('0x37')]=_['intersection'](_0x5bfaba['model'],qs[_0x2e18('0x39')](_0x4ab039[_0x2e18('0x35')]['fields']));_0x2e6bd5['attributes']=_0x2e6bd5[_0x2e18('0x37')]['length']?_0x2e6bd5[_0x2e18('0x37')]:_0x5bfaba[_0x2e18('0x34')];if(_0x4ab039['query'][_0x2e18('0x49')]){_0x2e6bd5[_0x2e18('0x4a')]=[{'all':!![]}];}_0x2e6bd5=_[_0x2e18('0x41')]({},_0x2e6bd5,_0x4ab039[_0x2e18('0x43')]);return db['Tag'][_0x2e18('0x4b')](_0x2e6bd5)[_0x2e18('0x24')](handleEntityNotFound(_0x40989e,null))[_0x2e18('0x24')](respondWithResult(_0x40989e,null))[_0x2e18('0x45')](handleError(_0x40989e,null));};exports[_0x2e18('0x4c')]=function(_0x1d621f,_0x170b4f){return db[_0x2e18('0x2f')][_0x2e18('0x4c')](_0x1d621f[_0x2e18('0x4d')],{})[_0x2e18('0x24')](function(_0xa4f80c){var _0x710232=_0x1d621f[_0x2e18('0x4e')]['get']({'plain':!![]});if(!_0x710232)throw new Error(_0x2e18('0x4f'));if(_0x710232['role']==='user'){var _0x396922=_0xa4f80c[_0x2e18('0x26')]({'plain':!![]});var _0x17bb73=_0x2e18('0x27');return db[_0x2e18('0x50')][_0x2e18('0x4b')]({'where':{'name':_0x17bb73,'userProfileId':_0x710232[_0x2e18('0x51')]},'raw':!![]})[_0x2e18('0x24')](function(_0x5acee2){if(_0x5acee2&&_0x5acee2[_0x2e18('0x52')]===0x0){return db[_0x2e18('0x28')]['create']({'name':_0x396922[_0x2e18('0x2b')],'resourceId':_0x396922['id'],'type':_0x5acee2[_0x2e18('0x2b')],'sectionId':_0x5acee2['id']},{})[_0x2e18('0x24')](function(){return _0xa4f80c;});}else{return _0xa4f80c;}})['catch'](function(_0x4bef41){logger[_0x2e18('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bef41);throw _0x4bef41;});}return _0xa4f80c;})['then'](respondWithResult(_0x170b4f,0xc9))[_0x2e18('0x45')](handleError(_0x170b4f,null));};exports['update']=function(_0x573c08,_0x392756){if(_0x573c08['body']['id']){delete _0x573c08['body']['id'];}return db['Tag'][_0x2e18('0x4b')]({'where':{'id':_0x573c08[_0x2e18('0x47')]['id']}})[_0x2e18('0x24')](handleEntityNotFound(_0x392756,null))[_0x2e18('0x24')](saveUpdates(_0x573c08['body'],null))[_0x2e18('0x24')](respondWithResult(_0x392756,null))['catch'](handleError(_0x392756,null));};exports[_0x2e18('0x25')]=function(_0x45c22a,_0x5b76f4){return db['Tag']['find']({'where':{'id':_0x45c22a['params']['id']}})[_0x2e18('0x24')](handleEntityNotFound(_0x5b76f4,null))['then'](removeEntity(_0x5b76f4,null))[_0x2e18('0x45')](handleError(_0x5b76f4,null));};exports['describe']=function(_0x3f2917,_0x48038e){return db[_0x2e18('0x2f')]['describe']()['then'](respondWithResult(_0x48038e,null))['catch'](handleError(_0x48038e,null));}; \ No newline at end of file +var _0xc712=['keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','catch','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','map','Tag','rawAttributes','fieldName','type','model','query'];(function(_0x100152,_0x1f3e8f){var _0x433e5b=function(_0x1f15af){while(--_0x1f15af){_0x100152['push'](_0x100152['shift']());}};_0x433e5b(++_0x1f3e8f);}(_0xc712,0xbd));var _0x2c71=function(_0x29a800,_0x3a39dc){_0x29a800=_0x29a800-0x0;var _0x23748a=_0xc712[_0x29a800];return _0x23748a;};'use strict';var emlformat=require(_0x2c71('0x0'));var rimraf=require(_0x2c71('0x1'));var zipdir=require(_0x2c71('0x2'));var jsonpatch=require(_0x2c71('0x3'));var rp=require('request-promise');var moment=require(_0x2c71('0x4'));var BPromise=require(_0x2c71('0x5'));var Mustache=require(_0x2c71('0x6'));var util=require(_0x2c71('0x7'));var path=require(_0x2c71('0x8'));var sox=require('sox');var csv=require(_0x2c71('0x9'));var ejs=require(_0x2c71('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c71('0xb'));var squel=require(_0x2c71('0xc'));var crypto=require(_0x2c71('0xd'));var jsforce=require(_0x2c71('0xe'));var deskjs=require(_0x2c71('0xf'));var toCsv=require(_0x2c71('0x9'));var querystring=require(_0x2c71('0x10'));var Papa=require(_0x2c71('0x11'));var Redis=require('ioredis');var authService=require(_0x2c71('0x12'));var qs=require(_0x2c71('0x13'));var as=require(_0x2c71('0x14'));var hardwareService=require(_0x2c71('0x15'));var logger=require(_0x2c71('0x16'))('api');var utils=require(_0x2c71('0x17'));var config=require(_0x2c71('0x18'));var licenseUtil=require(_0x2c71('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d71e5,_0x22dc34){_0x22dc34=_0x22dc34||0xcc;return function(_0x57f4d1){if(_0x57f4d1){return _0x3d71e5[_0x2c71('0x1a')](_0x22dc34);}return _0x3d71e5[_0x2c71('0x1b')](_0x22dc34)[_0x2c71('0x1c')]();};}function respondWithResult(_0x4700db,_0x2a12b1){_0x2a12b1=_0x2a12b1||0xc8;return function(_0x5a9f43){if(_0x5a9f43){return _0x4700db['status'](_0x2a12b1)[_0x2c71('0x1d')](_0x5a9f43);}};}function respondWithFilteredResult(_0x31e7ba,_0x53dd3c){return function(_0x4037e9){if(_0x4037e9){var _0x3a0ffb=typeof _0x53dd3c[_0x2c71('0x1e')]===_0x2c71('0x1f')&&typeof _0x53dd3c[_0x2c71('0x20')]===_0x2c71('0x1f');var _0x1d2996=_0x4037e9['count'];var _0x2a96b9=_0x3a0ffb?0x0:_0x53dd3c['offset'];var _0x2db611=_0x3a0ffb?_0x4037e9[_0x2c71('0x21')]:_0x53dd3c[_0x2c71('0x1e')]+_0x53dd3c[_0x2c71('0x20')];var _0x597a1e;if(_0x2db611>=_0x1d2996){_0x2db611=_0x1d2996;_0x597a1e=0xc8;}else{_0x597a1e=0xce;}_0x31e7ba['status'](_0x597a1e);return _0x31e7ba[_0x2c71('0x22')]('Content-Range',_0x2a96b9+'-'+_0x2db611+'/'+_0x1d2996)[_0x2c71('0x1d')](_0x4037e9);}return null;};}function patchUpdates(_0x4074ee){return function(_0x371508){try{jsonpatch[_0x2c71('0x23')](_0x371508,_0x4074ee,!![]);}catch(_0x2b4694){return BPromise[_0x2c71('0x24')](_0x2b4694);}return _0x371508[_0x2c71('0x25')]();};}function saveUpdates(_0x5bdc68,_0x1b1368){return function(_0x150d29){if(_0x150d29){return _0x150d29[_0x2c71('0x26')](_0x5bdc68)[_0x2c71('0x27')](function(_0x280e11){return _0x280e11;});}return null;};}function removeEntity(_0x599648,_0x2d61ec){return function(_0x9f1bc1){if(_0x9f1bc1){return _0x9f1bc1[_0x2c71('0x28')]()['then'](function(){var _0x4defd7=_0x9f1bc1[_0x2c71('0x29')]({'plain':!![]});var _0x30ab10=_0x2c71('0x2a');return db[_0x2c71('0x2b')][_0x2c71('0x28')]({'where':{'type':_0x30ab10,'resourceId':_0x4defd7['id']}})[_0x2c71('0x27')](function(){return _0x9f1bc1;});})[_0x2c71('0x27')](function(){_0x599648[_0x2c71('0x1b')](0xcc)[_0x2c71('0x1c')]();});}};}function handleEntityNotFound(_0x3b77c8,_0xfedc8b){return function(_0x61a14b){if(!_0x61a14b){_0x3b77c8['sendStatus'](0x194);}return _0x61a14b;};}function handleError(_0x1cab55,_0x2e711d){_0x2e711d=_0x2e711d||0x1f4;return function(_0x274d47){logger[_0x2c71('0x2c')](_0x274d47[_0x2c71('0x2d')]);if(_0x274d47[_0x2c71('0x2e')]){delete _0x274d47['name'];}_0x1cab55[_0x2c71('0x1b')](_0x2e711d)['send'](_0x274d47);};}exports['index']=function(_0x3ac629,_0x1764db){var _0x3ca0a1={},_0x5e18de={},_0x3b6818={'count':0x0,'rows':[]};var _0x351718=_[_0x2c71('0x2f')](db[_0x2c71('0x30')][_0x2c71('0x31')],function(_0x57dd36){return{'name':_0x57dd36[_0x2c71('0x32')],'type':_0x57dd36[_0x2c71('0x33')]['key']};});_0x5e18de[_0x2c71('0x34')]=_[_0x2c71('0x2f')](_0x351718,_0x2c71('0x2e'));_0x5e18de[_0x2c71('0x35')]=_[_0x2c71('0x36')](_0x3ac629[_0x2c71('0x35')]);_0x5e18de[_0x2c71('0x37')]=_[_0x2c71('0x38')](_0x5e18de['model'],_0x5e18de['query']);_0x3ca0a1[_0x2c71('0x39')]=_[_0x2c71('0x38')](_0x5e18de[_0x2c71('0x34')],qs['fields'](_0x3ac629['query'][_0x2c71('0x3a')]));_0x3ca0a1[_0x2c71('0x39')]=_0x3ca0a1['attributes']['length']?_0x3ca0a1[_0x2c71('0x39')]:_0x5e18de[_0x2c71('0x34')];if(!_0x3ac629['query'][_0x2c71('0x3b')](_0x2c71('0x3c'))){_0x3ca0a1['limit']=qs[_0x2c71('0x20')](_0x3ac629[_0x2c71('0x35')]['limit']);_0x3ca0a1['offset']=qs[_0x2c71('0x1e')](_0x3ac629[_0x2c71('0x35')]['offset']);}_0x3ca0a1['order']=qs['sort'](_0x3ac629[_0x2c71('0x35')][_0x2c71('0x3d')]);_0x3ca0a1[_0x2c71('0x3e')]=qs[_0x2c71('0x37')](_[_0x2c71('0x3f')](_0x3ac629[_0x2c71('0x35')],_0x5e18de['filters']),_0x351718);if(_0x3ac629[_0x2c71('0x35')][_0x2c71('0x40')]){_0x3ca0a1[_0x2c71('0x3e')]=_[_0x2c71('0x41')](_0x3ca0a1['where'],{'$or':_['map'](_0x351718,function(_0xb0fec2){if(_0xb0fec2[_0x2c71('0x33')]!==_0x2c71('0x42')){var _0x3ef68c={};_0x3ef68c[_0xb0fec2[_0x2c71('0x2e')]]={'$like':'%'+_0x3ac629[_0x2c71('0x35')][_0x2c71('0x40')]+'%'};return _0x3ef68c;}})});}_0x3ca0a1=_[_0x2c71('0x41')]({},_0x3ca0a1,_0x3ac629[_0x2c71('0x43')]);var _0x49e4ac={'where':_0x3ca0a1[_0x2c71('0x3e')]};return db['Tag'][_0x2c71('0x21')](_0x49e4ac)[_0x2c71('0x27')](function(_0x148b72){_0x3b6818[_0x2c71('0x21')]=_0x148b72;if(_0x3ac629[_0x2c71('0x35')]['includeAll']){_0x3ca0a1[_0x2c71('0x44')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x3ca0a1);})[_0x2c71('0x27')](function(_0xa06e1a){_0x3b6818['rows']=_0xa06e1a;return _0x3b6818;})[_0x2c71('0x27')](respondWithFilteredResult(_0x1764db,_0x3ca0a1))[_0x2c71('0x45')](handleError(_0x1764db,null));};exports['show']=function(_0x1eca3a,_0x327464){var _0x5c9c19={'raw':!![],'where':{'id':_0x1eca3a[_0x2c71('0x46')]['id']}},_0x429ea6={};_0x429ea6['model']=_[_0x2c71('0x36')](db[_0x2c71('0x30')][_0x2c71('0x31')]);_0x429ea6[_0x2c71('0x35')]=_[_0x2c71('0x36')](_0x1eca3a['query']);_0x429ea6[_0x2c71('0x37')]=_[_0x2c71('0x38')](_0x429ea6[_0x2c71('0x34')],_0x429ea6[_0x2c71('0x35')]);_0x5c9c19['attributes']=_[_0x2c71('0x38')](_0x429ea6[_0x2c71('0x34')],qs['fields'](_0x1eca3a[_0x2c71('0x35')][_0x2c71('0x3a')]));_0x5c9c19['attributes']=_0x5c9c19['attributes'][_0x2c71('0x47')]?_0x5c9c19[_0x2c71('0x39')]:_0x429ea6[_0x2c71('0x34')];if(_0x1eca3a[_0x2c71('0x35')]['includeAll']){_0x5c9c19[_0x2c71('0x44')]=[{'all':!![]}];}_0x5c9c19=_[_0x2c71('0x41')]({},_0x5c9c19,_0x1eca3a['options']);return db['Tag'][_0x2c71('0x48')](_0x5c9c19)[_0x2c71('0x27')](handleEntityNotFound(_0x327464,null))[_0x2c71('0x27')](respondWithResult(_0x327464,null))[_0x2c71('0x45')](handleError(_0x327464,null));};exports['create']=function(_0x525c21,_0x124152){return db[_0x2c71('0x30')][_0x2c71('0x49')](_0x525c21['body'],{})[_0x2c71('0x27')](function(_0x4a9a24){var _0x32f4b6=_0x525c21[_0x2c71('0x4a')][_0x2c71('0x29')]({'plain':!![]});if(!_0x32f4b6)throw new Error(_0x2c71('0x4b'));if(_0x32f4b6[_0x2c71('0x4c')]===_0x2c71('0x4a')){var _0xfaff03=_0x4a9a24[_0x2c71('0x29')]({'plain':!![]});var _0x96f8f6=_0x2c71('0x2a');return db['UserProfileSection'][_0x2c71('0x48')]({'where':{'name':_0x96f8f6,'userProfileId':_0x32f4b6[_0x2c71('0x4d')]},'raw':!![]})[_0x2c71('0x27')](function(_0x50dcfd){if(_0x50dcfd&&_0x50dcfd[_0x2c71('0x4e')]===0x0){return db[_0x2c71('0x2b')][_0x2c71('0x49')]({'name':_0xfaff03[_0x2c71('0x2e')],'resourceId':_0xfaff03['id'],'type':_0x50dcfd[_0x2c71('0x2e')],'sectionId':_0x50dcfd['id']},{})[_0x2c71('0x27')](function(){return _0x4a9a24;});}else{return _0x4a9a24;}})[_0x2c71('0x45')](function(_0x2978f7){logger[_0x2c71('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2978f7);throw _0x2978f7;});}return _0x4a9a24;})[_0x2c71('0x27')](respondWithResult(_0x124152,0xc9))[_0x2c71('0x45')](handleError(_0x124152,null));};exports['update']=function(_0x854252,_0x2a8c73){if(_0x854252[_0x2c71('0x4f')]['id']){delete _0x854252[_0x2c71('0x4f')]['id'];}return db['Tag'][_0x2c71('0x48')]({'where':{'id':_0x854252['params']['id']}})['then'](handleEntityNotFound(_0x2a8c73,null))[_0x2c71('0x27')](saveUpdates(_0x854252[_0x2c71('0x4f')],null))[_0x2c71('0x27')](respondWithResult(_0x2a8c73,null))[_0x2c71('0x45')](handleError(_0x2a8c73,null));};exports[_0x2c71('0x28')]=function(_0x5a4334,_0x1af111){return db[_0x2c71('0x30')][_0x2c71('0x48')]({'where':{'id':_0x5a4334['params']['id']}})['then'](handleEntityNotFound(_0x1af111,null))[_0x2c71('0x27')](removeEntity(_0x1af111,null))[_0x2c71('0x45')](handleError(_0x1af111,null));};exports[_0x2c71('0x50')]=function(_0x54ac8a,_0x5c52b2){return db[_0x2c71('0x30')]['describe']()[_0x2c71('0x27')](respondWithResult(_0x5c52b2,null))[_0x2c71('0x45')](handleError(_0x5c52b2,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index d08a3a1..83bd270 100644 --- a/server/api/tag/tag.model.js +++ b/server/api/tag/tag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x919d=['api','bluebird','path','./tag.attributes','exports','define','Tag','tools_tags','lodash','util','../../config/logger'];(function(_0x5a83e7,_0x3185a7){var _0x3222b1=function(_0x2c9504){while(--_0x2c9504){_0x5a83e7['push'](_0x5a83e7['shift']());}};_0x3222b1(++_0x3185a7);}(_0x919d,0x1c0));var _0xd919=function(_0x43ab16,_0x203b3e){_0x43ab16=_0x43ab16-0x0;var _0x3a6a7a=_0x919d[_0x43ab16];return _0x3a6a7a;};'use strict';var _=require(_0xd919('0x0'));var util=require(_0xd919('0x1'));var logger=require(_0xd919('0x2'))(_0xd919('0x3'));var moment=require('moment');var BPromise=require(_0xd919('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd919('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd919('0x6'));module[_0xd919('0x7')]=function(_0x5493fc,_0x495d7b){return _0x5493fc[_0xd919('0x8')](_0xd919('0x9'),attributes,{'tableName':_0xd919('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8060=['tools_tags','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','Tag'];(function(_0x33ec5e,_0x13092b){var _0x562b59=function(_0x5d04b4){while(--_0x5d04b4){_0x33ec5e['push'](_0x33ec5e['shift']());}};_0x562b59(++_0x13092b);}(_0x8060,0x1c4));var _0x0806=function(_0x492e32,_0x2e0a93){_0x492e32=_0x492e32-0x0;var _0x4a335e=_0x8060[_0x492e32];return _0x4a335e;};'use strict';var _=require(_0x0806('0x0'));var util=require(_0x0806('0x1'));var logger=require(_0x0806('0x2'))(_0x0806('0x3'));var moment=require(_0x0806('0x4'));var BPromise=require(_0x0806('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0806('0x6'));var config=require(_0x0806('0x7'));var attributes=require('./tag.attributes');module[_0x0806('0x8')]=function(_0x4219fa,_0x359980){return _0x4219fa['define'](_0x0806('0x9'),attributes,{'tableName':_0x0806('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index ca61187..4b6c294 100644 --- a/server/api/tag/tag.rpc.js +++ b/server/api/tag/tag.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9567=['info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','request','then'];(function(_0x13d5bc,_0x3fce3c){var _0x4b8a40=function(_0xe3ef3a){while(--_0xe3ef3a){_0x13d5bc['push'](_0x13d5bc['shift']());}};_0x4b8a40(++_0x3fce3c);}(_0x9567,0xdc));var _0x7956=function(_0x25ce90,_0x52a72a){_0x25ce90=_0x25ce90-0x0;var _0xf5f97a=_0x9567[_0x25ce90];return _0xf5f97a;};'use strict';var _=require(_0x7956('0x0'));var util=require(_0x7956('0x1'));var moment=require(_0x7956('0x2'));var BPromise=require(_0x7956('0x3'));var rs=require(_0x7956('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7956('0x5'));var logger=require(_0x7956('0x6'))('rpc');var config=require(_0x7956('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7956('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1819b6,_0x31b50d,_0x48b2b3){return new BPromise(function(_0x3c213a,_0x50038a){return client[_0x7956('0x9')](_0x1819b6,_0x48b2b3)[_0x7956('0xa')](function(_0x53310c){logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,'request\x20sent');logger[_0x7956('0xd')](_0x7956('0xe'),_0x31b50d,_0x7956('0xf'),JSON['stringify'](_0x53310c));if(_0x53310c[_0x7956('0x10')]){if(_0x53310c[_0x7956('0x10')][_0x7956('0x11')]===0x1f4){logger[_0x7956('0x10')]('Tag,\x20%s,\x20%s',_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x50038a(_0x53310c[_0x7956('0x10')]['message']);}logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x3c213a(_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);}else{logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,_0x7956('0xf'));_0x3c213a(_0x53310c[_0x7956('0x13')][_0x7956('0x12')]);}})[_0x7956('0x14')](function(_0x18ae51){logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x18ae51);_0x50038a(_0x18ae51);});});} \ No newline at end of file +var _0x66fa=['../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1a4039,_0x354d6f){var _0x21add9=function(_0x40e84b){while(--_0x40e84b){_0x1a4039['push'](_0x1a4039['shift']());}};_0x21add9(++_0x354d6f);}(_0x66fa,0x168));var _0xa66f=function(_0x471ae1,_0x591c7c){_0x471ae1=_0x471ae1-0x0;var _0x314743=_0x66fa[_0x471ae1];return _0x314743;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require(_0xa66f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa66f('0x3'));var db=require(_0xa66f('0x4'))['db'];var utils=require(_0xa66f('0x5'));var logger=require(_0xa66f('0x6'))(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var jayson=require(_0xa66f('0x9'));var client=jayson[_0xa66f('0xa')][_0xa66f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33bd0d,_0x150f73,_0x5b7cf7){return new BPromise(function(_0x1cf624,_0x5ec156){return client[_0xa66f('0xc')](_0x33bd0d,_0x5b7cf7)[_0xa66f('0xd')](function(_0x5ad336){logger[_0xa66f('0xe')](_0xa66f('0xf'),_0x150f73,_0xa66f('0x10'));logger[_0xa66f('0x11')](_0xa66f('0x12'),_0x150f73,_0xa66f('0x10'),JSON['stringify'](_0x5ad336));if(_0x5ad336['error']){if(_0x5ad336[_0xa66f('0x13')]['code']===0x1f4){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x150f73,_0x5ad336[_0xa66f('0x13')]['message']);return _0x5ec156(_0x5ad336[_0xa66f('0x13')][_0xa66f('0x14')]);}logger['error'](_0xa66f('0xf'),_0x150f73,_0x5ad336[_0xa66f('0x13')][_0xa66f('0x14')]);return _0x1cf624(_0x5ad336[_0xa66f('0x13')]['message']);}else{logger[_0xa66f('0xe')](_0xa66f('0xf'),_0x150f73,'request\x20sent');_0x1cf624(_0x5ad336[_0xa66f('0x15')][_0xa66f('0x14')]);}})[_0xa66f('0x16')](function(_0x76af81){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x150f73,_0x76af81);_0x5ec156(_0x76af81);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 97325f2..ae02ec3 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 5191fe0..f5217f4 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x3fc672,_0x4fad24){var _0x455d5a=function(_0x2a2dc1){while(--_0x2a2dc1){_0x3fc672['push'](_0x3fc672['shift']());}};_0x455d5a(++_0x4fad24);}(_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 +var _0xd8b0=['exports','sequelize'];(function(_0x5bcb58,_0x4682f0){var _0x969ce2=function(_0x452a95){while(--_0x452a95){_0x5bcb58['push'](_0x5bcb58['shift']());}};_0x969ce2(++_0x4682f0);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index f69be9c..a624dce 100644 --- a/server/api/team/team.controller.js +++ b/server/api/team/team.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10a0=['find','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','MailQueueId','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','FaxQueueId','UserFaxQueue','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','isValidChannel','add','ids','removeQueues','remove','addAgents','isArray','Voice','Mail','Sms','Fax','Openchannel','defaults','TeamVoiceQueue','penalty','findOrCreate','Queue:save','QueueId','User','voicePause','isNil','interface','format','SIP/%s','all','upsert','spread','removeAgents','Whatsapp','emit','Queue:remove','UserVoiceQueueRt','getAgents','rimraf','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','Team','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','UserProfileSection'];(function(_0x326904,_0x485428){var _0x412db7=function(_0x4177b2){while(--_0x4177b2){_0x326904['push'](_0x326904['shift']());}};_0x412db7(++_0x485428);}(_0x10a0,0x17d));var _0x010a=function(_0x4a258b,_0xb0006c){_0x4a258b=_0x4a258b-0x0;var _0x5ea6dc=_0x10a0[_0x4a258b];return _0x5ea6dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x010a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x010a('0x1'));var Mustache=require('mustache');var util=require('util');var path=require(_0x010a('0x2'));var sox=require('sox');var csv=require(_0x010a('0x3'));var ejs=require(_0x010a('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x010a('0x5'));var squel=require(_0x010a('0x6'));var crypto=require(_0x010a('0x7'));var jsforce=require(_0x010a('0x8'));var deskjs=require(_0x010a('0x9'));var toCsv=require(_0x010a('0x3'));var querystring=require(_0x010a('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x010a('0xb'));var qs=require(_0x010a('0xc'));var as=require(_0x010a('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x010a('0xe'))('api');var utils=require(_0x010a('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x010a('0x10'));var db=require(_0x010a('0x11'))['db'];config['redis']=_['defaults'](config[_0x010a('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0x010a('0x13'))(new Redis(config[_0x010a('0x12')]));require(_0x010a('0x14'))[_0x010a('0x15')](socket);function respondWithStatusCode(_0x42cbf2,_0x9902f){_0x9902f=_0x9902f||0xcc;return function(_0x3e63c4){if(_0x3e63c4){return _0x42cbf2[_0x010a('0x16')](_0x9902f);}return _0x42cbf2[_0x010a('0x17')](_0x9902f)[_0x010a('0x18')]();};}function respondWithResult(_0xd3d755,_0x1aeeae){_0x1aeeae=_0x1aeeae||0xc8;return function(_0x56dc4d){if(_0x56dc4d){return _0xd3d755[_0x010a('0x17')](_0x1aeeae)[_0x010a('0x19')](_0x56dc4d);}};}function respondWithFilteredResult(_0x561e3f,_0xf8e85c){return function(_0x2ed8b8){if(_0x2ed8b8){var _0x166c6d=typeof _0xf8e85c[_0x010a('0x1a')]===_0x010a('0x1b')&&typeof _0xf8e85c[_0x010a('0x1c')]===_0x010a('0x1b');var _0x4f8686=_0x2ed8b8[_0x010a('0x1d')];var _0x42c0c5=_0x166c6d?0x0:_0xf8e85c['offset'];var _0x4b6018=_0x166c6d?_0x2ed8b8[_0x010a('0x1d')]:_0xf8e85c[_0x010a('0x1a')]+_0xf8e85c[_0x010a('0x1c')];var _0x36d84a;if(_0x4b6018>=_0x4f8686){_0x4b6018=_0x4f8686;_0x36d84a=0xc8;}else{_0x36d84a=0xce;}_0x561e3f[_0x010a('0x17')](_0x36d84a);return _0x561e3f[_0x010a('0x1e')](_0x010a('0x1f'),_0x42c0c5+'-'+_0x4b6018+'/'+_0x4f8686)[_0x010a('0x19')](_0x2ed8b8);}return null;};}function patchUpdates(_0x170b8b){return function(_0x42f27c){try{jsonpatch[_0x010a('0x20')](_0x42f27c,_0x170b8b,!![]);}catch(_0x4f4997){return BPromise[_0x010a('0x21')](_0x4f4997);}return _0x42f27c[_0x010a('0x22')]();};}function saveUpdates(_0x5dbe30,_0x32d615){return function(_0x11cbb6){if(_0x11cbb6){return _0x11cbb6[_0x010a('0x23')](_0x5dbe30)[_0x010a('0x24')](function(_0x334601){return _0x334601;});}return null;};}function handleEntityNotFound(_0x2ddb44,_0xc34cd6){return function(_0xa45fd5){if(!_0xa45fd5){_0x2ddb44['sendStatus'](0x194);}return _0xa45fd5;};}function handleError(_0x4a75dd,_0x465ec9){_0x465ec9=_0x465ec9||0x1f4;return function(_0x675dec){logger['error'](_0x675dec[_0x010a('0x25')]);if(_0x675dec[_0x010a('0x26')]){delete _0x675dec[_0x010a('0x26')];}_0x4a75dd[_0x010a('0x17')](_0x465ec9)[_0x010a('0x27')](_0x675dec);};}exports[_0x010a('0x28')]=function(_0x5969ad,_0x1e369c){var _0x4f277a={},_0x8a9118={},_0x123dba={'count':0x0,'rows':[]};var _0x2de7a7=_[_0x010a('0x29')](db[_0x010a('0x2a')]['rawAttributes'],function(_0x56da6d){return{'name':_0x56da6d['fieldName'],'type':_0x56da6d[_0x010a('0x2b')][_0x010a('0x2c')]};});_0x8a9118[_0x010a('0x2d')]=_[_0x010a('0x29')](_0x2de7a7,_0x010a('0x26'));_0x8a9118[_0x010a('0x2e')]=_['keys'](_0x5969ad[_0x010a('0x2e')]);_0x8a9118[_0x010a('0x2f')]=_[_0x010a('0x30')](_0x8a9118['model'],_0x8a9118[_0x010a('0x2e')]);_0x4f277a['attributes']=_['intersection'](_0x8a9118[_0x010a('0x2d')],qs[_0x010a('0x31')](_0x5969ad[_0x010a('0x2e')][_0x010a('0x31')]));_0x4f277a[_0x010a('0x32')]=_0x4f277a['attributes'][_0x010a('0x33')]?_0x4f277a[_0x010a('0x32')]:_0x8a9118[_0x010a('0x2d')];if(!_0x5969ad[_0x010a('0x2e')][_0x010a('0x34')](_0x010a('0x35'))){_0x4f277a['limit']=qs['limit'](_0x5969ad['query']['limit']);_0x4f277a['offset']=qs[_0x010a('0x1a')](_0x5969ad[_0x010a('0x2e')][_0x010a('0x1a')]);}_0x4f277a[_0x010a('0x36')]=qs[_0x010a('0x37')](_0x5969ad['query'][_0x010a('0x37')]);_0x4f277a[_0x010a('0x38')]=qs[_0x010a('0x2f')](_[_0x010a('0x39')](_0x5969ad[_0x010a('0x2e')],_0x8a9118[_0x010a('0x2f')]),_0x2de7a7);if(_0x5969ad[_0x010a('0x2e')][_0x010a('0x3a')]){_0x4f277a[_0x010a('0x38')]=_[_0x010a('0x3b')](_0x4f277a[_0x010a('0x38')],{'$or':_[_0x010a('0x29')](_0x2de7a7,function(_0x58492e){if(_0x58492e[_0x010a('0x2b')]!==_0x010a('0x3c')){var _0x3509b4={};_0x3509b4[_0x58492e['name']]={'$like':'%'+_0x5969ad['query']['filter']+'%'};return _0x3509b4;}})});}_0x4f277a=_[_0x010a('0x3b')]({},_0x4f277a,_0x5969ad[_0x010a('0x3d')]);var _0x58316a={'where':_0x4f277a[_0x010a('0x38')]};return db[_0x010a('0x2a')][_0x010a('0x1d')](_0x58316a)[_0x010a('0x24')](function(_0x34d8c9){_0x123dba[_0x010a('0x1d')]=_0x34d8c9;if(_0x5969ad[_0x010a('0x2e')][_0x010a('0x3e')]){_0x4f277a[_0x010a('0x3f')]=[{'all':!![]}];}return db['Team'][_0x010a('0x40')](_0x4f277a);})[_0x010a('0x24')](function(_0x2bcee6){_0x123dba[_0x010a('0x41')]=_0x2bcee6;return _0x123dba;})[_0x010a('0x24')](respondWithFilteredResult(_0x1e369c,_0x4f277a))[_0x010a('0x42')](handleError(_0x1e369c,null));};exports[_0x010a('0x43')]=function(_0x585136,_0x1daf33){var _0x231ec0={'raw':![],'where':{'id':_0x585136['params']['id']}},_0x59f8b4={};_0x59f8b4[_0x010a('0x2d')]=_[_0x010a('0x44')](db['Team'][_0x010a('0x45')]);_0x59f8b4[_0x010a('0x2e')]=_['keys'](_0x585136[_0x010a('0x2e')]);_0x59f8b4[_0x010a('0x2f')]=_[_0x010a('0x30')](_0x59f8b4[_0x010a('0x2d')],_0x59f8b4['query']);_0x231ec0[_0x010a('0x32')]=_[_0x010a('0x30')](_0x59f8b4['model'],qs[_0x010a('0x31')](_0x585136[_0x010a('0x2e')][_0x010a('0x31')]));_0x231ec0[_0x010a('0x32')]=_0x231ec0['attributes'][_0x010a('0x33')]?_0x231ec0['attributes']:_0x59f8b4[_0x010a('0x2d')];if(_0x585136[_0x010a('0x2e')]['includeAll']){_0x231ec0[_0x010a('0x3f')]=[{'all':!![]}];}_0x231ec0=_[_0x010a('0x3b')]({},_0x231ec0,_0x585136[_0x010a('0x3d')]);return db[_0x010a('0x2a')]['find'](_0x231ec0)[_0x010a('0x24')](handleEntityNotFound(_0x1daf33,null))[_0x010a('0x24')](respondWithResult(_0x1daf33,null))['catch'](handleError(_0x1daf33,null));};exports[_0x010a('0x46')]=function(_0x2e6c29,_0x209c15){return db['Team'][_0x010a('0x46')](_0x2e6c29[_0x010a('0x47')],{})['then'](function(_0x43e337){var _0x560209=_0x2e6c29[_0x010a('0x48')]['get']({'plain':!![]});if(!_0x560209)throw new Error(_0x010a('0x49'));if(_0x560209[_0x010a('0x4a')]===_0x010a('0x48')){var _0x1cc47b=_0x43e337[_0x010a('0x4b')]({'plain':!![]});var _0x270027=_0x010a('0x4c');return db[_0x010a('0x4d')][_0x010a('0x4e')]({'where':{'name':_0x270027,'userProfileId':_0x560209['userProfileId']},'raw':!![]})[_0x010a('0x24')](function(_0x5bdd9b){if(_0x5bdd9b&&_0x5bdd9b[_0x010a('0x4f')]===0x0){return db[_0x010a('0x50')][_0x010a('0x46')]({'name':_0x1cc47b['name'],'resourceId':_0x1cc47b['id'],'type':_0x5bdd9b['name'],'sectionId':_0x5bdd9b['id']},{})['then'](function(){return _0x43e337;});}else{return _0x43e337;}})[_0x010a('0x42')](function(_0x5a042c){logger[_0x010a('0x51')](_0x010a('0x52'),_0x5a042c);throw _0x5a042c;});}return _0x43e337;})['then'](respondWithResult(_0x209c15,0xc9))[_0x010a('0x42')](handleError(_0x209c15,null));};exports[_0x010a('0x23')]=function(_0x21ccf3,_0x178f50){if(_0x21ccf3[_0x010a('0x47')]['id']){delete _0x21ccf3['body']['id'];}return db[_0x010a('0x2a')][_0x010a('0x4e')]({'where':{'id':_0x21ccf3[_0x010a('0x53')]['id']}})[_0x010a('0x24')](handleEntityNotFound(_0x178f50,null))['then'](saveUpdates(_0x21ccf3[_0x010a('0x47')],null))[_0x010a('0x24')](respondWithResult(_0x178f50,null))['catch'](handleError(_0x178f50,null));};exports[_0x010a('0x54')]=function(_0x4446a7,_0x212255){var _0x1c7222=_0x4446a7[_0x010a('0x53')]['id'];var _0x426812=[];return db[_0x010a('0x55')][_0x010a('0x56')](function(_0x46b597){var _0x2ecccd=_0x010a('0x57')+_0x1c7222;return db[_0x010a('0x55')]['query'](_0x2ecccd,{'type':db['Sequelize']['QueryTypes'][_0x010a('0x58')],'raw':!![],'transaction':_0x46b597})[_0x010a('0x24')](function(_0x1024c7){_0x426812=_[_0x010a('0x29')](_0x1024c7,function(_0x2ce944){return Number(_0x2ce944[_0x010a('0x59')]);});})[_0x010a('0x24')](function(){var _0xbfff3f=_0x010a('0x5a')+_0x1c7222;return db[_0x010a('0x55')][_0x010a('0x2e')](_0xbfff3f,{'type':db[_0x010a('0x5b')]['QueryTypes'][_0x010a('0x58')],'raw':!![],'transaction':_0x46b597});})[_0x010a('0x24')](function(_0x131870){var _0x4f7559=_[_0x010a('0x29')](_0x131870,function(_0x37a3f1){return Number(_0x37a3f1['VoiceQueueId']);});return db[_0x010a('0x5c')][_0x010a('0x54')]({'where':{'UserId':{'$in':_0x426812},'VoiceQueueId':{'$in':_0x4f7559}},'transaction':_0x46b597});})[_0x010a('0x24')](function(){var _0x55123d=_0x010a('0x5d')+_0x1c7222;return db['sequelize']['query'](_0x55123d,{'type':db['Sequelize'][_0x010a('0x5e')][_0x010a('0x58')],'raw':!![],'transaction':_0x46b597});})['then'](function(_0x36e3ea){var _0x228943=_[_0x010a('0x29')](_0x36e3ea,function(_0x3e8290){return Number(_0x3e8290[_0x010a('0x5f')]);});return db['UserMailQueue'][_0x010a('0x54')]({'where':{'UserId':{'$in':_0x426812},'MailQueueId':{'$in':_0x228943}},'transaction':_0x46b597});})[_0x010a('0x24')](function(){var _0x42776b=_0x010a('0x60')+_0x1c7222;return db[_0x010a('0x55')][_0x010a('0x2e')](_0x42776b,{'type':db['Sequelize'][_0x010a('0x5e')][_0x010a('0x58')],'raw':!![],'transaction':_0x46b597});})[_0x010a('0x24')](function(_0x1b0f9d){var _0x3b17c3=_['map'](_0x1b0f9d,function(_0x3ce85a){return Number(_0x3ce85a[_0x010a('0x61')]);});return db[_0x010a('0x62')]['destroy']({'where':{'UserId':{'$in':_0x426812},'SmsQueueId':{'$in':_0x3b17c3}},'transaction':_0x46b597});})[_0x010a('0x24')](function(){var _0x2a9097=_0x010a('0x63')+_0x1c7222;return db[_0x010a('0x55')][_0x010a('0x2e')](_0x2a9097,{'type':db['Sequelize']['QueryTypes'][_0x010a('0x58')],'raw':!![],'transaction':_0x46b597});})[_0x010a('0x24')](function(_0x1e425d){var _0x4ffb17=_[_0x010a('0x29')](_0x1e425d,function(_0x463ce2){return Number(_0x463ce2[_0x010a('0x64')]);});return db['UserChatQueue'][_0x010a('0x54')]({'where':{'UserId':{'$in':_0x426812},'ChatQueueId':{'$in':_0x4ffb17}},'transaction':_0x46b597});})[_0x010a('0x24')](function(){var _0x5ddff4=_0x010a('0x65')+_0x1c7222;return db[_0x010a('0x55')][_0x010a('0x2e')](_0x5ddff4,{'type':db['Sequelize'][_0x010a('0x5e')][_0x010a('0x58')],'raw':!![],'transaction':_0x46b597});})[_0x010a('0x24')](function(_0x3c8b17){var _0x1b249e=_['map'](_0x3c8b17,function(_0xdec9bb){return Number(_0xdec9bb[_0x010a('0x66')]);});return db[_0x010a('0x67')][_0x010a('0x54')]({'where':{'UserId':{'$in':_0x426812},'FaxQueueId':{'$in':_0x1b249e}},'transaction':_0x46b597});})[_0x010a('0x24')](function(){var _0x3faf4c='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1c7222;return db[_0x010a('0x55')]['query'](_0x3faf4c,{'type':db[_0x010a('0x5b')][_0x010a('0x5e')][_0x010a('0x58')],'raw':!![],'transaction':_0x46b597});})[_0x010a('0x24')](function(_0x272efe){var _0xdac422=_[_0x010a('0x29')](_0x272efe,function(_0xba44c){return Number(_0xba44c[_0x010a('0x68')]);});return db['UserOpenchannelQueue'][_0x010a('0x54')]({'where':{'UserId':{'$in':_0x426812},'OpenchannelQueueId':{'$in':_0xdac422}},'transaction':_0x46b597});})[_0x010a('0x24')](function(){var _0x292483=_0x010a('0x69')+_0x1c7222;return db[_0x010a('0x55')][_0x010a('0x2e')](_0x292483,{'type':db[_0x010a('0x5b')][_0x010a('0x5e')]['SELECT'],'raw':!![],'transaction':_0x46b597});})[_0x010a('0x24')](function(_0x1651d0){var _0xcdcf0c=_[_0x010a('0x29')](_0x1651d0,function(_0x451f07){return Number(_0x451f07['WhatsappQueueId']);});return db[_0x010a('0x6a')][_0x010a('0x54')]({'where':{'UserId':{'$in':_0x426812},'WhatsappQueueId':{'$in':_0xcdcf0c}},'transaction':_0x46b597});})[_0x010a('0x24')](function(){return db[_0x010a('0x6b')][_0x010a('0x4e')]({'where':{'TeamId':_0x1c7222}});})[_0x010a('0x24')](function(_0x5ab628){if(_0x5ab628===null){return;}return db[_0x010a('0x6c')][_0x010a('0x54')]({'where':{'UserId':{'$in':_0x426812},'VoicePrefixId':_0x5ab628[_0x010a('0x6d')]},'transaction':_0x46b597});})[_0x010a('0x24')](function(){return db[_0x010a('0x2a')][_0x010a('0x54')]({'where':{'id':_0x1c7222},'cascade':!![],'transaction':_0x46b597});})[_0x010a('0x24')](function(_0x3cee0d){if(_0x3cee0d===0x0){_0x212255[_0x010a('0x16')](0x194);}else{return db[_0x010a('0x50')][_0x010a('0x54')]({'where':{'type':'Teams','resourceId':_0x1c7222},'cascade':!![],'transaction':_0x46b597})[_0x010a('0x24')](function(){_0x212255[_0x010a('0x17')](0xcc)['end']();});}})[_0x010a('0x42')](function(_0x36f6f6){_0x212255[_0x010a('0x17')](0x1f4)[_0x010a('0x27')](_0x36f6f6);});});};exports[_0x010a('0x6e')]=function(_0x122a6b,_0x588196,_0x80eaa6){return db[_0x010a('0x2a')][_0x010a('0x6f')]({'where':{'id':_0x122a6b[_0x010a('0x53')]['id']}})['then'](handleEntityNotFound(_0x588196,null))[_0x010a('0x24')](function(_0xecf2ee){if(!_0x122a6b[_0x010a('0x2e')][_0x010a('0x70')]||!utils['isValidChannel'](_0x122a6b[_0x010a('0x2e')][_0x010a('0x70')])){throw new db[(_0x010a('0x5b'))][(_0x010a('0x71'))](_0x010a('0x72'));}var _0x58a07d={};var _0x2bc3fa={};_0x2bc3fa[_0x010a('0x2d')]=_[_0x010a('0x44')](db[_[_0x010a('0x73')](_0x122a6b['query'][_0x010a('0x70')][_0x010a('0x74')]())+_0x010a('0x75')][_0x010a('0x45')]);_0x2bc3fa[_0x010a('0x2e')]=_[_0x010a('0x44')](_0x122a6b[_0x010a('0x2e')]);_0x2bc3fa[_0x010a('0x2f')]=_[_0x010a('0x30')](_0x2bc3fa['model'],_0x2bc3fa[_0x010a('0x2e')]);_0x58a07d[_0x010a('0x32')]=_[_0x010a('0x30')](_0x2bc3fa[_0x010a('0x2d')],qs[_0x010a('0x31')](_0x122a6b[_0x010a('0x2e')][_0x010a('0x31')]));_0x58a07d[_0x010a('0x32')]=_0x58a07d['attributes'][_0x010a('0x33')]?_0x58a07d[_0x010a('0x32')]:_0x2bc3fa[_0x010a('0x2d')];_0x58a07d[_0x010a('0x1c')]=qs[_0x010a('0x1c')](_0x122a6b[_0x010a('0x2e')]['limit']);_0x58a07d[_0x010a('0x1a')]=qs[_0x010a('0x1a')](_0x122a6b[_0x010a('0x2e')][_0x010a('0x1a')]);_0x58a07d[_0x010a('0x36')]=qs['sort'](_0x122a6b['query'][_0x010a('0x37')]);_0x58a07d['where']=qs[_0x010a('0x2f')](_[_0x010a('0x39')](_0x122a6b[_0x010a('0x2e')],_0x2bc3fa[_0x010a('0x2f')]));_0x58a07d=_[_0x010a('0x3b')]({},_0x58a07d,_0x122a6b['options']);return _0xecf2ee[_0x010a('0x4b')+_[_0x010a('0x73')](_0x122a6b[_0x010a('0x2e')]['channel'][_0x010a('0x74')]())+_0x010a('0x76')](_0x58a07d);})[_0x010a('0x24')](respondWithResult(_0x588196,null))['catch'](handleError(_0x588196,null));};exports[_0x010a('0x77')]=function(_0x55ea83,_0x559a1e,_0x32198b){return db['Team']['findOne']({'where':{'id':_0x55ea83[_0x010a('0x53')]['id']}})[_0x010a('0x24')](function(_0x284505){if(_0x284505){if(!_0x55ea83[_0x010a('0x47')]['channel']||!utils[_0x010a('0x78')](_0x55ea83[_0x010a('0x47')]['channel'])){throw new db[(_0x010a('0x5b'))][(_0x010a('0x71'))](_0x010a('0x72'));}return _0x284505[_0x010a('0x79')+_[_0x010a('0x73')](_0x55ea83[_0x010a('0x47')][_0x010a('0x70')][_0x010a('0x74')]())+'Queues'](_0x55ea83[_0x010a('0x47')][_0x010a('0x7a')]);}return null;})[_0x010a('0x24')](handleEntityNotFound(_0x559a1e,null))[_0x010a('0x24')](respondWithStatusCode(_0x559a1e,null))[_0x010a('0x42')](handleError(_0x559a1e,null));};exports[_0x010a('0x7b')]=function(_0x19c723,_0x55d1f9,_0xa576b){return db[_0x010a('0x2a')][_0x010a('0x6f')]({'where':{'id':_0x19c723[_0x010a('0x53')]['id']}})[_0x010a('0x24')](function(_0x1ee3a4){if(_0x1ee3a4){if(!_0x19c723['query'][_0x010a('0x70')]||!utils[_0x010a('0x78')](_0x19c723['query'][_0x010a('0x70')])){throw new db[(_0x010a('0x5b'))][(_0x010a('0x71'))](_0x010a('0x72'));}return _0x1ee3a4[_0x010a('0x7c')+_[_0x010a('0x73')](_0x19c723['query'][_0x010a('0x70')]['toLowerCase']())+_0x010a('0x76')](_0x19c723[_0x010a('0x2e')][_0x010a('0x7a')]);}return null;})['then'](handleEntityNotFound(_0x55d1f9,null))['then'](respondWithStatusCode(_0x55d1f9,null))[_0x010a('0x42')](handleError(_0x55d1f9,null));};exports[_0x010a('0x7d')]=function(_0x3bdc8e,_0x5eca3f){var _0xfad2f=_[_0x010a('0x7e')](_0x3bdc8e[_0x010a('0x47')][_0x010a('0x7a')])?_0x3bdc8e[_0x010a('0x47')][_0x010a('0x7a')]:[_0x3bdc8e['body'][_0x010a('0x7a')]];var _0x14f32e=_0x3bdc8e[_0x010a('0x53')]['id'];return db[_0x010a('0x2a')]['find']({'where':{'id':_0x14f32e}})[_0x010a('0x24')](handleEntityNotFound(_0x5eca3f,null))[_0x010a('0x24')](function(_0x512a7f){if(_0x512a7f){var _0x55fb63=[_0x010a('0x7f'),'Chat',_0x010a('0x80'),_0x010a('0x81'),_0x010a('0x82'),_0x010a('0x83'),'Whatsapp'];return db['sequelize'][_0x010a('0x56')](function(_0x3a4f45){var _0x548789=_[_0x010a('0x29')](_0x55fb63,function(_0x2ebfc1){var _0x141c49={'attributes':['id',_0x010a('0x26')]};if(_0x2ebfc1===_0x010a('0x7f')){_0x141c49['through']={'attributes':['penalty']};}return _0x512a7f[_0x010a('0x4b')+_0x2ebfc1+_0x010a('0x76')](_0x141c49)[_0x010a('0x24')](function(_0xc30336){var _0x40da09=_[_0x010a('0x29')](_0xc30336,function(_0x191385){var _0x5e66e1=_['map'](_0xfad2f,function(_0x4e47cc){var _0x290cc0={'where':{'UserId':_0x4e47cc,[_0x2ebfc1+'QueueId']:_0x191385['id']},'transaction':_0x3a4f45};if(_0x2ebfc1===_0x010a('0x7f')){_0x290cc0[_0x010a('0x84')]={'penalty':_0x191385[_0x010a('0x85')][_0x010a('0x86')]};}return db['User'+_0x2ebfc1+'Queue'][_0x010a('0x87')](_0x290cc0)[_0x010a('0x24')](function(){socket['emit']('user'+_0x2ebfc1+_0x010a('0x88'),{'UserId':_0x4e47cc,[_0x2ebfc1+_0x010a('0x89')]:_0x191385['id']});if(_0x2ebfc1!==_0x010a('0x7f')){return;}return db[_0x010a('0x8a')]['findAll']({'where':{'id':_0xfad2f,'online':0x1},'attributes':['id','name','online',_0x010a('0x8b'),'interface'],'raw':!![]})['then'](function(_0x163cd2){var _0x4a3be2=_[_0x010a('0x29')](_0x163cd2,function(_0x510c3b){return db['UserVoiceQueueRt']['upsert']({'membername':_0x510c3b['name'],'UserId':_0x510c3b['id'],'queue_name':_0x191385[_0x010a('0x26')],'VoiceQueueId':_0x191385['id'],'interface':_[_0x010a('0x8c')](_0x510c3b[_0x010a('0x8d')])?util[_0x010a('0x8e')](_0x010a('0x8f'),_0x510c3b[_0x010a('0x26')]):_0x510c3b[_0x010a('0x8d')],'paused':_0x510c3b['voicePause']||![],'penalty':_0x191385[_0x010a('0x85')][_0x010a('0x86')]},{'transaction':_0x3a4f45});});return Promise[_0x010a('0x90')](_0x4a3be2);});});});return Promise['all'](_0x5e66e1);});return Promise['all'](_0x40da09);})[_0x010a('0x24')](function(){return db['TeamVoicePrefix'][_0x010a('0x6f')]({'where':{'teamId':_0x14f32e}})[_0x010a('0x24')](function(_0x38cfaf){if(_0x38cfaf){var _0x25d338=_[_0x010a('0x29')](_0xfad2f,function(_0x349ce8){db['UserVoicePrefix'][_0x010a('0x91')]({'UserId':_0x349ce8,'VoicePrefixId':_0x38cfaf[_0x010a('0x6d')]});});return Promise[_0x010a('0x90')](_0x25d338);}});});});return Promise[_0x010a('0x90')](_0x548789)['then'](function(){return _0x512a7f['addAgents'](_0xfad2f,{'transaction':_0x3a4f45})[_0x010a('0x92')](function(_0x5791cc){return _0x5791cc;});});});}})[_0x010a('0x24')](respondWithResult(_0x5eca3f,null))[_0x010a('0x42')](handleError(_0x5eca3f,null));};exports[_0x010a('0x93')]=function(_0x339ef1,_0x4cbc8a){var _0x5b5f6d=_[_0x010a('0x7e')](_0x339ef1[_0x010a('0x2e')]['ids'])?_0x339ef1[_0x010a('0x2e')][_0x010a('0x7a')]:[_0x339ef1[_0x010a('0x2e')][_0x010a('0x7a')]];var _0xd43fc1=_0x339ef1[_0x010a('0x53')]['id'];return db[_0x010a('0x2a')][_0x010a('0x4e')]({'where':{'id':_0xd43fc1}})['then'](handleEntityNotFound(_0x4cbc8a,null))[_0x010a('0x24')](function(_0x3e45a9){if(_0x3e45a9){var _0x38900c=[_0x010a('0x7f'),'Chat','Mail',_0x010a('0x81'),_0x010a('0x82'),'Openchannel',_0x010a('0x94')];return db[_0x010a('0x55')][_0x010a('0x56')](function(_0x41a14e){var _0x198738=_[_0x010a('0x29')](_0x38900c,function(_0x3464f2){var _0x3dd33c={'attributes':['id',_0x010a('0x26')]};return _0x3e45a9[_0x010a('0x4b')+_0x3464f2+_0x010a('0x76')](_0x3dd33c)[_0x010a('0x24')](function(_0x23d27c){var _0x37d6ee=_[_0x010a('0x29')](_0x23d27c,function(_0x1750f3){return _0x1750f3[_0x010a('0x93')](_0x5b5f6d,{'transaction':_0x41a14e})[_0x010a('0x24')](function(){var _0x53af33=_['map'](_0x5b5f6d,function(_0x55e1ef){socket[_0x010a('0x95')](_0x010a('0x48')+_0x3464f2+_0x010a('0x96'),{'UserId':Number(_0x55e1ef),[_0x3464f2+'QueueId']:_0x1750f3['id']});if(_0x3464f2!==_0x010a('0x7f')){return;}return db[_0x010a('0x97')][_0x010a('0x54')]({'where':{'VoiceQueueId':_0x1750f3['id'],'UserId':_0x55e1ef},'transaction':_0x41a14e});});return Promise['all'](_0x53af33);});});return Promise['all'](_0x37d6ee);});});return Promise[_0x010a('0x90')](_0x198738)['then'](function(){return _0x3e45a9[_0x010a('0x93')](_0x5b5f6d,{'transaction':_0x41a14e});})[_0x010a('0x24')](function(){return db[_0x010a('0x6b')][_0x010a('0x6f')]({'where':{'teamId':_0xd43fc1}})[_0x010a('0x24')](function(_0x1686e0){if(_0x1686e0){var _0x44297f=_[_0x010a('0x29')](_0x5b5f6d,function(_0x3d260b){db[_0x010a('0x6c')]['destroy']({'where':{'UserId':_0x3d260b,'VoicePrefixId':_0x1686e0[_0x010a('0x6d')]}});});return Promise[_0x010a('0x90')](_0x44297f);}});});});}})[_0x010a('0x24')](respondWithStatusCode(_0x4cbc8a,null))[_0x010a('0x42')](handleError(_0x4cbc8a,null));};exports[_0x010a('0x98')]=function(_0x55d263,_0x854e20,_0x2efd7d){var _0x5ec585={};var _0x2b4653={};var _0x520347;var _0x40d921;return db[_0x010a('0x2a')][_0x010a('0x6f')]({'where':{'id':_0x55d263[_0x010a('0x53')]['id']}})[_0x010a('0x24')](handleEntityNotFound(_0x854e20,null))[_0x010a('0x24')](function(_0x5a1177){if(_0x5a1177){_0x520347=_0x5a1177;_0x2b4653[_0x010a('0x2d')]=_[_0x010a('0x44')](db[_0x010a('0x8a')][_0x010a('0x45')]);_0x2b4653[_0x010a('0x2e')]=_[_0x010a('0x44')](_0x55d263['query']);_0x2b4653[_0x010a('0x2f')]=_[_0x010a('0x30')](_0x2b4653[_0x010a('0x2d')],_0x2b4653[_0x010a('0x2e')]);_0x5ec585[_0x010a('0x32')]=_[_0x010a('0x30')](_0x2b4653[_0x010a('0x2d')],qs[_0x010a('0x31')](_0x55d263['query'][_0x010a('0x31')]));_0x5ec585['attributes']=_0x5ec585[_0x010a('0x32')][_0x010a('0x33')]?_0x5ec585[_0x010a('0x32')]:_0x2b4653['model'];_0x5ec585[_0x010a('0x36')]=qs['sort'](_0x55d263[_0x010a('0x2e')]['sort']);_0x5ec585[_0x010a('0x38')]=qs[_0x010a('0x2f')](_[_0x010a('0x39')](_0x55d263['query'],_0x2b4653[_0x010a('0x2f')]));if(_0x55d263[_0x010a('0x2e')][_0x010a('0x3a')]){_0x5ec585[_0x010a('0x38')]=_[_0x010a('0x3b')](_0x5ec585['where'],{'$or':_[_0x010a('0x29')](_0x5ec585[_0x010a('0x32')],function(_0x1f8955){var _0x2d5472={};_0x2d5472[_0x1f8955]={'$like':'%'+_0x55d263[_0x010a('0x2e')][_0x010a('0x3a')]+'%'};return _0x2d5472;})});}_0x5ec585=_[_0x010a('0x3b')]({},_0x5ec585,_0x55d263['options']);return _0x520347[_0x010a('0x98')](_0x5ec585);}})[_0x010a('0x24')](function(_0x1a797b){if(_0x1a797b){_0x40d921=_0x1a797b[_0x010a('0x33')];if(!_0x55d263['query']['hasOwnProperty']('nolimit')){_0x5ec585[_0x010a('0x1c')]=qs['limit'](_0x55d263[_0x010a('0x2e')][_0x010a('0x1c')]);_0x5ec585[_0x010a('0x1a')]=qs['offset'](_0x55d263[_0x010a('0x2e')][_0x010a('0x1a')]);}return _0x520347['getAgents'](_0x5ec585);}})[_0x010a('0x24')](function(_0x3ef4fb){if(_0x3ef4fb){return _0x3ef4fb?{'count':_0x40d921,'rows':_0x3ef4fb}:null;}})[_0x010a('0x24')](respondWithResult(_0x854e20,null))[_0x010a('0x42')](handleError(_0x854e20,null));}; \ No newline at end of file +var _0x4586=['Mail','Sms','Fax','Openchannel','Whatsapp','through','penalty','QueueId','User','findOrCreate','emit','Queue:save','online','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','voicePause','all','spread','removeAgents','Queue:remove','getAgents','pick','length','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','json','apply','update','then','stack','name','index','map','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','Team','include','findAll','rows','catch','show','keys','includeAll','find','create','user','get','role','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','send','getQueues','findOne','params','channel','isValidChannel','ValidationError','capitalize','toLowerCase','Queue','rawAttributes','order','Queues','addQueues','Unknown\x20channel','add','ids','remove','addAgents','isArray','Voice','Chat'];(function(_0x184428,_0x1735fc){var _0x40ed56=function(_0xbf66f5){while(--_0xbf66f5){_0x184428['push'](_0x184428['shift']());}};_0x40ed56(++_0x1735fc);}(_0x4586,0x152));var _0x6458=function(_0x2fd873,_0x51262f){_0x2fd873=_0x2fd873-0x0;var _0x23e544=_0x4586[_0x2fd873];return _0x23e544;};'use strict';var emlformat=require(_0x6458('0x0'));var rimraf=require(_0x6458('0x1'));var zipdir=require(_0x6458('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6458('0x3'));var moment=require(_0x6458('0x4'));var BPromise=require(_0x6458('0x5'));var Mustache=require(_0x6458('0x6'));var util=require(_0x6458('0x7'));var path=require(_0x6458('0x8'));var sox=require('sox');var csv=require(_0x6458('0x9'));var ejs=require(_0x6458('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6458('0xb'));var squel=require('squel');var crypto=require(_0x6458('0xc'));var jsforce=require(_0x6458('0xd'));var deskjs=require(_0x6458('0xe'));var toCsv=require(_0x6458('0x9'));var querystring=require('querystring');var Papa=require(_0x6458('0xf'));var Redis=require(_0x6458('0x10'));var authService=require(_0x6458('0x11'));var qs=require(_0x6458('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6458('0x13'));var logger=require(_0x6458('0x14'))('api');var utils=require(_0x6458('0x15'));var config=require(_0x6458('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6458('0x17'))['db'];config[_0x6458('0x18')]=_[_0x6458('0x19')](config['redis'],{'host':_0x6458('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6458('0x18')]));require(_0x6458('0x1b'))[_0x6458('0x1c')](socket);function respondWithStatusCode(_0xcbfbbf,_0x5a5899){_0x5a5899=_0x5a5899||0xcc;return function(_0x36102c){if(_0x36102c){return _0xcbfbbf[_0x6458('0x1d')](_0x5a5899);}return _0xcbfbbf['status'](_0x5a5899)[_0x6458('0x1e')]();};}function respondWithResult(_0x1d0bd4,_0x2d454e){_0x2d454e=_0x2d454e||0xc8;return function(_0x1ebc83){if(_0x1ebc83){return _0x1d0bd4['status'](_0x2d454e)['json'](_0x1ebc83);}};}function respondWithFilteredResult(_0x501496,_0x3af61a){return function(_0x20a94e){if(_0x20a94e){var _0x22a03d=typeof _0x3af61a[_0x6458('0x1f')]===_0x6458('0x20')&&typeof _0x3af61a['limit']===_0x6458('0x20');var _0x1ce1fb=_0x20a94e[_0x6458('0x21')];var _0x14178d=_0x22a03d?0x0:_0x3af61a[_0x6458('0x1f')];var _0x8ff198=_0x22a03d?_0x20a94e[_0x6458('0x21')]:_0x3af61a[_0x6458('0x1f')]+_0x3af61a[_0x6458('0x22')];var _0x5752d9;if(_0x8ff198>=_0x1ce1fb){_0x8ff198=_0x1ce1fb;_0x5752d9=0xc8;}else{_0x5752d9=0xce;}_0x501496[_0x6458('0x23')](_0x5752d9);return _0x501496[_0x6458('0x24')](_0x6458('0x25'),_0x14178d+'-'+_0x8ff198+'/'+_0x1ce1fb)[_0x6458('0x26')](_0x20a94e);}return null;};}function patchUpdates(_0xed1fda){return function(_0x338cf6){try{jsonpatch[_0x6458('0x27')](_0x338cf6,_0xed1fda,!![]);}catch(_0x460806){return BPromise['reject'](_0x460806);}return _0x338cf6['save']();};}function saveUpdates(_0x5a4df4,_0x186ef3){return function(_0x3b2a07){if(_0x3b2a07){return _0x3b2a07[_0x6458('0x28')](_0x5a4df4)[_0x6458('0x29')](function(_0x452cb2){return _0x452cb2;});}return null;};}function handleEntityNotFound(_0x308807,_0x15252e){return function(_0xd254c8){if(!_0xd254c8){_0x308807[_0x6458('0x1d')](0x194);}return _0xd254c8;};}function handleError(_0x3c5136,_0x4ece5a){_0x4ece5a=_0x4ece5a||0x1f4;return function(_0x5a45ea){logger['error'](_0x5a45ea[_0x6458('0x2a')]);if(_0x5a45ea['name']){delete _0x5a45ea[_0x6458('0x2b')];}_0x3c5136[_0x6458('0x23')](_0x4ece5a)['send'](_0x5a45ea);};}exports[_0x6458('0x2c')]=function(_0xcc9dba,_0x1b461c){var _0x25d587={},_0x1187e7={},_0xa0f9a={'count':0x0,'rows':[]};var _0x3a1971=_[_0x6458('0x2d')](db['Team']['rawAttributes'],function(_0x2a6663){return{'name':_0x2a6663[_0x6458('0x2e')],'type':_0x2a6663[_0x6458('0x2f')]['key']};});_0x1187e7[_0x6458('0x30')]=_['map'](_0x3a1971,_0x6458('0x2b'));_0x1187e7[_0x6458('0x31')]=_['keys'](_0xcc9dba['query']);_0x1187e7[_0x6458('0x32')]=_['intersection'](_0x1187e7[_0x6458('0x30')],_0x1187e7['query']);_0x25d587[_0x6458('0x33')]=_[_0x6458('0x34')](_0x1187e7[_0x6458('0x30')],qs['fields'](_0xcc9dba[_0x6458('0x31')][_0x6458('0x35')]));_0x25d587[_0x6458('0x33')]=_0x25d587['attributes']['length']?_0x25d587[_0x6458('0x33')]:_0x1187e7['model'];if(!_0xcc9dba[_0x6458('0x31')][_0x6458('0x36')](_0x6458('0x37'))){_0x25d587['limit']=qs[_0x6458('0x22')](_0xcc9dba[_0x6458('0x31')][_0x6458('0x22')]);_0x25d587[_0x6458('0x1f')]=qs['offset'](_0xcc9dba[_0x6458('0x31')][_0x6458('0x1f')]);}_0x25d587['order']=qs[_0x6458('0x38')](_0xcc9dba[_0x6458('0x31')][_0x6458('0x38')]);_0x25d587[_0x6458('0x39')]=qs[_0x6458('0x32')](_['pick'](_0xcc9dba[_0x6458('0x31')],_0x1187e7[_0x6458('0x32')]),_0x3a1971);if(_0xcc9dba[_0x6458('0x31')][_0x6458('0x3a')]){_0x25d587['where']=_[_0x6458('0x3b')](_0x25d587['where'],{'$or':_[_0x6458('0x2d')](_0x3a1971,function(_0x4b25fc){if(_0x4b25fc[_0x6458('0x2f')]!==_0x6458('0x3c')){var _0x772921={};_0x772921[_0x4b25fc[_0x6458('0x2b')]]={'$like':'%'+_0xcc9dba[_0x6458('0x31')]['filter']+'%'};return _0x772921;}})});}_0x25d587=_[_0x6458('0x3b')]({},_0x25d587,_0xcc9dba[_0x6458('0x3d')]);var _0x3c5bbc={'where':_0x25d587['where']};return db[_0x6458('0x3e')][_0x6458('0x21')](_0x3c5bbc)[_0x6458('0x29')](function(_0x2a9249){_0xa0f9a[_0x6458('0x21')]=_0x2a9249;if(_0xcc9dba[_0x6458('0x31')]['includeAll']){_0x25d587[_0x6458('0x3f')]=[{'all':!![]}];}return db[_0x6458('0x3e')][_0x6458('0x40')](_0x25d587);})[_0x6458('0x29')](function(_0x2d2bd4){_0xa0f9a[_0x6458('0x41')]=_0x2d2bd4;return _0xa0f9a;})[_0x6458('0x29')](respondWithFilteredResult(_0x1b461c,_0x25d587))[_0x6458('0x42')](handleError(_0x1b461c,null));};exports[_0x6458('0x43')]=function(_0x4f8a20,_0x387e59){var _0x411ace={'raw':![],'where':{'id':_0x4f8a20['params']['id']}},_0xd2f278={};_0xd2f278['model']=_['keys'](db[_0x6458('0x3e')]['rawAttributes']);_0xd2f278[_0x6458('0x31')]=_[_0x6458('0x44')](_0x4f8a20[_0x6458('0x31')]);_0xd2f278['filters']=_[_0x6458('0x34')](_0xd2f278[_0x6458('0x30')],_0xd2f278[_0x6458('0x31')]);_0x411ace[_0x6458('0x33')]=_[_0x6458('0x34')](_0xd2f278[_0x6458('0x30')],qs[_0x6458('0x35')](_0x4f8a20[_0x6458('0x31')][_0x6458('0x35')]));_0x411ace['attributes']=_0x411ace['attributes']['length']?_0x411ace[_0x6458('0x33')]:_0xd2f278[_0x6458('0x30')];if(_0x4f8a20[_0x6458('0x31')][_0x6458('0x45')]){_0x411ace[_0x6458('0x3f')]=[{'all':!![]}];}_0x411ace=_[_0x6458('0x3b')]({},_0x411ace,_0x4f8a20[_0x6458('0x3d')]);return db[_0x6458('0x3e')][_0x6458('0x46')](_0x411ace)['then'](handleEntityNotFound(_0x387e59,null))[_0x6458('0x29')](respondWithResult(_0x387e59,null))[_0x6458('0x42')](handleError(_0x387e59,null));};exports['create']=function(_0x376e01,_0x16e8fc){return db[_0x6458('0x3e')][_0x6458('0x47')](_0x376e01['body'],{})[_0x6458('0x29')](function(_0x6519f6){var _0x2941a6=_0x376e01[_0x6458('0x48')][_0x6458('0x49')]({'plain':!![]});if(!_0x2941a6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2941a6[_0x6458('0x4a')]===_0x6458('0x48')){var _0x1bfe3e=_0x6519f6[_0x6458('0x49')]({'plain':!![]});var _0x8a2c94='Teams';return db['UserProfileSection'][_0x6458('0x46')]({'where':{'name':_0x8a2c94,'userProfileId':_0x2941a6['userProfileId']},'raw':!![]})[_0x6458('0x29')](function(_0x212426){if(_0x212426&&_0x212426[_0x6458('0x4b')]===0x0){return db[_0x6458('0x4c')][_0x6458('0x47')]({'name':_0x1bfe3e[_0x6458('0x2b')],'resourceId':_0x1bfe3e['id'],'type':_0x212426['name'],'sectionId':_0x212426['id']},{})[_0x6458('0x29')](function(){return _0x6519f6;});}else{return _0x6519f6;}})[_0x6458('0x42')](function(_0x2a43dc){logger[_0x6458('0x4d')](_0x6458('0x4e'),_0x2a43dc);throw _0x2a43dc;});}return _0x6519f6;})[_0x6458('0x29')](respondWithResult(_0x16e8fc,0xc9))['catch'](handleError(_0x16e8fc,null));};exports[_0x6458('0x28')]=function(_0x47e576,_0x110186){if(_0x47e576[_0x6458('0x4f')]['id']){delete _0x47e576['body']['id'];}return db[_0x6458('0x3e')][_0x6458('0x46')]({'where':{'id':_0x47e576['params']['id']}})['then'](handleEntityNotFound(_0x110186,null))[_0x6458('0x29')](saveUpdates(_0x47e576['body'],null))['then'](respondWithResult(_0x110186,null))[_0x6458('0x42')](handleError(_0x110186,null));};exports['destroy']=function(_0x493314,_0x24b0fc){var _0x21ff16=_0x493314['params']['id'];var _0x2a1947=[];return db['sequelize'][_0x6458('0x50')](function(_0x20110b){var _0x54e170=_0x6458('0x51')+_0x21ff16;return db[_0x6458('0x52')][_0x6458('0x31')](_0x54e170,{'type':db['Sequelize'][_0x6458('0x53')]['SELECT'],'raw':!![],'transaction':_0x20110b})['then'](function(_0x5254){_0x2a1947=_[_0x6458('0x2d')](_0x5254,function(_0x1c99bb){return Number(_0x1c99bb[_0x6458('0x54')]);});})[_0x6458('0x29')](function(){var _0x56528b=_0x6458('0x55')+_0x21ff16;return db['sequelize'][_0x6458('0x31')](_0x56528b,{'type':db[_0x6458('0x56')][_0x6458('0x53')]['SELECT'],'raw':!![],'transaction':_0x20110b});})[_0x6458('0x29')](function(_0x571f6f){var _0x16f281=_[_0x6458('0x2d')](_0x571f6f,function(_0x2a82ae){return Number(_0x2a82ae['VoiceQueueId']);});return db[_0x6458('0x57')][_0x6458('0x58')]({'where':{'UserId':{'$in':_0x2a1947},'VoiceQueueId':{'$in':_0x16f281}},'transaction':_0x20110b});})[_0x6458('0x29')](function(){var _0x42e065=_0x6458('0x59')+_0x21ff16;return db[_0x6458('0x52')][_0x6458('0x31')](_0x42e065,{'type':db[_0x6458('0x56')][_0x6458('0x53')][_0x6458('0x5a')],'raw':!![],'transaction':_0x20110b});})[_0x6458('0x29')](function(_0x48d679){var _0x2cdd01=_[_0x6458('0x2d')](_0x48d679,function(_0x547e89){return Number(_0x547e89[_0x6458('0x5b')]);});return db['UserMailQueue'][_0x6458('0x58')]({'where':{'UserId':{'$in':_0x2a1947},'MailQueueId':{'$in':_0x2cdd01}},'transaction':_0x20110b});})[_0x6458('0x29')](function(){var _0x124c35=_0x6458('0x5c')+_0x21ff16;return db['sequelize'][_0x6458('0x31')](_0x124c35,{'type':db[_0x6458('0x56')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x20110b});})['then'](function(_0x2feb93){var _0x3823cc=_[_0x6458('0x2d')](_0x2feb93,function(_0x1b801a){return Number(_0x1b801a['SmsQueueId']);});return db[_0x6458('0x5d')]['destroy']({'where':{'UserId':{'$in':_0x2a1947},'SmsQueueId':{'$in':_0x3823cc}},'transaction':_0x20110b});})['then'](function(){var _0x370372=_0x6458('0x5e')+_0x21ff16;return db[_0x6458('0x52')][_0x6458('0x31')](_0x370372,{'type':db[_0x6458('0x56')][_0x6458('0x53')][_0x6458('0x5a')],'raw':!![],'transaction':_0x20110b});})[_0x6458('0x29')](function(_0x30e53b){var _0x9bef7f=_[_0x6458('0x2d')](_0x30e53b,function(_0x383bfa){return Number(_0x383bfa[_0x6458('0x5f')]);});return db[_0x6458('0x60')]['destroy']({'where':{'UserId':{'$in':_0x2a1947},'ChatQueueId':{'$in':_0x9bef7f}},'transaction':_0x20110b});})[_0x6458('0x29')](function(){var _0x5af7e2=_0x6458('0x61')+_0x21ff16;return db[_0x6458('0x52')][_0x6458('0x31')](_0x5af7e2,{'type':db[_0x6458('0x56')][_0x6458('0x53')]['SELECT'],'raw':!![],'transaction':_0x20110b});})[_0x6458('0x29')](function(_0x5731c0){var _0x176f05=_[_0x6458('0x2d')](_0x5731c0,function(_0x5b81d3){return Number(_0x5b81d3[_0x6458('0x62')]);});return db[_0x6458('0x63')]['destroy']({'where':{'UserId':{'$in':_0x2a1947},'FaxQueueId':{'$in':_0x176f05}},'transaction':_0x20110b});})[_0x6458('0x29')](function(){var _0x4a2bfb=_0x6458('0x64')+_0x21ff16;return db[_0x6458('0x52')][_0x6458('0x31')](_0x4a2bfb,{'type':db[_0x6458('0x56')][_0x6458('0x53')][_0x6458('0x5a')],'raw':!![],'transaction':_0x20110b});})[_0x6458('0x29')](function(_0x951f6d){var _0x5dc276=_[_0x6458('0x2d')](_0x951f6d,function(_0xed5eb3){return Number(_0xed5eb3[_0x6458('0x65')]);});return db[_0x6458('0x66')]['destroy']({'where':{'UserId':{'$in':_0x2a1947},'OpenchannelQueueId':{'$in':_0x5dc276}},'transaction':_0x20110b});})[_0x6458('0x29')](function(){var _0x28ba26='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x21ff16;return db['sequelize'][_0x6458('0x31')](_0x28ba26,{'type':db[_0x6458('0x56')]['QueryTypes'][_0x6458('0x5a')],'raw':!![],'transaction':_0x20110b});})['then'](function(_0x3238e3){var _0x2f382c=_['map'](_0x3238e3,function(_0x2fa449){return Number(_0x2fa449[_0x6458('0x67')]);});return db[_0x6458('0x68')][_0x6458('0x58')]({'where':{'UserId':{'$in':_0x2a1947},'WhatsappQueueId':{'$in':_0x2f382c}},'transaction':_0x20110b});})['then'](function(){return db[_0x6458('0x69')][_0x6458('0x46')]({'where':{'TeamId':_0x21ff16}});})[_0x6458('0x29')](function(_0x39c3fd){if(_0x39c3fd===null){return;}return db[_0x6458('0x6a')][_0x6458('0x58')]({'where':{'UserId':{'$in':_0x2a1947},'VoicePrefixId':_0x39c3fd[_0x6458('0x6b')]},'transaction':_0x20110b});})[_0x6458('0x29')](function(){return db[_0x6458('0x3e')]['destroy']({'where':{'id':_0x21ff16},'cascade':!![],'transaction':_0x20110b});})[_0x6458('0x29')](function(_0x1695bf){if(_0x1695bf===0x0){_0x24b0fc[_0x6458('0x1d')](0x194);}else{return db[_0x6458('0x4c')]['destroy']({'where':{'type':'Teams','resourceId':_0x21ff16},'cascade':!![],'transaction':_0x20110b})[_0x6458('0x29')](function(){_0x24b0fc[_0x6458('0x23')](0xcc)[_0x6458('0x1e')]();});}})['catch'](function(_0x176a23){_0x24b0fc[_0x6458('0x23')](0x1f4)[_0x6458('0x6c')](_0x176a23);});});};exports[_0x6458('0x6d')]=function(_0x5f1682,_0x2c5b93,_0x1d87ea){return db[_0x6458('0x3e')][_0x6458('0x6e')]({'where':{'id':_0x5f1682[_0x6458('0x6f')]['id']}})['then'](handleEntityNotFound(_0x2c5b93,null))[_0x6458('0x29')](function(_0x34a7e1){if(!_0x5f1682['query'][_0x6458('0x70')]||!utils[_0x6458('0x71')](_0x5f1682[_0x6458('0x31')][_0x6458('0x70')])){throw new db[(_0x6458('0x56'))][(_0x6458('0x72'))]('Unknown\x20channel');}var _0x2d8b8b={};var _0x42e49a={};_0x42e49a[_0x6458('0x30')]=_[_0x6458('0x44')](db[_[_0x6458('0x73')](_0x5f1682[_0x6458('0x31')][_0x6458('0x70')][_0x6458('0x74')]())+_0x6458('0x75')][_0x6458('0x76')]);_0x42e49a[_0x6458('0x31')]=_[_0x6458('0x44')](_0x5f1682[_0x6458('0x31')]);_0x42e49a[_0x6458('0x32')]=_[_0x6458('0x34')](_0x42e49a[_0x6458('0x30')],_0x42e49a[_0x6458('0x31')]);_0x2d8b8b['attributes']=_[_0x6458('0x34')](_0x42e49a[_0x6458('0x30')],qs[_0x6458('0x35')](_0x5f1682[_0x6458('0x31')][_0x6458('0x35')]));_0x2d8b8b['attributes']=_0x2d8b8b[_0x6458('0x33')]['length']?_0x2d8b8b[_0x6458('0x33')]:_0x42e49a['model'];_0x2d8b8b[_0x6458('0x22')]=qs['limit'](_0x5f1682['query']['limit']);_0x2d8b8b[_0x6458('0x1f')]=qs[_0x6458('0x1f')](_0x5f1682[_0x6458('0x31')]['offset']);_0x2d8b8b[_0x6458('0x77')]=qs[_0x6458('0x38')](_0x5f1682[_0x6458('0x31')]['sort']);_0x2d8b8b[_0x6458('0x39')]=qs[_0x6458('0x32')](_['pick'](_0x5f1682['query'],_0x42e49a[_0x6458('0x32')]));_0x2d8b8b=_[_0x6458('0x3b')]({},_0x2d8b8b,_0x5f1682[_0x6458('0x3d')]);return _0x34a7e1[_0x6458('0x49')+_['capitalize'](_0x5f1682['query'][_0x6458('0x70')][_0x6458('0x74')]())+_0x6458('0x78')](_0x2d8b8b);})[_0x6458('0x29')](respondWithResult(_0x2c5b93,null))[_0x6458('0x42')](handleError(_0x2c5b93,null));};exports[_0x6458('0x79')]=function(_0x580b21,_0x165c65,_0x182f0e){return db[_0x6458('0x3e')]['findOne']({'where':{'id':_0x580b21[_0x6458('0x6f')]['id']}})['then'](function(_0x430bfd){if(_0x430bfd){if(!_0x580b21[_0x6458('0x4f')]['channel']||!utils['isValidChannel'](_0x580b21[_0x6458('0x4f')][_0x6458('0x70')])){throw new db['Sequelize'][(_0x6458('0x72'))](_0x6458('0x7a'));}return _0x430bfd[_0x6458('0x7b')+_[_0x6458('0x73')](_0x580b21['body'][_0x6458('0x70')][_0x6458('0x74')]())+_0x6458('0x78')](_0x580b21[_0x6458('0x4f')][_0x6458('0x7c')]);}return null;})[_0x6458('0x29')](handleEntityNotFound(_0x165c65,null))[_0x6458('0x29')](respondWithStatusCode(_0x165c65,null))[_0x6458('0x42')](handleError(_0x165c65,null));};exports['removeQueues']=function(_0x388b88,_0x16e767,_0x3300d8){return db['Team'][_0x6458('0x6e')]({'where':{'id':_0x388b88[_0x6458('0x6f')]['id']}})[_0x6458('0x29')](function(_0x2452b6){if(_0x2452b6){if(!_0x388b88['query'][_0x6458('0x70')]||!utils['isValidChannel'](_0x388b88[_0x6458('0x31')][_0x6458('0x70')])){throw new db[(_0x6458('0x56'))]['ValidationError'](_0x6458('0x7a'));}return _0x2452b6[_0x6458('0x7d')+_[_0x6458('0x73')](_0x388b88[_0x6458('0x31')][_0x6458('0x70')][_0x6458('0x74')]())+_0x6458('0x78')](_0x388b88['query'][_0x6458('0x7c')]);}return null;})[_0x6458('0x29')](handleEntityNotFound(_0x16e767,null))['then'](respondWithStatusCode(_0x16e767,null))[_0x6458('0x42')](handleError(_0x16e767,null));};exports[_0x6458('0x7e')]=function(_0x4f63cb,_0x3b15e3){var _0x4ccd3f=_[_0x6458('0x7f')](_0x4f63cb[_0x6458('0x4f')]['ids'])?_0x4f63cb[_0x6458('0x4f')][_0x6458('0x7c')]:[_0x4f63cb[_0x6458('0x4f')][_0x6458('0x7c')]];var _0x132bde=_0x4f63cb[_0x6458('0x6f')]['id'];return db[_0x6458('0x3e')]['find']({'where':{'id':_0x132bde}})[_0x6458('0x29')](handleEntityNotFound(_0x3b15e3,null))[_0x6458('0x29')](function(_0x105e64){if(_0x105e64){var _0x17645f=[_0x6458('0x80'),_0x6458('0x81'),_0x6458('0x82'),_0x6458('0x83'),_0x6458('0x84'),_0x6458('0x85'),_0x6458('0x86')];return db[_0x6458('0x52')][_0x6458('0x50')](function(_0x518997){var _0x45c77a=_[_0x6458('0x2d')](_0x17645f,function(_0x504751){var _0x1b11ea={'attributes':['id',_0x6458('0x2b')]};if(_0x504751===_0x6458('0x80')){_0x1b11ea[_0x6458('0x87')]={'attributes':[_0x6458('0x88')]};}return _0x105e64[_0x6458('0x49')+_0x504751+_0x6458('0x78')](_0x1b11ea)[_0x6458('0x29')](function(_0x8ab422){var _0x638eb6=_['map'](_0x8ab422,function(_0x1806aa){var _0x4f3f7b=_[_0x6458('0x2d')](_0x4ccd3f,function(_0x1f773c){var _0x58f285={'where':{'UserId':_0x1f773c,[_0x504751+_0x6458('0x89')]:_0x1806aa['id']},'transaction':_0x518997};if(_0x504751===_0x6458('0x80')){_0x58f285[_0x6458('0x19')]={'penalty':_0x1806aa['TeamVoiceQueue']['penalty']};}return db[_0x6458('0x8a')+_0x504751+_0x6458('0x75')][_0x6458('0x8b')](_0x58f285)['then'](function(){socket[_0x6458('0x8c')]('user'+_0x504751+_0x6458('0x8d'),{'UserId':_0x1f773c,[_0x504751+_0x6458('0x89')]:_0x1806aa['id']});if(_0x504751!==_0x6458('0x80')){return;}return db['User'][_0x6458('0x40')]({'where':{'id':_0x4ccd3f,'online':0x1},'attributes':['id','name',_0x6458('0x8e'),'voicePause',_0x6458('0x8f')],'raw':!![]})[_0x6458('0x29')](function(_0x39b6ca){var _0xf7295=_[_0x6458('0x2d')](_0x39b6ca,function(_0x3df9f2){return db[_0x6458('0x90')][_0x6458('0x91')]({'membername':_0x3df9f2[_0x6458('0x2b')],'UserId':_0x3df9f2['id'],'queue_name':_0x1806aa[_0x6458('0x2b')],'VoiceQueueId':_0x1806aa['id'],'interface':_[_0x6458('0x92')](_0x3df9f2[_0x6458('0x8f')])?util['format'](_0x6458('0x93'),_0x3df9f2[_0x6458('0x2b')]):_0x3df9f2[_0x6458('0x8f')],'paused':_0x3df9f2[_0x6458('0x94')]||![],'penalty':_0x1806aa['TeamVoiceQueue'][_0x6458('0x88')]},{'transaction':_0x518997});});return Promise[_0x6458('0x95')](_0xf7295);});});});return Promise[_0x6458('0x95')](_0x4f3f7b);});return Promise[_0x6458('0x95')](_0x638eb6);})['then'](function(){return db[_0x6458('0x69')][_0x6458('0x6e')]({'where':{'teamId':_0x132bde}})[_0x6458('0x29')](function(_0xb7da08){if(_0xb7da08){var _0x223106=_[_0x6458('0x2d')](_0x4ccd3f,function(_0x3f28fd){db[_0x6458('0x6a')]['upsert']({'UserId':_0x3f28fd,'VoicePrefixId':_0xb7da08[_0x6458('0x6b')]});});return Promise[_0x6458('0x95')](_0x223106);}});});});return Promise[_0x6458('0x95')](_0x45c77a)[_0x6458('0x29')](function(){return _0x105e64[_0x6458('0x7e')](_0x4ccd3f,{'transaction':_0x518997})[_0x6458('0x96')](function(_0x37e87d){return _0x37e87d;});});});}})['then'](respondWithResult(_0x3b15e3,null))[_0x6458('0x42')](handleError(_0x3b15e3,null));};exports[_0x6458('0x97')]=function(_0x3c7a75,_0x4a5bf7){var _0x30bb2e=_[_0x6458('0x7f')](_0x3c7a75[_0x6458('0x31')][_0x6458('0x7c')])?_0x3c7a75[_0x6458('0x31')]['ids']:[_0x3c7a75[_0x6458('0x31')][_0x6458('0x7c')]];var _0x505c4a=_0x3c7a75[_0x6458('0x6f')]['id'];return db[_0x6458('0x3e')][_0x6458('0x46')]({'where':{'id':_0x505c4a}})[_0x6458('0x29')](handleEntityNotFound(_0x4a5bf7,null))['then'](function(_0x3cd266){if(_0x3cd266){var _0x4c5549=[_0x6458('0x80'),_0x6458('0x81'),_0x6458('0x82'),'Sms','Fax',_0x6458('0x85'),'Whatsapp'];return db[_0x6458('0x52')]['transaction'](function(_0x3bfa7b){var _0x41517f=_[_0x6458('0x2d')](_0x4c5549,function(_0x543d7c){var _0x44983d={'attributes':['id',_0x6458('0x2b')]};return _0x3cd266[_0x6458('0x49')+_0x543d7c+'Queues'](_0x44983d)[_0x6458('0x29')](function(_0x5cac1a){var _0x537c9e=_['map'](_0x5cac1a,function(_0x35ca2e){return _0x35ca2e[_0x6458('0x97')](_0x30bb2e,{'transaction':_0x3bfa7b})[_0x6458('0x29')](function(){var _0x14ac29=_[_0x6458('0x2d')](_0x30bb2e,function(_0x42ea79){socket['emit']('user'+_0x543d7c+_0x6458('0x98'),{'UserId':Number(_0x42ea79),[_0x543d7c+_0x6458('0x89')]:_0x35ca2e['id']});if(_0x543d7c!==_0x6458('0x80')){return;}return db[_0x6458('0x90')][_0x6458('0x58')]({'where':{'VoiceQueueId':_0x35ca2e['id'],'UserId':_0x42ea79},'transaction':_0x3bfa7b});});return Promise['all'](_0x14ac29);});});return Promise[_0x6458('0x95')](_0x537c9e);});});return Promise['all'](_0x41517f)['then'](function(){return _0x3cd266[_0x6458('0x97')](_0x30bb2e,{'transaction':_0x3bfa7b});})[_0x6458('0x29')](function(){return db[_0x6458('0x69')][_0x6458('0x6e')]({'where':{'teamId':_0x505c4a}})[_0x6458('0x29')](function(_0x1e671c){if(_0x1e671c){var _0x1d9516=_[_0x6458('0x2d')](_0x30bb2e,function(_0x6bda1f){db[_0x6458('0x6a')]['destroy']({'where':{'UserId':_0x6bda1f,'VoicePrefixId':_0x1e671c[_0x6458('0x6b')]}});});return Promise[_0x6458('0x95')](_0x1d9516);}});});});}})[_0x6458('0x29')](respondWithStatusCode(_0x4a5bf7,null))[_0x6458('0x42')](handleError(_0x4a5bf7,null));};exports[_0x6458('0x99')]=function(_0x2cf6ce,_0x443aad,_0x3327f5){var _0x5a642f={};var _0x17db18={};var _0x226cd9;var _0x2f433a;return db['Team'][_0x6458('0x6e')]({'where':{'id':_0x2cf6ce[_0x6458('0x6f')]['id']}})[_0x6458('0x29')](handleEntityNotFound(_0x443aad,null))[_0x6458('0x29')](function(_0x9b06b8){if(_0x9b06b8){_0x226cd9=_0x9b06b8;_0x17db18['model']=_[_0x6458('0x44')](db[_0x6458('0x8a')]['rawAttributes']);_0x17db18['query']=_[_0x6458('0x44')](_0x2cf6ce[_0x6458('0x31')]);_0x17db18[_0x6458('0x32')]=_[_0x6458('0x34')](_0x17db18[_0x6458('0x30')],_0x17db18[_0x6458('0x31')]);_0x5a642f[_0x6458('0x33')]=_[_0x6458('0x34')](_0x17db18[_0x6458('0x30')],qs[_0x6458('0x35')](_0x2cf6ce[_0x6458('0x31')][_0x6458('0x35')]));_0x5a642f[_0x6458('0x33')]=_0x5a642f['attributes']['length']?_0x5a642f[_0x6458('0x33')]:_0x17db18[_0x6458('0x30')];_0x5a642f['order']=qs[_0x6458('0x38')](_0x2cf6ce['query']['sort']);_0x5a642f['where']=qs[_0x6458('0x32')](_[_0x6458('0x9a')](_0x2cf6ce[_0x6458('0x31')],_0x17db18[_0x6458('0x32')]));if(_0x2cf6ce[_0x6458('0x31')][_0x6458('0x3a')]){_0x5a642f['where']=_[_0x6458('0x3b')](_0x5a642f['where'],{'$or':_['map'](_0x5a642f[_0x6458('0x33')],function(_0x3745e0){var _0x54aabf={};_0x54aabf[_0x3745e0]={'$like':'%'+_0x2cf6ce['query']['filter']+'%'};return _0x54aabf;})});}_0x5a642f=_[_0x6458('0x3b')]({},_0x5a642f,_0x2cf6ce[_0x6458('0x3d')]);return _0x226cd9[_0x6458('0x99')](_0x5a642f);}})[_0x6458('0x29')](function(_0x5b5162){if(_0x5b5162){_0x2f433a=_0x5b5162[_0x6458('0x9b')];if(!_0x2cf6ce['query'][_0x6458('0x36')](_0x6458('0x37'))){_0x5a642f[_0x6458('0x22')]=qs[_0x6458('0x22')](_0x2cf6ce[_0x6458('0x31')][_0x6458('0x22')]);_0x5a642f[_0x6458('0x1f')]=qs['offset'](_0x2cf6ce[_0x6458('0x31')][_0x6458('0x1f')]);}return _0x226cd9[_0x6458('0x99')](_0x5a642f);}})[_0x6458('0x29')](function(_0x2a3f74){if(_0x2a3f74){return _0x2a3f74?{'count':_0x2f433a,'rows':_0x2a3f74}:null;}})[_0x6458('0x29')](respondWithResult(_0x443aad,null))[_0x6458('0x42')](handleError(_0x443aad,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 1744633..3f6497f 100644 --- a/server/api/team/team.events.js +++ b/server/api/team/team.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e73=['remove','hasOwnProperty','hook','events','Team'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6e73,0xd0));var _0x36e7=function(_0x239c82,_0x5a5749){_0x239c82=_0x239c82-0x0;var _0x2dc5c6=_0x6e73[_0x239c82];return _0x2dc5c6;};'use strict';var EventEmitter=require(_0x36e7('0x0'));var Team=require('../../mysqldb')['db'][_0x36e7('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x36e7('0x2')};function emitEvent(_0x30045c){return function(_0x1cf0da,_0x4da2f6,_0x231b49){TeamEvents['emit'](_0x30045c+':'+_0x1cf0da['id'],_0x1cf0da);TeamEvents['emit'](_0x30045c,_0x1cf0da);_0x231b49(null);};}for(var e in events){if(events[_0x36e7('0x3')](e)){var event=events[e];Team[_0x36e7('0x4')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x94c5=['events','../../mysqldb','Team','emit','hasOwnProperty','hook','exports'];(function(_0xf2d0e3,_0xe62461){var _0x215b41=function(_0x1e296a){while(--_0x1e296a){_0xf2d0e3['push'](_0xf2d0e3['shift']());}};_0x215b41(++_0xe62461);}(_0x94c5,0x7e));var _0x594c=function(_0x30c5ce,_0x3e3f7a){_0x30c5ce=_0x30c5ce-0x0;var _0x33cc16=_0x94c5[_0x30c5ce];return _0x33cc16;};'use strict';var EventEmitter=require(_0x594c('0x0'));var Team=require(_0x594c('0x1'))['db'][_0x594c('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5a5e60){return function(_0x2fe6e1,_0x4fca12,_0x1d4794){TeamEvents[_0x594c('0x3')](_0x5a5e60+':'+_0x2fe6e1['id'],_0x2fe6e1);TeamEvents[_0x594c('0x3')](_0x5a5e60,_0x2fe6e1);_0x1d4794(null);};}for(var e in events){if(events[_0x594c('0x4')](e)){var event=events[e];Team[_0x594c('0x5')](e,emitEvent(event));}}module[_0x594c('0x6')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 1d464ba..0203a54 100644 --- a/server/api/team/team.model.js +++ b/server/api/team/team.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda47=['Queues','then','map','setDataValue','channel','catch','Chat','Fax','Openchannel','Sms','Voice','Whatsapp','all','lodash','get'];(function(_0x5bef1e,_0x209bd4){var _0x5420a5=function(_0x119c92){while(--_0x119c92){_0x5bef1e['push'](_0x5bef1e['shift']());}};_0x5420a5(++_0x209bd4);}(_0xda47,0xa3));var _0x7da4=function(_0x515283,_0x813dea){_0x515283=_0x515283-0x0;var _0x38f836=_0xda47[_0x515283];return _0x38f836;};'use strict';var _=require(_0x7da4('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x121db6,_0x30fc53){var _0x183300=_0x7da4('0x1')+_0x30fc53+_0x7da4('0x2');return _0x121db6[_0x183300]()[_0x7da4('0x3')](function(_0x1f32b0){return _[_0x7da4('0x4')](_0x1f32b0,function(_0x1f640b){_0x1f640b[_0x7da4('0x5')](_0x7da4('0x6'),_0x30fc53);return _0x1f640b;});})[_0x7da4('0x7')](function(_0xa22b7d){throw _0xa22b7d;});}module['exports']=function(_0x321f95){return _0x321f95['define']('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x447ce4=this;var _0x5c0ce1=[_0x7da4('0x8'),_0x7da4('0x9'),'Mail',_0x7da4('0xa'),_0x7da4('0xb'),_0x7da4('0xc'),_0x7da4('0xd')];return Promise['resolve']()['then'](function(){var _0xadbd22=_[_0x7da4('0x4')](_0x5c0ce1,function(_0x3941c7){return getQueuesByChannel(_0x447ce4,_0x3941c7);});return Promise[_0x7da4('0xe')](_0xadbd22);})[_0x7da4('0x7')](function(_0x3a73ea){throw _0x3a73ea;});}}});}; \ No newline at end of file +var _0xeda8=['Chat','Fax','Mail','Openchannel','Sms','Voice','Whatsapp','resolve','then','all','lodash','./team.attributes','get','Queues','map','channel','catch','exports','define','Team','teams'];(function(_0x41d33b,_0x23aaf9){var _0x38ce98=function(_0x20f9b4){while(--_0x20f9b4){_0x41d33b['push'](_0x41d33b['shift']());}};_0x38ce98(++_0x23aaf9);}(_0xeda8,0x106));var _0x8eda=function(_0x3b2f52,_0x21ba7f){_0x3b2f52=_0x3b2f52-0x0;var _0x56b46e=_0xeda8[_0x3b2f52];return _0x56b46e;};'use strict';var _=require(_0x8eda('0x0'));var attributes=require(_0x8eda('0x1'));function getQueuesByChannel(_0x4f1986,_0x102ae5){var _0x4b334e=_0x8eda('0x2')+_0x102ae5+_0x8eda('0x3');return _0x4f1986[_0x4b334e]()['then'](function(_0x43c79c){return _[_0x8eda('0x4')](_0x43c79c,function(_0x2d2797){_0x2d2797['setDataValue'](_0x8eda('0x5'),_0x102ae5);return _0x2d2797;});})[_0x8eda('0x6')](function(_0x4be9ec){throw _0x4be9ec;});}module[_0x8eda('0x7')]=function(_0xf4fc75){return _0xf4fc75[_0x8eda('0x8')](_0x8eda('0x9'),attributes,{'tableName':_0x8eda('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x515259=this;var _0x47ddf5=[_0x8eda('0xb'),_0x8eda('0xc'),_0x8eda('0xd'),_0x8eda('0xe'),_0x8eda('0xf'),_0x8eda('0x10'),_0x8eda('0x11')];return Promise[_0x8eda('0x12')]()[_0x8eda('0x13')](function(){var _0x54f617=_[_0x8eda('0x4')](_0x47ddf5,function(_0x4d9460){return getQueuesByChannel(_0x515259,_0x4d9460);});return Promise[_0x8eda('0x14')](_0x54f617);})['catch'](function(_0x1b25d9){throw _0x1b25d9;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 3113d6b..fd247c7 100644 --- a/server/api/team/team.rpc.js +++ b/server/api/team/team.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd5d0=['./team.socket','register','request\x20sent','Team,\x20%s,\x20%s,\x20%s','error','code','Team,\x20%s,\x20%s','message','info','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter'];(function(_0x217c2e,_0x358f06){var _0x22b7d8=function(_0x111c48){while(--_0x111c48){_0x217c2e['push'](_0x217c2e['shift']());}};_0x22b7d8(++_0x358f06);}(_0xd5d0,0x153));var _0x0d5d=function(_0x5b2bb8,_0xcd9faa){_0x5b2bb8=_0x5b2bb8-0x0;var _0x3d402c=_0xd5d0[_0x5b2bb8];return _0x3d402c;};'use strict';var _=require(_0x0d5d('0x0'));var util=require('util');var moment=require(_0x0d5d('0x1'));var BPromise=require(_0x0d5d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d5d('0x3'));var db=require(_0x0d5d('0x4'))['db'];var utils=require(_0x0d5d('0x5'));var logger=require('../../config/logger')(_0x0d5d('0x6'));var config=require(_0x0d5d('0x7'));var jayson=require(_0x0d5d('0x8'));var client=jayson['client'][_0x0d5d('0x9')]({'port':0x232a});config[_0x0d5d('0xa')]=_['defaults'](config[_0x0d5d('0xa')],{'host':_0x0d5d('0xb'),'port':0x18eb});var socket=require(_0x0d5d('0xc'))(new Redis(config['redis']));require(_0x0d5d('0xd'))[_0x0d5d('0xe')](socket);function respondWithRpcPromise(_0x227db4,_0x55de40,_0x3d23d9){return new BPromise(function(_0x239e36,_0xbab54f){return client['request'](_0x227db4,_0x3d23d9)['then'](function(_0x5e9bb3){logger['info']('Team,\x20%s,\x20%s',_0x55de40,_0x0d5d('0xf'));logger['debug'](_0x0d5d('0x10'),_0x55de40,_0x0d5d('0xf'),JSON['stringify'](_0x5e9bb3));if(_0x5e9bb3[_0x0d5d('0x11')]){if(_0x5e9bb3[_0x0d5d('0x11')][_0x0d5d('0x12')]===0x1f4){logger['error'](_0x0d5d('0x13'),_0x55de40,_0x5e9bb3[_0x0d5d('0x11')][_0x0d5d('0x14')]);return _0xbab54f(_0x5e9bb3[_0x0d5d('0x11')]['message']);}logger[_0x0d5d('0x11')](_0x0d5d('0x13'),_0x55de40,_0x5e9bb3[_0x0d5d('0x11')][_0x0d5d('0x14')]);return _0x239e36(_0x5e9bb3[_0x0d5d('0x11')][_0x0d5d('0x14')]);}else{logger[_0x0d5d('0x15')]('Team,\x20%s,\x20%s',_0x55de40,_0x0d5d('0xf'));_0x239e36(_0x5e9bb3['result']['message']);}})['catch'](function(_0x2e22b5){logger['error'](_0x0d5d('0x13'),_0x55de40,_0x2e22b5);_0xbab54f(_0x2e22b5);});});} \ No newline at end of file +var _0xa6f9=['redis','defaults','localhost','socket.io-emitter','./team.socket','register','info','request\x20sent','stringify','error','message','Team,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x383f90,_0x42edf5){var _0x101752=function(_0x2669c9){while(--_0x2669c9){_0x383f90['push'](_0x383f90['shift']());}};_0x101752(++_0x42edf5);}(_0xa6f9,0x1e9));var _0x9a6f=function(_0x1b3711,_0x3493bc){_0x1b3711=_0x1b3711-0x0;var _0x516e51=_0xa6f9[_0x1b3711];return _0x516e51;};'use strict';var _=require(_0x9a6f('0x0'));var util=require('util');var moment=require(_0x9a6f('0x1'));var BPromise=require(_0x9a6f('0x2'));var rs=require(_0x9a6f('0x3'));var fs=require('fs');var Redis=require(_0x9a6f('0x4'));var db=require(_0x9a6f('0x5'))['db'];var utils=require(_0x9a6f('0x6'));var logger=require(_0x9a6f('0x7'))('rpc');var config=require(_0x9a6f('0x8'));var jayson=require(_0x9a6f('0x9'));var client=jayson[_0x9a6f('0xa')]['http']({'port':0x232a});config[_0x9a6f('0xb')]=_[_0x9a6f('0xc')](config[_0x9a6f('0xb')],{'host':_0x9a6f('0xd'),'port':0x18eb});var socket=require(_0x9a6f('0xe'))(new Redis(config[_0x9a6f('0xb')]));require(_0x9a6f('0xf'))[_0x9a6f('0x10')](socket);function respondWithRpcPromise(_0x14fe10,_0x4e749f,_0x515409){return new BPromise(function(_0x391d46,_0x45e76b){return client['request'](_0x14fe10,_0x515409)['then'](function(_0x58bab8){logger[_0x9a6f('0x11')]('Team,\x20%s,\x20%s',_0x4e749f,_0x9a6f('0x12'));logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x4e749f,'request\x20sent',JSON[_0x9a6f('0x13')](_0x58bab8));if(_0x58bab8[_0x9a6f('0x14')]){if(_0x58bab8['error']['code']===0x1f4){logger[_0x9a6f('0x14')]('Team,\x20%s,\x20%s',_0x4e749f,_0x58bab8[_0x9a6f('0x14')][_0x9a6f('0x15')]);return _0x45e76b(_0x58bab8[_0x9a6f('0x14')]['message']);}logger[_0x9a6f('0x14')](_0x9a6f('0x16'),_0x4e749f,_0x58bab8[_0x9a6f('0x14')][_0x9a6f('0x15')]);return _0x391d46(_0x58bab8[_0x9a6f('0x14')][_0x9a6f('0x15')]);}else{logger[_0x9a6f('0x11')]('Team,\x20%s,\x20%s',_0x4e749f,_0x9a6f('0x12'));_0x391d46(_0x58bab8[_0x9a6f('0x17')][_0x9a6f('0x15')]);}})[_0x9a6f('0x18')](function(_0x5541ab){logger[_0x9a6f('0x14')](_0x9a6f('0x16'),_0x4e749f,_0x5541ab);_0x45e76b(_0x5541ab);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 7f736bf..8cf2363 100644 --- a/server/api/team/team.socket.js +++ b/server/api/team/team.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda54=['team:','./team.events','save','remove','update','length'];(function(_0x1269c6,_0x1c8942){var _0x4868c7=function(_0x1661bc){while(--_0x1661bc){_0x1269c6['push'](_0x1269c6['shift']());}};_0x4868c7(++_0x1c8942);}(_0xda54,0xa3));var _0x4da5=function(_0x45c48f,_0x4aa891){_0x45c48f=_0x45c48f-0x0;var _0xaf5037=_0xda54[_0x45c48f];return _0xaf5037;};'use strict';var TeamEvents=require(_0x4da5('0x0'));var events=[_0x4da5('0x1'),_0x4da5('0x2'),_0x4da5('0x3')];function createListener(_0x4da958,_0x4efc2e){return function(_0x272671){_0x4efc2e['emit'](_0x4da958,_0x272671);};}function removeListener(_0x1ad3ac,_0x494c73){return function(){TeamEvents['removeListener'](_0x1ad3ac,_0x494c73);};}exports['register']=function(_0x419789){for(var _0x5bbbcb=0x0,_0x411ab8=events[_0x4da5('0x4')];_0x5bbbcb<_0x411ab8;_0x5bbbcb++){var _0x57d34c=events[_0x5bbbcb];var _0x3246de=createListener(_0x4da5('0x5')+_0x57d34c,_0x419789);TeamEvents['on'](_0x57d34c,_0x3246de);}}; \ No newline at end of file +var _0x945d=['length','team:','./team.events','save','update','emit','removeListener','register'];(function(_0xc5605,_0x2a6be6){var _0x8f3a49=function(_0x690206){while(--_0x690206){_0xc5605['push'](_0xc5605['shift']());}};_0x8f3a49(++_0x2a6be6);}(_0x945d,0xe2));var _0xd945=function(_0x45e815,_0x6ef037){_0x45e815=_0x45e815-0x0;var _0x3b82cc=_0x945d[_0x45e815];return _0x3b82cc;};'use strict';var TeamEvents=require(_0xd945('0x0'));var events=[_0xd945('0x1'),'remove',_0xd945('0x2')];function createListener(_0x48a906,_0x5af0bc){return function(_0x4c37d4){_0x5af0bc[_0xd945('0x3')](_0x48a906,_0x4c37d4);};}function removeListener(_0x1fe0d7,_0x3e19c1){return function(){TeamEvents[_0xd945('0x4')](_0x1fe0d7,_0x3e19c1);};}exports[_0xd945('0x5')]=function(_0x1a062b){for(var _0x576a58=0x0,_0x520a7c=events[_0xd945('0x6')];_0x576a58<_0x520a7c;_0x576a58++){var _0x4a4763=events[_0x576a58];var _0xb9ffca=createListener(_0xd945('0x7')+_0x4a4763,_0x1a062b);TeamEvents['on'](_0x4a4763,_0xb9ffca);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 8937fd3..604c03a 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe644=['sequelize','exports','INTEGER'];(function(_0x468fc4,_0x501001){var _0x3704ba=function(_0x2e1966){while(--_0x2e1966){_0x468fc4['push'](_0x468fc4['shift']());}};_0x3704ba(++_0x501001);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4e64('0x0'));module[_0x4e64('0x1')]={'TeamId':{'type':Sequelize[_0x4e64('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x4e64('0x2')]}}; \ No newline at end of file +var _0x5699=['INTEGER','sequelize','exports'];(function(_0x2068ee,_0x42966a){var _0xa36814=function(_0x35dba2){while(--_0x35dba2){_0x2068ee['push'](_0x2068ee['shift']());}};_0xa36814(++_0x42966a);}(_0x5699,0xaf));var _0x9569=function(_0x58ce85,_0x3b877c){_0x58ce85=_0x58ce85-0x0;var _0x236bd0=_0x5699[_0x58ce85];return _0x236bd0;};'use strict';var Sequelize=require(_0x9569('0x0'));module[_0x9569('0x1')]={'TeamId':{'type':Sequelize[_0x9569('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 66d0f3a..c673a05 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.model.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e22=['moment','bluebird','request-promise','../../config/environment','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes','util','api'];(function(_0x17c7c5,_0x9fd9c8){var _0xb2dd19=function(_0x4887b2){while(--_0x4887b2){_0x17c7c5['push'](_0x17c7c5['shift']());}};_0xb2dd19(++_0x9fd9c8);}(_0x3e22,0xa8));var _0x23e2=function(_0x12a2a6,_0x374ff1){_0x12a2a6=_0x12a2a6-0x0;var _0x1754ae=_0x3e22[_0x12a2a6];return _0x1754ae;};'use strict';var _=require('lodash');var util=require(_0x23e2('0x0'));var logger=require('../../config/logger')(_0x23e2('0x1'));var moment=require(_0x23e2('0x2'));var BPromise=require(_0x23e2('0x3'));var rp=require(_0x23e2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x23e2('0x5'));var attributes=require(_0x23e2('0x6'));module['exports']=function(_0x287f8f,_0x433a85){return _0x287f8f[_0x23e2('0x7')](_0x23e2('0x8'),attributes,{'tableName':_0x23e2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['define','team_has_voice_prefixes','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x757a,0xde));var _0xa757=function(_0x88cc4,_0x1a4ef8){_0x88cc4=_0x88cc4-0x0;var _0x31cc44=_0x757a[_0x88cc4];return _0x31cc44;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('TeamVoicePrefix',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index c217034..69937d7 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3b8eb6,_0xe23a2f){var _0x14afec=function(_0x45b634){while(--_0x45b634){_0x3b8eb6['push'](_0x3b8eb6['shift']());}};_0x14afec(++_0xe23a2f);}(_0xe706,0xa3));var _0x6e70=function(_0x3e2435,_0xc531a1){_0x3e2435=_0x3e2435-0x0;var _0x5d49e7=_0xe706[_0x3e2435];return _0x5d49e7;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2bb19f,_0x380199){var _0x1f8cf7=function(_0x333c9e){while(--_0x333c9e){_0x2bb19f['push'](_0x2bb19f['shift']());}};_0x1f8cf7(++_0x380199);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 9bb271a..9006424 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7cd7=['exports','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7cd7,0xdd));var _0x77cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cd7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x77cd('0x0'));module[_0x77cd('0x1')]={'penalty':{'type':Sequelize[_0x77cd('0x2')],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index bb828fb..51790fe 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.model.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdeb7=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','lodash'];(function(_0x151567,_0x490047){var _0x1245fb=function(_0x9a3cbf){while(--_0x9a3cbf){_0x151567['push'](_0x151567['shift']());}};_0x1245fb(++_0x490047);}(_0xdeb7,0x77));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x7deb('0x0'));var util=require(_0x7deb('0x1'));var logger=require(_0x7deb('0x2'))('api');var moment=require(_0x7deb('0x3'));var BPromise=require(_0x7deb('0x4'));var rp=require(_0x7deb('0x5'));var fs=require('fs');var path=require(_0x7deb('0x6'));var rimraf=require(_0x7deb('0x7'));var config=require('../../config/environment');var attributes=require(_0x7deb('0x8'));module[_0x7deb('0x9')]=function(_0x9283e7,_0x46e08e){return _0x9283e7[_0x7deb('0xa')](_0x7deb('0xb'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7b4=['bluebird','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','moment'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xa7b4,0x8d));var _0x4a7b=function(_0x2a607c,_0x2c0ede){_0x2a607c=_0x2a607c-0x0;var _0x46f19a=_0xa7b4[_0x2a607c];return _0x46f19a;};'use strict';var _=require('lodash');var util=require(_0x4a7b('0x0'));var logger=require(_0x4a7b('0x1'))('api');var moment=require(_0x4a7b('0x2'));var BPromise=require(_0x4a7b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4a7b('0x4'));var attributes=require(_0x4a7b('0x5'));module['exports']=function(_0x27e783,_0xf43e24){return _0x27e783[_0x4a7b('0x6')](_0x4a7b('0x7'),attributes,{'tableName':_0x4a7b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 9f0fb7e..32742ea 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x599f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x5c559a,_0x51274c){var _0x399ffb=function(_0x537e4c){while(--_0x537e4c){_0x5c559a['push'](_0x5c559a['shift']());}};_0x399ffb(++_0x51274c);}(_0x599f,0x74));var _0xf599=function(_0x12fdbe,_0x204796){_0x12fdbe=_0x12fdbe-0x0;var _0x38a758=_0x599f[_0x12fdbe];return _0x38a758;};'use strict';var _=require(_0xf599('0x0'));var util=require(_0xf599('0x1'));var moment=require(_0xf599('0x2'));var BPromise=require(_0xf599('0x3'));var rs=require(_0xf599('0x4'));var fs=require('fs');var Redis=require(_0xf599('0x5'));var db=require(_0xf599('0x6'))['db'];var utils=require(_0xf599('0x7'));var logger=require(_0xf599('0x8'))(_0xf599('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf599('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b8cb1,_0x151d22,_0x45f97e){return new BPromise(function(_0x3c49e9,_0xf79222){return client[_0xf599('0xb')](_0x4b8cb1,_0x45f97e)[_0xf599('0xc')](function(_0x116bb9){logger[_0xf599('0xd')](_0xf599('0xe'),_0x151d22,'request\x20sent');logger[_0xf599('0xf')](_0xf599('0x10'),_0x151d22,_0xf599('0x11'),JSON[_0xf599('0x12')](_0x116bb9));if(_0x116bb9[_0xf599('0x13')]){if(_0x116bb9[_0xf599('0x13')][_0xf599('0x14')]===0x1f4){logger['error'](_0xf599('0xe'),_0x151d22,_0x116bb9['error']['message']);return _0xf79222(_0x116bb9['error']['message']);}logger[_0xf599('0x13')](_0xf599('0xe'),_0x151d22,_0x116bb9[_0xf599('0x13')]['message']);return _0x3c49e9(_0x116bb9['error'][_0xf599('0x15')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x151d22,_0xf599('0x11'));_0x3c49e9(_0x116bb9[_0xf599('0x16')]['message']);}})[_0xf599('0x17')](function(_0x17e544){logger[_0xf599('0x13')](_0xf599('0xe'),_0x151d22,_0x17e544);_0xf79222(_0x17e544);});});} \ No newline at end of file +var _0x9df6=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','request\x20sent','debug','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x9df6,0x1ca));var _0x69df=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x9df6[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0x69df('0x0'));var util=require(_0x69df('0x1'));var moment=require(_0x69df('0x2'));var BPromise=require(_0x69df('0x3'));var rs=require(_0x69df('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69df('0x5'))['db'];var utils=require(_0x69df('0x6'));var logger=require(_0x69df('0x7'))('rpc');var config=require(_0x69df('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x69df('0x9')][_0x69df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22b91d,_0x2d6035,_0x2ab3fa){return new BPromise(function(_0x153a9f,_0x5db5e5){return client['request'](_0x22b91d,_0x2ab3fa)[_0x69df('0xb')](function(_0x3f070d){logger[_0x69df('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2d6035,_0x69df('0xd'));logger[_0x69df('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2d6035,'request\x20sent',JSON['stringify'](_0x3f070d));if(_0x3f070d['error']){if(_0x3f070d[_0x69df('0xf')][_0x69df('0x10')]===0x1f4){logger[_0x69df('0xf')](_0x69df('0x11'),_0x2d6035,_0x3f070d[_0x69df('0xf')][_0x69df('0x12')]);return _0x5db5e5(_0x3f070d['error'][_0x69df('0x12')]);}logger['error'](_0x69df('0x11'),_0x2d6035,_0x3f070d[_0x69df('0xf')][_0x69df('0x12')]);return _0x153a9f(_0x3f070d[_0x69df('0xf')]['message']);}else{logger[_0x69df('0xc')](_0x69df('0x11'),_0x2d6035,_0x69df('0xd'));_0x153a9f(_0x3f070d['result'][_0x69df('0x12')]);}})[_0x69df('0x13')](function(_0x5b8500){logger[_0x69df('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2d6035,_0x5b8500);_0x5db5e5(_0x5b8500);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 6b8059b..3e24667 100644 --- a/server/api/template/index.js +++ b/server/api/template/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb511=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x4ad0e9,_0xbdf2ad){var _0x3290f8=function(_0x540961){while(--_0x540961){_0x4ad0e9['push'](_0x4ad0e9['shift']());}};_0x3290f8(++_0xbdf2ad);}(_0xb511,0x165));var _0x1b51=function(_0x23fea8,_0xb391da){_0x23fea8=_0x23fea8-0x0;var _0x2ed35e=_0xb511[_0x23fea8];return _0x2ed35e;};'use strict';var multer=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var path=require(_0x1b51('0x2'));var timeout=require('connect-timeout');var express=require(_0x1b51('0x3'));var router=express[_0x1b51('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1b51('0x5'));var interaction=require(_0x1b51('0x6'));var config=require(_0x1b51('0x7'));var controller=require('./template.controller');router[_0x1b51('0x8')]('/',auth[_0x1b51('0x9')](),controller['index']);router[_0x1b51('0x8')](_0x1b51('0xa'),auth['isAuthenticated'](),controller[_0x1b51('0xb')]);router[_0x1b51('0xc')]('/',auth[_0x1b51('0x9')](),controller[_0x1b51('0xd')]);router[_0x1b51('0xe')](_0x1b51('0xa'),auth[_0x1b51('0x9')](),controller[_0x1b51('0xf')]);router['delete'](_0x1b51('0xa'),auth[_0x1b51('0x9')](),controller[_0x1b51('0x10')]);module[_0x1b51('0x11')]=router; \ No newline at end of file +var _0x8b52=['../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','path','express','Router'];(function(_0x590985,_0x3a1e02){var _0x2d8d61=function(_0x406e48){while(--_0x406e48){_0x590985['push'](_0x590985['shift']());}};_0x2d8d61(++_0x3a1e02);}(_0x8b52,0x151));var _0x28b5=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x8b52[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0x28b5('0x0'));var util=require(_0x28b5('0x1'));var path=require(_0x28b5('0x2'));var timeout=require('connect-timeout');var express=require(_0x28b5('0x3'));var router=express[_0x28b5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x28b5('0x5'));var interaction=require(_0x28b5('0x6'));var config=require(_0x28b5('0x7'));var controller=require(_0x28b5('0x8'));router[_0x28b5('0x9')]('/',auth[_0x28b5('0xa')](),controller[_0x28b5('0xb')]);router[_0x28b5('0x9')](_0x28b5('0xc'),auth['isAuthenticated'](),controller[_0x28b5('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x28b5('0xe')]);router[_0x28b5('0xf')]('/:id',auth[_0x28b5('0xa')](),controller[_0x28b5('0x10')]);router['delete'](_0x28b5('0xc'),auth[_0x28b5('0xa')](),controller[_0x28b5('0x11')]);module[_0x28b5('0x12')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 873c819..ce62a7d 100644 --- a/server/api/template/template.attributes.js +++ b/server/api/template/template.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ad7=['STRING','TEXT','sequelize','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4ad7,0x7a));var _0x74ad=function(_0x47aa2e,_0x4fd893){_0x47aa2e=_0x47aa2e-0x0;var _0x4ec027=_0x4ad7[_0x47aa2e];return _0x4ec027;};'use strict';var Sequelize=require(_0x74ad('0x0'));module[_0x74ad('0x1')]={'name':{'type':Sequelize[_0x74ad('0x2')]},'description':{'type':Sequelize[_0x74ad('0x2')]},'html':{'type':Sequelize[_0x74ad('0x3')]}}; \ No newline at end of file +var _0xde3d=['TEXT','sequelize','exports','STRING'];(function(_0x2a99dd,_0x228918){var _0x154fe0=function(_0x442464){while(--_0x442464){_0x2a99dd['push'](_0x2a99dd['shift']());}};_0x154fe0(++_0x228918);}(_0xde3d,0x185));var _0xdde3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xde3d[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xdde3('0x0'));module[_0xdde3('0x1')]={'name':{'type':Sequelize[_0xdde3('0x2')]},'description':{'type':Sequelize[_0xdde3('0x2')]},'html':{'type':Sequelize[_0xdde3('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 3cc876b..9a0bbe1 100644 --- a/server/api/template/template.controller.js +++ b/server/api/template/template.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd728=['type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','Templates','UserProfileResource','stack','name','send','index','Template','rawAttributes','fieldName'];(function(_0x26c2cf,_0x4d0f85){var _0x2dc186=function(_0x55ecd2){while(--_0x55ecd2){_0x26c2cf['push'](_0x26c2cf['shift']());}};_0x2dc186(++_0x4d0f85);}(_0xd728,0x12b));var _0x8d72=function(_0xb28ca0,_0x43ef4e){_0xb28ca0=_0xb28ca0-0x0;var _0x3a517d=_0xd728[_0xb28ca0];return _0x3a517d;};'use strict';var emlformat=require(_0x8d72('0x0'));var rimraf=require(_0x8d72('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8d72('0x2'));var moment=require(_0x8d72('0x3'));var BPromise=require(_0x8d72('0x4'));var Mustache=require(_0x8d72('0x5'));var util=require(_0x8d72('0x6'));var path=require(_0x8d72('0x7'));var sox=require(_0x8d72('0x8'));var csv=require(_0x8d72('0x9'));var ejs=require(_0x8d72('0xa'));var fs=require('fs');var fs_extra=require(_0x8d72('0xb'));var _=require(_0x8d72('0xc'));var squel=require(_0x8d72('0xd'));var crypto=require(_0x8d72('0xe'));var jsforce=require(_0x8d72('0xf'));var deskjs=require(_0x8d72('0x10'));var toCsv=require(_0x8d72('0x9'));var querystring=require('querystring');var Papa=require(_0x8d72('0x11'));var Redis=require(_0x8d72('0x12'));var authService=require(_0x8d72('0x13'));var qs=require(_0x8d72('0x14'));var as=require(_0x8d72('0x15'));var hardwareService=require(_0x8d72('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x8d72('0x17'));var config=require(_0x8d72('0x18'));var licenseUtil=require(_0x8d72('0x19'));var db=require(_0x8d72('0x1a'))['db'];function respondWithStatusCode(_0x48db78,_0xda2c42){_0xda2c42=_0xda2c42||0xcc;return function(_0x1fe68d){if(_0x1fe68d){return _0x48db78[_0x8d72('0x1b')](_0xda2c42);}return _0x48db78[_0x8d72('0x1c')](_0xda2c42)[_0x8d72('0x1d')]();};}function respondWithResult(_0x578f07,_0x47ae8f){_0x47ae8f=_0x47ae8f||0xc8;return function(_0x50d10a){if(_0x50d10a){return _0x578f07[_0x8d72('0x1c')](_0x47ae8f)[_0x8d72('0x1e')](_0x50d10a);}};}function respondWithFilteredResult(_0x5bb92d,_0x20d412){return function(_0x2409c0){if(_0x2409c0){var _0x48cf54=typeof _0x20d412[_0x8d72('0x1f')]===_0x8d72('0x20')&&typeof _0x20d412['limit']===_0x8d72('0x20');var _0x321ff3=_0x2409c0[_0x8d72('0x21')];var _0xe1113b=_0x48cf54?0x0:_0x20d412[_0x8d72('0x1f')];var _0x5b62d1=_0x48cf54?_0x2409c0['count']:_0x20d412['offset']+_0x20d412[_0x8d72('0x22')];var _0x4f15b3;if(_0x5b62d1>=_0x321ff3){_0x5b62d1=_0x321ff3;_0x4f15b3=0xc8;}else{_0x4f15b3=0xce;}_0x5bb92d['status'](_0x4f15b3);return _0x5bb92d[_0x8d72('0x23')](_0x8d72('0x24'),_0xe1113b+'-'+_0x5b62d1+'/'+_0x321ff3)['json'](_0x2409c0);}return null;};}function patchUpdates(_0x1bd539){return function(_0x589984){try{jsonpatch[_0x8d72('0x25')](_0x589984,_0x1bd539,!![]);}catch(_0x499492){return BPromise[_0x8d72('0x26')](_0x499492);}return _0x589984[_0x8d72('0x27')]();};}function saveUpdates(_0x1b0075,_0x1be60e){return function(_0xaa4bbf){if(_0xaa4bbf){return _0xaa4bbf[_0x8d72('0x28')](_0x1b0075)['then'](function(_0x590ee7){return _0x590ee7;});}return null;};}function removeEntity(_0x26578f,_0x356684){return function(_0x3ef0a8){if(_0x3ef0a8){return _0x3ef0a8[_0x8d72('0x29')]()[_0x8d72('0x2a')](function(){var _0x5affce=_0x3ef0a8[_0x8d72('0x2b')]({'plain':!![]});var _0x5f562e=_0x8d72('0x2c');return db[_0x8d72('0x2d')][_0x8d72('0x29')]({'where':{'type':_0x5f562e,'resourceId':_0x5affce['id']}})['then'](function(){return _0x3ef0a8;});})[_0x8d72('0x2a')](function(){_0x26578f['status'](0xcc)[_0x8d72('0x1d')]();});}};}function handleEntityNotFound(_0x489d5d,_0xc8c164){return function(_0x4a9fe2){if(!_0x4a9fe2){_0x489d5d[_0x8d72('0x1b')](0x194);}return _0x4a9fe2;};}function handleError(_0x5a7c40,_0x5d3754){_0x5d3754=_0x5d3754||0x1f4;return function(_0x4c8592){logger['error'](_0x4c8592[_0x8d72('0x2e')]);if(_0x4c8592['name']){delete _0x4c8592[_0x8d72('0x2f')];}_0x5a7c40['status'](_0x5d3754)[_0x8d72('0x30')](_0x4c8592);};}exports[_0x8d72('0x31')]=function(_0x1ea2df,_0x513377){var _0x221fc1={},_0x4444dc={},_0x198c54={'count':0x0,'rows':[]};var _0x3541a0=_['map'](db[_0x8d72('0x32')][_0x8d72('0x33')],function(_0x295e79){return{'name':_0x295e79[_0x8d72('0x34')],'type':_0x295e79[_0x8d72('0x35')][_0x8d72('0x36')]};});_0x4444dc[_0x8d72('0x37')]=_[_0x8d72('0x38')](_0x3541a0,_0x8d72('0x2f'));_0x4444dc[_0x8d72('0x39')]=_[_0x8d72('0x3a')](_0x1ea2df[_0x8d72('0x39')]);_0x4444dc[_0x8d72('0x3b')]=_[_0x8d72('0x3c')](_0x4444dc['model'],_0x4444dc[_0x8d72('0x39')]);_0x221fc1['attributes']=_[_0x8d72('0x3c')](_0x4444dc[_0x8d72('0x37')],qs[_0x8d72('0x3d')](_0x1ea2df['query'][_0x8d72('0x3d')]));_0x221fc1[_0x8d72('0x3e')]=_0x221fc1[_0x8d72('0x3e')][_0x8d72('0x3f')]?_0x221fc1[_0x8d72('0x3e')]:_0x4444dc[_0x8d72('0x37')];if(!_0x1ea2df[_0x8d72('0x39')][_0x8d72('0x40')](_0x8d72('0x41'))){_0x221fc1[_0x8d72('0x22')]=qs[_0x8d72('0x22')](_0x1ea2df[_0x8d72('0x39')][_0x8d72('0x22')]);_0x221fc1[_0x8d72('0x1f')]=qs[_0x8d72('0x1f')](_0x1ea2df[_0x8d72('0x39')][_0x8d72('0x1f')]);}_0x221fc1['order']=qs[_0x8d72('0x42')](_0x1ea2df[_0x8d72('0x39')]['sort']);_0x221fc1[_0x8d72('0x43')]=qs['filters'](_[_0x8d72('0x44')](_0x1ea2df[_0x8d72('0x39')],_0x4444dc[_0x8d72('0x3b')]),_0x3541a0);if(_0x1ea2df['query'][_0x8d72('0x45')]){_0x221fc1[_0x8d72('0x43')]=_[_0x8d72('0x46')](_0x221fc1[_0x8d72('0x43')],{'$or':_[_0x8d72('0x38')](_0x3541a0,function(_0x48b1bd){if(_0x48b1bd['type']!==_0x8d72('0x47')){var _0x5cdb8b={};_0x5cdb8b[_0x48b1bd['name']]={'$like':'%'+_0x1ea2df[_0x8d72('0x39')][_0x8d72('0x45')]+'%'};return _0x5cdb8b;}})});}_0x221fc1=_['merge']({},_0x221fc1,_0x1ea2df[_0x8d72('0x48')]);var _0x14fbb7={'where':_0x221fc1['where']};return db[_0x8d72('0x32')][_0x8d72('0x21')](_0x14fbb7)[_0x8d72('0x2a')](function(_0x518608){_0x198c54[_0x8d72('0x21')]=_0x518608;if(_0x1ea2df[_0x8d72('0x39')][_0x8d72('0x49')]){_0x221fc1['include']=[{'all':!![]}];}return db[_0x8d72('0x32')]['findAll'](_0x221fc1);})[_0x8d72('0x2a')](function(_0x248e0a){_0x198c54[_0x8d72('0x4a')]=_0x248e0a;return _0x198c54;})[_0x8d72('0x2a')](respondWithFilteredResult(_0x513377,_0x221fc1))['catch'](handleError(_0x513377,null));};exports[_0x8d72('0x4b')]=function(_0x22fe2a,_0x23f30e){var _0x43aa02={'raw':!![],'where':{'id':_0x22fe2a[_0x8d72('0x4c')]['id']}},_0x74d7b9={};_0x74d7b9[_0x8d72('0x37')]=_[_0x8d72('0x3a')](db[_0x8d72('0x32')][_0x8d72('0x33')]);_0x74d7b9['query']=_[_0x8d72('0x3a')](_0x22fe2a[_0x8d72('0x39')]);_0x74d7b9[_0x8d72('0x3b')]=_['intersection'](_0x74d7b9[_0x8d72('0x37')],_0x74d7b9[_0x8d72('0x39')]);_0x43aa02[_0x8d72('0x3e')]=_[_0x8d72('0x3c')](_0x74d7b9[_0x8d72('0x37')],qs['fields'](_0x22fe2a['query'][_0x8d72('0x3d')]));_0x43aa02[_0x8d72('0x3e')]=_0x43aa02[_0x8d72('0x3e')][_0x8d72('0x3f')]?_0x43aa02[_0x8d72('0x3e')]:_0x74d7b9[_0x8d72('0x37')];if(_0x22fe2a[_0x8d72('0x39')][_0x8d72('0x49')]){_0x43aa02['include']=[{'all':!![]}];}_0x43aa02=_[_0x8d72('0x46')]({},_0x43aa02,_0x22fe2a[_0x8d72('0x48')]);return db[_0x8d72('0x32')][_0x8d72('0x4d')](_0x43aa02)['then'](handleEntityNotFound(_0x23f30e,null))[_0x8d72('0x2a')](respondWithResult(_0x23f30e,null))[_0x8d72('0x4e')](handleError(_0x23f30e,null));};exports[_0x8d72('0x4f')]=function(_0x4f76ba,_0x548949){return db[_0x8d72('0x32')][_0x8d72('0x4f')](_0x4f76ba['body'],{})[_0x8d72('0x2a')](function(_0x27dbf2){var _0x28fb63=_0x4f76ba[_0x8d72('0x50')]['get']({'plain':!![]});if(!_0x28fb63)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28fb63[_0x8d72('0x51')]===_0x8d72('0x50')){var _0x35c299=_0x27dbf2[_0x8d72('0x2b')]({'plain':!![]});var _0x572f4f='Templates';return db[_0x8d72('0x52')][_0x8d72('0x4d')]({'where':{'name':_0x572f4f,'userProfileId':_0x28fb63[_0x8d72('0x53')]},'raw':!![]})['then'](function(_0xd130fa){if(_0xd130fa&&_0xd130fa[_0x8d72('0x54')]===0x0){return db[_0x8d72('0x2d')][_0x8d72('0x4f')]({'name':_0x35c299[_0x8d72('0x2f')],'resourceId':_0x35c299['id'],'type':_0xd130fa[_0x8d72('0x2f')],'sectionId':_0xd130fa['id']},{})['then'](function(){return _0x27dbf2;});}else{return _0x27dbf2;}})[_0x8d72('0x4e')](function(_0x401ff5){logger[_0x8d72('0x55')](_0x8d72('0x56'),_0x401ff5);throw _0x401ff5;});}return _0x27dbf2;})[_0x8d72('0x2a')](respondWithResult(_0x548949,0xc9))[_0x8d72('0x4e')](handleError(_0x548949,null));};exports[_0x8d72('0x28')]=function(_0x46d6f8,_0xb8fb88){if(_0x46d6f8['body']['id']){delete _0x46d6f8[_0x8d72('0x57')]['id'];}return db[_0x8d72('0x32')][_0x8d72('0x4d')]({'where':{'id':_0x46d6f8[_0x8d72('0x4c')]['id']}})[_0x8d72('0x2a')](handleEntityNotFound(_0xb8fb88,null))['then'](saveUpdates(_0x46d6f8[_0x8d72('0x57')],null))[_0x8d72('0x2a')](respondWithResult(_0xb8fb88,null))[_0x8d72('0x4e')](handleError(_0xb8fb88,null));};exports[_0x8d72('0x29')]=function(_0x413ed9,_0x5724c9){return db['Template']['find']({'where':{'id':_0x413ed9[_0x8d72('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5724c9,null))[_0x8d72('0x2a')](removeEntity(_0x5724c9,null))[_0x8d72('0x4e')](handleError(_0x5724c9,null));}; \ No newline at end of file +var _0x4c0c=['moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','map','Template','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','include','findAll','rows','catch','show','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2c4729,_0x502940){var _0x5a6f14=function(_0x429681){while(--_0x429681){_0x2c4729['push'](_0x2c4729['shift']());}};_0x5a6f14(++_0x502940);}(_0x4c0c,0xfa));var _0xc4c0=function(_0x24930c,_0xf01ff1){_0x24930c=_0x24930c-0x0;var _0x3ff362=_0x4c0c[_0x24930c];return _0x3ff362;};'use strict';var emlformat=require(_0xc4c0('0x0'));var rimraf=require(_0xc4c0('0x1'));var zipdir=require(_0xc4c0('0x2'));var jsonpatch=require(_0xc4c0('0x3'));var rp=require(_0xc4c0('0x4'));var moment=require(_0xc4c0('0x5'));var BPromise=require(_0xc4c0('0x6'));var Mustache=require(_0xc4c0('0x7'));var util=require(_0xc4c0('0x8'));var path=require(_0xc4c0('0x9'));var sox=require(_0xc4c0('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc4c0('0xb'));var squel=require(_0xc4c0('0xc'));var crypto=require(_0xc4c0('0xd'));var jsforce=require(_0xc4c0('0xe'));var deskjs=require(_0xc4c0('0xf'));var toCsv=require(_0xc4c0('0x10'));var querystring=require(_0xc4c0('0x11'));var Papa=require(_0xc4c0('0x12'));var Redis=require('ioredis');var authService=require(_0xc4c0('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc4c0('0x14'));var hardwareService=require(_0xc4c0('0x15'));var logger=require('../../config/logger')(_0xc4c0('0x16'));var utils=require('../../config/utils');var config=require(_0xc4c0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc4c0('0x18'))['db'];function respondWithStatusCode(_0x160b6d,_0x2ca915){_0x2ca915=_0x2ca915||0xcc;return function(_0x39754d){if(_0x39754d){return _0x160b6d[_0xc4c0('0x19')](_0x2ca915);}return _0x160b6d['status'](_0x2ca915)[_0xc4c0('0x1a')]();};}function respondWithResult(_0x2c2599,_0x14ca68){_0x14ca68=_0x14ca68||0xc8;return function(_0x5b5987){if(_0x5b5987){return _0x2c2599[_0xc4c0('0x1b')](_0x14ca68)[_0xc4c0('0x1c')](_0x5b5987);}};}function respondWithFilteredResult(_0x38bfb7,_0x2c4652){return function(_0x4ca00b){if(_0x4ca00b){var _0x2f72e5=typeof _0x2c4652[_0xc4c0('0x1d')]===_0xc4c0('0x1e')&&typeof _0x2c4652[_0xc4c0('0x1f')]===_0xc4c0('0x1e');var _0x338de2=_0x4ca00b[_0xc4c0('0x20')];var _0xbdbe2c=_0x2f72e5?0x0:_0x2c4652['offset'];var _0x59af8c=_0x2f72e5?_0x4ca00b[_0xc4c0('0x20')]:_0x2c4652[_0xc4c0('0x1d')]+_0x2c4652[_0xc4c0('0x1f')];var _0x5b96d6;if(_0x59af8c>=_0x338de2){_0x59af8c=_0x338de2;_0x5b96d6=0xc8;}else{_0x5b96d6=0xce;}_0x38bfb7[_0xc4c0('0x1b')](_0x5b96d6);return _0x38bfb7[_0xc4c0('0x21')](_0xc4c0('0x22'),_0xbdbe2c+'-'+_0x59af8c+'/'+_0x338de2)[_0xc4c0('0x1c')](_0x4ca00b);}return null;};}function patchUpdates(_0x2c904e){return function(_0xe7012f){try{jsonpatch[_0xc4c0('0x23')](_0xe7012f,_0x2c904e,!![]);}catch(_0x907b24){return BPromise[_0xc4c0('0x24')](_0x907b24);}return _0xe7012f[_0xc4c0('0x25')]();};}function saveUpdates(_0x1c11ee,_0x2a8b5f){return function(_0x23ddbc){if(_0x23ddbc){return _0x23ddbc[_0xc4c0('0x26')](_0x1c11ee)[_0xc4c0('0x27')](function(_0x310401){return _0x310401;});}return null;};}function removeEntity(_0x7a29fd,_0x154ab3){return function(_0x318eb7){if(_0x318eb7){return _0x318eb7[_0xc4c0('0x28')]()[_0xc4c0('0x27')](function(){var _0xcc375f=_0x318eb7[_0xc4c0('0x29')]({'plain':!![]});var _0x140a97=_0xc4c0('0x2a');return db[_0xc4c0('0x2b')]['destroy']({'where':{'type':_0x140a97,'resourceId':_0xcc375f['id']}})[_0xc4c0('0x27')](function(){return _0x318eb7;});})[_0xc4c0('0x27')](function(){_0x7a29fd[_0xc4c0('0x1b')](0xcc)[_0xc4c0('0x1a')]();});}};}function handleEntityNotFound(_0x5f2757,_0x158322){return function(_0xafd9f3){if(!_0xafd9f3){_0x5f2757[_0xc4c0('0x19')](0x194);}return _0xafd9f3;};}function handleError(_0x383bab,_0x2c9c76){_0x2c9c76=_0x2c9c76||0x1f4;return function(_0x501535){logger[_0xc4c0('0x2c')](_0x501535[_0xc4c0('0x2d')]);if(_0x501535['name']){delete _0x501535[_0xc4c0('0x2e')];}_0x383bab[_0xc4c0('0x1b')](_0x2c9c76)['send'](_0x501535);};}exports['index']=function(_0x36a4f6,_0x53cc80){var _0x4184e4={},_0x38ef84={},_0x4e1e06={'count':0x0,'rows':[]};var _0x34647d=_[_0xc4c0('0x2f')](db[_0xc4c0('0x30')][_0xc4c0('0x31')],function(_0x5d98ff){return{'name':_0x5d98ff[_0xc4c0('0x32')],'type':_0x5d98ff[_0xc4c0('0x33')][_0xc4c0('0x34')]};});_0x38ef84['model']=_[_0xc4c0('0x2f')](_0x34647d,_0xc4c0('0x2e'));_0x38ef84[_0xc4c0('0x35')]=_[_0xc4c0('0x36')](_0x36a4f6[_0xc4c0('0x35')]);_0x38ef84[_0xc4c0('0x37')]=_[_0xc4c0('0x38')](_0x38ef84[_0xc4c0('0x39')],_0x38ef84[_0xc4c0('0x35')]);_0x4184e4[_0xc4c0('0x3a')]=_['intersection'](_0x38ef84[_0xc4c0('0x39')],qs[_0xc4c0('0x3b')](_0x36a4f6['query'][_0xc4c0('0x3b')]));_0x4184e4['attributes']=_0x4184e4[_0xc4c0('0x3a')][_0xc4c0('0x3c')]?_0x4184e4[_0xc4c0('0x3a')]:_0x38ef84[_0xc4c0('0x39')];if(!_0x36a4f6[_0xc4c0('0x35')][_0xc4c0('0x3d')]('nolimit')){_0x4184e4[_0xc4c0('0x1f')]=qs[_0xc4c0('0x1f')](_0x36a4f6[_0xc4c0('0x35')][_0xc4c0('0x1f')]);_0x4184e4[_0xc4c0('0x1d')]=qs['offset'](_0x36a4f6['query'][_0xc4c0('0x1d')]);}_0x4184e4[_0xc4c0('0x3e')]=qs[_0xc4c0('0x3f')](_0x36a4f6[_0xc4c0('0x35')][_0xc4c0('0x3f')]);_0x4184e4['where']=qs[_0xc4c0('0x37')](_[_0xc4c0('0x40')](_0x36a4f6[_0xc4c0('0x35')],_0x38ef84[_0xc4c0('0x37')]),_0x34647d);if(_0x36a4f6['query']['filter']){_0x4184e4[_0xc4c0('0x41')]=_[_0xc4c0('0x42')](_0x4184e4[_0xc4c0('0x41')],{'$or':_['map'](_0x34647d,function(_0x391837){if(_0x391837[_0xc4c0('0x33')]!==_0xc4c0('0x43')){var _0x4fe3c4={};_0x4fe3c4[_0x391837[_0xc4c0('0x2e')]]={'$like':'%'+_0x36a4f6[_0xc4c0('0x35')]['filter']+'%'};return _0x4fe3c4;}})});}_0x4184e4=_[_0xc4c0('0x42')]({},_0x4184e4,_0x36a4f6['options']);var _0x53ebc3={'where':_0x4184e4[_0xc4c0('0x41')]};return db['Template'][_0xc4c0('0x20')](_0x53ebc3)['then'](function(_0xf8fbb2){_0x4e1e06[_0xc4c0('0x20')]=_0xf8fbb2;if(_0x36a4f6[_0xc4c0('0x35')]['includeAll']){_0x4184e4[_0xc4c0('0x44')]=[{'all':!![]}];}return db[_0xc4c0('0x30')][_0xc4c0('0x45')](_0x4184e4);})[_0xc4c0('0x27')](function(_0x1a5ef6){_0x4e1e06[_0xc4c0('0x46')]=_0x1a5ef6;return _0x4e1e06;})[_0xc4c0('0x27')](respondWithFilteredResult(_0x53cc80,_0x4184e4))[_0xc4c0('0x47')](handleError(_0x53cc80,null));};exports[_0xc4c0('0x48')]=function(_0x3be129,_0x24ea79){var _0x13a80d={'raw':!![],'where':{'id':_0x3be129['params']['id']}},_0x5d8358={};_0x5d8358[_0xc4c0('0x39')]=_[_0xc4c0('0x36')](db[_0xc4c0('0x30')][_0xc4c0('0x31')]);_0x5d8358[_0xc4c0('0x35')]=_['keys'](_0x3be129[_0xc4c0('0x35')]);_0x5d8358[_0xc4c0('0x37')]=_[_0xc4c0('0x38')](_0x5d8358[_0xc4c0('0x39')],_0x5d8358[_0xc4c0('0x35')]);_0x13a80d[_0xc4c0('0x3a')]=_[_0xc4c0('0x38')](_0x5d8358[_0xc4c0('0x39')],qs['fields'](_0x3be129[_0xc4c0('0x35')][_0xc4c0('0x3b')]));_0x13a80d[_0xc4c0('0x3a')]=_0x13a80d[_0xc4c0('0x3a')][_0xc4c0('0x3c')]?_0x13a80d[_0xc4c0('0x3a')]:_0x5d8358['model'];if(_0x3be129[_0xc4c0('0x35')][_0xc4c0('0x49')]){_0x13a80d[_0xc4c0('0x44')]=[{'all':!![]}];}_0x13a80d=_[_0xc4c0('0x42')]({},_0x13a80d,_0x3be129[_0xc4c0('0x4a')]);return db['Template'][_0xc4c0('0x4b')](_0x13a80d)['then'](handleEntityNotFound(_0x24ea79,null))[_0xc4c0('0x27')](respondWithResult(_0x24ea79,null))['catch'](handleError(_0x24ea79,null));};exports['create']=function(_0x139a36,_0x4503c1){return db[_0xc4c0('0x30')][_0xc4c0('0x4c')](_0x139a36[_0xc4c0('0x4d')],{})[_0xc4c0('0x27')](function(_0x5a875f){var _0x3eebe8=_0x139a36[_0xc4c0('0x4e')][_0xc4c0('0x29')]({'plain':!![]});if(!_0x3eebe8)throw new Error(_0xc4c0('0x4f'));if(_0x3eebe8[_0xc4c0('0x50')]===_0xc4c0('0x4e')){var _0x38fde5=_0x5a875f[_0xc4c0('0x29')]({'plain':!![]});var _0x59e4f6=_0xc4c0('0x2a');return db[_0xc4c0('0x51')][_0xc4c0('0x4b')]({'where':{'name':_0x59e4f6,'userProfileId':_0x3eebe8[_0xc4c0('0x52')]},'raw':!![]})[_0xc4c0('0x27')](function(_0x2271a7){if(_0x2271a7&&_0x2271a7['autoAssociation']===0x0){return db[_0xc4c0('0x2b')][_0xc4c0('0x4c')]({'name':_0x38fde5[_0xc4c0('0x2e')],'resourceId':_0x38fde5['id'],'type':_0x2271a7['name'],'sectionId':_0x2271a7['id']},{})[_0xc4c0('0x27')](function(){return _0x5a875f;});}else{return _0x5a875f;}})[_0xc4c0('0x47')](function(_0x49cb11){logger[_0xc4c0('0x2c')](_0xc4c0('0x53'),_0x49cb11);throw _0x49cb11;});}return _0x5a875f;})[_0xc4c0('0x27')](respondWithResult(_0x4503c1,0xc9))[_0xc4c0('0x47')](handleError(_0x4503c1,null));};exports[_0xc4c0('0x26')]=function(_0x42ae84,_0x3f938a){if(_0x42ae84[_0xc4c0('0x4d')]['id']){delete _0x42ae84['body']['id'];}return db[_0xc4c0('0x30')][_0xc4c0('0x4b')]({'where':{'id':_0x42ae84['params']['id']}})[_0xc4c0('0x27')](handleEntityNotFound(_0x3f938a,null))[_0xc4c0('0x27')](saveUpdates(_0x42ae84[_0xc4c0('0x4d')],null))[_0xc4c0('0x27')](respondWithResult(_0x3f938a,null))[_0xc4c0('0x47')](handleError(_0x3f938a,null));};exports[_0xc4c0('0x28')]=function(_0x1cde1a,_0xd98d4e){return db['Template'][_0xc4c0('0x4b')]({'where':{'id':_0x1cde1a[_0xc4c0('0x54')]['id']}})[_0xc4c0('0x27')](handleEntityNotFound(_0xd98d4e,null))[_0xc4c0('0x27')](removeEntity(_0xd98d4e,null))[_0xc4c0('0x47')](handleError(_0xd98d4e,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index f007890..b019c19 100644 --- a/server/api/template/template.model.js +++ b/server/api/template/template.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x441f=['tools_templates','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','define','Template'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x441f,0xfb));var _0xf441=function(_0x4ab99,_0x219ed2){_0x4ab99=_0x4ab99-0x0;var _0x29e39c=_0x441f[_0x4ab99];return _0x29e39c;};'use strict';var _=require(_0xf441('0x0'));var util=require(_0xf441('0x1'));var logger=require(_0xf441('0x2'))(_0xf441('0x3'));var moment=require(_0xf441('0x4'));var BPromise=require(_0xf441('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf441('0x6'));var attributes=require('./template.attributes');module['exports']=function(_0x5402eb,_0x6cefb8){return _0x5402eb[_0xf441('0x7')](_0xf441('0x8'),attributes,{'tableName':_0xf441('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1283=['exports','define','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x111f99,_0x3b347f){var _0x3687c0=function(_0x4641d7){while(--_0x4641d7){_0x111f99['push'](_0x111f99['shift']());}};_0x3687c0(++_0x3b347f);}(_0x1283,0x98));var _0x3128=function(_0x1bb0b8,_0x24add2){_0x1bb0b8=_0x1bb0b8-0x0;var _0x22fc67=_0x1283[_0x1bb0b8];return _0x22fc67;};'use strict';var _=require(_0x3128('0x0'));var util=require(_0x3128('0x1'));var logger=require(_0x3128('0x2'))('api');var moment=require(_0x3128('0x3'));var BPromise=require(_0x3128('0x4'));var rp=require(_0x3128('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3128('0x6'));var config=require(_0x3128('0x7'));var attributes=require('./template.attributes');module[_0x3128('0x8')]=function(_0x3b605a,_0x2fd2dc){return _0x3b605a[_0x3128('0x9')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 5cfdcb4..6e7f8e5 100644 --- a/server/api/template/template.rpc.js +++ b/server/api/template/template.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd3a2=['util','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','then'];(function(_0xc66583,_0x404ee3){var _0x580314=function(_0x5e2849){while(--_0x5e2849){_0xc66583['push'](_0xc66583['shift']());}};_0x580314(++_0x404ee3);}(_0xd3a2,0x7c));var _0x2d3a=function(_0xa0ec1c,_0x1a94dd){_0xa0ec1c=_0xa0ec1c-0x0;var _0x3a8908=_0xd3a2[_0xa0ec1c];return _0x3a8908;};'use strict';var _=require('lodash');var util=require(_0x2d3a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2d3a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d3a('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2d3a('0x3'));var config=require(_0x2d3a('0x4'));var jayson=require(_0x2d3a('0x5'));var client=jayson[_0x2d3a('0x6')][_0x2d3a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x48035a,_0x1d2c1c,_0x48380d){return new BPromise(function(_0x1fac6a,_0x2b8073){return client['request'](_0x48035a,_0x48380d)['then'](function(_0x564c97){logger[_0x2d3a('0x8')](_0x2d3a('0x9'),_0x1d2c1c,_0x2d3a('0xa'));logger[_0x2d3a('0xb')](_0x2d3a('0xc'),_0x1d2c1c,_0x2d3a('0xa'),JSON[_0x2d3a('0xd')](_0x564c97));if(_0x564c97[_0x2d3a('0xe')]){if(_0x564c97[_0x2d3a('0xe')][_0x2d3a('0xf')]===0x1f4){logger[_0x2d3a('0xe')](_0x2d3a('0x9'),_0x1d2c1c,_0x564c97[_0x2d3a('0xe')][_0x2d3a('0x10')]);return _0x2b8073(_0x564c97['error']['message']);}logger[_0x2d3a('0xe')](_0x2d3a('0x9'),_0x1d2c1c,_0x564c97[_0x2d3a('0xe')]['message']);return _0x1fac6a(_0x564c97['error'][_0x2d3a('0x10')]);}else{logger[_0x2d3a('0x8')](_0x2d3a('0x9'),_0x1d2c1c,_0x2d3a('0xa'));_0x1fac6a(_0x564c97[_0x2d3a('0x11')][_0x2d3a('0x10')]);}})[_0x2d3a('0x12')](function(_0x41f4d1){logger['error'](_0x2d3a('0x9'),_0x1d2c1c,_0x41f4d1);_0x2b8073(_0x41f4d1);});});}exports[_0x2d3a('0x13')]=function(_0x150867){var _0x5b6a4c=this;return new Promise(function(_0x49bd34,_0x5797ee){return db[_0x2d3a('0x14')][_0x2d3a('0x15')]({'raw':_0x150867[_0x2d3a('0x16')]?_0x150867[_0x2d3a('0x16')][_0x2d3a('0x17')]===undefined?!![]:![]:!![],'where':_0x150867['options']?_0x150867[_0x2d3a('0x16')][_0x2d3a('0x18')]||null:null,'attributes':_0x150867['options']?_0x150867[_0x2d3a('0x16')][_0x2d3a('0x19')]||null:null,'limit':_0x150867[_0x2d3a('0x16')]?_0x150867['options'][_0x2d3a('0x1a')]||null:null,'include':_0x150867['options']?_0x150867[_0x2d3a('0x16')][_0x2d3a('0x1b')]?_[_0x2d3a('0x1c')](_0x150867[_0x2d3a('0x16')][_0x2d3a('0x1b')],function(_0x4fad85){return{'model':db[_0x4fad85[_0x2d3a('0x1d')]],'as':_0x4fad85['as'],'attributes':_0x4fad85[_0x2d3a('0x19')],'include':_0x4fad85['include']?_['map'](_0x4fad85[_0x2d3a('0x1b')],function(_0x5da2de){return{'model':db[_0x5da2de[_0x2d3a('0x1d')]],'as':_0x5da2de['as'],'attributes':_0x5da2de['attributes'],'include':_0x5da2de['include']?_[_0x2d3a('0x1c')](_0x5da2de[_0x2d3a('0x1b')],function(_0x386f11){return{'model':db[_0x386f11[_0x2d3a('0x1d')]],'as':_0x386f11['as'],'attributes':_0x386f11[_0x2d3a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2d3a('0x1e')](function(_0x28bc09){logger['info'](_0x2d3a('0x13'),_0x150867);logger[_0x2d3a('0xb')](_0x2d3a('0x13'),_0x150867,JSON[_0x2d3a('0xd')](_0x28bc09));_0x49bd34(_0x28bc09);})['catch'](function(_0x33650b){logger[_0x2d3a('0xe')](_0x2d3a('0x13'),_0x33650b['message'],_0x150867);_0x5797ee(_0x5b6a4c[_0x2d3a('0xe')](0x1f4,_0x33650b[_0x2d3a('0x10')]));});});}; \ No newline at end of file +var _0xa46a=['include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetTemplate','Template','options','where','attributes','limit'];(function(_0x5b3a0e,_0x1d8878){var _0x10b7b8=function(_0xfc0186){while(--_0xfc0186){_0x5b3a0e['push'](_0x5b3a0e['shift']());}};_0x10b7b8(++_0x1d8878);}(_0xa46a,0x113));var _0xaa46=function(_0x584229,_0x11c7c9){_0x584229=_0x584229-0x0;var _0x334eae=_0xa46a[_0x584229];return _0x334eae;};'use strict';var _=require(_0xaa46('0x0'));var util=require(_0xaa46('0x1'));var moment=require(_0xaa46('0x2'));var BPromise=require(_0xaa46('0x3'));var rs=require(_0xaa46('0x4'));var fs=require('fs');var Redis=require(_0xaa46('0x5'));var db=require(_0xaa46('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa46('0x7'))(_0xaa46('0x8'));var config=require(_0xaa46('0x9'));var jayson=require(_0xaa46('0xa'));var client=jayson[_0xaa46('0xb')][_0xaa46('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xec5249,_0x4aa01b,_0x444f07){return new BPromise(function(_0x264eca,_0x95d0a3){return client[_0xaa46('0xd')](_0xec5249,_0x444f07)[_0xaa46('0xe')](function(_0x50d152){logger['info'](_0xaa46('0xf'),_0x4aa01b,_0xaa46('0x10'));logger[_0xaa46('0x11')]('Template,\x20%s,\x20%s,\x20%s',_0x4aa01b,_0xaa46('0x10'),JSON[_0xaa46('0x12')](_0x50d152));if(_0x50d152[_0xaa46('0x13')]){if(_0x50d152[_0xaa46('0x13')][_0xaa46('0x14')]===0x1f4){logger[_0xaa46('0x13')](_0xaa46('0xf'),_0x4aa01b,_0x50d152[_0xaa46('0x13')][_0xaa46('0x15')]);return _0x95d0a3(_0x50d152[_0xaa46('0x13')][_0xaa46('0x15')]);}logger[_0xaa46('0x13')]('Template,\x20%s,\x20%s',_0x4aa01b,_0x50d152['error'][_0xaa46('0x15')]);return _0x264eca(_0x50d152[_0xaa46('0x13')]['message']);}else{logger[_0xaa46('0x16')](_0xaa46('0xf'),_0x4aa01b,_0xaa46('0x10'));_0x264eca(_0x50d152[_0xaa46('0x17')]['message']);}})[_0xaa46('0x18')](function(_0x916c63){logger[_0xaa46('0x13')](_0xaa46('0xf'),_0x4aa01b,_0x916c63);_0x95d0a3(_0x916c63);});});}exports[_0xaa46('0x19')]=function(_0x35af5b){var _0x2b9379=this;return new Promise(function(_0x3c4366,_0x498f81){return db[_0xaa46('0x1a')]['findAll']({'raw':_0x35af5b[_0xaa46('0x1b')]?_0x35af5b['options']['raw']===undefined?!![]:![]:!![],'where':_0x35af5b[_0xaa46('0x1b')]?_0x35af5b[_0xaa46('0x1b')][_0xaa46('0x1c')]||null:null,'attributes':_0x35af5b[_0xaa46('0x1b')]?_0x35af5b[_0xaa46('0x1b')][_0xaa46('0x1d')]||null:null,'limit':_0x35af5b[_0xaa46('0x1b')]?_0x35af5b['options'][_0xaa46('0x1e')]||null:null,'include':_0x35af5b['options']?_0x35af5b[_0xaa46('0x1b')][_0xaa46('0x1f')]?_[_0xaa46('0x20')](_0x35af5b[_0xaa46('0x1b')][_0xaa46('0x1f')],function(_0x293953){return{'model':db[_0x293953[_0xaa46('0x21')]],'as':_0x293953['as'],'attributes':_0x293953[_0xaa46('0x1d')],'include':_0x293953[_0xaa46('0x1f')]?_[_0xaa46('0x20')](_0x293953[_0xaa46('0x1f')],function(_0x1cc08b){return{'model':db[_0x1cc08b['model']],'as':_0x1cc08b['as'],'attributes':_0x1cc08b['attributes'],'include':_0x1cc08b[_0xaa46('0x1f')]?_[_0xaa46('0x20')](_0x1cc08b[_0xaa46('0x1f')],function(_0x1046f9){return{'model':db[_0x1046f9[_0xaa46('0x21')]],'as':_0x1046f9['as'],'attributes':_0x1046f9[_0xaa46('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xaa46('0xe')](function(_0x145452){logger[_0xaa46('0x16')](_0xaa46('0x19'),_0x35af5b);logger[_0xaa46('0x11')](_0xaa46('0x19'),_0x35af5b,JSON[_0xaa46('0x12')](_0x145452));_0x3c4366(_0x145452);})['catch'](function(_0x5633bd){logger[_0xaa46('0x13')](_0xaa46('0x19'),_0x5633bd[_0xaa46('0x15')],_0x35af5b);_0x498f81(_0x2b9379[_0xaa46('0x13')](0x1f4,_0x5633bd['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index b6768e1..0607b9e 100644 --- a/server/api/trigger/index.js +++ b/server/api/trigger/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd408=['getAllConditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','/:id/any_conditions','addAction','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','show','/:id/all_conditions'];(function(_0x20a4dc,_0x2bd7c7){var _0x49000f=function(_0x2246e7){while(--_0x2246e7){_0x20a4dc['push'](_0x20a4dc['shift']());}};_0x49000f(++_0x2bd7c7);}(_0xd408,0x1e7));var _0x8d40=function(_0x35b094,_0x494122){_0x35b094=_0x35b094-0x0;var _0x41c6a8=_0xd408[_0x35b094];return _0x41c6a8;};'use strict';var multer=require(_0x8d40('0x0'));var util=require(_0x8d40('0x1'));var path=require(_0x8d40('0x2'));var timeout=require(_0x8d40('0x3'));var express=require(_0x8d40('0x4'));var router=express['Router']();var fs_extra=require(_0x8d40('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8d40('0x6'));var config=require(_0x8d40('0x7'));var controller=require(_0x8d40('0x8'));router[_0x8d40('0x9')]('/',auth[_0x8d40('0xa')](),controller['index']);router['get']('/:id',auth[_0x8d40('0xa')](),controller[_0x8d40('0xb')]);router[_0x8d40('0x9')](_0x8d40('0xc'),auth[_0x8d40('0xa')](),controller[_0x8d40('0xd')]);router[_0x8d40('0x9')]('/:id/any_conditions',auth[_0x8d40('0xa')](),controller[_0x8d40('0xe')]);router[_0x8d40('0x9')](_0x8d40('0xf'),auth[_0x8d40('0xa')](),controller[_0x8d40('0x10')]);router['post']('/',auth[_0x8d40('0xa')](),controller['create']);router[_0x8d40('0x11')]('/:id/all_conditions',auth[_0x8d40('0xa')](),controller[_0x8d40('0x12')]);router[_0x8d40('0x11')](_0x8d40('0x13'),auth['isAuthenticated'](),controller['addAnyCondition']);router['post']('/:id/actions',auth[_0x8d40('0xa')](),controller[_0x8d40('0x14')]);router[_0x8d40('0x15')](_0x8d40('0x16'),auth[_0x8d40('0xa')](),controller['update']);router[_0x8d40('0x17')](_0x8d40('0x16'),auth['isAuthenticated'](),controller[_0x8d40('0x18')]);module['exports']=router; \ No newline at end of file +var _0xc765=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','post','create','addAnyCondition','/:id/actions','put','update','destroy','multer','util','path','express','fs-extra'];(function(_0x12d2c3,_0x11584b){var _0xd75c5=function(_0x119cdd){while(--_0x119cdd){_0x12d2c3['push'](_0x12d2c3['shift']());}};_0xd75c5(++_0x11584b);}(_0xc765,0x14b));var _0x5c76=function(_0x1bb746,_0x40a782){_0x1bb746=_0x1bb746-0x0;var _0x27ffbb=_0xc765[_0x1bb746];return _0x27ffbb;};'use strict';var multer=require(_0x5c76('0x0'));var util=require(_0x5c76('0x1'));var path=require(_0x5c76('0x2'));var timeout=require('connect-timeout');var express=require(_0x5c76('0x3'));var router=express['Router']();var fs_extra=require(_0x5c76('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5c76('0x5'));var config=require(_0x5c76('0x6'));var controller=require('./trigger.controller');router[_0x5c76('0x7')]('/',auth[_0x5c76('0x8')](),controller['index']);router['get'](_0x5c76('0x9'),auth['isAuthenticated'](),controller[_0x5c76('0xa')]);router[_0x5c76('0x7')](_0x5c76('0xb'),auth[_0x5c76('0x8')](),controller['getAllConditions']);router[_0x5c76('0x7')](_0x5c76('0xc'),auth['isAuthenticated'](),controller[_0x5c76('0xd')]);router[_0x5c76('0x7')]('/:id/actions',auth[_0x5c76('0x8')](),controller['getActions']);router[_0x5c76('0xe')]('/',auth[_0x5c76('0x8')](),controller[_0x5c76('0xf')]);router[_0x5c76('0xe')](_0x5c76('0xb'),auth[_0x5c76('0x8')](),controller['addAllCondition']);router[_0x5c76('0xe')]('/:id/any_conditions',auth[_0x5c76('0x8')](),controller[_0x5c76('0x10')]);router['post'](_0x5c76('0x11'),auth[_0x5c76('0x8')](),controller['addAction']);router[_0x5c76('0x12')]('/:id',auth[_0x5c76('0x8')](),controller[_0x5c76('0x13')]);router['delete']('/:id',auth[_0x5c76('0x8')](),controller[_0x5c76('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index f2e465f..aa60bd5 100644 --- a/server/api/trigger/trigger.attributes.js +++ b/server/api/trigger/trigger.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa428=['STRING','BOOLEAN','sequelize'];(function(_0x3acd75,_0x5759fc){var _0x20fe5b=function(_0x3d60fa){while(--_0x3d60fa){_0x3acd75['push'](_0x3acd75['shift']());}};_0x20fe5b(++_0x5759fc);}(_0xa428,0x7a));var _0x8a42=function(_0x241f20,_0xcfd3fa){_0x241f20=_0x241f20-0x0;var _0x21b5f4=_0xa428[_0x241f20];return _0x21b5f4;};'use strict';var Sequelize=require(_0x8a42('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8a42('0x1')]},'description':{'type':Sequelize[_0x8a42('0x1')]},'status':{'type':Sequelize[_0x8a42('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x0a41=['STRING','BOOLEAN','exports'];(function(_0x285824,_0x3da647){var _0x311d7e=function(_0x2f3de0){while(--_0x2f3de0){_0x285824['push'](_0x285824['shift']());}};_0x311d7e(++_0x3da647);}(_0x0a41,0xe6));var _0x10a4=function(_0x279fc8,_0x1ba427){_0x279fc8=_0x279fc8-0x0;var _0x4521a5=_0x0a41[_0x279fc8];return _0x4521a5;};'use strict';var Sequelize=require('sequelize');module[_0x10a4('0x0')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x10a4('0x1')]},'status':{'type':Sequelize[_0x10a4('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 5471e40..6786f2f 100644 --- a/server/api/trigger/trigger.controller.js +++ b/server/api/trigger/trigger.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x56a6=['count','Content-Range','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','send','index','Trigger','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','VIRTUAL','merge','options','includeAll','include','rows','catch','params','find','create','user','role','Triggers','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','getAllConditions','findOne','Condition','sort','filter','getAnyConditions','addAction','TriggerId','getActions','Action','rimraf','fast-json-patch','request-promise','bluebird','mustache','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','sendStatus','end','status','json','offset','limit','undefined'];(function(_0x19c05d,_0x1253ad){var _0x167988=function(_0x437221){while(--_0x437221){_0x19c05d['push'](_0x19c05d['shift']());}};_0x167988(++_0x1253ad);}(_0x56a6,0x9b));var _0x656a=function(_0x367551,_0x17634d){_0x367551=_0x367551-0x0;var _0x3254f8=_0x56a6[_0x367551];return _0x3254f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x656a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x656a('0x1'));var rp=require(_0x656a('0x2'));var moment=require('moment');var BPromise=require(_0x656a('0x3'));var Mustache=require(_0x656a('0x4'));var util=require('util');var path=require(_0x656a('0x5'));var sox=require(_0x656a('0x6'));var csv=require(_0x656a('0x7'));var ejs=require(_0x656a('0x8'));var fs=require('fs');var fs_extra=require(_0x656a('0x9'));var _=require(_0x656a('0xa'));var squel=require(_0x656a('0xb'));var crypto=require('crypto');var jsforce=require(_0x656a('0xc'));var deskjs=require(_0x656a('0xd'));var toCsv=require(_0x656a('0x7'));var querystring=require(_0x656a('0xe'));var Papa=require(_0x656a('0xf'));var Redis=require(_0x656a('0x10'));var authService=require(_0x656a('0x11'));var qs=require(_0x656a('0x12'));var as=require(_0x656a('0x13'));var hardwareService=require(_0x656a('0x14'));var logger=require(_0x656a('0x15'))(_0x656a('0x16'));var utils=require(_0x656a('0x17'));var config=require(_0x656a('0x18'));var licenseUtil=require(_0x656a('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fa203,_0x532303){_0x532303=_0x532303||0xcc;return function(_0x216c57){if(_0x216c57){return _0x1fa203[_0x656a('0x1a')](_0x532303);}return _0x1fa203['status'](_0x532303)[_0x656a('0x1b')]();};}function respondWithResult(_0x44047f,_0x245fb8){_0x245fb8=_0x245fb8||0xc8;return function(_0x690ba9){if(_0x690ba9){return _0x44047f[_0x656a('0x1c')](_0x245fb8)[_0x656a('0x1d')](_0x690ba9);}};}function respondWithFilteredResult(_0x5e2e7d,_0x27aa62){return function(_0x16f6df){if(_0x16f6df){var _0x5a9f74=typeof _0x27aa62[_0x656a('0x1e')]==='undefined'&&typeof _0x27aa62[_0x656a('0x1f')]===_0x656a('0x20');var _0x19263f=_0x16f6df['count'];var _0x56b6c0=_0x5a9f74?0x0:_0x27aa62[_0x656a('0x1e')];var _0x573103=_0x5a9f74?_0x16f6df[_0x656a('0x21')]:_0x27aa62[_0x656a('0x1e')]+_0x27aa62[_0x656a('0x1f')];var _0x5dd4f4;if(_0x573103>=_0x19263f){_0x573103=_0x19263f;_0x5dd4f4=0xc8;}else{_0x5dd4f4=0xce;}_0x5e2e7d[_0x656a('0x1c')](_0x5dd4f4);return _0x5e2e7d['set'](_0x656a('0x22'),_0x56b6c0+'-'+_0x573103+'/'+_0x19263f)[_0x656a('0x1d')](_0x16f6df);}return null;};}function patchUpdates(_0x41c1bc){return function(_0x94c065){try{jsonpatch[_0x656a('0x23')](_0x94c065,_0x41c1bc,!![]);}catch(_0x1984c3){return BPromise[_0x656a('0x24')](_0x1984c3);}return _0x94c065['save']();};}function saveUpdates(_0x1c2ec4,_0x43dc5b){return function(_0x42b188){if(_0x42b188){return _0x42b188['update'](_0x1c2ec4)[_0x656a('0x25')](function(_0x4ce777){return _0x4ce777;});}return null;};}function removeEntity(_0x2b7fc3,_0x31f928){return function(_0x2b890b){if(_0x2b890b){return _0x2b890b[_0x656a('0x26')]()['then'](function(){var _0x2a8588=_0x2b890b[_0x656a('0x27')]({'plain':!![]});var _0x10d9eb='Triggers';return db[_0x656a('0x28')]['destroy']({'where':{'type':_0x10d9eb,'resourceId':_0x2a8588['id']}})[_0x656a('0x25')](function(){return _0x2b890b;});})[_0x656a('0x25')](function(){_0x2b7fc3[_0x656a('0x1c')](0xcc)[_0x656a('0x1b')]();});}};}function handleEntityNotFound(_0x515fa8,_0x7eb879){return function(_0x135122){if(!_0x135122){_0x515fa8[_0x656a('0x1a')](0x194);}return _0x135122;};}function handleError(_0xc438a9,_0x58f211){_0x58f211=_0x58f211||0x1f4;return function(_0x220d8e){logger[_0x656a('0x29')](_0x220d8e[_0x656a('0x2a')]);if(_0x220d8e['name']){delete _0x220d8e[_0x656a('0x2b')];}_0xc438a9[_0x656a('0x1c')](_0x58f211)[_0x656a('0x2c')](_0x220d8e);};}exports[_0x656a('0x2d')]=function(_0x46195b,_0x170ace){var _0x57a83f={},_0x21e582={},_0x38908d={'count':0x0,'rows':[]};var _0x436c9e=_['map'](db[_0x656a('0x2e')][_0x656a('0x2f')],function(_0x1994bb){return{'name':_0x1994bb['fieldName'],'type':_0x1994bb[_0x656a('0x30')]['key']};});_0x21e582[_0x656a('0x31')]=_[_0x656a('0x32')](_0x436c9e,_0x656a('0x2b'));_0x21e582[_0x656a('0x33')]=_[_0x656a('0x34')](_0x46195b[_0x656a('0x33')]);_0x21e582[_0x656a('0x35')]=_[_0x656a('0x36')](_0x21e582['model'],_0x21e582[_0x656a('0x33')]);_0x57a83f[_0x656a('0x37')]=_[_0x656a('0x36')](_0x21e582[_0x656a('0x31')],qs[_0x656a('0x38')](_0x46195b[_0x656a('0x33')][_0x656a('0x38')]));_0x57a83f['attributes']=_0x57a83f[_0x656a('0x37')][_0x656a('0x39')]?_0x57a83f[_0x656a('0x37')]:_0x21e582['model'];if(!_0x46195b[_0x656a('0x33')][_0x656a('0x3a')](_0x656a('0x3b'))){_0x57a83f[_0x656a('0x1f')]=qs[_0x656a('0x1f')](_0x46195b[_0x656a('0x33')][_0x656a('0x1f')]);_0x57a83f[_0x656a('0x1e')]=qs[_0x656a('0x1e')](_0x46195b[_0x656a('0x33')][_0x656a('0x1e')]);}_0x57a83f[_0x656a('0x3c')]=qs['sort'](_0x46195b[_0x656a('0x33')]['sort']);_0x57a83f[_0x656a('0x3d')]=qs['filters'](_[_0x656a('0x3e')](_0x46195b[_0x656a('0x33')],_0x21e582[_0x656a('0x35')]),_0x436c9e);if(_0x46195b[_0x656a('0x33')]['filter']){_0x57a83f['where']=_['merge'](_0x57a83f['where'],{'$or':_['map'](_0x436c9e,function(_0x462c20){if(_0x462c20[_0x656a('0x30')]!==_0x656a('0x3f')){var _0x5bec3d={};_0x5bec3d[_0x462c20[_0x656a('0x2b')]]={'$like':'%'+_0x46195b[_0x656a('0x33')]['filter']+'%'};return _0x5bec3d;}})});}_0x57a83f=_[_0x656a('0x40')]({},_0x57a83f,_0x46195b[_0x656a('0x41')]);var _0x3950d2={'where':_0x57a83f['where']};return db[_0x656a('0x2e')]['count'](_0x3950d2)[_0x656a('0x25')](function(_0x42b7dd){_0x38908d['count']=_0x42b7dd;if(_0x46195b[_0x656a('0x33')][_0x656a('0x42')]){_0x57a83f[_0x656a('0x43')]=[{'all':!![]}];}return db[_0x656a('0x2e')]['findAll'](_0x57a83f);})[_0x656a('0x25')](function(_0x1beb54){_0x38908d[_0x656a('0x44')]=_0x1beb54;return _0x38908d;})[_0x656a('0x25')](respondWithFilteredResult(_0x170ace,_0x57a83f))[_0x656a('0x45')](handleError(_0x170ace,null));};exports['show']=function(_0x292484,_0x2960a3){var _0x3b6136={'raw':![],'where':{'id':_0x292484[_0x656a('0x46')]['id']}},_0x1af4ea={};_0x1af4ea[_0x656a('0x31')]=_[_0x656a('0x34')](db['Trigger'][_0x656a('0x2f')]);_0x1af4ea[_0x656a('0x33')]=_[_0x656a('0x34')](_0x292484[_0x656a('0x33')]);_0x1af4ea[_0x656a('0x35')]=_[_0x656a('0x36')](_0x1af4ea['model'],_0x1af4ea[_0x656a('0x33')]);_0x3b6136[_0x656a('0x37')]=_[_0x656a('0x36')](_0x1af4ea['model'],qs['fields'](_0x292484['query'][_0x656a('0x38')]));_0x3b6136[_0x656a('0x37')]=_0x3b6136['attributes'][_0x656a('0x39')]?_0x3b6136[_0x656a('0x37')]:_0x1af4ea[_0x656a('0x31')];if(_0x292484[_0x656a('0x33')]['includeAll']){_0x3b6136[_0x656a('0x43')]=[{'all':!![]}];}_0x3b6136=_[_0x656a('0x40')]({},_0x3b6136,_0x292484[_0x656a('0x41')]);return db[_0x656a('0x2e')][_0x656a('0x47')](_0x3b6136)['then'](handleEntityNotFound(_0x2960a3,null))[_0x656a('0x25')](respondWithResult(_0x2960a3,null))['catch'](handleError(_0x2960a3,null));};exports['create']=function(_0x2cf9a0,_0x2d51c9){return db[_0x656a('0x2e')][_0x656a('0x48')](_0x2cf9a0['body'],{})[_0x656a('0x25')](function(_0x1b3751){var _0x1070e1=_0x2cf9a0[_0x656a('0x49')][_0x656a('0x27')]({'plain':!![]});if(!_0x1070e1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1070e1[_0x656a('0x4a')]===_0x656a('0x49')){var _0xc4599e=_0x1b3751[_0x656a('0x27')]({'plain':!![]});var _0xd2e697=_0x656a('0x4b');return db['UserProfileSection']['find']({'where':{'name':_0xd2e697,'userProfileId':_0x1070e1['userProfileId']},'raw':!![]})['then'](function(_0x581696){if(_0x581696&&_0x581696[_0x656a('0x4c')]===0x0){return db['UserProfileResource'][_0x656a('0x48')]({'name':_0xc4599e['name'],'resourceId':_0xc4599e['id'],'type':_0x581696[_0x656a('0x2b')],'sectionId':_0x581696['id']},{})[_0x656a('0x25')](function(){return _0x1b3751;});}else{return _0x1b3751;}})[_0x656a('0x45')](function(_0x13289e){logger['error'](_0x656a('0x4d'),_0x13289e);throw _0x13289e;});}return _0x1b3751;})[_0x656a('0x25')](respondWithResult(_0x2d51c9,0xc9))[_0x656a('0x45')](handleError(_0x2d51c9,null));};exports[_0x656a('0x4e')]=function(_0xe5db8,_0xd79915){if(_0xe5db8[_0x656a('0x4f')]['id']){delete _0xe5db8[_0x656a('0x4f')]['id'];}return db['Trigger'][_0x656a('0x47')]({'where':{'id':_0xe5db8[_0x656a('0x46')]['id']}})['then'](handleEntityNotFound(_0xd79915,null))[_0x656a('0x25')](saveUpdates(_0xe5db8[_0x656a('0x4f')],null))[_0x656a('0x25')](respondWithResult(_0xd79915,null))[_0x656a('0x45')](handleError(_0xd79915,null));};exports[_0x656a('0x26')]=function(_0x5bc4a0,_0x5f0286){return db['Trigger'][_0x656a('0x47')]({'where':{'id':_0x5bc4a0[_0x656a('0x46')]['id']}})[_0x656a('0x25')](handleEntityNotFound(_0x5f0286,null))[_0x656a('0x25')](removeEntity(_0x5f0286,null))[_0x656a('0x45')](handleError(_0x5f0286,null));};exports[_0x656a('0x50')]=function(_0x2de2f,_0x2b588f,_0x366bf2){if(_0x2de2f['body']['id']){delete _0x2de2f[_0x656a('0x4f')]['id'];}return db[_0x656a('0x2e')]['find']({'where':{'id':_0x2de2f[_0x656a('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b588f,null))[_0x656a('0x25')](function(_0x23adc0){if(_0x23adc0){_0x2de2f['body'][_0x656a('0x51')]=_0x23adc0['id'];return db['Condition'][_0x656a('0x48')](_0x2de2f['body']);}})[_0x656a('0x25')](respondWithResult(_0x2b588f,null))[_0x656a('0x45')](handleError(_0x2b588f,null));};exports[_0x656a('0x52')]=function(_0x5ef068,_0x5a05a1,_0x5342a6){if(_0x5ef068['body']['id']){delete _0x5ef068['body']['id'];}return db[_0x656a('0x2e')][_0x656a('0x47')]({'where':{'id':_0x5ef068[_0x656a('0x46')]['id']}})['then'](handleEntityNotFound(_0x5a05a1,null))[_0x656a('0x25')](function(_0x10d426){if(_0x10d426){_0x5ef068[_0x656a('0x4f')][_0x656a('0x53')]=_0x10d426['id'];return db['Condition']['create'](_0x5ef068['body']);}})[_0x656a('0x25')](respondWithResult(_0x5a05a1,null))['catch'](handleError(_0x5a05a1,null));};exports[_0x656a('0x54')]=function(_0x4b4169,_0x57b680,_0x2fb098){var _0x141d32={};var _0x366b7={};var _0x3a1fdb;var _0x32438f;return db[_0x656a('0x2e')][_0x656a('0x55')]({'where':{'id':_0x4b4169[_0x656a('0x46')]['id']}})[_0x656a('0x25')](handleEntityNotFound(_0x57b680,null))[_0x656a('0x25')](function(_0x3667e9){if(_0x3667e9){_0x3a1fdb=_0x3667e9;_0x366b7['model']=_[_0x656a('0x34')](db[_0x656a('0x56')][_0x656a('0x2f')]);_0x366b7[_0x656a('0x33')]=_['keys'](_0x4b4169['query']);_0x366b7[_0x656a('0x35')]=_[_0x656a('0x36')](_0x366b7['model'],_0x366b7[_0x656a('0x33')]);_0x141d32['attributes']=_[_0x656a('0x36')](_0x366b7[_0x656a('0x31')],qs[_0x656a('0x38')](_0x4b4169[_0x656a('0x33')]['fields']));_0x141d32[_0x656a('0x37')]=_0x141d32[_0x656a('0x37')][_0x656a('0x39')]?_0x141d32['attributes']:_0x366b7[_0x656a('0x31')];_0x141d32[_0x656a('0x3c')]=qs[_0x656a('0x57')](_0x4b4169[_0x656a('0x33')][_0x656a('0x57')]);_0x141d32[_0x656a('0x3d')]=qs['filters'](_[_0x656a('0x3e')](_0x4b4169[_0x656a('0x33')],_0x366b7[_0x656a('0x35')]));if(_0x4b4169[_0x656a('0x33')][_0x656a('0x58')]){_0x141d32['where']=_[_0x656a('0x40')](_0x141d32[_0x656a('0x3d')],{'$or':_[_0x656a('0x32')](_0x141d32[_0x656a('0x37')],function(_0x468bf2){var _0xa4f10={};_0xa4f10[_0x468bf2]={'$like':'%'+_0x4b4169[_0x656a('0x33')][_0x656a('0x58')]+'%'};return _0xa4f10;})});}_0x141d32=_[_0x656a('0x40')]({},_0x141d32,_0x4b4169[_0x656a('0x41')]);return _0x3a1fdb[_0x656a('0x54')](_0x141d32);}})[_0x656a('0x25')](function(_0x1ab1b8){if(_0x1ab1b8){_0x32438f=_0x1ab1b8[_0x656a('0x39')];if(!_0x4b4169[_0x656a('0x33')][_0x656a('0x3a')](_0x656a('0x3b'))){_0x141d32[_0x656a('0x1f')]=qs[_0x656a('0x1f')](_0x4b4169['query'][_0x656a('0x1f')]);_0x141d32['offset']=qs[_0x656a('0x1e')](_0x4b4169[_0x656a('0x33')][_0x656a('0x1e')]);}return _0x3a1fdb[_0x656a('0x54')](_0x141d32);}})['then'](function(_0x5c5067){if(_0x5c5067){return _0x5c5067?{'count':_0x32438f,'rows':_0x5c5067}:null;}})[_0x656a('0x25')](respondWithResult(_0x57b680,null))[_0x656a('0x45')](handleError(_0x57b680,null));};exports[_0x656a('0x59')]=function(_0x20114e,_0x1ececb,_0x578865){var _0x33b228={};var _0x5c549f={};var _0x295ed1;var _0x3105ca;return db[_0x656a('0x2e')][_0x656a('0x55')]({'where':{'id':_0x20114e[_0x656a('0x46')]['id']}})['then'](handleEntityNotFound(_0x1ececb,null))['then'](function(_0x4adf76){if(_0x4adf76){_0x295ed1=_0x4adf76;_0x5c549f[_0x656a('0x31')]=_[_0x656a('0x34')](db[_0x656a('0x56')][_0x656a('0x2f')]);_0x5c549f[_0x656a('0x33')]=_[_0x656a('0x34')](_0x20114e['query']);_0x5c549f[_0x656a('0x35')]=_['intersection'](_0x5c549f[_0x656a('0x31')],_0x5c549f[_0x656a('0x33')]);_0x33b228['attributes']=_[_0x656a('0x36')](_0x5c549f[_0x656a('0x31')],qs['fields'](_0x20114e[_0x656a('0x33')][_0x656a('0x38')]));_0x33b228[_0x656a('0x37')]=_0x33b228[_0x656a('0x37')]['length']?_0x33b228[_0x656a('0x37')]:_0x5c549f[_0x656a('0x31')];_0x33b228[_0x656a('0x3c')]=qs[_0x656a('0x57')](_0x20114e[_0x656a('0x33')][_0x656a('0x57')]);_0x33b228[_0x656a('0x3d')]=qs[_0x656a('0x35')](_[_0x656a('0x3e')](_0x20114e[_0x656a('0x33')],_0x5c549f[_0x656a('0x35')]));if(_0x20114e['query'][_0x656a('0x58')]){_0x33b228[_0x656a('0x3d')]=_['merge'](_0x33b228[_0x656a('0x3d')],{'$or':_[_0x656a('0x32')](_0x33b228[_0x656a('0x37')],function(_0x544573){var _0x37ec1a={};_0x37ec1a[_0x544573]={'$like':'%'+_0x20114e[_0x656a('0x33')][_0x656a('0x58')]+'%'};return _0x37ec1a;})});}_0x33b228=_[_0x656a('0x40')]({},_0x33b228,_0x20114e[_0x656a('0x41')]);return _0x295ed1[_0x656a('0x59')](_0x33b228);}})[_0x656a('0x25')](function(_0x5c5096){if(_0x5c5096){_0x3105ca=_0x5c5096['length'];if(!_0x20114e[_0x656a('0x33')]['hasOwnProperty'](_0x656a('0x3b'))){_0x33b228[_0x656a('0x1f')]=qs['limit'](_0x20114e[_0x656a('0x33')][_0x656a('0x1f')]);_0x33b228['offset']=qs[_0x656a('0x1e')](_0x20114e[_0x656a('0x33')][_0x656a('0x1e')]);}return _0x295ed1['getAnyConditions'](_0x33b228);}})[_0x656a('0x25')](function(_0x4f218d){if(_0x4f218d){return _0x4f218d?{'count':_0x3105ca,'rows':_0x4f218d}:null;}})[_0x656a('0x25')](respondWithResult(_0x1ececb,null))[_0x656a('0x45')](handleError(_0x1ececb,null));};exports[_0x656a('0x5a')]=function(_0x4fd5df,_0x2f7e93,_0x167fe9){if(_0x4fd5df[_0x656a('0x4f')]['id']){delete _0x4fd5df[_0x656a('0x4f')]['id'];}return db[_0x656a('0x2e')]['find']({'where':{'id':_0x4fd5df[_0x656a('0x46')]['id']}})['then'](handleEntityNotFound(_0x2f7e93,null))[_0x656a('0x25')](function(_0x180fa4){if(_0x180fa4){_0x4fd5df[_0x656a('0x4f')][_0x656a('0x5b')]=_0x180fa4['id'];return db['Action']['create'](_0x4fd5df[_0x656a('0x4f')]);}})['then'](respondWithResult(_0x2f7e93,null))['catch'](handleError(_0x2f7e93,null));};exports[_0x656a('0x5c')]=function(_0x3840bd,_0x43b8a1,_0x597c62){var _0x536e4e={};var _0x5a1c02={};var _0x3ca6fa;var _0x1ade90;return db[_0x656a('0x2e')][_0x656a('0x55')]({'where':{'id':_0x3840bd['params']['id']}})['then'](handleEntityNotFound(_0x43b8a1,null))[_0x656a('0x25')](function(_0x227b8e){if(_0x227b8e){_0x3ca6fa=_0x227b8e;_0x5a1c02[_0x656a('0x31')]=_['keys'](db[_0x656a('0x5d')][_0x656a('0x2f')]);_0x5a1c02['query']=_[_0x656a('0x34')](_0x3840bd[_0x656a('0x33')]);_0x5a1c02[_0x656a('0x35')]=_[_0x656a('0x36')](_0x5a1c02[_0x656a('0x31')],_0x5a1c02['query']);_0x536e4e['attributes']=_[_0x656a('0x36')](_0x5a1c02[_0x656a('0x31')],qs[_0x656a('0x38')](_0x3840bd[_0x656a('0x33')][_0x656a('0x38')]));_0x536e4e[_0x656a('0x37')]=_0x536e4e[_0x656a('0x37')][_0x656a('0x39')]?_0x536e4e[_0x656a('0x37')]:_0x5a1c02[_0x656a('0x31')];_0x536e4e[_0x656a('0x3c')]=qs[_0x656a('0x57')](_0x3840bd[_0x656a('0x33')][_0x656a('0x57')]);_0x536e4e[_0x656a('0x3d')]=qs[_0x656a('0x35')](_['pick'](_0x3840bd['query'],_0x5a1c02['filters']));if(_0x3840bd[_0x656a('0x33')][_0x656a('0x58')]){_0x536e4e[_0x656a('0x3d')]=_['merge'](_0x536e4e[_0x656a('0x3d')],{'$or':_[_0x656a('0x32')](_0x536e4e['attributes'],function(_0x3ec009){var _0x7d6431={};_0x7d6431[_0x3ec009]={'$like':'%'+_0x3840bd[_0x656a('0x33')][_0x656a('0x58')]+'%'};return _0x7d6431;})});}_0x536e4e=_[_0x656a('0x40')]({},_0x536e4e,_0x3840bd[_0x656a('0x41')]);return _0x3ca6fa['getActions'](_0x536e4e);}})[_0x656a('0x25')](function(_0x11a6d6){if(_0x11a6d6){_0x1ade90=_0x11a6d6[_0x656a('0x39')];if(!_0x3840bd[_0x656a('0x33')][_0x656a('0x3a')](_0x656a('0x3b'))){_0x536e4e['limit']=qs[_0x656a('0x1f')](_0x3840bd['query'][_0x656a('0x1f')]);_0x536e4e[_0x656a('0x1e')]=qs[_0x656a('0x1e')](_0x3840bd[_0x656a('0x33')][_0x656a('0x1e')]);}return _0x3ca6fa[_0x656a('0x5c')](_0x536e4e);}})['then'](function(_0x583ab7){if(_0x583ab7){return _0x583ab7?{'count':_0x1ade90,'rows':_0x583ab7}:null;}})[_0x656a('0x25')](respondWithResult(_0x43b8a1,null))[_0x656a('0x45')](handleError(_0x43b8a1,null));}; \ No newline at end of file +var _0xb6a3=['sox','to-csv','ejs','fs-extra','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','Triggers','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','params','keys','options','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x345e4c,_0x3e73ba){var _0x40c41c=function(_0x23dfe0){while(--_0x23dfe0){_0x345e4c['push'](_0x345e4c['shift']());}};_0x40c41c(++_0x3e73ba);}(_0xb6a3,0x103));var _0x3b6a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xb6a3[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x3b6a('0x0'));var rimraf=require(_0x3b6a('0x1'));var zipdir=require(_0x3b6a('0x2'));var jsonpatch=require(_0x3b6a('0x3'));var rp=require(_0x3b6a('0x4'));var moment=require(_0x3b6a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3b6a('0x6'));var util=require(_0x3b6a('0x7'));var path=require('path');var sox=require(_0x3b6a('0x8'));var csv=require(_0x3b6a('0x9'));var ejs=require(_0x3b6a('0xa'));var fs=require('fs');var fs_extra=require(_0x3b6a('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3b6a('0xc'));var toCsv=require(_0x3b6a('0x9'));var querystring=require(_0x3b6a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3b6a('0xe'));var qs=require(_0x3b6a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3b6a('0x10'));var logger=require('../../config/logger')(_0x3b6a('0x11'));var utils=require('../../config/utils');var config=require(_0x3b6a('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b6a('0x13'))['db'];function respondWithStatusCode(_0x3de3e6,_0x524218){_0x524218=_0x524218||0xcc;return function(_0x8b6cdc){if(_0x8b6cdc){return _0x3de3e6[_0x3b6a('0x14')](_0x524218);}return _0x3de3e6[_0x3b6a('0x15')](_0x524218)[_0x3b6a('0x16')]();};}function respondWithResult(_0x2cc744,_0x11c0c2){_0x11c0c2=_0x11c0c2||0xc8;return function(_0x4c33b1){if(_0x4c33b1){return _0x2cc744[_0x3b6a('0x15')](_0x11c0c2)[_0x3b6a('0x17')](_0x4c33b1);}};}function respondWithFilteredResult(_0x1612f9,_0x1b3497){return function(_0x3f9af0){if(_0x3f9af0){var _0x3573e2=typeof _0x1b3497[_0x3b6a('0x18')]===_0x3b6a('0x19')&&typeof _0x1b3497[_0x3b6a('0x1a')]==='undefined';var _0xd1bda9=_0x3f9af0['count'];var _0x5690c2=_0x3573e2?0x0:_0x1b3497[_0x3b6a('0x18')];var _0xff7463=_0x3573e2?_0x3f9af0[_0x3b6a('0x1b')]:_0x1b3497[_0x3b6a('0x18')]+_0x1b3497[_0x3b6a('0x1a')];var _0x2fd5f8;if(_0xff7463>=_0xd1bda9){_0xff7463=_0xd1bda9;_0x2fd5f8=0xc8;}else{_0x2fd5f8=0xce;}_0x1612f9[_0x3b6a('0x15')](_0x2fd5f8);return _0x1612f9[_0x3b6a('0x1c')](_0x3b6a('0x1d'),_0x5690c2+'-'+_0xff7463+'/'+_0xd1bda9)['json'](_0x3f9af0);}return null;};}function patchUpdates(_0x2f6ceb){return function(_0x5695a0){try{jsonpatch[_0x3b6a('0x1e')](_0x5695a0,_0x2f6ceb,!![]);}catch(_0x17daaa){return BPromise['reject'](_0x17daaa);}return _0x5695a0['save']();};}function saveUpdates(_0x415f8f,_0x44d73e){return function(_0x2f00a8){if(_0x2f00a8){return _0x2f00a8[_0x3b6a('0x1f')](_0x415f8f)[_0x3b6a('0x20')](function(_0x510517){return _0x510517;});}return null;};}function removeEntity(_0x685bdf,_0x4941e8){return function(_0xfa829b){if(_0xfa829b){return _0xfa829b[_0x3b6a('0x21')]()[_0x3b6a('0x20')](function(){var _0x9ee623=_0xfa829b['get']({'plain':!![]});var _0x55a0e8=_0x3b6a('0x22');return db['UserProfileResource'][_0x3b6a('0x21')]({'where':{'type':_0x55a0e8,'resourceId':_0x9ee623['id']}})['then'](function(){return _0xfa829b;});})[_0x3b6a('0x20')](function(){_0x685bdf[_0x3b6a('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x147ccd,_0x43d237){return function(_0x1984ae){if(!_0x1984ae){_0x147ccd[_0x3b6a('0x14')](0x194);}return _0x1984ae;};}function handleError(_0x558c1b,_0x2c1a4c){_0x2c1a4c=_0x2c1a4c||0x1f4;return function(_0x16d31f){logger[_0x3b6a('0x23')](_0x16d31f[_0x3b6a('0x24')]);if(_0x16d31f[_0x3b6a('0x25')]){delete _0x16d31f[_0x3b6a('0x25')];}_0x558c1b[_0x3b6a('0x15')](_0x2c1a4c)[_0x3b6a('0x26')](_0x16d31f);};}exports[_0x3b6a('0x27')]=function(_0x55d692,_0x4ed4cc){var _0x3aa94c={},_0x194255={},_0x481954={'count':0x0,'rows':[]};var _0x9c4811=_[_0x3b6a('0x28')](db[_0x3b6a('0x29')][_0x3b6a('0x2a')],function(_0x5b0da2){return{'name':_0x5b0da2[_0x3b6a('0x2b')],'type':_0x5b0da2[_0x3b6a('0x2c')]['key']};});_0x194255[_0x3b6a('0x2d')]=_[_0x3b6a('0x28')](_0x9c4811,'name');_0x194255[_0x3b6a('0x2e')]=_['keys'](_0x55d692[_0x3b6a('0x2e')]);_0x194255[_0x3b6a('0x2f')]=_[_0x3b6a('0x30')](_0x194255['model'],_0x194255['query']);_0x3aa94c['attributes']=_[_0x3b6a('0x30')](_0x194255[_0x3b6a('0x2d')],qs[_0x3b6a('0x31')](_0x55d692[_0x3b6a('0x2e')]['fields']));_0x3aa94c[_0x3b6a('0x32')]=_0x3aa94c[_0x3b6a('0x32')][_0x3b6a('0x33')]?_0x3aa94c['attributes']:_0x194255[_0x3b6a('0x2d')];if(!_0x55d692[_0x3b6a('0x2e')][_0x3b6a('0x34')](_0x3b6a('0x35'))){_0x3aa94c['limit']=qs['limit'](_0x55d692['query'][_0x3b6a('0x1a')]);_0x3aa94c[_0x3b6a('0x18')]=qs['offset'](_0x55d692['query']['offset']);}_0x3aa94c[_0x3b6a('0x36')]=qs[_0x3b6a('0x37')](_0x55d692['query'][_0x3b6a('0x37')]);_0x3aa94c[_0x3b6a('0x38')]=qs[_0x3b6a('0x2f')](_[_0x3b6a('0x39')](_0x55d692[_0x3b6a('0x2e')],_0x194255['filters']),_0x9c4811);if(_0x55d692[_0x3b6a('0x2e')][_0x3b6a('0x3a')]){_0x3aa94c[_0x3b6a('0x38')]=_[_0x3b6a('0x3b')](_0x3aa94c[_0x3b6a('0x38')],{'$or':_[_0x3b6a('0x28')](_0x9c4811,function(_0xe31670){if(_0xe31670[_0x3b6a('0x2c')]!==_0x3b6a('0x3c')){var _0x2bd862={};_0x2bd862[_0xe31670[_0x3b6a('0x25')]]={'$like':'%'+_0x55d692['query'][_0x3b6a('0x3a')]+'%'};return _0x2bd862;}})});}_0x3aa94c=_['merge']({},_0x3aa94c,_0x55d692['options']);var _0x2bedf7={'where':_0x3aa94c[_0x3b6a('0x38')]};return db[_0x3b6a('0x29')]['count'](_0x2bedf7)[_0x3b6a('0x20')](function(_0x54a05b){_0x481954['count']=_0x54a05b;if(_0x55d692[_0x3b6a('0x2e')]['includeAll']){_0x3aa94c[_0x3b6a('0x3d')]=[{'all':!![]}];}return db[_0x3b6a('0x29')][_0x3b6a('0x3e')](_0x3aa94c);})['then'](function(_0x4e371f){_0x481954[_0x3b6a('0x3f')]=_0x4e371f;return _0x481954;})[_0x3b6a('0x20')](respondWithFilteredResult(_0x4ed4cc,_0x3aa94c))[_0x3b6a('0x40')](handleError(_0x4ed4cc,null));};exports['show']=function(_0x2e8952,_0x21a6e5){var _0x1106a4={'raw':![],'where':{'id':_0x2e8952[_0x3b6a('0x41')]['id']}},_0x1dae9d={};_0x1dae9d[_0x3b6a('0x2d')]=_[_0x3b6a('0x42')](db['Trigger'][_0x3b6a('0x2a')]);_0x1dae9d[_0x3b6a('0x2e')]=_[_0x3b6a('0x42')](_0x2e8952[_0x3b6a('0x2e')]);_0x1dae9d['filters']=_[_0x3b6a('0x30')](_0x1dae9d[_0x3b6a('0x2d')],_0x1dae9d[_0x3b6a('0x2e')]);_0x1106a4['attributes']=_[_0x3b6a('0x30')](_0x1dae9d[_0x3b6a('0x2d')],qs[_0x3b6a('0x31')](_0x2e8952[_0x3b6a('0x2e')]['fields']));_0x1106a4[_0x3b6a('0x32')]=_0x1106a4[_0x3b6a('0x32')][_0x3b6a('0x33')]?_0x1106a4['attributes']:_0x1dae9d[_0x3b6a('0x2d')];if(_0x2e8952[_0x3b6a('0x2e')]['includeAll']){_0x1106a4[_0x3b6a('0x3d')]=[{'all':!![]}];}_0x1106a4=_[_0x3b6a('0x3b')]({},_0x1106a4,_0x2e8952[_0x3b6a('0x43')]);return db['Trigger']['find'](_0x1106a4)['then'](handleEntityNotFound(_0x21a6e5,null))[_0x3b6a('0x20')](respondWithResult(_0x21a6e5,null))[_0x3b6a('0x40')](handleError(_0x21a6e5,null));};exports['create']=function(_0x3b48d8,_0x4c36ec){return db[_0x3b6a('0x29')]['create'](_0x3b48d8[_0x3b6a('0x44')],{})[_0x3b6a('0x20')](function(_0x4d116f){var _0x2fea37=_0x3b48d8[_0x3b6a('0x45')]['get']({'plain':!![]});if(!_0x2fea37)throw new Error(_0x3b6a('0x46'));if(_0x2fea37[_0x3b6a('0x47')]==='user'){var _0x43022b=_0x4d116f[_0x3b6a('0x48')]({'plain':!![]});var _0x4fa8ad=_0x3b6a('0x22');return db[_0x3b6a('0x49')]['find']({'where':{'name':_0x4fa8ad,'userProfileId':_0x2fea37[_0x3b6a('0x4a')]},'raw':!![]})[_0x3b6a('0x20')](function(_0x358469){if(_0x358469&&_0x358469[_0x3b6a('0x4b')]===0x0){return db['UserProfileResource'][_0x3b6a('0x4c')]({'name':_0x43022b[_0x3b6a('0x25')],'resourceId':_0x43022b['id'],'type':_0x358469[_0x3b6a('0x25')],'sectionId':_0x358469['id']},{})[_0x3b6a('0x20')](function(){return _0x4d116f;});}else{return _0x4d116f;}})[_0x3b6a('0x40')](function(_0x2685d9){logger[_0x3b6a('0x23')](_0x3b6a('0x4d'),_0x2685d9);throw _0x2685d9;});}return _0x4d116f;})['then'](respondWithResult(_0x4c36ec,0xc9))[_0x3b6a('0x40')](handleError(_0x4c36ec,null));};exports[_0x3b6a('0x1f')]=function(_0x2a491c,_0xb451c4){if(_0x2a491c[_0x3b6a('0x44')]['id']){delete _0x2a491c[_0x3b6a('0x44')]['id'];}return db[_0x3b6a('0x29')][_0x3b6a('0x4e')]({'where':{'id':_0x2a491c[_0x3b6a('0x41')]['id']}})['then'](handleEntityNotFound(_0xb451c4,null))[_0x3b6a('0x20')](saveUpdates(_0x2a491c[_0x3b6a('0x44')],null))[_0x3b6a('0x20')](respondWithResult(_0xb451c4,null))[_0x3b6a('0x40')](handleError(_0xb451c4,null));};exports[_0x3b6a('0x21')]=function(_0x2fa0fc,_0x4d0031){return db[_0x3b6a('0x29')]['find']({'where':{'id':_0x2fa0fc['params']['id']}})[_0x3b6a('0x20')](handleEntityNotFound(_0x4d0031,null))[_0x3b6a('0x20')](removeEntity(_0x4d0031,null))['catch'](handleError(_0x4d0031,null));};exports['addAllCondition']=function(_0x342dea,_0x264b9a,_0x364ca6){if(_0x342dea[_0x3b6a('0x44')]['id']){delete _0x342dea[_0x3b6a('0x44')]['id'];}return db['Trigger'][_0x3b6a('0x4e')]({'where':{'id':_0x342dea[_0x3b6a('0x41')]['id']}})['then'](handleEntityNotFound(_0x264b9a,null))['then'](function(_0x4ecd07){if(_0x4ecd07){_0x342dea[_0x3b6a('0x44')][_0x3b6a('0x4f')]=_0x4ecd07['id'];return db[_0x3b6a('0x50')][_0x3b6a('0x4c')](_0x342dea[_0x3b6a('0x44')]);}})[_0x3b6a('0x20')](respondWithResult(_0x264b9a,null))[_0x3b6a('0x40')](handleError(_0x264b9a,null));};exports[_0x3b6a('0x51')]=function(_0x58a6d3,_0x538eb9,_0x16196b){if(_0x58a6d3[_0x3b6a('0x44')]['id']){delete _0x58a6d3['body']['id'];}return db[_0x3b6a('0x29')][_0x3b6a('0x4e')]({'where':{'id':_0x58a6d3[_0x3b6a('0x41')]['id']}})[_0x3b6a('0x20')](handleEntityNotFound(_0x538eb9,null))[_0x3b6a('0x20')](function(_0x59b03e){if(_0x59b03e){_0x58a6d3[_0x3b6a('0x44')]['TriggerAnyId']=_0x59b03e['id'];return db[_0x3b6a('0x50')][_0x3b6a('0x4c')](_0x58a6d3['body']);}})[_0x3b6a('0x20')](respondWithResult(_0x538eb9,null))['catch'](handleError(_0x538eb9,null));};exports[_0x3b6a('0x52')]=function(_0x1daa20,_0x2a9feb,_0x186ad2){var _0x469899={};var _0x412c17={};var _0x20cbff;var _0x2c0cc0;return db[_0x3b6a('0x29')][_0x3b6a('0x53')]({'where':{'id':_0x1daa20['params']['id']}})[_0x3b6a('0x20')](handleEntityNotFound(_0x2a9feb,null))[_0x3b6a('0x20')](function(_0x4d2678){if(_0x4d2678){_0x20cbff=_0x4d2678;_0x412c17['model']=_['keys'](db[_0x3b6a('0x50')][_0x3b6a('0x2a')]);_0x412c17[_0x3b6a('0x2e')]=_[_0x3b6a('0x42')](_0x1daa20[_0x3b6a('0x2e')]);_0x412c17[_0x3b6a('0x2f')]=_[_0x3b6a('0x30')](_0x412c17[_0x3b6a('0x2d')],_0x412c17['query']);_0x469899[_0x3b6a('0x32')]=_[_0x3b6a('0x30')](_0x412c17[_0x3b6a('0x2d')],qs[_0x3b6a('0x31')](_0x1daa20[_0x3b6a('0x2e')][_0x3b6a('0x31')]));_0x469899[_0x3b6a('0x32')]=_0x469899[_0x3b6a('0x32')]['length']?_0x469899[_0x3b6a('0x32')]:_0x412c17[_0x3b6a('0x2d')];_0x469899[_0x3b6a('0x36')]=qs[_0x3b6a('0x37')](_0x1daa20[_0x3b6a('0x2e')][_0x3b6a('0x37')]);_0x469899[_0x3b6a('0x38')]=qs[_0x3b6a('0x2f')](_[_0x3b6a('0x39')](_0x1daa20[_0x3b6a('0x2e')],_0x412c17[_0x3b6a('0x2f')]));if(_0x1daa20['query'][_0x3b6a('0x3a')]){_0x469899[_0x3b6a('0x38')]=_[_0x3b6a('0x3b')](_0x469899[_0x3b6a('0x38')],{'$or':_[_0x3b6a('0x28')](_0x469899[_0x3b6a('0x32')],function(_0x1839f1){var _0x37cc78={};_0x37cc78[_0x1839f1]={'$like':'%'+_0x1daa20[_0x3b6a('0x2e')][_0x3b6a('0x3a')]+'%'};return _0x37cc78;})});}_0x469899=_[_0x3b6a('0x3b')]({},_0x469899,_0x1daa20[_0x3b6a('0x43')]);return _0x20cbff[_0x3b6a('0x52')](_0x469899);}})[_0x3b6a('0x20')](function(_0x375f51){if(_0x375f51){_0x2c0cc0=_0x375f51['length'];if(!_0x1daa20[_0x3b6a('0x2e')]['hasOwnProperty']('nolimit')){_0x469899['limit']=qs[_0x3b6a('0x1a')](_0x1daa20[_0x3b6a('0x2e')][_0x3b6a('0x1a')]);_0x469899['offset']=qs[_0x3b6a('0x18')](_0x1daa20['query'][_0x3b6a('0x18')]);}return _0x20cbff[_0x3b6a('0x52')](_0x469899);}})['then'](function(_0x1c043d){if(_0x1c043d){return _0x1c043d?{'count':_0x2c0cc0,'rows':_0x1c043d}:null;}})[_0x3b6a('0x20')](respondWithResult(_0x2a9feb,null))['catch'](handleError(_0x2a9feb,null));};exports[_0x3b6a('0x54')]=function(_0x14700,_0x14d85c,_0x1ef0b9){var _0xcccacb={};var _0x1a4a9e={};var _0x3de939;var _0x8a4b72;return db[_0x3b6a('0x29')][_0x3b6a('0x53')]({'where':{'id':_0x14700[_0x3b6a('0x41')]['id']}})[_0x3b6a('0x20')](handleEntityNotFound(_0x14d85c,null))['then'](function(_0x4f4479){if(_0x4f4479){_0x3de939=_0x4f4479;_0x1a4a9e['model']=_['keys'](db['Condition'][_0x3b6a('0x2a')]);_0x1a4a9e[_0x3b6a('0x2e')]=_[_0x3b6a('0x42')](_0x14700[_0x3b6a('0x2e')]);_0x1a4a9e[_0x3b6a('0x2f')]=_[_0x3b6a('0x30')](_0x1a4a9e[_0x3b6a('0x2d')],_0x1a4a9e['query']);_0xcccacb[_0x3b6a('0x32')]=_[_0x3b6a('0x30')](_0x1a4a9e[_0x3b6a('0x2d')],qs[_0x3b6a('0x31')](_0x14700['query'][_0x3b6a('0x31')]));_0xcccacb[_0x3b6a('0x32')]=_0xcccacb[_0x3b6a('0x32')][_0x3b6a('0x33')]?_0xcccacb[_0x3b6a('0x32')]:_0x1a4a9e[_0x3b6a('0x2d')];_0xcccacb[_0x3b6a('0x36')]=qs[_0x3b6a('0x37')](_0x14700[_0x3b6a('0x2e')]['sort']);_0xcccacb[_0x3b6a('0x38')]=qs['filters'](_[_0x3b6a('0x39')](_0x14700[_0x3b6a('0x2e')],_0x1a4a9e[_0x3b6a('0x2f')]));if(_0x14700[_0x3b6a('0x2e')]['filter']){_0xcccacb['where']=_['merge'](_0xcccacb['where'],{'$or':_[_0x3b6a('0x28')](_0xcccacb['attributes'],function(_0x1eb07f){var _0x534727={};_0x534727[_0x1eb07f]={'$like':'%'+_0x14700['query'][_0x3b6a('0x3a')]+'%'};return _0x534727;})});}_0xcccacb=_['merge']({},_0xcccacb,_0x14700[_0x3b6a('0x43')]);return _0x3de939[_0x3b6a('0x54')](_0xcccacb);}})[_0x3b6a('0x20')](function(_0x3cb265){if(_0x3cb265){_0x8a4b72=_0x3cb265[_0x3b6a('0x33')];if(!_0x14700[_0x3b6a('0x2e')][_0x3b6a('0x34')](_0x3b6a('0x35'))){_0xcccacb[_0x3b6a('0x1a')]=qs[_0x3b6a('0x1a')](_0x14700['query']['limit']);_0xcccacb['offset']=qs[_0x3b6a('0x18')](_0x14700['query'][_0x3b6a('0x18')]);}return _0x3de939[_0x3b6a('0x54')](_0xcccacb);}})[_0x3b6a('0x20')](function(_0x4b28ee){if(_0x4b28ee){return _0x4b28ee?{'count':_0x8a4b72,'rows':_0x4b28ee}:null;}})[_0x3b6a('0x20')](respondWithResult(_0x14d85c,null))[_0x3b6a('0x40')](handleError(_0x14d85c,null));};exports[_0x3b6a('0x55')]=function(_0x2d8b51,_0x3b8557,_0x3d7b0b){if(_0x2d8b51[_0x3b6a('0x44')]['id']){delete _0x2d8b51[_0x3b6a('0x44')]['id'];}return db[_0x3b6a('0x29')][_0x3b6a('0x4e')]({'where':{'id':_0x2d8b51[_0x3b6a('0x41')]['id']}})['then'](handleEntityNotFound(_0x3b8557,null))[_0x3b6a('0x20')](function(_0x2090e3){if(_0x2090e3){_0x2d8b51[_0x3b6a('0x44')][_0x3b6a('0x56')]=_0x2090e3['id'];return db[_0x3b6a('0x57')][_0x3b6a('0x4c')](_0x2d8b51[_0x3b6a('0x44')]);}})[_0x3b6a('0x20')](respondWithResult(_0x3b8557,null))[_0x3b6a('0x40')](handleError(_0x3b8557,null));};exports['getActions']=function(_0x138468,_0x55bf1e,_0x1ffe80){var _0xc5d1e0={};var _0x197d54={};var _0x7708e5;var _0x10189f;return db['Trigger'][_0x3b6a('0x53')]({'where':{'id':_0x138468[_0x3b6a('0x41')]['id']}})[_0x3b6a('0x20')](handleEntityNotFound(_0x55bf1e,null))[_0x3b6a('0x20')](function(_0x3ed893){if(_0x3ed893){_0x7708e5=_0x3ed893;_0x197d54[_0x3b6a('0x2d')]=_[_0x3b6a('0x42')](db['Action'][_0x3b6a('0x2a')]);_0x197d54[_0x3b6a('0x2e')]=_[_0x3b6a('0x42')](_0x138468[_0x3b6a('0x2e')]);_0x197d54[_0x3b6a('0x2f')]=_[_0x3b6a('0x30')](_0x197d54[_0x3b6a('0x2d')],_0x197d54[_0x3b6a('0x2e')]);_0xc5d1e0[_0x3b6a('0x32')]=_[_0x3b6a('0x30')](_0x197d54[_0x3b6a('0x2d')],qs[_0x3b6a('0x31')](_0x138468['query'][_0x3b6a('0x31')]));_0xc5d1e0['attributes']=_0xc5d1e0[_0x3b6a('0x32')][_0x3b6a('0x33')]?_0xc5d1e0[_0x3b6a('0x32')]:_0x197d54[_0x3b6a('0x2d')];_0xc5d1e0['order']=qs['sort'](_0x138468[_0x3b6a('0x2e')]['sort']);_0xc5d1e0['where']=qs[_0x3b6a('0x2f')](_[_0x3b6a('0x39')](_0x138468[_0x3b6a('0x2e')],_0x197d54[_0x3b6a('0x2f')]));if(_0x138468[_0x3b6a('0x2e')]['filter']){_0xc5d1e0[_0x3b6a('0x38')]=_[_0x3b6a('0x3b')](_0xc5d1e0[_0x3b6a('0x38')],{'$or':_[_0x3b6a('0x28')](_0xc5d1e0[_0x3b6a('0x32')],function(_0x5163bf){var _0x309aa6={};_0x309aa6[_0x5163bf]={'$like':'%'+_0x138468[_0x3b6a('0x2e')][_0x3b6a('0x3a')]+'%'};return _0x309aa6;})});}_0xc5d1e0=_[_0x3b6a('0x3b')]({},_0xc5d1e0,_0x138468[_0x3b6a('0x43')]);return _0x7708e5[_0x3b6a('0x58')](_0xc5d1e0);}})['then'](function(_0x51014e){if(_0x51014e){_0x10189f=_0x51014e[_0x3b6a('0x33')];if(!_0x138468['query']['hasOwnProperty'](_0x3b6a('0x35'))){_0xc5d1e0['limit']=qs[_0x3b6a('0x1a')](_0x138468[_0x3b6a('0x2e')][_0x3b6a('0x1a')]);_0xc5d1e0[_0x3b6a('0x18')]=qs[_0x3b6a('0x18')](_0x138468[_0x3b6a('0x2e')][_0x3b6a('0x18')]);}return _0x7708e5[_0x3b6a('0x58')](_0xc5d1e0);}})[_0x3b6a('0x20')](function(_0x26d368){if(_0x26d368){return _0x26d368?{'count':_0x10189f,'rows':_0x26d368}:null;}})['then'](respondWithResult(_0x55bf1e,null))['catch'](handleError(_0x55bf1e,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 32243f4..030ed97 100644 --- a/server/api/trigger/trigger.model.js +++ b/server/api/trigger/trigger.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9585=['Trigger','tools_triggers','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','define'];(function(_0x50d0ad,_0x359285){var _0x53bdf3=function(_0x28a445){while(--_0x28a445){_0x50d0ad['push'](_0x50d0ad['shift']());}};_0x53bdf3(++_0x359285);}(_0x9585,0x15e));var _0x5958=function(_0x2a5b0c,_0x284c86){_0x2a5b0c=_0x2a5b0c-0x0;var _0x35e7dd=_0x9585[_0x2a5b0c];return _0x35e7dd;};'use strict';var _=require('lodash');var util=require(_0x5958('0x0'));var logger=require('../../config/logger')(_0x5958('0x1'));var moment=require(_0x5958('0x2'));var BPromise=require(_0x5958('0x3'));var rp=require(_0x5958('0x4'));var fs=require('fs');var path=require(_0x5958('0x5'));var rimraf=require(_0x5958('0x6'));var config=require(_0x5958('0x7'));var attributes=require(_0x5958('0x8'));module['exports']=function(_0x202d6f,_0x48ddaf){return _0x202d6f[_0x5958('0x9')](_0x5958('0xa'),attributes,{'tableName':_0x5958('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50b9=['./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0x50b9,0x171));var _0x950b=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0x50b9[_0x12bcf7];return _0x2825a;};'use strict';var _=require(_0x950b('0x0'));var util=require('util');var logger=require(_0x950b('0x1'))('api');var moment=require(_0x950b('0x2'));var BPromise=require(_0x950b('0x3'));var rp=require(_0x950b('0x4'));var fs=require('fs');var path=require(_0x950b('0x5'));var rimraf=require(_0x950b('0x6'));var config=require(_0x950b('0x7'));var attributes=require(_0x950b('0x8'));module[_0x950b('0x9')]=function(_0xc9024,_0x56ce3f){return _0xc9024[_0x950b('0xa')](_0x950b('0xb'),attributes,{'tableName':_0x950b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 8088495..a0fc344 100644 --- a/server/api/trigger/trigger.rpc.js +++ b/server/api/trigger/trigger.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x534b=['message','info','result','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrigger','find','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x512adb,_0x52d6bf){var _0x246a74=function(_0x45183c){while(--_0x45183c){_0x512adb['push'](_0x512adb['shift']());}};_0x246a74(++_0x52d6bf);}(_0x534b,0x1a8));var _0xb534=function(_0x1afacd,_0x5d41fb){_0x1afacd=_0x1afacd-0x0;var _0x194245=_0x534b[_0x1afacd];return _0x194245;};'use strict';var _=require(_0xb534('0x0'));var util=require(_0xb534('0x1'));var moment=require(_0xb534('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb534('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb534('0x4'));var logger=require(_0xb534('0x5'))(_0xb534('0x6'));var config=require(_0xb534('0x7'));var jayson=require(_0xb534('0x8'));var client=jayson[_0xb534('0x9')][_0xb534('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x467694,_0x141c5b,_0x24f052){return new BPromise(function(_0x4955eb,_0x338309){return client[_0xb534('0xb')](_0x467694,_0x24f052)[_0xb534('0xc')](function(_0x3ce5cf){logger['info'](_0xb534('0xd'),_0x141c5b,_0xb534('0xe'));logger[_0xb534('0xf')](_0xb534('0x10'),_0x141c5b,_0xb534('0xe'),JSON[_0xb534('0x11')](_0x3ce5cf));if(_0x3ce5cf[_0xb534('0x12')]){if(_0x3ce5cf[_0xb534('0x12')][_0xb534('0x13')]===0x1f4){logger['error'](_0xb534('0xd'),_0x141c5b,_0x3ce5cf[_0xb534('0x12')][_0xb534('0x14')]);return _0x338309(_0x3ce5cf[_0xb534('0x12')]['message']);}logger[_0xb534('0x12')](_0xb534('0xd'),_0x141c5b,_0x3ce5cf[_0xb534('0x12')]['message']);return _0x4955eb(_0x3ce5cf[_0xb534('0x12')]['message']);}else{logger[_0xb534('0x15')](_0xb534('0xd'),_0x141c5b,_0xb534('0xe'));_0x4955eb(_0x3ce5cf[_0xb534('0x16')][_0xb534('0x14')]);}})['catch'](function(_0x3c7a0e){logger[_0xb534('0x12')](_0xb534('0xd'),_0x141c5b,_0x3c7a0e);_0x338309(_0x3c7a0e);});});}exports[_0xb534('0x17')]=function(_0x706ab0){var _0x40d241=this;return new Promise(function(_0x55b9,_0x55ac50){return db[_0xb534('0x18')][_0xb534('0x19')]({'raw':_0x706ab0[_0xb534('0x1a')]?_0x706ab0['options'][_0xb534('0x1b')]===undefined?!![]:![]:!![],'where':_0x706ab0[_0xb534('0x1a')]?_0x706ab0[_0xb534('0x1a')][_0xb534('0x1c')]||null:null,'attributes':_0x706ab0[_0xb534('0x1a')]?_0x706ab0[_0xb534('0x1a')][_0xb534('0x1d')]||null:null,'limit':_0x706ab0[_0xb534('0x1a')]?_0x706ab0[_0xb534('0x1a')][_0xb534('0x1e')]||null:null,'include':_0x706ab0[_0xb534('0x1a')]?_0x706ab0[_0xb534('0x1a')][_0xb534('0x1f')]?_[_0xb534('0x20')](_0x706ab0[_0xb534('0x1a')][_0xb534('0x1f')],function(_0x537c27){return{'model':db[_0x537c27[_0xb534('0x21')]],'as':_0x537c27['as'],'attributes':_0x537c27[_0xb534('0x1d')],'include':_0x537c27['include']?_[_0xb534('0x20')](_0x537c27[_0xb534('0x1f')],function(_0x29c071){return{'model':db[_0x29c071[_0xb534('0x21')]],'as':_0x29c071['as'],'attributes':_0x29c071['attributes'],'include':_0x29c071[_0xb534('0x1f')]?_[_0xb534('0x20')](_0x29c071['include'],function(_0x59f3ee){return{'model':db[_0x59f3ee[_0xb534('0x21')]],'as':_0x59f3ee['as'],'attributes':_0x59f3ee[_0xb534('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5266e0){logger['info'](_0xb534('0x17'),_0x706ab0);logger['debug'](_0xb534('0x17'),_0x706ab0,JSON[_0xb534('0x11')](_0x5266e0));_0x55b9(_0x5266e0);})['catch'](function(_0x5caed8){logger[_0xb534('0x12')](_0xb534('0x17'),_0x5caed8[_0xb534('0x14')],_0x706ab0);_0x55ac50(_0x40d241[_0xb534('0x12')](0x1f4,_0x5caed8[_0xb534('0x14')]));});});};exports[_0xb534('0x22')]=function(_0x1d7fe6){var _0x351abb=this;return new Promise(function(_0x412df9,_0x3a1a11){return db['Trigger'][_0xb534('0x23')]({'raw':_0x1d7fe6[_0xb534('0x1a')]?_0x1d7fe6[_0xb534('0x1a')][_0xb534('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d7fe6[_0xb534('0x1a')]?_0x1d7fe6['options'][_0xb534('0x1c')]||null:null,'attributes':_0x1d7fe6['options']?_0x1d7fe6[_0xb534('0x1a')]['attributes']||null:null,'include':_0x1d7fe6[_0xb534('0x1a')]?_0x1d7fe6['options'][_0xb534('0x1f')]?_[_0xb534('0x20')](_0x1d7fe6[_0xb534('0x1a')][_0xb534('0x1f')],function(_0x50e190){return{'model':db[_0x50e190[_0xb534('0x21')]],'as':_0x50e190['as'],'attributes':_0x50e190['attributes'],'include':_0x50e190[_0xb534('0x1f')]?_[_0xb534('0x20')](_0x50e190[_0xb534('0x1f')],function(_0x1f654f){return{'model':db[_0x1f654f['model']],'as':_0x1f654f['as'],'attributes':_0x1f654f['attributes'],'include':_0x1f654f[_0xb534('0x1f')]?_['map'](_0x1f654f[_0xb534('0x1f')],function(_0xbf5293){return{'model':db[_0xbf5293[_0xb534('0x21')]],'as':_0xbf5293['as'],'attributes':_0xbf5293['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x427eaf){logger['info']('ShowTrigger',_0x1d7fe6);logger['debug']('ShowTrigger',_0x1d7fe6,JSON['stringify'](_0x427eaf));_0x412df9(_0x427eaf);})[_0xb534('0x24')](function(_0x452d37){logger[_0xb534('0x12')]('ShowTrigger',_0x452d37['message'],_0x1d7fe6);_0x3a1a11(_0x351abb[_0xb534('0x12')](0x1f4,_0x452d37[_0xb534('0x14')]));});});}; \ No newline at end of file +var _0xba1f=['rpc','http','request','then','info','Trigger,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','attributes','include','map','model','find','raw','ShowTrigger','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x180fda,_0x1af14f){var _0x3bddc9=function(_0x516a35){while(--_0x516a35){_0x180fda['push'](_0x180fda['shift']());}};_0x3bddc9(++_0x1af14f);}(_0xba1f,0x79));var _0xfba1=function(_0x58806c,_0x2e81c7){_0x58806c=_0x58806c-0x0;var _0x15ec56=_0xba1f[_0x58806c];return _0x15ec56;};'use strict';var _=require('lodash');var util=require(_0xfba1('0x0'));var moment=require(_0xfba1('0x1'));var BPromise=require(_0xfba1('0x2'));var rs=require(_0xfba1('0x3'));var fs=require('fs');var Redis=require(_0xfba1('0x4'));var db=require(_0xfba1('0x5'))['db'];var utils=require(_0xfba1('0x6'));var logger=require('../../config/logger')(_0xfba1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xfba1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2eab91,_0x41e6dc,_0x5d88d9){return new BPromise(function(_0x16e22f,_0x3a3450){return client[_0xfba1('0x9')](_0x2eab91,_0x5d88d9)[_0xfba1('0xa')](function(_0x45c907){logger[_0xfba1('0xb')](_0xfba1('0xc'),_0x41e6dc,'request\x20sent');logger[_0xfba1('0xd')]('Trigger,\x20%s,\x20%s,\x20%s',_0x41e6dc,_0xfba1('0xe'),JSON[_0xfba1('0xf')](_0x45c907));if(_0x45c907[_0xfba1('0x10')]){if(_0x45c907[_0xfba1('0x10')][_0xfba1('0x11')]===0x1f4){logger['error'](_0xfba1('0xc'),_0x41e6dc,_0x45c907[_0xfba1('0x10')][_0xfba1('0x12')]);return _0x3a3450(_0x45c907[_0xfba1('0x10')][_0xfba1('0x12')]);}logger[_0xfba1('0x10')](_0xfba1('0xc'),_0x41e6dc,_0x45c907[_0xfba1('0x10')][_0xfba1('0x12')]);return _0x16e22f(_0x45c907['error'][_0xfba1('0x12')]);}else{logger[_0xfba1('0xb')](_0xfba1('0xc'),_0x41e6dc,_0xfba1('0xe'));_0x16e22f(_0x45c907[_0xfba1('0x13')][_0xfba1('0x12')]);}})[_0xfba1('0x14')](function(_0x1c15c0){logger['error']('Trigger,\x20%s,\x20%s',_0x41e6dc,_0x1c15c0);_0x3a3450(_0x1c15c0);});});}exports[_0xfba1('0x15')]=function(_0x3936b7){var _0x156639=this;return new Promise(function(_0x145b69,_0x3df9a9){return db[_0xfba1('0x16')][_0xfba1('0x17')]({'raw':_0x3936b7[_0xfba1('0x18')]?_0x3936b7[_0xfba1('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3936b7[_0xfba1('0x18')]?_0x3936b7[_0xfba1('0x18')]['where']||null:null,'attributes':_0x3936b7[_0xfba1('0x18')]?_0x3936b7[_0xfba1('0x18')][_0xfba1('0x19')]||null:null,'limit':_0x3936b7[_0xfba1('0x18')]?_0x3936b7[_0xfba1('0x18')]['limit']||null:null,'include':_0x3936b7[_0xfba1('0x18')]?_0x3936b7[_0xfba1('0x18')][_0xfba1('0x1a')]?_['map'](_0x3936b7['options'][_0xfba1('0x1a')],function(_0x558e49){return{'model':db[_0x558e49['model']],'as':_0x558e49['as'],'attributes':_0x558e49[_0xfba1('0x19')],'include':_0x558e49[_0xfba1('0x1a')]?_[_0xfba1('0x1b')](_0x558e49[_0xfba1('0x1a')],function(_0x1181b7){return{'model':db[_0x1181b7[_0xfba1('0x1c')]],'as':_0x1181b7['as'],'attributes':_0x1181b7[_0xfba1('0x19')],'include':_0x1181b7[_0xfba1('0x1a')]?_[_0xfba1('0x1b')](_0x1181b7[_0xfba1('0x1a')],function(_0x377848){return{'model':db[_0x377848[_0xfba1('0x1c')]],'as':_0x377848['as'],'attributes':_0x377848[_0xfba1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfba1('0xa')](function(_0x36fc9b){logger['info'](_0xfba1('0x15'),_0x3936b7);logger['debug'](_0xfba1('0x15'),_0x3936b7,JSON[_0xfba1('0xf')](_0x36fc9b));_0x145b69(_0x36fc9b);})[_0xfba1('0x14')](function(_0xf3401c){logger[_0xfba1('0x10')]('GetTrigger',_0xf3401c['message'],_0x3936b7);_0x3df9a9(_0x156639['error'](0x1f4,_0xf3401c[_0xfba1('0x12')]));});});};exports['ShowTrigger']=function(_0x545ac3){var _0x293648=this;return new Promise(function(_0x20a00a,_0x48ecc3){return db[_0xfba1('0x16')][_0xfba1('0x1d')]({'raw':_0x545ac3[_0xfba1('0x18')]?_0x545ac3[_0xfba1('0x18')][_0xfba1('0x1e')]===undefined?!![]:![]:!![],'where':_0x545ac3['options']?_0x545ac3[_0xfba1('0x18')]['where']||null:null,'attributes':_0x545ac3[_0xfba1('0x18')]?_0x545ac3[_0xfba1('0x18')][_0xfba1('0x19')]||null:null,'include':_0x545ac3[_0xfba1('0x18')]?_0x545ac3[_0xfba1('0x18')][_0xfba1('0x1a')]?_[_0xfba1('0x1b')](_0x545ac3[_0xfba1('0x18')][_0xfba1('0x1a')],function(_0x10772c){return{'model':db[_0x10772c[_0xfba1('0x1c')]],'as':_0x10772c['as'],'attributes':_0x10772c['attributes'],'include':_0x10772c[_0xfba1('0x1a')]?_[_0xfba1('0x1b')](_0x10772c[_0xfba1('0x1a')],function(_0x246f70){return{'model':db[_0x246f70[_0xfba1('0x1c')]],'as':_0x246f70['as'],'attributes':_0x246f70[_0xfba1('0x19')],'include':_0x246f70[_0xfba1('0x1a')]?_[_0xfba1('0x1b')](_0x246f70[_0xfba1('0x1a')],function(_0x2d476e){return{'model':db[_0x2d476e[_0xfba1('0x1c')]],'as':_0x2d476e['as'],'attributes':_0x2d476e[_0xfba1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfba1('0xa')](function(_0x31a8d8){logger['info']('ShowTrigger',_0x545ac3);logger['debug'](_0xfba1('0x1f'),_0x545ac3,JSON[_0xfba1('0xf')](_0x31a8d8));_0x20a00a(_0x31a8d8);})[_0xfba1('0x14')](function(_0x1d5f3a){logger['error'](_0xfba1('0x1f'),_0x1d5f3a['message'],_0x545ac3);_0x48ecc3(_0x293648[_0xfba1('0x10')](0x1f4,_0x1d5f3a[_0xfba1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 4a04ad8..79da090 100644 --- a/server/api/trunk/index.js +++ b/server/api/trunk/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5acf=['multer','util','path','connect-timeout','express','../../components/auth/service','./trunk.controller','get','index','/:id','show','/:id/clone','clone','post','isAuthenticated','create','put','update','delete','destroy'];(function(_0x3ea9a4,_0x456ead){var _0x116803=function(_0x3fc35c){while(--_0x3fc35c){_0x3ea9a4['push'](_0x3ea9a4['shift']());}};_0x116803(++_0x456ead);}(_0x5acf,0x12c));var _0xf5ac=function(_0x182d72,_0x3a68dd){_0x182d72=_0x182d72-0x0;var _0x58280e=_0x5acf[_0x182d72];return _0x58280e;};'use strict';var multer=require(_0xf5ac('0x0'));var util=require(_0xf5ac('0x1'));var path=require(_0xf5ac('0x2'));var timeout=require(_0xf5ac('0x3'));var express=require(_0xf5ac('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf5ac('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5ac('0x6'));router[_0xf5ac('0x7')]('/',auth['isAuthenticated'](),controller[_0xf5ac('0x8')]);router[_0xf5ac('0x7')](_0xf5ac('0x9'),auth['isAuthenticated'](),controller[_0xf5ac('0xa')]);router['post'](_0xf5ac('0xb'),auth['isAuthenticated'](),controller[_0xf5ac('0xc')]);router[_0xf5ac('0xd')]('/',auth[_0xf5ac('0xe')](),controller[_0xf5ac('0xf')]);router[_0xf5ac('0x10')](_0xf5ac('0x9'),auth[_0xf5ac('0xe')](),controller[_0xf5ac('0x11')]);router[_0xf5ac('0x12')](_0xf5ac('0x9'),auth[_0xf5ac('0xe')](),controller[_0xf5ac('0x13')]);module['exports']=router; \ No newline at end of file +var _0x4f8e=['exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','show','clone','post','create','put','/:id','update','delete','destroy'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x4f8e,0x19f));var _0xe4f8=function(_0x505df9,_0x14138e){_0x505df9=_0x505df9-0x0;var _0x1cc025=_0x4f8e[_0x505df9];return _0x1cc025;};'use strict';var multer=require('multer');var util=require(_0xe4f8('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe4f8('0x1'));var router=express['Router']();var fs_extra=require(_0xe4f8('0x2'));var auth=require(_0xe4f8('0x3'));var interaction=require(_0xe4f8('0x4'));var config=require('../../config/environment');var controller=require(_0xe4f8('0x5'));router[_0xe4f8('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe4f8('0x6')]('/:id',auth[_0xe4f8('0x7')](),controller[_0xe4f8('0x8')]);router['post']('/:id/clone',auth[_0xe4f8('0x7')](),controller[_0xe4f8('0x9')]);router[_0xe4f8('0xa')]('/',auth['isAuthenticated'](),controller[_0xe4f8('0xb')]);router[_0xe4f8('0xc')](_0xe4f8('0xd'),auth['isAuthenticated'](),controller[_0xe4f8('0xe')]);router[_0xe4f8('0xf')](_0xe4f8('0xd'),auth[_0xe4f8('0x7')](),controller[_0xe4f8('0x10')]);module[_0xe4f8('0x11')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 40b17c8..baec660 100644 --- a/server/api/trunk/trunk.attributes.js +++ b/server/api/trunk/trunk.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x485a=['split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','certificate','active','passive','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','join','getDataValue','transport'];(function(_0x376453,_0x53cff8){var _0x227eb2=function(_0x8c70f6){while(--_0x8c70f6){_0x376453['push'](_0x376453['shift']());}};_0x227eb2(++_0x53cff8);}(_0x485a,0xeb));var _0xa485=function(_0x2c5eac,_0x319ede){_0x2c5eac=_0x2c5eac-0x0;var _0x13773d=_0x485a[_0x2c5eac];return _0x13773d;};'use strict';var Sequelize=require(_0xa485('0x0'));module[_0xa485('0x1')]={'name':{'type':Sequelize[_0xa485('0x2')],'allowNull':![],'unique':_0xa485('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x5'),_0xa485('0x6'),_0xa485('0x7')),'allowNull':![],'defaultValue':_0xa485('0x5')},'context':{'type':Sequelize[_0xa485('0x2')],'allowNull':![],'defaultValue':_0xa485('0x8')},'callingpres':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x9'),_0xa485('0xa'),_0xa485('0xb'),'ALLOWED',_0xa485('0xc'),_0xa485('0xd'),_0xa485('0xe'),'PROHIB')},'deny':{'type':Sequelize[_0xa485('0x2')]},'permit':{'type':Sequelize[_0xa485('0x2')]},'secret':{'type':Sequelize[_0xa485('0x2')]},'md5secret':{'type':Sequelize[_0xa485('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xa485('0x2')],'defaultValue':_0xa485('0xf'),'set':function(_0x49c4b9){this[_0xa485('0x10')]('transport',_0x49c4b9?_0x49c4b9[_0xa485('0x11')](','):null);},'get':function(){return this[_0xa485('0x12')](_0xa485('0x13'))?this[_0xa485('0x12')](_0xa485('0x13'))[_0xa485('0x14')](','):null;},'comment':_0xa485('0x15')},'dtmfmode':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x16'),'info',_0xa485('0x17'),'inband',_0xa485('0x18')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x19'),'no',_0xa485('0x1a'),_0xa485('0x1b'),_0xa485('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa485('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa485('0x2')]},'directmediadeny':{'type':Sequelize[_0xa485('0x2')]},'nat':{'type':Sequelize[_0xa485('0x2')],'defaultValue':_0xa485('0x1d'),'set':function(_0x2ca7c1){this[_0xa485('0x10')](_0xa485('0x1e'),_0x2ca7c1?_0x2ca7c1[_0xa485('0x11')](','):null);},'get':function(){return this['getDataValue']('nat')?this['getDataValue']('nat')[_0xa485('0x14')](','):null;},'comment':_0xa485('0x1f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xa485('0x2')]},'pickupgroup':{'type':Sequelize[_0xa485('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xa485('0x2')]},'language':{'type':Sequelize[_0xa485('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xa485('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xa485('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0xa485('0x2')],'allowNull':![],'defaultValue':_0xa485('0x20'),'set':function(_0x116063){this[_0xa485('0x10')](_0xa485('0x21'),_0x116063?_0x116063['join'](';'):_0xa485('0x20'));},'get':function(){return this[_0xa485('0x12')]('allow')?this[_0xa485('0x12')]('allow')[_0xa485('0x14')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xa485('0x19'),'no')},'insecure':{'type':Sequelize[_0xa485('0x2')],'defaultValue':_0xa485('0x22'),'set':function(_0x350837){this[_0xa485('0x10')]('insecure',_0x350837?_0x350837['join'](','):null);},'get':function(){return this[_0xa485('0x12')](_0xa485('0x23'))?this[_0xa485('0x12')](_0xa485('0x23'))[_0xa485('0x14')](','):null;},'comment':_0xa485('0x24')},'trustrpid':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa485('0x4')]('yes','no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0xa485('0x19'),'no')},'useclientcode':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x19'),'no')},'accountcode':{'type':Sequelize[_0xa485('0x25')](0xb)},'setvar':{'type':Sequelize[_0xa485('0x2')]},'callerid':{'type':Sequelize[_0xa485('0x2')],'defaultValue':_0xa485('0x26')},'amaflags':{'type':Sequelize[_0xa485('0x2')]},'callcounter':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x19'),'no'),'defaultValue':_0xa485('0x19')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0xa485('0x2')]},'template':{'type':Sequelize[_0xa485('0x2')]},'videosupport':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x19'),'no',_0xa485('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xa485('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x28'),_0xa485('0x29'),_0xa485('0x2a'))},'session_expires':{'type':Sequelize[_0xa485('0x25')](0xb)},'session_minse':{'type':Sequelize[_0xa485('0x25')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xa485('0x2b'),_0xa485('0x2c')),'defaultValue':_0xa485('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0xa485('0x2')]},'regexten':{'type':Sequelize[_0xa485('0x2')]},'fromdomain':{'type':Sequelize[_0xa485('0x2')]},'fromuser':{'type':Sequelize[_0xa485('0x2')]},'port':{'type':Sequelize[_0xa485('0x25')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xa485('0x19')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xa485('0x2')]},'defaultuser':{'type':Sequelize[_0xa485('0x2')]},'rtptimeout':{'type':Sequelize[_0xa485('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xa485('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x19'),'no',_0xa485('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa485('0x2')]},'callbackextension':{'type':Sequelize[_0xa485('0x2')]},'timert1':{'type':Sequelize[_0xa485('0x25')](0xb)},'timerb':{'type':Sequelize[_0xa485('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0xa485('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0xa485('0x2')]},'contactdeny':{'type':Sequelize[_0xa485('0x2')]},'contactacl':{'type':Sequelize[_0xa485('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xa485('0x2')]},'use_q850_reason':{'type':Sequelize[_0xa485('0x2')]},'maxforwards':{'type':Sequelize[_0xa485('0x25')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xa485('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize[_0xa485('0x4')]('yes','no')},'icesupport':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0xa485('0x4')]('yes','no','fingerprint',_0xa485('0x2e'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xa485('0x2')]},'dtlscipher':{'type':Sequelize[_0xa485('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xa485('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xa485('0x2f'),_0xa485('0x30'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa485('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0xa485('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa485('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xa485('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x19'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xa485('0x2')]},'mohsuggest':{'type':Sequelize[_0xa485('0x2')]},'parkinglot':{'type':Sequelize[_0xa485('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xa485('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xa485('0x4')](_0xa485('0x19'),'no','nonat',_0xa485('0x1b'),_0xa485('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xa485('0x2')]},'active':{'type':Sequelize[_0xa485('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xa485('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xdb4d=['all','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','\x22\x22\x20<>','INTEGER','accept','refuse','originate','uas','pai','fingerprint','certificate','active','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','udp','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','auto','nonat','update','outgoing','yes','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'];(function(_0x43edb1,_0x564880){var _0x926e84=function(_0x31fc2f){while(--_0x31fc2f){_0x43edb1['push'](_0x43edb1['shift']());}};_0x926e84(++_0x564880);}(_0xdb4d,0x1f2));var _0xddb4=function(_0x198a00,_0x54c679){_0x198a00=_0x198a00-0x0;var _0x5f595e=_0xdb4d[_0x198a00];return _0x5f595e;};'use strict';var Sequelize=require(_0xddb4('0x0'));module[_0xddb4('0x1')]={'name':{'type':Sequelize[_0xddb4('0x2')],'allowNull':![],'unique':_0xddb4('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xddb4('0x4')](_0xddb4('0x5'),_0xddb4('0x6'),_0xddb4('0x7')),'allowNull':![],'defaultValue':_0xddb4('0x5')},'context':{'type':Sequelize[_0xddb4('0x2')],'allowNull':![],'defaultValue':_0xddb4('0x8')},'callingpres':{'type':Sequelize['ENUM'](_0xddb4('0x9'),_0xddb4('0xa'),'ALLOWED_FAILED_SCREEN',_0xddb4('0xb'),_0xddb4('0xc'),_0xddb4('0xd'),'PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize[_0xddb4('0x2')]},'permit':{'type':Sequelize[_0xddb4('0x2')]},'secret':{'type':Sequelize[_0xddb4('0x2')]},'md5secret':{'type':Sequelize[_0xddb4('0x2')]},'remotesecret':{'type':Sequelize[_0xddb4('0x2')]},'transport':{'type':Sequelize[_0xddb4('0x2')],'defaultValue':_0xddb4('0xe'),'set':function(_0x2201fe){this['setDataValue'](_0xddb4('0xf'),_0x2201fe?_0x2201fe[_0xddb4('0x10')](','):null);},'get':function(){return this[_0xddb4('0x11')](_0xddb4('0xf'))?this['getDataValue'](_0xddb4('0xf'))[_0xddb4('0x12')](','):null;},'comment':_0xddb4('0x13')},'dtmfmode':{'type':Sequelize[_0xddb4('0x4')](_0xddb4('0x14'),'info','shortinfo','inband',_0xddb4('0x15')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xddb4('0x4')]('yes','no',_0xddb4('0x16'),_0xddb4('0x17'),_0xddb4('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xddb4('0x4')](_0xddb4('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xddb4('0x2')],'defaultValue':_0xddb4('0x1a'),'set':function(_0x2a7719){this[_0xddb4('0x1b')](_0xddb4('0x1c'),_0x2a7719?_0x2a7719[_0xddb4('0x10')](','):null);},'get':function(){return this[_0xddb4('0x11')]('nat')?this[_0xddb4('0x11')](_0xddb4('0x1c'))['split'](','):null;},'comment':_0xddb4('0x1d')},'callgroup':{'type':Sequelize[_0xddb4('0x2')]},'namedcallgroup':{'type':Sequelize[_0xddb4('0x2')]},'pickupgroup':{'type':Sequelize[_0xddb4('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xddb4('0x2')]},'language':{'type':Sequelize[_0xddb4('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xddb4('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xddb4('0x2')],'defaultValue':_0xddb4('0x1e')},'allow':{'type':Sequelize[_0xddb4('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3dae20){this[_0xddb4('0x1b')](_0xddb4('0x1f'),_0x3dae20?_0x3dae20['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xddb4('0x11')](_0xddb4('0x1f'))?this[_0xddb4('0x11')](_0xddb4('0x1f'))['split'](';'):null;},'comment':_0xddb4('0x20')},'autoframing':{'type':Sequelize[_0xddb4('0x4')](_0xddb4('0x19'),'no')},'insecure':{'type':Sequelize[_0xddb4('0x2')],'defaultValue':_0xddb4('0x21'),'set':function(_0x1e6229){this[_0xddb4('0x1b')](_0xddb4('0x22'),_0x1e6229?_0x1e6229['join'](','):null);},'get':function(){return this['getDataValue'](_0xddb4('0x22'))?this[_0xddb4('0x11')](_0xddb4('0x22'))[_0xddb4('0x12')](','):null;},'comment':_0xddb4('0x23')},'trustrpid':{'type':Sequelize[_0xddb4('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xddb4('0x4')](_0xddb4('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xddb4('0x4')](_0xddb4('0x19'),'no',_0xddb4('0x24'))},'promiscredir':{'type':Sequelize[_0xddb4('0x4')](_0xddb4('0x19'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xddb4('0x19'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xddb4('0x2')]},'callerid':{'type':Sequelize[_0xddb4('0x2')],'defaultValue':_0xddb4('0x25')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xddb4('0x4')](_0xddb4('0x19'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xddb4('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0xddb4('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0xddb4('0x4')](_0xddb4('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0xddb4('0x4')](_0xddb4('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0xddb4('0x4')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xddb4('0x2')]},'template':{'type':Sequelize[_0xddb4('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0xddb4('0x19'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xddb4('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xddb4('0x4')](_0xddb4('0x19'),'no')},'mailbox':{'type':Sequelize[_0xddb4('0x2')]},'session_timers':{'type':Sequelize[_0xddb4('0x4')](_0xddb4('0x27'),_0xddb4('0x28'),_0xddb4('0x29'))},'session_expires':{'type':Sequelize[_0xddb4('0x26')](0xb)},'session_minse':{'type':Sequelize[_0xddb4('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0xddb4('0x4')]('uac',_0xddb4('0x2a')),'defaultValue':_0xddb4('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0xddb4('0x2')]},'regexten':{'type':Sequelize[_0xddb4('0x2')]},'fromdomain':{'type':Sequelize[_0xddb4('0x2')]},'fromuser':{'type':Sequelize[_0xddb4('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xddb4('0x19'),'no'),'defaultValue':_0xddb4('0x19')},'keepalive':{'type':Sequelize[_0xddb4('0x26')](0xb)},'defaultip':{'type':Sequelize[_0xddb4('0x2')]},'defaultuser':{'type':Sequelize[_0xddb4('0x2')]},'rtptimeout':{'type':Sequelize[_0xddb4('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xddb4('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xddb4('0x4')]('yes','no',_0xddb4('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xddb4('0x2')]},'callbackextension':{'type':Sequelize[_0xddb4('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xddb4('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0xddb4('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0xddb4('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xddb4('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xddb4('0x2')]},'use_q850_reason':{'type':Sequelize[_0xddb4('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xddb4('0x4')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xddb4('0x4')](_0xddb4('0x19'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xddb4('0x19'),'no')},'icesupport':{'type':Sequelize[_0xddb4('0x4')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xddb4('0x4')](_0xddb4('0x19'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xddb4('0x19'),'no',_0xddb4('0x2c'),_0xddb4('0x2d'))},'dtlsrekey':{'type':Sequelize[_0xddb4('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0xddb4('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xddb4('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xddb4('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xddb4('0x4')](_0xddb4('0x2e'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xddb4('0x2')]},'usereqphone':{'type':Sequelize[_0xddb4('0x4')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xddb4('0x2')]},'recordofffeature':{'type':Sequelize[_0xddb4('0x2')]},'call_limit':{'type':Sequelize[_0xddb4('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xddb4('0x4')](_0xddb4('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0xddb4('0x4')](_0xddb4('0x19'),'no')},'vmexten':{'type':Sequelize[_0xddb4('0x2')]},'mohinterpret':{'type':Sequelize[_0xddb4('0x2')]},'mohsuggest':{'type':Sequelize[_0xddb4('0x2')]},'parkinglot':{'type':Sequelize[_0xddb4('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xddb4('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xddb4('0x4')](_0xddb4('0x19'),'no',_0xddb4('0x16'),_0xddb4('0x17'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xddb4('0x2')]},'otherFields':{'type':Sequelize[_0xddb4('0x2')]},'active':{'type':Sequelize[_0xddb4('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index ecfdc3d..6331eb4 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['userProfileId','autoAssociation','UserProfileResource','readFileSync','join','root','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','utf8','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','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/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','Trunks','stack','name','send','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','options','Trunk','includeAll','include','findAll','rows','show','params','rawAttributes','merge','find','catch','clone','omit','createdAt','updatedAt','create','body','get','role','UserProfileSection'];(function(_0x458dc1,_0x56a907){var _0x35ab83=function(_0x2727de){while(--_0x2727de){_0x458dc1['push'](_0x458dc1['shift']());}};_0x35ab83(++_0x56a907);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3dc21f,_0x10070f){_0x3dc21f=_0x3dc21f-0x0;var _0x4192a8=_0x8ef6[_0x3dc21f];return _0x4192a8;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];var jayson=require(_0x68ef('0x1b'));var client=jayson[_0x68ef('0x1c')][_0x68ef('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x288cc9,_0x508671,_0x3b48dd,_0xc50cce){return new BPromise(function(_0x2657c5,_0x47fbb5){var _0x22fe96=_0xc50cce||client;return _0x22fe96[_0x68ef('0x1e')](_0x288cc9,_0x3b48dd)[_0x68ef('0x1f')](function(_0x5005ba){logger[_0x68ef('0x20')](_0x68ef('0x21'),_0x508671,_0x68ef('0x22'));logger[_0x68ef('0x23')]('Trunk,\x20%s,\x20%s,\x20%s',_0x508671,_0x68ef('0x22'),JSON['stringify'](_0x5005ba));if(_0x5005ba['error']){if(_0x5005ba[_0x68ef('0x24')][_0x68ef('0x25')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x508671,_0x5005ba[_0x68ef('0x24')][_0x68ef('0x26')]);return _0x47fbb5(_0x5005ba[_0x68ef('0x24')]['message']);}logger[_0x68ef('0x24')](_0x68ef('0x21'),_0x508671,_0x5005ba[_0x68ef('0x24')]['message']);return _0x2657c5(_0x5005ba[_0x68ef('0x24')][_0x68ef('0x26')]);}else{logger['info'](_0x68ef('0x21'),_0x508671,_0x68ef('0x22'));_0x2657c5(_0x5005ba[_0x68ef('0x27')]['message']);}})['catch'](function(_0x59bebc){logger[_0x68ef('0x24')](_0x68ef('0x21'),_0x508671,_0x59bebc);_0x47fbb5(_0x59bebc);});});}function respondWithStatusCode(_0x312cc9,_0x2e6e39){_0x2e6e39=_0x2e6e39||0xcc;return function(_0x438b4c){if(_0x438b4c){return _0x312cc9[_0x68ef('0x28')](_0x2e6e39);}return _0x312cc9[_0x68ef('0x29')](_0x2e6e39)[_0x68ef('0x2a')]();};}function respondWithResult(_0x65fd09,_0x13280b){_0x13280b=_0x13280b||0xc8;return function(_0x5e4dbe){if(_0x5e4dbe){return _0x65fd09[_0x68ef('0x29')](_0x13280b)['json'](_0x5e4dbe);}};}function respondWithFilteredResult(_0x599243,_0x55d8b0){return function(_0x1a7ce1){if(_0x1a7ce1){var _0x268f32=typeof _0x55d8b0[_0x68ef('0x2b')]===_0x68ef('0x2c')&&typeof _0x55d8b0['limit']==='undefined';var _0x1cbe4f=_0x1a7ce1[_0x68ef('0x2d')];var _0x7bf96=_0x268f32?0x0:_0x55d8b0[_0x68ef('0x2b')];var _0x22ef25=_0x268f32?_0x1a7ce1[_0x68ef('0x2d')]:_0x55d8b0[_0x68ef('0x2b')]+_0x55d8b0[_0x68ef('0x2e')];var _0x5a6dfd;if(_0x22ef25>=_0x1cbe4f){_0x22ef25=_0x1cbe4f;_0x5a6dfd=0xc8;}else{_0x5a6dfd=0xce;}_0x599243[_0x68ef('0x29')](_0x5a6dfd);return _0x599243[_0x68ef('0x2f')](_0x68ef('0x30'),_0x7bf96+'-'+_0x22ef25+'/'+_0x1cbe4f)['json'](_0x1a7ce1);}return null;};}function patchUpdates(_0x370a8f){return function(_0x523120){try{jsonpatch[_0x68ef('0x31')](_0x523120,_0x370a8f,!![]);}catch(_0x17588a){return BPromise['reject'](_0x17588a);}return _0x523120['save']();};}function saveUpdates(_0x159395,_0x5fa72a){return function(_0x4b8fc8){if(_0x4b8fc8){return _0x4b8fc8[_0x68ef('0x32')](_0x159395)[_0x68ef('0x1f')](function(_0x2d67be){return _0x2d67be;});}return null;};}function removeEntity(_0x2d1e9f,_0x59e9fb){return function(_0x2c8bd0){if(_0x2c8bd0){return _0x2c8bd0[_0x68ef('0x33')]()['then'](function(){var _0x2f8de2=_0x2c8bd0['get']({'plain':!![]});var _0x14581d=_0x68ef('0x34');return db['UserProfileResource'][_0x68ef('0x33')]({'where':{'type':_0x14581d,'resourceId':_0x2f8de2['id']}})['then'](function(){return _0x2c8bd0;});})[_0x68ef('0x1f')](function(){_0x2d1e9f['status'](0xcc)[_0x68ef('0x2a')]();});}};}function handleEntityNotFound(_0x1444e0,_0x798276){return function(_0x569949){if(!_0x569949){_0x1444e0[_0x68ef('0x28')](0x194);}return _0x569949;};}function handleError(_0x485dc3,_0x476938){_0x476938=_0x476938||0x1f4;return function(_0x4c9506){logger[_0x68ef('0x24')](_0x4c9506[_0x68ef('0x35')]);if(_0x4c9506[_0x68ef('0x36')]){delete _0x4c9506[_0x68ef('0x36')];}_0x485dc3[_0x68ef('0x29')](_0x476938)[_0x68ef('0x37')](_0x4c9506);};}exports['index']=function(_0x294fba,_0x15a6ab){var _0x32074a={},_0x52a8b9={},_0x32eddd={'count':0x0,'rows':[]};var _0x3c5de6=_[_0x68ef('0x38')](db['Trunk']['rawAttributes'],function(_0x14f0fc){return{'name':_0x14f0fc[_0x68ef('0x39')],'type':_0x14f0fc[_0x68ef('0x3a')][_0x68ef('0x3b')]};});_0x52a8b9[_0x68ef('0x3c')]=_[_0x68ef('0x38')](_0x3c5de6,_0x68ef('0x36'));_0x52a8b9['query']=_[_0x68ef('0x3d')](_0x294fba[_0x68ef('0x3e')]);_0x52a8b9[_0x68ef('0x3f')]=_[_0x68ef('0x40')](_0x52a8b9['model'],_0x52a8b9[_0x68ef('0x3e')]);_0x32074a[_0x68ef('0x41')]=_[_0x68ef('0x40')](_0x52a8b9[_0x68ef('0x3c')],qs[_0x68ef('0x42')](_0x294fba[_0x68ef('0x3e')]['fields']));_0x32074a[_0x68ef('0x41')]=_0x32074a[_0x68ef('0x41')][_0x68ef('0x43')]?_0x32074a[_0x68ef('0x41')]:_0x52a8b9[_0x68ef('0x3c')];if(!_0x294fba[_0x68ef('0x3e')][_0x68ef('0x44')](_0x68ef('0x45'))){_0x32074a[_0x68ef('0x2e')]=qs['limit'](_0x294fba[_0x68ef('0x3e')][_0x68ef('0x2e')]);_0x32074a[_0x68ef('0x2b')]=qs[_0x68ef('0x2b')](_0x294fba[_0x68ef('0x3e')][_0x68ef('0x2b')]);}_0x32074a[_0x68ef('0x46')]=qs['sort'](_0x294fba[_0x68ef('0x3e')]['sort']);_0x32074a[_0x68ef('0x47')]=qs[_0x68ef('0x3f')](_[_0x68ef('0x48')](_0x294fba[_0x68ef('0x3e')],_0x52a8b9['filters']),_0x3c5de6);if(_0x294fba[_0x68ef('0x3e')]['filter']){_0x32074a[_0x68ef('0x47')]=_['merge'](_0x32074a[_0x68ef('0x47')],{'$or':_[_0x68ef('0x38')](_0x3c5de6,function(_0x105e8c){if(_0x105e8c['type']!=='VIRTUAL'){var _0x4044d5={};_0x4044d5[_0x105e8c[_0x68ef('0x36')]]={'$like':'%'+_0x294fba['query']['filter']+'%'};return _0x4044d5;}})});}_0x32074a=_['merge']({},_0x32074a,_0x294fba[_0x68ef('0x49')]);var _0x15c753={'where':_0x32074a[_0x68ef('0x47')]};return db[_0x68ef('0x4a')][_0x68ef('0x2d')](_0x15c753)['then'](function(_0x55f385){_0x32eddd[_0x68ef('0x2d')]=_0x55f385;if(_0x294fba[_0x68ef('0x3e')][_0x68ef('0x4b')]){_0x32074a[_0x68ef('0x4c')]=[{'all':!![]}];}return db['Trunk'][_0x68ef('0x4d')](_0x32074a);})[_0x68ef('0x1f')](function(_0x1c9b6f){_0x32eddd[_0x68ef('0x4e')]=_0x1c9b6f;return _0x32eddd;})['then'](respondWithFilteredResult(_0x15a6ab,_0x32074a))['catch'](handleError(_0x15a6ab,null));};exports[_0x68ef('0x4f')]=function(_0x3c3074,_0x566e7c){var _0xfc7a74={'raw':![],'where':{'id':_0x3c3074[_0x68ef('0x50')]['id']}},_0x12fff3={};_0x12fff3[_0x68ef('0x3c')]=_[_0x68ef('0x3d')](db['Trunk'][_0x68ef('0x51')]);_0x12fff3[_0x68ef('0x3e')]=_[_0x68ef('0x3d')](_0x3c3074['query']);_0x12fff3[_0x68ef('0x3f')]=_[_0x68ef('0x40')](_0x12fff3[_0x68ef('0x3c')],_0x12fff3['query']);_0xfc7a74[_0x68ef('0x41')]=_['intersection'](_0x12fff3['model'],qs[_0x68ef('0x42')](_0x3c3074['query'][_0x68ef('0x42')]));_0xfc7a74[_0x68ef('0x41')]=_0xfc7a74[_0x68ef('0x41')][_0x68ef('0x43')]?_0xfc7a74[_0x68ef('0x41')]:_0x12fff3[_0x68ef('0x3c')];if(_0x3c3074[_0x68ef('0x3e')][_0x68ef('0x4b')]){_0xfc7a74[_0x68ef('0x4c')]=[{'all':!![]}];}_0xfc7a74=_[_0x68ef('0x52')]({},_0xfc7a74,_0x3c3074['options']);return db['Trunk'][_0x68ef('0x53')](_0xfc7a74)[_0x68ef('0x1f')](handleEntityNotFound(_0x566e7c,null))[_0x68ef('0x1f')](respondWithResult(_0x566e7c,null))[_0x68ef('0x54')](handleError(_0x566e7c,null));};exports[_0x68ef('0x55')]=function(_0x1d11d7,_0x15400c){var _0x300a64={'where':{'id':_0x1d11d7['params']['id']}},_0x40c784={};_0x40c784['model']=_[_0x68ef('0x3d')](db['Trunk'][_0x68ef('0x51')]);_0x300a64['attributes']=_[_0x68ef('0x40')](_0x40c784[_0x68ef('0x3c')],qs['fields'](_0x1d11d7[_0x68ef('0x3e')]['fields']));_0x300a64[_0x68ef('0x41')]=_0x300a64[_0x68ef('0x41')][_0x68ef('0x43')]?_0x300a64[_0x68ef('0x41')]:_0x40c784[_0x68ef('0x3c')];if(_0x1d11d7[_0x68ef('0x3e')]['includeAll']){_0x300a64[_0x68ef('0x4c')]=[{'all':!![]}];}_0x300a64=_[_0x68ef('0x52')]({},_0x300a64,_0x1d11d7[_0x68ef('0x49')]);return db[_0x68ef('0x4a')][_0x68ef('0x53')](_0x300a64)[_0x68ef('0x1f')](handleEntityNotFound(_0x15400c,null))['then'](function(_0x9a978f){if(_0x9a978f){var _0x42d2a3=_0x9a978f['get']({'plain':!![]});_0x42d2a3=qs[_0x68ef('0x56')](_0x42d2a3,['id',_0x68ef('0x57'),_0x68ef('0x58')]);_0x1d11d7['body']=_[_0x68ef('0x56')](_0x1d11d7['body'],['id','createdAt',_0x68ef('0x58')]);return db['Trunk'][_0x68ef('0x59')](_['merge'](_0x42d2a3,_0x1d11d7[_0x68ef('0x5a')]),{'include':_0x1d11d7[_0x68ef('0x3e')][_0x68ef('0x4b')]?[{'all':!![]}]:undefined})[_0x68ef('0x1f')](function(_0x19ce17){var _0x19a9c4=_0x1d11d7['user'][_0x68ef('0x5b')]({'plain':!![]});if(!_0x19a9c4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19a9c4[_0x68ef('0x5c')]==='user'){var _0x2f97c5=_0x19ce17[_0x68ef('0x5b')]({'plain':!![]});var _0x212ec4=_0x68ef('0x34');return db[_0x68ef('0x5d')][_0x68ef('0x53')]({'where':{'name':_0x212ec4,'userProfileId':_0x19a9c4[_0x68ef('0x5e')]},'raw':!![]})['then'](function(_0x3ea4e7){if(_0x3ea4e7&&_0x3ea4e7[_0x68ef('0x5f')]===0x0){return db[_0x68ef('0x60')][_0x68ef('0x59')]({'name':_0x2f97c5[_0x68ef('0x36')],'resourceId':_0x2f97c5['id'],'type':_0x3ea4e7['name'],'sectionId':_0x3ea4e7['id']},{})[_0x68ef('0x1f')](function(){return _0x19ce17;});}else{return _0x19ce17;}})['catch'](function(_0x1ed172){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ed172);throw _0x1ed172;});}return _0x19ce17;});}})[_0x68ef('0x1f')](respondWithResult(_0x15400c,0xc9))[_0x68ef('0x54')](handleError(_0x15400c,null));};exports[_0x68ef('0x59')]=function(_0x21b2ce,_0x51f905,_0x124b49){var _0x570e0c;return db[_0x68ef('0x4a')][_0x68ef('0x59')](_0x21b2ce[_0x68ef('0x5a')],{'raw':!![]})['then'](function(_0x541e35){_0x570e0c=_0x541e35;return db[_0x68ef('0x4a')][_0x68ef('0x4d')]({'raw':!![]});})[_0x68ef('0x1f')](function(_0x454c6f){var _0x5b41e1=fs[_0x68ef('0x61')](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x64')),'utf8');var _0x3f56a7=fs['readFileSync'](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x65')),_0x68ef('0x66'));var _0xed16d1=ejs['render'](_0x5b41e1,{'trunks':_0x454c6f||[]});fs[_0x68ef('0x67')](_0x68ef('0x68'),_0xed16d1);if(_0x570e0c[_0x68ef('0x69')]){var _0x595e79=ejs[_0x68ef('0x6a')](_0x3f56a7,{'trunks':_0x454c6f||[]});fs['writeFileSync'](_0x68ef('0x6b'),_0x595e79);}})['then'](function(){return respondWithRpcPromise('Reload',_0x68ef('0x59'),{'module':_0x68ef('0x6c')});})[_0x68ef('0x1f')](function(){var _0x405971=_0x21b2ce['user'][_0x68ef('0x5b')]({'plain':!![]});if(!_0x405971)throw new Error(_0x68ef('0x6d'));if(_0x405971[_0x68ef('0x5c')]==='user'){var _0x3e14a4=_0x570e0c[_0x68ef('0x5b')]({'plain':!![]});return db[_0x68ef('0x5d')][_0x68ef('0x53')]({'where':{'name':_0x68ef('0x34'),'userProfileId':_0x405971[_0x68ef('0x5e')]},'raw':!![]})[_0x68ef('0x1f')](function(_0xfe72dc){if(_0xfe72dc&&_0xfe72dc[_0x68ef('0x5f')]===0x0){return db[_0x68ef('0x60')][_0x68ef('0x59')]({'name':_0x3e14a4[_0x68ef('0x36')],'resourceId':_0x3e14a4['id'],'type':_0xfe72dc['name'],'sectionId':_0xfe72dc['id']},{})[_0x68ef('0x1f')](function(){return _0x570e0c;});}else{return _0x570e0c;}})[_0x68ef('0x54')](function(_0x5db443){logger['error'](_0x68ef('0x6e'),_0x5db443);throw _0x5db443;});}return _0x570e0c;})['then'](respondWithResult(_0x51f905,0xc9))[_0x68ef('0x54')](handleError(_0x51f905,null));};exports[_0x68ef('0x32')]=function(_0x5f1b12,_0x4e0874,_0x31a336){var _0x5c500c;return db[_0x68ef('0x4a')]['find']({'where':{'id':_0x5f1b12[_0x68ef('0x50')]['id']}})['then'](handleEntityNotFound(_0x4e0874,null))[_0x68ef('0x1f')](saveUpdates(_0x5f1b12[_0x68ef('0x5a')],null))['then'](function(_0x3c5e35){if(_0x3c5e35){_0x5c500c=_0x3c5e35;return db[_0x68ef('0x4a')][_0x68ef('0x4d')]({'raw':!![]});}})[_0x68ef('0x1f')](function(_0x50c308){if(_0x50c308){var _0x2bebdc=fs[_0x68ef('0x61')](path['join'](config[_0x68ef('0x63')],_0x68ef('0x64')),_0x68ef('0x66'));var _0x4de1d1=fs[_0x68ef('0x61')](path['join'](config[_0x68ef('0x63')],_0x68ef('0x65')),'utf8');var _0x4b0fb4=ejs['render'](_0x2bebdc,{'trunks':_0x50c308||[]});fs['writeFileSync'](_0x68ef('0x68'),_0x4b0fb4);var _0x28ad22=ejs[_0x68ef('0x6a')](_0x4de1d1,{'trunks':_0x50c308||[]});fs[_0x68ef('0x67')](_0x68ef('0x6b'),_0x28ad22);return respondWithRpcPromise(_0x68ef('0x6f'),_0x68ef('0x32'),{'module':_0x68ef('0x6c')});}return null;})[_0x68ef('0x1f')](function(_0x3ae3e9){if(_0x3ae3e9){return _0x5c500c;}})[_0x68ef('0x1f')](respondWithResult(_0x4e0874,null))[_0x68ef('0x54')](handleError(_0x4e0874,null));};exports[_0x68ef('0x33')]=function(_0x4bd5c3,_0x2b20dc,_0x556dfc){var _0x791181;return db['Trunk']['find']({'where':{'id':_0x4bd5c3[_0x68ef('0x50')]['id']}})[_0x68ef('0x1f')](handleEntityNotFound(_0x2b20dc,null))[_0x68ef('0x1f')](removeEntity(_0x2b20dc,null))[_0x68ef('0x1f')](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0x68ef('0x1f')](function(_0x308997){var _0x1f1dfd=fs['readFileSync'](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x64')),_0x68ef('0x66'));var _0x4dc885=fs[_0x68ef('0x61')](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x65')),_0x68ef('0x66'));var _0x346049=ejs['render'](_0x1f1dfd,{'trunks':_0x308997});var _0x2a72e8=ejs['render'](_0x4dc885,{'trunks':_0x308997});fs[_0x68ef('0x67')](_0x68ef('0x68'),_0x346049);fs[_0x68ef('0x67')](_0x68ef('0x6b'),_0x2a72e8);return respondWithRpcPromise('Reload',_0x68ef('0x33'),{'module':'chan_sip.so'});})[_0x68ef('0x54')](handleError(_0x2b20dc,null));}; \ No newline at end of file +var _0x9f62=['updatedAt','body','create','user','role','UserProfileSection','autoAssociation','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','render','/etc/asterisk/sip_xcally_trunks.conf','Reload','server/files/templates/registry.ejs','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','get','Trunks','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','key','map','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','Trunk','findAll','rows','show','params','clone','find','omit','createdAt'];(function(_0x48c938,_0x14ac2c){var _0x5625b2=function(_0x3edffd){while(--_0x3edffd){_0x48c938['push'](_0x48c938['shift']());}};_0x5625b2(++_0x14ac2c);}(_0x9f62,0x154));var _0x29f6=function(_0x7c4fe4,_0x51a200){_0x7c4fe4=_0x7c4fe4-0x0;var _0x2facef=_0x9f62[_0x7c4fe4];return _0x2facef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x29f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29f6('0x1'));var rp=require(_0x29f6('0x2'));var moment=require(_0x29f6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x29f6('0x4'));var path=require(_0x29f6('0x5'));var sox=require(_0x29f6('0x6'));var csv=require(_0x29f6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29f6('0x8'));var _=require(_0x29f6('0x9'));var squel=require(_0x29f6('0xa'));var crypto=require(_0x29f6('0xb'));var jsforce=require(_0x29f6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x29f6('0xd'));var authService=require(_0x29f6('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29f6('0xf'));var logger=require(_0x29f6('0x10'))('api');var utils=require(_0x29f6('0x11'));var config=require(_0x29f6('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x29f6('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x55cf4,_0x189344,_0x11a1fd,_0x17de6e){return new BPromise(function(_0x156c96,_0x35d2e2){var _0x2418ee=_0x17de6e||client;return _0x2418ee[_0x29f6('0x14')](_0x55cf4,_0x11a1fd)[_0x29f6('0x15')](function(_0x28d314){logger[_0x29f6('0x16')](_0x29f6('0x17'),_0x189344,_0x29f6('0x18'));logger[_0x29f6('0x19')](_0x29f6('0x1a'),_0x189344,_0x29f6('0x18'),JSON['stringify'](_0x28d314));if(_0x28d314['error']){if(_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1c')]===0x1f4){logger[_0x29f6('0x1b')]('Trunk,\x20%s,\x20%s',_0x189344,_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x35d2e2(_0x28d314['error'][_0x29f6('0x1d')]);}logger[_0x29f6('0x1b')](_0x29f6('0x17'),_0x189344,_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x156c96(_0x28d314[_0x29f6('0x1b')]['message']);}else{logger[_0x29f6('0x16')]('Trunk,\x20%s,\x20%s',_0x189344,'request\x20sent');_0x156c96(_0x28d314[_0x29f6('0x1e')][_0x29f6('0x1d')]);}})[_0x29f6('0x1f')](function(_0xafb5dd){logger['error'](_0x29f6('0x17'),_0x189344,_0xafb5dd);_0x35d2e2(_0xafb5dd);});});}function respondWithStatusCode(_0x49f67d,_0xd4179c){_0xd4179c=_0xd4179c||0xcc;return function(_0xcce041){if(_0xcce041){return _0x49f67d[_0x29f6('0x20')](_0xd4179c);}return _0x49f67d[_0x29f6('0x21')](_0xd4179c)['end']();};}function respondWithResult(_0x4290a2,_0x4d494f){_0x4d494f=_0x4d494f||0xc8;return function(_0x47c385){if(_0x47c385){return _0x4290a2[_0x29f6('0x21')](_0x4d494f)[_0x29f6('0x22')](_0x47c385);}};}function respondWithFilteredResult(_0x2519ac,_0x342038){return function(_0x84ccb7){if(_0x84ccb7){var _0x4333bc=typeof _0x342038[_0x29f6('0x23')]==='undefined'&&typeof _0x342038[_0x29f6('0x24')]===_0x29f6('0x25');var _0x1ab8d8=_0x84ccb7[_0x29f6('0x26')];var _0xda0a63=_0x4333bc?0x0:_0x342038[_0x29f6('0x23')];var _0x3790f5=_0x4333bc?_0x84ccb7[_0x29f6('0x26')]:_0x342038[_0x29f6('0x23')]+_0x342038[_0x29f6('0x24')];var _0x2915bc;if(_0x3790f5>=_0x1ab8d8){_0x3790f5=_0x1ab8d8;_0x2915bc=0xc8;}else{_0x2915bc=0xce;}_0x2519ac[_0x29f6('0x21')](_0x2915bc);return _0x2519ac[_0x29f6('0x27')](_0x29f6('0x28'),_0xda0a63+'-'+_0x3790f5+'/'+_0x1ab8d8)[_0x29f6('0x22')](_0x84ccb7);}return null;};}function patchUpdates(_0x218931){return function(_0x3a7249){try{jsonpatch['apply'](_0x3a7249,_0x218931,!![]);}catch(_0x5582d3){return BPromise[_0x29f6('0x29')](_0x5582d3);}return _0x3a7249['save']();};}function saveUpdates(_0x341071,_0xc8d2c5){return function(_0x1e1bb6){if(_0x1e1bb6){return _0x1e1bb6[_0x29f6('0x2a')](_0x341071)['then'](function(_0x53e11f){return _0x53e11f;});}return null;};}function removeEntity(_0x1bde69,_0xa6377c){return function(_0x2edc2e){if(_0x2edc2e){return _0x2edc2e[_0x29f6('0x2b')]()[_0x29f6('0x15')](function(){var _0x20bc5e=_0x2edc2e[_0x29f6('0x2c')]({'plain':!![]});var _0x1c3f0f=_0x29f6('0x2d');return db[_0x29f6('0x2e')][_0x29f6('0x2b')]({'where':{'type':_0x1c3f0f,'resourceId':_0x20bc5e['id']}})[_0x29f6('0x15')](function(){return _0x2edc2e;});})[_0x29f6('0x15')](function(){_0x1bde69[_0x29f6('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e31dd,_0x206beb){return function(_0x44cf19){if(!_0x44cf19){_0x5e31dd[_0x29f6('0x20')](0x194);}return _0x44cf19;};}function handleError(_0x5416dc,_0x3e1e25){_0x3e1e25=_0x3e1e25||0x1f4;return function(_0x749b9d){logger[_0x29f6('0x1b')](_0x749b9d[_0x29f6('0x2f')]);if(_0x749b9d[_0x29f6('0x30')]){delete _0x749b9d['name'];}_0x5416dc[_0x29f6('0x21')](_0x3e1e25)[_0x29f6('0x31')](_0x749b9d);};}exports[_0x29f6('0x32')]=function(_0x1b51cc,_0x4f5fe1){var _0x30d747={},_0x2a09e8={},_0x14b392={'count':0x0,'rows':[]};var _0x105557=_['map'](db['Trunk'][_0x29f6('0x33')],function(_0x4bfc80){return{'name':_0x4bfc80[_0x29f6('0x34')],'type':_0x4bfc80['type'][_0x29f6('0x35')]};});_0x2a09e8['model']=_[_0x29f6('0x36')](_0x105557,_0x29f6('0x30'));_0x2a09e8['query']=_[_0x29f6('0x37')](_0x1b51cc['query']);_0x2a09e8[_0x29f6('0x38')]=_[_0x29f6('0x39')](_0x2a09e8['model'],_0x2a09e8[_0x29f6('0x3a')]);_0x30d747[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x2a09e8[_0x29f6('0x3c')],qs['fields'](_0x1b51cc[_0x29f6('0x3a')][_0x29f6('0x3d')]));_0x30d747[_0x29f6('0x3b')]=_0x30d747[_0x29f6('0x3b')][_0x29f6('0x3e')]?_0x30d747['attributes']:_0x2a09e8[_0x29f6('0x3c')];if(!_0x1b51cc['query'][_0x29f6('0x3f')]('nolimit')){_0x30d747[_0x29f6('0x24')]=qs[_0x29f6('0x24')](_0x1b51cc['query'][_0x29f6('0x24')]);_0x30d747[_0x29f6('0x23')]=qs[_0x29f6('0x23')](_0x1b51cc[_0x29f6('0x3a')]['offset']);}_0x30d747[_0x29f6('0x40')]=qs[_0x29f6('0x41')](_0x1b51cc[_0x29f6('0x3a')]['sort']);_0x30d747[_0x29f6('0x42')]=qs['filters'](_[_0x29f6('0x43')](_0x1b51cc['query'],_0x2a09e8['filters']),_0x105557);if(_0x1b51cc['query'][_0x29f6('0x44')]){_0x30d747[_0x29f6('0x42')]=_[_0x29f6('0x45')](_0x30d747[_0x29f6('0x42')],{'$or':_[_0x29f6('0x36')](_0x105557,function(_0x270842){if(_0x270842[_0x29f6('0x46')]!==_0x29f6('0x47')){var _0x352119={};_0x352119[_0x270842[_0x29f6('0x30')]]={'$like':'%'+_0x1b51cc['query']['filter']+'%'};return _0x352119;}})});}_0x30d747=_[_0x29f6('0x45')]({},_0x30d747,_0x1b51cc[_0x29f6('0x48')]);var _0x7a65c0={'where':_0x30d747[_0x29f6('0x42')]};return db['Trunk'][_0x29f6('0x26')](_0x7a65c0)[_0x29f6('0x15')](function(_0x532df5){_0x14b392[_0x29f6('0x26')]=_0x532df5;if(_0x1b51cc[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x30d747[_0x29f6('0x4a')]=[{'all':!![]}];}return db[_0x29f6('0x4b')][_0x29f6('0x4c')](_0x30d747);})[_0x29f6('0x15')](function(_0x1f03b6){_0x14b392[_0x29f6('0x4d')]=_0x1f03b6;return _0x14b392;})[_0x29f6('0x15')](respondWithFilteredResult(_0x4f5fe1,_0x30d747))[_0x29f6('0x1f')](handleError(_0x4f5fe1,null));};exports[_0x29f6('0x4e')]=function(_0x58ea69,_0x416c24){var _0x463551={'raw':![],'where':{'id':_0x58ea69[_0x29f6('0x4f')]['id']}},_0x335ec1={};_0x335ec1[_0x29f6('0x3c')]=_['keys'](db[_0x29f6('0x4b')]['rawAttributes']);_0x335ec1['query']=_[_0x29f6('0x37')](_0x58ea69[_0x29f6('0x3a')]);_0x335ec1[_0x29f6('0x38')]=_[_0x29f6('0x39')](_0x335ec1[_0x29f6('0x3c')],_0x335ec1['query']);_0x463551[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x335ec1['model'],qs[_0x29f6('0x3d')](_0x58ea69['query'][_0x29f6('0x3d')]));_0x463551[_0x29f6('0x3b')]=_0x463551[_0x29f6('0x3b')][_0x29f6('0x3e')]?_0x463551['attributes']:_0x335ec1[_0x29f6('0x3c')];if(_0x58ea69[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x463551[_0x29f6('0x4a')]=[{'all':!![]}];}_0x463551=_[_0x29f6('0x45')]({},_0x463551,_0x58ea69[_0x29f6('0x48')]);return db[_0x29f6('0x4b')]['find'](_0x463551)[_0x29f6('0x15')](handleEntityNotFound(_0x416c24,null))[_0x29f6('0x15')](respondWithResult(_0x416c24,null))[_0x29f6('0x1f')](handleError(_0x416c24,null));};exports[_0x29f6('0x50')]=function(_0x36e52c,_0x1ac20d){var _0x37c3c1={'where':{'id':_0x36e52c[_0x29f6('0x4f')]['id']}},_0x2f356d={};_0x2f356d[_0x29f6('0x3c')]=_['keys'](db['Trunk'][_0x29f6('0x33')]);_0x37c3c1[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x2f356d['model'],qs[_0x29f6('0x3d')](_0x36e52c['query']['fields']));_0x37c3c1[_0x29f6('0x3b')]=_0x37c3c1[_0x29f6('0x3b')]['length']?_0x37c3c1['attributes']:_0x2f356d[_0x29f6('0x3c')];if(_0x36e52c[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x37c3c1['include']=[{'all':!![]}];}_0x37c3c1=_[_0x29f6('0x45')]({},_0x37c3c1,_0x36e52c[_0x29f6('0x48')]);return db[_0x29f6('0x4b')][_0x29f6('0x51')](_0x37c3c1)[_0x29f6('0x15')](handleEntityNotFound(_0x1ac20d,null))[_0x29f6('0x15')](function(_0x7700da){if(_0x7700da){var _0x33b1d7=_0x7700da[_0x29f6('0x2c')]({'plain':!![]});_0x33b1d7=qs[_0x29f6('0x52')](_0x33b1d7,['id',_0x29f6('0x53'),_0x29f6('0x54')]);_0x36e52c[_0x29f6('0x55')]=_['omit'](_0x36e52c['body'],['id',_0x29f6('0x53'),'updatedAt']);return db[_0x29f6('0x4b')][_0x29f6('0x56')](_[_0x29f6('0x45')](_0x33b1d7,_0x36e52c[_0x29f6('0x55')]),{'include':_0x36e52c[_0x29f6('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0x29f6('0x15')](function(_0x38d684){var _0x2f694e=_0x36e52c[_0x29f6('0x57')][_0x29f6('0x2c')]({'plain':!![]});if(!_0x2f694e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f694e[_0x29f6('0x58')]==='user'){var _0x51b9dc=_0x38d684[_0x29f6('0x2c')]({'plain':!![]});var _0x336b8e='Trunks';return db[_0x29f6('0x59')][_0x29f6('0x51')]({'where':{'name':_0x336b8e,'userProfileId':_0x2f694e['userProfileId']},'raw':!![]})[_0x29f6('0x15')](function(_0x2ba44c){if(_0x2ba44c&&_0x2ba44c[_0x29f6('0x5a')]===0x0){return db[_0x29f6('0x2e')][_0x29f6('0x56')]({'name':_0x51b9dc[_0x29f6('0x30')],'resourceId':_0x51b9dc['id'],'type':_0x2ba44c[_0x29f6('0x30')],'sectionId':_0x2ba44c['id']},{})['then'](function(){return _0x38d684;});}else{return _0x38d684;}})[_0x29f6('0x1f')](function(_0x50ddd6){logger[_0x29f6('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50ddd6);throw _0x50ddd6;});}return _0x38d684;});}})['then'](respondWithResult(_0x1ac20d,0xc9))[_0x29f6('0x1f')](handleError(_0x1ac20d,null));};exports[_0x29f6('0x56')]=function(_0x195887,_0x536b0c,_0x6ae738){var _0x373cf6;return db[_0x29f6('0x4b')]['create'](_0x195887[_0x29f6('0x55')],{'raw':!![]})[_0x29f6('0x15')](function(_0x66a7bb){_0x373cf6=_0x66a7bb;return db[_0x29f6('0x4b')][_0x29f6('0x4c')]({'raw':!![]});})[_0x29f6('0x15')](function(_0x6587f3){var _0x41c1b9=fs['readFileSync'](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0x1636f1=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],'server/files/templates/registry.ejs'),_0x29f6('0x5e'));var _0x1ca187=ejs['render'](_0x41c1b9,{'trunks':_0x6587f3||[]});fs[_0x29f6('0x60')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ca187);if(_0x373cf6[_0x29f6('0x61')]){var _0x5a383f=ejs['render'](_0x1636f1,{'trunks':_0x6587f3||[]});fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x5a383f);}})['then'](function(){return respondWithRpcPromise('Reload','create',{'module':_0x29f6('0x63')});})[_0x29f6('0x15')](function(){var _0x144c76=_0x195887[_0x29f6('0x57')][_0x29f6('0x2c')]({'plain':!![]});if(!_0x144c76)throw new Error(_0x29f6('0x64'));if(_0x144c76[_0x29f6('0x58')]==='user'){var _0x11ef85=_0x373cf6[_0x29f6('0x2c')]({'plain':!![]});return db[_0x29f6('0x59')][_0x29f6('0x51')]({'where':{'name':'Trunks','userProfileId':_0x144c76[_0x29f6('0x65')]},'raw':!![]})[_0x29f6('0x15')](function(_0x32a862){if(_0x32a862&&_0x32a862[_0x29f6('0x5a')]===0x0){return db[_0x29f6('0x2e')]['create']({'name':_0x11ef85[_0x29f6('0x30')],'resourceId':_0x11ef85['id'],'type':_0x32a862[_0x29f6('0x30')],'sectionId':_0x32a862['id']},{})[_0x29f6('0x15')](function(){return _0x373cf6;});}else{return _0x373cf6;}})[_0x29f6('0x1f')](function(_0x4273a3){logger[_0x29f6('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4273a3);throw _0x4273a3;});}return _0x373cf6;})[_0x29f6('0x15')](respondWithResult(_0x536b0c,0xc9))['catch'](handleError(_0x536b0c,null));};exports['update']=function(_0x4f9907,_0x842ae3,_0x5bcf90){var _0x425da2;return db[_0x29f6('0x4b')][_0x29f6('0x51')]({'where':{'id':_0x4f9907[_0x29f6('0x4f')]['id']}})[_0x29f6('0x15')](handleEntityNotFound(_0x842ae3,null))[_0x29f6('0x15')](saveUpdates(_0x4f9907[_0x29f6('0x55')],null))['then'](function(_0x3a23f3){if(_0x3a23f3){_0x425da2=_0x3a23f3;return db['Trunk'][_0x29f6('0x4c')]({'raw':!![]});}})[_0x29f6('0x15')](function(_0x32fa77){if(_0x32fa77){var _0x1d6e32=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0xe14459=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0xa31c7d=ejs[_0x29f6('0x66')](_0x1d6e32,{'trunks':_0x32fa77||[]});fs['writeFileSync'](_0x29f6('0x67'),_0xa31c7d);var _0x57b9fb=ejs[_0x29f6('0x66')](_0xe14459,{'trunks':_0x32fa77||[]});fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x57b9fb);return respondWithRpcPromise(_0x29f6('0x68'),_0x29f6('0x2a'),{'module':_0x29f6('0x63')});}return null;})[_0x29f6('0x15')](function(_0x4203f1){if(_0x4203f1){return _0x425da2;}})[_0x29f6('0x15')](respondWithResult(_0x842ae3,null))[_0x29f6('0x1f')](handleError(_0x842ae3,null));};exports['destroy']=function(_0x1d61ff,_0x4c0acc,_0x16bb3c){var _0x144d8c;return db[_0x29f6('0x4b')][_0x29f6('0x51')]({'where':{'id':_0x1d61ff[_0x29f6('0x4f')]['id']}})[_0x29f6('0x15')](handleEntityNotFound(_0x4c0acc,null))[_0x29f6('0x15')](removeEntity(_0x4c0acc,null))[_0x29f6('0x15')](function(){return db['Trunk'][_0x29f6('0x4c')]({'raw':!![]});})[_0x29f6('0x15')](function(_0x4e185f){var _0x4bb53f=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0x906098=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x69')),_0x29f6('0x5e'));var _0x3f51fa=ejs['render'](_0x4bb53f,{'trunks':_0x4e185f});var _0x4b9631=ejs[_0x29f6('0x66')](_0x906098,{'trunks':_0x4e185f});fs[_0x29f6('0x60')]('/etc/asterisk/sip_xcally_trunks.conf',_0x3f51fa);fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x4b9631);return respondWithRpcPromise(_0x29f6('0x68'),_0x29f6('0x2b'),{'module':_0x29f6('0x63')});})[_0x29f6('0x1f')](handleError(_0x4c0acc,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 081386a..2a1676d 100644 --- a/server/api/trunk/trunk.model.js +++ b/server/api/trunk/trunk.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd180=['moment','bluebird','request-promise','rimraf','../../config/environment','./trunk.attributes','Trunk','tools_trunks','lodash','util','../../config/logger','api'];(function(_0x257e1e,_0x2387c2){var _0x2afd23=function(_0x464860){while(--_0x464860){_0x257e1e['push'](_0x257e1e['shift']());}};_0x2afd23(++_0x2387c2);}(_0xd180,0x1c4));var _0x0d18=function(_0x3da707,_0x30c36d){_0x3da707=_0x3da707-0x0;var _0x342ee7=_0xd180[_0x3da707];return _0x342ee7;};'use strict';var _=require(_0x0d18('0x0'));var util=require(_0x0d18('0x1'));var logger=require(_0x0d18('0x2'))(_0x0d18('0x3'));var moment=require(_0x0d18('0x4'));var BPromise=require(_0x0d18('0x5'));var rp=require(_0x0d18('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0d18('0x7'));var config=require(_0x0d18('0x8'));var attributes=require(_0x0d18('0x9'));module['exports']=function(_0x176846,_0x4e2885){return _0x176846['define'](_0x0d18('0xa'),attributes,{'tableName':_0x0d18('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x659b=['../../config/environment','./trunk.attributes','exports','define','tools_trunks','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2a390b,_0xf49f9b){var _0x5df10a=function(_0x115dbe){while(--_0x115dbe){_0x2a390b['push'](_0x2a390b['shift']());}};_0x5df10a(++_0xf49f9b);}(_0x659b,0x198));var _0xb659=function(_0x15e366,_0x10bf91){_0x15e366=_0x15e366-0x0;var _0xa322b3=_0x659b[_0x15e366];return _0xa322b3;};'use strict';var _=require('lodash');var util=require(_0xb659('0x0'));var logger=require(_0xb659('0x1'))(_0xb659('0x2'));var moment=require(_0xb659('0x3'));var BPromise=require(_0xb659('0x4'));var rp=require(_0xb659('0x5'));var fs=require('fs');var path=require(_0xb659('0x6'));var rimraf=require(_0xb659('0x7'));var config=require(_0xb659('0x8'));var attributes=require(_0xb659('0x9'));module[_0xb659('0xa')]=function(_0x1c47f4,_0xae8363){return _0x1c47f4[_0xb659('0xb')]('Trunk',attributes,{'tableName':_0xb659('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index ef2910d..c8284b2 100644 --- a/server/api/trunk/trunk.rpc.js +++ b/server/api/trunk/trunk.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04d0=['ShowTrunk','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','map','include','model'];(function(_0x6780cb,_0x58a7b9){var _0x4043aa=function(_0xad72aa){while(--_0xad72aa){_0x6780cb['push'](_0x6780cb['shift']());}};_0x4043aa(++_0x58a7b9);}(_0x04d0,0x122));var _0x004d=function(_0x2aa162,_0x193e6f){_0x2aa162=_0x2aa162-0x0;var _0x4efd6d=_0x04d0[_0x2aa162];return _0x4efd6d;};'use strict';var _=require('lodash');var util=require(_0x004d('0x0'));var moment=require(_0x004d('0x1'));var BPromise=require(_0x004d('0x2'));var rs=require(_0x004d('0x3'));var fs=require('fs');var Redis=require(_0x004d('0x4'));var db=require(_0x004d('0x5'))['db'];var utils=require(_0x004d('0x6'));var logger=require(_0x004d('0x7'))(_0x004d('0x8'));var config=require(_0x004d('0x9'));var jayson=require(_0x004d('0xa'));var client=jayson[_0x004d('0xb')][_0x004d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x43ac56,_0x5933b5,_0x4355ec){return new BPromise(function(_0x22af55,_0x87c28f){return client[_0x004d('0xd')](_0x43ac56,_0x4355ec)[_0x004d('0xe')](function(_0x3a096c){logger[_0x004d('0xf')](_0x004d('0x10'),_0x5933b5,'request\x20sent');logger[_0x004d('0x11')](_0x004d('0x12'),_0x5933b5,_0x004d('0x13'),JSON[_0x004d('0x14')](_0x3a096c));if(_0x3a096c[_0x004d('0x15')]){if(_0x3a096c[_0x004d('0x15')]['code']===0x1f4){logger[_0x004d('0x15')](_0x004d('0x10'),_0x5933b5,_0x3a096c[_0x004d('0x15')][_0x004d('0x16')]);return _0x87c28f(_0x3a096c[_0x004d('0x15')][_0x004d('0x16')]);}logger[_0x004d('0x15')]('Trunk,\x20%s,\x20%s',_0x5933b5,_0x3a096c[_0x004d('0x15')]['message']);return _0x22af55(_0x3a096c[_0x004d('0x15')][_0x004d('0x16')]);}else{logger[_0x004d('0xf')](_0x004d('0x10'),_0x5933b5,_0x004d('0x13'));_0x22af55(_0x3a096c['result'][_0x004d('0x16')]);}})[_0x004d('0x17')](function(_0x5acc7d){logger[_0x004d('0x15')]('Trunk,\x20%s,\x20%s',_0x5933b5,_0x5acc7d);_0x87c28f(_0x5acc7d);});});}exports[_0x004d('0x18')]=function(_0x37fcd1){var _0x46eef8=this;return new Promise(function(_0x4a3a5c,_0x2765b5){return db[_0x004d('0x19')][_0x004d('0x1a')]({'raw':_0x37fcd1[_0x004d('0x1b')]?_0x37fcd1[_0x004d('0x1b')][_0x004d('0x1c')]===undefined?!![]:![]:!![],'where':_0x37fcd1[_0x004d('0x1b')]?_0x37fcd1[_0x004d('0x1b')][_0x004d('0x1d')]||null:null,'attributes':_0x37fcd1[_0x004d('0x1b')]?_0x37fcd1[_0x004d('0x1b')][_0x004d('0x1e')]||null:null,'limit':_0x37fcd1[_0x004d('0x1b')]?_0x37fcd1['options']['limit']||null:null,'include':_0x37fcd1[_0x004d('0x1b')]?_0x37fcd1[_0x004d('0x1b')]['include']?_['map'](_0x37fcd1[_0x004d('0x1b')]['include'],function(_0x3bd69c){return{'model':db[_0x3bd69c['model']],'as':_0x3bd69c['as'],'attributes':_0x3bd69c[_0x004d('0x1e')],'include':_0x3bd69c['include']?_[_0x004d('0x1f')](_0x3bd69c[_0x004d('0x20')],function(_0x2f4f5a){return{'model':db[_0x2f4f5a[_0x004d('0x21')]],'as':_0x2f4f5a['as'],'attributes':_0x2f4f5a[_0x004d('0x1e')],'include':_0x2f4f5a[_0x004d('0x20')]?_[_0x004d('0x1f')](_0x2f4f5a[_0x004d('0x20')],function(_0xb6c98b){return{'model':db[_0xb6c98b[_0x004d('0x21')]],'as':_0xb6c98b['as'],'attributes':_0xb6c98b[_0x004d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x004d('0xe')](function(_0x325f8a){logger[_0x004d('0xf')](_0x004d('0x18'),_0x37fcd1);logger[_0x004d('0x11')](_0x004d('0x18'),_0x37fcd1,JSON[_0x004d('0x14')](_0x325f8a));_0x4a3a5c(_0x325f8a);})['catch'](function(_0x51586c){logger[_0x004d('0x15')]('GetTrunk',_0x51586c[_0x004d('0x16')],_0x37fcd1);_0x2765b5(_0x46eef8['error'](0x1f4,_0x51586c['message']));});});};exports[_0x004d('0x22')]=function(_0x2316d5){var _0x58f716=this;return new Promise(function(_0x444887,_0x40d182){return db[_0x004d('0x19')][_0x004d('0x23')]({'raw':_0x2316d5[_0x004d('0x1b')]?_0x2316d5[_0x004d('0x1b')][_0x004d('0x1c')]===undefined?!![]:![]:!![],'where':_0x2316d5[_0x004d('0x1b')]?_0x2316d5['options'][_0x004d('0x1d')]||null:null,'attributes':_0x2316d5['options']?_0x2316d5[_0x004d('0x1b')][_0x004d('0x1e')]||null:null,'include':_0x2316d5[_0x004d('0x1b')]?_0x2316d5['options'][_0x004d('0x20')]?_[_0x004d('0x1f')](_0x2316d5[_0x004d('0x1b')][_0x004d('0x20')],function(_0xf2db17){return{'model':db[_0xf2db17['model']],'as':_0xf2db17['as'],'attributes':_0xf2db17[_0x004d('0x1e')],'include':_0xf2db17[_0x004d('0x20')]?_['map'](_0xf2db17[_0x004d('0x20')],function(_0x1651ea){return{'model':db[_0x1651ea[_0x004d('0x21')]],'as':_0x1651ea['as'],'attributes':_0x1651ea[_0x004d('0x1e')],'include':_0x1651ea['include']?_[_0x004d('0x1f')](_0x1651ea[_0x004d('0x20')],function(_0x4620f1){return{'model':db[_0x4620f1[_0x004d('0x21')]],'as':_0x4620f1['as'],'attributes':_0x4620f1[_0x004d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x004d('0xe')](function(_0x2b925e){logger[_0x004d('0xf')](_0x004d('0x22'),_0x2316d5);logger[_0x004d('0x11')](_0x004d('0x22'),_0x2316d5,JSON[_0x004d('0x14')](_0x2b925e));_0x444887(_0x2b925e);})[_0x004d('0x17')](function(_0x3be73c){logger[_0x004d('0x15')](_0x004d('0x22'),_0x3be73c[_0x004d('0x16')],_0x2316d5);_0x40d182(_0x58f716[_0x004d('0x15')](0x1f4,_0x3be73c[_0x004d('0x16')]));});});}; \ No newline at end of file +var _0x1b1c=['jayson/promise','client','request','then','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','info','GetTrunk','options','raw','include','map','model','attributes','find','ShowTrunk','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x515661,_0x36a15d){var _0x1bf063=function(_0x1f186e){while(--_0x1f186e){_0x515661['push'](_0x515661['shift']());}};_0x1bf063(++_0x36a15d);}(_0x1b1c,0x112));var _0xc1b1=function(_0x44b04c,_0x5786a3){_0x44b04c=_0x44b04c-0x0;var _0x1d2442=_0x1b1c[_0x44b04c];return _0x1d2442;};'use strict';var _=require(_0xc1b1('0x0'));var util=require('util');var moment=require(_0xc1b1('0x1'));var BPromise=require('bluebird');var rs=require(_0xc1b1('0x2'));var fs=require('fs');var Redis=require(_0xc1b1('0x3'));var db=require(_0xc1b1('0x4'))['db'];var utils=require(_0xc1b1('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc1b1('0x6'));var client=jayson[_0xc1b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x322f8b,_0x9d3f8c,_0x2d7934){return new BPromise(function(_0x53b7ea,_0x2f3709){return client[_0xc1b1('0x8')](_0x322f8b,_0x2d7934)[_0xc1b1('0x9')](function(_0x527a56){logger['info']('Trunk,\x20%s,\x20%s',_0x9d3f8c,_0xc1b1('0xa'));logger[_0xc1b1('0xb')](_0xc1b1('0xc'),_0x9d3f8c,_0xc1b1('0xa'),JSON[_0xc1b1('0xd')](_0x527a56));if(_0x527a56[_0xc1b1('0xe')]){if(_0x527a56[_0xc1b1('0xe')][_0xc1b1('0xf')]===0x1f4){logger[_0xc1b1('0xe')]('Trunk,\x20%s,\x20%s',_0x9d3f8c,_0x527a56[_0xc1b1('0xe')]['message']);return _0x2f3709(_0x527a56[_0xc1b1('0xe')][_0xc1b1('0x10')]);}logger[_0xc1b1('0xe')](_0xc1b1('0x11'),_0x9d3f8c,_0x527a56['error'][_0xc1b1('0x10')]);return _0x53b7ea(_0x527a56['error']['message']);}else{logger[_0xc1b1('0x12')]('Trunk,\x20%s,\x20%s',_0x9d3f8c,_0xc1b1('0xa'));_0x53b7ea(_0x527a56['result'][_0xc1b1('0x10')]);}})['catch'](function(_0x8a0d11){logger[_0xc1b1('0xe')](_0xc1b1('0x11'),_0x9d3f8c,_0x8a0d11);_0x2f3709(_0x8a0d11);});});}exports[_0xc1b1('0x13')]=function(_0x89d6b1){var _0x2b297a=this;return new Promise(function(_0x2e1f25,_0x268ec3){return db['Trunk']['findAll']({'raw':_0x89d6b1[_0xc1b1('0x14')]?_0x89d6b1[_0xc1b1('0x14')][_0xc1b1('0x15')]===undefined?!![]:![]:!![],'where':_0x89d6b1[_0xc1b1('0x14')]?_0x89d6b1[_0xc1b1('0x14')]['where']||null:null,'attributes':_0x89d6b1[_0xc1b1('0x14')]?_0x89d6b1[_0xc1b1('0x14')]['attributes']||null:null,'limit':_0x89d6b1[_0xc1b1('0x14')]?_0x89d6b1['options']['limit']||null:null,'include':_0x89d6b1[_0xc1b1('0x14')]?_0x89d6b1[_0xc1b1('0x14')][_0xc1b1('0x16')]?_[_0xc1b1('0x17')](_0x89d6b1[_0xc1b1('0x14')][_0xc1b1('0x16')],function(_0x26df47){return{'model':db[_0x26df47[_0xc1b1('0x18')]],'as':_0x26df47['as'],'attributes':_0x26df47[_0xc1b1('0x19')],'include':_0x26df47[_0xc1b1('0x16')]?_['map'](_0x26df47['include'],function(_0x4a0e9e){return{'model':db[_0x4a0e9e['model']],'as':_0x4a0e9e['as'],'attributes':_0x4a0e9e['attributes'],'include':_0x4a0e9e[_0xc1b1('0x16')]?_['map'](_0x4a0e9e[_0xc1b1('0x16')],function(_0x663b52){return{'model':db[_0x663b52[_0xc1b1('0x18')]],'as':_0x663b52['as'],'attributes':_0x663b52[_0xc1b1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc1b1('0x9')](function(_0x12c283){logger[_0xc1b1('0x12')](_0xc1b1('0x13'),_0x89d6b1);logger['debug'](_0xc1b1('0x13'),_0x89d6b1,JSON[_0xc1b1('0xd')](_0x12c283));_0x2e1f25(_0x12c283);})['catch'](function(_0x189a86){logger['error'](_0xc1b1('0x13'),_0x189a86[_0xc1b1('0x10')],_0x89d6b1);_0x268ec3(_0x2b297a[_0xc1b1('0xe')](0x1f4,_0x189a86['message']));});});};exports['ShowTrunk']=function(_0x1f6bab){var _0x20227b=this;return new Promise(function(_0x14a46d,_0x2deb13){return db['Trunk'][_0xc1b1('0x1a')]({'raw':_0x1f6bab['options']?_0x1f6bab[_0xc1b1('0x14')][_0xc1b1('0x15')]===undefined?!![]:![]:!![],'where':_0x1f6bab[_0xc1b1('0x14')]?_0x1f6bab[_0xc1b1('0x14')]['where']||null:null,'attributes':_0x1f6bab[_0xc1b1('0x14')]?_0x1f6bab[_0xc1b1('0x14')][_0xc1b1('0x19')]||null:null,'include':_0x1f6bab[_0xc1b1('0x14')]?_0x1f6bab[_0xc1b1('0x14')][_0xc1b1('0x16')]?_[_0xc1b1('0x17')](_0x1f6bab[_0xc1b1('0x14')][_0xc1b1('0x16')],function(_0x159903){return{'model':db[_0x159903[_0xc1b1('0x18')]],'as':_0x159903['as'],'attributes':_0x159903[_0xc1b1('0x19')],'include':_0x159903['include']?_[_0xc1b1('0x17')](_0x159903[_0xc1b1('0x16')],function(_0x343e70){return{'model':db[_0x343e70[_0xc1b1('0x18')]],'as':_0x343e70['as'],'attributes':_0x343e70[_0xc1b1('0x19')],'include':_0x343e70[_0xc1b1('0x16')]?_['map'](_0x343e70['include'],function(_0x2ed19f){return{'model':db[_0x2ed19f['model']],'as':_0x2ed19f['as'],'attributes':_0x2ed19f[_0xc1b1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc1b1('0x9')](function(_0x1cfbd5){logger[_0xc1b1('0x12')](_0xc1b1('0x1b'),_0x1f6bab);logger[_0xc1b1('0xb')](_0xc1b1('0x1b'),_0x1f6bab,JSON[_0xc1b1('0xd')](_0x1cfbd5));_0x14a46d(_0x1cfbd5);})['catch'](function(_0x163b8a){logger['error']('ShowTrunk',_0x163b8a[_0xc1b1('0x10')],_0x1f6bab);_0x2deb13(_0x20227b['error'](0x1f4,_0x163b8a[_0xc1b1('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 6c46c1e..cb50d94 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35f0=['isAuthenticated','update','exports','Router','../../components/auth/service','./user-setting.controller','put','/:id'];(function(_0x4fb37d,_0x49a113){var _0x39400b=function(_0xc15daa){while(--_0xc15daa){_0x4fb37d['push'](_0x4fb37d['shift']());}};_0x39400b(++_0x49a113);}(_0x35f0,0x1b3));var _0x035f=function(_0x309fda,_0x1496f8){_0x309fda=_0x309fda-0x0;var _0xccaf12=_0x35f0[_0x309fda];return _0xccaf12;};'use strict';var express=require('express');var router=express[_0x035f('0x0')]();var auth=require(_0x035f('0x1'));var controller=require(_0x035f('0x2'));router[_0x035f('0x3')](_0x035f('0x4'),auth[_0x035f('0x5')](),controller[_0x035f('0x6')]);module[_0x035f('0x7')]=router; \ No newline at end of file +var _0x7bf6=['update','express','Router','/:id','isAuthenticated'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x7bf6,0xe7));var _0x67bf=function(_0x192b03,_0x3718e7){_0x192b03=_0x192b03-0x0;var _0x2e09db=_0x7bf6[_0x192b03];return _0x2e09db;};'use strict';var express=require(_0x67bf('0x0'));var router=express[_0x67bf('0x1')]();var auth=require('../../components/auth/service');var controller=require('./user-setting.controller');router['put'](_0x67bf('0x2'),auth[_0x67bf('0x3')](),controller[_0x67bf('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 018c9e1..9e4d8cb 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf53=['exports','ENUM','BOOLEAN','DATE','INTEGER','UserId','sequelize','error','info','debug'];(function(_0x346da4,_0x5e9473){var _0x535c0e=function(_0x3a54a2){while(--_0x3a54a2){_0x346da4['push'](_0x346da4['shift']());}};_0x535c0e(++_0x5e9473);}(_0xaf53,0x196));var _0x3af5=function(_0x580607,_0x3d2c7d){_0x580607=_0x580607-0x0;var _0x3adb02=_0xaf53[_0x580607];return _0x3adb02;};'use strict';var Sequelize=require(_0x3af5('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x3af5('0x1'),'warning',_0x3af5('0x2'),_0x3af5('0x3')];module[_0x3af5('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x3af5('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x3af5('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x3af5('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x3af5('0x8')],'unique':_0x3af5('0x9')}}; \ No newline at end of file +var _0x6088=['error','info','exports','ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x6088,0x1cb));var _0x8608=function(_0x31e719,_0x736e78){_0x31e719=_0x31e719-0x0;var _0x5cb5a3=_0x6088[_0x31e719];return _0x5cb5a3;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x8608('0x0'),'warning',_0x8608('0x1'),'debug'];module[_0x8608('0x2')]={'clientSideLoggingLevel':{'type':Sequelize[_0x8608('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x8608('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x8608('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x8608('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x8608('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x8608('0x7')],'unique':_0x8608('0x8')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index e9d1c25..0278876 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf83=['name','status','send','user','role','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','register','redis','defaults','json','update','then','sendStatus','stack'];(function(_0x5f12b1,_0x4df658){var _0x3290f7=function(_0x41cbe5){while(--_0x41cbe5){_0x5f12b1['push'](_0x5f12b1['shift']());}};_0x3290f7(++_0x4df658);}(_0xbf83,0x11e));var _0x3bf8=function(_0xb99346,_0xe507d5){_0xb99346=_0xb99346-0x0;var _0xd4881a=_0xbf83[_0xb99346];return _0xd4881a;};'use strict';var _=require(_0x3bf8('0x0'));var Redis=require('ioredis');var logger=require(_0x3bf8('0x1'))(_0x3bf8('0x2'));var config=require(_0x3bf8('0x3'));var db=require(_0x3bf8('0x4'))['db'];var socket=require(_0x3bf8('0x5'))(new Redis(config['redis']));require('./user-setting.socket')[_0x3bf8('0x6')](socket);config[_0x3bf8('0x7')]=_[_0x3bf8('0x8')](config[_0x3bf8('0x7')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x5b0c12,_0x168a20){_0x168a20=_0x168a20||0xc8;return function(_0x2df7c9){if(_0x2df7c9){return _0x5b0c12['status'](_0x168a20)[_0x3bf8('0x9')](_0x2df7c9);}};}function saveUpdates(_0x538bec){return function(_0x2f07a8){if(_0x2f07a8){return _0x2f07a8[_0x3bf8('0xa')](_0x538bec)[_0x3bf8('0xb')](function(_0x281063){return _0x281063;});}return null;};}function handleEntityNotFound(_0x2ee63c){return function(_0xc9f419){if(!_0xc9f419){_0x2ee63c[_0x3bf8('0xc')](0x194);}return _0xc9f419;};}function handleError(_0x5d1274,_0xb88128){_0xb88128=_0xb88128||0x1f4;return function(_0x3e0ab0){logger['error'](_0x3e0ab0[_0x3bf8('0xd')]);if(_0x3e0ab0[_0x3bf8('0xe')]){delete _0x3e0ab0[_0x3bf8('0xe')];}_0x5d1274[_0x3bf8('0xf')](_0xb88128)[_0x3bf8('0x10')](_0x3e0ab0);};}exports[_0x3bf8('0xa')]=function(_0x27b4e1,_0x260445){if(_0x27b4e1[_0x3bf8('0x11')][_0x3bf8('0x12')]!=='admin')throw new Error('Unauthorized');if(isNaN(Number(_0x27b4e1[_0x3bf8('0x13')]['id'])))throw new Error(_0x3bf8('0x14'));return db[_0x3bf8('0x15')][_0x3bf8('0x16')]({'where':{'id':_0x27b4e1['params']['id']}})[_0x3bf8('0xb')](handleEntityNotFound(_0x260445,null))[_0x3bf8('0xb')](saveUpdates(_0x27b4e1[_0x3bf8('0x17')],null))[_0x3bf8('0xb')](respondWithResult(_0x260445,null))[_0x3bf8('0x18')](handleError(_0x260445,null));}; \ No newline at end of file +var _0x9ef8=['admin','params','find','lodash','ioredis','api','../../config/environment','../../mysqldb','redis','./user-setting.socket','localhost','status','json','then','sendStatus','error','name','send','user','role'];(function(_0x356e5c,_0x23156b){var _0x459517=function(_0x425042){while(--_0x425042){_0x356e5c['push'](_0x356e5c['shift']());}};_0x459517(++_0x23156b);}(_0x9ef8,0x17f));var _0x89ef=function(_0x3d27ba,_0x2671a3){_0x3d27ba=_0x3d27ba-0x0;var _0xf01885=_0x9ef8[_0x3d27ba];return _0xf01885;};'use strict';var _=require(_0x89ef('0x0'));var Redis=require(_0x89ef('0x1'));var logger=require('../../config/logger')(_0x89ef('0x2'));var config=require(_0x89ef('0x3'));var db=require(_0x89ef('0x4'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x89ef('0x5')]));require(_0x89ef('0x6'))['register'](socket);config['redis']=_['defaults'](config[_0x89ef('0x5')],{'host':_0x89ef('0x7'),'port':0x18eb});function respondWithResult(_0x24439e,_0x90b5bf){_0x90b5bf=_0x90b5bf||0xc8;return function(_0x46c0da){if(_0x46c0da){return _0x24439e[_0x89ef('0x8')](_0x90b5bf)[_0x89ef('0x9')](_0x46c0da);}};}function saveUpdates(_0x3d204a){return function(_0xbd0084){if(_0xbd0084){return _0xbd0084['update'](_0x3d204a)[_0x89ef('0xa')](function(_0x4687cb){return _0x4687cb;});}return null;};}function handleEntityNotFound(_0x30c8f4){return function(_0x5c5435){if(!_0x5c5435){_0x30c8f4[_0x89ef('0xb')](0x194);}return _0x5c5435;};}function handleError(_0x7f5df1,_0x1c69aa){_0x1c69aa=_0x1c69aa||0x1f4;return function(_0x4b52dc){logger[_0x89ef('0xc')](_0x4b52dc['stack']);if(_0x4b52dc[_0x89ef('0xd')]){delete _0x4b52dc['name'];}_0x7f5df1[_0x89ef('0x8')](_0x1c69aa)[_0x89ef('0xe')](_0x4b52dc);};}exports['update']=function(_0x21ac0b,_0x269192){if(_0x21ac0b[_0x89ef('0xf')][_0x89ef('0x10')]!==_0x89ef('0x11'))throw new Error('Unauthorized');if(isNaN(Number(_0x21ac0b[_0x89ef('0x12')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db['UserSetting'][_0x89ef('0x13')]({'where':{'id':_0x21ac0b[_0x89ef('0x12')]['id']}})['then'](handleEntityNotFound(_0x269192,null))[_0x89ef('0xa')](saveUpdates(_0x21ac0b['body'],null))[_0x89ef('0xa')](respondWithResult(_0x269192,null))['catch'](handleError(_0x269192,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index a456a91..b8d4c3c 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ce3=['save','emit','hasOwnProperty','exports','events','../../mysqldb','UserSetting'];(function(_0x356ed3,_0x4edc4a){var _0xcfbee=function(_0x432188){while(--_0x432188){_0x356ed3['push'](_0x356ed3['shift']());}};_0xcfbee(++_0x4edc4a);}(_0x4ce3,0x1c4));var _0x34ce=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0x4ce3[_0x28669c];return _0x4a3af6;};'use strict';var EventEmitter=require(_0x34ce('0x0'));var UserSetting=require(_0x34ce('0x1'))['db'][_0x34ce('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x34ce('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x21ae6c){return function(_0x39542b,_0x5a5aab,_0xd6b615){UserSettingEvents[_0x34ce('0x4')](_0x21ae6c+':'+_0x39542b['id'],_0x39542b);UserSettingEvents[_0x34ce('0x4')](_0x21ae6c,_0x39542b);_0xd6b615(null);};}for(var e in events){if(events[_0x34ce('0x5')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x34ce('0x6')]=UserSettingEvents; \ No newline at end of file +var _0xe91f=['exports','events','UserSetting','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4128bd,_0x2727c0){var _0x179867=function(_0x429988){while(--_0x429988){_0x4128bd['push'](_0x4128bd['shift']());}};_0x179867(++_0x2727c0);}(_0xe91f,0x19b));var _0xfe91=function(_0x4ac315,_0x24c6af){_0x4ac315=_0x4ac315-0x0;var _0x56333f=_0xe91f[_0x4ac315];return _0x56333f;};'use strict';var EventEmitter=require(_0xfe91('0x0'));var UserSetting=require('../../mysqldb')['db'][_0xfe91('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xfe91('0x2')](0x0);var events={'afterCreate':_0xfe91('0x3'),'afterUpdate':_0xfe91('0x4'),'afterDestroy':_0xfe91('0x5')};function emitEvent(_0x141751){return function(_0x3009df,_0x2ed612,_0xba415){UserSettingEvents['emit'](_0x141751+':'+_0x3009df['id'],_0x3009df);UserSettingEvents[_0xfe91('0x6')](_0x141751,_0x3009df);_0xba415(null);};}for(var e in events){if(events[_0xfe91('0x7')](e)){var event=events[e];UserSetting[_0xfe91('0x8')](e,emitEvent(event));}}module[_0xfe91('0x9')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 898a037..f4ac712 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['UserSetting','user_settings','clientSideLoggingEnabledSince','exports','define'];(function(_0x362f5d,_0x5282c4){var _0x26f35c=function(_0x1386e6){while(--_0x1386e6){_0x362f5d['push'](_0x362f5d['shift']());}};_0x26f35c(++_0x5282c4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var attributes=require('./user-setting.attributes');module[_0x0baf('0x0')]=function(_0x2a3620){return _0x2a3620[_0x0baf('0x1')](_0x0baf('0x2'),attributes,{'tableName':_0x0baf('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d2e72){if(!_0x4d2e72['clientSideLoggingEnabled'])_0x4d2e72[_0x0baf('0x4')]=null;else if(_0x4d2e72[_0x0baf('0x4')]===null)_0x4d2e72[_0x0baf('0x4')]=new Date();}}});}; \ No newline at end of file +var _0xc577=['UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','define'];(function(_0x573a93,_0x3b1b43){var _0x1fa964=function(_0x31c4c7){while(--_0x31c4c7){_0x573a93['push'](_0x573a93['shift']());}};_0x1fa964(++_0x3b1b43);}(_0xc577,0x172));var _0x7c57=function(_0x52e251,_0x3b6303){_0x52e251=_0x52e251-0x0;var _0x5eee63=_0xc577[_0x52e251];return _0x5eee63;};'use strict';var attributes=require(_0x7c57('0x0'));module['exports']=function(_0x5cbd78){return _0x5cbd78[_0x7c57('0x1')](_0x7c57('0x2'),attributes,{'tableName':_0x7c57('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a2415){if(!_0x2a2415[_0x7c57('0x4')])_0x2a2415[_0x7c57('0x5')]=null;else if(_0x2a2415[_0x7c57('0x5')]===null)_0x2a2415['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 4e77048..7143d18 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7589=['UserId','register','length','user-setting:','./user-setting.events','remove','emit','user-setting:update:user-'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x7589,0x14c));var _0x9758=function(_0xbc35ae,_0x1b79a1){_0xbc35ae=_0xbc35ae-0x0;var _0x527b4c=_0x7589[_0xbc35ae];return _0x527b4c;};'use strict';var UserSettingEvents=require(_0x9758('0x0'));var events=['save',_0x9758('0x1'),'update'];function createListener(_0x36fcf3,_0x1bf060){return function(_0xa558df){_0x1bf060[_0x9758('0x2')](_0x36fcf3,_0xa558df);if(_0x36fcf3==='user-setting:update'){_0x1bf060['emit'](_0x9758('0x3')+_0xa558df[_0x9758('0x4')],_0xa558df);}};}exports[_0x9758('0x5')]=function(_0x38c69f){for(var _0xc298d6=0x0,_0xe32c7e=events[_0x9758('0x6')];_0xc298d6<_0xe32c7e;_0xc298d6++){var _0x5a19f3=events[_0xc298d6];var _0x307248=createListener(_0x9758('0x7')+_0x5a19f3,_0x38c69f);UserSettingEvents['on'](_0x5a19f3,_0x307248);}}; \ No newline at end of file +var _0x920b=['user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events','save','remove','update','emit'];(function(_0x1582b9,_0x23c6c2){var _0x1b838a=function(_0x385e10){while(--_0x385e10){_0x1582b9['push'](_0x1582b9['shift']());}};_0x1b838a(++_0x23c6c2);}(_0x920b,0x11d));var _0xb920=function(_0x3e2964,_0x479553){_0x3e2964=_0x3e2964-0x0;var _0x5b4d76=_0x920b[_0x3e2964];return _0x5b4d76;};'use strict';var UserSettingEvents=require(_0xb920('0x0'));var events=[_0xb920('0x1'),_0xb920('0x2'),_0xb920('0x3')];function createListener(_0x48c792,_0x149aa4){return function(_0x19c80f){_0x149aa4[_0xb920('0x4')](_0x48c792,_0x19c80f);if(_0x48c792==='user-setting:update'){_0x149aa4[_0xb920('0x4')](_0xb920('0x5')+_0x19c80f[_0xb920('0x6')],_0x19c80f);}};}exports[_0xb920('0x7')]=function(_0x480383){for(var _0x1ceebd=0x0,_0x55c69c=events[_0xb920('0x8')];_0x1ceebd<_0x55c69c;_0x1ceebd++){var _0xd802cf=events[_0x1ceebd];var _0x9b3873=createListener(_0xb920('0x9')+_0xd802cf,_0x480383);UserSettingEvents['on'](_0xd802cf,_0x9b3873);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index b8ae4a5..dee2e77 100644 --- a/server/api/user/index.js +++ b/server/api/user/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1d4=['login','logout','/:id/pause','unpause','/:id/teams','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','put','/:id','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeWhatsappAccounts','/:id/messengerSoundNotification','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/whoami','/presence','getPresence','show','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getGroups','getRecordings','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','addContacts','post','create','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','root','server/files/images/','format','%s-%s','now','/:id/avatar','single','file'];(function(_0xf068cc,_0x3055cb){var _0xd21823=function(_0x5c1a4b){while(--_0x5c1a4b){_0xf068cc['push'](_0xf068cc['shift']());}};_0xd21823(++_0x3055cb);}(_0xf1d4,0x158));var _0x4f1d=function(_0x340a9a,_0x2b0ade){_0x340a9a=_0x340a9a-0x0;var _0x574153=_0xf1d4[_0x340a9a];return _0x574153;};'use strict';var multer=require(_0x4f1d('0x0'));var util=require('util');var path=require(_0x4f1d('0x1'));var timeout=require('connect-timeout');var express=require(_0x4f1d('0x2'));var router=express[_0x4f1d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4f1d('0x4'));var interaction=require(_0x4f1d('0x5'));var config=require('../../config/environment');var controller=require('./user.controller');router[_0x4f1d('0x6')]('/',auth[_0x4f1d('0x7')](),controller['index']);router[_0x4f1d('0x6')](_0x4f1d('0x8'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x9')]);router[_0x4f1d('0x6')](_0x4f1d('0xa'),auth[_0x4f1d('0x7')](),controller['whoami']);router['get'](_0x4f1d('0xb'),auth['isAuthenticated'](),controller[_0x4f1d('0xc')]);router[_0x4f1d('0x6')]('/:id',auth[_0x4f1d('0x7')](),controller[_0x4f1d('0xd')]);router['get']('/:id/avatar',controller[_0x4f1d('0xe')]);router['get'](_0x4f1d('0xf'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x10')]);router[_0x4f1d('0x6')](_0x4f1d('0x11'),auth['isAuthenticated'](),controller['getContacts']);router[_0x4f1d('0x6')]('/:id/queues',auth['isAuthenticated'](),controller['getQueues']);router[_0x4f1d('0x6')]('/:id/queues_rt',auth[_0x4f1d('0x7')](),controller['getVoiceQueuesRt']);router[_0x4f1d('0x6')]('/:id/groups',auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x12')]);router[_0x4f1d('0x6')]('/:id/recordings',auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x13')]);router[_0x4f1d('0x6')]('/:id/screen_recordings',auth[_0x4f1d('0x7')](),controller['getScreenRecordings']);router[_0x4f1d('0x6')]('/:id/chat/interactions',auth[_0x4f1d('0x7')](),controller['getChatInteractions']);router[_0x4f1d('0x6')](_0x4f1d('0x14'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x15')]);router[_0x4f1d('0x6')](_0x4f1d('0x16'),auth['isAuthenticated'](),controller[_0x4f1d('0x17')]);router[_0x4f1d('0x6')](_0x4f1d('0x18'),auth[_0x4f1d('0x7')](),controller['getSmsInteractions']);router[_0x4f1d('0x6')](_0x4f1d('0x19'),auth['isAuthenticated'](),controller[_0x4f1d('0x1a')]);router[_0x4f1d('0x6')](_0x4f1d('0x1b'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x1c')]);router[_0x4f1d('0x6')]('/:id/teams',auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x1d')]);router['get']('/:id/lists',auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x1e')]);router[_0x4f1d('0x6')](_0x4f1d('0x1f'),auth['isAuthenticated'](),controller[_0x4f1d('0x20')]);router['get']('/:id/prefixes',auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x21')]);router['get'](_0x4f1d('0x22'),auth['isAuthenticated'](),controller['getFaxAccounts']);router[_0x4f1d('0x6')](_0x4f1d('0x23'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x24')]);router[_0x4f1d('0x6')](_0x4f1d('0x25'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x26')]);router['get'](_0x4f1d('0x27'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x28')]);router['get'](_0x4f1d('0x29'),auth[_0x4f1d('0x7')](),controller['getChatWebsites']);router['get'](_0x4f1d('0x2a'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x2b')]);router['get'](_0x4f1d('0x2c'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x2d')]);router[_0x4f1d('0x6')](_0x4f1d('0x2e'),auth['isAuthenticated'](),controller[_0x4f1d('0x2f')]);router['post']('/:id/contacts',auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x30')]);router[_0x4f1d('0x31')]('/',auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x32')]);router['post'](_0x4f1d('0x33'),auth['isAuthenticated'](),controller[_0x4f1d('0x34')]);router[_0x4f1d('0x31')](_0x4f1d('0x35'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x36')]);var upload=multer({'storage':multer[_0x4f1d('0x37')]({'destination':function(_0x418bb4,_0x5e49f2,_0x4b2ea0){_0x4b2ea0(null,path['join'](config[_0x4f1d('0x38')],_0x4f1d('0x39')));},'filename':function(_0x1f1f5b,_0x126c7d,_0x534384){_0x534384(null,util[_0x4f1d('0x3a')](_0x4f1d('0x3b'),Date[_0x4f1d('0x3c')](),_0x126c7d['originalname']));}})});router[_0x4f1d('0x31')](_0x4f1d('0x3d'),upload[_0x4f1d('0x3e')](_0x4f1d('0x3f')),controller['addAvatar']);router['post']('/:id/login',auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x40')]);router['post']('/:id/logout',auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x41')]);router[_0x4f1d('0x31')](_0x4f1d('0x42'),auth[_0x4f1d('0x7')](),controller['pause']);router[_0x4f1d('0x31')]('/:id/unpause',auth['isAuthenticated'](),controller[_0x4f1d('0x43')]);router['post'](_0x4f1d('0x44'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x45')]);router[_0x4f1d('0x31')](_0x4f1d('0x46'),auth[_0x4f1d('0x7')](),controller['addChatInteractions']);router['post'](_0x4f1d('0x47'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x48')]);router[_0x4f1d('0x31')](_0x4f1d('0x49'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x4a')]);router['post'](_0x4f1d('0x4b'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x4c')]);router[_0x4f1d('0x31')](_0x4f1d('0x4d'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x4e')]);router['post'](_0x4f1d('0x4f'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x50')]);router[_0x4f1d('0x31')](_0x4f1d('0x22'),auth[_0x4f1d('0x7')](),controller['addFaxAccounts']);router[_0x4f1d('0x31')]('/:id/mail_accounts',auth[_0x4f1d('0x7')](),controller['addMailAccounts']);router['post'](_0x4f1d('0x25'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x51')]);router[_0x4f1d('0x31')](_0x4f1d('0x27'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x52')]);router[_0x4f1d('0x31')](_0x4f1d('0x29'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x53')]);router[_0x4f1d('0x31')](_0x4f1d('0x2a'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0x4f1d('0x31')](_0x4f1d('0x2e'),auth[_0x4f1d('0x7')](),controller['createApiKey']);router[_0x4f1d('0x54')](_0x4f1d('0x55'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x56')]);router['put'](_0x4f1d('0x57'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x58')]);router[_0x4f1d('0x59')](_0x4f1d('0x35'),auth['isAuthenticated'](),controller[_0x4f1d('0x5a')]);router[_0x4f1d('0x59')](_0x4f1d('0x44'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x5b')]);router[_0x4f1d('0x59')]('/:id',auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x5c')]);router[_0x4f1d('0x59')](_0x4f1d('0x46'),auth['isAuthenticated'](),controller[_0x4f1d('0x5d')]);router[_0x4f1d('0x59')](_0x4f1d('0x47'),auth[_0x4f1d('0x7')](),controller['removeMailInteractions']);router[_0x4f1d('0x59')](_0x4f1d('0x49'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x5e')]);router[_0x4f1d('0x59')](_0x4f1d('0x4b'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x5f')]);router['delete'](_0x4f1d('0x4d'),auth[_0x4f1d('0x7')](),controller['removeOpenchannelInteractions']);router[_0x4f1d('0x59')](_0x4f1d('0x4f'),auth['isAuthenticated'](),controller[_0x4f1d('0x60')]);router[_0x4f1d('0x59')](_0x4f1d('0x22'),auth['isAuthenticated'](),controller[_0x4f1d('0x61')]);router[_0x4f1d('0x59')](_0x4f1d('0x23'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x62')]);router[_0x4f1d('0x59')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x4f1d('0x63')]);router['delete'](_0x4f1d('0x27'),auth[_0x4f1d('0x7')](),controller['removeSmsAccounts']);router[_0x4f1d('0x59')]('/:id/chat_websites',auth[_0x4f1d('0x7')](),controller['removeChatWebsites']);router['delete'](_0x4f1d('0x2a'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x64')]);router[_0x4f1d('0x59')](_0x4f1d('0x2e'),auth[_0x4f1d('0x7')](),controller['removeApiKey']);router['post'](_0x4f1d('0x65'),auth[_0x4f1d('0x7')](),controller['messengerSoundNotification']);module['exports']=router; \ No newline at end of file +var _0x3c8e=['/:id/chat_websites','/:id/whatsapp_accounts','addWhatsappAccounts','update','put','/:id/password','changePassword','delete','removeQueues','removeTeams','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','isAuthenticated','describe','/whoami','whoami','/presence','/:id','getAvatar','getOpenTabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/:id/contacts','addContacts','create','/create_many','addQueues','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/logout','/:id/pause','pause','/:id/unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts'];(function(_0x802997,_0x5534a2){var _0x35c641=function(_0x22c4f2){while(--_0x22c4f2){_0x802997['push'](_0x802997['shift']());}};_0x35c641(++_0x5534a2);}(_0x3c8e,0x89));var _0xe3c8=function(_0x4cc77b,_0x26e138){_0x4cc77b=_0x4cc77b-0x0;var _0x305fa6=_0x3c8e[_0x4cc77b];return _0x305fa6;};'use strict';var multer=require(_0xe3c8('0x0'));var util=require(_0xe3c8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe3c8('0x2'));var router=express[_0xe3c8('0x3')]();var fs_extra=require(_0xe3c8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe3c8('0x5'));var config=require(_0xe3c8('0x6'));var controller=require(_0xe3c8('0x7'));router[_0xe3c8('0x8')]('/',auth['isAuthenticated'](),controller[_0xe3c8('0x9')]);router[_0xe3c8('0x8')](_0xe3c8('0xa'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0xc')]);router['get'](_0xe3c8('0xd'),auth['isAuthenticated'](),controller[_0xe3c8('0xe')]);router[_0xe3c8('0x8')](_0xe3c8('0xf'),auth[_0xe3c8('0xb')](),controller['getPresence']);router[_0xe3c8('0x8')](_0xe3c8('0x10'),auth[_0xe3c8('0xb')](),controller['show']);router[_0xe3c8('0x8')]('/:id/avatar',controller[_0xe3c8('0x11')]);router['get']('/:id/open_tabs',auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x12')]);router[_0xe3c8('0x8')]('/:id/contacts',auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x13')]);router[_0xe3c8('0x8')](_0xe3c8('0x14'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x15')]);router['get'](_0xe3c8('0x16'),auth[_0xe3c8('0xb')](),controller['getVoiceQueuesRt']);router[_0xe3c8('0x8')](_0xe3c8('0x17'),auth[_0xe3c8('0xb')](),controller['getGroups']);router[_0xe3c8('0x8')](_0xe3c8('0x18'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x19')]);router[_0xe3c8('0x8')](_0xe3c8('0x1a'),auth[_0xe3c8('0xb')](),controller['getScreenRecordings']);router[_0xe3c8('0x8')](_0xe3c8('0x1b'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x1c')]);router[_0xe3c8('0x8')](_0xe3c8('0x1d'),auth['isAuthenticated'](),controller[_0xe3c8('0x1e')]);router[_0xe3c8('0x8')]('/:id/mail/interactions',auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x1f')]);router['get'](_0xe3c8('0x20'),auth[_0xe3c8('0xb')](),controller['getSmsInteractions']);router[_0xe3c8('0x8')](_0xe3c8('0x21'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x22')]);router[_0xe3c8('0x8')]('/:id/whatsapp/interactions',auth[_0xe3c8('0xb')](),controller['getWhatsappInteractions']);router['get']('/:id/teams',auth[_0xe3c8('0xb')](),controller['getTeams']);router[_0xe3c8('0x8')](_0xe3c8('0x23'),auth['isAuthenticated'](),controller[_0xe3c8('0x24')]);router['get'](_0xe3c8('0x25'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x26')]);router[_0xe3c8('0x8')](_0xe3c8('0x27'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x28')]);router['get']('/:id/fax_accounts',auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x29')]);router[_0xe3c8('0x8')]('/:id/mail_accounts',auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x2a')]);router[_0xe3c8('0x8')](_0xe3c8('0x2b'),auth['isAuthenticated'](),controller[_0xe3c8('0x2c')]);router['get'](_0xe3c8('0x2d'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x2e')]);router[_0xe3c8('0x8')]('/:id/chat_websites',auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x2f')]);router[_0xe3c8('0x8')]('/:id/whatsapp_accounts',auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x30')]);router[_0xe3c8('0x8')](_0xe3c8('0x31'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x32')]);router['get'](_0xe3c8('0x33'),auth['isAuthenticated'](),controller[_0xe3c8('0x34')]);router[_0xe3c8('0x35')](_0xe3c8('0x36'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x37')]);router[_0xe3c8('0x35')]('/',auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x38')]);router['post'](_0xe3c8('0x39'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0xe3c8('0x35')](_0xe3c8('0x14'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x3a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x462b04,_0x4c5f06,_0x26e8ad){_0x26e8ad(null,path[_0xe3c8('0x3b')](config[_0xe3c8('0x3c')],_0xe3c8('0x3d')));},'filename':function(_0x308a74,_0x543d70,_0x257c02){_0x257c02(null,util[_0xe3c8('0x3e')](_0xe3c8('0x3f'),Date[_0xe3c8('0x40')](),_0x543d70[_0xe3c8('0x41')]));}})});router['post']('/:id/avatar',upload[_0xe3c8('0x42')](_0xe3c8('0x43')),controller[_0xe3c8('0x44')]);router[_0xe3c8('0x35')]('/:id/login',auth[_0xe3c8('0xb')](),controller['login']);router[_0xe3c8('0x35')](_0xe3c8('0x45'),auth[_0xe3c8('0xb')](),controller['logout']);router[_0xe3c8('0x35')](_0xe3c8('0x46'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x47')]);router[_0xe3c8('0x35')](_0xe3c8('0x48'),auth[_0xe3c8('0xb')](),controller['unpause']);router['post'](_0xe3c8('0x49'),auth['isAuthenticated'](),controller[_0xe3c8('0x4a')]);router[_0xe3c8('0x35')](_0xe3c8('0x4b'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x4c')]);router[_0xe3c8('0x35')]('/:id/mail_interactions',auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x4d')]);router[_0xe3c8('0x35')](_0xe3c8('0x4e'),auth['isAuthenticated'](),controller['addFaxInteractions']);router['post']('/:id/sms_interactions',auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x4f')]);router[_0xe3c8('0x35')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0xe3c8('0x50')]);router[_0xe3c8('0x35')](_0xe3c8('0x51'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x52')]);router[_0xe3c8('0x35')](_0xe3c8('0x53'),auth['isAuthenticated'](),controller[_0xe3c8('0x54')]);router[_0xe3c8('0x35')](_0xe3c8('0x55'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x56')]);router[_0xe3c8('0x35')]('/:id/openchannel_accounts',auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x57')]);router['post']('/:id/sms_accounts',auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x58')]);router['post'](_0xe3c8('0x59'),auth[_0xe3c8('0xb')](),controller['addChatWebsites']);router[_0xe3c8('0x35')](_0xe3c8('0x5a'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x5b')]);router[_0xe3c8('0x35')](_0xe3c8('0x33'),auth[_0xe3c8('0xb')](),controller['createApiKey']);router['put'](_0xe3c8('0x10'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x5c')]);router[_0xe3c8('0x5d')](_0xe3c8('0x5e'),auth['isAuthenticated'](),controller[_0xe3c8('0x5f')]);router[_0xe3c8('0x60')](_0xe3c8('0x14'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x61')]);router[_0xe3c8('0x60')]('/:id/teams',auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x62')]);router[_0xe3c8('0x60')](_0xe3c8('0x10'),auth[_0xe3c8('0xb')](),controller['destroy']);router['delete'](_0xe3c8('0x4b'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x63')]);router[_0xe3c8('0x60')](_0xe3c8('0x64'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x65')]);router[_0xe3c8('0x60')](_0xe3c8('0x4e'),auth['isAuthenticated'](),controller[_0xe3c8('0x66')]);router[_0xe3c8('0x60')](_0xe3c8('0x67'),auth['isAuthenticated'](),controller['removeSmsInteractions']);router['delete'](_0xe3c8('0x68'),auth[_0xe3c8('0xb')](),controller['removeOpenchannelInteractions']);router[_0xe3c8('0x60')](_0xe3c8('0x51'),auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router['delete']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xe3c8('0x69')]);router['delete'](_0xe3c8('0x55'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x6a')]);router[_0xe3c8('0x60')](_0xe3c8('0x2b'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x6b')]);router['delete'](_0xe3c8('0x2d'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x6c')]);router[_0xe3c8('0x60')]('/:id/chat_websites',auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x6d')]);router[_0xe3c8('0x60')](_0xe3c8('0x5a'),auth[_0xe3c8('0xb')](),controller['removeWhatsappAccounts']);router['delete'](_0xe3c8('0x33'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x6e')]);router['post'](_0xe3c8('0x6f'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0x70')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 8a3312a..c653639 100644 --- a/server/api/user/user.attributes.js +++ b/server/api/user/user.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x92b5=['info','shortinfo','auto','yes','nonat','update','outgoing','force_rport,comedia','join','nat','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','TEXT','showWebBar','get','isArray','udp','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','getDataValue','internal','email','toLowerCase','ENUM','admin','user','telephone','local','INTEGER','\x22%s\x22\x20<%s>','BOOLEAN','DATE','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833'];(function(_0x1150dc,_0x2b8fee){var _0x3ad6bd=function(_0xe6ff2b){while(--_0xe6ff2b){_0x1150dc['push'](_0x1150dc['shift']());}};_0x3ad6bd(++_0x2b8fee);}(_0x92b5,0x149));var _0x592b=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x92b5[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require(_0x592b('0x0'));var moment=require(_0x592b('0x1'));var util=require(_0x592b('0x2'));var _=require(_0x592b('0x3'));module[_0x592b('0x4')]={'name':{'type':Sequelize[_0x592b('0x5')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5d08c3){this['setDataValue'](_0x592b('0x6'),_0x5d08c3);this[_0x592b('0x7')](_0x592b('0x8'),_0x5d08c3);},'comment':_0x592b('0x9')},'fullname':{'type':Sequelize[_0x592b('0x5')],'allowNull':![],'set':function(_0x2c41d4){this[_0x592b('0x7')](_0x592b('0xa'),_0x2c41d4);this[_0x592b('0x7')](_0x592b('0xb'),util[_0x592b('0xc')]('\x22%s\x22\x20<%s>',_0x2c41d4,this[_0x592b('0xd')](_0x592b('0xe'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x592b('0x5')],'allowNull':![],'unique':_0x592b('0xf'),'validate':{'isEmail':!![]},'set':function(_0x3123e7){if(_0x3123e7){this['setDataValue'](_0x592b('0xf'),_0x3123e7[_0x592b('0x10')]());}}},'role':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x12'),_0x592b('0x13'),'agent',_0x592b('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x592b('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x592b('0x5')],'defaultValue':_0x592b('0x15')},'internal':{'type':Sequelize[_0x592b('0x16')](0xb),'allowNull':![],'unique':'internal','set':function(_0x281fd7){this[_0x592b('0x7')](_0x592b('0xe'),_0x281fd7);this[_0x592b('0x7')]('accountcode',_0x281fd7);this[_0x592b('0x7')](_0x592b('0xb'),util[_0x592b('0xc')](_0x592b('0x17'),this[_0x592b('0xd')](_0x592b('0xa')),_0x281fd7));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x592b('0x5')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x592b('0x5')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x592b('0x5')]},'country':{'type':Sequelize[_0x592b('0x5')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x592b('0x5')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x592b('0x19')]},'chatCapacity':{'type':Sequelize[_0x592b('0x16')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x592b('0x16')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x592b('0x16')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x592b('0x16')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x592b('0x16')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x592b('0x18')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x592b('0x16')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x592b('0x16')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x592b('0x16')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x592b('0x16')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x1a'),'user','peer'),'allowNull':!![],'defaultValue':_0x592b('0x1a')},'context':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![],'defaultValue':_0x592b('0x1b')},'callingpres':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x1c'),'ALLOWED_PASSED_SCREEN',_0x592b('0x1d'),_0x592b('0x1e'),_0x592b('0x1f'),_0x592b('0x20'),_0x592b('0x21'),_0x592b('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'permit':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'secret':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3fb77b){this['setDataValue'](_0x592b('0x23'),_0x3fb77b?_0x3fb77b['join'](','):null);},'get':function(){return this['getDataValue']('transport')?this['getDataValue'](_0x592b('0x23'))[_0x592b('0x24')](','):null;},'comment':_0x592b('0x25')},'dtmfmode':{'type':Sequelize['ENUM'](_0x592b('0x26'),_0x592b('0x27'),_0x592b('0x28'),'inband',_0x592b('0x29')),'allowNull':!![],'defaultValue':_0x592b('0x26')},'directmedia':{'type':Sequelize['ENUM'](_0x592b('0x2a'),'no',_0x592b('0x2b'),_0x592b('0x2c'),_0x592b('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![],'defaultValue':_0x592b('0x2e'),'set':function(_0x51c7ee){this[_0x592b('0x7')]('nat',_0x51c7ee?_0x51c7ee[_0x592b('0x2f')](','):null);},'get':function(){return this[_0x592b('0xd')]('nat')?this['getDataValue'](_0x592b('0x30'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x592b('0x5')]},'namedcallgroup':{'type':Sequelize[_0x592b('0x5')]},'pickupgroup':{'type':Sequelize[_0x592b('0x5')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x592b('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x592b('0x5')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x592b('0x31'),'set':function(_0x4b7460){this['setDataValue'](_0x592b('0x32'),_0x4b7460?_0x4b7460['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x592b('0xd')]('allow')?this[_0x592b('0xd')]('allow')['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![],'set':function(_0x21df42){this[_0x592b('0x7')]('insecure',_0x21df42?_0x21df42[_0x592b('0x2f')](','):null);},'get':function(){return this[_0x592b('0xd')](_0x592b('0x33'))?this[_0x592b('0xd')](_0x592b('0x33'))[_0x592b('0x24')](','):null;},'comment':_0x592b('0x34')},'trustrpid':{'type':Sequelize['ENUM'](_0x592b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x2a'),'no',_0x592b('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x592b('0x11')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x592b('0x16')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x592b('0x2a')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x592b('0x11')]('yes','no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x592b('0x16')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x592b('0x11')]('accept',_0x592b('0x36'),_0x592b('0x37')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x592b('0x16')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x592b('0x16')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x38'),_0x592b('0x39')),'allowNull':!![],'defaultValue':_0x592b('0x39')},'t38pt_usertpsource':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0x592b('0x2a')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x592b('0x16')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x592b('0x16')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x592b('0x16')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x592b('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x592b('0x16')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x592b('0x16')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x592b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x592b('0x11')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x592b('0x11')]('yes','no',_0x592b('0x3a'),_0x592b('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x592b('0x16')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x592b('0x11')]('active',_0x592b('0x3c'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x592b('0x16')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x592b('0x11')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x592b('0x11')]('yes','no',_0x592b('0x2b'),_0x592b('0x2c'),_0x592b('0x3d')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x592b('0x5')]},'resetPasswordExpires':{'type':Sequelize[_0x592b('0x19')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x592b('0x3e')]},'showWebBar':{'type':Sequelize[_0x592b('0x16')],'defaultValue':0x0,'set':function(_0x5a6b55){this[_0x592b('0x7')](_0x592b('0x3f'),_0x5a6b55);var _0x245c21=this[_0x592b('0x40')]({'plain':!![]});switch(_0x5a6b55){case 0x0:case 0x1:var _0x3b9556=_0x245c21[_0x592b('0x23')]?_[_0x592b('0x41')](_0x245c21['transport'])?_0x245c21[_0x592b('0x23')]['join']():_0x245c21['transport']:_0x592b('0x42');if(_0x3b9556==='wss'){_0x3b9556=_0x592b('0x42');}this['setDataValue'](_0x592b('0x23'),_0x3b9556);this[_0x592b('0x7')](_0x592b('0x43'),'no');this[_0x592b('0x7')](_0x592b('0x44'),null);this[_0x592b('0x7')](_0x592b('0x45'),null);this[_0x592b('0x7')](_0x592b('0x46'),null);this[_0x592b('0x7')](_0x592b('0x47'),null);this[_0x592b('0x7')](_0x592b('0x48'),null);this['setDataValue'](_0x592b('0x49'),null);this['setDataValue'](_0x592b('0x4a'),null);this[_0x592b('0x7')](_0x592b('0x4b'),null);this[_0x592b('0x7')](_0x592b('0x4c'),'no');break;case 0x2:this['setDataValue'](_0x592b('0x23'),_0x592b('0x4d'));this[_0x592b('0x7')]('encryption',_0x592b('0x2a'));this['setDataValue'](_0x592b('0x44'),'yes');this[_0x592b('0x7')]('force_avp','yes');this[_0x592b('0x7')](_0x592b('0x46'),_0x592b('0x2a'));this[_0x592b('0x7')](_0x592b('0x47'),_0x592b('0x2a'));this[_0x592b('0x7')](_0x592b('0x48'),'no');this[_0x592b('0x7')](_0x592b('0x49'),_0x592b('0x4e'));this[_0x592b('0x7')]('dtlscertfile',_0x245c21[_0x592b('0x4a')]||_0x592b('0x4f'));this[_0x592b('0x7')]('dtlsprivatekey',_0x245c21[_0x592b('0x4b')]||_0x592b('0x50'));this[_0x592b('0x7')](_0x592b('0x4c'),_0x592b('0x2a'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x54c050){this[_0x592b('0x7')]('permissions',_0x54c050?_0x54c050[_0x592b('0x2f')](','):[]);},'get':function(){return this[_0x592b('0xd')](_0x592b('0x51'))?_[_0x592b('0x52')](this[_0x592b('0xd')](_0x592b('0x51'))[_0x592b('0x24')](','),function(_0x584437){return parseInt(_0x584437,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x592b('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x592b('0x5')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x592b('0x18')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x592b('0x18')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x592b('0x16')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x592b('0x11')](_0x592b('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x592b('0x18')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x592b('0x5')]},'phoneBarEnableJaws':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0x592b('0xd')](_0x592b('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'interface':{'type':Sequelize[_0x592b('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x592b('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x29f623){if(typeof _0x29f623===_0x592b('0x54')){var _0x1df719=_0x29f623==='1'?!![]:_0x29f623==='0'?![]:_0x29f623===_0x592b('0x55')?!![]:_0x29f623===_0x592b('0x56')?![]:![];this[_0x592b('0x7')](_0x592b('0x57'),_0x1df719);}else{this[_0x592b('0x7')]('screenrecording',_0x29f623);}}},'blocked':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![],'set':function(_0x55a1c7){this[_0x592b('0x7')](_0x592b('0x58'),_0x55a1c7);if(_0x55a1c7===!![]){this[_0x592b('0x7')]('blockedAt',moment());this[_0x592b('0x7')](_0x592b('0x59'),0x0);}else{this[_0x592b('0x7')](_0x592b('0x5a'),null);}}},'blockedAt':{'type':Sequelize[_0x592b('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x592b('0x16')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x592b('0x18')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x592b('0x16')](0x5)[_0x592b('0x5b')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x592b('0x18')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x592b('0x16')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x592b('0x16')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x592b('0x16')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x592b('0x16')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x592b('0x16')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x592b('0x16')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x592b('0x18')],'defaultValue':![]}}; \ No newline at end of file +var _0x9b5a=['ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update','TEXT','get','isArray','udp','encryption','avpf','force_avp','icesupport','dtlsverify','dtlscertfile','wss','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','lodash','exports','STRING','setDataValue','name','fullname','format','\x22%s\x22\x20<%s>','getDataValue','email','toLowerCase','ENUM','admin','agent','local','INTEGER','internal','accountcode','callerid','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','user','from-sip','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','yes','nonat','outgoing','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all'];(function(_0xbd4746,_0x9ca2c8){var _0x2afcef=function(_0x5c6a0b){while(--_0x5c6a0b){_0xbd4746['push'](_0xbd4746['shift']());}};_0x2afcef(++_0x9ca2c8);}(_0x9b5a,0x194));var _0xa9b5=function(_0x10ec3c,_0xc507ad){_0x10ec3c=_0x10ec3c-0x0;var _0x21dd46=_0x9b5a[_0x10ec3c];return _0x21dd46;};'use strict';var Sequelize=require(_0xa9b5('0x0'));var moment=require(_0xa9b5('0x1'));var util=require('util');var _=require(_0xa9b5('0x2'));module[_0xa9b5('0x3')]={'name':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3854c5){this[_0xa9b5('0x5')](_0xa9b5('0x6'),_0x3854c5);this[_0xa9b5('0x5')]('defaultuser',_0x3854c5);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x49deef){this[_0xa9b5('0x5')](_0xa9b5('0x7'),_0x49deef);this[_0xa9b5('0x5')]('callerid',util[_0xa9b5('0x8')](_0xa9b5('0x9'),_0x49deef,this[_0xa9b5('0xa')]('internal')));}},'alias':{'type':Sequelize[_0xa9b5('0x4')]},'email':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':![],'unique':_0xa9b5('0xb'),'validate':{'isEmail':!![]},'set':function(_0x193ca8){if(_0x193ca8){this[_0xa9b5('0x5')](_0xa9b5('0xb'),_0x193ca8[_0xa9b5('0xc')]());}}},'role':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0xe'),'user',_0xa9b5('0xf'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xa9b5('0x4')],'defaultValue':_0xa9b5('0x10')},'internal':{'type':Sequelize[_0xa9b5('0x11')](0xb),'allowNull':![],'unique':'internal','set':function(_0x4608e4){this[_0xa9b5('0x5')](_0xa9b5('0x12'),_0x4608e4);this[_0xa9b5('0x5')](_0xa9b5('0x13'),_0x4608e4);this[_0xa9b5('0x5')](_0xa9b5('0x14'),util[_0xa9b5('0x8')]('\x22%s\x22\x20<%s>',this['getDataValue'](_0xa9b5('0x7')),_0x4608e4));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xa9b5('0x4')]},'mobile':{'type':Sequelize[_0xa9b5('0x4')]},'address':{'type':Sequelize[_0xa9b5('0x4')]},'zipcode':{'type':Sequelize[_0xa9b5('0x4')]},'userpic':{'type':Sequelize[_0xa9b5('0x4')]},'city':{'type':Sequelize[_0xa9b5('0x4')]},'country':{'type':Sequelize[_0xa9b5('0x4')]},'online':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xa9b5('0x16')]},'voicePause':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xa9b5('0x4')],'defaultValue':_0xa9b5('0x17')},'lastPauseAt':{'type':Sequelize[_0xa9b5('0x16')]},'chatCapacity':{'type':Sequelize[_0xa9b5('0x11')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xa9b5('0x11')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xa9b5('0x11')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xa9b5('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xa9b5('0x11')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xa9b5('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xa9b5('0x11')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xa9b5('0x11')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xa9b5('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xa9b5('0x18'),_0xa9b5('0x19'),'peer'),'allowNull':!![],'defaultValue':_0xa9b5('0x18')},'context':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![],'defaultValue':_0xa9b5('0x1a')},'callingpres':{'type':Sequelize['ENUM'](_0xa9b5('0x1b'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0xa9b5('0x1c'),_0xa9b5('0x1d'),'PROHIB_PASSED_SCREEN',_0xa9b5('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![],'defaultValue':'udp','set':function(_0x18eedc){this[_0xa9b5('0x5')](_0xa9b5('0x1f'),_0x18eedc?_0x18eedc['join'](','):null);},'get':function(){return this[_0xa9b5('0xa')](_0xa9b5('0x1f'))?this[_0xa9b5('0xa')]('transport')[_0xa9b5('0x20')](','):null;},'comment':_0xa9b5('0x21')},'dtmfmode':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x22'),_0xa9b5('0x23'),_0xa9b5('0x24'),'inband',_0xa9b5('0x25')),'allowNull':!![],'defaultValue':_0xa9b5('0x22')},'directmedia':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no',_0xa9b5('0x27'),'update',_0xa9b5('0x28')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![],'defaultValue':_0xa9b5('0x29'),'set':function(_0x2365f2){this[_0xa9b5('0x5')](_0xa9b5('0x2a'),_0x2365f2?_0x2365f2[_0xa9b5('0x2b')](','):null);},'get':function(){return this['getDataValue'](_0xa9b5('0x2a'))?this[_0xa9b5('0xa')]('nat')[_0xa9b5('0x20')](','):null;},'comment':_0xa9b5('0x2c')},'callgroup':{'type':Sequelize[_0xa9b5('0x4')]},'namedcallgroup':{'type':Sequelize[_0xa9b5('0x4')]},'pickupgroup':{'type':Sequelize[_0xa9b5('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa9b5('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xa9b5('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa9b5('0x2d')},'allow':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':![],'defaultValue':_0xa9b5('0x2e'),'set':function(_0x5cf1fc){this['setDataValue']('allow',_0x5cf1fc?_0x5cf1fc[_0xa9b5('0x2b')](';'):_0xa9b5('0x2e'));},'get':function(){return this[_0xa9b5('0xa')](_0xa9b5('0x2f'))?this[_0xa9b5('0xa')](_0xa9b5('0x2f'))['split'](';'):null;},'comment':_0xa9b5('0x30')},'autoframing':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![],'set':function(_0x3a91fc){this[_0xa9b5('0x5')](_0xa9b5('0x31'),_0x3a91fc?_0x3a91fc['join'](','):null);},'get':function(){return this[_0xa9b5('0xa')](_0xa9b5('0x31'))?this[_0xa9b5('0xa')](_0xa9b5('0x31'))[_0xa9b5('0x20')](','):null;},'comment':_0xa9b5('0x32')},'trustrpid':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa9b5('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xa9b5('0x26'),'no',_0xa9b5('0x33')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xa9b5('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa9b5('0x34')},'amaflags':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xa9b5('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no',_0xa9b5('0x35')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x36'),_0xa9b5('0x37'),_0xa9b5('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x39'),_0xa9b5('0x3a')),'allowNull':!![],'defaultValue':_0xa9b5('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xa9b5('0x26'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xa9b5('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xa9b5('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xa9b5('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xa9b5('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xa9b5('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xa9b5('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xa9b5('0xd')]('yes','no',_0xa9b5('0x3b'),_0xa9b5('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xa9b5('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x3d'),_0xa9b5('0x3e'),_0xa9b5('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xa9b5('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xa9b5('0xd')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xa9b5('0xd')](_0xa9b5('0x26'),'no',_0xa9b5('0x27'),_0xa9b5('0x40'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xa9b5('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xa9b5('0x16')]},'passwordResetAt':{'type':Sequelize[_0xa9b5('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xa9b5('0x41')]},'showWebBar':{'type':Sequelize[_0xa9b5('0x11')],'defaultValue':0x0,'set':function(_0x3f8c47){this['setDataValue']('showWebBar',_0x3f8c47);var _0x26e436=this[_0xa9b5('0x42')]({'plain':!![]});switch(_0x3f8c47){case 0x0:case 0x1:var _0x416607=_0x26e436[_0xa9b5('0x1f')]?_[_0xa9b5('0x43')](_0x26e436[_0xa9b5('0x1f')])?_0x26e436[_0xa9b5('0x1f')][_0xa9b5('0x2b')]():_0x26e436['transport']:_0xa9b5('0x44');if(_0x416607==='wss'){_0x416607='udp';}this[_0xa9b5('0x5')](_0xa9b5('0x1f'),_0x416607);this[_0xa9b5('0x5')](_0xa9b5('0x45'),'no');this['setDataValue'](_0xa9b5('0x46'),null);this['setDataValue'](_0xa9b5('0x47'),null);this[_0xa9b5('0x5')](_0xa9b5('0x48'),null);this['setDataValue']('dtlsenable',null);this[_0xa9b5('0x5')](_0xa9b5('0x49'),null);this[_0xa9b5('0x5')]('dtlssetup',null);this[_0xa9b5('0x5')](_0xa9b5('0x4a'),null);this[_0xa9b5('0x5')]('dtlsprivatekey',null);this[_0xa9b5('0x5')]('rtcp_mux','no');break;case 0x2:this[_0xa9b5('0x5')](_0xa9b5('0x1f'),_0xa9b5('0x4b'));this['setDataValue']('encryption',_0xa9b5('0x26'));this[_0xa9b5('0x5')](_0xa9b5('0x46'),_0xa9b5('0x26'));this[_0xa9b5('0x5')]('force_avp',_0xa9b5('0x26'));this[_0xa9b5('0x5')](_0xa9b5('0x48'),_0xa9b5('0x26'));this[_0xa9b5('0x5')]('dtlsenable',_0xa9b5('0x26'));this[_0xa9b5('0x5')](_0xa9b5('0x49'),'no');this[_0xa9b5('0x5')]('dtlssetup',_0xa9b5('0x3f'));this[_0xa9b5('0x5')]('dtlscertfile',_0x26e436[_0xa9b5('0x4a')]||_0xa9b5('0x4c'));this[_0xa9b5('0x5')](_0xa9b5('0x4d'),_0x26e436[_0xa9b5('0x4d')]||_0xa9b5('0x4e'));this[_0xa9b5('0x5')](_0xa9b5('0x4f'),_0xa9b5('0x26'));break;default:}}},'permissions':{'type':Sequelize[_0xa9b5('0x41')],'set':function(_0x2e6b7f){this['setDataValue'](_0xa9b5('0x50'),_0x2e6b7f?_0x2e6b7f['join'](','):[]);},'get':function(){return this['getDataValue'](_0xa9b5('0x50'))?_[_0xa9b5('0x51')](this[_0xa9b5('0xa')](_0xa9b5('0x50'))[_0xa9b5('0x20')](','),function(_0x3ba59e){return parseInt(_0x3ba59e,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xa9b5('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xa9b5('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xa9b5('0x11')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xa9b5('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xa9b5('0x26'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xa9b5('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xa9b5('0x52')],'get':function(){return this[_0xa9b5('0xa')]('phoneBarEnableScreenRecordingByAgent')?this[_0xa9b5('0xa')](_0xa9b5('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0xa9b5('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xa9b5('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![],'set':function(_0x57fa4d){if(typeof _0x57fa4d==='string'){var _0x17b4b1=_0x57fa4d==='1'?!![]:_0x57fa4d==='0'?![]:_0x57fa4d==='true'?!![]:_0x57fa4d===_0xa9b5('0x54')?![]:![];this[_0xa9b5('0x5')]('screenrecording',_0x17b4b1);}else{this[_0xa9b5('0x5')](_0xa9b5('0x55'),_0x57fa4d);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x318e01){this[_0xa9b5('0x5')](_0xa9b5('0x56'),_0x318e01);if(_0x318e01===!![]){this[_0xa9b5('0x5')](_0xa9b5('0x57'),moment());this[_0xa9b5('0x5')](_0xa9b5('0x58'),0x0);}else{this[_0xa9b5('0x5')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xa9b5('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0xa9b5('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xa9b5('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0xa9b5('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xa9b5('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xa9b5('0x11')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0xa9b5('0x11')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0xa9b5('0x15')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index d449b4e..9fe9d0c 100644 --- a/server/api/user/user.controller.js +++ b/server/api/user/user.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd5cb=['../../mysqldb','socket.io-emitter','./user.socket','register','redis','defaults','localhost','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','request','info','User,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','then','emit','destroy','get','role','admin','Users','user','agent','Telephones','telephone','filter','ignore','includes','find','value','stack','name','send','User','rawAttributes','map','fieldName','type','key','password','salt','previousPasswords','index','getOptions','where','query','includeAll','userSetting','include','UserSetting','attributes','push','findAll','rows','openTabs','true','chat','dataValues','sms','fax','whatsapp','all','show','params','merge','options','openchannel','mail','update','body','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern','isNil','min_internal','sequelize','QueryTypes','length','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','110','104','106','107','108','109','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','Agents','autoAssociation','UserProfileResource','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','isEmpty','compact','changePassword','newPassword','authenticate','oldPassword','Sequelize','ValidationError','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','validatePasswordHistory','passwordHistoryLimit','channel','online','interface','isValidChannel','Unknown\x20channel','add','capitalize','Queues','penalty','spread','toLowerCase','QueueId','voice','format','voicePause','UserVoiceQueueRt','upsert','removeQueues','isArray','Queue:remove','addAvatar','userpic','file','filename','getAvatar','join','root','download','server/files/images/','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MAIL','SmsOpenTabs','SMS','findOne','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','CmList','List','Tag','tag','model','keys','Queue','filters','intersection','fields','order','sort','Unknown\x20role','nolimit','getVoiceQueuesRt','pick','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','mobile','loginInPause','LOCAL/%s@from-sip/n','SIP/%s','intrf','user:%s','user:forcelogout','remoteAddress','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','MemberReport','getChannels','forEach','LOGIN','PAUSE','LOGININPAUSE','concat','isMiddleware','logout','YYYY-MM-DD\x20HH:mm:ss','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','getTeams','Team','addTeams','resolve','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','flattenDeep','addAgent','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Queue:save','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeAgent','getDataValue','getLists','getAgents','getVoiceQueues','values','You\x20can\x27t\x20delete\x20yourself','CmHopper','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','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','ChatWebsite','getChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','$gt','$gte','$lt','$ne','$eq','$not','$between','$notBetween','$in','$iLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','phone','CmContact','Contact','dialActive','VoiceQueue','getApiKey','retrieveApiKey','token','createApiKey','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','unknown','ringing','teams','inbound','flatten','toString','col','asc','desc','substring','orderBy','offline','unavailable','voiceStatus','busy','slice','charAt','toUpperCase','SELECT','select','field','InteractionId','ui.createdAt','user_has_','_interactions','OpenTabs','messengerSoundNotification','enabled','moment','util','path','lodash','squel','ioredis','jayson/promise','../../components/auth/service','../../components/contacts','../../components/parsers/qs','../../components/realtime/agents','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APINotFoundError','APIForbiddenrror','handleError'];(function(_0x5682f9,_0x3fe9ac){var _0xb0f788=function(_0x9923e3){while(--_0x9923e3){_0x5682f9['push'](_0x5682f9['shift']());}};_0xb0f788(++_0x3fe9ac);}(_0xd5cb,0x181));var _0xbd5c=function(_0x472077,_0x2a35c6){_0x472077=_0x472077-0x0;var _0x3913dd=_0xd5cb[_0x472077];return _0x3913dd;};'use strict';var moment=require(_0xbd5c('0x0'));var util=require(_0xbd5c('0x1'));var path=require(_0xbd5c('0x2'));var fs=require('fs');var _=require(_0xbd5c('0x3'));var squel=require(_0xbd5c('0x4'));var Redis=require(_0xbd5c('0x5'));var jayson=require(_0xbd5c('0x6'));var authService=require(_0xbd5c('0x7'));var contacts=require(_0xbd5c('0x8'));var qs=require(_0xbd5c('0x9'));var rta=require(_0xbd5c('0xa'));var logger=require(_0xbd5c('0xb'))(_0xbd5c('0xc'));var utils=require(_0xbd5c('0xd'));var config=require(_0xbd5c('0xe'));var licenseUtil=require(_0xbd5c('0xf'));var APIBadRequestError=require(_0xbd5c('0x10'))['APIBadRequestError'];var APINotFoundError=require(_0xbd5c('0x10'))[_0xbd5c('0x11')];var APIForbiddenError=require('../../errors/api')[_0xbd5c('0x12')];var APIHandleError=require(_0xbd5c('0x10'))[_0xbd5c('0x13')];var db=require(_0xbd5c('0x14'))['db'];var socket=require(_0xbd5c('0x15'))(new Redis(config['redis']));require(_0xbd5c('0x16'))[_0xbd5c('0x17')](socket);config[_0xbd5c('0x18')]=_[_0xbd5c('0x19')](config[_0xbd5c('0x18')],{'host':_0xbd5c('0x1a'),'port':0x18eb});var amiClient=jayson['client']['http']({'port':0x232a});var values;function respondWithStatusCode(_0xba1485,_0x55ccf0){_0x55ccf0=_0x55ccf0||0xcc;return function(_0x20c5fe){if(_0x20c5fe){return _0xba1485[_0xbd5c('0x1b')](_0x55ccf0);}return _0xba1485[_0xbd5c('0x1c')](_0x55ccf0)[_0xbd5c('0x1d')]();};}function respondWithResult(_0x5764b3,_0x266f7c){_0x266f7c=_0x266f7c||0xc8;return function(_0x3f6083){if(_0x3f6083){return _0x5764b3[_0xbd5c('0x1c')](_0x266f7c)[_0xbd5c('0x1e')](_0x3f6083);}};}function respondWithFilteredResult(_0x26dddc,_0x59f2b4){return function(_0x4ed2e5){if(_0x4ed2e5){var _0x208f59=typeof _0x59f2b4[_0xbd5c('0x1f')]==='undefined'&&typeof _0x59f2b4[_0xbd5c('0x20')]===_0xbd5c('0x21');var _0x11a9d5=_0x4ed2e5['count'];var _0x475e99=_0x208f59?0x0:_0x59f2b4[_0xbd5c('0x1f')];var _0xfff6da=_0x208f59?_0x4ed2e5[_0xbd5c('0x22')]:_0x59f2b4[_0xbd5c('0x1f')]+_0x59f2b4[_0xbd5c('0x20')];var _0x4e8470;if(_0xfff6da>=_0x11a9d5){_0xfff6da=_0x11a9d5;_0x4e8470=0xc8;}else{_0x4e8470=0xce;}_0x26dddc[_0xbd5c('0x1c')](_0x4e8470);return _0x26dddc[_0xbd5c('0x23')](_0xbd5c('0x24'),_0x475e99+'-'+_0xfff6da+'/'+_0x11a9d5)[_0xbd5c('0x1e')](_0x4ed2e5);}return null;};}function respondWithRpcPromise(_0x3d6678,_0x20ab78,_0x2dfd87,_0x27d2b9){return new Promise(function(_0x3ee4d2,_0x4aa817){var _0x466440=_0x27d2b9||amiClient;return _0x466440[_0xbd5c('0x25')](_0x3d6678,_0x2dfd87)['then'](function(_0x59479b){logger[_0xbd5c('0x26')](_0xbd5c('0x27'),_0x20ab78,'request\x20sent');logger[_0xbd5c('0x28')]('User,\x20%s,\x20%s,\x20%s',_0x20ab78,_0xbd5c('0x29'),JSON[_0xbd5c('0x2a')](_0x59479b));if(_0x59479b[_0xbd5c('0x2b')]){if(_0x59479b[_0xbd5c('0x2b')][_0xbd5c('0x2c')]===0x1f4){logger[_0xbd5c('0x2b')](_0xbd5c('0x27'),_0x20ab78,_0x59479b[_0xbd5c('0x2b')][_0xbd5c('0x2d')]);return _0x4aa817(_0x59479b[_0xbd5c('0x2b')]['message']);}logger[_0xbd5c('0x2b')](_0xbd5c('0x27'),_0x20ab78,_0x59479b[_0xbd5c('0x2b')][_0xbd5c('0x2d')]);return _0x3ee4d2(_0x59479b[_0xbd5c('0x2b')][_0xbd5c('0x2d')]);}else{logger['info'](_0xbd5c('0x27'),_0x20ab78,_0xbd5c('0x29'));_0x3ee4d2(_0x59479b['result']['message']);}})[_0xbd5c('0x2e')](function(_0x1b36b0){logger['error'](_0xbd5c('0x27'),_0x20ab78,_0x1b36b0);_0x4aa817(_0x1b36b0);});});}function saveUpdates(_0x2b7128){return function(_0x13b9ab){if(_0x13b9ab){return _0x13b9ab['update'](_0x2b7128)[_0xbd5c('0x2f')](function(_0x2b1993){if(_0x2b1993['role']==='agent'){socket[_0xbd5c('0x30')]('userNotification:recalc:'+_0x2b1993['id'],_0x2b1993);}return _0x2b1993;});}return null;};}function removeEntity(_0x3f0d2b,_0x7a2b0d){return function(_0x248cb4){if(_0x248cb4){return _0x248cb4[_0xbd5c('0x31')]({'transaction':_0x7a2b0d})[_0xbd5c('0x2f')](function(){var _0x284be3=_0x248cb4[_0xbd5c('0x32')]({'plain':!![]});if(_0x284be3[_0xbd5c('0x33')]===_0xbd5c('0x34'))return;var _0x20bffd=[{'name':_0xbd5c('0x35'),'value':_0xbd5c('0x36'),'ignore':!![]},{'name':'Agents','value':_0xbd5c('0x37'),'ignore':![]},{'name':_0xbd5c('0x38'),'value':_0xbd5c('0x39'),'ignore':![]}];var _0x1aa1b7=_(_0x20bffd)[_0xbd5c('0x3a')](_0xbd5c('0x3b'))['map']('value')['value']();if(_[_0xbd5c('0x3c')](_0x1aa1b7,_0x284be3['role'])){return;}var _0x28a432=_[_0xbd5c('0x3d')](_0x20bffd,[_0xbd5c('0x3e'),_0x284be3[_0xbd5c('0x33')]])['name'];return db['UserProfileResource']['destroy']({'where':{'type':_0x28a432,'resourceId':_0x284be3['id']},'transaction':_0x7a2b0d})[_0xbd5c('0x2f')](function(){return _0x248cb4;});})[_0xbd5c('0x2f')](function(){_0x3f0d2b[_0xbd5c('0x1c')](0xcc)[_0xbd5c('0x1d')]();});}};}function handleEntityNotFound(_0x1354a5){return function(_0x19a82a){if(!_0x19a82a){_0x1354a5['sendStatus'](0x194);}return _0x19a82a;};}function handleError(_0x432df9,_0x471d5a){_0x471d5a=_0x471d5a||0x1f4;return function(_0x51badb){logger[_0xbd5c('0x2b')](_0x51badb[_0xbd5c('0x3f')]);if(_0x51badb['name']){delete _0x51badb[_0xbd5c('0x40')];}_0x432df9['status'](_0x471d5a)[_0xbd5c('0x41')](_0x51badb);};}function getUserAttributes(){return _(db[_0xbd5c('0x42')][_0xbd5c('0x43')])[_0xbd5c('0x44')](function(_0xe771b6){return{'name':_0xe771b6[_0xbd5c('0x45')],'type':_0xe771b6[_0xbd5c('0x46')][_0xbd5c('0x47')]};})[_0xbd5c('0x3a')](function(_0x4f2e10){return![_0xbd5c('0x48'),_0xbd5c('0x49'),_0xbd5c('0x4a'),'resetPasswordToken','resetPasswordExpires','md5secret'][_0xbd5c('0x3c')](_0x4f2e10[_0xbd5c('0x40')]);})['value']();}exports[_0xbd5c('0x4b')]=function(_0x5ad55d,_0x551343){var _0x271990={},_0x3daae4={'count':0x0,'rows':[]};var _0x225120=getUserAttributes();_0x271990=qs[_0xbd5c('0x4c')](_0x225120,_0x5ad55d);var _0x213ee5={'where':_0x271990[_0xbd5c('0x4d')]};return db[_0xbd5c('0x42')][_0xbd5c('0x22')](_0x213ee5)[_0xbd5c('0x2f')](function(_0x2c1f2e){_0x3daae4[_0xbd5c('0x22')]=_0x2c1f2e;if(_0x5ad55d[_0xbd5c('0x4e')][_0xbd5c('0x4f')]){_0x271990['include']=[{'all':!![]}];}if(_0x5ad55d[_0xbd5c('0x4e')][_0xbd5c('0x50')]==='true'){_0x271990[_0xbd5c('0x51')]=[{'model':db[_0xbd5c('0x52')],'as':'userSetting'}];}if(!_['includes'](_0x271990[_0xbd5c('0x53')],'id')){_0x271990[_0xbd5c('0x53')][_0xbd5c('0x54')]('id');}return db[_0xbd5c('0x42')][_0xbd5c('0x55')](_0x271990);})[_0xbd5c('0x2f')](function(_0x737f77){_0x3daae4[_0xbd5c('0x56')]=_0x737f77;if(_0x5ad55d[_0xbd5c('0x4e')][_0xbd5c('0x57')]===_0xbd5c('0x58')){var _0x2e6f9b=[];for(var _0xcfd6b=0x0;_0xcfd6b<_0x3daae4[_0xbd5c('0x56')]['length'];_0xcfd6b++){_0x2e6f9b['push'](get_open_tabs(_0xbd5c('0x59'),_0x3daae4[_0xbd5c('0x56')][_0xcfd6b][_0xbd5c('0x5a')]));_0x2e6f9b[_0xbd5c('0x54')](get_open_tabs(_0xbd5c('0x5b'),_0x3daae4['rows'][_0xcfd6b][_0xbd5c('0x5a')]));_0x2e6f9b[_0xbd5c('0x54')](get_open_tabs(_0xbd5c('0x5c'),_0x3daae4[_0xbd5c('0x56')][_0xcfd6b][_0xbd5c('0x5a')]));_0x2e6f9b[_0xbd5c('0x54')](get_open_tabs('mail',_0x3daae4[_0xbd5c('0x56')][_0xcfd6b][_0xbd5c('0x5a')]));_0x2e6f9b[_0xbd5c('0x54')](get_open_tabs('openchannel',_0x3daae4[_0xbd5c('0x56')][_0xcfd6b]['dataValues']));_0x2e6f9b['push'](get_open_tabs(_0xbd5c('0x5d'),_0x3daae4['rows'][_0xcfd6b][_0xbd5c('0x5a')]));}return Promise[_0xbd5c('0x5e')](_0x2e6f9b)[_0xbd5c('0x2f')](function(){return _0x3daae4;});}else{return _0x3daae4;}})['then'](respondWithFilteredResult(_0x551343,_0x271990))[_0xbd5c('0x2e')](handleError(_0x551343,null));};exports[_0xbd5c('0x5f')]=function(_0x45f6be,_0x2b2c59){var _0x55e931=getUserAttributes();_0x45f6be['query']['id']=_0x45f6be[_0xbd5c('0x60')]['id'];var _0x466544=qs[_0xbd5c('0x4c')](_0x55e931,_0x45f6be);if(_0x45f6be['query'][_0xbd5c('0x4f')]){_0x466544[_0xbd5c('0x51')]=[{'all':!![]}];}if(_0x45f6be[_0xbd5c('0x4e')]['userSetting']===_0xbd5c('0x58')){_0x466544[_0xbd5c('0x51')]=[{'model':db['UserSetting'],'as':_0xbd5c('0x50')}];}_0x466544=_[_0xbd5c('0x61')]({},_0x466544,_0x45f6be[_0xbd5c('0x62')]);if(!_[_0xbd5c('0x3c')](_0x466544[_0xbd5c('0x53')],'id')){_0x466544[_0xbd5c('0x53')][_0xbd5c('0x54')]('id');}return db[_0xbd5c('0x42')][_0xbd5c('0x3d')](_0x466544)['then'](handleEntityNotFound(_0x2b2c59,null))[_0xbd5c('0x2f')](function(_0x6233a0){var _0x392d25=[];values=_0x6233a0;if(_0x45f6be[_0xbd5c('0x4e')][_0xbd5c('0x57')]===_0xbd5c('0x58')){_0x392d25['push'](get_open_tabs(_0xbd5c('0x59'),_0x6233a0['dataValues']));_0x392d25[_0xbd5c('0x54')](get_open_tabs(_0xbd5c('0x5b'),_0x6233a0['dataValues']));_0x392d25[_0xbd5c('0x54')](get_open_tabs(_0xbd5c('0x63'),_0x6233a0[_0xbd5c('0x5a')]));_0x392d25[_0xbd5c('0x54')](get_open_tabs(_0xbd5c('0x5d'),_0x6233a0[_0xbd5c('0x5a')]));_0x392d25[_0xbd5c('0x54')](get_open_tabs(_0xbd5c('0x5c'),_0x6233a0['dataValues']));_0x392d25['push'](get_open_tabs(_0xbd5c('0x64'),_0x6233a0[_0xbd5c('0x5a')]));return Promise[_0xbd5c('0x5e')](_0x392d25);}else{return values;}})[_0xbd5c('0x2f')](function(){return values;})[_0xbd5c('0x2f')](respondWithResult(_0x2b2c59,null))['catch'](handleError(_0x2b2c59,null));};exports[_0xbd5c('0x65')]=function(_0x235546,_0x1fa506){if(_0x235546[_0xbd5c('0x66')]['id']){delete _0x235546[_0xbd5c('0x66')]['id'];}delete _0x235546[_0xbd5c('0x66')]['role'];return db['User']['find']({'where':{'id':_0x235546[_0xbd5c('0x60')]['id']}})['then'](handleEntityNotFound(_0x1fa506,null))['then'](saveUpdates(_0x235546[_0xbd5c('0x66')],null))[_0xbd5c('0x2f')](respondWithResult(_0x1fa506,null))['catch'](handleError(_0x1fa506,null));};exports[_0xbd5c('0x67')]=function(_0x14172c,_0x18db51){return db[_0xbd5c('0x42')][_0xbd5c('0x67')]()[_0xbd5c('0x2f')](respondWithResult(_0x18db51,null))['catch'](handleError(_0x18db51,null));};exports[_0xbd5c('0x68')]=function(_0x2d5464,_0x3b549d){return db[_0xbd5c('0x42')]['find']({'where':{'id':_0x2d5464[_0xbd5c('0x60')]['id']}})[_0xbd5c('0x2f')](handleEntityNotFound(_0x3b549d,null))['then'](function(_0x4e31dd){if(_0x4e31dd){return _0x4e31dd['addContacts'](_0x2d5464['body'][_0xbd5c('0x69')],_[_0xbd5c('0x6a')](_0x2d5464[_0xbd5c('0x66')],[_0xbd5c('0x69'),'id'])||{});}})[_0xbd5c('0x2f')](respondWithResult(_0x3b549d,null))[_0xbd5c('0x2e')](handleError(_0x3b549d,null));};function validateUser(_0x205f9c){return new Promise(function(_0x3e53d8,_0x2d5f6d){if(_0x205f9c[_0xbd5c('0x6b')])return _0x3e53d8(_0x205f9c);return db[_0xbd5c('0x6c')][_0xbd5c('0x6d')](0x1)[_0xbd5c('0x2f')](function(_0x32150b){if(_0x32150b[_0xbd5c('0x6e')])authService[_0xbd5c('0x6f')](_0x205f9c['password']);db['User']['max'](_0xbd5c('0x6b'))[_0xbd5c('0x2f')](function(_0x2d7b43){if(_[_0xbd5c('0x70')](_0x2d7b43)){_0x205f9c[_0xbd5c('0x6b')]=_0x32150b[_0xbd5c('0x71')]||0x1;return;}if(_[_0xbd5c('0x70')](_0x32150b[_0xbd5c('0x71')])||_0x32150b[_0xbd5c('0x71')]===_0x2d7b43){_0x205f9c[_0xbd5c('0x6b')]=_0x2d7b43+0x1;return;}if(_0x32150b[_0xbd5c('0x71')]>_0x2d7b43){_0x205f9c[_0xbd5c('0x6b')]=_0x32150b[_0xbd5c('0x71')];return;}return db['sequelize'][_0xbd5c('0x4e')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xbd5c('0x72')][_0xbd5c('0x73')]['SELECT']})['then'](function(_0x5ea5c7){if(_0x5ea5c7&&_0x5ea5c7['length']){for(var _0x405cf5=0x0,_0x3c2765=_0x5ea5c7[_0xbd5c('0x74')];_0x405cf5<_0x3c2765&&_['isNil'](_0x205f9c[_0xbd5c('0x6b')]);_0x405cf5++){if(_0x32150b['min_internal']<=_0x5ea5c7[_0x405cf5][_0xbd5c('0x75')]){_0x205f9c[_0xbd5c('0x6b')]=_0x5ea5c7[_0x405cf5]['from'];}else if(_0x32150b[_0xbd5c('0x71')]>_0x5ea5c7[_0x405cf5][_0xbd5c('0x75')]&&_0x32150b[_0xbd5c('0x71')]<=_0x5ea5c7[_0x405cf5]['to']){_0x205f9c[_0xbd5c('0x6b')]=_0x32150b[_0xbd5c('0x71')];}}}if(_[_0xbd5c('0x70')](_0x205f9c[_0xbd5c('0x6b')])){_0x205f9c['internal']=_0x2d7b43+0x1;}return _0x3e53d8(_0x205f9c);});});})[_0xbd5c('0x2e')](function(_0x4b1ce8){_0x2d5f6d(_0x4b1ce8);});});}function updateUser(_0x5203a4){return new Promise(function(_0x1e30ef,_0x4cbda4){try{if(_0x5203a4[_0xbd5c('0x76')]){_0x5203a4[_0xbd5c('0x77')]=_0x5203a4[_0xbd5c('0x6b')];_0x5203a4[_0xbd5c('0x78')]={'mailbox':_0x5203a4['internal'],'password':_0x5203a4[_0xbd5c('0x48')],'fullname':_0x5203a4[_0xbd5c('0x79')],'email':_0x5203a4[_0xbd5c('0x7a')]};}if(_0x5203a4['role']==='agent'){if(!_0x5203a4[_0xbd5c('0x7b')])_0x5203a4[_0xbd5c('0x7b')]=[_0xbd5c('0x7c'),_0xbd5c('0x7d'),_0xbd5c('0x7e'),'113',_0xbd5c('0x7f'),_0xbd5c('0x80'),'105',_0xbd5c('0x81'),_0xbd5c('0x82'),_0xbd5c('0x83'),_0xbd5c('0x84'),'100',_0xbd5c('0x85'),_0xbd5c('0x86'),_0xbd5c('0x87')];}_0x1e30ef(_0x5203a4);}catch(_0x282cf5){_0x4cbda4(_0x282cf5);}});}exports[_0xbd5c('0x88')]=function(_0xd27f9d,_0x3058f3){if(_0xd27f9d['user'][_0xbd5c('0x33')]===_0xbd5c('0x37'))throw new Error(_0xbd5c('0x89'));if(_0xd27f9d[_0xbd5c('0x66')]['role']===_0xbd5c('0x36')&&_0xd27f9d['user']['role']!==_0xbd5c('0x34')){throw new Error(_0xbd5c('0x8a'));}if(_0xd27f9d[_0xbd5c('0x66')][_0xbd5c('0x33')]==='admin'&&_0xd27f9d[_0xbd5c('0x36')][_0xbd5c('0x33')]!=='admin'){throw new Error(_0xbd5c('0x8b'));}return licenseUtil[_0xbd5c('0x8c')]([_0xd27f9d[_0xbd5c('0x66')]])['then'](function(){return validateUser(_0xd27f9d['body']);})[_0xbd5c('0x2f')](function(_0x477d5b){return updateUser(_0x477d5b)[_0xbd5c('0x2f')](function(_0x2afdb2){if(_0x2afdb2['role']===_0xbd5c('0x34')){_0x2afdb2[_0xbd5c('0x8d')]=_0xd27f9d[_0xbd5c('0x36')][_0xbd5c('0x8d')];delete _0x2afdb2[_0xbd5c('0x8e')];}return _0x2afdb2;});})[_0xbd5c('0x2f')](function(_0x365262){return db[_0xbd5c('0x42')][_0xbd5c('0x88')](_0x365262,{'include':[{'model':db[_0xbd5c('0x78')],'as':'VoiceMail'}]});})[_0xbd5c('0x2f')](function(_0x1fc872){if(_0xd27f9d['body']['role']==='user')return _0x1fc872;if(_0xd27f9d[_0xbd5c('0x36')][_0xbd5c('0x33')]!==_0xbd5c('0x36'))return _0x1fc872;return db[_0xbd5c('0x8f')][_0xbd5c('0x3d')]({'where':{'name':_0x1fc872[_0xbd5c('0x33')]==='agent'?_0xbd5c('0x90'):_0xbd5c('0x38'),'userProfileId':_0xd27f9d[_0xbd5c('0x36')][_0xbd5c('0x8e')]},'raw':!![]})[_0xbd5c('0x2f')](function(_0x452483){if(!_0x452483||_0x452483[_0xbd5c('0x91')]!=0x0)return _0x1fc872;return db[_0xbd5c('0x92')][_0xbd5c('0x88')]({'name':_0x1fc872[_0xbd5c('0x40')],'resourceId':_0x1fc872['id'],'type':_0x452483[_0xbd5c('0x40')],'sectionId':_0x452483['id']},{})['then'](function(){return _0x1fc872;});})[_0xbd5c('0x2e')](function(_0xfe548e){logger[_0xbd5c('0x2b')](_0xbd5c('0x93'),_0xfe548e);throw _0xfe548e;});})[_0xbd5c('0x2f')](respondWithResult(_0x3058f3,0xc9))['catch'](handleError(_0x3058f3,null));};exports[_0xbd5c('0x94')]=function(_0x20b7f6,_0x5797c9){var _0x4f417c=_0x20b7f6[_0xbd5c('0x66')];var _0x501902=[];if(_0x20b7f6[_0xbd5c('0x36')][_0xbd5c('0x33')]===_0xbd5c('0x37'))throw new Error(_0xbd5c('0x89'));if(_[_0xbd5c('0x95')](_0x4f417c,['role',_0xbd5c('0x36')])&&_0x20b7f6[_0xbd5c('0x36')][_0xbd5c('0x33')]!==_0xbd5c('0x34')){throw new Error(_0xbd5c('0x8a'));}if(_['some'](_0x4f417c,[_0xbd5c('0x33'),_0xbd5c('0x34')])&&_0x20b7f6[_0xbd5c('0x36')][_0xbd5c('0x33')]!==_0xbd5c('0x34')){throw new Error(_0xbd5c('0x96'));}return licenseUtil['checkUserLimits'](_0x4f417c)[_0xbd5c('0x2f')](function(){return validateUser(_0x4f417c[0x0]);})[_0xbd5c('0x2f')](function(){for(var _0x27c8a6=0x1;_0x27c8a6<_0x4f417c[_0xbd5c('0x74')];_0x27c8a6++){var _0x23dfdd=_0x4f417c[_0x27c8a6-0x1][_0xbd5c('0x6b')];if(!_0x4f417c[_0x27c8a6][_0xbd5c('0x6b')])_0x4f417c[_0x27c8a6][_0xbd5c('0x6b')]=_0x23dfdd+0x1;_0x501902['push'](validateUser(_0x4f417c[_0x27c8a6]));}return Promise[_0xbd5c('0x5e')](_0x501902);})[_0xbd5c('0x2f')](function(){_0x501902=[];for(var _0x402712=0x0;_0x402712<_0x4f417c[_0xbd5c('0x74')];_0x402712++){_0x501902[_0xbd5c('0x54')](updateUser(_0x4f417c[_0x402712]));}return Promise['all'](_0x501902);})[_0xbd5c('0x2f')](function(){_0x501902=_0x4f417c['map'](function(_0x30b66f){return db[_0xbd5c('0x42')][_0xbd5c('0x88')](_0x30b66f,{'include':[{'model':db[_0xbd5c('0x78')],'as':_0xbd5c('0x78')}]})[_0xbd5c('0x2f')](function(_0x6ef4fc){_0x30b66f['id']=_0x6ef4fc['id'];return _0x30b66f;});});return Promise['all'](_0x501902);})['then'](function(_0x300955){if(_0x20b7f6['body'][_0xbd5c('0x33')]==='user')return _0x300955;if(_0x20b7f6[_0xbd5c('0x36')][_0xbd5c('0x33')]!==_0xbd5c('0x36'))return _0x300955;var _0x3dfe3a=_[_0xbd5c('0x95')](_0x300955,function(_0x1854db){return _0x1854db[_0xbd5c('0x33')]===_0xbd5c('0x37')||_0x1854db[_0xbd5c('0x33')]==='telephone';});if(!_0x3dfe3a)return _0x300955;return db['UserProfileSection'][_0xbd5c('0x55')]({'where':{'name':{'$or':[_0xbd5c('0x90'),'Telephones']},'userProfileId':_0x20b7f6[_0xbd5c('0x36')][_0xbd5c('0x8e')]},'raw':!![]})[_0xbd5c('0x2f')](function(_0x3e7f7b){if(_[_0xbd5c('0x97')](_0x3e7f7b)||!_[_0xbd5c('0x95')](_0x3e7f7b,['autoAssociation',0x0]))return _0x300955;_0x501902=[];var _0xb3716=_(_0x3e7f7b)['map'](function(_0x209997){if(_0x209997['autoAssociation']===0x1)return;return _0x209997[_0xbd5c('0x40')]==='Agents'?'agent':_0xbd5c('0x39');})[_0xbd5c('0x98')]()[_0xbd5c('0x3e')]();for(var _0x16444a=0x0;_0x16444a<_0x300955[_0xbd5c('0x74')];_0x16444a++){if(!_[_0xbd5c('0x3c')](_0xb3716,_0x300955[_0x16444a][_0xbd5c('0x33')]))return;var _0x4e1498=_0x300955[_0x16444a][_0xbd5c('0x33')]==='agent'?'Agents':_0xbd5c('0x38');_0x501902[_0xbd5c('0x54')](db[_0xbd5c('0x92')]['create']({'name':_0x300955[_0x16444a][_0xbd5c('0x40')],'resourceId':_0x300955[_0x16444a]['id'],'type':_0x4e1498,'sectionId':_['find'](_0x3e7f7b,['name',_0x4e1498])['id']},{}));}return Promise[_0xbd5c('0x5e')](_0x501902);});})[_0xbd5c('0x2f')](respondWithResult(_0x5797c9,0xc9))[_0xbd5c('0x2e')](handleError(_0x5797c9,null));};exports[_0xbd5c('0x99')]=function(_0x4932eb,_0x2ad51d){if(_0x4932eb[_0xbd5c('0x66')]['id']){delete _0x4932eb[_0xbd5c('0x66')]['id'];}return db['User'][_0xbd5c('0x3d')]({'where':{'id':_0x4932eb[_0xbd5c('0x60')]['id']}})[_0xbd5c('0x2f')](function(_0x5f4847){if(!_0x5f4847)return null;if(_0x5f4847['id']===_0x4932eb['user']['id']){if(!_0x4932eb[_0xbd5c('0x66')]['oldPassword']||!_0x4932eb[_0xbd5c('0x66')][_0xbd5c('0x9a')]){throw new db['Sequelize']['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x5f4847[_0xbd5c('0x9b')](_0x4932eb[_0xbd5c('0x66')][_0xbd5c('0x9c')])){throw new db[(_0xbd5c('0x9d'))][(_0xbd5c('0x9e'))](_0xbd5c('0x9f'));}if(_0x4932eb[_0xbd5c('0x66')][_0xbd5c('0x9c')]===_0x4932eb['body'][_0xbd5c('0x9a')]){throw new db[(_0xbd5c('0x9d'))][(_0xbd5c('0x9e'))](_0xbd5c('0xa0'));}}else if(_0x4932eb[_0xbd5c('0x36')][_0xbd5c('0x33')]==='admin'){if(!_0x4932eb[_0xbd5c('0x66')]['newPassword']){throw new db['Sequelize']['ValidationError'](_0xbd5c('0xa1'));}}else if(_0x4932eb[_0xbd5c('0x36')]['role']===_0xbd5c('0x36')){if(!_0x4932eb[_0xbd5c('0x66')][_0xbd5c('0x9a')]){throw new db[(_0xbd5c('0x9d'))][(_0xbd5c('0x9e'))](_0xbd5c('0xa1'));}if(_0x5f4847[_0xbd5c('0x33')]!==_0xbd5c('0x37')){throw new db[(_0xbd5c('0x9d'))][(_0xbd5c('0x9e'))](_0xbd5c('0x89'));}}else{throw new db[(_0xbd5c('0x9d'))][(_0xbd5c('0x9e'))](_0xbd5c('0x89'));}return _0x5f4847;})[_0xbd5c('0x2f')](handleEntityNotFound(_0x2ad51d,null))['then'](function(_0x2a35cb){return db[_0xbd5c('0x6c')]['findOne']({'attributes':['id',_0xbd5c('0x6e'),_0xbd5c('0xa2'),'passwordHistoryLimit']})['then'](function(_0x4a3185){if(_0x4a3185['securePassword'])authService[_0xbd5c('0x6f')](_0x4932eb[_0xbd5c('0x66')]['newPassword']);if(!_0x4a3185[_0xbd5c('0xa2')]||!_0x2a35cb[_0xbd5c('0x4a')])return _0x2a35cb;authService[_0xbd5c('0xa3')](_0x4932eb['body']['newPassword'],_0x2a35cb[_0xbd5c('0x4a')],_0x4a3185[_0xbd5c('0xa4')]);return _0x2a35cb;})[_0xbd5c('0x2f')](saveUpdates({'password':_0x4932eb[_0xbd5c('0x66')][_0xbd5c('0x9a')],'passwordResetAt':_0x4932eb[_0xbd5c('0x36')]['id']==_0x4932eb['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x4932eb[_0xbd5c('0x66')][_0xbd5c('0x9a')],_0x2a35cb['previousPasswords'])},null));})[_0xbd5c('0x2f')](respondWithResult(_0x2ad51d,null))[_0xbd5c('0x2e')](handleError(_0x2ad51d,null));};exports['addQueues']=function(_0x4331af,_0x464958){var _0xb32dc1=_0x4331af[_0xbd5c('0x66')][_0xbd5c('0xa5')];return db[_0xbd5c('0x42')][_0xbd5c('0x3d')]({'where':{'id':_0x4331af['params']['id']},'attributes':['id',_0xbd5c('0x40'),_0xbd5c('0x33'),_0xbd5c('0xa6'),'loginInPause','voicePause',_0xbd5c('0xa7')]})[_0xbd5c('0x2f')](handleEntityNotFound(_0x464958,null))[_0xbd5c('0x2f')](function(_0x41f81f){if(_0x41f81f){if(!utils[_0xbd5c('0xa8')](_0xb32dc1)){throw new db['Sequelize'][(_0xbd5c('0x9e'))](_0xbd5c('0xa9'));}return _0x41f81f[_0xbd5c('0xaa')+_[_0xbd5c('0xab')](_0xb32dc1['toLowerCase']())+_0xbd5c('0xac')](_0x4331af[_0xbd5c('0x66')][_0xbd5c('0x69')],{'penalty':_0x4331af['body'][_0xbd5c('0xad')]||0x0})[_0xbd5c('0xae')](function(_0x5c8887){for(var _0x1af481=0x0;_0x1af481<_0x4331af[_0xbd5c('0x66')]['ids'][_0xbd5c('0x74')];_0x1af481+=0x1){var _0x2f744b={'UserId':Number(_0x4331af[_0xbd5c('0x60')]['id'])};_0x2f744b[_['capitalize'](_0xb32dc1[_0xbd5c('0xaf')]())+_0xbd5c('0xb0')]=Number(_0x4331af['body'][_0xbd5c('0x69')][_0x1af481]);socket[_0xbd5c('0x30')](_0xbd5c('0x36')+_['capitalize'](_0xb32dc1['toLowerCase']())+'Queue:save',_0x2f744b);}return _0x5c8887;})['then'](function(){if(_0xb32dc1===_0xbd5c('0xb1')){return db['VoiceQueue'][_0xbd5c('0x55')]({'where':{'id':_0x4331af[_0xbd5c('0x66')][_0xbd5c('0x69')]||[]},'raw':!![],'attributes':['id','name']});}})[_0xbd5c('0x2f')](function(_0x2d860b){var _0x1151c8=_0x41f81f['get']({'plain':!![]});var _0x202083=[];if(_0xb32dc1==='voice'&&_0x1151c8[_0xbd5c('0x33')]===_0xbd5c('0x37')&&_0x1151c8[_0xbd5c('0xa6')]){for(let _0x2617dd=0x0;_0x2617dd<_0x2d860b['length'];_0x2617dd+=0x1){_0x202083[_0xbd5c('0x54')]({'membername':_0x1151c8[_0xbd5c('0x40')],'UserId':_0x1151c8['id'],'queue_name':_0x2d860b[_0x2617dd][_0xbd5c('0x40')],'VoiceQueueId':_0x2d860b[_0x2617dd]['id'],'interface':_[_0xbd5c('0x70')](_0x1151c8['interface'])?util[_0xbd5c('0xb2')]('SIP/%s',_0x1151c8['name']):_0x1151c8[_0xbd5c('0xa7')],'paused':_0x1151c8[_0xbd5c('0xb3')]||![],'penalty':_0x4331af[_0xbd5c('0x66')]['penalty']||0x0});}return Promise[_0xbd5c('0x5e')](_0x202083[_0xbd5c('0x44')](function(_0x45e210){return db[_0xbd5c('0xb4')][_0xbd5c('0xb5')](_0x45e210);}));}return _0x41f81f;});}})['then'](respondWithStatusCode(_0x464958,null))[_0xbd5c('0x2e')](handleError(_0x464958,null));};exports[_0xbd5c('0xb6')]=function(_0x452a79,_0x496a07){var _0x564b74,_0x3e87f1;return db[_0xbd5c('0x42')][_0xbd5c('0x3d')]({'where':{'id':_0x452a79[_0xbd5c('0x60')]['id']},'attributes':['id',_0xbd5c('0x40'),_0xbd5c('0x33')]})['then'](handleEntityNotFound(_0x496a07,null))[_0xbd5c('0x2f')](function(_0x555333){if(_0x555333){_0x564b74=_0x555333;if(!_0x452a79[_0xbd5c('0x4e')][_0xbd5c('0xa5')]||!utils[_0xbd5c('0xa8')](_0x452a79['query']['channel'])){throw new db[(_0xbd5c('0x9d'))][(_0xbd5c('0x9e'))](_0xbd5c('0xa9'));}return _0x555333['remove'+_['capitalize'](_0x452a79[_0xbd5c('0x4e')][_0xbd5c('0xa5')][_0xbd5c('0xaf')]())+_0xbd5c('0xac')](_0x452a79[_0xbd5c('0x4e')][_0xbd5c('0x69')]);}})[_0xbd5c('0x2f')](function(_0x53a1e0){if(_[_0xbd5c('0xb7')](_0x452a79[_0xbd5c('0x4e')]['ids'])){for(var _0x5bbc3f=0x0;_0x5bbc3f<_0x452a79[_0xbd5c('0x4e')]['ids'][_0xbd5c('0x74')];_0x5bbc3f+=0x1){_0x3e87f1={'UserId':Number(_0x452a79['params']['id'])};_0x3e87f1[_[_0xbd5c('0xab')](_0x452a79[_0xbd5c('0x4e')][_0xbd5c('0xa5')][_0xbd5c('0xaf')]())+'QueueId']=Number(_0x452a79[_0xbd5c('0x4e')][_0xbd5c('0x69')][_0x5bbc3f]);socket[_0xbd5c('0x30')]('user'+_[_0xbd5c('0xab')](_0x452a79[_0xbd5c('0x4e')]['channel'][_0xbd5c('0xaf')]())+_0xbd5c('0xb8'),_0x3e87f1);}}else{_0x3e87f1={'UserId':Number(_0x452a79[_0xbd5c('0x60')]['id'])};_0x3e87f1[_['capitalize'](_0x452a79[_0xbd5c('0x4e')][_0xbd5c('0xa5')][_0xbd5c('0xaf')]())+_0xbd5c('0xb0')]=Number(_0x452a79[_0xbd5c('0x4e')]['ids']);socket[_0xbd5c('0x30')](_0xbd5c('0x36')+_[_0xbd5c('0xab')](_0x452a79[_0xbd5c('0x4e')][_0xbd5c('0xa5')][_0xbd5c('0xaf')]())+_0xbd5c('0xb8'),_0x3e87f1);}return _0x53a1e0;})[_0xbd5c('0x2f')](function(){if(_0x452a79[_0xbd5c('0x4e')]['channel']===_0xbd5c('0xb1')){return db['UserVoiceQueueRt'][_0xbd5c('0x31')]({'where':{'UserId':_0x452a79[_0xbd5c('0x60')]['id'],'VoiceQueueId':_0x452a79[_0xbd5c('0x4e')][_0xbd5c('0x69')]},'individualHooks':!![]})['then'](function(){return _0x564b74;});}return _0x564b74;})['then'](respondWithStatusCode(_0x496a07,null))['catch'](handleError(_0x496a07,null));};exports[_0xbd5c('0xb9')]=function(_0x41158c,_0x5ad9c1){_0x41158c[_0xbd5c('0x66')][_0xbd5c('0xba')]=_0x41158c[_0xbd5c('0xbb')][_0xbd5c('0xbc')];return db[_0xbd5c('0x42')][_0xbd5c('0x3d')]({'where':{'id':_0x41158c['params']['id']}})[_0xbd5c('0x2f')](handleEntityNotFound(_0x5ad9c1,null))[_0xbd5c('0x2f')](saveUpdates(_0x41158c['body'],null))[_0xbd5c('0x2f')](respondWithResult(_0x5ad9c1,null))[_0xbd5c('0x2e')](handleError(_0x5ad9c1,null));};exports[_0xbd5c('0xbd')]=function(_0x29b5b4,_0x3bca7f){var _0x523125=path[_0xbd5c('0xbe')](config[_0xbd5c('0xbf')],'server/files/images/logos/default_profile.png');return db[_0xbd5c('0x42')][_0xbd5c('0x3d')]({'where':{'id':_0x29b5b4[_0xbd5c('0x60')]['id']},'attributes':['id',_0xbd5c('0xba')],'raw':!![]})[_0xbd5c('0x2f')](handleEntityNotFound(_0x3bca7f,null))[_0xbd5c('0x2f')](function(_0x5432ed){if(_0x5432ed){if(_[_0xbd5c('0x70')](_0x5432ed[_0xbd5c('0xba')])){return _0x3bca7f[_0xbd5c('0xc0')](_0x523125);}else{if(!fs['existsSync'](path['join'](config['root'],_0xbd5c('0xc1'),_0x5432ed['userpic']))){return _0x3bca7f[_0xbd5c('0xc0')](_0x523125);}return _0x3bca7f[_0xbd5c('0xc0')](path['join'](config[_0xbd5c('0xbf')],'server/files/images/',_0x5432ed[_0xbd5c('0xba')]));}}})[_0xbd5c('0x2e')](handleError(_0x3bca7f,null));};exports['getOpenTabs']=function(_0x1f8cf4,_0x178230){return db['User'][_0xbd5c('0x3d')]({'where':{'id':_0x1f8cf4[_0xbd5c('0x60')]['id']},'attributes':['id']})[_0xbd5c('0x2f')](handleEntityNotFound(_0x178230,null))['then'](function(_0x13ee49){var _0x1ba019=[];values=_0x13ee49[_0xbd5c('0x5a')];_0x1ba019[_0xbd5c('0x54')](get_open_tabs('chat',_0x13ee49['dataValues']));_0x1ba019[_0xbd5c('0x54')](get_open_tabs('sms',_0x13ee49[_0xbd5c('0x5a')]));_0x1ba019['push'](get_open_tabs(_0xbd5c('0x63'),_0x13ee49['dataValues']));_0x1ba019[_0xbd5c('0x54')](get_open_tabs(_0xbd5c('0x5d'),_0x13ee49[_0xbd5c('0x5a')]));_0x1ba019['push'](get_open_tabs(_0xbd5c('0x5c'),_0x13ee49[_0xbd5c('0x5a')]));_0x1ba019[_0xbd5c('0x54')](get_open_tabs(_0xbd5c('0x64'),_0x13ee49[_0xbd5c('0x5a')]));return Promise['all'](_0x1ba019);})[_0xbd5c('0x2f')](function(_0x5b17d4){if(_0x5b17d4){var _0x2abbe8=_[_0xbd5c('0x44')](values['ChatOpenTabs'],function(_0x4275bb){return{'channel':_0xbd5c('0xc2'),'id':_0x4275bb['id'],'createdAt':_0x4275bb[_0xbd5c('0xc3')]};});var _0x1159d4=_[_0xbd5c('0x44')](values[_0xbd5c('0xc4')],function(_0x22e1f3){return{'channel':_0xbd5c('0xc5'),'id':_0x22e1f3['id'],'createdAt':_0x22e1f3['createdAt']};});var _0x15f24a=_[_0xbd5c('0x44')](values[_0xbd5c('0xc6')],function(_0x673f8c){return{'channel':'OPENCHANNEL','id':_0x673f8c['id'],'createdAt':_0x673f8c[_0xbd5c('0xc3')]};});var _0x1f172f=_[_0xbd5c('0x44')](values['MailOpenTabs'],function(_0x1889f8){return{'channel':_0xbd5c('0xc7'),'id':_0x1889f8['id'],'createdAt':_0x1889f8[_0xbd5c('0xc3')]};});var _0x831871=_[_0xbd5c('0x44')](values[_0xbd5c('0xc8')],function(_0x106089){return{'channel':_0xbd5c('0xc9'),'id':_0x106089['id'],'createdAt':_0x106089['createdAt']};});var _0x1e5a10=_['map'](values['WhatsappOpenTabs'],function(_0x1846f1){return{'channel':'WHATSAPP','id':_0x1846f1['id'],'createdAt':_0x1846f1[_0xbd5c('0xc3')]};});var _0x3ffccf=_['concat'](_0x2abbe8,_0x1159d4,_0x15f24a,_0x1f172f,_0x831871,_0x1e5a10);var _0x33fb2f={'count':_0x3ffccf[_0xbd5c('0x74')],'rows':_0x3ffccf};return _0x33fb2f;}else return null;})[_0xbd5c('0x2f')](respondWithResult(_0x178230,null))[_0xbd5c('0x2e')](handleError(_0x178230,null));};exports['getContacts']=function(_0x18512a,_0x1132e0){var _0x4b6ee9={};return db['User'][_0xbd5c('0xca')]({'where':{'id':_0x18512a[_0xbd5c('0x60')]['id']}})[_0xbd5c('0x2f')](function(_0x402870){if(!_0x402870){throw new APINotFoundError(util[_0xbd5c('0xb2')](_0xbd5c('0xcb'),_0x18512a['params']['id']));}return contacts[_0xbd5c('0x67')]();})['then'](function(_0x4161f9){_0x18512a['query'][_0xbd5c('0x42')]=_0x18512a['params']['id'];_0x4b6ee9=qs[_0xbd5c('0x4c')](_0x4161f9,_0x18512a);if(_0x18512a['query'][_0xbd5c('0xcc')]('includeAll')){_0x4b6ee9[_0xbd5c('0x51')]=[{'model':db[_0xbd5c('0xcd')],'as':_0xbd5c('0xce'),'required':![]},{'model':db[_0xbd5c('0xcf')],'as':'Tags','attributes':['id',_0xbd5c('0x40'),'color'],'where':_0x18512a[_0xbd5c('0x4e')][_0xbd5c('0xd0')]?{'id':_0x18512a[_0xbd5c('0x4e')][_0xbd5c('0xd0')]}:undefined,'required':_0x18512a[_0xbd5c('0x4e')][_0xbd5c('0xd0')]?!![]:![]}];}return contacts[_0xbd5c('0x55')](_0x18512a[_0xbd5c('0x4e')],_0x18512a['user'],_0x4b6ee9,_0x4161f9);})[_0xbd5c('0x2f')](respondWithFilteredResult(_0x1132e0,_0x4b6ee9))[_0xbd5c('0x2e')](APIHandleError(_0x1132e0));};exports['getQueues']=function(_0x5e6a6b,_0x4ff072){var _0x5eb23a;var _0x1da584={};var _0x1e2d59;return db[_0xbd5c('0x42')]['findOne']({'where':{'id':_0x5e6a6b[_0xbd5c('0x60')]['id']},'attributes':['id',_0xbd5c('0x40'),'role']})['then'](handleEntityNotFound(_0x4ff072,null))[_0xbd5c('0x2f')](function(_0x11c43c){if(!utils['isValidChannel'](_0x5e6a6b[_0xbd5c('0x4e')][_0xbd5c('0xa5')])){throw new db[(_0xbd5c('0x9d'))][(_0xbd5c('0x9e'))](_0xbd5c('0xa9'));}_0x5eb23a=_0x11c43c;var _0x166d90={};_0x166d90[_0xbd5c('0xd1')]=_[_0xbd5c('0xd2')](db[_[_0xbd5c('0xab')](_0x5e6a6b['query'][_0xbd5c('0xa5')])+_0xbd5c('0xd3')][_0xbd5c('0x43')]);_0x166d90[_0xbd5c('0x4e')]=_[_0xbd5c('0xd2')](_0x5e6a6b[_0xbd5c('0x4e')]);_0x166d90[_0xbd5c('0xd4')]=_[_0xbd5c('0xd5')](_0x166d90[_0xbd5c('0xd1')],_0x166d90[_0xbd5c('0x4e')]);_0x1da584[_0xbd5c('0x53')]=_['intersection'](_0x166d90[_0xbd5c('0xd1')],qs[_0xbd5c('0xd6')](_0x5e6a6b['query']['fields']));_0x1da584[_0xbd5c('0x53')]=_0x1da584[_0xbd5c('0x53')]['length']?_0x1da584[_0xbd5c('0x53')]:_0x166d90['model'];_0x1da584[_0xbd5c('0xd7')]=qs[_0xbd5c('0xd8')](_0x5e6a6b[_0xbd5c('0x4e')][_0xbd5c('0xd8')]);_0x1da584[_0xbd5c('0x4d')]=qs[_0xbd5c('0xd4')](_['pick'](_0x5e6a6b[_0xbd5c('0x4e')],_0x166d90[_0xbd5c('0xd4')]));if(_0x5e6a6b[_0xbd5c('0x4e')][_0xbd5c('0x3a')]){_0x1da584[_0xbd5c('0x4d')]=_['merge'](_0x1da584[_0xbd5c('0x4d')],{'$or':_[_0xbd5c('0x44')](_0x1da584['attributes'],function(_0x39ac7d){var _0x33b5e4={};_0x33b5e4[_0x39ac7d]={'$like':'%'+_0x5e6a6b[_0xbd5c('0x4e')][_0xbd5c('0x3a')]+'%'};return _0x33b5e4;})});}_0x1da584=_[_0xbd5c('0x61')]({},_0x1da584,_0x5e6a6b[_0xbd5c('0x62')]);switch(_0x5eb23a[_0xbd5c('0x33')]){case _0xbd5c('0x34'):return db[_[_0xbd5c('0xab')](_0x5e6a6b[_0xbd5c('0x4e')][_0xbd5c('0xa5')])+_0xbd5c('0xd3')]['findAll'](_0x1da584);case _0xbd5c('0x36'):case _0xbd5c('0x37'):return _0x5eb23a[_0xbd5c('0x32')+_[_0xbd5c('0xab')](_0x5e6a6b[_0xbd5c('0x4e')][_0xbd5c('0xa5')])+_0xbd5c('0xac')](_0x1da584);default:throw new db['Sequelize'][(_0xbd5c('0x9e'))](_0xbd5c('0xd9'));}})[_0xbd5c('0x2f')](function(_0x1b6037){_0x1e2d59=_0x1b6037['length'];if(!_0x5e6a6b[_0xbd5c('0x4e')][_0xbd5c('0xcc')](_0xbd5c('0xda'))){_0x1da584['limit']=qs[_0xbd5c('0x20')](_0x5e6a6b['query'][_0xbd5c('0x20')]);_0x1da584['offset']=qs[_0xbd5c('0x1f')](_0x5e6a6b[_0xbd5c('0x4e')][_0xbd5c('0x1f')]);}switch(_0x5eb23a[_0xbd5c('0x33')]){case _0xbd5c('0x34'):return db[_[_0xbd5c('0xab')](_0x5e6a6b[_0xbd5c('0x4e')]['channel'])+_0xbd5c('0xd3')][_0xbd5c('0x55')](_0x1da584);case _0xbd5c('0x36'):case _0xbd5c('0x37'):return _0x5eb23a[_0xbd5c('0x32')+_[_0xbd5c('0xab')](_0x5e6a6b['query'][_0xbd5c('0xa5')])+_0xbd5c('0xac')](_0x1da584);}})[_0xbd5c('0x2f')](function(_0x46baae){return{'count':_0x1e2d59,'rows':_0x46baae};})[_0xbd5c('0x2f')](respondWithResult(_0x4ff072,null))[_0xbd5c('0x2e')](handleError(_0x4ff072,null));};exports[_0xbd5c('0xdb')]=function(_0x15303b,_0x2ffa94){var _0x15f4a2={};var _0x45f473={};var _0x17c766;var _0x4c83ab;return db['User'][_0xbd5c('0xca')]({'where':{'id':_0x15303b[_0xbd5c('0x60')]['id']}})[_0xbd5c('0x2f')](handleEntityNotFound(_0x2ffa94,null))['then'](function(_0x241107){if(_0x241107){_0x17c766=_0x241107;_0x45f473[_0xbd5c('0xd1')]=_[_0xbd5c('0xd2')](db[_0xbd5c('0xb4')][_0xbd5c('0x43')]);_0x45f473[_0xbd5c('0x4e')]=_[_0xbd5c('0xd2')](_0x15303b['query']);_0x45f473[_0xbd5c('0xd4')]=_['intersection'](_0x45f473[_0xbd5c('0xd1')],_0x45f473['query']);_0x15f4a2[_0xbd5c('0x53')]=_['intersection'](_0x45f473[_0xbd5c('0xd1')],qs['fields'](_0x15303b[_0xbd5c('0x4e')][_0xbd5c('0xd6')]));_0x15f4a2[_0xbd5c('0x53')]=_0x15f4a2[_0xbd5c('0x53')][_0xbd5c('0x74')]?_0x15f4a2[_0xbd5c('0x53')]:_0x45f473[_0xbd5c('0xd1')];_0x15f4a2['order']=qs[_0xbd5c('0xd8')](_0x15303b[_0xbd5c('0x4e')][_0xbd5c('0xd8')]);_0x15f4a2[_0xbd5c('0x4d')]=qs[_0xbd5c('0xd4')](_[_0xbd5c('0xdc')](_0x15303b[_0xbd5c('0x4e')],_0x45f473[_0xbd5c('0xd4')]));if(_0x15303b[_0xbd5c('0x4e')][_0xbd5c('0x3a')]){_0x15f4a2[_0xbd5c('0x4d')]=_['merge'](_0x15f4a2[_0xbd5c('0x4d')],{'$or':_[_0xbd5c('0x44')](_0x15f4a2[_0xbd5c('0x53')],function(_0x2cd5e6){var _0x55eef5={};_0x55eef5[_0x2cd5e6]={'$like':'%'+_0x15303b[_0xbd5c('0x4e')][_0xbd5c('0x3a')]+'%'};return _0x55eef5;})});}_0x15f4a2=_['merge']({},_0x15f4a2,_0x15303b[_0xbd5c('0x62')]);return _0x17c766[_0xbd5c('0xdb')](_0x15f4a2);}})[_0xbd5c('0x2f')](function(_0x19e74f){if(_0x19e74f){_0x4c83ab=_0x19e74f[_0xbd5c('0x74')];if(!_0x15303b[_0xbd5c('0x4e')][_0xbd5c('0xcc')](_0xbd5c('0xda'))){_0x15f4a2[_0xbd5c('0x20')]=qs[_0xbd5c('0x20')](_0x15303b['query']['limit']);_0x15f4a2['offset']=qs[_0xbd5c('0x1f')](_0x15303b[_0xbd5c('0x4e')][_0xbd5c('0x1f')]);}return _0x17c766['getVoiceQueuesRt'](_0x15f4a2);}})['then'](function(_0x3bfc1a){if(_0x3bfc1a){return _0x3bfc1a?{'count':_0x4c83ab,'rows':_0x3bfc1a}:null;}})['then'](respondWithResult(_0x2ffa94,null))[_0xbd5c('0x2e')](handleError(_0x2ffa94,null));};exports[_0xbd5c('0xdd')]=function(_0x3ba5d6,_0x591382){var _0x46f7b8={};var _0x4d3427={};var _0x1624e8;var _0x51a329;return db[_0xbd5c('0x42')][_0xbd5c('0xca')]({'where':{'id':_0x3ba5d6[_0xbd5c('0x60')]['id']}})[_0xbd5c('0x2f')](handleEntityNotFound(_0x591382,null))[_0xbd5c('0x2f')](function(_0x523564){if(_0x523564){_0x1624e8=_0x523564;_0x4d3427[_0xbd5c('0xd1')]=_[_0xbd5c('0xd2')](db[_0xbd5c('0xde')][_0xbd5c('0x43')]);_0x4d3427[_0xbd5c('0x4e')]=_[_0xbd5c('0xd2')](_0x3ba5d6[_0xbd5c('0x4e')]);_0x4d3427[_0xbd5c('0xd4')]=_[_0xbd5c('0xd5')](_0x4d3427[_0xbd5c('0xd1')],_0x4d3427[_0xbd5c('0x4e')]);_0x46f7b8[_0xbd5c('0x53')]=_[_0xbd5c('0xd5')](_0x4d3427['model'],qs['fields'](_0x3ba5d6['query'][_0xbd5c('0xd6')]));_0x46f7b8['attributes']=_0x46f7b8[_0xbd5c('0x53')]['length']?_0x46f7b8[_0xbd5c('0x53')]:_0x4d3427[_0xbd5c('0xd1')];_0x46f7b8['order']=qs[_0xbd5c('0xd8')](_0x3ba5d6[_0xbd5c('0x4e')]['sort']);_0x46f7b8['where']=qs['filters'](_['pick'](_0x3ba5d6[_0xbd5c('0x4e')],_0x4d3427[_0xbd5c('0xd4')]));if(_0x3ba5d6[_0xbd5c('0x4e')][_0xbd5c('0x3a')]){_0x46f7b8[_0xbd5c('0x4d')]=_[_0xbd5c('0x61')](_0x46f7b8[_0xbd5c('0x4d')],{'$or':_[_0xbd5c('0x44')](_0x46f7b8['attributes'],function(_0x440a8c){var _0x456a04={};_0x456a04[_0x440a8c]={'$like':'%'+_0x3ba5d6[_0xbd5c('0x4e')][_0xbd5c('0x3a')]+'%'};return _0x456a04;})});}_0x46f7b8=_['merge']({},_0x46f7b8,_0x3ba5d6[_0xbd5c('0x62')]);return _0x1624e8[_0xbd5c('0xdd')](_0x46f7b8);}})[_0xbd5c('0x2f')](function(_0x1ebeec){if(_0x1ebeec){_0x51a329=_0x1ebeec[_0xbd5c('0x74')];if(!_0x3ba5d6[_0xbd5c('0x4e')][_0xbd5c('0xcc')]('nolimit')){_0x46f7b8[_0xbd5c('0x20')]=qs[_0xbd5c('0x20')](_0x3ba5d6[_0xbd5c('0x4e')][_0xbd5c('0x20')]);_0x46f7b8[_0xbd5c('0x1f')]=qs[_0xbd5c('0x1f')](_0x3ba5d6[_0xbd5c('0x4e')][_0xbd5c('0x1f')]);}return _0x1624e8[_0xbd5c('0xdd')](_0x46f7b8);}})[_0xbd5c('0x2f')](function(_0x53d1d2){if(_0x53d1d2){return _0x53d1d2?{'count':_0x51a329,'rows':_0x53d1d2}:null;}})[_0xbd5c('0x2f')](respondWithResult(_0x591382,null))[_0xbd5c('0x2e')](handleError(_0x591382,null));};exports[_0xbd5c('0xdf')]=function(_0x58b986,_0x439e6b){var _0x5584af={'raw':!![],'where':{}};var _0x2add11={};var _0x11660a={'count':0x0,'rows':[]};return db['User'][_0xbd5c('0xca')]({'where':{'id':_0x58b986[_0xbd5c('0x60')]['id']}})[_0xbd5c('0x2f')](handleEntityNotFound(_0x439e6b,null))[_0xbd5c('0x2f')](function(_0x3cd0a7){if(_0x3cd0a7){_0x2add11['model']=_[_0xbd5c('0xd2')](db[_0xbd5c('0xe0')][_0xbd5c('0x43')]);_0x2add11[_0xbd5c('0x4e')]=_[_0xbd5c('0xd2')](_0x58b986['query']);_0x2add11[_0xbd5c('0xd4')]=_['intersection'](_0x2add11[_0xbd5c('0xd1')],_0x2add11['query']);_0x5584af[_0xbd5c('0x53')]=_[_0xbd5c('0xd5')](_0x2add11[_0xbd5c('0xd1')],qs[_0xbd5c('0xd6')](_0x58b986[_0xbd5c('0x4e')]['fields']));_0x5584af[_0xbd5c('0x53')]=_0x5584af[_0xbd5c('0x53')]['length']?_0x5584af[_0xbd5c('0x53')]:_0x2add11[_0xbd5c('0xd1')];if(!_0x58b986[_0xbd5c('0x4e')]['hasOwnProperty'](_0xbd5c('0xda'))){_0x5584af[_0xbd5c('0x20')]=qs[_0xbd5c('0x20')](_0x58b986[_0xbd5c('0x4e')][_0xbd5c('0x20')]);_0x5584af[_0xbd5c('0x1f')]=qs['offset'](_0x58b986[_0xbd5c('0x4e')][_0xbd5c('0x1f')]);}_0x5584af['order']=qs[_0xbd5c('0xd8')](_0x58b986[_0xbd5c('0x4e')][_0xbd5c('0xd8')]);_0x5584af[_0xbd5c('0x4d')]=qs[_0xbd5c('0xd4')](_['pick'](_0x58b986[_0xbd5c('0x4e')],_0x2add11[_0xbd5c('0xd4')]));_0x5584af[_0xbd5c('0x4d')][_0xbd5c('0xe1')]=_0x3cd0a7['id'];if(_0x58b986[_0xbd5c('0x4e')]['filter']){_0x5584af[_0xbd5c('0x4d')]=_[_0xbd5c('0x61')](_0x5584af[_0xbd5c('0x4d')],{'$or':_[_0xbd5c('0x44')](_0x5584af[_0xbd5c('0x53')],function(_0x1017ce){var _0x280efc={};_0x280efc[_0x1017ce]={'$like':'%'+_0x58b986[_0xbd5c('0x4e')][_0xbd5c('0x3a')]+'%'};return _0x280efc;})});}_0x5584af=_['merge']({},_0x5584af,_0x58b986[_0xbd5c('0x62')]);return db['VoiceRecording'][_0xbd5c('0x22')]({'where':_0x5584af[_0xbd5c('0x4d')]})[_0xbd5c('0x2f')](function(_0x53680b){_0x11660a[_0xbd5c('0x22')]=_0x53680b;if(_0x58b986[_0xbd5c('0x4e')][_0xbd5c('0x4f')]){_0x5584af[_0xbd5c('0x51')]=[{'all':!![]}];}return db[_0xbd5c('0xe0')]['findAll'](_0x5584af);})[_0xbd5c('0x2f')](function(_0x37a289){_0x11660a[_0xbd5c('0x56')]=_0x37a289;return _0x11660a;});}})['then'](respondWithFilteredResult(_0x439e6b,_0x5584af))[_0xbd5c('0x2e')](handleError(_0x439e6b,null));};exports['getScreenRecordings']=function(_0x357c0d,_0x30dd5d){var _0x2ee5a2={'raw':!![],'where':{}};var _0x4dcc9d={};var _0x33e39e={'count':0x0,'rows':[]};return db[_0xbd5c('0x42')][_0xbd5c('0xca')]({'where':{'id':_0x357c0d[_0xbd5c('0x60')]['id']}})[_0xbd5c('0x2f')](handleEntityNotFound(_0x30dd5d,null))[_0xbd5c('0x2f')](function(_0x575a33){if(_0x575a33){_0x4dcc9d[_0xbd5c('0xd1')]=_[_0xbd5c('0xd2')](db['ScreenRecording'][_0xbd5c('0x43')]);_0x4dcc9d[_0xbd5c('0x4e')]=_[_0xbd5c('0xd2')](_0x357c0d['query']);_0x4dcc9d[_0xbd5c('0xd4')]=_[_0xbd5c('0xd5')](_0x4dcc9d[_0xbd5c('0xd1')],_0x4dcc9d[_0xbd5c('0x4e')]);_0x2ee5a2['attributes']=_[_0xbd5c('0xd5')](_0x4dcc9d['model'],qs['fields'](_0x357c0d['query']['fields']));_0x2ee5a2[_0xbd5c('0x53')]=_0x2ee5a2['attributes'][_0xbd5c('0x74')]?_0x2ee5a2[_0xbd5c('0x53')]:_0x4dcc9d[_0xbd5c('0xd1')];if(!_0x357c0d[_0xbd5c('0x4e')]['hasOwnProperty']('nolimit')){_0x2ee5a2[_0xbd5c('0x20')]=qs[_0xbd5c('0x20')](_0x357c0d[_0xbd5c('0x4e')][_0xbd5c('0x20')]);_0x2ee5a2[_0xbd5c('0x1f')]=qs['offset'](_0x357c0d['query']['offset']);}_0x2ee5a2['order']=qs[_0xbd5c('0xd8')](_0x357c0d['query'][_0xbd5c('0xd8')]);_0x2ee5a2['where']=qs[_0xbd5c('0xd4')](_[_0xbd5c('0xdc')](_0x357c0d[_0xbd5c('0x4e')],_0x4dcc9d[_0xbd5c('0xd4')]));_0x2ee5a2[_0xbd5c('0x4d')]['UserId']=_0x575a33['id'];if(_0x357c0d[_0xbd5c('0x4e')]['filter']){_0x2ee5a2[_0xbd5c('0x4d')]=_[_0xbd5c('0x61')](_0x2ee5a2[_0xbd5c('0x4d')],{'$or':_[_0xbd5c('0x44')](_0x2ee5a2[_0xbd5c('0x53')],function(_0x523225){var _0x36d61e={};_0x36d61e[_0x523225]={'$like':'%'+_0x357c0d[_0xbd5c('0x4e')]['filter']+'%'};return _0x36d61e;})});}_0x2ee5a2=_[_0xbd5c('0x61')]({},_0x2ee5a2,_0x357c0d[_0xbd5c('0x62')]);return db['ScreenRecording'][_0xbd5c('0x22')]({'where':_0x2ee5a2['where']})['then'](function(_0x45a962){_0x33e39e[_0xbd5c('0x22')]=_0x45a962;if(_0x357c0d['query']['includeAll']){_0x2ee5a2[_0xbd5c('0x51')]=[{'all':!![]}];}return db[_0xbd5c('0xe2')]['findAll'](_0x2ee5a2);})[_0xbd5c('0x2f')](function(_0x4bf2d6){_0x33e39e[_0xbd5c('0x56')]=_0x4bf2d6;return _0x33e39e;});}})[_0xbd5c('0x2f')](respondWithFilteredResult(_0x30dd5d,_0x2ee5a2))['catch'](handleError(_0x30dd5d,null));};exports[_0xbd5c('0xe3')]=function(_0x39099c,_0x4c3911){var _0x1aeda0={};var _0xe47514={};var _0x1aaf8e;var _0x112e49;return db[_0xbd5c('0x42')][_0xbd5c('0xca')]({'where':{'id':_0x39099c[_0xbd5c('0x60')]['id']}})['then'](handleEntityNotFound(_0x4c3911,null))['then'](function(_0x255ead){if(_0x255ead){_0x1aaf8e=_0x255ead;_0xe47514[_0xbd5c('0xd1')]=_[_0xbd5c('0xd2')](db[_0xbd5c('0xe4')][_0xbd5c('0x43')]);_0xe47514[_0xbd5c('0x4e')]=_[_0xbd5c('0xd2')](_0x39099c['query']);_0xe47514['filters']=_['intersection'](_0xe47514[_0xbd5c('0xd1')],_0xe47514[_0xbd5c('0x4e')]);_0x1aeda0[_0xbd5c('0x53')]=_[_0xbd5c('0xd5')](_0xe47514[_0xbd5c('0xd1')],qs[_0xbd5c('0xd6')](_0x39099c[_0xbd5c('0x4e')][_0xbd5c('0xd6')]));_0x1aeda0['attributes']=_0x1aeda0['attributes'][_0xbd5c('0x74')]?_0x1aeda0[_0xbd5c('0x53')]:_0xe47514[_0xbd5c('0xd1')];_0x1aeda0[_0xbd5c('0xd7')]=qs['sort'](_0x39099c[_0xbd5c('0x4e')]['sort']);_0x1aeda0[_0xbd5c('0x4d')]=qs[_0xbd5c('0xd4')](_['pick'](_0x39099c[_0xbd5c('0x4e')],_0xe47514['filters']));if(_0x39099c[_0xbd5c('0x4e')]['filter']){_0x1aeda0[_0xbd5c('0x4d')]=_[_0xbd5c('0x61')](_0x1aeda0[_0xbd5c('0x4d')],{'$or':_[_0xbd5c('0x44')](_0x1aeda0[_0xbd5c('0x53')],function(_0x813bee){var _0x5a160a={};_0x5a160a[_0x813bee]={'$like':'%'+_0x39099c[_0xbd5c('0x4e')][_0xbd5c('0x3a')]+'%'};return _0x5a160a;})});}_0x1aeda0=_['merge']({},_0x1aeda0,_0x39099c[_0xbd5c('0x62')]);return _0x1aaf8e[_0xbd5c('0xe3')](_0x1aeda0);}})[_0xbd5c('0x2f')](function(_0x8cdda){if(_0x8cdda){_0x112e49=_0x8cdda['length'];if(!_0x39099c[_0xbd5c('0x4e')][_0xbd5c('0xcc')](_0xbd5c('0xda'))){_0x1aeda0[_0xbd5c('0x20')]=qs[_0xbd5c('0x20')](_0x39099c[_0xbd5c('0x4e')][_0xbd5c('0x20')]);_0x1aeda0[_0xbd5c('0x1f')]=qs['offset'](_0x39099c[_0xbd5c('0x4e')]['offset']);}return _0x1aaf8e['getChatInteractions'](_0x1aeda0);}})['then'](function(_0xf13214){if(_0xf13214){return _0xf13214?{'count':_0x112e49,'rows':_0xf13214}:null;}})[_0xbd5c('0x2f')](respondWithResult(_0x4c3911,null))['catch'](handleError(_0x4c3911,null));};exports[_0xbd5c('0xe5')]=function(_0x4120a5,_0xa81461){var _0x390717={};var _0x37208a={};var _0xc2ccd8;var _0x1a422c;return db['User'][_0xbd5c('0xca')]({'where':{'id':_0x4120a5[_0xbd5c('0x60')]['id']}})['then'](handleEntityNotFound(_0xa81461,null))[_0xbd5c('0x2f')](function(_0x30889f){if(_0x30889f){_0xc2ccd8=_0x30889f;_0x37208a[_0xbd5c('0xd1')]=_['keys'](db[_0xbd5c('0xe6')][_0xbd5c('0x43')]);_0x37208a[_0xbd5c('0x4e')]=_[_0xbd5c('0xd2')](_0x4120a5['query']);_0x37208a[_0xbd5c('0xd4')]=_[_0xbd5c('0xd5')](_0x37208a[_0xbd5c('0xd1')],_0x37208a[_0xbd5c('0x4e')]);_0x390717[_0xbd5c('0x53')]=_[_0xbd5c('0xd5')](_0x37208a[_0xbd5c('0xd1')],qs[_0xbd5c('0xd6')](_0x4120a5[_0xbd5c('0x4e')][_0xbd5c('0xd6')]));_0x390717[_0xbd5c('0x53')]=_0x390717[_0xbd5c('0x53')][_0xbd5c('0x74')]?_0x390717[_0xbd5c('0x53')]:_0x37208a[_0xbd5c('0xd1')];_0x390717['order']=qs[_0xbd5c('0xd8')](_0x4120a5['query']['sort']);_0x390717[_0xbd5c('0x4d')]=qs[_0xbd5c('0xd4')](_['pick'](_0x4120a5['query'],_0x37208a[_0xbd5c('0xd4')]));if(_0x4120a5[_0xbd5c('0x4e')][_0xbd5c('0x3a')]){_0x390717[_0xbd5c('0x4d')]=_[_0xbd5c('0x61')](_0x390717[_0xbd5c('0x4d')],{'$or':_[_0xbd5c('0x44')](_0x390717[_0xbd5c('0x53')],function(_0xfd36b1){var _0x1d76f3={};_0x1d76f3[_0xfd36b1]={'$like':'%'+_0x4120a5[_0xbd5c('0x4e')][_0xbd5c('0x3a')]+'%'};return _0x1d76f3;})});}_0x390717=_[_0xbd5c('0x61')]({},_0x390717,_0x4120a5[_0xbd5c('0x62')]);return _0xc2ccd8[_0xbd5c('0xe5')](_0x390717);}})[_0xbd5c('0x2f')](function(_0x54b69f){if(_0x54b69f){_0x1a422c=_0x54b69f[_0xbd5c('0x74')];if(!_0x4120a5[_0xbd5c('0x4e')][_0xbd5c('0xcc')](_0xbd5c('0xda'))){_0x390717[_0xbd5c('0x20')]=qs[_0xbd5c('0x20')](_0x4120a5[_0xbd5c('0x4e')][_0xbd5c('0x20')]);_0x390717[_0xbd5c('0x1f')]=qs[_0xbd5c('0x1f')](_0x4120a5['query'][_0xbd5c('0x1f')]);}return _0xc2ccd8[_0xbd5c('0xe5')](_0x390717);}})[_0xbd5c('0x2f')](function(_0x3b8cb6){if(_0x3b8cb6){return _0x3b8cb6?{'count':_0x1a422c,'rows':_0x3b8cb6}:null;}})[_0xbd5c('0x2f')](respondWithResult(_0xa81461,null))[_0xbd5c('0x2e')](handleError(_0xa81461,null));};exports[_0xbd5c('0xe7')]=function(_0x3012a5,_0x4de99d){var _0x2bf489={'raw':!![],'where':{}};var _0x48549b={};var _0x2aead8={'count':0x0,'rows':[]};return db[_0xbd5c('0x42')][_0xbd5c('0xca')]({'where':{'id':_0x3012a5['params']['id']}})[_0xbd5c('0x2f')](handleEntityNotFound(_0x4de99d,null))['then'](function(_0x524c93){if(_0x524c93){_0x48549b['model']=_[_0xbd5c('0xd2')](db['MailInteraction']['rawAttributes']);_0x48549b[_0xbd5c('0x4e')]=_[_0xbd5c('0xd2')](_0x3012a5[_0xbd5c('0x4e')]);_0x48549b['filters']=_[_0xbd5c('0xd5')](_0x48549b[_0xbd5c('0xd1')],_0x48549b[_0xbd5c('0x4e')]);_0x2bf489['attributes']=_[_0xbd5c('0xd5')](_0x48549b[_0xbd5c('0xd1')],qs[_0xbd5c('0xd6')](_0x3012a5[_0xbd5c('0x4e')]['fields']));_0x2bf489[_0xbd5c('0x53')]=_0x2bf489[_0xbd5c('0x53')][_0xbd5c('0x74')]?_0x2bf489[_0xbd5c('0x53')]:_0x48549b['model'];if(!_0x3012a5[_0xbd5c('0x4e')][_0xbd5c('0xcc')]('nolimit')){_0x2bf489['limit']=qs[_0xbd5c('0x20')](_0x3012a5[_0xbd5c('0x4e')][_0xbd5c('0x20')]);_0x2bf489[_0xbd5c('0x1f')]=qs[_0xbd5c('0x1f')](_0x3012a5[_0xbd5c('0x4e')]['offset']);}_0x2bf489[_0xbd5c('0xd7')]=qs[_0xbd5c('0xd8')](_0x3012a5[_0xbd5c('0x4e')][_0xbd5c('0xd8')]);_0x2bf489['where']=qs['filters'](_['pick'](_0x3012a5[_0xbd5c('0x4e')],_0x48549b[_0xbd5c('0xd4')]));_0x2bf489[_0xbd5c('0x4d')][_0xbd5c('0xe1')]=_0x524c93['id'];if(_0x3012a5[_0xbd5c('0x4e')][_0xbd5c('0x3a')]){_0x2bf489[_0xbd5c('0x4d')]=_['merge'](_0x2bf489[_0xbd5c('0x4d')],{'$or':_[_0xbd5c('0x44')](_0x2bf489[_0xbd5c('0x53')],function(_0x514b94){var _0x3a9951={};_0x3a9951[_0x514b94]={'$like':'%'+_0x3012a5[_0xbd5c('0x4e')][_0xbd5c('0x3a')]+'%'};return _0x3a9951;})});}_0x2bf489=_['merge']({},_0x2bf489,_0x3012a5['options']);return db[_0xbd5c('0xe8')][_0xbd5c('0x22')]({'where':_0x2bf489[_0xbd5c('0x4d')]})[_0xbd5c('0x2f')](function(_0x58a75a){_0x2aead8[_0xbd5c('0x22')]=_0x58a75a;if(_0x3012a5['query'][_0xbd5c('0x4f')]){_0x2bf489[_0xbd5c('0x51')]=[{'all':!![]}];}return db['MailInteraction'][_0xbd5c('0x55')](_0x2bf489);})['then'](function(_0x17238f){_0x2aead8[_0xbd5c('0x56')]=_0x17238f;return _0x2aead8;});}})[_0xbd5c('0x2f')](respondWithFilteredResult(_0x4de99d,_0x2bf489))['catch'](handleError(_0x4de99d,null));};exports['getSmsInteractions']=function(_0x3c160d,_0x29da33){var _0x4ef6b2={};var _0x53bdd7={};var _0x19c22e;var _0x3e7df1;return db[_0xbd5c('0x42')][_0xbd5c('0xca')]({'where':{'id':_0x3c160d[_0xbd5c('0x60')]['id']}})[_0xbd5c('0x2f')](handleEntityNotFound(_0x29da33,null))[_0xbd5c('0x2f')](function(_0x4e8056){if(_0x4e8056){_0x19c22e=_0x4e8056;_0x53bdd7['model']=_[_0xbd5c('0xd2')](db[_0xbd5c('0xe9')][_0xbd5c('0x43')]);_0x53bdd7[_0xbd5c('0x4e')]=_[_0xbd5c('0xd2')](_0x3c160d[_0xbd5c('0x4e')]);_0x53bdd7[_0xbd5c('0xd4')]=_[_0xbd5c('0xd5')](_0x53bdd7[_0xbd5c('0xd1')],_0x53bdd7[_0xbd5c('0x4e')]);_0x4ef6b2[_0xbd5c('0x53')]=_[_0xbd5c('0xd5')](_0x53bdd7[_0xbd5c('0xd1')],qs[_0xbd5c('0xd6')](_0x3c160d[_0xbd5c('0x4e')][_0xbd5c('0xd6')]));_0x4ef6b2[_0xbd5c('0x53')]=_0x4ef6b2[_0xbd5c('0x53')][_0xbd5c('0x74')]?_0x4ef6b2[_0xbd5c('0x53')]:_0x53bdd7['model'];_0x4ef6b2[_0xbd5c('0xd7')]=qs[_0xbd5c('0xd8')](_0x3c160d[_0xbd5c('0x4e')]['sort']);_0x4ef6b2[_0xbd5c('0x4d')]=qs[_0xbd5c('0xd4')](_['pick'](_0x3c160d[_0xbd5c('0x4e')],_0x53bdd7['filters']));if(_0x3c160d[_0xbd5c('0x4e')][_0xbd5c('0x3a')]){_0x4ef6b2[_0xbd5c('0x4d')]=_['merge'](_0x4ef6b2[_0xbd5c('0x4d')],{'$or':_['map'](_0x4ef6b2[_0xbd5c('0x53')],function(_0x1a194c){var _0x57a3f9={};_0x57a3f9[_0x1a194c]={'$like':'%'+_0x3c160d['query'][_0xbd5c('0x3a')]+'%'};return _0x57a3f9;})});}_0x4ef6b2=_[_0xbd5c('0x61')]({},_0x4ef6b2,_0x3c160d['options']);return _0x19c22e['getSmsInteractions'](_0x4ef6b2);}})[_0xbd5c('0x2f')](function(_0x559cfe){if(_0x559cfe){_0x3e7df1=_0x559cfe[_0xbd5c('0x74')];if(!_0x3c160d['query'][_0xbd5c('0xcc')](_0xbd5c('0xda'))){_0x4ef6b2[_0xbd5c('0x20')]=qs['limit'](_0x3c160d['query'][_0xbd5c('0x20')]);_0x4ef6b2['offset']=qs[_0xbd5c('0x1f')](_0x3c160d[_0xbd5c('0x4e')][_0xbd5c('0x1f')]);}return _0x19c22e[_0xbd5c('0xea')](_0x4ef6b2);}})[_0xbd5c('0x2f')](function(_0xaa0743){if(_0xaa0743){return _0xaa0743?{'count':_0x3e7df1,'rows':_0xaa0743}:null;}})['then'](respondWithResult(_0x29da33,null))[_0xbd5c('0x2e')](handleError(_0x29da33,null));};exports['getFaxInteractions']=function(_0x1b119f,_0x2cb615){var _0x3620d7={};var _0x1dcf45={};var _0x22e2b1;var _0x2d542f;return db[_0xbd5c('0x42')][_0xbd5c('0xca')]({'where':{'id':_0x1b119f[_0xbd5c('0x60')]['id']}})[_0xbd5c('0x2f')](handleEntityNotFound(_0x2cb615,null))[_0xbd5c('0x2f')](function(_0x105cee){if(_0x105cee){_0x22e2b1=_0x105cee;_0x1dcf45[_0xbd5c('0xd1')]=_['keys'](db['FaxInteraction'][_0xbd5c('0x43')]);_0x1dcf45[_0xbd5c('0x4e')]=_['keys'](_0x1b119f[_0xbd5c('0x4e')]);_0x1dcf45['filters']=_['intersection'](_0x1dcf45[_0xbd5c('0xd1')],_0x1dcf45[_0xbd5c('0x4e')]);_0x3620d7[_0xbd5c('0x53')]=_[_0xbd5c('0xd5')](_0x1dcf45['model'],qs['fields'](_0x1b119f['query'][_0xbd5c('0xd6')]));_0x3620d7['attributes']=_0x3620d7[_0xbd5c('0x53')]['length']?_0x3620d7[_0xbd5c('0x53')]:_0x1dcf45[_0xbd5c('0xd1')];_0x3620d7[_0xbd5c('0xd7')]=qs[_0xbd5c('0xd8')](_0x1b119f['query'][_0xbd5c('0xd8')]);_0x3620d7[_0xbd5c('0x4d')]=qs[_0xbd5c('0xd4')](_[_0xbd5c('0xdc')](_0x1b119f[_0xbd5c('0x4e')],_0x1dcf45[_0xbd5c('0xd4')]));if(_0x1b119f[_0xbd5c('0x4e')]['filter']){_0x3620d7[_0xbd5c('0x4d')]=_[_0xbd5c('0x61')](_0x3620d7[_0xbd5c('0x4d')],{'$or':_['map'](_0x3620d7['attributes'],function(_0x5413be){var _0xb26476={};_0xb26476[_0x5413be]={'$like':'%'+_0x1b119f[_0xbd5c('0x4e')][_0xbd5c('0x3a')]+'%'};return _0xb26476;})});}_0x3620d7=_[_0xbd5c('0x61')]({},_0x3620d7,_0x1b119f['options']);return _0x22e2b1['getFaxInteractions'](_0x3620d7);}})[_0xbd5c('0x2f')](function(_0x35094d){if(_0x35094d){_0x2d542f=_0x35094d['length'];if(!_0x1b119f['query'][_0xbd5c('0xcc')](_0xbd5c('0xda'))){_0x3620d7['limit']=qs[_0xbd5c('0x20')](_0x1b119f[_0xbd5c('0x4e')][_0xbd5c('0x20')]);_0x3620d7[_0xbd5c('0x1f')]=qs[_0xbd5c('0x1f')](_0x1b119f[_0xbd5c('0x4e')][_0xbd5c('0x1f')]);}return _0x22e2b1[_0xbd5c('0xeb')](_0x3620d7);}})[_0xbd5c('0x2f')](function(_0x399b94){if(_0x399b94){return _0x399b94?{'count':_0x2d542f,'rows':_0x399b94}:null;}})[_0xbd5c('0x2f')](respondWithResult(_0x2cb615,null))['catch'](handleError(_0x2cb615,null));};exports[_0xbd5c('0xec')]=function(_0x4b8b01,_0x24959d){var _0x1d1fb5={};var _0x2a9f8f={};var _0x16a20b;var _0x1c3a68;return db[_0xbd5c('0x42')][_0xbd5c('0xca')]({'where':{'id':_0x4b8b01[_0xbd5c('0x60')]['id']}})[_0xbd5c('0x2f')](handleEntityNotFound(_0x24959d,null))['then'](function(_0x1846c3){if(_0x1846c3){_0x16a20b=_0x1846c3;_0x2a9f8f[_0xbd5c('0xd1')]=_[_0xbd5c('0xd2')](db[_0xbd5c('0xed')][_0xbd5c('0x43')]);_0x2a9f8f['query']=_[_0xbd5c('0xd2')](_0x4b8b01['query']);_0x2a9f8f['filters']=_[_0xbd5c('0xd5')](_0x2a9f8f[_0xbd5c('0xd1')],_0x2a9f8f['query']);_0x1d1fb5['attributes']=_[_0xbd5c('0xd5')](_0x2a9f8f['model'],qs[_0xbd5c('0xd6')](_0x4b8b01['query'][_0xbd5c('0xd6')]));_0x1d1fb5[_0xbd5c('0x53')]=_0x1d1fb5[_0xbd5c('0x53')][_0xbd5c('0x74')]?_0x1d1fb5[_0xbd5c('0x53')]:_0x2a9f8f[_0xbd5c('0xd1')];_0x1d1fb5[_0xbd5c('0xd7')]=qs[_0xbd5c('0xd8')](_0x4b8b01[_0xbd5c('0x4e')][_0xbd5c('0xd8')]);_0x1d1fb5['where']=qs[_0xbd5c('0xd4')](_[_0xbd5c('0xdc')](_0x4b8b01[_0xbd5c('0x4e')],_0x2a9f8f[_0xbd5c('0xd4')]));if(_0x4b8b01[_0xbd5c('0x4e')][_0xbd5c('0x3a')]){_0x1d1fb5[_0xbd5c('0x4d')]=_[_0xbd5c('0x61')](_0x1d1fb5[_0xbd5c('0x4d')],{'$or':_[_0xbd5c('0x44')](_0x1d1fb5['attributes'],function(_0x13b7be){var _0x4dd29c={};_0x4dd29c[_0x13b7be]={'$like':'%'+_0x4b8b01['query'][_0xbd5c('0x3a')]+'%'};return _0x4dd29c;})});}_0x1d1fb5=_[_0xbd5c('0x61')]({},_0x1d1fb5,_0x4b8b01['options']);return _0x16a20b[_0xbd5c('0xec')](_0x1d1fb5);}})['then'](function(_0x1f37c1){if(_0x1f37c1){_0x1c3a68=_0x1f37c1['length'];if(!_0x4b8b01[_0xbd5c('0x4e')]['hasOwnProperty'](_0xbd5c('0xda'))){_0x1d1fb5[_0xbd5c('0x20')]=qs[_0xbd5c('0x20')](_0x4b8b01['query'][_0xbd5c('0x20')]);_0x1d1fb5[_0xbd5c('0x1f')]=qs[_0xbd5c('0x1f')](_0x4b8b01[_0xbd5c('0x4e')][_0xbd5c('0x1f')]);}return _0x16a20b[_0xbd5c('0xec')](_0x1d1fb5);}})[_0xbd5c('0x2f')](function(_0xa11612){if(_0xa11612){return _0xa11612?{'count':_0x1c3a68,'rows':_0xa11612}:null;}})[_0xbd5c('0x2f')](respondWithResult(_0x24959d,null))[_0xbd5c('0x2e')](handleError(_0x24959d,null));};exports[_0xbd5c('0xee')]=function(_0x26096a,_0x7b2aa1,_0x1dbd50){var _0x3120cc;var _0x390cc1;var _0x4a6d90;var _0x4aca03=!_[_0xbd5c('0x70')](_0x26096a['params']['id'])?_0x26096a[_0xbd5c('0x60')]['id']:!_[_0xbd5c('0x70')](_0x26096a[_0xbd5c('0x36')]['id'])?_0x26096a[_0xbd5c('0x36')]['id']:null;return db[_0xbd5c('0x42')][_0xbd5c('0x3d')]({'where':{'id':_0x4aca03,'role':{'$or':[_0xbd5c('0x34'),_0xbd5c('0x36'),_0xbd5c('0x37')]}},'attributes':['id',_0xbd5c('0x40'),'phone',_0xbd5c('0xef'),_0xbd5c('0x33'),_0xbd5c('0x6b'),_0xbd5c('0xf0')]})[_0xbd5c('0x2f')](function(_0x17ea18){if(_0x17ea18){if(_0x17ea18[_0xbd5c('0x33')]===_0xbd5c('0x37')){_0x3120cc=_0x17ea18;if(_0x26096a['body'][_0xbd5c('0xa7')]){_0x4a6d90=util[_0xbd5c('0xb2')](_0xbd5c('0xf1'),_0x3120cc[_0x26096a[_0xbd5c('0x66')]['interface']]);}else if(_0x26096a[_0xbd5c('0x66')]['intrf']){_0x4a6d90=util[_0xbd5c('0xb2')](_0xbd5c('0xf2'),_0x26096a[_0xbd5c('0x66')][_0xbd5c('0xf3')]);}else{_0x4a6d90=util[_0xbd5c('0xb2')]('SIP/%s',_0x3120cc[_0xbd5c('0x40')]);}socket['to'](util[_0xbd5c('0xb2')](_0xbd5c('0xf4'),_0x3120cc[_0xbd5c('0x40')]))[_0xbd5c('0x30')](_0xbd5c('0xf5'),{'user':{'id':_0x3120cc['id'],'name':_0x3120cc[_0xbd5c('0x40')]},'ip':_0x26096a['headers']['x-forwarded-for']||_0x26096a['connection'][_0xbd5c('0xf6')]||_0x26096a['socket']['remoteAddress']||_0x26096a[_0xbd5c('0xf7')]['socket'][_0xbd5c('0xf6')]});return db['UserVoiceQueueRt'][_0xbd5c('0x31')]({'where':{'membername':_0x3120cc[_0xbd5c('0x40')]},'individualHooks':!![]});}}else{throw new db[(_0xbd5c('0x9d'))][(_0xbd5c('0x9e'))](_0xbd5c('0xf8'));}})[_0xbd5c('0x2f')](function(){if(_0x3120cc){return _0x3120cc['getVoiceQueues']({'raw':!![]});}})[_0xbd5c('0x2f')](function(_0x3b01e3){if(_0x3120cc){if(_0x3b01e3){_0x390cc1=_0x3b01e3;if(_0x390cc1['length']){var _0x1f5926=_0x390cc1[_0xbd5c('0x44')](function(_0x283cd0){var _0x441eb0={'membername':_0x3120cc[_0xbd5c('0x40')],'UserId':_0x3120cc['id'],'queue_name':_0x283cd0[_0xbd5c('0x40')],'VoiceQueueId':_0x283cd0['id'],'interface':_0x4a6d90,'paused':_0x3120cc[_0xbd5c('0xf0')]||![],'penalty':_0x283cd0['UserVoiceQueue.penalty']||0x0};return db[_0xbd5c('0xb4')][_0xbd5c('0xb5')](_0x441eb0);});return Promise[_0xbd5c('0x5e')](_0x1f5926);}}}})[_0xbd5c('0x2f')](function(){if(_0x3120cc){return db[_0xbd5c('0xf9')][_0xbd5c('0x55')]({'where':{'membername':_0x3120cc['name'],'exitAt':null}});}})[_0xbd5c('0x2f')](function(_0x61affb){if(_0x3120cc){var _0x237d04=[];_0x61affb['forEach'](function(_0x4dcb14){_0x237d04[_0xbd5c('0x54')](_0x4dcb14[_0xbd5c('0x65')]({'exitAt':moment()[_0xbd5c('0xb2')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise['all'](_0x237d04);}})['then'](function(){if(_0x3120cc){var _0x4de5f6=[];var _0x329ecd=[];var _0x1ac349=utils[_0xbd5c('0xfa')]();var _0x302394={'membername':_0x3120cc[_0xbd5c('0x40')],'interface':_0x4a6d90,'enterAt':moment()[_0xbd5c('0xb2')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x3120cc[_0xbd5c('0x33')],'internal':_0x3120cc['internal']};_0x1ac349[_0xbd5c('0xfb')](function(_0x490d95){_0x4de5f6[_0xbd5c('0x54')](_['merge']({'channel':_0x490d95,'type':_0xbd5c('0xfc'),'data1':_0x26096a[_0xbd5c('0x66')]['device'],'data2':_0x4a6d90},_0x302394));if(_0x3120cc[_0xbd5c('0xf0')]){_0x329ecd['push'](_[_0xbd5c('0x61')]({'channel':_0x490d95,'type':_0xbd5c('0xfd'),'data1':_0xbd5c('0xfe')},_0x302394));}});return db['MemberReport'][_0xbd5c('0x94')](_0x4de5f6[_0xbd5c('0xff')](_0x329ecd),{'individualHooks':!![]});}})[_0xbd5c('0x2f')](function(){if(_0x3120cc){return _0x3120cc[_0xbd5c('0x65')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x3120cc['loginInPause']||![],'mailPause':_0x3120cc[_0xbd5c('0xf0')]||![],'chatPause':_0x3120cc[_0xbd5c('0xf0')]||![],'faxPause':_0x3120cc[_0xbd5c('0xf0')]||![],'smsPause':_0x3120cc[_0xbd5c('0xf0')]||![],'openchannelPause':_0x3120cc[_0xbd5c('0xf0')]||![],'whatsappPause':_0x3120cc[_0xbd5c('0xf0')]||![],'pauseType':_0x3120cc[_0xbd5c('0xf0')]?_0xbd5c('0xfe'):null,'interface':_0x4a6d90,'lastPauseAt':moment()[_0xbd5c('0xb2')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xbd5c('0x2f')](function(_0x51cf1f){if(_0x26096a[_0xbd5c('0x100')]){return _0x1dbd50();}else{return Promise['resolve'](_0x51cf1f)[_0xbd5c('0x2f')](respondWithResult(_0x7b2aa1,null));}})['catch'](handleError(_0x7b2aa1,null));};exports[_0xbd5c('0x101')]=function(_0x5eadde,_0x4a33be){var _0x9a2a9d;return db[_0xbd5c('0x42')][_0xbd5c('0x3d')]({'where':{'id':_0x5eadde[_0xbd5c('0x60')]['id'],'role':'agent'},'attributes':['id','name',_0xbd5c('0x33')]})[_0xbd5c('0x2f')](handleEntityNotFound(_0x4a33be,null))[_0xbd5c('0x2f')](function(_0xabf1d3){if(_0xabf1d3){_0x9a2a9d=_0xabf1d3;return db[_0xbd5c('0xb4')][_0xbd5c('0x31')]({'where':{'membername':_0x9a2a9d['name']},'individualHooks':!![]});}})[_0xbd5c('0x2f')](function(){return db['MemberReport'][_0xbd5c('0x55')]({'where':{'membername':_0x9a2a9d[_0xbd5c('0x40')],'exitAt':null}});})[_0xbd5c('0x2f')](function(_0x3eb15b){var _0x403c71=[];_0x3eb15b[_0xbd5c('0xfb')](function(_0x4fcd5c){_0x403c71[_0xbd5c('0x54')](_0x4fcd5c[_0xbd5c('0x65')]({'exitAt':moment()[_0xbd5c('0xb2')](_0xbd5c('0x102'))}));});return Promise['all'](_0x403c71);})['then'](function(){return _0x9a2a9d[_0xbd5c('0x65')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xbd5c('0x2f')](respondWithResult(_0x4a33be,null))[_0xbd5c('0x2e')](handleError(_0x4a33be,null));};exports[_0xbd5c('0x103')]=function(_0x19ea8b,_0x23da17){var _0x51680c;return db['UserVoiceQueueRt'][_0xbd5c('0x65')]({'paused':0x1},{'where':{'UserId':_0x19ea8b['params']['id']},'individualHooks':!![]})[_0xbd5c('0x2f')](function(){return db[_0xbd5c('0x42')]['find']({'where':{'id':_0x19ea8b[_0xbd5c('0x60')]['id'],'role':_0xbd5c('0x37')},'attributes':['id','name',_0xbd5c('0x33'),'internal',_0xbd5c('0xa7'),'online']});})[_0xbd5c('0x2f')](handleEntityNotFound(_0x23da17,null))[_0xbd5c('0x2f')](function(_0x2f5685){if(_0x2f5685){_0x51680c=_0x2f5685;return respondWithRpcPromise(_0xbd5c('0x104'),_0xbd5c('0x103'),{'id':_0x51680c['id'],'name':_0x51680c['name'],'pause':!![]});}})[_0xbd5c('0x2f')](function(){if(_0x51680c){return db[_0xbd5c('0xf9')][_0xbd5c('0x55')]({'where':{'membername':_0x51680c[_0xbd5c('0x40')],'type':_0xbd5c('0xfd'),'exitAt':null}});}})['then'](function(_0x3ee1e1){if(_0x3ee1e1[_0xbd5c('0x74')]){var _0x1a9d6e=moment()[_0xbd5c('0xb2')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x880b22=0x0,_0x4c6cc8=_0x3ee1e1[_0xbd5c('0x74')];_0x880b22<_0x4c6cc8;_0x880b22++){_0x3ee1e1[_0x880b22][_0xbd5c('0x105')]({'exitAt':_0x1a9d6e});}}})[_0xbd5c('0x2f')](function(){var _0x44fed4=[];var _0x1c2019=utils['getChannels']();_0x1c2019[_0xbd5c('0xfb')](function(_0x5f4968){_0x44fed4[_0xbd5c('0x54')]({'channel':_0x5f4968,'membername':_0x51680c[_0xbd5c('0x40')],'interface':_[_0xbd5c('0x70')](_0x51680c[_0xbd5c('0xa7')])?util[_0xbd5c('0xb2')](_0xbd5c('0xf2'),_0x51680c['name']):_0x51680c[_0xbd5c('0xa7')],'type':_0xbd5c('0xfd'),'enterAt':moment()[_0xbd5c('0xb2')](_0xbd5c('0x102')),'data1':_0x19ea8b[_0xbd5c('0x66')][_0xbd5c('0x46')]||_0xbd5c('0x106'),'role':_0x51680c['role'],'internal':_0x51680c[_0xbd5c('0x6b')]});});return db[_0xbd5c('0xf9')][_0xbd5c('0x94')](_0x44fed4,{'individualHooks':!![]});})[_0xbd5c('0x2f')](function(){return _0x51680c[_0xbd5c('0x65')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x19ea8b[_0xbd5c('0x66')][_0xbd5c('0x46')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xbd5c('0xb2')](_0xbd5c('0x102'))});})['then'](respondWithResult(_0x23da17,null))[_0xbd5c('0x2e')](handleError(_0x23da17,null));};exports[_0xbd5c('0x107')]=function(_0x3fca11,_0xd93c87){if(_0x3fca11[_0xbd5c('0x66')]['channel']&&!utils[_0xbd5c('0xa8')](_0x3fca11[_0xbd5c('0x66')]['channel'])){throw new APIBadRequestError(util[_0xbd5c('0xb2')](_0xbd5c('0x108'),_0x3fca11[_0xbd5c('0x66')][_0xbd5c('0xa5')]));}return db[_0xbd5c('0x42')]['find']({'where':{'id':_0x3fca11['params']['id']},'attributes':['id',_0xbd5c('0x40'),_0xbd5c('0x33'),_0xbd5c('0x6b'),'interface','online','voicePause',_0xbd5c('0x109'),'chatPause',_0xbd5c('0x10a'),_0xbd5c('0x10b'),_0xbd5c('0x10c'),_0xbd5c('0x10d'),_0xbd5c('0x10e'),_0xbd5c('0x10f')]})['then'](function(_0x1479ce){if(!_0x1479ce){throw new APINotFoundError(util[_0xbd5c('0xb2')]('User\x20with\x20id\x20%s\x20not\x20found',_0x3fca11['params']['id']));}return _0x1479ce['unpause'](_0x3fca11[_0xbd5c('0x66')][_0xbd5c('0xa5')]);})[_0xbd5c('0x2f')](respondWithResult(_0xd93c87,null))[_0xbd5c('0x2e')](APIHandleError(_0xd93c87));};exports[_0xbd5c('0x110')]=function(_0x1217b4,_0xeb7e0d){var _0x245ed1={};var _0x41e4e9={};var _0x40654a;var _0x5bcc68;return db[_0xbd5c('0x42')][_0xbd5c('0xca')]({'where':{'id':_0x1217b4[_0xbd5c('0x60')]['id']}})[_0xbd5c('0x2f')](handleEntityNotFound(_0xeb7e0d,null))[_0xbd5c('0x2f')](function(_0x5080d1){if(_0x5080d1){_0x40654a=_0x5080d1;_0x41e4e9[_0xbd5c('0xd1')]=_[_0xbd5c('0xd2')](db[_0xbd5c('0x111')][_0xbd5c('0x43')]);_0x41e4e9['query']=_[_0xbd5c('0xd2')](_0x1217b4['query']);_0x41e4e9['filters']=_[_0xbd5c('0xd5')](_0x41e4e9[_0xbd5c('0xd1')],_0x41e4e9[_0xbd5c('0x4e')]);_0x245ed1[_0xbd5c('0x53')]=_[_0xbd5c('0xd5')](_0x41e4e9[_0xbd5c('0xd1')],qs[_0xbd5c('0xd6')](_0x1217b4[_0xbd5c('0x4e')][_0xbd5c('0xd6')]));_0x245ed1['attributes']=_0x245ed1[_0xbd5c('0x53')][_0xbd5c('0x74')]?_0x245ed1[_0xbd5c('0x53')]:_0x41e4e9[_0xbd5c('0xd1')];_0x245ed1[_0xbd5c('0xd7')]=qs[_0xbd5c('0xd8')](_0x1217b4[_0xbd5c('0x4e')][_0xbd5c('0xd8')]);_0x245ed1['where']=qs['filters'](_[_0xbd5c('0xdc')](_0x1217b4[_0xbd5c('0x4e')],_0x41e4e9[_0xbd5c('0xd4')]));if(_0x1217b4[_0xbd5c('0x4e')]['filter']){_0x245ed1[_0xbd5c('0x4d')]=_[_0xbd5c('0x61')](_0x245ed1[_0xbd5c('0x4d')],{'$or':_[_0xbd5c('0x44')](_0x245ed1['attributes'],function(_0x25733d){var _0x393b2c={};_0x393b2c[_0x25733d]={'$like':'%'+_0x1217b4[_0xbd5c('0x4e')][_0xbd5c('0x3a')]+'%'};return _0x393b2c;})});}_0x245ed1=_[_0xbd5c('0x61')]({},_0x245ed1,_0x1217b4[_0xbd5c('0x62')]);return _0x40654a['getTeams'](_0x245ed1);}})[_0xbd5c('0x2f')](function(_0x18f390){if(_0x18f390){_0x5bcc68=_0x18f390[_0xbd5c('0x74')];if(!_0x1217b4[_0xbd5c('0x4e')][_0xbd5c('0xcc')]('nolimit')){_0x245ed1[_0xbd5c('0x20')]=qs['limit'](_0x1217b4[_0xbd5c('0x4e')][_0xbd5c('0x20')]);_0x245ed1[_0xbd5c('0x1f')]=qs[_0xbd5c('0x1f')](_0x1217b4[_0xbd5c('0x4e')][_0xbd5c('0x1f')]);}return _0x40654a[_0xbd5c('0x110')](_0x245ed1);}})[_0xbd5c('0x2f')](function(_0x15d398){if(_0x15d398){return _0x15d398?{'count':_0x5bcc68,'rows':_0x15d398}:null;}})[_0xbd5c('0x2f')](respondWithResult(_0xeb7e0d,null))['catch'](handleError(_0xeb7e0d,null));};exports[_0xbd5c('0x112')]=function(_0x3394b1,_0x23b94a){var _0x3f8f32=_0x3394b1[_0xbd5c('0x60')]['id'];var _0x3e62a5=_0x3394b1[_0xbd5c('0x66')]?_0x3394b1['body'][_0xbd5c('0x69')]:null;var _0x9c49a1=[];return Promise[_0xbd5c('0x113')]()[_0xbd5c('0x2f')](function(){if(!_0x3e62a5)throw new APIBadRequestError(_0xbd5c('0x114'));})['then'](function(){return db['User'][_0xbd5c('0xca')]({'where':{'id':_0x3f8f32}});})[_0xbd5c('0x2f')](function(_0x15e04d){if(!_0x15e04d)throw new APINotFoundError(util[_0xbd5c('0xb2')](_0xbd5c('0xcb'),_0x3394b1[_0xbd5c('0x60')]['id']));return db[_0xbd5c('0x72')][_0xbd5c('0x115')](function(_0x3fd92d){return _0x15e04d[_0xbd5c('0x112')](_0x3e62a5,{'transaction':_0x3fd92d})[_0xbd5c('0x2f')](function(){return db[_0xbd5c('0x111')][_0xbd5c('0x55')]({'where':{'id':{'$in':_0x3e62a5}}});})['then'](function(_0x23fa3a){var _0x2055f2=_['map'](_0x23fa3a,function(_0x5f40d9){return _0x5f40d9['getAssociatedQueues']();});return Promise['all'](_0x2055f2);})['then'](function(_0x3e536d){_0x9c49a1=_[_0xbd5c('0x116')](_0x3e536d);var _0x3bb3b9=_[_0xbd5c('0x44')](_0x9c49a1,function(_0x59fab2){return _0x59fab2[_0xbd5c('0x117')](_0x15e04d['id'],{'transaction':_0x3fd92d});});return Promise['all'](_0x3bb3b9);})[_0xbd5c('0x2f')](function(){if(!_0x15e04d[_0xbd5c('0xa6')])return;var _0x19b494=_[_0xbd5c('0x3a')](_0x9c49a1,function(_0x2dd702){return _0x2dd702['getDataValue'](_0xbd5c('0xa5'))===_0xbd5c('0x118');});var _0x26526e=_['map'](_0x19b494,function(_0x1c4f75){return db[_0xbd5c('0xb4')][_0xbd5c('0xb5')]({'membername':_0x15e04d[_0xbd5c('0x40')],'UserId':_0x15e04d['id'],'queue_name':_0x1c4f75[_0xbd5c('0x40')],'VoiceQueueId':_0x1c4f75['id'],'interface':_['isNil'](_0x15e04d['interface'])?util['format']('SIP/%s',_0x15e04d[_0xbd5c('0x40')]):_0x15e04d[_0xbd5c('0xa7')],'paused':_0x15e04d[_0xbd5c('0xb3')]||![],'penalty':_0x15e04d['penalty']},{'transaction':_0x3fd92d});});return Promise[_0xbd5c('0x5e')](_0x26526e);})[_0xbd5c('0x2f')](function(){return db[_0xbd5c('0x119')][_0xbd5c('0x55')]({'where':{'teamId':{'$in':_0x3e62a5}}});})[_0xbd5c('0x2f')](function(_0x4b9cd1){var _0x11ef48=_[_0xbd5c('0x44')](_0x4b9cd1,function(_0x503013){return db[_0xbd5c('0x11a')]['create']({'UserId':_0x15e04d['id'],'VoicePrefixId':_0x503013[_0xbd5c('0x11b')]},{'transaction':_0x3fd92d});});return Promise[_0xbd5c('0x5e')](_0x11ef48);});});})['then'](function(){for(var _0x5713a7=0x0;_0x5713a7<_0x9c49a1['length'];_0x5713a7++){var _0x1f391c=_0x9c49a1[_0x5713a7]['getDataValue'](_0xbd5c('0xa5'));var _0x1b34a6=_0x1f391c+_0xbd5c('0xb0');socket[_0xbd5c('0x30')](_0xbd5c('0x36')+_0x1f391c+_0xbd5c('0x11c'),{'UserId':_0x3f8f32,['queueField']:_0x9c49a1[_0x5713a7]['id']});}})[_0xbd5c('0x2f')](respondWithStatusCode(_0x23b94a,null))[_0xbd5c('0x2e')](APIHandleError(_0x23b94a));};exports[_0xbd5c('0x11d')]=function(_0x44b38d,_0x28257c){var _0x1dfb47=_0x44b38d['params']['id'];var _0x2cdd19=null;if(_0x44b38d[_0xbd5c('0x4e')]['ids']){_0x2cdd19=_[_0xbd5c('0xb7')](_0x44b38d[_0xbd5c('0x4e')][_0xbd5c('0x69')])?_0x44b38d[_0xbd5c('0x4e')][_0xbd5c('0x69')]:[_0x44b38d[_0xbd5c('0x4e')][_0xbd5c('0x69')]];}var _0x146d23=[];return Promise[_0xbd5c('0x113')]()[_0xbd5c('0x2f')](function(){if(!_0x2cdd19)throw new APIBadRequestError(_0xbd5c('0x11e'));})[_0xbd5c('0x2f')](function(){return db[_0xbd5c('0x42')][_0xbd5c('0xca')]({'where':{'id':_0x1dfb47}});})[_0xbd5c('0x2f')](function(_0x36981f){if(!_0x36981f)throw new APINotFoundError(util[_0xbd5c('0xb2')](_0xbd5c('0xcb'),_0x44b38d['params']['id']));return db['sequelize'][_0xbd5c('0x115')](function(_0x2927fd){return _0x36981f[_0xbd5c('0x11d')](_0x2cdd19,{'transaction':_0x2927fd})[_0xbd5c('0x2f')](function(){return db[_0xbd5c('0x111')][_0xbd5c('0x55')]({'where':{'id':{'$in':_0x2cdd19}}});})['then'](function(_0x5ab3c1){var _0x202b25=_[_0xbd5c('0x44')](_0x5ab3c1,function(_0x4f6951){return _0x4f6951['getAssociatedQueues']();});return Promise[_0xbd5c('0x5e')](_0x202b25);})['then'](function(_0x443fd7){_0x146d23=_['flattenDeep'](_0x443fd7);var _0x385bb9=_[_0xbd5c('0x44')](_0x146d23,function(_0x480730){return _0x480730[_0xbd5c('0x11f')](_0x36981f['id'],{'transaction':_0x2927fd});});return Promise[_0xbd5c('0x5e')](_0x385bb9);})[_0xbd5c('0x2f')](function(){if(!_0x36981f[_0xbd5c('0xa6')])return;var _0x3f988a=_[_0xbd5c('0x3a')](_0x146d23,function(_0x51bdb6){return _0x51bdb6[_0xbd5c('0x120')](_0xbd5c('0xa5'))===_0xbd5c('0x118');});var _0x597869=_[_0xbd5c('0x44')](_0x3f988a,function(_0x45932f){return db[_0xbd5c('0xb4')]['destroy']({'where':{'VoiceQueueId':_0x45932f['id'],'UserId':_0x36981f['id']},'transaction':_0x2927fd});});return Promise['all'](_0x597869);})['then'](function(){return db['TeamVoicePrefix'][_0xbd5c('0x55')]({'where':{'teamId':{'$in':_0x2cdd19}}});})['then'](function(_0x1d76e2){var _0x1276bc=_[_0xbd5c('0x44')](_0x1d76e2,function(_0x116498){return db[_0xbd5c('0x11a')]['destroy']({'where':{'UserId':_0x36981f['id'],'VoicePrefixId':_0x116498[_0xbd5c('0x11b')]}},{'transaction':_0x2927fd});});return Promise['all'](_0x1276bc);});});})[_0xbd5c('0x2f')](function(){for(var _0x38143d=0x0;_0x38143d<_0x146d23['length'];_0x38143d++){var _0xd3c0a6=_0x146d23[_0x38143d][_0xbd5c('0x120')](_0xbd5c('0xa5'));var _0x263a0d=_0xd3c0a6+_0xbd5c('0xb0');socket[_0xbd5c('0x30')](_0xbd5c('0x36')+_0xd3c0a6+'Queue:remove',{'UserId':_0x1dfb47,['queueField']:_0x146d23[_0x38143d]['id']});}})[_0xbd5c('0x2f')](respondWithStatusCode(_0x28257c,null))['catch'](APIHandleError(_0x28257c));};exports[_0xbd5c('0x121')]=function(_0x4b3209,_0x41f232){var _0x3748f1={};var _0x53f7ad={};var _0x312cd9;var _0x56515e;return db[_0xbd5c('0x42')][_0xbd5c('0xca')]({'where':{'id':_0x4b3209[_0xbd5c('0x60')]['id']}})[_0xbd5c('0x2f')](handleEntityNotFound(_0x41f232,null))[_0xbd5c('0x2f')](function(_0x33a4d9){if(_0x33a4d9){_0x312cd9=_0x33a4d9;_0x53f7ad[_0xbd5c('0xd1')]=_['keys'](db['CmList']['rawAttributes']);_0x53f7ad[_0xbd5c('0x4e')]=_[_0xbd5c('0xd2')](_0x4b3209['query']);_0x53f7ad['filters']=_[_0xbd5c('0xd5')](_0x53f7ad[_0xbd5c('0xd1')],_0x53f7ad[_0xbd5c('0x4e')]);_0x3748f1[_0xbd5c('0x53')]=_[_0xbd5c('0xd5')](_0x53f7ad['model'],qs[_0xbd5c('0xd6')](_0x4b3209[_0xbd5c('0x4e')][_0xbd5c('0xd6')]));_0x3748f1['attributes']=_0x3748f1[_0xbd5c('0x53')]['length']?_0x3748f1[_0xbd5c('0x53')]:_0x53f7ad[_0xbd5c('0xd1')];_0x3748f1[_0xbd5c('0xd7')]=qs['sort'](_0x4b3209[_0xbd5c('0x4e')][_0xbd5c('0xd8')]);_0x3748f1[_0xbd5c('0x4d')]=qs['filters'](_[_0xbd5c('0xdc')](_0x4b3209[_0xbd5c('0x4e')],_0x53f7ad[_0xbd5c('0xd4')]));if(_0x4b3209['query'][_0xbd5c('0x3a')]){_0x3748f1[_0xbd5c('0x4d')]=_[_0xbd5c('0x61')](_0x3748f1[_0xbd5c('0x4d')],{'$or':_[_0xbd5c('0x44')](_0x3748f1[_0xbd5c('0x53')],function(_0x386077){var _0x4ef3c9={};_0x4ef3c9[_0x386077]={'$like':'%'+_0x4b3209[_0xbd5c('0x4e')][_0xbd5c('0x3a')]+'%'};return _0x4ef3c9;})});}_0x3748f1=_[_0xbd5c('0x61')]({},_0x3748f1,_0x4b3209[_0xbd5c('0x62')]);return _0x312cd9['getLists'](_0x3748f1);}})[_0xbd5c('0x2f')](function(_0x51c651){if(_0x51c651){_0x56515e=_0x51c651[_0xbd5c('0x74')];if(!_0x4b3209[_0xbd5c('0x4e')][_0xbd5c('0xcc')](_0xbd5c('0xda'))){_0x3748f1['limit']=qs[_0xbd5c('0x20')](_0x4b3209[_0xbd5c('0x4e')]['limit']);_0x3748f1[_0xbd5c('0x1f')]=qs[_0xbd5c('0x1f')](_0x4b3209[_0xbd5c('0x4e')][_0xbd5c('0x1f')]);}return _0x312cd9[_0xbd5c('0x121')](_0x3748f1);}})['then'](function(_0x5e1a0b){if(_0x5e1a0b){return _0x5e1a0b?{'count':_0x56515e,'rows':_0x5e1a0b}:null;}})[_0xbd5c('0x2f')](respondWithResult(_0x41f232,null))[_0xbd5c('0x2e')](handleError(_0x41f232,null));};exports[_0xbd5c('0x122')]=function(_0xbb05,_0x469fb5){var _0x249345={};var _0x59a0e9={};var _0x15b10f;return db[_0xbd5c('0x42')][_0xbd5c('0xca')]({'where':{'id':_0xbb05[_0xbd5c('0x60')]['id']}})[_0xbd5c('0x2f')](handleEntityNotFound(_0x469fb5,null))['then'](function(_0x1f4e28){if(_0x1f4e28){_0x15b10f=_0x1f4e28;_0x59a0e9[_0xbd5c('0xd1')]=_['keys'](db[_0xbd5c('0x42')][_0xbd5c('0x43')]);_0x59a0e9[_0xbd5c('0x4e')]=_[_0xbd5c('0xd2')](_0xbb05[_0xbd5c('0x4e')]);_0x59a0e9['filters']=_[_0xbd5c('0xd5')](_0x59a0e9['model'],_0x59a0e9[_0xbd5c('0x4e')]);_0x249345[_0xbd5c('0x53')]=_['intersection'](_0x59a0e9['model'],qs[_0xbd5c('0xd6')](_0xbb05['query'][_0xbd5c('0xd6')]));_0x249345['attributes']=_0x249345[_0xbd5c('0x53')]['length']?_0x249345[_0xbd5c('0x53')]:_0x59a0e9[_0xbd5c('0xd1')];_0x249345['order']=qs['sort'](_0xbb05[_0xbd5c('0x4e')][_0xbd5c('0xd8')]);_0x249345[_0xbd5c('0x4d')]=qs[_0xbd5c('0xd4')](_[_0xbd5c('0xdc')](_0xbb05[_0xbd5c('0x4e')],_0x59a0e9['filters']));if(_0xbb05[_0xbd5c('0x4e')][_0xbd5c('0x3a')]){_0x249345[_0xbd5c('0x4d')]=_[_0xbd5c('0x61')](_0x249345[_0xbd5c('0x4d')],{'$or':_['map'](_0x249345[_0xbd5c('0x53')],function(_0x2f52f7){var _0x381d48={};_0x381d48[_0x2f52f7]={'$like':'%'+_0xbb05[_0xbd5c('0x4e')][_0xbd5c('0x3a')]+'%'};return _0x381d48;})});}_0x249345[_0xbd5c('0xd1')]=db['User'];_0x249345['as']='Agents';_0x249345=_[_0xbd5c('0x61')]({},_0x249345,_0xbb05[_0xbd5c('0x62')]);return _0x15b10f[_0xbd5c('0x123')]({'include':[_0x249345]});}})[_0xbd5c('0x2f')](function(_0x4868cc){if(_0x4868cc){var _0x5f038e={},_0x2ea73b=[];for(var _0x3874d4=0x0;_0x3874d4<_0x4868cc[_0xbd5c('0x74')];_0x3874d4+=0x1){for(var _0x4a2bff=0x0,_0x1a772b;_0x4a2bff<_0x4868cc[_0x3874d4][_0xbd5c('0x90')][_0xbd5c('0x74')];_0x4a2bff+=0x1){_0x1a772b=_0x4868cc[_0x3874d4][_0xbd5c('0x90')][_0x4a2bff][_0xbd5c('0x32')]({'plain':!![]});_0x5f038e[_0x1a772b['id']]=_0x1a772b;}}_0x5f038e=_[_0xbd5c('0x124')](_0x5f038e);for(var _0x46094a=qs[_0xbd5c('0x1f')](_0xbb05['query'][_0xbd5c('0x1f')]);_0x46094a<_0x5f038e[_0xbd5c('0x74')]&&_0x2ea73b[_0xbd5c('0x74')]=_0x53a027){_0x33c0b3=_0x53a027;_0x1c5e65=0xc8;}else{_0x1c5e65=0xce;}_0x24d637[_0x003f('0x17')](_0x1c5e65);return _0x24d637['set'](_0x003f('0x1e'),_0x3c18fd+'-'+_0x33c0b3+'/'+_0x53a027)['json'](_0x51a14a);}return null;};}function respondWithRpcPromise(_0x4f921b,_0x298493,_0x18ba8a,_0x562f33){return new Promise(function(_0x62ebb5,_0x285ba3){var _0x2d7c25=_0x562f33||amiClient;return _0x2d7c25[_0x003f('0x1f')](_0x4f921b,_0x18ba8a)[_0x003f('0x20')](function(_0x2d68d4){logger[_0x003f('0x21')](_0x003f('0x22'),_0x298493,_0x003f('0x23'));logger[_0x003f('0x24')](_0x003f('0x25'),_0x298493,_0x003f('0x23'),JSON[_0x003f('0x26')](_0x2d68d4));if(_0x2d68d4[_0x003f('0x27')]){if(_0x2d68d4[_0x003f('0x27')][_0x003f('0x28')]===0x1f4){logger[_0x003f('0x27')](_0x003f('0x22'),_0x298493,_0x2d68d4['error'][_0x003f('0x29')]);return _0x285ba3(_0x2d68d4[_0x003f('0x27')]['message']);}logger[_0x003f('0x27')](_0x003f('0x22'),_0x298493,_0x2d68d4['error'][_0x003f('0x29')]);return _0x62ebb5(_0x2d68d4[_0x003f('0x27')][_0x003f('0x29')]);}else{logger[_0x003f('0x21')](_0x003f('0x22'),_0x298493,'request\x20sent');_0x62ebb5(_0x2d68d4[_0x003f('0x2a')][_0x003f('0x29')]);}})[_0x003f('0x2b')](function(_0x9b124d){logger[_0x003f('0x27')]('User,\x20%s,\x20%s',_0x298493,_0x9b124d);_0x285ba3(_0x9b124d);});});}function saveUpdates(_0x2813b3){return function(_0x5ef1c6){if(_0x5ef1c6){return _0x5ef1c6['update'](_0x2813b3)[_0x003f('0x20')](function(_0x386f1f){if(_0x386f1f[_0x003f('0x2c')]==='agent'){socket[_0x003f('0x2d')]('userNotification:recalc:'+_0x386f1f['id'],_0x386f1f);}return _0x386f1f;});}return null;};}function removeEntity(_0x3cfcfa,_0x29da28){return function(_0xc295cc){if(_0xc295cc){return _0xc295cc[_0x003f('0x2e')]({'transaction':_0x29da28})[_0x003f('0x20')](function(){var _0x2652a1=_0xc295cc[_0x003f('0x2f')]({'plain':!![]});if(_0x2652a1[_0x003f('0x2c')]===_0x003f('0x30'))return;var _0x17a45b=[{'name':_0x003f('0x31'),'value':'user','ignore':!![]},{'name':_0x003f('0x32'),'value':_0x003f('0x33'),'ignore':![]},{'name':'Telephones','value':_0x003f('0x34'),'ignore':![]}];var _0x359797=_(_0x17a45b)[_0x003f('0x35')](_0x003f('0x36'))[_0x003f('0x37')](_0x003f('0x38'))[_0x003f('0x38')]();if(_[_0x003f('0x39')](_0x359797,_0x2652a1['role'])){return;}var _0x6e9ae1=_[_0x003f('0x3a')](_0x17a45b,[_0x003f('0x38'),_0x2652a1[_0x003f('0x2c')]])['name'];return db[_0x003f('0x3b')][_0x003f('0x2e')]({'where':{'type':_0x6e9ae1,'resourceId':_0x2652a1['id']},'transaction':_0x29da28})['then'](function(){return _0xc295cc;});})[_0x003f('0x20')](function(){_0x3cfcfa['status'](0xcc)[_0x003f('0x18')]();});}};}function handleEntityNotFound(_0x492530){return function(_0xe47e71){if(!_0xe47e71){_0x492530[_0x003f('0x16')](0x194);}return _0xe47e71;};}function handleError(_0x594e30,_0x254db3){_0x254db3=_0x254db3||0x1f4;return function(_0x236c64){logger[_0x003f('0x27')](_0x236c64['stack']);if(_0x236c64[_0x003f('0x3c')]){delete _0x236c64[_0x003f('0x3c')];}_0x594e30[_0x003f('0x17')](_0x254db3)[_0x003f('0x3d')](_0x236c64);};}function getUserAttributes(){return _(db[_0x003f('0x3e')][_0x003f('0x3f')])[_0x003f('0x37')](function(_0x42a323){return{'name':_0x42a323[_0x003f('0x40')],'type':_0x42a323['type'][_0x003f('0x41')]};})[_0x003f('0x35')](function(_0x46716f){return![_0x003f('0x42'),'salt',_0x003f('0x43'),_0x003f('0x44'),_0x003f('0x45'),'md5secret'][_0x003f('0x39')](_0x46716f[_0x003f('0x3c')]);})[_0x003f('0x38')]();}exports['index']=function(_0x1be149,_0x15c8df){var _0x42e8c9={},_0x19fdb1={'count':0x0,'rows':[]};var _0x1b8074=getUserAttributes();_0x42e8c9=qs['getOptions'](_0x1b8074,_0x1be149);var _0xe9f5f6={'where':_0x42e8c9[_0x003f('0x46')]};return db[_0x003f('0x3e')]['count'](_0xe9f5f6)[_0x003f('0x20')](function(_0x38e0af){_0x19fdb1['count']=_0x38e0af;if(_0x1be149[_0x003f('0x47')][_0x003f('0x48')]){_0x42e8c9[_0x003f('0x49')]=[{'all':!![]}];}if(_0x1be149[_0x003f('0x47')][_0x003f('0x4a')]==='true'){_0x42e8c9['include']=[{'model':db[_0x003f('0x4b')],'as':_0x003f('0x4a')}];}if(!_['includes'](_0x42e8c9[_0x003f('0x4c')],'id')){_0x42e8c9['attributes'][_0x003f('0x4d')]('id');}return db[_0x003f('0x3e')][_0x003f('0x4e')](_0x42e8c9);})[_0x003f('0x20')](function(_0x2a18ef){_0x19fdb1['rows']=_0x2a18ef;if(_0x1be149[_0x003f('0x47')][_0x003f('0x4f')]==='true'){var _0x52906c=[];for(var _0x44592b=0x0;_0x44592b<_0x19fdb1['rows'][_0x003f('0x50')];_0x44592b++){_0x52906c[_0x003f('0x4d')](get_open_tabs('chat',_0x19fdb1[_0x003f('0x51')][_0x44592b][_0x003f('0x52')]));_0x52906c['push'](get_open_tabs(_0x003f('0x53'),_0x19fdb1[_0x003f('0x51')][_0x44592b]['dataValues']));_0x52906c[_0x003f('0x4d')](get_open_tabs(_0x003f('0x54'),_0x19fdb1[_0x003f('0x51')][_0x44592b][_0x003f('0x52')]));_0x52906c['push'](get_open_tabs(_0x003f('0x55'),_0x19fdb1[_0x003f('0x51')][_0x44592b][_0x003f('0x52')]));_0x52906c[_0x003f('0x4d')](get_open_tabs(_0x003f('0x56'),_0x19fdb1['rows'][_0x44592b][_0x003f('0x52')]));_0x52906c['push'](get_open_tabs(_0x003f('0x57'),_0x19fdb1[_0x003f('0x51')][_0x44592b][_0x003f('0x52')]));}return Promise[_0x003f('0x58')](_0x52906c)[_0x003f('0x20')](function(){return _0x19fdb1;});}else{return _0x19fdb1;}})[_0x003f('0x20')](respondWithFilteredResult(_0x15c8df,_0x42e8c9))['catch'](handleError(_0x15c8df,null));};exports['show']=function(_0x1cfba6,_0x3a14ed){var _0x2f17d0=getUserAttributes();_0x1cfba6[_0x003f('0x47')]['id']=_0x1cfba6[_0x003f('0x59')]['id'];var _0x114c65=qs[_0x003f('0x5a')](_0x2f17d0,_0x1cfba6);if(_0x1cfba6[_0x003f('0x47')][_0x003f('0x48')]){_0x114c65['include']=[{'all':!![]}];}if(_0x1cfba6[_0x003f('0x47')]['userSetting']===_0x003f('0x5b')){_0x114c65[_0x003f('0x49')]=[{'model':db[_0x003f('0x4b')],'as':'userSetting'}];}_0x114c65=_[_0x003f('0x5c')]({},_0x114c65,_0x1cfba6[_0x003f('0x5d')]);if(!_[_0x003f('0x39')](_0x114c65['attributes'],'id')){_0x114c65[_0x003f('0x4c')][_0x003f('0x4d')]('id');}return db[_0x003f('0x3e')][_0x003f('0x3a')](_0x114c65)['then'](handleEntityNotFound(_0x3a14ed,null))['then'](function(_0x1e0685){var _0x3bc6b4=[];values=_0x1e0685;if(_0x1cfba6[_0x003f('0x47')][_0x003f('0x4f')]===_0x003f('0x5b')){_0x3bc6b4['push'](get_open_tabs(_0x003f('0x5e'),_0x1e0685[_0x003f('0x52')]));_0x3bc6b4['push'](get_open_tabs(_0x003f('0x53'),_0x1e0685[_0x003f('0x52')]));_0x3bc6b4[_0x003f('0x4d')](get_open_tabs(_0x003f('0x56'),_0x1e0685[_0x003f('0x52')]));_0x3bc6b4[_0x003f('0x4d')](get_open_tabs('whatsapp',_0x1e0685[_0x003f('0x52')]));_0x3bc6b4[_0x003f('0x4d')](get_open_tabs(_0x003f('0x54'),_0x1e0685[_0x003f('0x52')]));_0x3bc6b4[_0x003f('0x4d')](get_open_tabs(_0x003f('0x55'),_0x1e0685['dataValues']));return Promise[_0x003f('0x58')](_0x3bc6b4);}else{return values;}})[_0x003f('0x20')](function(){return values;})[_0x003f('0x20')](respondWithResult(_0x3a14ed,null))[_0x003f('0x2b')](handleError(_0x3a14ed,null));};exports[_0x003f('0x5f')]=function(_0x5554fb,_0x28289c){if(_0x5554fb['body']['id']){delete _0x5554fb[_0x003f('0x60')]['id'];}delete _0x5554fb[_0x003f('0x60')]['role'];return db[_0x003f('0x3e')][_0x003f('0x3a')]({'where':{'id':_0x5554fb['params']['id']}})[_0x003f('0x20')](handleEntityNotFound(_0x28289c,null))['then'](saveUpdates(_0x5554fb[_0x003f('0x60')],null))['then'](respondWithResult(_0x28289c,null))['catch'](handleError(_0x28289c,null));};exports[_0x003f('0x61')]=function(_0x518d83,_0x2ef4d8){return db['User']['describe']()[_0x003f('0x20')](respondWithResult(_0x2ef4d8,null))[_0x003f('0x2b')](handleError(_0x2ef4d8,null));};exports['addContacts']=function(_0x1c6ccc,_0x4fda92){return db['User']['find']({'where':{'id':_0x1c6ccc[_0x003f('0x59')]['id']}})[_0x003f('0x20')](handleEntityNotFound(_0x4fda92,null))[_0x003f('0x20')](function(_0x56aa37){if(_0x56aa37){return _0x56aa37[_0x003f('0x62')](_0x1c6ccc[_0x003f('0x60')][_0x003f('0x63')],_[_0x003f('0x64')](_0x1c6ccc[_0x003f('0x60')],[_0x003f('0x63'),'id'])||{});}})[_0x003f('0x20')](respondWithResult(_0x4fda92,null))[_0x003f('0x2b')](handleError(_0x4fda92,null));};function validateUser(_0x2b0c8b){return new Promise(function(_0x71d06,_0x48fb0f){if(_0x2b0c8b['internal'])return _0x71d06(_0x2b0c8b);return db[_0x003f('0x65')][_0x003f('0x66')](0x1)[_0x003f('0x20')](function(_0xadd4f2){if(_0xadd4f2[_0x003f('0x67')])authService[_0x003f('0x68')](_0x2b0c8b[_0x003f('0x42')]);db[_0x003f('0x3e')][_0x003f('0x69')](_0x003f('0x6a'))[_0x003f('0x20')](function(_0x537642){if(_['isNil'](_0x537642)){_0x2b0c8b['internal']=_0xadd4f2['min_internal']||0x1;return;}if(_[_0x003f('0x6b')](_0xadd4f2[_0x003f('0x6c')])||_0xadd4f2[_0x003f('0x6c')]===_0x537642){_0x2b0c8b[_0x003f('0x6a')]=_0x537642+0x1;return;}if(_0xadd4f2[_0x003f('0x6c')]>_0x537642){_0x2b0c8b['internal']=_0xadd4f2['min_internal'];return;}return db[_0x003f('0x6d')]['query'](_0x003f('0x6e'),{'type':db[_0x003f('0x6d')]['QueryTypes'][_0x003f('0x6f')]})[_0x003f('0x20')](function(_0x477730){if(_0x477730&&_0x477730[_0x003f('0x50')]){for(var _0x333255=0x0,_0x1e4809=_0x477730[_0x003f('0x50')];_0x333255<_0x1e4809&&_[_0x003f('0x6b')](_0x2b0c8b[_0x003f('0x6a')]);_0x333255++){if(_0xadd4f2['min_internal']<=_0x477730[_0x333255][_0x003f('0x70')]){_0x2b0c8b['internal']=_0x477730[_0x333255][_0x003f('0x70')];}else if(_0xadd4f2[_0x003f('0x6c')]>_0x477730[_0x333255][_0x003f('0x70')]&&_0xadd4f2[_0x003f('0x6c')]<=_0x477730[_0x333255]['to']){_0x2b0c8b['internal']=_0xadd4f2[_0x003f('0x6c')];}}}if(_[_0x003f('0x6b')](_0x2b0c8b[_0x003f('0x6a')])){_0x2b0c8b[_0x003f('0x6a')]=_0x537642+0x1;}return _0x71d06(_0x2b0c8b);});});})[_0x003f('0x2b')](function(_0x3c54f7){_0x48fb0f(_0x3c54f7);});});}function updateUser(_0xfba546){return new Promise(function(_0x534846,_0x14bdf8){try{if(_0xfba546[_0x003f('0x71')]){_0xfba546[_0x003f('0x72')]=_0xfba546['internal'];_0xfba546[_0x003f('0x73')]={'mailbox':_0xfba546[_0x003f('0x6a')],'password':_0xfba546[_0x003f('0x42')],'fullname':_0xfba546[_0x003f('0x74')],'email':_0xfba546['email']};}if(_0xfba546[_0x003f('0x2c')]===_0x003f('0x33')){if(!_0xfba546['permissions'])_0xfba546[_0x003f('0x75')]=[_0x003f('0x76'),'102',_0x003f('0x77'),_0x003f('0x78'),_0x003f('0x79'),'104',_0x003f('0x7a'),_0x003f('0x7b'),_0x003f('0x7c'),_0x003f('0x7d'),'109',_0x003f('0x7e'),'111','114',_0x003f('0x7f')];}_0x534846(_0xfba546);}catch(_0x100376){_0x14bdf8(_0x100376);}});}exports['create']=function(_0x2559fc,_0x584dcf){if(_0x2559fc['user'][_0x003f('0x2c')]===_0x003f('0x33'))throw new Error('Unauthorized');if(_0x2559fc[_0x003f('0x60')][_0x003f('0x2c')]===_0x003f('0x80')&&_0x2559fc[_0x003f('0x80')]['role']!=='admin'){throw new Error(_0x003f('0x81'));}if(_0x2559fc[_0x003f('0x60')][_0x003f('0x2c')]===_0x003f('0x30')&&_0x2559fc[_0x003f('0x80')][_0x003f('0x2c')]!==_0x003f('0x30')){throw new Error(_0x003f('0x82'));}return licenseUtil[_0x003f('0x83')]([_0x2559fc[_0x003f('0x60')]])[_0x003f('0x20')](function(){return validateUser(_0x2559fc[_0x003f('0x60')]);})[_0x003f('0x20')](function(_0x180a90){return updateUser(_0x180a90)[_0x003f('0x20')](function(_0x28b4e1){if(_0x28b4e1['role']==='admin'){_0x28b4e1[_0x003f('0x84')]=_0x2559fc[_0x003f('0x80')][_0x003f('0x84')];delete _0x28b4e1[_0x003f('0x85')];}return _0x28b4e1;});})[_0x003f('0x20')](function(_0x9892e2){return db[_0x003f('0x3e')][_0x003f('0x86')](_0x9892e2,{'include':[{'model':db[_0x003f('0x73')],'as':_0x003f('0x73')}]});})[_0x003f('0x20')](function(_0x5362c9){if(_0x2559fc[_0x003f('0x60')][_0x003f('0x2c')]===_0x003f('0x80'))return _0x5362c9;if(_0x2559fc[_0x003f('0x80')]['role']!==_0x003f('0x80'))return _0x5362c9;return db[_0x003f('0x87')][_0x003f('0x3a')]({'where':{'name':_0x5362c9['role']===_0x003f('0x33')?_0x003f('0x32'):_0x003f('0x88'),'userProfileId':_0x2559fc[_0x003f('0x80')][_0x003f('0x85')]},'raw':!![]})[_0x003f('0x20')](function(_0x15b16e){if(!_0x15b16e||_0x15b16e[_0x003f('0x89')]!=0x0)return _0x5362c9;return db[_0x003f('0x3b')][_0x003f('0x86')]({'name':_0x5362c9[_0x003f('0x3c')],'resourceId':_0x5362c9['id'],'type':_0x15b16e['name'],'sectionId':_0x15b16e['id']},{})['then'](function(){return _0x5362c9;});})[_0x003f('0x2b')](function(_0x28bc44){logger[_0x003f('0x27')](_0x003f('0x8a'),_0x28bc44);throw _0x28bc44;});})[_0x003f('0x20')](respondWithResult(_0x584dcf,0xc9))[_0x003f('0x2b')](handleError(_0x584dcf,null));};exports['bulkCreate']=function(_0x43d29e,_0x573cda){var _0x2ab8a3=_0x43d29e['body'];var _0x3351da=[];if(_0x43d29e[_0x003f('0x80')][_0x003f('0x2c')]===_0x003f('0x33'))throw new Error(_0x003f('0x8b'));if(_['some'](_0x2ab8a3,['role',_0x003f('0x80')])&&_0x43d29e[_0x003f('0x80')]['role']!==_0x003f('0x30')){throw new Error(_0x003f('0x81'));}if(_[_0x003f('0x8c')](_0x2ab8a3,[_0x003f('0x2c'),_0x003f('0x30')])&&_0x43d29e[_0x003f('0x80')][_0x003f('0x2c')]!==_0x003f('0x30')){throw new Error(_0x003f('0x8d'));}return licenseUtil['checkUserLimits'](_0x2ab8a3)[_0x003f('0x20')](function(){return validateUser(_0x2ab8a3[0x0]);})[_0x003f('0x20')](function(){for(var _0x33e42f=0x1;_0x33e42f<_0x2ab8a3['length'];_0x33e42f++){var _0x285f8e=_0x2ab8a3[_0x33e42f-0x1][_0x003f('0x6a')];if(!_0x2ab8a3[_0x33e42f]['internal'])_0x2ab8a3[_0x33e42f]['internal']=_0x285f8e+0x1;_0x3351da[_0x003f('0x4d')](validateUser(_0x2ab8a3[_0x33e42f]));}return Promise[_0x003f('0x58')](_0x3351da);})[_0x003f('0x20')](function(){_0x3351da=[];for(var _0x10a36c=0x0;_0x10a36c<_0x2ab8a3['length'];_0x10a36c++){_0x3351da[_0x003f('0x4d')](updateUser(_0x2ab8a3[_0x10a36c]));}return Promise[_0x003f('0x58')](_0x3351da);})[_0x003f('0x20')](function(){_0x3351da=_0x2ab8a3[_0x003f('0x37')](function(_0x3b8f07){return db[_0x003f('0x3e')][_0x003f('0x86')](_0x3b8f07,{'include':[{'model':db[_0x003f('0x73')],'as':'VoiceMail'}]})[_0x003f('0x20')](function(_0x2c341a){_0x3b8f07['id']=_0x2c341a['id'];return _0x3b8f07;});});return Promise[_0x003f('0x58')](_0x3351da);})[_0x003f('0x20')](function(_0x445b67){if(_0x43d29e['body'][_0x003f('0x2c')]==='user')return _0x445b67;if(_0x43d29e[_0x003f('0x80')][_0x003f('0x2c')]!==_0x003f('0x80'))return _0x445b67;var _0x43ead5=_[_0x003f('0x8c')](_0x445b67,function(_0x35e0ae){return _0x35e0ae[_0x003f('0x2c')]==='agent'||_0x35e0ae[_0x003f('0x2c')]===_0x003f('0x34');});if(!_0x43ead5)return _0x445b67;return db[_0x003f('0x87')]['findAll']({'where':{'name':{'$or':[_0x003f('0x32'),_0x003f('0x88')]},'userProfileId':_0x43d29e[_0x003f('0x80')][_0x003f('0x85')]},'raw':!![]})[_0x003f('0x20')](function(_0xc0b9a4){if(_[_0x003f('0x8e')](_0xc0b9a4)||!_[_0x003f('0x8c')](_0xc0b9a4,[_0x003f('0x89'),0x0]))return _0x445b67;_0x3351da=[];var _0x27af53=_(_0xc0b9a4)[_0x003f('0x37')](function(_0xb9a9b0){if(_0xb9a9b0[_0x003f('0x89')]===0x1)return;return _0xb9a9b0['name']===_0x003f('0x32')?'agent':'telephone';})[_0x003f('0x8f')]()[_0x003f('0x38')]();for(var _0x114ecc=0x0;_0x114ecc<_0x445b67['length'];_0x114ecc++){if(!_[_0x003f('0x39')](_0x27af53,_0x445b67[_0x114ecc][_0x003f('0x2c')]))return;var _0x471232=_0x445b67[_0x114ecc][_0x003f('0x2c')]===_0x003f('0x33')?'Agents':_0x003f('0x88');_0x3351da[_0x003f('0x4d')](db[_0x003f('0x3b')][_0x003f('0x86')]({'name':_0x445b67[_0x114ecc][_0x003f('0x3c')],'resourceId':_0x445b67[_0x114ecc]['id'],'type':_0x471232,'sectionId':_[_0x003f('0x3a')](_0xc0b9a4,['name',_0x471232])['id']},{}));}return Promise[_0x003f('0x58')](_0x3351da);});})['then'](respondWithResult(_0x573cda,0xc9))['catch'](handleError(_0x573cda,null));};exports[_0x003f('0x90')]=function(_0x5afcf0,_0x346c5b){if(_0x5afcf0[_0x003f('0x60')]['id']){delete _0x5afcf0[_0x003f('0x60')]['id'];}return db[_0x003f('0x3e')][_0x003f('0x3a')]({'where':{'id':_0x5afcf0['params']['id']}})['then'](function(_0x544446){if(!_0x544446)return null;if(_0x544446['id']===_0x5afcf0[_0x003f('0x80')]['id']){if(!_0x5afcf0[_0x003f('0x60')][_0x003f('0x91')]||!_0x5afcf0['body'][_0x003f('0x92')]){throw new db['Sequelize'][(_0x003f('0x93'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x544446['authenticate'](_0x5afcf0[_0x003f('0x60')]['oldPassword'])){throw new db[(_0x003f('0x94'))]['ValidationError'](_0x003f('0x95'));}if(_0x5afcf0[_0x003f('0x60')][_0x003f('0x91')]===_0x5afcf0[_0x003f('0x60')][_0x003f('0x92')]){throw new db[(_0x003f('0x94'))][(_0x003f('0x93'))](_0x003f('0x96'));}}else if(_0x5afcf0[_0x003f('0x80')]['role']===_0x003f('0x30')){if(!_0x5afcf0[_0x003f('0x60')]['newPassword']){throw new db[(_0x003f('0x94'))][(_0x003f('0x93'))](_0x003f('0x97'));}}else if(_0x5afcf0['user'][_0x003f('0x2c')]===_0x003f('0x80')){if(!_0x5afcf0[_0x003f('0x60')][_0x003f('0x92')]){throw new db[(_0x003f('0x94'))]['ValidationError'](_0x003f('0x97'));}if(_0x544446[_0x003f('0x2c')]!==_0x003f('0x33')){throw new db[(_0x003f('0x94'))]['ValidationError'](_0x003f('0x8b'));}}else{throw new db[(_0x003f('0x94'))]['ValidationError'](_0x003f('0x8b'));}return _0x544446;})[_0x003f('0x20')](handleEntityNotFound(_0x346c5b,null))['then'](function(_0x12cdd5){return db[_0x003f('0x65')][_0x003f('0x98')]({'attributes':['id',_0x003f('0x67'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x003f('0x20')](function(_0x61e332){if(_0x61e332[_0x003f('0x67')])authService['validatePasswordPattern'](_0x5afcf0[_0x003f('0x60')][_0x003f('0x92')]);if(!_0x61e332[_0x003f('0x99')]||!_0x12cdd5[_0x003f('0x43')])return _0x12cdd5;authService['validatePasswordHistory'](_0x5afcf0['body'][_0x003f('0x92')],_0x12cdd5[_0x003f('0x43')],_0x61e332[_0x003f('0x9a')]);return _0x12cdd5;})[_0x003f('0x20')](saveUpdates({'password':_0x5afcf0[_0x003f('0x60')]['newPassword'],'passwordResetAt':_0x5afcf0[_0x003f('0x80')]['id']==_0x5afcf0[_0x003f('0x59')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x5afcf0[_0x003f('0x60')][_0x003f('0x92')],_0x12cdd5[_0x003f('0x43')])},null));})[_0x003f('0x20')](respondWithResult(_0x346c5b,null))[_0x003f('0x2b')](handleError(_0x346c5b,null));};exports[_0x003f('0x9b')]=function(_0x47bd68,_0x1e06f0){var _0xbdc361=_0x47bd68['body']['channel'];return db[_0x003f('0x3e')][_0x003f('0x3a')]({'where':{'id':_0x47bd68[_0x003f('0x59')]['id']},'attributes':['id','name','role','online',_0x003f('0x9c'),_0x003f('0x9d'),_0x003f('0x9e')]})[_0x003f('0x20')](handleEntityNotFound(_0x1e06f0,null))[_0x003f('0x20')](function(_0x3d005a){if(_0x3d005a){if(!utils[_0x003f('0x9f')](_0xbdc361)){throw new db[(_0x003f('0x94'))]['ValidationError'](_0x003f('0xa0'));}return _0x3d005a['add'+_['capitalize'](_0xbdc361['toLowerCase']())+_0x003f('0xa1')](_0x47bd68[_0x003f('0x60')][_0x003f('0x63')],{'penalty':_0x47bd68[_0x003f('0x60')][_0x003f('0xa2')]||0x0})[_0x003f('0xa3')](function(_0x281884){for(var _0x1495c0=0x0;_0x1495c0<_0x47bd68[_0x003f('0x60')]['ids'][_0x003f('0x50')];_0x1495c0+=0x1){var _0x1829d5={'UserId':Number(_0x47bd68[_0x003f('0x59')]['id'])};_0x1829d5[_['capitalize'](_0xbdc361[_0x003f('0xa4')]())+_0x003f('0xa5')]=Number(_0x47bd68[_0x003f('0x60')]['ids'][_0x1495c0]);socket[_0x003f('0x2d')]('user'+_[_0x003f('0xa6')](_0xbdc361['toLowerCase']())+_0x003f('0xa7'),_0x1829d5);}return _0x281884;})['then'](function(){if(_0xbdc361==='voice'){return db[_0x003f('0xa8')][_0x003f('0x4e')]({'where':{'id':_0x47bd68[_0x003f('0x60')]['ids']||[]},'raw':!![],'attributes':['id',_0x003f('0x3c')]});}})[_0x003f('0x20')](function(_0x209047){var _0x150c50=_0x3d005a[_0x003f('0x2f')]({'plain':!![]});var _0x61d267=[];if(_0xbdc361==='voice'&&_0x150c50['role']===_0x003f('0x33')&&_0x150c50['online']){for(let _0x4cfe04=0x0;_0x4cfe04<_0x209047[_0x003f('0x50')];_0x4cfe04+=0x1){_0x61d267[_0x003f('0x4d')]({'membername':_0x150c50[_0x003f('0x3c')],'UserId':_0x150c50['id'],'queue_name':_0x209047[_0x4cfe04][_0x003f('0x3c')],'VoiceQueueId':_0x209047[_0x4cfe04]['id'],'interface':_[_0x003f('0x6b')](_0x150c50[_0x003f('0x9e')])?util['format'](_0x003f('0xa9'),_0x150c50['name']):_0x150c50[_0x003f('0x9e')],'paused':_0x150c50[_0x003f('0x9d')]||![],'penalty':_0x47bd68['body']['penalty']||0x0});}return Promise[_0x003f('0x58')](_0x61d267['map'](function(_0x53877a){return db['UserVoiceQueueRt']['upsert'](_0x53877a);}));}return _0x3d005a;});}})[_0x003f('0x20')](respondWithStatusCode(_0x1e06f0,null))[_0x003f('0x2b')](handleError(_0x1e06f0,null));};exports['removeQueues']=function(_0x3aca76,_0x520db5){var _0x125fc,_0x3ae1ae;return db[_0x003f('0x3e')]['find']({'where':{'id':_0x3aca76[_0x003f('0x59')]['id']},'attributes':['id','name',_0x003f('0x2c')]})[_0x003f('0x20')](handleEntityNotFound(_0x520db5,null))[_0x003f('0x20')](function(_0x5ee8c9){if(_0x5ee8c9){_0x125fc=_0x5ee8c9;if(!_0x3aca76[_0x003f('0x47')][_0x003f('0xaa')]||!utils[_0x003f('0x9f')](_0x3aca76[_0x003f('0x47')][_0x003f('0xaa')])){throw new db['Sequelize'][(_0x003f('0x93'))](_0x003f('0xa0'));}return _0x5ee8c9['remove'+_[_0x003f('0xa6')](_0x3aca76[_0x003f('0x47')][_0x003f('0xaa')]['toLowerCase']())+_0x003f('0xa1')](_0x3aca76[_0x003f('0x47')][_0x003f('0x63')]);}})[_0x003f('0x20')](function(_0x7c8c4){if(_[_0x003f('0xab')](_0x3aca76[_0x003f('0x47')][_0x003f('0x63')])){for(var _0x3e1aef=0x0;_0x3e1aef<_0x3aca76[_0x003f('0x47')][_0x003f('0x63')][_0x003f('0x50')];_0x3e1aef+=0x1){_0x3ae1ae={'UserId':Number(_0x3aca76[_0x003f('0x59')]['id'])};_0x3ae1ae[_['capitalize'](_0x3aca76[_0x003f('0x47')][_0x003f('0xaa')][_0x003f('0xa4')]())+_0x003f('0xa5')]=Number(_0x3aca76[_0x003f('0x47')][_0x003f('0x63')][_0x3e1aef]);socket[_0x003f('0x2d')]('user'+_['capitalize'](_0x3aca76['query'][_0x003f('0xaa')][_0x003f('0xa4')]())+_0x003f('0xac'),_0x3ae1ae);}}else{_0x3ae1ae={'UserId':Number(_0x3aca76['params']['id'])};_0x3ae1ae[_[_0x003f('0xa6')](_0x3aca76[_0x003f('0x47')][_0x003f('0xaa')][_0x003f('0xa4')]())+_0x003f('0xa5')]=Number(_0x3aca76[_0x003f('0x47')][_0x003f('0x63')]);socket[_0x003f('0x2d')](_0x003f('0x80')+_[_0x003f('0xa6')](_0x3aca76['query'][_0x003f('0xaa')][_0x003f('0xa4')]())+_0x003f('0xac'),_0x3ae1ae);}return _0x7c8c4;})[_0x003f('0x20')](function(){if(_0x3aca76[_0x003f('0x47')][_0x003f('0xaa')]===_0x003f('0xad')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x3aca76[_0x003f('0x59')]['id'],'VoiceQueueId':_0x3aca76[_0x003f('0x47')][_0x003f('0x63')]},'individualHooks':!![]})[_0x003f('0x20')](function(){return _0x125fc;});}return _0x125fc;})[_0x003f('0x20')](respondWithStatusCode(_0x520db5,null))['catch'](handleError(_0x520db5,null));};exports[_0x003f('0xae')]=function(_0x22b58d,_0x551873){_0x22b58d[_0x003f('0x60')][_0x003f('0xaf')]=_0x22b58d[_0x003f('0xb0')][_0x003f('0xb1')];return db[_0x003f('0x3e')][_0x003f('0x3a')]({'where':{'id':_0x22b58d[_0x003f('0x59')]['id']}})[_0x003f('0x20')](handleEntityNotFound(_0x551873,null))[_0x003f('0x20')](saveUpdates(_0x22b58d[_0x003f('0x60')],null))[_0x003f('0x20')](respondWithResult(_0x551873,null))['catch'](handleError(_0x551873,null));};exports['getAvatar']=function(_0x55a312,_0x333b21){var _0x41e876=path[_0x003f('0xb2')](config[_0x003f('0xb3')],_0x003f('0xb4'));return db['User']['find']({'where':{'id':_0x55a312[_0x003f('0x59')]['id']},'attributes':['id',_0x003f('0xaf')],'raw':!![]})[_0x003f('0x20')](handleEntityNotFound(_0x333b21,null))[_0x003f('0x20')](function(_0x2514dc){if(_0x2514dc){if(_[_0x003f('0x6b')](_0x2514dc[_0x003f('0xaf')])){return _0x333b21['download'](_0x41e876);}else{if(!fs['existsSync'](path[_0x003f('0xb2')](config[_0x003f('0xb3')],_0x003f('0xb5'),_0x2514dc[_0x003f('0xaf')]))){return _0x333b21[_0x003f('0xb6')](_0x41e876);}return _0x333b21[_0x003f('0xb6')](path['join'](config[_0x003f('0xb3')],_0x003f('0xb5'),_0x2514dc[_0x003f('0xaf')]));}}})[_0x003f('0x2b')](handleError(_0x333b21,null));};exports[_0x003f('0xb7')]=function(_0x129fd3,_0x389ad4){return db['User'][_0x003f('0x3a')]({'where':{'id':_0x129fd3['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x389ad4,null))[_0x003f('0x20')](function(_0x3735f1){var _0x2503a7=[];values=_0x3735f1[_0x003f('0x52')];_0x2503a7[_0x003f('0x4d')](get_open_tabs(_0x003f('0x5e'),_0x3735f1[_0x003f('0x52')]));_0x2503a7['push'](get_open_tabs(_0x003f('0x53'),_0x3735f1[_0x003f('0x52')]));_0x2503a7['push'](get_open_tabs('openchannel',_0x3735f1[_0x003f('0x52')]));_0x2503a7[_0x003f('0x4d')](get_open_tabs(_0x003f('0x57'),_0x3735f1['dataValues']));_0x2503a7['push'](get_open_tabs(_0x003f('0x54'),_0x3735f1[_0x003f('0x52')]));_0x2503a7[_0x003f('0x4d')](get_open_tabs(_0x003f('0x55'),_0x3735f1['dataValues']));return Promise[_0x003f('0x58')](_0x2503a7);})[_0x003f('0x20')](function(_0x387131){if(_0x387131){var _0x190aee=_[_0x003f('0x37')](values[_0x003f('0xb8')],function(_0x5dd8f9){return{'channel':_0x003f('0xb9'),'id':_0x5dd8f9['id'],'createdAt':_0x5dd8f9[_0x003f('0xba')]};});var _0x4c4113=_[_0x003f('0x37')](values['FaxOpenTabs'],function(_0x31cea1){return{'channel':_0x003f('0xbb'),'id':_0x31cea1['id'],'createdAt':_0x31cea1['createdAt']};});var _0x10b1ad=_[_0x003f('0x37')](values['OpenchannelOpenTabs'],function(_0xd7fce){return{'channel':_0x003f('0xbc'),'id':_0xd7fce['id'],'createdAt':_0xd7fce[_0x003f('0xba')]};});var _0x51e6ec=_[_0x003f('0x37')](values[_0x003f('0xbd')],function(_0xf40da7){return{'channel':'MAIL','id':_0xf40da7['id'],'createdAt':_0xf40da7[_0x003f('0xba')]};});var _0x3f9943=_[_0x003f('0x37')](values[_0x003f('0xbe')],function(_0x1eb8c1){return{'channel':_0x003f('0xbf'),'id':_0x1eb8c1['id'],'createdAt':_0x1eb8c1[_0x003f('0xba')]};});var _0x1a16d2=_['map'](values[_0x003f('0xc0')],function(_0x449eff){return{'channel':_0x003f('0xc1'),'id':_0x449eff['id'],'createdAt':_0x449eff[_0x003f('0xba')]};});var _0x4fdea3=_[_0x003f('0xc2')](_0x190aee,_0x4c4113,_0x10b1ad,_0x51e6ec,_0x3f9943,_0x1a16d2);var _0x160b03={'count':_0x4fdea3[_0x003f('0x50')],'rows':_0x4fdea3};return _0x160b03;}else return null;})[_0x003f('0x20')](respondWithResult(_0x389ad4,null))['catch'](handleError(_0x389ad4,null));};exports[_0x003f('0xc3')]=function(_0x51812c,_0x13a613){var _0x5ec94f={};return db['User'][_0x003f('0x98')]({'where':{'id':_0x51812c[_0x003f('0x59')]['id']}})[_0x003f('0x20')](function(_0x2ca27){if(!_0x2ca27){throw new APINotFoundError(util[_0x003f('0xc4')](_0x003f('0xc5'),_0x51812c[_0x003f('0x59')]['id']));}return contacts[_0x003f('0x61')]();})[_0x003f('0x20')](function(_0x2d9965){_0x51812c[_0x003f('0x47')][_0x003f('0x3e')]=_0x51812c[_0x003f('0x59')]['id'];_0x5ec94f=qs[_0x003f('0x5a')](_0x2d9965,_0x51812c);if(_0x51812c[_0x003f('0x47')][_0x003f('0xc6')](_0x003f('0x48'))){_0x5ec94f[_0x003f('0x49')]=[{'model':db[_0x003f('0xc7')],'as':_0x003f('0xc8'),'required':![]},{'model':db[_0x003f('0xc9')],'as':_0x003f('0xca'),'attributes':['id',_0x003f('0x3c'),'color'],'where':_0x51812c['query']['tag']?{'id':_0x51812c[_0x003f('0x47')][_0x003f('0xcb')]}:undefined,'required':_0x51812c['query']['tag']?!![]:![]}];}return contacts[_0x003f('0x4e')](_0x51812c['query'],_0x51812c['user'],_0x5ec94f,_0x2d9965);})['then'](respondWithFilteredResult(_0x13a613,_0x5ec94f))[_0x003f('0x2b')](APIHandleError(_0x13a613));};exports['getQueues']=function(_0x43f5c4,_0x2ae7b0){var _0x1176af;var _0x3127ea={};var _0x7a353;return db[_0x003f('0x3e')][_0x003f('0x98')]({'where':{'id':_0x43f5c4['params']['id']},'attributes':['id',_0x003f('0x3c'),_0x003f('0x2c')]})[_0x003f('0x20')](handleEntityNotFound(_0x2ae7b0,null))[_0x003f('0x20')](function(_0x212b5d){if(!utils[_0x003f('0x9f')](_0x43f5c4[_0x003f('0x47')]['channel'])){throw new db[(_0x003f('0x94'))]['ValidationError'](_0x003f('0xa0'));}_0x1176af=_0x212b5d;var _0x5a67c1={};_0x5a67c1[_0x003f('0xcc')]=_[_0x003f('0xcd')](db[_[_0x003f('0xa6')](_0x43f5c4[_0x003f('0x47')][_0x003f('0xaa')])+_0x003f('0xce')][_0x003f('0x3f')]);_0x5a67c1['query']=_[_0x003f('0xcd')](_0x43f5c4[_0x003f('0x47')]);_0x5a67c1[_0x003f('0xcf')]=_[_0x003f('0xd0')](_0x5a67c1[_0x003f('0xcc')],_0x5a67c1[_0x003f('0x47')]);_0x3127ea[_0x003f('0x4c')]=_[_0x003f('0xd0')](_0x5a67c1[_0x003f('0xcc')],qs['fields'](_0x43f5c4[_0x003f('0x47')][_0x003f('0xd1')]));_0x3127ea[_0x003f('0x4c')]=_0x3127ea[_0x003f('0x4c')]['length']?_0x3127ea['attributes']:_0x5a67c1[_0x003f('0xcc')];_0x3127ea[_0x003f('0xd2')]=qs[_0x003f('0xd3')](_0x43f5c4[_0x003f('0x47')][_0x003f('0xd3')]);_0x3127ea['where']=qs[_0x003f('0xcf')](_[_0x003f('0xd4')](_0x43f5c4[_0x003f('0x47')],_0x5a67c1[_0x003f('0xcf')]));if(_0x43f5c4['query'][_0x003f('0x35')]){_0x3127ea[_0x003f('0x46')]=_['merge'](_0x3127ea[_0x003f('0x46')],{'$or':_[_0x003f('0x37')](_0x3127ea['attributes'],function(_0x7861c){var _0x50a3a6={};_0x50a3a6[_0x7861c]={'$like':'%'+_0x43f5c4[_0x003f('0x47')][_0x003f('0x35')]+'%'};return _0x50a3a6;})});}_0x3127ea=_[_0x003f('0x5c')]({},_0x3127ea,_0x43f5c4[_0x003f('0x5d')]);switch(_0x1176af[_0x003f('0x2c')]){case _0x003f('0x30'):return db[_[_0x003f('0xa6')](_0x43f5c4[_0x003f('0x47')][_0x003f('0xaa')])+'Queue'][_0x003f('0x4e')](_0x3127ea);case _0x003f('0x80'):case'agent':return _0x1176af[_0x003f('0x2f')+_[_0x003f('0xa6')](_0x43f5c4['query']['channel'])+_0x003f('0xa1')](_0x3127ea);default:throw new db['Sequelize'][(_0x003f('0x93'))](_0x003f('0xd5'));}})[_0x003f('0x20')](function(_0x566cc7){_0x7a353=_0x566cc7[_0x003f('0x50')];if(!_0x43f5c4['query'][_0x003f('0xc6')](_0x003f('0xd6'))){_0x3127ea[_0x003f('0x1d')]=qs[_0x003f('0x1d')](_0x43f5c4[_0x003f('0x47')][_0x003f('0x1d')]);_0x3127ea[_0x003f('0x1c')]=qs[_0x003f('0x1c')](_0x43f5c4[_0x003f('0x47')][_0x003f('0x1c')]);}switch(_0x1176af[_0x003f('0x2c')]){case'admin':return db[_[_0x003f('0xa6')](_0x43f5c4['query']['channel'])+_0x003f('0xce')][_0x003f('0x4e')](_0x3127ea);case _0x003f('0x80'):case'agent':return _0x1176af['get'+_['capitalize'](_0x43f5c4['query'][_0x003f('0xaa')])+'Queues'](_0x3127ea);}})['then'](function(_0x4567c5){return{'count':_0x7a353,'rows':_0x4567c5};})[_0x003f('0x20')](respondWithResult(_0x2ae7b0,null))['catch'](handleError(_0x2ae7b0,null));};exports['getVoiceQueuesRt']=function(_0x3398b5,_0x1b1c9f){var _0x27c7a5={};var _0x37232c={};var _0x19e7d4;var _0x194992;return db[_0x003f('0x3e')][_0x003f('0x98')]({'where':{'id':_0x3398b5[_0x003f('0x59')]['id']}})['then'](handleEntityNotFound(_0x1b1c9f,null))[_0x003f('0x20')](function(_0x21c93c){if(_0x21c93c){_0x19e7d4=_0x21c93c;_0x37232c['model']=_['keys'](db['UserVoiceQueueRt']['rawAttributes']);_0x37232c[_0x003f('0x47')]=_[_0x003f('0xcd')](_0x3398b5['query']);_0x37232c[_0x003f('0xcf')]=_[_0x003f('0xd0')](_0x37232c[_0x003f('0xcc')],_0x37232c[_0x003f('0x47')]);_0x27c7a5[_0x003f('0x4c')]=_[_0x003f('0xd0')](_0x37232c[_0x003f('0xcc')],qs[_0x003f('0xd1')](_0x3398b5['query']['fields']));_0x27c7a5[_0x003f('0x4c')]=_0x27c7a5['attributes'][_0x003f('0x50')]?_0x27c7a5[_0x003f('0x4c')]:_0x37232c['model'];_0x27c7a5[_0x003f('0xd2')]=qs[_0x003f('0xd3')](_0x3398b5[_0x003f('0x47')][_0x003f('0xd3')]);_0x27c7a5[_0x003f('0x46')]=qs[_0x003f('0xcf')](_[_0x003f('0xd4')](_0x3398b5[_0x003f('0x47')],_0x37232c[_0x003f('0xcf')]));if(_0x3398b5[_0x003f('0x47')][_0x003f('0x35')]){_0x27c7a5[_0x003f('0x46')]=_[_0x003f('0x5c')](_0x27c7a5[_0x003f('0x46')],{'$or':_[_0x003f('0x37')](_0x27c7a5[_0x003f('0x4c')],function(_0x168aa9){var _0x2b51a7={};_0x2b51a7[_0x168aa9]={'$like':'%'+_0x3398b5[_0x003f('0x47')]['filter']+'%'};return _0x2b51a7;})});}_0x27c7a5=_[_0x003f('0x5c')]({},_0x27c7a5,_0x3398b5[_0x003f('0x5d')]);return _0x19e7d4[_0x003f('0xd7')](_0x27c7a5);}})[_0x003f('0x20')](function(_0x41cbbd){if(_0x41cbbd){_0x194992=_0x41cbbd[_0x003f('0x50')];if(!_0x3398b5[_0x003f('0x47')]['hasOwnProperty'](_0x003f('0xd6'))){_0x27c7a5[_0x003f('0x1d')]=qs[_0x003f('0x1d')](_0x3398b5[_0x003f('0x47')][_0x003f('0x1d')]);_0x27c7a5[_0x003f('0x1c')]=qs[_0x003f('0x1c')](_0x3398b5[_0x003f('0x47')][_0x003f('0x1c')]);}return _0x19e7d4[_0x003f('0xd7')](_0x27c7a5);}})[_0x003f('0x20')](function(_0x395cbb){if(_0x395cbb){return _0x395cbb?{'count':_0x194992,'rows':_0x395cbb}:null;}})[_0x003f('0x20')](respondWithResult(_0x1b1c9f,null))[_0x003f('0x2b')](handleError(_0x1b1c9f,null));};exports[_0x003f('0xd8')]=function(_0x35e773,_0x3d338f){var _0x3c298b={};var _0x1e72b9={};var _0x3fdc37;var _0x4b0663;return db[_0x003f('0x3e')][_0x003f('0x98')]({'where':{'id':_0x35e773[_0x003f('0x59')]['id']}})['then'](handleEntityNotFound(_0x3d338f,null))[_0x003f('0x20')](function(_0x1b6929){if(_0x1b6929){_0x3fdc37=_0x1b6929;_0x1e72b9[_0x003f('0xcc')]=_[_0x003f('0xcd')](db[_0x003f('0xd9')][_0x003f('0x3f')]);_0x1e72b9['query']=_[_0x003f('0xcd')](_0x35e773[_0x003f('0x47')]);_0x1e72b9[_0x003f('0xcf')]=_[_0x003f('0xd0')](_0x1e72b9['model'],_0x1e72b9[_0x003f('0x47')]);_0x3c298b[_0x003f('0x4c')]=_[_0x003f('0xd0')](_0x1e72b9['model'],qs[_0x003f('0xd1')](_0x35e773['query']['fields']));_0x3c298b[_0x003f('0x4c')]=_0x3c298b[_0x003f('0x4c')][_0x003f('0x50')]?_0x3c298b[_0x003f('0x4c')]:_0x1e72b9[_0x003f('0xcc')];_0x3c298b[_0x003f('0xd2')]=qs[_0x003f('0xd3')](_0x35e773[_0x003f('0x47')][_0x003f('0xd3')]);_0x3c298b[_0x003f('0x46')]=qs[_0x003f('0xcf')](_[_0x003f('0xd4')](_0x35e773[_0x003f('0x47')],_0x1e72b9['filters']));if(_0x35e773[_0x003f('0x47')][_0x003f('0x35')]){_0x3c298b[_0x003f('0x46')]=_[_0x003f('0x5c')](_0x3c298b[_0x003f('0x46')],{'$or':_[_0x003f('0x37')](_0x3c298b[_0x003f('0x4c')],function(_0x2b8c3b){var _0x1bd115={};_0x1bd115[_0x2b8c3b]={'$like':'%'+_0x35e773[_0x003f('0x47')]['filter']+'%'};return _0x1bd115;})});}_0x3c298b=_['merge']({},_0x3c298b,_0x35e773[_0x003f('0x5d')]);return _0x3fdc37[_0x003f('0xd8')](_0x3c298b);}})[_0x003f('0x20')](function(_0x40c368){if(_0x40c368){_0x4b0663=_0x40c368[_0x003f('0x50')];if(!_0x35e773[_0x003f('0x47')]['hasOwnProperty'](_0x003f('0xd6'))){_0x3c298b[_0x003f('0x1d')]=qs['limit'](_0x35e773[_0x003f('0x47')][_0x003f('0x1d')]);_0x3c298b[_0x003f('0x1c')]=qs[_0x003f('0x1c')](_0x35e773[_0x003f('0x47')]['offset']);}return _0x3fdc37['getGroups'](_0x3c298b);}})['then'](function(_0x5ecd57){if(_0x5ecd57){return _0x5ecd57?{'count':_0x4b0663,'rows':_0x5ecd57}:null;}})[_0x003f('0x20')](respondWithResult(_0x3d338f,null))[_0x003f('0x2b')](handleError(_0x3d338f,null));};exports[_0x003f('0xda')]=function(_0x24a4db,_0x22ec7a){var _0x2bd0da={'raw':!![],'where':{}};var _0x4a86d7={};var _0x583689={'count':0x0,'rows':[]};return db[_0x003f('0x3e')][_0x003f('0x98')]({'where':{'id':_0x24a4db[_0x003f('0x59')]['id']}})[_0x003f('0x20')](handleEntityNotFound(_0x22ec7a,null))[_0x003f('0x20')](function(_0x383cbf){if(_0x383cbf){_0x4a86d7[_0x003f('0xcc')]=_['keys'](db[_0x003f('0xdb')][_0x003f('0x3f')]);_0x4a86d7['query']=_[_0x003f('0xcd')](_0x24a4db[_0x003f('0x47')]);_0x4a86d7[_0x003f('0xcf')]=_['intersection'](_0x4a86d7[_0x003f('0xcc')],_0x4a86d7[_0x003f('0x47')]);_0x2bd0da[_0x003f('0x4c')]=_[_0x003f('0xd0')](_0x4a86d7['model'],qs[_0x003f('0xd1')](_0x24a4db[_0x003f('0x47')][_0x003f('0xd1')]));_0x2bd0da['attributes']=_0x2bd0da[_0x003f('0x4c')][_0x003f('0x50')]?_0x2bd0da['attributes']:_0x4a86d7[_0x003f('0xcc')];if(!_0x24a4db[_0x003f('0x47')][_0x003f('0xc6')]('nolimit')){_0x2bd0da[_0x003f('0x1d')]=qs[_0x003f('0x1d')](_0x24a4db[_0x003f('0x47')][_0x003f('0x1d')]);_0x2bd0da[_0x003f('0x1c')]=qs[_0x003f('0x1c')](_0x24a4db['query'][_0x003f('0x1c')]);}_0x2bd0da[_0x003f('0xd2')]=qs[_0x003f('0xd3')](_0x24a4db['query']['sort']);_0x2bd0da[_0x003f('0x46')]=qs['filters'](_['pick'](_0x24a4db['query'],_0x4a86d7[_0x003f('0xcf')]));_0x2bd0da[_0x003f('0x46')][_0x003f('0xdc')]=_0x383cbf['id'];if(_0x24a4db[_0x003f('0x47')][_0x003f('0x35')]){_0x2bd0da[_0x003f('0x46')]=_[_0x003f('0x5c')](_0x2bd0da['where'],{'$or':_[_0x003f('0x37')](_0x2bd0da[_0x003f('0x4c')],function(_0x33c439){var _0x33c0f2={};_0x33c0f2[_0x33c439]={'$like':'%'+_0x24a4db[_0x003f('0x47')][_0x003f('0x35')]+'%'};return _0x33c0f2;})});}_0x2bd0da=_[_0x003f('0x5c')]({},_0x2bd0da,_0x24a4db['options']);return db[_0x003f('0xdb')]['count']({'where':_0x2bd0da[_0x003f('0x46')]})[_0x003f('0x20')](function(_0x4923d0){_0x583689['count']=_0x4923d0;if(_0x24a4db[_0x003f('0x47')][_0x003f('0x48')]){_0x2bd0da['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x003f('0x4e')](_0x2bd0da);})['then'](function(_0x5bc71c){_0x583689[_0x003f('0x51')]=_0x5bc71c;return _0x583689;});}})[_0x003f('0x20')](respondWithFilteredResult(_0x22ec7a,_0x2bd0da))[_0x003f('0x2b')](handleError(_0x22ec7a,null));};exports[_0x003f('0xdd')]=function(_0x5cc0c4,_0x24e61c){var _0x3c3645={'raw':!![],'where':{}};var _0x9f306c={};var _0x37fb9e={'count':0x0,'rows':[]};return db[_0x003f('0x3e')][_0x003f('0x98')]({'where':{'id':_0x5cc0c4[_0x003f('0x59')]['id']}})[_0x003f('0x20')](handleEntityNotFound(_0x24e61c,null))[_0x003f('0x20')](function(_0x47d4d0){if(_0x47d4d0){_0x9f306c[_0x003f('0xcc')]=_[_0x003f('0xcd')](db['ScreenRecording'][_0x003f('0x3f')]);_0x9f306c[_0x003f('0x47')]=_['keys'](_0x5cc0c4[_0x003f('0x47')]);_0x9f306c[_0x003f('0xcf')]=_[_0x003f('0xd0')](_0x9f306c['model'],_0x9f306c[_0x003f('0x47')]);_0x3c3645['attributes']=_[_0x003f('0xd0')](_0x9f306c[_0x003f('0xcc')],qs[_0x003f('0xd1')](_0x5cc0c4[_0x003f('0x47')][_0x003f('0xd1')]));_0x3c3645[_0x003f('0x4c')]=_0x3c3645['attributes'][_0x003f('0x50')]?_0x3c3645[_0x003f('0x4c')]:_0x9f306c[_0x003f('0xcc')];if(!_0x5cc0c4[_0x003f('0x47')][_0x003f('0xc6')](_0x003f('0xd6'))){_0x3c3645[_0x003f('0x1d')]=qs[_0x003f('0x1d')](_0x5cc0c4[_0x003f('0x47')][_0x003f('0x1d')]);_0x3c3645[_0x003f('0x1c')]=qs[_0x003f('0x1c')](_0x5cc0c4['query'][_0x003f('0x1c')]);}_0x3c3645['order']=qs[_0x003f('0xd3')](_0x5cc0c4['query'][_0x003f('0xd3')]);_0x3c3645[_0x003f('0x46')]=qs[_0x003f('0xcf')](_['pick'](_0x5cc0c4[_0x003f('0x47')],_0x9f306c[_0x003f('0xcf')]));_0x3c3645['where'][_0x003f('0xdc')]=_0x47d4d0['id'];if(_0x5cc0c4[_0x003f('0x47')]['filter']){_0x3c3645[_0x003f('0x46')]=_[_0x003f('0x5c')](_0x3c3645[_0x003f('0x46')],{'$or':_[_0x003f('0x37')](_0x3c3645[_0x003f('0x4c')],function(_0xc3bab4){var _0x47d336={};_0x47d336[_0xc3bab4]={'$like':'%'+_0x5cc0c4[_0x003f('0x47')]['filter']+'%'};return _0x47d336;})});}_0x3c3645=_[_0x003f('0x5c')]({},_0x3c3645,_0x5cc0c4[_0x003f('0x5d')]);return db[_0x003f('0xde')][_0x003f('0x1b')]({'where':_0x3c3645[_0x003f('0x46')]})[_0x003f('0x20')](function(_0x303dfd){_0x37fb9e[_0x003f('0x1b')]=_0x303dfd;if(_0x5cc0c4[_0x003f('0x47')][_0x003f('0x48')]){_0x3c3645[_0x003f('0x49')]=[{'all':!![]}];}return db[_0x003f('0xde')][_0x003f('0x4e')](_0x3c3645);})[_0x003f('0x20')](function(_0xa63f80){_0x37fb9e[_0x003f('0x51')]=_0xa63f80;return _0x37fb9e;});}})['then'](respondWithFilteredResult(_0x24e61c,_0x3c3645))[_0x003f('0x2b')](handleError(_0x24e61c,null));};exports[_0x003f('0xdf')]=function(_0x131559,_0x2ef2ef){var _0x14e2d2={};var _0x20fa9a={};var _0x3e2ebe;var _0x29c301;return db[_0x003f('0x3e')]['findOne']({'where':{'id':_0x131559[_0x003f('0x59')]['id']}})[_0x003f('0x20')](handleEntityNotFound(_0x2ef2ef,null))[_0x003f('0x20')](function(_0x3a7475){if(_0x3a7475){_0x3e2ebe=_0x3a7475;_0x20fa9a[_0x003f('0xcc')]=_['keys'](db['ChatInteraction'][_0x003f('0x3f')]);_0x20fa9a['query']=_[_0x003f('0xcd')](_0x131559['query']);_0x20fa9a[_0x003f('0xcf')]=_[_0x003f('0xd0')](_0x20fa9a[_0x003f('0xcc')],_0x20fa9a[_0x003f('0x47')]);_0x14e2d2[_0x003f('0x4c')]=_[_0x003f('0xd0')](_0x20fa9a['model'],qs[_0x003f('0xd1')](_0x131559[_0x003f('0x47')][_0x003f('0xd1')]));_0x14e2d2[_0x003f('0x4c')]=_0x14e2d2[_0x003f('0x4c')][_0x003f('0x50')]?_0x14e2d2[_0x003f('0x4c')]:_0x20fa9a[_0x003f('0xcc')];_0x14e2d2['order']=qs[_0x003f('0xd3')](_0x131559['query'][_0x003f('0xd3')]);_0x14e2d2['where']=qs[_0x003f('0xcf')](_[_0x003f('0xd4')](_0x131559[_0x003f('0x47')],_0x20fa9a['filters']));if(_0x131559[_0x003f('0x47')][_0x003f('0x35')]){_0x14e2d2[_0x003f('0x46')]=_[_0x003f('0x5c')](_0x14e2d2[_0x003f('0x46')],{'$or':_[_0x003f('0x37')](_0x14e2d2['attributes'],function(_0x416800){var _0x58b9d7={};_0x58b9d7[_0x416800]={'$like':'%'+_0x131559[_0x003f('0x47')][_0x003f('0x35')]+'%'};return _0x58b9d7;})});}_0x14e2d2=_[_0x003f('0x5c')]({},_0x14e2d2,_0x131559[_0x003f('0x5d')]);return _0x3e2ebe[_0x003f('0xdf')](_0x14e2d2);}})[_0x003f('0x20')](function(_0x4de995){if(_0x4de995){_0x29c301=_0x4de995[_0x003f('0x50')];if(!_0x131559['query']['hasOwnProperty']('nolimit')){_0x14e2d2['limit']=qs[_0x003f('0x1d')](_0x131559[_0x003f('0x47')][_0x003f('0x1d')]);_0x14e2d2[_0x003f('0x1c')]=qs[_0x003f('0x1c')](_0x131559['query'][_0x003f('0x1c')]);}return _0x3e2ebe[_0x003f('0xdf')](_0x14e2d2);}})[_0x003f('0x20')](function(_0x402844){if(_0x402844){return _0x402844?{'count':_0x29c301,'rows':_0x402844}:null;}})[_0x003f('0x20')](respondWithResult(_0x2ef2ef,null))[_0x003f('0x2b')](handleError(_0x2ef2ef,null));};exports['getOpenchannelInteractions']=function(_0x120399,_0x2f578c){var _0x326652={};var _0x490978={};var _0x21955d;var _0x427df7;return db[_0x003f('0x3e')][_0x003f('0x98')]({'where':{'id':_0x120399[_0x003f('0x59')]['id']}})[_0x003f('0x20')](handleEntityNotFound(_0x2f578c,null))[_0x003f('0x20')](function(_0x3593aa){if(_0x3593aa){_0x21955d=_0x3593aa;_0x490978[_0x003f('0xcc')]=_['keys'](db[_0x003f('0xe0')][_0x003f('0x3f')]);_0x490978[_0x003f('0x47')]=_[_0x003f('0xcd')](_0x120399[_0x003f('0x47')]);_0x490978[_0x003f('0xcf')]=_[_0x003f('0xd0')](_0x490978[_0x003f('0xcc')],_0x490978[_0x003f('0x47')]);_0x326652['attributes']=_[_0x003f('0xd0')](_0x490978[_0x003f('0xcc')],qs['fields'](_0x120399[_0x003f('0x47')]['fields']));_0x326652[_0x003f('0x4c')]=_0x326652[_0x003f('0x4c')][_0x003f('0x50')]?_0x326652['attributes']:_0x490978[_0x003f('0xcc')];_0x326652[_0x003f('0xd2')]=qs['sort'](_0x120399['query'][_0x003f('0xd3')]);_0x326652[_0x003f('0x46')]=qs[_0x003f('0xcf')](_[_0x003f('0xd4')](_0x120399['query'],_0x490978[_0x003f('0xcf')]));if(_0x120399[_0x003f('0x47')][_0x003f('0x35')]){_0x326652[_0x003f('0x46')]=_['merge'](_0x326652[_0x003f('0x46')],{'$or':_[_0x003f('0x37')](_0x326652[_0x003f('0x4c')],function(_0x599944){var _0x362514={};_0x362514[_0x599944]={'$like':'%'+_0x120399[_0x003f('0x47')][_0x003f('0x35')]+'%'};return _0x362514;})});}_0x326652=_[_0x003f('0x5c')]({},_0x326652,_0x120399[_0x003f('0x5d')]);return _0x21955d['getOpenchannelInteractions'](_0x326652);}})[_0x003f('0x20')](function(_0x403089){if(_0x403089){_0x427df7=_0x403089['length'];if(!_0x120399['query'][_0x003f('0xc6')](_0x003f('0xd6'))){_0x326652[_0x003f('0x1d')]=qs['limit'](_0x120399[_0x003f('0x47')][_0x003f('0x1d')]);_0x326652[_0x003f('0x1c')]=qs[_0x003f('0x1c')](_0x120399[_0x003f('0x47')][_0x003f('0x1c')]);}return _0x21955d[_0x003f('0xe1')](_0x326652);}})[_0x003f('0x20')](function(_0x4f0da4){if(_0x4f0da4){return _0x4f0da4?{'count':_0x427df7,'rows':_0x4f0da4}:null;}})[_0x003f('0x20')](respondWithResult(_0x2f578c,null))[_0x003f('0x2b')](handleError(_0x2f578c,null));};exports[_0x003f('0xe2')]=function(_0x507583,_0x4ebfff){var _0x139e36={'raw':!![],'where':{}};var _0x592d70={};var _0x59e444={'count':0x0,'rows':[]};return db['User'][_0x003f('0x98')]({'where':{'id':_0x507583[_0x003f('0x59')]['id']}})[_0x003f('0x20')](handleEntityNotFound(_0x4ebfff,null))[_0x003f('0x20')](function(_0x3d59a6){if(_0x3d59a6){_0x592d70['model']=_['keys'](db['MailInteraction'][_0x003f('0x3f')]);_0x592d70[_0x003f('0x47')]=_[_0x003f('0xcd')](_0x507583['query']);_0x592d70[_0x003f('0xcf')]=_[_0x003f('0xd0')](_0x592d70[_0x003f('0xcc')],_0x592d70['query']);_0x139e36['attributes']=_[_0x003f('0xd0')](_0x592d70[_0x003f('0xcc')],qs[_0x003f('0xd1')](_0x507583[_0x003f('0x47')][_0x003f('0xd1')]));_0x139e36[_0x003f('0x4c')]=_0x139e36['attributes'][_0x003f('0x50')]?_0x139e36[_0x003f('0x4c')]:_0x592d70[_0x003f('0xcc')];if(!_0x507583[_0x003f('0x47')][_0x003f('0xc6')](_0x003f('0xd6'))){_0x139e36[_0x003f('0x1d')]=qs[_0x003f('0x1d')](_0x507583[_0x003f('0x47')]['limit']);_0x139e36[_0x003f('0x1c')]=qs['offset'](_0x507583[_0x003f('0x47')][_0x003f('0x1c')]);}_0x139e36[_0x003f('0xd2')]=qs[_0x003f('0xd3')](_0x507583[_0x003f('0x47')][_0x003f('0xd3')]);_0x139e36[_0x003f('0x46')]=qs[_0x003f('0xcf')](_[_0x003f('0xd4')](_0x507583['query'],_0x592d70['filters']));_0x139e36[_0x003f('0x46')][_0x003f('0xdc')]=_0x3d59a6['id'];if(_0x507583[_0x003f('0x47')][_0x003f('0x35')]){_0x139e36[_0x003f('0x46')]=_[_0x003f('0x5c')](_0x139e36[_0x003f('0x46')],{'$or':_[_0x003f('0x37')](_0x139e36['attributes'],function(_0x333204){var _0x3c7d59={};_0x3c7d59[_0x333204]={'$like':'%'+_0x507583[_0x003f('0x47')][_0x003f('0x35')]+'%'};return _0x3c7d59;})});}_0x139e36=_[_0x003f('0x5c')]({},_0x139e36,_0x507583[_0x003f('0x5d')]);return db['MailInteraction']['count']({'where':_0x139e36[_0x003f('0x46')]})[_0x003f('0x20')](function(_0x2fb3eb){_0x59e444[_0x003f('0x1b')]=_0x2fb3eb;if(_0x507583[_0x003f('0x47')][_0x003f('0x48')]){_0x139e36['include']=[{'all':!![]}];}return db[_0x003f('0xe3')][_0x003f('0x4e')](_0x139e36);})[_0x003f('0x20')](function(_0x1b8c26){_0x59e444['rows']=_0x1b8c26;return _0x59e444;});}})[_0x003f('0x20')](respondWithFilteredResult(_0x4ebfff,_0x139e36))[_0x003f('0x2b')](handleError(_0x4ebfff,null));};exports[_0x003f('0xe4')]=function(_0x23e996,_0xaf4107){var _0x18d03c={};var _0x361cc0={};var _0x54483e;var _0x494ec8;return db[_0x003f('0x3e')][_0x003f('0x98')]({'where':{'id':_0x23e996[_0x003f('0x59')]['id']}})[_0x003f('0x20')](handleEntityNotFound(_0xaf4107,null))[_0x003f('0x20')](function(_0x48bc01){if(_0x48bc01){_0x54483e=_0x48bc01;_0x361cc0[_0x003f('0xcc')]=_[_0x003f('0xcd')](db['SmsInteraction']['rawAttributes']);_0x361cc0['query']=_[_0x003f('0xcd')](_0x23e996[_0x003f('0x47')]);_0x361cc0['filters']=_[_0x003f('0xd0')](_0x361cc0[_0x003f('0xcc')],_0x361cc0['query']);_0x18d03c[_0x003f('0x4c')]=_[_0x003f('0xd0')](_0x361cc0[_0x003f('0xcc')],qs['fields'](_0x23e996[_0x003f('0x47')]['fields']));_0x18d03c[_0x003f('0x4c')]=_0x18d03c[_0x003f('0x4c')][_0x003f('0x50')]?_0x18d03c[_0x003f('0x4c')]:_0x361cc0[_0x003f('0xcc')];_0x18d03c[_0x003f('0xd2')]=qs[_0x003f('0xd3')](_0x23e996[_0x003f('0x47')][_0x003f('0xd3')]);_0x18d03c[_0x003f('0x46')]=qs['filters'](_[_0x003f('0xd4')](_0x23e996[_0x003f('0x47')],_0x361cc0[_0x003f('0xcf')]));if(_0x23e996[_0x003f('0x47')][_0x003f('0x35')]){_0x18d03c[_0x003f('0x46')]=_['merge'](_0x18d03c[_0x003f('0x46')],{'$or':_[_0x003f('0x37')](_0x18d03c['attributes'],function(_0x4ebb51){var _0x9366ef={};_0x9366ef[_0x4ebb51]={'$like':'%'+_0x23e996[_0x003f('0x47')][_0x003f('0x35')]+'%'};return _0x9366ef;})});}_0x18d03c=_[_0x003f('0x5c')]({},_0x18d03c,_0x23e996['options']);return _0x54483e[_0x003f('0xe4')](_0x18d03c);}})[_0x003f('0x20')](function(_0x20d4d5){if(_0x20d4d5){_0x494ec8=_0x20d4d5['length'];if(!_0x23e996[_0x003f('0x47')][_0x003f('0xc6')](_0x003f('0xd6'))){_0x18d03c['limit']=qs['limit'](_0x23e996['query'][_0x003f('0x1d')]);_0x18d03c[_0x003f('0x1c')]=qs[_0x003f('0x1c')](_0x23e996[_0x003f('0x47')][_0x003f('0x1c')]);}return _0x54483e[_0x003f('0xe4')](_0x18d03c);}})[_0x003f('0x20')](function(_0x23b970){if(_0x23b970){return _0x23b970?{'count':_0x494ec8,'rows':_0x23b970}:null;}})[_0x003f('0x20')](respondWithResult(_0xaf4107,null))[_0x003f('0x2b')](handleError(_0xaf4107,null));};exports[_0x003f('0xe5')]=function(_0x103d27,_0x5160b7){var _0x324d75={};var _0x5e3028={};var _0xcaba39;var _0x43763c;return db['User'][_0x003f('0x98')]({'where':{'id':_0x103d27[_0x003f('0x59')]['id']}})['then'](handleEntityNotFound(_0x5160b7,null))[_0x003f('0x20')](function(_0x3b617a){if(_0x3b617a){_0xcaba39=_0x3b617a;_0x5e3028['model']=_[_0x003f('0xcd')](db['FaxInteraction'][_0x003f('0x3f')]);_0x5e3028[_0x003f('0x47')]=_['keys'](_0x103d27[_0x003f('0x47')]);_0x5e3028[_0x003f('0xcf')]=_[_0x003f('0xd0')](_0x5e3028[_0x003f('0xcc')],_0x5e3028[_0x003f('0x47')]);_0x324d75[_0x003f('0x4c')]=_[_0x003f('0xd0')](_0x5e3028['model'],qs[_0x003f('0xd1')](_0x103d27[_0x003f('0x47')]['fields']));_0x324d75['attributes']=_0x324d75[_0x003f('0x4c')]['length']?_0x324d75['attributes']:_0x5e3028[_0x003f('0xcc')];_0x324d75['order']=qs[_0x003f('0xd3')](_0x103d27[_0x003f('0x47')][_0x003f('0xd3')]);_0x324d75[_0x003f('0x46')]=qs[_0x003f('0xcf')](_[_0x003f('0xd4')](_0x103d27[_0x003f('0x47')],_0x5e3028[_0x003f('0xcf')]));if(_0x103d27['query'][_0x003f('0x35')]){_0x324d75['where']=_[_0x003f('0x5c')](_0x324d75[_0x003f('0x46')],{'$or':_[_0x003f('0x37')](_0x324d75[_0x003f('0x4c')],function(_0x47b3c6){var _0x4b33aa={};_0x4b33aa[_0x47b3c6]={'$like':'%'+_0x103d27[_0x003f('0x47')][_0x003f('0x35')]+'%'};return _0x4b33aa;})});}_0x324d75=_[_0x003f('0x5c')]({},_0x324d75,_0x103d27['options']);return _0xcaba39['getFaxInteractions'](_0x324d75);}})['then'](function(_0x1c7fdd){if(_0x1c7fdd){_0x43763c=_0x1c7fdd[_0x003f('0x50')];if(!_0x103d27[_0x003f('0x47')][_0x003f('0xc6')](_0x003f('0xd6'))){_0x324d75[_0x003f('0x1d')]=qs[_0x003f('0x1d')](_0x103d27[_0x003f('0x47')]['limit']);_0x324d75['offset']=qs['offset'](_0x103d27[_0x003f('0x47')][_0x003f('0x1c')]);}return _0xcaba39[_0x003f('0xe5')](_0x324d75);}})[_0x003f('0x20')](function(_0xace6b5){if(_0xace6b5){return _0xace6b5?{'count':_0x43763c,'rows':_0xace6b5}:null;}})[_0x003f('0x20')](respondWithResult(_0x5160b7,null))[_0x003f('0x2b')](handleError(_0x5160b7,null));};exports[_0x003f('0xe6')]=function(_0x23c4f9,_0x144671){var _0x31400a={};var _0x531d23={};var _0x595f84;var _0x47ffe8;return db[_0x003f('0x3e')]['findOne']({'where':{'id':_0x23c4f9[_0x003f('0x59')]['id']}})[_0x003f('0x20')](handleEntityNotFound(_0x144671,null))[_0x003f('0x20')](function(_0xe3c7f9){if(_0xe3c7f9){_0x595f84=_0xe3c7f9;_0x531d23[_0x003f('0xcc')]=_[_0x003f('0xcd')](db['WhatsappInteraction'][_0x003f('0x3f')]);_0x531d23[_0x003f('0x47')]=_[_0x003f('0xcd')](_0x23c4f9[_0x003f('0x47')]);_0x531d23[_0x003f('0xcf')]=_['intersection'](_0x531d23['model'],_0x531d23[_0x003f('0x47')]);_0x31400a[_0x003f('0x4c')]=_[_0x003f('0xd0')](_0x531d23[_0x003f('0xcc')],qs['fields'](_0x23c4f9[_0x003f('0x47')][_0x003f('0xd1')]));_0x31400a[_0x003f('0x4c')]=_0x31400a[_0x003f('0x4c')][_0x003f('0x50')]?_0x31400a[_0x003f('0x4c')]:_0x531d23['model'];_0x31400a['order']=qs['sort'](_0x23c4f9[_0x003f('0x47')]['sort']);_0x31400a[_0x003f('0x46')]=qs[_0x003f('0xcf')](_[_0x003f('0xd4')](_0x23c4f9[_0x003f('0x47')],_0x531d23['filters']));if(_0x23c4f9[_0x003f('0x47')]['filter']){_0x31400a[_0x003f('0x46')]=_['merge'](_0x31400a[_0x003f('0x46')],{'$or':_[_0x003f('0x37')](_0x31400a[_0x003f('0x4c')],function(_0x52dc97){var _0x110e42={};_0x110e42[_0x52dc97]={'$like':'%'+_0x23c4f9['query']['filter']+'%'};return _0x110e42;})});}_0x31400a=_[_0x003f('0x5c')]({},_0x31400a,_0x23c4f9[_0x003f('0x5d')]);return _0x595f84['getWhatsappInteractions'](_0x31400a);}})['then'](function(_0x33c634){if(_0x33c634){_0x47ffe8=_0x33c634[_0x003f('0x50')];if(!_0x23c4f9[_0x003f('0x47')][_0x003f('0xc6')](_0x003f('0xd6'))){_0x31400a['limit']=qs['limit'](_0x23c4f9[_0x003f('0x47')][_0x003f('0x1d')]);_0x31400a['offset']=qs[_0x003f('0x1c')](_0x23c4f9[_0x003f('0x47')][_0x003f('0x1c')]);}return _0x595f84[_0x003f('0xe6')](_0x31400a);}})['then'](function(_0x131168){if(_0x131168){return _0x131168?{'count':_0x47ffe8,'rows':_0x131168}:null;}})[_0x003f('0x20')](respondWithResult(_0x144671,null))[_0x003f('0x2b')](handleError(_0x144671,null));};exports[_0x003f('0xe7')]=function(_0x4fbeda,_0x4a27fd,_0xba6de5){var _0x2071d3;var _0x4af79c;var _0x181f41;var _0x34a3aa=!_['isNil'](_0x4fbeda[_0x003f('0x59')]['id'])?_0x4fbeda[_0x003f('0x59')]['id']:!_[_0x003f('0x6b')](_0x4fbeda[_0x003f('0x80')]['id'])?_0x4fbeda[_0x003f('0x80')]['id']:null;return db[_0x003f('0x3e')][_0x003f('0x3a')]({'where':{'id':_0x34a3aa,'role':{'$or':[_0x003f('0x30'),_0x003f('0x80'),_0x003f('0x33')]}},'attributes':['id',_0x003f('0x3c'),_0x003f('0xe8'),_0x003f('0xe9'),'role',_0x003f('0x6a'),'loginInPause']})[_0x003f('0x20')](function(_0x587e28){if(_0x587e28){if(_0x587e28[_0x003f('0x2c')]===_0x003f('0x33')){_0x2071d3=_0x587e28;if(_0x4fbeda[_0x003f('0x60')][_0x003f('0x9e')]){_0x181f41=util['format'](_0x003f('0xea'),_0x2071d3[_0x4fbeda[_0x003f('0x60')][_0x003f('0x9e')]]);}else if(_0x4fbeda[_0x003f('0x60')]['intrf']){_0x181f41=util[_0x003f('0xc4')](_0x003f('0xa9'),_0x4fbeda['body'][_0x003f('0xeb')]);}else{_0x181f41=util[_0x003f('0xc4')](_0x003f('0xa9'),_0x2071d3[_0x003f('0x3c')]);}socket['to'](util[_0x003f('0xc4')]('user:%s',_0x2071d3[_0x003f('0x3c')]))[_0x003f('0x2d')]('user:forcelogout',{'user':{'id':_0x2071d3['id'],'name':_0x2071d3[_0x003f('0x3c')]},'ip':_0x4fbeda['headers'][_0x003f('0xec')]||_0x4fbeda[_0x003f('0xed')][_0x003f('0xee')]||_0x4fbeda[_0x003f('0xef')]['remoteAddress']||_0x4fbeda['connection'][_0x003f('0xef')][_0x003f('0xee')]});return db[_0x003f('0xf0')][_0x003f('0x2e')]({'where':{'membername':_0x2071d3[_0x003f('0x3c')]},'individualHooks':!![]});}}else{throw new db[(_0x003f('0x94'))][(_0x003f('0x93'))](_0x003f('0xf1'));}})[_0x003f('0x20')](function(){if(_0x2071d3){return _0x2071d3[_0x003f('0xf2')]({'raw':!![]});}})[_0x003f('0x20')](function(_0x430a3b){if(_0x2071d3){if(_0x430a3b){_0x4af79c=_0x430a3b;if(_0x4af79c[_0x003f('0x50')]){var _0x3f5457=_0x4af79c[_0x003f('0x37')](function(_0x58df2f){var _0x24233b={'membername':_0x2071d3[_0x003f('0x3c')],'UserId':_0x2071d3['id'],'queue_name':_0x58df2f[_0x003f('0x3c')],'VoiceQueueId':_0x58df2f['id'],'interface':_0x181f41,'paused':_0x2071d3['loginInPause']||![],'penalty':_0x58df2f[_0x003f('0xf3')]||0x0};return db[_0x003f('0xf0')][_0x003f('0xf4')](_0x24233b);});return Promise[_0x003f('0x58')](_0x3f5457);}}}})[_0x003f('0x20')](function(){if(_0x2071d3){return db[_0x003f('0xf5')][_0x003f('0x4e')]({'where':{'membername':_0x2071d3[_0x003f('0x3c')],'exitAt':null}});}})['then'](function(_0x2eb1af){if(_0x2071d3){var _0x59e0fb=[];_0x2eb1af['forEach'](function(_0x4a8f2b){_0x59e0fb[_0x003f('0x4d')](_0x4a8f2b['update']({'exitAt':moment()['format'](_0x003f('0xf6'))}));});return Promise[_0x003f('0x58')](_0x59e0fb);}})[_0x003f('0x20')](function(){if(_0x2071d3){var _0x405ceb=[];var _0x58f1ed=[];var _0x195b1d=utils[_0x003f('0xf7')]();var _0x45e848={'membername':_0x2071d3['name'],'interface':_0x181f41,'enterAt':moment()[_0x003f('0xc4')](_0x003f('0xf6')),'role':_0x2071d3[_0x003f('0x2c')],'internal':_0x2071d3[_0x003f('0x6a')]};_0x195b1d['forEach'](function(_0x44d94e){_0x405ceb[_0x003f('0x4d')](_[_0x003f('0x5c')]({'channel':_0x44d94e,'type':_0x003f('0xf8'),'data1':_0x4fbeda['body'][_0x003f('0xf9')],'data2':_0x181f41},_0x45e848));if(_0x2071d3['loginInPause']){_0x58f1ed['push'](_[_0x003f('0x5c')]({'channel':_0x44d94e,'type':_0x003f('0xfa'),'data1':'LOGININPAUSE'},_0x45e848));}});return db['MemberReport'][_0x003f('0xfb')](_0x405ceb['concat'](_0x58f1ed),{'individualHooks':!![]});}})[_0x003f('0x20')](function(){if(_0x2071d3){return _0x2071d3[_0x003f('0x5f')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x2071d3[_0x003f('0x9c')]||![],'mailPause':_0x2071d3[_0x003f('0x9c')]||![],'chatPause':_0x2071d3[_0x003f('0x9c')]||![],'faxPause':_0x2071d3[_0x003f('0x9c')]||![],'smsPause':_0x2071d3[_0x003f('0x9c')]||![],'openchannelPause':_0x2071d3['loginInPause']||![],'whatsappPause':_0x2071d3[_0x003f('0x9c')]||![],'pauseType':_0x2071d3[_0x003f('0x9c')]?_0x003f('0xfc'):null,'interface':_0x181f41,'lastPauseAt':moment()[_0x003f('0xc4')](_0x003f('0xf6'))});}})['then'](function(_0x5d3495){if(_0x4fbeda[_0x003f('0xfd')]){return _0xba6de5();}else{return Promise[_0x003f('0xfe')](_0x5d3495)['then'](respondWithResult(_0x4a27fd,null));}})[_0x003f('0x2b')](handleError(_0x4a27fd,null));};exports[_0x003f('0xff')]=function(_0x4c0d8e,_0x5bdaa7){var _0x15cbcc;return db[_0x003f('0x3e')][_0x003f('0x3a')]({'where':{'id':_0x4c0d8e[_0x003f('0x59')]['id'],'role':_0x003f('0x33')},'attributes':['id',_0x003f('0x3c'),_0x003f('0x2c')]})[_0x003f('0x20')](handleEntityNotFound(_0x5bdaa7,null))[_0x003f('0x20')](function(_0x293159){if(_0x293159){_0x15cbcc=_0x293159;return db[_0x003f('0xf0')]['destroy']({'where':{'membername':_0x15cbcc['name']},'individualHooks':!![]});}})[_0x003f('0x20')](function(){return db[_0x003f('0xf5')][_0x003f('0x4e')]({'where':{'membername':_0x15cbcc[_0x003f('0x3c')],'exitAt':null}});})[_0x003f('0x20')](function(_0x1fb324){var _0x2fec4e=[];_0x1fb324['forEach'](function(_0x48ed54){_0x2fec4e['push'](_0x48ed54[_0x003f('0x5f')]({'exitAt':moment()['format'](_0x003f('0xf6'))}));});return Promise['all'](_0x2fec4e);})[_0x003f('0x20')](function(){return _0x15cbcc['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x003f('0x20')](respondWithResult(_0x5bdaa7,null))[_0x003f('0x2b')](handleError(_0x5bdaa7,null));};exports['pause']=function(_0x1239e5,_0x17c1e2){var _0x10452b;return db['UserVoiceQueueRt'][_0x003f('0x5f')]({'paused':0x1},{'where':{'UserId':_0x1239e5[_0x003f('0x59')]['id']},'individualHooks':!![]})[_0x003f('0x20')](function(){return db[_0x003f('0x3e')][_0x003f('0x3a')]({'where':{'id':_0x1239e5[_0x003f('0x59')]['id'],'role':_0x003f('0x33')},'attributes':['id',_0x003f('0x3c'),'role',_0x003f('0x6a'),_0x003f('0x9e'),_0x003f('0x100')]});})[_0x003f('0x20')](handleEntityNotFound(_0x17c1e2,null))[_0x003f('0x20')](function(_0x7584a0){if(_0x7584a0){_0x10452b=_0x7584a0;return respondWithRpcPromise(_0x003f('0x101'),_0x003f('0x102'),{'id':_0x10452b['id'],'name':_0x10452b[_0x003f('0x3c')],'pause':!![]});}})[_0x003f('0x20')](function(){if(_0x10452b){return db[_0x003f('0xf5')][_0x003f('0x4e')]({'where':{'membername':_0x10452b['name'],'type':_0x003f('0xfa'),'exitAt':null}});}})[_0x003f('0x20')](function(_0x383863){if(_0x383863[_0x003f('0x50')]){var _0x338b11=moment()[_0x003f('0xc4')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x264f5f=0x0,_0x360981=_0x383863[_0x003f('0x50')];_0x264f5f<_0x360981;_0x264f5f++){_0x383863[_0x264f5f][_0x003f('0x103')]({'exitAt':_0x338b11});}}})[_0x003f('0x20')](function(){var _0x2023a1=[];var _0x234f8e=utils[_0x003f('0xf7')]();_0x234f8e['forEach'](function(_0x43e949){_0x2023a1[_0x003f('0x4d')]({'channel':_0x43e949,'membername':_0x10452b[_0x003f('0x3c')],'interface':_[_0x003f('0x6b')](_0x10452b[_0x003f('0x9e')])?util['format']('SIP/%s',_0x10452b['name']):_0x10452b['interface'],'type':'PAUSE','enterAt':moment()[_0x003f('0xc4')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x1239e5[_0x003f('0x60')][_0x003f('0x104')]||'DEFAULT\x20PAUSE','role':_0x10452b[_0x003f('0x2c')],'internal':_0x10452b[_0x003f('0x6a')]});});return db[_0x003f('0xf5')][_0x003f('0xfb')](_0x2023a1,{'individualHooks':!![]});})['then'](function(){return _0x10452b['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1239e5['body'][_0x003f('0x104')]||_0x003f('0x105'),'lastPauseAt':moment()[_0x003f('0xc4')](_0x003f('0xf6'))});})['then'](respondWithResult(_0x17c1e2,null))['catch'](handleError(_0x17c1e2,null));};exports[_0x003f('0x106')]=function(_0x3a6a8b,_0x43e569){if(_0x3a6a8b['body'][_0x003f('0xaa')]&&!utils[_0x003f('0x9f')](_0x3a6a8b['body']['channel'])){throw new APIBadRequestError(util['format'](_0x003f('0x107'),_0x3a6a8b[_0x003f('0x60')]['channel']));}return db[_0x003f('0x3e')]['find']({'where':{'id':_0x3a6a8b['params']['id']},'attributes':['id',_0x003f('0x3c'),'role',_0x003f('0x6a'),_0x003f('0x9e'),_0x003f('0x100'),'voicePause','mailPause',_0x003f('0x108'),_0x003f('0x109'),_0x003f('0x10a'),_0x003f('0x10b'),'whatsappPause',_0x003f('0x10c'),_0x003f('0x10d')]})[_0x003f('0x20')](function(_0x739b2f){if(!_0x739b2f){throw new APINotFoundError(util[_0x003f('0xc4')](_0x003f('0xc5'),_0x3a6a8b[_0x003f('0x59')]['id']));}return _0x739b2f[_0x003f('0x106')](_0x3a6a8b[_0x003f('0x60')][_0x003f('0xaa')]);})[_0x003f('0x20')](respondWithResult(_0x43e569,null))[_0x003f('0x2b')](APIHandleError(_0x43e569));};exports[_0x003f('0x10e')]=function(_0x3a5866,_0x39f149){var _0x109fbc={};var _0x402ef2={};var _0x1509ce;var _0x506120;return db[_0x003f('0x3e')]['findOne']({'where':{'id':_0x3a5866[_0x003f('0x59')]['id']}})[_0x003f('0x20')](handleEntityNotFound(_0x39f149,null))[_0x003f('0x20')](function(_0x238f6b){if(_0x238f6b){_0x1509ce=_0x238f6b;_0x402ef2['model']=_[_0x003f('0xcd')](db[_0x003f('0x10f')]['rawAttributes']);_0x402ef2['query']=_[_0x003f('0xcd')](_0x3a5866[_0x003f('0x47')]);_0x402ef2[_0x003f('0xcf')]=_['intersection'](_0x402ef2[_0x003f('0xcc')],_0x402ef2['query']);_0x109fbc[_0x003f('0x4c')]=_[_0x003f('0xd0')](_0x402ef2[_0x003f('0xcc')],qs[_0x003f('0xd1')](_0x3a5866['query'][_0x003f('0xd1')]));_0x109fbc['attributes']=_0x109fbc[_0x003f('0x4c')][_0x003f('0x50')]?_0x109fbc[_0x003f('0x4c')]:_0x402ef2[_0x003f('0xcc')];_0x109fbc[_0x003f('0xd2')]=qs['sort'](_0x3a5866['query']['sort']);_0x109fbc[_0x003f('0x46')]=qs[_0x003f('0xcf')](_[_0x003f('0xd4')](_0x3a5866['query'],_0x402ef2[_0x003f('0xcf')]));if(_0x3a5866['query'][_0x003f('0x35')]){_0x109fbc[_0x003f('0x46')]=_[_0x003f('0x5c')](_0x109fbc[_0x003f('0x46')],{'$or':_[_0x003f('0x37')](_0x109fbc['attributes'],function(_0x3b918f){var _0x3a017f={};_0x3a017f[_0x3b918f]={'$like':'%'+_0x3a5866['query'][_0x003f('0x35')]+'%'};return _0x3a017f;})});}_0x109fbc=_[_0x003f('0x5c')]({},_0x109fbc,_0x3a5866[_0x003f('0x5d')]);return _0x1509ce['getTeams'](_0x109fbc);}})[_0x003f('0x20')](function(_0x1810d7){if(_0x1810d7){_0x506120=_0x1810d7[_0x003f('0x50')];if(!_0x3a5866[_0x003f('0x47')][_0x003f('0xc6')](_0x003f('0xd6'))){_0x109fbc[_0x003f('0x1d')]=qs[_0x003f('0x1d')](_0x3a5866['query'][_0x003f('0x1d')]);_0x109fbc[_0x003f('0x1c')]=qs[_0x003f('0x1c')](_0x3a5866['query'][_0x003f('0x1c')]);}return _0x1509ce[_0x003f('0x10e')](_0x109fbc);}})[_0x003f('0x20')](function(_0x13783e){if(_0x13783e){return _0x13783e?{'count':_0x506120,'rows':_0x13783e}:null;}})[_0x003f('0x20')](respondWithResult(_0x39f149,null))[_0x003f('0x2b')](handleError(_0x39f149,null));};exports[_0x003f('0x110')]=function(_0xac68f7,_0x36c17e){var _0x3adbc1=_0xac68f7[_0x003f('0x59')]['id'];var _0x3c8c77=_0xac68f7[_0x003f('0x60')]?_0xac68f7[_0x003f('0x60')][_0x003f('0x63')]:null;var _0x507a6e=[];return Promise['resolve']()['then'](function(){if(!_0x3c8c77)throw new APIBadRequestError(_0x003f('0x111'));})[_0x003f('0x20')](function(){return db['User'][_0x003f('0x98')]({'where':{'id':_0x3adbc1}});})[_0x003f('0x20')](function(_0x3a8eed){if(!_0x3a8eed)throw new APINotFoundError(util[_0x003f('0xc4')](_0x003f('0xc5'),_0xac68f7[_0x003f('0x59')]['id']));return db[_0x003f('0x6d')]['transaction'](function(_0xd9b213){return _0x3a8eed[_0x003f('0x110')](_0x3c8c77,{'transaction':_0xd9b213})[_0x003f('0x20')](function(){return db[_0x003f('0x10f')]['findAll']({'where':{'id':{'$in':_0x3c8c77}}});})[_0x003f('0x20')](function(_0x56486a){var _0x2d2e07=_[_0x003f('0x37')](_0x56486a,function(_0x24c8e0){return _0x24c8e0[_0x003f('0x112')]();});return Promise[_0x003f('0x58')](_0x2d2e07);})[_0x003f('0x20')](function(_0x12d8bf){_0x507a6e=_[_0x003f('0x113')](_0x12d8bf);var _0xff4aa5=_['map'](_0x507a6e,function(_0x3521ad){return _0x3521ad[_0x003f('0x114')](_0x3a8eed['id'],{'transaction':_0xd9b213});});return Promise['all'](_0xff4aa5);})[_0x003f('0x20')](function(){if(!_0x3a8eed[_0x003f('0x100')])return;var _0x573e7e=_[_0x003f('0x35')](_0x507a6e,function(_0x474555){return _0x474555[_0x003f('0x115')](_0x003f('0xaa'))==='Voice';});var _0x288bf8=_['map'](_0x573e7e,function(_0xe216e9){return db['UserVoiceQueueRt'][_0x003f('0xf4')]({'membername':_0x3a8eed[_0x003f('0x3c')],'UserId':_0x3a8eed['id'],'queue_name':_0xe216e9['name'],'VoiceQueueId':_0xe216e9['id'],'interface':_[_0x003f('0x6b')](_0x3a8eed[_0x003f('0x9e')])?util[_0x003f('0xc4')](_0x003f('0xa9'),_0x3a8eed[_0x003f('0x3c')]):_0x3a8eed[_0x003f('0x9e')],'paused':_0x3a8eed[_0x003f('0x9d')]||![],'penalty':_0x3a8eed['penalty']},{'transaction':_0xd9b213});});return Promise['all'](_0x288bf8);})[_0x003f('0x20')](function(){return db[_0x003f('0x116')][_0x003f('0x4e')]({'where':{'teamId':{'$in':_0x3c8c77}}});})['then'](function(_0x452a4b){var _0x817692=_[_0x003f('0x37')](_0x452a4b,function(_0x69c4bc){return db[_0x003f('0x117')][_0x003f('0x86')]({'UserId':_0x3a8eed['id'],'VoicePrefixId':_0x69c4bc[_0x003f('0x118')]},{'transaction':_0xd9b213});});return Promise[_0x003f('0x58')](_0x817692);});});})[_0x003f('0x20')](function(){for(var _0x4fc53f=0x0;_0x4fc53f<_0x507a6e[_0x003f('0x50')];_0x4fc53f++){var _0x18000c=_0x507a6e[_0x4fc53f]['getDataValue'](_0x003f('0xaa'));var _0x343b50=_0x18000c+_0x003f('0xa5');socket[_0x003f('0x2d')]('user'+_0x18000c+_0x003f('0xa7'),{'UserId':_0x3adbc1,['queueField']:_0x507a6e[_0x4fc53f]['id']});}})[_0x003f('0x20')](respondWithStatusCode(_0x36c17e,null))[_0x003f('0x2b')](APIHandleError(_0x36c17e));};exports[_0x003f('0x119')]=function(_0x3be56e,_0x41fc94){var _0x115811=_0x3be56e[_0x003f('0x59')]['id'];var _0x1babb5=null;if(_0x3be56e[_0x003f('0x47')][_0x003f('0x63')]){_0x1babb5=_[_0x003f('0xab')](_0x3be56e[_0x003f('0x47')]['ids'])?_0x3be56e[_0x003f('0x47')][_0x003f('0x63')]:[_0x3be56e['query']['ids']];}var _0xc4cf14=[];return Promise[_0x003f('0xfe')]()[_0x003f('0x20')](function(){if(!_0x1babb5)throw new APIBadRequestError(_0x003f('0x11a'));})[_0x003f('0x20')](function(){return db['User']['findOne']({'where':{'id':_0x115811}});})[_0x003f('0x20')](function(_0x495152){if(!_0x495152)throw new APINotFoundError(util['format'](_0x003f('0xc5'),_0x3be56e[_0x003f('0x59')]['id']));return db[_0x003f('0x6d')][_0x003f('0x11b')](function(_0x2c64a6){return _0x495152[_0x003f('0x119')](_0x1babb5,{'transaction':_0x2c64a6})['then'](function(){return db[_0x003f('0x10f')]['findAll']({'where':{'id':{'$in':_0x1babb5}}});})[_0x003f('0x20')](function(_0x14ee92){var _0x595b8e=_[_0x003f('0x37')](_0x14ee92,function(_0x227993){return _0x227993[_0x003f('0x112')]();});return Promise[_0x003f('0x58')](_0x595b8e);})[_0x003f('0x20')](function(_0x22421b){_0xc4cf14=_[_0x003f('0x113')](_0x22421b);var _0x2b3953=_['map'](_0xc4cf14,function(_0x1f22c2){return _0x1f22c2['removeAgent'](_0x495152['id'],{'transaction':_0x2c64a6});});return Promise[_0x003f('0x58')](_0x2b3953);})[_0x003f('0x20')](function(){if(!_0x495152['online'])return;var _0x5dd560=_['filter'](_0xc4cf14,function(_0x4cdd36){return _0x4cdd36[_0x003f('0x115')](_0x003f('0xaa'))==='Voice';});var _0x5be7c6=_[_0x003f('0x37')](_0x5dd560,function(_0x5d07b4){return db[_0x003f('0xf0')][_0x003f('0x2e')]({'where':{'VoiceQueueId':_0x5d07b4['id'],'UserId':_0x495152['id']},'transaction':_0x2c64a6});});return Promise[_0x003f('0x58')](_0x5be7c6);})[_0x003f('0x20')](function(){return db[_0x003f('0x116')][_0x003f('0x4e')]({'where':{'teamId':{'$in':_0x1babb5}}});})['then'](function(_0x1baa21){var _0x5e6995=_[_0x003f('0x37')](_0x1baa21,function(_0x5942ca){return db[_0x003f('0x117')][_0x003f('0x2e')]({'where':{'UserId':_0x495152['id'],'VoicePrefixId':_0x5942ca[_0x003f('0x118')]}},{'transaction':_0x2c64a6});});return Promise[_0x003f('0x58')](_0x5e6995);});});})['then'](function(){for(var _0x2671f1=0x0;_0x2671f1<_0xc4cf14['length'];_0x2671f1++){var _0x17f4cd=_0xc4cf14[_0x2671f1][_0x003f('0x115')](_0x003f('0xaa'));var _0x49cbb7=_0x17f4cd+_0x003f('0xa5');socket[_0x003f('0x2d')](_0x003f('0x80')+_0x17f4cd+_0x003f('0xac'),{'UserId':_0x115811,['queueField']:_0xc4cf14[_0x2671f1]['id']});}})[_0x003f('0x20')](respondWithStatusCode(_0x41fc94,null))[_0x003f('0x2b')](APIHandleError(_0x41fc94));};exports['getLists']=function(_0xf5a5f,_0x8dd7f2){var _0xe97932={};var _0x1a629c={};var _0x4466a9;var _0x5b2e25;return db['User'][_0x003f('0x98')]({'where':{'id':_0xf5a5f[_0x003f('0x59')]['id']}})[_0x003f('0x20')](handleEntityNotFound(_0x8dd7f2,null))['then'](function(_0x3ceeac){if(_0x3ceeac){_0x4466a9=_0x3ceeac;_0x1a629c[_0x003f('0xcc')]=_[_0x003f('0xcd')](db['CmList'][_0x003f('0x3f')]);_0x1a629c[_0x003f('0x47')]=_['keys'](_0xf5a5f['query']);_0x1a629c[_0x003f('0xcf')]=_[_0x003f('0xd0')](_0x1a629c[_0x003f('0xcc')],_0x1a629c[_0x003f('0x47')]);_0xe97932[_0x003f('0x4c')]=_[_0x003f('0xd0')](_0x1a629c[_0x003f('0xcc')],qs[_0x003f('0xd1')](_0xf5a5f['query']['fields']));_0xe97932[_0x003f('0x4c')]=_0xe97932[_0x003f('0x4c')][_0x003f('0x50')]?_0xe97932['attributes']:_0x1a629c[_0x003f('0xcc')];_0xe97932[_0x003f('0xd2')]=qs[_0x003f('0xd3')](_0xf5a5f[_0x003f('0x47')][_0x003f('0xd3')]);_0xe97932[_0x003f('0x46')]=qs[_0x003f('0xcf')](_[_0x003f('0xd4')](_0xf5a5f[_0x003f('0x47')],_0x1a629c[_0x003f('0xcf')]));if(_0xf5a5f[_0x003f('0x47')]['filter']){_0xe97932[_0x003f('0x46')]=_[_0x003f('0x5c')](_0xe97932['where'],{'$or':_['map'](_0xe97932['attributes'],function(_0x15087c){var _0x3911b2={};_0x3911b2[_0x15087c]={'$like':'%'+_0xf5a5f[_0x003f('0x47')][_0x003f('0x35')]+'%'};return _0x3911b2;})});}_0xe97932=_[_0x003f('0x5c')]({},_0xe97932,_0xf5a5f[_0x003f('0x5d')]);return _0x4466a9['getLists'](_0xe97932);}})['then'](function(_0x474f9d){if(_0x474f9d){_0x5b2e25=_0x474f9d[_0x003f('0x50')];if(!_0xf5a5f[_0x003f('0x47')][_0x003f('0xc6')]('nolimit')){_0xe97932[_0x003f('0x1d')]=qs['limit'](_0xf5a5f[_0x003f('0x47')][_0x003f('0x1d')]);_0xe97932[_0x003f('0x1c')]=qs[_0x003f('0x1c')](_0xf5a5f[_0x003f('0x47')]['offset']);}return _0x4466a9[_0x003f('0x11c')](_0xe97932);}})[_0x003f('0x20')](function(_0x3675b8){if(_0x3675b8){return _0x3675b8?{'count':_0x5b2e25,'rows':_0x3675b8}:null;}})['then'](respondWithResult(_0x8dd7f2,null))[_0x003f('0x2b')](handleError(_0x8dd7f2,null));};exports['getAgents']=function(_0x526a1c,_0x1a3ba5){var _0x3a6283={};var _0x1c6638={};var _0x46fd4d;return db[_0x003f('0x3e')][_0x003f('0x98')]({'where':{'id':_0x526a1c[_0x003f('0x59')]['id']}})[_0x003f('0x20')](handleEntityNotFound(_0x1a3ba5,null))[_0x003f('0x20')](function(_0x4151a1){if(_0x4151a1){_0x46fd4d=_0x4151a1;_0x1c6638[_0x003f('0xcc')]=_[_0x003f('0xcd')](db[_0x003f('0x3e')][_0x003f('0x3f')]);_0x1c6638['query']=_['keys'](_0x526a1c[_0x003f('0x47')]);_0x1c6638[_0x003f('0xcf')]=_[_0x003f('0xd0')](_0x1c6638['model'],_0x1c6638[_0x003f('0x47')]);_0x3a6283[_0x003f('0x4c')]=_['intersection'](_0x1c6638[_0x003f('0xcc')],qs[_0x003f('0xd1')](_0x526a1c[_0x003f('0x47')][_0x003f('0xd1')]));_0x3a6283[_0x003f('0x4c')]=_0x3a6283['attributes'][_0x003f('0x50')]?_0x3a6283[_0x003f('0x4c')]:_0x1c6638[_0x003f('0xcc')];_0x3a6283[_0x003f('0xd2')]=qs['sort'](_0x526a1c[_0x003f('0x47')][_0x003f('0xd3')]);_0x3a6283[_0x003f('0x46')]=qs[_0x003f('0xcf')](_[_0x003f('0xd4')](_0x526a1c[_0x003f('0x47')],_0x1c6638[_0x003f('0xcf')]));if(_0x526a1c[_0x003f('0x47')]['filter']){_0x3a6283[_0x003f('0x46')]=_[_0x003f('0x5c')](_0x3a6283[_0x003f('0x46')],{'$or':_['map'](_0x3a6283[_0x003f('0x4c')],function(_0x42638a){var _0x3f0b6e={};_0x3f0b6e[_0x42638a]={'$like':'%'+_0x526a1c[_0x003f('0x47')][_0x003f('0x35')]+'%'};return _0x3f0b6e;})});}_0x3a6283[_0x003f('0xcc')]=db[_0x003f('0x3e')];_0x3a6283['as']=_0x003f('0x32');_0x3a6283=_[_0x003f('0x5c')]({},_0x3a6283,_0x526a1c[_0x003f('0x5d')]);return _0x46fd4d[_0x003f('0xf2')]({'include':[_0x3a6283]});}})[_0x003f('0x20')](function(_0x2171d3){if(_0x2171d3){var _0x36b07f={},_0x5d6fb8=[];for(var _0x14d710=0x0;_0x14d710<_0x2171d3[_0x003f('0x50')];_0x14d710+=0x1){for(var _0x320e4b=0x0,_0x264bc8;_0x320e4b<_0x2171d3[_0x14d710]['Agents'][_0x003f('0x50')];_0x320e4b+=0x1){_0x264bc8=_0x2171d3[_0x14d710][_0x003f('0x32')][_0x320e4b][_0x003f('0x2f')]({'plain':!![]});_0x36b07f[_0x264bc8['id']]=_0x264bc8;}}_0x36b07f=_[_0x003f('0x11d')](_0x36b07f);for(var _0x360d76=qs[_0x003f('0x1c')](_0x526a1c['query'][_0x003f('0x1c')]);_0x360d76<_0x36b07f[_0x003f('0x50')]&&_0x5d6fb8[_0x003f('0x50')]=_0x472727[_0x86c2('0x4a')]){throw new Error(_0x86c2('0x4b'));}})[_0x86c2('0x17')](function(){if(_0x16e78d){return db[_0x86c2('0x3e')][_0x86c2('0x3f')]({'where':{'membername':_0x16e78d[_0x86c2('0x21')]},'individualHooks':!![]});}})[_0x86c2('0x17')](function(){if(_0x16e78d){return _0x16e78d[_0x86c2('0x4c')]({'raw':!![]});}})[_0x86c2('0x17')](function(_0x2d898b){if(_0x16e78d){if(_0x2d898b){var _0x23c0ec=[];_0x279a16=_0x2d898b;if(_0x279a16[_0x86c2('0x40')]){for(var _0x5363c8=0x0;_0x5363c8<_0x279a16[_0x86c2('0x40')];_0x5363c8++){_0x23c0ec[_0x86c2('0x2c')](db[_0x86c2('0x3e')][_0x86c2('0x4d')]({'membername':_0x16e78d[_0x86c2('0x21')],'UserId':_0x16e78d['id'],'queue_name':_0x279a16[_0x5363c8][_0x86c2('0x21')],'VoiceQueueId':_0x279a16[_0x5363c8]['id'],'interface':_0x21effc,'paused':_0x16e78d[_0x86c2('0x45')]||![],'penalty':_0x279a16[_0x5363c8][_0x86c2('0x4e')]||0x0}));}return BPromise[_0x86c2('0x42')](_0x23c0ec);}}}})[_0x86c2('0x17')](function(){if(_0x16e78d){return db['MemberReport'][_0x86c2('0x27')]({'where':{'membername':_0x16e78d[_0x86c2('0x21')],'exitAt':null}});}})[_0x86c2('0x17')](function(_0x9ac933){if(_0x16e78d){if(_0x9ac933&&_0x9ac933[_0x86c2('0x40')]){var _0x4409d6=[];_0x9ac933['forEach'](function(_0x38c677){_0x4409d6[_0x86c2('0x2c')](_0x38c677[_0x86c2('0x32')]({'exitAt':moment()[_0x86c2('0x24')](_0x86c2('0x29'))}));});return BPromise['all'](_0x4409d6);}}})['then'](function(){if(_0x16e78d){var _0xc89470=[];var _0x4a93a9=[];var _0x4921ef=utils[_0x86c2('0x2b')]();var _0x39f87c={'membername':_0x16e78d[_0x86c2('0x21')],'interface':_0x21effc,'enterAt':moment()[_0x86c2('0x24')](_0x86c2('0x29')),'role':_0x16e78d['role'],'internal':_0x16e78d[_0x86c2('0x30')]};_0x4921ef[_0x86c2('0x41')](function(_0x2ae5f8){_0xc89470[_0x86c2('0x2c')](_['merge']({'channel':_0x2ae5f8,'type':_0x86c2('0x4f'),'data1':'callysquare','data2':_0x21effc},_0x39f87c));if(_0x16e78d['loginInPause']){_0x4a93a9['push'](_[_0x86c2('0x50')]({'channel':_0x2ae5f8,'type':_0x86c2('0x28'),'data1':'LOGININPAUSE'},_0x39f87c));}});return db[_0x86c2('0x26')]['bulkCreate'](_0xc89470[_0x86c2('0x51')](_0x4a93a9),{'individualHooks':!![]});}})['then'](function(){if(_0x16e78d){return _0x16e78d[_0x86c2('0x32')]({'online':!![],'lastLoginAt':moment()[_0x86c2('0x24')](_0x86c2('0x29')),'voicePause':_0x16e78d[_0x86c2('0x45')]||![],'mailPause':_0x16e78d[_0x86c2('0x45')]||![],'chatPause':_0x16e78d['loginInPause']||![],'faxPause':_0x16e78d['loginInPause']||![],'smsPause':_0x16e78d[_0x86c2('0x45')]||![],'openchannelPause':_0x16e78d[_0x86c2('0x45')]||![],'pauseType':_0x16e78d[_0x86c2('0x45')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x86c2('0x24')](_0x86c2('0x29')),'interface':_0x21effc});}})[_0x86c2('0x17')](function(_0x3900cd){_0x57bc3d(_0x3900cd);})[_0x86c2('0x1a')](function(_0x38924e){_0x59910d(_0x389ac1[_0x86c2('0x1b')](0x1f4,_0x38924e[_0x86c2('0x1f')]));});});}; \ No newline at end of file +var _0xff10=['chatPause','openchannelPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','system','findOne','destroy','forEach','all','LoginUser','mobile','loginInPause','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','UserVoiceQueue.penalty','LOGIN','callysquare','merge','LOGININPAUSE','concat','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','redis','socket.io-emitter','./user.socket','register','GetUser','User','options','where','attributes','limit','map','include','model','then','debug','catch','error','message','ShowUser','info','stringify','find','name','role','internal','format','params','UserVoiceQueueRt','MemberReport','findAll','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','push','interface','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','update','UnpauseUser','resolve','channel','Channel\x20parameter\x20%s\x20is\x20invalid','online','voicePause','mailPause'];(function(_0x44532f,_0x2dac86){var _0x11e878=function(_0x1cb557){while(--_0x1cb557){_0x44532f['push'](_0x44532f['shift']());}};_0x11e878(++_0x2dac86);}(_0xff10,0x113));var _0x0ff1=function(_0x5971eb,_0x53ead0){_0x5971eb=_0x5971eb-0x0;var _0x1454a2=_0xff10[_0x5971eb];return _0x1454a2;};'use strict';var _=require(_0x0ff1('0x0'));var util=require(_0x0ff1('0x1'));var moment=require(_0x0ff1('0x2'));var BPromise=require('bluebird');var Redis=require(_0x0ff1('0x3'));var db=require(_0x0ff1('0x4'))['db'];var utils=require(_0x0ff1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0ff1('0x6'));config['redis']=_['defaults'](config[_0x0ff1('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x0ff1('0x8'))(new Redis(config[_0x0ff1('0x7')]));require(_0x0ff1('0x9'))[_0x0ff1('0xa')](socket);exports[_0x0ff1('0xb')]=function(_0xae255d){var _0x40c45a=this;return new Promise(function(_0x3f63ae,_0xd1d226){return db[_0x0ff1('0xc')]['findAll']({'raw':_0xae255d[_0x0ff1('0xd')]?_0xae255d[_0x0ff1('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0xae255d['options']?_0xae255d['options'][_0x0ff1('0xe')]||null:null,'attributes':_0xae255d[_0x0ff1('0xd')]?_0xae255d[_0x0ff1('0xd')][_0x0ff1('0xf')]||null:null,'limit':_0xae255d[_0x0ff1('0xd')]?_0xae255d['options'][_0x0ff1('0x10')]||null:null,'include':_0xae255d['options']?_0xae255d[_0x0ff1('0xd')]['include']?_[_0x0ff1('0x11')](_0xae255d[_0x0ff1('0xd')][_0x0ff1('0x12')],function(_0x2018af){return{'model':db[_0x2018af[_0x0ff1('0x13')]],'as':_0x2018af['as'],'attributes':_0x2018af['attributes'],'include':_0x2018af[_0x0ff1('0x12')]?_[_0x0ff1('0x11')](_0x2018af[_0x0ff1('0x12')],function(_0x32638a){return{'model':db[_0x32638a['model']],'as':_0x32638a['as'],'attributes':_0x32638a[_0x0ff1('0xf')],'include':_0x32638a[_0x0ff1('0x12')]?_['map'](_0x32638a['include'],function(_0x330f68){return{'model':db[_0x330f68['model']],'as':_0x330f68['as'],'attributes':_0x330f68[_0x0ff1('0xf')]};}):[]};}):[]};}):[]:[]})[_0x0ff1('0x14')](function(_0x2a54c5){logger['info']('GetUser',_0xae255d);logger[_0x0ff1('0x15')](_0x0ff1('0xb'),_0xae255d,JSON['stringify'](_0x2a54c5));_0x3f63ae(_0x2a54c5);})[_0x0ff1('0x16')](function(_0x14e09a){logger[_0x0ff1('0x17')]('GetUser',_0x14e09a[_0x0ff1('0x18')],_0xae255d);_0xd1d226(_0x40c45a[_0x0ff1('0x17')](0x1f4,_0x14e09a[_0x0ff1('0x18')]));});});};exports[_0x0ff1('0x19')]=function(_0xe1408c){var _0x7e87be=this;return new Promise(function(_0x215565,_0x5ccccf){return db[_0x0ff1('0xc')]['find']({'raw':_0xe1408c[_0x0ff1('0xd')]?_0xe1408c[_0x0ff1('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0xe1408c[_0x0ff1('0xd')]?_0xe1408c[_0x0ff1('0xd')][_0x0ff1('0xe')]||null:null,'attributes':_0xe1408c[_0x0ff1('0xd')]?_0xe1408c[_0x0ff1('0xd')][_0x0ff1('0xf')]||null:null,'include':_0xe1408c['options']?_0xe1408c[_0x0ff1('0xd')][_0x0ff1('0x12')]?_[_0x0ff1('0x11')](_0xe1408c[_0x0ff1('0xd')][_0x0ff1('0x12')],function(_0x296b96){return{'model':db[_0x296b96[_0x0ff1('0x13')]],'as':_0x296b96['as'],'attributes':_0x296b96['attributes'],'include':_0x296b96[_0x0ff1('0x12')]?_[_0x0ff1('0x11')](_0x296b96[_0x0ff1('0x12')],function(_0xf034a7){return{'model':db[_0xf034a7[_0x0ff1('0x13')]],'as':_0xf034a7['as'],'attributes':_0xf034a7['attributes'],'include':_0xf034a7[_0x0ff1('0x12')]?_[_0x0ff1('0x11')](_0xf034a7[_0x0ff1('0x12')],function(_0x2758ac){return{'model':db[_0x2758ac[_0x0ff1('0x13')]],'as':_0x2758ac['as'],'attributes':_0x2758ac[_0x0ff1('0xf')]};}):[]};}):[]};}):[]:[]})[_0x0ff1('0x14')](function(_0x78a37e){logger[_0x0ff1('0x1a')]('ShowUser',_0xe1408c);logger[_0x0ff1('0x15')](_0x0ff1('0x19'),_0xe1408c,JSON[_0x0ff1('0x1b')](_0x78a37e));_0x215565(_0x78a37e);})[_0x0ff1('0x16')](function(_0x4f8220){logger['error'](_0x0ff1('0x19'),_0x4f8220['message'],_0xe1408c);_0x5ccccf(_0x7e87be[_0x0ff1('0x17')](0x1f4,_0x4f8220[_0x0ff1('0x18')]));});});};exports['PauseUser']=function(_0x5277b1){var _0x308a47;return db[_0x0ff1('0xc')][_0x0ff1('0x1c')]({'where':_0x5277b1[_0x0ff1('0xd')][_0x0ff1('0xe')]||{},'attributes':['id',_0x0ff1('0x1d'),_0x0ff1('0x1e'),_0x0ff1('0x1f'),'interface']})[_0x0ff1('0x14')](function(_0x5bd406){if(!_0x5bd406){throw new Error(util[_0x0ff1('0x20')]('User\x20with\x20id\x20%s\x20not\x20found',_0x5277b1[_0x0ff1('0x21')]['id']));}_0x308a47=_0x5bd406;return db[_0x0ff1('0x22')]['update']({'paused':0x1},{'where':{'UserId':_0x308a47['id']},'individualHooks':!![]});})[_0x0ff1('0x14')](function(){return db[_0x0ff1('0x23')][_0x0ff1('0x24')]({'where':{'membername':_0x308a47[_0x0ff1('0x1d')],'type':_0x0ff1('0x25'),'exitAt':null}});})[_0x0ff1('0x14')](function(_0x34f346){if(_0x34f346&&_0x34f346[_0x0ff1('0x26')]){var _0x433a91=moment()[_0x0ff1('0x20')](_0x0ff1('0x27'));for(var _0x3bc9fc=0x0,_0x599602=_0x34f346[_0x0ff1('0x26')];_0x3bc9fc<_0x599602;_0x3bc9fc++){_0x34f346[_0x3bc9fc][_0x0ff1('0x28')]({'exitAt':_0x433a91});}}})['then'](function(){var _0x3aa50a=[];var _0x170894=utils[_0x0ff1('0x29')]();_0x170894['forEach'](function(_0x240ffb){_0x3aa50a[_0x0ff1('0x2a')]({'channel':_0x240ffb,'membername':_0x308a47['name'],'interface':_['isNil'](_0x308a47['interface'])?util[_0x0ff1('0x20')]('SIP/%s',_0x308a47[_0x0ff1('0x1d')]):_0x308a47[_0x0ff1('0x2b')],'type':_0x0ff1('0x25'),'enterAt':moment()['format'](_0x0ff1('0x27')),'data1':_0x5277b1[_0x0ff1('0x2c')][_0x0ff1('0x2d')]||_0x0ff1('0x2e'),'role':_0x308a47['role'],'internal':_0x308a47['internal'],'uniqueid':_0x5277b1['body'][_0x0ff1('0x2f')]||null});});return db['MemberReport'][_0x0ff1('0x30')](_0x3aa50a,{'individualHooks':!![]});})[_0x0ff1('0x14')](function(){return _0x308a47[_0x0ff1('0x31')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x5277b1[_0x0ff1('0x2c')][_0x0ff1('0x2d')]||_0x0ff1('0x2e'),'lastPauseAt':moment()[_0x0ff1('0x20')](_0x0ff1('0x27'))});})['catch'](function(_0x4a97e1){throw _0x4a97e1;});};exports[_0x0ff1('0x32')]=function(_0x256292){return Promise[_0x0ff1('0x33')]()[_0x0ff1('0x14')](function(){if(_0x256292[_0x0ff1('0x2c')][_0x0ff1('0x34')]&&!utils['isValidChannel'](_0x256292[_0x0ff1('0x2c')][_0x0ff1('0x34')])){throw new Error(util[_0x0ff1('0x20')](_0x0ff1('0x35'),_0x256292[_0x0ff1('0x2c')][_0x0ff1('0x34')]));}return db[_0x0ff1('0xc')]['findOne']({'where':_0x256292['options']['where']||{},'attributes':['id',_0x0ff1('0x1d'),_0x0ff1('0x1e'),'internal','interface',_0x0ff1('0x36'),_0x0ff1('0x37'),_0x0ff1('0x38'),_0x0ff1('0x39'),'faxPause',_0x0ff1('0x3a'),'smsPause',_0x0ff1('0x3b'),_0x0ff1('0x3c'),_0x0ff1('0x3d')]});})['then'](function(_0x3a411b){if(!_0x3a411b){throw new Error(util['format'](_0x0ff1('0x3e'),_0x256292['params']['id']));}return _0x3a411b['unpause'](_0x256292[_0x0ff1('0x2c')][_0x0ff1('0x34')],_0x0ff1('0x3f'));})['catch'](function(_0x24e516){throw _0x24e516;});};exports['LogoutUser']=function(_0x4b1afc){var _0x516df4=this;return new Promise(function(_0x54ba4d,_0x13f48e){var _0x187236;return db[_0x0ff1('0xc')][_0x0ff1('0x40')]({'where':_0x4b1afc[_0x0ff1('0xd')][_0x0ff1('0xe')]||{},'attributes':['id',_0x0ff1('0x1d')]})[_0x0ff1('0x14')](function(_0x322803){if(_0x322803){_0x187236=_0x322803;return db[_0x0ff1('0x22')][_0x0ff1('0x41')]({'where':{'membername':_0x187236[_0x0ff1('0x1d')]},'individualHooks':!![]});}})[_0x0ff1('0x14')](function(){if(_0x187236){return db[_0x0ff1('0x23')][_0x0ff1('0x24')]({'where':{'membername':_0x187236[_0x0ff1('0x1d')],'exitAt':null}});}})[_0x0ff1('0x14')](function(_0x2a37de){if(_0x187236){if(_0x2a37de&&_0x2a37de[_0x0ff1('0x26')]){var _0x3d8977=[];_0x2a37de[_0x0ff1('0x42')](function(_0x3ea759){_0x3d8977[_0x0ff1('0x2a')](_0x3ea759['update']({'exitAt':moment()[_0x0ff1('0x20')](_0x0ff1('0x27'))}));});return BPromise[_0x0ff1('0x43')](_0x3d8977);}}})[_0x0ff1('0x14')](function(){if(_0x187236){return _0x187236['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x0ff1('0x14')](function(_0x295dca){_0x54ba4d(_0x295dca);})[_0x0ff1('0x16')](function(_0x3b2c34){_0x13f48e(_0x516df4['error'](0x1f4,_0x3b2c34[_0x0ff1('0x18')]));});});};exports[_0x0ff1('0x44')]=function(_0x44d9a7){var _0x360ffa=this;return new Promise(function(_0x57f788,_0x29251e){var _0x5f04b3;var _0x78a6f0;var _0x17210c;var _0x3c1423;return db['User']['findOne']({'where':_0x44d9a7[_0x0ff1('0xd')]['where']||{},'attributes':['id','name','role',_0x0ff1('0x45'),'phone','internal',_0x0ff1('0x46'),_0x0ff1('0x2b')]})[_0x0ff1('0x14')](function(_0x59bedb){if(_0x59bedb){_0x5f04b3=_0x59bedb;_0x3c1423=_0x44d9a7[_0x0ff1('0x2c')][_0x0ff1('0x2b')]?_0x44d9a7[_0x0ff1('0x2c')]['interface']:util[_0x0ff1('0x20')]('SIP/%s',_0x5f04b3['name']);return db['User'][_0x0ff1('0x47')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x5f04b3['id']}}});}})[_0x0ff1('0x14')](function(_0xc6e46){if(_0xc6e46){_0x17210c=_0xc6e46;return require(_0x0ff1('0x48'))[_0x0ff1('0x49')]();}})[_0x0ff1('0x14')](function(_0x17f7dd){if(_0x17f7dd&&_0x17f7dd[_0x0ff1('0x4a')]&&_0x17210c>=_0x17f7dd[_0x0ff1('0x4a')]){throw new Error(_0x0ff1('0x4b'));}})[_0x0ff1('0x14')](function(){if(_0x5f04b3){return db[_0x0ff1('0x22')][_0x0ff1('0x41')]({'where':{'membername':_0x5f04b3[_0x0ff1('0x1d')]},'individualHooks':!![]});}})['then'](function(){if(_0x5f04b3){return _0x5f04b3['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x53b248){if(_0x5f04b3){if(_0x53b248){var _0x4ececc=[];_0x78a6f0=_0x53b248;if(_0x78a6f0['length']){for(var _0x20138e=0x0;_0x20138e<_0x78a6f0[_0x0ff1('0x26')];_0x20138e++){_0x4ececc[_0x0ff1('0x2a')](db['UserVoiceQueueRt'][_0x0ff1('0x4c')]({'membername':_0x5f04b3['name'],'UserId':_0x5f04b3['id'],'queue_name':_0x78a6f0[_0x20138e][_0x0ff1('0x1d')],'VoiceQueueId':_0x78a6f0[_0x20138e]['id'],'interface':_0x3c1423,'paused':_0x5f04b3['loginInPause']||![],'penalty':_0x78a6f0[_0x20138e][_0x0ff1('0x4d')]||0x0}));}return BPromise[_0x0ff1('0x43')](_0x4ececc);}}}})[_0x0ff1('0x14')](function(){if(_0x5f04b3){return db[_0x0ff1('0x23')][_0x0ff1('0x24')]({'where':{'membername':_0x5f04b3['name'],'exitAt':null}});}})[_0x0ff1('0x14')](function(_0x11990f){if(_0x5f04b3){if(_0x11990f&&_0x11990f['length']){var _0x1c197d=[];_0x11990f[_0x0ff1('0x42')](function(_0x15bd7c){_0x1c197d[_0x0ff1('0x2a')](_0x15bd7c['update']({'exitAt':moment()[_0x0ff1('0x20')](_0x0ff1('0x27'))}));});return BPromise[_0x0ff1('0x43')](_0x1c197d);}}})[_0x0ff1('0x14')](function(){if(_0x5f04b3){var _0x45e36a=[];var _0x6076bf=[];var _0x430165=utils['getChannels']();var _0xd1a86e={'membername':_0x5f04b3[_0x0ff1('0x1d')],'interface':_0x3c1423,'enterAt':moment()[_0x0ff1('0x20')](_0x0ff1('0x27')),'role':_0x5f04b3[_0x0ff1('0x1e')],'internal':_0x5f04b3[_0x0ff1('0x1f')]};_0x430165['forEach'](function(_0x5d4a8f){_0x45e36a[_0x0ff1('0x2a')](_['merge']({'channel':_0x5d4a8f,'type':_0x0ff1('0x4e'),'data1':_0x0ff1('0x4f'),'data2':_0x3c1423},_0xd1a86e));if(_0x5f04b3[_0x0ff1('0x46')]){_0x6076bf[_0x0ff1('0x2a')](_[_0x0ff1('0x50')]({'channel':_0x5d4a8f,'type':'PAUSE','data1':_0x0ff1('0x51')},_0xd1a86e));}});return db['MemberReport'][_0x0ff1('0x30')](_0x45e36a[_0x0ff1('0x52')](_0x6076bf),{'individualHooks':!![]});}})[_0x0ff1('0x14')](function(){if(_0x5f04b3){return _0x5f04b3[_0x0ff1('0x31')]({'online':!![],'lastLoginAt':moment()[_0x0ff1('0x20')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x5f04b3['loginInPause']||![],'mailPause':_0x5f04b3['loginInPause']||![],'chatPause':_0x5f04b3[_0x0ff1('0x46')]||![],'faxPause':_0x5f04b3[_0x0ff1('0x46')]||![],'smsPause':_0x5f04b3[_0x0ff1('0x46')]||![],'openchannelPause':_0x5f04b3[_0x0ff1('0x46')]||![],'pauseType':_0x5f04b3[_0x0ff1('0x46')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x0ff1('0x20')](_0x0ff1('0x27')),'interface':_0x3c1423});}})[_0x0ff1('0x14')](function(_0x2e44dd){_0x57f788(_0x2e44dd);})[_0x0ff1('0x16')](function(_0x13c61b){_0x29251e(_0x360ffa[_0x0ff1('0x17')](0x1f4,_0x13c61b['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index e267d28..bb991bd 100644 --- a/server/api/user/user.socket.js +++ b/server/api/user/user.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe9b1=['removeListener','register','length','user:','save','emit'];(function(_0x44ad4b,_0x13ccad){var _0x4c0516=function(_0x1a841e){while(--_0x1a841e){_0x44ad4b['push'](_0x44ad4b['shift']());}};_0x4c0516(++_0x13ccad);}(_0xe9b1,0xc4));var _0x1e9b=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xe9b1[_0x1beef3];return _0x5af964;};'use strict';var UserEvents=require('./user.events');var events=[_0x1e9b('0x0'),'remove','update'];function createListener(_0x564100,_0x14a6bc){return function(_0x222dd8){_0x14a6bc[_0x1e9b('0x1')](_0x564100,_0x222dd8);};}function removeListener(_0x1f2037,_0x2fbea1){return function(){UserEvents[_0x1e9b('0x2')](_0x1f2037,_0x2fbea1);};}exports[_0x1e9b('0x3')]=function(_0x5d4bfd){for(var _0xb9456a=0x0,_0x18887e=events[_0x1e9b('0x4')];_0xb9456a<_0x18887e;_0xb9456a++){var _0x483439=events[_0xb9456a];var _0x2e94d2=createListener(_0x1e9b('0x5')+_0x483439,_0x5d4bfd);UserEvents['on'](_0x483439,_0x2e94d2);}}; \ No newline at end of file +var _0xd58e=['update','emit','removeListener','register','length','user:','./user.events','save','remove'];(function(_0x3b3613,_0x521e7a){var _0x1fc80d=function(_0x32e775){while(--_0x32e775){_0x3b3613['push'](_0x3b3613['shift']());}};_0x1fc80d(++_0x521e7a);}(_0xd58e,0x19b));var _0xed58=function(_0x3f574f,_0x51bad2){_0x3f574f=_0x3f574f-0x0;var _0x4b0397=_0xd58e[_0x3f574f];return _0x4b0397;};'use strict';var UserEvents=require(_0xed58('0x0'));var events=[_0xed58('0x1'),_0xed58('0x2'),_0xed58('0x3')];function createListener(_0x5e4aa4,_0x29db2d){return function(_0x31ff59){_0x29db2d[_0xed58('0x4')](_0x5e4aa4,_0x31ff59);};}function removeListener(_0xc79c64,_0x39d38d){return function(){UserEvents[_0xed58('0x5')](_0xc79c64,_0x39d38d);};}exports[_0xed58('0x6')]=function(_0xef7b10){for(var _0x429e88=0x0,_0x54643f=events[_0xed58('0x7')];_0x429e88<_0x54643f;_0x429e88++){var _0x391232=events[_0x429e88];var _0x3c773c=createListener(_0xed58('0x8')+_0x391232,_0xef7b10);UserEvents['on'](_0x391232,_0x3c773c);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 0a3d7b5..84b8d1f 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2a75cd,_0x247962){var _0x2319bc=function(_0x47d0c5){while(--_0x47d0c5){_0x2a75cd['push'](_0x2a75cd['shift']());}};_0x2319bc(++_0x247962);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3e4557,_0x2f7730){var _0x22e593=function(_0x5307da){while(--_0x5307da){_0x3e4557['push'](_0x3e4557['shift']());}};_0x22e593(++_0x2f7730);}(_0x70e0,0x17b));var _0x070e=function(_0x29e373,_0xace428){_0x29e373=_0x29e373-0x0;var _0xec976d=_0x70e0[_0x29e373];return _0xec976d;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index da99aba..a1377b4 100644 --- a/server/api/userChatQueue/userChatQueue.attributes.js +++ b/server/api/userChatQueue/userChatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5885=['exports','INTEGER','sequelize'];(function(_0x14d44f,_0x4e0e7a){var _0x238549=function(_0x461dfd){while(--_0x461dfd){_0x14d44f['push'](_0x14d44f['shift']());}};_0x238549(++_0x4e0e7a);}(_0x5885,0x1f1));var _0x5588=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5885[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x5588('0x0'));module[_0x5588('0x1')]={'penalty':{'type':Sequelize[_0x5588('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0b5b=['INTEGER','exports'];(function(_0x47c894,_0x22cdc1){var _0xdab4b7=function(_0x2cf3c6){while(--_0x2cf3c6){_0x47c894['push'](_0x47c894['shift']());}};_0xdab4b7(++_0x22cdc1);}(_0x0b5b,0x147));var _0xb0b5=function(_0x5b485f,_0x3ca456){_0x5b485f=_0x5b485f-0x0;var _0x262f45=_0x0b5b[_0x5b485f];return _0x262f45;};'use strict';var Sequelize=require('sequelize');module[_0xb0b5('0x0')]={'penalty':{'type':Sequelize[_0xb0b5('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index eeef7f1..6beb4e0 100644 --- a/server/api/userChatQueue/userChatQueue.model.js +++ b/server/api/userChatQueue/userChatQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4256=['../../config/environment','UserChatQueue','user_has_chat_queues','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x4ce67e,_0x53e4bf){var _0x103349=function(_0x305233){while(--_0x305233){_0x4ce67e['push'](_0x4ce67e['shift']());}};_0x103349(++_0x53e4bf);}(_0x4256,0xf6));var _0x6425=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0x4256[_0xd22d95];return _0x15d7a3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6425('0x0'))(_0x6425('0x1'));var moment=require(_0x6425('0x2'));var BPromise=require(_0x6425('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6425('0x4'));var rimraf=require(_0x6425('0x5'));var config=require(_0x6425('0x6'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x1b42f8,_0x57f938){return _0x1b42f8['define'](_0x6425('0x7'),attributes,{'tableName':_0x6425('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda6b=['moment','path','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xda6b,0xad));var _0xbda6=function(_0x4f4a70,_0x4ed866){_0x4f4a70=_0x4f4a70-0x0;var _0x531f5a=_0xda6b[_0x4f4a70];return _0x531f5a;};'use strict';var _=require(_0xbda6('0x0'));var util=require('util');var logger=require(_0xbda6('0x1'))(_0xbda6('0x2'));var moment=require(_0xbda6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbda6('0x4'));var rimraf=require('rimraf');var config=require(_0xbda6('0x5'));var attributes=require(_0xbda6('0x6'));module[_0xbda6('0x7')]=function(_0xc2131a,_0x286eca){return _0xc2131a[_0xbda6('0x8')](_0xbda6('0x9'),attributes,{'tableName':_0xbda6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 8e77e52..7bfcc5f 100644 --- a/server/api/userChatQueue/userChatQueue.rpc.js +++ b/server/api/userChatQueue/userChatQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c77=['info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x53fced,_0x648397){var _0x561e1d=function(_0x34e3f8){while(--_0x34e3f8){_0x53fced['push'](_0x53fced['shift']());}};_0x561e1d(++_0x648397);}(_0x1c77,0x111));var _0x71c7=function(_0x29a29f,_0x155ce7){_0x29a29f=_0x29a29f-0x0;var _0x443ea3=_0x1c77[_0x29a29f];return _0x443ea3;};'use strict';var _=require(_0x71c7('0x0'));var util=require(_0x71c7('0x1'));var moment=require(_0x71c7('0x2'));var BPromise=require(_0x71c7('0x3'));var rs=require(_0x71c7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71c7('0x5'))['db'];var utils=require(_0x71c7('0x6'));var logger=require(_0x71c7('0x7'))(_0x71c7('0x8'));var config=require(_0x71c7('0x9'));var jayson=require(_0x71c7('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x525440,_0x55f048,_0x538c9d){return new BPromise(function(_0xcd3b49,_0x2022a9){return client[_0x71c7('0xb')](_0x525440,_0x538c9d)[_0x71c7('0xc')](function(_0x1c1927){logger[_0x71c7('0xd')](_0x71c7('0xe'),_0x55f048,_0x71c7('0xf'));logger[_0x71c7('0x10')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x55f048,_0x71c7('0xf'),JSON['stringify'](_0x1c1927));if(_0x1c1927[_0x71c7('0x11')]){if(_0x1c1927[_0x71c7('0x11')][_0x71c7('0x12')]===0x1f4){logger['error'](_0x71c7('0xe'),_0x55f048,_0x1c1927[_0x71c7('0x11')][_0x71c7('0x13')]);return _0x2022a9(_0x1c1927[_0x71c7('0x11')][_0x71c7('0x13')]);}logger[_0x71c7('0x11')](_0x71c7('0xe'),_0x55f048,_0x1c1927[_0x71c7('0x11')][_0x71c7('0x13')]);return _0xcd3b49(_0x1c1927[_0x71c7('0x11')][_0x71c7('0x13')]);}else{logger['info'](_0x71c7('0xe'),_0x55f048,_0x71c7('0xf'));_0xcd3b49(_0x1c1927[_0x71c7('0x14')]['message']);}})[_0x71c7('0x15')](function(_0x14bad2){logger['error'](_0x71c7('0xe'),_0x55f048,_0x14bad2);_0x2022a9(_0x14bad2);});});} \ No newline at end of file +var _0x5a9f=['UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x40de39,_0x200789){var _0x297839=function(_0x3ed462){while(--_0x3ed462){_0x40de39['push'](_0x40de39['shift']());}};_0x297839(++_0x200789);}(_0x5a9f,0x8d));var _0xf5a9=function(_0x1dd7e6,_0x45d47e){_0x1dd7e6=_0x1dd7e6-0x0;var _0x29ebbc=_0x5a9f[_0x1dd7e6];return _0x29ebbc;};'use strict';var _=require(_0xf5a9('0x0'));var util=require('util');var moment=require(_0xf5a9('0x1'));var BPromise=require(_0xf5a9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5a9('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf5a9('0x4'));var config=require(_0xf5a9('0x5'));var jayson=require(_0xf5a9('0x6'));var client=jayson['client'][_0xf5a9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ccdf0,_0x19065d,_0x3dabc8){return new BPromise(function(_0x264cc1,_0x273af3){return client[_0xf5a9('0x8')](_0x2ccdf0,_0x3dabc8)[_0xf5a9('0x9')](function(_0x5c603a){logger[_0xf5a9('0xa')](_0xf5a9('0xb'),_0x19065d,_0xf5a9('0xc'));logger[_0xf5a9('0xd')](_0xf5a9('0xe'),_0x19065d,_0xf5a9('0xc'),JSON['stringify'](_0x5c603a));if(_0x5c603a['error']){if(_0x5c603a[_0xf5a9('0xf')][_0xf5a9('0x10')]===0x1f4){logger[_0xf5a9('0xf')](_0xf5a9('0xb'),_0x19065d,_0x5c603a[_0xf5a9('0xf')]['message']);return _0x273af3(_0x5c603a[_0xf5a9('0xf')]['message']);}logger[_0xf5a9('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x19065d,_0x5c603a[_0xf5a9('0xf')][_0xf5a9('0x11')]);return _0x264cc1(_0x5c603a[_0xf5a9('0xf')][_0xf5a9('0x11')]);}else{logger['info'](_0xf5a9('0xb'),_0x19065d,_0xf5a9('0xc'));_0x264cc1(_0x5c603a[_0xf5a9('0x12')][_0xf5a9('0x11')]);}})['catch'](function(_0x4a9eab){logger[_0xf5a9('0xf')](_0xf5a9('0xb'),_0x19065d,_0x4a9eab);_0x273af3(_0x4a9eab);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index a345138..92b0023 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x30471a,_0x4825b2){var _0xdb9d5e=function(_0x4a2d78){while(--_0x4a2d78){_0x30471a['push'](_0x30471a['shift']());}};_0xdb9d5e(++_0x4825b2);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xc782d3,_0x28a86c){var _0x510d56=function(_0x8b18a3){while(--_0x8b18a3){_0xc782d3['push'](_0xc782d3['shift']());}};_0x510d56(++_0x28a86c);}(_0xe706,0xa3));var _0x6e70=function(_0x260ce2,_0x2e22b8){_0x260ce2=_0x260ce2-0x0;var _0x16b105=_0xe706[_0x260ce2];return _0x16b105;};'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 diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index b6eb14c..3d9e8bd 100644 --- a/server/api/userFaxQueue/userFaxQueue.attributes.js +++ b/server/api/userFaxQueue/userFaxQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89cc=['INTEGER','sequelize','exports'];(function(_0x5d28f4,_0x1cb121){var _0x377447=function(_0x541cc7){while(--_0x541cc7){_0x5d28f4['push'](_0x5d28f4['shift']());}};_0x377447(++_0x1cb121);}(_0x89cc,0x109));var _0xc89c=function(_0x27276d,_0x1fb889){_0x27276d=_0x27276d-0x0;var _0x35f7a1=_0x89cc[_0x27276d];return _0x35f7a1;};'use strict';var Sequelize=require(_0xc89c('0x0'));module[_0xc89c('0x1')]={'penalty':{'type':Sequelize[_0xc89c('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc89c('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8a43=['INTEGER','STRING','sequelize','exports'];(function(_0x147497,_0x43e433){var _0x35f45=function(_0x584421){while(--_0x584421){_0x147497['push'](_0x147497['shift']());}};_0x35f45(++_0x43e433);}(_0x8a43,0x15a));var _0x38a4=function(_0x52ec57,_0x5a25a5){_0x52ec57=_0x52ec57-0x0;var _0x2212f1=_0x8a43[_0x52ec57];return _0x2212f1;};'use strict';var Sequelize=require(_0x38a4('0x0'));module[_0x38a4('0x1')]={'penalty':{'type':Sequelize[_0x38a4('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x38a4('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x38a4('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 43e3f31..20fbbe7 100644 --- a/server/api/userFaxQueue/userFaxQueue.model.js +++ b/server/api/userFaxQueue/userFaxQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb207=['user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','exports','define'];(function(_0x50e0b4,_0x1057f7){var _0x2fa8b0=function(_0x3766bc){while(--_0x3766bc){_0x50e0b4['push'](_0x50e0b4['shift']());}};_0x2fa8b0(++_0x1057f7);}(_0xb207,0x17a));var _0x7b20=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xb207[_0xe66cf2];return _0x2d84e7;};'use strict';var _=require(_0x7b20('0x0'));var util=require(_0x7b20('0x1'));var logger=require(_0x7b20('0x2'))(_0x7b20('0x3'));var moment=require(_0x7b20('0x4'));var BPromise=require(_0x7b20('0x5'));var rp=require(_0x7b20('0x6'));var fs=require('fs');var path=require(_0x7b20('0x7'));var rimraf=require('rimraf');var config=require(_0x7b20('0x8'));var attributes=require(_0x7b20('0x9'));module[_0x7b20('0xa')]=function(_0x25cc59,_0x59c74c){return _0x25cc59[_0x7b20('0xb')]('UserFaxQueue',attributes,{'tableName':_0x7b20('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa34e=['exports','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0x110ab7,_0x3e61a9){var _0x1fed2a=function(_0x2fec4f){while(--_0x2fec4f){_0x110ab7['push'](_0x110ab7['shift']());}};_0x1fed2a(++_0x3e61a9);}(_0xa34e,0x18b));var _0xea34=function(_0x4218d0,_0x18aa4c){_0x4218d0=_0x4218d0-0x0;var _0x2c142c=_0xa34e[_0x4218d0];return _0x2c142c;};'use strict';var _=require(_0xea34('0x0'));var util=require(_0xea34('0x1'));var logger=require(_0xea34('0x2'))(_0xea34('0x3'));var moment=require(_0xea34('0x4'));var BPromise=require(_0xea34('0x5'));var rp=require(_0xea34('0x6'));var fs=require('fs');var path=require(_0xea34('0x7'));var rimraf=require(_0xea34('0x8'));var config=require(_0xea34('0x9'));var attributes=require(_0xea34('0xa'));module[_0xea34('0xb')]=function(_0x4a6039,_0x2a41a7){return _0x4a6039['define'](_0xea34('0xc'),attributes,{'tableName':_0xea34('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 3e92f5e..45a858c 100644 --- a/server/api/userFaxQueue/userFaxQueue.rpc.js +++ b/server/api/userFaxQueue/userFaxQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7c0=['request','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4653f7,_0x3d3ae3){var _0x5454da=function(_0x448f55){while(--_0x448f55){_0x4653f7['push'](_0x4653f7['shift']());}};_0x5454da(++_0x3d3ae3);}(_0xd7c0,0xa5));var _0x0d7c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xd7c0[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x0d7c('0x0'));var util=require('util');var moment=require(_0x0d7c('0x1'));var BPromise=require('bluebird');var rs=require(_0x0d7c('0x2'));var fs=require('fs');var Redis=require(_0x0d7c('0x3'));var db=require(_0x0d7c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d7c('0x5'))(_0x0d7c('0x6'));var config=require(_0x0d7c('0x7'));var jayson=require(_0x0d7c('0x8'));var client=jayson[_0x0d7c('0x9')][_0x0d7c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57c620,_0x32fb52,_0x45620e){return new BPromise(function(_0x2db6b6,_0x377c06){return client[_0x0d7c('0xb')](_0x57c620,_0x45620e)['then'](function(_0xf6baa5){logger['info'](_0x0d7c('0xc'),_0x32fb52,_0x0d7c('0xd'));logger['debug'](_0x0d7c('0xe'),_0x32fb52,_0x0d7c('0xd'),JSON[_0x0d7c('0xf')](_0xf6baa5));if(_0xf6baa5[_0x0d7c('0x10')]){if(_0xf6baa5[_0x0d7c('0x10')][_0x0d7c('0x11')]===0x1f4){logger[_0x0d7c('0x10')](_0x0d7c('0xc'),_0x32fb52,_0xf6baa5[_0x0d7c('0x10')]['message']);return _0x377c06(_0xf6baa5[_0x0d7c('0x10')][_0x0d7c('0x12')]);}logger['error'](_0x0d7c('0xc'),_0x32fb52,_0xf6baa5[_0x0d7c('0x10')][_0x0d7c('0x12')]);return _0x2db6b6(_0xf6baa5[_0x0d7c('0x10')][_0x0d7c('0x12')]);}else{logger[_0x0d7c('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x32fb52,'request\x20sent');_0x2db6b6(_0xf6baa5[_0x0d7c('0x14')]['message']);}})[_0x0d7c('0x15')](function(_0x19fc6f){logger[_0x0d7c('0x10')](_0x0d7c('0xc'),_0x32fb52,_0x19fc6f);_0x377c06(_0x19fc6f);});});} \ No newline at end of file +var _0xd6b6=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','randomstring','ioredis'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd6b6,0x18c));var _0x6d6b=function(_0x3a01be,_0x1ab778){_0x3a01be=_0x3a01be-0x0;var _0x4d2615=_0xd6b6[_0x3a01be];return _0x4d2615;};'use strict';var _=require(_0x6d6b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6d6b('0x1'));var fs=require('fs');var Redis=require(_0x6d6b('0x2'));var db=require(_0x6d6b('0x3'))['db'];var utils=require(_0x6d6b('0x4'));var logger=require(_0x6d6b('0x5'))(_0x6d6b('0x6'));var config=require(_0x6d6b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6d6b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x56664f,_0x4c0cad,_0x23e0c0){return new BPromise(function(_0x8615e2,_0x28602f){return client[_0x6d6b('0x9')](_0x56664f,_0x23e0c0)['then'](function(_0x276d89){logger['info'](_0x6d6b('0xa'),_0x4c0cad,_0x6d6b('0xb'));logger[_0x6d6b('0xc')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x4c0cad,_0x6d6b('0xb'),JSON[_0x6d6b('0xd')](_0x276d89));if(_0x276d89['error']){if(_0x276d89[_0x6d6b('0xe')]['code']===0x1f4){logger['error'](_0x6d6b('0xa'),_0x4c0cad,_0x276d89[_0x6d6b('0xe')][_0x6d6b('0xf')]);return _0x28602f(_0x276d89['error']['message']);}logger[_0x6d6b('0xe')](_0x6d6b('0xa'),_0x4c0cad,_0x276d89[_0x6d6b('0xe')][_0x6d6b('0xf')]);return _0x8615e2(_0x276d89[_0x6d6b('0xe')][_0x6d6b('0xf')]);}else{logger[_0x6d6b('0x10')](_0x6d6b('0xa'),_0x4c0cad,'request\x20sent');_0x8615e2(_0x276d89[_0x6d6b('0x11')][_0x6d6b('0xf')]);}})[_0x6d6b('0x12')](function(_0x4f4962){logger[_0x6d6b('0xe')](_0x6d6b('0xa'),_0x4c0cad,_0x4f4962);_0x28602f(_0x4f4962);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 7cda1c6..0db4ade 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4f8072,_0x490a73){var _0xb2d4ba=function(_0xdf8f29){while(--_0xdf8f29){_0x4f8072['push'](_0x4f8072['shift']());}};_0xb2d4ba(++_0x490a73);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x50de2e,_0x374fa8){var _0x510f2f=function(_0x35f73b){while(--_0x35f73b){_0x50de2e['push'](_0x50de2e['shift']());}};_0x510f2f(++_0x374fa8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x19691f,_0x159737){_0x19691f=_0x19691f-0x0;var _0x5677b6=_0xcb91[_0x19691f];return _0x5677b6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 053e4a3..31ea675 100644 --- a/server/api/userMailQueue/userMailQueue.attributes.js +++ b/server/api/userMailQueue/userMailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46e0=['INTEGER','sequelize','exports'];(function(_0x583e84,_0xda5b0c){var _0x3f8d93=function(_0x4579cb){while(--_0x4579cb){_0x583e84['push'](_0x583e84['shift']());}};_0x3f8d93(++_0xda5b0c);}(_0x46e0,0x1c3));var _0x046e=function(_0x54c27b,_0x2333f7){_0x54c27b=_0x54c27b-0x0;var _0x365557=_0x46e0[_0x54c27b];return _0x365557;};'use strict';var Sequelize=require(_0x046e('0x0'));module[_0x046e('0x1')]={'penalty':{'type':Sequelize[_0x046e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x20c3=['sequelize','exports','INTEGER'];(function(_0x485d46,_0x5b3dac){var _0x45eeca=function(_0x3ddbbb){while(--_0x3ddbbb){_0x485d46['push'](_0x485d46['shift']());}};_0x45eeca(++_0x5b3dac);}(_0x20c3,0x1b0));var _0x320c=function(_0x1d47a9,_0x28c6cd){_0x1d47a9=_0x1d47a9-0x0;var _0x5da009=_0x20c3[_0x1d47a9];return _0x5da009;};'use strict';var Sequelize=require(_0x320c('0x0'));module[_0x320c('0x1')]={'penalty':{'type':Sequelize[_0x320c('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 7e94739..4508dd6 100644 --- a/server/api/userMailQueue/userMailQueue.model.js +++ b/server/api/userMailQueue/userMailQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x76a4=['define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','bluebird','request-promise','rimraf','./userMailQueue.attributes'];(function(_0x4ce1ba,_0x436e9f){var _0x3b4ce7=function(_0x51fcac){while(--_0x51fcac){_0x4ce1ba['push'](_0x4ce1ba['shift']());}};_0x3b4ce7(++_0x436e9f);}(_0x76a4,0x107));var _0x476a=function(_0x42e07f,_0x393196){_0x42e07f=_0x42e07f-0x0;var _0x358915=_0x76a4[_0x42e07f];return _0x358915;};'use strict';var _=require(_0x476a('0x0'));var util=require(_0x476a('0x1'));var logger=require(_0x476a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x476a('0x3'));var rp=require(_0x476a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x476a('0x5'));var config=require('../../config/environment');var attributes=require(_0x476a('0x6'));module['exports']=function(_0x375c75,_0x44da77){return _0x375c75[_0x476a('0x7')](_0x476a('0x8'),attributes,{'tableName':_0x476a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x933d=['./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','api','moment','bluebird','path','../../config/environment'];(function(_0x50b6cd,_0x428332){var _0x289d3d=function(_0x32e628){while(--_0x32e628){_0x50b6cd['push'](_0x50b6cd['shift']());}};_0x289d3d(++_0x428332);}(_0x933d,0x191));var _0xd933=function(_0x27ad21,_0x295336){_0x27ad21=_0x27ad21-0x0;var _0x3deb2e=_0x933d[_0x27ad21];return _0x3deb2e;};'use strict';var _=require(_0xd933('0x0'));var util=require(_0xd933('0x1'));var logger=require('../../config/logger')(_0xd933('0x2'));var moment=require(_0xd933('0x3'));var BPromise=require(_0xd933('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd933('0x5'));var rimraf=require('rimraf');var config=require(_0xd933('0x6'));var attributes=require(_0xd933('0x7'));module[_0xd933('0x8')]=function(_0x4c8135,_0x3f37a7){return _0x4c8135[_0xd933('0x9')](_0xd933('0xa'),attributes,{'tableName':_0xd933('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index ddacea2..d16f788 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x291777,_0x4568cc){var _0x3e1f74=function(_0x108155){while(--_0x108155){_0x291777['push'](_0x291777['shift']());}};_0x3e1f74(++_0x4568cc);}(_0x3e74,0x175));var _0x43e7=function(_0x40f47c,_0x53db27){_0x40f47c=_0x40f47c-0x0;var _0x42b620=_0x3e74[_0x40f47c];return _0x42b620;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file +var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1409f7,_0x2cdfc6){var _0x304ed9=function(_0x48576c){while(--_0x48576c){_0x1409f7['push'](_0x1409f7['shift']());}};_0x304ed9(++_0x2cdfc6);}(_0x6aa7,0x178));var _0x76aa=function(_0x1ccc03,_0x2b4bcb){_0x1ccc03=_0x1ccc03-0x0;var _0x4f335a=_0x6aa7[_0x1ccc03];return _0x4f335a;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 6f64818..534faac 100644 --- a/server/api/userNotification/index.js +++ b/server/api/userNotification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d8f=['path','connect-timeout','express','../../components/auth/service','../../config/environment','post','isAuthenticated','sendUserNotification','exports','multer','util'];(function(_0x1c7889,_0x24cd26){var _0x2f14e5=function(_0x9ae1b1){while(--_0x9ae1b1){_0x1c7889['push'](_0x1c7889['shift']());}};_0x2f14e5(++_0x24cd26);}(_0x1d8f,0x1ed));var _0xf1d8=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1d8f[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0xf1d8('0x0'));var util=require(_0xf1d8('0x1'));var path=require(_0xf1d8('0x2'));var timeout=require(_0xf1d8('0x3'));var express=require(_0xf1d8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf1d8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf1d8('0x6'));var controller=require('./userNotification.controller');router[_0xf1d8('0x7')]('/',auth[_0xf1d8('0x8')](),controller[_0xf1d8('0x9')]);module[_0xf1d8('0xa')]=router; \ No newline at end of file +var _0xf886=['path','express','Router','../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer'];(function(_0xd4636c,_0x34dbf6){var _0x5ee17d=function(_0x223c38){while(--_0x223c38){_0xd4636c['push'](_0xd4636c['shift']());}};_0x5ee17d(++_0x34dbf6);}(_0xf886,0xb3));var _0x6f88=function(_0xbf09ab,_0x251a19){_0xbf09ab=_0xbf09ab-0x0;var _0x2a9aef=_0xf886[_0xbf09ab];return _0x2a9aef;};'use strict';var multer=require(_0x6f88('0x0'));var util=require('util');var path=require(_0x6f88('0x1'));var timeout=require('connect-timeout');var express=require(_0x6f88('0x2'));var router=express[_0x6f88('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6f88('0x4'));var interaction=require(_0x6f88('0x5'));var config=require('../../config/environment');var controller=require(_0x6f88('0x6'));router[_0x6f88('0x7')]('/',auth[_0x6f88('0x8')](),controller[_0x6f88('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 6a941f0..8ac5aeb 100644 --- a/server/api/userNotification/userNotification.attributes.js +++ b/server/api/userNotification/userNotification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd65=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xbd65,0xc6));var _0x5bd6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xbd65[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x5bd6('0x0'));module[_0x5bd6('0x1')]={'body':{'type':Sequelize[_0x5bd6('0x2')]},'senderName':{'type':Sequelize[_0x5bd6('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x5bd6('0x4')]}}; \ No newline at end of file +var _0xfdb5=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x3c7e26,_0x3cc265){var _0x530070=function(_0x5e8036){while(--_0x5e8036){_0x3c7e26['push'](_0x3c7e26['shift']());}};_0x530070(++_0x3cc265);}(_0xfdb5,0x194));var _0x5fdb=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0xfdb5[_0x368fb9];return _0x4892fb;};'use strict';var Sequelize=require(_0x5fdb('0x0'));module[_0x5fdb('0x1')]={'body':{'type':Sequelize[_0x5fdb('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x5fdb('0x2')]},'recipientsDescription':{'type':Sequelize[_0x5fdb('0x3')]},'beep':{'type':Sequelize[_0x5fdb('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 0045b6c..353dc94 100644 --- a/server/api/userNotification/userNotification.controller.js +++ b/server/api/userNotification/userNotification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc47e=['./userNotification.socket','register','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','sendStatus','error','stack','name','send','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','view','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','openchannelqueue','user','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','sequelize','UserNotification','create','forEach','emit','userNotification:send','catch','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','toLowerCase','User','queue','replace','Queue','ids','all','eml-format','rimraf','zip-dir','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter'];(function(_0x4af8e1,_0xff0618){var _0x22f628=function(_0x5e099c){while(--_0x5e099c){_0x4af8e1['push'](_0x4af8e1['shift']());}};_0x22f628(++_0xff0618);}(_0xc47e,0x198));var _0xec47=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xc47e[_0x47fd36];return _0x21a0fc;};'use strict';var emlformat=require(_0xec47('0x0'));var rimraf=require(_0xec47('0x1'));var zipdir=require(_0xec47('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xec47('0x3'));var util=require('util');var path=require(_0xec47('0x4'));var sox=require(_0xec47('0x5'));var csv=require(_0xec47('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec47('0x7'));var _=require(_0xec47('0x8'));var squel=require(_0xec47('0x9'));var crypto=require(_0xec47('0xa'));var jsforce=require(_0xec47('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xec47('0x6'));var querystring=require(_0xec47('0xc'));var Papa=require(_0xec47('0xd'));var Redis=require(_0xec47('0xe'));var authService=require(_0xec47('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xec47('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xec47('0x11'));var db=require(_0xec47('0x12'))['db'];config[_0xec47('0x13')]=_[_0xec47('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xec47('0x15'))(new Redis(config['redis']));require(_0xec47('0x16'))[_0xec47('0x17')](socket);function respondWithStatusCode(_0x409605,_0xdacfb1){_0xdacfb1=_0xdacfb1||0xcc;return function(_0x347e57){if(_0x347e57){return _0x409605['sendStatus'](_0xdacfb1);}return _0x409605[_0xec47('0x18')](_0xdacfb1)[_0xec47('0x19')]();};}function respondWithResult(_0x4f9012,_0x2ab34f){_0x2ab34f=_0x2ab34f||0xc8;return function(_0x30512e){if(_0x30512e){return _0x4f9012[_0xec47('0x18')](_0x2ab34f)[_0xec47('0x1a')](_0x30512e);}};}function respondWithFilteredResult(_0x656757,_0x1dc9f7){return function(_0x396aa2){if(_0x396aa2){var _0x3ffecc=typeof _0x1dc9f7[_0xec47('0x1b')]===_0xec47('0x1c')&&typeof _0x1dc9f7['limit']==='undefined';var _0x42fcf0=_0x396aa2[_0xec47('0x1d')];var _0xd2bc4b=_0x3ffecc?0x0:_0x1dc9f7[_0xec47('0x1b')];var _0x4cc6e1=_0x3ffecc?_0x396aa2[_0xec47('0x1d')]:_0x1dc9f7[_0xec47('0x1b')]+_0x1dc9f7[_0xec47('0x1e')];var _0x1aabf9;if(_0x4cc6e1>=_0x42fcf0){_0x4cc6e1=_0x42fcf0;_0x1aabf9=0xc8;}else{_0x1aabf9=0xce;}_0x656757[_0xec47('0x18')](_0x1aabf9);return _0x656757[_0xec47('0x1f')]('Content-Range',_0xd2bc4b+'-'+_0x4cc6e1+'/'+_0x42fcf0)['json'](_0x396aa2);}return null;};}function patchUpdates(_0x451ebd){return function(_0x5d1b39){try{jsonpatch[_0xec47('0x20')](_0x5d1b39,_0x451ebd,!![]);}catch(_0x31fea4){return BPromise['reject'](_0x31fea4);}return _0x5d1b39[_0xec47('0x21')]();};}function saveUpdates(_0x59b5d5,_0x407ab8){return function(_0x3fd907){if(_0x3fd907){return _0x3fd907[_0xec47('0x22')](_0x59b5d5)[_0xec47('0x23')](function(_0x55a594){return _0x55a594;});}return null;};}function removeEntity(_0x5ac48a,_0x3492ae){return function(_0x365a52){if(_0x365a52){return _0x365a52[_0xec47('0x24')]()[_0xec47('0x23')](function(){_0x5ac48a[_0xec47('0x18')](0xcc)[_0xec47('0x19')]();});}};}function handleEntityNotFound(_0xa6e2c8,_0x3c45b5){return function(_0x1c0a74){if(!_0x1c0a74){_0xa6e2c8[_0xec47('0x25')](0x194);}return _0x1c0a74;};}function handleError(_0x2e0080,_0x21175a){_0x21175a=_0x21175a||0x1f4;return function(_0x4e6f7d){logger[_0xec47('0x26')](_0x4e6f7d[_0xec47('0x27')]);if(_0x4e6f7d[_0xec47('0x28')]){delete _0x4e6f7d[_0xec47('0x28')];}_0x2e0080[_0xec47('0x18')](_0x21175a)[_0xec47('0x29')](_0x4e6f7d);};}exports['sendUserNotification']=function(_0x580614,_0x41c495,_0x4c9d22){if(!_0x580614[_0xec47('0x2a')][_0xec47('0x2b')](_0xec47('0x2c'))&&!_0x580614[_0xec47('0x2a')][_0xec47('0x2b')](_0xec47('0x2d'))){throw new db[(_0xec47('0x2e'))][(_0xec47('0x2f'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x580614[_0xec47('0x2a')][_0xec47('0x2b')](_0xec47('0x2d'))&&!_0x580614[_0xec47('0x2a')][_0xec47('0x2b')](_0xec47('0x30'))){throw new db[(_0xec47('0x2e'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x580614[_0xec47('0x2a')][_0xec47('0x2b')](_0xec47('0x31'))){throw new db[(_0xec47('0x2e'))][(_0xec47('0x2f'))](_0xec47('0x32'));}else{try{var _0x49ca3c=JSON[_0xec47('0x33')](_0x580614[_0xec47('0x2a')][_0xec47('0x31')]);}catch(_0x31e2a1){logger[_0xec47('0x26')](_0x31e2a1);throw new db[(_0xec47('0x2e'))]['ValidationError'](_0xec47('0x34'));}var _0x6bd110=[_0xec47('0x35'),'faxqueue','mailqueue',_0xec47('0x36'),'smsqueue','voicequeue','whatsappqueue','team',_0xec47('0x37')];if(_['some'](_0x49ca3c,function(_0x1d8849){return!_[_0xec47('0x38')](_0x6bd110,_0x1d8849[_0xec47('0x39')]['toLowerCase']());})){throw new db[(_0xec47('0x2e'))]['ValidationError'](_0xec47('0x3a'));}}}var _0x27e3c5={};_0x27e3c5[_0xec47('0x3b')]=_0x580614['body'][_0xec47('0x2b')](_0xec47('0x3b'))?_0x580614[_0xec47('0x2a')][_0xec47('0x3b')]:_0x580614[_0xec47('0x37')][_0xec47('0x3c')];_0x27e3c5[_0xec47('0x3d')]=_[_0xec47('0x3e')](_0x580614['body'][_0xec47('0x3d')])?null:_0x580614[_0xec47('0x2a')]['recipientsDescription'];_0x27e3c5[_0xec47('0x3f')]=_0x580614[_0xec47('0x2a')]['beep']||![];_0x27e3c5[_0xec47('0x40')]=_0x580614[_0xec47('0x37')]['id'];return getContent(_0x580614[_0xec47('0x2a')])['then'](function(_0x197763){_0x27e3c5['body']=_0x197763;return getRecipients(_0x49ca3c);})[_0xec47('0x23')](function(_0x1be470){_0x27e3c5[_0xec47('0x41')]=_[_0xec47('0x42')](_0x1be470)['join'](',');return db[_0xec47('0x43')]['transaction'](function(_0x38024a){return db[_0xec47('0x44')][_0xec47('0x45')](_0x27e3c5,{'raw':!![],'transaction':_0x38024a})[_0xec47('0x23')](function(_0xd921de){var _0x962d13={'sender':_0x27e3c5[_0xec47('0x3b')],'description':_0x27e3c5[_0xec47('0x3d')],'content':_0x27e3c5[_0xec47('0x2a')],'beep':_0x27e3c5[_0xec47('0x3f')]};_0x1be470[_0xec47('0x46')](function(_0x401335){_0x962d13['recipient']=_0x401335;socket[_0xec47('0x47')](_0xec47('0x48'),_0x962d13);});return _0xd921de;});});})['then'](respondWithResult(_0x41c495,0xc9))[_0xec47('0x49')](handleError(_0x41c495,null));};function getContent(_0x1b12d){return new BPromise(function(_0x452f27,_0xaa685e){if(_0x1b12d['text']){_0x452f27(_0x1b12d['text']);return;}return db['Template'][_0xec47('0x4a')]({'attributes':['html'],'where':{'id':_0x1b12d['TemplateId']},'raw':!![]})['then'](function(_0xe17ce8){if(!_0xe17ce8)throw new db[(_0xec47('0x2e'))][(_0xec47('0x2f'))](_0xec47('0x4b'));var _0x16a779=Mustache[_0xec47('0x4c')](_0xe17ce8[_0xec47('0x4d')],_0x1b12d[_0xec47('0x30')]);_0x452f27(_0x16a779);})[_0xec47('0x49')](function(_0x290cf7){_0xaa685e(_0x290cf7);});});}function getRecipients(_0x47671e){return new BPromise(function(_0x3727ec,_0x102588){var _0x571ef9=[];var _0x53d87b=[];_0x47671e[_0xec47('0x46')](function(_0x39f267){var _0x317396=_[_0xec47('0x4e')](_0x39f267[_0xec47('0x39')][_0xec47('0x4f')]());if(_0x317396===_0xec47('0x50')){_0x571ef9=_['union'](_0x571ef9,_0x39f267['ids']);}else{if(_['includes'](_0x317396,_0xec47('0x51')))_0x317396=_0x317396[_0xec47('0x52')](_0xec47('0x51'),_0xec47('0x53'));_0x39f267[_0xec47('0x54')]['forEach'](function(_0x4badc3){_0x53d87b['push'](getAgents(_0x317396,_0x4badc3));});}});return BPromise[_0xec47('0x55')](_0x53d87b)[_0xec47('0x23')](function(_0x1ed6df){_0x571ef9=_['union'](_0x571ef9,_['flatten'](_0x1ed6df));_0x3727ec(_0x571ef9);})['catch'](function(_0x4210a7){_0x102588(_0x4210a7);});});}function getAgents(_0x32cdb5,_0x5c8102){return new BPromise(function(_0x3f0bff,_0xedca0e){return db[_0x32cdb5]['findOne']({'where':{'id':_0x5c8102}})[_0xec47('0x23')](function(_0x103994){return _0x103994['getAgents']({'attributes':['id'],'raw':!![]})[_0xec47('0x23')](function(_0x1c6e98){var _0x1548b3=_['map'](_0x1c6e98,'id');_0x3f0bff(_0x1548b3);});})[_0xec47('0x49')](function(_0x39e04f){_0xedca0e(_0x39e04f);});});} \ No newline at end of file +var _0xbefc=['recipients','ValidationError','Missing\x20\x27recipients\x27\x20parameter','error','Invalid\x20\x27recipients\x27\x20object','mailqueue','openchannelqueue','smsqueue','voicequeue','team','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','sequelize','UserNotification','create','forEach','emit','userNotification:send','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','view','catch','startCase','union','ids','queue','replace','Queue','push','flatten','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','redis','./userNotification.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','stack','name','sendUserNotification','body','hasOwnProperty','text','TemplateId','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Sequelize','Missing\x20\x27view\x27\x20parameter'];(function(_0x30b23c,_0x2368bc){var _0x4f247e=function(_0x407aea){while(--_0x407aea){_0x30b23c['push'](_0x30b23c['shift']());}};_0x4f247e(++_0x2368bc);}(_0xbefc,0x8b));var _0xcbef=function(_0xa9212,_0x574e08){_0xa9212=_0xa9212-0x0;var _0x1df65e=_0xbefc[_0xa9212];return _0x1df65e;};'use strict';var emlformat=require(_0xcbef('0x0'));var rimraf=require(_0xcbef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcbef('0x2'));var moment=require('moment');var BPromise=require(_0xcbef('0x3'));var Mustache=require(_0xcbef('0x4'));var util=require(_0xcbef('0x5'));var path=require(_0xcbef('0x6'));var sox=require(_0xcbef('0x7'));var csv=require('to-csv');var ejs=require(_0xcbef('0x8'));var fs=require('fs');var fs_extra=require(_0xcbef('0x9'));var _=require('lodash');var squel=require(_0xcbef('0xa'));var crypto=require('crypto');var jsforce=require(_0xcbef('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcbef('0xc'));var querystring=require(_0xcbef('0xd'));var Papa=require(_0xcbef('0xe'));var Redis=require(_0xcbef('0xf'));var authService=require(_0xcbef('0x10'));var qs=require(_0xcbef('0x11'));var as=require(_0xcbef('0x12'));var hardwareService=require(_0xcbef('0x13'));var logger=require('../../config/logger')(_0xcbef('0x14'));var utils=require(_0xcbef('0x15'));var config=require(_0xcbef('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbef('0x17'))['db'];config['redis']=_[_0xcbef('0x18')](config['redis'],{'host':_0xcbef('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcbef('0x1a')]));require(_0xcbef('0x1b'))[_0xcbef('0x1c')](socket);function respondWithStatusCode(_0x262aa5,_0x431e9e){_0x431e9e=_0x431e9e||0xcc;return function(_0x189eea){if(_0x189eea){return _0x262aa5[_0xcbef('0x1d')](_0x431e9e);}return _0x262aa5[_0xcbef('0x1e')](_0x431e9e)[_0xcbef('0x1f')]();};}function respondWithResult(_0x3027a6,_0x71e273){_0x71e273=_0x71e273||0xc8;return function(_0x4d41bc){if(_0x4d41bc){return _0x3027a6[_0xcbef('0x1e')](_0x71e273)[_0xcbef('0x20')](_0x4d41bc);}};}function respondWithFilteredResult(_0x4c016b,_0x110d91){return function(_0xa94af8){if(_0xa94af8){var _0x416841=typeof _0x110d91[_0xcbef('0x21')]==='undefined'&&typeof _0x110d91[_0xcbef('0x22')]===_0xcbef('0x23');var _0xcff468=_0xa94af8[_0xcbef('0x24')];var _0x3c87e8=_0x416841?0x0:_0x110d91['offset'];var _0xb1e42a=_0x416841?_0xa94af8[_0xcbef('0x24')]:_0x110d91['offset']+_0x110d91[_0xcbef('0x22')];var _0x24bf1f;if(_0xb1e42a>=_0xcff468){_0xb1e42a=_0xcff468;_0x24bf1f=0xc8;}else{_0x24bf1f=0xce;}_0x4c016b[_0xcbef('0x1e')](_0x24bf1f);return _0x4c016b[_0xcbef('0x25')](_0xcbef('0x26'),_0x3c87e8+'-'+_0xb1e42a+'/'+_0xcff468)[_0xcbef('0x20')](_0xa94af8);}return null;};}function patchUpdates(_0x5e1e51){return function(_0x1c7b12){try{jsonpatch[_0xcbef('0x27')](_0x1c7b12,_0x5e1e51,!![]);}catch(_0x62aac1){return BPromise[_0xcbef('0x28')](_0x62aac1);}return _0x1c7b12['save']();};}function saveUpdates(_0x46c94d,_0x25384a){return function(_0x59b09a){if(_0x59b09a){return _0x59b09a['update'](_0x46c94d)[_0xcbef('0x29')](function(_0xadc741){return _0xadc741;});}return null;};}function removeEntity(_0x3f1c78,_0x3e5ad1){return function(_0x120f68){if(_0x120f68){return _0x120f68[_0xcbef('0x2a')]()[_0xcbef('0x29')](function(){_0x3f1c78['status'](0xcc)[_0xcbef('0x1f')]();});}};}function handleEntityNotFound(_0x58fe57,_0x288bb5){return function(_0x54ea77){if(!_0x54ea77){_0x58fe57[_0xcbef('0x1d')](0x194);}return _0x54ea77;};}function handleError(_0xce556,_0x3a17de){_0x3a17de=_0x3a17de||0x1f4;return function(_0x20de1f){logger['error'](_0x20de1f[_0xcbef('0x2b')]);if(_0x20de1f[_0xcbef('0x2c')]){delete _0x20de1f[_0xcbef('0x2c')];}_0xce556['status'](_0x3a17de)['send'](_0x20de1f);};}exports[_0xcbef('0x2d')]=function(_0x42909a,_0x2520d5,_0x5d094d){if(!_0x42909a[_0xcbef('0x2e')][_0xcbef('0x2f')](_0xcbef('0x30'))&&!_0x42909a[_0xcbef('0x2e')]['hasOwnProperty'](_0xcbef('0x31'))){throw new db['Sequelize']['ValidationError'](_0xcbef('0x32'));}else{if(_0x42909a['body'][_0xcbef('0x2f')](_0xcbef('0x31'))&&!_0x42909a[_0xcbef('0x2e')]['hasOwnProperty']('view')){throw new db[(_0xcbef('0x33'))]['ValidationError'](_0xcbef('0x34'));}if(!_0x42909a[_0xcbef('0x2e')][_0xcbef('0x2f')](_0xcbef('0x35'))){throw new db[(_0xcbef('0x33'))][(_0xcbef('0x36'))](_0xcbef('0x37'));}else{try{var _0x252c3c=JSON['parse'](_0x42909a['body'][_0xcbef('0x35')]);}catch(_0x25b6aa){logger[_0xcbef('0x38')](_0x25b6aa);throw new db[(_0xcbef('0x33'))]['ValidationError'](_0xcbef('0x39'));}var _0x30a6b5=['chatqueue','faxqueue',_0xcbef('0x3a'),_0xcbef('0x3b'),_0xcbef('0x3c'),_0xcbef('0x3d'),'whatsappqueue',_0xcbef('0x3e'),_0xcbef('0x3f')];if(_['some'](_0x252c3c,function(_0x1ad109){return!_[_0xcbef('0x40')](_0x30a6b5,_0x1ad109[_0xcbef('0x41')][_0xcbef('0x42')]());})){throw new db[(_0xcbef('0x33'))][(_0xcbef('0x36'))](_0xcbef('0x43'));}}}var _0x2ac011={};_0x2ac011[_0xcbef('0x44')]=_0x42909a[_0xcbef('0x2e')][_0xcbef('0x2f')](_0xcbef('0x44'))?_0x42909a['body'][_0xcbef('0x44')]:_0x42909a[_0xcbef('0x3f')][_0xcbef('0x45')];_0x2ac011[_0xcbef('0x46')]=_['isEmpty'](_0x42909a[_0xcbef('0x2e')][_0xcbef('0x46')])?null:_0x42909a[_0xcbef('0x2e')][_0xcbef('0x46')];_0x2ac011[_0xcbef('0x47')]=_0x42909a['body']['beep']||![];_0x2ac011[_0xcbef('0x48')]=_0x42909a[_0xcbef('0x3f')]['id'];return getContent(_0x42909a[_0xcbef('0x2e')])[_0xcbef('0x29')](function(_0x1f1e61){_0x2ac011[_0xcbef('0x2e')]=_0x1f1e61;return getRecipients(_0x252c3c);})[_0xcbef('0x29')](function(_0xd5e430){_0x2ac011[_0xcbef('0x49')]=_[_0xcbef('0x4a')](_0xd5e430)['join'](',');return db[_0xcbef('0x4b')]['transaction'](function(_0x450fcf){return db[_0xcbef('0x4c')][_0xcbef('0x4d')](_0x2ac011,{'raw':!![],'transaction':_0x450fcf})['then'](function(_0x301134){var _0x18ef38={'sender':_0x2ac011[_0xcbef('0x44')],'description':_0x2ac011[_0xcbef('0x46')],'content':_0x2ac011[_0xcbef('0x2e')],'beep':_0x2ac011[_0xcbef('0x47')]};_0xd5e430[_0xcbef('0x4e')](function(_0x56f0da){_0x18ef38['recipient']=_0x56f0da;socket[_0xcbef('0x4f')](_0xcbef('0x50'),_0x18ef38);});return _0x301134;});});})[_0xcbef('0x29')](respondWithResult(_0x2520d5,0xc9))['catch'](handleError(_0x2520d5,null));};function getContent(_0x4d4282){return new BPromise(function(_0x34353c,_0x3eef29){if(_0x4d4282[_0xcbef('0x30')]){_0x34353c(_0x4d4282[_0xcbef('0x30')]);return;}return db[_0xcbef('0x51')][_0xcbef('0x52')]({'attributes':['html'],'where':{'id':_0x4d4282[_0xcbef('0x31')]},'raw':!![]})[_0xcbef('0x29')](function(_0x4b4a0e){if(!_0x4b4a0e)throw new db[(_0xcbef('0x33'))]['ValidationError'](_0xcbef('0x53'));var _0x14c367=Mustache[_0xcbef('0x54')](_0x4b4a0e[_0xcbef('0x55')],_0x4d4282[_0xcbef('0x56')]);_0x34353c(_0x14c367);})[_0xcbef('0x57')](function(_0x3699b0){_0x3eef29(_0x3699b0);});});}function getRecipients(_0x2f1aae){return new BPromise(function(_0x2aaf7b,_0x381a87){var _0x3f705f=[];var _0x5f84b6=[];_0x2f1aae[_0xcbef('0x4e')](function(_0x32b0e1){var _0x357749=_[_0xcbef('0x58')](_0x32b0e1[_0xcbef('0x41')][_0xcbef('0x42')]());if(_0x357749==='User'){_0x3f705f=_[_0xcbef('0x59')](_0x3f705f,_0x32b0e1[_0xcbef('0x5a')]);}else{if(_['includes'](_0x357749,_0xcbef('0x5b')))_0x357749=_0x357749[_0xcbef('0x5c')](_0xcbef('0x5b'),_0xcbef('0x5d'));_0x32b0e1[_0xcbef('0x5a')][_0xcbef('0x4e')](function(_0x2f16ac){_0x5f84b6[_0xcbef('0x5e')](getAgents(_0x357749,_0x2f16ac));});}});return BPromise['all'](_0x5f84b6)[_0xcbef('0x29')](function(_0x247cc9){_0x3f705f=_['union'](_0x3f705f,_[_0xcbef('0x5f')](_0x247cc9));_0x2aaf7b(_0x3f705f);})[_0xcbef('0x57')](function(_0x37a386){_0x381a87(_0x37a386);});});}function getAgents(_0x1c6df0,_0x351847){return new BPromise(function(_0x33ad66,_0x540f6d){return db[_0x1c6df0][_0xcbef('0x52')]({'where':{'id':_0x351847}})[_0xcbef('0x29')](function(_0x3d20d7){return _0x3d20d7['getAgents']({'attributes':['id'],'raw':!![]})['then'](function(_0x5cac1a){var _0x1edcd5=_['map'](_0x5cac1a,'id');_0x33ad66(_0x1edcd5);});})[_0xcbef('0x57')](function(_0x16d3ed){_0x540f6d(_0x16d3ed);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index cc63377..f408c53 100644 --- a/server/api/userNotification/userNotification.events.js +++ b/server/api/userNotification/userNotification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x210f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','UserNotification'];(function(_0x527536,_0x192f94){var _0x11f19d=function(_0x53c6c0){while(--_0x53c6c0){_0x527536['push'](_0x527536['shift']());}};_0x11f19d(++_0x192f94);}(_0x210f,0x1c0));var _0xf210=function(_0x1f19a3,_0x41ee9a){_0x1f19a3=_0x1f19a3-0x0;var _0x5765a1=_0x210f[_0x1f19a3];return _0x5765a1;};'use strict';var EventEmitter=require(_0xf210('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xf210('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xf210('0x2')](0x0);var events={'afterCreate':_0xf210('0x3'),'afterUpdate':_0xf210('0x4'),'afterDestroy':_0xf210('0x5')};function emitEvent(_0x369047){return function(_0x3da874,_0x58e14a,_0x50df62){UserNotificationEvents[_0xf210('0x6')](_0x369047+':'+_0x3da874['id'],_0x3da874);UserNotificationEvents['emit'](_0x369047,_0x3da874);_0x50df62(null);};}for(var e in events){if(events[_0xf210('0x7')](e)){var event=events[e];UserNotification[_0xf210('0x8')](e,emitEvent(event));}}module[_0xf210('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0xe6d9=['emit','hasOwnProperty','exports','../../mysqldb','UserNotification','setMaxListeners','update','remove'];(function(_0xd61e34,_0x53347f){var _0x2e7471=function(_0x4e462a){while(--_0x4e462a){_0xd61e34['push'](_0xd61e34['shift']());}};_0x2e7471(++_0x53347f);}(_0xe6d9,0x12b));var _0x9e6d=function(_0x7e19de,_0x368cce){_0x7e19de=_0x7e19de-0x0;var _0x3b06be=_0xe6d9[_0x7e19de];return _0x3b06be;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x9e6d('0x0'))['db'][_0x9e6d('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x9e6d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9e6d('0x3'),'afterDestroy':_0x9e6d('0x4')};function emitEvent(_0x9a80f2){return function(_0x1a381c,_0x32d51d,_0x5e9be2){UserNotificationEvents[_0x9e6d('0x5')](_0x9a80f2+':'+_0x1a381c['id'],_0x1a381c);UserNotificationEvents[_0x9e6d('0x5')](_0x9a80f2,_0x1a381c);_0x5e9be2(null);};}for(var e in events){if(events[_0x9e6d('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x9e6d('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 1057826..5f210b8 100644 --- a/server/api/userNotification/userNotification.model.js +++ b/server/api/userNotification/userNotification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39e6=['../../config/environment','./userNotification.attributes','exports','define','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3bd827,_0x5acf5c){var _0x47271f=function(_0x23aa20){while(--_0x23aa20){_0x3bd827['push'](_0x3bd827['shift']());}};_0x47271f(++_0x5acf5c);}(_0x39e6,0xf5));var _0x639e=function(_0xf613fc,_0x496d11){_0xf613fc=_0xf613fc-0x0;var _0x3b6abd=_0x39e6[_0xf613fc];return _0x3b6abd;};'use strict';var _=require(_0x639e('0x0'));var util=require(_0x639e('0x1'));var logger=require(_0x639e('0x2'))(_0x639e('0x3'));var moment=require('moment');var BPromise=require(_0x639e('0x4'));var rp=require(_0x639e('0x5'));var fs=require('fs');var path=require(_0x639e('0x6'));var rimraf=require('rimraf');var config=require(_0x639e('0x7'));var attributes=require(_0x639e('0x8'));module[_0x639e('0x9')]=function(_0x46b3e9,_0x5b0f1e){return _0x46b3e9[_0x639e('0xa')]('UserNotification',attributes,{'tableName':_0x639e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x639e('0xc'),'collate':_0x639e('0xd')});}; \ No newline at end of file +var _0x4c0e=['util','../../config/logger','moment','bluebird','path','../../config/environment','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x15a8fa,_0x4652b2){var _0x1355c2=function(_0x203292){while(--_0x203292){_0x15a8fa['push'](_0x15a8fa['shift']());}};_0x1355c2(++_0x4652b2);}(_0x4c0e,0x83));var _0xe4c0=function(_0x1a0016,_0x3d80e1){_0x1a0016=_0x1a0016-0x0;var _0x2945df=_0x4c0e[_0x1a0016];return _0x2945df;};'use strict';var _=require(_0xe4c0('0x0'));var util=require(_0xe4c0('0x1'));var logger=require(_0xe4c0('0x2'))('api');var moment=require(_0xe4c0('0x3'));var BPromise=require(_0xe4c0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4c0('0x5'));var rimraf=require('rimraf');var config=require(_0xe4c0('0x6'));var attributes=require('./userNotification.attributes');module['exports']=function(_0x44c427,_0x217ad2){return _0x44c427[_0xe4c0('0x7')](_0xe4c0('0x8'),attributes,{'tableName':_0xe4c0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe4c0('0xa'),'collate':_0xe4c0('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 1a183e7..ddb298b 100644 --- a/server/api/userNotification/userNotification.rpc.js +++ b/server/api/userNotification/userNotification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f0e=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./userNotification.socket','register','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error'];(function(_0x5cf3d7,_0x26611b){var _0x318db5=function(_0x18bc6a){while(--_0x18bc6a){_0x5cf3d7['push'](_0x5cf3d7['shift']());}};_0x318db5(++_0x26611b);}(_0x8f0e,0x16f));var _0xe8f0=function(_0x3c513d,_0x239f98){_0x3c513d=_0x3c513d-0x0;var _0x418f20=_0x8f0e[_0x3c513d];return _0x418f20;};'use strict';var _=require(_0xe8f0('0x0'));var util=require(_0xe8f0('0x1'));var moment=require(_0xe8f0('0x2'));var BPromise=require(_0xe8f0('0x3'));var rs=require(_0xe8f0('0x4'));var fs=require('fs');var Redis=require(_0xe8f0('0x5'));var db=require(_0xe8f0('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe8f0('0x7'));var config=require(_0xe8f0('0x8'));var jayson=require(_0xe8f0('0x9'));var client=jayson['client'][_0xe8f0('0xa')]({'port':0x232a});config[_0xe8f0('0xb')]=_[_0xe8f0('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe8f0('0xd'))(new Redis(config[_0xe8f0('0xb')]));require(_0xe8f0('0xe'))[_0xe8f0('0xf')](socket);function respondWithRpcPromise(_0x58f7ff,_0x3fdfad,_0x5791d0){return new BPromise(function(_0x52dc5e,_0x512955){return client['request'](_0x58f7ff,_0x5791d0)[_0xe8f0('0x10')](function(_0x19f3f2){logger[_0xe8f0('0x11')](_0xe8f0('0x12'),_0x3fdfad,_0xe8f0('0x13'));logger[_0xe8f0('0x14')](_0xe8f0('0x15'),_0x3fdfad,'request\x20sent',JSON['stringify'](_0x19f3f2));if(_0x19f3f2[_0xe8f0('0x16')]){if(_0x19f3f2[_0xe8f0('0x16')][_0xe8f0('0x17')]===0x1f4){logger[_0xe8f0('0x16')](_0xe8f0('0x12'),_0x3fdfad,_0x19f3f2[_0xe8f0('0x16')][_0xe8f0('0x18')]);return _0x512955(_0x19f3f2[_0xe8f0('0x16')][_0xe8f0('0x18')]);}logger[_0xe8f0('0x16')](_0xe8f0('0x12'),_0x3fdfad,_0x19f3f2['error'][_0xe8f0('0x18')]);return _0x52dc5e(_0x19f3f2[_0xe8f0('0x16')]['message']);}else{logger[_0xe8f0('0x11')](_0xe8f0('0x12'),_0x3fdfad,_0xe8f0('0x13'));_0x52dc5e(_0x19f3f2[_0xe8f0('0x19')][_0xe8f0('0x18')]);}})['catch'](function(_0x5babe9){logger[_0xe8f0('0x16')](_0xe8f0('0x12'),_0x3fdfad,_0x5babe9);_0x512955(_0x5babe9);});});} \ No newline at end of file +var _0xfe6d=['client','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','request\x20sent','debug','error','code','UserNotification,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x14a6cf,_0x27e1cb){var _0x66d8e7=function(_0x33c220){while(--_0x33c220){_0x14a6cf['push'](_0x14a6cf['shift']());}};_0x66d8e7(++_0x27e1cb);}(_0xfe6d,0x13b));var _0xdfe6=function(_0x5266e7,_0x97b16b){_0x5266e7=_0x5266e7-0x0;var _0x5470f1=_0xfe6d[_0x5266e7];return _0x5470f1;};'use strict';var _=require(_0xdfe6('0x0'));var util=require('util');var moment=require(_0xdfe6('0x1'));var BPromise=require(_0xdfe6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdfe6('0x3'));var db=require(_0xdfe6('0x4'))['db'];var utils=require(_0xdfe6('0x5'));var logger=require(_0xdfe6('0x6'))('rpc');var config=require(_0xdfe6('0x7'));var jayson=require(_0xdfe6('0x8'));var client=jayson[_0xdfe6('0x9')]['http']({'port':0x232a});config['redis']=_[_0xdfe6('0xa')](config[_0xdfe6('0xb')],{'host':_0xdfe6('0xc'),'port':0x18eb});var socket=require(_0xdfe6('0xd'))(new Redis(config[_0xdfe6('0xb')]));require(_0xdfe6('0xe'))[_0xdfe6('0xf')](socket);function respondWithRpcPromise(_0x5a45e2,_0x2fe684,_0x5ca7d5){return new BPromise(function(_0x4a0d1d,_0x322f4d){return client[_0xdfe6('0x10')](_0x5a45e2,_0x5ca7d5)[_0xdfe6('0x11')](function(_0x45be5d){logger[_0xdfe6('0x12')]('UserNotification,\x20%s,\x20%s',_0x2fe684,_0xdfe6('0x13'));logger[_0xdfe6('0x14')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x2fe684,'request\x20sent',JSON['stringify'](_0x45be5d));if(_0x45be5d[_0xdfe6('0x15')]){if(_0x45be5d['error'][_0xdfe6('0x16')]===0x1f4){logger[_0xdfe6('0x15')](_0xdfe6('0x17'),_0x2fe684,_0x45be5d[_0xdfe6('0x15')][_0xdfe6('0x18')]);return _0x322f4d(_0x45be5d[_0xdfe6('0x15')]['message']);}logger[_0xdfe6('0x15')](_0xdfe6('0x17'),_0x2fe684,_0x45be5d['error'][_0xdfe6('0x18')]);return _0x4a0d1d(_0x45be5d[_0xdfe6('0x15')][_0xdfe6('0x18')]);}else{logger[_0xdfe6('0x12')](_0xdfe6('0x17'),_0x2fe684,'request\x20sent');_0x4a0d1d(_0x45be5d[_0xdfe6('0x19')][_0xdfe6('0x18')]);}})[_0xdfe6('0x1a')](function(_0x39c2e8){logger[_0xdfe6('0x15')](_0xdfe6('0x17'),_0x2fe684,_0x39c2e8);_0x322f4d(_0x39c2e8);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 7cf376d..cc716ba 100644 --- a/server/api/userNotification/userNotification.socket.js +++ b/server/api/userNotification/userNotification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8c7=['removeListener','register','length','userNotification:','./userNotification.events','save','remove','update'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0xa8c7,0x184));var _0x7a8c=function(_0x24502c,_0x147fb1){_0x24502c=_0x24502c-0x0;var _0x549866=_0xa8c7[_0x24502c];return _0x549866;};'use strict';var UserNotificationEvents=require(_0x7a8c('0x0'));var events=[_0x7a8c('0x1'),_0x7a8c('0x2'),_0x7a8c('0x3')];function createListener(_0x44642c,_0x5d7ac8){return function(_0xc9a470){_0x5d7ac8['emit'](_0x44642c,_0xc9a470);};}function removeListener(_0x1cc684,_0x344335){return function(){UserNotificationEvents[_0x7a8c('0x4')](_0x1cc684,_0x344335);};}exports[_0x7a8c('0x5')]=function(_0x40c7d4){for(var _0x4103f8=0x0,_0x37c55a=events[_0x7a8c('0x6')];_0x4103f8<_0x37c55a;_0x4103f8++){var _0x2b760b=events[_0x4103f8];var _0x583a43=createListener(_0x7a8c('0x7')+_0x2b760b,_0x40c7d4);UserNotificationEvents['on'](_0x2b760b,_0x583a43);}}; \ No newline at end of file +var _0xb351=['removeListener','register','length','remove','update'];(function(_0x21a8ba,_0x2b09e1){var _0x1da12a=function(_0xb9a7f0){while(--_0xb9a7f0){_0x21a8ba['push'](_0x21a8ba['shift']());}};_0x1da12a(++_0x2b09e1);}(_0xb351,0xf8));var _0x1b35=function(_0x28be93,_0x3276f7){_0x28be93=_0x28be93-0x0;var _0x493c59=_0xb351[_0x28be93];return _0x493c59;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save',_0x1b35('0x0'),_0x1b35('0x1')];function createListener(_0x2542fb,_0x243e06){return function(_0x5e7311){_0x243e06['emit'](_0x2542fb,_0x5e7311);};}function removeListener(_0x2b0d73,_0x57f5b4){return function(){UserNotificationEvents[_0x1b35('0x2')](_0x2b0d73,_0x57f5b4);};}exports[_0x1b35('0x3')]=function(_0x3db2c5){for(var _0x2e53a0=0x0,_0x16bb8b=events[_0x1b35('0x4')];_0x2e53a0<_0x16bb8b;_0x2e53a0++){var _0x1ea550=events[_0x2e53a0];var _0x2b91d6=createListener('userNotification:'+_0x1ea550,_0x3db2c5);UserNotificationEvents['on'](_0x1ea550,_0x2b91d6);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 778cd44..8194d20 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x913c1d,_0x2afb77){var _0x4c15f9=function(_0x2e7cda){while(--_0x2e7cda){_0x913c1d['push'](_0x913c1d['shift']());}};_0x4c15f9(++_0x2afb77);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5259f7,_0xdcdc61){var _0x11e597=function(_0x390f89){while(--_0x390f89){_0x5259f7['push'](_0x5259f7['shift']());}};_0x11e597(++_0xdcdc61);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 83b16b3..8b5824b 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd5d=['sequelize','exports','INTEGER'];(function(_0x51265e,_0x204fb3){var _0x503405=function(_0x4e4cd8){while(--_0x4e4cd8){_0x51265e['push'](_0x51265e['shift']());}};_0x503405(++_0x204fb3);}(_0xdd5d,0xd5));var _0xddd5=function(_0x43cc0d,_0x5f2e7d){_0x43cc0d=_0x43cc0d-0x0;var _0x22fc29=_0xdd5d[_0x43cc0d];return _0x22fc29;};'use strict';var Sequelize=require(_0xddd5('0x0'));module[_0xddd5('0x1')]={'penalty':{'type':Sequelize[_0xddd5('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0dd6=['INTEGER'];(function(_0x39507b,_0x3efdac){var _0x5e7dd4=function(_0x18527e){while(--_0x18527e){_0x39507b['push'](_0x39507b['shift']());}};_0x5e7dd4(++_0x3efdac);}(_0x0dd6,0xca));var _0x60dd=function(_0x45e335,_0x1add07){_0x45e335=_0x45e335-0x0;var _0x31497d=_0x0dd6[_0x45e335];return _0x31497d;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x60dd('0x0')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 9e5adc3..0869767 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b75=['user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x3e0709,_0x3e427b){var _0x9ed3b4=function(_0x45e864){while(--_0x45e864){_0x3e0709['push'](_0x3e0709['shift']());}};_0x9ed3b4(++_0x3e427b);}(_0x7b75,0x123));var _0x57b7=function(_0x1f2bd7,_0x26a4b6){_0x1f2bd7=_0x1f2bd7-0x0;var _0x56232d=_0x7b75[_0x1f2bd7];return _0x56232d;};'use strict';var _=require(_0x57b7('0x0'));var util=require(_0x57b7('0x1'));var logger=require(_0x57b7('0x2'))(_0x57b7('0x3'));var moment=require(_0x57b7('0x4'));var BPromise=require(_0x57b7('0x5'));var rp=require(_0x57b7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57b7('0x7'));var config=require('../../config/environment');var attributes=require('./userOpenchannelQueue.attributes');module[_0x57b7('0x8')]=function(_0x471d3d,_0x3666dc){return _0x471d3d['define']('UserOpenchannelQueue',attributes,{'tableName':_0x57b7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55b5=['path','rimraf','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','api','bluebird'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x55b5,0xf6));var _0x555b=function(_0x47ced1,_0x4bdac3){_0x47ced1=_0x47ced1-0x0;var _0x4f8c04=_0x55b5[_0x47ced1];return _0x4f8c04;};'use strict';var _=require('lodash');var util=require(_0x555b('0x0'));var logger=require(_0x555b('0x1'))(_0x555b('0x2'));var moment=require('moment');var BPromise=require(_0x555b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x555b('0x4'));var rimraf=require(_0x555b('0x5'));var config=require('../../config/environment');var attributes=require(_0x555b('0x6'));module['exports']=function(_0x550133,_0x2c042e){return _0x550133[_0x555b('0x7')](_0x555b('0x8'),attributes,{'tableName':_0x555b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 3afa813..5d97007 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc89c=['UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x2d1db5,_0x7455eb){var _0x228e0d=function(_0xc56459){while(--_0xc56459){_0x2d1db5['push'](_0x2d1db5['shift']());}};_0x228e0d(++_0x7455eb);}(_0xc89c,0xd8));var _0xcc89=function(_0x14bcbe,_0x9e97b5){_0x14bcbe=_0x14bcbe-0x0;var _0x23edc1=_0xc89c[_0x14bcbe];return _0x23edc1;};'use strict';var _=require(_0xcc89('0x0'));var util=require(_0xcc89('0x1'));var moment=require(_0xcc89('0x2'));var BPromise=require(_0xcc89('0x3'));var rs=require(_0xcc89('0x4'));var fs=require('fs');var Redis=require(_0xcc89('0x5'));var db=require(_0xcc89('0x6'))['db'];var utils=require(_0xcc89('0x7'));var logger=require(_0xcc89('0x8'))(_0xcc89('0x9'));var config=require(_0xcc89('0xa'));var jayson=require(_0xcc89('0xb'));var client=jayson[_0xcc89('0xc')][_0xcc89('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xae2612,_0x305d49,_0x1d283f){return new BPromise(function(_0xd7504d,_0x1e3757){return client[_0xcc89('0xe')](_0xae2612,_0x1d283f)[_0xcc89('0xf')](function(_0x50bebb){logger['info'](_0xcc89('0x10'),_0x305d49,_0xcc89('0x11'));logger['debug'](_0xcc89('0x12'),_0x305d49,_0xcc89('0x11'),JSON[_0xcc89('0x13')](_0x50bebb));if(_0x50bebb[_0xcc89('0x14')]){if(_0x50bebb[_0xcc89('0x14')][_0xcc89('0x15')]===0x1f4){logger[_0xcc89('0x14')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x305d49,_0x50bebb[_0xcc89('0x14')]['message']);return _0x1e3757(_0x50bebb['error'][_0xcc89('0x16')]);}logger[_0xcc89('0x14')](_0xcc89('0x10'),_0x305d49,_0x50bebb[_0xcc89('0x14')][_0xcc89('0x16')]);return _0xd7504d(_0x50bebb[_0xcc89('0x14')][_0xcc89('0x16')]);}else{logger[_0xcc89('0x17')](_0xcc89('0x10'),_0x305d49,_0xcc89('0x11'));_0xd7504d(_0x50bebb[_0xcc89('0x18')][_0xcc89('0x16')]);}})[_0xcc89('0x19')](function(_0x356b4f){logger[_0xcc89('0x14')](_0xcc89('0x10'),_0x305d49,_0x356b4f);_0x1e3757(_0x356b4f);});});} \ No newline at end of file +var _0x644b=['UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x644b,0xf0));var _0xb644=function(_0x3f127b,_0x986b51){_0x3f127b=_0x3f127b-0x0;var _0x23ed00=_0x644b[_0x3f127b];return _0x23ed00;};'use strict';var _=require(_0xb644('0x0'));var util=require(_0xb644('0x1'));var moment=require('moment');var BPromise=require(_0xb644('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb644('0x3'));var db=require(_0xb644('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb644('0x5'));var config=require(_0xb644('0x6'));var jayson=require(_0xb644('0x7'));var client=jayson['client'][_0xb644('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x394644,_0x9fdadf,_0x3c64a8){return new BPromise(function(_0xe9ecd2,_0x1d739a){return client[_0xb644('0x9')](_0x394644,_0x3c64a8)[_0xb644('0xa')](function(_0x24876a){logger[_0xb644('0xb')](_0xb644('0xc'),_0x9fdadf,'request\x20sent');logger[_0xb644('0xd')](_0xb644('0xe'),_0x9fdadf,'request\x20sent',JSON['stringify'](_0x24876a));if(_0x24876a[_0xb644('0xf')]){if(_0x24876a['error'][_0xb644('0x10')]===0x1f4){logger[_0xb644('0xf')](_0xb644('0xc'),_0x9fdadf,_0x24876a[_0xb644('0xf')]['message']);return _0x1d739a(_0x24876a[_0xb644('0xf')][_0xb644('0x11')]);}logger[_0xb644('0xf')](_0xb644('0xc'),_0x9fdadf,_0x24876a[_0xb644('0xf')][_0xb644('0x11')]);return _0xe9ecd2(_0x24876a[_0xb644('0xf')][_0xb644('0x11')]);}else{logger[_0xb644('0xb')](_0xb644('0xc'),_0x9fdadf,_0xb644('0x12'));_0xe9ecd2(_0x24876a[_0xb644('0x13')][_0xb644('0x11')]);}})[_0xb644('0x14')](function(_0x3d122c){logger[_0xb644('0xf')](_0xb644('0xc'),_0x9fdadf,_0x3d122c);_0x1d739a(_0x3d122c);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 2950a17..142a10b 100644 --- a/server/api/userProfile/index.js +++ b/server/api/userProfile/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe642=['show','get','/:id/resources','getResources','post','addSections','addResources','put','/:id','update','delete','removeSections','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','describe'];(function(_0x4b1660,_0x2805de){var _0x5d2b93=function(_0x1f1da2){while(--_0x1f1da2){_0x4b1660['push'](_0x4b1660['shift']());}};_0x5d2b93(++_0x2805de);}(_0xe642,0x17c));var _0x2e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe642[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2e64('0x0'));var util=require('util');var path=require(_0x2e64('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2e64('0x2')]();var fs_extra=require(_0x2e64('0x3'));var auth=require(_0x2e64('0x4'));var interaction=require(_0x2e64('0x5'));var config=require(_0x2e64('0x6'));var controller=require('./userProfile.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2e64('0x7')]);router['get'](_0x2e64('0x8'),auth[_0x2e64('0x9')](),controller[_0x2e64('0xa')]);router['get']('/:id',auth[_0x2e64('0x9')](),controller[_0x2e64('0xb')]);router[_0x2e64('0xc')]('/:id/sections',auth[_0x2e64('0x9')](),controller['getSections']);router[_0x2e64('0xc')](_0x2e64('0xd'),auth[_0x2e64('0x9')](),controller[_0x2e64('0xe')]);router[_0x2e64('0xf')]('/',auth[_0x2e64('0x9')](),controller['create']);router[_0x2e64('0xf')]('/:id/clone',auth[_0x2e64('0x9')](),controller['clone']);router['post']('/:id/sections',auth[_0x2e64('0x9')](),controller[_0x2e64('0x10')]);router[_0x2e64('0xf')]('/:id/resources',auth[_0x2e64('0x9')](),controller[_0x2e64('0x11')]);router[_0x2e64('0x12')](_0x2e64('0x13'),auth[_0x2e64('0x9')](),controller[_0x2e64('0x14')]);router[_0x2e64('0x15')](_0x2e64('0x13'),auth['isAuthenticated'](),controller['destroy']);router[_0x2e64('0x15')]('/:id/sections',auth[_0x2e64('0x9')](),controller[_0x2e64('0x16')]);router['delete'](_0x2e64('0xd'),auth[_0x2e64('0x9')](),controller['removeResources']);module['exports']=router; \ No newline at end of file +var _0xec19=['get','index','/describe','isAuthenticated','describe','show','/:id/sections','/:id/resources','getResources','post','/:id/clone','clone','addResources','put','/:id','update','delete','destroy','removeResources','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller'];(function(_0x28509b,_0x5831ff){var _0x1e0b6=function(_0x37d8a2){while(--_0x37d8a2){_0x28509b['push'](_0x28509b['shift']());}};_0x1e0b6(++_0x5831ff);}(_0xec19,0x7f));var _0x9ec1=function(_0x1b7377,_0x528bf1){_0x1b7377=_0x1b7377-0x0;var _0xcbceca=_0xec19[_0x1b7377];return _0xcbceca;};'use strict';var multer=require(_0x9ec1('0x0'));var util=require('util');var path=require(_0x9ec1('0x1'));var timeout=require(_0x9ec1('0x2'));var express=require(_0x9ec1('0x3'));var router=express['Router']();var fs_extra=require(_0x9ec1('0x4'));var auth=require(_0x9ec1('0x5'));var interaction=require(_0x9ec1('0x6'));var config=require('../../config/environment');var controller=require(_0x9ec1('0x7'));router[_0x9ec1('0x8')]('/',auth['isAuthenticated'](),controller[_0x9ec1('0x9')]);router[_0x9ec1('0x8')](_0x9ec1('0xa'),auth[_0x9ec1('0xb')](),controller[_0x9ec1('0xc')]);router[_0x9ec1('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x9ec1('0xd')]);router[_0x9ec1('0x8')](_0x9ec1('0xe'),auth[_0x9ec1('0xb')](),controller['getSections']);router[_0x9ec1('0x8')](_0x9ec1('0xf'),auth[_0x9ec1('0xb')](),controller[_0x9ec1('0x10')]);router[_0x9ec1('0x11')]('/',auth[_0x9ec1('0xb')](),controller['create']);router[_0x9ec1('0x11')](_0x9ec1('0x12'),auth[_0x9ec1('0xb')](),controller[_0x9ec1('0x13')]);router[_0x9ec1('0x11')]('/:id/sections',auth[_0x9ec1('0xb')](),controller['addSections']);router['post'](_0x9ec1('0xf'),auth[_0x9ec1('0xb')](),controller[_0x9ec1('0x14')]);router[_0x9ec1('0x15')](_0x9ec1('0x16'),auth['isAuthenticated'](),controller[_0x9ec1('0x17')]);router[_0x9ec1('0x18')](_0x9ec1('0x16'),auth[_0x9ec1('0xb')](),controller[_0x9ec1('0x19')]);router[_0x9ec1('0x18')](_0x9ec1('0xe'),auth['isAuthenticated'](),controller['removeSections']);router['delete'](_0x9ec1('0xf'),auth[_0x9ec1('0xb')](),controller[_0x9ec1('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 2d7fb20..2779757 100644 --- a/server/api/userProfile/userProfile.attributes.js +++ b/server/api/userProfile/userProfile.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc39=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','crudPermissions'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xdc39,0x16f));var _0x9dc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc39[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9dc3('0x0'));module[_0x9dc3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x9dc3('0x2')],'set':function(_0x4715fa){this['setDataValue'](_0x9dc3('0x3'),_0x4715fa?_0x4715fa['join'](''):[]);},'get':function(){return this['getDataValue'](_0x9dc3('0x3'))?this[_0x9dc3('0x4')](_0x9dc3('0x3'))[_0x9dc3('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x9dc3('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x9dc3('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x9dc3('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x9dc3('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xe1be=['name','setDataValue','crudPermissions','join','getDataValue','BOOLEAN','STRING'];(function(_0x308813,_0x5b634a){var _0x3760ab=function(_0x53f460){while(--_0x53f460){_0x308813['push'](_0x308813['shift']());}};_0x3760ab(++_0x5b634a);}(_0xe1be,0x102));var _0xee1b=function(_0x4746ca,_0x3fdd15){_0x4746ca=_0x4746ca-0x0;var _0x7a723a=_0xe1be[_0x4746ca];return _0x7a723a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xee1b('0x0')],'allowNull':![],'unique':_0xee1b('0x1')},'crudPermissions':{'type':Sequelize[_0xee1b('0x0')],'set':function(_0x88cff9){this[_0xee1b('0x2')](_0xee1b('0x3'),_0x88cff9?_0x88cff9[_0xee1b('0x4')](''):[]);},'get':function(){return this[_0xee1b('0x5')](_0xee1b('0x3'))?this[_0xee1b('0x5')](_0xee1b('0x3'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xee1b('0x0')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xee1b('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xee1b('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xee1b('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xee1b('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xee1b('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xee1b('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 386f0fa..7b71c57 100644 --- a/server/api/userProfile/userProfile.controller.js +++ b/server/api/userProfile/userProfile.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc475=['userProfileId','Resources','update','describe','addSections','push','removeSections','ids','getSections','enabled','isEmpty','subsections','includes','concat','findOne','Dashboard','forEach','resourceId','Plugin','addResources','removeResources','getResources','section','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','localhost','socket.io-emitter','redis','status','end','json','undefined','limit','count','offset','set','Content-Range','save','destroy','then','sendStatus','error','stack','name','send','map','UserProfile','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','rawAttributes','include','find','create','body','clone','params','get','omit','updatedAt','crudPermissions','createdAt','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId'];(function(_0x2c0e63,_0x3de8dc){var _0x3cb9df=function(_0x5768cb){while(--_0x5768cb){_0x2c0e63['push'](_0x2c0e63['shift']());}};_0x3cb9df(++_0x3de8dc);}(_0xc475,0x8a));var _0x5c47=function(_0x3a44ef,_0x209c8d){_0x3a44ef=_0x3a44ef-0x0;var _0x278acd=_0xc475[_0x3a44ef];return _0x278acd;};'use strict';var emlformat=require(_0x5c47('0x0'));var rimraf=require(_0x5c47('0x1'));var zipdir=require(_0x5c47('0x2'));var jsonpatch=require(_0x5c47('0x3'));var rp=require(_0x5c47('0x4'));var moment=require(_0x5c47('0x5'));var BPromise=require(_0x5c47('0x6'));var Mustache=require(_0x5c47('0x7'));var util=require(_0x5c47('0x8'));var path=require(_0x5c47('0x9'));var sox=require(_0x5c47('0xa'));var csv=require(_0x5c47('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c47('0xc'));var _=require(_0x5c47('0xd'));var squel=require(_0x5c47('0xe'));var crypto=require(_0x5c47('0xf'));var jsforce=require(_0x5c47('0x10'));var deskjs=require(_0x5c47('0x11'));var toCsv=require(_0x5c47('0xb'));var querystring=require('querystring');var Papa=require(_0x5c47('0x12'));var Redis=require(_0x5c47('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5c47('0x14'));var as=require(_0x5c47('0x15'));var hardwareService=require(_0x5c47('0x16'));var logger=require(_0x5c47('0x17'))(_0x5c47('0x18'));var utils=require(_0x5c47('0x19'));var config=require(_0x5c47('0x1a'));var licenseUtil=require(_0x5c47('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x5c47('0x1c'),'port':0x18eb});var socket=require(_0x5c47('0x1d'))(new Redis(config[_0x5c47('0x1e')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x29dd7e,_0x1c5696){_0x1c5696=_0x1c5696||0xcc;return function(_0x5251be){if(_0x5251be){return _0x29dd7e['sendStatus'](_0x1c5696);}return _0x29dd7e[_0x5c47('0x1f')](_0x1c5696)[_0x5c47('0x20')]();};}function respondWithResult(_0x477b94,_0x5bae07){_0x5bae07=_0x5bae07||0xc8;return function(_0x12da3b){if(_0x12da3b){return _0x477b94[_0x5c47('0x1f')](_0x5bae07)[_0x5c47('0x21')](_0x12da3b);}};}function respondWithFilteredResult(_0x306e96,_0x136594){return function(_0x19744f){if(_0x19744f){var _0xe6ed21=typeof _0x136594['offset']===_0x5c47('0x22')&&typeof _0x136594[_0x5c47('0x23')]===_0x5c47('0x22');var _0x3eaad8=_0x19744f[_0x5c47('0x24')];var _0x193b0a=_0xe6ed21?0x0:_0x136594[_0x5c47('0x25')];var _0x546e76=_0xe6ed21?_0x19744f[_0x5c47('0x24')]:_0x136594[_0x5c47('0x25')]+_0x136594[_0x5c47('0x23')];var _0xc5e140;if(_0x546e76>=_0x3eaad8){_0x546e76=_0x3eaad8;_0xc5e140=0xc8;}else{_0xc5e140=0xce;}_0x306e96['status'](_0xc5e140);return _0x306e96[_0x5c47('0x26')](_0x5c47('0x27'),_0x193b0a+'-'+_0x546e76+'/'+_0x3eaad8)[_0x5c47('0x21')](_0x19744f);}return null;};}function patchUpdates(_0x51692b){return function(_0x2b04dc){try{jsonpatch['apply'](_0x2b04dc,_0x51692b,!![]);}catch(_0x10c97d){return BPromise['reject'](_0x10c97d);}return _0x2b04dc[_0x5c47('0x28')]();};}function saveUpdates(_0x31103a,_0x3884d3){return function(_0x9b0418){if(_0x9b0418){return _0x9b0418['update'](_0x31103a)['then'](function(_0x1dc7f1){return _0x1dc7f1;});}return null;};}function removeEntity(_0x55102c,_0x51f2be){return function(_0x2ac1f5){if(_0x2ac1f5){return _0x2ac1f5[_0x5c47('0x29')]()[_0x5c47('0x2a')](function(){_0x55102c['status'](0xcc)[_0x5c47('0x20')]();});}};}function handleEntityNotFound(_0x366c99,_0x58ab22){return function(_0x333b84){if(!_0x333b84){_0x366c99[_0x5c47('0x2b')](0x194);}return _0x333b84;};}function handleError(_0x3d32bb,_0x2f01c7){_0x2f01c7=_0x2f01c7||0x1f4;return function(_0x1a0cdd){logger[_0x5c47('0x2c')](_0x1a0cdd[_0x5c47('0x2d')]);if(_0x1a0cdd[_0x5c47('0x2e')]){delete _0x1a0cdd[_0x5c47('0x2e')];}_0x3d32bb[_0x5c47('0x1f')](_0x2f01c7)[_0x5c47('0x2f')](_0x1a0cdd);};}exports['index']=function(_0x79d318,_0x2bf99b){var _0x4a1c63={},_0x4f066a={},_0x700ee5={'count':0x0,'rows':[]};var _0x23af93=_[_0x5c47('0x30')](db[_0x5c47('0x31')]['rawAttributes'],function(_0x175e68){return{'name':_0x175e68[_0x5c47('0x32')],'type':_0x175e68[_0x5c47('0x33')][_0x5c47('0x34')]};});_0x4f066a[_0x5c47('0x35')]=_[_0x5c47('0x30')](_0x23af93,_0x5c47('0x2e'));_0x4f066a[_0x5c47('0x36')]=_[_0x5c47('0x37')](_0x79d318['query']);_0x4f066a['filters']=_[_0x5c47('0x38')](_0x4f066a[_0x5c47('0x35')],_0x4f066a[_0x5c47('0x36')]);_0x4a1c63[_0x5c47('0x39')]=_['intersection'](_0x4f066a[_0x5c47('0x35')],qs['fields'](_0x79d318[_0x5c47('0x36')][_0x5c47('0x3a')]));_0x4a1c63['attributes']=_0x4a1c63['attributes'][_0x5c47('0x3b')]?_0x4a1c63[_0x5c47('0x39')]:_0x4f066a[_0x5c47('0x35')];if(!_0x79d318[_0x5c47('0x36')]['hasOwnProperty']('nolimit')){_0x4a1c63[_0x5c47('0x23')]=qs[_0x5c47('0x23')](_0x79d318[_0x5c47('0x36')]['limit']);_0x4a1c63[_0x5c47('0x25')]=qs[_0x5c47('0x25')](_0x79d318[_0x5c47('0x36')][_0x5c47('0x25')]);}_0x4a1c63[_0x5c47('0x3c')]=qs[_0x5c47('0x3d')](_0x79d318['query'][_0x5c47('0x3d')]);_0x4a1c63[_0x5c47('0x3e')]=qs['filters'](_[_0x5c47('0x3f')](_0x79d318[_0x5c47('0x36')],_0x4f066a['filters']),_0x23af93);if(_0x79d318[_0x5c47('0x36')]['filter']){_0x4a1c63[_0x5c47('0x3e')]=_[_0x5c47('0x40')](_0x4a1c63['where'],{'$or':_[_0x5c47('0x30')](_0x23af93,function(_0x1dbd96){if(_0x1dbd96[_0x5c47('0x33')]!==_0x5c47('0x41')){var _0x43432c={};_0x43432c[_0x1dbd96[_0x5c47('0x2e')]]={'$like':'%'+_0x79d318[_0x5c47('0x36')][_0x5c47('0x42')]+'%'};return _0x43432c;}})});}_0x4a1c63=_[_0x5c47('0x40')]({},_0x4a1c63,_0x79d318[_0x5c47('0x43')]);var _0xcaf22e={'where':_0x4a1c63[_0x5c47('0x3e')]};return db[_0x5c47('0x31')][_0x5c47('0x24')](_0xcaf22e)[_0x5c47('0x2a')](function(_0x534763){_0x700ee5['count']=_0x534763;if(_0x79d318[_0x5c47('0x36')][_0x5c47('0x44')]){_0x4a1c63['include']=[{'all':!![]}];}return db[_0x5c47('0x31')][_0x5c47('0x45')](_0x4a1c63);})[_0x5c47('0x2a')](function(_0xe4639){_0x700ee5[_0x5c47('0x46')]=_0xe4639;return _0x700ee5;})[_0x5c47('0x2a')](respondWithFilteredResult(_0x2bf99b,_0x4a1c63))[_0x5c47('0x47')](handleError(_0x2bf99b,null));};exports['show']=function(_0x5bd2e1,_0x1e90ab){var _0x47b131={'raw':![],'where':{'id':_0x5bd2e1['params']['id']}},_0x47930c={};_0x47930c['model']=_[_0x5c47('0x37')](db[_0x5c47('0x31')][_0x5c47('0x48')]);_0x47930c[_0x5c47('0x36')]=_[_0x5c47('0x37')](_0x5bd2e1['query']);_0x47930c['filters']=_[_0x5c47('0x38')](_0x47930c[_0x5c47('0x35')],_0x47930c[_0x5c47('0x36')]);_0x47b131['attributes']=_['intersection'](_0x47930c[_0x5c47('0x35')],qs[_0x5c47('0x3a')](_0x5bd2e1[_0x5c47('0x36')][_0x5c47('0x3a')]));_0x47b131[_0x5c47('0x39')]=_0x47b131[_0x5c47('0x39')][_0x5c47('0x3b')]?_0x47b131['attributes']:_0x47930c['model'];if(_0x5bd2e1[_0x5c47('0x36')][_0x5c47('0x44')]){_0x47b131[_0x5c47('0x49')]=[{'all':!![]}];}_0x47b131=_[_0x5c47('0x40')]({},_0x47b131,_0x5bd2e1[_0x5c47('0x43')]);return db[_0x5c47('0x31')][_0x5c47('0x4a')](_0x47b131)[_0x5c47('0x2a')](handleEntityNotFound(_0x1e90ab,null))[_0x5c47('0x2a')](respondWithResult(_0x1e90ab,null))['catch'](handleError(_0x1e90ab,null));};exports[_0x5c47('0x4b')]=function(_0x1604e6,_0x351d31){return db[_0x5c47('0x31')][_0x5c47('0x4b')](_0x1604e6[_0x5c47('0x4c')],{})[_0x5c47('0x2a')](respondWithResult(_0x351d31,0xc9))['catch'](handleError(_0x351d31,null));};exports[_0x5c47('0x4d')]=function(_0x5b8ef7,_0x24483c){var _0x1bcfc4={'where':{'id':_0x5b8ef7[_0x5c47('0x4e')]['id']}},_0x5a7ca6={};_0x5a7ca6[_0x5c47('0x35')]=_['keys'](db[_0x5c47('0x31')][_0x5c47('0x48')]);_0x1bcfc4['attributes']=_['intersection'](_0x5a7ca6[_0x5c47('0x35')],qs[_0x5c47('0x3a')](_0x5b8ef7[_0x5c47('0x36')][_0x5c47('0x3a')]));_0x1bcfc4[_0x5c47('0x39')]=_0x1bcfc4[_0x5c47('0x39')][_0x5c47('0x3b')]?_0x1bcfc4[_0x5c47('0x39')]:_0x5a7ca6['model'];if(_0x5b8ef7[_0x5c47('0x36')][_0x5c47('0x44')]){_0x1bcfc4[_0x5c47('0x49')]=[{'all':!![]}];}_0x1bcfc4=_['merge']({},_0x1bcfc4,_0x5b8ef7[_0x5c47('0x43')]);return db[_0x5c47('0x31')]['find'](_0x1bcfc4)[_0x5c47('0x2a')](handleEntityNotFound(_0x24483c,null))[_0x5c47('0x2a')](function(_0x1b0c59){if(_0x1b0c59){var _0x1d9be1=_0x1b0c59[_0x5c47('0x4f')]({'plain':!![]});_0x1d9be1=qs[_0x5c47('0x50')](_0x1d9be1,['id','createdAt',_0x5c47('0x51'),_0x5c47('0x52')]);_0x5b8ef7['body']=_[_0x5c47('0x50')](_0x5b8ef7['body'],['id',_0x5c47('0x53'),_0x5c47('0x51')]);return db['sequelize'][_0x5c47('0x54')](function(_0x552732){return db['UserProfile'][_0x5c47('0x4b')](_['merge'](_0x1d9be1,_0x5b8ef7[_0x5c47('0x4c')]),{'include':_0x5b8ef7[_0x5c47('0x36')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x552732})['then'](function(_0x41007a){var _0x1bbcd1=_0x41007a[_0x5c47('0x4f')]({'plain':!![]});return db[_0x5c47('0x55')][_0x5c47('0x45')]({'where':{'userProfileId':_0x5b8ef7[_0x5c47('0x4e')]['id']},'raw':!![]})[_0x5c47('0x2a')](function(_0x2f349a){if(_0x2f349a){return BPromise[_0x5c47('0x56')](_0x2f349a,function(_0x221b82){return new BPromise(function(_0x355469,_0x3cbfcc){if(_0x221b82['autoAssociation']===null||_0x221b82[_0x5c47('0x57')]===0x1)_0x355469(null);return db[_0x5c47('0x58')][_0x5c47('0x45')]({'where':{'sectionId':_0x221b82['id']},'raw':!![]})[_0x5c47('0x2a')](function(_0x188139){var _0xbedd5b=_[_0x5c47('0x30')](_0x188139,function(_0x824bbe){return qs[_0x5c47('0x50')](_0x824bbe,['id',_0x5c47('0x53'),_0x5c47('0x51'),_0x5c47('0x59')]);});_0x355469(_0xbedd5b);})[_0x5c47('0x47')](function(_0x3872e5){_0x3cbfcc(_0x3872e5);});})[_0x5c47('0x2a')](function(_0x4ed255){var _0x40b1a1=qs[_0x5c47('0x50')](_0x221b82,['id',_0x5c47('0x53'),'updatedAt']);_0x40b1a1[_0x5c47('0x5a')]=_0x1bbcd1['id'];if(_0x4ed255)_0x40b1a1[_0x5c47('0x5b')]=_0x4ed255;return _0x40b1a1;})[_0x5c47('0x2a')](function(_0x444bd3){return db[_0x5c47('0x55')][_0x5c47('0x4b')](_0x444bd3,{'include':[{'model':db['UserProfileResource'],'as':_0x5c47('0x5b')}],'raw':!![],'transaction':_0x552732});});})[_0x5c47('0x2a')](function(){return _0x1bbcd1;});}});});});}})['then'](respondWithResult(_0x24483c,0xc9))[_0x5c47('0x47')](handleError(_0x24483c,null));};exports[_0x5c47('0x5c')]=function(_0x1a5d53,_0x189b67){if(_0x1a5d53['body']['id']){delete _0x1a5d53[_0x5c47('0x4c')]['id'];}return db['UserProfile'][_0x5c47('0x4a')]({'where':{'id':_0x1a5d53['params']['id']}})[_0x5c47('0x2a')](handleEntityNotFound(_0x189b67,null))[_0x5c47('0x2a')](saveUpdates(_0x1a5d53[_0x5c47('0x4c')],null))[_0x5c47('0x2a')](respondWithResult(_0x189b67,null))[_0x5c47('0x47')](handleError(_0x189b67,null));};exports[_0x5c47('0x29')]=function(_0x278ea2,_0x5ec32e){return db['UserProfile'][_0x5c47('0x4a')]({'where':{'id':_0x278ea2['params']['id']}})[_0x5c47('0x2a')](handleEntityNotFound(_0x5ec32e,null))['then'](removeEntity(_0x5ec32e,null))[_0x5c47('0x47')](handleError(_0x5ec32e,null));};exports['describe']=function(_0x2f16ef,_0x44e376){return db['UserProfile'][_0x5c47('0x5d')]()[_0x5c47('0x2a')](respondWithResult(_0x44e376,null))[_0x5c47('0x47')](handleError(_0x44e376,null));};exports[_0x5c47('0x5e')]=function(_0xa89643,_0x19293b){var _0x266134=_0xa89643[_0x5c47('0x4c')];return db[_0x5c47('0x31')][_0x5c47('0x4a')]({'where':{'id':_0xa89643[_0x5c47('0x4e')]['id']}})[_0x5c47('0x2a')](handleEntityNotFound(_0x19293b,null))[_0x5c47('0x2a')](function(_0x617f67){if(_0x617f67){return db['sequelize']['transaction'](function(_0x12efe6){return db[_0x5c47('0x55')][_0x5c47('0x29')]({'where':{'userProfileId':_0xa89643[_0x5c47('0x4e')]['id'],'sectionId':_[_0x5c47('0x30')](_0x266134,function(_0x55c465){return _0x55c465['sectionId'];})},'transaction':_0x12efe6})[_0x5c47('0x2a')](function(){var _0x27c8cb=_[_0x5c47('0x30')](_0x266134,function(_0x5e1763){_0x5e1763[_0x5c47('0x5a')]=_0xa89643[_0x5c47('0x4e')]['id'];return _0x5e1763;});var _0x3100a4=[];return BPromise['each'](_0x27c8cb,function(_0x259c3e){return db[_0x5c47('0x55')]['create'](_0x259c3e,{'include':[{'model':db['UserProfileResource'],'as':_0x5c47('0x5b')}],'raw':!![],'transaction':_0x12efe6})['then'](function(_0x19d3fa){_0x3100a4[_0x5c47('0x5f')](_0x19d3fa[_0x5c47('0x4f')]({'plain':!![]}));});})[_0x5c47('0x2a')](function(){return _0x3100a4;});});});}})[_0x5c47('0x2a')](function(_0x4b2148){return _0x4b2148;})[_0x5c47('0x2a')](respondWithResult(_0x19293b,null))['catch'](handleError(_0x19293b,null));};exports[_0x5c47('0x60')]=function(_0x1a5eb5,_0x1df33d){var _0x34e745;return db['UserProfile']['find']({'where':{'id':_0x1a5eb5[_0x5c47('0x4e')]['id']},'attributes':['id',_0x5c47('0x2e')]})[_0x5c47('0x2a')](handleEntityNotFound(_0x1df33d,null))['then'](function(_0x169ec8){if(_0x169ec8){_0x34e745=_0x169ec8;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x1a5eb5[_0x5c47('0x4e')]['id'],'sectionId':_0x1a5eb5[_0x5c47('0x36')][_0x5c47('0x61')]}});}})['then'](function(){return _0x34e745;})[_0x5c47('0x2a')](respondWithStatusCode(_0x1df33d,null))[_0x5c47('0x47')](handleError(_0x1df33d,null));};exports[_0x5c47('0x62')]=function(_0x2f72ba,_0xd99b44){var _0x286b59=[];var _0x3ad4db=[];return db[_0x5c47('0x55')][_0x5c47('0x45')]({'where':{'userProfileId':_0x2f72ba[_0x5c47('0x4e')]['id']},'raw':!![]})['then'](function(_0x390f34){_0x286b59=_[_0x5c47('0x42')](_0x390f34,function(_0x47d02b){return _0x47d02b[_0x5c47('0x63')]===0x1||_['includes']([0x3eb,0x709],_0x47d02b['sectionId']);});if(!_[_0x5c47('0x64')](_0x286b59)){return _['map'](_0x286b59,function(_0x3a0c5b){return _0x3a0c5b[_0x5c47('0x59')];});}else{return;}})[_0x5c47('0x2a')](function(_0x54e012){if(_0x54e012)_0x3ad4db=_0x54e012;if(_['includes'](_0x3ad4db,0x64)){var _0x238150=_[_0x5c47('0x4a')](_0x286b59,{'sectionId':0x64});return hasDefaultDashboard(_0x238150)[_0x5c47('0x2a')](function(_0x4f7086){return _['map'](_0x286b59,function(_0x294938){if(_0x294938[_0x5c47('0x59')]===0x64){_0x294938[_0x5c47('0x65')]=_0x4f7086;}return _0x294938;});});}else{return;}})[_0x5c47('0x2a')](function(_0xd54304){if(_0xd54304)_0x286b59=_0xd54304;if(_[_0x5c47('0x66')](_0x3ad4db,0x3eb)){var _0x3d09c9=_['find'](_0x286b59,{'sectionId':0x3eb});return getCustomDashboards(_0x3d09c9)[_0x5c47('0x2a')](function(_0x1c6266){return _['map'](_0x286b59,function(_0x25822e){if(_0x3d09c9['enabled']){if(_0x25822e[_0x5c47('0x59')]===0x3eb){_0x25822e[_0x5c47('0x65')]=_0x1c6266;}}else{if(_0x25822e[_0x5c47('0x59')]===0x64){if(!_0x25822e[_0x5c47('0x65')]){_0x25822e['subsections']=[];}_0x25822e[_0x5c47('0x65')]=_0x25822e[_0x5c47('0x65')][_0x5c47('0x67')](_0x1c6266);}}return _0x25822e;});});}else{return;}})[_0x5c47('0x2a')](function(_0x496f52){if(_0x496f52)_0x286b59=_0x496f52;if(_[_0x5c47('0x66')](_0x3ad4db,0x709)){var _0x460f0e=_[_0x5c47('0x4a')](_0x286b59,{'sectionId':0x709});return getPlugins(_0x460f0e)[_0x5c47('0x2a')](function(_0x20757a){if(_0x460f0e[_0x5c47('0x63')]){return _[_0x5c47('0x30')](_0x286b59,function(_0x318acf){if(_0x318acf['sectionId']===0x709){_0x318acf[_0x5c47('0x65')]=_0x20757a;}return _0x318acf;});}else{var _0x3a46c6={'sectionId':0x76c,'enabled':0x1,'subsections':_0x20757a};var _0x1bbfa4=_[_0x5c47('0x30')](_0x286b59);_0x1bbfa4[_0x5c47('0x5f')](_0x3a46c6);return _0x1bbfa4;}});}else{return;}})[_0x5c47('0x2a')](function(_0x128468){if(_0x128468)_0x286b59=_0x128468;return _[_0x5c47('0x42')](_0x286b59,[_0x5c47('0x63'),0x1]);})[_0x5c47('0x2a')](respondWithResult(_0xd99b44,null))[_0x5c47('0x47')](handleError(_0xd99b44,null));};function hasDefaultDashboard(_0x18c8c4){var _0x4d69bb=[0x65];return new BPromise(function(_0x330653,_0x48a6ce){try{if(_0x18c8c4[_0x5c47('0x57')]){_0x330653(_0x4d69bb);}else{return db[_0x5c47('0x58')][_0x5c47('0x68')]({'where':{'sectionId':_0x18c8c4['id']},'raw':!![]})['then'](function(_0x5dc1fc){_0x5dc1fc?_0x330653(_0x4d69bb):_0x330653();});}}catch(_0x107108){_0x48a6ce(_0x107108);}});}function getCustomDashboards(_0x279bd4){var _0x1ad603=[];return new BPromise(function(_0x5aed0f,_0x80cce1){try{if(_0x279bd4['autoAssociation']){return db[_0x5c47('0x69')][_0x5c47('0x45')]({'raw':!![]})[_0x5c47('0x2a')](function(_0x4134d4){_0x4134d4[_0x5c47('0x6a')](function(_0x14222e){_0x1ad603[_0x5c47('0x5f')](_0x14222e['id']+0x1869f);});_0x5aed0f(_0x1ad603);});}else{return db[_0x5c47('0x58')][_0x5c47('0x45')]({'where':{'sectionId':_0x279bd4['id']},'raw':!![]})['then'](function(_0x3ce425){_0x3ce425[_0x5c47('0x6a')](function(_0x58cc3d){_0x1ad603[_0x5c47('0x5f')](_0x58cc3d[_0x5c47('0x6b')]+0x1869f);});_0x5aed0f(_0x1ad603);});}}catch(_0x5d297f){_0x80cce1(_0x5d297f);}});}function getPlugins(_0x3871bc){var _0x1e8252=[];return new BPromise(function(_0x115175,_0x103b49){try{if(_0x3871bc[_0x5c47('0x57')]){return db[_0x5c47('0x6c')][_0x5c47('0x45')]({'raw':!![]})[_0x5c47('0x2a')](function(_0x4880e0){_0x4880e0[_0x5c47('0x6a')](function(_0x494018){_0x1e8252[_0x5c47('0x5f')](_0x494018['id']+0x15b38);});_0x115175(_0x1e8252);});}else{return db[_0x5c47('0x58')][_0x5c47('0x45')]({'where':{'sectionId':_0x3871bc['id']},'raw':!![]})['then'](function(_0x4cc045){_0x4cc045[_0x5c47('0x6a')](function(_0x2415be){_0x1e8252[_0x5c47('0x5f')](_0x2415be[_0x5c47('0x6b')]+0x15b38);});_0x115175(_0x1e8252);});}}catch(_0x5e91b9){_0x103b49(_0x5e91b9);}});}exports[_0x5c47('0x6d')]=function(_0x3eff63,_0x4136a9){return db[_0x5c47('0x31')][_0x5c47('0x4a')]({'where':{'id':_0x3eff63[_0x5c47('0x4e')]['id']}})[_0x5c47('0x2a')](handleEntityNotFound(_0x4136a9,null))[_0x5c47('0x2a')](function(_0x4fb7b0){if(_0x4fb7b0){return db['sequelize']['transaction'](function(_0x7d86ad){return db[_0x5c47('0x55')][_0x5c47('0x45')]({'where':{'userProfileId':_0x3eff63[_0x5c47('0x4e')]['id']},'attributes':['id'],'raw':!![]})[_0x5c47('0x2a')](function(_0x392c4c){if(_0x392c4c){return db[_0x5c47('0x55')]['destroy']({'where':{'userProfileId':_0x3eff63[_0x5c47('0x4e')]['id'],'id':_['map'](_0x392c4c,function(_0x537686){return _0x537686['id'];})},'transaction':_0x7d86ad});}})[_0x5c47('0x2a')](function(_0x564f32){var _0x3830ea=_['map'](_0x3eff63[_0x5c47('0x4c')],function(_0x57143f){_0x57143f[_0x5c47('0x5a')]=_0x3eff63[_0x5c47('0x4e')]['id'];return _0x57143f;});return db[_0x5c47('0x55')]['bulkCreate'](_0x3830ea,{'raw':!![],'transaction':_0x7d86ad});})[_0x5c47('0x2a')](function(_0x46643d){var _0x1ac9bb=_[_0x5c47('0x42')](_[_0x5c47('0x30')](_0x46643d,function(_0x3e8f23){return _0x3e8f23[_0x5c47('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x1ac9bb){return db[_0x5c47('0x55')][_0x5c47('0x45')]({'where':{'userProfileId':_0x3eff63[_0x5c47('0x4e')]['id'],'sectionId':_[_0x5c47('0x30')](_0x1ac9bb,function(_0x38a1c9){return _0x38a1c9[_0x5c47('0x59')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x3c0fdd){var _0x2f4af4=_['map'](_0x3eff63[_0x5c47('0x4c')],function(_0x2ff0d2){_0x2ff0d2[_0x5c47('0x5a')]=_0x3eff63[_0x5c47('0x4e')]['id'];return _0x2ff0d2;});return db[_0x5c47('0x58')]['bulkCreate'](_0x2f4af4,{'raw':!![],'transaction':_0x7d86ad});});}})[_0x5c47('0x47')](handleError(_0x4136a9,null));});}})[_0x5c47('0x2a')](function(_0x3ef80b){var _0x365a63=_[_0x5c47('0x30')](_0x3ef80b,function(_0x5aa437){return _0x5aa437[_0x5c47('0x4f')]({'plain':!![]});});})[_0x5c47('0x2a')](respondWithResult(_0x4136a9,null))[_0x5c47('0x47')](handleError(_0x4136a9,null));};exports[_0x5c47('0x6e')]=function(_0x18351a,_0x5c0064,_0x1a5d94){return db[_0x5c47('0x31')]['find']({'where':{'id':_0x18351a[_0x5c47('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5c0064,null))[_0x5c47('0x2a')](function(_0x2592d8){if(_0x2592d8){return _0x2592d8[_0x5c47('0x6e')](_0x18351a[_0x5c47('0x36')]['ids']);}})[_0x5c47('0x2a')](respondWithStatusCode(_0x5c0064,null))['catch'](handleError(_0x5c0064,null));};exports[_0x5c47('0x6f')]=function(_0x2c23c4,_0x3050ea){var _0x28e28a={};if(!_0x2c23c4['query'][_0x5c47('0x70')])throw new Error('Missing\x20section\x20parameter');if(!_0x2c23c4['query'][_0x5c47('0x71')]('nolimit')){_0x28e28a['limit']=qs['limit'](_0x2c23c4[_0x5c47('0x36')][_0x5c47('0x23')]);_0x28e28a[_0x5c47('0x25')]=qs[_0x5c47('0x25')](_0x2c23c4[_0x5c47('0x36')][_0x5c47('0x25')]);}return db[_0x5c47('0x31')]['find']({'where':{'id':_0x2c23c4[_0x5c47('0x4e')]['id']}})[_0x5c47('0x2a')](function(_0x4cbc55){if(!_0x4cbc55)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x2c23c4['params']['id']);return db[_0x5c47('0x31')][_0x5c47('0x6f')](_0x2c23c4);})[_0x5c47('0x2a')](respondWithFilteredResult(_0x3050ea,_0x28e28a))[_0x5c47('0x47')](handleError(_0x3050ea,null));}; \ No newline at end of file +var _0xf962=['includeAll','find','create','clone','include','get','createdAt','updatedAt','crudPermissions','body','omit','sequelize','transaction','UserProfileSection','findAll','params','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileResource','describe','addSections','destroy','push','getSections','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./userProfile.socket','register','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','rawAttributes','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','UserProfile','rows','catch','show','keys'];(function(_0x59e862,_0x477bf2){var _0x1a25ee=function(_0xc61e64){while(--_0xc61e64){_0x59e862['push'](_0x59e862['shift']());}};_0x1a25ee(++_0x477bf2);}(_0xf962,0x10e));var _0x2f96=function(_0x36ce93,_0xdfd9a5){_0x36ce93=_0x36ce93-0x0;var _0x459145=_0xf962[_0x36ce93];return _0x459145;};'use strict';var emlformat=require(_0x2f96('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2f96('0x1'));var rp=require(_0x2f96('0x2'));var moment=require(_0x2f96('0x3'));var BPromise=require(_0x2f96('0x4'));var Mustache=require(_0x2f96('0x5'));var util=require(_0x2f96('0x6'));var path=require(_0x2f96('0x7'));var sox=require(_0x2f96('0x8'));var csv=require(_0x2f96('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f96('0xa'));var _=require(_0x2f96('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2f96('0xc'));var deskjs=require(_0x2f96('0xd'));var toCsv=require(_0x2f96('0x9'));var querystring=require(_0x2f96('0xe'));var Papa=require('papaparse');var Redis=require(_0x2f96('0xf'));var authService=require(_0x2f96('0x10'));var qs=require(_0x2f96('0x11'));var as=require(_0x2f96('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2f96('0x13'));var config=require(_0x2f96('0x14'));var licenseUtil=require(_0x2f96('0x15'));var db=require('../../mysqldb')['db'];config[_0x2f96('0x16')]=_[_0x2f96('0x17')](config[_0x2f96('0x16')],{'host':_0x2f96('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2f96('0x16')]));require(_0x2f96('0x19'))[_0x2f96('0x1a')](socket);function respondWithStatusCode(_0x2d2a1e,_0x252bcf){_0x252bcf=_0x252bcf||0xcc;return function(_0x51c317){if(_0x51c317){return _0x2d2a1e['sendStatus'](_0x252bcf);}return _0x2d2a1e['status'](_0x252bcf)['end']();};}function respondWithResult(_0x5546ed,_0x30ab75){_0x30ab75=_0x30ab75||0xc8;return function(_0xfbb89c){if(_0xfbb89c){return _0x5546ed[_0x2f96('0x1b')](_0x30ab75)[_0x2f96('0x1c')](_0xfbb89c);}};}function respondWithFilteredResult(_0x223851,_0x5791c8){return function(_0x256cc6){if(_0x256cc6){var _0x58fd7f=typeof _0x5791c8['offset']===_0x2f96('0x1d')&&typeof _0x5791c8[_0x2f96('0x1e')]===_0x2f96('0x1d');var _0x674f07=_0x256cc6[_0x2f96('0x1f')];var _0x328ede=_0x58fd7f?0x0:_0x5791c8[_0x2f96('0x20')];var _0x545a6d=_0x58fd7f?_0x256cc6[_0x2f96('0x1f')]:_0x5791c8[_0x2f96('0x20')]+_0x5791c8[_0x2f96('0x1e')];var _0x15e588;if(_0x545a6d>=_0x674f07){_0x545a6d=_0x674f07;_0x15e588=0xc8;}else{_0x15e588=0xce;}_0x223851[_0x2f96('0x1b')](_0x15e588);return _0x223851[_0x2f96('0x21')](_0x2f96('0x22'),_0x328ede+'-'+_0x545a6d+'/'+_0x674f07)['json'](_0x256cc6);}return null;};}function patchUpdates(_0x4be870){return function(_0xa88dfb){try{jsonpatch[_0x2f96('0x23')](_0xa88dfb,_0x4be870,!![]);}catch(_0x9e1479){return BPromise[_0x2f96('0x24')](_0x9e1479);}return _0xa88dfb[_0x2f96('0x25')]();};}function saveUpdates(_0x184882,_0x5cfa6a){return function(_0x545aa2){if(_0x545aa2){return _0x545aa2[_0x2f96('0x26')](_0x184882)[_0x2f96('0x27')](function(_0x74a2ec){return _0x74a2ec;});}return null;};}function removeEntity(_0x43e26f,_0x27a27a){return function(_0x48ddba){if(_0x48ddba){return _0x48ddba['destroy']()['then'](function(){_0x43e26f['status'](0xcc)[_0x2f96('0x28')]();});}};}function handleEntityNotFound(_0x4ce925,_0x2da971){return function(_0x514cec){if(!_0x514cec){_0x4ce925[_0x2f96('0x29')](0x194);}return _0x514cec;};}function handleError(_0x887b1e,_0x3ba433){_0x3ba433=_0x3ba433||0x1f4;return function(_0x22d43a){logger[_0x2f96('0x2a')](_0x22d43a[_0x2f96('0x2b')]);if(_0x22d43a['name']){delete _0x22d43a[_0x2f96('0x2c')];}_0x887b1e[_0x2f96('0x1b')](_0x3ba433)[_0x2f96('0x2d')](_0x22d43a);};}exports['index']=function(_0x398bc1,_0x18eccd){var _0x50a2e6={},_0x5f1e4e={},_0x3a4f11={'count':0x0,'rows':[]};var _0x560a52=_['map'](db['UserProfile'][_0x2f96('0x2e')],function(_0x341382){return{'name':_0x341382['fieldName'],'type':_0x341382['type']['key']};});_0x5f1e4e[_0x2f96('0x2f')]=_[_0x2f96('0x30')](_0x560a52,_0x2f96('0x2c'));_0x5f1e4e[_0x2f96('0x31')]=_['keys'](_0x398bc1['query']);_0x5f1e4e[_0x2f96('0x32')]=_[_0x2f96('0x33')](_0x5f1e4e['model'],_0x5f1e4e[_0x2f96('0x31')]);_0x50a2e6[_0x2f96('0x34')]=_[_0x2f96('0x33')](_0x5f1e4e['model'],qs[_0x2f96('0x35')](_0x398bc1[_0x2f96('0x31')]['fields']));_0x50a2e6[_0x2f96('0x34')]=_0x50a2e6['attributes'][_0x2f96('0x36')]?_0x50a2e6[_0x2f96('0x34')]:_0x5f1e4e[_0x2f96('0x2f')];if(!_0x398bc1['query'][_0x2f96('0x37')](_0x2f96('0x38'))){_0x50a2e6['limit']=qs['limit'](_0x398bc1['query'][_0x2f96('0x1e')]);_0x50a2e6[_0x2f96('0x20')]=qs['offset'](_0x398bc1['query']['offset']);}_0x50a2e6[_0x2f96('0x39')]=qs[_0x2f96('0x3a')](_0x398bc1[_0x2f96('0x31')][_0x2f96('0x3a')]);_0x50a2e6['where']=qs[_0x2f96('0x32')](_[_0x2f96('0x3b')](_0x398bc1[_0x2f96('0x31')],_0x5f1e4e[_0x2f96('0x32')]),_0x560a52);if(_0x398bc1[_0x2f96('0x31')][_0x2f96('0x3c')]){_0x50a2e6[_0x2f96('0x3d')]=_[_0x2f96('0x3e')](_0x50a2e6['where'],{'$or':_[_0x2f96('0x30')](_0x560a52,function(_0x577dbe){if(_0x577dbe['type']!=='VIRTUAL'){var _0x1da1f={};_0x1da1f[_0x577dbe[_0x2f96('0x2c')]]={'$like':'%'+_0x398bc1[_0x2f96('0x31')]['filter']+'%'};return _0x1da1f;}})});}_0x50a2e6=_[_0x2f96('0x3e')]({},_0x50a2e6,_0x398bc1[_0x2f96('0x3f')]);var _0x4160cb={'where':_0x50a2e6[_0x2f96('0x3d')]};return db['UserProfile']['count'](_0x4160cb)['then'](function(_0x175243){_0x3a4f11[_0x2f96('0x1f')]=_0x175243;if(_0x398bc1[_0x2f96('0x31')]['includeAll']){_0x50a2e6['include']=[{'all':!![]}];}return db[_0x2f96('0x40')]['findAll'](_0x50a2e6);})['then'](function(_0x3b8bea){_0x3a4f11[_0x2f96('0x41')]=_0x3b8bea;return _0x3a4f11;})[_0x2f96('0x27')](respondWithFilteredResult(_0x18eccd,_0x50a2e6))[_0x2f96('0x42')](handleError(_0x18eccd,null));};exports[_0x2f96('0x43')]=function(_0x285843,_0x607a4){var _0x3ad199={'raw':![],'where':{'id':_0x285843['params']['id']}},_0x3365c5={};_0x3365c5[_0x2f96('0x2f')]=_[_0x2f96('0x44')](db[_0x2f96('0x40')][_0x2f96('0x2e')]);_0x3365c5[_0x2f96('0x31')]=_[_0x2f96('0x44')](_0x285843[_0x2f96('0x31')]);_0x3365c5[_0x2f96('0x32')]=_[_0x2f96('0x33')](_0x3365c5['model'],_0x3365c5[_0x2f96('0x31')]);_0x3ad199['attributes']=_[_0x2f96('0x33')](_0x3365c5[_0x2f96('0x2f')],qs[_0x2f96('0x35')](_0x285843[_0x2f96('0x31')]['fields']));_0x3ad199['attributes']=_0x3ad199[_0x2f96('0x34')][_0x2f96('0x36')]?_0x3ad199[_0x2f96('0x34')]:_0x3365c5[_0x2f96('0x2f')];if(_0x285843[_0x2f96('0x31')][_0x2f96('0x45')]){_0x3ad199['include']=[{'all':!![]}];}_0x3ad199=_[_0x2f96('0x3e')]({},_0x3ad199,_0x285843[_0x2f96('0x3f')]);return db[_0x2f96('0x40')][_0x2f96('0x46')](_0x3ad199)[_0x2f96('0x27')](handleEntityNotFound(_0x607a4,null))[_0x2f96('0x27')](respondWithResult(_0x607a4,null))['catch'](handleError(_0x607a4,null));};exports[_0x2f96('0x47')]=function(_0x4c7b28,_0x581d8a){return db[_0x2f96('0x40')]['create'](_0x4c7b28['body'],{})[_0x2f96('0x27')](respondWithResult(_0x581d8a,0xc9))[_0x2f96('0x42')](handleError(_0x581d8a,null));};exports[_0x2f96('0x48')]=function(_0x593f89,_0x5ac1d9){var _0x475c00={'where':{'id':_0x593f89['params']['id']}},_0x50a17b={};_0x50a17b[_0x2f96('0x2f')]=_[_0x2f96('0x44')](db['UserProfile'][_0x2f96('0x2e')]);_0x475c00['attributes']=_[_0x2f96('0x33')](_0x50a17b['model'],qs[_0x2f96('0x35')](_0x593f89[_0x2f96('0x31')][_0x2f96('0x35')]));_0x475c00['attributes']=_0x475c00[_0x2f96('0x34')]['length']?_0x475c00[_0x2f96('0x34')]:_0x50a17b[_0x2f96('0x2f')];if(_0x593f89['query'][_0x2f96('0x45')]){_0x475c00[_0x2f96('0x49')]=[{'all':!![]}];}_0x475c00=_['merge']({},_0x475c00,_0x593f89[_0x2f96('0x3f')]);return db['UserProfile'][_0x2f96('0x46')](_0x475c00)[_0x2f96('0x27')](handleEntityNotFound(_0x5ac1d9,null))[_0x2f96('0x27')](function(_0x4fae84){if(_0x4fae84){var _0x3cdc04=_0x4fae84[_0x2f96('0x4a')]({'plain':!![]});_0x3cdc04=qs['omit'](_0x3cdc04,['id',_0x2f96('0x4b'),_0x2f96('0x4c'),_0x2f96('0x4d')]);_0x593f89[_0x2f96('0x4e')]=_[_0x2f96('0x4f')](_0x593f89[_0x2f96('0x4e')],['id',_0x2f96('0x4b'),_0x2f96('0x4c')]);return db[_0x2f96('0x50')][_0x2f96('0x51')](function(_0x5d99bd){return db[_0x2f96('0x40')]['create'](_[_0x2f96('0x3e')](_0x3cdc04,_0x593f89['body']),{'include':_0x593f89[_0x2f96('0x31')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x5d99bd})[_0x2f96('0x27')](function(_0x58a042){var _0x2e024a=_0x58a042[_0x2f96('0x4a')]({'plain':!![]});return db[_0x2f96('0x52')][_0x2f96('0x53')]({'where':{'userProfileId':_0x593f89[_0x2f96('0x54')]['id']},'raw':!![]})['then'](function(_0x18d4e3){if(_0x18d4e3){return BPromise[_0x2f96('0x55')](_0x18d4e3,function(_0x135360){return new BPromise(function(_0x3c7f9c,_0x36c1ff){if(_0x135360['autoAssociation']===null||_0x135360[_0x2f96('0x56')]===0x1)_0x3c7f9c(null);return db['UserProfileResource'][_0x2f96('0x53')]({'where':{'sectionId':_0x135360['id']},'raw':!![]})[_0x2f96('0x27')](function(_0x1d6a93){var _0x44e0ce=_[_0x2f96('0x30')](_0x1d6a93,function(_0x10fb46){return qs['omit'](_0x10fb46,['id',_0x2f96('0x4b'),_0x2f96('0x4c'),_0x2f96('0x57')]);});_0x3c7f9c(_0x44e0ce);})[_0x2f96('0x42')](function(_0x1327a9){_0x36c1ff(_0x1327a9);});})[_0x2f96('0x27')](function(_0x528ff1){var _0x4c3303=qs[_0x2f96('0x4f')](_0x135360,['id',_0x2f96('0x4b'),_0x2f96('0x4c')]);_0x4c3303[_0x2f96('0x58')]=_0x2e024a['id'];if(_0x528ff1)_0x4c3303[_0x2f96('0x59')]=_0x528ff1;return _0x4c3303;})[_0x2f96('0x27')](function(_0x174dee){return db[_0x2f96('0x52')][_0x2f96('0x47')](_0x174dee,{'include':[{'model':db[_0x2f96('0x5a')],'as':_0x2f96('0x59')}],'raw':!![],'transaction':_0x5d99bd});});})[_0x2f96('0x27')](function(){return _0x2e024a;});}});});});}})[_0x2f96('0x27')](respondWithResult(_0x5ac1d9,0xc9))[_0x2f96('0x42')](handleError(_0x5ac1d9,null));};exports[_0x2f96('0x26')]=function(_0x2d9359,_0x222b76){if(_0x2d9359[_0x2f96('0x4e')]['id']){delete _0x2d9359[_0x2f96('0x4e')]['id'];}return db[_0x2f96('0x40')]['find']({'where':{'id':_0x2d9359[_0x2f96('0x54')]['id']}})[_0x2f96('0x27')](handleEntityNotFound(_0x222b76,null))['then'](saveUpdates(_0x2d9359[_0x2f96('0x4e')],null))[_0x2f96('0x27')](respondWithResult(_0x222b76,null))[_0x2f96('0x42')](handleError(_0x222b76,null));};exports['destroy']=function(_0xf74327,_0x470735){return db[_0x2f96('0x40')][_0x2f96('0x46')]({'where':{'id':_0xf74327['params']['id']}})[_0x2f96('0x27')](handleEntityNotFound(_0x470735,null))[_0x2f96('0x27')](removeEntity(_0x470735,null))[_0x2f96('0x42')](handleError(_0x470735,null));};exports[_0x2f96('0x5b')]=function(_0x48ade5,_0x1cc28e){return db['UserProfile']['describe']()[_0x2f96('0x27')](respondWithResult(_0x1cc28e,null))[_0x2f96('0x42')](handleError(_0x1cc28e,null));};exports[_0x2f96('0x5c')]=function(_0x375840,_0x5c1986){var _0x11f03f=_0x375840['body'];return db[_0x2f96('0x40')][_0x2f96('0x46')]({'where':{'id':_0x375840[_0x2f96('0x54')]['id']}})['then'](handleEntityNotFound(_0x5c1986,null))['then'](function(_0x5a3a18){if(_0x5a3a18){return db['sequelize'][_0x2f96('0x51')](function(_0x1b25a5){return db['UserProfileSection'][_0x2f96('0x5d')]({'where':{'userProfileId':_0x375840[_0x2f96('0x54')]['id'],'sectionId':_[_0x2f96('0x30')](_0x11f03f,function(_0x5a0523){return _0x5a0523[_0x2f96('0x57')];})},'transaction':_0x1b25a5})['then'](function(){var _0x30f6aa=_[_0x2f96('0x30')](_0x11f03f,function(_0x5ac491){_0x5ac491[_0x2f96('0x58')]=_0x375840['params']['id'];return _0x5ac491;});var _0x34a90a=[];return BPromise[_0x2f96('0x55')](_0x30f6aa,function(_0x56078f){return db['UserProfileSection'][_0x2f96('0x47')](_0x56078f,{'include':[{'model':db[_0x2f96('0x5a')],'as':'Resources'}],'raw':!![],'transaction':_0x1b25a5})['then'](function(_0x5b5b53){_0x34a90a[_0x2f96('0x5e')](_0x5b5b53[_0x2f96('0x4a')]({'plain':!![]}));});})[_0x2f96('0x27')](function(){return _0x34a90a;});});});}})[_0x2f96('0x27')](function(_0x471dbd){return _0x471dbd;})['then'](respondWithResult(_0x5c1986,null))[_0x2f96('0x42')](handleError(_0x5c1986,null));};exports['removeSections']=function(_0x1991fe,_0x15a8ae){var _0x414afe;return db['UserProfile']['find']({'where':{'id':_0x1991fe[_0x2f96('0x54')]['id']},'attributes':['id',_0x2f96('0x2c')]})[_0x2f96('0x27')](handleEntityNotFound(_0x15a8ae,null))[_0x2f96('0x27')](function(_0x1c715f){if(_0x1c715f){_0x414afe=_0x1c715f;return db[_0x2f96('0x52')][_0x2f96('0x5d')]({'where':{'userProfileId':_0x1991fe[_0x2f96('0x54')]['id'],'sectionId':_0x1991fe[_0x2f96('0x31')]['ids']}});}})['then'](function(){return _0x414afe;})[_0x2f96('0x27')](respondWithStatusCode(_0x15a8ae,null))['catch'](handleError(_0x15a8ae,null));};exports[_0x2f96('0x5f')]=function(_0x137346,_0x1bdbaf){var _0x529e9f=[];var _0x44a4ac=[];return db[_0x2f96('0x52')]['findAll']({'where':{'userProfileId':_0x137346['params']['id']},'raw':!![]})[_0x2f96('0x27')](function(_0x313151){_0x529e9f=_[_0x2f96('0x3c')](_0x313151,function(_0x23d033){return _0x23d033[_0x2f96('0x60')]===0x1||_[_0x2f96('0x61')]([0x3eb,0x709],_0x23d033[_0x2f96('0x57')]);});if(!_[_0x2f96('0x62')](_0x529e9f)){return _[_0x2f96('0x30')](_0x529e9f,function(_0x253086){return _0x253086[_0x2f96('0x57')];});}else{return;}})['then'](function(_0x13e814){if(_0x13e814)_0x44a4ac=_0x13e814;if(_[_0x2f96('0x61')](_0x44a4ac,0x64)){var _0x226d52=_[_0x2f96('0x46')](_0x529e9f,{'sectionId':0x64});return hasDefaultDashboard(_0x226d52)[_0x2f96('0x27')](function(_0x995327){return _[_0x2f96('0x30')](_0x529e9f,function(_0x1f10ed){if(_0x1f10ed['sectionId']===0x64){_0x1f10ed[_0x2f96('0x63')]=_0x995327;}return _0x1f10ed;});});}else{return;}})[_0x2f96('0x27')](function(_0x239f42){if(_0x239f42)_0x529e9f=_0x239f42;if(_[_0x2f96('0x61')](_0x44a4ac,0x3eb)){var _0x5e9ba2=_[_0x2f96('0x46')](_0x529e9f,{'sectionId':0x3eb});return getCustomDashboards(_0x5e9ba2)[_0x2f96('0x27')](function(_0xf316e6){return _['map'](_0x529e9f,function(_0x1e0652){if(_0x5e9ba2[_0x2f96('0x60')]){if(_0x1e0652[_0x2f96('0x57')]===0x3eb){_0x1e0652[_0x2f96('0x63')]=_0xf316e6;}}else{if(_0x1e0652['sectionId']===0x64){if(!_0x1e0652['subsections']){_0x1e0652['subsections']=[];}_0x1e0652[_0x2f96('0x63')]=_0x1e0652[_0x2f96('0x63')][_0x2f96('0x64')](_0xf316e6);}}return _0x1e0652;});});}else{return;}})['then'](function(_0x3dd626){if(_0x3dd626)_0x529e9f=_0x3dd626;if(_[_0x2f96('0x61')](_0x44a4ac,0x709)){var _0x5cf4d9=_[_0x2f96('0x46')](_0x529e9f,{'sectionId':0x709});return getPlugins(_0x5cf4d9)[_0x2f96('0x27')](function(_0x3ff5fa){if(_0x5cf4d9[_0x2f96('0x60')]){return _[_0x2f96('0x30')](_0x529e9f,function(_0x585e39){if(_0x585e39[_0x2f96('0x57')]===0x709){_0x585e39[_0x2f96('0x63')]=_0x3ff5fa;}return _0x585e39;});}else{var _0x5bcad3={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3ff5fa};var _0x68349d=_['map'](_0x529e9f);_0x68349d[_0x2f96('0x5e')](_0x5bcad3);return _0x68349d;}});}else{return;}})[_0x2f96('0x27')](function(_0x2537b8){if(_0x2537b8)_0x529e9f=_0x2537b8;return _[_0x2f96('0x3c')](_0x529e9f,['enabled',0x1]);})[_0x2f96('0x27')](respondWithResult(_0x1bdbaf,null))['catch'](handleError(_0x1bdbaf,null));};function hasDefaultDashboard(_0x38518e){var _0x56dddd=[0x65];return new BPromise(function(_0x1f6be3,_0x1d3965){try{if(_0x38518e['autoAssociation']){_0x1f6be3(_0x56dddd);}else{return db[_0x2f96('0x5a')][_0x2f96('0x65')]({'where':{'sectionId':_0x38518e['id']},'raw':!![]})['then'](function(_0x15ab8d){_0x15ab8d?_0x1f6be3(_0x56dddd):_0x1f6be3();});}}catch(_0x3224cd){_0x1d3965(_0x3224cd);}});}function getCustomDashboards(_0x36925b){var _0x2e466c=[];return new BPromise(function(_0x2c7e84,_0x58c533){try{if(_0x36925b[_0x2f96('0x56')]){return db[_0x2f96('0x66')][_0x2f96('0x53')]({'raw':!![]})[_0x2f96('0x27')](function(_0x2e34ec){_0x2e34ec[_0x2f96('0x67')](function(_0x3c82d6){_0x2e466c['push'](_0x3c82d6['id']+0x1869f);});_0x2c7e84(_0x2e466c);});}else{return db[_0x2f96('0x5a')]['findAll']({'where':{'sectionId':_0x36925b['id']},'raw':!![]})[_0x2f96('0x27')](function(_0x8445fe){_0x8445fe[_0x2f96('0x67')](function(_0x5a1938){_0x2e466c[_0x2f96('0x5e')](_0x5a1938[_0x2f96('0x68')]+0x1869f);});_0x2c7e84(_0x2e466c);});}}catch(_0x154a68){_0x58c533(_0x154a68);}});}function getPlugins(_0x1da507){var _0x118843=[];return new BPromise(function(_0x4367cb,_0x2e666b){try{if(_0x1da507[_0x2f96('0x56')]){return db['Plugin'][_0x2f96('0x53')]({'raw':!![]})[_0x2f96('0x27')](function(_0x572b7a){_0x572b7a[_0x2f96('0x67')](function(_0xf52577){_0x118843['push'](_0xf52577['id']+0x15b38);});_0x4367cb(_0x118843);});}else{return db[_0x2f96('0x5a')][_0x2f96('0x53')]({'where':{'sectionId':_0x1da507['id']},'raw':!![]})[_0x2f96('0x27')](function(_0x1bf8bf){_0x1bf8bf['forEach'](function(_0x2ee307){_0x118843[_0x2f96('0x5e')](_0x2ee307[_0x2f96('0x68')]+0x15b38);});_0x4367cb(_0x118843);});}}catch(_0x3f5b73){_0x2e666b(_0x3f5b73);}});}exports[_0x2f96('0x69')]=function(_0x33cfda,_0x18dd03){return db[_0x2f96('0x40')][_0x2f96('0x46')]({'where':{'id':_0x33cfda[_0x2f96('0x54')]['id']}})[_0x2f96('0x27')](handleEntityNotFound(_0x18dd03,null))[_0x2f96('0x27')](function(_0x452554){if(_0x452554){return db['sequelize'][_0x2f96('0x51')](function(_0x4ab77b){return db[_0x2f96('0x52')][_0x2f96('0x53')]({'where':{'userProfileId':_0x33cfda[_0x2f96('0x54')]['id']},'attributes':['id'],'raw':!![]})[_0x2f96('0x27')](function(_0x2ce075){if(_0x2ce075){return db[_0x2f96('0x52')]['destroy']({'where':{'userProfileId':_0x33cfda[_0x2f96('0x54')]['id'],'id':_['map'](_0x2ce075,function(_0x226519){return _0x226519['id'];})},'transaction':_0x4ab77b});}})[_0x2f96('0x27')](function(_0x5482bb){var _0x3771a9=_[_0x2f96('0x30')](_0x33cfda[_0x2f96('0x4e')],function(_0x45ff47){_0x45ff47['userProfileId']=_0x33cfda[_0x2f96('0x54')]['id'];return _0x45ff47;});return db[_0x2f96('0x52')][_0x2f96('0x6a')](_0x3771a9,{'raw':!![],'transaction':_0x4ab77b});})[_0x2f96('0x27')](function(_0x573e8a){var _0x17d058=_[_0x2f96('0x3c')](_[_0x2f96('0x30')](_0x573e8a,function(_0x4254f1){return _0x4254f1['get']({'plain':!![]});}),{'includeAll':![]});if(_0x17d058){return db[_0x2f96('0x52')][_0x2f96('0x53')]({'where':{'userProfileId':_0x33cfda[_0x2f96('0x54')]['id'],'sectionId':_['map'](_0x17d058,function(_0xe9b477){return _0xe9b477[_0x2f96('0x57')];})},'attributes':['id',_0x2f96('0x57')],'raw':!![]})[_0x2f96('0x27')](function(_0x33c0ae){var _0x1e31b4=_[_0x2f96('0x30')](_0x33cfda[_0x2f96('0x4e')],function(_0xf535fa){_0xf535fa['userProfileId']=_0x33cfda[_0x2f96('0x54')]['id'];return _0xf535fa;});return db[_0x2f96('0x5a')]['bulkCreate'](_0x1e31b4,{'raw':!![],'transaction':_0x4ab77b});});}})[_0x2f96('0x42')](handleError(_0x18dd03,null));});}})[_0x2f96('0x27')](function(_0x1153fb){var _0x17a9f1=_[_0x2f96('0x30')](_0x1153fb,function(_0x508387){return _0x508387[_0x2f96('0x4a')]({'plain':!![]});});})['then'](respondWithResult(_0x18dd03,null))['catch'](handleError(_0x18dd03,null));};exports['removeResources']=function(_0x226cb9,_0x3659dc,_0x572b71){return db[_0x2f96('0x40')][_0x2f96('0x46')]({'where':{'id':_0x226cb9[_0x2f96('0x54')]['id']}})['then'](handleEntityNotFound(_0x3659dc,null))[_0x2f96('0x27')](function(_0xa3450d){if(_0xa3450d){return _0xa3450d[_0x2f96('0x6b')](_0x226cb9[_0x2f96('0x31')][_0x2f96('0x6c')]);}})[_0x2f96('0x27')](respondWithStatusCode(_0x3659dc,null))[_0x2f96('0x42')](handleError(_0x3659dc,null));};exports[_0x2f96('0x6d')]=function(_0x327881,_0x4f1d72){var _0x4cc65b={};if(!_0x327881[_0x2f96('0x31')][_0x2f96('0x6e')])throw new Error(_0x2f96('0x6f'));if(!_0x327881[_0x2f96('0x31')][_0x2f96('0x37')](_0x2f96('0x38'))){_0x4cc65b[_0x2f96('0x1e')]=qs[_0x2f96('0x1e')](_0x327881[_0x2f96('0x31')][_0x2f96('0x1e')]);_0x4cc65b[_0x2f96('0x20')]=qs[_0x2f96('0x20')](_0x327881[_0x2f96('0x31')][_0x2f96('0x20')]);}return db[_0x2f96('0x40')]['find']({'where':{'id':_0x327881[_0x2f96('0x54')]['id']}})['then'](function(_0x4000a8){if(!_0x4000a8)throw new Error(_0x2f96('0x70')+_0x327881[_0x2f96('0x54')]['id']);return db[_0x2f96('0x40')][_0x2f96('0x6d')](_0x327881);})['then'](respondWithFilteredResult(_0x4f1d72,_0x4cc65b))[_0x2f96('0x42')](handleError(_0x4f1d72,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 9c5773f..5824a9d 100644 --- a/server/api/userProfile/userProfile.events.js +++ b/server/api/userProfile/userProfile.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x002d=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','update','remove'];(function(_0x2c919a,_0x47c5e6){var _0x4a6261=function(_0x3e6f50){while(--_0x3e6f50){_0x2c919a['push'](_0x2c919a['shift']());}};_0x4a6261(++_0x47c5e6);}(_0x002d,0xca));var _0xd002=function(_0x55fb1e,_0x6caf25){_0x55fb1e=_0x55fb1e-0x0;var _0x27bf71=_0x002d[_0x55fb1e];return _0x27bf71;};'use strict';var EventEmitter=require(_0xd002('0x0'));var UserProfile=require(_0xd002('0x1'))['db'][_0xd002('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd002('0x3'),'afterDestroy':_0xd002('0x4')};function emitEvent(_0x1c0d0a){return function(_0x24ff42,_0x1323f0,_0x179915){UserProfileEvents[_0xd002('0x5')](_0x1c0d0a+':'+_0x24ff42['id'],_0x24ff42);UserProfileEvents[_0xd002('0x5')](_0x1c0d0a,_0x24ff42);_0x179915(null);};}for(var e in events){if(events[_0xd002('0x6')](e)){var event=events[e];UserProfile[_0xd002('0x7')](e,emitEvent(event));}}module[_0xd002('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x3914=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x425ecf,_0x495081){var _0x580f4c=function(_0x57058a){while(--_0x57058a){_0x425ecf['push'](_0x425ecf['shift']());}};_0x580f4c(++_0x495081);}(_0x3914,0xeb));var _0x4391=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0x3914[_0x541ea6];return _0x3c3e84;};'use strict';var EventEmitter=require(_0x4391('0x0'));var UserProfile=require(_0x4391('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x4391('0x2')](0x0);var events={'afterCreate':_0x4391('0x3'),'afterUpdate':'update','afterDestroy':_0x4391('0x4')};function emitEvent(_0x343fb7){return function(_0x175dbc,_0x5b5acb,_0x1eecd4){UserProfileEvents[_0x4391('0x5')](_0x343fb7+':'+_0x175dbc['id'],_0x175dbc);UserProfileEvents['emit'](_0x343fb7,_0x175dbc);_0x1eecd4(null);};}for(var e in events){if(events[_0x4391('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x4391('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 6e1cb5b..3057de9 100644 --- a/server/api/userProfile/userProfile.model.js +++ b/server/api/userProfile/userProfile.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe985=['VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','agent','Telephones','role','VoiceQueues','VoiceQueue','QueueCampaigns','queue','outbound','chanspies','VoiceChanSpy','voiceprefixes','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','teams','Team','queuecampaigns','users','agents','telephones','admin','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','DeskAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Dashboard','intervals','Interval','pauses','Pause','sounds','Sound','tags','templates','Template','triggers','Trigger','trunks','variables','Variable','plugins','Plugin','Reports','reportId','toUpperCase','slice','QueryTypes','SELECT','select','ui.','InteractionId','user_has_','where','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','user_profiles','../../components/parsers/qs','raw','section','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','union','ignore','model','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','key','VIRTUAL','AnalyticExtractedReport','foreignKey','merge','options','autoAssociation','includeAll','reportType','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','CmContact','include','tag','Tag','openTabs','chat','dataValues','sms','mail','lodash','./userProfile.attributes','exports','models','filter','field','then','associatedResources','map','catch','value','findAll','name','resolve','UserProfileResource','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','parentSections','projectName','projects','JscriptyProject','contacts','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatWebsite','faxqueues','FaxAccount','inboundroutes','internalroutes','outboundroutes'];(function(_0x36bff5,_0x3156cb){var _0x80ade5=function(_0x5eee65){while(--_0x5eee65){_0x36bff5['push'](_0x36bff5['shift']());}};_0x80ade5(++_0x3156cb);}(_0xe985,0x13f));var _0x5e98=function(_0x57a402,_0x40596b){_0x57a402=_0x57a402-0x0;var _0x753a36=_0xe985[_0x57a402];return _0x753a36;};'use strict';var _=require(_0x5e98('0x0'));var attributes=require(_0x5e98('0x1'));var squel=require('squel');module[_0x5e98('0x2')]=function(_0x332c19){var _0x3fd4be=_0x332c19[_0x5e98('0x3')];function _0x3d52b0(_0x3780c4,_0x328f47){return new Promise(function(_0x2d5d4e,_0x41f6d0){if(!_0x328f47)return _0x2d5d4e(null);var _0x4c6a38=_0x328f47[_0x5e98('0x4')]?{[_0x328f47[_0x5e98('0x4')][_0x5e98('0x5')]]:_0x328f47[_0x5e98('0x4')]['value']}:undefined;return _0x3fd4be[_0x3780c4]['findAll']({'where':_0x4c6a38,'raw':!![]})[_0x5e98('0x6')](function(_0x5bba95){_0x328f47[_0x5e98('0x7')]=_[_0x5e98('0x8')](_0x5bba95,'id');_0x2d5d4e(_0x328f47);})[_0x5e98('0x9')](function(_0x57e8b4){_0x41f6d0(_0x57e8b4);});});}function _0x201fa4(_0x35f240,_0x4ba2f8){return new Promise(function(_0x3c30d8,_0x5fe9f7){var _0xd2c7b6=_0x35f240[_0x5e98('0x4')]?{[_0x35f240['filter'][_0x5e98('0x5')]]:_0x35f240[_0x5e98('0x4')][_0x5e98('0xa')]}:undefined;return _0x3fd4be[_0x35f240['model']][_0x5e98('0xb')]({'where':_0xd2c7b6,'raw':!![]})[_0x5e98('0x6')](function(_0x20ea76){_0x4ba2f8[_0x5e98('0x7')]=_['map'](_0x20ea76,function(_0x25b454){return _0x25b454[_0x5e98('0xc')];});_0x3c30d8(_0x4ba2f8);})[_0x5e98('0x9')](function(_0x5aa39a){_0x5fe9f7(_0x5aa39a);});});}function _0x1bde53(_0x40bc37,_0x348ba4,_0x470961){if(!_0x348ba4)return Promise[_0x5e98('0xd')](null);return new Promise(function(_0x1c2251,_0x37b3bc){return _0x3fd4be[_0x5e98('0xe')]['findAll']({'where':{'sectionId':_0x348ba4['id']},'raw':!![]})[_0x5e98('0x6')](function(_0x3e367f){if(_0x40bc37[_0x5e98('0x5')]&&_0x40bc37[_0x5e98('0x5')]!=='id'){_0x348ba4[_0x5e98('0x7')]=_[_0x5e98('0x8')](_0x3e367f,function(_0x23b4b1){return _0x23b4b1[_0x40bc37['field']];});}else{if(_0x470961==='AnalyticExtractedReport'){_0x348ba4['associatedResources']=_[_0x5e98('0x8')](_0x3e367f,function(_0x445d8f){return{'id':_0x445d8f['resourceId'],'type':_0x445d8f[_0x5e98('0xf')]};});}else{_0x348ba4['associatedResources']=_['map'](_0x3e367f,function(_0x14108b){return _0x14108b['resourceId'];});}}_0x1c2251(_0x348ba4);})[_0x5e98('0x9')](function(_0x1d96b2){_0x37b3bc(_0x1d96b2);});});}function _0x6da3f7(_0x2edc3f,_0x200db5){var _0xde2cdf={'parentSections':[]};switch(_0x2edc3f[_0x5e98('0x10')]()){case _0x5e98('0x11'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x13');break;case _0x5e98('0x14'):_0xde2cdf['childModel']='SquareOdbc';break;case _0x5e98('0x15'):_0xde2cdf[_0x5e98('0x12')]='SquareRecording';_0xde2cdf[_0x5e98('0x16')]=[{'name':'SquareProjects','field':_0x5e98('0xc'),'foreignKey':_0x5e98('0x17')}];break;case _0x5e98('0x18'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x19');break;case _0x5e98('0x1a'):_0xde2cdf['childModel']='CmContact';_0xde2cdf[_0x5e98('0x16')]=[{'name':_0x5e98('0x1b'),'field':'id','foreignKey':_0x5e98('0x1c')}];break;case'lists':_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x1d');break;case _0x5e98('0x1e'):_0xde2cdf['childModel']=_0x5e98('0x1f');break;case _0x5e98('0x20'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x21');break;case _0x5e98('0x22'):_0xde2cdf[_0x5e98('0x12')]='ChatQueue';break;case'chatwebsites':_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x23');break;case _0x5e98('0x24'):_0xde2cdf[_0x5e98('0x12')]='FaxQueue';break;case'faxaccounts':_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x25');break;case _0x5e98('0x26'):case _0x5e98('0x27'):case _0x5e98('0x28'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x29');break;case _0x5e98('0x2a'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x2b');break;case _0x5e98('0x2c'):_0xde2cdf[_0x5e98('0x12')]='VoiceMail';break;case _0x5e98('0x2d'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x2e');_0xde2cdf[_0x5e98('0x16')]=[{'name':_0x5e98('0x2f'),'field':_0x5e98('0xc'),'foreignKey':_0x5e98('0x30'),'model':_0x5e98('0x31'),'filter':{'field':'role','value':[_0x5e98('0x32')]}},{'name':_0x5e98('0x33'),'field':_0x5e98('0xc'),'foreignKey':_0x5e98('0x30'),'model':_0x5e98('0x31'),'filter':{'field':_0x5e98('0x34'),'value':['telephone']}},{'name':_0x5e98('0x35'),'field':_0x5e98('0xc'),'foreignKey':'queue','model':_0x5e98('0x36'),'filter':{'field':_0x5e98('0xf'),'value':['inbound']}},{'name':_0x5e98('0x37'),'field':_0x5e98('0xc'),'foreignKey':_0x5e98('0x38'),'model':_0x5e98('0x36'),'filter':{'field':_0x5e98('0xf'),'value':[_0x5e98('0x39')]}}];break;case'musiconholds':_0xde2cdf[_0x5e98('0x12')]='VoiceMusicOnHold';break;case _0x5e98('0x3a'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x3b');break;case _0x5e98('0x3c'):_0xde2cdf[_0x5e98('0x12')]='VoicePrefix';break;case'ivrcampaigns':_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x3d');break;case _0x5e98('0x3e'):_0xde2cdf['childModel']=_0x5e98('0x3f');break;case _0x5e98('0x40'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x41');break;case _0x5e98('0x42'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x43');break;case _0x5e98('0x44'):_0xde2cdf[_0x5e98('0x12')]='OpenchannelQueue';break;case _0x5e98('0x45'):_0xde2cdf['childModel']=_0x5e98('0x46');break;case'smsqueues':_0xde2cdf['childModel']=_0x5e98('0x47');break;case _0x5e98('0x48'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x49');break;case'whatsappqueues':_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x4a');break;case _0x5e98('0x4b'):_0xde2cdf[_0x5e98('0x12')]='WhatsappAccount';break;case _0x5e98('0x4c'):_0xde2cdf['childModel']=_0x5e98('0x4d');break;case'voicequeues':case _0x5e98('0x4e'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x36');if(_0x200db5){_0xde2cdf[_0x5e98('0x16')]=[{'name':_0x5e98('0x35')},{'name':_0x5e98('0x37')}];}break;case _0x5e98('0x4f'):case _0x5e98('0x50'):case _0x5e98('0x51'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x31');if(_0x200db5){_0xde2cdf[_0x5e98('0x16')]=[{'name':'Users','filter':{'field':_0x5e98('0x34'),'value':[_0x5e98('0x52'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0x5e98('0x33')}];}break;case _0x5e98('0x53'):_0xde2cdf[_0x5e98('0x12')]='ZendeskAccount';break;case _0x5e98('0x54'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x55');break;case _0x5e98('0x56'):_0xde2cdf['childModel']='FreshdeskAccount';break;case _0x5e98('0x57'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x58');break;case'deskaccounts':_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x59');break;case'zohoaccounts':_0xde2cdf[_0x5e98('0x12')]='ZohoAccount';break;case _0x5e98('0x5a'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x31');break;case _0x5e98('0x5b'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x5c');break;case _0x5e98('0x5d'):_0xde2cdf[_0x5e98('0x12')]='Disposition';break;case'customdashboards':_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x5e');break;case _0x5e98('0x5f'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x60');break;case _0x5e98('0x61'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x62');break;case'scheduler':_0xde2cdf[_0x5e98('0x12')]='Schedule';break;case _0x5e98('0x63'):_0xde2cdf['childModel']=_0x5e98('0x64');break;case _0x5e98('0x65'):_0xde2cdf[_0x5e98('0x12')]='Tag';break;case _0x5e98('0x66'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x67');break;case _0x5e98('0x68'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x69');break;case _0x5e98('0x6a'):_0xde2cdf[_0x5e98('0x12')]='Trunk';break;case _0x5e98('0x6b'):_0xde2cdf['childModel']=_0x5e98('0x6c');break;case _0x5e98('0x6d'):_0xde2cdf[_0x5e98('0x12')]=_0x5e98('0x6e');break;case'extractedreports':_0xde2cdf['childModel']='AnalyticExtractedReport';_0xde2cdf['parentSections']=[{'name':_0x5e98('0x6f'),'field':'id','foreignKey':_0x5e98('0x70')}];break;case'metrics':_0xde2cdf['childModel']='AnalyticMetric';break;}return _0xde2cdf;}function _0x48b1ef(_0x580cb3,_0x1c4cd6){var _0x5b15ac=_0x580cb3['charAt'](0x0)[_0x5e98('0x71')]()+_0x580cb3[_0x5e98('0x72')](0x1);var _0x5e1aa5={'type':_0x3fd4be['Sequelize'][_0x5e98('0x73')][_0x5e98('0x74')],'raw':!![]};return new Promise(function(_0x3d0b3d,_0x236713){var _0x2aa57f=squel[_0x5e98('0x75')]()[_0x5e98('0x5')](_0x5e98('0x76')+_0x5b15ac+_0x5e98('0x77'),'id')['field']('ui.createdAt')['from'](_0x5e98('0x78')+_0x580cb3+'_interactions','ui')[_0x5e98('0x79')](_0x5e98('0x7a'),_0x1c4cd6['id']);return _0x3fd4be[_0x5e98('0x7b')][_0x5e98('0x7c')](_0x2aa57f['toString'](),_0x5e1aa5)['then'](function(_0x4b1323){_0x1c4cd6[_0x5b15ac+_0x5e98('0x7d')]=_0x4b1323;_0x3d0b3d(_0x4b1323);})[_0x5e98('0x9')](function(_0x16083d){_0x236713(_0x16083d);});});}return _0x332c19['define']('UserProfile',attributes,{'tableName':_0x5e98('0x7e'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x38c0dd){var _0x3c965f=require(_0x5e98('0x7f'));var _0x2e13a9={'raw':_0x38c0dd['query'][_0x5e98('0x80')],'where':{}};var _0xbbfb4e={};var _0x472b9c={'count':0x0,'rows':[]};var _0x2cab40=_0x38c0dd[_0x5e98('0x7c')][_0x5e98('0x81')];var _0x2aa182=_0x38c0dd[_0x5e98('0x7c')]['mergeResources']||![];var _0x53db7a=_0x6da3f7(_0x2cab40,_0x2aa182);if(!_0x53db7a[_0x5e98('0x12')])throw new Error(_0x5e98('0x82')+_0x2cab40+'\x27');var _0x599ea9=[{'name':_0x2cab40}];if(!_[_0x5e98('0x83')](_0x53db7a[_0x5e98('0x16')]))_0x599ea9=_0x53db7a['parentSections'];var _0x30701c=[];for(var _0x533a75=0x0;_0x533a75<_0x599ea9[_0x5e98('0x84')];_0x533a75++){_0x30701c[_0x5e98('0x85')](_0x3fd4be[_0x5e98('0x86')][_0x5e98('0x87')]({'where':{'userProfileId':_0x38c0dd[_0x5e98('0x88')]['id'],'name':_0x599ea9[_0x533a75][_0x5e98('0xc')]},'raw':!![]}));}return Promise[_0x5e98('0x89')](_0x30701c)[_0x5e98('0x6')](function(_0x182da1){var _0x2c83d6=_[_0x5e98('0x4')](_0x182da1,function(_0x2b4f38){return _0x2b4f38?_0x2b4f38:undefined;});var _0x109d08=_[_0x5e98('0x4')](_0x599ea9,['ignore',!![]]);var _0x493e72=_[_0x5e98('0x83')](_0x2c83d6)&&_[_0x5e98('0x83')](_0x109d08)?null:_[_0x5e98('0x8a')](_0x109d08,_0x2c83d6);if(!_0x493e72)return null;var _0x1a865f=[];for(var _0x33cebb=0x0;_0x33cebb<_0x493e72['length'];_0x33cebb++){var _0xdf72c4=_[_0x5e98('0x87')](_0x599ea9,function(_0x44f2a9){return _0x493e72[_0x33cebb]?_0x44f2a9['name']===_0x493e72[_0x33cebb][_0x5e98('0xc')]:null;});if(_0xdf72c4){if(_0x493e72[_0x33cebb][_0x5e98('0x8b')]){_0x1a865f['push'](_0x3d52b0(_0x53db7a[_0x5e98('0x12')],_0x493e72[_0x33cebb]));}else{if(!_0x493e72[_0x33cebb]['autoAssociation']){_0x1a865f[_0x5e98('0x85')](_0x1bde53(_0xdf72c4,_0x493e72[_0x33cebb],_0x53db7a[_0x5e98('0x12')]));}else{if(_0xdf72c4[_0x5e98('0x8c')]){_0x1a865f['push'](_0x201fa4(_0xdf72c4,_0x493e72[_0x33cebb]));}}}}}return Promise['all'](_0x1a865f);})['then'](function(_0x160c72){var _0x19c9e9=_0x160c72;var _0x4cb7ce=null;if(_0x19c9e9){_0x4cb7ce=_0x19c9e9[_0x5e98('0x84')]===0x1?_0x19c9e9[0x0]:null;}if(!_0x4cb7ce&&!_0x19c9e9)return _0x472b9c;var _0x2d62e6=_0x3fd4be[_0x53db7a[_0x5e98('0x12')]]['rawAttributes'];_0xbbfb4e[_0x5e98('0x8c')]=_['keys'](_0x2d62e6);_0xbbfb4e[_0x5e98('0x7c')]=_[_0x5e98('0x8d')](_0x38c0dd[_0x5e98('0x7c')]);_0xbbfb4e[_0x5e98('0x8e')]=_[_0x5e98('0x8f')](_0xbbfb4e[_0x5e98('0x8c')],_0xbbfb4e['query']);_0x2e13a9['attributes']=_[_0x5e98('0x8f')](_0xbbfb4e['model'],_0x3c965f[_0x5e98('0x90')](_0x38c0dd[_0x5e98('0x7c')][_0x5e98('0x90')]));_0x2e13a9[_0x5e98('0x91')]=_0x2e13a9[_0x5e98('0x91')][_0x5e98('0x84')]?_0x2e13a9[_0x5e98('0x91')]:_0xbbfb4e[_0x5e98('0x8c')];if(!_0x38c0dd[_0x5e98('0x7c')][_0x5e98('0x92')](_0x5e98('0x93'))){_0x2e13a9['limit']=_0x3c965f[_0x5e98('0x94')](_0x38c0dd[_0x5e98('0x7c')][_0x5e98('0x94')]);_0x2e13a9['offset']=_0x3c965f['offset'](_0x38c0dd[_0x5e98('0x7c')][_0x5e98('0x95')]);}_0x2e13a9[_0x5e98('0x96')]=_0x3c965f[_0x5e98('0x97')](_0x38c0dd['query'][_0x5e98('0x97')]);_0x2e13a9[_0x5e98('0x79')]=_0x3c965f[_0x5e98('0x8e')](_[_0x5e98('0x98')](_0x38c0dd['query'],_0xbbfb4e[_0x5e98('0x8e')]));if(_0x38c0dd[_0x5e98('0x7c')][_0x5e98('0x4')]){_0x2e13a9['where']=_['merge'](_0x2e13a9[_0x5e98('0x79')],{'$or':_[_0x5e98('0x8')](_0x2d62e6,function(_0x4743e0){if(_0x4743e0[_0x5e98('0xf')][_0x5e98('0x99')]!==_0x5e98('0x9a')){var _0x276712={};_0x276712[_0x4743e0[_0x5e98('0x5')]]={'$like':'%'+_0x38c0dd[_0x5e98('0x7c')][_0x5e98('0x4')]+'%'};return _0x276712;}})});}var _0xab9bb8=[];var _0x542195=null;var _0x417b8c={};if(_0x4cb7ce){_0x542195=_[_0x5e98('0x87')](_0x599ea9,[_0x5e98('0xc'),_0x4cb7ce[_0x5e98('0xc')]]);if(_0x542195['field']){_0x417b8c={};if(_0x53db7a['childModel']===_0x5e98('0x9b')){_0x417b8c[_0x542195[_0x5e98('0x9c')]]=_[_0x5e98('0x8')](_0x4cb7ce[_0x5e98('0x7')],'id');}else{_0x417b8c[_0x542195['foreignKey']]=_0x4cb7ce[_0x5e98('0x7')];}_0xab9bb8[_0x5e98('0x85')](_0x417b8c);}else{_0x2e13a9['where']['id']=_0x4cb7ce['associatedResources'];}}else{for(var _0xe416a3=0x0;_0xe416a3<_0x19c9e9[_0x5e98('0x84')];_0xe416a3++){_0x542195=_[_0x5e98('0x87')](_0x599ea9,['name',_0x19c9e9[_0xe416a3][_0x5e98('0xc')]]);if(_0x542195[_0x5e98('0x5')]){_0x417b8c={};_0x417b8c[_0x542195[_0x5e98('0x9c')]]=_0x19c9e9[_0xe416a3][_0x5e98('0x7')];_0xab9bb8['push'](_0x417b8c);}else{if(!_0x2e13a9[_0x5e98('0x79')]['id'])_0x2e13a9[_0x5e98('0x79')]['id']=[];_0x19c9e9[_0xe416a3]['associatedResources']['forEach'](function(_0x185cb3){_0x2e13a9[_0x5e98('0x79')]['id'][_0x5e98('0x85')](_0x185cb3);});}}}if(!_[_0x5e98('0x83')](_0xab9bb8)){_0x2e13a9[_0x5e98('0x79')]=_[_0x5e98('0x9d')](_0x2e13a9[_0x5e98('0x79')],{'$and':{'$or':_0xab9bb8}});}_0x2e13a9=_['merge']({},_0x2e13a9,_0x38c0dd[_0x5e98('0x9e')]);if(_0x4cb7ce&&!_0x4cb7ce[_0x5e98('0x9f')]&&_0x53db7a[_0x5e98('0x12')]==='AnalyticExtractedReport'){if(_0x38c0dd['query'][_0x5e98('0xa0')]){_0x2e13a9['include']=[{'all':!![]}];}return _0x3fd4be[_0x53db7a[_0x5e98('0x12')]]['findAll'](_0x2e13a9)[_0x5e98('0x6')](function(_0x37921e){var _0x117e55=[];_0x37921e['forEach'](function(_0x1b93a8){var _0x1ea3fa;switch(_0x1b93a8[_0x5e98('0xa1')]){case _0x5e98('0xa2'):_0x1ea3fa=_['find'](_0x4cb7ce[_0x5e98('0x7')],function(_0x57cc0f){return _0x57cc0f['id']===_0x1b93a8['reportId']&&_0x57cc0f[_0x5e98('0xf')]===_0x5e98('0xa3');});break;case _0x5e98('0xa4'):_0x1ea3fa=_[_0x5e98('0x87')](_0x4cb7ce['associatedResources'],function(_0x4b642d){return _0x4b642d['id']===_0x1b93a8[_0x5e98('0x70')]&&_0x4b642d[_0x5e98('0xf')]===_0x5e98('0xa5');});break;}if(_0x1ea3fa)_0x117e55['push'](_0x1b93a8);});_0x472b9c[_0x5e98('0xa6')]=_0x117e55['length'];_0x472b9c[_0x5e98('0xa7')]=_0x117e55;return _0x472b9c;});}else{if(!_[_0x5e98('0x83')](_0x38c0dd[_0x5e98('0x7c')]['ids'])){_0x2e13a9[_0x5e98('0x79')]['id']=_0x2e13a9[_0x5e98('0x79')]['id']?_['intersection'](_0x2e13a9[_0x5e98('0x79')]['id'],_0x38c0dd[_0x5e98('0x7c')][_0x5e98('0xa8')]):_0x38c0dd[_0x5e98('0x7c')]['ids'];if(_0x38c0dd[_0x5e98('0x7c')][_0x5e98('0xa9')]){_0x2e13a9[_0x5e98('0x96')]=_0x38c0dd['query']['customSorting'];}}if(_0x38c0dd[_0x5e98('0x7c')][_0x5e98('0xaa')]){_0x2e13a9['where']=_[_0x5e98('0x9d')](_0x2e13a9[_0x5e98('0x79')],{'$and':_0x38c0dd[_0x5e98('0x7c')]['extraQueryConditions']});}return _0x3fd4be[_0x53db7a[_0x5e98('0x12')]]['count']({'where':_0x2e13a9[_0x5e98('0x79')]})['then'](function(_0x5c6002){_0x472b9c[_0x5e98('0xa6')]=_0x5c6002;if(_0x38c0dd['query'][_0x5e98('0xa0')]){if(_0x53db7a['childModel']===_0x5e98('0xab')){_0x2e13a9[_0x5e98('0xac')]=[{'model':_0x3fd4be['Tag'],'as':'Tags','attributes':['id',_0x5e98('0xc'),'color'],'required':_0x38c0dd[_0x5e98('0x7c')][_0x5e98('0xad')]?!![]:![]},{'model':_0x3fd4be[_0x5e98('0xae')],'as':'ThroughTags','attributes':['id',_0x5e98('0xc'),'color'],'through':_0x38c0dd['query'][_0x5e98('0xad')]?{'attributes':[],'where':{'TagId':_0x38c0dd['query'][_0x5e98('0xad')]||undefined}}:{},'required':_0x38c0dd[_0x5e98('0x7c')][_0x5e98('0xad')]?!![]:![]}];}else{_0x2e13a9['include']=[{'all':!![]}];}}return _0x3fd4be[_0x53db7a[_0x5e98('0x12')]][_0x5e98('0xb')](_0x2e13a9);})[_0x5e98('0x6')](function(_0xdfbfc0){_0x472b9c[_0x5e98('0xa7')]=_0xdfbfc0;if(_0x2cab40===_0x5e98('0x2f')&&_0x38c0dd[_0x5e98('0x7c')][_0x5e98('0xaf')]==='true'){var _0x4c888e=[];for(var _0x24e879=0x0;_0x24e879<_0x472b9c[_0x5e98('0xa7')][_0x5e98('0x84')];_0x24e879++){_0x4c888e[_0x5e98('0x85')](_0x48b1ef(_0x5e98('0xb0'),_0x472b9c[_0x5e98('0xa7')][_0x24e879][_0x5e98('0xb1')]));_0x4c888e['push'](_0x48b1ef(_0x5e98('0xb2'),_0x472b9c['rows'][_0x24e879]['dataValues']));_0x4c888e[_0x5e98('0x85')](_0x48b1ef('fax',_0x472b9c[_0x5e98('0xa7')][_0x24e879][_0x5e98('0xb1')]));_0x4c888e['push'](_0x48b1ef(_0x5e98('0xb3'),_0x472b9c[_0x5e98('0xa7')][_0x24e879][_0x5e98('0xb1')]));_0x4c888e[_0x5e98('0x85')](_0x48b1ef('openchannel',_0x472b9c[_0x5e98('0xa7')][_0x24e879]['dataValues']));_0x4c888e[_0x5e98('0x85')](_0x48b1ef('whatsapp',_0x472b9c[_0x5e98('0xa7')][_0x24e879]['dataValues']));}return Promise[_0x5e98('0x89')](_0x4c888e)['then'](function(){return _0x472b9c;});}return _0x472b9c;});}});}}});}; \ No newline at end of file +var _0x65c0=['models','filter','findAll','then','associatedResources','value','model','map','catch','UserProfileResource','field','AnalyticExtractedReport','resourceId','type','squareprojects','childModel','SquareProject','odbc','SquareOdbc','SquareRecording','parentSections','SquareProjects','name','projectName','JscriptyProject','Lists','lists','CmList','CmCompany','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','User','role','membername','telephone','queue','VoiceQueue','outbound','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','QueueCampaigns','users','agents','telephones','admin','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','intervals','pauses','Pause','scheduler','sounds','tags','triggers','Trigger','trunks','Trunk','Variable','plugins','extractedreports','Reports','reportId','metrics','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','raw','query','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','params','ignore','autoAssociation','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','where','pick','merge','key','VIRTUAL','find','foreignKey','options','includeAll','include','DefaultReports','custom','CustomReports','count','ids','customSorting','order','extraQueryConditions','CmContact','Tag','Tags','color','ThroughTags','tag','rows','openTabs','true','dataValues','sms','fax','mail','openchannel','whatsapp','all','lodash','./userProfile.attributes','squel'];(function(_0x5a2f4b,_0x425b95){var _0x169410=function(_0x5748b6){while(--_0x5748b6){_0x5a2f4b['push'](_0x5a2f4b['shift']());}};_0x169410(++_0x425b95);}(_0x65c0,0x17f));var _0x065c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x65c0[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x065c('0x0'));var attributes=require(_0x065c('0x1'));var squel=require(_0x065c('0x2'));module['exports']=function(_0x4c4b4a){var _0x2dfebc=_0x4c4b4a[_0x065c('0x3')];function _0x548ca5(_0x486b90,_0x4d0522){return new Promise(function(_0x3da58f,_0x46a47f){if(!_0x4d0522)return _0x3da58f(null);var _0x495ec5=_0x4d0522[_0x065c('0x4')]?{[_0x4d0522[_0x065c('0x4')]['field']]:_0x4d0522[_0x065c('0x4')]['value']}:undefined;return _0x2dfebc[_0x486b90][_0x065c('0x5')]({'where':_0x495ec5,'raw':!![]})[_0x065c('0x6')](function(_0x5889e8){_0x4d0522[_0x065c('0x7')]=_['map'](_0x5889e8,'id');_0x3da58f(_0x4d0522);})['catch'](function(_0x2733eb){_0x46a47f(_0x2733eb);});});}function _0x1c9558(_0x16ad42,_0x239998){return new Promise(function(_0x1b9599,_0x2c3a7a){var _0x160bde=_0x16ad42['filter']?{[_0x16ad42['filter']['field']]:_0x16ad42['filter'][_0x065c('0x8')]}:undefined;return _0x2dfebc[_0x16ad42[_0x065c('0x9')]][_0x065c('0x5')]({'where':_0x160bde,'raw':!![]})[_0x065c('0x6')](function(_0x28e9bb){_0x239998[_0x065c('0x7')]=_[_0x065c('0xa')](_0x28e9bb,function(_0x2b183d){return _0x2b183d['name'];});_0x1b9599(_0x239998);})[_0x065c('0xb')](function(_0xe6e2f0){_0x2c3a7a(_0xe6e2f0);});});}function _0x40dcb4(_0x14dfd5,_0x42e999,_0x4817e4){if(!_0x42e999)return Promise['resolve'](null);return new Promise(function(_0x213de0,_0x1c4683){return _0x2dfebc[_0x065c('0xc')][_0x065c('0x5')]({'where':{'sectionId':_0x42e999['id']},'raw':!![]})[_0x065c('0x6')](function(_0x14125a){if(_0x14dfd5[_0x065c('0xd')]&&_0x14dfd5[_0x065c('0xd')]!=='id'){_0x42e999[_0x065c('0x7')]=_[_0x065c('0xa')](_0x14125a,function(_0x45242b){return _0x45242b[_0x14dfd5[_0x065c('0xd')]];});}else{if(_0x4817e4===_0x065c('0xe')){_0x42e999[_0x065c('0x7')]=_['map'](_0x14125a,function(_0x27a3e1){return{'id':_0x27a3e1[_0x065c('0xf')],'type':_0x27a3e1[_0x065c('0x10')]};});}else{_0x42e999[_0x065c('0x7')]=_[_0x065c('0xa')](_0x14125a,function(_0x3948b8){return _0x3948b8[_0x065c('0xf')];});}}_0x213de0(_0x42e999);})['catch'](function(_0x3858a2){_0x1c4683(_0x3858a2);});});}function _0x1fd24c(_0x259ebf,_0x322723){var _0x32d519={'parentSections':[]};switch(_0x259ebf['toLowerCase']()){case _0x065c('0x11'):_0x32d519[_0x065c('0x12')]=_0x065c('0x13');break;case _0x065c('0x14'):_0x32d519[_0x065c('0x12')]=_0x065c('0x15');break;case'squarerecordings':_0x32d519[_0x065c('0x12')]=_0x065c('0x16');_0x32d519[_0x065c('0x17')]=[{'name':_0x065c('0x18'),'field':_0x065c('0x19'),'foreignKey':_0x065c('0x1a')}];break;case'projects':_0x32d519[_0x065c('0x12')]=_0x065c('0x1b');break;case'contacts':_0x32d519[_0x065c('0x12')]='CmContact';_0x32d519[_0x065c('0x17')]=[{'name':_0x065c('0x1c'),'field':'id','foreignKey':'ListId'}];break;case _0x065c('0x1d'):_0x32d519[_0x065c('0x12')]=_0x065c('0x1e');break;case'companies':_0x32d519[_0x065c('0x12')]=_0x065c('0x1f');break;case _0x065c('0x20'):_0x32d519[_0x065c('0x12')]=_0x065c('0x21');break;case'chatqueues':_0x32d519['childModel']=_0x065c('0x22');break;case _0x065c('0x23'):_0x32d519[_0x065c('0x12')]=_0x065c('0x24');break;case _0x065c('0x25'):_0x32d519['childModel']=_0x065c('0x26');break;case'faxaccounts':_0x32d519[_0x065c('0x12')]=_0x065c('0x27');break;case _0x065c('0x28'):case _0x065c('0x29'):case'outboundroutes':_0x32d519[_0x065c('0x12')]=_0x065c('0x2a');break;case _0x065c('0x2b'):_0x32d519[_0x065c('0x12')]=_0x065c('0x2c');break;case _0x065c('0x2d'):_0x32d519[_0x065c('0x12')]=_0x065c('0x2e');break;case _0x065c('0x2f'):_0x32d519[_0x065c('0x12')]=_0x065c('0x30');_0x32d519[_0x065c('0x17')]=[{'name':_0x065c('0x31'),'field':_0x065c('0x19'),'foreignKey':'membername','model':_0x065c('0x32'),'filter':{'field':_0x065c('0x33'),'value':['agent']}},{'name':'Telephones','field':'name','foreignKey':_0x065c('0x34'),'model':'User','filter':{'field':_0x065c('0x33'),'value':[_0x065c('0x35')]}},{'name':'VoiceQueues','field':'name','foreignKey':'queue','model':'VoiceQueue','filter':{'field':'type','value':['inbound']}},{'name':'QueueCampaigns','field':_0x065c('0x19'),'foreignKey':_0x065c('0x36'),'model':_0x065c('0x37'),'filter':{'field':_0x065c('0x10'),'value':[_0x065c('0x38')]}}];break;case'musiconholds':_0x32d519[_0x065c('0x12')]=_0x065c('0x39');break;case _0x065c('0x3a'):_0x32d519[_0x065c('0x12')]='VoiceChanSpy';break;case _0x065c('0x3b'):_0x32d519['childModel']=_0x065c('0x3c');break;case _0x065c('0x3d'):_0x32d519[_0x065c('0x12')]=_0x065c('0x3e');break;case _0x065c('0x3f'):_0x32d519['childModel']=_0x065c('0x40');break;case'mailaccounts':_0x32d519['childModel']=_0x065c('0x41');break;case _0x065c('0x42'):_0x32d519[_0x065c('0x12')]=_0x065c('0x43');break;case _0x065c('0x44'):_0x32d519[_0x065c('0x12')]=_0x065c('0x45');break;case _0x065c('0x46'):_0x32d519['childModel']=_0x065c('0x47');break;case _0x065c('0x48'):_0x32d519[_0x065c('0x12')]=_0x065c('0x49');break;case _0x065c('0x4a'):_0x32d519[_0x065c('0x12')]='SmsAccount';break;case'whatsappqueues':_0x32d519[_0x065c('0x12')]=_0x065c('0x4b');break;case _0x065c('0x4c'):_0x32d519[_0x065c('0x12')]=_0x065c('0x4d');break;case _0x065c('0x4e'):_0x32d519[_0x065c('0x12')]='Team';break;case _0x065c('0x4f'):case _0x065c('0x50'):_0x32d519[_0x065c('0x12')]='VoiceQueue';if(_0x322723){_0x32d519[_0x065c('0x17')]=[{'name':'VoiceQueues'},{'name':_0x065c('0x51')}];}break;case _0x065c('0x52'):case _0x065c('0x53'):case _0x065c('0x54'):_0x32d519[_0x065c('0x12')]=_0x065c('0x32');if(_0x322723){_0x32d519[_0x065c('0x17')]=[{'name':'Users','filter':{'field':_0x065c('0x33'),'value':[_0x065c('0x55'),_0x065c('0x56')]},'ignore':!![]},{'name':_0x065c('0x31')},{'name':_0x065c('0x57')}];}break;case _0x065c('0x58'):_0x32d519[_0x065c('0x12')]=_0x065c('0x59');break;case _0x065c('0x5a'):_0x32d519[_0x065c('0x12')]='SalesforceAccount';break;case _0x065c('0x5b'):_0x32d519[_0x065c('0x12')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x32d519[_0x065c('0x12')]=_0x065c('0x5c');break;case _0x065c('0x5d'):_0x32d519[_0x065c('0x12')]='DeskAccount';break;case _0x065c('0x5e'):_0x32d519[_0x065c('0x12')]=_0x065c('0x5f');break;case _0x065c('0x60'):_0x32d519[_0x065c('0x12')]=_0x065c('0x32');break;case _0x065c('0x61'):_0x32d519['childModel']=_0x065c('0x62');break;case _0x065c('0x63'):_0x32d519[_0x065c('0x12')]='Disposition';break;case _0x065c('0x64'):_0x32d519[_0x065c('0x12')]=_0x065c('0x65');break;case _0x065c('0x66'):_0x32d519['childModel']='Interval';break;case _0x065c('0x67'):_0x32d519['childModel']=_0x065c('0x68');break;case _0x065c('0x69'):_0x32d519[_0x065c('0x12')]='Schedule';break;case _0x065c('0x6a'):_0x32d519[_0x065c('0x12')]='Sound';break;case _0x065c('0x6b'):_0x32d519[_0x065c('0x12')]='Tag';break;case'templates':_0x32d519['childModel']='Template';break;case _0x065c('0x6c'):_0x32d519[_0x065c('0x12')]=_0x065c('0x6d');break;case _0x065c('0x6e'):_0x32d519['childModel']=_0x065c('0x6f');break;case'variables':_0x32d519[_0x065c('0x12')]=_0x065c('0x70');break;case _0x065c('0x71'):_0x32d519['childModel']='Plugin';break;case _0x065c('0x72'):_0x32d519[_0x065c('0x12')]=_0x065c('0xe');_0x32d519[_0x065c('0x17')]=[{'name':_0x065c('0x73'),'field':'id','foreignKey':_0x065c('0x74')}];break;case _0x065c('0x75'):_0x32d519[_0x065c('0x12')]='AnalyticMetric';break;}return _0x32d519;}function _0x2fa55f(_0x551a0f,_0x11dd71){var _0x5ae58b=_0x551a0f[_0x065c('0x76')](0x0)[_0x065c('0x77')]()+_0x551a0f[_0x065c('0x78')](0x1);var _0x3aa6d6={'type':_0x2dfebc[_0x065c('0x79')][_0x065c('0x7a')][_0x065c('0x7b')],'raw':!![]};return new Promise(function(_0x202efa,_0x28f482){var _0x18004e=squel[_0x065c('0x7c')]()[_0x065c('0xd')](_0x065c('0x7d')+_0x5ae58b+'InteractionId','id')[_0x065c('0xd')](_0x065c('0x7e'))['from'](_0x065c('0x7f')+_0x551a0f+_0x065c('0x80'),'ui')['where'](_0x065c('0x81'),_0x11dd71['id']);return _0x2dfebc[_0x065c('0x82')]['query'](_0x18004e[_0x065c('0x83')](),_0x3aa6d6)['then'](function(_0xd937cb){_0x11dd71[_0x5ae58b+_0x065c('0x84')]=_0xd937cb;_0x202efa(_0xd937cb);})[_0x065c('0xb')](function(_0x3ac331){_0x28f482(_0x3ac331);});});}return _0x4c4b4a[_0x065c('0x85')](_0x065c('0x86'),attributes,{'tableName':_0x065c('0x87'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x452151){var _0x1183ad=require(_0x065c('0x88'));var _0x3d26a2={'raw':_0x452151['query'][_0x065c('0x89')],'where':{}};var _0x1c1031={};var _0x64318={'count':0x0,'rows':[]};var _0x2cbab8=_0x452151[_0x065c('0x8a')][_0x065c('0x8b')];var _0x47a521=_0x452151[_0x065c('0x8a')][_0x065c('0x8c')]||![];var _0x4787f8=_0x1fd24c(_0x2cbab8,_0x47a521);if(!_0x4787f8[_0x065c('0x12')])throw new Error(_0x065c('0x8d')+_0x2cbab8+'\x27');var _0x4c3871=[{'name':_0x2cbab8}];if(!_[_0x065c('0x8e')](_0x4787f8[_0x065c('0x17')]))_0x4c3871=_0x4787f8[_0x065c('0x17')];var _0x411f34=[];for(var _0x4d1e3a=0x0;_0x4d1e3a<_0x4c3871[_0x065c('0x8f')];_0x4d1e3a++){_0x411f34[_0x065c('0x90')](_0x2dfebc[_0x065c('0x91')]['find']({'where':{'userProfileId':_0x452151[_0x065c('0x92')]['id'],'name':_0x4c3871[_0x4d1e3a]['name']},'raw':!![]}));}return Promise['all'](_0x411f34)[_0x065c('0x6')](function(_0x4382d8){var _0x3212e2=_['filter'](_0x4382d8,function(_0x16df64){return _0x16df64?_0x16df64:undefined;});var _0x1a68ce=_['filter'](_0x4c3871,[_0x065c('0x93'),!![]]);var _0x48ca7a=_[_0x065c('0x8e')](_0x3212e2)&&_['isEmpty'](_0x1a68ce)?null:_['union'](_0x1a68ce,_0x3212e2);if(!_0x48ca7a)return null;var _0x44b1c6=[];for(var _0x405b51=0x0;_0x405b51<_0x48ca7a[_0x065c('0x8f')];_0x405b51++){var _0x4795d6=_['find'](_0x4c3871,function(_0x2429dc){return _0x48ca7a[_0x405b51]?_0x2429dc[_0x065c('0x19')]===_0x48ca7a[_0x405b51]['name']:null;});if(_0x4795d6){if(_0x48ca7a[_0x405b51][_0x065c('0x93')]){_0x44b1c6['push'](_0x548ca5(_0x4787f8['childModel'],_0x48ca7a[_0x405b51]));}else{if(!_0x48ca7a[_0x405b51][_0x065c('0x94')]){_0x44b1c6[_0x065c('0x90')](_0x40dcb4(_0x4795d6,_0x48ca7a[_0x405b51],_0x4787f8[_0x065c('0x12')]));}else{if(_0x4795d6[_0x065c('0x9')]){_0x44b1c6[_0x065c('0x90')](_0x1c9558(_0x4795d6,_0x48ca7a[_0x405b51]));}}}}}return Promise['all'](_0x44b1c6);})[_0x065c('0x6')](function(_0x1bdd60){var _0x421a7e=_0x1bdd60;var _0x2f69ea=null;if(_0x421a7e){_0x2f69ea=_0x421a7e[_0x065c('0x8f')]===0x1?_0x421a7e[0x0]:null;}if(!_0x2f69ea&&!_0x421a7e)return _0x64318;var _0x22dddd=_0x2dfebc[_0x4787f8['childModel']]['rawAttributes'];_0x1c1031[_0x065c('0x9')]=_[_0x065c('0x95')](_0x22dddd);_0x1c1031[_0x065c('0x8a')]=_[_0x065c('0x95')](_0x452151[_0x065c('0x8a')]);_0x1c1031[_0x065c('0x96')]=_[_0x065c('0x97')](_0x1c1031[_0x065c('0x9')],_0x1c1031[_0x065c('0x8a')]);_0x3d26a2[_0x065c('0x98')]=_[_0x065c('0x97')](_0x1c1031['model'],_0x1183ad[_0x065c('0x99')](_0x452151[_0x065c('0x8a')][_0x065c('0x99')]));_0x3d26a2[_0x065c('0x98')]=_0x3d26a2['attributes'][_0x065c('0x8f')]?_0x3d26a2['attributes']:_0x1c1031[_0x065c('0x9')];if(!_0x452151[_0x065c('0x8a')][_0x065c('0x9a')](_0x065c('0x9b'))){_0x3d26a2[_0x065c('0x9c')]=_0x1183ad[_0x065c('0x9c')](_0x452151[_0x065c('0x8a')]['limit']);_0x3d26a2[_0x065c('0x9d')]=_0x1183ad[_0x065c('0x9d')](_0x452151[_0x065c('0x8a')][_0x065c('0x9d')]);}_0x3d26a2['order']=_0x1183ad[_0x065c('0x9e')](_0x452151[_0x065c('0x8a')][_0x065c('0x9e')]);_0x3d26a2[_0x065c('0x9f')]=_0x1183ad[_0x065c('0x96')](_[_0x065c('0xa0')](_0x452151[_0x065c('0x8a')],_0x1c1031[_0x065c('0x96')]));if(_0x452151[_0x065c('0x8a')][_0x065c('0x4')]){_0x3d26a2['where']=_[_0x065c('0xa1')](_0x3d26a2[_0x065c('0x9f')],{'$or':_[_0x065c('0xa')](_0x22dddd,function(_0x1d989d){if(_0x1d989d[_0x065c('0x10')][_0x065c('0xa2')]!==_0x065c('0xa3')){var _0x2462a6={};_0x2462a6[_0x1d989d['field']]={'$like':'%'+_0x452151[_0x065c('0x8a')][_0x065c('0x4')]+'%'};return _0x2462a6;}})});}var _0x26b472=[];var _0x149037=null;var _0x4b08e8={};if(_0x2f69ea){_0x149037=_[_0x065c('0xa4')](_0x4c3871,[_0x065c('0x19'),_0x2f69ea[_0x065c('0x19')]]);if(_0x149037['field']){_0x4b08e8={};if(_0x4787f8[_0x065c('0x12')]===_0x065c('0xe')){_0x4b08e8[_0x149037[_0x065c('0xa5')]]=_[_0x065c('0xa')](_0x2f69ea[_0x065c('0x7')],'id');}else{_0x4b08e8[_0x149037[_0x065c('0xa5')]]=_0x2f69ea['associatedResources'];}_0x26b472[_0x065c('0x90')](_0x4b08e8);}else{_0x3d26a2[_0x065c('0x9f')]['id']=_0x2f69ea[_0x065c('0x7')];}}else{for(var _0x357dad=0x0;_0x357dad<_0x421a7e[_0x065c('0x8f')];_0x357dad++){_0x149037=_[_0x065c('0xa4')](_0x4c3871,[_0x065c('0x19'),_0x421a7e[_0x357dad][_0x065c('0x19')]]);if(_0x149037[_0x065c('0xd')]){_0x4b08e8={};_0x4b08e8[_0x149037['foreignKey']]=_0x421a7e[_0x357dad]['associatedResources'];_0x26b472[_0x065c('0x90')](_0x4b08e8);}else{if(!_0x3d26a2[_0x065c('0x9f')]['id'])_0x3d26a2[_0x065c('0x9f')]['id']=[];_0x421a7e[_0x357dad][_0x065c('0x7')]['forEach'](function(_0x374caa){_0x3d26a2[_0x065c('0x9f')]['id'][_0x065c('0x90')](_0x374caa);});}}}if(!_[_0x065c('0x8e')](_0x26b472)){_0x3d26a2[_0x065c('0x9f')]=_[_0x065c('0xa1')](_0x3d26a2[_0x065c('0x9f')],{'$and':{'$or':_0x26b472}});}_0x3d26a2=_['merge']({},_0x3d26a2,_0x452151[_0x065c('0xa6')]);if(_0x2f69ea&&!_0x2f69ea[_0x065c('0x94')]&&_0x4787f8[_0x065c('0x12')]===_0x065c('0xe')){if(_0x452151[_0x065c('0x8a')][_0x065c('0xa7')]){_0x3d26a2[_0x065c('0xa8')]=[{'all':!![]}];}return _0x2dfebc[_0x4787f8[_0x065c('0x12')]][_0x065c('0x5')](_0x3d26a2)[_0x065c('0x6')](function(_0x2c8cbe){var _0x4bdcb9=[];_0x2c8cbe['forEach'](function(_0x282565){var _0x3988cc;switch(_0x282565['reportType']){case'default':_0x3988cc=_[_0x065c('0xa4')](_0x2f69ea['associatedResources'],function(_0x2ab7fc){return _0x2ab7fc['id']===_0x282565[_0x065c('0x74')]&&_0x2ab7fc[_0x065c('0x10')]===_0x065c('0xa9');});break;case _0x065c('0xaa'):_0x3988cc=_[_0x065c('0xa4')](_0x2f69ea[_0x065c('0x7')],function(_0x55ec80){return _0x55ec80['id']===_0x282565[_0x065c('0x74')]&&_0x55ec80[_0x065c('0x10')]===_0x065c('0xab');});break;}if(_0x3988cc)_0x4bdcb9[_0x065c('0x90')](_0x282565);});_0x64318[_0x065c('0xac')]=_0x4bdcb9['length'];_0x64318['rows']=_0x4bdcb9;return _0x64318;});}else{if(!_[_0x065c('0x8e')](_0x452151['query'][_0x065c('0xad')])){_0x3d26a2[_0x065c('0x9f')]['id']=_0x3d26a2[_0x065c('0x9f')]['id']?_[_0x065c('0x97')](_0x3d26a2[_0x065c('0x9f')]['id'],_0x452151['query']['ids']):_0x452151[_0x065c('0x8a')][_0x065c('0xad')];if(_0x452151[_0x065c('0x8a')][_0x065c('0xae')]){_0x3d26a2[_0x065c('0xaf')]=_0x452151[_0x065c('0x8a')][_0x065c('0xae')];}}if(_0x452151[_0x065c('0x8a')][_0x065c('0xb0')]){_0x3d26a2[_0x065c('0x9f')]=_[_0x065c('0xa1')](_0x3d26a2[_0x065c('0x9f')],{'$and':_0x452151[_0x065c('0x8a')][_0x065c('0xb0')]});}return _0x2dfebc[_0x4787f8[_0x065c('0x12')]][_0x065c('0xac')]({'where':_0x3d26a2[_0x065c('0x9f')]})[_0x065c('0x6')](function(_0x2dfea8){_0x64318[_0x065c('0xac')]=_0x2dfea8;if(_0x452151['query'][_0x065c('0xa7')]){if(_0x4787f8['childModel']===_0x065c('0xb1')){_0x3d26a2['include']=[{'model':_0x2dfebc[_0x065c('0xb2')],'as':_0x065c('0xb3'),'attributes':['id',_0x065c('0x19'),_0x065c('0xb4')],'required':_0x452151[_0x065c('0x8a')]['tag']?!![]:![]},{'model':_0x2dfebc[_0x065c('0xb2')],'as':_0x065c('0xb5'),'attributes':['id',_0x065c('0x19'),_0x065c('0xb4')],'through':_0x452151[_0x065c('0x8a')][_0x065c('0xb6')]?{'attributes':[],'where':{'TagId':_0x452151[_0x065c('0x8a')][_0x065c('0xb6')]||undefined}}:{},'required':_0x452151['query']['tag']?!![]:![]}];}else{_0x3d26a2[_0x065c('0xa8')]=[{'all':!![]}];}}return _0x2dfebc[_0x4787f8[_0x065c('0x12')]][_0x065c('0x5')](_0x3d26a2);})[_0x065c('0x6')](function(_0x3a3e64){_0x64318[_0x065c('0xb7')]=_0x3a3e64;if(_0x2cbab8===_0x065c('0x31')&&_0x452151[_0x065c('0x8a')][_0x065c('0xb8')]===_0x065c('0xb9')){var _0x4efac4=[];for(var _0x52df2e=0x0;_0x52df2e<_0x64318[_0x065c('0xb7')]['length'];_0x52df2e++){_0x4efac4['push'](_0x2fa55f('chat',_0x64318[_0x065c('0xb7')][_0x52df2e][_0x065c('0xba')]));_0x4efac4[_0x065c('0x90')](_0x2fa55f(_0x065c('0xbb'),_0x64318[_0x065c('0xb7')][_0x52df2e]['dataValues']));_0x4efac4[_0x065c('0x90')](_0x2fa55f(_0x065c('0xbc'),_0x64318[_0x065c('0xb7')][_0x52df2e][_0x065c('0xba')]));_0x4efac4[_0x065c('0x90')](_0x2fa55f(_0x065c('0xbd'),_0x64318['rows'][_0x52df2e][_0x065c('0xba')]));_0x4efac4[_0x065c('0x90')](_0x2fa55f(_0x065c('0xbe'),_0x64318[_0x065c('0xb7')][_0x52df2e][_0x065c('0xba')]));_0x4efac4[_0x065c('0x90')](_0x2fa55f(_0x065c('0xbf'),_0x64318[_0x065c('0xb7')][_0x52df2e][_0x065c('0xba')]));}return Promise[_0x065c('0xc0')](_0x4efac4)[_0x065c('0x6')](function(){return _0x64318;});}return _0x64318;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 051af0c..f68ef6a 100644 --- a/server/api/userProfile/userProfile.rpc.js +++ b/server/api/userProfile/userProfile.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb22=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','info','debug','request\x20sent','error','UserProfile,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xd148b1,_0x300e46){var _0x1153af=function(_0x40ae3c){while(--_0x40ae3c){_0xd148b1['push'](_0xd148b1['shift']());}};_0x1153af(++_0x300e46);}(_0xcb22,0xc8));var _0x2cb2=function(_0x11b6a8,_0x38b981){_0x11b6a8=_0x11b6a8-0x0;var _0x5537a9=_0xcb22[_0x11b6a8];return _0x5537a9;};'use strict';var _=require(_0x2cb2('0x0'));var util=require(_0x2cb2('0x1'));var moment=require(_0x2cb2('0x2'));var BPromise=require(_0x2cb2('0x3'));var rs=require(_0x2cb2('0x4'));var fs=require('fs');var Redis=require(_0x2cb2('0x5'));var db=require(_0x2cb2('0x6'))['db'];var utils=require(_0x2cb2('0x7'));var logger=require(_0x2cb2('0x8'))(_0x2cb2('0x9'));var config=require(_0x2cb2('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x2cb2('0xb')][_0x2cb2('0xc')]({'port':0x232a});config[_0x2cb2('0xd')]=_[_0x2cb2('0xe')](config[_0x2cb2('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x2cb2('0xf'))(new Redis(config[_0x2cb2('0xd')]));require('./userProfile.socket')[_0x2cb2('0x10')](socket);function respondWithRpcPromise(_0x34170f,_0xe8c23e,_0x14f52f){return new BPromise(function(_0x16f6fe,_0x2122bf){return client['request'](_0x34170f,_0x14f52f)['then'](function(_0x1e2e62){logger[_0x2cb2('0x11')]('UserProfile,\x20%s,\x20%s',_0xe8c23e,'request\x20sent');logger[_0x2cb2('0x12')]('UserProfile,\x20%s,\x20%s,\x20%s',_0xe8c23e,_0x2cb2('0x13'),JSON['stringify'](_0x1e2e62));if(_0x1e2e62[_0x2cb2('0x14')]){if(_0x1e2e62[_0x2cb2('0x14')]['code']===0x1f4){logger[_0x2cb2('0x14')](_0x2cb2('0x15'),_0xe8c23e,_0x1e2e62[_0x2cb2('0x14')]['message']);return _0x2122bf(_0x1e2e62[_0x2cb2('0x14')][_0x2cb2('0x16')]);}logger['error'](_0x2cb2('0x15'),_0xe8c23e,_0x1e2e62['error'][_0x2cb2('0x16')]);return _0x16f6fe(_0x1e2e62[_0x2cb2('0x14')][_0x2cb2('0x16')]);}else{logger[_0x2cb2('0x11')](_0x2cb2('0x15'),_0xe8c23e,_0x2cb2('0x13'));_0x16f6fe(_0x1e2e62['result']['message']);}})['catch'](function(_0x488ae5){logger[_0x2cb2('0x14')](_0x2cb2('0x15'),_0xe8c23e,_0x488ae5);_0x2122bf(_0x488ae5);});});} \ No newline at end of file +var _0xe978=['error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xe978,0x70));var _0x8e97=function(_0x25534c,_0x331667){_0x25534c=_0x25534c-0x0;var _0x36d6f7=_0xe978[_0x25534c];return _0x36d6f7;};'use strict';var _=require(_0x8e97('0x0'));var util=require(_0x8e97('0x1'));var moment=require(_0x8e97('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e97('0x3'));var db=require(_0x8e97('0x4'))['db'];var utils=require(_0x8e97('0x5'));var logger=require(_0x8e97('0x6'))(_0x8e97('0x7'));var config=require('../../config/environment');var jayson=require(_0x8e97('0x8'));var client=jayson[_0x8e97('0x9')][_0x8e97('0xa')]({'port':0x232a});config[_0x8e97('0xb')]=_[_0x8e97('0xc')](config['redis'],{'host':_0x8e97('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8e97('0xb')]));require(_0x8e97('0xe'))[_0x8e97('0xf')](socket);function respondWithRpcPromise(_0x515bc2,_0x3149de,_0x1d2aa1){return new BPromise(function(_0x4406ad,_0x37b212){return client[_0x8e97('0x10')](_0x515bc2,_0x1d2aa1)[_0x8e97('0x11')](function(_0xa97614){logger[_0x8e97('0x12')](_0x8e97('0x13'),_0x3149de,_0x8e97('0x14'));logger[_0x8e97('0x15')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x3149de,_0x8e97('0x14'),JSON[_0x8e97('0x16')](_0xa97614));if(_0xa97614[_0x8e97('0x17')]){if(_0xa97614[_0x8e97('0x17')]['code']===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x3149de,_0xa97614['error']['message']);return _0x37b212(_0xa97614['error'][_0x8e97('0x18')]);}logger['error'](_0x8e97('0x13'),_0x3149de,_0xa97614[_0x8e97('0x17')]['message']);return _0x4406ad(_0xa97614['error'][_0x8e97('0x18')]);}else{logger[_0x8e97('0x12')](_0x8e97('0x13'),_0x3149de,_0x8e97('0x14'));_0x4406ad(_0xa97614[_0x8e97('0x19')][_0x8e97('0x18')]);}})[_0x8e97('0x1a')](function(_0x2a0800){logger[_0x8e97('0x17')]('UserProfile,\x20%s,\x20%s',_0x3149de,_0x2a0800);_0x37b212(_0x2a0800);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index addb7e4..9e6fa61 100644 --- a/server/api/userProfile/userProfile.socket.js +++ b/server/api/userProfile/userProfile.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc632=['userProfile:','./userProfile.events','update','removeListener'];(function(_0x4605dc,_0x3f7ae5){var _0x5d3e81=function(_0x1d0375){while(--_0x1d0375){_0x4605dc['push'](_0x4605dc['shift']());}};_0x5d3e81(++_0x3f7ae5);}(_0xc632,0x81));var _0x2c63=function(_0x5b3133,_0x39cd7f){_0x5b3133=_0x5b3133-0x0;var _0x5f4b51=_0xc632[_0x5b3133];return _0x5f4b51;};'use strict';var UserProfileEvents=require(_0x2c63('0x0'));var events=['save','remove',_0x2c63('0x1')];function createListener(_0x9c3ca5,_0x94998b){return function(_0x100c0e){_0x94998b['emit'](_0x9c3ca5,_0x100c0e);};}function removeListener(_0x182f8b,_0x27015a){return function(){UserProfileEvents[_0x2c63('0x2')](_0x182f8b,_0x27015a);};}exports['register']=function(_0x38d30c){for(var _0x47ea8b=0x0,_0x19c9d7=events['length'];_0x47ea8b<_0x19c9d7;_0x47ea8b++){var _0x4bdc66=events[_0x47ea8b];var _0x18c3fc=createListener(_0x2c63('0x3')+_0x4bdc66,_0x38d30c);UserProfileEvents['on'](_0x4bdc66,_0x18c3fc);}}; \ No newline at end of file +var _0xbf83=['save','remove','emit','removeListener','length','./userProfile.events'];(function(_0x1e06c0,_0x3c8d32){var _0x20a073=function(_0x5e370f){while(--_0x5e370f){_0x1e06c0['push'](_0x1e06c0['shift']());}};_0x20a073(++_0x3c8d32);}(_0xbf83,0x83));var _0x3bf8=function(_0x883339,_0x568895){_0x883339=_0x883339-0x0;var _0x3402f3=_0xbf83[_0x883339];return _0x3402f3;};'use strict';var UserProfileEvents=require(_0x3bf8('0x0'));var events=[_0x3bf8('0x1'),_0x3bf8('0x2'),'update'];function createListener(_0x22ca95,_0x7874ea){return function(_0x2f6143){_0x7874ea[_0x3bf8('0x3')](_0x22ca95,_0x2f6143);};}function removeListener(_0x2df77f,_0x1a1e59){return function(){UserProfileEvents[_0x3bf8('0x4')](_0x2df77f,_0x1a1e59);};}exports['register']=function(_0x5ab996){for(var _0x335d21=0x0,_0x54d85b=events[_0x3bf8('0x5')];_0x335d21<_0x54d85b;_0x335d21++){var _0xc6ab4a=events[_0x335d21];var _0xd8a3d2=createListener('userProfile:'+_0xc6ab4a,_0x5ab996);UserProfileEvents['on'](_0xc6ab4a,_0xd8a3d2);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 0cd3199..d0b1266 100644 --- a/server/api/userProfileResource/index.js +++ b/server/api/userProfileResource/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a6f=['../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','post','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3bf31c,_0x20f7e6){var _0x352186=function(_0x1e4266){while(--_0x1e4266){_0x3bf31c['push'](_0x3bf31c['shift']());}};_0x352186(++_0x20f7e6);}(_0x9a6f,0xdc));var _0xf9a6=function(_0x481ee8,_0x5aa574){_0x481ee8=_0x481ee8-0x0;var _0x5ad55f=_0x9a6f[_0x481ee8];return _0x5ad55f;};'use strict';var multer=require(_0xf9a6('0x0'));var util=require(_0xf9a6('0x1'));var path=require('path');var timeout=require(_0xf9a6('0x2'));var express=require(_0xf9a6('0x3'));var router=express[_0xf9a6('0x4')]();var fs_extra=require(_0xf9a6('0x5'));var auth=require(_0xf9a6('0x6'));var interaction=require(_0xf9a6('0x7'));var config=require(_0xf9a6('0x8'));var controller=require(_0xf9a6('0x9'));router[_0xf9a6('0xa')]('/',auth[_0xf9a6('0xb')](),controller['index']);router['get'](_0xf9a6('0xc'),auth['isAuthenticated'](),controller[_0xf9a6('0xd')]);router['get'](_0xf9a6('0xe'),auth[_0xf9a6('0xb')](),controller['show']);router[_0xf9a6('0xf')]('/',auth[_0xf9a6('0xb')](),controller['create']);router[_0xf9a6('0x10')](_0xf9a6('0xe'),auth[_0xf9a6('0xb')](),controller[_0xf9a6('0x11')]);router[_0xf9a6('0x12')]('/:id',auth[_0xf9a6('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7ef2=['/:id','post','create','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','describe'];(function(_0x3d0902,_0x39b8c5){var _0x302bf4=function(_0x2525a1){while(--_0x2525a1){_0x3d0902['push'](_0x3d0902['shift']());}};_0x302bf4(++_0x39b8c5);}(_0x7ef2,0x15d));var _0x27ef=function(_0x28e347,_0x2f66af){_0x28e347=_0x28e347-0x0;var _0x1d3cc9=_0x7ef2[_0x28e347];return _0x1d3cc9;};'use strict';var multer=require(_0x27ef('0x0'));var util=require('util');var path=require(_0x27ef('0x1'));var timeout=require(_0x27ef('0x2'));var express=require('express');var router=express[_0x27ef('0x3')]();var fs_extra=require(_0x27ef('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x27ef('0x5'));var controller=require(_0x27ef('0x6'));router['get']('/',auth[_0x27ef('0x7')](),controller[_0x27ef('0x8')]);router[_0x27ef('0x9')]('/describe',auth[_0x27ef('0x7')](),controller[_0x27ef('0xa')]);router[_0x27ef('0x9')](_0x27ef('0xb'),auth[_0x27ef('0x7')](),controller['show']);router[_0x27ef('0xc')]('/',auth['isAuthenticated'](),controller[_0x27ef('0xd')]);router['put'](_0x27ef('0xb'),auth['isAuthenticated'](),controller[_0x27ef('0xe')]);router[_0x27ef('0xf')](_0x27ef('0xb'),auth[_0x27ef('0x7')](),controller[_0x27ef('0x10')]);module[_0x27ef('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index dc43669..4d3f8c6 100644 --- a/server/api/userProfileResource/userProfileResource.attributes.js +++ b/server/api/userProfileResource/userProfileResource.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce8c=['sequelize','exports','STRING','INTEGER'];(function(_0x2fe4e6,_0x39f94e){var _0x331d75=function(_0x346bdf){while(--_0x346bdf){_0x2fe4e6['push'](_0x2fe4e6['shift']());}};_0x331d75(++_0x39f94e);}(_0xce8c,0x1d8));var _0xcce8=function(_0x1246e7,_0xdee926){_0x1246e7=_0x1246e7-0x0;var _0x59e6ff=_0xce8c[_0x1246e7];return _0x59e6ff;};'use strict';var Sequelize=require(_0xcce8('0x0'));module[_0xcce8('0x1')]={'name':{'type':Sequelize[_0xcce8('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xcce8('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xcce8('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xccb4=['exports','STRING','INTEGER','sequelize'];(function(_0x58f2b6,_0x5af1c6){var _0x3a0d0b=function(_0x4be4be){while(--_0x4be4be){_0x58f2b6['push'](_0x58f2b6['shift']());}};_0x3a0d0b(++_0x5af1c6);}(_0xccb4,0x193));var _0x4ccb=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0xccb4[_0xbf8ebe];return _0x1e25e8;};'use strict';var Sequelize=require(_0x4ccb('0x0'));module[_0x4ccb('0x1')]={'name':{'type':Sequelize[_0x4ccb('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x4ccb('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 0eeded1..eb794c4 100644 --- a/server/api/userProfileResource/userProfileResource.controller.js +++ b/server/api/userProfileResource/userProfileResource.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x524e=['end','json','offset','limit','count','set','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','UserProfileResource','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x404434,_0x4c31b8){var _0x238525=function(_0x5a46c9){while(--_0x5a46c9){_0x404434['push'](_0x404434['shift']());}};_0x238525(++_0x4c31b8);}(_0x524e,0x15e));var _0xe524=function(_0x3ed73b,_0x4e7255){_0x3ed73b=_0x3ed73b-0x0;var _0x403e89=_0x524e[_0x3ed73b];return _0x403e89;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['UserProfileResource'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['create'](_0x3d7ab7[_0xe524('0x49')],{})['then'](respondWithResult(_0x33b1c8,0xc9))['catch'](handleError(_0x33b1c8,null));};exports[_0xe524('0x27')]=function(_0x59fe6b,_0x232cf0){if(_0x59fe6b[_0xe524('0x49')]['id']){delete _0x59fe6b['body']['id'];}return db[_0xe524('0x3e')]['find']({'where':{'id':_0x59fe6b['params']['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x232cf0,null))[_0xe524('0x3f')](saveUpdates(_0x59fe6b[_0xe524('0x49')],null))['then'](respondWithResult(_0x232cf0,null))['catch'](handleError(_0x232cf0,null));};exports['destroy']=function(_0x4e9c3b,_0x4f7a64){return db['UserProfileResource'][_0xe524('0x47')]({'where':{'id':_0x4e9c3b[_0xe524('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f7a64,null))[_0xe524('0x3f')](removeEntity(_0x4f7a64,null))[_0xe524('0x44')](handleError(_0x4f7a64,null));};exports[_0xe524('0x4b')]=function(_0x208aa8,_0x2fa143){return db['UserProfileResource'][_0xe524('0x4b')]()[_0xe524('0x3f')](respondWithResult(_0x2fa143,null))[_0xe524('0x44')](handleError(_0x2fa143,null));}; \ No newline at end of file +var _0x1a37=['index','map','UserProfileResource','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1a37,0xb4));var _0x71a3=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x1a37[_0x13e741];return _0x3f8bb3;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){_0x452bc4[_0x71a3('0x19')](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0xb0f3aa,_0x4fd214){return function(_0x107fbd){if(!_0x107fbd){_0xb0f3aa[_0x71a3('0x18')](0x194);}return _0x107fbd;};}function handleError(_0x4c1a3d,_0x412746){_0x412746=_0x412746||0x1f4;return function(_0x515519){logger[_0x71a3('0x26')](_0x515519[_0x71a3('0x27')]);if(_0x515519[_0x71a3('0x28')]){delete _0x515519[_0x71a3('0x28')];}_0x4c1a3d[_0x71a3('0x19')](_0x412746)[_0x71a3('0x29')](_0x515519);};}exports[_0x71a3('0x2a')]=function(_0x242b85,_0x305eb1){var _0x3fc578={},_0x3ea7aa={},_0x228afa={'count':0x0,'rows':[]};var _0x51cde3=_[_0x71a3('0x2b')](db[_0x71a3('0x2c')][_0x71a3('0x2d')],function(_0x23ae85){return{'name':_0x23ae85['fieldName'],'type':_0x23ae85[_0x71a3('0x2e')][_0x71a3('0x2f')]};});_0x3ea7aa[_0x71a3('0x30')]=_[_0x71a3('0x2b')](_0x51cde3,_0x71a3('0x28'));_0x3ea7aa[_0x71a3('0x31')]=_[_0x71a3('0x32')](_0x242b85['query']);_0x3ea7aa[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],_0x3ea7aa[_0x71a3('0x31')]);_0x3fc578[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x36')]));_0x3fc578[_0x71a3('0x35')]=_0x3fc578[_0x71a3('0x35')][_0x71a3('0x37')]?_0x3fc578['attributes']:_0x3ea7aa['model'];if(!_0x242b85[_0x71a3('0x31')][_0x71a3('0x38')]('nolimit')){_0x3fc578[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x242b85['query'][_0x71a3('0x1d')]);_0x3fc578[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x1b')]);}_0x3fc578[_0x71a3('0x39')]=qs[_0x71a3('0x3a')](_0x242b85['query'][_0x71a3('0x3a')]);_0x3fc578[_0x71a3('0x3b')]=qs[_0x71a3('0x33')](_['pick'](_0x242b85[_0x71a3('0x31')],_0x3ea7aa[_0x71a3('0x33')]),_0x51cde3);if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]){_0x3fc578[_0x71a3('0x3b')]=_['merge'](_0x3fc578['where'],{'$or':_[_0x71a3('0x2b')](_0x51cde3,function(_0x2b3197){if(_0x2b3197[_0x71a3('0x2e')]!==_0x71a3('0x3d')){var _0x36ed2e={};_0x36ed2e[_0x2b3197['name']]={'$like':'%'+_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]+'%'};return _0x36ed2e;}})});}_0x3fc578=_[_0x71a3('0x3e')]({},_0x3fc578,_0x242b85['options']);var _0x17c467={'where':_0x3fc578['where']};return db[_0x71a3('0x2c')][_0x71a3('0x1e')](_0x17c467)[_0x71a3('0x24')](function(_0x43c6d1){_0x228afa[_0x71a3('0x1e')]=_0x43c6d1;if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x3fc578[_0x71a3('0x40')]=[{'all':!![]}];}return db[_0x71a3('0x2c')][_0x71a3('0x41')](_0x3fc578);})['then'](function(_0xa49846){_0x228afa['rows']=_0xa49846;return _0x228afa;})[_0x71a3('0x24')](respondWithFilteredResult(_0x305eb1,_0x3fc578))[_0x71a3('0x42')](handleError(_0x305eb1,null));};exports[_0x71a3('0x43')]=function(_0x18974c,_0x59c7c9){var _0x412bce={'raw':![],'where':{'id':_0x18974c['params']['id']}},_0x4b4fde={};_0x4b4fde[_0x71a3('0x30')]=_[_0x71a3('0x32')](db[_0x71a3('0x2c')][_0x71a3('0x2d')]);_0x4b4fde['query']=_[_0x71a3('0x32')](_0x18974c[_0x71a3('0x31')]);_0x4b4fde[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],_0x4b4fde[_0x71a3('0x31')]);_0x412bce[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x18974c[_0x71a3('0x31')][_0x71a3('0x36')]));_0x412bce[_0x71a3('0x35')]=_0x412bce[_0x71a3('0x35')][_0x71a3('0x37')]?_0x412bce[_0x71a3('0x35')]:_0x4b4fde['model'];if(_0x18974c[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x412bce['include']=[{'all':!![]}];}_0x412bce=_[_0x71a3('0x3e')]({},_0x412bce,_0x18974c[_0x71a3('0x44')]);return db[_0x71a3('0x2c')][_0x71a3('0x45')](_0x412bce)[_0x71a3('0x24')](handleEntityNotFound(_0x59c7c9,null))['then'](respondWithResult(_0x59c7c9,null))['catch'](handleError(_0x59c7c9,null));};exports[_0x71a3('0x46')]=function(_0x4305ee,_0x51d20d){return db[_0x71a3('0x2c')][_0x71a3('0x46')](_0x4305ee[_0x71a3('0x47')],{})[_0x71a3('0x24')](respondWithResult(_0x51d20d,0xc9))[_0x71a3('0x42')](handleError(_0x51d20d,null));};exports[_0x71a3('0x23')]=function(_0x501a62,_0x1c9ba6){if(_0x501a62['body']['id']){delete _0x501a62[_0x71a3('0x47')]['id'];}return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x501a62[_0x71a3('0x48')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1c9ba6,null))['then'](saveUpdates(_0x501a62[_0x71a3('0x47')],null))[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,null))[_0x71a3('0x42')](handleError(_0x1c9ba6,null));};exports['destroy']=function(_0x6c34,_0x4e6423){return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x6c34['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x4e6423,null))[_0x71a3('0x24')](removeEntity(_0x4e6423,null))[_0x71a3('0x42')](handleError(_0x4e6423,null));};exports[_0x71a3('0x49')]=function(_0x11391d,_0x3952c0){return db[_0x71a3('0x2c')]['describe']()[_0x71a3('0x24')](respondWithResult(_0x3952c0,null))['catch'](handleError(_0x3952c0,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 704d408..11af3c9 100644 --- a/server/api/userProfileResource/userProfileResource.model.js +++ b/server/api/userProfileResource/userProfileResource.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdb1=['api','moment','bluebird','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger'];(function(_0x5a06ca,_0x1a25e4){var _0x51d8a4=function(_0xf17976){while(--_0xf17976){_0x5a06ca['push'](_0x5a06ca['shift']());}};_0x51d8a4(++_0x1a25e4);}(_0xfdb1,0x147));var _0x1fdb=function(_0x78f020,_0x5e1f35){_0x78f020=_0x78f020-0x0;var _0x4fd10c=_0xfdb1[_0x78f020];return _0x4fd10c;};'use strict';var _=require(_0x1fdb('0x0'));var util=require(_0x1fdb('0x1'));var logger=require(_0x1fdb('0x2'))(_0x1fdb('0x3'));var moment=require(_0x1fdb('0x4'));var BPromise=require(_0x1fdb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fdb('0x6'));var rimraf=require(_0x1fdb('0x7'));var config=require(_0x1fdb('0x8'));var attributes=require(_0x1fdb('0x9'));module[_0x1fdb('0xa')]=function(_0x4322e2,_0x4406e8){return _0x4322e2['define']('UserProfileResource',attributes,{'tableName':_0x1fdb('0xb'),'paranoid':![],'indexes':[{'name':_0x1fdb('0xc'),'fields':[_0x1fdb('0xd'),_0x1fdb('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x398c=['bluebird','request-promise','path','rimraf','exports','define','UserProfileResource','user_profile_has_resources','resourceId','lodash','util','../../config/logger'];(function(_0x2ac9f1,_0x15ffee){var _0x521539=function(_0x99d050){while(--_0x99d050){_0x2ac9f1['push'](_0x2ac9f1['shift']());}};_0x521539(++_0x15ffee);}(_0x398c,0xbd));var _0xc398=function(_0x24003a,_0x4f4649){_0x24003a=_0x24003a-0x0;var _0x1d76b0=_0x398c[_0x24003a];return _0x1d76b0;};'use strict';var _=require(_0xc398('0x0'));var util=require(_0xc398('0x1'));var logger=require(_0xc398('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc398('0x3'));var rp=require(_0xc398('0x4'));var fs=require('fs');var path=require(_0xc398('0x5'));var rimraf=require(_0xc398('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0xc398('0x7')]=function(_0x40ea25,_0x1cb96f){return _0x40ea25[_0xc398('0x8')](_0xc398('0x9'),attributes,{'tableName':_0xc398('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xc398('0xb'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 7833bbb..2348e7e 100644 --- a/server/api/userProfileResource/userProfileResource.rpc.js +++ b/server/api/userProfileResource/userProfileResource.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93c1=['info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x58a4fe,_0x11d439){var _0x697de2=function(_0xe38c14){while(--_0xe38c14){_0x58a4fe['push'](_0x58a4fe['shift']());}};_0x697de2(++_0x11d439);}(_0x93c1,0x181));var _0x193c=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x93c1[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require('lodash');var util=require(_0x193c('0x0'));var moment=require(_0x193c('0x1'));var BPromise=require(_0x193c('0x2'));var rs=require(_0x193c('0x3'));var fs=require('fs');var Redis=require(_0x193c('0x4'));var db=require(_0x193c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x193c('0x6'))(_0x193c('0x7'));var config=require(_0x193c('0x8'));var jayson=require(_0x193c('0x9'));var client=jayson[_0x193c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbdba79,_0x11f8b5,_0x5b25b2){return new BPromise(function(_0x2e2ab2,_0x5e3561){return client['request'](_0xbdba79,_0x5b25b2)['then'](function(_0x5bb6be){logger[_0x193c('0xb')](_0x193c('0xc'),_0x11f8b5,'request\x20sent');logger[_0x193c('0xd')](_0x193c('0xe'),_0x11f8b5,_0x193c('0xf'),JSON[_0x193c('0x10')](_0x5bb6be));if(_0x5bb6be[_0x193c('0x11')]){if(_0x5bb6be[_0x193c('0x11')][_0x193c('0x12')]===0x1f4){logger[_0x193c('0x11')](_0x193c('0xc'),_0x11f8b5,_0x5bb6be[_0x193c('0x11')]['message']);return _0x5e3561(_0x5bb6be[_0x193c('0x11')][_0x193c('0x13')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x11f8b5,_0x5bb6be['error']['message']);return _0x2e2ab2(_0x5bb6be[_0x193c('0x11')]['message']);}else{logger[_0x193c('0xb')](_0x193c('0xc'),_0x11f8b5,_0x193c('0xf'));_0x2e2ab2(_0x5bb6be[_0x193c('0x14')][_0x193c('0x13')]);}})[_0x193c('0x15')](function(_0x4f3545){logger[_0x193c('0x11')](_0x193c('0xc'),_0x11f8b5,_0x4f3545);_0x5e3561(_0x4f3545);});});} \ No newline at end of file +var _0x5225=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x5225,0x1c5));var _0x5522=function(_0x2665a3,_0x3bac99){_0x2665a3=_0x2665a3-0x0;var _0x586de6=_0x5225[_0x2665a3];return _0x586de6;};'use strict';var _=require(_0x5522('0x0'));var util=require(_0x5522('0x1'));var moment=require('moment');var BPromise=require(_0x5522('0x2'));var rs=require(_0x5522('0x3'));var fs=require('fs');var Redis=require(_0x5522('0x4'));var db=require(_0x5522('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5522('0x6'))(_0x5522('0x7'));var config=require(_0x5522('0x8'));var jayson=require(_0x5522('0x9'));var client=jayson[_0x5522('0xa')][_0x5522('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x401066,_0x2c028e,_0x236729){return new BPromise(function(_0x454501,_0x18bffa){return client['request'](_0x401066,_0x236729)[_0x5522('0xc')](function(_0x11b701){logger[_0x5522('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x2c028e,_0x5522('0xe'));logger[_0x5522('0xf')](_0x5522('0x10'),_0x2c028e,_0x5522('0xe'),JSON[_0x5522('0x11')](_0x11b701));if(_0x11b701[_0x5522('0x12')]){if(_0x11b701['error'][_0x5522('0x13')]===0x1f4){logger['error'](_0x5522('0x14'),_0x2c028e,_0x11b701[_0x5522('0x12')]['message']);return _0x18bffa(_0x11b701[_0x5522('0x12')][_0x5522('0x15')]);}logger['error'](_0x5522('0x14'),_0x2c028e,_0x11b701[_0x5522('0x12')]['message']);return _0x454501(_0x11b701[_0x5522('0x12')][_0x5522('0x15')]);}else{logger[_0x5522('0xd')](_0x5522('0x14'),_0x2c028e,_0x5522('0xe'));_0x454501(_0x11b701[_0x5522('0x16')][_0x5522('0x15')]);}})[_0x5522('0x17')](function(_0x30faee){logger[_0x5522('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x2c028e,_0x30faee);_0x18bffa(_0x30faee);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 7003d30..49c0f66 100644 --- a/server/api/userProfileSection/index.js +++ b/server/api/userProfileSection/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x67f1=['exports','path','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x67f1,0xb5));var _0x167f=function(_0x3ba82e,_0x2ce183){_0x3ba82e=_0x3ba82e-0x0;var _0xfef60=_0x67f1[_0x3ba82e];return _0xfef60;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x167f('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x167f('0x1')]();var fs_extra=require(_0x167f('0x2'));var auth=require(_0x167f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x167f('0x4'));var controller=require(_0x167f('0x5'));router[_0x167f('0x6')]('/',auth[_0x167f('0x7')](),controller[_0x167f('0x8')]);router[_0x167f('0x6')](_0x167f('0x9'),auth[_0x167f('0x7')](),controller[_0x167f('0xa')]);router[_0x167f('0x6')](_0x167f('0xb'),auth[_0x167f('0x7')](),controller[_0x167f('0xc')]);router[_0x167f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x167f('0xe')](_0x167f('0xb'),auth['isAuthenticated'](),controller[_0x167f('0xf')]);router[_0x167f('0x10')](_0x167f('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x167f('0x11')]=router; \ No newline at end of file +var _0x9129=['put','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x9129,0xd5));var _0x9912=function(_0x298152,_0x2bab07){_0x298152=_0x298152-0x0;var _0x58117d=_0x9129[_0x298152];return _0x58117d;};'use strict';var multer=require(_0x9912('0x0'));var util=require('util');var path=require(_0x9912('0x1'));var timeout=require(_0x9912('0x2'));var express=require(_0x9912('0x3'));var router=express[_0x9912('0x4')]();var fs_extra=require(_0x9912('0x5'));var auth=require(_0x9912('0x6'));var interaction=require(_0x9912('0x7'));var config=require(_0x9912('0x8'));var controller=require(_0x9912('0x9'));router['get']('/',auth[_0x9912('0xa')](),controller[_0x9912('0xb')]);router[_0x9912('0xc')](_0x9912('0xd'),auth[_0x9912('0xa')](),controller[_0x9912('0xe')]);router[_0x9912('0xc')](_0x9912('0xf'),auth[_0x9912('0xa')](),controller['show']);router[_0x9912('0x10')]('/',auth['isAuthenticated'](),controller[_0x9912('0x11')]);router[_0x9912('0x12')](_0x9912('0xf'),auth[_0x9912('0xa')](),controller[_0x9912('0x13')]);router['delete']('/:id',auth[_0x9912('0xa')](),controller[_0x9912('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 5e311aa..9c917b4 100644 --- a/server/api/userProfileSection/userProfileSection.attributes.js +++ b/server/api/userProfileSection/userProfileSection.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa30a=['exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaa30('0x0'));module[_0xaa30('0x1')]={'name':{'type':Sequelize[_0xaa30('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xaa30('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xaa30('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xaa30('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xaa30('0x2')],'set':function(_0x2a9b06){this[_0xaa30('0x5')](_0xaa30('0x6'),_0x2a9b06?_0x2a9b06['join'](''):[]);},'get':function(){return this[_0xaa30('0x7')]('crudPermissions')?this[_0xaa30('0x7')](_0xaa30('0x6'))[_0xaa30('0x8')](''):[];}}}; \ No newline at end of file +var _0xe2cf=['crudPermissions','join','getDataValue','exports','STRING','BOOLEAN'];(function(_0x4f235f,_0x350745){var _0x347fe9=function(_0x1f8e84){while(--_0x1f8e84){_0x4f235f['push'](_0x4f235f['shift']());}};_0x347fe9(++_0x350745);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x566622,_0x399507){_0x566622=_0x566622-0x0;var _0x1851dd=_0xe2cf[_0x566622];return _0x1851dd;};'use strict';var Sequelize=require('sequelize');module[_0xfe2c('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xfe2c('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xfe2c('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xfe2c('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xfe2c('0x1')],'set':function(_0x11b6b8){this['setDataValue'](_0xfe2c('0x3'),_0x11b6b8?_0x11b6b8[_0xfe2c('0x4')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0xfe2c('0x5')](_0xfe2c('0x3'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 554058c..131240d 100644 --- a/server/api/userProfileSection/userProfileSection.controller.js +++ b/server/api/userProfileSection/userProfileSection.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb07=['to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','map','UserProfileSection','rawAttributes','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','update','find','eml-format','rimraf','zip-dir','mustache','util','sox'];(function(_0x1203c5,_0x4fd846){var _0x5435d6=function(_0xc9a244){while(--_0xc9a244){_0x1203c5['push'](_0x1203c5['shift']());}};_0x5435d6(++_0x4fd846);}(_0xbb07,0x192));var _0x7bb0=function(_0x477495,_0x5de2c1){_0x477495=_0x477495-0x0;var _0x29078e=_0xbb07[_0x477495];return _0x29078e;};'use strict';var emlformat=require(_0x7bb0('0x0'));var rimraf=require(_0x7bb0('0x1'));var zipdir=require(_0x7bb0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7bb0('0x3'));var util=require(_0x7bb0('0x4'));var path=require('path');var sox=require(_0x7bb0('0x5'));var csv=require(_0x7bb0('0x6'));var ejs=require(_0x7bb0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7bb0('0x8'));var crypto=require(_0x7bb0('0x9'));var jsforce=require(_0x7bb0('0xa'));var deskjs=require(_0x7bb0('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7bb0('0xc'));var Papa=require(_0x7bb0('0xd'));var Redis=require('ioredis');var authService=require(_0x7bb0('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x7bb0('0xf'));var hardwareService=require(_0x7bb0('0x10'));var logger=require(_0x7bb0('0x11'))(_0x7bb0('0x12'));var utils=require(_0x7bb0('0x13'));var config=require(_0x7bb0('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11f7ba,_0x43e3b0){_0x43e3b0=_0x43e3b0||0xcc;return function(_0x1f4b4b){if(_0x1f4b4b){return _0x11f7ba[_0x7bb0('0x15')](_0x43e3b0);}return _0x11f7ba[_0x7bb0('0x16')](_0x43e3b0)[_0x7bb0('0x17')]();};}function respondWithResult(_0x4d8bd5,_0xd4113){_0xd4113=_0xd4113||0xc8;return function(_0x2fae91){if(_0x2fae91){return _0x4d8bd5['status'](_0xd4113)[_0x7bb0('0x18')](_0x2fae91);}};}function respondWithFilteredResult(_0x10f6a3,_0x184719){return function(_0x1afd7e){if(_0x1afd7e){var _0x4b4a16=typeof _0x184719[_0x7bb0('0x19')]===_0x7bb0('0x1a')&&typeof _0x184719[_0x7bb0('0x1b')]===_0x7bb0('0x1a');var _0x30d86d=_0x1afd7e[_0x7bb0('0x1c')];var _0x454605=_0x4b4a16?0x0:_0x184719[_0x7bb0('0x19')];var _0x193d0d=_0x4b4a16?_0x1afd7e[_0x7bb0('0x1c')]:_0x184719[_0x7bb0('0x19')]+_0x184719['limit'];var _0x2dbab6;if(_0x193d0d>=_0x30d86d){_0x193d0d=_0x30d86d;_0x2dbab6=0xc8;}else{_0x2dbab6=0xce;}_0x10f6a3['status'](_0x2dbab6);return _0x10f6a3[_0x7bb0('0x1d')](_0x7bb0('0x1e'),_0x454605+'-'+_0x193d0d+'/'+_0x30d86d)[_0x7bb0('0x18')](_0x1afd7e);}return null;};}function patchUpdates(_0x30828b){return function(_0x449c9a){try{jsonpatch[_0x7bb0('0x1f')](_0x449c9a,_0x30828b,!![]);}catch(_0x4f4a47){return BPromise[_0x7bb0('0x20')](_0x4f4a47);}return _0x449c9a[_0x7bb0('0x21')]();};}function saveUpdates(_0x5ee980,_0x947fe7){return function(_0x3ac119){if(_0x3ac119){return _0x3ac119['update'](_0x5ee980)[_0x7bb0('0x22')](function(_0x353b44){return _0x353b44;});}return null;};}function removeEntity(_0x2baeda,_0x1a132c){return function(_0x5f0c3b){if(_0x5f0c3b){return _0x5f0c3b[_0x7bb0('0x23')]()[_0x7bb0('0x22')](function(){_0x2baeda['status'](0xcc)[_0x7bb0('0x17')]();});}};}function handleEntityNotFound(_0x8fc90e,_0x4636aa){return function(_0x59f648){if(!_0x59f648){_0x8fc90e[_0x7bb0('0x15')](0x194);}return _0x59f648;};}function handleError(_0x225dc1,_0x400a56){_0x400a56=_0x400a56||0x1f4;return function(_0x1480a2){logger[_0x7bb0('0x24')](_0x1480a2['stack']);if(_0x1480a2[_0x7bb0('0x25')]){delete _0x1480a2[_0x7bb0('0x25')];}_0x225dc1[_0x7bb0('0x16')](_0x400a56)['send'](_0x1480a2);};}exports['index']=function(_0x5a8b03,_0x280a5d){var _0x43cb74={},_0x2c3b94={},_0x100b18={'count':0x0,'rows':[]};var _0x29ef0c=_[_0x7bb0('0x26')](db[_0x7bb0('0x27')][_0x7bb0('0x28')],function(_0x590911){return{'name':_0x590911['fieldName'],'type':_0x590911['type']['key']};});_0x2c3b94[_0x7bb0('0x29')]=_[_0x7bb0('0x26')](_0x29ef0c,_0x7bb0('0x25'));_0x2c3b94[_0x7bb0('0x2a')]=_['keys'](_0x5a8b03[_0x7bb0('0x2a')]);_0x2c3b94[_0x7bb0('0x2b')]=_[_0x7bb0('0x2c')](_0x2c3b94[_0x7bb0('0x29')],_0x2c3b94[_0x7bb0('0x2a')]);_0x43cb74[_0x7bb0('0x2d')]=_['intersection'](_0x2c3b94['model'],qs['fields'](_0x5a8b03[_0x7bb0('0x2a')][_0x7bb0('0x2e')]));_0x43cb74[_0x7bb0('0x2d')]=_0x43cb74[_0x7bb0('0x2d')]['length']?_0x43cb74['attributes']:_0x2c3b94[_0x7bb0('0x29')];if(!_0x5a8b03['query']['hasOwnProperty'](_0x7bb0('0x2f'))){_0x43cb74[_0x7bb0('0x1b')]=qs[_0x7bb0('0x1b')](_0x5a8b03[_0x7bb0('0x2a')][_0x7bb0('0x1b')]);_0x43cb74[_0x7bb0('0x19')]=qs['offset'](_0x5a8b03['query'][_0x7bb0('0x19')]);}_0x43cb74['order']=qs[_0x7bb0('0x30')](_0x5a8b03['query'][_0x7bb0('0x30')]);_0x43cb74[_0x7bb0('0x31')]=qs[_0x7bb0('0x2b')](_[_0x7bb0('0x32')](_0x5a8b03['query'],_0x2c3b94[_0x7bb0('0x2b')]),_0x29ef0c);if(_0x5a8b03[_0x7bb0('0x2a')]['filter']){_0x43cb74['where']=_[_0x7bb0('0x33')](_0x43cb74[_0x7bb0('0x31')],{'$or':_[_0x7bb0('0x26')](_0x29ef0c,function(_0x2a445c){if(_0x2a445c[_0x7bb0('0x34')]!==_0x7bb0('0x35')){var _0x2b240c={};_0x2b240c[_0x2a445c[_0x7bb0('0x25')]]={'$like':'%'+_0x5a8b03[_0x7bb0('0x2a')][_0x7bb0('0x36')]+'%'};return _0x2b240c;}})});}_0x43cb74=_[_0x7bb0('0x33')]({},_0x43cb74,_0x5a8b03[_0x7bb0('0x37')]);var _0x3973be={'where':_0x43cb74[_0x7bb0('0x31')]};return db[_0x7bb0('0x27')][_0x7bb0('0x1c')](_0x3973be)[_0x7bb0('0x22')](function(_0xf1b1a){_0x100b18['count']=_0xf1b1a;if(_0x5a8b03[_0x7bb0('0x2a')][_0x7bb0('0x38')]){_0x43cb74[_0x7bb0('0x39')]=[{'all':!![]}];}return db[_0x7bb0('0x27')][_0x7bb0('0x3a')](_0x43cb74);})[_0x7bb0('0x22')](function(_0x43fc53){_0x100b18[_0x7bb0('0x3b')]=_0x43fc53;return _0x100b18;})[_0x7bb0('0x22')](respondWithFilteredResult(_0x280a5d,_0x43cb74))[_0x7bb0('0x3c')](handleError(_0x280a5d,null));};exports[_0x7bb0('0x3d')]=function(_0x15b32b,_0x4c601b){var _0x3f4435={'raw':![],'where':{'id':_0x15b32b[_0x7bb0('0x3e')]['id']}},_0x9ef436={};_0x9ef436[_0x7bb0('0x29')]=_['keys'](db[_0x7bb0('0x27')][_0x7bb0('0x28')]);_0x9ef436[_0x7bb0('0x2a')]=_[_0x7bb0('0x3f')](_0x15b32b[_0x7bb0('0x2a')]);_0x9ef436[_0x7bb0('0x2b')]=_['intersection'](_0x9ef436[_0x7bb0('0x29')],_0x9ef436['query']);_0x3f4435['attributes']=_[_0x7bb0('0x2c')](_0x9ef436[_0x7bb0('0x29')],qs['fields'](_0x15b32b[_0x7bb0('0x2a')][_0x7bb0('0x2e')]));_0x3f4435[_0x7bb0('0x2d')]=_0x3f4435[_0x7bb0('0x2d')]['length']?_0x3f4435[_0x7bb0('0x2d')]:_0x9ef436[_0x7bb0('0x29')];if(_0x15b32b[_0x7bb0('0x2a')][_0x7bb0('0x38')]){_0x3f4435[_0x7bb0('0x39')]=[{'all':!![]}];}_0x3f4435=_[_0x7bb0('0x33')]({},_0x3f4435,_0x15b32b[_0x7bb0('0x37')]);return db[_0x7bb0('0x27')]['find'](_0x3f4435)['then'](handleEntityNotFound(_0x4c601b,null))[_0x7bb0('0x22')](respondWithResult(_0x4c601b,null))[_0x7bb0('0x3c')](handleError(_0x4c601b,null));};exports[_0x7bb0('0x40')]=function(_0x2ca2fd,_0x1832e7){return db[_0x7bb0('0x27')][_0x7bb0('0x40')](_0x2ca2fd[_0x7bb0('0x41')],{})[_0x7bb0('0x22')](respondWithResult(_0x1832e7,0xc9))[_0x7bb0('0x3c')](handleError(_0x1832e7,null));};exports[_0x7bb0('0x42')]=function(_0x18718d,_0x145c2c){if(_0x18718d[_0x7bb0('0x41')]['id']){delete _0x18718d[_0x7bb0('0x41')]['id'];}return db[_0x7bb0('0x27')][_0x7bb0('0x43')]({'where':{'id':_0x18718d[_0x7bb0('0x3e')]['id']}})[_0x7bb0('0x22')](handleEntityNotFound(_0x145c2c,null))['then'](saveUpdates(_0x18718d['body'],null))[_0x7bb0('0x22')](respondWithResult(_0x145c2c,null))[_0x7bb0('0x3c')](handleError(_0x145c2c,null));};exports[_0x7bb0('0x23')]=function(_0x6d7fa5,_0x2980aa){return db['UserProfileSection']['find']({'where':{'id':_0x6d7fa5[_0x7bb0('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2980aa,null))[_0x7bb0('0x22')](removeEntity(_0x2980aa,null))[_0x7bb0('0x3c')](handleError(_0x2980aa,null));};exports['describe']=function(_0x5d703e,_0x389dd4){return db[_0x7bb0('0x27')]['describe']()[_0x7bb0('0x22')](respondWithResult(_0x389dd4,null))[_0x7bb0('0x3c')](handleError(_0x389dd4,null));}; \ No newline at end of file +var _0x5525=['../../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','save','update','then','error','stack','name','send','index','UserProfileSection','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','order','sort','filters','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','fields','length','find','create','body','describe','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x4609d0,_0x4b671a){var _0x3d3940=function(_0x3c3d27){while(--_0x3c3d27){_0x4609d0['push'](_0x4609d0['shift']());}};_0x3d3940(++_0x4b671a);}(_0x5525,0x163));var _0x5552=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5525[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5552('0x0'));var zipdir=require(_0x5552('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5552('0x2'));var BPromise=require(_0x5552('0x3'));var Mustache=require(_0x5552('0x4'));var util=require(_0x5552('0x5'));var path=require(_0x5552('0x6'));var sox=require('sox');var csv=require(_0x5552('0x7'));var ejs=require(_0x5552('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5552('0x9'));var squel=require(_0x5552('0xa'));var crypto=require('crypto');var jsforce=require(_0x5552('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5552('0x7'));var querystring=require(_0x5552('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5552('0xd'));var qs=require(_0x5552('0xe'));var as=require(_0x5552('0xf'));var hardwareService=require(_0x5552('0x10'));var logger=require(_0x5552('0x11'))(_0x5552('0x12'));var utils=require(_0x5552('0x13'));var config=require(_0x5552('0x14'));var licenseUtil=require(_0x5552('0x15'));var db=require(_0x5552('0x16'))['db'];function respondWithStatusCode(_0x21072f,_0x234241){_0x234241=_0x234241||0xcc;return function(_0x166234){if(_0x166234){return _0x21072f[_0x5552('0x17')](_0x234241);}return _0x21072f[_0x5552('0x18')](_0x234241)[_0x5552('0x19')]();};}function respondWithResult(_0x3f2317,_0x1ad47e){_0x1ad47e=_0x1ad47e||0xc8;return function(_0x3f12a3){if(_0x3f12a3){return _0x3f2317[_0x5552('0x18')](_0x1ad47e)[_0x5552('0x1a')](_0x3f12a3);}};}function respondWithFilteredResult(_0x243adf,_0x2efc58){return function(_0x4373c7){if(_0x4373c7){var _0x45739d=typeof _0x2efc58[_0x5552('0x1b')]==='undefined'&&typeof _0x2efc58[_0x5552('0x1c')]===_0x5552('0x1d');var _0x55d2c9=_0x4373c7[_0x5552('0x1e')];var _0x484982=_0x45739d?0x0:_0x2efc58[_0x5552('0x1b')];var _0x588e19=_0x45739d?_0x4373c7[_0x5552('0x1e')]:_0x2efc58[_0x5552('0x1b')]+_0x2efc58[_0x5552('0x1c')];var _0x2ae7be;if(_0x588e19>=_0x55d2c9){_0x588e19=_0x55d2c9;_0x2ae7be=0xc8;}else{_0x2ae7be=0xce;}_0x243adf[_0x5552('0x18')](_0x2ae7be);return _0x243adf[_0x5552('0x1f')](_0x5552('0x20'),_0x484982+'-'+_0x588e19+'/'+_0x55d2c9)[_0x5552('0x1a')](_0x4373c7);}return null;};}function patchUpdates(_0x21a629){return function(_0x15a717){try{jsonpatch[_0x5552('0x21')](_0x15a717,_0x21a629,!![]);}catch(_0x8e9817){return BPromise['reject'](_0x8e9817);}return _0x15a717[_0x5552('0x22')]();};}function saveUpdates(_0x306f6b,_0x3d1115){return function(_0x46c486){if(_0x46c486){return _0x46c486[_0x5552('0x23')](_0x306f6b)[_0x5552('0x24')](function(_0x2c34bb){return _0x2c34bb;});}return null;};}function removeEntity(_0x288df2,_0x3643ec){return function(_0x2d4c49){if(_0x2d4c49){return _0x2d4c49['destroy']()['then'](function(){_0x288df2['status'](0xcc)[_0x5552('0x19')]();});}};}function handleEntityNotFound(_0x283e82,_0x125175){return function(_0x4b39f5){if(!_0x4b39f5){_0x283e82['sendStatus'](0x194);}return _0x4b39f5;};}function handleError(_0x5f5c8e,_0x453d78){_0x453d78=_0x453d78||0x1f4;return function(_0x1ba236){logger[_0x5552('0x25')](_0x1ba236[_0x5552('0x26')]);if(_0x1ba236[_0x5552('0x27')]){delete _0x1ba236['name'];}_0x5f5c8e[_0x5552('0x18')](_0x453d78)[_0x5552('0x28')](_0x1ba236);};}exports[_0x5552('0x29')]=function(_0x51cf17,_0x594845){var _0x4cbf1a={},_0x279896={},_0x7a4f10={'count':0x0,'rows':[]};var _0x339494=_['map'](db[_0x5552('0x2a')][_0x5552('0x2b')],function(_0x167d36){return{'name':_0x167d36[_0x5552('0x2c')],'type':_0x167d36['type'][_0x5552('0x2d')]};});_0x279896[_0x5552('0x2e')]=_[_0x5552('0x2f')](_0x339494,_0x5552('0x27'));_0x279896[_0x5552('0x30')]=_[_0x5552('0x31')](_0x51cf17[_0x5552('0x30')]);_0x279896['filters']=_[_0x5552('0x32')](_0x279896[_0x5552('0x2e')],_0x279896[_0x5552('0x30')]);_0x4cbf1a[_0x5552('0x33')]=_['intersection'](_0x279896[_0x5552('0x2e')],qs['fields'](_0x51cf17[_0x5552('0x30')]['fields']));_0x4cbf1a[_0x5552('0x33')]=_0x4cbf1a[_0x5552('0x33')]['length']?_0x4cbf1a[_0x5552('0x33')]:_0x279896[_0x5552('0x2e')];if(!_0x51cf17[_0x5552('0x30')]['hasOwnProperty']('nolimit')){_0x4cbf1a[_0x5552('0x1c')]=qs[_0x5552('0x1c')](_0x51cf17['query'][_0x5552('0x1c')]);_0x4cbf1a[_0x5552('0x1b')]=qs['offset'](_0x51cf17[_0x5552('0x30')][_0x5552('0x1b')]);}_0x4cbf1a[_0x5552('0x34')]=qs['sort'](_0x51cf17['query'][_0x5552('0x35')]);_0x4cbf1a['where']=qs[_0x5552('0x36')](_[_0x5552('0x37')](_0x51cf17['query'],_0x279896['filters']),_0x339494);if(_0x51cf17['query'][_0x5552('0x38')]){_0x4cbf1a['where']=_['merge'](_0x4cbf1a[_0x5552('0x39')],{'$or':_[_0x5552('0x2f')](_0x339494,function(_0x401cd5){if(_0x401cd5[_0x5552('0x3a')]!==_0x5552('0x3b')){var _0x914f0a={};_0x914f0a[_0x401cd5['name']]={'$like':'%'+_0x51cf17[_0x5552('0x30')]['filter']+'%'};return _0x914f0a;}})});}_0x4cbf1a=_[_0x5552('0x3c')]({},_0x4cbf1a,_0x51cf17[_0x5552('0x3d')]);var _0x3eb9bf={'where':_0x4cbf1a[_0x5552('0x39')]};return db[_0x5552('0x2a')][_0x5552('0x1e')](_0x3eb9bf)[_0x5552('0x24')](function(_0x27aa5c){_0x7a4f10[_0x5552('0x1e')]=_0x27aa5c;if(_0x51cf17[_0x5552('0x30')][_0x5552('0x3e')]){_0x4cbf1a[_0x5552('0x3f')]=[{'all':!![]}];}return db['UserProfileSection'][_0x5552('0x40')](_0x4cbf1a);})['then'](function(_0x3ec1dc){_0x7a4f10[_0x5552('0x41')]=_0x3ec1dc;return _0x7a4f10;})[_0x5552('0x24')](respondWithFilteredResult(_0x594845,_0x4cbf1a))[_0x5552('0x42')](handleError(_0x594845,null));};exports['show']=function(_0x20c603,_0x5ed605){var _0x56e537={'raw':![],'where':{'id':_0x20c603[_0x5552('0x43')]['id']}},_0x596b30={};_0x596b30['model']=_[_0x5552('0x31')](db[_0x5552('0x2a')][_0x5552('0x2b')]);_0x596b30[_0x5552('0x30')]=_[_0x5552('0x31')](_0x20c603['query']);_0x596b30[_0x5552('0x36')]=_['intersection'](_0x596b30[_0x5552('0x2e')],_0x596b30[_0x5552('0x30')]);_0x56e537[_0x5552('0x33')]=_['intersection'](_0x596b30[_0x5552('0x2e')],qs[_0x5552('0x44')](_0x20c603['query']['fields']));_0x56e537[_0x5552('0x33')]=_0x56e537[_0x5552('0x33')][_0x5552('0x45')]?_0x56e537[_0x5552('0x33')]:_0x596b30[_0x5552('0x2e')];if(_0x20c603[_0x5552('0x30')]['includeAll']){_0x56e537[_0x5552('0x3f')]=[{'all':!![]}];}_0x56e537=_['merge']({},_0x56e537,_0x20c603['options']);return db['UserProfileSection'][_0x5552('0x46')](_0x56e537)[_0x5552('0x24')](handleEntityNotFound(_0x5ed605,null))[_0x5552('0x24')](respondWithResult(_0x5ed605,null))[_0x5552('0x42')](handleError(_0x5ed605,null));};exports[_0x5552('0x47')]=function(_0x2455e9,_0x525673){return db[_0x5552('0x2a')][_0x5552('0x47')](_0x2455e9[_0x5552('0x48')],{})[_0x5552('0x24')](respondWithResult(_0x525673,0xc9))[_0x5552('0x42')](handleError(_0x525673,null));};exports[_0x5552('0x23')]=function(_0x3b3418,_0x55e83d){if(_0x3b3418['body']['id']){delete _0x3b3418['body']['id'];}return db[_0x5552('0x2a')][_0x5552('0x46')]({'where':{'id':_0x3b3418[_0x5552('0x43')]['id']}})[_0x5552('0x24')](handleEntityNotFound(_0x55e83d,null))[_0x5552('0x24')](saveUpdates(_0x3b3418[_0x5552('0x48')],null))[_0x5552('0x24')](respondWithResult(_0x55e83d,null))['catch'](handleError(_0x55e83d,null));};exports['destroy']=function(_0x336063,_0x2fc519){return db[_0x5552('0x2a')][_0x5552('0x46')]({'where':{'id':_0x336063[_0x5552('0x43')]['id']}})[_0x5552('0x24')](handleEntityNotFound(_0x2fc519,null))[_0x5552('0x24')](removeEntity(_0x2fc519,null))[_0x5552('0x42')](handleError(_0x2fc519,null));};exports[_0x5552('0x49')]=function(_0x24ad8c,_0x347a7c){return db[_0x5552('0x2a')][_0x5552('0x49')]()[_0x5552('0x24')](respondWithResult(_0x347a7c,null))[_0x5552('0x42')](handleError(_0x347a7c,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 0a09d0b..071a993 100644 --- a/server/api/userProfileSection/userProfileSection.model.js +++ b/server/api/userProfileSection/userProfileSection.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x79a4=['api','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger'];(function(_0x2ef251,_0x3687e5){var _0x5c931b=function(_0x3e1e36){while(--_0x3e1e36){_0x2ef251['push'](_0x2ef251['shift']());}};_0x5c931b(++_0x3687e5);}(_0x79a4,0xeb));var _0x479a=function(_0x2f6088,_0x525fec){_0x2f6088=_0x2f6088-0x0;var _0xc5ad3c=_0x79a4[_0x2f6088];return _0xc5ad3c;};'use strict';var _=require(_0x479a('0x0'));var util=require(_0x479a('0x1'));var logger=require(_0x479a('0x2'))(_0x479a('0x3'));var moment=require('moment');var BPromise=require(_0x479a('0x4'));var rp=require(_0x479a('0x5'));var fs=require('fs');var path=require(_0x479a('0x6'));var rimraf=require(_0x479a('0x7'));var config=require(_0x479a('0x8'));var attributes=require(_0x479a('0x9'));module[_0x479a('0xa')]=function(_0x4ae49b,_0x473291){return _0x4ae49b[_0x479a('0xb')](_0x479a('0xc'),attributes,{'tableName':_0x479a('0xd'),'paranoid':![],'indexes':[{'name':_0x479a('0xe'),'fields':[_0x479a('0xf'),_0x479a('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdca1=['UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports'];(function(_0x84cae6,_0x9e11a4){var _0x40abc1=function(_0x1575d6){while(--_0x1575d6){_0x84cae6['push'](_0x84cae6['shift']());}};_0x40abc1(++_0x9e11a4);}(_0xdca1,0x171));var _0x1dca=function(_0x38fb82,_0x197088){_0x38fb82=_0x38fb82-0x0;var _0x5b1838=_0xdca1[_0x38fb82];return _0x5b1838;};'use strict';var _=require(_0x1dca('0x0'));var util=require(_0x1dca('0x1'));var logger=require(_0x1dca('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1dca('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1dca('0x4'));var config=require(_0x1dca('0x5'));var attributes=require(_0x1dca('0x6'));module[_0x1dca('0x7')]=function(_0x1e613c,_0x249a0c){return _0x1e613c['define'](_0x1dca('0x8'),attributes,{'tableName':_0x1dca('0x9'),'paranoid':![],'indexes':[{'name':_0x1dca('0xa'),'fields':[_0x1dca('0xb'),_0x1dca('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 8a3365c..8f3276a 100644 --- a/server/api/userProfileSection/userProfileSection.rpc.js +++ b/server/api/userProfileSection/userProfileSection.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e2a=['UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','info','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','debug'];(function(_0x184cc6,_0x4961ee){var _0x3f7435=function(_0x448fed){while(--_0x448fed){_0x184cc6['push'](_0x184cc6['shift']());}};_0x3f7435(++_0x4961ee);}(_0x3e2a,0xa0));var _0xa3e2=function(_0x56c95c,_0x2c1be0){_0x56c95c=_0x56c95c-0x0;var _0x81c774=_0x3e2a[_0x56c95c];return _0x81c774;};'use strict';var _=require('lodash');var util=require(_0xa3e2('0x0'));var moment=require(_0xa3e2('0x1'));var BPromise=require(_0xa3e2('0x2'));var rs=require(_0xa3e2('0x3'));var fs=require('fs');var Redis=require(_0xa3e2('0x4'));var db=require(_0xa3e2('0x5'))['db'];var utils=require(_0xa3e2('0x6'));var logger=require(_0xa3e2('0x7'))('rpc');var config=require(_0xa3e2('0x8'));var jayson=require(_0xa3e2('0x9'));var client=jayson[_0xa3e2('0xa')][_0xa3e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3aa9c5,_0x3b1e8f,_0x30e5f9){return new BPromise(function(_0x1d1119,_0x5c853d){return client[_0xa3e2('0xc')](_0x3aa9c5,_0x30e5f9)[_0xa3e2('0xd')](function(_0x4ed797){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x3b1e8f,'request\x20sent');logger[_0xa3e2('0xe')](_0xa3e2('0xf'),_0x3b1e8f,'request\x20sent',JSON[_0xa3e2('0x10')](_0x4ed797));if(_0x4ed797[_0xa3e2('0x11')]){if(_0x4ed797[_0xa3e2('0x11')][_0xa3e2('0x12')]===0x1f4){logger[_0xa3e2('0x11')](_0xa3e2('0x13'),_0x3b1e8f,_0x4ed797['error'][_0xa3e2('0x14')]);return _0x5c853d(_0x4ed797[_0xa3e2('0x11')][_0xa3e2('0x14')]);}logger[_0xa3e2('0x11')](_0xa3e2('0x13'),_0x3b1e8f,_0x4ed797[_0xa3e2('0x11')][_0xa3e2('0x14')]);return _0x1d1119(_0x4ed797[_0xa3e2('0x11')]['message']);}else{logger[_0xa3e2('0x15')](_0xa3e2('0x13'),_0x3b1e8f,_0xa3e2('0x16'));_0x1d1119(_0x4ed797[_0xa3e2('0x17')][_0xa3e2('0x14')]);}})[_0xa3e2('0x18')](function(_0x983f88){logger[_0xa3e2('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x3b1e8f,_0x983f88);_0x5c853d(_0x983f88);});});} \ No newline at end of file +var _0xa87c=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result'];(function(_0x51c06c,_0x2322e6){var _0x289364=function(_0x41bd30){while(--_0x41bd30){_0x51c06c['push'](_0x51c06c['shift']());}};_0x289364(++_0x2322e6);}(_0xa87c,0x135));var _0xca87=function(_0x532685,_0x1a38c2){_0x532685=_0x532685-0x0;var _0x21426a=_0xa87c[_0x532685];return _0x21426a;};'use strict';var _=require(_0xca87('0x0'));var util=require(_0xca87('0x1'));var moment=require(_0xca87('0x2'));var BPromise=require(_0xca87('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca87('0x4'));var db=require(_0xca87('0x5'))['db'];var utils=require(_0xca87('0x6'));var logger=require(_0xca87('0x7'))('rpc');var config=require(_0xca87('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xca87('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x75b8ba,_0x25f961,_0x4f51f0){return new BPromise(function(_0x189544,_0xd22997){return client[_0xca87('0xa')](_0x75b8ba,_0x4f51f0)['then'](function(_0x456702){logger[_0xca87('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x25f961,_0xca87('0xc'));logger[_0xca87('0xd')](_0xca87('0xe'),_0x25f961,_0xca87('0xc'),JSON[_0xca87('0xf')](_0x456702));if(_0x456702[_0xca87('0x10')]){if(_0x456702[_0xca87('0x10')][_0xca87('0x11')]===0x1f4){logger[_0xca87('0x10')](_0xca87('0x12'),_0x25f961,_0x456702[_0xca87('0x10')][_0xca87('0x13')]);return _0xd22997(_0x456702[_0xca87('0x10')]['message']);}logger['error'](_0xca87('0x12'),_0x25f961,_0x456702[_0xca87('0x10')]['message']);return _0x189544(_0x456702[_0xca87('0x10')][_0xca87('0x13')]);}else{logger[_0xca87('0xb')](_0xca87('0x12'),_0x25f961,'request\x20sent');_0x189544(_0x456702[_0xca87('0x14')][_0xca87('0x13')]);}})[_0xca87('0x15')](function(_0x378b9e){logger['error'](_0xca87('0x12'),_0x25f961,_0x378b9e);_0xd22997(_0x378b9e);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 65c3565..0549ade 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x7ce24c,_0x359fb9){var _0x38f713=function(_0x2d76ef){while(--_0x2d76ef){_0x7ce24c['push'](_0x7ce24c['shift']());}};_0x38f713(++_0x359fb9);}(_0x70e0,0x17b));var _0x070e=function(_0x5d3eca,_0x5d0820){_0x5d3eca=_0x5d3eca-0x0;var _0x37c68f=_0x70e0[_0x5d3eca];return _0x37c68f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5c5d17,_0xf562e9){var _0x563a64=function(_0x3cd78b){while(--_0x3cd78b){_0x5c5d17['push'](_0x5c5d17['shift']());}};_0x563a64(++_0xf562e9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index cea1845..5e7dc64 100644 --- a/server/api/userSmsQueue/userSmsQueue.attributes.js +++ b/server/api/userSmsQueue/userSmsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87f3=['INTEGER','exports'];(function(_0x201c00,_0xc3b3fd){var _0x47ba3c=function(_0x583c7d){while(--_0x583c7d){_0x201c00['push'](_0x201c00['shift']());}};_0x47ba3c(++_0xc3b3fd);}(_0x87f3,0x165));var _0x387f=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0x87f3[_0x55ff3e];return _0x2709eb;};'use strict';var Sequelize=require('sequelize');module[_0x387f('0x0')]={'penalty':{'type':Sequelize[_0x387f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x33c1=['exports'];(function(_0x4dbfec,_0x3c4e52){var _0x286ebc=function(_0x43deba){while(--_0x43deba){_0x4dbfec['push'](_0x4dbfec['shift']());}};_0x286ebc(++_0x3c4e52);}(_0x33c1,0x82));var _0x133c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x33c1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x133c('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 2d11d2a..39f5922 100644 --- a/server/api/userSmsQueue/userSmsQueue.model.js +++ b/server/api/userSmsQueue/userSmsQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x11e5=['path','../../config/environment','define','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x467bb7,_0x33a845){var _0x308b55=function(_0xa52571){while(--_0xa52571){_0x467bb7['push'](_0x467bb7['shift']());}};_0x308b55(++_0x33a845);}(_0x11e5,0x8b));var _0x511e=function(_0x12bc0d,_0x1e40ca){_0x12bc0d=_0x12bc0d-0x0;var _0x18cf40=_0x11e5[_0x12bc0d];return _0x18cf40;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var logger=require(_0x511e('0x1'))(_0x511e('0x2'));var moment=require('moment');var BPromise=require(_0x511e('0x3'));var rp=require(_0x511e('0x4'));var fs=require('fs');var path=require(_0x511e('0x5'));var rimraf=require('rimraf');var config=require(_0x511e('0x6'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x342539,_0x323f8c){return _0x342539[_0x511e('0x7')]('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f44=['bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','lodash','util','api','moment'];(function(_0x423f00,_0x467bb2){var _0x238c49=function(_0x1cd9ae){while(--_0x1cd9ae){_0x423f00['push'](_0x423f00['shift']());}};_0x238c49(++_0x467bb2);}(_0x6f44,0x1ea));var _0x46f4=function(_0x23ad96,_0x391222){_0x23ad96=_0x23ad96-0x0;var _0xce8a18=_0x6f44[_0x23ad96];return _0xce8a18;};'use strict';var _=require(_0x46f4('0x0'));var util=require(_0x46f4('0x1'));var logger=require('../../config/logger')(_0x46f4('0x2'));var moment=require(_0x46f4('0x3'));var BPromise=require(_0x46f4('0x4'));var rp=require(_0x46f4('0x5'));var fs=require('fs');var path=require(_0x46f4('0x6'));var rimraf=require(_0x46f4('0x7'));var config=require(_0x46f4('0x8'));var attributes=require(_0x46f4('0x9'));module[_0x46f4('0xa')]=function(_0x57f1a9,_0x169a5a){return _0x57f1a9[_0x46f4('0xb')](_0x46f4('0xc'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 8f61fc3..64acfb4 100644 --- a/server/api/userSmsQueue/userSmsQueue.rpc.js +++ b/server/api/userSmsQueue/userSmsQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0657=['UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x4425ea,_0x19d6f3){var _0x10f6af=function(_0x322c57){while(--_0x322c57){_0x4425ea['push'](_0x4425ea['shift']());}};_0x10f6af(++_0x19d6f3);}(_0x0657,0x12d));var _0x7065=function(_0x4ce25d,_0xfd5172){_0x4ce25d=_0x4ce25d-0x0;var _0x1fc1e1=_0x0657[_0x4ce25d];return _0x1fc1e1;};'use strict';var _=require('lodash');var util=require(_0x7065('0x0'));var moment=require('moment');var BPromise=require(_0x7065('0x1'));var rs=require(_0x7065('0x2'));var fs=require('fs');var Redis=require(_0x7065('0x3'));var db=require(_0x7065('0x4'))['db'];var utils=require(_0x7065('0x5'));var logger=require(_0x7065('0x6'))(_0x7065('0x7'));var config=require('../../config/environment');var jayson=require(_0x7065('0x8'));var client=jayson[_0x7065('0x9')][_0x7065('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f9a6a,_0x126947,_0x32d753){return new BPromise(function(_0x248ca9,_0x982be0){return client[_0x7065('0xb')](_0x3f9a6a,_0x32d753)[_0x7065('0xc')](function(_0x17d08d){logger[_0x7065('0xd')](_0x7065('0xe'),_0x126947,_0x7065('0xf'));logger[_0x7065('0x10')](_0x7065('0x11'),_0x126947,_0x7065('0xf'),JSON['stringify'](_0x17d08d));if(_0x17d08d['error']){if(_0x17d08d[_0x7065('0x12')]['code']===0x1f4){logger[_0x7065('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x126947,_0x17d08d[_0x7065('0x12')][_0x7065('0x13')]);return _0x982be0(_0x17d08d['error'][_0x7065('0x13')]);}logger[_0x7065('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x126947,_0x17d08d[_0x7065('0x12')]['message']);return _0x248ca9(_0x17d08d[_0x7065('0x12')]['message']);}else{logger[_0x7065('0xd')](_0x7065('0xe'),_0x126947,'request\x20sent');_0x248ca9(_0x17d08d[_0x7065('0x14')]['message']);}})['catch'](function(_0x2984ca){logger[_0x7065('0x12')](_0x7065('0xe'),_0x126947,_0x2984ca);_0x982be0(_0x2984ca);});});} \ No newline at end of file +var _0x433a=['../../config/environment','jayson/promise','client','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x345b5f,_0x15a2b3){var _0x444221=function(_0x10fa0e){while(--_0x10fa0e){_0x345b5f['push'](_0x345b5f['shift']());}};_0x444221(++_0x15a2b3);}(_0x433a,0x18e));var _0xa433=function(_0x21ef76,_0x375f58){_0x21ef76=_0x21ef76-0x0;var _0x31a642=_0x433a[_0x21ef76];return _0x31a642;};'use strict';var _=require(_0xa433('0x0'));var util=require(_0xa433('0x1'));var moment=require(_0xa433('0x2'));var BPromise=require(_0xa433('0x3'));var rs=require(_0xa433('0x4'));var fs=require('fs');var Redis=require(_0xa433('0x5'));var db=require(_0xa433('0x6'))['db'];var utils=require(_0xa433('0x7'));var logger=require(_0xa433('0x8'))(_0xa433('0x9'));var config=require(_0xa433('0xa'));var jayson=require(_0xa433('0xb'));var client=jayson[_0xa433('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x405d9c,_0x3cb624,_0x1d8b28){return new BPromise(function(_0xe955d0,_0x13f663){return client[_0xa433('0xd')](_0x405d9c,_0x1d8b28)['then'](function(_0x34563a){logger[_0xa433('0xe')](_0xa433('0xf'),_0x3cb624,_0xa433('0x10'));logger[_0xa433('0x11')](_0xa433('0x12'),_0x3cb624,_0xa433('0x10'),JSON[_0xa433('0x13')](_0x34563a));if(_0x34563a[_0xa433('0x14')]){if(_0x34563a['error'][_0xa433('0x15')]===0x1f4){logger[_0xa433('0x14')](_0xa433('0xf'),_0x3cb624,_0x34563a[_0xa433('0x14')][_0xa433('0x16')]);return _0x13f663(_0x34563a[_0xa433('0x14')][_0xa433('0x16')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x3cb624,_0x34563a['error'][_0xa433('0x16')]);return _0xe955d0(_0x34563a[_0xa433('0x14')][_0xa433('0x16')]);}else{logger[_0xa433('0xe')](_0xa433('0xf'),_0x3cb624,_0xa433('0x10'));_0xe955d0(_0x34563a[_0xa433('0x17')][_0xa433('0x16')]);}})['catch'](function(_0x4f26cd){logger[_0xa433('0x14')]('UserSmsQueue,\x20%s,\x20%s',_0x3cb624,_0x4f26cd);_0x13f663(_0x4f26cd);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 7fbac02..16e5406 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7d7=['INTEGER','sequelize','exports'];(function(_0x4aa5c2,_0x35cf13){var _0xb8c19a=function(_0x35689a){while(--_0x35689a){_0x4aa5c2['push'](_0x4aa5c2['shift']());}};_0xb8c19a(++_0x35cf13);}(_0xf7d7,0x19f));var _0x7f7d=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xf7d7[_0x9c2427];return _0x51984f;};'use strict';var Sequelize=require(_0x7f7d('0x0'));module[_0x7f7d('0x1')]={'UserId':{'type':Sequelize[_0x7f7d('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x7f7d('0x2')]}}; \ No newline at end of file +var _0xec39=['INTEGER','sequelize','exports'];(function(_0x3e1463,_0x1d8ce4){var _0x32add3=function(_0xb13f82){while(--_0xb13f82){_0x3e1463['push'](_0x3e1463['shift']());}};_0x32add3(++_0x1d8ce4);}(_0xec39,0x178));var _0x9ec3=function(_0x377e74,_0x481ba1){_0x377e74=_0x377e74-0x0;var _0x3d0c3d=_0xec39[_0x377e74];return _0x3d0c3d;};'use strict';var Sequelize=require(_0x9ec3('0x0'));module[_0x9ec3('0x1')]={'UserId':{'type':Sequelize[_0x9ec3('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 3b22ec9..ca50d8c 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.model.js +++ b/server/api/userVoicePrefix/userVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x92a8f4,_0x30e671){var _0x250832=function(_0x567795){while(--_0x567795){_0x92a8f4['push'](_0x92a8f4['shift']());}};_0x250832(++_0x30e671);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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(_0x30b138,_0x2e0be8){var _0x31ff7e=function(_0x44eb39){while(--_0x44eb39){_0x30b138['push'](_0x30b138['shift']());}};_0x31ff7e(++_0x2e0be8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index a5c881a..b26bd9d 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2b2193,_0x220cf2){var _0xd4faf8=function(_0x248b8d){while(--_0x248b8d){_0x2b2193['push'](_0x2b2193['shift']());}};_0xd4faf8(++_0x220cf2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5c6390,_0xfa0b91){var _0x32917b=function(_0x2aba55){while(--_0x2aba55){_0x5c6390['push'](_0x5c6390['shift']());}};_0x32917b(++_0xfa0b91);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 4679efd..bfc5d9f 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.attributes.js +++ b/server/api/userVoiceQueue/userVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x261b=['sequelize','exports','INTEGER'];(function(_0x4ab3e0,_0x23c06b){var _0x3f9f9c=function(_0x4e3ffe){while(--_0x4e3ffe){_0x4ab3e0['push'](_0x4ab3e0['shift']());}};_0x3f9f9c(++_0x23c06b);}(_0x261b,0x195));var _0xb261=function(_0x5211e2,_0x21ff96){_0x5211e2=_0x5211e2-0x0;var _0x2d753b=_0x261b[_0x5211e2];return _0x2d753b;};'use strict';var Sequelize=require(_0xb261('0x0'));module[_0xb261('0x1')]={'penalty':{'type':Sequelize[_0xb261('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x17da=['INTEGER','sequelize'];(function(_0x34df41,_0x485cc9){var _0x1de19f=function(_0x4164f7){while(--_0x4164f7){_0x34df41['push'](_0x34df41['shift']());}};_0x1de19f(++_0x485cc9);}(_0x17da,0x167));var _0xa17d=function(_0x2c8333,_0x5a6995){_0x2c8333=_0x2c8333-0x0;var _0x3821e4=_0x17da[_0x2c8333];return _0x3821e4;};'use strict';var Sequelize=require(_0xa17d('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xa17d('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 2a0403f..65a606b 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.model.js +++ b/server/api/userVoiceQueue/userVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4729=['bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','moment'];(function(_0x2e71e7,_0x216597){var _0x4279b9=function(_0x509463){while(--_0x509463){_0x2e71e7['push'](_0x2e71e7['shift']());}};_0x4279b9(++_0x216597);}(_0x4729,0xe1));var _0x9472=function(_0x47da22,_0x5f48f1){_0x47da22=_0x47da22-0x0;var _0xbd7ef3=_0x4729[_0x47da22];return _0xbd7ef3;};'use strict';var _=require(_0x9472('0x0'));var util=require(_0x9472('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9472('0x2'));var BPromise=require(_0x9472('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9472('0x4'));var rimraf=require(_0x9472('0x5'));var config=require(_0x9472('0x6'));var attributes=require(_0x9472('0x7'));module[_0x9472('0x8')]=function(_0x32202d,_0x5d483a){return _0x32202d[_0x9472('0x9')](_0x9472('0xa'),attributes,{'tableName':_0x9472('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x98d9=['path','rimraf','../../config/environment','./userVoiceQueue.attributes','UserVoiceQueue','lodash','util','moment','bluebird','request-promise'];(function(_0x1157aa,_0x299bbc){var _0x585681=function(_0x186441){while(--_0x186441){_0x1157aa['push'](_0x1157aa['shift']());}};_0x585681(++_0x299bbc);}(_0x98d9,0x7d));var _0x998d=function(_0x580b85,_0x2245dc){_0x580b85=_0x580b85-0x0;var _0x23009a=_0x98d9[_0x580b85];return _0x23009a;};'use strict';var _=require(_0x998d('0x0'));var util=require(_0x998d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x998d('0x2'));var BPromise=require(_0x998d('0x3'));var rp=require(_0x998d('0x4'));var fs=require('fs');var path=require(_0x998d('0x5'));var rimraf=require(_0x998d('0x6'));var config=require(_0x998d('0x7'));var attributes=require(_0x998d('0x8'));module['exports']=function(_0x1ee2bc,_0x446dcb){return _0x1ee2bc['define'](_0x998d('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index c995c0f..e128d09 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.rpc.js +++ b/server/api/userVoiceQueue/userVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x875e=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x12ddb2,_0x5ad61e){var _0x10b6dd=function(_0x47dd27){while(--_0x47dd27){_0x12ddb2['push'](_0x12ddb2['shift']());}};_0x10b6dd(++_0x5ad61e);}(_0x875e,0x106));var _0xe875=function(_0x3ea022,_0x2d5328){_0x3ea022=_0x3ea022-0x0;var _0x3b97a2=_0x875e[_0x3ea022];return _0x3b97a2;};'use strict';var _=require(_0xe875('0x0'));var util=require(_0xe875('0x1'));var moment=require(_0xe875('0x2'));var BPromise=require('bluebird');var rs=require(_0xe875('0x3'));var fs=require('fs');var Redis=require(_0xe875('0x4'));var db=require(_0xe875('0x5'))['db'];var utils=require(_0xe875('0x6'));var logger=require(_0xe875('0x7'))(_0xe875('0x8'));var config=require(_0xe875('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe875('0xa')][_0xe875('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a8ae9,_0x79cf6a,_0x5d2102){return new BPromise(function(_0x11c9b0,_0x2d44c5){return client[_0xe875('0xc')](_0x2a8ae9,_0x5d2102)[_0xe875('0xd')](function(_0x4b61f5){logger[_0xe875('0xe')](_0xe875('0xf'),_0x79cf6a,_0xe875('0x10'));logger[_0xe875('0x11')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x79cf6a,'request\x20sent',JSON[_0xe875('0x12')](_0x4b61f5));if(_0x4b61f5['error']){if(_0x4b61f5[_0xe875('0x13')][_0xe875('0x14')]===0x1f4){logger['error'](_0xe875('0xf'),_0x79cf6a,_0x4b61f5['error'][_0xe875('0x15')]);return _0x2d44c5(_0x4b61f5[_0xe875('0x13')][_0xe875('0x15')]);}logger[_0xe875('0x13')](_0xe875('0xf'),_0x79cf6a,_0x4b61f5[_0xe875('0x13')][_0xe875('0x15')]);return _0x11c9b0(_0x4b61f5[_0xe875('0x13')][_0xe875('0x15')]);}else{logger[_0xe875('0xe')](_0xe875('0xf'),_0x79cf6a,'request\x20sent');_0x11c9b0(_0x4b61f5[_0xe875('0x16')][_0xe875('0x15')]);}})[_0xe875('0x17')](function(_0x1db796){logger[_0xe875('0x13')](_0xe875('0xf'),_0x79cf6a,_0x1db796);_0x2d44c5(_0x1db796);});});} \ No newline at end of file +var _0x17de=['UserVoiceQueue,\x20%s,\x20%s','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x44a0cb,_0xe5115e){var _0x2584ea=function(_0x50a172){while(--_0x50a172){_0x44a0cb['push'](_0x44a0cb['shift']());}};_0x2584ea(++_0xe5115e);}(_0x17de,0x115));var _0xe17d=function(_0x21e049,_0x378eb9){_0x21e049=_0x21e049-0x0;var _0x486008=_0x17de[_0x21e049];return _0x486008;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe17d('0x0'));var BPromise=require(_0xe17d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe17d('0x2'));var db=require(_0xe17d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe17d('0x4'))(_0xe17d('0x5'));var config=require(_0xe17d('0x6'));var jayson=require(_0xe17d('0x7'));var client=jayson[_0xe17d('0x8')][_0xe17d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x560479,_0x126224,_0x4856b5){return new BPromise(function(_0x3a33de,_0x3342ff){return client['request'](_0x560479,_0x4856b5)[_0xe17d('0xa')](function(_0x4d0244){logger[_0xe17d('0xb')]('UserVoiceQueue,\x20%s,\x20%s',_0x126224,_0xe17d('0xc'));logger[_0xe17d('0xd')](_0xe17d('0xe'),_0x126224,'request\x20sent',JSON['stringify'](_0x4d0244));if(_0x4d0244[_0xe17d('0xf')]){if(_0x4d0244[_0xe17d('0xf')][_0xe17d('0x10')]===0x1f4){logger[_0xe17d('0xf')](_0xe17d('0x11'),_0x126224,_0x4d0244[_0xe17d('0xf')][_0xe17d('0x12')]);return _0x3342ff(_0x4d0244[_0xe17d('0xf')][_0xe17d('0x12')]);}logger['error'](_0xe17d('0x11'),_0x126224,_0x4d0244[_0xe17d('0xf')][_0xe17d('0x12')]);return _0x3a33de(_0x4d0244[_0xe17d('0xf')][_0xe17d('0x12')]);}else{logger['info'](_0xe17d('0x11'),_0x126224,_0xe17d('0xc'));_0x3a33de(_0x4d0244[_0xe17d('0x13')][_0xe17d('0x12')]);}})[_0xe17d('0x14')](function(_0x279c56){logger[_0xe17d('0xf')](_0xe17d('0x11'),_0x126224,_0x279c56);_0x3342ff(_0x279c56);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 24b08bb..83a97f7 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5a6f95,_0x4787f7){var _0x1a5041=function(_0x11a509){while(--_0x11a509){_0x5a6f95['push'](_0x5a6f95['shift']());}};_0x1a5041(++_0x4787f7);}(_0xe706,0xa3));var _0x6e70=function(_0x414ff1,_0xf0462b){_0x414ff1=_0x414ff1-0x0;var _0x29c53f=_0xe706[_0x414ff1];return _0x29c53f;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1d0aee,_0x2c4454){var _0x34ee2c=function(_0x6e3b9d){while(--_0x6e3b9d){_0x1d0aee['push'](_0x1d0aee['shift']());}};_0x34ee2c(++_0x2c4454);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 82de752..ea34501 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09eb=['exports','Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface','sequelize'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0x09eb,0x1d9));var _0xb09e=function(_0x455893,_0x909838){_0x455893=_0x455893-0x0;var _0x3851e8=_0x09eb[_0x455893];return _0x3851e8;};'use strict';var Sequelize=require(_0xb09e('0x0'));module[_0xb09e('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xb09e('0x2')},'membername':{'type':Sequelize[_0xb09e('0x3')],'allowNull':![],'comment':_0xb09e('0x2')},'UserId':{'type':Sequelize[_0xb09e('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb09e('0x5'),'comment':_0xb09e('0x2')},'VoiceQueueId':{'type':Sequelize[_0xb09e('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0xb09e('0x3')],'allowNull':![],'unique':_0xb09e('0x5'),'comment':_0xb09e('0x2')},'penalty':{'type':Sequelize[_0xb09e('0x4')](0xb),'defaultValue':0x0,'comment':_0xb09e('0x2')},'paused':{'type':Sequelize[_0xb09e('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xcd10=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xcd10,0x16d));var _0x0cd1=function(_0x250467,_0x33137e){_0x250467=_0x250467-0x0;var _0x39b492=_0xcd10[_0x250467];return _0x39b492;};'use strict';var Sequelize=require('sequelize');module[_0x0cd1('0x0')]={'uniqueid':{'type':Sequelize[_0x0cd1('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x0cd1('0x2')},'membername':{'type':Sequelize[_0x0cd1('0x3')],'allowNull':![],'comment':_0x0cd1('0x2')},'UserId':{'type':Sequelize[_0x0cd1('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x0cd1('0x3')],'allowNull':![],'unique':_0x0cd1('0x4'),'comment':_0x0cd1('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x0cd1('0x3')],'allowNull':![],'unique':_0x0cd1('0x4'),'comment':_0x0cd1('0x2')},'penalty':{'type':Sequelize[_0x0cd1('0x1')](0xb),'defaultValue':0x0,'comment':_0x0cd1('0x2')},'paused':{'type':Sequelize[_0x0cd1('0x1')](0xb),'defaultValue':0x0,'comment':_0x0cd1('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 6ec95c6..4de712e 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20e0=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x20e0,0x19a));var _0x020e=function(_0x157609,_0x23cd26){_0x157609=_0x157609-0x0;var _0x26d474=_0x20e0[_0x157609];return _0x26d474;};'use strict';var EventEmitter=require(_0x020e('0x0'));var UserVoiceQueueRt=require(_0x020e('0x1'))['db'][_0x020e('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x020e('0x3')](0x0);var events={'afterCreate':_0x020e('0x4'),'afterUpdate':'update','afterDestroy':_0x020e('0x5')};function emitEvent(_0x4e5fb8){return function(_0x4f05ba,_0x379f7d,_0x9b1366){UserVoiceQueueRtEvents[_0x020e('0x6')](_0x4e5fb8+':'+_0x4f05ba['id'],_0x4f05ba);UserVoiceQueueRtEvents[_0x020e('0x6')](_0x4e5fb8,_0x4f05ba);_0x9b1366(null);};}for(var e in events){if(events[_0x020e('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x020e('0x8')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xecd3=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x36cbe9,_0x41ea42){var _0x443303=function(_0x54a228){while(--_0x54a228){_0x36cbe9['push'](_0x36cbe9['shift']());}};_0x443303(++_0x41ea42);}(_0xecd3,0x1cf));var _0x3ecd=function(_0x41fe0e,_0x1fe71f){_0x41fe0e=_0x41fe0e-0x0;var _0x22ae18=_0xecd3[_0x41fe0e];return _0x22ae18;};'use strict';var EventEmitter=require(_0x3ecd('0x0'));var UserVoiceQueueRt=require(_0x3ecd('0x1'))['db'][_0x3ecd('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x3ecd('0x3')](0x0);var events={'afterCreate':_0x3ecd('0x4'),'afterUpdate':'update','afterDestroy':_0x3ecd('0x5')};function emitEvent(_0x10f5dd){return function(_0x45573c,_0x43d65d,_0xdc61b5){UserVoiceQueueRtEvents[_0x3ecd('0x6')](_0x10f5dd+':'+_0x45573c['id'],_0x45573c);UserVoiceQueueRtEvents[_0x3ecd('0x6')](_0x10f5dd,_0x45573c);_0xdc61b5(null);};}for(var e in events){if(events[_0x3ecd('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x3ecd('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 565d6e1..e3db7da 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0114=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt'];(function(_0x5568ed,_0x61f3be){var _0x406c98=function(_0x3cc9a7){while(--_0x3cc9a7){_0x5568ed['push'](_0x5568ed['shift']());}};_0x406c98(++_0x61f3be);}(_0x0114,0x198));var _0x4011=function(_0xf4f46,_0x1f7bd1){_0xf4f46=_0xf4f46-0x0;var _0x263651=_0x0114[_0xf4f46];return _0x263651;};'use strict';var _=require(_0x4011('0x0'));var util=require('util');var logger=require(_0x4011('0x1'))('api');var moment=require(_0x4011('0x2'));var BPromise=require(_0x4011('0x3'));var rp=require(_0x4011('0x4'));var fs=require('fs');var path=require(_0x4011('0x5'));var rimraf=require(_0x4011('0x6'));var config=require(_0x4011('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x4011('0x8')]=function(_0x313e33,_0x479fc8){return _0x313e33[_0x4011('0x9')](_0x4011('0xa'),attributes,{'tableName':_0x4011('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c4e=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash'];(function(_0x4db2d6,_0x1d39ec){var _0x1b707b=function(_0x1314d9){while(--_0x1314d9){_0x4db2d6['push'](_0x4db2d6['shift']());}};_0x1b707b(++_0x1d39ec);}(_0x3c4e,0x112));var _0xe3c4=function(_0x58be60,_0x3150e9){_0x58be60=_0x58be60-0x0;var _0x126469=_0x3c4e[_0x58be60];return _0x126469;};'use strict';var _=require(_0xe3c4('0x0'));var util=require('util');var logger=require(_0xe3c4('0x1'))(_0xe3c4('0x2'));var moment=require('moment');var BPromise=require(_0xe3c4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3c4('0x4'));var rimraf=require(_0xe3c4('0x5'));var config=require(_0xe3c4('0x6'));var attributes=require(_0xe3c4('0x7'));module[_0xe3c4('0x8')]=function(_0x1886b6,_0xfd566d){return _0x1886b6['define'](_0xe3c4('0x9'),attributes,{'tableName':_0xe3c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index a1a9ed4..66fbf04 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde9e=['http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2ae22a,_0x4fe753){var _0x286a82=function(_0x256e58){while(--_0x256e58){_0x2ae22a['push'](_0x2ae22a['shift']());}};_0x286a82(++_0x4fe753);}(_0xde9e,0x69));var _0xede9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde9e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xede9('0x0'));var util=require(_0xede9('0x1'));var moment=require(_0xede9('0x2'));var BPromise=require(_0xede9('0x3'));var rs=require(_0xede9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xede9('0x5'))['db'];var utils=require(_0xede9('0x6'));var logger=require(_0xede9('0x7'))(_0xede9('0x8'));var config=require(_0xede9('0x9'));var jayson=require(_0xede9('0xa'));var client=jayson[_0xede9('0xb')][_0xede9('0xc')]({'port':0x232a});config[_0xede9('0xd')]=_[_0xede9('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xede9('0xf'))(new Redis(config[_0xede9('0xd')]));require(_0xede9('0x10'))[_0xede9('0x11')](socket);function respondWithRpcPromise(_0x21ebc6,_0x542fbe,_0x3853fd){return new BPromise(function(_0xac50e3,_0x19490e){return client['request'](_0x21ebc6,_0x3853fd)[_0xede9('0x12')](function(_0x3356ce){logger[_0xede9('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x542fbe,'request\x20sent');logger['debug'](_0xede9('0x14'),_0x542fbe,_0xede9('0x15'),JSON[_0xede9('0x16')](_0x3356ce));if(_0x3356ce[_0xede9('0x17')]){if(_0x3356ce[_0xede9('0x17')][_0xede9('0x18')]===0x1f4){logger['error'](_0xede9('0x19'),_0x542fbe,_0x3356ce[_0xede9('0x17')]['message']);return _0x19490e(_0x3356ce['error'][_0xede9('0x1a')]);}logger[_0xede9('0x17')](_0xede9('0x19'),_0x542fbe,_0x3356ce[_0xede9('0x17')][_0xede9('0x1a')]);return _0xac50e3(_0x3356ce[_0xede9('0x17')][_0xede9('0x1a')]);}else{logger[_0xede9('0x13')](_0xede9('0x19'),_0x542fbe,_0xede9('0x15'));_0xac50e3(_0x3356ce[_0xede9('0x1b')][_0xede9('0x1a')]);}})[_0xede9('0x1c')](function(_0x5a226f){logger[_0xede9('0x17')](_0xede9('0x19'),_0x542fbe,_0x5a226f);_0x19490e(_0x5a226f);});});}exports[_0xede9('0x1d')]=function(_0x366f92){var _0xfb633e=this;return new Promise(function(_0x25f680,_0x532224){return db[_0xede9('0x1e')][_0xede9('0x1f')]({'raw':_0x366f92[_0xede9('0x20')]?_0x366f92[_0xede9('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x366f92[_0xede9('0x20')]?_0x366f92[_0xede9('0x20')]['where']||null:null,'attributes':[[db[_0xede9('0x21')]['fn'](_0xede9('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0xede9('0x23')](_0xede9('0x24')))),_0xede9('0x25')]]})['then'](function(_0x5172d7){logger[_0xede9('0x13')]('GetVoiceQueueRtPauses',_0x366f92);logger[_0xede9('0x26')]('GetVoiceQueueRtPauses',_0x366f92,JSON[_0xede9('0x16')](_0x5172d7));_0x25f680(_0x5172d7);})[_0xede9('0x1c')](function(_0x20c1ef){logger['error'](_0xede9('0x1d'),_0x20c1ef[_0xede9('0x1a')],_0x366f92);_0x532224(_0xfb633e[_0xede9('0x17')](0x1f4,_0x20c1ef[_0xede9('0x1a')]));});});}; \ No newline at end of file +var _0x5fe1=['../../config/logger','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','UserVoiceQueueRt','options','where','sequelize','COUNT','literal','outboundQueuePauses','util','bluebird','ioredis'];(function(_0x123ea8,_0x45eb48){var _0x5f0dc9=function(_0x5a39cf){while(--_0x5a39cf){_0x123ea8['push'](_0x123ea8['shift']());}};_0x5f0dc9(++_0x45eb48);}(_0x5fe1,0x1ad));var _0x15fe=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5fe1[_0xefd519];return _0x4bb882;};'use strict';var _=require('lodash');var util=require(_0x15fe('0x0'));var moment=require('moment');var BPromise=require(_0x15fe('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x15fe('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x15fe('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x15fe('0x4'));var client=jayson[_0x15fe('0x5')][_0x15fe('0x6')]({'port':0x232a});config[_0x15fe('0x7')]=_[_0x15fe('0x8')](config['redis'],{'host':_0x15fe('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x15fe('0x7')]));require('./userVoiceQueueRt.socket')[_0x15fe('0xa')](socket);function respondWithRpcPromise(_0x4482b1,_0x5df9e5,_0x15a163){return new BPromise(function(_0xdf9e47,_0x327042){return client[_0x15fe('0xb')](_0x4482b1,_0x15a163)[_0x15fe('0xc')](function(_0x32deda){logger[_0x15fe('0xd')](_0x15fe('0xe'),_0x5df9e5,_0x15fe('0xf'));logger[_0x15fe('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x5df9e5,_0x15fe('0xf'),JSON['stringify'](_0x32deda));if(_0x32deda['error']){if(_0x32deda[_0x15fe('0x11')]['code']===0x1f4){logger[_0x15fe('0x11')](_0x15fe('0xe'),_0x5df9e5,_0x32deda[_0x15fe('0x11')][_0x15fe('0x12')]);return _0x327042(_0x32deda['error'][_0x15fe('0x12')]);}logger[_0x15fe('0x11')](_0x15fe('0xe'),_0x5df9e5,_0x32deda['error'][_0x15fe('0x12')]);return _0xdf9e47(_0x32deda['error'][_0x15fe('0x12')]);}else{logger[_0x15fe('0xd')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5df9e5,_0x15fe('0xf'));_0xdf9e47(_0x32deda['result'][_0x15fe('0x12')]);}})[_0x15fe('0x13')](function(_0x2522f7){logger[_0x15fe('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5df9e5,_0x2522f7);_0x327042(_0x2522f7);});});}exports['GetVoiceQueueRtPauses']=function(_0x396f2b){var _0x220b46=this;return new Promise(function(_0x52aa16,_0x2fe531){return db[_0x15fe('0x14')]['findAll']({'raw':_0x396f2b[_0x15fe('0x15')]?_0x396f2b[_0x15fe('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x396f2b[_0x15fe('0x15')]?_0x396f2b[_0x15fe('0x15')][_0x15fe('0x16')]||null:null,'attributes':[[db[_0x15fe('0x17')]['fn'](_0x15fe('0x18'),db[_0x15fe('0x17')]['fn']('IF',db[_0x15fe('0x17')][_0x15fe('0x19')]('`paused`\x20=\x201,\x201,\x20null'))),_0x15fe('0x1a')]]})['then'](function(_0x314bd0){logger[_0x15fe('0xd')]('GetVoiceQueueRtPauses',_0x396f2b);logger[_0x15fe('0x10')]('GetVoiceQueueRtPauses',_0x396f2b,JSON['stringify'](_0x314bd0));_0x52aa16(_0x314bd0);})[_0x15fe('0x13')](function(_0x34793a){logger[_0x15fe('0x11')]('GetVoiceQueueRtPauses',_0x34793a['message'],_0x396f2b);_0x2fe531(_0x220b46[_0x15fe('0x11')](0x1f4,_0x34793a['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index fd43186..549e5c3 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab9f=['emit','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','update'];(function(_0x4d8121,_0x2f5171){var _0x477e74=function(_0x5b2357){while(--_0x5b2357){_0x4d8121['push'](_0x4d8121['shift']());}};_0x477e74(++_0x2f5171);}(_0xab9f,0x1bd));var _0xfab9=function(_0x3a57b0,_0x23145a){_0x3a57b0=_0x3a57b0-0x0;var _0x2b8f3e=_0xab9f[_0x3a57b0];return _0x2b8f3e;};'use strict';var UserVoiceQueueRtEvents=require(_0xfab9('0x0'));var events=['save',_0xfab9('0x1'),_0xfab9('0x2')];function createListener(_0x4650a0,_0x52dab0){return function(_0xbdd0fa){_0x52dab0[_0xfab9('0x3')](_0x4650a0,_0xbdd0fa);};}function removeListener(_0x50b645,_0xb7152f){return function(){UserVoiceQueueRtEvents['removeListener'](_0x50b645,_0xb7152f);};}exports[_0xfab9('0x4')]=function(_0x54ae20){for(var _0x1bfe77=0x0,_0x341aaf=events[_0xfab9('0x5')];_0x1bfe77<_0x341aaf;_0x1bfe77++){var _0x27e769=events[_0x1bfe77];var _0x524986=createListener(_0xfab9('0x6')+_0x27e769,_0x54ae20);UserVoiceQueueRtEvents['on'](_0x27e769,_0x524986);}}; \ No newline at end of file +var _0x6299=['register','remove','update','emit','removeListener'];(function(_0x55e5ed,_0x1549d3){var _0x5e4675=function(_0x354826){while(--_0x354826){_0x55e5ed['push'](_0x55e5ed['shift']());}};_0x5e4675(++_0x1549d3);}(_0x6299,0x169));var _0x9629=function(_0x2cb393,_0x2a6518){_0x2cb393=_0x2cb393-0x0;var _0xa090a0=_0x6299[_0x2cb393];return _0xa090a0;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save',_0x9629('0x0'),_0x9629('0x1')];function createListener(_0x3cf1e1,_0x35868a){return function(_0x3c3ab2){_0x35868a[_0x9629('0x2')](_0x3cf1e1,_0x3c3ab2);};}function removeListener(_0x55d4ce,_0x327ee9){return function(){UserVoiceQueueRtEvents[_0x9629('0x3')](_0x55d4ce,_0x327ee9);};}exports[_0x9629('0x4')]=function(_0x1edc13){for(var _0x1206bf=0x0,_0x5d5981=events['length'];_0x1206bf<_0x5d5981;_0x1206bf++){var _0x2c5ca5=events[_0x1206bf];var _0x1754e6=createListener('userVoiceQueueRt:'+_0x2c5ca5,_0x1edc13);UserVoiceQueueRtEvents['on'](_0x2c5ca5,_0x1754e6);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 77e4b8b..0ce9f94 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1a86ec,_0x3feb05){var _0x2e2b34=function(_0x44d3bb){while(--_0x44d3bb){_0x1a86ec['push'](_0x1a86ec['shift']());}};_0x2e2b34(++_0x3feb05);}(_0xedd9,0xfc));var _0x9edd=function(_0x2f92d1,_0x4e6aa2){_0x2f92d1=_0x2f92d1-0x0;var _0x2b0c0d=_0xedd9[_0x2f92d1];return _0x2b0c0d;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3d075a,_0x507f04){var _0x418be1=function(_0x19c75b){while(--_0x19c75b){_0x3d075a['push'](_0x3d075a['shift']());}};_0x418be1(++_0x507f04);}(_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 diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 69d5f76..2ce9bf6 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x117c=['exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x117c,0x8f));var _0xc117=function(_0x5f5c34,_0x23e89){_0x5f5c34=_0x5f5c34-0x0;var _0x48c0a7=_0x117c[_0x5f5c34];return _0x48c0a7;};'use strict';var Sequelize=require('sequelize');module[_0xc117('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9815=['exports','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9815,0x1d0));var _0x5981=function(_0xea475f,_0x4d6981){_0xea475f=_0xea475f-0x0;var _0x2920e9=_0x9815[_0xea475f];return _0x2920e9;};'use strict';var Sequelize=require(_0x5981('0x0'));module[_0x5981('0x1')]={'penalty':{'type':Sequelize[_0x5981('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 9fc7737..b9571df 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d1c=['user_has_whatsapp_queues','lodash','../../config/logger','api','moment','path','../../config/environment','exports','UserWhatsappQueue'];(function(_0x495625,_0x2dbb3a){var _0xa034cc=function(_0x3af2a3){while(--_0x3af2a3){_0x495625['push'](_0x495625['shift']());}};_0xa034cc(++_0x2dbb3a);}(_0x2d1c,0x76));var _0xc2d1=function(_0x4aa0a5,_0x1a915b){_0x4aa0a5=_0x4aa0a5-0x0;var _0x293470=_0x2d1c[_0x4aa0a5];return _0x293470;};'use strict';var _=require(_0xc2d1('0x0'));var util=require('util');var logger=require(_0xc2d1('0x1'))(_0xc2d1('0x2'));var moment=require(_0xc2d1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc2d1('0x4'));var rimraf=require('rimraf');var config=require(_0xc2d1('0x5'));var attributes=require('./userWhatsappQueue.attributes');module[_0xc2d1('0x6')]=function(_0x3f83ac,_0x2b8ade){return _0x3f83ac['define'](_0xc2d1('0x7'),attributes,{'tableName':_0xc2d1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8aa1=['moment','bluebird','path','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8aa1,0x110));var _0x18aa=function(_0x6923ea,_0x4b5785){_0x6923ea=_0x6923ea-0x0;var _0x37b5d1=_0x8aa1[_0x6923ea];return _0x37b5d1;};'use strict';var _=require(_0x18aa('0x0'));var util=require(_0x18aa('0x1'));var logger=require(_0x18aa('0x2'))('api');var moment=require(_0x18aa('0x3'));var BPromise=require(_0x18aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x18aa('0x5'));var rimraf=require('rimraf');var config=require(_0x18aa('0x6'));var attributes=require(_0x18aa('0x7'));module[_0x18aa('0x8')]=function(_0x59d5ec,_0x1ae460){return _0x59d5ec['define'](_0x18aa('0x9'),attributes,{'tableName':_0x18aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 5efd7e8..d4625f8 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xded9=['catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5d8065,_0x2c32cd){var _0x5bf04a=function(_0x2791f8){while(--_0x2791f8){_0x5d8065['push'](_0x5d8065['shift']());}};_0x5bf04a(++_0x2c32cd);}(_0xded9,0xb5));var _0x9ded=function(_0x18f533,_0xa5e674){_0x18f533=_0x18f533-0x0;var _0x153b34=_0xded9[_0x18f533];return _0x153b34;};'use strict';var _=require(_0x9ded('0x0'));var util=require('util');var moment=require(_0x9ded('0x1'));var BPromise=require('bluebird');var rs=require(_0x9ded('0x2'));var fs=require('fs');var Redis=require(_0x9ded('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9ded('0x4'));var logger=require(_0x9ded('0x5'))(_0x9ded('0x6'));var config=require(_0x9ded('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x201f0b,_0x5ec5fb,_0x55df8a){return new BPromise(function(_0x358e94,_0x3b8d73){return client['request'](_0x201f0b,_0x55df8a)[_0x9ded('0x8')](function(_0x274e14){logger[_0x9ded('0x9')](_0x9ded('0xa'),_0x5ec5fb,_0x9ded('0xb'));logger[_0x9ded('0xc')](_0x9ded('0xd'),_0x5ec5fb,_0x9ded('0xb'),JSON[_0x9ded('0xe')](_0x274e14));if(_0x274e14[_0x9ded('0xf')]){if(_0x274e14[_0x9ded('0xf')][_0x9ded('0x10')]===0x1f4){logger[_0x9ded('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5ec5fb,_0x274e14['error'][_0x9ded('0x11')]);return _0x3b8d73(_0x274e14[_0x9ded('0xf')][_0x9ded('0x11')]);}logger[_0x9ded('0xf')](_0x9ded('0xa'),_0x5ec5fb,_0x274e14['error'][_0x9ded('0x11')]);return _0x358e94(_0x274e14[_0x9ded('0xf')][_0x9ded('0x11')]);}else{logger[_0x9ded('0x9')](_0x9ded('0xa'),_0x5ec5fb,'request\x20sent');_0x358e94(_0x274e14[_0x9ded('0x12')]['message']);}})[_0x9ded('0x13')](function(_0x59f8a9){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x5ec5fb,_0x59f8a9);_0x3b8d73(_0x59f8a9);});});} \ No newline at end of file +var _0xb0d7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x11ef6d,_0xbc627b){var _0x3be32a=function(_0x2dda84){while(--_0x2dda84){_0x11ef6d['push'](_0x11ef6d['shift']());}};_0x3be32a(++_0xbc627b);}(_0xb0d7,0x156));var _0x7b0d=function(_0x506762,_0x5c2639){_0x506762=_0x506762-0x0;var _0x559d09=_0xb0d7[_0x506762];return _0x559d09;};'use strict';var _=require(_0x7b0d('0x0'));var util=require(_0x7b0d('0x1'));var moment=require(_0x7b0d('0x2'));var BPromise=require(_0x7b0d('0x3'));var rs=require(_0x7b0d('0x4'));var fs=require('fs');var Redis=require(_0x7b0d('0x5'));var db=require(_0x7b0d('0x6'))['db'];var utils=require(_0x7b0d('0x7'));var logger=require(_0x7b0d('0x8'))(_0x7b0d('0x9'));var config=require(_0x7b0d('0xa'));var jayson=require(_0x7b0d('0xb'));var client=jayson[_0x7b0d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc797,_0x2262e3,_0x788ed6){return new BPromise(function(_0x292786,_0x184801){return client[_0x7b0d('0xd')](_0xc797,_0x788ed6)['then'](function(_0x24bfeb){logger['info'](_0x7b0d('0xe'),_0x2262e3,'request\x20sent');logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x2262e3,_0x7b0d('0xf'),JSON[_0x7b0d('0x10')](_0x24bfeb));if(_0x24bfeb[_0x7b0d('0x11')]){if(_0x24bfeb[_0x7b0d('0x11')][_0x7b0d('0x12')]===0x1f4){logger['error'](_0x7b0d('0xe'),_0x2262e3,_0x24bfeb[_0x7b0d('0x11')][_0x7b0d('0x13')]);return _0x184801(_0x24bfeb[_0x7b0d('0x11')][_0x7b0d('0x13')]);}logger[_0x7b0d('0x11')](_0x7b0d('0xe'),_0x2262e3,_0x24bfeb['error'][_0x7b0d('0x13')]);return _0x292786(_0x24bfeb['error'][_0x7b0d('0x13')]);}else{logger[_0x7b0d('0x14')](_0x7b0d('0xe'),_0x2262e3,_0x7b0d('0xf'));_0x292786(_0x24bfeb[_0x7b0d('0x15')][_0x7b0d('0x13')]);}})[_0x7b0d('0x16')](function(_0x3a6d90){logger[_0x7b0d('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2262e3,_0x3a6d90);_0x184801(_0x3a6d90);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 4fd97a2..0749d05 100644 --- a/server/api/variable/index.js +++ b/server/api/variable/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ba7=['create','put','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x470f24,_0x2436a9){var _0x2c6fc8=function(_0x3ef190){while(--_0x3ef190){_0x470f24['push'](_0x470f24['shift']());}};_0x2c6fc8(++_0x2436a9);}(_0x0ba7,0x16d));var _0x70ba=function(_0x512e93,_0x7915ba){_0x512e93=_0x512e93-0x0;var _0x50bd84=_0x0ba7[_0x512e93];return _0x50bd84;};'use strict';var multer=require(_0x70ba('0x0'));var util=require('util');var path=require(_0x70ba('0x1'));var timeout=require(_0x70ba('0x2'));var express=require(_0x70ba('0x3'));var router=express[_0x70ba('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x70ba('0x5'));var interaction=require(_0x70ba('0x6'));var config=require(_0x70ba('0x7'));var controller=require(_0x70ba('0x8'));router[_0x70ba('0x9')]('/',auth[_0x70ba('0xa')](),controller[_0x70ba('0xb')]);router[_0x70ba('0x9')](_0x70ba('0xc'),auth[_0x70ba('0xa')](),controller[_0x70ba('0xd')]);router[_0x70ba('0xe')]('/',auth[_0x70ba('0xa')](),controller[_0x70ba('0xf')]);router[_0x70ba('0x10')]('/:id',auth[_0x70ba('0xa')](),controller['update']);router[_0x70ba('0x11')](_0x70ba('0xc'),auth[_0x70ba('0xa')](),controller[_0x70ba('0x12')]);module['exports']=router; \ No newline at end of file +var _0x97d5=['get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x45eacc,_0x3727a4){var _0x3f1252=function(_0x36b7f4){while(--_0x36b7f4){_0x45eacc['push'](_0x45eacc['shift']());}};_0x3f1252(++_0x3727a4);}(_0x97d5,0x199));var _0x597d=function(_0x1cf116,_0x21eace){_0x1cf116=_0x1cf116-0x0;var _0x4ba35f=_0x97d5[_0x1cf116];return _0x4ba35f;};'use strict';var multer=require(_0x597d('0x0'));var util=require(_0x597d('0x1'));var path=require(_0x597d('0x2'));var timeout=require(_0x597d('0x3'));var express=require(_0x597d('0x4'));var router=express[_0x597d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x597d('0x6'));var interaction=require(_0x597d('0x7'));var config=require(_0x597d('0x8'));var controller=require('./variable.controller');router[_0x597d('0x9')]('/',auth[_0x597d('0xa')](),controller[_0x597d('0xb')]);router[_0x597d('0x9')](_0x597d('0xc'),auth[_0x597d('0xa')](),controller[_0x597d('0xd')]);router['post']('/',auth[_0x597d('0xa')](),controller[_0x597d('0xe')]);router['put'](_0x597d('0xc'),auth['isAuthenticated'](),controller[_0x597d('0xf')]);router[_0x597d('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x597d('0x11')]);module[_0x597d('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 61a7241..13927b2 100644 --- a/server/api/variable/variable.attributes.js +++ b/server/api/variable/variable.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdae9=['exports','STRING','sequelize'];(function(_0x1f1f3b,_0x227aa9){var _0x2e63aa=function(_0x165a34){while(--_0x165a34){_0x1f1f3b['push'](_0x1f1f3b['shift']());}};_0x2e63aa(++_0x227aa9);}(_0xdae9,0x12b));var _0x9dae=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xdae9[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x9dae('0x0'));module[_0x9dae('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9dae('0x2')]}}; \ No newline at end of file +var _0x43f8=['exports','STRING','sequelize'];(function(_0x5527dd,_0x2389f6){var _0x2ffd1b=function(_0x4e9abf){while(--_0x4e9abf){_0x5527dd['push'](_0x5527dd['shift']());}};_0x2ffd1b(++_0x2389f6);}(_0x43f8,0x1bb));var _0x843f=function(_0x4a3c65,_0x150dfb){_0x4a3c65=_0x4a3c65-0x0;var _0x4a9565=_0x43f8[_0x4a3c65];return _0x4a9565;};'use strict';var Sequelize=require(_0x843f('0x0'));module[_0x843f('0x1')]={'name':{'type':Sequelize[_0x843f('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index a13becd..1832b38 100644 --- a/server/api/variable/variable.controller.js +++ b/server/api/variable/variable.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ade=['pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','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','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','end','status','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','then','get','Variables','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','Variable','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x8ade,0x6d));var _0xe8ad=function(_0x3ed505,_0x278780){_0x3ed505=_0x3ed505-0x0;var _0x43d948=_0x8ade[_0x3ed505];return _0x43d948;};'use strict';var emlformat=require(_0xe8ad('0x0'));var rimraf=require(_0xe8ad('0x1'));var zipdir=require(_0xe8ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8ad('0x3'));var moment=require(_0xe8ad('0x4'));var BPromise=require(_0xe8ad('0x5'));var Mustache=require(_0xe8ad('0x6'));var util=require('util');var path=require(_0xe8ad('0x7'));var sox=require(_0xe8ad('0x8'));var csv=require(_0xe8ad('0x9'));var ejs=require(_0xe8ad('0xa'));var fs=require('fs');var fs_extra=require(_0xe8ad('0xb'));var _=require(_0xe8ad('0xc'));var squel=require(_0xe8ad('0xd'));var crypto=require(_0xe8ad('0xe'));var jsforce=require(_0xe8ad('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe8ad('0x9'));var querystring=require(_0xe8ad('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe8ad('0x11'));var hardwareService=require(_0xe8ad('0x12'));var logger=require(_0xe8ad('0x13'))(_0xe8ad('0x14'));var utils=require('../../config/utils');var config=require(_0xe8ad('0x15'));var licenseUtil=require(_0xe8ad('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a3c75,_0x526243){_0x526243=_0x526243||0xcc;return function(_0xfa4ffb){if(_0xfa4ffb){return _0x3a3c75['sendStatus'](_0x526243);}return _0x3a3c75['status'](_0x526243)[_0xe8ad('0x17')]();};}function respondWithResult(_0x1a7688,_0x5454f5){_0x5454f5=_0x5454f5||0xc8;return function(_0x1d85a2){if(_0x1d85a2){return _0x1a7688[_0xe8ad('0x18')](_0x5454f5)[_0xe8ad('0x19')](_0x1d85a2);}};}function respondWithFilteredResult(_0x54af69,_0x5485ba){return function(_0x1282e7){if(_0x1282e7){var _0x11fd59=typeof _0x5485ba[_0xe8ad('0x1a')]==='undefined'&&typeof _0x5485ba[_0xe8ad('0x1b')]===_0xe8ad('0x1c');var _0x4f42be=_0x1282e7['count'];var _0x43a751=_0x11fd59?0x0:_0x5485ba['offset'];var _0x370b8e=_0x11fd59?_0x1282e7['count']:_0x5485ba[_0xe8ad('0x1a')]+_0x5485ba[_0xe8ad('0x1b')];var _0x575911;if(_0x370b8e>=_0x4f42be){_0x370b8e=_0x4f42be;_0x575911=0xc8;}else{_0x575911=0xce;}_0x54af69['status'](_0x575911);return _0x54af69[_0xe8ad('0x1d')](_0xe8ad('0x1e'),_0x43a751+'-'+_0x370b8e+'/'+_0x4f42be)[_0xe8ad('0x19')](_0x1282e7);}return null;};}function patchUpdates(_0x2a28c3){return function(_0x13d67c){try{jsonpatch[_0xe8ad('0x1f')](_0x13d67c,_0x2a28c3,!![]);}catch(_0x33c84e){return BPromise[_0xe8ad('0x20')](_0x33c84e);}return _0x13d67c[_0xe8ad('0x21')]();};}function saveUpdates(_0x908ac4,_0x35675c){return function(_0x45c42f){if(_0x45c42f){return _0x45c42f[_0xe8ad('0x22')](_0x908ac4)[_0xe8ad('0x23')](function(_0x493af5){return _0x493af5;});}return null;};}function removeEntity(_0x145398,_0x3433ce){return function(_0x5b0af8){if(_0x5b0af8){return _0x5b0af8['destroy']()[_0xe8ad('0x23')](function(){var _0x50f635=_0x5b0af8[_0xe8ad('0x24')]({'plain':!![]});var _0x5db0ed=_0xe8ad('0x25');return db[_0xe8ad('0x26')][_0xe8ad('0x27')]({'where':{'type':_0x5db0ed,'resourceId':_0x50f635['id']}})[_0xe8ad('0x23')](function(){return _0x5b0af8;});})[_0xe8ad('0x23')](function(){_0x145398['status'](0xcc)[_0xe8ad('0x17')]();});}};}function handleEntityNotFound(_0x570463,_0x16468a){return function(_0x47d7c6){if(!_0x47d7c6){_0x570463[_0xe8ad('0x28')](0x194);}return _0x47d7c6;};}function handleError(_0x1f8d96,_0x1dfa51){_0x1dfa51=_0x1dfa51||0x1f4;return function(_0x3d87ed){logger[_0xe8ad('0x29')](_0x3d87ed[_0xe8ad('0x2a')]);if(_0x3d87ed['name']){delete _0x3d87ed[_0xe8ad('0x2b')];}_0x1f8d96['status'](_0x1dfa51)[_0xe8ad('0x2c')](_0x3d87ed);};}exports[_0xe8ad('0x2d')]=function(_0x2b925c,_0x4e44df){var _0x397a31={},_0x912715={},_0x451195={'count':0x0,'rows':[]};var _0x3c1d6a=_['map'](db[_0xe8ad('0x2e')][_0xe8ad('0x2f')],function(_0x5d360e){return{'name':_0x5d360e[_0xe8ad('0x30')],'type':_0x5d360e[_0xe8ad('0x31')][_0xe8ad('0x32')]};});_0x912715['model']=_[_0xe8ad('0x33')](_0x3c1d6a,'name');_0x912715[_0xe8ad('0x34')]=_[_0xe8ad('0x35')](_0x2b925c['query']);_0x912715[_0xe8ad('0x36')]=_[_0xe8ad('0x37')](_0x912715['model'],_0x912715[_0xe8ad('0x34')]);_0x397a31[_0xe8ad('0x38')]=_['intersection'](_0x912715[_0xe8ad('0x39')],qs[_0xe8ad('0x3a')](_0x2b925c[_0xe8ad('0x34')][_0xe8ad('0x3a')]));_0x397a31['attributes']=_0x397a31['attributes'][_0xe8ad('0x3b')]?_0x397a31[_0xe8ad('0x38')]:_0x912715[_0xe8ad('0x39')];if(!_0x2b925c[_0xe8ad('0x34')][_0xe8ad('0x3c')](_0xe8ad('0x3d'))){_0x397a31[_0xe8ad('0x1b')]=qs[_0xe8ad('0x1b')](_0x2b925c['query'][_0xe8ad('0x1b')]);_0x397a31['offset']=qs['offset'](_0x2b925c[_0xe8ad('0x34')][_0xe8ad('0x1a')]);}_0x397a31[_0xe8ad('0x3e')]=qs[_0xe8ad('0x3f')](_0x2b925c['query'][_0xe8ad('0x3f')]);_0x397a31[_0xe8ad('0x40')]=qs[_0xe8ad('0x36')](_[_0xe8ad('0x41')](_0x2b925c[_0xe8ad('0x34')],_0x912715[_0xe8ad('0x36')]),_0x3c1d6a);if(_0x2b925c[_0xe8ad('0x34')][_0xe8ad('0x42')]){_0x397a31[_0xe8ad('0x40')]=_[_0xe8ad('0x43')](_0x397a31[_0xe8ad('0x40')],{'$or':_['map'](_0x3c1d6a,function(_0x234cf9){if(_0x234cf9[_0xe8ad('0x31')]!==_0xe8ad('0x44')){var _0x2932f0={};_0x2932f0[_0x234cf9['name']]={'$like':'%'+_0x2b925c[_0xe8ad('0x34')][_0xe8ad('0x42')]+'%'};return _0x2932f0;}})});}_0x397a31=_[_0xe8ad('0x43')]({},_0x397a31,_0x2b925c[_0xe8ad('0x45')]);var _0x137a98={'where':_0x397a31[_0xe8ad('0x40')]};return db[_0xe8ad('0x2e')][_0xe8ad('0x46')](_0x137a98)[_0xe8ad('0x23')](function(_0x3dab8e){_0x451195[_0xe8ad('0x46')]=_0x3dab8e;if(_0x2b925c['query'][_0xe8ad('0x47')]){_0x397a31['include']=[{'all':!![]}];}return db[_0xe8ad('0x2e')][_0xe8ad('0x48')](_0x397a31);})['then'](function(_0x43c805){_0x451195[_0xe8ad('0x49')]=_0x43c805;return _0x451195;})[_0xe8ad('0x23')](respondWithFilteredResult(_0x4e44df,_0x397a31))[_0xe8ad('0x4a')](handleError(_0x4e44df,null));};exports[_0xe8ad('0x4b')]=function(_0x3ec99d,_0x3717a7){var _0xbabdbe={'raw':!![],'where':{'id':_0x3ec99d[_0xe8ad('0x4c')]['id']}},_0x342d60={};_0x342d60[_0xe8ad('0x39')]=_[_0xe8ad('0x35')](db['Variable'][_0xe8ad('0x2f')]);_0x342d60['query']=_['keys'](_0x3ec99d[_0xe8ad('0x34')]);_0x342d60[_0xe8ad('0x36')]=_[_0xe8ad('0x37')](_0x342d60['model'],_0x342d60[_0xe8ad('0x34')]);_0xbabdbe[_0xe8ad('0x38')]=_['intersection'](_0x342d60[_0xe8ad('0x39')],qs[_0xe8ad('0x3a')](_0x3ec99d['query'][_0xe8ad('0x3a')]));_0xbabdbe[_0xe8ad('0x38')]=_0xbabdbe[_0xe8ad('0x38')][_0xe8ad('0x3b')]?_0xbabdbe[_0xe8ad('0x38')]:_0x342d60[_0xe8ad('0x39')];if(_0x3ec99d[_0xe8ad('0x34')][_0xe8ad('0x47')]){_0xbabdbe['include']=[{'all':!![]}];}_0xbabdbe=_['merge']({},_0xbabdbe,_0x3ec99d[_0xe8ad('0x45')]);return db[_0xe8ad('0x2e')][_0xe8ad('0x4d')](_0xbabdbe)['then'](handleEntityNotFound(_0x3717a7,null))['then'](respondWithResult(_0x3717a7,null))[_0xe8ad('0x4a')](handleError(_0x3717a7,null));};exports[_0xe8ad('0x4e')]=function(_0x2723a4,_0x2249eb){return db[_0xe8ad('0x2e')][_0xe8ad('0x4e')](_0x2723a4['body'],{})[_0xe8ad('0x23')](function(_0x3b37f5){var _0x1f0396=_0x2723a4[_0xe8ad('0x4f')]['get']({'plain':!![]});if(!_0x1f0396)throw new Error(_0xe8ad('0x50'));if(_0x1f0396[_0xe8ad('0x51')]===_0xe8ad('0x4f')){var _0x5c576f=_0x3b37f5[_0xe8ad('0x24')]({'plain':!![]});var _0x12b052=_0xe8ad('0x25');return db[_0xe8ad('0x52')][_0xe8ad('0x4d')]({'where':{'name':_0x12b052,'userProfileId':_0x1f0396[_0xe8ad('0x53')]},'raw':!![]})['then'](function(_0x2a56f0){if(_0x2a56f0&&_0x2a56f0[_0xe8ad('0x54')]===0x0){return db['UserProfileResource'][_0xe8ad('0x4e')]({'name':_0x5c576f[_0xe8ad('0x2b')],'resourceId':_0x5c576f['id'],'type':_0x2a56f0[_0xe8ad('0x2b')],'sectionId':_0x2a56f0['id']},{})[_0xe8ad('0x23')](function(){return _0x3b37f5;});}else{return _0x3b37f5;}})[_0xe8ad('0x4a')](function(_0x3952ee){logger['error'](_0xe8ad('0x55'),_0x3952ee);throw _0x3952ee;});}return _0x3b37f5;})[_0xe8ad('0x23')](respondWithResult(_0x2249eb,0xc9))[_0xe8ad('0x4a')](handleError(_0x2249eb,null));};exports['update']=function(_0x3c73aa,_0x12ecca){if(_0x3c73aa[_0xe8ad('0x56')]['id']){delete _0x3c73aa[_0xe8ad('0x56')]['id'];}return db['Variable'][_0xe8ad('0x4d')]({'where':{'id':_0x3c73aa['params']['id']}})['then'](handleEntityNotFound(_0x12ecca,null))['then'](saveUpdates(_0x3c73aa[_0xe8ad('0x56')],null))['then'](respondWithResult(_0x12ecca,null))[_0xe8ad('0x4a')](handleError(_0x12ecca,null));};exports[_0xe8ad('0x27')]=function(_0x4cc46f,_0x421990){return db[_0xe8ad('0x2e')][_0xe8ad('0x4d')]({'where':{'id':_0x4cc46f[_0xe8ad('0x4c')]['id']}})[_0xe8ad('0x23')](handleEntityNotFound(_0x421990,null))['then'](removeEntity(_0x421990,null))[_0xe8ad('0x4a')](handleError(_0x421990,null));}; \ No newline at end of file +var _0x66f3=['fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','save','update','then','get','Variables','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','catch','show','params','Variable','includeAll','include','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','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs'];(function(_0x4c9380,_0x2fefc0){var _0x49a523=function(_0x165e85){while(--_0x165e85){_0x4c9380['push'](_0x4c9380['shift']());}};_0x49a523(++_0x2fefc0);}(_0x66f3,0x13e));var _0x366f=function(_0x2a93f0,_0x1f8fb7){_0x2a93f0=_0x2a93f0-0x0;var _0x439217=_0x66f3[_0x2a93f0];return _0x439217;};'use strict';var emlformat=require(_0x366f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x366f('0x1'));var jsonpatch=require(_0x366f('0x2'));var rp=require(_0x366f('0x3'));var moment=require(_0x366f('0x4'));var BPromise=require(_0x366f('0x5'));var Mustache=require('mustache');var util=require(_0x366f('0x6'));var path=require(_0x366f('0x7'));var sox=require(_0x366f('0x8'));var csv=require('to-csv');var ejs=require(_0x366f('0x9'));var fs=require('fs');var fs_extra=require(_0x366f('0xa'));var _=require(_0x366f('0xb'));var squel=require(_0x366f('0xc'));var crypto=require(_0x366f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x366f('0xe'));var toCsv=require(_0x366f('0xf'));var querystring=require(_0x366f('0x10'));var Papa=require('papaparse');var Redis=require(_0x366f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x366f('0x12'));var as=require(_0x366f('0x13'));var hardwareService=require(_0x366f('0x14'));var logger=require(_0x366f('0x15'))(_0x366f('0x16'));var utils=require('../../config/utils');var config=require(_0x366f('0x17'));var licenseUtil=require(_0x366f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x520248,_0x2eb634){_0x2eb634=_0x2eb634||0xcc;return function(_0xe8d344){if(_0xe8d344){return _0x520248[_0x366f('0x19')](_0x2eb634);}return _0x520248[_0x366f('0x1a')](_0x2eb634)['end']();};}function respondWithResult(_0x475c84,_0x3517fb){_0x3517fb=_0x3517fb||0xc8;return function(_0x15b0dd){if(_0x15b0dd){return _0x475c84[_0x366f('0x1a')](_0x3517fb)[_0x366f('0x1b')](_0x15b0dd);}};}function respondWithFilteredResult(_0xebe2f2,_0x290ebc){return function(_0x145e31){if(_0x145e31){var _0x1bff03=typeof _0x290ebc[_0x366f('0x1c')]===_0x366f('0x1d')&&typeof _0x290ebc[_0x366f('0x1e')]===_0x366f('0x1d');var _0x198ff4=_0x145e31[_0x366f('0x1f')];var _0x224c04=_0x1bff03?0x0:_0x290ebc[_0x366f('0x1c')];var _0x44acf9=_0x1bff03?_0x145e31[_0x366f('0x1f')]:_0x290ebc[_0x366f('0x1c')]+_0x290ebc[_0x366f('0x1e')];var _0x2e729e;if(_0x44acf9>=_0x198ff4){_0x44acf9=_0x198ff4;_0x2e729e=0xc8;}else{_0x2e729e=0xce;}_0xebe2f2[_0x366f('0x1a')](_0x2e729e);return _0xebe2f2['set']('Content-Range',_0x224c04+'-'+_0x44acf9+'/'+_0x198ff4)[_0x366f('0x1b')](_0x145e31);}return null;};}function patchUpdates(_0x3c8ad2){return function(_0x1c510e){try{jsonpatch['apply'](_0x1c510e,_0x3c8ad2,!![]);}catch(_0x3daa2c){return BPromise['reject'](_0x3daa2c);}return _0x1c510e[_0x366f('0x20')]();};}function saveUpdates(_0xb0561e,_0x2d6a61){return function(_0x5f4da4){if(_0x5f4da4){return _0x5f4da4[_0x366f('0x21')](_0xb0561e)[_0x366f('0x22')](function(_0x4195ad){return _0x4195ad;});}return null;};}function removeEntity(_0x58836a,_0x3dfb1e){return function(_0xcde06d){if(_0xcde06d){return _0xcde06d['destroy']()[_0x366f('0x22')](function(){var _0xc60cc0=_0xcde06d[_0x366f('0x23')]({'plain':!![]});var _0x343897=_0x366f('0x24');return db[_0x366f('0x25')][_0x366f('0x26')]({'where':{'type':_0x343897,'resourceId':_0xc60cc0['id']}})[_0x366f('0x22')](function(){return _0xcde06d;});})[_0x366f('0x22')](function(){_0x58836a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e865a,_0x383414){return function(_0x3c6d94){if(!_0x3c6d94){_0x2e865a[_0x366f('0x19')](0x194);}return _0x3c6d94;};}function handleError(_0x499f39,_0x5cae68){_0x5cae68=_0x5cae68||0x1f4;return function(_0x35b633){logger[_0x366f('0x27')](_0x35b633[_0x366f('0x28')]);if(_0x35b633[_0x366f('0x29')]){delete _0x35b633[_0x366f('0x29')];}_0x499f39[_0x366f('0x1a')](_0x5cae68)[_0x366f('0x2a')](_0x35b633);};}exports['index']=function(_0x3138bb,_0x4fa46d){var _0x2f9c89={},_0x8f1437={},_0x350c4d={'count':0x0,'rows':[]};var _0x4f8a01=_['map'](db['Variable'][_0x366f('0x2b')],function(_0x1715f0){return{'name':_0x1715f0[_0x366f('0x2c')],'type':_0x1715f0[_0x366f('0x2d')]['key']};});_0x8f1437['model']=_[_0x366f('0x2e')](_0x4f8a01,'name');_0x8f1437[_0x366f('0x2f')]=_[_0x366f('0x30')](_0x3138bb[_0x366f('0x2f')]);_0x8f1437[_0x366f('0x31')]=_[_0x366f('0x32')](_0x8f1437[_0x366f('0x33')],_0x8f1437[_0x366f('0x2f')]);_0x2f9c89[_0x366f('0x34')]=_[_0x366f('0x32')](_0x8f1437[_0x366f('0x33')],qs[_0x366f('0x35')](_0x3138bb[_0x366f('0x2f')][_0x366f('0x35')]));_0x2f9c89[_0x366f('0x34')]=_0x2f9c89[_0x366f('0x34')][_0x366f('0x36')]?_0x2f9c89[_0x366f('0x34')]:_0x8f1437[_0x366f('0x33')];if(!_0x3138bb['query'][_0x366f('0x37')](_0x366f('0x38'))){_0x2f9c89[_0x366f('0x1e')]=qs[_0x366f('0x1e')](_0x3138bb['query']['limit']);_0x2f9c89[_0x366f('0x1c')]=qs[_0x366f('0x1c')](_0x3138bb['query'][_0x366f('0x1c')]);}_0x2f9c89[_0x366f('0x39')]=qs[_0x366f('0x3a')](_0x3138bb['query'][_0x366f('0x3a')]);_0x2f9c89['where']=qs['filters'](_[_0x366f('0x3b')](_0x3138bb[_0x366f('0x2f')],_0x8f1437['filters']),_0x4f8a01);if(_0x3138bb[_0x366f('0x2f')][_0x366f('0x3c')]){_0x2f9c89[_0x366f('0x3d')]=_[_0x366f('0x3e')](_0x2f9c89[_0x366f('0x3d')],{'$or':_[_0x366f('0x2e')](_0x4f8a01,function(_0x5d2092){if(_0x5d2092[_0x366f('0x2d')]!==_0x366f('0x3f')){var _0x7616c4={};_0x7616c4[_0x5d2092[_0x366f('0x29')]]={'$like':'%'+_0x3138bb[_0x366f('0x2f')]['filter']+'%'};return _0x7616c4;}})});}_0x2f9c89=_['merge']({},_0x2f9c89,_0x3138bb[_0x366f('0x40')]);var _0x261efc={'where':_0x2f9c89[_0x366f('0x3d')]};return db['Variable'][_0x366f('0x1f')](_0x261efc)[_0x366f('0x22')](function(_0x45e2e9){_0x350c4d[_0x366f('0x1f')]=_0x45e2e9;if(_0x3138bb[_0x366f('0x2f')]['includeAll']){_0x2f9c89['include']=[{'all':!![]}];}return db['Variable'][_0x366f('0x41')](_0x2f9c89);})[_0x366f('0x22')](function(_0x435c82){_0x350c4d['rows']=_0x435c82;return _0x350c4d;})[_0x366f('0x22')](respondWithFilteredResult(_0x4fa46d,_0x2f9c89))[_0x366f('0x42')](handleError(_0x4fa46d,null));};exports[_0x366f('0x43')]=function(_0x58d7d7,_0x3f2f0d){var _0xc207ae={'raw':!![],'where':{'id':_0x58d7d7[_0x366f('0x44')]['id']}},_0x2ae32c={};_0x2ae32c[_0x366f('0x33')]=_['keys'](db[_0x366f('0x45')][_0x366f('0x2b')]);_0x2ae32c[_0x366f('0x2f')]=_[_0x366f('0x30')](_0x58d7d7[_0x366f('0x2f')]);_0x2ae32c[_0x366f('0x31')]=_[_0x366f('0x32')](_0x2ae32c[_0x366f('0x33')],_0x2ae32c['query']);_0xc207ae['attributes']=_[_0x366f('0x32')](_0x2ae32c[_0x366f('0x33')],qs[_0x366f('0x35')](_0x58d7d7[_0x366f('0x2f')][_0x366f('0x35')]));_0xc207ae[_0x366f('0x34')]=_0xc207ae[_0x366f('0x34')][_0x366f('0x36')]?_0xc207ae['attributes']:_0x2ae32c[_0x366f('0x33')];if(_0x58d7d7[_0x366f('0x2f')][_0x366f('0x46')]){_0xc207ae[_0x366f('0x47')]=[{'all':!![]}];}_0xc207ae=_[_0x366f('0x3e')]({},_0xc207ae,_0x58d7d7['options']);return db[_0x366f('0x45')][_0x366f('0x48')](_0xc207ae)[_0x366f('0x22')](handleEntityNotFound(_0x3f2f0d,null))[_0x366f('0x22')](respondWithResult(_0x3f2f0d,null))['catch'](handleError(_0x3f2f0d,null));};exports[_0x366f('0x49')]=function(_0x4475e5,_0x53aab2){return db[_0x366f('0x45')]['create'](_0x4475e5['body'],{})[_0x366f('0x22')](function(_0x1101c6){var _0xef3a81=_0x4475e5[_0x366f('0x4a')][_0x366f('0x23')]({'plain':!![]});if(!_0xef3a81)throw new Error(_0x366f('0x4b'));if(_0xef3a81[_0x366f('0x4c')]==='user'){var _0x3ba59a=_0x1101c6[_0x366f('0x23')]({'plain':!![]});var _0x19c5b5='Variables';return db[_0x366f('0x4d')][_0x366f('0x48')]({'where':{'name':_0x19c5b5,'userProfileId':_0xef3a81[_0x366f('0x4e')]},'raw':!![]})[_0x366f('0x22')](function(_0x3d8bdf){if(_0x3d8bdf&&_0x3d8bdf[_0x366f('0x4f')]===0x0){return db[_0x366f('0x25')][_0x366f('0x49')]({'name':_0x3ba59a[_0x366f('0x29')],'resourceId':_0x3ba59a['id'],'type':_0x3d8bdf[_0x366f('0x29')],'sectionId':_0x3d8bdf['id']},{})[_0x366f('0x22')](function(){return _0x1101c6;});}else{return _0x1101c6;}})[_0x366f('0x42')](function(_0x2cd25d){logger[_0x366f('0x27')](_0x366f('0x50'),_0x2cd25d);throw _0x2cd25d;});}return _0x1101c6;})['then'](respondWithResult(_0x53aab2,0xc9))[_0x366f('0x42')](handleError(_0x53aab2,null));};exports[_0x366f('0x21')]=function(_0xc61c4f,_0x1216ba){if(_0xc61c4f[_0x366f('0x51')]['id']){delete _0xc61c4f[_0x366f('0x51')]['id'];}return db[_0x366f('0x45')][_0x366f('0x48')]({'where':{'id':_0xc61c4f['params']['id']}})['then'](handleEntityNotFound(_0x1216ba,null))[_0x366f('0x22')](saveUpdates(_0xc61c4f[_0x366f('0x51')],null))[_0x366f('0x22')](respondWithResult(_0x1216ba,null))[_0x366f('0x42')](handleError(_0x1216ba,null));};exports['destroy']=function(_0x3b5730,_0x2766cc){return db[_0x366f('0x45')][_0x366f('0x48')]({'where':{'id':_0x3b5730['params']['id']}})['then'](handleEntityNotFound(_0x2766cc,null))[_0x366f('0x22')](removeEntity(_0x2766cc,null))[_0x366f('0x42')](handleError(_0x2766cc,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 49b5f8c..5239b95 100644 --- a/server/api/variable/variable.model.js +++ b/server/api/variable/variable.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1345=['tools_variables','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./variable.attributes','exports','define'];(function(_0xa36290,_0x27313a){var _0x3d03bb=function(_0x133186){while(--_0x133186){_0xa36290['push'](_0xa36290['shift']());}};_0x3d03bb(++_0x27313a);}(_0x1345,0xb5));var _0x5134=function(_0x3af54c,_0x436158){_0x3af54c=_0x3af54c-0x0;var _0x4bc816=_0x1345[_0x3af54c];return _0x4bc816;};'use strict';var _=require(_0x5134('0x0'));var util=require(_0x5134('0x1'));var logger=require(_0x5134('0x2'))(_0x5134('0x3'));var moment=require(_0x5134('0x4'));var BPromise=require(_0x5134('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5134('0x6'));var config=require(_0x5134('0x7'));var attributes=require(_0x5134('0x8'));module[_0x5134('0x9')]=function(_0x51b377,_0x4056c8){return _0x51b377[_0x5134('0xa')]('Variable',attributes,{'tableName':_0x5134('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0ce=['./variable.attributes','exports','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x1c83c0,_0x5b83fd){var _0x326639=function(_0x17f1cc){while(--_0x17f1cc){_0x1c83c0['push'](_0x1c83c0['shift']());}};_0x326639(++_0x5b83fd);}(_0xe0ce,0x1b0));var _0xee0c=function(_0x327cbf,_0x114362){_0x327cbf=_0x327cbf-0x0;var _0x409cb8=_0xe0ce[_0x327cbf];return _0x409cb8;};'use strict';var _=require(_0xee0c('0x0'));var util=require(_0xee0c('0x1'));var logger=require(_0xee0c('0x2'))(_0xee0c('0x3'));var moment=require(_0xee0c('0x4'));var BPromise=require(_0xee0c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xee0c('0x6'));var config=require(_0xee0c('0x7'));var attributes=require(_0xee0c('0x8'));module[_0xee0c('0x9')]=function(_0x5caa33,_0x4d3e5a){return _0x5caa33['define']('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index ff50188..bb36354 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['stringify','error','code','message','result','catch','ShowVariable','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x284f70,_0x48622e){var _0x4f0d14=function(_0x4b31f3){while(--_0x4b31f3){_0x284f70['push'](_0x284f70['shift']());}};_0x4f0d14(++_0x48622e);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Variable,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Variable'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowVariable',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file +var _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1d69ba,_0x4090c9){var _0x8bab8c=function(_0x33ce38){while(--_0x33ce38){_0x1d69ba['push'](_0x1d69ba['shift']());}};_0x8bab8c(++_0x4090c9);}(_0x8ef6,0xf2));var _0x68ef=function(_0xef9522,_0x20a893){_0xef9522=_0xef9522-0x0;var _0xef9569=_0x8ef6[_0xef9522];return _0xef9569;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 8c9e9f6..62c38d1 100644 --- a/server/api/version/index.js +++ b/server/api/version/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80f6=['/restart','restart','/migrations','migrations','exports','Router','./version.controller','get','index','/fetch','isAuthenticated','fetch','/reset','canUpdate','reset','pull'];(function(_0xb7a459,_0xc13228){var _0x104ab5=function(_0x186a0e){while(--_0x186a0e){_0xb7a459['push'](_0xb7a459['shift']());}};_0x104ab5(++_0xc13228);}(_0x80f6,0xd5));var _0x680f=function(_0x1f1b7d,_0xad68d5){_0x1f1b7d=_0x1f1b7d-0x0;var _0x4c921d=_0x80f6[_0x1f1b7d];return _0x4c921d;};'use strict';var express=require('express');var router=express[_0x680f('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x680f('0x1'));router[_0x680f('0x2')]('/',controller[_0x680f('0x3')]);router[_0x680f('0x2')](_0x680f('0x4'),auth[_0x680f('0x5')](),auth['canUpdate'](),controller[_0x680f('0x6')]);router[_0x680f('0x2')](_0x680f('0x7'),auth[_0x680f('0x5')](),auth[_0x680f('0x8')](),controller[_0x680f('0x9')]);router[_0x680f('0x2')]('/pull',auth[_0x680f('0x5')](),auth['canUpdate'](),controller[_0x680f('0xa')]);router['get'](_0x680f('0xb'),auth[_0x680f('0x5')](),controller[_0x680f('0xc')]);router[_0x680f('0x2')](_0x680f('0xd'),controller[_0x680f('0xe')]);module[_0x680f('0xf')]=router; \ No newline at end of file +var _0x62fa=['canUpdate','reset','/pull','restart','/migrations','migrations','exports','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','fetch'];(function(_0x47f23d,_0x567e66){var _0x4e08f9=function(_0x296189){while(--_0x296189){_0x47f23d['push'](_0x47f23d['shift']());}};_0x4e08f9(++_0x567e66);}(_0x62fa,0x7f));var _0xa62f=function(_0x34bbe3,_0x28d122){_0x34bbe3=_0x34bbe3-0x0;var _0x4301aa=_0x62fa[_0x34bbe3];return _0x4301aa;};'use strict';var express=require('express');var router=express[_0xa62f('0x0')]();var auth=require(_0xa62f('0x1'));var controller=require(_0xa62f('0x2'));router[_0xa62f('0x3')]('/',controller[_0xa62f('0x4')]);router[_0xa62f('0x3')](_0xa62f('0x5'),auth[_0xa62f('0x6')](),auth['canUpdate'](),controller[_0xa62f('0x7')]);router['get']('/reset',auth['isAuthenticated'](),auth[_0xa62f('0x8')](),controller[_0xa62f('0x9')]);router['get'](_0xa62f('0xa'),auth[_0xa62f('0x6')](),auth['canUpdate'](),controller['pull']);router[_0xa62f('0x3')]('/restart',auth[_0xa62f('0x6')](),controller[_0xa62f('0xb')]);router['get'](_0xa62f('0xc'),controller[_0xa62f('0xd')]);module[_0xa62f('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 8eb803c..9d1cc8f 100644 --- a/server/api/version/version.controller.js +++ b/server/api/version/version.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0435=['index','exports','version','query','latest','tags','json','status','fetch','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','server','replace','.js','push','length','sort','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','join','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root'];(function(_0x40a168,_0x1d8701){var _0xc48200=function(_0x4db946){while(--_0x4db946){_0x40a168['push'](_0x40a168['shift']());}};_0xc48200(++_0x1d8701);}(_0x0435,0x1ac));var _0x5043=function(_0x1067cd,_0x400cb1){_0x1067cd=_0x1067cd-0x0;var _0x5d980d=_0x0435[_0x1067cd];return _0x5d980d;};'use strict';var Umzug=require(_0x5043('0x0'));var path=require(_0x5043('0x1'));var fs=require('fs');var _=require(_0x5043('0x2'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require(_0x5043('0x3'));var exec=require(_0x5043('0x4'))[_0x5043('0x5')];var db=require(_0x5043('0x6'))['db'];var config=require(_0x5043('0x7'));var pm2=require('../../config/pm2');var logger=require(_0x5043('0x8'))(_0x5043('0x9'));var git=require(_0x5043('0xa'))(config[_0x5043('0xb')]);exports[_0x5043('0xc')]=function(_0x297847,_0x5d5345){var _0x10e6da={'current':module[_0x5043('0xd')][_0x5043('0xe')],'phonebar':0x2};if(_0x297847['query']&&_0x297847[_0x5043('0xf')][_0x5043('0x10')]){return git['fetch']()[_0x5043('0x11')](function(_0x440105,_0x2dd049){_0x10e6da[_0x5043('0x10')]=(_0x440105?module['exports']['version']:_0x2dd049['latest'])||'2.0.0';return _0x5d5345['status'](0xc8)[_0x5043('0x12')](_0x10e6da);});}else{return _0x5d5345[_0x5043('0x13')](0xc8)['json'](_0x10e6da);}};exports[_0x5043('0x14')]=function(_0x1da341,_0x2ef38e){return git[_0x5043('0x14')]([_0x5043('0x15'),_0x5043('0x16')],function(_0x52534b){if(_0x52534b){logger[_0x5043('0x17')](_0x52534b);return _0x2ef38e['status'](0x1f4)[_0x5043('0x12')](_0x52534b);}logger[_0x5043('0x18')](_0x5043('0x19'));return _0x2ef38e['status'](0xc8)[_0x5043('0x12')]({'output':_0x5043('0x1a')});});};exports['reset']=function(_0x216b85,_0x40eef8){return git[_0x5043('0x1b')]([_0x5043('0x1c'),'FETCH_HEAD'],function(_0x28ae11){if(_0x28ae11){logger[_0x5043('0x17')](_0x28ae11);return _0x40eef8[_0x5043('0x13')](0x1f4)['json'](_0x28ae11);}logger['info'](_0x5043('0x1d'));return _0x40eef8[_0x5043('0x13')](0xc8)['json']({'output':_0x5043('0x1e')});});};exports[_0x5043('0x1f')]=function(_0x36d53b,_0x4e2a9a){exec('npm\x20install\x20--production',function(_0x4fe1a9,_0x33c3fc,_0x359e1e){logger[_0x5043('0x18')](_0x33c3fc);logger[_0x5043('0x18')](_0x359e1e);if(_0x4fe1a9){logger[_0x5043('0x17')](_0x4fe1a9);return _0x4e2a9a[_0x5043('0x13')](0x1f4)[_0x5043('0x12')](_0x4fe1a9);}return _0x4e2a9a[_0x5043('0x13')](0xc8)[_0x5043('0x12')]({'output':_0x33c3fc});});};exports['restart']=function(_0x54ce45,_0x4fcd56){return pm2[_0x5043('0x20')]('motion2')[_0x5043('0x21')](function(_0x7694dc){logger['info'](_0x5043('0x22'),_0x7694dc);return _0x4fcd56['status'](0xc8)['json']({'output':_0x5043('0x23')});})['catch'](function(_0x456fe0){logger['error'](_0x456fe0);return _0x4fcd56['status'](0x1f4)[_0x5043('0x12')](_0x456fe0);});};exports[_0x5043('0x24')]=function(_0x1bc13a,_0x5baadb){var _0x213a55=fs[_0x5043('0x25')](path['join'](config[_0x5043('0xb')],_0x5043('0x26'),'migrations'));var _0x28263d=[];for(var _0xe1bce4=0x0;_0xe1bce4<_0x213a55['length'];_0xe1bce4++){var _0x2562a2=_0x213a55[_0xe1bce4][_0x5043('0x27')](_0x5043('0x28'),'');if(compareVersions(module[_0x5043('0xd')][_0x5043('0xe')],_0x2562a2)===-0x1){_0x28263d[_0x5043('0x29')](_0x2562a2);}}if(_0x28263d[_0x5043('0x2a')]){var _0x54a5dc=_0x28263d[_0x5043('0x2b')](compareVersions);var _0x59f6c3=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x5043('0x2c')],'modelName':_0x5043('0x2c'),'columnName':'version'},'migrations':{'params':[db[_0x5043('0x2d')][_0x5043('0x2e')](),db['sequelize'][_0x5043('0x2f')],function(){throw new Error(_0x5043('0x30'));}],'path':path['join'](config[_0x5043('0xb')],'server',_0x5043('0x24')),'pattern':/\.js$/}});_0x59f6c3['up']({'migrations':_['map'](_0x54a5dc,function(_0x5d52cc){return _0x5d52cc+_0x5043('0x28');})})['then'](function(){return _0x5baadb[_0x5043('0x13')](0xc8)[_0x5043('0x12')]({'output':_0x5043('0x31')+module['exports'][_0x5043('0xe')]+_0x5043('0x32')+_[_0x5043('0x33')](_0x54a5dc),'migrations':_[_0x5043('0x34')](_0x54a5dc)});})['catch'](function(_0x8ed068){if(_0x8ed068 instanceof db['sequelize'][_0x5043('0x35')]){return _0x5baadb['status'](0xc8)[_0x5043('0x12')]({'output':_0x5043('0x36')});}else{return _0x5baadb[_0x5043('0x13')](0x1f4)[_0x5043('0x12')](_0x8ed068);}});}else{return _0x5baadb[_0x5043('0x13')](0xc8)[_0x5043('0x12')]({'output':_0x5043('0x36')});}}; \ No newline at end of file +var _0x76c3=['pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','length','replace','push','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','compare-versions','../../config/environment','../../config/pm2','../../config/logger','update','root','index','exports','version','latest','tags','2.0.0','json','status','fetch','origin','master','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','restart','then'];(function(_0x95b44e,_0x4af5e1){var _0x4d33ea=function(_0x35acd6){while(--_0x35acd6){_0x95b44e['push'](_0x95b44e['shift']());}};_0x4d33ea(++_0x4af5e1);}(_0x76c3,0x114));var _0x376c=function(_0x28d23d,_0x186bca){_0x28d23d=_0x28d23d-0x0;var _0x539fc0=_0x76c3[_0x28d23d];return _0x539fc0;};'use strict';var Umzug=require(_0x376c('0x0'));var path=require(_0x376c('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x376c('0x2'))(module,'version');var compareVersions=require(_0x376c('0x3'));var exec=require('child_process')['exec'];var db=require('../../mysqldb')['db'];var config=require(_0x376c('0x4'));var pm2=require(_0x376c('0x5'));var logger=require(_0x376c('0x6'))(_0x376c('0x7'));var git=require('simple-git')(config[_0x376c('0x8')]);exports[_0x376c('0x9')]=function(_0x535289,_0xbbdb4e){var _0x375ebb={'current':module[_0x376c('0xa')][_0x376c('0xb')],'phonebar':0x2};if(_0x535289['query']&&_0x535289['query'][_0x376c('0xc')]){return git['fetch']()[_0x376c('0xd')](function(_0x3c46c3,_0x28d4bb){_0x375ebb['latest']=(_0x3c46c3?module['exports'][_0x376c('0xb')]:_0x28d4bb['latest'])||_0x376c('0xe');return _0xbbdb4e['status'](0xc8)[_0x376c('0xf')](_0x375ebb);});}else{return _0xbbdb4e[_0x376c('0x10')](0xc8)[_0x376c('0xf')](_0x375ebb);}};exports[_0x376c('0x11')]=function(_0x1ca8ee,_0x459b12){return git[_0x376c('0x11')]([_0x376c('0x12'),_0x376c('0x13')],function(_0x3ef784){if(_0x3ef784){logger[_0x376c('0x14')](_0x3ef784);return _0x459b12[_0x376c('0x10')](0x1f4)['json'](_0x3ef784);}logger[_0x376c('0x15')](_0x376c('0x16'));return _0x459b12[_0x376c('0x10')](0xc8)[_0x376c('0xf')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x376c('0x17')]=function(_0x24a792,_0x5571fd){return git['reset']([_0x376c('0x18'),_0x376c('0x19')],function(_0x1d39fe){if(_0x1d39fe){logger[_0x376c('0x14')](_0x1d39fe);return _0x5571fd[_0x376c('0x10')](0x1f4)[_0x376c('0xf')](_0x1d39fe);}logger[_0x376c('0x15')](_0x376c('0x1a'));return _0x5571fd[_0x376c('0x10')](0xc8)[_0x376c('0xf')]({'output':_0x376c('0x1b')});});};exports['pull']=function(_0x4a3acc,_0x4112f6){exec('npm\x20install\x20--production',function(_0x265b24,_0x321a12,_0x18de06){logger['info'](_0x321a12);logger['info'](_0x18de06);if(_0x265b24){logger[_0x376c('0x14')](_0x265b24);return _0x4112f6[_0x376c('0x10')](0x1f4)[_0x376c('0xf')](_0x265b24);}return _0x4112f6['status'](0xc8)['json']({'output':_0x321a12});});};exports[_0x376c('0x1c')]=function(_0x4a4f71,_0x436012){return pm2[_0x376c('0x1c')]('motion2')[_0x376c('0x1d')](function(_0x18e429){logger[_0x376c('0x15')](_0x376c('0x1e'),_0x18e429);return _0x436012['status'](0xc8)['json']({'output':_0x376c('0x1f')});})[_0x376c('0x20')](function(_0x57eeb9){logger[_0x376c('0x14')](_0x57eeb9);return _0x436012[_0x376c('0x10')](0x1f4)[_0x376c('0xf')](_0x57eeb9);});};exports[_0x376c('0x21')]=function(_0x5f3b24,_0x4bbca5){var _0x171b8c=fs[_0x376c('0x22')](path['join'](config[_0x376c('0x8')],_0x376c('0x23'),_0x376c('0x21')));var _0x34148f=[];for(var _0x4ac684=0x0;_0x4ac684<_0x171b8c[_0x376c('0x24')];_0x4ac684++){var _0x5cefb7=_0x171b8c[_0x4ac684][_0x376c('0x25')]('.js','');if(compareVersions(module[_0x376c('0xa')]['version'],_0x5cefb7)===-0x1){_0x34148f[_0x376c('0x26')](_0x5cefb7);}}if(_0x34148f[_0x376c('0x24')]){var _0x10ad51=_0x34148f['sort'](compareVersions);var _0x4b13a7=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x376c('0x27')],'modelName':_0x376c('0x27'),'columnName':_0x376c('0xb')},'migrations':{'params':[db[_0x376c('0x28')][_0x376c('0x29')](),db[_0x376c('0x28')][_0x376c('0x2a')],function(){throw new Error(_0x376c('0x2b'));}],'path':path[_0x376c('0x2c')](config[_0x376c('0x8')],_0x376c('0x23'),_0x376c('0x21')),'pattern':/\.js$/}});_0x4b13a7['up']({'migrations':_['map'](_0x10ad51,function(_0x27bd6c){return _0x27bd6c+_0x376c('0x2d');})})['then'](function(){return _0x4bbca5[_0x376c('0x10')](0xc8)['json']({'output':_0x376c('0x2e')+module['exports'][_0x376c('0xb')]+_0x376c('0x2f')+_[_0x376c('0x30')](_0x10ad51),'migrations':_[_0x376c('0x2c')](_0x10ad51)});})['catch'](function(_0x17efc3){if(_0x17efc3 instanceof db['sequelize'][_0x376c('0x31')]){return _0x4bbca5[_0x376c('0x10')](0xc8)[_0x376c('0xf')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x4bbca5['status'](0x1f4)[_0x376c('0xf')](_0x17efc3);}});}else{return _0x4bbca5[_0x376c('0x10')](0xc8)[_0x376c('0xf')]({'output':_0x376c('0x32')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index cdf3710..7643f06 100644 --- a/server/api/voiceAgentReport/index.js +++ b/server/api/voiceAgentReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b79=['/:id','post','create','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x2d30b0,_0x486019){var _0x2304a0=function(_0x191938){while(--_0x191938){_0x2d30b0['push'](_0x2d30b0['shift']());}};_0x2304a0(++_0x486019);}(_0x9b79,0x148));var _0x99b7=function(_0x537f6f,_0x10b756){_0x537f6f=_0x537f6f-0x0;var _0x212d3f=_0x9b79[_0x537f6f];return _0x212d3f;};'use strict';var multer=require(_0x99b7('0x0'));var util=require(_0x99b7('0x1'));var path=require(_0x99b7('0x2'));var timeout=require(_0x99b7('0x3'));var express=require(_0x99b7('0x4'));var router=express[_0x99b7('0x5')]();var fs_extra=require(_0x99b7('0x6'));var auth=require(_0x99b7('0x7'));var interaction=require(_0x99b7('0x8'));var config=require(_0x99b7('0x9'));var controller=require('./voiceAgentReport.controller');router[_0x99b7('0xa')]('/',auth[_0x99b7('0xb')](),controller['index']);router['get'](_0x99b7('0xc'),auth['isAuthenticated'](),controller[_0x99b7('0xd')]);router['get'](_0x99b7('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x99b7('0xf')]('/',auth[_0x99b7('0xb')](),controller[_0x99b7('0x10')]);router[_0x99b7('0x11')]('/:id',auth[_0x99b7('0xb')](),controller[_0x99b7('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc3ae=['get','/describe','isAuthenticated','describe','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0xc3ae,0xdc));var _0xec3a=function(_0x138e40,_0x3479bf){_0x138e40=_0x138e40-0x0;var _0x10384b=_0xc3ae[_0x138e40];return _0x10384b;};'use strict';var multer=require(_0xec3a('0x0'));var util=require(_0xec3a('0x1'));var path=require(_0xec3a('0x2'));var timeout=require(_0xec3a('0x3'));var express=require('express');var router=express[_0xec3a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xec3a('0x5'));var interaction=require(_0xec3a('0x6'));var config=require(_0xec3a('0x7'));var controller=require('./voiceAgentReport.controller');router[_0xec3a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xec3a('0x8')](_0xec3a('0x9'),auth[_0xec3a('0xa')](),controller[_0xec3a('0xb')]);router[_0xec3a('0x8')](_0xec3a('0xc'),auth[_0xec3a('0xa')](),controller['show']);router[_0xec3a('0xd')]('/',auth[_0xec3a('0xa')](),controller['create']);router[_0xec3a('0xe')]('/:id',auth[_0xec3a('0xa')](),controller[_0xec3a('0xf')]);router[_0xec3a('0x10')]('/:id',auth[_0xec3a('0xa')](),controller[_0xec3a('0x11')]);module[_0xec3a('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index d18e249..8094cd2 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.attributes.js +++ b/server/api/voiceAgentReport/voiceAgentReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8caf=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x3ef4f1,_0x5f0f9b){var _0x69953c=function(_0xb4e621){while(--_0xb4e621){_0x3ef4f1['push'](_0x3ef4f1['shift']());}};_0x69953c(++_0x5f0f9b);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x466bfd,_0x56f4bb){_0x466bfd=_0x466bfd-0x0;var _0x29293d=_0x8caf[_0x466bfd];return _0x29293d;};'use strict';var Sequelize=require('sequelize');module[_0xf8ca('0x0')]={'type':{'type':Sequelize[_0xf8ca('0x1')]},'uniqueid':{'type':Sequelize[_0xf8ca('0x1')]},'calleridnum':{'type':Sequelize[_0xf8ca('0x1')]},'calleridname':{'type':Sequelize[_0xf8ca('0x1')]},'queue':{'type':Sequelize[_0xf8ca('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf8ca('0x1')]},'agentcalledAt':{'type':Sequelize[_0xf8ca('0x2')]},'agentconnectAt':{'type':Sequelize[_0xf8ca('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xf8ca('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xf8ca('0x2')]},'agentdumpAt':{'type':Sequelize[_0xf8ca('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xf8ca('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xf8ca('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xf8ca('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xf8ca('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xf8ca('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf8ca('0x1')]},'channelstate':{'type':Sequelize[_0xf8ca('0x4')]},'channelstatedesc':{'type':Sequelize[_0xf8ca('0x1')]},'connectedlinenum':{'type':Sequelize[_0xf8ca('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf8ca('0x1')]},'accountcode':{'type':Sequelize[_0xf8ca('0x1')]},'context':{'type':Sequelize[_0xf8ca('0x1')]},'exten':{'type':Sequelize[_0xf8ca('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xf8ca('0x1')]},'destchannelstate':{'type':Sequelize[_0xf8ca('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xf8ca('0x1')]},'destcalleridname':{'type':Sequelize[_0xf8ca('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xf8ca('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xf8ca('0x1')]},'destlanguage':{'type':Sequelize[_0xf8ca('0x1')]},'destaccountcode':{'type':Sequelize[_0xf8ca('0x1')]},'destcontext':{'type':Sequelize[_0xf8ca('0x1')]},'destexten':{'type':Sequelize[_0xf8ca('0x1')]},'destpriority':{'type':Sequelize[_0xf8ca('0x1')]},'destuniqueid':{'type':Sequelize[_0xf8ca('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xf8ca('0x1')]},'transfer':{'type':Sequelize[_0xf8ca('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf8ca('0x1')],'comment':_0xf8ca('0x5')},'transferexten':{'type':Sequelize[_0xf8ca('0x1')]},'transferuniqueid':{'type':Sequelize[_0xf8ca('0x1')]},'agententerreason':{'type':Sequelize[_0xf8ca('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3014=['DATE','INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x24f988,_0x4ec3dc){var _0x3c0c17=function(_0x335950){while(--_0x335950){_0x24f988['push'](_0x24f988['shift']());}};_0x3c0c17(++_0x4ec3dc);}(_0x3014,0x1d7));var _0x4301=function(_0x583c24,_0x515768){_0x583c24=_0x583c24-0x0;var _0x493609=_0x3014[_0x583c24];return _0x493609;};'use strict';var Sequelize=require(_0x4301('0x0'));module[_0x4301('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4301('0x2')]},'calleridnum':{'type':Sequelize[_0x4301('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x4301('0x2')]},'membername':{'type':Sequelize[_0x4301('0x2')]},'agentcalledAt':{'type':Sequelize[_0x4301('0x3')]},'agentconnectAt':{'type':Sequelize[_0x4301('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x4301('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x4301('0x3')]},'agentdumpAt':{'type':Sequelize[_0x4301('0x3')]},'holdtime':{'type':Sequelize[_0x4301('0x4')]},'agentcomplete':{'type':Sequelize[_0x4301('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x4301('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x4301('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4301('0x4')]},'reason':{'type':Sequelize[_0x4301('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4301('0x2')]},'channelstate':{'type':Sequelize[_0x4301('0x4')]},'channelstatedesc':{'type':Sequelize[_0x4301('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4301('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x4301('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4301('0x2')]},'exten':{'type':Sequelize[_0x4301('0x2')]},'priority':{'type':Sequelize[_0x4301('0x2')]},'destchannel':{'type':Sequelize[_0x4301('0x2')]},'destchannelstate':{'type':Sequelize[_0x4301('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x4301('0x2')]},'destcalleridnum':{'type':Sequelize[_0x4301('0x2')]},'destcalleridname':{'type':Sequelize[_0x4301('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x4301('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x4301('0x2')]},'destlanguage':{'type':Sequelize[_0x4301('0x2')]},'destaccountcode':{'type':Sequelize[_0x4301('0x2')]},'destcontext':{'type':Sequelize[_0x4301('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x4301('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x4301('0x2')]},'transfer':{'type':Sequelize[_0x4301('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4301('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x4301('0x2')]},'agententerreason':{'type':Sequelize[_0x4301('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 4965edf..0f5f4e0 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.controller.js +++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 7a6cbac..b91cd1f 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.model.js +++ b/server/api/voiceAgentReport/voiceAgentReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb458=['path','rimraf','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x44417e,_0x313408){var _0x32e605=function(_0x20ddcc){while(--_0x20ddcc){_0x44417e['push'](_0x44417e['shift']());}};_0x32e605(++_0x313408);}(_0xb458,0x103));var _0x8b45=function(_0x4f7d50,_0x363daa){_0x4f7d50=_0x4f7d50-0x0;var _0x327bfd=_0xb458[_0x4f7d50];return _0x327bfd;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var logger=require(_0x8b45('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8b45('0x3'));var rp=require(_0x8b45('0x4'));var fs=require('fs');var path=require(_0x8b45('0x5'));var rimraf=require(_0x8b45('0x6'));var config=require('../../config/environment');var attributes=require(_0x8b45('0x7'));module['exports']=function(_0x5cc2d5,_0xe8d774){return _0x5cc2d5[_0x8b45('0x8')](_0x8b45('0x9'),attributes,{'tableName':_0x8b45('0xa'),'paranoid':![],'indexes':[{'fields':[_0x8b45('0xb'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0763=['path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x973790,_0x5993b8){var _0xa84f7=function(_0x4639b2){while(--_0x4639b2){_0x973790['push'](_0x973790['shift']());}};_0xa84f7(++_0x5993b8);}(_0x0763,0x87));var _0x3076=function(_0x22ee1e,_0x3eff80){_0x22ee1e=_0x22ee1e-0x0;var _0x49a5c9=_0x0763[_0x22ee1e];return _0x49a5c9;};'use strict';var _=require(_0x3076('0x0'));var util=require('util');var logger=require(_0x3076('0x1'))(_0x3076('0x2'));var moment=require('moment');var BPromise=require(_0x3076('0x3'));var rp=require(_0x3076('0x4'));var fs=require('fs');var path=require(_0x3076('0x5'));var rimraf=require(_0x3076('0x6'));var config=require('../../config/environment');var attributes=require(_0x3076('0x7'));module[_0x3076('0x8')]=function(_0x1ce2ff,_0x1b5f4e){return _0x1ce2ff[_0x3076('0x9')](_0x3076('0xa'),attributes,{'tableName':_0x3076('0xb'),'paranoid':![],'indexes':[{'fields':[_0x3076('0xc'),_0x3076('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 57bc9b5..fa10c4b 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.rpc.js +++ b/server/api/voiceAgentReport/voiceAgentReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x65c9=['../../config/environment','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VoiceAgentReport','create','body','options','raw','then','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x32f250,_0x1fbca3){var _0x39ead3=function(_0x7e79d6){while(--_0x7e79d6){_0x32f250['push'](_0x32f250['shift']());}};_0x39ead3(++_0x1fbca3);}(_0x65c9,0x15a));var _0x965c=function(_0x37f275,_0x286233){_0x37f275=_0x37f275-0x0;var _0x37bd25=_0x65c9[_0x37f275];return _0x37bd25;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x965c('0x0'));var BPromise=require(_0x965c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x965c('0x2'));var db=require(_0x965c('0x3'))['db'];var utils=require(_0x965c('0x4'));var logger=require(_0x965c('0x5'))('rpc');var config=require(_0x965c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x965c('0x7')][_0x965c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f9a38,_0xbfceb0,_0x14e934){return new BPromise(function(_0x1d0a06,_0x2a21f8){return client[_0x965c('0x9')](_0x4f9a38,_0x14e934)['then'](function(_0x30b1ba){logger[_0x965c('0xa')](_0x965c('0xb'),_0xbfceb0,_0x965c('0xc'));logger[_0x965c('0xd')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0xbfceb0,'request\x20sent',JSON[_0x965c('0xe')](_0x30b1ba));if(_0x30b1ba['error']){if(_0x30b1ba[_0x965c('0xf')][_0x965c('0x10')]===0x1f4){logger['error'](_0x965c('0xb'),_0xbfceb0,_0x30b1ba[_0x965c('0xf')]['message']);return _0x2a21f8(_0x30b1ba[_0x965c('0xf')][_0x965c('0x11')]);}logger[_0x965c('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0xbfceb0,_0x30b1ba[_0x965c('0xf')]['message']);return _0x1d0a06(_0x30b1ba[_0x965c('0xf')][_0x965c('0x11')]);}else{logger[_0x965c('0xa')](_0x965c('0xb'),_0xbfceb0,_0x965c('0xc'));_0x1d0a06(_0x30b1ba[_0x965c('0x12')][_0x965c('0x11')]);}})[_0x965c('0x13')](function(_0x4a571b){logger[_0x965c('0xf')](_0x965c('0xb'),_0xbfceb0,_0x4a571b);_0x2a21f8(_0x4a571b);});});}exports['CreateVoiceAgentReport']=function(_0x496809){var _0x515073=this;return new Promise(function(_0x36e091,_0x3e91cd){return db[_0x965c('0x14')][_0x965c('0x15')](_0x496809[_0x965c('0x16')],{'raw':_0x496809[_0x965c('0x17')]?_0x496809[_0x965c('0x17')][_0x965c('0x18')]===undefined?!![]:![]:!![]})[_0x965c('0x19')](function(_0x42d71d){logger[_0x965c('0xa')]('CreateVoiceAgentReport',_0x496809);logger[_0x965c('0xd')](_0x965c('0x1a'),_0x496809,JSON[_0x965c('0xe')](_0x42d71d));_0x36e091(_0x42d71d);})[_0x965c('0x13')](function(_0x42d44b){logger[_0x965c('0xf')](_0x965c('0x1a'),_0x42d44b['message'],_0x496809);_0x3e91cd(_0x515073[_0x965c('0xf')](0x1f4,_0x42d44b['message']));});});};exports[_0x965c('0x1b')]=function(_0x44149a){var _0x5ee334=this;return new Promise(function(_0x317a3d,_0x266386){return db[_0x965c('0x14')][_0x965c('0x1c')](_0x44149a[_0x965c('0x16')],{'raw':_0x44149a[_0x965c('0x17')]?_0x44149a[_0x965c('0x17')][_0x965c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44149a['options']?_0x44149a['options'][_0x965c('0x1d')]||null:null,'attributes':_0x44149a['options']?_0x44149a[_0x965c('0x17')][_0x965c('0x1e')]||null:null,'limit':_0x44149a[_0x965c('0x17')]?_0x44149a[_0x965c('0x17')][_0x965c('0x1f')]||null:null})[_0x965c('0x19')](function(_0x900672){logger[_0x965c('0xa')]('UpdateVoiceAgentReport',_0x44149a);logger[_0x965c('0xd')](_0x965c('0x1b'),_0x44149a,JSON['stringify'](_0x900672));_0x317a3d(_0x900672);})[_0x965c('0x13')](function(_0xefa58e){logger[_0x965c('0xf')](_0x965c('0x1b'),_0xefa58e['message'],_0x44149a);_0x266386(_0x5ee334[_0x965c('0xf')](0x1f4,_0xefa58e[_0x965c('0x11')]));});});}; \ No newline at end of file +var _0x2513=['error','message','result','CreateVoiceAgentReport','VoiceAgentReport','create','options','then','update','body','raw','where','attributes','limit','UpdateVoiceAgentReport','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0x2513,0xab));var _0x3251=function(_0x436b99,_0x5eeb86){_0x436b99=_0x436b99-0x0;var _0x2829a6=_0x2513[_0x436b99];return _0x2829a6;};'use strict';var _=require(_0x3251('0x0'));var util=require(_0x3251('0x1'));var moment=require(_0x3251('0x2'));var BPromise=require('bluebird');var rs=require(_0x3251('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3251('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3251('0x5'))('rpc');var config=require(_0x3251('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3251('0x7')][_0x3251('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f9ebe,_0x494241,_0x13334e){return new BPromise(function(_0x8b9684,_0x23ba20){return client['request'](_0x3f9ebe,_0x13334e)['then'](function(_0x3b32a6){logger[_0x3251('0x9')](_0x3251('0xa'),_0x494241,_0x3251('0xb'));logger[_0x3251('0xc')](_0x3251('0xd'),_0x494241,_0x3251('0xb'),JSON[_0x3251('0xe')](_0x3b32a6));if(_0x3b32a6[_0x3251('0xf')]){if(_0x3b32a6['error']['code']===0x1f4){logger[_0x3251('0xf')](_0x3251('0xa'),_0x494241,_0x3b32a6[_0x3251('0xf')]['message']);return _0x23ba20(_0x3b32a6[_0x3251('0xf')][_0x3251('0x10')]);}logger[_0x3251('0xf')](_0x3251('0xa'),_0x494241,_0x3b32a6[_0x3251('0xf')][_0x3251('0x10')]);return _0x8b9684(_0x3b32a6[_0x3251('0xf')][_0x3251('0x10')]);}else{logger[_0x3251('0x9')](_0x3251('0xa'),_0x494241,_0x3251('0xb'));_0x8b9684(_0x3b32a6[_0x3251('0x11')]['message']);}})['catch'](function(_0x4981b5){logger['error'](_0x3251('0xa'),_0x494241,_0x4981b5);_0x23ba20(_0x4981b5);});});}exports[_0x3251('0x12')]=function(_0x553a89){var _0x4d2bfe=this;return new Promise(function(_0x522048,_0x3b86ca){return db[_0x3251('0x13')][_0x3251('0x14')](_0x553a89['body'],{'raw':_0x553a89[_0x3251('0x15')]?_0x553a89[_0x3251('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x3251('0x16')](function(_0x3800f7){logger[_0x3251('0x9')](_0x3251('0x12'),_0x553a89);logger[_0x3251('0xc')]('CreateVoiceAgentReport',_0x553a89,JSON[_0x3251('0xe')](_0x3800f7));_0x522048(_0x3800f7);})['catch'](function(_0x37fe53){logger['error'](_0x3251('0x12'),_0x37fe53['message'],_0x553a89);_0x3b86ca(_0x4d2bfe[_0x3251('0xf')](0x1f4,_0x37fe53['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x4115b4){var _0x3adf47=this;return new Promise(function(_0x5ddc8c,_0x46effb){return db[_0x3251('0x13')][_0x3251('0x17')](_0x4115b4[_0x3251('0x18')],{'raw':_0x4115b4[_0x3251('0x15')]?_0x4115b4['options'][_0x3251('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4115b4[_0x3251('0x15')]?_0x4115b4[_0x3251('0x15')][_0x3251('0x1a')]||null:null,'attributes':_0x4115b4[_0x3251('0x15')]?_0x4115b4[_0x3251('0x15')][_0x3251('0x1b')]||null:null,'limit':_0x4115b4[_0x3251('0x15')]?_0x4115b4[_0x3251('0x15')][_0x3251('0x1c')]||null:null})[_0x3251('0x16')](function(_0x46d821){logger[_0x3251('0x9')](_0x3251('0x1d'),_0x4115b4);logger[_0x3251('0xc')](_0x3251('0x1d'),_0x4115b4,JSON[_0x3251('0xe')](_0x46d821));_0x5ddc8c(_0x46d821);})[_0x3251('0x1e')](function(_0x45fe1a){logger[_0x3251('0xf')]('UpdateVoiceAgentReport',_0x45fe1a[_0x3251('0x10')],_0x4115b4);_0x46effb(_0x3adf47['error'](0x1f4,_0x45fe1a[_0x3251('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index a49dd6a..bd6f368 100644 --- a/server/api/voiceCallReport/index.js +++ b/server/api/voiceCallReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeec6=['isAuthenticated','index','/describe','describe','get','show','post','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xeec6,0x1c2));var _0x6eec=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0xeec6[_0x4b1032];return _0x5a1d55;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require(_0x6eec('0x6'));var interaction=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var controller=require(_0x6eec('0x9'));router['get']('/',auth[_0x6eec('0xa')](),controller[_0x6eec('0xb')]);router['get'](_0x6eec('0xc'),auth[_0x6eec('0xa')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/:id',auth[_0x6eec('0xa')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6eec('0x11'),auth[_0x6eec('0xa')](),controller['update']);router['delete'](_0x6eec('0x11'),auth['isAuthenticated'](),controller[_0x6eec('0x12')]);module[_0x6eec('0x13')]=router; \ No newline at end of file +var _0x4bc3=['post','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x182095,_0x45ec5b){var _0x299650=function(_0x26b35e){while(--_0x26b35e){_0x182095['push'](_0x182095['shift']());}};_0x299650(++_0x45ec5b);}(_0x4bc3,0x16e));var _0x34bc=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x4bc3[_0x20a558];return _0x53d3f7;};'use strict';var multer=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var path=require('path');var timeout=require(_0x34bc('0x2'));var express=require(_0x34bc('0x3'));var router=express['Router']();var fs_extra=require(_0x34bc('0x4'));var auth=require(_0x34bc('0x5'));var interaction=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var controller=require(_0x34bc('0x8'));router[_0x34bc('0x9')]('/',auth[_0x34bc('0xa')](),controller['index']);router[_0x34bc('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x34bc('0xb')]);router[_0x34bc('0x9')](_0x34bc('0xc'),auth[_0x34bc('0xa')](),controller[_0x34bc('0xd')]);router[_0x34bc('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x34bc('0xf')](_0x34bc('0xc'),auth[_0x34bc('0xa')](),controller['update']);router[_0x34bc('0x10')]('/:id',auth[_0x34bc('0xa')](),controller[_0x34bc('0x11')]);module[_0x34bc('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index c1226c1..141c42e 100644 --- a/server/api/voiceCallReport/voiceCallReport.attributes.js +++ b/server/api/voiceCallReport/voiceCallReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3458=['DATE','INTEGER','STRING','ENUM','inbound','outbound','inbound-fax','outbound-fax','TEXT'];(function(_0x1f21a9,_0x967fa9){var _0x2756ba=function(_0x42612c){while(--_0x42612c){_0x1f21a9['push'](_0x1f21a9['shift']());}};_0x2756ba(++_0x967fa9);}(_0x3458,0x92));var _0x8345=function(_0x4687aa,_0x52ce79){_0x4687aa=_0x4687aa-0x0;var _0x129611=_0x3458[_0x4687aa];return _0x129611;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x8345('0x0')]},'type':{'type':Sequelize[_0x8345('0x1')](_0x8345('0x2'),'internal',_0x8345('0x3'),_0x8345('0x4'),_0x8345('0x5'),'dialer')},'tag':{'type':Sequelize[_0x8345('0x0')]},'accountcode':{'type':Sequelize[_0x8345('0x0')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x8345('0x0')]},'destinationcontext':{'type':Sequelize[_0x8345('0x0')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8345('0x0')]},'destinationchannel':{'type':Sequelize[_0x8345('0x0')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x8345('0x6')]},'starttime':{'type':Sequelize[_0x8345('0x7')]},'systemanswertime':{'type':Sequelize[_0x8345('0x7')]},'answertime':{'type':Sequelize[_0x8345('0x7')]},'endtime':{'type':Sequelize[_0x8345('0x7')]},'duration':{'type':Sequelize[_0x8345('0x8')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x8345('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x8345('0x0')]},'userfield':{'type':Sequelize[_0x8345('0x0')]},'userDisposition':{'type':Sequelize[_0x8345('0x0')]},'userSecondDisposition':{'type':Sequelize[_0x8345('0x0')]},'userThirdDisposition':{'type':Sequelize[_0x8345('0x0')]},'note':{'type':Sequelize[_0x8345('0x0')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x8345('0x0')]}}; \ No newline at end of file +var _0xde44=['dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','internal','outbound','inbound-fax','outbound-fax'];(function(_0x5751e6,_0x125e5e){var _0x4199e4=function(_0x559843){while(--_0x559843){_0x5751e6['push'](_0x5751e6['shift']());}};_0x4199e4(++_0x125e5e);}(_0xde44,0x160));var _0x4de4=function(_0x464fbd,_0x4edb93){_0x464fbd=_0x464fbd-0x0;var _0xcabf88=_0xde44[_0x464fbd];return _0xcabf88;};'use strict';var Sequelize=require(_0x4de4('0x0'));module[_0x4de4('0x1')]={'uniqueid':{'type':Sequelize[_0x4de4('0x2')]},'type':{'type':Sequelize[_0x4de4('0x3')]('inbound',_0x4de4('0x4'),_0x4de4('0x5'),_0x4de4('0x6'),_0x4de4('0x7'),_0x4de4('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4de4('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x4de4('0x2')]},'destinationcontext':{'type':Sequelize[_0x4de4('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x4de4('0x2')]},'lastapplication':{'type':Sequelize[_0x4de4('0x2')]},'lastdata':{'type':Sequelize[_0x4de4('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x4de4('0xa')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x4de4('0xa')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x4de4('0xb')]},'mohtime':{'type':Sequelize[_0x4de4('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x4de4('0x2')]},'userfield':{'type':Sequelize[_0x4de4('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x4de4('0x2')]},'note':{'type':Sequelize[_0x4de4('0x2')]},'prefix':{'type':Sequelize[_0x4de4('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x4de4('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index e3df63b..2215f6c 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x5093e9,_0x5154d0){var _0x4c9a22=function(_0x15176d){while(--_0x15176d){_0x5093e9['push'](_0x5093e9['shift']());}};_0x4c9a22(++_0x5154d0);}(_0xadb5,0xad));var _0x5adb=function(_0x23a178,_0x2840dc){_0x23a178=_0x23a178-0x0;var _0x4e6937=_0xadb5[_0x23a178];return _0x4e6937;};'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 +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(_0x42dbc2,_0xfcd5d6){_0x42dbc2=_0x42dbc2-0x0;var _0x32477a=_0x2032[_0x42dbc2];return _0x32477a;};'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 diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 754f60a..403450e 100644 --- a/server/api/voiceCallReport/voiceCallReport.model.js +++ b/server/api/voiceCallReport/voiceCallReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd93e=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','lodash'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xd93e,0x15d));var _0xed93=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xd93e[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xed93('0x0'));var util=require(_0xed93('0x1'));var logger=require(_0xed93('0x2'))('api');var moment=require('moment');var BPromise=require(_0xed93('0x3'));var rp=require(_0xed93('0x4'));var fs=require('fs');var path=require(_0xed93('0x5'));var rimraf=require('rimraf');var config=require(_0xed93('0x6'));var attributes=require(_0xed93('0x7'));module['exports']=function(_0x3b39fa,_0x3e0fde){return _0x3b39fa[_0xed93('0x8')](_0xed93('0x9'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcdd0=['api','moment','bluebird','request-promise','rimraf','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','lodash','util','../../config/logger'];(function(_0x1733b9,_0x33a1b6){var _0x40e7e9=function(_0x1075b3){while(--_0x1075b3){_0x1733b9['push'](_0x1733b9['shift']());}};_0x40e7e9(++_0x33a1b6);}(_0xcdd0,0x169));var _0x0cdd=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xcdd0[_0x5416db];return _0x243e35;};'use strict';var _=require(_0x0cdd('0x0'));var util=require(_0x0cdd('0x1'));var logger=require(_0x0cdd('0x2'))(_0x0cdd('0x3'));var moment=require(_0x0cdd('0x4'));var BPromise=require(_0x0cdd('0x5'));var rp=require(_0x0cdd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0cdd('0x7'));var config=require('../../config/environment');var attributes=require(_0x0cdd('0x8'));module[_0x0cdd('0x9')]=function(_0x154e80,_0x43f99d){return _0x154e80[_0x0cdd('0xa')](_0x0cdd('0xb'),attributes,{'tableName':_0x0cdd('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 9c1f96c..0af0323 100644 --- a/server/api/voiceCallReport/voiceCallReport.rpc.js +++ b/server/api/voiceCallReport/voiceCallReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d5e=['client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','include','map','model','then','debug','CreateVoiceCallReport','create','body','update','UpdateVoiceCallReport','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x249b8e,_0x4df915){var _0x3541ae=function(_0x5ea416){while(--_0x5ea416){_0x249b8e['push'](_0x249b8e['shift']());}};_0x3541ae(++_0x4df915);}(_0x8d5e,0x19a));var _0xe8d5=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x8d5e[_0x164eca];return _0x2ce562;};'use strict';var _=require('lodash');var util=require(_0xe8d5('0x0'));var moment=require(_0xe8d5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe8d5('0x2'));var db=require(_0xe8d5('0x3'))['db'];var utils=require(_0xe8d5('0x4'));var logger=require(_0xe8d5('0x5'))('rpc');var config=require(_0xe8d5('0x6'));var jayson=require(_0xe8d5('0x7'));var client=jayson[_0xe8d5('0x8')][_0xe8d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2608bf,_0x3f7a13,_0x3eb966){return new BPromise(function(_0x1af844,_0xb389d2){return client[_0xe8d5('0xa')](_0x2608bf,_0x3eb966)['then'](function(_0x33ee48){logger[_0xe8d5('0xb')](_0xe8d5('0xc'),_0x3f7a13,_0xe8d5('0xd'));logger['debug'](_0xe8d5('0xe'),_0x3f7a13,'request\x20sent',JSON[_0xe8d5('0xf')](_0x33ee48));if(_0x33ee48[_0xe8d5('0x10')]){if(_0x33ee48[_0xe8d5('0x10')][_0xe8d5('0x11')]===0x1f4){logger[_0xe8d5('0x10')](_0xe8d5('0xc'),_0x3f7a13,_0x33ee48['error'][_0xe8d5('0x12')]);return _0xb389d2(_0x33ee48['error']['message']);}logger[_0xe8d5('0x10')](_0xe8d5('0xc'),_0x3f7a13,_0x33ee48[_0xe8d5('0x10')][_0xe8d5('0x12')]);return _0x1af844(_0x33ee48['error'][_0xe8d5('0x12')]);}else{logger[_0xe8d5('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x3f7a13,'request\x20sent');_0x1af844(_0x33ee48[_0xe8d5('0x13')][_0xe8d5('0x12')]);}})[_0xe8d5('0x14')](function(_0x464884){logger[_0xe8d5('0x10')](_0xe8d5('0xc'),_0x3f7a13,_0x464884);_0xb389d2(_0x464884);});});}exports[_0xe8d5('0x15')]=function(_0x2b3596){var _0x3f2839=this;return new Promise(function(_0x3d138f,_0x563a85){return db[_0xe8d5('0x16')][_0xe8d5('0x17')]({'raw':_0x2b3596[_0xe8d5('0x18')]?_0x2b3596[_0xe8d5('0x18')][_0xe8d5('0x19')]===undefined?!![]:![]:!![],'where':_0x2b3596['options']?_0x2b3596[_0xe8d5('0x18')][_0xe8d5('0x1a')]||null:null,'attributes':_0x2b3596[_0xe8d5('0x18')]?_0x2b3596[_0xe8d5('0x18')][_0xe8d5('0x1b')]||null:null,'limit':_0x2b3596['options']?_0x2b3596[_0xe8d5('0x18')]['limit']||null:null,'include':_0x2b3596[_0xe8d5('0x18')]?_0x2b3596[_0xe8d5('0x18')][_0xe8d5('0x1c')]?_[_0xe8d5('0x1d')](_0x2b3596[_0xe8d5('0x18')][_0xe8d5('0x1c')],function(_0x107a25){return{'model':db[_0x107a25[_0xe8d5('0x1e')]],'as':_0x107a25['as'],'attributes':_0x107a25[_0xe8d5('0x1b')],'include':_0x107a25['include']?_[_0xe8d5('0x1d')](_0x107a25[_0xe8d5('0x1c')],function(_0x1c729b){return{'model':db[_0x1c729b[_0xe8d5('0x1e')]],'as':_0x1c729b['as'],'attributes':_0x1c729b[_0xe8d5('0x1b')],'include':_0x1c729b[_0xe8d5('0x1c')]?_['map'](_0x1c729b[_0xe8d5('0x1c')],function(_0x35293c){return{'model':db[_0x35293c[_0xe8d5('0x1e')]],'as':_0x35293c['as'],'attributes':_0x35293c[_0xe8d5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe8d5('0x1f')](function(_0x47586c){logger[_0xe8d5('0xb')]('GetVoiceCallReport',_0x2b3596);logger[_0xe8d5('0x20')]('GetVoiceCallReport',_0x2b3596,JSON['stringify'](_0x47586c));_0x3d138f(_0x47586c);})[_0xe8d5('0x14')](function(_0x4c7ca1){logger['error'](_0xe8d5('0x15'),_0x4c7ca1['message'],_0x2b3596);_0x563a85(_0x3f2839[_0xe8d5('0x10')](0x1f4,_0x4c7ca1[_0xe8d5('0x12')]));});});};exports[_0xe8d5('0x21')]=function(_0x4bb89a){var _0x59e730=this;return new Promise(function(_0x33a90f,_0x599919){return db[_0xe8d5('0x16')][_0xe8d5('0x22')](_0x4bb89a[_0xe8d5('0x23')],{'raw':_0x4bb89a[_0xe8d5('0x18')]?_0x4bb89a[_0xe8d5('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xe8d5('0x1f')](function(_0x4f495c){logger['info'](_0xe8d5('0x21'),_0x4bb89a);logger[_0xe8d5('0x20')](_0xe8d5('0x21'),_0x4bb89a,JSON['stringify'](_0x4f495c));_0x33a90f(_0x4f495c);})[_0xe8d5('0x14')](function(_0x4d83bf){logger[_0xe8d5('0x10')](_0xe8d5('0x21'),_0x4d83bf[_0xe8d5('0x12')],_0x4bb89a);_0x599919(_0x59e730['error'](0x1f4,_0x4d83bf[_0xe8d5('0x12')]));});});};exports['UpdateVoiceCallReport']=function(_0x4c9119){var _0x1e3f04=this;return new Promise(function(_0x152d73,_0x324256){return db['VoiceCallReport'][_0xe8d5('0x24')](_0x4c9119[_0xe8d5('0x23')],{'raw':_0x4c9119['options']?_0x4c9119[_0xe8d5('0x18')][_0xe8d5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c9119[_0xe8d5('0x18')]?_0x4c9119[_0xe8d5('0x18')][_0xe8d5('0x1a')]||null:null,'attributes':_0x4c9119[_0xe8d5('0x18')]?_0x4c9119['options'][_0xe8d5('0x1b')]||null:null,'limit':_0x4c9119[_0xe8d5('0x18')]?_0x4c9119[_0xe8d5('0x18')]['limit']||null:null})[_0xe8d5('0x1f')](function(_0x37ba2f){logger[_0xe8d5('0xb')](_0xe8d5('0x25'),_0x4c9119);logger[_0xe8d5('0x20')](_0xe8d5('0x25'),_0x4c9119,JSON[_0xe8d5('0xf')](_0x37ba2f));_0x152d73(_0x37ba2f);})['catch'](function(_0x3d965a){logger[_0xe8d5('0x10')](_0xe8d5('0x25'),_0x3d965a[_0xe8d5('0x12')],_0x4c9119);_0x324256(_0x1e3f04['error'](0x1f4,_0x3d965a[_0xe8d5('0x12')]));});});}; \ No newline at end of file +var _0xb1c1=['randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','findAll','options','raw','where','attributes','include','map','model','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','VoiceCallReport','update','lodash','util','moment','bluebird'];(function(_0x3d1c2a,_0x4643ce){var _0x494989=function(_0x4dfbf8){while(--_0x4dfbf8){_0x3d1c2a['push'](_0x3d1c2a['shift']());}};_0x494989(++_0x4643ce);}(_0xb1c1,0x1c4));var _0x1b1c=function(_0x38b9e3,_0x4f8400){_0x38b9e3=_0x38b9e3-0x0;var _0xe2b7a7=_0xb1c1[_0x38b9e3];return _0xe2b7a7;};'use strict';var _=require(_0x1b1c('0x0'));var util=require(_0x1b1c('0x1'));var moment=require(_0x1b1c('0x2'));var BPromise=require(_0x1b1c('0x3'));var rs=require(_0x1b1c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b1c('0x5'))['db'];var utils=require(_0x1b1c('0x6'));var logger=require('../../config/logger')(_0x1b1c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1b1c('0x8')][_0x1b1c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11e077,_0x5bc89b,_0x2bf986){return new BPromise(function(_0x5ae490,_0x58915c){return client[_0x1b1c('0xa')](_0x11e077,_0x2bf986)[_0x1b1c('0xb')](function(_0x1eeeb4){logger[_0x1b1c('0xc')](_0x1b1c('0xd'),_0x5bc89b,_0x1b1c('0xe'));logger[_0x1b1c('0xf')](_0x1b1c('0x10'),_0x5bc89b,'request\x20sent',JSON[_0x1b1c('0x11')](_0x1eeeb4));if(_0x1eeeb4[_0x1b1c('0x12')]){if(_0x1eeeb4[_0x1b1c('0x12')][_0x1b1c('0x13')]===0x1f4){logger[_0x1b1c('0x12')](_0x1b1c('0xd'),_0x5bc89b,_0x1eeeb4[_0x1b1c('0x12')][_0x1b1c('0x14')]);return _0x58915c(_0x1eeeb4[_0x1b1c('0x12')]['message']);}logger[_0x1b1c('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x5bc89b,_0x1eeeb4[_0x1b1c('0x12')][_0x1b1c('0x14')]);return _0x5ae490(_0x1eeeb4[_0x1b1c('0x12')][_0x1b1c('0x14')]);}else{logger[_0x1b1c('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x5bc89b,_0x1b1c('0xe'));_0x5ae490(_0x1eeeb4[_0x1b1c('0x15')][_0x1b1c('0x14')]);}})[_0x1b1c('0x16')](function(_0x3afb84){logger['error'](_0x1b1c('0xd'),_0x5bc89b,_0x3afb84);_0x58915c(_0x3afb84);});});}exports[_0x1b1c('0x17')]=function(_0x268eba){var _0x5e4112=this;return new Promise(function(_0x38a79f,_0x10cfb9){return db['VoiceCallReport'][_0x1b1c('0x18')]({'raw':_0x268eba[_0x1b1c('0x19')]?_0x268eba['options'][_0x1b1c('0x1a')]===undefined?!![]:![]:!![],'where':_0x268eba[_0x1b1c('0x19')]?_0x268eba[_0x1b1c('0x19')][_0x1b1c('0x1b')]||null:null,'attributes':_0x268eba[_0x1b1c('0x19')]?_0x268eba[_0x1b1c('0x19')][_0x1b1c('0x1c')]||null:null,'limit':_0x268eba[_0x1b1c('0x19')]?_0x268eba[_0x1b1c('0x19')]['limit']||null:null,'include':_0x268eba[_0x1b1c('0x19')]?_0x268eba[_0x1b1c('0x19')][_0x1b1c('0x1d')]?_[_0x1b1c('0x1e')](_0x268eba[_0x1b1c('0x19')][_0x1b1c('0x1d')],function(_0x432d9d){return{'model':db[_0x432d9d[_0x1b1c('0x1f')]],'as':_0x432d9d['as'],'attributes':_0x432d9d[_0x1b1c('0x1c')],'include':_0x432d9d['include']?_['map'](_0x432d9d[_0x1b1c('0x1d')],function(_0x18f136){return{'model':db[_0x18f136[_0x1b1c('0x1f')]],'as':_0x18f136['as'],'attributes':_0x18f136[_0x1b1c('0x1c')],'include':_0x18f136['include']?_[_0x1b1c('0x1e')](_0x18f136[_0x1b1c('0x1d')],function(_0x1e042a){return{'model':db[_0x1e042a[_0x1b1c('0x1f')]],'as':_0x1e042a['as'],'attributes':_0x1e042a[_0x1b1c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1b1c('0xb')](function(_0x58150e){logger[_0x1b1c('0xc')](_0x1b1c('0x17'),_0x268eba);logger[_0x1b1c('0xf')]('GetVoiceCallReport',_0x268eba,JSON[_0x1b1c('0x11')](_0x58150e));_0x38a79f(_0x58150e);})['catch'](function(_0x2137f4){logger['error']('GetVoiceCallReport',_0x2137f4[_0x1b1c('0x14')],_0x268eba);_0x10cfb9(_0x5e4112['error'](0x1f4,_0x2137f4[_0x1b1c('0x14')]));});});};exports[_0x1b1c('0x20')]=function(_0x299a41){var _0xfed490=this;return new Promise(function(_0x51cd34,_0x375570){return db['VoiceCallReport'][_0x1b1c('0x21')](_0x299a41[_0x1b1c('0x22')],{'raw':_0x299a41[_0x1b1c('0x19')]?_0x299a41[_0x1b1c('0x19')][_0x1b1c('0x1a')]===undefined?!![]:![]:!![]})[_0x1b1c('0xb')](function(_0x12e458){logger[_0x1b1c('0xc')](_0x1b1c('0x20'),_0x299a41);logger['debug'](_0x1b1c('0x20'),_0x299a41,JSON[_0x1b1c('0x11')](_0x12e458));_0x51cd34(_0x12e458);})[_0x1b1c('0x16')](function(_0x24610a){logger[_0x1b1c('0x12')](_0x1b1c('0x20'),_0x24610a['message'],_0x299a41);_0x375570(_0xfed490['error'](0x1f4,_0x24610a[_0x1b1c('0x14')]));});});};exports[_0x1b1c('0x23')]=function(_0x573e12){var _0x2d42a5=this;return new Promise(function(_0x51c0ea,_0x476927){return db[_0x1b1c('0x24')][_0x1b1c('0x25')](_0x573e12['body'],{'raw':_0x573e12[_0x1b1c('0x19')]?_0x573e12[_0x1b1c('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x573e12[_0x1b1c('0x19')]?_0x573e12[_0x1b1c('0x19')][_0x1b1c('0x1b')]||null:null,'attributes':_0x573e12[_0x1b1c('0x19')]?_0x573e12[_0x1b1c('0x19')][_0x1b1c('0x1c')]||null:null,'limit':_0x573e12['options']?_0x573e12[_0x1b1c('0x19')]['limit']||null:null})[_0x1b1c('0xb')](function(_0x3ea3e5){logger[_0x1b1c('0xc')](_0x1b1c('0x23'),_0x573e12);logger[_0x1b1c('0xf')]('UpdateVoiceCallReport',_0x573e12,JSON['stringify'](_0x3ea3e5));_0x51c0ea(_0x3ea3e5);})[_0x1b1c('0x16')](function(_0x4b263a){logger[_0x1b1c('0x12')](_0x1b1c('0x23'),_0x4b263a[_0x1b1c('0x14')],_0x573e12);_0x476927(_0x2d42a5[_0x1b1c('0x12')](0x1f4,_0x4b263a[_0x1b1c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 1250fc4..7c89b9a 100644 --- a/server/api/voiceChanSpy/index.js +++ b/server/api/voiceChanSpy/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x569d=['get','isAuthenticated','index','/:id','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller'];(function(_0x33bd05,_0x25781f){var _0x214ca2=function(_0x296820){while(--_0x296820){_0x33bd05['push'](_0x33bd05['shift']());}};_0x214ca2(++_0x25781f);}(_0x569d,0x1ab));var _0xd569=function(_0x33199e,_0x428ded){_0x33199e=_0x33199e-0x0;var _0x2eef3c=_0x569d[_0x33199e];return _0x2eef3c;};'use strict';var multer=require('multer');var util=require(_0xd569('0x0'));var path=require(_0xd569('0x1'));var timeout=require(_0xd569('0x2'));var express=require(_0xd569('0x3'));var router=express[_0xd569('0x4')]();var fs_extra=require(_0xd569('0x5'));var auth=require(_0xd569('0x6'));var interaction=require(_0xd569('0x7'));var config=require(_0xd569('0x8'));var controller=require(_0xd569('0x9'));router[_0xd569('0xa')]('/',auth[_0xd569('0xb')](),controller[_0xd569('0xc')]);router[_0xd569('0xa')](_0xd569('0xd'),auth[_0xd569('0xb')](),controller['show']);router['post']('/',auth[_0xd569('0xb')](),controller[_0xd569('0xe')]);router[_0xd569('0xf')](_0xd569('0xd'),auth[_0xd569('0xb')](),controller[_0xd569('0x10')]);router[_0xd569('0x11')]('/:id',auth[_0xd569('0xb')](),controller['destroy']);module[_0xd569('0x12')]=router; \ No newline at end of file +var _0x4060=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x4060,0x127));var _0x0406=function(_0x17a1db,_0x990353){_0x17a1db=_0x17a1db-0x0;var _0x25d1e1=_0x4060[_0x17a1db];return _0x25d1e1;};'use strict';var multer=require(_0x0406('0x0'));var util=require(_0x0406('0x1'));var path=require(_0x0406('0x2'));var timeout=require(_0x0406('0x3'));var express=require(_0x0406('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0406('0x5'));var interaction=require(_0x0406('0x6'));var config=require(_0x0406('0x7'));var controller=require(_0x0406('0x8'));router[_0x0406('0x9')]('/',auth['isAuthenticated'](),controller[_0x0406('0xa')]);router[_0x0406('0x9')](_0x0406('0xb'),auth['isAuthenticated'](),controller[_0x0406('0xc')]);router[_0x0406('0xd')]('/',auth[_0x0406('0xe')](),controller[_0x0406('0xf')]);router[_0x0406('0x10')]('/:id',auth[_0x0406('0xe')](),controller[_0x0406('0x11')]);router[_0x0406('0x12')](_0x0406('0xb'),auth[_0x0406('0xe')](),controller[_0x0406('0x13')]);module[_0x0406('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 858a512..6bf3a1a 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.attributes.js +++ b/server/api/voiceChanSpy/voiceChanSpy.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4342=['getDataValue','options','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4342,0xe5));var _0x2434=function(_0x49aa99,_0x4ef618){_0x49aa99=_0x49aa99-0x0;var _0x1786d7=_0x4342[_0x49aa99];return _0x1786d7;};'use strict';var Sequelize=require(_0x2434('0x0'));module[_0x2434('0x1')]={'name':{'type':Sequelize[_0x2434('0x2')]},'prefix':{'type':Sequelize[_0x2434('0x2')],'unique':_0x2434('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x2434('0x2')],'set':function(_0x50953a){this[_0x2434('0x4')]('options',_0x50953a?_0x50953a['join'](''):[]);},'get':function(){return this[_0x2434('0x5')](_0x2434('0x6'))?this[_0x2434('0x5')](_0x2434('0x6'))[_0x2434('0x7')](''):[];}},'auth':{'type':Sequelize[_0x2434('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x2434('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x2434('0x2')]},'description':{'type':Sequelize[_0x2434('0x2')]}}; \ No newline at end of file +var _0x1c67=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','setDataValue','options'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x1c67,0x1db));var _0x71c6=function(_0x2e5952,_0x311989){_0x2e5952=_0x2e5952-0x0;var _0x2d26bb=_0x1c67[_0x2e5952];return _0x2d26bb;};'use strict';var Sequelize=require(_0x71c6('0x0'));module[_0x71c6('0x1')]={'name':{'type':Sequelize[_0x71c6('0x2')]},'prefix':{'type':Sequelize[_0x71c6('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x210d12){this[_0x71c6('0x3')](_0x71c6('0x4'),_0x210d12?_0x210d12['join'](''):[]);},'get':function(){return this[_0x71c6('0x5')](_0x71c6('0x4'))?this[_0x71c6('0x5')]('options')[_0x71c6('0x6')](''):[];}},'auth':{'type':Sequelize[_0x71c6('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x71c6('0x2')]},'record':{'type':Sequelize[_0x71c6('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x71c6('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 45ae7b2..3757abb 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.controller.js +++ b/server/api/voiceChanSpy/voiceChanSpy.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf0cc=['rows','catch','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','eml-format','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','offset','count','limit','set','Content-Range','json','reject','update','then','get','ChanSpies','error','send','index','map','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','VoiceChanSpy','includeAll','include'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xf0cc,0xa7));var _0xcf0c=function(_0x29bf6b,_0x12a4ac){_0x29bf6b=_0x29bf6b-0x0;var _0xbf3db3=_0xf0cc[_0x29bf6b];return _0xbf3db3;};'use strict';var emlformat=require(_0xcf0c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcf0c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcf0c('0x2'));var Mustache=require(_0xcf0c('0x3'));var util=require('util');var path=require('path');var sox=require(_0xcf0c('0x4'));var csv=require(_0xcf0c('0x5'));var ejs=require(_0xcf0c('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf0c('0x7'));var squel=require(_0xcf0c('0x8'));var crypto=require(_0xcf0c('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcf0c('0x5'));var querystring=require('querystring');var Papa=require(_0xcf0c('0xa'));var Redis=require('ioredis');var authService=require(_0xcf0c('0xb'));var qs=require(_0xcf0c('0xc'));var as=require(_0xcf0c('0xd'));var hardwareService=require(_0xcf0c('0xe'));var logger=require(_0xcf0c('0xf'))(_0xcf0c('0x10'));var utils=require(_0xcf0c('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xcf0c('0x12'));var db=require(_0xcf0c('0x13'))['db'];function respondWithStatusCode(_0x6dde21,_0x34f74f){_0x34f74f=_0x34f74f||0xcc;return function(_0x327f65){if(_0x327f65){return _0x6dde21['sendStatus'](_0x34f74f);}return _0x6dde21[_0xcf0c('0x14')](_0x34f74f)[_0xcf0c('0x15')]();};}function respondWithResult(_0x26fc43,_0x4fd482){_0x4fd482=_0x4fd482||0xc8;return function(_0x52038a){if(_0x52038a){return _0x26fc43[_0xcf0c('0x14')](_0x4fd482)['json'](_0x52038a);}};}function respondWithFilteredResult(_0x1f7a47,_0x8ed57d){return function(_0x5362ef){if(_0x5362ef){var _0x58f9ab=typeof _0x8ed57d['offset']===_0xcf0c('0x16')&&typeof _0x8ed57d['limit']===_0xcf0c('0x16');var _0xee0e66=_0x5362ef['count'];var _0x48766e=_0x58f9ab?0x0:_0x8ed57d[_0xcf0c('0x17')];var _0x3c43e5=_0x58f9ab?_0x5362ef[_0xcf0c('0x18')]:_0x8ed57d['offset']+_0x8ed57d[_0xcf0c('0x19')];var _0x134ecb;if(_0x3c43e5>=_0xee0e66){_0x3c43e5=_0xee0e66;_0x134ecb=0xc8;}else{_0x134ecb=0xce;}_0x1f7a47[_0xcf0c('0x14')](_0x134ecb);return _0x1f7a47[_0xcf0c('0x1a')](_0xcf0c('0x1b'),_0x48766e+'-'+_0x3c43e5+'/'+_0xee0e66)[_0xcf0c('0x1c')](_0x5362ef);}return null;};}function patchUpdates(_0x29bb2b){return function(_0xcfb5bd){try{jsonpatch['apply'](_0xcfb5bd,_0x29bb2b,!![]);}catch(_0x203da7){return BPromise[_0xcf0c('0x1d')](_0x203da7);}return _0xcfb5bd['save']();};}function saveUpdates(_0x4832d2,_0x39b1ed){return function(_0x20b8f3){if(_0x20b8f3){return _0x20b8f3[_0xcf0c('0x1e')](_0x4832d2)[_0xcf0c('0x1f')](function(_0x1ceea0){return _0x1ceea0;});}return null;};}function removeEntity(_0x8c4978,_0xbdf266){return function(_0x33628d){if(_0x33628d){return _0x33628d['destroy']()[_0xcf0c('0x1f')](function(){var _0x5466f4=_0x33628d[_0xcf0c('0x20')]({'plain':!![]});var _0x39f5e0=_0xcf0c('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0x39f5e0,'resourceId':_0x5466f4['id']}})[_0xcf0c('0x1f')](function(){return _0x33628d;});})[_0xcf0c('0x1f')](function(){_0x8c4978[_0xcf0c('0x14')](0xcc)[_0xcf0c('0x15')]();});}};}function handleEntityNotFound(_0x9b0174,_0x36c637){return function(_0x3b38d9){if(!_0x3b38d9){_0x9b0174['sendStatus'](0x194);}return _0x3b38d9;};}function handleError(_0x1d9501,_0x1ce8d4){_0x1ce8d4=_0x1ce8d4||0x1f4;return function(_0x2bd2e3){logger[_0xcf0c('0x22')](_0x2bd2e3['stack']);if(_0x2bd2e3['name']){delete _0x2bd2e3['name'];}_0x1d9501['status'](_0x1ce8d4)[_0xcf0c('0x23')](_0x2bd2e3);};}exports[_0xcf0c('0x24')]=function(_0x3bdfd0,_0x34db17){var _0x3da4df={},_0x3fa73f={},_0x358e43={'count':0x0,'rows':[]};var _0x249d54=_[_0xcf0c('0x25')](db['VoiceChanSpy'][_0xcf0c('0x26')],function(_0x4f5ee2){return{'name':_0x4f5ee2[_0xcf0c('0x27')],'type':_0x4f5ee2[_0xcf0c('0x28')][_0xcf0c('0x29')]};});_0x3fa73f['model']=_['map'](_0x249d54,_0xcf0c('0x2a'));_0x3fa73f['query']=_[_0xcf0c('0x2b')](_0x3bdfd0[_0xcf0c('0x2c')]);_0x3fa73f[_0xcf0c('0x2d')]=_[_0xcf0c('0x2e')](_0x3fa73f[_0xcf0c('0x2f')],_0x3fa73f['query']);_0x3da4df[_0xcf0c('0x30')]=_[_0xcf0c('0x2e')](_0x3fa73f[_0xcf0c('0x2f')],qs[_0xcf0c('0x31')](_0x3bdfd0['query'][_0xcf0c('0x31')]));_0x3da4df[_0xcf0c('0x30')]=_0x3da4df[_0xcf0c('0x30')][_0xcf0c('0x32')]?_0x3da4df['attributes']:_0x3fa73f[_0xcf0c('0x2f')];if(!_0x3bdfd0[_0xcf0c('0x2c')]['hasOwnProperty'](_0xcf0c('0x33'))){_0x3da4df[_0xcf0c('0x19')]=qs[_0xcf0c('0x19')](_0x3bdfd0[_0xcf0c('0x2c')][_0xcf0c('0x19')]);_0x3da4df[_0xcf0c('0x17')]=qs[_0xcf0c('0x17')](_0x3bdfd0['query'][_0xcf0c('0x17')]);}_0x3da4df['order']=qs[_0xcf0c('0x34')](_0x3bdfd0[_0xcf0c('0x2c')][_0xcf0c('0x34')]);_0x3da4df[_0xcf0c('0x35')]=qs[_0xcf0c('0x2d')](_['pick'](_0x3bdfd0['query'],_0x3fa73f[_0xcf0c('0x2d')]),_0x249d54);if(_0x3bdfd0['query'][_0xcf0c('0x36')]){_0x3da4df[_0xcf0c('0x35')]=_[_0xcf0c('0x37')](_0x3da4df[_0xcf0c('0x35')],{'$or':_[_0xcf0c('0x25')](_0x249d54,function(_0x532b2a){if(_0x532b2a[_0xcf0c('0x28')]!==_0xcf0c('0x38')){var _0xc1d73e={};_0xc1d73e[_0x532b2a[_0xcf0c('0x2a')]]={'$like':'%'+_0x3bdfd0[_0xcf0c('0x2c')][_0xcf0c('0x36')]+'%'};return _0xc1d73e;}})});}_0x3da4df=_[_0xcf0c('0x37')]({},_0x3da4df,_0x3bdfd0[_0xcf0c('0x39')]);var _0x12b43f={'where':_0x3da4df[_0xcf0c('0x35')]};return db[_0xcf0c('0x3a')]['count'](_0x12b43f)['then'](function(_0xf39dea){_0x358e43[_0xcf0c('0x18')]=_0xf39dea;if(_0x3bdfd0[_0xcf0c('0x2c')][_0xcf0c('0x3b')]){_0x3da4df[_0xcf0c('0x3c')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x3da4df);})[_0xcf0c('0x1f')](function(_0x24f4bd){_0x358e43[_0xcf0c('0x3d')]=_0x24f4bd;return _0x358e43;})['then'](respondWithFilteredResult(_0x34db17,_0x3da4df))[_0xcf0c('0x3e')](handleError(_0x34db17,null));};exports[_0xcf0c('0x3f')]=function(_0x2c8fa2,_0x1e688e){var _0x53af37={'raw':![],'where':{'id':_0x2c8fa2['params']['id']}},_0x681778={};_0x681778[_0xcf0c('0x2f')]=_['keys'](db[_0xcf0c('0x3a')]['rawAttributes']);_0x681778[_0xcf0c('0x2c')]=_[_0xcf0c('0x2b')](_0x2c8fa2['query']);_0x681778['filters']=_['intersection'](_0x681778[_0xcf0c('0x2f')],_0x681778[_0xcf0c('0x2c')]);_0x53af37[_0xcf0c('0x30')]=_[_0xcf0c('0x2e')](_0x681778[_0xcf0c('0x2f')],qs[_0xcf0c('0x31')](_0x2c8fa2[_0xcf0c('0x2c')][_0xcf0c('0x31')]));_0x53af37[_0xcf0c('0x30')]=_0x53af37[_0xcf0c('0x30')][_0xcf0c('0x32')]?_0x53af37[_0xcf0c('0x30')]:_0x681778['model'];if(_0x2c8fa2[_0xcf0c('0x2c')][_0xcf0c('0x3b')]){_0x53af37[_0xcf0c('0x3c')]=[{'all':!![]}];}_0x53af37=_[_0xcf0c('0x37')]({},_0x53af37,_0x2c8fa2[_0xcf0c('0x39')]);return db['VoiceChanSpy']['find'](_0x53af37)[_0xcf0c('0x1f')](handleEntityNotFound(_0x1e688e,null))[_0xcf0c('0x1f')](respondWithResult(_0x1e688e,null))['catch'](handleError(_0x1e688e,null));};exports[_0xcf0c('0x40')]=function(_0x1f9728,_0x87e6d4){return db[_0xcf0c('0x3a')][_0xcf0c('0x40')](_0x1f9728[_0xcf0c('0x41')],{})[_0xcf0c('0x1f')](function(_0xe9f843){var _0x2fca4a=_0x1f9728[_0xcf0c('0x42')][_0xcf0c('0x20')]({'plain':!![]});if(!_0x2fca4a)throw new Error(_0xcf0c('0x43'));if(_0x2fca4a[_0xcf0c('0x44')]===_0xcf0c('0x42')){var _0x11558c=_0xe9f843[_0xcf0c('0x20')]({'plain':!![]});var _0x5563be=_0xcf0c('0x21');return db['UserProfileSection'][_0xcf0c('0x45')]({'where':{'name':_0x5563be,'userProfileId':_0x2fca4a[_0xcf0c('0x46')]},'raw':!![]})[_0xcf0c('0x1f')](function(_0x5103ff){if(_0x5103ff&&_0x5103ff[_0xcf0c('0x47')]===0x0){return db[_0xcf0c('0x48')][_0xcf0c('0x40')]({'name':_0x11558c[_0xcf0c('0x2a')],'resourceId':_0x11558c['id'],'type':_0x5103ff[_0xcf0c('0x2a')],'sectionId':_0x5103ff['id']},{})[_0xcf0c('0x1f')](function(){return _0xe9f843;});}else{return _0xe9f843;}})['catch'](function(_0x20b133){logger['error'](_0xcf0c('0x49'),_0x20b133);throw _0x20b133;});}return _0xe9f843;})[_0xcf0c('0x1f')](respondWithResult(_0x87e6d4,0xc9))[_0xcf0c('0x3e')](handleError(_0x87e6d4,null));};exports[_0xcf0c('0x1e')]=function(_0x543d75,_0x19782d){if(_0x543d75[_0xcf0c('0x41')]['id']){delete _0x543d75[_0xcf0c('0x41')]['id'];}return db[_0xcf0c('0x3a')][_0xcf0c('0x45')]({'where':{'id':_0x543d75[_0xcf0c('0x4a')]['id']}})[_0xcf0c('0x1f')](handleEntityNotFound(_0x19782d,null))['then'](saveUpdates(_0x543d75[_0xcf0c('0x41')],null))[_0xcf0c('0x1f')](respondWithResult(_0x19782d,null))[_0xcf0c('0x3e')](handleError(_0x19782d,null));};exports[_0xcf0c('0x4b')]=function(_0x3f9edd,_0x53a2c8){return db[_0xcf0c('0x3a')][_0xcf0c('0x45')]({'where':{'id':_0x3f9edd[_0xcf0c('0x4a')]['id']}})[_0xcf0c('0x1f')](handleEntityNotFound(_0x53a2c8,null))[_0xcf0c('0x1f')](removeEntity(_0x53a2c8,null))['catch'](handleError(_0x53a2c8,null));}; \ No newline at end of file +var _0x847d=['keys','filters','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','stack','send','index','map','VoiceChanSpy','rawAttributes','key','model','name','query','intersection','fields','attributes','length','nolimit','sort','pick','where','type','VIRTUAL','merge','includeAll','findAll','rows','show','params'];(function(_0x44508f,_0x3d2edc){var _0x3cc7b9=function(_0x362c76){while(--_0x362c76){_0x44508f['push'](_0x44508f['shift']());}};_0x3cc7b9(++_0x3d2edc);}(_0x847d,0x14a));var _0xd847=function(_0x529296,_0x1a6a23){_0x529296=_0x529296-0x0;var _0x1796bf=_0x847d[_0x529296];return _0x1796bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd847('0x0'));var zipdir=require(_0xd847('0x1'));var jsonpatch=require(_0xd847('0x2'));var rp=require('request-promise');var moment=require(_0xd847('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd847('0x4'));var util=require(_0xd847('0x5'));var path=require('path');var sox=require(_0xd847('0x6'));var csv=require(_0xd847('0x7'));var ejs=require(_0xd847('0x8'));var fs=require('fs');var fs_extra=require(_0xd847('0x9'));var _=require('lodash');var squel=require(_0xd847('0xa'));var crypto=require(_0xd847('0xb'));var jsforce=require(_0xd847('0xc'));var deskjs=require(_0xd847('0xd'));var toCsv=require(_0xd847('0x7'));var querystring=require(_0xd847('0xe'));var Papa=require(_0xd847('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd847('0x10'));var logger=require(_0xd847('0x11'))(_0xd847('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd847('0x13'));var db=require(_0xd847('0x14'))['db'];function respondWithStatusCode(_0x344d39,_0x2ea8e7){_0x2ea8e7=_0x2ea8e7||0xcc;return function(_0x1e4e26){if(_0x1e4e26){return _0x344d39[_0xd847('0x15')](_0x2ea8e7);}return _0x344d39[_0xd847('0x16')](_0x2ea8e7)[_0xd847('0x17')]();};}function respondWithResult(_0x1c827a,_0x2faa39){_0x2faa39=_0x2faa39||0xc8;return function(_0x3c4805){if(_0x3c4805){return _0x1c827a['status'](_0x2faa39)[_0xd847('0x18')](_0x3c4805);}};}function respondWithFilteredResult(_0x165fbe,_0xd69fc9){return function(_0x404bdb){if(_0x404bdb){var _0x16c79a=typeof _0xd69fc9['offset']===_0xd847('0x19')&&typeof _0xd69fc9[_0xd847('0x1a')]===_0xd847('0x19');var _0x1a01ad=_0x404bdb['count'];var _0x1ef765=_0x16c79a?0x0:_0xd69fc9['offset'];var _0x4b6264=_0x16c79a?_0x404bdb[_0xd847('0x1b')]:_0xd69fc9[_0xd847('0x1c')]+_0xd69fc9[_0xd847('0x1a')];var _0x3905b8;if(_0x4b6264>=_0x1a01ad){_0x4b6264=_0x1a01ad;_0x3905b8=0xc8;}else{_0x3905b8=0xce;}_0x165fbe['status'](_0x3905b8);return _0x165fbe[_0xd847('0x1d')]('Content-Range',_0x1ef765+'-'+_0x4b6264+'/'+_0x1a01ad)['json'](_0x404bdb);}return null;};}function patchUpdates(_0x25e139){return function(_0x2c1091){try{jsonpatch[_0xd847('0x1e')](_0x2c1091,_0x25e139,!![]);}catch(_0x2a57df){return BPromise[_0xd847('0x1f')](_0x2a57df);}return _0x2c1091[_0xd847('0x20')]();};}function saveUpdates(_0x1490a1,_0x39c465){return function(_0x1eaf08){if(_0x1eaf08){return _0x1eaf08[_0xd847('0x21')](_0x1490a1)[_0xd847('0x22')](function(_0x3795fc){return _0x3795fc;});}return null;};}function removeEntity(_0x4a1691,_0x560563){return function(_0x26a787){if(_0x26a787){return _0x26a787[_0xd847('0x23')]()[_0xd847('0x22')](function(){var _0x5075a2=_0x26a787[_0xd847('0x24')]({'plain':!![]});var _0x246920=_0xd847('0x25');return db[_0xd847('0x26')][_0xd847('0x23')]({'where':{'type':_0x246920,'resourceId':_0x5075a2['id']}})[_0xd847('0x22')](function(){return _0x26a787;});})[_0xd847('0x22')](function(){_0x4a1691[_0xd847('0x16')](0xcc)[_0xd847('0x17')]();});}};}function handleEntityNotFound(_0x59296b,_0x46b213){return function(_0x1d03e2){if(!_0x1d03e2){_0x59296b[_0xd847('0x15')](0x194);}return _0x1d03e2;};}function handleError(_0x1a5370,_0x19bf66){_0x19bf66=_0x19bf66||0x1f4;return function(_0x3301cd){logger['error'](_0x3301cd[_0xd847('0x27')]);if(_0x3301cd['name']){delete _0x3301cd['name'];}_0x1a5370['status'](_0x19bf66)[_0xd847('0x28')](_0x3301cd);};}exports[_0xd847('0x29')]=function(_0x2678dc,_0x18d162){var _0x38c015={},_0x2306cf={},_0x329df1={'count':0x0,'rows':[]};var _0x197b7b=_[_0xd847('0x2a')](db[_0xd847('0x2b')][_0xd847('0x2c')],function(_0x156575){return{'name':_0x156575['fieldName'],'type':_0x156575['type'][_0xd847('0x2d')]};});_0x2306cf[_0xd847('0x2e')]=_[_0xd847('0x2a')](_0x197b7b,_0xd847('0x2f'));_0x2306cf[_0xd847('0x30')]=_['keys'](_0x2678dc[_0xd847('0x30')]);_0x2306cf['filters']=_[_0xd847('0x31')](_0x2306cf['model'],_0x2306cf[_0xd847('0x30')]);_0x38c015['attributes']=_[_0xd847('0x31')](_0x2306cf[_0xd847('0x2e')],qs['fields'](_0x2678dc['query'][_0xd847('0x32')]));_0x38c015[_0xd847('0x33')]=_0x38c015[_0xd847('0x33')][_0xd847('0x34')]?_0x38c015[_0xd847('0x33')]:_0x2306cf[_0xd847('0x2e')];if(!_0x2678dc['query']['hasOwnProperty'](_0xd847('0x35'))){_0x38c015[_0xd847('0x1a')]=qs[_0xd847('0x1a')](_0x2678dc['query'][_0xd847('0x1a')]);_0x38c015[_0xd847('0x1c')]=qs['offset'](_0x2678dc['query'][_0xd847('0x1c')]);}_0x38c015['order']=qs[_0xd847('0x36')](_0x2678dc[_0xd847('0x30')][_0xd847('0x36')]);_0x38c015['where']=qs['filters'](_[_0xd847('0x37')](_0x2678dc['query'],_0x2306cf['filters']),_0x197b7b);if(_0x2678dc[_0xd847('0x30')]['filter']){_0x38c015['where']=_['merge'](_0x38c015[_0xd847('0x38')],{'$or':_[_0xd847('0x2a')](_0x197b7b,function(_0x379814){if(_0x379814[_0xd847('0x39')]!==_0xd847('0x3a')){var _0x1dd9ed={};_0x1dd9ed[_0x379814['name']]={'$like':'%'+_0x2678dc[_0xd847('0x30')]['filter']+'%'};return _0x1dd9ed;}})});}_0x38c015=_[_0xd847('0x3b')]({},_0x38c015,_0x2678dc['options']);var _0x16eb77={'where':_0x38c015[_0xd847('0x38')]};return db['VoiceChanSpy'][_0xd847('0x1b')](_0x16eb77)[_0xd847('0x22')](function(_0x3b551a){_0x329df1[_0xd847('0x1b')]=_0x3b551a;if(_0x2678dc[_0xd847('0x30')][_0xd847('0x3c')]){_0x38c015['include']=[{'all':!![]}];}return db[_0xd847('0x2b')][_0xd847('0x3d')](_0x38c015);})[_0xd847('0x22')](function(_0x4ec489){_0x329df1[_0xd847('0x3e')]=_0x4ec489;return _0x329df1;})[_0xd847('0x22')](respondWithFilteredResult(_0x18d162,_0x38c015))['catch'](handleError(_0x18d162,null));};exports[_0xd847('0x3f')]=function(_0x581927,_0x4037fe){var _0x21d102={'raw':![],'where':{'id':_0x581927[_0xd847('0x40')]['id']}},_0x3a1654={};_0x3a1654['model']=_[_0xd847('0x41')](db[_0xd847('0x2b')][_0xd847('0x2c')]);_0x3a1654['query']=_[_0xd847('0x41')](_0x581927[_0xd847('0x30')]);_0x3a1654[_0xd847('0x42')]=_['intersection'](_0x3a1654[_0xd847('0x2e')],_0x3a1654[_0xd847('0x30')]);_0x21d102[_0xd847('0x33')]=_[_0xd847('0x31')](_0x3a1654['model'],qs['fields'](_0x581927['query'][_0xd847('0x32')]));_0x21d102[_0xd847('0x33')]=_0x21d102[_0xd847('0x33')][_0xd847('0x34')]?_0x21d102['attributes']:_0x3a1654[_0xd847('0x2e')];if(_0x581927['query'][_0xd847('0x3c')]){_0x21d102['include']=[{'all':!![]}];}_0x21d102=_[_0xd847('0x3b')]({},_0x21d102,_0x581927['options']);return db[_0xd847('0x2b')]['find'](_0x21d102)[_0xd847('0x22')](handleEntityNotFound(_0x4037fe,null))[_0xd847('0x22')](respondWithResult(_0x4037fe,null))[_0xd847('0x43')](handleError(_0x4037fe,null));};exports['create']=function(_0x2a130b,_0x465158){return db[_0xd847('0x2b')][_0xd847('0x44')](_0x2a130b['body'],{})['then'](function(_0x58dd6f){var _0x1c7a7d=_0x2a130b[_0xd847('0x45')][_0xd847('0x24')]({'plain':!![]});if(!_0x1c7a7d)throw new Error(_0xd847('0x46'));if(_0x1c7a7d[_0xd847('0x47')]===_0xd847('0x45')){var _0x341289=_0x58dd6f[_0xd847('0x24')]({'plain':!![]});var _0x2934ce='ChanSpies';return db[_0xd847('0x48')][_0xd847('0x49')]({'where':{'name':_0x2934ce,'userProfileId':_0x1c7a7d[_0xd847('0x4a')]},'raw':!![]})[_0xd847('0x22')](function(_0x4e7144){if(_0x4e7144&&_0x4e7144[_0xd847('0x4b')]===0x0){return db[_0xd847('0x26')][_0xd847('0x44')]({'name':_0x341289[_0xd847('0x2f')],'resourceId':_0x341289['id'],'type':_0x4e7144[_0xd847('0x2f')],'sectionId':_0x4e7144['id']},{})[_0xd847('0x22')](function(){return _0x58dd6f;});}else{return _0x58dd6f;}})[_0xd847('0x43')](function(_0x209e13){logger[_0xd847('0x4c')](_0xd847('0x4d'),_0x209e13);throw _0x209e13;});}return _0x58dd6f;})[_0xd847('0x22')](respondWithResult(_0x465158,0xc9))[_0xd847('0x43')](handleError(_0x465158,null));};exports[_0xd847('0x21')]=function(_0x6fe8cd,_0x39d0c2){if(_0x6fe8cd[_0xd847('0x4e')]['id']){delete _0x6fe8cd['body']['id'];}return db[_0xd847('0x2b')][_0xd847('0x49')]({'where':{'id':_0x6fe8cd[_0xd847('0x40')]['id']}})['then'](handleEntityNotFound(_0x39d0c2,null))[_0xd847('0x22')](saveUpdates(_0x6fe8cd[_0xd847('0x4e')],null))[_0xd847('0x22')](respondWithResult(_0x39d0c2,null))[_0xd847('0x43')](handleError(_0x39d0c2,null));};exports[_0xd847('0x23')]=function(_0x2dcb7d,_0x3744cf){return db['VoiceChanSpy'][_0xd847('0x49')]({'where':{'id':_0x2dcb7d['params']['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x3744cf,null))[_0xd847('0x22')](removeEntity(_0x3744cf,null))[_0xd847('0x43')](handleError(_0x3744cf,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index bf49a8d..baab580 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.model.js +++ b/server/api/voiceChanSpy/voiceChanSpy.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41f1=['models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch','destroy','util','context','from-sip','format','prefix','system','push','Set','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth','merge','Authenticate','password','SIP/%s,%s','name','options','join','StopMixMonitor','concat','internal','User','findAll','agent','then'];(function(_0x284506,_0x191316){var _0x1e9ee5=function(_0xe7eaa){while(--_0xe7eaa){_0x284506['push'](_0x284506['shift']());}};_0x1e9ee5(++_0x191316);}(_0x41f1,0x14c));var _0x141f=function(_0x206137,_0x2a56c7){_0x206137=_0x206137-0x0;var _0x96c5f7=_0x41f1[_0x206137];return _0x96c5f7;};'use strict';var _=require('lodash');var util=require(_0x141f('0x0'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x17d7b8,_0x501bab,_0x987458){var _0x908a86=0x1;var _0xb37222=[];var _0x3d19d4={'context':_0x501bab[_0x141f('0x1')]||_0x141f('0x2'),'exten':util[_0x141f('0x3')]('%s%s',_0x17d7b8[_0x141f('0x4')],_0x987458),'type':_0x141f('0x5'),'isApp':![],'ChanSpyId':_0x17d7b8['id'],'UserId':_0x501bab['id']};_0xb37222[_0x141f('0x6')](_['merge']({'app':_0x141f('0x7'),'appdata':util[_0x141f('0x3')](_0x141f('0x8'),_0x141f('0x9')),'priority':_0x908a86++},_0x3d19d4));if(_0x17d7b8[_0x141f('0xa')]){_0xb37222[_0x141f('0x6')](_['merge']({'app':_0x141f('0xb'),'appdata':util[_0x141f('0x3')]('${UNIQUEID}.%s,a',_0x17d7b8[_0x141f('0xc')]),'priority':_0x908a86++},_0x3d19d4));}if(_0x17d7b8[_0x141f('0xd')]){_0xb37222['push'](_[_0x141f('0xe')]({'app':_0x141f('0xf'),'appdata':_0x17d7b8[_0x141f('0x10')],'priority':_0x908a86++},_0x3d19d4));}_0xb37222['push'](_[_0x141f('0xe')]({'app':'ChanSpy','appdata':util[_0x141f('0x3')](_0x141f('0x11'),_0x501bab[_0x141f('0x12')],_0x17d7b8['options']?_0x17d7b8[_0x141f('0x13')][_0x141f('0x14')](''):''),'priority':_0x908a86++},_0x3d19d4));if(_0x17d7b8[_0x141f('0xa')]){_0xb37222[_0x141f('0x6')](_[_0x141f('0xe')]({'app':_0x141f('0x15'),'priority':_0x908a86++},_0x3d19d4));}return _0xb37222;};var getChanSpyApplications=function(_0x37277c,_0xb68613){var _0x47357d=[];for(var _0x10545c=0x0,_0x44744a=0x1;_0x10545c<_0xb68613['length'];_0x10545c++,_0x44744a=0x1){_0x47357d=_0x47357d[_0x141f('0x16')](getUserApplications(_0x37277c,_0xb68613[_0x10545c],_0xb68613[_0x10545c][_0x141f('0x17')]));if(_0xb68613[_0x10545c]['internal']!=_0xb68613[_0x10545c][_0x141f('0x12')]){_0x47357d=_0x47357d['concat'](getUserApplications(_0x37277c,_0xb68613[_0x10545c],_0xb68613[_0x10545c][_0x141f('0x12')]));}}return _0x47357d;};var getChanSpyPromise=function(_0x2a1129,_0x459548){return new BPromise(function(_0x532a21,_0x2a9190){return _0x2a1129[_0x141f('0x18')][_0x141f('0x19')]({'attributes':['id',_0x141f('0x12'),_0x141f('0x17')],'where':{'role':_0x141f('0x1a'),'chanspy':!![]},'raw':!![]})[_0x141f('0x1b')](function(_0x414046){if(_0x414046){return _0x532a21(getChanSpyApplications(_0x459548,_0x414046));}return _0x532a21([]);})['catch'](function(_0x53cbfc){_0x2a9190(_0x53cbfc);});});};module['exports']=function(_0x2d9aae,_0x1faf01){var _0x10c1df=_0x2d9aae[_0x141f('0x1c')];return _0x2d9aae[_0x141f('0x1d')](_0x141f('0x1e'),attributes,{'tableName':_0x141f('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x595925,_0x1bc3a9,_0x292e0d){return getChanSpyPromise(_0x10c1df,_0x595925)[_0x141f('0x1b')](function(_0x51e25c){if(_0x51e25c&&_0x51e25c['length']){return _0x10c1df[_0x141f('0x20')][_0x141f('0x21')](_0x51e25c);}})[_0x141f('0x1b')](function(){_0x292e0d();})[_0x141f('0x22')](function(_0x2df580){_0x292e0d(_0x2df580);});},'afterUpdate':function(_0x58856c,_0x1c1501,_0x22c529){return _0x10c1df[_0x141f('0x20')]['destroy']({'where':{'ChanSpyId':_0x58856c['id']}})[_0x141f('0x1b')](function(){return getChanSpyPromise(_0x10c1df,_0x58856c);})[_0x141f('0x1b')](function(_0x513d6e){if(_0x513d6e&&_0x513d6e['length']){return _0x10c1df[_0x141f('0x20')][_0x141f('0x21')](_0x513d6e);}})[_0x141f('0x1b')](function(){_0x22c529();})[_0x141f('0x22')](function(_0x596ccb){_0x22c529(_0x596ccb);});},'afterDestroy':function(_0x12a190,_0x38ad5b,_0x3c0cd8){return _0x10c1df[_0x141f('0x20')][_0x141f('0x23')]({'where':{'ChanSpyId':_0x12a190['id']}})[_0x141f('0x1b')](function(){_0x3c0cd8();})[_0x141f('0x22')](function(_0x11266c){_0x3c0cd8(_0x11266c);});}}});}; \ No newline at end of file +var _0xdb90=['StopMixMonitor','length','concat','internal','User','findAll','agent','then','exports','models','VoiceChanSpy','voice_chanspy','bulkCreate','catch','VoiceExtension','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','format','%s%s','system','Set','CDR(type)=%s','chanspy','record','push','merge','MixMonitor','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join'];(function(_0xe6edd7,_0x2993d2){var _0xc07080=function(_0x14d02b){while(--_0x14d02b){_0xe6edd7['push'](_0xe6edd7['shift']());}};_0xc07080(++_0x2993d2);}(_0xdb90,0x196));var _0x0db9=function(_0x53bec3,_0x550a58){_0x53bec3=_0x53bec3-0x0;var _0x159317=_0xdb90[_0x53bec3];return _0x159317;};'use strict';var _=require(_0x0db9('0x0'));var util=require(_0x0db9('0x1'));var BPromise=require(_0x0db9('0x2'));var attributes=require(_0x0db9('0x3'));var getUserApplications=function(_0x28ea1b,_0xdac15e,_0x3d5df8){var _0x1ce3f3=0x1;var _0x4cc55e=[];var _0x55b2d3={'context':_0xdac15e[_0x0db9('0x4')]||'from-sip','exten':util[_0x0db9('0x5')](_0x0db9('0x6'),_0x28ea1b['prefix'],_0x3d5df8),'type':_0x0db9('0x7'),'isApp':![],'ChanSpyId':_0x28ea1b['id'],'UserId':_0xdac15e['id']};_0x4cc55e['push'](_['merge']({'app':_0x0db9('0x8'),'appdata':util[_0x0db9('0x5')](_0x0db9('0x9'),_0x0db9('0xa')),'priority':_0x1ce3f3++},_0x55b2d3));if(_0x28ea1b[_0x0db9('0xb')]){_0x4cc55e[_0x0db9('0xc')](_[_0x0db9('0xd')]({'app':_0x0db9('0xe'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x28ea1b['recordingFormat']),'priority':_0x1ce3f3++},_0x55b2d3));}if(_0x28ea1b[_0x0db9('0xf')]){_0x4cc55e[_0x0db9('0xc')](_[_0x0db9('0xd')]({'app':_0x0db9('0x10'),'appdata':_0x28ea1b[_0x0db9('0x11')],'priority':_0x1ce3f3++},_0x55b2d3));}_0x4cc55e['push'](_[_0x0db9('0xd')]({'app':_0x0db9('0x12'),'appdata':util[_0x0db9('0x5')](_0x0db9('0x13'),_0xdac15e[_0x0db9('0x14')],_0x28ea1b[_0x0db9('0x15')]?_0x28ea1b[_0x0db9('0x15')][_0x0db9('0x16')](''):''),'priority':_0x1ce3f3++},_0x55b2d3));if(_0x28ea1b[_0x0db9('0xb')]){_0x4cc55e[_0x0db9('0xc')](_['merge']({'app':_0x0db9('0x17'),'priority':_0x1ce3f3++},_0x55b2d3));}return _0x4cc55e;};var getChanSpyApplications=function(_0x1a167c,_0x2fa47d){var _0x2ff644=[];for(var _0x40c1b3=0x0,_0x5a19b9=0x1;_0x40c1b3<_0x2fa47d[_0x0db9('0x18')];_0x40c1b3++,_0x5a19b9=0x1){_0x2ff644=_0x2ff644[_0x0db9('0x19')](getUserApplications(_0x1a167c,_0x2fa47d[_0x40c1b3],_0x2fa47d[_0x40c1b3]['internal']));if(_0x2fa47d[_0x40c1b3][_0x0db9('0x1a')]!=_0x2fa47d[_0x40c1b3]['name']){_0x2ff644=_0x2ff644[_0x0db9('0x19')](getUserApplications(_0x1a167c,_0x2fa47d[_0x40c1b3],_0x2fa47d[_0x40c1b3][_0x0db9('0x14')]));}}return _0x2ff644;};var getChanSpyPromise=function(_0x43ee96,_0x447d2b){return new BPromise(function(_0x395c9b,_0x2fbd12){return _0x43ee96[_0x0db9('0x1b')][_0x0db9('0x1c')]({'attributes':['id',_0x0db9('0x14'),_0x0db9('0x1a')],'where':{'role':_0x0db9('0x1d'),'chanspy':!![]},'raw':!![]})[_0x0db9('0x1e')](function(_0x3cef7a){if(_0x3cef7a){return _0x395c9b(getChanSpyApplications(_0x447d2b,_0x3cef7a));}return _0x395c9b([]);})['catch'](function(_0x43c0f8){_0x2fbd12(_0x43c0f8);});});};module[_0x0db9('0x1f')]=function(_0x405d5e,_0x3deaa2){var _0x19be7d=_0x405d5e[_0x0db9('0x20')];return _0x405d5e['define'](_0x0db9('0x21'),attributes,{'tableName':_0x0db9('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2942bd,_0x5451ec,_0x5751a2){return getChanSpyPromise(_0x19be7d,_0x2942bd)['then'](function(_0x362a16){if(_0x362a16&&_0x362a16[_0x0db9('0x18')]){return _0x19be7d['VoiceExtension'][_0x0db9('0x23')](_0x362a16);}})[_0x0db9('0x1e')](function(){_0x5751a2();})[_0x0db9('0x24')](function(_0x888e5f){_0x5751a2(_0x888e5f);});},'afterUpdate':function(_0x16c321,_0x3dab4,_0x259d7c){return _0x19be7d[_0x0db9('0x25')][_0x0db9('0x26')]({'where':{'ChanSpyId':_0x16c321['id']}})[_0x0db9('0x1e')](function(){return getChanSpyPromise(_0x19be7d,_0x16c321);})[_0x0db9('0x1e')](function(_0x11e878){if(_0x11e878&&_0x11e878['length']){return _0x19be7d['VoiceExtension'][_0x0db9('0x23')](_0x11e878);}})[_0x0db9('0x1e')](function(){_0x259d7c();})[_0x0db9('0x24')](function(_0x6dec9f){_0x259d7c(_0x6dec9f);});},'afterDestroy':function(_0x50eac9,_0x2a8b78,_0x193108){return _0x19be7d[_0x0db9('0x25')][_0x0db9('0x26')]({'where':{'ChanSpyId':_0x50eac9['id']}})[_0x0db9('0x1e')](function(){_0x193108();})['catch'](function(_0x26773a){_0x193108(_0x26773a);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 7a394f3..bcd2c44 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.rpc.js +++ b/server/api/voiceChanSpy/voiceChanSpy.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7341=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x16842d,_0x4014ac){var _0x3a3847=function(_0x191f43){while(--_0x191f43){_0x16842d['push'](_0x16842d['shift']());}};_0x3a3847(++_0x4014ac);}(_0x7341,0xe4));var _0x1734=function(_0x53e06e,_0x22ae77){_0x53e06e=_0x53e06e-0x0;var _0x8d64d8=_0x7341[_0x53e06e];return _0x8d64d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1734('0x0'));var BPromise=require('bluebird');var rs=require(_0x1734('0x1'));var fs=require('fs');var Redis=require(_0x1734('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1734('0x3'));var logger=require(_0x1734('0x4'))(_0x1734('0x5'));var config=require(_0x1734('0x6'));var jayson=require(_0x1734('0x7'));var client=jayson[_0x1734('0x8')][_0x1734('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c7349,_0x1ca30b,_0x2c223d){return new BPromise(function(_0x45c529,_0x5b8977){return client[_0x1734('0xa')](_0x4c7349,_0x2c223d)['then'](function(_0x56f0d5){logger[_0x1734('0xb')](_0x1734('0xc'),_0x1ca30b,_0x1734('0xd'));logger[_0x1734('0xe')](_0x1734('0xf'),_0x1ca30b,_0x1734('0xd'),JSON[_0x1734('0x10')](_0x56f0d5));if(_0x56f0d5[_0x1734('0x11')]){if(_0x56f0d5[_0x1734('0x11')][_0x1734('0x12')]===0x1f4){logger['error'](_0x1734('0xc'),_0x1ca30b,_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);return _0x5b8977(_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);}logger[_0x1734('0x11')](_0x1734('0xc'),_0x1ca30b,_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);return _0x45c529(_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);}else{logger[_0x1734('0xb')](_0x1734('0xc'),_0x1ca30b,_0x1734('0xd'));_0x45c529(_0x56f0d5[_0x1734('0x14')][_0x1734('0x13')]);}})[_0x1734('0x15')](function(_0x1ea188){logger[_0x1734('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x1ca30b,_0x1ea188);_0x5b8977(_0x1ea188);});});} \ No newline at end of file +var _0x702d=['stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x4fb810,_0x441071){var _0x5c646c=function(_0x3ce080){while(--_0x3ce080){_0x4fb810['push'](_0x4fb810['shift']());}};_0x5c646c(++_0x441071);}(_0x702d,0x147));var _0xd702=function(_0x4c7877,_0x291c0f){_0x4c7877=_0x4c7877-0x0;var _0x1e041b=_0x702d[_0x4c7877];return _0x1e041b;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var moment=require(_0xd702('0x2'));var BPromise=require(_0xd702('0x3'));var rs=require(_0xd702('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd702('0x5'))['db'];var utils=require(_0xd702('0x6'));var logger=require(_0xd702('0x7'))(_0xd702('0x8'));var config=require('../../config/environment');var jayson=require(_0xd702('0x9'));var client=jayson['client'][_0xd702('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a2c03,_0xf4bf4f,_0x5af246){return new BPromise(function(_0x12bb75,_0x53bd02){return client[_0xd702('0xb')](_0x3a2c03,_0x5af246)[_0xd702('0xc')](function(_0x907a9f){logger[_0xd702('0xd')](_0xd702('0xe'),_0xf4bf4f,_0xd702('0xf'));logger[_0xd702('0x10')](_0xd702('0x11'),_0xf4bf4f,_0xd702('0xf'),JSON[_0xd702('0x12')](_0x907a9f));if(_0x907a9f['error']){if(_0x907a9f['error'][_0xd702('0x13')]===0x1f4){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f['error'][_0xd702('0x15')]);return _0x53bd02(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f[_0xd702('0x14')]['message']);return _0x12bb75(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}else{logger['info'](_0xd702('0xe'),_0xf4bf4f,'request\x20sent');_0x12bb75(_0x907a9f[_0xd702('0x16')][_0xd702('0x15')]);}})['catch'](function(_0x2ba791){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x2ba791);_0x53bd02(_0x2ba791);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 5f140e4..160e010 100644 --- a/server/api/voiceContext/index.js +++ b/server/api/voiceContext/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f82=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x136628,_0xdd3206){var _0x35aad7=function(_0x542332){while(--_0x542332){_0x136628['push'](_0x136628['shift']());}};_0x35aad7(++_0xdd3206);}(_0x7f82,0x150));var _0x27f8=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x7f82[_0xea8947];return _0x2455e9;};'use strict';var multer=require(_0x27f8('0x0'));var util=require(_0x27f8('0x1'));var path=require(_0x27f8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x27f8('0x3')]();var fs_extra=require(_0x27f8('0x4'));var auth=require(_0x27f8('0x5'));var interaction=require(_0x27f8('0x6'));var config=require(_0x27f8('0x7'));var controller=require('./voiceContext.controller');router[_0x27f8('0x8')]('/',auth['isAuthenticated'](),controller[_0x27f8('0x9')]);router[_0x27f8('0x8')](_0x27f8('0xa'),auth[_0x27f8('0xb')](),controller[_0x27f8('0xc')]);router[_0x27f8('0xd')]('/',auth[_0x27f8('0xb')](),controller[_0x27f8('0xe')]);router[_0x27f8('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x27f8('0x10')]);router[_0x27f8('0x11')]('/:id',auth[_0x27f8('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x31ee=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x31ee,0x75));var _0xe31e=function(_0x1d7f33,_0x3a5e76){_0x1d7f33=_0x1d7f33-0x0;var _0x1f9ce4=_0x31ee[_0x1d7f33];return _0x1f9ce4;};'use strict';var multer=require(_0xe31e('0x0'));var util=require(_0xe31e('0x1'));var path=require(_0xe31e('0x2'));var timeout=require('connect-timeout');var express=require(_0xe31e('0x3'));var router=express['Router']();var fs_extra=require(_0xe31e('0x4'));var auth=require(_0xe31e('0x5'));var interaction=require(_0xe31e('0x6'));var config=require(_0xe31e('0x7'));var controller=require(_0xe31e('0x8'));router[_0xe31e('0x9')]('/',auth['isAuthenticated'](),controller[_0xe31e('0xa')]);router[_0xe31e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe31e('0xb')]);router[_0xe31e('0xc')]('/',auth[_0xe31e('0xd')](),controller[_0xe31e('0xe')]);router[_0xe31e('0xf')](_0xe31e('0x10'),auth['isAuthenticated'](),controller[_0xe31e('0x11')]);router[_0xe31e('0x12')](_0xe31e('0x10'),auth[_0xe31e('0xd')](),controller[_0xe31e('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 0d84fd7..37f7959 100644 --- a/server/api/voiceContext/voiceContext.attributes.js +++ b/server/api/voiceContext/voiceContext.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8478=['exports','STRING','name','BOOLEAN','sequelize'];(function(_0x26e396,_0x235230){var _0xb28815=function(_0x43e0b4){while(--_0x43e0b4){_0x26e396['push'](_0x26e396['shift']());}};_0xb28815(++_0x235230);}(_0x8478,0x1e4));var _0x8847=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8478[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x8847('0x0'));module[_0x8847('0x1')]={'name':{'type':Sequelize[_0x8847('0x2')],'unique':_0x8847('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x8847('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x63ab=['BOOLEAN','sequelize','exports','STRING'];(function(_0x697a85,_0x238db2){var _0x4a6ba9=function(_0x4e70b7){while(--_0x4e70b7){_0x697a85['push'](_0x697a85['shift']());}};_0x4a6ba9(++_0x238db2);}(_0x63ab,0x14d));var _0xb63a=function(_0xa67244,_0x3abb3b){_0xa67244=_0xa67244-0x0;var _0x3a05e4=_0x63ab[_0xa67244];return _0x3a05e4;};'use strict';var Sequelize=require(_0xb63a('0x0'));module[_0xb63a('0x1')]={'name':{'type':Sequelize[_0xb63a('0x2')],'unique':'name'},'description':{'type':Sequelize[_0xb63a('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xb63a('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 4bf4b6c..446aac0 100644 --- a/server/api/voiceContext/voiceContext.controller.js +++ b/server/api/voiceContext/voiceContext.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5859=['squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','Contexts','UserProfileResource','destroy','stack','name','send','index','map','VoiceContext','rawAttributes','type','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','length','options','create','body','join','root','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','get','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','server/files/templates/context.ejs','utf8','render','Reload','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x488ec2,_0x22fcce){var _0x2519cd=function(_0x547a5c){while(--_0x547a5c){_0x488ec2['push'](_0x488ec2['shift']());}};_0x2519cd(++_0x22fcce);}(_0x5859,0xc4));var _0x9585=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x5859[_0x5c2e3e];return _0x53f64a;};'use strict';var emlformat=require(_0x9585('0x0'));var rimraf=require(_0x9585('0x1'));var zipdir=require(_0x9585('0x2'));var jsonpatch=require(_0x9585('0x3'));var rp=require(_0x9585('0x4'));var moment=require(_0x9585('0x5'));var BPromise=require(_0x9585('0x6'));var Mustache=require(_0x9585('0x7'));var util=require(_0x9585('0x8'));var path=require(_0x9585('0x9'));var sox=require(_0x9585('0xa'));var csv=require(_0x9585('0xb'));var ejs=require(_0x9585('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9585('0xd'));var squel=require(_0x9585('0xe'));var crypto=require(_0x9585('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9585('0x10'));var toCsv=require(_0x9585('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9585('0x11'));var authService=require(_0x9585('0x12'));var qs=require(_0x9585('0x13'));var as=require(_0x9585('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9585('0x15'))('api');var utils=require(_0x9585('0x16'));var config=require(_0x9585('0x17'));var licenseUtil=require(_0x9585('0x18'));var db=require(_0x9585('0x19'))['db'];var jayson=require(_0x9585('0x1a'));var client=jayson[_0x9585('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7d31d1,_0x895b4d,_0x3dc44d,_0x5acfea){return new BPromise(function(_0x2b8d67,_0x278156){var _0x356835=_0x5acfea||client;return _0x356835['request'](_0x7d31d1,_0x3dc44d)[_0x9585('0x1c')](function(_0x44316b){logger['info'](_0x9585('0x1d'),_0x895b4d,'request\x20sent');logger[_0x9585('0x1e')](_0x9585('0x1f'),_0x895b4d,_0x9585('0x20'),JSON['stringify'](_0x44316b));if(_0x44316b[_0x9585('0x21')]){if(_0x44316b[_0x9585('0x21')]['code']===0x1f4){logger[_0x9585('0x21')]('VoiceContext,\x20%s,\x20%s',_0x895b4d,_0x44316b[_0x9585('0x21')]['message']);return _0x278156(_0x44316b[_0x9585('0x21')][_0x9585('0x22')]);}logger[_0x9585('0x21')](_0x9585('0x1d'),_0x895b4d,_0x44316b[_0x9585('0x21')][_0x9585('0x22')]);return _0x2b8d67(_0x44316b['error'][_0x9585('0x22')]);}else{logger[_0x9585('0x23')](_0x9585('0x1d'),_0x895b4d,_0x9585('0x20'));_0x2b8d67(_0x44316b[_0x9585('0x24')][_0x9585('0x22')]);}})['catch'](function(_0x36c868){logger[_0x9585('0x21')](_0x9585('0x1d'),_0x895b4d,_0x36c868);_0x278156(_0x36c868);});});}function respondWithStatusCode(_0x27ef5f,_0x135c71){_0x135c71=_0x135c71||0xcc;return function(_0x347e8d){if(_0x347e8d){return _0x27ef5f[_0x9585('0x25')](_0x135c71);}return _0x27ef5f[_0x9585('0x26')](_0x135c71)[_0x9585('0x27')]();};}function respondWithResult(_0x3afe59,_0xf735dd){_0xf735dd=_0xf735dd||0xc8;return function(_0x265631){if(_0x265631){return _0x3afe59['status'](_0xf735dd)[_0x9585('0x28')](_0x265631);}};}function respondWithFilteredResult(_0xa95ce6,_0x1f5217){return function(_0x1104df){if(_0x1104df){var _0x465c91=typeof _0x1f5217['offset']===_0x9585('0x29')&&typeof _0x1f5217[_0x9585('0x2a')]===_0x9585('0x29');var _0x5ac6c5=_0x1104df[_0x9585('0x2b')];var _0x33dbe7=_0x465c91?0x0:_0x1f5217['offset'];var _0x4d303e=_0x465c91?_0x1104df[_0x9585('0x2b')]:_0x1f5217['offset']+_0x1f5217[_0x9585('0x2a')];var _0x402905;if(_0x4d303e>=_0x5ac6c5){_0x4d303e=_0x5ac6c5;_0x402905=0xc8;}else{_0x402905=0xce;}_0xa95ce6[_0x9585('0x26')](_0x402905);return _0xa95ce6[_0x9585('0x2c')](_0x9585('0x2d'),_0x33dbe7+'-'+_0x4d303e+'/'+_0x5ac6c5)[_0x9585('0x28')](_0x1104df);}return null;};}function patchUpdates(_0x48e59f){return function(_0x29b35e){try{jsonpatch[_0x9585('0x2e')](_0x29b35e,_0x48e59f,!![]);}catch(_0x1b3b0c){return BPromise[_0x9585('0x2f')](_0x1b3b0c);}return _0x29b35e[_0x9585('0x30')]();};}function saveUpdates(_0x32cd9f,_0x736a66){return function(_0x802471){if(_0x802471){return _0x802471[_0x9585('0x31')](_0x32cd9f)['then'](function(_0x28efc9){return _0x28efc9;});}return null;};}function removeEntity(_0x3aab75,_0x424071){return function(_0x406d8b){if(_0x406d8b){return _0x406d8b['destroy']()[_0x9585('0x1c')](function(){var _0x176951=_0x406d8b['get']({'plain':!![]});var _0x3c7c56=_0x9585('0x32');return db[_0x9585('0x33')][_0x9585('0x34')]({'where':{'type':_0x3c7c56,'resourceId':_0x176951['id']}})['then'](function(){return _0x406d8b;});})[_0x9585('0x1c')](function(){_0x3aab75[_0x9585('0x26')](0xcc)[_0x9585('0x27')]();});}};}function handleEntityNotFound(_0x546a6c,_0x25f7f5){return function(_0x2b7b69){if(!_0x2b7b69){_0x546a6c['sendStatus'](0x194);}return _0x2b7b69;};}function handleError(_0x249d63,_0x2c093a){_0x2c093a=_0x2c093a||0x1f4;return function(_0x3be2fd){logger[_0x9585('0x21')](_0x3be2fd[_0x9585('0x35')]);if(_0x3be2fd[_0x9585('0x36')]){delete _0x3be2fd[_0x9585('0x36')];}_0x249d63[_0x9585('0x26')](_0x2c093a)[_0x9585('0x37')](_0x3be2fd);};}exports[_0x9585('0x38')]=function(_0x42046e,_0x34d274){var _0x5a90c9={},_0x16cabe={},_0x276f0b={'count':0x0,'rows':[]};var _0x428950=_[_0x9585('0x39')](db[_0x9585('0x3a')][_0x9585('0x3b')],function(_0x9a3c3e){return{'name':_0x9a3c3e['fieldName'],'type':_0x9a3c3e[_0x9585('0x3c')][_0x9585('0x3d')]};});_0x16cabe[_0x9585('0x3e')]=_[_0x9585('0x39')](_0x428950,_0x9585('0x36'));_0x16cabe[_0x9585('0x3f')]=_[_0x9585('0x40')](_0x42046e[_0x9585('0x3f')]);_0x16cabe['filters']=_[_0x9585('0x41')](_0x16cabe[_0x9585('0x3e')],_0x16cabe[_0x9585('0x3f')]);_0x5a90c9['attributes']=_[_0x9585('0x41')](_0x16cabe[_0x9585('0x3e')],qs['fields'](_0x42046e[_0x9585('0x3f')]['fields']));_0x5a90c9['attributes']=_0x5a90c9[_0x9585('0x42')]['length']?_0x5a90c9[_0x9585('0x42')]:_0x16cabe[_0x9585('0x3e')];if(!_0x42046e[_0x9585('0x3f')][_0x9585('0x43')](_0x9585('0x44'))){_0x5a90c9[_0x9585('0x2a')]=qs[_0x9585('0x2a')](_0x42046e['query']['limit']);_0x5a90c9[_0x9585('0x45')]=qs[_0x9585('0x45')](_0x42046e['query'][_0x9585('0x45')]);}_0x5a90c9[_0x9585('0x46')]=qs[_0x9585('0x47')](_0x42046e[_0x9585('0x3f')][_0x9585('0x47')]);_0x5a90c9[_0x9585('0x48')]=qs['filters'](_[_0x9585('0x49')](_0x42046e[_0x9585('0x3f')],_0x16cabe['filters']),_0x428950);if(_0x42046e[_0x9585('0x3f')][_0x9585('0x4a')]){_0x5a90c9[_0x9585('0x48')]=_[_0x9585('0x4b')](_0x5a90c9['where'],{'$or':_[_0x9585('0x39')](_0x428950,function(_0xbb138){if(_0xbb138[_0x9585('0x3c')]!==_0x9585('0x4c')){var _0x3dbc2a={};_0x3dbc2a[_0xbb138[_0x9585('0x36')]]={'$like':'%'+_0x42046e[_0x9585('0x3f')][_0x9585('0x4a')]+'%'};return _0x3dbc2a;}})});}_0x5a90c9=_[_0x9585('0x4b')]({},_0x5a90c9,_0x42046e['options']);var _0x3f26fd={'where':_0x5a90c9['where']};return db[_0x9585('0x3a')][_0x9585('0x2b')](_0x3f26fd)[_0x9585('0x1c')](function(_0x6485b2){_0x276f0b['count']=_0x6485b2;if(_0x42046e['query'][_0x9585('0x4d')]){_0x5a90c9[_0x9585('0x4e')]=[{'all':!![]}];}return db[_0x9585('0x3a')][_0x9585('0x4f')](_0x5a90c9);})[_0x9585('0x1c')](function(_0x21271b){_0x276f0b[_0x9585('0x50')]=_0x21271b;return _0x276f0b;})[_0x9585('0x1c')](respondWithFilteredResult(_0x34d274,_0x5a90c9))[_0x9585('0x51')](handleError(_0x34d274,null));};exports[_0x9585('0x52')]=function(_0x5ec0ca,_0x528882){var _0x4c614b={'raw':![],'where':{'id':_0x5ec0ca[_0x9585('0x53')]['id']}},_0x46272f={};_0x46272f['model']=_[_0x9585('0x40')](db[_0x9585('0x3a')][_0x9585('0x3b')]);_0x46272f[_0x9585('0x3f')]=_[_0x9585('0x40')](_0x5ec0ca[_0x9585('0x3f')]);_0x46272f['filters']=_[_0x9585('0x41')](_0x46272f['model'],_0x46272f[_0x9585('0x3f')]);_0x4c614b[_0x9585('0x42')]=_['intersection'](_0x46272f[_0x9585('0x3e')],qs[_0x9585('0x54')](_0x5ec0ca[_0x9585('0x3f')]['fields']));_0x4c614b[_0x9585('0x42')]=_0x4c614b[_0x9585('0x42')][_0x9585('0x55')]?_0x4c614b['attributes']:_0x46272f[_0x9585('0x3e')];if(_0x5ec0ca['query'][_0x9585('0x4d')]){_0x4c614b['include']=[{'all':!![]}];}_0x4c614b=_[_0x9585('0x4b')]({},_0x4c614b,_0x5ec0ca[_0x9585('0x56')]);return db[_0x9585('0x3a')]['find'](_0x4c614b)[_0x9585('0x1c')](handleEntityNotFound(_0x528882,null))[_0x9585('0x1c')](respondWithResult(_0x528882,null))['catch'](handleError(_0x528882,null));};exports[_0x9585('0x57')]=function(_0x40042a,_0x3e5f54,_0x5d2d62){var _0x336541;return db['VoiceContext'][_0x9585('0x57')](_0x40042a[_0x9585('0x58')],{'raw':!![]})['then'](function(_0x3679df){_0x336541=_0x3679df;return db['VoiceContext']['findAll']({'raw':!![]});})[_0x9585('0x1c')](function(_0x317c39){var _0x9de665=fs['readFileSync'](path[_0x9585('0x59')](config[_0x9585('0x5a')],'server/files/templates/context.ejs'),'utf8');var _0x40eb82=ejs['render'](_0x9de665,{'contexts':_0x317c39||[]});fs[_0x9585('0x5b')](_0x9585('0x5c'),_0x40eb82);})['then'](function(){return respondWithRpcPromise('Reload',_0x9585('0x57'),{'module':_0x9585('0x5d')});})['then'](function(){var _0x46548f=_0x40042a['user'][_0x9585('0x5e')]({'plain':!![]});if(!_0x46548f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46548f[_0x9585('0x5f')]==='user'){var _0x510175=_0x336541[_0x9585('0x5e')]({'plain':!![]});return db[_0x9585('0x60')][_0x9585('0x61')]({'where':{'name':'Contexts','userProfileId':_0x46548f['userProfileId']},'raw':!![]})[_0x9585('0x1c')](function(_0x2a2375){if(_0x2a2375&&_0x2a2375[_0x9585('0x62')]===0x0){return db['UserProfileResource'][_0x9585('0x57')]({'name':_0x510175[_0x9585('0x36')],'resourceId':_0x510175['id'],'type':_0x2a2375[_0x9585('0x36')],'sectionId':_0x2a2375['id']},{})[_0x9585('0x1c')](function(){return _0x336541;});}else{return _0x336541;}})[_0x9585('0x51')](function(_0x3feb13){logger[_0x9585('0x21')](_0x9585('0x63'),_0x3feb13);throw _0x3feb13;});}return _0x336541;})[_0x9585('0x1c')](respondWithResult(_0x3e5f54,0xc9))[_0x9585('0x51')](handleError(_0x3e5f54,null));};exports[_0x9585('0x31')]=function(_0x5500ab,_0xc4e78,_0x53b155){var _0x19ce15;return db[_0x9585('0x3a')]['find']({'where':{'id':_0x5500ab[_0x9585('0x53')]['id']}})[_0x9585('0x1c')](handleEntityNotFound(_0xc4e78,null))['then'](saveUpdates(_0x5500ab['body'],null))[_0x9585('0x1c')](function(_0x39a6de){if(_0x39a6de){_0x19ce15=_0x39a6de;return db['VoiceContext']['findAll']({'raw':!![]});}})['then'](function(_0x1bd651){var _0x411892=fs[_0x9585('0x64')](path[_0x9585('0x59')](config[_0x9585('0x5a')],_0x9585('0x65')),_0x9585('0x66'));var _0x1abb5c=ejs[_0x9585('0x67')](_0x411892,{'contexts':_0x1bd651||[]});fs[_0x9585('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x1abb5c);})[_0x9585('0x1c')](function(){return respondWithRpcPromise(_0x9585('0x68'),'update',{'module':_0x9585('0x5d')});})[_0x9585('0x1c')](function(){return _0x19ce15;})[_0x9585('0x1c')](respondWithResult(_0xc4e78,null))[_0x9585('0x51')](handleError(_0xc4e78,null));};exports[_0x9585('0x34')]=function(_0x33bd4f,_0x50140b,_0x53ced2){var _0x1b9e49;return db[_0x9585('0x3a')][_0x9585('0x61')]({'where':{'id':_0x33bd4f['params']['id']}})[_0x9585('0x1c')](handleEntityNotFound(_0x50140b,null))[_0x9585('0x1c')](removeEntity(_0x50140b,null))[_0x9585('0x1c')](function(){return db[_0x9585('0x3a')][_0x9585('0x4f')]({'raw':!![]});})[_0x9585('0x1c')](function(_0x4f1e4a){var _0x2723f8=fs[_0x9585('0x64')](path[_0x9585('0x59')](config[_0x9585('0x5a')],'server/files/templates/context.ejs'),'utf8');var _0x209787=ejs[_0x9585('0x67')](_0x2723f8,{'contexts':_0x4f1e4a});fs['writeFileSync'](_0x9585('0x5c'),_0x209787);return respondWithRpcPromise(_0x9585('0x68'),_0x9585('0x34'),{'module':_0x9585('0x5d')});})[_0x9585('0x51')](handleError(_0x50140b,null));}; \ No newline at end of file +var _0xfc9e=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','Contexts','UserProfileResource','end','stack','name','index','map','VoiceContext','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','/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','update','writeFileSync','chan_sip.so','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','lodash','jsforce','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','debug','request\x20sent','stringify','error','message','VoiceContext,\x20%s,\x20%s','result','catch','sendStatus'];(function(_0x1b1a88,_0x18a8fe){var _0x2de49b=function(_0x4fdabc){while(--_0x4fdabc){_0x1b1a88['push'](_0x1b1a88['shift']());}};_0x2de49b(++_0x18a8fe);}(_0xfc9e,0x110));var _0xefc9=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xfc9e[_0x1b6186];return _0x186121;};'use strict';var emlformat=require(_0xefc9('0x0'));var rimraf=require(_0xefc9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xefc9('0x2'));var moment=require(_0xefc9('0x3'));var BPromise=require(_0xefc9('0x4'));var Mustache=require('mustache');var util=require(_0xefc9('0x5'));var path=require(_0xefc9('0x6'));var sox=require(_0xefc9('0x7'));var csv=require('to-csv');var ejs=require(_0xefc9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xefc9('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xefc9('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xefc9('0xb'));var querystring=require(_0xefc9('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xefc9('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xefc9('0xe'));var logger=require(_0xefc9('0xf'))(_0xefc9('0x10'));var utils=require(_0xefc9('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xefc9('0x12'));var db=require(_0xefc9('0x13'))['db'];var jayson=require(_0xefc9('0x14'));var client=jayson['client'][_0xefc9('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x1210e0,_0x30f4cc,_0x2bb1d8,_0x35f945){return new BPromise(function(_0x47ba0a,_0x2b81ee){var _0x315e46=_0x35f945||client;return _0x315e46[_0xefc9('0x16')](_0x1210e0,_0x2bb1d8)[_0xefc9('0x17')](function(_0x4e345e){logger[_0xefc9('0x18')]('VoiceContext,\x20%s,\x20%s',_0x30f4cc,'request\x20sent');logger[_0xefc9('0x19')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x30f4cc,_0xefc9('0x1a'),JSON[_0xefc9('0x1b')](_0x4e345e));if(_0x4e345e[_0xefc9('0x1c')]){if(_0x4e345e['error']['code']===0x1f4){logger[_0xefc9('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x30f4cc,_0x4e345e[_0xefc9('0x1c')][_0xefc9('0x1d')]);return _0x2b81ee(_0x4e345e[_0xefc9('0x1c')][_0xefc9('0x1d')]);}logger[_0xefc9('0x1c')](_0xefc9('0x1e'),_0x30f4cc,_0x4e345e['error'][_0xefc9('0x1d')]);return _0x47ba0a(_0x4e345e[_0xefc9('0x1c')]['message']);}else{logger[_0xefc9('0x18')](_0xefc9('0x1e'),_0x30f4cc,_0xefc9('0x1a'));_0x47ba0a(_0x4e345e[_0xefc9('0x1f')]['message']);}})[_0xefc9('0x20')](function(_0xbef17d){logger['error'](_0xefc9('0x1e'),_0x30f4cc,_0xbef17d);_0x2b81ee(_0xbef17d);});});}function respondWithStatusCode(_0x18610b,_0x2918f0){_0x2918f0=_0x2918f0||0xcc;return function(_0x2b3208){if(_0x2b3208){return _0x18610b[_0xefc9('0x21')](_0x2918f0);}return _0x18610b[_0xefc9('0x22')](_0x2918f0)['end']();};}function respondWithResult(_0x36bbe0,_0x44d72a){_0x44d72a=_0x44d72a||0xc8;return function(_0x41e20c){if(_0x41e20c){return _0x36bbe0[_0xefc9('0x22')](_0x44d72a)[_0xefc9('0x23')](_0x41e20c);}};}function respondWithFilteredResult(_0x131346,_0x4915b1){return function(_0x39ab83){if(_0x39ab83){var _0x1bba8e=typeof _0x4915b1[_0xefc9('0x24')]===_0xefc9('0x25')&&typeof _0x4915b1[_0xefc9('0x26')]==='undefined';var _0x4c8ec7=_0x39ab83['count'];var _0x3d075e=_0x1bba8e?0x0:_0x4915b1['offset'];var _0x3443dd=_0x1bba8e?_0x39ab83[_0xefc9('0x27')]:_0x4915b1['offset']+_0x4915b1['limit'];var _0x5c6b06;if(_0x3443dd>=_0x4c8ec7){_0x3443dd=_0x4c8ec7;_0x5c6b06=0xc8;}else{_0x5c6b06=0xce;}_0x131346[_0xefc9('0x22')](_0x5c6b06);return _0x131346[_0xefc9('0x28')](_0xefc9('0x29'),_0x3d075e+'-'+_0x3443dd+'/'+_0x4c8ec7)[_0xefc9('0x23')](_0x39ab83);}return null;};}function patchUpdates(_0x1fabb1){return function(_0x244e89){try{jsonpatch[_0xefc9('0x2a')](_0x244e89,_0x1fabb1,!![]);}catch(_0x421afc){return BPromise[_0xefc9('0x2b')](_0x421afc);}return _0x244e89[_0xefc9('0x2c')]();};}function saveUpdates(_0x1038d7,_0xc80bd5){return function(_0x3a2279){if(_0x3a2279){return _0x3a2279['update'](_0x1038d7)[_0xefc9('0x17')](function(_0x227528){return _0x227528;});}return null;};}function removeEntity(_0x4b6dd9,_0x308a60){return function(_0x4be115){if(_0x4be115){return _0x4be115[_0xefc9('0x2d')]()[_0xefc9('0x17')](function(){var _0x7ae148=_0x4be115[_0xefc9('0x2e')]({'plain':!![]});var _0x4f221b=_0xefc9('0x2f');return db[_0xefc9('0x30')]['destroy']({'where':{'type':_0x4f221b,'resourceId':_0x7ae148['id']}})[_0xefc9('0x17')](function(){return _0x4be115;});})[_0xefc9('0x17')](function(){_0x4b6dd9[_0xefc9('0x22')](0xcc)[_0xefc9('0x31')]();});}};}function handleEntityNotFound(_0x564898,_0x56f915){return function(_0x47754b){if(!_0x47754b){_0x564898[_0xefc9('0x21')](0x194);}return _0x47754b;};}function handleError(_0x4c4afc,_0x340f9b){_0x340f9b=_0x340f9b||0x1f4;return function(_0x5a34f5){logger[_0xefc9('0x1c')](_0x5a34f5[_0xefc9('0x32')]);if(_0x5a34f5[_0xefc9('0x33')]){delete _0x5a34f5[_0xefc9('0x33')];}_0x4c4afc[_0xefc9('0x22')](_0x340f9b)['send'](_0x5a34f5);};}exports[_0xefc9('0x34')]=function(_0x1f571e,_0x15fba6){var _0x5be854={},_0x141910={},_0xfc77a4={'count':0x0,'rows':[]};var _0xd0a1b6=_[_0xefc9('0x35')](db[_0xefc9('0x36')][_0xefc9('0x37')],function(_0x3dc021){return{'name':_0x3dc021[_0xefc9('0x38')],'type':_0x3dc021['type'][_0xefc9('0x39')]};});_0x141910['model']=_[_0xefc9('0x35')](_0xd0a1b6,'name');_0x141910[_0xefc9('0x3a')]=_[_0xefc9('0x3b')](_0x1f571e['query']);_0x141910[_0xefc9('0x3c')]=_[_0xefc9('0x3d')](_0x141910['model'],_0x141910[_0xefc9('0x3a')]);_0x5be854[_0xefc9('0x3e')]=_[_0xefc9('0x3d')](_0x141910['model'],qs[_0xefc9('0x3f')](_0x1f571e[_0xefc9('0x3a')]['fields']));_0x5be854['attributes']=_0x5be854[_0xefc9('0x3e')][_0xefc9('0x40')]?_0x5be854[_0xefc9('0x3e')]:_0x141910[_0xefc9('0x41')];if(!_0x1f571e[_0xefc9('0x3a')][_0xefc9('0x42')](_0xefc9('0x43'))){_0x5be854[_0xefc9('0x26')]=qs[_0xefc9('0x26')](_0x1f571e[_0xefc9('0x3a')][_0xefc9('0x26')]);_0x5be854[_0xefc9('0x24')]=qs[_0xefc9('0x24')](_0x1f571e[_0xefc9('0x3a')][_0xefc9('0x24')]);}_0x5be854['order']=qs[_0xefc9('0x44')](_0x1f571e[_0xefc9('0x3a')][_0xefc9('0x44')]);_0x5be854[_0xefc9('0x45')]=qs['filters'](_[_0xefc9('0x46')](_0x1f571e['query'],_0x141910[_0xefc9('0x3c')]),_0xd0a1b6);if(_0x1f571e['query'][_0xefc9('0x47')]){_0x5be854[_0xefc9('0x45')]=_[_0xefc9('0x48')](_0x5be854[_0xefc9('0x45')],{'$or':_[_0xefc9('0x35')](_0xd0a1b6,function(_0xfb3029){if(_0xfb3029[_0xefc9('0x49')]!==_0xefc9('0x4a')){var _0x1ee9aa={};_0x1ee9aa[_0xfb3029[_0xefc9('0x33')]]={'$like':'%'+_0x1f571e[_0xefc9('0x3a')][_0xefc9('0x47')]+'%'};return _0x1ee9aa;}})});}_0x5be854=_[_0xefc9('0x48')]({},_0x5be854,_0x1f571e[_0xefc9('0x4b')]);var _0xeb8f6f={'where':_0x5be854[_0xefc9('0x45')]};return db['VoiceContext']['count'](_0xeb8f6f)[_0xefc9('0x17')](function(_0x5b6edc){_0xfc77a4[_0xefc9('0x27')]=_0x5b6edc;if(_0x1f571e[_0xefc9('0x3a')][_0xefc9('0x4c')]){_0x5be854[_0xefc9('0x4d')]=[{'all':!![]}];}return db[_0xefc9('0x36')][_0xefc9('0x4e')](_0x5be854);})[_0xefc9('0x17')](function(_0x13bd7c){_0xfc77a4['rows']=_0x13bd7c;return _0xfc77a4;})['then'](respondWithFilteredResult(_0x15fba6,_0x5be854))[_0xefc9('0x20')](handleError(_0x15fba6,null));};exports[_0xefc9('0x4f')]=function(_0x42d0e9,_0x43a157){var _0x3f5bf5={'raw':![],'where':{'id':_0x42d0e9[_0xefc9('0x50')]['id']}},_0x48777d={};_0x48777d[_0xefc9('0x41')]=_[_0xefc9('0x3b')](db[_0xefc9('0x36')]['rawAttributes']);_0x48777d[_0xefc9('0x3a')]=_['keys'](_0x42d0e9[_0xefc9('0x3a')]);_0x48777d[_0xefc9('0x3c')]=_[_0xefc9('0x3d')](_0x48777d['model'],_0x48777d['query']);_0x3f5bf5[_0xefc9('0x3e')]=_[_0xefc9('0x3d')](_0x48777d[_0xefc9('0x41')],qs['fields'](_0x42d0e9[_0xefc9('0x3a')][_0xefc9('0x3f')]));_0x3f5bf5[_0xefc9('0x3e')]=_0x3f5bf5[_0xefc9('0x3e')][_0xefc9('0x40')]?_0x3f5bf5[_0xefc9('0x3e')]:_0x48777d[_0xefc9('0x41')];if(_0x42d0e9[_0xefc9('0x3a')][_0xefc9('0x4c')]){_0x3f5bf5[_0xefc9('0x4d')]=[{'all':!![]}];}_0x3f5bf5=_[_0xefc9('0x48')]({},_0x3f5bf5,_0x42d0e9['options']);return db[_0xefc9('0x36')][_0xefc9('0x51')](_0x3f5bf5)['then'](handleEntityNotFound(_0x43a157,null))[_0xefc9('0x17')](respondWithResult(_0x43a157,null))[_0xefc9('0x20')](handleError(_0x43a157,null));};exports[_0xefc9('0x52')]=function(_0x26b300,_0x295ad3,_0x1514de){var _0x41979f;return db[_0xefc9('0x36')][_0xefc9('0x52')](_0x26b300[_0xefc9('0x53')],{'raw':!![]})[_0xefc9('0x17')](function(_0x4c7698){_0x41979f=_0x4c7698;return db['VoiceContext'][_0xefc9('0x4e')]({'raw':!![]});})['then'](function(_0x6d122){var _0x1955c0=fs[_0xefc9('0x54')](path[_0xefc9('0x55')](config[_0xefc9('0x56')],_0xefc9('0x57')),_0xefc9('0x58'));var _0x118150=ejs[_0xefc9('0x59')](_0x1955c0,{'contexts':_0x6d122||[]});fs['writeFileSync'](_0xefc9('0x5a'),_0x118150);})['then'](function(){return respondWithRpcPromise(_0xefc9('0x5b'),_0xefc9('0x52'),{'module':'chan_sip.so'});})[_0xefc9('0x17')](function(){var _0x3c8c18=_0x26b300['user'][_0xefc9('0x2e')]({'plain':!![]});if(!_0x3c8c18)throw new Error(_0xefc9('0x5c'));if(_0x3c8c18[_0xefc9('0x5d')]===_0xefc9('0x5e')){var _0x37e696=_0x41979f['get']({'plain':!![]});return db[_0xefc9('0x5f')][_0xefc9('0x51')]({'where':{'name':'Contexts','userProfileId':_0x3c8c18[_0xefc9('0x60')]},'raw':!![]})['then'](function(_0x2d4bae){if(_0x2d4bae&&_0x2d4bae[_0xefc9('0x61')]===0x0){return db[_0xefc9('0x30')][_0xefc9('0x52')]({'name':_0x37e696[_0xefc9('0x33')],'resourceId':_0x37e696['id'],'type':_0x2d4bae[_0xefc9('0x33')],'sectionId':_0x2d4bae['id']},{})['then'](function(){return _0x41979f;});}else{return _0x41979f;}})['catch'](function(_0x2ecc8f){logger[_0xefc9('0x1c')](_0xefc9('0x62'),_0x2ecc8f);throw _0x2ecc8f;});}return _0x41979f;})['then'](respondWithResult(_0x295ad3,0xc9))[_0xefc9('0x20')](handleError(_0x295ad3,null));};exports['update']=function(_0x3ad470,_0x9d5dfa,_0x15d4f1){var _0x1504b9;return db[_0xefc9('0x36')][_0xefc9('0x51')]({'where':{'id':_0x3ad470[_0xefc9('0x50')]['id']}})[_0xefc9('0x17')](handleEntityNotFound(_0x9d5dfa,null))[_0xefc9('0x17')](saveUpdates(_0x3ad470[_0xefc9('0x53')],null))[_0xefc9('0x17')](function(_0x31a101){if(_0x31a101){_0x1504b9=_0x31a101;return db[_0xefc9('0x36')][_0xefc9('0x4e')]({'raw':!![]});}})[_0xefc9('0x17')](function(_0x1ae376){var _0x535050=fs[_0xefc9('0x54')](path[_0xefc9('0x55')](config[_0xefc9('0x56')],_0xefc9('0x57')),_0xefc9('0x58'));var _0x51c7bd=ejs['render'](_0x535050,{'contexts':_0x1ae376||[]});fs['writeFileSync'](_0xefc9('0x5a'),_0x51c7bd);})['then'](function(){return respondWithRpcPromise('Reload',_0xefc9('0x63'),{'module':'chan_sip.so'});})[_0xefc9('0x17')](function(){return _0x1504b9;})['then'](respondWithResult(_0x9d5dfa,null))[_0xefc9('0x20')](handleError(_0x9d5dfa,null));};exports['destroy']=function(_0x6b5ec4,_0x29831a,_0x15b19c){var _0x22b3ba;return db[_0xefc9('0x36')][_0xefc9('0x51')]({'where':{'id':_0x6b5ec4['params']['id']}})[_0xefc9('0x17')](handleEntityNotFound(_0x29831a,null))['then'](removeEntity(_0x29831a,null))[_0xefc9('0x17')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0xefc9('0x17')](function(_0x5f1a58){var _0x33367e=fs['readFileSync'](path['join'](config['root'],_0xefc9('0x57')),_0xefc9('0x58'));var _0x3c5c16=ejs[_0xefc9('0x59')](_0x33367e,{'contexts':_0x5f1a58});fs[_0xefc9('0x64')](_0xefc9('0x5a'),_0x3c5c16);return respondWithRpcPromise(_0xefc9('0x5b'),_0xefc9('0x2d'),{'module':_0xefc9('0x65')});})['catch'](handleError(_0x29831a,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 7a8de1e..0e8eccd 100644 --- a/server/api/voiceContext/voiceContext.model.js +++ b/server/api/voiceContext/voiceContext.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5990=['util','../../config/logger','api','path','rimraf','../../config/environment','exports','define','VoiceContext','voice_contexts','lodash'];(function(_0x3cdf0f,_0x32c761){var _0x173c21=function(_0xba83db){while(--_0xba83db){_0x3cdf0f['push'](_0x3cdf0f['shift']());}};_0x173c21(++_0x32c761);}(_0x5990,0x1a1));var _0x0599=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5990[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0599('0x0'));var util=require(_0x0599('0x1'));var logger=require(_0x0599('0x2'))(_0x0599('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0599('0x4'));var rimraf=require(_0x0599('0x5'));var config=require(_0x0599('0x6'));var attributes=require('./voiceContext.attributes');module[_0x0599('0x7')]=function(_0x459008,_0x3decd8){return _0x459008[_0x0599('0x8')](_0x0599('0x9'),attributes,{'tableName':_0x0599('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7f3=['request-promise','path','../../config/environment','./voiceContext.attributes','exports','define','voice_contexts','../../config/logger','api','moment','bluebird'];(function(_0x245386,_0x391e32){var _0x5cfacb=function(_0x5458e5){while(--_0x5458e5){_0x245386['push'](_0x245386['shift']());}};_0x5cfacb(++_0x391e32);}(_0xa7f3,0x1e0));var _0x3a7f=function(_0x2f20f8,_0x54a3f2){_0x2f20f8=_0x2f20f8-0x0;var _0xfcb1b7=_0xa7f3[_0x2f20f8];return _0xfcb1b7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3a7f('0x0'))(_0x3a7f('0x1'));var moment=require(_0x3a7f('0x2'));var BPromise=require(_0x3a7f('0x3'));var rp=require(_0x3a7f('0x4'));var fs=require('fs');var path=require(_0x3a7f('0x5'));var rimraf=require('rimraf');var config=require(_0x3a7f('0x6'));var attributes=require(_0x3a7f('0x7'));module[_0x3a7f('0x8')]=function(_0x11297b,_0x8e90e9){return _0x11297b[_0x3a7f('0x9')]('VoiceContext',attributes,{'tableName':_0x3a7f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 427bf58..32b2fd5 100644 --- a/server/api/voiceContext/voiceContext.rpc.js +++ b/server/api/voiceContext/voiceContext.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9a7=['request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceContext,\x20%s,\x20%s'];(function(_0x4f75b5,_0x4db76d){var _0x5c263b=function(_0x31e622){while(--_0x31e622){_0x4f75b5['push'](_0x4f75b5['shift']());}};_0x5c263b(++_0x4db76d);}(_0xb9a7,0x112));var _0x7b9a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xb9a7[_0x1694f5];return _0x5b4321;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b9a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b9a('0x2'));var logger=require(_0x7b9a('0x3'))(_0x7b9a('0x4'));var config=require(_0x7b9a('0x5'));var jayson=require(_0x7b9a('0x6'));var client=jayson[_0x7b9a('0x7')][_0x7b9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7019fd,_0x37ce81,_0x3e51f0){return new BPromise(function(_0x4d3f20,_0x43d8e2){return client[_0x7b9a('0x9')](_0x7019fd,_0x3e51f0)['then'](function(_0x511e28){logger['info'](_0x7b9a('0xa'),_0x37ce81,_0x7b9a('0xb'));logger['debug'](_0x7b9a('0xc'),_0x37ce81,'request\x20sent',JSON[_0x7b9a('0xd')](_0x511e28));if(_0x511e28['error']){if(_0x511e28[_0x7b9a('0xe')][_0x7b9a('0xf')]===0x1f4){logger[_0x7b9a('0xe')]('VoiceContext,\x20%s,\x20%s',_0x37ce81,_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);return _0x43d8e2(_0x511e28['error'][_0x7b9a('0x10')]);}logger[_0x7b9a('0xe')]('VoiceContext,\x20%s,\x20%s',_0x37ce81,_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);return _0x4d3f20(_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);}else{logger[_0x7b9a('0x11')](_0x7b9a('0xa'),_0x37ce81,_0x7b9a('0xb'));_0x4d3f20(_0x511e28[_0x7b9a('0x12')][_0x7b9a('0x10')]);}})['catch'](function(_0x34a82d){logger['error'](_0x7b9a('0xa'),_0x37ce81,_0x34a82d);_0x43d8e2(_0x34a82d);});});} \ No newline at end of file +var _0x6da1=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x2abaae,_0x29fd8b){var _0x5b5745=function(_0x2f6218){while(--_0x2f6218){_0x2abaae['push'](_0x2abaae['shift']());}};_0x5b5745(++_0x29fd8b);}(_0x6da1,0x1b8));var _0x16da=function(_0x121b1a,_0x42fdb7){_0x121b1a=_0x121b1a-0x0;var _0x2d89a6=_0x6da1[_0x121b1a];return _0x2d89a6;};'use strict';var _=require('lodash');var util=require(_0x16da('0x0'));var moment=require('moment');var BPromise=require(_0x16da('0x1'));var rs=require(_0x16da('0x2'));var fs=require('fs');var Redis=require(_0x16da('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x16da('0x4'));var logger=require(_0x16da('0x5'))('rpc');var config=require(_0x16da('0x6'));var jayson=require(_0x16da('0x7'));var client=jayson[_0x16da('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4aa4b0,_0x414b10,_0x9ced5c){return new BPromise(function(_0x12df0e,_0x4410d0){return client['request'](_0x4aa4b0,_0x9ced5c)[_0x16da('0x9')](function(_0x495f89){logger[_0x16da('0xa')](_0x16da('0xb'),_0x414b10,_0x16da('0xc'));logger[_0x16da('0xd')](_0x16da('0xe'),_0x414b10,_0x16da('0xc'),JSON[_0x16da('0xf')](_0x495f89));if(_0x495f89[_0x16da('0x10')]){if(_0x495f89[_0x16da('0x10')][_0x16da('0x11')]===0x1f4){logger[_0x16da('0x10')]('VoiceContext,\x20%s,\x20%s',_0x414b10,_0x495f89['error']['message']);return _0x4410d0(_0x495f89[_0x16da('0x10')][_0x16da('0x12')]);}logger[_0x16da('0x10')]('VoiceContext,\x20%s,\x20%s',_0x414b10,_0x495f89[_0x16da('0x10')][_0x16da('0x12')]);return _0x12df0e(_0x495f89[_0x16da('0x10')]['message']);}else{logger[_0x16da('0xa')](_0x16da('0xb'),_0x414b10,_0x16da('0xc'));_0x12df0e(_0x495f89[_0x16da('0x13')]['message']);}})[_0x16da('0x14')](function(_0x30e761){logger[_0x16da('0x10')](_0x16da('0xb'),_0x414b10,_0x30e761);_0x4410d0(_0x30e761);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index eca94f1..be9b4cb 100644 --- a/server/api/voiceDialReport/index.js +++ b/server/api/voiceDialReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc196=['../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1d426f,_0x37e919){var _0x17f71a=function(_0x3bf60c){while(--_0x3bf60c){_0x1d426f['push'](_0x1d426f['shift']());}};_0x17f71a(++_0x37e919);}(_0xc196,0x1bc));var _0x6c19=function(_0x20ec2e,_0x1a6f1e){_0x20ec2e=_0x20ec2e-0x0;var _0x155d73=_0xc196[_0x20ec2e];return _0x155d73;};'use strict';var multer=require(_0x6c19('0x0'));var util=require(_0x6c19('0x1'));var path=require(_0x6c19('0x2'));var timeout=require(_0x6c19('0x3'));var express=require(_0x6c19('0x4'));var router=express[_0x6c19('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6c19('0x6'));var config=require(_0x6c19('0x7'));var controller=require(_0x6c19('0x8'));router[_0x6c19('0x9')]('/',auth[_0x6c19('0xa')](),controller['index']);router[_0x6c19('0x9')](_0x6c19('0xb'),auth[_0x6c19('0xa')](),controller['describe']);router[_0x6c19('0x9')](_0x6c19('0xc'),auth['isAuthenticated'](),controller[_0x6c19('0xd')]);router[_0x6c19('0xe')]('/',auth['isAuthenticated'](),controller[_0x6c19('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x6c19('0xc'),auth[_0x6c19('0xa')](),controller[_0x6c19('0x10')]);module[_0x6c19('0x11')]=router; \ No newline at end of file +var _0xcbdd=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xcbdd,0xec));var _0xdcbd=function(_0x12edeb,_0x3f5e5e){_0x12edeb=_0x12edeb-0x0;var _0x2905e7=_0xcbdd[_0x12edeb];return _0x2905e7;};'use strict';var multer=require(_0xdcbd('0x0'));var util=require('util');var path=require(_0xdcbd('0x1'));var timeout=require(_0xdcbd('0x2'));var express=require(_0xdcbd('0x3'));var router=express['Router']();var fs_extra=require(_0xdcbd('0x4'));var auth=require(_0xdcbd('0x5'));var interaction=require(_0xdcbd('0x6'));var config=require('../../config/environment');var controller=require(_0xdcbd('0x7'));router['get']('/',auth[_0xdcbd('0x8')](),controller[_0xdcbd('0x9')]);router[_0xdcbd('0xa')](_0xdcbd('0xb'),auth[_0xdcbd('0x8')](),controller[_0xdcbd('0xc')]);router[_0xdcbd('0xa')](_0xdcbd('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xdcbd('0xe')]('/',auth[_0xdcbd('0x8')](),controller[_0xdcbd('0xf')]);router[_0xdcbd('0x10')](_0xdcbd('0xd'),auth[_0xdcbd('0x8')](),controller[_0xdcbd('0x11')]);router[_0xdcbd('0x12')](_0xdcbd('0xd'),auth[_0xdcbd('0x8')](),controller[_0xdcbd('0x13')]);module[_0xdcbd('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index bedc350..ad3438b 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x425d=['sequelize','STRING','INTEGER','DATE'];(function(_0x944d2e,_0x186caf){var _0x3e29ff=function(_0x1a4eeb){while(--_0x1a4eeb){_0x944d2e['push'](_0x944d2e['shift']());}};_0x3e29ff(++_0x186caf);}(_0x425d,0x1e0));var _0xd425=function(_0x7d0f83,_0x43b7e3){_0x7d0f83=_0x7d0f83-0x0;var _0x7e1b2e=_0x425d[_0x7d0f83];return _0x7e1b2e;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xd425('0x1')]},'channel':{'type':Sequelize[_0xd425('0x1')]},'channelstate':{'type':Sequelize[_0xd425('0x2')]},'channelstatedesc':{'type':Sequelize[_0xd425('0x1')]},'calleridnum':{'type':Sequelize[_0xd425('0x1')]},'calleridname':{'type':Sequelize[_0xd425('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd425('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd425('0x1')]},'accountcode':{'type':Sequelize[_0xd425('0x1')]},'context':{'type':Sequelize[_0xd425('0x1')]},'exten':{'type':Sequelize[_0xd425('0x1')]},'priority':{'type':Sequelize[_0xd425('0x2')]},'uniqueid':{'type':Sequelize[_0xd425('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd425('0x1')]},'destchannelstate':{'type':Sequelize[_0xd425('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xd425('0x1')]},'destcalleridnum':{'type':Sequelize[_0xd425('0x1')]},'destcalleridname':{'type':Sequelize[_0xd425('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd425('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd425('0x1')]},'destlanguage':{'type':Sequelize[_0xd425('0x1')]},'destaccountcode':{'type':Sequelize[_0xd425('0x1')]},'destcontext':{'type':Sequelize[_0xd425('0x1')]},'destexten':{'type':Sequelize[_0xd425('0x1')]},'destpriority':{'type':Sequelize[_0xd425('0x2')]},'destuniqueid':{'type':Sequelize[_0xd425('0x1')]},'destlinkedid':{'type':Sequelize[_0xd425('0x1')]},'dialstring':{'type':Sequelize[_0xd425('0x1')]},'dialstatus':{'type':Sequelize[_0xd425('0x1')]},'starttime':{'type':Sequelize[_0xd425('0x3')]},'answertime':{'type':Sequelize[_0xd425('0x3')]},'endtime':{'type':Sequelize[_0xd425('0x3')]},'lastevent':{'type':Sequelize[_0xd425('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xd425('0x2')]},'duration':{'type':Sequelize[_0xd425('0x2')]},'holdtime':{'type':Sequelize[_0xd425('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9f62=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x46ef1d,_0x24926){var _0x49ce69=function(_0x5db4fc){while(--_0x5db4fc){_0x46ef1d['push'](_0x46ef1d['shift']());}};_0x49ce69(++_0x24926);}(_0x9f62,0x154));var _0x29f6=function(_0x330209,_0x2d27c9){_0x330209=_0x330209-0x0;var _0x38bc12=_0x9f62[_0x330209];return _0x38bc12;};'use strict';var Sequelize=require('sequelize');module[_0x29f6('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x29f6('0x1')]},'channelstate':{'type':Sequelize[_0x29f6('0x2')]},'channelstatedesc':{'type':Sequelize[_0x29f6('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x29f6('0x1')]},'connectedlinename':{'type':Sequelize[_0x29f6('0x1')]},'language':{'type':Sequelize[_0x29f6('0x1')]},'accountcode':{'type':Sequelize[_0x29f6('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x29f6('0x1')]},'priority':{'type':Sequelize[_0x29f6('0x2')]},'uniqueid':{'type':Sequelize[_0x29f6('0x1')]},'linkedid':{'type':Sequelize[_0x29f6('0x1')]},'destchannel':{'type':Sequelize[_0x29f6('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x29f6('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x29f6('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x29f6('0x1')]},'destexten':{'type':Sequelize[_0x29f6('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x29f6('0x1')]},'destlinkedid':{'type':Sequelize[_0x29f6('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x29f6('0x3')]},'lastevent':{'type':Sequelize[_0x29f6('0x1')],'comment':_0x29f6('0x4')},'routeId':{'type':Sequelize[_0x29f6('0x2')]},'duration':{'type':Sequelize[_0x29f6('0x2')]},'holdtime':{'type':Sequelize[_0x29f6('0x2')]},'billableseconds':{'type':Sequelize[_0x29f6('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 0181fbd..85a8e16 100644 --- a/server/api/voiceDialReport/voiceDialReport.controller.js +++ b/server/api/voiceDialReport/voiceDialReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d48=['VoiceDialReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','then','rows','show','params','create','body','find','catch','describe','zip-dir','request-promise','moment','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','limit','undefined','offset','count','set','Content-Range','json','apply','reject','update','destroy','error','stack','name','send','index','map'];(function(_0x1beacd,_0x17ded1){var _0x6b4276=function(_0xc55ce){while(--_0xc55ce){_0x1beacd['push'](_0x1beacd['shift']());}};_0x6b4276(++_0x17ded1);}(_0x7d48,0xed));var _0x87d4=function(_0x512a68,_0x11ee54){_0x512a68=_0x512a68-0x0;var _0x5c8499=_0x7d48[_0x512a68];return _0x5c8499;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x87d4('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x87d4('0x1'));var moment=require(_0x87d4('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x87d4('0x3'));var path=require(_0x87d4('0x4'));var sox=require('sox');var csv=require(_0x87d4('0x5'));var ejs=require(_0x87d4('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87d4('0x7'));var squel=require('squel');var crypto=require(_0x87d4('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x87d4('0x9'));var toCsv=require(_0x87d4('0x5'));var querystring=require(_0x87d4('0xa'));var Papa=require(_0x87d4('0xb'));var Redis=require('ioredis');var authService=require(_0x87d4('0xc'));var qs=require(_0x87d4('0xd'));var as=require(_0x87d4('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x87d4('0xf'))('api');var utils=require(_0x87d4('0x10'));var config=require(_0x87d4('0x11'));var licenseUtil=require(_0x87d4('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d5ab1,_0x258213){_0x258213=_0x258213||0xcc;return function(_0x328ca7){if(_0x328ca7){return _0x2d5ab1[_0x87d4('0x13')](_0x258213);}return _0x2d5ab1[_0x87d4('0x14')](_0x258213)[_0x87d4('0x15')]();};}function respondWithResult(_0x21c337,_0x267dfd){_0x267dfd=_0x267dfd||0xc8;return function(_0x368e9e){if(_0x368e9e){return _0x21c337[_0x87d4('0x14')](_0x267dfd)['json'](_0x368e9e);}};}function respondWithFilteredResult(_0x2c7e3d,_0x52e85f){return function(_0x59c945){if(_0x59c945){var _0xb3b9db=typeof _0x52e85f['offset']==='undefined'&&typeof _0x52e85f[_0x87d4('0x16')]===_0x87d4('0x17');var _0x5ef7e4=_0x59c945['count'];var _0x4eb36b=_0xb3b9db?0x0:_0x52e85f[_0x87d4('0x18')];var _0x4ecae3=_0xb3b9db?_0x59c945[_0x87d4('0x19')]:_0x52e85f[_0x87d4('0x18')]+_0x52e85f[_0x87d4('0x16')];var _0x24dc90;if(_0x4ecae3>=_0x5ef7e4){_0x4ecae3=_0x5ef7e4;_0x24dc90=0xc8;}else{_0x24dc90=0xce;}_0x2c7e3d[_0x87d4('0x14')](_0x24dc90);return _0x2c7e3d[_0x87d4('0x1a')](_0x87d4('0x1b'),_0x4eb36b+'-'+_0x4ecae3+'/'+_0x5ef7e4)[_0x87d4('0x1c')](_0x59c945);}return null;};}function patchUpdates(_0x1ebb42){return function(_0x441e84){try{jsonpatch[_0x87d4('0x1d')](_0x441e84,_0x1ebb42,!![]);}catch(_0x4f4175){return BPromise[_0x87d4('0x1e')](_0x4f4175);}return _0x441e84['save']();};}function saveUpdates(_0x2f1b04,_0x1e8f0d){return function(_0x4076a7){if(_0x4076a7){return _0x4076a7[_0x87d4('0x1f')](_0x2f1b04)['then'](function(_0x28a988){return _0x28a988;});}return null;};}function removeEntity(_0x42bb95,_0x4d24a2){return function(_0x3cde9c){if(_0x3cde9c){return _0x3cde9c[_0x87d4('0x20')]()['then'](function(){_0x42bb95[_0x87d4('0x14')](0xcc)[_0x87d4('0x15')]();});}};}function handleEntityNotFound(_0x21b4c9,_0xde3e7f){return function(_0x338d36){if(!_0x338d36){_0x21b4c9[_0x87d4('0x13')](0x194);}return _0x338d36;};}function handleError(_0x10ce5f,_0x4bad8d){_0x4bad8d=_0x4bad8d||0x1f4;return function(_0x329bbd){logger[_0x87d4('0x21')](_0x329bbd[_0x87d4('0x22')]);if(_0x329bbd[_0x87d4('0x23')]){delete _0x329bbd[_0x87d4('0x23')];}_0x10ce5f[_0x87d4('0x14')](_0x4bad8d)[_0x87d4('0x24')](_0x329bbd);};}exports[_0x87d4('0x25')]=function(_0x357d22,_0x2e72fc){var _0x545020={},_0x293fcf={},_0x27690f={'count':0x0,'rows':[]};var _0x217801=_[_0x87d4('0x26')](db[_0x87d4('0x27')][_0x87d4('0x28')],function(_0x340ba1){return{'name':_0x340ba1['fieldName'],'type':_0x340ba1[_0x87d4('0x29')][_0x87d4('0x2a')]};});_0x293fcf[_0x87d4('0x2b')]=_[_0x87d4('0x26')](_0x217801,'name');_0x293fcf[_0x87d4('0x2c')]=_[_0x87d4('0x2d')](_0x357d22['query']);_0x293fcf[_0x87d4('0x2e')]=_[_0x87d4('0x2f')](_0x293fcf[_0x87d4('0x2b')],_0x293fcf[_0x87d4('0x2c')]);_0x545020[_0x87d4('0x30')]=_['intersection'](_0x293fcf[_0x87d4('0x2b')],qs[_0x87d4('0x31')](_0x357d22[_0x87d4('0x2c')][_0x87d4('0x31')]));_0x545020[_0x87d4('0x30')]=_0x545020['attributes'][_0x87d4('0x32')]?_0x545020[_0x87d4('0x30')]:_0x293fcf[_0x87d4('0x2b')];if(!_0x357d22[_0x87d4('0x2c')]['hasOwnProperty']('nolimit')){_0x545020[_0x87d4('0x16')]=qs[_0x87d4('0x16')](_0x357d22['query']['limit']);_0x545020[_0x87d4('0x18')]=qs[_0x87d4('0x18')](_0x357d22[_0x87d4('0x2c')][_0x87d4('0x18')]);}_0x545020[_0x87d4('0x33')]=qs[_0x87d4('0x34')](_0x357d22[_0x87d4('0x2c')][_0x87d4('0x34')]);_0x545020[_0x87d4('0x35')]=qs[_0x87d4('0x2e')](_['pick'](_0x357d22['query'],_0x293fcf[_0x87d4('0x2e')]),_0x217801);if(_0x357d22[_0x87d4('0x2c')][_0x87d4('0x36')]){_0x545020['where']=_['merge'](_0x545020[_0x87d4('0x35')],{'$or':_[_0x87d4('0x26')](_0x217801,function(_0x166ba4){if(_0x166ba4[_0x87d4('0x29')]!==_0x87d4('0x37')){var _0x4dfb70={};_0x4dfb70[_0x166ba4[_0x87d4('0x23')]]={'$like':'%'+_0x357d22['query']['filter']+'%'};return _0x4dfb70;}})});}_0x545020=_[_0x87d4('0x38')]({},_0x545020,_0x357d22[_0x87d4('0x39')]);var _0x7bf06={'where':_0x545020[_0x87d4('0x35')]};return db[_0x87d4('0x27')][_0x87d4('0x19')](_0x7bf06)['then'](function(_0x4f3dcc){_0x27690f[_0x87d4('0x19')]=_0x4f3dcc;if(_0x357d22[_0x87d4('0x2c')][_0x87d4('0x3a')]){_0x545020[_0x87d4('0x3b')]=[{'all':!![]}];}return db[_0x87d4('0x27')]['findAll'](_0x545020);})[_0x87d4('0x3c')](function(_0x3157f0){_0x27690f[_0x87d4('0x3d')]=_0x3157f0;return _0x27690f;})['then'](respondWithFilteredResult(_0x2e72fc,_0x545020))['catch'](handleError(_0x2e72fc,null));};exports[_0x87d4('0x3e')]=function(_0x350339,_0x2700a7){var _0x48d156={'raw':!![],'where':{'id':_0x350339[_0x87d4('0x3f')]['id']}},_0xef17db={};_0xef17db['model']=_[_0x87d4('0x2d')](db[_0x87d4('0x27')][_0x87d4('0x28')]);_0xef17db[_0x87d4('0x2c')]=_[_0x87d4('0x2d')](_0x350339[_0x87d4('0x2c')]);_0xef17db[_0x87d4('0x2e')]=_[_0x87d4('0x2f')](_0xef17db[_0x87d4('0x2b')],_0xef17db['query']);_0x48d156[_0x87d4('0x30')]=_[_0x87d4('0x2f')](_0xef17db[_0x87d4('0x2b')],qs[_0x87d4('0x31')](_0x350339['query'][_0x87d4('0x31')]));_0x48d156[_0x87d4('0x30')]=_0x48d156[_0x87d4('0x30')][_0x87d4('0x32')]?_0x48d156[_0x87d4('0x30')]:_0xef17db['model'];if(_0x350339[_0x87d4('0x2c')][_0x87d4('0x3a')]){_0x48d156[_0x87d4('0x3b')]=[{'all':!![]}];}_0x48d156=_[_0x87d4('0x38')]({},_0x48d156,_0x350339[_0x87d4('0x39')]);return db[_0x87d4('0x27')]['find'](_0x48d156)[_0x87d4('0x3c')](handleEntityNotFound(_0x2700a7,null))[_0x87d4('0x3c')](respondWithResult(_0x2700a7,null))['catch'](handleError(_0x2700a7,null));};exports['create']=function(_0x4c4d27,_0x82588a){return db[_0x87d4('0x27')][_0x87d4('0x40')](_0x4c4d27[_0x87d4('0x41')],{})[_0x87d4('0x3c')](respondWithResult(_0x82588a,0xc9))['catch'](handleError(_0x82588a,null));};exports[_0x87d4('0x1f')]=function(_0x187914,_0x58a2f9){if(_0x187914[_0x87d4('0x41')]['id']){delete _0x187914['body']['id'];}return db['VoiceDialReport'][_0x87d4('0x42')]({'where':{'id':_0x187914['params']['id']}})[_0x87d4('0x3c')](handleEntityNotFound(_0x58a2f9,null))['then'](saveUpdates(_0x187914[_0x87d4('0x41')],null))[_0x87d4('0x3c')](respondWithResult(_0x58a2f9,null))['catch'](handleError(_0x58a2f9,null));};exports['destroy']=function(_0x53c70b,_0x5032b7){return db[_0x87d4('0x27')][_0x87d4('0x42')]({'where':{'id':_0x53c70b[_0x87d4('0x3f')]['id']}})[_0x87d4('0x3c')](handleEntityNotFound(_0x5032b7,null))[_0x87d4('0x3c')](removeEntity(_0x5032b7,null))[_0x87d4('0x43')](handleError(_0x5032b7,null));};exports[_0x87d4('0x44')]=function(_0x283014,_0x23cc6e){return db[_0x87d4('0x27')][_0x87d4('0x44')]()[_0x87d4('0x3c')](respondWithResult(_0x23cc6e,null))['catch'](handleError(_0x23cc6e,null));}; \ No newline at end of file +var _0xe98b=['create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','VoiceDialReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','findAll','rows','catch','params','include','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe98b,0x184));var _0xbe98=function(_0x2d7018,_0x5effe1){_0x2d7018=_0x2d7018-0x0;var _0x4e4820=_0xe98b[_0x2d7018];return _0x4e4820;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbe98('0x0'));var zipdir=require(_0xbe98('0x1'));var jsonpatch=require(_0xbe98('0x2'));var rp=require(_0xbe98('0x3'));var moment=require(_0xbe98('0x4'));var BPromise=require(_0xbe98('0x5'));var Mustache=require(_0xbe98('0x6'));var util=require(_0xbe98('0x7'));var path=require(_0xbe98('0x8'));var sox=require(_0xbe98('0x9'));var csv=require(_0xbe98('0xa'));var ejs=require(_0xbe98('0xb'));var fs=require('fs');var fs_extra=require(_0xbe98('0xc'));var _=require(_0xbe98('0xd'));var squel=require('squel');var crypto=require(_0xbe98('0xe'));var jsforce=require(_0xbe98('0xf'));var deskjs=require(_0xbe98('0x10'));var toCsv=require(_0xbe98('0xa'));var querystring=require('querystring');var Papa=require(_0xbe98('0x11'));var Redis=require(_0xbe98('0x12'));var authService=require(_0xbe98('0x13'));var qs=require(_0xbe98('0x14'));var as=require(_0xbe98('0x15'));var hardwareService=require(_0xbe98('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xbe98('0x17'));var config=require(_0xbe98('0x18'));var licenseUtil=require(_0xbe98('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fe163,_0x3d9ce7){_0x3d9ce7=_0x3d9ce7||0xcc;return function(_0x3e7e8c){if(_0x3e7e8c){return _0x2fe163['sendStatus'](_0x3d9ce7);}return _0x2fe163[_0xbe98('0x1a')](_0x3d9ce7)[_0xbe98('0x1b')]();};}function respondWithResult(_0x12b719,_0x59ad59){_0x59ad59=_0x59ad59||0xc8;return function(_0x26f0e6){if(_0x26f0e6){return _0x12b719[_0xbe98('0x1a')](_0x59ad59)[_0xbe98('0x1c')](_0x26f0e6);}};}function respondWithFilteredResult(_0x3e5fcb,_0x27a7a1){return function(_0x41f566){if(_0x41f566){var _0x39d06d=typeof _0x27a7a1[_0xbe98('0x1d')]==='undefined'&&typeof _0x27a7a1[_0xbe98('0x1e')]===_0xbe98('0x1f');var _0x5590b8=_0x41f566['count'];var _0x3534db=_0x39d06d?0x0:_0x27a7a1['offset'];var _0xcf9f36=_0x39d06d?_0x41f566[_0xbe98('0x20')]:_0x27a7a1[_0xbe98('0x1d')]+_0x27a7a1[_0xbe98('0x1e')];var _0x2efeec;if(_0xcf9f36>=_0x5590b8){_0xcf9f36=_0x5590b8;_0x2efeec=0xc8;}else{_0x2efeec=0xce;}_0x3e5fcb[_0xbe98('0x1a')](_0x2efeec);return _0x3e5fcb['set'](_0xbe98('0x21'),_0x3534db+'-'+_0xcf9f36+'/'+_0x5590b8)['json'](_0x41f566);}return null;};}function patchUpdates(_0x52cace){return function(_0x4194ea){try{jsonpatch[_0xbe98('0x22')](_0x4194ea,_0x52cace,!![]);}catch(_0x503463){return BPromise[_0xbe98('0x23')](_0x503463);}return _0x4194ea[_0xbe98('0x24')]();};}function saveUpdates(_0x5bdcef,_0x526deb){return function(_0x585483){if(_0x585483){return _0x585483[_0xbe98('0x25')](_0x5bdcef)[_0xbe98('0x26')](function(_0x31bb53){return _0x31bb53;});}return null;};}function removeEntity(_0x258ef0,_0x17d8d5){return function(_0x16b549){if(_0x16b549){return _0x16b549[_0xbe98('0x27')]()[_0xbe98('0x26')](function(){_0x258ef0[_0xbe98('0x1a')](0xcc)[_0xbe98('0x1b')]();});}};}function handleEntityNotFound(_0x5eeb72,_0xe31695){return function(_0x5e55f3){if(!_0x5e55f3){_0x5eeb72[_0xbe98('0x28')](0x194);}return _0x5e55f3;};}function handleError(_0x500329,_0x38e6e){_0x38e6e=_0x38e6e||0x1f4;return function(_0x31f7b2){logger[_0xbe98('0x29')](_0x31f7b2[_0xbe98('0x2a')]);if(_0x31f7b2[_0xbe98('0x2b')]){delete _0x31f7b2[_0xbe98('0x2b')];}_0x500329[_0xbe98('0x1a')](_0x38e6e)[_0xbe98('0x2c')](_0x31f7b2);};}exports['index']=function(_0x489971,_0x234f28){var _0x251984={},_0x5261c2={},_0x11aff8={'count':0x0,'rows':[]};var _0x48bd15=_[_0xbe98('0x2d')](db[_0xbe98('0x2e')][_0xbe98('0x2f')],function(_0x10ba58){return{'name':_0x10ba58[_0xbe98('0x30')],'type':_0x10ba58[_0xbe98('0x31')][_0xbe98('0x32')]};});_0x5261c2['model']=_[_0xbe98('0x2d')](_0x48bd15,_0xbe98('0x2b'));_0x5261c2[_0xbe98('0x33')]=_[_0xbe98('0x34')](_0x489971[_0xbe98('0x33')]);_0x5261c2['filters']=_[_0xbe98('0x35')](_0x5261c2[_0xbe98('0x36')],_0x5261c2[_0xbe98('0x33')]);_0x251984['attributes']=_['intersection'](_0x5261c2[_0xbe98('0x36')],qs[_0xbe98('0x37')](_0x489971[_0xbe98('0x33')]['fields']));_0x251984[_0xbe98('0x38')]=_0x251984[_0xbe98('0x38')]['length']?_0x251984[_0xbe98('0x38')]:_0x5261c2[_0xbe98('0x36')];if(!_0x489971[_0xbe98('0x33')][_0xbe98('0x39')](_0xbe98('0x3a'))){_0x251984['limit']=qs[_0xbe98('0x1e')](_0x489971['query']['limit']);_0x251984[_0xbe98('0x1d')]=qs[_0xbe98('0x1d')](_0x489971['query']['offset']);}_0x251984[_0xbe98('0x3b')]=qs[_0xbe98('0x3c')](_0x489971[_0xbe98('0x33')][_0xbe98('0x3c')]);_0x251984[_0xbe98('0x3d')]=qs[_0xbe98('0x3e')](_[_0xbe98('0x3f')](_0x489971['query'],_0x5261c2['filters']),_0x48bd15);if(_0x489971['query']['filter']){_0x251984[_0xbe98('0x3d')]=_['merge'](_0x251984[_0xbe98('0x3d')],{'$or':_['map'](_0x48bd15,function(_0x270866){if(_0x270866[_0xbe98('0x31')]!==_0xbe98('0x40')){var _0x318707={};_0x318707[_0x270866[_0xbe98('0x2b')]]={'$like':'%'+_0x489971[_0xbe98('0x33')][_0xbe98('0x41')]+'%'};return _0x318707;}})});}_0x251984=_[_0xbe98('0x42')]({},_0x251984,_0x489971[_0xbe98('0x43')]);var _0x2d7b5a={'where':_0x251984[_0xbe98('0x3d')]};return db[_0xbe98('0x2e')][_0xbe98('0x20')](_0x2d7b5a)['then'](function(_0x3ce9b1){_0x11aff8[_0xbe98('0x20')]=_0x3ce9b1;if(_0x489971[_0xbe98('0x33')]['includeAll']){_0x251984['include']=[{'all':!![]}];}return db[_0xbe98('0x2e')][_0xbe98('0x44')](_0x251984);})[_0xbe98('0x26')](function(_0x3af38c){_0x11aff8[_0xbe98('0x45')]=_0x3af38c;return _0x11aff8;})[_0xbe98('0x26')](respondWithFilteredResult(_0x234f28,_0x251984))[_0xbe98('0x46')](handleError(_0x234f28,null));};exports['show']=function(_0x1ce621,_0xdc2d35){var _0x136f10={'raw':!![],'where':{'id':_0x1ce621[_0xbe98('0x47')]['id']}},_0x282335={};_0x282335[_0xbe98('0x36')]=_[_0xbe98('0x34')](db[_0xbe98('0x2e')][_0xbe98('0x2f')]);_0x282335[_0xbe98('0x33')]=_[_0xbe98('0x34')](_0x1ce621[_0xbe98('0x33')]);_0x282335[_0xbe98('0x3e')]=_[_0xbe98('0x35')](_0x282335[_0xbe98('0x36')],_0x282335['query']);_0x136f10[_0xbe98('0x38')]=_['intersection'](_0x282335[_0xbe98('0x36')],qs['fields'](_0x1ce621[_0xbe98('0x33')][_0xbe98('0x37')]));_0x136f10[_0xbe98('0x38')]=_0x136f10['attributes']['length']?_0x136f10['attributes']:_0x282335[_0xbe98('0x36')];if(_0x1ce621[_0xbe98('0x33')]['includeAll']){_0x136f10[_0xbe98('0x48')]=[{'all':!![]}];}_0x136f10=_[_0xbe98('0x42')]({},_0x136f10,_0x1ce621[_0xbe98('0x43')]);return db['VoiceDialReport'][_0xbe98('0x49')](_0x136f10)['then'](handleEntityNotFound(_0xdc2d35,null))[_0xbe98('0x26')](respondWithResult(_0xdc2d35,null))[_0xbe98('0x46')](handleError(_0xdc2d35,null));};exports[_0xbe98('0x4a')]=function(_0x2968d8,_0x4559cb){return db[_0xbe98('0x2e')][_0xbe98('0x4a')](_0x2968d8[_0xbe98('0x4b')],{})[_0xbe98('0x26')](respondWithResult(_0x4559cb,0xc9))['catch'](handleError(_0x4559cb,null));};exports[_0xbe98('0x25')]=function(_0xbbee8,_0x2fbf74){if(_0xbbee8[_0xbe98('0x4b')]['id']){delete _0xbbee8[_0xbe98('0x4b')]['id'];}return db[_0xbe98('0x2e')][_0xbe98('0x49')]({'where':{'id':_0xbbee8[_0xbe98('0x47')]['id']}})['then'](handleEntityNotFound(_0x2fbf74,null))['then'](saveUpdates(_0xbbee8[_0xbe98('0x4b')],null))[_0xbe98('0x26')](respondWithResult(_0x2fbf74,null))['catch'](handleError(_0x2fbf74,null));};exports[_0xbe98('0x27')]=function(_0x46d17e,_0x5eb584){return db['VoiceDialReport'][_0xbe98('0x49')]({'where':{'id':_0x46d17e[_0xbe98('0x47')]['id']}})[_0xbe98('0x26')](handleEntityNotFound(_0x5eb584,null))[_0xbe98('0x26')](removeEntity(_0x5eb584,null))[_0xbe98('0x46')](handleError(_0x5eb584,null));};exports[_0xbe98('0x4c')]=function(_0x360a73,_0x33b7bc){return db[_0xbe98('0x2e')][_0xbe98('0x4c')]()[_0xbe98('0x26')](respondWithResult(_0x33b7bc,null))[_0xbe98('0x46')](handleError(_0x33b7bc,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 929c950..7c0d9ad 100644 --- a/server/api/voiceDialReport/voiceDialReport.model.js +++ b/server/api/voiceDialReport/voiceDialReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89c7=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial'];(function(_0x3b4359,_0x30fb5f){var _0x43cb11=function(_0x2d9be8){while(--_0x2d9be8){_0x3b4359['push'](_0x3b4359['shift']());}};_0x43cb11(++_0x30fb5f);}(_0x89c7,0x135));var _0x789c=function(_0xd467d7,_0x2f13cd){_0xd467d7=_0xd467d7-0x0;var _0x23b23d=_0x89c7[_0xd467d7];return _0x23b23d;};'use strict';var _=require(_0x789c('0x0'));var util=require(_0x789c('0x1'));var logger=require(_0x789c('0x2'))(_0x789c('0x3'));var moment=require('moment');var BPromise=require(_0x789c('0x4'));var rp=require(_0x789c('0x5'));var fs=require('fs');var path=require(_0x789c('0x6'));var rimraf=require(_0x789c('0x7'));var config=require(_0x789c('0x8'));var attributes=require(_0x789c('0x9'));module[_0x789c('0xa')]=function(_0x4d6cea,_0x162d40){return _0x4d6cea['define'](_0x789c('0xb'),attributes,{'tableName':_0x789c('0xc'),'paranoid':![],'indexes':[{'fields':[_0x789c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb3be=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xb3be,0x13c));var _0xeb3b=function(_0x3b4d88,_0x32cffa){_0x3b4d88=_0x3b4d88-0x0;var _0x4d39f9=_0xb3be[_0x3b4d88];return _0x4d39f9;};'use strict';var _=require(_0xeb3b('0x0'));var util=require(_0xeb3b('0x1'));var logger=require('../../config/logger')(_0xeb3b('0x2'));var moment=require(_0xeb3b('0x3'));var BPromise=require(_0xeb3b('0x4'));var rp=require(_0xeb3b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb3b('0x6'));var config=require(_0xeb3b('0x7'));var attributes=require(_0xeb3b('0x8'));module[_0xeb3b('0x9')]=function(_0x20e1ef,_0x5a3b08){return _0x20e1ef[_0xeb3b('0xa')](_0xeb3b('0xb'),attributes,{'tableName':_0xeb3b('0xc'),'paranoid':![],'indexes':[{'fields':[_0xeb3b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 8c1446c..0f4e7fe 100644 --- a/server/api/voiceDialReport/voiceDialReport.rpc.js +++ b/server/api/voiceDialReport/voiceDialReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2daa=['update','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport'];(function(_0xbe8e75,_0x2da8ad){var _0x2a8178=function(_0x400c5f){while(--_0x400c5f){_0xbe8e75['push'](_0xbe8e75['shift']());}};_0x2a8178(++_0x2da8ad);}(_0x2daa,0x10b));var _0xa2da=function(_0x20cc29,_0x30a46d){_0x20cc29=_0x20cc29-0x0;var _0x28d513=_0x2daa[_0x20cc29];return _0x28d513;};'use strict';var _=require(_0xa2da('0x0'));var util=require('util');var moment=require(_0xa2da('0x1'));var BPromise=require(_0xa2da('0x2'));var rs=require(_0xa2da('0x3'));var fs=require('fs');var Redis=require(_0xa2da('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa2da('0x5'));var logger=require(_0xa2da('0x6'))(_0xa2da('0x7'));var config=require(_0xa2da('0x8'));var jayson=require(_0xa2da('0x9'));var client=jayson['client'][_0xa2da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x331993,_0x534413,_0x12e8a7){return new BPromise(function(_0x5a9a18,_0x3b3aaf){return client[_0xa2da('0xb')](_0x331993,_0x12e8a7)[_0xa2da('0xc')](function(_0x1d6c6c){logger[_0xa2da('0xd')](_0xa2da('0xe'),_0x534413,'request\x20sent');logger[_0xa2da('0xf')](_0xa2da('0x10'),_0x534413,_0xa2da('0x11'),JSON[_0xa2da('0x12')](_0x1d6c6c));if(_0x1d6c6c[_0xa2da('0x13')]){if(_0x1d6c6c[_0xa2da('0x13')]['code']===0x1f4){logger[_0xa2da('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x534413,_0x1d6c6c[_0xa2da('0x13')][_0xa2da('0x14')]);return _0x3b3aaf(_0x1d6c6c[_0xa2da('0x13')][_0xa2da('0x14')]);}logger['error'](_0xa2da('0xe'),_0x534413,_0x1d6c6c[_0xa2da('0x13')][_0xa2da('0x14')]);return _0x5a9a18(_0x1d6c6c[_0xa2da('0x13')]['message']);}else{logger['info'](_0xa2da('0xe'),_0x534413,_0xa2da('0x11'));_0x5a9a18(_0x1d6c6c[_0xa2da('0x15')][_0xa2da('0x14')]);}})[_0xa2da('0x16')](function(_0x2720a2){logger[_0xa2da('0x13')](_0xa2da('0xe'),_0x534413,_0x2720a2);_0x3b3aaf(_0x2720a2);});});}exports[_0xa2da('0x17')]=function(_0x5c29e6){var _0x1c55d7=this;return new Promise(function(_0x4f8487,_0x2d06f2){return db[_0xa2da('0x18')][_0xa2da('0x19')](_0x5c29e6[_0xa2da('0x1a')],{'raw':_0x5c29e6[_0xa2da('0x1b')]?_0x5c29e6[_0xa2da('0x1b')][_0xa2da('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x5c556f){logger['info'](_0xa2da('0x17'),_0x5c29e6);logger['debug'](_0xa2da('0x17'),_0x5c29e6,JSON['stringify'](_0x5c556f));_0x4f8487(_0x5c556f);})[_0xa2da('0x16')](function(_0x475f40){logger[_0xa2da('0x13')](_0xa2da('0x17'),_0x475f40[_0xa2da('0x14')],_0x5c29e6);_0x2d06f2(_0x1c55d7[_0xa2da('0x13')](0x1f4,_0x475f40[_0xa2da('0x14')]));});});};exports[_0xa2da('0x1d')]=function(_0x264afa){var _0x9616ba=this;return new Promise(function(_0x5a7493,_0x33a67d){return db[_0xa2da('0x18')][_0xa2da('0x1e')](_0x264afa[_0xa2da('0x1a')],{'raw':_0x264afa['options']?_0x264afa[_0xa2da('0x1b')][_0xa2da('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x264afa['options']?_0x264afa['options'][_0xa2da('0x1f')]||null:null,'attributes':_0x264afa[_0xa2da('0x1b')]?_0x264afa[_0xa2da('0x1b')][_0xa2da('0x20')]||null:null,'limit':_0x264afa[_0xa2da('0x1b')]?_0x264afa[_0xa2da('0x1b')]['limit']||null:null})[_0xa2da('0xc')](function(_0x4a7f2a){logger[_0xa2da('0xd')](_0xa2da('0x1d'),_0x264afa);logger[_0xa2da('0xf')](_0xa2da('0x1d'),_0x264afa,JSON[_0xa2da('0x12')](_0x4a7f2a));_0x5a7493(_0x4a7f2a);})[_0xa2da('0x16')](function(_0x3a8f43){logger[_0xa2da('0x13')]('UpdateVoiceDialReport',_0x3a8f43[_0xa2da('0x14')],_0x264afa);_0x33a67d(_0x9616ba[_0xa2da('0x13')](0x1f4,_0x3a8f43['message']));});});}; \ No newline at end of file +var _0xd7cc=['../../config/logger','jayson/promise','client','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','VoiceDialReport,\x20%s,\x20%s','message','error','catch','CreateVoiceDialReport','VoiceDialReport','options','raw','stringify','body','where','attributes','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0xd7cc,0x1a4));var _0xcd7c=function(_0x5f4d2e,_0x111e63){_0x5f4d2e=_0x5f4d2e-0x0;var _0x37bde8=_0xd7cc[_0x5f4d2e];return _0x37bde8;};'use strict';var _=require(_0xcd7c('0x0'));var util=require(_0xcd7c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcd7c('0x2'));var fs=require('fs');var Redis=require(_0xcd7c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcd7c('0x4'));var logger=require(_0xcd7c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcd7c('0x6'));var client=jayson[_0xcd7c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x565768,_0x15667b,_0x43436e){return new BPromise(function(_0x5309ea,_0x3ff826){return client['request'](_0x565768,_0x43436e)[_0xcd7c('0x8')](function(_0x2cbca2){logger[_0xcd7c('0x9')]('VoiceDialReport,\x20%s,\x20%s',_0x15667b,_0xcd7c('0xa'));logger[_0xcd7c('0xb')](_0xcd7c('0xc'),_0x15667b,_0xcd7c('0xa'),JSON['stringify'](_0x2cbca2));if(_0x2cbca2['error']){if(_0x2cbca2['error']['code']===0x1f4){logger['error'](_0xcd7c('0xd'),_0x15667b,_0x2cbca2['error'][_0xcd7c('0xe')]);return _0x3ff826(_0x2cbca2[_0xcd7c('0xf')][_0xcd7c('0xe')]);}logger[_0xcd7c('0xf')](_0xcd7c('0xd'),_0x15667b,_0x2cbca2[_0xcd7c('0xf')][_0xcd7c('0xe')]);return _0x5309ea(_0x2cbca2[_0xcd7c('0xf')][_0xcd7c('0xe')]);}else{logger[_0xcd7c('0x9')](_0xcd7c('0xd'),_0x15667b,_0xcd7c('0xa'));_0x5309ea(_0x2cbca2['result'][_0xcd7c('0xe')]);}})[_0xcd7c('0x10')](function(_0x2a703c){logger[_0xcd7c('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x15667b,_0x2a703c);_0x3ff826(_0x2a703c);});});}exports[_0xcd7c('0x11')]=function(_0x40f867){var _0x21062f=this;return new Promise(function(_0x5c2061,_0x1c59ac){return db[_0xcd7c('0x12')]['create'](_0x40f867['body'],{'raw':_0x40f867[_0xcd7c('0x13')]?_0x40f867[_0xcd7c('0x13')][_0xcd7c('0x14')]===undefined?!![]:![]:!![]})[_0xcd7c('0x8')](function(_0x5388d6){logger[_0xcd7c('0x9')](_0xcd7c('0x11'),_0x40f867);logger['debug'](_0xcd7c('0x11'),_0x40f867,JSON[_0xcd7c('0x15')](_0x5388d6));_0x5c2061(_0x5388d6);})[_0xcd7c('0x10')](function(_0x467567){logger[_0xcd7c('0xf')](_0xcd7c('0x11'),_0x467567[_0xcd7c('0xe')],_0x40f867);_0x1c59ac(_0x21062f[_0xcd7c('0xf')](0x1f4,_0x467567[_0xcd7c('0xe')]));});});};exports['UpdateVoiceDialReport']=function(_0x3e4de3){var _0x324815=this;return new Promise(function(_0x33000c,_0x25a71a){return db[_0xcd7c('0x12')]['update'](_0x3e4de3[_0xcd7c('0x16')],{'raw':_0x3e4de3[_0xcd7c('0x13')]?_0x3e4de3[_0xcd7c('0x13')][_0xcd7c('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e4de3[_0xcd7c('0x13')]?_0x3e4de3[_0xcd7c('0x13')][_0xcd7c('0x17')]||null:null,'attributes':_0x3e4de3[_0xcd7c('0x13')]?_0x3e4de3[_0xcd7c('0x13')][_0xcd7c('0x18')]||null:null,'limit':_0x3e4de3['options']?_0x3e4de3[_0xcd7c('0x13')]['limit']||null:null})['then'](function(_0x1cec1b){logger['info']('UpdateVoiceDialReport',_0x3e4de3);logger[_0xcd7c('0xb')]('UpdateVoiceDialReport',_0x3e4de3,JSON[_0xcd7c('0x15')](_0x1cec1b));_0x33000c(_0x1cec1b);})[_0xcd7c('0x10')](function(_0x4b5d26){logger[_0xcd7c('0xf')]('UpdateVoiceDialReport',_0x4b5d26['message'],_0x3e4de3);_0x25a71a(_0x324815[_0xcd7c('0xf')](0x1f4,_0x4b5d26[_0xcd7c('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index ef98f6d..d83b330 100644 --- a/server/api/voiceExtension/index.js +++ b/server/api/voiceExtension/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1fb8=['addApplications','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','index','get','/:id','show','post','isAuthenticated','/:id/applications'];(function(_0x1341a6,_0x23816a){var _0x37658e=function(_0xbe0a4d){while(--_0xbe0a4d){_0x1341a6['push'](_0x1341a6['shift']());}};_0x37658e(++_0x23816a);}(_0x1fb8,0x17b));var _0x81fb=function(_0x2edb9f,_0x36fad0){_0x2edb9f=_0x2edb9f-0x0;var _0x4e5979=_0x1fb8[_0x2edb9f];return _0x4e5979;};'use strict';var multer=require(_0x81fb('0x0'));var util=require(_0x81fb('0x1'));var path=require(_0x81fb('0x2'));var timeout=require(_0x81fb('0x3'));var express=require(_0x81fb('0x4'));var router=express[_0x81fb('0x5')]();var fs_extra=require(_0x81fb('0x6'));var auth=require(_0x81fb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x81fb('0x8'));var controller=require(_0x81fb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x81fb('0xa')]);router[_0x81fb('0xb')](_0x81fb('0xc'),auth['isAuthenticated'](),controller[_0x81fb('0xd')]);router[_0x81fb('0xe')]('/',auth[_0x81fb('0xf')](),controller['create']);router[_0x81fb('0xe')](_0x81fb('0x10'),auth[_0x81fb('0xf')](),controller[_0x81fb('0x11')]);router[_0x81fb('0x12')](_0x81fb('0xc'),auth['isAuthenticated'](),controller[_0x81fb('0x13')]);router[_0x81fb('0x14')](_0x81fb('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x81fb('0x15')]=router; \ No newline at end of file +var _0x478c=['/:id','show','post','create','addApplications','update','destroy','exports','multer','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index'];(function(_0x3e697a,_0x3d19de){var _0x164710=function(_0x1d3e86){while(--_0x1d3e86){_0x3e697a['push'](_0x3e697a['shift']());}};_0x164710(++_0x3d19de);}(_0x478c,0x98));var _0xc478=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x478c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc478('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xc478('0x1'));var auth=require(_0xc478('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xc478('0x3'));var controller=require(_0xc478('0x4'));router[_0xc478('0x5')]('/',auth[_0xc478('0x6')](),controller[_0xc478('0x7')]);router[_0xc478('0x5')](_0xc478('0x8'),auth[_0xc478('0x6')](),controller[_0xc478('0x9')]);router[_0xc478('0xa')]('/',auth['isAuthenticated'](),controller[_0xc478('0xb')]);router[_0xc478('0xa')]('/:id/applications',auth[_0xc478('0x6')](),controller[_0xc478('0xc')]);router['put'](_0xc478('0x8'),auth[_0xc478('0x6')](),controller[_0xc478('0xd')]);router['delete'](_0xc478('0x8'),auth[_0xc478('0x6')](),controller[_0xc478('0xe')]);module[_0xc478('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 4db512b..1b4e6c1 100644 --- a/server/api/voiceExtension/voiceExtension.attributes.js +++ b/server/api/voiceExtension/voiceExtension.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x607b=['outbound','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','STRING','compositeIndex','NoOp','inbound'];(function(_0x5f49b3,_0x1ea166){var _0x373e8a=function(_0x306bc2){while(--_0x306bc2){_0x5f49b3['push'](_0x5f49b3['shift']());}};_0x373e8a(++_0x1ea166);}(_0x607b,0x155));var _0xb607=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x607b[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require('sequelize');module['exports']={'context':{'type':Sequelize[_0xb607('0x0')],'allowNull':![],'unique':_0xb607('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xb607('0x0')],'allowNull':![],'unique':_0xb607('0x1')},'priority':{'type':Sequelize[_0xb607('0x0')],'allowNull':![],'defaultValue':'1','unique':_0xb607('0x1')},'tag':{'type':Sequelize[_0xb607('0x0')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb607('0x2')},'appdata':{'type':Sequelize[_0xb607('0x0')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xb607('0x3'),_0xb607('0x4'),'internal',_0xb607('0x5'),_0xb607('0x6'),_0xb607('0x7'),_0xb607('0x8')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb607('0x0')],'allowNull':![],'defaultValue':_0xb607('0x9')},'IntervalId':{'type':Sequelize[_0xb607('0xa')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xb607('0x0')],'allowNull':!![]},'record':{'type':Sequelize[_0xb607('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xb607('0xa')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xb607('0xc')},'answer':{'type':Sequelize[_0xb607('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0xb607('0xd')],'get':function(_0x301096){return this[_0xb607('0xe')]('exten');}},'alias':{'type':Sequelize[_0xb607('0x0')],'allowNull':!![]}}; \ No newline at end of file +var _0xbfdb=['STRING','compositeIndex','NoOp','ENUM','inbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','VIRTUAL','getDataValue','exten','sequelize'];(function(_0x3c126c,_0x22f353){var _0x3b89e4=function(_0x1472c0){while(--_0x1472c0){_0x3c126c['push'](_0x3c126c['shift']());}};_0x3b89e4(++_0x22f353);}(_0xbfdb,0xed));var _0xbbfd=function(_0x28ffb5,_0x2deba8){_0x28ffb5=_0x28ffb5-0x0;var _0x15b509=_0xbfdb[_0x28ffb5];return _0x15b509;};'use strict';var Sequelize=require(_0xbbfd('0x0'));module['exports']={'context':{'type':Sequelize[_0xbbfd('0x1')],'allowNull':![],'unique':_0xbbfd('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbbfd('0x2')},'priority':{'type':Sequelize[_0xbbfd('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xbbfd('0x2')},'tag':{'type':Sequelize[_0xbbfd('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xbbfd('0x1')],'allowNull':![],'defaultValue':_0xbbfd('0x3')},'appdata':{'type':Sequelize[_0xbbfd('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xbbfd('0x4')](_0xbbfd('0x5'),'outbound',_0xbbfd('0x6'),_0xbbfd('0x7'),_0xbbfd('0x8'),_0xbbfd('0x9'),_0xbbfd('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xbbfd('0x1')]},'interval':{'type':Sequelize[_0xbbfd('0x1')],'allowNull':![],'defaultValue':_0xbbfd('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xbbfd('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xbbfd('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xbbfd('0x1')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xbbfd('0xd')]},'recordingFormat':{'type':Sequelize[_0xbbfd('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0xbbfd('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xbbfd('0xe')],'get':function(_0xb9a934){return this[_0xbbfd('0xf')](_0xbbfd('0x10'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index bc8ebd1..5ff5b38 100644 --- a/server/api/voiceExtension/voiceExtension.controller.js +++ b/server/api/voiceExtension/voiceExtension.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f07=['offset','undefined','count','limit','set','Content-Range','destroy','then','get','InboundRoutes','InternalRoutes','internal','ignore','map','includes','type','value','name','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model','keys','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','outbound','startsWith','body','exten','concat','user','role','inbound','OutboundRoutes','UserProfileSection','autoAssociation','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0f07,0x1c8));var _0x70f0=function(_0x205790,_0x514d3d){_0x205790=_0x205790-0x0;var _0x1dc25c=_0x0f07[_0x205790];return _0x1dc25c;};'use strict';var _=require(_0x70f0('0x0'));var Redis=require(_0x70f0('0x1'));var qs=require(_0x70f0('0x2'));var logger=require(_0x70f0('0x3'))('api');var config=require(_0x70f0('0x4'));var db=require('../../mysqldb')['db'];config[_0x70f0('0x5')]=_['defaults'](config[_0x70f0('0x5')],{'host':_0x70f0('0x6'),'port':0x18eb});var socket=require(_0x70f0('0x7'))(new Redis(config['redis']));require(_0x70f0('0x8'))[_0x70f0('0x9')](socket);function respondWithStatusCode(_0x5df3dc,_0x5bea95){_0x5bea95=_0x5bea95||0xcc;return function(_0x3aa639){if(_0x3aa639){return _0x5df3dc[_0x70f0('0xa')](_0x5bea95);}return _0x5df3dc[_0x70f0('0xb')](_0x5bea95)[_0x70f0('0xc')]();};}function respondWithResult(_0x2b7a53,_0x5a6b96){_0x5a6b96=_0x5a6b96||0xc8;return function(_0x507319){if(_0x507319){return _0x2b7a53[_0x70f0('0xb')](_0x5a6b96)[_0x70f0('0xd')](_0x507319);}};}function respondWithFilteredResult(_0x1a9d1a,_0x3ddea8){return function(_0x50da65){if(_0x50da65){var _0x20fdf6=typeof _0x3ddea8[_0x70f0('0xe')]===_0x70f0('0xf')&&typeof _0x3ddea8['limit']===_0x70f0('0xf');var _0x5501e9=_0x50da65[_0x70f0('0x10')];var _0x267140=_0x20fdf6?0x0:_0x3ddea8[_0x70f0('0xe')];var _0xb06c48=_0x20fdf6?_0x50da65['count']:_0x3ddea8[_0x70f0('0xe')]+_0x3ddea8[_0x70f0('0x11')];var _0x446ada;if(_0xb06c48>=_0x5501e9){_0xb06c48=_0x5501e9;_0x446ada=0xc8;}else{_0x446ada=0xce;}_0x1a9d1a['status'](_0x446ada);return _0x1a9d1a[_0x70f0('0x12')](_0x70f0('0x13'),_0x267140+'-'+_0xb06c48+'/'+_0x5501e9)[_0x70f0('0xd')](_0x50da65);}return null;};}function removeEntity(_0x643928){return function(_0x59c7b3){if(_0x59c7b3){return _0x59c7b3[_0x70f0('0x14')]()[_0x70f0('0x15')](function(){var _0x2d65ec=_0x59c7b3[_0x70f0('0x16')]({'plain':!![]});var _0x12c3a1=[{'name':_0x70f0('0x17'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0x70f0('0x18'),'value':_0x70f0('0x19'),'ignore':![]}];var _0x37084c=_(_0x12c3a1)['filter'](_0x70f0('0x1a'))[_0x70f0('0x1b')]('value')['value']();if(_[_0x70f0('0x1c')](_0x37084c,_0x2d65ec[_0x70f0('0x1d')])){return;}var _0x216d59=_['find'](_0x12c3a1,[_0x70f0('0x1e'),_0x2d65ec['type']])[_0x70f0('0x1f')];return db['UserProfileResource'][_0x70f0('0x14')]({'where':{'type':_0x216d59,'resourceId':_0x2d65ec['id']}})[_0x70f0('0x15')](function(){return _0x59c7b3;});})['then'](function(){_0x643928[_0x70f0('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39e661){return function(_0x1f0b86){if(!_0x1f0b86){_0x39e661['sendStatus'](0x194);}return _0x1f0b86;};}function handleError(_0x10cc5f,_0x139507){_0x139507=_0x139507||0x1f4;return function(_0x4b5b2b){logger[_0x70f0('0x20')](_0x4b5b2b[_0x70f0('0x21')]);if(_0x4b5b2b[_0x70f0('0x1f')]){delete _0x4b5b2b[_0x70f0('0x1f')];}_0x10cc5f[_0x70f0('0xb')](_0x139507)[_0x70f0('0x22')](_0x4b5b2b);};}exports[_0x70f0('0x23')]=function(_0xe78af7,_0x243bca){var _0x46bccd={},_0x39770e={},_0x3ab902={'count':0x0,'rows':[]};var _0x1bdba8=_[_0x70f0('0x1b')](db[_0x70f0('0x24')][_0x70f0('0x25')],function(_0x5824a4){return{'name':_0x5824a4[_0x70f0('0x26')],'type':_0x5824a4['type'][_0x70f0('0x27')]};});_0x39770e[_0x70f0('0x28')]=_[_0x70f0('0x1b')](_0x1bdba8,_0x70f0('0x1f'));_0x39770e['query']=_[_0x70f0('0x29')](_0xe78af7[_0x70f0('0x2a')]);_0x39770e['filters']=_['intersection'](_0x39770e['model'],_0x39770e[_0x70f0('0x2a')]);_0x46bccd[_0x70f0('0x2b')]=_[_0x70f0('0x2c')](_0x39770e[_0x70f0('0x28')],qs['fields'](_0xe78af7[_0x70f0('0x2a')][_0x70f0('0x2d')]));_0x46bccd[_0x70f0('0x2b')]=_0x46bccd['attributes'][_0x70f0('0x2e')]?_0x46bccd[_0x70f0('0x2b')]:_0x39770e['model'];if(!_0xe78af7[_0x70f0('0x2a')]['hasOwnProperty'](_0x70f0('0x2f'))){_0x46bccd[_0x70f0('0x11')]=qs[_0x70f0('0x11')](_0xe78af7[_0x70f0('0x2a')][_0x70f0('0x11')]);_0x46bccd[_0x70f0('0xe')]=qs[_0x70f0('0xe')](_0xe78af7['query']['offset']);}_0x46bccd[_0x70f0('0x30')]=qs[_0x70f0('0x31')](_0xe78af7[_0x70f0('0x2a')][_0x70f0('0x31')]);_0x46bccd[_0x70f0('0x32')]=qs[_0x70f0('0x33')](_[_0x70f0('0x34')](_0xe78af7[_0x70f0('0x2a')],_0x39770e[_0x70f0('0x33')]),_0x1bdba8);if(_0xe78af7[_0x70f0('0x2a')][_0x70f0('0x35')]){_0x46bccd[_0x70f0('0x32')]=_[_0x70f0('0x36')](_0x46bccd['where'],{'$or':_[_0x70f0('0x1b')](_0x1bdba8,function(_0x11f265){if(_0x11f265[_0x70f0('0x1d')]!==_0x70f0('0x37')){var _0x528290={};_0x528290[_0x11f265[_0x70f0('0x1f')]]={'$like':'%'+_0xe78af7[_0x70f0('0x2a')]['filter']+'%'};return _0x528290;}})});}_0x46bccd=_[_0x70f0('0x36')]({},_0x46bccd,_0xe78af7['options']);var _0x4669c6={'where':_0x46bccd[_0x70f0('0x32')]};return db[_0x70f0('0x24')][_0x70f0('0x10')](_0x4669c6)[_0x70f0('0x15')](function(_0x298b69){_0x3ab902[_0x70f0('0x10')]=_0x298b69;if(_0xe78af7[_0x70f0('0x2a')][_0x70f0('0x38')]){_0x46bccd[_0x70f0('0x39')]=[{'all':!![]}];}return db[_0x70f0('0x24')][_0x70f0('0x3a')](_0x46bccd);})[_0x70f0('0x15')](function(_0x3c9b4f){_0x3ab902[_0x70f0('0x3b')]=_0x3c9b4f;return _0x3ab902;})['then'](respondWithFilteredResult(_0x243bca,_0x46bccd))[_0x70f0('0x3c')](handleError(_0x243bca,null));};exports['show']=function(_0x15a5e3,_0x550e49){var _0x2c58bd={'raw':![],'where':{'id':_0x15a5e3[_0x70f0('0x3d')]['id']}},_0x5415b2={};_0x5415b2[_0x70f0('0x28')]=_[_0x70f0('0x29')](db[_0x70f0('0x24')][_0x70f0('0x25')]);_0x5415b2[_0x70f0('0x2a')]=_[_0x70f0('0x29')](_0x15a5e3[_0x70f0('0x2a')]);_0x5415b2[_0x70f0('0x33')]=_['intersection'](_0x5415b2[_0x70f0('0x28')],_0x5415b2[_0x70f0('0x2a')]);_0x2c58bd['attributes']=_['intersection'](_0x5415b2[_0x70f0('0x28')],qs[_0x70f0('0x2d')](_0x15a5e3['query'][_0x70f0('0x2d')]));_0x2c58bd['attributes']=_0x2c58bd['attributes']['length']?_0x2c58bd[_0x70f0('0x2b')]:_0x5415b2[_0x70f0('0x28')];if(_0x15a5e3[_0x70f0('0x2a')][_0x70f0('0x38')]){_0x2c58bd[_0x70f0('0x39')]=[{'all':!![]}];}_0x2c58bd=_['merge']({},_0x2c58bd,_0x15a5e3['options']);return db['VoiceExtension'][_0x70f0('0x3e')](_0x2c58bd)[_0x70f0('0x15')](handleEntityNotFound(_0x550e49,null))[_0x70f0('0x15')](respondWithResult(_0x550e49,null))['catch'](handleError(_0x550e49,null));};exports[_0x70f0('0x14')]=function(_0x439167,_0x2fc21d){return db[_0x70f0('0x24')]['find']({'where':{'id':_0x439167[_0x70f0('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2fc21d,null))['then'](removeEntity(_0x2fc21d,null))[_0x70f0('0x3c')](handleError(_0x2fc21d,null));};exports[_0x70f0('0x3f')]=function(_0x694a84,_0x128b92){if(_0x694a84['body'][_0x70f0('0x1d')]===_0x70f0('0x40')&&!_[_0x70f0('0x41')](_0x694a84[_0x70f0('0x42')]['exten'],'_')){_0x694a84['body'][_0x70f0('0x43')]='_'[_0x70f0('0x44')](_0x694a84[_0x70f0('0x42')][_0x70f0('0x43')]);}return db['VoiceExtension'][_0x70f0('0x3f')](_0x694a84[_0x70f0('0x42')],{'raw':![]})[_0x70f0('0x15')](function(_0x46ca62){var _0x1060c1=_0x694a84[_0x70f0('0x45')][_0x70f0('0x16')]({'plain':!![]});if(!_0x1060c1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1060c1[_0x70f0('0x46')]==='user'){var _0x3f75b4=_0x46ca62[_0x70f0('0x16')]({'plain':!![]});var _0x1cacf3=[{'name':_0x70f0('0x17'),'value':_0x70f0('0x47')},{'name':_0x70f0('0x48'),'value':_0x70f0('0x40')},{'name':_0x70f0('0x18'),'value':'internal'}];var _0x209c6d=_[_0x70f0('0x3e')](_0x1cacf3,[_0x70f0('0x1e'),_0x3f75b4[_0x70f0('0x1d')]])[_0x70f0('0x1f')];return db[_0x70f0('0x49')][_0x70f0('0x3e')]({'where':{'name':_0x209c6d,'userProfileId':_0x1060c1['userProfileId']},'raw':!![]})[_0x70f0('0x15')](function(_0x3d0517){if(_0x3d0517&&_0x3d0517[_0x70f0('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x3f75b4[_0x70f0('0x1f')],'resourceId':_0x3f75b4['id'],'type':_0x3d0517[_0x70f0('0x1f')],'sectionId':_0x3d0517['id']},{})[_0x70f0('0x15')](function(){return _0x46ca62;});}else{return _0x46ca62;}})[_0x70f0('0x3c')](function(_0x116a1a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x116a1a);throw _0x116a1a;});}return _0x46ca62;})[_0x70f0('0x15')](respondWithResult(_0x128b92,0xc9))[_0x70f0('0x3c')](handleError(_0x128b92,null));};exports[_0x70f0('0x4b')]=function(_0x6da3dc,_0x3666b0){if(_0x6da3dc['body']['id']){delete _0x6da3dc[_0x70f0('0x42')]['id'];}return db[_0x70f0('0x24')][_0x70f0('0x3e')]({'where':{'id':_0x6da3dc['params']['id']}})[_0x70f0('0x15')](handleEntityNotFound(_0x3666b0,null))[_0x70f0('0x15')](function(_0x20faec){if(_0x20faec){return db['VoiceExtension'][_0x70f0('0x4b')](_[_0x70f0('0x34')](_0x6da3dc[_0x70f0('0x42')],[_0x70f0('0x43'),_0x70f0('0x4c'),_0x70f0('0x4d'),_0x70f0('0x4e'),_0x70f0('0x4f'),_0x70f0('0x50'),_0x70f0('0x51')]),{'where':{'context':_0x20faec['context'],'exten':_0x20faec[_0x70f0('0x43')]},'individualHooks':!![]})['then'](function(_0x881d31){return _0x881d31;});}return null;})[_0x70f0('0x15')](respondWithStatusCode(_0x3666b0,null))[_0x70f0('0x3c')](handleError(_0x3666b0,null));};exports[_0x70f0('0x52')]=function(_0x90db9e,_0x4802e8){var _0x2de4dd=_0x90db9e[_0x70f0('0x3d')]['id'];var _0x556b52=_0x90db9e[_0x70f0('0x42')];var _0x46ed53=0xc8;var _0x3f4dcd=null;return db[_0x70f0('0x53')]['transaction']({'isolationLevel':db[_0x70f0('0x53')][_0x70f0('0x54')][_0x70f0('0x55')][_0x70f0('0x56')]},function(_0x1ba511){return db[_0x70f0('0x24')]['findOne']({'where':{'id':_0x2de4dd},'transaction':_0x1ba511})[_0x70f0('0x15')](function(_0x3c9fbc){if(_0x3c9fbc){return db[_0x70f0('0x24')]['destroy']({'where':{'VoiceExtensionId':_0x2de4dd},'transaction':_0x1ba511})[_0x70f0('0x15')](function(){var _0x541022=_[_0x70f0('0x1b')](_0x556b52,function(_0x58680c){_0x58680c[_0x70f0('0x57')]=_0x2de4dd;_0x58680c[_0x70f0('0x58')]=!![];return _0x58680c;});return _0x3c9fbc[_0x70f0('0x59')](_0x541022);})[_0x70f0('0x15')](function(_0x5461fb){return db[_0x70f0('0x24')][_0x70f0('0x5a')](_0x5461fb,{'transaction':_0x1ba511});});}else{_0x46ed53=0x194;_0x3f4dcd=[];}});})[_0x70f0('0x15')](function(){if(_0x46ed53!==0x194){return db['VoiceExtension'][_0x70f0('0x5b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2de4dd},'order':_0x70f0('0x5c')})[_0x70f0('0x15')](function(_0x1c55a0){_0x3f4dcd=_0x1c55a0;});}})['catch'](function(_0x2632fe){_0x46ed53=0x1f4;logger['error'](_0x2632fe[_0x70f0('0x21')]);if(_0x2632fe[_0x70f0('0x1f')]){delete _0x2632fe[_0x70f0('0x1f')];}_0x3f4dcd=_0x2632fe;})[_0x70f0('0x5d')](function(){if(_0x3f4dcd===null){_0x4802e8[_0x70f0('0xa')](_0x46ed53);}else{if(_0x46ed53===0x1f4){_0x4802e8[_0x70f0('0xb')](_0x46ed53)[_0x70f0('0x22')](_0x3f4dcd);}else{_0x4802e8[_0x70f0('0xb')](_0x46ed53)['json'](_0x3f4dcd);}}});}; \ No newline at end of file +var _0x6335=['context','addApplications','sequelize','Transaction','VoiceExtensionId','isApp','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','finally','send','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','set','Content-Range','json','then','InboundRoutes','inbound','ignore','map','value','type','name','UserProfileResource','error','stack','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','VoiceExtension','count','includeAll','include','findAll','catch','show','params','keys','fields','find','destroy','outbound','body','exten','concat','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InternalRoutes','internal','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','mandatoryDisposition'];(function(_0x414364,_0xd70cb){var _0x546b4e=function(_0xfb2af1){while(--_0xfb2af1){_0x414364['push'](_0x414364['shift']());}};_0x546b4e(++_0xd70cb);}(_0x6335,0x64));var _0x5633=function(_0x134328,_0x3a4bc5){_0x134328=_0x134328-0x0;var _0x569e6f=_0x6335[_0x134328];return _0x569e6f;};'use strict';var _=require(_0x5633('0x0'));var Redis=require(_0x5633('0x1'));var qs=require(_0x5633('0x2'));var logger=require(_0x5633('0x3'))('api');var config=require(_0x5633('0x4'));var db=require(_0x5633('0x5'))['db'];config[_0x5633('0x6')]=_[_0x5633('0x7')](config[_0x5633('0x6')],{'host':_0x5633('0x8'),'port':0x18eb});var socket=require(_0x5633('0x9'))(new Redis(config[_0x5633('0x6')]));require('./voiceExtension.socket')['register'](socket);function respondWithStatusCode(_0x2aee44,_0x198d81){_0x198d81=_0x198d81||0xcc;return function(_0x15ef03){if(_0x15ef03){return _0x2aee44[_0x5633('0xa')](_0x198d81);}return _0x2aee44[_0x5633('0xb')](_0x198d81)[_0x5633('0xc')]();};}function respondWithResult(_0x5359a9,_0x2e4663){_0x2e4663=_0x2e4663||0xc8;return function(_0x53f5cd){if(_0x53f5cd){return _0x5359a9[_0x5633('0xb')](_0x2e4663)['json'](_0x53f5cd);}};}function respondWithFilteredResult(_0x2aa93e,_0x564aa9){return function(_0x23df49){if(_0x23df49){var _0x3299b3=typeof _0x564aa9[_0x5633('0xd')]==='undefined'&&typeof _0x564aa9['limit']==='undefined';var _0x5ab7da=_0x23df49['count'];var _0x2576c9=_0x3299b3?0x0:_0x564aa9[_0x5633('0xd')];var _0x3be877=_0x3299b3?_0x23df49['count']:_0x564aa9['offset']+_0x564aa9['limit'];var _0x3147e1;if(_0x3be877>=_0x5ab7da){_0x3be877=_0x5ab7da;_0x3147e1=0xc8;}else{_0x3147e1=0xce;}_0x2aa93e[_0x5633('0xb')](_0x3147e1);return _0x2aa93e[_0x5633('0xe')](_0x5633('0xf'),_0x2576c9+'-'+_0x3be877+'/'+_0x5ab7da)[_0x5633('0x10')](_0x23df49);}return null;};}function removeEntity(_0x19b5cd){return function(_0x3c3c2d){if(_0x3c3c2d){return _0x3c3c2d['destroy']()[_0x5633('0x11')](function(){var _0x5d6cd2=_0x3c3c2d['get']({'plain':!![]});var _0x52573a=[{'name':_0x5633('0x12'),'value':_0x5633('0x13'),'ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x3afae1=_(_0x52573a)['filter'](_0x5633('0x14'))[_0x5633('0x15')](_0x5633('0x16'))[_0x5633('0x16')]();if(_['includes'](_0x3afae1,_0x5d6cd2[_0x5633('0x17')])){return;}var _0x26118c=_['find'](_0x52573a,[_0x5633('0x16'),_0x5d6cd2[_0x5633('0x17')]])[_0x5633('0x18')];return db[_0x5633('0x19')]['destroy']({'where':{'type':_0x26118c,'resourceId':_0x5d6cd2['id']}})[_0x5633('0x11')](function(){return _0x3c3c2d;});})[_0x5633('0x11')](function(){_0x19b5cd['status'](0xcc)[_0x5633('0xc')]();});}};}function handleEntityNotFound(_0x41b635){return function(_0x4fd6e7){if(!_0x4fd6e7){_0x41b635[_0x5633('0xa')](0x194);}return _0x4fd6e7;};}function handleError(_0xc59f15,_0x728308){_0x728308=_0x728308||0x1f4;return function(_0x5bec37){logger[_0x5633('0x1a')](_0x5bec37[_0x5633('0x1b')]);if(_0x5bec37[_0x5633('0x18')]){delete _0x5bec37['name'];}_0xc59f15[_0x5633('0xb')](_0x728308)['send'](_0x5bec37);};}exports[_0x5633('0x1c')]=function(_0x3b3d3d,_0x2d3c16){var _0x456124={},_0x13a16b={},_0x42d680={'count':0x0,'rows':[]};var _0x1e02e1=_[_0x5633('0x15')](db['VoiceExtension'][_0x5633('0x1d')],function(_0x5efedb){return{'name':_0x5efedb[_0x5633('0x1e')],'type':_0x5efedb[_0x5633('0x17')][_0x5633('0x1f')]};});_0x13a16b[_0x5633('0x20')]=_[_0x5633('0x15')](_0x1e02e1,_0x5633('0x18'));_0x13a16b[_0x5633('0x21')]=_['keys'](_0x3b3d3d[_0x5633('0x21')]);_0x13a16b[_0x5633('0x22')]=_[_0x5633('0x23')](_0x13a16b[_0x5633('0x20')],_0x13a16b[_0x5633('0x21')]);_0x456124[_0x5633('0x24')]=_[_0x5633('0x23')](_0x13a16b[_0x5633('0x20')],qs['fields'](_0x3b3d3d['query']['fields']));_0x456124[_0x5633('0x24')]=_0x456124['attributes'][_0x5633('0x25')]?_0x456124[_0x5633('0x24')]:_0x13a16b[_0x5633('0x20')];if(!_0x3b3d3d['query']['hasOwnProperty'](_0x5633('0x26'))){_0x456124[_0x5633('0x27')]=qs[_0x5633('0x27')](_0x3b3d3d[_0x5633('0x21')][_0x5633('0x27')]);_0x456124[_0x5633('0xd')]=qs[_0x5633('0xd')](_0x3b3d3d['query'][_0x5633('0xd')]);}_0x456124[_0x5633('0x28')]=qs[_0x5633('0x29')](_0x3b3d3d['query'][_0x5633('0x29')]);_0x456124[_0x5633('0x2a')]=qs[_0x5633('0x22')](_[_0x5633('0x2b')](_0x3b3d3d[_0x5633('0x21')],_0x13a16b[_0x5633('0x22')]),_0x1e02e1);if(_0x3b3d3d['query'][_0x5633('0x2c')]){_0x456124[_0x5633('0x2a')]=_['merge'](_0x456124[_0x5633('0x2a')],{'$or':_[_0x5633('0x15')](_0x1e02e1,function(_0x3422f3){if(_0x3422f3[_0x5633('0x17')]!==_0x5633('0x2d')){var _0x54a42d={};_0x54a42d[_0x3422f3[_0x5633('0x18')]]={'$like':'%'+_0x3b3d3d[_0x5633('0x21')]['filter']+'%'};return _0x54a42d;}})});}_0x456124=_[_0x5633('0x2e')]({},_0x456124,_0x3b3d3d[_0x5633('0x2f')]);var _0x316ca1={'where':_0x456124['where']};return db[_0x5633('0x30')][_0x5633('0x31')](_0x316ca1)[_0x5633('0x11')](function(_0x1d8cb1){_0x42d680[_0x5633('0x31')]=_0x1d8cb1;if(_0x3b3d3d['query'][_0x5633('0x32')]){_0x456124[_0x5633('0x33')]=[{'all':!![]}];}return db['VoiceExtension'][_0x5633('0x34')](_0x456124);})[_0x5633('0x11')](function(_0x4589b8){_0x42d680['rows']=_0x4589b8;return _0x42d680;})[_0x5633('0x11')](respondWithFilteredResult(_0x2d3c16,_0x456124))[_0x5633('0x35')](handleError(_0x2d3c16,null));};exports[_0x5633('0x36')]=function(_0x57bc31,_0x4e0870){var _0x453453={'raw':![],'where':{'id':_0x57bc31[_0x5633('0x37')]['id']}},_0x33e382={};_0x33e382[_0x5633('0x20')]=_[_0x5633('0x38')](db[_0x5633('0x30')][_0x5633('0x1d')]);_0x33e382[_0x5633('0x21')]=_[_0x5633('0x38')](_0x57bc31[_0x5633('0x21')]);_0x33e382[_0x5633('0x22')]=_[_0x5633('0x23')](_0x33e382[_0x5633('0x20')],_0x33e382[_0x5633('0x21')]);_0x453453[_0x5633('0x24')]=_[_0x5633('0x23')](_0x33e382[_0x5633('0x20')],qs[_0x5633('0x39')](_0x57bc31[_0x5633('0x21')][_0x5633('0x39')]));_0x453453[_0x5633('0x24')]=_0x453453[_0x5633('0x24')][_0x5633('0x25')]?_0x453453['attributes']:_0x33e382[_0x5633('0x20')];if(_0x57bc31['query'][_0x5633('0x32')]){_0x453453[_0x5633('0x33')]=[{'all':!![]}];}_0x453453=_[_0x5633('0x2e')]({},_0x453453,_0x57bc31[_0x5633('0x2f')]);return db[_0x5633('0x30')][_0x5633('0x3a')](_0x453453)[_0x5633('0x11')](handleEntityNotFound(_0x4e0870,null))['then'](respondWithResult(_0x4e0870,null))['catch'](handleError(_0x4e0870,null));};exports[_0x5633('0x3b')]=function(_0x328aa2,_0x43a6ae){return db[_0x5633('0x30')]['find']({'where':{'id':_0x328aa2[_0x5633('0x37')]['id']}})[_0x5633('0x11')](handleEntityNotFound(_0x43a6ae,null))[_0x5633('0x11')](removeEntity(_0x43a6ae,null))['catch'](handleError(_0x43a6ae,null));};exports['create']=function(_0x12b03c,_0x34cd32){if(_0x12b03c['body'][_0x5633('0x17')]===_0x5633('0x3c')&&!_['startsWith'](_0x12b03c[_0x5633('0x3d')][_0x5633('0x3e')],'_')){_0x12b03c['body'][_0x5633('0x3e')]='_'[_0x5633('0x3f')](_0x12b03c['body'][_0x5633('0x3e')]);}return db['VoiceExtension']['create'](_0x12b03c[_0x5633('0x3d')],{'raw':![]})[_0x5633('0x11')](function(_0xd17327){var _0x590b1b=_0x12b03c[_0x5633('0x40')][_0x5633('0x41')]({'plain':!![]});if(!_0x590b1b)throw new Error(_0x5633('0x42'));if(_0x590b1b[_0x5633('0x43')]===_0x5633('0x40')){var _0x49fa72=_0xd17327[_0x5633('0x41')]({'plain':!![]});var _0x340643=[{'name':_0x5633('0x12'),'value':'inbound'},{'name':'OutboundRoutes','value':'outbound'},{'name':_0x5633('0x44'),'value':_0x5633('0x45')}];var _0x158357=_['find'](_0x340643,['value',_0x49fa72[_0x5633('0x17')]])[_0x5633('0x18')];return db[_0x5633('0x46')]['find']({'where':{'name':_0x158357,'userProfileId':_0x590b1b['userProfileId']},'raw':!![]})[_0x5633('0x11')](function(_0x721fce){if(_0x721fce&&_0x721fce['autoAssociation']===0x0){return db['UserProfileResource'][_0x5633('0x47')]({'name':_0x49fa72[_0x5633('0x18')],'resourceId':_0x49fa72['id'],'type':_0x721fce[_0x5633('0x18')],'sectionId':_0x721fce['id']},{})['then'](function(){return _0xd17327;});}else{return _0xd17327;}})['catch'](function(_0x1c6dc5){logger[_0x5633('0x1a')](_0x5633('0x48'),_0x1c6dc5);throw _0x1c6dc5;});}return _0xd17327;})['then'](respondWithResult(_0x34cd32,0xc9))[_0x5633('0x35')](handleError(_0x34cd32,null));};exports[_0x5633('0x49')]=function(_0x4ca71c,_0x318e9e){if(_0x4ca71c[_0x5633('0x3d')]['id']){delete _0x4ca71c[_0x5633('0x3d')]['id'];}return db[_0x5633('0x30')][_0x5633('0x3a')]({'where':{'id':_0x4ca71c[_0x5633('0x37')]['id']}})[_0x5633('0x11')](handleEntityNotFound(_0x318e9e,null))[_0x5633('0x11')](function(_0x268ae9){if(_0x268ae9){return db[_0x5633('0x30')][_0x5633('0x49')](_[_0x5633('0x2b')](_0x4ca71c[_0x5633('0x3d')],[_0x5633('0x3e'),'context',_0x5633('0x4a'),_0x5633('0x4b'),_0x5633('0x4c'),_0x5633('0x4d'),'alias']),{'where':{'context':_0x268ae9[_0x5633('0x4e')],'exten':_0x268ae9[_0x5633('0x3e')]},'individualHooks':!![]})['then'](function(_0xb1f6f6){return _0xb1f6f6;});}return null;})[_0x5633('0x11')](respondWithStatusCode(_0x318e9e,null))[_0x5633('0x35')](handleError(_0x318e9e,null));};exports[_0x5633('0x4f')]=function(_0x257c2d,_0x1ebedc){var _0x46bb29=_0x257c2d[_0x5633('0x37')]['id'];var _0x40906d=_0x257c2d[_0x5633('0x3d')];var _0x9f45c7=0xc8;var _0x2ca667=null;return db[_0x5633('0x50')]['transaction']({'isolationLevel':db[_0x5633('0x50')][_0x5633('0x51')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x565585){return db[_0x5633('0x30')]['findOne']({'where':{'id':_0x46bb29},'transaction':_0x565585})[_0x5633('0x11')](function(_0x362630){if(_0x362630){return db[_0x5633('0x30')]['destroy']({'where':{'VoiceExtensionId':_0x46bb29},'transaction':_0x565585})[_0x5633('0x11')](function(){var _0x4ab97b=_[_0x5633('0x15')](_0x40906d,function(_0x4d79d4){_0x4d79d4[_0x5633('0x52')]=_0x46bb29;_0x4d79d4[_0x5633('0x53')]=!![];return _0x4d79d4;});return _0x362630[_0x5633('0x54')](_0x4ab97b);})['then'](function(_0x4e399f){return db[_0x5633('0x30')][_0x5633('0x55')](_0x4e399f,{'transaction':_0x565585});});}else{_0x9f45c7=0x194;_0x2ca667=[];}});})[_0x5633('0x11')](function(){if(_0x9f45c7!==0x194){return db[_0x5633('0x30')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x46bb29},'order':_0x5633('0x56')})[_0x5633('0x11')](function(_0x42c0ea){_0x2ca667=_0x42c0ea;});}})[_0x5633('0x35')](function(_0x3a2f0c){_0x9f45c7=0x1f4;logger[_0x5633('0x1a')](_0x3a2f0c[_0x5633('0x1b')]);if(_0x3a2f0c[_0x5633('0x18')]){delete _0x3a2f0c[_0x5633('0x18')];}_0x2ca667=_0x3a2f0c;})[_0x5633('0x57')](function(){if(_0x2ca667===null){_0x1ebedc[_0x5633('0xa')](_0x9f45c7);}else{if(_0x9f45c7===0x1f4){_0x1ebedc['status'](_0x9f45c7)[_0x5633('0x58')](_0x2ca667);}else{_0x1ebedc[_0x5633('0xb')](_0x9f45c7)['json'](_0x2ca667);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index a579f49..cefc496 100644 --- a/server/api/voiceExtension/voiceExtension.events.js +++ b/server/api/voiceExtension/voiceExtension.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6443=['hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6443,0x16a));var _0x3644=function(_0x5de532,_0x2941c4){_0x5de532=_0x5de532-0x0;var _0x4e9192=_0x6443[_0x5de532];return _0x4e9192;};'use strict';var EventEmitter=require(_0x3644('0x0'));var VoiceExtension=require(_0x3644('0x1'))['db'][_0x3644('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x3644('0x3')](0x0);var events={'afterCreate':_0x3644('0x4'),'afterUpdate':_0x3644('0x5'),'afterDestroy':'remove'};function emitEvent(_0x447067){return function(_0x4dbe86,_0x1e7f91,_0x3c7af0){VoiceExtensionEvents[_0x3644('0x6')](_0x447067+':'+_0x4dbe86['id'],_0x4dbe86);VoiceExtensionEvents['emit'](_0x447067,_0x4dbe86);_0x3c7af0(null);};}for(var e in events){if(events[_0x3644('0x7')](e)){var event=events[e];VoiceExtension[_0x3644('0x8')](e,emitEvent(event));}}module[_0x3644('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0xd7ed=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceExtension','setMaxListeners','save'];(function(_0x567c2d,_0x45454f){var _0x2b1c2b=function(_0x4a5e43){while(--_0x4a5e43){_0x567c2d['push'](_0x567c2d['shift']());}};_0x2b1c2b(++_0x45454f);}(_0xd7ed,0xb0));var _0xdd7e=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0xd7ed[_0x1344d6];return _0xf45b24;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xdd7e('0x0'))['db'][_0xdd7e('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xdd7e('0x2')](0x0);var events={'afterCreate':_0xdd7e('0x3'),'afterUpdate':_0xdd7e('0x4'),'afterDestroy':_0xdd7e('0x5')};function emitEvent(_0x438010){return function(_0x5ac346,_0x1f597f,_0x3fab4c){VoiceExtensionEvents[_0xdd7e('0x6')](_0x438010+':'+_0x5ac346['id'],_0x5ac346);VoiceExtensionEvents[_0xdd7e('0x6')](_0x438010,_0x5ac346);_0x3fab4c(null);};}for(var e in events){if(events[_0xdd7e('0x7')](e)){var event=events[e];VoiceExtension[_0xdd7e('0x8')](e,emitEvent(event));}}module[_0xdd7e('0x9')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index f9bf231..d2d8c56 100644 --- a/server/api/voiceExtension/voiceExtension.model.js +++ b/server/api/voiceExtension/voiceExtension.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa467=['NoOp','CDR(routeAlias)=','inbound','CDR(routeid)=','push','Set','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','wav','options','split','length','trunk','param','phone','prefix','SIP','indexOf','U(xcally-mixmonitor-context)','replace','join','Interval','IntervalId','*,*,*,*','intervals','interval','map','tag','CDR(tag)=','toLowerCase','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','includes','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','last','concat','priority','define','VoiceExtension','voice_extensions','then','Hangup','lodash','./voiceExtension.attributes','exports','models','CDR(type)=','context','exten','type','alias'];(function(_0x125ab7,_0x2a1c41){var _0x5e3009=function(_0x5cb5b5){while(--_0x5cb5b5){_0x125ab7['push'](_0x125ab7['shift']());}};_0x5e3009(++_0x2a1c41);}(_0xa467,0xde));var _0x7a46=function(_0x140f21,_0x5a7cee){_0x140f21=_0x140f21-0x0;var _0x29d2f0=_0xa467[_0x140f21];return _0x29d2f0;};'use strict';var _=require(_0x7a46('0x0'));var attributes=require(_0x7a46('0x1'));module[_0x7a46('0x2')]=function(_0x46f0ea){var _0x2b1a88=_0x46f0ea[_0x7a46('0x3')];function _0xf0bef0(_0x55c4a7){var _0x1a39bf=0x2;var _0x5d2e0b=[{'type':_0x55c4a7['type'],'app':'Set','appdata':_0x7a46('0x4')+_0x55c4a7['type'],'context':_0x55c4a7[_0x7a46('0x5')],'exten':_0x55c4a7[_0x7a46('0x6')],'priority':_0x1a39bf++,'VoiceExtensionId':_0x55c4a7['id']},{'type':_0x55c4a7[_0x7a46('0x7')],'app':_0x55c4a7[_0x7a46('0x8')]?'Set':_0x7a46('0x9'),'appdata':_0x55c4a7['alias']?_0x7a46('0xa')+_0x55c4a7[_0x7a46('0x8')]:'No\x20alias\x20set','context':_0x55c4a7[_0x7a46('0x5')],'exten':_0x55c4a7['exten'],'priority':_0x1a39bf++,'VoiceExtensionId':_0x55c4a7['id']}];if(_0x55c4a7[_0x7a46('0x7')]==='inbound'){_0x5d2e0b['push']({'type':_0x7a46('0xb'),'app':'Set','appdata':_0x7a46('0xc')+_0x55c4a7['id'],'context':_0x55c4a7[_0x7a46('0x5')],'exten':_0x55c4a7[_0x7a46('0x6')],'priority':_0x1a39bf++,'VoiceExtensionId':_0x55c4a7['id']});}_0x5d2e0b[_0x7a46('0xd')]({'type':_0x55c4a7[_0x7a46('0x7')],'app':_0x7a46('0xe'),'appdata':_0x7a46('0xf'),'context':_0x55c4a7['context'],'exten':_0x55c4a7[_0x7a46('0x6')],'priority':_0x1a39bf++,'VoiceExtensionId':_0x55c4a7['id']},{'type':_0x55c4a7['type'],'app':_0x7a46('0xe'),'appdata':_0x7a46('0x10'),'context':_0x55c4a7[_0x7a46('0x5')],'exten':_0x55c4a7[_0x7a46('0x6')],'priority':_0x1a39bf++,'VoiceExtensionId':_0x55c4a7['id']},{'type':_0x55c4a7['type'],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x55c4a7[_0x7a46('0x5')],'exten':_0x55c4a7[_0x7a46('0x6')],'priority':_0x1a39bf++,'VoiceExtensionId':_0x55c4a7['id']});return _0x5d2e0b;}function _0x5cc32f(_0x5e8497){var _0x16dd53=0x2;var _0x29cf9d=[{'type':_0x7a46('0x11'),'app':'Set','appdata':_0x7a46('0x12'),'context':_0x5e8497['context'],'exten':_0x5e8497[_0x7a46('0x6')],'priority':_0x16dd53++,'VoiceExtensionId':_0x5e8497['id']},{'type':_0x7a46('0x11'),'app':_0x5e8497[_0x7a46('0x8')]?_0x7a46('0xe'):'NoOp','appdata':_0x5e8497[_0x7a46('0x8')]?_0x7a46('0xa')+_0x5e8497['alias']:_0x7a46('0x13'),'context':_0x5e8497[_0x7a46('0x5')],'exten':_0x5e8497['exten'],'priority':_0x16dd53++,'VoiceExtensionId':_0x5e8497['id']},{'type':'outbound','app':'Set','appdata':_0x7a46('0x14')+(_0x5e8497[_0x7a46('0x15')]?_0x7a46('0x16')+_0x5e8497[_0x7a46('0x15')]+'}':_0x7a46('0x17')),'context':_0x5e8497[_0x7a46('0x5')],'exten':_0x5e8497[_0x7a46('0x6')],'priority':_0x16dd53++,'VoiceExtensionId':_0x5e8497['id']},{'type':_0x7a46('0x11'),'app':_0x7a46('0xe'),'appdata':_0x7a46('0xc')+_0x5e8497['id'],'context':_0x5e8497[_0x7a46('0x5')],'exten':_0x5e8497[_0x7a46('0x6')],'priority':_0x16dd53++,'VoiceExtensionId':_0x5e8497['id']},{'type':_0x7a46('0x11'),'app':_0x7a46('0x18'),'appdata':_0x7a46('0x19')+(_0x16dd53+0x2)+_0x7a46('0x1a')+(_0x16dd53+0x1)+')','context':_0x5e8497[_0x7a46('0x5')],'exten':_0x5e8497[_0x7a46('0x6')],'priority':_0x16dd53++,'VoiceExtensionId':_0x5e8497['id']},{'type':_0x7a46('0x11'),'app':_0x7a46('0xe'),'appdata':_0x5e8497[_0x7a46('0x15')]?_0x7a46('0x1b')+_0x5e8497[_0x7a46('0x15')]+'}':'CDR(prefix)=noprefix','context':_0x5e8497[_0x7a46('0x5')],'exten':_0x5e8497[_0x7a46('0x6')],'priority':_0x16dd53++,'VoiceExtensionId':_0x5e8497['id']},{'type':'outbound','app':'Set','appdata':_0x7a46('0xf'),'context':_0x5e8497[_0x7a46('0x5')],'exten':_0x5e8497[_0x7a46('0x6')],'priority':_0x16dd53++,'VoiceExtensionId':_0x5e8497['id']},{'type':_0x7a46('0x11'),'app':'Set','appdata':_0x7a46('0x10'),'context':_0x5e8497[_0x7a46('0x5')],'exten':_0x5e8497[_0x7a46('0x6')],'priority':_0x16dd53++,'VoiceExtensionId':_0x5e8497['id']},{'type':_0x7a46('0x11'),'app':_0x7a46('0xe'),'appdata':_0x7a46('0x1c'),'context':_0x5e8497['context'],'exten':_0x5e8497[_0x7a46('0x6')],'priority':_0x16dd53++,'VoiceExtensionId':_0x5e8497['id']},{'type':'outbound','app':_0x7a46('0xe'),'appdata':_0x7a46('0x1d')+_0x5e8497['id'],'context':_0x5e8497[_0x7a46('0x5')],'exten':_0x5e8497[_0x7a46('0x6')],'priority':_0x16dd53++,'VoiceExtensionId':_0x5e8497['id']}];if(_0x5e8497[_0x7a46('0x1e')](_0x7a46('0x1f'))&&_0x5e8497['recordingFormat']!=='none'){_0x29cf9d[_0x7a46('0xd')]({'type':_0x7a46('0x11'),'app':_0x7a46('0xe'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x5e8497[_0x7a46('0x5')],'exten':_0x5e8497['exten'],'priority':_0x16dd53++,'VoiceExtensionId':_0x5e8497['id']},{'type':_0x7a46('0x11'),'app':_0x7a46('0xe'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x5e8497[_0x7a46('0x1f')]||_0x7a46('0x20'),'context':_0x5e8497[_0x7a46('0x5')],'exten':_0x5e8497['exten'],'priority':_0x16dd53++,'VoiceExtensionId':_0x5e8497['id']});}return _0x29cf9d;}function _0x429264(_0x2426ed,_0x4c5baa){var _0x431392=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0x7a46('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0x4e646e={};var _0x40fbe8=_0x4c5baa[_0x7a46('0x22')](',');var _0x1c2721=[];for(var _0x21191f=0x0;_0x21191f<_0x431392[_0x7a46('0x23')];_0x21191f++){switch(_0x431392[_0x21191f]['name']){case _0x7a46('0x24'):_0x4e646e[_0x7a46('0x24')]=_0x40fbe8[_0x431392[_0x21191f][_0x7a46('0x25')]][_0x7a46('0x22')]('/')[0x1];_0x4e646e[_0x7a46('0x26')]=_0x40fbe8[_0x431392[_0x21191f][_0x7a46('0x25')]]['split']('/')[0x2];_0x4e646e[_0x7a46('0x27')]=_0x4e646e[_0x7a46('0x26')]?_0x4e646e[_0x7a46('0x26')][_0x7a46('0x22')]('$')[0x0]:undefined;_0x4e646e[_0x7a46('0x26')]=_0x2426ed['cutdigits']?(_0x4e646e[_0x7a46('0x27')]||'')+_0x7a46('0x16')+_0x2426ed[_0x7a46('0x15')]+'}':(_0x4e646e[_0x7a46('0x27')]||'')+_0x7a46('0x17');_0x1c2721[_0x431392[_0x21191f][_0x7a46('0x25')]]=[_0x7a46('0x28'),_0x4e646e['trunk'],_0x4e646e[_0x7a46('0x26')]]['join']('/');break;case'options':_0x4e646e[_0x7a46('0x21')]=_0x40fbe8[_0x431392[_0x21191f][_0x7a46('0x25')]];if(_0x2426ed['recordingFormat']!=='none'){if(_0x4e646e[_0x7a46('0x21')][_0x7a46('0x29')](_0x7a46('0x2a'))<0x0){_0x4e646e[_0x7a46('0x21')]+=_0x7a46('0x2a');}}else{_0x4e646e['options']=_0x4e646e[_0x7a46('0x21')][_0x7a46('0x2b')]('U(xcally-mixmonitor-context)','');}_0x1c2721[_0x431392[_0x21191f][_0x7a46('0x25')]]=_0x4e646e[_0x7a46('0x21')];break;default:_0x1c2721[_0x431392[_0x21191f][_0x7a46('0x25')]]=_0x40fbe8[_0x431392[_0x21191f]['param']];}}return _0x1c2721[_0x7a46('0x2c')](',');}function _0x24f324(_0x182e98,_0x207c9e,_0x2a2c4d){return new Promise(function(_0x3f8165,_0x47095e){var _0x2c6884=[];if(_['isEmpty'](_0x207c9e))return _0x3f8165(_0x2c6884);_0x2b1a88[_0x7a46('0x2d')]['findAll']({'attributes':['id','interval',_0x7a46('0x2e')],'raw':!![]})['then'](function(_0x15ee7d){for(var _0x22b576=0x0,_0x51a968=0x0;_0x22b576<_0x207c9e[_0x7a46('0x23')];_0x22b576++,_0x51a968=0x0){var _0xc2a742=_0x207c9e[_0x22b576];var _0x7bd2db=[];var _0x33aacb=[];delete _0xc2a742['id'];if(_0xc2a742['interval']!==_0x7a46('0x2f')){_0xc2a742[_0x7a46('0x30')]=[_0xc2a742[_0x7a46('0x31')]];}else{_0xc2a742['intervals']=_0xc2a742[_0x7a46('0x2e')]?_[_0x7a46('0x32')](_['filter'](_0x15ee7d,{'IntervalId':_0xc2a742[_0x7a46('0x2e')]}),_0x7a46('0x31')):[];}_0xc2a742[_0x7a46('0x5')]=_0x182e98[_0x7a46('0x5')];_0xc2a742[_0x7a46('0x6')]=_0x182e98[_0x7a46('0x6')];if(_0xc2a742[_0x7a46('0x7')])_0xc2a742[_0x7a46('0x7')]=_0xc2a742[_0x7a46('0x7')]['toLowerCase']();if(_0x182e98['type']===_0x7a46('0x11')){if(_0xc2a742[_0x7a46('0x1e')](_0x7a46('0x33'))&&_0xc2a742['tag']&&_0xc2a742[_0x7a46('0x33')]!=='--'){_0x7bd2db[_0x7a46('0xd')]({'type':_0xc2a742[_0x7a46('0x7')]['toLowerCase'](),'app':_0x7a46('0xe'),'appdata':_0x7a46('0x34')+_0xc2a742['tag'],'context':_0x182e98[_0x7a46('0x5')],'exten':_0x182e98[_0x7a46('0x6')],'priority':_0xc2a742[_0x7a46('0x30')][_0x7a46('0x23')]+_0x2a2c4d+_0x51a968++,'VoiceExtensionId':_0x182e98['id']});}_0x7bd2db[_0x7a46('0xd')]({'type':_0xc2a742[_0x7a46('0x7')][_0x7a46('0x35')](),'app':_0x7a46('0x18'),'appdata':_0x7a46('0x36')+(_0xc2a742[_0x7a46('0x37')]?_0x7a46('0x38')+_0xc2a742[_0x7a46('0x37')]+')':'NoOp(No\x20number\x20available)'),'context':_0x182e98[_0x7a46('0x5')],'exten':_0x182e98[_0x7a46('0x6')],'priority':_0xc2a742[_0x7a46('0x30')][_0x7a46('0x23')]+_0x2a2c4d+_0x51a968++,'VoiceExtensionId':_0x182e98['id']});}else{if(_0xc2a742[_0x7a46('0x1e')]('answer')){if(['queue','playback'][_0x7a46('0x39')](_0xc2a742['app'][_0x7a46('0x35')]())&&_0xc2a742[_0x7a46('0x3a')]!==_0x7a46('0x3b')){if(_0xc2a742[_0x7a46('0x3c')]){_0x7bd2db[_0x7a46('0xd')]({'type':_0xc2a742['type']['toLowerCase'](),'app':'ExecIf','appdata':_0x7a46('0x3d'),'context':_0x182e98['context'],'exten':_0x182e98[_0x7a46('0x6')],'priority':_0xc2a742[_0x7a46('0x30')][_0x7a46('0x23')]+_0x2a2c4d+_0x51a968++,'VoiceExtensionId':_0x182e98['id']});_0x7bd2db['push']({'type':_0xc2a742['type'][_0x7a46('0x35')](),'app':_0x7a46('0xe'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x182e98[_0x7a46('0x5')],'exten':_0x182e98[_0x7a46('0x6')],'priority':_0xc2a742[_0x7a46('0x30')][_0x7a46('0x23')]+_0x2a2c4d+_0x51a968++,'VoiceExtensionId':_0x182e98['id']});}else{_0x7bd2db[_0x7a46('0xd')]({'type':_0xc2a742['type'][_0x7a46('0x35')](),'app':'ExecIf','appdata':_0x7a46('0x3e'),'context':_0x182e98[_0x7a46('0x5')],'exten':_0x182e98[_0x7a46('0x6')],'priority':_0xc2a742[_0x7a46('0x30')][_0x7a46('0x23')]+_0x2a2c4d+_0x51a968++,'VoiceExtensionId':_0x182e98['id']});_0x7bd2db[_0x7a46('0xd')]({'type':_0xc2a742[_0x7a46('0x7')]['toLowerCase'](),'app':'Set','appdata':_0x7a46('0x3f'),'context':_0x182e98[_0x7a46('0x5')],'exten':_0x182e98[_0x7a46('0x6')],'priority':_0xc2a742['intervals'][_0x7a46('0x23')]+_0x2a2c4d+_0x51a968++,'VoiceExtensionId':_0x182e98['id']});}}}}for(var _0x1b071d=0x0;_0x1b071d<_0xc2a742[_0x7a46('0x30')][_0x7a46('0x23')];_0x1b071d++){var _0x1d0001=_0x2a2c4d+_0xc2a742[_0x7a46('0x30')][_0x7a46('0x23')];var _0x13a74e=_0x1b071d===_0xc2a742[_0x7a46('0x30')][_0x7a46('0x23')]-0x1?_0x2a2c4d+_0x7bd2db['length']+_0x33aacb['length']+0x2:_0x2a2c4d+_0x1b071d+0x1;_0x7bd2db[_0x7a46('0x40')](_0x1b071d,0x0,{'type':_0x182e98[_0x7a46('0x7')],'app':'GotoIfTime','appdata':_0xc2a742['intervals'][_0x1b071d]+'?'+_0x182e98[_0x7a46('0x5')]+_0x7a46('0x41')+_0x1d0001+':'+_0x182e98[_0x7a46('0x5')]+_0x7a46('0x41')+_0x13a74e,'exten':_0x182e98['exten'],'context':_0x182e98[_0x7a46('0x5')],'priority':_0x2a2c4d+_0x1b071d,'VoiceExtensionId':_0x182e98['id']});}if(_0xc2a742[_0x7a46('0x3a')]===_0x7a46('0x42')){_0xc2a742['appdata']=_0x429264(_0x182e98,_0xc2a742['appdata']);}if(_0xc2a742['appType']===_0x7a46('0x43')){_0x7bd2db[_0x7a46('0xd')]({'type':_0xc2a742['type'][_0x7a46('0x35')](),'app':_0x7a46('0xe'),'appdata':_0x7a46('0x44'),'context':_0x182e98[_0x7a46('0x5')],'exten':_0x182e98[_0x7a46('0x6')],'priority':_0xc2a742[_0x7a46('0x30')]['length']+_0x2a2c4d+_0x51a968++,'VoiceExtensionId':_0x182e98['id']});}_0xc2a742['priority']=_0x7bd2db[_0x7a46('0x23')]?_[_0x7a46('0x45')](_0x7bd2db)['priority']+0x1:_0x2a2c4d;_0x2c6884=_[_0x7a46('0x46')](_0x2c6884,_0x7bd2db,[_0xc2a742],_0x33aacb);_0x2a2c4d=_[_0x7a46('0x45')](_0x2c6884)[_0x7a46('0x47')]+0x1;}return _0x3f8165(_0x2c6884);})['catch'](function(_0x314c87){_0x47095e(_0x314c87);});});}return _0x46f0ea[_0x7a46('0x48')](_0x7a46('0x49'),attributes,{'tableName':_0x7a46('0x4a'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x59693c){var _0x42de8d=this['get']({'plain':!![]});var _0x500d7f=_0x42de8d[_0x7a46('0x7')]===_0x7a46('0x11')?_0x5cc32f(_0x42de8d):_0xf0bef0(_0x42de8d);return _0x24f324(_0x42de8d,_0x59693c,_['last'](_0x500d7f)['priority']+0x1)[_0x7a46('0x4b')](function(_0x513e0c){var _0x3e9ab9=_[_0x7a46('0x46')](_0x500d7f,_0x513e0c);_0x3e9ab9[_0x7a46('0xd')]({'type':_0x42de8d['type'],'app':_0x7a46('0x4c'),'exten':_0x42de8d[_0x7a46('0x6')],'context':_0x42de8d['context'],'priority':_[_0x7a46('0x45')](_0x3e9ab9)[_0x7a46('0x47')]+0x1,'VoiceExtensionId':_0x42de8d['id']});return _0x3e9ab9;});}}});}; \ No newline at end of file +var _0xb3c8=['CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','options','url','length','param','phone','prefix','${EXTEN:','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','NoOp','alias','CDR(routeAlias)=','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xb3c8,0x197));var _0x8b3c=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xb3c8[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0x8b3c('0x0'));var attributes=require(_0x8b3c('0x1'));module[_0x8b3c('0x2')]=function(_0x39260b){var _0x290fe8=_0x39260b[_0x8b3c('0x3')];function _0x3cee45(_0x25af7a){var _0x3631c4=0x2;var _0x540b00=[{'type':_0x25af7a[_0x8b3c('0x4')],'app':_0x8b3c('0x5'),'appdata':_0x8b3c('0x6')+_0x25af7a[_0x8b3c('0x4')],'context':_0x25af7a[_0x8b3c('0x7')],'exten':_0x25af7a[_0x8b3c('0x8')],'priority':_0x3631c4++,'VoiceExtensionId':_0x25af7a['id']},{'type':_0x25af7a[_0x8b3c('0x4')],'app':_0x25af7a['alias']?_0x8b3c('0x5'):_0x8b3c('0x9'),'appdata':_0x25af7a[_0x8b3c('0xa')]?_0x8b3c('0xb')+_0x25af7a[_0x8b3c('0xa')]:'No\x20alias\x20set','context':_0x25af7a['context'],'exten':_0x25af7a[_0x8b3c('0x8')],'priority':_0x3631c4++,'VoiceExtensionId':_0x25af7a['id']}];if(_0x25af7a[_0x8b3c('0x4')]===_0x8b3c('0xc')){_0x540b00[_0x8b3c('0xd')]({'type':'inbound','app':_0x8b3c('0x5'),'appdata':'CDR(routeid)='+_0x25af7a['id'],'context':_0x25af7a[_0x8b3c('0x7')],'exten':_0x25af7a[_0x8b3c('0x8')],'priority':_0x3631c4++,'VoiceExtensionId':_0x25af7a['id']});}_0x540b00[_0x8b3c('0xd')]({'type':_0x25af7a[_0x8b3c('0x4')],'app':_0x8b3c('0x5'),'appdata':_0x8b3c('0xe'),'context':_0x25af7a['context'],'exten':_0x25af7a[_0x8b3c('0x8')],'priority':_0x3631c4++,'VoiceExtensionId':_0x25af7a['id']},{'type':_0x25af7a[_0x8b3c('0x4')],'app':_0x8b3c('0x5'),'appdata':_0x8b3c('0xf'),'context':_0x25af7a[_0x8b3c('0x7')],'exten':_0x25af7a[_0x8b3c('0x8')],'priority':_0x3631c4++,'VoiceExtensionId':_0x25af7a['id']},{'type':_0x25af7a[_0x8b3c('0x4')],'app':_0x8b3c('0x5'),'appdata':_0x8b3c('0x10'),'context':_0x25af7a[_0x8b3c('0x7')],'exten':_0x25af7a[_0x8b3c('0x8')],'priority':_0x3631c4++,'VoiceExtensionId':_0x25af7a['id']});return _0x540b00;}function _0x2c6f6f(_0x14acb8){var _0x13d496=0x2;var _0x5407c6=[{'type':_0x8b3c('0x11'),'app':_0x8b3c('0x5'),'appdata':_0x8b3c('0x12'),'context':_0x14acb8[_0x8b3c('0x7')],'exten':_0x14acb8['exten'],'priority':_0x13d496++,'VoiceExtensionId':_0x14acb8['id']},{'type':_0x8b3c('0x11'),'app':_0x14acb8[_0x8b3c('0xa')]?'Set':_0x8b3c('0x9'),'appdata':_0x14acb8[_0x8b3c('0xa')]?_0x8b3c('0xb')+_0x14acb8[_0x8b3c('0xa')]:_0x8b3c('0x13'),'context':_0x14acb8['context'],'exten':_0x14acb8[_0x8b3c('0x8')],'priority':_0x13d496++,'VoiceExtensionId':_0x14acb8['id']},{'type':_0x8b3c('0x11'),'app':_0x8b3c('0x5'),'appdata':_0x8b3c('0x14')+(_0x14acb8[_0x8b3c('0x15')]?'${EXTEN:'+_0x14acb8[_0x8b3c('0x15')]+'}':_0x8b3c('0x16')),'context':_0x14acb8[_0x8b3c('0x7')],'exten':_0x14acb8[_0x8b3c('0x8')],'priority':_0x13d496++,'VoiceExtensionId':_0x14acb8['id']},{'type':_0x8b3c('0x11'),'app':_0x8b3c('0x5'),'appdata':_0x8b3c('0x17')+_0x14acb8['id'],'context':_0x14acb8[_0x8b3c('0x7')],'exten':_0x14acb8[_0x8b3c('0x8')],'priority':_0x13d496++,'VoiceExtensionId':_0x14acb8['id']},{'type':_0x8b3c('0x11'),'app':_0x8b3c('0x18'),'appdata':_0x8b3c('0x19')+(_0x13d496+0x2)+_0x8b3c('0x1a')+(_0x13d496+0x1)+')','context':_0x14acb8[_0x8b3c('0x7')],'exten':_0x14acb8[_0x8b3c('0x8')],'priority':_0x13d496++,'VoiceExtensionId':_0x14acb8['id']},{'type':_0x8b3c('0x11'),'app':_0x8b3c('0x5'),'appdata':_0x14acb8[_0x8b3c('0x15')]?_0x8b3c('0x1b')+_0x14acb8[_0x8b3c('0x15')]+'}':_0x8b3c('0x1c'),'context':_0x14acb8[_0x8b3c('0x7')],'exten':_0x14acb8[_0x8b3c('0x8')],'priority':_0x13d496++,'VoiceExtensionId':_0x14acb8['id']},{'type':'outbound','app':_0x8b3c('0x5'),'appdata':_0x8b3c('0xe'),'context':_0x14acb8[_0x8b3c('0x7')],'exten':_0x14acb8['exten'],'priority':_0x13d496++,'VoiceExtensionId':_0x14acb8['id']},{'type':_0x8b3c('0x11'),'app':'Set','appdata':_0x8b3c('0xf'),'context':_0x14acb8['context'],'exten':_0x14acb8['exten'],'priority':_0x13d496++,'VoiceExtensionId':_0x14acb8['id']},{'type':_0x8b3c('0x11'),'app':_0x8b3c('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x14acb8[_0x8b3c('0x7')],'exten':_0x14acb8['exten'],'priority':_0x13d496++,'VoiceExtensionId':_0x14acb8['id']},{'type':_0x8b3c('0x11'),'app':_0x8b3c('0x5'),'appdata':'outboundrouteid='+_0x14acb8['id'],'context':_0x14acb8['context'],'exten':_0x14acb8['exten'],'priority':_0x13d496++,'VoiceExtensionId':_0x14acb8['id']}];if(_0x14acb8[_0x8b3c('0x1d')]('recordingFormat')&&_0x14acb8[_0x8b3c('0x1e')]!==_0x8b3c('0x1f')){_0x5407c6[_0x8b3c('0xd')]({'type':'outbound','app':_0x8b3c('0x5'),'appdata':_0x8b3c('0x20'),'context':_0x14acb8[_0x8b3c('0x7')],'exten':_0x14acb8[_0x8b3c('0x8')],'priority':_0x13d496++,'VoiceExtensionId':_0x14acb8['id']},{'type':_0x8b3c('0x11'),'app':'Set','appdata':_0x8b3c('0x21')+_0x14acb8[_0x8b3c('0x1e')]||_0x8b3c('0x22'),'context':_0x14acb8[_0x8b3c('0x7')],'exten':_0x14acb8[_0x8b3c('0x8')],'priority':_0x13d496++,'VoiceExtensionId':_0x14acb8['id']});}return _0x5407c6;}function _0xce7dbb(_0x4377c4,_0xc999df){var _0x2674af=[{'name':_0x8b3c('0x23'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x8b3c('0x24'),'param':0x2},{'name':_0x8b3c('0x25'),'param':0x3}];var _0x35066e={};var _0x76c3da=_0xc999df['split'](',');var _0x5c8e2d=[];for(var _0x565cb2=0x0;_0x565cb2<_0x2674af[_0x8b3c('0x26')];_0x565cb2++){switch(_0x2674af[_0x565cb2]['name']){case _0x8b3c('0x23'):_0x35066e[_0x8b3c('0x23')]=_0x76c3da[_0x2674af[_0x565cb2][_0x8b3c('0x27')]]['split']('/')[0x1];_0x35066e[_0x8b3c('0x28')]=_0x76c3da[_0x2674af[_0x565cb2][_0x8b3c('0x27')]]['split']('/')[0x2];_0x35066e[_0x8b3c('0x29')]=_0x35066e[_0x8b3c('0x28')]?_0x35066e['phone']['split']('$')[0x0]:undefined;_0x35066e[_0x8b3c('0x28')]=_0x4377c4[_0x8b3c('0x15')]?(_0x35066e[_0x8b3c('0x29')]||'')+_0x8b3c('0x2a')+_0x4377c4['cutdigits']+'}':(_0x35066e['prefix']||'')+_0x8b3c('0x16');_0x5c8e2d[_0x2674af[_0x565cb2][_0x8b3c('0x27')]]=[_0x8b3c('0x2b'),_0x35066e['trunk'],_0x35066e[_0x8b3c('0x28')]][_0x8b3c('0x2c')]('/');break;case'options':_0x35066e['options']=_0x76c3da[_0x2674af[_0x565cb2][_0x8b3c('0x27')]];if(_0x4377c4[_0x8b3c('0x1e')]!==_0x8b3c('0x1f')){if(_0x35066e[_0x8b3c('0x24')][_0x8b3c('0x2d')](_0x8b3c('0x2e'))<0x0){_0x35066e['options']+=_0x8b3c('0x2e');}}else{_0x35066e[_0x8b3c('0x24')]=_0x35066e[_0x8b3c('0x24')][_0x8b3c('0x2f')](_0x8b3c('0x2e'),'');}_0x5c8e2d[_0x2674af[_0x565cb2][_0x8b3c('0x27')]]=_0x35066e[_0x8b3c('0x24')];break;default:_0x5c8e2d[_0x2674af[_0x565cb2][_0x8b3c('0x27')]]=_0x76c3da[_0x2674af[_0x565cb2][_0x8b3c('0x27')]];}}return _0x5c8e2d[_0x8b3c('0x2c')](',');}function _0x2f8f4c(_0x9a4315,_0x5c812a,_0x4bd794){return new Promise(function(_0x1659ab,_0x32c6b6){var _0x1bb9e0=[];if(_[_0x8b3c('0x30')](_0x5c812a))return _0x1659ab(_0x1bb9e0);_0x290fe8[_0x8b3c('0x31')]['findAll']({'attributes':['id',_0x8b3c('0x32'),_0x8b3c('0x33')],'raw':!![]})[_0x8b3c('0x34')](function(_0x5d1bc4){for(var _0x33c897=0x0,_0xa19d39=0x0;_0x33c897<_0x5c812a[_0x8b3c('0x26')];_0x33c897++,_0xa19d39=0x0){var _0x23b32f=_0x5c812a[_0x33c897];var _0x278e84=[];var _0x531e46=[];delete _0x23b32f['id'];if(_0x23b32f[_0x8b3c('0x32')]!==_0x8b3c('0x35')){_0x23b32f[_0x8b3c('0x36')]=[_0x23b32f[_0x8b3c('0x32')]];}else{_0x23b32f['intervals']=_0x23b32f[_0x8b3c('0x33')]?_[_0x8b3c('0x37')](_[_0x8b3c('0x38')](_0x5d1bc4,{'IntervalId':_0x23b32f[_0x8b3c('0x33')]}),_0x8b3c('0x32')):[];}_0x23b32f[_0x8b3c('0x7')]=_0x9a4315['context'];_0x23b32f[_0x8b3c('0x8')]=_0x9a4315[_0x8b3c('0x8')];if(_0x23b32f[_0x8b3c('0x4')])_0x23b32f[_0x8b3c('0x4')]=_0x23b32f[_0x8b3c('0x4')][_0x8b3c('0x39')]();if(_0x9a4315['type']===_0x8b3c('0x11')){if(_0x23b32f[_0x8b3c('0x1d')]('tag')&&_0x23b32f[_0x8b3c('0x3a')]&&_0x23b32f[_0x8b3c('0x3a')]!=='--'){_0x278e84[_0x8b3c('0xd')]({'type':_0x23b32f[_0x8b3c('0x4')][_0x8b3c('0x39')](),'app':_0x8b3c('0x5'),'appdata':'CDR(tag)='+_0x23b32f[_0x8b3c('0x3a')],'context':_0x9a4315[_0x8b3c('0x7')],'exten':_0x9a4315[_0x8b3c('0x8')],'priority':_0x23b32f[_0x8b3c('0x36')]['length']+_0x4bd794+_0xa19d39++,'VoiceExtensionId':_0x9a4315['id']});}_0x278e84[_0x8b3c('0xd')]({'type':_0x23b32f[_0x8b3c('0x4')]['toLowerCase'](),'app':_0x8b3c('0x18'),'appdata':_0x8b3c('0x3b')+(_0x23b32f[_0x8b3c('0x3c')]?_0x8b3c('0x3d')+_0x23b32f[_0x8b3c('0x3c')]+')':_0x8b3c('0x3e')),'context':_0x9a4315[_0x8b3c('0x7')],'exten':_0x9a4315[_0x8b3c('0x8')],'priority':_0x23b32f[_0x8b3c('0x36')][_0x8b3c('0x26')]+_0x4bd794+_0xa19d39++,'VoiceExtensionId':_0x9a4315['id']});}else{if(_0x23b32f['hasOwnProperty'](_0x8b3c('0x3f'))){if([_0x8b3c('0x40'),_0x8b3c('0x41')]['includes'](_0x23b32f['app'][_0x8b3c('0x39')]())&&_0x23b32f['appType']!==_0x8b3c('0x42')){if(_0x23b32f['answer']){_0x278e84[_0x8b3c('0xd')]({'type':_0x23b32f['type'][_0x8b3c('0x39')](),'app':_0x8b3c('0x18'),'appdata':_0x8b3c('0x43'),'context':_0x9a4315[_0x8b3c('0x7')],'exten':_0x9a4315[_0x8b3c('0x8')],'priority':_0x23b32f[_0x8b3c('0x36')][_0x8b3c('0x26')]+_0x4bd794+_0xa19d39++,'VoiceExtensionId':_0x9a4315['id']});_0x278e84[_0x8b3c('0xd')]({'type':_0x23b32f[_0x8b3c('0x4')][_0x8b3c('0x39')](),'app':_0x8b3c('0x5'),'appdata':_0x8b3c('0x44'),'context':_0x9a4315[_0x8b3c('0x7')],'exten':_0x9a4315[_0x8b3c('0x8')],'priority':_0x23b32f[_0x8b3c('0x36')][_0x8b3c('0x26')]+_0x4bd794+_0xa19d39++,'VoiceExtensionId':_0x9a4315['id']});}else{_0x278e84[_0x8b3c('0xd')]({'type':_0x23b32f[_0x8b3c('0x4')]['toLowerCase'](),'app':_0x8b3c('0x18'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x9a4315[_0x8b3c('0x7')],'exten':_0x9a4315[_0x8b3c('0x8')],'priority':_0x23b32f[_0x8b3c('0x36')][_0x8b3c('0x26')]+_0x4bd794+_0xa19d39++,'VoiceExtensionId':_0x9a4315['id']});_0x278e84[_0x8b3c('0xd')]({'type':_0x23b32f[_0x8b3c('0x4')][_0x8b3c('0x39')](),'app':_0x8b3c('0x5'),'appdata':_0x8b3c('0x45'),'context':_0x9a4315[_0x8b3c('0x7')],'exten':_0x9a4315[_0x8b3c('0x8')],'priority':_0x23b32f[_0x8b3c('0x36')]['length']+_0x4bd794+_0xa19d39++,'VoiceExtensionId':_0x9a4315['id']});}}}}for(var _0xee68cd=0x0;_0xee68cd<_0x23b32f['intervals'][_0x8b3c('0x26')];_0xee68cd++){var _0xc57ca9=_0x4bd794+_0x23b32f[_0x8b3c('0x36')]['length'];var _0x4d3d5b=_0xee68cd===_0x23b32f[_0x8b3c('0x36')][_0x8b3c('0x26')]-0x1?_0x4bd794+_0x278e84['length']+_0x531e46[_0x8b3c('0x26')]+0x2:_0x4bd794+_0xee68cd+0x1;_0x278e84[_0x8b3c('0x46')](_0xee68cd,0x0,{'type':_0x9a4315[_0x8b3c('0x4')],'app':_0x8b3c('0x47'),'appdata':_0x23b32f[_0x8b3c('0x36')][_0xee68cd]+'?'+_0x9a4315[_0x8b3c('0x7')]+_0x8b3c('0x48')+_0xc57ca9+':'+_0x9a4315[_0x8b3c('0x7')]+_0x8b3c('0x48')+_0x4d3d5b,'exten':_0x9a4315[_0x8b3c('0x8')],'context':_0x9a4315[_0x8b3c('0x7')],'priority':_0x4bd794+_0xee68cd,'VoiceExtensionId':_0x9a4315['id']});}if(_0x23b32f[_0x8b3c('0x49')]===_0x8b3c('0x4a')){_0x23b32f['appdata']=_0xce7dbb(_0x9a4315,_0x23b32f[_0x8b3c('0x4b')]);}if(_0x23b32f[_0x8b3c('0x49')]===_0x8b3c('0x4c')){_0x278e84[_0x8b3c('0xd')]({'type':_0x23b32f[_0x8b3c('0x4')]['toLowerCase'](),'app':_0x8b3c('0x5'),'appdata':_0x8b3c('0x4d'),'context':_0x9a4315[_0x8b3c('0x7')],'exten':_0x9a4315[_0x8b3c('0x8')],'priority':_0x23b32f[_0x8b3c('0x36')]['length']+_0x4bd794+_0xa19d39++,'VoiceExtensionId':_0x9a4315['id']});}_0x23b32f[_0x8b3c('0x4e')]=_0x278e84['length']?_[_0x8b3c('0x4f')](_0x278e84)[_0x8b3c('0x4e')]+0x1:_0x4bd794;_0x1bb9e0=_[_0x8b3c('0x50')](_0x1bb9e0,_0x278e84,[_0x23b32f],_0x531e46);_0x4bd794=_[_0x8b3c('0x4f')](_0x1bb9e0)['priority']+0x1;}return _0x1659ab(_0x1bb9e0);})[_0x8b3c('0x51')](function(_0x2bf120){_0x32c6b6(_0x2bf120);});});}return _0x39260b[_0x8b3c('0x52')](_0x8b3c('0x53'),attributes,{'tableName':_0x8b3c('0x54'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x37d74d){var _0xd96e01=this[_0x8b3c('0x55')]({'plain':!![]});var _0x300147=_0xd96e01[_0x8b3c('0x4')]===_0x8b3c('0x11')?_0x2c6f6f(_0xd96e01):_0x3cee45(_0xd96e01);return _0x2f8f4c(_0xd96e01,_0x37d74d,_[_0x8b3c('0x4f')](_0x300147)['priority']+0x1)['then'](function(_0x1b547c){var _0x3143cf=_[_0x8b3c('0x50')](_0x300147,_0x1b547c);_0x3143cf[_0x8b3c('0xd')]({'type':_0xd96e01['type'],'app':_0x8b3c('0x56'),'exten':_0xd96e01[_0x8b3c('0x8')],'context':_0xd96e01[_0x8b3c('0x7')],'priority':_[_0x8b3c('0x4f')](_0x3143cf)[_0x8b3c('0x4e')]+0x1,'VoiceExtensionId':_0xd96e01['id']});return _0x3143cf;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 81c534f..570a3fe 100644 --- a/server/api/voiceExtension/voiceExtension.rpc.js +++ b/server/api/voiceExtension/voiceExtension.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a96=['VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xc0ae59,_0xf24b6f){var _0x2eeca9=function(_0x40ff6a){while(--_0x40ff6a){_0xc0ae59['push'](_0xc0ae59['shift']());}};_0x2eeca9(++_0xf24b6f);}(_0x9a96,0xd0));var _0x69a9=function(_0x205a5c,_0x58c037){_0x205a5c=_0x205a5c-0x0;var _0x5930a9=_0x9a96[_0x205a5c];return _0x5930a9;};'use strict';var _=require(_0x69a9('0x0'));var util=require(_0x69a9('0x1'));var moment=require(_0x69a9('0x2'));var BPromise=require(_0x69a9('0x3'));var rs=require(_0x69a9('0x4'));var fs=require('fs');var Redis=require(_0x69a9('0x5'));var db=require(_0x69a9('0x6'))['db'];var utils=require(_0x69a9('0x7'));var logger=require(_0x69a9('0x8'))(_0x69a9('0x9'));var config=require(_0x69a9('0xa'));var jayson=require(_0x69a9('0xb'));var client=jayson['client'][_0x69a9('0xc')]({'port':0x232a});config[_0x69a9('0xd')]=_[_0x69a9('0xe')](config[_0x69a9('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x69a9('0xf'))(new Redis(config[_0x69a9('0xd')]));require(_0x69a9('0x10'))[_0x69a9('0x11')](socket);function respondWithRpcPromise(_0x510cee,_0x15b6c7,_0x1dbcdb){return new BPromise(function(_0x5f3217,_0x4382d4){return client['request'](_0x510cee,_0x1dbcdb)[_0x69a9('0x12')](function(_0xb6e00f){logger[_0x69a9('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x15b6c7,_0x69a9('0x14'));logger[_0x69a9('0x15')](_0x69a9('0x16'),_0x15b6c7,_0x69a9('0x14'),JSON[_0x69a9('0x17')](_0xb6e00f));if(_0xb6e00f[_0x69a9('0x18')]){if(_0xb6e00f[_0x69a9('0x18')][_0x69a9('0x19')]===0x1f4){logger['error'](_0x69a9('0x1a'),_0x15b6c7,_0xb6e00f[_0x69a9('0x18')][_0x69a9('0x1b')]);return _0x4382d4(_0xb6e00f[_0x69a9('0x18')][_0x69a9('0x1b')]);}logger[_0x69a9('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x15b6c7,_0xb6e00f['error'][_0x69a9('0x1b')]);return _0x5f3217(_0xb6e00f[_0x69a9('0x18')][_0x69a9('0x1b')]);}else{logger['info'](_0x69a9('0x1a'),_0x15b6c7,_0x69a9('0x14'));_0x5f3217(_0xb6e00f[_0x69a9('0x1c')][_0x69a9('0x1b')]);}})[_0x69a9('0x1d')](function(_0x38d6cf){logger[_0x69a9('0x18')](_0x69a9('0x1a'),_0x15b6c7,_0x38d6cf);_0x4382d4(_0x38d6cf);});});}exports[_0x69a9('0x1e')]=function(_0x28b75b){var _0x4985bf=this;return new Promise(function(_0x59b6af,_0xcc835){return db[_0x69a9('0x1f')][_0x69a9('0x20')]({'raw':_0x28b75b['options']?_0x28b75b['options']['raw']===undefined?!![]:![]:!![],'where':_0x28b75b['options']?_0x28b75b[_0x69a9('0x21')][_0x69a9('0x22')]||null:null,'attributes':_0x28b75b[_0x69a9('0x21')]?_0x28b75b[_0x69a9('0x21')][_0x69a9('0x23')]||null:null,'limit':_0x28b75b['options']?_0x28b75b['options']['limit']||null:null,'include':_0x28b75b['options']?_0x28b75b[_0x69a9('0x21')][_0x69a9('0x24')]?_['map'](_0x28b75b['options']['include'],function(_0x4685e3){return{'model':db[_0x4685e3[_0x69a9('0x25')]],'as':_0x4685e3['as'],'attributes':_0x4685e3['attributes'],'include':_0x4685e3[_0x69a9('0x24')]?_[_0x69a9('0x26')](_0x4685e3['include'],function(_0x44cbbc){return{'model':db[_0x44cbbc['model']],'as':_0x44cbbc['as'],'attributes':_0x44cbbc[_0x69a9('0x23')],'include':_0x44cbbc[_0x69a9('0x24')]?_[_0x69a9('0x26')](_0x44cbbc[_0x69a9('0x24')],function(_0x2299b2){return{'model':db[_0x2299b2[_0x69a9('0x25')]],'as':_0x2299b2['as'],'attributes':_0x2299b2[_0x69a9('0x23')]};}):[]};}):[]};}):[]:[]})[_0x69a9('0x12')](function(_0xc68890){logger[_0x69a9('0x13')](_0x69a9('0x1e'),_0x28b75b);logger['debug'](_0x69a9('0x1e'),_0x28b75b,JSON[_0x69a9('0x17')](_0xc68890));_0x59b6af(_0xc68890);})[_0x69a9('0x1d')](function(_0x4dcf96){logger[_0x69a9('0x18')](_0x69a9('0x1e'),_0x4dcf96[_0x69a9('0x1b')],_0x28b75b);_0xcc835(_0x4985bf[_0x69a9('0x18')](0x1f4,_0x4dcf96[_0x69a9('0x1b')]));});});}; \ No newline at end of file +var _0xbd0a=['request','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VoiceExtension','findAll','options','raw','attributes','limit','include','map','model','GetVoiceExtension','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceExtension.socket'];(function(_0x2f88c2,_0x1e1086){var _0x381475=function(_0xbfe3d3){while(--_0xbfe3d3){_0x2f88c2['push'](_0x2f88c2['shift']());}};_0x381475(++_0x1e1086);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x4f3c4f,_0x453492){_0x4f3c4f=_0x4f3c4f-0x0;var _0x58c273=_0xbd0a[_0x4f3c4f];return _0x58c273;};'use strict';var _=require(_0xabd0('0x0'));var util=require('util');var moment=require(_0xabd0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabd0('0x2'))['db'];var utils=require(_0xabd0('0x3'));var logger=require(_0xabd0('0x4'))(_0xabd0('0x5'));var config=require(_0xabd0('0x6'));var jayson=require(_0xabd0('0x7'));var client=jayson[_0xabd0('0x8')][_0xabd0('0x9')]({'port':0x232a});config[_0xabd0('0xa')]=_['defaults'](config[_0xabd0('0xa')],{'host':_0xabd0('0xb'),'port':0x18eb});var socket=require(_0xabd0('0xc'))(new Redis(config['redis']));require(_0xabd0('0xd'))['register'](socket);function respondWithRpcPromise(_0x151048,_0x23d4e4,_0x2c31c9){return new BPromise(function(_0x3dc0ab,_0x50fc2d){return client[_0xabd0('0xe')](_0x151048,_0x2c31c9)['then'](function(_0x1b78e2){logger[_0xabd0('0xf')](_0xabd0('0x10'),_0x23d4e4,_0xabd0('0x11'));logger[_0xabd0('0x12')](_0xabd0('0x13'),_0x23d4e4,'request\x20sent',JSON[_0xabd0('0x14')](_0x1b78e2));if(_0x1b78e2['error']){if(_0x1b78e2[_0xabd0('0x15')][_0xabd0('0x16')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x23d4e4,_0x1b78e2['error']['message']);return _0x50fc2d(_0x1b78e2[_0xabd0('0x15')][_0xabd0('0x17')]);}logger[_0xabd0('0x15')](_0xabd0('0x10'),_0x23d4e4,_0x1b78e2[_0xabd0('0x15')][_0xabd0('0x17')]);return _0x3dc0ab(_0x1b78e2[_0xabd0('0x15')][_0xabd0('0x17')]);}else{logger[_0xabd0('0xf')]('VoiceExtension,\x20%s,\x20%s',_0x23d4e4,_0xabd0('0x11'));_0x3dc0ab(_0x1b78e2['result']['message']);}})[_0xabd0('0x18')](function(_0x391988){logger[_0xabd0('0x15')](_0xabd0('0x10'),_0x23d4e4,_0x391988);_0x50fc2d(_0x391988);});});}exports['GetVoiceExtension']=function(_0x862492){var _0x1f2ecb=this;return new Promise(function(_0x4eed20,_0x56c2f5){return db[_0xabd0('0x19')][_0xabd0('0x1a')]({'raw':_0x862492['options']?_0x862492[_0xabd0('0x1b')][_0xabd0('0x1c')]===undefined?!![]:![]:!![],'where':_0x862492[_0xabd0('0x1b')]?_0x862492[_0xabd0('0x1b')]['where']||null:null,'attributes':_0x862492[_0xabd0('0x1b')]?_0x862492[_0xabd0('0x1b')][_0xabd0('0x1d')]||null:null,'limit':_0x862492[_0xabd0('0x1b')]?_0x862492[_0xabd0('0x1b')][_0xabd0('0x1e')]||null:null,'include':_0x862492[_0xabd0('0x1b')]?_0x862492[_0xabd0('0x1b')][_0xabd0('0x1f')]?_[_0xabd0('0x20')](_0x862492['options'][_0xabd0('0x1f')],function(_0x2699c4){return{'model':db[_0x2699c4[_0xabd0('0x21')]],'as':_0x2699c4['as'],'attributes':_0x2699c4[_0xabd0('0x1d')],'include':_0x2699c4[_0xabd0('0x1f')]?_[_0xabd0('0x20')](_0x2699c4[_0xabd0('0x1f')],function(_0x3a10d6){return{'model':db[_0x3a10d6[_0xabd0('0x21')]],'as':_0x3a10d6['as'],'attributes':_0x3a10d6[_0xabd0('0x1d')],'include':_0x3a10d6[_0xabd0('0x1f')]?_[_0xabd0('0x20')](_0x3a10d6[_0xabd0('0x1f')],function(_0x3246de){return{'model':db[_0x3246de[_0xabd0('0x21')]],'as':_0x3246de['as'],'attributes':_0x3246de[_0xabd0('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c0d90){logger[_0xabd0('0xf')](_0xabd0('0x22'),_0x862492);logger[_0xabd0('0x12')]('GetVoiceExtension',_0x862492,JSON[_0xabd0('0x14')](_0x1c0d90));_0x4eed20(_0x1c0d90);})[_0xabd0('0x18')](function(_0x20ff0a){logger['error'](_0xabd0('0x22'),_0x20ff0a[_0xabd0('0x17')],_0x862492);_0x56c2f5(_0x1f2ecb['error'](0x1f4,_0x20ff0a[_0xabd0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 8093d60..839f83d 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x436e4c,_0x3754f9){var _0x383d70=function(_0x22bfd4){while(--_0x22bfd4){_0x436e4c['push'](_0x436e4c['shift']());}};_0x383d70(++_0x3754f9);}(_0x326f,0xd1));var _0xf326=function(_0x298af3,_0x194ba3){_0x298af3=_0x298af3-0x0;var _0x5886cc=_0x326f[_0x298af3];return _0x5886cc;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file +var _0x0295=['emit','removeListener','register','voiceExtension:','./voiceExtension.events','update'];(function(_0x4abf8b,_0x46f226){var _0x504664=function(_0x4b936b){while(--_0x4b936b){_0x4abf8b['push'](_0x4abf8b['shift']());}};_0x504664(++_0x46f226);}(_0x0295,0x1f0));var _0x5029=function(_0x118733,_0x2bd820){_0x118733=_0x118733-0x0;var _0x4777af=_0x0295[_0x118733];return _0x4777af;};'use strict';var VoiceExtensionEvents=require(_0x5029('0x0'));var events=['save','remove',_0x5029('0x1')];function createListener(_0x4f552a,_0x53c2e1){return function(_0x315589){_0x53c2e1[_0x5029('0x2')](_0x4f552a,_0x315589);};}function removeListener(_0x157a4f,_0x3d0af1){return function(){VoiceExtensionEvents[_0x5029('0x3')](_0x157a4f,_0x3d0af1);};}exports[_0x5029('0x4')]=function(_0x200217){for(var _0x215955=0x0,_0x5b3cd=events['length'];_0x215955<_0x5b3cd;_0x215955++){var _0x54978f=events[_0x215955];var _0x4ee867=createListener(_0x5029('0x5')+_0x54978f,_0x200217);VoiceExtensionEvents['on'](_0x54978f,_0x4ee867);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 3ab2d7c..c6cfdff 100644 --- a/server/api/voiceMail/index.js +++ b/server/api/voiceMail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMail.controller','isAuthenticated','get','/:id','show','/:id/messages','getMessages','post','create','put'];(function(_0x3bcfbd,_0x337e00){var _0x46e92b=function(_0x3afbf2){while(--_0x3afbf2){_0x3bcfbd['push'](_0x3bcfbd['shift']());}};_0x46e92b(++_0x337e00);}(_0x53ec,0x192));var _0xc53e=function(_0x56c4de,_0xf1c874){_0x56c4de=_0x56c4de-0x0;var _0xd799af=_0x53ec[_0x56c4de];return _0xd799af;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('0x14')]=router; \ No newline at end of file +var _0xe3da=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','create','put','update','destroy'];(function(_0x4dc3c5,_0x1416ff){var _0x5b3d59=function(_0x424566){while(--_0x424566){_0x4dc3c5['push'](_0x4dc3c5['shift']());}};_0x5b3d59(++_0x1416ff);}(_0xe3da,0x1cd));var _0xae3d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe3da[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var path=require(_0xae3d('0x2'));var timeout=require(_0xae3d('0x3'));var express=require(_0xae3d('0x4'));var router=express[_0xae3d('0x5')]();var fs_extra=require(_0xae3d('0x6'));var auth=require(_0xae3d('0x7'));var interaction=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var controller=require(_0xae3d('0xa'));router[_0xae3d('0xb')]('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0xd')]);router[_0xae3d('0xb')](_0xae3d('0xe'),auth['isAuthenticated'](),controller[_0xae3d('0xf')]);router[_0xae3d('0xb')]('/:id/messages',auth['isAuthenticated'](),controller[_0xae3d('0x10')]);router[_0xae3d('0x11')]('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0x12')]);router[_0xae3d('0x13')](_0xae3d('0xe'),auth['isAuthenticated'](),controller[_0xae3d('0x14')]);router['delete'](_0xae3d('0xe'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x15')]);module[_0xae3d('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 5b466da..e73bc40 100644 --- a/server/api/voiceMail/voiceMail.attributes.js +++ b/server/api/voiceMail/voiceMail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd85e=['central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue'];(function(_0x36bb1f,_0x1c8317){var _0x4c1228=function(_0x5497af){while(--_0x5497af){_0x36bb1f['push'](_0x36bb1f['shift']());}};_0x4c1228(++_0x1c8317);}(_0xd85e,0x1db));var _0xed85=function(_0x3a90d6,_0x5a15ca){_0x3a90d6=_0x3a90d6-0x0;var _0x4d079c=_0xd85e[_0x3a90d6];return _0x4d079c;};'use strict';var Sequelize=require('sequelize');module[_0xed85('0x0')]={'customer_id':{'type':Sequelize[_0xed85('0x1')]},'context':{'type':Sequelize[_0xed85('0x1')],'defaultValue':_0xed85('0x2'),'unique':_0xed85('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xed85('0x3')},'password':{'type':Sequelize[_0xed85('0x1')]},'fullname':{'type':Sequelize[_0xed85('0x1')]},'email':{'type':Sequelize[_0xed85('0x1')],'validate':{'isEmail':!![]},'set':function(_0x594648){this[_0xed85('0x4')]('email',typeof _0x594648==='string'&&_0x594648['trim']()?_0x594648['trim']():null);}},'pager':{'type':Sequelize[_0xed85('0x1')]},'tz':{'type':Sequelize[_0xed85('0x1')],'defaultValue':_0xed85('0x5')},'attach':{'type':Sequelize[_0xed85('0x6')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xed85('0x6')]('yes','no'),'defaultValue':_0xed85('0x7'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xed85('0x1')]},'review':{'type':Sequelize[_0xed85('0x6')](_0xed85('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xed85('0x6')](_0xed85('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xed85('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xed85('0x6')](_0xed85('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xed85('0x8'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xed85('0x6')](_0xed85('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xed85('0x6')](_0xed85('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xed85('0x6')](_0xed85('0x7'),'no'),'defaultValue':_0xed85('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0xed85('0x6')](_0xed85('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xed85('0x6')](_0xed85('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xed85('0x6')]('yes','no'),'defaultValue':_0xed85('0x7'),'allowNull':![]},'stamp':{'type':_0xed85('0x9')},'emailsubject':{'type':Sequelize[_0xed85('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xed85('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xed85('0xb')],'get':function(){return this['getDataValue'](_0xed85('0xc'))+_0xed85('0xd')+this[_0xed85('0xe')](_0xed85('0xf'));}}}; \ No newline at end of file +var _0x4d35=['sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','central','ENUM','yes','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','\x20-\x20','mailbox'];(function(_0x2fdaba,_0x1744c4){var _0x205c28=function(_0x27008a){while(--_0x27008a){_0x2fdaba['push'](_0x2fdaba['shift']());}};_0x205c28(++_0x1744c4);}(_0x4d35,0x187));var _0x54d3=function(_0xc45c71,_0x5015c7){_0xc45c71=_0xc45c71-0x0;var _0x511962=_0x4d35[_0xc45c71];return _0x511962;};'use strict';var Sequelize=require(_0x54d3('0x0'));module[_0x54d3('0x1')]={'customer_id':{'type':Sequelize[_0x54d3('0x2')]},'context':{'type':Sequelize[_0x54d3('0x2')],'defaultValue':_0x54d3('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x54d3('0x2')],'defaultValue':'','allowNull':![],'unique':_0x54d3('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x54d3('0x2')],'validate':{'isEmail':!![]},'set':function(_0x2cc4cf){this[_0x54d3('0x5')]('email',typeof _0x2cc4cf===_0x54d3('0x6')&&_0x2cc4cf[_0x54d3('0x7')]()?_0x2cc4cf['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x54d3('0x8')},'attach':{'type':Sequelize[_0x54d3('0x9')]('yes','no'),'defaultValue':_0x54d3('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x54d3('0x9')](_0x54d3('0xa'),'no'),'defaultValue':_0x54d3('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x54d3('0x2')]},'callback':{'type':Sequelize[_0x54d3('0x2')]},'review':{'type':Sequelize['ENUM'](_0x54d3('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x54d3('0x9')](_0x54d3('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x54d3('0x9')](_0x54d3('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x54d3('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x54d3('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x54d3('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x54d3('0x9')](_0x54d3('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x54d3('0x9')](_0x54d3('0xa'),'no'),'defaultValue':_0x54d3('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x54d3('0x9')](_0x54d3('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x54d3('0x9')](_0x54d3('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x54d3('0x9')](_0x54d3('0xa'),'no'),'defaultValue':_0x54d3('0xa'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x54d3('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x54d3('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x54d3('0xd')],'get':function(){return this[_0x54d3('0xe')]('fullname')+_0x54d3('0xf')+this[_0x54d3('0xe')](_0x54d3('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 70c6e72..314062a 100644 --- a/server/api/voiceMail/voiceMail.controller.js +++ b/server/api/voiceMail/voiceMail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d2d=['sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','send','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','fields','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','catch','update','find','getMessages','findOne','VoiceMailMessage','nolimit','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x4df6f9,_0x44bd65){var _0x4b1a73=function(_0xf5adb7){while(--_0xf5adb7){_0x4df6f9['push'](_0x4df6f9['shift']());}};_0x4b1a73(++_0x44bd65);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x11a06b,_0x5462d8){_0x11a06b=_0x11a06b-0x0;var _0x1c5a82=_0x1d2d[_0x11a06b];return _0x1c5a82;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];function respondWithStatusCode(_0x33f088,_0x129d8f){_0x129d8f=_0x129d8f||0xcc;return function(_0xc3ee82){if(_0xc3ee82){return _0x33f088[_0xd1d2('0x1b')](_0x129d8f);}return _0x33f088[_0xd1d2('0x1c')](_0x129d8f)[_0xd1d2('0x1d')]();};}function respondWithResult(_0x3f670f,_0x4cf702){_0x4cf702=_0x4cf702||0xc8;return function(_0x2e7fec){if(_0x2e7fec){return _0x3f670f[_0xd1d2('0x1c')](_0x4cf702)[_0xd1d2('0x1e')](_0x2e7fec);}};}function respondWithFilteredResult(_0x56de25,_0x35381b){return function(_0xc36ce){if(_0xc36ce){var _0x208425=typeof _0x35381b[_0xd1d2('0x1f')]===_0xd1d2('0x20')&&typeof _0x35381b[_0xd1d2('0x21')]===_0xd1d2('0x20');var _0x57f2f9=_0xc36ce['count'];var _0x3be186=_0x208425?0x0:_0x35381b['offset'];var _0x247b3a=_0x208425?_0xc36ce[_0xd1d2('0x22')]:_0x35381b[_0xd1d2('0x1f')]+_0x35381b[_0xd1d2('0x21')];var _0x4ab386;if(_0x247b3a>=_0x57f2f9){_0x247b3a=_0x57f2f9;_0x4ab386=0xc8;}else{_0x4ab386=0xce;}_0x56de25['status'](_0x4ab386);return _0x56de25[_0xd1d2('0x23')]('Content-Range',_0x3be186+'-'+_0x247b3a+'/'+_0x57f2f9)['json'](_0xc36ce);}return null;};}function patchUpdates(_0x1ab67c){return function(_0x27e26b){try{jsonpatch[_0xd1d2('0x24')](_0x27e26b,_0x1ab67c,!![]);}catch(_0x40170b){return BPromise['reject'](_0x40170b);}return _0x27e26b[_0xd1d2('0x25')]();};}function saveUpdates(_0xbb4d27,_0x24b8db){return function(_0x4eb082){if(_0x4eb082){return _0x4eb082['update'](_0xbb4d27)[_0xd1d2('0x26')](function(_0x3a1078){return _0x3a1078;});}return null;};}function removeEntity(_0x19d535,_0x2f92ee){return function(_0x3f229c){if(_0x3f229c){return _0x3f229c[_0xd1d2('0x27')]()[_0xd1d2('0x26')](function(){var _0x5df4af=_0x3f229c[_0xd1d2('0x28')]({'plain':!![]});var _0x42da6d=_0xd1d2('0x29');return db[_0xd1d2('0x2a')][_0xd1d2('0x27')]({'where':{'type':_0x42da6d,'resourceId':_0x5df4af['id']}})[_0xd1d2('0x26')](function(){return _0x3f229c;});})[_0xd1d2('0x26')](function(){_0x19d535[_0xd1d2('0x1c')](0xcc)[_0xd1d2('0x1d')]();});}};}function handleEntityNotFound(_0x384460,_0x3645e9){return function(_0x4e1bc2){if(!_0x4e1bc2){_0x384460['sendStatus'](0x194);}return _0x4e1bc2;};}function handleError(_0x133c6c,_0x442375){_0x442375=_0x442375||0x1f4;return function(_0x1e6072){logger[_0xd1d2('0x2b')](_0x1e6072[_0xd1d2('0x2c')]);if(_0x1e6072['name']){delete _0x1e6072[_0xd1d2('0x2d')];}_0x133c6c[_0xd1d2('0x1c')](_0x442375)[_0xd1d2('0x2e')](_0x1e6072);};}exports['index']=function(_0x19db00,_0x1db17f){var _0xbd855a={},_0x56557d={},_0x419db7={'count':0x0,'rows':[]};var _0x18528f=_[_0xd1d2('0x2f')](db[_0xd1d2('0x30')][_0xd1d2('0x31')],function(_0x14d661){return{'name':_0x14d661[_0xd1d2('0x32')],'type':_0x14d661[_0xd1d2('0x33')][_0xd1d2('0x34')]};});_0x56557d[_0xd1d2('0x35')]=_[_0xd1d2('0x2f')](_0x18528f,_0xd1d2('0x2d'));_0x56557d[_0xd1d2('0x36')]=_[_0xd1d2('0x37')](_0x19db00[_0xd1d2('0x36')]);_0x56557d[_0xd1d2('0x38')]=_[_0xd1d2('0x39')](_0x56557d[_0xd1d2('0x35')],_0x56557d['query']);_0xbd855a[_0xd1d2('0x3a')]=_[_0xd1d2('0x39')](_0x56557d[_0xd1d2('0x35')],qs['fields'](_0x19db00[_0xd1d2('0x36')]['fields']));_0xbd855a['attributes']=_0xbd855a[_0xd1d2('0x3a')][_0xd1d2('0x3b')]?_0xbd855a[_0xd1d2('0x3a')]:_0x56557d[_0xd1d2('0x35')];if(!_0x19db00[_0xd1d2('0x36')][_0xd1d2('0x3c')]('nolimit')){_0xbd855a[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0x19db00['query'][_0xd1d2('0x21')]);_0xbd855a[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x19db00[_0xd1d2('0x36')]['offset']);}_0xbd855a['order']=qs[_0xd1d2('0x3d')](_0x19db00['query']['sort']);_0xbd855a['where']=qs[_0xd1d2('0x38')](_['pick'](_0x19db00[_0xd1d2('0x36')],_0x56557d['filters']),_0x18528f);if(_0x19db00['query']['filter']){_0xbd855a[_0xd1d2('0x3e')]=_[_0xd1d2('0x3f')](_0xbd855a[_0xd1d2('0x3e')],{'$or':_[_0xd1d2('0x2f')](_0x18528f,function(_0x33ba30){if(_0x33ba30[_0xd1d2('0x33')]!==_0xd1d2('0x40')){var _0x38bf16={};_0x38bf16[_0x33ba30[_0xd1d2('0x2d')]]={'$like':'%'+_0x19db00[_0xd1d2('0x36')][_0xd1d2('0x41')]+'%'};return _0x38bf16;}})});}_0xbd855a=_[_0xd1d2('0x3f')]({},_0xbd855a,_0x19db00[_0xd1d2('0x42')]);var _0x18ff05={'where':_0xbd855a['where']};return db['VoiceMail'][_0xd1d2('0x22')](_0x18ff05)[_0xd1d2('0x26')](function(_0x24fc93){_0x419db7['count']=_0x24fc93;if(_0x19db00['query'][_0xd1d2('0x43')]){_0xbd855a[_0xd1d2('0x44')]=[{'all':!![]}];}return db['VoiceMail'][_0xd1d2('0x45')](_0xbd855a);})['then'](function(_0x5a3790){_0x419db7[_0xd1d2('0x46')]=_0x5a3790;return _0x419db7;})['then'](respondWithFilteredResult(_0x1db17f,_0xbd855a))['catch'](handleError(_0x1db17f,null));};exports[_0xd1d2('0x47')]=function(_0x320fa4,_0x2a8961){var _0x49dad2={'raw':!![],'where':{'id':_0x320fa4[_0xd1d2('0x48')]['id']}},_0x2ba87b={};_0x2ba87b[_0xd1d2('0x35')]=_[_0xd1d2('0x37')](db['VoiceMail'][_0xd1d2('0x31')]);_0x2ba87b[_0xd1d2('0x36')]=_['keys'](_0x320fa4[_0xd1d2('0x36')]);_0x2ba87b['filters']=_[_0xd1d2('0x39')](_0x2ba87b[_0xd1d2('0x35')],_0x2ba87b[_0xd1d2('0x36')]);_0x49dad2[_0xd1d2('0x3a')]=_[_0xd1d2('0x39')](_0x2ba87b['model'],qs['fields'](_0x320fa4[_0xd1d2('0x36')][_0xd1d2('0x49')]));_0x49dad2['attributes']=_0x49dad2[_0xd1d2('0x3a')][_0xd1d2('0x3b')]?_0x49dad2[_0xd1d2('0x3a')]:_0x2ba87b[_0xd1d2('0x35')];if(_0x320fa4[_0xd1d2('0x36')][_0xd1d2('0x43')]){_0x49dad2[_0xd1d2('0x44')]=[{'all':!![]}];}_0x49dad2=_['merge']({},_0x49dad2,_0x320fa4[_0xd1d2('0x42')]);return db[_0xd1d2('0x30')]['find'](_0x49dad2)[_0xd1d2('0x26')](handleEntityNotFound(_0x2a8961,null))[_0xd1d2('0x26')](respondWithResult(_0x2a8961,null))['catch'](handleError(_0x2a8961,null));};exports['create']=function(_0x3d4fe3,_0x182ea8){return db['VoiceMail'][_0xd1d2('0x4a')](_0x3d4fe3[_0xd1d2('0x4b')],{})[_0xd1d2('0x26')](function(_0x23ab46){var _0x404ad2=_0x3d4fe3['user']['get']({'plain':!![]});if(!_0x404ad2)throw new Error(_0xd1d2('0x4c'));if(_0x404ad2['role']===_0xd1d2('0x4d')){var _0xcd4b70=_0x23ab46['get']({'plain':!![]});var _0x389fcb=_0xd1d2('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x389fcb,'userProfileId':_0x404ad2[_0xd1d2('0x4e')]},'raw':!![]})[_0xd1d2('0x26')](function(_0x187de4){if(_0x187de4&&_0x187de4[_0xd1d2('0x4f')]===0x0){return db[_0xd1d2('0x2a')][_0xd1d2('0x4a')]({'name':_0xcd4b70[_0xd1d2('0x2d')],'resourceId':_0xcd4b70['id'],'type':_0x187de4[_0xd1d2('0x2d')],'sectionId':_0x187de4['id']},{})[_0xd1d2('0x26')](function(){return _0x23ab46;});}else{return _0x23ab46;}})['catch'](function(_0x1958f3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1958f3);throw _0x1958f3;});}return _0x23ab46;})[_0xd1d2('0x26')](respondWithResult(_0x182ea8,0xc9))[_0xd1d2('0x50')](handleError(_0x182ea8,null));};exports[_0xd1d2('0x51')]=function(_0x47417f,_0x215dea){if(_0x47417f[_0xd1d2('0x4b')]['id']){delete _0x47417f[_0xd1d2('0x4b')]['id'];}return db[_0xd1d2('0x30')][_0xd1d2('0x52')]({'where':{'id':_0x47417f[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x215dea,null))[_0xd1d2('0x26')](saveUpdates(_0x47417f[_0xd1d2('0x4b')],null))['then'](respondWithResult(_0x215dea,null))['catch'](handleError(_0x215dea,null));};exports[_0xd1d2('0x27')]=function(_0xd5323d,_0x1562ad){return db[_0xd1d2('0x30')][_0xd1d2('0x52')]({'where':{'id':_0xd5323d[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x1562ad,null))[_0xd1d2('0x26')](removeEntity(_0x1562ad,null))[_0xd1d2('0x50')](handleError(_0x1562ad,null));};exports[_0xd1d2('0x53')]=function(_0x1788cd,_0x54406e,_0x479471){return db[_0xd1d2('0x30')][_0xd1d2('0x54')]({'where':{'id':_0x1788cd[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x54406e,null))['then'](function(_0x17e149){var _0x27c629;var _0x42961d={},_0xaf2acf={};_0xaf2acf[_0xd1d2('0x35')]=_[_0xd1d2('0x37')](db[_0xd1d2('0x55')]['rawAttributes']);_0xaf2acf[_0xd1d2('0x36')]=_[_0xd1d2('0x37')](_0x1788cd[_0xd1d2('0x36')]);_0xaf2acf['filters']=_['intersection'](_0xaf2acf[_0xd1d2('0x35')],_0xaf2acf[_0xd1d2('0x36')]);_0x42961d[_0xd1d2('0x3a')]=_[_0xd1d2('0x39')](_0xaf2acf['model'],qs[_0xd1d2('0x49')](_0x1788cd[_0xd1d2('0x36')][_0xd1d2('0x49')]));_0x42961d['attributes']=_0x42961d[_0xd1d2('0x3a')][_0xd1d2('0x3b')]?_0x42961d['attributes']:_0xaf2acf[_0xd1d2('0x35')];if(!_0x1788cd[_0xd1d2('0x36')][_0xd1d2('0x3c')](_0xd1d2('0x56'))){_0x42961d['limit']=qs[_0xd1d2('0x21')](_0x1788cd[_0xd1d2('0x36')][_0xd1d2('0x21')]);_0x42961d[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x1788cd['query']['offset']);}_0x42961d['order']=qs['sort'](_0x1788cd['query'][_0xd1d2('0x3d')]);_0x42961d[_0xd1d2('0x3e')]=qs[_0xd1d2('0x38')](_['pick'](_0x1788cd[_0xd1d2('0x36')],_0xaf2acf[_0xd1d2('0x38')]));if(_0x1788cd[_0xd1d2('0x36')]['filter']){_0x42961d[_0xd1d2('0x3e')]=_[_0xd1d2('0x3f')](_0x42961d[_0xd1d2('0x3e')],{'$or':_[_0xd1d2('0x2f')](_0x42961d[_0xd1d2('0x3a')],function(_0x1101a3){var _0x4a83f8={};_0x4a83f8[_0x1101a3]={'$like':'%'+_0x1788cd[_0xd1d2('0x36')][_0xd1d2('0x41')]+'%'};return _0x4a83f8;})});}_0x42961d['where']=_['merge'](_0x42961d[_0xd1d2('0x3e')],{'mailboxuser':_0x17e149[_0xd1d2('0x57')]});_0x42961d=_[_0xd1d2('0x3f')]({},_0x42961d,_0x1788cd[_0xd1d2('0x42')]);return db['VoiceMailMessage'][_0xd1d2('0x58')](_0x42961d)[_0xd1d2('0x26')](respondWithFilteredResult(_0x54406e,_0x42961d));})[_0xd1d2('0x50')](handleError(_0x54406e,null));}; \ No newline at end of file +var _0x5eb8=['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','Voicemails','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','VoiceMail','findAll','rows','catch','show','params','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','VoiceMailMessage','pick','filter','mailbox'];(function(_0x5104f5,_0x2908bd){var _0x2bb4f9=function(_0x431014){while(--_0x431014){_0x5104f5['push'](_0x5104f5['shift']());}};_0x2bb4f9(++_0x2908bd);}(_0x5eb8,0xb0));var _0x85eb=function(_0x529abc,_0x17b97e){_0x529abc=_0x529abc-0x0;var _0x453afa=_0x5eb8[_0x529abc];return _0x453afa;};'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['VoiceMail'][_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['VoiceMail']['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['VoiceMail'][_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')](removeEntity(_0x214ef7,null))[_0x85eb('0x47')](handleError(_0x214ef7,null));};exports['getMessages']=function(_0x152452,_0x2a0f8b,_0x4a3af9){return db[_0x85eb('0x44')]['findOne']({'where':{'id':_0x152452[_0x85eb('0x49')]['id']}})[_0x85eb('0x26')](handleEntityNotFound(_0x2a0f8b,null))[_0x85eb('0x26')](function(_0x13c0b3){var _0x45a201;var _0x15d4a7={},_0x5a729e={};_0x5a729e[_0x85eb('0x33')]=_[_0x85eb('0x35')](db[_0x85eb('0x54')][_0x85eb('0x30')]);_0x5a729e[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x152452[_0x85eb('0x34')]);_0x5a729e[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x5a729e[_0x85eb('0x33')],_0x5a729e[_0x85eb('0x34')]);_0x15d4a7['attributes']=_[_0x85eb('0x37')](_0x5a729e[_0x85eb('0x33')],qs[_0x85eb('0x39')](_0x152452[_0x85eb('0x34')][_0x85eb('0x39')]));_0x15d4a7[_0x85eb('0x38')]=_0x15d4a7['attributes'][_0x85eb('0x3a')]?_0x15d4a7['attributes']:_0x5a729e[_0x85eb('0x33')];if(!_0x152452[_0x85eb('0x34')][_0x85eb('0x3b')](_0x85eb('0x3c'))){_0x15d4a7[_0x85eb('0x1e')]=qs['limit'](_0x152452[_0x85eb('0x34')][_0x85eb('0x1e')]);_0x15d4a7[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x152452[_0x85eb('0x34')][_0x85eb('0x1c')]);}_0x15d4a7[_0x85eb('0x3d')]=qs[_0x85eb('0x3e')](_0x152452['query'][_0x85eb('0x3e')]);_0x15d4a7['where']=qs[_0x85eb('0x36')](_[_0x85eb('0x55')](_0x152452[_0x85eb('0x34')],_0x5a729e[_0x85eb('0x36')]));if(_0x152452[_0x85eb('0x34')]['filter']){_0x15d4a7[_0x85eb('0x3f')]=_[_0x85eb('0x40')](_0x15d4a7[_0x85eb('0x3f')],{'$or':_[_0x85eb('0x2f')](_0x15d4a7[_0x85eb('0x38')],function(_0x419b24){var _0x562ffa={};_0x562ffa[_0x419b24]={'$like':'%'+_0x152452['query'][_0x85eb('0x56')]+'%'};return _0x562ffa;})});}_0x15d4a7['where']=_[_0x85eb('0x40')](_0x15d4a7[_0x85eb('0x3f')],{'mailboxuser':_0x13c0b3[_0x85eb('0x57')]});_0x15d4a7=_[_0x85eb('0x40')]({},_0x15d4a7,_0x152452[_0x85eb('0x4a')]);return db[_0x85eb('0x54')]['findAndCountAll'](_0x15d4a7)[_0x85eb('0x26')](respondWithFilteredResult(_0x2a0f8b,_0x15d4a7));})[_0x85eb('0x47')](handleError(_0x2a0f8b,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index b20e55b..6f5e347 100644 --- a/server/api/voiceMail/voiceMail.model.js +++ b/server/api/voiceMail/voiceMail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe578=['exports','define','VoiceMail','mailbox','context','util','../../config/logger','api','request-promise','path','rimraf','./voiceMail.attributes'];(function(_0x5cc3d4,_0xbcbf9b){var _0x17ca31=function(_0x5dbd6d){while(--_0x5dbd6d){_0x5cc3d4['push'](_0x5cc3d4['shift']());}};_0x17ca31(++_0xbcbf9b);}(_0xe578,0x149));var _0x8e57=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xe578[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x8e57('0x0'));var logger=require(_0x8e57('0x1'))(_0x8e57('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8e57('0x3'));var fs=require('fs');var path=require(_0x8e57('0x4'));var rimraf=require(_0x8e57('0x5'));var config=require('../../config/environment');var attributes=require(_0x8e57('0x6'));module[_0x8e57('0x7')]=function(_0x5c35b6,_0x5f95d2){return _0x5c35b6[_0x8e57('0x8')](_0x8e57('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x8e57('0xa'),_0x8e57('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa5b8=['./voiceMail.attributes','exports','define','VoiceMail','mailbox_context','mailbox','context','lodash','api','path','../../config/environment'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xa5b8,0x1ca));var _0x8a5b=function(_0x4fed56,_0x33241d){_0x4fed56=_0x4fed56-0x0;var _0x1618fb=_0xa5b8[_0x4fed56];return _0x1618fb;};'use strict';var _=require(_0x8a5b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8a5b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a5b('0x2'));var rimraf=require('rimraf');var config=require(_0x8a5b('0x3'));var attributes=require(_0x8a5b('0x4'));module[_0x8a5b('0x5')]=function(_0x73821f,_0x587af7){return _0x73821f[_0x8a5b('0x6')](_0x8a5b('0x7'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x8a5b('0x8'),'fields':[_0x8a5b('0x9'),_0x8a5b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index c486f98..aa47a0a 100644 --- a/server/api/voiceMail/voiceMail.rpc.js +++ b/server/api/voiceMail/voiceMail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4df9=['error','code','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify'];(function(_0x529668,_0x4e0dba){var _0x1f4630=function(_0x521b75){while(--_0x521b75){_0x529668['push'](_0x529668['shift']());}};_0x1f4630(++_0x4e0dba);}(_0x4df9,0x148));var _0x94df=function(_0x473c78,_0x104aac){_0x473c78=_0x473c78-0x0;var _0x521557=_0x4df9[_0x473c78];return _0x521557;};'use strict';var _=require(_0x94df('0x0'));var util=require(_0x94df('0x1'));var moment=require('moment');var BPromise=require(_0x94df('0x2'));var rs=require(_0x94df('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94df('0x4'))['db'];var utils=require(_0x94df('0x5'));var logger=require(_0x94df('0x6'))(_0x94df('0x7'));var config=require(_0x94df('0x8'));var jayson=require(_0x94df('0x9'));var client=jayson[_0x94df('0xa')][_0x94df('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18a7d1,_0x214af6,_0x238b20){return new BPromise(function(_0x5e2828,_0x3f4a28){return client[_0x94df('0xc')](_0x18a7d1,_0x238b20)[_0x94df('0xd')](function(_0x40a23c){logger[_0x94df('0xe')]('VoiceMail,\x20%s,\x20%s',_0x214af6,_0x94df('0xf'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x214af6,_0x94df('0xf'),JSON[_0x94df('0x10')](_0x40a23c));if(_0x40a23c[_0x94df('0x11')]){if(_0x40a23c[_0x94df('0x11')][_0x94df('0x12')]===0x1f4){logger[_0x94df('0x11')](_0x94df('0x13'),_0x214af6,_0x40a23c[_0x94df('0x11')][_0x94df('0x14')]);return _0x3f4a28(_0x40a23c[_0x94df('0x11')][_0x94df('0x14')]);}logger['error'](_0x94df('0x13'),_0x214af6,_0x40a23c[_0x94df('0x11')][_0x94df('0x14')]);return _0x5e2828(_0x40a23c[_0x94df('0x11')][_0x94df('0x14')]);}else{logger[_0x94df('0xe')](_0x94df('0x13'),_0x214af6,_0x94df('0xf'));_0x5e2828(_0x40a23c[_0x94df('0x15')][_0x94df('0x14')]);}})[_0x94df('0x16')](function(_0x5680d0){logger[_0x94df('0x11')](_0x94df('0x13'),_0x214af6,_0x5680d0);_0x3f4a28(_0x5680d0);});});} \ No newline at end of file +var _0x2b33=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceMail,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird'];(function(_0xdce78a,_0x507cad){var _0x47c31c=function(_0x4238b5){while(--_0x4238b5){_0xdce78a['push'](_0xdce78a['shift']());}};_0x47c31c(++_0x507cad);}(_0x2b33,0xf3));var _0x32b3=function(_0x156488,_0x3e7952){_0x156488=_0x156488-0x0;var _0x2c6847=_0x2b33[_0x156488];return _0x2c6847;};'use strict';var _=require(_0x32b3('0x0'));var util=require(_0x32b3('0x1'));var moment=require(_0x32b3('0x2'));var BPromise=require(_0x32b3('0x3'));var rs=require(_0x32b3('0x4'));var fs=require('fs');var Redis=require(_0x32b3('0x5'));var db=require(_0x32b3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x32b3('0x7'))('rpc');var config=require(_0x32b3('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x63cb5c,_0x2d91f3,_0x3ec49d){return new BPromise(function(_0x2ab23b,_0x4f8f2e){return client['request'](_0x63cb5c,_0x3ec49d)['then'](function(_0xed1908){logger[_0x32b3('0x9')]('VoiceMail,\x20%s,\x20%s',_0x2d91f3,_0x32b3('0xa'));logger[_0x32b3('0xb')](_0x32b3('0xc'),_0x2d91f3,_0x32b3('0xa'),JSON[_0x32b3('0xd')](_0xed1908));if(_0xed1908[_0x32b3('0xe')]){if(_0xed1908[_0x32b3('0xe')]['code']===0x1f4){logger[_0x32b3('0xe')]('VoiceMail,\x20%s,\x20%s',_0x2d91f3,_0xed1908[_0x32b3('0xe')][_0x32b3('0xf')]);return _0x4f8f2e(_0xed1908[_0x32b3('0xe')][_0x32b3('0xf')]);}logger[_0x32b3('0xe')](_0x32b3('0x10'),_0x2d91f3,_0xed1908[_0x32b3('0xe')][_0x32b3('0xf')]);return _0x2ab23b(_0xed1908[_0x32b3('0xe')]['message']);}else{logger[_0x32b3('0x9')](_0x32b3('0x10'),_0x2d91f3,_0x32b3('0xa'));_0x2ab23b(_0xed1908[_0x32b3('0x11')][_0x32b3('0xf')]);}})[_0x32b3('0x12')](function(_0x4ed85b){logger[_0x32b3('0xe')](_0x32b3('0x10'),_0x2d91f3,_0x4ed85b);_0x4f8f2e(_0x4ed85b);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index c006baa..19d6e90 100644 --- a/server/api/voiceMailMessage/index.js +++ b/server/api/voiceMailMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x781f=['multer','util','path','connect-timeout','Router','../../components/interaction/service','./voiceMailMessage.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','post','create','update','destroy','exports'];(function(_0x59688f,_0x421bad){var _0x3d4d0b=function(_0x5285fd){while(--_0x5285fd){_0x59688f['push'](_0x59688f['shift']());}};_0x3d4d0b(++_0x421bad);}(_0x781f,0x169));var _0xf781=function(_0x3b3cc6,_0x1a6e24){_0x3b3cc6=_0x3b3cc6-0x0;var _0x1161e4=_0x781f[_0x3b3cc6];return _0x1161e4;};'use strict';var multer=require(_0xf781('0x0'));var util=require(_0xf781('0x1'));var path=require(_0xf781('0x2'));var timeout=require(_0xf781('0x3'));var express=require('express');var router=express[_0xf781('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf781('0x5'));var config=require('../../config/environment');var controller=require(_0xf781('0x6'));router['get']('/',auth[_0xf781('0x7')](),controller[_0xf781('0x8')]);router[_0xf781('0x9')](_0xf781('0xa'),auth[_0xf781('0x7')](),controller[_0xf781('0xb')]);router[_0xf781('0x9')](_0xf781('0xc'),auth[_0xf781('0x7')](),controller[_0xf781('0xd')]);router[_0xf781('0xe')]('/',auth[_0xf781('0x7')](),controller[_0xf781('0xf')]);router['put'](_0xf781('0xa'),auth[_0xf781('0x7')](),controller[_0xf781('0x10')]);router['delete'](_0xf781('0xa'),auth['isAuthenticated'](),controller[_0xf781('0x11')]);module[_0xf781('0x12')]=router; \ No newline at end of file +var _0xc0fd=['post','create','/:id','delete','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','show','/:id/download','download'];(function(_0x7c3bf0,_0x33ad9c){var _0x4a691f=function(_0x4cc46d){while(--_0x4cc46d){_0x7c3bf0['push'](_0x7c3bf0['shift']());}};_0x4a691f(++_0x33ad9c);}(_0xc0fd,0xd0));var _0xdc0f=function(_0x188e31,_0x117cdf){_0x188e31=_0x188e31-0x0;var _0x475bd0=_0xc0fd[_0x188e31];return _0x475bd0;};'use strict';var multer=require(_0xdc0f('0x0'));var util=require(_0xdc0f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdc0f('0x2'));var router=express['Router']();var fs_extra=require(_0xdc0f('0x3'));var auth=require(_0xdc0f('0x4'));var interaction=require(_0xdc0f('0x5'));var config=require(_0xdc0f('0x6'));var controller=require(_0xdc0f('0x7'));router[_0xdc0f('0x8')]('/',auth[_0xdc0f('0x9')](),controller['index']);router[_0xdc0f('0x8')]('/:id',auth[_0xdc0f('0x9')](),controller[_0xdc0f('0xa')]);router['get'](_0xdc0f('0xb'),auth[_0xdc0f('0x9')](),controller[_0xdc0f('0xc')]);router[_0xdc0f('0xd')]('/',auth[_0xdc0f('0x9')](),controller[_0xdc0f('0xe')]);router['put'](_0xdc0f('0xf'),auth[_0xdc0f('0x9')](),controller['update']);router[_0xdc0f('0x10')](_0xdc0f('0xf'),auth[_0xdc0f('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index a6893b4..687acc0 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.attributes.js +++ b/server/api/voiceMailMessage/voiceMailMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54c4=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x2a6022,_0x26cb48){var _0x557ee5=function(_0x573418){while(--_0x573418){_0x2a6022['push'](_0x2a6022['shift']());}};_0x557ee5(++_0x26cb48);}(_0x54c4,0xde));var _0x454c=function(_0x31a7c8,_0x178f72){_0x31a7c8=_0x31a7c8-0x0;var _0x43f4a0=_0x54c4[_0x31a7c8];return _0x43f4a0;};'use strict';var Sequelize=require(_0x454c('0x0'));module[_0x454c('0x1')]={'name':{'type':Sequelize[_0x454c('0x2')],'get':function(_0x42c51e){return this[_0x454c('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x454c('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x454c('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x454c('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x454c('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x454c('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x454c('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x454c('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x454c('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x454c('0x6')](_0x454c('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x454c('0x8'),'defaultValue':Sequelize[_0x454c('0x9')](_0x454c('0xa'))}}; \ No newline at end of file +var _0xa19d=['INTEGER','STRING','BLOB','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x4b17af,_0x35b7ef){var _0xf5398e=function(_0x1534f6){while(--_0x1534f6){_0x4b17af['push'](_0x4b17af['shift']());}};_0xf5398e(++_0x35b7ef);}(_0xa19d,0x100));var _0xda19=function(_0x322a07,_0x5a0c88){_0x322a07=_0x322a07-0x0;var _0x1d7845=_0xa19d[_0x322a07];return _0x1d7845;};'use strict';var Sequelize=require(_0xda19('0x0'));module[_0xda19('0x1')]={'name':{'type':Sequelize[_0xda19('0x2')],'get':function(_0x132605){return this[_0xda19('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xda19('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xda19('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xda19('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xda19('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0xda19('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xda19('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xda19('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xda19('0x6')](_0xda19('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xda19('0x5')],'defaultValue':''},'stamp':{'type':_0xda19('0x8'),'defaultValue':Sequelize['literal'](_0xda19('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index b09e267..194a006 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.controller.js +++ b/server/api/voiceMailMessage/voiceMailMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf483=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','create','find','body','download','recording','msg_id','Sequelize','ValidationError','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','apply','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','filters'];(function(_0x4799bf,_0x145838){var _0x436ef4=function(_0x1c0a40){while(--_0x1c0a40){_0x4799bf['push'](_0x4799bf['shift']());}};_0x436ef4(++_0x145838);}(_0xf483,0xc6));var _0x3f48=function(_0x4e76da,_0x291b71){_0x4e76da=_0x4e76da-0x0;var _0x5f14e8=_0xf483[_0x4e76da];return _0x5f14e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f48('0x0'));var zipdir=require(_0x3f48('0x1'));var jsonpatch=require(_0x3f48('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3f48('0x3'));var Mustache=require('mustache');var util=require(_0x3f48('0x4'));var path=require(_0x3f48('0x5'));var sox=require(_0x3f48('0x6'));var csv=require(_0x3f48('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3f48('0x8'));var squel=require(_0x3f48('0x9'));var crypto=require(_0x3f48('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3f48('0xb'));var toCsv=require(_0x3f48('0x7'));var querystring=require(_0x3f48('0xc'));var Papa=require(_0x3f48('0xd'));var Redis=require(_0x3f48('0xe'));var authService=require(_0x3f48('0xf'));var qs=require(_0x3f48('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f48('0x11'));var logger=require(_0x3f48('0x12'))(_0x3f48('0x13'));var utils=require(_0x3f48('0x14'));var config=require(_0x3f48('0x15'));var licenseUtil=require(_0x3f48('0x16'));var db=require(_0x3f48('0x17'))['db'];function respondWithStatusCode(_0x4e7cbd,_0x2c72ae){_0x2c72ae=_0x2c72ae||0xcc;return function(_0x41868a){if(_0x41868a){return _0x4e7cbd[_0x3f48('0x18')](_0x2c72ae);}return _0x4e7cbd['status'](_0x2c72ae)['end']();};}function respondWithResult(_0x117748,_0x2c0ae2){_0x2c0ae2=_0x2c0ae2||0xc8;return function(_0x47782f){if(_0x47782f){return _0x117748['status'](_0x2c0ae2)[_0x3f48('0x19')](_0x47782f);}};}function respondWithFilteredResult(_0x3cc4e1,_0x3370f0){return function(_0x31d242){if(_0x31d242){var _0x587742=typeof _0x3370f0[_0x3f48('0x1a')]===_0x3f48('0x1b')&&typeof _0x3370f0[_0x3f48('0x1c')]===_0x3f48('0x1b');var _0x5560c9=_0x31d242[_0x3f48('0x1d')];var _0xab77a0=_0x587742?0x0:_0x3370f0['offset'];var _0x388592=_0x587742?_0x31d242[_0x3f48('0x1d')]:_0x3370f0[_0x3f48('0x1a')]+_0x3370f0['limit'];var _0x2091a9;if(_0x388592>=_0x5560c9){_0x388592=_0x5560c9;_0x2091a9=0xc8;}else{_0x2091a9=0xce;}_0x3cc4e1[_0x3f48('0x1e')](_0x2091a9);return _0x3cc4e1[_0x3f48('0x1f')]('Content-Range',_0xab77a0+'-'+_0x388592+'/'+_0x5560c9)['json'](_0x31d242);}return null;};}function patchUpdates(_0x15e4d3){return function(_0x297473){try{jsonpatch[_0x3f48('0x20')](_0x297473,_0x15e4d3,!![]);}catch(_0x49b4a0){return BPromise['reject'](_0x49b4a0);}return _0x297473['save']();};}function saveUpdates(_0x56c9e2,_0x1f20a3){return function(_0x5aab11){if(_0x5aab11){return _0x5aab11[_0x3f48('0x21')](_0x56c9e2)[_0x3f48('0x22')](function(_0x3ffb16){return _0x3ffb16;});}return null;};}function removeEntity(_0x3c6686,_0xc650ec){return function(_0x5dd953){if(_0x5dd953){return _0x5dd953[_0x3f48('0x23')]()[_0x3f48('0x22')](function(){_0x3c6686[_0x3f48('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x263f74,_0x111dba){return function(_0x622ef3){if(!_0x622ef3){_0x263f74[_0x3f48('0x18')](0x194);}return _0x622ef3;};}function handleError(_0x2d2165,_0x59dd5e){_0x59dd5e=_0x59dd5e||0x1f4;return function(_0x4e97e7){logger[_0x3f48('0x24')](_0x4e97e7[_0x3f48('0x25')]);if(_0x4e97e7[_0x3f48('0x26')]){delete _0x4e97e7[_0x3f48('0x26')];}_0x2d2165['status'](_0x59dd5e)[_0x3f48('0x27')](_0x4e97e7);};}exports[_0x3f48('0x28')]=function(_0xd808ad,_0x12a031){var _0x5a4b10={},_0x53fccd={},_0x809fa4={'count':0x0,'rows':[]};var _0x29f9be=_[_0x3f48('0x29')](db[_0x3f48('0x2a')][_0x3f48('0x2b')],function(_0x36c36b){return{'name':_0x36c36b[_0x3f48('0x2c')],'type':_0x36c36b[_0x3f48('0x2d')][_0x3f48('0x2e')]};});_0x53fccd[_0x3f48('0x2f')]=_[_0x3f48('0x30')](_['map'](_0x29f9be,_0x3f48('0x26')),[_0x3f48('0x26')]);_0x53fccd[_0x3f48('0x31')]=_['keys'](_0xd808ad[_0x3f48('0x31')]);_0x53fccd[_0x3f48('0x32')]=_[_0x3f48('0x33')](_0x53fccd[_0x3f48('0x2f')],_0x53fccd[_0x3f48('0x31')]);_0x5a4b10[_0x3f48('0x34')]=_['intersection'](_0x53fccd[_0x3f48('0x2f')],qs[_0x3f48('0x35')](_0xd808ad[_0x3f48('0x31')][_0x3f48('0x35')]));_0x5a4b10[_0x3f48('0x34')]=_0x5a4b10[_0x3f48('0x34')][_0x3f48('0x36')]?_0x5a4b10[_0x3f48('0x34')]:_0x53fccd['model'];if(!_0xd808ad[_0x3f48('0x31')][_0x3f48('0x37')](_0x3f48('0x38'))){_0x5a4b10[_0x3f48('0x1c')]=qs[_0x3f48('0x1c')](_0xd808ad[_0x3f48('0x31')][_0x3f48('0x1c')]);_0x5a4b10['offset']=qs['offset'](_0xd808ad[_0x3f48('0x31')][_0x3f48('0x1a')]);}_0x5a4b10[_0x3f48('0x39')]=qs['sort'](_0xd808ad[_0x3f48('0x31')][_0x3f48('0x3a')]);_0x5a4b10['where']=qs['filters'](_['pick'](_0xd808ad[_0x3f48('0x31')],_0x53fccd[_0x3f48('0x32')]),_0x29f9be);if(_0xd808ad[_0x3f48('0x31')][_0x3f48('0x3b')]){_0x5a4b10[_0x3f48('0x3c')]=_[_0x3f48('0x3d')](_0x5a4b10['where'],{'$or':_[_0x3f48('0x29')](_0x29f9be,function(_0x1d5828){if(_0x1d5828[_0x3f48('0x2d')]!==_0x3f48('0x3e')){var _0x53f4a0={};_0x53f4a0[_0x1d5828[_0x3f48('0x26')]]={'$like':'%'+_0xd808ad[_0x3f48('0x31')][_0x3f48('0x3b')]+'%'};return _0x53f4a0;}})});}_0x5a4b10=_[_0x3f48('0x3d')]({},_0x5a4b10,_0xd808ad['options']);var _0x2d883e={'where':_0x5a4b10['where']};return db['VoiceMailMessage']['count'](_0x2d883e)[_0x3f48('0x22')](function(_0x50c718){_0x809fa4[_0x3f48('0x1d')]=_0x50c718;if(_0xd808ad[_0x3f48('0x31')][_0x3f48('0x3f')]){_0x5a4b10[_0x3f48('0x40')]=[{'all':!![]}];}return db[_0x3f48('0x2a')][_0x3f48('0x41')](_0x5a4b10);})[_0x3f48('0x22')](function(_0x10b4a2){_0x809fa4[_0x3f48('0x42')]=_0x10b4a2;return _0x809fa4;})['then'](respondWithFilteredResult(_0x12a031,_0x5a4b10))[_0x3f48('0x43')](handleError(_0x12a031,null));};exports[_0x3f48('0x44')]=function(_0x232c83,_0xad9acb){var _0x10931c={'raw':!![],'where':{'id':_0x232c83[_0x3f48('0x45')]['id']}},_0x61f78e={};_0x61f78e[_0x3f48('0x2f')]=_[_0x3f48('0x46')](db['VoiceMailMessage'][_0x3f48('0x2b')]);_0x61f78e[_0x3f48('0x31')]=_['keys'](_0x232c83[_0x3f48('0x31')]);_0x61f78e[_0x3f48('0x32')]=_[_0x3f48('0x33')](_0x61f78e[_0x3f48('0x2f')],_0x61f78e[_0x3f48('0x31')]);_0x10931c['attributes']=_[_0x3f48('0x33')](_0x61f78e[_0x3f48('0x2f')],qs[_0x3f48('0x35')](_0x232c83[_0x3f48('0x31')]['fields']));_0x10931c[_0x3f48('0x34')]=_0x10931c[_0x3f48('0x34')][_0x3f48('0x36')]?_0x10931c[_0x3f48('0x34')]:_0x61f78e[_0x3f48('0x2f')];if(_0x232c83[_0x3f48('0x31')][_0x3f48('0x3f')]){_0x10931c['include']=[{'all':!![]}];}_0x10931c=_[_0x3f48('0x3d')]({},_0x10931c,_0x232c83[_0x3f48('0x47')]);return db['VoiceMailMessage']['find'](_0x10931c)[_0x3f48('0x22')](handleEntityNotFound(_0xad9acb,null))[_0x3f48('0x22')](respondWithResult(_0xad9acb,null))[_0x3f48('0x43')](handleError(_0xad9acb,null));};exports['create']=function(_0x4c54c6,_0x5cb9af){return db['VoiceMailMessage'][_0x3f48('0x48')](_0x4c54c6['body'],{})[_0x3f48('0x22')](respondWithResult(_0x5cb9af,0xc9))['catch'](handleError(_0x5cb9af,null));};exports[_0x3f48('0x21')]=function(_0x413bc3,_0x129127){if(_0x413bc3['body']['id']){delete _0x413bc3['body']['id'];}return db[_0x3f48('0x2a')][_0x3f48('0x49')]({'where':{'id':_0x413bc3[_0x3f48('0x45')]['id']}})[_0x3f48('0x22')](handleEntityNotFound(_0x129127,null))['then'](saveUpdates(_0x413bc3[_0x3f48('0x4a')],null))[_0x3f48('0x22')](respondWithResult(_0x129127,null))[_0x3f48('0x43')](handleError(_0x129127,null));};exports[_0x3f48('0x23')]=function(_0x1fa5e0,_0x38d7b9){return db['VoiceMailMessage']['find']({'where':{'id':_0x1fa5e0[_0x3f48('0x45')]['id']}})['then'](handleEntityNotFound(_0x38d7b9,null))[_0x3f48('0x22')](removeEntity(_0x38d7b9,null))[_0x3f48('0x43')](handleError(_0x38d7b9,null));};exports[_0x3f48('0x4b')]=function(_0x24566d,_0x3ab75d,_0x1742f0){return db['VoiceMailMessage'][_0x3f48('0x49')]({'where':{'id':_0x24566d['params']['id']},'attributes':['id',_0x3f48('0x4c'),_0x3f48('0x4d')]})['then'](handleEntityNotFound(_0x3ab75d,null))[_0x3f48('0x22')](function(_0x422c19){if(_0x422c19){if(!_0x422c19[_0x3f48('0x4c')]){throw new db[(_0x3f48('0x4e'))][(_0x3f48('0x4f'))]('VoiceMailMessage\x20not\x20found');}var _0x519f99={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x422c19[_0x3f48('0x4d')]){_0x519f99[_0x3f48('0x50')]=_0x3f48('0x51')+_0x422c19['msg_id']+_0x3f48('0x52');}_0x3ab75d[_0x3f48('0x1f')](_0x519f99);return _0x3ab75d[_0x3f48('0x27')](new Buffer(_0x422c19[_0x3f48('0x4c')]));}})[_0x3f48('0x43')](handleError(_0x3ab75d,null));}; \ No newline at end of file +var _0x8a7f=['key','model','differenceBy','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','count','includeAll','include','catch','show','params','keys','find','create','body','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','error','name','send','index','VoiceMailMessage','rawAttributes','fieldName','type'];(function(_0x425cf0,_0x3f194a){var _0x2ba5ec=function(_0x4934fc){while(--_0x4934fc){_0x425cf0['push'](_0x425cf0['shift']());}};_0x2ba5ec(++_0x3f194a);}(_0x8a7f,0xd1));var _0xf8a7=function(_0x3afd30,_0x5a5e11){_0x3afd30=_0x3afd30-0x0;var _0x140895=_0x8a7f[_0x3afd30];return _0x140895;};'use strict';var emlformat=require(_0xf8a7('0x0'));var rimraf=require(_0xf8a7('0x1'));var zipdir=require(_0xf8a7('0x2'));var jsonpatch=require(_0xf8a7('0x3'));var rp=require(_0xf8a7('0x4'));var moment=require(_0xf8a7('0x5'));var BPromise=require(_0xf8a7('0x6'));var Mustache=require(_0xf8a7('0x7'));var util=require(_0xf8a7('0x8'));var path=require('path');var sox=require(_0xf8a7('0x9'));var csv=require(_0xf8a7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf8a7('0xb'));var _=require(_0xf8a7('0xc'));var squel=require(_0xf8a7('0xd'));var crypto=require('crypto');var jsforce=require(_0xf8a7('0xe'));var deskjs=require(_0xf8a7('0xf'));var toCsv=require(_0xf8a7('0xa'));var querystring=require('querystring');var Papa=require(_0xf8a7('0x10'));var Redis=require(_0xf8a7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf8a7('0x12'));var as=require(_0xf8a7('0x13'));var hardwareService=require(_0xf8a7('0x14'));var logger=require(_0xf8a7('0x15'))(_0xf8a7('0x16'));var utils=require(_0xf8a7('0x17'));var config=require(_0xf8a7('0x18'));var licenseUtil=require(_0xf8a7('0x19'));var db=require(_0xf8a7('0x1a'))['db'];function respondWithStatusCode(_0x517e9c,_0x1c96d7){_0x1c96d7=_0x1c96d7||0xcc;return function(_0x32cf71){if(_0x32cf71){return _0x517e9c[_0xf8a7('0x1b')](_0x1c96d7);}return _0x517e9c[_0xf8a7('0x1c')](_0x1c96d7)[_0xf8a7('0x1d')]();};}function respondWithResult(_0x1c2b24,_0x2744ab){_0x2744ab=_0x2744ab||0xc8;return function(_0x2137c5){if(_0x2137c5){return _0x1c2b24['status'](_0x2744ab)[_0xf8a7('0x1e')](_0x2137c5);}};}function respondWithFilteredResult(_0x50474f,_0x510a98){return function(_0x57f695){if(_0x57f695){var _0x2e1fd8=typeof _0x510a98[_0xf8a7('0x1f')]===_0xf8a7('0x20')&&typeof _0x510a98[_0xf8a7('0x21')]==='undefined';var _0x4de977=_0x57f695['count'];var _0x2c37a9=_0x2e1fd8?0x0:_0x510a98[_0xf8a7('0x1f')];var _0x44780b=_0x2e1fd8?_0x57f695['count']:_0x510a98[_0xf8a7('0x1f')]+_0x510a98[_0xf8a7('0x21')];var _0x2ef973;if(_0x44780b>=_0x4de977){_0x44780b=_0x4de977;_0x2ef973=0xc8;}else{_0x2ef973=0xce;}_0x50474f[_0xf8a7('0x1c')](_0x2ef973);return _0x50474f[_0xf8a7('0x22')]('Content-Range',_0x2c37a9+'-'+_0x44780b+'/'+_0x4de977)[_0xf8a7('0x1e')](_0x57f695);}return null;};}function patchUpdates(_0x54ae1c){return function(_0x3048c7){try{jsonpatch[_0xf8a7('0x23')](_0x3048c7,_0x54ae1c,!![]);}catch(_0xe495cc){return BPromise[_0xf8a7('0x24')](_0xe495cc);}return _0x3048c7[_0xf8a7('0x25')]();};}function saveUpdates(_0x4abeb9,_0x182265){return function(_0x3b1d1c){if(_0x3b1d1c){return _0x3b1d1c[_0xf8a7('0x26')](_0x4abeb9)[_0xf8a7('0x27')](function(_0xaf0a59){return _0xaf0a59;});}return null;};}function removeEntity(_0x28b739,_0x15151d){return function(_0x2505ca){if(_0x2505ca){return _0x2505ca[_0xf8a7('0x28')]()[_0xf8a7('0x27')](function(){_0x28b739[_0xf8a7('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57d971,_0x51b882){return function(_0x487a40){if(!_0x487a40){_0x57d971[_0xf8a7('0x1b')](0x194);}return _0x487a40;};}function handleError(_0x5e121d,_0x7feaaa){_0x7feaaa=_0x7feaaa||0x1f4;return function(_0x82d5d2){logger[_0xf8a7('0x29')](_0x82d5d2['stack']);if(_0x82d5d2[_0xf8a7('0x2a')]){delete _0x82d5d2[_0xf8a7('0x2a')];}_0x5e121d['status'](_0x7feaaa)[_0xf8a7('0x2b')](_0x82d5d2);};}exports[_0xf8a7('0x2c')]=function(_0x12b4c4,_0x304478){var _0x4ace47={},_0x585d97={},_0x92c0af={'count':0x0,'rows':[]};var _0x36f53a=_['map'](db[_0xf8a7('0x2d')][_0xf8a7('0x2e')],function(_0x5ef6d5){return{'name':_0x5ef6d5[_0xf8a7('0x2f')],'type':_0x5ef6d5[_0xf8a7('0x30')][_0xf8a7('0x31')]};});_0x585d97[_0xf8a7('0x32')]=_[_0xf8a7('0x33')](_[_0xf8a7('0x34')](_0x36f53a,_0xf8a7('0x2a')),[_0xf8a7('0x2a')]);_0x585d97[_0xf8a7('0x35')]=_['keys'](_0x12b4c4['query']);_0x585d97[_0xf8a7('0x36')]=_['intersection'](_0x585d97[_0xf8a7('0x32')],_0x585d97[_0xf8a7('0x35')]);_0x4ace47['attributes']=_[_0xf8a7('0x37')](_0x585d97[_0xf8a7('0x32')],qs['fields'](_0x12b4c4[_0xf8a7('0x35')][_0xf8a7('0x38')]));_0x4ace47[_0xf8a7('0x39')]=_0x4ace47[_0xf8a7('0x39')][_0xf8a7('0x3a')]?_0x4ace47['attributes']:_0x585d97[_0xf8a7('0x32')];if(!_0x12b4c4[_0xf8a7('0x35')][_0xf8a7('0x3b')](_0xf8a7('0x3c'))){_0x4ace47[_0xf8a7('0x21')]=qs['limit'](_0x12b4c4[_0xf8a7('0x35')][_0xf8a7('0x21')]);_0x4ace47[_0xf8a7('0x1f')]=qs[_0xf8a7('0x1f')](_0x12b4c4[_0xf8a7('0x35')][_0xf8a7('0x1f')]);}_0x4ace47[_0xf8a7('0x3d')]=qs[_0xf8a7('0x3e')](_0x12b4c4[_0xf8a7('0x35')][_0xf8a7('0x3e')]);_0x4ace47['where']=qs['filters'](_['pick'](_0x12b4c4['query'],_0x585d97[_0xf8a7('0x36')]),_0x36f53a);if(_0x12b4c4['query']['filter']){_0x4ace47[_0xf8a7('0x3f')]=_[_0xf8a7('0x40')](_0x4ace47['where'],{'$or':_[_0xf8a7('0x34')](_0x36f53a,function(_0x5c96e0){if(_0x5c96e0['type']!==_0xf8a7('0x41')){var _0x90dbd5={};_0x90dbd5[_0x5c96e0[_0xf8a7('0x2a')]]={'$like':'%'+_0x12b4c4[_0xf8a7('0x35')]['filter']+'%'};return _0x90dbd5;}})});}_0x4ace47=_[_0xf8a7('0x40')]({},_0x4ace47,_0x12b4c4[_0xf8a7('0x42')]);var _0xa1e46f={'where':_0x4ace47[_0xf8a7('0x3f')]};return db[_0xf8a7('0x2d')][_0xf8a7('0x43')](_0xa1e46f)['then'](function(_0x3812fd){_0x92c0af['count']=_0x3812fd;if(_0x12b4c4[_0xf8a7('0x35')][_0xf8a7('0x44')]){_0x4ace47[_0xf8a7('0x45')]=[{'all':!![]}];}return db[_0xf8a7('0x2d')]['findAll'](_0x4ace47);})[_0xf8a7('0x27')](function(_0x3b8f28){_0x92c0af['rows']=_0x3b8f28;return _0x92c0af;})[_0xf8a7('0x27')](respondWithFilteredResult(_0x304478,_0x4ace47))[_0xf8a7('0x46')](handleError(_0x304478,null));};exports[_0xf8a7('0x47')]=function(_0x5f3f13,_0x32074b){var _0x43704e={'raw':!![],'where':{'id':_0x5f3f13[_0xf8a7('0x48')]['id']}},_0x2d5f93={};_0x2d5f93['model']=_['keys'](db[_0xf8a7('0x2d')][_0xf8a7('0x2e')]);_0x2d5f93[_0xf8a7('0x35')]=_[_0xf8a7('0x49')](_0x5f3f13['query']);_0x2d5f93['filters']=_[_0xf8a7('0x37')](_0x2d5f93[_0xf8a7('0x32')],_0x2d5f93[_0xf8a7('0x35')]);_0x43704e[_0xf8a7('0x39')]=_['intersection'](_0x2d5f93[_0xf8a7('0x32')],qs[_0xf8a7('0x38')](_0x5f3f13[_0xf8a7('0x35')]['fields']));_0x43704e[_0xf8a7('0x39')]=_0x43704e[_0xf8a7('0x39')][_0xf8a7('0x3a')]?_0x43704e['attributes']:_0x2d5f93[_0xf8a7('0x32')];if(_0x5f3f13[_0xf8a7('0x35')]['includeAll']){_0x43704e[_0xf8a7('0x45')]=[{'all':!![]}];}_0x43704e=_['merge']({},_0x43704e,_0x5f3f13[_0xf8a7('0x42')]);return db[_0xf8a7('0x2d')][_0xf8a7('0x4a')](_0x43704e)[_0xf8a7('0x27')](handleEntityNotFound(_0x32074b,null))['then'](respondWithResult(_0x32074b,null))['catch'](handleError(_0x32074b,null));};exports[_0xf8a7('0x4b')]=function(_0x2fca73,_0x3cdbbd){return db[_0xf8a7('0x2d')]['create'](_0x2fca73[_0xf8a7('0x4c')],{})[_0xf8a7('0x27')](respondWithResult(_0x3cdbbd,0xc9))[_0xf8a7('0x46')](handleError(_0x3cdbbd,null));};exports[_0xf8a7('0x26')]=function(_0x3f3b66,_0x185e1c){if(_0x3f3b66[_0xf8a7('0x4c')]['id']){delete _0x3f3b66[_0xf8a7('0x4c')]['id'];}return db[_0xf8a7('0x2d')][_0xf8a7('0x4a')]({'where':{'id':_0x3f3b66['params']['id']}})[_0xf8a7('0x27')](handleEntityNotFound(_0x185e1c,null))[_0xf8a7('0x27')](saveUpdates(_0x3f3b66['body'],null))[_0xf8a7('0x27')](respondWithResult(_0x185e1c,null))[_0xf8a7('0x46')](handleError(_0x185e1c,null));};exports[_0xf8a7('0x28')]=function(_0x4552ed,_0x2e5111){return db[_0xf8a7('0x2d')]['find']({'where':{'id':_0x4552ed[_0xf8a7('0x48')]['id']}})[_0xf8a7('0x27')](handleEntityNotFound(_0x2e5111,null))[_0xf8a7('0x27')](removeEntity(_0x2e5111,null))[_0xf8a7('0x46')](handleError(_0x2e5111,null));};exports[_0xf8a7('0x4d')]=function(_0x389e20,_0x19f892,_0x4ed721){return db[_0xf8a7('0x2d')]['find']({'where':{'id':_0x389e20['params']['id']},'attributes':['id',_0xf8a7('0x4e'),'msg_id']})[_0xf8a7('0x27')](handleEntityNotFound(_0x19f892,null))['then'](function(_0x2ff54c){if(_0x2ff54c){if(!_0x2ff54c[_0xf8a7('0x4e')]){throw new db[(_0xf8a7('0x4f'))][(_0xf8a7('0x50'))](_0xf8a7('0x51'));}var _0x3abdd1={'Content-Type':_0xf8a7('0x52'),'Content-Disposition':_0xf8a7('0x53')};if(_0x2ff54c[_0xf8a7('0x54')]){_0x3abdd1['Content-Disposition']='attachment;\x20filename=\x22'+_0x2ff54c[_0xf8a7('0x54')]+_0xf8a7('0x55');}_0x19f892[_0xf8a7('0x22')](_0x3abdd1);return _0x19f892[_0xf8a7('0x2b')](new Buffer(_0x2ff54c[_0xf8a7('0x4e')]));}})[_0xf8a7('0x46')](handleError(_0x19f892,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 2da67f3..c371116 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.model.js +++ b/server/api/voiceMailMessage/voiceMailMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3066=['api','moment','request-promise','path','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util'];(function(_0x1253de,_0x2b60aa){var _0x278961=function(_0x902b68){while(--_0x902b68){_0x1253de['push'](_0x1253de['shift']());}};_0x278961(++_0x2b60aa);}(_0x3066,0x150));var _0x6306=function(_0x52d67e,_0x43c397){_0x52d67e=_0x52d67e-0x0;var _0x5251b2=_0x3066[_0x52d67e];return _0x5251b2;};'use strict';var _=require(_0x6306('0x0'));var util=require(_0x6306('0x1'));var logger=require('../../config/logger')(_0x6306('0x2'));var moment=require(_0x6306('0x3'));var BPromise=require('bluebird');var rp=require(_0x6306('0x4'));var fs=require('fs');var path=require(_0x6306('0x5'));var rimraf=require('rimraf');var config=require(_0x6306('0x6'));var attributes=require(_0x6306('0x7'));module[_0x6306('0x8')]=function(_0x4f4f55,_0x49379d){return _0x4f4f55[_0x6306('0x9')](_0x6306('0xa'),attributes,{'tableName':_0x6306('0xb'),'paranoid':![],'indexes':[{'name':_0x6306('0xc'),'fields':[_0x6306('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1c49=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','dir'];(function(_0x122006,_0x343cb4){var _0xd3582d=function(_0x2e6ef0){while(--_0x2e6ef0){_0x122006['push'](_0x122006['shift']());}};_0xd3582d(++_0x343cb4);}(_0x1c49,0x138));var _0x91c4=function(_0x3e36b6,_0x43de3b){_0x3e36b6=_0x3e36b6-0x0;var _0x4a3a36=_0x1c49[_0x3e36b6];return _0x4a3a36;};'use strict';var _=require(_0x91c4('0x0'));var util=require(_0x91c4('0x1'));var logger=require('../../config/logger')(_0x91c4('0x2'));var moment=require(_0x91c4('0x3'));var BPromise=require(_0x91c4('0x4'));var rp=require(_0x91c4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x91c4('0x6'));var config=require(_0x91c4('0x7'));var attributes=require(_0x91c4('0x8'));module['exports']=function(_0x3039f9,_0x5e0b58){return _0x3039f9[_0x91c4('0x9')](_0x91c4('0xa'),attributes,{'tableName':_0x91c4('0xb'),'paranoid':![],'indexes':[{'name':_0x91c4('0xc'),'fields':[_0x91c4('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index ca9aa28..9e11b4c 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.rpc.js +++ b/server/api/voiceMailMessage/voiceMailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f8e=['message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4c47bd,_0x6be67a){var _0x29d7d1=function(_0x4bfae6){while(--_0x4bfae6){_0x4c47bd['push'](_0x4c47bd['shift']());}};_0x29d7d1(++_0x6be67a);}(_0x9f8e,0x132));var _0xe9f8=function(_0x5a0776,_0x507b9c){_0x5a0776=_0x5a0776-0x0;var _0x4cbaef=_0x9f8e[_0x5a0776];return _0x4cbaef;};'use strict';var _=require(_0xe9f8('0x0'));var util=require('util');var moment=require(_0xe9f8('0x1'));var BPromise=require(_0xe9f8('0x2'));var rs=require(_0xe9f8('0x3'));var fs=require('fs');var Redis=require(_0xe9f8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe9f8('0x5'));var logger=require(_0xe9f8('0x6'))(_0xe9f8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35f823,_0x946916,_0x4c4977){return new BPromise(function(_0x5bcc85,_0x22a106){return client['request'](_0x35f823,_0x4c4977)[_0xe9f8('0x8')](function(_0x1230ad){logger[_0xe9f8('0x9')](_0xe9f8('0xa'),_0x946916,_0xe9f8('0xb'));logger[_0xe9f8('0xc')](_0xe9f8('0xd'),_0x946916,_0xe9f8('0xb'),JSON[_0xe9f8('0xe')](_0x1230ad));if(_0x1230ad[_0xe9f8('0xf')]){if(_0x1230ad[_0xe9f8('0xf')][_0xe9f8('0x10')]===0x1f4){logger['error'](_0xe9f8('0xa'),_0x946916,_0x1230ad[_0xe9f8('0xf')][_0xe9f8('0x11')]);return _0x22a106(_0x1230ad[_0xe9f8('0xf')][_0xe9f8('0x11')]);}logger[_0xe9f8('0xf')](_0xe9f8('0xa'),_0x946916,_0x1230ad[_0xe9f8('0xf')][_0xe9f8('0x11')]);return _0x5bcc85(_0x1230ad[_0xe9f8('0xf')]['message']);}else{logger[_0xe9f8('0x9')](_0xe9f8('0xa'),_0x946916,'request\x20sent');_0x5bcc85(_0x1230ad[_0xe9f8('0x12')][_0xe9f8('0x11')]);}})['catch'](function(_0x408db7){logger[_0xe9f8('0xf')](_0xe9f8('0xa'),_0x946916,_0x408db7);_0x22a106(_0x408db7);});});} \ No newline at end of file +var _0x00a3=['message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceMailMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x4f6d0e,_0x5d82af){var _0x4ddc07=function(_0x5f125e){while(--_0x5f125e){_0x4f6d0e['push'](_0x4f6d0e['shift']());}};_0x4ddc07(++_0x5d82af);}(_0x00a3,0xa5));var _0x300a=function(_0x2e76c5,_0x1fb02e){_0x2e76c5=_0x2e76c5-0x0;var _0x108a0d=_0x00a3[_0x2e76c5];return _0x108a0d;};'use strict';var _=require('lodash');var util=require(_0x300a('0x0'));var moment=require(_0x300a('0x1'));var BPromise=require(_0x300a('0x2'));var rs=require(_0x300a('0x3'));var fs=require('fs');var Redis=require(_0x300a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x300a('0x5'));var logger=require(_0x300a('0x6'))(_0x300a('0x7'));var config=require(_0x300a('0x8'));var jayson=require(_0x300a('0x9'));var client=jayson['client'][_0x300a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15116a,_0x40c455,_0x4ecd18){return new BPromise(function(_0x53ae2d,_0x152a9a){return client[_0x300a('0xb')](_0x15116a,_0x4ecd18)[_0x300a('0xc')](function(_0x1f1eb9){logger['info'](_0x300a('0xd'),_0x40c455,'request\x20sent');logger[_0x300a('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x40c455,_0x300a('0xf'),JSON[_0x300a('0x10')](_0x1f1eb9));if(_0x1f1eb9[_0x300a('0x11')]){if(_0x1f1eb9['error'][_0x300a('0x12')]===0x1f4){logger['error'](_0x300a('0xd'),_0x40c455,_0x1f1eb9[_0x300a('0x11')][_0x300a('0x13')]);return _0x152a9a(_0x1f1eb9[_0x300a('0x11')]['message']);}logger[_0x300a('0x11')](_0x300a('0xd'),_0x40c455,_0x1f1eb9[_0x300a('0x11')][_0x300a('0x13')]);return _0x53ae2d(_0x1f1eb9[_0x300a('0x11')][_0x300a('0x13')]);}else{logger[_0x300a('0x14')](_0x300a('0xd'),_0x40c455,'request\x20sent');_0x53ae2d(_0x1f1eb9[_0x300a('0x15')][_0x300a('0x13')]);}})[_0x300a('0x16')](function(_0x31cee6){logger[_0x300a('0x11')](_0x300a('0xd'),_0x40c455,_0x31cee6);_0x152a9a(_0x31cee6);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 3900cad..078cfd3 100644 --- a/server/api/voiceMusicOnHold/index.js +++ b/server/api/voiceMusicOnHold/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39c9=['Router','fs-extra','../../components/auth/service','./voiceMusicOnHold.controller','isAuthenticated','index','get','/:id','show','/:id/sounds','post','update','delete','destroy','/:id/sounds/:id2','exports','multer','util','path','connect-timeout','express'];(function(_0x118b0a,_0x33d432){var _0x2fd10b=function(_0x3518f9){while(--_0x3518f9){_0x118b0a['push'](_0x118b0a['shift']());}};_0x2fd10b(++_0x33d432);}(_0x39c9,0x1f3));var _0x939c=function(_0x412686,_0x3fde24){_0x412686=_0x412686-0x0;var _0x18619e=_0x39c9[_0x412686];return _0x18619e;};'use strict';var multer=require(_0x939c('0x0'));var util=require(_0x939c('0x1'));var path=require(_0x939c('0x2'));var timeout=require(_0x939c('0x3'));var express=require(_0x939c('0x4'));var router=express[_0x939c('0x5')]();var fs_extra=require(_0x939c('0x6'));var auth=require(_0x939c('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x939c('0x8'));router['get']('/',auth[_0x939c('0x9')](),controller[_0x939c('0xa')]);router[_0x939c('0xb')](_0x939c('0xc'),auth[_0x939c('0x9')](),controller[_0x939c('0xd')]);router[_0x939c('0xb')](_0x939c('0xe'),auth['isAuthenticated'](),controller['getSounds']);router[_0x939c('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x939c('0xf')]('/:id/sounds',auth[_0x939c('0x9')](),controller['addSound']);router['put'](_0x939c('0xc'),auth['isAuthenticated'](),controller[_0x939c('0x10')]);router[_0x939c('0x11')](_0x939c('0xc'),auth[_0x939c('0x9')](),controller[_0x939c('0x12')]);router['delete'](_0x939c('0x13'),auth[_0x939c('0x9')](),controller['removeSound']);module[_0x939c('0x14')]=router; \ No newline at end of file +var _0x1cb6=['/:id/sounds','getSounds','post','create','addSound','put','delete','/:id/sounds/:id2','removeSound','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x57101c,_0x1ab2d3){var _0x525315=function(_0x10cabb){while(--_0x10cabb){_0x57101c['push'](_0x57101c['shift']());}};_0x525315(++_0x1ab2d3);}(_0x1cb6,0x1c2));var _0x61cb=function(_0x3097c3,_0x237e3e){_0x3097c3=_0x3097c3-0x0;var _0x3657d5=_0x1cb6[_0x3097c3];return _0x3657d5;};'use strict';var multer=require(_0x61cb('0x0'));var util=require(_0x61cb('0x1'));var path=require('path');var timeout=require(_0x61cb('0x2'));var express=require(_0x61cb('0x3'));var router=express[_0x61cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x61cb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x61cb('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0x61cb('0x7')]('/',auth[_0x61cb('0x8')](),controller[_0x61cb('0x9')]);router['get'](_0x61cb('0xa'),auth[_0x61cb('0x8')](),controller[_0x61cb('0xb')]);router[_0x61cb('0x7')](_0x61cb('0xc'),auth[_0x61cb('0x8')](),controller[_0x61cb('0xd')]);router[_0x61cb('0xe')]('/',auth[_0x61cb('0x8')](),controller[_0x61cb('0xf')]);router['post'](_0x61cb('0xc'),auth[_0x61cb('0x8')](),controller[_0x61cb('0x10')]);router[_0x61cb('0x11')]('/:id',auth[_0x61cb('0x8')](),controller['update']);router[_0x61cb('0x12')](_0x61cb('0xa'),auth[_0x61cb('0x8')](),controller['destroy']);router['delete'](_0x61cb('0x13'),auth[_0x61cb('0x8')](),controller[_0x61cb('0x14')]);module[_0x61cb('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 3b7ac0c..2dc7934 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6f9=['mp3nb','quietmp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','custom','files'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xe6f9,0x1b4));var _0x9e6f=function(_0x1262b1,_0x4eee39){_0x1262b1=_0x1262b1-0x0;var _0x28324c=_0xe6f9[_0x1262b1];return _0x28324c;};'use strict';var Sequelize=require(_0x9e6f('0x0'));module['exports']={'name':{'type':Sequelize[_0x9e6f('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM'](_0x9e6f('0x2'),_0x9e6f('0x3'),_0x9e6f('0x4'),_0x9e6f('0x5'),_0x9e6f('0x6'),'mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x9e6f('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x9e6f('0x1')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9e6f('0x7')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x9e6f('0x8')},'defaultEntry':{'type':Sequelize[_0x9e6f('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2859=['custom','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','BOOLEAN','sequelize','exports','STRING','name','ENUM'];(function(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0x2859,0x126));var _0x9285=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x2859[_0x2ec461];return _0x28603d;};'use strict';var Sequelize=require(_0x9285('0x0'));module[_0x9285('0x1')]={'name':{'type':Sequelize[_0x9285('0x2')],'allowNull':![],'unique':_0x9285('0x3')},'mode':{'type':Sequelize[_0x9285('0x4')](_0x9285('0x5'),_0x9285('0x6'),_0x9285('0x7'),_0x9285('0x8'),_0x9285('0x9'),_0x9285('0xa')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x9285('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x9285('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x9285('0x2')],'allowNull':!![],'defaultValue':_0x9285('0xb')},'format':{'type':Sequelize[_0x9285('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x9285('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index bfd430f..dc0322f 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa3f1=['VoiceMusicOnHold','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','body','sequelize','transaction','mode','directory','join','server/files/moh','files','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','root','symlinkSync','message','removeSound','id2','getSounds','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','update','destroy','get','MusicOnHolds','UserProfileResource','then','error','name','send','index','map'];(function(_0x4333c9,_0xbb6496){var _0x4bfeb9=function(_0x35d658){while(--_0x35d658){_0x4333c9['push'](_0x4333c9['shift']());}};_0x4bfeb9(++_0xbb6496);}(_0xa3f1,0x197));var _0x1a3f=function(_0x36d9c3,_0x39e57f){_0x36d9c3=_0x36d9c3-0x0;var _0x536441=_0xa3f1[_0x36d9c3];return _0x536441;};'use strict';var emlformat=require(_0x1a3f('0x0'));var rimraf=require(_0x1a3f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a3f('0x2'));var rp=require(_0x1a3f('0x3'));var moment=require(_0x1a3f('0x4'));var BPromise=require(_0x1a3f('0x5'));var Mustache=require(_0x1a3f('0x6'));var util=require(_0x1a3f('0x7'));var path=require('path');var sox=require(_0x1a3f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a3f('0x9'));var _=require(_0x1a3f('0xa'));var squel=require(_0x1a3f('0xb'));var crypto=require(_0x1a3f('0xc'));var jsforce=require(_0x1a3f('0xd'));var deskjs=require(_0x1a3f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1a3f('0xf'));var Papa=require(_0x1a3f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a3f('0x11'));var hardwareService=require(_0x1a3f('0x12'));var logger=require(_0x1a3f('0x13'))(_0x1a3f('0x14'));var utils=require(_0x1a3f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1a3f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x284d47,_0x177f5f){_0x177f5f=_0x177f5f||0xcc;return function(_0x43fc40){if(_0x43fc40){return _0x284d47[_0x1a3f('0x17')](_0x177f5f);}return _0x284d47[_0x1a3f('0x18')](_0x177f5f)[_0x1a3f('0x19')]();};}function respondWithResult(_0x34841f,_0x256824){_0x256824=_0x256824||0xc8;return function(_0x4de9cf){if(_0x4de9cf){return _0x34841f[_0x1a3f('0x18')](_0x256824)['json'](_0x4de9cf);}};}function respondWithFilteredResult(_0x39dc91,_0x1915bd){return function(_0x44023e){if(_0x44023e){var _0x6ce8a4=typeof _0x1915bd[_0x1a3f('0x1a')]===_0x1a3f('0x1b')&&typeof _0x1915bd['limit']===_0x1a3f('0x1b');var _0x4b5eee=_0x44023e[_0x1a3f('0x1c')];var _0x173770=_0x6ce8a4?0x0:_0x1915bd[_0x1a3f('0x1a')];var _0x35d094=_0x6ce8a4?_0x44023e[_0x1a3f('0x1c')]:_0x1915bd['offset']+_0x1915bd[_0x1a3f('0x1d')];var _0x3a8a38;if(_0x35d094>=_0x4b5eee){_0x35d094=_0x4b5eee;_0x3a8a38=0xc8;}else{_0x3a8a38=0xce;}_0x39dc91[_0x1a3f('0x18')](_0x3a8a38);return _0x39dc91[_0x1a3f('0x1e')]('Content-Range',_0x173770+'-'+_0x35d094+'/'+_0x4b5eee)[_0x1a3f('0x1f')](_0x44023e);}return null;};}function patchUpdates(_0x3a88a5){return function(_0x5abc0b){try{jsonpatch[_0x1a3f('0x20')](_0x5abc0b,_0x3a88a5,!![]);}catch(_0x171396){return BPromise[_0x1a3f('0x21')](_0x171396);}return _0x5abc0b['save']();};}function saveUpdates(_0x203e39,_0x4c1be9){return function(_0x4b3bec){if(_0x4b3bec){return _0x4b3bec[_0x1a3f('0x22')](_0x203e39)['then'](function(_0x272486){return _0x272486;});}return null;};}function removeEntity(_0x4dbffe,_0x32f152){return function(_0x353ce4){if(_0x353ce4){return _0x353ce4[_0x1a3f('0x23')]()['then'](function(){var _0x321775=_0x353ce4[_0x1a3f('0x24')]({'plain':!![]});var _0x312572=_0x1a3f('0x25');return db[_0x1a3f('0x26')]['destroy']({'where':{'type':_0x312572,'resourceId':_0x321775['id']}})['then'](function(){return _0x353ce4;});})[_0x1a3f('0x27')](function(){_0x4dbffe[_0x1a3f('0x18')](0xcc)[_0x1a3f('0x19')]();});}};}function handleEntityNotFound(_0x504361,_0x1bd7d1){return function(_0x4a1734){if(!_0x4a1734){_0x504361['sendStatus'](0x194);}return _0x4a1734;};}function handleError(_0x20050e,_0x2602a6){_0x2602a6=_0x2602a6||0x1f4;return function(_0x2a6746){logger[_0x1a3f('0x28')](_0x2a6746['stack']);if(_0x2a6746[_0x1a3f('0x29')]){delete _0x2a6746['name'];}_0x20050e[_0x1a3f('0x18')](_0x2602a6)[_0x1a3f('0x2a')](_0x2a6746);};}exports[_0x1a3f('0x2b')]=function(_0xa9e7b0,_0x507860){var _0x3e8740={},_0x4e19c8={},_0x544184={'count':0x0,'rows':[]};var _0x352bc6=_[_0x1a3f('0x2c')](db[_0x1a3f('0x2d')][_0x1a3f('0x2e')],function(_0x2a12b7){return{'name':_0x2a12b7[_0x1a3f('0x2f')],'type':_0x2a12b7[_0x1a3f('0x30')]['key']};});_0x4e19c8[_0x1a3f('0x31')]=_[_0x1a3f('0x2c')](_0x352bc6,_0x1a3f('0x29'));_0x4e19c8['query']=_[_0x1a3f('0x32')](_0xa9e7b0[_0x1a3f('0x33')]);_0x4e19c8[_0x1a3f('0x34')]=_[_0x1a3f('0x35')](_0x4e19c8['model'],_0x4e19c8['query']);_0x3e8740[_0x1a3f('0x36')]=_[_0x1a3f('0x35')](_0x4e19c8['model'],qs['fields'](_0xa9e7b0[_0x1a3f('0x33')][_0x1a3f('0x37')]));_0x3e8740[_0x1a3f('0x36')]=_0x3e8740[_0x1a3f('0x36')]['length']?_0x3e8740[_0x1a3f('0x36')]:_0x4e19c8[_0x1a3f('0x31')];if(!_0xa9e7b0[_0x1a3f('0x33')]['hasOwnProperty'](_0x1a3f('0x38'))){_0x3e8740['limit']=qs[_0x1a3f('0x1d')](_0xa9e7b0[_0x1a3f('0x33')]['limit']);_0x3e8740[_0x1a3f('0x1a')]=qs['offset'](_0xa9e7b0[_0x1a3f('0x33')][_0x1a3f('0x1a')]);}_0x3e8740[_0x1a3f('0x39')]=qs[_0x1a3f('0x3a')](_0xa9e7b0[_0x1a3f('0x33')][_0x1a3f('0x3a')]);delete _0xa9e7b0[_0x1a3f('0x33')]['sort'];_0x3e8740[_0x1a3f('0x3b')]=qs[_0x1a3f('0x34')](_[_0x1a3f('0x3c')](_0xa9e7b0[_0x1a3f('0x33')],_0x4e19c8[_0x1a3f('0x34')]),_0x352bc6);if(_0xa9e7b0['query'][_0x1a3f('0x3d')]){_0x3e8740[_0x1a3f('0x3b')]=_['merge'](_0x3e8740['where'],{'$or':_[_0x1a3f('0x2c')](_0x352bc6,function(_0x40d7ce){if(_0x40d7ce['type']!==_0x1a3f('0x3e')){var _0x2f3679={};_0x2f3679[_0x40d7ce['name']]={'$like':'%'+_0xa9e7b0[_0x1a3f('0x33')][_0x1a3f('0x3d')]+'%'};return _0x2f3679;}})});}_0x3e8740=_[_0x1a3f('0x3f')]({},_0x3e8740,_0xa9e7b0['options']);var _0x19f717={'where':_0x3e8740['where']};return db[_0x1a3f('0x2d')][_0x1a3f('0x1c')](_0x19f717)['then'](function(_0x48aa9d){_0x544184['count']=_0x48aa9d;if(_0xa9e7b0[_0x1a3f('0x33')][_0x1a3f('0x40')]){_0x3e8740[_0x1a3f('0x41')]=[{'all':!![]}];}return db[_0x1a3f('0x2d')][_0x1a3f('0x42')](_0x3e8740);})[_0x1a3f('0x27')](function(_0x29ebe8){_0x544184[_0x1a3f('0x43')]=_0x29ebe8;return _0x544184;})[_0x1a3f('0x27')](respondWithFilteredResult(_0x507860,_0x3e8740))[_0x1a3f('0x44')](handleError(_0x507860,null));};exports[_0x1a3f('0x45')]=function(_0x239239,_0x48ed09){var _0x3894a5={'raw':![],'where':{'id':_0x239239[_0x1a3f('0x46')]['id']}},_0x4a1b68={};_0x4a1b68[_0x1a3f('0x31')]=_[_0x1a3f('0x32')](db[_0x1a3f('0x2d')][_0x1a3f('0x2e')]);_0x4a1b68['query']=_[_0x1a3f('0x32')](_0x239239[_0x1a3f('0x33')]);_0x4a1b68[_0x1a3f('0x34')]=_[_0x1a3f('0x35')](_0x4a1b68[_0x1a3f('0x31')],_0x4a1b68[_0x1a3f('0x33')]);_0x3894a5[_0x1a3f('0x36')]=_[_0x1a3f('0x35')](_0x4a1b68['model'],qs[_0x1a3f('0x37')](_0x239239[_0x1a3f('0x33')][_0x1a3f('0x37')]));_0x3894a5[_0x1a3f('0x36')]=_0x3894a5['attributes'][_0x1a3f('0x47')]?_0x3894a5['attributes']:_0x4a1b68[_0x1a3f('0x31')];if(_0x239239[_0x1a3f('0x33')][_0x1a3f('0x40')]){_0x3894a5[_0x1a3f('0x41')]=[{'all':!![]}];}_0x3894a5=_[_0x1a3f('0x3f')]({},_0x3894a5,_0x239239[_0x1a3f('0x48')]);return db[_0x1a3f('0x2d')][_0x1a3f('0x49')](_0x3894a5)[_0x1a3f('0x27')](handleEntityNotFound(_0x48ed09,null))[_0x1a3f('0x27')](respondWithResult(_0x48ed09,null))[_0x1a3f('0x44')](handleError(_0x48ed09,null));};exports['update']=function(_0x3cada6,_0x552965){if(_0x3cada6['body']['id']){delete _0x3cada6[_0x1a3f('0x4a')]['id'];}return db[_0x1a3f('0x2d')][_0x1a3f('0x49')]({'where':{'id':_0x3cada6['params']['id']}})[_0x1a3f('0x27')](handleEntityNotFound(_0x552965,null))['then'](saveUpdates(_0x3cada6[_0x1a3f('0x4a')],null))[_0x1a3f('0x27')](respondWithResult(_0x552965,null))[_0x1a3f('0x44')](handleError(_0x552965,null));};exports['create']=function(_0x2ee3d6,_0x55b8e2,_0x9adae2){return db[_0x1a3f('0x4b')][_0x1a3f('0x4c')](function(_0x1a4dbf){if(_0x2ee3d6[_0x1a3f('0x4a')][_0x1a3f('0x4d')]==='files'){_0x2ee3d6[_0x1a3f('0x4a')][_0x1a3f('0x4e')]=path[_0x1a3f('0x4f')](config['root'],_0x1a3f('0x50'),_0x2ee3d6['body'][_0x1a3f('0x29')]);}return db[_0x1a3f('0x2d')]['create'](_0x2ee3d6[_0x1a3f('0x4a')],{'transaction':_0x1a4dbf})[_0x1a3f('0x27')](function(_0x4a02da){if(_0x2ee3d6[_0x1a3f('0x4a')]['mode']===_0x1a3f('0x51')){fs[_0x1a3f('0x52')](_0x4a02da['directory'],parseInt('0777',0x8));}var _0x32fb67=_0x2ee3d6[_0x1a3f('0x53')]['get']({'plain':!![]});if(!_0x32fb67)throw new Error(_0x1a3f('0x54'));if(_0x32fb67[_0x1a3f('0x55')]===_0x1a3f('0x53')){var _0x20bd64=_0x4a02da[_0x1a3f('0x24')]({'plain':!![]});return db[_0x1a3f('0x56')][_0x1a3f('0x49')]({'where':{'name':_0x1a3f('0x25'),'userProfileId':_0x32fb67[_0x1a3f('0x57')]},'raw':!![]})['then'](function(_0x195133){if(_0x195133&&_0x195133['autoAssociation']===0x0){return db[_0x1a3f('0x26')]['create']({'name':_0x20bd64[_0x1a3f('0x29')],'resourceId':_0x20bd64['id'],'type':_0x195133[_0x1a3f('0x29')],'sectionId':_0x195133['id']},{})[_0x1a3f('0x27')](function(){return _0x4a02da;});}else{return _0x4a02da;}})[_0x1a3f('0x44')](function(_0x2e4a49){logger[_0x1a3f('0x28')](_0x1a3f('0x58'),_0x2e4a49);});}return _0x4a02da;});})[_0x1a3f('0x27')](respondWithResult(_0x55b8e2,0xc9))[_0x1a3f('0x44')](handleError(_0x55b8e2,null));};exports[_0x1a3f('0x23')]=function(_0x51733d,_0x1a0624,_0x2d571b){var _0x35b6a3;return db[_0x1a3f('0x2d')][_0x1a3f('0x49')]({'where':{'id':_0x51733d['params']['id']}})[_0x1a3f('0x27')](function(_0x2163c1){if(_0x2163c1){return db[_0x1a3f('0x4b')]['transaction'](function(_0x341eb8){return _0x2163c1[_0x1a3f('0x23')]({'transaction':_0x341eb8,'raw':!![]})[_0x1a3f('0x27')](function(_0x51dde2){if(_0x51dde2[_0x1a3f('0x4e')]){fs[_0x1a3f('0x59')](_0x51dde2[_0x1a3f('0x4e')])[_0x1a3f('0x5a')](function(_0x955bd6){fs[_0x1a3f('0x5b')](path[_0x1a3f('0x4f')](_0x51dde2[_0x1a3f('0x4e')],_0x955bd6));});fs[_0x1a3f('0x5c')](_0x51dde2['directory']);}return _0x51dde2;});})[_0x1a3f('0x44')](function(_0x587748){throw new db[(_0x1a3f('0x5d'))][(_0x1a3f('0x5e'))](_0x587748['message']);});}})[_0x1a3f('0x27')](handleEntityNotFound(_0x1a0624,null))[_0x1a3f('0x27')](removeEntity(_0x1a0624,null))['catch'](handleError(_0x1a0624,null));};exports[_0x1a3f('0x5f')]=function(_0x288ff3,_0x1abab5,_0x3f12c8){return db['sequelize'][_0x1a3f('0x4c')](function(_0x4669e6){var _0x5f3972;return db[_0x1a3f('0x2d')]['find']({'where':{'id':_0x288ff3[_0x1a3f('0x46')]['id']}})[_0x1a3f('0x27')](function(_0x5d8a5b){if(_0x5d8a5b){_0x5f3972=_0x5d8a5b;return _0x5d8a5b[_0x1a3f('0x5f')](_0x288ff3[_0x1a3f('0x4a')]['id'],{'transaction':_0x4669e6});}})[_0x1a3f('0x27')](function(_0x105294){if(_0x105294){return db[_0x1a3f('0x60')][_0x1a3f('0x61')]({'where':{'id':_0x288ff3[_0x1a3f('0x4a')]['id']},'attributes':['id',_0x1a3f('0x29'),_0x1a3f('0x62'),_0x1a3f('0x63'),_0x1a3f('0x64')],'raw':!![]});}})['then'](function(_0x22b35f){if(_0x22b35f){var _0xd1b58e=path[_0x1a3f('0x4f')](config['root'],_0x1a3f('0x65'),util[_0x1a3f('0x66')](_0x1a3f('0x67'),path[_0x1a3f('0x68')](_0x22b35f[_0x1a3f('0x62')],path[_0x1a3f('0x69')](_0x22b35f[_0x1a3f('0x62')])),_0x22b35f[_0x1a3f('0x63')]));var _0x25e999=path[_0x1a3f('0x4f')](config[_0x1a3f('0x6a')],'server/files/moh',_0x5f3972['name'],util['format'](_0x1a3f('0x67'),_0x22b35f[_0x1a3f('0x29')],_0x22b35f[_0x1a3f('0x63')]));fs[_0x1a3f('0x6b')](_0xd1b58e,_0x25e999);return _0x22b35f;}})['catch'](function(_0x175874){throw new db[(_0x1a3f('0x5d'))]['ValidationError'](_0x175874[_0x1a3f('0x6c')]);});})[_0x1a3f('0x27')](handleEntityNotFound(_0x1abab5,null))['then'](respondWithResult(_0x1abab5,0xc9))['catch'](handleError(_0x1abab5,null));};exports[_0x1a3f('0x6d')]=function(_0x41d94c,_0x15c066,_0x4de27b){return db[_0x1a3f('0x4b')][_0x1a3f('0x4c')](function(_0x263523){var _0x4dbdcd;return db[_0x1a3f('0x2d')]['findOne']({'where':{'id':_0x41d94c[_0x1a3f('0x46')]['id']}})[_0x1a3f('0x27')](handleEntityNotFound(_0x15c066,null))[_0x1a3f('0x27')](function(_0xbd626e){if(_0xbd626e){_0x4dbdcd=_0xbd626e;return _0xbd626e[_0x1a3f('0x6d')](_0x41d94c['params'][_0x1a3f('0x6e')]);}})[_0x1a3f('0x27')](function(_0x440f66){if(_0x440f66){return db[_0x1a3f('0x60')][_0x1a3f('0x61')]({'where':{'id':_0x41d94c['params'][_0x1a3f('0x6e')]},'attributes':['id','name',_0x1a3f('0x62'),_0x1a3f('0x63'),'createdAt'],'raw':!![]});}})['then'](function(_0x460a91){if(_0x460a91){fs[_0x1a3f('0x5b')](path['join'](_0x4dbdcd[_0x1a3f('0x4e')],util[_0x1a3f('0x66')](_0x1a3f('0x67'),_0x460a91[_0x1a3f('0x29')],_0x460a91[_0x1a3f('0x63')])));return _0x460a91;}})['catch'](function(_0x5b3be2){throw new db[(_0x1a3f('0x5d'))][(_0x1a3f('0x5e'))](_0x5b3be2[_0x1a3f('0x6c')]);});})[_0x1a3f('0x27')](handleEntityNotFound(_0x15c066,null))[_0x1a3f('0x27')](respondWithStatusCode(_0x15c066,0xcc))[_0x1a3f('0x44')](handleError(_0x15c066,null));};exports[_0x1a3f('0x6f')]=function(_0x4a41ef,_0x3c4547,_0x44317a){var _0x15bc16={};var _0x545863={};var _0x3d0838;var _0x10a351;return db[_0x1a3f('0x2d')][_0x1a3f('0x61')]({'where':{'id':_0x4a41ef[_0x1a3f('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c4547,null))[_0x1a3f('0x27')](function(_0x11a5c8){if(_0x11a5c8){_0x3d0838=_0x11a5c8;_0x545863[_0x1a3f('0x31')]=_[_0x1a3f('0x32')](db[_0x1a3f('0x60')][_0x1a3f('0x2e')]);_0x545863[_0x1a3f('0x33')]=_[_0x1a3f('0x32')](_0x4a41ef[_0x1a3f('0x33')]);_0x545863[_0x1a3f('0x34')]=_['intersection'](_0x545863['model'],_0x545863['query']);_0x15bc16[_0x1a3f('0x36')]=_[_0x1a3f('0x35')](_0x545863[_0x1a3f('0x31')],qs[_0x1a3f('0x37')](_0x4a41ef[_0x1a3f('0x33')][_0x1a3f('0x37')]));_0x15bc16[_0x1a3f('0x36')]=_0x15bc16[_0x1a3f('0x36')][_0x1a3f('0x47')]?_0x15bc16['attributes']:_0x545863['model'];_0x15bc16['order']=qs['sort'](_0x4a41ef[_0x1a3f('0x33')][_0x1a3f('0x3a')]);_0x15bc16[_0x1a3f('0x3b')]=qs[_0x1a3f('0x34')](_[_0x1a3f('0x3c')](_0x4a41ef[_0x1a3f('0x33')],_0x545863[_0x1a3f('0x34')]));if(_0x4a41ef[_0x1a3f('0x33')][_0x1a3f('0x3d')]){_0x15bc16[_0x1a3f('0x3b')]=_[_0x1a3f('0x3f')](_0x15bc16[_0x1a3f('0x3b')],{'$or':_[_0x1a3f('0x2c')](_0x15bc16[_0x1a3f('0x36')],function(_0x2f706b){var _0xb2f897={};_0xb2f897[_0x2f706b]={'$like':'%'+_0x4a41ef[_0x1a3f('0x33')][_0x1a3f('0x3d')]+'%'};return _0xb2f897;})});}_0x15bc16=_['merge']({},_0x15bc16,_0x4a41ef[_0x1a3f('0x48')]);return _0x3d0838[_0x1a3f('0x6f')](_0x15bc16);}})['then'](function(_0x2533d8){if(_0x2533d8){_0x10a351=_0x2533d8[_0x1a3f('0x47')];if(!_0x4a41ef[_0x1a3f('0x33')][_0x1a3f('0x70')](_0x1a3f('0x38'))){_0x15bc16[_0x1a3f('0x1d')]=qs['limit'](_0x4a41ef[_0x1a3f('0x33')]['limit']);_0x15bc16[_0x1a3f('0x1a')]=qs[_0x1a3f('0x1a')](_0x4a41ef[_0x1a3f('0x33')][_0x1a3f('0x1a')]);}return _0x3d0838[_0x1a3f('0x6f')](_0x15bc16);}})[_0x1a3f('0x27')](function(_0x1847e4){if(_0x1847e4){return _0x1847e4?{'count':_0x10a351,'rows':_0x1847e4}:null;}})[_0x1a3f('0x27')](respondWithResult(_0x3c4547,null))[_0x1a3f('0x44')](handleError(_0x3c4547,null));}; \ No newline at end of file +var _0x636b=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','MusicOnHolds','error','stack','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','catch','show','includeAll','include','body','params','sequelize','mode','files','directory','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','join','Sequelize','ValidationError','message','addSound','Sound','converted_format','createdAt','root','%s.%s','basename','save_name','extname','removeSound','findOne','id2','unlinkSync','format','getSounds','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x3c7a95,_0x547e8f){var _0x46a3f6=function(_0x431f6c){while(--_0x431f6c){_0x3c7a95['push'](_0x3c7a95['shift']());}};_0x46a3f6(++_0x547e8f);}(_0x636b,0x13c));var _0xb636=function(_0x523081,_0x3c7985){_0x523081=_0x523081-0x0;var _0x4051a4=_0x636b[_0x523081];return _0x4051a4;};'use strict';var emlformat=require(_0xb636('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb636('0x1'));var rp=require('request-promise');var moment=require(_0xb636('0x2'));var BPromise=require(_0xb636('0x3'));var Mustache=require(_0xb636('0x4'));var util=require(_0xb636('0x5'));var path=require(_0xb636('0x6'));var sox=require(_0xb636('0x7'));var csv=require(_0xb636('0x8'));var ejs=require(_0xb636('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb636('0xa'));var squel=require(_0xb636('0xb'));var crypto=require(_0xb636('0xc'));var jsforce=require(_0xb636('0xd'));var deskjs=require(_0xb636('0xe'));var toCsv=require(_0xb636('0x8'));var querystring=require(_0xb636('0xf'));var Papa=require(_0xb636('0x10'));var Redis=require(_0xb636('0x11'));var authService=require(_0xb636('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb636('0x13'));var logger=require(_0xb636('0x14'))(_0xb636('0x15'));var utils=require('../../config/utils');var config=require(_0xb636('0x16'));var licenseUtil=require(_0xb636('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c347b,_0x2efd47){_0x2efd47=_0x2efd47||0xcc;return function(_0x50cc36){if(_0x50cc36){return _0x1c347b[_0xb636('0x18')](_0x2efd47);}return _0x1c347b[_0xb636('0x19')](_0x2efd47)[_0xb636('0x1a')]();};}function respondWithResult(_0x2675a3,_0x2725f7){_0x2725f7=_0x2725f7||0xc8;return function(_0x4aacd5){if(_0x4aacd5){return _0x2675a3[_0xb636('0x19')](_0x2725f7)[_0xb636('0x1b')](_0x4aacd5);}};}function respondWithFilteredResult(_0x32dae1,_0x58dc59){return function(_0x233efc){if(_0x233efc){var _0x569fb6=typeof _0x58dc59[_0xb636('0x1c')]===_0xb636('0x1d')&&typeof _0x58dc59['limit']==='undefined';var _0x414691=_0x233efc[_0xb636('0x1e')];var _0x1cf0dd=_0x569fb6?0x0:_0x58dc59[_0xb636('0x1c')];var _0x49ce88=_0x569fb6?_0x233efc[_0xb636('0x1e')]:_0x58dc59['offset']+_0x58dc59[_0xb636('0x1f')];var _0xfad92e;if(_0x49ce88>=_0x414691){_0x49ce88=_0x414691;_0xfad92e=0xc8;}else{_0xfad92e=0xce;}_0x32dae1[_0xb636('0x19')](_0xfad92e);return _0x32dae1[_0xb636('0x20')]('Content-Range',_0x1cf0dd+'-'+_0x49ce88+'/'+_0x414691)[_0xb636('0x1b')](_0x233efc);}return null;};}function patchUpdates(_0x537ef7){return function(_0xa29a0b){try{jsonpatch[_0xb636('0x21')](_0xa29a0b,_0x537ef7,!![]);}catch(_0xb9c83){return BPromise[_0xb636('0x22')](_0xb9c83);}return _0xa29a0b[_0xb636('0x23')]();};}function saveUpdates(_0x321c1e,_0x510ff0){return function(_0x584bf1){if(_0x584bf1){return _0x584bf1[_0xb636('0x24')](_0x321c1e)[_0xb636('0x25')](function(_0x5c492f){return _0x5c492f;});}return null;};}function removeEntity(_0x4dea91,_0x481e15){return function(_0x123df3){if(_0x123df3){return _0x123df3[_0xb636('0x26')]()[_0xb636('0x25')](function(){var _0x133013=_0x123df3[_0xb636('0x27')]({'plain':!![]});var _0x49fcb0=_0xb636('0x28');return db['UserProfileResource'][_0xb636('0x26')]({'where':{'type':_0x49fcb0,'resourceId':_0x133013['id']}})['then'](function(){return _0x123df3;});})[_0xb636('0x25')](function(){_0x4dea91[_0xb636('0x19')](0xcc)[_0xb636('0x1a')]();});}};}function handleEntityNotFound(_0x42b976,_0x4f1d0d){return function(_0xc4df1e){if(!_0xc4df1e){_0x42b976['sendStatus'](0x194);}return _0xc4df1e;};}function handleError(_0x476c50,_0x435200){_0x435200=_0x435200||0x1f4;return function(_0x3810b4){logger[_0xb636('0x29')](_0x3810b4[_0xb636('0x2a')]);if(_0x3810b4[_0xb636('0x2b')]){delete _0x3810b4[_0xb636('0x2b')];}_0x476c50[_0xb636('0x19')](_0x435200)[_0xb636('0x2c')](_0x3810b4);};}exports['index']=function(_0x1435dd,_0x420add){var _0x376937={},_0x2e7ccc={},_0x3eb0f3={'count':0x0,'rows':[]};var _0x16a1d9=_[_0xb636('0x2d')](db[_0xb636('0x2e')][_0xb636('0x2f')],function(_0x5c2ce1){return{'name':_0x5c2ce1[_0xb636('0x30')],'type':_0x5c2ce1['type']['key']};});_0x2e7ccc['model']=_['map'](_0x16a1d9,'name');_0x2e7ccc[_0xb636('0x31')]=_[_0xb636('0x32')](_0x1435dd[_0xb636('0x31')]);_0x2e7ccc[_0xb636('0x33')]=_['intersection'](_0x2e7ccc['model'],_0x2e7ccc[_0xb636('0x31')]);_0x376937['attributes']=_[_0xb636('0x34')](_0x2e7ccc['model'],qs['fields'](_0x1435dd[_0xb636('0x31')][_0xb636('0x35')]));_0x376937[_0xb636('0x36')]=_0x376937[_0xb636('0x36')][_0xb636('0x37')]?_0x376937['attributes']:_0x2e7ccc[_0xb636('0x38')];if(!_0x1435dd[_0xb636('0x31')][_0xb636('0x39')](_0xb636('0x3a'))){_0x376937['limit']=qs[_0xb636('0x1f')](_0x1435dd[_0xb636('0x31')][_0xb636('0x1f')]);_0x376937['offset']=qs['offset'](_0x1435dd[_0xb636('0x31')][_0xb636('0x1c')]);}_0x376937[_0xb636('0x3b')]=qs[_0xb636('0x3c')](_0x1435dd[_0xb636('0x31')]['sort']);delete _0x1435dd[_0xb636('0x31')][_0xb636('0x3c')];_0x376937[_0xb636('0x3d')]=qs[_0xb636('0x33')](_[_0xb636('0x3e')](_0x1435dd[_0xb636('0x31')],_0x2e7ccc[_0xb636('0x33')]),_0x16a1d9);if(_0x1435dd[_0xb636('0x31')][_0xb636('0x3f')]){_0x376937[_0xb636('0x3d')]=_[_0xb636('0x40')](_0x376937[_0xb636('0x3d')],{'$or':_[_0xb636('0x2d')](_0x16a1d9,function(_0x3356d8){if(_0x3356d8[_0xb636('0x41')]!=='VIRTUAL'){var _0x2ad75d={};_0x2ad75d[_0x3356d8['name']]={'$like':'%'+_0x1435dd[_0xb636('0x31')][_0xb636('0x3f')]+'%'};return _0x2ad75d;}})});}_0x376937=_[_0xb636('0x40')]({},_0x376937,_0x1435dd[_0xb636('0x42')]);var _0x5e4312={'where':_0x376937[_0xb636('0x3d')]};return db[_0xb636('0x2e')][_0xb636('0x1e')](_0x5e4312)[_0xb636('0x25')](function(_0xc03d7f){_0x3eb0f3['count']=_0xc03d7f;if(_0x1435dd['query']['includeAll']){_0x376937['include']=[{'all':!![]}];}return db[_0xb636('0x2e')]['findAll'](_0x376937);})['then'](function(_0x50f969){_0x3eb0f3['rows']=_0x50f969;return _0x3eb0f3;})[_0xb636('0x25')](respondWithFilteredResult(_0x420add,_0x376937))[_0xb636('0x43')](handleError(_0x420add,null));};exports[_0xb636('0x44')]=function(_0x55ca31,_0x2d0022){var _0x4baa73={'raw':![],'where':{'id':_0x55ca31['params']['id']}},_0x387f71={};_0x387f71[_0xb636('0x38')]=_[_0xb636('0x32')](db[_0xb636('0x2e')][_0xb636('0x2f')]);_0x387f71[_0xb636('0x31')]=_[_0xb636('0x32')](_0x55ca31[_0xb636('0x31')]);_0x387f71['filters']=_[_0xb636('0x34')](_0x387f71['model'],_0x387f71[_0xb636('0x31')]);_0x4baa73[_0xb636('0x36')]=_[_0xb636('0x34')](_0x387f71[_0xb636('0x38')],qs[_0xb636('0x35')](_0x55ca31[_0xb636('0x31')][_0xb636('0x35')]));_0x4baa73['attributes']=_0x4baa73[_0xb636('0x36')]['length']?_0x4baa73[_0xb636('0x36')]:_0x387f71['model'];if(_0x55ca31[_0xb636('0x31')][_0xb636('0x45')]){_0x4baa73[_0xb636('0x46')]=[{'all':!![]}];}_0x4baa73=_[_0xb636('0x40')]({},_0x4baa73,_0x55ca31[_0xb636('0x42')]);return db['VoiceMusicOnHold']['find'](_0x4baa73)[_0xb636('0x25')](handleEntityNotFound(_0x2d0022,null))['then'](respondWithResult(_0x2d0022,null))[_0xb636('0x43')](handleError(_0x2d0022,null));};exports[_0xb636('0x24')]=function(_0x27ebf4,_0x46b3f4){if(_0x27ebf4[_0xb636('0x47')]['id']){delete _0x27ebf4[_0xb636('0x47')]['id'];}return db[_0xb636('0x2e')]['find']({'where':{'id':_0x27ebf4[_0xb636('0x48')]['id']}})[_0xb636('0x25')](handleEntityNotFound(_0x46b3f4,null))[_0xb636('0x25')](saveUpdates(_0x27ebf4[_0xb636('0x47')],null))[_0xb636('0x25')](respondWithResult(_0x46b3f4,null))[_0xb636('0x43')](handleError(_0x46b3f4,null));};exports['create']=function(_0x54405d,_0x55fc97,_0x346fea){return db[_0xb636('0x49')]['transaction'](function(_0x14be1b){if(_0x54405d['body'][_0xb636('0x4a')]===_0xb636('0x4b')){_0x54405d['body'][_0xb636('0x4c')]=path['join'](config['root'],_0xb636('0x4d'),_0x54405d['body'][_0xb636('0x2b')]);}return db[_0xb636('0x2e')]['create'](_0x54405d[_0xb636('0x47')],{'transaction':_0x14be1b})[_0xb636('0x25')](function(_0x4e392c){if(_0x54405d[_0xb636('0x47')][_0xb636('0x4a')]===_0xb636('0x4b')){fs[_0xb636('0x4e')](_0x4e392c[_0xb636('0x4c')],parseInt(_0xb636('0x4f'),0x8));}var _0x81230f=_0x54405d[_0xb636('0x50')][_0xb636('0x27')]({'plain':!![]});if(!_0x81230f)throw new Error(_0xb636('0x51'));if(_0x81230f[_0xb636('0x52')]===_0xb636('0x50')){var _0x17e495=_0x4e392c['get']({'plain':!![]});return db[_0xb636('0x53')][_0xb636('0x54')]({'where':{'name':_0xb636('0x28'),'userProfileId':_0x81230f[_0xb636('0x55')]},'raw':!![]})[_0xb636('0x25')](function(_0x407f7b){if(_0x407f7b&&_0x407f7b[_0xb636('0x56')]===0x0){return db[_0xb636('0x57')][_0xb636('0x58')]({'name':_0x17e495[_0xb636('0x2b')],'resourceId':_0x17e495['id'],'type':_0x407f7b[_0xb636('0x2b')],'sectionId':_0x407f7b['id']},{})[_0xb636('0x25')](function(){return _0x4e392c;});}else{return _0x4e392c;}})[_0xb636('0x43')](function(_0x5b75b0){logger['error'](_0xb636('0x59'),_0x5b75b0);});}return _0x4e392c;});})[_0xb636('0x25')](respondWithResult(_0x55fc97,0xc9))[_0xb636('0x43')](handleError(_0x55fc97,null));};exports[_0xb636('0x26')]=function(_0x16b380,_0x3f16dc,_0x4725fd){var _0x567aab;return db[_0xb636('0x2e')][_0xb636('0x54')]({'where':{'id':_0x16b380[_0xb636('0x48')]['id']}})['then'](function(_0x5c47c5){if(_0x5c47c5){return db[_0xb636('0x49')][_0xb636('0x5a')](function(_0x2ef202){return _0x5c47c5[_0xb636('0x26')]({'transaction':_0x2ef202,'raw':!![]})['then'](function(_0xd6dcb4){if(_0xd6dcb4['directory']){fs[_0xb636('0x5b')](_0xd6dcb4[_0xb636('0x4c')])['forEach'](function(_0x4e78c4){fs['unlinkSync'](path[_0xb636('0x5c')](_0xd6dcb4[_0xb636('0x4c')],_0x4e78c4));});fs['rmdirSync'](_0xd6dcb4[_0xb636('0x4c')]);}return _0xd6dcb4;});})['catch'](function(_0x8c0ccd){throw new db[(_0xb636('0x5d'))][(_0xb636('0x5e'))](_0x8c0ccd[_0xb636('0x5f')]);});}})[_0xb636('0x25')](handleEntityNotFound(_0x3f16dc,null))['then'](removeEntity(_0x3f16dc,null))[_0xb636('0x43')](handleError(_0x3f16dc,null));};exports['addSound']=function(_0xa8b353,_0x22ffb5,_0x10acbe){return db[_0xb636('0x49')][_0xb636('0x5a')](function(_0x18570c){var _0x172aff;return db[_0xb636('0x2e')]['find']({'where':{'id':_0xa8b353['params']['id']}})[_0xb636('0x25')](function(_0x176219){if(_0x176219){_0x172aff=_0x176219;return _0x176219[_0xb636('0x60')](_0xa8b353[_0xb636('0x47')]['id'],{'transaction':_0x18570c});}})['then'](function(_0x5c821b){if(_0x5c821b){return db[_0xb636('0x61')]['findOne']({'where':{'id':_0xa8b353['body']['id']},'attributes':['id',_0xb636('0x2b'),'save_name',_0xb636('0x62'),_0xb636('0x63')],'raw':!![]});}})['then'](function(_0x4d452f){if(_0x4d452f){var _0x3b93c4=path['join'](config[_0xb636('0x64')],'server/files/sounds/converted',util['format'](_0xb636('0x65'),path[_0xb636('0x66')](_0x4d452f[_0xb636('0x67')],path[_0xb636('0x68')](_0x4d452f[_0xb636('0x67')])),_0x4d452f[_0xb636('0x62')]));var _0x1a7634=path[_0xb636('0x5c')](config['root'],_0xb636('0x4d'),_0x172aff[_0xb636('0x2b')],util['format']('%s.%s',_0x4d452f[_0xb636('0x2b')],_0x4d452f['converted_format']));fs['symlinkSync'](_0x3b93c4,_0x1a7634);return _0x4d452f;}})[_0xb636('0x43')](function(_0x200a7a){throw new db[(_0xb636('0x5d'))][(_0xb636('0x5e'))](_0x200a7a[_0xb636('0x5f')]);});})['then'](handleEntityNotFound(_0x22ffb5,null))['then'](respondWithResult(_0x22ffb5,0xc9))[_0xb636('0x43')](handleError(_0x22ffb5,null));};exports[_0xb636('0x69')]=function(_0x4e4a17,_0x1374a8,_0x3b2bcf){return db[_0xb636('0x49')][_0xb636('0x5a')](function(_0x268c15){var _0x126710;return db[_0xb636('0x2e')][_0xb636('0x6a')]({'where':{'id':_0x4e4a17[_0xb636('0x48')]['id']}})[_0xb636('0x25')](handleEntityNotFound(_0x1374a8,null))[_0xb636('0x25')](function(_0xadc55e){if(_0xadc55e){_0x126710=_0xadc55e;return _0xadc55e[_0xb636('0x69')](_0x4e4a17[_0xb636('0x48')][_0xb636('0x6b')]);}})[_0xb636('0x25')](function(_0x4d6629){if(_0x4d6629){return db[_0xb636('0x61')][_0xb636('0x6a')]({'where':{'id':_0x4e4a17[_0xb636('0x48')][_0xb636('0x6b')]},'attributes':['id',_0xb636('0x2b'),_0xb636('0x67'),_0xb636('0x62'),_0xb636('0x63')],'raw':!![]});}})['then'](function(_0x574ebe){if(_0x574ebe){fs[_0xb636('0x6c')](path[_0xb636('0x5c')](_0x126710[_0xb636('0x4c')],util[_0xb636('0x6d')](_0xb636('0x65'),_0x574ebe[_0xb636('0x2b')],_0x574ebe[_0xb636('0x62')])));return _0x574ebe;}})['catch'](function(_0x409166){throw new db[(_0xb636('0x5d'))]['ValidationError'](_0x409166[_0xb636('0x5f')]);});})[_0xb636('0x25')](handleEntityNotFound(_0x1374a8,null))[_0xb636('0x25')](respondWithStatusCode(_0x1374a8,0xcc))[_0xb636('0x43')](handleError(_0x1374a8,null));};exports['getSounds']=function(_0x20c9fa,_0x259abf,_0x17d769){var _0x589ce9={};var _0x30af74={};var _0x3c160b;var _0x4e777d;return db['VoiceMusicOnHold'][_0xb636('0x6a')]({'where':{'id':_0x20c9fa[_0xb636('0x48')]['id']}})[_0xb636('0x25')](handleEntityNotFound(_0x259abf,null))[_0xb636('0x25')](function(_0x43700f){if(_0x43700f){_0x3c160b=_0x43700f;_0x30af74[_0xb636('0x38')]=_['keys'](db[_0xb636('0x61')][_0xb636('0x2f')]);_0x30af74[_0xb636('0x31')]=_[_0xb636('0x32')](_0x20c9fa['query']);_0x30af74[_0xb636('0x33')]=_[_0xb636('0x34')](_0x30af74['model'],_0x30af74[_0xb636('0x31')]);_0x589ce9['attributes']=_[_0xb636('0x34')](_0x30af74['model'],qs[_0xb636('0x35')](_0x20c9fa['query']['fields']));_0x589ce9[_0xb636('0x36')]=_0x589ce9[_0xb636('0x36')][_0xb636('0x37')]?_0x589ce9[_0xb636('0x36')]:_0x30af74['model'];_0x589ce9[_0xb636('0x3b')]=qs[_0xb636('0x3c')](_0x20c9fa[_0xb636('0x31')][_0xb636('0x3c')]);_0x589ce9[_0xb636('0x3d')]=qs[_0xb636('0x33')](_['pick'](_0x20c9fa[_0xb636('0x31')],_0x30af74[_0xb636('0x33')]));if(_0x20c9fa[_0xb636('0x31')][_0xb636('0x3f')]){_0x589ce9[_0xb636('0x3d')]=_[_0xb636('0x40')](_0x589ce9[_0xb636('0x3d')],{'$or':_[_0xb636('0x2d')](_0x589ce9[_0xb636('0x36')],function(_0x3e2d70){var _0x5da6fc={};_0x5da6fc[_0x3e2d70]={'$like':'%'+_0x20c9fa[_0xb636('0x31')][_0xb636('0x3f')]+'%'};return _0x5da6fc;})});}_0x589ce9=_[_0xb636('0x40')]({},_0x589ce9,_0x20c9fa[_0xb636('0x42')]);return _0x3c160b[_0xb636('0x6e')](_0x589ce9);}})[_0xb636('0x25')](function(_0x71015c){if(_0x71015c){_0x4e777d=_0x71015c['length'];if(!_0x20c9fa[_0xb636('0x31')][_0xb636('0x39')](_0xb636('0x3a'))){_0x589ce9[_0xb636('0x1f')]=qs[_0xb636('0x1f')](_0x20c9fa[_0xb636('0x31')]['limit']);_0x589ce9[_0xb636('0x1c')]=qs[_0xb636('0x1c')](_0x20c9fa['query'][_0xb636('0x1c')]);}return _0x3c160b[_0xb636('0x6e')](_0x589ce9);}})[_0xb636('0x25')](function(_0x101fd5){if(_0x101fd5){return _0x101fd5?{'count':_0x4e777d,'rows':_0x101fd5}:null;}})[_0xb636('0x25')](respondWithResult(_0x259abf,null))[_0xb636('0x43')](handleError(_0x259abf,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 03dcf92..ff55b16 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x476a=['request-promise','path','../../config/environment','exports','define','VoiceMusicOnHold','voice_musiconhold','../../config/logger','api','moment','bluebird'];(function(_0x31aff8,_0x3a8ed6){var _0xecff93=function(_0x241774){while(--_0x241774){_0x31aff8['push'](_0x31aff8['shift']());}};_0xecff93(++_0x3a8ed6);}(_0x476a,0x1a9));var _0xa476=function(_0xdc1af4,_0x4ed6f1){_0xdc1af4=_0xdc1af4-0x0;var _0x231abb=_0x476a[_0xdc1af4];return _0x231abb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa476('0x0'))(_0xa476('0x1'));var moment=require(_0xa476('0x2'));var BPromise=require(_0xa476('0x3'));var rp=require(_0xa476('0x4'));var fs=require('fs');var path=require(_0xa476('0x5'));var rimraf=require('rimraf');var config=require(_0xa476('0x6'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xa476('0x7')]=function(_0x528d53,_0x1917be){return _0x528d53[_0xa476('0x8')](_0xa476('0x9'),attributes,{'tableName':_0xa476('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x19ad=['VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define'];(function(_0x4d37cd,_0x319860){var _0x40f388=function(_0x4e2db6){while(--_0x4e2db6){_0x4d37cd['push'](_0x4d37cd['shift']());}};_0x40f388(++_0x319860);}(_0x19ad,0x1b5));var _0xd19a=function(_0x5c0b22,_0x56d46a){_0x5c0b22=_0x5c0b22-0x0;var _0x16a8a6=_0x19ad[_0x5c0b22];return _0x16a8a6;};'use strict';var _=require(_0xd19a('0x0'));var util=require(_0xd19a('0x1'));var logger=require(_0xd19a('0x2'))(_0xd19a('0x3'));var moment=require(_0xd19a('0x4'));var BPromise=require(_0xd19a('0x5'));var rp=require(_0xd19a('0x6'));var fs=require('fs');var path=require(_0xd19a('0x7'));var rimraf=require(_0xd19a('0x8'));var config=require(_0xd19a('0x9'));var attributes=require(_0xd19a('0xa'));module[_0xd19a('0xb')]=function(_0x4d67c7,_0x6c7bb){return _0x4d67c7[_0xd19a('0xc')](_0xd19a('0xd'),attributes,{'tableName':_0xd19a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index b847415..b82b31c 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x28412d,_0x282ffe){var _0x37a355=function(_0x574321){while(--_0x574321){_0x28412d['push'](_0x28412d['shift']());}};_0x37a355(++_0x282ffe);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xcb91[_0x13ce0c];return _0x4388fb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3ef12a,_0x37e502){var _0x59833a=function(_0x57a36a){while(--_0x57a36a){_0x3ef12a['push'](_0x3ef12a['shift']());}};_0x59833a(++_0x37e502);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 3af37d2..dcf5c56 100644 --- a/server/api/voicePrefix/index.js +++ b/server/api/voicePrefix/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10eb=['create','post','addTeams','put','/:id','update','delete','destroy','removeTeams','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','show','/:id/users','getAgents','/:id/teams','getTeams'];(function(_0x265b44,_0x4e9620){var _0x5b1a17=function(_0x32f6c3){while(--_0x32f6c3){_0x265b44['push'](_0x265b44['shift']());}};_0x5b1a17(++_0x4e9620);}(_0x10eb,0x71));var _0xb10e=function(_0x2ed651,_0x5c75af){_0x2ed651=_0x2ed651-0x0;var _0x5780ae=_0x10eb[_0x2ed651];return _0x5780ae;};'use strict';var multer=require(_0xb10e('0x0'));var util=require('util');var path=require(_0xb10e('0x1'));var timeout=require(_0xb10e('0x2'));var express=require(_0xb10e('0x3'));var router=express[_0xb10e('0x4')]();var fs_extra=require(_0xb10e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb10e('0x6'));var config=require(_0xb10e('0x7'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0xb10e('0x8')](),controller[_0xb10e('0x9')]);router[_0xb10e('0xa')](_0xb10e('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb10e('0xc')]);router[_0xb10e('0xa')](_0xb10e('0xd'),auth[_0xb10e('0x8')](),controller[_0xb10e('0xe')]);router[_0xb10e('0xa')](_0xb10e('0xf'),auth[_0xb10e('0x8')](),controller[_0xb10e('0x10')]);router['post']('/',auth[_0xb10e('0x8')](),controller[_0xb10e('0x11')]);router[_0xb10e('0x12')]('/:id/users',auth[_0xb10e('0x8')](),controller['addAgents']);router[_0xb10e('0x12')](_0xb10e('0xf'),auth[_0xb10e('0x8')](),controller[_0xb10e('0x13')]);router[_0xb10e('0x14')](_0xb10e('0x15'),auth[_0xb10e('0x8')](),controller[_0xb10e('0x16')]);router[_0xb10e('0x17')]('/:id',auth[_0xb10e('0x8')](),controller[_0xb10e('0x18')]);router[_0xb10e('0x17')](_0xb10e('0xd'),auth[_0xb10e('0x8')](),controller['removeAgents']);router[_0xb10e('0x17')](_0xb10e('0xf'),auth[_0xb10e('0x8')](),controller[_0xb10e('0x19')]);module['exports']=router; \ No newline at end of file +var _0xae4a=['create','addAgents','addTeams','put','/:id','update','destroy','delete','removeAgents','removeTeams','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','show','/:id/users','getAgents','/:id/teams','getTeams','post'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xae4a,0x68));var _0xaae4=function(_0x4ec50f,_0x5f1373){_0x4ec50f=_0x4ec50f-0x0;var _0x35fe9c=_0xae4a[_0x4ec50f];return _0x35fe9c;};'use strict';var multer=require(_0xaae4('0x0'));var util=require(_0xaae4('0x1'));var path=require('path');var timeout=require(_0xaae4('0x2'));var express=require(_0xaae4('0x3'));var router=express['Router']();var fs_extra=require(_0xaae4('0x4'));var auth=require(_0xaae4('0x5'));var interaction=require(_0xaae4('0x6'));var config=require(_0xaae4('0x7'));var controller=require(_0xaae4('0x8'));router[_0xaae4('0x9')]('/',auth[_0xaae4('0xa')](),controller[_0xaae4('0xb')]);router[_0xaae4('0x9')](_0xaae4('0xc'),auth[_0xaae4('0xa')](),controller[_0xaae4('0xd')]);router[_0xaae4('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xaae4('0xe')]);router[_0xaae4('0x9')](_0xaae4('0xf'),auth[_0xaae4('0xa')](),controller[_0xaae4('0x10')]);router[_0xaae4('0x9')](_0xaae4('0x11'),auth[_0xaae4('0xa')](),controller[_0xaae4('0x12')]);router[_0xaae4('0x13')]('/',auth[_0xaae4('0xa')](),controller[_0xaae4('0x14')]);router[_0xaae4('0x13')](_0xaae4('0xf'),auth[_0xaae4('0xa')](),controller[_0xaae4('0x15')]);router[_0xaae4('0x13')](_0xaae4('0x11'),auth['isAuthenticated'](),controller[_0xaae4('0x16')]);router[_0xaae4('0x17')](_0xaae4('0x18'),auth[_0xaae4('0xa')](),controller[_0xaae4('0x19')]);router['delete'](_0xaae4('0x18'),auth['isAuthenticated'](),controller[_0xaae4('0x1a')]);router[_0xaae4('0x1b')](_0xaae4('0xf'),auth[_0xaae4('0xa')](),controller[_0xaae4('0x1c')]);router[_0xaae4('0x1b')]('/:id/teams',auth[_0xaae4('0xa')](),controller[_0xaae4('0x1d')]);module[_0xaae4('0x1e')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 4c93132..fb7bdcd 100644 --- a/server/api/voicePrefix/voicePrefix.attributes.js +++ b/server/api/voicePrefix/voicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3168=['exports','STRING','name','VIRTUAL','system-','getDataValue','INTEGER','sequelize'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x3168,0xe7));var _0x8316=function(_0x3be641,_0x396724){_0x3be641=_0x3be641-0x0;var _0x2d9e5d=_0x3168[_0x3be641];return _0x2d9e5d;};'use strict';var Sequelize=require(_0x8316('0x0'));module[_0x8316('0x1')]={'name':{'type':Sequelize[_0x8316('0x2')],'allowNull':![],'unique':_0x8316('0x3')},'prefix':{'type':Sequelize[_0x8316('0x4')],'get':function(_0xd6f36a){return _0x8316('0x5')+this[_0x8316('0x6')](_0x8316('0x3'))+'-';}},'description':{'type':Sequelize[_0x8316('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x8316('0x7')]}}; \ No newline at end of file +var _0xf583=['system-','getDataValue','INTEGER','exports','STRING','name','VIRTUAL'];(function(_0x1e1f97,_0x2f6925){var _0x1e45fb=function(_0x2389ac){while(--_0x2389ac){_0x1e1f97['push'](_0x1e1f97['shift']());}};_0x1e45fb(++_0x2f6925);}(_0xf583,0xab));var _0x3f58=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0xf583[_0x35007a];return _0x574f68;};'use strict';var Sequelize=require('sequelize');module[_0x3f58('0x0')]={'name':{'type':Sequelize[_0x3f58('0x1')],'allowNull':![],'unique':_0x3f58('0x2')},'prefix':{'type':Sequelize[_0x3f58('0x3')],'get':function(_0x93ca77){return _0x3f58('0x4')+this[_0x3f58('0x5')](_0x3f58('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x3f58('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index d5ec562..f2c66ca 100644 --- a/server/api/voicePrefix/voicePrefix.controller.js +++ b/server/api/voicePrefix/voicePrefix.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3de3=['jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./voicePrefix.socket','register','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','update','then','VoicePrefixes','UserProfileResource','destroy','end','error','stack','name','send','index','map','VoicePrefix','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','rawAttributes','intersection','find','params','describe','create','transaction','body','get','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','Set','callerIdAll','No\x20callerid\x20available','push','goto','${EXTEN:','charAt','system-','findById','ids','omit','spread','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','emit','getAgents','findOne','User','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','removeTeams','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto'];(function(_0x831c75,_0x4032ee){var _0x36c0d6=function(_0x4d9703){while(--_0x4d9703){_0x831c75['push'](_0x831c75['shift']());}};_0x36c0d6(++_0x4032ee);}(_0x3de3,0x1ce));var _0x33de=function(_0x49915b,_0x3e2d08){_0x49915b=_0x49915b-0x0;var _0x368a7f=_0x3de3[_0x49915b];return _0x368a7f;};'use strict';var emlformat=require(_0x33de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x33de('0x1'));var jsonpatch=require(_0x33de('0x2'));var rp=require('request-promise');var moment=require(_0x33de('0x3'));var BPromise=require(_0x33de('0x4'));var Mustache=require(_0x33de('0x5'));var util=require(_0x33de('0x6'));var path=require('path');var sox=require(_0x33de('0x7'));var csv=require(_0x33de('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x33de('0x9'));var _=require('lodash');var squel=require(_0x33de('0xa'));var crypto=require(_0x33de('0xb'));var jsforce=require(_0x33de('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x33de('0x8'));var querystring=require(_0x33de('0xd'));var Papa=require(_0x33de('0xe'));var Redis=require('ioredis');var authService=require(_0x33de('0xf'));var qs=require(_0x33de('0x10'));var as=require(_0x33de('0x11'));var hardwareService=require(_0x33de('0x12'));var logger=require(_0x33de('0x13'))(_0x33de('0x14'));var utils=require(_0x33de('0x15'));var config=require(_0x33de('0x16'));var licenseUtil=require(_0x33de('0x17'));var db=require(_0x33de('0x18'))['db'];config[_0x33de('0x19')]=_['defaults'](config[_0x33de('0x19')],{'host':_0x33de('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x33de('0x1b'))[_0x33de('0x1c')](socket);function respondWithStatusCode(_0x2b3748,_0x57a2a1){_0x57a2a1=_0x57a2a1||0xcc;return function(_0x57aa73){if(_0x57aa73){return _0x2b3748[_0x33de('0x1d')](_0x57a2a1);}return _0x2b3748[_0x33de('0x1e')](_0x57a2a1)['end']();};}function respondWithResult(_0x4ff69f,_0x185849){_0x185849=_0x185849||0xc8;return function(_0x16c050){if(_0x16c050){return _0x4ff69f[_0x33de('0x1e')](_0x185849)['json'](_0x16c050);}};}function respondWithFilteredResult(_0x2db887,_0x1203cf){return function(_0x52cfa0){if(_0x52cfa0){var _0x2815a7=typeof _0x1203cf[_0x33de('0x1f')]==='undefined'&&typeof _0x1203cf['limit']===_0x33de('0x20');var _0x52d718=_0x52cfa0[_0x33de('0x21')];var _0x2f0529=_0x2815a7?0x0:_0x1203cf[_0x33de('0x1f')];var _0x315c9b=_0x2815a7?_0x52cfa0[_0x33de('0x21')]:_0x1203cf[_0x33de('0x1f')]+_0x1203cf[_0x33de('0x22')];var _0x493263;if(_0x315c9b>=_0x52d718){_0x315c9b=_0x52d718;_0x493263=0xc8;}else{_0x493263=0xce;}_0x2db887['status'](_0x493263);return _0x2db887[_0x33de('0x23')]('Content-Range',_0x2f0529+'-'+_0x315c9b+'/'+_0x52d718)[_0x33de('0x24')](_0x52cfa0);}return null;};}function patchUpdates(_0x4cd8db){return function(_0x28ed17){try{jsonpatch[_0x33de('0x25')](_0x28ed17,_0x4cd8db,!![]);}catch(_0x575e88){return BPromise[_0x33de('0x26')](_0x575e88);}return _0x28ed17['save']();};}function saveUpdates(_0x67d040,_0x5c602d){return function(_0x62743b){if(_0x62743b){return _0x62743b[_0x33de('0x27')](_0x67d040)[_0x33de('0x28')](function(_0x5b79d7){return _0x5b79d7;});}return null;};}function removeEntity(_0x3bdba4,_0x2d206b){return function(_0x140979){if(_0x140979){return _0x140979['destroy']()[_0x33de('0x28')](function(){var _0x5585a2=_0x140979['get']({'plain':!![]});var _0x1c8de9=_0x33de('0x29');return db[_0x33de('0x2a')][_0x33de('0x2b')]({'where':{'type':_0x1c8de9,'resourceId':_0x5585a2['id']}})[_0x33de('0x28')](function(){return _0x140979;});})[_0x33de('0x28')](function(){_0x3bdba4[_0x33de('0x1e')](0xcc)[_0x33de('0x2c')]();});}};}function handleEntityNotFound(_0x59bc3b,_0x5ae0e8){return function(_0x2755e6){if(!_0x2755e6){_0x59bc3b[_0x33de('0x1d')](0x194);}return _0x2755e6;};}function handleError(_0xaeaec5,_0x451ff5){_0x451ff5=_0x451ff5||0x1f4;return function(_0x167cec){logger[_0x33de('0x2d')](_0x167cec[_0x33de('0x2e')]);if(_0x167cec['name']){delete _0x167cec[_0x33de('0x2f')];}_0xaeaec5[_0x33de('0x1e')](_0x451ff5)[_0x33de('0x30')](_0x167cec);};}exports[_0x33de('0x31')]=function(_0x49e857,_0xe5dc68){var _0xf5d78a={},_0x5a9c43={},_0x5d2da4={'count':0x0,'rows':[]};var _0x57fcf3=_[_0x33de('0x32')](db[_0x33de('0x33')]['rawAttributes'],function(_0x1d0194){return{'name':_0x1d0194['fieldName'],'type':_0x1d0194['type'][_0x33de('0x34')]};});_0x5a9c43[_0x33de('0x35')]=_[_0x33de('0x32')](_0x57fcf3,_0x33de('0x2f'));_0x5a9c43[_0x33de('0x36')]=_[_0x33de('0x37')](_0x49e857[_0x33de('0x36')]);_0x5a9c43[_0x33de('0x38')]=_['intersection'](_0x5a9c43[_0x33de('0x35')],_0x5a9c43['query']);_0xf5d78a[_0x33de('0x39')]=_['intersection'](_0x5a9c43['model'],qs[_0x33de('0x3a')](_0x49e857[_0x33de('0x36')][_0x33de('0x3a')]));_0xf5d78a[_0x33de('0x39')]=_0xf5d78a[_0x33de('0x39')][_0x33de('0x3b')]?_0xf5d78a['attributes']:_0x5a9c43[_0x33de('0x35')];if(!_0x49e857[_0x33de('0x36')][_0x33de('0x3c')](_0x33de('0x3d'))){_0xf5d78a[_0x33de('0x22')]=qs[_0x33de('0x22')](_0x49e857[_0x33de('0x36')]['limit']);_0xf5d78a[_0x33de('0x1f')]=qs[_0x33de('0x1f')](_0x49e857[_0x33de('0x36')][_0x33de('0x1f')]);}_0xf5d78a[_0x33de('0x3e')]=qs[_0x33de('0x3f')](_0x49e857[_0x33de('0x36')]['sort']);_0xf5d78a[_0x33de('0x40')]=qs[_0x33de('0x38')](_[_0x33de('0x41')](_0x49e857[_0x33de('0x36')],_0x5a9c43[_0x33de('0x38')]),_0x57fcf3);if(_0x49e857[_0x33de('0x36')]['filter']){_0xf5d78a[_0x33de('0x40')]=_['merge'](_0xf5d78a[_0x33de('0x40')],{'$or':_[_0x33de('0x32')](_0x57fcf3,function(_0x4da2a5){if(_0x4da2a5[_0x33de('0x42')]!==_0x33de('0x43')){var _0x15918c={};_0x15918c[_0x4da2a5[_0x33de('0x2f')]]={'$like':'%'+_0x49e857[_0x33de('0x36')][_0x33de('0x44')]+'%'};return _0x15918c;}})});}_0xf5d78a=_[_0x33de('0x45')]({},_0xf5d78a,_0x49e857[_0x33de('0x46')]);var _0x48e0fc={'where':_0xf5d78a['where']};return db['VoicePrefix'][_0x33de('0x21')](_0x48e0fc)[_0x33de('0x28')](function(_0x20d04f){_0x5d2da4[_0x33de('0x21')]=_0x20d04f;if(_0x49e857['query'][_0x33de('0x47')]){_0xf5d78a['include']=[{'all':!![]}];}return db['VoicePrefix'][_0x33de('0x48')](_0xf5d78a);})[_0x33de('0x28')](function(_0x384b12){_0x5d2da4[_0x33de('0x49')]=_0x384b12;return _0x5d2da4;})[_0x33de('0x28')](respondWithFilteredResult(_0xe5dc68,_0xf5d78a))[_0x33de('0x4a')](handleError(_0xe5dc68,null));};exports[_0x33de('0x4b')]=function(_0x49b067,_0x3b5530){var _0x5de38b={'raw':![],'where':{'id':_0x49b067['params']['id']}},_0x2fbca6={};_0x2fbca6[_0x33de('0x35')]=_[_0x33de('0x37')](db['VoicePrefix'][_0x33de('0x4c')]);_0x2fbca6[_0x33de('0x36')]=_[_0x33de('0x37')](_0x49b067['query']);_0x2fbca6['filters']=_[_0x33de('0x4d')](_0x2fbca6[_0x33de('0x35')],_0x2fbca6['query']);_0x5de38b['attributes']=_[_0x33de('0x4d')](_0x2fbca6['model'],qs['fields'](_0x49b067['query'][_0x33de('0x3a')]));_0x5de38b[_0x33de('0x39')]=_0x5de38b[_0x33de('0x39')][_0x33de('0x3b')]?_0x5de38b['attributes']:_0x2fbca6['model'];if(_0x49b067[_0x33de('0x36')][_0x33de('0x47')]){_0x5de38b['include']=[{'all':!![]}];}_0x5de38b=_[_0x33de('0x45')]({},_0x5de38b,_0x49b067[_0x33de('0x46')]);return db[_0x33de('0x33')][_0x33de('0x4e')](_0x5de38b)[_0x33de('0x28')](handleEntityNotFound(_0x3b5530,null))['then'](respondWithResult(_0x3b5530,null))[_0x33de('0x4a')](handleError(_0x3b5530,null));};exports[_0x33de('0x2b')]=function(_0x4fe3a2,_0x302573){return db[_0x33de('0x33')][_0x33de('0x4e')]({'where':{'id':_0x4fe3a2[_0x33de('0x4f')]['id']}})[_0x33de('0x28')](handleEntityNotFound(_0x302573,null))[_0x33de('0x28')](removeEntity(_0x302573,null))[_0x33de('0x4a')](handleError(_0x302573,null));};exports[_0x33de('0x50')]=function(_0x24e428,_0x1b4397){return db['VoicePrefix'][_0x33de('0x50')]()[_0x33de('0x28')](respondWithResult(_0x1b4397,null))[_0x33de('0x4a')](handleError(_0x1b4397,null));};exports[_0x33de('0x51')]=function(_0xe6d59,_0x3fe65d){var _0x5c91e7;return db['sequelize'][_0x33de('0x52')](function(_0x32042e){return db[_0x33de('0x33')]['create'](_0xe6d59[_0x33de('0x53')],{'transaction':_0x32042e})[_0x33de('0x28')](function(_0x379224){_0x5c91e7=_0x379224[_0x33de('0x54')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x5c91e7[_0x33de('0x55')]},'raw':!![]})[_0x33de('0x28')](function(_0x232da5){return createVoicePrefixExtensions(_0x5c91e7,_0x232da5,_0x32042e);});});})[_0x33de('0x28')](function(){var _0x379784=_0xe6d59['user']['get']({'plain':!![]});if(!_0x379784)throw new Error(_0x33de('0x56'));if(_0x379784[_0x33de('0x57')]===_0x33de('0x58')){var _0x7112db=_0x5c91e7;return db[_0x33de('0x59')][_0x33de('0x4e')]({'where':{'name':_0x33de('0x29'),'userProfileId':_0x379784[_0x33de('0x5a')]},'raw':!![]})[_0x33de('0x28')](function(_0x5de12f){if(_0x5de12f&&_0x5de12f[_0x33de('0x5b')]===0x0){return db[_0x33de('0x2a')][_0x33de('0x51')]({'name':_0x7112db['name'],'resourceId':_0x7112db['id'],'type':_0x5de12f[_0x33de('0x2f')],'sectionId':_0x5de12f['id']},{})['then'](function(){return _0x5c91e7;});}else{return _0x5c91e7;}})['catch'](function(_0x4dae6d){logger['error'](_0x33de('0x5c'),_0x4dae6d);throw _0x4dae6d;});}return _0x5c91e7;})[_0x33de('0x28')](respondWithResult(_0x3fe65d,null))['catch'](handleError(_0x3fe65d,null));};function Extension(_0x397179,_0x232840,_0x56542f,_0x42c8b9){this[_0x33de('0x5d')]='from-sip';this[_0x33de('0x5e')]=_0x397179;this[_0x33de('0x5f')]=_0x56542f;this[_0x33de('0x42')]=_0x33de('0x60');this[_0x33de('0x61')]=_0x33de('0x62');this[_0x33de('0x63')]=_0x232840;this['appdata']=_0x42c8b9;}function createVoicePrefixExtensions(_0x533863,_0x409e2e,_0x49516d){return new BPromise(function(_0x2af340,_0x3eef03){var _0x4ca20f=new Extension(formatPrefixName(_0x533863[_0x33de('0x64')]),0x1,'NoOp',_0x33de('0x65'));_0x4ca20f[_0x33de('0x66')]=_0x533863['id'];return db['VoiceExtension']['create'](_0x4ca20f,{'transaction':_0x49516d})[_0x33de('0x28')](function(_0x1b2d6f){var _0x17845c=_0x1b2d6f[_0x33de('0x54')]({'plain':!![]});var _0x24d936=_['map'](addVoicePrefixExtensions(_0x533863,_0x409e2e),function(_0x221038){_0x221038[_0x33de('0x55')]=_0x17845c['id'];_0x221038['VoicePrefixId']=_0x533863['id'];return _0x221038;});return db[_0x33de('0x67')][_0x33de('0x68')](_0x24d936,{'transaction':_0x49516d})['then'](function(_0x151551){if(!_0x151551){return _0x3eef03(_0x33de('0x69'));}else{return _0x2af340(_0x151551);}})['catch'](function(_0x4aa203){return _0x3eef03(_0x4aa203);});});;});};function addVoicePrefixExtensions(_0xc2504a,_0x55d7ef){var _0x31a511=[];var _0x4803b8=formatPrefixName(_0xc2504a[_0x33de('0x64')]);_0x31a511['push'](new Extension(_0x4803b8,0x2,'Set','CDR(prefix)='+_0xc2504a['name']));if(_0xc2504a['callerIdAll']){_0x31a511['push'](new Extension(_0x4803b8,0x3,_0x33de('0x6a'),'PREFIX-CALLERIDALL='+_0xc2504a[_0x33de('0x6b')]));}else{_0x31a511['push'](new Extension(_0x4803b8,0x3,'NoOp',_0x33de('0x6c')));}_0x31a511[_0x33de('0x6d')](new Extension(_0x4803b8,0x4,_0x33de('0x6e'),_0x55d7ef[_0x33de('0x5d')]+','+_0x33de('0x6f')+(0x8+_0xc2504a[_0x33de('0x2f')][_0x33de('0x3b')])+'}'+','+0x1));return _0x31a511;}function formatPrefixName(_0x659652){var _0x4893d2='_';for(var _0x297a84=0x0;_0x297a84<_0x659652['length'];_0x297a84++){if(_0x659652[_0x33de('0x70')](_0x297a84)=='-'){_0x4893d2+=_0x659652[_0x33de('0x70')](_0x297a84);}else{_0x4893d2+='['+_0x659652[_0x33de('0x70')](_0x297a84)+']';}}_0x4893d2+='.';return _0x4893d2;}exports[_0x33de('0x27')]=function(_0x8a9729,_0x3f5d52,_0x2a6004){var _0x355b7d=_0x8a9729[_0x33de('0x53')];_0x355b7d[_0x33de('0x64')]=_0x33de('0x71')+_0x355b7d['name']+'-';return db['sequelize'][_0x33de('0x52')](function(_0x1179f6){return db[_0x33de('0x33')][_0x33de('0x27')](_0x355b7d,{'where':{'id':_0x355b7d['id']},'transaction':_0x1179f6})[_0x33de('0x28')](function(){return db[_0x33de('0x67')][_0x33de('0x2b')]({'where':{'VoicePrefixId':_0x355b7d['id']},'transaction':_0x1179f6})[_0x33de('0x28')](function(){return db[_0x33de('0x67')][_0x33de('0x4e')]({'where':{'id':_0x355b7d['VoiceExtensionId']},'raw':!![]})[_0x33de('0x28')](function(_0x43eb19){return createVoicePrefixExtensions(_0x355b7d,_0x43eb19,_0x1179f6);});});});})[_0x33de('0x28')](function(){return db[_0x33de('0x33')][_0x33de('0x72')](_0x355b7d['id']);})[_0x33de('0x28')](respondWithResult(_0x3f5d52,null))['catch'](handleError(_0x3f5d52,null));};exports['addAgents']=function(_0x558c26,_0x1370ac,_0x2d2b02){return db[_0x33de('0x33')][_0x33de('0x4e')]({'where':{'id':_0x558c26['params']['id']}})[_0x33de('0x28')](handleEntityNotFound(_0x1370ac,null))[_0x33de('0x28')](function(_0x484827){if(_0x484827){return _0x484827['addAgents'](_0x558c26['body'][_0x33de('0x73')],_[_0x33de('0x74')](_0x558c26[_0x33de('0x53')],[_0x33de('0x73'),'id'])||{})[_0x33de('0x75')](function(_0x545555){for(var _0x2e6389=0x0;_0x2e6389<_0x558c26['body'][_0x33de('0x73')][_0x33de('0x3b')];_0x2e6389+=0x1){socket['emit'](_0x33de('0x76'),{'UserId':Number(_0x558c26[_0x33de('0x53')]['ids'][_0x2e6389]),'VoicePrefixId':Number(_0x558c26[_0x33de('0x4f')]['id'])});}return _0x545555;});}})['then'](respondWithResult(_0x1370ac,null))['catch'](handleError(_0x1370ac,null));};exports[_0x33de('0x77')]=function(_0x2ef94d,_0x3fbbaf,_0x46e3d6){return db[_0x33de('0x33')]['find']({'where':{'id':_0x2ef94d[_0x33de('0x4f')]['id']}})[_0x33de('0x28')](handleEntityNotFound(_0x3fbbaf,null))[_0x33de('0x28')](function(_0x1e0637){if(_0x1e0637){return _0x1e0637['removeAgents'](_0x2ef94d[_0x33de('0x36')][_0x33de('0x73')])[_0x33de('0x28')](function(){if(_['isArray'](_0x2ef94d['query']['ids'])){for(var _0x586c51=0x0;_0x586c51<_0x2ef94d['query'][_0x33de('0x73')][_0x33de('0x3b')];_0x586c51+=0x1){socket['emit'](_0x33de('0x78'),{'UserId':Number(_0x2ef94d['query']['ids'][_0x586c51]),'VoicePrefixId':Number(_0x2ef94d[_0x33de('0x4f')]['id'])});}}else{socket[_0x33de('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x2ef94d[_0x33de('0x36')][_0x33de('0x73')]),'VoicePrefixId':Number(_0x2ef94d['params']['id'])});}});}})[_0x33de('0x28')](respondWithStatusCode(_0x3fbbaf,null))['catch'](handleError(_0x3fbbaf,null));};exports[_0x33de('0x7a')]=function(_0x1d060d,_0x487dac,_0x30d749){var _0x2cd94f={};var _0x53ec24={};var _0x4fa42c;var _0x130bbd;return db[_0x33de('0x33')][_0x33de('0x7b')]({'where':{'id':_0x1d060d[_0x33de('0x4f')]['id']}})[_0x33de('0x28')](handleEntityNotFound(_0x487dac,null))[_0x33de('0x28')](function(_0x4ef18b){if(_0x4ef18b){_0x4fa42c=_0x4ef18b;_0x53ec24[_0x33de('0x35')]=_[_0x33de('0x37')](db[_0x33de('0x7c')][_0x33de('0x4c')]);_0x53ec24[_0x33de('0x36')]=_[_0x33de('0x37')](_0x1d060d[_0x33de('0x36')]);_0x53ec24[_0x33de('0x38')]=_[_0x33de('0x4d')](_0x53ec24[_0x33de('0x35')],_0x53ec24[_0x33de('0x36')]);_0x2cd94f[_0x33de('0x39')]=_[_0x33de('0x4d')](_0x53ec24[_0x33de('0x35')],qs[_0x33de('0x3a')](_0x1d060d[_0x33de('0x36')]['fields']));_0x2cd94f[_0x33de('0x39')]=_0x2cd94f[_0x33de('0x39')][_0x33de('0x3b')]?_0x2cd94f[_0x33de('0x39')]:_0x53ec24[_0x33de('0x35')];_0x2cd94f['order']=qs[_0x33de('0x3f')](_0x1d060d[_0x33de('0x36')][_0x33de('0x3f')]);_0x2cd94f[_0x33de('0x40')]=qs[_0x33de('0x38')](_[_0x33de('0x41')](_0x1d060d[_0x33de('0x36')],_0x53ec24[_0x33de('0x38')]));if(_0x1d060d[_0x33de('0x36')][_0x33de('0x44')]){_0x2cd94f['where']=_['merge'](_0x2cd94f[_0x33de('0x40')],{'$or':_[_0x33de('0x32')](_0x2cd94f[_0x33de('0x39')],function(_0xa0b337){var _0x5b8928={};_0x5b8928[_0xa0b337]={'$like':'%'+_0x1d060d[_0x33de('0x36')][_0x33de('0x44')]+'%'};return _0x5b8928;})});}_0x2cd94f=_[_0x33de('0x45')]({},_0x2cd94f,_0x1d060d['options']);return _0x4fa42c['getAgents'](_0x2cd94f);}})[_0x33de('0x28')](function(_0xe6b940){if(_0xe6b940){_0x130bbd=_0xe6b940[_0x33de('0x3b')];if(!_0x1d060d['query'][_0x33de('0x3c')](_0x33de('0x3d'))){_0x2cd94f[_0x33de('0x22')]=qs['limit'](_0x1d060d[_0x33de('0x36')][_0x33de('0x22')]);_0x2cd94f['offset']=qs[_0x33de('0x1f')](_0x1d060d['query'][_0x33de('0x1f')]);}return _0x4fa42c[_0x33de('0x7a')](_0x2cd94f);}})['then'](function(_0x42546c){if(_0x42546c){return _0x42546c?{'count':_0x130bbd,'rows':_0x42546c}:null;}})[_0x33de('0x28')](respondWithResult(_0x487dac,null))[_0x33de('0x4a')](handleError(_0x487dac,null));};exports['getTeams']=function(_0x52b4e2,_0x48a039,_0xfb0042){var _0x5f46d7={};var _0x5817e3={};var _0x3df0d3;var _0xebf05f;return db[_0x33de('0x33')][_0x33de('0x7b')]({'where':{'id':_0x52b4e2['params']['id']}})[_0x33de('0x28')](handleEntityNotFound(_0x48a039,null))[_0x33de('0x28')](function(_0x27072a){if(_0x27072a){_0x3df0d3=_0x27072a;_0x5817e3['model']=_[_0x33de('0x37')](db[_0x33de('0x7d')][_0x33de('0x4c')]);_0x5817e3[_0x33de('0x36')]=_[_0x33de('0x37')](_0x52b4e2[_0x33de('0x36')]);_0x5817e3[_0x33de('0x38')]=_[_0x33de('0x4d')](_0x5817e3[_0x33de('0x35')],_0x5817e3[_0x33de('0x36')]);_0x5f46d7[_0x33de('0x39')]=_[_0x33de('0x4d')](_0x5817e3[_0x33de('0x35')],qs[_0x33de('0x3a')](_0x52b4e2[_0x33de('0x36')][_0x33de('0x3a')]));_0x5f46d7[_0x33de('0x39')]=_0x5f46d7[_0x33de('0x39')][_0x33de('0x3b')]?_0x5f46d7['attributes']:_0x5817e3[_0x33de('0x35')];_0x5f46d7[_0x33de('0x3e')]=qs[_0x33de('0x3f')](_0x52b4e2[_0x33de('0x36')][_0x33de('0x3f')]);_0x5f46d7['where']=qs[_0x33de('0x38')](_[_0x33de('0x41')](_0x52b4e2[_0x33de('0x36')],_0x5817e3[_0x33de('0x38')]));if(_0x52b4e2[_0x33de('0x36')][_0x33de('0x44')]){_0x5f46d7[_0x33de('0x40')]=_[_0x33de('0x45')](_0x5f46d7[_0x33de('0x40')],{'$or':_[_0x33de('0x32')](_0x5f46d7['attributes'],function(_0x3af223){var _0x258238={};_0x258238[_0x3af223]={'$like':'%'+_0x52b4e2['query'][_0x33de('0x44')]+'%'};return _0x258238;})});}_0x5f46d7=_[_0x33de('0x45')]({},_0x5f46d7,_0x52b4e2['options']);return _0x3df0d3['getTeams'](_0x5f46d7);}})['then'](function(_0x1f1bd4){if(_0x1f1bd4){_0xebf05f=_0x1f1bd4['length'];if(!_0x52b4e2[_0x33de('0x36')][_0x33de('0x3c')]('nolimit')){_0x5f46d7[_0x33de('0x22')]=qs['limit'](_0x52b4e2[_0x33de('0x36')][_0x33de('0x22')]);_0x5f46d7[_0x33de('0x1f')]=qs[_0x33de('0x1f')](_0x52b4e2[_0x33de('0x36')]['offset']);}return _0x3df0d3[_0x33de('0x7e')](_0x5f46d7);}})[_0x33de('0x28')](function(_0x24dcfe){if(_0x24dcfe){return _0x24dcfe?{'count':_0xebf05f,'rows':_0x24dcfe}:null;}})['then'](respondWithResult(_0x48a039,null))[_0x33de('0x4a')](handleError(_0x48a039,null));};exports[_0x33de('0x7f')]=function(_0x24af54,_0x2baee6,_0x56fadb){var _0x5ce00e=_0x24af54[_0x33de('0x53')][_0x33de('0x73')];var _0x2127ab;return db[_0x33de('0x7d')][_0x33de('0x48')]({'where':{'id':_0x5ce00e},'attributes':['id'],'include':[{'model':db[_0x33de('0x7c')],'as':_0x33de('0x80'),'attributes':['id',_0x33de('0x2f'),_0x33de('0x81'),_0x33de('0x82'),_0x33de('0x83')],'raw':!![]}]})[_0x33de('0x28')](function(_0x371e4d){if(_0x371e4d){_0x2127ab=_0x371e4d;var _0x17d367=_[_0x33de('0x84')](_0x371e4d,function(_0x21a70f){var _0x5e11f1=_0x21a70f[_0x33de('0x54')]({'plain':!![]});return _0x5e11f1[_0x33de('0x80')];});return db[_0x33de('0x33')][_0x33de('0x4e')]({'where':{'id':_0x24af54[_0x33de('0x4f')]['id']}})[_0x33de('0x28')](function(_0x5120f5){return db[_0x33de('0x85')][_0x33de('0x52')](function(_0x51b000){return _0x5120f5[_0x33de('0x7f')](_0x5ce00e,{'transaction':_0x51b000})[_0x33de('0x28')](function(){return BPromise[_0x33de('0x86')](_0x2127ab,function(_0x131d87){return db[_0x33de('0x87')][_0x33de('0x88')]({'TeamId':_0x131d87['id'],'VoicePrefixId':_0x24af54[_0x33de('0x4f')]['id']},{'transaction':_0x51b000});});})['then'](function(){return BPromise['each'](_0x17d367,function(_0x446257){return db[_0x33de('0x89')]['findOrCreate']({'where':{'UserId':_0x446257['id'],'VoicePrefixId':_0x24af54[_0x33de('0x4f')]['id']},'transaction':_0x51b000});});})[_0x33de('0x28')](function(){_0x17d367[_0x33de('0x8a')](function(_0xf06806){socket[_0x33de('0x79')]('userVoicePrefix:save',{'UserId':_0xf06806['id'],'VoicePrefixId':_0x5120f5['id']});});});});});}})[_0x33de('0x28')](respondWithStatusCode(_0x2baee6,null))[_0x33de('0x4a')](handleError(_0x2baee6,null));};exports[_0x33de('0x8b')]=function(_0x1f5872,_0x38d880,_0x40758b){return db[_0x33de('0x7d')][_0x33de('0x48')]({'where':{'id':_0x1f5872[_0x33de('0x36')][_0x33de('0x73')]},'attributes':['id'],'include':[{'model':db[_0x33de('0x7c')],'as':_0x33de('0x80'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x38d880,null))[_0x33de('0x28')](function(_0xd41b76){var _0x24fa73=_['map'](_0xd41b76,'id');var _0x93313d=[];var _0x3c854d=[];var _0x3e00b7=squel['select']();_0x3e00b7['field'](_0x33de('0x8c'))['from'](_0x33de('0x8d'),'tq')[_0x33de('0x8e')](_0x33de('0x8f'),'ut',_0x33de('0x90'))[_0x33de('0x40')](_0x33de('0x91'),_0x1f5872[_0x33de('0x4f')]['id']);for(var _0x23b8e9=0x0;_0x23b8e9<_0xd41b76[_0x33de('0x3b')];_0x23b8e9+=0x1){let _0x64836b=_0xd41b76[_0x23b8e9];for(var _0x72b745=0x0;_0x72b745<_0x64836b[_0x33de('0x80')]['length'];_0x72b745+=0x1){let _0x4eacef=_0x64836b[_0x33de('0x80')][_0x72b745];var _0x13cd17=_0x3e00b7[_0x33de('0x92')]();_0x13cd17[_0x33de('0x40')]('ut.UserId\x20=\x20?',_0x4eacef['id']);_0x3c854d[_0x33de('0x6d')](db['sequelize']['query'](_0x13cd17[_0x33de('0x93')](),{'type':db[_0x33de('0x85')][_0x33de('0x94')][_0x33de('0x95')]})[_0x33de('0x28')](function(_0x251b71){if(_0x251b71['length']===0x1){return _0x4eacef['id'];}else{var _0x341b23=_[_0x33de('0x96')](_[_0x33de('0x32')](_0x251b71,_0x33de('0x97')),function(_0x29eda7){return _[_0x33de('0x98')](_0x24fa73,_0x29eda7);});if(_0x341b23){return _0x4eacef['id'];}}}));}}return BPromise[_0x33de('0x99')](_0x3c854d)['then'](function(_0x572532){_0x93313d=_(_0x93313d)[_0x33de('0x9a')](_0x572532)[_0x33de('0x9b')]()[_0x33de('0x9c')]();return db[_0x33de('0x33')]['find']({'where':{'id':_0x1f5872[_0x33de('0x4f')]['id']}})[_0x33de('0x28')](function(_0x24edf8){return db['sequelize'][_0x33de('0x52')](function(_0x1ad90f){return _0x24edf8['removeTeams'](_0x1f5872['query'][_0x33de('0x73')],{'transaction':_0x1ad90f})[_0x33de('0x28')](function(){if(!_[_0x33de('0x9d')](_0x93313d)){return _0x24edf8['removeAgents'](_0x93313d,{'transaction':_0x1ad90f});}})[_0x33de('0x28')](function(){_0x93313d[_0x33de('0x8a')](function(_0x4d56df){socket[_0x33de('0x79')](_0x33de('0x78'),{'UserId':_0x4d56df,'VoicePrefixId':_0x24edf8['id']});});});});});});})['then'](respondWithStatusCode(_0x38d880,null))['catch'](handleError(_0x38d880,null));}; \ No newline at end of file +var _0x8f59=['../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','includeAll','find','describe','create','sequelize','transaction','body','VoiceExtensionId','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','priority','appdata','VoicePrefixId','VoiceExtension','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','params','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','pick','Team','getTeams','Agents','online','voicePause','interface','flatMap','addTeams','each','TeamVoicePrefix','upsert','findOrCreate','forEach','removeTeams','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','compact','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service'];(function(_0x14de57,_0x320a64){var _0x338dd6=function(_0x42b4f6){while(--_0x42b4f6){_0x14de57['push'](_0x14de57['shift']());}};_0x338dd6(++_0x320a64);}(_0x8f59,0x11d));var _0x98f5=function(_0x4ab7a5,_0x35eb99){_0x4ab7a5=_0x4ab7a5-0x0;var _0x5f5013=_0x8f59[_0x4ab7a5];return _0x5f5013;};'use strict';var emlformat=require(_0x98f5('0x0'));var rimraf=require(_0x98f5('0x1'));var zipdir=require(_0x98f5('0x2'));var jsonpatch=require(_0x98f5('0x3'));var rp=require(_0x98f5('0x4'));var moment=require(_0x98f5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x98f5('0x6'));var util=require(_0x98f5('0x7'));var path=require(_0x98f5('0x8'));var sox=require(_0x98f5('0x9'));var csv=require('to-csv');var ejs=require(_0x98f5('0xa'));var fs=require('fs');var fs_extra=require(_0x98f5('0xb'));var _=require(_0x98f5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x98f5('0xd'));var deskjs=require(_0x98f5('0xe'));var toCsv=require(_0x98f5('0xf'));var querystring=require('querystring');var Papa=require(_0x98f5('0x10'));var Redis=require(_0x98f5('0x11'));var authService=require(_0x98f5('0x12'));var qs=require(_0x98f5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98f5('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x98f5('0x15'));var config=require(_0x98f5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x98f5('0x17'))['db'];config[_0x98f5('0x18')]=_[_0x98f5('0x19')](config[_0x98f5('0x18')],{'host':_0x98f5('0x1a'),'port':0x18eb});var socket=require(_0x98f5('0x1b'))(new Redis(config['redis']));require(_0x98f5('0x1c'))[_0x98f5('0x1d')](socket);function respondWithStatusCode(_0x5b8bab,_0x9df84){_0x9df84=_0x9df84||0xcc;return function(_0x3d6b5c){if(_0x3d6b5c){return _0x5b8bab[_0x98f5('0x1e')](_0x9df84);}return _0x5b8bab['status'](_0x9df84)[_0x98f5('0x1f')]();};}function respondWithResult(_0xc7a49b,_0x113545){_0x113545=_0x113545||0xc8;return function(_0x5bb486){if(_0x5bb486){return _0xc7a49b[_0x98f5('0x20')](_0x113545)[_0x98f5('0x21')](_0x5bb486);}};}function respondWithFilteredResult(_0x574644,_0x1df52d){return function(_0x51a567){if(_0x51a567){var _0x10c57c=typeof _0x1df52d[_0x98f5('0x22')]===_0x98f5('0x23')&&typeof _0x1df52d[_0x98f5('0x24')]===_0x98f5('0x23');var _0xa4477c=_0x51a567['count'];var _0xf88f34=_0x10c57c?0x0:_0x1df52d['offset'];var _0xd1209d=_0x10c57c?_0x51a567[_0x98f5('0x25')]:_0x1df52d['offset']+_0x1df52d[_0x98f5('0x24')];var _0x2933d1;if(_0xd1209d>=_0xa4477c){_0xd1209d=_0xa4477c;_0x2933d1=0xc8;}else{_0x2933d1=0xce;}_0x574644[_0x98f5('0x20')](_0x2933d1);return _0x574644[_0x98f5('0x26')](_0x98f5('0x27'),_0xf88f34+'-'+_0xd1209d+'/'+_0xa4477c)[_0x98f5('0x21')](_0x51a567);}return null;};}function patchUpdates(_0x38b46d){return function(_0x5ac2b7){try{jsonpatch[_0x98f5('0x28')](_0x5ac2b7,_0x38b46d,!![]);}catch(_0x49ee4e){return BPromise[_0x98f5('0x29')](_0x49ee4e);}return _0x5ac2b7['save']();};}function saveUpdates(_0x44bfbb,_0x40c69b){return function(_0x106b24){if(_0x106b24){return _0x106b24[_0x98f5('0x2a')](_0x44bfbb)[_0x98f5('0x2b')](function(_0x18052d){return _0x18052d;});}return null;};}function removeEntity(_0x46dbd4,_0x58d506){return function(_0x27a533){if(_0x27a533){return _0x27a533[_0x98f5('0x2c')]()['then'](function(){var _0x1a1c55=_0x27a533[_0x98f5('0x2d')]({'plain':!![]});var _0x5b08c2=_0x98f5('0x2e');return db[_0x98f5('0x2f')][_0x98f5('0x2c')]({'where':{'type':_0x5b08c2,'resourceId':_0x1a1c55['id']}})[_0x98f5('0x2b')](function(){return _0x27a533;});})[_0x98f5('0x2b')](function(){_0x46dbd4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x428c85,_0x71661e){return function(_0x18bb29){if(!_0x18bb29){_0x428c85[_0x98f5('0x1e')](0x194);}return _0x18bb29;};}function handleError(_0x15bf92,_0x1ae531){_0x1ae531=_0x1ae531||0x1f4;return function(_0x5e9d73){logger[_0x98f5('0x30')](_0x5e9d73[_0x98f5('0x31')]);if(_0x5e9d73[_0x98f5('0x32')]){delete _0x5e9d73[_0x98f5('0x32')];}_0x15bf92[_0x98f5('0x20')](_0x1ae531)[_0x98f5('0x33')](_0x5e9d73);};}exports['index']=function(_0x1e7027,_0x4d4b5c){var _0x229495={},_0x1e193c={},_0x492771={'count':0x0,'rows':[]};var _0x45ca95=_[_0x98f5('0x34')](db[_0x98f5('0x35')][_0x98f5('0x36')],function(_0x45e55c){return{'name':_0x45e55c[_0x98f5('0x37')],'type':_0x45e55c[_0x98f5('0x38')][_0x98f5('0x39')]};});_0x1e193c[_0x98f5('0x3a')]=_[_0x98f5('0x34')](_0x45ca95,_0x98f5('0x32'));_0x1e193c[_0x98f5('0x3b')]=_[_0x98f5('0x3c')](_0x1e7027[_0x98f5('0x3b')]);_0x1e193c[_0x98f5('0x3d')]=_[_0x98f5('0x3e')](_0x1e193c[_0x98f5('0x3a')],_0x1e193c[_0x98f5('0x3b')]);_0x229495[_0x98f5('0x3f')]=_[_0x98f5('0x3e')](_0x1e193c['model'],qs[_0x98f5('0x40')](_0x1e7027['query']['fields']));_0x229495[_0x98f5('0x3f')]=_0x229495[_0x98f5('0x3f')][_0x98f5('0x41')]?_0x229495[_0x98f5('0x3f')]:_0x1e193c['model'];if(!_0x1e7027[_0x98f5('0x3b')][_0x98f5('0x42')](_0x98f5('0x43'))){_0x229495['limit']=qs[_0x98f5('0x24')](_0x1e7027[_0x98f5('0x3b')]['limit']);_0x229495[_0x98f5('0x22')]=qs[_0x98f5('0x22')](_0x1e7027[_0x98f5('0x3b')]['offset']);}_0x229495[_0x98f5('0x44')]=qs[_0x98f5('0x45')](_0x1e7027[_0x98f5('0x3b')][_0x98f5('0x45')]);_0x229495[_0x98f5('0x46')]=qs['filters'](_['pick'](_0x1e7027[_0x98f5('0x3b')],_0x1e193c[_0x98f5('0x3d')]),_0x45ca95);if(_0x1e7027[_0x98f5('0x3b')][_0x98f5('0x47')]){_0x229495[_0x98f5('0x46')]=_[_0x98f5('0x48')](_0x229495['where'],{'$or':_['map'](_0x45ca95,function(_0x3f6394){if(_0x3f6394[_0x98f5('0x38')]!==_0x98f5('0x49')){var _0x2f9638={};_0x2f9638[_0x3f6394['name']]={'$like':'%'+_0x1e7027['query'][_0x98f5('0x47')]+'%'};return _0x2f9638;}})});}_0x229495=_[_0x98f5('0x48')]({},_0x229495,_0x1e7027[_0x98f5('0x4a')]);var _0x110aa7={'where':_0x229495['where']};return db['VoicePrefix'][_0x98f5('0x25')](_0x110aa7)[_0x98f5('0x2b')](function(_0x372c33){_0x492771['count']=_0x372c33;if(_0x1e7027[_0x98f5('0x3b')]['includeAll']){_0x229495[_0x98f5('0x4b')]=[{'all':!![]}];}return db['VoicePrefix'][_0x98f5('0x4c')](_0x229495);})[_0x98f5('0x2b')](function(_0x1b8d40){_0x492771['rows']=_0x1b8d40;return _0x492771;})[_0x98f5('0x2b')](respondWithFilteredResult(_0x4d4b5c,_0x229495))[_0x98f5('0x4d')](handleError(_0x4d4b5c,null));};exports['show']=function(_0x3b5dee,_0xd27e7c){var _0x5ed787={'raw':![],'where':{'id':_0x3b5dee['params']['id']}},_0x42ec3e={};_0x42ec3e[_0x98f5('0x3a')]=_[_0x98f5('0x3c')](db['VoicePrefix']['rawAttributes']);_0x42ec3e['query']=_['keys'](_0x3b5dee[_0x98f5('0x3b')]);_0x42ec3e['filters']=_[_0x98f5('0x3e')](_0x42ec3e[_0x98f5('0x3a')],_0x42ec3e[_0x98f5('0x3b')]);_0x5ed787[_0x98f5('0x3f')]=_[_0x98f5('0x3e')](_0x42ec3e[_0x98f5('0x3a')],qs['fields'](_0x3b5dee[_0x98f5('0x3b')][_0x98f5('0x40')]));_0x5ed787[_0x98f5('0x3f')]=_0x5ed787[_0x98f5('0x3f')][_0x98f5('0x41')]?_0x5ed787[_0x98f5('0x3f')]:_0x42ec3e['model'];if(_0x3b5dee[_0x98f5('0x3b')][_0x98f5('0x4e')]){_0x5ed787[_0x98f5('0x4b')]=[{'all':!![]}];}_0x5ed787=_[_0x98f5('0x48')]({},_0x5ed787,_0x3b5dee['options']);return db[_0x98f5('0x35')][_0x98f5('0x4f')](_0x5ed787)[_0x98f5('0x2b')](handleEntityNotFound(_0xd27e7c,null))[_0x98f5('0x2b')](respondWithResult(_0xd27e7c,null))[_0x98f5('0x4d')](handleError(_0xd27e7c,null));};exports['destroy']=function(_0x8d7ebd,_0x254005){return db['VoicePrefix'][_0x98f5('0x4f')]({'where':{'id':_0x8d7ebd['params']['id']}})[_0x98f5('0x2b')](handleEntityNotFound(_0x254005,null))['then'](removeEntity(_0x254005,null))[_0x98f5('0x4d')](handleError(_0x254005,null));};exports[_0x98f5('0x50')]=function(_0x3114a4,_0x5b495e){return db[_0x98f5('0x35')][_0x98f5('0x50')]()[_0x98f5('0x2b')](respondWithResult(_0x5b495e,null))[_0x98f5('0x4d')](handleError(_0x5b495e,null));};exports[_0x98f5('0x51')]=function(_0xf39073,_0x37e620){var _0x1891ac;return db[_0x98f5('0x52')][_0x98f5('0x53')](function(_0x50343c){return db[_0x98f5('0x35')][_0x98f5('0x51')](_0xf39073[_0x98f5('0x54')],{'transaction':_0x50343c})[_0x98f5('0x2b')](function(_0x1289a7){_0x1891ac=_0x1289a7[_0x98f5('0x2d')]({'plain':!![]});return db['VoiceExtension'][_0x98f5('0x4f')]({'where':{'id':_0x1891ac[_0x98f5('0x55')]},'raw':!![]})[_0x98f5('0x2b')](function(_0x4663f2){return createVoicePrefixExtensions(_0x1891ac,_0x4663f2,_0x50343c);});});})[_0x98f5('0x2b')](function(){var _0x15c514=_0xf39073['user']['get']({'plain':!![]});if(!_0x15c514)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15c514[_0x98f5('0x56')]===_0x98f5('0x57')){var _0x372c49=_0x1891ac;return db[_0x98f5('0x58')]['find']({'where':{'name':_0x98f5('0x2e'),'userProfileId':_0x15c514['userProfileId']},'raw':!![]})[_0x98f5('0x2b')](function(_0x583be6){if(_0x583be6&&_0x583be6['autoAssociation']===0x0){return db[_0x98f5('0x2f')][_0x98f5('0x51')]({'name':_0x372c49[_0x98f5('0x32')],'resourceId':_0x372c49['id'],'type':_0x583be6['name'],'sectionId':_0x583be6['id']},{})['then'](function(){return _0x1891ac;});}else{return _0x1891ac;}})[_0x98f5('0x4d')](function(_0x139ca3){logger['error'](_0x98f5('0x59'),_0x139ca3);throw _0x139ca3;});}return _0x1891ac;})[_0x98f5('0x2b')](respondWithResult(_0x37e620,null))['catch'](handleError(_0x37e620,null));};function Extension(_0x400f32,_0x974509,_0x8e6975,_0x53249f){this[_0x98f5('0x5a')]=_0x98f5('0x5b');this[_0x98f5('0x5c')]=_0x400f32;this[_0x98f5('0x5d')]=_0x8e6975;this[_0x98f5('0x38')]=_0x98f5('0x5e');this[_0x98f5('0x5f')]='Voice\x20Prefix\x20Extension';this[_0x98f5('0x60')]=_0x974509;this[_0x98f5('0x61')]=_0x53249f;}function createVoicePrefixExtensions(_0x3f2da8,_0x58041d,_0x577552){return new BPromise(function(_0x43b8de,_0x43edfc){var _0x5ae48c=new Extension(formatPrefixName(_0x3f2da8['prefix']),0x1,'NoOp','Voice\x20Prefix');_0x5ae48c[_0x98f5('0x62')]=_0x3f2da8['id'];return db['VoiceExtension'][_0x98f5('0x51')](_0x5ae48c,{'transaction':_0x577552})[_0x98f5('0x2b')](function(_0x44149f){var _0x368567=_0x44149f[_0x98f5('0x2d')]({'plain':!![]});var _0x26cc86=_[_0x98f5('0x34')](addVoicePrefixExtensions(_0x3f2da8,_0x58041d),function(_0x9758e8){_0x9758e8['VoiceExtensionId']=_0x368567['id'];_0x9758e8['VoicePrefixId']=_0x3f2da8['id'];return _0x9758e8;});return db[_0x98f5('0x63')]['bulkCreate'](_0x26cc86,{'transaction':_0x577552})[_0x98f5('0x2b')](function(_0x4ae63d){if(!_0x4ae63d){return _0x43edfc(_0x98f5('0x64'));}else{return _0x43b8de(_0x4ae63d);}})['catch'](function(_0x1cd03f){return _0x43edfc(_0x1cd03f);});});;});};function addVoicePrefixExtensions(_0x56b308,_0x4a1de1){var _0x595aee=[];var _0x2d9cd8=formatPrefixName(_0x56b308['prefix']);_0x595aee[_0x98f5('0x65')](new Extension(_0x2d9cd8,0x2,_0x98f5('0x66'),_0x98f5('0x67')+_0x56b308['name']));if(_0x56b308['callerIdAll']){_0x595aee['push'](new Extension(_0x2d9cd8,0x3,_0x98f5('0x66'),_0x98f5('0x68')+_0x56b308['callerIdAll']));}else{_0x595aee['push'](new Extension(_0x2d9cd8,0x3,_0x98f5('0x69'),_0x98f5('0x6a')));}_0x595aee[_0x98f5('0x65')](new Extension(_0x2d9cd8,0x4,_0x98f5('0x6b'),_0x4a1de1[_0x98f5('0x5a')]+','+_0x98f5('0x6c')+(0x8+_0x56b308[_0x98f5('0x32')][_0x98f5('0x41')])+'}'+','+0x1));return _0x595aee;}function formatPrefixName(_0x139d2c){var _0x4fc5d6='_';for(var _0x35e965=0x0;_0x35e965<_0x139d2c[_0x98f5('0x41')];_0x35e965++){if(_0x139d2c[_0x98f5('0x6d')](_0x35e965)=='-'){_0x4fc5d6+=_0x139d2c[_0x98f5('0x6d')](_0x35e965);}else{_0x4fc5d6+='['+_0x139d2c['charAt'](_0x35e965)+']';}}_0x4fc5d6+='.';return _0x4fc5d6;}exports[_0x98f5('0x2a')]=function(_0x48b175,_0x42c7a6,_0x5760b3){var _0x1d54d8=_0x48b175[_0x98f5('0x54')];_0x1d54d8['prefix']=_0x98f5('0x6e')+_0x1d54d8[_0x98f5('0x32')]+'-';return db[_0x98f5('0x52')]['transaction'](function(_0x45413e){return db[_0x98f5('0x35')][_0x98f5('0x2a')](_0x1d54d8,{'where':{'id':_0x1d54d8['id']},'transaction':_0x45413e})[_0x98f5('0x2b')](function(){return db[_0x98f5('0x63')][_0x98f5('0x2c')]({'where':{'VoicePrefixId':_0x1d54d8['id']},'transaction':_0x45413e})[_0x98f5('0x2b')](function(){return db[_0x98f5('0x63')][_0x98f5('0x4f')]({'where':{'id':_0x1d54d8['VoiceExtensionId']},'raw':!![]})[_0x98f5('0x2b')](function(_0x486ff6){return createVoicePrefixExtensions(_0x1d54d8,_0x486ff6,_0x45413e);});});});})[_0x98f5('0x2b')](function(){return db[_0x98f5('0x35')][_0x98f5('0x6f')](_0x1d54d8['id']);})[_0x98f5('0x2b')](respondWithResult(_0x42c7a6,null))['catch'](handleError(_0x42c7a6,null));};exports[_0x98f5('0x70')]=function(_0x23bf5f,_0x57b9c1,_0x540c00){return db['VoicePrefix'][_0x98f5('0x4f')]({'where':{'id':_0x23bf5f[_0x98f5('0x71')]['id']}})[_0x98f5('0x2b')](handleEntityNotFound(_0x57b9c1,null))[_0x98f5('0x2b')](function(_0x5427a3){if(_0x5427a3){return _0x5427a3['addAgents'](_0x23bf5f[_0x98f5('0x54')][_0x98f5('0x72')],_['omit'](_0x23bf5f[_0x98f5('0x54')],[_0x98f5('0x72'),'id'])||{})[_0x98f5('0x73')](function(_0x28aa43){for(var _0x258ee7=0x0;_0x258ee7<_0x23bf5f[_0x98f5('0x54')][_0x98f5('0x72')][_0x98f5('0x41')];_0x258ee7+=0x1){socket[_0x98f5('0x74')](_0x98f5('0x75'),{'UserId':Number(_0x23bf5f[_0x98f5('0x54')]['ids'][_0x258ee7]),'VoicePrefixId':Number(_0x23bf5f['params']['id'])});}return _0x28aa43;});}})[_0x98f5('0x2b')](respondWithResult(_0x57b9c1,null))[_0x98f5('0x4d')](handleError(_0x57b9c1,null));};exports[_0x98f5('0x76')]=function(_0x54c7f9,_0x28d910,_0x3303d4){return db['VoicePrefix'][_0x98f5('0x4f')]({'where':{'id':_0x54c7f9[_0x98f5('0x71')]['id']}})['then'](handleEntityNotFound(_0x28d910,null))['then'](function(_0x4dfef7){if(_0x4dfef7){return _0x4dfef7['removeAgents'](_0x54c7f9[_0x98f5('0x3b')][_0x98f5('0x72')])['then'](function(){if(_[_0x98f5('0x77')](_0x54c7f9[_0x98f5('0x3b')]['ids'])){for(var _0x2afe1d=0x0;_0x2afe1d<_0x54c7f9['query']['ids'][_0x98f5('0x41')];_0x2afe1d+=0x1){socket[_0x98f5('0x74')](_0x98f5('0x78'),{'UserId':Number(_0x54c7f9[_0x98f5('0x3b')]['ids'][_0x2afe1d]),'VoicePrefixId':Number(_0x54c7f9[_0x98f5('0x71')]['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x54c7f9['query'][_0x98f5('0x72')]),'VoicePrefixId':Number(_0x54c7f9[_0x98f5('0x71')]['id'])});}});}})[_0x98f5('0x2b')](respondWithStatusCode(_0x28d910,null))[_0x98f5('0x4d')](handleError(_0x28d910,null));};exports[_0x98f5('0x79')]=function(_0x3ab0dc,_0x36048c,_0x11e72a){var _0x1a3a76={};var _0x2aa9a4={};var _0x485a15;var _0x40b6fa;return db[_0x98f5('0x35')][_0x98f5('0x7a')]({'where':{'id':_0x3ab0dc[_0x98f5('0x71')]['id']}})['then'](handleEntityNotFound(_0x36048c,null))[_0x98f5('0x2b')](function(_0x1aba52){if(_0x1aba52){_0x485a15=_0x1aba52;_0x2aa9a4['model']=_[_0x98f5('0x3c')](db[_0x98f5('0x7b')][_0x98f5('0x36')]);_0x2aa9a4['query']=_[_0x98f5('0x3c')](_0x3ab0dc[_0x98f5('0x3b')]);_0x2aa9a4[_0x98f5('0x3d')]=_[_0x98f5('0x3e')](_0x2aa9a4[_0x98f5('0x3a')],_0x2aa9a4[_0x98f5('0x3b')]);_0x1a3a76['attributes']=_['intersection'](_0x2aa9a4[_0x98f5('0x3a')],qs[_0x98f5('0x40')](_0x3ab0dc[_0x98f5('0x3b')][_0x98f5('0x40')]));_0x1a3a76['attributes']=_0x1a3a76[_0x98f5('0x3f')][_0x98f5('0x41')]?_0x1a3a76['attributes']:_0x2aa9a4['model'];_0x1a3a76[_0x98f5('0x44')]=qs['sort'](_0x3ab0dc[_0x98f5('0x3b')][_0x98f5('0x45')]);_0x1a3a76[_0x98f5('0x46')]=qs['filters'](_[_0x98f5('0x7c')](_0x3ab0dc[_0x98f5('0x3b')],_0x2aa9a4['filters']));if(_0x3ab0dc[_0x98f5('0x3b')][_0x98f5('0x47')]){_0x1a3a76[_0x98f5('0x46')]=_[_0x98f5('0x48')](_0x1a3a76['where'],{'$or':_['map'](_0x1a3a76[_0x98f5('0x3f')],function(_0x1e32f1){var _0x514dea={};_0x514dea[_0x1e32f1]={'$like':'%'+_0x3ab0dc[_0x98f5('0x3b')][_0x98f5('0x47')]+'%'};return _0x514dea;})});}_0x1a3a76=_[_0x98f5('0x48')]({},_0x1a3a76,_0x3ab0dc['options']);return _0x485a15[_0x98f5('0x79')](_0x1a3a76);}})[_0x98f5('0x2b')](function(_0x2de7e7){if(_0x2de7e7){_0x40b6fa=_0x2de7e7[_0x98f5('0x41')];if(!_0x3ab0dc['query'][_0x98f5('0x42')]('nolimit')){_0x1a3a76[_0x98f5('0x24')]=qs[_0x98f5('0x24')](_0x3ab0dc['query'][_0x98f5('0x24')]);_0x1a3a76[_0x98f5('0x22')]=qs[_0x98f5('0x22')](_0x3ab0dc[_0x98f5('0x3b')]['offset']);}return _0x485a15[_0x98f5('0x79')](_0x1a3a76);}})['then'](function(_0x6c3951){if(_0x6c3951){return _0x6c3951?{'count':_0x40b6fa,'rows':_0x6c3951}:null;}})['then'](respondWithResult(_0x36048c,null))[_0x98f5('0x4d')](handleError(_0x36048c,null));};exports['getTeams']=function(_0x1ba9a2,_0x193cbb,_0x3a411f){var _0x1a04f6={};var _0x40eb2f={};var _0x421e3c;var _0x1e28b7;return db[_0x98f5('0x35')][_0x98f5('0x7a')]({'where':{'id':_0x1ba9a2[_0x98f5('0x71')]['id']}})[_0x98f5('0x2b')](handleEntityNotFound(_0x193cbb,null))[_0x98f5('0x2b')](function(_0x5bec4f){if(_0x5bec4f){_0x421e3c=_0x5bec4f;_0x40eb2f['model']=_[_0x98f5('0x3c')](db[_0x98f5('0x7d')]['rawAttributes']);_0x40eb2f[_0x98f5('0x3b')]=_[_0x98f5('0x3c')](_0x1ba9a2[_0x98f5('0x3b')]);_0x40eb2f[_0x98f5('0x3d')]=_[_0x98f5('0x3e')](_0x40eb2f[_0x98f5('0x3a')],_0x40eb2f['query']);_0x1a04f6[_0x98f5('0x3f')]=_[_0x98f5('0x3e')](_0x40eb2f[_0x98f5('0x3a')],qs[_0x98f5('0x40')](_0x1ba9a2[_0x98f5('0x3b')][_0x98f5('0x40')]));_0x1a04f6['attributes']=_0x1a04f6[_0x98f5('0x3f')]['length']?_0x1a04f6[_0x98f5('0x3f')]:_0x40eb2f[_0x98f5('0x3a')];_0x1a04f6[_0x98f5('0x44')]=qs[_0x98f5('0x45')](_0x1ba9a2[_0x98f5('0x3b')][_0x98f5('0x45')]);_0x1a04f6[_0x98f5('0x46')]=qs[_0x98f5('0x3d')](_['pick'](_0x1ba9a2['query'],_0x40eb2f[_0x98f5('0x3d')]));if(_0x1ba9a2['query'][_0x98f5('0x47')]){_0x1a04f6[_0x98f5('0x46')]=_[_0x98f5('0x48')](_0x1a04f6['where'],{'$or':_['map'](_0x1a04f6['attributes'],function(_0x20cbaf){var _0x45779d={};_0x45779d[_0x20cbaf]={'$like':'%'+_0x1ba9a2[_0x98f5('0x3b')][_0x98f5('0x47')]+'%'};return _0x45779d;})});}_0x1a04f6=_[_0x98f5('0x48')]({},_0x1a04f6,_0x1ba9a2['options']);return _0x421e3c[_0x98f5('0x7e')](_0x1a04f6);}})[_0x98f5('0x2b')](function(_0x163f7e){if(_0x163f7e){_0x1e28b7=_0x163f7e[_0x98f5('0x41')];if(!_0x1ba9a2[_0x98f5('0x3b')][_0x98f5('0x42')](_0x98f5('0x43'))){_0x1a04f6[_0x98f5('0x24')]=qs[_0x98f5('0x24')](_0x1ba9a2[_0x98f5('0x3b')]['limit']);_0x1a04f6[_0x98f5('0x22')]=qs[_0x98f5('0x22')](_0x1ba9a2[_0x98f5('0x3b')][_0x98f5('0x22')]);}return _0x421e3c[_0x98f5('0x7e')](_0x1a04f6);}})['then'](function(_0x3af4fc){if(_0x3af4fc){return _0x3af4fc?{'count':_0x1e28b7,'rows':_0x3af4fc}:null;}})[_0x98f5('0x2b')](respondWithResult(_0x193cbb,null))[_0x98f5('0x4d')](handleError(_0x193cbb,null));};exports['addTeams']=function(_0x87ae6,_0x14a01b,_0x31282d){var _0x2e85ad=_0x87ae6[_0x98f5('0x54')][_0x98f5('0x72')];var _0x2a983e;return db[_0x98f5('0x7d')][_0x98f5('0x4c')]({'where':{'id':_0x2e85ad},'attributes':['id'],'include':[{'model':db['User'],'as':_0x98f5('0x7f'),'attributes':['id','name',_0x98f5('0x80'),_0x98f5('0x81'),_0x98f5('0x82')],'raw':!![]}]})[_0x98f5('0x2b')](function(_0x1f90ce){if(_0x1f90ce){_0x2a983e=_0x1f90ce;var _0x2bf55c=_[_0x98f5('0x83')](_0x1f90ce,function(_0x54eb1d){var _0x1aa66f=_0x54eb1d[_0x98f5('0x2d')]({'plain':!![]});return _0x1aa66f[_0x98f5('0x7f')];});return db['VoicePrefix'][_0x98f5('0x4f')]({'where':{'id':_0x87ae6[_0x98f5('0x71')]['id']}})[_0x98f5('0x2b')](function(_0x37a1a7){return db[_0x98f5('0x52')][_0x98f5('0x53')](function(_0x55de57){return _0x37a1a7[_0x98f5('0x84')](_0x2e85ad,{'transaction':_0x55de57})[_0x98f5('0x2b')](function(){return BPromise[_0x98f5('0x85')](_0x2a983e,function(_0x462498){return db[_0x98f5('0x86')][_0x98f5('0x87')]({'TeamId':_0x462498['id'],'VoicePrefixId':_0x87ae6[_0x98f5('0x71')]['id']},{'transaction':_0x55de57});});})[_0x98f5('0x2b')](function(){return BPromise[_0x98f5('0x85')](_0x2bf55c,function(_0x2adc96){return db['UserVoicePrefix'][_0x98f5('0x88')]({'where':{'UserId':_0x2adc96['id'],'VoicePrefixId':_0x87ae6[_0x98f5('0x71')]['id']},'transaction':_0x55de57});});})[_0x98f5('0x2b')](function(){_0x2bf55c[_0x98f5('0x89')](function(_0x4c06c3){socket[_0x98f5('0x74')](_0x98f5('0x75'),{'UserId':_0x4c06c3['id'],'VoicePrefixId':_0x37a1a7['id']});});});});});}})[_0x98f5('0x2b')](respondWithStatusCode(_0x14a01b,null))['catch'](handleError(_0x14a01b,null));};exports[_0x98f5('0x8a')]=function(_0x29f1af,_0x165c5c,_0x401ec7){return db[_0x98f5('0x7d')]['findAll']({'where':{'id':_0x29f1af['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x98f5('0x7f'),'attributes':['id'],'raw':!![]}]})[_0x98f5('0x2b')](handleEntityNotFound(_0x165c5c,null))['then'](function(_0x55edfd){var _0x339388=_[_0x98f5('0x34')](_0x55edfd,'id');var _0x1f1e6c=[];var _0x22009b=[];var _0x269fe1=squel['select']();_0x269fe1['field'](_0x98f5('0x8b'))[_0x98f5('0x8c')](_0x98f5('0x8d'),'tq')['join'](_0x98f5('0x8e'),'ut',_0x98f5('0x8f'))['where']('VoicePrefixId\x20=\x20?',_0x29f1af[_0x98f5('0x71')]['id']);for(var _0x4a8f92=0x0;_0x4a8f92<_0x55edfd['length'];_0x4a8f92+=0x1){let _0x20b788=_0x55edfd[_0x4a8f92];for(var _0x1743a8=0x0;_0x1743a8<_0x20b788[_0x98f5('0x7f')][_0x98f5('0x41')];_0x1743a8+=0x1){let _0x18bb66=_0x20b788[_0x98f5('0x7f')][_0x1743a8];var _0x1f1b89=_0x269fe1['clone']();_0x1f1b89[_0x98f5('0x46')](_0x98f5('0x90'),_0x18bb66['id']);_0x22009b[_0x98f5('0x65')](db[_0x98f5('0x52')]['query'](_0x1f1b89[_0x98f5('0x91')](),{'type':db[_0x98f5('0x52')][_0x98f5('0x92')][_0x98f5('0x93')]})[_0x98f5('0x2b')](function(_0x10d7d0){if(_0x10d7d0[_0x98f5('0x41')]===0x1){return _0x18bb66['id'];}else{var _0x4cc03e=_['every'](_[_0x98f5('0x34')](_0x10d7d0,_0x98f5('0x94')),function(_0x1068ff){return _[_0x98f5('0x95')](_0x339388,_0x1068ff);});if(_0x4cc03e){return _0x18bb66['id'];}}}));}}return BPromise['all'](_0x22009b)['then'](function(_0x2ddef8){_0x1f1e6c=_(_0x1f1e6c)['union'](_0x2ddef8)[_0x98f5('0x96')]()[_0x98f5('0x97')]();return db[_0x98f5('0x35')][_0x98f5('0x4f')]({'where':{'id':_0x29f1af[_0x98f5('0x71')]['id']}})[_0x98f5('0x2b')](function(_0x1d1949){return db['sequelize'][_0x98f5('0x53')](function(_0x2391f1){return _0x1d1949['removeTeams'](_0x29f1af[_0x98f5('0x3b')][_0x98f5('0x72')],{'transaction':_0x2391f1})[_0x98f5('0x2b')](function(){if(!_['isEmpty'](_0x1f1e6c)){return _0x1d1949['removeAgents'](_0x1f1e6c,{'transaction':_0x2391f1});}})[_0x98f5('0x2b')](function(){_0x1f1e6c[_0x98f5('0x89')](function(_0x4de795){socket['emit'](_0x98f5('0x78'),{'UserId':_0x4de795,'VoicePrefixId':_0x1d1949['id']});});});});});});})[_0x98f5('0x2b')](respondWithStatusCode(_0x165c5c,null))[_0x98f5('0x4d')](handleError(_0x165c5c,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index e00b021..da686e8 100644 --- a/server/api/voicePrefix/voicePrefix.events.js +++ b/server/api/voicePrefix/voicePrefix.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x636d=['save','remove','emit','hasOwnProperty','exports','events','VoicePrefix','setMaxListeners'];(function(_0x2c7ff5,_0x504abe){var _0x42fef4=function(_0x117eec){while(--_0x117eec){_0x2c7ff5['push'](_0x2c7ff5['shift']());}};_0x42fef4(++_0x504abe);}(_0x636d,0xad));var _0xd636=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x636d[_0xbca1b1];return _0x4e1686;};'use strict';var EventEmitter=require(_0xd636('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xd636('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xd636('0x2')](0x0);var events={'afterCreate':_0xd636('0x3'),'afterUpdate':'update','afterDestroy':_0xd636('0x4')};function emitEvent(_0x2d556d){return function(_0x5bb5e1,_0x44fc14,_0x3bac57){VoicePrefixEvents[_0xd636('0x5')](_0x2d556d+':'+_0x5bb5e1['id'],_0x5bb5e1);VoicePrefixEvents[_0xd636('0x5')](_0x2d556d,_0x5bb5e1);_0x3bac57(null);};}for(var e in events){if(events[_0xd636('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xd636('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0x2353=['remove','emit','hook','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0x2353,0xec));var _0x3235=function(_0x1f9c43,_0x24d1bc){_0x1f9c43=_0x1f9c43-0x0;var _0x2928fd=_0x2353[_0x1f9c43];return _0x2928fd;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x3235('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x3235('0x1')](0x0);var events={'afterCreate':_0x3235('0x2'),'afterUpdate':_0x3235('0x3'),'afterDestroy':_0x3235('0x4')};function emitEvent(_0x5bbd11){return function(_0x14617f,_0x26ca64,_0xeabf30){VoicePrefixEvents[_0x3235('0x5')](_0x5bbd11+':'+_0x14617f['id'],_0x14617f);VoicePrefixEvents['emit'](_0x5bbd11,_0x14617f);_0xeabf30(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x3235('0x6')](e,emitEvent(event));}}module[_0x3235('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 683f387..11f79c6 100644 --- a/server/api/voicePrefix/voicePrefix.model.js +++ b/server/api/voicePrefix/voicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1082=['lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','exports','define'];(function(_0x2a5f02,_0x19f336){var _0x584a2c=function(_0x53eb62){while(--_0x53eb62){_0x2a5f02['push'](_0x2a5f02['shift']());}};_0x584a2c(++_0x19f336);}(_0x1082,0x1ef));var _0x2108=function(_0x35f4f9,_0x4521fc){_0x35f4f9=_0x35f4f9-0x0;var _0x3d398a=_0x1082[_0x35f4f9];return _0x3d398a;};'use strict';var _=require(_0x2108('0x0'));var util=require('util');var logger=require(_0x2108('0x1'))(_0x2108('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2108('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2108('0x4'));var config=require(_0x2108('0x5'));var attributes=require(_0x2108('0x6'));module[_0x2108('0x7')]=function(_0x45683a,_0x14ce5d){return _0x45683a[_0x2108('0x8')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20e2=['util','moment','bluebird','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','lodash'];(function(_0x4b388f,_0x20e19c){var _0x4d70f7=function(_0x1ac74f){while(--_0x1ac74f){_0x4b388f['push'](_0x4b388f['shift']());}};_0x4d70f7(++_0x20e19c);}(_0x20e2,0x1c2));var _0x220e=function(_0x20af3e,_0x130a58){_0x20af3e=_0x20af3e-0x0;var _0x45fcfb=_0x20e2[_0x20af3e];return _0x45fcfb;};'use strict';var _=require(_0x220e('0x0'));var util=require(_0x220e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x220e('0x2'));var BPromise=require(_0x220e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x220e('0x4'));var rimraf=require(_0x220e('0x5'));var config=require(_0x220e('0x6'));var attributes=require(_0x220e('0x7'));module[_0x220e('0x8')]=function(_0x38d4f3,_0x10ca24){return _0x38d4f3[_0x220e('0x9')](_0x220e('0xa'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index dbf907c..fe731b3 100644 --- a/server/api/voicePrefix/voicePrefix.rpc.js +++ b/server/api/voicePrefix/voicePrefix.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b29=['code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x164925,_0x28d616){var _0x350ebe=function(_0x127f11){while(--_0x127f11){_0x164925['push'](_0x164925['shift']());}};_0x350ebe(++_0x28d616);}(_0x2b29,0x163));var _0x92b2=function(_0x3f9f4c,_0x3d1507){_0x3f9f4c=_0x3f9f4c-0x0;var _0x5a7fa4=_0x2b29[_0x3f9f4c];return _0x5a7fa4;};'use strict';var _=require('lodash');var util=require(_0x92b2('0x0'));var moment=require(_0x92b2('0x1'));var BPromise=require(_0x92b2('0x2'));var rs=require(_0x92b2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92b2('0x4'))['db'];var utils=require(_0x92b2('0x5'));var logger=require(_0x92b2('0x6'))(_0x92b2('0x7'));var config=require(_0x92b2('0x8'));var jayson=require(_0x92b2('0x9'));var client=jayson['client'][_0x92b2('0xa')]({'port':0x232a});config['redis']=_[_0x92b2('0xb')](config[_0x92b2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x92b2('0xd'))(new Redis(config[_0x92b2('0xc')]));require(_0x92b2('0xe'))[_0x92b2('0xf')](socket);function respondWithRpcPromise(_0x592c9e,_0x2b17de,_0x21bbf5){return new BPromise(function(_0x187eab,_0x1ef7f3){return client[_0x92b2('0x10')](_0x592c9e,_0x21bbf5)[_0x92b2('0x11')](function(_0xa18d4e){logger['info'](_0x92b2('0x12'),_0x2b17de,_0x92b2('0x13'));logger[_0x92b2('0x14')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x2b17de,_0x92b2('0x13'),JSON[_0x92b2('0x15')](_0xa18d4e));if(_0xa18d4e[_0x92b2('0x16')]){if(_0xa18d4e[_0x92b2('0x16')][_0x92b2('0x17')]===0x1f4){logger[_0x92b2('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x2b17de,_0xa18d4e[_0x92b2('0x16')]['message']);return _0x1ef7f3(_0xa18d4e[_0x92b2('0x16')][_0x92b2('0x18')]);}logger[_0x92b2('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x2b17de,_0xa18d4e['error'][_0x92b2('0x18')]);return _0x187eab(_0xa18d4e['error'][_0x92b2('0x18')]);}else{logger['info'](_0x92b2('0x12'),_0x2b17de,_0x92b2('0x13'));_0x187eab(_0xa18d4e[_0x92b2('0x19')][_0x92b2('0x18')]);}})[_0x92b2('0x1a')](function(_0x3dfd47){logger[_0x92b2('0x16')](_0x92b2('0x12'),_0x2b17de,_0x3dfd47);_0x1ef7f3(_0x3dfd47);});});} \ No newline at end of file +var _0x4489=['util','bluebird','randomstring','ioredis','../../mysqldb','client','redis','localhost','socket.io-emitter','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x1760c8,_0xddc3e8){var _0x3ca9e6=function(_0x590e19){while(--_0x590e19){_0x1760c8['push'](_0x1760c8['shift']());}};_0x3ca9e6(++_0xddc3e8);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9448('0x0'));var util=require(_0x9448('0x1'));var moment=require('moment');var BPromise=require(_0x9448('0x2'));var rs=require(_0x9448('0x3'));var fs=require('fs');var Redis=require(_0x9448('0x4'));var db=require(_0x9448('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9448('0x6')]['http']({'port':0x232a});config[_0x9448('0x7')]=_['defaults'](config[_0x9448('0x7')],{'host':_0x9448('0x8'),'port':0x18eb});var socket=require(_0x9448('0x9'))(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x301bf5,_0x3e272d,_0x4640c3){return new BPromise(function(_0x5d20e2,_0x20b436){return client['request'](_0x301bf5,_0x4640c3)[_0x9448('0xa')](function(_0x444830){logger[_0x9448('0xb')](_0x9448('0xc'),_0x3e272d,_0x9448('0xd'));logger[_0x9448('0xe')](_0x9448('0xf'),_0x3e272d,_0x9448('0xd'),JSON['stringify'](_0x444830));if(_0x444830[_0x9448('0x10')]){if(_0x444830['error'][_0x9448('0x11')]===0x1f4){logger[_0x9448('0x10')]('VoicePrefix,\x20%s,\x20%s',_0x3e272d,_0x444830[_0x9448('0x10')][_0x9448('0x12')]);return _0x20b436(_0x444830[_0x9448('0x10')][_0x9448('0x12')]);}logger[_0x9448('0x10')](_0x9448('0xc'),_0x3e272d,_0x444830[_0x9448('0x10')][_0x9448('0x12')]);return _0x5d20e2(_0x444830['error'][_0x9448('0x12')]);}else{logger['info'](_0x9448('0xc'),_0x3e272d,_0x9448('0xd'));_0x5d20e2(_0x444830[_0x9448('0x13')][_0x9448('0x12')]);}})[_0x9448('0x14')](function(_0x194e0e){logger[_0x9448('0x10')](_0x9448('0xc'),_0x3e272d,_0x194e0e);_0x20b436(_0x194e0e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 8e5868c..1498691 100644 --- a/server/api/voicePrefix/voicePrefix.socket.js +++ b/server/api/voicePrefix/voicePrefix.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9234=['emit','removeListener','register','length','voicePrefix:','./voicePrefix.events','remove','update'];(function(_0x449792,_0x5c6ada){var _0x19cff7=function(_0x3e2493){while(--_0x3e2493){_0x449792['push'](_0x449792['shift']());}};_0x19cff7(++_0x5c6ada);}(_0x9234,0x1bd));var _0x4923=function(_0x50e0b4,_0x1057f7){_0x50e0b4=_0x50e0b4-0x0;var _0x2fa8b0=_0x9234[_0x50e0b4];return _0x2fa8b0;};'use strict';var VoicePrefixEvents=require(_0x4923('0x0'));var events=['save',_0x4923('0x1'),_0x4923('0x2')];function createListener(_0x1f0d3a,_0x34915b){return function(_0x481178){_0x34915b[_0x4923('0x3')](_0x1f0d3a,_0x481178);};}function removeListener(_0x436ce1,_0x4bf615){return function(){VoicePrefixEvents[_0x4923('0x4')](_0x436ce1,_0x4bf615);};}exports[_0x4923('0x5')]=function(_0x526ad7){for(var _0x3c5e3f=0x0,_0x17b854=events[_0x4923('0x6')];_0x3c5e3f<_0x17b854;_0x3c5e3f++){var _0x2de396=events[_0x3c5e3f];var _0x548676=createListener(_0x4923('0x7')+_0x2de396,_0x526ad7);VoicePrefixEvents['on'](_0x2de396,_0x548676);}}; \ No newline at end of file +var _0xbdeb=['voicePrefix:','save','update','emit','register'];(function(_0x1f0400,_0x9b2e4a){var _0xb0c042=function(_0x93a0c){while(--_0x93a0c){_0x1f0400['push'](_0x1f0400['shift']());}};_0xb0c042(++_0x9b2e4a);}(_0xbdeb,0x6f));var _0xbbde=function(_0xec590e,_0x406821){_0xec590e=_0xec590e-0x0;var _0x52b041=_0xbdeb[_0xec590e];return _0x52b041;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xbbde('0x0'),'remove',_0xbbde('0x1')];function createListener(_0x51599e,_0x1279b0){return function(_0x365857){_0x1279b0[_0xbbde('0x2')](_0x51599e,_0x365857);};}function removeListener(_0x3ee0ec,_0x5362c3){return function(){VoicePrefixEvents['removeListener'](_0x3ee0ec,_0x5362c3);};}exports[_0xbbde('0x3')]=function(_0x1d4042){for(var _0x278651=0x0,_0x1a8482=events['length'];_0x278651<_0x1a8482;_0x278651++){var _0x49966c=events[_0x278651];var _0x3215c9=createListener(_0xbbde('0x4')+_0x49966c,_0x1d4042);VoicePrefixEvents['on'](_0x49966c,_0x3215c9);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index b48b6aa..249798a 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xb10b,0x12a));var _0xbb10=function(_0x28e7e1,_0x45f235){_0x28e7e1=_0x28e7e1-0x0;var _0x1d8a9e=_0xb10b[_0x28e7e1];return _0x1d8a9e;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +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(_0x34f164,_0x1d9946){var _0xaa1b7b=function(_0x4acfab){while(--_0x4acfab){_0x34f164['push'](_0x34f164['shift']());}};_0xaa1b7b(++_0x1d9946);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 5a5b77b..82faa42 100644 --- a/server/api/voiceQueue/voiceQueue.attributes.js +++ b/server/api/voiceQueue/voiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc6a=['agentBusyFactor','dropRate','FLOAT','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','rrmemory','linear','setDataValue','type','getDataValue','dialMethod','strategy','roundrobin','includes','INTEGER','yes','all','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','power','predictive','booked','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'];(function(_0x4a890a,_0x27a853){var _0x1860ba=function(_0x1babf6){while(--_0x1babf6){_0x4a890a['push'](_0x4a890a['shift']());}};_0x1860ba(++_0x27a853);}(_0xfc6a,0x1b0));var _0xafc6=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0xfc6a[_0x1f36bb];return _0xaf97fa;};'use strict';var Sequelize=require(_0xafc6('0x0'));module[_0xafc6('0x1')]={'name':{'type':Sequelize[_0xafc6('0x2')],'allowNull':![],'unique':_0xafc6('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xafc6('0x4')](_0xafc6('0x5'),_0xafc6('0x6')),'allowNull':![],'defaultValue':_0xafc6('0x5')},'musiconhold':{'type':Sequelize[_0xafc6('0x2')],'defaultValue':_0xafc6('0x7')},'announce':{'type':Sequelize[_0xafc6('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xafc6('0x8'),_0xafc6('0x9'),_0xafc6('0xa'),'random',_0xafc6('0xb'),_0xafc6('0xc'),'wrandom','rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x235850){this[_0xafc6('0xd')]('strategy',_0x235850?_0x235850:'rrmemory');},'get':function(){var _0x1b4ca2=this['getDataValue'](_0xafc6('0xe'));var _0x487ac9=this[_0xafc6('0xf')](_0xafc6('0x10'));var _0x39dce6=this['getDataValue'](_0xafc6('0x11'));if(_0x1b4ca2===_0xafc6('0x6')){if(_0x487ac9==='preview'){return null;}if(_0x487ac9==='booked'&&!['rrmemory',_0xafc6('0x12')][_0xafc6('0x13')](_0x39dce6)){this[_0xafc6('0xd')]('strategy',_0xafc6('0xb'));}}return _0x39dce6;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xafc6('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xafc6('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xafc6('0x2')]},'weight':{'type':Sequelize[_0xafc6('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xafc6('0x4')](_0xafc6('0x15'),'no'),'defaultValue':_0xafc6('0x15')},'autopause':{'type':Sequelize[_0xafc6('0x4')]('yes','no',_0xafc6('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xafc6('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xafc6('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xafc6('0x4')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xafc6('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xafc6('0x4')](_0xafc6('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xafc6('0x4')](_0xafc6('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xafc6('0x4')](_0xafc6('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xafc6('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xafc6('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xafc6('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xafc6('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xafc6('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xafc6('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xafc6('0x4')](_0xafc6('0x15'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xafc6('0x4')](_0xafc6('0x15'),'no',_0xafc6('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xafc6('0x4')](_0xafc6('0x15'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xafc6('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xafc6('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xafc6('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xafc6('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xafc6('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xafc6('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xafc6('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xafc6('0x2')]},'queue_quantity1':{'type':Sequelize[_0xafc6('0x2')]},'queue_quantity2':{'type':Sequelize[_0xafc6('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xafc6('0x2')]},'queue_less_than':{'type':Sequelize[_0xafc6('0x2')]},'periodic_announce':{'type':Sequelize[_0xafc6('0x18')],'set':function(_0x5d1350){this['setDataValue'](_0xafc6('0x19'),_0x5d1350?_0x5d1350[_0xafc6('0x1a')](','):[]);},'get':function(){return this[_0xafc6('0xf')](_0xafc6('0x19'))?this[_0xafc6('0xf')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0xafc6('0x2')],'defaultValue':_0xafc6('0x15'),'set':function(_0x32c468){this[_0xafc6('0xd')](_0xafc6('0x1b'),_0x32c468?_0x32c468[_0xafc6('0x1a')](','):undefined);},'get':function(){return this[_0xafc6('0xf')]('joinempty')?this[_0xafc6('0xf')]('joinempty')[_0xafc6('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xafc6('0x2')],'defaultValue':'no','set':function(_0x44ae51){this['setDataValue'](_0xafc6('0x1d'),_0x44ae51?_0x44ae51[_0xafc6('0x1a')](','):undefined);},'get':function(){return this[_0xafc6('0xf')](_0xafc6('0x1d'))?this[_0xafc6('0xf')](_0xafc6('0x1d'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xafc6('0x4')](_0xafc6('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xafc6('0x4')](_0xafc6('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xafc6('0x4')](_0xafc6('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xafc6('0x2')]},'description':{'type':Sequelize[_0xafc6('0x2')]},'acw':{'type':Sequelize[_0xafc6('0x1e')],'defaultValue':0x0,'set':function(_0xe5b1f8){this[_0xafc6('0xd')]('acw',_0xe5b1f8);if(_0xe5b1f8){if(this[_0xafc6('0xf')](_0xafc6('0x1f'))<0x2){this[_0xafc6('0xd')](_0xafc6('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xafc6('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xafc6('0x20')},'dialMethod':{'type':Sequelize['ENUM'](_0xafc6('0x21'),'progressive',_0xafc6('0x22'),_0xafc6('0x23'),_0xafc6('0x24')),'defaultValue':_0xafc6('0x25'),'comment':_0xafc6('0x26')},'dialLimitChannel':{'type':Sequelize[_0xafc6('0x14')](0x4)[_0xafc6('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xafc6('0x28')},'dialLimitQueue':{'type':Sequelize[_0xafc6('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xafc6('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xafc6('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0xafc6('0x4')](_0xafc6('0x2a'),_0xafc6('0x2b')),'defaultValue':_0xafc6('0x2b'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xafc6('0x2c')](0x2)[_0xafc6('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xafc6('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0xafc6('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xafc6('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xafc6('0x14')](0x3)[_0xafc6('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xafc6('0x2e')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':_0xafc6('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0xafc6('0x14')](0x3)[_0xafc6('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xafc6('0x30')},'dialQueueProject':{'type':Sequelize[_0xafc6('0x2')],'comment':_0xafc6('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0xafc6('0x14')](0x3)[_0xafc6('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xafc6('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xafc6('0x14')](0x5)[_0xafc6('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xafc6('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0xafc6('0x14')](0x3)[_0xafc6('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xafc6('0x14')](0x5)[_0xafc6('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xafc6('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xafc6('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xafc6('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xafc6('0x35')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xafc6('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xafc6('0x36')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xafc6('0x37')},'dialPrefix':{'type':Sequelize[_0xafc6('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xafc6('0x4')]('always','never','onlyIfOpen'),'defaultValue':_0xafc6('0x38')},'dialAMDActive':{'type':Sequelize[_0xafc6('0x1e')],'defaultValue':0x0,'comment':_0xafc6('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0xafc6('0x14')](0x9)[_0xafc6('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xafc6('0x3a')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xafc6('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xafc6('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xafc6('0x14')](0x9)[_0xafc6('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xafc6('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xafc6('0x14')](0x9)[_0xafc6('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xafc6('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0xafc6('0x14')](0x9)[_0xafc6('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xafc6('0x14')](0x9)[_0xafc6('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xafc6('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xafc6('0x14')](0x9)[_0xafc6('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xafc6('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xafc6('0x14')](0x5)[_0xafc6('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xafc6('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xafc6('0x14')](0x9)[_0xafc6('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xafc6('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0xafc6('0x14')](0x5)[_0xafc6('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xafc6('0x1e')],'defaultValue':0x0,'comment':_0xafc6('0x42')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xafc6('0x43'),_0xafc6('0x44')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xafc6('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xafc6('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xafc6('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xafc6('0x45')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xafc6('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xafc6('0x14')](0x3)[_0xafc6('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xafc6('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xafc6('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xafc6('0x47')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xafc6('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xafc6('0x48')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xafc6('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xafc6('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xafc6('0x14')](0x5)[_0xafc6('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xafc6('0x14')](0x3)[_0xafc6('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xafc6('0x14')](0x5)[_0xafc6('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xafc6('0x14')](0x3)[_0xafc6('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xafc6('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xafc6('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xafc6('0x14')],'allowNull':!![],'comment':_0xafc6('0x4b')},'mandatoryDisposition':{'type':Sequelize[_0xafc6('0x1e')],'defaultValue':![],'comment':_0xafc6('0x4c'),'set':function(_0x3bc662){if(!_0x3bc662)this[_0xafc6('0xd')](_0xafc6('0x4d'),null);this[_0xafc6('0xd')](_0xafc6('0x4e'),_0x3bc662);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xafc6('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xafc6('0x14')](0x3)[_0xafc6('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xafc6('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xafc6('0x1e')],'defaultValue':![]}}; \ No newline at end of file +var _0x1bf2=['Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#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','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\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','random','wrandom','setDataValue','strategy','getDataValue','type','preview','booked','rrmemory','includes','INTEGER','yes','all','once','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate'];(function(_0x452cf5,_0x17dacc){var _0x5929fa=function(_0x211d43){while(--_0x211d43){_0x452cf5['push'](_0x452cf5['shift']());}};_0x5929fa(++_0x17dacc);}(_0x1bf2,0x167));var _0x21bf=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x1bf2[_0x4d8ed9];return _0x1e2140;};'use strict';var Sequelize=require(_0x21bf('0x0'));module[_0x21bf('0x1')]={'name':{'type':Sequelize[_0x21bf('0x2')],'allowNull':![],'unique':_0x21bf('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x21bf('0x4')](_0x21bf('0x5'),_0x21bf('0x6')),'allowNull':![],'defaultValue':_0x21bf('0x5')},'musiconhold':{'type':Sequelize[_0x21bf('0x2')],'defaultValue':_0x21bf('0x7')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x21bf('0x4')]('rr',_0x21bf('0x8'),_0x21bf('0x9'),'fewestcalls',_0x21bf('0xa'),'rrmemory','linear',_0x21bf('0xb'),'rrordered'),'allowNull':![],'defaultValue':_0x21bf('0x8'),'set':function(_0x37b941){this[_0x21bf('0xc')](_0x21bf('0xd'),_0x37b941?_0x37b941:'rrmemory');},'get':function(){var _0x6e902a=this[_0x21bf('0xe')](_0x21bf('0xf'));var _0x22c51a=this[_0x21bf('0xe')]('dialMethod');var _0x4839e6=this[_0x21bf('0xe')](_0x21bf('0xd'));if(_0x6e902a===_0x21bf('0x6')){if(_0x22c51a===_0x21bf('0x10')){return null;}if(_0x22c51a===_0x21bf('0x11')&&![_0x21bf('0x12'),'roundrobin'][_0x21bf('0x13')](_0x4839e6)){this['setDataValue']('strategy',_0x21bf('0x12'));}}return _0x4839e6;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x21bf('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x21bf('0x14')](0xb)},'timeout':{'type':Sequelize[_0x21bf('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x21bf('0x2')]},'weight':{'type':Sequelize[_0x21bf('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x21bf('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x21bf('0x4')](_0x21bf('0x15'),'no'),'defaultValue':_0x21bf('0x15')},'autopause':{'type':Sequelize[_0x21bf('0x4')](_0x21bf('0x15'),'no',_0x21bf('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x21bf('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x21bf('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x21bf('0x4')](_0x21bf('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x21bf('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x21bf('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x21bf('0x4')](_0x21bf('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x21bf('0x4')](_0x21bf('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x21bf('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x21bf('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x21bf('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x21bf('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x21bf('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x21bf('0x4')](_0x21bf('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x21bf('0x4')]('yes','no'),'defaultValue':_0x21bf('0x15')},'announce_holdtime':{'type':Sequelize[_0x21bf('0x4')]('yes','no',_0x21bf('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x21bf('0x4')](_0x21bf('0x15'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x21bf('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x21bf('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x21bf('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x21bf('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x21bf('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x21bf('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x21bf('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x21bf('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x2869d6){this['setDataValue']('periodic_announce',_0x2869d6?_0x2869d6['join'](','):[]);},'get':function(){return this[_0x21bf('0xe')](_0x21bf('0x18'))?this[_0x21bf('0xe')]('periodic_announce')[_0x21bf('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0x21bf('0x2')],'defaultValue':'yes','set':function(_0x39436f){this[_0x21bf('0xc')](_0x21bf('0x1a'),_0x39436f?_0x39436f['join'](','):undefined);},'get':function(){return this['getDataValue']('joinempty')?this[_0x21bf('0xe')](_0x21bf('0x1a'))[_0x21bf('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x21bf('0x2')],'defaultValue':'no','set':function(_0x1e50d4){this[_0x21bf('0xc')]('leavewhenempty',_0x1e50d4?_0x1e50d4[_0x21bf('0x1b')](','):undefined);},'get':function(){return this[_0x21bf('0xe')](_0x21bf('0x1c'))?this[_0x21bf('0xe')](_0x21bf('0x1c'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x21bf('0x4')](_0x21bf('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x21bf('0x4')](_0x21bf('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x21bf('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x21bf('0x4')](_0x21bf('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x21bf('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x21bf('0x1d')],'defaultValue':0x0,'set':function(_0x12a3c7){this['setDataValue'](_0x21bf('0x1e'),_0x12a3c7);if(_0x12a3c7){if(this[_0x21bf('0xe')](_0x21bf('0x1f'))<0x2){this[_0x21bf('0xc')](_0x21bf('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x21bf('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x21bf('0x1d')],'defaultValue':0x0,'comment':_0x21bf('0x20')},'dialMethod':{'type':Sequelize[_0x21bf('0x4')](_0x21bf('0x10'),'progressive',_0x21bf('0x21'),'predictive',_0x21bf('0x11')),'defaultValue':'progressive','comment':_0x21bf('0x22')},'dialLimitChannel':{'type':Sequelize[_0x21bf('0x14')](0x4)[_0x21bf('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x21bf('0x24')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x21bf('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x21bf('0x25')},'dialPowerLevel':{'type':Sequelize[_0x21bf('0x26')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x21bf('0x4')](_0x21bf('0x27'),_0x21bf('0x28')),'defaultValue':_0x21bf('0x28'),'comment':_0x21bf('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x21bf('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x21bf('0x14')](0x3)[_0x21bf('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x21bf('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x21bf('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x21bf('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x21bf('0x14')](0x3)[_0x21bf('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x21bf('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x21bf('0x2')],'defaultValue':_0x21bf('0x2c'),'comment':_0x21bf('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0x21bf('0x14')](0x3)[_0x21bf('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x21bf('0x2')],'comment':_0x21bf('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x21bf('0x14')](0x3)[_0x21bf('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x21bf('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x21bf('0x14')](0x5)[_0x21bf('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x21bf('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x21bf('0x14')](0x3)[_0x21bf('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x21bf('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x21bf('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x21bf('0x14')](0x3)[_0x21bf('0x23')],'defaultValue':0x3,'comment':_0x21bf('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x21bf('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x21bf('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x21bf('0x14')](0x3)[_0x21bf('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x21bf('0x34')},'dialTimezone':{'type':Sequelize[_0x21bf('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x21bf('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x21bf('0x4')](_0x21bf('0x35'),_0x21bf('0x36'),_0x21bf('0x37')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x21bf('0x1d')],'defaultValue':0x0,'comment':_0x21bf('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x21bf('0x14')](0x9)[_0x21bf('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x21bf('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x21bf('0x14')](0x9)[_0x21bf('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x21bf('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x21bf('0x14')](0x9)[_0x21bf('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x21bf('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x21bf('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x21bf('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x21bf('0x14')](0x9)[_0x21bf('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x21bf('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x21bf('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x21bf('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x21bf('0x14')](0x9)[_0x21bf('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x21bf('0x14')](0x5)[_0x21bf('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x21bf('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x21bf('0x14')](0x9)[_0x21bf('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x21bf('0x14')](0x5)[_0x21bf('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x21bf('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x21bf('0x1d')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x21bf('0x4')](_0x21bf('0x41'),_0x21bf('0x42')),'defaultValue':_0x21bf('0x41')},'dialQueueProject2':{'type':Sequelize[_0x21bf('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x21bf('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x21bf('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x21bf('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x21bf('0x14')](0x3)[_0x21bf('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x21bf('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x21bf('0x44')},'dialDropMaxRetry':{'type':Sequelize[_0x21bf('0x14')](0x3)[_0x21bf('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x21bf('0x45')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x21bf('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x21bf('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x21bf('0x14')](0x3)[_0x21bf('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x21bf('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x21bf('0x14')](0x5)[_0x21bf('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x21bf('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0x21bf('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x21bf('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x21bf('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x21bf('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x21bf('0x14')](0x3)[_0x21bf('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x21bf('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x21bf('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x21bf('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x21bf('0x14')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x21bf('0x1d')],'defaultValue':![],'comment':_0x21bf('0x4d'),'set':function(_0x568253){if(!_0x568253)this[_0x21bf('0xc')](_0x21bf('0x4e'),null);this['setDataValue'](_0x21bf('0x4f'),_0x568253);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x21bf('0x14')](0x3)[_0x21bf('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x21bf('0x1d')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x21bf('0x14')](0x3)[_0x21bf('0x23')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x21bf('0x1d')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 9b1d80f..ebbcacb 100644 --- a/server/api/voiceQueue/voiceQueue.controller.js +++ b/server/api/voiceQueue/voiceQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00bb=['query','filters','intersection','attributes','fields','length','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoiceQueues','QueueCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','getHoppers','hasOwnProperty','nolimit','sort','VoiceQueueId','CmHopper','includeAll','findAll','CmHopperHistory','order','pick','getHopperFinals','findOne','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','online','voicePause','interface','Agents','forEach','penalty','sequelize','transaction','each','upsert','UserVoiceQueue','UserVoiceQueueRt','SIP/%s','emit','userVoiceQueue:save','ids','User','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','all','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isNil','format','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','scheduledAt','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','push','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','bluebird','util','squel','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./voiceQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','then','destroy','get','inbound','outbound','filter','ignore','value','includes','type','find','name','UserProfileResource','error','stack','send','index','map','rawAttributes','fieldName','key','getOptions','where','VoiceQueue','include','rows','catch','show','params','model','keys'];(function(_0xc7c064,_0x11068c){var _0x454458=function(_0x170663){while(--_0x170663){_0xc7c064['push'](_0xc7c064['shift']());}};_0x454458(++_0x11068c);}(_0x00bb,0x1d8));var _0xb00b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x00bb[_0x501510];return _0x1e6ee5;};'use strict';var moment=require(_0xb00b('0x0'));var BPromise=require(_0xb00b('0x1'));var util=require(_0xb00b('0x2'));var _=require('lodash');var squel=require(_0xb00b('0x3'));var Redis=require('ioredis');var qs=require(_0xb00b('0x4'));var logger=require(_0xb00b('0x5'))('api');var config=require(_0xb00b('0x6'));var db=require(_0xb00b('0x7'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xb00b('0x8'),'port':0x18eb});var socket=require(_0xb00b('0x9'))(new Redis(config[_0xb00b('0xa')]));require(_0xb00b('0xb'))[_0xb00b('0xc')](socket);function respondWithStatusCode(_0x3c36c5,_0x5b0c03){_0x5b0c03=_0x5b0c03||0xcc;return function(_0x51d12b){if(_0x51d12b){return _0x3c36c5[_0xb00b('0xd')](_0x5b0c03);}return _0x3c36c5[_0xb00b('0xe')](_0x5b0c03)[_0xb00b('0xf')]();};}function respondWithResult(_0x46a25c,_0x28d3cc){_0x28d3cc=_0x28d3cc||0xc8;return function(_0x48e125){if(_0x48e125){return _0x46a25c[_0xb00b('0xe')](_0x28d3cc)['json'](_0x48e125);}};}function respondWithFilteredResult(_0x5a4fea,_0x594075){return function(_0x4ff792){if(_0x4ff792){var _0x2d8ddf=typeof _0x594075[_0xb00b('0x10')]===_0xb00b('0x11')&&typeof _0x594075[_0xb00b('0x12')]===_0xb00b('0x11');var _0x4ada81=_0x4ff792[_0xb00b('0x13')];var _0xb0d42e=_0x2d8ddf?0x0:_0x594075['offset'];var _0x88d95e=_0x2d8ddf?_0x4ff792[_0xb00b('0x13')]:_0x594075['offset']+_0x594075['limit'];var _0x9b471e;if(_0x88d95e>=_0x4ada81){_0x88d95e=_0x4ada81;_0x9b471e=0xc8;}else{_0x9b471e=0xce;}_0x5a4fea['status'](_0x9b471e);return _0x5a4fea['set'](_0xb00b('0x14'),_0xb0d42e+'-'+_0x88d95e+'/'+_0x4ada81)[_0xb00b('0x15')](_0x4ff792);}return null;};}function saveUpdates(_0x387d97){return function(_0xbb72fc){if(_0xbb72fc){return _0xbb72fc['update'](_0x387d97)[_0xb00b('0x16')](function(_0x599347){return _0x599347;});}return null;};}function removeEntity(_0x415f91){return function(_0x5aa9a0){if(_0x5aa9a0){return _0x5aa9a0[_0xb00b('0x17')]()['then'](function(){var _0xb26ebb=_0x5aa9a0[_0xb00b('0x18')]({'plain':!![]});var _0x53ee68=[{'name':'VoiceQueues','value':_0xb00b('0x19'),'ignore':![]},{'name':'QueueCampaigns','value':_0xb00b('0x1a'),'ignore':![]}];var _0x43da66=_(_0x53ee68)[_0xb00b('0x1b')](_0xb00b('0x1c'))['map'](_0xb00b('0x1d'))['value']();if(_[_0xb00b('0x1e')](_0x43da66,_0xb26ebb[_0xb00b('0x1f')])){return;}var _0x51b841=_[_0xb00b('0x20')](_0x53ee68,[_0xb00b('0x1d'),_0xb26ebb['type']])[_0xb00b('0x21')];return db[_0xb00b('0x22')]['destroy']({'where':{'type':_0x51b841,'resourceId':_0xb26ebb['id']}})[_0xb00b('0x16')](function(){return _0x5aa9a0;});})[_0xb00b('0x16')](function(){_0x415f91[_0xb00b('0xe')](0xcc)[_0xb00b('0xf')]();});}};}function handleEntityNotFound(_0x520e55){return function(_0x50be6c){if(!_0x50be6c){_0x520e55[_0xb00b('0xd')](0x194);}return _0x50be6c;};}function handleError(_0x490380,_0x550587){_0x550587=_0x550587||0x1f4;return function(_0x4a635e){logger[_0xb00b('0x23')](_0x4a635e[_0xb00b('0x24')]);if(_0x4a635e[_0xb00b('0x21')]){delete _0x4a635e[_0xb00b('0x21')];}_0x490380[_0xb00b('0xe')](_0x550587)[_0xb00b('0x25')](_0x4a635e);};}exports[_0xb00b('0x26')]=function(_0x4a8d2b,_0x22c22d){var _0x503c9c={};var _0x450129={'count':0x0,'rows':[]};var _0x348165=_[_0xb00b('0x27')](db['VoiceQueue'][_0xb00b('0x28')],function(_0x280ed3){return{'name':_0x280ed3[_0xb00b('0x29')],'type':_0x280ed3[_0xb00b('0x1f')][_0xb00b('0x2a')]};});_0x503c9c=qs[_0xb00b('0x2b')](_0x348165,_0x4a8d2b);var _0x2e160a={'where':_0x503c9c[_0xb00b('0x2c')]};return db[_0xb00b('0x2d')]['count'](_0x2e160a)[_0xb00b('0x16')](function(_0x44918d){_0x450129['count']=_0x44918d;_0x503c9c[_0xb00b('0x2e')]=qs[_0xb00b('0x2e')](_0x4a8d2b['query']);return db[_0xb00b('0x2d')]['findAll'](_0x503c9c);})[_0xb00b('0x16')](function(_0x4117f2){_0x450129[_0xb00b('0x2f')]=_0x4117f2;return _0x450129;})[_0xb00b('0x16')](respondWithFilteredResult(_0x22c22d,_0x503c9c))[_0xb00b('0x30')](handleError(_0x22c22d,null));};exports[_0xb00b('0x31')]=function(_0x17f613,_0x594840){var _0x57e8f9={'raw':![],'where':{'id':_0x17f613[_0xb00b('0x32')]['id']}},_0x5b04c2={};_0x5b04c2[_0xb00b('0x33')]=_[_0xb00b('0x34')](db[_0xb00b('0x2d')]['rawAttributes']);_0x5b04c2[_0xb00b('0x35')]=_[_0xb00b('0x34')](_0x17f613[_0xb00b('0x35')]);_0x5b04c2[_0xb00b('0x36')]=_[_0xb00b('0x37')](_0x5b04c2[_0xb00b('0x33')],_0x5b04c2[_0xb00b('0x35')]);_0x57e8f9[_0xb00b('0x38')]=_['intersection'](_0x5b04c2['model'],qs[_0xb00b('0x39')](_0x17f613['query'][_0xb00b('0x39')]));_0x57e8f9[_0xb00b('0x38')]=_0x57e8f9[_0xb00b('0x38')][_0xb00b('0x3a')]?_0x57e8f9[_0xb00b('0x38')]:_0x5b04c2[_0xb00b('0x33')];if(_0x17f613[_0xb00b('0x35')]['includeAll']){_0x57e8f9[_0xb00b('0x2e')]=[{'all':!![]}];}_0x57e8f9=_[_0xb00b('0x3b')]({},_0x57e8f9,_0x17f613[_0xb00b('0x3c')]);return db[_0xb00b('0x2d')][_0xb00b('0x20')](_0x57e8f9)[_0xb00b('0x16')](handleEntityNotFound(_0x594840,null))['then'](respondWithResult(_0x594840,null))[_0xb00b('0x30')](handleError(_0x594840,null));};exports[_0xb00b('0x3d')]=function(_0x4801e7,_0x17ff34){return db[_0xb00b('0x2d')][_0xb00b('0x3d')](_0x4801e7[_0xb00b('0x3e')],{})[_0xb00b('0x16')](function(_0x5636b1){var _0x14ff6a=_0x4801e7[_0xb00b('0x3f')][_0xb00b('0x18')]({'plain':!![]});if(!_0x14ff6a)throw new Error(_0xb00b('0x40'));if(_0x14ff6a['role']==='user'){var _0x43f834=_0x5636b1[_0xb00b('0x18')]({'plain':!![]});var _0x10a348=[{'name':_0xb00b('0x41'),'value':_0xb00b('0x19')},{'name':_0xb00b('0x42'),'value':_0xb00b('0x1a')}];var _0x493841=_[_0xb00b('0x20')](_0x10a348,[_0xb00b('0x1d'),_0x43f834[_0xb00b('0x1f')]])[_0xb00b('0x21')];return db[_0xb00b('0x43')][_0xb00b('0x20')]({'where':{'name':_0x493841,'userProfileId':_0x14ff6a[_0xb00b('0x44')]},'raw':!![]})[_0xb00b('0x16')](function(_0x2d58e2){if(_0x2d58e2&&_0x2d58e2[_0xb00b('0x45')]===0x0){return db[_0xb00b('0x22')][_0xb00b('0x3d')]({'name':_0x43f834['name'],'resourceId':_0x43f834['id'],'type':_0x2d58e2[_0xb00b('0x21')],'sectionId':_0x2d58e2['id']},{})[_0xb00b('0x16')](function(){return _0x5636b1;});}else{return _0x5636b1;}})[_0xb00b('0x30')](function(_0x44afa0){logger[_0xb00b('0x23')](_0xb00b('0x46'),_0x44afa0);throw _0x44afa0;});}return _0x5636b1;})[_0xb00b('0x16')](respondWithResult(_0x17ff34,0xc9))[_0xb00b('0x30')](handleError(_0x17ff34,null));};exports[_0xb00b('0x47')]=function(_0x103320,_0x1eec12){var _0x3b3031={'where':{'id':_0x103320['params']['id']}},_0x5dbe00={};_0x5dbe00['model']=_[_0xb00b('0x34')](db[_0xb00b('0x2d')]['rawAttributes']);_0x3b3031[_0xb00b('0x38')]=_[_0xb00b('0x37')](_0x5dbe00[_0xb00b('0x33')],qs[_0xb00b('0x39')](_0x103320['query']['fields']));_0x3b3031[_0xb00b('0x38')]=_0x3b3031[_0xb00b('0x38')]['length']?_0x3b3031['attributes']:_0x5dbe00[_0xb00b('0x33')];if(_0x103320[_0xb00b('0x35')]['includeAll']){_0x3b3031[_0xb00b('0x2e')]=[{'all':!![]}];}_0x3b3031=_['merge']({},_0x3b3031,_0x103320['options']);return db['VoiceQueue'][_0xb00b('0x20')](_0x3b3031)['then'](handleEntityNotFound(_0x1eec12,null))[_0xb00b('0x16')](function(_0x3178aa){if(_0x3178aa){var _0x4b6482=_0x3178aa[_0xb00b('0x18')]({'plain':!![]});_0x4b6482=qs[_0xb00b('0x48')](_0x4b6482,['id',_0xb00b('0x49'),'updatedAt']);_0x103320['body']=_[_0xb00b('0x48')](_0x103320[_0xb00b('0x3e')],['id','createdAt',_0xb00b('0x4a')]);return db[_0xb00b('0x2d')]['create'](_[_0xb00b('0x3b')](_0x4b6482,_0x103320[_0xb00b('0x3e')]),{'include':_0x103320[_0xb00b('0x35')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x19f907){var _0x398deb=_0x103320[_0xb00b('0x3f')][_0xb00b('0x18')]({'plain':!![]});if(!_0x398deb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x398deb[_0xb00b('0x4b')]===_0xb00b('0x3f')){var _0x4ad9cb=_0x19f907['get']({'plain':!![]});var _0x160965=[{'name':'VoiceQueues','value':_0xb00b('0x19')},{'name':_0xb00b('0x42'),'value':_0xb00b('0x1a')}];var _0x222459=_[_0xb00b('0x20')](_0x160965,[_0xb00b('0x1d'),_0x4ad9cb['type']])[_0xb00b('0x21')];return db['UserProfileSection'][_0xb00b('0x20')]({'where':{'name':_0x222459,'userProfileId':_0x398deb[_0xb00b('0x44')]},'raw':!![]})[_0xb00b('0x16')](function(_0x5ac79e){if(_0x5ac79e&&_0x5ac79e[_0xb00b('0x45')]===0x0){return db[_0xb00b('0x22')][_0xb00b('0x3d')]({'name':_0x4ad9cb['name'],'resourceId':_0x4ad9cb['id'],'type':_0x5ac79e[_0xb00b('0x21')],'sectionId':_0x5ac79e['id']},{})[_0xb00b('0x16')](function(){return _0x19f907;});}else{return _0x19f907;}})[_0xb00b('0x30')](function(_0x385029){logger[_0xb00b('0x23')](_0xb00b('0x46'),_0x385029);throw _0x385029;});}return _0x19f907;});}})[_0xb00b('0x16')](respondWithResult(_0x1eec12,0xc9))[_0xb00b('0x30')](handleError(_0x1eec12,null));};exports['update']=function(_0x153551,_0x2cbe80){if(_0x153551[_0xb00b('0x3e')]['id']){delete _0x153551['body']['id'];}return db[_0xb00b('0x2d')][_0xb00b('0x20')]({'where':{'id':_0x153551[_0xb00b('0x32')]['id']}})[_0xb00b('0x16')](handleEntityNotFound(_0x2cbe80,null))[_0xb00b('0x16')](saveUpdates(_0x153551['body'],null))[_0xb00b('0x16')](respondWithResult(_0x2cbe80,null))[_0xb00b('0x30')](handleError(_0x2cbe80,null));};exports[_0xb00b('0x17')]=function(_0x1cad79,_0x4b1e5f){return db[_0xb00b('0x2d')][_0xb00b('0x20')]({'where':{'id':_0x1cad79[_0xb00b('0x32')]['id']}})[_0xb00b('0x16')](handleEntityNotFound(_0x4b1e5f,null))[_0xb00b('0x16')](removeEntity(_0x4b1e5f,null))[_0xb00b('0x30')](handleError(_0x4b1e5f,null));};exports[_0xb00b('0x4c')]=function(_0x542223,_0x2b090a){var _0x502822={'raw':![],'where':{}};var _0x3e0648={};var _0x4c2186={'count':0x0,'rows':[]};return db[_0xb00b('0x2d')]['findOne']({'where':{'id':_0x542223[_0xb00b('0x32')]['id']}})['then'](handleEntityNotFound(_0x2b090a,null))[_0xb00b('0x16')](function(_0x2534ed){if(_0x2534ed){_0x3e0648[_0xb00b('0x33')]=_['keys'](db['CmHopper']['rawAttributes']);_0x3e0648[_0xb00b('0x35')]=_[_0xb00b('0x34')](_0x542223[_0xb00b('0x35')]);_0x3e0648['filters']=_[_0xb00b('0x37')](_0x3e0648[_0xb00b('0x33')],_0x3e0648[_0xb00b('0x35')]);_0x502822[_0xb00b('0x38')]=_[_0xb00b('0x37')](_0x3e0648['model'],qs[_0xb00b('0x39')](_0x542223[_0xb00b('0x35')]['fields']));_0x502822[_0xb00b('0x38')]=_0x502822[_0xb00b('0x38')][_0xb00b('0x3a')]?_0x502822['attributes']:_0x3e0648['model'];if(!_0x542223[_0xb00b('0x35')][_0xb00b('0x4d')](_0xb00b('0x4e'))){_0x502822['limit']=qs['limit'](_0x542223['query']['limit']);_0x502822[_0xb00b('0x10')]=qs['offset'](_0x542223[_0xb00b('0x35')][_0xb00b('0x10')]);}_0x502822['order']=qs[_0xb00b('0x4f')](_0x542223[_0xb00b('0x35')][_0xb00b('0x4f')]);_0x502822[_0xb00b('0x2c')]=qs[_0xb00b('0x36')](_['pick'](_0x542223[_0xb00b('0x35')],_0x3e0648[_0xb00b('0x36')]));_0x502822[_0xb00b('0x2c')][_0xb00b('0x50')]=_0x2534ed['id'];if(_0x542223[_0xb00b('0x35')][_0xb00b('0x1b')]){_0x502822[_0xb00b('0x2c')]=_['merge'](_0x502822[_0xb00b('0x2c')],{'$or':_[_0xb00b('0x27')](_0x502822[_0xb00b('0x38')],function(_0x328f72){var _0x109f56={};_0x109f56[_0x328f72]={'$like':'%'+_0x542223[_0xb00b('0x35')][_0xb00b('0x1b')]+'%'};return _0x109f56;})});}_0x502822=_[_0xb00b('0x3b')]({},_0x502822,_0x542223['options']);return db[_0xb00b('0x51')][_0xb00b('0x13')]({'where':_0x502822[_0xb00b('0x2c')]})[_0xb00b('0x16')](function(_0x3d6b33){_0x4c2186[_0xb00b('0x13')]=_0x3d6b33;if(_0x542223[_0xb00b('0x35')][_0xb00b('0x52')]){_0x502822['include']=[{'all':!![]}];}return db[_0xb00b('0x51')][_0xb00b('0x53')](_0x502822);})[_0xb00b('0x16')](function(_0x26b82a){_0x4c2186[_0xb00b('0x2f')]=_0x26b82a;return _0x4c2186;});}})[_0xb00b('0x16')](respondWithFilteredResult(_0x2b090a,_0x502822))[_0xb00b('0x30')](handleError(_0x2b090a,null));};exports['getHopperHistories']=function(_0x207bda,_0x37a4c0){var _0x28ecf8={'raw':!![],'where':{}};var _0x22b19c={};var _0x16e8ff={'count':0x0,'rows':[]};return db[_0xb00b('0x2d')]['findOne']({'where':{'id':_0x207bda[_0xb00b('0x32')]['id']}})['then'](handleEntityNotFound(_0x37a4c0,null))[_0xb00b('0x16')](function(_0x50922f){if(_0x50922f){_0x22b19c[_0xb00b('0x33')]=_[_0xb00b('0x34')](db[_0xb00b('0x54')]['rawAttributes']);_0x22b19c['query']=_[_0xb00b('0x34')](_0x207bda[_0xb00b('0x35')]);_0x22b19c[_0xb00b('0x36')]=_[_0xb00b('0x37')](_0x22b19c[_0xb00b('0x33')],_0x22b19c[_0xb00b('0x35')]);_0x28ecf8[_0xb00b('0x38')]=_[_0xb00b('0x37')](_0x22b19c[_0xb00b('0x33')],qs[_0xb00b('0x39')](_0x207bda[_0xb00b('0x35')][_0xb00b('0x39')]));_0x28ecf8[_0xb00b('0x38')]=_0x28ecf8[_0xb00b('0x38')]['length']?_0x28ecf8['attributes']:_0x22b19c[_0xb00b('0x33')];if(!_0x207bda[_0xb00b('0x35')]['hasOwnProperty']('nolimit')){_0x28ecf8[_0xb00b('0x12')]=qs[_0xb00b('0x12')](_0x207bda[_0xb00b('0x35')]['limit']);_0x28ecf8[_0xb00b('0x10')]=qs[_0xb00b('0x10')](_0x207bda[_0xb00b('0x35')][_0xb00b('0x10')]);}_0x28ecf8[_0xb00b('0x55')]=qs[_0xb00b('0x4f')](_0x207bda[_0xb00b('0x35')]['sort']);_0x28ecf8[_0xb00b('0x2c')]=qs['filters'](_[_0xb00b('0x56')](_0x207bda[_0xb00b('0x35')],_0x22b19c['filters']));_0x28ecf8[_0xb00b('0x2c')][_0xb00b('0x50')]=_0x50922f['id'];if(_0x207bda[_0xb00b('0x35')][_0xb00b('0x1b')]){_0x28ecf8[_0xb00b('0x2c')]=_[_0xb00b('0x3b')](_0x28ecf8[_0xb00b('0x2c')],{'$or':_[_0xb00b('0x27')](_0x28ecf8[_0xb00b('0x38')],function(_0x383d16){var _0x2ec3f2={};_0x2ec3f2[_0x383d16]={'$like':'%'+_0x207bda[_0xb00b('0x35')]['filter']+'%'};return _0x2ec3f2;})});}_0x28ecf8=_[_0xb00b('0x3b')]({},_0x28ecf8,_0x207bda[_0xb00b('0x3c')]);return db[_0xb00b('0x54')][_0xb00b('0x13')]({'where':_0x28ecf8['where']})[_0xb00b('0x16')](function(_0x17503d){_0x16e8ff[_0xb00b('0x13')]=_0x17503d;if(_0x207bda[_0xb00b('0x35')][_0xb00b('0x52')]){_0x28ecf8['include']=[{'all':!![]}];}return db[_0xb00b('0x54')][_0xb00b('0x53')](_0x28ecf8);})[_0xb00b('0x16')](function(_0x2b66b7){_0x16e8ff['rows']=_0x2b66b7;return _0x16e8ff;});}})[_0xb00b('0x16')](respondWithFilteredResult(_0x37a4c0,_0x28ecf8))['catch'](handleError(_0x37a4c0,null));};exports[_0xb00b('0x57')]=function(_0x202d5f,_0x69b4e0){var _0x165442={'raw':!![],'where':{}};var _0x188349={};var _0x27e051={'count':0x0,'rows':[]};return db[_0xb00b('0x2d')][_0xb00b('0x58')]({'where':{'id':_0x202d5f[_0xb00b('0x32')]['id']}})[_0xb00b('0x16')](handleEntityNotFound(_0x69b4e0,null))[_0xb00b('0x16')](function(_0x551a55){if(_0x551a55){_0x188349[_0xb00b('0x33')]=_[_0xb00b('0x34')](db[_0xb00b('0x59')][_0xb00b('0x28')]);_0x188349['query']=_[_0xb00b('0x34')](_0x202d5f[_0xb00b('0x35')]);_0x188349['filters']=_[_0xb00b('0x37')](_0x188349['model'],_0x188349[_0xb00b('0x35')]);_0x165442[_0xb00b('0x38')]=_[_0xb00b('0x37')](_0x188349['model'],qs[_0xb00b('0x39')](_0x202d5f[_0xb00b('0x35')][_0xb00b('0x39')]));_0x165442[_0xb00b('0x38')]=_0x165442[_0xb00b('0x38')][_0xb00b('0x3a')]?_0x165442[_0xb00b('0x38')]:_0x188349[_0xb00b('0x33')];if(!_0x202d5f[_0xb00b('0x35')]['hasOwnProperty']('nolimit')){_0x165442[_0xb00b('0x12')]=qs[_0xb00b('0x12')](_0x202d5f[_0xb00b('0x35')][_0xb00b('0x12')]);_0x165442['offset']=qs[_0xb00b('0x10')](_0x202d5f[_0xb00b('0x35')]['offset']);}_0x165442[_0xb00b('0x55')]=qs[_0xb00b('0x4f')](_0x202d5f[_0xb00b('0x35')]['sort']);_0x165442[_0xb00b('0x2c')]=qs[_0xb00b('0x36')](_['pick'](_0x202d5f[_0xb00b('0x35')],_0x188349[_0xb00b('0x36')]));_0x165442[_0xb00b('0x2c')][_0xb00b('0x50')]=_0x551a55['id'];if(_0x202d5f[_0xb00b('0x35')][_0xb00b('0x1b')]){_0x165442[_0xb00b('0x2c')]=_[_0xb00b('0x3b')](_0x165442['where'],{'$or':_[_0xb00b('0x27')](_0x165442[_0xb00b('0x38')],function(_0x320542){var _0x29d101={};_0x29d101[_0x320542]={'$like':'%'+_0x202d5f['query'][_0xb00b('0x1b')]+'%'};return _0x29d101;})});}_0x165442=_['merge']({},_0x165442,_0x202d5f[_0xb00b('0x3c')]);return db['CmHopperFinal'][_0xb00b('0x13')]({'where':_0x165442[_0xb00b('0x2c')]})[_0xb00b('0x16')](function(_0x3e0e49){_0x27e051[_0xb00b('0x13')]=_0x3e0e49;if(_0x202d5f['query'][_0xb00b('0x52')]){_0x165442[_0xb00b('0x2e')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xb00b('0x53')](_0x165442);})['then'](function(_0x20a690){_0x27e051[_0xb00b('0x2f')]=_0x20a690;return _0x27e051;});}})[_0xb00b('0x16')](respondWithFilteredResult(_0x69b4e0,_0x165442))[_0xb00b('0x30')](handleError(_0x69b4e0,null));};exports['getHopperBlacks']=function(_0x3ae4a4,_0x76b483){var _0x190019={'raw':!![],'where':{}};var _0x44ea58={};var _0x11172e={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x3ae4a4[_0xb00b('0x32')]['id']}})[_0xb00b('0x16')](handleEntityNotFound(_0x76b483,null))[_0xb00b('0x16')](function(_0x2d5652){if(_0x2d5652){_0x44ea58[_0xb00b('0x33')]=_['keys'](db['CmHopperBlack'][_0xb00b('0x28')]);_0x44ea58[_0xb00b('0x35')]=_[_0xb00b('0x34')](_0x3ae4a4[_0xb00b('0x35')]);_0x44ea58[_0xb00b('0x36')]=_[_0xb00b('0x37')](_0x44ea58[_0xb00b('0x33')],_0x44ea58['query']);_0x190019[_0xb00b('0x38')]=_['intersection'](_0x44ea58[_0xb00b('0x33')],qs['fields'](_0x3ae4a4[_0xb00b('0x35')][_0xb00b('0x39')]));_0x190019[_0xb00b('0x38')]=_0x190019[_0xb00b('0x38')][_0xb00b('0x3a')]?_0x190019[_0xb00b('0x38')]:_0x44ea58[_0xb00b('0x33')];if(!_0x3ae4a4[_0xb00b('0x35')][_0xb00b('0x4d')](_0xb00b('0x4e'))){_0x190019[_0xb00b('0x12')]=qs['limit'](_0x3ae4a4[_0xb00b('0x35')][_0xb00b('0x12')]);_0x190019[_0xb00b('0x10')]=qs[_0xb00b('0x10')](_0x3ae4a4['query'][_0xb00b('0x10')]);}_0x190019[_0xb00b('0x55')]=qs['sort'](_0x3ae4a4[_0xb00b('0x35')]['sort']);_0x190019[_0xb00b('0x2c')]=qs[_0xb00b('0x36')](_['pick'](_0x3ae4a4[_0xb00b('0x35')],_0x44ea58[_0xb00b('0x36')]));_0x190019[_0xb00b('0x2c')][_0xb00b('0x50')]=_0x2d5652['id'];if(_0x3ae4a4[_0xb00b('0x35')][_0xb00b('0x1b')]){_0x190019['where']=_[_0xb00b('0x3b')](_0x190019['where'],{'$or':_[_0xb00b('0x27')](_0x190019[_0xb00b('0x38')],function(_0x140bfd){var _0x43fbc5={};_0x43fbc5[_0x140bfd]={'$like':'%'+_0x3ae4a4['query'][_0xb00b('0x1b')]+'%'};return _0x43fbc5;})});}_0x190019=_[_0xb00b('0x3b')]({},_0x190019,_0x3ae4a4[_0xb00b('0x3c')]);return db['CmHopperBlack'][_0xb00b('0x13')]({'where':_0x190019[_0xb00b('0x2c')]})[_0xb00b('0x16')](function(_0xcc2183){_0x11172e['count']=_0xcc2183;if(_0x3ae4a4[_0xb00b('0x35')][_0xb00b('0x52')]){_0x190019[_0xb00b('0x2e')]=[{'all':!![]}];}return db[_0xb00b('0x5a')][_0xb00b('0x53')](_0x190019);})[_0xb00b('0x16')](function(_0x568c0a){_0x11172e['rows']=_0x568c0a;return _0x11172e;});}})[_0xb00b('0x16')](respondWithFilteredResult(_0x76b483,_0x190019))[_0xb00b('0x30')](handleError(_0x76b483,null));};exports[_0xb00b('0x5b')]=function(_0x2ec514,_0x3de4f6){var _0x5f0fd8={};var _0x3d80e7={};var _0xbe553c;var _0x14597c;return db[_0xb00b('0x2d')][_0xb00b('0x58')]({'where':{'id':_0x2ec514[_0xb00b('0x32')]['id']}})['then'](handleEntityNotFound(_0x3de4f6,null))[_0xb00b('0x16')](function(_0x2414bd){if(_0x2414bd){_0xbe553c=_0x2414bd;_0x3d80e7[_0xb00b('0x33')]=_[_0xb00b('0x34')](db[_0xb00b('0x5c')][_0xb00b('0x28')]);_0x3d80e7[_0xb00b('0x35')]=_[_0xb00b('0x34')](_0x2ec514[_0xb00b('0x35')]);_0x3d80e7[_0xb00b('0x36')]=_['intersection'](_0x3d80e7['model'],_0x3d80e7[_0xb00b('0x35')]);_0x5f0fd8[_0xb00b('0x38')]=_[_0xb00b('0x37')](_0x3d80e7['model'],qs['fields'](_0x2ec514['query'][_0xb00b('0x39')]));_0x5f0fd8[_0xb00b('0x38')]=_0x5f0fd8[_0xb00b('0x38')]['length']?_0x5f0fd8[_0xb00b('0x38')]:_0x3d80e7[_0xb00b('0x33')];_0x5f0fd8[_0xb00b('0x55')]=qs[_0xb00b('0x4f')](_0x2ec514['query'][_0xb00b('0x4f')]);_0x5f0fd8[_0xb00b('0x2c')]=qs[_0xb00b('0x36')](_[_0xb00b('0x56')](_0x2ec514[_0xb00b('0x35')],_0x3d80e7[_0xb00b('0x36')]));if(_0x2ec514[_0xb00b('0x35')][_0xb00b('0x1b')]){_0x5f0fd8['where']=_[_0xb00b('0x3b')](_0x5f0fd8[_0xb00b('0x2c')],{'$or':_[_0xb00b('0x27')](_0x5f0fd8[_0xb00b('0x38')],function(_0xf9c361){var _0x24c646={};_0x24c646[_0xf9c361]={'$like':'%'+_0x2ec514[_0xb00b('0x35')][_0xb00b('0x1b')]+'%'};return _0x24c646;})});}_0x5f0fd8=_['merge']({},_0x5f0fd8,_0x2ec514[_0xb00b('0x3c')]);return _0xbe553c[_0xb00b('0x5b')](_0x5f0fd8);}})[_0xb00b('0x16')](function(_0x122522){if(_0x122522){_0x14597c=_0x122522['length'];if(!_0x2ec514[_0xb00b('0x35')][_0xb00b('0x4d')](_0xb00b('0x4e'))){_0x5f0fd8[_0xb00b('0x12')]=qs[_0xb00b('0x12')](_0x2ec514[_0xb00b('0x35')][_0xb00b('0x12')]);_0x5f0fd8[_0xb00b('0x10')]=qs['offset'](_0x2ec514['query'][_0xb00b('0x10')]);}return _0xbe553c[_0xb00b('0x5b')](_0x5f0fd8);}})[_0xb00b('0x16')](function(_0x58894a){if(_0x58894a){return _0x58894a?{'count':_0x14597c,'rows':_0x58894a}:null;}})[_0xb00b('0x16')](respondWithResult(_0x3de4f6,null))[_0xb00b('0x30')](handleError(_0x3de4f6,null));};exports[_0xb00b('0x5d')]=function(_0x581548,_0x44d3c0){var _0x3d5880=_0x581548[_0xb00b('0x3e')]['teams'];var _0x58808e=_[_0xb00b('0x27')](_0x3d5880,'id');return db['Team'][_0xb00b('0x53')]({'where':{'id':_0x58808e},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xb00b('0x21'),_0xb00b('0x5e'),_0xb00b('0x5f'),_0xb00b('0x60')],'raw':!![]}]})[_0xb00b('0x16')](function(_0x5c5a04){if(_0x5c5a04){var _0x1aa5e5=_['flatMap'](_0x5c5a04,function(_0x592206){var _0x3551ca=_0x592206[_0xb00b('0x18')]({'plain':!![]});_0x3551ca[_0xb00b('0x61')][_0xb00b('0x62')](function(_0x8b31d3){_0x8b31d3[_0xb00b('0x63')]=_['find'](_0x3d5880,{'id':_0x3551ca['id']})[_0xb00b('0x63')];});return _0x3551ca['Agents'];});return db[_0xb00b('0x2d')][_0xb00b('0x20')]({'where':{'id':_0x581548[_0xb00b('0x32')]['id']}})['then'](function(_0x226527){return db[_0xb00b('0x64')][_0xb00b('0x65')](function(_0x3dc8d2){return _0x226527['addTeams'](_0x58808e,{'transaction':_0x3dc8d2})['then'](function(){return BPromise[_0xb00b('0x66')](_0x3d5880,function(_0x55bb31){return db['TeamVoiceQueue'][_0xb00b('0x67')]({'TeamId':_0x55bb31['id'],'VoiceQueueId':_0x581548['params']['id'],'penalty':_0x55bb31['penalty']},{'transaction':_0x3dc8d2});});})[_0xb00b('0x16')](function(){return BPromise[_0xb00b('0x66')](_0x1aa5e5,function(_0x745803){return db[_0xb00b('0x68')]['findOrCreate']({'where':{'UserId':_0x745803['id'],'VoiceQueueId':_0x581548['params']['id']},'defaults':{'penalty':_0x745803[_0xb00b('0x63')]},'transaction':_0x3dc8d2});});})[_0xb00b('0x16')](function(){return BPromise[_0xb00b('0x66')](_['filter'](_0x1aa5e5,{'online':!![]}),function(_0x48bac5){return db[_0xb00b('0x69')]['upsert']({'membername':_0x48bac5['name'],'UserId':_0x48bac5['id'],'queue_name':_0x226527[_0xb00b('0x21')],'VoiceQueueId':_0x226527['id'],'interface':_['isNil'](_0x48bac5[_0xb00b('0x60')])?util['format'](_0xb00b('0x6a'),_0x48bac5['name']):_0x48bac5[_0xb00b('0x60')],'paused':_0x48bac5[_0xb00b('0x5f')]||![],'penalty':_0x48bac5[_0xb00b('0x63')]},{'transaction':_0x3dc8d2});});})['then'](function(){_0x1aa5e5[_0xb00b('0x62')](function(_0x596092){socket[_0xb00b('0x6b')](_0xb00b('0x6c'),{'UserId':_0x596092['id'],'VoiceQueueId':_0x226527['id']});});});});});}})['then'](respondWithStatusCode(_0x44d3c0,null))['catch'](handleError(_0x44d3c0,null));};exports['removeTeams']=function(_0x552f73,_0x192b43){return db['Team'][_0xb00b('0x53')]({'where':{'id':_0x552f73['query'][_0xb00b('0x6d')]},'attributes':['id'],'include':[{'model':db[_0xb00b('0x6e')],'as':_0xb00b('0x61'),'attributes':['id'],'raw':!![]}]})[_0xb00b('0x16')](handleEntityNotFound(_0x192b43,null))[_0xb00b('0x16')](function(_0x5b1576){var _0x8292fe=_[_0xb00b('0x27')](_0x5b1576,'id');var _0x3c1cc5=[];var _0x38e425=[];var _0x515143=squel['select']();_0x515143[_0xb00b('0x6f')](_0xb00b('0x70'))[_0xb00b('0x71')](_0xb00b('0x72'),'tq')[_0xb00b('0x73')](_0xb00b('0x74'),'ut',_0xb00b('0x75'))[_0xb00b('0x2c')](_0xb00b('0x76'),_0x552f73['params']['id']);for(var _0x45bae8=0x0;_0x45bae8<_0x5b1576[_0xb00b('0x3a')];_0x45bae8+=0x1){let _0x496500=_0x5b1576[_0x45bae8];for(var _0x475ebb=0x0;_0x475ebb<_0x496500['Agents'][_0xb00b('0x3a')];_0x475ebb+=0x1){let _0x13054a=_0x496500['Agents'][_0x475ebb];var _0x4ce456=_0x515143[_0xb00b('0x47')]();_0x4ce456[_0xb00b('0x2c')](_0xb00b('0x77'),_0x13054a['id']);_0x38e425['push'](db[_0xb00b('0x64')][_0xb00b('0x35')](_0x4ce456[_0xb00b('0x78')](),{'type':db['sequelize'][_0xb00b('0x79')]['SELECT']})['then'](function(_0x58ea43){if(_0x58ea43[_0xb00b('0x3a')]===0x1){return _0x13054a['id'];}else{var _0x4d42af=_[_0xb00b('0x7a')](_[_0xb00b('0x27')](_0x58ea43,'TeamId'),function(_0x4c389f){return _[_0xb00b('0x1e')](_0x8292fe,_0x4c389f);});if(_0x4d42af){return _0x13054a['id'];}}}));}}return BPromise[_0xb00b('0x7b')](_0x38e425)['then'](function(_0x2f131e){_0x3c1cc5=_(_0x3c1cc5)[_0xb00b('0x7c')](_0x2f131e)[_0xb00b('0x7d')]()[_0xb00b('0x1d')]();return db[_0xb00b('0x2d')][_0xb00b('0x20')]({'where':{'id':_0x552f73['params']['id']}})[_0xb00b('0x16')](function(_0x22b425){return db['sequelize'][_0xb00b('0x65')](function(_0x4ed3c7){return _0x22b425['removeTeams'](_0x552f73[_0xb00b('0x35')]['ids'],{'transaction':_0x4ed3c7})[_0xb00b('0x16')](function(){if(!_[_0xb00b('0x7e')](_0x3c1cc5)){return _0x22b425[_0xb00b('0x7f')](_0x3c1cc5,{'transaction':_0x4ed3c7})['then'](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x552f73[_0xb00b('0x32')]['id'],'UserId':_0x3c1cc5},'transaction':_0x4ed3c7});});}})[_0xb00b('0x16')](function(){_0x3c1cc5['forEach'](function(_0x20f4d2){socket[_0xb00b('0x6b')](_0xb00b('0x80'),{'UserId':_0x20f4d2,'VoiceQueueId':_0x22b425['id']});});});});});});})[_0xb00b('0x16')](respondWithStatusCode(_0x192b43,null))[_0xb00b('0x30')](handleError(_0x192b43,null));};exports[_0xb00b('0x81')]=function(_0x21ecef,_0x40f6f6){var _0x48125c,_0x1b097a;return db[_0xb00b('0x2d')][_0xb00b('0x20')]({'where':{'id':_0x21ecef['params']['id']}})['then'](handleEntityNotFound(_0x40f6f6,null))['then'](function(_0x1e66eb){if(_0x1e66eb){_0x1b097a=_0x1e66eb;return _0x1e66eb[_0xb00b('0x81')](_0x21ecef[_0xb00b('0x3e')]['ids'],_[_0xb00b('0x48')](_0x21ecef[_0xb00b('0x3e')],[_0xb00b('0x6d'),'id'])||{})[_0xb00b('0x82')](function(_0x2c3557){for(var _0x5b7137=0x0;_0x5b7137<_0x21ecef[_0xb00b('0x3e')]['ids'][_0xb00b('0x3a')];_0x5b7137+=0x1){socket[_0xb00b('0x6b')](_0xb00b('0x6c'),{'UserId':Number(_0x21ecef[_0xb00b('0x3e')][_0xb00b('0x6d')][_0x5b7137]),'VoiceQueueId':Number(_0x21ecef[_0xb00b('0x32')]['id'])});}return _0x2c3557;});}})['then'](function(_0xeaa6ea){_0x48125c=_0xeaa6ea||[];if(_0x1b097a){return db[_0xb00b('0x6e')][_0xb00b('0x53')]({'where':{'id':_0x21ecef[_0xb00b('0x3e')][_0xb00b('0x6d')]},'attributes':['id',_0xb00b('0x21'),_0xb00b('0x5e'),_0xb00b('0x5f'),_0xb00b('0x60')],'raw':!![]});}})[_0xb00b('0x16')](function(_0x5f1258){if(!_[_0xb00b('0x7e')](_0x5f1258)){var _0x33952b=[];for(var _0x4cd459=0x0;_0x4cd459<_0x5f1258[_0xb00b('0x3a')];_0x4cd459++){if(_0x5f1258[_0x4cd459]['online']){_0x33952b['push'](db['UserVoiceQueueRt'][_0xb00b('0x67')]({'membername':_0x5f1258[_0x4cd459]['name'],'UserId':_0x5f1258[_0x4cd459]['id'],'queue_name':_0x1b097a[_0xb00b('0x21')],'VoiceQueueId':_0x1b097a['id'],'interface':_[_0xb00b('0x83')](_0x5f1258[_0x4cd459][_0xb00b('0x60')])?util[_0xb00b('0x84')](_0xb00b('0x6a'),_0x5f1258[_0x4cd459][_0xb00b('0x21')]):_0x5f1258[_0x4cd459][_0xb00b('0x60')],'paused':_0x5f1258[_0x4cd459][_0xb00b('0x5f')]||![],'penalty':_0x21ecef[_0xb00b('0x3e')][_0xb00b('0x63')]||0x0}));}}return BPromise[_0xb00b('0x7b')](_0x33952b);}})[_0xb00b('0x16')](function(){return _0x48125c;})[_0xb00b('0x16')](respondWithResult(_0x40f6f6,null))[_0xb00b('0x30')](handleError(_0x40f6f6,null));};exports['removeAgents']=function(_0x31d2f0,_0x15f9cd){return db[_0xb00b('0x2d')][_0xb00b('0x20')]({'where':{'id':_0x31d2f0[_0xb00b('0x32')]['id']}})['then'](handleEntityNotFound(_0x15f9cd,null))[_0xb00b('0x16')](function(_0x387744){if(_0x387744){return _0x387744['removeAgents'](_0x31d2f0['query'][_0xb00b('0x6d')])[_0xb00b('0x16')](function(){if(_[_0xb00b('0x85')](_0x31d2f0[_0xb00b('0x35')][_0xb00b('0x6d')])){for(var _0x11f9b7=0x0;_0x11f9b7<_0x31d2f0[_0xb00b('0x35')][_0xb00b('0x6d')][_0xb00b('0x3a')];_0x11f9b7+=0x1){socket[_0xb00b('0x6b')](_0xb00b('0x80'),{'UserId':Number(_0x31d2f0['query'][_0xb00b('0x6d')][_0x11f9b7]),'VoiceQueueId':Number(_0x31d2f0['params']['id'])});}}else{socket[_0xb00b('0x6b')](_0xb00b('0x80'),{'UserId':Number(_0x31d2f0[_0xb00b('0x35')][_0xb00b('0x6d')]),'VoiceQueueId':Number(_0x31d2f0[_0xb00b('0x32')]['id'])});}});}})[_0xb00b('0x16')](function(_0x59c4b6){return db[_0xb00b('0x69')][_0xb00b('0x17')]({'where':{'VoiceQueueId':_0x31d2f0[_0xb00b('0x32')]['id'],'UserId':_0x31d2f0[_0xb00b('0x35')]['ids']}})[_0xb00b('0x16')](function(){return _0x59c4b6;});})[_0xb00b('0x16')](respondWithStatusCode(_0x15f9cd,null))['catch'](handleError(_0x15f9cd,null));};exports[_0xb00b('0x86')]=function(_0x16cca9,_0x3c57b2){var _0xca4a87={};var _0x456515={};var _0x26145a;var _0x31fa5b;return db[_0xb00b('0x2d')][_0xb00b('0x58')]({'where':{'id':_0x16cca9['params']['id']}})[_0xb00b('0x16')](handleEntityNotFound(_0x3c57b2,null))[_0xb00b('0x16')](function(_0x4b0306){if(_0x4b0306){_0x26145a=_0x4b0306;_0x456515[_0xb00b('0x33')]=_[_0xb00b('0x34')](db[_0xb00b('0x6e')][_0xb00b('0x28')]);_0x456515[_0xb00b('0x35')]=_[_0xb00b('0x34')](_0x16cca9[_0xb00b('0x35')]);_0x456515[_0xb00b('0x36')]=_[_0xb00b('0x37')](_0x456515[_0xb00b('0x33')],_0x456515[_0xb00b('0x35')]);_0xca4a87['attributes']=_[_0xb00b('0x37')](_0x456515[_0xb00b('0x33')],qs[_0xb00b('0x39')](_0x16cca9['query'][_0xb00b('0x39')]));_0xca4a87[_0xb00b('0x38')]=_0xca4a87[_0xb00b('0x38')][_0xb00b('0x3a')]?_0xca4a87['attributes']:_0x456515[_0xb00b('0x33')];_0xca4a87[_0xb00b('0x55')]=qs['sort'](_0x16cca9['query'][_0xb00b('0x4f')]);_0xca4a87[_0xb00b('0x2c')]=qs['filters'](_[_0xb00b('0x56')](_0x16cca9['query'],_0x456515['filters']));if(_0x16cca9[_0xb00b('0x35')]['filter']){_0xca4a87['where']=_[_0xb00b('0x3b')](_0xca4a87[_0xb00b('0x2c')],{'$or':_[_0xb00b('0x27')](_0xca4a87[_0xb00b('0x38')],function(_0x11e9b4){var _0x2ae27c={};_0x2ae27c[_0x11e9b4]={'$like':'%'+_0x16cca9[_0xb00b('0x35')][_0xb00b('0x1b')]+'%'};return _0x2ae27c;})});}_0xca4a87=_[_0xb00b('0x3b')]({},_0xca4a87,_0x16cca9[_0xb00b('0x3c')]);return _0x26145a[_0xb00b('0x86')](_0xca4a87);}})[_0xb00b('0x16')](function(_0x29ba55){if(_0x29ba55){_0x31fa5b=_0x29ba55[_0xb00b('0x3a')];if(!_0x16cca9['query'][_0xb00b('0x4d')](_0xb00b('0x4e'))){_0xca4a87['limit']=qs[_0xb00b('0x12')](_0x16cca9['query'][_0xb00b('0x12')]);_0xca4a87[_0xb00b('0x10')]=qs[_0xb00b('0x10')](_0x16cca9['query'][_0xb00b('0x10')]);}return _0x26145a[_0xb00b('0x86')](_0xca4a87);}})['then'](function(_0x8478c8){if(_0x8478c8){return _0x8478c8?{'count':_0x31fa5b,'rows':_0x8478c8}:null;}})[_0xb00b('0x16')](respondWithResult(_0x3c57b2,null))[_0xb00b('0x30')](handleError(_0x3c57b2,null));};exports[_0xb00b('0x87')]=function(_0x57bfab,_0x2dab12){var _0x47194e={};var _0x19d24b={};var _0x52b54b;var _0x571811;return db['VoiceQueue'][_0xb00b('0x58')]({'where':{'id':_0x57bfab[_0xb00b('0x32')]['id']}})[_0xb00b('0x16')](handleEntityNotFound(_0x2dab12,null))[_0xb00b('0x16')](function(_0x344379){if(_0x344379){_0x52b54b=_0x344379;_0x19d24b[_0xb00b('0x33')]=_[_0xb00b('0x34')](db[_0xb00b('0x69')][_0xb00b('0x28')]);_0x19d24b['query']=_['keys'](_0x57bfab[_0xb00b('0x35')]);_0x19d24b[_0xb00b('0x36')]=_['intersection'](_0x19d24b[_0xb00b('0x33')],_0x19d24b['query']);_0x47194e[_0xb00b('0x38')]=_['intersection'](_0x19d24b[_0xb00b('0x33')],qs[_0xb00b('0x39')](_0x57bfab['query'][_0xb00b('0x39')]));_0x47194e[_0xb00b('0x38')]=_0x47194e['attributes'][_0xb00b('0x3a')]?_0x47194e['attributes']:_0x19d24b[_0xb00b('0x33')];_0x47194e[_0xb00b('0x55')]=qs[_0xb00b('0x4f')](_0x57bfab[_0xb00b('0x35')][_0xb00b('0x4f')]);_0x47194e[_0xb00b('0x2c')]=qs[_0xb00b('0x36')](_[_0xb00b('0x56')](_0x57bfab[_0xb00b('0x35')],_0x19d24b[_0xb00b('0x36')]));if(_0x57bfab['query']['filter']){_0x47194e[_0xb00b('0x2c')]=_['merge'](_0x47194e[_0xb00b('0x2c')],{'$or':_['map'](_0x47194e[_0xb00b('0x38')],function(_0x1600f1){var _0x58bd2a={};_0x58bd2a[_0x1600f1]={'$like':'%'+_0x57bfab[_0xb00b('0x35')]['filter']+'%'};return _0x58bd2a;})});}_0x47194e=_[_0xb00b('0x3b')]({},_0x47194e,_0x57bfab[_0xb00b('0x3c')]);return _0x52b54b['getMembers'](_0x47194e);}})[_0xb00b('0x16')](function(_0x307c52){if(_0x307c52){_0x571811=_0x307c52[_0xb00b('0x3a')];if(!_0x57bfab[_0xb00b('0x35')][_0xb00b('0x4d')]('nolimit')){_0x47194e[_0xb00b('0x12')]=qs[_0xb00b('0x12')](_0x57bfab['query']['limit']);_0x47194e[_0xb00b('0x10')]=qs['offset'](_0x57bfab['query']['offset']);}return _0x52b54b[_0xb00b('0x87')](_0x47194e);}})[_0xb00b('0x16')](function(_0x39eb7a){return _0x39eb7a?{'count':_0x571811,'rows':_0x39eb7a}:null;})[_0xb00b('0x16')](respondWithResult(_0x2dab12,null))['catch'](handleError(_0x2dab12,null));};exports[_0xb00b('0x88')]=function(_0x482fc4,_0x3232cc){var _0x89225a={};var _0x22f2f6={};var _0x459f30;var _0x5aa72a;return db[_0xb00b('0x2d')][_0xb00b('0x58')]({'where':{'id':_0x482fc4['params']['id']}})[_0xb00b('0x16')](handleEntityNotFound(_0x3232cc,null))[_0xb00b('0x16')](function(_0x4291a3){if(_0x4291a3){_0x459f30=_0x4291a3;_0x22f2f6['model']=_['keys'](db[_0xb00b('0x89')][_0xb00b('0x28')]);_0x22f2f6[_0xb00b('0x35')]=_[_0xb00b('0x34')](_0x482fc4[_0xb00b('0x35')]);_0x22f2f6[_0xb00b('0x36')]=_[_0xb00b('0x37')](_0x22f2f6['model'],_0x22f2f6['query']);_0x89225a[_0xb00b('0x38')]=_['intersection'](_0x22f2f6['model'],qs[_0xb00b('0x39')](_0x482fc4[_0xb00b('0x35')]['fields']));_0x89225a[_0xb00b('0x38')]=_0x89225a[_0xb00b('0x38')][_0xb00b('0x3a')]?_0x89225a['attributes']:_0x22f2f6[_0xb00b('0x33')];_0x89225a[_0xb00b('0x55')]=qs[_0xb00b('0x4f')](_0x482fc4[_0xb00b('0x35')][_0xb00b('0x4f')]);_0x89225a[_0xb00b('0x2c')]=qs[_0xb00b('0x36')](_['pick'](_0x482fc4[_0xb00b('0x35')],_0x22f2f6[_0xb00b('0x36')]));if(_0x482fc4['query']['filter']){_0x89225a['where']=_[_0xb00b('0x3b')](_0x89225a[_0xb00b('0x2c')],{'$or':_[_0xb00b('0x27')](_0x89225a[_0xb00b('0x38')],function(_0x3deb79){var _0x1901d1={};_0x1901d1[_0x3deb79]={'$like':'%'+_0x482fc4[_0xb00b('0x35')]['filter']+'%'};return _0x1901d1;})});}_0x89225a=_['merge']({},_0x89225a,_0x482fc4[_0xb00b('0x3c')]);return _0x459f30[_0xb00b('0x88')](_0x89225a);}})['then'](function(_0x3517d6){if(_0x3517d6){_0x5aa72a=_0x3517d6[_0xb00b('0x3a')];if(!_0x482fc4['query'][_0xb00b('0x4d')]('nolimit')){_0x89225a[_0xb00b('0x12')]=qs['limit'](_0x482fc4['query']['limit']);_0x89225a[_0xb00b('0x10')]=qs[_0xb00b('0x10')](_0x482fc4[_0xb00b('0x35')][_0xb00b('0x10')]);}return _0x459f30['getLists'](_0x89225a);}})[_0xb00b('0x16')](function(_0x481abb){if(_0x481abb){return _0x481abb?{'count':_0x5aa72a,'rows':_0x481abb}:null;}})[_0xb00b('0x16')](respondWithResult(_0x3232cc,null))[_0xb00b('0x30')](handleError(_0x3232cc,null));};exports[_0xb00b('0x8a')]=function(_0x7ecc19,_0x1cc9fb){var _0x259acf=moment()[_0xb00b('0x84')](_0xb00b('0x8b'));var _0x57834b,_0x5448bb;return db[_0xb00b('0x2d')][_0xb00b('0x20')]({'where':{'id':_0x7ecc19[_0xb00b('0x32')]['id']}})[_0xb00b('0x16')](handleEntityNotFound(_0x1cc9fb,null))[_0xb00b('0x16')](function(_0x1e0206){if(_0x1e0206){_0x5448bb=_0x1e0206;return _0x1e0206[_0xb00b('0x8a')](_0x7ecc19[_0xb00b('0x3e')][_0xb00b('0x6d')],_['omit'](_0x7ecc19[_0xb00b('0x3e')],[_0xb00b('0x6d'),'id'])||{});}return null;})[_0xb00b('0x82')](function(_0x26b234){var _0x4fe674;_0x57834b=_0x26b234||[];var _0x45ad1f=[];if(_0x26b234){for(var _0x11b817=0x0;_0x11b817<_0x26b234[_0xb00b('0x3a')];_0x11b817+=0x1){var _0x89dd0a=_0x26b234[_0x11b817][_0xb00b('0x18')]({'plain':!![]});_0x5448bb[_0xb00b('0x8c')]=_0x7ecc19[_0xb00b('0x3e')][_0xb00b('0x8c')]?_0x7ecc19[_0xb00b('0x3e')]['dialCheckDuplicateType']:_0x5448bb['dialCheckDuplicateType'];switch(_0x5448bb[_0xb00b('0x8c')]){case _0xb00b('0x8d'):_0x4fe674=squel[_0xb00b('0x8e')]()[_0xb00b('0x8f')](_0xb00b('0x90'))[_0xb00b('0x91')]([_0xb00b('0x92'),'scheduledAt',_0xb00b('0x93'),_0xb00b('0x94'),_0xb00b('0x50'),_0xb00b('0x49'),_0xb00b('0x4a')],squel[_0xb00b('0x95')]()['field'](_0xb00b('0x92'),_0xb00b('0x92'))['field']('\x27'+_0x259acf+'\x27',_0xb00b('0x96'))[_0xb00b('0x6f')]('id',_0xb00b('0x93'))[_0xb00b('0x6f')](_0x89dd0a[_0xb00b('0x97')][_0xb00b('0x78')](),'ListId')['field'](_0x7ecc19[_0xb00b('0x32')]['id']['toString'](),'VoiceQueueId')['field']('\x27'+_0x259acf+'\x27',_0xb00b('0x49'))[_0xb00b('0x6f')]('\x27'+_0x259acf+'\x27','updatedAt')['from'](_0xb00b('0x98'))[_0xb00b('0x2c')](_0xb00b('0x99'))[_0xb00b('0x2c')](_0xb00b('0x9a'),_0x89dd0a[_0xb00b('0x97')][_0xb00b('0x78')]())[_0xb00b('0x2c')](_0xb00b('0x9b'))[_0xb00b('0x2c')](_0xb00b('0x9c'),squel['select']()[_0xb00b('0x6f')](_0xb00b('0x9d'))[_0xb00b('0x71')](_0xb00b('0x9e'))[_0xb00b('0x2c')](_0xb00b('0x76'),_0x7ecc19['params']['id'][_0xb00b('0x78')]()))[_0xb00b('0x2c')](_0xb00b('0x9c'),squel[_0xb00b('0x95')]()['field']('COALESCE(phone,\x27\x27)')[_0xb00b('0x71')](_0xb00b('0x90'))[_0xb00b('0x2c')](_0xb00b('0x76'),_0x7ecc19[_0xb00b('0x32')]['id'][_0xb00b('0x78')]())))[_0xb00b('0x78')]();break;case _0xb00b('0x9f'):_0x4fe674=squel[_0xb00b('0x8e')]()[_0xb00b('0x8f')](_0xb00b('0x90'))['fromQuery']([_0xb00b('0x92'),_0xb00b('0x96'),_0xb00b('0x93'),_0xb00b('0x94'),_0xb00b('0x50'),_0xb00b('0x49'),_0xb00b('0x4a')],squel[_0xb00b('0x95')]()['field'](_0xb00b('0x92'),_0xb00b('0x92'))[_0xb00b('0x6f')]('\x27'+_0x259acf+'\x27',_0xb00b('0x96'))['field']('id','ContactId')['field'](_0x89dd0a[_0xb00b('0x97')]['toString'](),_0xb00b('0x94'))[_0xb00b('0x6f')](_0x7ecc19[_0xb00b('0x32')]['id'][_0xb00b('0x78')](),'VoiceQueueId')['field']('\x27'+_0x259acf+'\x27',_0xb00b('0x49'))['field']('\x27'+_0x259acf+'\x27','updatedAt')[_0xb00b('0x71')]('cm_contacts')[_0xb00b('0x2c')](_0xb00b('0x99'))[_0xb00b('0x2c')](_0xb00b('0x9a'),_0x89dd0a['CmListId'][_0xb00b('0x78')]())[_0xb00b('0x2c')](_0xb00b('0x9b'))[_0xb00b('0x2c')](_0xb00b('0x9c'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0xb00b('0x71')](_0xb00b('0x90'))['where'](_0xb00b('0x76'),_0x7ecc19[_0xb00b('0x32')]['id'][_0xb00b('0x78')]())))[_0xb00b('0x78')]();break;default:_0x4fe674=squel['insert']()[_0xb00b('0x8f')](_0xb00b('0x90'))[_0xb00b('0x91')]([_0xb00b('0x92'),'scheduledAt',_0xb00b('0x93'),'ListId',_0xb00b('0x50'),_0xb00b('0x49'),_0xb00b('0x4a')],squel[_0xb00b('0x95')]()[_0xb00b('0x6f')](_0xb00b('0x92'),_0xb00b('0x92'))[_0xb00b('0x6f')]('\x27'+_0x259acf+'\x27',_0xb00b('0x96'))[_0xb00b('0x6f')]('id',_0xb00b('0x93'))[_0xb00b('0x6f')](_0x89dd0a[_0xb00b('0x97')][_0xb00b('0x78')](),_0xb00b('0x94'))[_0xb00b('0x6f')](_0x7ecc19[_0xb00b('0x32')]['id']['toString'](),_0xb00b('0x50'))[_0xb00b('0x6f')]('\x27'+_0x259acf+'\x27',_0xb00b('0x49'))[_0xb00b('0x6f')]('\x27'+_0x259acf+'\x27',_0xb00b('0x4a'))['from'](_0xb00b('0x98'))[_0xb00b('0x2c')](_0xb00b('0x99'))[_0xb00b('0x2c')](_0xb00b('0x9a'),_0x89dd0a[_0xb00b('0x97')][_0xb00b('0x78')]())['where'](_0xb00b('0x9b')))['toString']();}_0x45ad1f[_0xb00b('0xa0')](db[_0xb00b('0x64')][_0xb00b('0x35')](_0x4fe674));}return BPromise['all'](_0x45ad1f);}})[_0xb00b('0x16')](function(){var _0x2bf68f=[];var _0x283ad6=squel[_0xb00b('0x8e')]()['into']('cm_hopper_additional_phones')[_0xb00b('0x91')]([_0xb00b('0xa1'),'phone',_0xb00b('0xa2'),_0xb00b('0x49'),_0xb00b('0x4a')],squel[_0xb00b('0x95')]()['field']('h.id')[_0xb00b('0x6f')](_0xb00b('0xa3'))[_0xb00b('0x6f')](_0xb00b('0xa4'))[_0xb00b('0x6f')]('\x27'+_0x259acf+'\x27',_0xb00b('0x49'))[_0xb00b('0x6f')]('\x27'+_0x259acf+'\x27',_0xb00b('0x4a'))['from'](_0xb00b('0xa5'),'ci')[_0xb00b('0x73')](_0xb00b('0x90'),'h',_0xb00b('0xa6'))[_0xb00b('0x2c')](_0xb00b('0xa7'),_0x259acf)[_0xb00b('0x2c')]('ci.ItemClass=?',_0xb00b('0xa8')))[_0xb00b('0x78')]();_0x2bf68f[_0xb00b('0xa0')](db[_0xb00b('0x64')][_0xb00b('0x35')](_0x283ad6));return BPromise[_0xb00b('0x7b')](_0x2bf68f);})[_0xb00b('0x16')](function(){return _0x57834b;})[_0xb00b('0x16')](respondWithResult(_0x1cc9fb,null))[_0xb00b('0x30')](handleError(_0x1cc9fb,null));};exports[_0xb00b('0xa9')]=function(_0x229197,_0x5ce3f3){return db[_0xb00b('0x2d')][_0xb00b('0x20')]({'where':{'id':_0x229197[_0xb00b('0x32')]['id']}})[_0xb00b('0x16')](handleEntityNotFound(_0x5ce3f3,null))[_0xb00b('0x16')](function(_0x406469){if(_0x406469){return _0x406469['removeLists'](_0x229197[_0xb00b('0x35')][_0xb00b('0x6d')]);}})[_0xb00b('0x16')](function(_0x4ffe41){if(_0x4ffe41){return db['CmHopper'][_0xb00b('0x17')]({'where':{'ListId':_0x229197['query'][_0xb00b('0x6d')],'VoiceQueueId':_0x229197[_0xb00b('0x32')]['id']}})['then'](function(){return _0x4ffe41;});}})[_0xb00b('0x16')](respondWithStatusCode(_0x5ce3f3,null))['catch'](handleError(_0x5ce3f3,null));};exports['getBlackLists']=function(_0x122be3,_0x4cb6ba){var _0x3ca253={};var _0x438281={};var _0x23b994;var _0x564934;return db[_0xb00b('0x2d')][_0xb00b('0x58')]({'where':{'id':_0x122be3[_0xb00b('0x32')]['id']}})[_0xb00b('0x16')](handleEntityNotFound(_0x4cb6ba,null))[_0xb00b('0x16')](function(_0x18f5ac){if(_0x18f5ac){_0x23b994=_0x18f5ac;_0x438281[_0xb00b('0x33')]=_['keys'](db[_0xb00b('0x89')]['rawAttributes']);_0x438281[_0xb00b('0x35')]=_[_0xb00b('0x34')](_0x122be3[_0xb00b('0x35')]);_0x438281[_0xb00b('0x36')]=_['intersection'](_0x438281[_0xb00b('0x33')],_0x438281[_0xb00b('0x35')]);_0x3ca253[_0xb00b('0x38')]=_[_0xb00b('0x37')](_0x438281[_0xb00b('0x33')],qs[_0xb00b('0x39')](_0x122be3['query'][_0xb00b('0x39')]));_0x3ca253[_0xb00b('0x38')]=_0x3ca253['attributes'][_0xb00b('0x3a')]?_0x3ca253[_0xb00b('0x38')]:_0x438281[_0xb00b('0x33')];_0x3ca253[_0xb00b('0x55')]=qs[_0xb00b('0x4f')](_0x122be3[_0xb00b('0x35')][_0xb00b('0x4f')]);_0x3ca253[_0xb00b('0x2c')]=qs[_0xb00b('0x36')](_[_0xb00b('0x56')](_0x122be3[_0xb00b('0x35')],_0x438281[_0xb00b('0x36')]));if(_0x122be3[_0xb00b('0x35')][_0xb00b('0x1b')]){_0x3ca253['where']=_['merge'](_0x3ca253['where'],{'$or':_[_0xb00b('0x27')](_0x3ca253[_0xb00b('0x38')],function(_0x966247){var _0x58b695={};_0x58b695[_0x966247]={'$like':'%'+_0x122be3[_0xb00b('0x35')][_0xb00b('0x1b')]+'%'};return _0x58b695;})});}_0x3ca253=_[_0xb00b('0x3b')]({},_0x3ca253,_0x122be3[_0xb00b('0x3c')]);return _0x23b994[_0xb00b('0xaa')](_0x3ca253);}})['then'](function(_0x1bafb2){if(_0x1bafb2){_0x564934=_0x1bafb2['length'];if(!_0x122be3['query']['hasOwnProperty'](_0xb00b('0x4e'))){_0x3ca253[_0xb00b('0x12')]=qs['limit'](_0x122be3[_0xb00b('0x35')][_0xb00b('0x12')]);_0x3ca253[_0xb00b('0x10')]=qs['offset'](_0x122be3[_0xb00b('0x35')]['offset']);}return _0x23b994[_0xb00b('0xaa')](_0x3ca253);}})[_0xb00b('0x16')](function(_0x2e3e5a){if(_0x2e3e5a){return _0x2e3e5a?{'count':_0x564934,'rows':_0x2e3e5a}:null;}})[_0xb00b('0x16')](respondWithResult(_0x4cb6ba,null))['catch'](handleError(_0x4cb6ba,null));};exports['addBlackLists']=function(_0x470c4a,_0x12cc9d){var _0xe5b66f;return db[_0xb00b('0x2d')][_0xb00b('0x20')]({'where':{'id':_0x470c4a[_0xb00b('0x32')]['id']}})['then'](handleEntityNotFound(_0x12cc9d,null))[_0xb00b('0x16')](function(_0x3afb66){if(_0x3afb66){return _0x3afb66[_0xb00b('0xab')](_0x470c4a[_0xb00b('0x3e')]['ids'],_[_0xb00b('0x48')](_0x470c4a[_0xb00b('0x3e')],[_0xb00b('0x6d'),'id'])||{});}return null;})[_0xb00b('0x82')](function(_0x379b81){var _0x46c784;_0xe5b66f=_0x379b81||[];var _0x471db4=[];if(_0x379b81){for(var _0x333bee=0x0;_0x333bee<_0x379b81['length'];_0x333bee+=0x1){var _0x1a94bf=_0x379b81[_0x333bee][_0xb00b('0x18')]({'plain':!![]});_0x46c784=squel[_0xb00b('0x8e')]()['into'](_0xb00b('0xac'))[_0xb00b('0x91')]([_0xb00b('0x92'),'ContactId',_0xb00b('0x94'),_0xb00b('0x50'),_0xb00b('0x49'),_0xb00b('0x4a')],squel[_0xb00b('0x95')]()[_0xb00b('0x6f')](_0xb00b('0x92'),'phone')[_0xb00b('0x6f')]('id',_0xb00b('0x93'))[_0xb00b('0x6f')](_0x1a94bf['CmListId'][_0xb00b('0x78')](),_0xb00b('0x94'))[_0xb00b('0x6f')](_0x470c4a[_0xb00b('0x32')]['id']['toString'](),_0xb00b('0x50'))['field'](_0xb00b('0xad'),_0xb00b('0x49'))['field'](_0xb00b('0xad'),_0xb00b('0x4a'))[_0xb00b('0x71')](_0xb00b('0x98'))[_0xb00b('0x2c')]('deletedAt\x20IS\x20NULL')['where'](_0xb00b('0x9a'),_0x1a94bf[_0xb00b('0x97')][_0xb00b('0x78')]())['where'](_0xb00b('0x9b')))[_0xb00b('0x78')]();_0x471db4[_0xb00b('0xa0')](db['sequelize'][_0xb00b('0x35')](_0x46c784));}return BPromise[_0xb00b('0x7b')](_0x471db4);}})[_0xb00b('0x16')](function(){return _0xe5b66f;})['then'](respondWithResult(_0x12cc9d,null))[_0xb00b('0x30')](handleError(_0x12cc9d,null));};exports[_0xb00b('0xae')]=function(_0x4d30c3,_0x5099fd){return db[_0xb00b('0x2d')][_0xb00b('0x20')]({'where':{'id':_0x4d30c3[_0xb00b('0x32')]['id']}})[_0xb00b('0x16')](handleEntityNotFound(_0x5099fd,null))['then'](function(_0x45b2e1){if(_0x45b2e1){return _0x45b2e1[_0xb00b('0xae')](_0x4d30c3[_0xb00b('0x35')][_0xb00b('0x6d')]);}})[_0xb00b('0x16')](function(_0x5e12dc){if(_0x5e12dc){return db[_0xb00b('0x5a')][_0xb00b('0x17')]({'where':{'ListId':_0x4d30c3[_0xb00b('0x35')][_0xb00b('0x6d')],'VoiceQueueId':_0x4d30c3[_0xb00b('0x32')]['id']}})[_0xb00b('0x16')](function(){return _0x5e12dc;});}})[_0xb00b('0x16')](respondWithStatusCode(_0x5099fd,null))[_0xb00b('0x30')](handleError(_0x5099fd,null));}; \ No newline at end of file +var _0x3e74=['phone\x20NOT\x20IN\x20(?)','cm_hopper','onlyIfOpen','insert','into','fromQuery','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','ListId\x20=\x20?','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','PHONE','removeLists','getBlackLists','addBlackLists','NOW()','removeBlackLists','moment','util','lodash','squel','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','end','json','offset','undefined','count','limit','Content-Range','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','map','value','includes','type','UserProfileResource','sendStatus','stack','name','status','send','index','VoiceQueue','rawAttributes','fieldName','key','getOptions','where','include','query','findAll','catch','show','intersection','model','attributes','fields','length','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','clone','params','keys','omit','updatedAt','createdAt','outbound','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','CmHopper','hasOwnProperty','nolimit','sort','filters','pick','VoiceQueueId','options','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','online','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','addTeams','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','User','select','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','QueryTypes','every','all','union','compact','isEmpty','userVoiceQueue:remove','addAgents','removeAgents','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','phone','scheduledAt','field','ContactId','CmListId','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?'];(function(_0x2c200d,_0x321292){var _0x1de96d=function(_0x8b5ec9){while(--_0x8b5ec9){_0x2c200d['push'](_0x2c200d['shift']());}};_0x1de96d(++_0x321292);}(_0x3e74,0x175));var _0x43e7=function(_0x504226,_0x434c5b){_0x504226=_0x504226-0x0;var _0x3dda47=_0x3e74[_0x504226];return _0x3dda47;};'use strict';var moment=require(_0x43e7('0x0'));var BPromise=require('bluebird');var util=require(_0x43e7('0x1'));var _=require(_0x43e7('0x2'));var squel=require(_0x43e7('0x3'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x43e7('0x4'))('api');var config=require(_0x43e7('0x5'));var db=require(_0x43e7('0x6'))['db'];config[_0x43e7('0x7')]=_[_0x43e7('0x8')](config[_0x43e7('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x43e7('0x9'))(new Redis(config[_0x43e7('0x7')]));require(_0x43e7('0xa'))[_0x43e7('0xb')](socket);function respondWithStatusCode(_0x21f491,_0x516b4d){_0x516b4d=_0x516b4d||0xcc;return function(_0x212c6c){if(_0x212c6c){return _0x21f491['sendStatus'](_0x516b4d);}return _0x21f491['status'](_0x516b4d)[_0x43e7('0xc')]();};}function respondWithResult(_0x4139c9,_0x5c34f4){_0x5c34f4=_0x5c34f4||0xc8;return function(_0x2803d9){if(_0x2803d9){return _0x4139c9['status'](_0x5c34f4)[_0x43e7('0xd')](_0x2803d9);}};}function respondWithFilteredResult(_0x37302c,_0x4ebc8e){return function(_0x3eb206){if(_0x3eb206){var _0xc960ea=typeof _0x4ebc8e[_0x43e7('0xe')]===_0x43e7('0xf')&&typeof _0x4ebc8e['limit']==='undefined';var _0x2fcb36=_0x3eb206[_0x43e7('0x10')];var _0x44b0bd=_0xc960ea?0x0:_0x4ebc8e['offset'];var _0x5e641c=_0xc960ea?_0x3eb206[_0x43e7('0x10')]:_0x4ebc8e[_0x43e7('0xe')]+_0x4ebc8e[_0x43e7('0x11')];var _0x328445;if(_0x5e641c>=_0x2fcb36){_0x5e641c=_0x2fcb36;_0x328445=0xc8;}else{_0x328445=0xce;}_0x37302c['status'](_0x328445);return _0x37302c['set'](_0x43e7('0x12'),_0x44b0bd+'-'+_0x5e641c+'/'+_0x2fcb36)[_0x43e7('0xd')](_0x3eb206);}return null;};}function saveUpdates(_0x273a32){return function(_0x5d346f){if(_0x5d346f){return _0x5d346f['update'](_0x273a32)[_0x43e7('0x13')](function(_0x1ca758){return _0x1ca758;});}return null;};}function removeEntity(_0x9037d3){return function(_0x140657){if(_0x140657){return _0x140657[_0x43e7('0x14')]()[_0x43e7('0x13')](function(){var _0x619236=_0x140657[_0x43e7('0x15')]({'plain':!![]});var _0x2377a3=[{'name':_0x43e7('0x16'),'value':_0x43e7('0x17'),'ignore':![]},{'name':_0x43e7('0x18'),'value':'outbound','ignore':![]}];var _0xef1a5a=_(_0x2377a3)[_0x43e7('0x19')]('ignore')[_0x43e7('0x1a')](_0x43e7('0x1b'))[_0x43e7('0x1b')]();if(_[_0x43e7('0x1c')](_0xef1a5a,_0x619236[_0x43e7('0x1d')])){return;}var _0x2f4cb4=_['find'](_0x2377a3,[_0x43e7('0x1b'),_0x619236['type']])['name'];return db[_0x43e7('0x1e')][_0x43e7('0x14')]({'where':{'type':_0x2f4cb4,'resourceId':_0x619236['id']}})['then'](function(){return _0x140657;});})[_0x43e7('0x13')](function(){_0x9037d3['status'](0xcc)[_0x43e7('0xc')]();});}};}function handleEntityNotFound(_0x5c5e67){return function(_0x1af208){if(!_0x1af208){_0x5c5e67[_0x43e7('0x1f')](0x194);}return _0x1af208;};}function handleError(_0x20888b,_0x405f85){_0x405f85=_0x405f85||0x1f4;return function(_0x51f4d7){logger['error'](_0x51f4d7[_0x43e7('0x20')]);if(_0x51f4d7['name']){delete _0x51f4d7[_0x43e7('0x21')];}_0x20888b[_0x43e7('0x22')](_0x405f85)[_0x43e7('0x23')](_0x51f4d7);};}exports[_0x43e7('0x24')]=function(_0x5087d7,_0x33a1a5){var _0x4690a6={};var _0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x1a')](db[_0x43e7('0x25')][_0x43e7('0x26')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x27')],'type':_0x31b2a6[_0x43e7('0x1d')][_0x43e7('0x28')]};});_0x4690a6=qs[_0x43e7('0x29')](_0x50f9f5,_0x5087d7);var _0x2bde44={'where':_0x4690a6[_0x43e7('0x2a')]};return db['VoiceQueue'][_0x43e7('0x10')](_0x2bde44)[_0x43e7('0x13')](function(_0x3b8f78){_0x45b675[_0x43e7('0x10')]=_0x3b8f78;_0x4690a6[_0x43e7('0x2b')]=qs['include'](_0x5087d7[_0x43e7('0x2c')]);return db[_0x43e7('0x25')][_0x43e7('0x2d')](_0x4690a6);})[_0x43e7('0x13')](function(_0x4c61b9){_0x45b675['rows']=_0x4c61b9;return _0x45b675;})['then'](respondWithFilteredResult(_0x33a1a5,_0x4690a6))[_0x43e7('0x2e')](handleError(_0x33a1a5,null));};exports[_0x43e7('0x2f')]=function(_0x117c07,_0x234fe6){var _0x108313={'raw':![],'where':{'id':_0x117c07['params']['id']}},_0xde7ed={};_0xde7ed['model']=_['keys'](db['VoiceQueue']['rawAttributes']);_0xde7ed['query']=_['keys'](_0x117c07[_0x43e7('0x2c')]);_0xde7ed['filters']=_[_0x43e7('0x30')](_0xde7ed[_0x43e7('0x31')],_0xde7ed[_0x43e7('0x2c')]);_0x108313[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0xde7ed[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x117c07['query']['fields']));_0x108313['attributes']=_0x108313[_0x43e7('0x32')][_0x43e7('0x34')]?_0x108313[_0x43e7('0x32')]:_0xde7ed[_0x43e7('0x31')];if(_0x117c07[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x108313[_0x43e7('0x2b')]=[{'all':!![]}];}_0x108313=_[_0x43e7('0x36')]({},_0x108313,_0x117c07['options']);return db[_0x43e7('0x25')][_0x43e7('0x37')](_0x108313)['then'](handleEntityNotFound(_0x234fe6,null))[_0x43e7('0x13')](respondWithResult(_0x234fe6,null))['catch'](handleError(_0x234fe6,null));};exports[_0x43e7('0x38')]=function(_0x2ad008,_0x1c6f45){return db[_0x43e7('0x25')][_0x43e7('0x38')](_0x2ad008[_0x43e7('0x39')],{})['then'](function(_0x574a93){var _0x30dfa9=_0x2ad008[_0x43e7('0x3a')][_0x43e7('0x15')]({'plain':!![]});if(!_0x30dfa9)throw new Error(_0x43e7('0x3b'));if(_0x30dfa9[_0x43e7('0x3c')]==='user'){var _0x32a451=_0x574a93[_0x43e7('0x15')]({'plain':!![]});var _0x575439=[{'name':_0x43e7('0x16'),'value':'inbound'},{'name':_0x43e7('0x18'),'value':'outbound'}];var _0x3d81ae=_[_0x43e7('0x37')](_0x575439,[_0x43e7('0x1b'),_0x32a451[_0x43e7('0x1d')]])['name'];return db['UserProfileSection'][_0x43e7('0x37')]({'where':{'name':_0x3d81ae,'userProfileId':_0x30dfa9[_0x43e7('0x3d')]},'raw':!![]})[_0x43e7('0x13')](function(_0x36b770){if(_0x36b770&&_0x36b770['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x32a451[_0x43e7('0x21')],'resourceId':_0x32a451['id'],'type':_0x36b770['name'],'sectionId':_0x36b770['id']},{})[_0x43e7('0x13')](function(){return _0x574a93;});}else{return _0x574a93;}})['catch'](function(_0x5b28db){logger[_0x43e7('0x3e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b28db);throw _0x5b28db;});}return _0x574a93;})[_0x43e7('0x13')](respondWithResult(_0x1c6f45,0xc9))[_0x43e7('0x2e')](handleError(_0x1c6f45,null));};exports[_0x43e7('0x3f')]=function(_0x99b9e1,_0x4fc5e8){var _0x91f1e4={'where':{'id':_0x99b9e1[_0x43e7('0x40')]['id']}},_0x2b9046={};_0x2b9046[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x25')]['rawAttributes']);_0x91f1e4['attributes']=_[_0x43e7('0x30')](_0x2b9046[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x99b9e1['query']['fields']));_0x91f1e4['attributes']=_0x91f1e4[_0x43e7('0x32')][_0x43e7('0x34')]?_0x91f1e4['attributes']:_0x2b9046[_0x43e7('0x31')];if(_0x99b9e1[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x91f1e4['include']=[{'all':!![]}];}_0x91f1e4=_['merge']({},_0x91f1e4,_0x99b9e1['options']);return db['VoiceQueue'][_0x43e7('0x37')](_0x91f1e4)[_0x43e7('0x13')](handleEntityNotFound(_0x4fc5e8,null))['then'](function(_0x23e7cb){if(_0x23e7cb){var _0x82d32f=_0x23e7cb[_0x43e7('0x15')]({'plain':!![]});_0x82d32f=qs[_0x43e7('0x42')](_0x82d32f,['id','createdAt',_0x43e7('0x43')]);_0x99b9e1['body']=_['omit'](_0x99b9e1[_0x43e7('0x39')],['id',_0x43e7('0x44'),_0x43e7('0x43')]);return db[_0x43e7('0x25')][_0x43e7('0x38')](_[_0x43e7('0x36')](_0x82d32f,_0x99b9e1[_0x43e7('0x39')]),{'include':_0x99b9e1[_0x43e7('0x2c')][_0x43e7('0x35')]?[{'all':!![]}]:undefined})[_0x43e7('0x13')](function(_0x58dfd0){var _0x119d34=_0x99b9e1[_0x43e7('0x3a')]['get']({'plain':!![]});if(!_0x119d34)throw new Error(_0x43e7('0x3b'));if(_0x119d34['role']===_0x43e7('0x3a')){var _0x520857=_0x58dfd0[_0x43e7('0x15')]({'plain':!![]});var _0x1f561f=[{'name':_0x43e7('0x16'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x43e7('0x45')}];var _0x2ab7ee=_[_0x43e7('0x37')](_0x1f561f,[_0x43e7('0x1b'),_0x520857[_0x43e7('0x1d')]])[_0x43e7('0x21')];return db[_0x43e7('0x46')][_0x43e7('0x37')]({'where':{'name':_0x2ab7ee,'userProfileId':_0x119d34[_0x43e7('0x3d')]},'raw':!![]})[_0x43e7('0x13')](function(_0x312306){if(_0x312306&&_0x312306['autoAssociation']===0x0){return db[_0x43e7('0x1e')][_0x43e7('0x38')]({'name':_0x520857['name'],'resourceId':_0x520857['id'],'type':_0x312306[_0x43e7('0x21')],'sectionId':_0x312306['id']},{})[_0x43e7('0x13')](function(){return _0x58dfd0;});}else{return _0x58dfd0;}})[_0x43e7('0x2e')](function(_0x558d54){logger['error'](_0x43e7('0x47'),_0x558d54);throw _0x558d54;});}return _0x58dfd0;});}})[_0x43e7('0x13')](respondWithResult(_0x4fc5e8,0xc9))['catch'](handleError(_0x4fc5e8,null));};exports[_0x43e7('0x48')]=function(_0x54506d,_0x49a6ce){if(_0x54506d[_0x43e7('0x39')]['id']){delete _0x54506d[_0x43e7('0x39')]['id'];}return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x54506d[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x49a6ce,null))[_0x43e7('0x13')](saveUpdates(_0x54506d[_0x43e7('0x39')],null))['then'](respondWithResult(_0x49a6ce,null))[_0x43e7('0x2e')](handleError(_0x49a6ce,null));};exports[_0x43e7('0x14')]=function(_0x296a0d,_0x5bb536){return db['VoiceQueue']['find']({'where':{'id':_0x296a0d[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x5bb536,null))[_0x43e7('0x13')](removeEntity(_0x5bb536,null))[_0x43e7('0x2e')](handleError(_0x5bb536,null));};exports['getHoppers']=function(_0x5a50fc,_0x1b27da){var _0x8b50bb={'raw':![],'where':{}};var _0x140438={};var _0x5dd349={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0x5a50fc[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x1b27da,null))[_0x43e7('0x13')](function(_0x3369b8){if(_0x3369b8){_0x140438[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x4a')][_0x43e7('0x26')]);_0x140438[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x5a50fc['query']);_0x140438['filters']=_[_0x43e7('0x30')](_0x140438['model'],_0x140438['query']);_0x8b50bb['attributes']=_[_0x43e7('0x30')](_0x140438[_0x43e7('0x31')],qs['fields'](_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x8b50bb[_0x43e7('0x32')]=_0x8b50bb['attributes'][_0x43e7('0x34')]?_0x8b50bb[_0x43e7('0x32')]:_0x140438[_0x43e7('0x31')];if(!_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x4b')](_0x43e7('0x4c'))){_0x8b50bb[_0x43e7('0x11')]=qs['limit'](_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x8b50bb[_0x43e7('0xe')]=qs['offset'](_0x5a50fc['query'][_0x43e7('0xe')]);}_0x8b50bb['order']=qs['sort'](_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x8b50bb['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x5a50fc[_0x43e7('0x2c')],_0x140438[_0x43e7('0x4e')]));_0x8b50bb[_0x43e7('0x2a')][_0x43e7('0x50')]=_0x3369b8['id'];if(_0x5a50fc[_0x43e7('0x2c')]['filter']){_0x8b50bb[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x8b50bb['where'],{'$or':_[_0x43e7('0x1a')](_0x8b50bb['attributes'],function(_0x26ee52){var _0x248936={};_0x248936[_0x26ee52]={'$like':'%'+_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x248936;})});}_0x8b50bb=_['merge']({},_0x8b50bb,_0x5a50fc[_0x43e7('0x51')]);return db[_0x43e7('0x4a')][_0x43e7('0x10')]({'where':_0x8b50bb['where']})[_0x43e7('0x13')](function(_0x38fa5b){_0x5dd349[_0x43e7('0x10')]=_0x38fa5b;if(_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x8b50bb['include']=[{'all':!![]}];}return db[_0x43e7('0x4a')][_0x43e7('0x2d')](_0x8b50bb);})[_0x43e7('0x13')](function(_0x2499ef){_0x5dd349[_0x43e7('0x52')]=_0x2499ef;return _0x5dd349;});}})[_0x43e7('0x13')](respondWithFilteredResult(_0x1b27da,_0x8b50bb))[_0x43e7('0x2e')](handleError(_0x1b27da,null));};exports['getHopperHistories']=function(_0x499ee9,_0x405faa){var _0x536477={'raw':!![],'where':{}};var _0x550036={};var _0x5b98bf={'count':0x0,'rows':[]};return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x499ee9[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x405faa,null))[_0x43e7('0x13')](function(_0x1ae0c8){if(_0x1ae0c8){_0x550036['model']=_[_0x43e7('0x41')](db[_0x43e7('0x53')][_0x43e7('0x26')]);_0x550036['query']=_[_0x43e7('0x41')](_0x499ee9[_0x43e7('0x2c')]);_0x550036[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x550036[_0x43e7('0x31')],_0x550036[_0x43e7('0x2c')]);_0x536477[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x550036['model'],qs['fields'](_0x499ee9['query'][_0x43e7('0x33')]));_0x536477[_0x43e7('0x32')]=_0x536477['attributes'][_0x43e7('0x34')]?_0x536477[_0x43e7('0x32')]:_0x550036[_0x43e7('0x31')];if(!_0x499ee9[_0x43e7('0x2c')]['hasOwnProperty']('nolimit')){_0x536477['limit']=qs[_0x43e7('0x11')](_0x499ee9[_0x43e7('0x2c')]['limit']);_0x536477['offset']=qs[_0x43e7('0xe')](_0x499ee9[_0x43e7('0x2c')][_0x43e7('0xe')]);}_0x536477['order']=qs[_0x43e7('0x4d')](_0x499ee9[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x536477[_0x43e7('0x2a')]=qs['filters'](_[_0x43e7('0x4f')](_0x499ee9['query'],_0x550036[_0x43e7('0x4e')]));_0x536477[_0x43e7('0x2a')][_0x43e7('0x50')]=_0x1ae0c8['id'];if(_0x499ee9[_0x43e7('0x2c')][_0x43e7('0x19')]){_0x536477[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x536477['where'],{'$or':_[_0x43e7('0x1a')](_0x536477[_0x43e7('0x32')],function(_0x1aea4e){var _0x6fb694={};_0x6fb694[_0x1aea4e]={'$like':'%'+_0x499ee9['query']['filter']+'%'};return _0x6fb694;})});}_0x536477=_['merge']({},_0x536477,_0x499ee9[_0x43e7('0x51')]);return db['CmHopperHistory'][_0x43e7('0x10')]({'where':_0x536477[_0x43e7('0x2a')]})[_0x43e7('0x13')](function(_0x7387f6){_0x5b98bf[_0x43e7('0x10')]=_0x7387f6;if(_0x499ee9[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x536477[_0x43e7('0x2b')]=[{'all':!![]}];}return db[_0x43e7('0x53')][_0x43e7('0x2d')](_0x536477);})[_0x43e7('0x13')](function(_0x5b3565){_0x5b98bf[_0x43e7('0x52')]=_0x5b3565;return _0x5b98bf;});}})[_0x43e7('0x13')](respondWithFilteredResult(_0x405faa,_0x536477))[_0x43e7('0x2e')](handleError(_0x405faa,null));};exports[_0x43e7('0x54')]=function(_0x206e54,_0x4ea4a9){var _0x5e04ec={'raw':!![],'where':{}};var _0x162a27={};var _0x3e3c82={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0x206e54[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x4ea4a9,null))['then'](function(_0x1e869a){if(_0x1e869a){_0x162a27[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x55')][_0x43e7('0x26')]);_0x162a27['query']=_['keys'](_0x206e54[_0x43e7('0x2c')]);_0x162a27[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x162a27[_0x43e7('0x31')],_0x162a27['query']);_0x5e04ec[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x162a27[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x206e54['query'][_0x43e7('0x33')]));_0x5e04ec[_0x43e7('0x32')]=_0x5e04ec[_0x43e7('0x32')][_0x43e7('0x34')]?_0x5e04ec[_0x43e7('0x32')]:_0x162a27['model'];if(!_0x206e54[_0x43e7('0x2c')][_0x43e7('0x4b')]('nolimit')){_0x5e04ec[_0x43e7('0x11')]=qs[_0x43e7('0x11')](_0x206e54[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x5e04ec['offset']=qs[_0x43e7('0xe')](_0x206e54['query'][_0x43e7('0xe')]);}_0x5e04ec[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x206e54[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x5e04ec[_0x43e7('0x2a')]=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x206e54[_0x43e7('0x2c')],_0x162a27['filters']));_0x5e04ec[_0x43e7('0x2a')][_0x43e7('0x50')]=_0x1e869a['id'];if(_0x206e54[_0x43e7('0x2c')][_0x43e7('0x19')]){_0x5e04ec['where']=_['merge'](_0x5e04ec[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x5e04ec[_0x43e7('0x32')],function(_0x4d30f7){var _0x12e7a8={};_0x12e7a8[_0x4d30f7]={'$like':'%'+_0x206e54['query']['filter']+'%'};return _0x12e7a8;})});}_0x5e04ec=_['merge']({},_0x5e04ec,_0x206e54[_0x43e7('0x51')]);return db['CmHopperFinal'][_0x43e7('0x10')]({'where':_0x5e04ec[_0x43e7('0x2a')]})[_0x43e7('0x13')](function(_0x2fea54){_0x3e3c82[_0x43e7('0x10')]=_0x2fea54;if(_0x206e54['query']['includeAll']){_0x5e04ec[_0x43e7('0x2b')]=[{'all':!![]}];}return db[_0x43e7('0x55')]['findAll'](_0x5e04ec);})[_0x43e7('0x13')](function(_0x10fd28){_0x3e3c82[_0x43e7('0x52')]=_0x10fd28;return _0x3e3c82;});}})[_0x43e7('0x13')](respondWithFilteredResult(_0x4ea4a9,_0x5e04ec))[_0x43e7('0x2e')](handleError(_0x4ea4a9,null));};exports[_0x43e7('0x57')]=function(_0x399253,_0x32e698){var _0x39ce5e={'raw':!![],'where':{}};var _0x284617={};var _0x610819={'count':0x0,'rows':[]};return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x399253[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x32e698,null))[_0x43e7('0x13')](function(_0x3286b1){if(_0x3286b1){_0x284617[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x58')][_0x43e7('0x26')]);_0x284617[_0x43e7('0x2c')]=_['keys'](_0x399253[_0x43e7('0x2c')]);_0x284617[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x284617[_0x43e7('0x31')],_0x284617['query']);_0x39ce5e[_0x43e7('0x32')]=_['intersection'](_0x284617[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x399253[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x39ce5e[_0x43e7('0x32')]=_0x39ce5e[_0x43e7('0x32')]['length']?_0x39ce5e[_0x43e7('0x32')]:_0x284617[_0x43e7('0x31')];if(!_0x399253[_0x43e7('0x2c')][_0x43e7('0x4b')](_0x43e7('0x4c'))){_0x39ce5e['limit']=qs['limit'](_0x399253[_0x43e7('0x2c')]['limit']);_0x39ce5e[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x399253[_0x43e7('0x2c')][_0x43e7('0xe')]);}_0x39ce5e['order']=qs['sort'](_0x399253['query'][_0x43e7('0x4d')]);_0x39ce5e['where']=qs['filters'](_['pick'](_0x399253[_0x43e7('0x2c')],_0x284617[_0x43e7('0x4e')]));_0x39ce5e['where'][_0x43e7('0x50')]=_0x3286b1['id'];if(_0x399253['query'][_0x43e7('0x19')]){_0x39ce5e[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x39ce5e[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x39ce5e['attributes'],function(_0x1f4162){var _0x449cb4={};_0x449cb4[_0x1f4162]={'$like':'%'+_0x399253[_0x43e7('0x2c')]['filter']+'%'};return _0x449cb4;})});}_0x39ce5e=_['merge']({},_0x39ce5e,_0x399253[_0x43e7('0x51')]);return db[_0x43e7('0x58')][_0x43e7('0x10')]({'where':_0x39ce5e[_0x43e7('0x2a')]})['then'](function(_0x385cc1){_0x610819[_0x43e7('0x10')]=_0x385cc1;if(_0x399253[_0x43e7('0x2c')]['includeAll']){_0x39ce5e[_0x43e7('0x2b')]=[{'all':!![]}];}return db[_0x43e7('0x58')][_0x43e7('0x2d')](_0x39ce5e);})[_0x43e7('0x13')](function(_0x541ce8){_0x610819[_0x43e7('0x52')]=_0x541ce8;return _0x610819;});}})['then'](respondWithFilteredResult(_0x32e698,_0x39ce5e))[_0x43e7('0x2e')](handleError(_0x32e698,null));};exports[_0x43e7('0x59')]=function(_0x47f29f,_0x4e5484){var _0xc62dc9={};var _0x1480c6={};var _0x21d001;var _0x4600e5;return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x47f29f[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x4e5484,null))[_0x43e7('0x13')](function(_0xfc577b){if(_0xfc577b){_0x21d001=_0xfc577b;_0x1480c6[_0x43e7('0x31')]=_['keys'](db[_0x43e7('0x5a')]['rawAttributes']);_0x1480c6[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x47f29f[_0x43e7('0x2c')]);_0x1480c6['filters']=_[_0x43e7('0x30')](_0x1480c6[_0x43e7('0x31')],_0x1480c6[_0x43e7('0x2c')]);_0xc62dc9[_0x43e7('0x32')]=_['intersection'](_0x1480c6[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x47f29f['query']['fields']));_0xc62dc9['attributes']=_0xc62dc9[_0x43e7('0x32')][_0x43e7('0x34')]?_0xc62dc9[_0x43e7('0x32')]:_0x1480c6[_0x43e7('0x31')];_0xc62dc9[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x47f29f[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0xc62dc9['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x47f29f[_0x43e7('0x2c')],_0x1480c6[_0x43e7('0x4e')]));if(_0x47f29f['query']['filter']){_0xc62dc9[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0xc62dc9[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0xc62dc9['attributes'],function(_0x2f529b){var _0x427cec={};_0x427cec[_0x2f529b]={'$like':'%'+_0x47f29f[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x427cec;})});}_0xc62dc9=_[_0x43e7('0x36')]({},_0xc62dc9,_0x47f29f[_0x43e7('0x51')]);return _0x21d001['getTeams'](_0xc62dc9);}})[_0x43e7('0x13')](function(_0x52c974){if(_0x52c974){_0x4600e5=_0x52c974['length'];if(!_0x47f29f[_0x43e7('0x2c')][_0x43e7('0x4b')]('nolimit')){_0xc62dc9['limit']=qs[_0x43e7('0x11')](_0x47f29f[_0x43e7('0x2c')]['limit']);_0xc62dc9[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x47f29f[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x21d001['getTeams'](_0xc62dc9);}})['then'](function(_0x2a084b){if(_0x2a084b){return _0x2a084b?{'count':_0x4600e5,'rows':_0x2a084b}:null;}})[_0x43e7('0x13')](respondWithResult(_0x4e5484,null))[_0x43e7('0x2e')](handleError(_0x4e5484,null));};exports['addTeams']=function(_0x49de67,_0x298239){var _0xf682ec=_0x49de67[_0x43e7('0x39')][_0x43e7('0x5b')];var _0x1e247f=_[_0x43e7('0x1a')](_0xf682ec,'id');return db[_0x43e7('0x5a')][_0x43e7('0x2d')]({'where':{'id':_0x1e247f},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x43e7('0x5c'),'voicePause',_0x43e7('0x5d')],'raw':!![]}]})[_0x43e7('0x13')](function(_0x44fee0){if(_0x44fee0){var _0x41d130=_[_0x43e7('0x5e')](_0x44fee0,function(_0x5e87d6){var _0x21039a=_0x5e87d6[_0x43e7('0x15')]({'plain':!![]});_0x21039a[_0x43e7('0x5f')][_0x43e7('0x60')](function(_0x59f68a){_0x59f68a[_0x43e7('0x61')]=_[_0x43e7('0x37')](_0xf682ec,{'id':_0x21039a['id']})[_0x43e7('0x61')];});return _0x21039a[_0x43e7('0x5f')];});return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x49de67[_0x43e7('0x40')]['id']}})['then'](function(_0xc9356c){return db[_0x43e7('0x62')][_0x43e7('0x63')](function(_0x3637d9){return _0xc9356c[_0x43e7('0x64')](_0x1e247f,{'transaction':_0x3637d9})['then'](function(){return BPromise[_0x43e7('0x65')](_0xf682ec,function(_0x25ddf8){return db['TeamVoiceQueue'][_0x43e7('0x66')]({'TeamId':_0x25ddf8['id'],'VoiceQueueId':_0x49de67[_0x43e7('0x40')]['id'],'penalty':_0x25ddf8['penalty']},{'transaction':_0x3637d9});});})[_0x43e7('0x13')](function(){return BPromise[_0x43e7('0x65')](_0x41d130,function(_0x110154){return db[_0x43e7('0x67')][_0x43e7('0x68')]({'where':{'UserId':_0x110154['id'],'VoiceQueueId':_0x49de67['params']['id']},'defaults':{'penalty':_0x110154[_0x43e7('0x61')]},'transaction':_0x3637d9});});})[_0x43e7('0x13')](function(){return BPromise[_0x43e7('0x65')](_['filter'](_0x41d130,{'online':!![]}),function(_0x32b788){return db[_0x43e7('0x69')]['upsert']({'membername':_0x32b788[_0x43e7('0x21')],'UserId':_0x32b788['id'],'queue_name':_0xc9356c[_0x43e7('0x21')],'VoiceQueueId':_0xc9356c['id'],'interface':_[_0x43e7('0x6a')](_0x32b788[_0x43e7('0x5d')])?util[_0x43e7('0x6b')](_0x43e7('0x6c'),_0x32b788['name']):_0x32b788[_0x43e7('0x5d')],'paused':_0x32b788[_0x43e7('0x6d')]||![],'penalty':_0x32b788[_0x43e7('0x61')]},{'transaction':_0x3637d9});});})['then'](function(){_0x41d130[_0x43e7('0x60')](function(_0x21901c){socket[_0x43e7('0x6e')](_0x43e7('0x6f'),{'UserId':_0x21901c['id'],'VoiceQueueId':_0xc9356c['id']});});});});});}})[_0x43e7('0x13')](respondWithStatusCode(_0x298239,null))[_0x43e7('0x2e')](handleError(_0x298239,null));};exports[_0x43e7('0x70')]=function(_0x1896b3,_0x4345a5){return db['Team'][_0x43e7('0x2d')]({'where':{'id':_0x1896b3[_0x43e7('0x2c')][_0x43e7('0x71')]},'attributes':['id'],'include':[{'model':db[_0x43e7('0x72')],'as':_0x43e7('0x5f'),'attributes':['id'],'raw':!![]}]})[_0x43e7('0x13')](handleEntityNotFound(_0x4345a5,null))[_0x43e7('0x13')](function(_0x3e8631){var _0x51e17c=_[_0x43e7('0x1a')](_0x3e8631,'id');var _0x6246c4=[];var _0xd0dca2=[];var _0xa721ba=squel[_0x43e7('0x73')]();_0xa721ba['field'](_0x43e7('0x74'))[_0x43e7('0x75')](_0x43e7('0x76'),'tq')[_0x43e7('0x77')](_0x43e7('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x43e7('0x2a')]('VoiceQueueId\x20=\x20?',_0x1896b3[_0x43e7('0x40')]['id']);for(var _0x339826=0x0;_0x339826<_0x3e8631[_0x43e7('0x34')];_0x339826+=0x1){let _0xc28ac6=_0x3e8631[_0x339826];for(var _0x4b0abd=0x0;_0x4b0abd<_0xc28ac6[_0x43e7('0x5f')][_0x43e7('0x34')];_0x4b0abd+=0x1){let _0x41d636=_0xc28ac6[_0x43e7('0x5f')][_0x4b0abd];var _0x19bdf7=_0xa721ba[_0x43e7('0x3f')]();_0x19bdf7[_0x43e7('0x2a')](_0x43e7('0x79'),_0x41d636['id']);_0xd0dca2[_0x43e7('0x7a')](db[_0x43e7('0x62')][_0x43e7('0x2c')](_0x19bdf7['toString'](),{'type':db['sequelize'][_0x43e7('0x7b')]['SELECT']})['then'](function(_0x4a0d5d){if(_0x4a0d5d[_0x43e7('0x34')]===0x1){return _0x41d636['id'];}else{var _0x5eae45=_[_0x43e7('0x7c')](_['map'](_0x4a0d5d,'TeamId'),function(_0x55f1df){return _[_0x43e7('0x1c')](_0x51e17c,_0x55f1df);});if(_0x5eae45){return _0x41d636['id'];}}}));}}return BPromise[_0x43e7('0x7d')](_0xd0dca2)[_0x43e7('0x13')](function(_0xd6ebb0){_0x6246c4=_(_0x6246c4)[_0x43e7('0x7e')](_0xd6ebb0)[_0x43e7('0x7f')]()[_0x43e7('0x1b')]();return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x1896b3[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](function(_0x2a1218){return db[_0x43e7('0x62')][_0x43e7('0x63')](function(_0xe14e67){return _0x2a1218[_0x43e7('0x70')](_0x1896b3[_0x43e7('0x2c')][_0x43e7('0x71')],{'transaction':_0xe14e67})[_0x43e7('0x13')](function(){if(!_[_0x43e7('0x80')](_0x6246c4)){return _0x2a1218['removeAgents'](_0x6246c4,{'transaction':_0xe14e67})[_0x43e7('0x13')](function(){return db[_0x43e7('0x69')]['destroy']({'where':{'VoiceQueueId':_0x1896b3[_0x43e7('0x40')]['id'],'UserId':_0x6246c4},'transaction':_0xe14e67});});}})[_0x43e7('0x13')](function(){_0x6246c4[_0x43e7('0x60')](function(_0x32b33c){socket['emit'](_0x43e7('0x81'),{'UserId':_0x32b33c,'VoiceQueueId':_0x2a1218['id']});});});});});});})[_0x43e7('0x13')](respondWithStatusCode(_0x4345a5,null))['catch'](handleError(_0x4345a5,null));};exports[_0x43e7('0x82')]=function(_0x1a520e,_0xb4cf23){var _0x559145,_0x22b824;return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x1a520e[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0xb4cf23,null))['then'](function(_0x33b63b){if(_0x33b63b){_0x22b824=_0x33b63b;return _0x33b63b[_0x43e7('0x82')](_0x1a520e['body'][_0x43e7('0x71')],_['omit'](_0x1a520e['body'],['ids','id'])||{})['spread'](function(_0x255113){for(var _0x451fb5=0x0;_0x451fb5<_0x1a520e[_0x43e7('0x39')][_0x43e7('0x71')]['length'];_0x451fb5+=0x1){socket['emit'](_0x43e7('0x6f'),{'UserId':Number(_0x1a520e['body'][_0x43e7('0x71')][_0x451fb5]),'VoiceQueueId':Number(_0x1a520e['params']['id'])});}return _0x255113;});}})[_0x43e7('0x13')](function(_0x4cf7e9){_0x559145=_0x4cf7e9||[];if(_0x22b824){return db['User']['findAll']({'where':{'id':_0x1a520e['body'][_0x43e7('0x71')]},'attributes':['id',_0x43e7('0x21'),_0x43e7('0x5c'),'voicePause',_0x43e7('0x5d')],'raw':!![]});}})[_0x43e7('0x13')](function(_0x517289){if(!_['isEmpty'](_0x517289)){var _0x25fd39=[];for(var _0xb2aca0=0x0;_0xb2aca0<_0x517289[_0x43e7('0x34')];_0xb2aca0++){if(_0x517289[_0xb2aca0][_0x43e7('0x5c')]){_0x25fd39['push'](db[_0x43e7('0x69')]['upsert']({'membername':_0x517289[_0xb2aca0][_0x43e7('0x21')],'UserId':_0x517289[_0xb2aca0]['id'],'queue_name':_0x22b824[_0x43e7('0x21')],'VoiceQueueId':_0x22b824['id'],'interface':_[_0x43e7('0x6a')](_0x517289[_0xb2aca0][_0x43e7('0x5d')])?util[_0x43e7('0x6b')](_0x43e7('0x6c'),_0x517289[_0xb2aca0][_0x43e7('0x21')]):_0x517289[_0xb2aca0]['interface'],'paused':_0x517289[_0xb2aca0][_0x43e7('0x6d')]||![],'penalty':_0x1a520e[_0x43e7('0x39')]['penalty']||0x0}));}}return BPromise[_0x43e7('0x7d')](_0x25fd39);}})[_0x43e7('0x13')](function(){return _0x559145;})[_0x43e7('0x13')](respondWithResult(_0xb4cf23,null))[_0x43e7('0x2e')](handleError(_0xb4cf23,null));};exports[_0x43e7('0x83')]=function(_0x4fd17e,_0x3fd573){return db['VoiceQueue'][_0x43e7('0x37')]({'where':{'id':_0x4fd17e['params']['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x3fd573,null))[_0x43e7('0x13')](function(_0x4446cb){if(_0x4446cb){return _0x4446cb[_0x43e7('0x83')](_0x4fd17e[_0x43e7('0x2c')]['ids'])[_0x43e7('0x13')](function(){if(_['isArray'](_0x4fd17e[_0x43e7('0x2c')][_0x43e7('0x71')])){for(var _0x34d476=0x0;_0x34d476<_0x4fd17e['query'][_0x43e7('0x71')][_0x43e7('0x34')];_0x34d476+=0x1){socket[_0x43e7('0x6e')](_0x43e7('0x81'),{'UserId':Number(_0x4fd17e[_0x43e7('0x2c')]['ids'][_0x34d476]),'VoiceQueueId':Number(_0x4fd17e[_0x43e7('0x40')]['id'])});}}else{socket['emit'](_0x43e7('0x81'),{'UserId':Number(_0x4fd17e[_0x43e7('0x2c')][_0x43e7('0x71')]),'VoiceQueueId':Number(_0x4fd17e[_0x43e7('0x40')]['id'])});}});}})[_0x43e7('0x13')](function(_0x34ed9e){return db[_0x43e7('0x69')]['destroy']({'where':{'VoiceQueueId':_0x4fd17e[_0x43e7('0x40')]['id'],'UserId':_0x4fd17e['query'][_0x43e7('0x71')]}})[_0x43e7('0x13')](function(){return _0x34ed9e;});})[_0x43e7('0x13')](respondWithStatusCode(_0x3fd573,null))[_0x43e7('0x2e')](handleError(_0x3fd573,null));};exports[_0x43e7('0x84')]=function(_0xf9178f,_0x3bb7ab){var _0x2be8c7={};var _0x2bb14d={};var _0x57f7ea;var _0x240478;return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0xf9178f[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x3bb7ab,null))[_0x43e7('0x13')](function(_0x381e47){if(_0x381e47){_0x57f7ea=_0x381e47;_0x2bb14d['model']=_[_0x43e7('0x41')](db[_0x43e7('0x72')][_0x43e7('0x26')]);_0x2bb14d[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0xf9178f[_0x43e7('0x2c')]);_0x2bb14d[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x2bb14d['model'],_0x2bb14d[_0x43e7('0x2c')]);_0x2be8c7[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x2bb14d['model'],qs[_0x43e7('0x33')](_0xf9178f[_0x43e7('0x2c')]['fields']));_0x2be8c7[_0x43e7('0x32')]=_0x2be8c7[_0x43e7('0x32')]['length']?_0x2be8c7[_0x43e7('0x32')]:_0x2bb14d[_0x43e7('0x31')];_0x2be8c7[_0x43e7('0x56')]=qs['sort'](_0xf9178f[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x2be8c7['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0xf9178f[_0x43e7('0x2c')],_0x2bb14d[_0x43e7('0x4e')]));if(_0xf9178f['query']['filter']){_0x2be8c7[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x2be8c7[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x2be8c7['attributes'],function(_0x1e6245){var _0x36860d={};_0x36860d[_0x1e6245]={'$like':'%'+_0xf9178f[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x36860d;})});}_0x2be8c7=_['merge']({},_0x2be8c7,_0xf9178f[_0x43e7('0x51')]);return _0x57f7ea[_0x43e7('0x84')](_0x2be8c7);}})[_0x43e7('0x13')](function(_0x3ff5d6){if(_0x3ff5d6){_0x240478=_0x3ff5d6[_0x43e7('0x34')];if(!_0xf9178f['query']['hasOwnProperty']('nolimit')){_0x2be8c7[_0x43e7('0x11')]=qs[_0x43e7('0x11')](_0xf9178f[_0x43e7('0x2c')]['limit']);_0x2be8c7[_0x43e7('0xe')]=qs['offset'](_0xf9178f[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x57f7ea[_0x43e7('0x84')](_0x2be8c7);}})[_0x43e7('0x13')](function(_0x249a8d){if(_0x249a8d){return _0x249a8d?{'count':_0x240478,'rows':_0x249a8d}:null;}})[_0x43e7('0x13')](respondWithResult(_0x3bb7ab,null))['catch'](handleError(_0x3bb7ab,null));};exports[_0x43e7('0x85')]=function(_0x202421,_0x12e4a3){var _0x16ca0e={};var _0x2f467b={};var _0x7f43b5;var _0x4637f6;return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x202421[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x12e4a3,null))[_0x43e7('0x13')](function(_0x24e9a7){if(_0x24e9a7){_0x7f43b5=_0x24e9a7;_0x2f467b['model']=_[_0x43e7('0x41')](db[_0x43e7('0x69')]['rawAttributes']);_0x2f467b[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x202421['query']);_0x2f467b[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x2f467b[_0x43e7('0x31')],_0x2f467b['query']);_0x16ca0e['attributes']=_[_0x43e7('0x30')](_0x2f467b[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x202421[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x16ca0e[_0x43e7('0x32')]=_0x16ca0e[_0x43e7('0x32')][_0x43e7('0x34')]?_0x16ca0e['attributes']:_0x2f467b[_0x43e7('0x31')];_0x16ca0e[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x202421[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x16ca0e[_0x43e7('0x2a')]=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x202421[_0x43e7('0x2c')],_0x2f467b[_0x43e7('0x4e')]));if(_0x202421[_0x43e7('0x2c')][_0x43e7('0x19')]){_0x16ca0e['where']=_[_0x43e7('0x36')](_0x16ca0e[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x16ca0e[_0x43e7('0x32')],function(_0x49f43c){var _0xad02f6={};_0xad02f6[_0x49f43c]={'$like':'%'+_0x202421['query'][_0x43e7('0x19')]+'%'};return _0xad02f6;})});}_0x16ca0e=_['merge']({},_0x16ca0e,_0x202421[_0x43e7('0x51')]);return _0x7f43b5[_0x43e7('0x85')](_0x16ca0e);}})[_0x43e7('0x13')](function(_0x4a500c){if(_0x4a500c){_0x4637f6=_0x4a500c[_0x43e7('0x34')];if(!_0x202421[_0x43e7('0x2c')]['hasOwnProperty'](_0x43e7('0x4c'))){_0x16ca0e['limit']=qs[_0x43e7('0x11')](_0x202421[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x16ca0e[_0x43e7('0xe')]=qs['offset'](_0x202421[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x7f43b5[_0x43e7('0x85')](_0x16ca0e);}})['then'](function(_0x12c4f9){return _0x12c4f9?{'count':_0x4637f6,'rows':_0x12c4f9}:null;})[_0x43e7('0x13')](respondWithResult(_0x12e4a3,null))[_0x43e7('0x2e')](handleError(_0x12e4a3,null));};exports[_0x43e7('0x86')]=function(_0x77c2f,_0x1e4a25){var _0x5790b5={};var _0x3f057e={};var _0x505287;var _0x221938;return db[_0x43e7('0x25')]['findOne']({'where':{'id':_0x77c2f[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x1e4a25,null))['then'](function(_0x46aa47){if(_0x46aa47){_0x505287=_0x46aa47;_0x3f057e[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x87')]['rawAttributes']);_0x3f057e['query']=_[_0x43e7('0x41')](_0x77c2f[_0x43e7('0x2c')]);_0x3f057e[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x3f057e[_0x43e7('0x31')],_0x3f057e[_0x43e7('0x2c')]);_0x5790b5[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x3f057e['model'],qs[_0x43e7('0x33')](_0x77c2f[_0x43e7('0x2c')]['fields']));_0x5790b5[_0x43e7('0x32')]=_0x5790b5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x5790b5[_0x43e7('0x32')]:_0x3f057e[_0x43e7('0x31')];_0x5790b5[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x77c2f['query'][_0x43e7('0x4d')]);_0x5790b5['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x77c2f['query'],_0x3f057e[_0x43e7('0x4e')]));if(_0x77c2f['query'][_0x43e7('0x19')]){_0x5790b5[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x5790b5['where'],{'$or':_['map'](_0x5790b5[_0x43e7('0x32')],function(_0xcfecd2){var _0x4cd879={};_0x4cd879[_0xcfecd2]={'$like':'%'+_0x77c2f[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x4cd879;})});}_0x5790b5=_[_0x43e7('0x36')]({},_0x5790b5,_0x77c2f['options']);return _0x505287[_0x43e7('0x86')](_0x5790b5);}})[_0x43e7('0x13')](function(_0xb2eb62){if(_0xb2eb62){_0x221938=_0xb2eb62['length'];if(!_0x77c2f[_0x43e7('0x2c')][_0x43e7('0x4b')](_0x43e7('0x4c'))){_0x5790b5[_0x43e7('0x11')]=qs[_0x43e7('0x11')](_0x77c2f[_0x43e7('0x2c')]['limit']);_0x5790b5[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x77c2f[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x505287[_0x43e7('0x86')](_0x5790b5);}})[_0x43e7('0x13')](function(_0x34ab5a){if(_0x34ab5a){return _0x34ab5a?{'count':_0x221938,'rows':_0x34ab5a}:null;}})[_0x43e7('0x13')](respondWithResult(_0x1e4a25,null))[_0x43e7('0x2e')](handleError(_0x1e4a25,null));};exports[_0x43e7('0x88')]=function(_0x13133c,_0x288d6a){var _0x47ef9d=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x56598f,_0x280668;return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x13133c[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x288d6a,null))[_0x43e7('0x13')](function(_0x51dc07){if(_0x51dc07){_0x280668=_0x51dc07;return _0x51dc07['addLists'](_0x13133c[_0x43e7('0x39')][_0x43e7('0x71')],_['omit'](_0x13133c['body'],[_0x43e7('0x71'),'id'])||{});}return null;})[_0x43e7('0x89')](function(_0x58a783){var _0x3d6659;_0x56598f=_0x58a783||[];var _0x57bcab=[];if(_0x58a783){for(var _0x5f4023=0x0;_0x5f4023<_0x58a783[_0x43e7('0x34')];_0x5f4023+=0x1){var _0x2be66d=_0x58a783[_0x5f4023]['get']({'plain':!![]});_0x280668['dialCheckDuplicateType']=_0x13133c[_0x43e7('0x39')][_0x43e7('0x8a')]?_0x13133c[_0x43e7('0x39')][_0x43e7('0x8a')]:_0x280668['dialCheckDuplicateType'];switch(_0x280668[_0x43e7('0x8a')]){case _0x43e7('0x8b'):_0x3d6659=squel['insert']()['into']('cm_hopper')['fromQuery']([_0x43e7('0x8c'),_0x43e7('0x8d'),'ContactId','ListId',_0x43e7('0x50'),_0x43e7('0x44'),_0x43e7('0x43')],squel[_0x43e7('0x73')]()[_0x43e7('0x8e')]('phone',_0x43e7('0x8c'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x8d'))[_0x43e7('0x8e')]('id',_0x43e7('0x8f'))['field'](_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')](),_0x43e7('0x92'))[_0x43e7('0x8e')](_0x13133c['params']['id'][_0x43e7('0x91')](),_0x43e7('0x50'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x44'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))['from'](_0x43e7('0x93'))[_0x43e7('0x2a')](_0x43e7('0x94'))[_0x43e7('0x2a')]('ListId\x20=\x20?',_0x2be66d[_0x43e7('0x90')]['toString']())[_0x43e7('0x2a')]('phone\x20IS\x20NOT\x20NULL')[_0x43e7('0x2a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x43e7('0x73')]()['field'](_0x43e7('0x95'))[_0x43e7('0x75')](_0x43e7('0x96'))[_0x43e7('0x2a')](_0x43e7('0x97'),_0x13133c[_0x43e7('0x40')]['id'][_0x43e7('0x91')]()))[_0x43e7('0x2a')](_0x43e7('0x98'),squel[_0x43e7('0x73')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x43e7('0x99'))['where']('VoiceQueueId\x20=\x20?',_0x13133c[_0x43e7('0x40')]['id'][_0x43e7('0x91')]())))[_0x43e7('0x91')]();break;case _0x43e7('0x9a'):_0x3d6659=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')](_0x43e7('0x99'))[_0x43e7('0x9d')]([_0x43e7('0x8c'),_0x43e7('0x8d'),_0x43e7('0x8f'),'ListId',_0x43e7('0x50'),_0x43e7('0x44'),_0x43e7('0x43')],squel['select']()[_0x43e7('0x8e')](_0x43e7('0x8c'),_0x43e7('0x8c'))['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x8d'))[_0x43e7('0x8e')]('id',_0x43e7('0x8f'))[_0x43e7('0x8e')](_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')](),_0x43e7('0x92'))['field'](_0x13133c['params']['id'][_0x43e7('0x91')](),_0x43e7('0x50'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27','createdAt')['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))['from'](_0x43e7('0x93'))['where'](_0x43e7('0x94'))[_0x43e7('0x2a')]('ListId\x20=\x20?',_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')]())[_0x43e7('0x2a')](_0x43e7('0x9e'))['where'](_0x43e7('0x98'),squel[_0x43e7('0x73')]()[_0x43e7('0x8e')](_0x43e7('0x9f'))['from']('cm_hopper')[_0x43e7('0x2a')]('VoiceQueueId\x20=\x20?',_0x13133c['params']['id'][_0x43e7('0x91')]())))[_0x43e7('0x91')]();break;default:_0x3d6659=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')]('cm_hopper')[_0x43e7('0x9d')]([_0x43e7('0x8c'),_0x43e7('0x8d'),_0x43e7('0x8f'),_0x43e7('0x92'),_0x43e7('0x50'),'createdAt','updatedAt'],squel[_0x43e7('0x73')]()[_0x43e7('0x8e')](_0x43e7('0x8c'),_0x43e7('0x8c'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x8d'))['field']('id',_0x43e7('0x8f'))[_0x43e7('0x8e')](_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')](),'ListId')[_0x43e7('0x8e')](_0x13133c['params']['id'][_0x43e7('0x91')](),_0x43e7('0x50'))['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x44'))['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))[_0x43e7('0x75')]('cm_contacts')[_0x43e7('0x2a')](_0x43e7('0x94'))[_0x43e7('0x2a')](_0x43e7('0xa0'),_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')]())[_0x43e7('0x2a')](_0x43e7('0x9e')))[_0x43e7('0x91')]();}_0x57bcab['push'](db['sequelize'][_0x43e7('0x2c')](_0x3d6659));}return BPromise[_0x43e7('0x7d')](_0x57bcab);}})[_0x43e7('0x13')](function(){var _0x3ac223=[];var _0x486780=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')](_0x43e7('0xa1'))[_0x43e7('0x9d')]([_0x43e7('0xa2'),_0x43e7('0x8c'),_0x43e7('0xa3'),'createdAt',_0x43e7('0x43')],squel['select']()['field']('h.id')[_0x43e7('0x8e')](_0x43e7('0xa4'))[_0x43e7('0x8e')](_0x43e7('0xa5'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27','createdAt')['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))['from'](_0x43e7('0xa6'),'ci')['join'](_0x43e7('0x99'),'h',_0x43e7('0xa7'))[_0x43e7('0x2a')](_0x43e7('0xa8'),_0x47ef9d)['where']('ci.ItemClass=?',_0x43e7('0xa9')))[_0x43e7('0x91')]();_0x3ac223['push'](db['sequelize'][_0x43e7('0x2c')](_0x486780));return BPromise[_0x43e7('0x7d')](_0x3ac223);})[_0x43e7('0x13')](function(){return _0x56598f;})[_0x43e7('0x13')](respondWithResult(_0x288d6a,null))[_0x43e7('0x2e')](handleError(_0x288d6a,null));};exports[_0x43e7('0xaa')]=function(_0x71807e,_0x314259){return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x71807e['params']['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x314259,null))[_0x43e7('0x13')](function(_0x2613fc){if(_0x2613fc){return _0x2613fc[_0x43e7('0xaa')](_0x71807e['query'][_0x43e7('0x71')]);}})['then'](function(_0x17b298){if(_0x17b298){return db[_0x43e7('0x4a')][_0x43e7('0x14')]({'where':{'ListId':_0x71807e[_0x43e7('0x2c')]['ids'],'VoiceQueueId':_0x71807e['params']['id']}})[_0x43e7('0x13')](function(){return _0x17b298;});}})['then'](respondWithStatusCode(_0x314259,null))[_0x43e7('0x2e')](handleError(_0x314259,null));};exports[_0x43e7('0xab')]=function(_0x44c536,_0x3a9550){var _0x5dcd3f={};var _0x2e7f00={};var _0x2627e2;var _0x591517;return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0x44c536[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x3a9550,null))[_0x43e7('0x13')](function(_0x5e042f){if(_0x5e042f){_0x2627e2=_0x5e042f;_0x2e7f00['model']=_[_0x43e7('0x41')](db[_0x43e7('0x87')][_0x43e7('0x26')]);_0x2e7f00[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x44c536[_0x43e7('0x2c')]);_0x2e7f00[_0x43e7('0x4e')]=_['intersection'](_0x2e7f00[_0x43e7('0x31')],_0x2e7f00[_0x43e7('0x2c')]);_0x5dcd3f[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x2e7f00[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x44c536[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x5dcd3f[_0x43e7('0x32')]=_0x5dcd3f[_0x43e7('0x32')][_0x43e7('0x34')]?_0x5dcd3f[_0x43e7('0x32')]:_0x2e7f00[_0x43e7('0x31')];_0x5dcd3f[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x44c536[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x5dcd3f['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x44c536[_0x43e7('0x2c')],_0x2e7f00[_0x43e7('0x4e')]));if(_0x44c536[_0x43e7('0x2c')]['filter']){_0x5dcd3f[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x5dcd3f[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x5dcd3f[_0x43e7('0x32')],function(_0x5278fd){var _0x84b4f4={};_0x84b4f4[_0x5278fd]={'$like':'%'+_0x44c536['query']['filter']+'%'};return _0x84b4f4;})});}_0x5dcd3f=_['merge']({},_0x5dcd3f,_0x44c536[_0x43e7('0x51')]);return _0x2627e2[_0x43e7('0xab')](_0x5dcd3f);}})[_0x43e7('0x13')](function(_0x4ee587){if(_0x4ee587){_0x591517=_0x4ee587[_0x43e7('0x34')];if(!_0x44c536[_0x43e7('0x2c')]['hasOwnProperty'](_0x43e7('0x4c'))){_0x5dcd3f[_0x43e7('0x11')]=qs['limit'](_0x44c536[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x5dcd3f[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x44c536[_0x43e7('0x2c')]['offset']);}return _0x2627e2[_0x43e7('0xab')](_0x5dcd3f);}})[_0x43e7('0x13')](function(_0x3b641e){if(_0x3b641e){return _0x3b641e?{'count':_0x591517,'rows':_0x3b641e}:null;}})[_0x43e7('0x13')](respondWithResult(_0x3a9550,null))[_0x43e7('0x2e')](handleError(_0x3a9550,null));};exports['addBlackLists']=function(_0x5b046d,_0x4a0427){var _0xc3460c;return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x5b046d[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x4a0427,null))[_0x43e7('0x13')](function(_0x19c1d2){if(_0x19c1d2){return _0x19c1d2[_0x43e7('0xac')](_0x5b046d['body'][_0x43e7('0x71')],_['omit'](_0x5b046d[_0x43e7('0x39')],[_0x43e7('0x71'),'id'])||{});}return null;})[_0x43e7('0x89')](function(_0x40cc83){var _0x148d72;_0xc3460c=_0x40cc83||[];var _0x1ceb94=[];if(_0x40cc83){for(var _0x19c29b=0x0;_0x19c29b<_0x40cc83[_0x43e7('0x34')];_0x19c29b+=0x1){var _0x38a8db=_0x40cc83[_0x19c29b]['get']({'plain':!![]});_0x148d72=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')]('cm_hopper_black')['fromQuery']([_0x43e7('0x8c'),_0x43e7('0x8f'),_0x43e7('0x92'),_0x43e7('0x50'),_0x43e7('0x44'),_0x43e7('0x43')],squel[_0x43e7('0x73')]()[_0x43e7('0x8e')](_0x43e7('0x8c'),_0x43e7('0x8c'))[_0x43e7('0x8e')]('id','ContactId')[_0x43e7('0x8e')](_0x38a8db['CmListId'][_0x43e7('0x91')](),_0x43e7('0x92'))[_0x43e7('0x8e')](_0x5b046d[_0x43e7('0x40')]['id']['toString'](),_0x43e7('0x50'))[_0x43e7('0x8e')]('NOW()',_0x43e7('0x44'))[_0x43e7('0x8e')](_0x43e7('0xad'),_0x43e7('0x43'))[_0x43e7('0x75')](_0x43e7('0x93'))[_0x43e7('0x2a')]('deletedAt\x20IS\x20NULL')[_0x43e7('0x2a')](_0x43e7('0xa0'),_0x38a8db[_0x43e7('0x90')][_0x43e7('0x91')]())[_0x43e7('0x2a')](_0x43e7('0x9e')))[_0x43e7('0x91')]();_0x1ceb94[_0x43e7('0x7a')](db[_0x43e7('0x62')]['query'](_0x148d72));}return BPromise[_0x43e7('0x7d')](_0x1ceb94);}})['then'](function(){return _0xc3460c;})[_0x43e7('0x13')](respondWithResult(_0x4a0427,null))[_0x43e7('0x2e')](handleError(_0x4a0427,null));};exports[_0x43e7('0xae')]=function(_0x1dc579,_0x6d9fb){return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x1dc579['params']['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x6d9fb,null))['then'](function(_0x59ca95){if(_0x59ca95){return _0x59ca95[_0x43e7('0xae')](_0x1dc579['query']['ids']);}})[_0x43e7('0x13')](function(_0x759eb5){if(_0x759eb5){return db[_0x43e7('0x58')][_0x43e7('0x14')]({'where':{'ListId':_0x1dc579['query'][_0x43e7('0x71')],'VoiceQueueId':_0x1dc579['params']['id']}})[_0x43e7('0x13')](function(){return _0x759eb5;});}})[_0x43e7('0x13')](respondWithStatusCode(_0x6d9fb,null))[_0x43e7('0x2e')](handleError(_0x6d9fb,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 426b094..0c5cad9 100644 --- a/server/api/voiceQueue/voiceQueue.events.js +++ b/server/api/voiceQueue/voiceQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05dc=['events','../../mysqldb','VoiceQueue','update','remove','emit','hook','exports'];(function(_0x304322,_0x4a7ed3){var _0x317a2f=function(_0x22d280){while(--_0x22d280){_0x304322['push'](_0x304322['shift']());}};_0x317a2f(++_0x4a7ed3);}(_0x05dc,0x120));var _0xc05d=function(_0x3495b7,_0x3054fd){_0x3495b7=_0x3495b7-0x0;var _0x55eff5=_0x05dc[_0x3495b7];return _0x55eff5;};'use strict';var EventEmitter=require(_0xc05d('0x0'));var VoiceQueue=require(_0xc05d('0x1'))['db'][_0xc05d('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc05d('0x3'),'afterDestroy':_0xc05d('0x4')};function emitEvent(_0x55588f){return function(_0x109291,_0x2e45d5,_0x55af0d){VoiceQueueEvents[_0xc05d('0x5')](_0x55588f+':'+_0x109291['id'],_0x109291);VoiceQueueEvents[_0xc05d('0x5')](_0x55588f,_0x109291);_0x55af0d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xc05d('0x6')](e,emitEvent(event));}}module[_0xc05d('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0xf866=['VoiceQueue','setMaxListeners','save','remove','emit','hook','events'];(function(_0x32f9ca,_0x2fa8bc){var _0x52e083=function(_0x4fd86a){while(--_0x4fd86a){_0x32f9ca['push'](_0x32f9ca['shift']());}};_0x52e083(++_0x2fa8bc);}(_0xf866,0x1e2));var _0x6f86=function(_0x32c1e8,_0x1bf7d1){_0x32c1e8=_0x32c1e8-0x0;var _0x46d9d4=_0xf866[_0x32c1e8];return _0x46d9d4;};'use strict';var EventEmitter=require(_0x6f86('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x6f86('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x6f86('0x2')](0x0);var events={'afterCreate':_0x6f86('0x3'),'afterUpdate':'update','afterDestroy':_0x6f86('0x4')};function emitEvent(_0x37c457){return function(_0x5d3307,_0x1016e4,_0x177885){VoiceQueueEvents[_0x6f86('0x5')](_0x37c457+':'+_0x5d3307['id'],_0x5d3307);VoiceQueueEvents[_0x6f86('0x5')](_0x37c457,_0x5d3307);_0x177885(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x6f86('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index fe38a2f..654dcaf 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x55ca,0x126));var _0xa55c=function(_0x519869,_0x5e9535){_0x519869=_0x519869-0x0;var _0x26f819=_0x55ca[_0x519869];return _0x26f819;};'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 +var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x400fae,_0x437273){var _0x5b100a=function(_0x10192){while(--_0x10192){_0x400fae['push'](_0x400fae['shift']());}};_0x5b100a(++_0x437273);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 0ac46e0..15e5276 100644 --- a/server/api/voiceQueue/voiceQueue.rpc.js +++ b/server/api/voiceQueue/voiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7300=['request','then','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','VoiceQueue','findAll','options','raw','where','limit','include','map','model','attributes','info','GetVoiceQueue','find','ShowVoiceQueue','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register'];(function(_0x8c2a7d,_0xc7b745){var _0x1ad9bb=function(_0x22535a){while(--_0x22535a){_0x8c2a7d['push'](_0x8c2a7d['shift']());}};_0x1ad9bb(++_0xc7b745);}(_0x7300,0x91));var _0x0730=function(_0x5f4556,_0x2a3b1f){_0x5f4556=_0x5f4556-0x0;var _0x20ada3=_0x7300[_0x5f4556];return _0x20ada3;};'use strict';var _=require(_0x0730('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0730('0x1'));var fs=require('fs');var Redis=require(_0x0730('0x2'));var db=require(_0x0730('0x3'))['db'];var utils=require(_0x0730('0x4'));var logger=require('../../config/logger')(_0x0730('0x5'));var config=require('../../config/environment');var jayson=require(_0x0730('0x6'));var client=jayson[_0x0730('0x7')][_0x0730('0x8')]({'port':0x232a});config[_0x0730('0x9')]=_[_0x0730('0xa')](config[_0x0730('0x9')],{'host':_0x0730('0xb'),'port':0x18eb});var socket=require(_0x0730('0xc'))(new Redis(config[_0x0730('0x9')]));require(_0x0730('0xd'))[_0x0730('0xe')](socket);function respondWithRpcPromise(_0x6271d6,_0x37afb1,_0x1added){return new BPromise(function(_0x43eaee,_0x3e8804){return client[_0x0730('0xf')](_0x6271d6,_0x1added)[_0x0730('0x10')](function(_0x51a12d){logger['info'](_0x0730('0x11'),_0x37afb1,'request\x20sent');logger[_0x0730('0x12')](_0x0730('0x13'),_0x37afb1,_0x0730('0x14'),JSON[_0x0730('0x15')](_0x51a12d));if(_0x51a12d['error']){if(_0x51a12d[_0x0730('0x16')]['code']===0x1f4){logger[_0x0730('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x37afb1,_0x51a12d['error'][_0x0730('0x17')]);return _0x3e8804(_0x51a12d['error'][_0x0730('0x17')]);}logger[_0x0730('0x16')](_0x0730('0x11'),_0x37afb1,_0x51a12d[_0x0730('0x16')][_0x0730('0x17')]);return _0x43eaee(_0x51a12d[_0x0730('0x16')][_0x0730('0x17')]);}else{logger['info'](_0x0730('0x11'),_0x37afb1,'request\x20sent');_0x43eaee(_0x51a12d[_0x0730('0x18')][_0x0730('0x17')]);}})[_0x0730('0x19')](function(_0x159d3d){logger[_0x0730('0x16')](_0x0730('0x11'),_0x37afb1,_0x159d3d);_0x3e8804(_0x159d3d);});});}exports['GetVoiceQueue']=function(_0x4b964c){var _0x5a078b=this;return new Promise(function(_0x374de6,_0x2790bd){return db[_0x0730('0x1a')][_0x0730('0x1b')]({'raw':_0x4b964c[_0x0730('0x1c')]?_0x4b964c[_0x0730('0x1c')][_0x0730('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b964c[_0x0730('0x1c')]?_0x4b964c[_0x0730('0x1c')][_0x0730('0x1e')]||null:null,'attributes':_0x4b964c[_0x0730('0x1c')]?_0x4b964c[_0x0730('0x1c')]['attributes']||null:null,'limit':_0x4b964c[_0x0730('0x1c')]?_0x4b964c['options'][_0x0730('0x1f')]||null:null,'include':_0x4b964c[_0x0730('0x1c')]?_0x4b964c['options'][_0x0730('0x20')]?_[_0x0730('0x21')](_0x4b964c[_0x0730('0x1c')][_0x0730('0x20')],function(_0x19d402){return{'model':db[_0x19d402[_0x0730('0x22')]],'as':_0x19d402['as'],'attributes':_0x19d402[_0x0730('0x23')],'include':_0x19d402[_0x0730('0x20')]?_[_0x0730('0x21')](_0x19d402[_0x0730('0x20')],function(_0x5aa5c8){return{'model':db[_0x5aa5c8[_0x0730('0x22')]],'as':_0x5aa5c8['as'],'attributes':_0x5aa5c8['attributes'],'include':_0x5aa5c8[_0x0730('0x20')]?_['map'](_0x5aa5c8[_0x0730('0x20')],function(_0x263387){return{'model':db[_0x263387[_0x0730('0x22')]],'as':_0x263387['as'],'attributes':_0x263387['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5df255){logger[_0x0730('0x24')](_0x0730('0x25'),_0x4b964c);logger[_0x0730('0x12')](_0x0730('0x25'),_0x4b964c,JSON[_0x0730('0x15')](_0x5df255));_0x374de6(_0x5df255);})[_0x0730('0x19')](function(_0x39f46b){logger[_0x0730('0x16')](_0x0730('0x25'),_0x39f46b[_0x0730('0x17')],_0x4b964c);_0x2790bd(_0x5a078b['error'](0x1f4,_0x39f46b['message']));});});};exports['ShowVoiceQueue']=function(_0x2ec6ea){var _0x2ea1b9=this;return new Promise(function(_0x2d063c,_0x1d3b91){return db['VoiceQueue'][_0x0730('0x26')]({'raw':_0x2ec6ea[_0x0730('0x1c')]?_0x2ec6ea[_0x0730('0x1c')][_0x0730('0x1d')]===undefined?!![]:![]:!![],'where':_0x2ec6ea['options']?_0x2ec6ea[_0x0730('0x1c')][_0x0730('0x1e')]||null:null,'attributes':_0x2ec6ea[_0x0730('0x1c')]?_0x2ec6ea[_0x0730('0x1c')][_0x0730('0x23')]||null:null,'include':_0x2ec6ea[_0x0730('0x1c')]?_0x2ec6ea['options']['include']?_['map'](_0x2ec6ea['options']['include'],function(_0x36bdb2){return{'model':db[_0x36bdb2['model']],'as':_0x36bdb2['as'],'attributes':_0x36bdb2[_0x0730('0x23')],'include':_0x36bdb2[_0x0730('0x20')]?_[_0x0730('0x21')](_0x36bdb2[_0x0730('0x20')],function(_0xca11eb){return{'model':db[_0xca11eb[_0x0730('0x22')]],'as':_0xca11eb['as'],'attributes':_0xca11eb[_0x0730('0x23')],'include':_0xca11eb[_0x0730('0x20')]?_[_0x0730('0x21')](_0xca11eb[_0x0730('0x20')],function(_0x373941){return{'model':db[_0x373941[_0x0730('0x22')]],'as':_0x373941['as'],'attributes':_0x373941[_0x0730('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0730('0x10')](function(_0x146bce){logger['info'](_0x0730('0x27'),_0x2ec6ea);logger[_0x0730('0x12')]('ShowVoiceQueue',_0x2ec6ea,JSON['stringify'](_0x146bce));_0x2d063c(_0x146bce);})[_0x0730('0x19')](function(_0x3e4a42){logger[_0x0730('0x16')](_0x0730('0x27'),_0x3e4a42[_0x0730('0x17')],_0x2ec6ea);_0x1d3b91(_0x2ea1b9[_0x0730('0x16')](0x1f4,_0x3e4a42[_0x0730('0x17')]));});});}; \ No newline at end of file +var _0x9141=['info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','limit','map','include','model','attributes','ShowVoiceQueue','util','moment','randomstring','ioredis','rpc','../../config/environment','client','http','redis','defaults','localhost','./voiceQueue.socket','register','request','then'];(function(_0x6b4826,_0x3ec6a3){var _0x2605eb=function(_0x1a976b){while(--_0x1a976b){_0x6b4826['push'](_0x6b4826['shift']());}};_0x2605eb(++_0x3ec6a3);}(_0x9141,0x85));var _0x1914=function(_0x1e51ad,_0x5a8c9e){_0x1e51ad=_0x1e51ad-0x0;var _0x15435f=_0x9141[_0x1e51ad];return _0x15435f;};'use strict';var _=require('lodash');var util=require(_0x1914('0x0'));var moment=require(_0x1914('0x1'));var BPromise=require('bluebird');var rs=require(_0x1914('0x2'));var fs=require('fs');var Redis=require(_0x1914('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1914('0x4'));var config=require(_0x1914('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1914('0x6')][_0x1914('0x7')]({'port':0x232a});config[_0x1914('0x8')]=_[_0x1914('0x9')](config[_0x1914('0x8')],{'host':_0x1914('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1914('0x8')]));require(_0x1914('0xb'))[_0x1914('0xc')](socket);function respondWithRpcPromise(_0x4cadfc,_0x25da32,_0x2dae3e){return new BPromise(function(_0x60ccc,_0x52245c){return client[_0x1914('0xd')](_0x4cadfc,_0x2dae3e)[_0x1914('0xe')](function(_0x182a50){logger[_0x1914('0xf')]('VoiceQueue,\x20%s,\x20%s',_0x25da32,_0x1914('0x10'));logger[_0x1914('0x11')](_0x1914('0x12'),_0x25da32,_0x1914('0x10'),JSON[_0x1914('0x13')](_0x182a50));if(_0x182a50['error']){if(_0x182a50['error']['code']===0x1f4){logger[_0x1914('0x14')](_0x1914('0x15'),_0x25da32,_0x182a50['error']['message']);return _0x52245c(_0x182a50[_0x1914('0x14')][_0x1914('0x16')]);}logger[_0x1914('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x25da32,_0x182a50[_0x1914('0x14')][_0x1914('0x16')]);return _0x60ccc(_0x182a50['error'][_0x1914('0x16')]);}else{logger[_0x1914('0xf')](_0x1914('0x15'),_0x25da32,_0x1914('0x10'));_0x60ccc(_0x182a50[_0x1914('0x17')][_0x1914('0x16')]);}})[_0x1914('0x18')](function(_0x134165){logger[_0x1914('0x14')](_0x1914('0x15'),_0x25da32,_0x134165);_0x52245c(_0x134165);});});}exports[_0x1914('0x19')]=function(_0x4b2cc5){var _0xbb2d96=this;return new Promise(function(_0x33be40,_0xc3b32c){return db[_0x1914('0x1a')][_0x1914('0x1b')]({'raw':_0x4b2cc5[_0x1914('0x1c')]?_0x4b2cc5[_0x1914('0x1c')][_0x1914('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b2cc5[_0x1914('0x1c')]?_0x4b2cc5[_0x1914('0x1c')][_0x1914('0x1e')]||null:null,'attributes':_0x4b2cc5['options']?_0x4b2cc5[_0x1914('0x1c')]['attributes']||null:null,'limit':_0x4b2cc5[_0x1914('0x1c')]?_0x4b2cc5[_0x1914('0x1c')][_0x1914('0x1f')]||null:null,'include':_0x4b2cc5['options']?_0x4b2cc5[_0x1914('0x1c')]['include']?_[_0x1914('0x20')](_0x4b2cc5['options'][_0x1914('0x21')],function(_0x1943d7){return{'model':db[_0x1943d7[_0x1914('0x22')]],'as':_0x1943d7['as'],'attributes':_0x1943d7[_0x1914('0x23')],'include':_0x1943d7[_0x1914('0x21')]?_[_0x1914('0x20')](_0x1943d7[_0x1914('0x21')],function(_0x386e73){return{'model':db[_0x386e73[_0x1914('0x22')]],'as':_0x386e73['as'],'attributes':_0x386e73[_0x1914('0x23')],'include':_0x386e73[_0x1914('0x21')]?_[_0x1914('0x20')](_0x386e73['include'],function(_0x35f76b){return{'model':db[_0x35f76b[_0x1914('0x22')]],'as':_0x35f76b['as'],'attributes':_0x35f76b[_0x1914('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc518cb){logger['info'](_0x1914('0x19'),_0x4b2cc5);logger['debug'](_0x1914('0x19'),_0x4b2cc5,JSON[_0x1914('0x13')](_0xc518cb));_0x33be40(_0xc518cb);})['catch'](function(_0x144ee6){logger[_0x1914('0x14')](_0x1914('0x19'),_0x144ee6['message'],_0x4b2cc5);_0xc3b32c(_0xbb2d96[_0x1914('0x14')](0x1f4,_0x144ee6[_0x1914('0x16')]));});});};exports[_0x1914('0x24')]=function(_0x5927a0){var _0x48c015=this;return new Promise(function(_0x3bfff6,_0x2754b7){return db[_0x1914('0x1a')]['find']({'raw':_0x5927a0[_0x1914('0x1c')]?_0x5927a0['options'][_0x1914('0x1d')]===undefined?!![]:![]:!![],'where':_0x5927a0[_0x1914('0x1c')]?_0x5927a0[_0x1914('0x1c')][_0x1914('0x1e')]||null:null,'attributes':_0x5927a0[_0x1914('0x1c')]?_0x5927a0['options'][_0x1914('0x23')]||null:null,'include':_0x5927a0['options']?_0x5927a0[_0x1914('0x1c')][_0x1914('0x21')]?_[_0x1914('0x20')](_0x5927a0['options']['include'],function(_0x4518e6){return{'model':db[_0x4518e6['model']],'as':_0x4518e6['as'],'attributes':_0x4518e6[_0x1914('0x23')],'include':_0x4518e6[_0x1914('0x21')]?_[_0x1914('0x20')](_0x4518e6[_0x1914('0x21')],function(_0x1efa47){return{'model':db[_0x1efa47[_0x1914('0x22')]],'as':_0x1efa47['as'],'attributes':_0x1efa47['attributes'],'include':_0x1efa47[_0x1914('0x21')]?_[_0x1914('0x20')](_0x1efa47[_0x1914('0x21')],function(_0x23bc13){return{'model':db[_0x23bc13[_0x1914('0x22')]],'as':_0x23bc13['as'],'attributes':_0x23bc13[_0x1914('0x23')]};}):[]};}):[]};}):[]:[]})[_0x1914('0xe')](function(_0x5cb692){logger['info'](_0x1914('0x24'),_0x5927a0);logger[_0x1914('0x11')](_0x1914('0x24'),_0x5927a0,JSON['stringify'](_0x5cb692));_0x3bfff6(_0x5cb692);})[_0x1914('0x18')](function(_0x29fe47){logger[_0x1914('0x14')](_0x1914('0x24'),_0x29fe47[_0x1914('0x16')],_0x5927a0);_0x2754b7(_0x48c015[_0x1914('0x14')](0x1f4,_0x29fe47[_0x1914('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 3805027..42f83ed 100644 --- a/server/api/voiceQueue/voiceQueue.socket.js +++ b/server/api/voiceQueue/voiceQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf91=['save','remove','emit','removeListener','length','./voiceQueue.events'];(function(_0x973a06,_0x1e22cc){var _0x1261b5=function(_0x2ecf02){while(--_0x2ecf02){_0x973a06['push'](_0x973a06['shift']());}};_0x1261b5(++_0x1e22cc);}(_0xbf91,0xd7));var _0x1bf9=function(_0x3d1280,_0x569bb9){_0x3d1280=_0x3d1280-0x0;var _0x4e1988=_0xbf91[_0x3d1280];return _0x4e1988;};'use strict';var VoiceQueueEvents=require(_0x1bf9('0x0'));var events=[_0x1bf9('0x1'),_0x1bf9('0x2'),'update'];function createListener(_0x5abd06,_0xec59be){return function(_0xaaa44d){_0xec59be[_0x1bf9('0x3')](_0x5abd06,_0xaaa44d);};}function removeListener(_0x5ae5a9,_0x130e4d){return function(){VoiceQueueEvents[_0x1bf9('0x4')](_0x5ae5a9,_0x130e4d);};}exports['register']=function(_0xaf1247){for(var _0x1bc652=0x0,_0x3c7141=events[_0x1bf9('0x5')];_0x1bc652<_0x3c7141;_0x1bc652++){var _0x10a2bf=events[_0x1bc652];var _0x143cae=createListener('voiceQueue:'+_0x10a2bf,_0xaf1247);VoiceQueueEvents['on'](_0x10a2bf,_0x143cae);}}; \ No newline at end of file +var _0x74b5=['./voiceQueue.events','remove','update','emit','removeListener','register','length','voiceQueue:'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x74b5,0xc8));var _0x574b=function(_0x52fc0f,_0x391070){_0x52fc0f=_0x52fc0f-0x0;var _0x1c3f18=_0x74b5[_0x52fc0f];return _0x1c3f18;};'use strict';var VoiceQueueEvents=require(_0x574b('0x0'));var events=['save',_0x574b('0x1'),_0x574b('0x2')];function createListener(_0x309347,_0x4572a2){return function(_0x5d59dd){_0x4572a2[_0x574b('0x3')](_0x309347,_0x5d59dd);};}function removeListener(_0x1c1db4,_0x132e46){return function(){VoiceQueueEvents[_0x574b('0x4')](_0x1c1db4,_0x132e46);};}exports[_0x574b('0x5')]=function(_0x178ebf){for(var _0xb52b64=0x0,_0x1ab2b8=events[_0x574b('0x6')];_0xb52b64<_0x1ab2b8;_0xb52b64++){var _0x1a1d86=events[_0xb52b64];var _0x4d0e37=createListener(_0x574b('0x7')+_0x1a1d86,_0x178ebf);VoiceQueueEvents['on'](_0x1a1d86,_0x4d0e37);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 889e382..d9a3fc9 100644 --- a/server/api/voiceQueueReport/index.js +++ b/server/api/voiceQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a99=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','index','get','/describe','/index','isAuthenticated','/:id','show','post'];(function(_0x59162a,_0x10e547){var _0x35e50d=function(_0x578425){while(--_0x578425){_0x59162a['push'](_0x59162a['shift']());}};_0x35e50d(++_0x10e547);}(_0x5a99,0xbd));var _0x95a9=function(_0x35335e,_0x46613b){_0x35335e=_0x35335e-0x0;var _0x236530=_0x5a99[_0x35335e];return _0x236530;};'use strict';var multer=require(_0x95a9('0x0'));var util=require(_0x95a9('0x1'));var path=require(_0x95a9('0x2'));var timeout=require(_0x95a9('0x3'));var express=require(_0x95a9('0x4'));var router=express[_0x95a9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x95a9('0x6'));var interaction=require(_0x95a9('0x7'));var config=require(_0x95a9('0x8'));var controller=require(_0x95a9('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x95a9('0xa')]);router[_0x95a9('0xb')](_0x95a9('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x95a9('0xb')](_0x95a9('0xd'),auth[_0x95a9('0xe')](),controller['getVoiceQueuesReport']);router[_0x95a9('0xb')](_0x95a9('0xf'),auth['isAuthenticated'](),controller[_0x95a9('0x10')]);router[_0x95a9('0x11')]('/',auth[_0x95a9('0xe')](),controller[_0x95a9('0x12')]);router['put'](_0x95a9('0xf'),auth[_0x95a9('0xe')](),controller[_0x95a9('0x13')]);router[_0x95a9('0x14')](_0x95a9('0xf'),auth[_0x95a9('0xe')](),controller[_0x95a9('0x15')]);module[_0x95a9('0x16')]=router; \ No newline at end of file +var _0xd88a=['index','get','/describe','describe','/index','isAuthenticated','/:id','show','post','create','update','delete','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x217cd1,_0x10c0a5){var _0x515315=function(_0x27882f){while(--_0x27882f){_0x217cd1['push'](_0x217cd1['shift']());}};_0x515315(++_0x10c0a5);}(_0xd88a,0x1d9));var _0xad88=function(_0x493370,_0x4c7fac){_0x493370=_0x493370-0x0;var _0xac15d=_0xd88a[_0x493370];return _0xac15d;};'use strict';var multer=require('multer');var util=require(_0xad88('0x0'));var path=require(_0xad88('0x1'));var timeout=require('connect-timeout');var express=require(_0xad88('0x2'));var router=express[_0xad88('0x3')]();var fs_extra=require(_0xad88('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xad88('0x5'));var config=require(_0xad88('0x6'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xad88('0x7')]);router[_0xad88('0x8')](_0xad88('0x9'),auth['isAuthenticated'](),controller[_0xad88('0xa')]);router[_0xad88('0x8')](_0xad88('0xb'),auth[_0xad88('0xc')](),controller['getVoiceQueuesReport']);router[_0xad88('0x8')](_0xad88('0xd'),auth[_0xad88('0xc')](),controller[_0xad88('0xe')]);router[_0xad88('0xf')]('/',auth['isAuthenticated'](),controller[_0xad88('0x10')]);router['put']('/:id',auth[_0xad88('0xc')](),controller[_0xad88('0x11')]);router[_0xad88('0x12')](_0xad88('0xd'),auth[_0xad88('0xc')](),controller['destroy']);module[_0xad88('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 2d2976c..0e3c0a5 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.attributes.js +++ b/server/api/voiceQueueReport/voiceQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5189=['seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff'];(function(_0x296754,_0x5befe9){var _0x1d9f1d=function(_0x3f033e){while(--_0x3f033e){_0x296754['push'](_0x296754['shift']());}};_0x1d9f1d(++_0x5befe9);}(_0x5189,0x1d7));var _0x9518=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0x5189[_0x149ca0];return _0x56b6b9;};'use strict';var Sequelize=require(_0x9518('0x0'));var moment=require(_0x9518('0x1'));module[_0x9518('0x2')]={'type':{'type':Sequelize[_0x9518('0x3')]},'uniqueid':{'type':Sequelize[_0x9518('0x3')]},'calleridnum':{'type':Sequelize[_0x9518('0x3')]},'calleridname':{'type':Sequelize[_0x9518('0x3')]},'queue':{'type':Sequelize[_0x9518('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x9518('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x9518('0x4')],'set':function(_0x52d0e4){var _0x217409=moment(_0x52d0e4);var _0x25013f=moment(this[_0x9518('0x5')](_0x9518('0x6')))['format'](_0x9518('0x7'));var _0x108d72=_0x217409[_0x9518('0x8')](_0x25013f,_0x9518('0x9'));this['setDataValue'](_0x9518('0xa'),_0x52d0e4);this[_0x9518('0xb')](_0x9518('0xc'),_0x108d72||null);}},'position':{'type':Sequelize[_0x9518('0xd')]},'count':{'type':Sequelize[_0x9518('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x9518('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x9518('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x9518('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x9518('0x4')]},'queuecallerexit':{'type':Sequelize[_0x9518('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x9518('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x9518('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x9518('0xd')]},'channel':{'type':Sequelize[_0x9518('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x9518('0x3')]},'accountcode':{'type':Sequelize[_0x9518('0x3')]},'context':{'type':Sequelize[_0x9518('0x3')]},'exten':{'type':Sequelize[_0x9518('0x3')]},'priority':{'type':Sequelize[_0x9518('0x3')]},'holdtime':{'type':Sequelize[_0x9518('0xd')]},'mohtime':{'type':Sequelize[_0x9518('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9518('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x9518('0x3')]},'transfer':{'type':Sequelize[_0x9518('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9518('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x9518('0x3')]},'transferuniqueid':{'type':Sequelize[_0x9518('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9518('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x9518('0xd')],'defaultValue':0x0},'note':{'type':Sequelize[_0x9518('0x3')]}}; \ No newline at end of file +var _0x15a9=['holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x15a9,0x122));var _0x915a=function(_0x554b57,_0x6c143b){_0x554b57=_0x554b57-0x0;var _0x4e9b05=_0x15a9[_0x554b57];return _0x4e9b05;};'use strict';var Sequelize=require(_0x915a('0x0'));var moment=require('moment');module[_0x915a('0x1')]={'type':{'type':Sequelize[_0x915a('0x2')]},'uniqueid':{'type':Sequelize[_0x915a('0x2')]},'calleridnum':{'type':Sequelize[_0x915a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x915a('0x3')],'set':function(_0x4e37f9){var _0x14e3c6=moment(_0x4e37f9);var _0x5d59c3=moment(this['getDataValue']('queuecallerjoinAt'))['format'](_0x915a('0x4'));var _0x412a2d=_0x14e3c6[_0x915a('0x5')](_0x5d59c3,'seconds');this[_0x915a('0x6')]('queuecallerleaveAt',_0x4e37f9);this[_0x915a('0x6')](_0x915a('0x7'),_0x412a2d||null);}},'position':{'type':Sequelize[_0x915a('0x8')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x915a('0x9')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x915a('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x915a('0x9')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x915a('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x915a('0x2')],'comment':_0x915a('0xa')},'originalposition':{'type':Sequelize[_0x915a('0x8')]},'channel':{'type':Sequelize[_0x915a('0x2')]},'connectedlinenum':{'type':Sequelize[_0x915a('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x915a('0x2')]},'priority':{'type':Sequelize[_0x915a('0x2')]},'holdtime':{'type':Sequelize[_0x915a('0x8')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x915a('0x9')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x915a('0x2')]},'transfer':{'type':Sequelize[_0x915a('0x9')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x915a('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x915a('0x2')]},'disposition':{'type':Sequelize[_0x915a('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x915a('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x915a('0x8')],'defaultValue':0x0},'note':{'type':Sequelize[_0x915a('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index c43ff78..8e4b29c 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.controller.js +++ b/server/api/voiceQueueReport/voiceQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4122=['fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','options','find','create','body','params','describe','rawAttributes','eml-format','rimraf','fast-json-patch','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','VoiceQueueReport'];(function(_0x31f186,_0x32cee2){var _0x4cbb16=function(_0x3f7e25){while(--_0x3f7e25){_0x31f186['push'](_0x31f186['shift']());}};_0x4cbb16(++_0x32cee2);}(_0x4122,0x6f));var _0x2412=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4122[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x2412('0x0'));var rimraf=require(_0x2412('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2412('0x2'));var rp=require('request-promise');var moment=require(_0x2412('0x3'));var BPromise=require(_0x2412('0x4'));var Mustache=require('mustache');var util=require(_0x2412('0x5'));var path=require('path');var sox=require(_0x2412('0x6'));var csv=require('to-csv');var ejs=require(_0x2412('0x7'));var fs=require('fs');var fs_extra=require(_0x2412('0x8'));var _=require(_0x2412('0x9'));var squel=require('squel');var crypto=require(_0x2412('0xa'));var jsforce=require(_0x2412('0xb'));var deskjs=require(_0x2412('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2412('0xd'));var Papa=require(_0x2412('0xe'));var Redis=require(_0x2412('0xf'));var authService=require(_0x2412('0x10'));var qs=require(_0x2412('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2412('0x12'));var utils=require(_0x2412('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2412('0x14'));var db=require(_0x2412('0x15'))['db'];config[_0x2412('0x16')]=_['defaults'](config[_0x2412('0x16')],{'host':_0x2412('0x17'),'port':0x18eb});var socket=require(_0x2412('0x18'))(new Redis(config[_0x2412('0x16')]));require(_0x2412('0x19'))[_0x2412('0x1a')](socket);function respondWithStatusCode(_0xecde1d,_0x534b9d){_0x534b9d=_0x534b9d||0xcc;return function(_0x2f1cac){if(_0x2f1cac){return _0xecde1d[_0x2412('0x1b')](_0x534b9d);}return _0xecde1d[_0x2412('0x1c')](_0x534b9d)[_0x2412('0x1d')]();};}function respondWithResult(_0x1f8219,_0x3842a9){_0x3842a9=_0x3842a9||0xc8;return function(_0x2608ad){if(_0x2608ad){return _0x1f8219[_0x2412('0x1c')](_0x3842a9)[_0x2412('0x1e')](_0x2608ad);}};}function respondWithFilteredResult(_0x497b95,_0x2aaf84){return function(_0x1783da){if(_0x1783da){var _0xe62341=typeof _0x2aaf84[_0x2412('0x1f')]===_0x2412('0x20')&&typeof _0x2aaf84[_0x2412('0x21')]===_0x2412('0x20');var _0x54166f=_0x1783da[_0x2412('0x22')];var _0x656442=_0xe62341?0x0:_0x2aaf84[_0x2412('0x1f')];var _0x147957=_0xe62341?_0x1783da[_0x2412('0x22')]:_0x2aaf84[_0x2412('0x1f')]+_0x2aaf84[_0x2412('0x21')];var _0x408d5a;if(_0x147957>=_0x54166f){_0x147957=_0x54166f;_0x408d5a=0xc8;}else{_0x408d5a=0xce;}_0x497b95[_0x2412('0x1c')](_0x408d5a);return _0x497b95[_0x2412('0x23')](_0x2412('0x24'),_0x656442+'-'+_0x147957+'/'+_0x54166f)[_0x2412('0x1e')](_0x1783da);}return null;};}function patchUpdates(_0x1a5ee8){return function(_0x4e52fc){try{jsonpatch[_0x2412('0x25')](_0x4e52fc,_0x1a5ee8,!![]);}catch(_0x350f7e){return BPromise[_0x2412('0x26')](_0x350f7e);}return _0x4e52fc[_0x2412('0x27')]();};}function saveUpdates(_0x37fa5d,_0xe10822){return function(_0x301c92){if(_0x301c92){return _0x301c92[_0x2412('0x28')](_0x37fa5d)['then'](function(_0x293375){return _0x293375;});}return null;};}function removeEntity(_0x175e24,_0x3a7ae9){return function(_0x430a7a){if(_0x430a7a){return _0x430a7a[_0x2412('0x29')]()[_0x2412('0x2a')](function(){_0x175e24[_0x2412('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ebc52,_0x5d3fbe){return function(_0x4b8835){if(!_0x4b8835){_0x4ebc52[_0x2412('0x1b')](0x194);}return _0x4b8835;};}function handleError(_0x197eae,_0x6ebf2f){_0x6ebf2f=_0x6ebf2f||0x1f4;return function(_0xacd028){logger[_0x2412('0x2b')](_0xacd028[_0x2412('0x2c')]);if(_0xacd028[_0x2412('0x2d')]){delete _0xacd028[_0x2412('0x2d')];}_0x197eae[_0x2412('0x1c')](_0x6ebf2f)[_0x2412('0x2e')](_0xacd028);};}exports['index']=function(_0x2e8f56,_0x1c7ea5){var _0x2ed005={},_0x3ff22d={},_0x374615={'count':0x0,'rows':[]};var _0x5756eb=_[_0x2412('0x2f')](db[_0x2412('0x30')]['rawAttributes'],function(_0x2542a2){return{'name':_0x2542a2[_0x2412('0x31')],'type':_0x2542a2['type'][_0x2412('0x32')]};});_0x3ff22d[_0x2412('0x33')]=_['map'](_0x5756eb,'name');_0x3ff22d[_0x2412('0x34')]=_[_0x2412('0x35')](_0x2e8f56[_0x2412('0x34')]);_0x3ff22d[_0x2412('0x36')]=_[_0x2412('0x37')](_0x3ff22d[_0x2412('0x33')],_0x3ff22d[_0x2412('0x34')]);_0x2ed005[_0x2412('0x38')]=_['intersection'](_0x3ff22d[_0x2412('0x33')],qs[_0x2412('0x39')](_0x2e8f56[_0x2412('0x34')][_0x2412('0x39')]));_0x2ed005[_0x2412('0x38')]=_0x2ed005['attributes'][_0x2412('0x3a')]?_0x2ed005['attributes']:_0x3ff22d[_0x2412('0x33')];if(!_0x2e8f56[_0x2412('0x34')][_0x2412('0x3b')](_0x2412('0x3c'))){_0x2ed005[_0x2412('0x21')]=qs[_0x2412('0x21')](_0x2e8f56[_0x2412('0x34')]['limit']);_0x2ed005[_0x2412('0x1f')]=qs[_0x2412('0x1f')](_0x2e8f56[_0x2412('0x34')]['offset']);}_0x2ed005[_0x2412('0x3d')]=qs[_0x2412('0x3e')](_0x2e8f56[_0x2412('0x34')][_0x2412('0x3e')]);_0x2ed005['where']=qs[_0x2412('0x36')](_[_0x2412('0x3f')](_0x2e8f56[_0x2412('0x34')],_0x3ff22d[_0x2412('0x36')]),_0x5756eb);if(_0x2e8f56['query'][_0x2412('0x40')]){_0x2ed005[_0x2412('0x41')]=_[_0x2412('0x42')](_0x2ed005['where'],{'$or':_[_0x2412('0x2f')](_0x5756eb,function(_0xa24ba3){if(_0xa24ba3['type']!==_0x2412('0x43')){var _0x3959d5={};_0x3959d5[_0xa24ba3[_0x2412('0x2d')]]={'$like':'%'+_0x2e8f56[_0x2412('0x34')][_0x2412('0x40')]+'%'};return _0x3959d5;}})});}_0x2ed005=_[_0x2412('0x42')]({},_0x2ed005,_0x2e8f56['options']);var _0x312a05={'where':_0x2ed005['where']};return db[_0x2412('0x30')][_0x2412('0x22')](_0x312a05)[_0x2412('0x2a')](function(_0xf221d6){_0x374615[_0x2412('0x22')]=_0xf221d6;if(_0x2e8f56[_0x2412('0x34')][_0x2412('0x44')]){_0x2ed005[_0x2412('0x45')]=[{'all':!![]}];}return db[_0x2412('0x30')][_0x2412('0x46')](_0x2ed005);})[_0x2412('0x2a')](function(_0x535fc9){_0x374615[_0x2412('0x47')]=_0x535fc9;return _0x374615;})[_0x2412('0x2a')](respondWithFilteredResult(_0x1c7ea5,_0x2ed005))[_0x2412('0x48')](handleError(_0x1c7ea5,null));};exports['show']=function(_0x51edd6,_0x26599e){var _0x5af3dc={'raw':![],'where':{'id':_0x51edd6['params']['id']}},_0x3b724c={};_0x3b724c['model']=_[_0x2412('0x35')](db['VoiceQueueReport']['rawAttributes']);_0x3b724c[_0x2412('0x34')]=_[_0x2412('0x35')](_0x51edd6[_0x2412('0x34')]);_0x3b724c[_0x2412('0x36')]=_[_0x2412('0x37')](_0x3b724c[_0x2412('0x33')],_0x3b724c['query']);_0x5af3dc[_0x2412('0x38')]=_['intersection'](_0x3b724c[_0x2412('0x33')],qs[_0x2412('0x39')](_0x51edd6['query'][_0x2412('0x39')]));_0x5af3dc[_0x2412('0x38')]=_0x5af3dc['attributes'][_0x2412('0x3a')]?_0x5af3dc[_0x2412('0x38')]:_0x3b724c[_0x2412('0x33')];if(_0x51edd6[_0x2412('0x34')][_0x2412('0x44')]){_0x5af3dc[_0x2412('0x45')]=[{'all':!![]}];}_0x5af3dc=_[_0x2412('0x42')]({},_0x5af3dc,_0x51edd6[_0x2412('0x49')]);return db['VoiceQueueReport'][_0x2412('0x4a')](_0x5af3dc)[_0x2412('0x2a')](handleEntityNotFound(_0x26599e,null))[_0x2412('0x2a')](respondWithResult(_0x26599e,null))[_0x2412('0x48')](handleError(_0x26599e,null));};exports[_0x2412('0x4b')]=function(_0x852ea2,_0x305220){return db[_0x2412('0x30')][_0x2412('0x4b')](_0x852ea2[_0x2412('0x4c')],{})['then'](respondWithResult(_0x305220,0xc9))[_0x2412('0x48')](handleError(_0x305220,null));};exports[_0x2412('0x28')]=function(_0x59b04e,_0x11a48e){if(_0x59b04e[_0x2412('0x4c')]['id']){delete _0x59b04e[_0x2412('0x4c')]['id'];}return db[_0x2412('0x30')][_0x2412('0x4a')]({'where':{'id':_0x59b04e[_0x2412('0x4d')]['id']}})[_0x2412('0x2a')](handleEntityNotFound(_0x11a48e,null))['then'](saveUpdates(_0x59b04e[_0x2412('0x4c')],null))[_0x2412('0x2a')](respondWithResult(_0x11a48e,null))[_0x2412('0x48')](handleError(_0x11a48e,null));};exports['destroy']=function(_0x108bbf,_0x3a81f7){return db[_0x2412('0x30')][_0x2412('0x4a')]({'where':{'id':_0x108bbf['params']['id']}})['then'](handleEntityNotFound(_0x3a81f7,null))['then'](removeEntity(_0x3a81f7,null))['catch'](handleError(_0x3a81f7,null));};exports['describe']=function(_0x2cdeb3,_0x148e49){return db[_0x2412('0x30')][_0x2412('0x4e')]()[_0x2412('0x2a')](respondWithResult(_0x148e49,null))[_0x2412('0x48')](handleError(_0x148e49,null));};exports['getVoiceQueuesReport']=function(_0x25ba5b,_0xa24634){var _0x2b543a={},_0xf2ae73={},_0x23ff99={'count':0x0,'rows':[]};_0xf2ae73[_0x2412('0x33')]=_[_0x2412('0x35')](db[_0x2412('0x30')][_0x2412('0x4f')]);_0xf2ae73[_0x2412('0x34')]=_['keys'](_0x25ba5b[_0x2412('0x34')]);_0xf2ae73[_0x2412('0x36')]=_[_0x2412('0x37')](_0xf2ae73[_0x2412('0x33')],_0xf2ae73[_0x2412('0x34')]);_0x2b543a[_0x2412('0x38')]=_[_0x2412('0x37')](_0xf2ae73[_0x2412('0x33')],qs[_0x2412('0x39')](_0x25ba5b[_0x2412('0x34')][_0x2412('0x39')]));_0x2b543a[_0x2412('0x38')]=_0x2b543a[_0x2412('0x38')][_0x2412('0x3a')]?_0x2b543a[_0x2412('0x38')]:_0xf2ae73[_0x2412('0x33')];if(!_0x25ba5b['query'][_0x2412('0x3b')](_0x2412('0x3c'))){_0x2b543a[_0x2412('0x21')]=qs[_0x2412('0x21')](_0x25ba5b[_0x2412('0x34')][_0x2412('0x21')]);_0x2b543a[_0x2412('0x1f')]=qs[_0x2412('0x1f')](_0x25ba5b[_0x2412('0x34')][_0x2412('0x1f')]);}_0x2b543a[_0x2412('0x3d')]=qs[_0x2412('0x3e')](_0x25ba5b[_0x2412('0x34')][_0x2412('0x3e')]);_0x2b543a[_0x2412('0x41')]=qs[_0x2412('0x36')](_[_0x2412('0x3f')](_0x25ba5b[_0x2412('0x34')],_0xf2ae73[_0x2412('0x36')]));if(_0x25ba5b[_0x2412('0x34')]['filter']){_0x2b543a[_0x2412('0x41')]=_['merge'](_0x2b543a[_0x2412('0x41')],{'$or':_[_0x2412('0x2f')](_0x2b543a['attributes'],function(_0x1bbe7e){var _0x348a3c={};_0x348a3c[_0x1bbe7e]={'$like':'%'+_0x25ba5b[_0x2412('0x34')]['filter']+'%'};return _0x348a3c;})});}_0x2b543a=_[_0x2412('0x42')]({},_0x2b543a,_0x25ba5b[_0x2412('0x49')]);var _0x4f0f38={'where':_0x2b543a[_0x2412('0x41')]};return db['VoiceQueueReport']['count'](_0x4f0f38)[_0x2412('0x2a')](function(_0x7cf32b){_0x23ff99['count']=_0x7cf32b;if(_0x25ba5b[_0x2412('0x34')][_0x2412('0x44')]){_0x2b543a[_0x2412('0x45')]=[{'all':!![]}];}return db[_0x2412('0x30')][_0x2412('0x46')](_0x2b543a);})['then'](function(_0x566d58){_0x23ff99['rows']=_0x566d58;return _0x23ff99;})[_0x2412('0x2a')](respondWithFilteredResult(_0xa24634,_0x2b543a,'getVoiceQueuesReport'))[_0x2412('0x48')](handleError(_0xa24634,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0xf27e=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','destroy','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','end','error','stack','name','send','map','VoiceQueueReport','fieldName','type','key'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xf27e,0x119));var _0xef27=function(_0x3fbfe8,_0x4d88fe){_0x3fbfe8=_0x3fbfe8-0x0;var _0x5db024=_0xf27e[_0x3fbfe8];return _0x5db024;};'use strict';var emlformat=require(_0xef27('0x0'));var rimraf=require(_0xef27('0x1'));var zipdir=require(_0xef27('0x2'));var jsonpatch=require(_0xef27('0x3'));var rp=require(_0xef27('0x4'));var moment=require('moment');var BPromise=require(_0xef27('0x5'));var Mustache=require(_0xef27('0x6'));var util=require(_0xef27('0x7'));var path=require(_0xef27('0x8'));var sox=require(_0xef27('0x9'));var csv=require(_0xef27('0xa'));var ejs=require(_0xef27('0xb'));var fs=require('fs');var fs_extra=require(_0xef27('0xc'));var _=require(_0xef27('0xd'));var squel=require(_0xef27('0xe'));var crypto=require('crypto');var jsforce=require(_0xef27('0xf'));var deskjs=require(_0xef27('0x10'));var toCsv=require(_0xef27('0xa'));var querystring=require(_0xef27('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xef27('0x12'));var qs=require(_0xef27('0x13'));var as=require(_0xef27('0x14'));var hardwareService=require(_0xef27('0x15'));var logger=require('../../config/logger')(_0xef27('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xef27('0x17'));var db=require('../../mysqldb')['db'];config[_0xef27('0x18')]=_['defaults'](config[_0xef27('0x18')],{'host':_0xef27('0x19'),'port':0x18eb});var socket=require(_0xef27('0x1a'))(new Redis(config[_0xef27('0x18')]));require(_0xef27('0x1b'))[_0xef27('0x1c')](socket);function respondWithStatusCode(_0x43fa5e,_0xebfa7b){_0xebfa7b=_0xebfa7b||0xcc;return function(_0x49585b){if(_0x49585b){return _0x43fa5e[_0xef27('0x1d')](_0xebfa7b);}return _0x43fa5e[_0xef27('0x1e')](_0xebfa7b)['end']();};}function respondWithResult(_0x22a302,_0x31a804){_0x31a804=_0x31a804||0xc8;return function(_0x41ae83){if(_0x41ae83){return _0x22a302[_0xef27('0x1e')](_0x31a804)[_0xef27('0x1f')](_0x41ae83);}};}function respondWithFilteredResult(_0x10f993,_0x48f186){return function(_0x303d25){if(_0x303d25){var _0x4c18d5=typeof _0x48f186[_0xef27('0x20')]==='undefined'&&typeof _0x48f186['limit']===_0xef27('0x21');var _0x1455cf=_0x303d25[_0xef27('0x22')];var _0x6d39d6=_0x4c18d5?0x0:_0x48f186[_0xef27('0x20')];var _0x115cd5=_0x4c18d5?_0x303d25[_0xef27('0x22')]:_0x48f186['offset']+_0x48f186[_0xef27('0x23')];var _0x1beee6;if(_0x115cd5>=_0x1455cf){_0x115cd5=_0x1455cf;_0x1beee6=0xc8;}else{_0x1beee6=0xce;}_0x10f993[_0xef27('0x1e')](_0x1beee6);return _0x10f993['set'](_0xef27('0x24'),_0x6d39d6+'-'+_0x115cd5+'/'+_0x1455cf)['json'](_0x303d25);}return null;};}function patchUpdates(_0x26b7b7){return function(_0x21a0a8){try{jsonpatch[_0xef27('0x25')](_0x21a0a8,_0x26b7b7,!![]);}catch(_0x5304a0){return BPromise['reject'](_0x5304a0);}return _0x21a0a8[_0xef27('0x26')]();};}function saveUpdates(_0x19855e,_0x588aaf){return function(_0x9f5c1e){if(_0x9f5c1e){return _0x9f5c1e[_0xef27('0x27')](_0x19855e)[_0xef27('0x28')](function(_0x4cbc6a){return _0x4cbc6a;});}return null;};}function removeEntity(_0x2318be,_0x114411){return function(_0x1c9e22){if(_0x1c9e22){return _0x1c9e22['destroy']()[_0xef27('0x28')](function(){_0x2318be[_0xef27('0x1e')](0xcc)[_0xef27('0x29')]();});}};}function handleEntityNotFound(_0xef0ee,_0x2bb126){return function(_0x81e1d6){if(!_0x81e1d6){_0xef0ee[_0xef27('0x1d')](0x194);}return _0x81e1d6;};}function handleError(_0x2f127e,_0xba3662){_0xba3662=_0xba3662||0x1f4;return function(_0x369314){logger[_0xef27('0x2a')](_0x369314[_0xef27('0x2b')]);if(_0x369314[_0xef27('0x2c')]){delete _0x369314[_0xef27('0x2c')];}_0x2f127e['status'](_0xba3662)[_0xef27('0x2d')](_0x369314);};}exports['index']=function(_0x30b671,_0x11bfdc){var _0x47fcc4={},_0xb50913={},_0x4caf16={'count':0x0,'rows':[]};var _0x87698=_[_0xef27('0x2e')](db[_0xef27('0x2f')]['rawAttributes'],function(_0x5313b8){return{'name':_0x5313b8[_0xef27('0x30')],'type':_0x5313b8[_0xef27('0x31')][_0xef27('0x32')]};});_0xb50913[_0xef27('0x33')]=_['map'](_0x87698,_0xef27('0x2c'));_0xb50913[_0xef27('0x34')]=_[_0xef27('0x35')](_0x30b671['query']);_0xb50913[_0xef27('0x36')]=_[_0xef27('0x37')](_0xb50913['model'],_0xb50913[_0xef27('0x34')]);_0x47fcc4[_0xef27('0x38')]=_[_0xef27('0x37')](_0xb50913['model'],qs[_0xef27('0x39')](_0x30b671['query'][_0xef27('0x39')]));_0x47fcc4['attributes']=_0x47fcc4[_0xef27('0x38')][_0xef27('0x3a')]?_0x47fcc4[_0xef27('0x38')]:_0xb50913[_0xef27('0x33')];if(!_0x30b671[_0xef27('0x34')][_0xef27('0x3b')](_0xef27('0x3c'))){_0x47fcc4['limit']=qs['limit'](_0x30b671['query'][_0xef27('0x23')]);_0x47fcc4[_0xef27('0x20')]=qs['offset'](_0x30b671[_0xef27('0x34')]['offset']);}_0x47fcc4[_0xef27('0x3d')]=qs[_0xef27('0x3e')](_0x30b671['query'][_0xef27('0x3e')]);_0x47fcc4[_0xef27('0x3f')]=qs[_0xef27('0x36')](_[_0xef27('0x40')](_0x30b671[_0xef27('0x34')],_0xb50913[_0xef27('0x36')]),_0x87698);if(_0x30b671[_0xef27('0x34')][_0xef27('0x41')]){_0x47fcc4[_0xef27('0x3f')]=_['merge'](_0x47fcc4[_0xef27('0x3f')],{'$or':_[_0xef27('0x2e')](_0x87698,function(_0x481a24){if(_0x481a24[_0xef27('0x31')]!==_0xef27('0x42')){var _0x2f61f6={};_0x2f61f6[_0x481a24[_0xef27('0x2c')]]={'$like':'%'+_0x30b671['query'][_0xef27('0x41')]+'%'};return _0x2f61f6;}})});}_0x47fcc4=_['merge']({},_0x47fcc4,_0x30b671[_0xef27('0x43')]);var _0x16551f={'where':_0x47fcc4['where']};return db[_0xef27('0x2f')][_0xef27('0x22')](_0x16551f)[_0xef27('0x28')](function(_0x5cc35b){_0x4caf16[_0xef27('0x22')]=_0x5cc35b;if(_0x30b671[_0xef27('0x34')][_0xef27('0x44')]){_0x47fcc4[_0xef27('0x45')]=[{'all':!![]}];}return db[_0xef27('0x2f')][_0xef27('0x46')](_0x47fcc4);})[_0xef27('0x28')](function(_0x517eb7){_0x4caf16[_0xef27('0x47')]=_0x517eb7;return _0x4caf16;})['then'](respondWithFilteredResult(_0x11bfdc,_0x47fcc4))[_0xef27('0x48')](handleError(_0x11bfdc,null));};exports[_0xef27('0x49')]=function(_0x40a891,_0x278e08){var _0x45ffac={'raw':![],'where':{'id':_0x40a891[_0xef27('0x4a')]['id']}},_0x2583ea={};_0x2583ea[_0xef27('0x33')]=_[_0xef27('0x35')](db[_0xef27('0x2f')][_0xef27('0x4b')]);_0x2583ea['query']=_[_0xef27('0x35')](_0x40a891['query']);_0x2583ea['filters']=_[_0xef27('0x37')](_0x2583ea[_0xef27('0x33')],_0x2583ea[_0xef27('0x34')]);_0x45ffac[_0xef27('0x38')]=_[_0xef27('0x37')](_0x2583ea[_0xef27('0x33')],qs['fields'](_0x40a891['query'][_0xef27('0x39')]));_0x45ffac[_0xef27('0x38')]=_0x45ffac[_0xef27('0x38')][_0xef27('0x3a')]?_0x45ffac[_0xef27('0x38')]:_0x2583ea[_0xef27('0x33')];if(_0x40a891[_0xef27('0x34')][_0xef27('0x44')]){_0x45ffac[_0xef27('0x45')]=[{'all':!![]}];}_0x45ffac=_[_0xef27('0x4c')]({},_0x45ffac,_0x40a891[_0xef27('0x43')]);return db['VoiceQueueReport'][_0xef27('0x4d')](_0x45ffac)['then'](handleEntityNotFound(_0x278e08,null))[_0xef27('0x28')](respondWithResult(_0x278e08,null))[_0xef27('0x48')](handleError(_0x278e08,null));};exports[_0xef27('0x4e')]=function(_0x13ab40,_0x90aa45){return db[_0xef27('0x2f')][_0xef27('0x4e')](_0x13ab40[_0xef27('0x4f')],{})[_0xef27('0x28')](respondWithResult(_0x90aa45,0xc9))[_0xef27('0x48')](handleError(_0x90aa45,null));};exports['update']=function(_0x451f9c,_0x388c1b){if(_0x451f9c[_0xef27('0x4f')]['id']){delete _0x451f9c['body']['id'];}return db[_0xef27('0x2f')][_0xef27('0x4d')]({'where':{'id':_0x451f9c[_0xef27('0x4a')]['id']}})[_0xef27('0x28')](handleEntityNotFound(_0x388c1b,null))[_0xef27('0x28')](saveUpdates(_0x451f9c[_0xef27('0x4f')],null))[_0xef27('0x28')](respondWithResult(_0x388c1b,null))[_0xef27('0x48')](handleError(_0x388c1b,null));};exports[_0xef27('0x50')]=function(_0x3d3407,_0x5ec07e){return db[_0xef27('0x2f')][_0xef27('0x4d')]({'where':{'id':_0x3d3407[_0xef27('0x4a')]['id']}})[_0xef27('0x28')](handleEntityNotFound(_0x5ec07e,null))[_0xef27('0x28')](removeEntity(_0x5ec07e,null))[_0xef27('0x48')](handleError(_0x5ec07e,null));};exports['describe']=function(_0x3df887,_0x22561a){return db[_0xef27('0x2f')][_0xef27('0x51')]()[_0xef27('0x28')](respondWithResult(_0x22561a,null))[_0xef27('0x48')](handleError(_0x22561a,null));};exports[_0xef27('0x52')]=function(_0x244b67,_0x2433fd){var _0x4dd415={},_0x139351={},_0x20e9ac={'count':0x0,'rows':[]};_0x139351[_0xef27('0x33')]=_[_0xef27('0x35')](db[_0xef27('0x2f')][_0xef27('0x4b')]);_0x139351[_0xef27('0x34')]=_[_0xef27('0x35')](_0x244b67[_0xef27('0x34')]);_0x139351[_0xef27('0x36')]=_['intersection'](_0x139351[_0xef27('0x33')],_0x139351[_0xef27('0x34')]);_0x4dd415[_0xef27('0x38')]=_[_0xef27('0x37')](_0x139351['model'],qs[_0xef27('0x39')](_0x244b67['query'][_0xef27('0x39')]));_0x4dd415[_0xef27('0x38')]=_0x4dd415['attributes'][_0xef27('0x3a')]?_0x4dd415['attributes']:_0x139351[_0xef27('0x33')];if(!_0x244b67[_0xef27('0x34')]['hasOwnProperty'](_0xef27('0x3c'))){_0x4dd415[_0xef27('0x23')]=qs[_0xef27('0x23')](_0x244b67[_0xef27('0x34')][_0xef27('0x23')]);_0x4dd415[_0xef27('0x20')]=qs['offset'](_0x244b67[_0xef27('0x34')]['offset']);}_0x4dd415[_0xef27('0x3d')]=qs['sort'](_0x244b67[_0xef27('0x34')][_0xef27('0x3e')]);_0x4dd415[_0xef27('0x3f')]=qs[_0xef27('0x36')](_[_0xef27('0x40')](_0x244b67[_0xef27('0x34')],_0x139351[_0xef27('0x36')]));if(_0x244b67[_0xef27('0x34')][_0xef27('0x41')]){_0x4dd415[_0xef27('0x3f')]=_[_0xef27('0x4c')](_0x4dd415['where'],{'$or':_['map'](_0x4dd415['attributes'],function(_0x27982f){var _0x3e5d3d={};_0x3e5d3d[_0x27982f]={'$like':'%'+_0x244b67[_0xef27('0x34')][_0xef27('0x41')]+'%'};return _0x3e5d3d;})});}_0x4dd415=_['merge']({},_0x4dd415,_0x244b67[_0xef27('0x43')]);var _0x2390c6={'where':_0x4dd415[_0xef27('0x3f')]};return db[_0xef27('0x2f')][_0xef27('0x22')](_0x2390c6)[_0xef27('0x28')](function(_0x39465a){_0x20e9ac[_0xef27('0x22')]=_0x39465a;if(_0x244b67[_0xef27('0x34')][_0xef27('0x44')]){_0x4dd415[_0xef27('0x45')]=[{'all':!![]}];}return db[_0xef27('0x2f')][_0xef27('0x46')](_0x4dd415);})['then'](function(_0x41d50d){_0x20e9ac[_0xef27('0x47')]=_0x41d50d;return _0x20e9ac;})['then'](respondWithFilteredResult(_0x2433fd,_0x4dd415,_0xef27('0x52')))['catch'](handleError(_0x2433fd,null,_0xef27('0x52')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index be7ad08..689a3ef 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.events.js +++ b/server/api/voiceQueueReport/voiceQueueReport.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3bff=['../../mysqldb','VoiceQueueReport','emit','hasOwnProperty','hook','exports','events'];(function(_0x349a33,_0xdeb5bd){var _0x1226fe=function(_0x585fcf){while(--_0x585fcf){_0x349a33['push'](_0x349a33['shift']());}};_0x1226fe(++_0xdeb5bd);}(_0x3bff,0x187));var _0xf3bf=function(_0x4935b1,_0x2c6114){_0x4935b1=_0x4935b1-0x0;var _0x3354c1=_0x3bff[_0x4935b1];return _0x3354c1;};'use strict';var EventEmitter=require(_0xf3bf('0x0'));var VoiceQueueReport=require(_0xf3bf('0x1'))['db'][_0xf3bf('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x55e545){return function(_0x2c658d,_0x83417,_0xf16ef9){VoiceQueueReportEvents[_0xf3bf('0x3')](_0x55e545+':'+_0x2c658d['id'],_0x2c658d);VoiceQueueReportEvents[_0xf3bf('0x3')](_0x55e545,_0x2c658d);_0xf16ef9(null);};}for(var e in events){if(events[_0xf3bf('0x4')](e)){var event=events[e];VoiceQueueReport[_0xf3bf('0x5')](e,emitEvent(event));}}module[_0xf3bf('0x6')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x8ea7=['hasOwnProperty','hook','events','VoiceQueueReport','save','update','remove','emit'];(function(_0x86dc5c,_0x3a42c6){var _0x1f19a8=function(_0x163614){while(--_0x163614){_0x86dc5c['push'](_0x86dc5c['shift']());}};_0x1f19a8(++_0x3a42c6);}(_0x8ea7,0x82));var _0x78ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea7[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x78ea('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x78ea('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x78ea('0x2'),'afterUpdate':_0x78ea('0x3'),'afterDestroy':_0x78ea('0x4')};function emitEvent(_0x52f2a3){return function(_0x5aa3c2,_0x417c37,_0x500f7c){VoiceQueueReportEvents[_0x78ea('0x5')](_0x52f2a3+':'+_0x5aa3c2['id'],_0x5aa3c2);VoiceQueueReportEvents[_0x78ea('0x5')](_0x52f2a3,_0x5aa3c2);_0x500f7c(null);};}for(var e in events){if(events[_0x78ea('0x6')](e)){var event=events[e];VoiceQueueReport[_0x78ea('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index cc92072..673474a 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.model.js +++ b/server/api/voiceQueueReport/voiceQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3992=['bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3992,0x7b));var _0x2399=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x3992[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x2399('0x0'));var util=require(_0x2399('0x1'));var logger=require(_0x2399('0x2'))(_0x2399('0x3'));var moment=require(_0x2399('0x4'));var BPromise=require(_0x2399('0x5'));var rp=require(_0x2399('0x6'));var fs=require('fs');var path=require(_0x2399('0x7'));var rimraf=require('rimraf');var config=require(_0x2399('0x8'));var attributes=require(_0x2399('0x9'));module[_0x2399('0xa')]=function(_0x41ce9d,_0x1204b7){return _0x41ce9d[_0x2399('0xb')](_0x2399('0xc'),attributes,{'tableName':_0x2399('0xd'),'paranoid':![],'indexes':[{'fields':[_0x2399('0xe')]},{'fields':[_0x2399('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0614=['uniqueid','calleridnum','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0xb2bedd,_0x31fd7f){var _0xe4c3a4=function(_0x5af4fd){while(--_0x5af4fd){_0xb2bedd['push'](_0xb2bedd['shift']());}};_0xe4c3a4(++_0x31fd7f);}(_0x0614,0x12e));var _0x4061=function(_0x4b43e7,_0x55d87d){_0x4b43e7=_0x4b43e7-0x0;var _0x2451d8=_0x0614[_0x4b43e7];return _0x2451d8;};'use strict';var _=require(_0x4061('0x0'));var util=require(_0x4061('0x1'));var logger=require(_0x4061('0x2'))(_0x4061('0x3'));var moment=require('moment');var BPromise=require(_0x4061('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4061('0x5'));var rimraf=require(_0x4061('0x6'));var config=require(_0x4061('0x7'));var attributes=require('./voiceQueueReport.attributes');module[_0x4061('0x8')]=function(_0x68461a,_0x5aff1b){return _0x68461a[_0x4061('0x9')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x4061('0xa')]},{'fields':[_0x4061('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 7e9738d..ccc237a 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.rpc.js +++ b/server/api/voiceQueueReport/voiceQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x754c=['include','map','model','debug','CreateVoiceQueueReport','create','then','UpdateVoiceQueueReport','update','body','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit'];(function(_0xc7c7d3,_0x4f453b){var _0x171c14=function(_0xde2e9f){while(--_0xde2e9f){_0xc7c7d3['push'](_0xc7c7d3['shift']());}};_0x171c14(++_0x4f453b);}(_0x754c,0x196));var _0xc754=function(_0xe3d27e,_0x474186){_0xe3d27e=_0xe3d27e-0x0;var _0x4daee4=_0x754c[_0xe3d27e];return _0x4daee4;};'use strict';var _=require(_0xc754('0x0'));var util=require(_0xc754('0x1'));var moment=require('moment');var BPromise=require(_0xc754('0x2'));var rs=require(_0xc754('0x3'));var fs=require('fs');var Redis=require(_0xc754('0x4'));var db=require(_0xc754('0x5'))['db'];var utils=require(_0xc754('0x6'));var logger=require('../../config/logger')(_0xc754('0x7'));var config=require('../../config/environment');var jayson=require(_0xc754('0x8'));var client=jayson[_0xc754('0x9')]['http']({'port':0x232a});config[_0xc754('0xa')]=_[_0xc754('0xb')](config[_0xc754('0xa')],{'host':_0xc754('0xc'),'port':0x18eb});var socket=require(_0xc754('0xd'))(new Redis(config[_0xc754('0xa')]));require('./voiceQueueReport.socket')[_0xc754('0xe')](socket);function respondWithRpcPromise(_0x26f4cb,_0x507781,_0x373c49){return new BPromise(function(_0x2c255a,_0x47e678){return client[_0xc754('0xf')](_0x26f4cb,_0x373c49)['then'](function(_0x4105d5){logger[_0xc754('0x10')](_0xc754('0x11'),_0x507781,_0xc754('0x12'));logger['debug'](_0xc754('0x13'),_0x507781,_0xc754('0x12'),JSON[_0xc754('0x14')](_0x4105d5));if(_0x4105d5[_0xc754('0x15')]){if(_0x4105d5[_0xc754('0x15')][_0xc754('0x16')]===0x1f4){logger[_0xc754('0x15')](_0xc754('0x11'),_0x507781,_0x4105d5[_0xc754('0x15')][_0xc754('0x17')]);return _0x47e678(_0x4105d5[_0xc754('0x15')]['message']);}logger[_0xc754('0x15')](_0xc754('0x11'),_0x507781,_0x4105d5[_0xc754('0x15')]['message']);return _0x2c255a(_0x4105d5[_0xc754('0x15')][_0xc754('0x17')]);}else{logger[_0xc754('0x10')](_0xc754('0x11'),_0x507781,_0xc754('0x12'));_0x2c255a(_0x4105d5[_0xc754('0x18')][_0xc754('0x17')]);}})[_0xc754('0x19')](function(_0x4fe00e){logger[_0xc754('0x15')](_0xc754('0x11'),_0x507781,_0x4fe00e);_0x47e678(_0x4fe00e);});});}exports[_0xc754('0x1a')]=function(_0x4b8877){var _0x1e2877=this;return new Promise(function(_0x4363c7,_0x4a7717){return db[_0xc754('0x1b')][_0xc754('0x1c')]({'raw':_0x4b8877[_0xc754('0x1d')]?_0x4b8877[_0xc754('0x1d')][_0xc754('0x1e')]===undefined?!![]:![]:!![],'where':_0x4b8877[_0xc754('0x1d')]?_0x4b8877[_0xc754('0x1d')][_0xc754('0x1f')]||null:null,'attributes':_0x4b8877[_0xc754('0x1d')]?_0x4b8877[_0xc754('0x1d')][_0xc754('0x20')]||null:null,'limit':_0x4b8877['options']?_0x4b8877['options'][_0xc754('0x21')]||null:null,'include':_0x4b8877['options']?_0x4b8877[_0xc754('0x1d')][_0xc754('0x22')]?_[_0xc754('0x23')](_0x4b8877[_0xc754('0x1d')][_0xc754('0x22')],function(_0x352f74){return{'model':db[_0x352f74['model']],'as':_0x352f74['as'],'attributes':_0x352f74[_0xc754('0x20')],'include':_0x352f74[_0xc754('0x22')]?_[_0xc754('0x23')](_0x352f74['include'],function(_0x26299d){return{'model':db[_0x26299d['model']],'as':_0x26299d['as'],'attributes':_0x26299d[_0xc754('0x20')],'include':_0x26299d[_0xc754('0x22')]?_[_0xc754('0x23')](_0x26299d['include'],function(_0x417d17){return{'model':db[_0x417d17[_0xc754('0x24')]],'as':_0x417d17['as'],'attributes':_0x417d17[_0xc754('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4691ef){logger[_0xc754('0x10')](_0xc754('0x1a'),_0x4b8877);logger[_0xc754('0x25')](_0xc754('0x1a'),_0x4b8877,JSON[_0xc754('0x14')](_0x4691ef));_0x4363c7(_0x4691ef);})['catch'](function(_0x45fe7b){logger[_0xc754('0x15')]('GetVoiceQueueReport',_0x45fe7b[_0xc754('0x17')],_0x4b8877);_0x4a7717(_0x1e2877[_0xc754('0x15')](0x1f4,_0x45fe7b[_0xc754('0x17')]));});});};exports[_0xc754('0x26')]=function(_0x2cb697){var _0x1e0818=this;return new Promise(function(_0x4b64fd,_0x7ef7c0){return db[_0xc754('0x1b')][_0xc754('0x27')](_0x2cb697['body'],{'raw':_0x2cb697[_0xc754('0x1d')]?_0x2cb697[_0xc754('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xc754('0x28')](function(_0x44ab81){logger[_0xc754('0x10')](_0xc754('0x26'),_0x2cb697);logger[_0xc754('0x25')]('CreateVoiceQueueReport',_0x2cb697,JSON['stringify'](_0x44ab81));_0x4b64fd(_0x44ab81);})[_0xc754('0x19')](function(_0x1b7f26){logger['error'](_0xc754('0x26'),_0x1b7f26[_0xc754('0x17')],_0x2cb697);_0x7ef7c0(_0x1e0818['error'](0x1f4,_0x1b7f26[_0xc754('0x17')]));});});};exports[_0xc754('0x29')]=function(_0x24456a){var _0x316ad7=this;return new Promise(function(_0x551ffc,_0x20c5a0){return db[_0xc754('0x1b')][_0xc754('0x2a')](_0x24456a[_0xc754('0x2b')],{'raw':_0x24456a[_0xc754('0x1d')]?_0x24456a['options'][_0xc754('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24456a[_0xc754('0x1d')]?_0x24456a[_0xc754('0x1d')]['where']||null:null,'attributes':_0x24456a[_0xc754('0x1d')]?_0x24456a['options'][_0xc754('0x20')]||null:null,'limit':_0x24456a[_0xc754('0x1d')]?_0x24456a['options'][_0xc754('0x21')]||null:null})[_0xc754('0x28')](function(_0x3f6871){logger[_0xc754('0x10')](_0xc754('0x29'),_0x24456a);logger[_0xc754('0x25')](_0xc754('0x29'),_0x24456a,JSON[_0xc754('0x14')](_0x3f6871));_0x551ffc(_0x3f6871);})['catch'](function(_0x3e36cd){logger[_0xc754('0x15')](_0xc754('0x29'),_0x3e36cd['message'],_0x24456a);_0x20c5a0(_0x316ad7[_0xc754('0x15')](0x1f4,_0x3e36cd[_0xc754('0x17')]));});});}; \ No newline at end of file +var _0x1380=['code','message','result','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','limit','include','model','map','catch','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x48e1bf,_0x197e63){var _0x56d217=function(_0x45cb40){while(--_0x45cb40){_0x48e1bf['push'](_0x48e1bf['shift']());}};_0x56d217(++_0x197e63);}(_0x1380,0xdb));var _0x0138=function(_0x503cd3,_0x13e11e){_0x503cd3=_0x503cd3-0x0;var _0x6bab62=_0x1380[_0x503cd3];return _0x6bab62;};'use strict';var _=require(_0x0138('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0138('0x1'));var rs=require(_0x0138('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0138('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0138('0x4'))(_0x0138('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0138('0x6')][_0x0138('0x7')]({'port':0x232a});config[_0x0138('0x8')]=_[_0x0138('0x9')](config['redis'],{'host':_0x0138('0xa'),'port':0x18eb});var socket=require(_0x0138('0xb'))(new Redis(config['redis']));require(_0x0138('0xc'))['register'](socket);function respondWithRpcPromise(_0x2dbd76,_0x675e82,_0x59fb89){return new BPromise(function(_0xad4416,_0x31fb07){return client['request'](_0x2dbd76,_0x59fb89)[_0x0138('0xd')](function(_0x4168d9){logger[_0x0138('0xe')](_0x0138('0xf'),_0x675e82,'request\x20sent');logger[_0x0138('0x10')](_0x0138('0x11'),_0x675e82,_0x0138('0x12'),JSON[_0x0138('0x13')](_0x4168d9));if(_0x4168d9['error']){if(_0x4168d9[_0x0138('0x14')][_0x0138('0x15')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x675e82,_0x4168d9[_0x0138('0x14')][_0x0138('0x16')]);return _0x31fb07(_0x4168d9[_0x0138('0x14')][_0x0138('0x16')]);}logger[_0x0138('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x675e82,_0x4168d9[_0x0138('0x14')][_0x0138('0x16')]);return _0xad4416(_0x4168d9[_0x0138('0x14')][_0x0138('0x16')]);}else{logger[_0x0138('0xe')]('VoiceQueueReport,\x20%s,\x20%s',_0x675e82,'request\x20sent');_0xad4416(_0x4168d9[_0x0138('0x17')]['message']);}})['catch'](function(_0x4ef455){logger['error'](_0x0138('0xf'),_0x675e82,_0x4ef455);_0x31fb07(_0x4ef455);});});}exports[_0x0138('0x18')]=function(_0x268116){var _0x1ef248=this;return new Promise(function(_0x1d9d08,_0x1f7cff){return db[_0x0138('0x19')]['findAll']({'raw':_0x268116['options']?_0x268116[_0x0138('0x1a')][_0x0138('0x1b')]===undefined?!![]:![]:!![],'where':_0x268116[_0x0138('0x1a')]?_0x268116[_0x0138('0x1a')][_0x0138('0x1c')]||null:null,'attributes':_0x268116[_0x0138('0x1a')]?_0x268116[_0x0138('0x1a')][_0x0138('0x1d')]||null:null,'limit':_0x268116[_0x0138('0x1a')]?_0x268116[_0x0138('0x1a')][_0x0138('0x1e')]||null:null,'include':_0x268116['options']?_0x268116[_0x0138('0x1a')][_0x0138('0x1f')]?_['map'](_0x268116['options'][_0x0138('0x1f')],function(_0x3f3b55){return{'model':db[_0x3f3b55[_0x0138('0x20')]],'as':_0x3f3b55['as'],'attributes':_0x3f3b55[_0x0138('0x1d')],'include':_0x3f3b55[_0x0138('0x1f')]?_[_0x0138('0x21')](_0x3f3b55[_0x0138('0x1f')],function(_0x4de350){return{'model':db[_0x4de350[_0x0138('0x20')]],'as':_0x4de350['as'],'attributes':_0x4de350[_0x0138('0x1d')],'include':_0x4de350[_0x0138('0x1f')]?_['map'](_0x4de350[_0x0138('0x1f')],function(_0x253179){return{'model':db[_0x253179[_0x0138('0x20')]],'as':_0x253179['as'],'attributes':_0x253179[_0x0138('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0138('0xd')](function(_0x2ed62c){logger[_0x0138('0xe')](_0x0138('0x18'),_0x268116);logger[_0x0138('0x10')]('GetVoiceQueueReport',_0x268116,JSON['stringify'](_0x2ed62c));_0x1d9d08(_0x2ed62c);})[_0x0138('0x22')](function(_0x5732d5){logger[_0x0138('0x14')](_0x0138('0x18'),_0x5732d5[_0x0138('0x16')],_0x268116);_0x1f7cff(_0x1ef248[_0x0138('0x14')](0x1f4,_0x5732d5[_0x0138('0x16')]));});});};exports['CreateVoiceQueueReport']=function(_0x5d6ff5){var _0x17b7e0=this;return new Promise(function(_0x500bd4,_0x411f82){return db[_0x0138('0x19')][_0x0138('0x23')](_0x5d6ff5[_0x0138('0x24')],{'raw':_0x5d6ff5[_0x0138('0x1a')]?_0x5d6ff5[_0x0138('0x1a')][_0x0138('0x1b')]===undefined?!![]:![]:!![]})[_0x0138('0xd')](function(_0x44597c){logger[_0x0138('0xe')](_0x0138('0x25'),_0x5d6ff5);logger[_0x0138('0x10')](_0x0138('0x25'),_0x5d6ff5,JSON['stringify'](_0x44597c));_0x500bd4(_0x44597c);})[_0x0138('0x22')](function(_0x122d1a){logger['error'](_0x0138('0x25'),_0x122d1a[_0x0138('0x16')],_0x5d6ff5);_0x411f82(_0x17b7e0['error'](0x1f4,_0x122d1a[_0x0138('0x16')]));});});};exports[_0x0138('0x26')]=function(_0x2b8f26){var _0x4f8755=this;return new Promise(function(_0x58606c,_0x2c6ebf){return db['VoiceQueueReport'][_0x0138('0x27')](_0x2b8f26['body'],{'raw':_0x2b8f26[_0x0138('0x1a')]?_0x2b8f26['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b8f26[_0x0138('0x1a')]?_0x2b8f26[_0x0138('0x1a')][_0x0138('0x1c')]||null:null,'attributes':_0x2b8f26[_0x0138('0x1a')]?_0x2b8f26[_0x0138('0x1a')][_0x0138('0x1d')]||null:null,'limit':_0x2b8f26['options']?_0x2b8f26[_0x0138('0x1a')][_0x0138('0x1e')]||null:null})[_0x0138('0xd')](function(_0x1d3a38){logger[_0x0138('0xe')](_0x0138('0x26'),_0x2b8f26);logger[_0x0138('0x10')](_0x0138('0x26'),_0x2b8f26,JSON['stringify'](_0x1d3a38));_0x58606c(_0x1d3a38);})[_0x0138('0x22')](function(_0x5777e3){logger[_0x0138('0x14')](_0x0138('0x26'),_0x5777e3['message'],_0x2b8f26);_0x2c6ebf(_0x4f8755['error'](0x1f4,_0x5777e3[_0x0138('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 8d78b1e..f755c15 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.socket.js +++ b/server/api/voiceQueueReport/voiceQueueReport.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x28e3=['remove','update','emit','removeListener','register','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0xf396fe,_0xed31fb){var _0x14d2dd=function(_0x10d2d5){while(--_0x10d2d5){_0xf396fe['push'](_0xf396fe['shift']());}};_0x14d2dd(++_0xed31fb);}(_0x28e3,0x106));var _0x328e=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x28e3[_0x422905];return _0x33dc6c;};'use strict';var VoiceQueueReportEvents=require(_0x328e('0x0'));var events=[_0x328e('0x1'),_0x328e('0x2'),_0x328e('0x3')];function createListener(_0x499442,_0x5f1520){return function(_0x392b85){_0x5f1520[_0x328e('0x4')](_0x499442,_0x392b85);};}function removeListener(_0x168893,_0x8cdc14){return function(){VoiceQueueReportEvents[_0x328e('0x5')](_0x168893,_0x8cdc14);};}exports[_0x328e('0x6')]=function(_0x439182){for(var _0x5e5bcf=0x0,_0x4b5c91=events['length'];_0x5e5bcf<_0x4b5c91;_0x5e5bcf++){var _0x2bddaa=events[_0x5e5bcf];var _0x3696b6=createListener(_0x328e('0x7')+_0x2bddaa,_0x439182);VoiceQueueReportEvents['on'](_0x2bddaa,_0x3696b6);}}; \ No newline at end of file +var _0xd7ce=['register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7ce,0x16b));var _0xed7c=function(_0x51bda1,_0x44f80d){_0x51bda1=_0x51bda1-0x0;var _0x1ce08c=_0xd7ce[_0x51bda1];return _0x1ce08c;};'use strict';var VoiceQueueReportEvents=require(_0xed7c('0x0'));var events=[_0xed7c('0x1'),_0xed7c('0x2'),_0xed7c('0x3')];function createListener(_0x4ce2a9,_0x4fe5c1){return function(_0x1230ec){_0x4fe5c1['emit'](_0x4ce2a9,_0x1230ec);};}function removeListener(_0x4a6138,_0x587c5a){return function(){VoiceQueueReportEvents[_0xed7c('0x4')](_0x4a6138,_0x587c5a);};}exports[_0xed7c('0x5')]=function(_0x194d4b){for(var _0x1aa7a0=0x0,_0x34bbd7=events[_0xed7c('0x6')];_0x1aa7a0<_0x34bbd7;_0x1aa7a0++){var _0x41afb9=events[_0x1aa7a0];var _0x270db6=createListener(_0xed7c('0x7')+_0x41afb9,_0x194d4b);VoiceQueueReportEvents['on'](_0x41afb9,_0x270db6);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index dba0eb0..8520fcb 100644 --- a/server/api/voiceQueuesLog/index.js +++ b/server/api/voiceQueuesLog/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3402=['multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x23d7ad,_0x4e7a26){var _0xa7bfb3=function(_0x33edd4){while(--_0x33edd4){_0x23d7ad['push'](_0x23d7ad['shift']());}};_0xa7bfb3(++_0x4e7a26);}(_0x3402,0x1f0));var _0x2340=function(_0x7c6fe3,_0x188961){_0x7c6fe3=_0x7c6fe3-0x0;var _0x974db9=_0x3402[_0x7c6fe3];return _0x974db9;};'use strict';var multer=require(_0x2340('0x0'));var util=require('util');var path=require(_0x2340('0x1'));var timeout=require(_0x2340('0x2'));var express=require(_0x2340('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2340('0x4'));var interaction=require(_0x2340('0x5'));var config=require(_0x2340('0x6'));var controller=require(_0x2340('0x7'));router[_0x2340('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2340('0x8')](_0x2340('0x9'),auth[_0x2340('0xa')](),controller[_0x2340('0xb')]);router[_0x2340('0xc')]('/',auth['isAuthenticated'](),controller[_0x2340('0xd')]);router[_0x2340('0xe')](_0x2340('0x9'),auth[_0x2340('0xa')](),controller[_0x2340('0xf')]);router['delete'](_0x2340('0x9'),auth[_0x2340('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe492=['put','update','delete','/:id','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create'];(function(_0x2c293f,_0x584d76){var _0x1e29af=function(_0x50eb09){while(--_0x50eb09){_0x2c293f['push'](_0x2c293f['shift']());}};_0x1e29af(++_0x584d76);}(_0xe492,0x169));var _0x2e49=function(_0x2f8d76,_0x3f6a7c){_0x2f8d76=_0x2f8d76-0x0;var _0x3fbb4a=_0xe492[_0x2f8d76];return _0x3fbb4a;};'use strict';var multer=require(_0x2e49('0x0'));var util=require(_0x2e49('0x1'));var path=require(_0x2e49('0x2'));var timeout=require(_0x2e49('0x3'));var express=require('express');var router=express[_0x2e49('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2e49('0x5'));var interaction=require(_0x2e49('0x6'));var config=require(_0x2e49('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0x2e49('0x8')]('/',auth[_0x2e49('0x9')](),controller[_0x2e49('0xa')]);router[_0x2e49('0x8')]('/:id',auth[_0x2e49('0x9')](),controller[_0x2e49('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2e49('0xc')]);router[_0x2e49('0xd')]('/:id',auth[_0x2e49('0x9')](),controller[_0x2e49('0xe')]);router[_0x2e49('0xf')](_0x2e49('0x10'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 83666cf..0522df0 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5af=['STRING','DATE','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports'];(function(_0x84fa15,_0x22947b){var _0x34e652=function(_0x5367d2){while(--_0x5367d2){_0x84fa15['push'](_0x84fa15['shift']());}};_0x34e652(++_0x22947b);}(_0xe5af,0x1c0));var _0xfe5a=function(_0x3ff54f,_0x1877ad){_0x3ff54f=_0x3ff54f-0x0;var _0x29ae7e=_0xe5af[_0x3ff54f];return _0x29ae7e;};'use strict';var Sequelize=require(_0xfe5a('0x0'));var moment=require('moment');module[_0xfe5a('0x1')]={'time':{'type':Sequelize[_0xfe5a('0x2')]},'callid':{'type':Sequelize[_0xfe5a('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xfe5a('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xfe5a('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xfe5a('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xfe5a('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xfe5a('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xfe5a('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xfe5a('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xfe5a('0x3')],'allowNull':![],'defaultValue':Sequelize['literal'](_0xfe5a('0x4'))}}; \ No newline at end of file +var _0x7be8=['DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','STRING'];(function(_0x442ad9,_0x2a0ea7){var _0x480808=function(_0x4ab713){while(--_0x4ab713){_0x442ad9['push'](_0x442ad9['shift']());}};_0x480808(++_0x2a0ea7);}(_0x7be8,0x81));var _0x87be=function(_0x299b08,_0x5338a6){_0x299b08=_0x299b08-0x0;var _0x14d50c=_0x7be8[_0x299b08];return _0x14d50c;};'use strict';var Sequelize=require(_0x87be('0x0'));var moment=require('moment');module[_0x87be('0x1')]={'time':{'type':Sequelize[_0x87be('0x2')]},'callid':{'type':Sequelize[_0x87be('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x87be('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x87be('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x87be('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x87be('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x87be('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x87be('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x87be('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x87be('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x87be('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x87be('0x4')](_0x87be('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 80c0023..d9b29e4 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x85d6=['query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','name','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model'];(function(_0x19d4c7,_0x5357a6){var _0x814d48=function(_0x25d139){while(--_0x25d139){_0x19d4c7['push'](_0x19d4c7['shift']());}};_0x814d48(++_0x5357a6);}(_0x85d6,0x1d7));var _0x685d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x85d6[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x685d('0x0'));var rimraf=require(_0x685d('0x1'));var zipdir=require(_0x685d('0x2'));var jsonpatch=require(_0x685d('0x3'));var rp=require(_0x685d('0x4'));var moment=require(_0x685d('0x5'));var BPromise=require(_0x685d('0x6'));var Mustache=require(_0x685d('0x7'));var util=require('util');var path=require(_0x685d('0x8'));var sox=require(_0x685d('0x9'));var csv=require(_0x685d('0xa'));var ejs=require(_0x685d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x685d('0xc'));var crypto=require('crypto');var jsforce=require(_0x685d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x685d('0xa'));var querystring=require('querystring');var Papa=require(_0x685d('0xe'));var Redis=require('ioredis');var authService=require(_0x685d('0xf'));var qs=require(_0x685d('0x10'));var as=require(_0x685d('0x11'));var hardwareService=require(_0x685d('0x12'));var logger=require(_0x685d('0x13'))(_0x685d('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dc675,_0x539ed1){_0x539ed1=_0x539ed1||0xcc;return function(_0x51bfd2){if(_0x51bfd2){return _0x4dc675[_0x685d('0x15')](_0x539ed1);}return _0x4dc675['status'](_0x539ed1)[_0x685d('0x16')]();};}function respondWithResult(_0x59322d,_0x346542){_0x346542=_0x346542||0xc8;return function(_0x4288dc){if(_0x4288dc){return _0x59322d[_0x685d('0x17')](_0x346542)[_0x685d('0x18')](_0x4288dc);}};}function respondWithFilteredResult(_0x386f03,_0xe14d43){return function(_0x323742){if(_0x323742){var _0x55c021=typeof _0xe14d43[_0x685d('0x19')]===_0x685d('0x1a')&&typeof _0xe14d43['limit']===_0x685d('0x1a');var _0x17f354=_0x323742[_0x685d('0x1b')];var _0xeac0c1=_0x55c021?0x0:_0xe14d43[_0x685d('0x19')];var _0x3cd3ab=_0x55c021?_0x323742[_0x685d('0x1b')]:_0xe14d43[_0x685d('0x19')]+_0xe14d43[_0x685d('0x1c')];var _0x5aac25;if(_0x3cd3ab>=_0x17f354){_0x3cd3ab=_0x17f354;_0x5aac25=0xc8;}else{_0x5aac25=0xce;}_0x386f03[_0x685d('0x17')](_0x5aac25);return _0x386f03[_0x685d('0x1d')](_0x685d('0x1e'),_0xeac0c1+'-'+_0x3cd3ab+'/'+_0x17f354)[_0x685d('0x18')](_0x323742);}return null;};}function patchUpdates(_0x3fd6ef){return function(_0x581765){try{jsonpatch[_0x685d('0x1f')](_0x581765,_0x3fd6ef,!![]);}catch(_0x37d8ed){return BPromise[_0x685d('0x20')](_0x37d8ed);}return _0x581765[_0x685d('0x21')]();};}function saveUpdates(_0x12734c,_0x6b08da){return function(_0x1978c7){if(_0x1978c7){return _0x1978c7[_0x685d('0x22')](_0x12734c)['then'](function(_0x41d6f8){return _0x41d6f8;});}return null;};}function removeEntity(_0x335f5c,_0x38d972){return function(_0x372a0b){if(_0x372a0b){return _0x372a0b[_0x685d('0x23')]()[_0x685d('0x24')](function(){_0x335f5c[_0x685d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38438a,_0x47cc48){return function(_0x44017f){if(!_0x44017f){_0x38438a[_0x685d('0x15')](0x194);}return _0x44017f;};}function handleError(_0x5ddc39,_0x4e4b29){_0x4e4b29=_0x4e4b29||0x1f4;return function(_0x25ae31){logger[_0x685d('0x25')](_0x25ae31['stack']);if(_0x25ae31[_0x685d('0x26')]){delete _0x25ae31[_0x685d('0x26')];}_0x5ddc39[_0x685d('0x17')](_0x4e4b29)['send'](_0x25ae31);};}exports[_0x685d('0x27')]=function(_0x1f8ca7,_0x2b17e1){var _0x4a42b3={},_0x3b9877={},_0x43f554={'count':0x0,'rows':[]};var _0x44d936=_[_0x685d('0x28')](db[_0x685d('0x29')][_0x685d('0x2a')],function(_0x3ae7b6){return{'name':_0x3ae7b6[_0x685d('0x2b')],'type':_0x3ae7b6[_0x685d('0x2c')][_0x685d('0x2d')]};});_0x3b9877[_0x685d('0x2e')]=_[_0x685d('0x28')](_0x44d936,_0x685d('0x26'));_0x3b9877[_0x685d('0x2f')]=_[_0x685d('0x30')](_0x1f8ca7[_0x685d('0x2f')]);_0x3b9877['filters']=_[_0x685d('0x31')](_0x3b9877[_0x685d('0x2e')],_0x3b9877[_0x685d('0x2f')]);_0x4a42b3[_0x685d('0x32')]=_[_0x685d('0x31')](_0x3b9877[_0x685d('0x2e')],qs[_0x685d('0x33')](_0x1f8ca7[_0x685d('0x2f')][_0x685d('0x33')]));_0x4a42b3[_0x685d('0x32')]=_0x4a42b3['attributes'][_0x685d('0x34')]?_0x4a42b3[_0x685d('0x32')]:_0x3b9877['model'];if(!_0x1f8ca7['query'][_0x685d('0x35')](_0x685d('0x36'))){_0x4a42b3['limit']=qs[_0x685d('0x1c')](_0x1f8ca7['query']['limit']);_0x4a42b3[_0x685d('0x19')]=qs[_0x685d('0x19')](_0x1f8ca7[_0x685d('0x2f')]['offset']);}_0x4a42b3[_0x685d('0x37')]=qs[_0x685d('0x38')](_0x1f8ca7[_0x685d('0x2f')][_0x685d('0x38')]);_0x4a42b3[_0x685d('0x39')]=qs[_0x685d('0x3a')](_[_0x685d('0x3b')](_0x1f8ca7[_0x685d('0x2f')],_0x3b9877[_0x685d('0x3a')]),_0x44d936);if(_0x1f8ca7[_0x685d('0x2f')][_0x685d('0x3c')]){_0x4a42b3['where']=_[_0x685d('0x3d')](_0x4a42b3['where'],{'$or':_['map'](_0x44d936,function(_0x5e6fb2){if(_0x5e6fb2[_0x685d('0x2c')]!==_0x685d('0x3e')){var _0x21fe70={};_0x21fe70[_0x5e6fb2[_0x685d('0x26')]]={'$like':'%'+_0x1f8ca7['query'][_0x685d('0x3c')]+'%'};return _0x21fe70;}})});}_0x4a42b3=_[_0x685d('0x3d')]({},_0x4a42b3,_0x1f8ca7[_0x685d('0x3f')]);var _0x52b8b4={'where':_0x4a42b3['where']};return db[_0x685d('0x29')][_0x685d('0x1b')](_0x52b8b4)[_0x685d('0x24')](function(_0x377d3a){_0x43f554[_0x685d('0x1b')]=_0x377d3a;if(_0x1f8ca7[_0x685d('0x2f')]['includeAll']){_0x4a42b3[_0x685d('0x40')]=[{'all':!![]}];}return db[_0x685d('0x29')][_0x685d('0x41')](_0x4a42b3);})[_0x685d('0x24')](function(_0x1a48f2){_0x43f554[_0x685d('0x42')]=_0x1a48f2;return _0x43f554;})[_0x685d('0x24')](respondWithFilteredResult(_0x2b17e1,_0x4a42b3))['catch'](handleError(_0x2b17e1,null));};exports[_0x685d('0x43')]=function(_0x30aa7a,_0x4dc872){var _0xd6be9f={'raw':!![],'where':{'id':_0x30aa7a[_0x685d('0x44')]['id']}},_0x356301={};_0x356301[_0x685d('0x2e')]=_[_0x685d('0x30')](db[_0x685d('0x29')][_0x685d('0x2a')]);_0x356301['query']=_[_0x685d('0x30')](_0x30aa7a[_0x685d('0x2f')]);_0x356301['filters']=_[_0x685d('0x31')](_0x356301['model'],_0x356301[_0x685d('0x2f')]);_0xd6be9f[_0x685d('0x32')]=_[_0x685d('0x31')](_0x356301[_0x685d('0x2e')],qs[_0x685d('0x33')](_0x30aa7a[_0x685d('0x2f')][_0x685d('0x33')]));_0xd6be9f[_0x685d('0x32')]=_0xd6be9f['attributes'][_0x685d('0x34')]?_0xd6be9f[_0x685d('0x32')]:_0x356301[_0x685d('0x2e')];if(_0x30aa7a[_0x685d('0x2f')][_0x685d('0x45')]){_0xd6be9f[_0x685d('0x40')]=[{'all':!![]}];}_0xd6be9f=_[_0x685d('0x3d')]({},_0xd6be9f,_0x30aa7a[_0x685d('0x3f')]);return db[_0x685d('0x29')][_0x685d('0x46')](_0xd6be9f)[_0x685d('0x24')](handleEntityNotFound(_0x4dc872,null))['then'](respondWithResult(_0x4dc872,null))[_0x685d('0x47')](handleError(_0x4dc872,null));};exports['create']=function(_0x1956e3,_0x248fab){return db[_0x685d('0x29')][_0x685d('0x48')](_0x1956e3['body'],{})[_0x685d('0x24')](respondWithResult(_0x248fab,0xc9))['catch'](handleError(_0x248fab,null));};exports[_0x685d('0x22')]=function(_0x5c14a7,_0x89a1cb){if(_0x5c14a7[_0x685d('0x49')]['id']){delete _0x5c14a7[_0x685d('0x49')]['id'];}return db[_0x685d('0x29')][_0x685d('0x46')]({'where':{'id':_0x5c14a7[_0x685d('0x44')]['id']}})[_0x685d('0x24')](handleEntityNotFound(_0x89a1cb,null))[_0x685d('0x24')](saveUpdates(_0x5c14a7[_0x685d('0x49')],null))[_0x685d('0x24')](respondWithResult(_0x89a1cb,null))[_0x685d('0x47')](handleError(_0x89a1cb,null));};exports['destroy']=function(_0x14b86c,_0x1820a4){return db[_0x685d('0x29')][_0x685d('0x46')]({'where':{'id':_0x14b86c[_0x685d('0x44')]['id']}})['then'](handleEntityNotFound(_0x1820a4,null))['then'](removeEntity(_0x1820a4,null))[_0x685d('0x47')](handleError(_0x1820a4,null));}; \ No newline at end of file +var _0xa58a=['VoiceQueuesLog','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','rawAttributes','keys','catch','create','body','find','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','squel','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','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send'];(function(_0x22c512,_0x2ad19b){var _0xfbb64b=function(_0x585ac1){while(--_0x585ac1){_0x22c512['push'](_0x22c512['shift']());}};_0xfbb64b(++_0x2ad19b);}(_0xa58a,0x104));var _0xaa58=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0xa58a[_0x1347f8];return _0x218368;};'use strict';var emlformat=require(_0xaa58('0x0'));var rimraf=require(_0xaa58('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa58('0x2'));var rp=require('request-promise');var moment=require(_0xaa58('0x3'));var BPromise=require(_0xaa58('0x4'));var Mustache=require('mustache');var util=require(_0xaa58('0x5'));var path=require(_0xaa58('0x6'));var sox=require(_0xaa58('0x7'));var csv=require('to-csv');var ejs=require(_0xaa58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa58('0x9'));var squel=require(_0xaa58('0xa'));var crypto=require('crypto');var jsforce=require(_0xaa58('0xb'));var deskjs=require(_0xaa58('0xc'));var toCsv=require(_0xaa58('0xd'));var querystring=require(_0xaa58('0xe'));var Papa=require(_0xaa58('0xf'));var Redis=require(_0xaa58('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xaa58('0x11'));var as=require(_0xaa58('0x12'));var hardwareService=require(_0xaa58('0x13'));var logger=require(_0xaa58('0x14'))(_0xaa58('0x15'));var utils=require(_0xaa58('0x16'));var config=require(_0xaa58('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xaa58('0x18'))['db'];function respondWithStatusCode(_0x271a91,_0x8eb501){_0x8eb501=_0x8eb501||0xcc;return function(_0x3056b7){if(_0x3056b7){return _0x271a91[_0xaa58('0x19')](_0x8eb501);}return _0x271a91[_0xaa58('0x1a')](_0x8eb501)[_0xaa58('0x1b')]();};}function respondWithResult(_0x8aa1af,_0x1a074f){_0x1a074f=_0x1a074f||0xc8;return function(_0x52e4e1){if(_0x52e4e1){return _0x8aa1af[_0xaa58('0x1a')](_0x1a074f)[_0xaa58('0x1c')](_0x52e4e1);}};}function respondWithFilteredResult(_0x5673d2,_0x4d03a1){return function(_0x537b3d){if(_0x537b3d){var _0xb29157=typeof _0x4d03a1[_0xaa58('0x1d')]===_0xaa58('0x1e')&&typeof _0x4d03a1[_0xaa58('0x1f')]===_0xaa58('0x1e');var _0x25683c=_0x537b3d[_0xaa58('0x20')];var _0x410942=_0xb29157?0x0:_0x4d03a1[_0xaa58('0x1d')];var _0xb5d8e7=_0xb29157?_0x537b3d[_0xaa58('0x20')]:_0x4d03a1['offset']+_0x4d03a1[_0xaa58('0x1f')];var _0x3b403a;if(_0xb5d8e7>=_0x25683c){_0xb5d8e7=_0x25683c;_0x3b403a=0xc8;}else{_0x3b403a=0xce;}_0x5673d2[_0xaa58('0x1a')](_0x3b403a);return _0x5673d2['set'](_0xaa58('0x21'),_0x410942+'-'+_0xb5d8e7+'/'+_0x25683c)[_0xaa58('0x1c')](_0x537b3d);}return null;};}function patchUpdates(_0x23ca97){return function(_0x42215c){try{jsonpatch[_0xaa58('0x22')](_0x42215c,_0x23ca97,!![]);}catch(_0x3fbc51){return BPromise[_0xaa58('0x23')](_0x3fbc51);}return _0x42215c[_0xaa58('0x24')]();};}function saveUpdates(_0x1f475d,_0x2f407a){return function(_0x45a4c7){if(_0x45a4c7){return _0x45a4c7[_0xaa58('0x25')](_0x1f475d)['then'](function(_0x183b43){return _0x183b43;});}return null;};}function removeEntity(_0x5d7fef,_0x2c7105){return function(_0x3f16b5){if(_0x3f16b5){return _0x3f16b5[_0xaa58('0x26')]()[_0xaa58('0x27')](function(){_0x5d7fef[_0xaa58('0x1a')](0xcc)[_0xaa58('0x1b')]();});}};}function handleEntityNotFound(_0x16b94a,_0x405332){return function(_0x457293){if(!_0x457293){_0x16b94a[_0xaa58('0x19')](0x194);}return _0x457293;};}function handleError(_0x55b518,_0x19f601){_0x19f601=_0x19f601||0x1f4;return function(_0x242479){logger[_0xaa58('0x28')](_0x242479[_0xaa58('0x29')]);if(_0x242479[_0xaa58('0x2a')]){delete _0x242479[_0xaa58('0x2a')];}_0x55b518['status'](_0x19f601)[_0xaa58('0x2b')](_0x242479);};}exports['index']=function(_0x3eaf8c,_0x29c581){var _0x338acb={},_0x49eeb7={},_0x137d70={'count':0x0,'rows':[]};var _0x1c5507=_['map'](db[_0xaa58('0x2c')]['rawAttributes'],function(_0x3835fe){return{'name':_0x3835fe['fieldName'],'type':_0x3835fe[_0xaa58('0x2d')][_0xaa58('0x2e')]};});_0x49eeb7[_0xaa58('0x2f')]=_[_0xaa58('0x30')](_0x1c5507,'name');_0x49eeb7[_0xaa58('0x31')]=_['keys'](_0x3eaf8c[_0xaa58('0x31')]);_0x49eeb7[_0xaa58('0x32')]=_[_0xaa58('0x33')](_0x49eeb7['model'],_0x49eeb7[_0xaa58('0x31')]);_0x338acb['attributes']=_[_0xaa58('0x33')](_0x49eeb7[_0xaa58('0x2f')],qs[_0xaa58('0x34')](_0x3eaf8c['query'][_0xaa58('0x34')]));_0x338acb['attributes']=_0x338acb[_0xaa58('0x35')][_0xaa58('0x36')]?_0x338acb[_0xaa58('0x35')]:_0x49eeb7[_0xaa58('0x2f')];if(!_0x3eaf8c[_0xaa58('0x31')][_0xaa58('0x37')](_0xaa58('0x38'))){_0x338acb[_0xaa58('0x1f')]=qs[_0xaa58('0x1f')](_0x3eaf8c[_0xaa58('0x31')][_0xaa58('0x1f')]);_0x338acb[_0xaa58('0x1d')]=qs[_0xaa58('0x1d')](_0x3eaf8c[_0xaa58('0x31')]['offset']);}_0x338acb[_0xaa58('0x39')]=qs[_0xaa58('0x3a')](_0x3eaf8c[_0xaa58('0x31')][_0xaa58('0x3a')]);_0x338acb['where']=qs['filters'](_[_0xaa58('0x3b')](_0x3eaf8c['query'],_0x49eeb7[_0xaa58('0x32')]),_0x1c5507);if(_0x3eaf8c['query'][_0xaa58('0x3c')]){_0x338acb[_0xaa58('0x3d')]=_['merge'](_0x338acb[_0xaa58('0x3d')],{'$or':_[_0xaa58('0x30')](_0x1c5507,function(_0xa088e6){if(_0xa088e6[_0xaa58('0x2d')]!==_0xaa58('0x3e')){var _0x303c56={};_0x303c56[_0xa088e6[_0xaa58('0x2a')]]={'$like':'%'+_0x3eaf8c[_0xaa58('0x31')][_0xaa58('0x3c')]+'%'};return _0x303c56;}})});}_0x338acb=_[_0xaa58('0x3f')]({},_0x338acb,_0x3eaf8c[_0xaa58('0x40')]);var _0x43c62a={'where':_0x338acb[_0xaa58('0x3d')]};return db[_0xaa58('0x2c')][_0xaa58('0x20')](_0x43c62a)['then'](function(_0x3e176b){_0x137d70['count']=_0x3e176b;if(_0x3eaf8c[_0xaa58('0x31')][_0xaa58('0x41')]){_0x338acb[_0xaa58('0x42')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xaa58('0x43')](_0x338acb);})['then'](function(_0x5a055a){_0x137d70[_0xaa58('0x44')]=_0x5a055a;return _0x137d70;})['then'](respondWithFilteredResult(_0x29c581,_0x338acb))['catch'](handleError(_0x29c581,null));};exports['show']=function(_0x3009f5,_0x3d561a){var _0x3a6f58={'raw':!![],'where':{'id':_0x3009f5[_0xaa58('0x45')]['id']}},_0x2e2257={};_0x2e2257['model']=_['keys'](db[_0xaa58('0x2c')][_0xaa58('0x46')]);_0x2e2257[_0xaa58('0x31')]=_[_0xaa58('0x47')](_0x3009f5[_0xaa58('0x31')]);_0x2e2257[_0xaa58('0x32')]=_[_0xaa58('0x33')](_0x2e2257['model'],_0x2e2257[_0xaa58('0x31')]);_0x3a6f58[_0xaa58('0x35')]=_[_0xaa58('0x33')](_0x2e2257[_0xaa58('0x2f')],qs[_0xaa58('0x34')](_0x3009f5['query']['fields']));_0x3a6f58[_0xaa58('0x35')]=_0x3a6f58[_0xaa58('0x35')][_0xaa58('0x36')]?_0x3a6f58['attributes']:_0x2e2257[_0xaa58('0x2f')];if(_0x3009f5[_0xaa58('0x31')][_0xaa58('0x41')]){_0x3a6f58[_0xaa58('0x42')]=[{'all':!![]}];}_0x3a6f58=_[_0xaa58('0x3f')]({},_0x3a6f58,_0x3009f5[_0xaa58('0x40')]);return db[_0xaa58('0x2c')]['find'](_0x3a6f58)['then'](handleEntityNotFound(_0x3d561a,null))[_0xaa58('0x27')](respondWithResult(_0x3d561a,null))[_0xaa58('0x48')](handleError(_0x3d561a,null));};exports[_0xaa58('0x49')]=function(_0x5c3f49,_0x30d0b4){return db[_0xaa58('0x2c')][_0xaa58('0x49')](_0x5c3f49[_0xaa58('0x4a')],{})[_0xaa58('0x27')](respondWithResult(_0x30d0b4,0xc9))['catch'](handleError(_0x30d0b4,null));};exports[_0xaa58('0x25')]=function(_0x4e1030,_0x16a579){if(_0x4e1030[_0xaa58('0x4a')]['id']){delete _0x4e1030[_0xaa58('0x4a')]['id'];}return db[_0xaa58('0x2c')][_0xaa58('0x4b')]({'where':{'id':_0x4e1030[_0xaa58('0x45')]['id']}})[_0xaa58('0x27')](handleEntityNotFound(_0x16a579,null))[_0xaa58('0x27')](saveUpdates(_0x4e1030[_0xaa58('0x4a')],null))[_0xaa58('0x27')](respondWithResult(_0x16a579,null))['catch'](handleError(_0x16a579,null));};exports['destroy']=function(_0x3c5fc9,_0x30fd96){return db[_0xaa58('0x2c')]['find']({'where':{'id':_0x3c5fc9[_0xaa58('0x45')]['id']}})[_0xaa58('0x27')](handleEntityNotFound(_0x30fd96,null))[_0xaa58('0x27')](removeEntity(_0x30fd96,null))[_0xaa58('0x48')](handleError(_0x30fd96,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 9e7986c..18e6dbc 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.model.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd73a=['rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','lodash','util','../../config/logger','api','moment','path'];(function(_0x275630,_0x153371){var _0x4ca89c=function(_0x3c0b87){while(--_0x3c0b87){_0x275630['push'](_0x275630['shift']());}};_0x4ca89c(++_0x153371);}(_0xd73a,0x171));var _0xad73=function(_0x442212,_0x2c70ae){_0x442212=_0x442212-0x0;var _0xff6993=_0xd73a[_0x442212];return _0xff6993;};'use strict';var _=require(_0xad73('0x0'));var util=require(_0xad73('0x1'));var logger=require(_0xad73('0x2'))(_0xad73('0x3'));var moment=require(_0xad73('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xad73('0x5'));var rimraf=require(_0xad73('0x6'));var config=require(_0xad73('0x7'));var attributes=require(_0xad73('0x8'));module[_0xad73('0x9')]=function(_0x7d2258,_0x247d3c){return _0x7d2258[_0xad73('0xa')](_0xad73('0xb'),attributes,{'tableName':_0xad73('0xc'),'paranoid':![],'indexes':[{'name':_0xad73('0xd'),'fields':['event',_0xad73('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x4c3c=['util','api','request-promise','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event_dtm','event','lodash'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x4c3c,0x1e3));var _0xc4c3=function(_0x3fe780,_0x26079d){_0x3fe780=_0x3fe780-0x0;var _0x59c64e=_0x4c3c[_0x3fe780];return _0x59c64e;};'use strict';var _=require(_0xc4c3('0x0'));var util=require(_0xc4c3('0x1'));var logger=require('../../config/logger')(_0xc4c3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc4c3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc4c3('0x4'));var attributes=require(_0xc4c3('0x5'));module[_0xc4c3('0x6')]=function(_0x36cea1,_0x1cb620){return _0x36cea1[_0xc4c3('0x7')](_0xc4c3('0x8'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xc4c3('0x9'),'fields':[_0xc4c3('0xa'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 38ca611..06163c0 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe78c=['debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','randomstring','../../mysqldb','../../config/utils','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent'];(function(_0x1911ed,_0x4e8c73){var _0x11edaa=function(_0x216008){while(--_0x216008){_0x1911ed['push'](_0x1911ed['shift']());}};_0x11edaa(++_0x4e8c73);}(_0xe78c,0xaa));var _0xce78=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xe78c[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0xce78('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xce78('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce78('0x2'))['db'];var utils=require(_0xce78('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xce78('0x4')][_0xce78('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2afba0,_0x5b2057,_0x204148){return new BPromise(function(_0x1c3788,_0x29c2c0){return client[_0xce78('0x6')](_0x2afba0,_0x204148)[_0xce78('0x7')](function(_0x5d186a){logger['info'](_0xce78('0x8'),_0x5b2057,_0xce78('0x9'));logger[_0xce78('0xa')](_0xce78('0xb'),_0x5b2057,_0xce78('0x9'),JSON['stringify'](_0x5d186a));if(_0x5d186a['error']){if(_0x5d186a[_0xce78('0xc')][_0xce78('0xd')]===0x1f4){logger[_0xce78('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5b2057,_0x5d186a[_0xce78('0xc')]['message']);return _0x29c2c0(_0x5d186a[_0xce78('0xc')][_0xce78('0xe')]);}logger['error'](_0xce78('0x8'),_0x5b2057,_0x5d186a['error'][_0xce78('0xe')]);return _0x1c3788(_0x5d186a[_0xce78('0xc')][_0xce78('0xe')]);}else{logger[_0xce78('0xf')](_0xce78('0x8'),_0x5b2057,_0xce78('0x9'));_0x1c3788(_0x5d186a[_0xce78('0x10')][_0xce78('0xe')]);}})[_0xce78('0x11')](function(_0xe5c945){logger[_0xce78('0xc')](_0xce78('0x8'),_0x5b2057,_0xe5c945);_0x29c2c0(_0xe5c945);});});} \ No newline at end of file +var _0x657b=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x657b,0x131));var _0xb657=function(_0x246c1c,_0x538e20){_0x246c1c=_0x246c1c-0x0;var _0x4ef12c=_0x657b[_0x246c1c];return _0x4ef12c;};'use strict';var _=require(_0xb657('0x0'));var util=require(_0xb657('0x1'));var moment=require(_0xb657('0x2'));var BPromise=require(_0xb657('0x3'));var rs=require(_0xb657('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb657('0x5'))['db'];var utils=require(_0xb657('0x6'));var logger=require('../../config/logger')(_0xb657('0x7'));var config=require(_0xb657('0x8'));var jayson=require(_0xb657('0x9'));var client=jayson[_0xb657('0xa')][_0xb657('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d54f6,_0x471e78,_0x55acdf){return new BPromise(function(_0x326dd7,_0x42a844){return client[_0xb657('0xc')](_0x5d54f6,_0x55acdf)['then'](function(_0x36b334){logger['info'](_0xb657('0xd'),_0x471e78,'request\x20sent');logger[_0xb657('0xe')](_0xb657('0xf'),_0x471e78,_0xb657('0x10'),JSON['stringify'](_0x36b334));if(_0x36b334[_0xb657('0x11')]){if(_0x36b334[_0xb657('0x11')][_0xb657('0x12')]===0x1f4){logger[_0xb657('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x471e78,_0x36b334[_0xb657('0x11')][_0xb657('0x13')]);return _0x42a844(_0x36b334['error'][_0xb657('0x13')]);}logger[_0xb657('0x11')](_0xb657('0xd'),_0x471e78,_0x36b334[_0xb657('0x11')]['message']);return _0x326dd7(_0x36b334[_0xb657('0x11')][_0xb657('0x13')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x471e78,_0xb657('0x10'));_0x326dd7(_0x36b334[_0xb657('0x14')][_0xb657('0x13')]);}})[_0xb657('0x15')](function(_0x17c045){logger[_0xb657('0x11')](_0xb657('0xd'),_0x471e78,_0x17c045);_0x42a844(_0x17c045);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 80d8027..8119861 100644 --- a/server/api/voiceRecording/index.js +++ b/server/api/voiceRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec3d=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id/download','/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4734d8,_0x479950){var _0x3b1120=function(_0x4a5d1c){while(--_0x4a5d1c){_0x4734d8['push'](_0x4734d8['shift']());}};_0x3b1120(++_0x479950);}(_0xec3d,0xef));var _0xdec3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xec3d[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xdec3('0x0'));var util=require(_0xdec3('0x1'));var path=require(_0xdec3('0x2'));var timeout=require(_0xdec3('0x3'));var express=require(_0xdec3('0x4'));var router=express[_0xdec3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdec3('0x6'));var interaction=require(_0xdec3('0x7'));var config=require(_0xdec3('0x8'));var controller=require('./voiceRecording.controller');router[_0xdec3('0x9')]('/',auth[_0xdec3('0xa')](),controller[_0xdec3('0xb')]);router[_0xdec3('0x9')](_0xdec3('0xc'),auth[_0xdec3('0xa')](),controller[_0xdec3('0xd')]);router[_0xdec3('0x9')]('/:id',auth[_0xdec3('0xa')](),controller['show']);router[_0xdec3('0x9')](_0xdec3('0xe'),auth[_0xdec3('0xa')](),controller['download']);router[_0xdec3('0x9')](_0xdec3('0xf'),controller[_0xdec3('0x10')]);router[_0xdec3('0x9')](_0xdec3('0x11'),auth[_0xdec3('0xa')](),controller['downloadTranscribe']);router[_0xdec3('0x12')]('/',auth[_0xdec3('0xa')](),controller[_0xdec3('0x13')]);router[_0xdec3('0x12')](_0xdec3('0x11'),auth[_0xdec3('0xa')](),controller[_0xdec3('0x14')]);router[_0xdec3('0x15')](_0xdec3('0x16'),auth[_0xdec3('0xa')](),controller[_0xdec3('0x17')]);router[_0xdec3('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xdec3('0x19')]);module[_0xdec3('0x1a')]=router; \ No newline at end of file +var _0x7861=['download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','runTranscribe','put','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','describe','/:id','/:id/download'];(function(_0x5e03ab,_0x595d38){var _0x25a10f=function(_0x49fd47){while(--_0x49fd47){_0x5e03ab['push'](_0x5e03ab['shift']());}};_0x25a10f(++_0x595d38);}(_0x7861,0x153));var _0x1786=function(_0x49b383,_0x268869){_0x49b383=_0x49b383-0x0;var _0x20948d=_0x7861[_0x49b383];return _0x20948d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1786('0x0'));var timeout=require(_0x1786('0x1'));var express=require(_0x1786('0x2'));var router=express[_0x1786('0x3')]();var fs_extra=require(_0x1786('0x4'));var auth=require(_0x1786('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1786('0x6'));var controller=require(_0x1786('0x7'));router[_0x1786('0x8')]('/',auth[_0x1786('0x9')](),controller['index']);router['get']('/describe',auth[_0x1786('0x9')](),controller[_0x1786('0xa')]);router['get'](_0x1786('0xb'),auth[_0x1786('0x9')](),controller['show']);router[_0x1786('0x8')](_0x1786('0xc'),auth[_0x1786('0x9')](),controller[_0x1786('0xd')]);router[_0x1786('0x8')](_0x1786('0xe'),controller[_0x1786('0xf')]);router[_0x1786('0x8')](_0x1786('0x10'),auth[_0x1786('0x9')](),controller[_0x1786('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/transcribe',auth[_0x1786('0x9')](),controller[_0x1786('0x12')]);router[_0x1786('0x13')](_0x1786('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x1786('0x14')](_0x1786('0xb'),auth[_0x1786('0x9')](),controller[_0x1786('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 3e74681..e5c08c5 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 6baf131..fe98bf0 100644 --- a/server/api/voiceRecording/voiceRecording.controller.js +++ b/server/api/voiceRecording/voiceRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ca0=['Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceRecording','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','describe','download','uniqueid','existsSync','decryptFile','value','Sequelize','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','send','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','$and','push','%s.cypher','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','end','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','format','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','transcribeStatus','runTranscribe','findOne','secrets','recording','Setting','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion'];(function(_0x933266,_0x303366){var _0x2471f4=function(_0x913138){while(--_0x913138){_0x933266['push'](_0x933266['shift']());}};_0x2471f4(++_0x303366);}(_0x4ca0,0x1de));var _0x04ca=function(_0x12f9e3,_0x3fadc1){_0x12f9e3=_0x12f9e3-0x0;var _0x2de0c8=_0x4ca0[_0x12f9e3];return _0x2de0c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x04ca('0x0'));var zipdir=require(_0x04ca('0x1'));var jsonpatch=require(_0x04ca('0x2'));var rp=require(_0x04ca('0x3'));var moment=require(_0x04ca('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x04ca('0x5'));var util=require(_0x04ca('0x6'));var path=require(_0x04ca('0x7'));var sox=require(_0x04ca('0x8'));var csv=require(_0x04ca('0x9'));var ejs=require(_0x04ca('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x04ca('0xb'));var squel=require(_0x04ca('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x04ca('0xd'));var toCsv=require(_0x04ca('0x9'));var querystring=require(_0x04ca('0xe'));var Papa=require(_0x04ca('0xf'));var AWS=require(_0x04ca('0x10'));var uuidv4=require(_0x04ca('0x11'));var Redis=require('ioredis');var authService=require(_0x04ca('0x12'));var qs=require(_0x04ca('0x13'));var as=require(_0x04ca('0x14'));var hardwareService=require(_0x04ca('0x15'));var logger=require('../../config/logger')(_0x04ca('0x16'));var utils=require(_0x04ca('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x04ca('0x18'));var db=require(_0x04ca('0x19'))['db'];function respondWithStatusCode(_0x49aa66,_0x4f80e1){_0x4f80e1=_0x4f80e1||0xcc;return function(_0x2e253b){if(_0x2e253b){return _0x49aa66[_0x04ca('0x1a')](_0x4f80e1);}return _0x49aa66[_0x04ca('0x1b')](_0x4f80e1)['end']();};}function respondWithResult(_0x30361e,_0x416cc5){_0x416cc5=_0x416cc5||0xc8;return function(_0x39998d){if(_0x39998d){return _0x30361e[_0x04ca('0x1b')](_0x416cc5)[_0x04ca('0x1c')](_0x39998d);}};}function respondWithFilteredResult(_0x47777e,_0x35da6f){return function(_0x2c8e3d){if(_0x2c8e3d){var _0x97df50=typeof _0x35da6f[_0x04ca('0x1d')]===_0x04ca('0x1e')&&typeof _0x35da6f[_0x04ca('0x1f')]==='undefined';var _0x407da1=_0x2c8e3d[_0x04ca('0x20')];var _0x5e1cf6=_0x97df50?0x0:_0x35da6f[_0x04ca('0x1d')];var _0x2ee2d8=_0x97df50?_0x2c8e3d[_0x04ca('0x20')]:_0x35da6f[_0x04ca('0x1d')]+_0x35da6f[_0x04ca('0x1f')];var _0x3b34ac;if(_0x2ee2d8>=_0x407da1){_0x2ee2d8=_0x407da1;_0x3b34ac=0xc8;}else{_0x3b34ac=0xce;}_0x47777e[_0x04ca('0x1b')](_0x3b34ac);return _0x47777e['set'](_0x04ca('0x21'),_0x5e1cf6+'-'+_0x2ee2d8+'/'+_0x407da1)[_0x04ca('0x1c')](_0x2c8e3d);}return null;};}function patchUpdates(_0xd39d4b){return function(_0x5a6f7d){try{jsonpatch[_0x04ca('0x22')](_0x5a6f7d,_0xd39d4b,!![]);}catch(_0xd69831){return BPromise[_0x04ca('0x23')](_0xd69831);}return _0x5a6f7d[_0x04ca('0x24')]();};}function saveUpdates(_0xe64454,_0x42074c){return function(_0x22ba23){if(_0x22ba23){return _0x22ba23['update'](_0xe64454)[_0x04ca('0x25')](function(_0x1dcf57){return _0x1dcf57;});}return null;};}function removeEntity(_0xa59420,_0x2cb5e2){return function(_0x585f17){if(_0x585f17){return _0x585f17[_0x04ca('0x26')]()['then'](function(){_0xa59420[_0x04ca('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17a057,_0x34b9ea){return function(_0x3446ba){if(!_0x3446ba){_0x17a057['sendStatus'](0x194);}return _0x3446ba;};}function handleError(_0x1db694,_0x3c3e47){_0x3c3e47=_0x3c3e47||0x1f4;return function(_0x25272a){logger[_0x04ca('0x27')](_0x25272a[_0x04ca('0x28')]);if(_0x25272a[_0x04ca('0x29')]){delete _0x25272a[_0x04ca('0x29')];}_0x1db694[_0x04ca('0x1b')](_0x3c3e47)['send'](_0x25272a);};}exports[_0x04ca('0x2a')]=function(_0x4d0bf8,_0x54640e){var _0x36cc51={},_0x1efdee={},_0x6d4610={'count':0x0,'rows':[]};var _0x328d65=_[_0x04ca('0x2b')](db[_0x04ca('0x2c')][_0x04ca('0x2d')],function(_0x1e9fa0){return{'name':_0x1e9fa0[_0x04ca('0x2e')],'type':_0x1e9fa0[_0x04ca('0x2f')][_0x04ca('0x30')]};});_0x1efdee['model']=_['differenceBy'](_[_0x04ca('0x2b')](_0x328d65,_0x04ca('0x29')),['format']);_0x1efdee['query']=_[_0x04ca('0x31')](_0x4d0bf8['query']);_0x1efdee[_0x04ca('0x32')]=_[_0x04ca('0x33')](_0x1efdee[_0x04ca('0x34')],_0x1efdee[_0x04ca('0x35')]);_0x36cc51[_0x04ca('0x36')]=_[_0x04ca('0x33')](_0x1efdee[_0x04ca('0x34')],qs[_0x04ca('0x37')](_0x4d0bf8[_0x04ca('0x35')][_0x04ca('0x37')]));_0x36cc51[_0x04ca('0x36')]=_0x36cc51[_0x04ca('0x36')][_0x04ca('0x38')]?_0x36cc51[_0x04ca('0x36')]:_0x1efdee[_0x04ca('0x34')];if(!_0x4d0bf8[_0x04ca('0x35')][_0x04ca('0x39')]('nolimit')){_0x36cc51[_0x04ca('0x1f')]=qs[_0x04ca('0x1f')](_0x4d0bf8[_0x04ca('0x35')]['limit']);_0x36cc51['offset']=qs[_0x04ca('0x1d')](_0x4d0bf8[_0x04ca('0x35')][_0x04ca('0x1d')]);}_0x36cc51[_0x04ca('0x3a')]=qs[_0x04ca('0x3b')](_0x4d0bf8[_0x04ca('0x35')][_0x04ca('0x3b')]);_0x36cc51[_0x04ca('0x3c')]=qs[_0x04ca('0x32')](_[_0x04ca('0x3d')](_0x4d0bf8[_0x04ca('0x35')],_0x1efdee[_0x04ca('0x32')]),_0x328d65);if(_0x4d0bf8['query'][_0x04ca('0x3e')]){_0x36cc51[_0x04ca('0x3c')]=_[_0x04ca('0x3f')](_0x36cc51[_0x04ca('0x3c')],{'$or':_['map'](_0x328d65,function(_0x7e2182){if(_0x7e2182['type']!==_0x04ca('0x40')){var _0x20bf3b={};_0x20bf3b[_0x7e2182[_0x04ca('0x29')]]={'$like':'%'+_0x4d0bf8[_0x04ca('0x35')][_0x04ca('0x3e')]+'%'};return _0x20bf3b;}})});}_0x36cc51=_[_0x04ca('0x3f')]({},_0x36cc51,_0x4d0bf8[_0x04ca('0x41')]);var _0x18c46e={'where':_0x36cc51[_0x04ca('0x3c')]};return db[_0x04ca('0x2c')][_0x04ca('0x20')](_0x18c46e)[_0x04ca('0x25')](function(_0x513484){_0x6d4610[_0x04ca('0x20')]=_0x513484;if(_0x4d0bf8[_0x04ca('0x35')][_0x04ca('0x42')]){_0x36cc51[_0x04ca('0x43')]=[{'all':!![]}];}return db[_0x04ca('0x2c')][_0x04ca('0x44')](_0x36cc51);})[_0x04ca('0x25')](function(_0x54a65f){_0x6d4610[_0x04ca('0x45')]=_0x54a65f;return _0x6d4610;})[_0x04ca('0x25')](respondWithFilteredResult(_0x54640e,_0x36cc51))[_0x04ca('0x46')](handleError(_0x54640e,null));};exports['show']=function(_0x5d48fe,_0x22ccae){var _0x42c8af={'raw':![],'where':{'id':_0x5d48fe[_0x04ca('0x47')]['id']}},_0x596a9a={};_0x596a9a[_0x04ca('0x34')]=_[_0x04ca('0x31')](db[_0x04ca('0x2c')]['rawAttributes']);_0x596a9a[_0x04ca('0x35')]=_[_0x04ca('0x31')](_0x5d48fe[_0x04ca('0x35')]);_0x596a9a[_0x04ca('0x32')]=_[_0x04ca('0x33')](_0x596a9a[_0x04ca('0x34')],_0x596a9a[_0x04ca('0x35')]);_0x42c8af[_0x04ca('0x36')]=_['intersection'](_0x596a9a[_0x04ca('0x34')],qs['fields'](_0x5d48fe[_0x04ca('0x35')]['fields']));_0x42c8af[_0x04ca('0x36')]=_0x42c8af[_0x04ca('0x36')]['length']?_0x42c8af[_0x04ca('0x36')]:_0x596a9a[_0x04ca('0x34')];if(_0x5d48fe[_0x04ca('0x35')][_0x04ca('0x42')]){_0x42c8af[_0x04ca('0x43')]=[{'all':!![]}];}_0x42c8af=_['merge']({},_0x42c8af,_0x5d48fe[_0x04ca('0x41')]);return db[_0x04ca('0x2c')][_0x04ca('0x48')](_0x42c8af)[_0x04ca('0x25')](handleEntityNotFound(_0x22ccae,null))[_0x04ca('0x25')](respondWithResult(_0x22ccae,null))[_0x04ca('0x46')](handleError(_0x22ccae,null));};exports['create']=function(_0x42f50f,_0x1170f7){return db[_0x04ca('0x2c')][_0x04ca('0x49')](_0x42f50f[_0x04ca('0x4a')],{})['then'](respondWithResult(_0x1170f7,0xc9))['catch'](handleError(_0x1170f7,null));};exports[_0x04ca('0x4b')]=function(_0x38ca35,_0x3c399b){if(_0x38ca35[_0x04ca('0x4a')]['id']){delete _0x38ca35['body']['id'];}return db[_0x04ca('0x2c')][_0x04ca('0x48')]({'where':{'id':_0x38ca35[_0x04ca('0x47')]['id']}})[_0x04ca('0x25')](handleEntityNotFound(_0x3c399b,null))[_0x04ca('0x25')](saveUpdates(_0x38ca35['body'],null))[_0x04ca('0x25')](respondWithResult(_0x3c399b,null))['catch'](handleError(_0x3c399b,null));};exports[_0x04ca('0x4c')]=function(_0xaf9ac9,_0x22ed6e){return db[_0x04ca('0x2c')][_0x04ca('0x4c')]()['then'](respondWithResult(_0x22ed6e,null))['catch'](handleError(_0x22ed6e,null));};exports[_0x04ca('0x4d')]=function(_0x2f5a9a,_0x5ac427,_0x13c6e1){var _0x59d0a5=require('../../components/encryptor');var _0x15aab5=![];var _0x7d3443={};if(_0x2f5a9a[_0x04ca('0x35')]['type']&&_0x2f5a9a['query'][_0x04ca('0x2f')]===_0x04ca('0x4e')){_0x7d3443[_0x04ca('0x4e')]=_0x2f5a9a[_0x04ca('0x47')]['id'];}else{_0x7d3443['id']=_0x2f5a9a[_0x04ca('0x47')]['id'];}return db[_0x04ca('0x2c')][_0x04ca('0x48')]({'where':_0x7d3443,'attributes':['id','value'],'raw':!![]})[_0x04ca('0x25')](handleEntityNotFound(_0x5ac427,null))[_0x04ca('0x25')](function(_0x1ccc8d){if(_0x1ccc8d){var _0x2427b8=_0x1ccc8d['value'];var _0x510fd3=util['format']('%s.cypher',_0x2427b8);if(fs[_0x04ca('0x4f')](_0x510fd3)){_0x15aab5=!![];return _0x59d0a5[_0x04ca('0x50')](_0x510fd3,_0x2427b8,config['secrets']['recording'])[_0x04ca('0x25')](function(){return _0x1ccc8d;});}return _0x1ccc8d;}})[_0x04ca('0x25')](function(_0x4916a6){if(_0x4916a6){var _0x4a70cd=_0x4916a6[_0x04ca('0x51')];if(!fs[_0x04ca('0x4f')](_0x4a70cd)){throw new db[(_0x04ca('0x52'))][(_0x04ca('0x53'))]('VoiceRecording\x20not\x20found');}if(_0x4916a6['filename']){return _0x5ac427[_0x04ca('0x4d')](_0x4a70cd,_0x4916a6[_0x04ca('0x54')]+path[_0x04ca('0x55')](_0x4a70cd),function(){if(_0x15aab5){fs[_0x04ca('0x56')](_0x4a70cd);}});}else{return _0x5ac427[_0x04ca('0x4d')](_0x4a70cd,function(_0x35e87d){if(_0x15aab5){fs[_0x04ca('0x56')](_0x4a70cd);}});}}})[_0x04ca('0x46')](function(_0x8bf2df){if(_0x8bf2df[_0x04ca('0x57')]===_0x04ca('0x58')){_0x5ac427[_0x04ca('0x1b')](0x194)[_0x04ca('0x59')](_0x04ca('0x5a'));}else{return handleError(_0x5ac427,null);}});};exports[_0x04ca('0x5b')]=function(_0x303ae2,_0x14bd70,_0x2dea44){var _0x2dbca8=require(_0x04ca('0x5c'));var _0x3a0036=![];var _0x3041c2={'$and':[db[_0x04ca('0x5d')][_0x04ca('0x3c')](db['sequelize']['fn'](_0x04ca('0x5e'),db['sequelize']['col'](_0x04ca('0x4e'))),_0x303ae2[_0x04ca('0x35')]['token'])]};if(_0x303ae2[_0x04ca('0x35')][_0x04ca('0x2f')]&&_0x303ae2[_0x04ca('0x35')][_0x04ca('0x2f')]==='uniqueid'){_0x3041c2['$and']['push']({'uniqueid':_0x303ae2[_0x04ca('0x47')]['id']});}else{_0x3041c2[_0x04ca('0x5f')][_0x04ca('0x60')]({'id':_0x303ae2[_0x04ca('0x47')]['id']});}return db[_0x04ca('0x2c')][_0x04ca('0x48')]({'where':_0x3041c2,'attributes':['id',_0x04ca('0x51')],'raw':!![]})[_0x04ca('0x25')](handleEntityNotFound(_0x14bd70,null))[_0x04ca('0x25')](function(_0x39210c){if(_0x39210c){var _0x2e0f0f=util['format'](_0x04ca('0x61'),_0x39210c[_0x04ca('0x51')]);if(fs[_0x04ca('0x4f')](_0x2e0f0f)){_0x3a0036=!![];return _0x2dbca8[_0x04ca('0x50')](_0x2e0f0f,_0x39210c['value'],config['secrets']['recording'])[_0x04ca('0x25')](function(){return _0x39210c;});}return _0x39210c;}})[_0x04ca('0x25')](function(_0x50d5b3){if(_0x50d5b3){if(!fs[_0x04ca('0x4f')](_0x50d5b3['value'])){throw new db[(_0x04ca('0x52'))][(_0x04ca('0x53'))]('VoiceRecording\x20not\x20found');}if(_0x50d5b3[_0x04ca('0x54')]){return _0x14bd70[_0x04ca('0x4d')](_0x50d5b3[_0x04ca('0x51')],_0x50d5b3[_0x04ca('0x54')]+path[_0x04ca('0x55')](_0x50d5b3[_0x04ca('0x51')]),function(){if(_0x3a0036){fs[_0x04ca('0x56')](_0x50d5b3[_0x04ca('0x51')]);}});}else{return _0x14bd70[_0x04ca('0x4d')](_0x50d5b3[_0x04ca('0x51')],function(_0x175041){if(_0x3a0036){fs[_0x04ca('0x56')](_0x50d5b3[_0x04ca('0x51')]);}});}}})[_0x04ca('0x46')](handleError(_0x14bd70,null));};exports[_0x04ca('0x26')]=function(_0x588ad1,_0x203c99){return db[_0x04ca('0x2c')][_0x04ca('0x48')]({'where':{'id':_0x588ad1[_0x04ca('0x47')]['id']}})[_0x04ca('0x25')](function(_0x22a226){if(_[_0x04ca('0x62')](_0x22a226)){throw new ReferenceError(_0x04ca('0x63'));}return _0x22a226;})['then'](function(_0x52b690){var _0x2e847d=_0x52b690['value'];logger[_0x04ca('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x2e847d);if(!_[_0x04ca('0x62')](_0x52b690['value'])&&fs[_0x04ca('0x4f')](_0x2e847d)){logger[_0x04ca('0x64')](_0x04ca('0x65')+_0x2e847d+_0x04ca('0x66'));fs[_0x04ca('0x67')](_0x2e847d);}_0x2e847d=_0x2e847d+'.cypher';if(!_[_0x04ca('0x62')](_0x52b690[_0x04ca('0x51')])&&fs['existsSync'](_0x2e847d)){logger[_0x04ca('0x64')](_0x04ca('0x65')+_0x2e847d+_0x04ca('0x66'));fs[_0x04ca('0x67')](_0x2e847d);}return _0x52b690;})[_0x04ca('0x25')](function(_0xead612){if(!_0xead612)throw new InternalError();return _0xead612[_0x04ca('0x26')]();})[_0x04ca('0x25')](function(){_0x203c99[_0x04ca('0x1b')](0xcc)[_0x04ca('0x68')]();})[_0x04ca('0x46')](handleError(_0x203c99,null));};function getBucketslist(_0x3b7d4c,_0x3bb458,_0x1f5c4d){return new Promise(function(_0x438f62,_0x552532){var _0x3221bb=new AWS['S3']({'accessKeyId':_0x3bb458,'secretAccessKey':_0x3b7d4c,'region':_0x1f5c4d});_0x3221bb[_0x04ca('0x69')]({},function(_0x4a82ed,_0x35eee6){if(_0x4a82ed){return _0x552532(_0x4a82ed);}else{return _0x438f62(_0x35eee6);}});});}function createBucket(_0x5deb9c,_0xaca1c4,_0x23792c,_0x4367f0){return new Promise(function(_0x171be2,_0x34bb4e){var _0x350285=new AWS['S3']({'accessKeyId':_0xaca1c4,'secretAccessKey':_0x5deb9c,'region':_0x23792c});_0x350285[_0x04ca('0x6a')]({'Bucket':_0x4367f0},function(_0x5d43e6,_0x31bb3d){if(_0x5d43e6){return _0x34bb4e(_0x5d43e6);}else{return _0x171be2(_0x31bb3d);}});});}function uploadFile(_0x2fb17f,_0x5237cf,_0x5804db,_0x216fcf,_0x2b0bf8,_0x4412d2){return new Promise(function(_0x305472,_0x29899b){var _0x1eaa04=new AWS['S3']({'accessKeyId':_0x5237cf,'secretAccessKey':_0x2fb17f,'region':_0x5804db});_0x1eaa04[_0x04ca('0x6b')]({'Bucket':_0x216fcf,'Key':_0x2b0bf8,'Body':_0x4412d2},function(_0x3ff99b,_0x570306){if(_0x3ff99b){return _0x29899b(_0x3ff99b);}else{return _0x305472(_0x570306);}});});}function startTranscribe(_0x398eef,_0x228e9c,_0xaca239,_0x4d0478,_0x55ec1a,_0x372876){return new Promise(function(_0x250b94,_0x2dad87){var _0x4b7dbc=new AWS[(_0x04ca('0x6c'))]({'accessKeyId':_0x228e9c,'secretAccessKey':_0x398eef,'region':_0xaca239});_0x4b7dbc[_0x04ca('0x6d')]({'TranscriptionJobName':_0x4d0478,'LanguageCode':_0x55ec1a,'Media':{'MediaFileUri':_0x372876}},function(_0x1e8bc9,_0x3c8228){if(_0x1e8bc9){return _0x2dad87(_0x1e8bc9);}else{return _0x250b94(_0x3c8228);}});});}function transcribe(_0x383fe8,_0x4d5a31,_0x6c932c,_0x7ea747,_0x329410,_0x31470d,_0x28bdff){return new Promise(function(_0x1c7c91,_0x959d28){var _0x469810={};logger[_0x04ca('0x64')](util[_0x04ca('0x6e')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x383fe8,_0x329410));return uploadFile(_0x4d5a31,_0x6c932c,_0x7ea747,_0x329410,path['basename'](_0x31470d),fs['readFileSync'](_0x31470d))[_0x04ca('0x25')](function(_0x3cd089){logger['info'](util[_0x04ca('0x6e')](_0x04ca('0x6f'),_0x383fe8,_0x329410,_0x3cd089[_0x04ca('0x70')]));_0x469810[_0x04ca('0x71')]=_0x3cd089['Bucket'];_0x469810['location']=_0x3cd089[_0x04ca('0x70')];logger['info'](util['format'](_0x04ca('0x72'),_0x383fe8));return startTranscribe(_0x4d5a31,_0x6c932c,_0x7ea747,uuidv4(),_0x28bdff,_0x3cd089[_0x04ca('0x70')]);})[_0x04ca('0x25')](function(_0x12400e){logger[_0x04ca('0x64')](util[_0x04ca('0x6e')](_0x04ca('0x73'),_0x383fe8,_0x12400e[_0x04ca('0x74')]['TranscriptionJobName']));_0x469810[_0x04ca('0x75')]=_0x12400e[_0x04ca('0x74')]['TranscriptionJobName'];_0x469810[_0x04ca('0x76')]=_0x12400e[_0x04ca('0x74')]['TranscriptionJobStatus'];return _0x1c7c91(_0x469810);})['catch'](function(_0x4115ab){return _0x959d28(_0x4115ab);});});}exports[_0x04ca('0x77')]=function(_0x2a4164,_0x4961cc,_0x3a0a6f){var _0x24c7b2;var _0xbaebf6;var _0x209b22;var _0x2b10de=require(_0x04ca('0x5c'));return db[_0x04ca('0x2c')][_0x04ca('0x78')]({'where':{'id':_0x2a4164[_0x04ca('0x47')]['id']}})[_0x04ca('0x25')](function(_0x557b74){if(_0x557b74){var _0x295c45=util['format'](_0x04ca('0x61'),_0x557b74[_0x04ca('0x51')]);if(fs['existsSync'](_0x295c45)){cypher=!![];return _0x2b10de[_0x04ca('0x50')](_0x295c45,_0x557b74[_0x04ca('0x51')],config[_0x04ca('0x79')][_0x04ca('0x7a')])[_0x04ca('0x25')](function(){return _0x557b74;});}return _0x557b74;}})['then'](function(_0x7ef534){if(!_0x7ef534){throw new db[(_0x04ca('0x52'))][(_0x04ca('0x53'))]('Voice\x20Recording\x20not\x20found');}_0xbaebf6=_0x7ef534;return db[_0x04ca('0x7b')][_0x04ca('0x78')]({'where':{'id':0x1}});})[_0x04ca('0x25')](handleEntityNotFound(_0x4961cc,null))[_0x04ca('0x25')](function(_0x63c25f){if(_0x63c25f){_0x24c7b2=_0x63c25f;if(!_0x24c7b2['transcribe']||!_0x24c7b2[_0x04ca('0x7c')]||!_0x24c7b2['transcribeRegion']||!_0x24c7b2[_0x04ca('0x7d')]||!_0x24c7b2[_0x04ca('0x71')]){throw new db['Sequelize'][(_0x04ca('0x53'))](_0x04ca('0x7e'));}if(_0x2a4164[_0x04ca('0x4a')][_0x04ca('0x7f')]&&(!_0x24c7b2[_0x04ca('0x80')]||!_0x24c7b2['sentimentAccountId']||!_0x24c7b2[_0x04ca('0x81')]||!_0x24c7b2[_0x04ca('0x7d')]||!_0x24c7b2[_0x04ca('0x71')])){throw new db['Sequelize'][(_0x04ca('0x53'))](_0x04ca('0x82'));}return db[_0x04ca('0x83')][_0x04ca('0x78')]({'where':{'id':_0x24c7b2[_0x04ca('0x7c')]}});}})[_0x04ca('0x25')](function(_0x103cc8){if(!_0x103cc8){throw new db[(_0x04ca('0x52'))][(_0x04ca('0x53'))](_0x04ca('0x84'));}if(!_0x103cc8[_0x04ca('0x85')]||!_0x103cc8[_0x04ca('0x86')]){throw new db[(_0x04ca('0x52'))]['ValidationError'](_0x04ca('0x87'));}_0x209b22=_0x103cc8;return getBucketslist(_0x209b22[_0x04ca('0x85')],_0x209b22[_0x04ca('0x86')],_0x24c7b2[_0x04ca('0x88')]);})['then'](function(_0x2680cf){if(_0x2680cf&&_0x2680cf[_0x04ca('0x89')]){var _0x133a23=_[_0x04ca('0x48')](_0x2680cf[_0x04ca('0x89')],function(_0x55d93e){return _0x55d93e[_0x04ca('0x8a')]===_0x24c7b2[_0x04ca('0x71')];});if(!_0x133a23){logger['info'](util['format'](_0x04ca('0x8b'),_0x2a4164[_0x04ca('0x47')]['id'],_0x24c7b2['bucket']));return createBucket(_0x209b22[_0x04ca('0x85')],_0x209b22[_0x04ca('0x86')],_0x24c7b2['transcribeRegion'],_0x24c7b2[_0x04ca('0x71')]);}logger[_0x04ca('0x64')](util[_0x04ca('0x6e')](_0x04ca('0x8c'),_0x2a4164[_0x04ca('0x47')]['id'],_0x24c7b2['bucket']));return;}})['then'](function(_0x171a28){if(_0xbaebf6[_0x04ca('0x76')]===_0x04ca('0x8d')){return transcribe(_0x2a4164['params']['id'],_0x209b22[_0x04ca('0x85')],_0x209b22[_0x04ca('0x86')],_0x24c7b2[_0x04ca('0x88')],_0x24c7b2[_0x04ca('0x71')],_0xbaebf6['value'],_0x24c7b2[_0x04ca('0x7d')]);}else{logger['info'](util['format'](_0x04ca('0x8e'),_0x2a4164['params']['id']));return{'transcribeStatus':_0x04ca('0x8f')};}})[_0x04ca('0x25')](function(_0x130a9c){if(_0x130a9c){_0x130a9c[_0x04ca('0x90')]=_0x2a4164[_0x04ca('0x4a')][_0x04ca('0x7f')];return _0xbaebf6[_0x04ca('0x91')](_0x130a9c);}})[_0x04ca('0x25')](respondWithResult(_0x4961cc,null))['catch'](handleError(_0x4961cc,null));};function writeFile(_0x2ee948,_0x3e91e4){return new Promise(function(_0x5acf31,_0x19b1f1){fs['writeFile'](_0x3e91e4,_0x2ee948,function(_0x318773,_0x1bbe3a){if(_0x318773){return _0x19b1f1(_0x318773);}else{return _0x5acf31(_0x1bbe3a);}});});}exports[_0x04ca('0x92')]=function(_0x41d670,_0x56cace,_0x1fa8ad){return db[_0x04ca('0x2c')][_0x04ca('0x78')]({'where':{'id':_0x41d670['params']['id']}})[_0x04ca('0x25')](handleEntityNotFound(_0x56cace))['then'](function(_0x24f7a1){if(_0x24f7a1&&_0x24f7a1[_0x04ca('0x93')]){var _0x30345c=_0x24f7a1['fileText'];var _0x45a8c3=config[_0x04ca('0x94')]+_0x04ca('0x95')+_0x24f7a1['id']+_0x04ca('0x96');if(fs[_0x04ca('0x4f')](_0x45a8c3)){return _0x45a8c3;}return writeFile(_0x30345c,_0x45a8c3)['then'](function(){return _0x45a8c3;});}else{throw new db[(_0x04ca('0x52'))][(_0x04ca('0x53'))](_0x04ca('0x97'));}})[_0x04ca('0x25')](function(_0x575b24){return _0x56cace[_0x04ca('0x4d')](_0x575b24);})[_0x04ca('0x46')](handleError(_0x56cace));}; \ No newline at end of file +var _0xb3c6=['crypto','desk.js','querystring','aws-sdk','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','sendStatus','error','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','type','key','differenceBy','format','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','catch','keys','include','create','body','update','find','describe','download','../../components/encryptor','uniqueid','params','value','%s.cypher','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','sequelize','MD5','token','$and','push','existsSync','decryptFile','destroy','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','status','listBuckets','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','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash'];(function(_0x42c2f7,_0x16bbdd){var _0x55c3ae=function(_0x24502f){while(--_0x24502f){_0x42c2f7['push'](_0x42c2f7['shift']());}};_0x55c3ae(++_0x16bbdd);}(_0xb3c6,0x12b));var _0x6b3c=function(_0x4295fd,_0x1f2573){_0x4295fd=_0x4295fd-0x0;var _0x96f34e=_0xb3c6[_0x4295fd];return _0x96f34e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b3c('0x0'));var zipdir=require(_0x6b3c('0x1'));var jsonpatch=require(_0x6b3c('0x2'));var rp=require(_0x6b3c('0x3'));var moment=require(_0x6b3c('0x4'));var BPromise=require(_0x6b3c('0x5'));var Mustache=require(_0x6b3c('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6b3c('0x7'));var csv=require(_0x6b3c('0x8'));var ejs=require(_0x6b3c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b3c('0xa'));var squel=require('squel');var crypto=require(_0x6b3c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6b3c('0xc'));var toCsv=require(_0x6b3c('0x8'));var querystring=require(_0x6b3c('0xd'));var Papa=require('papaparse');var AWS=require(_0x6b3c('0xe'));var uuidv4=require('uuid/v4');var Redis=require(_0x6b3c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6b3c('0x10'));var as=require(_0x6b3c('0x11'));var hardwareService=require(_0x6b3c('0x12'));var logger=require(_0x6b3c('0x13'))(_0x6b3c('0x14'));var utils=require(_0x6b3c('0x15'));var config=require(_0x6b3c('0x16'));var licenseUtil=require(_0x6b3c('0x17'));var db=require(_0x6b3c('0x18'))['db'];function respondWithStatusCode(_0x3ff726,_0x3e80d3){_0x3e80d3=_0x3e80d3||0xcc;return function(_0x221273){if(_0x221273){return _0x3ff726['sendStatus'](_0x3e80d3);}return _0x3ff726['status'](_0x3e80d3)[_0x6b3c('0x19')]();};}function respondWithResult(_0x23e80c,_0x428ba4){_0x428ba4=_0x428ba4||0xc8;return function(_0x16a8dc){if(_0x16a8dc){return _0x23e80c['status'](_0x428ba4)[_0x6b3c('0x1a')](_0x16a8dc);}};}function respondWithFilteredResult(_0x38ad04,_0x9849e7){return function(_0x298ea2){if(_0x298ea2){var _0x49aac9=typeof _0x9849e7[_0x6b3c('0x1b')]===_0x6b3c('0x1c')&&typeof _0x9849e7[_0x6b3c('0x1d')]===_0x6b3c('0x1c');var _0x2b2b22=_0x298ea2[_0x6b3c('0x1e')];var _0x2f07f7=_0x49aac9?0x0:_0x9849e7['offset'];var _0x8fea33=_0x49aac9?_0x298ea2[_0x6b3c('0x1e')]:_0x9849e7[_0x6b3c('0x1b')]+_0x9849e7[_0x6b3c('0x1d')];var _0x51be09;if(_0x8fea33>=_0x2b2b22){_0x8fea33=_0x2b2b22;_0x51be09=0xc8;}else{_0x51be09=0xce;}_0x38ad04['status'](_0x51be09);return _0x38ad04[_0x6b3c('0x1f')](_0x6b3c('0x20'),_0x2f07f7+'-'+_0x8fea33+'/'+_0x2b2b22)[_0x6b3c('0x1a')](_0x298ea2);}return null;};}function patchUpdates(_0x289e7c){return function(_0x5c6bcb){try{jsonpatch[_0x6b3c('0x21')](_0x5c6bcb,_0x289e7c,!![]);}catch(_0x5d9f68){return BPromise['reject'](_0x5d9f68);}return _0x5c6bcb[_0x6b3c('0x22')]();};}function saveUpdates(_0x2d77c6,_0x5b02cd){return function(_0x11cf59){if(_0x11cf59){return _0x11cf59['update'](_0x2d77c6)[_0x6b3c('0x23')](function(_0x260540){return _0x260540;});}return null;};}function removeEntity(_0x1dd1d5,_0x306784){return function(_0x1c94bb){if(_0x1c94bb){return _0x1c94bb['destroy']()[_0x6b3c('0x23')](function(){_0x1dd1d5['status'](0xcc)[_0x6b3c('0x19')]();});}};}function handleEntityNotFound(_0x25d8e8,_0x570ac4){return function(_0x38a553){if(!_0x38a553){_0x25d8e8[_0x6b3c('0x24')](0x194);}return _0x38a553;};}function handleError(_0x58c1aa,_0x32819f){_0x32819f=_0x32819f||0x1f4;return function(_0x5a0340){logger[_0x6b3c('0x25')](_0x5a0340[_0x6b3c('0x26')]);if(_0x5a0340[_0x6b3c('0x27')]){delete _0x5a0340[_0x6b3c('0x27')];}_0x58c1aa['status'](_0x32819f)[_0x6b3c('0x28')](_0x5a0340);};}exports['index']=function(_0x441c15,_0x567eb8){var _0x2274db={},_0x1dc2a2={},_0xce222c={'count':0x0,'rows':[]};var _0x5e802a=_[_0x6b3c('0x29')](db[_0x6b3c('0x2a')][_0x6b3c('0x2b')],function(_0x341531){return{'name':_0x341531[_0x6b3c('0x2c')],'type':_0x341531[_0x6b3c('0x2d')][_0x6b3c('0x2e')]};});_0x1dc2a2['model']=_[_0x6b3c('0x2f')](_[_0x6b3c('0x29')](_0x5e802a,_0x6b3c('0x27')),[_0x6b3c('0x30')]);_0x1dc2a2['query']=_['keys'](_0x441c15[_0x6b3c('0x31')]);_0x1dc2a2[_0x6b3c('0x32')]=_[_0x6b3c('0x33')](_0x1dc2a2['model'],_0x1dc2a2[_0x6b3c('0x31')]);_0x2274db[_0x6b3c('0x34')]=_['intersection'](_0x1dc2a2[_0x6b3c('0x35')],qs[_0x6b3c('0x36')](_0x441c15[_0x6b3c('0x31')]['fields']));_0x2274db['attributes']=_0x2274db[_0x6b3c('0x34')][_0x6b3c('0x37')]?_0x2274db[_0x6b3c('0x34')]:_0x1dc2a2[_0x6b3c('0x35')];if(!_0x441c15[_0x6b3c('0x31')][_0x6b3c('0x38')](_0x6b3c('0x39'))){_0x2274db[_0x6b3c('0x1d')]=qs['limit'](_0x441c15[_0x6b3c('0x31')]['limit']);_0x2274db[_0x6b3c('0x1b')]=qs[_0x6b3c('0x1b')](_0x441c15[_0x6b3c('0x31')][_0x6b3c('0x1b')]);}_0x2274db[_0x6b3c('0x3a')]=qs[_0x6b3c('0x3b')](_0x441c15['query'][_0x6b3c('0x3b')]);_0x2274db['where']=qs[_0x6b3c('0x32')](_[_0x6b3c('0x3c')](_0x441c15[_0x6b3c('0x31')],_0x1dc2a2['filters']),_0x5e802a);if(_0x441c15['query'][_0x6b3c('0x3d')]){_0x2274db[_0x6b3c('0x3e')]=_['merge'](_0x2274db[_0x6b3c('0x3e')],{'$or':_['map'](_0x5e802a,function(_0x3b57ce){if(_0x3b57ce[_0x6b3c('0x2d')]!==_0x6b3c('0x3f')){var _0x4fbe0a={};_0x4fbe0a[_0x3b57ce[_0x6b3c('0x27')]]={'$like':'%'+_0x441c15[_0x6b3c('0x31')][_0x6b3c('0x3d')]+'%'};return _0x4fbe0a;}})});}_0x2274db=_[_0x6b3c('0x40')]({},_0x2274db,_0x441c15[_0x6b3c('0x41')]);var _0x1d9fe4={'where':_0x2274db[_0x6b3c('0x3e')]};return db[_0x6b3c('0x2a')]['count'](_0x1d9fe4)[_0x6b3c('0x23')](function(_0x5db5d2){_0xce222c[_0x6b3c('0x1e')]=_0x5db5d2;if(_0x441c15['query'][_0x6b3c('0x42')]){_0x2274db['include']=[{'all':!![]}];}return db[_0x6b3c('0x2a')]['findAll'](_0x2274db);})['then'](function(_0x1899cf){_0xce222c[_0x6b3c('0x43')]=_0x1899cf;return _0xce222c;})['then'](respondWithFilteredResult(_0x567eb8,_0x2274db))[_0x6b3c('0x44')](handleError(_0x567eb8,null));};exports['show']=function(_0x1b6335,_0x3c2ebb){var _0x2680b9={'raw':![],'where':{'id':_0x1b6335['params']['id']}},_0x59b3b5={};_0x59b3b5['model']=_[_0x6b3c('0x45')](db[_0x6b3c('0x2a')][_0x6b3c('0x2b')]);_0x59b3b5['query']=_[_0x6b3c('0x45')](_0x1b6335[_0x6b3c('0x31')]);_0x59b3b5['filters']=_[_0x6b3c('0x33')](_0x59b3b5['model'],_0x59b3b5[_0x6b3c('0x31')]);_0x2680b9['attributes']=_[_0x6b3c('0x33')](_0x59b3b5['model'],qs['fields'](_0x1b6335[_0x6b3c('0x31')][_0x6b3c('0x36')]));_0x2680b9[_0x6b3c('0x34')]=_0x2680b9[_0x6b3c('0x34')]['length']?_0x2680b9[_0x6b3c('0x34')]:_0x59b3b5[_0x6b3c('0x35')];if(_0x1b6335['query'][_0x6b3c('0x42')]){_0x2680b9[_0x6b3c('0x46')]=[{'all':!![]}];}_0x2680b9=_[_0x6b3c('0x40')]({},_0x2680b9,_0x1b6335[_0x6b3c('0x41')]);return db['VoiceRecording']['find'](_0x2680b9)['then'](handleEntityNotFound(_0x3c2ebb,null))[_0x6b3c('0x23')](respondWithResult(_0x3c2ebb,null))[_0x6b3c('0x44')](handleError(_0x3c2ebb,null));};exports[_0x6b3c('0x47')]=function(_0x192b45,_0x592961){return db[_0x6b3c('0x2a')][_0x6b3c('0x47')](_0x192b45[_0x6b3c('0x48')],{})[_0x6b3c('0x23')](respondWithResult(_0x592961,0xc9))[_0x6b3c('0x44')](handleError(_0x592961,null));};exports[_0x6b3c('0x49')]=function(_0x439bf2,_0x2cb080){if(_0x439bf2['body']['id']){delete _0x439bf2[_0x6b3c('0x48')]['id'];}return db['VoiceRecording'][_0x6b3c('0x4a')]({'where':{'id':_0x439bf2['params']['id']}})[_0x6b3c('0x23')](handleEntityNotFound(_0x2cb080,null))[_0x6b3c('0x23')](saveUpdates(_0x439bf2[_0x6b3c('0x48')],null))[_0x6b3c('0x23')](respondWithResult(_0x2cb080,null))[_0x6b3c('0x44')](handleError(_0x2cb080,null));};exports['describe']=function(_0x22306d,_0x528817){return db[_0x6b3c('0x2a')][_0x6b3c('0x4b')]()[_0x6b3c('0x23')](respondWithResult(_0x528817,null))[_0x6b3c('0x44')](handleError(_0x528817,null));};exports[_0x6b3c('0x4c')]=function(_0x3cbffa,_0x24ab17,_0x37e53e){var _0x74c6e9=require(_0x6b3c('0x4d'));var _0x443294=![];var _0x9a8970={};if(_0x3cbffa['query'][_0x6b3c('0x2d')]&&_0x3cbffa[_0x6b3c('0x31')][_0x6b3c('0x2d')]===_0x6b3c('0x4e')){_0x9a8970[_0x6b3c('0x4e')]=_0x3cbffa[_0x6b3c('0x4f')]['id'];}else{_0x9a8970['id']=_0x3cbffa[_0x6b3c('0x4f')]['id'];}return db[_0x6b3c('0x2a')][_0x6b3c('0x4a')]({'where':_0x9a8970,'attributes':['id',_0x6b3c('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x24ab17,null))[_0x6b3c('0x23')](function(_0x3a4329){if(_0x3a4329){var _0x3b7272=_0x3a4329[_0x6b3c('0x50')];var _0x11ebc1=util[_0x6b3c('0x30')](_0x6b3c('0x51'),_0x3b7272);if(fs['existsSync'](_0x11ebc1)){_0x443294=!![];return _0x74c6e9['decryptFile'](_0x11ebc1,_0x3b7272,config[_0x6b3c('0x52')][_0x6b3c('0x53')])[_0x6b3c('0x23')](function(){return _0x3a4329;});}return _0x3a4329;}})[_0x6b3c('0x23')](function(_0x5542bc){if(_0x5542bc){var _0x1f20e6=_0x5542bc[_0x6b3c('0x50')];if(!fs['existsSync'](_0x1f20e6)){throw new db[(_0x6b3c('0x54'))][(_0x6b3c('0x55'))](_0x6b3c('0x56'));}if(_0x5542bc[_0x6b3c('0x57')]){return _0x24ab17[_0x6b3c('0x4c')](_0x1f20e6,_0x5542bc[_0x6b3c('0x57')]+path['extname'](_0x1f20e6),function(){if(_0x443294){fs[_0x6b3c('0x58')](_0x1f20e6);}});}else{return _0x24ab17[_0x6b3c('0x4c')](_0x1f20e6,function(_0x224094){if(_0x443294){fs[_0x6b3c('0x58')](_0x1f20e6);}});}}})['catch'](function(_0x4c95d4){if(_0x4c95d4[_0x6b3c('0x59')]===_0x6b3c('0x56')){_0x24ab17['status'](0x194)['send'](_0x6b3c('0x5a'));}else{return handleError(_0x24ab17,null);}});};exports[_0x6b3c('0x5b')]=function(_0x318467,_0x298cfe,_0x899f73){var _0x21df60=require('../../components/encryptor');var _0x1001a8=![];var _0x3b73f4={'$and':[db[_0x6b3c('0x5c')][_0x6b3c('0x3e')](db[_0x6b3c('0x5c')]['fn'](_0x6b3c('0x5d'),db[_0x6b3c('0x5c')]['col'](_0x6b3c('0x4e'))),_0x318467['query'][_0x6b3c('0x5e')])]};if(_0x318467[_0x6b3c('0x31')][_0x6b3c('0x2d')]&&_0x318467['query'][_0x6b3c('0x2d')]===_0x6b3c('0x4e')){_0x3b73f4[_0x6b3c('0x5f')]['push']({'uniqueid':_0x318467[_0x6b3c('0x4f')]['id']});}else{_0x3b73f4[_0x6b3c('0x5f')][_0x6b3c('0x60')]({'id':_0x318467['params']['id']});}return db['VoiceRecording'][_0x6b3c('0x4a')]({'where':_0x3b73f4,'attributes':['id',_0x6b3c('0x50')],'raw':!![]})[_0x6b3c('0x23')](handleEntityNotFound(_0x298cfe,null))['then'](function(_0x2113d9){if(_0x2113d9){var _0x25999e=util[_0x6b3c('0x30')](_0x6b3c('0x51'),_0x2113d9[_0x6b3c('0x50')]);if(fs[_0x6b3c('0x61')](_0x25999e)){_0x1001a8=!![];return _0x21df60[_0x6b3c('0x62')](_0x25999e,_0x2113d9['value'],config[_0x6b3c('0x52')][_0x6b3c('0x53')])[_0x6b3c('0x23')](function(){return _0x2113d9;});}return _0x2113d9;}})[_0x6b3c('0x23')](function(_0x5099e7){if(_0x5099e7){if(!fs[_0x6b3c('0x61')](_0x5099e7['value'])){throw new db[(_0x6b3c('0x54'))]['ValidationError'](_0x6b3c('0x56'));}if(_0x5099e7[_0x6b3c('0x57')]){return _0x298cfe[_0x6b3c('0x4c')](_0x5099e7[_0x6b3c('0x50')],_0x5099e7[_0x6b3c('0x57')]+path['extname'](_0x5099e7[_0x6b3c('0x50')]),function(){if(_0x1001a8){fs['unlink'](_0x5099e7['value']);}});}else{return _0x298cfe[_0x6b3c('0x4c')](_0x5099e7[_0x6b3c('0x50')],function(_0x26a68c){if(_0x1001a8){fs['unlink'](_0x5099e7[_0x6b3c('0x50')]);}});}}})[_0x6b3c('0x44')](handleError(_0x298cfe,null));};exports[_0x6b3c('0x63')]=function(_0x43fd4c,_0x2c6855){return db[_0x6b3c('0x2a')]['find']({'where':{'id':_0x43fd4c['params']['id']}})[_0x6b3c('0x23')](function(_0x17e117){if(_[_0x6b3c('0x64')](_0x17e117)){throw new ReferenceError(_0x6b3c('0x65'));}return _0x17e117;})[_0x6b3c('0x23')](function(_0x1a74d3){var _0x2c6040=_0x1a74d3[_0x6b3c('0x50')];logger['info'](_0x6b3c('0x66'),_0x2c6040);if(!_['isNil'](_0x1a74d3[_0x6b3c('0x50')])&&fs[_0x6b3c('0x61')](_0x2c6040)){logger[_0x6b3c('0x67')](_0x6b3c('0x68')+_0x2c6040+_0x6b3c('0x69'));fs[_0x6b3c('0x6a')](_0x2c6040);}_0x2c6040=_0x2c6040+'.cypher';if(!_['isNil'](_0x1a74d3['value'])&&fs['existsSync'](_0x2c6040)){logger[_0x6b3c('0x67')](_0x6b3c('0x68')+_0x2c6040+_0x6b3c('0x69'));fs[_0x6b3c('0x6a')](_0x2c6040);}return _0x1a74d3;})[_0x6b3c('0x23')](function(_0x19d545){if(!_0x19d545)throw new InternalError();return _0x19d545[_0x6b3c('0x63')]();})['then'](function(){_0x2c6855[_0x6b3c('0x6b')](0xcc)[_0x6b3c('0x19')]();})[_0x6b3c('0x44')](handleError(_0x2c6855,null));};function getBucketslist(_0x201334,_0x3d0be1,_0xcf8825){return new Promise(function(_0x5a1f2c,_0x19f79c){var _0x1e3a8d=new AWS['S3']({'accessKeyId':_0x3d0be1,'secretAccessKey':_0x201334,'region':_0xcf8825});_0x1e3a8d[_0x6b3c('0x6c')]({},function(_0x299725,_0xc96007){if(_0x299725){return _0x19f79c(_0x299725);}else{return _0x5a1f2c(_0xc96007);}});});}function createBucket(_0x821769,_0x2ddc80,_0x2b2861,_0x8a1063){return new Promise(function(_0x38e959,_0x3a6dcf){var _0x5a26c0=new AWS['S3']({'accessKeyId':_0x2ddc80,'secretAccessKey':_0x821769,'region':_0x2b2861});_0x5a26c0['createBucket']({'Bucket':_0x8a1063},function(_0x40a452,_0x1c4d4a){if(_0x40a452){return _0x3a6dcf(_0x40a452);}else{return _0x38e959(_0x1c4d4a);}});});}function uploadFile(_0x93c975,_0x43dae7,_0xb23a95,_0x55601f,_0x321d48,_0x1a7d2d){return new Promise(function(_0x2b67d1,_0x564500){var _0x2175e6=new AWS['S3']({'accessKeyId':_0x43dae7,'secretAccessKey':_0x93c975,'region':_0xb23a95});_0x2175e6[_0x6b3c('0x6d')]({'Bucket':_0x55601f,'Key':_0x321d48,'Body':_0x1a7d2d},function(_0x16e186,_0x2ef59c){if(_0x16e186){return _0x564500(_0x16e186);}else{return _0x2b67d1(_0x2ef59c);}});});}function startTranscribe(_0x2f6bd4,_0x12ea9b,_0x1a8016,_0x180a5a,_0x303fea,_0x589c81){return new Promise(function(_0x3eb890,_0x5a0301){var _0x566161=new AWS[(_0x6b3c('0x6e'))]({'accessKeyId':_0x12ea9b,'secretAccessKey':_0x2f6bd4,'region':_0x1a8016});_0x566161[_0x6b3c('0x6f')]({'TranscriptionJobName':_0x180a5a,'LanguageCode':_0x303fea,'Media':{'MediaFileUri':_0x589c81}},function(_0x91162b,_0x3c87cb){if(_0x91162b){return _0x5a0301(_0x91162b);}else{return _0x3eb890(_0x3c87cb);}});});}function transcribe(_0x359490,_0x4f010d,_0x25b761,_0x19442c,_0x1040cc,_0x12a42b,_0x543d33){return new Promise(function(_0x2685ab,_0x23472f){var _0x404e3a={};logger['info'](util[_0x6b3c('0x30')](_0x6b3c('0x70'),_0x359490,_0x1040cc));return uploadFile(_0x4f010d,_0x25b761,_0x19442c,_0x1040cc,path[_0x6b3c('0x71')](_0x12a42b),fs['readFileSync'](_0x12a42b))[_0x6b3c('0x23')](function(_0x893d5f){logger['info'](util[_0x6b3c('0x30')](_0x6b3c('0x72'),_0x359490,_0x1040cc,_0x893d5f[_0x6b3c('0x73')]));_0x404e3a[_0x6b3c('0x74')]=_0x893d5f[_0x6b3c('0x75')];_0x404e3a['location']=_0x893d5f[_0x6b3c('0x73')];logger['info'](util[_0x6b3c('0x30')](_0x6b3c('0x76'),_0x359490));return startTranscribe(_0x4f010d,_0x25b761,_0x19442c,uuidv4(),_0x543d33,_0x893d5f[_0x6b3c('0x73')]);})[_0x6b3c('0x23')](function(_0x555086){logger['info'](util[_0x6b3c('0x30')](_0x6b3c('0x77'),_0x359490,_0x555086[_0x6b3c('0x78')]['TranscriptionJobName']));_0x404e3a[_0x6b3c('0x79')]=_0x555086[_0x6b3c('0x78')][_0x6b3c('0x7a')];_0x404e3a['transcribeStatus']=_0x555086[_0x6b3c('0x78')][_0x6b3c('0x7b')];return _0x2685ab(_0x404e3a);})[_0x6b3c('0x44')](function(_0x27b25f){return _0x23472f(_0x27b25f);});});}exports['runTranscribe']=function(_0x159957,_0x595e14,_0x3307d1){var _0x36d229;var _0x5c83b4;var _0x3567b4;var _0x385e90=require(_0x6b3c('0x4d'));return db['VoiceRecording'][_0x6b3c('0x7c')]({'where':{'id':_0x159957['params']['id']}})[_0x6b3c('0x23')](function(_0x6b46e9){if(_0x6b46e9){var _0x3ba152=util['format'](_0x6b3c('0x51'),_0x6b46e9[_0x6b3c('0x50')]);if(fs[_0x6b3c('0x61')](_0x3ba152)){cypher=!![];return _0x385e90['decryptFile'](_0x3ba152,_0x6b46e9[_0x6b3c('0x50')],config['secrets'][_0x6b3c('0x53')])[_0x6b3c('0x23')](function(){return _0x6b46e9;});}return _0x6b46e9;}})[_0x6b3c('0x23')](function(_0x475e64){if(!_0x475e64){throw new db['Sequelize'][(_0x6b3c('0x55'))](_0x6b3c('0x7d'));}_0x5c83b4=_0x475e64;return db[_0x6b3c('0x7e')]['findOne']({'where':{'id':0x1}});})[_0x6b3c('0x23')](handleEntityNotFound(_0x595e14,null))['then'](function(_0xefd867){if(_0xefd867){_0x36d229=_0xefd867;if(!_0x36d229[_0x6b3c('0x7f')]||!_0x36d229[_0x6b3c('0x80')]||!_0x36d229[_0x6b3c('0x81')]||!_0x36d229[_0x6b3c('0x82')]||!_0x36d229['bucket']){throw new db[(_0x6b3c('0x54'))]['ValidationError']('Transcribe\x20not\x20configured');}if(_0x159957[_0x6b3c('0x48')]['runSentiment']&&(!_0x36d229[_0x6b3c('0x83')]||!_0x36d229[_0x6b3c('0x84')]||!_0x36d229['sentimentRegion']||!_0x36d229[_0x6b3c('0x82')]||!_0x36d229[_0x6b3c('0x74')])){throw new db['Sequelize'][(_0x6b3c('0x55'))](_0x6b3c('0x85'));}return db[_0x6b3c('0x86')][_0x6b3c('0x7c')]({'where':{'id':_0x36d229[_0x6b3c('0x80')]}});}})[_0x6b3c('0x23')](function(_0x136478){if(!_0x136478){throw new db['Sequelize']['ValidationError'](_0x6b3c('0x87'));}if(!_0x136478[_0x6b3c('0x88')]||!_0x136478[_0x6b3c('0x89')]){throw new db[(_0x6b3c('0x54'))][(_0x6b3c('0x55'))](_0x6b3c('0x8a'));}_0x3567b4=_0x136478;return getBucketslist(_0x3567b4[_0x6b3c('0x88')],_0x3567b4[_0x6b3c('0x89')],_0x36d229[_0x6b3c('0x81')]);})[_0x6b3c('0x23')](function(_0x1ba764){if(_0x1ba764&&_0x1ba764[_0x6b3c('0x8b')]){var _0x464c5d=_['find'](_0x1ba764[_0x6b3c('0x8b')],function(_0x11c95e){return _0x11c95e[_0x6b3c('0x8c')]===_0x36d229[_0x6b3c('0x74')];});if(!_0x464c5d){logger[_0x6b3c('0x67')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x159957[_0x6b3c('0x4f')]['id'],_0x36d229['bucket']));return createBucket(_0x3567b4['data1'],_0x3567b4['data2'],_0x36d229[_0x6b3c('0x81')],_0x36d229[_0x6b3c('0x74')]);}logger[_0x6b3c('0x67')](util[_0x6b3c('0x30')](_0x6b3c('0x8d'),_0x159957[_0x6b3c('0x4f')]['id'],_0x36d229['bucket']));return;}})['then'](function(_0x4c6aa4){if(_0x5c83b4[_0x6b3c('0x8e')]===_0x6b3c('0x8f')){return transcribe(_0x159957[_0x6b3c('0x4f')]['id'],_0x3567b4[_0x6b3c('0x88')],_0x3567b4[_0x6b3c('0x89')],_0x36d229['transcribeRegion'],_0x36d229[_0x6b3c('0x74')],_0x5c83b4[_0x6b3c('0x50')],_0x36d229[_0x6b3c('0x82')]);}else{logger[_0x6b3c('0x67')](util['format'](_0x6b3c('0x90'),_0x159957['params']['id']));return{'transcribeStatus':_0x6b3c('0x91')};}})['then'](function(_0x399a7f){if(_0x399a7f){_0x399a7f[_0x6b3c('0x92')]=_0x159957['body'][_0x6b3c('0x93')];return _0x5c83b4['updateAttributes'](_0x399a7f);}})['then'](respondWithResult(_0x595e14,null))[_0x6b3c('0x44')](handleError(_0x595e14,null));};function writeFile(_0x5b985e,_0x1f37b5){return new Promise(function(_0x1c658e,_0x193c5a){fs[_0x6b3c('0x94')](_0x1f37b5,_0x5b985e,function(_0x5a11a4,_0x5d1f7c){if(_0x5a11a4){return _0x193c5a(_0x5a11a4);}else{return _0x1c658e(_0x5d1f7c);}});});}exports[_0x6b3c('0x95')]=function(_0x19fc0a,_0x4b0507,_0x1b8964){return db[_0x6b3c('0x2a')][_0x6b3c('0x7c')]({'where':{'id':_0x19fc0a['params']['id']}})[_0x6b3c('0x23')](handleEntityNotFound(_0x4b0507))[_0x6b3c('0x23')](function(_0x2c447b){if(_0x2c447b&&_0x2c447b['fileText']){var _0x69d8fc=_0x2c447b[_0x6b3c('0x96')];var _0x180004=config[_0x6b3c('0x97')]+_0x6b3c('0x98')+_0x2c447b['id']+_0x6b3c('0x99');if(fs['existsSync'](_0x180004)){return _0x180004;}return writeFile(_0x69d8fc,_0x180004)[_0x6b3c('0x23')](function(){return _0x180004;});}else{throw new db[(_0x6b3c('0x54'))][(_0x6b3c('0x55'))](_0x6b3c('0x9a'));}})[_0x6b3c('0x23')](function(_0x523adf){return _0x4b0507[_0x6b3c('0x4c')](_0x523adf);})['catch'](handleError(_0x4b0507));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index d24387a..8bb2f6a 100644 --- a/server/api/voiceRecording/voiceRecording.model.js +++ b/server/api/voiceRecording/voiceRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2bdb=['voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','define','VoiceRecording'];(function(_0x6d94ed,_0x3d2dba){var _0x5a66aa=function(_0x55ba94){while(--_0x55ba94){_0x6d94ed['push'](_0x6d94ed['shift']());}};_0x5a66aa(++_0x3d2dba);}(_0x2bdb,0x105));var _0xb2bd=function(_0x392c54,_0x421876){_0x392c54=_0x392c54-0x0;var _0x340cb8=_0x2bdb[_0x392c54];return _0x340cb8;};'use strict';var attributes=require(_0xb2bd('0x0'));module['exports']=function(_0x156a93,_0x4af8e4){return _0x156a93[_0xb2bd('0x1')](_0xb2bd('0x2'),attributes,{'tableName':_0xb2bd('0x3'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb2bd('0x4')]},{'name':_0xb2bd('0x5'),'fields':[_0xb2bd('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3645=['VoiceRecording','voice_recordings','uniqueid','transcribeStatus','exports','define'];(function(_0x2b63a0,_0x14fc48){var _0x4f0434=function(_0x8cba9e){while(--_0x8cba9e){_0x2b63a0['push'](_0x2b63a0['shift']());}};_0x4f0434(++_0x14fc48);}(_0x3645,0x154));var _0x5364=function(_0x2a7b50,_0x545d55){_0x2a7b50=_0x2a7b50-0x0;var _0x4224c9=_0x3645[_0x2a7b50];return _0x4224c9;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0x5364('0x0')]=function(_0x12217b,_0x2fbfcc){return _0x12217b[_0x5364('0x1')](_0x5364('0x2'),attributes,{'tableName':_0x5364('0x3'),'paranoid':![],'indexes':[{'name':_0x5364('0x4'),'fields':['uniqueid']},{'name':_0x5364('0x5'),'fields':[_0x5364('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index d8eb712..aa9c6f7 100644 --- a/server/api/voiceRecording/voiceRecording.rpc.js +++ b/server/api/voiceRecording/voiceRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93e9=['http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','debug','stringify','../../components/encryptor','Setting','findOne','existsSync','value','format','%s.cypher','encryptFile','secrets','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x3c863c,_0x585fe4){var _0x3af15b=function(_0x483acd){while(--_0x483acd){_0x3c863c['push'](_0x3c863c['shift']());}};_0x3af15b(++_0x585fe4);}(_0x93e9,0xcc));var _0x993e=function(_0x508233,_0x4bbda4){_0x508233=_0x508233-0x0;var _0x2b60e3=_0x93e9[_0x508233];return _0x2b60e3;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var moment=require(_0x993e('0x2'));var BPromise=require(_0x993e('0x3'));var rs=require(_0x993e('0x4'));var fs=require('fs');var Redis=require(_0x993e('0x5'));var db=require(_0x993e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x993e('0x7'));var config=require(_0x993e('0x8'));var jayson=require(_0x993e('0x9'));var client=jayson[_0x993e('0xa')][_0x993e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2366d9,_0x12ac94,_0x1aef74){return new BPromise(function(_0x53d0ce,_0x4701d3){return client[_0x993e('0xc')](_0x2366d9,_0x1aef74)[_0x993e('0xd')](function(_0x280291){logger[_0x993e('0xe')](_0x993e('0xf'),_0x12ac94,_0x993e('0x10'));logger['debug'](_0x993e('0x11'),_0x12ac94,_0x993e('0x10'),JSON['stringify'](_0x280291));if(_0x280291['error']){if(_0x280291[_0x993e('0x12')]['code']===0x1f4){logger[_0x993e('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x12ac94,_0x280291['error'][_0x993e('0x13')]);return _0x4701d3(_0x280291[_0x993e('0x12')][_0x993e('0x13')]);}logger[_0x993e('0x12')](_0x993e('0xf'),_0x12ac94,_0x280291[_0x993e('0x12')][_0x993e('0x13')]);return _0x53d0ce(_0x280291[_0x993e('0x12')][_0x993e('0x13')]);}else{logger[_0x993e('0xe')](_0x993e('0xf'),_0x12ac94,_0x993e('0x10'));_0x53d0ce(_0x280291[_0x993e('0x14')][_0x993e('0x13')]);}})[_0x993e('0x15')](function(_0x454475){logger[_0x993e('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x12ac94,_0x454475);_0x4701d3(_0x454475);});});}exports[_0x993e('0x16')]=function(_0x1acd21){var _0x3cc2b9=this;return new Promise(function(_0x3d6109,_0xfc2cbb){return db[_0x993e('0x17')]['update'](_0x1acd21[_0x993e('0x18')],{'raw':_0x1acd21[_0x993e('0x19')]?_0x1acd21[_0x993e('0x19')][_0x993e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1acd21[_0x993e('0x19')]?_0x1acd21[_0x993e('0x19')][_0x993e('0x1b')]||null:null,'attributes':_0x1acd21[_0x993e('0x19')]?_0x1acd21['options'][_0x993e('0x1c')]||null:null,'limit':_0x1acd21['options']?_0x1acd21[_0x993e('0x19')][_0x993e('0x1d')]||null:null})[_0x993e('0xd')](function(_0x5ba2a1){logger[_0x993e('0xe')](_0x993e('0x16'),_0x1acd21);logger[_0x993e('0x1e')](_0x993e('0x16'),_0x1acd21,JSON[_0x993e('0x1f')](_0x5ba2a1));_0x3d6109(_0x5ba2a1);})[_0x993e('0x15')](function(_0xa1c83e){logger[_0x993e('0x12')](_0x993e('0x16'),_0xa1c83e[_0x993e('0x13')],_0x1acd21);_0xfc2cbb(_0x3cc2b9[_0x993e('0x12')](0x1f4,_0xa1c83e[_0x993e('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x2756a7){var _0x279bb8=this;return new Promise(function(_0x52b727,_0x27bbf7){var _0x4f5cc1=require(_0x993e('0x20'));var _0xa03fbd;return db[_0x993e('0x21')][_0x993e('0x22')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x32e332){_0xa03fbd=_0x32e332;return db[_0x993e('0x17')]['create'](_0x2756a7[_0x993e('0x18')]);})[_0x993e('0xd')](function(_0x248354){if(_0xa03fbd['callRecordingEncryption']&&fs[_0x993e('0x23')](_0x248354[_0x993e('0x24')])){var _0x1f5d51=util[_0x993e('0x25')](_0x993e('0x26'),_0x248354['value']);return _0x4f5cc1[_0x993e('0x27')](_0x248354['value'],_0x1f5d51,config[_0x993e('0x28')]['recording'])[_0x993e('0xd')](function(){fs['unlink'](_0x248354[_0x993e('0x24')]);logger[_0x993e('0xe')](_0x993e('0x29'));return _0x248354;});}return _0x248354;})[_0x993e('0xd')](function(_0xbadd6e){logger[_0x993e('0xe')]('CreateVoiceRecording',_0x2756a7);logger[_0x993e('0x1e')]('CreateVoiceRecording',_0x2756a7,JSON['stringify'](_0xbadd6e));_0x52b727(_0xbadd6e);})[_0x993e('0x15')](function(_0x497d29){logger[_0x993e('0x12')](_0x993e('0x2a'),_0x497d29[_0x993e('0x13')],_0x2756a7);_0x27bbf7(_0x279bb8[_0x993e('0x12')](0x1f4,_0x497d29[_0x993e('0x13')]));});});}; \ No newline at end of file +var _0x32b6=['jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','info','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','limit','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x32b6,0x1d1));var _0x632b=function(_0x3f2512,_0x2221b9){_0x3f2512=_0x3f2512-0x0;var _0x4b5988=_0x32b6[_0x3f2512];return _0x4b5988;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('VoiceRecording,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});}exports[_0x632b('0x15')]=function(_0x3bb27f){var _0x28c472=this;return new Promise(function(_0x51c894,_0x2f3e88){return db[_0x632b('0x16')][_0x632b('0x17')](_0x3bb27f[_0x632b('0x18')],{'raw':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')][_0x632b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')]['where']||null:null,'attributes':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')]['attributes']||null:null,'limit':_0x3bb27f[_0x632b('0x19')]?_0x3bb27f[_0x632b('0x19')][_0x632b('0x1b')]||null:null})['then'](function(_0x10fc32){logger[_0x632b('0x14')]('UpdateVoiceRecording',_0x3bb27f);logger[_0x632b('0xd')](_0x632b('0x15'),_0x3bb27f,JSON[_0x632b('0xf')](_0x10fc32));_0x51c894(_0x10fc32);})[_0x632b('0x1c')](function(_0x45d017){logger[_0x632b('0x10')]('UpdateVoiceRecording',_0x45d017['message'],_0x3bb27f);_0x2f3e88(_0x28c472[_0x632b('0x10')](0x1f4,_0x45d017['message']));});});};exports[_0x632b('0x1d')]=function(_0x954fa0){var _0x5d6855=this;return new Promise(function(_0x273e89,_0x3f4eab){var _0x29d9aa=require(_0x632b('0x1e'));var _0x4728a8;return db[_0x632b('0x1f')][_0x632b('0x20')]({'attributes':['id',_0x632b('0x21')],'where':{'id':0x1},'raw':!![]})[_0x632b('0xc')](function(_0x4f8410){_0x4728a8=_0x4f8410;return db[_0x632b('0x16')][_0x632b('0x22')](_0x954fa0[_0x632b('0x18')]);})[_0x632b('0xc')](function(_0x17a5ba){if(_0x4728a8[_0x632b('0x21')]&&fs[_0x632b('0x23')](_0x17a5ba[_0x632b('0x24')])){var _0x1ace1b=util[_0x632b('0x25')](_0x632b('0x26'),_0x17a5ba[_0x632b('0x24')]);return _0x29d9aa[_0x632b('0x27')](_0x17a5ba[_0x632b('0x24')],_0x1ace1b,config[_0x632b('0x28')][_0x632b('0x29')])[_0x632b('0xc')](function(){fs[_0x632b('0x2a')](_0x17a5ba[_0x632b('0x24')]);logger[_0x632b('0x14')]('CreateVoiceRecording\x20file\x20encrypted');return _0x17a5ba;});}return _0x17a5ba;})[_0x632b('0xc')](function(_0x4401dc){logger[_0x632b('0x14')](_0x632b('0x1d'),_0x954fa0);logger['debug'](_0x632b('0x1d'),_0x954fa0,JSON['stringify'](_0x4401dc));_0x273e89(_0x4401dc);})[_0x632b('0x1c')](function(_0x15b22d){logger['error'](_0x632b('0x1d'),_0x15b22d[_0x632b('0x13')],_0x954fa0);_0x3f4eab(_0x5d6855[_0x632b('0x10')](0x1f4,_0x15b22d[_0x632b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 3dd0e74..72abda5 100644 --- a/server/api/voiceTransferReport/index.js +++ b/server/api/voiceTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x51cc=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete'];(function(_0x173fdf,_0x1ba573){var _0x147b6d=function(_0x5dc021){while(--_0x5dc021){_0x173fdf['push'](_0x173fdf['shift']());}};_0x147b6d(++_0x1ba573);}(_0x51cc,0x1e6));var _0xc51c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x51cc[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0xc51c('0x0'));var path=require(_0xc51c('0x1'));var timeout=require(_0xc51c('0x2'));var express=require(_0xc51c('0x3'));var router=express[_0xc51c('0x4')]();var fs_extra=require(_0xc51c('0x5'));var auth=require(_0xc51c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc51c('0x7'));var controller=require(_0xc51c('0x8'));router[_0xc51c('0x9')]('/',auth[_0xc51c('0xa')](),controller[_0xc51c('0xb')]);router[_0xc51c('0x9')](_0xc51c('0xc'),auth[_0xc51c('0xa')](),controller[_0xc51c('0xd')]);router[_0xc51c('0x9')](_0xc51c('0xe'),auth[_0xc51c('0xa')](),controller[_0xc51c('0xf')]);router[_0xc51c('0x10')]('/',auth[_0xc51c('0xa')](),controller[_0xc51c('0x11')]);router[_0xc51c('0x12')](_0xc51c('0xe'),auth[_0xc51c('0xa')](),controller['update']);router[_0xc51c('0x13')](_0xc51c('0xe'),auth[_0xc51c('0xa')](),controller[_0xc51c('0x14')]);module[_0xc51c('0x15')]=router; \ No newline at end of file +var _0xc7d3=['../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','update','exports','multer','path','express','fs-extra'];(function(_0xf03f9e,_0x2f85e8){var _0x2326a7=function(_0x44702b){while(--_0x44702b){_0xf03f9e['push'](_0xf03f9e['shift']());}};_0x2326a7(++_0x2f85e8);}(_0xc7d3,0xdc));var _0x3c7d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7d3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3c7d('0x0'));var util=require('util');var path=require(_0x3c7d('0x1'));var timeout=require('connect-timeout');var express=require(_0x3c7d('0x2'));var router=express['Router']();var fs_extra=require(_0x3c7d('0x3'));var auth=require(_0x3c7d('0x4'));var interaction=require(_0x3c7d('0x5'));var config=require('../../config/environment');var controller=require(_0x3c7d('0x6'));router[_0x3c7d('0x7')]('/',auth[_0x3c7d('0x8')](),controller['index']);router[_0x3c7d('0x7')](_0x3c7d('0x9'),auth[_0x3c7d('0x8')](),controller[_0x3c7d('0xa')]);router[_0x3c7d('0x7')](_0x3c7d('0xb'),auth[_0x3c7d('0x8')](),controller[_0x3c7d('0xc')]);router['post']('/',auth[_0x3c7d('0x8')](),controller[_0x3c7d('0xd')]);router['put'](_0x3c7d('0xb'),auth[_0x3c7d('0x8')](),controller[_0x3c7d('0xe')]);router['delete'](_0x3c7d('0xb'),auth[_0x3c7d('0x8')](),controller['destroy']);module[_0x3c7d('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 70769e5..1179920 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.attributes.js +++ b/server/api/voiceTransferReport/voiceTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x499e=['Yes','sequelize','ENUM','attended','STRING'];(function(_0x57c5da,_0xe2c98d){var _0x1e3e09=function(_0x6411fc){while(--_0x6411fc){_0x57c5da['push'](_0x57c5da['shift']());}};_0x1e3e09(++_0xe2c98d);}(_0x499e,0x182));var _0xe499=function(_0x32f417,_0x181970){_0x32f417=_0x32f417-0x0;var _0x22108f=_0x499e[_0x32f417];return _0x22108f;};'use strict';var Sequelize=require(_0xe499('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0xe499('0x1')]('blind',_0xe499('0x2'))},'result':{'type':Sequelize[_0xe499('0x3')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xe499('0x3')]},'transferercalleridname':{'type':Sequelize[_0xe499('0x3')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xe499('0x3')]},'transfereraccountcode':{'type':Sequelize[_0xe499('0x3')]},'transferercontext':{'type':Sequelize[_0xe499('0x3')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xe499('0x3')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xe499('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0xe499('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0xe499('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xe499('0x3')]},'transfereelinkedid':{'type':Sequelize[_0xe499('0x3')]},'isexternal':{'type':Sequelize[_0xe499('0x1')](_0xe499('0x4'),'No')},'context':{'type':Sequelize[_0xe499('0x3')]},'extension':{'type':Sequelize[_0xe499('0x3')]}}; \ No newline at end of file +var _0x260d=['blind','STRING','moment','ENUM'];(function(_0x43c112,_0x4a770f){var _0x4ea632=function(_0x5e8af6){while(--_0x5e8af6){_0x43c112['push'](_0x43c112['shift']());}};_0x4ea632(++_0x4a770f);}(_0x260d,0x1ae));var _0xd260=function(_0x3f98fc,_0x4e48d8){_0x3f98fc=_0x3f98fc-0x0;var _0x24ba7e=_0x260d[_0x3f98fc];return _0x24ba7e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd260('0x0'));module['exports']={'type':{'type':Sequelize[_0xd260('0x1')](_0xd260('0x2'),'attended')},'result':{'type':Sequelize[_0xd260('0x3')]},'transfererchannel':{'type':Sequelize[_0xd260('0x3')]},'transferercalleridnum':{'type':Sequelize[_0xd260('0x3')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xd260('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0xd260('0x3')]},'transfereraccountcode':{'type':Sequelize[_0xd260('0x3')]},'transferercontext':{'type':Sequelize[_0xd260('0x3')]},'transfererexten':{'type':Sequelize[_0xd260('0x3')]},'transfererlinkedid':{'type':Sequelize[_0xd260('0x3')]},'transfereechannel':{'type':Sequelize[_0xd260('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0xd260('0x3')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xd260('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0xd260('0x3')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xd260('0x3')]},'transfereeexten':{'type':Sequelize[_0xd260('0x3')]},'transfereelinkedid':{'type':Sequelize[_0xd260('0x3')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0xd260('0x3')]},'extension':{'type':Sequelize[_0xd260('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 48f8768..072be00 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.controller.js +++ b/server/api/voiceTransferReport/voiceTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c11=['create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','apply','reject','then','destroy','end','sendStatus','error','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find'];(function(_0x3c864e,_0x2883ef){var _0x26e84d=function(_0x5a6b0a){while(--_0x5a6b0a){_0x3c864e['push'](_0x3c864e['shift']());}};_0x26e84d(++_0x2883ef);}(_0x7c11,0x1bf));var _0x17c1=function(_0x45ed91,_0x3b7a15){_0x45ed91=_0x45ed91-0x0;var _0x99ae7a=_0x7c11[_0x45ed91];return _0x99ae7a;};'use strict';var emlformat=require(_0x17c1('0x0'));var rimraf=require(_0x17c1('0x1'));var zipdir=require(_0x17c1('0x2'));var jsonpatch=require(_0x17c1('0x3'));var rp=require(_0x17c1('0x4'));var moment=require(_0x17c1('0x5'));var BPromise=require(_0x17c1('0x6'));var Mustache=require(_0x17c1('0x7'));var util=require('util');var path=require(_0x17c1('0x8'));var sox=require(_0x17c1('0x9'));var csv=require('to-csv');var ejs=require(_0x17c1('0xa'));var fs=require('fs');var fs_extra=require(_0x17c1('0xb'));var _=require(_0x17c1('0xc'));var squel=require(_0x17c1('0xd'));var crypto=require(_0x17c1('0xe'));var jsforce=require(_0x17c1('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x17c1('0x10'));var Papa=require('papaparse');var Redis=require(_0x17c1('0x11'));var authService=require(_0x17c1('0x12'));var qs=require(_0x17c1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x17c1('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x17c1('0x15'))['db'];function respondWithStatusCode(_0x1c71a5,_0x2bd8bb){_0x2bd8bb=_0x2bd8bb||0xcc;return function(_0x2282bf){if(_0x2282bf){return _0x1c71a5['sendStatus'](_0x2bd8bb);}return _0x1c71a5[_0x17c1('0x16')](_0x2bd8bb)['end']();};}function respondWithResult(_0x551fa7,_0xe7c5cf){_0xe7c5cf=_0xe7c5cf||0xc8;return function(_0x5f59c3){if(_0x5f59c3){return _0x551fa7[_0x17c1('0x16')](_0xe7c5cf)[_0x17c1('0x17')](_0x5f59c3);}};}function respondWithFilteredResult(_0x15b187,_0x169287){return function(_0x22ff01){if(_0x22ff01){var _0x85c640=typeof _0x169287[_0x17c1('0x18')]===_0x17c1('0x19')&&typeof _0x169287['limit']===_0x17c1('0x19');var _0x13eec0=_0x22ff01['count'];var _0x4613a1=_0x85c640?0x0:_0x169287[_0x17c1('0x18')];var _0x39c0fd=_0x85c640?_0x22ff01[_0x17c1('0x1a')]:_0x169287[_0x17c1('0x18')]+_0x169287['limit'];var _0xf4a097;if(_0x39c0fd>=_0x13eec0){_0x39c0fd=_0x13eec0;_0xf4a097=0xc8;}else{_0xf4a097=0xce;}_0x15b187[_0x17c1('0x16')](_0xf4a097);return _0x15b187[_0x17c1('0x1b')](_0x17c1('0x1c'),_0x4613a1+'-'+_0x39c0fd+'/'+_0x13eec0)[_0x17c1('0x17')](_0x22ff01);}return null;};}function patchUpdates(_0xe54b2){return function(_0x29c7c0){try{jsonpatch[_0x17c1('0x1d')](_0x29c7c0,_0xe54b2,!![]);}catch(_0x2156ff){return BPromise[_0x17c1('0x1e')](_0x2156ff);}return _0x29c7c0['save']();};}function saveUpdates(_0xa84906,_0x2e3727){return function(_0x107516){if(_0x107516){return _0x107516['update'](_0xa84906)[_0x17c1('0x1f')](function(_0x1fac80){return _0x1fac80;});}return null;};}function removeEntity(_0x300f4e,_0x32bb8c){return function(_0x2c49a3){if(_0x2c49a3){return _0x2c49a3[_0x17c1('0x20')]()[_0x17c1('0x1f')](function(){_0x300f4e[_0x17c1('0x16')](0xcc)[_0x17c1('0x21')]();});}};}function handleEntityNotFound(_0x3da69d,_0x4112f2){return function(_0x402c9d){if(!_0x402c9d){_0x3da69d[_0x17c1('0x22')](0x194);}return _0x402c9d;};}function handleError(_0x3b17b7,_0x1ed36b){_0x1ed36b=_0x1ed36b||0x1f4;return function(_0x2752e6){logger[_0x17c1('0x23')](_0x2752e6[_0x17c1('0x24')]);if(_0x2752e6[_0x17c1('0x25')]){delete _0x2752e6[_0x17c1('0x25')];}_0x3b17b7[_0x17c1('0x16')](_0x1ed36b)['send'](_0x2752e6);};}exports[_0x17c1('0x26')]=function(_0x1f68ac,_0x5710ef){var _0x438654={},_0x415a96={},_0x4a90ca={'count':0x0,'rows':[]};var _0x55b90b=_[_0x17c1('0x27')](db[_0x17c1('0x28')][_0x17c1('0x29')],function(_0x9de27b){return{'name':_0x9de27b[_0x17c1('0x2a')],'type':_0x9de27b['type'][_0x17c1('0x2b')]};});_0x415a96[_0x17c1('0x2c')]=_[_0x17c1('0x27')](_0x55b90b,_0x17c1('0x25'));_0x415a96[_0x17c1('0x2d')]=_[_0x17c1('0x2e')](_0x1f68ac['query']);_0x415a96[_0x17c1('0x2f')]=_[_0x17c1('0x30')](_0x415a96[_0x17c1('0x2c')],_0x415a96[_0x17c1('0x2d')]);_0x438654[_0x17c1('0x31')]=_[_0x17c1('0x30')](_0x415a96[_0x17c1('0x2c')],qs[_0x17c1('0x32')](_0x1f68ac[_0x17c1('0x2d')]['fields']));_0x438654['attributes']=_0x438654[_0x17c1('0x31')][_0x17c1('0x33')]?_0x438654[_0x17c1('0x31')]:_0x415a96[_0x17c1('0x2c')];if(!_0x1f68ac['query'][_0x17c1('0x34')](_0x17c1('0x35'))){_0x438654[_0x17c1('0x36')]=qs[_0x17c1('0x36')](_0x1f68ac[_0x17c1('0x2d')][_0x17c1('0x36')]);_0x438654['offset']=qs[_0x17c1('0x18')](_0x1f68ac[_0x17c1('0x2d')][_0x17c1('0x18')]);}_0x438654[_0x17c1('0x37')]=qs['sort'](_0x1f68ac['query'][_0x17c1('0x38')]);_0x438654['where']=qs[_0x17c1('0x2f')](_['pick'](_0x1f68ac[_0x17c1('0x2d')],_0x415a96['filters']),_0x55b90b);if(_0x1f68ac[_0x17c1('0x2d')][_0x17c1('0x39')]){_0x438654[_0x17c1('0x3a')]=_[_0x17c1('0x3b')](_0x438654[_0x17c1('0x3a')],{'$or':_['map'](_0x55b90b,function(_0x3b59bf){if(_0x3b59bf[_0x17c1('0x3c')]!==_0x17c1('0x3d')){var _0x431a18={};_0x431a18[_0x3b59bf[_0x17c1('0x25')]]={'$like':'%'+_0x1f68ac[_0x17c1('0x2d')][_0x17c1('0x39')]+'%'};return _0x431a18;}})});}_0x438654=_['merge']({},_0x438654,_0x1f68ac[_0x17c1('0x3e')]);var _0x1c0111={'where':_0x438654[_0x17c1('0x3a')]};return db[_0x17c1('0x28')]['count'](_0x1c0111)[_0x17c1('0x1f')](function(_0x50312f){_0x4a90ca[_0x17c1('0x1a')]=_0x50312f;if(_0x1f68ac[_0x17c1('0x2d')][_0x17c1('0x3f')]){_0x438654['include']=[{'all':!![]}];}return db[_0x17c1('0x28')][_0x17c1('0x40')](_0x438654);})[_0x17c1('0x1f')](function(_0x24649f){_0x4a90ca[_0x17c1('0x41')]=_0x24649f;return _0x4a90ca;})[_0x17c1('0x1f')](respondWithFilteredResult(_0x5710ef,_0x438654))[_0x17c1('0x42')](handleError(_0x5710ef,null));};exports[_0x17c1('0x43')]=function(_0x49bc24,_0x305602){var _0x5ae160={'raw':!![],'where':{'id':_0x49bc24[_0x17c1('0x44')]['id']}},_0x451100={};_0x451100[_0x17c1('0x2c')]=_[_0x17c1('0x2e')](db[_0x17c1('0x28')][_0x17c1('0x29')]);_0x451100[_0x17c1('0x2d')]=_['keys'](_0x49bc24[_0x17c1('0x2d')]);_0x451100[_0x17c1('0x2f')]=_['intersection'](_0x451100[_0x17c1('0x2c')],_0x451100[_0x17c1('0x2d')]);_0x5ae160[_0x17c1('0x31')]=_[_0x17c1('0x30')](_0x451100['model'],qs[_0x17c1('0x32')](_0x49bc24[_0x17c1('0x2d')][_0x17c1('0x32')]));_0x5ae160['attributes']=_0x5ae160[_0x17c1('0x31')][_0x17c1('0x33')]?_0x5ae160[_0x17c1('0x31')]:_0x451100[_0x17c1('0x2c')];if(_0x49bc24[_0x17c1('0x2d')][_0x17c1('0x3f')]){_0x5ae160[_0x17c1('0x45')]=[{'all':!![]}];}_0x5ae160=_['merge']({},_0x5ae160,_0x49bc24[_0x17c1('0x3e')]);return db[_0x17c1('0x28')][_0x17c1('0x46')](_0x5ae160)[_0x17c1('0x1f')](handleEntityNotFound(_0x305602,null))[_0x17c1('0x1f')](respondWithResult(_0x305602,null))[_0x17c1('0x42')](handleError(_0x305602,null));};exports[_0x17c1('0x47')]=function(_0xcb2ea2,_0x4d5369){return db[_0x17c1('0x28')][_0x17c1('0x47')](_0xcb2ea2[_0x17c1('0x48')],{})['then'](respondWithResult(_0x4d5369,0xc9))[_0x17c1('0x42')](handleError(_0x4d5369,null));};exports['update']=function(_0x50d8d3,_0x1320fa){if(_0x50d8d3[_0x17c1('0x48')]['id']){delete _0x50d8d3[_0x17c1('0x48')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x50d8d3[_0x17c1('0x44')]['id']}})['then'](handleEntityNotFound(_0x1320fa,null))[_0x17c1('0x1f')](saveUpdates(_0x50d8d3[_0x17c1('0x48')],null))[_0x17c1('0x1f')](respondWithResult(_0x1320fa,null))[_0x17c1('0x42')](handleError(_0x1320fa,null));};exports[_0x17c1('0x20')]=function(_0x725245,_0x63bb6d){return db[_0x17c1('0x28')][_0x17c1('0x46')]({'where':{'id':_0x725245[_0x17c1('0x44')]['id']}})[_0x17c1('0x1f')](handleEntityNotFound(_0x63bb6d,null))[_0x17c1('0x1f')](removeEntity(_0x63bb6d,null))[_0x17c1('0x42')](handleError(_0x63bb6d,null));};exports[_0x17c1('0x49')]=function(_0x7c6fc0,_0x464116){return db['VoiceTransferReport']['describe']()[_0x17c1('0x1f')](respondWithResult(_0x464116,null))[_0x17c1('0x42')](handleError(_0x464116,null));}; \ No newline at end of file +var _0xd2ba=['includeAll','include','findAll','catch','show','params','create','body','find','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','set','Content-Range','apply','reject','update','then','error','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','nolimit','limit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options'];(function(_0x289fd8,_0x29c288){var _0x1fccf7=function(_0x1c549a){while(--_0x1c549a){_0x289fd8['push'](_0x289fd8['shift']());}};_0x1fccf7(++_0x29c288);}(_0xd2ba,0x9b));var _0xad2b=function(_0x5086f7,_0x35bb69){_0x5086f7=_0x5086f7-0x0;var _0x253f9b=_0xd2ba[_0x5086f7];return _0x253f9b;};'use strict';var emlformat=require(_0xad2b('0x0'));var rimraf=require(_0xad2b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad2b('0x2'));var rp=require(_0xad2b('0x3'));var moment=require(_0xad2b('0x4'));var BPromise=require(_0xad2b('0x5'));var Mustache=require(_0xad2b('0x6'));var util=require('util');var path=require(_0xad2b('0x7'));var sox=require(_0xad2b('0x8'));var csv=require(_0xad2b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad2b('0xa'));var squel=require(_0xad2b('0xb'));var crypto=require('crypto');var jsforce=require(_0xad2b('0xc'));var deskjs=require(_0xad2b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xad2b('0xe'));var Redis=require(_0xad2b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xad2b('0x10'));var as=require(_0xad2b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xad2b('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xad2b('0x13'));var db=require(_0xad2b('0x14'))['db'];function respondWithStatusCode(_0x443682,_0x3c4905){_0x3c4905=_0x3c4905||0xcc;return function(_0xafbe74){if(_0xafbe74){return _0x443682[_0xad2b('0x15')](_0x3c4905);}return _0x443682['status'](_0x3c4905)[_0xad2b('0x16')]();};}function respondWithResult(_0x3d0c84,_0x2b829d){_0x2b829d=_0x2b829d||0xc8;return function(_0x4442cc){if(_0x4442cc){return _0x3d0c84[_0xad2b('0x17')](_0x2b829d)[_0xad2b('0x18')](_0x4442cc);}};}function respondWithFilteredResult(_0xfb7bf3,_0x791972){return function(_0x242b97){if(_0x242b97){var _0x1784ac=typeof _0x791972['offset']===_0xad2b('0x19')&&typeof _0x791972['limit']===_0xad2b('0x19');var _0x122057=_0x242b97[_0xad2b('0x1a')];var _0x39b951=_0x1784ac?0x0:_0x791972[_0xad2b('0x1b')];var _0x6d09eb=_0x1784ac?_0x242b97[_0xad2b('0x1a')]:_0x791972[_0xad2b('0x1b')]+_0x791972['limit'];var _0x58ec6a;if(_0x6d09eb>=_0x122057){_0x6d09eb=_0x122057;_0x58ec6a=0xc8;}else{_0x58ec6a=0xce;}_0xfb7bf3[_0xad2b('0x17')](_0x58ec6a);return _0xfb7bf3[_0xad2b('0x1c')](_0xad2b('0x1d'),_0x39b951+'-'+_0x6d09eb+'/'+_0x122057)[_0xad2b('0x18')](_0x242b97);}return null;};}function patchUpdates(_0x55d1b3){return function(_0x2514f1){try{jsonpatch[_0xad2b('0x1e')](_0x2514f1,_0x55d1b3,!![]);}catch(_0x54dc4c){return BPromise[_0xad2b('0x1f')](_0x54dc4c);}return _0x2514f1['save']();};}function saveUpdates(_0x1ea738,_0x24790c){return function(_0x1d70ee){if(_0x1d70ee){return _0x1d70ee[_0xad2b('0x20')](_0x1ea738)[_0xad2b('0x21')](function(_0x288c63){return _0x288c63;});}return null;};}function removeEntity(_0x119c2f,_0x4b983f){return function(_0x4288d5){if(_0x4288d5){return _0x4288d5['destroy']()[_0xad2b('0x21')](function(){_0x119c2f[_0xad2b('0x17')](0xcc)[_0xad2b('0x16')]();});}};}function handleEntityNotFound(_0x180135,_0x3a330a){return function(_0x86201b){if(!_0x86201b){_0x180135[_0xad2b('0x15')](0x194);}return _0x86201b;};}function handleError(_0x1ba4e4,_0x37bf5d){_0x37bf5d=_0x37bf5d||0x1f4;return function(_0x2a8c60){logger[_0xad2b('0x22')](_0x2a8c60[_0xad2b('0x23')]);if(_0x2a8c60[_0xad2b('0x24')]){delete _0x2a8c60['name'];}_0x1ba4e4[_0xad2b('0x17')](_0x37bf5d)['send'](_0x2a8c60);};}exports[_0xad2b('0x25')]=function(_0x517f0a,_0x4bb4f6){var _0xd32b8d={},_0x291e20={},_0x5a67f1={'count':0x0,'rows':[]};var _0x39e9be=_[_0xad2b('0x26')](db[_0xad2b('0x27')][_0xad2b('0x28')],function(_0x483ad3){return{'name':_0x483ad3[_0xad2b('0x29')],'type':_0x483ad3[_0xad2b('0x2a')][_0xad2b('0x2b')]};});_0x291e20[_0xad2b('0x2c')]=_[_0xad2b('0x26')](_0x39e9be,_0xad2b('0x24'));_0x291e20['query']=_[_0xad2b('0x2d')](_0x517f0a[_0xad2b('0x2e')]);_0x291e20['filters']=_[_0xad2b('0x2f')](_0x291e20[_0xad2b('0x2c')],_0x291e20[_0xad2b('0x2e')]);_0xd32b8d['attributes']=_['intersection'](_0x291e20[_0xad2b('0x2c')],qs[_0xad2b('0x30')](_0x517f0a[_0xad2b('0x2e')][_0xad2b('0x30')]));_0xd32b8d[_0xad2b('0x31')]=_0xd32b8d[_0xad2b('0x31')]['length']?_0xd32b8d[_0xad2b('0x31')]:_0x291e20[_0xad2b('0x2c')];if(!_0x517f0a[_0xad2b('0x2e')]['hasOwnProperty'](_0xad2b('0x32'))){_0xd32b8d[_0xad2b('0x33')]=qs[_0xad2b('0x33')](_0x517f0a[_0xad2b('0x2e')]['limit']);_0xd32b8d[_0xad2b('0x1b')]=qs['offset'](_0x517f0a[_0xad2b('0x2e')][_0xad2b('0x1b')]);}_0xd32b8d[_0xad2b('0x34')]=qs[_0xad2b('0x35')](_0x517f0a[_0xad2b('0x2e')][_0xad2b('0x35')]);_0xd32b8d[_0xad2b('0x36')]=qs['filters'](_[_0xad2b('0x37')](_0x517f0a[_0xad2b('0x2e')],_0x291e20[_0xad2b('0x38')]),_0x39e9be);if(_0x517f0a[_0xad2b('0x2e')]['filter']){_0xd32b8d[_0xad2b('0x36')]=_[_0xad2b('0x39')](_0xd32b8d[_0xad2b('0x36')],{'$or':_[_0xad2b('0x26')](_0x39e9be,function(_0x2337ea){if(_0x2337ea[_0xad2b('0x2a')]!==_0xad2b('0x3a')){var _0x27711b={};_0x27711b[_0x2337ea[_0xad2b('0x24')]]={'$like':'%'+_0x517f0a[_0xad2b('0x2e')][_0xad2b('0x3b')]+'%'};return _0x27711b;}})});}_0xd32b8d=_['merge']({},_0xd32b8d,_0x517f0a[_0xad2b('0x3c')]);var _0x30c746={'where':_0xd32b8d['where']};return db['VoiceTransferReport'][_0xad2b('0x1a')](_0x30c746)['then'](function(_0xb45988){_0x5a67f1[_0xad2b('0x1a')]=_0xb45988;if(_0x517f0a['query'][_0xad2b('0x3d')]){_0xd32b8d[_0xad2b('0x3e')]=[{'all':!![]}];}return db[_0xad2b('0x27')][_0xad2b('0x3f')](_0xd32b8d);})[_0xad2b('0x21')](function(_0x580194){_0x5a67f1['rows']=_0x580194;return _0x5a67f1;})[_0xad2b('0x21')](respondWithFilteredResult(_0x4bb4f6,_0xd32b8d))[_0xad2b('0x40')](handleError(_0x4bb4f6,null));};exports[_0xad2b('0x41')]=function(_0x47af8f,_0x46d553){var _0x2aca54={'raw':!![],'where':{'id':_0x47af8f[_0xad2b('0x42')]['id']}},_0x2cd14a={};_0x2cd14a[_0xad2b('0x2c')]=_[_0xad2b('0x2d')](db['VoiceTransferReport']['rawAttributes']);_0x2cd14a[_0xad2b('0x2e')]=_[_0xad2b('0x2d')](_0x47af8f[_0xad2b('0x2e')]);_0x2cd14a[_0xad2b('0x38')]=_[_0xad2b('0x2f')](_0x2cd14a[_0xad2b('0x2c')],_0x2cd14a[_0xad2b('0x2e')]);_0x2aca54[_0xad2b('0x31')]=_[_0xad2b('0x2f')](_0x2cd14a['model'],qs[_0xad2b('0x30')](_0x47af8f[_0xad2b('0x2e')][_0xad2b('0x30')]));_0x2aca54[_0xad2b('0x31')]=_0x2aca54[_0xad2b('0x31')]['length']?_0x2aca54[_0xad2b('0x31')]:_0x2cd14a['model'];if(_0x47af8f[_0xad2b('0x2e')][_0xad2b('0x3d')]){_0x2aca54[_0xad2b('0x3e')]=[{'all':!![]}];}_0x2aca54=_[_0xad2b('0x39')]({},_0x2aca54,_0x47af8f[_0xad2b('0x3c')]);return db['VoiceTransferReport']['find'](_0x2aca54)['then'](handleEntityNotFound(_0x46d553,null))[_0xad2b('0x21')](respondWithResult(_0x46d553,null))['catch'](handleError(_0x46d553,null));};exports[_0xad2b('0x43')]=function(_0x12a739,_0x3b834b){return db['VoiceTransferReport']['create'](_0x12a739['body'],{})[_0xad2b('0x21')](respondWithResult(_0x3b834b,0xc9))[_0xad2b('0x40')](handleError(_0x3b834b,null));};exports['update']=function(_0x381e1f,_0xa165f9){if(_0x381e1f[_0xad2b('0x44')]['id']){delete _0x381e1f[_0xad2b('0x44')]['id'];}return db[_0xad2b('0x27')][_0xad2b('0x45')]({'where':{'id':_0x381e1f[_0xad2b('0x42')]['id']}})[_0xad2b('0x21')](handleEntityNotFound(_0xa165f9,null))['then'](saveUpdates(_0x381e1f[_0xad2b('0x44')],null))[_0xad2b('0x21')](respondWithResult(_0xa165f9,null))[_0xad2b('0x40')](handleError(_0xa165f9,null));};exports[_0xad2b('0x46')]=function(_0x42081c,_0x4a1697){return db['VoiceTransferReport'][_0xad2b('0x45')]({'where':{'id':_0x42081c[_0xad2b('0x42')]['id']}})[_0xad2b('0x21')](handleEntityNotFound(_0x4a1697,null))[_0xad2b('0x21')](removeEntity(_0x4a1697,null))[_0xad2b('0x40')](handleError(_0x4a1697,null));};exports['describe']=function(_0x4ef200,_0x52b116){return db[_0xad2b('0x27')][_0xad2b('0x47')]()['then'](respondWithResult(_0x52b116,null))['catch'](handleError(_0x52b116,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 0f89fe0..3c17fa1 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.model.js +++ b/server/api/voiceTransferReport/voiceTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcaec=['./voiceTransferReport.attributes','define','VoiceTransferReport','report_call_transfer','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1dded2,_0x46dbbc){var _0x3dfe8c=function(_0x88b322){while(--_0x88b322){_0x1dded2['push'](_0x1dded2['shift']());}};_0x3dfe8c(++_0x46dbbc);}(_0xcaec,0x10c));var _0xccae=function(_0x115400,_0xa46198){_0x115400=_0x115400-0x0;var _0xc96d5d=_0xcaec[_0x115400];return _0xc96d5d;};'use strict';var _=require(_0xccae('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xccae('0x1'));var moment=require(_0xccae('0x2'));var BPromise=require(_0xccae('0x3'));var rp=require(_0xccae('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xccae('0x5'));var config=require(_0xccae('0x6'));var attributes=require(_0xccae('0x7'));module['exports']=function(_0x5debe3,_0x2337a1){return _0x5debe3[_0xccae('0x8')](_0xccae('0x9'),attributes,{'tableName':_0xccae('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34ba=['request-promise','path','../../config/environment','./voiceTransferReport.attributes','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment'];(function(_0x1d695f,_0x4d8dc8){var _0x5987b5=function(_0x48dca0){while(--_0x48dca0){_0x1d695f['push'](_0x1d695f['shift']());}};_0x5987b5(++_0x4d8dc8);}(_0x34ba,0x145));var _0xa34b=function(_0x4152d0,_0x3c9c2d){_0x4152d0=_0x4152d0-0x0;var _0x3a0e50=_0x34ba[_0x4152d0];return _0x3a0e50;};'use strict';var _=require(_0xa34b('0x0'));var util=require(_0xa34b('0x1'));var logger=require(_0xa34b('0x2'))(_0xa34b('0x3'));var moment=require(_0xa34b('0x4'));var BPromise=require('bluebird');var rp=require(_0xa34b('0x5'));var fs=require('fs');var path=require(_0xa34b('0x6'));var rimraf=require('rimraf');var config=require(_0xa34b('0x7'));var attributes=require(_0xa34b('0x8'));module['exports']=function(_0x176619,_0x48a194){return _0x176619['define'](_0xa34b('0x9'),attributes,{'tableName':_0xa34b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index c785e2b..d742b67 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.rpc.js +++ b/server/api/voiceTransferReport/voiceTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x643d=['then','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateVoiceTransferReport','create','body','options','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x643d,0x1af));var _0xd643=function(_0x42c96b,_0xeba7de){_0x42c96b=_0x42c96b-0x0;var _0x38e61a=_0x643d[_0x42c96b];return _0x38e61a;};'use strict';var _=require(_0xd643('0x0'));var util=require(_0xd643('0x1'));var moment=require(_0xd643('0x2'));var BPromise=require(_0xd643('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd643('0x4'));var db=require(_0xd643('0x5'))['db'];var utils=require(_0xd643('0x6'));var logger=require(_0xd643('0x7'))('rpc');var config=require(_0xd643('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd643('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9f7a60,_0x256b82,_0x460f7c){return new BPromise(function(_0x8df328,_0x144c4e){return client[_0xd643('0xa')](_0x9f7a60,_0x460f7c)[_0xd643('0xb')](function(_0x3f5be2){logger['info'](_0xd643('0xc'),_0x256b82,'request\x20sent');logger[_0xd643('0xd')](_0xd643('0xe'),_0x256b82,_0xd643('0xf'),JSON['stringify'](_0x3f5be2));if(_0x3f5be2[_0xd643('0x10')]){if(_0x3f5be2[_0xd643('0x10')][_0xd643('0x11')]===0x1f4){logger[_0xd643('0x10')](_0xd643('0xc'),_0x256b82,_0x3f5be2[_0xd643('0x10')][_0xd643('0x12')]);return _0x144c4e(_0x3f5be2['error'][_0xd643('0x12')]);}logger[_0xd643('0x10')](_0xd643('0xc'),_0x256b82,_0x3f5be2['error']['message']);return _0x8df328(_0x3f5be2[_0xd643('0x10')][_0xd643('0x12')]);}else{logger[_0xd643('0x13')](_0xd643('0xc'),_0x256b82,_0xd643('0xf'));_0x8df328(_0x3f5be2[_0xd643('0x14')][_0xd643('0x12')]);}})[_0xd643('0x15')](function(_0x395749){logger[_0xd643('0x10')](_0xd643('0xc'),_0x256b82,_0x395749);_0x144c4e(_0x395749);});});}exports[_0xd643('0x16')]=function(_0x2e3135){var _0x11dd63=this;return new Promise(function(_0x3d94da,_0x30a34a){return db['VoiceTransferReport'][_0xd643('0x17')](_0x2e3135[_0xd643('0x18')],{'raw':_0x2e3135[_0xd643('0x19')]?_0x2e3135['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4c925d){logger[_0xd643('0x13')](_0xd643('0x16'),_0x2e3135);logger[_0xd643('0xd')](_0xd643('0x16'),_0x2e3135,JSON['stringify'](_0x4c925d));_0x3d94da(_0x4c925d);})[_0xd643('0x15')](function(_0x24224c){logger['error']('CreateVoiceTransferReport',_0x24224c[_0xd643('0x12')],_0x2e3135);_0x30a34a(_0x11dd63[_0xd643('0x10')](0x1f4,_0x24224c[_0xd643('0x12')]));});});}; \ No newline at end of file +var _0x1142=['../../config/utils','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4fd5d6,_0x50dced){var _0x1f635d=function(_0x47a3c8){while(--_0x47a3c8){_0x4fd5d6['push'](_0x4fd5d6['shift']());}};_0x1f635d(++_0x50dced);}(_0x1142,0x182));var _0x2114=function(_0x5d8d02,_0xe8c638){_0x5d8d02=_0x5d8d02-0x0;var _0x246743=_0x1142[_0x5d8d02];return _0x246743;};'use strict';var _=require(_0x2114('0x0'));var util=require(_0x2114('0x1'));var moment=require('moment');var BPromise=require(_0x2114('0x2'));var rs=require(_0x2114('0x3'));var fs=require('fs');var Redis=require(_0x2114('0x4'));var db=require(_0x2114('0x5'))['db'];var utils=require(_0x2114('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x2114('0x7'));var client=jayson[_0x2114('0x8')][_0x2114('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a2a9b,_0x154dd1,_0x2047c0){return new BPromise(function(_0xb57074,_0x192b54){return client[_0x2114('0xa')](_0x4a2a9b,_0x2047c0)[_0x2114('0xb')](function(_0x2fe1d6){logger[_0x2114('0xc')](_0x2114('0xd'),_0x154dd1,_0x2114('0xe'));logger[_0x2114('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x154dd1,_0x2114('0xe'),JSON['stringify'](_0x2fe1d6));if(_0x2fe1d6[_0x2114('0x10')]){if(_0x2fe1d6[_0x2114('0x10')][_0x2114('0x11')]===0x1f4){logger[_0x2114('0x10')](_0x2114('0xd'),_0x154dd1,_0x2fe1d6[_0x2114('0x10')]['message']);return _0x192b54(_0x2fe1d6[_0x2114('0x10')]['message']);}logger[_0x2114('0x10')](_0x2114('0xd'),_0x154dd1,_0x2fe1d6[_0x2114('0x10')][_0x2114('0x12')]);return _0xb57074(_0x2fe1d6[_0x2114('0x10')][_0x2114('0x12')]);}else{logger[_0x2114('0xc')](_0x2114('0xd'),_0x154dd1,_0x2114('0xe'));_0xb57074(_0x2fe1d6[_0x2114('0x13')][_0x2114('0x12')]);}})[_0x2114('0x14')](function(_0x39a14c){logger[_0x2114('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x154dd1,_0x39a14c);_0x192b54(_0x39a14c);});});}exports[_0x2114('0x15')]=function(_0x2a6e8e){var _0x3d27d3=this;return new Promise(function(_0x51746e,_0x279185){return db[_0x2114('0x16')][_0x2114('0x17')](_0x2a6e8e[_0x2114('0x18')],{'raw':_0x2a6e8e[_0x2114('0x19')]?_0x2a6e8e[_0x2114('0x19')][_0x2114('0x1a')]===undefined?!![]:![]:!![]})[_0x2114('0xb')](function(_0x10f618){logger[_0x2114('0xc')](_0x2114('0x15'),_0x2a6e8e);logger['debug'](_0x2114('0x15'),_0x2a6e8e,JSON[_0x2114('0x1b')](_0x10f618));_0x51746e(_0x10f618);})[_0x2114('0x14')](function(_0x3f168e){logger[_0x2114('0x10')](_0x2114('0x15'),_0x3f168e[_0x2114('0x12')],_0x2a6e8e);_0x279185(_0x3d27d3[_0x2114('0x10')](0x1f4,_0x3f168e[_0x2114('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 41a1fbd..79fa4e6 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x750a=['Router','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','/unhold','unhold','/calls','calls','/transfer','transfer','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x750a,0x140));var _0xa750=function(_0x2e6e9d,_0x158527){_0x2e6e9d=_0x2e6e9d-0x0;var _0x509c6a=_0x750a[_0x2e6e9d];return _0x509c6a;};'use strict';var express=require('express');var router=express[_0xa750('0x0')]();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router[_0xa750('0x1')](_0xa750('0x2'),auth[_0xa750('0x3')](),auth[_0xa750('0x4')](),controller[_0xa750('0x5')]);router[_0xa750('0x1')](_0xa750('0x6'),auth[_0xa750('0x3')](),auth[_0xa750('0x4')](),controller[_0xa750('0x7')]);router[_0xa750('0x1')](_0xa750('0x8'),auth[_0xa750('0x3')](),auth['isWebrtcLicence'](),controller['answer']);router[_0xa750('0x1')]('/hold',auth[_0xa750('0x3')](),auth[_0xa750('0x4')](),controller['hold']);router[_0xa750('0x1')](_0xa750('0x9'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xa750('0xa')]);router['post'](_0xa750('0xb'),auth[_0xa750('0x3')](),auth['isWebrtcLicence'](),controller[_0xa750('0xc')]);router[_0xa750('0x1')](_0xa750('0xd'),auth['isAuthenticated'](),auth[_0xa750('0x4')](),controller[_0xa750('0xe')]);module[_0xa750('0xf')]=router; \ No newline at end of file +var _0xf109=['/transfer','transfer','express','Router','../../components/auth/service','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer','/hold','/unhold','/calls','calls'];(function(_0x1c3e69,_0x5a4c37){var _0x34dde8=function(_0x3dfcb0){while(--_0x3dfcb0){_0x1c3e69['push'](_0x1c3e69['shift']());}};_0x34dde8(++_0x5a4c37);}(_0xf109,0xce));var _0x9f10=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xf109[_0x22b68a];return _0x1ac67a;};'use strict';var express=require(_0x9f10('0x0'));var router=express[_0x9f10('0x1')]();var auth=require(_0x9f10('0x2'));var controller=require('./webbar.controller');router['post']('/originate',auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x5')]);router[_0x9f10('0x6')](_0x9f10('0x7'),auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x8')]);router[_0x9f10('0x6')](_0x9f10('0x9'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller[_0x9f10('0xa')]);router[_0x9f10('0x6')](_0x9f10('0xb'),auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller['hold']);router[_0x9f10('0x6')](_0x9f10('0xc'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller['unhold']);router[_0x9f10('0x6')](_0x9f10('0xd'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller[_0x9f10('0xe')]);router[_0x9f10('0x6')](_0x9f10('0xf'),auth['isAuthenticated'](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index c25e80d..0a3ae1d 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80d9=['validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','emit','log','handleError:','error','stack','name','status','send','code','message','catch','User','then','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','callNumber','body','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','userId','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','answer\x20executed!','hold','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','../../mysqldb','../../config/environment','util','jayson/promise','client','http','../../config/logger','webbarapi','defaults','socket.io-emitter','redis'];(function(_0x51cc1d,_0xaa88ae){var _0x2eb9f2=function(_0x1ca525){while(--_0x1ca525){_0x51cc1d['push'](_0x51cc1d['shift']());}};_0x2eb9f2(++_0xaa88ae);}(_0x80d9,0x15c));var _0x980d=function(_0x1693ad,_0x1c3369){_0x1693ad=_0x1693ad-0x0;var _0x23ce6a=_0x80d9[_0x1693ad];return _0x23ce6a;};'use strict';var path=require(_0x980d('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x980d('0x1'))['db'];var config=require(_0x980d('0x2'));var util=require(_0x980d('0x3'));var BPromise=require('bluebird');var jayson=require(_0x980d('0x4'));var amiClient=jayson[_0x980d('0x5')][_0x980d('0x6')]({'port':0x232a});var logger=require(_0x980d('0x7'))(_0x980d('0x8'));var Redis=require('ioredis');config['redis']=_[_0x980d('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x980d('0xa'))(new Redis(config[_0x980d('0xb')]));var Schema=require(_0x980d('0xc'));var originateValidation=new Schema({'userId':{'type':_0x980d('0xd'),'required':[!![],_0x980d('0xe')]},'callNumber':{'type':_0x980d('0xf'),'required':[!![],_0x980d('0x10')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x980d('0xe')]},'sessionId':{'type':_0x980d('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x980d('0xe')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x980d('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x980d('0xf'),'required':[!![],_0x980d('0x11')]},'transferNumber':{'type':_0x980d('0xf'),'required':[!![],_0x980d('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0x980d('0xd'),'required':[!![],_0x980d('0xe')]},'sessionId':{'type':_0x980d('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x980d('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x980d('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x980d('0xd'),'required':[!![],_0x980d('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0x980d('0xd'),'required':[!![],_0x980d('0xe')]}});function emit(_0x169648,_0x5824bf,_0x27dd6a){logger[_0x980d('0x13')](_0x169648,_0x5824bf,JSON['stringify'](_0x27dd6a));io['to'](_0x169648)[_0x980d('0x14')](_0x5824bf,_0x27dd6a);}function handleError(_0x4e9d73){return function(_0x23f64c){console[_0x980d('0x15')](_0x980d('0x16'),_0x23f64c,_0x23f64c instanceof RangeError);logger[_0x980d('0x17')](_0x23f64c[_0x980d('0x18')]);if(_0x23f64c instanceof RangeError){if(_0x23f64c[_0x980d('0x19')]){delete _0x23f64c[_0x980d('0x19')];}_0x4e9d73[_0x980d('0x1a')](0x194)[_0x980d('0x1b')](_0x23f64c);}else{if(_0x23f64c[_0x980d('0x19')]){delete _0x23f64c[_0x980d('0x19')];}_0x4e9d73['status'](0x1f4)['send'](_0x23f64c);}};}function checkError(){return function(_0x3cb470){if(!_0x3cb470){throw new RangeError('NotFound');}return _0x3cb470;};}function respondWithRpcPromise(_0x4e37c8,_0x124c3f){return new BPromise(function(_0x1d6286,_0x45d698){var _0xbb89e3=amiClient;return _0xbb89e3['request'](_0x4e37c8,_0x124c3f)['then'](function(_0x11cb45){if(_0x11cb45['error']){if(_0x11cb45[_0x980d('0x17')][_0x980d('0x1c')]===0x1f4){return _0x45d698(_0x11cb45['error'][_0x980d('0x1d')]);}return _0x1d6286(_0x11cb45['error']['message']);}else{_0x1d6286(_0x11cb45['result']);}})[_0x980d('0x1e')](function(_0x43f278){_0x45d698(_0x43f278);});});}function getAgent(_0x117053){return db[_0x980d('0x1f')]['findOne']({'where':{'id':_0x117053,'role':'agent'}})[_0x980d('0x20')](checkError());}function getAgentCheckSession(_0x1d5dad,_0x97ca70){return new BPromise(function(_0x1da8ea,_0x3d5f19){var _0x47b11d=respondWithRpcPromise('VoiceChannels');var _0x2830e5=getAgent(_0x1d5dad);Promise[_0x980d('0x21')]([_0x47b11d,_0x2830e5])[_0x980d('0x20')](function(_0xf00845){var _0x2dab0e=_0xf00845[0x0];var _0x25542b=_0xf00845[0x1];var _0x513693=_[_0x980d('0x22')](_0x2dab0e[_0x980d('0x23')],function(_0xaa9cd6){return _0xaa9cd6[_0x980d('0x24')]==_0x25542b['id']&&_0xaa9cd6[_0x980d('0x25')]==_0x97ca70;});if(_0x513693[_0x980d('0x26')]==0x1){_0x1da8ea(_0x25542b);}else{_0x3d5f19(new RangeError(_0x980d('0x27')+_0x97ca70+_0x980d('0x28')));}});});}exports[_0x980d('0x29')]=function(_0x59a847,_0x3671b8){logger[_0x980d('0x13')](_0x980d('0x2a'),_0x59a847['body']);var _0x5d0771=originateValidation[_0x980d('0xc')](_0x59a847['body']);if(_0x5d0771[_0x980d('0x26')]>0x0){return _0x3671b8['status'](0x190)['json'](_0x5d0771);}var _0x5a3160=_0x59a847['body']['userId'];var _0x511d25=_0x59a847['body'][_0x980d('0x2b')];var _0x3569b8=_0x59a847[_0x980d('0x2c')]['callerId'];var _0x498081=_0x59a847[_0x980d('0x2c')][_0x980d('0x2d')];return getAgent(_0x5a3160)[_0x980d('0x20')](function(_0x120bf1){logger[_0x980d('0x13')](_0x980d('0x2e'),_0x120bf1['name']);emit(util[_0x980d('0x2f')](_0x980d('0x30'),_0x120bf1['name']),_0x980d('0x31'),{'callNumber':_0x511d25,'callerId':_0x3569b8,'callbackUrl':_0x498081});return _0x3671b8['status'](0xc8)[_0x980d('0x32')]({'error':![],'message':_0x980d('0x33')});})[_0x980d('0x1e')](handleError(_0x3671b8));};exports['hangup']=function(_0x5d8c31,_0x5d5903){logger[_0x980d('0x13')]('hangup\x20fired:',_0x5d8c31['body']);var _0x98b1b=hangupValidation[_0x980d('0xc')](_0x5d8c31[_0x980d('0x2c')]);if(_0x98b1b['length']>0x0){return _0x5d5903[_0x980d('0x1a')](0x190)[_0x980d('0x32')](_0x98b1b);}var _0x32f2f9=_0x5d8c31[_0x980d('0x2c')][_0x980d('0x34')];var _0x4e2aac=_0x5d8c31['body'][_0x980d('0x25')];return getAgent(_0x32f2f9)['then'](function(_0x5b49e2){logger['info']('entityFound:',_0x5b49e2[_0x980d('0x19')]);emit(util[_0x980d('0x2f')](_0x980d('0x30'),_0x5b49e2['name']),_0x980d('0x35'),{'sessionId':_0x4e2aac});return _0x5d5903[_0x980d('0x1a')](0xc8)[_0x980d('0x32')]({'error':![],'message':_0x980d('0x36')});})[_0x980d('0x1e')](handleError(_0x5d5903));};exports[_0x980d('0x37')]=function(_0x1221e7,_0x555417){logger[_0x980d('0x13')](_0x980d('0x38'),_0x1221e7[_0x980d('0x2c')]);var _0x5f1f04=answerValidation[_0x980d('0xc')](_0x1221e7[_0x980d('0x2c')]);if(_0x5f1f04[_0x980d('0x26')]>0x0){return _0x555417[_0x980d('0x1a')](0x190)[_0x980d('0x32')](_0x5f1f04);}var _0x45831c=_0x1221e7[_0x980d('0x2c')]['userId'];var _0x473c94=_0x1221e7['body'][_0x980d('0x25')];return getAgent(_0x45831c)[_0x980d('0x20')](function(_0x23980c){logger[_0x980d('0x13')](_0x980d('0x2e'),_0x23980c[_0x980d('0x19')]);emit(util[_0x980d('0x2f')](_0x980d('0x30'),_0x23980c['name']),'webbar:answer',{'sessionId':_0x473c94});return _0x555417[_0x980d('0x1a')](0xc8)[_0x980d('0x32')]({'error':![],'message':_0x980d('0x39')});})[_0x980d('0x1e')](handleError(_0x555417));};exports[_0x980d('0x3a')]=function(_0x48f239,_0x1de28b){logger[_0x980d('0x13')]('hold\x20fired:',_0x48f239[_0x980d('0x2c')]);var _0x169270=holdValidation[_0x980d('0xc')](_0x48f239[_0x980d('0x2c')]);if(_0x169270[_0x980d('0x26')]>0x0){return _0x1de28b[_0x980d('0x1a')](0x190)[_0x980d('0x32')](_0x169270);}var _0x135c26=_0x48f239[_0x980d('0x2c')]['userId'];var _0xaf9c1c=_0x48f239[_0x980d('0x2c')][_0x980d('0x25')];return getAgent(_0x135c26)[_0x980d('0x20')](function(_0x2e18c6){logger[_0x980d('0x13')](_0x980d('0x2e'),_0x2e18c6['name']);emit(util[_0x980d('0x2f')]('user:%s',_0x2e18c6[_0x980d('0x19')]),_0x980d('0x3b'),{'sessionId':_0xaf9c1c});return _0x1de28b[_0x980d('0x1a')](0xc8)[_0x980d('0x32')]({'error':![],'message':_0x980d('0x3c')});})['catch'](handleError(_0x1de28b));};exports[_0x980d('0x3d')]=function(_0x448b3c,_0x242277){logger[_0x980d('0x13')](_0x980d('0x3e'),_0x448b3c[_0x980d('0x2c')]);var _0x411b3a=unholdValidation['validate'](_0x448b3c['body']);if(_0x411b3a['length']>0x0){return _0x242277['status'](0x190)[_0x980d('0x32')](_0x411b3a);}var _0x216458=_0x448b3c[_0x980d('0x2c')][_0x980d('0x34')];var _0x177bb2=_0x448b3c[_0x980d('0x2c')]['sessionId'];return getAgent(_0x216458)[_0x980d('0x20')](function(_0x51c112){logger[_0x980d('0x13')](_0x980d('0x2e'),_0x51c112[_0x980d('0x19')]);emit(util[_0x980d('0x2f')]('user:%s',_0x51c112['name']),_0x980d('0x3f'),{'sessionId':_0x177bb2});return _0x242277[_0x980d('0x1a')](0xc8)[_0x980d('0x32')]({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x242277));};exports[_0x980d('0x40')]=function(_0x4c61c8,_0x459b0e){logger[_0x980d('0x13')](_0x980d('0x41'),_0x459b0e[_0x980d('0x2c')]);var _0x20459e=callsValidation[_0x980d('0xc')](_0x4c61c8[_0x980d('0x2c')]);if(_0x20459e[_0x980d('0x26')]>0x0){return _0x459b0e['status'](0x190)['json'](_0x20459e);}var _0x899a7e=_0x4c61c8['body'][_0x980d('0x34')];var _0x21cf36=respondWithRpcPromise('VoiceChannels');var _0x2b28e4=getAgent(_0x899a7e);return Promise[_0x980d('0x21')]([_0x21cf36,_0x2b28e4])[_0x980d('0x20')](function(_0x60969d){var _0x5498aa=_0x60969d[0x0];var _0x2ccfff=_0x60969d[0x1];var _0x5e45c6=_['filter'](_0x5498aa[_0x980d('0x23')],function(_0x55a075){return _0x55a075[_0x980d('0x24')]==_0x2ccfff['id'];});return _0x459b0e['status'](0xc8)[_0x980d('0x32')]({'count':_0x5e45c6[_0x980d('0x26')],'rows':_0x5e45c6});})['catch'](handleError(_0x459b0e));};exports[_0x980d('0x42')]=function(_0x132495,_0x36f01e){logger[_0x980d('0x13')](_0x980d('0x43'),_0x132495[_0x980d('0x2c')]);var _0x343deb=conferenceValidation[_0x980d('0xc')](_0x132495[_0x980d('0x2c')]);if(_0x343deb[_0x980d('0x26')]>0x0){return _0x36f01e[_0x980d('0x1a')](0x190)[_0x980d('0x32')](_0x343deb);}var _0x4cb91f=_0x132495['body']['userId'];return getAgent(_0x4cb91f)[_0x980d('0x20')](function(_0x53a444){logger[_0x980d('0x13')](_0x980d('0x2e'),_0x53a444[_0x980d('0x19')]);emit(util[_0x980d('0x2f')]('user:%s',_0x53a444[_0x980d('0x19')]),_0x980d('0x44'));return _0x36f01e['status'](0xc8)[_0x980d('0x32')]({'error':![],'message':'conference\x20executed!'});})[_0x980d('0x1e')](handleError(_0x36f01e));};exports['transfer']=function(_0x528e35,_0x465e03){logger[_0x980d('0x13')](_0x980d('0x45'),_0x528e35[_0x980d('0x2c')]);var _0x4dbcca=transferValidation[_0x980d('0xc')](_0x528e35['body']);if(_0x4dbcca['length']>0x0){return _0x465e03[_0x980d('0x1a')](0x190)[_0x980d('0x32')](_0x4dbcca);}var _0x3bd029=_0x528e35[_0x980d('0x2c')][_0x980d('0x34')];var _0x287d47=_0x528e35[_0x980d('0x2c')][_0x980d('0x25')];var _0x392ec3=_0x528e35[_0x980d('0x2c')]['transferNumber'];return getAgent(_0x3bd029)[_0x980d('0x20')](function(_0x4e6f36){logger[_0x980d('0x13')](_0x980d('0x2e'),_0x4e6f36['name']);emit(util[_0x980d('0x2f')](_0x980d('0x30'),_0x4e6f36[_0x980d('0x19')]),_0x980d('0x46'),{'sessionId':_0x287d47,'transferNumber':_0x392ec3});return _0x465e03['status'](0xc8)[_0x980d('0x32')]({'error':![],'message':_0x980d('0x47')});})[_0x980d('0x1e')](handleError(_0x465e03));}; \ No newline at end of file +var _0xe28e=['../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','handleError:','stack','name','send','status','NotFound','request','error','code','message','result','catch','findOne','VoiceChannels','all','then','filter','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','info','body','json','callNumber','callerId','callbackUrl','entityFound:','user:%s','originate\x20executed!','hangup','hangup\x20fired:','userId','format','webbar:hangup','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold','webbar:hold','hold\x20executed!','webbar:unhold','calls','rows','conference','conference\x20fired:','conference\x20executed!','transfer\x20fired:','transferNumber','path','lodash'];(function(_0x2cdca0,_0x241be4){var _0xa301f2=function(_0x104e88){while(--_0x104e88){_0x2cdca0['push'](_0x2cdca0['shift']());}};_0xa301f2(++_0x241be4);}(_0xe28e,0x1ba));var _0xee28=function(_0x5b4e11,_0x477803){_0x5b4e11=_0x5b4e11-0x0;var _0x123b4d=_0xe28e[_0x5b4e11];return _0x123b4d;};'use strict';var path=require(_0xee28('0x0'));var fs=require('fs');var _=require(_0xee28('0x1'));var db=require(_0xee28('0x2'))['db'];var config=require(_0xee28('0x3'));var util=require(_0xee28('0x4'));var BPromise=require(_0xee28('0x5'));var jayson=require(_0xee28('0x6'));var amiClient=jayson[_0xee28('0x7')][_0xee28('0x8')]({'port':0x232a});var logger=require(_0xee28('0x9'))(_0xee28('0xa'));var Redis=require(_0xee28('0xb'));config[_0xee28('0xc')]=_['defaults'](config[_0xee28('0xc')],{'host':_0xee28('0xd'),'port':0x18eb});var io=require(_0xee28('0xe'))(new Redis(config[_0xee28('0xc')]));var Schema=require(_0xee28('0xf'));var originateValidation=new Schema({'userId':{'type':_0xee28('0x10'),'required':[!![],_0xee28('0x11')]},'callNumber':{'type':'string','required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0xee28('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0xee28('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xee28('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xee28('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xee28('0x12'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xee28('0x10'),'required':[!![],_0xee28('0x11')]},'sessionId':{'type':_0xee28('0x12'),'required':[!![],_0xee28('0x13')]},'transferNumber':{'type':_0xee28('0x12'),'required':[!![],_0xee28('0x14')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xee28('0x11')]},'sessionId':{'type':_0xee28('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xee28('0x10'),'required':[!![],_0xee28('0x11')]},'sessionId':{'type':_0xee28('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xee28('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0xee28('0x10'),'required':[!![],_0xee28('0x11')]}});function emit(_0x343358,_0x1ff99e,_0x11c95d){logger['info'](_0x343358,_0x1ff99e,JSON[_0xee28('0x15')](_0x11c95d));io['to'](_0x343358)['emit'](_0x1ff99e,_0x11c95d);}function handleError(_0x37e429){return function(_0x19472a){console['log'](_0xee28('0x16'),_0x19472a,_0x19472a instanceof RangeError);logger['error'](_0x19472a[_0xee28('0x17')]);if(_0x19472a instanceof RangeError){if(_0x19472a['name']){delete _0x19472a[_0xee28('0x18')];}_0x37e429['status'](0x194)[_0xee28('0x19')](_0x19472a);}else{if(_0x19472a['name']){delete _0x19472a[_0xee28('0x18')];}_0x37e429[_0xee28('0x1a')](0x1f4)[_0xee28('0x19')](_0x19472a);}};}function checkError(){return function(_0x3674c7){if(!_0x3674c7){throw new RangeError(_0xee28('0x1b'));}return _0x3674c7;};}function respondWithRpcPromise(_0x1280f5,_0x2dbd49){return new BPromise(function(_0x4bda53,_0x342798){var _0x44d7ff=amiClient;return _0x44d7ff[_0xee28('0x1c')](_0x1280f5,_0x2dbd49)['then'](function(_0x5b500b){if(_0x5b500b[_0xee28('0x1d')]){if(_0x5b500b[_0xee28('0x1d')][_0xee28('0x1e')]===0x1f4){return _0x342798(_0x5b500b[_0xee28('0x1d')][_0xee28('0x1f')]);}return _0x4bda53(_0x5b500b[_0xee28('0x1d')][_0xee28('0x1f')]);}else{_0x4bda53(_0x5b500b[_0xee28('0x20')]);}})[_0xee28('0x21')](function(_0x733ca8){_0x342798(_0x733ca8);});});}function getAgent(_0x281c8a){return db['User'][_0xee28('0x22')]({'where':{'id':_0x281c8a,'role':'agent'}})['then'](checkError());}function getAgentCheckSession(_0x54528b,_0x587aac){return new BPromise(function(_0x51eae7,_0x8373a7){var _0x884e7d=respondWithRpcPromise(_0xee28('0x23'));var _0x469889=getAgent(_0x54528b);Promise[_0xee28('0x24')]([_0x884e7d,_0x469889])[_0xee28('0x25')](function(_0xbafd67){var _0x4fcc8f=_0xbafd67[0x0];var _0x84e0ba=_0xbafd67[0x1];var _0x7390dc=_[_0xee28('0x26')](_0x4fcc8f['rows'],function(_0x14f7c4){return _0x14f7c4[_0xee28('0x27')]==_0x84e0ba['id']&&_0x14f7c4[_0xee28('0x28')]==_0x587aac;});if(_0x7390dc[_0xee28('0x29')]==0x1){_0x51eae7(_0x84e0ba);}else{_0x8373a7(new RangeError(_0xee28('0x2a')+_0x587aac+_0xee28('0x2b')));}});});}exports[_0xee28('0x2c')]=function(_0x5d2a9d,_0x15f294){logger[_0xee28('0x2d')]('originate\x20fired:',_0x5d2a9d[_0xee28('0x2e')]);var _0x34dd11=originateValidation[_0xee28('0xf')](_0x5d2a9d[_0xee28('0x2e')]);if(_0x34dd11[_0xee28('0x29')]>0x0){return _0x15f294[_0xee28('0x1a')](0x190)[_0xee28('0x2f')](_0x34dd11);}var _0x5a4f48=_0x5d2a9d['body']['userId'];var _0x1a8ef0=_0x5d2a9d[_0xee28('0x2e')][_0xee28('0x30')];var _0x3402ce=_0x5d2a9d[_0xee28('0x2e')][_0xee28('0x31')];var _0x5b0c20=_0x5d2a9d[_0xee28('0x2e')][_0xee28('0x32')];return getAgent(_0x5a4f48)['then'](function(_0x51b28d){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x51b28d['name']);emit(util['format'](_0xee28('0x34'),_0x51b28d[_0xee28('0x18')]),'webbar:originate',{'callNumber':_0x1a8ef0,'callerId':_0x3402ce,'callbackUrl':_0x5b0c20});return _0x15f294[_0xee28('0x1a')](0xc8)[_0xee28('0x2f')]({'error':![],'message':_0xee28('0x35')});})[_0xee28('0x21')](handleError(_0x15f294));};exports[_0xee28('0x36')]=function(_0x594116,_0x2a5d06){logger[_0xee28('0x2d')](_0xee28('0x37'),_0x594116[_0xee28('0x2e')]);var _0x43b587=hangupValidation[_0xee28('0xf')](_0x594116['body']);if(_0x43b587[_0xee28('0x29')]>0x0){return _0x2a5d06['status'](0x190)['json'](_0x43b587);}var _0x265ae5=_0x594116['body'][_0xee28('0x38')];var _0x5c5f08=_0x594116[_0xee28('0x2e')]['sessionId'];return getAgent(_0x265ae5)[_0xee28('0x25')](function(_0x211345){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x211345['name']);emit(util[_0xee28('0x39')]('user:%s',_0x211345[_0xee28('0x18')]),_0xee28('0x3a'),{'sessionId':_0x5c5f08});return _0x2a5d06[_0xee28('0x1a')](0xc8)[_0xee28('0x2f')]({'error':![],'message':_0xee28('0x3b')});})[_0xee28('0x21')](handleError(_0x2a5d06));};exports[_0xee28('0x3c')]=function(_0x5a4b9c,_0x4d9d21){logger[_0xee28('0x2d')]('answer\x20fired:',_0x5a4b9c['body']);var _0x4064cf=answerValidation[_0xee28('0xf')](_0x5a4b9c['body']);if(_0x4064cf[_0xee28('0x29')]>0x0){return _0x4d9d21[_0xee28('0x1a')](0x190)[_0xee28('0x2f')](_0x4064cf);}var _0x24cfaa=_0x5a4b9c[_0xee28('0x2e')][_0xee28('0x38')];var _0x1735a9=_0x5a4b9c['body'][_0xee28('0x28')];return getAgent(_0x24cfaa)[_0xee28('0x25')](function(_0x2dd024){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x2dd024['name']);emit(util[_0xee28('0x39')](_0xee28('0x34'),_0x2dd024['name']),_0xee28('0x3d'),{'sessionId':_0x1735a9});return _0x4d9d21[_0xee28('0x1a')](0xc8)[_0xee28('0x2f')]({'error':![],'message':_0xee28('0x3e')});})[_0xee28('0x21')](handleError(_0x4d9d21));};exports[_0xee28('0x3f')]=function(_0x54ab7b,_0x36e5bb){logger['info']('hold\x20fired:',_0x54ab7b[_0xee28('0x2e')]);var _0x2f240f=holdValidation['validate'](_0x54ab7b[_0xee28('0x2e')]);if(_0x2f240f[_0xee28('0x29')]>0x0){return _0x36e5bb[_0xee28('0x1a')](0x190)['json'](_0x2f240f);}var _0x57e57e=_0x54ab7b[_0xee28('0x2e')][_0xee28('0x38')];var _0x1bb1ac=_0x54ab7b[_0xee28('0x2e')][_0xee28('0x28')];return getAgent(_0x57e57e)[_0xee28('0x25')](function(_0x2574c5){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x2574c5[_0xee28('0x18')]);emit(util['format'](_0xee28('0x34'),_0x2574c5['name']),_0xee28('0x40'),{'sessionId':_0x1bb1ac});return _0x36e5bb[_0xee28('0x1a')](0xc8)[_0xee28('0x2f')]({'error':![],'message':_0xee28('0x41')});})[_0xee28('0x21')](handleError(_0x36e5bb));};exports['unhold']=function(_0x5247fe,_0x5ca018){logger[_0xee28('0x2d')]('unhold\x20fired:',_0x5247fe['body']);var _0x659fc4=unholdValidation['validate'](_0x5247fe[_0xee28('0x2e')]);if(_0x659fc4[_0xee28('0x29')]>0x0){return _0x5ca018[_0xee28('0x1a')](0x190)[_0xee28('0x2f')](_0x659fc4);}var _0x398120=_0x5247fe[_0xee28('0x2e')][_0xee28('0x38')];var _0xc1bdba=_0x5247fe[_0xee28('0x2e')][_0xee28('0x28')];return getAgent(_0x398120)['then'](function(_0x1f3680){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x1f3680['name']);emit(util['format']('user:%s',_0x1f3680['name']),_0xee28('0x42'),{'sessionId':_0xc1bdba});return _0x5ca018[_0xee28('0x1a')](0xc8)[_0xee28('0x2f')]({'error':![],'message':'unhold\x20executed!'});})[_0xee28('0x21')](handleError(_0x5ca018));};exports[_0xee28('0x43')]=function(_0x204bbe,_0x39b228){logger[_0xee28('0x2d')]('calls\x20fired:',_0x39b228[_0xee28('0x2e')]);var _0x1c6696=callsValidation[_0xee28('0xf')](_0x204bbe['body']);if(_0x1c6696[_0xee28('0x29')]>0x0){return _0x39b228[_0xee28('0x1a')](0x190)[_0xee28('0x2f')](_0x1c6696);}var _0x47794a=_0x204bbe[_0xee28('0x2e')][_0xee28('0x38')];var _0xfcca7e=respondWithRpcPromise('VoiceChannels');var _0x161394=getAgent(_0x47794a);return Promise['all']([_0xfcca7e,_0x161394])['then'](function(_0x5b7292){var _0x333d7e=_0x5b7292[0x0];var _0x7c51d5=_0x5b7292[0x1];var _0x3cad0a=_[_0xee28('0x26')](_0x333d7e[_0xee28('0x44')],function(_0x27d96d){return _0x27d96d[_0xee28('0x27')]==_0x7c51d5['id'];});return _0x39b228[_0xee28('0x1a')](0xc8)['json']({'count':_0x3cad0a[_0xee28('0x29')],'rows':_0x3cad0a});})[_0xee28('0x21')](handleError(_0x39b228));};exports[_0xee28('0x45')]=function(_0x2b8252,_0x209c3e){logger[_0xee28('0x2d')](_0xee28('0x46'),_0x2b8252['body']);var _0x438943=conferenceValidation['validate'](_0x2b8252[_0xee28('0x2e')]);if(_0x438943[_0xee28('0x29')]>0x0){return _0x209c3e['status'](0x190)[_0xee28('0x2f')](_0x438943);}var _0x2a5fa7=_0x2b8252[_0xee28('0x2e')][_0xee28('0x38')];return getAgent(_0x2a5fa7)['then'](function(_0x209d6d){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x209d6d[_0xee28('0x18')]);emit(util[_0xee28('0x39')](_0xee28('0x34'),_0x209d6d[_0xee28('0x18')]),'webbar:conference');return _0x209c3e[_0xee28('0x1a')](0xc8)['json']({'error':![],'message':_0xee28('0x47')});})[_0xee28('0x21')](handleError(_0x209c3e));};exports['transfer']=function(_0x4b222a,_0x14bc7a){logger['info'](_0xee28('0x48'),_0x4b222a[_0xee28('0x2e')]);var _0x19f81a=transferValidation[_0xee28('0xf')](_0x4b222a[_0xee28('0x2e')]);if(_0x19f81a[_0xee28('0x29')]>0x0){return _0x14bc7a[_0xee28('0x1a')](0x190)['json'](_0x19f81a);}var _0x179ce6=_0x4b222a[_0xee28('0x2e')][_0xee28('0x38')];var _0x57ded5=_0x4b222a[_0xee28('0x2e')][_0xee28('0x28')];var _0x1e190f=_0x4b222a[_0xee28('0x2e')][_0xee28('0x49')];return getAgent(_0x179ce6)[_0xee28('0x25')](function(_0x5dc31e){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x5dc31e[_0xee28('0x18')]);emit(util[_0xee28('0x39')](_0xee28('0x34'),_0x5dc31e[_0xee28('0x18')]),'webbar:transfer',{'sessionId':_0x57ded5,'transferNumber':_0x1e190f});return _0x14bc7a[_0xee28('0x1a')](0xc8)[_0xee28('0x2f')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x14bc7a));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index ba6bc8f..6a5075a 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x157e=['destroy','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','getAnswers','/:id/users','/:id/applications','getApplications','create','/:id/dispositions','addDisposition','post','/:id/canned_answers','addAnswer','addApplications','/:id/notify','notify','/:id/send','send','put','delete'];(function(_0x33db7c,_0x3fcb11){var _0x3d55a5=function(_0x1358c5){while(--_0x1358c5){_0x33db7c['push'](_0x33db7c['shift']());}};_0x3d55a5(++_0x3fcb11);}(_0x157e,0x19a));var _0xe157=function(_0x493c8c,_0x470567){_0x493c8c=_0x493c8c-0x0;var _0x17344b=_0x157e[_0x493c8c];return _0x17344b;};'use strict';var multer=require(_0xe157('0x0'));var util=require(_0xe157('0x1'));var path=require(_0xe157('0x2'));var timeout=require(_0xe157('0x3'));var express=require(_0xe157('0x4'));var router=express[_0xe157('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe157('0x6'));var config=require(_0xe157('0x7'));var controller=require('./whatsappAccount.controller');router[_0xe157('0x8')]('/',auth[_0xe157('0x9')](),controller['index']);router[_0xe157('0x8')](_0xe157('0xa'),auth[_0xe157('0x9')](),controller[_0xe157('0xb')]);router[_0xe157('0x8')](_0xe157('0xc'),auth['isAuthenticated'](),controller[_0xe157('0xd')]);router[_0xe157('0x8')]('/:id/dispositions',auth[_0xe157('0x9')](),controller[_0xe157('0xe')]);router[_0xe157('0x8')]('/:id/canned_answers',auth[_0xe157('0x9')](),controller[_0xe157('0xf')]);router[_0xe157('0x8')](_0xe157('0x10'),auth[_0xe157('0x9')](),controller['getAgents']);router[_0xe157('0x8')](_0xe157('0x11'),auth[_0xe157('0x9')](),controller[_0xe157('0x12')]);router['post']('/',auth[_0xe157('0x9')](),controller[_0xe157('0x13')]);router['post'](_0xe157('0x14'),auth['isAuthenticated'](),controller[_0xe157('0x15')]);router[_0xe157('0x16')](_0xe157('0x17'),auth[_0xe157('0x9')](),controller[_0xe157('0x18')]);router['post'](_0xe157('0x10'),auth[_0xe157('0x9')](),controller['addAgents']);router[_0xe157('0x16')](_0xe157('0x11'),auth[_0xe157('0x9')](),controller[_0xe157('0x19')]);router[_0xe157('0x16')](_0xe157('0x1a'),controller[_0xe157('0x1b')]);router[_0xe157('0x16')](_0xe157('0x1c'),auth['isAuthenticated'](),controller[_0xe157('0x1d')]);router[_0xe157('0x1e')](_0xe157('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xe157('0x1f')](_0xe157('0xc'),auth[_0xe157('0x9')](),controller[_0xe157('0x20')]);router[_0xe157('0x1f')](_0xe157('0x14'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0xe157('0x17'),auth[_0xe157('0x9')](),controller['removeAnswers']);router[_0xe157('0x1f')]('/:id/users',auth[_0xe157('0x9')](),controller[_0xe157('0x21')]);module['exports']=router; \ No newline at end of file +var _0x8df3=['/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','notify','/:id/send','send','put','update','destroy','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x5da01c,_0x53bf77){var _0x1216c2=function(_0x1d8513){while(--_0x1d8513){_0x5da01c['push'](_0x5da01c['shift']());}};_0x1216c2(++_0x53bf77);}(_0x8df3,0x120));var _0x38df=function(_0xbfc389,_0x5aad2e){_0xbfc389=_0xbfc389-0x0;var _0x31583a=_0x8df3[_0xbfc389];return _0x31583a;};'use strict';var multer=require(_0x38df('0x0'));var util=require(_0x38df('0x1'));var path=require(_0x38df('0x2'));var timeout=require(_0x38df('0x3'));var express=require(_0x38df('0x4'));var router=express['Router']();var fs_extra=require(_0x38df('0x5'));var auth=require(_0x38df('0x6'));var interaction=require(_0x38df('0x7'));var config=require('../../config/environment');var controller=require(_0x38df('0x8'));router[_0x38df('0x9')]('/',auth[_0x38df('0xa')](),controller[_0x38df('0xb')]);router[_0x38df('0x9')](_0x38df('0xc'),auth[_0x38df('0xa')](),controller[_0x38df('0xd')]);router[_0x38df('0x9')](_0x38df('0xe'),auth[_0x38df('0xa')](),controller[_0x38df('0xf')]);router[_0x38df('0x9')](_0x38df('0x10'),auth[_0x38df('0xa')](),controller[_0x38df('0x11')]);router['get'](_0x38df('0x12'),auth[_0x38df('0xa')](),controller['getAnswers']);router['get'](_0x38df('0x13'),auth[_0x38df('0xa')](),controller[_0x38df('0x14')]);router[_0x38df('0x9')](_0x38df('0x15'),auth[_0x38df('0xa')](),controller[_0x38df('0x16')]);router[_0x38df('0x17')]('/',auth['isAuthenticated'](),controller[_0x38df('0x18')]);router[_0x38df('0x17')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x38df('0x19')]);router[_0x38df('0x17')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x38df('0x1a')]);router[_0x38df('0x17')](_0x38df('0x13'),auth[_0x38df('0xa')](),controller[_0x38df('0x1b')]);router['post'](_0x38df('0x15'),auth[_0x38df('0xa')](),controller[_0x38df('0x1c')]);router[_0x38df('0x17')]('/:id/notify',controller[_0x38df('0x1d')]);router[_0x38df('0x17')](_0x38df('0x1e'),auth['isAuthenticated'](),controller[_0x38df('0x1f')]);router[_0x38df('0x20')](_0x38df('0xe'),auth[_0x38df('0xa')](),controller[_0x38df('0x21')]);router['delete'](_0x38df('0xe'),auth[_0x38df('0xa')](),controller[_0x38df('0x22')]);router[_0x38df('0x23')](_0x38df('0x10'),auth['isAuthenticated'](),controller[_0x38df('0x24')]);router[_0x38df('0x23')](_0x38df('0x12'),auth[_0x38df('0xa')](),controller['removeAnswers']);router['delete'](_0x38df('0x13'),auth[_0x38df('0xa')](),controller['removeAgents']);module[_0x38df('0x25')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 9b07178..fd695e4 100644 --- a/server/api/whatsappAccount/whatsappAccount.attributes.js +++ b/server/api/whatsappAccount/whatsappAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x92f6=['sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','name','STRING','generate','twilio'];(function(_0x496369,_0x1be924){var _0x4cbfe9=function(_0x3ba23){while(--_0x3ba23){_0x496369['push'](_0x496369['shift']());}};_0x4cbfe9(++_0x1be924);}(_0x92f6,0x108));var _0x692f=function(_0x1bcebc,_0x1437e2){_0x1bcebc=_0x1bcebc-0x0;var _0x52541a=_0x92f6[_0x1bcebc];return _0x52541a;};'use strict';var Sequelize=require(_0x692f('0x0'));var rs=require('randomstring');module[_0x692f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x692f('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x692f('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x692f('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x692f('0x5'),_0x692f('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x692f('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x692f('0x7')],'defaultValue':function(){return _0x692f('0x8');}},'notificationSound':{'type':Sequelize[_0x692f('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x692f('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x692f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x692f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x692f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x692f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x692f('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x692f('0x9')],'defaultValue':![],'comment':_0x692f('0xc'),'set':function(_0x2cac45){if(!_0x2cac45){this[_0x692f('0xd')]('mandatoryDispositionPauseId',null);}this[_0x692f('0xd')](_0x692f('0xe'),_0x2cac45);}},'description':{'type':Sequelize[_0x692f('0x3')]}}; \ No newline at end of file +var _0xbe59=['exports','STRING','name','generate','ENUM','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0x2a54df,_0x45ea17){var _0x1d5f05=function(_0x5b5fee){while(--_0x5b5fee){_0x2a54df['push'](_0x2a54df['shift']());}};_0x1d5f05(++_0x45ea17);}(_0xbe59,0x166));var _0x9be5=function(_0x45faae,_0x13b1c3){_0x45faae=_0x45faae-0x0;var _0xbdd122=_0xbe59[_0x45faae];return _0xbdd122;};'use strict';var Sequelize=require(_0x9be5('0x0'));var rs=require(_0x9be5('0x1'));module[_0x9be5('0x2')]={'name':{'type':Sequelize[_0x9be5('0x3')],'unique':_0x9be5('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x9be5('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x9be5('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x9be5('0x3')],'defaultValue':function(){return rs[_0x9be5('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9be5('0x6')]('twilio',_0x9be5('0x7'))},'accountSid':{'type':Sequelize[_0x9be5('0x3')]},'baseUrl':{'type':Sequelize[_0x9be5('0x3')]},'authToken':{'type':Sequelize[_0x9be5('0x3')]},'notificationTemplate':{'type':Sequelize[_0x9be5('0x8')],'defaultValue':function(){return _0x9be5('0x9');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x9be5('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9be5('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9be5('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9be5('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9be5('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x9be5('0xb')],'defaultValue':![],'comment':_0x9be5('0xc'),'set':function(_0x4017f1){if(!_0x4017f1){this['setDataValue']('mandatoryDispositionPauseId',null);}this[_0x9be5('0xd')](_0x9be5('0xe'),_0x4017f1);}},'description':{'type':Sequelize[_0x9be5('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 9a9ff1a..3b82bf9 100644 --- a/server/api/whatsappAccount/whatsappAccount.controller.js +++ b/server/api/whatsappAccount/whatsappAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bb9=['isArray','userWhatsappAccount:remove','getAgents','User','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','message_id','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','replace','whatsapp:','Body','MessageSid','from','notifications','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','list','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','push','unmanaged','AttachmentId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','queueId','WhatsappQueue','queue','waitForTheAssignedQueue','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','text/xml','DESC','List','out','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','apply','save','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','WhatsappAccountId','Disposition','findOne','pick','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x7bb9,0x1eb));var _0x97bb=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x7bb9[_0x1ccdf7];return _0x52a0ae;};'use strict';var emlformat=require(_0x97bb('0x0'));var rimraf=require(_0x97bb('0x1'));var zipdir=require(_0x97bb('0x2'));var jsonpatch=require(_0x97bb('0x3'));var rp=require(_0x97bb('0x4'));var moment=require('moment');var BPromise=require(_0x97bb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x97bb('0x6'));var csv=require(_0x97bb('0x7'));var ejs=require(_0x97bb('0x8'));var fs=require('fs');var fs_extra=require(_0x97bb('0x9'));var _=require(_0x97bb('0xa'));var squel=require(_0x97bb('0xb'));var crypto=require(_0x97bb('0xc'));var jsforce=require(_0x97bb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x97bb('0x7'));var querystring=require(_0x97bb('0xe'));var Papa=require(_0x97bb('0xf'));var Redis=require(_0x97bb('0x10'));var authService=require(_0x97bb('0x11'));var qs=require(_0x97bb('0x12'));var as=require(_0x97bb('0x13'));var hardwareService=require(_0x97bb('0x14'));var logger=require(_0x97bb('0x15'))(_0x97bb('0x16'));var utils=require(_0x97bb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x97bb('0x18'));var db=require('../../mysqldb')['db'];config[_0x97bb('0x19')]=_[_0x97bb('0x1a')](config[_0x97bb('0x19')],{'host':_0x97bb('0x1b'),'port':0x18eb});var socket=require(_0x97bb('0x1c'))(new Redis(config[_0x97bb('0x19')]));require(_0x97bb('0x1d'))[_0x97bb('0x1e')](socket);var jayson=require(_0x97bb('0x1f'));var client=jayson[_0x97bb('0x20')][_0x97bb('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x1daffb,_0x3d63f2,_0x5dbbd9,_0x149bfe){return new BPromise(function(_0x308a77,_0x4f8506){var _0x101741=_0x149bfe||client;return _0x101741[_0x97bb('0x22')](_0x1daffb,_0x5dbbd9)[_0x97bb('0x23')](function(_0x33bcfb){logger[_0x97bb('0x24')](_0x97bb('0x25'),_0x3d63f2,_0x97bb('0x26'));logger[_0x97bb('0x27')](_0x97bb('0x28'),_0x3d63f2,_0x97bb('0x26'),JSON[_0x97bb('0x29')](_0x33bcfb));if(_0x33bcfb[_0x97bb('0x2a')]){if(_0x33bcfb[_0x97bb('0x2a')]['code']===0x1f4){logger[_0x97bb('0x2a')](_0x97bb('0x25'),_0x3d63f2,_0x33bcfb[_0x97bb('0x2a')][_0x97bb('0x2b')]);return _0x4f8506(_0x33bcfb[_0x97bb('0x2a')][_0x97bb('0x2b')]);}logger[_0x97bb('0x2a')](_0x97bb('0x25'),_0x3d63f2,_0x33bcfb[_0x97bb('0x2a')]['message']);return _0x308a77(_0x33bcfb[_0x97bb('0x2a')][_0x97bb('0x2b')]);}else{logger[_0x97bb('0x24')](_0x97bb('0x25'),_0x3d63f2,_0x97bb('0x26'));_0x308a77(_0x33bcfb[_0x97bb('0x2c')]['message']);}})[_0x97bb('0x2d')](function(_0x3a55b4){logger[_0x97bb('0x2a')]('WhatsappAccount,\x20%s,\x20%s',_0x3d63f2,_0x3a55b4);_0x4f8506(_0x3a55b4);});});}function respondWithStatusCode(_0x4d7ecd,_0x4e4701){_0x4e4701=_0x4e4701||0xcc;return function(_0x38e7a4){if(_0x38e7a4){return _0x4d7ecd[_0x97bb('0x2e')](_0x4e4701);}return _0x4d7ecd['status'](_0x4e4701)[_0x97bb('0x2f')]();};}function respondWithResult(_0x4d5c06,_0x5768d3){_0x5768d3=_0x5768d3||0xc8;return function(_0x46f90e){if(_0x46f90e){return _0x4d5c06[_0x97bb('0x30')](_0x5768d3)[_0x97bb('0x31')](_0x46f90e);}};}function respondWithFilteredResult(_0x2ed467,_0x49b4aa){return function(_0x2c1d70){if(_0x2c1d70){var _0xe3aa4e=typeof _0x49b4aa['offset']==='undefined'&&typeof _0x49b4aa[_0x97bb('0x32')]===_0x97bb('0x33');var _0x11e872=_0x2c1d70[_0x97bb('0x34')];var _0x1fc0d0=_0xe3aa4e?0x0:_0x49b4aa[_0x97bb('0x35')];var _0x294504=_0xe3aa4e?_0x2c1d70[_0x97bb('0x34')]:_0x49b4aa['offset']+_0x49b4aa[_0x97bb('0x32')];var _0x5cd733;if(_0x294504>=_0x11e872){_0x294504=_0x11e872;_0x5cd733=0xc8;}else{_0x5cd733=0xce;}_0x2ed467['status'](_0x5cd733);return _0x2ed467['set'](_0x97bb('0x36'),_0x1fc0d0+'-'+_0x294504+'/'+_0x11e872)[_0x97bb('0x31')](_0x2c1d70);}return null;};}function patchUpdates(_0x53cc9f){return function(_0x47fea0){try{jsonpatch[_0x97bb('0x37')](_0x47fea0,_0x53cc9f,!![]);}catch(_0x51b34e){return BPromise['reject'](_0x51b34e);}return _0x47fea0[_0x97bb('0x38')]();};}function saveUpdates(_0x5211ac,_0x1f135e){return function(_0x506af1){if(_0x506af1){return _0x506af1[_0x97bb('0x39')](_0x5211ac)[_0x97bb('0x23')](function(_0x44ca59){return _0x44ca59;});}return null;};}function removeEntity(_0xa524f2,_0x1c64c9){return function(_0x1baf65){if(_0x1baf65){return _0x1baf65[_0x97bb('0x3a')]()[_0x97bb('0x23')](function(){var _0x4d626c=_0x1baf65[_0x97bb('0x3b')]({'plain':!![]});var _0x28c0e4=_0x97bb('0x3c');return db[_0x97bb('0x3d')][_0x97bb('0x3a')]({'where':{'type':_0x28c0e4,'resourceId':_0x4d626c['id']}})[_0x97bb('0x23')](function(){return _0x1baf65;});})['then'](function(){_0xa524f2['status'](0xcc)[_0x97bb('0x2f')]();});}};}function handleEntityNotFound(_0x4f60d6,_0x49d45c){return function(_0x2686e1){if(!_0x2686e1){_0x4f60d6[_0x97bb('0x2e')](0x194);}return _0x2686e1;};}function handleError(_0xf96aa8,_0x27830c){_0x27830c=_0x27830c||0x1f4;return function(_0x243977){logger[_0x97bb('0x2a')](_0x243977[_0x97bb('0x3e')]);if(_0x243977[_0x97bb('0x3f')]){delete _0x243977[_0x97bb('0x3f')];}_0xf96aa8[_0x97bb('0x30')](_0x27830c)[_0x97bb('0x40')](_0x243977);};}exports[_0x97bb('0x41')]=function(_0x2888a5,_0x22d591){var _0x4e332e={'include':[{'model':db[_0x97bb('0x42')],'as':_0x97bb('0x43')}]},_0x554311={},_0x11b202={'count':0x0,'rows':[]};var _0x277987=_[_0x97bb('0x44')](db[_0x97bb('0x45')][_0x97bb('0x46')],function(_0x31fa26){return{'name':_0x31fa26['fieldName'],'type':_0x31fa26[_0x97bb('0x47')]['key']};});_0x554311[_0x97bb('0x48')]=_[_0x97bb('0x44')](_0x277987,_0x97bb('0x3f'));_0x554311[_0x97bb('0x49')]=_[_0x97bb('0x4a')](_0x2888a5[_0x97bb('0x49')]);_0x554311[_0x97bb('0x4b')]=_[_0x97bb('0x4c')](_0x554311[_0x97bb('0x48')],_0x554311['query']);_0x4e332e[_0x97bb('0x4d')]=_['intersection'](_0x554311['model'],qs[_0x97bb('0x4e')](_0x2888a5['query']['fields']));_0x4e332e['attributes']=_0x4e332e[_0x97bb('0x4d')][_0x97bb('0x4f')]?_0x4e332e['attributes']:_0x554311[_0x97bb('0x48')];if(!_0x2888a5[_0x97bb('0x49')][_0x97bb('0x50')](_0x97bb('0x51'))){_0x4e332e[_0x97bb('0x32')]=qs[_0x97bb('0x32')](_0x2888a5[_0x97bb('0x49')][_0x97bb('0x32')]);_0x4e332e[_0x97bb('0x35')]=qs[_0x97bb('0x35')](_0x2888a5[_0x97bb('0x49')][_0x97bb('0x35')]);}_0x4e332e[_0x97bb('0x52')]=qs['sort'](_0x2888a5[_0x97bb('0x49')][_0x97bb('0x53')]);_0x4e332e[_0x97bb('0x54')]=qs[_0x97bb('0x4b')](_['pick'](_0x2888a5[_0x97bb('0x49')],_0x554311[_0x97bb('0x4b')]),_0x277987);if(_0x2888a5[_0x97bb('0x49')][_0x97bb('0x55')]){_0x4e332e[_0x97bb('0x54')]=_['merge'](_0x4e332e[_0x97bb('0x54')],{'$or':_[_0x97bb('0x44')](_0x277987,function(_0x3d10ef){if(_0x3d10ef['type']!==_0x97bb('0x56')){var _0x375ac0={};_0x375ac0[_0x3d10ef[_0x97bb('0x3f')]]={'$like':'%'+_0x2888a5['query']['filter']+'%'};return _0x375ac0;}})});}_0x4e332e=_[_0x97bb('0x57')]({},_0x4e332e,_0x2888a5[_0x97bb('0x58')]);var _0x4376b1={'where':_0x4e332e['where']};return db[_0x97bb('0x45')][_0x97bb('0x34')](_0x4376b1)['then'](function(_0x271053){_0x11b202['count']=_0x271053;if(_0x2888a5[_0x97bb('0x49')][_0x97bb('0x59')]){_0x4e332e['include']=[{'all':!![]}];}return db[_0x97bb('0x45')][_0x97bb('0x5a')](_0x4e332e);})[_0x97bb('0x23')](function(_0x36274f){_0x11b202[_0x97bb('0x5b')]=_0x36274f;return _0x11b202;})[_0x97bb('0x23')](respondWithFilteredResult(_0x22d591,_0x4e332e))[_0x97bb('0x2d')](handleError(_0x22d591,null));};exports['show']=function(_0x5b399b,_0x353866){var _0x4ce6b8={'raw':![],'where':{'id':_0x5b399b[_0x97bb('0x5c')]['id']},'include':[{'model':db[_0x97bb('0x42')],'as':'mandatoryDispositionPause'}]},_0x3031d0={};_0x3031d0[_0x97bb('0x48')]=_['keys'](db[_0x97bb('0x45')][_0x97bb('0x46')]);_0x3031d0[_0x97bb('0x49')]=_[_0x97bb('0x4a')](_0x5b399b[_0x97bb('0x49')]);_0x3031d0[_0x97bb('0x4b')]=_[_0x97bb('0x4c')](_0x3031d0['model'],_0x3031d0[_0x97bb('0x49')]);_0x4ce6b8[_0x97bb('0x4d')]=_[_0x97bb('0x4c')](_0x3031d0[_0x97bb('0x48')],qs[_0x97bb('0x4e')](_0x5b399b[_0x97bb('0x49')][_0x97bb('0x4e')]));_0x4ce6b8[_0x97bb('0x4d')]=_0x4ce6b8[_0x97bb('0x4d')][_0x97bb('0x4f')]?_0x4ce6b8[_0x97bb('0x4d')]:_0x3031d0[_0x97bb('0x48')];if(_0x5b399b[_0x97bb('0x49')]['includeAll']){_0x4ce6b8['include']=[{'all':!![]}];}_0x4ce6b8=_['merge']({},_0x4ce6b8,_0x5b399b[_0x97bb('0x58')]);return db[_0x97bb('0x45')][_0x97bb('0x5d')](_0x4ce6b8)[_0x97bb('0x23')](handleEntityNotFound(_0x353866,null))[_0x97bb('0x23')](respondWithResult(_0x353866,null))['catch'](handleError(_0x353866,null));};exports[_0x97bb('0x5e')]=function(_0x13f2c9,_0x301d23){return db[_0x97bb('0x45')][_0x97bb('0x5e')](_0x13f2c9[_0x97bb('0x5f')],{})['then'](function(_0x12c307){var _0x5da80a=_0x13f2c9[_0x97bb('0x60')][_0x97bb('0x3b')]({'plain':!![]});if(!_0x5da80a)throw new Error(_0x97bb('0x61'));if(_0x5da80a[_0x97bb('0x62')]===_0x97bb('0x60')){var _0x145a12=_0x12c307[_0x97bb('0x3b')]({'plain':!![]});var _0x10a637='WhatsappAccounts';return db[_0x97bb('0x63')]['find']({'where':{'name':_0x10a637,'userProfileId':_0x5da80a[_0x97bb('0x64')]},'raw':!![]})['then'](function(_0x381417){if(_0x381417&&_0x381417[_0x97bb('0x65')]===0x0){return db[_0x97bb('0x3d')][_0x97bb('0x5e')]({'name':_0x145a12[_0x97bb('0x3f')],'resourceId':_0x145a12['id'],'type':_0x381417[_0x97bb('0x3f')],'sectionId':_0x381417['id']},{})[_0x97bb('0x23')](function(){return _0x12c307;});}else{return _0x12c307;}})[_0x97bb('0x2d')](function(_0x4ffdc6){logger[_0x97bb('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ffdc6);throw _0x4ffdc6;});}return _0x12c307;})[_0x97bb('0x23')](respondWithResult(_0x301d23,0xc9))[_0x97bb('0x2d')](handleError(_0x301d23,null));};exports[_0x97bb('0x39')]=function(_0x251c5a,_0x44d1d4){if(_0x251c5a[_0x97bb('0x5f')]['id']){delete _0x251c5a[_0x97bb('0x5f')]['id'];}return db[_0x97bb('0x45')][_0x97bb('0x5d')]({'where':{'id':_0x251c5a[_0x97bb('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x97bb('0x43')}]})[_0x97bb('0x23')](handleEntityNotFound(_0x44d1d4,null))['then'](saveUpdates(_0x251c5a[_0x97bb('0x5f')],null))[_0x97bb('0x23')](respondWithResult(_0x44d1d4,null))[_0x97bb('0x2d')](handleError(_0x44d1d4,null));};exports[_0x97bb('0x3a')]=function(_0x461628,_0x26dac4){return db[_0x97bb('0x45')][_0x97bb('0x5d')]({'where':{'id':_0x461628[_0x97bb('0x5c')]['id']}})[_0x97bb('0x23')](handleEntityNotFound(_0x26dac4,null))[_0x97bb('0x23')](removeEntity(_0x26dac4,null))[_0x97bb('0x2d')](handleError(_0x26dac4,null));};exports[_0x97bb('0x66')]=function(_0x441c1f,_0x310d5a){return db[_0x97bb('0x45')]['describe']()['then'](respondWithResult(_0x310d5a,null))[_0x97bb('0x2d')](handleError(_0x310d5a,null));};exports[_0x97bb('0x67')]=function(_0x5c2489,_0x946eb2,_0x1ee1f6){if(_0x5c2489['body']['id']){delete _0x5c2489['body']['id'];}return db[_0x97bb('0x45')]['find']({'where':{'id':_0x5c2489[_0x97bb('0x5c')]['id']}})[_0x97bb('0x23')](handleEntityNotFound(_0x946eb2,null))[_0x97bb('0x23')](function(_0x244cb8){if(_0x244cb8){_0x5c2489[_0x97bb('0x5f')][_0x97bb('0x68')]=_0x244cb8['id'];return db[_0x97bb('0x69')][_0x97bb('0x5e')](_0x5c2489[_0x97bb('0x5f')]);}})[_0x97bb('0x23')](respondWithResult(_0x946eb2,null))[_0x97bb('0x2d')](handleError(_0x946eb2,null));};exports['getDispositions']=function(_0x54aea7,_0xf1478a,_0x395175){var _0x338b75={'raw':![],'where':{}};var _0x3fffdf={};var _0x8d9838={'count':0x0,'rows':[]};return db[_0x97bb('0x45')][_0x97bb('0x6a')]({'where':{'id':_0x54aea7['params']['id']}})['then'](handleEntityNotFound(_0xf1478a,null))[_0x97bb('0x23')](function(_0x809746){if(_0x809746){_0x3fffdf[_0x97bb('0x48')]=_['keys'](db[_0x97bb('0x69')][_0x97bb('0x46')]);_0x3fffdf['query']=_['keys'](_0x54aea7[_0x97bb('0x49')]);_0x3fffdf[_0x97bb('0x4b')]=_[_0x97bb('0x4c')](_0x3fffdf['model'],_0x3fffdf['query']);_0x338b75[_0x97bb('0x4d')]=_[_0x97bb('0x4c')](_0x3fffdf[_0x97bb('0x48')],qs['fields'](_0x54aea7[_0x97bb('0x49')][_0x97bb('0x4e')]));_0x338b75[_0x97bb('0x4d')]=_0x338b75['attributes'][_0x97bb('0x4f')]?_0x338b75[_0x97bb('0x4d')]:_0x3fffdf['model'];if(!_0x54aea7[_0x97bb('0x49')]['hasOwnProperty']('nolimit')){_0x338b75[_0x97bb('0x32')]=qs[_0x97bb('0x32')](_0x54aea7[_0x97bb('0x49')][_0x97bb('0x32')]);_0x338b75[_0x97bb('0x35')]=qs[_0x97bb('0x35')](_0x54aea7[_0x97bb('0x49')][_0x97bb('0x35')]);}_0x338b75['order']=qs['sort'](_0x54aea7[_0x97bb('0x49')]['sort']);_0x338b75['where']=qs[_0x97bb('0x4b')](_[_0x97bb('0x6b')](_0x54aea7[_0x97bb('0x49')],_0x3fffdf[_0x97bb('0x4b')]));_0x338b75['where'][_0x97bb('0x68')]=_0x809746['id'];if(_0x54aea7[_0x97bb('0x49')]['filter']){_0x338b75[_0x97bb('0x54')]=_[_0x97bb('0x57')](_0x338b75[_0x97bb('0x54')],{'$or':_['map'](_0x338b75[_0x97bb('0x4d')],function(_0x5f01a0){var _0x3227f5={};_0x3227f5[_0x5f01a0]={'$like':'%'+_0x54aea7['query'][_0x97bb('0x55')]+'%'};return _0x3227f5;})});}_0x338b75=_[_0x97bb('0x57')]({},_0x338b75,_0x54aea7[_0x97bb('0x58')]);return db[_0x97bb('0x69')][_0x97bb('0x34')]({'where':_0x338b75[_0x97bb('0x54')]})[_0x97bb('0x23')](function(_0x39d58e){_0x8d9838[_0x97bb('0x34')]=_0x39d58e;if(_0x54aea7[_0x97bb('0x49')][_0x97bb('0x59')]){_0x338b75[_0x97bb('0x6c')]=[{'all':!![]}];}return db['Disposition'][_0x97bb('0x5a')](_0x338b75);})[_0x97bb('0x23')](function(_0xf29d90){_0x8d9838[_0x97bb('0x5b')]=_0xf29d90;return _0x8d9838;});}})[_0x97bb('0x23')](respondWithFilteredResult(_0xf1478a,_0x338b75))[_0x97bb('0x2d')](handleError(_0xf1478a,null));};exports[_0x97bb('0x6d')]=function(_0x14b1cd,_0x181cf1,_0x5be8e0){return db[_0x97bb('0x45')][_0x97bb('0x5d')]({'where':{'id':_0x14b1cd[_0x97bb('0x5c')]['id']}})[_0x97bb('0x23')](handleEntityNotFound(_0x181cf1,null))[_0x97bb('0x23')](function(_0x5c18fc){if(_0x5c18fc){return _0x5c18fc[_0x97bb('0x6d')](_0x14b1cd[_0x97bb('0x49')][_0x97bb('0x6e')]);}})[_0x97bb('0x23')](respondWithStatusCode(_0x181cf1,null))[_0x97bb('0x2d')](handleError(_0x181cf1,null));};exports[_0x97bb('0x6f')]=function(_0x3e373a,_0x2fbb8d,_0x4cc100){if(_0x3e373a[_0x97bb('0x5f')]['id']){delete _0x3e373a['body']['id'];}return db[_0x97bb('0x45')][_0x97bb('0x5d')]({'where':{'id':_0x3e373a[_0x97bb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2fbb8d,null))[_0x97bb('0x23')](function(_0x24683f){if(_0x24683f){_0x3e373a['body'][_0x97bb('0x68')]=_0x24683f['id'];return db[_0x97bb('0x70')][_0x97bb('0x5e')](_0x3e373a[_0x97bb('0x5f')]);}})[_0x97bb('0x23')](respondWithResult(_0x2fbb8d,null))['catch'](handleError(_0x2fbb8d,null));};exports[_0x97bb('0x71')]=function(_0x288e12,_0x535a66,_0xc55d67){var _0x1e532a={'raw':![],'where':{}};var _0x2023ad={};var _0x451cb1={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x97bb('0x6a')]({'where':{'id':_0x288e12[_0x97bb('0x5c')]['id']}})[_0x97bb('0x23')](handleEntityNotFound(_0x535a66,null))[_0x97bb('0x23')](function(_0xe9d971){if(_0xe9d971){_0x2023ad['model']=_['keys'](db[_0x97bb('0x70')][_0x97bb('0x46')]);_0x2023ad[_0x97bb('0x49')]=_[_0x97bb('0x4a')](_0x288e12[_0x97bb('0x49')]);_0x2023ad['filters']=_[_0x97bb('0x4c')](_0x2023ad[_0x97bb('0x48')],_0x2023ad[_0x97bb('0x49')]);_0x1e532a['attributes']=_[_0x97bb('0x4c')](_0x2023ad[_0x97bb('0x48')],qs[_0x97bb('0x4e')](_0x288e12[_0x97bb('0x49')][_0x97bb('0x4e')]));_0x1e532a['attributes']=_0x1e532a[_0x97bb('0x4d')][_0x97bb('0x4f')]?_0x1e532a[_0x97bb('0x4d')]:_0x2023ad[_0x97bb('0x48')];if(!_0x288e12[_0x97bb('0x49')][_0x97bb('0x50')](_0x97bb('0x51'))){_0x1e532a[_0x97bb('0x32')]=qs['limit'](_0x288e12[_0x97bb('0x49')][_0x97bb('0x32')]);_0x1e532a[_0x97bb('0x35')]=qs[_0x97bb('0x35')](_0x288e12['query']['offset']);}_0x1e532a[_0x97bb('0x52')]=qs['sort'](_0x288e12['query']['sort']);_0x1e532a[_0x97bb('0x54')]=qs[_0x97bb('0x4b')](_[_0x97bb('0x6b')](_0x288e12[_0x97bb('0x49')],_0x2023ad[_0x97bb('0x4b')]));_0x1e532a[_0x97bb('0x54')]['WhatsappAccountId']=_0xe9d971['id'];if(_0x288e12['query'][_0x97bb('0x55')]){_0x1e532a[_0x97bb('0x54')]=_[_0x97bb('0x57')](_0x1e532a['where'],{'$or':_[_0x97bb('0x44')](_0x1e532a[_0x97bb('0x4d')],function(_0x534c60){var _0x44cfe8={};_0x44cfe8[_0x534c60]={'$like':'%'+_0x288e12[_0x97bb('0x49')][_0x97bb('0x55')]+'%'};return _0x44cfe8;})});}_0x1e532a=_[_0x97bb('0x57')]({},_0x1e532a,_0x288e12[_0x97bb('0x58')]);return db[_0x97bb('0x70')]['count']({'where':_0x1e532a[_0x97bb('0x54')]})[_0x97bb('0x23')](function(_0x2b040d){_0x451cb1[_0x97bb('0x34')]=_0x2b040d;if(_0x288e12[_0x97bb('0x49')][_0x97bb('0x59')]){_0x1e532a[_0x97bb('0x6c')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x1e532a);})['then'](function(_0x3d800b){_0x451cb1['rows']=_0x3d800b;return _0x451cb1;});}})[_0x97bb('0x23')](respondWithFilteredResult(_0x535a66,_0x1e532a))[_0x97bb('0x2d')](handleError(_0x535a66,null));};exports['removeAnswers']=function(_0x58bf0b,_0x3a2399,_0x303818){return db[_0x97bb('0x45')][_0x97bb('0x5d')]({'where':{'id':_0x58bf0b['params']['id']}})[_0x97bb('0x23')](handleEntityNotFound(_0x3a2399,null))[_0x97bb('0x23')](function(_0x571d18){if(_0x571d18){return _0x571d18[_0x97bb('0x72')](_0x58bf0b[_0x97bb('0x49')][_0x97bb('0x6e')]);}})[_0x97bb('0x23')](respondWithStatusCode(_0x3a2399,null))[_0x97bb('0x2d')](handleError(_0x3a2399,null));};exports[_0x97bb('0x73')]=function(_0x5a8b81,_0x503300,_0xd5aab4){return db[_0x97bb('0x45')][_0x97bb('0x5d')]({'where':{'id':_0x5a8b81[_0x97bb('0x5c')]['id']}})[_0x97bb('0x23')](handleEntityNotFound(_0x503300,null))[_0x97bb('0x23')](function(_0x1162df){if(_0x1162df){return _0x1162df[_0x97bb('0x73')](_0x5a8b81[_0x97bb('0x5f')]['ids'],_[_0x97bb('0x74')](_0x5a8b81[_0x97bb('0x5f')],['ids','id'])||{})[_0x97bb('0x75')](function(_0x5a3565){for(var _0x2af565=0x0;_0x2af565<_0x5a8b81[_0x97bb('0x5f')][_0x97bb('0x6e')][_0x97bb('0x4f')];_0x2af565+=0x1){socket[_0x97bb('0x76')](_0x97bb('0x77'),{'UserId':Number(_0x5a8b81[_0x97bb('0x5f')]['ids'][_0x2af565]),'WhatsappAccountId':Number(_0x5a8b81['params']['id'])});}return _0x5a3565;});}})['then'](respondWithResult(_0x503300,null))[_0x97bb('0x2d')](handleError(_0x503300,null));};exports[_0x97bb('0x78')]=function(_0x361cc9,_0x5e3ff5,_0x2b7cbf){return db['WhatsappAccount'][_0x97bb('0x5d')]({'where':{'id':_0x361cc9[_0x97bb('0x5c')]['id']}})[_0x97bb('0x23')](handleEntityNotFound(_0x5e3ff5,null))[_0x97bb('0x23')](function(_0x2c1f4d){if(_0x2c1f4d){return _0x2c1f4d['removeAgents'](_0x361cc9[_0x97bb('0x49')][_0x97bb('0x6e')])[_0x97bb('0x23')](function(){if(_[_0x97bb('0x79')](_0x361cc9[_0x97bb('0x49')][_0x97bb('0x6e')])){for(var _0x2a63da=0x0;_0x2a63da<_0x361cc9[_0x97bb('0x49')][_0x97bb('0x6e')][_0x97bb('0x4f')];_0x2a63da+=0x1){socket['emit'](_0x97bb('0x7a'),{'UserId':Number(_0x361cc9[_0x97bb('0x49')][_0x97bb('0x6e')][_0x2a63da]),'WhatsappAccountId':Number(_0x361cc9[_0x97bb('0x5c')]['id'])});}}else{socket[_0x97bb('0x76')](_0x97bb('0x7a'),{'UserId':Number(_0x361cc9['query'][_0x97bb('0x6e')]),'WhatsappAccountId':Number(_0x361cc9['params']['id'])});}});}})[_0x97bb('0x23')](respondWithStatusCode(_0x5e3ff5,null))[_0x97bb('0x2d')](handleError(_0x5e3ff5,null));};exports[_0x97bb('0x7b')]=function(_0x70e9d1,_0x42fc97,_0x87df23){var _0x586219={};var _0x2c3aff={};var _0x556256;var _0x45d8da;return db[_0x97bb('0x45')][_0x97bb('0x6a')]({'where':{'id':_0x70e9d1[_0x97bb('0x5c')]['id']}})[_0x97bb('0x23')](handleEntityNotFound(_0x42fc97,null))[_0x97bb('0x23')](function(_0x2696b5){if(_0x2696b5){_0x556256=_0x2696b5;_0x2c3aff[_0x97bb('0x48')]=_['keys'](db[_0x97bb('0x7c')][_0x97bb('0x46')]);_0x2c3aff[_0x97bb('0x49')]=_[_0x97bb('0x4a')](_0x70e9d1[_0x97bb('0x49')]);_0x2c3aff[_0x97bb('0x4b')]=_['intersection'](_0x2c3aff[_0x97bb('0x48')],_0x2c3aff[_0x97bb('0x49')]);_0x586219[_0x97bb('0x4d')]=_[_0x97bb('0x4c')](_0x2c3aff[_0x97bb('0x48')],qs[_0x97bb('0x4e')](_0x70e9d1[_0x97bb('0x49')]['fields']));_0x586219[_0x97bb('0x4d')]=_0x586219[_0x97bb('0x4d')]['length']?_0x586219[_0x97bb('0x4d')]:_0x2c3aff[_0x97bb('0x48')];_0x586219[_0x97bb('0x52')]=qs['sort'](_0x70e9d1[_0x97bb('0x49')][_0x97bb('0x53')]);_0x586219[_0x97bb('0x54')]=qs[_0x97bb('0x4b')](_[_0x97bb('0x6b')](_0x70e9d1[_0x97bb('0x49')],_0x2c3aff[_0x97bb('0x4b')]));if(_0x70e9d1[_0x97bb('0x49')]['filter']){_0x586219[_0x97bb('0x54')]=_[_0x97bb('0x57')](_0x586219[_0x97bb('0x54')],{'$or':_[_0x97bb('0x44')](_0x586219[_0x97bb('0x4d')],function(_0x334528){var _0x12c033={};_0x12c033[_0x334528]={'$like':'%'+_0x70e9d1[_0x97bb('0x49')][_0x97bb('0x55')]+'%'};return _0x12c033;})});}_0x586219=_[_0x97bb('0x57')]({},_0x586219,_0x70e9d1['options']);return _0x556256[_0x97bb('0x7b')](_0x586219);}})[_0x97bb('0x23')](function(_0x1d7be1){if(_0x1d7be1){_0x45d8da=_0x1d7be1[_0x97bb('0x4f')];if(!_0x70e9d1[_0x97bb('0x49')][_0x97bb('0x50')](_0x97bb('0x51'))){_0x586219[_0x97bb('0x32')]=qs[_0x97bb('0x32')](_0x70e9d1['query'][_0x97bb('0x32')]);_0x586219[_0x97bb('0x35')]=qs['offset'](_0x70e9d1['query'][_0x97bb('0x35')]);}return _0x556256[_0x97bb('0x7b')](_0x586219);}})[_0x97bb('0x23')](function(_0x585075){if(_0x585075){return _0x585075?{'count':_0x45d8da,'rows':_0x585075}:null;}})['then'](respondWithResult(_0x42fc97,null))[_0x97bb('0x2d')](handleError(_0x42fc97,null));};exports['addApplications']=function(_0x1b2ca9,_0x12f745){var _0x5c1056=_0x1b2ca9[_0x97bb('0x5c')]['id'];var _0x10567b=_0x1b2ca9[_0x97bb('0x5f')];var _0x22699f=0xc8;var _0x3a7621=null;return db['sequelize'][_0x97bb('0x7d')]({'isolationLevel':db[_0x97bb('0x7e')][_0x97bb('0x7f')][_0x97bb('0x80')][_0x97bb('0x81')]},function(_0x41d2a2){return db[_0x97bb('0x45')]['findOne']({'where':{'id':_0x5c1056},'transaction':_0x41d2a2})['then'](function(_0x14f187){if(_0x14f187){return db[_0x97bb('0x82')][_0x97bb('0x3a')]({'where':{'WhatsappAccountId':_0x5c1056},'transaction':_0x41d2a2})[_0x97bb('0x23')](function(){var _0x226515=_['map'](_0x10567b,function(_0x4d8c81){_0x4d8c81[_0x97bb('0x68')]=_0x5c1056;return _0x4d8c81;});return db['WhatsappApplication'][_0x97bb('0x83')](_0x226515,{'transaction':_0x41d2a2});});}else{_0x22699f=0x194;_0x3a7621=[];}});})[_0x97bb('0x23')](function(){if(_0x22699f!==0x194){return db[_0x97bb('0x82')][_0x97bb('0x84')]({'where':{'WhatsappAccountId':_0x5c1056},'order':_0x97bb('0x85')})[_0x97bb('0x23')](function(_0xb3bb2c){_0x3a7621=_0xb3bb2c;});}})[_0x97bb('0x2d')](function(_0x5c98a0){_0x22699f=0x1f4;logger[_0x97bb('0x2a')](_0x5c98a0[_0x97bb('0x3e')]);if(_0x5c98a0[_0x97bb('0x3f')]){delete _0x5c98a0[_0x97bb('0x3f')];}_0x3a7621=_0x5c98a0;})[_0x97bb('0x86')](function(){if(_0x3a7621===null){_0x12f745[_0x97bb('0x2e')](_0x22699f);}else{if(_0x22699f===0x1f4){_0x12f745[_0x97bb('0x30')](_0x22699f)[_0x97bb('0x40')](_0x3a7621);}else{_0x12f745['status'](_0x22699f)[_0x97bb('0x31')](_0x3a7621);}}});};exports[_0x97bb('0x87')]=function(_0x370156,_0xf5c471,_0x4effd6){var _0x3103d5={};var _0x4656e8={};var _0x4a3ea3;var _0x31e51e;return db[_0x97bb('0x45')][_0x97bb('0x6a')]({'where':{'id':_0x370156['params']['id']}})['then'](handleEntityNotFound(_0xf5c471,null))[_0x97bb('0x23')](function(_0x2eddea){if(_0x2eddea){_0x4a3ea3=_0x2eddea;_0x4656e8[_0x97bb('0x48')]=_['keys'](db[_0x97bb('0x82')][_0x97bb('0x46')]);_0x4656e8[_0x97bb('0x49')]=_[_0x97bb('0x4a')](_0x370156['query']);_0x4656e8[_0x97bb('0x4b')]=_['intersection'](_0x4656e8[_0x97bb('0x48')],_0x4656e8[_0x97bb('0x49')]);_0x3103d5[_0x97bb('0x4d')]=_[_0x97bb('0x4c')](_0x4656e8[_0x97bb('0x48')],qs[_0x97bb('0x4e')](_0x370156['query'][_0x97bb('0x4e')]));_0x3103d5[_0x97bb('0x4d')]=_0x3103d5[_0x97bb('0x4d')][_0x97bb('0x4f')]?_0x3103d5[_0x97bb('0x4d')]:_0x4656e8[_0x97bb('0x48')];_0x3103d5[_0x97bb('0x52')]=qs['sort'](_0x370156['query'][_0x97bb('0x53')]);_0x3103d5[_0x97bb('0x54')]=qs[_0x97bb('0x4b')](_[_0x97bb('0x6b')](_0x370156[_0x97bb('0x49')],_0x4656e8['filters']));if(_0x370156[_0x97bb('0x49')]['filter']){_0x3103d5['where']=_[_0x97bb('0x57')](_0x3103d5[_0x97bb('0x54')],{'$or':_[_0x97bb('0x44')](_0x3103d5[_0x97bb('0x4d')],function(_0x1d505e){var _0x34b4a5={};_0x34b4a5[_0x1d505e]={'$like':'%'+_0x370156[_0x97bb('0x49')][_0x97bb('0x55')]+'%'};return _0x34b4a5;})});}_0x3103d5=_['merge']({},_0x3103d5,_0x370156[_0x97bb('0x58')]);return _0x4a3ea3['getApplications'](_0x3103d5);}})[_0x97bb('0x23')](function(_0x5029a3){if(_0x5029a3){_0x31e51e=_0x5029a3[_0x97bb('0x4f')];if(!_0x370156['query'][_0x97bb('0x50')](_0x97bb('0x51'))){_0x3103d5[_0x97bb('0x32')]=qs[_0x97bb('0x32')](_0x370156[_0x97bb('0x49')][_0x97bb('0x32')]);_0x3103d5[_0x97bb('0x35')]=qs[_0x97bb('0x35')](_0x370156[_0x97bb('0x49')]['offset']);}return _0x4a3ea3[_0x97bb('0x87')](_0x3103d5);}})[_0x97bb('0x23')](function(_0x321e5c){if(_0x321e5c){return _0x321e5c?{'count':_0x31e51e,'rows':_0x321e5c}:null;}})[_0x97bb('0x23')](respondWithResult(_0xf5c471,null))[_0x97bb('0x2d')](handleError(_0xf5c471,null));};exports[_0x97bb('0x88')]=function(_0x83116e,_0x26fc25,_0x451e08){var _0x1d1f9d={'channel':_0x97bb('0x89')};var _0x116737=[];var _0x1ee20b=[];var _0x3328f9={};return db[_0x97bb('0x45')][_0x97bb('0x5d')]({'where':{'id':_0x83116e['params']['id']},'include':[{'model':db[_0x97bb('0x82')],'as':_0x97bb('0x8a')}]})[_0x97bb('0x23')](handleEntityNotFound(_0x26fc25,null))['then'](function(_0x321932){_0x1d1f9d[_0x97bb('0x8b')]=_0x321932;if(_0x1d1f9d[_0x97bb('0x8b')]&&_0x1d1f9d[_0x97bb('0x8b')][_0x97bb('0x47')]===_0x97bb('0x8c')&&_0x83116e['body'][_0x97bb('0x8d')]){if(_0x83116e[_0x97bb('0x5f')][_0x97bb('0x8d')]['length']===0x0)return;if(_0x83116e[_0x97bb('0x5f')][_0x97bb('0x8d')][0x0][_0x97bb('0x8e')]!==_0x97bb('0x8f'))return;return db[_0x97bb('0x90')][_0x97bb('0x39')]({'read':!![],'readAt':_0x83116e['body']['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x83116e[_0x97bb('0x5f')]['statuses'][0x0][_0x97bb('0x91')]},'individualHooks':!![]})[_0x97bb('0x23')](function(_0x56d74a){return _0x26fc25[_0x97bb('0x30')](0xc8)[_0x97bb('0x31')](_0x56d74a);});}_0x1d1f9d[_0x97bb('0x92')]=_[_0x97bb('0x93')](_0x321932[_0x97bb('0x8a')],['priority'],[_0x97bb('0x94')]);if(_0x1d1f9d[_0x97bb('0x8b')]['Applications']){delete _0x1d1f9d[_0x97bb('0x8b')][_0x97bb('0x8a')];}return db[_0x97bb('0x95')][_0x97bb('0x66')]()[_0x97bb('0x23')](function(_0x14fa37){if(!_0x14fa37){throw new db[(_0x97bb('0x96'))][(_0x97bb('0x97'))](_0x97bb('0x98'));}_0x116737=_[_0x97bb('0x99')](_[_0x97bb('0x4a')](_0x14fa37),[_0x97bb('0x9a'),_0x97bb('0x9b')]);_0x1ee20b=_['difference'](_[_0x97bb('0x4a')](_0x14fa37),['createdAt',_0x97bb('0x9b'),_0x97bb('0x9c'),_0x97bb('0x9d')]);_0x1d1f9d['body']={'mapKey':_0x97bb('0x9e')};if(_0x1d1f9d[_0x97bb('0x8b')]&&_0x1d1f9d[_0x97bb('0x8b')][_0x97bb('0x47')]===_0x97bb('0x9f')){_0x1d1f9d['body']['from']=_0x83116e['body'][_0x97bb('0xa0')][_0x97bb('0xa1')](_0x97bb('0xa2'),'');_0x1d1f9d[_0x97bb('0x5f')][_0x97bb('0x5f')]=_0x83116e['body'][_0x97bb('0xa3')];_0x1d1f9d[_0x97bb('0x5f')]['messageId']=_0x83116e[_0x97bb('0x5f')][_0x97bb('0xa4')];}if(_0x1d1f9d[_0x97bb('0x8b')]&&_0x1d1f9d[_0x97bb('0x8b')][_0x97bb('0x47')]==='sinch'){_0x1d1f9d[_0x97bb('0x5f')][_0x97bb('0xa5')]=_0x83116e['body']['notifications'][0x0][_0x97bb('0xa5')];_0x1d1f9d['body'][_0x97bb('0x5f')]=_0x83116e[_0x97bb('0x5f')][_0x97bb('0xa6')][0x0][_0x97bb('0x2b')][_0x97bb('0x5f')];_0x1d1f9d[_0x97bb('0x5f')]['messageId']=_0x83116e[_0x97bb('0x5f')][_0x97bb('0xa6')][0x0][_0x97bb('0x91')];}if(_0x1d1f9d['body']['id']){delete _0x1d1f9d[_0x97bb('0x5f')]['id'];}if(_['isNil'](_0x1d1f9d[_0x97bb('0x5f')][_0x97bb('0xa5')])){throw new db[(_0x97bb('0x96'))][(_0x97bb('0x97'))](_0x97bb('0xa7'));}if(_[_0x97bb('0xa8')](_0x1d1f9d[_0x97bb('0x5f')][_0x97bb('0x5f')])||_0x1d1f9d[_0x97bb('0x5f')][_0x97bb('0x5f')]===''){throw new db[(_0x97bb('0x96'))]['ValidationError'](_0x97bb('0xa9'));}if(_[_0x97bb('0xa8')](_0x1d1f9d[_0x97bb('0x5f')][_0x97bb('0xaa')])){throw new db[(_0x97bb('0x96'))]['ValidationError'](_0x97bb('0xab')+_0x1ee20b);}if(!_[_0x97bb('0xac')](_0x1ee20b,_0x1d1f9d[_0x97bb('0x5f')][_0x97bb('0xaa')])){throw new db[(_0x97bb('0x96'))][(_0x97bb('0x97'))](_0x97bb('0xad')+_0x1ee20b);}_0x3328f9[_0x1d1f9d[_0x97bb('0x5f')][_0x97bb('0xaa')]]=_0x1d1f9d[_0x97bb('0x5f')][_0x97bb('0xa5')];return db[_0x97bb('0xae')][_0x97bb('0x5d')]({'where':{'id':_0x1d1f9d[_0x97bb('0x8b')][_0x97bb('0x9d')]},'include':[{'model':db[_0x97bb('0x95')],'as':'Contacts','where':_0x3328f9,'limit':0x1,'order':[[_0x97bb('0x9b'),'DESC']]}]});})[_0x97bb('0x23')](handleEntityNotFound(_0x26fc25,null))['then'](function(_0x3d4079){if(_0x3d4079){_0x1d1f9d[_0x97bb('0xaf')]=_[_0x97bb('0x74')](_0x3d4079,[_0x97bb('0xb0')]);if(_0x3d4079['Contacts'][_0x97bb('0x4f')]){return _0x3d4079[_0x97bb('0xb0')][0x0];}var _0x19574c=_[_0x97bb('0x1a')](_0x1d1f9d[_0x97bb('0x5f')],{'firstName':_0x1d1f9d[_0x97bb('0x5f')][_0x97bb('0xa5')],'ListId':_0x3d4079['id']});_0x19574c[_0x1d1f9d['body']['mapKey']]=_0x1d1f9d[_0x97bb('0x5f')][_0x97bb('0xa5')];return db[_0x97bb('0x95')][_0x97bb('0x5e')](_0x19574c,{'fields':_0x116737,'raw':!![]});}})[_0x97bb('0x23')](handleEntityNotFound(_0x26fc25,null))[_0x97bb('0x23')](function(_0x52cb5d){if(_0x52cb5d){_0x1d1f9d[_0x97bb('0xb1')]=_0x52cb5d;var _0x58a54e={'ContactId':_0x52cb5d['id'],'phone':_0x1d1f9d[_0x97bb('0x5f')][_0x97bb('0xa5')],'WhatsappAccountId':_0x83116e[_0x97bb('0x5c')]['id']};var _0x2cc95a={'ContactId':_0x52cb5d['id'],'WhatsappAccountId':_0x83116e[_0x97bb('0x5c')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x97bb('0x5d')]({'where':_0x2cc95a})[_0x97bb('0x23')](function(_0x490beb){if(_0x490beb){return[_0x490beb,![]];}return db[_0x97bb('0xb2')][_0x97bb('0x5e')](_0x58a54e)[_0x97bb('0x23')](function(_0x53174b){return[_0x53174b,!![]];});});}})['spread'](function(_0x27677e,_0xfa5a0f){_0x1d1f9d[_0x97bb('0xb3')]=_0x27677e['get']({'plain':!![]});_0x1d1f9d[_0x97bb('0xb3')][_0x97bb('0xb4')]=![];if(_0xfa5a0f){if(_0x1d1f9d['account'][_0x97bb('0xb5')]){_0x1d1f9d[_0x97bb('0x92')][_0x97bb('0xb6')]({'id':0x0,'priority':_0x1d1f9d['applications'][_0x97bb('0x4f')]+0x1,'app':'close','appdata':_0x97bb('0xb7'),'interval':'*,*,*,*'});}_0x1d1f9d[_0x97bb('0xb3')][_0x97bb('0xb4')]=!![];}return db[_0x97bb('0x90')]['create']({'phone':_0x1d1f9d['body'][_0x97bb('0xa5')],'messageId':_0x1d1f9d[_0x97bb('0x5f')]['messageId'],'body':_0x1d1f9d[_0x97bb('0x5f')][_0x97bb('0x5f')],'WhatsappAccountId':_0x83116e[_0x97bb('0x5c')]['id'],'WhatsappInteractionId':_0x27677e['id'],'direction':'in','ContactId':_0x27677e['ContactId'],'AttachmentId':_0x1d1f9d[_0x97bb('0x5f')][_0x97bb('0xb8')]});})['then'](function(_0x4587ca){_0x1d1f9d[_0x97bb('0x2b')]=_0x4587ca;if(!_0x1d1f9d[_0x97bb('0xb3')]['UserId'])return;return db['User'][_0x97bb('0x5d')]({'attributes':['id',_0x97bb('0x3f')],'where':{'id':_0x1d1f9d['interaction']['UserId']}});})['then'](function(_0x1dbd3a){if(_0x1dbd3a){_0x1d1f9d[_0x97bb('0x92')][_0x97bb('0xb9')]({'id':0x0,'priority':0x0,'app':_0x97bb('0xba'),'appdata':_0x1dbd3a[_0x97bb('0x3f')]+','+(_0x1d1f9d[_0x97bb('0x8b')][_0x97bb('0xbb')]||0xa),'interval':_0x97bb('0xbc')});}if(!_0x1d1f9d['interaction'][_0x97bb('0xbd')])return;return db[_0x97bb('0xbe')][_0x97bb('0x5d')]({'attributes':['id',_0x97bb('0x3f')],'where':{'id':_0x1d1f9d['interaction'][_0x97bb('0xbd')]}});})['then'](function(_0xa85063){if(_0xa85063){_0x1d1f9d[_0x97bb('0x92')][_0x97bb('0xb9')]({'id':0x0,'priority':0x1,'app':_0x97bb('0xbf'),'appdata':_0xa85063['name']+','+(_0x1d1f9d[_0x97bb('0x8b')][_0x97bb('0xc0')]||0x12c),'interval':_0x97bb('0xbc')});}return respondWithRpcPromise(_0x97bb('0xc1'),_0x97bb('0xc2'),_0x1d1f9d);})[_0x97bb('0x23')](function(_0x5a10fb){if(_0x5a10fb){var _0x22aca1=0xc8;var _0xf8d658='receiveMessage';logger['info'](_0x97bb('0x28'),_0xf8d658,_0x22aca1,_0x97bb('0xc3'));logger[_0x97bb('0x27')](_0x97bb('0xc4'),_0xf8d658,_0x22aca1,_0x97bb('0xc3'),JSON[_0x97bb('0x29')](_0x5a10fb));if(_0x1d1f9d[_0x97bb('0x8b')]['type']===_0x97bb('0x9f')){return _0x26fc25[_0x97bb('0x30')](_0x22aca1)[_0x97bb('0xc5')]('Content-Type',_0x97bb('0xc6'))['send']('\x0a');}else{return _0x26fc25['status'](_0x22aca1)['json'](_0x5a10fb);}}});})[_0x97bb('0x2d')](handleError(_0x26fc25,null));};exports['send']=function(_0x8458d3,_0x3c6a7d,_0x18d6fb){var _0x1df677,_0x51c456,_0x9ae2be;if(_['isNil'](_0x8458d3[_0x97bb('0x5f')]['body'])||_0x8458d3[_0x97bb('0x5f')][_0x97bb('0x5f')]===''){throw new db[(_0x97bb('0x96'))][(_0x97bb('0x97'))](_0x97bb('0xa9'));}if(_[_0x97bb('0xa8')](_0x8458d3[_0x97bb('0x5f')]['to'])){throw new db[(_0x97bb('0x96'))]['ValidationError']('to\x20is\x20mandatory');}_0x1df677=_0x8458d3[_0x97bb('0x5f')]['to'];return db[_0x97bb('0x45')][_0x97bb('0x5d')]({'where':{'id':_0x8458d3[_0x97bb('0x5c')]['id']},'include':[{'model':db[_0x97bb('0xae')],'as':'List','include':[{'model':db[_0x97bb('0x95')],'as':_0x97bb('0xb0'),'where':{'mobile':_0x1df677},'limit':0x1,'order':[['updatedAt',_0x97bb('0xc7')]]}]}]})[_0x97bb('0x23')](handleEntityNotFound(_0x3c6a7d,null))['then'](function(_0x3c9fa2){if(_0x3c9fa2&&_0x3c9fa2[_0x97bb('0xc8')]){_0x51c456=_0x3c9fa2[_0x97bb('0x3b')]({'plain':!![]});if(_0x51c456[_0x97bb('0xc8')]&&_0x51c456[_0x97bb('0xc8')][_0x97bb('0xb0')][_0x97bb('0x4f')]){return _0x51c456['List'][_0x97bb('0xb0')][0x0];}return db[_0x97bb('0x95')][_0x97bb('0x5e')](_[_0x97bb('0x1a')](_0x8458d3[_0x97bb('0x5f')],{'firstName':_0x1df677,'mobile':_0x1df677,'phone':_0x1df677,'ListId':_0x51c456[_0x97bb('0x9d')]}));}})[_0x97bb('0x23')](handleEntityNotFound(_0x3c6a7d,null))[_0x97bb('0x23')](function(_0x4d251d){if(_0x4d251d){_0x9ae2be=_0x4d251d;return db['WhatsappInteraction'][_0x97bb('0x5d')]({'where':{'ContactId':_0x9ae2be['id'],'closed':![],'WhatsappAccountId':_0x51c456['id']}})[_0x97bb('0x23')](function(_0x16a188){if(_0x16a188){return[_0x16a188,![]];}return db[_0x97bb('0xb2')][_0x97bb('0x5e')]({'UserId':_0x8458d3['user']['id'],'ContactId':_0x9ae2be['id'],'WhatsappAccountId':_0x51c456['id'],'phone':_0x1df677,'firstMsgDirection':_0x97bb('0xc9'),'Messages':[_[_0x97bb('0x57')](_0x8458d3[_0x97bb('0x5f')],{'read':![],'body':_0x8458d3['body'][_0x97bb('0x5f')],'phone':_0x1df677,'WhatsappAccountId':_0x51c456['id'],'UserId':_0x8458d3[_0x97bb('0x60')]['id'],'ContactId':_0x9ae2be['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':'Messages'}]})['then'](function(_0x2ace41){return[_0x2ace41,!![]];});});}})[_0x97bb('0x75')](function(_0x3e114b,_0x4513b6){if(_0x4513b6){return _0x3e114b;}return db[_0x97bb('0x90')][_0x97bb('0x5e')](_['merge'](_0x8458d3[_0x97bb('0x5f')],{'read':![],'body':_0x8458d3[_0x97bb('0x5f')]['body'],'phone':_0x1df677,'WhatsappAccountId':_0x51c456['id'],'WhatsappInteractionId':_0x3e114b['id'],'UserId':_0x8458d3[_0x97bb('0x60')]['id'],'ContactId':_0x9ae2be['id']}))[_0x97bb('0x23')](function(_0x1e81e8){_0x3e114b[_0x97bb('0xca')][_0x97bb('0xcb')]=[];_0x3e114b[_0x97bb('0xca')][_0x97bb('0xcb')][_0x97bb('0xb6')](_0x1e81e8[_0x97bb('0xca')]);return _0x3e114b;});})[_0x97bb('0x23')](respondWithResult(_0x3c6a7d,null))[_0x97bb('0x2d')](handleError(_0x3c6a7d,null));}; \ No newline at end of file +var _0x9330=['unshift','queue','waitForTheAssignedQueue','Start','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','update','then','get','WhatsappAccounts','destroy','name','send','index','Pause','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','VIRTUAL','merge','options','WhatsappAccount','includeAll','include','rows','params','keys','find','create','body','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','WhatsappAccountId','Disposition','getDispositions','findOne','order','filter','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','pick','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','Transaction','WhatsappApplication','bulkCreate','priority','stack','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','applications','asc','CmContact','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','mobile','twilio','from','From','whatsapp:','Body','messageId','MessageSid','notifications','message_id','ValidationError','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','WhatsappInteraction','interaction','created','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','queueId','WhatsappQueue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9330,0xd3));var _0x0933=function(_0x34e615,_0x3d1f7c){_0x34e615=_0x34e615-0x0;var _0x1d124d=_0x9330[_0x34e615];return _0x1d124d;};'use strict';var emlformat=require(_0x0933('0x0'));var rimraf=require(_0x0933('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0933('0x2'));var rp=require('request-promise');var moment=require(_0x0933('0x3'));var BPromise=require(_0x0933('0x4'));var Mustache=require(_0x0933('0x5'));var util=require(_0x0933('0x6'));var path=require(_0x0933('0x7'));var sox=require(_0x0933('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0933('0x9'));var crypto=require(_0x0933('0xa'));var jsforce=require(_0x0933('0xb'));var deskjs=require(_0x0933('0xc'));var toCsv=require(_0x0933('0xd'));var querystring=require(_0x0933('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0933('0xf'));var as=require(_0x0933('0x10'));var hardwareService=require(_0x0933('0x11'));var logger=require(_0x0933('0x12'))('api');var utils=require(_0x0933('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0933('0x14'));var db=require(_0x0933('0x15'))['db'];config[_0x0933('0x16')]=_[_0x0933('0x17')](config[_0x0933('0x16')],{'host':_0x0933('0x18'),'port':0x18eb});var socket=require(_0x0933('0x19'))(new Redis(config['redis']));require(_0x0933('0x1a'))[_0x0933('0x1b')](socket);var jayson=require(_0x0933('0x1c'));var client=jayson[_0x0933('0x1d')][_0x0933('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x5ab362,_0x534bb2,_0x561569,_0x3da79b){return new BPromise(function(_0x244ecf,_0x5f0186){var _0x568b53=_0x3da79b||client;return _0x568b53['request'](_0x5ab362,_0x561569)['then'](function(_0x4bc15e){logger[_0x0933('0x1f')](_0x0933('0x20'),_0x534bb2,_0x0933('0x21'));logger[_0x0933('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x534bb2,_0x0933('0x21'),JSON[_0x0933('0x23')](_0x4bc15e));if(_0x4bc15e[_0x0933('0x24')]){if(_0x4bc15e[_0x0933('0x24')][_0x0933('0x25')]===0x1f4){logger['error'](_0x0933('0x20'),_0x534bb2,_0x4bc15e[_0x0933('0x24')][_0x0933('0x26')]);return _0x5f0186(_0x4bc15e['error'][_0x0933('0x26')]);}logger[_0x0933('0x24')](_0x0933('0x20'),_0x534bb2,_0x4bc15e[_0x0933('0x24')]['message']);return _0x244ecf(_0x4bc15e[_0x0933('0x24')][_0x0933('0x26')]);}else{logger[_0x0933('0x1f')](_0x0933('0x20'),_0x534bb2,'request\x20sent');_0x244ecf(_0x4bc15e[_0x0933('0x27')]['message']);}})[_0x0933('0x28')](function(_0x163601){logger[_0x0933('0x24')](_0x0933('0x20'),_0x534bb2,_0x163601);_0x5f0186(_0x163601);});});}function respondWithStatusCode(_0x2c151c,_0x2f0cd2){_0x2f0cd2=_0x2f0cd2||0xcc;return function(_0x283ab2){if(_0x283ab2){return _0x2c151c[_0x0933('0x29')](_0x2f0cd2);}return _0x2c151c[_0x0933('0x2a')](_0x2f0cd2)[_0x0933('0x2b')]();};}function respondWithResult(_0x54db00,_0x1a3e9a){_0x1a3e9a=_0x1a3e9a||0xc8;return function(_0xf1f341){if(_0xf1f341){return _0x54db00[_0x0933('0x2a')](_0x1a3e9a)['json'](_0xf1f341);}};}function respondWithFilteredResult(_0x321b79,_0x2e391e){return function(_0x186378){if(_0x186378){var _0x1df76b=typeof _0x2e391e[_0x0933('0x2c')]==='undefined'&&typeof _0x2e391e['limit']===_0x0933('0x2d');var _0x1edfa7=_0x186378[_0x0933('0x2e')];var _0x91814e=_0x1df76b?0x0:_0x2e391e[_0x0933('0x2c')];var _0x5dfb2a=_0x1df76b?_0x186378[_0x0933('0x2e')]:_0x2e391e[_0x0933('0x2c')]+_0x2e391e[_0x0933('0x2f')];var _0x53b992;if(_0x5dfb2a>=_0x1edfa7){_0x5dfb2a=_0x1edfa7;_0x53b992=0xc8;}else{_0x53b992=0xce;}_0x321b79[_0x0933('0x2a')](_0x53b992);return _0x321b79[_0x0933('0x30')](_0x0933('0x31'),_0x91814e+'-'+_0x5dfb2a+'/'+_0x1edfa7)[_0x0933('0x32')](_0x186378);}return null;};}function patchUpdates(_0x1a3262){return function(_0x49125f){try{jsonpatch[_0x0933('0x33')](_0x49125f,_0x1a3262,!![]);}catch(_0x44af38){return BPromise['reject'](_0x44af38);}return _0x49125f['save']();};}function saveUpdates(_0x2b5e3b,_0x181cb3){return function(_0xabbcf3){if(_0xabbcf3){return _0xabbcf3[_0x0933('0x34')](_0x2b5e3b)['then'](function(_0x1f5390){return _0x1f5390;});}return null;};}function removeEntity(_0x51998f,_0x4b0a82){return function(_0x4adad3){if(_0x4adad3){return _0x4adad3['destroy']()[_0x0933('0x35')](function(){var _0x37eced=_0x4adad3[_0x0933('0x36')]({'plain':!![]});var _0x12c5d2=_0x0933('0x37');return db['UserProfileResource'][_0x0933('0x38')]({'where':{'type':_0x12c5d2,'resourceId':_0x37eced['id']}})[_0x0933('0x35')](function(){return _0x4adad3;});})['then'](function(){_0x51998f['status'](0xcc)[_0x0933('0x2b')]();});}};}function handleEntityNotFound(_0x4181e9,_0x6c36e7){return function(_0x48af73){if(!_0x48af73){_0x4181e9[_0x0933('0x29')](0x194);}return _0x48af73;};}function handleError(_0x9d96bd,_0x2c0fb8){_0x2c0fb8=_0x2c0fb8||0x1f4;return function(_0x5f5b9b){logger[_0x0933('0x24')](_0x5f5b9b['stack']);if(_0x5f5b9b[_0x0933('0x39')]){delete _0x5f5b9b[_0x0933('0x39')];}_0x9d96bd[_0x0933('0x2a')](_0x2c0fb8)[_0x0933('0x3a')](_0x5f5b9b);};}exports[_0x0933('0x3b')]=function(_0x1f2c8c,_0x5c7205){var _0x1bf694={'include':[{'model':db[_0x0933('0x3c')],'as':'mandatoryDispositionPause'}]},_0x4fdb5c={},_0x23ea65={'count':0x0,'rows':[]};var _0x3131de=_[_0x0933('0x3d')](db['WhatsappAccount'][_0x0933('0x3e')],function(_0x5e8529){return{'name':_0x5e8529[_0x0933('0x3f')],'type':_0x5e8529[_0x0933('0x40')][_0x0933('0x41')]};});_0x4fdb5c[_0x0933('0x42')]=_[_0x0933('0x3d')](_0x3131de,_0x0933('0x39'));_0x4fdb5c[_0x0933('0x43')]=_['keys'](_0x1f2c8c[_0x0933('0x43')]);_0x4fdb5c[_0x0933('0x44')]=_[_0x0933('0x45')](_0x4fdb5c[_0x0933('0x42')],_0x4fdb5c['query']);_0x1bf694[_0x0933('0x46')]=_[_0x0933('0x45')](_0x4fdb5c['model'],qs[_0x0933('0x47')](_0x1f2c8c[_0x0933('0x43')]['fields']));_0x1bf694['attributes']=_0x1bf694[_0x0933('0x46')][_0x0933('0x48')]?_0x1bf694[_0x0933('0x46')]:_0x4fdb5c['model'];if(!_0x1f2c8c['query']['hasOwnProperty'](_0x0933('0x49'))){_0x1bf694[_0x0933('0x2f')]=qs['limit'](_0x1f2c8c[_0x0933('0x43')]['limit']);_0x1bf694[_0x0933('0x2c')]=qs[_0x0933('0x2c')](_0x1f2c8c[_0x0933('0x43')][_0x0933('0x2c')]);}_0x1bf694['order']=qs[_0x0933('0x4a')](_0x1f2c8c[_0x0933('0x43')][_0x0933('0x4a')]);_0x1bf694[_0x0933('0x4b')]=qs[_0x0933('0x44')](_['pick'](_0x1f2c8c['query'],_0x4fdb5c[_0x0933('0x44')]),_0x3131de);if(_0x1f2c8c['query']['filter']){_0x1bf694[_0x0933('0x4b')]=_['merge'](_0x1bf694[_0x0933('0x4b')],{'$or':_[_0x0933('0x3d')](_0x3131de,function(_0x58fa5a){if(_0x58fa5a['type']!==_0x0933('0x4c')){var _0x453d94={};_0x453d94[_0x58fa5a['name']]={'$like':'%'+_0x1f2c8c[_0x0933('0x43')]['filter']+'%'};return _0x453d94;}})});}_0x1bf694=_[_0x0933('0x4d')]({},_0x1bf694,_0x1f2c8c[_0x0933('0x4e')]);var _0x2f9565={'where':_0x1bf694[_0x0933('0x4b')]};return db[_0x0933('0x4f')][_0x0933('0x2e')](_0x2f9565)[_0x0933('0x35')](function(_0x512c39){_0x23ea65[_0x0933('0x2e')]=_0x512c39;if(_0x1f2c8c['query'][_0x0933('0x50')]){_0x1bf694[_0x0933('0x51')]=[{'all':!![]}];}return db[_0x0933('0x4f')]['findAll'](_0x1bf694);})[_0x0933('0x35')](function(_0x57bc2d){_0x23ea65[_0x0933('0x52')]=_0x57bc2d;return _0x23ea65;})[_0x0933('0x35')](respondWithFilteredResult(_0x5c7205,_0x1bf694))[_0x0933('0x28')](handleError(_0x5c7205,null));};exports['show']=function(_0x4a1373,_0x11732b){var _0x5a845f={'raw':![],'where':{'id':_0x4a1373[_0x0933('0x53')]['id']},'include':[{'model':db[_0x0933('0x3c')],'as':'mandatoryDispositionPause'}]},_0x3b5be3={};_0x3b5be3[_0x0933('0x42')]=_[_0x0933('0x54')](db[_0x0933('0x4f')][_0x0933('0x3e')]);_0x3b5be3[_0x0933('0x43')]=_['keys'](_0x4a1373['query']);_0x3b5be3[_0x0933('0x44')]=_[_0x0933('0x45')](_0x3b5be3[_0x0933('0x42')],_0x3b5be3['query']);_0x5a845f['attributes']=_[_0x0933('0x45')](_0x3b5be3[_0x0933('0x42')],qs['fields'](_0x4a1373[_0x0933('0x43')]['fields']));_0x5a845f['attributes']=_0x5a845f[_0x0933('0x46')]['length']?_0x5a845f['attributes']:_0x3b5be3[_0x0933('0x42')];if(_0x4a1373[_0x0933('0x43')]['includeAll']){_0x5a845f[_0x0933('0x51')]=[{'all':!![]}];}_0x5a845f=_[_0x0933('0x4d')]({},_0x5a845f,_0x4a1373[_0x0933('0x4e')]);return db[_0x0933('0x4f')][_0x0933('0x55')](_0x5a845f)[_0x0933('0x35')](handleEntityNotFound(_0x11732b,null))[_0x0933('0x35')](respondWithResult(_0x11732b,null))[_0x0933('0x28')](handleError(_0x11732b,null));};exports[_0x0933('0x56')]=function(_0x39bab7,_0x17b8de){return db['WhatsappAccount'][_0x0933('0x56')](_0x39bab7[_0x0933('0x57')],{})[_0x0933('0x35')](function(_0x2e2a23){var _0x3bb3d2=_0x39bab7[_0x0933('0x58')][_0x0933('0x36')]({'plain':!![]});if(!_0x3bb3d2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3bb3d2[_0x0933('0x59')]==='user'){var _0xa95b5c=_0x2e2a23[_0x0933('0x36')]({'plain':!![]});var _0x13ed87='WhatsappAccounts';return db['UserProfileSection'][_0x0933('0x55')]({'where':{'name':_0x13ed87,'userProfileId':_0x3bb3d2[_0x0933('0x5a')]},'raw':!![]})[_0x0933('0x35')](function(_0xe4adcd){if(_0xe4adcd&&_0xe4adcd[_0x0933('0x5b')]===0x0){return db[_0x0933('0x5c')][_0x0933('0x56')]({'name':_0xa95b5c[_0x0933('0x39')],'resourceId':_0xa95b5c['id'],'type':_0xe4adcd[_0x0933('0x39')],'sectionId':_0xe4adcd['id']},{})[_0x0933('0x35')](function(){return _0x2e2a23;});}else{return _0x2e2a23;}})['catch'](function(_0x2dfcb5){logger['error'](_0x0933('0x5d'),_0x2dfcb5);throw _0x2dfcb5;});}return _0x2e2a23;})[_0x0933('0x35')](respondWithResult(_0x17b8de,0xc9))[_0x0933('0x28')](handleError(_0x17b8de,null));};exports[_0x0933('0x34')]=function(_0x5d5ef0,_0x9755b5){if(_0x5d5ef0['body']['id']){delete _0x5d5ef0[_0x0933('0x57')]['id'];}return db[_0x0933('0x4f')][_0x0933('0x55')]({'where':{'id':_0x5d5ef0['params']['id']},'include':[{'model':db[_0x0933('0x3c')],'as':_0x0933('0x5e')}]})[_0x0933('0x35')](handleEntityNotFound(_0x9755b5,null))[_0x0933('0x35')](saveUpdates(_0x5d5ef0[_0x0933('0x57')],null))[_0x0933('0x35')](respondWithResult(_0x9755b5,null))[_0x0933('0x28')](handleError(_0x9755b5,null));};exports[_0x0933('0x38')]=function(_0x53be29,_0x2bb006){return db[_0x0933('0x4f')]['find']({'where':{'id':_0x53be29['params']['id']}})['then'](handleEntityNotFound(_0x2bb006,null))[_0x0933('0x35')](removeEntity(_0x2bb006,null))[_0x0933('0x28')](handleError(_0x2bb006,null));};exports[_0x0933('0x5f')]=function(_0x5037a1,_0x36a6ca){return db[_0x0933('0x4f')][_0x0933('0x5f')]()[_0x0933('0x35')](respondWithResult(_0x36a6ca,null))['catch'](handleError(_0x36a6ca,null));};exports['addDisposition']=function(_0x2986a3,_0x5d45c7,_0x2c48b9){if(_0x2986a3[_0x0933('0x57')]['id']){delete _0x2986a3[_0x0933('0x57')]['id'];}return db[_0x0933('0x4f')][_0x0933('0x55')]({'where':{'id':_0x2986a3['params']['id']}})[_0x0933('0x35')](handleEntityNotFound(_0x5d45c7,null))[_0x0933('0x35')](function(_0x4b12af){if(_0x4b12af){_0x2986a3['body'][_0x0933('0x60')]=_0x4b12af['id'];return db[_0x0933('0x61')][_0x0933('0x56')](_0x2986a3[_0x0933('0x57')]);}})[_0x0933('0x35')](respondWithResult(_0x5d45c7,null))[_0x0933('0x28')](handleError(_0x5d45c7,null));};exports[_0x0933('0x62')]=function(_0x2eaa59,_0x499ab1,_0x4b59fe){var _0x2c438f={'raw':![],'where':{}};var _0xdd28db={};var _0x1eb09d={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x0933('0x63')]({'where':{'id':_0x2eaa59[_0x0933('0x53')]['id']}})[_0x0933('0x35')](handleEntityNotFound(_0x499ab1,null))['then'](function(_0x17e52b){if(_0x17e52b){_0xdd28db['model']=_['keys'](db['Disposition'][_0x0933('0x3e')]);_0xdd28db[_0x0933('0x43')]=_['keys'](_0x2eaa59['query']);_0xdd28db[_0x0933('0x44')]=_['intersection'](_0xdd28db['model'],_0xdd28db[_0x0933('0x43')]);_0x2c438f['attributes']=_[_0x0933('0x45')](_0xdd28db[_0x0933('0x42')],qs[_0x0933('0x47')](_0x2eaa59['query'][_0x0933('0x47')]));_0x2c438f[_0x0933('0x46')]=_0x2c438f[_0x0933('0x46')][_0x0933('0x48')]?_0x2c438f[_0x0933('0x46')]:_0xdd28db[_0x0933('0x42')];if(!_0x2eaa59[_0x0933('0x43')]['hasOwnProperty']('nolimit')){_0x2c438f[_0x0933('0x2f')]=qs[_0x0933('0x2f')](_0x2eaa59[_0x0933('0x43')][_0x0933('0x2f')]);_0x2c438f['offset']=qs[_0x0933('0x2c')](_0x2eaa59[_0x0933('0x43')]['offset']);}_0x2c438f[_0x0933('0x64')]=qs[_0x0933('0x4a')](_0x2eaa59['query'][_0x0933('0x4a')]);_0x2c438f['where']=qs[_0x0933('0x44')](_['pick'](_0x2eaa59[_0x0933('0x43')],_0xdd28db[_0x0933('0x44')]));_0x2c438f['where'][_0x0933('0x60')]=_0x17e52b['id'];if(_0x2eaa59[_0x0933('0x43')][_0x0933('0x65')]){_0x2c438f[_0x0933('0x4b')]=_['merge'](_0x2c438f['where'],{'$or':_[_0x0933('0x3d')](_0x2c438f['attributes'],function(_0x38877c){var _0x19faa4={};_0x19faa4[_0x38877c]={'$like':'%'+_0x2eaa59['query']['filter']+'%'};return _0x19faa4;})});}_0x2c438f=_[_0x0933('0x4d')]({},_0x2c438f,_0x2eaa59['options']);return db['Disposition']['count']({'where':_0x2c438f['where']})['then'](function(_0x47f976){_0x1eb09d[_0x0933('0x2e')]=_0x47f976;if(_0x2eaa59[_0x0933('0x43')][_0x0933('0x50')]){_0x2c438f[_0x0933('0x51')]=[{'all':!![]}];}return db[_0x0933('0x61')]['findAll'](_0x2c438f);})['then'](function(_0x5a6c2c){_0x1eb09d[_0x0933('0x52')]=_0x5a6c2c;return _0x1eb09d;});}})['then'](respondWithFilteredResult(_0x499ab1,_0x2c438f))['catch'](handleError(_0x499ab1,null));};exports[_0x0933('0x66')]=function(_0x1b6e0e,_0x1aa733,_0x5000ed){return db[_0x0933('0x4f')][_0x0933('0x55')]({'where':{'id':_0x1b6e0e[_0x0933('0x53')]['id']}})[_0x0933('0x35')](handleEntityNotFound(_0x1aa733,null))[_0x0933('0x35')](function(_0x3ba6be){if(_0x3ba6be){return _0x3ba6be[_0x0933('0x66')](_0x1b6e0e[_0x0933('0x43')][_0x0933('0x67')]);}})[_0x0933('0x35')](respondWithStatusCode(_0x1aa733,null))[_0x0933('0x28')](handleError(_0x1aa733,null));};exports[_0x0933('0x68')]=function(_0x4cf4e2,_0x49d3d1,_0x26ebb3){if(_0x4cf4e2['body']['id']){delete _0x4cf4e2[_0x0933('0x57')]['id'];}return db[_0x0933('0x4f')]['find']({'where':{'id':_0x4cf4e2[_0x0933('0x53')]['id']}})['then'](handleEntityNotFound(_0x49d3d1,null))[_0x0933('0x35')](function(_0x38f2e7){if(_0x38f2e7){_0x4cf4e2['body']['WhatsappAccountId']=_0x38f2e7['id'];return db[_0x0933('0x69')]['create'](_0x4cf4e2[_0x0933('0x57')]);}})[_0x0933('0x35')](respondWithResult(_0x49d3d1,null))[_0x0933('0x28')](handleError(_0x49d3d1,null));};exports[_0x0933('0x6a')]=function(_0x313485,_0x1fafaf,_0x4a6b92){var _0x513827={'raw':![],'where':{}};var _0x44351e={};var _0x59d978={'count':0x0,'rows':[]};return db[_0x0933('0x4f')]['findOne']({'where':{'id':_0x313485[_0x0933('0x53')]['id']}})['then'](handleEntityNotFound(_0x1fafaf,null))['then'](function(_0x2d0f4a){if(_0x2d0f4a){_0x44351e[_0x0933('0x42')]=_[_0x0933('0x54')](db['CannedAnswer'][_0x0933('0x3e')]);_0x44351e['query']=_[_0x0933('0x54')](_0x313485[_0x0933('0x43')]);_0x44351e[_0x0933('0x44')]=_[_0x0933('0x45')](_0x44351e[_0x0933('0x42')],_0x44351e[_0x0933('0x43')]);_0x513827[_0x0933('0x46')]=_[_0x0933('0x45')](_0x44351e[_0x0933('0x42')],qs[_0x0933('0x47')](_0x313485['query'][_0x0933('0x47')]));_0x513827[_0x0933('0x46')]=_0x513827[_0x0933('0x46')][_0x0933('0x48')]?_0x513827[_0x0933('0x46')]:_0x44351e['model'];if(!_0x313485['query'][_0x0933('0x6b')](_0x0933('0x49'))){_0x513827[_0x0933('0x2f')]=qs[_0x0933('0x2f')](_0x313485[_0x0933('0x43')][_0x0933('0x2f')]);_0x513827[_0x0933('0x2c')]=qs['offset'](_0x313485[_0x0933('0x43')][_0x0933('0x2c')]);}_0x513827[_0x0933('0x64')]=qs[_0x0933('0x4a')](_0x313485['query'][_0x0933('0x4a')]);_0x513827[_0x0933('0x4b')]=qs[_0x0933('0x44')](_[_0x0933('0x6c')](_0x313485[_0x0933('0x43')],_0x44351e[_0x0933('0x44')]));_0x513827[_0x0933('0x4b')]['WhatsappAccountId']=_0x2d0f4a['id'];if(_0x313485[_0x0933('0x43')][_0x0933('0x65')]){_0x513827[_0x0933('0x4b')]=_[_0x0933('0x4d')](_0x513827[_0x0933('0x4b')],{'$or':_[_0x0933('0x3d')](_0x513827['attributes'],function(_0x23caa9){var _0x3dc3a0={};_0x3dc3a0[_0x23caa9]={'$like':'%'+_0x313485[_0x0933('0x43')][_0x0933('0x65')]+'%'};return _0x3dc3a0;})});}_0x513827=_[_0x0933('0x4d')]({},_0x513827,_0x313485['options']);return db['CannedAnswer'][_0x0933('0x2e')]({'where':_0x513827[_0x0933('0x4b')]})[_0x0933('0x35')](function(_0x10dab2){_0x59d978[_0x0933('0x2e')]=_0x10dab2;if(_0x313485['query'][_0x0933('0x50')]){_0x513827[_0x0933('0x51')]=[{'all':!![]}];}return db[_0x0933('0x69')]['findAll'](_0x513827);})[_0x0933('0x35')](function(_0x1e3afd){_0x59d978[_0x0933('0x52')]=_0x1e3afd;return _0x59d978;});}})[_0x0933('0x35')](respondWithFilteredResult(_0x1fafaf,_0x513827))[_0x0933('0x28')](handleError(_0x1fafaf,null));};exports['removeAnswers']=function(_0x590fbe,_0x2e8878,_0x387c97){return db[_0x0933('0x4f')][_0x0933('0x55')]({'where':{'id':_0x590fbe[_0x0933('0x53')]['id']}})[_0x0933('0x35')](handleEntityNotFound(_0x2e8878,null))['then'](function(_0x48198c){if(_0x48198c){return _0x48198c[_0x0933('0x6d')](_0x590fbe[_0x0933('0x43')]['ids']);}})[_0x0933('0x35')](respondWithStatusCode(_0x2e8878,null))[_0x0933('0x28')](handleError(_0x2e8878,null));};exports[_0x0933('0x6e')]=function(_0x5c68f0,_0x2f2564,_0x2b9655){return db[_0x0933('0x4f')]['find']({'where':{'id':_0x5c68f0[_0x0933('0x53')]['id']}})[_0x0933('0x35')](handleEntityNotFound(_0x2f2564,null))[_0x0933('0x35')](function(_0x332900){if(_0x332900){return _0x332900['addAgents'](_0x5c68f0['body'][_0x0933('0x67')],_[_0x0933('0x6f')](_0x5c68f0[_0x0933('0x57')],['ids','id'])||{})[_0x0933('0x70')](function(_0x1f2312){for(var _0x3538ff=0x0;_0x3538ff<_0x5c68f0['body'][_0x0933('0x67')][_0x0933('0x48')];_0x3538ff+=0x1){socket['emit'](_0x0933('0x71'),{'UserId':Number(_0x5c68f0['body'][_0x0933('0x67')][_0x3538ff]),'WhatsappAccountId':Number(_0x5c68f0[_0x0933('0x53')]['id'])});}return _0x1f2312;});}})[_0x0933('0x35')](respondWithResult(_0x2f2564,null))[_0x0933('0x28')](handleError(_0x2f2564,null));};exports['removeAgents']=function(_0x3a587c,_0x51d1ec,_0x28fcc9){return db[_0x0933('0x4f')][_0x0933('0x55')]({'where':{'id':_0x3a587c[_0x0933('0x53')]['id']}})[_0x0933('0x35')](handleEntityNotFound(_0x51d1ec,null))[_0x0933('0x35')](function(_0x29ace0){if(_0x29ace0){return _0x29ace0[_0x0933('0x72')](_0x3a587c[_0x0933('0x43')][_0x0933('0x67')])[_0x0933('0x35')](function(){if(_[_0x0933('0x73')](_0x3a587c[_0x0933('0x43')]['ids'])){for(var _0x355814=0x0;_0x355814<_0x3a587c[_0x0933('0x43')]['ids']['length'];_0x355814+=0x1){socket[_0x0933('0x74')](_0x0933('0x75'),{'UserId':Number(_0x3a587c[_0x0933('0x43')][_0x0933('0x67')][_0x355814]),'WhatsappAccountId':Number(_0x3a587c['params']['id'])});}}else{socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x3a587c[_0x0933('0x43')][_0x0933('0x67')]),'WhatsappAccountId':Number(_0x3a587c['params']['id'])});}});}})[_0x0933('0x35')](respondWithStatusCode(_0x51d1ec,null))['catch'](handleError(_0x51d1ec,null));};exports[_0x0933('0x76')]=function(_0xadf85f,_0x15c83b,_0x4851b4){var _0x2b851f={};var _0x513f5f={};var _0x17ffb0;var _0x1c0d8b;return db[_0x0933('0x4f')][_0x0933('0x63')]({'where':{'id':_0xadf85f['params']['id']}})[_0x0933('0x35')](handleEntityNotFound(_0x15c83b,null))[_0x0933('0x35')](function(_0x5272f4){if(_0x5272f4){_0x17ffb0=_0x5272f4;_0x513f5f['model']=_[_0x0933('0x54')](db[_0x0933('0x77')][_0x0933('0x3e')]);_0x513f5f[_0x0933('0x43')]=_[_0x0933('0x54')](_0xadf85f[_0x0933('0x43')]);_0x513f5f['filters']=_[_0x0933('0x45')](_0x513f5f[_0x0933('0x42')],_0x513f5f['query']);_0x2b851f['attributes']=_['intersection'](_0x513f5f['model'],qs[_0x0933('0x47')](_0xadf85f[_0x0933('0x43')]['fields']));_0x2b851f[_0x0933('0x46')]=_0x2b851f[_0x0933('0x46')]['length']?_0x2b851f[_0x0933('0x46')]:_0x513f5f['model'];_0x2b851f[_0x0933('0x64')]=qs[_0x0933('0x4a')](_0xadf85f['query'][_0x0933('0x4a')]);_0x2b851f['where']=qs[_0x0933('0x44')](_[_0x0933('0x6c')](_0xadf85f[_0x0933('0x43')],_0x513f5f[_0x0933('0x44')]));if(_0xadf85f[_0x0933('0x43')][_0x0933('0x65')]){_0x2b851f[_0x0933('0x4b')]=_[_0x0933('0x4d')](_0x2b851f[_0x0933('0x4b')],{'$or':_[_0x0933('0x3d')](_0x2b851f[_0x0933('0x46')],function(_0x55aed1){var _0x5a7ef9={};_0x5a7ef9[_0x55aed1]={'$like':'%'+_0xadf85f[_0x0933('0x43')]['filter']+'%'};return _0x5a7ef9;})});}_0x2b851f=_['merge']({},_0x2b851f,_0xadf85f[_0x0933('0x4e')]);return _0x17ffb0['getAgents'](_0x2b851f);}})[_0x0933('0x35')](function(_0x275598){if(_0x275598){_0x1c0d8b=_0x275598[_0x0933('0x48')];if(!_0xadf85f[_0x0933('0x43')]['hasOwnProperty'](_0x0933('0x49'))){_0x2b851f[_0x0933('0x2f')]=qs[_0x0933('0x2f')](_0xadf85f[_0x0933('0x43')][_0x0933('0x2f')]);_0x2b851f['offset']=qs['offset'](_0xadf85f[_0x0933('0x43')][_0x0933('0x2c')]);}return _0x17ffb0[_0x0933('0x76')](_0x2b851f);}})[_0x0933('0x35')](function(_0x19d3f3){if(_0x19d3f3){return _0x19d3f3?{'count':_0x1c0d8b,'rows':_0x19d3f3}:null;}})['then'](respondWithResult(_0x15c83b,null))[_0x0933('0x28')](handleError(_0x15c83b,null));};exports[_0x0933('0x78')]=function(_0x445c1b,_0x4dfc2c){var _0x326778=_0x445c1b[_0x0933('0x53')]['id'];var _0x31a5e8=_0x445c1b[_0x0933('0x57')];var _0x4a818c=0xc8;var _0x3c0b8e=null;return db[_0x0933('0x79')]['transaction']({'isolationLevel':db[_0x0933('0x79')][_0x0933('0x7a')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x490534){return db[_0x0933('0x4f')][_0x0933('0x63')]({'where':{'id':_0x326778},'transaction':_0x490534})[_0x0933('0x35')](function(_0x4e6688){if(_0x4e6688){return db[_0x0933('0x7b')]['destroy']({'where':{'WhatsappAccountId':_0x326778},'transaction':_0x490534})[_0x0933('0x35')](function(){var _0x1debfa=_[_0x0933('0x3d')](_0x31a5e8,function(_0x1369a3){_0x1369a3['WhatsappAccountId']=_0x326778;return _0x1369a3;});return db[_0x0933('0x7b')][_0x0933('0x7c')](_0x1debfa,{'transaction':_0x490534});});}else{_0x4a818c=0x194;_0x3c0b8e=[];}});})[_0x0933('0x35')](function(){if(_0x4a818c!==0x194){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x326778},'order':_0x0933('0x7d')})[_0x0933('0x35')](function(_0x32540c){_0x3c0b8e=_0x32540c;});}})[_0x0933('0x28')](function(_0x2486b9){_0x4a818c=0x1f4;logger['error'](_0x2486b9[_0x0933('0x7e')]);if(_0x2486b9['name']){delete _0x2486b9[_0x0933('0x39')];}_0x3c0b8e=_0x2486b9;})[_0x0933('0x7f')](function(){if(_0x3c0b8e===null){_0x4dfc2c[_0x0933('0x29')](_0x4a818c);}else{if(_0x4a818c===0x1f4){_0x4dfc2c['status'](_0x4a818c)[_0x0933('0x3a')](_0x3c0b8e);}else{_0x4dfc2c['status'](_0x4a818c)[_0x0933('0x32')](_0x3c0b8e);}}});};exports[_0x0933('0x80')]=function(_0x4dbb42,_0x359093,_0x3cd472){var _0x28a2ff={};var _0x203d73={};var _0x321c62;var _0x5c4ab9;return db[_0x0933('0x4f')]['findOne']({'where':{'id':_0x4dbb42['params']['id']}})[_0x0933('0x35')](handleEntityNotFound(_0x359093,null))['then'](function(_0x862b52){if(_0x862b52){_0x321c62=_0x862b52;_0x203d73[_0x0933('0x42')]=_[_0x0933('0x54')](db[_0x0933('0x7b')]['rawAttributes']);_0x203d73[_0x0933('0x43')]=_['keys'](_0x4dbb42[_0x0933('0x43')]);_0x203d73['filters']=_[_0x0933('0x45')](_0x203d73[_0x0933('0x42')],_0x203d73[_0x0933('0x43')]);_0x28a2ff[_0x0933('0x46')]=_['intersection'](_0x203d73['model'],qs[_0x0933('0x47')](_0x4dbb42[_0x0933('0x43')][_0x0933('0x47')]));_0x28a2ff['attributes']=_0x28a2ff['attributes']['length']?_0x28a2ff[_0x0933('0x46')]:_0x203d73[_0x0933('0x42')];_0x28a2ff[_0x0933('0x64')]=qs[_0x0933('0x4a')](_0x4dbb42[_0x0933('0x43')]['sort']);_0x28a2ff[_0x0933('0x4b')]=qs['filters'](_[_0x0933('0x6c')](_0x4dbb42[_0x0933('0x43')],_0x203d73['filters']));if(_0x4dbb42['query']['filter']){_0x28a2ff['where']=_[_0x0933('0x4d')](_0x28a2ff[_0x0933('0x4b')],{'$or':_[_0x0933('0x3d')](_0x28a2ff[_0x0933('0x46')],function(_0x57f718){var _0x56c157={};_0x56c157[_0x57f718]={'$like':'%'+_0x4dbb42['query'][_0x0933('0x65')]+'%'};return _0x56c157;})});}_0x28a2ff=_['merge']({},_0x28a2ff,_0x4dbb42[_0x0933('0x4e')]);return _0x321c62[_0x0933('0x80')](_0x28a2ff);}})[_0x0933('0x35')](function(_0xb182a1){if(_0xb182a1){_0x5c4ab9=_0xb182a1[_0x0933('0x48')];if(!_0x4dbb42[_0x0933('0x43')][_0x0933('0x6b')](_0x0933('0x49'))){_0x28a2ff[_0x0933('0x2f')]=qs['limit'](_0x4dbb42['query']['limit']);_0x28a2ff[_0x0933('0x2c')]=qs[_0x0933('0x2c')](_0x4dbb42[_0x0933('0x43')][_0x0933('0x2c')]);}return _0x321c62[_0x0933('0x80')](_0x28a2ff);}})['then'](function(_0x211559){if(_0x211559){return _0x211559?{'count':_0x5c4ab9,'rows':_0x211559}:null;}})[_0x0933('0x35')](respondWithResult(_0x359093,null))[_0x0933('0x28')](handleError(_0x359093,null));};exports[_0x0933('0x81')]=function(_0xf0d347,_0x413384,_0x3a6997){var _0x41c086={'channel':_0x0933('0x82')};var _0x3a1eeb=[];var _0x27a0a5=[];var _0x5d1a86={};return db[_0x0933('0x4f')][_0x0933('0x55')]({'where':{'id':_0xf0d347[_0x0933('0x53')]['id']},'include':[{'model':db[_0x0933('0x7b')],'as':_0x0933('0x83')}]})['then'](handleEntityNotFound(_0x413384,null))['then'](function(_0x119073){_0x41c086[_0x0933('0x84')]=_0x119073;if(_0x41c086[_0x0933('0x84')]&&_0x41c086['account'][_0x0933('0x40')]===_0x0933('0x85')&&_0xf0d347[_0x0933('0x57')][_0x0933('0x86')]){if(_0xf0d347[_0x0933('0x57')]['statuses']['length']===0x0)return;if(_0xf0d347[_0x0933('0x57')][_0x0933('0x86')][0x0][_0x0933('0x87')]!==_0x0933('0x88'))return;return db[_0x0933('0x89')][_0x0933('0x34')]({'read':!![],'readAt':_0xf0d347['body']['statuses'][0x0]['timestamp']},{'where':{'messageId':_0xf0d347[_0x0933('0x57')][_0x0933('0x86')][0x0]['message_id']},'individualHooks':!![]})[_0x0933('0x35')](function(_0x58f09e){return _0x413384[_0x0933('0x2a')](0xc8)[_0x0933('0x32')](_0x58f09e);});}_0x41c086[_0x0933('0x8a')]=_['orderBy'](_0x119073[_0x0933('0x83')],[_0x0933('0x7d')],[_0x0933('0x8b')]);if(_0x41c086[_0x0933('0x84')][_0x0933('0x83')]){delete _0x41c086[_0x0933('0x84')][_0x0933('0x83')];}return db[_0x0933('0x8c')][_0x0933('0x5f')]()[_0x0933('0x35')](function(_0x23197d){if(!_0x23197d){throw new db[(_0x0933('0x8d'))]['ValidationError'](_0x0933('0x8e'));}_0x3a1eeb=_['difference'](_[_0x0933('0x54')](_0x23197d),[_0x0933('0x8f'),_0x0933('0x90')]);_0x27a0a5=_[_0x0933('0x91')](_[_0x0933('0x54')](_0x23197d),[_0x0933('0x8f'),'updatedAt','CompanyId',_0x0933('0x92')]);_0x41c086[_0x0933('0x57')]={'mapKey':_0x0933('0x93')};if(_0x41c086[_0x0933('0x84')]&&_0x41c086[_0x0933('0x84')][_0x0933('0x40')]===_0x0933('0x94')){_0x41c086[_0x0933('0x57')][_0x0933('0x95')]=_0xf0d347[_0x0933('0x57')][_0x0933('0x96')]['replace'](_0x0933('0x97'),'');_0x41c086[_0x0933('0x57')][_0x0933('0x57')]=_0xf0d347[_0x0933('0x57')][_0x0933('0x98')];_0x41c086['body'][_0x0933('0x99')]=_0xf0d347[_0x0933('0x57')][_0x0933('0x9a')];}if(_0x41c086['account']&&_0x41c086[_0x0933('0x84')][_0x0933('0x40')]===_0x0933('0x85')){_0x41c086[_0x0933('0x57')][_0x0933('0x95')]=_0xf0d347[_0x0933('0x57')][_0x0933('0x9b')][0x0]['from'];_0x41c086[_0x0933('0x57')][_0x0933('0x57')]=_0xf0d347['body'][_0x0933('0x9b')][0x0][_0x0933('0x26')][_0x0933('0x57')];_0x41c086['body'][_0x0933('0x99')]=_0xf0d347[_0x0933('0x57')][_0x0933('0x9b')][0x0][_0x0933('0x9c')];}if(_0x41c086['body']['id']){delete _0x41c086[_0x0933('0x57')]['id'];}if(_['isNil'](_0x41c086[_0x0933('0x57')]['from'])){throw new db[(_0x0933('0x8d'))][(_0x0933('0x9d'))]('from\x20is\x20mandatory');}if(_[_0x0933('0x9e')](_0x41c086['body'][_0x0933('0x57')])||_0x41c086[_0x0933('0x57')][_0x0933('0x57')]===''){throw new db[(_0x0933('0x8d'))]['ValidationError'](_0x0933('0x9f'));}if(_[_0x0933('0x9e')](_0x41c086[_0x0933('0x57')]['mapKey'])){throw new db[(_0x0933('0x8d'))]['ValidationError'](_0x0933('0xa0')+_0x27a0a5);}if(!_['includes'](_0x27a0a5,_0x41c086[_0x0933('0x57')][_0x0933('0xa1')])){throw new db[(_0x0933('0x8d'))][(_0x0933('0x9d'))](_0x0933('0xa2')+_0x27a0a5);}_0x5d1a86[_0x41c086['body'][_0x0933('0xa1')]]=_0x41c086[_0x0933('0x57')][_0x0933('0x95')];return db[_0x0933('0xa3')]['find']({'where':{'id':_0x41c086['account'][_0x0933('0x92')]},'include':[{'model':db[_0x0933('0x8c')],'as':_0x0933('0xa4'),'where':_0x5d1a86,'limit':0x1,'order':[['updatedAt',_0x0933('0xa5')]]}]});})['then'](handleEntityNotFound(_0x413384,null))['then'](function(_0x3b5f72){if(_0x3b5f72){_0x41c086[_0x0933('0xa6')]=_[_0x0933('0x6f')](_0x3b5f72,[_0x0933('0xa4')]);if(_0x3b5f72[_0x0933('0xa4')][_0x0933('0x48')]){return _0x3b5f72[_0x0933('0xa4')][0x0];}var _0x248585=_[_0x0933('0x17')](_0x41c086[_0x0933('0x57')],{'firstName':_0x41c086[_0x0933('0x57')][_0x0933('0x95')],'ListId':_0x3b5f72['id']});_0x248585[_0x41c086[_0x0933('0x57')]['mapKey']]=_0x41c086[_0x0933('0x57')][_0x0933('0x95')];return db[_0x0933('0x8c')][_0x0933('0x56')](_0x248585,{'fields':_0x3a1eeb,'raw':!![]});}})[_0x0933('0x35')](handleEntityNotFound(_0x413384,null))[_0x0933('0x35')](function(_0x207730){if(_0x207730){_0x41c086['contact']=_0x207730;var _0x2145b8={'ContactId':_0x207730['id'],'phone':_0x41c086[_0x0933('0x57')][_0x0933('0x95')],'WhatsappAccountId':_0xf0d347[_0x0933('0x53')]['id']};var _0x9b3ad2={'ContactId':_0x207730['id'],'WhatsappAccountId':_0xf0d347['params']['id'],'closed':![]};return db['WhatsappInteraction'][_0x0933('0x55')]({'where':_0x9b3ad2})[_0x0933('0x35')](function(_0x4ac954){if(_0x4ac954){return[_0x4ac954,![]];}return db[_0x0933('0xa7')][_0x0933('0x56')](_0x2145b8)[_0x0933('0x35')](function(_0x440750){return[_0x440750,!![]];});});}})[_0x0933('0x70')](function(_0xb7710,_0x4ec241){_0x41c086[_0x0933('0xa8')]=_0xb7710[_0x0933('0x36')]({'plain':!![]});_0x41c086['interaction'][_0x0933('0xa9')]=![];if(_0x4ec241){if(_0x41c086['account']['autoclose']){_0x41c086['applications'][_0x0933('0xaa')]({'id':0x0,'priority':_0x41c086[_0x0933('0x8a')]['length']+0x1,'app':_0x0933('0xab'),'appdata':_0x0933('0xac'),'interval':_0x0933('0xad')});}_0x41c086[_0x0933('0xa8')][_0x0933('0xa9')]=!![];}return db['WhatsappMessage'][_0x0933('0x56')]({'phone':_0x41c086[_0x0933('0x57')][_0x0933('0x95')],'messageId':_0x41c086[_0x0933('0x57')][_0x0933('0x99')],'body':_0x41c086[_0x0933('0x57')]['body'],'WhatsappAccountId':_0xf0d347['params']['id'],'WhatsappInteractionId':_0xb7710['id'],'direction':'in','ContactId':_0xb7710[_0x0933('0xae')],'AttachmentId':_0x41c086[_0x0933('0x57')][_0x0933('0xaf')]});})[_0x0933('0x35')](function(_0x54814c){_0x41c086[_0x0933('0x26')]=_0x54814c;if(!_0x41c086[_0x0933('0xa8')]['UserId'])return;return db[_0x0933('0x77')][_0x0933('0x55')]({'attributes':['id',_0x0933('0x39')],'where':{'id':_0x41c086[_0x0933('0xa8')][_0x0933('0xb0')]}});})[_0x0933('0x35')](function(_0x31394a){if(_0x31394a){_0x41c086[_0x0933('0x8a')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0933('0xb1'),'appdata':_0x31394a[_0x0933('0x39')]+','+(_0x41c086[_0x0933('0x84')][_0x0933('0xb2')]||0xa),'interval':_0x0933('0xad')});}if(!_0x41c086[_0x0933('0xa8')][_0x0933('0xb3')])return;return db[_0x0933('0xb4')][_0x0933('0x55')]({'attributes':['id','name'],'where':{'id':_0x41c086[_0x0933('0xa8')]['queueId']}});})[_0x0933('0x35')](function(_0x153ed3){if(_0x153ed3){_0x41c086[_0x0933('0x8a')][_0x0933('0xb5')]({'id':0x0,'priority':0x1,'app':_0x0933('0xb6'),'appdata':_0x153ed3[_0x0933('0x39')]+','+(_0x41c086[_0x0933('0x84')][_0x0933('0xb7')]||0x12c),'interval':_0x0933('0xad')});}return respondWithRpcPromise(_0x0933('0xb8'),'startRouting',_0x41c086);})['then'](function(_0xf55654){if(_0xf55654){var _0x574f6c=0xc8;var _0x26c8f9='receiveMessage';logger[_0x0933('0x1f')](_0x0933('0xb9'),_0x26c8f9,_0x574f6c,_0x0933('0xba'));logger[_0x0933('0x22')](_0x0933('0xbb'),_0x26c8f9,_0x574f6c,_0x0933('0xba'),JSON[_0x0933('0x23')](_0xf55654));if(_0x41c086[_0x0933('0x84')][_0x0933('0x40')]===_0x0933('0x94')){return _0x413384[_0x0933('0x2a')](_0x574f6c)[_0x0933('0x30')](_0x0933('0xbc'),_0x0933('0xbd'))[_0x0933('0x3a')](_0x0933('0xbe'));}else{return _0x413384[_0x0933('0x2a')](_0x574f6c)['json'](_0xf55654);}}});})['catch'](handleError(_0x413384,null));};exports['send']=function(_0x19026c,_0x163b56,_0x5a67ab){var _0x5d94d3,_0xf776cd,_0x5260ea;if(_['isNil'](_0x19026c[_0x0933('0x57')][_0x0933('0x57')])||_0x19026c[_0x0933('0x57')][_0x0933('0x57')]===''){throw new db['Sequelize'][(_0x0933('0x9d'))](_0x0933('0x9f'));}if(_[_0x0933('0x9e')](_0x19026c[_0x0933('0x57')]['to'])){throw new db['Sequelize'][(_0x0933('0x9d'))](_0x0933('0xbf'));}_0x5d94d3=_0x19026c[_0x0933('0x57')]['to'];return db['WhatsappAccount'][_0x0933('0x55')]({'where':{'id':_0x19026c['params']['id']},'include':[{'model':db[_0x0933('0xa3')],'as':_0x0933('0xc0'),'include':[{'model':db[_0x0933('0x8c')],'as':_0x0933('0xa4'),'where':{'mobile':_0x5d94d3},'limit':0x1,'order':[[_0x0933('0x90'),'DESC']]}]}]})[_0x0933('0x35')](handleEntityNotFound(_0x163b56,null))['then'](function(_0xd0bf11){if(_0xd0bf11&&_0xd0bf11[_0x0933('0xc0')]){_0xf776cd=_0xd0bf11[_0x0933('0x36')]({'plain':!![]});if(_0xf776cd['List']&&_0xf776cd[_0x0933('0xc0')][_0x0933('0xa4')][_0x0933('0x48')]){return _0xf776cd[_0x0933('0xc0')][_0x0933('0xa4')][0x0];}return db[_0x0933('0x8c')][_0x0933('0x56')](_[_0x0933('0x17')](_0x19026c[_0x0933('0x57')],{'firstName':_0x5d94d3,'mobile':_0x5d94d3,'phone':_0x5d94d3,'ListId':_0xf776cd[_0x0933('0x92')]}));}})['then'](handleEntityNotFound(_0x163b56,null))[_0x0933('0x35')](function(_0x2a66cc){if(_0x2a66cc){_0x5260ea=_0x2a66cc;return db[_0x0933('0xa7')]['find']({'where':{'ContactId':_0x5260ea['id'],'closed':![],'WhatsappAccountId':_0xf776cd['id']}})[_0x0933('0x35')](function(_0x3ae7d4){if(_0x3ae7d4){return[_0x3ae7d4,![]];}return db[_0x0933('0xa7')][_0x0933('0x56')]({'UserId':_0x19026c[_0x0933('0x58')]['id'],'ContactId':_0x5260ea['id'],'WhatsappAccountId':_0xf776cd['id'],'phone':_0x5d94d3,'firstMsgDirection':_0x0933('0xc1'),'Messages':[_[_0x0933('0x4d')](_0x19026c[_0x0933('0x57')],{'read':![],'body':_0x19026c[_0x0933('0x57')][_0x0933('0x57')],'phone':_0x5d94d3,'WhatsappAccountId':_0xf776cd['id'],'UserId':_0x19026c['user']['id'],'ContactId':_0x5260ea['id']})]},{'include':[{'model':db[_0x0933('0x89')],'as':_0x0933('0xc2')}]})['then'](function(_0x506e93){return[_0x506e93,!![]];});});}})[_0x0933('0x70')](function(_0x386f9c,_0x4729a4){if(_0x4729a4){return _0x386f9c;}return db[_0x0933('0x89')]['create'](_[_0x0933('0x4d')](_0x19026c[_0x0933('0x57')],{'read':![],'body':_0x19026c[_0x0933('0x57')][_0x0933('0x57')],'phone':_0x5d94d3,'WhatsappAccountId':_0xf776cd['id'],'WhatsappInteractionId':_0x386f9c['id'],'UserId':_0x19026c[_0x0933('0x58')]['id'],'ContactId':_0x5260ea['id']}))[_0x0933('0x35')](function(_0xe99dc1){_0x386f9c[_0x0933('0xc3')][_0x0933('0xc2')]=[];_0x386f9c[_0x0933('0xc3')][_0x0933('0xc2')][_0x0933('0xaa')](_0xe99dc1[_0x0933('0xc3')]);return _0x386f9c;});})[_0x0933('0x35')](respondWithResult(_0x163b56,null))[_0x0933('0x28')](handleError(_0x163b56,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 1781130..626d030 100644 --- a/server/api/whatsappAccount/whatsappAccount.events.js +++ b/server/api/whatsappAccount/whatsappAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbeda=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount'];(function(_0x38d6e8,_0x21c3b9){var _0x37e27f=function(_0x2e9a3e){while(--_0x2e9a3e){_0x38d6e8['push'](_0x38d6e8['shift']());}};_0x37e27f(++_0x21c3b9);}(_0xbeda,0xe7));var _0xabed=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0xbeda[_0x240261];return _0x45c332;};'use strict';var EventEmitter=require(_0xabed('0x0'));var WhatsappAccount=require(_0xabed('0x1'))['db'][_0xabed('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xabed('0x3')](0x0);var events={'afterCreate':_0xabed('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x17074c){return function(_0x46fab2,_0x5e92e7,_0x31084a){WhatsappAccountEvents[_0xabed('0x5')](_0x17074c+':'+_0x46fab2['id'],_0x46fab2);WhatsappAccountEvents[_0xabed('0x5')](_0x17074c,_0x46fab2);_0x31084a(null);};}for(var e in events){if(events[_0xabed('0x6')](e)){var event=events[e];WhatsappAccount[_0xabed('0x7')](e,emitEvent(event));}}module[_0xabed('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0xd821=['events','../../mysqldb','WhatsappAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x195654,_0x1252db){var _0x5b0eba=function(_0x7422c5){while(--_0x7422c5){_0x195654['push'](_0x195654['shift']());}};_0x5b0eba(++_0x1252db);}(_0xd821,0x168));var _0x1d82=function(_0xd7f9f3,_0x11b2c9){_0xd7f9f3=_0xd7f9f3-0x0;var _0x254d5b=_0xd821[_0xd7f9f3];return _0x254d5b;};'use strict';var EventEmitter=require(_0x1d82('0x0'));var WhatsappAccount=require(_0x1d82('0x1'))['db'][_0x1d82('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1d82('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1d82('0x4'),'afterDestroy':_0x1d82('0x5')};function emitEvent(_0x4c1de6){return function(_0x21f87a,_0x388fe3,_0x2228db){WhatsappAccountEvents[_0x1d82('0x6')](_0x4c1de6+':'+_0x21f87a['id'],_0x21f87a);WhatsappAccountEvents[_0x1d82('0x6')](_0x4c1de6,_0x21f87a);_0x2228db(null);};}for(var e in events){if(events[_0x1d82('0x7')](e)){var event=events[e];WhatsappAccount[_0x1d82('0x8')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 1fe500e..44b3c55 100644 --- a/server/api/whatsappAccount/whatsappAccount.model.js +++ b/server/api/whatsappAccount/whatsappAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x925d=['../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','lodash','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x58bd92,_0x47740c){var _0x31fd24=function(_0x396aaa){while(--_0x396aaa){_0x58bd92['push'](_0x58bd92['shift']());}};_0x31fd24(++_0x47740c);}(_0x925d,0x73));var _0xd925=function(_0x5dabce,_0x2c124d){_0x5dabce=_0x5dabce-0x0;var _0x64fbb6=_0x925d[_0x5dabce];return _0x64fbb6;};'use strict';var _=require(_0xd925('0x0'));var util=require('util');var logger=require(_0xd925('0x1'))(_0xd925('0x2'));var moment=require(_0xd925('0x3'));var BPromise=require('bluebird');var rp=require(_0xd925('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd925('0x5'));var config=require(_0xd925('0x6'));var attributes=require(_0xd925('0x7'));module[_0xd925('0x8')]=function(_0x4802c6,_0x5ae9c1){return _0x4802c6[_0xd925('0x9')](_0xd925('0xa'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63f1=['WhatsappAccount','whatsapp_accounts','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define'];(function(_0x1ddb9b,_0x3b4467){var _0x3c4ad4=function(_0xedb5a2){while(--_0xedb5a2){_0x1ddb9b['push'](_0x1ddb9b['shift']());}};_0x3c4ad4(++_0x3b4467);}(_0x63f1,0xf9));var _0x163f=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x63f1[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x163f('0x0'));var util=require(_0x163f('0x1'));var logger=require('../../config/logger')(_0x163f('0x2'));var moment=require(_0x163f('0x3'));var BPromise=require(_0x163f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x163f('0x5'));var rimraf=require(_0x163f('0x6'));var config=require(_0x163f('0x7'));var attributes=require(_0x163f('0x8'));module[_0x163f('0x9')]=function(_0x111a4d,_0xba2299){return _0x111a4d[_0x163f('0xa')](_0x163f('0xb'),attributes,{'tableName':_0x163f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 81d1607..6c38458 100644 --- a/server/api/whatsappAccount/whatsappAccount.rpc.js +++ b/server/api/whatsappAccount/whatsappAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeac6=['defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','info','request\x20sent','stringify','error','code','message','WhatsappAccount,\x20%s,\x20%s','catch','WhatsappAccount','options','raw','where','attributes','include','map','model','then','ShowWhatsappAccount','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x28a2be,_0x5f6b50){var _0x3925f2=function(_0x32fc03){while(--_0x32fc03){_0x28a2be['push'](_0x28a2be['shift']());}};_0x3925f2(++_0x5f6b50);}(_0xeac6,0x7f));var _0x6eac=function(_0x2b72a6,_0x16620d){_0x2b72a6=_0x2b72a6-0x0;var _0x26e7f3=_0xeac6[_0x2b72a6];return _0x26e7f3;};'use strict';var _=require('lodash');var util=require(_0x6eac('0x0'));var moment=require(_0x6eac('0x1'));var BPromise=require('bluebird');var rs=require(_0x6eac('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6eac('0x3'))['db'];var utils=require(_0x6eac('0x4'));var logger=require(_0x6eac('0x5'))(_0x6eac('0x6'));var config=require(_0x6eac('0x7'));var jayson=require(_0x6eac('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x6eac('0x9')](config[_0x6eac('0xa')],{'host':_0x6eac('0xb'),'port':0x18eb});var socket=require(_0x6eac('0xc'))(new Redis(config[_0x6eac('0xa')]));require(_0x6eac('0xd'))[_0x6eac('0xe')](socket);function respondWithRpcPromise(_0x198c05,_0x3c857f,_0x508e6c){return new BPromise(function(_0x4bf461,_0x96c574){return client[_0x6eac('0xf')](_0x198c05,_0x508e6c)['then'](function(_0x2a0ce0){logger[_0x6eac('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x3c857f,'request\x20sent');logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3c857f,_0x6eac('0x11'),JSON[_0x6eac('0x12')](_0x2a0ce0));if(_0x2a0ce0[_0x6eac('0x13')]){if(_0x2a0ce0['error'][_0x6eac('0x14')]===0x1f4){logger[_0x6eac('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x3c857f,_0x2a0ce0['error']['message']);return _0x96c574(_0x2a0ce0[_0x6eac('0x13')][_0x6eac('0x15')]);}logger['error'](_0x6eac('0x16'),_0x3c857f,_0x2a0ce0[_0x6eac('0x13')]['message']);return _0x4bf461(_0x2a0ce0[_0x6eac('0x13')][_0x6eac('0x15')]);}else{logger[_0x6eac('0x10')](_0x6eac('0x16'),_0x3c857f,_0x6eac('0x11'));_0x4bf461(_0x2a0ce0['result'][_0x6eac('0x15')]);}})[_0x6eac('0x17')](function(_0x3d3ad6){logger[_0x6eac('0x13')](_0x6eac('0x16'),_0x3c857f,_0x3d3ad6);_0x96c574(_0x3d3ad6);});});}exports['ShowWhatsappAccount']=function(_0x13672e){var _0x30f4a7=this;return new Promise(function(_0x1163ee,_0x1d75d2){return db[_0x6eac('0x18')]['find']({'raw':_0x13672e[_0x6eac('0x19')]?_0x13672e[_0x6eac('0x19')][_0x6eac('0x1a')]===undefined?!![]:![]:!![],'where':_0x13672e['options']?_0x13672e[_0x6eac('0x19')][_0x6eac('0x1b')]||null:null,'attributes':_0x13672e[_0x6eac('0x19')]?_0x13672e[_0x6eac('0x19')][_0x6eac('0x1c')]||null:null,'include':_0x13672e[_0x6eac('0x19')]?_0x13672e['options'][_0x6eac('0x1d')]?_[_0x6eac('0x1e')](_0x13672e[_0x6eac('0x19')][_0x6eac('0x1d')],function(_0x243233){return{'model':db[_0x243233[_0x6eac('0x1f')]],'as':_0x243233['as'],'attributes':_0x243233['attributes'],'include':_0x243233[_0x6eac('0x1d')]?_[_0x6eac('0x1e')](_0x243233[_0x6eac('0x1d')],function(_0x1849b2){return{'model':db[_0x1849b2['model']],'as':_0x1849b2['as'],'attributes':_0x1849b2[_0x6eac('0x1c')],'include':_0x1849b2[_0x6eac('0x1d')]?_[_0x6eac('0x1e')](_0x1849b2[_0x6eac('0x1d')],function(_0x18c390){return{'model':db[_0x18c390['model']],'as':_0x18c390['as'],'attributes':_0x18c390[_0x6eac('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6eac('0x20')](function(_0x4f5c06){logger[_0x6eac('0x10')]('ShowWhatsappAccount',_0x13672e);logger['debug'](_0x6eac('0x21'),_0x13672e,JSON[_0x6eac('0x12')](_0x4f5c06));_0x1163ee(_0x4f5c06);})[_0x6eac('0x17')](function(_0x2e6cc1){logger[_0x6eac('0x13')](_0x6eac('0x21'),_0x2e6cc1[_0x6eac('0x15')],_0x13672e);_0x1d75d2(_0x30f4a7[_0x6eac('0x13')](0x1f4,_0x2e6cc1['message']));});});}; \ No newline at end of file +var _0x4ab3=['debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ShowWhatsappAccount','raw','options','where','include','model','attributes','map','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x4ab3,0x164));var _0x34ab=function(_0x27dba4,_0x419253){_0x27dba4=_0x27dba4-0x0;var _0x35ec9d=_0x4ab3[_0x27dba4];return _0x35ec9d;};'use strict';var _=require('lodash');var util=require(_0x34ab('0x0'));var moment=require(_0x34ab('0x1'));var BPromise=require(_0x34ab('0x2'));var rs=require(_0x34ab('0x3'));var fs=require('fs');var Redis=require(_0x34ab('0x4'));var db=require(_0x34ab('0x5'))['db'];var utils=require(_0x34ab('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x34ab('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x34ab('0x8')]=_[_0x34ab('0x9')](config['redis'],{'host':_0x34ab('0xa'),'port':0x18eb});var socket=require(_0x34ab('0xb'))(new Redis(config[_0x34ab('0x8')]));require(_0x34ab('0xc'))[_0x34ab('0xd')](socket);function respondWithRpcPromise(_0x188998,_0x3498db,_0x44a117){return new BPromise(function(_0x87d1ad,_0x104e92){return client[_0x34ab('0xe')](_0x188998,_0x44a117)[_0x34ab('0xf')](function(_0x4fabb2){logger['info'](_0x34ab('0x10'),_0x3498db,_0x34ab('0x11'));logger[_0x34ab('0x12')](_0x34ab('0x13'),_0x3498db,_0x34ab('0x11'),JSON[_0x34ab('0x14')](_0x4fabb2));if(_0x4fabb2[_0x34ab('0x15')]){if(_0x4fabb2[_0x34ab('0x15')][_0x34ab('0x16')]===0x1f4){logger[_0x34ab('0x15')](_0x34ab('0x10'),_0x3498db,_0x4fabb2[_0x34ab('0x15')][_0x34ab('0x17')]);return _0x104e92(_0x4fabb2['error'][_0x34ab('0x17')]);}logger['error'](_0x34ab('0x10'),_0x3498db,_0x4fabb2[_0x34ab('0x15')][_0x34ab('0x17')]);return _0x87d1ad(_0x4fabb2[_0x34ab('0x15')][_0x34ab('0x17')]);}else{logger[_0x34ab('0x18')](_0x34ab('0x10'),_0x3498db,_0x34ab('0x11'));_0x87d1ad(_0x4fabb2['result'][_0x34ab('0x17')]);}})[_0x34ab('0x19')](function(_0x431dc6){logger[_0x34ab('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x3498db,_0x431dc6);_0x104e92(_0x431dc6);});});}exports[_0x34ab('0x1a')]=function(_0x35222e){var _0x5a986d=this;return new Promise(function(_0x1278b0,_0x18ce85){return db['WhatsappAccount']['find']({'raw':_0x35222e['options']?_0x35222e['options'][_0x34ab('0x1b')]===undefined?!![]:![]:!![],'where':_0x35222e[_0x34ab('0x1c')]?_0x35222e['options'][_0x34ab('0x1d')]||null:null,'attributes':_0x35222e[_0x34ab('0x1c')]?_0x35222e[_0x34ab('0x1c')]['attributes']||null:null,'include':_0x35222e['options']?_0x35222e[_0x34ab('0x1c')][_0x34ab('0x1e')]?_['map'](_0x35222e[_0x34ab('0x1c')][_0x34ab('0x1e')],function(_0x2b0206){return{'model':db[_0x2b0206[_0x34ab('0x1f')]],'as':_0x2b0206['as'],'attributes':_0x2b0206[_0x34ab('0x20')],'include':_0x2b0206['include']?_[_0x34ab('0x21')](_0x2b0206[_0x34ab('0x1e')],function(_0x4a8ea3){return{'model':db[_0x4a8ea3['model']],'as':_0x4a8ea3['as'],'attributes':_0x4a8ea3['attributes'],'include':_0x4a8ea3[_0x34ab('0x1e')]?_[_0x34ab('0x21')](_0x4a8ea3[_0x34ab('0x1e')],function(_0x376923){return{'model':db[_0x376923[_0x34ab('0x1f')]],'as':_0x376923['as'],'attributes':_0x376923[_0x34ab('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3041b5){logger['info']('ShowWhatsappAccount',_0x35222e);logger[_0x34ab('0x12')]('ShowWhatsappAccount',_0x35222e,JSON[_0x34ab('0x14')](_0x3041b5));_0x1278b0(_0x3041b5);})[_0x34ab('0x19')](function(_0x2bf1e0){logger[_0x34ab('0x15')](_0x34ab('0x1a'),_0x2bf1e0[_0x34ab('0x17')],_0x35222e);_0x18ce85(_0x5a986d[_0x34ab('0x15')](0x1f4,_0x2bf1e0[_0x34ab('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 2cccb3e..3440860 100644 --- a/server/api/whatsappAccount/whatsappAccount.socket.js +++ b/server/api/whatsappAccount/whatsappAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ed3=['save','remove','update','register','whatsappAccount:','./whatsappAccount.events'];(function(_0x3825a8,_0x2ce1a2){var _0xabc9bc=function(_0x101073){while(--_0x101073){_0x3825a8['push'](_0x3825a8['shift']());}};_0xabc9bc(++_0x2ce1a2);}(_0x0ed3,0x1e5));var _0x30ed=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0ed3[_0x14add3];return _0x4a174f;};'use strict';var WhatsappAccountEvents=require(_0x30ed('0x0'));var events=[_0x30ed('0x1'),_0x30ed('0x2'),_0x30ed('0x3')];function createListener(_0x5c7009,_0x38d2d2){return function(_0x19854f){_0x38d2d2['emit'](_0x5c7009,_0x19854f);};}function removeListener(_0x40d059,_0x4a1ac1){return function(){WhatsappAccountEvents['removeListener'](_0x40d059,_0x4a1ac1);};}exports[_0x30ed('0x4')]=function(_0x33dcff){for(var _0x2185e1=0x0,_0x312cac=events['length'];_0x2185e1<_0x312cac;_0x2185e1++){var _0x2cbb58=events[_0x2185e1];var _0x5648bd=createListener(_0x30ed('0x5')+_0x2cbb58,_0x33dcff);WhatsappAccountEvents['on'](_0x2cbb58,_0x5648bd);}}; \ No newline at end of file +var _0x6537=['./whatsappAccount.events','remove','register','length','whatsappAccount:'];(function(_0x3edb30,_0x24a66f){var _0x58fa12=function(_0x11a27a){while(--_0x11a27a){_0x3edb30['push'](_0x3edb30['shift']());}};_0x58fa12(++_0x24a66f);}(_0x6537,0xaa));var _0x7653=function(_0x1f1525,_0x270974){_0x1f1525=_0x1f1525-0x0;var _0x1a2171=_0x6537[_0x1f1525];return _0x1a2171;};'use strict';var WhatsappAccountEvents=require(_0x7653('0x0'));var events=['save',_0x7653('0x1'),'update'];function createListener(_0x3366ea,_0x45afc0){return function(_0x402e6e){_0x45afc0['emit'](_0x3366ea,_0x402e6e);};}function removeListener(_0xf372e4,_0x2f91b9){return function(){WhatsappAccountEvents['removeListener'](_0xf372e4,_0x2f91b9);};}exports[_0x7653('0x2')]=function(_0x1be1ab){for(var _0x1970fb=0x0,_0x41c7f2=events[_0x7653('0x3')];_0x1970fb<_0x41c7f2;_0x1970fb++){var _0x51f5c0=events[_0x1970fb];var _0xe2297f=createListener(_0x7653('0x4')+_0x51f5c0,_0x1be1ab);WhatsappAccountEvents['on'](_0x51f5c0,_0xe2297f);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 833b86a..c3594e9 100644 --- a/server/api/whatsappApplication/index.js +++ b/server/api/whatsappApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfe0=['show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated','index','/:id'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xcfe0,0x137));var _0x0cfe=function(_0xd0cfa4,_0x4c44af){_0xd0cfa4=_0xd0cfa4-0x0;var _0x1f7ce4=_0xcfe0[_0xd0cfa4];return _0x1f7ce4;};'use strict';var multer=require(_0x0cfe('0x0'));var util=require(_0x0cfe('0x1'));var path=require(_0x0cfe('0x2'));var timeout=require(_0x0cfe('0x3'));var express=require(_0x0cfe('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0cfe('0x5'));var interaction=require(_0x0cfe('0x6'));var config=require('../../config/environment');var controller=require(_0x0cfe('0x7'));router[_0x0cfe('0x8')]('/',auth[_0x0cfe('0x9')](),controller[_0x0cfe('0xa')]);router[_0x0cfe('0x8')](_0x0cfe('0xb'),auth[_0x0cfe('0x9')](),controller[_0x0cfe('0xc')]);router[_0x0cfe('0xd')]('/',auth[_0x0cfe('0x9')](),controller[_0x0cfe('0xe')]);router[_0x0cfe('0xf')](_0x0cfe('0xb'),auth[_0x0cfe('0x9')](),controller[_0x0cfe('0x10')]);router[_0x0cfe('0x11')](_0x0cfe('0xb'),auth[_0x0cfe('0x9')](),controller[_0x0cfe('0x12')]);module['exports']=router; \ No newline at end of file +var _0x5a87=['update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x17788d,_0x5802a2){var _0x36cc48=function(_0x19b053){while(--_0x19b053){_0x17788d['push'](_0x17788d['shift']());}};_0x36cc48(++_0x5802a2);}(_0x5a87,0x15a));var _0x75a8=function(_0x57eba4,_0x51131b){_0x57eba4=_0x57eba4-0x0;var _0xf50650=_0x5a87[_0x57eba4];return _0xf50650;};'use strict';var multer=require(_0x75a8('0x0'));var util=require(_0x75a8('0x1'));var path=require(_0x75a8('0x2'));var timeout=require('connect-timeout');var express=require(_0x75a8('0x3'));var router=express['Router']();var fs_extra=require(_0x75a8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x75a8('0x5'));var config=require(_0x75a8('0x6'));var controller=require('./whatsappApplication.controller');router[_0x75a8('0x7')]('/',auth[_0x75a8('0x8')](),controller[_0x75a8('0x9')]);router[_0x75a8('0x7')](_0x75a8('0xa'),auth[_0x75a8('0x8')](),controller[_0x75a8('0xb')]);router[_0x75a8('0xc')]('/',auth[_0x75a8('0x8')](),controller[_0x75a8('0xd')]);router[_0x75a8('0xe')](_0x75a8('0xa'),auth[_0x75a8('0x8')](),controller[_0x75a8('0xf')]);router[_0x75a8('0x10')](_0x75a8('0xa'),auth[_0x75a8('0x8')](),controller[_0x75a8('0x11')]);module[_0x75a8('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 6af4754..1b03c3b 100644 --- a/server/api/whatsappApplication/whatsappApplication.attributes.js +++ b/server/api/whatsappApplication/whatsappApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f87=['sequelize','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x274fad,_0x3f699e){var _0x47b085=function(_0x372998){while(--_0x372998){_0x274fad['push'](_0x274fad['shift']());}};_0x47b085(++_0x3f699e);}(_0x1f87,0x15e));var _0x71f8=function(_0xf44d98,_0x12a472){_0xf44d98=_0xf44d98-0x0;var _0x5ebb04=_0x1f87[_0xf44d98];return _0x5ebb04;};'use strict';var Sequelize=require(_0x71f8('0x0'));module['exports']={'priority':{'type':Sequelize[_0x71f8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x71f8('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x71f8('0x3')]()},'description':{'type':Sequelize[_0x71f8('0x2')]},'interval':{'type':Sequelize[_0x71f8('0x2')],'defaultValue':_0x71f8('0x4')}}; \ No newline at end of file +var _0x3620=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x11fd58,_0x21fd24){var _0x187e39=function(_0x52596a){while(--_0x52596a){_0x11fd58['push'](_0x11fd58['shift']());}};_0x187e39(++_0x21fd24);}(_0x3620,0xc4));var _0x0362=function(_0x14b439,_0x1353e6){_0x14b439=_0x14b439-0x0;var _0x509d83=_0x3620[_0x14b439];return _0x509d83;};'use strict';var Sequelize=require(_0x0362('0x0'));module[_0x0362('0x1')]={'priority':{'type':Sequelize[_0x0362('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0362('0x3')],'allowNull':![],'defaultValue':_0x0362('0x4')},'appdata':{'type':Sequelize[_0x0362('0x5')]()},'description':{'type':Sequelize[_0x0362('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x0362('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index f83cb86..8c22a41 100644 --- a/server/api/whatsappApplication/whatsappApplication.controller.js +++ b/server/api/whatsappApplication/whatsappApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6b0=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','keys','include','find','create','body','params','eml-format','rimraf','request-promise','moment','bluebird','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','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','index','map','WhatsappApplication','key','model','query','filters','intersection','fields'];(function(_0x26fc0d,_0xa9ae57){var _0x3639ff=function(_0x370ce0){while(--_0x370ce0){_0x26fc0d['push'](_0x26fc0d['shift']());}};_0x3639ff(++_0xa9ae57);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x33f240,_0x42e306){_0x33f240=_0x33f240-0x0;var _0x51bc19=_0xa6b0[_0x33f240];return _0x51bc19;};'use strict';var emlformat=require(_0x0a6b('0x0'));var rimraf=require(_0x0a6b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a6b('0x2'));var moment=require(_0x0a6b('0x3'));var BPromise=require(_0x0a6b('0x4'));var Mustache=require('mustache');var util=require(_0x0a6b('0x5'));var path=require(_0x0a6b('0x6'));var sox=require(_0x0a6b('0x7'));var csv=require(_0x0a6b('0x8'));var ejs=require(_0x0a6b('0x9'));var fs=require('fs');var fs_extra=require(_0x0a6b('0xa'));var _=require(_0x0a6b('0xb'));var squel=require(_0x0a6b('0xc'));var crypto=require(_0x0a6b('0xd'));var jsforce=require(_0x0a6b('0xe'));var deskjs=require(_0x0a6b('0xf'));var toCsv=require(_0x0a6b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0a6b('0x10'));var authService=require(_0x0a6b('0x11'));var qs=require(_0x0a6b('0x12'));var as=require(_0x0a6b('0x13'));var hardwareService=require(_0x0a6b('0x14'));var logger=require(_0x0a6b('0x15'))(_0x0a6b('0x16'));var utils=require(_0x0a6b('0x17'));var config=require(_0x0a6b('0x18'));var licenseUtil=require(_0x0a6b('0x19'));var db=require(_0x0a6b('0x1a'))['db'];function respondWithStatusCode(_0x890493,_0x244a7d){_0x244a7d=_0x244a7d||0xcc;return function(_0x3cd9a4){if(_0x3cd9a4){return _0x890493['sendStatus'](_0x244a7d);}return _0x890493['status'](_0x244a7d)[_0x0a6b('0x1b')]();};}function respondWithResult(_0x2f27d6,_0x2abc4e){_0x2abc4e=_0x2abc4e||0xc8;return function(_0x177e87){if(_0x177e87){return _0x2f27d6[_0x0a6b('0x1c')](_0x2abc4e)[_0x0a6b('0x1d')](_0x177e87);}};}function respondWithFilteredResult(_0x9bb98e,_0x19e84c){return function(_0x1205a3){if(_0x1205a3){var _0x9d7aba=typeof _0x19e84c['offset']===_0x0a6b('0x1e')&&typeof _0x19e84c[_0x0a6b('0x1f')]==='undefined';var _0x290f7f=_0x1205a3['count'];var _0xcb412=_0x9d7aba?0x0:_0x19e84c[_0x0a6b('0x20')];var _0x2cb10b=_0x9d7aba?_0x1205a3[_0x0a6b('0x21')]:_0x19e84c['offset']+_0x19e84c[_0x0a6b('0x1f')];var _0x296162;if(_0x2cb10b>=_0x290f7f){_0x2cb10b=_0x290f7f;_0x296162=0xc8;}else{_0x296162=0xce;}_0x9bb98e['status'](_0x296162);return _0x9bb98e[_0x0a6b('0x22')](_0x0a6b('0x23'),_0xcb412+'-'+_0x2cb10b+'/'+_0x290f7f)[_0x0a6b('0x1d')](_0x1205a3);}return null;};}function patchUpdates(_0x491936){return function(_0x3ae3f4){try{jsonpatch[_0x0a6b('0x24')](_0x3ae3f4,_0x491936,!![]);}catch(_0x4077c6){return BPromise['reject'](_0x4077c6);}return _0x3ae3f4[_0x0a6b('0x25')]();};}function saveUpdates(_0x531e4c,_0xe4c2b9){return function(_0x5e8206){if(_0x5e8206){return _0x5e8206[_0x0a6b('0x26')](_0x531e4c)['then'](function(_0x1e5065){return _0x1e5065;});}return null;};}function removeEntity(_0xdda188,_0x3d153f){return function(_0x5c77fb){if(_0x5c77fb){return _0x5c77fb[_0x0a6b('0x27')]()[_0x0a6b('0x28')](function(){_0xdda188[_0x0a6b('0x1c')](0xcc)[_0x0a6b('0x1b')]();});}};}function handleEntityNotFound(_0x3b12a2,_0x5b2229){return function(_0x3e6a1d){if(!_0x3e6a1d){_0x3b12a2[_0x0a6b('0x29')](0x194);}return _0x3e6a1d;};}function handleError(_0x19a653,_0x4ce9d4){_0x4ce9d4=_0x4ce9d4||0x1f4;return function(_0x3a9092){logger['error'](_0x3a9092[_0x0a6b('0x2a')]);if(_0x3a9092[_0x0a6b('0x2b')]){delete _0x3a9092[_0x0a6b('0x2b')];}_0x19a653['status'](_0x4ce9d4)['send'](_0x3a9092);};}exports[_0x0a6b('0x2c')]=function(_0xe01bba,_0x1aecc7){var _0x3d649e={},_0x1935a3={},_0x2bbcb1={'count':0x0,'rows':[]};var _0x486f0d=_[_0x0a6b('0x2d')](db[_0x0a6b('0x2e')]['rawAttributes'],function(_0x4744d1){return{'name':_0x4744d1['fieldName'],'type':_0x4744d1['type'][_0x0a6b('0x2f')]};});_0x1935a3[_0x0a6b('0x30')]=_[_0x0a6b('0x2d')](_0x486f0d,_0x0a6b('0x2b'));_0x1935a3[_0x0a6b('0x31')]=_['keys'](_0xe01bba['query']);_0x1935a3[_0x0a6b('0x32')]=_[_0x0a6b('0x33')](_0x1935a3[_0x0a6b('0x30')],_0x1935a3[_0x0a6b('0x31')]);_0x3d649e['attributes']=_[_0x0a6b('0x33')](_0x1935a3[_0x0a6b('0x30')],qs['fields'](_0xe01bba['query'][_0x0a6b('0x34')]));_0x3d649e[_0x0a6b('0x35')]=_0x3d649e['attributes'][_0x0a6b('0x36')]?_0x3d649e[_0x0a6b('0x35')]:_0x1935a3[_0x0a6b('0x30')];if(!_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x37')](_0x0a6b('0x38'))){_0x3d649e[_0x0a6b('0x1f')]=qs[_0x0a6b('0x1f')](_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x1f')]);_0x3d649e[_0x0a6b('0x20')]=qs[_0x0a6b('0x20')](_0xe01bba['query'][_0x0a6b('0x20')]);}_0x3d649e[_0x0a6b('0x39')]=qs['sort'](_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x3a')]);_0x3d649e[_0x0a6b('0x3b')]=qs[_0x0a6b('0x32')](_[_0x0a6b('0x3c')](_0xe01bba[_0x0a6b('0x31')],_0x1935a3[_0x0a6b('0x32')]),_0x486f0d);if(_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x3d')]){_0x3d649e['where']=_[_0x0a6b('0x3e')](_0x3d649e[_0x0a6b('0x3b')],{'$or':_[_0x0a6b('0x2d')](_0x486f0d,function(_0x2f7e4b){if(_0x2f7e4b[_0x0a6b('0x3f')]!==_0x0a6b('0x40')){var _0x25254d={};_0x25254d[_0x2f7e4b[_0x0a6b('0x2b')]]={'$like':'%'+_0xe01bba[_0x0a6b('0x31')]['filter']+'%'};return _0x25254d;}})});}_0x3d649e=_[_0x0a6b('0x3e')]({},_0x3d649e,_0xe01bba[_0x0a6b('0x41')]);var _0x3aa7d5={'where':_0x3d649e[_0x0a6b('0x3b')]};return db[_0x0a6b('0x2e')][_0x0a6b('0x21')](_0x3aa7d5)[_0x0a6b('0x28')](function(_0x127e20){_0x2bbcb1[_0x0a6b('0x21')]=_0x127e20;if(_0xe01bba['query'][_0x0a6b('0x42')]){_0x3d649e['include']=[{'all':!![]}];}return db['WhatsappApplication'][_0x0a6b('0x43')](_0x3d649e);})['then'](function(_0x556a28){_0x2bbcb1[_0x0a6b('0x44')]=_0x556a28;return _0x2bbcb1;})[_0x0a6b('0x28')](respondWithFilteredResult(_0x1aecc7,_0x3d649e))[_0x0a6b('0x45')](handleError(_0x1aecc7,null));};exports['show']=function(_0x445a7b,_0x4d32bf){var _0x531f94={'raw':!![],'where':{'id':_0x445a7b['params']['id']}},_0x1114f1={};_0x1114f1[_0x0a6b('0x30')]=_['keys'](db[_0x0a6b('0x2e')]['rawAttributes']);_0x1114f1['query']=_[_0x0a6b('0x46')](_0x445a7b[_0x0a6b('0x31')]);_0x1114f1[_0x0a6b('0x32')]=_[_0x0a6b('0x33')](_0x1114f1['model'],_0x1114f1[_0x0a6b('0x31')]);_0x531f94[_0x0a6b('0x35')]=_[_0x0a6b('0x33')](_0x1114f1[_0x0a6b('0x30')],qs[_0x0a6b('0x34')](_0x445a7b[_0x0a6b('0x31')][_0x0a6b('0x34')]));_0x531f94['attributes']=_0x531f94[_0x0a6b('0x35')][_0x0a6b('0x36')]?_0x531f94[_0x0a6b('0x35')]:_0x1114f1[_0x0a6b('0x30')];if(_0x445a7b[_0x0a6b('0x31')][_0x0a6b('0x42')]){_0x531f94[_0x0a6b('0x47')]=[{'all':!![]}];}_0x531f94=_[_0x0a6b('0x3e')]({},_0x531f94,_0x445a7b[_0x0a6b('0x41')]);return db['WhatsappApplication'][_0x0a6b('0x48')](_0x531f94)[_0x0a6b('0x28')](handleEntityNotFound(_0x4d32bf,null))[_0x0a6b('0x28')](respondWithResult(_0x4d32bf,null))[_0x0a6b('0x45')](handleError(_0x4d32bf,null));};exports[_0x0a6b('0x49')]=function(_0x638ba8,_0x8f1372){return db['WhatsappApplication']['create'](_0x638ba8[_0x0a6b('0x4a')],{})[_0x0a6b('0x28')](respondWithResult(_0x8f1372,0xc9))[_0x0a6b('0x45')](handleError(_0x8f1372,null));};exports[_0x0a6b('0x26')]=function(_0x2ca82a,_0x446187){if(_0x2ca82a[_0x0a6b('0x4a')]['id']){delete _0x2ca82a[_0x0a6b('0x4a')]['id'];}return db[_0x0a6b('0x2e')]['find']({'where':{'id':_0x2ca82a[_0x0a6b('0x4b')]['id']}})[_0x0a6b('0x28')](handleEntityNotFound(_0x446187,null))[_0x0a6b('0x28')](saveUpdates(_0x2ca82a[_0x0a6b('0x4a')],null))[_0x0a6b('0x28')](respondWithResult(_0x446187,null))['catch'](handleError(_0x446187,null));};exports[_0x0a6b('0x27')]=function(_0x3fd0df,_0x3aa85f){return db[_0x0a6b('0x2e')][_0x0a6b('0x48')]({'where':{'id':_0x3fd0df[_0x0a6b('0x4b')]['id']}})[_0x0a6b('0x28')](handleEntityNotFound(_0x3aa85f,null))[_0x0a6b('0x28')](removeEntity(_0x3aa85f,null))[_0x0a6b('0x45')](handleError(_0x3aa85f,null));}; \ No newline at end of file +var _0xee55=['count','set','Content-Range','apply','reject','save','update','then','name','send','index','WhatsappApplication','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined'];(function(_0x102900,_0x23d97e){var _0x4f6543=function(_0x2c73c5){while(--_0x2c73c5){_0x102900['push'](_0x102900['shift']());}};_0x4f6543(++_0x23d97e);}(_0xee55,0x1a0));var _0x5ee5=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0xee55[_0x4409e7];return _0x24c751;};'use strict';var emlformat=require(_0x5ee5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5ee5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5ee5('0x2'));var moment=require('moment');var BPromise=require(_0x5ee5('0x3'));var Mustache=require(_0x5ee5('0x4'));var util=require('util');var path=require(_0x5ee5('0x5'));var sox=require(_0x5ee5('0x6'));var csv=require(_0x5ee5('0x7'));var ejs=require(_0x5ee5('0x8'));var fs=require('fs');var fs_extra=require(_0x5ee5('0x9'));var _=require(_0x5ee5('0xa'));var squel=require(_0x5ee5('0xb'));var crypto=require('crypto');var jsforce=require(_0x5ee5('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5ee5('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ee5('0xe'));var qs=require(_0x5ee5('0xf'));var as=require(_0x5ee5('0x10'));var hardwareService=require(_0x5ee5('0x11'));var logger=require('../../config/logger')(_0x5ee5('0x12'));var utils=require(_0x5ee5('0x13'));var config=require(_0x5ee5('0x14'));var licenseUtil=require(_0x5ee5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a9abc,_0x38437c){_0x38437c=_0x38437c||0xcc;return function(_0x349c46){if(_0x349c46){return _0x4a9abc[_0x5ee5('0x16')](_0x38437c);}return _0x4a9abc['status'](_0x38437c)[_0x5ee5('0x17')]();};}function respondWithResult(_0x2cbfab,_0x1a5da4){_0x1a5da4=_0x1a5da4||0xc8;return function(_0x1cd19c){if(_0x1cd19c){return _0x2cbfab[_0x5ee5('0x18')](_0x1a5da4)[_0x5ee5('0x19')](_0x1cd19c);}};}function respondWithFilteredResult(_0x2ef66a,_0x5dd990){return function(_0x2773ab){if(_0x2773ab){var _0x184e53=typeof _0x5dd990[_0x5ee5('0x1a')]===_0x5ee5('0x1b')&&typeof _0x5dd990['limit']==='undefined';var _0x3bb1b5=_0x2773ab[_0x5ee5('0x1c')];var _0x173043=_0x184e53?0x0:_0x5dd990['offset'];var _0x1eafc3=_0x184e53?_0x2773ab['count']:_0x5dd990[_0x5ee5('0x1a')]+_0x5dd990['limit'];var _0x2c859a;if(_0x1eafc3>=_0x3bb1b5){_0x1eafc3=_0x3bb1b5;_0x2c859a=0xc8;}else{_0x2c859a=0xce;}_0x2ef66a[_0x5ee5('0x18')](_0x2c859a);return _0x2ef66a[_0x5ee5('0x1d')](_0x5ee5('0x1e'),_0x173043+'-'+_0x1eafc3+'/'+_0x3bb1b5)[_0x5ee5('0x19')](_0x2773ab);}return null;};}function patchUpdates(_0x24ce1b){return function(_0x46416a){try{jsonpatch[_0x5ee5('0x1f')](_0x46416a,_0x24ce1b,!![]);}catch(_0x45e278){return BPromise[_0x5ee5('0x20')](_0x45e278);}return _0x46416a[_0x5ee5('0x21')]();};}function saveUpdates(_0x72a60d,_0x3a15e2){return function(_0xb133d4){if(_0xb133d4){return _0xb133d4[_0x5ee5('0x22')](_0x72a60d)[_0x5ee5('0x23')](function(_0x3aa2d5){return _0x3aa2d5;});}return null;};}function removeEntity(_0x1e0f65,_0x1c2004){return function(_0x218f79){if(_0x218f79){return _0x218f79['destroy']()['then'](function(){_0x1e0f65[_0x5ee5('0x18')](0xcc)[_0x5ee5('0x17')]();});}};}function handleEntityNotFound(_0x6a7dca,_0x59c422){return function(_0x1df98d){if(!_0x1df98d){_0x6a7dca['sendStatus'](0x194);}return _0x1df98d;};}function handleError(_0x474d24,_0xbcc308){_0xbcc308=_0xbcc308||0x1f4;return function(_0x252da3){logger['error'](_0x252da3['stack']);if(_0x252da3[_0x5ee5('0x24')]){delete _0x252da3[_0x5ee5('0x24')];}_0x474d24[_0x5ee5('0x18')](_0xbcc308)[_0x5ee5('0x25')](_0x252da3);};}exports[_0x5ee5('0x26')]=function(_0x14254a,_0x334295){var _0x483c28={},_0x3d78a8={},_0x1947ae={'count':0x0,'rows':[]};var _0x422e71=_['map'](db[_0x5ee5('0x27')][_0x5ee5('0x28')],function(_0x2542da){return{'name':_0x2542da[_0x5ee5('0x29')],'type':_0x2542da[_0x5ee5('0x2a')][_0x5ee5('0x2b')]};});_0x3d78a8[_0x5ee5('0x2c')]=_[_0x5ee5('0x2d')](_0x422e71,'name');_0x3d78a8[_0x5ee5('0x2e')]=_['keys'](_0x14254a[_0x5ee5('0x2e')]);_0x3d78a8['filters']=_[_0x5ee5('0x2f')](_0x3d78a8[_0x5ee5('0x2c')],_0x3d78a8['query']);_0x483c28['attributes']=_[_0x5ee5('0x2f')](_0x3d78a8[_0x5ee5('0x2c')],qs[_0x5ee5('0x30')](_0x14254a[_0x5ee5('0x2e')]['fields']));_0x483c28[_0x5ee5('0x31')]=_0x483c28['attributes'][_0x5ee5('0x32')]?_0x483c28['attributes']:_0x3d78a8[_0x5ee5('0x2c')];if(!_0x14254a['query'][_0x5ee5('0x33')](_0x5ee5('0x34'))){_0x483c28[_0x5ee5('0x35')]=qs[_0x5ee5('0x35')](_0x14254a[_0x5ee5('0x2e')][_0x5ee5('0x35')]);_0x483c28[_0x5ee5('0x1a')]=qs['offset'](_0x14254a[_0x5ee5('0x2e')][_0x5ee5('0x1a')]);}_0x483c28[_0x5ee5('0x36')]=qs[_0x5ee5('0x37')](_0x14254a['query'][_0x5ee5('0x37')]);_0x483c28['where']=qs[_0x5ee5('0x38')](_[_0x5ee5('0x39')](_0x14254a['query'],_0x3d78a8[_0x5ee5('0x38')]),_0x422e71);if(_0x14254a['query'][_0x5ee5('0x3a')]){_0x483c28[_0x5ee5('0x3b')]=_[_0x5ee5('0x3c')](_0x483c28[_0x5ee5('0x3b')],{'$or':_[_0x5ee5('0x2d')](_0x422e71,function(_0xeab8e3){if(_0xeab8e3['type']!=='VIRTUAL'){var _0x11fad0={};_0x11fad0[_0xeab8e3['name']]={'$like':'%'+_0x14254a['query'][_0x5ee5('0x3a')]+'%'};return _0x11fad0;}})});}_0x483c28=_['merge']({},_0x483c28,_0x14254a[_0x5ee5('0x3d')]);var _0x36062b={'where':_0x483c28[_0x5ee5('0x3b')]};return db[_0x5ee5('0x27')]['count'](_0x36062b)['then'](function(_0xe5607e){_0x1947ae[_0x5ee5('0x1c')]=_0xe5607e;if(_0x14254a[_0x5ee5('0x2e')][_0x5ee5('0x3e')]){_0x483c28[_0x5ee5('0x3f')]=[{'all':!![]}];}return db[_0x5ee5('0x27')][_0x5ee5('0x40')](_0x483c28);})[_0x5ee5('0x23')](function(_0x1973e0){_0x1947ae[_0x5ee5('0x41')]=_0x1973e0;return _0x1947ae;})[_0x5ee5('0x23')](respondWithFilteredResult(_0x334295,_0x483c28))[_0x5ee5('0x42')](handleError(_0x334295,null));};exports[_0x5ee5('0x43')]=function(_0x5ed5f7,_0x21cbfb){var _0x199667={'raw':!![],'where':{'id':_0x5ed5f7[_0x5ee5('0x44')]['id']}},_0x5a5d3c={};_0x5a5d3c[_0x5ee5('0x2c')]=_['keys'](db['WhatsappApplication'][_0x5ee5('0x28')]);_0x5a5d3c[_0x5ee5('0x2e')]=_[_0x5ee5('0x45')](_0x5ed5f7[_0x5ee5('0x2e')]);_0x5a5d3c[_0x5ee5('0x38')]=_[_0x5ee5('0x2f')](_0x5a5d3c['model'],_0x5a5d3c[_0x5ee5('0x2e')]);_0x199667[_0x5ee5('0x31')]=_[_0x5ee5('0x2f')](_0x5a5d3c[_0x5ee5('0x2c')],qs[_0x5ee5('0x30')](_0x5ed5f7['query']['fields']));_0x199667[_0x5ee5('0x31')]=_0x199667['attributes'][_0x5ee5('0x32')]?_0x199667[_0x5ee5('0x31')]:_0x5a5d3c[_0x5ee5('0x2c')];if(_0x5ed5f7[_0x5ee5('0x2e')][_0x5ee5('0x3e')]){_0x199667[_0x5ee5('0x3f')]=[{'all':!![]}];}_0x199667=_[_0x5ee5('0x3c')]({},_0x199667,_0x5ed5f7[_0x5ee5('0x3d')]);return db['WhatsappApplication'][_0x5ee5('0x46')](_0x199667)[_0x5ee5('0x23')](handleEntityNotFound(_0x21cbfb,null))[_0x5ee5('0x23')](respondWithResult(_0x21cbfb,null))[_0x5ee5('0x42')](handleError(_0x21cbfb,null));};exports[_0x5ee5('0x47')]=function(_0x1373ba,_0x4b11d0){return db['WhatsappApplication']['create'](_0x1373ba[_0x5ee5('0x48')],{})[_0x5ee5('0x23')](respondWithResult(_0x4b11d0,0xc9))[_0x5ee5('0x42')](handleError(_0x4b11d0,null));};exports[_0x5ee5('0x22')]=function(_0x117086,_0x2b2c79){if(_0x117086['body']['id']){delete _0x117086[_0x5ee5('0x48')]['id'];}return db[_0x5ee5('0x27')]['find']({'where':{'id':_0x117086[_0x5ee5('0x44')]['id']}})[_0x5ee5('0x23')](handleEntityNotFound(_0x2b2c79,null))[_0x5ee5('0x23')](saveUpdates(_0x117086[_0x5ee5('0x48')],null))['then'](respondWithResult(_0x2b2c79,null))[_0x5ee5('0x42')](handleError(_0x2b2c79,null));};exports[_0x5ee5('0x49')]=function(_0x5586d3,_0x4ffd24){return db[_0x5ee5('0x27')][_0x5ee5('0x46')]({'where':{'id':_0x5586d3['params']['id']}})['then'](handleEntityNotFound(_0x4ffd24,null))[_0x5ee5('0x23')](removeEntity(_0x4ffd24,null))[_0x5ee5('0x42')](handleError(_0x4ffd24,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 4a50fdf..8691532 100644 --- a/server/api/whatsappApplication/whatsappApplication.model.js +++ b/server/api/whatsappApplication/whatsappApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1da1=['whatsapp_applications','utf8mb4','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports'];(function(_0x581b63,_0x3cd4ea){var _0x3e8862=function(_0x581016){while(--_0x581016){_0x581b63['push'](_0x581b63['shift']());}};_0x3e8862(++_0x3cd4ea);}(_0x1da1,0x1a4));var _0x11da=function(_0xd27327,_0x48b1c7){_0xd27327=_0xd27327-0x0;var _0x55a621=_0x1da1[_0xd27327];return _0x55a621;};'use strict';var _=require(_0x11da('0x0'));var util=require(_0x11da('0x1'));var logger=require(_0x11da('0x2'))(_0x11da('0x3'));var moment=require(_0x11da('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x11da('0x5'));var rimraf=require(_0x11da('0x6'));var config=require(_0x11da('0x7'));var attributes=require('./whatsappApplication.attributes');module[_0x11da('0x8')]=function(_0x209cbb,_0x15c324){return _0x209cbb['define']('WhatsappApplication',attributes,{'tableName':_0x11da('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x11da('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xeddd=['./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x17c3d7,_0x424d58){var _0x71f2dc=function(_0x47a8cd){while(--_0x47a8cd){_0x17c3d7['push'](_0x17c3d7['shift']());}};_0x71f2dc(++_0x424d58);}(_0xeddd,0x69));var _0xdedd=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xeddd[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0xdedd('0x0'));var util=require(_0xdedd('0x1'));var logger=require(_0xdedd('0x2'))(_0xdedd('0x3'));var moment=require('moment');var BPromise=require(_0xdedd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdedd('0x5'));var rimraf=require(_0xdedd('0x6'));var config=require('../../config/environment');var attributes=require(_0xdedd('0x7'));module[_0xdedd('0x8')]=function(_0x16801a,_0x3e6b5a){return _0x16801a[_0xdedd('0x9')](_0xdedd('0xa'),attributes,{'tableName':_0xdedd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdedd('0xc'),'collate':_0xdedd('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 8192100..79c8561 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ea3=['WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x4ea3,0x70));var _0x34ea=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x4ea3[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var moment=require(_0x34ea('0x2'));var BPromise=require(_0x34ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x34ea('0x6'));var jayson=require(_0x34ea('0x7'));var client=jayson[_0x34ea('0x8')][_0x34ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40434e,_0x18b461,_0x22b09e){return new BPromise(function(_0x5bec7c,_0x341727){return client[_0x34ea('0xa')](_0x40434e,_0x22b09e)[_0x34ea('0xb')](function(_0x5132c4){logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,'request\x20sent');logger['debug'](_0x34ea('0xe'),_0x18b461,_0x34ea('0xf'),JSON[_0x34ea('0x10')](_0x5132c4));if(_0x5132c4['error']){if(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x12')]===0x1f4){logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);return _0x341727(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')]['message']);return _0x5bec7c(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}else{logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,_0x34ea('0xf'));_0x5bec7c(_0x5132c4['result'][_0x34ea('0x13')]);}})[_0x34ea('0x14')](function(_0x3fa3b0){logger[_0x34ea('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x18b461,_0x3fa3b0);_0x341727(_0x3fa3b0);});});} \ No newline at end of file +var _0x5fd1=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x5b94df,_0x2ecad7){var _0x5645d6=function(_0x5c179d){while(--_0x5c179d){_0x5b94df['push'](_0x5b94df['shift']());}};_0x5645d6(++_0x2ecad7);}(_0x5fd1,0x155));var _0x15fd=function(_0x59c59b,_0x2ef8ac){_0x59c59b=_0x59c59b-0x0;var _0x5665ae=_0x5fd1[_0x59c59b];return _0x5665ae;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e88bf,_0x225728,_0x534e63){return new BPromise(function(_0x210e90,_0x1ee117){return client[_0x15fd('0xa')](_0x2e88bf,_0x534e63)['then'](function(_0x2d2fbb){logger['info'](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x225728,'request\x20sent',JSON[_0x15fd('0xd')](_0x2d2fbb));if(_0x2d2fbb[_0x15fd('0xe')]){if(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0xf')]===0x1f4){logger[_0x15fd('0xe')](_0x15fd('0xb'),_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x1ee117(_0x2d2fbb[_0x15fd('0xe')]['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x210e90(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);}else{logger[_0x15fd('0x11')](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));_0x210e90(_0x2d2fbb[_0x15fd('0x12')]['message']);}})['catch'](function(_0x25f139){logger['error'](_0x15fd('0xb'),_0x225728,_0x25f139);_0x1ee117(_0x25f139);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 7a70562..9837912 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['./whatsappInteraction.controller','get','isAuthenticated','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','whatsapp','put','/:id','tracked','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xd89b16,_0x3aa266){var _0x3baa36=function(_0x35fd0b){while(--_0x35fd0b){_0xd89b16['push'](_0xd89b16['shift']());}};_0x3baa36(++_0x3aa266);}(_0x326f,0xd1));var _0xf326=function(_0x194700,_0x310e6b){_0x194700=_0x194700-0x0;var _0x3097e1=_0x326f[_0x194700];return _0x3097e1;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0x9')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router['get'](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['post']('/',auth[_0xf326('0xa')](),controller['create']);router[_0xf326('0x12')](_0xf326('0xe'),auth['isAuthenticated'](),controller[_0xf326('0x13')]);router[_0xf326('0x12')](_0xf326('0x14'),auth[_0xf326('0xa')](),interaction['tracked'](_0xf326('0x15'),'whatsappinteraction:addtags'),controller['addTags']);router[_0xf326('0x16')](_0xf326('0x17'),auth[_0xf326('0xa')](),interaction[_0xf326('0x18')](_0xf326('0x15'),_0xf326('0x19')),controller[_0xf326('0x1a')]);router[_0xf326('0x1b')]('/:id',auth[_0xf326('0xa')](),interaction[_0xf326('0x18')](_0xf326('0x15'),_0xf326('0x1c')),controller[_0xf326('0x1d')]);router[_0xf326('0x1b')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0xf326('0x1e')]=router; \ No newline at end of file +var _0x326f=['./whatsappInteraction.controller','get','isAuthenticated','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','whatsapp','put','/:id','tracked','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1d64f9,_0x2bdb41){var _0x536355=function(_0x4f6f05){while(--_0x4f6f05){_0x1d64f9['push'](_0x1d64f9['shift']());}};_0x536355(++_0x2bdb41);}(_0x326f,0xd1));var _0xf326=function(_0x252d0b,_0x2634a0){_0x252d0b=_0x252d0b-0x0;var _0x3496bd=_0x326f[_0x252d0b];return _0x3496bd;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0x9')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router['get'](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['post']('/',auth[_0xf326('0xa')](),controller['create']);router[_0xf326('0x12')](_0xf326('0xe'),auth['isAuthenticated'](),controller[_0xf326('0x13')]);router[_0xf326('0x12')](_0xf326('0x14'),auth[_0xf326('0xa')](),interaction['tracked'](_0xf326('0x15'),'whatsappinteraction:addtags'),controller['addTags']);router[_0xf326('0x16')](_0xf326('0x17'),auth[_0xf326('0xa')](),interaction[_0xf326('0x18')](_0xf326('0x15'),_0xf326('0x19')),controller[_0xf326('0x1a')]);router[_0xf326('0x1b')]('/:id',auth[_0xf326('0xa')](),interaction[_0xf326('0x18')](_0xf326('0x15'),_0xf326('0x1c')),controller[_0xf326('0x1d')]);router[_0xf326('0x1b')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0xf326('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 7aadbf6..d33de98 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js +++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d5a=['BOOLEAN','STRING','DATE','ENUM','out','INTEGER','moment','exports'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x4d5a,0x15e));var _0xa4d5=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x4d5a[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa4d5('0x0'));module[_0xa4d5('0x1')]={'closed':{'type':Sequelize[_0xa4d5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xa4d5('0x3')]},'secondDisposition':{'type':Sequelize[_0xa4d5('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa4d5('0x3')]},'note':{'type':Sequelize[_0xa4d5('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xa4d5('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa4d5('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xa4d5('0x5')]('in',_0xa4d5('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa4d5('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xa4d5('0x7')]}}; \ No newline at end of file +var _0x078f=['ENUM','out','BOOLEAN','INTEGER','moment','exports','DATE','STRING'];(function(_0x189e54,_0x9630d8){var _0x27cd7b=function(_0x757fa){while(--_0x757fa){_0x189e54['push'](_0x189e54['shift']());}};_0x27cd7b(++_0x9630d8);}(_0x078f,0x1b4));var _0xf078=function(_0x2f1e25,_0x3e5590){_0x2f1e25=_0x2f1e25-0x0;var _0x227c8a=_0x078f[_0x2f1e25];return _0x227c8a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf078('0x0'));module[_0xf078('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf078('0x2')]},'disposition':{'type':Sequelize[_0xf078('0x3')]},'secondDisposition':{'type':Sequelize[_0xf078('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf078('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xf078('0x3')]},'read1stAt':{'type':Sequelize[_0xf078('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xf078('0x4')]('in',_0xf078('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf078('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xf078('0x4')]('in',_0xf078('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf078('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xf078('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 46c364a..fb6510f 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a2d=['../../components/export/pdf','../../config/logger','api','../../mysqldb','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','then','error','stack','send','index','map','WhatsappInteraction','getOptions','findAll','whatsapp','user','catch','show','params','model','keys','rawAttributes','query','intersection','attributes','fields','include','merge','options','find','create','body','describe','addMessage','ids','omit','getMessages','WhatsappMessage','length','sort','where','filters','pick','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','name','removeTags','download','unix','toString','join','root','server','files','attachments','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','firstName','Attachment','createdAt','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','closed','closedAt','disposition','existsSync','pipe','basename','direction','out','System','lastName','read','value','renderFile','views','.pdf','log','err','rimraf','zip-dir','moment','bluebird','util','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs'];(function(_0x37ac49,_0x31884b){var _0x3e4f24=function(_0x57cb17){while(--_0x57cb17){_0x37ac49['push'](_0x37ac49['shift']());}};_0x3e4f24(++_0x31884b);}(_0x0a2d,0x1cf));var _0xd0a2=function(_0x146100,_0x21f298){_0x146100=_0x146100-0x0;var _0x4ea820=_0x0a2d[_0x146100];return _0x4ea820;};'use strict';var rimraf=require(_0xd0a2('0x0'));var zipdir=require(_0xd0a2('0x1'));var moment=require(_0xd0a2('0x2'));var BPromise=require(_0xd0a2('0x3'));var util=require(_0xd0a2('0x4'));var path=require('path');var ejs=require(_0xd0a2('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xd0a2('0x6'));var interaction=require(_0xd0a2('0x7'));var qs=require(_0xd0a2('0x8'));var pdf=require(_0xd0a2('0x9'));var logger=require(_0xd0a2('0xa'))(_0xd0a2('0xb'));var config=require('../../config/environment');var db=require(_0xd0a2('0xc'))['db'];config['redis']=_[_0xd0a2('0xd')](config['redis'],{'host':_0xd0a2('0xe'),'port':0x18eb});var socket=require(_0xd0a2('0xf'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0xd0a2('0x10')](socket);function respondWithStatusCode(_0xf87d66,_0x2b720e){_0x2b720e=_0x2b720e||0xcc;return function(_0x4aee27){if(_0x4aee27){return _0xf87d66[_0xd0a2('0x11')](_0x2b720e);}return _0xf87d66[_0xd0a2('0x12')](_0x2b720e)[_0xd0a2('0x13')]();};}function respondWithResult(_0x52e44f,_0x5329f4){_0x5329f4=_0x5329f4||0xc8;return function(_0x2b0449){if(_0x2b0449){return _0x52e44f[_0xd0a2('0x12')](_0x5329f4)[_0xd0a2('0x14')](_0x2b0449);}};}function respondWithFilteredResult(_0x388107,_0x592b17){return function(_0x160051){if(_0x160051){var _0x3c2569=typeof _0x592b17['offset']===_0xd0a2('0x15')&&typeof _0x592b17[_0xd0a2('0x16')]===_0xd0a2('0x15');var _0x407b31=_0x160051[_0xd0a2('0x17')];var _0x5569d9=_0x3c2569?0x0:_0x592b17[_0xd0a2('0x18')];var _0x1b45bc=_0x3c2569?_0x160051[_0xd0a2('0x17')]:_0x592b17[_0xd0a2('0x18')]+_0x592b17[_0xd0a2('0x16')];var _0x4f3203;if(_0x1b45bc>=_0x407b31){_0x1b45bc=_0x407b31;_0x4f3203=0xc8;}else{_0x4f3203=0xce;}_0x388107['status'](_0x4f3203);return _0x388107['set'](_0xd0a2('0x19'),_0x5569d9+'-'+_0x1b45bc+'/'+_0x407b31)[_0xd0a2('0x14')](_0x160051);}return null;};}function saveUpdates(_0x47305c){return function(_0xb658f){if(_0xb658f){return _0xb658f[_0xd0a2('0x1a')](_0x47305c)[_0xd0a2('0x1b')](function(_0x22e418){return _0x22e418;});}return null;};}function removeEntity(_0x42b582){return function(_0x2a1c27){if(_0x2a1c27){return _0x2a1c27['destroy']()[_0xd0a2('0x1b')](function(){_0x42b582[_0xd0a2('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1719ab){return function(_0x410e8d){if(!_0x410e8d){_0x1719ab[_0xd0a2('0x11')](0x194);}return _0x410e8d;};}function handleError(_0x9059e9,_0x3e2b26){_0x3e2b26=_0x3e2b26||0x1f4;return function(_0x34ae7b){logger[_0xd0a2('0x1c')](_0x34ae7b[_0xd0a2('0x1d')]);if(_0x34ae7b['name']){delete _0x34ae7b['name'];}_0x9059e9[_0xd0a2('0x12')](_0x3e2b26)[_0xd0a2('0x1e')](_0x34ae7b);};}exports[_0xd0a2('0x1f')]=function(_0x202f73,_0x1350bc){var _0x5e7eef={};var _0x4990d=_[_0xd0a2('0x20')](db[_0xd0a2('0x21')]['rawAttributes'],function(_0xa826c9){return{'name':_0xa826c9['fieldName'],'type':_0xa826c9['type']['key']};});_0x5e7eef=qs[_0xd0a2('0x22')](_0x4990d,_0x202f73);return interaction[_0xd0a2('0x23')](_0xd0a2('0x24'),_0x202f73['query'],_0x202f73[_0xd0a2('0x25')],_0x5e7eef,_0x4990d)[_0xd0a2('0x1b')](respondWithFilteredResult(_0x1350bc,_0x5e7eef))[_0xd0a2('0x26')](handleError(_0x1350bc,null));};exports[_0xd0a2('0x27')]=function(_0x399071,_0xd646a5){var _0x368d9e={'raw':![],'where':{'id':_0x399071[_0xd0a2('0x28')]['id']}},_0x2e1a9c={};_0x2e1a9c[_0xd0a2('0x29')]=_[_0xd0a2('0x2a')](db[_0xd0a2('0x21')][_0xd0a2('0x2b')]);_0x2e1a9c[_0xd0a2('0x2c')]=_[_0xd0a2('0x2a')](_0x399071[_0xd0a2('0x2c')]);_0x2e1a9c['filters']=_[_0xd0a2('0x2d')](_0x2e1a9c[_0xd0a2('0x29')],_0x2e1a9c[_0xd0a2('0x2c')]);_0x368d9e[_0xd0a2('0x2e')]=_['intersection'](_0x2e1a9c['model'],qs[_0xd0a2('0x2f')](_0x399071[_0xd0a2('0x2c')][_0xd0a2('0x2f')]));_0x368d9e[_0xd0a2('0x2e')]=_0x368d9e['attributes']['length']?_0x368d9e[_0xd0a2('0x2e')]:_0x2e1a9c[_0xd0a2('0x29')];if(_0x399071['query']['includeAll']){_0x368d9e[_0xd0a2('0x30')]=[{'all':!![]}];}_0x368d9e=_[_0xd0a2('0x31')]({},_0x368d9e,_0x399071[_0xd0a2('0x32')]);return db[_0xd0a2('0x21')][_0xd0a2('0x33')](_0x368d9e)['then'](handleEntityNotFound(_0xd646a5,null))[_0xd0a2('0x1b')](respondWithResult(_0xd646a5,null))[_0xd0a2('0x26')](handleError(_0xd646a5,null));};exports[_0xd0a2('0x34')]=function(_0x2a9fca,_0x97d09c){return db[_0xd0a2('0x21')][_0xd0a2('0x34')](_0x2a9fca['body'],{})[_0xd0a2('0x1b')](respondWithResult(_0x97d09c,0xc9))[_0xd0a2('0x26')](handleError(_0x97d09c,null));};exports[_0xd0a2('0x1a')]=function(_0x460460,_0x4118c0){if(_0x460460[_0xd0a2('0x35')]['id']){delete _0x460460[_0xd0a2('0x35')]['id'];}return db[_0xd0a2('0x21')]['find']({'where':{'id':_0x460460[_0xd0a2('0x28')]['id']}})[_0xd0a2('0x1b')](handleEntityNotFound(_0x4118c0,null))[_0xd0a2('0x1b')](saveUpdates(_0x460460[_0xd0a2('0x35')],null))[_0xd0a2('0x1b')](respondWithResult(_0x4118c0,null))[_0xd0a2('0x26')](handleError(_0x4118c0,null));};exports['destroy']=function(_0x453cee,_0x25c0d9){return db[_0xd0a2('0x21')]['find']({'where':{'id':_0x453cee[_0xd0a2('0x28')]['id']}})['then'](handleEntityNotFound(_0x25c0d9,null))['then'](removeEntity(_0x25c0d9,null))[_0xd0a2('0x26')](handleError(_0x25c0d9,null));};exports[_0xd0a2('0x36')]=function(_0x2ba93,_0x2cba20){return db[_0xd0a2('0x21')][_0xd0a2('0x36')]()[_0xd0a2('0x1b')](respondWithResult(_0x2cba20,null))[_0xd0a2('0x26')](handleError(_0x2cba20,null));};exports[_0xd0a2('0x37')]=function(_0x37b1a6,_0x2340c4){return db['WhatsappMessage'][_0xd0a2('0x33')]({'where':{'id':_0x37b1a6['params']['id']}})[_0xd0a2('0x1b')](handleEntityNotFound(_0x2340c4,null))['then'](function(_0x1044f4){if(_0x1044f4){return _0x1044f4[_0xd0a2('0x37')](_0x37b1a6[_0xd0a2('0x35')][_0xd0a2('0x38')],_[_0xd0a2('0x39')](_0x37b1a6['body'],[_0xd0a2('0x38'),'id'])||{});}})[_0xd0a2('0x1b')](respondWithResult(_0x2340c4,null))[_0xd0a2('0x26')](handleError(_0x2340c4,null));};exports[_0xd0a2('0x3a')]=function(_0x32e7a8,_0x284e1c){var _0x3e21a6={'raw':![],'where':{}};var _0x6a7b63={};var _0x1958db={'count':0x0,'rows':[]};return db[_0xd0a2('0x21')]['findOne']({'where':{'id':_0x32e7a8[_0xd0a2('0x28')]['id']}})[_0xd0a2('0x1b')](handleEntityNotFound(_0x284e1c,null))[_0xd0a2('0x1b')](function(_0x2647d0){if(_0x2647d0){_0x6a7b63['model']=_[_0xd0a2('0x2a')](db[_0xd0a2('0x3b')]['rawAttributes']);_0x6a7b63[_0xd0a2('0x2c')]=_['keys'](_0x32e7a8[_0xd0a2('0x2c')]);_0x6a7b63['filters']=_[_0xd0a2('0x2d')](_0x6a7b63[_0xd0a2('0x29')],_0x6a7b63[_0xd0a2('0x2c')]);_0x3e21a6['attributes']=_['intersection'](_0x6a7b63[_0xd0a2('0x29')],qs[_0xd0a2('0x2f')](_0x32e7a8[_0xd0a2('0x2c')][_0xd0a2('0x2f')]));_0x3e21a6[_0xd0a2('0x2e')]=_0x3e21a6[_0xd0a2('0x2e')][_0xd0a2('0x3c')]?_0x3e21a6[_0xd0a2('0x2e')]:_0x6a7b63['model'];if(!_0x32e7a8['query']['hasOwnProperty']('nolimit')){_0x3e21a6[_0xd0a2('0x16')]=qs['limit'](_0x32e7a8[_0xd0a2('0x2c')][_0xd0a2('0x16')]);_0x3e21a6[_0xd0a2('0x18')]=qs[_0xd0a2('0x18')](_0x32e7a8[_0xd0a2('0x2c')][_0xd0a2('0x18')]);}_0x3e21a6['order']=qs[_0xd0a2('0x3d')](_0x32e7a8['query'][_0xd0a2('0x3d')]);_0x3e21a6[_0xd0a2('0x3e')]=qs[_0xd0a2('0x3f')](_[_0xd0a2('0x40')](_0x32e7a8[_0xd0a2('0x2c')],_0x6a7b63[_0xd0a2('0x3f')]));_0x3e21a6[_0xd0a2('0x3e')][_0xd0a2('0x41')]=_0x2647d0['id'];if(_0x32e7a8['query']['filter']){_0x3e21a6[_0xd0a2('0x3e')]=_['merge'](_0x3e21a6[_0xd0a2('0x3e')],{'$or':_[_0xd0a2('0x20')](_0x3e21a6[_0xd0a2('0x2e')],function(_0x42d35b){var _0x15b302={};_0x15b302[_0x42d35b]={'$like':'%'+_0x32e7a8[_0xd0a2('0x2c')][_0xd0a2('0x42')]+'%'};return _0x15b302;})});}if(_0x32e7a8[_0xd0a2('0x2c')][_0xd0a2('0x43')]){var _0x22d371=_0x32e7a8[_0xd0a2('0x2c')][_0xd0a2('0x43')][_0xd0a2('0x44')](',');var _0x36b026={};_0x36b026[_0x22d371[0x0]]={'$gte':moment(_0x22d371[0x1])[_0xd0a2('0x45')](_0xd0a2('0x46'))};_0x3e21a6[_0xd0a2('0x3e')]=_[_0xd0a2('0x31')](_0x3e21a6[_0xd0a2('0x3e')],_0x36b026);}_0x3e21a6=_['merge']({},_0x3e21a6,_0x32e7a8['options']);return db[_0xd0a2('0x3b')][_0xd0a2('0x17')]({'where':_0x3e21a6['where']})[_0xd0a2('0x1b')](function(_0x3622b7){_0x1958db[_0xd0a2('0x17')]=_0x3622b7;if(_0x32e7a8['query']['includeAll']){_0x3e21a6[_0xd0a2('0x30')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xd0a2('0x23')](_0x3e21a6);})[_0xd0a2('0x1b')](function(_0x2595cb){_0x1958db[_0xd0a2('0x47')]=_0x2595cb;return _0x1958db;});}})[_0xd0a2('0x1b')](respondWithFilteredResult(_0x284e1c,_0x3e21a6))['catch'](handleError(_0x284e1c,null));};exports[_0xd0a2('0x48')]=function(_0xb0ea08,_0x21a463){return db[_0xd0a2('0x21')]['find']({'where':{'id':_0xb0ea08[_0xd0a2('0x28')]['id']}})[_0xd0a2('0x1b')](handleEntityNotFound(_0x21a463,null))[_0xd0a2('0x1b')](function(_0x23b9b4){if(_0x23b9b4){return _0x23b9b4[_0xd0a2('0x49')](_0xb0ea08['body'][_0xd0a2('0x38')],_[_0xd0a2('0x39')](_0xb0ea08[_0xd0a2('0x35')],[_0xd0a2('0x38'),'id'])||{})[_0xd0a2('0x4a')](function(){return db[_0xd0a2('0x4b')][_0xd0a2('0x23')]({'attributes':['id',_0xd0a2('0x4c'),'color'],'where':{'id':_0xb0ea08[_0xd0a2('0x35')][_0xd0a2('0x38')]}});})[_0xd0a2('0x1b')](function(_0x343eed){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0xb0ea08['params']['id']),'tags':_0x343eed||[]});return{'id':Number(_0xb0ea08['params']['id']),'tags':_0x343eed||[]};});}})[_0xd0a2('0x1b')](respondWithResult(_0x21a463,null))['catch'](handleError(_0x21a463,null));};exports['removeTags']=function(_0x13d1f8,_0x1ff18f){return db[_0xd0a2('0x21')][_0xd0a2('0x33')]({'where':{'id':_0x13d1f8['params']['id']}})[_0xd0a2('0x1b')](handleEntityNotFound(_0x1ff18f,null))[_0xd0a2('0x1b')](function(_0x1eb56e){if(_0x1eb56e){return _0x1eb56e[_0xd0a2('0x4d')](_0x13d1f8[_0xd0a2('0x2c')][_0xd0a2('0x38')]);}})[_0xd0a2('0x1b')](respondWithStatusCode(_0x1ff18f,null))[_0xd0a2('0x26')](handleError(_0x1ff18f,null));};exports[_0xd0a2('0x4e')]=function(_0x55f895,_0x4c8be1){var _0x16580d=moment()[_0xd0a2('0x4f')]()[_0xd0a2('0x50')]();var _0xb7b589=path[_0xd0a2('0x51')](config[_0xd0a2('0x52')],_0xd0a2('0x53'),_0xd0a2('0x54'),'tmp');var _0x94ac75=path[_0xd0a2('0x51')](config['root'],_0xd0a2('0x53'),'files',_0xd0a2('0x55'));var _0x478115=path[_0xd0a2('0x51')](_0xb7b589,_0x16580d);var _0x444f3f=util[_0xd0a2('0x45')](_0xd0a2('0x56'),_0x55f895[_0xd0a2('0x28')]['id'],_0x16580d);var _0x257316=path[_0xd0a2('0x51')](_0xb7b589,_0x444f3f);var _0x22d1e0=[];_0x22d1e0['push']({'model':db[_0xd0a2('0x57')],'as':'User','attributes':['id',_0xd0a2('0x58')],'raw':!![]});_0x22d1e0[_0xd0a2('0x59')]({'model':db[_0xd0a2('0x5a')],'as':_0xd0a2('0x5b'),'attributes':['id',_0xd0a2('0x5c'),'lastName'],'raw':!![]});if(_0x55f895[_0xd0a2('0x2c')][_0xd0a2('0x55')]){_0x22d1e0['push']({'model':db['Attachment'],'as':_0xd0a2('0x5d'),'raw':!![]});}var _0x2a92ee=[{'model':db[_0xd0a2('0x3b')],'as':'Messages','attributes':['id',_0xd0a2('0x35'),_0xd0a2('0x5e'),'direction','secret','read'],'include':_0x22d1e0}];_0x2a92ee[_0xd0a2('0x59')]({'model':db[_0xd0a2('0x5f')],'as':_0xd0a2('0x60'),'attributes':['id',_0xd0a2('0x4c')]});_0x2a92ee[_0xd0a2('0x59')]({'model':db[_0xd0a2('0x57')],'as':_0xd0a2('0x61'),'attributes':['id',_0xd0a2('0x58')]});return db[_0xd0a2('0x21')][_0xd0a2('0x33')]({'where':{'id':_0x55f895[_0xd0a2('0x28')]['id']},'include':_0x2a92ee})[_0xd0a2('0x1b')](handleEntityNotFound(_0x4c8be1,null))[_0xd0a2('0x1b')](function(_0x3172f8){if(_0x3172f8){var _0x54bc2c=_0x3172f8['get']({'plain':!![]});fs[_0xd0a2('0x62')](_0x478115);var _0xd1bf2={'channel':_0xd0a2('0x63'),'account':_0x54bc2c[_0xd0a2('0x60')][_0xd0a2('0x4c')],'agent':_0x54bc2c[_0xd0a2('0x61')]?_0x54bc2c[_0xd0a2('0x61')]['fullname']:_0xd0a2('0x64'),'createdAt':moment(_0x54bc2c[_0xd0a2('0x5e')])['format'](_0xd0a2('0x46'))[_0xd0a2('0x50')](),'closedAt':_0x54bc2c[_0xd0a2('0x65')]?moment(_0x54bc2c[_0xd0a2('0x66')])['format'](_0xd0a2('0x46'))[_0xd0a2('0x50')]():'','disposition':_0x54bc2c[_0xd0a2('0x67')],'messages':_(_0x54bc2c['Messages'])[_0xd0a2('0x42')]({'secret':![]})[_0xd0a2('0x20')](function(_0xf0b617){if(_0xf0b617[_0xd0a2('0x5d')]){var _0xff27d2=path['join'](_0x94ac75,_0xf0b617[_0xd0a2('0x5d')]['basename']);if(fs[_0xd0a2('0x68')](_0xff27d2)){fs['createReadStream'](_0xff27d2)[_0xd0a2('0x69')](fs['createWriteStream'](path['join'](_0x478115,_0xf0b617[_0xd0a2('0x5d')][_0xd0a2('0x6a')])));}}return{'date':moment(_0xf0b617[_0xd0a2('0x5e')])[_0xd0a2('0x45')](_0xd0a2('0x46'))['toString'](),'sender':_0xf0b617[_0xd0a2('0x6b')]===_0xd0a2('0x6c')?_0xf0b617[_0xd0a2('0x57')]?_0xf0b617[_0xd0a2('0x57')][_0xd0a2('0x58')]:_0xd0a2('0x6d'):_0xf0b617[_0xd0a2('0x5b')][_0xd0a2('0x5c')]+(_0xf0b617['Contact'][_0xd0a2('0x6e')]?'\x20'+_0xf0b617['Contact'][_0xd0a2('0x6e')]:''),'body':_0xf0b617['Attachment']?_0xf0b617[_0xd0a2('0x5d')][_0xd0a2('0x6a')]:_0xf0b617[_0xd0a2('0x35')],'direction':_0xf0b617[_0xd0a2('0x6b')]==='out'?'A':'C','secret':_0xf0b617['secret'],'read':_0xf0b617[_0xd0a2('0x6f')],'attachment':_0xf0b617[_0xd0a2('0x5d')]};})[_0xd0a2('0x70')]()};return ejs[_0xd0a2('0x71')](path[_0xd0a2('0x51')](config[_0xd0a2('0x52')],_0xd0a2('0x53'),_0xd0a2('0x72'),'downloadInteraction.ejs'),{'interaction':_0xd1bf2})['then'](function(_0x41d811){var _0xcb75b3=path[_0xd0a2('0x51')](_0x478115,'transcript-'+_0x54bc2c['id']+'-'+_0x16580d+_0xd0a2('0x73'));var _0x5c97e1={'path':_0xcb75b3,'channel':'Whatsapp','interactionId':_0x54bc2c['id']};return pdf['createPdfFromHTML'](_0x41d811,_0x5c97e1);})[_0xd0a2('0x1b')](function(){return new BPromise(function(_0x373eac,_0x5e6ffe){zipdir(_0x478115,{'saveTo':_0x257316},function(_0x463af4,_0x3dd3d5){if(_0x463af4)return _0x5e6ffe(_0x463af4);return _0x373eac(_0x3dd3d5);});})[_0xd0a2('0x1b')](function(){return new BPromise(function(_0x2a666a,_0xb711ad){rimraf(_0x478115,function(_0x7dcc0b){if(_0x7dcc0b)_0xb711ad(_0x7dcc0b);return _0x2a666a();});});})[_0xd0a2('0x1b')](function(){return _0x4c8be1[_0xd0a2('0x4e')](_0x257316,_0x444f3f,function(_0x200783){if(_0x200783){console[_0xd0a2('0x74')](_0xd0a2('0x75'),_0x200783);}else{fs['unlinkSync'](_0x257316);}});});});}else{return _0x4c8be1['sendStatus'](0xc8);}})['catch'](handleError(_0x4c8be1,null));}; \ No newline at end of file +var _0x13be=['download','log','err','unlinkSync','zip-dir','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','end','status','offset','undefined','limit','Content-Range','json','update','then','destroy','sendStatus','error','stack','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','type','getOptions','whatsapp','query','catch','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll','include','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','WhatsappMessage','hasOwnProperty','nolimit','order','sort','pick','where','WhatsappInteractionId','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','count','findAll','rows','setTags','spread','Tag','color','emit','removeTags','unix','join','root','files','tmp','server','attachments','format','User','fullname','push','CmContact','lastName','Attachment','Messages','WhatsappAccount','Owner','Whatsapp','Account','N.A.','toString','closed','closedAt','filter','basename','existsSync','pipe','createWriteStream','direction','out','System','Contact','secret','read','value','renderFile','.pdf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x13be,0x175));var _0xe13b=function(_0x364154,_0x399863){_0x364154=_0x364154-0x0;var _0x413d88=_0x13be[_0x364154];return _0x413d88;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xe13b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xe13b('0x1'));var path=require(_0xe13b('0x2'));var ejs=require(_0xe13b('0x3'));var fs=require('fs');var _=require(_0xe13b('0x4'));var Redis=require(_0xe13b('0x5'));var interaction=require(_0xe13b('0x6'));var qs=require('../../components/parsers/qs');var pdf=require(_0xe13b('0x7'));var logger=require(_0xe13b('0x8'))(_0xe13b('0x9'));var config=require(_0xe13b('0xa'));var db=require(_0xe13b('0xb'))['db'];config[_0xe13b('0xc')]=_[_0xe13b('0xd')](config[_0xe13b('0xc')],{'host':_0xe13b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe13b('0xc')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x3e245a,_0x18ad8b){_0x18ad8b=_0x18ad8b||0xcc;return function(_0x364ff0){if(_0x364ff0){return _0x3e245a['sendStatus'](_0x18ad8b);}return _0x3e245a['status'](_0x18ad8b)[_0xe13b('0xf')]();};}function respondWithResult(_0x23a1a8,_0x6b5662){_0x6b5662=_0x6b5662||0xc8;return function(_0x47c2fe){if(_0x47c2fe){return _0x23a1a8[_0xe13b('0x10')](_0x6b5662)['json'](_0x47c2fe);}};}function respondWithFilteredResult(_0x1b05dc,_0x602b89){return function(_0x39f126){if(_0x39f126){var _0x4f9fc6=typeof _0x602b89[_0xe13b('0x11')]===_0xe13b('0x12')&&typeof _0x602b89[_0xe13b('0x13')]==='undefined';var _0x54dd71=_0x39f126['count'];var _0xf8d34c=_0x4f9fc6?0x0:_0x602b89['offset'];var _0x318efb=_0x4f9fc6?_0x39f126['count']:_0x602b89[_0xe13b('0x11')]+_0x602b89['limit'];var _0x237c3a;if(_0x318efb>=_0x54dd71){_0x318efb=_0x54dd71;_0x237c3a=0xc8;}else{_0x237c3a=0xce;}_0x1b05dc['status'](_0x237c3a);return _0x1b05dc['set'](_0xe13b('0x14'),_0xf8d34c+'-'+_0x318efb+'/'+_0x54dd71)[_0xe13b('0x15')](_0x39f126);}return null;};}function saveUpdates(_0xac8534){return function(_0x2acf51){if(_0x2acf51){return _0x2acf51[_0xe13b('0x16')](_0xac8534)[_0xe13b('0x17')](function(_0x3c63ff){return _0x3c63ff;});}return null;};}function removeEntity(_0x49543b){return function(_0x5d0dd5){if(_0x5d0dd5){return _0x5d0dd5[_0xe13b('0x18')]()[_0xe13b('0x17')](function(){_0x49543b['status'](0xcc)[_0xe13b('0xf')]();});}};}function handleEntityNotFound(_0x43cc95){return function(_0x501d4d){if(!_0x501d4d){_0x43cc95[_0xe13b('0x19')](0x194);}return _0x501d4d;};}function handleError(_0x56d7d3,_0x31d86a){_0x31d86a=_0x31d86a||0x1f4;return function(_0xa3037){logger[_0xe13b('0x1a')](_0xa3037[_0xe13b('0x1b')]);if(_0xa3037[_0xe13b('0x1c')]){delete _0xa3037['name'];}_0x56d7d3['status'](_0x31d86a)[_0xe13b('0x1d')](_0xa3037);};}exports[_0xe13b('0x1e')]=function(_0x1076ee,_0x3b3ba2){var _0x374a9a={};var _0x4771db=_[_0xe13b('0x1f')](db[_0xe13b('0x20')][_0xe13b('0x21')],function(_0x193ff2){return{'name':_0x193ff2[_0xe13b('0x22')],'type':_0x193ff2[_0xe13b('0x23')]['key']};});_0x374a9a=qs[_0xe13b('0x24')](_0x4771db,_0x1076ee);return interaction['findAll'](_0xe13b('0x25'),_0x1076ee[_0xe13b('0x26')],_0x1076ee['user'],_0x374a9a,_0x4771db)['then'](respondWithFilteredResult(_0x3b3ba2,_0x374a9a))[_0xe13b('0x27')](handleError(_0x3b3ba2,null));};exports[_0xe13b('0x28')]=function(_0x4a9cce,_0x5db958){var _0x23ec75={'raw':![],'where':{'id':_0x4a9cce[_0xe13b('0x29')]['id']}},_0x244baa={};_0x244baa[_0xe13b('0x2a')]=_[_0xe13b('0x2b')](db[_0xe13b('0x20')][_0xe13b('0x21')]);_0x244baa['query']=_[_0xe13b('0x2b')](_0x4a9cce[_0xe13b('0x26')]);_0x244baa[_0xe13b('0x2c')]=_[_0xe13b('0x2d')](_0x244baa[_0xe13b('0x2a')],_0x244baa['query']);_0x23ec75['attributes']=_[_0xe13b('0x2d')](_0x244baa[_0xe13b('0x2a')],qs['fields'](_0x4a9cce[_0xe13b('0x26')][_0xe13b('0x2e')]));_0x23ec75[_0xe13b('0x2f')]=_0x23ec75[_0xe13b('0x2f')][_0xe13b('0x30')]?_0x23ec75[_0xe13b('0x2f')]:_0x244baa[_0xe13b('0x2a')];if(_0x4a9cce[_0xe13b('0x26')][_0xe13b('0x31')]){_0x23ec75[_0xe13b('0x32')]=[{'all':!![]}];}_0x23ec75=_['merge']({},_0x23ec75,_0x4a9cce['options']);return db[_0xe13b('0x20')][_0xe13b('0x33')](_0x23ec75)['then'](handleEntityNotFound(_0x5db958,null))[_0xe13b('0x17')](respondWithResult(_0x5db958,null))[_0xe13b('0x27')](handleError(_0x5db958,null));};exports[_0xe13b('0x34')]=function(_0x24ad22,_0x35ac4a){return db[_0xe13b('0x20')][_0xe13b('0x34')](_0x24ad22[_0xe13b('0x35')],{})[_0xe13b('0x17')](respondWithResult(_0x35ac4a,0xc9))[_0xe13b('0x27')](handleError(_0x35ac4a,null));};exports[_0xe13b('0x16')]=function(_0x28ffd8,_0x381914){if(_0x28ffd8[_0xe13b('0x35')]['id']){delete _0x28ffd8['body']['id'];}return db[_0xe13b('0x20')][_0xe13b('0x33')]({'where':{'id':_0x28ffd8[_0xe13b('0x29')]['id']}})[_0xe13b('0x17')](handleEntityNotFound(_0x381914,null))[_0xe13b('0x17')](saveUpdates(_0x28ffd8[_0xe13b('0x35')],null))[_0xe13b('0x17')](respondWithResult(_0x381914,null))[_0xe13b('0x27')](handleError(_0x381914,null));};exports[_0xe13b('0x18')]=function(_0x13de89,_0x582097){return db[_0xe13b('0x20')][_0xe13b('0x33')]({'where':{'id':_0x13de89[_0xe13b('0x29')]['id']}})[_0xe13b('0x17')](handleEntityNotFound(_0x582097,null))[_0xe13b('0x17')](removeEntity(_0x582097,null))['catch'](handleError(_0x582097,null));};exports[_0xe13b('0x36')]=function(_0x4801d0,_0x435eb3){return db[_0xe13b('0x20')][_0xe13b('0x36')]()[_0xe13b('0x17')](respondWithResult(_0x435eb3,null))[_0xe13b('0x27')](handleError(_0x435eb3,null));};exports[_0xe13b('0x37')]=function(_0x3fde4d,_0x150877){return db['WhatsappMessage']['find']({'where':{'id':_0x3fde4d['params']['id']}})[_0xe13b('0x17')](handleEntityNotFound(_0x150877,null))[_0xe13b('0x17')](function(_0x373329){if(_0x373329){return _0x373329[_0xe13b('0x37')](_0x3fde4d[_0xe13b('0x35')][_0xe13b('0x38')],_[_0xe13b('0x39')](_0x3fde4d[_0xe13b('0x35')],['ids','id'])||{});}})[_0xe13b('0x17')](respondWithResult(_0x150877,null))[_0xe13b('0x27')](handleError(_0x150877,null));};exports[_0xe13b('0x3a')]=function(_0x42e0a7,_0x1185b7){var _0x5f253f={'raw':![],'where':{}};var _0x565ce1={};var _0x2eeb17={'count':0x0,'rows':[]};return db[_0xe13b('0x20')][_0xe13b('0x3b')]({'where':{'id':_0x42e0a7[_0xe13b('0x29')]['id']}})[_0xe13b('0x17')](handleEntityNotFound(_0x1185b7,null))['then'](function(_0x267255){if(_0x267255){_0x565ce1[_0xe13b('0x2a')]=_[_0xe13b('0x2b')](db[_0xe13b('0x3c')]['rawAttributes']);_0x565ce1[_0xe13b('0x26')]=_['keys'](_0x42e0a7[_0xe13b('0x26')]);_0x565ce1[_0xe13b('0x2c')]=_[_0xe13b('0x2d')](_0x565ce1[_0xe13b('0x2a')],_0x565ce1['query']);_0x5f253f[_0xe13b('0x2f')]=_[_0xe13b('0x2d')](_0x565ce1[_0xe13b('0x2a')],qs['fields'](_0x42e0a7[_0xe13b('0x26')][_0xe13b('0x2e')]));_0x5f253f[_0xe13b('0x2f')]=_0x5f253f[_0xe13b('0x2f')][_0xe13b('0x30')]?_0x5f253f['attributes']:_0x565ce1['model'];if(!_0x42e0a7['query'][_0xe13b('0x3d')](_0xe13b('0x3e'))){_0x5f253f[_0xe13b('0x13')]=qs['limit'](_0x42e0a7['query']['limit']);_0x5f253f[_0xe13b('0x11')]=qs[_0xe13b('0x11')](_0x42e0a7[_0xe13b('0x26')]['offset']);}_0x5f253f[_0xe13b('0x3f')]=qs[_0xe13b('0x40')](_0x42e0a7[_0xe13b('0x26')]['sort']);_0x5f253f['where']=qs[_0xe13b('0x2c')](_[_0xe13b('0x41')](_0x42e0a7[_0xe13b('0x26')],_0x565ce1[_0xe13b('0x2c')]));_0x5f253f[_0xe13b('0x42')][_0xe13b('0x43')]=_0x267255['id'];if(_0x42e0a7[_0xe13b('0x26')]['filter']){_0x5f253f[_0xe13b('0x42')]=_[_0xe13b('0x44')](_0x5f253f['where'],{'$or':_['map'](_0x5f253f[_0xe13b('0x2f')],function(_0x198e07){var _0xf3b032={};_0xf3b032[_0x198e07]={'$like':'%'+_0x42e0a7[_0xe13b('0x26')]['filter']+'%'};return _0xf3b032;})});}if(_0x42e0a7['query'][_0xe13b('0x45')]){var _0xca6f3f=_0x42e0a7['query'][_0xe13b('0x45')][_0xe13b('0x46')](',');var _0x304f0e={};_0x304f0e[_0xca6f3f[0x0]]={'$gte':moment(_0xca6f3f[0x1])['format'](_0xe13b('0x47'))};_0x5f253f[_0xe13b('0x42')]=_[_0xe13b('0x44')](_0x5f253f[_0xe13b('0x42')],_0x304f0e);}_0x5f253f=_[_0xe13b('0x44')]({},_0x5f253f,_0x42e0a7[_0xe13b('0x48')]);return db[_0xe13b('0x3c')][_0xe13b('0x49')]({'where':_0x5f253f['where']})['then'](function(_0xd39ef4){_0x2eeb17[_0xe13b('0x49')]=_0xd39ef4;if(_0x42e0a7[_0xe13b('0x26')][_0xe13b('0x31')]){_0x5f253f[_0xe13b('0x32')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xe13b('0x4a')](_0x5f253f);})['then'](function(_0x1e5632){_0x2eeb17[_0xe13b('0x4b')]=_0x1e5632;return _0x2eeb17;});}})[_0xe13b('0x17')](respondWithFilteredResult(_0x1185b7,_0x5f253f))['catch'](handleError(_0x1185b7,null));};exports['addTags']=function(_0x10a0ec,_0xf710a2){return db['WhatsappInteraction'][_0xe13b('0x33')]({'where':{'id':_0x10a0ec[_0xe13b('0x29')]['id']}})['then'](handleEntityNotFound(_0xf710a2,null))['then'](function(_0x5d2e09){if(_0x5d2e09){return _0x5d2e09[_0xe13b('0x4c')](_0x10a0ec[_0xe13b('0x35')]['ids'],_[_0xe13b('0x39')](_0x10a0ec[_0xe13b('0x35')],[_0xe13b('0x38'),'id'])||{})[_0xe13b('0x4d')](function(){return db[_0xe13b('0x4e')][_0xe13b('0x4a')]({'attributes':['id',_0xe13b('0x1c'),_0xe13b('0x4f')],'where':{'id':_0x10a0ec[_0xe13b('0x35')][_0xe13b('0x38')]}});})[_0xe13b('0x17')](function(_0xdf6b4d){socket[_0xe13b('0x50')]('whatsappInteractionTags:save',{'id':Number(_0x10a0ec[_0xe13b('0x29')]['id']),'tags':_0xdf6b4d||[]});return{'id':Number(_0x10a0ec[_0xe13b('0x29')]['id']),'tags':_0xdf6b4d||[]};});}})[_0xe13b('0x17')](respondWithResult(_0xf710a2,null))['catch'](handleError(_0xf710a2,null));};exports[_0xe13b('0x51')]=function(_0x2da08b,_0x1b70e8){return db[_0xe13b('0x20')][_0xe13b('0x33')]({'where':{'id':_0x2da08b[_0xe13b('0x29')]['id']}})['then'](handleEntityNotFound(_0x1b70e8,null))[_0xe13b('0x17')](function(_0x96d29){if(_0x96d29){return _0x96d29[_0xe13b('0x51')](_0x2da08b[_0xe13b('0x26')][_0xe13b('0x38')]);}})[_0xe13b('0x17')](respondWithStatusCode(_0x1b70e8,null))[_0xe13b('0x27')](handleError(_0x1b70e8,null));};exports['download']=function(_0x4d6762,_0x2595ea){var _0x4f3f14=moment()[_0xe13b('0x52')]()['toString']();var _0x3d71ae=path[_0xe13b('0x53')](config[_0xe13b('0x54')],'server',_0xe13b('0x55'),_0xe13b('0x56'));var _0x28b7e9=path[_0xe13b('0x53')](config[_0xe13b('0x54')],_0xe13b('0x57'),'files',_0xe13b('0x58'));var _0x2091f2=path[_0xe13b('0x53')](_0x3d71ae,_0x4f3f14);var _0x280528=util[_0xe13b('0x59')]('transcript-%d-%s.zip',_0x4d6762['params']['id'],_0x4f3f14);var _0x1dfe77=path[_0xe13b('0x53')](_0x3d71ae,_0x280528);var _0x629791=[];_0x629791['push']({'model':db['User'],'as':_0xe13b('0x5a'),'attributes':['id',_0xe13b('0x5b')],'raw':!![]});_0x629791[_0xe13b('0x5c')]({'model':db[_0xe13b('0x5d')],'as':'Contact','attributes':['id','firstName',_0xe13b('0x5e')],'raw':!![]});if(_0x4d6762[_0xe13b('0x26')][_0xe13b('0x58')]){_0x629791[_0xe13b('0x5c')]({'model':db[_0xe13b('0x5f')],'as':_0xe13b('0x5f'),'raw':!![]});}var _0x3091cb=[{'model':db[_0xe13b('0x3c')],'as':_0xe13b('0x60'),'attributes':['id',_0xe13b('0x35'),'createdAt','direction','secret','read'],'include':_0x629791}];_0x3091cb['push']({'model':db[_0xe13b('0x61')],'as':'Account','attributes':['id',_0xe13b('0x1c')]});_0x3091cb[_0xe13b('0x5c')]({'model':db[_0xe13b('0x5a')],'as':_0xe13b('0x62'),'attributes':['id',_0xe13b('0x5b')]});return db['WhatsappInteraction']['find']({'where':{'id':_0x4d6762[_0xe13b('0x29')]['id']},'include':_0x3091cb})[_0xe13b('0x17')](handleEntityNotFound(_0x2595ea,null))[_0xe13b('0x17')](function(_0xfae7b1){if(_0xfae7b1){var _0x843e7=_0xfae7b1['get']({'plain':!![]});fs['mkdirSync'](_0x2091f2);var _0x4ae345={'channel':_0xe13b('0x63'),'account':_0x843e7[_0xe13b('0x64')]['name'],'agent':_0x843e7['Owner']?_0x843e7['Owner'][_0xe13b('0x5b')]:_0xe13b('0x65'),'createdAt':moment(_0x843e7['createdAt'])[_0xe13b('0x59')](_0xe13b('0x47'))[_0xe13b('0x66')](),'closedAt':_0x843e7[_0xe13b('0x67')]?moment(_0x843e7[_0xe13b('0x68')])[_0xe13b('0x59')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe13b('0x66')]():'','disposition':_0x843e7['disposition'],'messages':_(_0x843e7[_0xe13b('0x60')])[_0xe13b('0x69')]({'secret':![]})[_0xe13b('0x1f')](function(_0x119fa9){if(_0x119fa9['Attachment']){var _0x5e7aa1=path[_0xe13b('0x53')](_0x28b7e9,_0x119fa9[_0xe13b('0x5f')][_0xe13b('0x6a')]);if(fs[_0xe13b('0x6b')](_0x5e7aa1)){fs['createReadStream'](_0x5e7aa1)[_0xe13b('0x6c')](fs[_0xe13b('0x6d')](path['join'](_0x2091f2,_0x119fa9[_0xe13b('0x5f')][_0xe13b('0x6a')])));}}return{'date':moment(_0x119fa9['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe13b('0x66')](),'sender':_0x119fa9[_0xe13b('0x6e')]===_0xe13b('0x6f')?_0x119fa9['User']?_0x119fa9[_0xe13b('0x5a')][_0xe13b('0x5b')]:_0xe13b('0x70'):_0x119fa9[_0xe13b('0x71')]['firstName']+(_0x119fa9['Contact'][_0xe13b('0x5e')]?'\x20'+_0x119fa9['Contact'][_0xe13b('0x5e')]:''),'body':_0x119fa9[_0xe13b('0x5f')]?_0x119fa9[_0xe13b('0x5f')][_0xe13b('0x6a')]:_0x119fa9[_0xe13b('0x35')],'direction':_0x119fa9[_0xe13b('0x6e')]==='out'?'A':'C','secret':_0x119fa9[_0xe13b('0x72')],'read':_0x119fa9[_0xe13b('0x73')],'attachment':_0x119fa9['Attachment']};})[_0xe13b('0x74')]()};return ejs[_0xe13b('0x75')](path[_0xe13b('0x53')](config['root'],_0xe13b('0x57'),'views','downloadInteraction.ejs'),{'interaction':_0x4ae345})[_0xe13b('0x17')](function(_0x1cfceb){var _0x27661e=path[_0xe13b('0x53')](_0x2091f2,'transcript-'+_0x843e7['id']+'-'+_0x4f3f14+_0xe13b('0x76'));var _0x1ad3f5={'path':_0x27661e,'channel':_0xe13b('0x63'),'interactionId':_0x843e7['id']};return pdf['createPdfFromHTML'](_0x1cfceb,_0x1ad3f5);})[_0xe13b('0x17')](function(){return new BPromise(function(_0x476f4a,_0x4e4136){zipdir(_0x2091f2,{'saveTo':_0x1dfe77},function(_0x40966b,_0x4b1b1c){if(_0x40966b)return _0x4e4136(_0x40966b);return _0x476f4a(_0x4b1b1c);});})['then'](function(){return new BPromise(function(_0x313842,_0x103fa8){rimraf(_0x2091f2,function(_0x352f31){if(_0x352f31)_0x103fa8(_0x352f31);return _0x313842();});});})[_0xe13b('0x17')](function(){return _0x2595ea[_0xe13b('0x77')](_0x1dfe77,_0x280528,function(_0x311622){if(_0x311622){console[_0xe13b('0x78')](_0xe13b('0x79'),_0x311622);}else{fs[_0xe13b('0x7a')](_0x1dfe77);}});});});}else{return _0x2595ea[_0xe13b('0x19')](0xc8);}})[_0xe13b('0x27')](handleError(_0x2595ea,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index d6c6e8e..b225ae0 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfbb4=['unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','getUsers','map','then'];(function(_0x3809dd,_0x4203d3){var _0x1420b1=function(_0x198c23){while(--_0x198c23){_0x3809dd['push'](_0x3809dd['shift']());}};_0x1420b1(++_0x4203d3);}(_0xfbb4,0x186));var _0x4fbb=function(_0x501863,_0x57a7bc){_0x501863=_0x501863-0x0;var _0x3059cb=_0xfbb4[_0x501863];return _0x3059cb;};'use strict';var EventEmitter=require(_0x4fbb('0x0'));var WhatsappInteraction=require(_0x4fbb('0x1'))['db'][_0x4fbb('0x2')];var WhatsappMessage=require(_0x4fbb('0x1'))['db'][_0x4fbb('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x4fbb('0x4')](0x0);var events={'afterCreate':_0x4fbb('0x5'),'afterUpdate':_0x4fbb('0x6'),'afterDestroy':'remove'};function emitEvent(_0x514d23){return function(_0x16c6f2,_0xba265e,_0x2b5756){_0x16c6f2[_0x4fbb('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x53a552){_0x16c6f2['setDataValue']('Users',_0x53a552[_0x4fbb('0x8')](function(_0x45ac3e){return{'id':_0x45ac3e['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x16c6f2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4fbb('0x9')](function(_0xc3ed78){_0x16c6f2['setDataValue'](_0x4fbb('0xa'),_0xc3ed78[_0x4fbb('0xb')]);WhatsappInteractionEvents[_0x4fbb('0xc')](_0x514d23+':'+_0x16c6f2['id'],_0x16c6f2);WhatsappInteractionEvents[_0x4fbb('0xc')](_0x514d23,_0x16c6f2);_0x2b5756(null);})[_0x4fbb('0xd')](_0x2b5756(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x4fbb('0xe')](e,emitEvent(event));}}module[_0x4fbb('0xf')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x5712=['setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','WhatsappInteraction','WhatsappMessage'];(function(_0x47bf35,_0x159c89){var _0x32ea70=function(_0x1796cb){while(--_0x1796cb){_0x47bf35['push'](_0x47bf35['shift']());}};_0x32ea70(++_0x159c89);}(_0x5712,0x140));var _0x2571=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5712[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require(_0x2571('0x0'));var WhatsappInteraction=require(_0x2571('0x1'))['db'][_0x2571('0x2')];var WhatsappMessage=require(_0x2571('0x1'))['db'][_0x2571('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x2571('0x4')](0x0);var events={'afterCreate':_0x2571('0x5'),'afterUpdate':_0x2571('0x6'),'afterDestroy':_0x2571('0x7')};function emitEvent(_0x42459b){return function(_0x53f883,_0x49d593,_0x4713ad){_0x53f883['getUsers']({'attributes':['id'],'raw':!![]})[_0x2571('0x8')](function(_0x251ee6){_0x53f883[_0x2571('0x9')](_0x2571('0xa'),_0x251ee6[_0x2571('0xb')](function(_0x26355f){return{'id':_0x26355f['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x53f883['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2571('0x8')](function(_0x558992){_0x53f883[_0x2571('0x9')](_0x2571('0xc'),_0x558992[_0x2571('0xd')]);WhatsappInteractionEvents[_0x2571('0xe')](_0x42459b+':'+_0x53f883['id'],_0x53f883);WhatsappInteractionEvents[_0x2571('0xe')](_0x42459b,_0x53f883);_0x4713ad(null);})[_0x2571('0xf')](_0x4713ad(null));};}for(var e in events){if(events[_0x2571('0x10')](e)){var event=events[e];WhatsappInteraction[_0x2571('0x11')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index f15d866..fdbc5b8 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.model.js +++ b/server/api/whatsappInteraction/whatsappInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5bf=['moment','bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','WhatsappInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x6e9a01,_0x41ab36){var _0x238469=function(_0x4811e){while(--_0x4811e){_0x6e9a01['push'](_0x6e9a01['shift']());}};_0x238469(++_0x41ab36);}(_0xf5bf,0x15c));var _0xff5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf5bf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xff5b('0x0'));var util=require(_0xff5b('0x1'));var logger=require(_0xff5b('0x2'))(_0xff5b('0x3'));var moment=require(_0xff5b('0x4'));var BPromise=require(_0xff5b('0x5'));var rp=require(_0xff5b('0x6'));var fs=require('fs');var path=require(_0xff5b('0x7'));var rimraf=require('rimraf');var config=require(_0xff5b('0x8'));var attributes=require(_0xff5b('0x9'));module['exports']=function(_0x4dce05,_0x356c2e){return _0x4dce05['define'](_0xff5b('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x52185f,_0x21c7ec,_0x5a4565){if(_0x52185f[_0xff5b('0xb')](_0xff5b('0xc'))){_0x52185f[_0xff5b('0xd')]=moment()[_0xff5b('0xe')](_0xff5b('0xf'));}_0x5a4565(null,_0x52185f);}}});}; \ No newline at end of file +var _0x5f8e=['WhatsappInteraction','whatsapp_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes'];(function(_0x2e8ff6,_0x2039a9){var _0x2e0682=function(_0x3dd1fa){while(--_0x3dd1fa){_0x2e8ff6['push'](_0x2e8ff6['shift']());}};_0x2e0682(++_0x2039a9);}(_0x5f8e,0x1aa));var _0xe5f8=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0x5f8e[_0x26fc81];return _0x9feece;};'use strict';var _=require('lodash');var util=require(_0xe5f8('0x0'));var logger=require(_0xe5f8('0x1'))(_0xe5f8('0x2'));var moment=require(_0xe5f8('0x3'));var BPromise=require(_0xe5f8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe5f8('0x5'));var rimraf=require(_0xe5f8('0x6'));var config=require(_0xe5f8('0x7'));var attributes=require(_0xe5f8('0x8'));module['exports']=function(_0x494236,_0x2baa65){return _0x494236['define'](_0xe5f8('0x9'),attributes,{'tableName':_0xe5f8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e3ab3,_0x1e0a11,_0x356708){if(_0x3e3ab3['changed'](_0xe5f8('0xb'))){_0x3e3ab3[_0xe5f8('0xc')]=moment()[_0xe5f8('0xd')](_0xe5f8('0xe'));}_0x356708(null,_0x3e3ab3);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index a24bc1a..6b23d9c 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js +++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc9b=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','catch','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3b7e18,_0xb04a03){var _0x2a48cd=function(_0x137c08){while(--_0x137c08){_0x3b7e18['push'](_0x3b7e18['shift']());}};_0x2a48cd(++_0xb04a03);}(_0xfc9b,0x126));var _0xbfc9=function(_0x22ce25,_0x307747){_0x22ce25=_0x22ce25-0x0;var _0x3bd9c6=_0xfc9b[_0x22ce25];return _0x3bd9c6;};'use strict';var _=require(_0xbfc9('0x0'));var util=require(_0xbfc9('0x1'));var moment=require(_0xbfc9('0x2'));var BPromise=require(_0xbfc9('0x3'));var rs=require(_0xbfc9('0x4'));var fs=require('fs');var Redis=require(_0xbfc9('0x5'));var db=require(_0xbfc9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbfc9('0x7'))(_0xbfc9('0x8'));var config=require(_0xbfc9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbfc9('0xa')][_0xbfc9('0xb')]({'port':0x232a});config[_0xbfc9('0xc')]=_[_0xbfc9('0xd')](config['redis'],{'host':_0xbfc9('0xe'),'port':0x18eb});var socket=require(_0xbfc9('0xf'))(new Redis(config['redis']));require(_0xbfc9('0x10'))[_0xbfc9('0x11')](socket);function respondWithRpcPromise(_0x459fa2,_0x5bcd9a,_0x1823b1){return new BPromise(function(_0x31d328,_0x12a420){return client['request'](_0x459fa2,_0x1823b1)[_0xbfc9('0x12')](function(_0x572c75){logger[_0xbfc9('0x13')](_0xbfc9('0x14'),_0x5bcd9a,'request\x20sent');logger[_0xbfc9('0x15')](_0xbfc9('0x16'),_0x5bcd9a,_0xbfc9('0x17'),JSON[_0xbfc9('0x18')](_0x572c75));if(_0x572c75['error']){if(_0x572c75[_0xbfc9('0x19')]['code']===0x1f4){logger[_0xbfc9('0x19')](_0xbfc9('0x14'),_0x5bcd9a,_0x572c75[_0xbfc9('0x19')][_0xbfc9('0x1a')]);return _0x12a420(_0x572c75['error'][_0xbfc9('0x1a')]);}logger[_0xbfc9('0x19')](_0xbfc9('0x14'),_0x5bcd9a,_0x572c75[_0xbfc9('0x19')][_0xbfc9('0x1a')]);return _0x31d328(_0x572c75['error'][_0xbfc9('0x1a')]);}else{logger[_0xbfc9('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x5bcd9a,'request\x20sent');_0x31d328(_0x572c75[_0xbfc9('0x1b')][_0xbfc9('0x1a')]);}})['catch'](function(_0x2ed064){logger[_0xbfc9('0x19')]('WhatsappInteraction,\x20%s,\x20%s',_0x5bcd9a,_0x2ed064);_0x12a420(_0x2ed064);});});}exports[_0xbfc9('0x1c')]=function(_0x15aa26){var _0x209b12=this;return new Promise(function(_0x581468,_0x284b49){return db[_0xbfc9('0x1d')][_0xbfc9('0x1e')](_0x15aa26[_0xbfc9('0x1f')],{'raw':_0x15aa26[_0xbfc9('0x20')]?_0x15aa26['options'][_0xbfc9('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15aa26[_0xbfc9('0x20')]?_0x15aa26['options'][_0xbfc9('0x22')]||null:null,'attributes':_0x15aa26[_0xbfc9('0x20')]?_0x15aa26[_0xbfc9('0x20')][_0xbfc9('0x23')]||null:null,'limit':_0x15aa26[_0xbfc9('0x20')]?_0x15aa26[_0xbfc9('0x20')][_0xbfc9('0x24')]||null:null})[_0xbfc9('0x12')](function(_0x39f71d){logger[_0xbfc9('0x13')]('UpdateWhatsappInteraction',_0x15aa26);logger['debug']('UpdateWhatsappInteraction',_0x15aa26,JSON[_0xbfc9('0x18')](_0x39f71d));_0x581468(_0x39f71d);})[_0xbfc9('0x25')](function(_0x37c47e){logger[_0xbfc9('0x19')](_0xbfc9('0x1c'),_0x37c47e[_0xbfc9('0x1a')],_0x15aa26);_0x284b49(_0x209b12[_0xbfc9('0x19')](0x1f4,_0x37c47e['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x2bf623){return new Promise(function(_0x39d1a0,_0x4a61e9){return db['WhatsappInteraction'][_0xbfc9('0x26')]({'where':_0x2bf623[_0xbfc9('0x20')]?_0x2bf623[_0xbfc9('0x20')]['where']||null:null})[_0xbfc9('0x12')](function(_0x5a5810){if(_0x5a5810){return _0x5a5810[_0xbfc9('0x27')](_0x2bf623[_0xbfc9('0x1f')][_0xbfc9('0x28')],_['omit'](_0x2bf623[_0xbfc9('0x1f')],[_0xbfc9('0x28'),'id'])||{});}})[_0xbfc9('0x29')](function(_0x18533a){logger['info'](_0xbfc9('0x2a'),_0x2bf623);logger[_0xbfc9('0x15')](_0xbfc9('0x2a'),_0x2bf623,JSON[_0xbfc9('0x18')](_0x18533a));_0x39d1a0(_0x18533a);})[_0xbfc9('0x25')](function(_0x9edd8c){logger[_0xbfc9('0x19')](_0xbfc9('0x2a'),_0x9edd8c[_0xbfc9('0x1a')],_0x2bf623);_0x4a61e9(_this[_0xbfc9('0x19')](0x1f4,_0x9edd8c[_0xbfc9('0x1a')]));});});}; \ No newline at end of file +var _0xd8f1=['body','options','raw','where','attributes','find','addTags','omit','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','UpdateWhatsappInteraction'];(function(_0x12c7e3,_0x417a84){var _0x348f08=function(_0x3b3052){while(--_0x3b3052){_0x12c7e3['push'](_0x12c7e3['shift']());}};_0x348f08(++_0x417a84);}(_0xd8f1,0x82));var _0x1d8f=function(_0x2d2b8e,_0x453b4b){_0x2d2b8e=_0x2d2b8e-0x0;var _0x556d19=_0xd8f1[_0x2d2b8e];return _0x556d19;};'use strict';var _=require(_0x1d8f('0x0'));var util=require(_0x1d8f('0x1'));var moment=require(_0x1d8f('0x2'));var BPromise=require(_0x1d8f('0x3'));var rs=require(_0x1d8f('0x4'));var fs=require('fs');var Redis=require(_0x1d8f('0x5'));var db=require(_0x1d8f('0x6'))['db'];var utils=require(_0x1d8f('0x7'));var logger=require('../../config/logger')(_0x1d8f('0x8'));var config=require(_0x1d8f('0x9'));var jayson=require(_0x1d8f('0xa'));var client=jayson[_0x1d8f('0xb')]['http']({'port':0x232a});config[_0x1d8f('0xc')]=_['defaults'](config[_0x1d8f('0xc')],{'host':_0x1d8f('0xd'),'port':0x18eb});var socket=require(_0x1d8f('0xe'))(new Redis(config[_0x1d8f('0xc')]));require(_0x1d8f('0xf'))[_0x1d8f('0x10')](socket);function respondWithRpcPromise(_0x763c0e,_0x318c16,_0x26a4c5){return new BPromise(function(_0x58935b,_0x178f94){return client[_0x1d8f('0x11')](_0x763c0e,_0x26a4c5)[_0x1d8f('0x12')](function(_0x6f7916){logger[_0x1d8f('0x13')](_0x1d8f('0x14'),_0x318c16,_0x1d8f('0x15'));logger[_0x1d8f('0x16')](_0x1d8f('0x17'),_0x318c16,_0x1d8f('0x15'),JSON[_0x1d8f('0x18')](_0x6f7916));if(_0x6f7916['error']){if(_0x6f7916['error'][_0x1d8f('0x19')]===0x1f4){logger[_0x1d8f('0x1a')](_0x1d8f('0x14'),_0x318c16,_0x6f7916[_0x1d8f('0x1a')]['message']);return _0x178f94(_0x6f7916[_0x1d8f('0x1a')]['message']);}logger[_0x1d8f('0x1a')]('WhatsappInteraction,\x20%s,\x20%s',_0x318c16,_0x6f7916['error'][_0x1d8f('0x1b')]);return _0x58935b(_0x6f7916['error'][_0x1d8f('0x1b')]);}else{logger[_0x1d8f('0x13')](_0x1d8f('0x14'),_0x318c16,_0x1d8f('0x15'));_0x58935b(_0x6f7916['result']['message']);}})[_0x1d8f('0x1c')](function(_0x10bb25){logger[_0x1d8f('0x1a')](_0x1d8f('0x14'),_0x318c16,_0x10bb25);_0x178f94(_0x10bb25);});});}exports[_0x1d8f('0x1d')]=function(_0x1a278d){var _0x331798=this;return new Promise(function(_0x35320c,_0x3a9fe1){return db['WhatsappInteraction']['update'](_0x1a278d[_0x1d8f('0x1e')],{'raw':_0x1a278d[_0x1d8f('0x1f')]?_0x1a278d['options'][_0x1d8f('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a278d[_0x1d8f('0x1f')]?_0x1a278d[_0x1d8f('0x1f')][_0x1d8f('0x21')]||null:null,'attributes':_0x1a278d[_0x1d8f('0x1f')]?_0x1a278d['options'][_0x1d8f('0x22')]||null:null,'limit':_0x1a278d[_0x1d8f('0x1f')]?_0x1a278d[_0x1d8f('0x1f')]['limit']||null:null})[_0x1d8f('0x12')](function(_0x434c73){logger['info'](_0x1d8f('0x1d'),_0x1a278d);logger[_0x1d8f('0x16')]('UpdateWhatsappInteraction',_0x1a278d,JSON[_0x1d8f('0x18')](_0x434c73));_0x35320c(_0x434c73);})[_0x1d8f('0x1c')](function(_0x4a9798){logger[_0x1d8f('0x1a')](_0x1d8f('0x1d'),_0x4a9798['message'],_0x1a278d);_0x3a9fe1(_0x331798[_0x1d8f('0x1a')](0x1f4,_0x4a9798['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x3f82a8){return new Promise(function(_0x46ddba,_0x50d53e){return db['WhatsappInteraction'][_0x1d8f('0x23')]({'where':_0x3f82a8['options']?_0x3f82a8[_0x1d8f('0x1f')]['where']||null:null})[_0x1d8f('0x12')](function(_0x4100eb){if(_0x4100eb){return _0x4100eb[_0x1d8f('0x24')](_0x3f82a8['body']['ids'],_[_0x1d8f('0x25')](_0x3f82a8[_0x1d8f('0x1e')],[_0x1d8f('0x26'),'id'])||{});}})['spread'](function(_0x18dcf1){logger[_0x1d8f('0x13')](_0x1d8f('0x27'),_0x3f82a8);logger['debug'](_0x1d8f('0x27'),_0x3f82a8,JSON[_0x1d8f('0x18')](_0x18dcf1));_0x46ddba(_0x18dcf1);})[_0x1d8f('0x1c')](function(_0x501ab8){logger[_0x1d8f('0x1a')](_0x1d8f('0x27'),_0x501ab8[_0x1d8f('0x1b')],_0x3f82a8);_0x50d53e(_this[_0x1d8f('0x1a')](0x1f4,_0x501ab8[_0x1d8f('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index f4d7b0f..91b7f48 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.socket.js +++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a35=['update','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x4d943a,_0x1c5663){var _0x3dc58e=function(_0x4a0f28){while(--_0x4a0f28){_0x4d943a['push'](_0x4d943a['shift']());}};_0x3dc58e(++_0x1c5663);}(_0x1a35,0x1a7));var _0x51a3=function(_0x4a02ef,_0x6bf96c){_0x4a02ef=_0x4a02ef-0x0;var _0x630d5d=_0x1a35[_0x4a02ef];return _0x630d5d;};'use strict';var WhatsappInteractionEvents=require(_0x51a3('0x0'));var events=[_0x51a3('0x1'),'remove',_0x51a3('0x2')];function createListener(_0x5eaedf,_0x99e6a8){return function(_0x378ba7){_0x99e6a8['emit'](_0x5eaedf,_0x378ba7);};}function removeListener(_0x5f4d43,_0xcf81cb){return function(){WhatsappInteractionEvents['removeListener'](_0x5f4d43,_0xcf81cb);};}exports['register']=function(_0x398dfd){for(var _0x1b7332=0x0,_0x1c2532=events[_0x51a3('0x3')];_0x1b7332<_0x1c2532;_0x1b7332++){var _0x4f8864=events[_0x1b7332];var _0x5a3003=createListener(_0x51a3('0x4')+_0x4f8864,_0x398dfd);WhatsappInteractionEvents['on'](_0x4f8864,_0x5a3003);}}; \ No newline at end of file +var _0x58eb=['removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit'];(function(_0x1f538a,_0x46abdb){var _0x33a374=function(_0x42698f){while(--_0x42698f){_0x1f538a['push'](_0x1f538a['shift']());}};_0x33a374(++_0x46abdb);}(_0x58eb,0x199));var _0xb58e=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x58eb[_0x1abb09];return _0xea1c07;};'use strict';var WhatsappInteractionEvents=require(_0xb58e('0x0'));var events=[_0xb58e('0x1'),_0xb58e('0x2'),_0xb58e('0x3')];function createListener(_0x20d524,_0x22f140){return function(_0x83c143){_0x22f140[_0xb58e('0x4')](_0x20d524,_0x83c143);};}function removeListener(_0xb8247c,_0x2b8238){return function(){WhatsappInteractionEvents[_0xb58e('0x5')](_0xb8247c,_0x2b8238);};}exports[_0xb58e('0x6')]=function(_0x3ca816){for(var _0x3b60ef=0x0,_0x3b28e4=events[_0xb58e('0x7')];_0x3b60ef<_0x3b28e4;_0x3b60ef++){var _0x3fac36=events[_0x3b60ef];var _0x166a52=createListener(_0xb58e('0x8')+_0x3fac36,_0x3ca816);WhatsappInteractionEvents['on'](_0x3fac36,_0x166a52);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index f166600..7a4c976 100644 --- a/server/api/whatsappMessage/index.js +++ b/server/api/whatsappMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4aaf=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','whatsappmessage:create','/:id/status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy'];(function(_0x3bea54,_0x581f54){var _0x13cc53=function(_0x2a6938){while(--_0x2a6938){_0x3bea54['push'](_0x3bea54['shift']());}};_0x13cc53(++_0x581f54);}(_0x4aaf,0x145));var _0xf4aa=function(_0x2980ea,_0x5ebb26){_0x2980ea=_0x2980ea-0x0;var _0x142815=_0x4aaf[_0x2980ea];return _0x142815;};'use strict';var multer=require(_0xf4aa('0x0'));var util=require(_0xf4aa('0x1'));var path=require('path');var timeout=require(_0xf4aa('0x2'));var express=require(_0xf4aa('0x3'));var router=express[_0xf4aa('0x4')]();var fs_extra=require(_0xf4aa('0x5'));var auth=require(_0xf4aa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf4aa('0x7'));var controller=require('./whatsappMessage.controller');router[_0xf4aa('0x8')]('/',auth[_0xf4aa('0x9')](),controller['index']);router[_0xf4aa('0x8')](_0xf4aa('0xa'),auth[_0xf4aa('0x9')](),controller[_0xf4aa('0xb')]);router[_0xf4aa('0x8')](_0xf4aa('0xc'),auth[_0xf4aa('0x9')](),controller[_0xf4aa('0xd')]);router[_0xf4aa('0xe')]('/',auth[_0xf4aa('0x9')](),interaction[_0xf4aa('0xf')]('whatsapp',_0xf4aa('0x10')),controller['create']);router[_0xf4aa('0xe')](_0xf4aa('0x11'),controller['status']);router[_0xf4aa('0x12')]('/:id',auth[_0xf4aa('0x9')](),controller[_0xf4aa('0x13')]);router[_0xf4aa('0x12')](_0xf4aa('0x14'),auth[_0xf4aa('0x9')](),controller[_0xf4aa('0x15')]);router[_0xf4aa('0x12')](_0xf4aa('0x16'),auth[_0xf4aa('0x9')](),controller[_0xf4aa('0x17')]);router[_0xf4aa('0x18')](_0xf4aa('0xc'),auth[_0xf4aa('0x9')](),controller[_0xf4aa('0x19')]);module[_0xf4aa('0x1a')]=router; \ No newline at end of file +var _0x49dd=['whatsapp','create','/:id/status','status','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','show','post','tracked'];(function(_0x5c50ac,_0x12a10a){var _0x1fba86=function(_0x38a6ff){while(--_0x38a6ff){_0x5c50ac['push'](_0x5c50ac['shift']());}};_0x1fba86(++_0x12a10a);}(_0x49dd,0x16a));var _0xd49d=function(_0x5de22f,_0x5a1b8b){_0x5de22f=_0x5de22f-0x0;var _0x5dca4a=_0x49dd[_0x5de22f];return _0x5dca4a;};'use strict';var multer=require('multer');var util=require(_0xd49d('0x0'));var path=require(_0xd49d('0x1'));var timeout=require(_0xd49d('0x2'));var express=require(_0xd49d('0x3'));var router=express[_0xd49d('0x4')]();var fs_extra=require(_0xd49d('0x5'));var auth=require(_0xd49d('0x6'));var interaction=require(_0xd49d('0x7'));var config=require(_0xd49d('0x8'));var controller=require(_0xd49d('0x9'));router[_0xd49d('0xa')]('/',auth[_0xd49d('0xb')](),controller[_0xd49d('0xc')]);router[_0xd49d('0xa')]('/describe',auth[_0xd49d('0xb')](),controller['describe']);router[_0xd49d('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xd49d('0xd')]);router[_0xd49d('0xe')]('/',auth['isAuthenticated'](),interaction[_0xd49d('0xf')](_0xd49d('0x10'),'whatsappmessage:create'),controller[_0xd49d('0x11')]);router[_0xd49d('0xe')](_0xd49d('0x12'),controller[_0xd49d('0x13')]);router[_0xd49d('0x14')](_0xd49d('0x15'),auth[_0xd49d('0xb')](),controller['update']);router[_0xd49d('0x14')](_0xd49d('0x16'),auth[_0xd49d('0xb')](),controller[_0xd49d('0x17')]);router[_0xd49d('0x14')](_0xd49d('0x18'),auth[_0xd49d('0xb')](),controller[_0xd49d('0x19')]);router[_0xd49d('0x1a')](_0xd49d('0x15'),auth[_0xd49d('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index d381350..7c49d96 100644 --- a/server/api/whatsappMessage/whatsappMessage.attributes.js +++ b/server/api/whatsappMessage/whatsappMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a51=['STRING','DATE','TEXT','medium','ENUM','out'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0a51,0x158));var _0x10a5=function(_0x3e13f7,_0x199ab5){_0x3e13f7=_0x3e13f7-0x0;var _0x154230=_0x0a51[_0x3e13f7];return _0x154230;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x10a5('0x0')](_0x10a5('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x10a5('0x2')]('in',_0x10a5('0x3')),'defaultValue':_0x10a5('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x10a5('0x4')](0xbe)},'phone':{'type':Sequelize[_0x10a5('0x4')]},'readAt':{'type':Sequelize[_0x10a5('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x34e7=['BOOLEAN','ENUM','out','STRING','DATE','TEXT','exports','medium'];(function(_0x569eb3,_0x338a0c){var _0x203115=function(_0x24b50a){while(--_0x24b50a){_0x569eb3['push'](_0x569eb3['shift']());}};_0x203115(++_0x338a0c);}(_0x34e7,0x1be));var _0x734e=function(_0x5880ad,_0x4da2dc){_0x5880ad=_0x5880ad-0x0;var _0x5b3222=_0x34e7[_0x5880ad];return _0x5b3222;};'use strict';var Sequelize=require('sequelize');module[_0x734e('0x0')]={'body':{'type':Sequelize['TEXT'](_0x734e('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x734e('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x734e('0x3')]('in',_0x734e('0x4')),'defaultValue':_0x734e('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x734e('0x5')]},'readAt':{'type':Sequelize[_0x734e('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x734e('0x5')]},'providerResponse':{'type':Sequelize[_0x734e('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 979b9f2..6d949b4 100644 --- a/server/api/whatsappMessage/whatsappMessage.controller.js +++ b/server/api/whatsappMessage/whatsappMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45e2=['undefined','count','offset','set','apply','reject','save','update','then','destroy','end','stack','name','send','map','WhatsappMessage','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','params','rawAttributes','keys','find','create','body','describe','whatsapp-interactions','whatsapp','read','format','UserId','user','agent','get','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','info','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','ContactId','Sequelize','SELECT','internal','manual','interface','SIP/%s','channel','accept','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','contact','fullname','motionChannel','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./whatsappMessage.socket','client','http','request','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','WhatsappMessage,\x20%s,\x20%s','catch','sendStatus','status','json','limit'];(function(_0x2ff2cd,_0x13057d){var _0x452fc6=function(_0x51b15c){while(--_0x51b15c){_0x2ff2cd['push'](_0x2ff2cd['shift']());}};_0x452fc6(++_0x13057d);}(_0x45e2,0xe3));var _0x245e=function(_0x12f8f4,_0x5afc59){_0x12f8f4=_0x12f8f4-0x0;var _0xf88f33=_0x45e2[_0x12f8f4];return _0xf88f33;};'use strict';var emlformat=require(_0x245e('0x0'));var rimraf=require(_0x245e('0x1'));var zipdir=require(_0x245e('0x2'));var jsonpatch=require(_0x245e('0x3'));var rp=require(_0x245e('0x4'));var moment=require(_0x245e('0x5'));var BPromise=require(_0x245e('0x6'));var Mustache=require(_0x245e('0x7'));var util=require(_0x245e('0x8'));var path=require(_0x245e('0x9'));var sox=require(_0x245e('0xa'));var csv=require(_0x245e('0xb'));var ejs=require(_0x245e('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x245e('0xd'));var crypto=require(_0x245e('0xe'));var jsforce=require(_0x245e('0xf'));var deskjs=require(_0x245e('0x10'));var toCsv=require(_0x245e('0xb'));var querystring=require('querystring');var Papa=require(_0x245e('0x11'));var Redis=require(_0x245e('0x12'));var authService=require(_0x245e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x245e('0x14'));var hardwareService=require(_0x245e('0x15'));var logger=require(_0x245e('0x16'))(_0x245e('0x17'));var utils=require(_0x245e('0x18'));var config=require(_0x245e('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x245e('0x1a')]=_['defaults'](config['redis'],{'host':_0x245e('0x1b'),'port':0x18eb});var socket=require(_0x245e('0x1c'))(new Redis(config['redis']));require(_0x245e('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x245e('0x1e')][_0x245e('0x1f')]({'port':0x232c});var client9002=jayson[_0x245e('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c2fe0,_0x103a50,_0x5c9740,_0x3a799a){return new BPromise(function(_0x280b05,_0xb8a3c4){var _0x1ddbd8=_0x3a799a||client;return _0x1ddbd8[_0x245e('0x20')](_0x2c2fe0,_0x5c9740)['then'](function(_0x2a1062){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x103a50,_0x245e('0x21'));logger[_0x245e('0x22')](_0x245e('0x23'),_0x103a50,_0x245e('0x21'),JSON[_0x245e('0x24')](_0x2a1062));if(_0x2a1062[_0x245e('0x25')]){if(_0x2a1062[_0x245e('0x25')]['code']===0x1f4){logger[_0x245e('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x103a50,_0x2a1062['error']['message']);return _0xb8a3c4(_0x2a1062['error'][_0x245e('0x26')]);}logger[_0x245e('0x25')](_0x245e('0x27'),_0x103a50,_0x2a1062[_0x245e('0x25')][_0x245e('0x26')]);return _0x280b05(_0x2a1062[_0x245e('0x25')][_0x245e('0x26')]);}else{logger['info'](_0x245e('0x27'),_0x103a50,'request\x20sent');_0x280b05(_0x2a1062['result']['message']);}})[_0x245e('0x28')](function(_0x5409d0){logger[_0x245e('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x103a50,_0x5409d0);_0xb8a3c4(_0x5409d0);});});}function respondWithStatusCode(_0x5171b2,_0x5bdfd1){_0x5bdfd1=_0x5bdfd1||0xcc;return function(_0x367c7e){if(_0x367c7e){return _0x5171b2[_0x245e('0x29')](_0x5bdfd1);}return _0x5171b2['status'](_0x5bdfd1)['end']();};}function respondWithResult(_0xfa5c6a,_0x1a5d2c){_0x1a5d2c=_0x1a5d2c||0xc8;return function(_0x1e97f6){if(_0x1e97f6){return _0xfa5c6a[_0x245e('0x2a')](_0x1a5d2c)[_0x245e('0x2b')](_0x1e97f6);}};}function respondWithFilteredResult(_0x14a972,_0x58b375){return function(_0x3cf996){if(_0x3cf996){var _0x1b8ce1=typeof _0x58b375['offset']==='undefined'&&typeof _0x58b375[_0x245e('0x2c')]===_0x245e('0x2d');var _0xd9db38=_0x3cf996[_0x245e('0x2e')];var _0x5ad43e=_0x1b8ce1?0x0:_0x58b375['offset'];var _0xfd1f3=_0x1b8ce1?_0x3cf996[_0x245e('0x2e')]:_0x58b375[_0x245e('0x2f')]+_0x58b375[_0x245e('0x2c')];var _0x50e188;if(_0xfd1f3>=_0xd9db38){_0xfd1f3=_0xd9db38;_0x50e188=0xc8;}else{_0x50e188=0xce;}_0x14a972[_0x245e('0x2a')](_0x50e188);return _0x14a972[_0x245e('0x30')]('Content-Range',_0x5ad43e+'-'+_0xfd1f3+'/'+_0xd9db38)['json'](_0x3cf996);}return null;};}function patchUpdates(_0x3a0701){return function(_0x5d08c0){try{jsonpatch[_0x245e('0x31')](_0x5d08c0,_0x3a0701,!![]);}catch(_0x172532){return BPromise[_0x245e('0x32')](_0x172532);}return _0x5d08c0[_0x245e('0x33')]();};}function saveUpdates(_0x85cf3a,_0x13eb98){return function(_0x46d81d){if(_0x46d81d){return _0x46d81d[_0x245e('0x34')](_0x85cf3a)[_0x245e('0x35')](function(_0x4b5de4){return _0x4b5de4;});}return null;};}function removeEntity(_0x3a90da,_0x898084){return function(_0x5c758b){if(_0x5c758b){return _0x5c758b[_0x245e('0x36')]()[_0x245e('0x35')](function(){_0x3a90da[_0x245e('0x2a')](0xcc)[_0x245e('0x37')]();});}};}function handleEntityNotFound(_0x3cb66c,_0x4b0412){return function(_0x56c9b8){if(!_0x56c9b8){_0x3cb66c[_0x245e('0x29')](0x194);}return _0x56c9b8;};}function handleError(_0x53fa32,_0x306bc3){_0x306bc3=_0x306bc3||0x1f4;return function(_0x2ebbf0){logger[_0x245e('0x25')](_0x2ebbf0[_0x245e('0x38')]);if(_0x2ebbf0[_0x245e('0x39')]){delete _0x2ebbf0[_0x245e('0x39')];}_0x53fa32['status'](_0x306bc3)[_0x245e('0x3a')](_0x2ebbf0);};}exports['index']=function(_0x3293be,_0x2fb9cd){var _0x1fe1db={},_0xa75092={},_0x233969={'count':0x0,'rows':[]};var _0x3bf6b8=_[_0x245e('0x3b')](db[_0x245e('0x3c')]['rawAttributes'],function(_0x503aad){return{'name':_0x503aad[_0x245e('0x3d')],'type':_0x503aad[_0x245e('0x3e')][_0x245e('0x3f')]};});_0xa75092[_0x245e('0x40')]=_['map'](_0x3bf6b8,'name');_0xa75092[_0x245e('0x41')]=_['keys'](_0x3293be[_0x245e('0x41')]);_0xa75092[_0x245e('0x42')]=_[_0x245e('0x43')](_0xa75092[_0x245e('0x40')],_0xa75092['query']);_0x1fe1db['attributes']=_[_0x245e('0x43')](_0xa75092[_0x245e('0x40')],qs['fields'](_0x3293be[_0x245e('0x41')][_0x245e('0x44')]));_0x1fe1db[_0x245e('0x45')]=_0x1fe1db[_0x245e('0x45')][_0x245e('0x46')]?_0x1fe1db[_0x245e('0x45')]:_0xa75092[_0x245e('0x40')];if(!_0x3293be[_0x245e('0x41')][_0x245e('0x47')](_0x245e('0x48'))){_0x1fe1db[_0x245e('0x2c')]=qs['limit'](_0x3293be[_0x245e('0x41')][_0x245e('0x2c')]);_0x1fe1db['offset']=qs[_0x245e('0x2f')](_0x3293be['query']['offset']);}_0x1fe1db['order']=qs['sort'](_0x3293be[_0x245e('0x41')][_0x245e('0x49')]);_0x1fe1db['where']=qs[_0x245e('0x42')](_[_0x245e('0x4a')](_0x3293be[_0x245e('0x41')],_0xa75092[_0x245e('0x42')]),_0x3bf6b8);if(_0x3293be[_0x245e('0x41')][_0x245e('0x4b')]){_0x1fe1db[_0x245e('0x4c')]=_[_0x245e('0x4d')](_0x1fe1db[_0x245e('0x4c')],{'$or':_['map'](_0x3bf6b8,function(_0x2d85d3){if(_0x2d85d3[_0x245e('0x3e')]!==_0x245e('0x4e')){var _0x495607={};_0x495607[_0x2d85d3['name']]={'$like':'%'+_0x3293be[_0x245e('0x41')]['filter']+'%'};return _0x495607;}})});}_0x1fe1db=_['merge']({},_0x1fe1db,_0x3293be['options']);var _0x5a19a1={'where':_0x1fe1db[_0x245e('0x4c')]};return db[_0x245e('0x3c')][_0x245e('0x2e')](_0x5a19a1)['then'](function(_0x3f75c9){_0x233969['count']=_0x3f75c9;if(_0x3293be['query'][_0x245e('0x4f')]){_0x1fe1db[_0x245e('0x50')]=[{'all':!![]}];}return db[_0x245e('0x3c')][_0x245e('0x51')](_0x1fe1db);})[_0x245e('0x35')](function(_0x6782a1){_0x233969[_0x245e('0x52')]=_0x6782a1;return _0x233969;})[_0x245e('0x35')](respondWithFilteredResult(_0x2fb9cd,_0x1fe1db))[_0x245e('0x28')](handleError(_0x2fb9cd,null));};exports['show']=function(_0xfd26d2,_0x189353){var _0x14e4c2={'raw':!![],'where':{'id':_0xfd26d2[_0x245e('0x53')]['id']}},_0x57d91e={};_0x57d91e[_0x245e('0x40')]=_['keys'](db['WhatsappMessage'][_0x245e('0x54')]);_0x57d91e[_0x245e('0x41')]=_[_0x245e('0x55')](_0xfd26d2[_0x245e('0x41')]);_0x57d91e[_0x245e('0x42')]=_[_0x245e('0x43')](_0x57d91e[_0x245e('0x40')],_0x57d91e[_0x245e('0x41')]);_0x14e4c2['attributes']=_['intersection'](_0x57d91e['model'],qs[_0x245e('0x44')](_0xfd26d2['query'][_0x245e('0x44')]));_0x14e4c2['attributes']=_0x14e4c2[_0x245e('0x45')]['length']?_0x14e4c2[_0x245e('0x45')]:_0x57d91e[_0x245e('0x40')];if(_0xfd26d2[_0x245e('0x41')]['includeAll']){_0x14e4c2[_0x245e('0x50')]=[{'all':!![]}];}_0x14e4c2=_[_0x245e('0x4d')]({},_0x14e4c2,_0xfd26d2['options']);return db['WhatsappMessage'][_0x245e('0x56')](_0x14e4c2)[_0x245e('0x35')](handleEntityNotFound(_0x189353,null))['then'](respondWithResult(_0x189353,null))[_0x245e('0x28')](handleError(_0x189353,null));};exports[_0x245e('0x57')]=function(_0x2ac9fc,_0x3fdb19){return db[_0x245e('0x3c')][_0x245e('0x57')](_0x2ac9fc[_0x245e('0x58')],{})[_0x245e('0x35')](respondWithResult(_0x3fdb19,0xc9))['catch'](handleError(_0x3fdb19,null));};exports[_0x245e('0x34')]=function(_0x537760,_0x2e8eee){if(_0x537760['body']['id']){delete _0x537760[_0x245e('0x58')]['id'];}return db[_0x245e('0x3c')][_0x245e('0x56')]({'where':{'id':_0x537760['params']['id']}})['then'](handleEntityNotFound(_0x2e8eee,null))[_0x245e('0x35')](saveUpdates(_0x537760[_0x245e('0x58')],null))[_0x245e('0x35')](respondWithResult(_0x2e8eee,null))['catch'](handleError(_0x2e8eee,null));};exports[_0x245e('0x36')]=function(_0x3d00d3,_0x153fc2){return db[_0x245e('0x3c')][_0x245e('0x56')]({'where':{'id':_0x3d00d3[_0x245e('0x53')]['id']}})[_0x245e('0x35')](handleEntityNotFound(_0x153fc2,null))['then'](removeEntity(_0x153fc2,null))['catch'](handleError(_0x153fc2,null));};exports[_0x245e('0x59')]=function(_0x40a2dd,_0x2c4f4b){return db[_0x245e('0x3c')]['describe']()[_0x245e('0x35')](respondWithResult(_0x2c4f4b,null))[_0x245e('0x28')](handleError(_0x2c4f4b,null));};var interaction_log=require('../../config/logger')(_0x245e('0x5a'));exports['accept']=function(_0x3c2554,_0x49e4a6,_0x4fc4da){var _0x32c26e={'agent':{},'channel':_0x245e('0x5b')};if(_0x3c2554[_0x245e('0x58')]['id']){delete _0x3c2554[_0x245e('0x58')]['id'];}_0x3c2554[_0x245e('0x58')][_0x245e('0x5c')]=!![];_0x3c2554[_0x245e('0x58')]['readAt']=moment()[_0x245e('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x3c2554['body'][_0x245e('0x5e')]=_0x3c2554['body'][_0x245e('0x5e')]||_0x3c2554[_0x245e('0x5f')]['id'];_0x32c26e[_0x245e('0x60')]['id']=_0x3c2554[_0x245e('0x58')]['UserId'];return db[_0x245e('0x3c')][_0x245e('0x56')]({'where':{'id':_0x3c2554[_0x245e('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x49e4a6,null))[_0x245e('0x35')](saveUpdates(_0x3c2554[_0x245e('0x58')],null))['then'](function(_0x22af03){if(_0x22af03){_0x32c26e[_0x245e('0x26')]=_0x22af03[_0x245e('0x61')]({'plain':!![]});return db['WhatsappInteraction'][_0x245e('0x56')]({'where':{'id':_0x22af03[_0x245e('0x62')]}});}return null;})[_0x245e('0x35')](handleEntityNotFound(_0x49e4a6,null))[_0x245e('0x35')](function(_0x4a90ef){if(_0x4a90ef){return _0x4a90ef[_0x245e('0x34')]({'UserId':_0x3c2554[_0x245e('0x58')]['UserId'],'read1stAt':_[_0x245e('0x63')](_0x4a90ef[_0x245e('0x64')])?moment()[_0x245e('0x5d')](_0x245e('0x65')):undefined});}return null;})['then'](function(_0x902b33){if(_0x902b33){_0x32c26e[_0x245e('0x66')]=_0x902b33['get']({'plain':!![]});interaction_log[_0x245e('0x67')](_0x245e('0x68'),_0x3c2554[_0x245e('0x5f')]['id'],_0x3c2554['user'][_0x245e('0x39')],_0x3c2554[_0x245e('0x5f')]['role'],_0x32c26e[_0x245e('0x66')]['id'],_0x3c2554[_0x245e('0x58')]?JSON[_0x245e('0x24')](_0x3c2554[_0x245e('0x58')]):_0x245e('0x69'));return respondWithRpcPromise(_0x245e('0x6a'),_0x245e('0x6b'),_0x32c26e);}return null;})['then'](function(_0x57f04a){var _0x47efab='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x57f04a[_0x245e('0x26')][_0x245e('0x6c')];return db['sequelize'][_0x245e('0x41')](_0x47efab,{'type':db[_0x245e('0x6d')]['QueryTypes'][_0x245e('0x6e')],'raw':!![]})[_0x245e('0x35')](function(_0x5ecb20){return _0x5ecb20;});})['then'](function(_0x17ac17){if(_0x17ac17){_0x32c26e[_0x245e('0x26')]['contact']=_0x17ac17[0x0];if(!_0x3c2554['body'][_0x245e('0x5e')])return;return db['User']['find']({'where':{'id':_0x3c2554[_0x245e('0x58')][_0x245e('0x5e')],'role':'agent'},'attributes':['id',_0x245e('0x39'),'fullname','email',_0x245e('0x6f')],'raw':!![]});}return null;})['then'](function(_0x5765b5){if(!_0x5765b5)return null;_0x32c26e[_0x245e('0x26')][_0x245e('0x60')]=_0x5765b5;return _0x32c26e;})[_0x245e('0x35')](function(_0x525225){if(_0x525225){if(_0x3c2554[_0x245e('0x58')][_0x245e('0x70')]){_0x32c26e[_0x245e('0x26')][_0x245e('0x71')]=util[_0x245e('0x5d')](_0x245e('0x72'),_0x3c2554[_0x245e('0x5f')][_0x245e('0x39')]);_0x32c26e[_0x245e('0x26')][_0x245e('0x73')]=_0x32c26e[_0x245e('0x73')];_0x32c26e[_0x245e('0x26')]['motionChannel']=_0x32c26e['channel'];_0x32c26e['message']['event']=_0x245e('0x74');return respondWithRpcPromise(_0x245e('0x75'),'EventManager',{'event':_0x245e('0x76'),'message':_0x32c26e['message']},client9002)[_0x245e('0x35')](function(){return _0x32c26e;});}return _0x32c26e;}return null;})['then'](respondWithResult(_0x49e4a6,null))[_0x245e('0x28')](handleError(_0x49e4a6,null));};var interaction_log=require(_0x245e('0x16'))(_0x245e('0x5a'));exports[_0x245e('0x32')]=function(_0x26ddc1,_0x2034f4,_0xa7b5ef){var _0x373882={'agent':{},'channel':_0x245e('0x5b')};if(_0x26ddc1[_0x245e('0x58')]['id']){delete _0x26ddc1[_0x245e('0x58')]['id'];}_0x26ddc1[_0x245e('0x58')][_0x245e('0x5e')]=_0x26ddc1[_0x245e('0x58')][_0x245e('0x5e')]||_0x26ddc1[_0x245e('0x5f')]['id'];_0x373882[_0x245e('0x60')]['id']=_0x26ddc1[_0x245e('0x58')][_0x245e('0x5e')];return db[_0x245e('0x3c')][_0x245e('0x56')]({'where':{'id':_0x26ddc1[_0x245e('0x53')]['id'],'UserId':null}})[_0x245e('0x35')](handleEntityNotFound(_0x2034f4,null))['then'](function(_0x3a4c08){if(_0x3a4c08){_0x373882[_0x245e('0x26')]=_0x3a4c08[_0x245e('0x61')]({'plain':!![]});return db['WhatsappInteraction'][_0x245e('0x56')]({'where':{'id':_0x3a4c08[_0x245e('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x2034f4,null))[_0x245e('0x35')](function(_0x2dc264){if(_0x2dc264){_0x373882[_0x245e('0x66')]=_0x2dc264['get']({'plain':!![]});interaction_log[_0x245e('0x67')](_0x245e('0x77'),_0x26ddc1[_0x245e('0x5f')]['id'],_0x26ddc1[_0x245e('0x5f')][_0x245e('0x39')],_0x26ddc1['user'][_0x245e('0x78')],_0x373882[_0x245e('0x66')]['id'],_0x26ddc1[_0x245e('0x58')]?JSON[_0x245e('0x24')](_0x26ddc1[_0x245e('0x58')]):_0x245e('0x69'));return respondWithRpcPromise('RejectMessage',_0x245e('0x79'),_0x373882);}return null;})[_0x245e('0x35')](function(_0x58b3d7){var _0x4e457c=_0x245e('0x7a')+_0x58b3d7[_0x245e('0x26')][_0x245e('0x6c')];return db[_0x245e('0x7b')][_0x245e('0x41')](_0x4e457c,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x245e('0x35')](function(_0x523266){return _0x523266;});})[_0x245e('0x35')](function(_0xc6274a){if(_0xc6274a){_0x373882[_0x245e('0x26')][_0x245e('0x7c')]=_0xc6274a[0x0];if(!_0x26ddc1[_0x245e('0x58')]['UserId'])return;return db['User']['find']({'where':{'id':_0x26ddc1['body'][_0x245e('0x5e')],'role':'agent'},'attributes':['id','name',_0x245e('0x7d'),'email',_0x245e('0x6f')],'raw':!![]});}return null;})['then'](function(_0xd7c846){if(!_0xd7c846)return null;_0x373882[_0x245e('0x26')]['agent']=_0xd7c846;return _0x373882;})['then'](function(_0x4156df){if(_0x4156df){_0x4156df[_0x245e('0x26')][_0x245e('0x71')]=util[_0x245e('0x5d')]('SIP/%s',_0x26ddc1['user'][_0x245e('0x39')]);_0x4156df[_0x245e('0x26')][_0x245e('0x73')]=_0x373882['channel'];_0x4156df[_0x245e('0x26')][_0x245e('0x7e')]=_0x373882[_0x245e('0x73')];_0x4156df['message']['event']=_0x245e('0x32');respondWithRpcPromise(_0x245e('0x75'),_0x245e('0x75'),{'event':_0x245e('0x7f'),'message':_0x4156df[_0x245e('0x26')]},client9002);return _0x373882;}return null;})[_0x245e('0x35')](respondWithResult(_0x2034f4,null))[_0x245e('0x28')](handleError(_0x2034f4,null));};exports[_0x245e('0x2a')]=function(_0x1700ab,_0x7097bb,_0x3d5d20){if(_0x1700ab['body']['id']){delete _0x1700ab[_0x245e('0x58')]['id'];}var _0x55f090;return db['WhatsappMessage'][_0x245e('0x56')]({'where':{'id':_0x1700ab[_0x245e('0x53')]['id']}})[_0x245e('0x35')](handleEntityNotFound(_0x7097bb,null))[_0x245e('0x35')](function(_0x58f5fc){if(_0x58f5fc){_0x55f090=_0x58f5fc;return db['WhatsappAccount'][_0x245e('0x56')]({'where':{'id':_0x58f5fc[_0x245e('0x80')]}});}})[_0x245e('0x35')](handleEntityNotFound(_0x7097bb,null))[_0x245e('0x35')](function(_0x24fea9){if(_0x24fea9){logger[_0x245e('0x22')](_0x245e('0x81'),_0x245e('0x2a'),_0x245e('0x82'),_0x24fea9[_0x245e('0x3e')],util[_0x245e('0x83')](_0x1700ab[_0x245e('0x58')],{'showHidden':![],'depth':null}));switch(_0x24fea9[_0x245e('0x3e')]){case _0x245e('0x84'):if(_0x1700ab[_0x245e('0x58')][_0x245e('0x85')]&&_0x1700ab['body'][_0x245e('0x85')]===_0x55f090['messageId']&&_0x1700ab[_0x245e('0x58')][_0x245e('0x86')]&&_0x1700ab[_0x245e('0x58')][_0x245e('0x86')]===_0x245e('0x5c')){return _0x55f090[_0x245e('0x34')]({'read':!![]});}else{logger[_0x245e('0x25')](_0x245e('0x87'),_0x245e('0x2a'),_0x245e('0x84'),util[_0x245e('0x83')](_0x1700ab[_0x245e('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x55f090;}})[_0x245e('0x35')](respondWithResult(_0x7097bb,null))[_0x245e('0x28')](handleError(_0x7097bb,null));}; \ No newline at end of file +var _0xcf83=['status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','stack','name','index','map','WhatsappMessage','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','params','rawAttributes','length','includeAll','include','find','create','body','update','describe','../../config/logger','whatsapp-interactions','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','User','interface','rejectmessage','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus'];(function(_0x46e5cc,_0x2d646e){var _0x4d79e5=function(_0x5984b6){while(--_0x5984b6){_0x46e5cc['push'](_0x46e5cc['shift']());}};_0x4d79e5(++_0x2d646e);}(_0xcf83,0x182));var _0x3cf8=function(_0x3bded8,_0x4cbb26){_0x3bded8=_0x3bded8-0x0;var _0x5e6421=_0xcf83[_0x3bded8];return _0x5e6421;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3cf8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3cf8('0x1'));var rp=require(_0x3cf8('0x2'));var moment=require(_0x3cf8('0x3'));var BPromise=require(_0x3cf8('0x4'));var Mustache=require(_0x3cf8('0x5'));var util=require('util');var path=require(_0x3cf8('0x6'));var sox=require('sox');var csv=require(_0x3cf8('0x7'));var ejs=require(_0x3cf8('0x8'));var fs=require('fs');var fs_extra=require(_0x3cf8('0x9'));var _=require(_0x3cf8('0xa'));var squel=require(_0x3cf8('0xb'));var crypto=require(_0x3cf8('0xc'));var jsforce=require(_0x3cf8('0xd'));var deskjs=require(_0x3cf8('0xe'));var toCsv=require(_0x3cf8('0x7'));var querystring=require(_0x3cf8('0xf'));var Papa=require(_0x3cf8('0x10'));var Redis=require('ioredis');var authService=require(_0x3cf8('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3cf8('0x12'));var logger=require('../../config/logger')(_0x3cf8('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3cf8('0x14'));var db=require(_0x3cf8('0x15'))['db'];config[_0x3cf8('0x16')]=_[_0x3cf8('0x17')](config[_0x3cf8('0x16')],{'host':_0x3cf8('0x18'),'port':0x18eb});var socket=require(_0x3cf8('0x19'))(new Redis(config[_0x3cf8('0x16')]));require('./whatsappMessage.socket')[_0x3cf8('0x1a')](socket);var jayson=require(_0x3cf8('0x1b'));var client=jayson[_0x3cf8('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x3cf8('0x1c')][_0x3cf8('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x56fa9b,_0x197ff2,_0x1ce48d,_0x2b0547){return new BPromise(function(_0x178ac9,_0x2d8c8e){var _0xf593a5=_0x2b0547||client;return _0xf593a5[_0x3cf8('0x1e')](_0x56fa9b,_0x1ce48d)[_0x3cf8('0x1f')](function(_0x2557a7){logger[_0x3cf8('0x20')](_0x3cf8('0x21'),_0x197ff2,_0x3cf8('0x22'));logger[_0x3cf8('0x23')](_0x3cf8('0x24'),_0x197ff2,_0x3cf8('0x22'),JSON['stringify'](_0x2557a7));if(_0x2557a7[_0x3cf8('0x25')]){if(_0x2557a7[_0x3cf8('0x25')][_0x3cf8('0x26')]===0x1f4){logger['error'](_0x3cf8('0x21'),_0x197ff2,_0x2557a7['error'][_0x3cf8('0x27')]);return _0x2d8c8e(_0x2557a7[_0x3cf8('0x25')]['message']);}logger[_0x3cf8('0x25')](_0x3cf8('0x21'),_0x197ff2,_0x2557a7[_0x3cf8('0x25')][_0x3cf8('0x27')]);return _0x178ac9(_0x2557a7[_0x3cf8('0x25')][_0x3cf8('0x27')]);}else{logger[_0x3cf8('0x20')](_0x3cf8('0x21'),_0x197ff2,_0x3cf8('0x22'));_0x178ac9(_0x2557a7[_0x3cf8('0x28')]['message']);}})[_0x3cf8('0x29')](function(_0x86c328){logger[_0x3cf8('0x25')](_0x3cf8('0x21'),_0x197ff2,_0x86c328);_0x2d8c8e(_0x86c328);});});}function respondWithStatusCode(_0x38794e,_0x4bb74b){_0x4bb74b=_0x4bb74b||0xcc;return function(_0x32e2d0){if(_0x32e2d0){return _0x38794e[_0x3cf8('0x2a')](_0x4bb74b);}return _0x38794e[_0x3cf8('0x2b')](_0x4bb74b)[_0x3cf8('0x2c')]();};}function respondWithResult(_0x2386bc,_0x33c04b){_0x33c04b=_0x33c04b||0xc8;return function(_0x10ea77){if(_0x10ea77){return _0x2386bc[_0x3cf8('0x2b')](_0x33c04b)[_0x3cf8('0x2d')](_0x10ea77);}};}function respondWithFilteredResult(_0x4269f4,_0x57c846){return function(_0x42438c){if(_0x42438c){var _0x2ce2c7=typeof _0x57c846[_0x3cf8('0x2e')]===_0x3cf8('0x2f')&&typeof _0x57c846[_0x3cf8('0x30')]===_0x3cf8('0x2f');var _0x128765=_0x42438c[_0x3cf8('0x31')];var _0x373d8a=_0x2ce2c7?0x0:_0x57c846['offset'];var _0x2d00b4=_0x2ce2c7?_0x42438c['count']:_0x57c846[_0x3cf8('0x2e')]+_0x57c846[_0x3cf8('0x30')];var _0x4b5e99;if(_0x2d00b4>=_0x128765){_0x2d00b4=_0x128765;_0x4b5e99=0xc8;}else{_0x4b5e99=0xce;}_0x4269f4[_0x3cf8('0x2b')](_0x4b5e99);return _0x4269f4[_0x3cf8('0x32')](_0x3cf8('0x33'),_0x373d8a+'-'+_0x2d00b4+'/'+_0x128765)['json'](_0x42438c);}return null;};}function patchUpdates(_0x243c4d){return function(_0x3832f8){try{jsonpatch['apply'](_0x3832f8,_0x243c4d,!![]);}catch(_0xe2fd7f){return BPromise[_0x3cf8('0x34')](_0xe2fd7f);}return _0x3832f8[_0x3cf8('0x35')]();};}function saveUpdates(_0x1a4657,_0x17611f){return function(_0xc71155){if(_0xc71155){return _0xc71155['update'](_0x1a4657)[_0x3cf8('0x1f')](function(_0x55c435){return _0x55c435;});}return null;};}function removeEntity(_0x1f766a,_0x4b41f3){return function(_0x8af6c3){if(_0x8af6c3){return _0x8af6c3[_0x3cf8('0x36')]()[_0x3cf8('0x1f')](function(){_0x1f766a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17b6b1,_0x5528ba){return function(_0x163a03){if(!_0x163a03){_0x17b6b1[_0x3cf8('0x2a')](0x194);}return _0x163a03;};}function handleError(_0x211ebf,_0x421df1){_0x421df1=_0x421df1||0x1f4;return function(_0x353515){logger[_0x3cf8('0x25')](_0x353515[_0x3cf8('0x37')]);if(_0x353515[_0x3cf8('0x38')]){delete _0x353515['name'];}_0x211ebf[_0x3cf8('0x2b')](_0x421df1)['send'](_0x353515);};}exports[_0x3cf8('0x39')]=function(_0x2b918f,_0x10fdf6){var _0x39d82c={},_0x3baca9={},_0x3f0287={'count':0x0,'rows':[]};var _0x4da3fe=_[_0x3cf8('0x3a')](db[_0x3cf8('0x3b')]['rawAttributes'],function(_0x49895d){return{'name':_0x49895d['fieldName'],'type':_0x49895d[_0x3cf8('0x3c')][_0x3cf8('0x3d')]};});_0x3baca9['model']=_[_0x3cf8('0x3a')](_0x4da3fe,_0x3cf8('0x38'));_0x3baca9[_0x3cf8('0x3e')]=_[_0x3cf8('0x3f')](_0x2b918f[_0x3cf8('0x3e')]);_0x3baca9[_0x3cf8('0x40')]=_[_0x3cf8('0x41')](_0x3baca9[_0x3cf8('0x42')],_0x3baca9[_0x3cf8('0x3e')]);_0x39d82c[_0x3cf8('0x43')]=_['intersection'](_0x3baca9[_0x3cf8('0x42')],qs[_0x3cf8('0x44')](_0x2b918f['query']['fields']));_0x39d82c[_0x3cf8('0x43')]=_0x39d82c[_0x3cf8('0x43')]['length']?_0x39d82c['attributes']:_0x3baca9[_0x3cf8('0x42')];if(!_0x2b918f[_0x3cf8('0x3e')][_0x3cf8('0x45')](_0x3cf8('0x46'))){_0x39d82c[_0x3cf8('0x30')]=qs[_0x3cf8('0x30')](_0x2b918f[_0x3cf8('0x3e')][_0x3cf8('0x30')]);_0x39d82c[_0x3cf8('0x2e')]=qs[_0x3cf8('0x2e')](_0x2b918f[_0x3cf8('0x3e')][_0x3cf8('0x2e')]);}_0x39d82c[_0x3cf8('0x47')]=qs[_0x3cf8('0x48')](_0x2b918f[_0x3cf8('0x3e')][_0x3cf8('0x48')]);_0x39d82c['where']=qs['filters'](_[_0x3cf8('0x49')](_0x2b918f[_0x3cf8('0x3e')],_0x3baca9[_0x3cf8('0x40')]),_0x4da3fe);if(_0x2b918f['query'][_0x3cf8('0x4a')]){_0x39d82c[_0x3cf8('0x4b')]=_[_0x3cf8('0x4c')](_0x39d82c[_0x3cf8('0x4b')],{'$or':_[_0x3cf8('0x3a')](_0x4da3fe,function(_0x4a36c4){if(_0x4a36c4[_0x3cf8('0x3c')]!==_0x3cf8('0x4d')){var _0xafb33f={};_0xafb33f[_0x4a36c4[_0x3cf8('0x38')]]={'$like':'%'+_0x2b918f[_0x3cf8('0x3e')]['filter']+'%'};return _0xafb33f;}})});}_0x39d82c=_[_0x3cf8('0x4c')]({},_0x39d82c,_0x2b918f[_0x3cf8('0x4e')]);var _0x1f43c7={'where':_0x39d82c['where']};return db[_0x3cf8('0x3b')][_0x3cf8('0x31')](_0x1f43c7)[_0x3cf8('0x1f')](function(_0x27be4a){_0x3f0287['count']=_0x27be4a;if(_0x2b918f['query']['includeAll']){_0x39d82c['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x3cf8('0x4f')](_0x39d82c);})[_0x3cf8('0x1f')](function(_0x2f22a3){_0x3f0287[_0x3cf8('0x50')]=_0x2f22a3;return _0x3f0287;})[_0x3cf8('0x1f')](respondWithFilteredResult(_0x10fdf6,_0x39d82c))[_0x3cf8('0x29')](handleError(_0x10fdf6,null));};exports['show']=function(_0x39aff7,_0x1c11bb){var _0x51dc78={'raw':!![],'where':{'id':_0x39aff7[_0x3cf8('0x51')]['id']}},_0x5805ce={};_0x5805ce[_0x3cf8('0x42')]=_['keys'](db[_0x3cf8('0x3b')][_0x3cf8('0x52')]);_0x5805ce['query']=_[_0x3cf8('0x3f')](_0x39aff7[_0x3cf8('0x3e')]);_0x5805ce['filters']=_[_0x3cf8('0x41')](_0x5805ce['model'],_0x5805ce[_0x3cf8('0x3e')]);_0x51dc78[_0x3cf8('0x43')]=_['intersection'](_0x5805ce[_0x3cf8('0x42')],qs[_0x3cf8('0x44')](_0x39aff7[_0x3cf8('0x3e')][_0x3cf8('0x44')]));_0x51dc78[_0x3cf8('0x43')]=_0x51dc78[_0x3cf8('0x43')][_0x3cf8('0x53')]?_0x51dc78[_0x3cf8('0x43')]:_0x5805ce[_0x3cf8('0x42')];if(_0x39aff7[_0x3cf8('0x3e')][_0x3cf8('0x54')]){_0x51dc78[_0x3cf8('0x55')]=[{'all':!![]}];}_0x51dc78=_[_0x3cf8('0x4c')]({},_0x51dc78,_0x39aff7[_0x3cf8('0x4e')]);return db[_0x3cf8('0x3b')][_0x3cf8('0x56')](_0x51dc78)['then'](handleEntityNotFound(_0x1c11bb,null))[_0x3cf8('0x1f')](respondWithResult(_0x1c11bb,null))[_0x3cf8('0x29')](handleError(_0x1c11bb,null));};exports[_0x3cf8('0x57')]=function(_0x21b57d,_0x3feefd){return db[_0x3cf8('0x3b')][_0x3cf8('0x57')](_0x21b57d[_0x3cf8('0x58')],{})[_0x3cf8('0x1f')](respondWithResult(_0x3feefd,0xc9))[_0x3cf8('0x29')](handleError(_0x3feefd,null));};exports[_0x3cf8('0x59')]=function(_0x6e3aad,_0x4d59b4){if(_0x6e3aad[_0x3cf8('0x58')]['id']){delete _0x6e3aad['body']['id'];}return db[_0x3cf8('0x3b')]['find']({'where':{'id':_0x6e3aad[_0x3cf8('0x51')]['id']}})[_0x3cf8('0x1f')](handleEntityNotFound(_0x4d59b4,null))[_0x3cf8('0x1f')](saveUpdates(_0x6e3aad[_0x3cf8('0x58')],null))[_0x3cf8('0x1f')](respondWithResult(_0x4d59b4,null))['catch'](handleError(_0x4d59b4,null));};exports[_0x3cf8('0x36')]=function(_0xe8c144,_0x2d0cce){return db[_0x3cf8('0x3b')][_0x3cf8('0x56')]({'where':{'id':_0xe8c144['params']['id']}})[_0x3cf8('0x1f')](handleEntityNotFound(_0x2d0cce,null))[_0x3cf8('0x1f')](removeEntity(_0x2d0cce,null))[_0x3cf8('0x29')](handleError(_0x2d0cce,null));};exports[_0x3cf8('0x5a')]=function(_0xace54d,_0x15ed9f){return db['WhatsappMessage'][_0x3cf8('0x5a')]()[_0x3cf8('0x1f')](respondWithResult(_0x15ed9f,null))[_0x3cf8('0x29')](handleError(_0x15ed9f,null));};var interaction_log=require(_0x3cf8('0x5b'))(_0x3cf8('0x5c'));exports['accept']=function(_0x521c4c,_0x28f0b7,_0x2042cd){var _0x2f9407={'agent':{},'channel':_0x3cf8('0x5d')};if(_0x521c4c[_0x3cf8('0x58')]['id']){delete _0x521c4c[_0x3cf8('0x58')]['id'];}_0x521c4c[_0x3cf8('0x58')][_0x3cf8('0x5e')]=!![];_0x521c4c[_0x3cf8('0x58')][_0x3cf8('0x5f')]=moment()[_0x3cf8('0x60')](_0x3cf8('0x61'));_0x521c4c[_0x3cf8('0x58')][_0x3cf8('0x62')]=_0x521c4c[_0x3cf8('0x58')][_0x3cf8('0x62')]||_0x521c4c[_0x3cf8('0x63')]['id'];_0x2f9407[_0x3cf8('0x64')]['id']=_0x521c4c[_0x3cf8('0x58')][_0x3cf8('0x62')];return db[_0x3cf8('0x3b')][_0x3cf8('0x56')]({'where':{'id':_0x521c4c['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x28f0b7,null))[_0x3cf8('0x1f')](saveUpdates(_0x521c4c[_0x3cf8('0x58')],null))['then'](function(_0x2d5be1){if(_0x2d5be1){_0x2f9407[_0x3cf8('0x27')]=_0x2d5be1[_0x3cf8('0x65')]({'plain':!![]});return db[_0x3cf8('0x66')][_0x3cf8('0x56')]({'where':{'id':_0x2d5be1[_0x3cf8('0x67')]}});}return null;})[_0x3cf8('0x1f')](handleEntityNotFound(_0x28f0b7,null))['then'](function(_0x29a8c4){if(_0x29a8c4){return _0x29a8c4[_0x3cf8('0x59')]({'UserId':_0x521c4c[_0x3cf8('0x58')][_0x3cf8('0x62')],'read1stAt':_['isNil'](_0x29a8c4[_0x3cf8('0x68')])?moment()['format'](_0x3cf8('0x61')):undefined});}return null;})[_0x3cf8('0x1f')](function(_0x57b6b9){if(_0x57b6b9){_0x2f9407[_0x3cf8('0x69')]=_0x57b6b9[_0x3cf8('0x65')]({'plain':!![]});interaction_log[_0x3cf8('0x20')](_0x3cf8('0x6a'),_0x521c4c[_0x3cf8('0x63')]['id'],_0x521c4c[_0x3cf8('0x63')][_0x3cf8('0x38')],_0x521c4c[_0x3cf8('0x63')][_0x3cf8('0x6b')],_0x2f9407['interaction']['id'],_0x521c4c['body']?JSON['stringify'](_0x521c4c['body']):_0x3cf8('0x6c'));return respondWithRpcPromise(_0x3cf8('0x6d'),_0x3cf8('0x6e'),_0x2f9407);}return null;})['then'](function(_0x25cbf6){var _0x17df4e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x25cbf6[_0x3cf8('0x27')][_0x3cf8('0x6f')];return db['sequelize'][_0x3cf8('0x3e')](_0x17df4e,{'type':db[_0x3cf8('0x70')][_0x3cf8('0x71')][_0x3cf8('0x72')],'raw':!![]})[_0x3cf8('0x1f')](function(_0x463845){return _0x463845;});})[_0x3cf8('0x1f')](function(_0x3e1b0a){if(_0x3e1b0a){_0x2f9407[_0x3cf8('0x27')][_0x3cf8('0x73')]=_0x3e1b0a[0x0];if(!_0x521c4c[_0x3cf8('0x58')][_0x3cf8('0x62')])return;return db['User'][_0x3cf8('0x56')]({'where':{'id':_0x521c4c[_0x3cf8('0x58')][_0x3cf8('0x62')],'role':_0x3cf8('0x64')},'attributes':['id',_0x3cf8('0x38'),_0x3cf8('0x74'),_0x3cf8('0x75'),_0x3cf8('0x76')],'raw':!![]});}return null;})[_0x3cf8('0x1f')](function(_0x584970){if(!_0x584970)return null;_0x2f9407[_0x3cf8('0x27')][_0x3cf8('0x64')]=_0x584970;return _0x2f9407;})[_0x3cf8('0x1f')](function(_0x4466c6){if(_0x4466c6){if(_0x521c4c['body'][_0x3cf8('0x77')]){_0x2f9407[_0x3cf8('0x27')]['interface']=util[_0x3cf8('0x60')](_0x3cf8('0x78'),_0x521c4c['user']['name']);_0x2f9407[_0x3cf8('0x27')][_0x3cf8('0x79')]=_0x2f9407['channel'];_0x2f9407[_0x3cf8('0x27')][_0x3cf8('0x7a')]=_0x2f9407[_0x3cf8('0x79')];_0x2f9407[_0x3cf8('0x27')][_0x3cf8('0x7b')]=_0x3cf8('0x7c');return respondWithRpcPromise(_0x3cf8('0x7d'),_0x3cf8('0x7d'),{'event':_0x3cf8('0x7e'),'message':_0x2f9407['message']},client9002)[_0x3cf8('0x1f')](function(){return _0x2f9407;});}return _0x2f9407;}return null;})[_0x3cf8('0x1f')](respondWithResult(_0x28f0b7,null))[_0x3cf8('0x29')](handleError(_0x28f0b7,null));};var interaction_log=require(_0x3cf8('0x5b'))('whatsapp-interactions');exports['reject']=function(_0x1df8bb,_0x136391,_0x2b790a){var _0x111585={'agent':{},'channel':_0x3cf8('0x5d')};if(_0x1df8bb[_0x3cf8('0x58')]['id']){delete _0x1df8bb[_0x3cf8('0x58')]['id'];}_0x1df8bb[_0x3cf8('0x58')]['UserId']=_0x1df8bb[_0x3cf8('0x58')][_0x3cf8('0x62')]||_0x1df8bb[_0x3cf8('0x63')]['id'];_0x111585[_0x3cf8('0x64')]['id']=_0x1df8bb[_0x3cf8('0x58')][_0x3cf8('0x62')];return db['WhatsappMessage']['find']({'where':{'id':_0x1df8bb[_0x3cf8('0x51')]['id'],'UserId':null}})[_0x3cf8('0x1f')](handleEntityNotFound(_0x136391,null))[_0x3cf8('0x1f')](function(_0x2af63c){if(_0x2af63c){_0x111585[_0x3cf8('0x27')]=_0x2af63c[_0x3cf8('0x65')]({'plain':!![]});return db[_0x3cf8('0x66')]['find']({'where':{'id':_0x2af63c[_0x3cf8('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x136391,null))[_0x3cf8('0x1f')](function(_0x2f1ddd){if(_0x2f1ddd){_0x111585[_0x3cf8('0x69')]=_0x2f1ddd[_0x3cf8('0x65')]({'plain':!![]});interaction_log[_0x3cf8('0x20')](_0x3cf8('0x7f'),_0x1df8bb[_0x3cf8('0x63')]['id'],_0x1df8bb[_0x3cf8('0x63')][_0x3cf8('0x38')],_0x1df8bb[_0x3cf8('0x63')][_0x3cf8('0x6b')],_0x111585[_0x3cf8('0x69')]['id'],_0x1df8bb[_0x3cf8('0x58')]?JSON[_0x3cf8('0x80')](_0x1df8bb[_0x3cf8('0x58')]):_0x3cf8('0x6c'));return respondWithRpcPromise(_0x3cf8('0x81'),_0x3cf8('0x82'),_0x111585);}return null;})[_0x3cf8('0x1f')](function(_0x38024f){var _0x2ac7de=_0x3cf8('0x83')+_0x38024f[_0x3cf8('0x27')][_0x3cf8('0x6f')];return db[_0x3cf8('0x84')]['query'](_0x2ac7de,{'type':db[_0x3cf8('0x70')][_0x3cf8('0x71')][_0x3cf8('0x72')],'raw':!![]})[_0x3cf8('0x1f')](function(_0x4cd7ab){return _0x4cd7ab;});})[_0x3cf8('0x1f')](function(_0x5201df){if(_0x5201df){_0x111585['message'][_0x3cf8('0x73')]=_0x5201df[0x0];if(!_0x1df8bb['body'][_0x3cf8('0x62')])return;return db[_0x3cf8('0x85')][_0x3cf8('0x56')]({'where':{'id':_0x1df8bb[_0x3cf8('0x58')][_0x3cf8('0x62')],'role':_0x3cf8('0x64')},'attributes':['id',_0x3cf8('0x38'),_0x3cf8('0x74'),_0x3cf8('0x75'),'internal'],'raw':!![]});}return null;})[_0x3cf8('0x1f')](function(_0xb2ceb7){if(!_0xb2ceb7)return null;_0x111585[_0x3cf8('0x27')][_0x3cf8('0x64')]=_0xb2ceb7;return _0x111585;})[_0x3cf8('0x1f')](function(_0x3f4e69){if(_0x3f4e69){_0x3f4e69['message'][_0x3cf8('0x86')]=util['format']('SIP/%s',_0x1df8bb['user']['name']);_0x3f4e69['message'][_0x3cf8('0x79')]=_0x111585[_0x3cf8('0x79')];_0x3f4e69[_0x3cf8('0x27')][_0x3cf8('0x7a')]=_0x111585['channel'];_0x3f4e69[_0x3cf8('0x27')][_0x3cf8('0x7b')]=_0x3cf8('0x34');respondWithRpcPromise('EventManager','EventManager',{'event':_0x3cf8('0x87'),'message':_0x3f4e69[_0x3cf8('0x27')]},client9002);return _0x111585;}return null;})[_0x3cf8('0x1f')](respondWithResult(_0x136391,null))[_0x3cf8('0x29')](handleError(_0x136391,null));};exports['status']=function(_0x2cfa69,_0x39a5b9,_0x225c86){if(_0x2cfa69[_0x3cf8('0x58')]['id']){delete _0x2cfa69[_0x3cf8('0x58')]['id'];}var _0x4fa981;return db['WhatsappMessage']['find']({'where':{'id':_0x2cfa69['params']['id']}})[_0x3cf8('0x1f')](handleEntityNotFound(_0x39a5b9,null))[_0x3cf8('0x1f')](function(_0x437b68){if(_0x437b68){_0x4fa981=_0x437b68;return db['WhatsappAccount']['find']({'where':{'id':_0x437b68['WhatsappAccountId']}});}})[_0x3cf8('0x1f')](handleEntityNotFound(_0x39a5b9,null))['then'](function(_0x5446dd){if(_0x5446dd){logger['debug']('WhatsppMessage,\x20%s,\x20%s,\x20%s','status',_0x3cf8('0x88'),_0x5446dd[_0x3cf8('0x3c')],util['inspect'](_0x2cfa69[_0x3cf8('0x58')],{'showHidden':![],'depth':null}));switch(_0x5446dd[_0x3cf8('0x3c')]){case _0x3cf8('0x89'):if(_0x2cfa69[_0x3cf8('0x58')]['MessageSid']&&_0x2cfa69['body'][_0x3cf8('0x8a')]===_0x4fa981[_0x3cf8('0x8b')]&&_0x2cfa69['body'][_0x3cf8('0x8c')]&&_0x2cfa69[_0x3cf8('0x58')][_0x3cf8('0x8c')]===_0x3cf8('0x5e')){return _0x4fa981['update']({'read':!![]});}else{logger[_0x3cf8('0x25')](_0x3cf8('0x8d'),_0x3cf8('0x2b'),'twilio',util[_0x3cf8('0x8e')](_0x2cfa69['body'],{'showHidden':![],'depth':null}));}break;}return _0x4fa981;}})[_0x3cf8('0x1f')](respondWithResult(_0x39a5b9,null))[_0x3cf8('0x29')](handleError(_0x39a5b9,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 386dc2f..16e4fb8 100644 --- a/server/api/whatsappMessage/whatsappMessage.events.js +++ b/server/api/whatsappMessage/whatsappMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['hasOwnProperty','hook','events','WhatsappMessage','setMaxListeners','save','remove','emit'];(function(_0x52aad2,_0x35c444){var _0x2510af=function(_0x55b391){while(--_0x55b391){_0x52aad2['push'](_0x52aad2['shift']());}};_0x2510af(++_0x35c444);}(_0xb10b,0x12a));var _0xbb10=function(_0x44a518,_0x413a2d){_0x44a518=_0x44a518-0x0;var _0x4a3cdf=_0xb10b[_0x44a518];return _0x4a3cdf;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xbb10('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){WhatsappMessageEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);WhatsappMessageEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];WhatsappMessage[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x80df=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage','setMaxListeners','update'];(function(_0x264c81,_0x460b13){var _0x1908a0=function(_0x162184){while(--_0x162184){_0x264c81['push'](_0x264c81['shift']());}};_0x1908a0(++_0x460b13);}(_0x80df,0x17e));var _0xf80d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80df[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xf80d('0x0'));var WhatsappMessage=require(_0xf80d('0x1'))['db'][_0xf80d('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf80d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf80d('0x4'),'afterDestroy':_0xf80d('0x5')};function emitEvent(_0xfd239e){return function(_0x21365c,_0x15d302,_0xa6b1bb){WhatsappMessageEvents[_0xf80d('0x6')](_0xfd239e+':'+_0x21365c['id'],_0x21365c);WhatsappMessageEvents[_0xf80d('0x6')](_0xfd239e,_0x21365c);_0xa6b1bb(null);};}for(var e in events){if(events[_0xf80d('0x7')](e)){var event=events[e];WhatsappMessage[_0xf80d('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 366e77a..a4c9d05 100644 --- a/server/api/whatsappMessage/whatsappMessage.model.js +++ b/server/api/whatsappMessage/whatsappMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe59a=['rimraf','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','toLowerCase','error','find','WhatsappAccountId','type','twilio','accountSid','authToken','create','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','Bearer\x20','application/json','statuses','message_id','err','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','node-fetch','path'];(function(_0x5679d7,_0x564b0b){var _0x1b1edf=function(_0x55a68e){while(--_0x55a68e){_0x5679d7['push'](_0x5679d7['shift']());}};_0x1b1edf(++_0x564b0b);}(_0xe59a,0x19f));var _0xae59=function(_0x132be3,_0x375b4c){_0x132be3=_0x132be3-0x0;var _0x535bf0=_0xe59a[_0x132be3];return _0x535bf0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xae59('0x0'))('api');var moment=require(_0xae59('0x1'));var BPromise=require(_0xae59('0x2'));var rp=require('request-promise');var fetch=require(_0xae59('0x3'));var fs=require('fs');var path=require(_0xae59('0x4'));var rimraf=require(_0xae59('0x5'));var config=require('../../config/environment');var attributes=require(_0xae59('0x6'));module[_0xae59('0x7')]=function(_0x5a763c,_0x16b4d3){return _0x5a763c[_0xae59('0x8')](_0xae59('0x9'),attributes,{'tableName':_0xae59('0xa'),'paranoid':![],'indexes':[{'name':_0xae59('0xb'),'fields':[_0xae59('0xb')]},{'name':_0xae59('0xc'),'fields':[_0xae59('0xd')],'type':_0xae59('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x153d37,_0x1bdcdd,_0x4f70bc){var _0x3f102d=_0x5a763c[_0xae59('0xf')];var _0x555051=_0x153d37[_0xae59('0x10')]({'plain':!![]});if(_0x555051[_0xae59('0x11')]['toLowerCase']()==='in'||_0x555051[_0xae59('0x11')]['toLowerCase']()===_0xae59('0x12')&&!_0x555051[_0xae59('0x13')]&&!_[_0xae59('0x14')](_0x555051[_0xae59('0x15')])){_0x3f102d[_0xae59('0x16')]['findOne']({'where':{'id':_0x555051[_0xae59('0x17')]}})[_0xae59('0x18')](function(_0x56a9cf){if(_0x56a9cf){_0x56a9cf[_0xae59('0x19')]({'lastMsgAt':_0x555051[_0xae59('0x1a')],'lastMsgDirection':_0x555051[_0xae59('0x11')][_0xae59('0x1b')]()});}})['catch'](function(_0x47d684){console[_0xae59('0x1c')](_0x47d684);});}if(_0x555051[_0xae59('0x11')]===_0xae59('0x12')&&!_0x555051[_0xae59('0x13')]){var _0x2652cc;_0x3f102d['WhatsappAccount'][_0xae59('0x1d')]({'where':{'id':_0x555051[_0xae59('0x1e')]},'raw':!![]})[_0xae59('0x18')](function(_0x6d4967){_0x2652cc=_0x6d4967;if(_0x2652cc&&_0x2652cc[_0xae59('0x1f')]){switch(_0x2652cc[_0xae59('0x1f')]){case _0xae59('0x20'):var _0x553a49=require(_0xae59('0x20'));if(_0x2652cc[_0xae59('0x21')]&&_0x2652cc[_0xae59('0x22')]&&_0x2652cc['phone']){var _0x401e8d=new _0x553a49(_0x2652cc[_0xae59('0x21')],_0x2652cc[_0xae59('0x22')]);_0x401e8d['messages'][_0xae59('0x23')]({'body':_0x555051[_0xae59('0xd')],'to':_0xae59('0x24')+_0x555051[_0xae59('0x25')],'from':_0xae59('0x24')+_0x2652cc[_0xae59('0x25')],'statusCallback':_0x2652cc[_0xae59('0x26')]+_0xae59('0x27')+_0x555051['id']+_0xae59('0x28')+_0x2652cc[_0xae59('0x29')]})[_0xae59('0x18')](function(_0xcfb97a){if(_0xcfb97a['sid']){return _0x153d37[_0xae59('0x19')]({'messageId':_0xcfb97a[_0xae59('0x2a')]});}})[_0xae59('0x2b')](function(_0x438ba2){logger[_0xae59('0x1c')](_0xae59('0x2c'),'afterCreate',_0xae59('0x20'),util[_0xae59('0x2d')](_0x438ba2,{'showHidden':![],'depth':null}));});}else{logger[_0xae59('0x1c')](_0xae59('0x2c'),'afterCreate',_0xae59('0x20'),_0xae59('0x2e'));}break;case _0xae59('0x2f'):var _0x3127cb=_0x2652cc[_0xae59('0x21')];var _0x32d78b=_0x2652cc[_0xae59('0x22')];var _0x270253=_0x2652cc[_0xae59('0x30')]+_0xae59('0x31')+_0x3127cb+_0xae59('0x32');var _0x44e4cc={'to':[_0x555051[_0xae59('0x25')]],'message':{'type':'text','text':_0x555051[_0xae59('0xd')]}};var _0x252cad={'method':_0xae59('0x33'),'uri':_0x270253,'headers':{'Authorization':_0xae59('0x34')+_0x32d78b,'Content-Type':_0xae59('0x35')},'body':_0x44e4cc,'json':!![]};rp(_0x252cad)[_0xae59('0x18')](function(_0x74aa83){if(_0x74aa83[_0xae59('0x36')][0x0][_0xae59('0x37')]){return _0x153d37[_0xae59('0x19')]({'messageId':_0x74aa83['statuses'][0x0]['message_id']});}})[_0xae59('0x2b')](function(_0x230ffb){logger[_0xae59('0x38')]('WhatsappMessage,\x20%s',_0x230ffb);});break;}}})[_0xae59('0x39')](function(){_0x4f70bc();});}else{_0x4f70bc();}}},'charset':_0xae59('0x3a'),'collate':_0xae59('0x3b')});}; \ No newline at end of file +var _0x652f=['inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','/messages/','Bearer\x20','application/json','message_id','statuses','err','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','request-promise','node-fetch','path','../../config/environment','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','createdAt','catch','error','secret','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','phone','authToken','messages','whatsapp:','remote','/api/whatsapp/messages/','token','sid','update','WhatsappMessage,\x20%s,\x20%s,\x20%s'];(function(_0x539ce2,_0x54efa0){var _0x1c85b0=function(_0x3d82ac){while(--_0x3d82ac){_0x539ce2['push'](_0x539ce2['shift']());}};_0x1c85b0(++_0x54efa0);}(_0x652f,0xf1));var _0xf652=function(_0x47ef0c,_0x4b5af9){_0x47ef0c=_0x47ef0c-0x0;var _0x316487=_0x652f[_0x47ef0c];return _0x316487;};'use strict';var _=require('lodash');var util=require(_0xf652('0x0'));var logger=require('../../config/logger')(_0xf652('0x1'));var moment=require('moment');var BPromise=require(_0xf652('0x2'));var rp=require(_0xf652('0x3'));var fetch=require(_0xf652('0x4'));var fs=require('fs');var path=require(_0xf652('0x5'));var rimraf=require('rimraf');var config=require(_0xf652('0x6'));var attributes=require('./whatsappMessage.attributes');module[_0xf652('0x7')]=function(_0x3a9f56,_0x581d9f){return _0x3a9f56['define'](_0xf652('0x8'),attributes,{'tableName':_0xf652('0x9'),'paranoid':![],'indexes':[{'name':_0xf652('0xa'),'fields':[_0xf652('0xa')]},{'name':_0xf652('0xb'),'fields':[_0xf652('0xc')],'type':_0xf652('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5252df,_0x45e0ef,_0x4eb4d8){var _0x5f1c5b=_0x3a9f56[_0xf652('0xe')];var _0x55f800=_0x5252df[_0xf652('0xf')]({'plain':!![]});if(_0x55f800[_0xf652('0x10')][_0xf652('0x11')]()==='in'||_0x55f800[_0xf652('0x10')][_0xf652('0x11')]()===_0xf652('0x12')&&!_0x55f800['secret']&&!_[_0xf652('0x13')](_0x55f800[_0xf652('0x14')])){_0x5f1c5b[_0xf652('0x15')][_0xf652('0x16')]({'where':{'id':_0x55f800[_0xf652('0x17')]}})[_0xf652('0x18')](function(_0x350d75){if(_0x350d75){_0x350d75['update']({'lastMsgAt':_0x55f800[_0xf652('0x19')],'lastMsgDirection':_0x55f800['direction'][_0xf652('0x11')]()});}})[_0xf652('0x1a')](function(_0xeba63b){console[_0xf652('0x1b')](_0xeba63b);});}if(_0x55f800[_0xf652('0x10')]===_0xf652('0x12')&&!_0x55f800[_0xf652('0x1c')]){var _0x1e0e9c;_0x5f1c5b[_0xf652('0x1d')]['find']({'where':{'id':_0x55f800[_0xf652('0x1e')]},'raw':!![]})['then'](function(_0x253df4){_0x1e0e9c=_0x253df4;if(_0x1e0e9c&&_0x1e0e9c[_0xf652('0x1f')]){switch(_0x1e0e9c['type']){case'twilio':var _0xd3aed7=require(_0xf652('0x20'));if(_0x1e0e9c[_0xf652('0x21')]&&_0x1e0e9c['authToken']&&_0x1e0e9c[_0xf652('0x22')]){var _0x1364a2=new _0xd3aed7(_0x1e0e9c[_0xf652('0x21')],_0x1e0e9c[_0xf652('0x23')]);_0x1364a2[_0xf652('0x24')]['create']({'body':_0x55f800[_0xf652('0xc')],'to':_0xf652('0x25')+_0x55f800[_0xf652('0x22')],'from':'whatsapp:'+_0x1e0e9c[_0xf652('0x22')],'statusCallback':_0x1e0e9c[_0xf652('0x26')]+_0xf652('0x27')+_0x55f800['id']+'/status?token='+_0x1e0e9c[_0xf652('0x28')]})[_0xf652('0x18')](function(_0x48a77e){if(_0x48a77e[_0xf652('0x29')]){return _0x5252df[_0xf652('0x2a')]({'messageId':_0x48a77e[_0xf652('0x29')]});}})['catch'](function(_0x2aabf2){logger[_0xf652('0x1b')](_0xf652('0x2b'),'afterCreate',_0xf652('0x20'),util[_0xf652('0x2c')](_0x2aabf2,{'showHidden':![],'depth':null}));});}else{logger[_0xf652('0x1b')](_0xf652('0x2b'),'afterCreate',_0xf652('0x20'),_0xf652('0x2d'));}break;case _0xf652('0x2e'):var _0x27ee51=_0x1e0e9c[_0xf652('0x21')];var _0x2d429d=_0x1e0e9c[_0xf652('0x23')];var _0x1844ff=_0x1e0e9c['baseUrl']+_0xf652('0x2f')+_0x27ee51+_0xf652('0x30');var _0x58af51={'to':[_0x55f800[_0xf652('0x22')]],'message':{'type':'text','text':_0x55f800[_0xf652('0xc')]}};var _0x2aae32={'method':'POST','uri':_0x1844ff,'headers':{'Authorization':_0xf652('0x31')+_0x2d429d,'Content-Type':_0xf652('0x32')},'body':_0x58af51,'json':!![]};rp(_0x2aae32)['then'](function(_0x311543){if(_0x311543['statuses'][0x0][_0xf652('0x33')]){return _0x5252df[_0xf652('0x2a')]({'messageId':_0x311543[_0xf652('0x34')][0x0][_0xf652('0x33')]});}})['catch'](function(_0x282375){logger[_0xf652('0x35')](_0xf652('0x36'),_0x282375);});break;}}})['finally'](function(){_0x4eb4d8();});}else{_0x4eb4d8();}}},'charset':_0xf652('0x37'),'collate':_0xf652('0x38')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 14eb95a..339c169 100644 --- a/server/api/whatsappMessage/whatsappMessage.rpc.js +++ b/server/api/whatsappMessage/whatsappMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c3c=['localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','request\x20sent','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x510673,_0x4dcacd){var _0x492aaf=function(_0x365fba){while(--_0x365fba){_0x510673['push'](_0x510673['shift']());}};_0x492aaf(++_0x4dcacd);}(_0x0c3c,0x197));var _0xc0c3=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0x0c3c[_0x648163];return _0x199d4d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc0c3('0x0'));var BPromise=require(_0xc0c3('0x1'));var rs=require(_0xc0c3('0x2'));var fs=require('fs');var Redis=require(_0xc0c3('0x3'));var db=require(_0xc0c3('0x4'))['db'];var utils=require(_0xc0c3('0x5'));var logger=require('../../config/logger')(_0xc0c3('0x6'));var config=require(_0xc0c3('0x7'));var jayson=require(_0xc0c3('0x8'));var client=jayson[_0xc0c3('0x9')][_0xc0c3('0xa')]({'port':0x232a});config[_0xc0c3('0xb')]=_[_0xc0c3('0xc')](config[_0xc0c3('0xb')],{'host':_0xc0c3('0xd'),'port':0x18eb});var socket=require(_0xc0c3('0xe'))(new Redis(config[_0xc0c3('0xb')]));require(_0xc0c3('0xf'))[_0xc0c3('0x10')](socket);function respondWithRpcPromise(_0x2c5d16,_0x34b72c,_0x58694a){return new BPromise(function(_0x11765a,_0x236078){return client[_0xc0c3('0x11')](_0x2c5d16,_0x58694a)[_0xc0c3('0x12')](function(_0x1e264b){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x34b72c,_0xc0c3('0x13'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x34b72c,_0xc0c3('0x13'),JSON[_0xc0c3('0x14')](_0x1e264b));if(_0x1e264b[_0xc0c3('0x15')]){if(_0x1e264b[_0xc0c3('0x15')][_0xc0c3('0x16')]===0x1f4){logger['error'](_0xc0c3('0x17'),_0x34b72c,_0x1e264b[_0xc0c3('0x15')][_0xc0c3('0x18')]);return _0x236078(_0x1e264b[_0xc0c3('0x15')][_0xc0c3('0x18')]);}logger[_0xc0c3('0x15')](_0xc0c3('0x17'),_0x34b72c,_0x1e264b[_0xc0c3('0x15')][_0xc0c3('0x18')]);return _0x11765a(_0x1e264b[_0xc0c3('0x15')]['message']);}else{logger[_0xc0c3('0x19')](_0xc0c3('0x17'),_0x34b72c,_0xc0c3('0x13'));_0x11765a(_0x1e264b[_0xc0c3('0x1a')][_0xc0c3('0x18')]);}})[_0xc0c3('0x1b')](function(_0x156f0e){logger[_0xc0c3('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x34b72c,_0x156f0e);_0x236078(_0x156f0e);});});}exports[_0xc0c3('0x1c')]=function(_0x1830f6){var _0x1c9450=this;return new Promise(function(_0x1b7178,_0x5d8d2f){return db[_0xc0c3('0x1d')][_0xc0c3('0x1e')](_0x1830f6[_0xc0c3('0x1f')],{'raw':_0x1830f6[_0xc0c3('0x20')]?_0x1830f6[_0xc0c3('0x20')][_0xc0c3('0x21')]===undefined?!![]:![]:!![]})[_0xc0c3('0x12')](function(_0xfa7c73){logger[_0xc0c3('0x19')](_0xc0c3('0x1c'),_0x1830f6);logger[_0xc0c3('0x22')]('CreateWhatsappMessage',_0x1830f6,JSON[_0xc0c3('0x14')](_0xfa7c73));_0x1b7178(_0xfa7c73);})[_0xc0c3('0x1b')](function(_0xbf25e){logger['error'](_0xc0c3('0x1c'),_0xbf25e[_0xc0c3('0x18')],_0x1830f6);_0x5d8d2f(_0x1c9450[_0xc0c3('0x15')](0x1f4,_0xbf25e[_0xc0c3('0x18')]));});});}; \ No newline at end of file +var _0xd930=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappMessage.socket','request','info','request\x20sent','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','CreateWhatsappMessage','create','options','raw','then','debug','lodash'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0xd930,0xff));var _0x0d93=function(_0x117049,_0x46d729){_0x117049=_0x117049-0x0;var _0x5adfb4=_0xd930[_0x117049];return _0x5adfb4;};'use strict';var _=require(_0x0d93('0x0'));var util=require(_0x0d93('0x1'));var moment=require(_0x0d93('0x2'));var BPromise=require(_0x0d93('0x3'));var rs=require(_0x0d93('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d93('0x5'))['db'];var utils=require(_0x0d93('0x6'));var logger=require(_0x0d93('0x7'))(_0x0d93('0x8'));var config=require(_0x0d93('0x9'));var jayson=require(_0x0d93('0xa'));var client=jayson[_0x0d93('0xb')][_0x0d93('0xc')]({'port':0x232a});config[_0x0d93('0xd')]=_[_0x0d93('0xe')](config[_0x0d93('0xd')],{'host':_0x0d93('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0d93('0x10'))['register'](socket);function respondWithRpcPromise(_0x3ac8cf,_0x3c9b41,_0x559a38){return new BPromise(function(_0x263cf4,_0x294db9){return client[_0x0d93('0x11')](_0x3ac8cf,_0x559a38)['then'](function(_0x349d24){logger[_0x0d93('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x3c9b41,_0x0d93('0x13'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3c9b41,'request\x20sent',JSON[_0x0d93('0x14')](_0x349d24));if(_0x349d24[_0x0d93('0x15')]){if(_0x349d24[_0x0d93('0x15')][_0x0d93('0x16')]===0x1f4){logger[_0x0d93('0x15')](_0x0d93('0x17'),_0x3c9b41,_0x349d24[_0x0d93('0x15')]['message']);return _0x294db9(_0x349d24[_0x0d93('0x15')]['message']);}logger[_0x0d93('0x15')](_0x0d93('0x17'),_0x3c9b41,_0x349d24[_0x0d93('0x15')][_0x0d93('0x18')]);return _0x263cf4(_0x349d24['error'][_0x0d93('0x18')]);}else{logger[_0x0d93('0x12')](_0x0d93('0x17'),_0x3c9b41,_0x0d93('0x13'));_0x263cf4(_0x349d24[_0x0d93('0x19')][_0x0d93('0x18')]);}})['catch'](function(_0x202b4e){logger[_0x0d93('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x3c9b41,_0x202b4e);_0x294db9(_0x202b4e);});});}exports[_0x0d93('0x1a')]=function(_0xf50670){var _0x37c4ae=this;return new Promise(function(_0x40aaf4,_0x24ffd6){return db['WhatsappMessage'][_0x0d93('0x1b')](_0xf50670['body'],{'raw':_0xf50670['options']?_0xf50670[_0x0d93('0x1c')][_0x0d93('0x1d')]===undefined?!![]:![]:!![]})[_0x0d93('0x1e')](function(_0x42c89b){logger[_0x0d93('0x12')](_0x0d93('0x1a'),_0xf50670);logger[_0x0d93('0x1f')]('CreateWhatsappMessage',_0xf50670,JSON[_0x0d93('0x14')](_0x42c89b));_0x40aaf4(_0x42c89b);})['catch'](function(_0x1fb67c){logger[_0x0d93('0x15')]('CreateWhatsappMessage',_0x1fb67c['message'],_0xf50670);_0x24ffd6(_0x37c4ae[_0x0d93('0x15')](0x1f4,_0x1fb67c['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 8303626..65095f2 100644 --- a/server/api/whatsappMessage/whatsappMessage.socket.js +++ b/server/api/whatsappMessage/whatsappMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b6b=['removeListener','register','whatsappMessage:','./whatsappMessage.events','remove','update','emit'];(function(_0x3ceb7b,_0x4b6fcf){var _0x244fec=function(_0x1fc4a7){while(--_0x1fc4a7){_0x3ceb7b['push'](_0x3ceb7b['shift']());}};_0x244fec(++_0x4b6fcf);}(_0x5b6b,0x6c));var _0xb5b6=function(_0x3007a4,_0x411c1f){_0x3007a4=_0x3007a4-0x0;var _0x3c96a4=_0x5b6b[_0x3007a4];return _0x3c96a4;};'use strict';var WhatsappMessageEvents=require(_0xb5b6('0x0'));var events=['save',_0xb5b6('0x1'),_0xb5b6('0x2')];function createListener(_0x253711,_0xa6bdde){return function(_0x27c752){_0xa6bdde[_0xb5b6('0x3')](_0x253711,_0x27c752);};}function removeListener(_0x121c2c,_0x40fccd){return function(){WhatsappMessageEvents[_0xb5b6('0x4')](_0x121c2c,_0x40fccd);};}exports[_0xb5b6('0x5')]=function(_0x17e015){for(var _0x52c75d=0x0,_0x17d32e=events['length'];_0x52c75d<_0x17d32e;_0x52c75d++){var _0x3b5ebc=events[_0x52c75d];var _0x386ef1=createListener(_0xb5b6('0x6')+_0x3b5ebc,_0x17e015);WhatsappMessageEvents['on'](_0x3b5ebc,_0x386ef1);}}; \ No newline at end of file +var _0x86e0=['remove','update','emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save'];(function(_0x366511,_0x55abe4){var _0x3169e9=function(_0xa100d4){while(--_0xa100d4){_0x366511['push'](_0x366511['shift']());}};_0x3169e9(++_0x55abe4);}(_0x86e0,0x142));var _0x086e=function(_0x2ee8c9,_0x591d80){_0x2ee8c9=_0x2ee8c9-0x0;var _0x33e880=_0x86e0[_0x2ee8c9];return _0x33e880;};'use strict';var WhatsappMessageEvents=require(_0x086e('0x0'));var events=[_0x086e('0x1'),_0x086e('0x2'),_0x086e('0x3')];function createListener(_0x27b5a9,_0x8b774c){return function(_0x32a4bc){_0x8b774c[_0x086e('0x4')](_0x27b5a9,_0x32a4bc);};}function removeListener(_0x34bf32,_0x249415){return function(){WhatsappMessageEvents[_0x086e('0x5')](_0x34bf32,_0x249415);};}exports[_0x086e('0x6')]=function(_0x195301){for(var _0x5298a0=0x0,_0x5900d6=events[_0x086e('0x7')];_0x5298a0<_0x5900d6;_0x5298a0++){var _0x27d8be=events[_0x5298a0];var _0x2528c9=createListener(_0x086e('0x8')+_0x27d8be,_0x195301);WhatsappMessageEvents['on'](_0x27d8be,_0x2528c9);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index aaefd8c..e1f5672 100644 --- a/server/api/whatsappQueue/index.js +++ b/server/api/whatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5540=['/:id','isAuthenticated','/:id/members','getMembers','/:id/users','getAgents','post','/:id/teams','update','destroy','delete','removeTeams','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0xd206ce,_0x3031d2){var _0x5b3ec6=function(_0x526993){while(--_0x526993){_0xd206ce['push'](_0xd206ce['shift']());}};_0x5b3ec6(++_0x3031d2);}(_0x5540,0x12a));var _0x0554=function(_0x369a03,_0x24528c){_0x369a03=_0x369a03-0x0;var _0x4a2329=_0x5540[_0x369a03];return _0x4a2329;};'use strict';var multer=require(_0x0554('0x0'));var util=require(_0x0554('0x1'));var path=require(_0x0554('0x2'));var timeout=require('connect-timeout');var express=require(_0x0554('0x3'));var router=express[_0x0554('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0554('0x5'));var interaction=require(_0x0554('0x6'));var config=require(_0x0554('0x7'));var controller=require('./whatsappQueue.controller');router[_0x0554('0x8')]('/',auth['isAuthenticated'](),controller[_0x0554('0x9')]);router[_0x0554('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x0554('0x8')](_0x0554('0xa'),auth[_0x0554('0xb')](),controller['show']);router[_0x0554('0x8')](_0x0554('0xc'),auth[_0x0554('0xb')](),controller[_0x0554('0xd')]);router['get']('/:id/teams',auth[_0x0554('0xb')](),controller['getTeams']);router['get'](_0x0554('0xe'),auth['isAuthenticated'](),controller[_0x0554('0xf')]);router[_0x0554('0x10')]('/',auth[_0x0554('0xb')](),controller['create']);router['post'](_0x0554('0x11'),auth[_0x0554('0xb')](),controller['addTeams']);router[_0x0554('0x10')](_0x0554('0xe'),auth[_0x0554('0xb')](),controller['addAgents']);router['put'](_0x0554('0xa'),auth[_0x0554('0xb')](),controller[_0x0554('0x12')]);router['delete'](_0x0554('0xa'),auth[_0x0554('0xb')](),controller[_0x0554('0x13')]);router[_0x0554('0x14')](_0x0554('0x11'),auth[_0x0554('0xb')](),controller[_0x0554('0x15')]);router[_0x0554('0x14')](_0x0554('0xe'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xb5fc=['removeAgents','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','/:id','update','delete','removeTeams'];(function(_0x12ce42,_0x5eb1b2){var _0x52e005=function(_0x37ed99){while(--_0x37ed99){_0x12ce42['push'](_0x12ce42['shift']());}};_0x52e005(++_0x5eb1b2);}(_0xb5fc,0x88));var _0xcb5f=function(_0x3699a8,_0x17e64d){_0x3699a8=_0x3699a8-0x0;var _0x59c306=_0xb5fc[_0x3699a8];return _0x59c306;};'use strict';var multer=require('multer');var util=require(_0xcb5f('0x0'));var path=require(_0xcb5f('0x1'));var timeout=require(_0xcb5f('0x2'));var express=require(_0xcb5f('0x3'));var router=express[_0xcb5f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcb5f('0x5'));var interaction=require(_0xcb5f('0x6'));var config=require(_0xcb5f('0x7'));var controller=require(_0xcb5f('0x8'));router[_0xcb5f('0x9')]('/',auth[_0xcb5f('0xa')](),controller['index']);router[_0xcb5f('0x9')]('/describe',auth[_0xcb5f('0xa')](),controller[_0xcb5f('0xb')]);router[_0xcb5f('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xcb5f('0xc')]);router[_0xcb5f('0x9')](_0xcb5f('0xd'),auth[_0xcb5f('0xa')](),controller[_0xcb5f('0xe')]);router[_0xcb5f('0x9')](_0xcb5f('0xf'),auth[_0xcb5f('0xa')](),controller['getTeams']);router[_0xcb5f('0x9')](_0xcb5f('0x10'),auth[_0xcb5f('0xa')](),controller[_0xcb5f('0x11')]);router[_0xcb5f('0x12')]('/',auth[_0xcb5f('0xa')](),controller[_0xcb5f('0x13')]);router['post']('/:id/teams',auth[_0xcb5f('0xa')](),controller['addTeams']);router[_0xcb5f('0x12')](_0xcb5f('0x10'),auth[_0xcb5f('0xa')](),controller[_0xcb5f('0x14')]);router[_0xcb5f('0x15')](_0xcb5f('0x16'),auth['isAuthenticated'](),controller[_0xcb5f('0x17')]);router[_0xcb5f('0x18')](_0xcb5f('0x16'),auth[_0xcb5f('0xa')](),controller['destroy']);router['delete'](_0xcb5f('0xf'),auth[_0xcb5f('0xa')](),controller[_0xcb5f('0x19')]);router[_0xcb5f('0x18')](_0xcb5f('0x10'),auth[_0xcb5f('0xa')](),controller[_0xcb5f('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 57ede58..2558a22 100644 --- a/server/api/whatsappQueue/whatsappQueue.attributes.js +++ b/server/api/whatsappQueue/whatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf93=['STRING','sequelize','exports','INTEGER','ENUM','beepall','roundrobin'];(function(_0xeff2c3,_0x3a5a82){var _0x2cade6=function(_0x5a26a1){while(--_0x5a26a1){_0xeff2c3['push'](_0xeff2c3['shift']());}};_0x2cade6(++_0x3a5a82);}(_0xaf93,0x151));var _0x3af9=function(_0x325ff5,_0x46dca7){_0x325ff5=_0x325ff5-0x0;var _0x32ccc8=_0xaf93[_0x325ff5];return _0x32ccc8;};'use strict';var Sequelize=require(_0x3af9('0x0'));module[_0x3af9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x3af9('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3af9('0x3')]('rrmemory',_0x3af9('0x4'),_0x3af9('0x5'))},'description':{'type':Sequelize[_0x3af9('0x6')]}}; \ No newline at end of file +var _0xf197=['sequelize','exports','STRING','ENUM'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xf197,0x130));var _0x7f19=function(_0x4fde14,_0x10431b){_0x4fde14=_0x4fde14-0x0;var _0x5bbbd5=_0xf197[_0x4fde14];return _0x5bbbd5;};'use strict';var Sequelize=require(_0x7f19('0x0'));module[_0x7f19('0x1')]={'name':{'type':Sequelize[_0x7f19('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7f19('0x3')]('rrmemory','beepall','roundrobin')},'description':{'type':Sequelize[_0x7f19('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 4aff78e..f01c3b1 100644 --- a/server/api/whatsappQueue/whatsappQueue.controller.js +++ b/server/api/whatsappQueue/whatsappQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e3e=['util','lodash','squel','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','get','UserProfileResource','stack','name','send','map','WhatsappQueue','rawAttributes','type','getOptions','where','include','query','findAll','rows','catch','params','keys','filters','model','attributes','fields','length','includeAll','merge','options','find','create','body','user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','intersection','nolimit','order','sort','pick','filter','UserWhatsappQueue','findAndCountAll','agent','whatsappPause','createdAt','format','%s/%s','SIP','updatedAt','findOne','Team','getTeams','hasOwnProperty','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userWhatsappQueue:save','ids','User','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','all','union','compact','value','removeTeams','isEmpty','removeAgents','addAgents','omit','spread','userWhatsappQueue:remove','getAgents','bluebird'];(function(_0x2db667,_0x193cf5){var _0x83ff9=function(_0x5da022){while(--_0x5da022){_0x2db667['push'](_0x2db667['shift']());}};_0x83ff9(++_0x193cf5);}(_0x1e3e,0x167));var _0xe1e3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1e3e[_0x122ef9];return _0x42fba0;};'use strict';var BPromise=require(_0xe1e3('0x0'));var util=require(_0xe1e3('0x1'));var _=require(_0xe1e3('0x2'));var squel=require(_0xe1e3('0x3'));var Redis=require('ioredis');var qs=require(_0xe1e3('0x4'));var logger=require(_0xe1e3('0x5'))('api');var config=require(_0xe1e3('0x6'));var db=require(_0xe1e3('0x7'))['db'];config[_0xe1e3('0x8')]=_[_0xe1e3('0x9')](config[_0xe1e3('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xe1e3('0xa'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0xe1e3('0xb')](socket);function respondWithStatusCode(_0x281be2,_0x5deff3){_0x5deff3=_0x5deff3||0xcc;return function(_0x3690af){if(_0x3690af){return _0x281be2[_0xe1e3('0xc')](_0x5deff3);}return _0x281be2[_0xe1e3('0xd')](_0x5deff3)[_0xe1e3('0xe')]();};}function respondWithResult(_0xfcda9d,_0x268710){_0x268710=_0x268710||0xc8;return function(_0x2f1285){if(_0x2f1285){return _0xfcda9d[_0xe1e3('0xd')](_0x268710)['json'](_0x2f1285);}};}function respondWithFilteredResult(_0x30203a,_0x3d429c){return function(_0x2fd485){if(_0x2fd485){var _0x57f3e7=typeof _0x3d429c[_0xe1e3('0xf')]===_0xe1e3('0x10')&&typeof _0x3d429c[_0xe1e3('0x11')]===_0xe1e3('0x10');var _0x2598c0=_0x2fd485['count'];var _0x749723=_0x57f3e7?0x0:_0x3d429c['offset'];var _0x53c934=_0x57f3e7?_0x2fd485[_0xe1e3('0x12')]:_0x3d429c[_0xe1e3('0xf')]+_0x3d429c[_0xe1e3('0x11')];var _0x11f8c9;if(_0x53c934>=_0x2598c0){_0x53c934=_0x2598c0;_0x11f8c9=0xc8;}else{_0x11f8c9=0xce;}_0x30203a[_0xe1e3('0xd')](_0x11f8c9);return _0x30203a[_0xe1e3('0x13')](_0xe1e3('0x14'),_0x749723+'-'+_0x53c934+'/'+_0x2598c0)[_0xe1e3('0x15')](_0x2fd485);}return null;};}function saveUpdates(_0x8c8573){return function(_0x5b67ec){if(_0x5b67ec){return _0x5b67ec[_0xe1e3('0x16')](_0x8c8573)[_0xe1e3('0x17')](function(_0x579eaf){return _0x579eaf;});}return null;};}function removeEntity(_0xd64ad2){return function(_0xb1bfb){if(_0xb1bfb){return _0xb1bfb[_0xe1e3('0x18')]()[_0xe1e3('0x17')](function(){var _0x1ff125=_0xb1bfb[_0xe1e3('0x19')]({'plain':!![]});var _0x25a716='WhatsappQueues';return db[_0xe1e3('0x1a')][_0xe1e3('0x18')]({'where':{'type':_0x25a716,'resourceId':_0x1ff125['id']}})['then'](function(){return _0xb1bfb;});})['then'](function(){_0xd64ad2[_0xe1e3('0xd')](0xcc)[_0xe1e3('0xe')]();});}};}function handleEntityNotFound(_0x539182){return function(_0x31fc53){if(!_0x31fc53){_0x539182['sendStatus'](0x194);}return _0x31fc53;};}function handleError(_0x4eafa4,_0x1abde8){_0x1abde8=_0x1abde8||0x1f4;return function(_0x3c6073){logger['error'](_0x3c6073[_0xe1e3('0x1b')]);if(_0x3c6073['name']){delete _0x3c6073[_0xe1e3('0x1c')];}_0x4eafa4['status'](_0x1abde8)[_0xe1e3('0x1d')](_0x3c6073);};}exports['index']=function(_0x2d781c,_0x803aa4){var _0x331c1c={};var _0x846c6={'count':0x0,'rows':[]};var _0x4973fd=_[_0xe1e3('0x1e')](db[_0xe1e3('0x1f')][_0xe1e3('0x20')],function(_0x33f8bd){return{'name':_0x33f8bd['fieldName'],'type':_0x33f8bd[_0xe1e3('0x21')]['key']};});_0x331c1c=qs[_0xe1e3('0x22')](_0x4973fd,_0x2d781c);var _0x266c68={'where':_0x331c1c[_0xe1e3('0x23')]};return db[_0xe1e3('0x1f')][_0xe1e3('0x12')](_0x266c68)['then'](function(_0x1507e0){_0x846c6[_0xe1e3('0x12')]=_0x1507e0;_0x331c1c['include']=qs[_0xe1e3('0x24')](_0x2d781c[_0xe1e3('0x25')]);return db['WhatsappQueue'][_0xe1e3('0x26')](_0x331c1c);})['then'](function(_0x272a24){_0x846c6[_0xe1e3('0x27')]=_0x272a24;return _0x846c6;})[_0xe1e3('0x17')](respondWithFilteredResult(_0x803aa4,_0x331c1c))[_0xe1e3('0x28')](handleError(_0x803aa4,null));};exports['show']=function(_0xf28d77,_0x55f53f){var _0x23e3f1={'raw':!![],'where':{'id':_0xf28d77[_0xe1e3('0x29')]['id']}},_0x16cf2e={};_0x16cf2e['model']=_[_0xe1e3('0x2a')](db[_0xe1e3('0x1f')][_0xe1e3('0x20')]);_0x16cf2e['query']=_['keys'](_0xf28d77['query']);_0x16cf2e[_0xe1e3('0x2b')]=_['intersection'](_0x16cf2e[_0xe1e3('0x2c')],_0x16cf2e[_0xe1e3('0x25')]);_0x23e3f1[_0xe1e3('0x2d')]=_['intersection'](_0x16cf2e[_0xe1e3('0x2c')],qs[_0xe1e3('0x2e')](_0xf28d77[_0xe1e3('0x25')][_0xe1e3('0x2e')]));_0x23e3f1[_0xe1e3('0x2d')]=_0x23e3f1['attributes'][_0xe1e3('0x2f')]?_0x23e3f1[_0xe1e3('0x2d')]:_0x16cf2e[_0xe1e3('0x2c')];if(_0xf28d77[_0xe1e3('0x25')][_0xe1e3('0x30')]){_0x23e3f1['include']=[{'all':!![]}];}_0x23e3f1=_[_0xe1e3('0x31')]({},_0x23e3f1,_0xf28d77[_0xe1e3('0x32')]);return db[_0xe1e3('0x1f')][_0xe1e3('0x33')](_0x23e3f1)[_0xe1e3('0x17')](handleEntityNotFound(_0x55f53f,null))[_0xe1e3('0x17')](respondWithResult(_0x55f53f,null))[_0xe1e3('0x28')](handleError(_0x55f53f,null));};exports[_0xe1e3('0x34')]=function(_0x591386,_0x261769){return db[_0xe1e3('0x1f')][_0xe1e3('0x34')](_0x591386[_0xe1e3('0x35')],{})['then'](function(_0x3b4d67){var _0x3b91a9=_0x591386[_0xe1e3('0x36')]['get']({'plain':!![]});if(!_0x3b91a9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b91a9[_0xe1e3('0x37')]===_0xe1e3('0x36')){var _0x2b543e=_0x3b4d67[_0xe1e3('0x19')]({'plain':!![]});var _0x16fb95='WhatsappQueues';return db[_0xe1e3('0x38')][_0xe1e3('0x33')]({'where':{'name':_0x16fb95,'userProfileId':_0x3b91a9['userProfileId']},'raw':!![]})[_0xe1e3('0x17')](function(_0x22b489){if(_0x22b489&&_0x22b489[_0xe1e3('0x39')]===0x0){return db[_0xe1e3('0x1a')][_0xe1e3('0x34')]({'name':_0x2b543e[_0xe1e3('0x1c')],'resourceId':_0x2b543e['id'],'type':_0x22b489['name'],'sectionId':_0x22b489['id']},{})[_0xe1e3('0x17')](function(){return _0x3b4d67;});}else{return _0x3b4d67;}})[_0xe1e3('0x28')](function(_0x28b1b7){logger[_0xe1e3('0x3a')](_0xe1e3('0x3b'),_0x28b1b7);throw _0x28b1b7;});}return _0x3b4d67;})[_0xe1e3('0x17')](respondWithResult(_0x261769,0xc9))['catch'](handleError(_0x261769,null));};exports[_0xe1e3('0x16')]=function(_0x1b44fd,_0x5e2b09){if(_0x1b44fd['body']['id']){delete _0x1b44fd['body']['id'];}return db[_0xe1e3('0x1f')][_0xe1e3('0x33')]({'where':{'id':_0x1b44fd[_0xe1e3('0x29')]['id']}})[_0xe1e3('0x17')](handleEntityNotFound(_0x5e2b09,null))[_0xe1e3('0x17')](saveUpdates(_0x1b44fd[_0xe1e3('0x35')],null))[_0xe1e3('0x17')](respondWithResult(_0x5e2b09,null))['catch'](handleError(_0x5e2b09,null));};exports[_0xe1e3('0x18')]=function(_0x5c4b65,_0x24b18d){return db[_0xe1e3('0x1f')][_0xe1e3('0x33')]({'where':{'id':_0x5c4b65['params']['id']}})[_0xe1e3('0x17')](handleEntityNotFound(_0x24b18d,null))[_0xe1e3('0x17')](removeEntity(_0x24b18d,null))[_0xe1e3('0x28')](handleError(_0x24b18d,null));};exports[_0xe1e3('0x3c')]=function(_0x43e295,_0x3b18cc){return db['WhatsappQueue'][_0xe1e3('0x3c')]()[_0xe1e3('0x17')](respondWithResult(_0x3b18cc,null))['catch'](handleError(_0x3b18cc,null));};exports[_0xe1e3('0x3d')]=function(_0x4f5bfe,_0x1465b1){var _0x33f2f1={'raw':!![],'where':{}},_0x4b45c5={},_0x483bf1;return db[_0xe1e3('0x1f')]['findOne']({'where':{'id':_0x4f5bfe[_0xe1e3('0x29')]['id']}})[_0xe1e3('0x17')](handleEntityNotFound(_0x1465b1,null))['then'](function(_0x1dd30e){if(_0x1dd30e){_0x483bf1=_0x1dd30e[_0xe1e3('0x19')]({'plain':!![]});_0x4b45c5[_0xe1e3('0x2c')]=_[_0xe1e3('0x2a')](db['UserWhatsappQueue'][_0xe1e3('0x20')]);_0x4b45c5['query']=_[_0xe1e3('0x2a')](_0x4f5bfe['query']);_0x4b45c5[_0xe1e3('0x2b')]=_['intersection'](_0x4b45c5[_0xe1e3('0x2c')],_0x4b45c5[_0xe1e3('0x25')]);_0x33f2f1[_0xe1e3('0x2d')]=_[_0xe1e3('0x3e')](_0x4b45c5[_0xe1e3('0x2c')],qs[_0xe1e3('0x2e')](_0x4f5bfe[_0xe1e3('0x25')][_0xe1e3('0x2e')]));_0x33f2f1[_0xe1e3('0x2d')]=_0x33f2f1['attributes'][_0xe1e3('0x2f')]?_0x33f2f1['attributes']:_0x4b45c5[_0xe1e3('0x2c')];if(!_0x4f5bfe[_0xe1e3('0x25')]['hasOwnProperty'](_0xe1e3('0x3f'))){_0x33f2f1[_0xe1e3('0x11')]=qs[_0xe1e3('0x11')](_0x4f5bfe[_0xe1e3('0x25')]['limit']);_0x33f2f1[_0xe1e3('0xf')]=qs[_0xe1e3('0xf')](_0x4f5bfe[_0xe1e3('0x25')][_0xe1e3('0xf')]);}_0x33f2f1[_0xe1e3('0x40')]=qs['sort'](_0x4f5bfe['query'][_0xe1e3('0x41')]);_0x33f2f1[_0xe1e3('0x23')]=qs['filters'](_[_0xe1e3('0x42')](_0x4f5bfe[_0xe1e3('0x25')],_0x4b45c5[_0xe1e3('0x2b')]));_0x33f2f1[_0xe1e3('0x23')]['WhatsappQueueId']=_0x1dd30e['id'];if(_0x4f5bfe[_0xe1e3('0x25')]['filter']){_0x33f2f1[_0xe1e3('0x23')]=_[_0xe1e3('0x31')](_0x33f2f1[_0xe1e3('0x23')],{'$or':_[_0xe1e3('0x1e')](_0x33f2f1['attributes'],function(_0x43bada){var _0x453112={};_0x453112[_0x43bada]={'$like':'%'+_0x4f5bfe['query'][_0xe1e3('0x43')]+'%'};return _0x453112;})});}_0x33f2f1=_[_0xe1e3('0x31')]({},_0x33f2f1,_0x4f5bfe[_0xe1e3('0x32')]);return db[_0xe1e3('0x44')]['findAll'](_0x33f2f1);}})[_0xe1e3('0x17')](function(_0x36f26a){if(_0x36f26a){return db['User'][_0xe1e3('0x45')]({'where':{'id':_[_0xe1e3('0x1e')](_0x36f26a,'UserId'),'role':_0xe1e3('0x46')},'attributes':['id',_0xe1e3('0x1c'),_0xe1e3('0x47'),'updatedAt',_0xe1e3('0x48')]});}})[_0xe1e3('0x17')](function(_0x3ea11b){if(_0x3ea11b){return{'count':_0x3ea11b[_0xe1e3('0x12')],'rows':_[_0xe1e3('0x1e')](_0x3ea11b['rows'],function(_0x248434){return{'membername':_0x248434[_0xe1e3('0x1c')],'UserId':_0x248434['id'],'queue_name':_0x483bf1[_0xe1e3('0x1c')],'WhatsappQueueId':_0x483bf1['id'],'interface':util[_0xe1e3('0x49')](_0xe1e3('0x4a'),_0xe1e3('0x4b'),_0x248434['name']),'penalty':0x0,'paused':_0x248434[_0xe1e3('0x47')],'createdAt':_0x248434[_0xe1e3('0x48')],'updatedAt':_0x248434[_0xe1e3('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe1e3('0x17')](respondWithFilteredResult(_0x1465b1,_0x33f2f1))[_0xe1e3('0x28')](handleError(_0x1465b1,null));};exports['getTeams']=function(_0x53808f,_0x14b81c){var _0x1f422d={};var _0x3ef58b={};var _0x5c7348;var _0x47355a;return db[_0xe1e3('0x1f')][_0xe1e3('0x4d')]({'where':{'id':_0x53808f[_0xe1e3('0x29')]['id']}})[_0xe1e3('0x17')](handleEntityNotFound(_0x14b81c,null))[_0xe1e3('0x17')](function(_0x5a51ab){if(_0x5a51ab){_0x5c7348=_0x5a51ab;_0x3ef58b[_0xe1e3('0x2c')]=_[_0xe1e3('0x2a')](db[_0xe1e3('0x4e')][_0xe1e3('0x20')]);_0x3ef58b['query']=_['keys'](_0x53808f[_0xe1e3('0x25')]);_0x3ef58b[_0xe1e3('0x2b')]=_[_0xe1e3('0x3e')](_0x3ef58b[_0xe1e3('0x2c')],_0x3ef58b[_0xe1e3('0x25')]);_0x1f422d[_0xe1e3('0x2d')]=_['intersection'](_0x3ef58b[_0xe1e3('0x2c')],qs[_0xe1e3('0x2e')](_0x53808f[_0xe1e3('0x25')][_0xe1e3('0x2e')]));_0x1f422d[_0xe1e3('0x2d')]=_0x1f422d[_0xe1e3('0x2d')][_0xe1e3('0x2f')]?_0x1f422d[_0xe1e3('0x2d')]:_0x3ef58b[_0xe1e3('0x2c')];_0x1f422d[_0xe1e3('0x40')]=qs[_0xe1e3('0x41')](_0x53808f[_0xe1e3('0x25')][_0xe1e3('0x41')]);_0x1f422d[_0xe1e3('0x23')]=qs[_0xe1e3('0x2b')](_[_0xe1e3('0x42')](_0x53808f['query'],_0x3ef58b['filters']));if(_0x53808f[_0xe1e3('0x25')][_0xe1e3('0x43')]){_0x1f422d[_0xe1e3('0x23')]=_['merge'](_0x1f422d[_0xe1e3('0x23')],{'$or':_[_0xe1e3('0x1e')](_0x1f422d[_0xe1e3('0x2d')],function(_0x2da465){var _0x555fa2={};_0x555fa2[_0x2da465]={'$like':'%'+_0x53808f[_0xe1e3('0x25')]['filter']+'%'};return _0x555fa2;})});}_0x1f422d=_[_0xe1e3('0x31')]({},_0x1f422d,_0x53808f[_0xe1e3('0x32')]);return _0x5c7348[_0xe1e3('0x4f')](_0x1f422d);}})[_0xe1e3('0x17')](function(_0xcd15ba){if(_0xcd15ba){_0x47355a=_0xcd15ba['length'];if(!_0x53808f[_0xe1e3('0x25')][_0xe1e3('0x50')](_0xe1e3('0x3f'))){_0x1f422d['limit']=qs[_0xe1e3('0x11')](_0x53808f['query'][_0xe1e3('0x11')]);_0x1f422d['offset']=qs[_0xe1e3('0xf')](_0x53808f[_0xe1e3('0x25')][_0xe1e3('0xf')]);}return _0x5c7348[_0xe1e3('0x4f')](_0x1f422d);}})[_0xe1e3('0x17')](function(_0x29259d){if(_0x29259d){return _0x29259d?{'count':_0x47355a,'rows':_0x29259d}:null;}})['then'](respondWithResult(_0x14b81c,null))[_0xe1e3('0x28')](handleError(_0x14b81c,null));};exports['addTeams']=function(_0x54de9f,_0x3d1300){var _0x2a4d0e=_0x54de9f[_0xe1e3('0x35')]['ids'];return db[_0xe1e3('0x4e')][_0xe1e3('0x26')]({'where':{'id':_0x2a4d0e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe1e3('0x51'),'attributes':['id',_0xe1e3('0x1c'),_0xe1e3('0x52'),'voicePause',_0xe1e3('0x53')],'raw':!![]}]})[_0xe1e3('0x17')](function(_0x469e67){if(_0x469e67){var _0x32db70=_[_0xe1e3('0x54')](_0x469e67,function(_0x34e91c){var _0x4eb609=_0x34e91c[_0xe1e3('0x19')]({'plain':!![]});return _0x4eb609['Agents'];});return db[_0xe1e3('0x1f')][_0xe1e3('0x33')]({'where':{'id':_0x54de9f['params']['id']}})[_0xe1e3('0x17')](function(_0x555e2f){return db[_0xe1e3('0x55')][_0xe1e3('0x56')](function(_0x1b3988){return _0x555e2f[_0xe1e3('0x57')](_0x2a4d0e,{'transaction':_0x1b3988})[_0xe1e3('0x17')](function(){return BPromise[_0xe1e3('0x58')](_0x32db70,function(_0x262cd4){return db[_0xe1e3('0x44')][_0xe1e3('0x59')]({'where':{'UserId':_0x262cd4['id'],'WhatsappQueueId':_0x54de9f['params']['id']},'transaction':_0x1b3988});});})[_0xe1e3('0x17')](function(){_0x32db70[_0xe1e3('0x5a')](function(_0x38e98d){socket[_0xe1e3('0x5b')](_0xe1e3('0x5c'),{'UserId':_0x38e98d['id'],'WhatsappQueueId':_0x555e2f['id']});});});});});}})[_0xe1e3('0x17')](respondWithStatusCode(_0x3d1300,null))['catch'](handleError(_0x3d1300,null));};exports['removeTeams']=function(_0x441b3c,_0x202023){return db[_0xe1e3('0x4e')][_0xe1e3('0x26')]({'where':{'id':_0x441b3c[_0xe1e3('0x25')][_0xe1e3('0x5d')]},'attributes':['id'],'include':[{'model':db[_0xe1e3('0x5e')],'as':_0xe1e3('0x51'),'attributes':['id'],'raw':!![]}]})[_0xe1e3('0x17')](handleEntityNotFound(_0x202023,null))['then'](function(_0x293a99){var _0x4aafe2=_[_0xe1e3('0x1e')](_0x293a99,'id');var _0x44c633=[];var _0x16274e=[];var _0x3926de=squel['select']();_0x3926de[_0xe1e3('0x5f')](_0xe1e3('0x60'))[_0xe1e3('0x61')](_0xe1e3('0x62'),'tq')[_0xe1e3('0x63')](_0xe1e3('0x64'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe1e3('0x23')](_0xe1e3('0x65'),_0x441b3c[_0xe1e3('0x29')]['id']);for(var _0xf64177=0x0;_0xf64177<_0x293a99[_0xe1e3('0x2f')];_0xf64177+=0x1){let _0x4b3288=_0x293a99[_0xf64177];for(var _0x17fe3d=0x0;_0x17fe3d<_0x4b3288[_0xe1e3('0x51')][_0xe1e3('0x2f')];_0x17fe3d+=0x1){let _0x554e57=_0x4b3288[_0xe1e3('0x51')][_0x17fe3d];var _0x34324d=_0x3926de[_0xe1e3('0x66')]();_0x34324d[_0xe1e3('0x23')](_0xe1e3('0x67'),_0x554e57['id']);_0x16274e[_0xe1e3('0x68')](db[_0xe1e3('0x55')][_0xe1e3('0x25')](_0x34324d['toString'](),{'type':db[_0xe1e3('0x55')]['QueryTypes'][_0xe1e3('0x69')]})[_0xe1e3('0x17')](function(_0x5a7960){if(_0x5a7960[_0xe1e3('0x2f')]===0x1){return _0x554e57['id'];}else{var _0x5aaa9c=_[_0xe1e3('0x6a')](_['map'](_0x5a7960,_0xe1e3('0x6b')),function(_0x559d5b){return _['includes'](_0x4aafe2,_0x559d5b);});if(_0x5aaa9c){return _0x554e57['id'];}}}));}}return BPromise[_0xe1e3('0x6c')](_0x16274e)[_0xe1e3('0x17')](function(_0x1bc617){_0x44c633=_(_0x44c633)[_0xe1e3('0x6d')](_0x1bc617)[_0xe1e3('0x6e')]()[_0xe1e3('0x6f')]();return db[_0xe1e3('0x1f')][_0xe1e3('0x33')]({'where':{'id':_0x441b3c[_0xe1e3('0x29')]['id']}})[_0xe1e3('0x17')](function(_0x5570bc){return db[_0xe1e3('0x55')]['transaction'](function(_0x2934d3){return _0x5570bc[_0xe1e3('0x70')](_0x441b3c[_0xe1e3('0x25')][_0xe1e3('0x5d')],{'transaction':_0x2934d3})[_0xe1e3('0x17')](function(){if(!_[_0xe1e3('0x71')](_0x44c633)){return _0x5570bc[_0xe1e3('0x72')](_0x44c633,{'transaction':_0x2934d3});}})[_0xe1e3('0x17')](function(){_0x44c633[_0xe1e3('0x5a')](function(_0x121806){socket['emit']('userWhatsappQueue:remove',{'UserId':_0x121806,'WhatsappQueueId':_0x5570bc['id']});});});});});});})[_0xe1e3('0x17')](respondWithStatusCode(_0x202023,null))[_0xe1e3('0x28')](handleError(_0x202023,null));};exports[_0xe1e3('0x73')]=function(_0x789139,_0x2b0173){return db['WhatsappQueue'][_0xe1e3('0x33')]({'where':{'id':_0x789139[_0xe1e3('0x29')]['id']}})[_0xe1e3('0x17')](handleEntityNotFound(_0x2b0173,null))[_0xe1e3('0x17')](function(_0x83854e){if(_0x83854e){return _0x83854e[_0xe1e3('0x73')](_0x789139['body'][_0xe1e3('0x5d')],_[_0xe1e3('0x74')](_0x789139[_0xe1e3('0x35')],[_0xe1e3('0x5d'),'id'])||{})[_0xe1e3('0x75')](function(_0x148385){for(var _0x501488=0x0;_0x501488<_0x789139[_0xe1e3('0x35')][_0xe1e3('0x5d')][_0xe1e3('0x2f')];_0x501488+=0x1){socket['emit'](_0xe1e3('0x5c'),{'UserId':Number(_0x789139[_0xe1e3('0x35')]['ids'][_0x501488]),'WhatsappQueueId':Number(_0x789139[_0xe1e3('0x29')]['id'])});}return _0x148385;});}})['then'](respondWithResult(_0x2b0173,null))[_0xe1e3('0x28')](handleError(_0x2b0173,null));};exports[_0xe1e3('0x72')]=function(_0x330ca4,_0x4efd06){return db[_0xe1e3('0x1f')][_0xe1e3('0x33')]({'where':{'id':_0x330ca4[_0xe1e3('0x29')]['id']}})[_0xe1e3('0x17')](handleEntityNotFound(_0x4efd06,null))[_0xe1e3('0x17')](function(_0x5c6f4e){if(_0x5c6f4e){return _0x5c6f4e['removeAgents'](_0x330ca4[_0xe1e3('0x25')][_0xe1e3('0x5d')])[_0xe1e3('0x17')](function(){if(_['isArray'](_0x330ca4[_0xe1e3('0x25')][_0xe1e3('0x5d')])){for(var _0x44c268=0x0;_0x44c268<_0x330ca4[_0xe1e3('0x25')][_0xe1e3('0x5d')][_0xe1e3('0x2f')];_0x44c268+=0x1){socket['emit'](_0xe1e3('0x76'),{'UserId':Number(_0x330ca4[_0xe1e3('0x25')][_0xe1e3('0x5d')][_0x44c268]),'WhatsappQueueId':Number(_0x330ca4[_0xe1e3('0x29')]['id'])});}}else{socket['emit'](_0xe1e3('0x76'),{'UserId':Number(_0x330ca4[_0xe1e3('0x25')][_0xe1e3('0x5d')]),'WhatsappQueueId':Number(_0x330ca4[_0xe1e3('0x29')]['id'])});}});}})['then'](respondWithStatusCode(_0x4efd06,null))['catch'](handleError(_0x4efd06,null));};exports[_0xe1e3('0x77')]=function(_0x1a62df,_0x19c350){var _0x1947f7={};var _0x114775={};var _0x4cf3a3;var _0x543c6f;return db[_0xe1e3('0x1f')]['findOne']({'where':{'id':_0x1a62df[_0xe1e3('0x29')]['id']}})[_0xe1e3('0x17')](handleEntityNotFound(_0x19c350,null))[_0xe1e3('0x17')](function(_0x34161e){if(_0x34161e){_0x4cf3a3=_0x34161e;_0x114775[_0xe1e3('0x2c')]=_[_0xe1e3('0x2a')](db[_0xe1e3('0x5e')]['rawAttributes']);_0x114775[_0xe1e3('0x25')]=_[_0xe1e3('0x2a')](_0x1a62df[_0xe1e3('0x25')]);_0x114775[_0xe1e3('0x2b')]=_[_0xe1e3('0x3e')](_0x114775['model'],_0x114775[_0xe1e3('0x25')]);_0x1947f7[_0xe1e3('0x2d')]=_['intersection'](_0x114775[_0xe1e3('0x2c')],qs['fields'](_0x1a62df[_0xe1e3('0x25')]['fields']));_0x1947f7[_0xe1e3('0x2d')]=_0x1947f7['attributes'][_0xe1e3('0x2f')]?_0x1947f7['attributes']:_0x114775['model'];_0x1947f7[_0xe1e3('0x40')]=qs[_0xe1e3('0x41')](_0x1a62df[_0xe1e3('0x25')][_0xe1e3('0x41')]);_0x1947f7[_0xe1e3('0x23')]=qs[_0xe1e3('0x2b')](_[_0xe1e3('0x42')](_0x1a62df['query'],_0x114775[_0xe1e3('0x2b')]));if(_0x1a62df[_0xe1e3('0x25')][_0xe1e3('0x43')]){_0x1947f7[_0xe1e3('0x23')]=_[_0xe1e3('0x31')](_0x1947f7[_0xe1e3('0x23')],{'$or':_[_0xe1e3('0x1e')](_0x1947f7[_0xe1e3('0x2d')],function(_0x52bd59){var _0xed40f7={};_0xed40f7[_0x52bd59]={'$like':'%'+_0x1a62df['query'][_0xe1e3('0x43')]+'%'};return _0xed40f7;})});}_0x1947f7=_[_0xe1e3('0x31')]({},_0x1947f7,_0x1a62df[_0xe1e3('0x32')]);return _0x4cf3a3[_0xe1e3('0x77')](_0x1947f7);}})[_0xe1e3('0x17')](function(_0x147114){if(_0x147114){_0x543c6f=_0x147114[_0xe1e3('0x2f')];if(!_0x1a62df['query'][_0xe1e3('0x50')]('nolimit')){_0x1947f7[_0xe1e3('0x11')]=qs['limit'](_0x1a62df[_0xe1e3('0x25')][_0xe1e3('0x11')]);_0x1947f7[_0xe1e3('0xf')]=qs[_0xe1e3('0xf')](_0x1a62df[_0xe1e3('0x25')][_0xe1e3('0xf')]);}return _0x4cf3a3[_0xe1e3('0x77')](_0x1947f7);}})[_0xe1e3('0x17')](function(_0x1390ef){if(_0x1390ef){return _0x1390ef?{'count':_0x543c6f,'rows':_0x1390ef}:null;}})[_0xe1e3('0x17')](respondWithResult(_0x19c350,null))[_0xe1e3('0x28')](handleError(_0x19c350,null));}; \ No newline at end of file +var _0xd6b9=['autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserWhatsappQueue','filters','hasOwnProperty','nolimit','sort','where','pick','WhatsappQueueId','filter','findAndCountAll','UserId','agent','whatsappPause','updatedAt','rows','format','%s/%s','SIP','getTeams','Team','order','ids','Agents','online','interface','flatMap','transaction','addTeams','findOrCreate','emit','removeTeams','User','select','field','tq.TeamId','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','union','value','isEmpty','forEach','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','update','then','get','WhatsappQueues','UserProfileResource','destroy','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','getOptions','include','query','findAll','catch','model','keys','intersection','fields','attributes','length','includeAll','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId'];(function(_0x4143a8,_0x3dbc9e){var _0x1ada4c=function(_0x4e74df){while(--_0x4e74df){_0x4143a8['push'](_0x4143a8['shift']());}};_0x1ada4c(++_0x3dbc9e);}(_0xd6b9,0x137));var _0x9d6b=function(_0x2d7f58,_0x4d5c28){_0x2d7f58=_0x2d7f58-0x0;var _0x174c16=_0xd6b9[_0x2d7f58];return _0x174c16;};'use strict';var BPromise=require(_0x9d6b('0x0'));var util=require(_0x9d6b('0x1'));var _=require(_0x9d6b('0x2'));var squel=require(_0x9d6b('0x3'));var Redis=require(_0x9d6b('0x4'));var qs=require(_0x9d6b('0x5'));var logger=require(_0x9d6b('0x6'))(_0x9d6b('0x7'));var config=require(_0x9d6b('0x8'));var db=require(_0x9d6b('0x9'))['db'];config[_0x9d6b('0xa')]=_[_0x9d6b('0xb')](config['redis'],{'host':_0x9d6b('0xc'),'port':0x18eb});var socket=require(_0x9d6b('0xd'))(new Redis(config[_0x9d6b('0xa')]));require(_0x9d6b('0xe'))[_0x9d6b('0xf')](socket);function respondWithStatusCode(_0x22a9a3,_0x3c8cd4){_0x3c8cd4=_0x3c8cd4||0xcc;return function(_0x1bdec7){if(_0x1bdec7){return _0x22a9a3[_0x9d6b('0x10')](_0x3c8cd4);}return _0x22a9a3[_0x9d6b('0x11')](_0x3c8cd4)[_0x9d6b('0x12')]();};}function respondWithResult(_0x19ed3a,_0x2273e9){_0x2273e9=_0x2273e9||0xc8;return function(_0x46f43c){if(_0x46f43c){return _0x19ed3a[_0x9d6b('0x11')](_0x2273e9)[_0x9d6b('0x13')](_0x46f43c);}};}function respondWithFilteredResult(_0xd44631,_0x52edda){return function(_0x15060d){if(_0x15060d){var _0x22e96e=typeof _0x52edda['offset']===_0x9d6b('0x14')&&typeof _0x52edda[_0x9d6b('0x15')]===_0x9d6b('0x14');var _0x437ac0=_0x15060d[_0x9d6b('0x16')];var _0x5e9dac=_0x22e96e?0x0:_0x52edda[_0x9d6b('0x17')];var _0x176b4b=_0x22e96e?_0x15060d['count']:_0x52edda[_0x9d6b('0x17')]+_0x52edda['limit'];var _0x557b97;if(_0x176b4b>=_0x437ac0){_0x176b4b=_0x437ac0;_0x557b97=0xc8;}else{_0x557b97=0xce;}_0xd44631[_0x9d6b('0x11')](_0x557b97);return _0xd44631['set']('Content-Range',_0x5e9dac+'-'+_0x176b4b+'/'+_0x437ac0)[_0x9d6b('0x13')](_0x15060d);}return null;};}function saveUpdates(_0x146c60){return function(_0x33129b){if(_0x33129b){return _0x33129b[_0x9d6b('0x18')](_0x146c60)[_0x9d6b('0x19')](function(_0x5af2f8){return _0x5af2f8;});}return null;};}function removeEntity(_0x498453){return function(_0x249707){if(_0x249707){return _0x249707['destroy']()[_0x9d6b('0x19')](function(){var _0x4dd6d7=_0x249707[_0x9d6b('0x1a')]({'plain':!![]});var _0x48b2a4=_0x9d6b('0x1b');return db[_0x9d6b('0x1c')][_0x9d6b('0x1d')]({'where':{'type':_0x48b2a4,'resourceId':_0x4dd6d7['id']}})['then'](function(){return _0x249707;});})[_0x9d6b('0x19')](function(){_0x498453['status'](0xcc)[_0x9d6b('0x12')]();});}};}function handleEntityNotFound(_0x3be623){return function(_0x2c8a3d){if(!_0x2c8a3d){_0x3be623[_0x9d6b('0x10')](0x194);}return _0x2c8a3d;};}function handleError(_0x3e9f30,_0xdb00f4){_0xdb00f4=_0xdb00f4||0x1f4;return function(_0x57a81c){logger['error'](_0x57a81c[_0x9d6b('0x1e')]);if(_0x57a81c[_0x9d6b('0x1f')]){delete _0x57a81c[_0x9d6b('0x1f')];}_0x3e9f30[_0x9d6b('0x11')](_0xdb00f4)[_0x9d6b('0x20')](_0x57a81c);};}exports[_0x9d6b('0x21')]=function(_0x4e22d9,_0x48a18d){var _0x11f4d2={};var _0x39686c={'count':0x0,'rows':[]};var _0x4c95c4=_[_0x9d6b('0x22')](db[_0x9d6b('0x23')][_0x9d6b('0x24')],function(_0x52cff7){return{'name':_0x52cff7[_0x9d6b('0x25')],'type':_0x52cff7[_0x9d6b('0x26')][_0x9d6b('0x27')]};});_0x11f4d2=qs[_0x9d6b('0x28')](_0x4c95c4,_0x4e22d9);var _0x1ee886={'where':_0x11f4d2['where']};return db['WhatsappQueue']['count'](_0x1ee886)[_0x9d6b('0x19')](function(_0x960e5e){_0x39686c[_0x9d6b('0x16')]=_0x960e5e;_0x11f4d2['include']=qs[_0x9d6b('0x29')](_0x4e22d9[_0x9d6b('0x2a')]);return db[_0x9d6b('0x23')][_0x9d6b('0x2b')](_0x11f4d2);})[_0x9d6b('0x19')](function(_0xb6d217){_0x39686c['rows']=_0xb6d217;return _0x39686c;})[_0x9d6b('0x19')](respondWithFilteredResult(_0x48a18d,_0x11f4d2))[_0x9d6b('0x2c')](handleError(_0x48a18d,null));};exports['show']=function(_0x26f849,_0x28a436){var _0x26c16e={'raw':!![],'where':{'id':_0x26f849['params']['id']}},_0x48d9b8={};_0x48d9b8[_0x9d6b('0x2d')]=_[_0x9d6b('0x2e')](db[_0x9d6b('0x23')][_0x9d6b('0x24')]);_0x48d9b8[_0x9d6b('0x2a')]=_['keys'](_0x26f849['query']);_0x48d9b8['filters']=_['intersection'](_0x48d9b8['model'],_0x48d9b8[_0x9d6b('0x2a')]);_0x26c16e['attributes']=_[_0x9d6b('0x2f')](_0x48d9b8['model'],qs[_0x9d6b('0x30')](_0x26f849['query'][_0x9d6b('0x30')]));_0x26c16e[_0x9d6b('0x31')]=_0x26c16e[_0x9d6b('0x31')][_0x9d6b('0x32')]?_0x26c16e[_0x9d6b('0x31')]:_0x48d9b8[_0x9d6b('0x2d')];if(_0x26f849[_0x9d6b('0x2a')][_0x9d6b('0x33')]){_0x26c16e[_0x9d6b('0x29')]=[{'all':!![]}];}_0x26c16e=_[_0x9d6b('0x34')]({},_0x26c16e,_0x26f849[_0x9d6b('0x35')]);return db[_0x9d6b('0x23')][_0x9d6b('0x36')](_0x26c16e)[_0x9d6b('0x19')](handleEntityNotFound(_0x28a436,null))[_0x9d6b('0x19')](respondWithResult(_0x28a436,null))[_0x9d6b('0x2c')](handleError(_0x28a436,null));};exports[_0x9d6b('0x37')]=function(_0x1b15f1,_0x50aa9b){return db['WhatsappQueue'][_0x9d6b('0x37')](_0x1b15f1['body'],{})[_0x9d6b('0x19')](function(_0x5f3855){var _0x5aac29=_0x1b15f1['user'][_0x9d6b('0x1a')]({'plain':!![]});if(!_0x5aac29)throw new Error(_0x9d6b('0x38'));if(_0x5aac29['role']==='user'){var _0x14bfd1=_0x5f3855[_0x9d6b('0x1a')]({'plain':!![]});var _0x52bbdf='WhatsappQueues';return db['UserProfileSection']['find']({'where':{'name':_0x52bbdf,'userProfileId':_0x5aac29[_0x9d6b('0x39')]},'raw':!![]})['then'](function(_0x44cf25){if(_0x44cf25&&_0x44cf25[_0x9d6b('0x3a')]===0x0){return db[_0x9d6b('0x1c')][_0x9d6b('0x37')]({'name':_0x14bfd1[_0x9d6b('0x1f')],'resourceId':_0x14bfd1['id'],'type':_0x44cf25[_0x9d6b('0x1f')],'sectionId':_0x44cf25['id']},{})[_0x9d6b('0x19')](function(){return _0x5f3855;});}else{return _0x5f3855;}})['catch'](function(_0x5222f1){logger[_0x9d6b('0x3b')](_0x9d6b('0x3c'),_0x5222f1);throw _0x5222f1;});}return _0x5f3855;})[_0x9d6b('0x19')](respondWithResult(_0x50aa9b,0xc9))[_0x9d6b('0x2c')](handleError(_0x50aa9b,null));};exports[_0x9d6b('0x18')]=function(_0x45f010,_0x5c2d91){if(_0x45f010['body']['id']){delete _0x45f010[_0x9d6b('0x3d')]['id'];}return db[_0x9d6b('0x23')][_0x9d6b('0x36')]({'where':{'id':_0x45f010[_0x9d6b('0x3e')]['id']}})[_0x9d6b('0x19')](handleEntityNotFound(_0x5c2d91,null))[_0x9d6b('0x19')](saveUpdates(_0x45f010['body'],null))['then'](respondWithResult(_0x5c2d91,null))['catch'](handleError(_0x5c2d91,null));};exports[_0x9d6b('0x1d')]=function(_0x498be1,_0xecd976){return db[_0x9d6b('0x23')][_0x9d6b('0x36')]({'where':{'id':_0x498be1[_0x9d6b('0x3e')]['id']}})[_0x9d6b('0x19')](handleEntityNotFound(_0xecd976,null))[_0x9d6b('0x19')](removeEntity(_0xecd976,null))[_0x9d6b('0x2c')](handleError(_0xecd976,null));};exports[_0x9d6b('0x3f')]=function(_0x3a31ba,_0x3986d7){return db[_0x9d6b('0x23')][_0x9d6b('0x3f')]()[_0x9d6b('0x19')](respondWithResult(_0x3986d7,null))[_0x9d6b('0x2c')](handleError(_0x3986d7,null));};exports[_0x9d6b('0x40')]=function(_0x5f0905,_0x348099){var _0x535bd4={'raw':!![],'where':{}},_0x554de8={},_0x1f862d;return db['WhatsappQueue'][_0x9d6b('0x41')]({'where':{'id':_0x5f0905[_0x9d6b('0x3e')]['id']}})['then'](handleEntityNotFound(_0x348099,null))[_0x9d6b('0x19')](function(_0x264943){if(_0x264943){_0x1f862d=_0x264943[_0x9d6b('0x1a')]({'plain':!![]});_0x554de8[_0x9d6b('0x2d')]=_[_0x9d6b('0x2e')](db[_0x9d6b('0x42')][_0x9d6b('0x24')]);_0x554de8[_0x9d6b('0x2a')]=_[_0x9d6b('0x2e')](_0x5f0905[_0x9d6b('0x2a')]);_0x554de8[_0x9d6b('0x43')]=_[_0x9d6b('0x2f')](_0x554de8[_0x9d6b('0x2d')],_0x554de8[_0x9d6b('0x2a')]);_0x535bd4[_0x9d6b('0x31')]=_[_0x9d6b('0x2f')](_0x554de8[_0x9d6b('0x2d')],qs['fields'](_0x5f0905[_0x9d6b('0x2a')][_0x9d6b('0x30')]));_0x535bd4[_0x9d6b('0x31')]=_0x535bd4[_0x9d6b('0x31')]['length']?_0x535bd4[_0x9d6b('0x31')]:_0x554de8[_0x9d6b('0x2d')];if(!_0x5f0905[_0x9d6b('0x2a')][_0x9d6b('0x44')](_0x9d6b('0x45'))){_0x535bd4[_0x9d6b('0x15')]=qs[_0x9d6b('0x15')](_0x5f0905['query'][_0x9d6b('0x15')]);_0x535bd4[_0x9d6b('0x17')]=qs[_0x9d6b('0x17')](_0x5f0905[_0x9d6b('0x2a')]['offset']);}_0x535bd4['order']=qs[_0x9d6b('0x46')](_0x5f0905['query'][_0x9d6b('0x46')]);_0x535bd4[_0x9d6b('0x47')]=qs[_0x9d6b('0x43')](_[_0x9d6b('0x48')](_0x5f0905[_0x9d6b('0x2a')],_0x554de8[_0x9d6b('0x43')]));_0x535bd4[_0x9d6b('0x47')][_0x9d6b('0x49')]=_0x264943['id'];if(_0x5f0905['query'][_0x9d6b('0x4a')]){_0x535bd4[_0x9d6b('0x47')]=_[_0x9d6b('0x34')](_0x535bd4[_0x9d6b('0x47')],{'$or':_[_0x9d6b('0x22')](_0x535bd4[_0x9d6b('0x31')],function(_0x4181ea){var _0x5c44f5={};_0x5c44f5[_0x4181ea]={'$like':'%'+_0x5f0905['query']['filter']+'%'};return _0x5c44f5;})});}_0x535bd4=_[_0x9d6b('0x34')]({},_0x535bd4,_0x5f0905['options']);return db[_0x9d6b('0x42')][_0x9d6b('0x2b')](_0x535bd4);}})[_0x9d6b('0x19')](function(_0x44be63){if(_0x44be63){return db['User'][_0x9d6b('0x4b')]({'where':{'id':_[_0x9d6b('0x22')](_0x44be63,_0x9d6b('0x4c')),'role':_0x9d6b('0x4d')},'attributes':['id',_0x9d6b('0x1f'),_0x9d6b('0x4e'),_0x9d6b('0x4f'),'createdAt']});}})['then'](function(_0x498d52){if(_0x498d52){return{'count':_0x498d52[_0x9d6b('0x16')],'rows':_['map'](_0x498d52[_0x9d6b('0x50')],function(_0x2be959){return{'membername':_0x2be959[_0x9d6b('0x1f')],'UserId':_0x2be959['id'],'queue_name':_0x1f862d['name'],'WhatsappQueueId':_0x1f862d['id'],'interface':util[_0x9d6b('0x51')](_0x9d6b('0x52'),_0x9d6b('0x53'),_0x2be959['name']),'penalty':0x0,'paused':_0x2be959[_0x9d6b('0x4e')],'createdAt':_0x2be959['createdAt'],'updatedAt':_0x2be959[_0x9d6b('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9d6b('0x19')](respondWithFilteredResult(_0x348099,_0x535bd4))[_0x9d6b('0x2c')](handleError(_0x348099,null));};exports[_0x9d6b('0x54')]=function(_0x111f46,_0x23c166){var _0x4bf807={};var _0x1fd32c={};var _0x26a551;var _0x9fb946;return db['WhatsappQueue'][_0x9d6b('0x41')]({'where':{'id':_0x111f46['params']['id']}})[_0x9d6b('0x19')](handleEntityNotFound(_0x23c166,null))['then'](function(_0x1837d3){if(_0x1837d3){_0x26a551=_0x1837d3;_0x1fd32c[_0x9d6b('0x2d')]=_['keys'](db[_0x9d6b('0x55')][_0x9d6b('0x24')]);_0x1fd32c[_0x9d6b('0x2a')]=_[_0x9d6b('0x2e')](_0x111f46[_0x9d6b('0x2a')]);_0x1fd32c[_0x9d6b('0x43')]=_['intersection'](_0x1fd32c['model'],_0x1fd32c[_0x9d6b('0x2a')]);_0x4bf807[_0x9d6b('0x31')]=_[_0x9d6b('0x2f')](_0x1fd32c[_0x9d6b('0x2d')],qs['fields'](_0x111f46[_0x9d6b('0x2a')][_0x9d6b('0x30')]));_0x4bf807[_0x9d6b('0x31')]=_0x4bf807['attributes'][_0x9d6b('0x32')]?_0x4bf807[_0x9d6b('0x31')]:_0x1fd32c[_0x9d6b('0x2d')];_0x4bf807[_0x9d6b('0x56')]=qs[_0x9d6b('0x46')](_0x111f46['query'][_0x9d6b('0x46')]);_0x4bf807[_0x9d6b('0x47')]=qs['filters'](_[_0x9d6b('0x48')](_0x111f46[_0x9d6b('0x2a')],_0x1fd32c[_0x9d6b('0x43')]));if(_0x111f46[_0x9d6b('0x2a')][_0x9d6b('0x4a')]){_0x4bf807[_0x9d6b('0x47')]=_[_0x9d6b('0x34')](_0x4bf807[_0x9d6b('0x47')],{'$or':_[_0x9d6b('0x22')](_0x4bf807[_0x9d6b('0x31')],function(_0x74a71c){var _0x5a0e7a={};_0x5a0e7a[_0x74a71c]={'$like':'%'+_0x111f46[_0x9d6b('0x2a')]['filter']+'%'};return _0x5a0e7a;})});}_0x4bf807=_[_0x9d6b('0x34')]({},_0x4bf807,_0x111f46[_0x9d6b('0x35')]);return _0x26a551[_0x9d6b('0x54')](_0x4bf807);}})['then'](function(_0x57934d){if(_0x57934d){_0x9fb946=_0x57934d[_0x9d6b('0x32')];if(!_0x111f46[_0x9d6b('0x2a')][_0x9d6b('0x44')](_0x9d6b('0x45'))){_0x4bf807[_0x9d6b('0x15')]=qs[_0x9d6b('0x15')](_0x111f46[_0x9d6b('0x2a')][_0x9d6b('0x15')]);_0x4bf807[_0x9d6b('0x17')]=qs[_0x9d6b('0x17')](_0x111f46[_0x9d6b('0x2a')][_0x9d6b('0x17')]);}return _0x26a551[_0x9d6b('0x54')](_0x4bf807);}})[_0x9d6b('0x19')](function(_0x58f157){if(_0x58f157){return _0x58f157?{'count':_0x9fb946,'rows':_0x58f157}:null;}})[_0x9d6b('0x19')](respondWithResult(_0x23c166,null))[_0x9d6b('0x2c')](handleError(_0x23c166,null));};exports['addTeams']=function(_0x527b14,_0x3499a8){var _0x3c5fb5=_0x527b14[_0x9d6b('0x3d')][_0x9d6b('0x57')];return db[_0x9d6b('0x55')][_0x9d6b('0x2b')]({'where':{'id':_0x3c5fb5},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9d6b('0x58'),'attributes':['id','name',_0x9d6b('0x59'),'voicePause',_0x9d6b('0x5a')],'raw':!![]}]})['then'](function(_0x40bb95){if(_0x40bb95){var _0x5ba2e1=_[_0x9d6b('0x5b')](_0x40bb95,function(_0x2226f2){var _0x2f47a8=_0x2226f2[_0x9d6b('0x1a')]({'plain':!![]});return _0x2f47a8[_0x9d6b('0x58')];});return db[_0x9d6b('0x23')][_0x9d6b('0x36')]({'where':{'id':_0x527b14[_0x9d6b('0x3e')]['id']}})[_0x9d6b('0x19')](function(_0x43f61f){return db['sequelize'][_0x9d6b('0x5c')](function(_0x2ab6a0){return _0x43f61f[_0x9d6b('0x5d')](_0x3c5fb5,{'transaction':_0x2ab6a0})[_0x9d6b('0x19')](function(){return BPromise['each'](_0x5ba2e1,function(_0x45e220){return db[_0x9d6b('0x42')][_0x9d6b('0x5e')]({'where':{'UserId':_0x45e220['id'],'WhatsappQueueId':_0x527b14[_0x9d6b('0x3e')]['id']},'transaction':_0x2ab6a0});});})[_0x9d6b('0x19')](function(){_0x5ba2e1['forEach'](function(_0x205530){socket[_0x9d6b('0x5f')]('userWhatsappQueue:save',{'UserId':_0x205530['id'],'WhatsappQueueId':_0x43f61f['id']});});});});});}})[_0x9d6b('0x19')](respondWithStatusCode(_0x3499a8,null))[_0x9d6b('0x2c')](handleError(_0x3499a8,null));};exports[_0x9d6b('0x60')]=function(_0x5dc407,_0x541e00){return db['Team'][_0x9d6b('0x2b')]({'where':{'id':_0x5dc407[_0x9d6b('0x2a')][_0x9d6b('0x57')]},'attributes':['id'],'include':[{'model':db[_0x9d6b('0x61')],'as':_0x9d6b('0x58'),'attributes':['id'],'raw':!![]}]})[_0x9d6b('0x19')](handleEntityNotFound(_0x541e00,null))['then'](function(_0x4a4fec){var _0x4784d4=_['map'](_0x4a4fec,'id');var _0x2223b1=[];var _0x1efa21=[];var _0xd367e0=squel[_0x9d6b('0x62')]();_0xd367e0[_0x9d6b('0x63')](_0x9d6b('0x64'))['from'](_0x9d6b('0x65'),'tq')[_0x9d6b('0x66')]('user_has_teams','ut',_0x9d6b('0x67'))[_0x9d6b('0x47')](_0x9d6b('0x68'),_0x5dc407[_0x9d6b('0x3e')]['id']);for(var _0x6c2a66=0x0;_0x6c2a66<_0x4a4fec[_0x9d6b('0x32')];_0x6c2a66+=0x1){let _0x50387d=_0x4a4fec[_0x6c2a66];for(var _0x49c88a=0x0;_0x49c88a<_0x50387d['Agents'][_0x9d6b('0x32')];_0x49c88a+=0x1){let _0x581575=_0x50387d[_0x9d6b('0x58')][_0x49c88a];var _0x119407=_0xd367e0[_0x9d6b('0x69')]();_0x119407['where']('ut.UserId\x20=\x20?',_0x581575['id']);_0x1efa21[_0x9d6b('0x6a')](db['sequelize'][_0x9d6b('0x2a')](_0x119407['toString'](),{'type':db[_0x9d6b('0x6b')][_0x9d6b('0x6c')][_0x9d6b('0x6d')]})[_0x9d6b('0x19')](function(_0x38c3e4){if(_0x38c3e4[_0x9d6b('0x32')]===0x1){return _0x581575['id'];}else{var _0x42de26=_[_0x9d6b('0x6e')](_[_0x9d6b('0x22')](_0x38c3e4,_0x9d6b('0x6f')),function(_0x2912b0){return _[_0x9d6b('0x70')](_0x4784d4,_0x2912b0);});if(_0x42de26){return _0x581575['id'];}}}));}}return BPromise['all'](_0x1efa21)[_0x9d6b('0x19')](function(_0x480fc0){_0x2223b1=_(_0x2223b1)[_0x9d6b('0x71')](_0x480fc0)['compact']()[_0x9d6b('0x72')]();return db['WhatsappQueue'][_0x9d6b('0x36')]({'where':{'id':_0x5dc407[_0x9d6b('0x3e')]['id']}})['then'](function(_0x31e347){return db[_0x9d6b('0x6b')][_0x9d6b('0x5c')](function(_0x2a0eb4){return _0x31e347[_0x9d6b('0x60')](_0x5dc407[_0x9d6b('0x2a')][_0x9d6b('0x57')],{'transaction':_0x2a0eb4})[_0x9d6b('0x19')](function(){if(!_[_0x9d6b('0x73')](_0x2223b1)){return _0x31e347['removeAgents'](_0x2223b1,{'transaction':_0x2a0eb4});}})[_0x9d6b('0x19')](function(){_0x2223b1[_0x9d6b('0x74')](function(_0x1e52f0){socket['emit'](_0x9d6b('0x75'),{'UserId':_0x1e52f0,'WhatsappQueueId':_0x31e347['id']});});});});});});})[_0x9d6b('0x19')](respondWithStatusCode(_0x541e00,null))['catch'](handleError(_0x541e00,null));};exports[_0x9d6b('0x76')]=function(_0x335dbd,_0xd6408){return db[_0x9d6b('0x23')][_0x9d6b('0x36')]({'where':{'id':_0x335dbd['params']['id']}})[_0x9d6b('0x19')](handleEntityNotFound(_0xd6408,null))[_0x9d6b('0x19')](function(_0x511f8e){if(_0x511f8e){return _0x511f8e['addAgents'](_0x335dbd[_0x9d6b('0x3d')][_0x9d6b('0x57')],_[_0x9d6b('0x77')](_0x335dbd['body'],[_0x9d6b('0x57'),'id'])||{})[_0x9d6b('0x78')](function(_0xed4f3d){for(var _0x5a8377=0x0;_0x5a8377<_0x335dbd[_0x9d6b('0x3d')][_0x9d6b('0x57')]['length'];_0x5a8377+=0x1){socket[_0x9d6b('0x5f')]('userWhatsappQueue:save',{'UserId':Number(_0x335dbd[_0x9d6b('0x3d')][_0x9d6b('0x57')][_0x5a8377]),'WhatsappQueueId':Number(_0x335dbd['params']['id'])});}return _0xed4f3d;});}})['then'](respondWithResult(_0xd6408,null))[_0x9d6b('0x2c')](handleError(_0xd6408,null));};exports['removeAgents']=function(_0x174622,_0x4d94bd){return db['WhatsappQueue']['find']({'where':{'id':_0x174622[_0x9d6b('0x3e')]['id']}})[_0x9d6b('0x19')](handleEntityNotFound(_0x4d94bd,null))[_0x9d6b('0x19')](function(_0x1b492f){if(_0x1b492f){return _0x1b492f[_0x9d6b('0x79')](_0x174622[_0x9d6b('0x2a')][_0x9d6b('0x57')])['then'](function(){if(_['isArray'](_0x174622[_0x9d6b('0x2a')][_0x9d6b('0x57')])){for(var _0x34d410=0x0;_0x34d410<_0x174622[_0x9d6b('0x2a')][_0x9d6b('0x57')][_0x9d6b('0x32')];_0x34d410+=0x1){socket[_0x9d6b('0x5f')](_0x9d6b('0x75'),{'UserId':Number(_0x174622[_0x9d6b('0x2a')][_0x9d6b('0x57')][_0x34d410]),'WhatsappQueueId':Number(_0x174622[_0x9d6b('0x3e')]['id'])});}}else{socket[_0x9d6b('0x5f')](_0x9d6b('0x75'),{'UserId':Number(_0x174622[_0x9d6b('0x2a')][_0x9d6b('0x57')]),'WhatsappQueueId':Number(_0x174622[_0x9d6b('0x3e')]['id'])});}});}})[_0x9d6b('0x19')](respondWithStatusCode(_0x4d94bd,null))['catch'](handleError(_0x4d94bd,null));};exports['getAgents']=function(_0xb2e537,_0x239eea){var _0x34014d={};var _0x333735={};var _0x281ee2;var _0x367510;return db[_0x9d6b('0x23')][_0x9d6b('0x41')]({'where':{'id':_0xb2e537[_0x9d6b('0x3e')]['id']}})[_0x9d6b('0x19')](handleEntityNotFound(_0x239eea,null))[_0x9d6b('0x19')](function(_0x1c0418){if(_0x1c0418){_0x281ee2=_0x1c0418;_0x333735['model']=_[_0x9d6b('0x2e')](db['User'][_0x9d6b('0x24')]);_0x333735['query']=_['keys'](_0xb2e537[_0x9d6b('0x2a')]);_0x333735['filters']=_['intersection'](_0x333735[_0x9d6b('0x2d')],_0x333735[_0x9d6b('0x2a')]);_0x34014d[_0x9d6b('0x31')]=_[_0x9d6b('0x2f')](_0x333735[_0x9d6b('0x2d')],qs['fields'](_0xb2e537['query'][_0x9d6b('0x30')]));_0x34014d['attributes']=_0x34014d[_0x9d6b('0x31')][_0x9d6b('0x32')]?_0x34014d['attributes']:_0x333735[_0x9d6b('0x2d')];_0x34014d['order']=qs[_0x9d6b('0x46')](_0xb2e537[_0x9d6b('0x2a')][_0x9d6b('0x46')]);_0x34014d[_0x9d6b('0x47')]=qs[_0x9d6b('0x43')](_[_0x9d6b('0x48')](_0xb2e537['query'],_0x333735[_0x9d6b('0x43')]));if(_0xb2e537['query']['filter']){_0x34014d['where']=_['merge'](_0x34014d['where'],{'$or':_[_0x9d6b('0x22')](_0x34014d[_0x9d6b('0x31')],function(_0x501e34){var _0x238d0d={};_0x238d0d[_0x501e34]={'$like':'%'+_0xb2e537[_0x9d6b('0x2a')]['filter']+'%'};return _0x238d0d;})});}_0x34014d=_[_0x9d6b('0x34')]({},_0x34014d,_0xb2e537[_0x9d6b('0x35')]);return _0x281ee2[_0x9d6b('0x7a')](_0x34014d);}})['then'](function(_0x4f30f8){if(_0x4f30f8){_0x367510=_0x4f30f8[_0x9d6b('0x32')];if(!_0xb2e537[_0x9d6b('0x2a')][_0x9d6b('0x44')]('nolimit')){_0x34014d[_0x9d6b('0x15')]=qs[_0x9d6b('0x15')](_0xb2e537[_0x9d6b('0x2a')][_0x9d6b('0x15')]);_0x34014d[_0x9d6b('0x17')]=qs['offset'](_0xb2e537[_0x9d6b('0x2a')][_0x9d6b('0x17')]);}return _0x281ee2[_0x9d6b('0x7a')](_0x34014d);}})[_0x9d6b('0x19')](function(_0x26836d){if(_0x26836d){return _0x26836d?{'count':_0x367510,'rows':_0x26836d}:null;}})[_0x9d6b('0x19')](respondWithResult(_0x239eea,null))[_0x9d6b('0x2c')](handleError(_0x239eea,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 9466662..38440d6 100644 --- a/server/api/whatsappQueue/whatsappQueue.events.js +++ b/server/api/whatsappQueue/whatsappQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ce5=['WhatsappQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x51b85f,_0xd3cf3a){var _0x2aded1=function(_0x439243){while(--_0x439243){_0x51b85f['push'](_0x51b85f['shift']());}};_0x2aded1(++_0xd3cf3a);}(_0x9ce5,0x126));var _0x59ce=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x9ce5[_0x42bdad];return _0x122626;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0x59ce('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x59ce('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x59ce('0x2'),'afterDestroy':_0x59ce('0x3')};function emitEvent(_0x3b8f84){return function(_0x64593f,_0x5bb653,_0x1a0ad2){WhatsappQueueEvents[_0x59ce('0x4')](_0x3b8f84+':'+_0x64593f['id'],_0x64593f);WhatsappQueueEvents['emit'](_0x3b8f84,_0x64593f);_0x1a0ad2(null);};}for(var e in events){if(events[_0x59ce('0x5')](e)){var event=events[e];WhatsappQueue[_0x59ce('0x6')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0xe342=['emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe342,0x1b2));var _0x2e34=function(_0x302f85,_0x5bcca3){_0x302f85=_0x302f85-0x0;var _0x5ef7cb=_0xe342[_0x302f85];return _0x5ef7cb;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x2e34('0x0'))['db'][_0x2e34('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x2e34('0x2')](0x0);var events={'afterCreate':_0x2e34('0x3'),'afterUpdate':_0x2e34('0x4'),'afterDestroy':_0x2e34('0x5')};function emitEvent(_0x303085){return function(_0x4f0824,_0x3e3933,_0x2bc4b5){WhatsappQueueEvents['emit'](_0x303085+':'+_0x4f0824['id'],_0x4f0824);WhatsappQueueEvents[_0x2e34('0x6')](_0x303085,_0x4f0824);_0x2bc4b5(null);};}for(var e in events){if(events[_0x2e34('0x7')](e)){var event=events[e];WhatsappQueue[_0x2e34('0x8')](e,emitEvent(event));}}module[_0x2e34('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index f1b204f..94d5eff 100644 --- a/server/api/whatsappQueue/whatsappQueue.model.js +++ b/server/api/whatsappQueue/whatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf404=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','util'];(function(_0x59e821,_0x86c723){var _0x5333f6=function(_0x5dc2c9){while(--_0x5dc2c9){_0x59e821['push'](_0x59e821['shift']());}};_0x5333f6(++_0x86c723);}(_0xf404,0x1ac));var _0x4f40=function(_0x32abaf,_0x319a63){_0x32abaf=_0x32abaf-0x0;var _0x3ff745=_0xf404[_0x32abaf];return _0x3ff745;};'use strict';var _=require('lodash');var util=require(_0x4f40('0x0'));var logger=require(_0x4f40('0x1'))(_0x4f40('0x2'));var moment=require('moment');var BPromise=require(_0x4f40('0x3'));var rp=require(_0x4f40('0x4'));var fs=require('fs');var path=require(_0x4f40('0x5'));var rimraf=require(_0x4f40('0x6'));var config=require(_0x4f40('0x7'));var attributes=require(_0x4f40('0x8'));module[_0x4f40('0x9')]=function(_0x8dacae,_0x3148f5){return _0x8dacae['define'](_0x4f40('0xa'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7335=['../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x23b2f4,_0xf82ce){var _0x19d093=function(_0x5d7cbd){while(--_0x5d7cbd){_0x23b2f4['push'](_0x23b2f4['shift']());}};_0x19d093(++_0xf82ce);}(_0x7335,0xc8));var _0x5733=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x7335[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x5733('0x0'));var util=require(_0x5733('0x1'));var logger=require(_0x5733('0x2'))('api');var moment=require(_0x5733('0x3'));var BPromise=require(_0x5733('0x4'));var rp=require(_0x5733('0x5'));var fs=require('fs');var path=require(_0x5733('0x6'));var rimraf=require(_0x5733('0x7'));var config=require(_0x5733('0x8'));var attributes=require(_0x5733('0x9'));module['exports']=function(_0x3470e5,_0x171aec){return _0x3470e5[_0x5733('0xa')](_0x5733('0xb'),attributes,{'tableName':_0x5733('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index a9ce83f..a264967 100644 --- a/server/api/whatsappQueue/whatsappQueue.rpc.js +++ b/server/api/whatsappQueue/whatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5733=['ShowWhatsappQueue','WhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetWhatsappQueue','findAll','options','raw','where','attributes','limit','map','include','model','then'];(function(_0x5b9b56,_0x1dd1cc){var _0x3360a1=function(_0xe156e5){while(--_0xe156e5){_0x5b9b56['push'](_0x5b9b56['shift']());}};_0x3360a1(++_0x1dd1cc);}(_0x5733,0xff));var _0x3573=function(_0x13f9ce,_0x36b3f2){_0x13f9ce=_0x13f9ce-0x0;var _0x4d6fd4=_0x5733[_0x13f9ce];return _0x4d6fd4;};'use strict';var _=require(_0x3573('0x0'));var util=require(_0x3573('0x1'));var moment=require(_0x3573('0x2'));var BPromise=require(_0x3573('0x3'));var rs=require(_0x3573('0x4'));var fs=require('fs');var Redis=require(_0x3573('0x5'));var db=require(_0x3573('0x6'))['db'];var utils=require(_0x3573('0x7'));var logger=require(_0x3573('0x8'))(_0x3573('0x9'));var config=require('../../config/environment');var jayson=require(_0x3573('0xa'));var client=jayson[_0x3573('0xb')]['http']({'port':0x232a});config[_0x3573('0xc')]=_[_0x3573('0xd')](config[_0x3573('0xc')],{'host':_0x3573('0xe'),'port':0x18eb});var socket=require(_0x3573('0xf'))(new Redis(config[_0x3573('0xc')]));require(_0x3573('0x10'))['register'](socket);function respondWithRpcPromise(_0x2a00c3,_0xeed32e,_0x4bf212){return new BPromise(function(_0x11b279,_0x119f24){return client['request'](_0x2a00c3,_0x4bf212)['then'](function(_0x130e4d){logger['info'](_0x3573('0x11'),_0xeed32e,_0x3573('0x12'));logger[_0x3573('0x13')](_0x3573('0x14'),_0xeed32e,_0x3573('0x12'),JSON[_0x3573('0x15')](_0x130e4d));if(_0x130e4d[_0x3573('0x16')]){if(_0x130e4d[_0x3573('0x16')][_0x3573('0x17')]===0x1f4){logger[_0x3573('0x16')](_0x3573('0x11'),_0xeed32e,_0x130e4d[_0x3573('0x16')][_0x3573('0x18')]);return _0x119f24(_0x130e4d['error']['message']);}logger[_0x3573('0x16')](_0x3573('0x11'),_0xeed32e,_0x130e4d[_0x3573('0x16')][_0x3573('0x18')]);return _0x11b279(_0x130e4d['error'][_0x3573('0x18')]);}else{logger[_0x3573('0x19')](_0x3573('0x11'),_0xeed32e,_0x3573('0x12'));_0x11b279(_0x130e4d[_0x3573('0x1a')][_0x3573('0x18')]);}})[_0x3573('0x1b')](function(_0x1a916e){logger[_0x3573('0x16')](_0x3573('0x11'),_0xeed32e,_0x1a916e);_0x119f24(_0x1a916e);});});}exports[_0x3573('0x1c')]=function(_0x2ff2c0){var _0x56709b=this;return new Promise(function(_0x55c4f2,_0x29f6ce){return db['WhatsappQueue'][_0x3573('0x1d')]({'raw':_0x2ff2c0[_0x3573('0x1e')]?_0x2ff2c0['options'][_0x3573('0x1f')]===undefined?!![]:![]:!![],'where':_0x2ff2c0[_0x3573('0x1e')]?_0x2ff2c0[_0x3573('0x1e')][_0x3573('0x20')]||null:null,'attributes':_0x2ff2c0[_0x3573('0x1e')]?_0x2ff2c0[_0x3573('0x1e')][_0x3573('0x21')]||null:null,'limit':_0x2ff2c0['options']?_0x2ff2c0[_0x3573('0x1e')][_0x3573('0x22')]||null:null,'include':_0x2ff2c0[_0x3573('0x1e')]?_0x2ff2c0[_0x3573('0x1e')]['include']?_[_0x3573('0x23')](_0x2ff2c0['options'][_0x3573('0x24')],function(_0x38fc85){return{'model':db[_0x38fc85[_0x3573('0x25')]],'as':_0x38fc85['as'],'attributes':_0x38fc85[_0x3573('0x21')],'include':_0x38fc85[_0x3573('0x24')]?_['map'](_0x38fc85['include'],function(_0x9f6ec6){return{'model':db[_0x9f6ec6[_0x3573('0x25')]],'as':_0x9f6ec6['as'],'attributes':_0x9f6ec6[_0x3573('0x21')],'include':_0x9f6ec6[_0x3573('0x24')]?_[_0x3573('0x23')](_0x9f6ec6[_0x3573('0x24')],function(_0xdc85f9){return{'model':db[_0xdc85f9[_0x3573('0x25')]],'as':_0xdc85f9['as'],'attributes':_0xdc85f9[_0x3573('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3573('0x26')](function(_0xcdae8e){logger[_0x3573('0x19')](_0x3573('0x1c'),_0x2ff2c0);logger[_0x3573('0x13')]('GetWhatsappQueue',_0x2ff2c0,JSON[_0x3573('0x15')](_0xcdae8e));_0x55c4f2(_0xcdae8e);})[_0x3573('0x1b')](function(_0x4fe251){logger[_0x3573('0x16')](_0x3573('0x1c'),_0x4fe251['message'],_0x2ff2c0);_0x29f6ce(_0x56709b[_0x3573('0x16')](0x1f4,_0x4fe251[_0x3573('0x18')]));});});};exports[_0x3573('0x27')]=function(_0x2969c1){var _0x5f316d=this;return new Promise(function(_0x384178,_0x132aa4){return db[_0x3573('0x28')][_0x3573('0x29')]({'raw':_0x2969c1[_0x3573('0x1e')]?_0x2969c1[_0x3573('0x1e')][_0x3573('0x1f')]===undefined?!![]:![]:!![],'where':_0x2969c1[_0x3573('0x1e')]?_0x2969c1[_0x3573('0x1e')][_0x3573('0x20')]||null:null,'attributes':_0x2969c1[_0x3573('0x1e')]?_0x2969c1[_0x3573('0x1e')][_0x3573('0x21')]||null:null,'include':_0x2969c1[_0x3573('0x1e')]?_0x2969c1['options'][_0x3573('0x24')]?_[_0x3573('0x23')](_0x2969c1[_0x3573('0x1e')][_0x3573('0x24')],function(_0x5f5789){return{'model':db[_0x5f5789['model']],'as':_0x5f5789['as'],'attributes':_0x5f5789[_0x3573('0x21')],'include':_0x5f5789[_0x3573('0x24')]?_['map'](_0x5f5789[_0x3573('0x24')],function(_0x59db31){return{'model':db[_0x59db31[_0x3573('0x25')]],'as':_0x59db31['as'],'attributes':_0x59db31[_0x3573('0x21')],'include':_0x59db31[_0x3573('0x24')]?_['map'](_0x59db31[_0x3573('0x24')],function(_0x2e6d01){return{'model':db[_0x2e6d01[_0x3573('0x25')]],'as':_0x2e6d01['as'],'attributes':_0x2e6d01[_0x3573('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41947d){logger['info'](_0x3573('0x27'),_0x2969c1);logger[_0x3573('0x13')](_0x3573('0x27'),_0x2969c1,JSON[_0x3573('0x15')](_0x41947d));_0x384178(_0x41947d);})['catch'](function(_0x1652c5){logger[_0x3573('0x16')](_0x3573('0x27'),_0x1652c5[_0x3573('0x18')],_0x2969c1);_0x132aa4(_0x5f316d[_0x3573('0x16')](0x1f4,_0x1652c5[_0x3573('0x18')]));});});}; \ No newline at end of file +var _0x8164=['error','code','WhatsappQueue,\x20%s,\x20%s','message','catch','WhatsappQueue','findAll','options','raw','where','attributes','limit','map','include','model','info','GetWhatsappQueue','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x245605,_0x240d98){var _0x1a9581=function(_0x411645){while(--_0x411645){_0x245605['push'](_0x245605['shift']());}};_0x1a9581(++_0x240d98);}(_0x8164,0x1ac));var _0x4816=function(_0x47ae1f,_0x328d68){_0x47ae1f=_0x47ae1f-0x0;var _0x2a0233=_0x8164[_0x47ae1f];return _0x2a0233;};'use strict';var _=require(_0x4816('0x0'));var util=require(_0x4816('0x1'));var moment=require(_0x4816('0x2'));var BPromise=require(_0x4816('0x3'));var rs=require(_0x4816('0x4'));var fs=require('fs');var Redis=require(_0x4816('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4816('0x6'));var logger=require('../../config/logger')(_0x4816('0x7'));var config=require(_0x4816('0x8'));var jayson=require(_0x4816('0x9'));var client=jayson['client'][_0x4816('0xa')]({'port':0x232a});config['redis']=_[_0x4816('0xb')](config[_0x4816('0xc')],{'host':_0x4816('0xd'),'port':0x18eb});var socket=require(_0x4816('0xe'))(new Redis(config[_0x4816('0xc')]));require(_0x4816('0xf'))[_0x4816('0x10')](socket);function respondWithRpcPromise(_0x189d59,_0x21f485,_0x2609ef){return new BPromise(function(_0x2bb35e,_0x2e21ad){return client[_0x4816('0x11')](_0x189d59,_0x2609ef)[_0x4816('0x12')](function(_0x180844){logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x21f485,'request\x20sent');logger[_0x4816('0x13')](_0x4816('0x14'),_0x21f485,_0x4816('0x15'),JSON[_0x4816('0x16')](_0x180844));if(_0x180844['error']){if(_0x180844[_0x4816('0x17')][_0x4816('0x18')]===0x1f4){logger['error'](_0x4816('0x19'),_0x21f485,_0x180844[_0x4816('0x17')][_0x4816('0x1a')]);return _0x2e21ad(_0x180844['error'][_0x4816('0x1a')]);}logger[_0x4816('0x17')](_0x4816('0x19'),_0x21f485,_0x180844['error'][_0x4816('0x1a')]);return _0x2bb35e(_0x180844['error']['message']);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x21f485,_0x4816('0x15'));_0x2bb35e(_0x180844['result']['message']);}})[_0x4816('0x1b')](function(_0x37fe47){logger[_0x4816('0x17')](_0x4816('0x19'),_0x21f485,_0x37fe47);_0x2e21ad(_0x37fe47);});});}exports['GetWhatsappQueue']=function(_0x3c71de){var _0xd4bf5a=this;return new Promise(function(_0x1b0f23,_0x40c62f){return db[_0x4816('0x1c')][_0x4816('0x1d')]({'raw':_0x3c71de[_0x4816('0x1e')]?_0x3c71de[_0x4816('0x1e')][_0x4816('0x1f')]===undefined?!![]:![]:!![],'where':_0x3c71de[_0x4816('0x1e')]?_0x3c71de['options'][_0x4816('0x20')]||null:null,'attributes':_0x3c71de[_0x4816('0x1e')]?_0x3c71de[_0x4816('0x1e')][_0x4816('0x21')]||null:null,'limit':_0x3c71de[_0x4816('0x1e')]?_0x3c71de['options'][_0x4816('0x22')]||null:null,'include':_0x3c71de[_0x4816('0x1e')]?_0x3c71de[_0x4816('0x1e')]['include']?_[_0x4816('0x23')](_0x3c71de[_0x4816('0x1e')]['include'],function(_0x726982){return{'model':db[_0x726982['model']],'as':_0x726982['as'],'attributes':_0x726982[_0x4816('0x21')],'include':_0x726982[_0x4816('0x24')]?_[_0x4816('0x23')](_0x726982[_0x4816('0x24')],function(_0x444d2b){return{'model':db[_0x444d2b['model']],'as':_0x444d2b['as'],'attributes':_0x444d2b['attributes'],'include':_0x444d2b['include']?_['map'](_0x444d2b[_0x4816('0x24')],function(_0x86a4d6){return{'model':db[_0x86a4d6[_0x4816('0x25')]],'as':_0x86a4d6['as'],'attributes':_0x86a4d6[_0x4816('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4816('0x12')](function(_0x93b6a0){logger[_0x4816('0x26')](_0x4816('0x27'),_0x3c71de);logger['debug']('GetWhatsappQueue',_0x3c71de,JSON[_0x4816('0x16')](_0x93b6a0));_0x1b0f23(_0x93b6a0);})[_0x4816('0x1b')](function(_0x59a5d2){logger[_0x4816('0x17')]('GetWhatsappQueue',_0x59a5d2[_0x4816('0x1a')],_0x3c71de);_0x40c62f(_0xd4bf5a[_0x4816('0x17')](0x1f4,_0x59a5d2[_0x4816('0x1a')]));});});};exports[_0x4816('0x28')]=function(_0x588fa9){var _0x4e34ec=this;return new Promise(function(_0x2befd1,_0x566dbe){return db['WhatsappQueue']['find']({'raw':_0x588fa9[_0x4816('0x1e')]?_0x588fa9[_0x4816('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x588fa9[_0x4816('0x1e')]?_0x588fa9[_0x4816('0x1e')][_0x4816('0x20')]||null:null,'attributes':_0x588fa9['options']?_0x588fa9['options'][_0x4816('0x21')]||null:null,'include':_0x588fa9[_0x4816('0x1e')]?_0x588fa9[_0x4816('0x1e')][_0x4816('0x24')]?_[_0x4816('0x23')](_0x588fa9[_0x4816('0x1e')][_0x4816('0x24')],function(_0x467204){return{'model':db[_0x467204['model']],'as':_0x467204['as'],'attributes':_0x467204[_0x4816('0x21')],'include':_0x467204[_0x4816('0x24')]?_[_0x4816('0x23')](_0x467204['include'],function(_0x4c8599){return{'model':db[_0x4c8599[_0x4816('0x25')]],'as':_0x4c8599['as'],'attributes':_0x4c8599[_0x4816('0x21')],'include':_0x4c8599[_0x4816('0x24')]?_[_0x4816('0x23')](_0x4c8599[_0x4816('0x24')],function(_0x5272cc){return{'model':db[_0x5272cc[_0x4816('0x25')]],'as':_0x5272cc['as'],'attributes':_0x5272cc[_0x4816('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4816('0x12')](function(_0x45dbf9){logger[_0x4816('0x26')](_0x4816('0x28'),_0x588fa9);logger[_0x4816('0x13')](_0x4816('0x28'),_0x588fa9,JSON[_0x4816('0x16')](_0x45dbf9));_0x2befd1(_0x45dbf9);})[_0x4816('0x1b')](function(_0x966f27){logger[_0x4816('0x17')](_0x4816('0x28'),_0x966f27[_0x4816('0x1a')],_0x588fa9);_0x566dbe(_0x4e34ec['error'](0x1f4,_0x966f27['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index c8527e1..d6c8b79 100644 --- a/server/api/whatsappQueue/whatsappQueue.socket.js +++ b/server/api/whatsappQueue/whatsappQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93e9=['whatsappQueue:','./whatsappQueue.events','save','update','removeListener','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x93e9,0x19e));var _0x993e=function(_0x48a586,_0x7dae91){_0x48a586=_0x48a586-0x0;var _0xe87f79=_0x93e9[_0x48a586];return _0xe87f79;};'use strict';var WhatsappQueueEvents=require(_0x993e('0x0'));var events=[_0x993e('0x1'),'remove',_0x993e('0x2')];function createListener(_0x41401e,_0x51367d){return function(_0x3557df){_0x51367d['emit'](_0x41401e,_0x3557df);};}function removeListener(_0x538efb,_0x34cde7){return function(){WhatsappQueueEvents[_0x993e('0x3')](_0x538efb,_0x34cde7);};}exports[_0x993e('0x4')]=function(_0x167dac){for(var _0x427bb5=0x0,_0x8b8310=events[_0x993e('0x5')];_0x427bb5<_0x8b8310;_0x427bb5++){var _0x3e9a58=events[_0x427bb5];var _0xc6ae1b=createListener(_0x993e('0x6')+_0x3e9a58,_0x167dac);WhatsappQueueEvents['on'](_0x3e9a58,_0xc6ae1b);}}; \ No newline at end of file +var _0x124b=['save','update','emit','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x360f7c,_0x30176c){var _0x2e4f89=function(_0x23f7a4){while(--_0x23f7a4){_0x360f7c['push'](_0x360f7c['shift']());}};_0x2e4f89(++_0x30176c);}(_0x124b,0xef));var _0xb124=function(_0x2e86ba,_0x3a57af){_0x2e86ba=_0x2e86ba-0x0;var _0x52ebed=_0x124b[_0x2e86ba];return _0x52ebed;};'use strict';var WhatsappQueueEvents=require(_0xb124('0x0'));var events=[_0xb124('0x1'),'remove',_0xb124('0x2')];function createListener(_0x41bb76,_0x388264){return function(_0x409dfd){_0x388264[_0xb124('0x3')](_0x41bb76,_0x409dfd);};}function removeListener(_0x17f654,_0x353aa0){return function(){WhatsappQueueEvents['removeListener'](_0x17f654,_0x353aa0);};}exports['register']=function(_0x3623b8){for(var _0x4cee6b=0x0,_0x53f3b8=events[_0xb124('0x4')];_0x4cee6b<_0x53f3b8;_0x4cee6b++){var _0x2b5f7c=events[_0x4cee6b];var _0x57de75=createListener(_0xb124('0x5')+_0x2b5f7c,_0x3623b8);WhatsappQueueEvents['on'](_0x2b5f7c,_0x57de75);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 34f9867..2cf1598 100644 --- a/server/api/whatsappQueueReport/index.js +++ b/server/api/whatsappQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb507=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index'];(function(_0x134bca,_0x19fc26){var _0x5a1754=function(_0x3ecec1){while(--_0x3ecec1){_0x134bca['push'](_0x134bca['shift']());}};_0x5a1754(++_0x19fc26);}(_0xb507,0xdc));var _0x7b50=function(_0x35de8a,_0x7acd4b){_0x35de8a=_0x35de8a-0x0;var _0x9c759d=_0xb507[_0x35de8a];return _0x9c759d;};'use strict';var multer=require(_0x7b50('0x0'));var util=require('util');var path=require(_0x7b50('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b50('0x2'));var router=express['Router']();var fs_extra=require(_0x7b50('0x3'));var auth=require(_0x7b50('0x4'));var interaction=require(_0x7b50('0x5'));var config=require(_0x7b50('0x6'));var controller=require(_0x7b50('0x7'));router[_0x7b50('0x8')]('/',auth[_0x7b50('0x9')](),controller[_0x7b50('0xa')]);router[_0x7b50('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7b50('0xb')]);router[_0x7b50('0x8')](_0x7b50('0xc'),auth[_0x7b50('0x9')](),controller[_0x7b50('0xd')]);router[_0x7b50('0xe')]('/',auth[_0x7b50('0x9')](),controller[_0x7b50('0xf')]);router[_0x7b50('0x10')](_0x7b50('0xc'),auth[_0x7b50('0x9')](),controller[_0x7b50('0x11')]);router[_0x7b50('0x12')](_0x7b50('0xc'),auth['isAuthenticated'](),controller[_0x7b50('0x13')]);module[_0x7b50('0x14')]=router; \ No newline at end of file +var _0x7747=['multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x225d7e,_0x206329){var _0x3d1998=function(_0x2c5072){while(--_0x2c5072){_0x225d7e['push'](_0x225d7e['shift']());}};_0x3d1998(++_0x206329);}(_0x7747,0x1a4));var _0x7774=function(_0x56db28,_0x95952b){_0x56db28=_0x56db28-0x0;var _0x255efc=_0x7747[_0x56db28];return _0x255efc;};'use strict';var multer=require(_0x7774('0x0'));var util=require(_0x7774('0x1'));var path=require(_0x7774('0x2'));var timeout=require('connect-timeout');var express=require(_0x7774('0x3'));var router=express[_0x7774('0x4')]();var fs_extra=require(_0x7774('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7774('0x6'));var config=require(_0x7774('0x7'));var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0x7774('0x8')](),controller[_0x7774('0x9')]);router[_0x7774('0xa')](_0x7774('0xb'),auth['isAuthenticated'](),controller[_0x7774('0xc')]);router[_0x7774('0xa')](_0x7774('0xd'),auth[_0x7774('0x8')](),controller[_0x7774('0xe')]);router[_0x7774('0xf')]('/',auth[_0x7774('0x8')](),controller[_0x7774('0x10')]);router[_0x7774('0x11')](_0x7774('0xd'),auth['isAuthenticated'](),controller[_0x7774('0x12')]);router[_0x7774('0x13')]('/:id',auth[_0x7774('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 9c0bda7..ef15d32 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x44661e,_0x2fd669){var _0x32ab77=function(_0x28e38e){while(--_0x28e38e){_0x44661e['push'](_0x44661e['shift']());}};_0x32ab77(++_0x2fd669);}(_0x7a54,0x106));var _0x47a5=function(_0x1d59bc,_0x4583a4){_0x1d59bc=_0x1d59bc-0x0;var _0x338d18=_0x7a54[_0x1d59bc];return _0x338d18;};'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(_0x59c480,_0x13cea7){var _0xb0246c=function(_0x45b5ef){while(--_0x45b5ef){_0x59c480['push'](_0x59c480['shift']());}};_0xb0246c(++_0x13cea7);}(_0x7a54,0x106));var _0x47a5=function(_0x4efe20,_0x1b7dda){_0x4efe20=_0x4efe20-0x0;var _0x2efee7=_0x7a54[_0x4efe20];return _0x2efee7;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 14b50b9..f27e3a3 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf45e=['Content-Range','json','apply','reject','save','destroy','then','sendStatus','stack','index','map','rawAttributes','type','key','model','name','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','WhatsappQueueReport','includeAll','include','findAll','rows','show','params','keys','length','merge','find','create','body','update','catch','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','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set'];(function(_0x4d3369,_0x1c842c){var _0x91723b=function(_0x54682b){while(--_0x54682b){_0x4d3369['push'](_0x4d3369['shift']());}};_0x91723b(++_0x1c842c);}(_0xf45e,0x115));var _0xef45=function(_0x560419,_0x32d862){_0x560419=_0x560419-0x0;var _0x56183d=_0xf45e[_0x560419];return _0x56183d;};'use strict';var emlformat=require(_0xef45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef45('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef45('0x2'));var moment=require(_0xef45('0x3'));var BPromise=require(_0xef45('0x4'));var Mustache=require(_0xef45('0x5'));var util=require(_0xef45('0x6'));var path=require(_0xef45('0x7'));var sox=require(_0xef45('0x8'));var csv=require(_0xef45('0x9'));var ejs=require(_0xef45('0xa'));var fs=require('fs');var fs_extra=require(_0xef45('0xb'));var _=require(_0xef45('0xc'));var squel=require(_0xef45('0xd'));var crypto=require(_0xef45('0xe'));var jsforce=require(_0xef45('0xf'));var deskjs=require(_0xef45('0x10'));var toCsv=require(_0xef45('0x9'));var querystring=require(_0xef45('0x11'));var Papa=require(_0xef45('0x12'));var Redis=require(_0xef45('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xef45('0x14'));var as=require(_0xef45('0x15'));var hardwareService=require(_0xef45('0x16'));var logger=require(_0xef45('0x17'))(_0xef45('0x18'));var utils=require(_0xef45('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xef45('0x1a'));var db=require(_0xef45('0x1b'))['db'];function respondWithStatusCode(_0x30babb,_0x433be9){_0x433be9=_0x433be9||0xcc;return function(_0x476739){if(_0x476739){return _0x30babb['sendStatus'](_0x433be9);}return _0x30babb['status'](_0x433be9)[_0xef45('0x1c')]();};}function respondWithResult(_0x47fd96,_0x2ae89a){_0x2ae89a=_0x2ae89a||0xc8;return function(_0xb0fc43){if(_0xb0fc43){return _0x47fd96[_0xef45('0x1d')](_0x2ae89a)['json'](_0xb0fc43);}};}function respondWithFilteredResult(_0x5b3136,_0x29c0c4){return function(_0x5530e6){if(_0x5530e6){var _0x11cd3a=typeof _0x29c0c4[_0xef45('0x1e')]===_0xef45('0x1f')&&typeof _0x29c0c4[_0xef45('0x20')]==='undefined';var _0x560b2f=_0x5530e6[_0xef45('0x21')];var _0x219778=_0x11cd3a?0x0:_0x29c0c4[_0xef45('0x1e')];var _0x258785=_0x11cd3a?_0x5530e6['count']:_0x29c0c4['offset']+_0x29c0c4[_0xef45('0x20')];var _0x20ef26;if(_0x258785>=_0x560b2f){_0x258785=_0x560b2f;_0x20ef26=0xc8;}else{_0x20ef26=0xce;}_0x5b3136[_0xef45('0x1d')](_0x20ef26);return _0x5b3136[_0xef45('0x22')](_0xef45('0x23'),_0x219778+'-'+_0x258785+'/'+_0x560b2f)[_0xef45('0x24')](_0x5530e6);}return null;};}function patchUpdates(_0x375cbd){return function(_0x4a6217){try{jsonpatch[_0xef45('0x25')](_0x4a6217,_0x375cbd,!![]);}catch(_0x3e2a47){return BPromise[_0xef45('0x26')](_0x3e2a47);}return _0x4a6217[_0xef45('0x27')]();};}function saveUpdates(_0x27322f,_0x5205bf){return function(_0x40abc8){if(_0x40abc8){return _0x40abc8['update'](_0x27322f)['then'](function(_0x7707a1){return _0x7707a1;});}return null;};}function removeEntity(_0x2b41d8,_0xbb859b){return function(_0x7817d0){if(_0x7817d0){return _0x7817d0[_0xef45('0x28')]()[_0xef45('0x29')](function(){_0x2b41d8[_0xef45('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x208b35,_0x5f0593){return function(_0x38b470){if(!_0x38b470){_0x208b35[_0xef45('0x2a')](0x194);}return _0x38b470;};}function handleError(_0x578f03,_0x46e423){_0x46e423=_0x46e423||0x1f4;return function(_0x2c356d){logger['error'](_0x2c356d[_0xef45('0x2b')]);if(_0x2c356d['name']){delete _0x2c356d['name'];}_0x578f03['status'](_0x46e423)['send'](_0x2c356d);};}exports[_0xef45('0x2c')]=function(_0x2f72ef,_0x217e8d){var _0x15ad38={},_0x5782d0={},_0x18f304={'count':0x0,'rows':[]};var _0x4f028c=_[_0xef45('0x2d')](db['WhatsappQueueReport'][_0xef45('0x2e')],function(_0x5bfd2d){return{'name':_0x5bfd2d['fieldName'],'type':_0x5bfd2d[_0xef45('0x2f')][_0xef45('0x30')]};});_0x5782d0[_0xef45('0x31')]=_[_0xef45('0x2d')](_0x4f028c,_0xef45('0x32'));_0x5782d0['query']=_['keys'](_0x2f72ef['query']);_0x5782d0[_0xef45('0x33')]=_[_0xef45('0x34')](_0x5782d0[_0xef45('0x31')],_0x5782d0[_0xef45('0x35')]);_0x15ad38[_0xef45('0x36')]=_[_0xef45('0x34')](_0x5782d0[_0xef45('0x31')],qs['fields'](_0x2f72ef['query'][_0xef45('0x37')]));_0x15ad38['attributes']=_0x15ad38[_0xef45('0x36')]['length']?_0x15ad38[_0xef45('0x36')]:_0x5782d0[_0xef45('0x31')];if(!_0x2f72ef[_0xef45('0x35')][_0xef45('0x38')](_0xef45('0x39'))){_0x15ad38['limit']=qs[_0xef45('0x20')](_0x2f72ef[_0xef45('0x35')][_0xef45('0x20')]);_0x15ad38['offset']=qs['offset'](_0x2f72ef[_0xef45('0x35')][_0xef45('0x1e')]);}_0x15ad38['order']=qs[_0xef45('0x3a')](_0x2f72ef['query']['sort']);_0x15ad38[_0xef45('0x3b')]=qs[_0xef45('0x33')](_[_0xef45('0x3c')](_0x2f72ef['query'],_0x5782d0[_0xef45('0x33')]),_0x4f028c);if(_0x2f72ef[_0xef45('0x35')][_0xef45('0x3d')]){_0x15ad38[_0xef45('0x3b')]=_['merge'](_0x15ad38['where'],{'$or':_[_0xef45('0x2d')](_0x4f028c,function(_0x474be1){if(_0x474be1[_0xef45('0x2f')]!==_0xef45('0x3e')){var _0x269a11={};_0x269a11[_0x474be1[_0xef45('0x32')]]={'$like':'%'+_0x2f72ef[_0xef45('0x35')][_0xef45('0x3d')]+'%'};return _0x269a11;}})});}_0x15ad38=_['merge']({},_0x15ad38,_0x2f72ef['options']);var _0x13f8b2={'where':_0x15ad38[_0xef45('0x3b')]};return db[_0xef45('0x3f')][_0xef45('0x21')](_0x13f8b2)[_0xef45('0x29')](function(_0x3bcada){_0x18f304[_0xef45('0x21')]=_0x3bcada;if(_0x2f72ef[_0xef45('0x35')][_0xef45('0x40')]){_0x15ad38[_0xef45('0x41')]=[{'all':!![]}];}return db[_0xef45('0x3f')][_0xef45('0x42')](_0x15ad38);})[_0xef45('0x29')](function(_0xd7d217){_0x18f304[_0xef45('0x43')]=_0xd7d217;return _0x18f304;})[_0xef45('0x29')](respondWithFilteredResult(_0x217e8d,_0x15ad38))['catch'](handleError(_0x217e8d,null));};exports[_0xef45('0x44')]=function(_0x5bdfad,_0x1b9d45){var _0x82c123={'raw':!![],'where':{'id':_0x5bdfad[_0xef45('0x45')]['id']}},_0x54ccb8={};_0x54ccb8['model']=_[_0xef45('0x46')](db['WhatsappQueueReport'][_0xef45('0x2e')]);_0x54ccb8[_0xef45('0x35')]=_[_0xef45('0x46')](_0x5bdfad[_0xef45('0x35')]);_0x54ccb8[_0xef45('0x33')]=_[_0xef45('0x34')](_0x54ccb8[_0xef45('0x31')],_0x54ccb8['query']);_0x82c123[_0xef45('0x36')]=_[_0xef45('0x34')](_0x54ccb8[_0xef45('0x31')],qs[_0xef45('0x37')](_0x5bdfad[_0xef45('0x35')][_0xef45('0x37')]));_0x82c123[_0xef45('0x36')]=_0x82c123[_0xef45('0x36')][_0xef45('0x47')]?_0x82c123[_0xef45('0x36')]:_0x54ccb8[_0xef45('0x31')];if(_0x5bdfad[_0xef45('0x35')][_0xef45('0x40')]){_0x82c123[_0xef45('0x41')]=[{'all':!![]}];}_0x82c123=_[_0xef45('0x48')]({},_0x82c123,_0x5bdfad['options']);return db[_0xef45('0x3f')][_0xef45('0x49')](_0x82c123)[_0xef45('0x29')](handleEntityNotFound(_0x1b9d45,null))['then'](respondWithResult(_0x1b9d45,null))['catch'](handleError(_0x1b9d45,null));};exports['create']=function(_0x29aeab,_0x18143c){return db[_0xef45('0x3f')][_0xef45('0x4a')](_0x29aeab[_0xef45('0x4b')],{})[_0xef45('0x29')](respondWithResult(_0x18143c,0xc9))['catch'](handleError(_0x18143c,null));};exports[_0xef45('0x4c')]=function(_0x463796,_0x2b2419){if(_0x463796['body']['id']){delete _0x463796['body']['id'];}return db[_0xef45('0x3f')][_0xef45('0x49')]({'where':{'id':_0x463796['params']['id']}})[_0xef45('0x29')](handleEntityNotFound(_0x2b2419,null))[_0xef45('0x29')](saveUpdates(_0x463796[_0xef45('0x4b')],null))[_0xef45('0x29')](respondWithResult(_0x2b2419,null))[_0xef45('0x4d')](handleError(_0x2b2419,null));};exports[_0xef45('0x28')]=function(_0x23581f,_0xfa5fdd){return db[_0xef45('0x3f')][_0xef45('0x49')]({'where':{'id':_0x23581f[_0xef45('0x45')]['id']}})[_0xef45('0x29')](handleEntityNotFound(_0xfa5fdd,null))[_0xef45('0x29')](removeEntity(_0xfa5fdd,null))[_0xef45('0x4d')](handleError(_0xfa5fdd,null));};exports['describe']=function(_0x22b75e,_0x24aceb){return db[_0xef45('0x3f')]['describe']()[_0xef45('0x29')](respondWithResult(_0x24aceb,null))[_0xef45('0x4d')](handleError(_0x24aceb,null));}; \ No newline at end of file +var _0x5eb8=['rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','includeAll','include','catch','show','params','keys','options','find','create','body','describe','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','sendStatus','error','stack','name','send','map','WhatsappQueueReport'];(function(_0x59606e,_0x429521){var _0x19e449=function(_0x1a0483){while(--_0x1a0483){_0x59606e['push'](_0x59606e['shift']());}};_0x19e449(++_0x429521);}(_0x5eb8,0xb0));var _0x85eb=function(_0x188905,_0x398fac){_0x188905=_0x188905-0x0;var _0x2bf735=_0x5eb8[_0x188905];return _0x2bf735;};'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(){_0x5b48d9[_0x85eb('0x1a')](0xcc)[_0x85eb('0x19')]();});}};}function handleEntityNotFound(_0x5dfc96,_0x39d3fe){return function(_0x3453cd){if(!_0x3453cd){_0x5dfc96[_0x85eb('0x27')](0x194);}return _0x3453cd;};}function handleError(_0x30e766,_0x3e2326){_0x3e2326=_0x3e2326||0x1f4;return function(_0x57a03c){logger[_0x85eb('0x28')](_0x57a03c[_0x85eb('0x29')]);if(_0x57a03c[_0x85eb('0x2a')]){delete _0x57a03c[_0x85eb('0x2a')];}_0x30e766[_0x85eb('0x1a')](_0x3e2326)[_0x85eb('0x2b')](_0x57a03c);};}exports['index']=function(_0x562792,_0x37515c){var _0x585f2a={},_0xa9b14f={},_0x5255eb={'count':0x0,'rows':[]};var _0x4229e9=_[_0x85eb('0x2c')](db[_0x85eb('0x2d')][_0x85eb('0x2e')],function(_0xa67e1c){return{'name':_0xa67e1c[_0x85eb('0x2f')],'type':_0xa67e1c[_0x85eb('0x30')]['key']};});_0xa9b14f[_0x85eb('0x31')]=_[_0x85eb('0x2c')](_0x4229e9,'name');_0xa9b14f[_0x85eb('0x32')]=_['keys'](_0x562792['query']);_0xa9b14f[_0x85eb('0x33')]=_[_0x85eb('0x34')](_0xa9b14f[_0x85eb('0x31')],_0xa9b14f[_0x85eb('0x32')]);_0x585f2a[_0x85eb('0x35')]=_[_0x85eb('0x34')](_0xa9b14f[_0x85eb('0x31')],qs[_0x85eb('0x36')](_0x562792[_0x85eb('0x32')][_0x85eb('0x36')]));_0x585f2a['attributes']=_0x585f2a[_0x85eb('0x35')][_0x85eb('0x37')]?_0x585f2a['attributes']:_0xa9b14f['model'];if(!_0x562792[_0x85eb('0x32')][_0x85eb('0x38')](_0x85eb('0x39'))){_0x585f2a[_0x85eb('0x1e')]=qs[_0x85eb('0x1e')](_0x562792[_0x85eb('0x32')][_0x85eb('0x1e')]);_0x585f2a[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x562792[_0x85eb('0x32')][_0x85eb('0x1c')]);}_0x585f2a[_0x85eb('0x3a')]=qs[_0x85eb('0x3b')](_0x562792[_0x85eb('0x32')]['sort']);_0x585f2a[_0x85eb('0x3c')]=qs[_0x85eb('0x33')](_['pick'](_0x562792['query'],_0xa9b14f[_0x85eb('0x33')]),_0x4229e9);if(_0x562792[_0x85eb('0x32')]['filter']){_0x585f2a[_0x85eb('0x3c')]=_['merge'](_0x585f2a[_0x85eb('0x3c')],{'$or':_['map'](_0x4229e9,function(_0xaa27ca){if(_0xaa27ca['type']!==_0x85eb('0x3d')){var _0x5c618a={};_0x5c618a[_0xaa27ca[_0x85eb('0x2a')]]={'$like':'%'+_0x562792[_0x85eb('0x32')]['filter']+'%'};return _0x5c618a;}})});}_0x585f2a=_[_0x85eb('0x3e')]({},_0x585f2a,_0x562792['options']);var _0x2a6baa={'where':_0x585f2a[_0x85eb('0x3c')]};return db['WhatsappQueueReport'][_0x85eb('0x1f')](_0x2a6baa)['then'](function(_0x5495cf){_0x5255eb[_0x85eb('0x1f')]=_0x5495cf;if(_0x562792['query'][_0x85eb('0x3f')]){_0x585f2a[_0x85eb('0x40')]=[{'all':!![]}];}return db['WhatsappQueueReport']['findAll'](_0x585f2a);})[_0x85eb('0x26')](function(_0x422ec3){_0x5255eb['rows']=_0x422ec3;return _0x5255eb;})['then'](respondWithFilteredResult(_0x37515c,_0x585f2a))[_0x85eb('0x41')](handleError(_0x37515c,null));};exports[_0x85eb('0x42')]=function(_0x2211f9,_0x202681){var _0x3be961={'raw':!![],'where':{'id':_0x2211f9[_0x85eb('0x43')]['id']}},_0x5b7411={};_0x5b7411[_0x85eb('0x31')]=_[_0x85eb('0x44')](db[_0x85eb('0x2d')][_0x85eb('0x2e')]);_0x5b7411[_0x85eb('0x32')]=_[_0x85eb('0x44')](_0x2211f9[_0x85eb('0x32')]);_0x5b7411[_0x85eb('0x33')]=_['intersection'](_0x5b7411[_0x85eb('0x31')],_0x5b7411[_0x85eb('0x32')]);_0x3be961['attributes']=_[_0x85eb('0x34')](_0x5b7411[_0x85eb('0x31')],qs[_0x85eb('0x36')](_0x2211f9[_0x85eb('0x32')][_0x85eb('0x36')]));_0x3be961[_0x85eb('0x35')]=_0x3be961['attributes'][_0x85eb('0x37')]?_0x3be961[_0x85eb('0x35')]:_0x5b7411[_0x85eb('0x31')];if(_0x2211f9[_0x85eb('0x32')][_0x85eb('0x3f')]){_0x3be961[_0x85eb('0x40')]=[{'all':!![]}];}_0x3be961=_[_0x85eb('0x3e')]({},_0x3be961,_0x2211f9[_0x85eb('0x45')]);return db['WhatsappQueueReport'][_0x85eb('0x46')](_0x3be961)[_0x85eb('0x26')](handleEntityNotFound(_0x202681,null))[_0x85eb('0x26')](respondWithResult(_0x202681,null))[_0x85eb('0x41')](handleError(_0x202681,null));};exports[_0x85eb('0x47')]=function(_0x1a19c2,_0x3c387a){return db[_0x85eb('0x2d')][_0x85eb('0x47')](_0x1a19c2[_0x85eb('0x48')],{})[_0x85eb('0x26')](respondWithResult(_0x3c387a,0xc9))[_0x85eb('0x41')](handleError(_0x3c387a,null));};exports['update']=function(_0x11da79,_0x2c951b){if(_0x11da79[_0x85eb('0x48')]['id']){delete _0x11da79['body']['id'];}return db[_0x85eb('0x2d')][_0x85eb('0x46')]({'where':{'id':_0x11da79[_0x85eb('0x43')]['id']}})[_0x85eb('0x26')](handleEntityNotFound(_0x2c951b,null))[_0x85eb('0x26')](saveUpdates(_0x11da79['body'],null))[_0x85eb('0x26')](respondWithResult(_0x2c951b,null))[_0x85eb('0x41')](handleError(_0x2c951b,null));};exports[_0x85eb('0x25')]=function(_0x50e264,_0xc5cb43){return db[_0x85eb('0x2d')][_0x85eb('0x46')]({'where':{'id':_0x50e264['params']['id']}})['then'](handleEntityNotFound(_0xc5cb43,null))[_0x85eb('0x26')](removeEntity(_0xc5cb43,null))['catch'](handleError(_0xc5cb43,null));};exports['describe']=function(_0x3f0b0c,_0x593723){return db[_0x85eb('0x2d')][_0x85eb('0x49')]()['then'](respondWithResult(_0x593723,null))['catch'](handleError(_0x593723,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index b056835..4e28e67 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x563a=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','uniqueid','lodash'];(function(_0x4c9380,_0x2fefc0){var _0x49a523=function(_0x165e85){while(--_0x165e85){_0x4c9380['push'](_0x4c9380['shift']());}};_0x49a523(++_0x2fefc0);}(_0x563a,0x1cd));var _0xa563=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x563a[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xa563('0x0'));var util=require('util');var logger=require(_0xa563('0x1'))(_0xa563('0x2'));var moment=require(_0xa563('0x3'));var BPromise=require(_0xa563('0x4'));var rp=require(_0xa563('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa563('0x6'));var config=require('../../config/environment');var attributes=require(_0xa563('0x7'));module[_0xa563('0x8')]=function(_0x6ed59e,_0x47f8c1){return _0x6ed59e['define'](_0xa563('0x9'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xa563('0xa'),'fields':[_0xa563('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x760b=['exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x45b916,_0x57ac98){var _0x572505=function(_0x4a6e95){while(--_0x4a6e95){_0x45b916['push'](_0x45b916['shift']());}};_0x572505(++_0x57ac98);}(_0x760b,0x1bf));var _0xb760=function(_0x196613,_0x45475f){_0x196613=_0x196613-0x0;var _0x25a090=_0x760b[_0x196613];return _0x25a090;};'use strict';var _=require(_0xb760('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb760('0x1'));var moment=require(_0xb760('0x2'));var BPromise=require(_0xb760('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb760('0x4'));var rimraf=require(_0xb760('0x5'));var config=require(_0xb760('0x6'));var attributes=require(_0xb760('0x7'));module[_0xb760('0x8')]=function(_0x1268d2,_0x584746){return _0x1268d2[_0xb760('0x9')](_0xb760('0xa'),attributes,{'tableName':_0xb760('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb760('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 49949ad..9f0129b 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ef4=['debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','message','info','catch','body','options','CreateWhatsappQueueReport','stringify','UpdateWhatsappQueueReport','WhatsappQueueReport','update','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4cf0b7,_0x560029){var _0x545f10=function(_0x993533){while(--_0x993533){_0x4cf0b7['push'](_0x4cf0b7['shift']());}};_0x545f10(++_0x560029);}(_0x3ef4,0x1de));var _0x43ef=function(_0x423797,_0x3d393b){_0x423797=_0x423797-0x0;var _0x57ec0c=_0x3ef4[_0x423797];return _0x57ec0c;};'use strict';var _=require(_0x43ef('0x0'));var util=require(_0x43ef('0x1'));var moment=require(_0x43ef('0x2'));var BPromise=require(_0x43ef('0x3'));var rs=require(_0x43ef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43ef('0x5'))['db'];var utils=require(_0x43ef('0x6'));var logger=require(_0x43ef('0x7'))('rpc');var config=require(_0x43ef('0x8'));var jayson=require(_0x43ef('0x9'));var client=jayson[_0x43ef('0xa')][_0x43ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51c087,_0x27f37d,_0x26f139){return new BPromise(function(_0xcd8e0b,_0x482c30){return client['request'](_0x51c087,_0x26f139)[_0x43ef('0xc')](function(_0x20dc15){logger['info'](_0x43ef('0xd'),_0x27f37d,_0x43ef('0xe'));logger[_0x43ef('0xf')](_0x43ef('0x10'),_0x27f37d,_0x43ef('0xe'),JSON['stringify'](_0x20dc15));if(_0x20dc15[_0x43ef('0x11')]){if(_0x20dc15[_0x43ef('0x11')]['code']===0x1f4){logger[_0x43ef('0x11')](_0x43ef('0xd'),_0x27f37d,_0x20dc15[_0x43ef('0x11')][_0x43ef('0x12')]);return _0x482c30(_0x20dc15['error'][_0x43ef('0x12')]);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x27f37d,_0x20dc15[_0x43ef('0x11')]['message']);return _0xcd8e0b(_0x20dc15['error'][_0x43ef('0x12')]);}else{logger[_0x43ef('0x13')](_0x43ef('0xd'),_0x27f37d,'request\x20sent');_0xcd8e0b(_0x20dc15['result'][_0x43ef('0x12')]);}})[_0x43ef('0x14')](function(_0x3d7065){logger['error'](_0x43ef('0xd'),_0x27f37d,_0x3d7065);_0x482c30(_0x3d7065);});});}exports['CreateWhatsappQueueReport']=function(_0x5b0217){var _0x4edbd6=this;return new Promise(function(_0x4595ae,_0x10bda4){return db['WhatsappQueueReport']['create'](_0x5b0217[_0x43ef('0x15')],{'raw':_0x5b0217[_0x43ef('0x16')]?_0x5b0217[_0x43ef('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x43ef('0xc')](function(_0x39618e){logger['info'](_0x43ef('0x17'),_0x5b0217);logger[_0x43ef('0xf')](_0x43ef('0x17'),_0x5b0217,JSON[_0x43ef('0x18')](_0x39618e));_0x4595ae(_0x39618e);})[_0x43ef('0x14')](function(_0x350f27){logger[_0x43ef('0x11')](_0x43ef('0x17'),_0x350f27['message'],_0x5b0217);_0x10bda4(_0x4edbd6[_0x43ef('0x11')](0x1f4,_0x350f27['message']));});});};exports[_0x43ef('0x19')]=function(_0x32fe44){var _0x23f7e7=this;return new Promise(function(_0x3faf1b,_0x180c06){return db[_0x43ef('0x1a')][_0x43ef('0x1b')](_0x32fe44[_0x43ef('0x15')],{'raw':_0x32fe44[_0x43ef('0x16')]?_0x32fe44[_0x43ef('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32fe44['options']?_0x32fe44[_0x43ef('0x16')][_0x43ef('0x1c')]||null:null,'attributes':_0x32fe44[_0x43ef('0x16')]?_0x32fe44[_0x43ef('0x16')]['attributes']||null:null,'limit':_0x32fe44[_0x43ef('0x16')]?_0x32fe44[_0x43ef('0x16')]['limit']||null:null})[_0x43ef('0xc')](function(_0x31e997){logger['info'](_0x43ef('0x19'),_0x32fe44);logger['debug'](_0x43ef('0x19'),_0x32fe44,JSON[_0x43ef('0x18')](_0x31e997));_0x3faf1b(_0x31e997);})['catch'](function(_0x63b331){logger[_0x43ef('0x11')](_0x43ef('0x19'),_0x63b331['message'],_0x32fe44);_0x180c06(_0x23f7e7[_0x43ef('0x11')](0x1f4,_0x63b331[_0x43ef('0x12')]));});});}; \ No newline at end of file +var _0x611e=['util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','update','where','limit','UpdateWhatsappQueueReport'];(function(_0xab5846,_0x523119){var _0x288809=function(_0x2a1de8){while(--_0x2a1de8){_0xab5846['push'](_0xab5846['shift']());}};_0x288809(++_0x523119);}(_0x611e,0x10e));var _0xe611=function(_0x47a42f,_0x3a1bbc){_0x47a42f=_0x47a42f-0x0;var _0x514eef=_0x611e[_0x47a42f];return _0x514eef;};'use strict';var _=require('lodash');var util=require(_0xe611('0x0'));var moment=require(_0xe611('0x1'));var BPromise=require('bluebird');var rs=require(_0xe611('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe611('0x3'))(_0xe611('0x4'));var config=require(_0xe611('0x5'));var jayson=require(_0xe611('0x6'));var client=jayson[_0xe611('0x7')][_0xe611('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x479061,_0x573614,_0x1fee60){return new BPromise(function(_0x391979,_0x115f5a){return client[_0xe611('0x9')](_0x479061,_0x1fee60)[_0xe611('0xa')](function(_0x5757ef){logger[_0xe611('0xb')](_0xe611('0xc'),_0x573614,_0xe611('0xd'));logger[_0xe611('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x573614,_0xe611('0xd'),JSON[_0xe611('0xf')](_0x5757ef));if(_0x5757ef[_0xe611('0x10')]){if(_0x5757ef[_0xe611('0x10')]['code']===0x1f4){logger[_0xe611('0x10')](_0xe611('0xc'),_0x573614,_0x5757ef[_0xe611('0x10')][_0xe611('0x11')]);return _0x115f5a(_0x5757ef['error'][_0xe611('0x11')]);}logger[_0xe611('0x10')](_0xe611('0xc'),_0x573614,_0x5757ef[_0xe611('0x10')]['message']);return _0x391979(_0x5757ef[_0xe611('0x10')][_0xe611('0x11')]);}else{logger[_0xe611('0xb')](_0xe611('0xc'),_0x573614,_0xe611('0xd'));_0x391979(_0x5757ef[_0xe611('0x12')][_0xe611('0x11')]);}})[_0xe611('0x13')](function(_0x2e8761){logger[_0xe611('0x10')](_0xe611('0xc'),_0x573614,_0x2e8761);_0x115f5a(_0x2e8761);});});}exports[_0xe611('0x14')]=function(_0x10731a){var _0x16153c=this;return new Promise(function(_0x3e043c,_0x19da38){return db[_0xe611('0x15')][_0xe611('0x16')](_0x10731a[_0xe611('0x17')],{'raw':_0x10731a[_0xe611('0x18')]?_0x10731a[_0xe611('0x18')][_0xe611('0x19')]===undefined?!![]:![]:!![]})[_0xe611('0xa')](function(_0xff6796){logger[_0xe611('0xb')](_0xe611('0x14'),_0x10731a);logger['debug'](_0xe611('0x14'),_0x10731a,JSON[_0xe611('0xf')](_0xff6796));_0x3e043c(_0xff6796);})[_0xe611('0x13')](function(_0x4da9b5){logger[_0xe611('0x10')](_0xe611('0x14'),_0x4da9b5[_0xe611('0x11')],_0x10731a);_0x19da38(_0x16153c[_0xe611('0x10')](0x1f4,_0x4da9b5[_0xe611('0x11')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x1c9e42){var _0x59ecd7=this;return new Promise(function(_0x2c9853,_0x17e8ed){return db['WhatsappQueueReport'][_0xe611('0x1a')](_0x1c9e42['body'],{'raw':_0x1c9e42[_0xe611('0x18')]?_0x1c9e42[_0xe611('0x18')][_0xe611('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c9e42[_0xe611('0x18')]?_0x1c9e42[_0xe611('0x18')][_0xe611('0x1b')]||null:null,'attributes':_0x1c9e42[_0xe611('0x18')]?_0x1c9e42[_0xe611('0x18')]['attributes']||null:null,'limit':_0x1c9e42[_0xe611('0x18')]?_0x1c9e42[_0xe611('0x18')][_0xe611('0x1c')]||null:null})[_0xe611('0xa')](function(_0x115595){logger[_0xe611('0xb')](_0xe611('0x1d'),_0x1c9e42);logger[_0xe611('0xe')]('UpdateWhatsappQueueReport',_0x1c9e42,JSON[_0xe611('0xf')](_0x115595));_0x2c9853(_0x115595);})[_0xe611('0x13')](function(_0x76f843){logger[_0xe611('0x10')](_0xe611('0x1d'),_0x76f843['message'],_0x1c9e42);_0x17e8ed(_0x59ecd7[_0xe611('0x10')](0x1f4,_0x76f843[_0xe611('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 14b38ee..1ba8089 100644 --- a/server/api/whatsappTransferReport/index.js +++ b/server/api/whatsappTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9787=['post','create','put','update','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x170772,_0x1f1ee7){var _0x3ef69c=function(_0x4cde12){while(--_0x4cde12){_0x170772['push'](_0x170772['shift']());}};_0x3ef69c(++_0x1f1ee7);}(_0x9787,0x16c));var _0x7978=function(_0x10abfe,_0x7a9ad6){_0x10abfe=_0x10abfe-0x0;var _0x473c1b=_0x9787[_0x10abfe];return _0x473c1b;};'use strict';var multer=require(_0x7978('0x0'));var util=require(_0x7978('0x1'));var path=require(_0x7978('0x2'));var timeout=require('connect-timeout');var express=require(_0x7978('0x3'));var router=express[_0x7978('0x4')]();var fs_extra=require(_0x7978('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7978('0x6'));var config=require(_0x7978('0x7'));var controller=require(_0x7978('0x8'));router['get']('/',auth[_0x7978('0x9')](),controller[_0x7978('0xa')]);router[_0x7978('0xb')](_0x7978('0xc'),auth[_0x7978('0x9')](),controller[_0x7978('0xd')]);router['get'](_0x7978('0xe'),auth[_0x7978('0x9')](),controller[_0x7978('0xf')]);router[_0x7978('0x10')]('/',auth[_0x7978('0x9')](),controller[_0x7978('0x11')]);router[_0x7978('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x7978('0x13')]);router['delete'](_0x7978('0xe'),auth[_0x7978('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x619e=['post','create','put','update','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xb301ed,_0x280e7f){var _0x3558be=function(_0x5f18d1){while(--_0x5f18d1){_0xb301ed['push'](_0xb301ed['shift']());}};_0x3558be(++_0x280e7f);}(_0x619e,0x15b));var _0xe619=function(_0xfe2c60,_0x1866fd){_0xfe2c60=_0xfe2c60-0x0;var _0x1da88e=_0x619e[_0xfe2c60];return _0x1da88e;};'use strict';var multer=require(_0xe619('0x0'));var util=require(_0xe619('0x1'));var path=require(_0xe619('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe619('0x3'));var auth=require(_0xe619('0x4'));var interaction=require(_0xe619('0x5'));var config=require('../../config/environment');var controller=require(_0xe619('0x6'));router[_0xe619('0x7')]('/',auth[_0xe619('0x8')](),controller[_0xe619('0x9')]);router['get'](_0xe619('0xa'),auth[_0xe619('0x8')](),controller[_0xe619('0xb')]);router[_0xe619('0x7')](_0xe619('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xe619('0xd')]('/',auth[_0xe619('0x8')](),controller[_0xe619('0xe')]);router[_0xe619('0xf')]('/:id',auth[_0xe619('0x8')](),controller[_0xe619('0x10')]);router['delete']('/:id',auth[_0xe619('0x8')](),controller['destroy']);module[_0xe619('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 5d75d92..4d45c94 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ffd=['queue','DATE','sequelize','exports','STRING','account','agent'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x16c0f0,_0xf93e70){_0x16c0f0=_0x16c0f0-0x0;var _0x2505f4=_0x9ffd[_0x16c0f0];return _0x2505f4;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'uniqueid':{'type':Sequelize[_0xd9ff('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xd9ff('0x3'),_0xd9ff('0x4'),_0xd9ff('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xd9ff('0x6')]}}; \ No newline at end of file +var _0xc15c=['account','queue','STRING','ENUM'];(function(_0x21fbab,_0x1bda8d){var _0x29fef1=function(_0x1ff144){while(--_0x1ff144){_0x21fbab['push'](_0x21fbab['shift']());}};_0x29fef1(++_0x1bda8d);}(_0xc15c,0xae));var _0xcc15=function(_0x167233,_0x2d3947){_0x167233=_0x167233-0x0;var _0x3fc748=_0xc15c[_0x167233];return _0x3fc748;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xcc15('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xcc15('0x1')](_0xcc15('0x2'),'agent',_0xcc15('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 66636db..cfc3498 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc0c=['../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','error','stack','name','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','WhatsappTransferReport','include','findAll','catch','params','includeAll','find','create','body','describe','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x4b90f8,_0x3a3331){var _0x3723f3=function(_0x4b6d7f){while(--_0x4b6d7f){_0x4b90f8['push'](_0x4b90f8['shift']());}};_0x3723f3(++_0x3a3331);}(_0xfc0c,0x103));var _0xcfc0=function(_0x43dec1,_0x53f198){_0x43dec1=_0x43dec1-0x0;var _0x5ca575=_0xfc0c[_0x43dec1];return _0x5ca575;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcfc0('0x0'));var zipdir=require(_0xcfc0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcfc0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcfc0('0x3'));var util=require(_0xcfc0('0x4'));var path=require(_0xcfc0('0x5'));var sox=require(_0xcfc0('0x6'));var csv=require(_0xcfc0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfc0('0x8'));var _=require(_0xcfc0('0x9'));var squel=require('squel');var crypto=require(_0xcfc0('0xa'));var jsforce=require(_0xcfc0('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcfc0('0x7'));var querystring=require('querystring');var Papa=require(_0xcfc0('0xc'));var Redis=require(_0xcfc0('0xd'));var authService=require(_0xcfc0('0xe'));var qs=require(_0xcfc0('0xf'));var as=require(_0xcfc0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcfc0('0x11'))('api');var utils=require(_0xcfc0('0x12'));var config=require(_0xcfc0('0x13'));var licenseUtil=require(_0xcfc0('0x14'));var db=require(_0xcfc0('0x15'))['db'];function respondWithStatusCode(_0x245bc8,_0x5bd9e5){_0x5bd9e5=_0x5bd9e5||0xcc;return function(_0x14892f){if(_0x14892f){return _0x245bc8[_0xcfc0('0x16')](_0x5bd9e5);}return _0x245bc8['status'](_0x5bd9e5)[_0xcfc0('0x17')]();};}function respondWithResult(_0x32d2fb,_0x12f305){_0x12f305=_0x12f305||0xc8;return function(_0x132ed0){if(_0x132ed0){return _0x32d2fb[_0xcfc0('0x18')](_0x12f305)['json'](_0x132ed0);}};}function respondWithFilteredResult(_0x355b56,_0x1ecece){return function(_0x221515){if(_0x221515){var _0x478d61=typeof _0x1ecece[_0xcfc0('0x19')]===_0xcfc0('0x1a')&&typeof _0x1ecece[_0xcfc0('0x1b')]==='undefined';var _0x42624a=_0x221515[_0xcfc0('0x1c')];var _0x429b20=_0x478d61?0x0:_0x1ecece['offset'];var _0x3e7065=_0x478d61?_0x221515[_0xcfc0('0x1c')]:_0x1ecece[_0xcfc0('0x19')]+_0x1ecece['limit'];var _0x193f5e;if(_0x3e7065>=_0x42624a){_0x3e7065=_0x42624a;_0x193f5e=0xc8;}else{_0x193f5e=0xce;}_0x355b56[_0xcfc0('0x18')](_0x193f5e);return _0x355b56[_0xcfc0('0x1d')]('Content-Range',_0x429b20+'-'+_0x3e7065+'/'+_0x42624a)[_0xcfc0('0x1e')](_0x221515);}return null;};}function patchUpdates(_0x4fa2f8){return function(_0x365d20){try{jsonpatch['apply'](_0x365d20,_0x4fa2f8,!![]);}catch(_0x1d136c){return BPromise[_0xcfc0('0x1f')](_0x1d136c);}return _0x365d20[_0xcfc0('0x20')]();};}function saveUpdates(_0x2ac41a,_0x3e5358){return function(_0x3be8f2){if(_0x3be8f2){return _0x3be8f2[_0xcfc0('0x21')](_0x2ac41a)[_0xcfc0('0x22')](function(_0x36b6bb){return _0x36b6bb;});}return null;};}function removeEntity(_0x265a75,_0x3f43d4){return function(_0x5f4f2e){if(_0x5f4f2e){return _0x5f4f2e[_0xcfc0('0x23')]()[_0xcfc0('0x22')](function(){_0x265a75['status'](0xcc)[_0xcfc0('0x17')]();});}};}function handleEntityNotFound(_0xb42a0b,_0xa52a43){return function(_0x57f3cc){if(!_0x57f3cc){_0xb42a0b['sendStatus'](0x194);}return _0x57f3cc;};}function handleError(_0x14457a,_0x35962d){_0x35962d=_0x35962d||0x1f4;return function(_0x32c99e){logger[_0xcfc0('0x24')](_0x32c99e[_0xcfc0('0x25')]);if(_0x32c99e[_0xcfc0('0x26')]){delete _0x32c99e[_0xcfc0('0x26')];}_0x14457a[_0xcfc0('0x18')](_0x35962d)['send'](_0x32c99e);};}exports['index']=function(_0x7388e4,_0x2d5587){var _0x31a4fc={},_0x32fb3b={},_0x57d132={'count':0x0,'rows':[]};var _0xa0bb8f=_['map'](db['WhatsappTransferReport'][_0xcfc0('0x27')],function(_0x5a4f72){return{'name':_0x5a4f72[_0xcfc0('0x28')],'type':_0x5a4f72[_0xcfc0('0x29')][_0xcfc0('0x2a')]};});_0x32fb3b[_0xcfc0('0x2b')]=_[_0xcfc0('0x2c')](_0xa0bb8f,'name');_0x32fb3b[_0xcfc0('0x2d')]=_[_0xcfc0('0x2e')](_0x7388e4[_0xcfc0('0x2d')]);_0x32fb3b['filters']=_[_0xcfc0('0x2f')](_0x32fb3b[_0xcfc0('0x2b')],_0x32fb3b[_0xcfc0('0x2d')]);_0x31a4fc[_0xcfc0('0x30')]=_[_0xcfc0('0x2f')](_0x32fb3b[_0xcfc0('0x2b')],qs[_0xcfc0('0x31')](_0x7388e4[_0xcfc0('0x2d')][_0xcfc0('0x31')]));_0x31a4fc[_0xcfc0('0x30')]=_0x31a4fc[_0xcfc0('0x30')][_0xcfc0('0x32')]?_0x31a4fc[_0xcfc0('0x30')]:_0x32fb3b[_0xcfc0('0x2b')];if(!_0x7388e4[_0xcfc0('0x2d')]['hasOwnProperty'](_0xcfc0('0x33'))){_0x31a4fc[_0xcfc0('0x1b')]=qs[_0xcfc0('0x1b')](_0x7388e4[_0xcfc0('0x2d')][_0xcfc0('0x1b')]);_0x31a4fc[_0xcfc0('0x19')]=qs[_0xcfc0('0x19')](_0x7388e4[_0xcfc0('0x2d')][_0xcfc0('0x19')]);}_0x31a4fc['order']=qs[_0xcfc0('0x34')](_0x7388e4['query'][_0xcfc0('0x34')]);_0x31a4fc[_0xcfc0('0x35')]=qs[_0xcfc0('0x36')](_[_0xcfc0('0x37')](_0x7388e4['query'],_0x32fb3b['filters']),_0xa0bb8f);if(_0x7388e4[_0xcfc0('0x2d')]['filter']){_0x31a4fc[_0xcfc0('0x35')]=_[_0xcfc0('0x38')](_0x31a4fc[_0xcfc0('0x35')],{'$or':_[_0xcfc0('0x2c')](_0xa0bb8f,function(_0x96fc3c){if(_0x96fc3c['type']!==_0xcfc0('0x39')){var _0x215098={};_0x215098[_0x96fc3c['name']]={'$like':'%'+_0x7388e4[_0xcfc0('0x2d')][_0xcfc0('0x3a')]+'%'};return _0x215098;}})});}_0x31a4fc=_['merge']({},_0x31a4fc,_0x7388e4[_0xcfc0('0x3b')]);var _0x4cc920={'where':_0x31a4fc[_0xcfc0('0x35')]};return db[_0xcfc0('0x3c')][_0xcfc0('0x1c')](_0x4cc920)[_0xcfc0('0x22')](function(_0x4e9451){_0x57d132[_0xcfc0('0x1c')]=_0x4e9451;if(_0x7388e4[_0xcfc0('0x2d')]['includeAll']){_0x31a4fc[_0xcfc0('0x3d')]=[{'all':!![]}];}return db[_0xcfc0('0x3c')][_0xcfc0('0x3e')](_0x31a4fc);})['then'](function(_0x253839){_0x57d132['rows']=_0x253839;return _0x57d132;})['then'](respondWithFilteredResult(_0x2d5587,_0x31a4fc))[_0xcfc0('0x3f')](handleError(_0x2d5587,null));};exports['show']=function(_0x9ca0bf,_0x2c402c){var _0x4b6d44={'raw':!![],'where':{'id':_0x9ca0bf[_0xcfc0('0x40')]['id']}},_0x51e26a={};_0x51e26a[_0xcfc0('0x2b')]=_[_0xcfc0('0x2e')](db['WhatsappTransferReport'][_0xcfc0('0x27')]);_0x51e26a['query']=_[_0xcfc0('0x2e')](_0x9ca0bf[_0xcfc0('0x2d')]);_0x51e26a[_0xcfc0('0x36')]=_[_0xcfc0('0x2f')](_0x51e26a[_0xcfc0('0x2b')],_0x51e26a[_0xcfc0('0x2d')]);_0x4b6d44[_0xcfc0('0x30')]=_[_0xcfc0('0x2f')](_0x51e26a[_0xcfc0('0x2b')],qs[_0xcfc0('0x31')](_0x9ca0bf[_0xcfc0('0x2d')]['fields']));_0x4b6d44[_0xcfc0('0x30')]=_0x4b6d44[_0xcfc0('0x30')][_0xcfc0('0x32')]?_0x4b6d44[_0xcfc0('0x30')]:_0x51e26a['model'];if(_0x9ca0bf[_0xcfc0('0x2d')][_0xcfc0('0x41')]){_0x4b6d44['include']=[{'all':!![]}];}_0x4b6d44=_[_0xcfc0('0x38')]({},_0x4b6d44,_0x9ca0bf[_0xcfc0('0x3b')]);return db[_0xcfc0('0x3c')][_0xcfc0('0x42')](_0x4b6d44)[_0xcfc0('0x22')](handleEntityNotFound(_0x2c402c,null))[_0xcfc0('0x22')](respondWithResult(_0x2c402c,null))[_0xcfc0('0x3f')](handleError(_0x2c402c,null));};exports[_0xcfc0('0x43')]=function(_0x786397,_0x101a15){return db[_0xcfc0('0x3c')][_0xcfc0('0x43')](_0x786397['body'],{})['then'](respondWithResult(_0x101a15,0xc9))[_0xcfc0('0x3f')](handleError(_0x101a15,null));};exports[_0xcfc0('0x21')]=function(_0x3de97e,_0x1f06dd){if(_0x3de97e[_0xcfc0('0x44')]['id']){delete _0x3de97e[_0xcfc0('0x44')]['id'];}return db[_0xcfc0('0x3c')][_0xcfc0('0x42')]({'where':{'id':_0x3de97e[_0xcfc0('0x40')]['id']}})[_0xcfc0('0x22')](handleEntityNotFound(_0x1f06dd,null))[_0xcfc0('0x22')](saveUpdates(_0x3de97e[_0xcfc0('0x44')],null))[_0xcfc0('0x22')](respondWithResult(_0x1f06dd,null))[_0xcfc0('0x3f')](handleError(_0x1f06dd,null));};exports[_0xcfc0('0x23')]=function(_0x35c442,_0x28ad72){return db[_0xcfc0('0x3c')][_0xcfc0('0x42')]({'where':{'id':_0x35c442[_0xcfc0('0x40')]['id']}})[_0xcfc0('0x22')](handleEntityNotFound(_0x28ad72,null))[_0xcfc0('0x22')](removeEntity(_0x28ad72,null))[_0xcfc0('0x3f')](handleError(_0x28ad72,null));};exports[_0xcfc0('0x45')]=function(_0x3bea43,_0x1a680c){return db[_0xcfc0('0x3c')][_0xcfc0('0x45')]()[_0xcfc0('0x22')](respondWithResult(_0x1a680c,null))['catch'](handleError(_0x1a680c,null));}; \ No newline at end of file +var _0x4511=['findAll','rows','catch','params','includeAll','create','body','destroy','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','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','sendStatus','status','json','limit','undefined','count','Content-Range','reject','update','then','end','error','stack','name','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','offset','sort','where','pick','merge','VIRTUAL','filter','options','include'];(function(_0x28da41,_0x4eeb51){var _0x95362b=function(_0x22446e){while(--_0x22446e){_0x28da41['push'](_0x28da41['shift']());}};_0x95362b(++_0x4eeb51);}(_0x4511,0x18b));var _0x1451=function(_0x5eb737,_0x4e3819){_0x5eb737=_0x5eb737-0x0;var _0x213cb8=_0x4511[_0x5eb737];return _0x213cb8;};'use strict';var emlformat=require(_0x1451('0x0'));var rimraf=require(_0x1451('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1451('0x2'));var rp=require(_0x1451('0x3'));var moment=require(_0x1451('0x4'));var BPromise=require(_0x1451('0x5'));var Mustache=require(_0x1451('0x6'));var util=require('util');var path=require(_0x1451('0x7'));var sox=require(_0x1451('0x8'));var csv=require(_0x1451('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1451('0xa'));var _=require(_0x1451('0xb'));var squel=require(_0x1451('0xc'));var crypto=require(_0x1451('0xd'));var jsforce=require(_0x1451('0xe'));var deskjs=require(_0x1451('0xf'));var toCsv=require(_0x1451('0x9'));var querystring=require(_0x1451('0x10'));var Papa=require(_0x1451('0x11'));var Redis=require(_0x1451('0x12'));var authService=require(_0x1451('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1451('0x14'));var hardwareService=require(_0x1451('0x15'));var logger=require(_0x1451('0x16'))(_0x1451('0x17'));var utils=require(_0x1451('0x18'));var config=require(_0x1451('0x19'));var licenseUtil=require(_0x1451('0x1a'));var db=require(_0x1451('0x1b'))['db'];function respondWithStatusCode(_0x5a4624,_0x4c10a3){_0x4c10a3=_0x4c10a3||0xcc;return function(_0x40d204){if(_0x40d204){return _0x5a4624[_0x1451('0x1c')](_0x4c10a3);}return _0x5a4624[_0x1451('0x1d')](_0x4c10a3)['end']();};}function respondWithResult(_0x492e24,_0x46813b){_0x46813b=_0x46813b||0xc8;return function(_0x517e84){if(_0x517e84){return _0x492e24[_0x1451('0x1d')](_0x46813b)[_0x1451('0x1e')](_0x517e84);}};}function respondWithFilteredResult(_0x227f0e,_0x88b26e){return function(_0x28981a){if(_0x28981a){var _0x50b017=typeof _0x88b26e['offset']==='undefined'&&typeof _0x88b26e[_0x1451('0x1f')]===_0x1451('0x20');var _0x3a7a36=_0x28981a['count'];var _0x20f5ad=_0x50b017?0x0:_0x88b26e['offset'];var _0x41640b=_0x50b017?_0x28981a[_0x1451('0x21')]:_0x88b26e['offset']+_0x88b26e[_0x1451('0x1f')];var _0x3ec08e;if(_0x41640b>=_0x3a7a36){_0x41640b=_0x3a7a36;_0x3ec08e=0xc8;}else{_0x3ec08e=0xce;}_0x227f0e[_0x1451('0x1d')](_0x3ec08e);return _0x227f0e['set'](_0x1451('0x22'),_0x20f5ad+'-'+_0x41640b+'/'+_0x3a7a36)[_0x1451('0x1e')](_0x28981a);}return null;};}function patchUpdates(_0x5d0183){return function(_0x1d6adb){try{jsonpatch['apply'](_0x1d6adb,_0x5d0183,!![]);}catch(_0x556377){return BPromise[_0x1451('0x23')](_0x556377);}return _0x1d6adb['save']();};}function saveUpdates(_0x2ce497,_0x259df6){return function(_0xf5fbe){if(_0xf5fbe){return _0xf5fbe[_0x1451('0x24')](_0x2ce497)['then'](function(_0x1f9720){return _0x1f9720;});}return null;};}function removeEntity(_0xafaeec,_0x420097){return function(_0x92dcbe){if(_0x92dcbe){return _0x92dcbe['destroy']()[_0x1451('0x25')](function(){_0xafaeec[_0x1451('0x1d')](0xcc)[_0x1451('0x26')]();});}};}function handleEntityNotFound(_0x2ef746,_0x593d33){return function(_0x58415b){if(!_0x58415b){_0x2ef746[_0x1451('0x1c')](0x194);}return _0x58415b;};}function handleError(_0x1f302c,_0x71490c){_0x71490c=_0x71490c||0x1f4;return function(_0x21a076){logger[_0x1451('0x27')](_0x21a076[_0x1451('0x28')]);if(_0x21a076[_0x1451('0x29')]){delete _0x21a076[_0x1451('0x29')];}_0x1f302c[_0x1451('0x1d')](_0x71490c)['send'](_0x21a076);};}exports[_0x1451('0x2a')]=function(_0x31c954,_0x29420d){var _0x1a0ecc={},_0x10d7f9={},_0x319362={'count':0x0,'rows':[]};var _0x2aeca4=_[_0x1451('0x2b')](db[_0x1451('0x2c')][_0x1451('0x2d')],function(_0x5a78ee){return{'name':_0x5a78ee[_0x1451('0x2e')],'type':_0x5a78ee[_0x1451('0x2f')][_0x1451('0x30')]};});_0x10d7f9[_0x1451('0x31')]=_['map'](_0x2aeca4,'name');_0x10d7f9[_0x1451('0x32')]=_[_0x1451('0x33')](_0x31c954[_0x1451('0x32')]);_0x10d7f9[_0x1451('0x34')]=_[_0x1451('0x35')](_0x10d7f9[_0x1451('0x31')],_0x10d7f9[_0x1451('0x32')]);_0x1a0ecc['attributes']=_[_0x1451('0x35')](_0x10d7f9[_0x1451('0x31')],qs[_0x1451('0x36')](_0x31c954['query'][_0x1451('0x36')]));_0x1a0ecc[_0x1451('0x37')]=_0x1a0ecc[_0x1451('0x37')][_0x1451('0x38')]?_0x1a0ecc[_0x1451('0x37')]:_0x10d7f9[_0x1451('0x31')];if(!_0x31c954['query'][_0x1451('0x39')]('nolimit')){_0x1a0ecc['limit']=qs[_0x1451('0x1f')](_0x31c954[_0x1451('0x32')][_0x1451('0x1f')]);_0x1a0ecc[_0x1451('0x3a')]=qs[_0x1451('0x3a')](_0x31c954[_0x1451('0x32')]['offset']);}_0x1a0ecc['order']=qs[_0x1451('0x3b')](_0x31c954['query'][_0x1451('0x3b')]);_0x1a0ecc[_0x1451('0x3c')]=qs[_0x1451('0x34')](_[_0x1451('0x3d')](_0x31c954['query'],_0x10d7f9[_0x1451('0x34')]),_0x2aeca4);if(_0x31c954['query']['filter']){_0x1a0ecc[_0x1451('0x3c')]=_[_0x1451('0x3e')](_0x1a0ecc[_0x1451('0x3c')],{'$or':_['map'](_0x2aeca4,function(_0xeacff8){if(_0xeacff8[_0x1451('0x2f')]!==_0x1451('0x3f')){var _0x58b548={};_0x58b548[_0xeacff8[_0x1451('0x29')]]={'$like':'%'+_0x31c954[_0x1451('0x32')][_0x1451('0x40')]+'%'};return _0x58b548;}})});}_0x1a0ecc=_[_0x1451('0x3e')]({},_0x1a0ecc,_0x31c954[_0x1451('0x41')]);var _0x3e8765={'where':_0x1a0ecc[_0x1451('0x3c')]};return db[_0x1451('0x2c')][_0x1451('0x21')](_0x3e8765)[_0x1451('0x25')](function(_0x3be075){_0x319362['count']=_0x3be075;if(_0x31c954[_0x1451('0x32')]['includeAll']){_0x1a0ecc[_0x1451('0x42')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x1451('0x43')](_0x1a0ecc);})['then'](function(_0xf89b5a){_0x319362[_0x1451('0x44')]=_0xf89b5a;return _0x319362;})[_0x1451('0x25')](respondWithFilteredResult(_0x29420d,_0x1a0ecc))[_0x1451('0x45')](handleError(_0x29420d,null));};exports['show']=function(_0x25c0ea,_0x102d87){var _0x1f52a6={'raw':!![],'where':{'id':_0x25c0ea[_0x1451('0x46')]['id']}},_0x1bd8a8={};_0x1bd8a8[_0x1451('0x31')]=_[_0x1451('0x33')](db[_0x1451('0x2c')][_0x1451('0x2d')]);_0x1bd8a8['query']=_[_0x1451('0x33')](_0x25c0ea[_0x1451('0x32')]);_0x1bd8a8[_0x1451('0x34')]=_['intersection'](_0x1bd8a8[_0x1451('0x31')],_0x1bd8a8['query']);_0x1f52a6[_0x1451('0x37')]=_[_0x1451('0x35')](_0x1bd8a8[_0x1451('0x31')],qs[_0x1451('0x36')](_0x25c0ea[_0x1451('0x32')][_0x1451('0x36')]));_0x1f52a6['attributes']=_0x1f52a6[_0x1451('0x37')][_0x1451('0x38')]?_0x1f52a6['attributes']:_0x1bd8a8['model'];if(_0x25c0ea[_0x1451('0x32')][_0x1451('0x47')]){_0x1f52a6[_0x1451('0x42')]=[{'all':!![]}];}_0x1f52a6=_[_0x1451('0x3e')]({},_0x1f52a6,_0x25c0ea[_0x1451('0x41')]);return db[_0x1451('0x2c')]['find'](_0x1f52a6)['then'](handleEntityNotFound(_0x102d87,null))['then'](respondWithResult(_0x102d87,null))[_0x1451('0x45')](handleError(_0x102d87,null));};exports[_0x1451('0x48')]=function(_0x59eb1d,_0x4faf56){return db[_0x1451('0x2c')][_0x1451('0x48')](_0x59eb1d[_0x1451('0x49')],{})[_0x1451('0x25')](respondWithResult(_0x4faf56,0xc9))[_0x1451('0x45')](handleError(_0x4faf56,null));};exports[_0x1451('0x24')]=function(_0x4e406c,_0x383d13){if(_0x4e406c['body']['id']){delete _0x4e406c[_0x1451('0x49')]['id'];}return db[_0x1451('0x2c')]['find']({'where':{'id':_0x4e406c[_0x1451('0x46')]['id']}})[_0x1451('0x25')](handleEntityNotFound(_0x383d13,null))[_0x1451('0x25')](saveUpdates(_0x4e406c['body'],null))['then'](respondWithResult(_0x383d13,null))[_0x1451('0x45')](handleError(_0x383d13,null));};exports[_0x1451('0x4a')]=function(_0x3537c9,_0x76be7){return db['WhatsappTransferReport'][_0x1451('0x4b')]({'where':{'id':_0x3537c9['params']['id']}})[_0x1451('0x25')](handleEntityNotFound(_0x76be7,null))['then'](removeEntity(_0x76be7,null))[_0x1451('0x45')](handleError(_0x76be7,null));};exports[_0x1451('0x4c')]=function(_0x1d811f,_0x5ab237){return db['WhatsappTransferReport'][_0x1451('0x4c')]()[_0x1451('0x25')](respondWithResult(_0x5ab237,null))[_0x1451('0x45')](handleError(_0x5ab237,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 2605a1e..d09a5c3 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2ed=['uniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer'];(function(_0x9a67a4,_0x5bfbad){var _0x5ddcd2=function(_0xadfb5f){while(--_0xadfb5f){_0x9a67a4['push'](_0x9a67a4['shift']());}};_0x5ddcd2(++_0x5bfbad);}(_0xc2ed,0x160));var _0xdc2e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xc2ed[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0xdc2e('0x0'));var util=require(_0xdc2e('0x1'));var logger=require('../../config/logger')(_0xdc2e('0x2'));var moment=require(_0xdc2e('0x3'));var BPromise=require('bluebird');var rp=require(_0xdc2e('0x4'));var fs=require('fs');var path=require(_0xdc2e('0x5'));var rimraf=require(_0xdc2e('0x6'));var config=require(_0xdc2e('0x7'));var attributes=require('./whatsappTransferReport.attributes');module[_0xdc2e('0x8')]=function(_0x4c32e7,_0x5e1240){return _0x4c32e7[_0xdc2e('0x9')](_0xdc2e('0xa'),attributes,{'tableName':_0xdc2e('0xb'),'paranoid':![],'indexes':[{'name':_0xdc2e('0xc'),'fields':[_0xdc2e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4630=['api','moment','bluebird','request-promise','path','define','report_whatsapp_transfer','uniqueid','lodash','util'];(function(_0x32c34d,_0x4b7972){var _0x5f1e30=function(_0x3f5040){while(--_0x3f5040){_0x32c34d['push'](_0x32c34d['shift']());}};_0x5f1e30(++_0x4b7972);}(_0x4630,0x1ca));var _0x0463=function(_0x29b50a,_0x2865a5){_0x29b50a=_0x29b50a-0x0;var _0x5566bf=_0x4630[_0x29b50a];return _0x5566bf;};'use strict';var _=require(_0x0463('0x0'));var util=require(_0x0463('0x1'));var logger=require('../../config/logger')(_0x0463('0x2'));var moment=require(_0x0463('0x3'));var BPromise=require(_0x0463('0x4'));var rp=require(_0x0463('0x5'));var fs=require('fs');var path=require(_0x0463('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0xa60d71,_0x569ef5){return _0xa60d71[_0x0463('0x7')]('WhatsappTransferReport',attributes,{'tableName':_0x0463('0x8'),'paranoid':![],'indexes':[{'name':_0x0463('0x9'),'fields':[_0x0463('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index ef17bcd..b8e83f1 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1564=['info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message'];(function(_0x262165,_0x2f5be6){var _0x5e3b12=function(_0x4bf4f7){while(--_0x4bf4f7){_0x262165['push'](_0x262165['shift']());}};_0x5e3b12(++_0x2f5be6);}(_0x1564,0x15c));var _0x4156=function(_0x505b15,_0x576feb){_0x505b15=_0x505b15-0x0;var _0x3f4c13=_0x1564[_0x505b15];return _0x3f4c13;};'use strict';var _=require(_0x4156('0x0'));var util=require(_0x4156('0x1'));var moment=require(_0x4156('0x2'));var BPromise=require('bluebird');var rs=require(_0x4156('0x3'));var fs=require('fs');var Redis=require(_0x4156('0x4'));var db=require(_0x4156('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4156('0x6'))('rpc');var config=require(_0x4156('0x7'));var jayson=require(_0x4156('0x8'));var client=jayson[_0x4156('0x9')][_0x4156('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x192c0a,_0x383af6,_0xb3eef9){return new BPromise(function(_0x5bb863,_0x399b5c){return client[_0x4156('0xb')](_0x192c0a,_0xb3eef9)[_0x4156('0xc')](function(_0x4d5725){logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x383af6,_0x4156('0xd'));logger[_0x4156('0xe')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x383af6,_0x4156('0xd'),JSON[_0x4156('0xf')](_0x4d5725));if(_0x4d5725['error']){if(_0x4d5725[_0x4156('0x10')][_0x4156('0x11')]===0x1f4){logger[_0x4156('0x10')](_0x4156('0x12'),_0x383af6,_0x4d5725[_0x4156('0x10')][_0x4156('0x13')]);return _0x399b5c(_0x4d5725['error'][_0x4156('0x13')]);}logger['error'](_0x4156('0x12'),_0x383af6,_0x4d5725['error'][_0x4156('0x13')]);return _0x5bb863(_0x4d5725[_0x4156('0x10')][_0x4156('0x13')]);}else{logger[_0x4156('0x14')](_0x4156('0x12'),_0x383af6,_0x4156('0xd'));_0x5bb863(_0x4d5725[_0x4156('0x15')][_0x4156('0x13')]);}})[_0x4156('0x16')](function(_0x197184){logger[_0x4156('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x383af6,_0x197184);_0x399b5c(_0x197184);});});} \ No newline at end of file +var _0x5b53=['../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappTransferReport,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x44c26c,_0x5a63c9){var _0x5bf55e=function(_0x3b9f2d){while(--_0x3b9f2d){_0x44c26c['push'](_0x44c26c['shift']());}};_0x5bf55e(++_0x5a63c9);}(_0x5b53,0x1b1));var _0x35b5=function(_0xb29bef,_0x45aff1){_0xb29bef=_0xb29bef-0x0;var _0x878163=_0x5b53[_0xb29bef];return _0x878163;};'use strict';var _=require(_0x35b5('0x0'));var util=require('util');var moment=require(_0x35b5('0x1'));var BPromise=require(_0x35b5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35b5('0x3'));var db=require(_0x35b5('0x4'))['db'];var utils=require(_0x35b5('0x5'));var logger=require('../../config/logger')(_0x35b5('0x6'));var config=require(_0x35b5('0x7'));var jayson=require(_0x35b5('0x8'));var client=jayson[_0x35b5('0x9')][_0x35b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56ccd5,_0x4fb588,_0x260260){return new BPromise(function(_0x443022,_0x23aa97){return client['request'](_0x56ccd5,_0x260260)['then'](function(_0x2954f0){logger[_0x35b5('0xb')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4fb588,_0x35b5('0xc'));logger[_0x35b5('0xd')](_0x35b5('0xe'),_0x4fb588,_0x35b5('0xc'),JSON[_0x35b5('0xf')](_0x2954f0));if(_0x2954f0[_0x35b5('0x10')]){if(_0x2954f0[_0x35b5('0x10')][_0x35b5('0x11')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x4fb588,_0x2954f0[_0x35b5('0x10')]['message']);return _0x23aa97(_0x2954f0[_0x35b5('0x10')][_0x35b5('0x12')]);}logger[_0x35b5('0x10')](_0x35b5('0x13'),_0x4fb588,_0x2954f0['error']['message']);return _0x443022(_0x2954f0[_0x35b5('0x10')][_0x35b5('0x12')]);}else{logger[_0x35b5('0xb')](_0x35b5('0x13'),_0x4fb588,'request\x20sent');_0x443022(_0x2954f0[_0x35b5('0x14')][_0x35b5('0x12')]);}})[_0x35b5('0x15')](function(_0x1ecb93){logger[_0x35b5('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4fb588,_0x1ecb93);_0x23aa97(_0x1ecb93);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index c786ec3..11a1ba9 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4c7=['info','start','filter','exitCode','number','length','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','status','None','log','App\x20Ready!','catch','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/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','default','listen'];(function(_0x409186,_0x4b8b73){var _0x3deb43=function(_0x358728){while(--_0x358728){_0x409186['push'](_0x409186['shift']());}};_0x3deb43(++_0x4b8b73);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x395889,_0x40a0cf){_0x395889=_0x395889-0x0;var _0x50f6b2=_0xb4c7[_0x395889];return _0x50f6b2;};'use strict';var _=require(_0x7b4c('0x0'));var db=require(_0x7b4c('0x1'))['db'];var seedDb=require(_0x7b4c('0x2'));var checkLicense=require(_0x7b4c('0x3'));var rpc=require(_0x7b4c('0x4'));var config=require('./config/environment');var logger=require(_0x7b4c('0x5'))(_0x7b4c('0x6'));var pm2=require(_0x7b4c('0x7'));var pm2Config=require(_0x7b4c('0x8'));var schedule=require(_0x7b4c('0x9'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x7b4c('0xa'));var transcribe=require(_0x7b4c('0xb'));var provider=require(_0x7b4c('0xc'));function main(){return db['sequelize'][_0x7b4c('0xd')]()[_0x7b4c('0xe')](function(){if(config['seedDB']){return seedDb[_0x7b4c('0xf')]();}})[_0x7b4c('0xe')](function(){return checkLicense[_0x7b4c('0xf')]();})[_0x7b4c('0xe')](function(){return rpc[_0x7b4c('0x10')]();})[_0x7b4c('0xe')](function(_0x1a996f){logger[_0x7b4c('0x11')](_0x1a996f);return chat[_0x7b4c('0x12')]();})[_0x7b4c('0xe')](function(){return whatsapp['start']();})['then'](function(){return schedule[_0x7b4c('0x12')]();})[_0x7b4c('0xe')](function(){return transcribe[_0x7b4c('0x12')]();})[_0x7b4c('0xe')](function(){return provider[_0x7b4c('0x12')]();})[_0x7b4c('0xe')](function(_0x3ea0da){logger[_0x7b4c('0x11')](_0x3ea0da);return pm2[_0x7b4c('0x12')](pm2Config);})[_0x7b4c('0xe')](function(_0x593a19){var _0x2edb77=_0x593a19[_0x7b4c('0x13')](function(_0xdc71cd){return typeof _0xdc71cd[_0x7b4c('0x14')]===_0x7b4c('0x15')&&_0xdc71cd[_0x7b4c('0x14')]>=0x0;});if(_0x2edb77[_0x7b4c('0x16')]>0x0){throw new Error(_0x2edb77[_0x7b4c('0x16')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x7b4c('0x17')](_0x2edb77,function(_0xe71d88){return'\x22'+_0xe71d88[_0x7b4c('0x18')][_0x7b4c('0x19')]+'\x22';}));}logger['info'](_0x7b4c('0x1a'),_[_0x7b4c('0x17')](_[_0x7b4c('0x13')](_0x593a19,{'status':_0x7b4c('0x1b')}),_0x7b4c('0x19'))[_0x7b4c('0x1c')]());logger[_0x7b4c('0x11')](_0x7b4c('0x1d'),_[_0x7b4c('0x17')](_['filter'](_0x593a19,function(_0x1f06ec){return _0x1f06ec[_0x7b4c('0x1e')]!==_0x7b4c('0x1b');}),_0x7b4c('0x19'))[_0x7b4c('0x1c')]()||_0x7b4c('0x1f'));console[_0x7b4c('0x20')](_0x7b4c('0x21'));})[_0x7b4c('0x22')](function(_0x2c267c){console['log'](_0x7b4c('0x23'),_0x2c267c);logger[_0x7b4c('0x24')](_0x7b4c('0x25'),_0x2c267c);process[_0x7b4c('0x26')](0x1);});}main(); \ No newline at end of file +var _0x4aa3=['Online\x20apps:','filter','online','join','Offline\x20apps:','status','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/license','./rpc','./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','default','listen','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4aa3,0x174));var _0x34aa=function(_0x32e7f3,_0x313d33){_0x32e7f3=_0x32e7f3-0x0;var _0x14ed27=_0x4aa3[_0x32e7f3];return _0x14ed27;};'use strict';var _=require(_0x34aa('0x0'));var db=require(_0x34aa('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x34aa('0x2'));var rpc=require(_0x34aa('0x3'));var config=require('./config/environment');var logger=require(_0x34aa('0x4'))(_0x34aa('0x5'));var pm2=require('./config/pm2');var pm2Config=require(_0x34aa('0x6'));var schedule=require(_0x34aa('0x7'));var chat=require(_0x34aa('0x8'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x34aa('0x9'));var provider=require(_0x34aa('0xa'));function main(){return db['sequelize'][_0x34aa('0xb')]()[_0x34aa('0xc')](function(){if(config['seedDB']){return seedDb[_0x34aa('0xd')]();}})['then'](function(){return checkLicense['default']();})[_0x34aa('0xc')](function(){return rpc[_0x34aa('0xe')]();})[_0x34aa('0xc')](function(_0x10fc02){logger[_0x34aa('0xf')](_0x10fc02);return chat[_0x34aa('0x10')]();})['then'](function(){return whatsapp[_0x34aa('0x10')]();})['then'](function(){return schedule['start']();})[_0x34aa('0xc')](function(){return transcribe[_0x34aa('0x10')]();})[_0x34aa('0xc')](function(){return provider['start']();})[_0x34aa('0xc')](function(_0x5a5a5b){logger[_0x34aa('0xf')](_0x5a5a5b);return pm2[_0x34aa('0x10')](pm2Config);})[_0x34aa('0xc')](function(_0x3a6819){var _0x29713a=_0x3a6819['filter'](function(_0x3dc282){return typeof _0x3dc282[_0x34aa('0x11')]===_0x34aa('0x12')&&_0x3dc282[_0x34aa('0x11')]>=0x0;});if(_0x29713a[_0x34aa('0x13')]>0x0){throw new Error(_0x29713a[_0x34aa('0x13')]+_0x34aa('0x14')+_[_0x34aa('0x15')](_0x29713a,function(_0x2663ea){return'\x22'+_0x2663ea[_0x34aa('0x16')][_0x34aa('0x17')]+'\x22';}));}logger[_0x34aa('0xf')](_0x34aa('0x18'),_[_0x34aa('0x15')](_[_0x34aa('0x19')](_0x3a6819,{'status':_0x34aa('0x1a')}),_0x34aa('0x17'))[_0x34aa('0x1b')]());logger[_0x34aa('0xf')](_0x34aa('0x1c'),_[_0x34aa('0x15')](_[_0x34aa('0x19')](_0x3a6819,function(_0x329a6b){return _0x329a6b[_0x34aa('0x1d')]!==_0x34aa('0x1a');}),_0x34aa('0x17'))[_0x34aa('0x1b')]()||'None');console[_0x34aa('0x1e')](_0x34aa('0x1f'));})['catch'](function(_0x2db2ec){console[_0x34aa('0x1e')](_0x34aa('0x20'),_0x2db2ec);logger[_0x34aa('0x21')](_0x34aa('0x22'),_0x2db2ec);process[_0x34aa('0x23')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 8e7e342..194ee6b 100644 --- a/server/components/auth/service.js +++ b/server/components/auth/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66c1=['then','closed','query','status','unmanaged','Unmanaged.','Forbidden.','headers','authorization','startsWith','Basic','User','find','name','authenticate','json','Wrong\x20credentials.','catch','Unknown\x20authorization\x20format','apikey','getUuid','Setting','allowedLoginAttempts','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','User\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','use','webrtc','isMiddleware','signToken','setTokenCookie','cookie','motion.token','send','isNil','apiKeyNonce','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','ValidationError','validatePasswordHistory','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','updatePasswordsHistory','decryptString','length','splice','unshift','join','promisify','secret','payload','options','session','randomBytes','toString','hex','floor','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','secrets','role','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarExpires','phoneBarRemoteControl','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','params','disposition'];(function(_0x4ce15c,_0x1bbcbd){var _0x5ee259=function(_0xfb0acd){while(--_0xfb0acd){_0x4ce15c['push'](_0x4ce15c['shift']());}};_0x5ee259(++_0x1bbcbd);}(_0x66c1,0xd0));var _0x166c=function(_0x40a0d5,_0x26f161){_0x40a0d5=_0x40a0d5-0x0;var _0x3065c1=_0x66c1[_0x40a0d5];return _0x3065c1;};'use strict';var db=require(_0x166c('0x0'))['db'];var config=require(_0x166c('0x1'));var hardwareConf=require(_0x166c('0x2'));var licenseUtil=require(_0x166c('0x3'));var encryptor=require('../encryptor');var _=require(_0x166c('0x4'));var jwt=require(_0x166c('0x5'));var expressJwt=require(_0x166c('0x6'));var compose=require(_0x166c('0x7'));var basicAuth=require(_0x166c('0x8'));var crypto=require(_0x166c('0x9'));var BPromise=require(_0x166c('0xa'));var util=require(_0x166c('0xb'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x166c('0xc')]['session']});var userAttributes=['id',_0x166c('0xd'),'fullname','name',_0x166c('0xe'),_0x166c('0xf'),_0x166c('0x10'),_0x166c('0x11'),_0x166c('0x12'),_0x166c('0x13'),_0x166c('0x14'),_0x166c('0x15'),'faxPause',_0x166c('0x16'),_0x166c('0x17'),_0x166c('0x18'),_0x166c('0x19'),_0x166c('0x1a'),_0x166c('0x1b'),_0x166c('0x1c'),_0x166c('0x1d'),'passwordResetAt',_0x166c('0x1e'),_0x166c('0x1f'),'phoneBarAutoAnswerDelay',_0x166c('0x20'),'phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings',_0x166c('0x21'),'phoneBarPrefixRequired',_0x166c('0x22'),'phoneBarRemoteControlPort',_0x166c('0x23'),_0x166c('0x24'),_0x166c('0x25'),_0x166c('0x26'),_0x166c('0x27'),_0x166c('0x28'),_0x166c('0x29'),_0x166c('0x2a'),_0x166c('0x2b'),_0x166c('0x2c'),_0x166c('0x2d'),_0x166c('0x2e'),_0x166c('0x2f'),_0x166c('0x30'),_0x166c('0x31'),_0x166c('0x32'),_0x166c('0x33'),'openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer',_0x166c('0x34'),'whatsappAutoanswer',_0x166c('0x35'),_0x166c('0x36')];exports[_0x166c('0x37')]=function(){return this[_0x166c('0x38')](!![])['use'](function(_0x4d22a5,_0x4ae734,_0x17aebb){if(_0x4d22a5[_0x166c('0x39')]){_0x17aebb();}else{return db[_0x166c('0x3a')][_0x166c('0x3b')]({'where':{'id':_0x4d22a5[_0x166c('0x3c')]['id']},'attributes':['id','closed',_0x166c('0x3d')],'raw':!![]})[_0x166c('0x3e')](function(_0x1280b6){if(_0x1280b6&&_0x1280b6[_0x166c('0x3f')]&&!_0x4d22a5[_0x166c('0x40')]['forceDownload']){return _0x4ae734[_0x166c('0x41')](_0x1280b6[_0x166c('0x3d')]==='unmanaged'?0x195:0x193)['json']({'message':_0x1280b6[_0x166c('0x3d')]===_0x166c('0x42')?_0x166c('0x43'):_0x166c('0x44')});}else{_0x17aebb();}})['catch'](function(_0x36f81d){_0x17aebb(_0x36f81d);});}});};exports['isAuthenticated']=function isAuthenticated(_0x57c956){return compose()['use'](function(_0x59888d,_0x33b310,_0x52615b){var _0x271ef8;if(_0x59888d[_0x166c('0x45')][_0x166c('0x46')]){if(_[_0x166c('0x47')](_0x59888d[_0x166c('0x45')]['authorization'],_0x166c('0x48'))){var _0x5f1455=basicAuth(_0x59888d);db[_0x166c('0x49')][_0x166c('0x4a')]({'where':{'name':_0x5f1455[_0x166c('0x4b')]}})[_0x166c('0x3e')](function(_0x405918){if(!_0x405918||!_0x405918[_0x166c('0x4c')](_0x5f1455['pass'])){return _0x33b310[_0x166c('0x41')](0x191)[_0x166c('0x4d')]({'message':_0x166c('0x4e')});}_0x59888d['user']={'id':_0x405918['id']};_0x52615b();})[_0x166c('0x4f')](function(_0x32c2da){_0x52615b(_0x32c2da);});}else if(_[_0x166c('0x47')](_0x59888d[_0x166c('0x45')][_0x166c('0x46')],'Bearer')){validateJwt(_0x59888d,_0x33b310,_0x52615b);}else{if(_0x57c956){_0x52615b();}else{return _0x33b310['status'](0x193)[_0x166c('0x4d')]({'message':_0x166c('0x50')});}}}else if(_0x59888d[_0x166c('0x40')][_0x166c('0x51')]){try{var _0x1e5b3a={'audience':hardwareConf[_0x166c('0x52')](),'issuer':hardwareConf[_0x166c('0x52')]()};verifyJwt(_0x59888d[_0x166c('0x40')]['apikey'],_0x1e5b3a)[_0x166c('0x3e')](function(_0x3a9bf4){return db[_0x166c('0x49')][_0x166c('0x4a')]({'where':{'id':_0x3a9bf4['sub']}})[_0x166c('0x3e')](function(_0x47b755){_0x271ef8=_0x47b755;return db[_0x166c('0x53')][_0x166c('0x3b')]({'where':{'id':0x1},'attributes':[_0x166c('0x54'),'blockDuration'],'raw':!![]});})['then'](function(_0x20b26f){if(!_0x271ef8||!_[_0x166c('0x55')](_0x271ef8['apiKeyNonce'],_0x3a9bf4[_0x166c('0x56')])){return _0x33b310[_0x166c('0x41')](0x191)[_0x166c('0x4d')]({'message':_0x166c('0x57')});}if(_0x271ef8[_0x166c('0x58')]){return _0x33b310[_0x166c('0x41')](0x191)[_0x166c('0x4d')]({'message':_0x166c('0x59')});}if(_0x271ef8['blocked']){if(_0x20b26f['blockDuration']>0x0){if(moment(_0x271ef8[_0x166c('0x5a')])[_0x166c('0x5b')](_0x20b26f['blockDuration'],_0x166c('0x5c'))>moment()){return _0x33b310[_0x166c('0x41')](0x191)[_0x166c('0x4d')]({'message':_0x166c('0x59')});}}else{return _0x33b310['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}_0x59888d['user']={'id':_0x271ef8['id']};_0x52615b();});})[_0x166c('0x4f')](function(){return _0x33b310[_0x166c('0x41')](0x191)[_0x166c('0x4d')]({'message':_0x166c('0x59')});});}catch(_0x3e67d3){_0x52615b(_0x3e67d3);}}else if(_0x57c956){_0x52615b();}else{return _0x33b310['status'](0x193)['json']({'message':_0x166c('0x50')});}})['use'](function(_0x21733a,_0x4b898c,_0x2dee88){if(_0x21733a['user']){db[_0x166c('0x49')]['find']({'where':{'id':_0x21733a['user']['id']},'attributes':userAttributes})[_0x166c('0x3e')](function(_0x18b269){if(!_0x18b269){return _0x4b898c[_0x166c('0x41')](0x194)[_0x166c('0x4d')]({'message':_0x166c('0x5d')});}_0x21733a[_0x166c('0x39')]=_0x18b269;_0x2dee88();})[_0x166c('0x4f')](function(_0x5a0e){_0x2dee88(_0x5a0e);});}else if(_0x57c956){_0x2dee88();}else{return _0x4b898c['status'](0x194)[_0x166c('0x4d')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x166c('0x5e')]=function canUpdate(){return compose()['use'](function(_0x3e2dc5,_0x5c832d,_0x38ccbb){return licenseUtil[_0x166c('0x5f')]()['then'](function(_0x458da5){if(_0x458da5['update']){_0x38ccbb();}else{return _0x5c832d[_0x166c('0x41')](0x193)['json']({'message':_0x166c('0x60')});}})[_0x166c('0x4f')](function(_0x595b2e){_0x38ccbb(_0x595b2e);});});};exports[_0x166c('0x61')]=function isWebrtcLicence(){return compose()[_0x166c('0x62')](function(_0x4ccf81,_0x564f5a,_0x31e58a){return licenseUtil[_0x166c('0x5f')]()['then'](function(_0x4f9c93){if(_0x4f9c93[_0x166c('0x63')]){_0x31e58a();}else{return _0x564f5a[_0x166c('0x41')](0x193)[_0x166c('0x4d')]({'message':_0x166c('0x60')});}})[_0x166c('0x4f')](function(_0x4246b8){_0x31e58a(_0x4246b8);});});};exports[_0x166c('0x64')]=function(_0x1824d7,_0x3dd1a5,_0x210108){_0x1824d7[_0x166c('0x64')]=!![];return _0x210108();};exports[_0x166c('0x65')]=function signToken(_0x2ba1d7){return signJwt(_0x2ba1d7);};exports[_0x166c('0x66')]=function(_0x137d8d,_0x1842bb){if(!_0x137d8d[_0x166c('0x39')]){return _0x1842bb[_0x166c('0x41')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x3f398e={'payload':{'id':_0x137d8d[_0x166c('0x39')]['id'],'role':_0x137d8d['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x3f398e)['then'](function(_0x5d89b9){_0x1842bb[_0x166c('0x67')](_0x166c('0x68'),_0x5d89b9);_0x1842bb['redirect']('/dashboards/general');})[_0x166c('0x4f')](function(_0x14b26b){return _0x1842bb[_0x166c('0x41')](0x1f4)[_0x166c('0x69')](_0x14b26b);});};exports['retrieveApiKey']=function(_0x34da16){if(_[_0x166c('0x6a')](_0x34da16[_0x166c('0x6b')])||_[_0x166c('0x6a')](_0x34da16[_0x166c('0x6c')])){return null;}else{return createJwt(_0x34da16);}};exports[_0x166c('0x6d')]=function(_0x3d8dc){_0x3d8dc[_0x166c('0x6b')]=generateNonce();_0x3d8dc['apiKeyIat']=generateIssuedAt();return createJwt(_0x3d8dc);};exports['regenerateApiKey']=function(_0x275492,_0x45dd7d){var _0x556581=_0x275492[_0x166c('0x40')][_0x166c('0x51')];if(_0x556581){var _0x3327cd={'nonce':_0x45dd7d['apiKeyNonce'],'iat':_0x45dd7d['apiKeyIat'],'audience':hardwareConf[_0x166c('0x52')](),'issuer':hardwareConf[_0x166c('0x52')]()};return verifyJwt(_0x556581,_0x3327cd)[_0x166c('0x3e')](function(){return generateApiKey(_0x45dd7d);});}else{throw{'message':_0x166c('0x6e')};}};exports['validatePasswordPattern']=function(_0x565ff2){var _0xe79c7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xe79c7['test'](_0x565ff2))throw new db['Sequelize'][(_0x166c('0x6f'))]('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[_0x166c('0x70')]=function(_0x35b2ac,_0x5d5118,_0x563993){var _0xc774eb=encryptor['decryptString'](_0x5d5118)[_0x166c('0x71')](',');for(var _0x50ad4b=0x0;_0x50ad4b<_0x563993;_0x50ad4b++){if(!_0xc774eb[_0x50ad4b])break;if(_0x35b2ac[_0x166c('0x72')]()===_0xc774eb[_0x50ad4b][_0x166c('0x72')]()){var _0x1ad92e=util[_0x166c('0x73')](_0x166c('0x74'),_0x563993);if(_0x563993===0x1){_0x1ad92e=_0x166c('0x75');}throw new db[(_0x166c('0x76'))]['ValidationError'](_0x1ad92e);}}return;};exports[_0x166c('0x77')]=function(_0xe26547,_0x315539){var _0x365d91=_0x315539?encryptor[_0x166c('0x78')](_0x315539)[_0x166c('0x71')](','):[];if(_0x365d91[_0x166c('0x79')]===0x5){_0x365d91[_0x166c('0x7a')](-0x1,0x1);}_0x365d91[_0x166c('0x7b')](_0xe26547);return encryptor['encryptString'](_0x365d91[_0x166c('0x7c')](','));};function signJwt(_0x2a6f23){var _0x4275c0=BPromise[_0x166c('0x7d')](jwt['sign'],{'context':jwt});var _0x37f915=_0x2a6f23[_0x166c('0x7e')]||config['secrets']['session'];return new BPromise(function(_0x396cb4,_0x4b6dec){_0x4275c0(_0x2a6f23[_0x166c('0x7f')],_0x37f915,_0x2a6f23[_0x166c('0x80')])[_0x166c('0x3e')](function(_0x18e7f3){_0x396cb4(_0x18e7f3);})['catch'](function(_0x256732){_0x4b6dec(_0x256732);});});}function verifyJwt(_0x18ebfd,_0x24cc77,_0x10e864){var _0x18c68c=BPromise[_0x166c('0x7d')](jwt['verify'],{'context':jwt});var _0x5e89e3=_0x10e864||config[_0x166c('0xc')][_0x166c('0x81')];return new BPromise(function(_0x26fa52,_0x2f8ab0){_0x18c68c(_0x18ebfd,_0x5e89e3,_0x24cc77)[_0x166c('0x3e')](function(_0xb3b089){_0x26fa52(_0xb3b089);})['catch'](function(_0x29c971){_0x2f8ab0(_0x29c971);});});}function generateNonce(){return crypto[_0x166c('0x82')](0x10)[_0x166c('0x83')](_0x166c('0x84'));}function generateIssuedAt(){return Math[_0x166c('0x85')](Date['now']()/0x3e8)[_0x166c('0x83')]();}function createJwt(_0x1aea94){var _0x1837f9={'payload':{'iat':_0x1aea94['apiKeyIat'],'nonce':_0x1aea94['apiKeyNonce']},'options':{'algorithm':_0x166c('0x86'),'subject':_0x1aea94['id'][_0x166c('0x83')](),'issuer':hardwareConf[_0x166c('0x52')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x1837f9)[_0x166c('0x3e')](function(_0x492f4e){return{'iat':_0x1aea94[_0x166c('0x6c')],'nonce':_0x1aea94[_0x166c('0x6b')],'token':_0x492f4e};});} \ No newline at end of file +var _0xa28c=['composable-middleware','basic-auth','crypto','util','moment','secrets','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','pauseType','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','params','closed','disposition','then','query','status','unmanaged','Forbidden.','catch','headers','authorization','startsWith','Basic','User','authenticate','json','Wrong\x20credentials.','apikey','getUuid','find','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','Unknown\x20authorization\x20format','use','User\x20not\x20found.','canUpdate','getLicense','Forbidden','isMiddleware','signToken','setTokenCookie','role','redirect','/dashboards/general','send','retrieveApiKey','isNil','generateApiKey','apiKeyIat','regenerateApiKey','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~!@#$%^&-_=+[{]}.','validatePasswordHistory','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','splice','unshift','join','promisify','secret','session','payload','options','verify','toString','hex','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt'];(function(_0x500225,_0x523a00){var _0xa4856c=function(_0x4ec077){while(--_0x4ec077){_0x500225['push'](_0x500225['shift']());}};_0xa4856c(++_0x523a00);}(_0xa28c,0x88));var _0xca28=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xa28c[_0x5bd426];return _0x23a7eb;};'use strict';var db=require(_0xca28('0x0'))['db'];var config=require(_0xca28('0x1'));var hardwareConf=require(_0xca28('0x2'));var licenseUtil=require(_0xca28('0x3'));var encryptor=require(_0xca28('0x4'));var _=require(_0xca28('0x5'));var jwt=require(_0xca28('0x6'));var expressJwt=require(_0xca28('0x7'));var compose=require(_0xca28('0x8'));var basicAuth=require(_0xca28('0x9'));var crypto=require(_0xca28('0xa'));var BPromise=require('bluebird');var util=require(_0xca28('0xb'));var moment=require(_0xca28('0xc'));var validateJwt=expressJwt({'secret':config[_0xca28('0xd')]['session']});var userAttributes=['id','role',_0xca28('0xe'),_0xca28('0xf'),_0xca28('0x10'),_0xca28('0x11'),_0xca28('0x12'),_0xca28('0x13'),_0xca28('0x14'),_0xca28('0x15'),_0xca28('0x16'),_0xca28('0x17'),_0xca28('0x18'),'smsPause','openchannelPause',_0xca28('0x19'),'showWebBar','lastLoginAt',_0xca28('0x1a'),_0xca28('0x1b'),_0xca28('0x1c'),_0xca28('0x1d'),_0xca28('0x1e'),_0xca28('0x1f'),_0xca28('0x20'),_0xca28('0x21'),'phoneBarEnableRecording',_0xca28('0x22'),_0xca28('0x23'),_0xca28('0x24'),_0xca28('0x25'),_0xca28('0x26'),_0xca28('0x27'),_0xca28('0x28'),_0xca28('0x29'),_0xca28('0x2a'),_0xca28('0x2b'),_0xca28('0x2c'),_0xca28('0x2d'),_0xca28('0x2e'),_0xca28('0x2f'),_0xca28('0x30'),_0xca28('0x31'),'selectRecallMeCampaign',_0xca28('0x32'),'chatAutoanswerDelay',_0xca28('0x33'),_0xca28('0x34'),_0xca28('0x35'),_0xca28('0x36'),_0xca28('0x37'),_0xca28('0x38'),_0xca28('0x39'),_0xca28('0x3a'),_0xca28('0x3b'),_0xca28('0x3c'),_0xca28('0x3d')];exports[_0xca28('0x3e')]=function(){return this[_0xca28('0x3f')](!![])['use'](function(_0x45e9a8,_0x1a85c6,_0x3e2d55){if(_0x45e9a8[_0xca28('0x40')]){_0x3e2d55();}else{return db[_0xca28('0x41')][_0xca28('0x42')]({'where':{'id':_0x45e9a8[_0xca28('0x43')]['id']},'attributes':['id',_0xca28('0x44'),_0xca28('0x45')],'raw':!![]})[_0xca28('0x46')](function(_0x586008){if(_0x586008&&_0x586008[_0xca28('0x44')]&&!_0x45e9a8[_0xca28('0x47')]['forceDownload']){return _0x1a85c6[_0xca28('0x48')](_0x586008[_0xca28('0x45')]===_0xca28('0x49')?0x195:0x193)['json']({'message':_0x586008['disposition']===_0xca28('0x49')?'Unmanaged.':_0xca28('0x4a')});}else{_0x3e2d55();}})[_0xca28('0x4b')](function(_0x44952f){_0x3e2d55(_0x44952f);});}});};exports[_0xca28('0x3f')]=function isAuthenticated(_0x571222){return compose()['use'](function(_0x3c9080,_0x1160cd,_0x3b5686){var _0x1a88d2;if(_0x3c9080[_0xca28('0x4c')][_0xca28('0x4d')]){if(_[_0xca28('0x4e')](_0x3c9080[_0xca28('0x4c')]['authorization'],_0xca28('0x4f'))){var _0x3a4605=basicAuth(_0x3c9080);db[_0xca28('0x50')]['find']({'where':{'name':_0x3a4605[_0xca28('0xf')]}})[_0xca28('0x46')](function(_0x3df4df){if(!_0x3df4df||!_0x3df4df[_0xca28('0x51')](_0x3a4605['pass'])){return _0x1160cd['status'](0x191)[_0xca28('0x52')]({'message':_0xca28('0x53')});}_0x3c9080['user']={'id':_0x3df4df['id']};_0x3b5686();})[_0xca28('0x4b')](function(_0x56e236){_0x3b5686(_0x56e236);});}else if(_['startsWith'](_0x3c9080['headers'][_0xca28('0x4d')],'Bearer')){validateJwt(_0x3c9080,_0x1160cd,_0x3b5686);}else{if(_0x571222){_0x3b5686();}else{return _0x1160cd['status'](0x193)[_0xca28('0x52')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x3c9080['query'][_0xca28('0x54')]){try{var _0x381445={'audience':hardwareConf[_0xca28('0x55')](),'issuer':hardwareConf[_0xca28('0x55')]()};verifyJwt(_0x3c9080[_0xca28('0x47')][_0xca28('0x54')],_0x381445)[_0xca28('0x46')](function(_0x15d435){return db['User'][_0xca28('0x56')]({'where':{'id':_0x15d435['sub']}})[_0xca28('0x46')](function(_0x3a27c4){_0x1a88d2=_0x3a27c4;return db[_0xca28('0x57')][_0xca28('0x42')]({'where':{'id':0x1},'attributes':[_0xca28('0x58'),_0xca28('0x59')],'raw':!![]});})[_0xca28('0x46')](function(_0x1acbe3){if(!_0x1a88d2||!_[_0xca28('0x5a')](_0x1a88d2[_0xca28('0x5b')],_0x15d435[_0xca28('0x5c')])){return _0x1160cd[_0xca28('0x48')](0x191)[_0xca28('0x52')]({'message':_0xca28('0x5d')});}if(_0x1a88d2[_0xca28('0x5e')]){return _0x1160cd['status'](0x191)[_0xca28('0x52')]({'message':_0xca28('0x5f')});}if(_0x1a88d2['blocked']){if(_0x1acbe3[_0xca28('0x59')]>0x0){if(moment(_0x1a88d2[_0xca28('0x60')])[_0xca28('0x61')](_0x1acbe3['blockDuration'],_0xca28('0x62'))>moment()){return _0x1160cd['status'](0x191)[_0xca28('0x52')]({'message':_0xca28('0x5f')});}}else{return _0x1160cd[_0xca28('0x48')](0x191)['json']({'message':_0xca28('0x5f')});}}_0x3c9080['user']={'id':_0x1a88d2['id']};_0x3b5686();});})[_0xca28('0x4b')](function(){return _0x1160cd[_0xca28('0x48')](0x191)[_0xca28('0x52')]({'message':_0xca28('0x5f')});});}catch(_0x109b42){_0x3b5686(_0x109b42);}}else if(_0x571222){_0x3b5686();}else{return _0x1160cd['status'](0x193)['json']({'message':_0xca28('0x63')});}})[_0xca28('0x64')](function(_0x3b1f31,_0x1ac13c,_0x5a071f){if(_0x3b1f31['user']){db['User']['find']({'where':{'id':_0x3b1f31[_0xca28('0x40')]['id']},'attributes':userAttributes})[_0xca28('0x46')](function(_0x56c84f){if(!_0x56c84f){return _0x1ac13c['status'](0x194)[_0xca28('0x52')]({'message':_0xca28('0x65')});}_0x3b1f31['user']=_0x56c84f;_0x5a071f();})[_0xca28('0x4b')](function(_0x256139){_0x5a071f(_0x256139);});}else if(_0x571222){_0x5a071f();}else{return _0x1ac13c[_0xca28('0x48')](0x194)[_0xca28('0x52')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xca28('0x66')]=function canUpdate(){return compose()[_0xca28('0x64')](function(_0x39b587,_0x3e53de,_0x30c905){return licenseUtil[_0xca28('0x67')]()[_0xca28('0x46')](function(_0x23a09d){if(_0x23a09d['update']){_0x30c905();}else{return _0x3e53de['status'](0x193)[_0xca28('0x52')]({'message':_0xca28('0x68')});}})[_0xca28('0x4b')](function(_0x5464ca){_0x30c905(_0x5464ca);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0xca28('0x64')](function(_0x1cc9ea,_0xe85cb6,_0x10f22b){return licenseUtil[_0xca28('0x67')]()[_0xca28('0x46')](function(_0x3fec38){if(_0x3fec38['webrtc']){_0x10f22b();}else{return _0xe85cb6['status'](0x193)['json']({'message':_0xca28('0x68')});}})[_0xca28('0x4b')](function(_0x50d625){_0x10f22b(_0x50d625);});});};exports[_0xca28('0x69')]=function(_0x273336,_0x1d0d22,_0xeddb66){_0x273336[_0xca28('0x69')]=!![];return _0xeddb66();};exports[_0xca28('0x6a')]=function signToken(_0x42d5a7){return signJwt(_0x42d5a7);};exports[_0xca28('0x6b')]=function(_0x211d72,_0x13f838){if(!_0x211d72[_0xca28('0x40')]){return _0x13f838[_0xca28('0x48')](0x194)[_0xca28('0x52')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x801595={'payload':{'id':_0x211d72[_0xca28('0x40')]['id'],'role':_0x211d72[_0xca28('0x40')][_0xca28('0x6c')]},'options':{'expiresIn':0x15180}};return signJwt(_0x801595)['then'](function(_0x4260b2){_0x13f838['cookie']('motion.token',_0x4260b2);_0x13f838[_0xca28('0x6d')](_0xca28('0x6e'));})['catch'](function(_0x4e5fbb){return _0x13f838[_0xca28('0x48')](0x1f4)[_0xca28('0x6f')](_0x4e5fbb);});};exports[_0xca28('0x70')]=function(_0x379aae){if(_[_0xca28('0x71')](_0x379aae[_0xca28('0x5b')])||_['isNil'](_0x379aae['apiKeyIat'])){return null;}else{return createJwt(_0x379aae);}};exports[_0xca28('0x72')]=function(_0x5e07b4){_0x5e07b4[_0xca28('0x5b')]=generateNonce();_0x5e07b4[_0xca28('0x73')]=generateIssuedAt();return createJwt(_0x5e07b4);};exports[_0xca28('0x74')]=function(_0x1a1e35,_0x14ae2d){var _0x2cbac4=_0x1a1e35[_0xca28('0x47')][_0xca28('0x54')];if(_0x2cbac4){var _0xbc0082={'nonce':_0x14ae2d[_0xca28('0x5b')],'iat':_0x14ae2d[_0xca28('0x73')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xca28('0x55')]()};return verifyJwt(_0x2cbac4,_0xbc0082)[_0xca28('0x46')](function(){return generateApiKey(_0x14ae2d);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xca28('0x75')]=function(_0x46202a){var _0x3683ad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3683ad[_0xca28('0x76')](_0x46202a))throw new db[(_0xca28('0x77'))][(_0xca28('0x78'))](_0xca28('0x79'));return;};exports[_0xca28('0x7a')]=function(_0x3cb048,_0x167ee6,_0xbef81e){var _0x3e0fa9=encryptor[_0xca28('0x7b')](_0x167ee6)[_0xca28('0x7c')](',');for(var _0x6f6841=0x0;_0x6f6841<_0xbef81e;_0x6f6841++){if(!_0x3e0fa9[_0x6f6841])break;if(_0x3cb048['toLowerCase']()===_0x3e0fa9[_0x6f6841][_0xca28('0x7d')]()){var _0x24f32f=util[_0xca28('0x7e')](_0xca28('0x7f'),_0xbef81e);if(_0xbef81e===0x1){_0x24f32f=_0xca28('0x80');}throw new db[(_0xca28('0x77'))]['ValidationError'](_0x24f32f);}}return;};exports[_0xca28('0x81')]=function(_0x2dd4af,_0x95fc08){var _0x422fa2=_0x95fc08?encryptor[_0xca28('0x7b')](_0x95fc08)[_0xca28('0x7c')](','):[];if(_0x422fa2[_0xca28('0x82')]===0x5){_0x422fa2[_0xca28('0x83')](-0x1,0x1);}_0x422fa2[_0xca28('0x84')](_0x2dd4af);return encryptor['encryptString'](_0x422fa2[_0xca28('0x85')](','));};function signJwt(_0x120265){var _0x641272=BPromise[_0xca28('0x86')](jwt['sign'],{'context':jwt});var _0x47b38b=_0x120265[_0xca28('0x87')]||config[_0xca28('0xd')][_0xca28('0x88')];return new BPromise(function(_0x4a3ebf,_0x5db162){_0x641272(_0x120265[_0xca28('0x89')],_0x47b38b,_0x120265[_0xca28('0x8a')])['then'](function(_0x526604){_0x4a3ebf(_0x526604);})['catch'](function(_0x3666a2){_0x5db162(_0x3666a2);});});}function verifyJwt(_0x5ba275,_0x14c5c4,_0x596de9){var _0x3a73be=BPromise[_0xca28('0x86')](jwt[_0xca28('0x8b')],{'context':jwt});var _0x15229c=_0x596de9||config['secrets'][_0xca28('0x88')];return new BPromise(function(_0x3723f4,_0x8f699f){_0x3a73be(_0x5ba275,_0x15229c,_0x14c5c4)[_0xca28('0x46')](function(_0x19d4f5){_0x3723f4(_0x19d4f5);})[_0xca28('0x4b')](function(_0x2c1103){_0x8f699f(_0x2c1103);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xca28('0x8c')](_0xca28('0x8d'));}function generateIssuedAt(){return Math['floor'](Date[_0xca28('0x8e')]()/0x3e8)[_0xca28('0x8c')]();}function createJwt(_0x1a5335){var _0x1a2c94={'payload':{'iat':_0x1a5335[_0xca28('0x73')],'nonce':_0x1a5335[_0xca28('0x5b')]},'options':{'algorithm':_0xca28('0x8f'),'subject':_0x1a5335['id'][_0xca28('0x8c')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xca28('0x55')]()}};return signJwt(_0x1a2c94)[_0xca28('0x46')](function(_0x5ef404){return{'iat':_0x1a5335['apiKeyIat'],'nonce':_0x1a5335[_0xca28('0x5b')],'token':_0x5ef404};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index d47bd15..c8eafe5 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdcc=['user','clause','tags','skip','checkListsRestrictions','tag','countFilteredContacts','User','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','startsWith','CmCustomField','findOne','slice','all','length','cf_','fieldType','map','type','lodash','./sql-utils','findAll','skipContactsQuery','getContactsSubquery','then','parseAdvancedSearchFilter','search','parseQueryParameters','default','where','fields','filter'];(function(_0x3002a0,_0x6beda2){var _0x9c2ed1=function(_0x1fb3a5){while(--_0x1fb3a5){_0x3002a0['push'](_0x3002a0['shift']());}};_0x9c2ed1(++_0x6beda2);}(_0xbdcc,0x11b));var _0xcbdc=function(_0x2453c1,_0x31fd1e){_0x2453c1=_0x2453c1-0x0;var _0x295a8d=_0xbdcc[_0x2453c1];return _0x295a8d;};'use strict';var _=require(_0xcbdc('0x0'));var sqlUtils=require(_0xcbdc('0x1'));var db=require('../../mysqldb')['db'];exports[_0xcbdc('0x2')]=function(_0x24dd58,_0x2f1354,_0x18e3c8,_0x5f20ca){var _0xfc3f07={'count':0x0,'rows':[]};var _0x317221=sqlUtils[_0xcbdc('0x3')](_0x2f1354,_0x24dd58);if(_0x317221){return Promise['resolve'](_0xfc3f07);}var _0xfe77a4=sqlUtils[_0xcbdc('0x4')]();var _0x1cf13c={};var _0x2e30ab=![];var _0x52ad36=![];return Promise['resolve']()[_0xcbdc('0x5')](function(){if(_0x24dd58['search']){return sqlUtils[_0xcbdc('0x6')](_0x24dd58[_0xcbdc('0x7')],_0x5f20ca);}else{return sqlUtils[_0xcbdc('0x8')](_0x24dd58,_0x5f20ca);}})[_0xcbdc('0x5')](function(_0x541132){_0xfe77a4['where'](_0x541132[_0xcbdc('0x9')]);_0xfe77a4[_0xcbdc('0xa')](_0x541132[_0xcbdc('0xb')]);_0xfe77a4[_0xcbdc('0xa')](_0x541132[_0xcbdc('0xc')]);_0xfe77a4[_0xcbdc('0xa')](_0x541132[_0xcbdc('0xd')][_0xcbdc('0xe')]);_0x1cf13c=_0x541132[_0xcbdc('0xf')];_0x52ad36=_0x541132[_0xcbdc('0xd')][_0xcbdc('0x10')];return sqlUtils[_0xcbdc('0x11')](_0x2f1354,_0x24dd58,_0x52ad36);})[_0xcbdc('0x5')](function(_0x15b5a1){_0xfe77a4[_0xcbdc('0xa')](_0x15b5a1);var _0x2ef01e=_0x24dd58[_0xcbdc('0x7')]?_0x1cf13c['ids']:_0x24dd58[_0xcbdc('0x12')];_0x2e30ab=_0x2ef01e?!![]:![];return sqlUtils[_0xcbdc('0x13')](_0xfe77a4,_0x2ef01e);})[_0xcbdc('0x5')](function(_0x331e21){_0xfc3f07['count']=_0x331e21;if(_0xfc3f07['count']===0x0){return;}if(_0x24dd58[_0xcbdc('0x14')]){_0x52ad36=!![];}return sqlUtils[_0xcbdc('0x15')](_0xfe77a4,_0x24dd58[_0xcbdc('0xb')],_0x18e3c8,_0x2e30ab,_0x1cf13c[_0xcbdc('0xe')],_0x52ad36);})['then'](function(_0x80e8e4){if(!_0x80e8e4){return[];}return sqlUtils[_0xcbdc('0x16')](_0x80e8e4,_0x24dd58,_0x18e3c8);})['then'](function(_0x381718){_0xfc3f07[_0xcbdc('0x17')]=_0x381718;return _0xfc3f07;})[_0xcbdc('0x18')](function(_0x2d942b){throw _0x2d942b;});};exports[_0xcbdc('0x19')]=function(){var _0x5817cd={};var _0x4d1756=[];return db[_0xcbdc('0x1a')][_0xcbdc('0x19')]()[_0xcbdc('0x5')](function(_0x43e790){_0x5817cd=_0x43e790;var _0x33af29=Object['keys'](_0x5817cd)['filter'](function(_0x276181){return _[_0xcbdc('0x1b')](_0x276181,'cf_')?_0x276181:undefined;});var _0x4f4700=_0x33af29['map'](function(_0x3af30c){return db[_0xcbdc('0x1c')][_0xcbdc('0x1d')]({'where':{'id':_0x3af30c[_0xcbdc('0x1e')](0x3)},'raw':!![]});});return Promise[_0xcbdc('0x1f')](_0x4f4700);})['then'](function(_0x20489c){for(var _0x17afdd=0x0;_0x17afdd<_0x20489c[_0xcbdc('0x20')];_0x17afdd++){if(_0x20489c[_0x17afdd]){var _0x175452=_0xcbdc('0x21')+_0x20489c[_0x17afdd]['id'];_0x5817cd[_0x175452][_0xcbdc('0x22')]=_0x20489c[_0x17afdd]['type'];}}_0x4d1756=_[_0xcbdc('0x23')](Object['keys'](_0x5817cd),function(_0x15069c){return{'name':_0x15069c,'type':_0x5817cd[_0x15069c][_0xcbdc('0x24')]};});return _0x4d1756;})[_0xcbdc('0x18')](function(_0x128c85){throw _0x128c85;});}; \ No newline at end of file +var _0xb10f=['User','buildContactsQuery','getFilteredContacts','rows','describe','keys','filter','startsWith','map','CmCustomField','slice','length','cf_','fieldType','type','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','clause','user','skip','checkListsRestrictions','then','tag','count'];(function(_0xcfeda9,_0xd418ae){var _0x4826c7=function(_0x45dc9d){while(--_0x45dc9d){_0xcfeda9['push'](_0xcfeda9['shift']());}};_0x4826c7(++_0xd418ae);}(_0xb10f,0xbe));var _0xfb10=function(_0x51a610,_0x426307){_0x51a610=_0x51a610-0x0;var _0x352d1e=_0xb10f[_0x51a610];return _0x352d1e;};'use strict';var _=require(_0xfb10('0x0'));var sqlUtils=require(_0xfb10('0x1'));var db=require(_0xfb10('0x2'))['db'];exports[_0xfb10('0x3')]=function(_0x525cc4,_0x228201,_0x3faa6f,_0x367dd4){var _0x2e2089={'count':0x0,'rows':[]};var _0x2956ee=sqlUtils[_0xfb10('0x4')](_0x228201,_0x525cc4);if(_0x2956ee){return Promise[_0xfb10('0x5')](_0x2e2089);}var _0x176a1d=sqlUtils[_0xfb10('0x6')]();var _0x3c2a59={};var _0x43f71e=![];var _0x25aa9c=![];return Promise[_0xfb10('0x5')]()['then'](function(){if(_0x525cc4[_0xfb10('0x7')]){return sqlUtils[_0xfb10('0x8')](_0x525cc4['search'],_0x367dd4);}else{return sqlUtils[_0xfb10('0x9')](_0x525cc4,_0x367dd4);}})['then'](function(_0x4f3ea4){_0x176a1d[_0xfb10('0xa')](_0x4f3ea4[_0xfb10('0xb')]);_0x176a1d[_0xfb10('0xa')](_0x4f3ea4[_0xfb10('0xc')]);_0x176a1d[_0xfb10('0xa')](_0x4f3ea4['filter']);_0x176a1d[_0xfb10('0xa')](_0x4f3ea4['user'][_0xfb10('0xd')]);_0x3c2a59=_0x4f3ea4['tags'];_0x25aa9c=_0x4f3ea4[_0xfb10('0xe')][_0xfb10('0xf')];return sqlUtils[_0xfb10('0x10')](_0x228201,_0x525cc4,_0x25aa9c);})[_0xfb10('0x11')](function(_0x42a3a8){_0x176a1d[_0xfb10('0xa')](_0x42a3a8);var _0x297dc8=_0x525cc4[_0xfb10('0x7')]?_0x3c2a59['ids']:_0x525cc4[_0xfb10('0x12')];_0x43f71e=_0x297dc8?!![]:![];return sqlUtils['countFilteredContacts'](_0x176a1d,_0x297dc8);})['then'](function(_0xccd4bd){_0x2e2089[_0xfb10('0x13')]=_0xccd4bd;if(_0x2e2089['count']===0x0){return;}if(_0x525cc4[_0xfb10('0x14')]){_0x25aa9c=!![];}return sqlUtils[_0xfb10('0x15')](_0x176a1d,_0x525cc4[_0xfb10('0xc')],_0x3faa6f,_0x43f71e,_0x3c2a59[_0xfb10('0xd')],_0x25aa9c);})[_0xfb10('0x11')](function(_0x1acdff){if(!_0x1acdff){return[];}return sqlUtils[_0xfb10('0x16')](_0x1acdff,_0x525cc4,_0x3faa6f);})[_0xfb10('0x11')](function(_0x3b1d2f){_0x2e2089[_0xfb10('0x17')]=_0x3b1d2f;return _0x2e2089;})['catch'](function(_0x320f6f){throw _0x320f6f;});};exports[_0xfb10('0x18')]=function(){var _0x499bc1={};var _0x533e0a=[];return db['CmContact'][_0xfb10('0x18')]()[_0xfb10('0x11')](function(_0x296601){_0x499bc1=_0x296601;var _0x15a6d9=Object[_0xfb10('0x19')](_0x499bc1)[_0xfb10('0x1a')](function(_0x138231){return _[_0xfb10('0x1b')](_0x138231,'cf_')?_0x138231:undefined;});var _0x381ba0=_0x15a6d9[_0xfb10('0x1c')](function(_0x4ed264){return db[_0xfb10('0x1d')]['findOne']({'where':{'id':_0x4ed264[_0xfb10('0x1e')](0x3)},'raw':!![]});});return Promise['all'](_0x381ba0);})['then'](function(_0x1838c4){for(var _0xd31ed6=0x0;_0xd31ed6<_0x1838c4[_0xfb10('0x1f')];_0xd31ed6++){if(_0x1838c4[_0xd31ed6]){var _0xb8f85b=_0xfb10('0x20')+_0x1838c4[_0xd31ed6]['id'];_0x499bc1[_0xb8f85b][_0xfb10('0x21')]=_0x1838c4[_0xd31ed6][_0xfb10('0x22')];}}_0x533e0a=_[_0xfb10('0x1c')](Object['keys'](_0x499bc1),function(_0x24d5e4){return{'name':_0x24d5e4,'type':_0x499bc1[_0x24d5e4]['type']};});return _0x533e0a;})['catch'](function(_0x2124e0){throw _0x2124e0;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index ee1649b..ae61fcc 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b8f=['t.id\x20IN\x20?','toString','COUNT(*)','lodash','../parsers/advancedSearch','../parsers/qs','../interaction/utils','agent','true','select','from','cm_contacts','where','subqry','left_join','cm_user_has_contacts','ct.CmContactId\x20=\x20','.id','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','fax','email','ListId','CompanyId','createdAt','deletedAt','TagIds','includes','push','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','length','conditions','find','name','dateOfBirth','datetime','type','default','text','value','start','Tag','tags','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','then','tag','filter','search','role','getLists','c.ListId\x20IS\x20NULL','map','group','c.id','limit','offset','subqry.id','having','order','DESC','findAll','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','clone','isEmpty'];(function(_0x40ddf5,_0x487622){var _0x1e22fd=function(_0x3831d2){while(--_0x3831d2){_0x40ddf5['push'](_0x40ddf5['shift']());}};_0x1e22fd(++_0x487622);}(_0x7b8f,0x1ab));var _0xf7b8=function(_0xa0b432,_0x55f6c9){_0xa0b432=_0xa0b432-0x0;var _0x4a35ed=_0x7b8f[_0xa0b432];return _0x4a35ed;};'use strict';var _=require(_0xf7b8('0x0'));var squel=require('squel');var as=require(_0xf7b8('0x1'));var qs=require(_0xf7b8('0x2'));var utils=require(_0xf7b8('0x3'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x133c91,_0x572e04){var _0x3c5ac0=![];if(_0x133c91['role']===_0xf7b8('0x4')&&!_0x572e04['search']&&!_0x572e04['ListId']&&_0x572e04['autocomplete']!==_0xf7b8('0x5')){_0x3c5ac0=!![];}return _0x3c5ac0;}function getContactsSubquery(){return squel[_0xf7b8('0x6')]()[_0xf7b8('0x7')](_0xf7b8('0x8'),'c')[_0xf7b8('0x9')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x2f88c6,_0x512a0b){var _0xd4026c=_0x512a0b?'c':_0xf7b8('0xa');_0x2f88c6[_0xf7b8('0xb')](_0xf7b8('0xc'),'uc','uc.CmContactId\x20=\x20'+_0xd4026c+'.id')['left_join']('cm_contact_has_tags','ct',_0xf7b8('0xd')+_0xd4026c+_0xf7b8('0xe'))[_0xf7b8('0xb')](_0xf7b8('0xf'),'t',_0xf7b8('0x10'));return _0x2f88c6;}function addFieldsToQuery(_0x375622,_0x528cee,_0x104735,_0x14a973,_0x1b66ab){var _0x3c23ef=_0x1b66ab?'c':_0xf7b8('0xa');if(!_0x528cee){_0x528cee=['id',_0xf7b8('0x11'),_0xf7b8('0x12'),_0xf7b8('0x13'),'mobile',_0xf7b8('0x14'),_0xf7b8('0x15'),_0xf7b8('0x16'),_0xf7b8('0x17'),_0xf7b8('0x18'),'updatedAt',_0xf7b8('0x19'),_0xf7b8('0x1a')];}else if(!_0x528cee[_0xf7b8('0x1b')]('id')){_0x528cee[_0xf7b8('0x1c')]('id');}var _0x1dac6b=_0x104735&&_0x1b66ab||!_0x104735&&!_0x1b66ab;if(_0x14a973){_0x1dac6b=_0x14a973&&_0x1b66ab||!_0x14a973&&!_0x1b66ab;}_0x528cee[_0xf7b8('0x1d')](function(_0x329771){if(_0x329771===_0xf7b8('0x1a')){if(_0x1dac6b){_0x375622['field'](_0xf7b8('0x1e'),_0x329771);}else if(_0x104735||_0x14a973){_0x375622[_0xf7b8('0x1f')](_0x3c23ef+'.'+_0x329771);}}else{_0x375622[_0xf7b8('0x1f')](_0x3c23ef+'.'+_0x329771);}});return _0x375622;}function getSqlClauses(){var _0x1f7eb8={'default':squel['expr'](),'fields':squel[_0xf7b8('0x20')](),'filter':squel[_0xf7b8('0x20')](),'tags':{'clause':squel[_0xf7b8('0x20')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x1f7eb8;}function parseTagParameter(_0x1fdfc0){var _0x6a48a6=squel[_0xf7b8('0x20')]();if(_0x1fdfc0){var _0x32566f=utils[_0xf7b8('0x21')](_0x1fdfc0);_0x32566f[_0xf7b8('0x1d')](function(_0x42c3d){_0x6a48a6['or'](_0xf7b8('0x22'),'%,'+_0x42c3d+',%');});}return _0x6a48a6;}function parseSearchFilter(_0x1886c3){var _0x43fceb=squel[_0xf7b8('0x20')]();if(_0x1886c3){var _0x27223b=_0x1886c3['replace']('\x5c','\x5c\x5c')[_0xf7b8('0x23')](/'/g,'\x27\x27');if(_0x27223b[_0xf7b8('0x24')]('\x20')['length']>0x1){_0x43fceb['or'](_0xf7b8('0x25'),qs[_0xf7b8('0x26')](_0x27223b,!![]),null);}else{if(qs[_0xf7b8('0x27')](_0x27223b)){_0x43fceb['or'](_0xf7b8('0x28'),_0x27223b+'%');_0x43fceb['or'](_0xf7b8('0x29'),_0x27223b+'%');_0x43fceb['or'](_0xf7b8('0x2a'),_0x27223b+'%');_0x43fceb['or'](_0xf7b8('0x2b'),_0x27223b+'%');}else if(qs[_0xf7b8('0x2c')](_0x27223b)){_0x43fceb['or'](_0xf7b8('0x2d'),_0x27223b+'%');}else{_0x43fceb['or'](_0xf7b8('0x2e'),'%'+_0x27223b+'%');_0x43fceb['or'](_0xf7b8('0x2f'),'%'+_0x27223b+'%');_0x43fceb['or'](_0xf7b8('0x2d'),'%'+_0x27223b+'%');}}}return _0x43fceb;}function parseAdvancedSearchFilter(_0x1ba225,_0x1e0304){var _0x2f699c=getSqlClauses();var _0x47ae7d=as[_0xf7b8('0x30')](_0x1ba225);var _0x46ca31=_0x47ae7d['sqlOperator'];for(var _0x5c676b=0x0;_0x5c676b<_0x47ae7d['conditions'][_0xf7b8('0x31')];_0x5c676b++){var _0x26df6f=_0x47ae7d[_0xf7b8('0x32')][_0x5c676b];var _0xb4678b='c';var _0x4dc4cd=_[_0xf7b8('0x33')](_0x1e0304,[_0xf7b8('0x34'),_0x26df6f['field']]);if(_0x4dc4cd){if(_0x26df6f[_0xf7b8('0x1f')]===_0xf7b8('0x35')||_0x4dc4cd['fieldType']===_0xf7b8('0x36')){_0x26df6f['castTo']='DATE';}var _0x53e27b=as['buildExpression'](_0xb4678b,_0x4dc4cd[_0xf7b8('0x37')],_0x26df6f);_0x2f699c[_0xf7b8('0x38')][_0x46ca31](_0x53e27b[_0xf7b8('0x39')],_0x53e27b[_0xf7b8('0x3a')][_0xf7b8('0x3b')],_0x53e27b[_0xf7b8('0x3a')]['end']);}else{if(_0x26df6f[_0xf7b8('0x1f')]===_0xf7b8('0x3c')){var _0x456ab7=_0x26df6f[_0xf7b8('0x3a')][_0xf7b8('0x24')](',')['map'](function(_0x32ad61){return Number(_0x32ad61);});var _0x568dc4=parseTagParameter(_0x456ab7);_0x2f699c[_0xf7b8('0x3d')][_0xf7b8('0x3e')][_0xf7b8('0x3f')](_0x568dc4);_0x2f699c['tags'][_0xf7b8('0x40')]=_0x456ab7;}else if(_0x26df6f[_0xf7b8('0x1f')]===_0xf7b8('0x41')){_0x2f699c[_0xf7b8('0x42')][_0xf7b8('0x3e')]['and'](_0xf7b8('0x43'),_0x26df6f[_0xf7b8('0x3a')]);_0x2f699c[_0xf7b8('0x42')][_0xf7b8('0x44')]=!![];}}}return _0x2f699c;}function parseModelFields(_0x259bf3,_0x5f5358){var _0x41a7ef=squel[_0xf7b8('0x20')]();var _0x18df17=_(_0x259bf3)[_0xf7b8('0x45')]()['map'](function(_0x510a74){return _[_0xf7b8('0x46')](_0x5f5358,[_0xf7b8('0x34'),_0x510a74])?_0x510a74:undefined;})[_0xf7b8('0x47')]()[_0xf7b8('0x3a')]();if(_0x259bf3[_0xf7b8('0x48')]){_0x18df17[_0xf7b8('0x1c')](_0xf7b8('0x48'));}if(_0x259bf3[_0xf7b8('0x41')]){_0x18df17['push'](_0xf7b8('0x41'));}if(_0x18df17['length']>0x0){_0x18df17['forEach'](function(_0x30ef36){if(_0x30ef36===_0xf7b8('0x16')){_0x41a7ef['and'](_0xf7b8('0x49'),[][_0xf7b8('0x4a')](_0x259bf3[_0x30ef36]));}else if(_0x30ef36===_0xf7b8('0x48')){var _0x4eecf5='%'+_0x259bf3[_0x30ef36]+'%';_0x41a7ef[_0xf7b8('0x3f')](_0xf7b8('0x4b'),_0x4eecf5);}else if(_0x30ef36===_0xf7b8('0x41')){_0x41a7ef[_0xf7b8('0x3f')](_0xf7b8('0x43'),_0x259bf3[_0x30ef36]);}else{_0x41a7ef[_0xf7b8('0x3f')]('c.'+_0x30ef36+'\x20=\x20?',_0x259bf3[_0x30ef36]);}});}return _0x41a7ef;}function parseQueryParameters(_0x555cc3,_0xc9bf45){var _0x32ffc1=getSqlClauses();return Promise[_0xf7b8('0x4c')]()[_0xf7b8('0x4d')](function(){return parseModelFields(_0x555cc3,_0xc9bf45);})[_0xf7b8('0x4d')](function(_0x72ac44){_0x32ffc1['fields'][_0xf7b8('0x3f')](_0x72ac44);return parseTagParameter(_0x555cc3[_0xf7b8('0x4e')]);})[_0xf7b8('0x4d')](function(_0x1bffd7){_0x32ffc1['tags'][_0xf7b8('0x3e')]['and'](_0x1bffd7);return parseSearchFilter(_0x555cc3[_0xf7b8('0x4f')]);})[_0xf7b8('0x4d')](function(_0x502815){_0x32ffc1['filter']=_0x502815;return _0x32ffc1;});}function checkListsRestrictions(_0x10096d,_0x3772f1,_0x3efa7a){var _0x322a64=squel[_0xf7b8('0x20')]();return Promise[_0xf7b8('0x4c')]()[_0xf7b8('0x4d')](function(){if(_0x3772f1[_0xf7b8('0x50')]&&_0x10096d[_0xf7b8('0x51')]===_0xf7b8('0x4')&&!_0x3efa7a){return _0x10096d[_0xf7b8('0x52')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x596186){if(_0x596186){if(_0x596186[_0xf7b8('0x31')]===0x0){_0x322a64[_0xf7b8('0x3f')](_0xf7b8('0x53'));}else{_0x322a64[_0xf7b8('0x3f')]('c.ListId\x20IN\x20?',_[_0xf7b8('0x54')](_0x596186,'id'));}}})[_0xf7b8('0x4d')](function(){return _0x322a64;});}function buildContactsQuery(_0x3c936b,_0x20c4c0,_0x15ef1d,_0x1e40ba,_0x31c158,_0x24a0e6){if(_0x20c4c0){_0x20c4c0=_0x15ef1d['attributes'];}_0x3c936b=addFieldsToQuery(_0x3c936b,_0x20c4c0,_0x1e40ba,_0x24a0e6,!![]);var _0x1c4325=squel[_0xf7b8('0x6')]();_0x1c4325=addFieldsToQuery(_0x1c4325,_0x20c4c0,_0x1e40ba,_0x24a0e6,![]);if(_0x1e40ba||_0x24a0e6){_0x3c936b=applyJoinClauses(_0x3c936b,!![]);_0x3c936b[_0xf7b8('0x55')](_0xf7b8('0x56'));if(_0x15ef1d['limit']){_0x1c4325[_0xf7b8('0x57')](_0x15ef1d[_0xf7b8('0x57')]);}if(_0x15ef1d[_0xf7b8('0x58')]){_0x1c4325[_0xf7b8('0x58')](_0x15ef1d[_0xf7b8('0x58')]);}}else{_0x1c4325=applyJoinClauses(_0x1c4325,![]);_0x1c4325[_0xf7b8('0x55')](_0xf7b8('0x59'));if(_0x15ef1d[_0xf7b8('0x57')]){_0x3c936b[_0xf7b8('0x57')](_0x15ef1d[_0xf7b8('0x57')]);}if(_0x15ef1d[_0xf7b8('0x58')]){_0x3c936b[_0xf7b8('0x58')](_0x15ef1d['offset']);}}_0x1c4325[_0xf7b8('0x5a')](_0x31c158);if(_0x15ef1d[_0xf7b8('0x5b')]){_0x15ef1d[_0xf7b8('0x5b')]['forEach'](function(_0x22b98a){_0x3c936b[_0xf7b8('0x5b')]('c.'+_0x22b98a[0x0],_0x22b98a[0x1]===_0xf7b8('0x5c')?![]:!![]);_0x1c4325[_0xf7b8('0x5b')]('subqry.'+_0x22b98a[0x0],_0x22b98a[0x1]===_0xf7b8('0x5c')?![]:!![]);});}_0x1c4325[_0xf7b8('0x7')](_0x3c936b,_0xf7b8('0xa'));return _0x1c4325;}function getFilteredContacts(_0x1d4afa){var _0x43fd89=[];return db['Tag'][_0xf7b8('0x5d')]({'attributes':['id',_0xf7b8('0x34'),'color'],'raw':!![]})[_0xf7b8('0x4d')](function(_0x18977a){_0x43fd89=_[_0xf7b8('0x5e')](_0x18977a,'id');var _0x3df0d5={'type':db[_0xf7b8('0x5f')][_0xf7b8('0x60')][_0xf7b8('0x61')],'model':db[_0xf7b8('0x62')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xf7b8('0x63')][_0xf7b8('0x64')](_0x1d4afa['toString'](),_0x3df0d5);})[_0xf7b8('0x4d')](function(_0x2096f1){_0x2096f1[_0xf7b8('0x1d')](function(_0x5112c2){if(_0x5112c2[_0xf7b8('0x1a')]){_0x5112c2['Tags']=[];_0x5112c2[_0xf7b8('0x1a')][_0xf7b8('0x24')](',')['forEach'](function(_0x3da917){_0x5112c2['Tags']['push'](_0x43fd89[_0x3da917]);});}delete _0x5112c2[_0xf7b8('0x1a')];});return _0x2096f1;});}function countFilteredContacts(_0x1ec3e7,_0x533d4c){var _0x355ff6=_0x1ec3e7[_0xf7b8('0x65')]();_0x355ff6[_0xf7b8('0x1f')]('COUNT(*)');_0x355ff6=applyJoinClauses(_0x355ff6,!![]);_0x1ec3e7['group'](_0xf7b8('0x56'));var _0x4e5afb=utils[_0xf7b8('0x21')](_0x533d4c);if(!_[_0xf7b8('0x66')](_0x4e5afb)){_0x355ff6[_0xf7b8('0x9')](_0xf7b8('0x67'),_0x4e5afb);}var _0x100019={'type':db[_0xf7b8('0x5f')][_0xf7b8('0x60')]['SELECT'],'raw':!![]};return db['sequelize'][_0xf7b8('0x64')](_0x355ff6[_0xf7b8('0x68')](),_0x100019)[_0xf7b8('0x4d')](function(_0xef6cd2){return _0xef6cd2[0x0][_0xf7b8('0x69')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x4bf9=['Sequelize','SELECT','CmContact','query','toString','clone','COUNT(*)','getSelectedTags','isEmpty','QueryTypes','sequelize','exports','lodash','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','search','true','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','email','ListId','createdAt','deletedAt','TagIds','includes','forEach','field','expr','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','DATE','type','default','value','start','end','Tag','map','tags','clause','and','ids','User','user','skip','some','compact','Contact','push','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','tag','filter','select','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','keyBy'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x4bf9,0xd6));var _0x94bf=function(_0x4baf7e,_0x422b41){_0x4baf7e=_0x4baf7e-0x0;var _0x308a7f=_0x4bf9[_0x4baf7e];return _0x308a7f;};'use strict';var _=require(_0x94bf('0x0'));var squel=require('squel');var as=require(_0x94bf('0x1'));var qs=require(_0x94bf('0x2'));var utils=require(_0x94bf('0x3'));var db=require(_0x94bf('0x4'))['db'];function skipContactsQuery(_0x28822b,_0x34078c){var _0x2a5610=![];if(_0x28822b[_0x94bf('0x5')]==='agent'&&!_0x34078c[_0x94bf('0x6')]&&!_0x34078c['ListId']&&_0x34078c['autocomplete']!==_0x94bf('0x7')){_0x2a5610=!![];}return _0x2a5610;}function getContactsSubquery(){return squel['select']()[_0x94bf('0x8')](_0x94bf('0x9'),'c')[_0x94bf('0xa')](_0x94bf('0xb'));}function applyJoinClauses(_0x350280,_0x26693c){var _0x2ac3c5=_0x26693c?'c':_0x94bf('0xc');_0x350280['left_join']('cm_user_has_contacts','uc','uc.CmContactId\x20=\x20'+_0x2ac3c5+_0x94bf('0xd'))[_0x94bf('0xe')](_0x94bf('0xf'),'ct',_0x94bf('0x10')+_0x2ac3c5+_0x94bf('0xd'))[_0x94bf('0xe')](_0x94bf('0x11'),'t',_0x94bf('0x12'));return _0x350280;}function addFieldsToQuery(_0x4d44e3,_0x52576b,_0x2e35d7,_0x43190f,_0x10e2a2){var _0x5bdd47=_0x10e2a2?'c':'subqry';if(!_0x52576b){_0x52576b=['id',_0x94bf('0x13'),_0x94bf('0x14'),_0x94bf('0x15'),_0x94bf('0x16'),_0x94bf('0x17'),_0x94bf('0x18'),_0x94bf('0x19'),'CompanyId',_0x94bf('0x1a'),'updatedAt',_0x94bf('0x1b'),_0x94bf('0x1c')];}else if(!_0x52576b[_0x94bf('0x1d')]('id')){_0x52576b['push']('id');}var _0x5cfea9=_0x2e35d7&&_0x10e2a2||!_0x2e35d7&&!_0x10e2a2;if(_0x43190f){_0x5cfea9=_0x43190f&&_0x10e2a2||!_0x43190f&&!_0x10e2a2;}_0x52576b[_0x94bf('0x1e')](function(_0x584c9c){if(_0x584c9c===_0x94bf('0x1c')){if(_0x5cfea9){_0x4d44e3[_0x94bf('0x1f')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x584c9c);}else if(_0x2e35d7||_0x43190f){_0x4d44e3[_0x94bf('0x1f')](_0x5bdd47+'.'+_0x584c9c);}}else{_0x4d44e3[_0x94bf('0x1f')](_0x5bdd47+'.'+_0x584c9c);}});return _0x4d44e3;}function getSqlClauses(){var _0x3f7ba3={'default':squel[_0x94bf('0x20')](),'fields':squel[_0x94bf('0x20')](),'filter':squel[_0x94bf('0x20')](),'tags':{'clause':squel[_0x94bf('0x20')](),'ids':null},'user':{'clause':squel[_0x94bf('0x20')](),'skip':![]}};return _0x3f7ba3;}function parseTagParameter(_0x2c2afe){var _0x2a5729=squel['expr']();if(_0x2c2afe){var _0x1a753a=utils['getSelectedTags'](_0x2c2afe);_0x1a753a[_0x94bf('0x1e')](function(_0x3a6892){_0x2a5729['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3a6892+',%');});}return _0x2a5729;}function parseSearchFilter(_0x571422){var _0x3f57fa=squel[_0x94bf('0x20')]();if(_0x571422){var _0x3363b1=_0x571422[_0x94bf('0x21')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x3363b1[_0x94bf('0x22')]('\x20')[_0x94bf('0x23')]>0x1){_0x3f57fa['or'](_0x94bf('0x24'),qs[_0x94bf('0x25')](_0x3363b1,!![]),null);}else{if(qs['isNumeric'](_0x3363b1)){_0x3f57fa['or'](_0x94bf('0x26'),_0x3363b1+'%');_0x3f57fa['or'](_0x94bf('0x27'),_0x3363b1+'%');_0x3f57fa['or'](_0x94bf('0x28'),_0x3363b1+'%');_0x3f57fa['or'](_0x94bf('0x29'),_0x3363b1+'%');}else if(qs[_0x94bf('0x2a')](_0x3363b1)){_0x3f57fa['or'](_0x94bf('0x2b'),_0x3363b1+'%');}else{_0x3f57fa['or'](_0x94bf('0x2c'),'%'+_0x3363b1+'%');_0x3f57fa['or'](_0x94bf('0x2d'),'%'+_0x3363b1+'%');_0x3f57fa['or']('c.email\x20LIKE\x20?','%'+_0x3363b1+'%');}}}return _0x3f57fa;}function parseAdvancedSearchFilter(_0x2ca425,_0x223314){var _0x1899ba=getSqlClauses();var _0x162959=as[_0x94bf('0x2e')](_0x2ca425);var _0x533dc7=_0x162959[_0x94bf('0x2f')];for(var _0x1c9de8=0x0;_0x1c9de8<_0x162959['conditions']['length'];_0x1c9de8++){var _0x2fb8ff=_0x162959[_0x94bf('0x30')][_0x1c9de8];var _0x2ffbe7='c';var _0x3deefe=_[_0x94bf('0x31')](_0x223314,[_0x94bf('0x32'),_0x2fb8ff[_0x94bf('0x1f')]]);if(_0x3deefe){if(_0x2fb8ff[_0x94bf('0x1f')]===_0x94bf('0x33')||_0x3deefe['fieldType']==='datetime'){_0x2fb8ff['castTo']=_0x94bf('0x34');}var _0x18bc4a=as['buildExpression'](_0x2ffbe7,_0x3deefe[_0x94bf('0x35')],_0x2fb8ff);_0x1899ba[_0x94bf('0x36')][_0x533dc7](_0x18bc4a['text'],_0x18bc4a[_0x94bf('0x37')][_0x94bf('0x38')],_0x18bc4a[_0x94bf('0x37')][_0x94bf('0x39')]);}else{if(_0x2fb8ff[_0x94bf('0x1f')]===_0x94bf('0x3a')){var _0x2734b9=_0x2fb8ff[_0x94bf('0x37')][_0x94bf('0x22')](',')[_0x94bf('0x3b')](function(_0x176a2a){return Number(_0x176a2a);});var _0x4dceba=parseTagParameter(_0x2734b9);_0x1899ba[_0x94bf('0x3c')][_0x94bf('0x3d')][_0x94bf('0x3e')](_0x4dceba);_0x1899ba[_0x94bf('0x3c')][_0x94bf('0x3f')]=_0x2734b9;}else if(_0x2fb8ff[_0x94bf('0x1f')]===_0x94bf('0x40')){_0x1899ba[_0x94bf('0x41')]['clause'][_0x94bf('0x3e')]('uc.UserId\x20=\x20?',_0x2fb8ff[_0x94bf('0x37')]);_0x1899ba[_0x94bf('0x41')][_0x94bf('0x42')]=!![];}}}return _0x1899ba;}function parseModelFields(_0x17a633,_0x58f7ba){var _0xcc4b66=squel[_0x94bf('0x20')]();var _0x2dc92d=_(_0x17a633)['keys']()[_0x94bf('0x3b')](function(_0x5ee46c){return _[_0x94bf('0x43')](_0x58f7ba,[_0x94bf('0x32'),_0x5ee46c])?_0x5ee46c:undefined;})[_0x94bf('0x44')]()['value']();if(_0x17a633[_0x94bf('0x45')]){_0x2dc92d[_0x94bf('0x46')](_0x94bf('0x45'));}if(_0x17a633['User']){_0x2dc92d[_0x94bf('0x46')](_0x94bf('0x40'));}if(_0x2dc92d[_0x94bf('0x23')]>0x0){_0x2dc92d[_0x94bf('0x1e')](function(_0x7ffc8){if(_0x7ffc8===_0x94bf('0x19')){_0xcc4b66[_0x94bf('0x3e')]('c.ListId\x20IN\x20?',[][_0x94bf('0x47')](_0x17a633[_0x7ffc8]));}else if(_0x7ffc8===_0x94bf('0x45')){var _0x49f616='%'+_0x17a633[_0x7ffc8]+'%';_0xcc4b66[_0x94bf('0x3e')](_0x94bf('0x48'),_0x49f616);}else if(_0x7ffc8===_0x94bf('0x40')){_0xcc4b66[_0x94bf('0x3e')]('uc.UserId\x20=\x20?',_0x17a633[_0x7ffc8]);}else{_0xcc4b66['and']('c.'+_0x7ffc8+_0x94bf('0x49'),_0x17a633[_0x7ffc8]);}});}return _0xcc4b66;}function parseQueryParameters(_0xba06b,_0x13b676){var _0xa835d9=getSqlClauses();return Promise[_0x94bf('0x4a')]()[_0x94bf('0x4b')](function(){return parseModelFields(_0xba06b,_0x13b676);})[_0x94bf('0x4b')](function(_0x202c69){_0xa835d9['fields'][_0x94bf('0x3e')](_0x202c69);return parseTagParameter(_0xba06b[_0x94bf('0x4c')]);})[_0x94bf('0x4b')](function(_0x31700f){_0xa835d9['tags'][_0x94bf('0x3d')][_0x94bf('0x3e')](_0x31700f);return parseSearchFilter(_0xba06b[_0x94bf('0x4d')]);})['then'](function(_0x2078f6){_0xa835d9[_0x94bf('0x4d')]=_0x2078f6;return _0xa835d9;});}function checkListsRestrictions(_0x589d6e,_0x4ff88a,_0x56a195){var _0xae1fde=squel[_0x94bf('0x20')]();return Promise[_0x94bf('0x4a')]()[_0x94bf('0x4b')](function(){if(_0x4ff88a['search']&&_0x589d6e[_0x94bf('0x5')]==='agent'&&!_0x56a195){return _0x589d6e['getLists']({'attributes':['id'],'raw':!![]});}})['then'](function(_0x1c59bf){if(_0x1c59bf){if(_0x1c59bf[_0x94bf('0x23')]===0x0){_0xae1fde[_0x94bf('0x3e')]('c.ListId\x20IS\x20NULL');}else{_0xae1fde[_0x94bf('0x3e')]('c.ListId\x20IN\x20?',_['map'](_0x1c59bf,'id'));}}})['then'](function(){return _0xae1fde;});}function buildContactsQuery(_0x5f3bd2,_0x3a5212,_0x1a523b,_0x42acc6,_0x21cb08,_0x969da1){if(_0x3a5212){_0x3a5212=_0x1a523b['attributes'];}_0x5f3bd2=addFieldsToQuery(_0x5f3bd2,_0x3a5212,_0x42acc6,_0x969da1,!![]);var _0x460ddc=squel[_0x94bf('0x4e')]();_0x460ddc=addFieldsToQuery(_0x460ddc,_0x3a5212,_0x42acc6,_0x969da1,![]);if(_0x42acc6||_0x969da1){_0x5f3bd2=applyJoinClauses(_0x5f3bd2,!![]);_0x5f3bd2[_0x94bf('0x4f')](_0x94bf('0x50'));if(_0x1a523b[_0x94bf('0x51')]){_0x460ddc[_0x94bf('0x51')](_0x1a523b[_0x94bf('0x51')]);}if(_0x1a523b[_0x94bf('0x52')]){_0x460ddc['offset'](_0x1a523b['offset']);}}else{_0x460ddc=applyJoinClauses(_0x460ddc,![]);_0x460ddc[_0x94bf('0x4f')](_0x94bf('0x53'));if(_0x1a523b['limit']){_0x5f3bd2[_0x94bf('0x51')](_0x1a523b[_0x94bf('0x51')]);}if(_0x1a523b['offset']){_0x5f3bd2[_0x94bf('0x52')](_0x1a523b[_0x94bf('0x52')]);}}_0x460ddc[_0x94bf('0x54')](_0x21cb08);if(_0x1a523b[_0x94bf('0x55')]){_0x1a523b[_0x94bf('0x55')]['forEach'](function(_0x4a3d37){_0x5f3bd2['order']('c.'+_0x4a3d37[0x0],_0x4a3d37[0x1]===_0x94bf('0x56')?![]:!![]);_0x460ddc[_0x94bf('0x55')](_0x94bf('0x57')+_0x4a3d37[0x0],_0x4a3d37[0x1]==='DESC'?![]:!![]);});}_0x460ddc[_0x94bf('0x8')](_0x5f3bd2,_0x94bf('0xc'));return _0x460ddc;}function getFilteredContacts(_0x4cf4a4){var _0x2fbde9=[];return db[_0x94bf('0x3a')]['findAll']({'attributes':['id',_0x94bf('0x32'),'color'],'raw':!![]})[_0x94bf('0x4b')](function(_0x235dc1){_0x2fbde9=_[_0x94bf('0x58')](_0x235dc1,'id');var _0xd5f6f2={'type':db[_0x94bf('0x59')]['QueryTypes'][_0x94bf('0x5a')],'model':db[_0x94bf('0x5b')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x94bf('0x5c')](_0x4cf4a4[_0x94bf('0x5d')](),_0xd5f6f2);})[_0x94bf('0x4b')](function(_0x972dd){_0x972dd[_0x94bf('0x1e')](function(_0x42f3b9){if(_0x42f3b9[_0x94bf('0x1c')]){_0x42f3b9['Tags']=[];_0x42f3b9[_0x94bf('0x1c')][_0x94bf('0x22')](',')[_0x94bf('0x1e')](function(_0x2af013){_0x42f3b9['Tags']['push'](_0x2fbde9[_0x2af013]);});}delete _0x42f3b9[_0x94bf('0x1c')];});return _0x972dd;});}function countFilteredContacts(_0x57d1fa,_0x47ea4a){var _0x3c892a=_0x57d1fa[_0x94bf('0x5e')]();_0x3c892a['field'](_0x94bf('0x5f'));_0x3c892a=applyJoinClauses(_0x3c892a,!![]);_0x57d1fa[_0x94bf('0x4f')](_0x94bf('0x50'));var _0x118207=utils[_0x94bf('0x60')](_0x47ea4a);if(!_[_0x94bf('0x61')](_0x118207)){_0x3c892a[_0x94bf('0xa')]('t.id\x20IN\x20?',_0x118207);}var _0x26a05d={'type':db[_0x94bf('0x59')][_0x94bf('0x62')]['SELECT'],'raw':!![]};return db[_0x94bf('0x63')]['query'](_0x3c892a[_0x94bf('0x5d')](),_0x26a05d)[_0x94bf('0x4b')](function(_0x3364c6){return _0x3364c6[0x0][_0x94bf('0x5f')];});}module[_0x94bf('0x64')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 39a6ada..421b360 100644 --- a/server/components/encryptor/index.js +++ b/server/components/encryptor/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6fc=['end','final','close','unlink','createDecipher','data','secret','base64','decryptString','utf8','bluebird','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','update','binary','write'];(function(_0x81e39d,_0x4c3934){var _0x548fbb=function(_0x1adda5){while(--_0x1adda5){_0x81e39d['push'](_0x81e39d['shift']());}};_0x548fbb(++_0x4c3934);}(_0xa6fc,0x6d));var _0xca6f=function(_0x20cd42,_0x2c92fc){_0x20cd42=_0x20cd42-0x0;var _0x20013a=_0xa6fc[_0x20cd42];return _0x20013a;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xca6f('0x0'));var _=require('lodash');var config=require('../../config/environment');var logger=require(_0xca6f('0x1'))(_0xca6f('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xca6f('0x3')],'algorithm':_0xca6f('0x4')};const fileOptions={'algorithm':_0xca6f('0x5')};if(config[_0xca6f('0x6')]&&config['encrypt'][_0xca6f('0x7')]){var isSupported=isAlgorithmSupported(config[_0xca6f('0x6')][_0xca6f('0x7')]);if(isSupported){fileOptions[_0xca6f('0x7')]=config[_0xca6f('0x6')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0xca6f('0x8')](',\x20');logger[_0xca6f('0x9')](config['encrypt']['algorithm'],_0xca6f('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x57a3a5){return AES_SUPPORTED_RX[_0xca6f('0xb')](_0x57a3a5);}function getSupportedCiphers(){return crypto[_0xca6f('0xc')]()[_0xca6f('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x207a2c){return getSupportedCiphers()[_0xca6f('0xe')](_0x207a2c)>-0x1;}function combineOptions(_0x3fd4a4){var _0x1a5d35={};for(var _0x4c4d78 in fileOptions){if(fileOptions[_0xca6f('0xf')](_0x4c4d78)){_0x1a5d35[_0x4c4d78]=fileOptions[_0x4c4d78];}}if(_0x3fd4a4){for(var _0x3655be in _0x3fd4a4){if(_0x3fd4a4['hasOwnProperty'](_0x3655be)){_0x1a5d35[_0x3655be]=_0x3fd4a4[_0x3655be];}}}return _0x1a5d35;}exports[_0xca6f('0x10')]=function(_0x5459c8,_0x489472,_0xb81015,_0x5d1533){return new BPromise(function(_0x403bd9,_0x3fb520){_0x5d1533=combineOptions(_0x5d1533);var _0x99aedd=new Buffer(_0xb81015);var _0x564100=fs[_0xca6f('0x11')](_0x5459c8);var _0x167d29=fs[_0xca6f('0x12')](_0x489472);var _0x3af39b=crypto[_0xca6f('0x13')](_0x5d1533['algorithm'],_0x99aedd);_0x564100['on']('data',function(_0x57327e){var _0x8f7229=new Buffer(_0x3af39b[_0xca6f('0x14')](_0x57327e),_0xca6f('0x15'));_0x167d29[_0xca6f('0x16')](_0x8f7229);});_0x564100['on'](_0xca6f('0x17'),function(){try{var _0x27f8d4=new Buffer(_0x3af39b[_0xca6f('0x18')](_0xca6f('0x15')),_0xca6f('0x15'));_0x167d29[_0xca6f('0x16')](_0x27f8d4);_0x167d29[_0xca6f('0x17')]();_0x167d29['on'](_0xca6f('0x19'),function(){return _0x403bd9(_0x489472);});}catch(_0x569f3e){fs[_0xca6f('0x1a')](_0x489472);return _0x3fb520(_0x569f3e);}});});};exports['decryptFile']=function(_0x4a92dc,_0x37f346,_0x3897e1,_0x49e291){return new BPromise(function(_0x431c8c,_0x4fb119){_0x49e291=combineOptions(_0x49e291);var _0x4425ae=new Buffer(_0x3897e1);var _0x5b02e6=fs['createReadStream'](_0x4a92dc);var _0x55c7e6=fs[_0xca6f('0x12')](_0x37f346);var _0x2e2ee9=crypto[_0xca6f('0x1b')](_0x49e291[_0xca6f('0x7')],_0x4425ae);_0x5b02e6['on'](_0xca6f('0x1c'),function(_0x42e649){var _0x2b5819=new Buffer(_0x2e2ee9[_0xca6f('0x14')](_0x42e649),_0xca6f('0x15'));_0x55c7e6[_0xca6f('0x16')](_0x2b5819);});_0x5b02e6['on']('end',function(){try{var _0x198cbd=new Buffer(_0x2e2ee9[_0xca6f('0x18')](_0xca6f('0x15')),_0xca6f('0x15'));_0x55c7e6[_0xca6f('0x16')](_0x198cbd);_0x55c7e6[_0xca6f('0x17')]();_0x55c7e6['on'](_0xca6f('0x19'),function(){return _0x431c8c(_0x37f346);});}catch(_0x3dd849){fs['unlink'](_0x37f346);return _0x4fb119(_0x3dd849);}});});};exports['encryptString']=function(_0x13ee51,_0x29b079,_0xfb6bd9){var _0x326163=_0xfb6bd9||stringOptions['algorithm'];var _0xeaa11=_0x29b079||stringOptions[_0xca6f('0x1d')];var _0x1f92f1=crypto['createCipher'](_0x326163,_0xeaa11);var _0x4c01e4=_0x1f92f1['update'](_0x13ee51,'utf8','base64');_0x4c01e4+=_0x1f92f1[_0xca6f('0x18')](_0xca6f('0x1e'));return _0x4c01e4;};exports[_0xca6f('0x1f')]=function(_0x396aeb,_0x2bdc6a,_0x295602){var _0x18a35e=_0x295602||stringOptions[_0xca6f('0x7')];var _0x419849=_0x2bdc6a||stringOptions['secret'];var _0x378ee5=crypto[_0xca6f('0x1b')](_0x18a35e,_0x419849);var _0x2f18b1=_0x378ee5[_0xca6f('0x14')](_0x396aeb,_0xca6f('0x1e'),_0xca6f('0x20'));_0x2f18b1+=_0x378ee5[_0xca6f('0x18')](_0xca6f('0x20'));return _0x2f18b1;}; \ No newline at end of file +var _0x64f6=['close','unlink','decryptFile','createDecipher','final','encryptString','secret','createCipher','utf8','base64','crypto','bluebird','lodash','../../config/environment','app','aes192','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','update','binary','write','end'];(function(_0x2e1821,_0x51f1be){var _0x53188c=function(_0x4fc2c6){while(--_0x4fc2c6){_0x2e1821['push'](_0x2e1821['shift']());}};_0x53188c(++_0x51f1be);}(_0x64f6,0x67));var _0x664f=function(_0x39d518,_0x32b600){_0x39d518=_0x39d518-0x0;var _0x2feade=_0x64f6[_0x39d518];return _0x2feade;};'use strict';var crypto=require(_0x664f('0x0'));var fs=require('fs');var BPromise=require(_0x664f('0x1'));var _=require(_0x664f('0x2'));var config=require(_0x664f('0x3'));var logger=require('../../config/logger')(_0x664f('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x664f('0x5')};if(config[_0x664f('0x6')]&&config[_0x664f('0x6')][_0x664f('0x7')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions['algorithm']=config[_0x664f('0x6')][_0x664f('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0x664f('0x6')]['algorithm'],_0x664f('0x8'),supportedAlgorithms);}}function isASupportedCipher(_0x1644b6){return AES_SUPPORTED_RX[_0x664f('0x9')](_0x1644b6);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x664f('0xa')](isASupportedCipher);}function isAlgorithmSupported(_0x46f271){return getSupportedCiphers()[_0x664f('0xb')](_0x46f271)>-0x1;}function combineOptions(_0x35a284){var _0x9b555a={};for(var _0x462233 in fileOptions){if(fileOptions[_0x664f('0xc')](_0x462233)){_0x9b555a[_0x462233]=fileOptions[_0x462233];}}if(_0x35a284){for(var _0x1ee648 in _0x35a284){if(_0x35a284[_0x664f('0xc')](_0x1ee648)){_0x9b555a[_0x1ee648]=_0x35a284[_0x1ee648];}}}return _0x9b555a;}exports[_0x664f('0xd')]=function(_0x3d06f2,_0x203b24,_0x439f50,_0x56622d){return new BPromise(function(_0x214a06,_0x105dad){_0x56622d=combineOptions(_0x56622d);var _0x1fd017=new Buffer(_0x439f50);var _0x2ffd74=fs[_0x664f('0xe')](_0x3d06f2);var _0x2d528f=fs[_0x664f('0xf')](_0x203b24);var _0xf76c05=crypto['createCipher'](_0x56622d[_0x664f('0x7')],_0x1fd017);_0x2ffd74['on'](_0x664f('0x10'),function(_0x30b5fe){var _0x44408f=new Buffer(_0xf76c05[_0x664f('0x11')](_0x30b5fe),_0x664f('0x12'));_0x2d528f['write'](_0x44408f);});_0x2ffd74['on']('end',function(){try{var _0x14cdae=new Buffer(_0xf76c05['final'](_0x664f('0x12')),_0x664f('0x12'));_0x2d528f[_0x664f('0x13')](_0x14cdae);_0x2d528f[_0x664f('0x14')]();_0x2d528f['on'](_0x664f('0x15'),function(){return _0x214a06(_0x203b24);});}catch(_0x4ff2f4){fs[_0x664f('0x16')](_0x203b24);return _0x105dad(_0x4ff2f4);}});});};exports[_0x664f('0x17')]=function(_0x4ed0f8,_0x50d606,_0x38c357,_0x387455){return new BPromise(function(_0x5cd536,_0x43a724){_0x387455=combineOptions(_0x387455);var _0x18c4a6=new Buffer(_0x38c357);var _0x17e1ed=fs[_0x664f('0xe')](_0x4ed0f8);var _0x8654e8=fs['createWriteStream'](_0x50d606);var _0x19ebe0=crypto[_0x664f('0x18')](_0x387455[_0x664f('0x7')],_0x18c4a6);_0x17e1ed['on'](_0x664f('0x10'),function(_0x50162a){var _0x51169f=new Buffer(_0x19ebe0[_0x664f('0x11')](_0x50162a),'binary');_0x8654e8[_0x664f('0x13')](_0x51169f);});_0x17e1ed['on'](_0x664f('0x14'),function(){try{var _0x1c98fc=new Buffer(_0x19ebe0[_0x664f('0x19')](_0x664f('0x12')),_0x664f('0x12'));_0x8654e8[_0x664f('0x13')](_0x1c98fc);_0x8654e8[_0x664f('0x14')]();_0x8654e8['on'](_0x664f('0x15'),function(){return _0x5cd536(_0x50d606);});}catch(_0x13a48c){fs[_0x664f('0x16')](_0x50d606);return _0x43a724(_0x13a48c);}});});};exports[_0x664f('0x1a')]=function(_0x71c2e8,_0x354a54,_0x196100){var _0x4a5703=_0x196100||stringOptions[_0x664f('0x7')];var _0x45b688=_0x354a54||stringOptions[_0x664f('0x1b')];var _0x355865=crypto[_0x664f('0x1c')](_0x4a5703,_0x45b688);var _0x15b711=_0x355865['update'](_0x71c2e8,_0x664f('0x1d'),_0x664f('0x1e'));_0x15b711+=_0x355865[_0x664f('0x19')](_0x664f('0x1e'));return _0x15b711;};exports['decryptString']=function(_0x9f24ed,_0x116d0f,_0x167523){var _0x380d20=_0x167523||stringOptions[_0x664f('0x7')];var _0x557421=_0x116d0f||stringOptions[_0x664f('0x1b')];var _0x3d8514=crypto[_0x664f('0x18')](_0x380d20,_0x557421);var _0x46f455=_0x3d8514[_0x664f('0x11')](_0x9f24ed,_0x664f('0x1e'),_0x664f('0x1d'));_0x46f455+=_0x3d8514[_0x664f('0x19')](_0x664f('0x1d'));return _0x46f455;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index a4dea86..92fa56e 100644 --- a/server/components/export/csv.js +++ b/server/components/export/csv.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38b8=['join','mkdirSync','each','%s%d.%s','%s.%s','csv','writeFileSync','zip','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','split','splitSizeCsv','then','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','Empty','length','range','num','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','basename','existsSync'];(function(_0x2197bb,_0x2d7033){var _0x255158=function(_0x45dcbb){while(--_0x45dcbb){_0x2197bb['push'](_0x2197bb['shift']());}};_0x255158(++_0x2d7033);}(_0x38b8,0x160));var _0x838b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x38b8[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x838b('0x0'));var path=require(_0x838b('0x1'));var _=require('lodash');var csv=require(_0x838b('0x2'));var fs=require('fs');var BPromise=require(_0x838b('0x3'));var zipdir=require(_0x838b('0x4'));var rimraf=require('rimraf');var db=require(_0x838b('0x5'))['db'];var dbH=require(_0x838b('0x5'))[_0x838b('0x6')];var logger=require(_0x838b('0x7'))(_0x838b('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x838b('0x9')][0x3];var PATH=process[_0x838b('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3f9b01,_0x7c2c1f){var _0xf48133={'status':_0x3f9b01};var _0x333b93={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x7c2c1f){_0xf48133['savename']=_0x7c2c1f;}return db[_0x838b('0xa')][_0x838b('0xb')](_0xf48133,_0x333b93);}function main(){var _0x3d6b1a=0x1388;var _0x3bc177;logger[_0x838b('0xc')](util['format'](_0x838b('0xd'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0x838b('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x838b('0xf'),_0x838b('0x10')]})[_0x838b('0x11')](function(_0x526e30){if(_0x526e30){_0x3bc177=_0x526e30;_0x3d6b1a=_0x3bc177['splitSizeCsv']||0x1388;}})[_0x838b('0x11')](function(){return dbH['sequelize'][_0x838b('0x12')](util[_0x838b('0x13')](_0x838b('0x14'),QUERY),{'type':dbH[_0x838b('0x15')][_0x838b('0x16')]['SELECT']});})['then'](function(_0x39f4c3){if(!_0x39f4c3[0x0]['num']){return analyticExtractedReport(_0x838b('0x17'));}var _0x9a5900=[];var _0x365fb6=0x0;if(_0x3bc177[_0x838b('0xf')]){if(_0x39f4c3&&_0x39f4c3[_0x838b('0x18')]){var _0x5bf975=_[_0x838b('0x19')](_0x39f4c3[0x0][_0x838b('0x1a')]/_0x3d6b1a);var _0x3bd24a=Number['isInteger'](_0x39f4c3[0x0][_0x838b('0x1a')]/_0x3d6b1a)?_0x39f4c3[0x0][_0x838b('0x1a')]%_0x3d6b1a:0x0;_0x5bf975[_0x838b('0x1b')](function(_0x55e3ea){if(_0x55e3ea>0x0){_0x365fb6+=_0x3d6b1a;}_0x9a5900['push'](dbH[_0x838b('0x15')][_0x838b('0x12')](util['format'](_0x838b('0x1c'),QUERY,_0x3d6b1a,_0x365fb6),{'type':dbH['sequelize'][_0x838b('0x16')]['SELECT']}));});if(_0x3bd24a>0x0){_0x365fb6+=_0x3d6b1a;_0x9a5900[_0x838b('0x1d')](dbH[_0x838b('0x15')][_0x838b('0x12')](util['format'](_0x838b('0x1c'),QUERY,_0x3bd24a,_0x365fb6),{'type':dbH[_0x838b('0x15')][_0x838b('0x16')]['SELECT']}));}}}else{_0x9a5900['push'](dbH[_0x838b('0x15')]['query'](QUERY,{'type':dbH[_0x838b('0x15')][_0x838b('0x16')]['SELECT']}));}var _0x45ba0c=path['dirname'](PATH);var _0x120f0c=path[_0x838b('0x1e')](PATH,'.csv');var _0x374fb3=_0x3bc177[_0x838b('0xf')]&&_0x9a5900[_0x838b('0x18')]>0x1;var _0x43e3de=[];if(!fs[_0x838b('0x1f')](path[_0x838b('0x20')](_0x45ba0c,_0x120f0c))&&_0x374fb3){fs[_0x838b('0x21')](path['join'](_0x45ba0c,_0x120f0c));}return BPromise[_0x838b('0x22')](_0x9a5900,function(_0x35e369){_0x43e3de[_0x838b('0x1d')](_0x35e369);})[_0x838b('0x11')](function(){for(var _0x454d8a=0x0;_0x454d8a<_0x43e3de[_0x838b('0x18')];_0x454d8a+=0x1){var _0x3d2249;var _0x38c672=_0x43e3de[_0x454d8a];if(_0x374fb3){_0x3d2249=path[_0x838b('0x20')](_0x45ba0c,_0x120f0c,util[_0x838b('0x13')](_0x838b('0x23'),_0x120f0c,_0x454d8a,'csv'));}else{_0x3d2249=path[_0x838b('0x20')](_0x45ba0c,util[_0x838b('0x13')](_0x838b('0x24'),_0x120f0c,_0x838b('0x25')));}fs[_0x838b('0x26')](_0x3d2249,csv(_0x38c672));}})[_0x838b('0x11')](function(){if(_0x374fb3){return new Promise(function(_0xc2d342){zipdir(path[_0x838b('0x20')](_0x45ba0c,_0x120f0c),{'saveTo':path[_0x838b('0x20')](_0x45ba0c,util[_0x838b('0x13')](_0x838b('0x24'),_0x120f0c,_0x838b('0x27')))},function(_0x2c05b1,_0x40ca0a){rimraf(path[_0x838b('0x20')](_0x45ba0c,_0x120f0c),function(){});_0xc2d342('zip\x20finished');});});}})[_0x838b('0x11')](function(){logger[_0x838b('0xc')](util[_0x838b('0x13')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x838b('0x28')));return analyticExtractedReport(_0x838b('0x29'),_0x374fb3?util[_0x838b('0x13')]('%s.%s',_0x120f0c,_0x374fb3?_0x838b('0x27'):'csv'):null);});})[_0x838b('0x2a')](function(_0x3ddfc9){logger[_0x838b('0xc')](util['format'](_0x838b('0x2b'),EXTRACTED_REPORT_ID,_0x838b('0x28')),util[_0x838b('0x2c')](_0x3ddfc9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x838b('0x2d'));})[_0x838b('0x2e')](function(){process[_0x838b('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xce48=['query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','length','num','format','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','.csv','split','join','mkdirSync','csv','%s.%s','writeFileSync','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','Failed','finally','exit','util','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','splitSizeCsv','then','sequelize'];(function(_0x14546a,_0x42ffd3){var _0x4a693d=function(_0x35145e){while(--_0x35145e){_0x14546a['push'](_0x14546a['shift']());}};_0x4a693d(++_0x42ffd3);}(_0xce48,0x73));var _0x8ce4=function(_0x3f22e8,_0x37732a){_0x3f22e8=_0x3f22e8-0x0;var _0x368a7e=_0xce48[_0x3f22e8];return _0x368a7e;};'use strict';var util=require(_0x8ce4('0x0'));var path=require('path');var _=require(_0x8ce4('0x1'));var csv=require(_0x8ce4('0x2'));var fs=require('fs');var BPromise=require(_0x8ce4('0x3'));var zipdir=require(_0x8ce4('0x4'));var rimraf=require('rimraf');var db=require(_0x8ce4('0x5'))['db'];var dbH=require('../../mysqldb')[_0x8ce4('0x6')];var logger=require(_0x8ce4('0x7'))(_0x8ce4('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x8ce4('0x9')][0x2]);var QUERY=process[_0x8ce4('0x9')][0x3];var PATH=process[_0x8ce4('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x35c52d,_0x2c1778){var _0x22043b={'status':_0x35c52d};var _0x2890ae={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2c1778){_0x22043b[_0x8ce4('0xa')]=_0x2c1778;}return db[_0x8ce4('0xb')][_0x8ce4('0xc')](_0x22043b,_0x2890ae);}function main(){var _0x308ae1=0x1388;var _0xd3ba1e;logger[_0x8ce4('0xd')](util['format'](_0x8ce4('0xe'),EXTRACTED_REPORT_ID,_0x8ce4('0xf')));return db['Setting'][_0x8ce4('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x8ce4('0x11')]})[_0x8ce4('0x12')](function(_0x3d17b3){if(_0x3d17b3){_0xd3ba1e=_0x3d17b3;_0x308ae1=_0xd3ba1e[_0x8ce4('0x11')]||0x1388;}})[_0x8ce4('0x12')](function(){return dbH[_0x8ce4('0x13')][_0x8ce4('0x14')](util['format'](_0x8ce4('0x15'),QUERY),{'type':dbH[_0x8ce4('0x13')][_0x8ce4('0x16')]['SELECT']});})[_0x8ce4('0x12')](function(_0x45dab9){if(!_0x45dab9[0x0]['num']){return analyticExtractedReport('Empty');}var _0x4d3c0a=[];var _0x5ab0c3=0x0;if(_0xd3ba1e['split']){if(_0x45dab9&&_0x45dab9[_0x8ce4('0x17')]){var _0x508cf8=_['range'](_0x45dab9[0x0][_0x8ce4('0x18')]/_0x308ae1);var _0x28c93a=Number['isInteger'](_0x45dab9[0x0][_0x8ce4('0x18')]/_0x308ae1)?_0x45dab9[0x0]['num']%_0x308ae1:0x0;_0x508cf8['forEach'](function(_0x2c63a2){if(_0x2c63a2>0x0){_0x5ab0c3+=_0x308ae1;}_0x4d3c0a['push'](dbH[_0x8ce4('0x13')][_0x8ce4('0x14')](util[_0x8ce4('0x19')](_0x8ce4('0x1a'),QUERY,_0x308ae1,_0x5ab0c3),{'type':dbH[_0x8ce4('0x13')]['QueryTypes'][_0x8ce4('0x1b')]}));});if(_0x28c93a>0x0){_0x5ab0c3+=_0x308ae1;_0x4d3c0a[_0x8ce4('0x1c')](dbH[_0x8ce4('0x13')][_0x8ce4('0x14')](util[_0x8ce4('0x19')](_0x8ce4('0x1a'),QUERY,_0x28c93a,_0x5ab0c3),{'type':dbH[_0x8ce4('0x13')][_0x8ce4('0x16')]['SELECT']}));}}}else{_0x4d3c0a[_0x8ce4('0x1c')](dbH[_0x8ce4('0x13')][_0x8ce4('0x14')](QUERY,{'type':dbH[_0x8ce4('0x13')]['QueryTypes'][_0x8ce4('0x1b')]}));}var _0x9355ef=path['dirname'](PATH);var _0x72ca66=path['basename'](PATH,_0x8ce4('0x1d'));var _0x9c3bcb=_0xd3ba1e[_0x8ce4('0x1e')]&&_0x4d3c0a[_0x8ce4('0x17')]>0x1;var _0x45e48e=[];if(!fs['existsSync'](path[_0x8ce4('0x1f')](_0x9355ef,_0x72ca66))&&_0x9c3bcb){fs[_0x8ce4('0x20')](path[_0x8ce4('0x1f')](_0x9355ef,_0x72ca66));}return BPromise['each'](_0x4d3c0a,function(_0x5f2170){_0x45e48e[_0x8ce4('0x1c')](_0x5f2170);})[_0x8ce4('0x12')](function(){for(var _0x3604ff=0x0;_0x3604ff<_0x45e48e[_0x8ce4('0x17')];_0x3604ff+=0x1){var _0xdf80ab;var _0x22ba82=_0x45e48e[_0x3604ff];if(_0x9c3bcb){_0xdf80ab=path['join'](_0x9355ef,_0x72ca66,util[_0x8ce4('0x19')]('%s%d.%s',_0x72ca66,_0x3604ff,_0x8ce4('0x21')));}else{_0xdf80ab=path[_0x8ce4('0x1f')](_0x9355ef,util[_0x8ce4('0x19')](_0x8ce4('0x22'),_0x72ca66,_0x8ce4('0x21')));}fs[_0x8ce4('0x23')](_0xdf80ab,csv(_0x22ba82));}})[_0x8ce4('0x12')](function(){if(_0x9c3bcb){return new Promise(function(_0x857a67){zipdir(path['join'](_0x9355ef,_0x72ca66),{'saveTo':path[_0x8ce4('0x1f')](_0x9355ef,util[_0x8ce4('0x19')](_0x8ce4('0x22'),_0x72ca66,_0x8ce4('0x24')))},function(_0x547078,_0x17d7aa){rimraf(path['join'](_0x9355ef,_0x72ca66),function(){});_0x857a67(_0x8ce4('0x25'));});});}})[_0x8ce4('0x12')](function(){logger[_0x8ce4('0xd')](util[_0x8ce4('0x19')](_0x8ce4('0x26'),EXTRACTED_REPORT_ID,_0x8ce4('0xf')));return analyticExtractedReport(_0x8ce4('0x27'),_0x9c3bcb?util[_0x8ce4('0x19')](_0x8ce4('0x22'),_0x72ca66,_0x9c3bcb?_0x8ce4('0x24'):'csv'):null);});})[_0x8ce4('0x28')](function(_0x387d91){logger['info'](util[_0x8ce4('0x19')](_0x8ce4('0x29'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x387d91,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8ce4('0x2a'));})[_0x8ce4('0x2b')](function(){process[_0x8ce4('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 1ad6e10..ed4ff50 100644 --- a/server/components/export/pdf.js +++ b/server/components/export/pdf.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5ee=['header','pageBreak','before','margin','landscape','toString','\x20/\x20','footer','black','right','num','Empty','Setting','find','split','then','splitSizePdf','sequelize','QueryTypes','SELECT','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.pdf','existsSync','join','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','findOne','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','createPdfFromHTML','catch','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','value','fill','length','auto','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate'];(function(_0x2cac2e,_0x1fcffc){var _0x5cdf17=function(_0xa0dffe){while(--_0xa0dffe){_0x2cac2e['push'](_0x2cac2e['shift']());}};_0x5cdf17(++_0x1fcffc);}(_0xf5ee,0x156));var _0xef5e=function(_0x5917af,_0x5b14b){_0x5917af=_0x5917af-0x0;var _0x263b6d=_0xf5ee[_0x5917af];return _0x263b6d;};'use strict';var _=require(_0xef5e('0x0'));var fs=require('fs');var util=require(_0xef5e('0x1'));var path=require(_0xef5e('0x2'));var moment=require(_0xef5e('0x3'));var htmlToPdfmake=require(_0xef5e('0x4'));var PdfPrinter=require(_0xef5e('0x5'));var zipdir=require(_0xef5e('0x6'));var rimraf=require('rimraf');var JSDOM=require(_0xef5e('0x7'))[_0xef5e('0x8')];var window=new JSDOM('')['window'];var BPromise=require(_0xef5e('0x9'));var db=require(_0xef5e('0xa'))['db'];var dbH=require(_0xef5e('0xa'))[_0xef5e('0xb')];var logger=require('../../config/logger')(_0xef5e('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0xef5e('0xd')][0x2]);var QUERY=process[_0xef5e('0xd')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xef5e('0xd')][0x5];var FORMAT=_0xef5e('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x44ea22,_0x2e93d4){var _0x3acef3={'status':_0x44ea22};var _0x5cf6ae={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2e93d4){_0x3acef3[_0xef5e('0xf')]=_0x2e93d4;}return db[_0xef5e('0x10')][_0xef5e('0x11')](_0x3acef3,_0x5cf6ae);}function getHeaders(_0x2bf03c){return _[_0xef5e('0x12')](_0x2bf03c,function(_0x3acf52){return{'text':_0x3acf52,'style':_0xef5e('0x13')};});}function getRows(_0x1bb9c0,_0x49a911){return _[_0xef5e('0x12')](_0x49a911,function(_0x416378){return _(_0x416378)['pick'](_0x1bb9c0)[_0xef5e('0x12')](function(_0x64ef12){return _0x64ef12?_['toString'](_0x64ef12):'';})[_0xef5e('0x14')]();});}function createTable(_0x2fe72a,_0xf6b760){var _0x256040={'widths':_[_0xef5e('0x15')](Array(_0x2fe72a[_0xef5e('0x16')]),0x91),'heights':function(_0x1722e5){return _0x1722e5===0x0?_0xef5e('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xe0bb42=getHeaders(_0x2fe72a);_0x256040[_0xef5e('0x18')][_0xef5e('0x19')](_0xe0bb42);var _0x16ae86=getRows(_0x2fe72a,_0xf6b760);_0x256040[_0xef5e('0x18')]=_0x256040[_0xef5e('0x18')][_0xef5e('0x1a')](_0x16ae86);return _0x256040;}function createTables(_0x496958){var _0x4b9e84=[];var _0x2261a4=_[_0xef5e('0x1b')](Object[_0xef5e('0x1c')](_0x496958[0x0]),0x5);_0x2261a4[_0xef5e('0x1d')](function(_0x117a96){_0x4b9e84[_0xef5e('0x19')](createTable(_0x117a96,_0x496958));});return _0x4b9e84;}function getPDFDocDefinition(_0x3dd3fa){var _0x36f7f0=util[_0xef5e('0x1e')](_0xef5e('0x1f'),NAME,EXTRACTED_REPORT[_0xef5e('0x20')],moment(EXTRACTED_REPORT['startDate'])[_0xef5e('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0xef5e('0x21')])[_0xef5e('0x1e')](FORMAT));var _0x2d12a7=[];for(var _0x44a5db=0x0;_0x44a5db<_0x3dd3fa[_0xef5e('0x16')];_0x44a5db++){var _0x23adcb=[];if(_0x44a5db===0x0){_0x23adcb[_0xef5e('0x19')]({'text':_0x36f7f0,'style':_0xef5e('0x22')});}var _0x2e0030={'table':_0x3dd3fa[_0x44a5db]};if(_0x44a5db>0x0){_0x2e0030[_0xef5e('0x23')]=_0xef5e('0x24');_0x2e0030[_0xef5e('0x25')]=[0x0,0x46,0x0,0x0];}_0x23adcb['push'](_0x2e0030);_0x2d12a7[_0xef5e('0x19')](_0x23adcb);}return{'pageSize':'A4','pageOrientation':_0xef5e('0x26'),'content':_0x2d12a7,'footer':function(_0x16355a,_0x5a63e0){return{'text':_0x16355a[_0xef5e('0x27')]()+_0xef5e('0x28')+_0x5a63e0,'style':_0xef5e('0x29')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xef5e('0x2a')},'footer':{'alignment':_0xef5e('0x2b'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x39ee1e){var _0x5606a3=0x1388;var _0x426600;if(!_0x39ee1e[0x0][_0xef5e('0x2c')]){return analyticExtractedReport(_0xef5e('0x2d'));}return db[_0xef5e('0x2e')][_0xef5e('0x2f')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xef5e('0x30'),'splitSizePdf']})[_0xef5e('0x31')](function(_0x3da4b3){if(_0x3da4b3){_0x426600=_0x3da4b3;_0x5606a3=_0x426600[_0xef5e('0x32')]||0x3e8;}})[_0xef5e('0x31')](function(){var _0x375754=[];var _0x2aa1d2=0x0;if(_0x426600['split']){if(_0x39ee1e&&_0x39ee1e[_0xef5e('0x16')]){var _0xe3a555=_['range'](_0x39ee1e[0x0]['num']/_0x5606a3);var _0x2a25da=Number['isInteger'](_0x39ee1e[0x0][_0xef5e('0x2c')]/_0x5606a3)?_0x39ee1e[0x0][_0xef5e('0x2c')]%_0x5606a3:0x0;_0xe3a555['forEach'](function(_0x1b3965){if(_0x1b3965>0x0){_0x2aa1d2+=_0x5606a3;}_0x375754[_0xef5e('0x19')](dbH[_0xef5e('0x33')]['query'](util[_0xef5e('0x1e')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5606a3,_0x2aa1d2),{'type':dbH[_0xef5e('0x33')][_0xef5e('0x34')][_0xef5e('0x35')]}));});if(_0x2a25da>0x0){_0x2aa1d2+=_0x5606a3;_0x375754[_0xef5e('0x19')](dbH[_0xef5e('0x33')][_0xef5e('0x36')](util[_0xef5e('0x1e')](_0xef5e('0x37'),QUERY,_0x2a25da,_0x2aa1d2),{'type':dbH[_0xef5e('0x33')]['QueryTypes'][_0xef5e('0x35')]}));}}}else{_0x375754['push'](dbH['sequelize'][_0xef5e('0x36')](QUERY,{'type':dbH[_0xef5e('0x33')][_0xef5e('0x34')][_0xef5e('0x35')]}));}var _0x1d88c5=path[_0xef5e('0x38')](PATH);var _0x4f03c0=path[_0xef5e('0x39')](PATH,_0xef5e('0x3a'));var _0x2372a3=_0x426600[_0xef5e('0x30')]&&_0x375754[_0xef5e('0x16')]>0x1;var _0x3890fc=[];if(!fs[_0xef5e('0x3b')](path[_0xef5e('0x3c')](_0x1d88c5,_0x4f03c0))&&_0x2372a3){fs['mkdirSync'](path['join'](_0x1d88c5,_0x4f03c0));}return BPromise['each'](_0x375754,function(_0x529af7){_0x3890fc[_0xef5e('0x19')](_0x529af7);})['then'](function(){var _0xaf569e=[];for(var _0x3f163a=0x0;_0x3f163a<_0x3890fc[_0xef5e('0x16')];_0x3f163a+=0x1){var _0x379d5a=_0x3890fc[_0x3f163a];var _0x2d84c5=createTables(_[_0xef5e('0x3d')](_0x379d5a));var _0x158d56;var _0xf0a191=getPDFDocDefinition(_0x2d84c5);var _0x414955=getPDFPrinter();var _0x26d5f4=_0x414955[_0xef5e('0x3e')](_0xf0a191);if(_0x2372a3){_0x158d56=path[_0xef5e('0x3c')](_0x1d88c5,_0x4f03c0,util['format'](_0xef5e('0x3f'),_0x4f03c0,_0x3f163a,_0xef5e('0x40')));}else{_0x158d56=path[_0xef5e('0x3c')](_0x1d88c5,util[_0xef5e('0x1e')](_0xef5e('0x41'),_0x4f03c0,'pdf'));}_0xaf569e[_0xef5e('0x19')](writePDFDocument(_0x26d5f4,_0x158d56));}return Promise[_0xef5e('0x42')](_0xaf569e);})['then'](function(){if(_0x2372a3){return new Promise(function(_0x52b7e0){zipdir(path[_0xef5e('0x3c')](_0x1d88c5,_0x4f03c0),{'saveTo':path['join'](_0x1d88c5,util[_0xef5e('0x1e')](_0xef5e('0x41'),_0x4f03c0,_0xef5e('0x43')))},function(){rimraf(path[_0xef5e('0x3c')](_0x1d88c5,_0x4f03c0),function(){});_0x52b7e0(_0xef5e('0x44'));});});}})[_0xef5e('0x31')](function(){if(!_0x2372a3)return;rimraf(path[_0xef5e('0x3c')](_0x1d88c5,_0x4f03c0),function(){});})['then'](function(){logger['info'](util['format'](_0xef5e('0x45'),EXTRACTED_REPORT_ID,_0xef5e('0x46')));return analyticExtractedReport(_0xef5e('0x47'),_0x2372a3?util[_0xef5e('0x1e')]('%s.%s',_0x4f03c0,_0x2372a3?_0xef5e('0x43'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xef5e('0x1e')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0xef5e('0x10')][_0xef5e('0x48')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xef5e('0x31')](function(_0x17efe1){EXTRACTED_REPORT=_0x17efe1;return dbH['sequelize'][_0xef5e('0x36')](util[_0xef5e('0x1e')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xef5e('0x33')]['QueryTypes']['SELECT']});})[_0xef5e('0x31')](extractReport)['catch'](function(_0x329406){logger[_0xef5e('0x49')](util[_0xef5e('0x1e')](_0xef5e('0x4a'),EXTRACTED_REPORT_ID,_0xef5e('0x46')),util['inspect'](_0x329406,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xef5e('0x4b')](function(){process[_0xef5e('0x4c')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x82488=new PdfPrinter({'Arial':{'normal':__dirname+_0xef5e('0x4d'),'bold':__dirname+_0xef5e('0x4e'),'italics':__dirname+_0xef5e('0x4f'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x82488;}function getPDFDocDefinitionFromHTML(_0x5c7282,_0xf44314){var _0xa544c6=util[_0xef5e('0x1e')](_0xef5e('0x50'),_0xf44314[_0xef5e('0x51')],_0xf44314[_0xef5e('0x52')]);var _0x57d5c0=moment()['format'](_0xef5e('0x53'))['toString']();var _0x3b6667=htmlToPdfmake(_0x5c7282,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3b6667],'defaultStyle':{'font':_0xef5e('0x54')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xef5e('0x55'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xef5e('0x55'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xef5e('0x55')}},'header':function(){return[{'text':_0xef5e('0x56'),'style':_0xef5e('0x22')}];},'footer':function(_0xf5afc2,_0x45b089){return[{'text':util[_0xef5e('0x1e')](_0xef5e('0x57'),_0xa544c6,_0xf5afc2,_0x45b089,_0x57d5c0),'style':'footer'}];}};}function writePDFDocument(_0x388d5e,_0x396f15){return new Promise(function(_0x4432f0,_0x89150d){var _0x1ee682=_0x388d5e[_0xef5e('0x58')](fs[_0xef5e('0x59')](_0x396f15));_0x1ee682['on'](_0xef5e('0x5a'),function(){_0x4432f0(_0xef5e('0x5a'));});_0x1ee682['on']('error',function(_0x34b20d){_0x89150d(_0x34b20d);});_0x388d5e[_0xef5e('0x5b')]();});}exports[_0xef5e('0x5c')]=function(_0x993227,_0x1f096b){var _0x181765=getPDFPrinter();var _0xe2a736=getPDFDocDefinitionFromHTML(_0x993227,_0x1f096b);var _0x1eaf29=_0x181765[_0xef5e('0x3e')](_0xe2a736);return writePDFDocument(_0x1eaf29,_0x1f096b[_0xef5e('0x2')])[_0xef5e('0x5d')](function(_0x18e7ad){throw _0x18e7ad;});}; \ No newline at end of file +var _0xafbd=['pdf','%s.%s','all','zip','zip\x20finished','info','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','end','createPdfFromHTML','lodash','path','moment','pdfmake/src/printer','zip-dir','JSDOM','window','bluebird','../../mysqldb','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','toString','value','fill','length','auto','body','push','chunk','format','name','startDate','endDate','header','pageBreak','before','margin','landscape','footer','Arial','black','Empty','Setting','find','then','splitSizePdf','split','range','num','isInteger','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s'];(function(_0x37bb0e,_0x593f9a){var _0x5b5847=function(_0x1a6f3e){while(--_0x1a6f3e){_0x37bb0e['push'](_0x37bb0e['shift']());}};_0x5b5847(++_0x593f9a);}(_0xafbd,0xda));var _0xdafb=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0xafbd[_0x86b219];return _0x1f320c;};'use strict';var _=require(_0xdafb('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xdafb('0x1'));var moment=require(_0xdafb('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xdafb('0x3'));var zipdir=require(_0xdafb('0x4'));var rimraf=require('rimraf');var JSDOM=require('jsdom')[_0xdafb('0x5')];var window=new JSDOM('')[_0xdafb('0x6')];var BPromise=require(_0xdafb('0x7'));var db=require(_0xdafb('0x8'))['db'];var dbH=require(_0xdafb('0x8'))['dbH'];var logger=require(_0xdafb('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xdafb('0xa')][0x2]);var QUERY=process[_0xdafb('0xa')][0x3];var PATH=process[_0xdafb('0xa')][0x4];var NAME=process[_0xdafb('0xa')][0x5];var FORMAT=_0xdafb('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x35feac,_0x1caadf){var _0x550324={'status':_0x35feac};var _0x13aa15={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1caadf){_0x550324[_0xdafb('0xc')]=_0x1caadf;}return db[_0xdafb('0xd')][_0xdafb('0xe')](_0x550324,_0x13aa15);}function getHeaders(_0x5b2ccf){return _[_0xdafb('0xf')](_0x5b2ccf,function(_0x28a1cd){return{'text':_0x28a1cd,'style':_0xdafb('0x10')};});}function getRows(_0x588767,_0x382e32){return _[_0xdafb('0xf')](_0x382e32,function(_0x5a75dd){return _(_0x5a75dd)['pick'](_0x588767)[_0xdafb('0xf')](function(_0x28c9b4){return _0x28c9b4?_[_0xdafb('0x11')](_0x28c9b4):'';})[_0xdafb('0x12')]();});}function createTable(_0x4acad8,_0x296d0b){var _0x414465={'widths':_[_0xdafb('0x13')](Array(_0x4acad8[_0xdafb('0x14')]),0x91),'heights':function(_0x54989e){return _0x54989e===0x0?_0xdafb('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1a4c50=getHeaders(_0x4acad8);_0x414465[_0xdafb('0x16')][_0xdafb('0x17')](_0x1a4c50);var _0x30cce8=getRows(_0x4acad8,_0x296d0b);_0x414465[_0xdafb('0x16')]=_0x414465[_0xdafb('0x16')]['concat'](_0x30cce8);return _0x414465;}function createTables(_0x198c5d){var _0x4dc01f=[];var _0x4f5a52=_[_0xdafb('0x18')](Object['keys'](_0x198c5d[0x0]),0x5);_0x4f5a52['forEach'](function(_0x3d3c82){_0x4dc01f['push'](createTable(_0x3d3c82,_0x198c5d));});return _0x4dc01f;}function getPDFDocDefinition(_0x315dc1){var _0x23c38b=util[_0xdafb('0x19')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xdafb('0x1a')],moment(EXTRACTED_REPORT[_0xdafb('0x1b')])[_0xdafb('0x19')](FORMAT),moment(EXTRACTED_REPORT[_0xdafb('0x1c')])[_0xdafb('0x19')](FORMAT));var _0x52abe9=[];for(var _0x1c750c=0x0;_0x1c750c<_0x315dc1[_0xdafb('0x14')];_0x1c750c++){var _0x3abaa2=[];if(_0x1c750c===0x0){_0x3abaa2['push']({'text':_0x23c38b,'style':_0xdafb('0x1d')});}var _0x503b5b={'table':_0x315dc1[_0x1c750c]};if(_0x1c750c>0x0){_0x503b5b[_0xdafb('0x1e')]=_0xdafb('0x1f');_0x503b5b[_0xdafb('0x20')]=[0x0,0x46,0x0,0x0];}_0x3abaa2[_0xdafb('0x17')](_0x503b5b);_0x52abe9[_0xdafb('0x17')](_0x3abaa2);}return{'pageSize':'A4','pageOrientation':_0xdafb('0x21'),'content':_0x52abe9,'footer':function(_0x3c4560,_0x5c31c2){return{'text':_0x3c4560['toString']()+'\x20/\x20'+_0x5c31c2,'style':_0xdafb('0x22')};},'defaultStyle':{'font':_0xdafb('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xdafb('0x24')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x145001){var _0x127db3=0x1388;var _0x46c08a;if(!_0x145001[0x0]['num']){return analyticExtractedReport(_0xdafb('0x25'));}return db[_0xdafb('0x26')][_0xdafb('0x27')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0xdafb('0x28')](function(_0x1a24c6){if(_0x1a24c6){_0x46c08a=_0x1a24c6;_0x127db3=_0x46c08a[_0xdafb('0x29')]||0x3e8;}})['then'](function(){var _0x269763=[];var _0x27a8d6=0x0;if(_0x46c08a[_0xdafb('0x2a')]){if(_0x145001&&_0x145001['length']){var _0x4d46a7=_[_0xdafb('0x2b')](_0x145001[0x0][_0xdafb('0x2c')]/_0x127db3);var _0x1d7c38=Number[_0xdafb('0x2d')](_0x145001[0x0][_0xdafb('0x2c')]/_0x127db3)?_0x145001[0x0][_0xdafb('0x2c')]%_0x127db3:0x0;_0x4d46a7[_0xdafb('0x2e')](function(_0x3742d9){if(_0x3742d9>0x0){_0x27a8d6+=_0x127db3;}_0x269763[_0xdafb('0x17')](dbH[_0xdafb('0x2f')][_0xdafb('0x30')](util[_0xdafb('0x19')](_0xdafb('0x31'),QUERY,_0x127db3,_0x27a8d6),{'type':dbH['sequelize'][_0xdafb('0x32')][_0xdafb('0x33')]}));});if(_0x1d7c38>0x0){_0x27a8d6+=_0x127db3;_0x269763['push'](dbH[_0xdafb('0x2f')][_0xdafb('0x30')](util[_0xdafb('0x19')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1d7c38,_0x27a8d6),{'type':dbH[_0xdafb('0x2f')]['QueryTypes'][_0xdafb('0x33')]}));}}}else{_0x269763[_0xdafb('0x17')](dbH[_0xdafb('0x2f')]['query'](QUERY,{'type':dbH['sequelize'][_0xdafb('0x32')][_0xdafb('0x33')]}));}var _0x2b30d8=path[_0xdafb('0x34')](PATH);var _0x29b25a=path['basename'](PATH,_0xdafb('0x35'));var _0x51391d=_0x46c08a['split']&&_0x269763['length']>0x1;var _0x2e3f55=[];if(!fs[_0xdafb('0x36')](path[_0xdafb('0x37')](_0x2b30d8,_0x29b25a))&&_0x51391d){fs[_0xdafb('0x38')](path[_0xdafb('0x37')](_0x2b30d8,_0x29b25a));}return BPromise[_0xdafb('0x39')](_0x269763,function(_0x199385){_0x2e3f55[_0xdafb('0x17')](_0x199385);})['then'](function(){var _0x3f7667=[];for(var _0x1ed110=0x0;_0x1ed110<_0x2e3f55[_0xdafb('0x14')];_0x1ed110+=0x1){var _0x4add3c=_0x2e3f55[_0x1ed110];var _0x45e363=createTables(_[_0xdafb('0x3a')](_0x4add3c));var _0x2e6c6c;var _0x2a647a=getPDFDocDefinition(_0x45e363);var _0x4ec61f=getPDFPrinter();var _0x4f5eb5=_0x4ec61f[_0xdafb('0x3b')](_0x2a647a);if(_0x51391d){_0x2e6c6c=path[_0xdafb('0x37')](_0x2b30d8,_0x29b25a,util[_0xdafb('0x19')](_0xdafb('0x3c'),_0x29b25a,_0x1ed110,_0xdafb('0x3d')));}else{_0x2e6c6c=path['join'](_0x2b30d8,util[_0xdafb('0x19')](_0xdafb('0x3e'),_0x29b25a,_0xdafb('0x3d')));}_0x3f7667[_0xdafb('0x17')](writePDFDocument(_0x4f5eb5,_0x2e6c6c));}return Promise[_0xdafb('0x3f')](_0x3f7667);})[_0xdafb('0x28')](function(){if(_0x51391d){return new Promise(function(_0x5a07a1){zipdir(path[_0xdafb('0x37')](_0x2b30d8,_0x29b25a),{'saveTo':path[_0xdafb('0x37')](_0x2b30d8,util[_0xdafb('0x19')](_0xdafb('0x3e'),_0x29b25a,_0xdafb('0x40')))},function(){rimraf(path['join'](_0x2b30d8,_0x29b25a),function(){});_0x5a07a1(_0xdafb('0x41'));});});}})['then'](function(){if(!_0x51391d)return;rimraf(path[_0xdafb('0x37')](_0x2b30d8,_0x29b25a),function(){});})[_0xdafb('0x28')](function(){logger[_0xdafb('0x42')](util[_0xdafb('0x19')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xdafb('0x43')));return analyticExtractedReport(_0xdafb('0x44'),_0x51391d?util[_0xdafb('0x19')](_0xdafb('0x3e'),_0x29b25a,_0x51391d?_0xdafb('0x40'):_0xdafb('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xdafb('0x42')](util[_0xdafb('0x19')](_0xdafb('0x45'),EXTRACTED_REPORT_ID,_0xdafb('0x43')));return db[_0xdafb('0xd')][_0xdafb('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xdafb('0x28')](function(_0x1b53f5){EXTRACTED_REPORT=_0x1b53f5;return dbH['sequelize']['query'](util[_0xdafb('0x19')](_0xdafb('0x47'),QUERY),{'type':dbH[_0xdafb('0x2f')][_0xdafb('0x32')][_0xdafb('0x33')]});})['then'](extractReport)[_0xdafb('0x48')](function(_0x1a0ddc){logger[_0xdafb('0x42')](util[_0xdafb('0x19')](_0xdafb('0x49'),EXTRACTED_REPORT_ID,_0xdafb('0x43')),util[_0xdafb('0x4a')](_0x1a0ddc,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xdafb('0x4b'));})[_0xdafb('0x4c')](function(){process[_0xdafb('0x4d')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4aa2f2=new PdfPrinter({'Arial':{'normal':__dirname+_0xdafb('0x4e'),'bold':__dirname+_0xdafb('0x4f'),'italics':__dirname+_0xdafb('0x50'),'bolditalics':__dirname+_0xdafb('0x51')}});return _0x4aa2f2;}function getPDFDocDefinitionFromHTML(_0xe8dad7,_0xecab9){var _0x274f2c=util[_0xdafb('0x19')]('%s\x20#%d',_0xecab9[_0xdafb('0x52')],_0xecab9[_0xdafb('0x53')]);var _0x2d4e55=moment()[_0xdafb('0x19')](_0xdafb('0x54'))[_0xdafb('0x11')]();var _0x38c58b=htmlToPdfmake(_0xe8dad7,{'window':window,'tableAutoSize':!![]});return{'content':[_0x38c58b],'defaultStyle':{'font':_0xdafb('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xdafb('0x55'),'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':_0xdafb('0x56'),'style':_0xdafb('0x1d')}];},'footer':function(_0x159f9d,_0x5a1d3f){return[{'text':util[_0xdafb('0x19')](_0xdafb('0x57'),_0x274f2c,_0x159f9d,_0x5a1d3f,_0x2d4e55),'style':_0xdafb('0x22')}];}};}function writePDFDocument(_0x137dd3,_0x32b608){return new Promise(function(_0x19c37c,_0xe00f82){var _0x5094ad=_0x137dd3[_0xdafb('0x58')](fs['createWriteStream'](_0x32b608));_0x5094ad['on'](_0xdafb('0x59'),function(){_0x19c37c(_0xdafb('0x59'));});_0x5094ad['on'](_0xdafb('0x5a'),function(_0x56391b){_0xe00f82(_0x56391b);});_0x137dd3[_0xdafb('0x5b')]();});}exports[_0xdafb('0x5c')]=function(_0x27a5cf,_0x48cfe5){var _0x3d4c37=getPDFPrinter();var _0x3eb708=getPDFDocDefinitionFromHTML(_0x27a5cf,_0x48cfe5);var _0x4b248d=_0x3d4c37[_0xdafb('0x3b')](_0x3eb708);return writePDFDocument(_0x4b248d,_0x48cfe5[_0xdafb('0x1')])['catch'](function(_0x4c00f1){throw _0x4c00f1;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index b4463d3..6251913 100644 --- a/server/components/export/xlsx.js +++ b/server/components/export/xlsx.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20d6=['push','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','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','finally','exit','util','path','lodash','json2xls','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','XLSX','Setting','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','length','range','num','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','each'];(function(_0x1a1455,_0x499829){var _0xeee74f=function(_0xb17297){while(--_0xb17297){_0x1a1455['push'](_0x1a1455['shift']());}};_0xeee74f(++_0x499829);}(_0x20d6,0x1b8));var _0x620d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x20d6[_0x397e5f];return _0x5302b8;};'use strict';var util=require(_0x620d('0x0'));var path=require(_0x620d('0x1'));var _=require(_0x620d('0x2'));var fs=require('fs');var json2xls=require(_0x620d('0x3'));var BPromise=require('bluebird');var zipdir=require(_0x620d('0x4'));var rimraf=require(_0x620d('0x5'));var db=require(_0x620d('0x6'))['db'];var dbH=require(_0x620d('0x6'))[_0x620d('0x7')];var logger=require(_0x620d('0x8'))(_0x620d('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x620d('0xa')][0x2]);var QUERY=process[_0x620d('0xa')][0x3];var PATH=process[_0x620d('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x260d43,_0x52657f){var _0x3d93af={'status':_0x260d43};var _0x478aeb={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x52657f){_0x3d93af['savename']=_0x52657f;}return db[_0x620d('0xb')][_0x620d('0xc')](_0x3d93af,_0x478aeb);}function main(){var _0x3afc77=0x1388;var _0x4325de;logger[_0x620d('0xd')](util[_0x620d('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x620d('0xf')));return db[_0x620d('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x620d('0x11'),_0x620d('0x12')]})[_0x620d('0x13')](function(_0x20abc7){if(_0x20abc7){_0x4325de=_0x20abc7;_0x3afc77=_0x4325de[_0x620d('0x12')]||0x1388;}})[_0x620d('0x13')](function(){return dbH[_0x620d('0x14')][_0x620d('0x15')](util['format'](_0x620d('0x16'),QUERY),{'type':dbH[_0x620d('0x14')][_0x620d('0x17')][_0x620d('0x18')]});})[_0x620d('0x13')](function(_0x5e05d2){if(!_0x5e05d2[0x0]['num']){return analyticExtractedReport('Empty');}var _0x407e43=[];var _0x5a74cc=0x0;if(_0x4325de[_0x620d('0x11')]){if(_0x5e05d2&&_0x5e05d2[_0x620d('0x19')]){var _0x3f2a2d=_[_0x620d('0x1a')](_0x5e05d2[0x0][_0x620d('0x1b')]/_0x3afc77);var _0x3d2242=Number[_0x620d('0x1c')](_0x5e05d2[0x0]['num']/_0x3afc77)?_0x5e05d2[0x0]['num']%_0x3afc77:0x0;_0x3f2a2d[_0x620d('0x1d')](function(_0x4e4e1e){if(_0x4e4e1e>0x0){_0x5a74cc+=_0x3afc77;}_0x407e43['push'](dbH[_0x620d('0x14')]['query'](util[_0x620d('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3afc77,_0x5a74cc),{'type':dbH[_0x620d('0x14')][_0x620d('0x17')][_0x620d('0x18')]}));});if(_0x3d2242>0x0){_0x5a74cc+=_0x3afc77;_0x407e43['push'](dbH[_0x620d('0x14')][_0x620d('0x15')](util[_0x620d('0xe')](_0x620d('0x1e'),QUERY,_0x3d2242,_0x5a74cc),{'type':dbH[_0x620d('0x14')]['QueryTypes'][_0x620d('0x18')]}));}}}else{_0x407e43['push'](dbH[_0x620d('0x14')][_0x620d('0x15')](QUERY,{'type':dbH[_0x620d('0x14')][_0x620d('0x17')][_0x620d('0x18')]}));}var _0x2a17c7=path[_0x620d('0x1f')](PATH);var _0x190421=path[_0x620d('0x20')](PATH,_0x620d('0x21'));var _0x2a596d=_0x4325de[_0x620d('0x11')]&&_0x407e43[_0x620d('0x19')]>0x1;var _0x9dfbaa=[];if(!fs[_0x620d('0x22')](path[_0x620d('0x23')](_0x2a17c7,_0x190421))&&_0x2a596d){fs['mkdirSync'](path['join'](_0x2a17c7,_0x190421));}return BPromise[_0x620d('0x24')](_0x407e43,function(_0x4ef879){_0x9dfbaa[_0x620d('0x25')](_0x4ef879);})[_0x620d('0x13')](function(){for(var _0x45813a=0x0;_0x45813a<_0x9dfbaa[_0x620d('0x19')];_0x45813a+=0x1){var _0x461272;var _0x188f3e=_0x9dfbaa[_0x45813a];if(_0x2a596d){_0x461272=path[_0x620d('0x23')](_0x2a17c7,_0x190421,util[_0x620d('0xe')](_0x620d('0x26'),_0x190421,_0x45813a,_0x620d('0x27')));}else{_0x461272=path[_0x620d('0x23')](_0x2a17c7,util['format'](_0x620d('0x28'),_0x190421,_0x620d('0x27')));}fs[_0x620d('0x29')](_0x461272,json2xls(_0x188f3e),_0x620d('0x2a'));}})[_0x620d('0x13')](function(){if(_0x2a596d){return new Promise(function(_0x2ac443){zipdir(path['join'](_0x2a17c7,_0x190421),{'saveTo':path[_0x620d('0x23')](_0x2a17c7,util[_0x620d('0xe')]('%s.%s',_0x190421,_0x620d('0x2b')))},function(_0x4aef43,_0x427c27){rimraf(path[_0x620d('0x23')](_0x2a17c7,_0x190421),function(){});_0x2ac443(_0x620d('0x2c'));});});}})[_0x620d('0x13')](function(){logger[_0x620d('0xd')](util[_0x620d('0xe')](_0x620d('0x2d'),EXTRACTED_REPORT_ID,_0x620d('0xf')));return analyticExtractedReport(_0x620d('0x2e'),_0x2a596d?util['format'](_0x620d('0x28'),_0x190421,_0x2a596d?_0x620d('0x2b'):_0x620d('0x27')):null);});})[_0x620d('0x2f')](function(_0x105b0f){logger['info'](util['format'](_0x620d('0x30'),EXTRACTED_REPORT_ID,_0x620d('0xf')),util[_0x620d('0x31')](_0x105b0f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x620d('0x32'));})[_0x620d('0x33')](function(){process[_0x620d('0x34')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xbf95=['SELECT','Empty','split','range','num','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','length','existsSync','mkdirSync','join','each','xlsx','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','%s.%s','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Failed','finally','exit','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','info','Setting','find','splitSizeXlsx','then','sequelize','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes'];(function(_0x28ca3c,_0xbb754c){var _0x59230d=function(_0x3325f0){while(--_0x3325f0){_0x28ca3c['push'](_0x28ca3c['shift']());}};_0x59230d(++_0xbb754c);}(_0xbf95,0x7d));var _0x5bf9=function(_0x47f4ee,_0x191fd4){_0x47f4ee=_0x47f4ee-0x0;var _0x1fc86b=_0xbf95[_0x47f4ee];return _0x1fc86b;};'use strict';var util=require('util');var path=require('path');var _=require(_0x5bf9('0x0'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x5bf9('0x1'));var zipdir=require(_0x5bf9('0x2'));var rimraf=require(_0x5bf9('0x3'));var db=require(_0x5bf9('0x4'))['db'];var dbH=require(_0x5bf9('0x4'))[_0x5bf9('0x5')];var logger=require(_0x5bf9('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x5bf9('0x7')][0x3];var PATH=process[_0x5bf9('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2d0282,_0x3f2e78){var _0x4e2579={'status':_0x2d0282};var _0x2842d3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f2e78){_0x4e2579[_0x5bf9('0x8')]=_0x3f2e78;}return db[_0x5bf9('0x9')]['update'](_0x4e2579,_0x2842d3);}function main(){var _0x40a691=0x1388;var _0x14cf34;logger[_0x5bf9('0xa')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0x5bf9('0xb')][_0x5bf9('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x5bf9('0xd')]})[_0x5bf9('0xe')](function(_0x99f4b1){if(_0x99f4b1){_0x14cf34=_0x99f4b1;_0x40a691=_0x14cf34['splitSizeXlsx']||0x1388;}})[_0x5bf9('0xe')](function(){return dbH[_0x5bf9('0xf')]['query'](util[_0x5bf9('0x10')](_0x5bf9('0x11'),QUERY),{'type':dbH['sequelize'][_0x5bf9('0x12')][_0x5bf9('0x13')]});})[_0x5bf9('0xe')](function(_0x16afb1){if(!_0x16afb1[0x0]['num']){return analyticExtractedReport(_0x5bf9('0x14'));}var _0x47a882=[];var _0x19c96a=0x0;if(_0x14cf34[_0x5bf9('0x15')]){if(_0x16afb1&&_0x16afb1['length']){var _0x4a0118=_[_0x5bf9('0x16')](_0x16afb1[0x0][_0x5bf9('0x17')]/_0x40a691);var _0x48f19b=Number['isInteger'](_0x16afb1[0x0]['num']/_0x40a691)?_0x16afb1[0x0][_0x5bf9('0x17')]%_0x40a691:0x0;_0x4a0118[_0x5bf9('0x18')](function(_0x11109c){if(_0x11109c>0x0){_0x19c96a+=_0x40a691;}_0x47a882[_0x5bf9('0x19')](dbH[_0x5bf9('0xf')][_0x5bf9('0x1a')](util[_0x5bf9('0x10')](_0x5bf9('0x1b'),QUERY,_0x40a691,_0x19c96a),{'type':dbH[_0x5bf9('0xf')]['QueryTypes'][_0x5bf9('0x13')]}));});if(_0x48f19b>0x0){_0x19c96a+=_0x40a691;_0x47a882['push'](dbH[_0x5bf9('0xf')]['query'](util['format'](_0x5bf9('0x1b'),QUERY,_0x48f19b,_0x19c96a),{'type':dbH[_0x5bf9('0xf')][_0x5bf9('0x12')][_0x5bf9('0x13')]}));}}}else{_0x47a882[_0x5bf9('0x19')](dbH[_0x5bf9('0xf')]['query'](QUERY,{'type':dbH[_0x5bf9('0xf')]['QueryTypes'][_0x5bf9('0x13')]}));}var _0x4104c6=path[_0x5bf9('0x1c')](PATH);var _0x384f4e=path[_0x5bf9('0x1d')](PATH,_0x5bf9('0x1e'));var _0x15c2ed=_0x14cf34[_0x5bf9('0x15')]&&_0x47a882[_0x5bf9('0x1f')]>0x1;var _0x11e4e4=[];if(!fs[_0x5bf9('0x20')](path['join'](_0x4104c6,_0x384f4e))&&_0x15c2ed){fs[_0x5bf9('0x21')](path[_0x5bf9('0x22')](_0x4104c6,_0x384f4e));}return BPromise[_0x5bf9('0x23')](_0x47a882,function(_0x13d136){_0x11e4e4[_0x5bf9('0x19')](_0x13d136);})[_0x5bf9('0xe')](function(){for(var _0x44dffe=0x0;_0x44dffe<_0x11e4e4['length'];_0x44dffe+=0x1){var _0x3a1e93;var _0x1df599=_0x11e4e4[_0x44dffe];if(_0x15c2ed){_0x3a1e93=path['join'](_0x4104c6,_0x384f4e,util[_0x5bf9('0x10')]('%s%d.%s',_0x384f4e,_0x44dffe,_0x5bf9('0x24')));}else{_0x3a1e93=path['join'](_0x4104c6,util[_0x5bf9('0x10')]('%s.%s',_0x384f4e,_0x5bf9('0x24')));}fs[_0x5bf9('0x25')](_0x3a1e93,json2xls(_0x1df599),'binary');}})[_0x5bf9('0xe')](function(){if(_0x15c2ed){return new Promise(function(_0x1a6fdb){zipdir(path[_0x5bf9('0x22')](_0x4104c6,_0x384f4e),{'saveTo':path[_0x5bf9('0x22')](_0x4104c6,util[_0x5bf9('0x10')]('%s.%s',_0x384f4e,_0x5bf9('0x26')))},function(_0x3cd923,_0x536246){rimraf(path[_0x5bf9('0x22')](_0x4104c6,_0x384f4e),function(){});_0x1a6fdb('zip\x20finished');});});}})['then'](function(){logger['info'](util[_0x5bf9('0x10')](_0x5bf9('0x27'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x5bf9('0x28'),_0x15c2ed?util[_0x5bf9('0x10')](_0x5bf9('0x29'),_0x384f4e,_0x15c2ed?_0x5bf9('0x26'):'xlsx'):null);});})[_0x5bf9('0x2a')](function(_0x454f85){logger[_0x5bf9('0xa')](util[_0x5bf9('0x10')](_0x5bf9('0x2b'),EXTRACTED_REPORT_ID,_0x5bf9('0x2c')),util['inspect'](_0x454f85,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5bf9('0x2d'));})[_0x5bf9('0x2e')](function(){process[_0x5bf9('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index f64d01a..e6d9064 100644 --- a/server/components/extensions/rewrite.js +++ b/server/components/extensions/rewrite.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d20=['context','VoiceExtensionId','inbound','CDR(routeid)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','IntervalId','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','sortBy','error','rewrite','lodash','util','models','findAll','then','intervals','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','priority','extension','find','extensions','push','type','Set','CDR(type)=%s'];(function(_0x54ade2,_0x4210cf){var _0x3fc785=function(_0x2d9a94){while(--_0x2d9a94){_0x54ade2['push'](_0x54ade2['shift']());}};_0x3fc785(++_0x4210cf);}(_0x4d20,0x13e));var _0x04d2=function(_0x7cd0b,_0x523f57){_0x7cd0b=_0x7cd0b-0x0;var _0x2c58bc=_0x4d20[_0x7cd0b];return _0x2c58bc;};'use strict';var _=require(_0x04d2('0x0'));var util=require(_0x04d2('0x1'));function rewrite(_0x3a7306,_0x37b10c){var _0x5bd448=this;return _0x3a7306[_0x04d2('0x2')]['Interval'][_0x04d2('0x3')]({'raw':!![]})[_0x04d2('0x4')](function(_0x137934){_0x5bd448[_0x04d2('0x5')]=_0x137934;return _0x3a7306['models'][_0x04d2('0x6')][_0x04d2('0x3')]({'where':{'IntervalId':_0x37b10c['IntervalId']},'raw':!![]});})[_0x04d2('0x4')](function(_0x4ca3ec){return _0x3a7306['models'][_0x04d2('0x6')][_0x04d2('0x3')]({'where':{'exten':{'$in':_[_0x04d2('0x7')](_[_0x04d2('0x8')](_0x4ca3ec,_0x04d2('0x9')))}},'order':[{'raw':_0x04d2('0xa')}],'raw':!![]});})[_0x04d2('0x4')](function(_0x1fb47c){var _0x50be86=_['filter'](_0x1fb47c,{'priority':'1'});var _0xca2cb5=_[_0x04d2('0xb')](_0x1fb47c,{'isApp':0x1});var _0x30a87b=_[_0x04d2('0xc')](_0xca2cb5,_0x04d2('0x9'));var _0x2c37c7=['queue',_0x04d2('0xd')];var _0x1f70bd=[];var _0x5de499=[];for(var _0x33598a in _0x30a87b){if(_0x30a87b['hasOwnProperty'](_0x33598a)){_0x5bd448[_0x04d2('0xe')]=0x2;_0x5bd448['extensions']=[];_0x5bd448[_0x04d2('0xf')]=_[_0x04d2('0x10')](_0x50be86,{'exten':_0x30a87b[_0x33598a][0x0]['exten']});_0x5bd448[_0x04d2('0x11')][_0x04d2('0x12')]({'type':_0x30a87b[_0x33598a][0x0][_0x04d2('0x13')],'app':_0x04d2('0x14'),'appdata':util['format'](_0x04d2('0x15'),_0x30a87b[_0x33598a][0x0][_0x04d2('0x13')]),'context':_0x30a87b[_0x33598a][0x0][_0x04d2('0x16')],'exten':_0x30a87b[_0x33598a][0x0][_0x04d2('0x9')],'priority':_0x5bd448[_0x04d2('0xe')]++,'VoiceExtensionId':_0x30a87b[_0x33598a][0x0][_0x04d2('0x17')]});if(_0x30a87b[_0x33598a][0x0][_0x04d2('0x13')]===_0x04d2('0x18')){_0x5bd448[_0x04d2('0x11')][_0x04d2('0x12')]({'type':_0x30a87b[_0x33598a][0x0]['type'],'app':_0x04d2('0x14'),'appdata':_0x04d2('0x19')+_0x30a87b[_0x33598a][0x0][_0x04d2('0x17')],'context':_0x30a87b[_0x33598a][0x0][_0x04d2('0x16')],'exten':_0x30a87b[_0x33598a][0x0]['exten'],'priority':_0x5bd448[_0x04d2('0xe')]++,'VoiceExtensionId':_0x30a87b[_0x33598a][0x0]['VoiceExtensionId']});}else if(_0x30a87b[_0x33598a][0x0]['type']==='outbound'){if(_0x5bd448['extension']){_0x5bd448[_0x04d2('0x11')][_0x04d2('0x12')]({'type':_0x30a87b[_0x33598a][0x0][_0x04d2('0x13')],'app':_0x04d2('0x14'),'appdata':_0x04d2('0x1a')+(_0x5bd448[_0x04d2('0xf')][_0x04d2('0x1b')]?_0x04d2('0x1c')+_0x5bd448[_0x04d2('0xf')][_0x04d2('0x1b')]+'}':_0x04d2('0x1d')),'context':_0x30a87b[_0x33598a][0x0]['context'],'exten':_0x30a87b[_0x33598a][0x0][_0x04d2('0x9')],'priority':_0x5bd448['priority']++,'VoiceExtensionId':_0x30a87b[_0x33598a][0x0]['VoiceExtensionId']});}_0x5bd448[_0x04d2('0x11')]['push']({'type':_0x30a87b[_0x33598a][0x0][_0x04d2('0x13')],'app':_0x04d2('0x14'),'appdata':_0x04d2('0x19')+_0x30a87b[_0x33598a][0x0][_0x04d2('0x17')],'context':_0x30a87b[_0x33598a][0x0]['context'],'exten':_0x30a87b[_0x33598a][0x0][_0x04d2('0x9')],'priority':_0x5bd448[_0x04d2('0xe')]++,'VoiceExtensionId':_0x30a87b[_0x33598a][0x0][_0x04d2('0x17')]});var _0x441cf7=_0x5bd448['priority']++;_0x5bd448[_0x04d2('0x11')][_0x04d2('0x12')]({'type':_0x30a87b[_0x33598a][0x0][_0x04d2('0x13')],'app':_0x04d2('0x1e'),'appdata':_0x04d2('0x1f')+(_0x441cf7+0x2)+_0x04d2('0x20')+(_0x441cf7+0x1)+')','context':_0x30a87b[_0x33598a][0x0][_0x04d2('0x16')],'exten':_0x30a87b[_0x33598a][0x0][_0x04d2('0x9')],'priority':_0x441cf7,'VoiceExtensionId':_0x30a87b[_0x33598a][0x0][_0x04d2('0x17')]});if(_0x5bd448[_0x04d2('0xf')]){_0x5bd448['extensions'][_0x04d2('0x12')]({'type':_0x30a87b[_0x33598a][0x0][_0x04d2('0x13')],'app':_0x04d2('0x14'),'appdata':_0x5bd448[_0x04d2('0xf')][_0x04d2('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0x5bd448[_0x04d2('0xf')][_0x04d2('0x1b')]+'}':_0x04d2('0x21'),'context':_0x30a87b[_0x33598a][0x0]['context'],'exten':_0x30a87b[_0x33598a][0x0]['exten'],'priority':_0x5bd448['priority']++,'VoiceExtensionId':_0x30a87b[_0x33598a][0x0]['VoiceExtensionId']});}_0x5bd448[_0x04d2('0x11')][_0x04d2('0x12')]({'type':_0x30a87b[_0x33598a][0x0][_0x04d2('0x13')],'app':_0x04d2('0x14'),'appdata':_0x04d2('0x22')+_0x30a87b[_0x33598a][0x0][_0x04d2('0x17')],'context':_0x30a87b[_0x33598a][0x0][_0x04d2('0x16')],'exten':_0x30a87b[_0x33598a][0x0][_0x04d2('0x9')],'priority':_0x5bd448[_0x04d2('0xe')]++,'VoiceExtensionId':_0x30a87b[_0x33598a][0x0][_0x04d2('0x17')]});if(_0x5bd448['extension']&&_0x5bd448[_0x04d2('0xf')][_0x04d2('0x23')](_0x04d2('0x24'))&&_0x5bd448[_0x04d2('0xf')][_0x04d2('0x24')]!==_0x04d2('0x25')){_0x5bd448['extensions'][_0x04d2('0x12')]({'type':_0x30a87b[_0x33598a][0x0]['type'],'app':_0x04d2('0x14'),'appdata':_0x04d2('0x26'),'context':_0x30a87b[_0x33598a][0x0][_0x04d2('0x16')],'exten':_0x30a87b[_0x33598a][0x0][_0x04d2('0x9')],'priority':_0x5bd448[_0x04d2('0xe')]++,'VoiceExtensionId':_0x30a87b[_0x33598a][0x0][_0x04d2('0x17')]});_0x5bd448[_0x04d2('0x11')][_0x04d2('0x12')]({'type':_0x30a87b[_0x33598a][0x0][_0x04d2('0x13')],'app':_0x04d2('0x14'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x5bd448[_0x04d2('0xf')][_0x04d2('0x24')]||_0x04d2('0x27'),'context':_0x30a87b[_0x33598a][0x0][_0x04d2('0x16')],'exten':_0x30a87b[_0x33598a][0x0]['exten'],'priority':_0x5bd448['priority']++,'VoiceExtensionId':_0x30a87b[_0x33598a][0x0][_0x04d2('0x17')]});}}_0x5bd448[_0x04d2('0x11')][_0x04d2('0x12')]({'type':_0x30a87b[_0x33598a][0x0][_0x04d2('0x13')],'app':_0x04d2('0x14'),'appdata':_0x04d2('0x28'),'context':_0x30a87b[_0x33598a][0x0][_0x04d2('0x16')],'exten':_0x30a87b[_0x33598a][0x0][_0x04d2('0x9')],'priority':_0x5bd448['priority']++,'VoiceExtensionId':_0x30a87b[_0x33598a][0x0]['VoiceExtensionId']});_0x5bd448[_0x04d2('0x11')][_0x04d2('0x12')]({'type':_0x30a87b[_0x33598a][0x0][_0x04d2('0x13')],'app':_0x04d2('0x14'),'appdata':_0x04d2('0x29'),'context':_0x30a87b[_0x33598a][0x0][_0x04d2('0x16')],'exten':_0x30a87b[_0x33598a][0x0][_0x04d2('0x9')],'priority':_0x5bd448[_0x04d2('0xe')]++,'VoiceExtensionId':_0x30a87b[_0x33598a][0x0][_0x04d2('0x17')]});_0x5bd448[_0x04d2('0x11')][_0x04d2('0x12')]({'type':_0x30a87b[_0x33598a][0x0][_0x04d2('0x13')],'app':_0x04d2('0x14'),'appdata':_0x04d2('0x2a'),'context':_0x30a87b[_0x33598a][0x0]['context'],'exten':_0x30a87b[_0x33598a][0x0][_0x04d2('0x9')],'priority':_0x5bd448[_0x04d2('0xe')]++,'VoiceExtensionId':_0x30a87b[_0x33598a][0x0]['VoiceExtensionId']});for(var _0x5e45ab=0x0,_0x5775aa=0x0;_0x5e45ab<_0x30a87b[_0x33598a][_0x04d2('0x2b')];_0x5e45ab+=0x1,_0x5775aa=0x0){var _0x16495a=_0x30a87b[_0x33598a][_0x5e45ab];if(_0x16495a[_0x04d2('0x13')]){_0x16495a[_0x04d2('0x13')]=_0x16495a['type'][_0x04d2('0x2c')]();}var _0x281ffa=[];var _0x3f456b=[];delete _0x16495a['id'];delete _0x16495a['createdAt'];delete _0x16495a[_0x04d2('0x2d')];var _0x2a5daa=_0x16495a['interval']!=='*,*,*,*'?[_0x16495a['interval']]:_0x16495a[_0x04d2('0x2e')]?_[_0x04d2('0x8')](_['filter'](_0x5bd448[_0x04d2('0x5')],{'IntervalId':_0x16495a[_0x04d2('0x2e')]}),'interval'):[];if(_0x16495a[_0x04d2('0x23')]('tag')){if(_0x16495a[_0x04d2('0x2f')]&&_0x16495a['tag']!=='--'){_0x281ffa[_0x04d2('0x12')]({'type':_0x16495a['type'],'app':_0x04d2('0x14'),'appdata':'CDR(tag)='+_0x16495a['tag'],'context':_0x16495a[_0x04d2('0x16')],'exten':_0x16495a[_0x04d2('0x9')],'priority':_0x2a5daa['length']+_0x5bd448[_0x04d2('0xe')]+_0x5775aa++,'VoiceExtensionId':_0x16495a['VoiceExtensionId']});}}if(_0x16495a['type']==='outbound'&&_0x16495a[_0x04d2('0x23')](_0x04d2('0x30'))){if(_0x16495a[_0x04d2('0x30')]){_0x281ffa[_0x04d2('0x12')]({'type':_0x16495a['type'],'app':'ExecIf','appdata':_0x04d2('0x31')+_0x16495a[_0x04d2('0x30')]+')','context':_0x16495a['context'],'exten':_0x16495a[_0x04d2('0x9')],'priority':_0x2a5daa[_0x04d2('0x2b')]+_0x5bd448[_0x04d2('0xe')]+_0x5775aa++,'VoiceExtensionId':_0x16495a[_0x04d2('0x17')]});}else{_0x281ffa['push']({'type':_0x16495a[_0x04d2('0x13')],'app':_0x04d2('0x1e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x16495a['context'],'exten':_0x16495a[_0x04d2('0x9')],'priority':_0x2a5daa[_0x04d2('0x2b')]+_0x5bd448['priority']+_0x5775aa++,'VoiceExtensionId':_0x16495a['VoiceExtensionId']});}}if(_0x16495a[_0x04d2('0x23')](_0x04d2('0x32'))){if(_0x2c37c7[_0x04d2('0x33')](_0x16495a[_0x04d2('0x34')][_0x04d2('0x2c')]())>=0x0&&_0x16495a[_0x04d2('0x35')]!=='custom'){if(_0x16495a[_0x04d2('0x32')]){_0x281ffa[_0x04d2('0x12')]({'type':_0x16495a['type'],'app':_0x04d2('0x1e'),'appdata':_0x04d2('0x36'),'context':_0x16495a['context'],'exten':_0x16495a['exten'],'priority':_0x2a5daa['length']+_0x5bd448[_0x04d2('0xe')]+_0x5775aa++,'VoiceExtensionId':_0x16495a['VoiceExtensionId']});_0x281ffa[_0x04d2('0x12')]({'type':_0x16495a[_0x04d2('0x13')],'app':_0x04d2('0x14'),'appdata':_0x04d2('0x37'),'context':_0x16495a[_0x04d2('0x16')],'exten':_0x16495a['exten'],'priority':_0x2a5daa[_0x04d2('0x2b')]+_0x5bd448['priority']+_0x5775aa++,'VoiceExtensionId':_0x16495a[_0x04d2('0x17')]});}else{_0x281ffa[_0x04d2('0x12')]({'type':_0x16495a[_0x04d2('0x13')],'app':'ExecIf','appdata':_0x04d2('0x38'),'context':_0x16495a[_0x04d2('0x16')],'exten':_0x16495a[_0x04d2('0x9')],'priority':_0x2a5daa['length']+_0x5bd448[_0x04d2('0xe')]+_0x5775aa++,'VoiceExtensionId':_0x16495a[_0x04d2('0x17')]});_0x281ffa[_0x04d2('0x12')]({'type':_0x16495a[_0x04d2('0x13')],'app':_0x04d2('0x14'),'appdata':_0x04d2('0x39'),'context':_0x16495a[_0x04d2('0x16')],'exten':_0x16495a[_0x04d2('0x9')],'priority':_0x2a5daa[_0x04d2('0x2b')]+_0x5bd448[_0x04d2('0xe')]+_0x5775aa++,'VoiceExtensionId':_0x16495a[_0x04d2('0x17')]});}}}for(var _0x596a9e=0x0;_0x596a9e<_0x2a5daa['length'];_0x596a9e+=0x1){var _0x2660c3=_0x5bd448['priority']+_0x2a5daa[_0x04d2('0x2b')];var _0x25b4d1=_0x596a9e===_0x2a5daa[_0x04d2('0x2b')]-0x1?_0x5bd448[_0x04d2('0xe')]+_0x281ffa['length']+_0x3f456b[_0x04d2('0x2b')]+0x2:_0x5bd448[_0x04d2('0xe')]+_0x596a9e+0x1;_0x281ffa['splice'](_0x596a9e,0x0,{'type':_0x16495a[_0x04d2('0x13')],'app':_0x04d2('0x3a'),'appdata':_0x2a5daa[_0x596a9e]+'?'+_0x16495a[_0x04d2('0x16')]+',${EXTEN},'+_0x2660c3+':'+_0x16495a['context']+_0x04d2('0x3b')+_0x25b4d1,'exten':_0x16495a[_0x04d2('0x9')],'context':_0x16495a[_0x04d2('0x16')],'priority':_0x5bd448[_0x04d2('0xe')]+_0x596a9e,'VoiceExtensionId':_0x30a87b[_0x33598a][0x0][_0x04d2('0x17')]});}_0x16495a[_0x04d2('0xe')]=_0x281ffa[_0x04d2('0x2b')]?_[_0x04d2('0x3c')](_0x281ffa)[_0x04d2('0xe')]+0x1:_0x5bd448[_0x04d2('0xe')];_0x5bd448['priority']=(_0x3f456b[_0x04d2('0x2b')]?_['last'](_0x3f456b)[_0x04d2('0xe')]:_0x16495a[_0x04d2('0xe')])+0x1;_0x5bd448['extensions']=_[_0x04d2('0x3d')](_0x5bd448[_0x04d2('0x11')],_0x281ffa,[_0x16495a],_0x3f456b);}_0x5bd448['extensions']['push']({'type':_0x30a87b[_0x33598a][0x0]['type'],'app':_0x04d2('0x3e'),'exten':_0x30a87b[_0x33598a][0x0][_0x04d2('0x9')],'context':_0x30a87b[_0x33598a][0x0][_0x04d2('0x16')],'priority':_0x5bd448['priority'],'VoiceExtensionId':_0x30a87b[_0x33598a][0x0][_0x04d2('0x17')]});_0x1f70bd[_0x04d2('0x12')](_0x30a87b[_0x33598a][0x0][_0x04d2('0x17')]);_0x5de499=_['concat'](_0x5de499,_0x5bd448['extensions']);}}return _0x3a7306['transaction'](function(_0x5461a0){return _0x3a7306['models']['VoiceExtension'][_0x04d2('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x1f70bd}},'transaction':_0x5461a0})[_0x04d2('0x4')](function(_0x569282){return _0x3a7306[_0x04d2('0x2')][_0x04d2('0x6')][_0x04d2('0x40')](_[_0x04d2('0x41')](_0x5de499,_0x04d2('0xe')),{'transaction':_0x5461a0});});});})['catch'](function(_0x589494){console[_0x04d2('0x42')](_0x589494);});}exports[_0x04d2('0x43')]=rewrite; \ No newline at end of file +var _0x3bed=['rewrite','lodash','util','findAll','then','models','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','extensions','extension','find','push','Set','format','CDR(type)=%s','context','priority','VoiceExtensionId','type','inbound','outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','intervals','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','destroy','bulkCreate','sortBy','catch'];(function(_0x16b09d,_0xc302ab){var _0x12e85e=function(_0x47ec38){while(--_0x47ec38){_0x16b09d['push'](_0x16b09d['shift']());}};_0x12e85e(++_0xc302ab);}(_0x3bed,0x125));var _0xd3be=function(_0x1b3e94,_0x467671){_0x1b3e94=_0x1b3e94-0x0;var _0x118f99=_0x3bed[_0x1b3e94];return _0x118f99;};'use strict';var _=require(_0xd3be('0x0'));var util=require(_0xd3be('0x1'));function rewrite(_0x215fc1,_0x41815a){var _0x25e271=this;return _0x215fc1['models']['Interval']['findAll']({'raw':!![]})['then'](function(_0x2da7aa){_0x25e271['intervals']=_0x2da7aa;return _0x215fc1['models']['VoiceExtension'][_0xd3be('0x2')]({'where':{'IntervalId':_0x41815a['IntervalId']},'raw':!![]});})[_0xd3be('0x3')](function(_0x2ddc8f){return _0x215fc1[_0xd3be('0x4')][_0xd3be('0x5')][_0xd3be('0x2')]({'where':{'exten':{'$in':_[_0xd3be('0x6')](_[_0xd3be('0x7')](_0x2ddc8f,_0xd3be('0x8')))}},'order':[{'raw':_0xd3be('0x9')}],'raw':!![]});})[_0xd3be('0x3')](function(_0x11594d){var _0x6cb2c3=_[_0xd3be('0xa')](_0x11594d,{'priority':'1'});var _0x55cbe8=_[_0xd3be('0xa')](_0x11594d,{'isApp':0x1});var _0x2ab50a=_[_0xd3be('0xb')](_0x55cbe8,_0xd3be('0x8'));var _0x251a98=[_0xd3be('0xc'),_0xd3be('0xd')];var _0x10386d=[];var _0x5976ed=[];for(var _0xf3fc99 in _0x2ab50a){if(_0x2ab50a['hasOwnProperty'](_0xf3fc99)){_0x25e271['priority']=0x2;_0x25e271[_0xd3be('0xe')]=[];_0x25e271[_0xd3be('0xf')]=_[_0xd3be('0x10')](_0x6cb2c3,{'exten':_0x2ab50a[_0xf3fc99][0x0]['exten']});_0x25e271[_0xd3be('0xe')][_0xd3be('0x11')]({'type':_0x2ab50a[_0xf3fc99][0x0]['type'],'app':_0xd3be('0x12'),'appdata':util[_0xd3be('0x13')](_0xd3be('0x14'),_0x2ab50a[_0xf3fc99][0x0]['type']),'context':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x15')],'exten':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x8')],'priority':_0x25e271[_0xd3be('0x16')]++,'VoiceExtensionId':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x17')]});if(_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x18')]===_0xd3be('0x19')){_0x25e271[_0xd3be('0xe')][_0xd3be('0x11')]({'type':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x18')],'app':_0xd3be('0x12'),'appdata':'CDR(routeid)='+_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x17')],'context':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x15')],'exten':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x8')],'priority':_0x25e271[_0xd3be('0x16')]++,'VoiceExtensionId':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x17')]});}else if(_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x18')]===_0xd3be('0x1a')){if(_0x25e271[_0xd3be('0xf')]){_0x25e271[_0xd3be('0xe')][_0xd3be('0x11')]({'type':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x18')],'app':_0xd3be('0x12'),'appdata':_0xd3be('0x1b')+(_0x25e271[_0xd3be('0xf')]['cutdigits']?_0xd3be('0x1c')+_0x25e271['extension'][_0xd3be('0x1d')]+'}':_0xd3be('0x1e')),'context':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x15')],'exten':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x8')],'priority':_0x25e271[_0xd3be('0x16')]++,'VoiceExtensionId':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x17')]});}_0x25e271[_0xd3be('0xe')]['push']({'type':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x18')],'app':_0xd3be('0x12'),'appdata':_0xd3be('0x1f')+_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x17')],'context':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x15')],'exten':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x8')],'priority':_0x25e271[_0xd3be('0x16')]++,'VoiceExtensionId':_0x2ab50a[_0xf3fc99][0x0]['VoiceExtensionId']});var _0x18c479=_0x25e271['priority']++;_0x25e271[_0xd3be('0xe')]['push']({'type':_0x2ab50a[_0xf3fc99][0x0]['type'],'app':_0xd3be('0x20'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x18c479+0x2)+_0xd3be('0x21')+(_0x18c479+0x1)+')','context':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x15')],'exten':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x8')],'priority':_0x18c479,'VoiceExtensionId':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x17')]});if(_0x25e271[_0xd3be('0xf')]){_0x25e271[_0xd3be('0xe')][_0xd3be('0x11')]({'type':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x18')],'app':_0xd3be('0x12'),'appdata':_0x25e271['extension'][_0xd3be('0x1d')]?_0xd3be('0x22')+_0x25e271[_0xd3be('0xf')][_0xd3be('0x1d')]+'}':'CDR(prefix)=noprefix','context':_0x2ab50a[_0xf3fc99][0x0]['context'],'exten':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x8')],'priority':_0x25e271[_0xd3be('0x16')]++,'VoiceExtensionId':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x17')]});}_0x25e271[_0xd3be('0xe')][_0xd3be('0x11')]({'type':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x18')],'app':_0xd3be('0x12'),'appdata':_0xd3be('0x23')+_0x2ab50a[_0xf3fc99][0x0]['VoiceExtensionId'],'context':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x15')],'exten':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x8')],'priority':_0x25e271[_0xd3be('0x16')]++,'VoiceExtensionId':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x17')]});if(_0x25e271[_0xd3be('0xf')]&&_0x25e271[_0xd3be('0xf')][_0xd3be('0x24')]('recordingFormat')&&_0x25e271['extension'][_0xd3be('0x25')]!==_0xd3be('0x26')){_0x25e271[_0xd3be('0xe')][_0xd3be('0x11')]({'type':_0x2ab50a[_0xf3fc99][0x0]['type'],'app':'Set','appdata':_0xd3be('0x27'),'context':_0x2ab50a[_0xf3fc99][0x0]['context'],'exten':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x8')],'priority':_0x25e271[_0xd3be('0x16')]++,'VoiceExtensionId':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x17')]});_0x25e271[_0xd3be('0xe')][_0xd3be('0x11')]({'type':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x18')],'app':'Set','appdata':_0xd3be('0x28')+_0x25e271[_0xd3be('0xf')][_0xd3be('0x25')]||'wav','context':_0x2ab50a[_0xf3fc99][0x0]['context'],'exten':_0x2ab50a[_0xf3fc99][0x0]['exten'],'priority':_0x25e271[_0xd3be('0x16')]++,'VoiceExtensionId':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x17')]});}}_0x25e271['extensions'][_0xd3be('0x11')]({'type':_0x2ab50a[_0xf3fc99][0x0]['type'],'app':_0xd3be('0x12'),'appdata':_0xd3be('0x29'),'context':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x15')],'exten':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x8')],'priority':_0x25e271[_0xd3be('0x16')]++,'VoiceExtensionId':_0x2ab50a[_0xf3fc99][0x0]['VoiceExtensionId']});_0x25e271['extensions'][_0xd3be('0x11')]({'type':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x18')],'app':_0xd3be('0x12'),'appdata':_0xd3be('0x2a'),'context':_0x2ab50a[_0xf3fc99][0x0]['context'],'exten':_0x2ab50a[_0xf3fc99][0x0]['exten'],'priority':_0x25e271[_0xd3be('0x16')]++,'VoiceExtensionId':_0x2ab50a[_0xf3fc99][0x0]['VoiceExtensionId']});_0x25e271[_0xd3be('0xe')]['push']({'type':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x18')],'app':_0xd3be('0x12'),'appdata':_0xd3be('0x2b'),'context':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x15')],'exten':_0x2ab50a[_0xf3fc99][0x0]['exten'],'priority':_0x25e271[_0xd3be('0x16')]++,'VoiceExtensionId':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x17')]});for(var _0x139b5b=0x0,_0x526f73=0x0;_0x139b5b<_0x2ab50a[_0xf3fc99]['length'];_0x139b5b+=0x1,_0x526f73=0x0){var _0x301358=_0x2ab50a[_0xf3fc99][_0x139b5b];if(_0x301358[_0xd3be('0x18')]){_0x301358[_0xd3be('0x18')]=_0x301358[_0xd3be('0x18')][_0xd3be('0x2c')]();}var _0x57aef3=[];var _0x501f37=[];delete _0x301358['id'];delete _0x301358[_0xd3be('0x2d')];delete _0x301358[_0xd3be('0x2e')];var _0x5890b1=_0x301358[_0xd3be('0x2f')]!==_0xd3be('0x30')?[_0x301358[_0xd3be('0x2f')]]:_0x301358[_0xd3be('0x31')]?_[_0xd3be('0x7')](_[_0xd3be('0xa')](_0x25e271[_0xd3be('0x32')],{'IntervalId':_0x301358[_0xd3be('0x31')]}),'interval'):[];if(_0x301358[_0xd3be('0x24')]('tag')){if(_0x301358[_0xd3be('0x33')]&&_0x301358[_0xd3be('0x33')]!=='--'){_0x57aef3['push']({'type':_0x301358[_0xd3be('0x18')],'app':'Set','appdata':_0xd3be('0x34')+_0x301358[_0xd3be('0x33')],'context':_0x301358[_0xd3be('0x15')],'exten':_0x301358[_0xd3be('0x8')],'priority':_0x5890b1['length']+_0x25e271[_0xd3be('0x16')]+_0x526f73++,'VoiceExtensionId':_0x301358[_0xd3be('0x17')]});}}if(_0x301358[_0xd3be('0x18')]==='outbound'&&_0x301358[_0xd3be('0x24')]('callerID')){if(_0x301358['callerID']){_0x57aef3['push']({'type':_0x301358['type'],'app':_0xd3be('0x20'),'appdata':_0xd3be('0x35')+_0x301358[_0xd3be('0x36')]+')','context':_0x301358[_0xd3be('0x15')],'exten':_0x301358[_0xd3be('0x8')],'priority':_0x5890b1[_0xd3be('0x37')]+_0x25e271[_0xd3be('0x16')]+_0x526f73++,'VoiceExtensionId':_0x301358[_0xd3be('0x17')]});}else{_0x57aef3[_0xd3be('0x11')]({'type':_0x301358[_0xd3be('0x18')],'app':_0xd3be('0x20'),'appdata':_0xd3be('0x38'),'context':_0x301358[_0xd3be('0x15')],'exten':_0x301358[_0xd3be('0x8')],'priority':_0x5890b1[_0xd3be('0x37')]+_0x25e271[_0xd3be('0x16')]+_0x526f73++,'VoiceExtensionId':_0x301358['VoiceExtensionId']});}}if(_0x301358[_0xd3be('0x24')](_0xd3be('0x39'))){if(_0x251a98['indexOf'](_0x301358[_0xd3be('0x3a')][_0xd3be('0x2c')]())>=0x0&&_0x301358[_0xd3be('0x3b')]!==_0xd3be('0x3c')){if(_0x301358[_0xd3be('0x39')]){_0x57aef3[_0xd3be('0x11')]({'type':_0x301358[_0xd3be('0x18')],'app':_0xd3be('0x20'),'appdata':_0xd3be('0x3d'),'context':_0x301358['context'],'exten':_0x301358[_0xd3be('0x8')],'priority':_0x5890b1[_0xd3be('0x37')]+_0x25e271['priority']+_0x526f73++,'VoiceExtensionId':_0x301358[_0xd3be('0x17')]});_0x57aef3[_0xd3be('0x11')]({'type':_0x301358[_0xd3be('0x18')],'app':_0xd3be('0x12'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x301358[_0xd3be('0x15')],'exten':_0x301358[_0xd3be('0x8')],'priority':_0x5890b1['length']+_0x25e271[_0xd3be('0x16')]+_0x526f73++,'VoiceExtensionId':_0x301358[_0xd3be('0x17')]});}else{_0x57aef3[_0xd3be('0x11')]({'type':_0x301358[_0xd3be('0x18')],'app':_0xd3be('0x20'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x301358[_0xd3be('0x15')],'exten':_0x301358[_0xd3be('0x8')],'priority':_0x5890b1['length']+_0x25e271[_0xd3be('0x16')]+_0x526f73++,'VoiceExtensionId':_0x301358[_0xd3be('0x17')]});_0x57aef3[_0xd3be('0x11')]({'type':_0x301358[_0xd3be('0x18')],'app':_0xd3be('0x12'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x301358[_0xd3be('0x15')],'exten':_0x301358['exten'],'priority':_0x5890b1[_0xd3be('0x37')]+_0x25e271['priority']+_0x526f73++,'VoiceExtensionId':_0x301358[_0xd3be('0x17')]});}}}for(var _0x242f10=0x0;_0x242f10<_0x5890b1[_0xd3be('0x37')];_0x242f10+=0x1){var _0x3250fc=_0x25e271[_0xd3be('0x16')]+_0x5890b1[_0xd3be('0x37')];var _0x46a71d=_0x242f10===_0x5890b1[_0xd3be('0x37')]-0x1?_0x25e271[_0xd3be('0x16')]+_0x57aef3[_0xd3be('0x37')]+_0x501f37[_0xd3be('0x37')]+0x2:_0x25e271['priority']+_0x242f10+0x1;_0x57aef3[_0xd3be('0x3e')](_0x242f10,0x0,{'type':_0x301358['type'],'app':_0xd3be('0x3f'),'appdata':_0x5890b1[_0x242f10]+'?'+_0x301358[_0xd3be('0x15')]+',${EXTEN},'+_0x3250fc+':'+_0x301358[_0xd3be('0x15')]+_0xd3be('0x40')+_0x46a71d,'exten':_0x301358['exten'],'context':_0x301358[_0xd3be('0x15')],'priority':_0x25e271[_0xd3be('0x16')]+_0x242f10,'VoiceExtensionId':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x17')]});}_0x301358[_0xd3be('0x16')]=_0x57aef3[_0xd3be('0x37')]?_['last'](_0x57aef3)[_0xd3be('0x16')]+0x1:_0x25e271[_0xd3be('0x16')];_0x25e271['priority']=(_0x501f37[_0xd3be('0x37')]?_[_0xd3be('0x41')](_0x501f37)[_0xd3be('0x16')]:_0x301358[_0xd3be('0x16')])+0x1;_0x25e271['extensions']=_['concat'](_0x25e271[_0xd3be('0xe')],_0x57aef3,[_0x301358],_0x501f37);}_0x25e271[_0xd3be('0xe')][_0xd3be('0x11')]({'type':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x18')],'app':_0xd3be('0x42'),'exten':_0x2ab50a[_0xf3fc99][0x0]['exten'],'context':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x15')],'priority':_0x25e271['priority'],'VoiceExtensionId':_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x17')]});_0x10386d['push'](_0x2ab50a[_0xf3fc99][0x0][_0xd3be('0x17')]);_0x5976ed=_[_0xd3be('0x43')](_0x5976ed,_0x25e271[_0xd3be('0xe')]);}}return _0x215fc1['transaction'](function(_0x334366){return _0x215fc1[_0xd3be('0x4')][_0xd3be('0x5')][_0xd3be('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x10386d}},'transaction':_0x334366})[_0xd3be('0x3')](function(_0x23a98b){return _0x215fc1[_0xd3be('0x4')]['VoiceExtension'][_0xd3be('0x45')](_[_0xd3be('0x46')](_0x5976ed,'priority'),{'transaction':_0x334366});});});})[_0xd3be('0x47')](function(_0x3f66df){console['error'](_0x3f66df);});}exports[_0xd3be('0x48')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 4cd59fc..17a51bd 100644 --- a/server/components/import/cm/csv.js +++ b/server/components/import/cm/csv.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5ca=['catch','query','all','findAll','BlackLists','get','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','resume','resolve','contact:csv_','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','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','email','email\x20format\x20is\x20not\x20valid!','CompanyId','duplicate','Duplicate\x20Contact','CmContact','keys','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','select','field','NOW()','toString','updatedAt','from','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','insert','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','CmList','Lists','then','always','push','sequelize','VoiceQueueId'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0xe5ca,0x1d6));var _0xae5c=function(_0x3181cc,_0x28447f){_0x3181cc=_0x3181cc-0x0;var _0x547a4a=_0xe5ca[_0x3181cc];return _0x547a4a;};'use strict';var BPromise=require(_0xae5c('0x0'));var util=require(_0xae5c('0x1'));var _=require(_0xae5c('0x2'));var fs=require('fs');var squel=require(_0xae5c('0x3'));var Papa=require(_0xae5c('0x4'));var Redis=require(_0xae5c('0x5'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0xae5c('0x6'))(_0xae5c('0x7'));config['redis']=_['defaults'](config[_0xae5c('0x8')],{'host':_0xae5c('0x9'),'port':0x18eb});var socket=require(_0xae5c('0xa'))(new Redis(config[_0xae5c('0x8')]));require(_0xae5c('0xb'))[_0xae5c('0xc')](socket);try{if(!process[_0xae5c('0xd')][0x2]||process[_0xae5c('0xd')][0x2]===_0xae5c('0xe')||process[_0xae5c('0xd')][0x2]===_0xae5c('0xf')){throw new Error(_0xae5c('0x10'));}var FILEPATH=process[_0xae5c('0xd')][0x2];if(!process[_0xae5c('0xd')][0x3]||process['argv'][0x3]==='undefined'||process[_0xae5c('0xd')][0x3]==='null'||!process[_0xae5c('0xd')][0x4]||process['argv'][0x4]===_0xae5c('0xe')||process[_0xae5c('0xd')][0x4]===_0xae5c('0xf')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xae5c('0x11')](process[_0xae5c('0xd')][0x3][_0xae5c('0x12')](','),process[_0xae5c('0xd')][0x4][_0xae5c('0x12')](','));if(!process[_0xae5c('0xd')][0x5]||process[_0xae5c('0xd')][0x5]==='undefined'||process[_0xae5c('0xd')][0x5]===_0xae5c('0xf')){throw new Error(_0xae5c('0x13'));}var LISTID=process[_0xae5c('0xd')][0x5];var COMPANYID=process[_0xae5c('0xd')][0x6]&&process[_0xae5c('0xd')][0x6]!==_0xae5c('0xe')&&process['argv'][0x6]!=='null'?process[_0xae5c('0xd')][0x6]:null;var DUPLICATES=process[_0xae5c('0xd')][0x7]&&process[_0xae5c('0xd')][0x7]!=='undefined'&&process[_0xae5c('0xd')][0x7]!=='null'?process['argv'][0x7]:null;if(!process[_0xae5c('0xd')][0x8]||process['argv'][0x8]==='undefined'||process['argv'][0x8]===_0xae5c('0xf')){throw new Error(_0xae5c('0x14'));}var SOCKET_TIMESTAMP=process[_0xae5c('0xd')][0x8];}catch(_0x15378a){logger['error'](_0x15378a);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(_0x14039b,_0x45885f,_0x1db73e,_0x397e2e){var _0x34dffd={'message':_0x45885f};_0x34dffd[_0x14039b]=!![];if(_0x1db73e){_0x34dffd['contact']=_0x1db73e;}if(_0x397e2e){_0x34dffd[_0xae5c('0x15')]=_0x397e2e;}return _0x34dffd;}function isEmail(_0x212416){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))*$/[_0xae5c('0x16')](_0x212416);}function checkRow(_0x40fa97,_0x47b6c3,_0x50fa79){return new BPromise(function(_0x52ecd3,_0xa5f524){if(_[_0xae5c('0x17')](_0x40fa97)){return _0xa5f524(handleCheckRowError(_0xae5c('0x18'),_0xae5c('0x19'),null,_0x50fa79));}if(_0x40fa97['errors']&&_0x40fa97[_0xae5c('0x1a')][_0xae5c('0x1b')]){var _0x3bf727=_[_0xae5c('0x1c')](_0x40fa97[_0xae5c('0x1a')],_0xae5c('0x1d'))[_0xae5c('0x1e')](';');return _0xa5f524(handleCheckRowError('error',_0x3bf727,null,_0x50fa79));}var _0x17e32e={};for(var _0x2377f5 in FIELDS){if(FIELDS[_0xae5c('0x1f')](_0x2377f5)&&FIELDS[_0x2377f5]){_0x17e32e[_0x2377f5]=_0x40fa97[_0xae5c('0x20')][0x0][FIELDS[_0x2377f5]]||_0x40fa97[_0xae5c('0x20')][0x0]['\ufeff'+FIELDS[_0x2377f5]];}}if(!_0x17e32e[_0xae5c('0x21')]){return _0xa5f524(handleCheckRowError(_0xae5c('0x18'),'firstName\x20not\x20specified!',null,_0x50fa79));}if(!_0x17e32e[_0xae5c('0x22')]){return _0xa5f524(handleCheckRowError('error',_0xae5c('0x23'),null,_0x50fa79));}if(_0x17e32e[_0xae5c('0x24')]){var _0x5f2110=moment(_0x17e32e[_0xae5c('0x24')],_0xae5c('0x25'));if(!_0x5f2110[_0xae5c('0x26')]()){return _0xa5f524(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x50fa79));}}if(_0x17e32e[_0xae5c('0x27')]){if(!isEmail(_0x17e32e[_0xae5c('0x27')])){return _0xa5f524(handleCheckRowError(_0xae5c('0x18'),_0xae5c('0x28'),null,_0x50fa79));}}_0x17e32e['ListId']=LISTID;_0x17e32e[_0xae5c('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xae5c('0x1b')]&&_0x47b6c3){var _0x1e2787={};for(var _0x10fc66=0x0,_0x324210=DUPLICATES[_0xae5c('0x1b')];_0x10fc66<_0x324210;_0x10fc66+=0x1){_0x1e2787[DUPLICATES[_0x10fc66]]=_0x17e32e[DUPLICATES[_0x10fc66]];}var _0x248f85=_['find'](_0x47b6c3,_0x1e2787);if(_0x248f85){return _0xa5f524(handleCheckRowError(_0xae5c('0x2a'),_0xae5c('0x2b'),_0x248f85,_0x50fa79));}}return db[_0xae5c('0x2c')]['create'](_0x17e32e,{'raw':!![],'hooks':![],'fields':_[_0xae5c('0x2d')](_0x17e32e)})['then'](function(_0x13eeda){if(DUPLICATES&&DUPLICATES[_0xae5c('0x1b')]&&_0x47b6c3){_0x47b6c3['push'](_['pick'](_0x17e32e,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x13eeda['id'];return _0x52ecd3();})['catch'](function(_0x339953){return _0xa5f524(handleCheckRowError(_0xae5c('0x18'),_0xae5c('0x2e')+(_0x339953[_0xae5c('0x1d')]||JSON[_0xae5c('0x2f')](_0x339953)),null,_0x50fa79));});});}function checkHopper(){function _0x354940(){return function(_0x45c792){logger['error'](_0xae5c('0x30'),_0xae5c('0x31'),util[_0xae5c('0x32')](_0x45c792,{'showHidden':![],'depth':null}));};}var _0x4bf0fa=function(_0x962d3d,_0x2f4be8){var _0x1b0e24=squel['insert']()[_0xae5c('0x33')](_0xae5c('0x34'))[_0xae5c('0x35')]([_0xae5c('0x22'),_0xae5c('0x36'),_0xae5c('0x37'),_0xae5c('0x38'),_0x2f4be8,_0xae5c('0x39'),'updatedAt'],squel[_0xae5c('0x3a')]()['field']('phone',_0xae5c('0x22'))[_0xae5c('0x3b')](_0xae5c('0x3c'),'scheduledAt')[_0xae5c('0x3b')]('id','ContactId')[_0xae5c('0x3b')](LISTID[_0xae5c('0x3d')](),_0xae5c('0x38'))[_0xae5c('0x3b')](_0x962d3d['id'][_0xae5c('0x3d')](),_0x2f4be8)[_0xae5c('0x3b')](_0xae5c('0x3c'),'createdAt')[_0xae5c('0x3b')]('NOW()',_0xae5c('0x3e'))[_0xae5c('0x3f')]('cm_contacts')[_0xae5c('0x40')]('deletedAt\x20IS\x20NULL')[_0xae5c('0x40')](_0xae5c('0x41'),LISTID[_0xae5c('0x3d')]())['where'](_0xae5c('0x42'))['where'](_0xae5c('0x43'),squel[_0xae5c('0x3a')]()['field'](_0xae5c('0x22'))['from'](_0xae5c('0x34'))[_0xae5c('0x40')](_0x2f4be8+_0xae5c('0x44'),_0x962d3d['id']['toString']())))[_0xae5c('0x3d')]();return _0x1b0e24;};var _0x280e87=function(_0x4f17f6,_0x2dde5e){var _0x4b74ad=squel['insert']()[_0xae5c('0x33')](_0xae5c('0x34'))['fromQuery']([_0xae5c('0x22'),_0xae5c('0x36'),_0xae5c('0x37'),_0xae5c('0x38'),_0x2dde5e,'createdAt',_0xae5c('0x3e')],squel['select']()[_0xae5c('0x3b')]('phone',_0xae5c('0x22'))[_0xae5c('0x3b')](_0xae5c('0x3c'),_0xae5c('0x36'))[_0xae5c('0x3b')]('id',_0xae5c('0x37'))[_0xae5c('0x3b')](LISTID[_0xae5c('0x3d')](),_0xae5c('0x38'))[_0xae5c('0x3b')](_0x4f17f6['id']['toString'](),_0x2dde5e)[_0xae5c('0x3b')](_0xae5c('0x3c'),'createdAt')[_0xae5c('0x3b')](_0xae5c('0x3c'),_0xae5c('0x3e'))['from']('cm_contacts')[_0xae5c('0x40')]('deletedAt\x20IS\x20NULL')[_0xae5c('0x40')]('ListId\x20=\x20?',LISTID[_0xae5c('0x3d')]())[_0xae5c('0x40')](_0xae5c('0x45'),squel[_0xae5c('0x46')](hopperContacts))[_0xae5c('0x40')](_0xae5c('0x42'))[_0xae5c('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0xae5c('0x3a')]()[_0xae5c('0x3b')](_0xae5c('0x47'))[_0xae5c('0x3f')](_0xae5c('0x48'))[_0xae5c('0x40')](_0x2dde5e+'\x20=\x20?',_0x4f17f6['id'][_0xae5c('0x3d')]()))[_0xae5c('0x40')](_0xae5c('0x43'),squel[_0xae5c('0x3a')]()[_0xae5c('0x3b')]('phone')['from'](_0xae5c('0x34'))['where'](_0x2dde5e+_0xae5c('0x44'),_0x4f17f6['id'][_0xae5c('0x3d')]())))[_0xae5c('0x3d')]();return _0x4b74ad;};function _0x2f8932(_0x4987e6,_0x1286b7){var _0x55e1c1=squel[_0xae5c('0x49')]()[_0xae5c('0x33')](_0xae5c('0x34'))['fromQuery']([_0xae5c('0x22'),'scheduledAt',_0xae5c('0x37'),_0xae5c('0x38'),_0x1286b7,_0xae5c('0x39'),_0xae5c('0x3e')],squel[_0xae5c('0x3a')]()[_0xae5c('0x3b')](_0xae5c('0x22'),_0xae5c('0x22'))[_0xae5c('0x3b')](_0xae5c('0x3c'),_0xae5c('0x36'))[_0xae5c('0x3b')]('id',_0xae5c('0x37'))[_0xae5c('0x3b')](LISTID[_0xae5c('0x3d')](),'ListId')[_0xae5c('0x3b')](_0x4987e6['id'][_0xae5c('0x3d')](),_0x1286b7)[_0xae5c('0x3b')](_0xae5c('0x3c'),_0xae5c('0x39'))[_0xae5c('0x3b')](_0xae5c('0x3c'),_0xae5c('0x3e'))[_0xae5c('0x3f')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0xae5c('0x41'),LISTID[_0xae5c('0x3d')]())[_0xae5c('0x40')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0xae5c('0x40')](_0xae5c('0x42')))[_0xae5c('0x3d')]();return _0x55e1c1;}function _0x3f46c3(_0x3b5b3f,_0x2619ba){var _0x35c7f4=squel[_0xae5c('0x49')]()[_0xae5c('0x33')](_0xae5c('0x4a'))[_0xae5c('0x35')]([_0xae5c('0x22'),_0xae5c('0x37'),_0xae5c('0x38'),_0x2619ba,_0xae5c('0x39'),_0xae5c('0x3e')],squel['select']()[_0xae5c('0x3b')]('phone',_0xae5c('0x22'))[_0xae5c('0x3b')]('id',_0xae5c('0x37'))[_0xae5c('0x3b')](LISTID[_0xae5c('0x3d')](),_0xae5c('0x38'))[_0xae5c('0x3b')](_0x3b5b3f['id'][_0xae5c('0x3d')](),_0x2619ba)[_0xae5c('0x3b')](_0xae5c('0x3c'),_0xae5c('0x39'))['field'](_0xae5c('0x3c'),_0xae5c('0x3e'))[_0xae5c('0x3f')]('cm_contacts')[_0xae5c('0x40')]('deletedAt\x20IS\x20NULL')[_0xae5c('0x40')](_0xae5c('0x41'),LISTID[_0xae5c('0x3d')]())[_0xae5c('0x40')]('id\x20IN\x20?',squel[_0xae5c('0x46')](hopperContacts))[_0xae5c('0x40')](_0xae5c('0x42')))[_0xae5c('0x3d')]();return _0x35c7f4;}return db[_0xae5c('0x4b')]['findAll']({'where':{'type':_0xae5c('0x4c')},'attributes':['id',_0xae5c('0x4d')],'include':[{'model':db[_0xae5c('0x4e')],'as':_0xae5c('0x4f'),'where':{'id':LISTID}}]})[_0xae5c('0x50')](function(_0x4aa7ce){var _0xf02408=[];if(_0x4aa7ce){var _0x26ddec;for(var _0x15f94c=0x0,_0x5695f0;_0x15f94c<_0x4aa7ce[_0xae5c('0x1b')];_0x15f94c+=0x1){_0x5695f0=_0x4aa7ce[_0x15f94c]['get']({'plain':!![]});switch(_0x5695f0[_0xae5c('0x4d')]){case _0xae5c('0x51'):_0xf02408[_0xae5c('0x52')](db[_0xae5c('0x53')]['query'](_0x280e87(_0x5695f0,_0xae5c('0x54')))[_0xae5c('0x50')](function(){})[_0xae5c('0x55')](_0x354940()));break;case'onlyIfOpen':_0xf02408['push'](db[_0xae5c('0x53')][_0xae5c('0x56')](_0x4bf0fa(_0x5695f0,'VoiceQueueId'))[_0xae5c('0x50')](function(){})[_0xae5c('0x55')](_0x354940()));break;default:_0xf02408['push'](db['sequelize']['query'](_0x2f8932(_0x5695f0,_0xae5c('0x54')))[_0xae5c('0x50')](function(){})['catch'](_0x354940()));}}}return _0xf02408;})[_0xae5c('0x57')]()[_0xae5c('0x50')](function(){return db[_0xae5c('0x4b')][_0xae5c('0x58')]({'where':{'type':_0xae5c('0x4c')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xae5c('0x59'),'where':{'id':LISTID}}]})['then'](function(_0x44718c){var _0x3cc552=[];if(_0x44718c){var _0x125324;for(var _0x48f3b5=0x0,_0x25de48;_0x48f3b5<_0x44718c[_0xae5c('0x1b')];_0x48f3b5+=0x1){_0x25de48=_0x44718c[_0x48f3b5][_0xae5c('0x5a')]({'plain':!![]});_0x3cc552[_0xae5c('0x52')](db['sequelize'][_0xae5c('0x56')](_0x3f46c3(_0x25de48,_0xae5c('0x54')))[_0xae5c('0x50')](function(){})[_0xae5c('0x55')](_0x354940()));}}return _0x3cc552;})[_0xae5c('0x57')]();})[_0xae5c('0x50')](function(){return db[_0xae5c('0x5b')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0xae5c('0x4f'),'where':{'id':LISTID}}]})[_0xae5c('0x50')](function(_0x10988d){var _0x7b4628=[];if(_0x10988d){for(var _0x2227b6=0x0,_0x15240f;_0x2227b6<_0x10988d['length'];_0x2227b6+=0x1){_0x15240f=_0x10988d[_0x2227b6][_0xae5c('0x5a')]({'plain':!![]});switch(_0x15240f[_0xae5c('0x4d')]){case'always':_0x7b4628['push'](db[_0xae5c('0x53')]['query'](_0x280e87(_0x15240f,_0xae5c('0x5c')))[_0xae5c('0x50')](function(){})[_0xae5c('0x55')](_0x354940()));break;case'onlyIfOpen':_0x7b4628[_0xae5c('0x52')](db[_0xae5c('0x53')][_0xae5c('0x56')](_0x4bf0fa(_0x15240f,_0xae5c('0x5c')))[_0xae5c('0x50')](function(){})[_0xae5c('0x55')](_0x354940()));break;default:_0x7b4628['push'](db['sequelize'][_0xae5c('0x56')](_0x2f8932(_0x15240f,_0xae5c('0x5c')))['then'](function(){})['catch'](_0x354940()));}}}return _0x7b4628;})[_0xae5c('0x57')]();})[_0xae5c('0x50')](function(){return db[_0xae5c('0x5b')][_0xae5c('0x58')]({'attributes':['id'],'include':[{'model':db[_0xae5c('0x4e')],'as':_0xae5c('0x59'),'where':{'id':LISTID}}]})[_0xae5c('0x50')](function(_0x3a374){var _0x28c162=[];if(_0x3a374){for(var _0x11ffac=0x0,_0x3aec34;_0x11ffac<_0x3a374[_0xae5c('0x1b')];_0x11ffac+=0x1){_0x3aec34=_0x3a374[_0x11ffac][_0xae5c('0x5a')]({'plain':!![]});_0x28c162[_0xae5c('0x52')](db[_0xae5c('0x53')][_0xae5c('0x56')](_0x3f46c3(_0x3aec34,_0xae5c('0x5c')))[_0xae5c('0x50')](function(){})[_0xae5c('0x55')](_0x354940()));}}return _0x28c162;})[_0xae5c('0x57')]();})[_0xae5c('0x55')](function(_0x2a3fc3){logger[_0xae5c('0x18')](_0xae5c('0x5d'),_0xae5c('0x5e'),_0x2a3fc3[_0xae5c('0x1d')]);});}var processPromises=function(_0x10d6a5){return BPromise['all'](promises)[_0xae5c('0x50')](function(_0x372df6){})[_0xae5c('0x55')](function(_0x4a8a87){logger[_0xae5c('0x18')](_0xae5c('0x5f'),JSON['stringify'](_0x4a8a87));})[_0xae5c('0x60')](function(){socket[_0xae5c('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x10d6a5){return _0x10d6a5[_0xae5c('0x62')]();}});};var endCsv=function(){return BPromise[_0xae5c('0x63')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xae5c('0x50')](function(){socket[_0xae5c('0x61')](_0xae5c('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x3f1eb7){logger[_0xae5c('0x18')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xae5c('0x2f')](_0x3f1eb7));}finally{process[_0xae5c('0x65')](0x0);}});};process['on'](_0xae5c('0x66'),function(){logger[_0xae5c('0x67')](_0xae5c('0x68'));endCsv();});function main(){return BPromise[_0xae5c('0x63')]()[_0xae5c('0x50')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xae5c('0x2c')][_0xae5c('0x58')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xae5c('0x50')](function(_0x5834e3){var _0x4a3682=fs[_0xae5c('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xae5c('0x6a')](_0x4a3682,{'header':!![],'skipEmptyLines':!![],'step':function(_0x490117,_0x43eea2){total+=0x1;var _0x157cf9=total;promises[_0xae5c('0x52')](checkRow(_0x490117,_0x5834e3,_0x157cf9)[_0xae5c('0x50')](function(){success+=0x1;})[_0xae5c('0x55')](function(_0x216730){if(_0x216730[_0xae5c('0x18')]){errors+=0x1;delete _0x216730[_0xae5c('0x18')];}else if(_0x216730['duplicate']){duplicates+=0x1;delete _0x216730['duplicate'];}rows[_0xae5c('0x52')](_0x216730);}));if(total%0xc8===0x0){_0x43eea2[_0xae5c('0x6b')]();return processPromises(_0x43eea2);}},'complete':function(){return processPromises()['then'](function(){logger['info'](_0xae5c('0x6c'));endCsv();});},'error':function(_0x493c27,_0x3472d8){logger[_0xae5c('0x67')](_0xae5c('0x6d'),JSON[_0xae5c('0x2f')](_0x493c27));endCsv();}});})[_0xae5c('0x55')](function(_0x3f0a9e){logger['error'](_0xae5c('0x6e'),JSON['stringify'](_0x3f0a9e));});}main(); \ No newline at end of file +var _0x71f6=['where','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','into','ListId\x20=\x20?','findAll','outbound','dialCheckDuplicateType','CmList','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','VoiceQueue','BlackLists','get','CampaignId','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','papaparse','ioredis','../../../mysqldb','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','message','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL'];(function(_0x2d7094,_0x4241e4){var _0x3d9c67=function(_0x34d46f){while(--_0x34d46f){_0x2d7094['push'](_0x2d7094['shift']());}};_0x3d9c67(++_0x4241e4);}(_0x71f6,0x1e3));var _0x671f=function(_0x2eaf39,_0x185dbb){_0x2eaf39=_0x2eaf39-0x0;var _0x4c4d87=_0x71f6[_0x2eaf39];return _0x4c4d87;};'use strict';var BPromise=require('bluebird');var util=require(_0x671f('0x0'));var _=require(_0x671f('0x1'));var fs=require('fs');var squel=require(_0x671f('0x2'));var Papa=require(_0x671f('0x3'));var Redis=require(_0x671f('0x4'));var db=require(_0x671f('0x5'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x671f('0x6'));config['redis']=_[_0x671f('0x7')](config[_0x671f('0x8')],{'host':_0x671f('0x9'),'port':0x18eb});var socket=require(_0x671f('0xa'))(new Redis(config[_0x671f('0x8')]));require(_0x671f('0xb'))[_0x671f('0xc')](socket);try{if(!process[_0x671f('0xd')][0x2]||process['argv'][0x2]===_0x671f('0xe')||process[_0x671f('0xd')][0x2]===_0x671f('0xf')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x671f('0xd')][0x2];if(!process[_0x671f('0xd')][0x3]||process['argv'][0x3]===_0x671f('0xe')||process[_0x671f('0xd')][0x3]===_0x671f('0xf')||!process['argv'][0x4]||process[_0x671f('0xd')][0x4]===_0x671f('0xe')||process[_0x671f('0xd')][0x4]==='null'){throw new Error(_0x671f('0x10'));}var FIELDS=_[_0x671f('0x11')](process[_0x671f('0xd')][0x3][_0x671f('0x12')](','),process[_0x671f('0xd')][0x4]['split'](','));if(!process[_0x671f('0xd')][0x5]||process['argv'][0x5]==='undefined'||process[_0x671f('0xd')][0x5]===_0x671f('0xf')){throw new Error(_0x671f('0x13'));}var LISTID=process[_0x671f('0xd')][0x5];var COMPANYID=process[_0x671f('0xd')][0x6]&&process[_0x671f('0xd')][0x6]!==_0x671f('0xe')&&process['argv'][0x6]!=='null'?process[_0x671f('0xd')][0x6]:null;var DUPLICATES=process[_0x671f('0xd')][0x7]&&process[_0x671f('0xd')][0x7]!=='undefined'&&process[_0x671f('0xd')][0x7]!==_0x671f('0xf')?process[_0x671f('0xd')][0x7]:null;if(!process[_0x671f('0xd')][0x8]||process['argv'][0x8]==='undefined'||process[_0x671f('0xd')][0x8]===_0x671f('0xf')){throw new Error(_0x671f('0x14'));}var SOCKET_TIMESTAMP=process[_0x671f('0xd')][0x8];}catch(_0x5b72a5){logger[_0x671f('0x15')](_0x5b72a5);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(_0x3973eb,_0x113236,_0x125544,_0x11b215){var _0x54eee5={'message':_0x113236};_0x54eee5[_0x3973eb]=!![];if(_0x125544){_0x54eee5['contact']=_0x125544;}if(_0x11b215){_0x54eee5['index']=_0x11b215;}return _0x54eee5;}function isEmail(_0x4cb073){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))*$/[_0x671f('0x16')](_0x4cb073);}function checkRow(_0x483e86,_0x2b2e79,_0x5a4fdf){return new BPromise(function(_0x1e651a,_0x504834){if(_[_0x671f('0x17')](_0x483e86)){return _0x504834(handleCheckRowError(_0x671f('0x15'),_0x671f('0x18'),null,_0x5a4fdf));}if(_0x483e86['errors']&&_0x483e86['errors']['length']){var _0x18c2da=_['map'](_0x483e86[_0x671f('0x19')],_0x671f('0x1a'))['join'](';');return _0x504834(handleCheckRowError(_0x671f('0x15'),_0x18c2da,null,_0x5a4fdf));}var _0x233097={};for(var _0xc6d1f4 in FIELDS){if(FIELDS[_0x671f('0x1b')](_0xc6d1f4)&&FIELDS[_0xc6d1f4]){_0x233097[_0xc6d1f4]=_0x483e86[_0x671f('0x1c')][0x0][FIELDS[_0xc6d1f4]]||_0x483e86[_0x671f('0x1c')][0x0]['\ufeff'+FIELDS[_0xc6d1f4]];}}if(!_0x233097['firstName']){return _0x504834(handleCheckRowError('error',_0x671f('0x1d'),null,_0x5a4fdf));}if(!_0x233097[_0x671f('0x1e')]){return _0x504834(handleCheckRowError('error',_0x671f('0x1f'),null,_0x5a4fdf));}if(_0x233097['birthDate']){var _0x1997ff=moment(_0x233097['birthDate'],_0x671f('0x20'));if(!_0x1997ff[_0x671f('0x21')]()){return _0x504834(handleCheckRowError(_0x671f('0x15'),_0x671f('0x22'),null,_0x5a4fdf));}}if(_0x233097[_0x671f('0x23')]){if(!isEmail(_0x233097[_0x671f('0x23')])){return _0x504834(handleCheckRowError(_0x671f('0x15'),_0x671f('0x24'),null,_0x5a4fdf));}}_0x233097[_0x671f('0x25')]=LISTID;_0x233097['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x671f('0x26')]&&_0x2b2e79){var _0x178613={};for(var _0x2e72ea=0x0,_0x2fcb06=DUPLICATES[_0x671f('0x26')];_0x2e72ea<_0x2fcb06;_0x2e72ea+=0x1){_0x178613[DUPLICATES[_0x2e72ea]]=_0x233097[DUPLICATES[_0x2e72ea]];}var _0x2c2960=_[_0x671f('0x27')](_0x2b2e79,_0x178613);if(_0x2c2960){return _0x504834(handleCheckRowError(_0x671f('0x28'),_0x671f('0x29'),_0x2c2960,_0x5a4fdf));}}return db[_0x671f('0x2a')][_0x671f('0x2b')](_0x233097,{'raw':!![],'hooks':![],'fields':_[_0x671f('0x2c')](_0x233097)})[_0x671f('0x2d')](function(_0x2c5baa){if(DUPLICATES&&DUPLICATES['length']&&_0x2b2e79){_0x2b2e79[_0x671f('0x2e')](_[_0x671f('0x2f')](_0x233097,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2c5baa['id'];return _0x1e651a();})[_0x671f('0x30')](function(_0x128313){return _0x504834(handleCheckRowError(_0x671f('0x15'),'Error\x20while\x20creating\x20contact:\x20'+(_0x128313[_0x671f('0x1a')]||JSON[_0x671f('0x31')](_0x128313)),null,_0x5a4fdf));});});}function checkHopper(){function _0x582c95(){return function(_0x1d9ab4){logger[_0x671f('0x15')](_0x671f('0x32'),_0x671f('0x33'),util[_0x671f('0x34')](_0x1d9ab4,{'showHidden':![],'depth':null}));};}var _0x1b70ee=function(_0x5a0ff1,_0x561085){var _0x37147e=squel[_0x671f('0x35')]()['into'](_0x671f('0x36'))[_0x671f('0x37')]([_0x671f('0x1e'),_0x671f('0x38'),_0x671f('0x39'),_0x671f('0x25'),_0x561085,_0x671f('0x3a'),_0x671f('0x3b')],squel[_0x671f('0x3c')]()[_0x671f('0x3d')](_0x671f('0x1e'),_0x671f('0x1e'))['field'](_0x671f('0x3e'),_0x671f('0x38'))[_0x671f('0x3d')]('id','ContactId')[_0x671f('0x3d')](LISTID[_0x671f('0x3f')](),_0x671f('0x25'))[_0x671f('0x3d')](_0x5a0ff1['id'][_0x671f('0x3f')](),_0x561085)['field'](_0x671f('0x3e'),_0x671f('0x3a'))[_0x671f('0x3d')](_0x671f('0x3e'),'updatedAt')[_0x671f('0x40')](_0x671f('0x41'))['where'](_0x671f('0x42'))[_0x671f('0x43')]('ListId\x20=\x20?',LISTID[_0x671f('0x3f')]())['where'](_0x671f('0x44'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x671f('0x3c')]()[_0x671f('0x3d')](_0x671f('0x1e'))[_0x671f('0x40')](_0x671f('0x36'))[_0x671f('0x43')](_0x561085+_0x671f('0x45'),_0x5a0ff1['id'][_0x671f('0x3f')]())))[_0x671f('0x3f')]();return _0x37147e;};var _0x1aa5cc=function(_0x376550,_0x25ce2f){var _0x5a6461=squel[_0x671f('0x35')]()['into'](_0x671f('0x36'))['fromQuery'](['phone','scheduledAt',_0x671f('0x39'),_0x671f('0x25'),_0x25ce2f,'createdAt',_0x671f('0x3b')],squel[_0x671f('0x3c')]()[_0x671f('0x3d')]('phone','phone')['field'](_0x671f('0x3e'),_0x671f('0x38'))[_0x671f('0x3d')]('id','ContactId')[_0x671f('0x3d')](LISTID['toString'](),_0x671f('0x25'))[_0x671f('0x3d')](_0x376550['id']['toString'](),_0x25ce2f)[_0x671f('0x3d')](_0x671f('0x3e'),_0x671f('0x3a'))['field']('NOW()',_0x671f('0x3b'))[_0x671f('0x40')](_0x671f('0x41'))[_0x671f('0x43')]('deletedAt\x20IS\x20NULL')[_0x671f('0x43')]('ListId\x20=\x20?',LISTID[_0x671f('0x3f')]())[_0x671f('0x43')](_0x671f('0x46'),squel[_0x671f('0x47')](hopperContacts))[_0x671f('0x43')](_0x671f('0x44'))[_0x671f('0x43')](_0x671f('0x48'),squel['select']()[_0x671f('0x3d')](_0x671f('0x49'))[_0x671f('0x40')](_0x671f('0x4a'))[_0x671f('0x43')](_0x25ce2f+_0x671f('0x45'),_0x376550['id']['toString']()))[_0x671f('0x43')](_0x671f('0x48'),squel[_0x671f('0x3c')]()[_0x671f('0x3d')]('phone')['from'](_0x671f('0x36'))[_0x671f('0x43')](_0x25ce2f+_0x671f('0x45'),_0x376550['id'][_0x671f('0x3f')]())))[_0x671f('0x3f')]();return _0x5a6461;};function _0x2e778a(_0x10cbca,_0x35ce50){var _0x156529=squel[_0x671f('0x35')]()[_0x671f('0x4b')](_0x671f('0x36'))['fromQuery'](['phone','scheduledAt',_0x671f('0x39'),_0x671f('0x25'),_0x35ce50,'createdAt',_0x671f('0x3b')],squel[_0x671f('0x3c')]()[_0x671f('0x3d')](_0x671f('0x1e'),_0x671f('0x1e'))['field'](_0x671f('0x3e'),'scheduledAt')['field']('id',_0x671f('0x39'))[_0x671f('0x3d')](LISTID['toString'](),_0x671f('0x25'))[_0x671f('0x3d')](_0x10cbca['id'][_0x671f('0x3f')](),_0x35ce50)[_0x671f('0x3d')]('NOW()','createdAt')[_0x671f('0x3d')]('NOW()',_0x671f('0x3b'))[_0x671f('0x40')](_0x671f('0x41'))[_0x671f('0x43')](_0x671f('0x42'))[_0x671f('0x43')](_0x671f('0x4c'),LISTID[_0x671f('0x3f')]())['where'](_0x671f('0x46'),squel[_0x671f('0x47')](hopperContacts))[_0x671f('0x43')](_0x671f('0x44')))[_0x671f('0x3f')]();return _0x156529;}function _0x10fbc7(_0x3a24cb,_0x333a54){var _0x505389=squel[_0x671f('0x35')]()[_0x671f('0x4b')]('cm_hopper_black')['fromQuery'](['phone',_0x671f('0x39'),_0x671f('0x25'),_0x333a54,_0x671f('0x3a'),_0x671f('0x3b')],squel[_0x671f('0x3c')]()[_0x671f('0x3d')](_0x671f('0x1e'),_0x671f('0x1e'))['field']('id',_0x671f('0x39'))[_0x671f('0x3d')](LISTID[_0x671f('0x3f')](),_0x671f('0x25'))[_0x671f('0x3d')](_0x3a24cb['id']['toString'](),_0x333a54)[_0x671f('0x3d')](_0x671f('0x3e'),'createdAt')[_0x671f('0x3d')](_0x671f('0x3e'),_0x671f('0x3b'))[_0x671f('0x40')]('cm_contacts')[_0x671f('0x43')](_0x671f('0x42'))[_0x671f('0x43')](_0x671f('0x4c'),LISTID['toString']())[_0x671f('0x43')]('id\x20IN\x20?',squel[_0x671f('0x47')](hopperContacts))[_0x671f('0x43')](_0x671f('0x44')))[_0x671f('0x3f')]();return _0x505389;}return db['VoiceQueue'][_0x671f('0x4d')]({'where':{'type':_0x671f('0x4e')},'attributes':['id',_0x671f('0x4f')],'include':[{'model':db[_0x671f('0x50')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x2bc0f7){var _0xa8cd60=[];if(_0x2bc0f7){var _0x3fd28d;for(var _0x14153b=0x0,_0x1ec51a;_0x14153b<_0x2bc0f7['length'];_0x14153b+=0x1){_0x1ec51a=_0x2bc0f7[_0x14153b]['get']({'plain':!![]});switch(_0x1ec51a['dialCheckDuplicateType']){case _0x671f('0x51'):_0xa8cd60[_0x671f('0x2e')](db[_0x671f('0x52')][_0x671f('0x53')](_0x1aa5cc(_0x1ec51a,_0x671f('0x54')))[_0x671f('0x2d')](function(){})[_0x671f('0x30')](_0x582c95()));break;case _0x671f('0x55'):_0xa8cd60[_0x671f('0x2e')](db[_0x671f('0x52')][_0x671f('0x53')](_0x1b70ee(_0x1ec51a,_0x671f('0x54')))['then'](function(){})[_0x671f('0x30')](_0x582c95()));break;default:_0xa8cd60[_0x671f('0x2e')](db[_0x671f('0x52')][_0x671f('0x53')](_0x2e778a(_0x1ec51a,'VoiceQueueId'))['then'](function(){})[_0x671f('0x30')](_0x582c95()));}}}return _0xa8cd60;})[_0x671f('0x56')]()[_0x671f('0x2d')](function(){return db[_0x671f('0x57')][_0x671f('0x4d')]({'where':{'type':_0x671f('0x4e')},'attributes':['id'],'include':[{'model':db[_0x671f('0x50')],'as':_0x671f('0x58'),'where':{'id':LISTID}}]})[_0x671f('0x2d')](function(_0x214cdf){var _0x5a06e8=[];if(_0x214cdf){var _0x4bc5e8;for(var _0x28583b=0x0,_0x4f6723;_0x28583b<_0x214cdf[_0x671f('0x26')];_0x28583b+=0x1){_0x4f6723=_0x214cdf[_0x28583b][_0x671f('0x59')]({'plain':!![]});_0x5a06e8[_0x671f('0x2e')](db[_0x671f('0x52')][_0x671f('0x53')](_0x10fbc7(_0x4f6723,_0x671f('0x54')))[_0x671f('0x2d')](function(){})[_0x671f('0x30')](_0x582c95()));}}return _0x5a06e8;})['all']();})['then'](function(){return db['Campaign'][_0x671f('0x4d')]({'attributes':['id',_0x671f('0x4f')],'include':[{'model':db[_0x671f('0x50')],'as':'Lists','where':{'id':LISTID}}]})[_0x671f('0x2d')](function(_0x3efc3d){var _0x1f567f=[];if(_0x3efc3d){for(var _0x55bd56=0x0,_0x2674b0;_0x55bd56<_0x3efc3d[_0x671f('0x26')];_0x55bd56+=0x1){_0x2674b0=_0x3efc3d[_0x55bd56]['get']({'plain':!![]});switch(_0x2674b0[_0x671f('0x4f')]){case _0x671f('0x51'):_0x1f567f[_0x671f('0x2e')](db['sequelize'][_0x671f('0x53')](_0x1aa5cc(_0x2674b0,_0x671f('0x5a')))[_0x671f('0x2d')](function(){})['catch'](_0x582c95()));break;case'onlyIfOpen':_0x1f567f['push'](db['sequelize'][_0x671f('0x53')](_0x1b70ee(_0x2674b0,_0x671f('0x5a')))[_0x671f('0x2d')](function(){})['catch'](_0x582c95()));break;default:_0x1f567f[_0x671f('0x2e')](db[_0x671f('0x52')][_0x671f('0x53')](_0x2e778a(_0x2674b0,_0x671f('0x5a')))[_0x671f('0x2d')](function(){})[_0x671f('0x30')](_0x582c95()));}}}return _0x1f567f;})[_0x671f('0x56')]();})[_0x671f('0x2d')](function(){return db[_0x671f('0x5b')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x671f('0x50')],'as':_0x671f('0x58'),'where':{'id':LISTID}}]})['then'](function(_0x46d72c){var _0x41f76a=[];if(_0x46d72c){for(var _0x18024e=0x0,_0x584b0e;_0x18024e<_0x46d72c[_0x671f('0x26')];_0x18024e+=0x1){_0x584b0e=_0x46d72c[_0x18024e][_0x671f('0x59')]({'plain':!![]});_0x41f76a['push'](db[_0x671f('0x52')][_0x671f('0x53')](_0x10fbc7(_0x584b0e,_0x671f('0x5a')))[_0x671f('0x2d')](function(){})[_0x671f('0x30')](_0x582c95()));}}return _0x41f76a;})['all']();})['catch'](function(_0x3b10a0){logger[_0x671f('0x15')](_0x671f('0x5c'),_0x671f('0x5d'),_0x3b10a0[_0x671f('0x1a')]);});}var processPromises=function(_0x45d015){return BPromise[_0x671f('0x56')](promises)[_0x671f('0x2d')](function(_0x528b64){})[_0x671f('0x30')](function(_0x419448){logger[_0x671f('0x15')](_0x671f('0x5e'),JSON[_0x671f('0x31')](_0x419448));})[_0x671f('0x5f')](function(){socket[_0x671f('0x60')](_0x671f('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x45d015){return _0x45d015[_0x671f('0x62')]();}});};var endCsv=function(){return BPromise[_0x671f('0x63')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x671f('0x60')](_0x671f('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x671f('0x64')](FILEPATH);}catch(_0xa342f6){logger[_0x671f('0x15')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x671f('0x31')](_0xa342f6));}finally{process[_0x671f('0x65')](0x0);}});};process['on'](_0x671f('0x66'),function(){logger['info'](_0x671f('0x67'));endCsv();});function main(){return BPromise[_0x671f('0x63')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x671f('0x12')](',');return db[_0x671f('0x2a')][_0x671f('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x28141f){var _0x1083ba=fs[_0x671f('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x671f('0x69')](_0x1083ba,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5d445f,_0x595718){total+=0x1;var _0x2b01f6=total;promises['push'](checkRow(_0x5d445f,_0x28141f,_0x2b01f6)[_0x671f('0x2d')](function(){success+=0x1;})[_0x671f('0x30')](function(_0x4966a8){if(_0x4966a8[_0x671f('0x15')]){errors+=0x1;delete _0x4966a8[_0x671f('0x15')];}else if(_0x4966a8[_0x671f('0x28')]){duplicates+=0x1;delete _0x4966a8[_0x671f('0x28')];}rows['push'](_0x4966a8);}));if(total%0xc8===0x0){_0x595718['pause']();return processPromises(_0x595718);}},'complete':function(){return processPromises()[_0x671f('0x2d')](function(){logger[_0x671f('0x6a')](_0x671f('0x6b'));endCsv();});},'error':function(_0x400179,_0x2dcb76){logger[_0x671f('0x6a')](_0x671f('0x6c'),JSON[_0x671f('0x31')](_0x400179));endCsv();}});})[_0x671f('0x30')](function(_0x13b610){logger[_0x671f('0x15')](_0x671f('0x6d'),JSON['stringify'](_0x13b610));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index d2ce887..3a0919f 100644 --- a/server/components/import/cm/csv2.js +++ b/server/components/import/cm/csv2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe68f=['\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.phone','cm_hopper_black','ListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','UserId','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId','scheduledAt','deletedAt\x20IS\x20NULL','id\x20IN\x20?','info','error','message','exit','errors','code','sequelize','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','query','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','isNil','offset','main','stringify','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','header','ContactItemType','name','_description','writeFileSync','parse','data','rows','find','hasOwnProperty','trim','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','email','email\x20wrong\x20format','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','firstName','\x20not\x20specified','description','replace','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','voice_queues_','each','dialTimezone,utcOffset',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','arguments\x20\x20\x20','argv','existsSync','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','path','papaparse','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','redis','defaults','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','CmContact','findAll','AdditionalPhones','then','length','push','split','all','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper'];(function(_0x350343,_0x256f69){var _0x9afc1c=function(_0x47ab32){while(--_0x47ab32){_0x350343['push'](_0x350343['shift']());}};_0x9afc1c(++_0x256f69);}(_0xe68f,0x1d4));var _0xfe68=function(_0x203db0,_0x42a771){_0x203db0=_0x203db0-0x0;var _0x531798=_0xe68f[_0x203db0];return _0x531798;};'use strict';var fs=require('fs');var path=require(_0xfe68('0x0'));var _=require('lodash');var Papa=require(_0xfe68('0x1'));var util=require('util');var BPromise=require(_0xfe68('0x2'));var moment=require(_0xfe68('0x3'));var squel=require('squel');var Redis=require(_0xfe68('0x4'));var db=require(_0xfe68('0x5'))['db'];var config=require('../../../config/environment');var shared=require(_0xfe68('0x6'));var logger=require(_0xfe68('0x7'))(_0xfe68('0x8'));config[_0xfe68('0x9')]=_[_0xfe68('0xa')](config[_0xfe68('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe68('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xfe68('0xb')](_0xfe68('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xfe68('0xb')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x3fa30f){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))*$/[_0xfe68('0xd')](_0x3fa30f);}function selectNotIn(_0x572a90,_0x40b7b2,_0x3ff563,_0x39596f,_0x4d2473){return squel[_0xfe68('0xe')]()[_0xfe68('0xf')](_0xfe68('0x10'))[_0xfe68('0x11')](_0x39596f)[_0xfe68('0x12')](_0x40b7b2,null,_0x40b7b2+_0xfe68('0x13')+_0x39596f+'.'+_0x3ff563)[_0xfe68('0x14')](_0x39596f+'.'+_0x3ff563+_0xfe68('0x15')+_0x572a90+'.'+_0x3ff563)[_0xfe68('0x14')](_0x40b7b2+'.dialCheckDuplicateType\x20IN\x20('+_0x4d2473['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3b9364,_0x574f4c){promisesAdditionalPhones=[];return db[_0xfe68('0x16')][_0xfe68('0x17')]({'raw':!![],'attributes':['id',_0xfe68('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xfe68('0x19')](function(_0x3cc063){if(_0x3cc063!==null){var _0x1e0163=[];for(var _0x429f92=0x0;_0x429f92<_0x3cc063[_0xfe68('0x1a')];_0x429f92++){var _0x2d229f=_0x3cc063[_0x429f92];_0x1e0163[_0xfe68('0x1b')](insertAdditionalPhones(_0x2d229f));}}Promise['all'](_0x1e0163)[_0xfe68('0x19')](function(){_0x3b9364({'val':0x1});});});});}function insertAdditionalPhones(_0x224b59){return new Promise(function(_0x27b729,_0x245e1d){var _0x57bd16=_0x224b59[_0xfe68('0x18')];var _0x33ce19=_0x57bd16[_0xfe68('0x1c')](';');var _0x3e80e0=[];orderBy=0x0;for(var _0x4c4957=0x0;_0x4c4957<_0x33ce19[_0xfe68('0x1a')];_0x4c4957++){_0x3e80e0[_0xfe68('0x1b')](splitAdditionalPhone(_0x224b59['id'],_0x33ce19[_0x4c4957]));}Promise[_0xfe68('0x1d')](_0x3e80e0)['then'](function(){_0x27b729({'val':_0x33ce19[_0xfe68('0x1a')]});});});}function splitAdditionalPhone(_0x42c2d0,_0x1eeedc){return new Promise(function(_0xc5142,_0x726480){var _0x2098e7=_0x1eeedc['split'](':');var _0x35a265=_0x2098e7[0x0];var _0x37e0db=_0x2098e7[0x1];if(!_['isNil'](_0x37e0db)){var _0x1dac1c=_0x37e0db['split']('|');var _0x4828c8=[];for(var _0x45a840=0x0;_0x45a840<_0x1dac1c[_0xfe68('0x1a')];_0x45a840++){if(_0x1dac1c[_0x45a840]!==''){var _0x579229=_[_0xfe68('0x1e')](promisesAdditionalPhones,{'contactId':_0x42c2d0,'phone':_0x1dac1c[_0x45a840]});if(_0x579229[_0xfe68('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0xfe68('0x1b')]({'contactId':_0x42c2d0,'contactTypeId':_0x35a265,'phone':_0x1dac1c[_0x45a840],'orderBy':orderBy});}}}_0xc5142({'ok':0x1});}else _0xc5142({'res':0x0});});}function createAdditionalPhone(_0x514077,_0xb9dd77,_0x1bf95c,_0x4ff9c4){var _0x3b707a='';var _0xe001d2='';var _0x5b5681=_0x1bf95c['split']('§');_0x3b707a=_0x5b5681[0x0];if(_0x5b5681[_0xfe68('0x1a')]==0x2)_0xe001d2=_0x5b5681[0x1];return new Promise(function(_0x7c8c02,_0x264771){return db[_0xfe68('0x1f')][_0xfe68('0x20')]({'where':{'CmContactId':_0x514077,'item':_0x3b707a}})[_0xfe68('0x19')](function(_0x5e1eb1){if(_0x5e1eb1){return db[_0xfe68('0x1f')][_0xfe68('0x21')]({'ItemTypeId':_0xb9dd77,'description':_0xe001d2,'OrderBy':_0x4ff9c4},{'where':{'CmContactId':_0x514077,'item':_0x3b707a}})[_0xfe68('0x19')](function(_0x29e3c8){_0x7c8c02({'res':_0xfe68('0x22')});});}else{return db[_0xfe68('0x1f')][_0xfe68('0x23')]({'CmContactId':_0x514077,'item':_0x3b707a,'description':_0xe001d2,'ItemTypeId':_0xb9dd77,'OrderBy':_0x4ff9c4,'ItemClass':_0xfe68('0x24')})['then'](function(_0x3f01f6){_0x7c8c02({'res':_0xfe68('0x25')});});}});});}function insertCmHopper(_0x34a9be,_0xcbdcd2,_0x2cecdc,_0x2b2012,_0x1d5c8b){var _0x309188=['cm_contacts.phone',_0xfe68('0x26'),_0xfe68('0x27'),_0xfe68('0x28'),_0xcbdcd2+'.'+_0x2b2012,_0xfe68('0x29'),_0xfe68('0x2a'),_0xfe68('0x2b'),_0xfe68('0x2c'),'\x22'+_0x1d5c8b+'\x22'];return squel[_0xfe68('0x2d')]()[_0xfe68('0x2e')]('cm_hopper')[_0xfe68('0x2f')]([_0xfe68('0x10'),_0xfe68('0x30'),_0xfe68('0x31'),'ListId',_0x2b2012,_0xfe68('0x32'),_0xfe68('0x33'),_0xfe68('0x34'),'UserId',_0xfe68('0x35')],squel['select']()[_0xfe68('0x36')](_0x309188)[_0xfe68('0x11')](_0xcbdcd2)[_0xfe68('0x12')](_0xfe68('0x37'),null,_0xfe68('0x38')+_0xcbdcd2+_0xfe68('0x39'))[_0xfe68('0x12')](_0x2cecdc,null,_0x2cecdc+_0xfe68('0x13')+_0xcbdcd2+'.'+_0x2b2012)[_0xfe68('0x14')](_0xcbdcd2+'.CmListId\x20=\x20?',_0x34a9be)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xfe68('0x14')](_0xfe68('0x3a'),selectNotIn(_0xcbdcd2,_0x2cecdc,_0x2b2012,_0xfe68('0x3b'),['\x22always\x22',_0xfe68('0x3c')]))[_0xfe68('0x14')](_0xfe68('0x3a'),selectNotIn(_0xcbdcd2,_0x2cecdc,_0x2b2012,_0xfe68('0x3b'),[_0xfe68('0x3d')])))[_0xfe68('0x3e')]();}function insertCmHopperBlack(_0x52ae0f,_0x518f8a,_0x2d77f8,_0x141933){var _0x145f39=[_0xfe68('0x3f'),_0xfe68('0x27'),_0xfe68('0x28'),_0x518f8a+'.'+_0x141933,_0xfe68('0x29'),'cm_contacts.updatedAt'];return squel[_0xfe68('0x2d')]()['into'](_0xfe68('0x40'))[_0xfe68('0x2f')]([_0xfe68('0x10'),_0xfe68('0x31'),_0xfe68('0x41'),_0x141933,'createdAt',_0xfe68('0x33')],squel['select']()[_0xfe68('0x36')](_0x145f39)['from'](_0x518f8a)[_0xfe68('0x12')](_0xfe68('0x37'),null,'cm_contacts.ListId\x20=\x20'+_0x518f8a+_0xfe68('0x39'))[_0xfe68('0x12')](_0x2d77f8,null,_0x2d77f8+_0xfe68('0x13')+_0x518f8a+'.'+_0x141933)[_0xfe68('0x14')](_0x518f8a+_0xfe68('0x42'),_0x52ae0f)[_0xfe68('0x14')](_0xfe68('0x43'),NOW)[_0xfe68('0x14')](_0xfe68('0x3a'),squel[_0xfe68('0xe')]()[_0xfe68('0xf')](_0xfe68('0x10'))[_0xfe68('0x11')](_0xfe68('0x40'))[_0xfe68('0x14')](_0xfe68('0x44'),_0x52ae0f)[_0xfe68('0x14')](_0x141933+_0xfe68('0x15')+_0x518f8a+'.'+_0x141933)))[_0xfe68('0x3e')]();}function insertTzCmHopper(_0x37669d,_0x50e021,_0x5c53f0,_0x2b560f,_0x26f719,_0x1834b2){var _0x533469=[_0xfe68('0x3f'),_0xfe68('0x45')+_0x1834b2+_0xfe68('0x46'),_0xfe68('0x27'),_0xfe68('0x28'),_0x50e021+'.'+_0x2b560f,_0xfe68('0x29'),'cm_contacts.updatedAt',_0xfe68('0x2b'),_0xfe68('0x2c'),'\x22'+_0x26f719+'\x22'];var _0x591dd8=squel[_0xfe68('0x2d')]()['into'](_0xfe68('0x3b'))['fromQuery']([_0xfe68('0x10'),_0xfe68('0x30'),'ContactId',_0xfe68('0x41'),_0x2b560f,'createdAt','updatedAt',_0xfe68('0x34'),_0xfe68('0x47'),_0xfe68('0x35')],squel[_0xfe68('0xe')]()[_0xfe68('0x36')](_0x533469)[_0xfe68('0x11')](_0x50e021)[_0xfe68('0x12')](_0xfe68('0x37'),null,'cm_contacts.ListId\x20=\x20'+_0x50e021+'.CmListId')[_0xfe68('0x12')](_0x5c53f0,null,_0x5c53f0+_0xfe68('0x13')+_0x50e021+'.'+_0x2b560f)[_0xfe68('0x12')](_0x1834b2,null,_0x1834b2+'.id\x20=\x20'+_0x50e021+'.'+_0x2b560f)['where'](_0x50e021+_0xfe68('0x42'),_0x37669d)[_0xfe68('0x14')](_0xfe68('0x43'),NOW)['where'](_0xfe68('0x3a'),selectNotIn(_0x50e021,_0x5c53f0,_0x2b560f,_0xfe68('0x3b'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0xfe68('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x50e021,_0x5c53f0,_0x2b560f,_0xfe68('0x3b'),[_0xfe68('0x3d')])))[_0xfe68('0x3e')]();return _0x591dd8;}function insertTzCmHopperBlack(_0x420703,_0x453163,_0x1bb6d0,_0x31c136){var _0xdc0f7a=['cm_contacts.phone','cm_contacts.id',_0xfe68('0x28'),_0x453163+'.'+_0x31c136,_0xfe68('0x29'),'cm_contacts.updatedAt'];return squel[_0xfe68('0x2d')]()[_0xfe68('0x2e')](_0xfe68('0x40'))['fromQuery']([_0xfe68('0x10'),'ContactId',_0xfe68('0x41'),_0x31c136,_0xfe68('0x32'),'updatedAt'],squel[_0xfe68('0xe')]()[_0xfe68('0x36')](_0xdc0f7a)['from'](_0x453163)['join'](_0xfe68('0x37'),null,_0xfe68('0x38')+_0x453163+_0xfe68('0x39'))[_0xfe68('0x12')](_0x1bb6d0,null,_0x1bb6d0+_0xfe68('0x13')+_0x453163+'.'+_0x31c136)['where'](_0x453163+_0xfe68('0x42'),_0x420703)[_0xfe68('0x14')](_0xfe68('0x43'),NOW)[_0xfe68('0x14')](_0xfe68('0x3a'),squel[_0xfe68('0xe')]()['field']('phone')[_0xfe68('0x11')](_0xfe68('0x40'))[_0xfe68('0x14')]('ListId\x20=\x20?',_0x420703)[_0xfe68('0x14')](_0x31c136+_0xfe68('0x15')+_0x453163+'.'+_0x31c136)))[_0xfe68('0x3e')]();}function insertCmHopperAdditionalPhones(_0x4d490b){var _0x521d31=[_0xfe68('0x48'),_0xfe68('0x49'),'cm_contact_has_items.OrderBy',_0xfe68('0x4a'),'cm_contact_has_items.updatedAt'];return squel['insert']()[_0xfe68('0x2e')](_0xfe68('0x4b'))[_0xfe68('0x2f')]([_0xfe68('0x4c'),_0xfe68('0x10'),_0xfe68('0x4d'),_0xfe68('0x32'),_0xfe68('0x33')],squel['select']()[_0xfe68('0x36')](_0x521d31)[_0xfe68('0x11')]('cm_hopper')[_0xfe68('0x12')](_0xfe68('0x37'),null,_0xfe68('0x4e'))['join']('cm_contact_has_items',null,_0xfe68('0x4f'))['where'](_0xfe68('0x50'),_0x4d490b)[_0xfe68('0x14')](_0xfe68('0x43'),NOW))[_0xfe68('0x3e')]();}function insertCmContact(_0x3d9833,_0x59c741,_0x1cf065,_0x3779c2){var _0x2c230e=_['concat'](_[_0xfe68('0x51')](_0x3779c2),['ListId',_0xfe68('0x52'),_0xfe68('0x32'),_0xfe68('0x33'),_0xfe68('0x53')]);return squel['insert']()[_0xfe68('0x2e')](_0xfe68('0x37'))[_0xfe68('0x2f')](_0x2c230e,squel[_0xfe68('0xe')]()[_0xfe68('0x36')](_0x2c230e)[_0xfe68('0x11')](_0x59c741)['where']('('+_0x1cf065[_0xfe68('0x12')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0xfe68('0x36')](_0x1cf065)['from']('cm_contacts')['where'](_0xfe68('0x44'),_0x3d9833)[_0xfe68('0x14')](_0xfe68('0x54')))[_0xfe68('0x14')](_0xfe68('0x55'),squel[_0xfe68('0xe')]()[_0xfe68('0xf')]('MIN(id)','min_id')[_0xfe68('0x11')](_0x59c741)['group'](_0x1cf065[_0xfe68('0x12')](','))))[_0xfe68('0x3e')]();}function handleStop(){logger[_0xfe68('0x56')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x5db410){logger[_0xfe68('0x57')](_0x5db410[_0xfe68('0x58')]);process[_0xfe68('0x59')](0x1);}function handleError(_0x12ff66,_0x5635ed){stats[_0xfe68('0x5a')][_0xfe68('0x1b')]({'name':_0x5635ed[_0xfe68('0x5b')],'message':_0x5635ed['message'],'row':_0x12ff66});}function handleQuery(_0x2e9a79){logger['info'](_0x2e9a79);return db[_0xfe68('0x5c')]['query'](_0x2e9a79)[_0xfe68('0x5d')](function(_0x53e673){results[_0xfe68('0x1b')](_0x53e673);})[_0xfe68('0x5e')](function(_0x43f796){logger['error'](_0x43f796[_0xfe68('0x58')]);});}function updateTzCampaigns(_0x5c5b29){return new Promise(function(_0x1a0784,_0x1233f7){var _0x5c6d76=squel['select']()['fields']([_0xfe68('0x5f'),_0xfe68('0x60')])[_0xfe68('0x11')]('campaigns')[_0xfe68('0x12')](_0xfe68('0x61'),null,_0xfe68('0x62'))[_0xfe68('0x14')]('campaigns_has_cm_lists.CmListId='+_0x5c5b29);db[_0xfe68('0x5c')][_0xfe68('0x63')](_0x5c6d76[_0xfe68('0x3e')]())[_0xfe68('0x5d')](function(_0x143a06){var _0x376a8e=[];for(var _0x54f8f2=0x0;_0x54f8f2<_0x143a06[_0xfe68('0x1a')];_0x54f8f2++){_0x376a8e[_0xfe68('0x1b')](getTimezoneData(_0x143a06[_0x54f8f2],tmp_campaigns));}BPromise['all'](_0x376a8e)[_0xfe68('0x19')](function(){_0x1a0784({'val':0x1});});})['catch'](function(_0x5f54c5){logger[_0xfe68('0x57')](_0x5f54c5[_0xfe68('0x58')]);_0x1a0784({'val':0x0});});});}function updateTzVoiceQueues(_0x4afc8d){return new Promise(function(_0x152484,_0x23f70f){var _0x523684=squel[_0xfe68('0xe')]()[_0xfe68('0x36')](['voice_queues.id',_0xfe68('0x64')])[_0xfe68('0x11')](_0xfe68('0x65'))['join'](_0xfe68('0x66'),null,_0xfe68('0x67'))['where'](_0xfe68('0x68')+_0x4afc8d);db[_0xfe68('0x5c')][_0xfe68('0x63')](_0x523684[_0xfe68('0x3e')]())[_0xfe68('0x5d')](function(_0xf4e5b9){var _0x2a1095=[];for(var _0x53b5a9=0x0;_0x53b5a9<_0xf4e5b9[_0xfe68('0x1a')];_0x53b5a9++){_0x2a1095[_0xfe68('0x1b')](getTimezoneData(_0xf4e5b9[_0x53b5a9],tmp_voice_queues));}BPromise[_0xfe68('0x1d')](_0x2a1095)[_0xfe68('0x19')](function(){_0x152484({'val':0x1});});})[_0xfe68('0x5e')](function(_0x2df693){logger[_0xfe68('0x57')](_0x2df693['message']);_0x152484({'val':0x0});});});}function getTimezoneData(_0x2d9dfe,_0x18fdf6){return new Promise(function(_0x22a2c2,_0x8d893c){var _0x205e9b=shared[_0xfe68('0x69')];var _0x24af5c=_0x205e9b[_0x2d9dfe[_0xfe68('0x6a')]];if(_[_0xfe68('0x6b')](_0x24af5c)){_0x22a2c2({'ret':0x1});}else{var _0x388034=_0x24af5c['utcOffset'];var _0x219609=squel['insert']()[_0xfe68('0x2e')](_0x18fdf6)['set']('id',_0x2d9dfe['id'])['set'](_0xfe68('0x6c'),_0x388034)['set'](_0xfe68('0x6a'),_0x2d9dfe['dialTimezone'])[_0xfe68('0x3e')]();return db['sequelize'][_0xfe68('0x63')](_0x219609)[_0xfe68('0x5d')](function(_0x5d07f9){_0x22a2c2({'ret':0x1});})['catch'](function(_0xa99a6c){logger['error'](_0xa99a6c['message']);_0x8d893c({'ret':0x1});});}});}function handleTZQuery(_0x517f36){logger[_0xfe68('0x56')](_0x517f36);return db[_0xfe68('0x5c')][_0xfe68('0x63')](_0x517f36)['spread'](function(_0x137c3c){})[_0xfe68('0x5e')](function(_0x36604c){logger[_0xfe68('0x57')](_0x36604c[_0xfe68('0x58')]);});}function main(_0x37c178,_0x222c1a,_0x3e7155,_0x55a0a7){logger['info'](_0xfe68('0x6d'),_0x37c178,JSON[_0xfe68('0x6e')](_0x222c1a));process['send'](_0xfe68('0x6f'));var _0x346ba4=_0x222c1a[_0xfe68('0x70')];var _0x19877b=_[_0xfe68('0x71')](_0x346ba4);var _0x504b3a=_0x222c1a[_0xfe68('0x72')];var _0xb66b63=path['join'](config[_0xfe68('0x73')],_0xfe68('0x74'),_0x504b3a+_0xfe68('0x75'));hasTZ=_[_0xfe68('0x51')](_0x346ba4)['includes'](_0xfe68('0x6a'));var _0x448e27=_[_0xfe68('0x51')](_0x346ba4)[_0xfe68('0x12')]();logger['info'](_0xfe68('0x76'),_0x448e27);db[_0xfe68('0x77')][_0xfe68('0x17')]({'raw':!![],'attributes':['id','name']})['then'](function(_0xc45321){for(var _0x52edc1=0x0;_0x52edc1<_0xc45321[_0xfe68('0x1a')];_0x52edc1++){if(_0xc45321[_0x52edc1][_0xfe68('0x78')]in _0x346ba4){contactItemTypes[_0xfe68('0x1b')](_0xc45321[_0x52edc1]);delete _0x19877b[_0xc45321[_0x52edc1][_0xfe68('0x78')]];hasAdditionalPhones=!![];}for(var _0x36392e in _0x346ba4){if(_0xc45321[_0x52edc1]['name']+_0xfe68('0x79')===_0x36392e){phoneDescriptions['push']({'itemTypeId':_0xc45321[_0x52edc1]['id'],'description':_0x36392e});delete _0x19877b[_0x36392e];}}}if(hasAdditionalPhones)_0x19877b[_0xfe68('0x18')]='';var _0x5a4511=_[_0xfe68('0x51')](_0x19877b)[_0xfe68('0x12')]();logger[_0xfe68('0x56')](_0xfe68('0x76'),_0x5a4511);fs[_0xfe68('0x7a')](_0xb66b63,_0x5a4511+'\x0a');Papa[_0xfe68('0x7b')](fs['createReadStream'](_0x37c178),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3ca56f,_0x21f7e9){try{for(var _0x2356d7=0x0,_0x42f833=[];_0x2356d7<_0x3ca56f[_0xfe68('0x7c')][_0xfe68('0x1a')];_0x2356d7++){stats[_0xfe68('0x7d')]+=0x1;if(_0x3ca56f[_0xfe68('0x5a')][_0x2356d7]){handleError(_0x3ca56f[_0xfe68('0x7c')][_0x2356d7],_0x3ca56f[_0xfe68('0x5a')][_0x2356d7]);}else{var _0x3d980b=[];var _0x4c814e=[];var _0x1b54c2={};for(var _0xe06353 in _0x346ba4){let _0x3ff003=contactItemTypes[_0xfe68('0x7e')](_0x13ffaf=>_0x13ffaf[_0xfe68('0x78')]===_0xe06353);let _0x3f9c76=contactItemTypes[_0xfe68('0x7e')](_0x12246d=>_0x12246d[_0xfe68('0x78')]+_0xfe68('0x79')===_0xe06353);if(_['isNil'](_0x3ff003)&&_[_0xfe68('0x6b')](_0x3f9c76)){if(_0x346ba4[_0xfe68('0x7f')](_0xe06353)){if(_0x3ca56f[_0xfe68('0x7c')][_0x2356d7][_0x346ba4[_0xe06353]]){var _0x918183=_[_0xfe68('0x80')](_0x3ca56f[_0xfe68('0x7c')][_0x2356d7][_0x346ba4[_0xe06353]]['replace'](/"/g,'\x27'));switch(_0xe06353){case _0xfe68('0x30'):var _0x3cba0d=moment(_0x918183,_0xfe68('0xc'),!![]);if(_0x3cba0d['isValid']()){_0x42f833[_0xfe68('0x1b')]('\x22'+_0x918183+'\x22');}else{_0x3d980b[_0xfe68('0x1b')](_0xfe68('0x81'));}break;case _0xfe68('0x34'):var _0xdbb9ca=parseInt(_0x918183);_0x918183=_[_0xfe68('0x82')](_0xdbb9ca)||_0xdbb9ca<0x0||_0xdbb9ca>0x4?_0x55a0a7?0x3:0x2:_0xdbb9ca;_0x42f833[_0xfe68('0x1b')]('\x22'+_0x918183+'\x22');break;case _0xfe68('0x47'):var _0x4cc300=parseInt(_0x918183);if(_[_0xfe68('0x83')](_0x4cc300)&&_['includes'](_0x3e7155,_0x4cc300)){_0x42f833[_0xfe68('0x1b')]('\x22'+_0x4cc300+'\x22');}else{_0x3d980b[_0xfe68('0x1b')]('agent\x20not\x20exists');}break;case _0xfe68('0x84'):if(isEmail(_0x918183)){_0x42f833[_0xfe68('0x1b')]('\x22'+_0x918183+'\x22');}else{_0x3d980b[_0xfe68('0x1b')](_0xfe68('0x85'));}break;case'dateOfBirth':var _0x155e5d=moment(_0x918183,_0xfe68('0x86'),!![]);if(_0x155e5d[_0xfe68('0x87')]()){_0x42f833[_0xfe68('0x1b')]('\x22'+_0x918183+'\x22');}else{_0x3d980b[_0xfe68('0x1b')](_0xfe68('0x88'));}break;case _0xfe68('0x6a'):var _0x41c74f=shared[_0xfe68('0x69')];var _0x3814af=_0x41c74f[_0x918183];if(!_['isNil'](_0x3814af)){var _0x54755d=_0x3814af[_0xfe68('0x89')];_0x42f833['push']('\x22'+_0x918183+'\x22');_0x42f833[_0xfe68('0x1b')]('\x22'+_0x54755d+'\x22');}break;default:_0x42f833[_0xfe68('0x1b')]('\x22'+_0x918183+'\x22');}}else{switch(_0xe06353){case _0xfe68('0x8a'):case _0xfe68('0x10'):_0x3d980b[_0xfe68('0x1b')](_0xe06353+_0xfe68('0x8b'));break;default:_0x42f833[_0xfe68('0x1b')]('\x22\x22');}}}}else{var _0x27709c='';if(!_[_0xfe68('0x6b')](_0x3ff003)){if(!_0x1b54c2[_0xfe68('0x7f')](_0x3ff003['id'])){if(!_[_0xfe68('0x6b')](_0x3ca56f[_0xfe68('0x7c')][_0x2356d7][_0x346ba4[_0xe06353]])){var _0x918183=_[_0xfe68('0x80')](_0x3ca56f[_0xfe68('0x7c')][_0x2356d7][_0x346ba4[_0xe06353]]['replace'](/"/g,'\x27'));var _0x16ab22=phoneDescriptions['find'](_0xc0f31a=>_0xc0f31a['itemTypeId']===_0x3ff003['id']);if(!_[_0xfe68('0x6b')](_0x16ab22)){var _0x341da7=_[_0xfe68('0x80')](_0x3ca56f[_0xfe68('0x7c')][_0x2356d7][_0x346ba4[_0x16ab22[_0xfe68('0x8c')]]][_0xfe68('0x8d')](/"/g,'\x27'));if(!_[_0xfe68('0x6b')](_0x341da7))_0x918183=_0x918183+'§'+_0x341da7;}if(_0x27709c=='')_0x27709c=_0x918183;else _0x27709c+='|'+_0x918183;}_0x4c814e[_0xfe68('0x1b')](_0x3ff003['id']+':'+_0x27709c);_0x1b54c2[_0x3ff003['id']]=0x1;}}}}if(hasAdditionalPhones){_0x42f833[_0xfe68('0x1b')]('\x22'+_0x4c814e[_0xfe68('0x12')](';')+'\x22');}if(_0x3d980b['length']){handleError(_0x3ca56f[_0xfe68('0x7c')][_0x2356d7],{'code':_0xfe68('0x8e'),'message':_0x3d980b[_0xfe68('0x12')]()});}else{fs[_0xfe68('0x8f')](_0xb66b63,_0x42f833['join']()+'\x0a');}_0x42f833=[];}if(!(stats[_0xfe68('0x7d')]%0xc8)){socket[_0xfe68('0x90')](_0xfe68('0x91')+_0x504b3a,stats);stats[_0xfe68('0x5a')]=[];}}if(stopped){logger[_0xfe68('0x56')](_0xfe68('0x92'));_0x21f7e9['abort']();}}catch(_0x28b201){handleError(_0x3ca56f[_0xfe68('0x7c')][_0x2356d7],{'code':'SystemError','message':_0x28b201[_0xfe68('0x58')]});logger[_0xfe68('0x57')](_0xfe68('0x93'),_0x28b201[_0xfe68('0x58')]);}},'complete':function(){try{var _0x196032=[];var _0x36f500=[];var _0x2b6caa=_0xfe68('0x37');if(_0x222c1a[_0xfe68('0x94')]&&_0x222c1a[_0xfe68('0x94')][_0xfe68('0x1a')]){_0x2b6caa=_0xfe68('0x95')+_0x504b3a;_0x196032[_0xfe68('0x1b')](_0xfe68('0x96')+_0x2b6caa+_0xfe68('0x97'));}tmp_campaigns='campaigns_'+_0x504b3a;tmp_voice_queues=_0xfe68('0x98')+_0x504b3a;_0x36f500[_0xfe68('0x1b')]('CREATE\x20TABLE\x20'+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x36f500[_0xfe68('0x1b')](_0xfe68('0x96')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0xfe68('0x99')](_0x36f500,handleTZQuery)[_0xfe68('0x19')](function(_0x128d81){updateTzCampaigns(_0x222c1a[_0xfe68('0x41')])['then'](function(_0x2b91a0){updateTzVoiceQueues(_0x222c1a[_0xfe68('0x41')])[_0xfe68('0x19')](function(_0x3be19d){if(hasTZ)_0x5a4511=_0x5a4511[_0xfe68('0x8d')](_0xfe68('0x6a'),_0xfe68('0x9a'));var _0x7bc8e7=util[_0xfe68('0xb')]('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',_0xb66b63,_0x2b6caa,_0x5a4511,_0x222c1a['ListId'],_0x222c1a[_0xfe68('0x52')]||null,NOW,NOW);if(_[_0xfe68('0x6b')](_0x346ba4[_0xfe68('0x30')])){_0x7bc8e7+=_0xfe68('0x9b');}_0x196032[_0xfe68('0x1b')](_0x7bc8e7);if(_0x222c1a[_0xfe68('0x94')]&&_0x222c1a[_0xfe68('0x94')][_0xfe68('0x1a')]){_0x196032[_0xfe68('0x1b')](insertCmContact(_0x222c1a[_0xfe68('0x41')],_0x2b6caa,_0x222c1a['duplicates'],_0x346ba4));_0x196032[_0xfe68('0x1b')](_0xfe68('0x9c')+_0x2b6caa+';');}BPromise[_0xfe68('0x99')](_0x196032,handleQuery)[_0xfe68('0x19')](function(_0x156ecb){BPromise[_0xfe68('0x1d')]([handleAdditionalPhones()])[_0xfe68('0x19')](function(){_0x196032=[];for(var _0x2b5501=0x0;_0x2b5501\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','binding','firstName','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','lodash','util','squel','ioredis','../../../config/environment/shared','../../../config/logger','import','redis','defaults','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','length','push','all','split','isNil','filter','CmContactHasItem','findOne','update','updated','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.updatedAt','insert','cm_hopper_black','ContactId','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.createdAt','cm_contacts.priority','priority','UserId','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId'];(function(_0x16c6ad,_0x1de5c8){var _0x3fdde6=function(_0x29ed1e){while(--_0x29ed1e){_0x16c6ad['push'](_0x16c6ad['shift']());}};_0x3fdde6(++_0x1de5c8);}(_0xa62e,0x114));var _0xea62=function(_0x394f2c,_0x5d4de7){_0x394f2c=_0x394f2c-0x0;var _0x134114=_0xa62e[_0x394f2c];return _0x134114;};'use strict';var fs=require('fs');var path=require(_0xea62('0x0'));var _=require(_0xea62('0x1'));var Papa=require('papaparse');var util=require(_0xea62('0x2'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0xea62('0x3'));var Redis=require(_0xea62('0x4'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var shared=require(_0xea62('0x5'));var logger=require(_0xea62('0x6'))(_0xea62('0x7'));config[_0xea62('0x8')]=_[_0xea62('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea62('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xea62('0xa')](_0xea62('0xb'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xea62('0xa')](_0xea62('0xb'));function isEmail(_0x42dbf9){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))*$/[_0xea62('0xc')](_0x42dbf9);}function selectNotIn(_0x2d854f,_0x40bd93,_0x29f91d,_0x102b2d,_0x5151e5){return squel[_0xea62('0xd')]()[_0xea62('0xe')](_0xea62('0xf'))[_0xea62('0x10')](_0x102b2d)[_0xea62('0x11')](_0x40bd93,null,_0x40bd93+_0xea62('0x12')+_0x102b2d+'.'+_0x29f91d)[_0xea62('0x13')](_0x102b2d+'.'+_0x29f91d+_0xea62('0x14')+_0x2d854f+'.'+_0x29f91d)[_0xea62('0x13')](_0x40bd93+_0xea62('0x15')+_0x5151e5['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4b3b79,_0x2823d3){promisesAdditionalPhones=[];return db[_0xea62('0x16')][_0xea62('0x17')]({'raw':!![],'attributes':['id',_0xea62('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xea62('0x19')](function(_0x315fb0){if(_0x315fb0!==null){var _0x3e0fa2=[];for(var _0x41d3a1=0x0;_0x41d3a1<_0x315fb0[_0xea62('0x1a')];_0x41d3a1++){var _0x3e9fa2=_0x315fb0[_0x41d3a1];_0x3e0fa2[_0xea62('0x1b')](insertAdditionalPhones(_0x3e9fa2));}}Promise[_0xea62('0x1c')](_0x3e0fa2)[_0xea62('0x19')](function(){_0x4b3b79({'val':0x1});});});});}function insertAdditionalPhones(_0x38e470){return new Promise(function(_0x46b017,_0x2f57cf){var _0x19eba2=_0x38e470[_0xea62('0x18')];var _0x514075=_0x19eba2[_0xea62('0x1d')](';');var _0x4e1a4a=[];orderBy=0x0;for(var _0x400fce=0x0;_0x400fce<_0x514075[_0xea62('0x1a')];_0x400fce++){_0x4e1a4a[_0xea62('0x1b')](splitAdditionalPhone(_0x38e470['id'],_0x514075[_0x400fce]));}Promise['all'](_0x4e1a4a)[_0xea62('0x19')](function(){_0x46b017({'val':_0x514075[_0xea62('0x1a')]});});});}function splitAdditionalPhone(_0x2e23a2,_0x263c9b){return new Promise(function(_0x1f5d8c,_0x3d1e3f){var _0x6761d7=_0x263c9b[_0xea62('0x1d')](':');var _0x35d00b=_0x6761d7[0x0];var _0x54e19e=_0x6761d7[0x1];if(!_[_0xea62('0x1e')](_0x54e19e)){var _0x3f551a=_0x54e19e[_0xea62('0x1d')]('|');var _0x6f1506=[];for(var _0x545545=0x0;_0x545545<_0x3f551a[_0xea62('0x1a')];_0x545545++){if(_0x3f551a[_0x545545]!==''){var _0x20427a=_[_0xea62('0x1f')](promisesAdditionalPhones,{'contactId':_0x2e23a2,'phone':_0x3f551a[_0x545545]});if(_0x20427a[_0xea62('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0xea62('0x1b')]({'contactId':_0x2e23a2,'contactTypeId':_0x35d00b,'phone':_0x3f551a[_0x545545],'orderBy':orderBy});}}}_0x1f5d8c({'ok':0x1});}else _0x1f5d8c({'res':0x0});});}function createAdditionalPhone(_0xb188bd,_0x151f2f,_0x5674aa,_0x49f3cf){var _0xbcf892='';var _0xdae6a5='';var _0x2e18fb=_0x5674aa[_0xea62('0x1d')]('§');_0xbcf892=_0x2e18fb[0x0];if(_0x2e18fb[_0xea62('0x1a')]==0x2)_0xdae6a5=_0x2e18fb[0x1];return new Promise(function(_0x8f7b51,_0x2d17ae){return db[_0xea62('0x20')][_0xea62('0x21')]({'where':{'CmContactId':_0xb188bd,'item':_0xbcf892}})[_0xea62('0x19')](function(_0x4fba30){if(_0x4fba30){return db[_0xea62('0x20')][_0xea62('0x22')]({'ItemTypeId':_0x151f2f,'description':_0xdae6a5,'OrderBy':_0x49f3cf},{'where':{'CmContactId':_0xb188bd,'item':_0xbcf892}})[_0xea62('0x19')](function(_0x5bceda){_0x8f7b51({'res':_0xea62('0x23')});});}else{return db['CmContactHasItem']['create']({'CmContactId':_0xb188bd,'item':_0xbcf892,'description':_0xdae6a5,'ItemTypeId':_0x151f2f,'OrderBy':_0x49f3cf,'ItemClass':'PHONE'})[_0xea62('0x19')](function(_0x38c601){_0x8f7b51({'res':_0xea62('0x24')});});}});});}function insertCmHopper(_0xffa270,_0x241979,_0x522d6d,_0x284391,_0x197f83){var _0x5238b3=[_0xea62('0x25'),_0xea62('0x26'),_0xea62('0x27'),_0xea62('0x28'),_0x241979+'.'+_0x284391,'cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority',_0xea62('0x29'),'\x22'+_0x197f83+'\x22'];return squel['insert']()[_0xea62('0x2a')](_0xea62('0x2b'))[_0xea62('0x2c')](['phone',_0xea62('0x2d'),'ContactId',_0xea62('0x2e'),_0x284391,_0xea62('0x2f'),_0xea62('0x30'),'priority','UserId',_0xea62('0x31')],squel[_0xea62('0xd')]()[_0xea62('0x32')](_0x5238b3)[_0xea62('0x10')](_0x241979)['join'](_0xea62('0x33'),null,_0xea62('0x34')+_0x241979+_0xea62('0x35'))['join'](_0x522d6d,null,_0x522d6d+_0xea62('0x12')+_0x241979+'.'+_0x284391)[_0xea62('0x13')](_0x241979+_0xea62('0x36'),_0xffa270)[_0xea62('0x13')](_0xea62('0x37'),NOW)['where'](_0xea62('0x38'),selectNotIn(_0x241979,_0x522d6d,_0x284391,_0xea62('0x2b'),[_0xea62('0x39'),_0xea62('0x3a')]))[_0xea62('0x13')](_0xea62('0x38'),selectNotIn(_0x241979,_0x522d6d,_0x284391,_0xea62('0x2b'),[_0xea62('0x39')])))[_0xea62('0x3b')]();}function insertCmHopperBlack(_0x8b540a,_0x188f98,_0x4b0f7b,_0x5f251d){var _0xb73fbb=[_0xea62('0x25'),'cm_contacts.id',_0xea62('0x28'),_0x188f98+'.'+_0x5f251d,'cm_contacts.createdAt',_0xea62('0x3c')];return squel[_0xea62('0x3d')]()[_0xea62('0x2a')](_0xea62('0x3e'))[_0xea62('0x2c')]([_0xea62('0xf'),_0xea62('0x3f'),_0xea62('0x2e'),_0x5f251d,_0xea62('0x2f'),'updatedAt'],squel[_0xea62('0xd')]()[_0xea62('0x32')](_0xb73fbb)[_0xea62('0x10')](_0x188f98)[_0xea62('0x11')]('cm_contacts',null,_0xea62('0x34')+_0x188f98+_0xea62('0x35'))[_0xea62('0x11')](_0x4b0f7b,null,_0x4b0f7b+_0xea62('0x12')+_0x188f98+'.'+_0x5f251d)[_0xea62('0x13')](_0x188f98+_0xea62('0x36'),_0x8b540a)[_0xea62('0x13')](_0xea62('0x37'),NOW)[_0xea62('0x13')](_0xea62('0x38'),squel[_0xea62('0xd')]()[_0xea62('0xe')](_0xea62('0xf'))['from'](_0xea62('0x3e'))[_0xea62('0x13')](_0xea62('0x40'),_0x8b540a)[_0xea62('0x13')](_0x5f251d+_0xea62('0x14')+_0x188f98+'.'+_0x5f251d)))[_0xea62('0x3b')]();}function insertTzCmHopper(_0x3b8d6c,_0x1530da,_0x3bf27f,_0x21976f,_0x3463ba,_0x54c9d2){var _0x244d74=[_0xea62('0x25'),_0xea62('0x41')+_0x54c9d2+_0xea62('0x42'),'cm_contacts.id',_0xea62('0x28'),_0x1530da+'.'+_0x21976f,_0xea62('0x43'),_0xea62('0x3c'),_0xea62('0x44'),_0xea62('0x29'),'\x22'+_0x3463ba+'\x22'];var _0x1cf6d9=squel[_0xea62('0x3d')]()[_0xea62('0x2a')](_0xea62('0x2b'))['fromQuery']([_0xea62('0xf'),_0xea62('0x2d'),_0xea62('0x3f'),_0xea62('0x2e'),_0x21976f,_0xea62('0x2f'),_0xea62('0x30'),_0xea62('0x45'),_0xea62('0x46'),_0xea62('0x31')],squel[_0xea62('0xd')]()[_0xea62('0x32')](_0x244d74)['from'](_0x1530da)[_0xea62('0x11')](_0xea62('0x33'),null,_0xea62('0x34')+_0x1530da+_0xea62('0x35'))[_0xea62('0x11')](_0x3bf27f,null,_0x3bf27f+_0xea62('0x12')+_0x1530da+'.'+_0x21976f)['join'](_0x54c9d2,null,_0x54c9d2+_0xea62('0x12')+_0x1530da+'.'+_0x21976f)['where'](_0x1530da+_0xea62('0x36'),_0x3b8d6c)['where'](_0xea62('0x37'),NOW)[_0xea62('0x13')](_0xea62('0x38'),selectNotIn(_0x1530da,_0x3bf27f,_0x21976f,_0xea62('0x2b'),[_0xea62('0x39'),_0xea62('0x3a')]))[_0xea62('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1530da,_0x3bf27f,_0x21976f,_0xea62('0x2b'),['\x22always\x22'])))[_0xea62('0x3b')]();return _0x1cf6d9;}function insertTzCmHopperBlack(_0x572bd1,_0x3f52a4,_0x40b88e,_0x569f36){var _0x3713c4=[_0xea62('0x25'),_0xea62('0x27'),_0xea62('0x28'),_0x3f52a4+'.'+_0x569f36,_0xea62('0x43'),_0xea62('0x3c')];return squel['insert']()['into'](_0xea62('0x3e'))['fromQuery']([_0xea62('0xf'),_0xea62('0x3f'),'ListId',_0x569f36,_0xea62('0x2f'),_0xea62('0x30')],squel[_0xea62('0xd')]()[_0xea62('0x32')](_0x3713c4)['from'](_0x3f52a4)[_0xea62('0x11')]('cm_contacts',null,_0xea62('0x34')+_0x3f52a4+'.CmListId')[_0xea62('0x11')](_0x40b88e,null,_0x40b88e+_0xea62('0x12')+_0x3f52a4+'.'+_0x569f36)[_0xea62('0x13')](_0x3f52a4+_0xea62('0x36'),_0x572bd1)[_0xea62('0x13')](_0xea62('0x37'),NOW)[_0xea62('0x13')](_0xea62('0x38'),squel[_0xea62('0xd')]()[_0xea62('0xe')]('phone')['from'](_0xea62('0x3e'))[_0xea62('0x13')](_0xea62('0x40'),_0x572bd1)[_0xea62('0x13')](_0x569f36+'\x20=\x20'+_0x3f52a4+'.'+_0x569f36)))['toString']();}function insertCmHopperAdditionalPhones(_0x3c52c7){var _0x273151=[_0xea62('0x47'),_0xea62('0x48'),'cm_contact_has_items.OrderBy',_0xea62('0x49'),'cm_contact_has_items.updatedAt'];return squel[_0xea62('0x3d')]()[_0xea62('0x2a')](_0xea62('0x4a'))[_0xea62('0x2c')]([_0xea62('0x4b'),_0xea62('0xf'),_0xea62('0x4c'),_0xea62('0x2f'),'updatedAt'],squel[_0xea62('0xd')]()[_0xea62('0x32')](_0x273151)[_0xea62('0x10')](_0xea62('0x2b'))[_0xea62('0x11')](_0xea62('0x33'),null,_0xea62('0x4d'))[_0xea62('0x11')](_0xea62('0x4e'),null,_0xea62('0x4f'))[_0xea62('0x13')](_0xea62('0x50'),_0x3c52c7)[_0xea62('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xea62('0x3b')]();}function insertCmContact(_0xe10ab0,_0x1c8821,_0x39f9bb,_0x1c08e2){var _0x2b45d5=_[_0xea62('0x51')](_['keys'](_0x1c08e2),[_0xea62('0x2e'),_0xea62('0x52'),_0xea62('0x2f'),'updatedAt',_0xea62('0x53')]);return squel[_0xea62('0x3d')]()[_0xea62('0x2a')]('cm_contacts')[_0xea62('0x2c')](_0x2b45d5,squel[_0xea62('0xd')]()['fields'](_0x2b45d5)['from'](_0x1c8821)['where']('('+_0x39f9bb[_0xea62('0x11')](',')+_0xea62('0x54'),squel[_0xea62('0xd')]()[_0xea62('0x32')](_0x39f9bb)[_0xea62('0x10')](_0xea62('0x33'))[_0xea62('0x13')](_0xea62('0x40'),_0xe10ab0)['where'](_0xea62('0x55')))[_0xea62('0x13')](_0xea62('0x56'),squel['select']()[_0xea62('0xe')](_0xea62('0x57'),_0xea62('0x58'))[_0xea62('0x10')](_0x1c8821)[_0xea62('0x59')](_0x39f9bb['join'](','))))[_0xea62('0x3b')]();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x5cba3f){logger['error'](_0x5cba3f[_0xea62('0x5a')]);process[_0xea62('0x5b')](0x1);}function handleError(_0x5163bf,_0x45e8c2){stats['errors'][_0xea62('0x1b')]({'name':_0x45e8c2[_0xea62('0x5c')],'message':_0x45e8c2[_0xea62('0x5a')],'row':_0x5163bf});}function handleQuery(_0x3f789c){logger['info'](_0x3f789c);return db[_0xea62('0x5d')][_0xea62('0x5e')](_0x3f789c)[_0xea62('0x5f')](function(_0x257649){results[_0xea62('0x1b')](_0x257649);})[_0xea62('0x60')](function(_0x4027af){logger[_0xea62('0x61')](_0x4027af[_0xea62('0x5a')]);});}function updateTzCampaigns(_0x222310){return new Promise(function(_0x4b2d70,_0x59e9aa){var _0x3ee4db=squel[_0xea62('0xd')]()[_0xea62('0x32')](['campaigns.id','campaigns.dialTimezone'])[_0xea62('0x10')](_0xea62('0x62'))['join'](_0xea62('0x63'),null,_0xea62('0x64'))[_0xea62('0x13')]('campaigns_has_cm_lists.CmListId='+_0x222310);db['sequelize'][_0xea62('0x5e')](_0x3ee4db['toString']())['spread'](function(_0x36aa39){var _0x5e6a2b=[];for(var _0x1e65e6=0x0;_0x1e65e6<_0x36aa39[_0xea62('0x1a')];_0x1e65e6++){_0x5e6a2b[_0xea62('0x1b')](getTimezoneData(_0x36aa39[_0x1e65e6],tmp_campaigns));}BPromise['all'](_0x5e6a2b)[_0xea62('0x19')](function(){_0x4b2d70({'val':0x1});});})[_0xea62('0x60')](function(_0xec225){logger[_0xea62('0x61')](_0xec225[_0xea62('0x5a')]);_0x4b2d70({'val':0x0});});});}function updateTzVoiceQueues(_0x5da20c){return new Promise(function(_0x53dfb6,_0x4ea8cf){var _0x394ff6=squel['select']()['fields']([_0xea62('0x65'),_0xea62('0x66')])['from'](_0xea62('0x67'))[_0xea62('0x11')]('voice_queues_has_cm_lists',null,_0xea62('0x68'))['where'](_0xea62('0x69')+_0x5da20c);db[_0xea62('0x5d')][_0xea62('0x5e')](_0x394ff6[_0xea62('0x3b')]())[_0xea62('0x5f')](function(_0x47fcad){var _0x12948b=[];for(var _0x4703bf=0x0;_0x4703bf<_0x47fcad[_0xea62('0x1a')];_0x4703bf++){_0x12948b[_0xea62('0x1b')](getTimezoneData(_0x47fcad[_0x4703bf],tmp_voice_queues));}BPromise[_0xea62('0x1c')](_0x12948b)['then'](function(){_0x53dfb6({'val':0x1});});})['catch'](function(_0x23b7fa){logger[_0xea62('0x61')](_0x23b7fa[_0xea62('0x5a')]);_0x53dfb6({'val':0x0});});});}function getTimezoneData(_0x19c536,_0x59583b){return new Promise(function(_0x40c566,_0x20f5b4){var _0x346bf5=shared[_0xea62('0x6a')];var _0x41e600=_0x346bf5[_0x19c536[_0xea62('0x6b')]];if(_['isNil'](_0x41e600)){_0x40c566({'ret':0x1});}else{var _0x48919f=_0x41e600['utcOffset'];var _0x39c696=squel['insert']()[_0xea62('0x2a')](_0x59583b)[_0xea62('0x6c')]('id',_0x19c536['id'])[_0xea62('0x6c')]('offset',_0x48919f)[_0xea62('0x6c')]('dialTimezone',_0x19c536[_0xea62('0x6b')])[_0xea62('0x3b')]();return db[_0xea62('0x5d')][_0xea62('0x5e')](_0x39c696)[_0xea62('0x5f')](function(_0x418585){_0x40c566({'ret':0x1});})[_0xea62('0x60')](function(_0x160bfb){logger[_0xea62('0x61')](_0x160bfb[_0xea62('0x5a')]);_0x20f5b4({'ret':0x1});});}});}function handleTZQuery(_0x2901a8){logger[_0xea62('0x6d')](_0x2901a8);return db[_0xea62('0x5d')]['query'](_0x2901a8)[_0xea62('0x5f')](function(_0x5ebca6){})['catch'](function(_0x3df131){logger[_0xea62('0x61')](_0x3df131[_0xea62('0x5a')]);});}function main(_0x204b7d,_0x1743e5,_0x2ce380,_0x50d044){logger[_0xea62('0x6d')](_0xea62('0x6e'),_0x204b7d,JSON['stringify'](_0x1743e5));process[_0xea62('0x6f')]('start');var _0x17ebc8=_0x1743e5['binding'];var _0x19ce47=_[_0xea62('0x70')](_0x17ebc8);var _0x185cd0=_0x1743e5[_0xea62('0x71')];var _0x47ccac=path[_0xea62('0x11')](config['root'],_0xea62('0x72'),_0x185cd0+_0xea62('0x73'));hasTZ=_['keys'](_0x17ebc8)[_0xea62('0x74')](_0xea62('0x6b'));var _0x3319ca=_[_0xea62('0x75')](_0x17ebc8)[_0xea62('0x11')]();logger[_0xea62('0x6d')]('header',_0x3319ca);db[_0xea62('0x76')]['findAll']({'raw':!![],'attributes':['id',_0xea62('0x77')]})['then'](function(_0x52d2f1){for(var _0x318fac=0x0;_0x318fac<_0x52d2f1[_0xea62('0x1a')];_0x318fac++){if(_0x52d2f1[_0x318fac][_0xea62('0x77')]in _0x17ebc8){contactItemTypes[_0xea62('0x1b')](_0x52d2f1[_0x318fac]);delete _0x19ce47[_0x52d2f1[_0x318fac]['name']];hasAdditionalPhones=!![];}for(var _0x93d842 in _0x17ebc8){if(_0x52d2f1[_0x318fac][_0xea62('0x77')]+_0xea62('0x78')===_0x93d842){phoneDescriptions['push']({'itemTypeId':_0x52d2f1[_0x318fac]['id'],'description':_0x93d842});delete _0x19ce47[_0x93d842];}}}if(hasAdditionalPhones)_0x19ce47[_0xea62('0x18')]='';var _0x39ab08=_[_0xea62('0x75')](_0x19ce47)['join']();logger[_0xea62('0x6d')](_0xea62('0x79'),_0x39ab08);fs[_0xea62('0x7a')](_0x47ccac,_0x39ab08+'\x0a');Papa['parse'](fs['createReadStream'](_0x204b7d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x13a78e,_0x9591ff){try{for(var _0x23e3b9=0x0,_0x39a8f8=[];_0x23e3b9<_0x13a78e[_0xea62('0x7b')]['length'];_0x23e3b9++){stats[_0xea62('0x7c')]+=0x1;if(_0x13a78e['errors'][_0x23e3b9]){handleError(_0x13a78e[_0xea62('0x7b')][_0x23e3b9],_0x13a78e[_0xea62('0x7d')][_0x23e3b9]);}else{var _0x409c91=[];var _0x57ce0a=[];var _0x1f306d={};for(var _0x1cedf7 in _0x17ebc8){let _0x3c37a7=contactItemTypes[_0xea62('0x7e')](_0x13f618=>_0x13f618[_0xea62('0x77')]===_0x1cedf7);let _0x37c4ec=contactItemTypes[_0xea62('0x7e')](_0x271bd9=>_0x271bd9[_0xea62('0x77')]+_0xea62('0x78')===_0x1cedf7);if(_['isNil'](_0x3c37a7)&&_[_0xea62('0x1e')](_0x37c4ec)){if(_0x17ebc8[_0xea62('0x7f')](_0x1cedf7)){if(_0x13a78e[_0xea62('0x7b')][_0x23e3b9][_0x17ebc8[_0x1cedf7]]){var _0x48610d=_['trim'](_0x13a78e[_0xea62('0x7b')][_0x23e3b9][_0x17ebc8[_0x1cedf7]][_0xea62('0x80')](/"/g,'\x27'));switch(_0x1cedf7){case _0xea62('0x2d'):var _0x214cf0=moment(_0x48610d,_0xea62('0xb'),!![]);if(_0x214cf0['isValid']()){_0x39a8f8['push']('\x22'+_0x48610d+'\x22');}else{_0x409c91['push'](_0xea62('0x81'));}break;case _0xea62('0x45'):var _0xffe890=parseInt(_0x48610d);_0x48610d=_[_0xea62('0x82')](_0xffe890)||_0xffe890<0x0||_0xffe890>0x4?_0x50d044?0x3:0x2:_0xffe890;_0x39a8f8['push']('\x22'+_0x48610d+'\x22');break;case _0xea62('0x46'):var _0x3a61f9=parseInt(_0x48610d);if(_['isNumber'](_0x3a61f9)&&_[_0xea62('0x74')](_0x2ce380,_0x3a61f9)){_0x39a8f8[_0xea62('0x1b')]('\x22'+_0x3a61f9+'\x22');}else{_0x409c91[_0xea62('0x1b')](_0xea62('0x83'));}break;case'email':if(isEmail(_0x48610d)){_0x39a8f8[_0xea62('0x1b')]('\x22'+_0x48610d+'\x22');}else{_0x409c91[_0xea62('0x1b')](_0xea62('0x84'));}break;case _0xea62('0x85'):var _0x5e9548=moment(_0x48610d,_0xea62('0x86'),!![]);if(_0x5e9548['isValid']()){_0x39a8f8[_0xea62('0x1b')]('\x22'+_0x48610d+'\x22');}else{_0x409c91[_0xea62('0x1b')](_0xea62('0x87'));}break;case'dialTimezone':var _0x2086c7=shared[_0xea62('0x6a')];var _0x414cd0=_0x2086c7[_0x48610d];if(!_[_0xea62('0x1e')](_0x414cd0)){var _0x284397=_0x414cd0[_0xea62('0x88')];_0x39a8f8[_0xea62('0x1b')]('\x22'+_0x48610d+'\x22');_0x39a8f8[_0xea62('0x1b')]('\x22'+_0x284397+'\x22');}break;default:_0x39a8f8[_0xea62('0x1b')]('\x22'+_0x48610d+'\x22');}}else{switch(_0x1cedf7){case'firstName':case _0xea62('0xf'):_0x409c91[_0xea62('0x1b')](_0x1cedf7+'\x20not\x20specified');break;default:_0x39a8f8['push']('\x22\x22');}}}}else{var _0x511e7d='';if(!_[_0xea62('0x1e')](_0x3c37a7)){if(!_0x1f306d[_0xea62('0x7f')](_0x3c37a7['id'])){if(!_[_0xea62('0x1e')](_0x13a78e[_0xea62('0x7b')][_0x23e3b9][_0x17ebc8[_0x1cedf7]])){var _0x48610d=_[_0xea62('0x89')](_0x13a78e[_0xea62('0x7b')][_0x23e3b9][_0x17ebc8[_0x1cedf7]][_0xea62('0x80')](/"/g,'\x27'));var _0x5a1922=phoneDescriptions[_0xea62('0x7e')](_0x471c69=>_0x471c69[_0xea62('0x8a')]===_0x3c37a7['id']);if(!_['isNil'](_0x5a1922)){var _0x524c4e=_[_0xea62('0x89')](_0x13a78e[_0xea62('0x7b')][_0x23e3b9][_0x17ebc8[_0x5a1922['description']]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x524c4e))_0x48610d=_0x48610d+'§'+_0x524c4e;}if(_0x511e7d=='')_0x511e7d=_0x48610d;else _0x511e7d+='|'+_0x48610d;}_0x57ce0a[_0xea62('0x1b')](_0x3c37a7['id']+':'+_0x511e7d);_0x1f306d[_0x3c37a7['id']]=0x1;}}}}if(hasAdditionalPhones){_0x39a8f8[_0xea62('0x1b')]('\x22'+_0x57ce0a['join'](';')+'\x22');}if(_0x409c91['length']){handleError(_0x13a78e[_0xea62('0x7b')][_0x23e3b9],{'code':_0xea62('0x8b'),'message':_0x409c91[_0xea62('0x11')]()});}else{fs['appendFileSync'](_0x47ccac,_0x39a8f8[_0xea62('0x11')]()+'\x0a');}_0x39a8f8=[];}if(!(stats[_0xea62('0x7c')]%0xc8)){socket['emit'](_0xea62('0x8c')+_0x185cd0,stats);stats[_0xea62('0x7d')]=[];}}if(stopped){logger[_0xea62('0x6d')]('Abort\x20parser');_0x9591ff['abort']();}}catch(_0x52d10c){handleError(_0x13a78e[_0xea62('0x7b')][_0x23e3b9],{'code':_0xea62('0x8d'),'message':_0x52d10c[_0xea62('0x5a')]});logger[_0xea62('0x61')]('step',_0x52d10c['message']);}},'complete':function(){try{var _0x29e60d=[];var _0x3653f3=[];var _0x27e8d8=_0xea62('0x33');if(_0x1743e5['duplicates']&&_0x1743e5[_0xea62('0x8e')][_0xea62('0x1a')]){_0x27e8d8='cm_contacts_'+_0x185cd0;_0x29e60d[_0xea62('0x1b')](_0xea62('0x8f')+_0x27e8d8+_0xea62('0x90'));}tmp_campaigns=_0xea62('0x91')+_0x185cd0;tmp_voice_queues='voice_queues_'+_0x185cd0;_0x3653f3[_0xea62('0x1b')](_0xea62('0x8f')+tmp_campaigns+_0xea62('0x92'));_0x3653f3['push'](_0xea62('0x8f')+tmp_voice_queues+_0xea62('0x92'));BPromise[_0xea62('0x93')](_0x3653f3,handleTZQuery)[_0xea62('0x19')](function(_0x357a0a){updateTzCampaigns(_0x1743e5['ListId'])[_0xea62('0x19')](function(_0x1d421c){updateTzVoiceQueues(_0x1743e5[_0xea62('0x2e')])['then'](function(_0x7c5cc){if(hasTZ)_0x39ab08=_0x39ab08[_0xea62('0x80')](_0xea62('0x6b'),_0xea62('0x94'));var _0x79c0cf=util[_0xea62('0xa')](_0xea62('0x95'),_0x47ccac,_0x27e8d8,_0x39ab08,_0x1743e5[_0xea62('0x2e')],_0x1743e5[_0xea62('0x52')]||null,NOW,NOW);if(_[_0xea62('0x1e')](_0x17ebc8['scheduledat'])){_0x79c0cf+=_0xea62('0x96');}_0x29e60d[_0xea62('0x1b')](_0x79c0cf);if(_0x1743e5['duplicates']&&_0x1743e5[_0xea62('0x8e')][_0xea62('0x1a')]){_0x29e60d[_0xea62('0x1b')](insertCmContact(_0x1743e5[_0xea62('0x2e')],_0x27e8d8,_0x1743e5[_0xea62('0x8e')],_0x17ebc8));_0x29e60d[_0xea62('0x1b')](_0xea62('0x97')+_0x27e8d8+';');}BPromise[_0xea62('0x93')](_0x29e60d,handleQuery)[_0xea62('0x19')](function(_0x934ceb){BPromise[_0xea62('0x1c')]([handleAdditionalPhones()])['then'](function(){_0x29e60d=[];for(var _0xcd95d6=0x0;_0xcd95d6\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','squel','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','format','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','then','catch','error','split','findOne','CmContactHasItem','updated','create','PHONE','inserted','CmContact','CmHopper','update','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','ContactId','ListId','priority','UserId','recallme','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','toString','cm_hopper_black','createdAt','fields','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','insert','fromQuery','CmHopperId','OrderBy','updatedAt','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','ListId\x20=\x20?','id\x20IN\x20?','info','Received\x20SIGINT','message','exit','errors','code','query','stringify','send','start','binding','clone','socket_timestamp','server/files/tmp','.csv','body','ContactItemType','name','_description','header','writeFileSync','parse','createReadStream','rows','data','find','hasOwnProperty','trim','replace','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isValid','isNaN','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','firstName','\x20not\x20specified','description','SystemRow','appendFileSync','Abort\x20parser','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','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()','each','contactId','contactTypeId','DROP\x20TABLE\x20'];(function(_0x299e3c,_0x8ace29){var _0x2eab48=function(_0xf7699e){while(--_0xf7699e){_0x299e3c['push'](_0x299e3c['shift']());}};_0x2eab48(++_0x8ace29);}(_0x9652,0xaf));var _0x2965=function(_0x33a73b,_0x2d367f){_0x33a73b=_0x33a73b-0x0;var _0x30527e=_0x9652[_0x33a73b];return _0x30527e;};'use strict';var fs=require('fs');var path=require(_0x2965('0x0'));var _=require(_0x2965('0x1'));var Papa=require('papaparse');var util=require(_0x2965('0x2'));var BPromise=require(_0x2965('0x3'));var moment=require(_0x2965('0x4'));var squel=require(_0x2965('0x5'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0x2965('0x6'));var logger=require(_0x2965('0x7'))('import');config['redis']=_['defaults'](config[_0x2965('0x8')],{'host':_0x2965('0x9'),'port':0x18eb});var socket=require(_0x2965('0xa'))(new Redis(config[_0x2965('0x8')]));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()[_0x2965('0xb')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x2965('0xc')+moment()[_0x2965('0xb')](_0x2965('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x2fdf5b){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))*$/[_0x2965('0xe')](_0x2fdf5b);}function selectNotIn(_0x504f29,_0x2f1ec6,_0x88a581,_0x53bd0f,_0x1ff227){return squel[_0x2965('0xf')]()[_0x2965('0x10')](_0x2965('0x11'))[_0x2965('0x12')](_0x53bd0f)[_0x2965('0x13')](_0x2f1ec6,null,_0x2f1ec6+_0x2965('0x14')+_0x53bd0f+'.'+_0x88a581)['where'](_0x53bd0f+'.'+_0x88a581+_0x2965('0x15')+_0x504f29+'.'+_0x88a581)[_0x2965('0x16')](_0x2f1ec6+_0x2965('0x17')+_0x1ff227[_0x2965('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1474bc,_0x38a39c){promisesAdditionalPhones=[];promisesContact=[];return db[_0x2965('0x18')]['query'](_0x2965('0x19')+tempTableName)[_0x2965('0x1a')](function(_0x563ff5){if(_0x563ff5!==null){var _0x1547d0=[];for(var _0x3d043c=0x0;_0x3d043c<_0x563ff5[_0x2965('0x1b')];_0x3d043c++){var _0x1e2599=_0x563ff5[_0x3d043c];if(!_[_0x2965('0x1c')](_0x1e2599[_0x2965('0x11')])){if(!_[_0x2965('0x1c')](_0x1e2599[_0x2965('0x1d')]))_0x1547d0[_0x2965('0x1e')](insertAdditionalPhones(_0x1e2599));promisesContact[_0x2965('0x1e')]({'contact':_0x1e2599});}}}Promise[_0x2965('0x1f')](_0x1547d0)[_0x2965('0x20')](function(){_0x1474bc({'val':0x1});});})[_0x2965('0x21')](function(_0xfb9c36){logger[_0x2965('0x22')](_0xfb9c36['message']);});});}function insertAdditionalPhones(_0x3a7c9e){return new Promise(function(_0x3b619c,_0x3110a8){var _0x4a0617=_0x3a7c9e[_0x2965('0x1d')];if(_['isNil'](_0x4a0617))_0x3110a8({'val':0x0});else{var _0x26eb01=_0x4a0617[_0x2965('0x23')](';');var _0x3e3e2b=[];orderBy=0x0;for(var _0x2f2776=0x0;_0x2f2776<_0x26eb01[_0x2965('0x1b')];_0x2f2776++){_0x3e3e2b[_0x2965('0x1e')](splitAdditionalPhone(_0x3a7c9e['id'],_0x26eb01[_0x2f2776]));}Promise[_0x2965('0x1f')](_0x3e3e2b)[_0x2965('0x20')](function(){_0x3b619c({'val':_0x26eb01['length']});});}});}function splitAdditionalPhone(_0xe0ae17,_0x25043a){return new Promise(function(_0x56a0f4,_0x13b03b){var _0x44fc11=_0x25043a[_0x2965('0x23')](':');var _0x365c98=_0x44fc11[0x0];var _0x39e4e2=_0x44fc11[0x1];if(_0x39e4e2!==''){var _0x5f58af=_0x39e4e2[_0x2965('0x23')]('|');var _0x1fe71e=[];for(var _0x22c67b=0x0;_0x22c67b<_0x5f58af[_0x2965('0x1b')];_0x22c67b++){if(_0x5f58af[_0x22c67b]!==''){var _0x8800c4=_['filter'](promisesAdditionalPhones,{'contactId':_0xe0ae17,'phone':_0x5f58af[_0x22c67b]});if(_0x8800c4[_0x2965('0x1b')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0xe0ae17,'contactTypeId':_0x365c98,'phone':_0x5f58af[_0x22c67b],'orderBy':orderBy});}}}_0x56a0f4({'ok':0x1});}else _0x56a0f4({'res':0x0});});}function createAdditionalPhone(_0x1b98d4,_0x2d680f,_0x300b57,_0x3f7f45){var _0x469f22='';var _0x3356ee='';var _0xb03de0=_0x300b57[_0x2965('0x23')]('§');_0x469f22=_0xb03de0[0x0];if(_0xb03de0[_0x2965('0x1b')]==0x2)_0x3356ee=_0xb03de0[0x1];return new Promise(function(_0x3d6b3a,_0x174099){return db['CmContactHasItem'][_0x2965('0x24')]({'where':{'CmContactId':_0x1b98d4,'item':_0x469f22}})['then'](function(_0x5a28a7){if(_0x5a28a7){return db[_0x2965('0x25')]['update']({'ItemTypeId':_0x2d680f,'description':_0x3356ee,'OrderBy':_0x3f7f45},{'where':{'CmContactId':_0x1b98d4,'item':_0x469f22}})[_0x2965('0x20')](function(_0x1705d3){_0x3d6b3a({'res':_0x2965('0x26')});});}else{return db[_0x2965('0x25')][_0x2965('0x27')]({'CmContactId':_0x1b98d4,'item':_0x469f22,'ItemTypeId':_0x2d680f,'description':_0x3356ee,'OrderBy':_0x3f7f45,'ItemClass':_0x2965('0x28')})['then'](function(_0x126681){_0x3d6b3a({'res':_0x2965('0x29')});});}});});}function updateContact(_0x8ed836){return new Promise(function(_0x713d99,_0x300eaf){var _0xfa7d0a=_0x8ed836['id'];delete _0x8ed836['id'];return db[_0x2965('0x2a')]['update'](_0x8ed836,{'where':{'id':_0xfa7d0a}})[_0x2965('0x20')](function(_0x3dc2b3){updatedRows+=0x1;return db[_0x2965('0x2b')][_0x2965('0x2c')]({'phone':_0x8ed836['phone']},{'where':{'ContactId':_0xfa7d0a}})[_0x2965('0x20')](function(_0x441272){_0x713d99({'ret':'OK'});});});});}function insertCmHopper(_0x3b6447,_0xc8415f,_0x45b271,_0x27975c,_0x58d9e9){var _0x208294=['cm_contacts.phone','cm_contacts.scheduledat',_0x2965('0x2d'),_0x2965('0x2e'),_0xc8415f+'.'+_0x27975c,_0x2965('0x2f'),_0x2965('0x30'),_0x2965('0x31'),_0x2965('0x32'),'\x22'+_0x58d9e9+'\x22'];return squel['insert']()[_0x2965('0x33')](_0x2965('0x34'))['fromQuery']([_0x2965('0x11'),'scheduledat',_0x2965('0x35'),_0x2965('0x36'),_0x27975c,'createdAt','updatedAt',_0x2965('0x37'),_0x2965('0x38'),_0x2965('0x39')],squel[_0x2965('0xf')]()['fields'](_0x208294)[_0x2965('0x12')](_0xc8415f)['join'](_0x2965('0x3a'),null,'cm_contacts.ListId\x20=\x20'+_0xc8415f+_0x2965('0x3b'))[_0x2965('0x13')](_0x45b271,null,_0x45b271+_0x2965('0x14')+_0xc8415f+'.'+_0x27975c)[_0x2965('0x16')](_0xc8415f+_0x2965('0x3c'),_0x3b6447)[_0x2965('0x16')](_0x2965('0x3d'),NOW)[_0x2965('0x16')](_0x2965('0x3e'),selectNotIn(_0xc8415f,_0x45b271,_0x27975c,_0x2965('0x34'),['\x22always\x22',_0x2965('0x3f')]))[_0x2965('0x16')](_0x2965('0x3e'),selectNotIn(_0xc8415f,_0x45b271,_0x27975c,_0x2965('0x34'),['\x22always\x22'])))[_0x2965('0x40')]();}function insertCmHopperBlack(_0x49afe4,_0x7cfc15,_0xc730da,_0x432cf3){var _0x5939a6=['cm_contacts.phone',_0x2965('0x2d'),_0x2965('0x2e'),_0x7cfc15+'.'+_0x432cf3,'cm_contacts.createdAt',_0x2965('0x30')];return squel['insert']()[_0x2965('0x33')](_0x2965('0x41'))['fromQuery']([_0x2965('0x11'),_0x2965('0x35'),_0x2965('0x36'),_0x432cf3,_0x2965('0x42'),'updatedAt'],squel['select']()[_0x2965('0x43')](_0x5939a6)[_0x2965('0x12')](_0x7cfc15)['join'](_0x2965('0x3a'),null,'cm_contacts.ListId\x20=\x20'+_0x7cfc15+_0x2965('0x3b'))[_0x2965('0x13')](_0xc730da,null,_0xc730da+_0x2965('0x14')+_0x7cfc15+'.'+_0x432cf3)['where'](_0x7cfc15+_0x2965('0x3c'),_0x49afe4)['where'](_0x2965('0x3d'),NOW)[_0x2965('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x2965('0x11'))[_0x2965('0x12')](_0x2965('0x41'))[_0x2965('0x16')]('ListId\x20=\x20?',_0x49afe4)['where'](_0x432cf3+_0x2965('0x44'),_0x7cfc15+'.'+_0x432cf3)))[_0x2965('0x40')]();}function insertCmHopperAdditionalPhones(_0x3dbcfa){var _0x400e5d=[_0x2965('0x45'),_0x2965('0x46'),'cm_contact_has_items.OrderBy',_0x2965('0x47'),_0x2965('0x48')];return squel[_0x2965('0x49')]()['into']('cm_hopper_additional_phones')[_0x2965('0x4a')]([_0x2965('0x4b'),_0x2965('0x11'),_0x2965('0x4c'),_0x2965('0x42'),_0x2965('0x4d')],squel[_0x2965('0xf')]()['fields'](_0x400e5d)[_0x2965('0x12')](_0x2965('0x34'))[_0x2965('0x13')](_0x2965('0x3a'),null,_0x2965('0x4e'))[_0x2965('0x13')](_0x2965('0x4f'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0x2965('0x50'),_0x3dbcfa)[_0x2965('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW))['toString']();}function insertCmContact(_0x4e4bcd,_0xdfce71,_0x4d878b,_0x388c35){var _0x3a3a98=_[_0x2965('0x51')](_[_0x2965('0x52')](_0x388c35),[_0x2965('0x36'),_0x2965('0x53'),'createdAt',_0x2965('0x4d')]);return squel[_0x2965('0x49')]()['into'](_0x2965('0x3a'))[_0x2965('0x4a')](_0x3a3a98,squel[_0x2965('0xf')]()[_0x2965('0x43')](_0x3a3a98)[_0x2965('0x12')](_0xdfce71)[_0x2965('0x16')]('('+_0x4d878b[_0x2965('0x13')](',')+')\x20NOT\x20IN\x20?',squel[_0x2965('0xf')]()[_0x2965('0x43')](_0x4d878b)['from']('cm_contacts')[_0x2965('0x16')](_0x2965('0x54'),_0x4e4bcd))['where'](_0x2965('0x55'),squel[_0x2965('0xf')]()[_0x2965('0x10')]('MIN(id)','min_id')[_0x2965('0x12')](_0xdfce71)['group'](_0x4d878b[_0x2965('0x13')](','))))['toString']();}function handleStop(){logger[_0x2965('0x56')](_0x2965('0x57'));stopped=!![];}function handleUncaughtException(_0x301c81){logger[_0x2965('0x22')](_0x301c81[_0x2965('0x58')]);process[_0x2965('0x59')](0x1);}function handleError(_0x1199aa,_0x4d6255){stats[_0x2965('0x5a')]['push']({'name':_0x4d6255[_0x2965('0x5b')],'message':_0x4d6255[_0x2965('0x58')],'row':_0x1199aa});}function handleQuery(_0x16f527){logger[_0x2965('0x56')](_0x16f527);return db['sequelize'][_0x2965('0x5c')](_0x16f527)[_0x2965('0x1a')](function(_0x6a7d0a){results['push'](_0x6a7d0a);})[_0x2965('0x21')](function(_0x2d07c9){logger[_0x2965('0x22')](_0x2d07c9[_0x2965('0x58')]);});}function main(_0x2f18d1,_0x52e75e,_0x498a3f,_0x5c5d16){logger[_0x2965('0x56')]('main',_0x2f18d1,JSON[_0x2965('0x5d')](_0x52e75e));process[_0x2965('0x5e')](_0x2965('0x5f'));var _0xbb9c79=_0x52e75e[_0x2965('0x60')];var _0x2b5620=_[_0x2965('0x61')](_0xbb9c79);var _0x55b766=_0x52e75e[_0x2965('0x62')];var _0x36c16a=path[_0x2965('0x13')](config['root'],_0x2965('0x63'),_0x55b766+_0x2965('0x64'));logger[_0x2965('0x56')](_0x2965('0x65'),_0x52e75e);db[_0x2965('0x66')]['findAll']({'raw':!![],'attributes':['id','name']})[_0x2965('0x20')](function(_0x11bd14){for(var _0x45d8b1=0x0;_0x45d8b1<_0x11bd14['length'];_0x45d8b1++){if(_0x11bd14[_0x45d8b1][_0x2965('0x67')]in _0xbb9c79){contactItemTypes['push'](_0x11bd14[_0x45d8b1]);delete _0x2b5620[_0x11bd14[_0x45d8b1][_0x2965('0x67')]];hasAdditionalPhones=!![];}for(var _0x5df6a4 in _0xbb9c79){if(_0x11bd14[_0x45d8b1][_0x2965('0x67')]+_0x2965('0x68')===_0x5df6a4){phoneDescriptions[_0x2965('0x1e')]({'itemTypeId':_0x11bd14[_0x45d8b1]['id'],'description':_0x5df6a4});delete _0x2b5620[_0x5df6a4];}}}if(hasAdditionalPhones)_0x2b5620[_0x2965('0x1d')]='';var _0x2c5e37=_['keys'](_0x2b5620)[_0x2965('0x13')]();logger[_0x2965('0x56')](_0x2965('0x69'),_0x2c5e37);fs[_0x2965('0x6a')](_0x36c16a,_0x2c5e37+'\x0a');Papa[_0x2965('0x6b')](fs[_0x2965('0x6c')](_0x2f18d1),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3ef500,_0x31e898){try{for(var _0x385469=0x0,_0x22cc3d=[];_0x385469<_0x3ef500['data'][_0x2965('0x1b')];_0x385469++){stats[_0x2965('0x6d')]+=0x1;if(_0x3ef500[_0x2965('0x5a')][_0x385469]){handleError(_0x3ef500[_0x2965('0x6e')][_0x385469],_0x3ef500[_0x2965('0x5a')][_0x385469]);}else{var _0x49c0a3=[];var _0x376922=[];var _0x391173={};for(var _0x3d8151 in _0xbb9c79){let _0x105f60=contactItemTypes[_0x2965('0x6f')](_0x3857ad=>_0x3857ad[_0x2965('0x67')]===_0x3d8151);let _0x9e954e=contactItemTypes['find'](_0x260961=>_0x260961[_0x2965('0x67')]+'_description'===_0x3d8151);if(_['isNil'](_0x105f60)&&_['isNil'](_0x9e954e)){if(_0xbb9c79[_0x2965('0x70')](_0x3d8151)){if(_0x3ef500[_0x2965('0x6e')][_0x385469][_0xbb9c79[_0x3d8151]]){var _0x5cf548=_[_0x2965('0x71')](_0x3ef500[_0x2965('0x6e')][_0x385469][_0xbb9c79[_0x3d8151]][_0x2965('0x72')](/"/g,'\x27'));switch(_0x3d8151){case _0x2965('0x73'):var _0x5f743a=moment(_0x5cf548,_0x2965('0x74'),!![]);if(_0x5f743a[_0x2965('0x75')]()){_0x22cc3d[_0x2965('0x1e')]('\x22'+_0x5cf548+'\x22');}else{_0x49c0a3[_0x2965('0x1e')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x5f2c4f=parseInt(_0x5cf548);_0x5cf548=_[_0x2965('0x76')](_0x5f2c4f)||_0x5f2c4f<0x0||_0x5f2c4f>0x4?_0x5c5d16?0x3:0x2:_0x5f2c4f;_0x22cc3d[_0x2965('0x1e')]('\x22'+_0x5cf548+'\x22');break;case'UserId':var _0x56f2f2=parseInt(_0x5cf548);if(_['isNumber'](_0x56f2f2)&&_[_0x2965('0x77')](_0x498a3f,_0x56f2f2)){_0x22cc3d[_0x2965('0x1e')]('\x22'+_0x56f2f2+'\x22');}else{_0x49c0a3[_0x2965('0x1e')](_0x2965('0x78'));}break;case _0x2965('0x79'):if(isEmail(_0x5cf548)){_0x22cc3d[_0x2965('0x1e')]('\x22'+_0x5cf548+'\x22');}else{_0x49c0a3['push'](_0x2965('0x7a'));}break;case _0x2965('0x7b'):var _0x21170f=moment(_0x5cf548,'YYYY-MM-DD',!![]);if(_0x21170f[_0x2965('0x75')]()){_0x22cc3d[_0x2965('0x1e')]('\x22'+_0x5cf548+'\x22');}else{_0x49c0a3[_0x2965('0x1e')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x22cc3d[_0x2965('0x1e')]('\x22'+_0x5cf548+'\x22');}}else{switch(_0x3d8151){case _0x2965('0x7c'):case _0x2965('0x11'):_0x49c0a3[_0x2965('0x1e')](_0x3d8151+_0x2965('0x7d'));break;default:_0x22cc3d['push']('\x22\x22');}}}}else{var _0x446f4a='';if(!_[_0x2965('0x1c')](_0x105f60)){if(!_0x391173[_0x2965('0x70')](_0x105f60['id'])){for(var _0xa7b4c4=0x0;_0xa7b4c4<_0xbb9c79[_0x3d8151][_0x2965('0x1b')];_0xa7b4c4++){var _0x5cf548=_[_0x2965('0x71')](_0x3ef500[_0x2965('0x6e')][_0x385469][_0xbb9c79[_0x3d8151][_0xa7b4c4]]['replace'](/"/g,'\x27'));var _0xccfed9=phoneDescriptions['find'](_0x1de39d=>_0x1de39d['itemTypeId']===_0x105f60['id']);if(!_[_0x2965('0x1c')](_0xccfed9)){var _0x503c20=_[_0x2965('0x71')](_0x3ef500[_0x2965('0x6e')][_0x385469][_0xbb9c79[_0xccfed9[_0x2965('0x7e')]][0x0]][_0x2965('0x72')](/"/g,'\x27'));if(!_[_0x2965('0x1c')](_0x503c20))_0x5cf548=_0x5cf548+'§'+_0x503c20;}if(_0x446f4a=='')_0x446f4a=_0x5cf548;else _0x446f4a+='|'+_0x5cf548;}_0x376922['push'](_0x105f60['id']+':'+_0x446f4a);_0x391173[_0x105f60['id']]=0x1;}}}}if(hasAdditionalPhones){_0x22cc3d[_0x2965('0x1e')]('\x22'+_0x376922[_0x2965('0x13')](';')+'\x22');}if(_0x49c0a3['length']){handleError(_0x3ef500[_0x2965('0x6e')][_0x385469],{'code':_0x2965('0x7f'),'message':_0x49c0a3[_0x2965('0x13')]()});}else{fs[_0x2965('0x80')](_0x36c16a,_0x22cc3d[_0x2965('0x13')]()+'\x0a');}_0x22cc3d=[];}if(!(stats[_0x2965('0x6d')]%0xc8)){socket['emit']('contact:import:'+_0x55b766,stats);stats[_0x2965('0x5a')]=[];}}if(stopped){logger[_0x2965('0x56')](_0x2965('0x81'));_0x31e898['abort']();}}catch(_0x331dfa){handleError(_0x3ef500[_0x2965('0x6e')][_0x385469],{'code':_0x2965('0x82'),'message':_0x331dfa[_0x2965('0x58')]});logger['error'](_0x2965('0x83'),_0x331dfa[_0x2965('0x58')]);}},'complete':function(){try{var _0x2f2739=[];var _0x333208=tempTableName;_0x2f2739[_0x2965('0x1e')](_0x2965('0x84')+_0x333208+_0x2965('0x85'));logger[_0x2965('0x56')](_0x2965('0x86'),contactItemTypes[_0x2965('0x1b')]);var _0x192d3a=util['format'](_0x2965('0x87'),_0x36c16a,_0x333208,_0x2c5e37,_0x52e75e[_0x2965('0x36')],_0x52e75e[_0x2965('0x53')]||null,NOW,NOW);if(_[_0x2965('0x1c')](_0xbb9c79[_0x2965('0x73')])){_0x192d3a+=_0x2965('0x88');}_0x2f2739[_0x2965('0x1e')](_0x192d3a);BPromise[_0x2965('0x89')](_0x2f2739,handleQuery)[_0x2965('0x20')](function(_0x342938){BPromise[_0x2965('0x1f')]([handleAdditionalPhones()])[_0x2965('0x20')](function(){_0x2f2739=[];for(var _0x201e21=0x0;_0x201e21_0x55f6fe[_0x3ed0('0x62')]===_0xc394c5);let _0x4ee35b=contactItemTypes[_0x3ed0('0x6a')](_0x2ca7ff=>_0x2ca7ff[_0x3ed0('0x62')]+_0x3ed0('0x63')===_0xc394c5);if(_['isNil'](_0x39f7ad)&&_[_0x3ed0('0x1b')](_0x4ee35b)){if(_0x5af4e1[_0x3ed0('0x6b')](_0xc394c5)){if(_0x4235d8[_0x3ed0('0x68')][_0x585a08][_0x5af4e1[_0xc394c5]]){var _0x505549=_['trim'](_0x4235d8[_0x3ed0('0x68')][_0x585a08][_0x5af4e1[_0xc394c5]][_0x3ed0('0x6c')](/"/g,'\x27'));switch(_0xc394c5){case _0x3ed0('0x33'):var _0x51f697=moment(_0x505549,_0x3ed0('0xc'),!![]);if(_0x51f697[_0x3ed0('0x6d')]()){_0x1fd8ca[_0x3ed0('0x1c')]('\x22'+_0x505549+'\x22');}else{_0x5ce6ba[_0x3ed0('0x1c')](_0x3ed0('0x6e'));}break;case _0x3ed0('0x36'):var _0x84cf70=parseInt(_0x505549);_0x505549=_[_0x3ed0('0x6f')](_0x84cf70)||_0x84cf70<0x0||_0x84cf70>0x4?_0x590a3c?0x3:0x2:_0x84cf70;_0x1fd8ca[_0x3ed0('0x1c')]('\x22'+_0x505549+'\x22');break;case _0x3ed0('0x37'):var _0x5780cf=parseInt(_0x505549);if(_[_0x3ed0('0x70')](_0x5780cf)&&_[_0x3ed0('0x71')](_0x47b626,_0x5780cf)){_0x1fd8ca[_0x3ed0('0x1c')]('\x22'+_0x5780cf+'\x22');}else{_0x5ce6ba[_0x3ed0('0x1c')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x505549)){_0x1fd8ca[_0x3ed0('0x1c')]('\x22'+_0x505549+'\x22');}else{_0x5ce6ba[_0x3ed0('0x1c')](_0x3ed0('0x72'));}break;case'dateOfBirth':var _0x3e4b29=moment(_0x505549,_0x3ed0('0x73'),!![]);if(_0x3e4b29['isValid']()){_0x1fd8ca['push']('\x22'+_0x505549+'\x22');}else{_0x5ce6ba[_0x3ed0('0x1c')](_0x3ed0('0x74'));}break;default:_0x1fd8ca[_0x3ed0('0x1c')]('\x22'+_0x505549+'\x22');}}else{switch(_0xc394c5){case _0x3ed0('0x75'):case _0x3ed0('0x10'):_0x5ce6ba[_0x3ed0('0x1c')](_0xc394c5+_0x3ed0('0x76'));break;default:_0x1fd8ca['push']('\x22\x22');}}}}else{var _0x53f4d0='';if(!_[_0x3ed0('0x1b')](_0x39f7ad)){if(!_0x3de405['hasOwnProperty'](_0x39f7ad['id'])){for(var _0x5e565d=0x0;_0x5e565d<_0x5af4e1[_0xc394c5][_0x3ed0('0x1a')];_0x5e565d++){var _0x505549=_[_0x3ed0('0x77')](_0x4235d8[_0x3ed0('0x68')][_0x585a08][_0x5af4e1[_0xc394c5][_0x5e565d]]['replace'](/"/g,'\x27'));var _0x1f31e6=phoneDescriptions['find'](_0x444859=>_0x444859['itemTypeId']===_0x39f7ad['id']);if(!_['isNil'](_0x1f31e6)){var _0x362d03=_[_0x3ed0('0x77')](_0x4235d8[_0x3ed0('0x68')][_0x585a08][_0x5af4e1[_0x1f31e6[_0x3ed0('0x78')]][0x0]][_0x3ed0('0x6c')](/"/g,'\x27'));if(!_['isNil'](_0x362d03))_0x505549=_0x505549+'§'+_0x362d03;}if(_0x53f4d0=='')_0x53f4d0=_0x505549;else _0x53f4d0+='|'+_0x505549;}_0x17c1a2['push'](_0x39f7ad['id']+':'+_0x53f4d0);_0x3de405[_0x39f7ad['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1fd8ca[_0x3ed0('0x1c')]('\x22'+_0x17c1a2['join'](';')+'\x22');}if(_0x5ce6ba[_0x3ed0('0x1a')]){handleError(_0x4235d8['data'][_0x585a08],{'code':_0x3ed0('0x79'),'message':_0x5ce6ba['join']()});}else{fs[_0x3ed0('0x7a')](_0x4d92fe,_0x1fd8ca[_0x3ed0('0x12')]()+'\x0a');}_0x1fd8ca=[];}if(!(stats[_0x3ed0('0x69')]%0xc8)){socket[_0x3ed0('0x7b')](_0x3ed0('0x7c')+_0x779e61,stats);stats[_0x3ed0('0x59')]=[];}}if(stopped){logger[_0x3ed0('0x56')]('Abort\x20parser');_0x321702['abort']();}}catch(_0x2e60a5){handleError(_0x4235d8[_0x3ed0('0x68')][_0x585a08],{'code':_0x3ed0('0x7d'),'message':_0x2e60a5[_0x3ed0('0x20')]});logger['error']('step',_0x2e60a5[_0x3ed0('0x20')]);}},'complete':function(){try{var _0x300e0c=[];var _0x5a387e=tempTableName;_0x300e0c[_0x3ed0('0x1c')](_0x3ed0('0x7e')+_0x5a387e+_0x3ed0('0x7f'));logger[_0x3ed0('0x56')]('CIS\x20len',contactItemTypes[_0x3ed0('0x1a')]);var _0x11fc67=util[_0x3ed0('0xb')]('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',_0x4d92fe,_0x5a387e,_0x24acea,_0x383358[_0x3ed0('0x43')],_0x383358[_0x3ed0('0x52')]||null,NOW,NOW);if(_[_0x3ed0('0x1b')](_0x5af4e1[_0x3ed0('0x33')])){_0x11fc67+=_0x3ed0('0x80');}_0x300e0c[_0x3ed0('0x1c')](_0x11fc67);BPromise[_0x3ed0('0x81')](_0x300e0c,handleQuery)[_0x3ed0('0x1e')](function(_0x506f71){BPromise[_0x3ed0('0x1d')]([handleAdditionalPhones()])['then'](function(){_0x300e0c=[];for(var _0x2845ff=0x0;_0x2845ff\x20\x20');}var _0x431ff7=path['join'](config['root'],_0x3ed0('0x5e'),process[_0x3ed0('0x8c')][0x2]);if(!fs[_0x3ed0('0x8d')](_0x431ff7)){throw new Error(_0x3ed0('0x8e'));}var _0x176911={};try{_0x176911=JSON[_0x3ed0('0x66')](process[_0x3ed0('0x8c')][0x3]);if(!_0x176911[_0x3ed0('0x5d')]){throw new Error('binding\x20doesn\x27t\x20exists');}var _0x48a176=0x0;if(_0x176911[_0x3ed0('0x5d')]['UserId']){_0x48a176=0x1;}if(!_0x176911[_0x3ed0('0x43')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x5b92f2){throw new Error(_0x3ed0('0x8f'));}var _0x44a78e=[];try{_0x44a78e=_[_0x3ed0('0x90')](JSON[_0x3ed0('0x66')](process['argv'][0x4]),'id');}catch(_0x16837d){logger[_0x3ed0('0x56')](_0x3ed0('0x91'));}main(_0x431ff7,_0x176911,_0x44a78e,_0x48a176);}validate();process['on'](_0x3ed0('0x92'),handleStop);process['on'](_0x3ed0('0x93'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index ce775a5..6313525 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5932=['agentcalledAt','Agent\x20Complete','agentcompleteAt','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','duration','getSubjects','[xCALLY\x20Ticket]','toLowerCase','push','variable','outbound','destcalleridnum','getDescriptions','voice','inbound','string','***\x20Call\x20Info\x20***','keyValue','calleridnum','Caller\x20Name','calleridname','Call\x20To','destexten','UniqueId','uniqueid','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***'];(function(_0x42a636,_0x5a4cd8){var _0x2be55d=function(_0x321125){while(--_0x321125){_0x42a636['push'](_0x42a636['shift']());}};_0x2be55d(++_0x5a4cd8);}(_0x5932,0xd8));var _0x2593=function(_0x4d7edc,_0x3869d8){_0x4d7edc=_0x4d7edc-0x0;var _0x5cddf9=_0x5932[_0x4d7edc];return _0x5cddf9;};'use strict';exports[_0x2593('0x0')]=function(_0x5d1bbf,_0x3481c7){var _0xf26de2=[{'type':'string','content':_0x2593('0x1'),'variableName':null}];switch(_0x5d1bbf[_0x2593('0x2')]()){case'voice':switch(_0x3481c7[_0x2593('0x2')]()){case'inbound':_0xf26de2[_0x2593('0x3')]({'type':_0x2593('0x4'),'content':'','variableName':'queue'});_0xf26de2[_0x2593('0x3')]({'type':_0x2593('0x4'),'content':'','variableName':'calleridnum'});break;case _0x2593('0x5'):_0xf26de2[_0x2593('0x3')]({'type':'string','content':'Outbound\x20Call','variableName':null});_0xf26de2[_0x2593('0x3')]({'type':_0x2593('0x4'),'content':'','variableName':_0x2593('0x6')});break;}}return _0xf26de2;};exports[_0x2593('0x7')]=function(_0x28d69d,_0x47737c){var _0x181b72=[];switch(_0x28d69d[_0x2593('0x2')]()){case _0x2593('0x8'):switch(_0x47737c[_0x2593('0x2')]()){case _0x2593('0x9'):_0x181b72=[{'type':_0x2593('0xa'),'content':_0x2593('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0x2593('0xc'),'content':'','key':'Caller\x20Number','keyType':'variable','variableName':_0x2593('0xd')},{'type':_0x2593('0xc'),'content':'','key':_0x2593('0xe'),'keyType':_0x2593('0x4'),'variableName':_0x2593('0xf')},{'type':_0x2593('0xc'),'content':'','key':_0x2593('0x10'),'keyType':_0x2593('0x4'),'variableName':_0x2593('0x11')},{'type':_0x2593('0xc'),'content':'','key':'Queue','keyType':'variable','variableName':'queue'},{'type':_0x2593('0xc'),'content':'','key':_0x2593('0x12'),'keyType':'variable','variableName':_0x2593('0x13')},{'type':_0x2593('0xc'),'content':'','key':'Date','keyType':_0x2593('0x4'),'variableName':'agentcalledAt'},{'type':_0x2593('0xa'),'content':_0x2593('0x14'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':_0x2593('0x4'),'variableName':_0x2593('0x15')},{'type':'keyValue','content':'','key':_0x2593('0x16'),'keyType':_0x2593('0x4'),'variableName':_0x2593('0x6')},{'type':_0x2593('0xa'),'content':_0x2593('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x2593('0xc'),'content':'','key':'Agent\x20Ring','keyType':_0x2593('0x4'),'variableName':_0x2593('0x18')},{'type':_0x2593('0xc'),'content':'','key':'Agent\x20Connect','keyType':_0x2593('0x4'),'variableName':'agentconnectAt'},{'type':'keyValue','content':'','key':_0x2593('0x19'),'keyType':_0x2593('0x4'),'variableName':_0x2593('0x1a')},{'type':_0x2593('0xc'),'content':'','key':'Hold\x20Time','keyType':'variable','variableName':_0x2593('0x1b')},{'type':_0x2593('0xc'),'content':'','key':_0x2593('0x1c'),'keyType':'variable','variableName':_0x2593('0x1d')}];break;case _0x2593('0x5'):_0x181b72=[{'type':_0x2593('0xa'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x2593('0xc'),'content':'','key':_0x2593('0x1e'),'keyType':'variable','keyContent':'','variableName':_0x2593('0x6')},{'type':_0x2593('0xc'),'content':'','key':_0x2593('0x1f'),'keyType':_0x2593('0x4'),'keyContent':'','variableName':_0x2593('0x20')},{'type':_0x2593('0xc'),'content':'','key':'UniqueId','keyType':_0x2593('0x4'),'keyContent':'','variableName':'uniqueid'},{'type':_0x2593('0xc'),'content':'','key':_0x2593('0x21'),'keyType':'variable','keyContent':'','variableName':_0x2593('0x22')},{'type':_0x2593('0xa'),'content':_0x2593('0x17')},{'type':_0x2593('0xc'),'content':'','key':_0x2593('0x23'),'keyType':'variable','keyContent':'','variableName':_0x2593('0x24')},{'type':_0x2593('0xc'),'content':'','key':_0x2593('0x25'),'keyType':_0x2593('0x4'),'keyContent':'','variableName':_0x2593('0x26')},{'type':_0x2593('0xc'),'content':'','key':'Duration','keyType':_0x2593('0x4'),'keyContent':'','variableName':_0x2593('0x27')},{'type':_0x2593('0xc'),'content':'','key':'Billable\x20Time','keyType':_0x2593('0x4'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x181b72;}; \ No newline at end of file +var _0x9d02=['***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','talktime','outbound','Called\x20Number','Member\x20Name','membername','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','variable','calleridnum','Outbound\x20Call','destcalleridnum','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','Call\x20To','destexten','Queue','queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number'];(function(_0x5ca8fe,_0x5ab430){var _0x1095df=function(_0x352c17){while(--_0x352c17){_0x5ca8fe['push'](_0x5ca8fe['shift']());}};_0x1095df(++_0x5ab430);}(_0x9d02,0x127));var _0x29d0=function(_0x1e7002,_0x1cd53b){_0x1e7002=_0x1e7002-0x0;var _0x506c2a=_0x9d02[_0x1e7002];return _0x506c2a;};'use strict';exports[_0x29d0('0x0')]=function(_0x323597,_0xd34b7b){var _0x1d375b=[{'type':_0x29d0('0x1'),'content':_0x29d0('0x2'),'variableName':null}];switch(_0x323597[_0x29d0('0x3')]()){case _0x29d0('0x4'):switch(_0xd34b7b[_0x29d0('0x3')]()){case'inbound':_0x1d375b[_0x29d0('0x5')]({'type':_0x29d0('0x6'),'content':'','variableName':'queue'});_0x1d375b[_0x29d0('0x5')]({'type':_0x29d0('0x6'),'content':'','variableName':_0x29d0('0x7')});break;case'outbound':_0x1d375b[_0x29d0('0x5')]({'type':'string','content':_0x29d0('0x8'),'variableName':null});_0x1d375b[_0x29d0('0x5')]({'type':_0x29d0('0x6'),'content':'','variableName':_0x29d0('0x9')});break;}}return _0x1d375b;};exports['getDescriptions']=function(_0x12285b,_0x224c65){var _0x45d7f6=[];switch(_0x12285b[_0x29d0('0x3')]()){case _0x29d0('0x4'):switch(_0x224c65[_0x29d0('0x3')]()){case _0x29d0('0xa'):_0x45d7f6=[{'type':_0x29d0('0x1'),'content':_0x29d0('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0x29d0('0xc'),'content':'','key':_0x29d0('0xd'),'keyType':_0x29d0('0x6'),'variableName':_0x29d0('0x7')},{'type':_0x29d0('0xc'),'content':'','key':_0x29d0('0xe'),'keyType':_0x29d0('0x6'),'variableName':'calleridname'},{'type':_0x29d0('0xc'),'content':'','key':_0x29d0('0xf'),'keyType':_0x29d0('0x6'),'variableName':_0x29d0('0x10')},{'type':_0x29d0('0xc'),'content':'','key':_0x29d0('0x11'),'keyType':_0x29d0('0x6'),'variableName':_0x29d0('0x12')},{'type':_0x29d0('0xc'),'content':'','key':_0x29d0('0x13'),'keyType':'variable','variableName':_0x29d0('0x14')},{'type':'keyValue','content':'','key':_0x29d0('0x15'),'keyType':_0x29d0('0x6'),'variableName':_0x29d0('0x16')},{'type':_0x29d0('0x1'),'content':_0x29d0('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x29d0('0xc'),'content':'','key':_0x29d0('0x18'),'keyType':_0x29d0('0x6'),'variableName':_0x29d0('0x19')},{'type':_0x29d0('0xc'),'content':'','key':_0x29d0('0x1a'),'keyType':_0x29d0('0x6'),'variableName':_0x29d0('0x9')},{'type':'string','content':_0x29d0('0x1b'),'key':null,'keyType':null,'variableName':null},{'type':_0x29d0('0xc'),'content':'','key':'Agent\x20Ring','keyType':_0x29d0('0x6'),'variableName':_0x29d0('0x16')},{'type':_0x29d0('0xc'),'content':'','key':_0x29d0('0x1c'),'keyType':'variable','variableName':_0x29d0('0x1d')},{'type':_0x29d0('0xc'),'content':'','key':_0x29d0('0x1e'),'keyType':_0x29d0('0x6'),'variableName':_0x29d0('0x1f')},{'type':_0x29d0('0xc'),'content':'','key':'Hold\x20Time','keyType':_0x29d0('0x6'),'variableName':_0x29d0('0x20')},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':'variable','variableName':_0x29d0('0x21')}];break;case _0x29d0('0x22'):_0x45d7f6=[{'type':_0x29d0('0x1'),'content':_0x29d0('0xb'),'variableName':null},{'type':_0x29d0('0xc'),'content':'','key':_0x29d0('0x23'),'keyType':'variable','keyContent':'','variableName':_0x29d0('0x9')},{'type':_0x29d0('0xc'),'content':'','key':_0x29d0('0x24'),'keyType':_0x29d0('0x6'),'keyContent':'','variableName':_0x29d0('0x25')},{'type':_0x29d0('0xc'),'content':'','key':_0x29d0('0x13'),'keyType':_0x29d0('0x6'),'keyContent':'','variableName':_0x29d0('0x14')},{'type':_0x29d0('0xc'),'content':'','key':'Date','keyType':'variable','keyContent':'','variableName':'starttime'},{'type':'string','content':'***\x20Time\x20Info\x20***'},{'type':_0x29d0('0xc'),'content':'','key':_0x29d0('0x26'),'keyType':'variable','keyContent':'','variableName':_0x29d0('0x27')},{'type':_0x29d0('0xc'),'content':'','key':_0x29d0('0x28'),'keyType':'variable','keyContent':'','variableName':_0x29d0('0x29')},{'type':_0x29d0('0xc'),'content':'','key':_0x29d0('0x2a'),'keyType':_0x29d0('0x6'),'keyContent':'','variableName':_0x29d0('0x2b')},{'type':_0x29d0('0xc'),'content':'','key':_0x29d0('0x2c'),'keyType':'variable','keyContent':'','variableName':_0x29d0('0x2d')}];break;}}return _0x45d7f6;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 7784598..de8be0d 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca99=['catch','tracked','query','omit','html','phone','fax','mobile','updateUser','lodash','./sql-utils','./utils','findAll','skipInteractionsQuery','resolve','getInteractionsQuery','then','search','parseQueryParameters','where','contact','fields','filter','user','having','read','tags','checkAccountsRestrictions','group','i.id','countFilteredInteractions','count','length','order','forEach','contactName','DESC','closed','getClosedOrderClause','getFilteredInteractions','rows'];(function(_0x6fd957,_0x35f4d4){var _0x2e87a2=function(_0x223074){while(--_0x223074){_0x6fd957['push'](_0x6fd957['shift']());}};_0x2e87a2(++_0x35f4d4);}(_0xca99,0x151));var _0x9ca9=function(_0x1b3b6c,_0x4f6f96){_0x1b3b6c=_0x1b3b6c-0x0;var _0x32947d=_0xca99[_0x1b3b6c];return _0x32947d;};'use strict';var _=require(_0x9ca9('0x0'));var sqlUtils=require(_0x9ca9('0x1'));var utils=require(_0x9ca9('0x2'));exports[_0x9ca9('0x3')]=function(_0x2e8799,_0x16b777,_0x53ab65,_0x12ef24,_0x223d22){var _0x1d08b6={'count':0x0,'rows':[]};var _0x14825a=sqlUtils[_0x9ca9('0x4')](_0x2e8799,_0x53ab65,_0x16b777);if(_0x14825a){return Promise[_0x9ca9('0x5')](_0x1d08b6);}var _0x56b920=sqlUtils[_0x9ca9('0x6')](_0x2e8799);var _0x35688e={};return Promise[_0x9ca9('0x5')]()[_0x9ca9('0x7')](function(){if(_0x16b777[_0x9ca9('0x8')]){return sqlUtils['parseAdvancedSearchFilter'](_0x16b777[_0x9ca9('0x8')],_0x223d22);}else{return sqlUtils[_0x9ca9('0x9')](_0x2e8799,_0x16b777,_0x223d22);}})[_0x9ca9('0x7')](function(_0xd19c32){_0x56b920[_0x9ca9('0xa')](_0xd19c32['body']);_0x56b920[_0x9ca9('0xa')](_0xd19c32[_0x9ca9('0xb')]);_0x56b920[_0x9ca9('0xa')](_0xd19c32['default']);_0x56b920['where'](_0xd19c32[_0x9ca9('0xc')]);_0x56b920[_0x9ca9('0xa')](_0xd19c32[_0x9ca9('0xd')]);_0x56b920[_0x9ca9('0xa')](_0xd19c32[_0x9ca9('0xe')]);_0x56b920[_0x9ca9('0xf')](_0xd19c32[_0x9ca9('0x10')]);_0x35688e=_0xd19c32[_0x9ca9('0x11')];return sqlUtils[_0x9ca9('0x12')](_0x2e8799,_0x53ab65,_0x16b777);})[_0x9ca9('0x7')](function(_0x1a5e7f){_0x56b920[_0x9ca9('0xa')](_0x1a5e7f);_0x56b920[_0x9ca9('0x13')](_0x9ca9('0x14'));var _0x3cd62b=_0x16b777[_0x9ca9('0x8')]?_0x35688e['ids']:_0x16b777['tag'];return sqlUtils[_0x9ca9('0x15')](_0x56b920,_0x3cd62b);})[_0x9ca9('0x7')](function(_0x29fda4){_0x1d08b6[_0x9ca9('0x16')]=_0x29fda4[_0x9ca9('0x17')];if(_0x1d08b6[_0x9ca9('0x16')]===0x0){return[];}_0x56b920[_0x9ca9('0xf')](_0x35688e['clause']);if(_0x12ef24[_0x9ca9('0x18')]){_0x12ef24[_0x9ca9('0x18')][_0x9ca9('0x19')](function(_0x1e62a5){var _0x34d4a0=_0x1e62a5[0x0]===_0x9ca9('0x1a')?_0x1e62a5[0x0]:'i.'+_0x1e62a5[0x0];_0x56b920[_0x9ca9('0x18')](_0x34d4a0,_0x1e62a5[0x1]===_0x9ca9('0x1b')?![]:!![]);if(_0x1e62a5[0x0]===_0x9ca9('0x1c')){var _0x4249ed=sqlUtils[_0x9ca9('0x1d')](_0x2e8799,_0x16b777);_0x56b920[_0x9ca9('0x18')](_0x4249ed,_0x1e62a5[0x1]===_0x9ca9('0x1b')?![]:!![]);}});}return sqlUtils[_0x9ca9('0x1e')](_0x2e8799,_0x56b920,_0x16b777,_0x12ef24);})[_0x9ca9('0x7')](function(_0x3ca2e0){_0x1d08b6[_0x9ca9('0x1f')]=_0x3ca2e0;return _0x1d08b6;})[_0x9ca9('0x20')](function(_0x250ab5){throw _0x250ab5;});};exports[_0x9ca9('0x21')]=function(_0x48c7eb,_0x4cd4eb){return function(_0x51e6e7,_0x44a9a2,_0x1b66db){var _0x5f1c3e=_0x51e6e7['user'];var _0x51eedc={};var _0x13e8eb=_0x51e6e7[_0x9ca9('0x22')];if(_0x51eedc){_0x51eedc=_['clone'](_0x51e6e7['body']);_0x51eedc=_[_0x9ca9('0x23')](_0x51eedc,['body',_0x9ca9('0x24'),_0x9ca9('0x25'),_0x9ca9('0x26'),_0x9ca9('0x27')]);}utils[_0x9ca9('0x28')](_0x5f1c3e,_0x51eedc,_0x13e8eb,_0x48c7eb,_0x4cd4eb);_0x1b66db(null);};}; \ No newline at end of file +var _0x04b7=['ids','tag','countFilteredInteractions','count','length','clause','order','forEach','contactName','DESC','closed','getClosedOrderClause','getFilteredInteractions','rows','catch','tracked','query','clone','body','omit','fax','mobile','updateUser','lodash','findAll','skipInteractionsQuery','resolve','getInteractionsQuery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','user','having','read','tags','checkAccountsRestrictions','group','i.id'];(function(_0x4d208f,_0x1730e8){var _0x4e2d22=function(_0x167577){while(--_0x167577){_0x4d208f['push'](_0x4d208f['shift']());}};_0x4e2d22(++_0x1730e8);}(_0x04b7,0x1bb));var _0x704b=function(_0x33c3d3,_0x51eed3){_0x33c3d3=_0x33c3d3-0x0;var _0xf3a17f=_0x04b7[_0x33c3d3];return _0xf3a17f;};'use strict';var _=require(_0x704b('0x0'));var sqlUtils=require('./sql-utils');var utils=require('./utils');exports[_0x704b('0x1')]=function(_0x226411,_0x38d73e,_0x344f0b,_0x4ec5e4,_0x2112e8){var _0xc704ea={'count':0x0,'rows':[]};var _0x5ed083=sqlUtils[_0x704b('0x2')](_0x226411,_0x344f0b,_0x38d73e);if(_0x5ed083){return Promise[_0x704b('0x3')](_0xc704ea);}var _0x352031=sqlUtils[_0x704b('0x4')](_0x226411);var _0x13305a={};return Promise['resolve']()[_0x704b('0x5')](function(){if(_0x38d73e[_0x704b('0x6')]){return sqlUtils[_0x704b('0x7')](_0x38d73e['search'],_0x2112e8);}else{return sqlUtils[_0x704b('0x8')](_0x226411,_0x38d73e,_0x2112e8);}})[_0x704b('0x5')](function(_0x185bcc){_0x352031[_0x704b('0x9')](_0x185bcc['body']);_0x352031[_0x704b('0x9')](_0x185bcc['contact']);_0x352031[_0x704b('0x9')](_0x185bcc[_0x704b('0xa')]);_0x352031[_0x704b('0x9')](_0x185bcc[_0x704b('0xb')]);_0x352031[_0x704b('0x9')](_0x185bcc['filter']);_0x352031['where'](_0x185bcc[_0x704b('0xc')]);_0x352031[_0x704b('0xd')](_0x185bcc[_0x704b('0xe')]);_0x13305a=_0x185bcc[_0x704b('0xf')];return sqlUtils[_0x704b('0x10')](_0x226411,_0x344f0b,_0x38d73e);})['then'](function(_0x4e7989){_0x352031[_0x704b('0x9')](_0x4e7989);_0x352031[_0x704b('0x11')](_0x704b('0x12'));var _0x3953bc=_0x38d73e[_0x704b('0x6')]?_0x13305a[_0x704b('0x13')]:_0x38d73e[_0x704b('0x14')];return sqlUtils[_0x704b('0x15')](_0x352031,_0x3953bc);})[_0x704b('0x5')](function(_0xe6e939){_0xc704ea[_0x704b('0x16')]=_0xe6e939[_0x704b('0x17')];if(_0xc704ea[_0x704b('0x16')]===0x0){return[];}_0x352031[_0x704b('0xd')](_0x13305a[_0x704b('0x18')]);if(_0x4ec5e4[_0x704b('0x19')]){_0x4ec5e4[_0x704b('0x19')][_0x704b('0x1a')](function(_0x1a5b74){var _0x1e0380=_0x1a5b74[0x0]===_0x704b('0x1b')?_0x1a5b74[0x0]:'i.'+_0x1a5b74[0x0];_0x352031[_0x704b('0x19')](_0x1e0380,_0x1a5b74[0x1]===_0x704b('0x1c')?![]:!![]);if(_0x1a5b74[0x0]===_0x704b('0x1d')){var _0x52cef8=sqlUtils[_0x704b('0x1e')](_0x226411,_0x38d73e);_0x352031[_0x704b('0x19')](_0x52cef8,_0x1a5b74[0x1]===_0x704b('0x1c')?![]:!![]);}});}return sqlUtils[_0x704b('0x1f')](_0x226411,_0x352031,_0x38d73e,_0x4ec5e4);})[_0x704b('0x5')](function(_0x121cfa){_0xc704ea[_0x704b('0x20')]=_0x121cfa;return _0xc704ea;})[_0x704b('0x21')](function(_0x3d9c10){throw _0x3d9c10;});};exports[_0x704b('0x22')]=function(_0x1a397f,_0x1f85f1){return function(_0x34dfe3,_0xd010f,_0x56e931){var _0x339e8d=_0x34dfe3[_0x704b('0xc')];var _0x242d96={};var _0x21a7ea=_0x34dfe3[_0x704b('0x23')];if(_0x242d96){_0x242d96=_[_0x704b('0x24')](_0x34dfe3[_0x704b('0x25')]);_0x242d96=_[_0x704b('0x26')](_0x242d96,[_0x704b('0x25'),'html','phone',_0x704b('0x27'),_0x704b('0x28')]);}utils[_0x704b('0x29')](_0x339e8d,_0x242d96,_0x21a7ea,_0x1a397f,_0x1f85f1);_0x56e931(null);};}; \ No newline at end of file diff --git a/server/components/interaction/sql-utils.js b/server/components/interaction/sql-utils.js index acbde4f..c2409b6 100644 --- a/server/components/interaction/sql-utils.js +++ b/server/components/interaction/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6713=['openchannel','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','parseSearch','sqlOperator','conditions','find','buildExpression','type','default','text','value','start','end','unreadMessages','read','and','operator','contact','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','Tag','split','tags','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','plainBody','body','keys','some','forEach','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','then','fields','tag','clause','get','chat','Websites','Accounts','resolve','search','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','capitalize','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','Account.mandatoryDisposition','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','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.ContactId','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.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','TagIds','limit','offset','groupBy','Setting','findOne','enableEmailPreview','clone','isEmpty','t.id\x20IN\x20?','exports','lodash','squel','../parsers/qs','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','select','field','name','getInteractionFK','user_has_','_interactions','u.fullname','ui.','from','left_join','users','length','where','\x20IN\x20?','map','interactions','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','tools_tags','t.id\x20=\x20it.TagId','expr','getSelectedTags','unreadMessages\x20{OPERATOR}\x200','replace','isNumeric','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x6713,0x6d));var _0x3671=function(_0x1aba25,_0x1faed1){_0x1aba25=_0x1aba25-0x0;var _0x47d997=_0x6713[_0x1aba25];return _0x47d997;};'use strict';var _=require(_0x3671('0x0'));var squel=require(_0x3671('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x3671('0x2'));var updateInteraction=require(_0x3671('0x3'))[_0x3671('0x4')];var utils=require(_0x3671('0x5'));var db=require(_0x3671('0x6'))['db'];function skipInteractionsQuery(_0x430b3b,_0x38f4f1,_0x467b09){var _0x354112=![];var _0xe4eedd=utils[_0x3671('0x7')](_0x430b3b);if(_0x38f4f1[_0x3671('0x8')]===_0x3671('0x9')&&!_0x467b09['search']&&!_0x467b09[_0xe4eedd]){_0x354112=!![];}return _0x354112;}function getTagsQuery(){return squel[_0x3671('0xa')]()['field']('id')[_0x3671('0xb')](_0x3671('0xc'))['field']('color')['from']('tools_tags');}function getUsersQuery(_0x5b8677,_0x6cee84){var _0x58be2e=utils[_0x3671('0xd')](_0x5b8677);var _0x29e27d=_0x3671('0xe')+_0x5b8677+_0x3671('0xf');var _0x2deb9b=squel['select']()[_0x3671('0xb')]('u.id')[_0x3671('0xb')](_0x3671('0x10'))['field'](_0x3671('0x11')+_0x58be2e)[_0x3671('0x12')](_0x29e27d,'ui')[_0x3671('0x13')](_0x3671('0x14'),'u','u.id\x20=\x20ui.UserId');if(_0x6cee84[_0x3671('0x15')]>0x0){_0x2deb9b[_0x3671('0x16')](_0x3671('0x11')+_0x58be2e+_0x3671('0x17'),_[_0x3671('0x18')](_0x6cee84,'id'));}return _0x2deb9b;}function getInteractionsQuery(_0x39771a){var _0x5d6fa6=utils['getInteractionsTables'](_0x39771a);var _0x4e5dd7=utils[_0x3671('0x7')](_0x39771a);var _0x1cd862=utils['getInteractionFK'](_0x39771a);return squel[_0x3671('0xa')]()[_0x3671('0x12')](_0x5d6fa6[_0x3671('0x19')],'i')[_0x3671('0x13')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x3671('0x13')](_0x3671('0x14'),'o',_0x3671('0x1a'))[_0x3671('0x13')](_0x5d6fa6[_0x3671('0x1b')],'a',_0x3671('0x1c')+_0x4e5dd7)[_0x3671('0x13')](_0x5d6fa6[_0x3671('0x1d')],'me',_0x3671('0x1e')+_0x1cd862+_0x3671('0x1f'))[_0x3671('0x13')](_0x5d6fa6[_0x3671('0x20')],'it',_0x3671('0x21')+_0x1cd862+_0x3671('0x1f'))[_0x3671('0x13')](_0x3671('0x22'),'t',_0x3671('0x23'));}function getSqlClauses(){var _0x1d9330={'body':squel['expr'](),'contact':squel['expr'](),'default':squel[_0x3671('0x24')](),'fields':squel[_0x3671('0x24')](),'filter':squel['expr'](),'read':squel['expr'](),'tags':{'clause':squel[_0x3671('0x24')](),'ids':null},'user':squel[_0x3671('0x24')]()};return _0x1d9330;}function parseTagParameter(_0x3c72b8){var _0x5a9f41=squel[_0x3671('0x24')]();if(_0x3c72b8){var _0x33997f=utils[_0x3671('0x25')](_0x3c72b8);_0x33997f['forEach'](function(_0x1bbb3b){_0x5a9f41['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1bbb3b+',%');});}return _0x5a9f41;}function parseReadParameter(_0x1246c0){var _0x13fad9='';if(_0x1246c0){_0x13fad9=_0x3671('0x26');if(_0x1246c0==='1'){_0x13fad9=_0x13fad9['replace']('{OPERATOR}','=');}else{_0x13fad9=_0x13fad9[_0x3671('0x27')]('{OPERATOR}','>');}}return _0x13fad9;}function parseSearchFilter(_0x4ba582,_0x5573d5){var _0x59a046=squel[_0x3671('0x24')]();if(_0x5573d5){var _0x5945e9=_0x5573d5[_0x3671('0x27')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x3671('0x28')](_0x5945e9)){_0x59a046['or']('i.id\x20LIKE\x20?',_0x5945e9+'%');if(['sms',_0x3671('0x29')][_0x3671('0x2a')](_0x4ba582)){_0x59a046['or'](_0x3671('0x2b'),_0x5945e9+'%');}else if(_0x4ba582===_0x3671('0x2c')){_0x59a046['or'](_0x3671('0x2d'),_0x5945e9+'%');}else if(_0x4ba582===_0x3671('0x2e')){_0x59a046['or']('i.from\x20LIKE\x20?',_0x5945e9+'%');}}else if(_0x4ba582===_0x3671('0x2f')&&qs[_0x3671('0x30')](_0x5945e9)){_0x59a046['or'](_0x3671('0x31'),_0x5945e9+'%');}else{if(_0x4ba582===_0x3671('0x2f')){_0x59a046['or'](_0x3671('0x32'),qs['getFullTextValue'](_0x5945e9,!![]))['or'](_0x3671('0x33'),qs[_0x3671('0x34')](_0x5945e9));}else if(_0x4ba582!==_0x3671('0x2c')){_0x59a046['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5945e9));}_0x59a046['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3671('0x34')](_0x5945e9,!![]),null);}}return _0x59a046;}function parseAdvancedSearchFilter(_0x57c667,_0x5dbd95){var _0x39fa5d=getSqlClauses();var _0x16e5a8=as[_0x3671('0x35')](_0x57c667);var _0x556d92=_0x16e5a8[_0x3671('0x36')];for(var _0xe6711c=0x0;_0xe6711c<_0x16e5a8[_0x3671('0x37')][_0x3671('0x15')];_0xe6711c++){var _0x4759e4=_0x16e5a8['conditions'][_0xe6711c];var _0x2384cd='i';var _0x508c39=_[_0x3671('0x38')](_0x5dbd95,['name',_0x4759e4[_0x3671('0xb')]]);if(_0x508c39){var _0x40863d=as[_0x3671('0x39')](_0x2384cd,_0x508c39[_0x3671('0x3a')],_0x4759e4);_0x39fa5d[_0x3671('0x3b')][_0x556d92](_0x40863d[_0x3671('0x3c')],_0x40863d[_0x3671('0x3d')][_0x3671('0x3e')],_0x40863d['value'][_0x3671('0x3f')]);}else{switch(_0x4759e4[_0x3671('0xb')]){case _0x3671('0x40'):var _0x491e56=parseReadParameter(_0x4759e4['value']);_0x39fa5d[_0x3671('0x41')][_0x3671('0x42')](_0x491e56);break;case'Contact':if(_0x4759e4[_0x3671('0x43')]==='$substring'){if(_0x4759e4[_0x3671('0x3d')]['split']('\x20')[_0x3671('0x15')]>0x1){_0x39fa5d[_0x3671('0x44')][_0x556d92](_0x3671('0x45'),qs[_0x3671('0x34')](_0x4759e4[_0x3671('0x3d')],!![]),null);}else{var _0x1cab3d='%'+_0x4759e4[_0x3671('0x3d')]+'%';_0x39fa5d[_0x3671('0x44')][_0x556d92](_0x3671('0x46'),_0x1cab3d,_0x1cab3d,_0x1cab3d);}}else{_0x508c39=_[_0x3671('0x38')](_0x5dbd95,[_0x3671('0xc'),_0x3671('0x47')]);_0x4759e4[_0x3671('0xb')]=_0x3671('0x47');_0x40863d=as['buildExpression'](_0x2384cd,_0x508c39[_0x3671('0x3a')],_0x4759e4);_0x39fa5d['contact'][_0x556d92](_0x40863d[_0x3671('0x3c')],_0x40863d[_0x3671('0x3d')][_0x3671('0x3e')],_0x40863d[_0x3671('0x3d')][_0x3671('0x3f')]);}break;case _0x3671('0x48'):var _0x28f538=_0x4759e4[_0x3671('0x3d')][_0x3671('0x49')](',')[_0x3671('0x18')](function(_0x2787d7){return Number(_0x2787d7);});var _0x2076f1=parseTagParameter(_0x28f538);_0x39fa5d[_0x3671('0x4a')]['clause'][_0x3671('0x42')](_0x2076f1);_0x39fa5d[_0x3671('0x4a')]['ids']=_0x28f538;break;case'User':if(_0x4759e4[_0x3671('0x43')]==='$substring'){_0x39fa5d[_0x3671('0x4b')][_0x556d92](_0x3671('0x4c'),'%'+_0x4759e4[_0x3671('0x3d')]+'%',null);}else{_0x508c39=_['find'](_0x5dbd95,[_0x3671('0xc'),'UserId']);_0x4759e4['field']='UserId';_0x40863d=as[_0x3671('0x39')](_0x2384cd,_0x508c39[_0x3671('0x3a')],_0x4759e4);_0x39fa5d[_0x3671('0x4b')][_0x556d92](_0x40863d[_0x3671('0x3c')],_0x40863d[_0x3671('0x3d')][_0x3671('0x3e')],_0x40863d[_0x3671('0x3d')]['end']);}break;case'body':case _0x3671('0x4d'):_0x40863d=as[_0x3671('0x39')]('me',null,_0x4759e4);_0x39fa5d[_0x3671('0x4e')][_0x556d92](_0x40863d[_0x3671('0x3c')],_0x40863d[_0x3671('0x3d')][_0x3671('0x3e')],_0x40863d[_0x3671('0x3d')][_0x3671('0x3f')]);break;}}}return _0x39fa5d;}function parseModelFields(_0x1e8d15,_0x20214a,_0x3a4be1){var _0x1714bf=utils[_0x3671('0x7')](_0x1e8d15);var _0x13de27=squel[_0x3671('0x24')]();var _0x7919f7=_(_0x20214a)[_0x3671('0x4f')]()[_0x3671('0x18')](function(_0x2b3aa2){return _[_0x3671('0x50')](_0x3a4be1,['name',_0x2b3aa2])?_0x2b3aa2:undefined;})['compact']()['value']();if(_0x7919f7[_0x3671('0x15')]>0x0){_0x7919f7[_0x3671('0x51')](function(_0x118b45){if(_0x118b45===_0x1714bf){_0x13de27['and']('i.'+_0x1714bf+_0x3671('0x17'),[]['concat'](_0x20214a[_0x118b45]));}else if(_0x118b45==='createdAt'){var _0x5f3d2d=JSON[_0x3671('0x52')](_0x20214a[_0x118b45])[_0x3671('0x53')];var _0x4f04ea=JSON[_0x3671('0x52')](_0x20214a[_0x118b45])['$lte'];_0x13de27['and'](_0x3671('0x54'),_0x5f3d2d,_0x4f04ea);}else{if(_0x20214a[_0x118b45]===_0x3671('0x55')){_0x13de27[_0x3671('0x42')]('i.'+_0x118b45+_0x3671('0x56'));}else{_0x13de27['and']('i.'+_0x118b45+'\x20=\x20?',_0x20214a[_0x118b45]);}}});}return _0x13de27;}function parseQueryParameters(_0x586cd8,_0x4fe34d,_0xefd2ab){var _0x47caff=getSqlClauses();return Promise['resolve']()[_0x3671('0x57')](function(){return parseModelFields(_0x586cd8,_0x4fe34d,_0xefd2ab);})[_0x3671('0x57')](function(_0xabbd1e){_0x47caff[_0x3671('0x58')][_0x3671('0x42')](_0xabbd1e);return parseReadParameter(_0x4fe34d[_0x3671('0x41')]);})[_0x3671('0x57')](function(_0x40452d){_0x47caff[_0x3671('0x41')]['and'](_0x40452d);return parseTagParameter(_0x4fe34d[_0x3671('0x59')]);})[_0x3671('0x57')](function(_0x592b65){_0x47caff[_0x3671('0x4a')][_0x3671('0x5a')][_0x3671('0x42')](_0x592b65);return parseSearchFilter(_0x586cd8,_0x4fe34d['filter']);})[_0x3671('0x57')](function(_0x456d69){_0x47caff['filter']=_0x456d69;return _0x47caff;});}function checkAccountsRestrictions(_0x1aedd8,_0x4bdd34,_0x1f6281){var _0x526e3c=utils[_0x3671('0x7')](_0x1aedd8);var _0x3ad1d4=_0x3671('0x5b')+_['capitalize'](_0x1aedd8)+(_0x1aedd8===_0x3671('0x5c')?_0x3671('0x5d'):_0x3671('0x5e'));var _0x52a298=squel[_0x3671('0x24')]();return Promise[_0x3671('0x5f')]()[_0x3671('0x57')](function(){if(_0x1f6281[_0x3671('0x60')]&&_0x4bdd34[_0x3671('0x8')]===_0x3671('0x9')){return _0x4bdd34[_0x3ad1d4]({'attributes':['id'],'raw':!![]});}})[_0x3671('0x57')](function(_0x4a4e52){if(_0x4a4e52){if(_0x4a4e52['length']===0x0){_0x52a298['and']('i.'+_0x526e3c+'\x20IS\x20NULL');}else{_0x52a298[_0x3671('0x42')]('i.'+_0x526e3c+'\x20IN\x20?',_['map'](_0x4a4e52,'id'));}}else if(!_0x1f6281[_0x526e3c]){_0x52a298['and']('i.'+_0x526e3c+'\x20IS\x20NOT\x20NULL');}})[_0x3671('0x57')](function(){return _0x52a298;});}function getClosedOrderClause(_0x476c8b,_0x116ca2){var _0x2631ee='';var _0x5ef8ea=[_0x3671('0x61'),_0x3671('0x62'),_0x3671('0x63')];if(_0x476c8b===_0x3671('0x2f')){_0x5ef8ea[_0x3671('0x64')](_0x3671('0x65'));}if(_0x116ca2[_0x3671('0x66')]==='0'&&_0x476c8b===_0x3671('0x2f')){_0x2631ee=_0x3671('0x65');}else{if(_0x116ca2['closed']==='1'){_0x5ef8ea[_0x3671('0x67')]();}_0x2631ee=_0x3671('0x68')+_0x5ef8ea['join'](',\x20')+')';}return _0x2631ee;}function getFilteredInteractions(_0x21536f,_0x57a5cb,_0x41d41a,_0x21782f){var _0x2d5de6=utils[_0x3671('0xd')](_0x21536f);var _0x3ce5d0=_[_0x3671('0x69')](_0x21536f)+_0x3671('0x6a');var _0x695ba6=[];var _0x4cf78a=getTagsQuery();var _0x15d0bb={'type':db[_0x3671('0x6b')][_0x3671('0x6c')][_0x3671('0x6d')],'raw':!![]};var _0xf5b478=[];var _0x4f04a3=[];return db[_0x3671('0x6e')][_0x3671('0x6f')](_0x4cf78a[_0x3671('0x70')](),_0x15d0bb)[_0x3671('0x57')](function(_0x15a9ed){_0x695ba6=_['keyBy'](_0x15a9ed,'id');_0x15d0bb=_['merge'](_0x15d0bb,{'model':db[_0x3ce5d0],'mapToModel':!![],'nest':!![]});if(_0x41d41a['fields']){_0x21782f['attributes']['forEach'](function(_0x8cb2e6){_0x57a5cb['field']('i.'+_0x8cb2e6);});}else{_0x57a5cb[_0x3671('0xb')](_0x3671('0x71'),_0x3671('0x40'));_0x57a5cb[_0x3671('0xb')]('a.key',_0x3671('0x72'));_0x57a5cb['field']('a.mandatoryDisposition',_0x3671('0x73'));if(_0x21536f===_0x3671('0x2f')){_0x57a5cb[_0x3671('0xb')](_0x3671('0x74'),_0x3671('0x75'));_0x57a5cb[_0x3671('0xb')](_0x3671('0x76'),_0x3671('0x77'));_0x57a5cb[_0x3671('0xb')](_0x3671('0x78'));_0x57a5cb[_0x3671('0xb')](_0x3671('0x79'));_0x57a5cb['field'](_0x3671('0x7a'));_0x57a5cb[_0x3671('0xb')](_0x3671('0x7b'));_0x57a5cb['field'](_0x3671('0x7c'));_0x57a5cb[_0x3671('0xb')](_0x3671('0x7d'));_0x57a5cb[_0x3671('0xb')](_0x3671('0x7e'));_0x57a5cb[_0x3671('0xb')](_0x3671('0x7f'));_0x57a5cb[_0x3671('0xb')]('i.subject');_0x57a5cb[_0x3671('0xb')](_0x3671('0x63'));_0x57a5cb['field'](_0x3671('0x62'));_0x57a5cb[_0x3671('0xb')](_0x3671('0x61'));_0x57a5cb[_0x3671('0xb')](_0x3671('0x65'));_0x57a5cb[_0x3671('0xb')]('i.to');_0x57a5cb['field'](_0x3671('0x80'));_0x57a5cb[_0x3671('0xb')]('i.MailAccountId');_0x57a5cb[_0x3671('0xb')]('i.UserId');}else if(_0x21536f===_0x3671('0x2e')){_0x57a5cb[_0x3671('0xb')](_0x3671('0x81'),'contactName');}else{_0x57a5cb['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',_0x3671('0x77'));}if(_0x21536f!==_0x3671('0x2f')){_0x57a5cb['field']('i.*');}_0x57a5cb[_0x3671('0xb')](_0x3671('0x82'),_0x3671('0x83'));_0x57a5cb[_0x3671('0xb')](_0x3671('0x84'),_0x3671('0x85'));_0x57a5cb[_0x3671('0xb')](_0x3671('0x86'),_0x3671('0x87'));_0x57a5cb[_0x3671('0xb')](_0x3671('0x88'),_0x3671('0x89'));_0x57a5cb[_0x3671('0xb')](_0x3671('0x8a'),_0x3671('0x8b'));_0x57a5cb['field'](_0x3671('0x8c'),_0x3671('0x8d'));_0x57a5cb[_0x3671('0xb')]('o.fullname',_0x3671('0x8e'));_0x57a5cb['field'](_0x3671('0x8f'),'Owner.internal');_0x57a5cb[_0x3671('0xb')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3671('0x90'));}if(_0x21782f[_0x3671('0x91')]){_0x57a5cb[_0x3671('0x91')](_0x21782f[_0x3671('0x91')]);}if(_0x21782f['offset']){_0x57a5cb['offset'](_0x21782f[_0x3671('0x92')]);}return db['sequelize'][_0x3671('0x6f')](_0x57a5cb[_0x3671('0x70')](),_0x15d0bb);})[_0x3671('0x57')](function(_0x3aa52f){_0xf5b478=_0x3aa52f;var _0x531c9a=getUsersQuery(_0x21536f,_0xf5b478);return db[_0x3671('0x6e')][_0x3671('0x6f')](_0x531c9a['toString'](),_0x15d0bb);})[_0x3671('0x57')](function(_0x223dc9){_0x4f04a3=_[_0x3671('0x93')](_0x223dc9,_0x2d5de6);if(_0x21536f==='mail'){return db[_0x3671('0x94')][_0x3671('0x95')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x3671('0x57')](function(_0x5cf532){var _0xbf37e3=_0x5cf532?_0x5cf532[_0x3671('0x96')]:undefined;var _0x17fccf=_0xf5b478[_0x3671('0x18')](function(_0x53aeb1){return updateInteraction(_0x53aeb1,_0x695ba6,_0x4f04a3,_0xbf37e3);});return Promise['all'](_0x17fccf);});}function countFilteredInteractions(_0x9da68e,_0x48b91a){var _0x5b021b=_0x9da68e[_0x3671('0x97')]();_0x5b021b['field']('COUNT(*)');_0x5b021b[_0x3671('0xb')](_0x3671('0x71'),'unreadMessages');var _0x1364b1=utils[_0x3671('0x25')](_0x48b91a);if(!_[_0x3671('0x98')](_0x1364b1)){_0x5b021b[_0x3671('0x16')](_0x3671('0x99'),_0x1364b1);}var _0x5f30b1={'type':db[_0x3671('0x6b')][_0x3671('0x6c')][_0x3671('0x6d')],'raw':!![]};return db[_0x3671('0x6e')]['query'](_0x5b021b[_0x3671('0x70')](),_0x5f30b1);}module[_0x3671('0x9a')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x8925=['ContactId','end','Tag','map','and','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','plainBody','keys','some','compact','createdAt','$gte','parse','$lte','null','\x20=\x20?','then','fields','clause','filter','get','chat','Websites','Accounts','resolve','agent','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','join','getInteractionFK','capitalize','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','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','contactName','i.id','i.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.ContactId','i.UserId','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','c.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','limit','offset','toString','groupBy','Setting','enableEmailPreview','all','clone','t.id\x20IN\x20?','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','../../mysqldb','getAccountFK','role','search','select','field','tools_tags','user_has_','_interactions','u.id','u.fullname','ui.','from','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','getInteractionsTables','interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','unreadMessages\x20{OPERATOR}\x200','{OPERATOR}','replace','isNumeric','i.id\x20LIKE\x20?','sms','includes','i.phone\x20LIKE\x20?','fax','openchannel','mail','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','conditions','find','buildExpression','type','default','text','value','start','read','Contact','operator','$substring','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','name'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x8925,0xfb));var _0x5892=function(_0x10a546,_0x5ea132){_0x10a546=_0x10a546-0x0;var _0x30e897=_0x8925[_0x10a546];return _0x30e897;};'use strict';var _=require(_0x5892('0x0'));var squel=require(_0x5892('0x1'));var as=require(_0x5892('0x2'));var qs=require(_0x5892('0x3'));var updateInteraction=require(_0x5892('0x4'))['updateInteraction'];var utils=require(_0x5892('0x5'));var db=require(_0x5892('0x6'))['db'];function skipInteractionsQuery(_0x130074,_0x5755c3,_0x5cc7f5){var _0x2d5197=![];var _0x59020a=utils[_0x5892('0x7')](_0x130074);if(_0x5755c3[_0x5892('0x8')]==='agent'&&!_0x5cc7f5[_0x5892('0x9')]&&!_0x5cc7f5[_0x59020a]){_0x2d5197=!![];}return _0x2d5197;}function getTagsQuery(){return squel[_0x5892('0xa')]()[_0x5892('0xb')]('id')['field']('name')['field']('color')['from'](_0x5892('0xc'));}function getUsersQuery(_0x291ad3,_0x49d62c){var _0x5a6167=utils['getInteractionFK'](_0x291ad3);var _0x299235=_0x5892('0xd')+_0x291ad3+_0x5892('0xe');var _0x1ec13c=squel[_0x5892('0xa')]()[_0x5892('0xb')](_0x5892('0xf'))[_0x5892('0xb')](_0x5892('0x10'))['field'](_0x5892('0x11')+_0x5a6167)[_0x5892('0x12')](_0x299235,'ui')[_0x5892('0x13')](_0x5892('0x14'),'u',_0x5892('0x15'));if(_0x49d62c[_0x5892('0x16')]>0x0){_0x1ec13c[_0x5892('0x17')](_0x5892('0x11')+_0x5a6167+_0x5892('0x18'),_['map'](_0x49d62c,'id'));}return _0x1ec13c;}function getInteractionsQuery(_0x5e1926){var _0x4dd4ca=utils[_0x5892('0x19')](_0x5e1926);var _0x4f2f74=utils['getAccountFK'](_0x5e1926);var _0x4b2068=utils['getInteractionFK'](_0x5e1926);return squel[_0x5892('0xa')]()['from'](_0x4dd4ca[_0x5892('0x1a')],'i')[_0x5892('0x13')]('cm_contacts','c',_0x5892('0x1b'))[_0x5892('0x13')]('users','o',_0x5892('0x1c'))[_0x5892('0x13')](_0x4dd4ca['accounts'],'a',_0x5892('0x1d')+_0x4f2f74)['left_join'](_0x4dd4ca[_0x5892('0x1e')],'me',_0x5892('0x1f')+_0x4b2068+_0x5892('0x20'))['left_join'](_0x4dd4ca[_0x5892('0x21')],'it',_0x5892('0x22')+_0x4b2068+_0x5892('0x20'))['left_join'](_0x5892('0xc'),'t',_0x5892('0x23'));}function getSqlClauses(){var _0x1948a4={'body':squel[_0x5892('0x24')](),'contact':squel[_0x5892('0x24')](),'default':squel[_0x5892('0x24')](),'fields':squel[_0x5892('0x24')](),'filter':squel[_0x5892('0x24')](),'read':squel['expr'](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x5892('0x24')]()};return _0x1948a4;}function parseTagParameter(_0x19e224){var _0x189a8a=squel[_0x5892('0x24')]();if(_0x19e224){var _0x4927bc=utils[_0x5892('0x25')](_0x19e224);_0x4927bc[_0x5892('0x26')](function(_0x3d4f0d){_0x189a8a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3d4f0d+',%');});}return _0x189a8a;}function parseReadParameter(_0x49033f){var _0x1ac813='';if(_0x49033f){_0x1ac813=_0x5892('0x27');if(_0x49033f==='1'){_0x1ac813=_0x1ac813['replace'](_0x5892('0x28'),'=');}else{_0x1ac813=_0x1ac813[_0x5892('0x29')](_0x5892('0x28'),'>');}}return _0x1ac813;}function parseSearchFilter(_0x3eb6ae,_0x2da9c1){var _0x1d4ecc=squel[_0x5892('0x24')]();if(_0x2da9c1){var _0x5e5fb9=_0x2da9c1[_0x5892('0x29')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x5892('0x2a')](_0x5e5fb9)){_0x1d4ecc['or'](_0x5892('0x2b'),_0x5e5fb9+'%');if([_0x5892('0x2c'),'whatsapp'][_0x5892('0x2d')](_0x3eb6ae)){_0x1d4ecc['or'](_0x5892('0x2e'),_0x5e5fb9+'%');}else if(_0x3eb6ae===_0x5892('0x2f')){_0x1d4ecc['or']('i.fax\x20LIKE\x20?',_0x5e5fb9+'%');}else if(_0x3eb6ae===_0x5892('0x30')){_0x1d4ecc['or']('i.from\x20LIKE\x20?',_0x5e5fb9+'%');}}else if(_0x3eb6ae===_0x5892('0x31')&&qs[_0x5892('0x32')](_0x5e5fb9)){_0x1d4ecc['or']('c.email\x20LIKE\x20?',_0x5e5fb9+'%');}else{if(_0x3eb6ae===_0x5892('0x31')){_0x1d4ecc['or'](_0x5892('0x33'),qs[_0x5892('0x34')](_0x5e5fb9,!![]))['or'](_0x5892('0x35'),qs['getFullTextValue'](_0x5e5fb9));}else if(_0x3eb6ae!==_0x5892('0x2f')){_0x1d4ecc['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5e5fb9));}_0x1d4ecc['or'](_0x5892('0x36'),qs['getFullTextValue'](_0x5e5fb9,!![]),null);}}return _0x1d4ecc;}function parseAdvancedSearchFilter(_0x198a00,_0x23de6f){var _0x4b9a44=getSqlClauses();var _0x1612d0=as['parseSearch'](_0x198a00);var _0x18787d=_0x1612d0['sqlOperator'];for(var _0x5e8044=0x0;_0x5e8044<_0x1612d0[_0x5892('0x37')][_0x5892('0x16')];_0x5e8044++){var _0x2b1598=_0x1612d0[_0x5892('0x37')][_0x5e8044];var _0x25bb3f='i';var _0x34de6f=_[_0x5892('0x38')](_0x23de6f,['name',_0x2b1598['field']]);if(_0x34de6f){var _0x201280=as[_0x5892('0x39')](_0x25bb3f,_0x34de6f[_0x5892('0x3a')],_0x2b1598);_0x4b9a44[_0x5892('0x3b')][_0x18787d](_0x201280[_0x5892('0x3c')],_0x201280[_0x5892('0x3d')][_0x5892('0x3e')],_0x201280[_0x5892('0x3d')]['end']);}else{switch(_0x2b1598[_0x5892('0xb')]){case'unreadMessages':var _0x5c7596=parseReadParameter(_0x2b1598[_0x5892('0x3d')]);_0x4b9a44[_0x5892('0x3f')]['and'](_0x5c7596);break;case _0x5892('0x40'):if(_0x2b1598[_0x5892('0x41')]===_0x5892('0x42')){if(_0x2b1598[_0x5892('0x3d')][_0x5892('0x43')]('\x20')['length']>0x1){_0x4b9a44['contact'][_0x18787d](_0x5892('0x36'),qs[_0x5892('0x34')](_0x2b1598['value'],!![]),null);}else{var _0x558f61='%'+_0x2b1598['value']+'%';_0x4b9a44[_0x5892('0x44')][_0x18787d](_0x5892('0x45'),_0x558f61,_0x558f61,_0x558f61);}}else{_0x34de6f=_[_0x5892('0x38')](_0x23de6f,[_0x5892('0x46'),_0x5892('0x47')]);_0x2b1598[_0x5892('0xb')]=_0x5892('0x47');_0x201280=as[_0x5892('0x39')](_0x25bb3f,_0x34de6f[_0x5892('0x3a')],_0x2b1598);_0x4b9a44['contact'][_0x18787d](_0x201280[_0x5892('0x3c')],_0x201280['value'][_0x5892('0x3e')],_0x201280[_0x5892('0x3d')][_0x5892('0x48')]);}break;case _0x5892('0x49'):var _0x29cb8e=_0x2b1598['value'][_0x5892('0x43')](',')[_0x5892('0x4a')](function(_0x2ddb13){return Number(_0x2ddb13);});var _0xdd4301=parseTagParameter(_0x29cb8e);_0x4b9a44['tags']['clause'][_0x5892('0x4b')](_0xdd4301);_0x4b9a44['tags'][_0x5892('0x4c')]=_0x29cb8e;break;case _0x5892('0x4d'):if(_0x2b1598[_0x5892('0x41')]===_0x5892('0x42')){_0x4b9a44[_0x5892('0x4e')][_0x18787d](_0x5892('0x4f'),'%'+_0x2b1598[_0x5892('0x3d')]+'%',null);}else{_0x34de6f=_[_0x5892('0x38')](_0x23de6f,[_0x5892('0x46'),_0x5892('0x50')]);_0x2b1598['field']=_0x5892('0x50');_0x201280=as[_0x5892('0x39')](_0x25bb3f,_0x34de6f['type'],_0x2b1598);_0x4b9a44[_0x5892('0x4e')][_0x18787d](_0x201280[_0x5892('0x3c')],_0x201280[_0x5892('0x3d')][_0x5892('0x3e')],_0x201280[_0x5892('0x3d')][_0x5892('0x48')]);}break;case _0x5892('0x51'):case _0x5892('0x52'):_0x201280=as[_0x5892('0x39')]('me',null,_0x2b1598);_0x4b9a44[_0x5892('0x51')][_0x18787d](_0x201280[_0x5892('0x3c')],_0x201280[_0x5892('0x3d')][_0x5892('0x3e')],_0x201280[_0x5892('0x3d')][_0x5892('0x48')]);break;}}}return _0x4b9a44;}function parseModelFields(_0x4b7524,_0x482688,_0x2312fb){var _0x2e8c34=utils[_0x5892('0x7')](_0x4b7524);var _0x5b81fe=squel[_0x5892('0x24')]();var _0x15d707=_(_0x482688)[_0x5892('0x53')]()[_0x5892('0x4a')](function(_0x4c5910){return _[_0x5892('0x54')](_0x2312fb,[_0x5892('0x46'),_0x4c5910])?_0x4c5910:undefined;})[_0x5892('0x55')]()[_0x5892('0x3d')]();if(_0x15d707[_0x5892('0x16')]>0x0){_0x15d707['forEach'](function(_0x2707c2){if(_0x2707c2===_0x2e8c34){_0x5b81fe[_0x5892('0x4b')]('i.'+_0x2e8c34+_0x5892('0x18'),[]['concat'](_0x482688[_0x2707c2]));}else if(_0x2707c2===_0x5892('0x56')){var _0xe68dd0=JSON['parse'](_0x482688[_0x2707c2])[_0x5892('0x57')];var _0x31333d=JSON[_0x5892('0x58')](_0x482688[_0x2707c2])[_0x5892('0x59')];_0x5b81fe[_0x5892('0x4b')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xe68dd0,_0x31333d);}else{if(_0x482688[_0x2707c2]===_0x5892('0x5a')){_0x5b81fe['and']('i.'+_0x2707c2+'\x20IS\x20NULL');}else{_0x5b81fe[_0x5892('0x4b')]('i.'+_0x2707c2+_0x5892('0x5b'),_0x482688[_0x2707c2]);}}});}return _0x5b81fe;}function parseQueryParameters(_0x3dadef,_0x4090c0,_0xfd259c){var _0x46fefc=getSqlClauses();return Promise['resolve']()[_0x5892('0x5c')](function(){return parseModelFields(_0x3dadef,_0x4090c0,_0xfd259c);})['then'](function(_0x4fe39f){_0x46fefc[_0x5892('0x5d')][_0x5892('0x4b')](_0x4fe39f);return parseReadParameter(_0x4090c0['read']);})[_0x5892('0x5c')](function(_0x3cd603){_0x46fefc[_0x5892('0x3f')][_0x5892('0x4b')](_0x3cd603);return parseTagParameter(_0x4090c0['tag']);})[_0x5892('0x5c')](function(_0x4d8837){_0x46fefc['tags'][_0x5892('0x5e')][_0x5892('0x4b')](_0x4d8837);return parseSearchFilter(_0x3dadef,_0x4090c0[_0x5892('0x5f')]);})[_0x5892('0x5c')](function(_0x12e6cc){_0x46fefc[_0x5892('0x5f')]=_0x12e6cc;return _0x46fefc;});}function checkAccountsRestrictions(_0x342158,_0x10187e,_0x31922d){var _0x1c1a0a=utils['getAccountFK'](_0x342158);var _0x4e59b2=_0x5892('0x60')+_['capitalize'](_0x342158)+(_0x342158===_0x5892('0x61')?_0x5892('0x62'):_0x5892('0x63'));var _0x1afe1a=squel['expr']();return Promise[_0x5892('0x64')]()[_0x5892('0x5c')](function(){if(_0x31922d[_0x5892('0x9')]&&_0x10187e['role']===_0x5892('0x65')){return _0x10187e[_0x4e59b2]({'attributes':['id'],'raw':!![]});}})[_0x5892('0x5c')](function(_0x5b3110){if(_0x5b3110){if(_0x5b3110['length']===0x0){_0x1afe1a['and']('i.'+_0x1c1a0a+'\x20IS\x20NULL');}else{_0x1afe1a[_0x5892('0x4b')]('i.'+_0x1c1a0a+'\x20IN\x20?',_[_0x5892('0x4a')](_0x5b3110,'id'));}}else if(!_0x31922d[_0x1c1a0a]){_0x1afe1a['and']('i.'+_0x1c1a0a+_0x5892('0x66'));}})[_0x5892('0x5c')](function(){return _0x1afe1a;});}function getClosedOrderClause(_0x279ce3,_0x158129){var _0xcbbc81='';var _0x326e48=[_0x5892('0x67'),_0x5892('0x68'),_0x5892('0x69')];if(_0x279ce3===_0x5892('0x31')){_0x326e48[_0x5892('0x6a')](_0x5892('0x6b'));}if(_0x158129[_0x5892('0x6c')]==='0'&&_0x279ce3===_0x5892('0x31')){_0xcbbc81=_0x5892('0x6b');}else{if(_0x158129[_0x5892('0x6c')]==='1'){_0x326e48[_0x5892('0x6d')]();}_0xcbbc81='CONCAT_WS(\x27\x27,\x20'+_0x326e48[_0x5892('0x6e')](',\x20')+')';}return _0xcbbc81;}function getFilteredInteractions(_0x545169,_0x39a551,_0x3bb998,_0x5ea2ef){var _0x565e15=utils[_0x5892('0x6f')](_0x545169);var _0x181def=_[_0x5892('0x70')](_0x545169)+_0x5892('0x71');var _0x31c21d=[];var _0x170007=getTagsQuery();var _0x113ca8={'type':db[_0x5892('0x72')][_0x5892('0x73')][_0x5892('0x74')],'raw':!![]};var _0x380283=[];var _0xcd9831=[];return db[_0x5892('0x75')][_0x5892('0x76')](_0x170007['toString'](),_0x113ca8)[_0x5892('0x5c')](function(_0x32b115){_0x31c21d=_[_0x5892('0x77')](_0x32b115,'id');_0x113ca8=_['merge'](_0x113ca8,{'model':db[_0x181def],'mapToModel':!![],'nest':!![]});if(_0x3bb998[_0x5892('0x5d')]){_0x5ea2ef['attributes'][_0x5892('0x26')](function(_0xdd8f87){_0x39a551[_0x5892('0xb')]('i.'+_0xdd8f87);});}else{_0x39a551[_0x5892('0xb')](_0x5892('0x78'),_0x5892('0x79'));_0x39a551[_0x5892('0xb')](_0x5892('0x7a'),_0x5892('0x7b'));_0x39a551[_0x5892('0xb')](_0x5892('0x7c'),_0x5892('0x7d'));if(_0x545169===_0x5892('0x31')){_0x39a551[_0x5892('0xb')]('a.email',_0x5892('0x7e'));_0x39a551[_0x5892('0xb')](_0x5892('0x7f'),_0x5892('0x80'));_0x39a551[_0x5892('0xb')](_0x5892('0x81'));_0x39a551[_0x5892('0xb')](_0x5892('0x82'));_0x39a551['field']('i.updatedAt');_0x39a551[_0x5892('0xb')](_0x5892('0x83'));_0x39a551[_0x5892('0xb')](_0x5892('0x84'));_0x39a551[_0x5892('0xb')](_0x5892('0x85'));_0x39a551[_0x5892('0xb')](_0x5892('0x86'));_0x39a551[_0x5892('0xb')](_0x5892('0x87'));_0x39a551['field']('i.subject');_0x39a551['field'](_0x5892('0x69'));_0x39a551[_0x5892('0xb')]('i.secondDisposition');_0x39a551[_0x5892('0xb')]('i.thirdDisposition');_0x39a551[_0x5892('0xb')](_0x5892('0x6b'));_0x39a551[_0x5892('0xb')]('i.to');_0x39a551['field'](_0x5892('0x88'));_0x39a551[_0x5892('0xb')]('i.MailAccountId');_0x39a551[_0x5892('0xb')](_0x5892('0x89'));}else if(_0x545169===_0x5892('0x30')){_0x39a551[_0x5892('0xb')]('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',_0x5892('0x80'));}else{_0x39a551[_0x5892('0xb')]('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',_0x5892('0x80'));}if(_0x545169!==_0x5892('0x31')){_0x39a551[_0x5892('0xb')](_0x5892('0x8a'));}_0x39a551[_0x5892('0xb')](_0x5892('0x8b'),_0x5892('0x8c'));_0x39a551[_0x5892('0xb')]('c.lastName',_0x5892('0x8d'));_0x39a551['field'](_0x5892('0x8e'),'Contact.email');_0x39a551[_0x5892('0xb')](_0x5892('0x8f'),'Contact.phone');_0x39a551[_0x5892('0xb')]('c.mobile',_0x5892('0x90'));_0x39a551[_0x5892('0xb')](_0x5892('0x91'),_0x5892('0x92'));_0x39a551[_0x5892('0xb')](_0x5892('0x93'),_0x5892('0x94'));_0x39a551['field'](_0x5892('0x95'),'Owner.internal');_0x39a551['field'](_0x5892('0x96'),'TagIds');}if(_0x5ea2ef[_0x5892('0x97')]){_0x39a551[_0x5892('0x97')](_0x5ea2ef[_0x5892('0x97')]);}if(_0x5ea2ef['offset']){_0x39a551[_0x5892('0x98')](_0x5ea2ef[_0x5892('0x98')]);}return db[_0x5892('0x75')][_0x5892('0x76')](_0x39a551['toString'](),_0x113ca8);})[_0x5892('0x5c')](function(_0x4fd016){_0x380283=_0x4fd016;var _0x8e57f2=getUsersQuery(_0x545169,_0x380283);return db['sequelize'][_0x5892('0x76')](_0x8e57f2[_0x5892('0x99')](),_0x113ca8);})['then'](function(_0x313ecb){_0xcd9831=_[_0x5892('0x9a')](_0x313ecb,_0x565e15);if(_0x545169==='mail'){return db[_0x5892('0x9b')]['findOne']({'attributes':[_0x5892('0x9c')],'raw':!![]});}})[_0x5892('0x5c')](function(_0x5aab37){var _0x4a9bed=_0x5aab37?_0x5aab37['enableEmailPreview']:undefined;var _0x449e1f=_0x380283[_0x5892('0x4a')](function(_0x566edb){return updateInteraction(_0x566edb,_0x31c21d,_0xcd9831,_0x4a9bed);});return Promise[_0x5892('0x9d')](_0x449e1f);});}function countFilteredInteractions(_0x432845,_0x3ec462){var _0x314fdf=_0x432845[_0x5892('0x9e')]();_0x314fdf[_0x5892('0xb')]('COUNT(*)');_0x314fdf['field'](_0x5892('0x78'),_0x5892('0x79'));var _0x167bbf=utils['getSelectedTags'](_0x3ec462);if(!_['isEmpty'](_0x167bbf)){_0x314fdf['where'](_0x5892('0x9f'),_0x167bbf);}var _0x544f94={'type':db['Sequelize'][_0x5892('0x73')][_0x5892('0x74')],'raw':!![]};return db['sequelize'][_0x5892('0x76')](_0x314fdf[_0x5892('0x99')](),_0x544f94);}module[_0x5892('0xa0')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index f5034ca..9adbfcb 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc963=['waiting','talking','answered','unmanaged','abandoned','total','disposition','UserId','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','trimStart','catch','updateInteraction','TagIds','Tags','lodash','../../mysqldb','map','fullname','forEach','push'];(function(_0x1621cb,_0x32c214){var _0x1e7bea=function(_0x5565cf){while(--_0x5565cf){_0x1621cb['push'](_0x1621cb['shift']());}};_0x1e7bea(++_0x32c214);}(_0xc963,0x7c));var _0x3c96=function(_0x385c76,_0xb97335){_0x385c76=_0x385c76-0x0;var _0x5c8367=_0xc963[_0x385c76];return _0x5c8367;};'use strict';var _=require(_0x3c96('0x0'));var db=require(_0x3c96('0x1'))['db'];function getInteractionUsers(_0x300ecc,_0x2a9d79){return new Promise(function(_0x460b12,_0x4c9f0d){try{var _0x20efb1=[];if(_0x2a9d79[_0x300ecc]){_0x20efb1=_0x2a9d79[_0x300ecc][_0x3c96('0x2')](function(_0x15512b){return{'id':_0x15512b['id'],'fullname':_0x15512b[_0x3c96('0x3')]};});}return _0x460b12(_0x20efb1);}catch(_0xc5822a){_0x4c9f0d(_0xc5822a);}});}function getInteractionTags(_0x13a79c,_0x1e4dc6){var _0x386bd8=[];if(_0x13a79c){_0x13a79c['split'](',')[_0x3c96('0x4')](function(_0x49c789){_0x386bd8[_0x3c96('0x5')](_0x1e4dc6[_0x49c789]);});}return _0x386bd8;}function updateWaitingCounter(_0x5c0e1d){if(_0x5c0e1d[_0x3c96('0x6')]){_0x5c0e1d[_0x3c96('0x6')]-=0x1;}}function updateInteractionCounters(_0x537b37){_0x537b37['waiting']=0x0;_0x537b37[_0x3c96('0x7')]=0x0;_0x537b37[_0x3c96('0x8')]=0x0;_0x537b37[_0x3c96('0x9')]=0x0;_0x537b37[_0x3c96('0xa')]=0x0;_0x537b37[_0x3c96('0xb')]=0x0;if(_0x537b37['closed']){if(_0x537b37[_0x3c96('0xc')]==='abandoned'){_0x537b37[_0x3c96('0xa')]+=0x1;updateWaitingCounter(_0x537b37);}if(_0x537b37[_0x3c96('0xd')]){_0x537b37[_0x3c96('0x8')]+=0x1;if(_0x537b37[_0x3c96('0x7')]){_0x537b37[_0x3c96('0x7')]-=0x1;}}else{if(_0x537b37[_0x3c96('0xc')]){_0x537b37[_0x3c96('0x9')]+=0x1;updateWaitingCounter(_0x537b37);}}}else{if(!_0x537b37[_0x3c96('0xd')]){_0x537b37[_0x3c96('0x6')]+=0x1;}if(_0x537b37[_0x3c96('0xd')]){_0x537b37['talking']+=0x1;updateWaitingCounter(_0x537b37);}}_0x537b37['total']+=0x1;return _0x537b37;}function getLastMessageText(_0x364e40){return db[_0x3c96('0xe')][_0x3c96('0xf')]({'where':{'$and':[{'MailInteractionId':_0x364e40['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x3c96('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x3c96('0x11')],'order':_0x3c96('0x12'),'raw':!![]})[_0x3c96('0x13')](function(_0x2ad7a2){if(_0x2ad7a2&&_0x2ad7a2[_0x3c96('0x11')]){_0x364e40[_0x3c96('0x14')]=_[_0x3c96('0x15')](_0x2ad7a2['plainBody']);}return _0x364e40;})[_0x3c96('0x16')](function(_0x37ba45){throw _0x37ba45;});}exports[_0x3c96('0x17')]=function(_0x20e328,_0x904ac,_0x59f19a,_0x1aa3b2){return new Promise(function(_0x55b316,_0x27bf20){return getInteractionUsers(_0x20e328['id'],_0x59f19a)[_0x3c96('0x13')](function(_0x1bf80d){_0x20e328['Users']=_0x1bf80d;return getInteractionTags(_0x20e328[_0x3c96('0x18')],_0x904ac);})[_0x3c96('0x13')](function(_0x25b28d){_0x20e328[_0x3c96('0x19')]=_0x25b28d;delete _0x20e328[_0x3c96('0x18')];return updateInteractionCounters(_0x20e328);})[_0x3c96('0x13')](function(_0x34dc76){if(_0x1aa3b2){return getLastMessageText(_0x34dc76);}else{return _0x34dc76;}})[_0x3c96('0x13')](function(_0x59b5bb){_0x55b316(_0x59b5bb);})[_0x3c96('0x16')](function(_0x442061){_0x27bf20(_0x442061);});});}; \ No newline at end of file +var _0xdc0d=['abandoned','total','answered','talking','disposition','UserId','MailMessage','findOne','out','-id','trimStart','plainBody','catch','updateInteraction','then','TagIds','Tags','lodash','../../mysqldb','map','fullname','split','forEach','push','waiting','unmanaged'];(function(_0x2396a3,_0x9f2c00){var _0x3bcbe2=function(_0x4fe61a){while(--_0x4fe61a){_0x2396a3['push'](_0x2396a3['shift']());}};_0x3bcbe2(++_0x9f2c00);}(_0xdc0d,0x149));var _0xddc0=function(_0x1d7423,_0x531a37){_0x1d7423=_0x1d7423-0x0;var _0xf9f22a=_0xdc0d[_0x1d7423];return _0xf9f22a;};'use strict';var _=require(_0xddc0('0x0'));var db=require(_0xddc0('0x1'))['db'];function getInteractionUsers(_0x5cc874,_0x45149c){return new Promise(function(_0x33d33f,_0x546918){try{var _0x5fb0d=[];if(_0x45149c[_0x5cc874]){_0x5fb0d=_0x45149c[_0x5cc874][_0xddc0('0x2')](function(_0x129bfd){return{'id':_0x129bfd['id'],'fullname':_0x129bfd[_0xddc0('0x3')]};});}return _0x33d33f(_0x5fb0d);}catch(_0x140932){_0x546918(_0x140932);}});}function getInteractionTags(_0x3f41db,_0x413981){var _0x4141c0=[];if(_0x3f41db){_0x3f41db[_0xddc0('0x4')](',')[_0xddc0('0x5')](function(_0x5513eb){_0x4141c0[_0xddc0('0x6')](_0x413981[_0x5513eb]);});}return _0x4141c0;}function updateWaitingCounter(_0x16c5e6){if(_0x16c5e6['waiting']){_0x16c5e6['waiting']-=0x1;}}function updateInteractionCounters(_0x481b37){_0x481b37[_0xddc0('0x7')]=0x0;_0x481b37['talking']=0x0;_0x481b37['answered']=0x0;_0x481b37[_0xddc0('0x8')]=0x0;_0x481b37[_0xddc0('0x9')]=0x0;_0x481b37[_0xddc0('0xa')]=0x0;if(_0x481b37['closed']){if(_0x481b37['disposition']==='abandoned'){_0x481b37[_0xddc0('0x9')]+=0x1;updateWaitingCounter(_0x481b37);}if(_0x481b37['UserId']){_0x481b37[_0xddc0('0xb')]+=0x1;if(_0x481b37[_0xddc0('0xc')]){_0x481b37['talking']-=0x1;}}else{if(_0x481b37[_0xddc0('0xd')]){_0x481b37[_0xddc0('0x8')]+=0x1;updateWaitingCounter(_0x481b37);}}}else{if(!_0x481b37[_0xddc0('0xe')]){_0x481b37['waiting']+=0x1;}if(_0x481b37[_0xddc0('0xe')]){_0x481b37[_0xddc0('0xc')]+=0x1;updateWaitingCounter(_0x481b37);}}_0x481b37[_0xddc0('0xa')]+=0x1;return _0x481b37;}function getLastMessageText(_0x47910f){return db[_0xddc0('0xf')][_0xddc0('0x10')]({'where':{'$and':[{'MailInteractionId':_0x47910f['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xddc0('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xddc0('0x12'),'raw':!![]})['then'](function(_0x81c194){if(_0x81c194&&_0x81c194['plainBody']){_0x47910f['lastMsgText']=_[_0xddc0('0x13')](_0x81c194[_0xddc0('0x14')]);}return _0x47910f;})[_0xddc0('0x15')](function(_0x25dc4a){throw _0x25dc4a;});}exports[_0xddc0('0x16')]=function(_0x26792c,_0x282574,_0x37435b,_0x89af83){return new Promise(function(_0x3decb0,_0x2accab){return getInteractionUsers(_0x26792c['id'],_0x37435b)[_0xddc0('0x17')](function(_0x59a071){_0x26792c['Users']=_0x59a071;return getInteractionTags(_0x26792c[_0xddc0('0x18')],_0x282574);})[_0xddc0('0x17')](function(_0x173749){_0x26792c[_0xddc0('0x19')]=_0x173749;delete _0x26792c[_0xddc0('0x18')];return updateInteractionCounters(_0x26792c);})[_0xddc0('0x17')](function(_0x231218){if(_0x89af83){return getLastMessageText(_0x231218);}else{return _0x231218;}})[_0xddc0('0x17')](function(_0x8e579c){_0x3decb0(_0x8e579c);})[_0xddc0('0x15')](function(_0x1986e3){_0x2accab(_0x1986e3);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 88469db..9fe2ebd 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f76=['unknown','websites','_interaction_has_tags','_messages','user_has_','_interactions','isArray','toLowerCase','toUpperCase','name','role','stringify','Interaction','findOne','then','update','info','error','exports','lodash','../../mysqldb','../../config/logger','sms-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0x2f76,0xe5));var _0x62f7=function(_0x14219e,_0x4c974b){_0x14219e=_0x14219e-0x0;var _0x55f735=_0x2f76[_0x14219e];return _0x55f735;};'use strict';var _=require(_0x62f7('0x0'));var db=require(_0x62f7('0x1'))['db'];var loggers={'openchannel':require(_0x62f7('0x2'))('openchannel-interactions'),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0x62f7('0x2'))('fax-interactions'),'sms':require(_0x62f7('0x2'))(_0x62f7('0x3')),'chat':require(_0x62f7('0x2'))('chat-interactions'),'whatsapp':require(_0x62f7('0x2'))(_0x62f7('0x4'))};function getAccountFK(_0x1a548d){return _[_0x62f7('0x5')](_0x1a548d)+(_0x1a548d===_0x62f7('0x6')?_0x62f7('0x7'):_0x62f7('0x8'))+'Id';}function getInteractionFK(_0x2708ef){return _[_0x62f7('0x5')](_0x2708ef)+_0x62f7('0x9');}function getInteractionId(_0x4e3c79,_0x556d3a,_0xd1d750){if(_0x4e3c79&&_0x4e3c79[_['upperFirst'](_0xd1d750)+_0x62f7('0x9')]){return _0x4e3c79[_[_0x62f7('0xa')](_0xd1d750)+_0x62f7('0x9')];}else if(_0x4e3c79&&_0x4e3c79['id']){return _0x4e3c79['id'];}else if(_0x556d3a&&_0x556d3a['id']){return _0x556d3a['id'];}else{return _0x62f7('0xb');}}function getInteractionsTables(_0x163dca){return{'accounts':_0x163dca+'_'+(_0x163dca===_0x62f7('0x6')?_0x62f7('0xc'):'accounts'),'interactions':_0x163dca+'_interactions','interactionsTags':_0x163dca+_0x62f7('0xd'),'messages':_0x163dca+_0x62f7('0xe'),'userInteractions':_0x62f7('0xf')+_0x163dca+_0x62f7('0x10')};}function getSelectedTags(_0x1b953b){var _0x94dd9d=[];if(_0x1b953b){_0x94dd9d=Array[_0x62f7('0x11')](_0x1b953b)?_0x1b953b:[_0x1b953b];}return _0x94dd9d;}function log(_0x2372d9,_0x584b9e,_0x392bc5,_0x176614,_0x372f78,_0x725ecc){loggers[_0x372f78[_0x62f7('0x12')]()][_0x2372d9]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x725ecc[_0x62f7('0x13')](),_0x584b9e?_0x584b9e['id']:null,_0x584b9e?_0x584b9e[_0x62f7('0x14')]:null,_0x584b9e?_0x584b9e[_0x62f7('0x15')]:null,getInteractionId(_0x392bc5,_0x176614,_0x372f78),_0x392bc5?JSON[_0x62f7('0x16')](_0x392bc5):'null');}function updateUser(_0x253054,_0x51c300,_0x30be18,_0x195403,_0x3ed280){db[_['upperFirst'](_0x195403)+_0x62f7('0x17')][_0x62f7('0x18')]({'where':{'id':getInteractionId(_0x51c300,_0x30be18,_0x195403)}})[_0x62f7('0x19')](function(_0xf400a9){if(_0xf400a9){return _0xf400a9[_0x62f7('0x1a')]({'UserId':_0x253054?_0x253054['id']:null});}})[_0x62f7('0x19')](function(_0x59a289){if(_0x59a289){log(_0x62f7('0x1b'),_0x253054,_0x51c300,_0x30be18,_0x195403,_0x3ed280);}})['catch'](function(){log(_0x62f7('0x1c'),_0x253054,_0x51c300,_0x30be18,_0x195403,_0x3ed280);});}module[_0x62f7('0x1d')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x3ed8=['_interaction_has_tags','_messages','user_has_','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','Interaction','findOne','update','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','chat','Website','Account','capitalize','upperFirst','InteractionId','unknown','websites','accounts'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3ed8,0x183));var _0x83ed=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x3ed8[_0x4ed520];return _0x4415a6;};'use strict';var _=require(_0x83ed('0x0'));var db=require(_0x83ed('0x1'))['db'];var loggers={'openchannel':require(_0x83ed('0x2'))(_0x83ed('0x3')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0x83ed('0x2'))(_0x83ed('0x4')),'sms':require(_0x83ed('0x2'))(_0x83ed('0x5')),'chat':require(_0x83ed('0x2'))(_0x83ed('0x6')),'whatsapp':require(_0x83ed('0x2'))('whatsapp-interactions')};function getAccountFK(_0x52d2f0){return _['capitalize'](_0x52d2f0)+(_0x52d2f0===_0x83ed('0x7')?_0x83ed('0x8'):_0x83ed('0x9'))+'Id';}function getInteractionFK(_0x15b682){return _[_0x83ed('0xa')](_0x15b682)+'InteractionId';}function getInteractionId(_0x30dde8,_0x582419,_0x4b726d){if(_0x30dde8&&_0x30dde8[_[_0x83ed('0xb')](_0x4b726d)+_0x83ed('0xc')]){return _0x30dde8[_[_0x83ed('0xb')](_0x4b726d)+_0x83ed('0xc')];}else if(_0x30dde8&&_0x30dde8['id']){return _0x30dde8['id'];}else if(_0x582419&&_0x582419['id']){return _0x582419['id'];}else{return _0x83ed('0xd');}}function getInteractionsTables(_0xf3279b){return{'accounts':_0xf3279b+'_'+(_0xf3279b==='chat'?_0x83ed('0xe'):_0x83ed('0xf')),'interactions':_0xf3279b+'_interactions','interactionsTags':_0xf3279b+_0x83ed('0x10'),'messages':_0xf3279b+_0x83ed('0x11'),'userInteractions':_0x83ed('0x12')+_0xf3279b+_0x83ed('0x13')};}function getSelectedTags(_0x51d434){var _0x45e90a=[];if(_0x51d434){_0x45e90a=Array[_0x83ed('0x14')](_0x51d434)?_0x51d434:[_0x51d434];}return _0x45e90a;}function log(_0xcc1da6,_0x4e3b33,_0x3a44a4,_0x356454,_0x15837d,_0x2bf844){loggers[_0x15837d[_0x83ed('0x15')]()][_0xcc1da6](_0x83ed('0x16'),_0x2bf844['toUpperCase'](),_0x4e3b33?_0x4e3b33['id']:null,_0x4e3b33?_0x4e3b33[_0x83ed('0x17')]:null,_0x4e3b33?_0x4e3b33[_0x83ed('0x18')]:null,getInteractionId(_0x3a44a4,_0x356454,_0x15837d),_0x3a44a4?JSON[_0x83ed('0x19')](_0x3a44a4):'null');}function updateUser(_0x3d0b41,_0x43b833,_0xc01a4c,_0x23832e,_0x74794d){db[_[_0x83ed('0xb')](_0x23832e)+_0x83ed('0x1a')][_0x83ed('0x1b')]({'where':{'id':getInteractionId(_0x43b833,_0xc01a4c,_0x23832e)}})['then'](function(_0xd15f15){if(_0xd15f15){return _0xd15f15[_0x83ed('0x1c')]({'UserId':_0x3d0b41?_0x3d0b41['id']:null});}})['then'](function(_0x259bf9){if(_0x259bf9){log('info',_0x3d0b41,_0x43b833,_0xc01a4c,_0x23832e,_0x74794d);}})['catch'](function(){log(_0x83ed('0x1d'),_0x3d0b41,_0x43b833,_0xc01a4c,_0x23832e,_0x74794d);});}module[_0x83ed('0x1e')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 740ce39..c2d92d2 100644 --- a/server/components/license/service.js +++ b/server/components/license/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ca3=['json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','split','createDecipher','aes-256-ctr','format','update','base64','utf8','hasOwnProperty','use','License','then','status'];(function(_0x3889ae,_0x4770c3){var _0x6533dd=function(_0x4275f7){while(--_0x4275f7){_0x3889ae['push'](_0x3889ae['shift']());}};_0x6533dd(++_0x4770c3);}(_0x7ca3,0xae));var _0x37ca=function(_0x45f4e9,_0x5246fd){_0x45f4e9=_0x45f4e9-0x0;var _0x559d8f=_0x7ca3[_0x45f4e9];return _0x559d8f;};'use strict';var crypto=require(_0x37ca('0x0'));var util=require(_0x37ca('0x1'));var compose=require(_0x37ca('0x2'));var db=require(_0x37ca('0x3'))['db'];var config=require(_0x37ca('0x4'));function getValueFromLicense(_0x4110e9,_0x174e1a){if(_0x4110e9&&_0x174e1a){if(_0x174e1a['data1']&&_0x174e1a['license']){var _0x3c4a1a=_0x174e1a[_0x37ca('0x5')];var _0x432254=_0x174e1a['license'];var _0x99455a=_0x3c4a1a[_0x37ca('0x6')]('-')[0x4];var _0x27c424=_0x3c4a1a['split']('-')[0x0];var _0x2861f8=crypto[_0x37ca('0x7')](_0x37ca('0x8'),util[_0x37ca('0x9')]('%s:%s:%s',_0x99455a,_0x3c4a1a,_0x27c424));var _0x496f8c=_0x2861f8[_0x37ca('0xa')](_0x432254,_0x37ca('0xb'),_0x37ca('0xc'));_0x496f8c+=_0x2861f8['final']('utf8');var _0x432cfc=JSON['parse'](_0x496f8c);return _0x432cfc[_0x37ca('0xd')](_0x4110e9)?_0x432cfc[_0x4110e9]:null;}}return null;}function isLimit(_0x4093d7,_0x13d797,_0x3e6626,_0x1e6803){var _0x4f15f2=_0x13d797;return compose()[_0x37ca('0xe')](function(_0x17526c,_0x40669f,_0x1e2f7b){return db[_0x37ca('0xf')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x121050){var _0x28afe3=getValueFromLicense(_0x4093d7,_0x121050);return _0x28afe3?_0x28afe3:_0x4f15f2;})[_0x37ca('0x10')](function(_0x2658f6){_0x4f15f2=_0x2658f6;return _0x3e6626['count'](_0x1e6803);})['then'](function(_0x39a934){if(_0x39a934>=_0x4f15f2){return _0x40669f[_0x37ca('0x11')](0x193)[_0x37ca('0x12')]({'message':util['format'](_0x37ca('0x13'),_0x4093d7)});}_0x1e2f7b();})[_0x37ca('0x14')](function(_0x1743b2){_0x1e2f7b(_0x1743b2);});});}function isUserLimit(){return isLimit(_0x37ca('0x15'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0x37ca('0x16')}]}});}exports[_0x37ca('0x17')]=isUserLimit; \ No newline at end of file +var _0x2d64=['License','findOne','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','isUserLimit','composable-middleware','../../mysqldb','../../config/environment','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use'];(function(_0x4d1191,_0x38a586){var _0x141e72=function(_0x4c76ab){while(--_0x4c76ab){_0x4d1191['push'](_0x4d1191['shift']());}};_0x141e72(++_0x38a586);}(_0x2d64,0xad));var _0x42d6=function(_0x507613,_0xfe77fd){_0x507613=_0x507613-0x0;var _0x519ccf=_0x2d64[_0x507613];return _0x519ccf;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0x42d6('0x0'));var db=require(_0x42d6('0x1'))['db'];var config=require(_0x42d6('0x2'));function getValueFromLicense(_0x1014a6,_0x40995d){if(_0x1014a6&&_0x40995d){if(_0x40995d['data1']&&_0x40995d[_0x42d6('0x3')]){var _0x965417=_0x40995d['data1'];var _0x3cd890=_0x40995d[_0x42d6('0x3')];var _0x415202=_0x965417[_0x42d6('0x4')]('-')[0x4];var _0x2d045f=_0x965417['split']('-')[0x0];var _0x3ece82=crypto[_0x42d6('0x5')](_0x42d6('0x6'),util[_0x42d6('0x7')](_0x42d6('0x8'),_0x415202,_0x965417,_0x2d045f));var _0x261b58=_0x3ece82[_0x42d6('0x9')](_0x3cd890,_0x42d6('0xa'),_0x42d6('0xb'));_0x261b58+=_0x3ece82[_0x42d6('0xc')](_0x42d6('0xb'));var _0x431b28=JSON[_0x42d6('0xd')](_0x261b58);return _0x431b28[_0x42d6('0xe')](_0x1014a6)?_0x431b28[_0x1014a6]:null;}}return null;}function isLimit(_0x40fb65,_0x48f88d,_0x139676,_0xb4fe24){var _0x5ce15f=_0x48f88d;return compose()[_0x42d6('0xf')](function(_0xa7ba00,_0x2f8e53,_0x403703){return db[_0x42d6('0x10')][_0x42d6('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x42d6('0x12')](function(_0x4c450f){var _0x4b2a72=getValueFromLicense(_0x40fb65,_0x4c450f);return _0x4b2a72?_0x4b2a72:_0x5ce15f;})['then'](function(_0xd6de05){_0x5ce15f=_0xd6de05;return _0x139676[_0x42d6('0x13')](_0xb4fe24);})['then'](function(_0x5401d8){if(_0x5401d8>=_0x5ce15f){return _0x2f8e53[_0x42d6('0x14')](0x193)['json']({'message':util['format'](_0x42d6('0x15'),_0x40fb65)});}_0x403703();})[_0x42d6('0x16')](function(_0x1cdd33){_0x403703(_0x1cdd33);});});}function isUserLimit(){return isLimit(_0x42d6('0x17'),0x1,db[_0x42d6('0x18')],{'where':{'$or':[{'role':'admin'},{'role':_0x42d6('0x19')}]}});}exports[_0x42d6('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index bdfb21e..55ffec1 100644 --- a/server/components/parsers/advancedSearch.js +++ b/server/components/parsers/advancedSearch.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb72e=['map','conditions','push','$eq','operator','value','$gt','$lte','days','format','castTo','text','CAST(','field','\x20AS\x20','includes','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$startsWith','$endsWith','LIKE\x20?','<\x20?','>\x20?','>=\x20?','start','$substring','$between','DATE','utcOffset','add','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','forEach','shift','match','filter','indexOf'];(function(_0x57fa33,_0x2b8222){var _0x12e724=function(_0x481a33){while(--_0x481a33){_0x57fa33['push'](_0x57fa33['shift']());}};_0x12e724(++_0x2b8222);}(_0xb72e,0xfe));var _0xeb72=function(_0x1a22e9,_0x4b0a43){_0x1a22e9=_0x1a22e9-0x0;var _0x3a0f93=_0xb72e[_0x1a22e9];return _0x3a0f93;};'use strict';var _=require(_0xeb72('0x0'));var moment=require(_0xeb72('0x1'));exports[_0xeb72('0x2')]=function(_0x471fe9){var _0x3d6c98={'conditions':[]};_0x3d6c98[_0xeb72('0x3')]=_[_0xeb72('0x4')](_0x471fe9,_0xeb72('0x5'))?'or':_0xeb72('0x6');var _0x5f237a=_0x471fe9[_0xeb72('0x7')](_0xeb72('0x8'),'')[_0xeb72('0x7')](_0xeb72('0x5'),'')[_0xeb72('0x9')]('||');for(var _0x2586af=0x0;_0x2586af<_0x5f237a[_0xeb72('0xa')];_0x2586af++){var _0x384522=_0x5f237a[_0x2586af][_0xeb72('0x9')](':=');var _0x47b0f0=_0x384522[0x0];var _0x2160dc=_0x384522['slice'](0x1);_0x2160dc[_0xeb72('0xb')](function(_0x475afc){var _0x151022=_0x475afc[_0xeb72('0x9')]('[')[_0xeb72('0xc')]();var _0x402d83=_0x475afc[_0xeb72('0xd')](/\[(.*?)\]/g);_0x402d83[_0xeb72('0xb')](function(_0xf05b22){var _0x3a072e=_0xf05b22[_0xeb72('0x9')]('[')[_0xeb72('0xe')](function(_0x158db3){return _0x158db3[_0xeb72('0xf')](']')>-0x1;})[_0xeb72('0x10')](function(_0x2ef2d8){return _0x2ef2d8[_0xeb72('0x9')](']')[0x0];})[0x0];_0x3d6c98[_0xeb72('0x11')][_0xeb72('0x12')]({'field':_0x47b0f0,'operator':_0x151022,'value':_0x3a072e});});});}return _0x3d6c98;};exports['buildExpression']=function(_0xc2e573,_0x4cb959,_0x3f2b81){var _0x1b43b4={};if(_0x4cb959==='DATE'){if(_0x3f2b81['operator']===_0xeb72('0x13')){_0x3f2b81[_0xeb72('0x14')]='$between';_0x3f2b81[_0xeb72('0x15')]+=','+_0x3f2b81[_0xeb72('0x15')];}else if(_['includes']([_0xeb72('0x16'),_0xeb72('0x17')],_0x3f2b81[_0xeb72('0x14')])){_0x3f2b81[_0xeb72('0x15')]=moment(_0x3f2b81[_0xeb72('0x15')])['add'](0x1,_0xeb72('0x18'))[_0xeb72('0x19')]('YYYY-MM-DD');}}if(_0x3f2b81['castTo']){_0x4cb959=_0x3f2b81[_0xeb72('0x1a')];_0x1b43b4[_0xeb72('0x1b')]=_0xeb72('0x1c')+_0xc2e573+'.'+_0x3f2b81[_0xeb72('0x1d')]+_0xeb72('0x1e')+_0x3f2b81['castTo']+')\x20'+parseOperator(_0x3f2b81[_0xeb72('0x14')]);}else{_0x1b43b4[_0xeb72('0x1b')]=_0xc2e573+'.'+_0x3f2b81['field']+'\x20'+parseOperator(_0x3f2b81[_0xeb72('0x14')]);}if(_[_0xeb72('0x1f')]([_0xeb72('0x20'),_0xeb72('0x21')],_0x3f2b81['operator']))_0x1b43b4['text']='('+_0x1b43b4[_0xeb72('0x1b')]+_0xeb72('0x22')+_0xc2e573+'.'+_0x3f2b81[_0xeb72('0x1d')]+_0xeb72('0x23');_0x1b43b4[_0xeb72('0x15')]=parseValue(_0x4cb959,_0x3f2b81['operator'],_0x3f2b81['value']);return _0x1b43b4;};function parseOperator(_0x23ba39){var _0x754048;switch(_0x23ba39){case _0xeb72('0x24'):_0x754048=_0xeb72('0x25');break;case _0xeb72('0x21'):_0x754048=_0xeb72('0x26');break;case'$eq':_0x754048='=\x20?';break;case _0xeb72('0x20'):_0x754048='<>\x20?';break;case'$substring':case _0xeb72('0x27'):case _0xeb72('0x28'):_0x754048=_0xeb72('0x29');break;case'$lt':_0x754048=_0xeb72('0x2a');break;case _0xeb72('0x16'):_0x754048=_0xeb72('0x2b');break;case'$lte':_0x754048='<=\x20?';break;case'$gte':_0x754048=_0xeb72('0x2c');break;case'$between':_0x754048='BETWEEN\x20?\x20AND\x20?';break;}return _0x754048;}function parseValue(_0x491440,_0x1ad5d9,_0x33f30d){var _0x32dd43={'start':undefined,'end':undefined};switch(_0x1ad5d9){case _0xeb72('0x24'):case'$notIn':_0x32dd43[_0xeb72('0x2d')]=_0x33f30d['split'](',');break;case _0xeb72('0x2e'):_0x32dd43[_0xeb72('0x2d')]='%'+_0x33f30d+'%';break;case _0xeb72('0x27'):_0x32dd43[_0xeb72('0x2d')]=_0x33f30d+'%';break;case _0xeb72('0x28'):_0x32dd43[_0xeb72('0x2d')]='%'+_0x33f30d;break;case _0xeb72('0x2f'):var _0x56d6c5=_0x33f30d[_0xeb72('0x9')](',');var _0x33f30d=_0x56d6c5[_0xeb72('0xc')]();var _0x363ff0=_0x56d6c5['pop']();if(_0x491440===_0xeb72('0x30')){_0x33f30d=moment(_0x33f30d)['utcOffset'](0x0,!![])[_0xeb72('0x19')]();_0x363ff0=moment(_0x363ff0)[_0xeb72('0x31')](0x0,!![])[_0xeb72('0x32')](0x17,_0xeb72('0x33'))[_0xeb72('0x32')](0x3b,_0xeb72('0x34'))['add'](0x3b,_0xeb72('0x35'))[_0xeb72('0x19')]();}_0x32dd43={'start':_0x33f30d,'end':_0x363ff0};break;default:_0x32dd43[_0xeb72('0x2d')]=_0x33f30d;break;}return _0x32dd43;} \ No newline at end of file +var _0x53c9=['text','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','<\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','shift','DATE','utcOffset','add','seconds','start','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','length','slice','forEach','match','indexOf','map','push','operator','$eq','$between','value','includes','$gt','$lte','format','castTo','field'];(function(_0x170941,_0x38d105){var _0x50e48d=function(_0x1eb49a){while(--_0x1eb49a){_0x170941['push'](_0x170941['shift']());}};_0x50e48d(++_0x38d105);}(_0x53c9,0x157));var _0x953c=function(_0x23153a,_0xa2e784){_0x23153a=_0x23153a-0x0;var _0x25b6ef=_0x53c9[_0x23153a];return _0x25b6ef;};'use strict';var _=require('lodash');var moment=require(_0x953c('0x0'));exports[_0x953c('0x1')]=function(_0x13eb39){var _0x559731={'conditions':[]};_0x559731[_0x953c('0x2')]=_[_0x953c('0x3')](_0x13eb39,_0x953c('0x4'))?'or':_0x953c('0x5');var _0x192fa7=_0x13eb39['replace']('[$and]','')[_0x953c('0x6')](_0x953c('0x4'),'')[_0x953c('0x7')]('||');for(var _0x303bef=0x0;_0x303bef<_0x192fa7[_0x953c('0x8')];_0x303bef++){var _0x519c6e=_0x192fa7[_0x303bef][_0x953c('0x7')](':=');var _0x70c1b=_0x519c6e[0x0];var _0x2d7753=_0x519c6e[_0x953c('0x9')](0x1);_0x2d7753[_0x953c('0xa')](function(_0x1c3491){var _0x6ecd06=_0x1c3491['split']('[')['shift']();var _0xc1bf12=_0x1c3491[_0x953c('0xb')](/\[(.*?)\]/g);_0xc1bf12[_0x953c('0xa')](function(_0x4a739a){var _0x2e35ce=_0x4a739a['split']('[')['filter'](function(_0x43725c){return _0x43725c[_0x953c('0xc')](']')>-0x1;})[_0x953c('0xd')](function(_0x2fe0b2){return _0x2fe0b2[_0x953c('0x7')](']')[0x0];})[0x0];_0x559731['conditions'][_0x953c('0xe')]({'field':_0x70c1b,'operator':_0x6ecd06,'value':_0x2e35ce});});});}return _0x559731;};exports['buildExpression']=function(_0x3e3d72,_0x2aedeb,_0x45cf42){var _0x27b29e={};if(_0x2aedeb==='DATE'){if(_0x45cf42[_0x953c('0xf')]===_0x953c('0x10')){_0x45cf42[_0x953c('0xf')]=_0x953c('0x11');_0x45cf42[_0x953c('0x12')]+=','+_0x45cf42['value'];}else if(_[_0x953c('0x13')]([_0x953c('0x14'),_0x953c('0x15')],_0x45cf42[_0x953c('0xf')])){_0x45cf42[_0x953c('0x12')]=moment(_0x45cf42[_0x953c('0x12')])['add'](0x1,'days')[_0x953c('0x16')]('YYYY-MM-DD');}}if(_0x45cf42[_0x953c('0x17')]){_0x2aedeb=_0x45cf42['castTo'];_0x27b29e['text']='CAST('+_0x3e3d72+'.'+_0x45cf42[_0x953c('0x18')]+'\x20AS\x20'+_0x45cf42[_0x953c('0x17')]+')\x20'+parseOperator(_0x45cf42[_0x953c('0xf')]);}else{_0x27b29e[_0x953c('0x19')]=_0x3e3d72+'.'+_0x45cf42[_0x953c('0x18')]+'\x20'+parseOperator(_0x45cf42[_0x953c('0xf')]);}if(_['includes']([_0x953c('0x1a'),_0x953c('0x1b')],_0x45cf42[_0x953c('0xf')]))_0x27b29e[_0x953c('0x19')]='('+_0x27b29e['text']+'\x20OR\x20'+_0x3e3d72+'.'+_0x45cf42['field']+_0x953c('0x1c');_0x27b29e['value']=parseValue(_0x2aedeb,_0x45cf42[_0x953c('0xf')],_0x45cf42['value']);return _0x27b29e;};function parseOperator(_0x12bfbd){var _0x38a96c;switch(_0x12bfbd){case _0x953c('0x1d'):_0x38a96c=_0x953c('0x1e');break;case _0x953c('0x1b'):_0x38a96c=_0x953c('0x1f');break;case _0x953c('0x10'):_0x38a96c='=\x20?';break;case _0x953c('0x1a'):_0x38a96c=_0x953c('0x20');break;case _0x953c('0x21'):case'$startsWith':case _0x953c('0x22'):_0x38a96c=_0x953c('0x23');break;case'$lt':_0x38a96c=_0x953c('0x24');break;case _0x953c('0x14'):_0x38a96c='>\x20?';break;case _0x953c('0x15'):_0x38a96c=_0x953c('0x25');break;case _0x953c('0x26'):_0x38a96c='>=\x20?';break;case'$between':_0x38a96c=_0x953c('0x27');break;}return _0x38a96c;}function parseValue(_0x3d506e,_0x4e17c7,_0x4fdcf7){var _0x26a586={'start':undefined,'end':undefined};switch(_0x4e17c7){case _0x953c('0x1d'):case _0x953c('0x1b'):_0x26a586['start']=_0x4fdcf7[_0x953c('0x7')](',');break;case'$substring':_0x26a586['start']='%'+_0x4fdcf7+'%';break;case'$startsWith':_0x26a586['start']=_0x4fdcf7+'%';break;case'$endsWith':_0x26a586['start']='%'+_0x4fdcf7;break;case'$between':var _0xbe9389=_0x4fdcf7[_0x953c('0x7')](',');var _0x4fdcf7=_0xbe9389[_0x953c('0x28')]();var _0x416d7e=_0xbe9389['pop']();if(_0x3d506e===_0x953c('0x29')){_0x4fdcf7=moment(_0x4fdcf7)['utcOffset'](0x0,!![])[_0x953c('0x16')]();_0x416d7e=moment(_0x416d7e)[_0x953c('0x2a')](0x0,!![])['add'](0x17,'hours')[_0x953c('0x2b')](0x3b,'minutes')[_0x953c('0x2b')](0x3b,_0x953c('0x2c'))[_0x953c('0x16')]();}_0x26a586={'start':_0x4fdcf7,'end':_0x416d7e};break;default:_0x26a586[_0x953c('0x2d')]=_0x4fdcf7;break;}return _0x26a586;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index a946bb6..537247c 100644 --- a/server/components/parsers/qs.js +++ b/server/components/parsers/qs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8595=['merge','VIRTUAL','lower','options','include','push','lodash','sequelize','moment','keys','includes','parse','model','fields','raw','filters','isEmpty','forOwn','find','isPlainObject','$gte','format','YYYY-MM-DD','utc','isArray','offset','sort','split','map','indexOf','priority','unsigned','substr','cast','col','ASC','omit','isObject','isString','length','unset','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','\x22{EXPR}\x22','forEach','replace','{EXPR}','join','getOptions','$id','query','name','attributes','intersection','limit','order','where','pick','filter'];(function(_0x1cef3c,_0x5561d6){var _0x4f0d8=function(_0x1d2bcc){while(--_0x1d2bcc){_0x1cef3c['push'](_0x1cef3c['shift']());}};_0x4f0d8(++_0x5561d6);}(_0x8595,0x1b8));var _0x5859=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x8595[_0x288f5e];return _0x476cc9;};'use strict';var _=require(_0x5859('0x0'));var sequelize=require(_0x5859('0x1'));var moment=require(_0x5859('0x2'));var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1fb2a1){var _0x3f5d0f=['ne'];try{var _0x1209e8=JSON['parse'](_0x1fb2a1);var _0x4186b7=Object[_0x5859('0x3')](_0x1209e8)[0x0];return _0x3f5d0f[_0x5859('0x4')](_0x4186b7);}catch(_0x4e7014){return![];}}function getOperatorValue(_0x3478bd){var _0x26c867=JSON[_0x5859('0x5')](_0x3478bd);var _0x347852=Object[_0x5859('0x3')](_0x26c867)[0x0];var _0x48db47=_0x26c867[_0x347852];return{['$'+_0x347852]:_0x48db47};}function parseIncludeModel(_0x1a735f){var _0x596175=JSON['parse'](_0x1a735f);return{'model':db[_0x596175[_0x5859('0x6')]],'as':_0x596175['alias'],'attributes':_0x596175[_0x5859('0x7')],'raw':_0x596175[_0x5859('0x8')]};}exports[_0x5859('0x7')]=function(_0x4bd4d2){var _0x42f690=null;if(_0x4bd4d2){_0x42f690=_0x4bd4d2['split'](',');}return _0x42f690;};exports[_0x5859('0x9')]=function(_0x11de8d,_0x1fde0c){var _0x5960d2={};if(!_[_0x5859('0xa')](_0x11de8d)){_[_0x5859('0xb')](_0x11de8d,function(_0x41ddee,_0x59636c){try{if(_0x1fde0c){var _0x4f1b18=_[_0x5859('0xc')](_0x1fde0c,{'name':_0x59636c})||{};if(hasSequelizeOperator(_0x41ddee)){_0x5960d2[_0x59636c]=getOperatorValue(_0x41ddee);}else if(_0x4f1b18['type']==='DATE'&&_[_0x5859('0xd')](_0x41ddee)){var _0x434887=JSON[_0x5859('0x5')](_0x41ddee);var _0x1d6e90={'$gte':moment(moment(_0x434887[_0x5859('0xe')])[_0x5859('0xf')](_0x5859('0x10')))[_0x5859('0x11')]()[_0x5859('0xf')](),'$lte':moment(moment(_0x434887['$lte'])[_0x5859('0xf')]('YYYY-MM-DD'))['utc']()['subtract'](0x1,'s')[_0x5859('0xf')]()};_0x5960d2[_0x59636c]=_0x1d6e90;}else if(_0x4f1b18['name']==='uniqueid'){_0x5960d2[_0x59636c]=_0x41ddee;}else{_0x5960d2[_0x59636c]=_[_0x5859('0x12')](_0x41ddee)?_0x41ddee:JSON[_0x5859('0x5')](_0x41ddee);}}else{_0x5960d2[_0x59636c]=_[_0x5859('0x12')](_0x41ddee)?_0x41ddee:JSON[_0x5859('0x5')](_0x41ddee);}}catch(_0x180ed3){_0x5960d2[_0x59636c]=_0x41ddee['split'](',');}});}return _0x5960d2;};exports['limit']=function(_0x35d58f){_0x35d58f=parseInt(_0x35d58f,0xa);if(!_0x35d58f||_0x35d58f<0x0){_0x35d58f=LIMIT_VALUE;}return _0x35d58f;};exports[_0x5859('0x13')]=function(_0x2e698d){_0x2e698d=parseInt(_0x2e698d,0xa);if(!_0x2e698d||_0x2e698d<0x0){_0x2e698d=0x0;}return _0x2e698d;};exports[_0x5859('0x14')]=function(_0x3428d6){var _0x2c1cbd,_0x211546=null;if(_0x3428d6){_0x2c1cbd=_0x3428d6[_0x5859('0x15')](',');_0x211546=_[_0x5859('0x16')](_0x2c1cbd,function(_0x17a91e){if(_0x17a91e[_0x5859('0x17')]('-')===0x0){return[_0x17a91e===_0x5859('0x18')?sequelize['cast'](sequelize['col'](_0x5859('0x18')),_0x5859('0x19')):_0x17a91e[_0x5859('0x1a')](0x1),'DESC'];}else{return[_0x17a91e===_0x5859('0x18')?sequelize[_0x5859('0x1b')](sequelize[_0x5859('0x1c')](_0x5859('0x18')),_0x5859('0x19')):_0x17a91e,_0x5859('0x1d')];}});}return _0x211546;};exports[_0x5859('0x1e')]=function(_0x2d347b,_0xf23235){if(_['isEmpty'](_0x2d347b)){return _0x2d347b;}if(_[_0x5859('0x12')](_0x2d347b)){for(var _0x16cc7a=0x0;_0x16cc7a<_0x2d347b['length'];_0x16cc7a+=0x1){_0x2d347b[_0x16cc7a]=this[_0x5859('0x1e')](_0x2d347b[_0x16cc7a],_0xf23235);}return _0x2d347b;}if(!_[_0x5859('0x1f')](_0x2d347b)){return _0x2d347b;}if(_[_0x5859('0x20')](_0xf23235)){_0xf23235=[_0xf23235];}if(!_['isArray'](_0xf23235)){return _0x2d347b;}for(var _0x55fb20=0x0;_0x55fb20<_0xf23235[_0x5859('0x21')];_0x55fb20+=0x1){_[_0x5859('0x22')](_0x2d347b,_0xf23235[_0x55fb20]);}for(var _0x1b3b13 in _0x2d347b){if(_0x2d347b[_0x5859('0x23')](_0x1b3b13)){_0x2d347b[_0x1b3b13]=this['omit'](_0x2d347b[_0x1b3b13],_0xf23235);}}return _0x2d347b;};exports[_0x5859('0x24')]=function(_0x34d1bd){return _0x34d1bd[_0x5859('0x25')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x5859('0x26')]=function(_0x1b33e0){return _0x1b33e0[_0x5859('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0x5859('0x27')]=function(_0x5612fa,_0x4de5d5){var _0x3a7c2d=[];var _0x42d298=/[ `!@#$%^&*()_\-?~]/;var _0x45756c=_0x4de5d5?_0x5859('0x28'):'{EXPR}';_0x5612fa[_0x5859('0x15')](/[ ,]+/)[_0x5859('0x29')](function(_0x40e26f){_0x40e26f=_0x40e26f[_0x5859('0x2a')](/([^:]")"+/g,'$1');_0x40e26f='+'+_0x40e26f+'*';var _0x559316=_0x40e26f[_0x5859('0x25')](_0x42d298);if(_0x559316){_0x40e26f='\x22'+_0x40e26f+'\x22';}_0x3a7c2d['push'](_0x40e26f);});_0x45756c=_0x45756c[_0x5859('0x2a')](_0x5859('0x2b'),_0x3a7c2d[_0x5859('0x2c')]('\x20'));return _0x45756c;};exports[_0x5859('0x2d')]=function(_0xb94e4c,_0x458a3f,_0x201906){var _0x334bf8={},_0x39fa74={};if(_0x458a3f['query'][_0x5859('0x2e')]){_0x458a3f[_0x5859('0x2f')]['id']=_0x458a3f['query'][_0x5859('0x2e')];delete _0x458a3f[_0x5859('0x2f')][_0x5859('0x2e')];}_0x334bf8[_0x5859('0x6')]=_[_0x5859('0x16')](_0xb94e4c,_0x5859('0x30'));_0x334bf8[_0x5859('0x2f')]=_['keys'](_0x458a3f['query']);_0x334bf8[_0x5859('0x9')]=_['intersection'](_0x334bf8[_0x5859('0x6')],_0x334bf8[_0x5859('0x2f')]);_0x39fa74[_0x5859('0x31')]=_[_0x5859('0x32')](_0x334bf8['model'],this[_0x5859('0x7')](_0x458a3f[_0x5859('0x2f')]['fields']));_0x39fa74[_0x5859('0x31')]=_0x39fa74[_0x5859('0x31')][_0x5859('0x21')]?_0x39fa74[_0x5859('0x31')]:_0x334bf8[_0x5859('0x6')];if(!_0x458a3f[_0x5859('0x2f')][_0x5859('0x23')]('nolimit')){_0x39fa74['limit']=this[_0x5859('0x33')](_0x458a3f['query']['limit']);_0x39fa74['offset']=this['offset'](_0x458a3f['query']['offset']);}_0x39fa74[_0x5859('0x34')]=this[_0x5859('0x14')](_0x458a3f[_0x5859('0x2f')]['sort']);_0x39fa74[_0x5859('0x35')]=this['filters'](_[_0x5859('0x36')](_0x458a3f['query'],_0x334bf8[_0x5859('0x9')]),_0xb94e4c);if(_0x458a3f[_0x5859('0x2f')]['filter']){var _0x551652=_0xb94e4c;var _0x5b7b12=_0x458a3f['query'][_0x5859('0x37')];if(typeof _0x5b7b12==='object'){_0x551652=_[_0x5859('0x37')](_0xb94e4c,function(_0x13f4d8){return _[_0x5859('0x4')](_0x5b7b12['columns'],_0x13f4d8[_0x5859('0x30')]);});_0x5b7b12=_0x5b7b12['value'];}_0x39fa74[_0x5859('0x35')]=_[_0x5859('0x38')](_0x39fa74[_0x5859('0x35')],{'$or':_[_0x5859('0x16')](_0x551652,function(_0x527e02){if(_0x527e02['type']!==_0x5859('0x39')){if(_0x201906){return sequelize[_0x5859('0x35')](sequelize['fn'](_0x5859('0x3a'),sequelize[_0x5859('0x1c')](_0x527e02['name'])),{'$like':sequelize['fn'](_0x5859('0x3a'),'%'+_0x458a3f[_0x5859('0x2f')][_0x5859('0x37')]+'%')});}else{var _0x141065={};_0x141065[_0x527e02[_0x5859('0x30')]]={'$like':'%'+_0x458a3f['query'][_0x5859('0x37')]+'%'};return _0x141065;}}})});}_0x39fa74=_[_0x5859('0x38')]({},_0x39fa74,_0x458a3f[_0x5859('0x3b')]);return _0x39fa74;};exports[_0x5859('0x3c')]=function(_0x715a0e){var _0x5c85c5=[];if(_0x715a0e['includeAll']){_0x5c85c5[_0x5859('0x3d')]({'all':!![]});}else if(_0x715a0e[_0x5859('0x3c')]){if(Array[_0x5859('0x12')](_0x715a0e['include'])){_0x5c85c5=Object['keys'](_0x715a0e['include'])[_0x5859('0x16')](function(_0x5c661f){return parseIncludeModel(_0x715a0e['include'][_0x5c661f]);});}else{var _0x414649=parseIncludeModel(_0x715a0e[_0x5859('0x3c')]);_0x5c85c5[_0x5859('0x3d')](_0x414649);}}return _0x5c85c5;}; \ No newline at end of file +var _0x15ff=['isPlainObject','YYYY-MM-DD','utc','format','name','uniqueid','isArray','limit','offset','sort','map','indexOf','cast','col','unsigned','substr','DESC','priority','omit','length','isObject','isString','unset','isNumeric','match','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','replace','join','getOptions','query','$id','attributes','intersection','hasOwnProperty','nolimit','order','where','pick','filter','object','value','merge','VIRTUAL','lower','includeAll','push','include','lodash','sequelize','../../mysqldb','parse','keys','includes','model','fields','raw','split','filters','isEmpty','forOwn','find','type','DATE'];(function(_0x349761,_0x23baaf){var _0x5368c1=function(_0x57cae0){while(--_0x57cae0){_0x349761['push'](_0x349761['shift']());}};_0x5368c1(++_0x23baaf);}(_0x15ff,0x74));var _0xf15f=function(_0x784fec,_0x3f7922){_0x784fec=_0x784fec-0x0;var _0x33975e=_0x15ff[_0x784fec];return _0x33975e;};'use strict';var _=require(_0xf15f('0x0'));var sequelize=require(_0xf15f('0x1'));var moment=require('moment');var db=require(_0xf15f('0x2'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x53fc85){var _0x393442=['ne'];try{var _0x2d7cb4=JSON[_0xf15f('0x3')](_0x53fc85);var _0x1aa38c=Object[_0xf15f('0x4')](_0x2d7cb4)[0x0];return _0x393442[_0xf15f('0x5')](_0x1aa38c);}catch(_0x53748d){return![];}}function getOperatorValue(_0x31df48){var _0x48b6a4=JSON[_0xf15f('0x3')](_0x31df48);var _0x23a2d9=Object[_0xf15f('0x4')](_0x48b6a4)[0x0];var _0x1a981c=_0x48b6a4[_0x23a2d9];return{['$'+_0x23a2d9]:_0x1a981c};}function parseIncludeModel(_0x5748d4){var _0x28e381=JSON[_0xf15f('0x3')](_0x5748d4);return{'model':db[_0x28e381[_0xf15f('0x6')]],'as':_0x28e381['alias'],'attributes':_0x28e381[_0xf15f('0x7')],'raw':_0x28e381[_0xf15f('0x8')]};}exports['fields']=function(_0x4767f7){var _0x218e47=null;if(_0x4767f7){_0x218e47=_0x4767f7[_0xf15f('0x9')](',');}return _0x218e47;};exports[_0xf15f('0xa')]=function(_0x108ae3,_0xceec8d){var _0x1a5252={};if(!_[_0xf15f('0xb')](_0x108ae3)){_[_0xf15f('0xc')](_0x108ae3,function(_0x35767b,_0x3b5ea8){try{if(_0xceec8d){var _0x3e47c5=_[_0xf15f('0xd')](_0xceec8d,{'name':_0x3b5ea8})||{};if(hasSequelizeOperator(_0x35767b)){_0x1a5252[_0x3b5ea8]=getOperatorValue(_0x35767b);}else if(_0x3e47c5[_0xf15f('0xe')]===_0xf15f('0xf')&&_[_0xf15f('0x10')](_0x35767b)){var _0x473479=JSON[_0xf15f('0x3')](_0x35767b);var _0x37cb43={'$gte':moment(moment(_0x473479['$gte'])['format'](_0xf15f('0x11')))[_0xf15f('0x12')]()['format'](),'$lte':moment(moment(_0x473479['$lte'])[_0xf15f('0x13')]('YYYY-MM-DD'))[_0xf15f('0x12')]()['subtract'](0x1,'s')[_0xf15f('0x13')]()};_0x1a5252[_0x3b5ea8]=_0x37cb43;}else if(_0x3e47c5[_0xf15f('0x14')]===_0xf15f('0x15')){_0x1a5252[_0x3b5ea8]=_0x35767b;}else{_0x1a5252[_0x3b5ea8]=_[_0xf15f('0x16')](_0x35767b)?_0x35767b:JSON[_0xf15f('0x3')](_0x35767b);}}else{_0x1a5252[_0x3b5ea8]=_[_0xf15f('0x16')](_0x35767b)?_0x35767b:JSON[_0xf15f('0x3')](_0x35767b);}}catch(_0x4b6fd4){_0x1a5252[_0x3b5ea8]=_0x35767b['split'](',');}});}return _0x1a5252;};exports[_0xf15f('0x17')]=function(_0x1f3edb){_0x1f3edb=parseInt(_0x1f3edb,0xa);if(!_0x1f3edb||_0x1f3edb<0x0){_0x1f3edb=LIMIT_VALUE;}return _0x1f3edb;};exports[_0xf15f('0x18')]=function(_0x386bf4){_0x386bf4=parseInt(_0x386bf4,0xa);if(!_0x386bf4||_0x386bf4<0x0){_0x386bf4=0x0;}return _0x386bf4;};exports[_0xf15f('0x19')]=function(_0x42523b){var _0x3de061,_0x488647=null;if(_0x42523b){_0x3de061=_0x42523b[_0xf15f('0x9')](',');_0x488647=_[_0xf15f('0x1a')](_0x3de061,function(_0x35a8b2){if(_0x35a8b2[_0xf15f('0x1b')]('-')===0x0){return[_0x35a8b2==='priority'?sequelize[_0xf15f('0x1c')](sequelize[_0xf15f('0x1d')]('priority'),_0xf15f('0x1e')):_0x35a8b2[_0xf15f('0x1f')](0x1),_0xf15f('0x20')];}else{return[_0x35a8b2===_0xf15f('0x21')?sequelize[_0xf15f('0x1c')](sequelize['col']('priority'),'unsigned'):_0x35a8b2,'ASC'];}});}return _0x488647;};exports[_0xf15f('0x22')]=function(_0x34021d,_0x2dbee1){if(_[_0xf15f('0xb')](_0x34021d)){return _0x34021d;}if(_['isArray'](_0x34021d)){for(var _0x4add78=0x0;_0x4add78<_0x34021d[_0xf15f('0x23')];_0x4add78+=0x1){_0x34021d[_0x4add78]=this[_0xf15f('0x22')](_0x34021d[_0x4add78],_0x2dbee1);}return _0x34021d;}if(!_[_0xf15f('0x24')](_0x34021d)){return _0x34021d;}if(_[_0xf15f('0x25')](_0x2dbee1)){_0x2dbee1=[_0x2dbee1];}if(!_[_0xf15f('0x16')](_0x2dbee1)){return _0x34021d;}for(var _0x20b41b=0x0;_0x20b41b<_0x2dbee1[_0xf15f('0x23')];_0x20b41b+=0x1){_[_0xf15f('0x26')](_0x34021d,_0x2dbee1[_0x20b41b]);}for(var _0x400039 in _0x34021d){if(_0x34021d['hasOwnProperty'](_0x400039)){_0x34021d[_0x400039]=this['omit'](_0x34021d[_0x400039],_0x2dbee1);}}return _0x34021d;};exports[_0xf15f('0x27')]=function(_0x56aa1f){return _0x56aa1f[_0xf15f('0x28')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xf15f('0x29')]=function(_0x6a658c){return _0x6a658c[_0xf15f('0x28')](/^\S+@\S+$/)?!![]:![];};exports[_0xf15f('0x2a')]=function(_0x244c42,_0xbf32bf){var _0x971bc6=[];var _0x45b73d=/[ `!@#$%^&*()_\-?~]/;var _0x26d863=_0xbf32bf?_0xf15f('0x2b'):_0xf15f('0x2c');_0x244c42[_0xf15f('0x9')](/[ ,]+/)['forEach'](function(_0x5a6c6e){_0x5a6c6e=_0x5a6c6e[_0xf15f('0x2d')](/([^:]")"+/g,'$1');_0x5a6c6e='+'+_0x5a6c6e+'*';var _0x7cc6ec=_0x5a6c6e[_0xf15f('0x28')](_0x45b73d);if(_0x7cc6ec){_0x5a6c6e='\x22'+_0x5a6c6e+'\x22';}_0x971bc6['push'](_0x5a6c6e);});_0x26d863=_0x26d863[_0xf15f('0x2d')](_0xf15f('0x2c'),_0x971bc6[_0xf15f('0x2e')]('\x20'));return _0x26d863;};exports[_0xf15f('0x2f')]=function(_0x34cd24,_0x1bc0f1,_0x16a384){var _0x183fc8={},_0x1d7ca3={};if(_0x1bc0f1[_0xf15f('0x30')][_0xf15f('0x31')]){_0x1bc0f1[_0xf15f('0x30')]['id']=_0x1bc0f1[_0xf15f('0x30')][_0xf15f('0x31')];delete _0x1bc0f1[_0xf15f('0x30')][_0xf15f('0x31')];}_0x183fc8[_0xf15f('0x6')]=_[_0xf15f('0x1a')](_0x34cd24,'name');_0x183fc8['query']=_['keys'](_0x1bc0f1[_0xf15f('0x30')]);_0x183fc8[_0xf15f('0xa')]=_['intersection'](_0x183fc8[_0xf15f('0x6')],_0x183fc8['query']);_0x1d7ca3[_0xf15f('0x32')]=_[_0xf15f('0x33')](_0x183fc8[_0xf15f('0x6')],this[_0xf15f('0x7')](_0x1bc0f1[_0xf15f('0x30')][_0xf15f('0x7')]));_0x1d7ca3[_0xf15f('0x32')]=_0x1d7ca3[_0xf15f('0x32')][_0xf15f('0x23')]?_0x1d7ca3[_0xf15f('0x32')]:_0x183fc8[_0xf15f('0x6')];if(!_0x1bc0f1[_0xf15f('0x30')][_0xf15f('0x34')](_0xf15f('0x35'))){_0x1d7ca3[_0xf15f('0x17')]=this[_0xf15f('0x17')](_0x1bc0f1[_0xf15f('0x30')]['limit']);_0x1d7ca3[_0xf15f('0x18')]=this[_0xf15f('0x18')](_0x1bc0f1[_0xf15f('0x30')][_0xf15f('0x18')]);}_0x1d7ca3[_0xf15f('0x36')]=this[_0xf15f('0x19')](_0x1bc0f1[_0xf15f('0x30')][_0xf15f('0x19')]);_0x1d7ca3[_0xf15f('0x37')]=this[_0xf15f('0xa')](_[_0xf15f('0x38')](_0x1bc0f1[_0xf15f('0x30')],_0x183fc8[_0xf15f('0xa')]),_0x34cd24);if(_0x1bc0f1[_0xf15f('0x30')]['filter']){var _0x32e6d8=_0x34cd24;var _0x4c3c6c=_0x1bc0f1[_0xf15f('0x30')][_0xf15f('0x39')];if(typeof _0x4c3c6c===_0xf15f('0x3a')){_0x32e6d8=_[_0xf15f('0x39')](_0x34cd24,function(_0x2b2161){return _['includes'](_0x4c3c6c['columns'],_0x2b2161['name']);});_0x4c3c6c=_0x4c3c6c[_0xf15f('0x3b')];}_0x1d7ca3['where']=_[_0xf15f('0x3c')](_0x1d7ca3[_0xf15f('0x37')],{'$or':_['map'](_0x32e6d8,function(_0x4018e4){if(_0x4018e4[_0xf15f('0xe')]!==_0xf15f('0x3d')){if(_0x16a384){return sequelize[_0xf15f('0x37')](sequelize['fn'](_0xf15f('0x3e'),sequelize[_0xf15f('0x1d')](_0x4018e4[_0xf15f('0x14')])),{'$like':sequelize['fn']('lower','%'+_0x1bc0f1[_0xf15f('0x30')][_0xf15f('0x39')]+'%')});}else{var _0x58a21d={};_0x58a21d[_0x4018e4[_0xf15f('0x14')]]={'$like':'%'+_0x1bc0f1['query']['filter']+'%'};return _0x58a21d;}}})});}_0x1d7ca3=_[_0xf15f('0x3c')]({},_0x1d7ca3,_0x1bc0f1['options']);return _0x1d7ca3;};exports['include']=function(_0x59f6c4){var _0x18778a=[];if(_0x59f6c4[_0xf15f('0x3f')]){_0x18778a[_0xf15f('0x40')]({'all':!![]});}else if(_0x59f6c4['include']){if(Array[_0xf15f('0x16')](_0x59f6c4[_0xf15f('0x41')])){_0x18778a=Object['keys'](_0x59f6c4[_0xf15f('0x41')])['map'](function(_0x4472ad){return parseIncludeModel(_0x59f6c4[_0xf15f('0x41')][_0x4472ad]);});}else{var _0x2150bf=parseIncludeModel(_0x59f6c4[_0xf15f('0x41')]);_0x18778a[_0xf15f('0x40')](_0x2150bf);}}return _0x18778a;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 1a79721..46b7184 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['pauseType','find','globalStatus','catch','getSortedAgentsIdsByStatus','fields','order','DESC','ASC','internal','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','smsStatus','chatStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','value','filterAgentAttributes','name','role','openchannelStatusTime','mailCurrentCapacity','onhold','routealias','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','mailPause','smsPause','whatsappPause','every','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','voicePause','pause','faxStatus','mailStatus','openchannelStatus','whatsappStatus','request','Agents','error','result','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','all','flatten','uniq','includes','filter','getAgentIdsByStatus','resolve','User','findAll','fullname','chatPause','faxPause','openchannelPause'];(function(_0x48340b,_0x244588){var _0x1af24b=function(_0x5a4bec){while(--_0x5a4bec){_0x48340b['push'](_0x48340b['shift']());}};_0x1af24b(++_0x244588);}(_0xabce,0x103));var _0xeabc=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xabce[_0x521929];return _0x632436;};'use strict';var _=require(_0xeabc('0x0'));var jayson=require(_0xeabc('0x1'));var db=require(_0xeabc('0x2'))['db'];var amiClient=jayson[_0xeabc('0x3')][_0xeabc('0x4')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function isAgentPaused(_0x2e01eb,_0x1d9f37){var _0x1a88a7=[_0x2e01eb['chatPause'],_0x2e01eb['faxPause'],_0x2e01eb[_0xeabc('0x5')],_0x2e01eb['openchannelPause'],_0x2e01eb[_0xeabc('0x6')],_0x2e01eb['voicePause'],_0x2e01eb[_0xeabc('0x7')]];if(!_0x1d9f37)return _[_0xeabc('0x8')](_0x1a88a7);var _0x8434c5=_['filter'](_0x1a88a7);return _0x8434c5[_0xeabc('0x9')]>0x0&&_0x8434c5[_0xeabc('0x9')]<_0x1a88a7[_0xeabc('0x9')]?!![]:![];}function isIdle(_0x1b4d1b){return _0x1b4d1b===_0xeabc('0xa')||_0x1b4d1b===_0xeabc('0xb')||_0x1b4d1b===_0xeabc('0xc')||_0x1b4d1b===_0xeabc('0xd')||_[_0xeabc('0xe')](_0x1b4d1b);}function isAgentIdle(_0xf0d9c0){if(_0xf0d9c0[_0xeabc('0xf')]!==_0xeabc('0xa')&&_0xf0d9c0[_0xeabc('0x10')]){_0xf0d9c0[_0xeabc('0xf')]=_0xeabc('0x11');return![];}return _[_0xeabc('0x8')]([_0xf0d9c0['chatStatus'],_0xf0d9c0[_0xeabc('0x12')],_0xf0d9c0[_0xeabc('0x13')],_0xf0d9c0[_0xeabc('0x14')],_0xf0d9c0['smsStatus'],_0xf0d9c0['voiceStatus'],_0xf0d9c0[_0xeabc('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xeabc('0x16')](_0xeabc('0x17'),{})['then'](function(_0xf913d7){if(_0xf913d7[_0xeabc('0x18')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x53fe28=_0xf913d7[_0xeabc('0x19')];return routingClient['request'](_0xeabc('0x17'),{})[_0xeabc('0x1a')](function(_0x58a3c0){if(_0x58a3c0[_0xeabc('0x18')]){throw new Error(_0xeabc('0x1b'));}var _0x31f52a=_0x58a3c0[_0xeabc('0x19')];return _[_0xeabc('0x1c')]({},_0x53fe28,_0x31f52a);});})['catch'](function(_0x1253e4){throw _0x1253e4;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x31201a){var _0x16530c='unknown';if(isAgentPaused(_0x31201a))_0x16530c=_0xeabc('0x11');else if(isAgentPaused(_0x31201a,!![]))_0x16530c=_0xeabc('0x1d');else if(isAgentIdle(_0x31201a))_0x16530c=_0xeabc('0xa');else _0x16530c=_0xeabc('0x1e');return _0x16530c;}exports[_0xeabc('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x4e99a4,_0xecdbf){var _0x10c675=_[_0xeabc('0x20')](_0x4e99a4)?_0x4e99a4:[_0x4e99a4];var _0x5bdd57=_[_0xeabc('0x21')](_0xecdbf)+_0xeabc('0x22');var _0x214953=_[_0xeabc('0x23')](_0x10c675,function(_0x5b8838){return db[_0x5bdd57][_0xeabc('0x24')]({'where':{'id':_0x5b8838}})['then'](function(_0x27dbaf){if(!_0x27dbaf)return[];return _0x27dbaf['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xeabc('0x25')](_0x214953)[_0xeabc('0x1a')](function(_0x269621){var _0x3f194e=_(_0x269621)[_0xeabc('0x26')]()[_0xeabc('0x23')]('id')[_0xeabc('0x27')]()['value']();return _0x3f194e;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x459c8a,_0x5bf8f2,_0x3c1b5b){try{if(_0x5bf8f2[_0xeabc('0x9')]>0x0){_0x459c8a=_0x459c8a['filter'](function(_0x2163e6){return _0x5bf8f2[_0xeabc('0x28')](_0x2163e6['id']);});}var _0x2b568f=_0x459c8a[_0xeabc('0x29')](function(_0x149170){var _0x481ee1=_0xeabc('0x1e');if(isAgentIdle(_0x149170)){_0x481ee1=_0xeabc('0xa');}return _0x481ee1===_0x3c1b5b;});return _[_0xeabc('0x23')](_0x2b568f,'id');}catch(_0x5ebb86){throw _0x5ebb86;}}exports[_0xeabc('0x2a')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x5bb1f1,_0x2f03e8,_0x2d027e){return Promise[_0xeabc('0x2b')]()[_0xeabc('0x1a')](function(){if(_0x2f03e8[_0xeabc('0x9')]>0x0){_0x5bb1f1=_0x5bb1f1[_0xeabc('0x29')](function(_0x61c0af){return _0x2f03e8['includes'](_0x61c0af['id']);});}return _0x5bb1f1;})[_0xeabc('0x1a')](function(){return db[_0xeabc('0x2c')][_0xeabc('0x2d')]({'attributes':['id','name',_0xeabc('0x2e'),_0xeabc('0x2f'),_0xeabc('0x30'),'mailPause',_0xeabc('0x31'),_0xeabc('0x6'),_0xeabc('0x10'),'whatsappPause',_0xeabc('0x32')],'where':{'id':{'$in':_[_0xeabc('0x23')](_0x5bb1f1,'id')}},'raw':!![]});})['then'](function(_0x50cca2){return _0x50cca2[_0xeabc('0x23')](function(_0x3829a9){var _0x4fc60c=_[_0xeabc('0x33')](_0x5bb1f1,['id',_0x3829a9['id']]);var _0x81976d=filterAgentAttributes(_0x4fc60c);_[_0xeabc('0x1c')](_0x3829a9,_0x81976d);_0x3829a9[_0xeabc('0x34')]=getAgentStatus(_0x3829a9);return _0x3829a9;});})[_0xeabc('0x1a')](function(_0x4b7923){var _0x353e48=sortAgentsByStatus(_0x4b7923,_0x2d027e);return _['map'](_0x353e48,'id');})[_0xeabc('0x35')](function(_0x2bda29){throw _0x2bda29;});}exports[_0xeabc('0x36')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x5b52c4){var _0x532999={'fields':[],'order':null};var _0x452580=_0x5b52c4['split'](',');_0x532999[_0xeabc('0x37')]=_['filter'](_0x452580,function(_0x54e284){if(!_0x54e284['includes']('globalStatus')){return!![];}_0x532999[_0xeabc('0x38')]=_['startsWith'](_0x54e284,'-')?_0xeabc('0x39'):_0xeabc('0x3a');return![];});return _0x532999;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0xe8fa6e){if(!_0xe8fa6e){_0xe8fa6e='fullname,internal';}if(_0xe8fa6e[_0xeabc('0x28')]('fullname')&&!_0xe8fa6e[_0xeabc('0x28')](_0xeabc('0x3b'))){var _0xeeef02=_0xe8fa6e['substring'](0x0,_0xe8fa6e['indexOf']('fullname'));_0xe8fa6e+=','+_0xeeef02+_0xeabc('0x3b');}return _0xe8fa6e;}exports[_0xeabc('0x3c')]=validateSortParameter;function sortAgentsByStatus(_0xafa59b,_0x4c2df5){var _0x4f1897=_0xafa59b[_0xeabc('0x3d')](function(_0x1680e8,_0x5e9cb3){if(_0x1680e8[_0xeabc('0x34')]===_0x5e9cb3['globalStatus']){if(_0x1680e8[_0xeabc('0x34')]==='pause'){if(_0x4c2df5==='DESC'){return(_0x1680e8['pauseType']||'')<(_0x5e9cb3[_0xeabc('0x32')]||'')||_0x1680e8[_0xeabc('0x2e')][_0xeabc('0x3e')]()>_0x5e9cb3[_0xeabc('0x2e')]['toLowerCase']()?0x1:-0x1;}else{return(_0x1680e8[_0xeabc('0x32')]||'')<(_0x5e9cb3['pauseType']||'')||_0x1680e8[_0xeabc('0x2e')][_0xeabc('0x3e')]()>_0x5e9cb3[_0xeabc('0x2e')][_0xeabc('0x3e')]()?-0x1:0x1;}}else{if(_0x4c2df5===_0xeabc('0x39')){return _0x1680e8['fullname']['toLowerCase']()<_0x5e9cb3[_0xeabc('0x2e')]['toLowerCase']()?0x1:-0x1;}else{return _0x1680e8[_0xeabc('0x2e')][_0xeabc('0x3e')]()<_0x5e9cb3['fullname'][_0xeabc('0x3e')]()?-0x1:0x1;}}}else{if(_0x4c2df5===_0xeabc('0x39')){return _0x1680e8[_0xeabc('0x34')]<_0x5e9cb3[_0xeabc('0x34')]?0x1:-0x1;}else{return _0x1680e8[_0xeabc('0x34')]<_0x5e9cb3[_0xeabc('0x34')]?-0x1:0x1;}}});return _0x4f1897;}exports[_0xeabc('0x3f')]=sortAgentsByStatus;function filterAgentAttributes(_0x4b2fb6){var _0x3e165f=[_0xeabc('0x40'),_0xeabc('0x41'),_0xeabc('0x42'),_0xeabc('0x43'),_0xeabc('0x32'),_0xeabc('0x43'),_0xeabc('0x3b'),_0xeabc('0x44'),_0xeabc('0x2f'),'openchannelPause',_0xeabc('0x5'),_0xeabc('0x6'),_0xeabc('0x7'),_0xeabc('0x30'),_0xeabc('0x10'),_0xeabc('0x45'),_0xeabc('0x46'),'mailCapacity',_0xeabc('0x47'),_0xeabc('0x48'),_0xeabc('0x49'),_0xeabc('0x4a'),_0xeabc('0x4b'),'mailCurrentCapacity',_0xeabc('0x4c'),_0xeabc('0x4d'),_0xeabc('0x4e'),_0xeabc('0x4f'),'openchannelStatus',_0xeabc('0x13'),_0xeabc('0x50'),'whatsappStatus',_0xeabc('0x12'),'voiceStatus',_0xeabc('0x51'),'openchannelStatusTime',_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55'),_0xeabc('0x56'),_0xeabc('0x57'),_0xeabc('0x58'),_0xeabc('0x59'),_0xeabc('0x5a'),_0xeabc('0x5b'),'routealias'];var _0x180a14=[_0xeabc('0x2f'),_0xeabc('0x31'),_0xeabc('0x5'),'smsPause',_0xeabc('0x7'),_0xeabc('0x30'),_0xeabc('0x10'),_0xeabc('0x41')];var _0x5f2d2f=_(_0x4b2fb6)[_0xeabc('0x5c')](_0x180a14)[_0xeabc('0x5d')](_0x3e165f)[_0xeabc('0x5e')]();return _0x5f2d2f;}exports[_0xeabc('0x5f')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xeabc('0x60'),_0xeabc('0x2e'),_0xeabc('0x61'),_0xeabc('0x3b'),_0xeabc('0x41'),'globalStatus',_0xeabc('0x40'),'lastLoginAt','pauseType','lastPauseAt',_0xeabc('0x30'),_0xeabc('0x2f'),_0xeabc('0x5'),_0xeabc('0x31'),_0xeabc('0x6'),_0xeabc('0x10'),'whatsappPause',_0xeabc('0x4f'),_0xeabc('0x12'),_0xeabc('0x13'),_0xeabc('0x14'),_0xeabc('0x50'),_0xeabc('0xf'),_0xeabc('0x15'),_0xeabc('0x51'),'faxStatusTime','mailStatusTime',_0xeabc('0x62'),_0xeabc('0x53'),_0xeabc('0x56'),'whatsappStatusTime',_0xeabc('0x45'),'faxCapacity','mailCapacity',_0xeabc('0x46'),_0xeabc('0x47'),_0xeabc('0x48'),_0xeabc('0x4a'),_0xeabc('0x4e'),_0xeabc('0x63'),'openchannelCurrentCapacity',_0xeabc('0x4c'),_0xeabc('0x4d'),_0xeabc('0x5a'),_0xeabc('0x5b'),_0xeabc('0x58'),_0xeabc('0x64'),'queue',_0xeabc('0x65'),_0xeabc('0x59')];}exports[_0xeabc('0x66')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0xf494=['pauseType','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','startsWith','DESC','getUpdatedSortOptions','internal','substring','indexOf','sort','toLowerCase','sortAgentsByStatus','userpic','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','whatsappStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','whatsappStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','online','omit','filterAgentAttributes','faxStatusTime','smsStatusTime','phoneBarEnableScreenRecordingByAgent','onhold','routealias','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','http','client','chatPause','faxPause','mailPause','openchannelPause','smsPause','every','filter','length','idle','unavailable','ringing','voicePause','voiceStatus','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge','catch','getRealtimeAgents','unknown','pause','*pause','getAgentStatus','isArray','startCase','Queue','map','all','flatten','uniq','value','getAgentIdsByQueues','resolve','includes','User','findAll','name','fullname','whatsappPause'];(function(_0x22d76b,_0x5c8d23){var _0x2184ad=function(_0x8430af){while(--_0x8430af){_0x22d76b['push'](_0x22d76b['shift']());}};_0x2184ad(++_0x5c8d23);}(_0xf494,0x1c6));var _0x4f49=function(_0xb518e5,_0x5b627c){_0xb518e5=_0xb518e5-0x0;var _0x59c78e=_0xf494[_0xb518e5];return _0x59c78e;};'use strict';var _=require(_0x4f49('0x0'));var jayson=require(_0x4f49('0x1'));var db=require(_0x4f49('0x2'))['db'];var amiClient=jayson['client'][_0x4f49('0x3')]({'port':0x232a});var routingClient=jayson[_0x4f49('0x4')][_0x4f49('0x3')]({'port':0x232c});function isAgentPaused(_0x25677c,_0x20c0d7){var _0x2a15fb=[_0x25677c[_0x4f49('0x5')],_0x25677c[_0x4f49('0x6')],_0x25677c[_0x4f49('0x7')],_0x25677c[_0x4f49('0x8')],_0x25677c[_0x4f49('0x9')],_0x25677c['voicePause'],_0x25677c['whatsappPause']];if(!_0x20c0d7)return _[_0x4f49('0xa')](_0x2a15fb);var _0x327bd5=_[_0x4f49('0xb')](_0x2a15fb);return _0x327bd5[_0x4f49('0xc')]>0x0&&_0x327bd5[_0x4f49('0xc')]<_0x2a15fb[_0x4f49('0xc')]?!![]:![];}function isIdle(_0x151d8c){return _0x151d8c===_0x4f49('0xd')||_0x151d8c==='unknown'||_0x151d8c===_0x4f49('0xe')||_0x151d8c===_0x4f49('0xf')||_['isNil'](_0x151d8c);}function isAgentIdle(_0x15e7a1){if(_0x15e7a1['voiceStatus']!=='idle'&&_0x15e7a1[_0x4f49('0x10')]){_0x15e7a1[_0x4f49('0x11')]='pause';return![];}return _[_0x4f49('0xa')]([_0x15e7a1[_0x4f49('0x12')],_0x15e7a1[_0x4f49('0x13')],_0x15e7a1[_0x4f49('0x14')],_0x15e7a1[_0x4f49('0x15')],_0x15e7a1[_0x4f49('0x16')],_0x15e7a1[_0x4f49('0x11')],_0x15e7a1['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0x4f49('0x17')](_0x4f49('0x18'),{})[_0x4f49('0x19')](function(_0x5878f4){if(_0x5878f4['error']){throw new Error(_0x4f49('0x1a'));}var _0x2ecaaa=_0x5878f4[_0x4f49('0x1b')];return routingClient['request'](_0x4f49('0x18'),{})[_0x4f49('0x19')](function(_0x4e85df){if(_0x4e85df['error']){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x560592=_0x4e85df['result'];return _[_0x4f49('0x1c')]({},_0x2ecaaa,_0x560592);});})[_0x4f49('0x1d')](function(_0x1c2d70){throw _0x1c2d70;});}exports[_0x4f49('0x1e')]=getRealtimeAgents;function getAgentStatus(_0x5793ac){var _0x416893=_0x4f49('0x1f');if(isAgentPaused(_0x5793ac))_0x416893=_0x4f49('0x20');else if(isAgentPaused(_0x5793ac,!![]))_0x416893=_0x4f49('0x21');else if(isAgentIdle(_0x5793ac))_0x416893=_0x4f49('0xd');else _0x416893='busy';return _0x416893;}exports[_0x4f49('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0x357446,_0x3ae590){var _0x53b57d=_[_0x4f49('0x23')](_0x357446)?_0x357446:[_0x357446];var _0x1d70a7=_[_0x4f49('0x24')](_0x3ae590)+_0x4f49('0x25');var _0x9d30aa=_[_0x4f49('0x26')](_0x53b57d,function(_0x559d98){return db[_0x1d70a7]['findOne']({'where':{'id':_0x559d98}})[_0x4f49('0x19')](function(_0x429de7){if(!_0x429de7)return[];return _0x429de7['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x4f49('0x27')](_0x9d30aa)[_0x4f49('0x19')](function(_0x35f8e0){var _0x525950=_(_0x35f8e0)[_0x4f49('0x28')]()[_0x4f49('0x26')]('id')[_0x4f49('0x29')]()[_0x4f49('0x2a')]();return _0x525950;});}exports[_0x4f49('0x2b')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x122404,_0x4915af,_0x50c571){try{if(_0x4915af[_0x4f49('0xc')]>0x0){_0x122404=_0x122404[_0x4f49('0xb')](function(_0x605c91){return _0x4915af['includes'](_0x605c91['id']);});}var _0x3cbfbd=_0x122404[_0x4f49('0xb')](function(_0x43d8e3){var _0x506b20='busy';if(isAgentIdle(_0x43d8e3)){_0x506b20=_0x4f49('0xd');}return _0x506b20===_0x50c571;});return _[_0x4f49('0x26')](_0x3cbfbd,'id');}catch(_0x7a6ea0){throw _0x7a6ea0;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1eaac6,_0x35aa33,_0x173657){return Promise[_0x4f49('0x2c')]()[_0x4f49('0x19')](function(){if(_0x35aa33[_0x4f49('0xc')]>0x0){_0x1eaac6=_0x1eaac6[_0x4f49('0xb')](function(_0x45ae19){return _0x35aa33[_0x4f49('0x2d')](_0x45ae19['id']);});}return _0x1eaac6;})[_0x4f49('0x19')](function(){return db[_0x4f49('0x2e')][_0x4f49('0x2f')]({'attributes':['id',_0x4f49('0x30'),_0x4f49('0x31'),_0x4f49('0x5'),_0x4f49('0x6'),_0x4f49('0x7'),_0x4f49('0x8'),_0x4f49('0x9'),'voicePause',_0x4f49('0x32'),_0x4f49('0x33')],'where':{'id':{'$in':_[_0x4f49('0x26')](_0x1eaac6,'id')}},'raw':!![]});})[_0x4f49('0x19')](function(_0x1c3af8){return _0x1c3af8[_0x4f49('0x26')](function(_0x2cbe4e){var _0x3ad6a7=_[_0x4f49('0x34')](_0x1eaac6,['id',_0x2cbe4e['id']]);var _0x338db8=filterAgentAttributes(_0x3ad6a7);_[_0x4f49('0x1c')](_0x2cbe4e,_0x338db8);_0x2cbe4e[_0x4f49('0x35')]=getAgentStatus(_0x2cbe4e);return _0x2cbe4e;});})[_0x4f49('0x19')](function(_0x4d2d57){var _0x371282=sortAgentsByStatus(_0x4d2d57,_0x173657);return _[_0x4f49('0x26')](_0x371282,'id');})[_0x4f49('0x1d')](function(_0x26014f){throw _0x26014f;});}exports[_0x4f49('0x36')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x3ee818){var _0xe1b662={'fields':[],'order':null};var _0x25fdf8=_0x3ee818[_0x4f49('0x37')](',');_0xe1b662[_0x4f49('0x38')]=_[_0x4f49('0xb')](_0x25fdf8,function(_0x141db){if(!_0x141db[_0x4f49('0x2d')](_0x4f49('0x35'))){return!![];}_0xe1b662['order']=_[_0x4f49('0x39')](_0x141db,'-')?_0x4f49('0x3a'):'ASC';return![];});return _0xe1b662;}exports[_0x4f49('0x3b')]=getUpdatedSortOptions;function validateSortParameter(_0xbf05f3){if(!_0xbf05f3){_0xbf05f3='fullname,internal';}if(_0xbf05f3[_0x4f49('0x2d')](_0x4f49('0x31'))&&!_0xbf05f3[_0x4f49('0x2d')](_0x4f49('0x3c'))){var _0x3bfe7e=_0xbf05f3[_0x4f49('0x3d')](0x0,_0xbf05f3[_0x4f49('0x3e')]('fullname'));_0xbf05f3+=','+_0x3bfe7e+'internal';}return _0xbf05f3;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x15e4b3,_0x15b280){var _0x2e4355=_0x15e4b3[_0x4f49('0x3f')](function(_0x1053b2,_0x1ecf6c){if(_0x1053b2[_0x4f49('0x35')]===_0x1ecf6c[_0x4f49('0x35')]){if(_0x1053b2[_0x4f49('0x35')]==='pause'){if(_0x15b280==='DESC'){return(_0x1053b2[_0x4f49('0x33')]||'')<(_0x1ecf6c[_0x4f49('0x33')]||'')||_0x1053b2[_0x4f49('0x31')]['toLowerCase']()>_0x1ecf6c[_0x4f49('0x31')]['toLowerCase']()?0x1:-0x1;}else{return(_0x1053b2['pauseType']||'')<(_0x1ecf6c[_0x4f49('0x33')]||'')||_0x1053b2[_0x4f49('0x31')][_0x4f49('0x40')]()>_0x1ecf6c['fullname'][_0x4f49('0x40')]()?-0x1:0x1;}}else{if(_0x15b280===_0x4f49('0x3a')){return _0x1053b2['fullname'][_0x4f49('0x40')]()<_0x1ecf6c['fullname'][_0x4f49('0x40')]()?0x1:-0x1;}else{return _0x1053b2[_0x4f49('0x31')][_0x4f49('0x40')]()<_0x1ecf6c['fullname'][_0x4f49('0x40')]()?-0x1:0x1;}}}else{if(_0x15b280===_0x4f49('0x3a')){return _0x1053b2[_0x4f49('0x35')]<_0x1ecf6c[_0x4f49('0x35')]?0x1:-0x1;}else{return _0x1053b2[_0x4f49('0x35')]<_0x1ecf6c[_0x4f49('0x35')]?-0x1:0x1;}}});return _0x2e4355;}exports[_0x4f49('0x41')]=sortAgentsByStatus;function filterAgentAttributes(_0x356785){var _0x435192=[_0x4f49('0x42'),'online',_0x4f49('0x43'),_0x4f49('0x44'),'pauseType',_0x4f49('0x44'),'internal',_0x4f49('0x45'),_0x4f49('0x5'),_0x4f49('0x8'),_0x4f49('0x7'),'smsPause',_0x4f49('0x32'),_0x4f49('0x6'),_0x4f49('0x10'),_0x4f49('0x46'),_0x4f49('0x47'),_0x4f49('0x48'),_0x4f49('0x49'),_0x4f49('0x4a'),_0x4f49('0x4b'),_0x4f49('0x4c'),_0x4f49('0x4d'),_0x4f49('0x4e'),_0x4f49('0x4f'),_0x4f49('0x50'),_0x4f49('0x51'),_0x4f49('0x12'),'openchannelStatus','mailStatus',_0x4f49('0x16'),_0x4f49('0x52'),_0x4f49('0x13'),_0x4f49('0x11'),_0x4f49('0x53'),_0x4f49('0x54'),_0x4f49('0x55'),'smsStatusTime',_0x4f49('0x56'),'faxStatusTime',_0x4f49('0x57'),_0x4f49('0x58'),_0x4f49('0x59'),_0x4f49('0x5a'),'phoneBarEnableScreenRecordingByAgent',_0x4f49('0x5b'),'routealias'];var _0x52d18c=[_0x4f49('0x5'),_0x4f49('0x8'),_0x4f49('0x7'),_0x4f49('0x9'),'whatsappPause','faxPause',_0x4f49('0x10'),_0x4f49('0x5c')];var _0x5cb187=_(_0x356785)[_0x4f49('0x5d')](_0x52d18c)['pick'](_0x435192)['value']();return _0x5cb187;}exports[_0x4f49('0x5e')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id','name',_0x4f49('0x31'),'role',_0x4f49('0x3c'),_0x4f49('0x5c'),_0x4f49('0x35'),_0x4f49('0x42'),_0x4f49('0x43'),_0x4f49('0x33'),_0x4f49('0x44'),_0x4f49('0x6'),'chatPause',_0x4f49('0x7'),'openchannelPause',_0x4f49('0x9'),_0x4f49('0x10'),_0x4f49('0x32'),_0x4f49('0x12'),_0x4f49('0x13'),_0x4f49('0x14'),'openchannelStatus',_0x4f49('0x16'),_0x4f49('0x11'),'whatsappStatus','chatStatusTime',_0x4f49('0x5f'),_0x4f49('0x55'),_0x4f49('0x54'),_0x4f49('0x60'),_0x4f49('0x57'),'whatsappStatusTime',_0x4f49('0x46'),'faxCapacity',_0x4f49('0x48'),_0x4f49('0x47'),_0x4f49('0x49'),'whatsappCapacity',_0x4f49('0x4c'),_0x4f49('0x51'),_0x4f49('0x4e'),_0x4f49('0x4d'),'smsCurrentCapacity',_0x4f49('0x50'),_0x4f49('0x61'),'phoneBarEnableAutomaticScreenRecording',_0x4f49('0x59'),_0x4f49('0x62'),_0x4f49('0x58'),_0x4f49('0x63'),_0x4f49('0x5a')];}exports[_0x4f49('0x64')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index ac75158..96bc1f7 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeeab=['getRealtimeQueues','inbound','concat','map','get','paused','outbound','originated','find','merge','initializeQueues','lodash','jayson/promise','util','http','client','available','loggedIn','waiting','busy','inUse','invalid','loggedInDb','notInUse','onHold','ringInUse','unavailable','unknown','pTalking','message','statusMessage','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','then','format','result','catch'];(function(_0x3c7731,_0x3b50fc){var _0x50f36b=function(_0x29304d){while(--_0x29304d){_0x3c7731['push'](_0x3c7731['shift']());}};_0x50f36b(++_0x3b50fc);}(_0xeeab,0x185));var _0xbeea=function(_0x1f8264,_0x25b2ed){_0x1f8264=_0x1f8264-0x0;var _0x255f33=_0xeeab[_0x1f8264];return _0x255f33;};'use strict';var _=require(_0xbeea('0x0'));var jayson=require(_0xbeea('0x1'));var util=require(_0xbeea('0x2'));var amiClient=jayson['client'][_0xbeea('0x3')]({'port':0x232a});var routingClient=jayson[_0xbeea('0x4')][_0xbeea('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xbeea('0x5'),_0xbeea('0x6'),'paused',_0xbeea('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0xbeea('0x8'),_0xbeea('0x9'),_0xbeea('0xa'),_0xbeea('0xb'),_0xbeea('0xc'),_0xbeea('0xd'),'ringing',_0xbeea('0xe'),'talking',_0xbeea('0xf'),_0xbeea('0x10')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xbeea('0x11'),'originated',_0xbeea('0x12'),_0xbeea('0x13'),_0xbeea('0x14'),_0xbeea('0x15'),_0xbeea('0x16'),'startPredictive',_0xbeea('0x17'),_0xbeea('0x18'),_0xbeea('0x19'),_0xbeea('0x1a'),'erlangBusyFactor',_0xbeea('0x1b'),'dialPredictiveIntervalMaxThreshold',_0xbeea('0x1c'),_0xbeea('0x1d'),_0xbeea('0x1e'),_0xbeea('0x1f'),_0xbeea('0x20'),_0xbeea('0x21'),_0xbeea('0x22'),_0xbeea('0x23')];function getRealtimeQueues(_0x3fecc1,_0x40ed37){var _0x2fdc53=_0x40ed37===_0xbeea('0x24')?amiClient:routingClient;return _0x2fdc53[_0xbeea('0x25')](_[_0xbeea('0x26')](_0x40ed37)+'Queues',_0x3fecc1)[_0xbeea('0x27')](function(_0xe297c2){if(_0xe297c2['error'])throw new Error(util[_0xbeea('0x28')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x40ed37));return _0xe297c2[_0xbeea('0x29')];})[_0xbeea('0x2a')](function(_0x14bd99){throw _0x14bd99;});}exports[_0xbeea('0x2b')]=getRealtimeQueues;function initializeQueues(_0x1a2e21,_0x4e1aa0,_0x399074,_0x48d00e){var _0x44fda0=DEFAULT_QUEUE_ATTRIBUTES;if(_0x399074==='voice'){if(_0x48d00e===_0xbeea('0x2c')){_0x44fda0=_0x44fda0[_0xbeea('0x2d')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x48d00e==='outbound'){_0x44fda0=_0x44fda0[_0xbeea('0x2d')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x1a2e21[_0xbeea('0x2e')](function(_0x14e25c){var _0x2b6db9=_0x14e25c[_0xbeea('0x2f')]({'plain':!![]});_0x2b6db9[_0xbeea('0x30')]=0x0;_0x2b6db9[_0xbeea('0xb')]=0x0;_0x2b6db9[_0xbeea('0x6')]=0x0;_0x2b6db9[_0xbeea('0x5')]=0x0;_0x2b6db9['waiting']=0x0;if(_0x399074===_0xbeea('0x24')){_0x2b6db9['talking']=0x0;_0x2b6db9['busy']=0x0;if(_0x48d00e===_0xbeea('0x31')){_0x2b6db9[_0xbeea('0x11')]=0x0;_0x2b6db9[_0xbeea('0x32')]=0x0;}}var _0x1ddada=_[_0xbeea('0x33')](_0x4e1aa0,['id',_0x2b6db9['id']]);if(_0x1ddada){_[_0xbeea('0x34')](_0x2b6db9,_['pick'](_0x1ddada,_0x44fda0));}return _0x2b6db9;});}exports[_0xbeea('0x35')]=initializeQueues; \ No newline at end of file +var _0xcc19=['jayson/promise','util','client','http','available','loggedIn','paused','waiting','busy','inUse','invalid','loggedInDb','onHold','ringing','ringInUse','talking','unavailable','unknown','pTalking','message','statusMessage','dialActive','Trunk','startProgressive','erlangCalls','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','request','startCase','Queues','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','voice','inbound','concat','outbound','map','get','originated','find','merge','pick','initializeQueues','lodash'];(function(_0x269d1b,_0x5baebe){var _0x58df11=function(_0x5eb5c0){while(--_0x5eb5c0){_0x269d1b['push'](_0x269d1b['shift']());}};_0x58df11(++_0x5baebe);}(_0xcc19,0x1e5));var _0x9cc1=function(_0xfa260b,_0xd2d0d){_0xfa260b=_0xfa260b-0x0;var _0x48fb84=_0xcc19[_0xfa260b];return _0x48fb84;};'use strict';var _=require(_0x9cc1('0x0'));var jayson=require(_0x9cc1('0x1'));var util=require(_0x9cc1('0x2'));var amiClient=jayson[_0x9cc1('0x3')]['http']({'port':0x232a});var routingClient=jayson['client'][_0x9cc1('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x9cc1('0x5'),_0x9cc1('0x6'),_0x9cc1('0x7'),_0x9cc1('0x8')];var VOICE_QUEUE_ATTRIBUTES=[_0x9cc1('0x9'),_0x9cc1('0xa'),_0x9cc1('0xb'),_0x9cc1('0xc'),'notInUse',_0x9cc1('0xd'),_0x9cc1('0xe'),_0x9cc1('0xf'),_0x9cc1('0x10'),_0x9cc1('0x11'),_0x9cc1('0x12')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x9cc1('0x13'),'originated',_0x9cc1('0x14'),_0x9cc1('0x15'),_0x9cc1('0x16'),'dialMethod',_0x9cc1('0x17'),'startPredictive',_0x9cc1('0x18'),_0x9cc1('0x19'),'erlangCallToSecond','erlangAbandonmentRate',_0x9cc1('0x1a'),_0x9cc1('0x1b'),_0x9cc1('0x1c'),_0x9cc1('0x1d'),'predictiveIntervalAvailable',_0x9cc1('0x1e'),'predictiveIntervalAnsweredCalls',_0x9cc1('0x1f'),_0x9cc1('0x20'),_0x9cc1('0x21'),_0x9cc1('0x22')];function getRealtimeQueues(_0x51e931,_0x366375){var _0x401ae8=_0x366375==='voice'?amiClient:routingClient;return _0x401ae8[_0x9cc1('0x23')](_[_0x9cc1('0x24')](_0x366375)+_0x9cc1('0x25'),_0x51e931)[_0x9cc1('0x26')](function(_0x18e1c5){if(_0x18e1c5['error'])throw new Error(util[_0x9cc1('0x27')](_0x9cc1('0x28'),_0x366375));return _0x18e1c5[_0x9cc1('0x29')];})['catch'](function(_0x3792f3){throw _0x3792f3;});}exports[_0x9cc1('0x2a')]=getRealtimeQueues;function initializeQueues(_0x35563f,_0xb4ee5,_0x3f84c3,_0x7dacb1){var _0x4e8566=DEFAULT_QUEUE_ATTRIBUTES;if(_0x3f84c3===_0x9cc1('0x2b')){if(_0x7dacb1===_0x9cc1('0x2c')){_0x4e8566=_0x4e8566[_0x9cc1('0x2d')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x7dacb1===_0x9cc1('0x2e')){_0x4e8566=_0x4e8566[_0x9cc1('0x2d')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x35563f[_0x9cc1('0x2f')](function(_0xc3aecf){var _0x1af5e4=_0xc3aecf[_0x9cc1('0x30')]({'plain':!![]});_0x1af5e4[_0x9cc1('0x7')]=0x0;_0x1af5e4['loggedInDb']=0x0;_0x1af5e4['loggedIn']=0x0;_0x1af5e4[_0x9cc1('0x5')]=0x0;_0x1af5e4['waiting']=0x0;if(_0x3f84c3===_0x9cc1('0x2b')){_0x1af5e4[_0x9cc1('0x10')]=0x0;_0x1af5e4[_0x9cc1('0x9')]=0x0;if(_0x7dacb1===_0x9cc1('0x2e')){_0x1af5e4[_0x9cc1('0x13')]=0x0;_0x1af5e4[_0x9cc1('0x31')]=0x0;}}var _0x1041d2=_[_0x9cc1('0x32')](_0xb4ee5,['id',_0x1af5e4['id']]);if(_0x1041d2){_[_0x9cc1('0x33')](_0x1af5e4,_[_0x9cc1('0x34')](_0x1041d2,_0x4e8566));}return _0x1af5e4;});}exports[_0x9cc1('0x35')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index dba0c55..6aa2b7b 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x14e4c8,_0x2dad18){var _0x488280=function(_0x569ff8){while(--_0x569ff8){_0x14e4c8['push'](_0x14e4c8['shift']());}};_0x488280(++_0x2dad18);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x2db025,_0x1cf6de){var _0x47afbe=function(_0x37840e){while(--_0x37840e){_0x2db025['push'](_0x2db025['shift']());}};_0x47afbe(++_0x1cf6de);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 80a317f..85fe79d 100644 --- a/server/config/license/hardware.js +++ b/server/config/license/hardware.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe66f=['map','model','join','createHash','digest','getUuid','platform','licenseToken','win32','utf8','ipAddress','md5','substring','crypto','bimedia-machine-uuid','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','concat','head','mac','address','127.0.0.1','getFirstInterface','cpus'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xe66f,0xfd));var _0xfe66=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xe66f[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xfe66('0x0'));var machine=require(_0xfe66('0x1'));var exec=require('child_process')[_0xfe66('0x2')];var config=require(_0xfe66('0x3'));function getInterfaces(){var _0x338a92=[];var _0x1e16e8=os[_0xfe66('0x4')]();var _0xea1e0c=_[_0xfe66('0x5')](_[_0xfe66('0x6')](_0x1e16e8));for(var _0x4895cc=0x0;_0x4895cc<_0xea1e0c[_0xfe66('0x7')];_0x4895cc++){var _0x2cdc73=_0x1e16e8[_0xea1e0c[_0x4895cc]][_0xfe66('0x8')](function(_0x5d45ba){return _0x5d45ba[_0xfe66('0x9')]==='IPv4'&&_0x5d45ba['internal']===![];});_0x338a92=_0x338a92[_0xfe66('0xa')](_0x2cdc73);}return _0x338a92;}function getFirstInterface(){var _0xbc4af7=_[_0xfe66('0xb')](getInterfaces());return{'macAddress':_0xbc4af7&&_0xbc4af7[_0xfe66('0xc')]?_0xbc4af7['mac']:'00:00:00:00:00:00','ipAddress':_0xbc4af7&&_0xbc4af7[_0xfe66('0xd')]?_0xbc4af7[_0xfe66('0xd')]:_0xfe66('0xe')};}exports[_0xfe66('0xf')]=getFirstInterface;function getCPUhash(){var _0x4c2963=_[_0xfe66('0x5')](os[_0xfe66('0x10')]()[_0xfe66('0x11')](function(_0x49976f){return _0x49976f[_0xfe66('0x12')];}))[_0xfe66('0x13')](':');return crypto[_0xfe66('0x14')]('md5')['update'](_0x4c2963)[_0xfe66('0x15')]('hex');}exports[_0xfe66('0x16')]=function(){var _0xf099c8=os[_0xfe66('0x17')]();var _0x26cef3=/[0-9a-f-]{36}/;if(config[_0xfe66('0x18')]&&_0x26cef3['test'](config[_0xfe66('0x18')])){return config[_0xfe66('0x18')];}else if(_0xf099c8===_0xfe66('0x19')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xfe66('0x1a')})['replace']('\x0d\x0a','');}else{var _0x37321e=getFirstInterface();var _0x12bca8=getCPUhash();var _0x48949b=_0x12bca8+'|'+os['hostname']()+'|'+_0x37321e['macAddress']+'|'+_0x37321e[_0xfe66('0x1b')];var _0xcd536c=crypto[_0xfe66('0x14')](_0xfe66('0x1c'))['update'](_0x48949b)['digest']('hex');return _0xcd536c[_0xfe66('0x1d')](0x0,0x8)+'-'+_0xcd536c[_0xfe66('0x1d')](0x8,0xc)+'-'+_0xcd536c['substring'](0xc,0x10)+'-'+_0xcd536c[_0xfe66('0x1d')](0x10,0x14)+'-'+_0xcd536c[_0xfe66('0x1d')](0x14);}}; \ No newline at end of file +var _0x8321=['hostname','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','../environment','orderBy','keys','length','filter','family','IPv4','internal','head','address','127.0.0.1','getFirstInterface','cpus','model','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','replace'];(function(_0x2d3021,_0x2492b8){var _0x128dfe=function(_0x1ac5ce){while(--_0x1ac5ce){_0x2d3021['push'](_0x2d3021['shift']());}};_0x128dfe(++_0x2492b8);}(_0x8321,0x14d));var _0x1832=function(_0x5245d1,_0x3f0c61){_0x5245d1=_0x5245d1-0x0;var _0x22ad4a=_0x8321[_0x5245d1];return _0x22ad4a;};'use strict';var _=require(_0x1832('0x0'));var os=require('os');var crypto=require(_0x1832('0x1'));var machine=require(_0x1832('0x2'));var exec=require('child_process')['execSync'];var config=require(_0x1832('0x3'));function getInterfaces(){var _0xdcd084=[];var _0x1958fa=os['networkInterfaces']();var _0x573458=_[_0x1832('0x4')](_[_0x1832('0x5')](_0x1958fa));for(var _0x39b141=0x0;_0x39b141<_0x573458[_0x1832('0x6')];_0x39b141++){var _0x2782e5=_0x1958fa[_0x573458[_0x39b141]][_0x1832('0x7')](function(_0x4bdc7f){return _0x4bdc7f[_0x1832('0x8')]===_0x1832('0x9')&&_0x4bdc7f[_0x1832('0xa')]===![];});_0xdcd084=_0xdcd084['concat'](_0x2782e5);}return _0xdcd084;}function getFirstInterface(){var _0x4e48d7=_[_0x1832('0xb')](getInterfaces());return{'macAddress':_0x4e48d7&&_0x4e48d7['mac']?_0x4e48d7['mac']:'00:00:00:00:00:00','ipAddress':_0x4e48d7&&_0x4e48d7[_0x1832('0xc')]?_0x4e48d7[_0x1832('0xc')]:_0x1832('0xd')};}exports[_0x1832('0xe')]=getFirstInterface;function getCPUhash(){var _0x5ce6c4=_['orderBy'](os[_0x1832('0xf')]()['map'](function(_0x412ffe){return _0x412ffe[_0x1832('0x10')];}))[_0x1832('0x11')](':');return crypto[_0x1832('0x12')](_0x1832('0x13'))[_0x1832('0x14')](_0x5ce6c4)[_0x1832('0x15')](_0x1832('0x16'));}exports[_0x1832('0x17')]=function(){var _0x2c1a74=os[_0x1832('0x18')]();var _0x57eb0d=/[0-9a-f-]{36}/;if(config[_0x1832('0x19')]&&_0x57eb0d[_0x1832('0x1a')](config['licenseToken'])){return config[_0x1832('0x19')];}else if(_0x2c1a74==='win32'){return exec(_0x1832('0x1b'),{'encoding':_0x1832('0x1c')})[_0x1832('0x1d')]('\x0d\x0a','');}else{var _0x56de64=getFirstInterface();var _0x31e8e0=getCPUhash();var _0x2fb0fe=_0x31e8e0+'|'+os[_0x1832('0x1e')]()+'|'+_0x56de64['macAddress']+'|'+_0x56de64[_0x1832('0x1f')];var _0x50af63=crypto[_0x1832('0x12')](_0x1832('0x13'))[_0x1832('0x14')](_0x2fb0fe)['digest'](_0x1832('0x16'));return _0x50af63[_0x1832('0x20')](0x0,0x8)+'-'+_0x50af63[_0x1832('0x20')](0x8,0xc)+'-'+_0x50af63['substring'](0xc,0x10)+'-'+_0x50af63[_0x1832('0x20')](0x10,0x14)+'-'+_0x50af63[_0x1832('0x20')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index d8953f7..46347c7 100644 --- a/server/config/license/index.js +++ b/server/config/license/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2447=['encryptString','diff','days','DEMO\x20START\x20AT\x20%s','error','message','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','license','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm'];(function(_0x1152bb,_0x322e59){var _0x58ddd3=function(_0x346fd8){while(--_0x346fd8){_0x1152bb['push'](_0x1152bb['shift']());}};_0x58ddd3(++_0x322e59);}(_0x2447,0x131));var _0x7244=function(_0x2f0a23,_0xdcad7b){_0x2f0a23=_0x2f0a23-0x0;var _0x42cee1=_0x2447[_0x2f0a23];return _0x42cee1;};'use strict';var util=require(_0x7244('0x0'));var moment=require(_0x7244('0x1'));var rp=require(_0x7244('0x2'));var BPromise=require(_0x7244('0x3'));var pkginfo=require(_0x7244('0x4'))(module,_0x7244('0x5'));var db=require(_0x7244('0x6'))['db'];var encryptor=require(_0x7244('0x7'));var hardware=require(_0x7244('0x8'));var logger=require('../logger')(_0x7244('0x9'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x131bc7){return new BPromise(function(_0x2b6a67,_0x2eb578){var _0x2846b3=util[_0x7244('0xa')](_0x7244('0xb'),HOST,_0x131bc7,module[_0x7244('0xc')][_0x7244('0x5')]);if(oldToken){_0x2846b3=util[_0x7244('0xa')](_0x7244('0xd'),HOST,_0x131bc7,module[_0x7244('0xc')]['version'],oldToken);}var _0x2909dc={'uri':_0x2846b3,'method':_0x7244('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x2909dc)[_0x7244('0xf')](function(_0x3dbc6f){_0x2b6a67(_0x3dbc6f);})[_0x7244('0x10')](function(_0x50bc56){_0x2eb578(_0x50bc56);});});}function manageLicense(_0x3d2f9e,_0x2ff71a){var _0x16b634=_0x2ff71a[_0x7244('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x16b634[_0x7244('0x12')]!==_0x3d2f9e&&!_0x16b634[_0x7244('0x13')]){oldToken=_0x16b634[_0x7244('0x12')];}httpRequest(_0x3d2f9e)[_0x7244('0xf')](function(_0x50618c){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x50618c[_0x7244('0x14')]){isOldTokenSent=![];if(!_0x16b634[_0x7244('0x9')]&&_0x16b634[_0x7244('0x9')]!=_0x50618c[_0x7244('0x9')]||_0x16b634[_0x7244('0x9')]&&_0x16b634[_0x7244('0x13')]){logger[_0x7244('0x15')](_0x7244('0x16'));}if(_0x16b634[_0x7244('0x9')]&&!_0x16b634['data2']&&_0x16b634[_0x7244('0x9')]!=_0x50618c[_0x7244('0x9')]){logger[_0x7244('0x15')](_0x7244('0x17'));}if(_0x16b634[_0x7244('0x9')]&&!_0x16b634[_0x7244('0x13')]&&_0x16b634[_0x7244('0x9')]==_0x50618c['license']){return _0x2ff71a;}return _0x2ff71a[_0x7244('0x18')]({'data1':_0x3d2f9e,'data2':null,'license':_0x50618c[_0x7244('0x9')]});}else{if(_0x50618c[_0x7244('0x9')]||_0x16b634[_0x7244('0x9')]){if(!_0x16b634[_0x7244('0x13')]){if(_0x16b634['data1']==_0x3d2f9e){GRAY_PERIOD_REASON=_0x7244('0x19');logger['info'](_0x7244('0x1a'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x7244('0x15')](_0x7244('0x1b'),_0x16b634[_0x7244('0x12')],_0x3d2f9e);}logger[_0x7244('0x15')](_0x7244('0x1c'),GRAY_PERIOD_REASON[_0x7244('0x1d')](),moment()[_0x7244('0xa')](_0x7244('0x1e')));return _0x2ff71a[_0x7244('0x18')]({'data2':encryptor[_0x7244('0x1f')](moment()[_0x7244('0xa')](_0x7244('0x1e')))});}else{if(moment()[_0x7244('0x20')](encryptor['decryptString'](_0x16b634[_0x7244('0x13')]),_0x7244('0x21'))>DAYS){logger[_0x7244('0x15')](_0x7244('0x22'),moment()[_0x7244('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x2ff71a['update']({'data1':_0x3d2f9e,'data2':null,'license':null});}}}else{if(_0x16b634[_0x7244('0x12')]!=_0x3d2f9e){logger[_0x7244('0x15')](_0x7244('0x1b'),_0x16b634['data1'],_0x3d2f9e);return _0x2ff71a[_0x7244('0x18')]({'data1':_0x3d2f9e,'data2':null,'license':null});}}}return _0x2ff71a;})[_0x7244('0xf')](function(_0x8eae07){_0x2ff71a=_0x8eae07;})[_0x7244('0x10')](function(_0x5b1911){logger[_0x7244('0x23')](_0x5b1911[_0x7244('0x24')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x7244('0x25')](),_0x2ff71a);},TIME);});}function defaultLicense(){var _0x4aec77=hardware[_0x7244('0x25')]();if(_0x4aec77){return db[_0x7244('0x26')][_0x7244('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x4aec77}})['spread'](function(_0x119382,_0x431997){logger['info'](_0x7244('0x28'),_0x4aec77);manageLicense(_0x4aec77,_0x119382);})[_0x7244('0x10')](function(_0x6b86c6){logger[_0x7244('0x23')](_0x6b86c6[_0x7244('0x24')]);});}}exports[_0x7244('0x29')]=defaultLicense; \ No newline at end of file +var _0x49ee=['SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','pkginfo','version','../../mysqldb','./hardware','license','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','get','data1','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','update','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','DEMO\x20START\x20AT\x20%s','catch','message','getUuid','findOrCreate'];(function(_0x5e2f5c,_0x41160d){var _0x32e26a=function(_0x49b48c){while(--_0x49b48c){_0x5e2f5c['push'](_0x5e2f5c['shift']());}};_0x32e26a(++_0x41160d);}(_0x49ee,0x1ca));var _0xe49e=function(_0x99f61,_0x5777a4){_0x99f61=_0x99f61-0x0;var _0x111865=_0x49ee[_0x99f61];return _0x111865;};'use strict';var util=require(_0xe49e('0x0'));var moment=require(_0xe49e('0x1'));var rp=require(_0xe49e('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0xe49e('0x3'))(module,_0xe49e('0x4'));var db=require(_0xe49e('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0xe49e('0x6'));var logger=require('../logger')(_0xe49e('0x7'));var HOST=_0xe49e('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2790c9){return new BPromise(function(_0x2e9106,_0x168bb5){var _0xcdb3c=util[_0xe49e('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x2790c9,module[_0xe49e('0xa')][_0xe49e('0x4')]);if(oldToken){_0xcdb3c=util[_0xe49e('0x9')](_0xe49e('0xb'),HOST,_0x2790c9,module[_0xe49e('0xa')][_0xe49e('0x4')],oldToken);}var _0xdc1f04={'uri':_0xcdb3c,'method':_0xe49e('0xc'),'timeout':0xea60,'json':!![]};return rp(_0xdc1f04)[_0xe49e('0xd')](function(_0x19eb4e){_0x2e9106(_0x19eb4e);})['catch'](function(_0x228422){_0x168bb5(_0x228422);});});}function manageLicense(_0x4120b3,_0x5b3e0c){var _0x26e3ab=_0x5b3e0c[_0xe49e('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x26e3ab[_0xe49e('0xf')]!==_0x4120b3&&!_0x26e3ab['data2']){oldToken=_0x26e3ab[_0xe49e('0xf')];}httpRequest(_0x4120b3)[_0xe49e('0xd')](function(_0x5d3407){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5d3407[_0xe49e('0x10')]){isOldTokenSent=![];if(!_0x26e3ab['license']&&_0x26e3ab['license']!=_0x5d3407[_0xe49e('0x7')]||_0x26e3ab[_0xe49e('0x7')]&&_0x26e3ab[_0xe49e('0x11')]){logger[_0xe49e('0x12')](_0xe49e('0x13'));}if(_0x26e3ab['license']&&!_0x26e3ab[_0xe49e('0x11')]&&_0x26e3ab[_0xe49e('0x7')]!=_0x5d3407[_0xe49e('0x7')]){logger[_0xe49e('0x12')](_0xe49e('0x14'));}if(_0x26e3ab[_0xe49e('0x7')]&&!_0x26e3ab[_0xe49e('0x11')]&&_0x26e3ab['license']==_0x5d3407[_0xe49e('0x7')]){return _0x5b3e0c;}return _0x5b3e0c['update']({'data1':_0x4120b3,'data2':null,'license':_0x5d3407[_0xe49e('0x7')]});}else{if(_0x5d3407['license']||_0x26e3ab[_0xe49e('0x7')]){if(!_0x26e3ab[_0xe49e('0x11')]){if(_0x26e3ab[_0xe49e('0xf')]==_0x4120b3){GRAY_PERIOD_REASON=_0xe49e('0x15');logger[_0xe49e('0x12')](_0xe49e('0x16'));}else{GRAY_PERIOD_REASON=_0xe49e('0x17');logger['info'](_0xe49e('0x18'),_0x26e3ab[_0xe49e('0xf')],_0x4120b3);}logger['info'](_0xe49e('0x19'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x5b3e0c[_0xe49e('0x1a')]({'data2':encryptor[_0xe49e('0x1b')](moment()[_0xe49e('0x9')](_0xe49e('0x1c')))});}else{if(moment()[_0xe49e('0x1d')](encryptor[_0xe49e('0x1e')](_0x26e3ab['data2']),'days')>DAYS){logger[_0xe49e('0x12')](_0xe49e('0x1f'),moment()['format'](_0xe49e('0x1c')));isOldTokenSent=![];return _0x5b3e0c[_0xe49e('0x1a')]({'data1':_0x4120b3,'data2':null,'license':null});}}}else{if(_0x26e3ab[_0xe49e('0xf')]!=_0x4120b3){logger['info'](_0xe49e('0x18'),_0x26e3ab[_0xe49e('0xf')],_0x4120b3);return _0x5b3e0c[_0xe49e('0x1a')]({'data1':_0x4120b3,'data2':null,'license':null});}}}return _0x5b3e0c;})[_0xe49e('0xd')](function(_0x534791){_0x5b3e0c=_0x534791;})[_0xe49e('0x20')](function(_0x5eca82){logger['error'](_0x5eca82[_0xe49e('0x21')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xe49e('0x22')](),_0x5b3e0c);},TIME);});}function defaultLicense(){var _0x187b68=hardware[_0xe49e('0x22')]();if(_0x187b68){return db['License'][_0xe49e('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x187b68}})['spread'](function(_0x4fc4d7,_0x1af16d){logger['info'](_0xe49e('0x24'),_0x187b68);manageLicense(_0x187b68,_0x4fc4d7);})[_0xe49e('0x20')](function(_0x453023){logger['error'](_0x453023['message']);});}}exports[_0xe49e('0x25')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index b5d91b2..bd2ed9e 100644 --- a/server/config/license/util.js +++ b/server/config/license/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa1d9=['Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','decryptString','format','parse','demo','machineUuid','gray','deadline','add','days','grayReason','changed','disabled','uuid','message','User','findAll','sequelize','col','role','count','admin','user','users','forEach','telephone','License\x20limit\x20reached\x20for\x20users','exports','util','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z'];(function(_0x5dcc7c,_0x16b1ac){var _0x1ef099=function(_0x29b91e){while(--_0x29b91e){_0x5dcc7c['push'](_0x5dcc7c['shift']());}};_0x1ef099(++_0x16b1ac);}(_0xa1d9,0x13b));var _0x9a1d=function(_0x3aecb2,_0x5e1cb0){_0x3aecb2=_0x3aecb2-0x0;var _0x211de9=_0xa1d9[_0x3aecb2];return _0x211de9;};'use strict';var util=require(_0x9a1d('0x0'));var _=require(_0x9a1d('0x1'));var moment=require('moment');var BPromise=require(_0x9a1d('0x2'));var hardware=require(_0x9a1d('0x3'));var encryptor=require(_0x9a1d('0x4'));var db=require(_0x9a1d('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9a1d('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x9a1d('0x7'),'machineUuid':hardware[_0x9a1d('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9a1d('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x9a1d('0x9'),'machineUuid':hardware[_0x9a1d('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x54829c){return new BPromise(function(_0x3294b1,_0x2991f3){return db[_0x9a1d('0xa')][_0x9a1d('0xb')](_[_0x9a1d('0xc')](_0x54829c,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x5187f2){return checkLicense(_0x5187f2,null);})[_0x9a1d('0xd')](function(_0x409946){_0x3294b1(_0x409946);return;})[_0x9a1d('0xe')](function(_0x2ed8e8){_0x2991f3(_0x2ed8e8);});});}function checkLicense(_0x449292,_0x3baf6c){if(!_0x449292){demoLicense['uuid']=_0x449292[_0x9a1d('0xf')];return demoLicense;}try{var _0x397212=_0x3baf6c||_0x449292[_0x9a1d('0x10')];if(_[_0x9a1d('0x11')](_0x397212)){throw new Error(_0x9a1d('0x12'));}var _0x1c6a1b=_0x449292[_0x9a1d('0xf')];var _0x574168=_0x449292['data2'];var _0x4f4015=_0x1c6a1b['split']('-')[0x4];var _0x2e0ac5=_0x1c6a1b['split']('-')[0x0];var _0x11b654=encryptor[_0x9a1d('0x13')](_0x397212,util[_0x9a1d('0x14')]('%s:%s:%s',_0x4f4015,_0x1c6a1b,_0x2e0ac5));var _0x53678d=JSON[_0x9a1d('0x15')](_0x11b654);_0x53678d[_0x9a1d('0x16')]=![];_0x53678d['uuid']=_0x1c6a1b;_0x53678d[_0x9a1d('0x17')]=hardware[_0x9a1d('0x8')]();if(_0x574168){var _0x172d58=encryptor[_0x9a1d('0x13')](_0x574168);_0x53678d[_0x9a1d('0x18')]=_0x172d58;_0x53678d[_0x9a1d('0x19')]=moment(_0x172d58)[_0x9a1d('0x1a')](0x7,_0x9a1d('0x1b'))[_0x9a1d('0x14')]();_0x53678d[_0x9a1d('0x1c')]=_0x53678d['uuid']!=_0x53678d['machineUuid']?_0x9a1d('0x1d'):_0x9a1d('0x1e');}return _0x53678d;}catch(_0x29979f){breakingLicense[_0x9a1d('0x1f')]=_0x449292[_0x9a1d('0xf')];breakingLicense[_0x9a1d('0x20')]=_0x29979f[_0x9a1d('0x20')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xe6dbd9,_0x1469cd){getLicense()['then'](function(_0x52a957){return db[_0x9a1d('0x21')][_0x9a1d('0x22')]({'attributes':['role',[db[_0x9a1d('0x23')]['fn']('COUNT',db[_0x9a1d('0x23')][_0x9a1d('0x24')](_0x9a1d('0x25'))),_0x9a1d('0x26')]],'group':_0x9a1d('0x25'),'where':{'role':{'$or':[_0x9a1d('0x27'),_0x9a1d('0x28'),'telephone']}},'raw':!![]})['then'](function(_0x1e6eb0){var _0x1a706d={'user':_0x52a957[_0x9a1d('0x29')]||0x0,'telephone':_0x52a957['telephones']||0x0};_0x1e6eb0[_0x9a1d('0x2a')](function(_0x1aeb3f){var _0x352651=_0x1aeb3f['role']==='admin'?_0x9a1d('0x28'):_0x1aeb3f['role'];_0x1a706d[_0x352651]-=_0x1aeb3f[_0x9a1d('0x26')];if(_0x1a706d[_0x352651]<0x0)_0x1a706d[_0x352651]=0x0;});_0xe6dbd9(_0x1a706d);return;});})[_0x9a1d('0xe')](function(_0x38dd03){_0x1469cd(_0x38dd03);});});}function checkUserLimits(_0x28480a){return new BPromise(function(_0x1f2505,_0x42d126){getLimits()[_0x9a1d('0xd')](function(_0x237ee8){var _0x24f489=_['pick'](_['countBy'](_0x28480a,_0x9a1d('0x25')),['admin',_0x9a1d('0x28'),_0x9a1d('0x2b')]);var _0x46a082=(_0x24f489['admin']||0x0)+(_0x24f489['user']||0x0);var _0x2b11cc=_0x24f489[_0x9a1d('0x2b')]||0x0;if(_0x46a082>_0x237ee8[_0x9a1d('0x28')])return _0x42d126(_0x9a1d('0x2c'));if(_0x2b11cc>_0x237ee8[_0x9a1d('0x2b')])return _0x42d126('License\x20limit\x20reached\x20for\x20telephones');return _0x1f2505();})[_0x9a1d('0xe')](function(_0x8b5894){_0x42d126(_0x8b5894);});});}module[_0x9a1d('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x9e77=['sequelize','COUNT','col','count','admin','user','telephone','users','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','bluebird','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','find','defaults','then','catch','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','uuid','machineUuid','gray','add','days','message','User','findAll','role'];(function(_0x186176,_0x2dd384){var _0x38c57c=function(_0x45b47b){while(--_0x45b47b){_0x186176['push'](_0x186176['shift']());}};_0x38c57c(++_0x2dd384);}(_0x9e77,0x16a));var _0x79e7=function(_0x2536e9,_0x1b40cc){_0x2536e9=_0x2536e9-0x0;var _0x198fb5=_0x9e77[_0x2536e9];return _0x198fb5;};'use strict';var util=require('util');var _=require(_0x79e7('0x0'));var moment=require('moment');var BPromise=require(_0x79e7('0x1'));var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x79e7('0x2'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x79e7('0x3')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x79e7('0x2'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x79e7('0x4'),'machineUuid':hardware[_0x79e7('0x3')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x192b01){return new BPromise(function(_0x40655e,_0x5b87e8){return db['License'][_0x79e7('0x5')](_[_0x79e7('0x6')](_0x192b01,{'raw':!![],'where':{'id':0x1}}))[_0x79e7('0x7')](function(_0xb0e504){return checkLicense(_0xb0e504,null);})[_0x79e7('0x7')](function(_0x17dfed){_0x40655e(_0x17dfed);return;})[_0x79e7('0x8')](function(_0x2b435f){_0x5b87e8(_0x2b435f);});});}function checkLicense(_0x419e28,_0x26b69d){if(!_0x419e28){demoLicense['uuid']=_0x419e28[_0x79e7('0x9')];return demoLicense;}try{var _0x57dc6d=_0x26b69d||_0x419e28['license'];if(_[_0x79e7('0xa')](_0x57dc6d)){throw new Error(_0x79e7('0xb'));}var _0x17aabd=_0x419e28[_0x79e7('0x9')];var _0x4164e3=_0x419e28[_0x79e7('0xc')];var _0x54934b=_0x17aabd[_0x79e7('0xd')]('-')[0x4];var _0x4d9f36=_0x17aabd[_0x79e7('0xd')]('-')[0x0];var _0xe07017=encryptor[_0x79e7('0xe')](_0x57dc6d,util[_0x79e7('0xf')](_0x79e7('0x10'),_0x54934b,_0x17aabd,_0x4d9f36));var _0x2f60f5=JSON[_0x79e7('0x11')](_0xe07017);_0x2f60f5[_0x79e7('0x12')]=![];_0x2f60f5[_0x79e7('0x13')]=_0x17aabd;_0x2f60f5[_0x79e7('0x14')]=hardware[_0x79e7('0x3')]();if(_0x4164e3){var _0x34aee9=encryptor['decryptString'](_0x4164e3);_0x2f60f5[_0x79e7('0x15')]=_0x34aee9;_0x2f60f5['deadline']=moment(_0x34aee9)[_0x79e7('0x16')](0x7,_0x79e7('0x17'))[_0x79e7('0xf')]();_0x2f60f5['grayReason']=_0x2f60f5[_0x79e7('0x13')]!=_0x2f60f5[_0x79e7('0x14')]?'changed':'disabled';}return _0x2f60f5;}catch(_0x128e28){breakingLicense[_0x79e7('0x13')]=_0x419e28[_0x79e7('0x9')];breakingLicense[_0x79e7('0x18')]=_0x128e28[_0x79e7('0x18')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2fdec3,_0x24fec3){getLicense()[_0x79e7('0x7')](function(_0x3bb8c6){return db[_0x79e7('0x19')][_0x79e7('0x1a')]({'attributes':[_0x79e7('0x1b'),[db[_0x79e7('0x1c')]['fn'](_0x79e7('0x1d'),db[_0x79e7('0x1c')][_0x79e7('0x1e')]('role')),_0x79e7('0x1f')]],'group':_0x79e7('0x1b'),'where':{'role':{'$or':[_0x79e7('0x20'),_0x79e7('0x21'),_0x79e7('0x22')]}},'raw':!![]})[_0x79e7('0x7')](function(_0x327060){var _0x12e998={'user':_0x3bb8c6[_0x79e7('0x23')]||0x0,'telephone':_0x3bb8c6['telephones']||0x0};_0x327060['forEach'](function(_0x44b2d4){var _0x4c5f51=_0x44b2d4[_0x79e7('0x1b')]===_0x79e7('0x20')?_0x79e7('0x21'):_0x44b2d4[_0x79e7('0x1b')];_0x12e998[_0x4c5f51]-=_0x44b2d4[_0x79e7('0x1f')];if(_0x12e998[_0x4c5f51]<0x0)_0x12e998[_0x4c5f51]=0x0;});_0x2fdec3(_0x12e998);return;});})[_0x79e7('0x8')](function(_0x445bc0){_0x24fec3(_0x445bc0);});});}function checkUserLimits(_0x1b4724){return new BPromise(function(_0x4979de,_0x574b5c){getLimits()[_0x79e7('0x7')](function(_0x5b286e){var _0x51afdf=_['pick'](_[_0x79e7('0x24')](_0x1b4724,_0x79e7('0x1b')),[_0x79e7('0x20'),_0x79e7('0x21'),_0x79e7('0x22')]);var _0x43f45a=(_0x51afdf['admin']||0x0)+(_0x51afdf['user']||0x0);var _0x2b17af=_0x51afdf['telephone']||0x0;if(_0x43f45a>_0x5b286e[_0x79e7('0x21')])return _0x574b5c('License\x20limit\x20reached\x20for\x20users');if(_0x2b17af>_0x5b286e[_0x79e7('0x22')])return _0x574b5c(_0x79e7('0x25'));return _0x4979de();})[_0x79e7('0x8')](function(_0xeb6672){_0x574b5c(_0xeb6672);});});}module[_0x79e7('0x26')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 12019af..f5c2f88 100644 --- a/server/config/local.env.js +++ b/server/config/local.env.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x430c=['exports','app-id','secret'];(function(_0x51b6dc,_0x5a079b){var _0x70be33=function(_0x37584c){while(--_0x37584c){_0x51b6dc['push'](_0x51b6dc['shift']());}};_0x70be33(++_0x5a079b);}(_0x430c,0x1a1));var _0xc430=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0x430c[_0x1ad926];return _0x1b81dc;};'use strict';module[_0xc430('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xc430('0x1'),'GOOGLE_SECRET':_0xc430('0x2'),'DEBUG':''}; \ No newline at end of file +var _0xefda=['exports','app-id','secret'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xefda,0x96));var _0xaefd=function(_0x2045ec,_0x543794){_0x2045ec=_0x2045ec-0x0;var _0xc513a=_0xefda[_0x2045ec];return _0xc513a;};'use strict';module[_0xaefd('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xaefd('0x1'),'GOOGLE_SECRET':_0xaefd('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index d84ce55..994a41d 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6842=['fileLogger','../utils/loggers'];(function(_0x2bf8d2,_0x579c85){var _0x5439e0=function(_0x4cdb23){while(--_0x4cdb23){_0x2bf8d2['push'](_0x2bf8d2['shift']());}};_0x5439e0(++_0x579c85);}(_0x6842,0x107));var _0x2684=function(_0x24260b,_0x2de761){_0x24260b=_0x24260b-0x0;var _0xcf4176=_0x6842[_0x24260b];return _0xcf4176;};'use strict';var fileLogger=require(_0x2684('0x0'))[_0x2684('0x1')];module['exports']=fileLogger; \ No newline at end of file +var _0x45ae=['fileLogger'];(function(_0x1f2deb,_0x446cc3){var _0x2ce9eb=function(_0x5f9ff5){while(--_0x5f9ff5){_0x1f2deb['push'](_0x1f2deb['shift']());}};_0x2ce9eb(++_0x446cc3);}(_0x45ae,0xcd));var _0xe45a=function(_0x3cfa5b,_0x1c6541){_0x3cfa5b=_0x3cfa5b-0x0;var _0x5e518e=_0x45ae[_0x3cfa5b];return _0x5e518e;};'use strict';var fileLogger=require('../utils/loggers')[_0xe45a('0x0')];module['exports']=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 43b711a..fb254ee 100644 --- a/server/config/pm2/config.js +++ b/server/config/pm2/config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdeec=['../../services/xdr/index.js','exports','resolve','root','legacy-libs','express','join','ami','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js'];(function(_0x4cf93b,_0x4eb0dd){var _0x363de3=function(_0x38845a){while(--_0x38845a){_0x4cf93b['push'](_0x4cf93b['shift']());}};_0x363de3(++_0x4eb0dd);}(_0xdeec,0x64));var _0xcdee=function(_0x5cc242,_0x54f742){_0x5cc242=_0x5cc242-0x0;var _0x11c71e=_0xdeec[_0x5cc242];return _0x11c71e;};'use strict';var path=require('path');var cfg=require('../../config/environment');var env={'NODE_PATH':path[_0xcdee('0x0')](path['join'](cfg[_0xcdee('0x1')],_0xcdee('0x2')))};var pm2config={'apps':[{'name':_0xcdee('0x3'),'script':path[_0xcdee('0x4')](__dirname,'../../services/express/index.js'),'env':env},{'name':_0xcdee('0x5'),'script':path[_0xcdee('0x4')](__dirname,_0xcdee('0x6')),'env':env},{'name':'agi','script':path[_0xcdee('0x4')](__dirname,_0xcdee('0x7')),'env':env},{'name':_0xcdee('0x8'),'script':path[_0xcdee('0x4')](__dirname,_0xcdee('0x9')),'env':env},{'name':_0xcdee('0xa'),'script':path[_0xcdee('0x4')](__dirname,_0xcdee('0xb')),'env':env},{'name':'xdr','script':path[_0xcdee('0x4')](__dirname,_0xcdee('0xc')),'env':env}]};module[_0xcdee('0xd')]=pm2config; \ No newline at end of file +var _0x70c4=['email','../../services/email/index.js','xdr','../../services/xdr/index.js','exports','join','root','legacy-libs','express','../../services/express/index.js','../../services/ami/index.js'];(function(_0x44f4fe,_0x4ddfea){var _0x5f48bc=function(_0x3bfeb7){while(--_0x3bfeb7){_0x44f4fe['push'](_0x44f4fe['shift']());}};_0x5f48bc(++_0x4ddfea);}(_0x70c4,0x1f4));var _0x470c=function(_0x579f74,_0x206aa0){_0x579f74=_0x579f74-0x0;var _0x3bf7d0=_0x70c4[_0x579f74];return _0x3bf7d0;};'use strict';var path=require('path');var cfg=require('../../config/environment');var env={'NODE_PATH':path['resolve'](path[_0x470c('0x0')](cfg[_0x470c('0x1')],_0x470c('0x2')))};var pm2config={'apps':[{'name':_0x470c('0x3'),'script':path['join'](__dirname,_0x470c('0x4')),'env':env},{'name':'ami','script':path['join'](__dirname,_0x470c('0x5')),'env':env},{'name':'agi','script':path[_0x470c('0x0')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x470c('0x6'),'script':path['join'](__dirname,_0x470c('0x7')),'env':env},{'name':'routing','script':path[_0x470c('0x0')](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0x470c('0x8'),'script':path[_0x470c('0x0')](__dirname,_0x470c('0x9')),'env':env}]};module[_0x470c('0xa')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 2f4ac7e..a0a7fe2 100644 --- a/server/config/pm2/index.js +++ b/server/config/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5f4=['start','disconnect','then','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connected'];(function(_0x56d4bc,_0x3d3c05){var _0x48cebd=function(_0x79005d){while(--_0x79005d){_0x56d4bc['push'](_0x56d4bc['shift']());}};_0x48cebd(++_0x3d3c05);}(_0xa5f4,0xcc));var _0x4a5f=function(_0x575fe1,_0x36e40b){_0x575fe1=_0x575fe1-0x0;var _0xa9e036=_0xa5f4[_0x575fe1];return _0xa9e036;};'use strict';var pm2=require(_0x4a5f('0x0'));var BPromise=require(_0x4a5f('0x1'));var config=require(_0x4a5f('0x2'));function connect(){return new BPromise(function(_0x274e0b,_0x1bbd93){return pm2['connect'](function(_0x51fd54){if(_0x51fd54){return _0x1bbd93(_0x51fd54);}return _0x274e0b(_0x4a5f('0x3'));});});};exports['start']=function(_0x4e74ef){return connect()['then'](function(){return new BPromise(function(_0x3f0439,_0x58417f){return pm2[_0x4a5f('0x4')](_0x4e74ef,function(_0x1b8c61,_0x468c79){if(_0x1b8c61){return _0x58417f(_0x1b8c61);}pm2[_0x4a5f('0x5')]();return _0x3f0439(_0x468c79);});});});};exports['stop']=function(_0x450cdd){return connect()[_0x4a5f('0x6')](function(){return new BPromise(function(_0x24a82e,_0x238eea){return pm2['stop'](_0x450cdd,function(_0x51dfd7,_0x261346){if(_0x51dfd7){return _0x238eea(_0x51dfd7);}pm2[_0x4a5f('0x5')]();return _0x24a82e(_0x261346);});});});};exports['restart']=function(_0x45948f){return connect()['then'](function(){return new BPromise(function(_0x8bf896,_0x90e978){return pm2[_0x4a5f('0x7')](_0x45948f,function(_0x227d96,_0x13421e){if(_0x227d96){return _0x90e978(_0x227d96);}pm2[_0x4a5f('0x5')]();return _0x8bf896(_0x13421e);});});});};exports['list']=function(){return connect()[_0x4a5f('0x6')](function(){return new BPromise(function(_0x23c2df,_0x32b368){return pm2[_0x4a5f('0x8')](function(_0x3d8147,_0x25e9b7){if(_0x3d8147){return _0x32b368(_0x3d8147);}pm2['disconnect']();return _0x23c2df(_0x25e9b7);});});});};exports[_0x4a5f('0x9')]=function(_0x3c7e2b){return connect()[_0x4a5f('0x6')](function(){return new BPromise(function(_0x5bc44e,_0x345d4a){return pm2[_0x4a5f('0x9')](_0x3c7e2b,function(_0x1ea577,_0x555c2b){if(_0x1ea577){return _0x345d4a(_0x1ea577);}pm2[_0x4a5f('0x5')]();return _0x5bc44e(_0x555c2b);});});});};exports[_0x4a5f('0xa')]=function(_0xab412){return connect()[_0x4a5f('0x6')](function(){return new BPromise(function(_0x4acde0,_0x4cebf6){return pm2['delete'](_0xab412,function(_0x1cc3f7,_0x13b251){if(_0x1cc3f7){return _0x4cebf6(_0x1cc3f7);}pm2[_0x4a5f('0x5')]();return _0x4acde0(_0x13b251);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x101ee3,_0x3e606c){return pm2[_0x4a5f('0xb')](function(_0x1e95f3){if(_0x1e95f3){return _0x3e606c(_0x1e95f3);}return _0x101ee3(_0x4a5f('0xc'));});});});}; \ No newline at end of file +var _0x87fd=['list','describe','delete','dump','bluebird','./config','connect','start','then','disconnect','stop','restart'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0x87fd,0x1a8));var _0xd87f=function(_0x249bdb,_0x82bab2){_0x249bdb=_0x249bdb-0x0;var _0x5ed42d=_0x87fd[_0x249bdb];return _0x5ed42d;};'use strict';var pm2=require('pm2');var BPromise=require(_0xd87f('0x0'));var config=require(_0xd87f('0x1'));function connect(){return new BPromise(function(_0x139675,_0x547d01){return pm2[_0xd87f('0x2')](function(_0x3db9ca){if(_0x3db9ca){return _0x547d01(_0x3db9ca);}return _0x139675('connected');});});};exports[_0xd87f('0x3')]=function(_0x56ca74){return connect()[_0xd87f('0x4')](function(){return new BPromise(function(_0x42dc62,_0x55b8a2){return pm2[_0xd87f('0x3')](_0x56ca74,function(_0x51fc6d,_0x6134dc){if(_0x51fc6d){return _0x55b8a2(_0x51fc6d);}pm2[_0xd87f('0x5')]();return _0x42dc62(_0x6134dc);});});});};exports['stop']=function(_0x2e72df){return connect()[_0xd87f('0x4')](function(){return new BPromise(function(_0x170da2,_0x1f17b5){return pm2[_0xd87f('0x6')](_0x2e72df,function(_0x3b7b1a,_0x2e8d5a){if(_0x3b7b1a){return _0x1f17b5(_0x3b7b1a);}pm2[_0xd87f('0x5')]();return _0x170da2(_0x2e8d5a);});});});};exports[_0xd87f('0x7')]=function(_0xa647da){return connect()['then'](function(){return new BPromise(function(_0x47913f,_0x19f2f4){return pm2[_0xd87f('0x7')](_0xa647da,function(_0x1b6023,_0x5669e3){if(_0x1b6023){return _0x19f2f4(_0x1b6023);}pm2[_0xd87f('0x5')]();return _0x47913f(_0x5669e3);});});});};exports['list']=function(){return connect()[_0xd87f('0x4')](function(){return new BPromise(function(_0x25d2b7,_0x3f9929){return pm2[_0xd87f('0x8')](function(_0x3d27f2,_0x1f75f7){if(_0x3d27f2){return _0x3f9929(_0x3d27f2);}pm2[_0xd87f('0x5')]();return _0x25d2b7(_0x1f75f7);});});});};exports[_0xd87f('0x9')]=function(_0x2a6383){return connect()[_0xd87f('0x4')](function(){return new BPromise(function(_0x4cdba9,_0x1a45f5){return pm2[_0xd87f('0x9')](_0x2a6383,function(_0x18d869,_0x1315fb){if(_0x18d869){return _0x1a45f5(_0x18d869);}pm2[_0xd87f('0x5')]();return _0x4cdba9(_0x1315fb);});});});};exports[_0xd87f('0xa')]=function(_0x5ecbe3){return connect()['then'](function(){return new BPromise(function(_0x11448b,_0x4758b2){return pm2[_0xd87f('0xa')](_0x5ecbe3,function(_0x1492ac,_0x462c34){if(_0x1492ac){return _0x4758b2(_0x1492ac);}pm2[_0xd87f('0x5')]();return _0x11448b(_0x462c34);});});});};exports[_0xd87f('0xb')]=function(){return connect()[_0xd87f('0x4')](function(){return new BPromise(function(_0x4da79f,_0x52fcf2){return pm2[_0xd87f('0xb')](function(_0x5912e3){if(_0x5912e3){return _0x52fcf2(_0x5912e3);}return _0x4da79f('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index c1c64ee..bf5c500 100644 --- a/server/config/schedule/chat.js +++ b/server/config/schedule/chat.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x56bb=['info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','timeout','format','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','util','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','Setting','findAll','lastMsgAt','subtract','chatTimeout','minutes','then','length'];(function(_0x19fa19,_0x1205a1){var _0x1db119=function(_0x15c622){while(--_0x15c622){_0x19fa19['push'](_0x19fa19['shift']());}};_0x1db119(++_0x1205a1);}(_0x56bb,0x183));var _0xb56b=function(_0x17ba58,_0x214de4){_0x17ba58=_0x17ba58-0x0;var _0x455763=_0x56bb[_0x17ba58];return _0x455763;};'use strict';var _=require(_0xb56b('0x0'));var moment=require(_0xb56b('0x1'));var Redis=require(_0xb56b('0x2'));var util=require(_0xb56b('0x3'));var config=require(_0xb56b('0x4'));var db=require(_0xb56b('0x5'))['db'];var logger=require(_0xb56b('0x6'))(_0xb56b('0x7'));config['redis']=_[_0xb56b('0x8')](config[_0xb56b('0x9')],{'host':_0xb56b('0xa'),'port':0x18eb});var io=require(_0xb56b('0xb'))(new Redis(config[_0xb56b('0x9')]));function closeInteractions(){var _0x38cc27=0x0;var _0x5e5bd0=[];return db[_0xb56b('0xc')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x221242){_0x38cc27=_0x221242['chatTimeout'];if(_0x38cc27){return db['ChatInteraction'][_0xb56b('0xd')]({'raw':!![],'attributes':['id',_0xb56b('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xb56b('0xf')](_0x221242[_0xb56b('0x10')],_0xb56b('0x11'))}}});}else{return[];}})[_0xb56b('0x12')](function(_0x36ec43){if(_0x36ec43&&_0x36ec43[_0xb56b('0x13')]){_0x5e5bd0=_['map'](_0x36ec43||[],'id');logger[_0xb56b('0x14')](_0xb56b('0x15'),_0x5e5bd0[_0xb56b('0x16')]());return db[_0xb56b('0x17')][_0xb56b('0x18')]({'closeReason':_0xb56b('0x19'),'disposition':_0xb56b('0x1a'),'closed':!![],'closedAt':moment()[_0xb56b('0x1b')](_0xb56b('0x1c'))},{'where':{'id':_0x5e5bd0}});}})['then'](function(){if(_0x5e5bd0&&_0x5e5bd0[_0xb56b('0x13')]){logger[_0xb56b('0x14')](_0xb56b('0x1d'),_0x5e5bd0[_0xb56b('0x16')]());for(var _0x5b2b50=0x0;_0x5b2b50<_0x5e5bd0[_0xb56b('0x13')];_0x5b2b50++){io[_0xb56b('0x1e')](_0xb56b('0x1f'),{'id':_0x5e5bd0[_0x5b2b50],'closed':!![]});}}})[_0xb56b('0x20')](function(_0x43c72e){logger[_0xb56b('0x21')](_0xb56b('0x22'),_0x43c72e?util[_0xb56b('0x23')](_0x43c72e,{'showHidden':![],'depth':null}):'');});}exports[_0xb56b('0x24')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xb684=['length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','emit','catch','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes'];(function(_0x2e2499,_0x53ea7f){var _0x208669=function(_0x3bdfe9){while(--_0x3bdfe9){_0x2e2499['push'](_0x2e2499['shift']());}};_0x208669(++_0x53ea7f);}(_0xb684,0xa8));var _0x4b68=function(_0x2c20d2,_0x44d927){_0x2c20d2=_0x2c20d2-0x0;var _0x179161=_0xb684[_0x2c20d2];return _0x179161;};'use strict';var _=require(_0x4b68('0x0'));var moment=require(_0x4b68('0x1'));var Redis=require(_0x4b68('0x2'));var util=require('util');var config=require(_0x4b68('0x3'));var db=require(_0x4b68('0x4'))['db'];var logger=require(_0x4b68('0x5'))(_0x4b68('0x6'));config[_0x4b68('0x7')]=_['defaults'](config[_0x4b68('0x7')],{'host':_0x4b68('0x8'),'port':0x18eb});var io=require(_0x4b68('0x9'))(new Redis(config[_0x4b68('0x7')]));function closeInteractions(){var _0x4bc586=0x0;var _0x52d146=[];return db['Setting'][_0x4b68('0xa')]({'raw':!![],'attributes':['id',_0x4b68('0xb')],'where':{'id':0x1}})[_0x4b68('0xc')](function(_0x57d309){_0x4bc586=_0x57d309[_0x4b68('0xb')];if(_0x4bc586){return db[_0x4b68('0xd')][_0x4b68('0xe')]({'raw':!![],'attributes':['id',_0x4b68('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x4b68('0x10')](_0x57d309[_0x4b68('0xb')],_0x4b68('0x11'))}}});}else{return[];}})['then'](function(_0x36dab4){if(_0x36dab4&&_0x36dab4[_0x4b68('0x12')]){_0x52d146=_[_0x4b68('0x13')](_0x36dab4||[],'id');logger[_0x4b68('0x14')](_0x4b68('0x15'),_0x52d146[_0x4b68('0x16')]());return db[_0x4b68('0xd')][_0x4b68('0x17')]({'closeReason':_0x4b68('0x18'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x4b68('0x19')](_0x4b68('0x1a'))},{'where':{'id':_0x52d146}});}})[_0x4b68('0xc')](function(){if(_0x52d146&&_0x52d146[_0x4b68('0x12')]){logger[_0x4b68('0x14')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x52d146[_0x4b68('0x16')]());for(var _0x4b87bf=0x0;_0x4b87bf<_0x52d146[_0x4b68('0x12')];_0x4b87bf++){io[_0x4b68('0x1b')]('chatInteraction:update',{'id':_0x52d146[_0x4b87bf],'closed':!![]});}}})[_0x4b68('0x1c')](function(_0x4c235b){logger['error'](_0x4b68('0x1d'),_0x4c235b?util['inspect'](_0x4c235b,{'showHidden':![],'depth':null}):'');});}exports[_0x4b68('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 438f287..09d6942 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb3b=['exports','startAllRefreshIntervals'];(function(_0x1e91eb,_0x5829a3){var _0x2af75a=function(_0x1815d1){while(--_0x1815d1){_0x1e91eb['push'](_0x1e91eb['shift']());}};_0x2af75a(++_0x5829a3);}(_0xdb3b,0x153));var _0xbdb3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xdb3b[_0xa464c9];return _0x3d73c4;};'use strict';function start(){var _0x2d3dfb=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x2d3dfb[_0xbdb3('0x0')]();}module[_0xbdb3('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x5e24=['startAllRefreshIntervals','exports'];(function(_0x14c4e1,_0x1a40b8){var _0x15f899=function(_0x4ba923){while(--_0x4ba923){_0x14c4e1['push'](_0x14c4e1['shift']());}};_0x15f899(++_0x1a40b8);}(_0x5e24,0x130));var _0x45e2=function(_0x6782c1,_0x539047){_0x6782c1=_0x6782c1-0x0;var _0x52d22b=_0x5e24[_0x6782c1];return _0x52d22b;};'use strict';function start(){var _0x1c2897=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x1c2897[_0x45e2('0x0')]();}module[_0x45e2('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index be0b916..c5d37f9 100644 --- a/server/config/schedule/index.js +++ b/server/config/schedule/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x265e=['keys','map','toString','keyBy','difference','intersection','length','stop','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','startAt','endAt','start','exists','deleteJob','stop\x20cron','isBetween','update','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','format','%s.%s','extname','zip','existsSync','status','Sent','attachments','message','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','error','email\x20sent','error\x20mail','stringify','data','isNil','subtract','YYYY-MM-DD\x20HH:mm:ss','exec\x20defaul\x20report\x20id:%s','DefaultReportId','catch','exec\x20custom\x20report\x20id:%s','runReport','CustomReportId','then','Schedule','findAll','MailServerOut','CloudProvider'];(function(_0x19b5fb,_0xdd32ef){var _0x152f3a=function(_0x5dd47d){while(--_0x5dd47d){_0x19b5fb['push'](_0x19b5fb['shift']());}};_0x152f3a(++_0xdd32ef);}(_0x265e,0xc7));var _0xe265=function(_0x26e970,_0x2c44a9){_0x26e970=_0x26e970-0x0;var _0x5ab9b6=_0x265e[_0x26e970];return _0x5ab9b6;};'use strict';var fs=require('fs');var util=require(_0xe265('0x0'));var path=require(_0xe265('0x1'));var _=require(_0xe265('0x2'));var moment=require(_0xe265('0x3'));var CronJobManager=require(_0xe265('0x4'));var jayson=require(_0xe265('0x5'));var BPromise=require(_0xe265('0x6'));var logger=require(_0xe265('0x7'))(_0xe265('0x8'));var db=require(_0xe265('0x9'))['db'];var analyticCustomReportController=require(_0xe265('0xa'));var analyticDefaultReportController=require(_0xe265('0xb'));var client=jayson[_0xe265('0xc')][_0xe265('0xd')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xbda103,_0x2dd040){return function(){logger['info'](_0xe265('0xe'),_0xbda103[_0xe265('0xf')]);var _0x13063a=!![];var _0x4aac44=_0xbda103[_0xe265('0x10')][_0xe265('0x11')]();var _0x4dfd85={'account':_0x4aac44,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0xbda103[_0xe265('0x10')][_0xe265('0x12')],_0xbda103[_0xe265('0x10')]['email']||_0xbda103[_0xe265('0x10')][_0xe265('0x13')][_0xe265('0x14')]),'to':_0xbda103[_0xe265('0xf')],'cc':_0xbda103['cc'],'bcc':_0xbda103[_0xe265('0x15')],'subject':util['format'](_0xe265('0x16'),_0x2dd040['name'],_0xbda103[_0xe265('0x17')],_0xbda103[_0xe265('0x18')])}};var _0x40d7bb=path[_0xe265('0x19')](__dirname,_0xe265('0x1a'));var _0x420e13=_0x2dd040[_0xe265('0x1b')];var _0x237463=util[_0xe265('0x1c')](_0xe265('0x1d'),path['basename'](_0x2dd040[_0xe265('0x1b')],path[_0xe265('0x1e')](_0x2dd040[_0xe265('0x1b')])),_0xe265('0x1f'));var _0x26f64a=path[_0xe265('0x19')](_0x40d7bb,_0x420e13);var _0x31837d=path['join'](_0x40d7bb,_0x237463);if(fs[_0xe265('0x20')](_0x26f64a)){_0x2dd040[_0xe265('0x21')]=_0xe265('0x22');_0x4dfd85['message'][_0xe265('0x23')]=[{'filename':_0x420e13,'path':_0x26f64a}];_0x4dfd85[_0xe265('0x24')][_0xe265('0x25')]=util['format']('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x2dd040,null,0x2));}else if(fs['existsSync'](_0x31837d)){_0x2dd040[_0xe265('0x21')]=_0xe265('0x22');_0x4dfd85[_0xe265('0x24')]['attachments']=[{'filename':_0x237463,'path':_0x31837d}];}else{_0x4dfd85[_0xe265('0x24')][_0xe265('0x25')]=_0xe265('0x26');if(!_0xbda103[_0xe265('0x27')]){_0x13063a=![];logger[_0xe265('0x28')](_0xe265('0x29'));}}if(_0x13063a){return client[_0xe265('0x2a')]('SendMail',_0x4dfd85)['then'](function(_0x40328d){if(_0x40328d['error']){return logger[_0xe265('0x2b')]('error\x20mail',JSON['stringify'](_0x40328d));}return logger['info'](_0xe265('0x2c'));})['catch'](function(_0x247ef7){return logger[_0xe265('0x2b')](_0xe265('0x2d'),JSON[_0xe265('0x2e')](_0x247ef7));});}};}function handleError(){return function(_0x33e230){return logger[_0xe265('0x2b')](JSON[_0xe265('0x2e')](_0x33e230));};}function handleResult(_0x1fbe82){return function(_0x4a3a97){logger[_0xe265('0x28')](_0xe265('0x2f'),JSON[_0xe265('0x2e')](_0x4a3a97));if(_0x1fbe82[_0xe265('0x10')]&&_0x1fbe82['MailAccount'][_0xe265('0x13')]&&!_[_0xe265('0x30')](_0x1fbe82[_0xe265('0xf')])){setTimeout(handleSendEmail(_0x1fbe82,_0x4a3a97),0x3c*0x3e8);}};}function handleJob(_0x5ba9eb){return function(){try{if(_['isNil'](_0x5ba9eb[_0xe265('0x17')])){return logger[_0xe265('0x28')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xe265('0x30')](_0x5ba9eb[_0xe265('0x18')])){return logger[_0xe265('0x28')]('subtractUnit\x20null\x20or\x20undefined');}var _0x358558={'startDate':moment()[_0xe265('0x31')](_0x5ba9eb[_0xe265('0x17')],_0x5ba9eb[_0xe265('0x18')])[_0xe265('0x1c')](_0xe265('0x32')),'endDate':moment()[_0xe265('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x5ba9eb['output'],'name':_0x5ba9eb[_0xe265('0x12')]};if(!_['isNil'](_0x5ba9eb['DefaultReportId'])){logger['info'](_0xe265('0x33'),_0x5ba9eb['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x5ba9eb[_0xe265('0x34')]},_0x358558)['then'](handleResult(_0x5ba9eb))[_0xe265('0x35')](handleError());}if(!_['isNil'](_0x5ba9eb['CustomReportId'])){logger['info'](_0xe265('0x36'),_0x5ba9eb['CustomReportId']);return analyticCustomReportController[_0xe265('0x37')]({'id':_0x5ba9eb[_0xe265('0x38')]},_0x358558)[_0xe265('0x39')](handleResult(_0x5ba9eb))[_0xe265('0x35')](handleError());}}catch(_0x2f2cd5){logger[_0xe265('0x2b')](JSON['stringify'](_0x2f2cd5));}return logger[_0xe265('0x28')]('no\x20report\x20id');};}function getJobs(_0x46c2cc){var _0x3a4004={};if(_0x46c2cc){_0x3a4004['id']=_0x46c2cc;}return db[_0xe265('0x3a')][_0xe265('0x3b')]({'where':_0x3a4004,'include':[{'model':db[_0xe265('0x10')],'attributes':['id',_0xe265('0x12'),_0xe265('0xf')],'include':[{'model':db[_0xe265('0x3c')],'as':_0xe265('0x13'),'include':[{'model':db[_0xe265('0x3d')],'as':_0xe265('0x3d')}]}]}]})[_0xe265('0x39')](function(_0x4b50fb){var _0xf779ac=_[_0xe265('0x3e')](manager['jobs']);var _0x3e755f=_[_0xe265('0x3f')](_0x4b50fb,function(_0xc39a85){return _0xc39a85['id'][_0xe265('0x40')]();});var _0x449cda=_[_0xe265('0x41')](_0x4b50fb,function(_0x1079ae){return _0x1079ae['id'][_0xe265('0x40')]();});var _0x1ddad8=_0x46c2cc?_0x3e755f:_[_0xe265('0x42')](_0x3e755f,_0xf779ac);var _0x568949=_[_0xe265('0x43')](_0x3e755f,_0xf779ac);var _0x884b94=_[_0xe265('0x42')](_0xf779ac,_0x3e755f);var _0x32a58f;var _0x53f594;for(_0x32a58f=0x0;_0x32a58f<_0x884b94[_0xe265('0x44')]&&!_0x46c2cc;_0x32a58f+=0x1){_0x53f594=_0x884b94[_0x32a58f][_0xe265('0x40')]();if(manager['exists'](_0x53f594)){manager[_0xe265('0x45')](_0x53f594);manager['deleteJob'](_0x53f594);logger[_0xe265('0x28')](_0xe265('0x46'),_0x53f594);}}logger[_0xe265('0x28')](_0xe265('0x47'),JSON[_0xe265('0x2e')](_0x1ddad8));for(_0x32a58f=0x0;_0x32a58f<_0x1ddad8[_0xe265('0x44')];_0x32a58f+=0x1){_0x53f594=_0x1ddad8[_0x32a58f][_0xe265('0x40')]();logger[_0xe265('0x28')](_0xe265('0x48'),_0x53f594);if(_0x46c2cc){logger['info'](_0xe265('0x49'),_0x46c2cc);logger[_0xe265('0x28')](JSON[_0xe265('0x2e')](_0x449cda[_0x53f594]));BPromise[_0xe265('0x4a')]()[_0xe265('0x39')](handleJob(_0x449cda[_0x53f594]));logger[_0xe265('0x28')](_0xe265('0x4b'),_0x449cda[_0x53f594][_0xe265('0x12')],_0x449cda[_0x53f594][_0xe265('0x4c')]);}else if(_0x449cda[_0x53f594][_0xe265('0x4c')]&&_0x449cda[_0x53f594][_0xe265('0x4d')]&&moment()['isBetween'](_0x449cda[_0x53f594][_0xe265('0x4e')],_0x449cda[_0x53f594][_0xe265('0x4f')])){manager['add'](_0x53f594,_0x449cda[_0x53f594][_0xe265('0x4c')],handleJob(_0x449cda[_0x53f594]));manager[_0xe265('0x50')](_0x53f594);logger[_0xe265('0x28')]('add\x20cron',_0x449cda[_0x53f594][_0xe265('0x12')],_0x449cda[_0x53f594][_0xe265('0x4c')]);}else if(manager[_0xe265('0x51')](_0x53f594)){manager[_0xe265('0x45')](_0x53f594);manager[_0xe265('0x52')](_0x53f594);logger['info'](_0xe265('0x53'),_0x449cda[_0x53f594][_0xe265('0x12')],_0x449cda[_0x53f594][_0xe265('0x4c')]);}}for(_0x32a58f=0x0,_0x53f594;_0x32a58f<_0x568949[_0xe265('0x44')]&&!_0x46c2cc;_0x32a58f+=0x1){_0x53f594=_0x568949[_0x32a58f][_0xe265('0x40')]();if(manager['exists'](_0x53f594)){if(_0x449cda[_0x53f594][_0xe265('0x4c')]&&_0x449cda[_0x53f594][_0xe265('0x4d')]&&moment()[_0xe265('0x54')](_0x449cda[_0x53f594][_0xe265('0x4e')],_0x449cda[_0x53f594][_0xe265('0x4f')])){manager[_0xe265('0x55')](_0x53f594,_0x449cda[_0x53f594][_0xe265('0x4c')],handleJob(_0x449cda[_0x53f594]));logger[_0xe265('0x28')]('update\x20cron',_0x449cda[_0x53f594][_0xe265('0x12')],_0x449cda[_0x53f594][_0xe265('0x4c')]);}else{manager[_0xe265('0x45')](_0x53f594);manager[_0xe265('0x52')](_0x53f594);logger[_0xe265('0x28')]('stop\x20cron',_0x449cda[_0x53f594][_0xe265('0x12')],_0x449cda[_0x53f594]['cron']);}}}})[_0xe265('0x35')](function(_0x2b6bbb){logger['error'](JSON[_0xe265('0x2e')](_0x2b6bbb));});}exports[_0xe265('0x56')]=function(_0x5d251c){return getJobs(_0x5d251c);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x386f=['MailAccount','getSmtpOptions','format','Smtp','user','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','zip','join','status','Sent','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','SendMail','then','error','stringify','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','exists','stop','deleteJob','delete\x20cron','toRun','length','index','my\x20id','run\x20job','cron','active','isBetween','add','start','add\x20cron','endAt','update','update\x20cron','stop\x20cron','run','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','Try\x20to\x20send\x20a\x20mail\x20to','email'];(function(_0x217483,_0x422422){var _0x37f8a4=function(_0x7639ac){while(--_0x7639ac){_0x217483['push'](_0x217483['shift']());}};_0x37f8a4(++_0x422422);}(_0x386f,0x194));var _0xf386=function(_0x2a1d7a,_0x2f8c37){_0x2a1d7a=_0x2a1d7a-0x0;var _0xfc9855=_0x386f[_0x2a1d7a];return _0xfc9855;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xf386('0x0'));var _=require(_0xf386('0x1'));var moment=require(_0xf386('0x2'));var CronJobManager=require(_0xf386('0x3'));var jayson=require(_0xf386('0x4'));var BPromise=require(_0xf386('0x5'));var logger=require(_0xf386('0x6'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xf386('0x7'));var analyticDefaultReportController=require(_0xf386('0x8'));var client=jayson['client']['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5057ee,_0x19abbe){return function(){logger['info'](_0xf386('0x9'),_0x5057ee[_0xf386('0xa')]);var _0x1ceae9=!![];var _0x3d1c86=_0x5057ee[_0xf386('0xb')][_0xf386('0xc')]();var _0x4e9191={'account':_0x3d1c86,'message':{'from':util[_0xf386('0xd')]('\x22%s\x22\x20<%s>',_0x5057ee[_0xf386('0xb')]['name'],_0x5057ee[_0xf386('0xb')][_0xf386('0xa')]||_0x5057ee[_0xf386('0xb')][_0xf386('0xe')][_0xf386('0xf')]),'to':_0x5057ee[_0xf386('0xa')],'cc':_0x5057ee['cc'],'bcc':_0x5057ee['bcc'],'subject':util[_0xf386('0xd')](_0xf386('0x10'),_0x19abbe[_0xf386('0x11')],_0x5057ee[_0xf386('0x12')],_0x5057ee[_0xf386('0x13')])}};var _0x32fad3=path['join'](__dirname,_0xf386('0x14'));var _0x336b70=_0x19abbe[_0xf386('0x15')];var _0x528912=util[_0xf386('0xd')](_0xf386('0x16'),path[_0xf386('0x17')](_0x19abbe[_0xf386('0x15')],path['extname'](_0x19abbe[_0xf386('0x15')])),_0xf386('0x18'));var _0x1bbd1a=path[_0xf386('0x19')](_0x32fad3,_0x336b70);var _0x4d39ec=path[_0xf386('0x19')](_0x32fad3,_0x528912);if(fs['existsSync'](_0x1bbd1a)){_0x19abbe[_0xf386('0x1a')]=_0xf386('0x1b');_0x4e9191['message']['attachments']=[{'filename':_0x336b70,'path':_0x1bbd1a}];_0x4e9191[_0xf386('0x1c')]['text']=util[_0xf386('0xd')](_0xf386('0x1d'),JSON['stringify'](_0x19abbe,null,0x2));}else if(fs[_0xf386('0x1e')](_0x4d39ec)){_0x19abbe['status']=_0xf386('0x1b');_0x4e9191[_0xf386('0x1c')]['attachments']=[{'filename':_0x528912,'path':_0x4d39ec}];}else{_0x4e9191[_0xf386('0x1c')]['text']=_0xf386('0x1f');if(!_0x5057ee[_0xf386('0x20')]){_0x1ceae9=![];logger[_0xf386('0x21')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x1ceae9){return client['request'](_0xf386('0x22'),_0x4e9191)[_0xf386('0x23')](function(_0x19bb23){if(_0x19bb23[_0xf386('0x24')]){return logger[_0xf386('0x24')]('error\x20mail',JSON[_0xf386('0x25')](_0x19bb23));}return logger[_0xf386('0x21')]('email\x20sent');})['catch'](function(_0x1b6fe6){return logger[_0xf386('0x24')](_0xf386('0x26'),JSON[_0xf386('0x25')](_0x1b6fe6));});}};}function handleError(){return function(_0x239d84){return logger[_0xf386('0x24')](JSON['stringify'](_0x239d84));};}function handleResult(_0x956622){return function(_0x4fec73){logger[_0xf386('0x21')](_0xf386('0x27'),JSON[_0xf386('0x25')](_0x4fec73));if(_0x956622[_0xf386('0xb')]&&_0x956622[_0xf386('0xb')][_0xf386('0xe')]&&!_[_0xf386('0x28')](_0x956622['email'])){setTimeout(handleSendEmail(_0x956622,_0x4fec73),0x3c*0x3e8);}};}function handleJob(_0x261b8d){return function(){try{if(_[_0xf386('0x28')](_0x261b8d[_0xf386('0x12')])){return logger[_0xf386('0x21')](_0xf386('0x29'));}if(_[_0xf386('0x28')](_0x261b8d['subtractUnit'])){return logger[_0xf386('0x21')](_0xf386('0x2a'));}var _0x33427a={'startDate':moment()[_0xf386('0x2b')](_0x261b8d['subtractNumber'],_0x261b8d[_0xf386('0x13')])[_0xf386('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xf386('0xd')](_0xf386('0x2c')),'type':_0xf386('0x2d'),'output':_0x261b8d[_0xf386('0x2e')],'name':_0x261b8d['name']};if(!_[_0xf386('0x28')](_0x261b8d[_0xf386('0x2f')])){logger['info'](_0xf386('0x30'),_0x261b8d[_0xf386('0x2f')]);return analyticDefaultReportController[_0xf386('0x31')]({'id':_0x261b8d['DefaultReportId']},_0x33427a)[_0xf386('0x23')](handleResult(_0x261b8d))[_0xf386('0x32')](handleError());}if(!_[_0xf386('0x28')](_0x261b8d[_0xf386('0x33')])){logger[_0xf386('0x21')]('exec\x20custom\x20report\x20id:%s',_0x261b8d[_0xf386('0x33')]);return analyticCustomReportController[_0xf386('0x31')]({'id':_0x261b8d[_0xf386('0x33')]},_0x33427a)[_0xf386('0x23')](handleResult(_0x261b8d))[_0xf386('0x32')](handleError());}}catch(_0x3f334a){logger[_0xf386('0x24')](JSON[_0xf386('0x25')](_0x3f334a));}return logger['info'](_0xf386('0x34'));};}function getJobs(_0x3d80e6){var _0x58f5f7={};if(_0x3d80e6){_0x58f5f7['id']=_0x3d80e6;}return db[_0xf386('0x35')]['findAll']({'where':_0x58f5f7,'include':[{'model':db[_0xf386('0xb')],'attributes':['id',_0xf386('0x11'),_0xf386('0xa')],'include':[{'model':db[_0xf386('0x36')],'as':_0xf386('0xe'),'include':[{'model':db[_0xf386('0x37')],'as':_0xf386('0x37')}]}]}]})['then'](function(_0x419c95){var _0x5ee22b=_[_0xf386('0x38')](manager[_0xf386('0x39')]);var _0x132f66=_[_0xf386('0x3a')](_0x419c95,function(_0x32b7c0){return _0x32b7c0['id'][_0xf386('0x3b')]();});var _0x78ea5c=_[_0xf386('0x3c')](_0x419c95,function(_0x3ece71){return _0x3ece71['id']['toString']();});var _0xe1f4c3=_0x3d80e6?_0x132f66:_[_0xf386('0x3d')](_0x132f66,_0x5ee22b);var _0x35e976=_[_0xf386('0x3e')](_0x132f66,_0x5ee22b);var _0x171cbf=_[_0xf386('0x3d')](_0x5ee22b,_0x132f66);var _0x5f48d8;var _0x33db45;for(_0x5f48d8=0x0;_0x5f48d8<_0x171cbf['length']&&!_0x3d80e6;_0x5f48d8+=0x1){_0x33db45=_0x171cbf[_0x5f48d8]['toString']();if(manager[_0xf386('0x3f')](_0x33db45)){manager[_0xf386('0x40')](_0x33db45);manager[_0xf386('0x41')](_0x33db45);logger[_0xf386('0x21')](_0xf386('0x42'),_0x33db45);}}logger[_0xf386('0x21')](_0xf386('0x43'),JSON[_0xf386('0x25')](_0xe1f4c3));for(_0x5f48d8=0x0;_0x5f48d8<_0xe1f4c3[_0xf386('0x44')];_0x5f48d8+=0x1){_0x33db45=_0xe1f4c3[_0x5f48d8][_0xf386('0x3b')]();logger[_0xf386('0x21')](_0xf386('0x45'),_0x33db45);if(_0x3d80e6){logger[_0xf386('0x21')](_0xf386('0x46'),_0x3d80e6);logger['info'](JSON[_0xf386('0x25')](_0x78ea5c[_0x33db45]));BPromise['resolve']()[_0xf386('0x23')](handleJob(_0x78ea5c[_0x33db45]));logger['info'](_0xf386('0x47'),_0x78ea5c[_0x33db45][_0xf386('0x11')],_0x78ea5c[_0x33db45][_0xf386('0x48')]);}else if(_0x78ea5c[_0x33db45][_0xf386('0x48')]&&_0x78ea5c[_0x33db45][_0xf386('0x49')]&&moment()[_0xf386('0x4a')](_0x78ea5c[_0x33db45]['startAt'],_0x78ea5c[_0x33db45]['endAt'])){manager[_0xf386('0x4b')](_0x33db45,_0x78ea5c[_0x33db45][_0xf386('0x48')],handleJob(_0x78ea5c[_0x33db45]));manager[_0xf386('0x4c')](_0x33db45);logger[_0xf386('0x21')](_0xf386('0x4d'),_0x78ea5c[_0x33db45][_0xf386('0x11')],_0x78ea5c[_0x33db45][_0xf386('0x48')]);}else if(manager[_0xf386('0x3f')](_0x33db45)){manager['stop'](_0x33db45);manager['deleteJob'](_0x33db45);logger['info']('stop\x20cron',_0x78ea5c[_0x33db45][_0xf386('0x11')],_0x78ea5c[_0x33db45][_0xf386('0x48')]);}}for(_0x5f48d8=0x0,_0x33db45;_0x5f48d8<_0x35e976[_0xf386('0x44')]&&!_0x3d80e6;_0x5f48d8+=0x1){_0x33db45=_0x35e976[_0x5f48d8][_0xf386('0x3b')]();if(manager[_0xf386('0x3f')](_0x33db45)){if(_0x78ea5c[_0x33db45][_0xf386('0x48')]&&_0x78ea5c[_0x33db45][_0xf386('0x49')]&&moment()[_0xf386('0x4a')](_0x78ea5c[_0x33db45]['startAt'],_0x78ea5c[_0x33db45][_0xf386('0x4e')])){manager[_0xf386('0x4f')](_0x33db45,_0x78ea5c[_0x33db45][_0xf386('0x48')],handleJob(_0x78ea5c[_0x33db45]));logger[_0xf386('0x21')](_0xf386('0x50'),_0x78ea5c[_0x33db45]['name'],_0x78ea5c[_0x33db45][_0xf386('0x48')]);}else{manager[_0xf386('0x40')](_0x33db45);manager['deleteJob'](_0x33db45);logger[_0xf386('0x21')](_0xf386('0x51'),_0x78ea5c[_0x33db45][_0xf386('0x11')],_0x78ea5c[_0x33db45]['cron']);}}}})['catch'](function(_0x1abcc7){logger[_0xf386('0x24')](JSON[_0xf386('0x25')](_0x1abcc7));});}exports[_0xf386('0x52')]=function(_0x48d662){return getJobs(_0x48d662);};exports[_0xf386('0x4c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index fac12fc..17d75dc 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde6f=['TranscriptionJob','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','sentiment','sentimentAccountId','language','bucket','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','update','Sentiment','SentimentScore','Positive','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Neutral','COMPLETED','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','all','SequelizeValidationError','request-promise','util','bluebird','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','transcribeName','data1','data2','then','TranscriptionJobStatus','fileText'];(function(_0x2deb12,_0x2bd2e4){var _0x360b37=function(_0x4d2e34){while(--_0x4d2e34){_0x2deb12['push'](_0x2deb12['shift']());}};_0x360b37(++_0x2bd2e4);}(_0xde6f,0x84));var _0xfde6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xde6f[_0x321bb2];return _0x9c12ed;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require(_0xfde6('0x0'));var util=require(_0xfde6('0x1'));var BPromise=require(_0xfde6('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xfde6('0x3'))(_0xfde6('0x4'));function getTranscriptionJob(_0x3d10be,_0x17d254,_0x44c8f3,_0x347a67){return new Promise(function(_0x50d21a,_0x5628ea){var _0x20ec09=new AWS[(_0xfde6('0x5'))]({'accessKeyId':_0x17d254,'secretAccessKey':_0x3d10be,'region':_0x44c8f3});_0x20ec09[_0xfde6('0x6')]({'TranscriptionJobName':_0x347a67},function(_0x135b39,_0x5e6fb0){if(_0x135b39){return _0x5628ea(_0x135b39);}else{return _0x50d21a(_0x5e6fb0);}});});}function sentiment(_0x333746,_0x3fe159,_0x136937,_0x5d890c,_0x27e896){return new Promise(function(_0x470b8a,_0x48dd4c){var _0x5167e2=new AWS[(_0xfde6('0x7'))]({'accessKeyId':_0x3fe159,'secretAccessKey':_0x333746,'region':_0x136937});_0x5167e2[_0xfde6('0x8')]({'Text':_0x5d890c,'LanguageCode':_0x27e896[_0xfde6('0x9')](0x0,0x2)},function(_0x1a540f,_0x485d23){if(_0x1a540f){return _0x48dd4c(_0x1a540f);}else{return _0x470b8a(_0x485d23);}});});}function checkTranscribeJob(_0xdb1266,_0x9a96cf,_0x3a3776){var _0x1c5ade;return new BPromise(function(_0x13da60,_0x5bf8fb){logger[_0xfde6('0xa')](util[_0xfde6('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0xdb1266['id'],_0xdb1266[_0xfde6('0xc')]));return getTranscriptionJob(_0x3a3776[_0xfde6('0xd')],_0x3a3776[_0xfde6('0xe')],_0x9a96cf['transcribeRegion'],_0xdb1266[_0xfde6('0xc')])[_0xfde6('0xf')](function(_0x101ea8){logger[_0xfde6('0xa')](util['format']('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0xdb1266['id'],_0xdb1266[_0xfde6('0xc')],_0x101ea8['TranscriptionJob'][_0xfde6('0x10')]));if(!_0xdb1266[_0xfde6('0x11')]){switch(_0x101ea8['TranscriptionJob'][_0xfde6('0x10')]){case'COMPLETED':var _0x122e45={'transcribeStatus':_0x101ea8[_0xfde6('0x12')][_0xfde6('0x10')],'fileUri':_0x101ea8[_0xfde6('0x12')][_0xfde6('0x13')][_0xfde6('0x14')]};logger[_0xfde6('0xa')](util[_0xfde6('0xb')](_0xfde6('0x15'),_0xdb1266['id']));return rp({'uri':_0x101ea8['TranscriptionJob'][_0xfde6('0x13')][_0xfde6('0x14')],'json':!![]})['then'](function(_0x2577a1){logger[_0xfde6('0xa')](util['format'](_0xfde6('0x16'),_0xdb1266['id']));if(_0x2577a1&&_0x2577a1[_0xfde6('0x17')]&&_0x2577a1['results']['transcripts']&&_0x2577a1[_0xfde6('0x17')][_0xfde6('0x18')]['length']){_0x122e45[_0xfde6('0x11')]='';for(var _0x492219=0x0;_0x492219<_0x2577a1['results'][_0xfde6('0x18')][_0xfde6('0x19')];_0x492219++){_0x122e45[_0xfde6('0x11')]+=_0x2577a1[_0xfde6('0x17')][_0xfde6('0x18')][_0x492219][_0xfde6('0x1a')]+'';}}return _0xdb1266['update'](_0x122e45);})[_0xfde6('0xf')](function(){logger[_0xfde6('0xa')](util['format'](_0xfde6('0x1b'),_0xdb1266['id']));if(!_0xdb1266['tempSentiment']){throw new db[(_0xfde6('0x1c'))][(_0xfde6('0x1d'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x9a96cf[_0xfde6('0x1e')]||!_0x9a96cf[_0xfde6('0x1f')]||!_0x9a96cf['sentimentRegion']||!_0x9a96cf[_0xfde6('0x20')]||!_0x9a96cf[_0xfde6('0x21')]){throw new db['Sequelize'][(_0xfde6('0x1d'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x122e45[_0xfde6('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x9a96cf['sentimentAccountId']===_0x3a3776['id']){return _0x3a3776;}else{return db['CloudProvider'][_0xfde6('0x22')]({'where':{'id':_settings[_0xfde6('0x1f')]}});}})[_0xfde6('0xf')](function(_0x140296){if(!_0x140296){throw new db[(_0xfde6('0x1c'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x140296['data1']||!_0x140296[_0xfde6('0xe')]){throw new db[(_0xfde6('0x1c'))][(_0xfde6('0x1d'))](_0xfde6('0x23'));}_0x1c5ade=_0x140296;logger[_0xfde6('0xa')](util[_0xfde6('0xb')](_0xfde6('0x24'),_0xdb1266['id']));return sentiment(_0x1c5ade[_0xfde6('0xd')],_0x1c5ade[_0xfde6('0xe')],_0x9a96cf['sentimentRegion'],_0x122e45[_0xfde6('0x11')],_0x9a96cf[_0xfde6('0x20')]);})[_0xfde6('0xf')](function(_0x180ece){logger['info'](util[_0xfde6('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0xdb1266['id']));return _0xdb1266[_0xfde6('0x25')]({'sentiment':_0x180ece[_0xfde6('0x26')],'sPositive':_0x180ece[_0xfde6('0x27')][_0xfde6('0x28')],'sNegative':_0x180ece['SentimentScore'][_0xfde6('0x29')],'sMixed':_0x180ece['SentimentScore'][_0xfde6('0x2a')],'sNeutral':_0x180ece[_0xfde6('0x27')]['Neutral']});})[_0xfde6('0xf')](function(){logger[_0xfde6('0xa')](util[_0xfde6('0xb')](_0xfde6('0x1b'),_0xdb1266['id']));_0x13da60();});case'FAILED':return _0xdb1266[_0xfde6('0x25')]({'transcribeStatus':_0xfde6('0x2b'),'failureReason':_0x101ea8[_0xfde6('0x12')][_0xfde6('0x2c')]})[_0xfde6('0xf')](function(){logger[_0xfde6('0xa')](util[_0xfde6('0xb')](_0xfde6('0x1b'),_0xdb1266['id']));_0x13da60();});default:logger[_0xfde6('0xa')](util[_0xfde6('0xb')](_0xfde6('0x2d'),_0xdb1266['id']));break;}}else{return BPromise[_0xfde6('0x2e')]()[_0xfde6('0xf')](function(){if(!_0xdb1266[_0xfde6('0x2f')]){throw new db[(_0xfde6('0x1c'))][(_0xfde6('0x1d'))](_0xfde6('0x30'));}if(!_0x9a96cf['sentiment']||!_0x9a96cf['sentimentAccountId']||!_0x9a96cf['sentimentRegion']||!_0x9a96cf[_0xfde6('0x20')]||!_0x9a96cf[_0xfde6('0x21')]){throw new db['Sequelize'][(_0xfde6('0x1d'))](_0xfde6('0x31'));}if(!_0xdb1266[_0xfde6('0x11')]){throw new Error(_0xfde6('0x32'));}if(_0x9a96cf[_0xfde6('0x1f')]===_0x3a3776['id']){return _0x3a3776;}else{return db[_0xfde6('0x33')][_0xfde6('0x22')]({'where':{'id':_settings[_0xfde6('0x1f')]}});}})[_0xfde6('0xf')](function(_0x245894){if(!_0x245894){throw new db[(_0xfde6('0x1c'))][(_0xfde6('0x1d'))](_0xfde6('0x34'));}if(!_0x245894['data1']||!_0x245894[_0xfde6('0xe')]){throw new db[(_0xfde6('0x1c'))]['ValidationError'](_0xfde6('0x23'));}_0x1c5ade=_0x245894;logger[_0xfde6('0xa')](util[_0xfde6('0xb')](_0xfde6('0x24'),_0xdb1266['id']));return sentiment(_0x1c5ade[_0xfde6('0xd')],_0x1c5ade[_0xfde6('0xe')],_0x9a96cf[_0xfde6('0x35')],_0xdb1266[_0xfde6('0x11')],_0x9a96cf[_0xfde6('0x20')]);})[_0xfde6('0xf')](function(_0x387581){logger[_0xfde6('0xa')](util[_0xfde6('0xb')](_0xfde6('0x36'),_0xdb1266['id']));return _0xdb1266[_0xfde6('0x25')]({'sentiment':_0x387581[_0xfde6('0x26')],'sPositive':_0x387581['SentimentScore'][_0xfde6('0x28')],'sNegative':_0x387581[_0xfde6('0x27')][_0xfde6('0x29')],'sMixed':_0x387581[_0xfde6('0x27')][_0xfde6('0x2a')],'sNeutral':_0x387581['SentimentScore'][_0xfde6('0x37')],'transcribeStatus':_0xfde6('0x38')});})[_0xfde6('0xf')](function(){logger['info'](util['format'](_0xfde6('0x1b'),_0xdb1266['id']));_0x13da60();});}})[_0xfde6('0x39')](function(_0x1eb912){if(_0x1eb912){if(!_0x1eb912[_0xfde6('0x3a')]||_0x1eb912[_0xfde6('0x3a')]!=='SequelizeValidationError'){logger[_0xfde6('0x3b')](util[_0xfde6('0xb')](_0xfde6('0x3c'),_0xdb1266['id']),util[_0xfde6('0x3d')](_0x1eb912,{'showHidden':![],'depth':null}));}}_0x13da60();});});}function checkTranscribe(){var _0x545f35;var _0x1419be;var _0x5ccefb;return db[_0xfde6('0x3e')][_0xfde6('0x3f')]({'where':{'transcribeStatus':_0xfde6('0x40')}})[_0xfde6('0xf')](function(_0x3830ea){if(!_0x3830ea||!_0x3830ea[_0xfde6('0x19')]){throw new db[(_0xfde6('0x1c'))][(_0xfde6('0x1d'))](_0xfde6('0x41'));}_0x545f35=_0x3830ea;return db[_0xfde6('0x42')]['findOne']({'where':{'id':0x1}});})[_0xfde6('0xf')](function(_0x43677d){if(!_0x43677d){throw new db['Sequelize'][(_0xfde6('0x1d'))](_0xfde6('0x43'));}_0x1419be=_0x43677d;if(!_0x1419be['transcribe']||!_0x1419be[_0xfde6('0x44')]||!_0x1419be[_0xfde6('0x45')]||!_0x1419be[_0xfde6('0x20')]||!_0x1419be[_0xfde6('0x21')]){throw new db[(_0xfde6('0x1c'))][(_0xfde6('0x1d'))](_0xfde6('0x46'));}return db[_0xfde6('0x33')][_0xfde6('0x22')]({'where':{'id':_0x1419be[_0xfde6('0x44')]}});})[_0xfde6('0xf')](function(_0x507d55){if(!_0x507d55){throw new db['Sequelize'][(_0xfde6('0x1d'))](_0xfde6('0x34'));}if(!_0x507d55[_0xfde6('0xd')]||!_0x507d55[_0xfde6('0xe')]){throw new db[(_0xfde6('0x1c'))][(_0xfde6('0x1d'))](_0xfde6('0x23'));}_0x5ccefb=_0x507d55;var _0x2a25d6=[];_0x545f35[_0xfde6('0x47')](function(_0x13ab70){_0x2a25d6[_0xfde6('0x48')](checkTranscribeJob(_0x13ab70,_0x1419be,_0x5ccefb));});return BPromise[_0xfde6('0x49')](_0x2a25d6);})[_0xfde6('0x39')](function(_0x19915d){if(_0x19915d){if(!_0x19915d[_0xfde6('0x3a')]||_0x19915d[_0xfde6('0x3a')]!==_0xfde6('0x4a')){logger['error'](util['inspect'](_0x19915d,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x6584=['Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','catch','name','error','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','lodash','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','detectSentiment','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','transcribeRegion','transcribeName','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','info','format','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','then','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne'];(function(_0x58e434,_0x3b6d4f){var _0xfc855a=function(_0x2302c0){while(--_0x2302c0){_0x58e434['push'](_0x58e434['shift']());}};_0xfc855a(++_0x3b6d4f);}(_0x6584,0x175));var _0x4658=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0x6584[_0x4394b6];return _0x360244;};var _=require(_0x4658('0x0'));var AWS=require(_0x4658('0x1'));var rp=require(_0x4658('0x2'));var util=require(_0x4658('0x3'));var BPromise=require('bluebird');var db=require(_0x4658('0x4'))['db'];var logger=require(_0x4658('0x5'))(_0x4658('0x6'));function getTranscriptionJob(_0x55b820,_0x53a2eb,_0x15fbf2,_0x126301){return new Promise(function(_0x253182,_0x63273f){var _0x5b2a16=new AWS['TranscribeService']({'accessKeyId':_0x53a2eb,'secretAccessKey':_0x55b820,'region':_0x15fbf2});_0x5b2a16[_0x4658('0x7')]({'TranscriptionJobName':_0x126301},function(_0x2ff543,_0x6e2e03){if(_0x2ff543){return _0x63273f(_0x2ff543);}else{return _0x253182(_0x6e2e03);}});});}function sentiment(_0x51d3f4,_0x10b9e0,_0x796ef7,_0x570ef0,_0x5117fc){return new Promise(function(_0x429f7a,_0x49ec37){var _0x309489=new AWS['Comprehend']({'accessKeyId':_0x10b9e0,'secretAccessKey':_0x51d3f4,'region':_0x796ef7});_0x309489[_0x4658('0x8')]({'Text':_0x570ef0,'LanguageCode':_0x5117fc['substring'](0x0,0x2)},function(_0x4060c6,_0x511c40){if(_0x4060c6){return _0x49ec37(_0x4060c6);}else{return _0x429f7a(_0x511c40);}});});}function checkTranscribeJob(_0x29a06a,_0x243444,_0x424206){var _0x4eb5e5;return new BPromise(function(_0x38aabe,_0x41f611){logger['info'](util['format'](_0x4658('0x9'),_0x29a06a['id'],_0x29a06a['transcribeName']));return getTranscriptionJob(_0x424206[_0x4658('0xa')],_0x424206['data2'],_0x243444[_0x4658('0xb')],_0x29a06a[_0x4658('0xc')])['then'](function(_0x27aede){logger['info'](util['format']('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x29a06a['id'],_0x29a06a[_0x4658('0xc')],_0x27aede['TranscriptionJob'][_0x4658('0xd')]));if(!_0x29a06a[_0x4658('0xe')]){switch(_0x27aede[_0x4658('0xf')][_0x4658('0xd')]){case _0x4658('0x10'):var _0x30bf0d={'transcribeStatus':_0x27aede['TranscriptionJob'][_0x4658('0xd')],'fileUri':_0x27aede[_0x4658('0xf')][_0x4658('0x11')][_0x4658('0x12')]};logger[_0x4658('0x13')](util[_0x4658('0x14')]('[RECORDING:%d]\x20Get\x20transcript',_0x29a06a['id']));return rp({'uri':_0x27aede[_0x4658('0xf')][_0x4658('0x11')][_0x4658('0x12')],'json':!![]})['then'](function(_0x2eb16d){logger[_0x4658('0x13')](util[_0x4658('0x14')](_0x4658('0x15'),_0x29a06a['id']));if(_0x2eb16d&&_0x2eb16d[_0x4658('0x16')]&&_0x2eb16d[_0x4658('0x16')][_0x4658('0x17')]&&_0x2eb16d['results'][_0x4658('0x17')]['length']){_0x30bf0d[_0x4658('0xe')]='';for(var _0x4516b4=0x0;_0x4516b4<_0x2eb16d[_0x4658('0x16')][_0x4658('0x17')][_0x4658('0x18')];_0x4516b4++){_0x30bf0d['fileText']+=_0x2eb16d[_0x4658('0x16')][_0x4658('0x17')][_0x4516b4][_0x4658('0x19')]+'';}}return _0x29a06a[_0x4658('0x1a')](_0x30bf0d);})[_0x4658('0x1b')](function(){logger[_0x4658('0x13')](util[_0x4658('0x14')](_0x4658('0x1c'),_0x29a06a['id']));if(!_0x29a06a[_0x4658('0x1d')]){throw new db['Sequelize'][(_0x4658('0x1e'))](_0x4658('0x1f'));}if(!_0x243444[_0x4658('0x20')]||!_0x243444[_0x4658('0x21')]||!_0x243444['sentimentRegion']||!_0x243444[_0x4658('0x22')]||!_0x243444[_0x4658('0x23')]){throw new db[(_0x4658('0x24'))][(_0x4658('0x1e'))](_0x4658('0x25'));}if(!_0x30bf0d['fileText']){throw new Error(_0x4658('0x26'));}if(_0x243444['sentimentAccountId']===_0x424206['id']){return _0x424206;}else{return db[_0x4658('0x27')][_0x4658('0x28')]({'where':{'id':_settings[_0x4658('0x21')]}});}})['then'](function(_0x19856c){if(!_0x19856c){throw new db[(_0x4658('0x24'))][(_0x4658('0x1e'))](_0x4658('0x29'));}if(!_0x19856c[_0x4658('0xa')]||!_0x19856c[_0x4658('0x2a')]){throw new db['Sequelize'][(_0x4658('0x1e'))](_0x4658('0x2b'));}_0x4eb5e5=_0x19856c;logger[_0x4658('0x13')](util[_0x4658('0x14')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x29a06a['id']));return sentiment(_0x4eb5e5[_0x4658('0xa')],_0x4eb5e5[_0x4658('0x2a')],_0x243444[_0x4658('0x2c')],_0x30bf0d['fileText'],_0x243444['language']);})[_0x4658('0x1b')](function(_0x560618){logger[_0x4658('0x13')](util['format'](_0x4658('0x2d'),_0x29a06a['id']));return _0x29a06a[_0x4658('0x1a')]({'sentiment':_0x560618[_0x4658('0x2e')],'sPositive':_0x560618['SentimentScore'][_0x4658('0x2f')],'sNegative':_0x560618[_0x4658('0x30')][_0x4658('0x31')],'sMixed':_0x560618[_0x4658('0x30')][_0x4658('0x32')],'sNeutral':_0x560618[_0x4658('0x30')][_0x4658('0x33')]});})[_0x4658('0x1b')](function(){logger[_0x4658('0x13')](util[_0x4658('0x14')](_0x4658('0x1c'),_0x29a06a['id']));_0x38aabe();});case _0x4658('0x34'):return _0x29a06a['update']({'transcribeStatus':_0x4658('0x34'),'failureReason':_0x27aede[_0x4658('0xf')][_0x4658('0x35')]})['then'](function(){logger[_0x4658('0x13')](util['format'](_0x4658('0x1c'),_0x29a06a['id']));_0x38aabe();});default:logger[_0x4658('0x13')](util['format'](_0x4658('0x36'),_0x29a06a['id']));break;}}else{return BPromise[_0x4658('0x37')]()[_0x4658('0x1b')](function(){if(!_0x29a06a[_0x4658('0x1d')]){throw new db[(_0x4658('0x24'))]['ValidationError'](_0x4658('0x1f'));}if(!_0x243444['sentiment']||!_0x243444[_0x4658('0x21')]||!_0x243444[_0x4658('0x2c')]||!_0x243444[_0x4658('0x22')]||!_0x243444[_0x4658('0x23')]){throw new db[(_0x4658('0x24'))]['ValidationError'](_0x4658('0x25'));}if(!_0x29a06a['fileText']){throw new Error(_0x4658('0x26'));}if(_0x243444['sentimentAccountId']===_0x424206['id']){return _0x424206;}else{return db[_0x4658('0x27')][_0x4658('0x28')]({'where':{'id':_settings[_0x4658('0x21')]}});}})[_0x4658('0x1b')](function(_0x1eca32){if(!_0x1eca32){throw new db[(_0x4658('0x24'))][(_0x4658('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1eca32[_0x4658('0xa')]||!_0x1eca32['data2']){throw new db[(_0x4658('0x24'))][(_0x4658('0x1e'))](_0x4658('0x2b'));}_0x4eb5e5=_0x1eca32;logger['info'](util[_0x4658('0x14')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x29a06a['id']));return sentiment(_0x4eb5e5['data1'],_0x4eb5e5[_0x4658('0x2a')],_0x243444['sentimentRegion'],_0x29a06a[_0x4658('0xe')],_0x243444['language']);})[_0x4658('0x1b')](function(_0x56995d){logger[_0x4658('0x13')](util[_0x4658('0x14')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x29a06a['id']));return _0x29a06a[_0x4658('0x1a')]({'sentiment':_0x56995d[_0x4658('0x2e')],'sPositive':_0x56995d['SentimentScore'][_0x4658('0x2f')],'sNegative':_0x56995d[_0x4658('0x30')]['Negative'],'sMixed':_0x56995d[_0x4658('0x30')][_0x4658('0x32')],'sNeutral':_0x56995d[_0x4658('0x30')][_0x4658('0x33')],'transcribeStatus':_0x4658('0x10')});})[_0x4658('0x1b')](function(){logger[_0x4658('0x13')](util[_0x4658('0x14')](_0x4658('0x1c'),_0x29a06a['id']));_0x38aabe();});}})[_0x4658('0x38')](function(_0x35075a){if(_0x35075a){if(!_0x35075a[_0x4658('0x39')]||_0x35075a[_0x4658('0x39')]!=='SequelizeValidationError'){logger[_0x4658('0x3a')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x29a06a['id']),util['inspect'](_0x35075a,{'showHidden':![],'depth':null}));}}_0x38aabe();});});}function checkTranscribe(){var _0x47f7fe;var _0xca376d;var _0x3bc7e0;return db[_0x4658('0x3b')][_0x4658('0x3c')]({'where':{'transcribeStatus':_0x4658('0x3d')}})['then'](function(_0x6a11f2){if(!_0x6a11f2||!_0x6a11f2[_0x4658('0x18')]){throw new db['Sequelize'][(_0x4658('0x1e'))](_0x4658('0x3e'));}_0x47f7fe=_0x6a11f2;return db['Setting']['findOne']({'where':{'id':0x1}});})['then'](function(_0x3c5712){if(!_0x3c5712){throw new db[(_0x4658('0x24'))][(_0x4658('0x1e'))](_0x4658('0x3f'));}_0xca376d=_0x3c5712;if(!_0xca376d[_0x4658('0x6')]||!_0xca376d[_0x4658('0x40')]||!_0xca376d['transcribeRegion']||!_0xca376d[_0x4658('0x22')]||!_0xca376d[_0x4658('0x23')]){throw new db[(_0x4658('0x24'))][(_0x4658('0x1e'))](_0x4658('0x41'));}return db[_0x4658('0x27')]['findOne']({'where':{'id':_0xca376d[_0x4658('0x40')]}});})[_0x4658('0x1b')](function(_0x583c52){if(!_0x583c52){throw new db[(_0x4658('0x24'))][(_0x4658('0x1e'))](_0x4658('0x29'));}if(!_0x583c52[_0x4658('0xa')]||!_0x583c52[_0x4658('0x2a')]){throw new db[(_0x4658('0x24'))][(_0x4658('0x1e'))]('Cloud\x20Provider\x20not\x20configured');}_0x3bc7e0=_0x583c52;var _0x33c754=[];_0x47f7fe[_0x4658('0x42')](function(_0x560031){_0x33c754[_0x4658('0x43')](checkTranscribeJob(_0x560031,_0xca376d,_0x3bc7e0));});return BPromise[_0x4658('0x44')](_0x33c754);})[_0x4658('0x38')](function(_0x4093b5){if(_0x4093b5){if(!_0x4093b5[_0x4658('0x39')]||_0x4093b5[_0x4658('0x39')]!=='SequelizeValidationError'){logger[_0x4658('0x3a')](util['inspect'](_0x4093b5,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 3dfb6b9..ac676d1 100644 --- a/server/config/schedule/whatsapp.js +++ b/server/config/schedule/whatsapp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdbcd=['inspect','start','lodash','moment','../../config/environment','../../mysqldb','../logger','redis','defaults','subtract','hours','then','info','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','catch'];(function(_0x19d394,_0x171598){var _0x56bc5d=function(_0xb12b8a){while(--_0xb12b8a){_0x19d394['push'](_0x19d394['shift']());}};_0x56bc5d(++_0x171598);}(_0xdbcd,0x1ba));var _0xddbc=function(_0x3447a4,_0x528548){_0x3447a4=_0x3447a4-0x0;var _0xa1fe43=_0xdbcd[_0x3447a4];return _0xa1fe43;};'use strict';var _=require(_0xddbc('0x0'));var moment=require(_0xddbc('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0xddbc('0x2'));var db=require(_0xddbc('0x3'))['db'];var logger=require(_0xddbc('0x4'))('schedule');config[_0xddbc('0x5')]=_[_0xddbc('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xddbc('0x5')]));function closeInteractions(){var _0x4d8331=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xddbc('0x7')](0x18,_0xddbc('0x8'))}}})[_0xddbc('0x9')](function(_0x123450){if(_0x123450&&_0x123450['length']){_0x4d8331=_['map'](_0x123450||[],'id');logger[_0xddbc('0xa')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x4d8331[_0xddbc('0xb')]());return db['WhatsappInteraction'][_0xddbc('0xc')]({'closeReason':_0xddbc('0xd'),'disposition':_0xddbc('0xe'),'closed':!![],'closedAt':moment()[_0xddbc('0xf')](_0xddbc('0x10'))},{'where':{'id':_0x4d8331}});}})[_0xddbc('0x9')](function(){if(_0x4d8331&&_0x4d8331[_0xddbc('0x11')]){logger[_0xddbc('0xa')](_0xddbc('0x12'),_0x4d8331[_0xddbc('0xb')]());for(var _0x458c75=0x0;_0x458c75<_0x4d8331[_0xddbc('0x11')];_0x458c75++){io['emit']('whatsappInteraction:update',{'id':_0x4d8331[_0x458c75],'closed':!![]});}}})[_0xddbc('0x13')](function(_0x4453bf){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x4453bf?util[_0xddbc('0x14')](_0x4453bf,{'showHidden':![],'depth':null}):'');});}exports[_0xddbc('0x15')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x975f=['join','WhatsappInteraction','update','timeout','YYYY-MM-DD\x20HH:mm:ss','then','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','inspect','start','moment','ioredis','redis','defaults','socket.io-emitter','lastMsgAt','subtract','hours','info'];(function(_0x2dd0cf,_0x53a53f){var _0x578453=function(_0x22d324){while(--_0x22d324){_0x2dd0cf['push'](_0x2dd0cf['shift']());}};_0x578453(++_0x53a53f);}(_0x975f,0x167));var _0xf975=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0x975f[_0x26d6d9];return _0x1b4875;};'use strict';var _=require('lodash');var moment=require(_0xf975('0x0'));var Redis=require(_0xf975('0x1'));var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require('../logger')('schedule');config[_0xf975('0x2')]=_[_0xf975('0x3')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf975('0x4'))(new Redis(config[_0xf975('0x2')]));function closeInteractions(){var _0x526ac0=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id',_0xf975('0x5')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xf975('0x6')](0x18,_0xf975('0x7'))}}})['then'](function(_0x71744b){if(_0x71744b&&_0x71744b['length']){_0x526ac0=_['map'](_0x71744b||[],'id');logger[_0xf975('0x8')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x526ac0[_0xf975('0x9')]());return db[_0xf975('0xa')][_0xf975('0xb')]({'closeReason':'system','disposition':_0xf975('0xc'),'closed':!![],'closedAt':moment()['format'](_0xf975('0xd'))},{'where':{'id':_0x526ac0}});}})[_0xf975('0xe')](function(){if(_0x526ac0&&_0x526ac0[_0xf975('0xf')]){logger[_0xf975('0x8')](_0xf975('0x10'),_0x526ac0[_0xf975('0x9')]());for(var _0x8271c1=0x0;_0x8271c1<_0x526ac0['length'];_0x8271c1++){io[_0xf975('0x11')](_0xf975('0x12'),{'id':_0x526ac0[_0x8271c1],'closed':!![]});}}})[_0xf975('0x13')](function(_0x375d9f){logger[_0xf975('0x14')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x375d9f?util[_0xf975('0x15')](_0x375d9f,{'showHidden':![],'depth':null}):'');});}exports[_0xf975('0x16')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 48ec1dc..8fa0bb7 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4662=['now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','hopper1','CmHopper','catch','util','Innocenzo','Biondo','@xcally.com','push'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x4662,0xcd));var _0x2466=function(_0x18d429,_0x20414e){_0x18d429=_0x18d429-0x0;var _0x5753db=_0x4662[_0x18d429];return _0x5753db;};'use strict';var util=require(_0x2466('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x2466('0x1')+i,'lastName':_0x2466('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x2466('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x2466('0x4')]({'id':i,'active':![],'scheduledat':Date[_0x2466('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2466('0x5')](),'updatedAt':Date[_0x2466('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x2466('0x4')]({'id':i,'firstName':_0x2466('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x2466('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x2466('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2466('0x5')](),'updatedAt':Date[_0x2466('0x5')]()});}db[_0x2466('0x6')][_0x2466('0x7')]({'where':{}})[_0x2466('0x8')](function(){return db[_0x2466('0x6')][_0x2466('0x9')](contacts);})[_0x2466('0x8')](function(){console[_0x2466('0xa')](_0x2466('0xb'),'contacts1');return db['CmHopper'][_0x2466('0x7')]({'where':{}});})[_0x2466('0x8')](function(){return db['CmHopper'][_0x2466('0x9')](hopper);})[_0x2466('0x8')](function(){console['log'](_0x2466('0xb'),_0x2466('0xc'));return db[_0x2466('0x6')][_0x2466('0x9')](contacts2);})[_0x2466('0x8')](function(){console[_0x2466('0xa')](_0x2466('0xb'),'contacts2');return db[_0x2466('0xd')][_0x2466('0x9')](hopper2);})[_0x2466('0x8')](function(){console[_0x2466('0xa')]('finished\x20populating','hopper2');})[_0x2466('0xe')](function(_0x959911){console['log'](_0x959911);}); \ No newline at end of file +var _0xd596=['CmHopper','hopper1','contacts2','util','push','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1'];(function(_0x2e9f1e,_0x4d89ae){var _0x9ba79e=function(_0x565880){while(--_0x565880){_0x2e9f1e['push'](_0x2e9f1e['shift']());}};_0x9ba79e(++_0x4d89ae);}(_0xd596,0x83));var _0x6d59=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0xd596[_0x211fef];return _0x5447bf;};'use strict';var util=require(_0x6d59('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6d59('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x6d59('0x2')+i,'phone':0xf879fb460+i,'email':_0x6d59('0x3')+i+_0x6d59('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x6d59('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6d59('0x5')](),'updatedAt':Date[_0x6d59('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6d59('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x6d59('0x2')+i,'phone':0xf879fb460+i,'email':_0x6d59('0x3')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6d59('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x6d59('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6d59('0x5')](),'updatedAt':Date['now']()});}db[_0x6d59('0x6')][_0x6d59('0x7')]({'where':{}})[_0x6d59('0x8')](function(){return db[_0x6d59('0x6')][_0x6d59('0x9')](contacts);})[_0x6d59('0x8')](function(){console[_0x6d59('0xa')](_0x6d59('0xb'),_0x6d59('0xc'));return db[_0x6d59('0xd')]['destroy']({'where':{}});})[_0x6d59('0x8')](function(){return db[_0x6d59('0xd')][_0x6d59('0x9')](hopper);})['then'](function(){console[_0x6d59('0xa')](_0x6d59('0xb'),_0x6d59('0xe'));return db[_0x6d59('0x6')][_0x6d59('0x9')](contacts2);})[_0x6d59('0x8')](function(){console[_0x6d59('0xa')]('finished\x20populating',_0x6d59('0xf'));return db[_0x6d59('0xd')][_0x6d59('0x9')](hopper2);})[_0x6d59('0x8')](function(){console[_0x6d59('0xa')](_0x6d59('0xb'),'hopper2');})['catch'](function(_0x1e63f6){console[_0x6d59('0xa')](_0x1e63f6);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 0bae19e..88835ad 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47b3=['all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','then','log','add\x20user','catch','util','../mysqldb','push','%s%s','agent','format','password','udp','wss'];(function(_0x170ee8,_0x1b2c0d){var _0x57595d=function(_0x433cf6){while(--_0x433cf6){_0x170ee8['push'](_0x170ee8['shift']());}};_0x57595d(++_0x1b2c0d);}(_0x47b3,0xee));var _0x347b=function(_0x39eb3e,_0x14064){_0x39eb3e=_0x39eb3e-0x0;var _0x4240b2=_0x47b3[_0x39eb3e];return _0x4240b2;};'use strict';var util=require(_0x347b('0x0'));var db=require(_0x347b('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x347b('0x2')]({'name':util['format'](_0x347b('0x3'),_0x347b('0x4'),i),'fullname':util[_0x347b('0x5')](_0x347b('0x3'),'agent',i),'email':util[_0x347b('0x5')]('%s%s@xcally.com',_0x347b('0x4'),i),'role':'agent','password':_0x347b('0x6'),'internal':0xfa0+i,'type':'friend','transport':[_0x347b('0x7'),'ws',_0x347b('0x8')],'disallow':[_0x347b('0x9')],'allow':['ulaw'],'defaultuser':util[_0x347b('0x5')](_0x347b('0x3'),_0x347b('0x4'),i),'encryption':_0x347b('0xa'),'avpf':_0x347b('0xa'),'force_avp':_0x347b('0xa'),'icesupport':_0x347b('0xa'),'dtlsenable':_0x347b('0xa'),'dtlsverify':'no','dtlscertfile':_0x347b('0xb'),'dtlsprivatekey':_0x347b('0xc'),'dtlssetup':'actpass','callerid':util[_0x347b('0x5')](_0x347b('0xd'),util[_0x347b('0x5')](_0x347b('0x3'),_0x347b('0x4'),i),0xfa0+i)});}db[_0x347b('0xe')]['bulkCreate'](users)[_0x347b('0xf')](function(){console[_0x347b('0x10')](_0x347b('0x11'));})[_0x347b('0x12')](function(_0x4e67cc){console[_0x347b('0x10')](_0x4e67cc);}); \ No newline at end of file +var _0x8c7b=['add\x20user','catch','log','../mysqldb','push','%s%s','agent','format','%s%s@xcally.com','password','friend','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c7b,0x7b));var _0xb8c7=function(_0xf9d583,_0xc9c988){_0xf9d583=_0xf9d583-0x0;var _0x52d96b=_0x8c7b[_0xf9d583];return _0x52d96b;};'use strict';var util=require('util');var db=require(_0xb8c7('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xb8c7('0x1')]({'name':util['format'](_0xb8c7('0x2'),_0xb8c7('0x3'),i),'fullname':util[_0xb8c7('0x4')](_0xb8c7('0x2'),_0xb8c7('0x3'),i),'email':util[_0xb8c7('0x4')](_0xb8c7('0x5'),_0xb8c7('0x3'),i),'role':'agent','password':_0xb8c7('0x6'),'internal':0xfa0+i,'type':_0xb8c7('0x7'),'transport':['udp','ws','wss'],'disallow':[_0xb8c7('0x8')],'allow':[_0xb8c7('0x9')],'defaultuser':util[_0xb8c7('0x4')](_0xb8c7('0x2'),_0xb8c7('0x3'),i),'encryption':_0xb8c7('0xa'),'avpf':_0xb8c7('0xa'),'force_avp':'yes','icesupport':'yes','dtlsenable':_0xb8c7('0xa'),'dtlsverify':'no','dtlscertfile':_0xb8c7('0xb'),'dtlsprivatekey':_0xb8c7('0xc'),'dtlssetup':'actpass','callerid':util['format'](_0xb8c7('0xd'),util[_0xb8c7('0x4')](_0xb8c7('0x2'),_0xb8c7('0x3'),i),0xfa0+i)});}db[_0xb8c7('0xe')][_0xb8c7('0xf')](users)[_0xb8c7('0x10')](function(){console['log'](_0xb8c7('0x11'));})[_0xb8c7('0x12')](function(_0x1b363c){console[_0xb8c7('0x13')](_0x1b363c);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 0dead44..b7b1f0a 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x88f8=['WhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','default','connection','address','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','CONNECTED','util','../mysqldb','./environment','Agents','User','name','role','agent','telephone','type','ivr','UserProfileSection','findOne','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','Campaign','where','then','format','%s:queue:%s','length','user:%s','query','find','handshake','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','VoiceQueues','userProfileId','ChatQueue','SmsQueue','Trunk','voice:inbound','getVoiceQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','mail','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','emit','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove'];(function(_0x5f8000,_0x4a56b1){var _0xc8f261=function(_0x53e032){while(--_0x53e032){_0x5f8000['push'](_0x5f8000['shift']());}};_0xc8f261(++_0x4a56b1);}(_0x88f8,0xd4));var _0x888f=function(_0x1dd587,_0x9c184e){_0x1dd587=_0x1dd587-0x0;var _0x3b9da1=_0x88f8[_0x1dd587];return _0x3b9da1;};'use strict';var _=require('lodash');var util=require(_0x888f('0x0'));var BPromise=require('bluebird');var db=require(_0x888f('0x1'))['db'];var config=require(_0x888f('0x2'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x888f('0x3'),'model':db[_0x888f('0x4')],'attributes':['id',_0x888f('0x5'),_0x888f('0x6')],'raw':!![],'where':{'role':_0x888f('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x888f('0x5')],'where':{'role':_0x888f('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x888f('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x888f('0x5')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x888f('0x5'),_0x888f('0x9')],'where':{'type':_0x888f('0xa')}};function getAssociatedResources(_0x38d0d1,_0x2e5680,_0x45e3a8){return db[_0x888f('0xb')][_0x888f('0xc')]({'where':{'name':_0x38d0d1,'userProfileId':_0x2e5680},'raw':!![]})['then'](function(_0x4b0490){if(_0x4b0490){if(_0x4b0490[_0x888f('0xd')]){switch(_0x38d0d1){case'VoiceQueues':case _0x888f('0xe'):case _0x888f('0xf'):case _0x888f('0x10'):case _0x888f('0x11'):case _0x888f('0x12'):case _0x888f('0x13'):return db[_0x45e3a8][_0x888f('0x14')](queryQueues);case _0x888f('0x15'):return db[_0x45e3a8]['findAll'](queryTelephones);case _0x888f('0x16'):return db[_0x45e3a8][_0x888f('0x14')](queryTrunks);case _0x888f('0x17'):return db[_0x45e3a8][_0x888f('0x14')](queryCampaigns);}}else{return db[_0x888f('0x18')]['findAll']({'attributes':[_0x888f('0x19')],'where':{'sectionId':_0x4b0490['id']},'raw':!![]})['then'](function(_0x41c38e){if(_0x41c38e){var _0x44175e={'where':{'id':_[_0x888f('0x1a')](_0x41c38e,_0x888f('0x19'))},'raw':!![]};switch(_0x45e3a8){case'User':_0x44175e['where'][_0x888f('0x6')]=_0x888f('0x8');break;case _0x888f('0x1b'):_0x44175e[_0x888f('0x1c')][_0x888f('0x9')]=_0x888f('0xa');break;}return db[_0x45e3a8]['findAll'](_0x44175e);}else{return[];}});}}else{return[];}})[_0x888f('0x1d')](function(_0x462394){return _0x462394;});}function joinOrLeaveQueues(_0xf382fa,_0x1bbc22,_0x4d6ccd,_0x51dcb5){_0xf382fa[_0x1bbc22](util[_0x888f('0x1e')](_0x888f('0x1f'),_0x4d6ccd,_0x51dcb5[_0x888f('0x5')]));if(_0x51dcb5['Agents']){for(var _0x48f5b3=0x0;_0x48f5b3<_0x51dcb5[_0x888f('0x3')][_0x888f('0x20')];_0x48f5b3+=0x1){_0xf382fa[_0x1bbc22](util['format'](_0x888f('0x21'),_0x51dcb5[_0x888f('0x3')][_0x48f5b3][_0x888f('0x5')]));}}}function joinOrLeave(_0x5db255,_0x2629be,_0x5c71cd){var _0xff58a1;if(_0x5db255['handshake'][_0x888f('0x22')]['id']){db[_0x888f('0x4')][_0x888f('0x23')]({'attributes':['id','name',_0x888f('0x6'),'userProfileId'],'where':{'id':_0x5db255[_0x888f('0x24')][_0x888f('0x22')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x888f('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x888f('0x26')],'as':_0x888f('0x27'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x888f('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x888f('0x29')],'as':_0x888f('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x888f('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x888f('0x2c')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x888f('0x1d')](function(_0x379c04){if(_0x379c04){_0xff58a1=_0x379c04;_0x5db255[_0x2629be](util[_0x888f('0x1e')](_0x888f('0x21'),_0x379c04[_0x888f('0x5')]));var _0x8a9e8c=[];switch(_0x379c04[_0x888f('0x6')]){case _0x888f('0x2d'):_0x5db255[_0x2629be]('voice:inbound');_0x5db255[_0x2629be](_0x888f('0x2e'));if(queryQueues[_0x888f('0x2f')](_0x888f('0x30'))){delete queryQueues[_0x888f('0x30')];}_0x8a9e8c[_0x888f('0x31')](db[_0x888f('0x32')][_0x888f('0x14')](queryQueues));_0x8a9e8c[_0x888f('0x31')](db['ChatQueue'][_0x888f('0x14')](queryQueues));_0x8a9e8c[_0x888f('0x31')](db[_0x888f('0x33')]['findAll'](queryQueues));_0x8a9e8c[_0x888f('0x31')](db['SmsQueue']['findAll'](queryQueues));_0x8a9e8c[_0x888f('0x31')](db[_0x888f('0x34')][_0x888f('0x14')](queryQueues));_0x8a9e8c[_0x888f('0x31')](db[_0x888f('0x35')][_0x888f('0x14')](queryQueues));_0x8a9e8c[_0x888f('0x31')](db[_0x888f('0x36')][_0x888f('0x14')](queryQueues));_0x8a9e8c['push'](db[_0x888f('0x4')][_0x888f('0x14')](queryTelephones));_0x8a9e8c['push'](db['Trunk'][_0x888f('0x14')](queryTrunks));_0x8a9e8c[_0x888f('0x31')](db[_0x888f('0x1b')][_0x888f('0x14')](queryCampaigns));_0x8a9e8c['push'](db[_0x888f('0x4')]['findAll'](queryAgents));break;case _0x888f('0x37'):_0x5db255[_0x2629be]('voice:inbound');_0x5db255[_0x2629be](_0x888f('0x2e'));_0x8a9e8c[_0x888f('0x31')](getAssociatedResources(_0x888f('0x38'),_0x379c04[_0x888f('0x39')],_0x888f('0x32')));_0x8a9e8c[_0x888f('0x31')](getAssociatedResources(_0x888f('0xe'),_0x379c04[_0x888f('0x39')],_0x888f('0x3a')));_0x8a9e8c[_0x888f('0x31')](getAssociatedResources(_0x888f('0xf'),_0x379c04['userProfileId'],_0x888f('0x33')));_0x8a9e8c[_0x888f('0x31')](getAssociatedResources(_0x888f('0x10'),_0x379c04[_0x888f('0x39')],_0x888f('0x3b')));_0x8a9e8c[_0x888f('0x31')](getAssociatedResources(_0x888f('0x11'),_0x379c04[_0x888f('0x39')],_0x888f('0x34')));_0x8a9e8c[_0x888f('0x31')](getAssociatedResources('OpenchannelQueues',_0x379c04[_0x888f('0x39')],'OpenchannelQueue'));_0x8a9e8c[_0x888f('0x31')](getAssociatedResources(_0x888f('0x13'),_0x379c04[_0x888f('0x39')],'WhatsappQueue'));_0x8a9e8c[_0x888f('0x31')](getAssociatedResources(_0x888f('0x15'),_0x379c04[_0x888f('0x39')],_0x888f('0x4')));_0x8a9e8c[_0x888f('0x31')](getAssociatedResources('Trunks',_0x379c04[_0x888f('0x39')],_0x888f('0x3c')));_0x8a9e8c[_0x888f('0x31')](getAssociatedResources(_0x888f('0x17'),_0x379c04[_0x888f('0x39')],_0x888f('0x1b')));_0x8a9e8c[_0x888f('0x31')](db['User'][_0x888f('0x14')](queryAgents));break;case _0x888f('0x7'):_0x5db255[_0x2629be](_0x888f('0x3d'));_0x5db255[_0x2629be](_0x888f('0x2e'));_0x8a9e8c[_0x888f('0x31')](_0x379c04[_0x888f('0x3e')]({'attributes':['id',_0x888f('0x5')]}));_0x8a9e8c['push'](_0x379c04['getChatQueues']({'attributes':['id','name']}));_0x8a9e8c[_0x888f('0x31')](_0x379c04['getFaxQueues']({'attributes':['id',_0x888f('0x5')]}));_0x8a9e8c['push'](_0x379c04[_0x888f('0x3f')]({'attributes':['id',_0x888f('0x5')]}));_0x8a9e8c[_0x888f('0x31')](_0x379c04['getMailQueues']({'attributes':['id',_0x888f('0x5')]}));_0x8a9e8c[_0x888f('0x31')](_0x379c04[_0x888f('0x40')]({'attributes':['id',_0x888f('0x5')]}));_0x8a9e8c[_0x888f('0x31')](_0x379c04[_0x888f('0x41')]({'attributes':['id',_0x888f('0x5')]}));break;}return BPromise[_0x888f('0x42')](_0x8a9e8c);}})[_0x888f('0x1d')](function(_0x451ad0){if(_0x451ad0&&_0x451ad0[_0x888f('0x20')]){for(var _0x5086c7=0x0;_0x5086c7<_0x451ad0[_0x888f('0x20')];_0x5086c7+=0x1){for(var _0x599df8=0x0;_0x599df8<_0x451ad0[_0x5086c7][_0x888f('0x20')];_0x599df8+=0x1){switch(_0x5086c7){case 0x0:joinOrLeaveQueues(_0x5db255,_0x2629be,_0x888f('0x43'),_0x451ad0[_0x5086c7][_0x599df8]);break;case 0x1:joinOrLeaveQueues(_0x5db255,_0x2629be,_0x888f('0x44'),_0x451ad0[_0x5086c7][_0x599df8]);break;case 0x2:joinOrLeaveQueues(_0x5db255,_0x2629be,_0x888f('0x45'),_0x451ad0[_0x5086c7][_0x599df8]);break;case 0x3:joinOrLeaveQueues(_0x5db255,_0x2629be,'sms',_0x451ad0[_0x5086c7][_0x599df8]);break;case 0x4:joinOrLeaveQueues(_0x5db255,_0x2629be,_0x888f('0x46'),_0x451ad0[_0x5086c7][_0x599df8]);break;case 0x5:joinOrLeaveQueues(_0x5db255,_0x2629be,'openchannel',_0x451ad0[_0x5086c7][_0x599df8]);break;case 0x6:joinOrLeaveQueues(_0x5db255,_0x2629be,_0x888f('0x47'),_0x451ad0[_0x5086c7][_0x599df8]);break;case 0x7:if(_0xff58a1['role']!==_0x888f('0x7'))_0x5db255[_0x2629be](util[_0x888f('0x1e')](_0x888f('0x48'),_0x451ad0[_0x5086c7][_0x599df8][_0x888f('0x5')]));break;case 0x8:if(_0xff58a1[_0x888f('0x6')]!==_0x888f('0x7'))_0x5db255[_0x2629be](util[_0x888f('0x1e')](_0x888f('0x49'),_0x451ad0[_0x5086c7][_0x599df8][_0x888f('0x5')]));break;case 0x9:if(_0xff58a1['role']!=='agent')_0x5db255[_0x2629be](util[_0x888f('0x1e')](_0x888f('0x4a'),_0x451ad0[_0x5086c7][_0x599df8][_0x888f('0x9')],_0x451ad0[_0x5086c7][_0x599df8]['name']));break;case 0xa:_0x5db255[_0x2629be](util[_0x888f('0x1e')](_0x888f('0x21'),_0x451ad0[_0x5086c7][_0x599df8][_0x888f('0x5')]));break;}}}}})[_0x888f('0x1d')](function(){if(_0x2629be===_0x888f('0x4b')){var _0x207a97=_['map'](_0xff58a1[_0x888f('0x25')],'id');return _0xff58a1[_0x888f('0x4c')](_0x207a97)['then'](function(){for(var _0x11b3f6=0x0;_0x11b3f6<_0x207a97[_0x888f('0x20')];_0x11b3f6+=0x1){_0x5c71cd['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x207a97[_0x11b3f6]),'UserId':Number(_0xff58a1['id'])});}});}})[_0x888f('0x1d')](function(){if(_0x2629be==='leave'){var _0x3ec4a4=_[_0x888f('0x1a')](_0xff58a1['MailInteractions'],'id');return _0xff58a1[_0x888f('0x4d')](_0x3ec4a4)[_0x888f('0x1d')](function(){for(var _0x54f18a=0x0;_0x54f18a<_0x3ec4a4[_0x888f('0x20')];_0x54f18a+=0x1){_0x5c71cd['emit'](_0x888f('0x4e'),{'MailInteractionId':Number(_0x3ec4a4[_0x54f18a]),'UserId':Number(_0xff58a1['id'])});}});}})[_0x888f('0x1d')](function(){if(_0x2629be===_0x888f('0x4b')){var _0x3051c2=_[_0x888f('0x1a')](_0xff58a1[_0x888f('0x28')],'id');return _0xff58a1[_0x888f('0x4f')](_0x3051c2)[_0x888f('0x1d')](function(){for(var _0x3f1d0c=0x0;_0x3f1d0c<_0x3051c2['length'];_0x3f1d0c+=0x1){_0x5c71cd[_0x888f('0x50')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x3051c2[_0x3f1d0c]),'UserId':Number(_0xff58a1['id'])});}});}})[_0x888f('0x1d')](function(){if(_0x2629be===_0x888f('0x4b')){var _0x1ad773=_['map'](_0xff58a1[_0x888f('0x2a')],'id');return _0xff58a1[_0x888f('0x51')](_0x1ad773)[_0x888f('0x1d')](function(){for(var _0x444099=0x0;_0x444099<_0x1ad773['length'];_0x444099+=0x1){_0x5c71cd[_0x888f('0x50')](_0x888f('0x52'),{'SmsInteractionId':Number(_0x1ad773[_0x444099]),'UserId':Number(_0xff58a1['id'])});}});}})[_0x888f('0x1d')](function(){if(_0x2629be===_0x888f('0x4b')){var _0x691cb7=_[_0x888f('0x1a')](_0xff58a1[_0x888f('0x2b')],'id');return _0xff58a1[_0x888f('0x53')](_0x691cb7)[_0x888f('0x1d')](function(){for(var _0x441492=0x0;_0x441492<_0x691cb7[_0x888f('0x20')];_0x441492+=0x1){_0x5c71cd[_0x888f('0x50')](_0x888f('0x54'),{'OpenchannelInteractionId':Number(_0x691cb7[_0x441492]),'UserId':Number(_0xff58a1['id'])});}});}})['then'](function(){if(_0x2629be===_0x888f('0x4b')){var _0x8bd7ef=_[_0x888f('0x1a')](_0xff58a1[_0x888f('0x55')],'id');return _0xff58a1['removeWhatsappInteractions'](_0x8bd7ef)['then'](function(){for(var _0x570458=0x0;_0x570458<_0x8bd7ef['length'];_0x570458+=0x1){_0x5c71cd['emit'](_0x888f('0x56'),{'WhatsappInteractionId':Number(_0x8bd7ef[_0x570458]),'UserId':Number(_0xff58a1['id'])});}});}})[_0x888f('0x57')](function(_0x1eac92){_0x5db255[_0x888f('0x58')](_0x1eac92);});}}function onDisconnect(_0x335ea1,_0x34ea4f){joinOrLeave(_0x335ea1,_0x888f('0x4b'),_0x34ea4f);}function onConnect(_0x24d770){joinOrLeave(_0x24d770,'join');}exports[_0x888f('0x59')]=function(_0x300db9){_0x300db9['on'](_0x888f('0x5a'),function(_0x1595c8){_0x1595c8['setMaxListeners'](0x0);_0x1595c8[_0x888f('0x5b')]=_0x1595c8[_0x888f('0x5c')][_0x888f('0x5a')]['remoteAddress']+':'+_0x1595c8[_0x888f('0x5c')]['connection'][_0x888f('0x5d')];_0x1595c8[_0x888f('0x5e')]=new Date();_0x1595c8[_0x888f('0x58')]=function(_0x37b8e0){console['log'](_0x888f('0x5f')+_0x1595c8[_0x888f('0x60')][_0x888f('0x5')]+'['+_0x1595c8[_0x888f('0x5b')]+']',_0x37b8e0);};_0x1595c8['on'](_0x888f('0x61'),function(){onDisconnect(_0x1595c8,_0x300db9);_0x1595c8[_0x888f('0x58')]('DISCONNECTED');});onConnect(_0x1595c8);_0x1595c8[_0x888f('0x58')](_0x888f('0x62'));});}; \ No newline at end of file +var _0x2687=['OpenchannelQueue','WhatsappQueue','Trunks','IvrCampaigns','agent','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','voice','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','leave','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','log','join','default','connection','remoteAddress','request','remotePort','connectedAt','SocketIO\x20','nsp','address','disconnect','DISCONNECTED','CONNECTED','lodash','util','../mysqldb','./environment','name','User','role','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','UserProfileResource','resourceId','map','where','format','%s:queue:%s','Agents','length','user:%s','find','userProfileId','handshake','query','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','MailQueue','Trunk','user','VoiceQueue','FaxQueue','SmsQueue'];(function(_0x432d66,_0x283ad9){var _0x64f753=function(_0x5579d5){while(--_0x5579d5){_0x432d66['push'](_0x432d66['shift']());}};_0x64f753(++_0x283ad9);}(_0x2687,0x8f));var _0x7268=function(_0x4173f3,_0x41904c){_0x4173f3=_0x4173f3-0x0;var _0x2431a0=_0x2687[_0x4173f3];return _0x2431a0;};'use strict';var _=require(_0x7268('0x0'));var util=require(_0x7268('0x1'));var BPromise=require('bluebird');var db=require(_0x7268('0x2'))['db'];var config=require(_0x7268('0x3'));var queryQueues={'attributes':['id',_0x7268('0x4')],'include':[{'as':'Agents','model':db[_0x7268('0x5')],'attributes':['id',_0x7268('0x4'),_0x7268('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x7268('0x4')],'where':{'role':_0x7268('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7268('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x7268('0x4'),_0x7268('0x8')],'where':{'type':_0x7268('0x9')}};function getAssociatedResources(_0x3b25f8,_0x32885e,_0x116b3f){return db[_0x7268('0xa')][_0x7268('0xb')]({'where':{'name':_0x3b25f8,'userProfileId':_0x32885e},'raw':!![]})[_0x7268('0xc')](function(_0x211f25){if(_0x211f25){if(_0x211f25[_0x7268('0xd')]){switch(_0x3b25f8){case _0x7268('0xe'):case _0x7268('0xf'):case _0x7268('0x10'):case'SmsQueues':case _0x7268('0x11'):case _0x7268('0x12'):case _0x7268('0x13'):return db[_0x116b3f][_0x7268('0x14')](queryQueues);case _0x7268('0x15'):return db[_0x116b3f][_0x7268('0x14')](queryTelephones);case'Trunks':return db[_0x116b3f]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x116b3f][_0x7268('0x14')](queryCampaigns);}}else{return db[_0x7268('0x16')][_0x7268('0x14')]({'attributes':[_0x7268('0x17')],'where':{'sectionId':_0x211f25['id']},'raw':!![]})[_0x7268('0xc')](function(_0x64a51){if(_0x64a51){var _0x8abe85={'where':{'id':_[_0x7268('0x18')](_0x64a51,'resourceId')},'raw':!![]};switch(_0x116b3f){case _0x7268('0x5'):_0x8abe85['where'][_0x7268('0x6')]=_0x7268('0x7');break;case'Campaign':_0x8abe85[_0x7268('0x19')][_0x7268('0x8')]='ivr';break;}return db[_0x116b3f][_0x7268('0x14')](_0x8abe85);}else{return[];}});}}else{return[];}})['then'](function(_0x2c3cfe){return _0x2c3cfe;});}function joinOrLeaveQueues(_0x6cd42b,_0x56bac6,_0x1e9d2c,_0x4dd54a){_0x6cd42b[_0x56bac6](util[_0x7268('0x1a')](_0x7268('0x1b'),_0x1e9d2c,_0x4dd54a[_0x7268('0x4')]));if(_0x4dd54a[_0x7268('0x1c')]){for(var _0x49b390=0x0;_0x49b390<_0x4dd54a[_0x7268('0x1c')][_0x7268('0x1d')];_0x49b390+=0x1){_0x6cd42b[_0x56bac6](util[_0x7268('0x1a')](_0x7268('0x1e'),_0x4dd54a[_0x7268('0x1c')][_0x49b390][_0x7268('0x4')]));}}}function joinOrLeave(_0x5ade09,_0x3e551d,_0x3abb49){var _0x4d820b;if(_0x5ade09['handshake']['query']['id']){db[_0x7268('0x5')][_0x7268('0x1f')]({'attributes':['id',_0x7268('0x4'),_0x7268('0x6'),_0x7268('0x20')],'where':{'id':_0x5ade09[_0x7268('0x21')][_0x7268('0x22')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x7268('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x7268('0x24')],'as':_0x7268('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x7268('0x26')],'as':_0x7268('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x7268('0x28')],'as':_0x7268('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x7268('0x2a')],'as':_0x7268('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x7268('0x2c')],'as':_0x7268('0x2d'),'attributes':['id'],'raw':!![]}]})[_0x7268('0xc')](function(_0x159adb){if(_0x159adb){_0x4d820b=_0x159adb;_0x5ade09[_0x3e551d](util[_0x7268('0x1a')](_0x7268('0x1e'),_0x159adb[_0x7268('0x4')]));var _0x216f8b=[];switch(_0x159adb[_0x7268('0x6')]){case _0x7268('0x2e'):_0x5ade09[_0x3e551d](_0x7268('0x2f'));_0x5ade09[_0x3e551d](_0x7268('0x30'));if(queryQueues[_0x7268('0x31')](_0x7268('0x32'))){delete queryQueues[_0x7268('0x32')];}_0x216f8b['push'](db['VoiceQueue']['findAll'](queryQueues));_0x216f8b[_0x7268('0x33')](db[_0x7268('0x34')][_0x7268('0x14')](queryQueues));_0x216f8b[_0x7268('0x33')](db['FaxQueue']['findAll'](queryQueues));_0x216f8b[_0x7268('0x33')](db['SmsQueue'][_0x7268('0x14')](queryQueues));_0x216f8b['push'](db[_0x7268('0x35')]['findAll'](queryQueues));_0x216f8b[_0x7268('0x33')](db['OpenchannelQueue'][_0x7268('0x14')](queryQueues));_0x216f8b[_0x7268('0x33')](db['WhatsappQueue'][_0x7268('0x14')](queryQueues));_0x216f8b[_0x7268('0x33')](db[_0x7268('0x5')]['findAll'](queryTelephones));_0x216f8b[_0x7268('0x33')](db[_0x7268('0x36')][_0x7268('0x14')](queryTrunks));_0x216f8b['push'](db['Campaign'][_0x7268('0x14')](queryCampaigns));_0x216f8b['push'](db[_0x7268('0x5')][_0x7268('0x14')](queryAgents));break;case _0x7268('0x37'):_0x5ade09[_0x3e551d]('voice:inbound');_0x5ade09[_0x3e551d](_0x7268('0x30'));_0x216f8b[_0x7268('0x33')](getAssociatedResources(_0x7268('0xe'),_0x159adb['userProfileId'],_0x7268('0x38')));_0x216f8b[_0x7268('0x33')](getAssociatedResources(_0x7268('0xf'),_0x159adb['userProfileId'],_0x7268('0x34')));_0x216f8b['push'](getAssociatedResources(_0x7268('0x10'),_0x159adb[_0x7268('0x20')],_0x7268('0x39')));_0x216f8b[_0x7268('0x33')](getAssociatedResources('SmsQueues',_0x159adb[_0x7268('0x20')],_0x7268('0x3a')));_0x216f8b[_0x7268('0x33')](getAssociatedResources(_0x7268('0x11'),_0x159adb['userProfileId'],_0x7268('0x35')));_0x216f8b['push'](getAssociatedResources(_0x7268('0x12'),_0x159adb[_0x7268('0x20')],_0x7268('0x3b')));_0x216f8b[_0x7268('0x33')](getAssociatedResources(_0x7268('0x13'),_0x159adb[_0x7268('0x20')],_0x7268('0x3c')));_0x216f8b[_0x7268('0x33')](getAssociatedResources('Telephones',_0x159adb[_0x7268('0x20')],_0x7268('0x5')));_0x216f8b[_0x7268('0x33')](getAssociatedResources(_0x7268('0x3d'),_0x159adb['userProfileId'],_0x7268('0x36')));_0x216f8b[_0x7268('0x33')](getAssociatedResources(_0x7268('0x3e'),_0x159adb['userProfileId'],'Campaign'));_0x216f8b[_0x7268('0x33')](db[_0x7268('0x5')][_0x7268('0x14')](queryAgents));break;case _0x7268('0x3f'):_0x5ade09[_0x3e551d]('voice:inbound');_0x5ade09[_0x3e551d](_0x7268('0x30'));_0x216f8b[_0x7268('0x33')](_0x159adb[_0x7268('0x40')]({'attributes':['id',_0x7268('0x4')]}));_0x216f8b['push'](_0x159adb['getChatQueues']({'attributes':['id',_0x7268('0x4')]}));_0x216f8b['push'](_0x159adb[_0x7268('0x41')]({'attributes':['id',_0x7268('0x4')]}));_0x216f8b[_0x7268('0x33')](_0x159adb[_0x7268('0x42')]({'attributes':['id',_0x7268('0x4')]}));_0x216f8b[_0x7268('0x33')](_0x159adb[_0x7268('0x43')]({'attributes':['id',_0x7268('0x4')]}));_0x216f8b['push'](_0x159adb['getOpenchannelQueues']({'attributes':['id','name']}));_0x216f8b[_0x7268('0x33')](_0x159adb[_0x7268('0x44')]({'attributes':['id',_0x7268('0x4')]}));break;}return BPromise['all'](_0x216f8b);}})['then'](function(_0x518a2e){if(_0x518a2e&&_0x518a2e['length']){for(var _0x26d77d=0x0;_0x26d77d<_0x518a2e[_0x7268('0x1d')];_0x26d77d+=0x1){for(var _0x1e4a39=0x0;_0x1e4a39<_0x518a2e[_0x26d77d][_0x7268('0x1d')];_0x1e4a39+=0x1){switch(_0x26d77d){case 0x0:joinOrLeaveQueues(_0x5ade09,_0x3e551d,_0x7268('0x45'),_0x518a2e[_0x26d77d][_0x1e4a39]);break;case 0x1:joinOrLeaveQueues(_0x5ade09,_0x3e551d,'chat',_0x518a2e[_0x26d77d][_0x1e4a39]);break;case 0x2:joinOrLeaveQueues(_0x5ade09,_0x3e551d,_0x7268('0x46'),_0x518a2e[_0x26d77d][_0x1e4a39]);break;case 0x3:joinOrLeaveQueues(_0x5ade09,_0x3e551d,_0x7268('0x47'),_0x518a2e[_0x26d77d][_0x1e4a39]);break;case 0x4:joinOrLeaveQueues(_0x5ade09,_0x3e551d,_0x7268('0x48'),_0x518a2e[_0x26d77d][_0x1e4a39]);break;case 0x5:joinOrLeaveQueues(_0x5ade09,_0x3e551d,_0x7268('0x49'),_0x518a2e[_0x26d77d][_0x1e4a39]);break;case 0x6:joinOrLeaveQueues(_0x5ade09,_0x3e551d,_0x7268('0x4a'),_0x518a2e[_0x26d77d][_0x1e4a39]);break;case 0x7:if(_0x4d820b[_0x7268('0x6')]!=='agent')_0x5ade09[_0x3e551d](util[_0x7268('0x1a')](_0x7268('0x4b'),_0x518a2e[_0x26d77d][_0x1e4a39][_0x7268('0x4')]));break;case 0x8:if(_0x4d820b[_0x7268('0x6')]!=='agent')_0x5ade09[_0x3e551d](util[_0x7268('0x1a')]('trunk:%s',_0x518a2e[_0x26d77d][_0x1e4a39][_0x7268('0x4')]));break;case 0x9:if(_0x4d820b[_0x7268('0x6')]!=='agent')_0x5ade09[_0x3e551d](util[_0x7268('0x1a')](_0x7268('0x4c'),_0x518a2e[_0x26d77d][_0x1e4a39][_0x7268('0x8')],_0x518a2e[_0x26d77d][_0x1e4a39][_0x7268('0x4')]));break;case 0xa:_0x5ade09[_0x3e551d](util['format']('user:%s',_0x518a2e[_0x26d77d][_0x1e4a39][_0x7268('0x4')]));break;}}}}})[_0x7268('0xc')](function(){if(_0x3e551d==='leave'){var _0x554db5=_[_0x7268('0x18')](_0x4d820b[_0x7268('0x23')],'id');return _0x4d820b[_0x7268('0x4d')](_0x554db5)[_0x7268('0xc')](function(){for(var _0x24a8d3=0x0;_0x24a8d3<_0x554db5['length'];_0x24a8d3+=0x1){_0x3abb49[_0x7268('0x4e')](_0x7268('0x4f'),{'ChatInteractionId':Number(_0x554db5[_0x24a8d3]),'UserId':Number(_0x4d820b['id'])});}});}})[_0x7268('0xc')](function(){if(_0x3e551d==='leave'){var _0x35072f=_[_0x7268('0x18')](_0x4d820b['MailInteractions'],'id');return _0x4d820b['removeMailInteractions'](_0x35072f)[_0x7268('0xc')](function(){for(var _0x28a39f=0x0;_0x28a39f<_0x35072f[_0x7268('0x1d')];_0x28a39f+=0x1){_0x3abb49[_0x7268('0x4e')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x35072f[_0x28a39f]),'UserId':Number(_0x4d820b['id'])});}});}})['then'](function(){if(_0x3e551d==='leave'){var _0x4a9905=_[_0x7268('0x18')](_0x4d820b[_0x7268('0x27')],'id');return _0x4d820b[_0x7268('0x50')](_0x4a9905)[_0x7268('0xc')](function(){for(var _0x259e2f=0x0;_0x259e2f<_0x4a9905['length'];_0x259e2f+=0x1){_0x3abb49['emit'](_0x7268('0x51'),{'FaxInteractionId':Number(_0x4a9905[_0x259e2f]),'UserId':Number(_0x4d820b['id'])});}});}})[_0x7268('0xc')](function(){if(_0x3e551d===_0x7268('0x52')){var _0xdc6a57=_[_0x7268('0x18')](_0x4d820b['SmsInteractions'],'id');return _0x4d820b[_0x7268('0x53')](_0xdc6a57)['then'](function(){for(var _0x421a32=0x0;_0x421a32<_0xdc6a57[_0x7268('0x1d')];_0x421a32+=0x1){_0x3abb49['emit'](_0x7268('0x54'),{'SmsInteractionId':Number(_0xdc6a57[_0x421a32]),'UserId':Number(_0x4d820b['id'])});}});}})[_0x7268('0xc')](function(){if(_0x3e551d==='leave'){var _0x3b0049=_[_0x7268('0x18')](_0x4d820b[_0x7268('0x2b')],'id');return _0x4d820b['removeOpenchannelInteractions'](_0x3b0049)[_0x7268('0xc')](function(){for(var _0x4d7277=0x0;_0x4d7277<_0x3b0049['length'];_0x4d7277+=0x1){_0x3abb49['emit'](_0x7268('0x55'),{'OpenchannelInteractionId':Number(_0x3b0049[_0x4d7277]),'UserId':Number(_0x4d820b['id'])});}});}})[_0x7268('0xc')](function(){if(_0x3e551d===_0x7268('0x52')){var _0x494c04=_[_0x7268('0x18')](_0x4d820b['WhatsappInteractions'],'id');return _0x4d820b[_0x7268('0x56')](_0x494c04)['then'](function(){for(var _0x50af71=0x0;_0x50af71<_0x494c04[_0x7268('0x1d')];_0x50af71+=0x1){_0x3abb49[_0x7268('0x4e')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x494c04[_0x50af71]),'UserId':Number(_0x4d820b['id'])});}});}})['catch'](function(_0x2efb27){_0x5ade09[_0x7268('0x57')](_0x2efb27);});}}function onDisconnect(_0x37c95a,_0x2f24bb){joinOrLeave(_0x37c95a,_0x7268('0x52'),_0x2f24bb);}function onConnect(_0x449969){joinOrLeave(_0x449969,_0x7268('0x58'));}exports[_0x7268('0x59')]=function(_0x269002){_0x269002['on'](_0x7268('0x5a'),function(_0x120af0){_0x120af0['setMaxListeners'](0x0);_0x120af0['address']=_0x120af0['request']['connection'][_0x7268('0x5b')]+':'+_0x120af0[_0x7268('0x5c')]['connection'][_0x7268('0x5d')];_0x120af0[_0x7268('0x5e')]=new Date();_0x120af0[_0x7268('0x57')]=function(_0x4d4167){console[_0x7268('0x57')](_0x7268('0x5f')+_0x120af0[_0x7268('0x60')][_0x7268('0x4')]+'['+_0x120af0[_0x7268('0x61')]+']',_0x4d4167);};_0x120af0['on'](_0x7268('0x62'),function(){onDisconnect(_0x120af0,_0x269002);_0x120af0[_0x7268('0x57')](_0x7268('0x63'));});onConnect(_0x120af0);_0x120af0[_0x7268('0x57')](_0x7268('0x64'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 1a03dc7..168bb17 100644 --- a/server/config/triggers/index.js +++ b/server/config/triggers/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeaeb=['then','info','Trigger,\x20%s','code','error','catch','get','channel','motionChannel','event','direction','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','Sequelize','SELECT','contact','interface','format','SIP/%s','name','agent','incomingmessage','AfterCreateMessage','offlineMessage','opened','UserId','AfterCreate','changed','substatus','sequelize','QueryTypes','User','fullname','email','hasOwnProperty','model','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','newmessage','ChatOfflineMessage','Sms','SmsInteraction','SmsMessage','Whatsapp','closedinteraction','WhatsappMessage','FaxInteraction','Fax','FaxMessage','MailInteraction','Mail','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager'];(function(_0x3861f7,_0x995b22){var _0x50879f=function(_0x3003f1){while(--_0x3003f1){_0x3861f7['push'](_0x3861f7['shift']());}};_0x50879f(++_0x995b22);}(_0xeaeb,0xb5));var _0xbeae=function(_0x115f82,_0x4ebe3){_0x115f82=_0x115f82-0x0;var _0x52cabb=_0xeaeb[_0x115f82];return _0x52cabb;};'use strict';var util=require(_0xbeae('0x0'));var db=require(_0xbeae('0x1'))['db'];var jayson=require(_0xbeae('0x2'));var logger=require(_0xbeae('0x3'))('triggers');var client=jayson[_0xbeae('0x4')][_0xbeae('0x5')]({'port':0x232a});var triggers=[{'channel':_0xbeae('0x6'),'model':_0xbeae('0x7'),'event':_0xbeae('0x8'),'condition':_0xbeae('0x9'),'callback':afterCreate},{'channel':'Chat','model':_0xbeae('0x7'),'event':_0xbeae('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xbeae('0x6'),'model':'ChatMessage','event':_0xbeae('0x8'),'condition':_0xbeae('0xb'),'callback':afterCreateMessage},{'channel':_0xbeae('0x6'),'model':_0xbeae('0xc'),'event':_0xbeae('0x8'),'condition':_0xbeae('0xb'),'callback':afterCreateOfflineMessage},{'channel':_0xbeae('0xd'),'model':'SmsInteraction','event':'afterCreate','condition':_0xbeae('0x9'),'callback':afterCreate},{'channel':_0xbeae('0xd'),'model':_0xbeae('0xe'),'event':_0xbeae('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xbeae('0xd'),'model':_0xbeae('0xf'),'event':_0xbeae('0x8'),'condition':_0xbeae('0xb'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':'WhatsappInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xbeae('0x10'),'model':'WhatsappInteraction','event':_0xbeae('0xa'),'condition':_0xbeae('0x11'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0xbeae('0x12'),'event':'afterCreate','condition':_0xbeae('0xb'),'callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':_0xbeae('0x8'),'condition':_0xbeae('0x9'),'callback':afterCreate},{'channel':'Fax','model':_0xbeae('0x13'),'event':'afterUpdate','condition':_0xbeae('0x11'),'callback':afterUpdate},{'channel':_0xbeae('0x14'),'model':_0xbeae('0x15'),'event':_0xbeae('0x8'),'condition':_0xbeae('0xb'),'callback':afterCreateMessage},{'channel':'Mail','model':_0xbeae('0x16'),'event':_0xbeae('0x8'),'condition':_0xbeae('0x9'),'callback':afterCreate},{'channel':_0xbeae('0x17'),'model':_0xbeae('0x16'),'event':_0xbeae('0xa'),'condition':_0xbeae('0x11'),'callback':afterUpdate},{'channel':_0xbeae('0x17'),'model':'MailMessage','event':_0xbeae('0x8'),'condition':_0xbeae('0xb'),'callback':afterCreateMessage},{'channel':_0xbeae('0x18'),'model':_0xbeae('0x19'),'event':_0xbeae('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':'Openchannel','model':'OpenchannelInteraction','event':_0xbeae('0xa'),'condition':_0xbeae('0x11'),'callback':afterUpdate},{'channel':'Openchannel','model':_0xbeae('0x1a'),'event':_0xbeae('0x8'),'condition':_0xbeae('0xb'),'callback':afterCreateMessage}];function request(_0x2dedb6){return client[_0xbeae('0x1b')](_0xbeae('0x1c'),_0x2dedb6)[_0xbeae('0x1d')](function(_0x189a7f){logger[_0xbeae('0x1e')](_0xbeae('0x1f'),'EventManager',_0x189a7f);if(_0x189a7f['error']){if(_0x189a7f['error'][_0xbeae('0x20')]===0x1f4){logger['error'](_0xbeae('0x1f'),_0xbeae('0x1c'),_0x189a7f[_0xbeae('0x21')]);}}})[_0xbeae('0x22')](function(_0xf02de4){logger[_0xbeae('0x21')](_0xbeae('0x1f'),_0xbeae('0x1c'),_0xf02de4);});}function afterCreateMessage(_0x1212da){return function(_0x444447){_0x444447=_0x444447[_0xbeae('0x23')]({'plain':!![]});_0x444447[_0xbeae('0x24')]=_0x1212da;_0x444447[_0xbeae('0x25')]=_0x1212da;_0x444447[_0xbeae('0x26')]=_0x444447[_0xbeae('0x27')];Promise['resolve']()[_0xbeae('0x1d')](function(){if(typeof _0x444447[_0xbeae('0x28')]===_0xbeae('0x29'))return null;var _0x449abe=_0xbeae('0x2a')+_0x444447[_0xbeae('0x28')];return db['sequelize'][_0xbeae('0x2b')](_0x449abe,{'type':db[_0xbeae('0x2c')]['QueryTypes'][_0xbeae('0x2d')],'raw':!![]});})['then'](function(_0x2a5209){if(_0x2a5209){_0x444447[_0xbeae('0x2e')]=_0x2a5209[0x0];}if(typeof _0x444447['UserId']===_0xbeae('0x29'))return;return getAgent(_0x444447['UserId']);})['then'](function(_0x15b99d){if(_0x15b99d){_0x444447[_0xbeae('0x2f')]=util[_0xbeae('0x30')](_0xbeae('0x31'),_0x15b99d[_0xbeae('0x32')]);_0x444447[_0xbeae('0x33')]=_0x15b99d;_0x444447[_0xbeae('0x24')]=_0x1212da;return request({'event':_0xbeae('0x34'),'message':_0x444447});}else{return request({'event':'outgoingmessage','message':_0x444447});}})[_0xbeae('0x22')](function(_0x442903){logger[_0xbeae('0x21')](_0xbeae('0x1f'),_0xbeae('0x35'),_0x442903);});};}function afterCreateOfflineMessage(_0x4b394b){return function(_0x549a19){_0x549a19=_0x549a19[_0xbeae('0x23')]({'plain':!![]});_0x549a19[_0xbeae('0x24')]=_0x4b394b;_0x549a19[_0xbeae('0x25')]=_0x4b394b;_0x549a19[_0xbeae('0x26')]=_0xbeae('0x36');return request({'event':_0x549a19['event'],'message':_0x549a19});};}function afterCreate(_0x4cc096,_0x148204){return function(_0x344487){_0x344487=_0x344487['get']({'plain':!![]});_0x344487['channel']=_0x4cc096;_0x344487[_0xbeae('0x25')]=_0x4cc096;_0x344487['event']=_0xbeae('0x37');Promise['resolve']()[_0xbeae('0x1d')](function(){var _0x176d0e=_0xbeae('0x2a')+_0x344487['ContactId'];return db['sequelize'][_0xbeae('0x2b')](_0x176d0e,{'type':db[_0xbeae('0x2c')]['QueryTypes']['SELECT'],'raw':!![]});})[_0xbeae('0x1d')](function(_0x306961){if(_0x306961){_0x344487[_0xbeae('0x2e')]=_0x306961[0x0];}if(typeof _0x344487[_0xbeae('0x38')]===_0xbeae('0x29'))return;return getAgent(_0x344487[_0xbeae('0x38')]);})[_0xbeae('0x1d')](function(_0x4489e4){if(_0x4489e4){_0x344487['interface']=util['format']('SIP/%s',_0x4489e4[_0xbeae('0x32')]);_0x344487[_0xbeae('0x33')]=_0x4489e4;}return request({'event':_0x148204,'message':_0x344487});})[_0xbeae('0x22')](function(_0x469093){logger[_0xbeae('0x21')]('Trigger,\x20%s',_0xbeae('0x39'),_0x469093);});};}function afterUpdate(_0x3b29e1){return function(_0x11f7b7){var _0x4ce59f=_0x11f7b7[_0xbeae('0x3a')]('closed')&&_0x11f7b7['closed'];var _0x4dd5b2=_0x11f7b7[_0xbeae('0x3a')](_0xbeae('0x3b'));if(_0x4ce59f||_0x4dd5b2){var _0x14c4cb=_0x4ce59f?'closedinteraction':_0xbeae('0x3b');var _0xb94126=_0x11f7b7[_0xbeae('0x23')]({'plain':!![]});_0xb94126[_0xbeae('0x24')]=_0x3b29e1;_0xb94126['motionChannel']=_0x3b29e1;_0xb94126[_0xbeae('0x26')]=_0x4ce59f?'closed':'substatus';var _0x2e63a9=_0xbeae('0x2a')+_0xb94126[_0xbeae('0x28')];return db[_0xbeae('0x3c')]['query'](_0x2e63a9,{'type':db[_0xbeae('0x2c')][_0xbeae('0x3d')][_0xbeae('0x2d')],'raw':!![]})[_0xbeae('0x1d')](function(_0x3a75a5){if(_0x3a75a5){_0xb94126[_0xbeae('0x2e')]=_0x3a75a5[0x0];}if(typeof _0xb94126[_0xbeae('0x38')]===_0xbeae('0x29'))return;return getAgent(_0xb94126[_0xbeae('0x38')]);})[_0xbeae('0x1d')](function(_0x4d05f2){if(_0x4d05f2){_0xb94126[_0xbeae('0x2f')]=util['format']('SIP/%s',_0x4d05f2['name']);_0xb94126[_0xbeae('0x33')]=_0x4d05f2;}return request({'event':_0x14c4cb,'message':_0xb94126});})['catch'](function(_0x4fe827){logger[_0xbeae('0x21')](_0xbeae('0x1f'),'AfterUpdate',_0x4fe827);});}};}function getAgent(_0x3671d2){return db[_0xbeae('0x3e')]['find']({'where':{'id':_0x3671d2},'attributes':['id','name',_0xbeae('0x3f'),_0xbeae('0x40'),'internal'],'raw':!![]})['then'](function(_0x200f84){return _0x200f84;});}exports['default']=function(){for(var _0x21275d=0x0;_0x21275d=_0x573f49[_0x4b39('0x14')]){throw Error(_0x4b39('0x15'));}_0x1ade4c(_0x1d5dd9);})[_0x4b39('0x16')](function(_0x24bf7b){_0x168036(_0x24bf7b);});});}; \ No newline at end of file +var _0x562c=['then','agents','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','fax','whatsapp','openchannel','isValidChannel','includes','clearBlockUser','blockedAt','updateAttributes','getLicense','role','agent','count'];(function(_0x5036a7,_0x210fbd){var _0x2dddb5=function(_0xe61eb){while(--_0xe61eb){_0x5036a7['push'](_0x5036a7['shift']());}};_0x2dddb5(++_0x210fbd);}(_0x562c,0xaa));var _0xc562=function(_0x1bb386,_0xc04584){_0x1bb386=_0x1bb386-0x0;var _0x15414e=_0x562c[_0x1bb386];return _0x15414e;};'use strict';var _=require(_0xc562('0x0'));var BPromise=require(_0xc562('0x1'));var db=require(_0xc562('0x2'))['db'];var util=require(_0xc562('0x3'));var channels=[_0xc562('0x4'),_0xc562('0x5'),_0xc562('0x6'),_0xc562('0x7'),'sms',_0xc562('0x8'),_0xc562('0x9')];exports['getChannels']=function(){return channels;};exports[_0xc562('0xa')]=function(_0x5d9543){_0x5d9543=_0x5d9543['toLowerCase']();return _[_0xc562('0xb')](channels,_0x5d9543);};exports[_0xc562('0xc')]=function(_0x3353b4,_0x1e0d6d,_0x4f78a1,_0x3f7e7f){var _0x415f5e={'loginAttempts':_0x1e0d6d,'blocked':_0x4f78a1};if(!_['isUndefined'](_0x3f7e7f)){_0x415f5e[_0xc562('0xd')]=_0x3f7e7f;}return _0x3353b4[_0xc562('0xe')](_0x415f5e);};exports[_0xc562('0xf')]=function(_0x121a7b){return new BPromise(function(_0x230f45,_0x27be35){var _0x18bcdd=0x0;if(_0x121a7b[_0xc562('0x10')]!==_0xc562('0x11')){_0x230f45(_0x121a7b);}db['User'][_0xc562('0x12')]({'where':{'role':_0xc562('0x11'),'online':!![],'id':{'$ne':_0x121a7b['id']}}})[_0xc562('0x13')](function(_0x594f73){_0x18bcdd=_0x594f73;return util['getLicense']();})['then'](function(_0x54b52f){if(_0x54b52f&&_0x54b52f[_0xc562('0x14')]&&_0x18bcdd>=_0x54b52f['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x230f45(_0x121a7b);})['catch'](function(_0x2e040f){_0x27be35(_0x2e040f);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 511fff7..afb9ca0 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf0b0=['Message\x20sent\x20outside\x20a\x20valid\x20interval','code','details','OutOfInterval','Resource\x20Conflict','Conflict','Out\x20Of\x20Interval','error','stack','statusMessage','send','exports','../config/logger','message','name','Error','inherits','Bad\x20Request','Forbidden','Entity\x20not\x20found','Not\x20Found'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf0b0,0x108));var _0x0f0b=function(_0x1e6622,_0x102bc4){_0x1e6622=_0x1e6622-0x0;var _0x20c415=_0xf0b0[_0x1e6622];return _0x20c415;};'use strict';var util=require('util');var logger=require(_0x0f0b('0x0'))('api');var APIError=function(_0x48ff97,_0x4a6e57){this[_0x0f0b('0x1')]=_0x48ff97||'Internal\x20Server\x20Error';this[_0x0f0b('0x2')]=_0x4a6e57||_0x0f0b('0x3');util[_0x0f0b('0x4')](APIError,Error);};var APIBadRequestError=function(_0x239609){this[_0x0f0b('0x1')]=_0x239609||_0x0f0b('0x5');this['name']=_0x0f0b('0x5');util[_0x0f0b('0x4')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x27185f){this[_0x0f0b('0x1')]=_0x27185f||_0x0f0b('0x6');this[_0x0f0b('0x2')]=_0x0f0b('0x6');util[_0x0f0b('0x4')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x272b12){this[_0x0f0b('0x1')]=_0x272b12||_0x0f0b('0x7');this[_0x0f0b('0x2')]=_0x0f0b('0x8');util[_0x0f0b('0x4')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x138d4b){this['message']=_0x138d4b||_0x0f0b('0x9');this[_0x0f0b('0x2')]='Out\x20Of\x20Interval';this[_0x0f0b('0xa')]=0x193;this[_0x0f0b('0xb')]={'type':_0x0f0b('0xc')};util['inherits'](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x3bc282){this[_0x0f0b('0x1')]=_0x3bc282||_0x0f0b('0xd');this['name']=_0x0f0b('0xe');util[_0x0f0b('0x4')](APIBadRequestError,APIError);};function getStatusCode(_0x3f55ba){switch(_0x3f55ba){case _0x0f0b('0x5'):return 0x190;case _0x0f0b('0x6'),'Out\x20Of\x20Interval':return 0x193;case'Not\x20Found':return 0x194;case _0x0f0b('0xe'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x29945e){if(_0x29945e===_0x0f0b('0xf'))return _0x29945e;return null;}function handleError(_0x4cab0f){return function(_0x272897){logger[_0x0f0b('0x10')](_0x272897[_0x0f0b('0x11')]);var _0x4289ab=getStatusCode(_0x272897[_0x0f0b('0x2')]);var _0x256b74=getCustomStatusMessage(_0x272897[_0x0f0b('0x2')]);if(_0x272897[_0x0f0b('0x2')]){delete _0x272897[_0x0f0b('0x2')];}if(_0x256b74){_0x4cab0f[_0x0f0b('0x12')]=_0x256b74;}return _0x4cab0f['status'](_0x4289ab)[_0x0f0b('0x13')](_0x272897);};}module[_0x0f0b('0x14')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file +var _0xd34d=['Conflict','error','stack','statusMessage','status','send','exports','util','../config/logger','api','message','name','Error','inherits','Bad\x20Request','Forbidden','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','code','details','OutOfInterval','Resource\x20Conflict'];(function(_0x2cc594,_0x4d727b){var _0x4abff7=function(_0x22b01d){while(--_0x22b01d){_0x2cc594['push'](_0x2cc594['shift']());}};_0x4abff7(++_0x4d727b);}(_0xd34d,0x11b));var _0xdd34=function(_0x124e75,_0x4287aa){_0x124e75=_0x124e75-0x0;var _0x2b769d=_0xd34d[_0x124e75];return _0x2b769d;};'use strict';var util=require(_0xdd34('0x0'));var logger=require(_0xdd34('0x1'))(_0xdd34('0x2'));var APIError=function(_0x144647,_0x4c3abd){this[_0xdd34('0x3')]=_0x144647||'Internal\x20Server\x20Error';this[_0xdd34('0x4')]=_0x4c3abd||_0xdd34('0x5');util[_0xdd34('0x6')](APIError,Error);};var APIBadRequestError=function(_0x2afe76){this[_0xdd34('0x3')]=_0x2afe76||_0xdd34('0x7');this['name']=_0xdd34('0x7');util[_0xdd34('0x6')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x461340){this['message']=_0x461340||_0xdd34('0x8');this[_0xdd34('0x4')]=_0xdd34('0x8');util['inherits'](APIForbiddenError,APIError);};var APINotFoundError=function(_0x53d19a){this[_0xdd34('0x3')]=_0x53d19a||'Entity\x20not\x20found';this[_0xdd34('0x4')]=_0xdd34('0x9');util['inherits'](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x31a81c){this['message']=_0x31a81c||_0xdd34('0xa');this['name']=_0xdd34('0xb');this[_0xdd34('0xc')]=0x193;this[_0xdd34('0xd')]={'type':_0xdd34('0xe')};util[_0xdd34('0x6')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x59762c){this[_0xdd34('0x3')]=_0x59762c||_0xdd34('0xf');this[_0xdd34('0x4')]=_0xdd34('0x10');util[_0xdd34('0x6')](APIBadRequestError,APIError);};function getStatusCode(_0x391558){switch(_0x391558){case _0xdd34('0x7'):return 0x190;case _0xdd34('0x8'),_0xdd34('0xb'):return 0x193;case'Not\x20Found':return 0x194;case'Conflict':return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0xa0c4f0){if(_0xa0c4f0===_0xdd34('0xb'))return _0xa0c4f0;return null;}function handleError(_0x2dba20){return function(_0x3b4649){logger[_0xdd34('0x11')](_0x3b4649[_0xdd34('0x12')]);var _0x8d9ad6=getStatusCode(_0x3b4649[_0xdd34('0x4')]);var _0x11e31f=getCustomStatusMessage(_0x3b4649[_0xdd34('0x4')]);if(_0x3b4649[_0xdd34('0x4')]){delete _0x3b4649[_0xdd34('0x4')];}if(_0x11e31f){_0x2dba20[_0xdd34('0x13')]=_0x11e31f;}return _0x2dba20[_0xdd34('0x14')](_0x8d9ad6)[_0xdd34('0x15')](_0x3b4649);};}module[_0xdd34('0x16')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 80e178e..27c3e98 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa222=['send','exports','404','status','render','json'];(function(_0x3a64fd,_0x5dcc53){var _0x556b53=function(_0xf65079){while(--_0xf65079){_0x3a64fd['push'](_0x3a64fd['shift']());}};_0x556b53(++_0x5dcc53);}(_0xa222,0x1b7));var _0x2a22=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0xa222[_0x1857d0];return _0x3e3c46;};'use strict';module[_0x2a22('0x0')][0x194]=function pageNotFound(_0x22943,_0xefa312){var _0x3d02a1=_0x2a22('0x1');var _0x1883bf=0x194;var _0x4373ac={'status':_0x1883bf};_0xefa312['status'](_0x4373ac[_0x2a22('0x2')]);_0xefa312[_0x2a22('0x3')](_0x3d02a1,{},function(_0x404769,_0x557f2e){if(_0x404769){return _0xefa312[_0x2a22('0x2')](_0x4373ac[_0x2a22('0x2')])[_0x2a22('0x4')](_0x4373ac);}_0xefa312[_0x2a22('0x5')](_0x557f2e);});}; \ No newline at end of file +var _0x2516=['json','send','exports','render','status'];(function(_0x8ba624,_0x42e30e){var _0x43940f=function(_0x1f64af){while(--_0x1f64af){_0x8ba624['push'](_0x8ba624['shift']());}};_0x43940f(++_0x42e30e);}(_0x2516,0x16f));var _0x6251=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x2516[_0x3ce3c];return _0x55a2c9;};'use strict';module[_0x6251('0x0')][0x194]=function pageNotFound(_0x198831,_0x2870f9){var _0x1c120e='404';var _0x4e2f92=0x194;var _0x3e24e8={'status':_0x4e2f92};_0x2870f9['status'](_0x3e24e8['status']);_0x2870f9[_0x6251('0x1')](_0x1c120e,{},function(_0xb6b117,_0x113bda){if(_0xb6b117){return _0x2870f9[_0x6251('0x2')](_0x3e24e8[_0x6251('0x2')])[_0x6251('0x3')](_0x3e24e8);}_0x2870f9[_0x6251('0x4')](_0x113bda);});}; \ No newline at end of file diff --git a/server/files/chat/iframe.ejs b/server/files/chat/iframe.ejs index 8bbdea1..ae3ec99 100644 --- a/server/files/chat/iframe.ejs +++ b/server/files/chat/iframe.ejs @@ -1,392 +1,420 @@ (function() { - 'use strict'; - try { - const chatWebsiteAddress = new URL('{{{chatWebsiteAddressOrigin}}}') - if (chatWebsiteAddress.origin !== window.location.origin){ - throw new Error(`Domain "${window.location.origin}"" can't load snippet for '{{{chatWebsiteAddressOrigin}}}'. Please check your website domain in the current XCALLY Chat Website settings.`) - } - } catch (error) { - window.alert(`Domain ${window.location.origin} can't load snippet for '{{{chatWebsiteAddressOrigin}}}'. Please check your website domain in the current XCALLY Chat Website settings.`) - return + 'use strict'; + try { + const chatWebsiteAddress = new URL('{{{chatWebsiteAddressOrigin}}}'); + if (chatWebsiteAddress.origin !== window.location.origin){ + throw new Error(`Domain "${window.location.origin}"" can't load snippet for '{{{chatWebsiteAddressOrigin}}}'. Please check your website domain in the current XCALLY Chat Website settings.`); } - // Init all URLs - const remoteURL = new URL('{{{remote}}}') - const chatOrigin = remoteURL.origin - const chatPath = '/snippet/' - const chatStylesPath = chatPath + 'styles/' - const chatVersion = '{{{chatVersion}}}' - - // Style setttings - const divColor = '<%=div_color%>' - const textColor = '<%=text_color%>' - const buttonColor = '<%=button_color%>' - const backgroungColor = '<%=background_color%>' - let alignment = "<%=alignment%>"; - let verticalAlignment = "<%=verticalAlignment%>"; - - // iframe URL settings - const iframeId = 'motion-chat-iframe' - const iframeSrcURL = new URL(chatPath, chatOrigin) - const iframeSearchParams = new URLSearchParams('{{{query}}}') - iframeSearchParams.append('version', chatVersion) - iframeSearchParams.append('location', btoa(window.location.host)) - iframeSrcURL.search = iframeSearchParams - - // Style URL settings - const linkURL = new URL(chatStylesPath + 'mobile.css', chatOrigin) - linkURL.search = new URLSearchParams({ version: chatVersion }) - const linkMobile = document.createElement('link'); - linkMobile.type = "text/css"; - linkMobile.rel='stylesheet'; - linkMobile.href = linkURL.toString() - - // Iframe localstorage whitelisting - const allowedOrigins = [chatOrigin] - - function remoteLocalStorageEventHandler(event){ - if (allowedOrigins.includes(event.origin)) { - const { action, key, value } = event.data - const localStorage = window.localStorage - switch(action){ - case 'setItem': - { - localStorage.setItem(key, JSON.stringify(value)) - event.source.postMessage( - { - action: 'setItemResult', - key - }, event.origin) - } - break - case 'getItem': - { - let item = localStorage.getItem(key) - if(item){ - try { - item = JSON.parse(item) - } catch (error) { - console.error('Cannot read data from localstorage', error) - } - } - event.source.postMessage( - { - action: 'getItemResult', - key, - item - }, event.origin) - } - break - case 'removeItem': - { - localStorage.removeItem(key) - event.source.postMessage( - { - action: 'removeItemResult', - key - }, event.origin) - } - break - default: - typeof action === 'string' && console.debug('Unsupported action', action) - break; - } + } catch (error) { + window.alert(`Domain ${window.location.origin} can't load snippet for '{{{chatWebsiteAddressOrigin}}}'. Please check your website domain in the current XCALLY Chat Website settings.`); + return; + } + + // Init all URLs + const remoteURL = new URL('{{{remote}}}'); + const chatOrigin = remoteURL.origin; + const chatPath = '/snippet/'; + const chatStylesPath = chatPath + 'styles/'; + const chatVersion = '{{{chatVersion}}}'; + + // Style setttings + const divColor = '<%=div_color%>'; + const textColor = '<%=text_color%>'; + const buttonColor = '<%=button_color%>'; + const backgroungColor = '<%=background_color%>'; + let alignment = "<%=alignment%>"; + let verticalAlignment = "<%=verticalAlignment%>"; + + // iframe URL settings + const iframeId = 'motion-chat-iframe'; + const iframeSrcURL = new URL(chatPath, chatOrigin); + const iframeSearchParams = new URLSearchParams('{{{query}}}'); + iframeSearchParams.append('version', chatVersion); + iframeSearchParams.append('location', btoa(window.location.host)); + iframeSrcURL.search = iframeSearchParams; + + // Style URL settings + const linkURL = new URL(chatStylesPath + 'mobile.css', chatOrigin); + linkURL.search = new URLSearchParams({ version: chatVersion }); + const linkMobile = document.createElement('link'); + linkMobile.type = "text/css"; + linkMobile.rel='stylesheet'; + linkMobile.href = linkURL.toString(); + + // Iframe localstorage whitelisting + const allowedOrigins = [chatOrigin]; + + function remoteLocalStorageEventHandler(event) { + if (allowedOrigins.includes(event.origin)) { + const { action, key, value } = event.data; + const localStorage = window.localStorage; + switch(action) { + case 'setItem': { + localStorage.setItem(key, JSON.stringify(value)) + event.source.postMessage( + { action: 'setItemResult', key }, + event.origin + ); + break; + } + case 'getItem': { + let item = localStorage.getItem(key); + if (item) { + try { + item = JSON.parse(item); + } catch (error) { + console.error('Cannot read data from localstorage', error); } + } + event.source.postMessage( + { action: 'getItemResult', key, item }, + event.origin + ); + break; } - - // DOM Manipulation - let iframe = document.createElement('iframe'); - // Attributes - iframe['id'] = iframeId; - iframe['src'] = iframeSrcURL.toString() - - let iframe_status = false; - - document.documentElement.style.setProperty('--xc-ws-div-color', divColor); - document.documentElement.style.setProperty('--xc-ws-text-color', textColor); - document.documentElement.style.setProperty('--xc-ws-button-color', buttonColor); - document.documentElement.style.setProperty('--xc-ws-background-color', backgroungColor); + case 'removeItem': { + localStorage.removeItem(key); + event.source.postMessage( + { action: 'removeItemResult', key }, + event.origin + ); + break; + } + default: + typeof action === 'string' && console.debug('Unsupported action', action); + break; + } + } + } + + // DOM Manipulation + let iframe = document.createElement('iframe'); + // Attributes + iframe['id'] = iframeId; + iframe['src'] = iframeSrcURL.toString() + + let iframe_status = false; + + document.documentElement.style.setProperty('--xc-ws-div-color', divColor); + document.documentElement.style.setProperty('--xc-ws-text-color', textColor); + document.documentElement.style.setProperty('--xc-ws-button-color', buttonColor); + document.documentElement.style.setProperty('--xc-ws-background-color', backgroungColor); + + document.head.appendChild(linkMobile); + document.body.appendChild(iframe); + + <% if (alignment == 'bottom_right') { -%> + // Bottom, right + iframe.className = 'motion-chat-iframe-bottom_right'; + verticalAlignment = 0; + <% } else if (alignment == 'right') { -%> + // Right + iframe.className = 'motion-chat-iframe-right'; + iframe.style['top'] = verticalAlignment+'%'; + let iframe_h = topIframe_calc(); + topIframe_set(iframe_h); + let div_tab = document.createElement('div'); + div_tab['id'] = 'motion-chat-iframe-tab'; + div_tab.className = 'motion-chat-div-right'; + let tab_status=0; + <% } else if (alignment == 'left') { -%> + // Left + iframe.className = 'motion-chat-iframe-left'; + iframe.style['top'] = verticalAlignment+'%'; + let iframe_h = topIframe_calc(); + topIframe_set(iframe_h); + let div_tab = document.createElement('div'); + div_tab.className = 'motion-chat-div-left'; + div_tab['id'] ='motion-chat-iframe-tab'; + let tab_status=0; + <% } -%> + + <% if (alignment == 'right') { -%> + // RIGHT + topChat_set(iframe_h, verticalAlignment); + document.body.appendChild(div_tab); + let html = '
<
<%=labelText%>'; + div_tab.innerHTML = html; - document.head.appendChild(linkMobile); - - <% if (alignment == 'bottom_right') { -%> // Bottom, right - iframe.className = 'motion-chat-iframe-bottom_right'; - verticalAlignment = 0; - document.body.appendChild(iframe); - - <% } else if (alignment == 'right') { -%> // Right - iframe.className = 'motion-chat-iframe-right'; - iframe.style['top'] = verticalAlignment+'%'; - let iframe_h = topIframe_calc(); - topIframe_set(iframe_h); - let div_tab = document.createElement('div'); - div_tab['id'] = 'motion-chat-iframe-tab'; - div_tab.className = 'motion-chat-div-right'; - let tab_status=0; + div_tab.style.backgroundColor = divColor; + document.getElementById("chat_tab_text").style.color = textColor; + document.getElementById("chat_tab_arrow").style.color = divColor; + document.getElementById("chat_tab_arrow").style.backgroundColor = textColor; + document.getElementById("motion-chat-iframe-tab").style.display = "flex"; + + function appendLink(){ + if(iframe_status == false){ + document.body.appendChild(iframe); + iframe_status=true; + } + } - <% } else if (alignment == 'left') { -%> // Left - iframe.className = 'motion-chat-iframe-left'; - iframe.style['top'] = verticalAlignment+'%'; - let iframe_h = topIframe_calc(); - topIframe_set(iframe_h); - let div_tab = document.createElement('div'); - div_tab.className = 'motion-chat-div-left'; - div_tab['id'] ='motion-chat-iframe-tab'; - let tab_status=0; + function expandChatRight(){ + appendLink(); + div_tab.style.right = '295px'; + iframe.style.right = '0px'; + document.getElementById("chat_tab_arrow").innerHTML = " > "; + let iframeEl = document.getElementById('motion-chat-iframe'); + iframeEl.contentWindow?.postMessage({"evt":"show"}, '*'); + } - <% } -%> + function collapseChatRight(){ + appendLink(); + div_tab.style.right = '0px'; + iframe.style.right = '-312px'; + document.getElementById("chat_tab_arrow").innerHTML = " < "; + let iframeEl = document.getElementById('motion-chat-iframe'); + iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); + } - <% if (alignment == 'right') { -%> // Right - topChat_set(iframe_h, verticalAlignment); - document.body.appendChild(div_tab); - let html = '
<
<%=labelText%>'; - div_tab.innerHTML = html; - - div_tab.style.backgroundColor = divColor; - document.getElementById("chat_tab_text").style.color = textColor; - document.getElementById("chat_tab_arrow").style.color = divColor - document.getElementById("chat_tab_arrow").style.backgroundColor = textColor; - document.getElementById("motion-chat-iframe-tab").style.display = "flex"; - - function appendLink(){ - if(iframe_status == false){ - document.body.appendChild(iframe); - iframe_status=true; - } - } + function toggleChatExpandedRight(){ + if (tab_status % 2 === 0) { + expandChatRight(); + } + else { + collapseChatRight(); + } + tab_status++; + } - function expandChatRight(){ - appendLink() - div_tab.style.right = '295px'; - iframe.style.right = '0px'; - document.getElementById("chat_tab_arrow").innerHTML = " > "; - let iframeEl = document.getElementById('motion-chat-iframe'); - iframeEl.contentWindow?.postMessage({"evt":"show"}, '*'); - } + document.getElementById("motion-chat-iframe-tab").addEventListener("click", toggleChatExpandedRight); + <% } else if (alignment == 'left') { -%> + // LEFT + topChat_set(iframe_h, verticalAlignment); + document.body.appendChild(div_tab); + let html='
>
<%=labelText%>'; + div_tab.innerHTML = html; + + div_tab.style.backgroundColor = divColor; + document.getElementById("chat_tab_text").style.color = textColor; + document.getElementById("chat_tab_arrow").style.color = divColor; + document.getElementById("chat_tab_arrow").style.backgroundColor = textColor; + document.getElementById("motion-chat-iframe-tab").style.display="flex"; + + function appendLink() { + if (iframe_status == false){ + document.body.appendChild(iframe); + iframe_status=true; + } + } - function collapseChatRight(){ - appendLink() - div_tab.style.right = '0px'; - iframe.style.right = '-312px'; - document.getElementById("chat_tab_arrow").innerHTML = " < "; - let iframeEl = document.getElementById('motion-chat-iframe'); - iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); - } + function expandChatLeft() { + appendLink(); + div_tab.style.left = '295px'; + iframe.style.left = '0px'; + document.getElementById("chat_tab_arrow").innerHTML = " < "; + let iframeEl = document.getElementById('motion-chat-iframe'); + iframeEl.contentWindow?.postMessage({"evt":"show"}, '*'); + } - function toggleChatExpandedRight(){ - if(tab_status % 2 === 0) { - expandChatRight() - } - else { - collapseChatRight() - } - tab_status++; - } + function collapseChatLeft() { + appendLink(); + div_tab.style.left = '0px'; + iframe.style.left = '-312px'; + document.getElementById("chat_tab_arrow").innerHTML = " > "; + let iframeEl = document.getElementById('motion-chat-iframe'); + iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); + } - document.getElementById("motion-chat-iframe-tab").addEventListener("click", toggleChatExpandedRight); - <% } else if (alignment == 'left') { -%> - topChat_set(iframe_h, verticalAlignment); - document.body.appendChild(div_tab); - let html='
>
<%=labelText%>'; - div_tab.innerHTML=html; + function toggleChatExpandedLeft() { + if (tab_status % 2 === 0) { + expandChatLeft(); + } + else { + collapseChatLeft(); + } + tab_status++; + } + document.getElementById("motion-chat-iframe-tab").addEventListener("click", toggleChatExpandedLeft); + <% } -%> + + // START Events management + window.addEventListener( + 'message', + function(evt) { + remoteLocalStorageEventHandler(evt) + switch (evt.data.cmd) { + case 'show': + <% if (alignment == 'bottom_right') { -%> + // Bottom, right + iframe.style.top = 'auto'; + iframe.style.bottom = '0px'; + <% } else if (alignment == 'right') { -%> + // Right + iframe.style.right = '0px'; + div_tab.style.right = '295px'; + <% } else if (alignment == 'left') { -%> + // Left + iframe.style.left = '0px'; + div_tab.style.left = '295px'; + <% } -%> + break; + case 'hide': + <% if (alignment == 'bottom_right') { -%> + // Bottom, right + iframe.style.top = 'calc(100% - 50px)'; + <% } else if (alignment == 'right') { -%> + // Right + iframe.style.right = '-312px'; + div_tab.style['right'] = '0px'; + <% } else if (alignment == 'left') { -%> + // Left + iframe.style.left = '-312px'; + div_tab.style.left = '0px'; + <% } -%> + break; + case "init": + <% if (alignment == 'right' || alignment == 'left') { -%> + // Bottom, right div_tab.style.backgroundColor = divColor; document.getElementById("chat_tab_text").style.color = textColor; document.getElementById("chat_tab_arrow").style.color = divColor; document.getElementById("chat_tab_arrow").style.backgroundColor = textColor; - document.getElementById("motion-chat-iframe-tab").style.display="flex"; - - function appendLink(){ - if(iframe_status == false){ - document.body.appendChild(iframe); - iframe_status=true; - } - } - - function expandChatLeft(){ - appendLink() - div_tab.style.left = '295px'; - iframe.style.left = '0px'; - document.getElementById("chat_tab_arrow").innerHTML = " < "; - let iframeEl = document.getElementById('motion-chat-iframe'); - iframeEl.contentWindow?.postMessage({"evt":"show"}, '*'); - } - - function collapseChatLeft(){ - appendLink() - div_tab.style.left = '0px'; - iframe.style.left = '-312px'; - document.getElementById("chat_tab_arrow").innerHTML = " > "; - let iframeEl = document.getElementById('motion-chat-iframe'); - iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); - } - - function toggleChatExpandedLeft(){ - if(tab_status % 2 === 0) { - expandChatLeft() - } - else { - collapseChatLeft() - } - tab_status++; - } - - document.getElementById("motion-chat-iframe-tab").addEventListener("click", toggleChatExpandedLeft); - - <% } -%> - - // START Events management - window.addEventListener('message', function(evt) { - remoteLocalStorageEventHandler(evt) - switch (evt.data.cmd) { - case 'show': - <% if (alignment == 'bottom_right') { -%> // Bottom, right - iframe.style.top = 'auto'; - iframe.style.bottom = '0px'; - <% } else if (alignment == 'right') { -%> // Right - iframe.style.right = '0px'; - div_tab.style.right = '295px'; - <% } else if (alignment == 'left') { -%> // Left - iframe.style.left = '0px'; - div_tab.style.left = '295px'; - // Left - <% } -%> break; - case 'hide': - <% if (alignment == 'bottom_right') { -%> // Bottom, right - iframe.style.top = 'calc(100% - 50px)'; - <% } else if (alignment == 'right') { -%> // Right - iframe.style.right = '-312px'; - div_tab.style['right'] = '0px'; - <% } else if (alignment == 'left') { -%> // Left - iframe.style.left = '-312px'; - div_tab.style.left = '0px'; - <% } -%> break; - case "init": - <% if (alignment == 'right' || alignment == 'left') { -%> // Bottom, right - div_tab.style.backgroundColor = divColor; - document.getElementById("chat_tab_text").style.color = textColor; - document.getElementById("chat_tab_arrow").style.color = divColor; - document.getElementById("chat_tab_arrow").style.backgroundColor = textColor; - document.getElementById("motion-chat-iframe-tab").style.display = "flex"; - <% } -%> break; - case "offline": - <% if (alignment == 'right' || alignment == 'left') { -%> // Bottom, right - document.getElementById("motion-chat-iframe-tab").style.display = "none"; - <% } -%> break; - default: - } - - }, false); - // END Events management - - // START Proactive action management - <% proactiveActions.forEach(function(action, index) { -%> - <% if (action.type == 'timeout') { -%> - setTimeout(function() { - <% if (alignment == 'right') { -%> - expandChatRight(); - tab_status++; - <% } else if (alignment == 'left') { -%> - expandChatLeft(); - tab_status++; - <% } else { -%> - iframe.style.bottom = '0px'; - iframe.contentWindow?.postMessage({ - evt: 'show' - }, '*'); - <% } -%> - }, <%- action.timeout %> * 1000); - <% } -%> - <% if (action.type == 'mouseOver') { -%> - let elements<%- index %> = document.querySelectorAll("<%- action.selector %>"); - for (let i = 0; i < elements<%- index %>.length; i++) { - elements<%- index %>[i].onmouseover = function() { - <% if (alignment == 'right') { -%> - expandChatRight(); - tab_status++; - <% } else if (alignment == 'left') { -%> - expandChatLeft(); - tab_status++; - <% } else { -%> - iframe.style.bottom = '0px'; - iframe.contentWindow?.postMessage({ - evt: 'show' - }, '*'); - <% } -%> - } - } - <% } -%> <% }); -%> - // END Proactive action management - - - if (window.DeviceOrientationEvent) { - window.addEventListener('orientationchange', function() { - if (alignment == 'right'){ - document.getElementById("chat_tab_arrow").innerHTML = " < "; - let iframeEl = document.getElementById('motion-chat-iframe'); - iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); - tab_status = 0; - iframe_h = topIframe_calc(); - topIframe_set(iframe_h); - if(typeof div_tab != "undefined") topChat_set(iframe_h, verticalAlignment); - } - else if (alignment == 'left'){ - document.getElementById("chat_tab_arrow").innerHTML = " > "; - let iframeEl = document.getElementById('motion-chat-iframe'); - iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); - tab_status = 0; - iframe_h = topIframe_calc(); - topIframe_set(iframe_h); - if(typeof div_tab != "undefined") topChat_set(iframe_h, verticalAlignment); - } }, false); - } - - window.addEventListener("resize", function(event) { - let iframe_h = topIframe_calc(); - topIframe_set(iframe_h); - if(typeof div_tab != "undefined") topChat_set(iframe_h, verticalAlignment); - }); - - function topIframe_calc(){ - let height_iframe - let heightD = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); - let iframeT = ((heightD/100)*verticalAlignment) + 450; - if (heightD < iframeT) { - height_iframe = 450 - (iframeT - heightD); + document.getElementById("motion-chat-iframe-tab").style.display = "flex"; + <% } -%> + break; + case "offline": + <% if (alignment == 'right' || alignment == 'left') { -%> + // Bottom, right + document.getElementById("motion-chat-iframe-tab").style.display = "none"; + <% } -%> + break; + default: + } + }, + false + ); + // END Events management + + // START Proactive action management + <% proactiveActions.forEach(function(action, index) { -%> + <% if (action.type == 'timeout') { -%> + setTimeout(function() { + <% if (alignment == 'right') { -%> + expandChatRight(); + tab_status++; + <% } else if (alignment == 'left') { -%> + expandChatLeft(); + tab_status++; + <% } else { -%> + iframe.style.bottom = '0px'; + iframe.contentWindow?.postMessage({ + evt: 'show' + }, '*'); + <% } -%> + }, <%- action.timeout %> * 1000); + <% } -%> + <% if (action.type == 'mouseOver') { -%> + let elements<%- index %> = document.querySelectorAll("<%- action.selector %>"); + for (let i = 0; i < elements<%- index %>.length; i++) { + elements<%- index %>[i].onmouseover = function() { + <% if (alignment == 'right') { -%> + expandChatRight(); + tab_status++; + <% } else if (alignment == 'left') { -%> + expandChatLeft(); + tab_status++; + <% } else { -%> + iframe.style.bottom = '0px'; + iframe.contentWindow?.postMessage({ + evt: 'show' + }, '*'); + <% } -%> + } + } + <% } -%> <% }); -%> + // END Proactive action management + + if (window.DeviceOrientationEvent) { + window.addEventListener( + 'orientationchange', + function() { + if (alignment == 'right') { + document.getElementById("chat_tab_arrow").innerHTML = " < "; + let iframeEl = document.getElementById('motion-chat-iframe'); + iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); + tab_status = 0; + iframe_h = topIframe_calc(); + topIframe_set(iframe_h); + if (typeof div_tab != "undefined") { + topChat_set(iframe_h, verticalAlignment); + } } - else { height_iframe = 450; } - return height_iframe; + else if (alignment == 'left') { + document.getElementById("chat_tab_arrow").innerHTML = " > "; + let iframeEl = document.getElementById('motion-chat-iframe'); + iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); + tab_status = 0; + iframe_h = topIframe_calc(); + topIframe_set(iframe_h); + if (typeof div_tab != "undefined") { + topChat_set(iframe_h, verticalAlignment); + } } + }, + false + ); + } + + window.addEventListener( + "resize", + function(event) { + let iframe_h = topIframe_calc(); + topIframe_set(iframe_h); + if(typeof div_tab != "undefined") { + topChat_set(iframe_h, verticalAlignment); + } + } + ); + + function topIframe_calc(){ + let height_iframe + let heightD = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); + let iframeT = ((heightD/100)*verticalAlignment) + 450; + if (heightD < iframeT) { + height_iframe = 450 - (iframeT - heightD); + } + else { + height_iframe = 450; + } + return height_iframe; + } + + function topIframe_set(height_iframe) { + if (height_iframe > 340) { + iframe.style['height'] = height_iframe +'px'; + if (alignment == "right" || alignment == "left") { + iframe.style['top'] = verticalAlignment + "%"; + } + else { + iframe.style['bottom'] = "0%"; + } + } + else { + iframe.style['height'] = '340px'; + if (alignment == "right" || alignment == "left") { + iframe.style['top'] = "calc(100% - 340px)"; + } + else { + iframe.style['bottom'] = "0%"; + } + } + } - function topIframe_set(height_iframe){ - if( height_iframe > 340){ - iframe.style['height'] = height_iframe +'px'; - if (alignment == "right" || alignment == "left" ) - { iframe.style['top'] = verticalAlignment + "%"; } - else{ iframe.style['bottom'] = "0%"; } - - } - else { - iframe.style['height'] = '340px'; - if (alignment == "right" || alignment == "left" ) - { iframe.style['top'] = "calc(100% - 340px)"; } - else{ iframe.style['bottom'] = "0%"; } - - } - } - - function topChat_set(height_iframe, verticalAlignment){ - - if( height_iframe > 340){ - div_tab.style['top'] = "calc("+ verticalAlignment +"% + " + (height_iframe - 100) + "px)"; - } - else { - div_tab.style['top'] = "auto"; - div_tab.style['bottom'] = "0px"; - } - } + function topChat_set(height_iframe, verticalAlignment) { + if (height_iframe > 340) { + div_tab.style['top'] = "calc("+ verticalAlignment +"% + " + (height_iframe - 100) + "px)"; + } + else { + div_tab.style['top'] = "auto"; + div_tab.style['bottom'] = "0px"; + } + } - // hide chat - <% if (hideWhenOffline && intervalId != null) { -%> // hide template - document.getElementById("motion-chat-iframe-tab").style.display = "none"; - <% } -%> + // hide chat + <% if (hideWhenOffline && intervalId != null) { -%> + // hide template + document.getElementById("motion-chat-iframe-tab").style.display = "none"; + <% } -%> }()); \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index f2dc75b..5d374a4 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57b2=['chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteraction','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','UserVoicePrefix','ChatQueues','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueues','WhatsappQueue','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','Applications','Sounds','moh_has_sounds','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPause','Lists','voice_queues_has_cm_lists','Teams','Messages','mailboxuser','mailbox','VoiceQueueReport','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProvider','CloudProviderId','Imap','Smtp','Dispositions','Answers','List','Template','TemplateId','mandatoryDispositionPauseId','Agents','team_has_mail_queues','Owner','Tags','mail_interaction_has_tags','ThroughTags','MailInteractionId','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','ListId','Dashboard','FaxAccountId','Interactions','FaxInteractionId','Account','fax_interaction_has_tags','Users','AttachmentId','FaxQueue','SmsAccountId','user_has_sms_accounts','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','SmsQueue','team_has_sms_queues','OpenchannelAccount','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','user_has_openchannel_interactions','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatGroupId','CompanyId','CmContactId','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','ChatApplications','SmsApplications','CustomReportId','Mohs','cm_contact_has_tags','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AllConditions','TriggerAllId','AnyCondition','Fields','DefaultReportId','MetricId','SalesforceAccount','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','Variable','VariableId','SugarcrmConfiguration','SugarcrmField','int_desk_configuration_has_tags','ZendeskConfiguration','int_zendesk_configuration_has_tags','VtigerConfiguration','ServicenowAccount','ServicenowField','Dynamics365Configuration','ChatQueueReport','FromId','SessionId','ProjectId','JscriptyProject','team_has_chat_queues','team_has_fax_queues','team_has_whatsapp_queues','WhatsappQueues','TeamVoicePrefix','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToMailAccountId','FromChatWebsiteId','ToChatQueueId','ToAccount','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','user','exports','../config/environment','sequelize','lodash','jstz','determine','motion2','xcall','name','utf8_general_ci','sequelizeHistory','defaultsDeep','127.0.0.1','mysql','utf8mb4','utf8','database','username','password','options','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','ContactItemType','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReportDetail/squareReportDetail.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','UserSetting','../api/user-setting/user-setting.model','MailInteractionHasTag','../api/mailInteractionHasTag/mailInteractionHasTag.model','User','hasOne','cascade','UserId','userSetting','VoiceRecording','VoiceQueuesRt','hasMany','Extensions','CmHopperFinal','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','CmHopper','Hoppers','belongsTo','userProfileId','belongsToMany','ChatGroup','Groups'];(function(_0xadbca9,_0x2a30f6){var _0x1e3e1b=function(_0x4dc079){while(--_0x4dc079){_0xadbca9['push'](_0xadbca9['shift']());}};_0x1e3e1b(++_0x2a30f6);}(_0x57b2,0xda));var _0x257b=function(_0x45b4eb,_0x4536ac){_0x45b4eb=_0x45b4eb-0x0;var _0x3b9dc5=_0x57b2[_0x45b4eb];return _0x3b9dc5;};'use strict';var config=require(_0x257b('0x0'));var Sequelize=require(_0x257b('0x1'));var _=require(_0x257b('0x2'));var jstz=require(_0x257b('0x3'));var timezone=jstz[_0x257b('0x4')]();config[_0x257b('0x1')]=_['defaultsDeep'](config[_0x257b('0x1')],{'database':_0x257b('0x5'),'username':_0x257b('0x6'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x257b('0x7')](),'define':{'charset':'utf8','collate':_0x257b('0x8')}}});config[_0x257b('0x9')]=_[_0x257b('0xa')](config['sequelizeHistory'],{'database':_0x257b('0x5'),'username':_0x257b('0x6'),'password':'xC@LL1234','options':{'host':_0x257b('0xb'),'port':0xcea,'dialect':_0x257b('0xc'),'dialectOptions':{'charset':_0x257b('0xd')},'logging':![],'timezone':timezone[_0x257b('0x7')](),'define':{'charset':_0x257b('0xe'),'collate':_0x257b('0x8')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x257b('0x1')][_0x257b('0xf')],config[_0x257b('0x1')][_0x257b('0x10')],config[_0x257b('0x1')][_0x257b('0x11')],config[_0x257b('0x1')][_0x257b('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x257b('0x9')]['database'],config[_0x257b('0x9')][_0x257b('0x10')],config[_0x257b('0x9')][_0x257b('0x11')],config[_0x257b('0x9')]['options'])};db['User']=db[_0x257b('0x1')]['import'](_0x257b('0x13'));db[_0x257b('0x14')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x16'));db[_0x257b('0x17')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/voiceContext/voiceContext.model');db[_0x257b('0x18')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/voiceExtension/voiceExtension.model');db[_0x257b('0x19')]=db['sequelize'][_0x257b('0x15')](_0x257b('0x1a'));db[_0x257b('0x1b')]=db['sequelize'][_0x257b('0x15')](_0x257b('0x1c'));db['VoiceRecording']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x1d'));db[_0x257b('0x1e')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/screenRecording/screenRecording.model');db[_0x257b('0x1f')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x20'));db[_0x257b('0x21')]=db[_0x257b('0x1')]['import'](_0x257b('0x22'));db[_0x257b('0x23')]=db['sequelize'][_0x257b('0x15')]('../api/voiceCallReport/voiceCallReport.model');db[_0x257b('0x24')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x25'));db[_0x257b('0x26')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x27'));db['VoiceQueueReport']=db[_0x257b('0x1')]['import'](_0x257b('0x28'));db[_0x257b('0x29')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x2a'));db[_0x257b('0x2b')]=db['sequelize']['import'](_0x257b('0x2c'));db['VoiceTransferReport']=db['sequelize'][_0x257b('0x15')](_0x257b('0x2d'));db[_0x257b('0x2e')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x257b('0x2f')]=db['sequelize']['import'](_0x257b('0x30'));db[_0x257b('0x31')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x32'));db[_0x257b('0x33')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/userMailQueue/userMailQueue.model');db[_0x257b('0x34')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/userFaxQueue/userFaxQueue.model');db['UserSmsQueue']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x35'));db[_0x257b('0x36')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x257b('0x37')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x38'));db[_0x257b('0x39')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/mailServerIn/mailServerIn.model');db[_0x257b('0x3a')]=db[_0x257b('0x1')]['import']('../api/mailServerOut/mailServerOut.model');db[_0x257b('0x3b')]=db[_0x257b('0x1')]['import'](_0x257b('0x3c'));db[_0x257b('0x3d')]=db[_0x257b('0x1')]['import']('../api/mailQueue/mailQueue.model');db[_0x257b('0x3e')]=db['sequelize'][_0x257b('0x15')](_0x257b('0x3f'));db['MailInteraction']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x40'));db[_0x257b('0x41')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x42'));db[_0x257b('0x43')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x44'));db[_0x257b('0x45')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x46'));db['Dashboard']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x47'));db[_0x257b('0x48')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x49'));db[_0x257b('0x4a')]=db['sequelize'][_0x257b('0x15')](_0x257b('0x4b'));db[_0x257b('0x4c')]=db[_0x257b('0x1')]['import'](_0x257b('0x4d'));db[_0x257b('0x4e')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x4f'));db[_0x257b('0x50')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/faxMessage/faxMessage.model');db['FaxQueue']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x51'));db[_0x257b('0x52')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x53'));db['SmsAccount']=db['sequelize']['import'](_0x257b('0x54'));db['SmsApplication']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x55'));db[_0x257b('0x56')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x57'));db[_0x257b('0x58')]=db[_0x257b('0x1')]['import'](_0x257b('0x59'));db['SmsQueue']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x5a'));db['OpenchannelAccount']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x5b'));db[_0x257b('0x5c')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x5d'));db[_0x257b('0x5e')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x257b('0x5f')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x60'));db[_0x257b('0x61')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x62'));db[_0x257b('0x63')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x64'));db[_0x257b('0x65')]=db['sequelize'][_0x257b('0x15')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x257b('0x66')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x67'));db[_0x257b('0x68')]=db['sequelize'][_0x257b('0x15')](_0x257b('0x69'));db[_0x257b('0x6a')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x6b'));db[_0x257b('0x6c')]=db['sequelize'][_0x257b('0x15')]('../api/chatQueue/chatQueue.model');db['ChatGroup']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x6d'));db['ChatProactiveAction']=db['sequelize'][_0x257b('0x15')](_0x257b('0x6e'));db[_0x257b('0x6f')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x70'));db[_0x257b('0x71')]=db['sequelize']['import'](_0x257b('0x72'));db['CmHopper']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x73'));db[_0x257b('0x74')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x75'));db['CmHopperFinal']=db[_0x257b('0x1')]['import'](_0x257b('0x76'));db[_0x257b('0x77')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x78'));db[_0x257b('0x79')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x7a'));db[_0x257b('0x7b')]=db['sequelize'][_0x257b('0x15')]('../api/cmCustomField/cmCustomField.model');db[_0x257b('0x7c')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x7d'));db[_0x257b('0x7e')]=db[_0x257b('0x1')]['import'](_0x257b('0x7f'));db[_0x257b('0x80')]=db[_0x257b('0x1')]['import']('../api/cannedAnswer/cannedAnswer.model');db[_0x257b('0x81')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x82'));db[_0x257b('0x83')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x84'));db['Interval']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x85'));db[_0x257b('0x86')]=db['sequelize']['import']('../api/pause/pause.model');db['Cdr']=db[_0x257b('0x1')][_0x257b('0x15')]('../api/cdr/cdr.model');db[_0x257b('0x87')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x88'));db[_0x257b('0x89')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x8a'));db[_0x257b('0x8b')]=db['sequelize'][_0x257b('0x15')]('../api/sound/sound.model');db[_0x257b('0x8c')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/tag/tag.model');db[_0x257b('0x8d')]=db['sequelize']['import']('../api/contactItemType/contactItemType.model');db[_0x257b('0x8e')]=db['sequelize'][_0x257b('0x15')](_0x257b('0x8f'));db['CmHopperAdditionalPhone']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x90'));db['Template']=db[_0x257b('0x1')][_0x257b('0x15')]('../api/template/template.model');db[_0x257b('0x91')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x92'));db['Variable']=db['sequelize']['import'](_0x257b('0x93'));db['Integration']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x94'));db[_0x257b('0x95')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/integrationReport/integrationReport.model');db[_0x257b('0x96')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x97'));db[_0x257b('0x98')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x99'));db[_0x257b('0x9a')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x257b('0x9b')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/analyticMetric/analyticMetric.model');db[_0x257b('0x9c')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x9d'));db[_0x257b('0x9e')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x9f'));db['SalesforceAccount']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xa0'));db[_0x257b('0xa1')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xa2'));db[_0x257b('0xa3')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/intSalesforceField/intSalesforceField.model');db[_0x257b('0xa4')]=db[_0x257b('0x1')]['import'](_0x257b('0xa5'));db['SugarcrmConfiguration']=db[_0x257b('0x1')][_0x257b('0x15')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db['SugarcrmField']=db['sequelize'][_0x257b('0x15')](_0x257b('0xa6'));db[_0x257b('0xa7')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xa8'));db[_0x257b('0xa9')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xaa'));db[_0x257b('0xab')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/intDeskField/intDeskField.model');db[_0x257b('0xac')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xad'));db[_0x257b('0xae')]=db[_0x257b('0x1')]['import'](_0x257b('0xaf'));db[_0x257b('0xb0')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/intZohoField/intZohoField.model');db[_0x257b('0xb1')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xb2'));db[_0x257b('0xb3')]=db['sequelize']['import']('../api/intZendeskField/intZendeskField.model');db[_0x257b('0xb4')]=db['sequelize'][_0x257b('0x15')](_0x257b('0xb5'));db[_0x257b('0xb6')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xb7'));db[_0x257b('0xb8')]=db[_0x257b('0x1')]['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0x257b('0xb9')]=db[_0x257b('0x1')]['import']('../api/intVtigerAccount/intVtigerAccount.model');db['VtigerConfiguration']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xba'));db[_0x257b('0xbb')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xbc'));db['ServicenowAccount']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xbd'));db[_0x257b('0xbe')]=db['sequelize'][_0x257b('0x15')](_0x257b('0xbf'));db['ServicenowField']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xc0'));db[_0x257b('0xc1')]=db[_0x257b('0x1')]['import'](_0x257b('0xc2'));db['Dynamics365Configuration']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xc3'));db[_0x257b('0xc4')]=db['sequelize'][_0x257b('0x15')](_0x257b('0xc5'));db[_0x257b('0xc6')]=db['sequelize']['import'](_0x257b('0xc7'));db[_0x257b('0xc8')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x257b('0xc9')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xca'));db[_0x257b('0xcb')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x94'));db[_0x257b('0xcc')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xcd'));db['ChatQueueReport']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xce'));db[_0x257b('0xcf')]=db['sequelize'][_0x257b('0x15')](_0x257b('0xd0'));db[_0x257b('0xd1')]=db['sequelize'][_0x257b('0x15')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x257b('0xd2')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x257b('0xd3')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xd4'));db[_0x257b('0xd5')]=db[_0x257b('0x1')]['import'](_0x257b('0xd6'));db[_0x257b('0xd7')]=db['sequelize'][_0x257b('0x15')]('../api/squareReport/squareReport.model');db['SquareDetailsReport']=db[_0x257b('0x1')]['import'](_0x257b('0xd8'));db['JscriptyProject']=db[_0x257b('0x1')]['import']('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xd9'));db[_0x257b('0xda')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xdb'));db[_0x257b('0xdc')]=db['sequelize'][_0x257b('0x15')]('../api/squareProject/squareProject.model');db[_0x257b('0xdd')]=db[_0x257b('0x1')]['import'](_0x257b('0xde'));db[_0x257b('0xdf')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xe0'));db[_0x257b('0xe1')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/team/team.model');db['License']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xe2'));db[_0x257b('0xe3')]=db[_0x257b('0x1')]['import']('../api/campaign/campaign.model');db[_0x257b('0xe4')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xe5'));db[_0x257b('0xe6')]=db['sequelize'][_0x257b('0x15')](_0x257b('0xe7'));db[_0x257b('0xe8')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xe9'));db['MailTransferReport']=db['sequelize'][_0x257b('0x15')](_0x257b('0xea'));db[_0x257b('0xeb')]=db['sequelize'][_0x257b('0x15')](_0x257b('0xec'));db[_0x257b('0xed')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/faxTransferReport/faxTransferReport.model');db[_0x257b('0xee')]=db[_0x257b('0x1')]['import'](_0x257b('0xef'));db['SmsTransferReport']=db['sequelize'][_0x257b('0x15')](_0x257b('0xf0'));db[_0x257b('0xf1')]=db[_0x257b('0x1')]['import'](_0x257b('0xf2'));db['VoicePrefix']=db[_0x257b('0x1')]['import'](_0x257b('0xf3'));db[_0x257b('0xf4')]=db[_0x257b('0x1')]['import']('../api/userProfile/userProfile.model');db[_0x257b('0xf5')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xf6'));db[_0x257b('0xf7')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xf8'));db[_0x257b('0xf9')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xfa'));db[_0x257b('0xfb')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0xfc'));db[_0x257b('0xfd')]=db[_0x257b('0x1')][_0x257b('0x15')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x257b('0xfe')]=db['sequelize'][_0x257b('0x15')](_0x257b('0xff'));db[_0x257b('0x100')]=db[_0x257b('0x1')]['import'](_0x257b('0x101'));db[_0x257b('0x102')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x103'));db['WhatsappQueue']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x104'));db['CloudProvider']=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x105'));db[_0x257b('0x106')]=db[_0x257b('0x1')]['import'](_0x257b('0x107'));db['TeamVoicePrefix']=db[_0x257b('0x1')][_0x257b('0x15')]('../api/teamVoicePrefix/teamVoicePrefix.model');db['UserVoicePrefix']=db[_0x257b('0x1')][_0x257b('0x15')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x257b('0x108')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x109'));db[_0x257b('0x10a')]=db[_0x257b('0x1')][_0x257b('0x15')](_0x257b('0x10b'));db[_0x257b('0x10c')][_0x257b('0x10d')](db[_0x257b('0x1f')],{'as':_0x257b('0x1f'),'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x10f')});db[_0x257b('0x10c')][_0x257b('0x10d')](db['UserSetting'],{'as':_0x257b('0x110'),'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x10f')});db[_0x257b('0x10c')]['hasMany'](db[_0x257b('0x111')],{'as':'Recordings','foreignKey':_0x257b('0x10f')});db[_0x257b('0x10c')]['hasMany'](db[_0x257b('0x2e')],{'as':_0x257b('0x112'),'foreignKey':_0x257b('0x10f')});db[_0x257b('0x10c')][_0x257b('0x113')](db[_0x257b('0x18')],{'as':_0x257b('0x114'),'onDelete':_0x257b('0x10e'),'hooks':!![]});db['User'][_0x257b('0x113')](db[_0x257b('0x115')],{'as':_0x257b('0x116'),'foreignKey':_0x257b('0x10f')});db[_0x257b('0x10c')][_0x257b('0x113')](db[_0x257b('0x77')],{'as':_0x257b('0x117'),'foreignKey':'UserId'});db[_0x257b('0x10c')][_0x257b('0x113')](db['ReportAgentPreview'],{'as':_0x257b('0x79'),'foreignKey':_0x257b('0x10f')});db[_0x257b('0x10c')][_0x257b('0x113')](db[_0x257b('0x5e')],{'as':_0x257b('0x118'),'foreignKey':_0x257b('0x10f')});db[_0x257b('0x10c')][_0x257b('0x113')](db['ChatInteraction'],{'as':_0x257b('0x119'),'foreignKey':'UserId'});db['User'][_0x257b('0x113')](db[_0x257b('0x56')],{'as':'SmsInteractions','foreignKey':_0x257b('0x10f')});db[_0x257b('0x10c')][_0x257b('0x113')](db[_0x257b('0x4e')],{'as':_0x257b('0x11a'),'foreignKey':_0x257b('0x10f')});db['User'][_0x257b('0x113')](db[_0x257b('0x11b')],{'as':_0x257b('0x11c'),'foreignKey':_0x257b('0x10f')});db['User']['hasMany'](db[_0x257b('0xfd')],{'as':_0x257b('0x11d'),'foreignKey':_0x257b('0x10f')});db[_0x257b('0x10c')][_0x257b('0x113')](db[_0x257b('0xf9')],{'as':_0x257b('0x11e'),'foreignKey':'SenderId'});db['User'][_0x257b('0x113')](db[_0x257b('0x11f')],{'as':_0x257b('0x120'),'foreignKey':_0x257b('0x10f'),'onDelete':'SET\x20NULL'});db['User'][_0x257b('0x121')](db[_0x257b('0xf4')],{'as':_0x257b('0xf4'),'foreignKey':_0x257b('0x122')});db[_0x257b('0x10c')][_0x257b('0x123')](db[_0x257b('0x124')],{'as':_0x257b('0x125'),'through':_0x257b('0x126')});db[_0x257b('0x10c')]['belongsToMany'](db[_0x257b('0x71')],{'as':_0x257b('0x127'),'through':_0x257b('0x128')});db[_0x257b('0x10c')][_0x257b('0x123')](db[_0x257b('0xf1')],{'as':'Lists','through':_0x257b('0x129')});db[_0x257b('0x10c')][_0x257b('0x123')](db[_0x257b('0xe1')],{'through':_0x257b('0x12a')});db[_0x257b('0x10c')]['belongsToMany'](db[_0x257b('0x11b')],{'as':_0x257b('0x11c'),'through':_0x257b('0x12b')});db[_0x257b('0x10c')]['belongsToMany'](db[_0x257b('0x12c')],{'as':_0x257b('0x119'),'through':_0x257b('0x12d')});db['User']['belongsToMany'](db[_0x257b('0x4e')],{'as':'FaxInteractions','through':_0x257b('0x12e')});db[_0x257b('0x10c')]['belongsToMany'](db['SmsInteraction'],{'as':_0x257b('0x12f'),'through':_0x257b('0x130')});db[_0x257b('0x10c')][_0x257b('0x123')](db[_0x257b('0x5e')],{'as':_0x257b('0x118'),'through':'user_has_openchannel_interactions'});db[_0x257b('0x10c')][_0x257b('0x123')](db[_0x257b('0xfd')],{'as':_0x257b('0x11d'),'through':_0x257b('0x131')});db[_0x257b('0x10c')][_0x257b('0x123')](db[_0x257b('0x1b')],{'as':_0x257b('0x132'),'through':'UserVoiceQueue','required':![]});db[_0x257b('0x10c')][_0x257b('0x123')](db[_0x257b('0x133')],{'as':_0x257b('0x134'),'through':_0x257b('0x135'),'required':![]});db[_0x257b('0x10c')][_0x257b('0x123')](db[_0x257b('0x3d')],{'as':'MailQueues','through':_0x257b('0x33'),'required':![]});db[_0x257b('0x10c')]['belongsToMany'](db[_0x257b('0x6c')],{'as':_0x257b('0x136'),'through':_0x257b('0x31'),'required':![],'hooks':!![]});db[_0x257b('0x10c')][_0x257b('0x123')](db['FaxQueue'],{'as':_0x257b('0x137'),'through':_0x257b('0x34'),'required':![]});db[_0x257b('0x10c')][_0x257b('0x123')](db['SmsQueue'],{'as':_0x257b('0x138'),'through':_0x257b('0x139'),'required':![]});db[_0x257b('0x10c')][_0x257b('0x123')](db[_0x257b('0x61')],{'as':_0x257b('0x13a'),'through':'UserOpenchannelQueue','required':![]});db[_0x257b('0x10c')][_0x257b('0x123')](db[_0x257b('0x13b')],{'as':'WhatsappQueues','through':_0x257b('0x37'),'required':![]});db[_0x257b('0x10c')][_0x257b('0x123')](db[_0x257b('0xf1')],{'through':_0x257b('0x129')});db[_0x257b('0x10c')][_0x257b('0x123')](db[_0x257b('0x63')],{'as':_0x257b('0x13c'),'through':_0x257b('0x13d')});db[_0x257b('0x10c')][_0x257b('0x123')](db[_0x257b('0x4a')],{'as':_0x257b('0x13e'),'through':_0x257b('0x13f')});db[_0x257b('0x10c')][_0x257b('0x123')](db['MailAccount'],{'as':_0x257b('0x140'),'through':_0x257b('0x141')});db['User']['belongsToMany'](db['OpenchannelAccount'],{'as':_0x257b('0x142'),'through':_0x257b('0x143')});db[_0x257b('0x10c')][_0x257b('0x123')](db[_0x257b('0x144')],{'as':_0x257b('0x145'),'through':'user_has_sms_accounts'});db[_0x257b('0x10c')]['belongsToMany'](db[_0x257b('0xfb')],{'as':_0x257b('0x146'),'through':_0x257b('0x147')});db['VoiceChanSpy'][_0x257b('0x113')](db[_0x257b('0x18')],{'as':'SpiedAgents','onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x148')});db['VoiceContext'][_0x257b('0x113')](db[_0x257b('0x18')],{'onDelete':_0x257b('0x10e')});db[_0x257b('0x18')][_0x257b('0x113')](db['VoiceExtension'],{'as':_0x257b('0x149'),'onDelete':_0x257b('0x10e')});db[_0x257b('0x19')][_0x257b('0x123')](db['Sound'],{'as':_0x257b('0x14a'),'through':_0x257b('0x14b')});db['VoiceQueue']['hasMany'](db[_0x257b('0x2e')],{'as':'Members','foreignKey':_0x257b('0x14c')});db[_0x257b('0x1b')][_0x257b('0x113')](db[_0x257b('0x11f')],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db[_0x257b('0x1b')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'VoiceQueueId'});db[_0x257b('0x1b')][_0x257b('0x113')](db[_0x257b('0x77')],{'as':_0x257b('0x14d'),'foreignKey':'VoiceQueueId'});db[_0x257b('0x1b')][_0x257b('0x113')](db[_0x257b('0x79')],{'as':_0x257b('0x79'),'foreignKey':_0x257b('0x14c')});db[_0x257b('0x1b')]['hasMany'](db[_0x257b('0x74')],{'as':_0x257b('0x14e'),'foreignKey':_0x257b('0x14c')});db['VoiceQueue'][_0x257b('0x113')](db[_0x257b('0xd3')],{'as':_0x257b('0x14f'),'foreignKey':_0x257b('0x14c')});db[_0x257b('0x1b')][_0x257b('0x121')](db[_0x257b('0x2b')],{'as':_0x257b('0x2b'),'foreignKey':_0x257b('0x150')});db[_0x257b('0x1b')][_0x257b('0x121')](db[_0x257b('0x2b')],{'as':_0x257b('0x151'),'foreignKey':_0x257b('0x152')});db[_0x257b('0x1b')][_0x257b('0x121')](db[_0x257b('0x153')],{'as':_0x257b('0x153'),'foreignKey':_0x257b('0x154')});db['VoiceQueue'][_0x257b('0x121')](db['Pause'],{'as':_0x257b('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x257b('0x1b')][_0x257b('0x123')](db[_0x257b('0xf1')],{'as':_0x257b('0x156'),'through':_0x257b('0x157')});db[_0x257b('0x1b')]['belongsToMany'](db[_0x257b('0x10c')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x257b('0x1b')][_0x257b('0x123')](db[_0x257b('0xe1')],{'as':_0x257b('0x158'),'through':_0x257b('0x106')});db[_0x257b('0x1b')][_0x257b('0x123')](db[_0x257b('0xf1')],{'as':'BlackLists','through':'voice_queues_has_cm_blacklists'});db[_0x257b('0x111')]['belongsTo'](db[_0x257b('0x10c')],{'as':_0x257b('0x10c'),'foreignKey':_0x257b('0x10f')});db[_0x257b('0x1e')][_0x257b('0x121')](db[_0x257b('0x10c')],{'as':'User','foreignKey':_0x257b('0x10f')});db[_0x257b('0x1f')][_0x257b('0x113')](db[_0x257b('0x21')],{'as':_0x257b('0x159'),'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x15a'),'sourceKey':_0x257b('0x15b')});db['VoiceMailMessage'][_0x257b('0x121')](db[_0x257b('0x1f')],{'foreignKey':_0x257b('0x15a'),'targetKey':_0x257b('0x15b')});db['VoiceCallReport'][_0x257b('0x113')](db[_0x257b('0x15c')],{'as':'QueueCalls','foreignKey':_0x257b('0x15d'),'constraints':![]});db[_0x257b('0x23')][_0x257b('0x113')](db[_0x257b('0x26')],{'as':_0x257b('0x15e'),'foreignKey':'uniqueid','constraints':![]});db[_0x257b('0x23')]['belongsTo'](db[_0x257b('0x10c')],{'as':_0x257b('0x10c'),'foreignKey':_0x257b('0x10f')});db['VoiceCallReport']['belongsTo'](db[_0x257b('0x71')],{'as':_0x257b('0x15f'),'foreignKey':_0x257b('0x160')});db[_0x257b('0x39')]['belongsTo'](db[_0x257b('0x3b')],{'as':_0x257b('0x3b'),'foreignKey':_0x257b('0x161')});db[_0x257b('0x39')][_0x257b('0x121')](db[_0x257b('0x162')],{'as':_0x257b('0x162'),'foreignKey':'CloudProviderId','onDelete':'restrict'});db[_0x257b('0x3a')][_0x257b('0x121')](db[_0x257b('0x3b')],{'as':_0x257b('0x3b'),'foreignKey':'MailAccountId'});db[_0x257b('0x3a')][_0x257b('0x121')](db[_0x257b('0x162')],{'as':'CloudProvider','foreignKey':_0x257b('0x163'),'onDelete':'restrict'});db[_0x257b('0x3b')][_0x257b('0x10d')](db[_0x257b('0x39')],{'as':_0x257b('0x164'),'onDelete':_0x257b('0x10e')});db['MailAccount'][_0x257b('0x10d')](db['MailServerOut'],{'as':_0x257b('0x165'),'onDelete':_0x257b('0x10e')});db[_0x257b('0x3b')][_0x257b('0x113')](db[_0x257b('0x81')],{'as':_0x257b('0x166'),'foreignKey':_0x257b('0x161'),'onDelete':_0x257b('0x10e')});db[_0x257b('0x3b')][_0x257b('0x113')](db[_0x257b('0x80')],{'as':_0x257b('0x167'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x257b('0x113')](db['MailMessage'],{'as':'Messages','foreignKey':_0x257b('0x161')});db[_0x257b('0x3b')][_0x257b('0x113')](db['MailInteraction'],{'as':'Interactions'});db[_0x257b('0x3b')][_0x257b('0x113')](db[_0x257b('0x43')],{'as':_0x257b('0x149'),'foreignKey':'MailAccountId','onDelete':_0x257b('0x10e')});db[_0x257b('0x3b')]['belongsTo'](db['CmList'],{'as':_0x257b('0x168'),'foreignKey':'ListId'});db[_0x257b('0x3b')]['belongsTo'](db[_0x257b('0x169')],{'as':_0x257b('0x169'),'foreignKey':_0x257b('0x16a')});db[_0x257b('0x3b')][_0x257b('0x121')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x257b('0x16b')});db[_0x257b('0x3b')]['belongsToMany'](db[_0x257b('0x10c')],{'as':_0x257b('0x16c'),'through':'user_has_mail_accounts'});db[_0x257b('0x3d')][_0x257b('0x123')](db['User'],{'as':_0x257b('0x16c'),'through':_0x257b('0x33')});db['MailQueue']['belongsToMany'](db[_0x257b('0xe1')],{'through':_0x257b('0x16d'),'as':_0x257b('0x158')});db[_0x257b('0x11b')][_0x257b('0x113')](db[_0x257b('0x41')],{'as':_0x257b('0x159'),'onDelete':_0x257b('0x10e'),'foreignKey':'MailInteractionId'});db[_0x257b('0x11b')][_0x257b('0x121')](db['MailAccount'],{'as':'Account','foreignKey':_0x257b('0x161')});db[_0x257b('0x11b')]['belongsTo'](db['CmContact'],{'as':_0x257b('0x15f'),'foreignKey':_0x257b('0x160')});db[_0x257b('0x11b')][_0x257b('0x121')](db[_0x257b('0x10c')],{'as':_0x257b('0x16e'),'foreignKey':_0x257b('0x10f')});db['MailInteraction'][_0x257b('0x123')](db[_0x257b('0x8c')],{'through':'mail_interaction_has_tags','as':_0x257b('0x16f')});db[_0x257b('0x11b')][_0x257b('0x123')](db[_0x257b('0x8c')],{'through':_0x257b('0x170'),'as':_0x257b('0x171')});db[_0x257b('0x11b')][_0x257b('0x123')](db['User'],{'as':'Users','through':_0x257b('0x12b'),'foreignKey':_0x257b('0x172')});db[_0x257b('0x41')][_0x257b('0x113')](db[_0x257b('0xe6')],{'as':_0x257b('0x173'),'onDelete':_0x257b('0x10e')});db['MailMessage'][_0x257b('0x121')](db[_0x257b('0x10c')],{'as':_0x257b('0x10c')});db[_0x257b('0x41')][_0x257b('0x121')](db[_0x257b('0x71')],{'onDelete':_0x257b('0x10e'),'as':'Contact'});db[_0x257b('0x41')]['belongsTo'](db[_0x257b('0x11b')],{'as':_0x257b('0x174'),'foreignKey':_0x257b('0x172')});db['MailMessage'][_0x257b('0x121')](db[_0x257b('0x3b')],{'as':'Account','foreignKey':'MailAccountId'});db[_0x257b('0x41')][_0x257b('0x121')](db['ChatWebsite'],{'as':_0x257b('0x63'),'foreignKey':_0x257b('0x175')});db[_0x257b('0x41')][_0x257b('0x121')](db['ChatOfflineMessage'],{'as':_0x257b('0x6a'),'foreignKey':_0x257b('0x176')});db[_0x257b('0x43')]['belongsTo'](db[_0x257b('0x10c')],{'onDelete':_0x257b('0x177')});db[_0x257b('0x43')][_0x257b('0x121')](db[_0x257b('0x3d')],{'onDelete':_0x257b('0x177')});db[_0x257b('0x43')][_0x257b('0x121')](db[_0x257b('0x3b')],{'onDelete':_0x257b('0x177')});db['MailApplication'][_0x257b('0x121')](db[_0x257b('0x153')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x257b('0x43')][_0x257b('0x121')](db['Tag'],{'onDelete':_0x257b('0x177'),'foreignKey':_0x257b('0x178')});db['MailQueueReport'][_0x257b('0x121')](db[_0x257b('0x3b')],{});db[_0x257b('0x45')][_0x257b('0x121')](db[_0x257b('0xf1')],{'as':'List','foreignKey':_0x257b('0x179')});db[_0x257b('0x45')][_0x257b('0x121')](db['CmContact'],{'as':_0x257b('0x15f'),'foreignKey':'ContactId'});db[_0x257b('0x45')]['belongsTo'](db[_0x257b('0x11b')],{});db[_0x257b('0x45')][_0x257b('0x121')](db[_0x257b('0x41')],{});db[_0x257b('0x45')]['belongsTo'](db[_0x257b('0x10c')],{});db['MailQueueReport']['belongsTo'](db['MailQueue'],{});db[_0x257b('0x17a')][_0x257b('0x113')](db['DashboardItem'],{'as':'Items','onDelete':'cascade'});db[_0x257b('0x4a')][_0x257b('0x113')](db[_0x257b('0x81')],{'as':_0x257b('0x166'),'foreignKey':_0x257b('0x17b'),'onDelete':_0x257b('0x10e')});db[_0x257b('0x4a')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x257b('0x17b')});db[_0x257b('0x4a')][_0x257b('0x113')](db[_0x257b('0x4e')],{'as':_0x257b('0x17c')});db[_0x257b('0x4a')][_0x257b('0x113')](db[_0x257b('0x4c')],{'as':_0x257b('0x149'),'foreignKey':_0x257b('0x17b'),'onDelete':_0x257b('0x10e')});db['FaxAccount'][_0x257b('0x113')](db['VoiceExtension'],{'as':'Exntensions','onDelete':_0x257b('0x10e')});db[_0x257b('0x4a')][_0x257b('0x113')](db[_0x257b('0x50')],{'as':'Messages'});db[_0x257b('0x4a')][_0x257b('0x121')](db[_0x257b('0x2b')],{'as':_0x257b('0x2b')});db[_0x257b('0x4a')][_0x257b('0x121')](db[_0x257b('0xf1')],{'as':'List','foreignKey':_0x257b('0x179')});db[_0x257b('0x4a')][_0x257b('0x121')](db[_0x257b('0x86')],{'as':_0x257b('0x155'),'foreignKey':_0x257b('0x16b')});db[_0x257b('0x4a')][_0x257b('0x123')](db[_0x257b('0x10c')],{'as':'Agents','through':_0x257b('0x13f')});db[_0x257b('0x4c')]['belongsTo'](db[_0x257b('0x10c')],{'onDelete':_0x257b('0x177')});db[_0x257b('0x4c')][_0x257b('0x121')](db['FaxQueue'],{'onDelete':_0x257b('0x177')});db[_0x257b('0x4c')][_0x257b('0x121')](db[_0x257b('0x4a')],{'onDelete':_0x257b('0x177')});db['FaxApplication'][_0x257b('0x121')](db[_0x257b('0x8c')],{'onDelete':_0x257b('0x177'),'foreignKey':_0x257b('0x178')});db[_0x257b('0x4e')][_0x257b('0x113')](db[_0x257b('0x50')],{'as':_0x257b('0x159'),'onDelete':'cascade','foreignKey':_0x257b('0x17d')});db[_0x257b('0x4e')][_0x257b('0x121')](db[_0x257b('0x4a')],{'as':_0x257b('0x17e'),'foreignKey':_0x257b('0x17b')});db[_0x257b('0x4e')][_0x257b('0x121')](db[_0x257b('0x71')],{'as':_0x257b('0x15f'),'foreignKey':'ContactId'});db[_0x257b('0x4e')][_0x257b('0x121')](db[_0x257b('0x10c')],{'as':'Owner','foreignKey':_0x257b('0x10f')});db[_0x257b('0x4e')][_0x257b('0x123')](db[_0x257b('0x8c')],{'through':_0x257b('0x17f'),'as':'Tags'});db[_0x257b('0x4e')][_0x257b('0x123')](db[_0x257b('0x8c')],{'through':'fax_interaction_has_tags','as':_0x257b('0x171')});db[_0x257b('0x4e')][_0x257b('0x123')](db[_0x257b('0x10c')],{'as':_0x257b('0x180'),'through':'user_has_fax_interactions','foreignKey':_0x257b('0x17d')});db[_0x257b('0x50')][_0x257b('0x121')](db[_0x257b('0x10c')],{'onDelete':_0x257b('0x10e'),'as':_0x257b('0x10c')});db[_0x257b('0x50')][_0x257b('0x121')](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0x257b('0x17d')});db[_0x257b('0x50')][_0x257b('0x121')](db[_0x257b('0x71')],{'onDelete':_0x257b('0x10e'),'as':_0x257b('0x15f')});db['FaxMessage'][_0x257b('0x121')](db['Attachment'],{'as':_0x257b('0xe6'),'foreignKey':_0x257b('0x181')});db[_0x257b('0x50')][_0x257b('0x121')](db[_0x257b('0x4a')],{'as':'Account','foreignKey':'FaxAccountId'});db['FaxQueue'][_0x257b('0x123')](db[_0x257b('0x10c')],{'as':_0x257b('0x16c'),'through':_0x257b('0x34')});db[_0x257b('0x182')][_0x257b('0x123')](db['Team'],{'through':'team_has_fax_queues','as':_0x257b('0x158')});db[_0x257b('0x52')][_0x257b('0x121')](db[_0x257b('0x4a')],{});db[_0x257b('0x52')][_0x257b('0x121')](db['CmList'],{'as':_0x257b('0x168'),'foreignKey':_0x257b('0x179')});db['FaxQueueReport'][_0x257b('0x121')](db[_0x257b('0x71')],{'as':_0x257b('0x15f'),'foreignKey':'ContactId'});db[_0x257b('0x52')][_0x257b('0x121')](db[_0x257b('0x4e')],{});db[_0x257b('0x52')]['belongsTo'](db['FaxMessage'],{});db['FaxQueueReport'][_0x257b('0x121')](db['User'],{});db[_0x257b('0x52')][_0x257b('0x121')](db['FaxQueue'],{});db['SmsAccount'][_0x257b('0x113')](db[_0x257b('0x81')],{'as':'Dispositions','foreignKey':_0x257b('0x183'),'onDelete':'cascade'});db['SmsAccount'][_0x257b('0x113')](db['CannedAnswer'],{'as':_0x257b('0x167'),'foreignKey':'SmsAccountId'});db[_0x257b('0x144')][_0x257b('0x113')](db[_0x257b('0x58')],{'as':_0x257b('0x159'),'foreignKey':_0x257b('0x183')});db[_0x257b('0x144')][_0x257b('0x113')](db['SmsInteraction'],{'as':_0x257b('0x17c')});db[_0x257b('0x144')][_0x257b('0x113')](db['SmsApplication'],{'as':_0x257b('0x149'),'foreignKey':_0x257b('0x183'),'onDelete':_0x257b('0x10e')});db[_0x257b('0x144')][_0x257b('0x121')](db['CmList'],{'as':_0x257b('0x168'),'foreignKey':'ListId'});db['SmsAccount'][_0x257b('0x121')](db['Pause'],{'as':_0x257b('0x155'),'foreignKey':_0x257b('0x16b')});db[_0x257b('0x144')][_0x257b('0x123')](db[_0x257b('0x10c')],{'as':_0x257b('0x16c'),'through':_0x257b('0x184')});db[_0x257b('0x185')][_0x257b('0x121')](db[_0x257b('0x10c')],{'onDelete':_0x257b('0x177')});db['SmsApplication'][_0x257b('0x121')](db['SmsQueue'],{'onDelete':_0x257b('0x177')});db[_0x257b('0x185')][_0x257b('0x121')](db[_0x257b('0x144')],{'onDelete':'restrict'});db[_0x257b('0x185')][_0x257b('0x121')](db['Interval'],{'onDelete':_0x257b('0x177'),'foreignKey':'IntervalId'});db[_0x257b('0x185')][_0x257b('0x121')](db[_0x257b('0x8c')],{'onDelete':'restrict','foreignKey':_0x257b('0x178')});db[_0x257b('0x56')][_0x257b('0x113')](db[_0x257b('0x58')],{'as':'Messages','onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x186')});db['SmsInteraction']['belongsTo'](db[_0x257b('0x144')],{'as':_0x257b('0x17e'),'foreignKey':_0x257b('0x183')});db[_0x257b('0x56')]['belongsTo'](db[_0x257b('0x71')],{'as':'Contact','foreignKey':_0x257b('0x160')});db[_0x257b('0x56')][_0x257b('0x121')](db['User'],{'as':_0x257b('0x16e'),'foreignKey':_0x257b('0x10f')});db[_0x257b('0x56')][_0x257b('0x123')](db[_0x257b('0x8c')],{'through':_0x257b('0x187'),'as':'Tags'});db[_0x257b('0x56')]['belongsToMany'](db['Tag'],{'through':_0x257b('0x187'),'as':_0x257b('0x171')});db[_0x257b('0x56')][_0x257b('0x123')](db['User'],{'as':_0x257b('0x180'),'through':_0x257b('0x130'),'foreignKey':_0x257b('0x186')});db[_0x257b('0x58')][_0x257b('0x121')](db[_0x257b('0x10c')],{'as':_0x257b('0x10c')});db[_0x257b('0x58')][_0x257b('0x121')](db[_0x257b('0x71')],{'onDelete':_0x257b('0x10e'),'as':_0x257b('0x15f')});db[_0x257b('0x58')][_0x257b('0x121')](db[_0x257b('0x56')],{'onDelete':_0x257b('0x10e'),'as':_0x257b('0x174'),'foreignKey':_0x257b('0x186')});db[_0x257b('0x58')][_0x257b('0x121')](db[_0x257b('0x144')],{'as':_0x257b('0x17e'),'foreignKey':_0x257b('0x183')});db['SmsQueue']['belongsToMany'](db[_0x257b('0x10c')],{'as':_0x257b('0x16c'),'through':_0x257b('0x139'),'foreignKey':_0x257b('0x188')});db[_0x257b('0x189')][_0x257b('0x123')](db[_0x257b('0xe1')],{'through':_0x257b('0x18a'),'as':_0x257b('0x158')});db[_0x257b('0x18b')]['hasMany'](db[_0x257b('0x81')],{'as':_0x257b('0x166'),'foreignKey':_0x257b('0x18c'),'onDelete':_0x257b('0x10e')});db[_0x257b('0x18b')][_0x257b('0x113')](db[_0x257b('0x80')],{'as':_0x257b('0x167'),'foreignKey':_0x257b('0x18c')});db[_0x257b('0x18b')][_0x257b('0x113')](db['OpenchannelInteraction'],{'as':_0x257b('0x17c'),'foreignKey':_0x257b('0x18c')});db[_0x257b('0x18b')][_0x257b('0x113')](db['OpenchannelMessage'],{'as':_0x257b('0x159'),'foreignKey':_0x257b('0x18c')});db['OpenchannelAccount'][_0x257b('0x113')](db['OpenchannelApplication'],{'as':_0x257b('0x149'),'foreignKey':_0x257b('0x18c'),'onDelete':_0x257b('0x10e')});db[_0x257b('0x18b')][_0x257b('0x121')](db[_0x257b('0xf1')],{'as':_0x257b('0x168'),'foreignKey':'ListId'});db[_0x257b('0x18b')][_0x257b('0x121')](db[_0x257b('0x86')],{'as':_0x257b('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db['OpenchannelAccount'][_0x257b('0x123')](db[_0x257b('0x10c')],{'as':_0x257b('0x16c'),'through':_0x257b('0x143')});db[_0x257b('0x5c')][_0x257b('0x121')](db['User'],{'onDelete':'restrict'});db[_0x257b('0x5c')][_0x257b('0x121')](db[_0x257b('0x61')],{'onDelete':_0x257b('0x177'),'foreignKey':_0x257b('0x18d')});db[_0x257b('0x5c')][_0x257b('0x121')](db['OpenchannelAccount'],{'onDelete':_0x257b('0x177'),'foreignKey':_0x257b('0x18c')});db[_0x257b('0x5c')][_0x257b('0x121')](db[_0x257b('0x153')],{'onDelete':_0x257b('0x177'),'foreignKey':_0x257b('0x154')});db[_0x257b('0x5c')]['belongsTo'](db[_0x257b('0x8c')],{'onDelete':_0x257b('0x177'),'foreignKey':_0x257b('0x178')});db[_0x257b('0x5e')]['hasMany'](db[_0x257b('0x5f')],{'as':_0x257b('0x159'),'onDelete':'cascade','foreignKey':_0x257b('0x18e')});db['OpenchannelInteraction'][_0x257b('0x121')](db[_0x257b('0x18b')],{'as':_0x257b('0x17e'),'foreignKey':_0x257b('0x18c')});db[_0x257b('0x5e')][_0x257b('0x121')](db[_0x257b('0x71')],{'as':'Contact','foreignKey':_0x257b('0x160')});db['OpenchannelInteraction']['belongsTo'](db[_0x257b('0x10c')],{'as':_0x257b('0x16e'),'foreignKey':_0x257b('0x10f')});db[_0x257b('0x5e')][_0x257b('0x123')](db[_0x257b('0x8c')],{'through':'openchannel_interaction_has_tags','as':'Tags'});db[_0x257b('0x5e')][_0x257b('0x123')](db[_0x257b('0x8c')],{'through':'openchannel_interaction_has_tags','as':_0x257b('0x171')});db[_0x257b('0x5e')]['belongsToMany'](db[_0x257b('0x10c')],{'as':_0x257b('0x180'),'through':_0x257b('0x18f'),'foreignKey':'OpenchannelInteractionId'});db[_0x257b('0x5f')]['belongsTo'](db[_0x257b('0x10c')],{'onDelete':_0x257b('0x10e'),'as':'User'});db[_0x257b('0x5f')][_0x257b('0x121')](db[_0x257b('0x71')],{'onDelete':_0x257b('0x10e'),'as':_0x257b('0x15f')});db[_0x257b('0x5f')][_0x257b('0x121')](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x257b('0x174'),'foreignKey':_0x257b('0x18e')});db['OpenchannelMessage'][_0x257b('0x121')](db[_0x257b('0xe6')],{'as':_0x257b('0xe6'),'foreignKey':_0x257b('0x181')});db[_0x257b('0x5f')][_0x257b('0x121')](db['OpenchannelAccount'],{'as':_0x257b('0x17e'),'foreignKey':_0x257b('0x18c')});db[_0x257b('0x61')][_0x257b('0x123')](db[_0x257b('0x10c')],{'as':'Agents','through':_0x257b('0x36'),'foreignKey':'OpenchannelQueueId'});db[_0x257b('0x61')][_0x257b('0x123')](db[_0x257b('0xe1')],{'through':_0x257b('0x190'),'as':'Teams'});db[_0x257b('0x63')]['hasMany'](db[_0x257b('0x81')],{'as':_0x257b('0x166'),'foreignKey':_0x257b('0x175'),'onDelete':_0x257b('0x10e')});db['ChatWebsite'][_0x257b('0x113')](db[_0x257b('0x80')],{'as':_0x257b('0x167'),'foreignKey':_0x257b('0x175')});db[_0x257b('0x63')]['hasMany'](db[_0x257b('0x191')],{'as':_0x257b('0x192')});db['ChatWebsite'][_0x257b('0x113')](db[_0x257b('0x12c')],{'as':_0x257b('0x17c')});db[_0x257b('0x63')]['hasMany'](db['ChatApplication'],{'as':_0x257b('0x149'),'foreignKey':_0x257b('0x175'),'onDelete':'cascade'});db[_0x257b('0x63')][_0x257b('0x113')](db[_0x257b('0x68')],{'as':_0x257b('0x159')});db[_0x257b('0x63')][_0x257b('0x121')](db[_0x257b('0xf1')],{'as':_0x257b('0x168'),'foreignKey':'ListId'});db['ChatWebsite'][_0x257b('0x121')](db[_0x257b('0x153')],{'as':_0x257b('0x153'),'foreignKey':'IntervalId'});db[_0x257b('0x63')][_0x257b('0x121')](db[_0x257b('0x3b')],{'as':_0x257b('0x3b'),'foreignKey':'MailAccountId'});db[_0x257b('0x63')]['belongsTo'](db[_0x257b('0x86')],{'as':'mandatoryDispositionPause','foreignKey':_0x257b('0x16b')});db[_0x257b('0x63')][_0x257b('0x123')](db['User'],{'as':_0x257b('0x16c'),'through':_0x257b('0x13d')});db['OpenchannelQueueReport'][_0x257b('0x121')](db[_0x257b('0x18b')],{});db[_0x257b('0x65')][_0x257b('0x121')](db[_0x257b('0xf1')],{'as':_0x257b('0x168'),'foreignKey':'ListId'});db[_0x257b('0x65')][_0x257b('0x121')](db[_0x257b('0x71')],{'as':_0x257b('0x15f'),'foreignKey':_0x257b('0x160')});db[_0x257b('0x65')][_0x257b('0x121')](db[_0x257b('0x5e')],{});db[_0x257b('0x65')][_0x257b('0x121')](db[_0x257b('0x5f')],{});db[_0x257b('0x65')][_0x257b('0x121')](db[_0x257b('0x10c')],{});db[_0x257b('0x65')][_0x257b('0x121')](db[_0x257b('0x61')],{});db[_0x257b('0x66')][_0x257b('0x121')](db[_0x257b('0x10c')],{'as':_0x257b('0x193'),'foreignKey':'UserId','onDelete':_0x257b('0x177')});db[_0x257b('0x66')]['belongsTo'](db[_0x257b('0x6c')],{'as':_0x257b('0x194'),'foreignKey':_0x257b('0x195'),'onDelete':_0x257b('0x177')});db[_0x257b('0x66')][_0x257b('0x121')](db[_0x257b('0x63')],{'as':_0x257b('0x196'),'foreignKey':_0x257b('0x175'),'onDelete':_0x257b('0x177')});db['ChatApplication'][_0x257b('0x121')](db[_0x257b('0x8c')],{'onDelete':_0x257b('0x177'),'foreignKey':_0x257b('0x178')});db[_0x257b('0x12c')][_0x257b('0x113')](db['ChatMessage'],{'as':_0x257b('0x159'),'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x197')});db[_0x257b('0x12c')][_0x257b('0x121')](db[_0x257b('0x63')],{'as':_0x257b('0x17e'),'foreignKey':_0x257b('0x175')});db[_0x257b('0x12c')][_0x257b('0x121')](db[_0x257b('0x71')],{'as':'Contact','foreignKey':_0x257b('0x160')});db[_0x257b('0x12c')][_0x257b('0x121')](db[_0x257b('0x10c')],{'as':_0x257b('0x16e'),'foreignKey':'UserId'});db[_0x257b('0x12c')][_0x257b('0x123')](db[_0x257b('0x8c')],{'through':_0x257b('0x198'),'as':'Tags'});db[_0x257b('0x12c')][_0x257b('0x123')](db[_0x257b('0x8c')],{'through':'chat_interaction_has_tags','as':_0x257b('0x171')});db[_0x257b('0x12c')][_0x257b('0x123')](db[_0x257b('0x10c')],{'as':_0x257b('0x180'),'through':_0x257b('0x12d'),'foreignKey':_0x257b('0x197')});db[_0x257b('0x68')][_0x257b('0x121')](db[_0x257b('0x10c')],{'onDelete':_0x257b('0x10e'),'as':_0x257b('0x10c')});db[_0x257b('0x68')][_0x257b('0x121')](db[_0x257b('0x71')],{'onDelete':_0x257b('0x10e'),'as':_0x257b('0x15f'),'foreignKey':_0x257b('0x160')});db['ChatMessage'][_0x257b('0x121')](db['ChatInteraction'],{'onDelete':_0x257b('0x10e'),'as':_0x257b('0x174'),'foreignKey':_0x257b('0x197')});db[_0x257b('0x68')][_0x257b('0x121')](db['Attachment'],{'as':'Attachment','foreignKey':_0x257b('0x181')});db[_0x257b('0x68')][_0x257b('0x121')](db[_0x257b('0x63')],{'as':_0x257b('0x17e'),'foreignKey':_0x257b('0x175')});db[_0x257b('0x6a')]['hasMany'](db['Attachment'],{'as':_0x257b('0x173'),'foreignKey':_0x257b('0x176'),'onDelete':_0x257b('0x10e'),'hooks':!![]});db[_0x257b('0x6a')]['belongsTo'](db[_0x257b('0x71')],{'onDelete':_0x257b('0x10e'),'as':_0x257b('0x15f'),'foreignKey':'ContactId'});db['ChatOfflineMessage'][_0x257b('0x121')](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x257b('0x6c')]['belongsToMany'](db[_0x257b('0x10c')],{'as':_0x257b('0x16c'),'through':_0x257b('0x31'),'hooks':!![]});db['ChatQueue'][_0x257b('0x123')](db[_0x257b('0xe1')],{'through':'team_has_chat_queues','as':_0x257b('0x158')});db[_0x257b('0x124')][_0x257b('0x113')](db[_0x257b('0xcf')],{'as':_0x257b('0x159'),'foreignKey':_0x257b('0x199'),'onDelete':_0x257b('0x10e')});db[_0x257b('0x124')][_0x257b('0x123')](db[_0x257b('0x10c')],{'as':'Members','through':_0x257b('0x126')});db[_0x257b('0x191')][_0x257b('0x121')](db[_0x257b('0x63')],{'as':'Website','foreignKey':'ChatWebsiteId'});db['CmCompany']['hasMany'](db['CmContact'],{'as':_0x257b('0x127'),'foreignKey':_0x257b('0x19a')});db[_0x257b('0x71')][_0x257b('0x113')](db[_0x257b('0x8e')],{'as':'Phones','foreignKey':_0x257b('0x19b')});db[_0x257b('0x71')]['hasMany'](db[_0x257b('0x11f')],{'as':_0x257b('0x120'),'foreignKey':'ContactId'});db[_0x257b('0x71')][_0x257b('0x113')](db[_0x257b('0x115')],{'as':_0x257b('0x116'),'foreignKey':'ContactId'});db[_0x257b('0x71')][_0x257b('0x113')](db[_0x257b('0x77')],{'as':_0x257b('0x14d'),'foreignKey':'ContactId'});db[_0x257b('0x71')][_0x257b('0x113')](db[_0x257b('0x79')],{'as':_0x257b('0x79'),'foreignKey':'ContactId'});db['CmContact'][_0x257b('0x113')](db[_0x257b('0xd3')],{'as':'JscriptySessions','foreignKey':_0x257b('0x160')});db[_0x257b('0x71')][_0x257b('0x113')](db[_0x257b('0x5e')],{'as':'OpenchannelInteractions','foreignKey':_0x257b('0x160'),'onDelete':_0x257b('0x177')});db[_0x257b('0x71')][_0x257b('0x113')](db[_0x257b('0x12c')],{'as':_0x257b('0x119'),'foreignKey':_0x257b('0x160'),'onDelete':'restrict'});db[_0x257b('0x71')]['hasMany'](db[_0x257b('0x56')],{'as':_0x257b('0x12f'),'foreignKey':_0x257b('0x160'),'onDelete':_0x257b('0x177')});db[_0x257b('0x71')][_0x257b('0x113')](db[_0x257b('0x4e')],{'as':_0x257b('0x11a'),'foreignKey':'ContactId','onDelete':_0x257b('0x177')});db[_0x257b('0x71')][_0x257b('0x113')](db[_0x257b('0x11b')],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':_0x257b('0x177')});db[_0x257b('0x71')][_0x257b('0x121')](db[_0x257b('0x6f')],{'as':'Company','foreignKey':_0x257b('0x19a')});db[_0x257b('0x71')][_0x257b('0x121')](db[_0x257b('0xf1')],{'as':'List','foreignKey':'ListId','onDelete':_0x257b('0x10e')});db[_0x257b('0x71')][_0x257b('0x123')](db[_0x257b('0x10c')],{'as':_0x257b('0x180'),'through':'cm_user_has_contacts'});db[_0x257b('0x71')][_0x257b('0x123')](db[_0x257b('0x8c')],{'as':_0x257b('0x16f'),'through':'cm_contact_has_tags'});db['CmContact'][_0x257b('0x123')](db['Tag'],{'through':'cm_contact_has_tags','as':_0x257b('0x171')});db['CmHopper'][_0x257b('0x113')](db[_0x257b('0x19c')],{'as':_0x257b('0x19d'),'foreignKey':_0x257b('0x19e')});db[_0x257b('0x11f')][_0x257b('0x121')](db[_0x257b('0x71')],{'as':_0x257b('0x15f'),'foreignKey':_0x257b('0x160'),'onDelete':_0x257b('0x10e')});db[_0x257b('0x11f')][_0x257b('0x121')](db[_0x257b('0xf1')],{'as':_0x257b('0x168'),'foreignKey':'ListId','onDelete':_0x257b('0x10e')});db[_0x257b('0x11f')][_0x257b('0x121')](db[_0x257b('0x10c')],{'as':'Agent','foreignKey':_0x257b('0x10f')});db[_0x257b('0x11f')]['belongsTo'](db[_0x257b('0x1b')],{'as':'Queue','foreignKey':_0x257b('0x14c'),'onDelete':_0x257b('0x10e')});db[_0x257b('0x11f')]['belongsTo'](db[_0x257b('0xe3')],{'as':_0x257b('0xe3'),'foreignKey':_0x257b('0x19f'),'onDelete':_0x257b('0x10e')});db[_0x257b('0x11f')][_0x257b('0x121')](db[_0x257b('0x10c')],{'as':_0x257b('0x16e'),'foreignKey':_0x257b('0x1a0')});db[_0x257b('0x74')][_0x257b('0x121')](db[_0x257b('0x71')],{'as':'Contact','foreignKey':_0x257b('0x160'),'onDelete':_0x257b('0x10e')});db[_0x257b('0x74')][_0x257b('0x121')](db[_0x257b('0xf1')],{'as':_0x257b('0x168'),'foreignKey':_0x257b('0x179'),'onDelete':'cascade'});db[_0x257b('0x74')][_0x257b('0x121')](db[_0x257b('0x1b')],{'as':_0x257b('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db['CmHopperBlack'][_0x257b('0x121')](db['Campaign'],{'as':_0x257b('0xe3'),'foreignKey':'CampaignId','onDelete':_0x257b('0x10e')});db[_0x257b('0x7e')][_0x257b('0x113')](db[_0x257b('0x83')],{'as':{'plural':_0x257b('0x1a1'),'singular':_0x257b('0x1a2')},'foreignKey':_0x257b('0x1a3'),'onDelete':_0x257b('0x10e'),'hooks':!![]});db[_0x257b('0x7e')]['hasMany'](db[_0x257b('0x83')],{'as':{'plural':_0x257b('0x1a4'),'singular':'OneAny'},'foreignKey':_0x257b('0x1a5'),'onDelete':_0x257b('0x10e'),'hooks':!![]});db[_0x257b('0x7e')][_0x257b('0x113')](db[_0x257b('0x7c')],{'as':_0x257b('0x1a6'),'foreignKey':_0x257b('0x1a7'),'onDelete':'cascade','hooks':!![]});db[_0x257b('0x81')][_0x257b('0x113')](db[_0x257b('0x81')],{'as':_0x257b('0x166'),'foreignKey':_0x257b('0x1a8'),'onDelete':'cascade'});db['Interval'][_0x257b('0x113')](db['Interval'],{'as':_0x257b('0x1a9'),'foreignKey':_0x257b('0x154'),'onDelete':_0x257b('0x10e'),'hooks':!![],'required':![]});db[_0x257b('0x153')][_0x257b('0x113')](db[_0x257b('0x18')],{'as':_0x257b('0x114'),'foreignKey':'IntervalId','onDelete':_0x257b('0x177')});db[_0x257b('0x153')]['hasMany'](db[_0x257b('0x43')],{'as':'MailApplications','foreignKey':_0x257b('0x154')});db[_0x257b('0x153')][_0x257b('0x113')](db[_0x257b('0x66')],{'as':_0x257b('0x1aa'),'foreignKey':_0x257b('0x154')});db[_0x257b('0x153')][_0x257b('0x113')](db[_0x257b('0x4c')],{'as':'FaxApplications','foreignKey':_0x257b('0x154')});db[_0x257b('0x153')][_0x257b('0x113')](db[_0x257b('0x185')],{'as':_0x257b('0x1ab'),'foreignKey':_0x257b('0x154')});db['Schedule'][_0x257b('0x121')](db[_0x257b('0x3b')],{});db[_0x257b('0x89')][_0x257b('0x121')](db[_0x257b('0x98')],{'foreignKey':'DefaultReportId'});db[_0x257b('0x89')][_0x257b('0x121')](db[_0x257b('0x96')],{'foreignKey':_0x257b('0x1ac')});db[_0x257b('0x8b')]['belongsToMany'](db[_0x257b('0x19')],{'as':_0x257b('0x1ad'),'through':_0x257b('0x14b'),'onDelete':_0x257b('0x177')});db[_0x257b('0x8c')]['belongsToMany'](db[_0x257b('0x71')],{'through':_0x257b('0x1ae')});db[_0x257b('0x8c')][_0x257b('0x123')](db[_0x257b('0x12c')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x257b('0x123')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db[_0x257b('0x8c')][_0x257b('0x123')](db['SmsInteraction'],{'through':_0x257b('0x187')});db[_0x257b('0x8c')][_0x257b('0x123')](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0x257b('0x5e')],{'through':_0x257b('0x1af')});db[_0x257b('0x8c')][_0x257b('0x123')](db['WhatsappInteraction'],{'through':_0x257b('0x1b0')});db[_0x257b('0x8e')][_0x257b('0x121')](db[_0x257b('0x8d')],{'as':_0x257b('0x1b1'),'foreignKey':_0x257b('0x1b2')});db[_0x257b('0x19c')]['belongsTo'](db['CmHopper'],{'as':_0x257b('0x1b3'),'foreignKey':'CmHopperId'});db['CmContactHasItem']['belongsTo'](db[_0x257b('0x71')],{'as':_0x257b('0x15f'),'foreignKey':_0x257b('0x19b')});db[_0x257b('0x91')][_0x257b('0x113')](db[_0x257b('0x83')],{'as':{'plural':_0x257b('0x1b4'),'singular':'AllCondition'},'foreignKey':_0x257b('0x1b5'),'onDelete':'cascade','hooks':!![]});db[_0x257b('0x91')][_0x257b('0x113')](db[_0x257b('0x83')],{'as':{'plural':'AnyConditions','singular':_0x257b('0x1b6')},'foreignKey':'TriggerAnyId','onDelete':_0x257b('0x10e'),'hooks':!![]});db[_0x257b('0x91')][_0x257b('0x113')](db['Action'],{'as':_0x257b('0x1a6'),'foreignKey':'TriggerId','onDelete':_0x257b('0x10e'),'hooks':!![]});db[_0x257b('0x96')][_0x257b('0x113')](db['AnalyticFieldReport'],{'as':_0x257b('0x1b7'),'onDelete':'cascade','foreignKey':_0x257b('0x1ac'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db['AnalyticFieldReport'],{'as':_0x257b('0x1b7'),'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1b8')});db[_0x257b('0x9b')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x257b('0x1b7'),'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1b9')});db['AnalyticFieldReport'][_0x257b('0x121')](db[_0x257b('0x9b')],{'foreignKey':_0x257b('0x1b9')});db[_0x257b('0x1ba')][_0x257b('0x113')](db[_0x257b('0xa1')],{'as':_0x257b('0x1bb'),'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1bc')});db[_0x257b('0xa1')]['hasMany'](db[_0x257b('0xa3')],{'as':_0x257b('0x1bd'),'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1be')});db[_0x257b('0xa1')][_0x257b('0x113')](db[_0x257b('0xa3')],{'as':_0x257b('0x1bf'),'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1c0')});db[_0x257b('0xa1')][_0x257b('0x113')](db['SalesforceField'],{'as':'Fields','onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1c1')});db['SalesforceConfiguration']['belongsTo'](db[_0x257b('0x1ba')],{'as':_0x257b('0x17e'),'foreignKey':_0x257b('0x1bc')});db[_0x257b('0xa3')][_0x257b('0x113')](db[_0x257b('0xa3')],{'as':_0x257b('0x1c2'),'foreignKey':_0x257b('0x1be')});db[_0x257b('0xa3')][_0x257b('0x113')](db['SalesforceField'],{'as':_0x257b('0x1c3'),'foreignKey':_0x257b('0x1c0')});db[_0x257b('0xa3')]['hasMany'](db[_0x257b('0xa3')],{'as':_0x257b('0x1c4'),'foreignKey':_0x257b('0x1c1')});db['SalesforceField']['belongsTo'](db[_0x257b('0x1c5')],{'as':_0x257b('0x1c5'),'foreignKey':_0x257b('0x1c6')});db[_0x257b('0xa4')][_0x257b('0x113')](db[_0x257b('0x1c7')],{'as':_0x257b('0x1bb'),'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1bc')});db[_0x257b('0x1c7')]['hasMany'](db[_0x257b('0x1c8')],{'as':_0x257b('0x1bd'),'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1be')});db[_0x257b('0x1c7')][_0x257b('0x113')](db[_0x257b('0x1c8')],{'as':'Descriptions','onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1c0')});db['SugarcrmConfiguration']['hasMany'](db[_0x257b('0x1c8')],{'as':_0x257b('0x1b7'),'onDelete':_0x257b('0x10e'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0x257b('0x121')](db['SugarcrmAccount'],{'as':_0x257b('0x17e'),'foreignKey':_0x257b('0x1bc')});db[_0x257b('0x1c8')][_0x257b('0x113')](db['SugarcrmField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x257b('0x1c8')][_0x257b('0x113')](db[_0x257b('0x1c8')],{'as':_0x257b('0x1c3'),'foreignKey':_0x257b('0x1c0')});db[_0x257b('0x1c8')][_0x257b('0x113')](db[_0x257b('0x1c8')],{'as':_0x257b('0x1c4'),'foreignKey':'FieldId'});db[_0x257b('0x1c8')][_0x257b('0x121')](db[_0x257b('0x1c5')],{'as':_0x257b('0x1c5'),'foreignKey':_0x257b('0x1c6')});db['DeskAccount'][_0x257b('0x113')](db[_0x257b('0xa9')],{'as':'Configurations','onDelete':_0x257b('0x10e'),'foreignKey':'AccountId'});db[_0x257b('0xa9')][_0x257b('0x113')](db[_0x257b('0xab')],{'as':_0x257b('0x1bd'),'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1be')});db[_0x257b('0xa9')][_0x257b('0x113')](db[_0x257b('0xab')],{'as':_0x257b('0x1bf'),'onDelete':_0x257b('0x10e'),'foreignKey':'DescriptionId'});db[_0x257b('0xa9')][_0x257b('0x113')](db[_0x257b('0xab')],{'as':_0x257b('0x1b7'),'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1c1')});db[_0x257b('0xa9')][_0x257b('0x121')](db[_0x257b('0xa7')],{'as':_0x257b('0x17e'),'foreignKey':_0x257b('0x1bc')});db[_0x257b('0xa9')]['belongsToMany'](db[_0x257b('0x8c')],{'through':_0x257b('0x1c9')});db[_0x257b('0xab')]['hasMany'](db[_0x257b('0xab')],{'as':'Subject','foreignKey':_0x257b('0x1be')});db[_0x257b('0xab')]['hasMany'](db[_0x257b('0xab')],{'as':'Description','foreignKey':_0x257b('0x1c0')});db['DeskField']['hasMany'](db[_0x257b('0xab')],{'as':_0x257b('0x1c4'),'foreignKey':_0x257b('0x1c1')});db['DeskField'][_0x257b('0x121')](db[_0x257b('0x1c5')],{'as':_0x257b('0x1c5'),'foreignKey':'VariableId'});db['ZohoAccount']['hasMany'](db[_0x257b('0xae')],{'as':_0x257b('0x1bb'),'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1bc')});db[_0x257b('0xae')][_0x257b('0x113')](db[_0x257b('0xb0')],{'as':_0x257b('0x1bd'),'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1be')});db[_0x257b('0xae')][_0x257b('0x113')](db['ZohoField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x257b('0x1c0')});db[_0x257b('0xae')][_0x257b('0x113')](db[_0x257b('0xb0')],{'as':'Fields','onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1c1')});db[_0x257b('0xae')][_0x257b('0x121')](db[_0x257b('0xac')],{'as':_0x257b('0x17e'),'foreignKey':_0x257b('0x1bc')});db[_0x257b('0xb0')][_0x257b('0x113')](db[_0x257b('0xb0')],{'as':_0x257b('0x1c2'),'foreignKey':_0x257b('0x1be')});db['ZohoField'][_0x257b('0x113')](db[_0x257b('0xb0')],{'as':_0x257b('0x1c3'),'foreignKey':_0x257b('0x1c0')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':'Field','foreignKey':_0x257b('0x1c1')});db[_0x257b('0xb0')][_0x257b('0x121')](db['Variable'],{'as':_0x257b('0x1c5'),'foreignKey':_0x257b('0x1c6')});db['ZendeskAccount'][_0x257b('0x113')](db[_0x257b('0x1ca')],{'as':_0x257b('0x1bb'),'onDelete':'cascade','foreignKey':_0x257b('0x1bc')});db[_0x257b('0x1ca')][_0x257b('0x113')](db[_0x257b('0xb3')],{'as':'Subjects','foreignKey':_0x257b('0x1be')});db[_0x257b('0x1ca')][_0x257b('0x113')](db['ZendeskField'],{'as':_0x257b('0x1bf'),'foreignKey':'DescriptionId'});db[_0x257b('0x1ca')][_0x257b('0x113')](db['ZendeskField'],{'as':_0x257b('0x1b7'),'foreignKey':_0x257b('0x1c1')});db[_0x257b('0x1ca')][_0x257b('0x121')](db['ZendeskAccount'],{'as':'Account','foreignKey':_0x257b('0x1bc')});db[_0x257b('0x1ca')][_0x257b('0x123')](db[_0x257b('0x8c')],{'through':_0x257b('0x1cb')});db['ZendeskField']['hasMany'](db['ZendeskField'],{'as':_0x257b('0x1c2'),'foreignKey':'SubjectId'});db[_0x257b('0xb3')][_0x257b('0x113')](db[_0x257b('0xb3')],{'as':_0x257b('0x1c3'),'foreignKey':'DescriptionId'});db[_0x257b('0xb3')][_0x257b('0x113')](db['ZendeskField'],{'as':_0x257b('0x1c4'),'foreignKey':_0x257b('0x1c1')});db[_0x257b('0xb3')][_0x257b('0x121')](db[_0x257b('0x1c5')],{'as':_0x257b('0x1c5'),'foreignKey':'VariableId'});db[_0x257b('0xb4')]['hasMany'](db[_0x257b('0xb6')],{'as':_0x257b('0x1bb'),'onDelete':'cascade','foreignKey':'AccountId'});db['FreshdeskConfiguration']['hasMany'](db[_0x257b('0xb8')],{'as':'Subjects','onDelete':_0x257b('0x10e'),'foreignKey':'SubjectId'});db[_0x257b('0xb6')]['hasMany'](db[_0x257b('0xb8')],{'as':_0x257b('0x1bf'),'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1c0')});db['FreshdeskConfiguration'][_0x257b('0x113')](db[_0x257b('0xb8')],{'as':_0x257b('0x1b7'),'onDelete':'cascade','foreignKey':_0x257b('0x1c1')});db[_0x257b('0xb6')][_0x257b('0x121')](db[_0x257b('0xb4')],{'as':_0x257b('0x17e'),'foreignKey':_0x257b('0x1bc')});db[_0x257b('0xb6')][_0x257b('0x123')](db[_0x257b('0x8c')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x257b('0xb8')]['hasMany'](db['FreshdeskField'],{'as':_0x257b('0x1c2'),'foreignKey':_0x257b('0x1be')});db[_0x257b('0xb8')][_0x257b('0x113')](db[_0x257b('0xb8')],{'as':_0x257b('0x1c3'),'foreignKey':_0x257b('0x1c0')});db[_0x257b('0xb8')][_0x257b('0x113')](db[_0x257b('0xb8')],{'as':_0x257b('0x1c4'),'foreignKey':_0x257b('0x1c1')});db[_0x257b('0xb8')]['belongsTo'](db['Variable'],{'as':_0x257b('0x1c5'),'foreignKey':'VariableId'});db[_0x257b('0xb9')]['hasMany'](db[_0x257b('0x1cc')],{'as':'Configurations','onDelete':_0x257b('0x10e'),'foreignKey':'AccountId'});db[_0x257b('0x1cc')][_0x257b('0x113')](db['VtigerField'],{'as':_0x257b('0x1bd'),'foreignKey':_0x257b('0x1be')});db[_0x257b('0x1cc')][_0x257b('0x113')](db[_0x257b('0xbb')],{'as':_0x257b('0x1bf'),'foreignKey':_0x257b('0x1c0')});db[_0x257b('0x1cc')][_0x257b('0x113')](db[_0x257b('0xbb')],{'as':_0x257b('0x1b7'),'foreignKey':_0x257b('0x1c1')});db[_0x257b('0x1cc')][_0x257b('0x121')](db[_0x257b('0xb9')],{'as':'Account','foreignKey':_0x257b('0x1bc')});db['VtigerField'][_0x257b('0x113')](db[_0x257b('0xbb')],{'as':_0x257b('0x1c2'),'foreignKey':'SubjectId'});db[_0x257b('0xbb')][_0x257b('0x113')](db[_0x257b('0xbb')],{'as':_0x257b('0x1c3'),'foreignKey':'DescriptionId'});db[_0x257b('0xbb')]['hasMany'](db[_0x257b('0xbb')],{'as':'Field','foreignKey':_0x257b('0x1c1')});db[_0x257b('0xbb')][_0x257b('0x121')](db[_0x257b('0x1c5')],{'as':_0x257b('0x1c5'),'foreignKey':_0x257b('0x1c6')});db[_0x257b('0x1cd')][_0x257b('0x113')](db[_0x257b('0xbe')],{'as':_0x257b('0x1bb'),'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1bc')});db[_0x257b('0xbe')]['hasMany'](db['ServicenowField'],{'as':_0x257b('0x1bd'),'foreignKey':_0x257b('0x1be')});db[_0x257b('0xbe')][_0x257b('0x113')](db[_0x257b('0x1ce')],{'as':_0x257b('0x1bf'),'foreignKey':_0x257b('0x1c0')});db['ServicenowConfiguration']['hasMany'](db[_0x257b('0x1ce')],{'as':'Fields','foreignKey':'FieldId'});db[_0x257b('0xbe')][_0x257b('0x121')](db[_0x257b('0x1cd')],{'as':_0x257b('0x17e'),'foreignKey':_0x257b('0x1bc')});db[_0x257b('0x1ce')][_0x257b('0x113')](db[_0x257b('0x1ce')],{'as':'Subject','foreignKey':_0x257b('0x1be')});db['ServicenowField'][_0x257b('0x113')](db[_0x257b('0x1ce')],{'as':_0x257b('0x1c3'),'foreignKey':_0x257b('0x1c0')});db[_0x257b('0x1ce')][_0x257b('0x113')](db[_0x257b('0x1ce')],{'as':_0x257b('0x1c4'),'foreignKey':_0x257b('0x1c1')});db[_0x257b('0x1ce')][_0x257b('0x121')](db[_0x257b('0x1c5')],{'as':_0x257b('0x1c5'),'foreignKey':'VariableId'});db[_0x257b('0xc1')]['hasMany'](db[_0x257b('0x1cf')],{'as':'Configurations','onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1bc')});db['Dynamics365Account'][_0x257b('0x121')](db['CloudProvider'],{'as':_0x257b('0x162'),'foreignKey':_0x257b('0x163')});db[_0x257b('0x1cf')][_0x257b('0x113')](db[_0x257b('0xc4')],{'as':_0x257b('0x1bd'),'onDelete':'cascade','foreignKey':_0x257b('0x1be')});db['Dynamics365Configuration'][_0x257b('0x113')](db[_0x257b('0xc4')],{'as':'Descriptions','onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1c0')});db[_0x257b('0x1cf')]['hasMany'](db[_0x257b('0xc4')],{'as':_0x257b('0x1b7'),'onDelete':'cascade','foreignKey':_0x257b('0x1c1')});db['Dynamics365Configuration']['belongsTo'](db[_0x257b('0xc1')],{'as':_0x257b('0x17e'),'foreignKey':_0x257b('0x1bc')});db[_0x257b('0xc4')][_0x257b('0x113')](db[_0x257b('0xc4')],{'as':'Subject','foreignKey':_0x257b('0x1be')});db[_0x257b('0xc4')]['hasMany'](db['Dynamics365Field'],{'as':_0x257b('0x1c3'),'foreignKey':_0x257b('0x1c0')});db[_0x257b('0xc4')]['hasMany'](db[_0x257b('0xc4')],{'as':_0x257b('0x1c4'),'foreignKey':'FieldId'});db['Dynamics365Field'][_0x257b('0x121')](db[_0x257b('0x1c5')],{'as':_0x257b('0x1c5'),'foreignKey':_0x257b('0x1c6')});db[_0x257b('0xc6')][_0x257b('0x113')](db[_0x257b('0xc8')],{'as':_0x257b('0x1bb'),'onDelete':'cascade','foreignKey':_0x257b('0x1bc')});db['FreshsalesConfiguration'][_0x257b('0x113')](db['FreshsalesField'],{'as':_0x257b('0x1bd'),'foreignKey':'SubjectId'});db[_0x257b('0xc8')][_0x257b('0x113')](db['FreshsalesField'],{'as':_0x257b('0x1bf'),'foreignKey':_0x257b('0x1c0')});db['FreshsalesConfiguration']['hasMany'](db[_0x257b('0xc9')],{'as':_0x257b('0x1b7'),'foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0x257b('0x121')](db['FreshsalesAccount'],{'as':'Account','foreignKey':_0x257b('0x1bc')});db[_0x257b('0xc9')][_0x257b('0x113')](db[_0x257b('0xc9')],{'as':_0x257b('0x1c2'),'foreignKey':_0x257b('0x1be')});db[_0x257b('0xc9')][_0x257b('0x113')](db[_0x257b('0xc9')],{'as':_0x257b('0x1c3'),'foreignKey':_0x257b('0x1c0')});db[_0x257b('0xc9')][_0x257b('0x113')](db['FreshsalesField'],{'as':_0x257b('0x1c4'),'foreignKey':_0x257b('0x1c1')});db[_0x257b('0xc9')][_0x257b('0x121')](db[_0x257b('0x1c5')],{'as':_0x257b('0x1c5'),'foreignKey':_0x257b('0x1c6')});db['ChatQueueReport'][_0x257b('0x121')](db['ChatWebsite'],{});db[_0x257b('0x1d0')][_0x257b('0x121')](db[_0x257b('0xf1')],{'as':_0x257b('0x168'),'foreignKey':'ListId'});db[_0x257b('0x1d0')][_0x257b('0x121')](db[_0x257b('0x71')],{'as':_0x257b('0x15f'),'foreignKey':_0x257b('0x160')});db[_0x257b('0x1d0')][_0x257b('0x121')](db[_0x257b('0x12c')],{});db['ChatQueueReport']['belongsTo'](db[_0x257b('0x68')],{});db[_0x257b('0x1d0')]['belongsTo'](db[_0x257b('0x10c')],{});db['ChatQueueReport'][_0x257b('0x121')](db[_0x257b('0x6c')],{});db[_0x257b('0xcf')][_0x257b('0x121')](db[_0x257b('0x10c')],{'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1d1')});db[_0x257b('0xcf')][_0x257b('0x121')](db[_0x257b('0x10c')],{'onDelete':_0x257b('0x10e'),'foreignKey':'ToId'});db[_0x257b('0xd3')][_0x257b('0x113')](db[_0x257b('0xd2')],{'foreignKey':_0x257b('0x1d2'),'onDelete':_0x257b('0x10e')});db[_0x257b('0xd3')][_0x257b('0x113')](db[_0x257b('0xd1')],{'foreignKey':_0x257b('0x1d2'),'onDelete':_0x257b('0x10e')});db[_0x257b('0xd5')][_0x257b('0x121')](db[_0x257b('0x144')],{});db['SmsQueueReport'][_0x257b('0x121')](db['CmList'],{'as':'List','foreignKey':'ListId'});db['SmsQueueReport'][_0x257b('0x121')](db['CmContact'],{'as':'Contact','foreignKey':_0x257b('0x160')});db[_0x257b('0xd5')]['belongsTo'](db['SmsInteraction'],{});db['SmsQueueReport']['belongsTo'](db[_0x257b('0x58')],{});db['SmsQueueReport'][_0x257b('0x121')](db[_0x257b('0x10c')],{});db[_0x257b('0xd5')][_0x257b('0x121')](db[_0x257b('0x189')],{});db['JscriptyProject'][_0x257b('0x113')](db[_0x257b('0xd3')],{'foreignKey':_0x257b('0x1d3')});db['JscriptyProject']['hasMany'](db[_0x257b('0xd2')],{'foreignKey':_0x257b('0x1d3')});db[_0x257b('0x1d4')][_0x257b('0x113')](db[_0x257b('0xd1')],{'foreignKey':_0x257b('0x1d3')});db['Team'][_0x257b('0x123')](db[_0x257b('0x10c')],{'as':_0x257b('0x16c'),'through':_0x257b('0x12a')});db[_0x257b('0xe1')][_0x257b('0x123')](db[_0x257b('0x1b')],{'through':_0x257b('0x106'),'as':_0x257b('0x132')});db['Team'][_0x257b('0x123')](db['MailQueue'],{'through':_0x257b('0x16d'),'as':'MailQueues'});db[_0x257b('0xe1')]['belongsToMany'](db[_0x257b('0x6c')],{'through':_0x257b('0x1d5'),'as':'ChatQueues'});db[_0x257b('0xe1')][_0x257b('0x123')](db['FaxQueue'],{'through':_0x257b('0x1d6'),'as':'FaxQueues'});db[_0x257b('0xe1')][_0x257b('0x123')](db[_0x257b('0x189')],{'through':_0x257b('0x18a'),'as':'SmsQueues'});db['Team'][_0x257b('0x123')](db['OpenchannelQueue'],{'through':_0x257b('0x190'),'as':'OpenchannelQueues'});db[_0x257b('0xe1')]['belongsToMany'](db[_0x257b('0x13b')],{'through':_0x257b('0x1d7'),'as':_0x257b('0x1d8')});db['Team'][_0x257b('0x123')](db[_0x257b('0x133')],{'through':_0x257b('0x1d9'),'as':_0x257b('0x134')});db['Campaign'][_0x257b('0x113')](db['CmHopper'],{'as':_0x257b('0x120'),'foreignKey':_0x257b('0x19f')});db[_0x257b('0xe3')][_0x257b('0x113')](db[_0x257b('0x115')],{'as':_0x257b('0x116'),'foreignKey':_0x257b('0x19f')});db[_0x257b('0xe3')][_0x257b('0x113')](db[_0x257b('0x77')],{'as':_0x257b('0x14d'),'foreignKey':_0x257b('0x19f')});db[_0x257b('0xe3')][_0x257b('0x113')](db[_0x257b('0x74')],{'as':_0x257b('0x14e'),'foreignKey':_0x257b('0x19f')});db[_0x257b('0xe3')][_0x257b('0x121')](db[_0x257b('0x2b')],{'as':_0x257b('0x2b'),'foreignKey':_0x257b('0x150')});db[_0x257b('0xe3')][_0x257b('0x121')](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0x257b('0x152')});db['Campaign']['belongsTo'](db[_0x257b('0x153')],{'as':_0x257b('0x153'),'foreignKey':_0x257b('0x154')});db[_0x257b('0xe3')]['belongsTo'](db['SquareProject'],{'as':_0x257b('0xdc'),'foreignKey':_0x257b('0x1da')});db[_0x257b('0xe3')][_0x257b('0x123')](db[_0x257b('0xf1')],{'as':_0x257b('0x156'),'through':_0x257b('0x1db')});db['Campaign'][_0x257b('0x123')](db[_0x257b('0xf1')],{'as':_0x257b('0x1dc'),'through':_0x257b('0x1dd')});db[_0x257b('0xe6')][_0x257b('0x121')](db[_0x257b('0x6a')],{'as':_0x257b('0x6a'),'foreignKey':'ChatOfflineMessageId'});db['MailTransferReport'][_0x257b('0x121')](db['MailMessage'],{});db[_0x257b('0x1de')][_0x257b('0x121')](db[_0x257b('0x11b')],{});db[_0x257b('0x1de')]['belongsTo'](db[_0x257b('0x3b')],{'foreignKey':_0x257b('0x1df'),'as':_0x257b('0x1e0')});db[_0x257b('0x1de')][_0x257b('0x121')](db[_0x257b('0x10c')],{'foreignKey':_0x257b('0x1e1'),'as':_0x257b('0x1e2')});db['MailTransferReport'][_0x257b('0x121')](db[_0x257b('0x10c')],{'foreignKey':_0x257b('0x1e3'),'as':_0x257b('0x1e4')});db[_0x257b('0x1de')][_0x257b('0x121')](db[_0x257b('0x3d')],{'foreignKey':'ToMailQueueId','as':_0x257b('0x1e5')});db[_0x257b('0x1de')]['belongsTo'](db[_0x257b('0x3b')],{'foreignKey':_0x257b('0x1e6'),'as':'ToAccount'});db['ChatTransferReport']['belongsTo'](db['ChatMessage'],{});db[_0x257b('0xeb')]['belongsTo'](db[_0x257b('0x12c')],{});db[_0x257b('0xeb')]['belongsTo'](db[_0x257b('0x63')],{'foreignKey':_0x257b('0x1e7'),'as':'FromAccount'});db['ChatTransferReport'][_0x257b('0x121')](db['User'],{'foreignKey':_0x257b('0x1e1'),'as':_0x257b('0x1e2')});db[_0x257b('0xeb')][_0x257b('0x121')](db[_0x257b('0x10c')],{'foreignKey':_0x257b('0x1e3'),'as':_0x257b('0x1e4')});db[_0x257b('0xeb')][_0x257b('0x121')](db[_0x257b('0x6c')],{'foreignKey':_0x257b('0x1e8'),'as':_0x257b('0x1e5')});db[_0x257b('0xeb')]['belongsTo'](db[_0x257b('0x63')],{'foreignKey':'ToChatWebsiteId','as':_0x257b('0x1e9')});db[_0x257b('0xed')][_0x257b('0x121')](db[_0x257b('0x50')],{});db['FaxTransferReport'][_0x257b('0x121')](db[_0x257b('0x4e')],{});db[_0x257b('0xed')][_0x257b('0x121')](db[_0x257b('0x4a')],{'foreignKey':_0x257b('0x1ea'),'as':_0x257b('0x1e0')});db[_0x257b('0xed')]['belongsTo'](db[_0x257b('0x10c')],{'foreignKey':_0x257b('0x1e1'),'as':_0x257b('0x1e2')});db[_0x257b('0xed')][_0x257b('0x121')](db[_0x257b('0x10c')],{'foreignKey':_0x257b('0x1e3'),'as':'ToAgent'});db[_0x257b('0xed')][_0x257b('0x121')](db[_0x257b('0x182')],{'foreignKey':_0x257b('0x1eb'),'as':_0x257b('0x1e5')});db[_0x257b('0xed')]['belongsTo'](db[_0x257b('0x4a')],{'foreignKey':_0x257b('0x1ec'),'as':_0x257b('0x1e9')});db[_0x257b('0xee')][_0x257b('0x121')](db[_0x257b('0x5f')],{});db[_0x257b('0xee')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x257b('0xee')][_0x257b('0x121')](db[_0x257b('0x18b')],{'foreignKey':_0x257b('0x1ed'),'as':'FromAccount'});db[_0x257b('0xee')][_0x257b('0x121')](db['User'],{'foreignKey':_0x257b('0x1e1'),'as':_0x257b('0x1e2')});db[_0x257b('0xee')][_0x257b('0x121')](db[_0x257b('0x10c')],{'foreignKey':_0x257b('0x1e3'),'as':'ToAgent'});db[_0x257b('0xee')]['belongsTo'](db[_0x257b('0x61')],{'foreignKey':_0x257b('0x1ee'),'as':_0x257b('0x1e5')});db[_0x257b('0xee')][_0x257b('0x121')](db[_0x257b('0x18b')],{'foreignKey':_0x257b('0x1ef'),'as':_0x257b('0x1e9')});db[_0x257b('0x1f0')][_0x257b('0x121')](db[_0x257b('0x58')],{});db[_0x257b('0x1f0')][_0x257b('0x121')](db[_0x257b('0x56')],{});db[_0x257b('0x1f0')][_0x257b('0x121')](db[_0x257b('0x144')],{'foreignKey':_0x257b('0x1f1'),'as':_0x257b('0x1e0')});db['SmsTransferReport'][_0x257b('0x121')](db[_0x257b('0x10c')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x257b('0x1f0')]['belongsTo'](db[_0x257b('0x10c')],{'foreignKey':'ToUserId','as':_0x257b('0x1e4')});db['SmsTransferReport'][_0x257b('0x121')](db['SmsQueue'],{'foreignKey':_0x257b('0x1f2'),'as':_0x257b('0x1e5')});db[_0x257b('0x1f0')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x257b('0x1f3'),'as':_0x257b('0x1e9')});db[_0x257b('0xf1')]['hasMany'](db[_0x257b('0x81')],{'as':_0x257b('0x166'),'foreignKey':_0x257b('0x179'),'onDelete':_0x257b('0x10e')});db[_0x257b('0xf1')][_0x257b('0x113')](db['CmCustomField'],{'as':_0x257b('0x1f4'),'foreignKey':_0x257b('0x179')});db['CmList']['hasMany'](db['CmContact'],{'as':_0x257b('0x127'),'onDelete':_0x257b('0x10e'),'foreignKey':'ListId'});db[_0x257b('0xf1')][_0x257b('0x113')](db['CmHopperFinal'],{'as':_0x257b('0x116'),'foreignKey':_0x257b('0x179')});db['CmList'][_0x257b('0x113')](db[_0x257b('0x77')],{'as':_0x257b('0x117'),'foreignKey':_0x257b('0x179')});db[_0x257b('0xf1')][_0x257b('0x113')](db[_0x257b('0x79')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0x257b('0xf1')][_0x257b('0x123')](db['VoiceQueue'],{'as':_0x257b('0x1f5'),'through':_0x257b('0x157')});db['CmList'][_0x257b('0x123')](db[_0x257b('0x10c')],{'as':_0x257b('0x16c'),'through':'cm_user_has_lists'});db[_0x257b('0x133')][_0x257b('0x113')](db['VoiceExtension'],{'as':_0x257b('0x114'),'onDelete':_0x257b('0x10e')});db['VoicePrefix'][_0x257b('0x123')](db['User'],{'as':_0x257b('0x16c'),'through':'UserVoicePrefix'});db[_0x257b('0x133')][_0x257b('0x123')](db[_0x257b('0xe1')],{'through':_0x257b('0x1d9'),'as':_0x257b('0x158')});db[_0x257b('0xf4')]['hasMany'](db[_0x257b('0x10c')],{'as':_0x257b('0x180'),'foreignKey':_0x257b('0x122')});db[_0x257b('0xf4')][_0x257b('0x113')](db['UserProfileSection'],{'as':_0x257b('0x1f6'),'foreignKey':_0x257b('0x122'),'onDelete':_0x257b('0x10e')});db[_0x257b('0xf5')][_0x257b('0x113')](db[_0x257b('0xf7')],{'as':_0x257b('0x1f7'),'foreignKey':_0x257b('0x1f8'),'onDelete':_0x257b('0x10e')});db[_0x257b('0xfb')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0x257b('0x1f9'),'onDelete':_0x257b('0x10e')});db[_0x257b('0xfb')][_0x257b('0x113')](db[_0x257b('0x80')],{'as':_0x257b('0x167'),'foreignKey':_0x257b('0x1f9')});db['WhatsappAccount'][_0x257b('0x113')](db[_0x257b('0xfe')],{'as':_0x257b('0x159'),'foreignKey':'WhatsappAccountId'});db[_0x257b('0xfb')][_0x257b('0x113')](db[_0x257b('0xfd')],{'as':_0x257b('0x17c')});db[_0x257b('0xfb')][_0x257b('0x113')](db[_0x257b('0x1fa')],{'as':_0x257b('0x149'),'foreignKey':_0x257b('0x1f9'),'onDelete':_0x257b('0x10e')});db[_0x257b('0xfb')]['belongsTo'](db[_0x257b('0xf1')],{'as':_0x257b('0x168'),'foreignKey':_0x257b('0x179')});db[_0x257b('0xfb')]['belongsTo'](db[_0x257b('0x86')],{'as':_0x257b('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x257b('0xfb')]['belongsToMany'](db[_0x257b('0x10c')],{'as':_0x257b('0x16c'),'through':_0x257b('0x147')});db[_0x257b('0x1fa')][_0x257b('0x121')](db[_0x257b('0x10c')],{'onDelete':'restrict'});db[_0x257b('0x1fa')][_0x257b('0x121')](db[_0x257b('0x13b')],{'onDelete':_0x257b('0x177')});db[_0x257b('0x1fa')][_0x257b('0x121')](db['WhatsappAccount'],{'onDelete':_0x257b('0x177')});db[_0x257b('0x1fa')]['belongsTo'](db[_0x257b('0x153')],{'onDelete':_0x257b('0x177'),'foreignKey':'IntervalId'});db['WhatsappApplication'][_0x257b('0x121')](db[_0x257b('0x8c')],{'onDelete':_0x257b('0x177'),'foreignKey':_0x257b('0x178')});db[_0x257b('0xfd')][_0x257b('0x113')](db[_0x257b('0xfe')],{'as':_0x257b('0x159'),'onDelete':_0x257b('0x10e'),'foreignKey':_0x257b('0x1fb')});db[_0x257b('0xfd')][_0x257b('0x121')](db[_0x257b('0xfb')],{'as':_0x257b('0x17e'),'foreignKey':_0x257b('0x1f9')});db[_0x257b('0xfd')]['belongsTo'](db[_0x257b('0x71')],{'as':'Contact','foreignKey':_0x257b('0x160')});db['WhatsappInteraction'][_0x257b('0x121')](db[_0x257b('0x10c')],{'as':_0x257b('0x16e'),'foreignKey':'UserId'});db['WhatsappInteraction'][_0x257b('0x123')](db['Tag'],{'through':_0x257b('0x1b0'),'as':_0x257b('0x16f')});db[_0x257b('0xfd')][_0x257b('0x123')](db[_0x257b('0x8c')],{'through':_0x257b('0x1b0'),'as':'ThroughTags'});db[_0x257b('0xfd')][_0x257b('0x123')](db[_0x257b('0x10c')],{'as':_0x257b('0x180'),'through':_0x257b('0x131'),'foreignKey':'WhatsappInteractionId'});db[_0x257b('0xfe')][_0x257b('0x121')](db[_0x257b('0x10c')],{'as':'User'});db[_0x257b('0xfe')][_0x257b('0x121')](db[_0x257b('0x71')],{'onDelete':'cascade','as':'Contact'});db[_0x257b('0xfe')][_0x257b('0x121')](db['WhatsappInteraction'],{'onDelete':_0x257b('0x10e'),'as':_0x257b('0x174'),'foreignKey':_0x257b('0x1fb')});db[_0x257b('0xfe')]['belongsTo'](db['WhatsappAccount'],{'as':_0x257b('0x17e'),'foreignKey':_0x257b('0x1f9')});db[_0x257b('0x100')][_0x257b('0x121')](db[_0x257b('0xfb')],{});db[_0x257b('0x100')][_0x257b('0x121')](db['CmList'],{'as':_0x257b('0x168'),'foreignKey':_0x257b('0x179')});db['WhatsappQueueReport'][_0x257b('0x121')](db['CmContact'],{'as':'Contact','foreignKey':_0x257b('0x160')});db[_0x257b('0x100')][_0x257b('0x121')](db[_0x257b('0xfd')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x257b('0x13b')],{});db[_0x257b('0x100')][_0x257b('0x121')](db[_0x257b('0xfe')],{});db[_0x257b('0x100')][_0x257b('0x121')](db['User'],{});db[_0x257b('0x102')]['belongsTo'](db['WhatsappMessage'],{});db[_0x257b('0x102')][_0x257b('0x121')](db[_0x257b('0xfd')],{});db['WhatsappTransferReport'][_0x257b('0x121')](db[_0x257b('0xfb')],{'foreignKey':_0x257b('0x1fc'),'as':'FromAccount'});db[_0x257b('0x102')][_0x257b('0x121')](db[_0x257b('0xfb')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0x257b('0x102')][_0x257b('0x121')](db['WhatsappQueue'],{'foreignKey':_0x257b('0x1fd'),'as':_0x257b('0x1e5')});db[_0x257b('0x102')][_0x257b('0x121')](db[_0x257b('0x10c')],{'foreignKey':'FromUserId','as':_0x257b('0x1e2')});db[_0x257b('0x102')][_0x257b('0x121')](db[_0x257b('0x10c')],{'foreignKey':_0x257b('0x1e3'),'as':_0x257b('0x1e4')});db['WhatsappQueue'][_0x257b('0x123')](db[_0x257b('0x10c')],{'as':_0x257b('0x16c'),'through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db[_0x257b('0x13b')][_0x257b('0x123')](db[_0x257b('0xe1')],{'through':_0x257b('0x1d7'),'as':_0x257b('0x158')});db[_0x257b('0x108')][_0x257b('0x121')](db[_0x257b('0x10c')],{'as':_0x257b('0x1fe'),'foreignKey':_0x257b('0x10f'),'onDelete':_0x257b('0x10e'),'hooks':!![]});db['CloudProvider'][_0x257b('0x10d')](db[_0x257b('0xc1')],{'as':_0x257b('0xc1'),'onDelete':_0x257b('0x177')});db[_0x257b('0x162')][_0x257b('0x10d')](db[_0x257b('0x39')],{'as':_0x257b('0x164'),'onDelete':'restrict'});db[_0x257b('0x162')][_0x257b('0x10d')](db[_0x257b('0x3a')],{'as':'Smtp','onDelete':_0x257b('0x177')});module[_0x257b('0x1ff')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x72c9=['MailAccounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','VoiceChanSpy','SpiedAgents','ChanSpyId','Applications','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','mandatoryDispositionPause','voice_queues_has_cm_lists','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','restrict','MailServerOut','Smtp','Dispositions','Answers','Interactions','List','ListId','Template','TemplateId','Pause','mandatoryDispositionPauseId','Agents','team_has_mail_queues','Account','Owner','mail_interaction_has_tags','Tags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','IntervalId','TagId','MailQueueReport','DashboardItem','Items','FaxAccountId','Exntensions','FaxInteractionId','fax_interaction_has_tags','ThroughTags','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsMessage','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatInternalMessage','ChatGroupId','Members','Contacts','Phones','CmContactId','Company','CompanyId','cm_contact_has_tags','CampaignId','OwnerId','Condition','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','Extensions','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','whatsapp_interaction_has_tags','ContactItemType','ItemTypeId','Hopper','CmHopperId','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerId','Fields','AnalyticFieldReport','AnalyticMetric','MetricId','AccountId','Subjects','SubjectId','Descriptions','Subject','Field','FieldId','SugarcrmConfiguration','Configurations','Description','VariableId','DeskAccount','DescriptionId','int_desk_configuration_has_tags','ZohoAccount','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowAccount','ServicenowConfiguration','Dynamics365Configuration','FromId','JscriptyQuestionReport','SessionId','JscriptyAnswerReport','ProjectId','FaxQueues','team_has_openchannel_queues','team_has_whatsapp_queues','TeamVoicePrefix','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToAccount','ChatTransferReport','FromUserId','ToAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','cm_user_has_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','Imap','exports','../config/environment','sequelize','jstz','determine','defaultsDeep','motion2','xC@LL1234','utf8mb4','utf8_general_ci','127.0.0.1','name','utf8','database','password','sequelizeHistory','username','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmHopper','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/pause/pause.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/contactItemType/contactItemType.model','CmContactHasItem','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','FreshdeskField','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','MailInteractionHasTag','../api/mailInteractionHasTag/mailInteractionHasTag.model','hasOne','cascade','UserId','userSetting','hasMany','Recordings','VoiceQueuesRt','HopperFinals','ReportAgentPreview','OpenchannelInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','UserNotifications','Hoppers','SET\x20NULL','belongsTo','belongsToMany','ChatGroup','Groups','chat_group_has_users','CmContact','cm_user_has_contacts','Lists','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts'];(function(_0x588e69,_0x5d393b){var _0x3e5ab7=function(_0x300647){while(--_0x300647){_0x588e69['push'](_0x588e69['shift']());}};_0x3e5ab7(++_0x5d393b);}(_0x72c9,0xcc));var _0x972c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x72c9[_0x14add3];return _0x4a174f;};'use strict';var config=require(_0x972c('0x0'));var Sequelize=require(_0x972c('0x1'));var _=require('lodash');var jstz=require(_0x972c('0x2'));var timezone=jstz[_0x972c('0x3')]();config['sequelize']=_[_0x972c('0x4')](config[_0x972c('0x1')],{'database':_0x972c('0x5'),'username':'xcall','password':_0x972c('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x972c('0x7')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x972c('0x8')}}});config['sequelizeHistory']=_['defaultsDeep'](config['sequelizeHistory'],{'database':'motion2','username':'xcall','password':_0x972c('0x6'),'options':{'host':_0x972c('0x9'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x972c('0xa')](),'define':{'charset':_0x972c('0xb'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x972c('0xc')],config['sequelize']['username'],config[_0x972c('0x1')][_0x972c('0xd')],config[_0x972c('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x972c('0xe')][_0x972c('0xc')],config['sequelizeHistory'][_0x972c('0xf')],config[_0x972c('0xe')][_0x972c('0xd')],config[_0x972c('0xe')][_0x972c('0x10')])};db[_0x972c('0x11')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x13'));db['VoiceChanSpy']=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x14'));db[_0x972c('0x15')]=db['sequelize'][_0x972c('0x12')](_0x972c('0x16'));db[_0x972c('0x17')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x18'));db[_0x972c('0x19')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x1a'));db[_0x972c('0x1b')]=db['sequelize']['import'](_0x972c('0x1c'));db[_0x972c('0x1d')]=db['sequelize']['import'](_0x972c('0x1e'));db[_0x972c('0x1f')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x20'));db[_0x972c('0x21')]=db[_0x972c('0x1')]['import']('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0x972c('0x1')][_0x972c('0x12')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x972c('0x22')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x23'));db[_0x972c('0x24')]=db['sequelize'][_0x972c('0x12')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x25'));db[_0x972c('0x26')]=db['sequelize'][_0x972c('0x12')](_0x972c('0x27'));db[_0x972c('0x28')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x29'));db['Trunk']=db[_0x972c('0x1')][_0x972c('0x12')]('../api/trunk/trunk.model');db[_0x972c('0x2a')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x2b'));db[_0x972c('0x2c')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x2d'));db[_0x972c('0x2e')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x2f'));db[_0x972c('0x30')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x31'));db[_0x972c('0x32')]=db[_0x972c('0x1')]['import']('../api/userMailQueue/userMailQueue.model');db[_0x972c('0x33')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x34'));db[_0x972c('0x35')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x36'));db[_0x972c('0x37')]=db['sequelize'][_0x972c('0x12')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x972c('0x38')]=db[_0x972c('0x1')]['import'](_0x972c('0x39'));db[_0x972c('0x3a')]=db[_0x972c('0x1')][_0x972c('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x3b'));db[_0x972c('0x3c')]=db['sequelize'][_0x972c('0x12')](_0x972c('0x3d'));db[_0x972c('0x3e')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x3f'));db[_0x972c('0x40')]=db[_0x972c('0x1')]['import'](_0x972c('0x41'));db[_0x972c('0x42')]=db[_0x972c('0x1')]['import'](_0x972c('0x43'));db[_0x972c('0x44')]=db[_0x972c('0x1')]['import'](_0x972c('0x45'));db[_0x972c('0x46')]=db['sequelize'][_0x972c('0x12')](_0x972c('0x47'));db['MailQueueReport']=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x48'));db[_0x972c('0x49')]=db['sequelize']['import']('../api/dashboard/dashboard.model');db['DashboardItem']=db[_0x972c('0x1')][_0x972c('0x12')]('../api/dashboardItem/dashboardItem.model');db[_0x972c('0x4a')]=db['sequelize'][_0x972c('0x12')](_0x972c('0x4b'));db[_0x972c('0x4c')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x4d'));db['FaxInteraction']=db['sequelize']['import'](_0x972c('0x4e'));db[_0x972c('0x4f')]=db[_0x972c('0x1')]['import'](_0x972c('0x50'));db[_0x972c('0x51')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x52'));db['FaxQueueReport']=db[_0x972c('0x1')]['import'](_0x972c('0x53'));db['SmsAccount']=db['sequelize'][_0x972c('0x12')](_0x972c('0x54'));db[_0x972c('0x55')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x56'));db[_0x972c('0x57')]=db['sequelize'][_0x972c('0x12')](_0x972c('0x58'));db['SmsMessage']=db['sequelize'][_0x972c('0x12')](_0x972c('0x59'));db[_0x972c('0x5a')]=db['sequelize'][_0x972c('0x12')](_0x972c('0x5b'));db[_0x972c('0x5c')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x5d'));db[_0x972c('0x5e')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x5f'));db[_0x972c('0x60')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x61'));db[_0x972c('0x62')]=db[_0x972c('0x1')]['import'](_0x972c('0x63'));db[_0x972c('0x64')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x65'));db[_0x972c('0x66')]=db[_0x972c('0x1')]['import'](_0x972c('0x67'));db[_0x972c('0x68')]=db[_0x972c('0x1')]['import'](_0x972c('0x69'));db[_0x972c('0x6a')]=db[_0x972c('0x1')][_0x972c('0x12')]('../api/chatApplication/chatApplication.model');db[_0x972c('0x6b')]=db['sequelize']['import']('../api/chatInteraction/chatInteraction.model');db[_0x972c('0x6c')]=db[_0x972c('0x1')][_0x972c('0x12')]('../api/chatMessage/chatMessage.model');db[_0x972c('0x6d')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x6e'));db[_0x972c('0x6f')]=db[_0x972c('0x1')]['import'](_0x972c('0x70'));db['ChatGroup']=db[_0x972c('0x1')][_0x972c('0x12')]('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x71'));db[_0x972c('0x72')]=db[_0x972c('0x1')][_0x972c('0x12')]('../api/cmCompany/cmCompany.model');db['CmContact']=db[_0x972c('0x1')][_0x972c('0x12')]('../api/cmContact/cmContact.model');db[_0x972c('0x73')]=db[_0x972c('0x1')]['import']('../api/cmHopper/cmHopper.model');db[_0x972c('0x74')]=db[_0x972c('0x1')]['import']('../api/cmHopperBlack/cmHopperBlack.model');db[_0x972c('0x75')]=db[_0x972c('0x1')]['import'](_0x972c('0x76'));db[_0x972c('0x77')]=db['sequelize'][_0x972c('0x12')](_0x972c('0x78'));db['ReportAgentPreview']=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x79'));db[_0x972c('0x7a')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x7b'));db[_0x972c('0x7c')]=db['sequelize'][_0x972c('0x12')](_0x972c('0x7d'));db[_0x972c('0x7e')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x7f'));db[_0x972c('0x80')]=db[_0x972c('0x1')][_0x972c('0x12')]('../api/cannedAnswer/cannedAnswer.model');db[_0x972c('0x81')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x82'));db['Condition']=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x83'));db[_0x972c('0x84')]=db[_0x972c('0x1')][_0x972c('0x12')]('../api/interval/interval.model');db['Pause']=db['sequelize'][_0x972c('0x12')](_0x972c('0x85'));db['Cdr']=db[_0x972c('0x1')][_0x972c('0x12')]('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x86'));db[_0x972c('0x87')]=db[_0x972c('0x1')][_0x972c('0x12')]('../api/schedule/schedule.model');db[_0x972c('0x88')]=db[_0x972c('0x1')]['import'](_0x972c('0x89'));db[_0x972c('0x8a')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x8b'));db['ContactItemType']=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x8c'));db[_0x972c('0x8d')]=db[_0x972c('0x1')]['import']('../api/cmContactHasItem/cmContactHasItem.model');db[_0x972c('0x8e')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x8f'));db['Template']=db[_0x972c('0x1')][_0x972c('0x12')]('../api/template/template.model');db[_0x972c('0x90')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x91'));db[_0x972c('0x92')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x93'));db[_0x972c('0x94')]=db['sequelize'][_0x972c('0x12')](_0x972c('0x95'));db[_0x972c('0x96')]=db[_0x972c('0x1')]['import'](_0x972c('0x97'));db[_0x972c('0x98')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x99'));db[_0x972c('0x9a')]=db['sequelize']['import'](_0x972c('0x9b'));db[_0x972c('0x9c')]=db[_0x972c('0x1')][_0x972c('0x12')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db[_0x972c('0x1')]['import']('../api/analyticMetric/analyticMetric.model');db['AnalyticFieldReport']=db[_0x972c('0x1')][_0x972c('0x12')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x972c('0x9d')]=db[_0x972c('0x1')]['import'](_0x972c('0x9e'));db[_0x972c('0x9f')]=db[_0x972c('0x1')]['import']('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x972c('0xa0')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xa1'));db[_0x972c('0xa2')]=db['sequelize'][_0x972c('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x972c('0xa3')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xa4'));db['SugarcrmConfiguration']=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xa5'));db[_0x972c('0xa6')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xa7'));db['DeskAccount']=db[_0x972c('0x1')][_0x972c('0x12')]('../api/intDeskAccount/intDeskAccount.model');db[_0x972c('0xa8')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xa9'));db[_0x972c('0xaa')]=db['sequelize'][_0x972c('0x12')](_0x972c('0xab'));db['ZohoAccount']=db['sequelize']['import'](_0x972c('0xac'));db[_0x972c('0xad')]=db[_0x972c('0x1')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x972c('0xae')]=db[_0x972c('0x1')][_0x972c('0x12')]('../api/intZohoField/intZohoField.model');db[_0x972c('0xaf')]=db['sequelize'][_0x972c('0x12')](_0x972c('0xb0'));db[_0x972c('0xb1')]=db[_0x972c('0x1')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x972c('0xb2')]=db[_0x972c('0x1')]['import'](_0x972c('0xb3'));db[_0x972c('0xb4')]=db[_0x972c('0x1')]['import']('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x972c('0xb5')]=db['sequelize'][_0x972c('0x12')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x972c('0xb6')]=db[_0x972c('0x1')][_0x972c('0x12')]('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xb7'));db[_0x972c('0xb8')]=db[_0x972c('0x1')]['import']('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x972c('0xb9')]=db['sequelize'][_0x972c('0x12')](_0x972c('0xba'));db['ServicenowAccount']=db[_0x972c('0x1')]['import'](_0x972c('0xbb'));db['ServicenowConfiguration']=db['sequelize'][_0x972c('0x12')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x972c('0xbc')]=db['sequelize'][_0x972c('0x12')](_0x972c('0xbd'));db[_0x972c('0xbe')]=db['sequelize'][_0x972c('0x12')](_0x972c('0xbf'));db['Dynamics365Configuration']=db[_0x972c('0x1')]['import']('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x972c('0xc0')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xc1'));db[_0x972c('0xc2')]=db['sequelize'][_0x972c('0x12')](_0x972c('0xc3'));db[_0x972c('0xc4')]=db[_0x972c('0x1')][_0x972c('0x12')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x972c('0xc5')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xc6'));db[_0x972c('0x94')]=db['sequelize']['import']('../api/integration/integration.model');db[_0x972c('0xc7')]=db[_0x972c('0x1')][_0x972c('0x12')]('../api/network/network.model');db[_0x972c('0xc8')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xc9'));db['ChatInternalMessage']=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xca'));db['JscriptyAnswerReport']=db[_0x972c('0x1')]['import'](_0x972c('0xcb'));db['JscriptyQuestionReport']=db['sequelize'][_0x972c('0x12')](_0x972c('0xcc'));db[_0x972c('0xcd')]=db['sequelize'][_0x972c('0x12')](_0x972c('0xce'));db[_0x972c('0xcf')]=db[_0x972c('0x1')][_0x972c('0x12')]('../api/smsQueueReport/smsQueueReport.model');db[_0x972c('0xd0')]=db[_0x972c('0x1')]['import'](_0x972c('0xd1'));db['SquareDetailsReport']=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xd2'));db[_0x972c('0xd3')]=db['sequelize'][_0x972c('0x12')]('../api/jscriptyProject/jscriptyProject.model');db[_0x972c('0xd4')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xd5'));db[_0x972c('0xd6')]=db[_0x972c('0x1')]['import'](_0x972c('0xd7'));db[_0x972c('0xd8')]=db[_0x972c('0x1')]['import'](_0x972c('0xd9'));db['SquareRecording']=db['sequelize']['import'](_0x972c('0xda'));db['SquareMessage']=db[_0x972c('0x1')][_0x972c('0x12')]('../api/squareMessage/squareMessage.model');db[_0x972c('0xdb')]=db[_0x972c('0x1')]['import'](_0x972c('0xdc'));db['License']=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xdd'));db[_0x972c('0xde')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xdf'));db[_0x972c('0xe0')]=db[_0x972c('0x1')][_0x972c('0x12')]('../api/migration/migration.model');db[_0x972c('0xe1')]=db[_0x972c('0x1')]['import'](_0x972c('0xe2'));db[_0x972c('0xe3')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xe4'));db['MailTransferReport']=db[_0x972c('0x1')][_0x972c('0x12')]('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db[_0x972c('0x1')]['import']('../api/chatTransferReport/chatTransferReport.model');db[_0x972c('0xe5')]=db[_0x972c('0x1')][_0x972c('0x12')]('../api/faxTransferReport/faxTransferReport.model');db[_0x972c('0xe6')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xe7'));db[_0x972c('0xe8')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xe9'));db[_0x972c('0xea')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xeb'));db[_0x972c('0xec')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xed'));db[_0x972c('0xee')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xef'));db[_0x972c('0xf0')]=db[_0x972c('0x1')]['import']('../api/userProfileSection/userProfileSection.model');db[_0x972c('0xf1')]=db[_0x972c('0x1')]['import']('../api/userProfileResource/userProfileResource.model');db[_0x972c('0xf2')]=db[_0x972c('0x1')]['import'](_0x972c('0xf3'));db[_0x972c('0xf4')]=db['sequelize']['import'](_0x972c('0xf5'));db[_0x972c('0xf6')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xf7'));db[_0x972c('0xf8')]=db['sequelize'][_0x972c('0x12')](_0x972c('0xf9'));db['WhatsappMessage']=db['sequelize'][_0x972c('0x12')](_0x972c('0xfa'));db[_0x972c('0xfb')]=db['sequelize']['import'](_0x972c('0xfc'));db[_0x972c('0xfd')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0xfe'));db[_0x972c('0xff')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x100'));db[_0x972c('0x101')]=db[_0x972c('0x1')]['import'](_0x972c('0x102'));db[_0x972c('0x103')]=db[_0x972c('0x1')][_0x972c('0x12')](_0x972c('0x104'));db['TeamVoicePrefix']=db['sequelize'][_0x972c('0x12')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x972c('0x105')]=db[_0x972c('0x1')][_0x972c('0x12')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x972c('0x106')]=db[_0x972c('0x1')]['import'](_0x972c('0x107'));db[_0x972c('0x108')]=db[_0x972c('0x1')]['import'](_0x972c('0x109'));db[_0x972c('0x11')][_0x972c('0x10a')](db[_0x972c('0x21')],{'as':_0x972c('0x21'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x10c')});db['User'][_0x972c('0x10a')](db[_0x972c('0x106')],{'as':_0x972c('0x10d'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x10c')});db[_0x972c('0x11')][_0x972c('0x10e')](db['VoiceRecording'],{'as':_0x972c('0x10f'),'foreignKey':_0x972c('0x10c')});db[_0x972c('0x11')][_0x972c('0x10e')](db[_0x972c('0x2c')],{'as':_0x972c('0x110'),'foreignKey':_0x972c('0x10c')});db['User'][_0x972c('0x10e')](db[_0x972c('0x17')],{'as':'Extensions','onDelete':_0x972c('0x10b'),'hooks':!![]});db[_0x972c('0x11')]['hasMany'](db[_0x972c('0x75')],{'as':_0x972c('0x111'),'foreignKey':_0x972c('0x10c')});db[_0x972c('0x11')][_0x972c('0x10e')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x972c('0x10c')});db[_0x972c('0x11')][_0x972c('0x10e')](db[_0x972c('0x112')],{'as':_0x972c('0x112'),'foreignKey':'UserId'});db[_0x972c('0x11')][_0x972c('0x10e')](db[_0x972c('0x60')],{'as':_0x972c('0x113'),'foreignKey':_0x972c('0x10c')});db[_0x972c('0x11')][_0x972c('0x10e')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x972c('0x10c')});db[_0x972c('0x11')]['hasMany'](db[_0x972c('0x57')],{'as':_0x972c('0x114'),'foreignKey':_0x972c('0x10c')});db[_0x972c('0x11')]['hasMany'](db[_0x972c('0x115')],{'as':_0x972c('0x116'),'foreignKey':_0x972c('0x10c')});db['User'][_0x972c('0x10e')](db['MailInteraction'],{'as':_0x972c('0x117'),'foreignKey':_0x972c('0x10c')});db[_0x972c('0x11')][_0x972c('0x10e')](db[_0x972c('0xf8')],{'as':'WhatsappInteractions','foreignKey':'UserId'});db['User'][_0x972c('0x10e')](db[_0x972c('0xf2')],{'as':_0x972c('0x118'),'foreignKey':'SenderId'});db[_0x972c('0x11')]['hasMany'](db[_0x972c('0x73')],{'as':_0x972c('0x119'),'foreignKey':'UserId','onDelete':_0x972c('0x11a')});db[_0x972c('0x11')][_0x972c('0x11b')](db[_0x972c('0xee')],{'as':_0x972c('0xee'),'foreignKey':'userProfileId'});db[_0x972c('0x11')][_0x972c('0x11c')](db[_0x972c('0x11d')],{'as':_0x972c('0x11e'),'through':_0x972c('0x11f')});db[_0x972c('0x11')][_0x972c('0x11c')](db[_0x972c('0x120')],{'as':'Contacts','through':_0x972c('0x121')});db[_0x972c('0x11')]['belongsToMany'](db['CmList'],{'as':_0x972c('0x122'),'through':'cm_user_has_lists'});db[_0x972c('0x11')][_0x972c('0x11c')](db[_0x972c('0xdb')],{'through':'user_has_teams'});db[_0x972c('0x11')][_0x972c('0x11c')](db['MailInteraction'],{'as':_0x972c('0x117'),'through':_0x972c('0x123')});db[_0x972c('0x11')][_0x972c('0x11c')](db['ChatInteraction'],{'as':_0x972c('0x124'),'through':_0x972c('0x125')});db['User']['belongsToMany'](db[_0x972c('0x115')],{'as':_0x972c('0x116'),'through':_0x972c('0x126')});db['User'][_0x972c('0x11c')](db[_0x972c('0x57')],{'as':_0x972c('0x114'),'through':'user_has_sms_interactions'});db[_0x972c('0x11')][_0x972c('0x11c')](db[_0x972c('0x60')],{'as':'OpenchannelInteractions','through':_0x972c('0x127')});db[_0x972c('0x11')][_0x972c('0x11c')](db[_0x972c('0xf8')],{'as':_0x972c('0x128'),'through':_0x972c('0x129')});db[_0x972c('0x11')][_0x972c('0x11c')](db[_0x972c('0x1b')],{'as':_0x972c('0x12a'),'through':_0x972c('0x2e'),'required':![]});db[_0x972c('0x11')][_0x972c('0x11c')](db[_0x972c('0xec')],{'as':_0x972c('0x12b'),'through':_0x972c('0x105'),'required':![]});db[_0x972c('0x11')][_0x972c('0x11c')](db[_0x972c('0x3e')],{'as':_0x972c('0x12c'),'through':'UserMailQueue','required':![]});db[_0x972c('0x11')]['belongsToMany'](db['ChatQueue'],{'as':_0x972c('0x12d'),'through':_0x972c('0x30'),'required':![],'hooks':!![]});db[_0x972c('0x11')]['belongsToMany'](db[_0x972c('0x51')],{'as':'FaxQueues','through':_0x972c('0x33'),'required':![]});db[_0x972c('0x11')][_0x972c('0x11c')](db[_0x972c('0x5a')],{'as':_0x972c('0x12e'),'through':_0x972c('0x35'),'required':![]});db[_0x972c('0x11')]['belongsToMany'](db[_0x972c('0x64')],{'as':_0x972c('0x12f'),'through':_0x972c('0x37'),'required':![]});db[_0x972c('0x11')][_0x972c('0x11c')](db[_0x972c('0xff')],{'as':_0x972c('0x130'),'through':_0x972c('0x38'),'required':![]});db[_0x972c('0x11')][_0x972c('0x11c')](db['CmList'],{'through':'cm_user_has_lists'});db[_0x972c('0x11')]['belongsToMany'](db[_0x972c('0x66')],{'as':_0x972c('0x131'),'through':_0x972c('0x132')});db['User'][_0x972c('0x11c')](db[_0x972c('0x4a')],{'as':_0x972c('0x133'),'through':_0x972c('0x134')});db[_0x972c('0x11')][_0x972c('0x11c')](db[_0x972c('0x3c')],{'as':_0x972c('0x135'),'through':_0x972c('0x136')});db[_0x972c('0x11')][_0x972c('0x11c')](db[_0x972c('0x5c')],{'as':_0x972c('0x137'),'through':'user_has_openchannel_accounts'});db['User'][_0x972c('0x11c')](db[_0x972c('0x138')],{'as':_0x972c('0x139'),'through':_0x972c('0x13a')});db[_0x972c('0x11')][_0x972c('0x11c')](db['WhatsappAccount'],{'as':_0x972c('0x13b'),'through':_0x972c('0x13c')});db[_0x972c('0x13d')][_0x972c('0x10e')](db[_0x972c('0x17')],{'as':_0x972c('0x13e'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x13f')});db['VoiceContext']['hasMany'](db[_0x972c('0x17')],{'onDelete':'cascade'});db[_0x972c('0x17')]['hasMany'](db['VoiceExtension'],{'as':_0x972c('0x140'),'onDelete':_0x972c('0x10b')});db['VoiceMusicOnHold'][_0x972c('0x11c')](db['Sound'],{'as':'Sounds','through':'moh_has_sounds'});db[_0x972c('0x1b')]['hasMany'](db[_0x972c('0x2c')],{'as':'Members','foreignKey':'VoiceQueueId'});db[_0x972c('0x1b')][_0x972c('0x10e')](db[_0x972c('0x73')],{'as':_0x972c('0x119'),'foreignKey':_0x972c('0x141')});db[_0x972c('0x1b')][_0x972c('0x10e')](db[_0x972c('0x75')],{'as':'HopperFinals','foreignKey':'VoiceQueueId'});db[_0x972c('0x1b')]['hasMany'](db[_0x972c('0x77')],{'as':_0x972c('0x142'),'foreignKey':'VoiceQueueId'});db[_0x972c('0x1b')][_0x972c('0x10e')](db[_0x972c('0x112')],{'as':'ReportAgentPreview','foreignKey':_0x972c('0x141')});db['VoiceQueue'][_0x972c('0x10e')](db[_0x972c('0x74')],{'as':_0x972c('0x143'),'foreignKey':_0x972c('0x141')});db[_0x972c('0x1b')]['hasMany'](db[_0x972c('0xcd')],{'as':_0x972c('0x144'),'foreignKey':_0x972c('0x141')});db[_0x972c('0x1b')]['belongsTo'](db[_0x972c('0x145')],{'as':_0x972c('0x145'),'foreignKey':_0x972c('0x146')});db['VoiceQueue'][_0x972c('0x11b')](db[_0x972c('0x145')],{'as':_0x972c('0x147'),'foreignKey':_0x972c('0x148')});db['VoiceQueue']['belongsTo'](db['Interval'],{'as':'Interval','foreignKey':'IntervalId'});db[_0x972c('0x1b')]['belongsTo'](db['Pause'],{'as':_0x972c('0x149'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x972c('0x1b')][_0x972c('0x11c')](db[_0x972c('0xea')],{'as':'Lists','through':_0x972c('0x14a')});db[_0x972c('0x1b')][_0x972c('0x11c')](db[_0x972c('0x11')],{'as':'Agents','through':_0x972c('0x2e')});db['VoiceQueue']['belongsToMany'](db[_0x972c('0xdb')],{'as':_0x972c('0x14b'),'through':_0x972c('0x103')});db[_0x972c('0x1b')][_0x972c('0x11c')](db[_0x972c('0xea')],{'as':_0x972c('0x14c'),'through':_0x972c('0x14d')});db[_0x972c('0x1d')][_0x972c('0x11b')](db[_0x972c('0x11')],{'as':_0x972c('0x11'),'foreignKey':_0x972c('0x10c')});db[_0x972c('0x1f')][_0x972c('0x11b')](db[_0x972c('0x11')],{'as':'User','foreignKey':_0x972c('0x10c')});db['VoiceMail'][_0x972c('0x10e')](db[_0x972c('0x14e')],{'as':_0x972c('0x14f'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x150'),'sourceKey':_0x972c('0x151')});db[_0x972c('0x14e')][_0x972c('0x11b')](db[_0x972c('0x21')],{'foreignKey':_0x972c('0x150'),'targetKey':_0x972c('0x151')});db[_0x972c('0x22')]['hasMany'](db[_0x972c('0x26')],{'as':_0x972c('0x152'),'foreignKey':_0x972c('0x153'),'constraints':![]});db['VoiceCallReport'][_0x972c('0x10e')](db[_0x972c('0x154')],{'as':_0x972c('0x155'),'foreignKey':_0x972c('0x153'),'constraints':![]});db[_0x972c('0x22')][_0x972c('0x11b')](db[_0x972c('0x11')],{'as':_0x972c('0x11'),'foreignKey':_0x972c('0x10c')});db[_0x972c('0x22')][_0x972c('0x11b')](db[_0x972c('0x120')],{'as':_0x972c('0x156'),'foreignKey':_0x972c('0x157')});db['MailServerIn']['belongsTo'](db[_0x972c('0x3c')],{'as':'MailAccount','foreignKey':_0x972c('0x158')});db[_0x972c('0x3a')][_0x972c('0x11b')](db[_0x972c('0x101')],{'as':_0x972c('0x101'),'foreignKey':_0x972c('0x159'),'onDelete':_0x972c('0x15a')});db[_0x972c('0x15b')][_0x972c('0x11b')](db[_0x972c('0x3c')],{'as':_0x972c('0x3c'),'foreignKey':_0x972c('0x158')});db[_0x972c('0x15b')][_0x972c('0x11b')](db[_0x972c('0x101')],{'as':_0x972c('0x101'),'foreignKey':'CloudProviderId','onDelete':_0x972c('0x15a')});db[_0x972c('0x3c')][_0x972c('0x10a')](db[_0x972c('0x3a')],{'as':'Imap','onDelete':_0x972c('0x10b')});db[_0x972c('0x3c')]['hasOne'](db[_0x972c('0x15b')],{'as':_0x972c('0x15c'),'onDelete':_0x972c('0x10b')});db[_0x972c('0x3c')]['hasMany'](db['Disposition'],{'as':_0x972c('0x15d'),'foreignKey':_0x972c('0x158'),'onDelete':_0x972c('0x10b')});db['MailAccount'][_0x972c('0x10e')](db[_0x972c('0x80')],{'as':_0x972c('0x15e'),'foreignKey':_0x972c('0x158')});db[_0x972c('0x3c')]['hasMany'](db['MailMessage'],{'as':_0x972c('0x14f'),'foreignKey':'MailAccountId'});db['MailAccount']['hasMany'](db[_0x972c('0x42')],{'as':_0x972c('0x15f')});db['MailAccount'][_0x972c('0x10e')](db[_0x972c('0x46')],{'as':_0x972c('0x140'),'foreignKey':_0x972c('0x158'),'onDelete':_0x972c('0x10b')});db[_0x972c('0x3c')][_0x972c('0x11b')](db[_0x972c('0xea')],{'as':_0x972c('0x160'),'foreignKey':_0x972c('0x161')});db['MailAccount'][_0x972c('0x11b')](db['Template'],{'as':_0x972c('0x162'),'foreignKey':_0x972c('0x163')});db[_0x972c('0x3c')][_0x972c('0x11b')](db[_0x972c('0x164')],{'as':_0x972c('0x149'),'foreignKey':_0x972c('0x165')});db[_0x972c('0x3c')]['belongsToMany'](db['User'],{'as':_0x972c('0x166'),'through':'user_has_mail_accounts'});db[_0x972c('0x3e')][_0x972c('0x11c')](db['User'],{'as':'Agents','through':_0x972c('0x32')});db[_0x972c('0x3e')][_0x972c('0x11c')](db[_0x972c('0xdb')],{'through':_0x972c('0x167'),'as':_0x972c('0x14b')});db[_0x972c('0x42')]['hasMany'](db[_0x972c('0x44')],{'as':_0x972c('0x14f'),'onDelete':_0x972c('0x10b'),'foreignKey':'MailInteractionId'});db[_0x972c('0x42')][_0x972c('0x11b')](db[_0x972c('0x3c')],{'as':_0x972c('0x168'),'foreignKey':_0x972c('0x158')});db['MailInteraction'][_0x972c('0x11b')](db[_0x972c('0x120')],{'as':'Contact','foreignKey':_0x972c('0x157')});db['MailInteraction'][_0x972c('0x11b')](db['User'],{'as':_0x972c('0x169'),'foreignKey':'UserId'});db['MailInteraction'][_0x972c('0x11c')](db['Tag'],{'through':_0x972c('0x16a'),'as':_0x972c('0x16b')});db[_0x972c('0x42')][_0x972c('0x11c')](db[_0x972c('0x8a')],{'through':_0x972c('0x16a'),'as':'ThroughTags'});db[_0x972c('0x42')][_0x972c('0x11c')](db[_0x972c('0x11')],{'as':_0x972c('0x16c'),'through':_0x972c('0x123'),'foreignKey':_0x972c('0x16d')});db['MailMessage'][_0x972c('0x10e')](db[_0x972c('0xe1')],{'as':_0x972c('0x16e'),'onDelete':_0x972c('0x10b')});db[_0x972c('0x44')][_0x972c('0x11b')](db[_0x972c('0x11')],{'as':'User'});db[_0x972c('0x44')]['belongsTo'](db[_0x972c('0x120')],{'onDelete':'cascade','as':_0x972c('0x156')});db[_0x972c('0x44')][_0x972c('0x11b')](db[_0x972c('0x42')],{'as':_0x972c('0x16f'),'foreignKey':_0x972c('0x16d')});db['MailMessage'][_0x972c('0x11b')](db[_0x972c('0x3c')],{'as':_0x972c('0x168'),'foreignKey':_0x972c('0x158')});db[_0x972c('0x44')][_0x972c('0x11b')](db[_0x972c('0x66')],{'as':_0x972c('0x66'),'foreignKey':_0x972c('0x170')});db['MailMessage'][_0x972c('0x11b')](db[_0x972c('0x6d')],{'as':_0x972c('0x6d'),'foreignKey':_0x972c('0x171')});db['MailApplication'][_0x972c('0x11b')](db[_0x972c('0x11')],{'onDelete':_0x972c('0x15a')});db[_0x972c('0x46')]['belongsTo'](db['MailQueue'],{'onDelete':_0x972c('0x15a')});db[_0x972c('0x46')]['belongsTo'](db[_0x972c('0x3c')],{'onDelete':_0x972c('0x15a')});db[_0x972c('0x46')][_0x972c('0x11b')](db[_0x972c('0x84')],{'onDelete':_0x972c('0x15a'),'foreignKey':_0x972c('0x172')});db['MailApplication'][_0x972c('0x11b')](db['Tag'],{'onDelete':_0x972c('0x15a'),'foreignKey':_0x972c('0x173')});db['MailQueueReport'][_0x972c('0x11b')](db['MailAccount'],{});db['MailQueueReport'][_0x972c('0x11b')](db[_0x972c('0xea')],{'as':_0x972c('0x160'),'foreignKey':_0x972c('0x161')});db[_0x972c('0x174')][_0x972c('0x11b')](db[_0x972c('0x120')],{'as':_0x972c('0x156'),'foreignKey':'ContactId'});db[_0x972c('0x174')][_0x972c('0x11b')](db[_0x972c('0x42')],{});db[_0x972c('0x174')][_0x972c('0x11b')](db['MailMessage'],{});db['MailQueueReport']['belongsTo'](db['User'],{});db['MailQueueReport']['belongsTo'](db[_0x972c('0x3e')],{});db[_0x972c('0x49')][_0x972c('0x10e')](db[_0x972c('0x175')],{'as':_0x972c('0x176'),'onDelete':'cascade'});db[_0x972c('0x4a')][_0x972c('0x10e')](db[_0x972c('0x81')],{'as':_0x972c('0x15d'),'foreignKey':_0x972c('0x177'),'onDelete':'cascade'});db[_0x972c('0x4a')][_0x972c('0x10e')](db[_0x972c('0x80')],{'as':_0x972c('0x15e'),'foreignKey':_0x972c('0x177')});db[_0x972c('0x4a')][_0x972c('0x10e')](db[_0x972c('0x115')],{'as':'Interactions'});db['FaxAccount']['hasMany'](db[_0x972c('0x4c')],{'as':'Applications','foreignKey':_0x972c('0x177'),'onDelete':_0x972c('0x10b')});db[_0x972c('0x4a')][_0x972c('0x10e')](db[_0x972c('0x17')],{'as':_0x972c('0x178'),'onDelete':'cascade'});db[_0x972c('0x4a')][_0x972c('0x10e')](db['FaxMessage'],{'as':_0x972c('0x14f')});db[_0x972c('0x4a')][_0x972c('0x11b')](db[_0x972c('0x145')],{'as':'Trunk'});db[_0x972c('0x4a')][_0x972c('0x11b')](db['CmList'],{'as':_0x972c('0x160'),'foreignKey':'ListId'});db[_0x972c('0x4a')][_0x972c('0x11b')](db[_0x972c('0x164')],{'as':_0x972c('0x149'),'foreignKey':_0x972c('0x165')});db[_0x972c('0x4a')][_0x972c('0x11c')](db[_0x972c('0x11')],{'as':_0x972c('0x166'),'through':_0x972c('0x134')});db['FaxApplication']['belongsTo'](db[_0x972c('0x11')],{'onDelete':_0x972c('0x15a')});db[_0x972c('0x4c')][_0x972c('0x11b')](db['FaxQueue'],{'onDelete':_0x972c('0x15a')});db[_0x972c('0x4c')]['belongsTo'](db[_0x972c('0x4a')],{'onDelete':_0x972c('0x15a')});db['FaxApplication'][_0x972c('0x11b')](db['Tag'],{'onDelete':_0x972c('0x15a'),'foreignKey':_0x972c('0x173')});db[_0x972c('0x115')]['hasMany'](db[_0x972c('0x4f')],{'as':_0x972c('0x14f'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x179')});db['FaxInteraction'][_0x972c('0x11b')](db[_0x972c('0x4a')],{'as':'Account','foreignKey':_0x972c('0x177')});db['FaxInteraction'][_0x972c('0x11b')](db[_0x972c('0x120')],{'as':_0x972c('0x156'),'foreignKey':_0x972c('0x157')});db[_0x972c('0x115')]['belongsTo'](db[_0x972c('0x11')],{'as':_0x972c('0x169'),'foreignKey':_0x972c('0x10c')});db[_0x972c('0x115')]['belongsToMany'](db['Tag'],{'through':_0x972c('0x17a'),'as':'Tags'});db[_0x972c('0x115')]['belongsToMany'](db[_0x972c('0x8a')],{'through':_0x972c('0x17a'),'as':_0x972c('0x17b')});db[_0x972c('0x115')][_0x972c('0x11c')](db['User'],{'as':'Users','through':_0x972c('0x126'),'foreignKey':_0x972c('0x179')});db[_0x972c('0x4f')][_0x972c('0x11b')](db[_0x972c('0x11')],{'onDelete':_0x972c('0x10b'),'as':_0x972c('0x11')});db[_0x972c('0x4f')][_0x972c('0x11b')](db[_0x972c('0x115')],{'as':_0x972c('0x16f'),'foreignKey':'FaxInteractionId'});db[_0x972c('0x4f')][_0x972c('0x11b')](db[_0x972c('0x120')],{'onDelete':_0x972c('0x10b'),'as':_0x972c('0x156')});db[_0x972c('0x4f')][_0x972c('0x11b')](db[_0x972c('0xe1')],{'as':'Attachment','foreignKey':_0x972c('0x17c')});db['FaxMessage'][_0x972c('0x11b')](db[_0x972c('0x4a')],{'as':_0x972c('0x168'),'foreignKey':'FaxAccountId'});db[_0x972c('0x51')][_0x972c('0x11c')](db[_0x972c('0x11')],{'as':'Agents','through':_0x972c('0x33')});db[_0x972c('0x51')]['belongsToMany'](db[_0x972c('0xdb')],{'through':_0x972c('0x17d'),'as':_0x972c('0x14b')});db[_0x972c('0x17e')][_0x972c('0x11b')](db[_0x972c('0x4a')],{});db[_0x972c('0x17e')][_0x972c('0x11b')](db['CmList'],{'as':'List','foreignKey':_0x972c('0x161')});db[_0x972c('0x17e')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['FaxQueueReport'][_0x972c('0x11b')](db[_0x972c('0x115')],{});db[_0x972c('0x17e')][_0x972c('0x11b')](db['FaxMessage'],{});db[_0x972c('0x17e')]['belongsTo'](db[_0x972c('0x11')],{});db[_0x972c('0x17e')][_0x972c('0x11b')](db[_0x972c('0x51')],{});db[_0x972c('0x138')][_0x972c('0x10e')](db[_0x972c('0x81')],{'as':_0x972c('0x15d'),'foreignKey':_0x972c('0x17f'),'onDelete':_0x972c('0x10b')});db[_0x972c('0x138')][_0x972c('0x10e')](db['CannedAnswer'],{'as':_0x972c('0x15e'),'foreignKey':_0x972c('0x17f')});db[_0x972c('0x138')][_0x972c('0x10e')](db[_0x972c('0x180')],{'as':_0x972c('0x14f'),'foreignKey':'SmsAccountId'});db[_0x972c('0x138')][_0x972c('0x10e')](db[_0x972c('0x57')],{'as':_0x972c('0x15f')});db[_0x972c('0x138')]['hasMany'](db[_0x972c('0x55')],{'as':'Applications','foreignKey':_0x972c('0x17f'),'onDelete':'cascade'});db['SmsAccount']['belongsTo'](db[_0x972c('0xea')],{'as':_0x972c('0x160'),'foreignKey':_0x972c('0x161')});db['SmsAccount'][_0x972c('0x11b')](db[_0x972c('0x164')],{'as':'mandatoryDispositionPause','foreignKey':_0x972c('0x165')});db[_0x972c('0x138')][_0x972c('0x11c')](db['User'],{'as':'Agents','through':_0x972c('0x13a')});db[_0x972c('0x55')][_0x972c('0x11b')](db[_0x972c('0x11')],{'onDelete':_0x972c('0x15a')});db[_0x972c('0x55')][_0x972c('0x11b')](db[_0x972c('0x5a')],{'onDelete':_0x972c('0x15a')});db[_0x972c('0x55')][_0x972c('0x11b')](db[_0x972c('0x138')],{'onDelete':'restrict'});db[_0x972c('0x55')]['belongsTo'](db[_0x972c('0x84')],{'onDelete':_0x972c('0x15a'),'foreignKey':'IntervalId'});db[_0x972c('0x55')][_0x972c('0x11b')](db[_0x972c('0x8a')],{'onDelete':_0x972c('0x15a'),'foreignKey':_0x972c('0x173')});db['SmsInteraction']['hasMany'](db[_0x972c('0x180')],{'as':'Messages','onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x181')});db[_0x972c('0x57')]['belongsTo'](db[_0x972c('0x138')],{'as':_0x972c('0x168'),'foreignKey':_0x972c('0x17f')});db[_0x972c('0x57')][_0x972c('0x11b')](db['CmContact'],{'as':_0x972c('0x156'),'foreignKey':_0x972c('0x157')});db[_0x972c('0x57')]['belongsTo'](db[_0x972c('0x11')],{'as':_0x972c('0x169'),'foreignKey':_0x972c('0x10c')});db[_0x972c('0x57')][_0x972c('0x11c')](db[_0x972c('0x8a')],{'through':_0x972c('0x182'),'as':_0x972c('0x16b')});db['SmsInteraction'][_0x972c('0x11c')](db[_0x972c('0x8a')],{'through':_0x972c('0x182'),'as':_0x972c('0x17b')});db[_0x972c('0x57')][_0x972c('0x11c')](db[_0x972c('0x11')],{'as':'Users','through':_0x972c('0x183'),'foreignKey':'SmsInteractionId'});db[_0x972c('0x180')]['belongsTo'](db[_0x972c('0x11')],{'as':'User'});db['SmsMessage'][_0x972c('0x11b')](db[_0x972c('0x120')],{'onDelete':_0x972c('0x10b'),'as':_0x972c('0x156')});db[_0x972c('0x180')]['belongsTo'](db[_0x972c('0x57')],{'onDelete':'cascade','as':_0x972c('0x16f'),'foreignKey':'SmsInteractionId'});db[_0x972c('0x180')][_0x972c('0x11b')](db['SmsAccount'],{'as':_0x972c('0x168'),'foreignKey':_0x972c('0x17f')});db['SmsQueue'][_0x972c('0x11c')](db[_0x972c('0x11')],{'as':_0x972c('0x166'),'through':_0x972c('0x35'),'foreignKey':_0x972c('0x184')});db[_0x972c('0x5a')][_0x972c('0x11c')](db[_0x972c('0xdb')],{'through':_0x972c('0x185'),'as':_0x972c('0x14b')});db[_0x972c('0x5c')]['hasMany'](db[_0x972c('0x81')],{'as':'Dispositions','foreignKey':'OpenchannelAccountId','onDelete':_0x972c('0x10b')});db[_0x972c('0x5c')][_0x972c('0x10e')](db[_0x972c('0x80')],{'as':'Answers','foreignKey':_0x972c('0x186')});db['OpenchannelAccount']['hasMany'](db[_0x972c('0x60')],{'as':_0x972c('0x15f'),'foreignKey':_0x972c('0x186')});db[_0x972c('0x5c')][_0x972c('0x10e')](db[_0x972c('0x62')],{'as':_0x972c('0x14f'),'foreignKey':_0x972c('0x186')});db['OpenchannelAccount'][_0x972c('0x10e')](db[_0x972c('0x5e')],{'as':'Applications','foreignKey':_0x972c('0x186'),'onDelete':'cascade'});db[_0x972c('0x5c')][_0x972c('0x11b')](db[_0x972c('0xea')],{'as':_0x972c('0x160'),'foreignKey':_0x972c('0x161')});db['OpenchannelAccount'][_0x972c('0x11b')](db[_0x972c('0x164')],{'as':_0x972c('0x149'),'foreignKey':_0x972c('0x165')});db['OpenchannelAccount'][_0x972c('0x11c')](db[_0x972c('0x11')],{'as':_0x972c('0x166'),'through':_0x972c('0x187')});db[_0x972c('0x5e')]['belongsTo'](db[_0x972c('0x11')],{'onDelete':'restrict'});db[_0x972c('0x5e')][_0x972c('0x11b')](db[_0x972c('0x64')],{'onDelete':_0x972c('0x15a'),'foreignKey':'OpenchannelQueueId'});db[_0x972c('0x5e')][_0x972c('0x11b')](db[_0x972c('0x5c')],{'onDelete':'restrict','foreignKey':_0x972c('0x186')});db[_0x972c('0x5e')]['belongsTo'](db[_0x972c('0x84')],{'onDelete':'restrict','foreignKey':_0x972c('0x172')});db['OpenchannelApplication'][_0x972c('0x11b')](db[_0x972c('0x8a')],{'onDelete':_0x972c('0x15a'),'foreignKey':_0x972c('0x173')});db['OpenchannelInteraction'][_0x972c('0x10e')](db[_0x972c('0x62')],{'as':_0x972c('0x14f'),'onDelete':'cascade','foreignKey':_0x972c('0x188')});db[_0x972c('0x60')][_0x972c('0x11b')](db[_0x972c('0x5c')],{'as':'Account','foreignKey':_0x972c('0x186')});db[_0x972c('0x60')]['belongsTo'](db['CmContact'],{'as':_0x972c('0x156'),'foreignKey':_0x972c('0x157')});db['OpenchannelInteraction'][_0x972c('0x11b')](db[_0x972c('0x11')],{'as':_0x972c('0x169'),'foreignKey':_0x972c('0x10c')});db['OpenchannelInteraction'][_0x972c('0x11c')](db['Tag'],{'through':_0x972c('0x189'),'as':_0x972c('0x16b')});db[_0x972c('0x60')]['belongsToMany'](db[_0x972c('0x8a')],{'through':_0x972c('0x189'),'as':_0x972c('0x17b')});db[_0x972c('0x60')][_0x972c('0x11c')](db[_0x972c('0x11')],{'as':_0x972c('0x16c'),'through':_0x972c('0x127'),'foreignKey':_0x972c('0x188')});db['OpenchannelMessage'][_0x972c('0x11b')](db[_0x972c('0x11')],{'onDelete':'cascade','as':_0x972c('0x11')});db[_0x972c('0x62')][_0x972c('0x11b')](db[_0x972c('0x120')],{'onDelete':_0x972c('0x10b'),'as':_0x972c('0x156')});db['OpenchannelMessage'][_0x972c('0x11b')](db[_0x972c('0x60')],{'onDelete':_0x972c('0x10b'),'as':_0x972c('0x16f'),'foreignKey':_0x972c('0x188')});db[_0x972c('0x62')][_0x972c('0x11b')](db[_0x972c('0xe1')],{'as':_0x972c('0xe1'),'foreignKey':_0x972c('0x17c')});db[_0x972c('0x62')]['belongsTo'](db['OpenchannelAccount'],{'as':_0x972c('0x168'),'foreignKey':_0x972c('0x186')});db['OpenchannelQueue'][_0x972c('0x11c')](db[_0x972c('0x11')],{'as':_0x972c('0x166'),'through':'UserOpenchannelQueue','foreignKey':_0x972c('0x18a')});db['OpenchannelQueue'][_0x972c('0x11c')](db[_0x972c('0xdb')],{'through':'team_has_openchannel_queues','as':_0x972c('0x14b')});db[_0x972c('0x66')]['hasMany'](db['Disposition'],{'as':_0x972c('0x15d'),'foreignKey':'ChatWebsiteId','onDelete':_0x972c('0x10b')});db[_0x972c('0x66')][_0x972c('0x10e')](db[_0x972c('0x80')],{'as':_0x972c('0x15e'),'foreignKey':_0x972c('0x170')});db[_0x972c('0x66')][_0x972c('0x10e')](db[_0x972c('0x18b')],{'as':_0x972c('0x18c')});db[_0x972c('0x66')]['hasMany'](db[_0x972c('0x6b')],{'as':_0x972c('0x15f')});db[_0x972c('0x66')][_0x972c('0x10e')](db[_0x972c('0x6a')],{'as':_0x972c('0x140'),'foreignKey':_0x972c('0x170'),'onDelete':_0x972c('0x10b')});db[_0x972c('0x66')]['hasMany'](db[_0x972c('0x6c')],{'as':_0x972c('0x14f')});db['ChatWebsite']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x972c('0x161')});db['ChatWebsite'][_0x972c('0x11b')](db[_0x972c('0x84')],{'as':_0x972c('0x84'),'foreignKey':_0x972c('0x172')});db[_0x972c('0x66')][_0x972c('0x11b')](db[_0x972c('0x3c')],{'as':_0x972c('0x3c'),'foreignKey':'MailAccountId'});db[_0x972c('0x66')][_0x972c('0x11b')](db[_0x972c('0x164')],{'as':_0x972c('0x149'),'foreignKey':_0x972c('0x165')});db['ChatWebsite'][_0x972c('0x11c')](db[_0x972c('0x11')],{'as':'Agents','through':_0x972c('0x132')});db[_0x972c('0x68')]['belongsTo'](db[_0x972c('0x5c')],{});db[_0x972c('0x68')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x972c('0x68')][_0x972c('0x11b')](db['CmContact'],{'as':_0x972c('0x156'),'foreignKey':'ContactId'});db[_0x972c('0x68')]['belongsTo'](db[_0x972c('0x60')],{});db['OpenchannelQueueReport'][_0x972c('0x11b')](db['OpenchannelMessage'],{});db['OpenchannelQueueReport'][_0x972c('0x11b')](db['User'],{});db['OpenchannelQueueReport'][_0x972c('0x11b')](db[_0x972c('0x64')],{});db[_0x972c('0x6a')][_0x972c('0x11b')](db['User'],{'as':_0x972c('0x18d'),'foreignKey':'UserId','onDelete':_0x972c('0x15a')});db[_0x972c('0x6a')]['belongsTo'](db[_0x972c('0x6f')],{'as':_0x972c('0x18e'),'foreignKey':_0x972c('0x18f'),'onDelete':_0x972c('0x15a')});db[_0x972c('0x6a')][_0x972c('0x11b')](db[_0x972c('0x66')],{'as':_0x972c('0x190'),'foreignKey':_0x972c('0x170'),'onDelete':_0x972c('0x15a')});db[_0x972c('0x6a')][_0x972c('0x11b')](db[_0x972c('0x8a')],{'onDelete':_0x972c('0x15a'),'foreignKey':_0x972c('0x173')});db[_0x972c('0x6b')][_0x972c('0x10e')](db[_0x972c('0x6c')],{'as':_0x972c('0x14f'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x191')});db[_0x972c('0x6b')][_0x972c('0x11b')](db[_0x972c('0x66')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x972c('0x6b')]['belongsTo'](db[_0x972c('0x120')],{'as':_0x972c('0x156'),'foreignKey':_0x972c('0x157')});db[_0x972c('0x6b')]['belongsTo'](db[_0x972c('0x11')],{'as':_0x972c('0x169'),'foreignKey':_0x972c('0x10c')});db[_0x972c('0x6b')][_0x972c('0x11c')](db[_0x972c('0x8a')],{'through':_0x972c('0x192'),'as':_0x972c('0x16b')});db[_0x972c('0x6b')]['belongsToMany'](db[_0x972c('0x8a')],{'through':'chat_interaction_has_tags','as':_0x972c('0x17b')});db[_0x972c('0x6b')][_0x972c('0x11c')](db[_0x972c('0x11')],{'as':_0x972c('0x16c'),'through':_0x972c('0x125'),'foreignKey':_0x972c('0x191')});db[_0x972c('0x6c')][_0x972c('0x11b')](db[_0x972c('0x11')],{'onDelete':'cascade','as':_0x972c('0x11')});db[_0x972c('0x6c')][_0x972c('0x11b')](db[_0x972c('0x120')],{'onDelete':'cascade','as':_0x972c('0x156'),'foreignKey':_0x972c('0x157')});db[_0x972c('0x6c')][_0x972c('0x11b')](db['ChatInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x972c('0x191')});db[_0x972c('0x6c')][_0x972c('0x11b')](db[_0x972c('0xe1')],{'as':_0x972c('0xe1'),'foreignKey':'AttachmentId'});db[_0x972c('0x6c')]['belongsTo'](db[_0x972c('0x66')],{'as':'Account','foreignKey':_0x972c('0x170')});db[_0x972c('0x6d')]['hasMany'](db[_0x972c('0xe1')],{'as':'Attachments','foreignKey':_0x972c('0x171'),'onDelete':'cascade','hooks':!![]});db[_0x972c('0x6d')][_0x972c('0x11b')](db['CmContact'],{'onDelete':'cascade','as':_0x972c('0x156'),'foreignKey':_0x972c('0x157')});db[_0x972c('0x6d')][_0x972c('0x11b')](db[_0x972c('0x66')],{'as':_0x972c('0x168'),'foreignKey':_0x972c('0x170')});db[_0x972c('0x6f')][_0x972c('0x11c')](db[_0x972c('0x11')],{'as':_0x972c('0x166'),'through':_0x972c('0x30'),'hooks':!![]});db[_0x972c('0x6f')]['belongsToMany'](db[_0x972c('0xdb')],{'through':_0x972c('0x193'),'as':'Teams'});db[_0x972c('0x11d')][_0x972c('0x10e')](db[_0x972c('0x194')],{'as':_0x972c('0x14f'),'foreignKey':_0x972c('0x195'),'onDelete':_0x972c('0x10b')});db[_0x972c('0x11d')]['belongsToMany'](db[_0x972c('0x11')],{'as':_0x972c('0x196'),'through':'chat_group_has_users'});db[_0x972c('0x18b')][_0x972c('0x11b')](db[_0x972c('0x66')],{'as':'Website','foreignKey':_0x972c('0x170')});db[_0x972c('0x72')][_0x972c('0x10e')](db['CmContact'],{'as':_0x972c('0x197'),'foreignKey':'CompanyId'});db[_0x972c('0x120')][_0x972c('0x10e')](db[_0x972c('0x8d')],{'as':_0x972c('0x198'),'foreignKey':_0x972c('0x199')});db['CmContact'][_0x972c('0x10e')](db[_0x972c('0x73')],{'as':_0x972c('0x119'),'foreignKey':'ContactId'});db[_0x972c('0x120')][_0x972c('0x10e')](db['CmHopperFinal'],{'as':_0x972c('0x111'),'foreignKey':_0x972c('0x157')});db[_0x972c('0x120')]['hasMany'](db[_0x972c('0x77')],{'as':_0x972c('0x142'),'foreignKey':'ContactId'});db[_0x972c('0x120')][_0x972c('0x10e')](db['ReportAgentPreview'],{'as':_0x972c('0x112'),'foreignKey':_0x972c('0x157')});db['CmContact']['hasMany'](db[_0x972c('0xcd')],{'as':_0x972c('0x144'),'foreignKey':_0x972c('0x157')});db['CmContact'][_0x972c('0x10e')](db[_0x972c('0x60')],{'as':_0x972c('0x113'),'foreignKey':_0x972c('0x157'),'onDelete':_0x972c('0x15a')});db[_0x972c('0x120')][_0x972c('0x10e')](db[_0x972c('0x6b')],{'as':_0x972c('0x124'),'foreignKey':_0x972c('0x157'),'onDelete':'restrict'});db[_0x972c('0x120')][_0x972c('0x10e')](db[_0x972c('0x57')],{'as':_0x972c('0x114'),'foreignKey':'ContactId','onDelete':_0x972c('0x15a')});db[_0x972c('0x120')]['hasMany'](db[_0x972c('0x115')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':_0x972c('0x15a')});db[_0x972c('0x120')][_0x972c('0x10e')](db[_0x972c('0x42')],{'as':_0x972c('0x117'),'foreignKey':_0x972c('0x157'),'onDelete':'restrict'});db[_0x972c('0x120')][_0x972c('0x11b')](db[_0x972c('0x72')],{'as':_0x972c('0x19a'),'foreignKey':_0x972c('0x19b')});db[_0x972c('0x120')][_0x972c('0x11b')](db[_0x972c('0xea')],{'as':_0x972c('0x160'),'foreignKey':_0x972c('0x161'),'onDelete':_0x972c('0x10b')});db['CmContact'][_0x972c('0x11c')](db[_0x972c('0x11')],{'as':_0x972c('0x16c'),'through':'cm_user_has_contacts'});db[_0x972c('0x120')][_0x972c('0x11c')](db[_0x972c('0x8a')],{'as':'Tags','through':'cm_contact_has_tags'});db[_0x972c('0x120')][_0x972c('0x11c')](db[_0x972c('0x8a')],{'through':_0x972c('0x19c'),'as':_0x972c('0x17b')});db[_0x972c('0x73')]['hasMany'](db['CmHopperAdditionalPhone'],{'as':'AdditionalPhones','foreignKey':'CmHopperId'});db['CmHopper'][_0x972c('0x11b')](db['CmContact'],{'as':_0x972c('0x156'),'foreignKey':_0x972c('0x157'),'onDelete':_0x972c('0x10b')});db['CmHopper'][_0x972c('0x11b')](db[_0x972c('0xea')],{'as':_0x972c('0x160'),'foreignKey':_0x972c('0x161'),'onDelete':'cascade'});db[_0x972c('0x73')]['belongsTo'](db['User'],{'as':_0x972c('0x18d'),'foreignKey':'UserId'});db[_0x972c('0x73')]['belongsTo'](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x972c('0x141'),'onDelete':_0x972c('0x10b')});db[_0x972c('0x73')][_0x972c('0x11b')](db[_0x972c('0xde')],{'as':_0x972c('0xde'),'foreignKey':_0x972c('0x19d'),'onDelete':_0x972c('0x10b')});db['CmHopper']['belongsTo'](db[_0x972c('0x11')],{'as':_0x972c('0x169'),'foreignKey':_0x972c('0x19e')});db[_0x972c('0x74')][_0x972c('0x11b')](db[_0x972c('0x120')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0x972c('0x10b')});db[_0x972c('0x74')][_0x972c('0x11b')](db[_0x972c('0xea')],{'as':_0x972c('0x160'),'foreignKey':_0x972c('0x161'),'onDelete':'cascade'});db[_0x972c('0x74')][_0x972c('0x11b')](db[_0x972c('0x1b')],{'as':_0x972c('0x18e'),'foreignKey':_0x972c('0x141'),'onDelete':'cascade'});db[_0x972c('0x74')]['belongsTo'](db['Campaign'],{'as':_0x972c('0xde'),'foreignKey':_0x972c('0x19d'),'onDelete':_0x972c('0x10b')});db[_0x972c('0x7e')]['hasMany'](db[_0x972c('0x19f')],{'as':{'plural':_0x972c('0x1a0'),'singular':_0x972c('0x1a1')},'foreignKey':_0x972c('0x1a2'),'onDelete':'cascade','hooks':!![]});db['Automation']['hasMany'](db[_0x972c('0x19f')],{'as':{'plural':_0x972c('0x1a3'),'singular':_0x972c('0x1a4')},'foreignKey':_0x972c('0x1a5'),'onDelete':'cascade','hooks':!![]});db[_0x972c('0x7e')][_0x972c('0x10e')](db['Action'],{'as':_0x972c('0x1a6'),'foreignKey':_0x972c('0x1a7'),'onDelete':'cascade','hooks':!![]});db[_0x972c('0x81')]['hasMany'](db[_0x972c('0x81')],{'as':_0x972c('0x15d'),'foreignKey':'ParentId','onDelete':_0x972c('0x10b')});db[_0x972c('0x84')][_0x972c('0x10e')](db[_0x972c('0x84')],{'as':'Intervals','foreignKey':_0x972c('0x172'),'onDelete':_0x972c('0x10b'),'hooks':!![],'required':![]});db[_0x972c('0x84')][_0x972c('0x10e')](db[_0x972c('0x17')],{'as':_0x972c('0x1a8'),'foreignKey':_0x972c('0x172'),'onDelete':_0x972c('0x15a')});db[_0x972c('0x84')]['hasMany'](db[_0x972c('0x46')],{'as':_0x972c('0x1a9'),'foreignKey':_0x972c('0x172')});db[_0x972c('0x84')]['hasMany'](db[_0x972c('0x6a')],{'as':_0x972c('0x1aa'),'foreignKey':_0x972c('0x172')});db[_0x972c('0x84')][_0x972c('0x10e')](db[_0x972c('0x4c')],{'as':_0x972c('0x1ab'),'foreignKey':_0x972c('0x172')});db[_0x972c('0x84')][_0x972c('0x10e')](db[_0x972c('0x55')],{'as':_0x972c('0x1ac'),'foreignKey':_0x972c('0x172')});db['Schedule']['belongsTo'](db[_0x972c('0x3c')],{});db[_0x972c('0x87')]['belongsTo'](db[_0x972c('0x9a')],{'foreignKey':_0x972c('0x1ad')});db['Schedule'][_0x972c('0x11b')](db[_0x972c('0x98')],{'foreignKey':_0x972c('0x1ae')});db[_0x972c('0x88')][_0x972c('0x11c')](db[_0x972c('0x19')],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0x972c('0x15a')});db[_0x972c('0x8a')][_0x972c('0x11c')](db[_0x972c('0x120')],{'through':_0x972c('0x19c')});db['Tag'][_0x972c('0x11c')](db[_0x972c('0x6b')],{'through':_0x972c('0x192')});db[_0x972c('0x8a')][_0x972c('0x11c')](db[_0x972c('0x42')],{'through':_0x972c('0x16a')});db[_0x972c('0x8a')][_0x972c('0x11c')](db[_0x972c('0x57')],{'through':_0x972c('0x182')});db['Tag']['belongsToMany'](db[_0x972c('0x115')],{'through':_0x972c('0x17a')});db[_0x972c('0x8a')][_0x972c('0x11c')](db['OpenchannelInteraction'],{'through':_0x972c('0x189')});db[_0x972c('0x8a')][_0x972c('0x11c')](db['WhatsappInteraction'],{'through':_0x972c('0x1af')});db['CmContactHasItem']['belongsTo'](db[_0x972c('0x1b0')],{'as':'ItemType','foreignKey':_0x972c('0x1b1')});db[_0x972c('0x8e')][_0x972c('0x11b')](db[_0x972c('0x73')],{'as':_0x972c('0x1b2'),'foreignKey':_0x972c('0x1b3')});db['CmContactHasItem']['belongsTo'](db[_0x972c('0x120')],{'as':'Contact','foreignKey':_0x972c('0x199')});db['Trigger']['hasMany'](db['Condition'],{'as':{'plural':_0x972c('0x1b4'),'singular':_0x972c('0x1b5')},'foreignKey':_0x972c('0x1b6'),'onDelete':_0x972c('0x10b'),'hooks':!![]});db[_0x972c('0x90')][_0x972c('0x10e')](db[_0x972c('0x19f')],{'as':{'plural':_0x972c('0x1b7'),'singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':_0x972c('0x10b'),'hooks':!![]});db[_0x972c('0x90')][_0x972c('0x10e')](db[_0x972c('0x7c')],{'as':_0x972c('0x1a6'),'foreignKey':_0x972c('0x1b8'),'onDelete':_0x972c('0x10b'),'hooks':!![]});db[_0x972c('0x98')][_0x972c('0x10e')](db['AnalyticFieldReport'],{'as':_0x972c('0x1b9'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x1ae'),'hooks':!![]});db[_0x972c('0x9a')][_0x972c('0x10e')](db[_0x972c('0x1ba')],{'as':_0x972c('0x1b9'),'onDelete':_0x972c('0x10b'),'foreignKey':'DefaultReportId'});db[_0x972c('0x1bb')]['hasMany'](db[_0x972c('0x1ba')],{'as':_0x972c('0x1b9'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x1bc')});db['AnalyticFieldReport'][_0x972c('0x11b')](db[_0x972c('0x1bb')],{'foreignKey':_0x972c('0x1bc')});db[_0x972c('0x9f')][_0x972c('0x10e')](db[_0x972c('0xa0')],{'as':'Configurations','onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x1bd')});db['SalesforceConfiguration'][_0x972c('0x10e')](db[_0x972c('0xa2')],{'as':_0x972c('0x1be'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x1bf')});db['SalesforceConfiguration'][_0x972c('0x10e')](db['SalesforceField'],{'as':_0x972c('0x1c0'),'onDelete':_0x972c('0x10b'),'foreignKey':'DescriptionId'});db[_0x972c('0xa0')][_0x972c('0x10e')](db['SalesforceField'],{'as':_0x972c('0x1b9'),'onDelete':_0x972c('0x10b'),'foreignKey':'FieldId'});db[_0x972c('0xa0')][_0x972c('0x11b')](db['SalesforceAccount'],{'as':_0x972c('0x168'),'foreignKey':_0x972c('0x1bd')});db[_0x972c('0xa2')]['hasMany'](db[_0x972c('0xa2')],{'as':_0x972c('0x1c1'),'foreignKey':'SubjectId'});db[_0x972c('0xa2')][_0x972c('0x10e')](db['SalesforceField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x972c('0xa2')][_0x972c('0x10e')](db[_0x972c('0xa2')],{'as':_0x972c('0x1c2'),'foreignKey':_0x972c('0x1c3')});db[_0x972c('0xa2')][_0x972c('0x11b')](db['Variable'],{'as':_0x972c('0x92'),'foreignKey':'VariableId'});db['SugarcrmAccount'][_0x972c('0x10e')](db[_0x972c('0x1c4')],{'as':_0x972c('0x1c5'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x1bd')});db[_0x972c('0x1c4')][_0x972c('0x10e')](db[_0x972c('0xa6')],{'as':'Subjects','onDelete':_0x972c('0x10b'),'foreignKey':'SubjectId'});db[_0x972c('0x1c4')]['hasMany'](db[_0x972c('0xa6')],{'as':_0x972c('0x1c0'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x972c('0x1c4')][_0x972c('0x10e')](db[_0x972c('0xa6')],{'as':_0x972c('0x1b9'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x1c3')});db[_0x972c('0x1c4')][_0x972c('0x11b')](db[_0x972c('0xa3')],{'as':_0x972c('0x168'),'foreignKey':_0x972c('0x1bd')});db[_0x972c('0xa6')][_0x972c('0x10e')](db[_0x972c('0xa6')],{'as':_0x972c('0x1c1'),'foreignKey':_0x972c('0x1bf')});db[_0x972c('0xa6')][_0x972c('0x10e')](db[_0x972c('0xa6')],{'as':_0x972c('0x1c6'),'foreignKey':'DescriptionId'});db[_0x972c('0xa6')][_0x972c('0x10e')](db[_0x972c('0xa6')],{'as':_0x972c('0x1c2'),'foreignKey':_0x972c('0x1c3')});db['SugarcrmField'][_0x972c('0x11b')](db['Variable'],{'as':_0x972c('0x92'),'foreignKey':_0x972c('0x1c7')});db[_0x972c('0x1c8')]['hasMany'](db[_0x972c('0xa8')],{'as':'Configurations','onDelete':_0x972c('0x10b'),'foreignKey':'AccountId'});db[_0x972c('0xa8')][_0x972c('0x10e')](db[_0x972c('0xaa')],{'as':_0x972c('0x1be'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x1bf')});db[_0x972c('0xa8')]['hasMany'](db[_0x972c('0xaa')],{'as':_0x972c('0x1c0'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x1c9')});db['DeskConfiguration']['hasMany'](db[_0x972c('0xaa')],{'as':_0x972c('0x1b9'),'onDelete':'cascade','foreignKey':_0x972c('0x1c3')});db[_0x972c('0xa8')]['belongsTo'](db[_0x972c('0x1c8')],{'as':_0x972c('0x168'),'foreignKey':_0x972c('0x1bd')});db[_0x972c('0xa8')][_0x972c('0x11c')](db[_0x972c('0x8a')],{'through':_0x972c('0x1ca')});db[_0x972c('0xaa')][_0x972c('0x10e')](db[_0x972c('0xaa')],{'as':'Subject','foreignKey':'SubjectId'});db['DeskField'][_0x972c('0x10e')](db['DeskField'],{'as':_0x972c('0x1c6'),'foreignKey':_0x972c('0x1c9')});db['DeskField'][_0x972c('0x10e')](db[_0x972c('0xaa')],{'as':_0x972c('0x1c2'),'foreignKey':_0x972c('0x1c3')});db[_0x972c('0xaa')][_0x972c('0x11b')](db[_0x972c('0x92')],{'as':_0x972c('0x92'),'foreignKey':_0x972c('0x1c7')});db[_0x972c('0x1cb')][_0x972c('0x10e')](db[_0x972c('0xad')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x972c('0x1bd')});db[_0x972c('0xad')]['hasMany'](db[_0x972c('0xae')],{'as':_0x972c('0x1be'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x1bf')});db[_0x972c('0xad')]['hasMany'](db['ZohoField'],{'as':_0x972c('0x1c0'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x1c9')});db[_0x972c('0xad')]['hasMany'](db[_0x972c('0xae')],{'as':_0x972c('0x1b9'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x972c('0xad')]['belongsTo'](db['ZohoAccount'],{'as':'Account','foreignKey':_0x972c('0x1bd')});db[_0x972c('0xae')][_0x972c('0x10e')](db[_0x972c('0xae')],{'as':_0x972c('0x1c1'),'foreignKey':'SubjectId'});db['ZohoField'][_0x972c('0x10e')](db[_0x972c('0xae')],{'as':_0x972c('0x1c6'),'foreignKey':_0x972c('0x1c9')});db['ZohoField'][_0x972c('0x10e')](db['ZohoField'],{'as':'Field','foreignKey':_0x972c('0x1c3')});db['ZohoField'][_0x972c('0x11b')](db[_0x972c('0x92')],{'as':'Variable','foreignKey':_0x972c('0x1c7')});db[_0x972c('0xaf')][_0x972c('0x10e')](db[_0x972c('0xb1')],{'as':_0x972c('0x1c5'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x1bd')});db[_0x972c('0xb1')][_0x972c('0x10e')](db[_0x972c('0xb2')],{'as':_0x972c('0x1be'),'foreignKey':_0x972c('0x1bf')});db[_0x972c('0xb1')]['hasMany'](db[_0x972c('0xb2')],{'as':'Descriptions','foreignKey':_0x972c('0x1c9')});db[_0x972c('0xb1')][_0x972c('0x10e')](db[_0x972c('0xb2')],{'as':'Fields','foreignKey':'FieldId'});db[_0x972c('0xb1')][_0x972c('0x11b')](db[_0x972c('0xaf')],{'as':_0x972c('0x168'),'foreignKey':_0x972c('0x1bd')});db[_0x972c('0xb1')][_0x972c('0x11c')](db[_0x972c('0x8a')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0x972c('0x10e')](db[_0x972c('0xb2')],{'as':_0x972c('0x1c1'),'foreignKey':_0x972c('0x1bf')});db[_0x972c('0xb2')][_0x972c('0x10e')](db[_0x972c('0xb2')],{'as':_0x972c('0x1c6'),'foreignKey':_0x972c('0x1c9')});db['ZendeskField'][_0x972c('0x10e')](db[_0x972c('0xb2')],{'as':_0x972c('0x1c2'),'foreignKey':_0x972c('0x1c3')});db[_0x972c('0xb2')][_0x972c('0x11b')](db[_0x972c('0x92')],{'as':_0x972c('0x92'),'foreignKey':_0x972c('0x1c7')});db[_0x972c('0xb4')][_0x972c('0x10e')](db['FreshdeskConfiguration'],{'as':_0x972c('0x1c5'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x1bd')});db[_0x972c('0xb5')][_0x972c('0x10e')](db[_0x972c('0xb6')],{'as':_0x972c('0x1be'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x1bf')});db[_0x972c('0xb5')][_0x972c('0x10e')](db['FreshdeskField'],{'as':_0x972c('0x1c0'),'onDelete':_0x972c('0x10b'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration']['hasMany'](db['FreshdeskField'],{'as':_0x972c('0x1b9'),'onDelete':'cascade','foreignKey':_0x972c('0x1c3')});db['FreshdeskConfiguration'][_0x972c('0x11b')](db[_0x972c('0xb4')],{'as':_0x972c('0x168'),'foreignKey':_0x972c('0x1bd')});db['FreshdeskConfiguration'][_0x972c('0x11c')](db[_0x972c('0x8a')],{'through':_0x972c('0x1cc')});db[_0x972c('0xb6')][_0x972c('0x10e')](db[_0x972c('0xb6')],{'as':_0x972c('0x1c1'),'foreignKey':_0x972c('0x1bf')});db['FreshdeskField']['hasMany'](db['FreshdeskField'],{'as':_0x972c('0x1c6'),'foreignKey':_0x972c('0x1c9')});db[_0x972c('0xb6')]['hasMany'](db['FreshdeskField'],{'as':'Field','foreignKey':_0x972c('0x1c3')});db['FreshdeskField'][_0x972c('0x11b')](db[_0x972c('0x92')],{'as':_0x972c('0x92'),'foreignKey':_0x972c('0x1c7')});db[_0x972c('0x1cd')][_0x972c('0x10e')](db[_0x972c('0xb8')],{'as':_0x972c('0x1c5'),'onDelete':_0x972c('0x10b'),'foreignKey':'AccountId'});db[_0x972c('0xb8')][_0x972c('0x10e')](db[_0x972c('0xb9')],{'as':'Subjects','foreignKey':_0x972c('0x1bf')});db[_0x972c('0xb8')][_0x972c('0x10e')](db[_0x972c('0xb9')],{'as':_0x972c('0x1c0'),'foreignKey':_0x972c('0x1c9')});db[_0x972c('0xb8')][_0x972c('0x10e')](db[_0x972c('0xb9')],{'as':_0x972c('0x1b9'),'foreignKey':'FieldId'});db[_0x972c('0xb8')]['belongsTo'](db[_0x972c('0x1cd')],{'as':_0x972c('0x168'),'foreignKey':_0x972c('0x1bd')});db['VtigerField']['hasMany'](db[_0x972c('0xb9')],{'as':_0x972c('0x1c1'),'foreignKey':_0x972c('0x1bf')});db['VtigerField'][_0x972c('0x10e')](db[_0x972c('0xb9')],{'as':_0x972c('0x1c6'),'foreignKey':_0x972c('0x1c9')});db[_0x972c('0xb9')][_0x972c('0x10e')](db[_0x972c('0xb9')],{'as':_0x972c('0x1c2'),'foreignKey':_0x972c('0x1c3')});db[_0x972c('0xb9')]['belongsTo'](db[_0x972c('0x92')],{'as':_0x972c('0x92'),'foreignKey':'VariableId'});db[_0x972c('0x1ce')][_0x972c('0x10e')](db['ServicenowConfiguration'],{'as':_0x972c('0x1c5'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x1bd')});db['ServicenowConfiguration'][_0x972c('0x10e')](db[_0x972c('0xbc')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x972c('0x1cf')][_0x972c('0x10e')](db[_0x972c('0xbc')],{'as':_0x972c('0x1c0'),'foreignKey':_0x972c('0x1c9')});db['ServicenowConfiguration'][_0x972c('0x10e')](db[_0x972c('0xbc')],{'as':'Fields','foreignKey':_0x972c('0x1c3')});db[_0x972c('0x1cf')][_0x972c('0x11b')](db[_0x972c('0x1ce')],{'as':_0x972c('0x168'),'foreignKey':'AccountId'});db['ServicenowField'][_0x972c('0x10e')](db[_0x972c('0xbc')],{'as':_0x972c('0x1c1'),'foreignKey':_0x972c('0x1bf')});db[_0x972c('0xbc')]['hasMany'](db[_0x972c('0xbc')],{'as':_0x972c('0x1c6'),'foreignKey':'DescriptionId'});db[_0x972c('0xbc')][_0x972c('0x10e')](db[_0x972c('0xbc')],{'as':_0x972c('0x1c2'),'foreignKey':_0x972c('0x1c3')});db[_0x972c('0xbc')][_0x972c('0x11b')](db[_0x972c('0x92')],{'as':_0x972c('0x92'),'foreignKey':'VariableId'});db[_0x972c('0xbe')][_0x972c('0x10e')](db[_0x972c('0x1d0')],{'as':_0x972c('0x1c5'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x1bd')});db[_0x972c('0xbe')][_0x972c('0x11b')](db['CloudProvider'],{'as':_0x972c('0x101'),'foreignKey':'CloudProviderId'});db['Dynamics365Configuration'][_0x972c('0x10e')](db['Dynamics365Field'],{'as':_0x972c('0x1be'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x1bf')});db['Dynamics365Configuration'][_0x972c('0x10e')](db[_0x972c('0xc0')],{'as':_0x972c('0x1c0'),'onDelete':'cascade','foreignKey':_0x972c('0x1c9')});db['Dynamics365Configuration'][_0x972c('0x10e')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x972c('0x10b'),'foreignKey':'FieldId'});db['Dynamics365Configuration'][_0x972c('0x11b')](db[_0x972c('0xbe')],{'as':_0x972c('0x168'),'foreignKey':_0x972c('0x1bd')});db[_0x972c('0xc0')][_0x972c('0x10e')](db[_0x972c('0xc0')],{'as':_0x972c('0x1c1'),'foreignKey':_0x972c('0x1bf')});db[_0x972c('0xc0')][_0x972c('0x10e')](db[_0x972c('0xc0')],{'as':_0x972c('0x1c6'),'foreignKey':_0x972c('0x1c9')});db[_0x972c('0xc0')][_0x972c('0x10e')](db['Dynamics365Field'],{'as':_0x972c('0x1c2'),'foreignKey':'FieldId'});db[_0x972c('0xc0')][_0x972c('0x11b')](db[_0x972c('0x92')],{'as':_0x972c('0x92'),'foreignKey':_0x972c('0x1c7')});db[_0x972c('0xc2')][_0x972c('0x10e')](db['FreshsalesConfiguration'],{'as':_0x972c('0x1c5'),'onDelete':'cascade','foreignKey':_0x972c('0x1bd')});db[_0x972c('0xc4')][_0x972c('0x10e')](db[_0x972c('0xc5')],{'as':_0x972c('0x1be'),'foreignKey':_0x972c('0x1bf')});db[_0x972c('0xc4')]['hasMany'](db[_0x972c('0xc5')],{'as':_0x972c('0x1c0'),'foreignKey':_0x972c('0x1c9')});db[_0x972c('0xc4')][_0x972c('0x10e')](db[_0x972c('0xc5')],{'as':'Fields','foreignKey':_0x972c('0x1c3')});db['FreshsalesConfiguration']['belongsTo'](db['FreshsalesAccount'],{'as':_0x972c('0x168'),'foreignKey':_0x972c('0x1bd')});db[_0x972c('0xc5')][_0x972c('0x10e')](db['FreshsalesField'],{'as':_0x972c('0x1c1'),'foreignKey':_0x972c('0x1bf')});db[_0x972c('0xc5')][_0x972c('0x10e')](db[_0x972c('0xc5')],{'as':_0x972c('0x1c6'),'foreignKey':'DescriptionId'});db[_0x972c('0xc5')][_0x972c('0x10e')](db[_0x972c('0xc5')],{'as':'Field','foreignKey':_0x972c('0x1c3')});db[_0x972c('0xc5')][_0x972c('0x11b')](db[_0x972c('0x92')],{'as':_0x972c('0x92'),'foreignKey':'VariableId'});db[_0x972c('0xc8')][_0x972c('0x11b')](db[_0x972c('0x66')],{});db[_0x972c('0xc8')][_0x972c('0x11b')](db[_0x972c('0xea')],{'as':_0x972c('0x160'),'foreignKey':_0x972c('0x161')});db['ChatQueueReport'][_0x972c('0x11b')](db['CmContact'],{'as':_0x972c('0x156'),'foreignKey':_0x972c('0x157')});db['ChatQueueReport'][_0x972c('0x11b')](db[_0x972c('0x6b')],{});db['ChatQueueReport'][_0x972c('0x11b')](db[_0x972c('0x6c')],{});db[_0x972c('0xc8')][_0x972c('0x11b')](db[_0x972c('0x11')],{});db[_0x972c('0xc8')][_0x972c('0x11b')](db[_0x972c('0x6f')],{});db['ChatInternalMessage'][_0x972c('0x11b')](db[_0x972c('0x11')],{'onDelete':'cascade','foreignKey':_0x972c('0x1d1')});db[_0x972c('0x194')][_0x972c('0x11b')](db['User'],{'onDelete':_0x972c('0x10b'),'foreignKey':'ToId'});db[_0x972c('0xcd')]['hasMany'](db[_0x972c('0x1d2')],{'foreignKey':_0x972c('0x1d3'),'onDelete':_0x972c('0x10b')});db[_0x972c('0xcd')][_0x972c('0x10e')](db[_0x972c('0x1d4')],{'foreignKey':_0x972c('0x1d3'),'onDelete':_0x972c('0x10b')});db[_0x972c('0xcf')][_0x972c('0x11b')](db['SmsAccount'],{});db['SmsQueueReport'][_0x972c('0x11b')](db['CmList'],{'as':'List','foreignKey':_0x972c('0x161')});db[_0x972c('0xcf')]['belongsTo'](db[_0x972c('0x120')],{'as':_0x972c('0x156'),'foreignKey':'ContactId'});db[_0x972c('0xcf')][_0x972c('0x11b')](db[_0x972c('0x57')],{});db[_0x972c('0xcf')][_0x972c('0x11b')](db[_0x972c('0x180')],{});db[_0x972c('0xcf')][_0x972c('0x11b')](db[_0x972c('0x11')],{});db[_0x972c('0xcf')][_0x972c('0x11b')](db[_0x972c('0x5a')],{});db[_0x972c('0xd3')][_0x972c('0x10e')](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db['JscriptyProject']['hasMany'](db[_0x972c('0x1d2')],{'foreignKey':_0x972c('0x1d5')});db[_0x972c('0xd3')][_0x972c('0x10e')](db[_0x972c('0x1d4')],{'foreignKey':'ProjectId'});db[_0x972c('0xdb')][_0x972c('0x11c')](db[_0x972c('0x11')],{'as':_0x972c('0x166'),'through':'user_has_teams'});db['Team'][_0x972c('0x11c')](db[_0x972c('0x1b')],{'through':_0x972c('0x103'),'as':_0x972c('0x12a')});db[_0x972c('0xdb')][_0x972c('0x11c')](db['MailQueue'],{'through':_0x972c('0x167'),'as':_0x972c('0x12c')});db[_0x972c('0xdb')][_0x972c('0x11c')](db['ChatQueue'],{'through':_0x972c('0x193'),'as':'ChatQueues'});db['Team']['belongsToMany'](db[_0x972c('0x51')],{'through':'team_has_fax_queues','as':_0x972c('0x1d6')});db[_0x972c('0xdb')][_0x972c('0x11c')](db[_0x972c('0x5a')],{'through':_0x972c('0x185'),'as':_0x972c('0x12e')});db[_0x972c('0xdb')][_0x972c('0x11c')](db[_0x972c('0x64')],{'through':_0x972c('0x1d7'),'as':_0x972c('0x12f')});db[_0x972c('0xdb')][_0x972c('0x11c')](db[_0x972c('0xff')],{'through':_0x972c('0x1d8'),'as':_0x972c('0x130')});db[_0x972c('0xdb')]['belongsToMany'](db[_0x972c('0xec')],{'through':_0x972c('0x1d9'),'as':_0x972c('0x12b')});db['Campaign']['hasMany'](db['CmHopper'],{'as':_0x972c('0x119'),'foreignKey':'CampaignId'});db[_0x972c('0xde')]['hasMany'](db['CmHopperFinal'],{'as':_0x972c('0x111'),'foreignKey':_0x972c('0x19d')});db[_0x972c('0xde')][_0x972c('0x10e')](db[_0x972c('0x77')],{'as':_0x972c('0x142'),'foreignKey':'CampaignId'});db[_0x972c('0xde')]['hasMany'](db[_0x972c('0x74')],{'as':_0x972c('0x143'),'foreignKey':'CampaignId'});db[_0x972c('0xde')][_0x972c('0x11b')](db[_0x972c('0x145')],{'as':_0x972c('0x145'),'foreignKey':'TrunkId'});db[_0x972c('0xde')][_0x972c('0x11b')](db[_0x972c('0x145')],{'as':'TrunkBackup','foreignKey':_0x972c('0x148')});db[_0x972c('0xde')][_0x972c('0x11b')](db[_0x972c('0x84')],{'as':'Interval','foreignKey':_0x972c('0x172')});db[_0x972c('0xde')][_0x972c('0x11b')](db[_0x972c('0xd8')],{'as':'SquareProject','foreignKey':_0x972c('0x1da')});db[_0x972c('0xde')]['belongsToMany'](db[_0x972c('0xea')],{'as':_0x972c('0x122'),'through':_0x972c('0x1db')});db[_0x972c('0xde')][_0x972c('0x11c')](db[_0x972c('0xea')],{'as':_0x972c('0x14c'),'through':_0x972c('0x1dc')});db[_0x972c('0xe1')]['belongsTo'](db[_0x972c('0x6d')],{'as':_0x972c('0x6d'),'foreignKey':_0x972c('0x171')});db['MailTransferReport'][_0x972c('0x11b')](db[_0x972c('0x44')],{});db[_0x972c('0x1dd')][_0x972c('0x11b')](db[_0x972c('0x42')],{});db[_0x972c('0x1dd')][_0x972c('0x11b')](db['MailAccount'],{'foreignKey':_0x972c('0x1de'),'as':_0x972c('0x1df')});db['MailTransferReport'][_0x972c('0x11b')](db[_0x972c('0x11')],{'foreignKey':'FromUserId','as':_0x972c('0x1e0')});db[_0x972c('0x1dd')][_0x972c('0x11b')](db[_0x972c('0x11')],{'foreignKey':_0x972c('0x1e1'),'as':'ToAgent'});db[_0x972c('0x1dd')][_0x972c('0x11b')](db[_0x972c('0x3e')],{'foreignKey':_0x972c('0x1e2'),'as':_0x972c('0x1e3')});db[_0x972c('0x1dd')][_0x972c('0x11b')](db[_0x972c('0x3c')],{'foreignKey':'ToMailAccountId','as':_0x972c('0x1e4')});db[_0x972c('0x1e5')][_0x972c('0x11b')](db['ChatMessage'],{});db[_0x972c('0x1e5')][_0x972c('0x11b')](db[_0x972c('0x6b')],{});db[_0x972c('0x1e5')]['belongsTo'](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0x972c('0x1df')});db[_0x972c('0x1e5')][_0x972c('0x11b')](db[_0x972c('0x11')],{'foreignKey':_0x972c('0x1e6'),'as':_0x972c('0x1e0')});db[_0x972c('0x1e5')][_0x972c('0x11b')](db['User'],{'foreignKey':_0x972c('0x1e1'),'as':_0x972c('0x1e7')});db[_0x972c('0x1e5')][_0x972c('0x11b')](db[_0x972c('0x6f')],{'foreignKey':_0x972c('0x1e8'),'as':_0x972c('0x1e3')});db['ChatTransferReport'][_0x972c('0x11b')](db[_0x972c('0x66')],{'foreignKey':_0x972c('0x1e9'),'as':_0x972c('0x1e4')});db['FaxTransferReport']['belongsTo'](db[_0x972c('0x4f')],{});db[_0x972c('0xe5')][_0x972c('0x11b')](db['FaxInteraction'],{});db['FaxTransferReport'][_0x972c('0x11b')](db['FaxAccount'],{'foreignKey':_0x972c('0x1ea'),'as':_0x972c('0x1df')});db['FaxTransferReport'][_0x972c('0x11b')](db[_0x972c('0x11')],{'foreignKey':'FromUserId','as':_0x972c('0x1e0')});db[_0x972c('0xe5')][_0x972c('0x11b')](db[_0x972c('0x11')],{'foreignKey':_0x972c('0x1e1'),'as':_0x972c('0x1e7')});db[_0x972c('0xe5')][_0x972c('0x11b')](db[_0x972c('0x51')],{'foreignKey':_0x972c('0x1eb'),'as':_0x972c('0x1e3')});db[_0x972c('0xe5')][_0x972c('0x11b')](db[_0x972c('0x4a')],{'foreignKey':_0x972c('0x1ec'),'as':_0x972c('0x1e4')});db['OpenchannelTransferReport'][_0x972c('0x11b')](db[_0x972c('0x62')],{});db[_0x972c('0xe6')][_0x972c('0x11b')](db[_0x972c('0x60')],{});db[_0x972c('0xe6')][_0x972c('0x11b')](db[_0x972c('0x5c')],{'foreignKey':_0x972c('0x1ed'),'as':_0x972c('0x1df')});db['OpenchannelTransferReport'][_0x972c('0x11b')](db[_0x972c('0x11')],{'foreignKey':_0x972c('0x1e6'),'as':'FromAgent'});db[_0x972c('0xe6')][_0x972c('0x11b')](db[_0x972c('0x11')],{'foreignKey':_0x972c('0x1e1'),'as':_0x972c('0x1e7')});db[_0x972c('0xe6')][_0x972c('0x11b')](db[_0x972c('0x64')],{'foreignKey':'ToOpenchannelQueueId','as':_0x972c('0x1e3')});db[_0x972c('0xe6')][_0x972c('0x11b')](db[_0x972c('0x5c')],{'foreignKey':_0x972c('0x1ee'),'as':_0x972c('0x1e4')});db[_0x972c('0xe8')][_0x972c('0x11b')](db[_0x972c('0x180')],{});db[_0x972c('0xe8')][_0x972c('0x11b')](db[_0x972c('0x57')],{});db[_0x972c('0xe8')][_0x972c('0x11b')](db[_0x972c('0x138')],{'foreignKey':'FromSmsAccountId','as':_0x972c('0x1df')});db['SmsTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x972c('0x1e6'),'as':_0x972c('0x1e0')});db[_0x972c('0xe8')]['belongsTo'](db[_0x972c('0x11')],{'foreignKey':_0x972c('0x1e1'),'as':_0x972c('0x1e7')});db[_0x972c('0xe8')]['belongsTo'](db[_0x972c('0x5a')],{'foreignKey':_0x972c('0x1ef'),'as':_0x972c('0x1e3')});db['SmsTransferReport'][_0x972c('0x11b')](db[_0x972c('0x138')],{'foreignKey':_0x972c('0x1f0'),'as':'ToAccount'});db['CmList']['hasMany'](db[_0x972c('0x81')],{'as':_0x972c('0x15d'),'foreignKey':_0x972c('0x161'),'onDelete':'cascade'});db[_0x972c('0xea')]['hasMany'](db[_0x972c('0x7a')],{'as':_0x972c('0x1f1'),'foreignKey':'ListId'});db['CmList'][_0x972c('0x10e')](db['CmContact'],{'as':_0x972c('0x197'),'onDelete':_0x972c('0x10b'),'foreignKey':_0x972c('0x161')});db[_0x972c('0xea')]['hasMany'](db[_0x972c('0x75')],{'as':_0x972c('0x111'),'foreignKey':_0x972c('0x161')});db[_0x972c('0xea')][_0x972c('0x10e')](db['CmHopperHistory'],{'as':_0x972c('0x1f2'),'foreignKey':_0x972c('0x161')});db[_0x972c('0xea')]['hasMany'](db[_0x972c('0x112')],{'as':'ReportAgentPreview','foreignKey':_0x972c('0x161')});db[_0x972c('0xea')]['belongsToMany'](db[_0x972c('0x1b')],{'as':'Queues','through':_0x972c('0x14a')});db[_0x972c('0xea')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x972c('0x1f3')});db[_0x972c('0xec')][_0x972c('0x10e')](db[_0x972c('0x17')],{'as':_0x972c('0x1a8'),'onDelete':_0x972c('0x10b')});db['VoicePrefix']['belongsToMany'](db[_0x972c('0x11')],{'as':_0x972c('0x166'),'through':_0x972c('0x105')});db['VoicePrefix'][_0x972c('0x11c')](db[_0x972c('0xdb')],{'through':_0x972c('0x1d9'),'as':_0x972c('0x14b')});db[_0x972c('0xee')]['hasMany'](db['User'],{'as':'Users','foreignKey':_0x972c('0x1f4')});db[_0x972c('0xee')]['hasMany'](db[_0x972c('0xf0')],{'as':_0x972c('0x1f5'),'foreignKey':_0x972c('0x1f4'),'onDelete':_0x972c('0x10b')});db['UserProfileSection'][_0x972c('0x10e')](db[_0x972c('0xf1')],{'as':_0x972c('0x1f6'),'foreignKey':_0x972c('0x1f7'),'onDelete':_0x972c('0x10b')});db[_0x972c('0xf4')]['hasMany'](db[_0x972c('0x81')],{'as':_0x972c('0x15d'),'foreignKey':_0x972c('0x1f8'),'onDelete':_0x972c('0x10b')});db[_0x972c('0xf4')][_0x972c('0x10e')](db[_0x972c('0x80')],{'as':_0x972c('0x15e'),'foreignKey':_0x972c('0x1f8')});db[_0x972c('0xf4')][_0x972c('0x10e')](db[_0x972c('0x1f9')],{'as':'Messages','foreignKey':'WhatsappAccountId'});db[_0x972c('0xf4')][_0x972c('0x10e')](db[_0x972c('0xf8')],{'as':_0x972c('0x15f')});db[_0x972c('0xf4')][_0x972c('0x10e')](db[_0x972c('0xf6')],{'as':_0x972c('0x140'),'foreignKey':'WhatsappAccountId','onDelete':_0x972c('0x10b')});db[_0x972c('0xf4')][_0x972c('0x11b')](db['CmList'],{'as':_0x972c('0x160'),'foreignKey':_0x972c('0x161')});db['WhatsappAccount'][_0x972c('0x11b')](db[_0x972c('0x164')],{'as':_0x972c('0x149'),'foreignKey':_0x972c('0x165')});db[_0x972c('0xf4')]['belongsToMany'](db[_0x972c('0x11')],{'as':_0x972c('0x166'),'through':_0x972c('0x13c')});db[_0x972c('0xf6')]['belongsTo'](db[_0x972c('0x11')],{'onDelete':_0x972c('0x15a')});db[_0x972c('0xf6')][_0x972c('0x11b')](db['WhatsappQueue'],{'onDelete':_0x972c('0x15a')});db[_0x972c('0xf6')]['belongsTo'](db['WhatsappAccount'],{'onDelete':_0x972c('0x15a')});db[_0x972c('0xf6')][_0x972c('0x11b')](db['Interval'],{'onDelete':_0x972c('0x15a'),'foreignKey':_0x972c('0x172')});db['WhatsappApplication'][_0x972c('0x11b')](db['Tag'],{'onDelete':_0x972c('0x15a'),'foreignKey':_0x972c('0x173')});db[_0x972c('0xf8')]['hasMany'](db[_0x972c('0x1f9')],{'as':_0x972c('0x14f'),'onDelete':_0x972c('0x10b'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0x972c('0x11b')](db[_0x972c('0xf4')],{'as':'Account','foreignKey':_0x972c('0x1f8')});db[_0x972c('0xf8')]['belongsTo'](db['CmContact'],{'as':_0x972c('0x156'),'foreignKey':_0x972c('0x157')});db[_0x972c('0xf8')][_0x972c('0x11b')](db[_0x972c('0x11')],{'as':_0x972c('0x169'),'foreignKey':_0x972c('0x10c')});db[_0x972c('0xf8')]['belongsToMany'](db['Tag'],{'through':_0x972c('0x1af'),'as':_0x972c('0x16b')});db[_0x972c('0xf8')][_0x972c('0x11c')](db['Tag'],{'through':_0x972c('0x1af'),'as':_0x972c('0x17b')});db[_0x972c('0xf8')][_0x972c('0x11c')](db[_0x972c('0x11')],{'as':_0x972c('0x16c'),'through':_0x972c('0x129'),'foreignKey':_0x972c('0x1fa')});db['WhatsappMessage'][_0x972c('0x11b')](db[_0x972c('0x11')],{'as':_0x972c('0x11')});db[_0x972c('0x1f9')][_0x972c('0x11b')](db['CmContact'],{'onDelete':_0x972c('0x10b'),'as':_0x972c('0x156')});db[_0x972c('0x1f9')][_0x972c('0x11b')](db[_0x972c('0xf8')],{'onDelete':_0x972c('0x10b'),'as':_0x972c('0x16f'),'foreignKey':_0x972c('0x1fa')});db[_0x972c('0x1f9')][_0x972c('0x11b')](db['WhatsappAccount'],{'as':_0x972c('0x168'),'foreignKey':_0x972c('0x1f8')});db[_0x972c('0xfb')][_0x972c('0x11b')](db[_0x972c('0xf4')],{});db['WhatsappQueueReport'][_0x972c('0x11b')](db['CmList'],{'as':'List','foreignKey':_0x972c('0x161')});db[_0x972c('0xfb')][_0x972c('0x11b')](db['CmContact'],{'as':_0x972c('0x156'),'foreignKey':_0x972c('0x157')});db[_0x972c('0xfb')][_0x972c('0x11b')](db['WhatsappInteraction'],{});db[_0x972c('0xfb')][_0x972c('0x11b')](db[_0x972c('0xff')],{});db[_0x972c('0xfb')][_0x972c('0x11b')](db[_0x972c('0x1f9')],{});db[_0x972c('0xfb')][_0x972c('0x11b')](db[_0x972c('0x11')],{});db[_0x972c('0xfd')][_0x972c('0x11b')](db[_0x972c('0x1f9')],{});db['WhatsappTransferReport'][_0x972c('0x11b')](db[_0x972c('0xf8')],{});db[_0x972c('0xfd')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':_0x972c('0x1df')});db['WhatsappTransferReport']['belongsTo'](db[_0x972c('0xf4')],{'foreignKey':_0x972c('0x1fb'),'as':'ToAccount'});db['WhatsappTransferReport']['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x972c('0x1fc'),'as':_0x972c('0x1e3')});db[_0x972c('0xfd')][_0x972c('0x11b')](db[_0x972c('0x11')],{'foreignKey':'FromUserId','as':_0x972c('0x1e0')});db[_0x972c('0xfd')]['belongsTo'](db['User'],{'foreignKey':_0x972c('0x1e1'),'as':_0x972c('0x1e7')});db[_0x972c('0xff')]['belongsToMany'](db[_0x972c('0x11')],{'as':_0x972c('0x166'),'through':_0x972c('0x38'),'foreignKey':_0x972c('0x1fd')});db['WhatsappQueue'][_0x972c('0x11c')](db[_0x972c('0xdb')],{'through':_0x972c('0x1d8'),'as':_0x972c('0x14b')});db[_0x972c('0x106')]['belongsTo'](db[_0x972c('0x11')],{'as':_0x972c('0x1fe'),'foreignKey':_0x972c('0x10c'),'onDelete':_0x972c('0x10b'),'hooks':!![]});db[_0x972c('0x101')][_0x972c('0x10a')](db[_0x972c('0xbe')],{'as':_0x972c('0xbe'),'onDelete':'restrict'});db[_0x972c('0x101')]['hasOne'](db[_0x972c('0x3a')],{'as':_0x972c('0x1ff'),'onDelete':_0x972c('0x15a')});db['CloudProvider'][_0x972c('0x10a')](db[_0x972c('0x15b')],{'as':_0x972c('0x15c'),'onDelete':_0x972c('0x15a')});module[_0x972c('0x200')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index cc0f6bb..dca9130 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49e5=['./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','/api/schedules','/api/sounds','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./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/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/attachment','/api/plugins','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/openchannelTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/mail_interaction_has_tags','./api/mailInteractionHasTag','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','/api/logs','/apidoc','/www','join','root','static','/snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards'];(function(_0x371241,_0x1006c8){var _0x1eb44d=function(_0x587384){while(--_0x587384){_0x371241['push'](_0x371241['shift']());}};_0x1eb44d(++_0x1006c8);}(_0x49e5,0xe9));var _0x549e=function(_0xf07499,_0x48f4c4){_0xf07499=_0xf07499-0x0;var _0x178f02=_0x49e5[_0xf07499];return _0x178f02;};'use strict';var path=require(_0x549e('0x0'));var express=require(_0x549e('0x1'));var errors=require(_0x549e('0x2'));var config=require(_0x549e('0x3'));var setupLoggers=require(_0x549e('0x4'))[_0x549e('0x5')];var clientSideLogs=require(_0x549e('0x6'));exports[_0x549e('0x7')]=function(_0x37a0bb){return setupLoggers(_0x37a0bb)[_0x549e('0x8')](function(){_0x37a0bb[_0x549e('0x9')]('/api/users',require(_0x549e('0xa')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xb'),require(_0x549e('0xc')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xd'),require(_0x549e('0xe')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xf'),require(_0x549e('0x10')));_0x37a0bb['use']('/api/voice/mohs',require(_0x549e('0x11')));_0x37a0bb['use'](_0x549e('0x12'),require('./api/voiceQueue'));_0x37a0bb[_0x549e('0x9')](_0x549e('0x13'),require('./api/voiceRecording'));_0x37a0bb[_0x549e('0x9')](_0x549e('0x14'),require(_0x549e('0x15')));_0x37a0bb[_0x549e('0x9')]('/api/voice/mails',require(_0x549e('0x16')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x17'),require(_0x549e('0x18')));_0x37a0bb['use'](_0x549e('0x19'),require('./api/voiceCallReport'));_0x37a0bb[_0x549e('0x9')]('/api/voice/dials/reports',require(_0x549e('0x1a')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x1b'),require('./api/voiceAgentReport'));_0x37a0bb[_0x549e('0x9')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x37a0bb[_0x549e('0x9')]('/api/members/reports',require(_0x549e('0x1c')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x1d'),require(_0x549e('0x1e')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x1f'),require(_0x549e('0x20')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x21'),require(_0x549e('0x22')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x23'),require(_0x549e('0x24')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x25'),require(_0x549e('0x26')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x27'),require(_0x549e('0x28')));_0x37a0bb['use'](_0x549e('0x29'),require(_0x549e('0x2a')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x2b'),require(_0x549e('0x2c')));_0x37a0bb['use'](_0x549e('0x2d'),require(_0x549e('0x2e')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x2f'),require(_0x549e('0x30')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x31'),require('./api/dashboard'));_0x37a0bb[_0x549e('0x9')]('/api/dashboards/items',require(_0x549e('0x32')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x33'),require('./api/faxAccount'));_0x37a0bb[_0x549e('0x9')](_0x549e('0x34'),require(_0x549e('0x35')));_0x37a0bb[_0x549e('0x9')]('/api/fax/interactions',require(_0x549e('0x36')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x37'),require(_0x549e('0x38')));_0x37a0bb[_0x549e('0x9')]('/api/fax/queues',require('./api/faxQueue'));_0x37a0bb[_0x549e('0x9')](_0x549e('0x39'),require(_0x549e('0x3a')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x3b'),require(_0x549e('0x3c')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x3d'),require(_0x549e('0x3e')));_0x37a0bb['use'](_0x549e('0x3f'),require(_0x549e('0x40')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x41'),require('./api/smsMessage'));_0x37a0bb['use'](_0x549e('0x42'),require('./api/smsQueue'));_0x37a0bb[_0x549e('0x9')](_0x549e('0x43'),require(_0x549e('0x44')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x45'),require(_0x549e('0x46')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x47'),require(_0x549e('0x48')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x49'),require('./api/openchannelMessage'));_0x37a0bb[_0x549e('0x9')](_0x549e('0x4a'),require(_0x549e('0x4b')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x4c'),require(_0x549e('0x4d')));_0x37a0bb['use'](_0x549e('0x4e'),require(_0x549e('0x4f')));_0x37a0bb['use'](_0x549e('0x50'),require(_0x549e('0x51')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x52'),require('./api/chatInteraction'));_0x37a0bb[_0x549e('0x9')](_0x549e('0x53'),require(_0x549e('0x54')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x55'),require(_0x549e('0x56')));_0x37a0bb['use'](_0x549e('0x57'),require(_0x549e('0x58')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x59'),require(_0x549e('0x5a')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x5b'),require(_0x549e('0x5c')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x5d'),require(_0x549e('0x5e')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x5f'),require(_0x549e('0x60')));_0x37a0bb[_0x549e('0x9')]('/api/cm/hopper',require('./api/cmHopper'));_0x37a0bb[_0x549e('0x9')](_0x549e('0x61'),require(_0x549e('0x62')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x63'),require(_0x549e('0x64')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x65'),require(_0x549e('0x66')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x67'),require(_0x549e('0x68')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x69'),require(_0x549e('0x6a')));_0x37a0bb[_0x549e('0x9')]('/api/automations',require(_0x549e('0x6b')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x6c'),require(_0x549e('0x6d')));_0x37a0bb['use'](_0x549e('0x6e'),require('./api/disposition'));_0x37a0bb[_0x549e('0x9')](_0x549e('0x6f'),require(_0x549e('0x70')));_0x37a0bb[_0x549e('0x9')]('/api/intervals',require('./api/interval'));_0x37a0bb[_0x549e('0x9')](_0x549e('0x71'),require(_0x549e('0x72')));_0x37a0bb[_0x549e('0x9')]('/api/cdr',require(_0x549e('0x73')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x74'),require('./api/voiceQueuesLog'));_0x37a0bb[_0x549e('0x9')](_0x549e('0x75'),require('./api/schedule'));_0x37a0bb[_0x549e('0x9')](_0x549e('0x76'),require('./api/sound'));_0x37a0bb[_0x549e('0x9')](_0x549e('0x77'),require(_0x549e('0x78')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x79'),require(_0x549e('0x7a')));_0x37a0bb[_0x549e('0x9')]('/api/cm_contact_has_items',require('./api/cmContactHasItem'));_0x37a0bb[_0x549e('0x9')](_0x549e('0x7b'),require(_0x549e('0x7c')));_0x37a0bb['use'](_0x549e('0x7d'),require(_0x549e('0x7e')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x7f'),require(_0x549e('0x80')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x81'),require('./api/variable'));_0x37a0bb[_0x549e('0x9')](_0x549e('0x82'),require(_0x549e('0x83')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x84'),require(_0x549e('0x85')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x86'),require(_0x549e('0x87')));_0x37a0bb[_0x549e('0x9')]('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x37a0bb['use']('/api/analytics/extracted_reports',require(_0x549e('0x88')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x89'),require(_0x549e('0x8a')));_0x37a0bb['use']('/api/analytics/field_reports',require(_0x549e('0x8b')));_0x37a0bb['use'](_0x549e('0x8c'),require(_0x549e('0x8d')));_0x37a0bb['use'](_0x549e('0x8e'),require(_0x549e('0x8f')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x90'),require(_0x549e('0x91')));_0x37a0bb['use'](_0x549e('0x92'),require(_0x549e('0x93')));_0x37a0bb['use'](_0x549e('0x94'),require(_0x549e('0x95')));_0x37a0bb[_0x549e('0x9')]('/api/integrations/sugarcrm/configurations',require(_0x549e('0x96')));_0x37a0bb['use']('/api/integrations/sugarcrm/fields',require(_0x549e('0x97')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x98'),require('./api/intDeskAccount'));_0x37a0bb[_0x549e('0x9')](_0x549e('0x99'),require('./api/intDeskConfiguration'));_0x37a0bb['use']('/api/integrations/desk/fields',require(_0x549e('0x9a')));_0x37a0bb['use'](_0x549e('0x9b'),require(_0x549e('0x9c')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x9d'),require('./api/intZohoConfiguration'));_0x37a0bb['use'](_0x549e('0x9e'),require(_0x549e('0x9f')));_0x37a0bb[_0x549e('0x9')]('/api/integrations/zendesk/accounts',require(_0x549e('0xa0')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xa1'),require('./api/intZendeskConfiguration'));_0x37a0bb[_0x549e('0x9')](_0x549e('0xa2'),require(_0x549e('0xa3')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xa4'),require(_0x549e('0xa5')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xa6'),require(_0x549e('0xa7')));_0x37a0bb['use'](_0x549e('0xa8'),require(_0x549e('0xa9')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xaa'),require(_0x549e('0xab')));_0x37a0bb['use'](_0x549e('0xac'),require('./api/intVtigerConfiguration'));_0x37a0bb[_0x549e('0x9')](_0x549e('0xad'),require(_0x549e('0xae')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xaf'),require(_0x549e('0xb0')));_0x37a0bb['use'](_0x549e('0xb1'),require(_0x549e('0xb2')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xb3'),require(_0x549e('0xb4')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xb5'),require(_0x549e('0xb6')));_0x37a0bb[_0x549e('0x9')]('/api/integrations/dynamics365/configurations',require(_0x549e('0xb7')));_0x37a0bb['use'](_0x549e('0xb8'),require(_0x549e('0xb9')));_0x37a0bb['use'](_0x549e('0xba'),require('./api/intFreshsalesAccount'));_0x37a0bb[_0x549e('0x9')](_0x549e('0xbb'),require(_0x549e('0xbc')));_0x37a0bb[_0x549e('0x9')]('/api/integrations/freshsales/fields',require('./api/intFreshsalesField'));_0x37a0bb[_0x549e('0x9')](_0x549e('0xbd'),require(_0x549e('0xbe')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xbf'),require('./api/chatQueueReport'));_0x37a0bb['use'](_0x549e('0xc0'),require(_0x549e('0xc1')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xc2'),require(_0x549e('0xc3')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xc4'),require(_0x549e('0xc5')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xc6'),require('./api/jscriptySessionReport'));_0x37a0bb['use'](_0x549e('0xc7'),require('./api/smsQueueReport'));_0x37a0bb['use'](_0x549e('0xc8'),require(_0x549e('0xc9')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xca'),require(_0x549e('0xcb')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xcc'),require('./api/jscriptyProject'));_0x37a0bb['use']('/api/settings',require(_0x549e('0xcd')));_0x37a0bb['use'](_0x549e('0xce'),require(_0x549e('0xcf')));_0x37a0bb['use'](_0x549e('0xd0'),require(_0x549e('0xd1')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xd2'),require(_0x549e('0xd3')));_0x37a0bb['use'](_0x549e('0xd4'),require(_0x549e('0xd5')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xd6'),require(_0x549e('0xd7')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xd8'),require(_0x549e('0xd9')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xda'),require(_0x549e('0xdb')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xdc'),require('./api/migration'));_0x37a0bb[_0x549e('0x9')]('/api/attachments',require(_0x549e('0xdd')));_0x37a0bb['use'](_0x549e('0xde'),require('./api/plugin'));_0x37a0bb[_0x549e('0x9')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x37a0bb[_0x549e('0x9')](_0x549e('0xdf'),require(_0x549e('0xe0')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xe1'),require('./api/faxTransferReport'));_0x37a0bb['use']('/api/openchannel/reports/transfer',require(_0x549e('0xe2')));_0x37a0bb[_0x549e('0x9')]('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x37a0bb[_0x549e('0x9')](_0x549e('0xe3'),require(_0x549e('0xe4')));_0x37a0bb['use'](_0x549e('0xe5'),require(_0x549e('0xe6')));_0x37a0bb['use'](_0x549e('0xe7'),require(_0x549e('0xe8')));_0x37a0bb['use'](_0x549e('0xe9'),require(_0x549e('0xea')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xeb'),require(_0x549e('0xec')));_0x37a0bb[_0x549e('0x9')]('/api/userNotifications',require('./api/userNotification'));_0x37a0bb['use'](_0x549e('0xed'),require(_0x549e('0xee')));_0x37a0bb['use'](_0x549e('0xef'),require(_0x549e('0xf0')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xf1'),require(_0x549e('0xf2')));_0x37a0bb[_0x549e('0x9')]('/api/whatsapp/messages',require(_0x549e('0xf3')));_0x37a0bb[_0x549e('0x9')](_0x549e('0xf4'),require('./api/whatsappQueueReport'));_0x37a0bb['use'](_0x549e('0xf5'),require(_0x549e('0xf6')));_0x37a0bb['use'](_0x549e('0xf7'),require('./api/whatsappQueue'));_0x37a0bb[_0x549e('0x9')](_0x549e('0xf8'),require(_0x549e('0xf9')));_0x37a0bb['use'](_0x549e('0xfa'),require(_0x549e('0xfb')));_0x37a0bb[_0x549e('0x9')]('/api/user-settings',require('./api/user-setting'));_0x37a0bb['use'](_0x549e('0xfc'),require(_0x549e('0xfd')));_0x37a0bb['use'](_0x549e('0xfe'),require(_0x549e('0xff')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x100'),require(_0x549e('0x101')));_0x37a0bb['use'](_0x549e('0x102'),require('./api/authActiveDirectory'));_0x37a0bb[_0x549e('0x9')](_0x549e('0x103'),require(_0x549e('0x104')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x105'),require(_0x549e('0x106')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x107'),require('./api/version'));_0x37a0bb['use']('/api/system',require(_0x549e('0x108')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x109'),require(_0x549e('0x10a')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x10b'),require('./api/webbar'));_0x37a0bb['use'](_0x549e('0x10c'),clientSideLogs);_0x37a0bb[_0x549e('0x9')]('/apidoc',express['static'](path['join'](config['root'],_0x549e('0x10d'))));_0x37a0bb['use'](_0x549e('0x10e'),express['static'](path[_0x549e('0x10f')](config[_0x549e('0x110')],_0x549e('0x10e'))));_0x37a0bb[_0x549e('0x9')]('/demo',express[_0x549e('0x111')](path[_0x549e('0x10f')](config[_0x549e('0x110')],'/demo')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x112'),express[_0x549e('0x111')](path[_0x549e('0x10f')](config[_0x549e('0x110')],'snippet','3.9.0')));_0x37a0bb[_0x549e('0x9')](_0x549e('0x113'),express[_0x549e('0x111')](path['join'](config['root'],_0x549e('0x114'))));_0x37a0bb[_0x549e('0x115')](_0x549e('0x116'))[_0x549e('0x117')](errors[0x194]);_0x37a0bb[_0x549e('0x115')]('/*')['get'](function(_0x4625a3,_0x5d93ea){_0x5d93ea['sendFile'](path[_0x549e('0x118')](_0x37a0bb['get'](_0x549e('0x119'))+_0x549e('0x11a')));});return _0x37a0bb;});}; \ No newline at end of file +var _0x89d1=['./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','./api/user-setting','/api/mail_interaction_has_tags','./api/mailInteractionHasTag','/api/auth/local','./api/authLocal','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','/index.html','path','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','/api/voice/chanspy','/api/voice/contexts','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/sounds','./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/variables','./api/variable','/api/integrations','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','/api/analytics/field_reports','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/freshsales/accounts'];(function(_0x24bea1,_0x16898d){var _0x289d21=function(_0x342c8){while(--_0x342c8){_0x24bea1['push'](_0x24bea1['shift']());}};_0x289d21(++_0x16898d);}(_0x89d1,0x17c));var _0x189d=function(_0x973b12,_0x1ef7c5){_0x973b12=_0x973b12-0x0;var _0x311cb7=_0x89d1[_0x973b12];return _0x311cb7;};'use strict';var path=require(_0x189d('0x0'));var express=require('express');var errors=require(_0x189d('0x1'));var config=require(_0x189d('0x2'));var setupLoggers=require(_0x189d('0x3'))[_0x189d('0x4')];var clientSideLogs=require(_0x189d('0x5'));exports[_0x189d('0x6')]=function(_0x4e5669){return setupLoggers(_0x4e5669)[_0x189d('0x7')](function(){_0x4e5669[_0x189d('0x8')](_0x189d('0x9'),require('./api/user'));_0x4e5669[_0x189d('0x8')](_0x189d('0xa'),require('./api/voiceChanSpy'));_0x4e5669[_0x189d('0x8')](_0x189d('0xb'),require('./api/voiceContext'));_0x4e5669['use'](_0x189d('0xc'),require('./api/voiceExtension'));_0x4e5669[_0x189d('0x8')](_0x189d('0xd'),require(_0x189d('0xe')));_0x4e5669[_0x189d('0x8')](_0x189d('0xf'),require(_0x189d('0x10')));_0x4e5669[_0x189d('0x8')]('/api/voice/recordings',require(_0x189d('0x11')));_0x4e5669['use']('/api/screen/recordings',require(_0x189d('0x12')));_0x4e5669[_0x189d('0x8')](_0x189d('0x13'),require(_0x189d('0x14')));_0x4e5669['use'](_0x189d('0x15'),require(_0x189d('0x16')));_0x4e5669[_0x189d('0x8')](_0x189d('0x17'),require(_0x189d('0x18')));_0x4e5669['use'](_0x189d('0x19'),require(_0x189d('0x1a')));_0x4e5669[_0x189d('0x8')](_0x189d('0x1b'),require('./api/voiceAgentReport'));_0x4e5669[_0x189d('0x8')]('/api/voice/queues/reports',require(_0x189d('0x1c')));_0x4e5669[_0x189d('0x8')](_0x189d('0x1d'),require(_0x189d('0x1e')));_0x4e5669['use']('/api/trunks',require('./api/trunk'));_0x4e5669[_0x189d('0x8')](_0x189d('0x1f'),require(_0x189d('0x20')));_0x4e5669[_0x189d('0x8')](_0x189d('0x21'),require(_0x189d('0x22')));_0x4e5669['use'](_0x189d('0x23'),require(_0x189d('0x24')));_0x4e5669[_0x189d('0x8')](_0x189d('0x25'),require(_0x189d('0x26')));_0x4e5669['use'](_0x189d('0x27'),require('./api/mailSubstatus'));_0x4e5669[_0x189d('0x8')]('/api/mail/interactions',require(_0x189d('0x28')));_0x4e5669[_0x189d('0x8')](_0x189d('0x29'),require(_0x189d('0x2a')));_0x4e5669[_0x189d('0x8')](_0x189d('0x2b'),require(_0x189d('0x2c')));_0x4e5669[_0x189d('0x8')](_0x189d('0x2d'),require(_0x189d('0x2e')));_0x4e5669[_0x189d('0x8')](_0x189d('0x2f'),require(_0x189d('0x30')));_0x4e5669[_0x189d('0x8')](_0x189d('0x31'),require(_0x189d('0x32')));_0x4e5669[_0x189d('0x8')](_0x189d('0x33'),require(_0x189d('0x34')));_0x4e5669['use'](_0x189d('0x35'),require('./api/faxApplication'));_0x4e5669[_0x189d('0x8')](_0x189d('0x36'),require('./api/faxInteraction'));_0x4e5669[_0x189d('0x8')](_0x189d('0x37'),require(_0x189d('0x38')));_0x4e5669[_0x189d('0x8')](_0x189d('0x39'),require(_0x189d('0x3a')));_0x4e5669['use']('/api/fax/reports/queue',require(_0x189d('0x3b')));_0x4e5669[_0x189d('0x8')](_0x189d('0x3c'),require(_0x189d('0x3d')));_0x4e5669[_0x189d('0x8')](_0x189d('0x3e'),require(_0x189d('0x3f')));_0x4e5669['use'](_0x189d('0x40'),require('./api/smsInteraction'));_0x4e5669[_0x189d('0x8')](_0x189d('0x41'),require(_0x189d('0x42')));_0x4e5669[_0x189d('0x8')](_0x189d('0x43'),require(_0x189d('0x44')));_0x4e5669[_0x189d('0x8')]('/api/openchannel/accounts',require(_0x189d('0x45')));_0x4e5669[_0x189d('0x8')](_0x189d('0x46'),require('./api/openchannelApplication'));_0x4e5669['use'](_0x189d('0x47'),require('./api/openchannelInteraction'));_0x4e5669['use'](_0x189d('0x48'),require(_0x189d('0x49')));_0x4e5669['use'](_0x189d('0x4a'),require(_0x189d('0x4b')));_0x4e5669[_0x189d('0x8')]('/api/chat/websites',require(_0x189d('0x4c')));_0x4e5669['use'](_0x189d('0x4d'),require('./api/openchannelQueueReport'));_0x4e5669['use'](_0x189d('0x4e'),require('./api/chatApplication'));_0x4e5669[_0x189d('0x8')](_0x189d('0x4f'),require(_0x189d('0x50')));_0x4e5669[_0x189d('0x8')](_0x189d('0x51'),require(_0x189d('0x52')));_0x4e5669['use'](_0x189d('0x53'),require(_0x189d('0x54')));_0x4e5669['use'](_0x189d('0x55'),require(_0x189d('0x56')));_0x4e5669[_0x189d('0x8')]('/api/chat/groups',require(_0x189d('0x57')));_0x4e5669['use'](_0x189d('0x58'),require(_0x189d('0x59')));_0x4e5669[_0x189d('0x8')](_0x189d('0x5a'),require(_0x189d('0x5b')));_0x4e5669['use'](_0x189d('0x5c'),require(_0x189d('0x5d')));_0x4e5669[_0x189d('0x8')](_0x189d('0x5e'),require(_0x189d('0x5f')));_0x4e5669['use'](_0x189d('0x60'),require('./api/cmHopperBlack'));_0x4e5669[_0x189d('0x8')](_0x189d('0x61'),require(_0x189d('0x62')));_0x4e5669[_0x189d('0x8')]('/api/cm/hopper_history',require(_0x189d('0x63')));_0x4e5669['use'](_0x189d('0x64'),require(_0x189d('0x65')));_0x4e5669[_0x189d('0x8')]('/api/actions',require(_0x189d('0x66')));_0x4e5669[_0x189d('0x8')](_0x189d('0x67'),require(_0x189d('0x68')));_0x4e5669[_0x189d('0x8')](_0x189d('0x69'),require('./api/cannedAnswer'));_0x4e5669['use'](_0x189d('0x6a'),require(_0x189d('0x6b')));_0x4e5669[_0x189d('0x8')](_0x189d('0x6c'),require('./api/condition'));_0x4e5669[_0x189d('0x8')](_0x189d('0x6d'),require(_0x189d('0x6e')));_0x4e5669[_0x189d('0x8')](_0x189d('0x6f'),require(_0x189d('0x70')));_0x4e5669[_0x189d('0x8')](_0x189d('0x71'),require(_0x189d('0x72')));_0x4e5669['use'](_0x189d('0x73'),require(_0x189d('0x74')));_0x4e5669['use']('/api/schedules',require('./api/schedule'));_0x4e5669[_0x189d('0x8')](_0x189d('0x75'),require('./api/sound'));_0x4e5669[_0x189d('0x8')]('/api/tags',require(_0x189d('0x76')));_0x4e5669[_0x189d('0x8')]('/api/contact_item_types',require(_0x189d('0x77')));_0x4e5669[_0x189d('0x8')](_0x189d('0x78'),require(_0x189d('0x79')));_0x4e5669[_0x189d('0x8')](_0x189d('0x7a'),require(_0x189d('0x7b')));_0x4e5669[_0x189d('0x8')](_0x189d('0x7c'),require(_0x189d('0x7d')));_0x4e5669[_0x189d('0x8')](_0x189d('0x7e'),require('./api/trigger'));_0x4e5669[_0x189d('0x8')](_0x189d('0x7f'),require(_0x189d('0x80')));_0x4e5669[_0x189d('0x8')](_0x189d('0x81'),require('./api/integration'));_0x4e5669['use']('/api/integrations/reports',require(_0x189d('0x82')));_0x4e5669['use'](_0x189d('0x83'),require(_0x189d('0x84')));_0x4e5669[_0x189d('0x8')](_0x189d('0x85'),require(_0x189d('0x86')));_0x4e5669[_0x189d('0x8')](_0x189d('0x87'),require('./api/analyticExtractedReport'));_0x4e5669[_0x189d('0x8')](_0x189d('0x88'),require('./api/analyticMetric'));_0x4e5669[_0x189d('0x8')](_0x189d('0x89'),require('./api/analyticFieldReport'));_0x4e5669[_0x189d('0x8')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x4e5669[_0x189d('0x8')](_0x189d('0x8a'),require('./api/intSalesforceAccount'));_0x4e5669[_0x189d('0x8')](_0x189d('0x8b'),require(_0x189d('0x8c')));_0x4e5669[_0x189d('0x8')](_0x189d('0x8d'),require(_0x189d('0x8e')));_0x4e5669[_0x189d('0x8')](_0x189d('0x8f'),require(_0x189d('0x90')));_0x4e5669[_0x189d('0x8')](_0x189d('0x91'),require('./api/intSugarcrmConfiguration'));_0x4e5669['use'](_0x189d('0x92'),require(_0x189d('0x93')));_0x4e5669['use'](_0x189d('0x94'),require(_0x189d('0x95')));_0x4e5669[_0x189d('0x8')](_0x189d('0x96'),require(_0x189d('0x97')));_0x4e5669['use'](_0x189d('0x98'),require(_0x189d('0x99')));_0x4e5669[_0x189d('0x8')](_0x189d('0x9a'),require('./api/intZohoAccount'));_0x4e5669[_0x189d('0x8')]('/api/integrations/zoho/configurations',require(_0x189d('0x9b')));_0x4e5669[_0x189d('0x8')](_0x189d('0x9c'),require(_0x189d('0x9d')));_0x4e5669[_0x189d('0x8')](_0x189d('0x9e'),require('./api/intZendeskAccount'));_0x4e5669[_0x189d('0x8')](_0x189d('0x9f'),require(_0x189d('0xa0')));_0x4e5669[_0x189d('0x8')](_0x189d('0xa1'),require(_0x189d('0xa2')));_0x4e5669[_0x189d('0x8')](_0x189d('0xa3'),require(_0x189d('0xa4')));_0x4e5669[_0x189d('0x8')](_0x189d('0xa5'),require('./api/intFreshdeskConfiguration'));_0x4e5669['use'](_0x189d('0xa6'),require(_0x189d('0xa7')));_0x4e5669[_0x189d('0x8')](_0x189d('0xa8'),require(_0x189d('0xa9')));_0x4e5669['use'](_0x189d('0xaa'),require(_0x189d('0xab')));_0x4e5669[_0x189d('0x8')]('/api/integrations/vtiger/fields',require(_0x189d('0xac')));_0x4e5669[_0x189d('0x8')]('/api/integrations/servicenow/accounts',require(_0x189d('0xad')));_0x4e5669[_0x189d('0x8')]('/api/integrations/servicenow/configurations',require(_0x189d('0xae')));_0x4e5669[_0x189d('0x8')](_0x189d('0xaf'),require(_0x189d('0xb0')));_0x4e5669[_0x189d('0x8')](_0x189d('0xb1'),require(_0x189d('0xb2')));_0x4e5669['use']('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x4e5669[_0x189d('0x8')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x4e5669[_0x189d('0x8')](_0x189d('0xb3'),require(_0x189d('0xb4')));_0x4e5669[_0x189d('0x8')](_0x189d('0xb5'),require(_0x189d('0xb6')));_0x4e5669[_0x189d('0x8')]('/api/integrations/freshsales/fields',require(_0x189d('0xb7')));_0x4e5669[_0x189d('0x8')](_0x189d('0xb8'),require(_0x189d('0xb9')));_0x4e5669[_0x189d('0x8')](_0x189d('0xba'),require(_0x189d('0xbb')));_0x4e5669['use'](_0x189d('0xbc'),require('./api/chatInternalMessage'));_0x4e5669[_0x189d('0x8')](_0x189d('0xbd'),require('./api/jscriptyAnswerReport'));_0x4e5669['use']('/api/jscripty/questions/reports',require(_0x189d('0xbe')));_0x4e5669['use'](_0x189d('0xbf'),require('./api/jscriptySessionReport'));_0x4e5669[_0x189d('0x8')]('/api/sms/reports/queue',require(_0x189d('0xc0')));_0x4e5669[_0x189d('0x8')](_0x189d('0xc1'),require(_0x189d('0xc2')));_0x4e5669[_0x189d('0x8')](_0x189d('0xc3'),require(_0x189d('0xc4')));_0x4e5669['use'](_0x189d('0xc5'),require('./api/jscriptyProject'));_0x4e5669[_0x189d('0x8')](_0x189d('0xc6'),require(_0x189d('0xc7')));_0x4e5669[_0x189d('0x8')](_0x189d('0xc8'),require('./api/squareOdbc'));_0x4e5669['use'](_0x189d('0xc9'),require(_0x189d('0xca')));_0x4e5669[_0x189d('0x8')](_0x189d('0xcb'),require(_0x189d('0xcc')));_0x4e5669[_0x189d('0x8')](_0x189d('0xcd'),require('./api/squareMessage'));_0x4e5669['use'](_0x189d('0xce'),require(_0x189d('0xcf')));_0x4e5669[_0x189d('0x8')](_0x189d('0xd0'),require(_0x189d('0xd1')));_0x4e5669[_0x189d('0x8')](_0x189d('0xd2'),require('./api/campaign'));_0x4e5669[_0x189d('0x8')]('/api/migrations',require('./api/migration'));_0x4e5669[_0x189d('0x8')]('/api/attachments',require(_0x189d('0xd3')));_0x4e5669[_0x189d('0x8')](_0x189d('0xd4'),require(_0x189d('0xd5')));_0x4e5669[_0x189d('0x8')](_0x189d('0xd6'),require(_0x189d('0xd7')));_0x4e5669[_0x189d('0x8')]('/api/chat/reports/transfer',require(_0x189d('0xd8')));_0x4e5669['use'](_0x189d('0xd9'),require(_0x189d('0xda')));_0x4e5669[_0x189d('0x8')](_0x189d('0xdb'),require('./api/openchannelTransferReport'));_0x4e5669[_0x189d('0x8')](_0x189d('0xdc'),require(_0x189d('0xdd')));_0x4e5669[_0x189d('0x8')](_0x189d('0xde'),require(_0x189d('0xdf')));_0x4e5669[_0x189d('0x8')](_0x189d('0xe0'),require(_0x189d('0xe1')));_0x4e5669[_0x189d('0x8')](_0x189d('0xe2'),require(_0x189d('0xe3')));_0x4e5669[_0x189d('0x8')](_0x189d('0xe4'),require('./api/userProfileSection'));_0x4e5669[_0x189d('0x8')]('/api/userProfile/resources',require(_0x189d('0xe5')));_0x4e5669[_0x189d('0x8')](_0x189d('0xe6'),require('./api/userNotification'));_0x4e5669[_0x189d('0x8')](_0x189d('0xe7'),require(_0x189d('0xe8')));_0x4e5669[_0x189d('0x8')](_0x189d('0xe9'),require(_0x189d('0xea')));_0x4e5669[_0x189d('0x8')]('/api/whatsapp/interactions',require(_0x189d('0xeb')));_0x4e5669[_0x189d('0x8')](_0x189d('0xec'),require(_0x189d('0xed')));_0x4e5669['use'](_0x189d('0xee'),require(_0x189d('0xef')));_0x4e5669[_0x189d('0x8')](_0x189d('0xf0'),require(_0x189d('0xf1')));_0x4e5669['use']('/api/whatsapp/queues',require('./api/whatsappQueue'));_0x4e5669[_0x189d('0x8')](_0x189d('0xf2'),require(_0x189d('0xf3')));_0x4e5669[_0x189d('0x8')](_0x189d('0xf4'),require(_0x189d('0xf5')));_0x4e5669[_0x189d('0x8')]('/api/user-settings',require(_0x189d('0xf6')));_0x4e5669[_0x189d('0x8')](_0x189d('0xf7'),require(_0x189d('0xf8')));_0x4e5669['use'](_0x189d('0xf9'),require(_0x189d('0xfa')));_0x4e5669['use']('/api/auth/google',require('./api/authGoogle'));_0x4e5669[_0x189d('0x8')](_0x189d('0xfb'),require(_0x189d('0xfc')));_0x4e5669[_0x189d('0x8')](_0x189d('0xfd'),require(_0x189d('0xfe')));_0x4e5669[_0x189d('0x8')](_0x189d('0xff'),require('./api/rpc'));_0x4e5669['use'](_0x189d('0x100'),require('./api/version'));_0x4e5669['use'](_0x189d('0x101'),require(_0x189d('0x102')));_0x4e5669[_0x189d('0x8')](_0x189d('0x103'),require(_0x189d('0x104')));_0x4e5669[_0x189d('0x8')](_0x189d('0x105'),require(_0x189d('0x106')));_0x4e5669['use'](_0x189d('0x107'),clientSideLogs);_0x4e5669[_0x189d('0x8')](_0x189d('0x108'),express[_0x189d('0x109')](path[_0x189d('0x10a')](config[_0x189d('0x10b')],'/apidoc')));_0x4e5669[_0x189d('0x8')](_0x189d('0x10c'),express['static'](path[_0x189d('0x10a')](config[_0x189d('0x10b')],_0x189d('0x10c'))));_0x4e5669[_0x189d('0x8')](_0x189d('0x10d'),express[_0x189d('0x109')](path['join'](config['root'],_0x189d('0x10d'))));_0x4e5669[_0x189d('0x8')](_0x189d('0x10e'),express[_0x189d('0x109')](path['join'](config['root'],_0x189d('0x10f'),'3.9.0')));_0x4e5669[_0x189d('0x8')](_0x189d('0x110'),express[_0x189d('0x109')](path['join'](config[_0x189d('0x10b')],_0x189d('0x111'))));_0x4e5669[_0x189d('0x112')]('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x4e5669[_0x189d('0x112')]('/*')[_0x189d('0x113')](function(_0x2ac7a9,_0x5f13d1){_0x5f13d1[_0x189d('0x114')](path[_0x189d('0x115')](_0x4e5669[_0x189d('0x113')](_0x189d('0x116'))+_0x189d('0x117')));});return _0x4e5669;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 86844df..223c618 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25d3=['../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc'];(function(_0x48e556,_0x122e2d){var _0x256f39=function(_0x446127){while(--_0x446127){_0x48e556['push'](_0x48e556['shift']());}};_0x256f39(++_0x122e2d);}(_0x25d3,0x1b7));var _0x325d=function(_0x376543,_0x4dd713){_0x376543=_0x376543-0x0;var _0x2e1cb2=_0x25d3[_0x376543];return _0x2e1cb2;};'use strict';var jayson=require(_0x325d('0x0'));var _=require(_0x325d('0x1'));var config=require(_0x325d('0x2'));exports[_0x325d('0x3')]=function(){return new Promise(function(_0x52089e,_0x690b7c){var _0x16be36={};_0x16be36=_['merge'](_0x16be36,require(_0x325d('0x4')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/voiceExtension/voiceExtension.rpc'));_0x16be36=_['merge'](_0x16be36,require(_0x325d('0x6')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x7')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x8')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x9')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0xa')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0xb')));_0x16be36=_['merge'](_0x16be36,require(_0x325d('0xc')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0xd')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0xe')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/mailServerIn/mailServerIn.rpc'));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/mailAccount/mailAccount.rpc'));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0xf')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/mailInteraction/mailInteraction.rpc'));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x10')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x11')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x12')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x13')));_0x16be36=_['merge'](_0x16be36,require(_0x325d('0x14')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/faxInteraction/faxInteraction.rpc'));_0x16be36=_['merge'](_0x16be36,require(_0x325d('0x15')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x16')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x17')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x18')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/smsInteraction/smsInteraction.rpc'));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x19')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x1a')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x1b')));_0x16be36=_['merge'](_0x16be36,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x1c')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x1d')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x1e')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x1f')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/chatQueue/chatQueue.rpc'));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/cmContact/cmContact.rpc'));_0x16be36=_['merge'](_0x16be36,require('../api/cmHopper/cmHopper.rpc'));_0x16be36=_['merge'](_0x16be36,require(_0x325d('0x20')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x21')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x16be36=_['merge'](_0x16be36,require(_0x325d('0x22')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x23')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x24')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x25')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x26')));_0x16be36=_['merge'](_0x16be36,require('../api/template/template.rpc'));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/trigger/trigger.rpc'));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x27')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x28')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x29')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x2a')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x16be36=_['merge'](_0x16be36,require(_0x325d('0x2b')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x2c')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x2d')));_0x16be36=_['merge'](_0x16be36,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x2e')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x2f')));_0x16be36=_['merge'](_0x16be36,require('../api/squareReport/squareReport.rpc'));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x30')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/setting/setting.rpc'));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x31')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/squareProject/squareProject.rpc'));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/squareRecording/squareRecording.rpc'));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x32')));_0x16be36=_['merge'](_0x16be36,require(_0x325d('0x33')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require('../api/attachment/attachment.rpc'));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x34')));_0x16be36=_['merge'](_0x16be36,require(_0x325d('0x35')));_0x16be36=_['merge'](_0x16be36,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x16be36=_['merge'](_0x16be36,require(_0x325d('0x36')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x37')));_0x16be36=_[_0x325d('0x5')](_0x16be36,require(_0x325d('0x38')));var _0x259aa2=jayson[_0x325d('0x39')](_0x16be36)[_0x325d('0x3a')]();var _0x3d1631=config['rpc']['port']||config[_0x325d('0x3b')]+0x1;var _0x5862db=config[_0x325d('0x3c')]['ip']||_0x325d('0x3d');_0x259aa2['on'](_0x325d('0x3e'),function(_0x9fe02e){return _0x690b7c(_0x9fe02e);});_0x259aa2[_0x325d('0x3')](_0x3d1631,_0x5862db,function(){console[_0x325d('0x3f')](_0x325d('0x40'),_0x5862db,_0x3d1631);require(_0x325d('0x41'))[_0x325d('0x42')]();return _0x52089e(_0x325d('0x43')+_0x5862db+':'+_0x3d1631);});});}; \ No newline at end of file +var _0x6089=['../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','jayson/promise','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.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/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/openchannelApplication/openchannelApplication.rpc'];(function(_0x1575a5,_0x28d177){var _0x3b91f8=function(_0x3f7cb9){while(--_0x3f7cb9){_0x1575a5['push'](_0x1575a5['shift']());}};_0x3b91f8(++_0x28d177);}(_0x6089,0x75));var _0x9608=function(_0x55c8ec,_0x5bc960){_0x55c8ec=_0x55c8ec-0x0;var _0x4cf866=_0x6089[_0x55c8ec];return _0x4cf866;};'use strict';var jayson=require(_0x9608('0x0'));var _=require('lodash');var config=require('../config/environment');exports[_0x9608('0x1')]=function(){return new Promise(function(_0x19565d,_0xb05a59){var _0x563ff1={};_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x3')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x4')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require('../api/voiceQueue/voiceQueue.rpc'));_0x563ff1=_['merge'](_0x563ff1,require(_0x9608('0x5')));_0x563ff1=_['merge'](_0x563ff1,require(_0x9608('0x6')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x7')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x563ff1=_['merge'](_0x563ff1,require(_0x9608('0x8')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x9')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0xa')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0xb')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0xc')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0xd')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0xe')));_0x563ff1=_['merge'](_0x563ff1,require(_0x9608('0xf')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x10')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x11')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x12')));_0x563ff1=_['merge'](_0x563ff1,require(_0x9608('0x13')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x14')));_0x563ff1=_['merge'](_0x563ff1,require('../api/faxApplication/faxApplication.rpc'));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x15')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x16')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require('../api/faxQueue/faxQueue.rpc'));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x17')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x18')));_0x563ff1=_['merge'](_0x563ff1,require(_0x9608('0x19')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require('../api/smsMessage/smsMessage.rpc'));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require('../api/smsQueue/smsQueue.rpc'));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x1a')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x1b')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x1c')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x1d')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x1e')));_0x563ff1=_['merge'](_0x563ff1,require(_0x9608('0x1f')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require('../api/chatQueue/chatQueue.rpc'));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x20')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require('../api/cmHopper/cmHopper.rpc'));_0x563ff1=_['merge'](_0x563ff1,require(_0x9608('0x21')));_0x563ff1=_['merge'](_0x563ff1,require(_0x9608('0x22')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x23')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x24')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x25')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x26')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x27')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x28')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x29')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x2a')));_0x563ff1=_['merge'](_0x563ff1,require('../api/variable/variable.rpc'));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x2b')));_0x563ff1=_['merge'](_0x563ff1,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x563ff1=_['merge'](_0x563ff1,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x2c')));_0x563ff1=_['merge'](_0x563ff1,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x2d')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x2e')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x2f')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x30')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x31')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x32')));_0x563ff1=_['merge'](_0x563ff1,require(_0x9608('0x33')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x34')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x35')));_0x563ff1=_['merge'](_0x563ff1,require('../api/squareProject/squareProject.rpc'));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x36')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x37')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require('../api/campaign/campaign.rpc'));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x38')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x39')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x3a')));_0x563ff1=_['merge'](_0x563ff1,require(_0x9608('0x3b')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x3c')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x3d')));_0x563ff1=_[_0x9608('0x2')](_0x563ff1,require(_0x9608('0x3e')));var _0x3f7a4f=jayson[_0x9608('0x3f')](_0x563ff1)[_0x9608('0x40')]();var _0x2603e3=config[_0x9608('0x41')][_0x9608('0x42')]||config[_0x9608('0x42')]+0x1;var _0x4a03f2=config[_0x9608('0x41')]['ip']||_0x9608('0x43');_0x3f7a4f['on'](_0x9608('0x44'),function(_0x96cb41){return _0xb05a59(_0x96cb41);});_0x3f7a4f[_0x9608('0x1')](_0x2603e3,_0x4a03f2,function(){console[_0x9608('0x45')](_0x9608('0x46'),_0x4a03f2,_0x2603e3);require('../config/triggers')[_0x9608('0x47')]();return _0x19565d('RPC\x20listening\x20on\x20'+_0x4a03f2+':'+_0x2603e3);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index e75534b..9f8ef43 100644 --- a/server/services/agi/channel.js +++ b/server/services/agi/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba29=['AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','headers','ready','line','toLowerCase','hangup','search','function','replace','split','length','substring','match','error','E_AGI_SOCKET_ERROR','code','close','emit','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','write','destroy','sendRequest','command','sync','prototype','answer','ANSWER','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','exec'];(function(_0x22dc81,_0x1f9066){var _0x2ccdba=function(_0x12cc15){while(--_0x12cc15){_0x22dc81['push'](_0x22dc81['shift']());}};_0x2ccdba(++_0x1f9066);}(_0xba29,0x9e));var _0x9ba2=function(_0x34febf,_0x48f9a5){_0x34febf=_0x34febf-0x0;var _0x73784a=_0xba29[_0x34febf];return _0x73784a;};'use strict';var util=require(_0x9ba2('0x0'));var _=require(_0x9ba2('0x1'));var EventEmitter=require(_0x9ba2('0x2'))[_0x9ba2('0x3')];var AGIReply=require(_0x9ba2('0x4'));var AGIError=require(_0x9ba2('0x5'));function AGIChannel(_0x5cdbb2){var _0x55d157=this,_0x4e8cc7=new AGIReply(),_0x27d3f5=![],_0x216ed9={};EventEmitter['call'](_0x55d157);_0x5cdbb2[_0x9ba2('0x6')](_0x9ba2('0x7'));_0x5cdbb2[_0x9ba2('0x8')](0x8*0x3c*0x3c*0x3e8);_0x4e8cc7[_0x9ba2('0x6')](_0x9ba2('0x7'));_0x4e8cc7['on'](_0x9ba2('0x9'),function(_0x1664b7){for(var _0x7b6458 in _0x1664b7){_0x55d157[_0x7b6458]=_0x1664b7[_0x7b6458];}_0x55d157['emit'](_0x9ba2('0xa'));});_0x4e8cc7['on'](_0x9ba2('0xb'),function(_0x156d4a){if(_0x156d4a[_0x9ba2('0xc')]()==_0x9ba2('0xd')){_0x55d157['emit'](_0x9ba2('0xd'));return;}if(_0x156d4a['substring'](0x0,0xb)=='520-Invalid'){_0x27d3f5=!![];}if(_0x27d3f5){_0x216ed9['rx']+=_0x156d4a+'\x0a';if(_0x156d4a[_0x9ba2('0xe')]('520\x20End\x20of\x20proper')!=-0x1){_0x27d3f5=![];}}else{_0x216ed9['rx']=_0x156d4a;}if(_0x27d3f5){return;}if(typeof _0x216ed9['cb']==_0x9ba2('0xf')){var _0x44849b=_0x216ed9['rx']['substring'](0x0,0x3),_0x83917a=null,_0x112800=null;_0x44849b=parseInt(_0x44849b);if(isNaN(_0x44849b)){_0x216ed9['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x44849b!=0xc8){_0x216ed9['cb'](null,{'code':_0x44849b,'result':-0x1,'extra':'KO'});return;}_0x83917a=_0x216ed9['rx']['substring'](0x4)[_0x9ba2('0x10')]('result=','');if(_0x83917a['indexOf']('\x20')!=-0x1){_0x83917a=_0x83917a['substr'](0x0,_0x83917a['indexOf']('\x20'));}if(_['startsWith'](_0x83917a,'-1')){_0x83917a=parseInt(_0x83917a);}_0x112800=_0x216ed9['rx'][_0x9ba2('0x11')]('\x20');if(_0x112800[_0x9ba2('0x12')]==0x3){_0x112800=_0x112800[0x2][_0x9ba2('0x13')](0x1,_0x112800[0x2][_0x9ba2('0x12')]-0x1);}else if(_0x112800[_0x9ba2('0x12')]>0x3){var _0x212aca=/\((.+)\)/;var _0x2c82ca=_0x216ed9['rx'][_0x9ba2('0x14')](_0x212aca);if(_0x2c82ca){_0x112800=_0x2c82ca[0x1];}else{_0x112800=null;}}else{_0x112800=null;}_0x216ed9['cb'](null,{'code':_0x44849b,'result':_0x83917a,'extra':_0x112800});}});_0x5cdbb2['on']('error',function(_0x55b47d){_0x55d157['emit'](_0x9ba2('0x15'),new AGIError(_0x9ba2('0x16'),_0x55b47d[_0x9ba2('0x17')]));});_0x5cdbb2['on'](_0x9ba2('0x18'),function(){_0x55d157[_0x9ba2('0x19')](_0x9ba2('0x18'),new AGIError(_0x9ba2('0x1a')));});_0x5cdbb2['on'](_0x9ba2('0x1b'),function(){_0x55d157['emit']('timeout',new AGIError(_0x9ba2('0x1c')));_0x5cdbb2['destroy']();});_0x5cdbb2[_0x9ba2('0x1d')](_0x4e8cc7);this['command']=function(_0x35c587,_0x145866){var _0x35c587=_0x35c587||'',_0x145866=typeof _0x145866==_0x9ba2('0xf')?_0x145866:new Function();_0x216ed9={'tx':_0x35c587,'rx':'','cb':_0x145866};_0x5cdbb2[_0x9ba2('0x1e')](_0x35c587+'\x0a');},this[_0x9ba2('0x18')]=function(){_0x5cdbb2[_0x9ba2('0x1f')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x9ba2('0x20')]=function(_0x470d6f){return this[_0x9ba2('0x21')][_0x9ba2('0x22')](this,_0x470d6f);};AGIChannel[_0x9ba2('0x23')][_0x9ba2('0x24')]=function(){return this[_0x9ba2('0x20')](_0x9ba2('0x25'));};AGIChannel['prototype']['getData']=function(_0x324c59,_0x1158db,_0x1a6fd7){_0x324c59=_0x324c59===undefined?'beep':_0x324c59;_0x1158db=_0x1158db===undefined?'5':_0x1158db;_0x1a6fd7=_0x1a6fd7===undefined?'1':_0x1a6fd7;return this['sendRequest'](util[_0x9ba2('0x26')](_0x9ba2('0x27'),_0x324c59,_0x1158db*0x3e8,_0x1a6fd7));};AGIChannel[_0x9ba2('0x23')][_0x9ba2('0x28')]=function(_0x1b3869){_0x1b3869=_0x1b3869||'NO\x20MESSAGE';return this[_0x9ba2('0x20')](util[_0x9ba2('0x26')](_0x9ba2('0x29'),_0x1b3869));};AGIChannel['prototype']['exec']=function(_0x7a51bd,_0x35f7c9){if(_[_0x9ba2('0x2a')](_0x35f7c9)){return this[_0x9ba2('0x20')](util[_0x9ba2('0x26')](_0x9ba2('0x2b'),_0x7a51bd,_0x35f7c9[_0x9ba2('0x2c')](',')));}return this[_0x9ba2('0x20')](util[_0x9ba2('0x26')](_0x9ba2('0x2b'),_0x7a51bd,_0x35f7c9));};AGIChannel[_0x9ba2('0x23')][_0x9ba2('0x2d')]=function(_0x2e4018){return this['sendRequest'](util[_0x9ba2('0x26')]('SET\x20CONTEXT\x20%s',_0x2e4018));};AGIChannel[_0x9ba2('0x23')]['setExtension']=function(_0x244732){return this[_0x9ba2('0x20')](util['format'](_0x9ba2('0x2e'),_0x244732));};AGIChannel['prototype'][_0x9ba2('0x2f')]=function(_0x35f7c5){return this[_0x9ba2('0x20')](util[_0x9ba2('0x26')]('SET\x20PRIORITY\x20%s',_0x35f7c5));};AGIChannel[_0x9ba2('0x23')][_0x9ba2('0xd')]=function(){return this['sendRequest'](_0x9ba2('0x30'));};AGIChannel[_0x9ba2('0x23')][_0x9ba2('0x31')]=function(_0xcf4768,_0x122c44){var _0x21b992=_['isBoolean'](_0x122c44)||_[_0x9ba2('0x32')](_0x122c44)?_0x122c44[_0x9ba2('0x33')]():_0x122c44;return this[_0x9ba2('0x20')](util['format'](_0x9ba2('0x34'),_0xcf4768,_0x21b992?_0x21b992['toString']()[_0x9ba2('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x9ba2('0x35')]=function(_0x5c79a4,_0x1e7b84){return this['sendRequest'](util[_0x9ba2('0x26')](_0x9ba2('0x36'),_0x5c79a4,_0x1e7b84));};AGIChannel[_0x9ba2('0x23')]['sayDigits']=function(_0x2a4e3d,_0x307685){return this['sendRequest'](util[_0x9ba2('0x26')](_0x9ba2('0x37'),_0x2a4e3d,_0x307685));};AGIChannel[_0x9ba2('0x23')][_0x9ba2('0x38')]=function(_0x30a766,_0x3abee5){return this['sendRequest'](util['format'](_0x9ba2('0x39'),_0x30a766,_0x3abee5));};AGIChannel[_0x9ba2('0x23')][_0x9ba2('0x3a')]=function(_0x66c892,_0x249136,_0x367c8a){_0x249136=_0x249136||this[_0x9ba2('0x3b')];_0x367c8a=_0x367c8a||0x1;this[_0x9ba2('0x2d')](_0x66c892);this[_0x9ba2('0x3c')](_0x249136);this[_0x9ba2('0x2f')](_0x367c8a);return this[_0x9ba2('0x28')](util[_0x9ba2('0x26')](_0x9ba2('0x3d'),_0x66c892,_0x249136,_0x367c8a));};AGIChannel['prototype']['getVariable']=function(_0x157f46){return this[_0x9ba2('0x20')](util[_0x9ba2('0x26')](_0x9ba2('0x3e'),_0x157f46));};AGIChannel['prototype'][_0x9ba2('0x3f')]=function(_0x3715e2,_0x1e7ed5,_0x466156,_0x1f6f63,_0x4a8623,_0x4890a7){_0x1e7ed5=_0x1e7ed5||_0x9ba2('0x40');_0x466156=_0x466156||'';_0x1f6f63=_0x1f6f63===undefined?-0x1:_0x1f6f63==='-1'?-0x1:_0x1f6f63*0x3e8;_0x4a8623=_0x4a8623===undefined?'':'s='+_0x4a8623;_0x4890a7=_0x4890a7?_0x9ba2('0x41'):'';return this['sendRequest'](util[_0x9ba2('0x26')](_0x9ba2('0x42'),_0x3715e2,_0x1e7ed5,_0x466156,_0x1f6f63,_0x4890a7,_0x4a8623));};AGIChannel['prototype'][_0x9ba2('0x43')]=function(_0x2bc253,_0x1e8a51){_0x1e8a51=_0x1e8a51||'';return this[_0x9ba2('0x20')](util[_0x9ba2('0x26')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x2bc253,_0x1e8a51));};AGIChannel['prototype'][_0x9ba2('0x44')]=function(_0xedfb82){return this[_0x9ba2('0x45')](_0x9ba2('0x46'),_0xedfb82);};AGIChannel[_0x9ba2('0x23')][_0x9ba2('0x47')]=function(_0x5dc61b){return this['exec'](_0x9ba2('0x48'),_0x5dc61b);};AGIChannel[_0x9ba2('0x23')][_0x9ba2('0x15')]=function(_0x485367,_0x28610c){this['noop'](util[_0x9ba2('0x26')](_0x9ba2('0x49'),_0x485367['id'],_0x485367[_0x9ba2('0x4a')],_0x28610c));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x9ba2('0x4b')]=AGIChannel; \ No newline at end of file +var _0xe0ad=['SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','replace','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','setExtension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','error','label','exports','util','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','result=','indexOf','substr','startsWith','length','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','pipe','command','destroy','inherits','sendRequest','sync','prototype','answer','ANSWER','getData','noop','NO\x20MESSAGE','format','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe0ad,0x1a5));var _0xde0a=function(_0x1ad86c,_0x1b9d47){_0x1ad86c=_0x1ad86c-0x0;var _0x405a97=_0xe0ad[_0x1ad86c];return _0x405a97;};'use strict';var util=require(_0xde0a('0x0'));var _=require('lodash');var EventEmitter=require(_0xde0a('0x1'))[_0xde0a('0x2')];var AGIReply=require(_0xde0a('0x3'));var AGIError=require(_0xde0a('0x4'));function AGIChannel(_0x53c75a){var _0x209b3e=this,_0x349167=new AGIReply(),_0x41800c=![],_0x395fb6={};EventEmitter[_0xde0a('0x5')](_0x209b3e);_0x53c75a[_0xde0a('0x6')](_0xde0a('0x7'));_0x53c75a[_0xde0a('0x8')](0x8*0x3c*0x3c*0x3e8);_0x349167[_0xde0a('0x6')](_0xde0a('0x7'));_0x349167['on'](_0xde0a('0x9'),function(_0x325e86){for(var _0x4070b6 in _0x325e86){_0x209b3e[_0x4070b6]=_0x325e86[_0x4070b6];}_0x209b3e[_0xde0a('0xa')](_0xde0a('0xb'));});_0x349167['on'](_0xde0a('0xc'),function(_0x2ae190){if(_0x2ae190['toLowerCase']()==_0xde0a('0xd')){_0x209b3e[_0xde0a('0xa')]('hangup');return;}if(_0x2ae190[_0xde0a('0xe')](0x0,0xb)==_0xde0a('0xf')){_0x41800c=!![];}if(_0x41800c){_0x395fb6['rx']+=_0x2ae190+'\x0a';if(_0x2ae190[_0xde0a('0x10')](_0xde0a('0x11'))!=-0x1){_0x41800c=![];}}else{_0x395fb6['rx']=_0x2ae190;}if(_0x41800c){return;}if(typeof _0x395fb6['cb']==_0xde0a('0x12')){var _0x1e2941=_0x395fb6['rx']['substring'](0x0,0x3),_0xaa1c4b=null,_0x24de85=null;_0x1e2941=parseInt(_0x1e2941);if(isNaN(_0x1e2941)){_0x395fb6['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xde0a('0x13')});return;}if(_0x1e2941!=0xc8){_0x395fb6['cb'](null,{'code':_0x1e2941,'result':-0x1,'extra':'KO'});return;}_0xaa1c4b=_0x395fb6['rx'][_0xde0a('0xe')](0x4)['replace'](_0xde0a('0x14'),'');if(_0xaa1c4b[_0xde0a('0x15')]('\x20')!=-0x1){_0xaa1c4b=_0xaa1c4b[_0xde0a('0x16')](0x0,_0xaa1c4b[_0xde0a('0x15')]('\x20'));}if(_[_0xde0a('0x17')](_0xaa1c4b,'-1')){_0xaa1c4b=parseInt(_0xaa1c4b);}_0x24de85=_0x395fb6['rx']['split']('\x20');if(_0x24de85[_0xde0a('0x18')]==0x3){_0x24de85=_0x24de85[0x2][_0xde0a('0xe')](0x1,_0x24de85[0x2][_0xde0a('0x18')]-0x1);}else if(_0x24de85[_0xde0a('0x18')]>0x3){var _0x346ff3=/\((.+)\)/;var _0x4e1b2a=_0x395fb6['rx']['match'](_0x346ff3);if(_0x4e1b2a){_0x24de85=_0x4e1b2a[0x1];}else{_0x24de85=null;}}else{_0x24de85=null;}_0x395fb6['cb'](null,{'code':_0x1e2941,'result':_0xaa1c4b,'extra':_0x24de85});}});_0x53c75a['on']('error',function(_0x571574){_0x209b3e[_0xde0a('0xa')]('error',new AGIError(_0xde0a('0x19'),_0x571574['code']));});_0x53c75a['on'](_0xde0a('0x1a'),function(){_0x209b3e[_0xde0a('0xa')]('close',new AGIError(_0xde0a('0x1b')));});_0x53c75a['on'](_0xde0a('0x1c'),function(){_0x209b3e[_0xde0a('0xa')](_0xde0a('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x53c75a['destroy']();});_0x53c75a[_0xde0a('0x1d')](_0x349167);this[_0xde0a('0x1e')]=function(_0x5dc3df,_0x8992c5){var _0x5dc3df=_0x5dc3df||'',_0x8992c5=typeof _0x8992c5==_0xde0a('0x12')?_0x8992c5:new Function();_0x395fb6={'tx':_0x5dc3df,'rx':'','cb':_0x8992c5};_0x53c75a['write'](_0x5dc3df+'\x0a');},this[_0xde0a('0x1a')]=function(){_0x53c75a[_0xde0a('0x1f')]();};}util[_0xde0a('0x20')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xde0a('0x21')]=function(_0x51111d){return this[_0xde0a('0x1e')][_0xde0a('0x22')](this,_0x51111d);};AGIChannel[_0xde0a('0x23')][_0xde0a('0x24')]=function(){return this[_0xde0a('0x21')](_0xde0a('0x25'));};AGIChannel[_0xde0a('0x23')][_0xde0a('0x26')]=function(_0x3b6381,_0x57eadf,_0x2438a5){_0x3b6381=_0x3b6381===undefined?'beep':_0x3b6381;_0x57eadf=_0x57eadf===undefined?'5':_0x57eadf;_0x2438a5=_0x2438a5===undefined?'1':_0x2438a5;return this[_0xde0a('0x21')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x3b6381,_0x57eadf*0x3e8,_0x2438a5));};AGIChannel[_0xde0a('0x23')][_0xde0a('0x27')]=function(_0xf5479f){_0xf5479f=_0xf5479f||_0xde0a('0x28');return this['sendRequest'](util[_0xde0a('0x29')]('VERBOSE\x20\x22%s\x22',_0xf5479f));};AGIChannel[_0xde0a('0x23')][_0xde0a('0x2a')]=function(_0x236de9,_0x48d197){if(_[_0xde0a('0x2b')](_0x48d197)){return this['sendRequest'](util[_0xde0a('0x29')](_0xde0a('0x2c'),_0x236de9,_0x48d197['join'](',')));}return this[_0xde0a('0x21')](util[_0xde0a('0x29')]('EXEC\x20%s\x20%s',_0x236de9,_0x48d197));};AGIChannel[_0xde0a('0x23')][_0xde0a('0x2d')]=function(_0x4297b8){return this['sendRequest'](util[_0xde0a('0x29')](_0xde0a('0x2e'),_0x4297b8));};AGIChannel[_0xde0a('0x23')]['setExtension']=function(_0x498410){return this[_0xde0a('0x21')](util[_0xde0a('0x29')](_0xde0a('0x2f'),_0x498410));};AGIChannel[_0xde0a('0x23')][_0xde0a('0x30')]=function(_0x22fc38){return this[_0xde0a('0x21')](util[_0xde0a('0x29')](_0xde0a('0x31'),_0x22fc38));};AGIChannel[_0xde0a('0x23')]['hangup']=function(){return this['sendRequest'](_0xde0a('0x32'));};AGIChannel[_0xde0a('0x23')][_0xde0a('0x33')]=function(_0x45bf58,_0x2b876f){var _0x2061bd=_[_0xde0a('0x34')](_0x2b876f)||_[_0xde0a('0x35')](_0x2b876f)?_0x2b876f['toString']():_0x2b876f;return this[_0xde0a('0x21')](util['format'](_0xde0a('0x36'),_0x45bf58,_0x2061bd?_0x2061bd[_0xde0a('0x37')]()[_0xde0a('0x38')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xde0a('0x23')][_0xde0a('0x39')]=function(_0x839dda,_0x17a06d){return this['sendRequest'](util[_0xde0a('0x29')](_0xde0a('0x3a'),_0x839dda,_0x17a06d));};AGIChannel['prototype'][_0xde0a('0x3b')]=function(_0x248ada,_0x28b7a8){return this[_0xde0a('0x21')](util[_0xde0a('0x29')](_0xde0a('0x3c'),_0x248ada,_0x28b7a8));};AGIChannel[_0xde0a('0x23')][_0xde0a('0x3d')]=function(_0x3b22c5,_0x1582d8){return this[_0xde0a('0x21')](util[_0xde0a('0x29')](_0xde0a('0x3e'),_0x3b22c5,_0x1582d8));};AGIChannel[_0xde0a('0x23')][_0xde0a('0x3f')]=function(_0x4a682d,_0x195bb1,_0x39c4ad){_0x195bb1=_0x195bb1||this[_0xde0a('0x40')];_0x39c4ad=_0x39c4ad||0x1;this[_0xde0a('0x2d')](_0x4a682d);this[_0xde0a('0x41')](_0x195bb1);this[_0xde0a('0x30')](_0x39c4ad);return this[_0xde0a('0x27')](util[_0xde0a('0x29')](_0xde0a('0x42'),_0x4a682d,_0x195bb1,_0x39c4ad));};AGIChannel[_0xde0a('0x23')]['getVariable']=function(_0x2b796f){return this[_0xde0a('0x21')](util[_0xde0a('0x29')](_0xde0a('0x43'),_0x2b796f));};AGIChannel[_0xde0a('0x23')][_0xde0a('0x44')]=function(_0x779ee6,_0x1b03c2,_0x93afcd,_0x54b2eb,_0x240f38,_0x143294){_0x1b03c2=_0x1b03c2||_0xde0a('0x45');_0x93afcd=_0x93afcd||'';_0x54b2eb=_0x54b2eb===undefined?-0x1:_0x54b2eb==='-1'?-0x1:_0x54b2eb*0x3e8;_0x240f38=_0x240f38===undefined?'':'s='+_0x240f38;_0x143294=_0x143294?_0xde0a('0x46'):'';return this[_0xde0a('0x21')](util[_0xde0a('0x29')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x779ee6,_0x1b03c2,_0x93afcd,_0x54b2eb,_0x143294,_0x240f38));};AGIChannel[_0xde0a('0x23')]['streamFile']=function(_0x1ac63b,_0x417dfb){_0x417dfb=_0x417dfb||'';return this['sendRequest'](util[_0xde0a('0x29')](_0xde0a('0x47'),_0x1ac63b,_0x417dfb));};AGIChannel['prototype']['agi']=function(_0x4e9514){return this[_0xde0a('0x2a')](_0xde0a('0x48'),_0x4e9514);};AGIChannel[_0xde0a('0x23')][_0xde0a('0x49')]=function(_0x1e5ce8){return this[_0xde0a('0x2a')](_0xde0a('0x4a'),_0x1e5ce8);};AGIChannel[_0xde0a('0x23')][_0xde0a('0x4b')]=function(_0x37f97b,_0x297367){this['noop'](util[_0xde0a('0x29')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x37f97b['id'],_0x37f97b[_0xde0a('0x4c')],_0x297367));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xde0a('0x4d')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 4eb45fd..e796ff5 100644 --- a/server/services/agi/error.js +++ b/server/services/agi/error.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6137=['message','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x6137,0x1e3));var _0x7613=function(_0xf36821,_0xae177f){_0xf36821=_0xf36821-0x0;var _0x5d954b=_0x6137[_0xf36821];return _0x5d954b;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x7613('0x0'),'E_AGI_ARGUMENT_PORT':_0x7613('0x1'),'E_AGI_SERVER_ERROR':_0x7613('0x2'),'E_AGI_SERVER_CLOSE':_0x7613('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x7613('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x7613('0x5'),'E_AGI_SOCKET_ERROR':_0x7613('0x6'),'E_AGI_SOCKET_CLOSE':_0x7613('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x7613('0x8'),'E_AGI_COMMAND_EMPTY':_0x7613('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x7613('0xa')};function AGIError(_0x33569a){var _0x33569a=_0x33569a||null,_0x45ce2b=_0x45ce2b||[],_0x1d9258=0x1,_0x577ff1='';if(!error[_0x33569a]){_0x33569a='E_AGI_UNDEFINED';}_0x45ce2b[_0x7613('0xb')](error[_0x33569a]);while(arguments[_0x1d9258]){_0x45ce2b[_0x7613('0xb')](arguments[_0x1d9258]);_0x1d9258++;}_0x577ff1=util[_0x7613('0xc')]['apply'](util,_0x45ce2b);this[_0x7613('0xd')]=_0x577ff1;this[_0x7613('0xe')]=_0x33569a;}module[_0x7613('0xf')]=AGIError; \ No newline at end of file +var _0x13fc=['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.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.'];(function(_0x3f9164,_0x14e2ac){var _0x1eac97=function(_0x3c0b51){while(--_0x3c0b51){_0x3f9164['push'](_0x3f9164['shift']());}};_0x1eac97(++_0x14e2ac);}(_0x13fc,0xee));var _0xc13f=function(_0x156172,_0x2f3f37){_0x156172=_0x156172-0x0;var _0x3cab19=_0x13fc[_0x156172];return _0x3cab19;};'use strict';var util=require(_0xc13f('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xc13f('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xc13f('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0xc13f('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xc13f('0x4'),'E_AGI_SOCKET_ERROR':_0xc13f('0x5'),'E_AGI_SOCKET_CLOSE':_0xc13f('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xc13f('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xc13f('0x8')};function AGIError(_0x608e3c){var _0x608e3c=_0x608e3c||null,_0x196028=_0x196028||[],_0x4bd87a=0x1,_0x42c33f='';if(!error[_0x608e3c]){_0x608e3c=_0xc13f('0x9');}_0x196028[_0xc13f('0xa')](error[_0x608e3c]);while(arguments[_0x4bd87a]){_0x196028[_0xc13f('0xa')](arguments[_0x4bd87a]);_0x4bd87a++;}_0x42c33f=util[_0xc13f('0xb')][_0xc13f('0xc')](util,_0x196028);this[_0xc13f('0xd')]=_0x42c33f;this[_0xc13f('0xe')]=_0x608e3c;}module[_0xc13f('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 37d4779..3d93f87 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63cf=['emit','error','events','EventEmitter','ioredis','./error','redis','localhost','agi','parse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63cf,0xa2));var _0xf63c=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x63cf[_0x2ca2d0];return _0x521c23;};'use strict';var _=require('lodash');var EventEmitter=require(_0xf63c('0x0'))[_0xf63c('0x1')];var Redis=require(_0xf63c('0x2'));var AGIError=require(_0xf63c('0x3'));var config=require('../../config/environment');config[_0xf63c('0x4')]=_['defaults'](config[_0xf63c('0x4')],{'host':_0xf63c('0x5'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub['subscribe'](_0xf63c('0x6'),function(_0x53197e){if(_0x53197e)return eventEmitter['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0x53197e));});sub['on']('message',function(_0x4109d4,_0x24d5bc){if(_0x4109d4!==_0xf63c('0x6'))return;try{var _0x3a47bd=JSON[_0xf63c('0x7')](_0x24d5bc);eventEmitter['emit']('projectUpdate',_0x3a47bd);}catch(_0x494280){eventEmitter[_0xf63c('0x8')](_0xf63c('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x494280));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x9131=['lodash','EventEmitter','./error','../../config/environment','redis','defaults','localhost','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','message','projectUpdate'];(function(_0x415608,_0x3b1b35){var _0x3c121e=function(_0x4d8ef7){while(--_0x4d8ef7){_0x415608['push'](_0x415608['shift']());}};_0x3c121e(++_0x3b1b35);}(_0x9131,0x1a4));var _0x1913=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9131[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1913('0x0'));var EventEmitter=require('events')[_0x1913('0x1')];var Redis=require('ioredis');var AGIError=require(_0x1913('0x2'));var config=require(_0x1913('0x3'));config[_0x1913('0x4')]=_[_0x1913('0x5')](config[_0x1913('0x4')],{'host':_0x1913('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x1913('0x4')]);sub[_0x1913('0x7')](_0x1913('0x8'),function(_0x5a319b){if(_0x5a319b)return eventEmitter[_0x1913('0x9')](_0x1913('0xa'),new AGIError(_0x1913('0xb'),_0x5a319b));});sub['on'](_0x1913('0xc'),function(_0xaa7b1e,_0x6a0edf){if(_0xaa7b1e!=='agi')return;try{var _0x2ee640=JSON['parse'](_0x6a0edf);eventEmitter[_0x1913('0x9')](_0x1913('0xd'),_0x2ee640);}catch(_0x51277e){eventEmitter[_0x1913('0x9')](_0x1913('0xa'),new AGIError(_0x1913('0xb'),_0x51277e));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 212bed3..2d0b7a4 100644 --- a/server/services/agi/graph/index.js +++ b/server/services/agi/graph/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x923d=['agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','addVertex','prototype','addEdge','push','size','getVertex','traverseBFS','info','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','invalid','includes','max\x20retry\x20reach','exports','../../../config/logger'];(function(_0x491a48,_0x46f746){var _0x37b4d1=function(_0x5a68ca){while(--_0x5a68ca){_0x491a48['push'](_0x491a48['shift']());}};_0x37b4d1(++_0x46f746);}(_0x923d,0xdf));var _0xd923=function(_0x147660,_0x144cc6){_0x147660=_0x147660-0x0;var _0xf4ca71=_0x923d[_0x147660];return _0xf4ca71;};'use strict';var _=require('lodash');var logger=require(_0xd923('0x0'))(_0xd923('0x1'));var verticesWithRetry=[_0xd923('0x2'),_0xd923('0x3'),_0xd923('0x4')];var Graph=function(){this[_0xd923('0x5')]={};this[_0xd923('0x6')]={};this[_0xd923('0x7')]=0x0;};Graph['prototype'][_0xd923('0x8')]=function(_0x176b91){this['vertices'][_0x176b91['id']]=_0x176b91;this[_0xd923('0x6')][_0x176b91['id']]=[];};Graph[_0xd923('0x9')][_0xd923('0xa')]=function(_0x4e43ba,_0x5c4bac,_0x40064a){this[_0xd923('0x6')][_0x4e43ba][_0xd923('0xb')]({'target':_0x5c4bac,'condition':_0x40064a});this[_0xd923('0x7')]+=0x1;};Graph['prototype'][_0xd923('0xc')]=function(){return _[_0xd923('0xc')](this[_0xd923('0x5')]);};Graph['prototype']['relations']=function(){return this['numberOfEdges'];};Graph[_0xd923('0x9')][_0xd923('0xd')]=function(_0x39921e){return this['vertices'][_0x39921e];};Graph[_0xd923('0x9')][_0xd923('0xe')]=function(_0x18b0fa,_0x9665e9){if(!this[_0xd923('0x5')][_0x18b0fa]){return logger[_0xd923('0xf')](_0xd923('0x10'));}var _0x3e81eb=_0x9665e9(this[_0xd923('0x5')][_0x18b0fa]);if(!_0x3e81eb){return logger[_0xd923('0xf')]('stop\x20traverse');}if(this['edges'][_0x18b0fa][_0xd923('0x11')]===0x0){return logger[_0xd923('0xf')](_0xd923('0x12'));}for(var _0x10a256=0x0,_0x211481=[],_0x36e9b6=![];_0x10a256\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','catch','hasOwnProperty','indexOf','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','find','production','handleUnpublished','initialize','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED'];(function(_0x5ee0fb,_0x8d23c2){var _0x204bf0=function(_0x1ceb52){while(--_0x1ceb52){_0x5ee0fb['push'](_0x5ee0fb['shift']());}};_0x204bf0(++_0x8d23c2);}(_0xfa46,0xbb));var _0x6fa4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfa46[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6fa4('0x0'));var syncho=require(_0x6fa4('0x1'));var util=require(_0x6fa4('0x2'));var config=require(_0x6fa4('0x3'));var logger=require('../../config/logger')(_0x6fa4('0x4'));var utilLicense=require(_0x6fa4('0x5'));var rpc=require(_0x6fa4('0x6'));var Project=require(_0x6fa4('0x7'));var AGIEmitter=require(_0x6fa4('0x8'))[_0x6fa4('0x9')];var projects=[];config['agi']=_['defaults'](config['agi'],{'ip':_0x6fa4('0xa'),'port':0x11dd});AGIEmitter['on'](_0x6fa4('0xb'),projectUpdateHandler);function connectionHandler(_0x486bf5){process[_0x6fa4('0xc')](function(){syncho(function(){try{setChannelVariables(_0x486bf5);agiHandler(_0x486bf5);}catch(_0x2d42b6){logger[_0x6fa4('0xd')](_0x2d42b6['stack']);}});});}function projectUpdateHandler(_0x54b724){try{var _0x46a3fc=_[_0x6fa4('0xe')](projects,['id',_0x54b724['id']]);if(_0x46a3fc>-0x1){if(_0x54b724['deleted']===!![]){projects[_0x6fa4('0xf')](_0x46a3fc,0x1);}else{projects[_0x46a3fc]=_0x54b724;}}else{projects[_0x6fa4('0x10')](_0x54b724);}}catch(_0x5f4fde){logger[_0x6fa4('0xd')](_0x5f4fde[_0x6fa4('0x11')]);}}function listeningHandler(){console[_0x6fa4('0x12')](_0x6fa4('0x13'),config['agi'][_0x6fa4('0x14')]);logger[_0x6fa4('0x15')](util[_0x6fa4('0x16')](_0x6fa4('0x17'),config['agi']['ip'],config['agi'][_0x6fa4('0x14')]));}function errorHandler(_0x32137d){if(_0x32137d&&_0x32137d['name']&&_0x32137d['message']){logger[_0x6fa4('0xd')](util[_0x6fa4('0x16')](_0x6fa4('0x18'),_0x32137d[_0x6fa4('0x19')],_0x32137d[_0x6fa4('0x1a')]));}else{logger[_0x6fa4('0xd')](util['format'](_0x6fa4('0x1b'),_0x32137d[_0x6fa4('0x11')]));}}function closeHandler(){logger['info'](util[_0x6fa4('0x16')](_0x6fa4('0x1c'),this[_0x6fa4('0x1d')],this[_0x6fa4('0x1e')],this[_0x6fa4('0x1f')],this[_0x6fa4('0x20')],this[_0x6fa4('0x21')]));try{createSquareReport(this);}catch(_0x1e3c4d){logger[_0x6fa4('0xd')](_0x1e3c4d[_0x6fa4('0x11')]);}}function timeoutHandler(){logger[_0x6fa4('0x15')](util[_0x6fa4('0x16')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x6fa4('0x1e')],this[_0x6fa4('0x1f')],this[_0x6fa4('0x20')],this[_0x6fa4('0x21')]));}function hangupHandler(){logger[_0x6fa4('0x15')](util[_0x6fa4('0x16')](_0x6fa4('0x22'),this[_0x6fa4('0x1d')],this[_0x6fa4('0x1e')],this[_0x6fa4('0x1f')],this[_0x6fa4('0x20')],this[_0x6fa4('0x21')]));this[_0x6fa4('0x23')]=!![];}function createSquareReport(_0x2bd323,_0x40a47e){rpc[_0x6fa4('0x24')](_0x2bd323)['then'](function(_0x312adc){if(_0x40a47e){_0x40a47e(null,_0x312adc);}})[_0x6fa4('0x25')](function(_0x549ac7){if(_0x40a47e){_0x40a47e(null,_0x549ac7);}});}function setChannelVariables(_0x1e1659){for(var _0x151146 in _0x1e1659){if(_0x1e1659[_0x6fa4('0x26')](_0x151146)){if(_0x151146[_0x6fa4('0x27')]('agi_')===0x0){_0x1e1659[_0x151146['substring'](0x4)]=_0x1e1659[_0x151146];delete _0x1e1659[_0x151146];}}}}function agiHandler(_0x515a45){logger[_0x6fa4('0x28')](_0x6fa4('0x29'),JSON['stringify'](_0x515a45,null,0x2));logger[_0x6fa4('0x15')](util[_0x6fa4('0x16')](_0x6fa4('0x2a'),_0x515a45[_0x6fa4('0x1d')],_0x515a45[_0x6fa4('0x1e')],_0x515a45[_0x6fa4('0x1f')],_0x515a45[_0x6fa4('0x20')],_0x515a45['uniqueid']));_0x515a45['on'](_0x6fa4('0xd'),errorHandler);_0x515a45['on'](_0x6fa4('0x2b'),closeHandler);_0x515a45['on'](_0x6fa4('0x2c'),timeoutHandler);_0x515a45[_0x6fa4('0x23')]=![];_0x515a45['on'](_0x6fa4('0x2d'),hangupHandler);var _0x3039d3=_[_0x6fa4('0x2e')](projects,['name',_0x515a45[_0x6fa4('0x1d')]]);if(!_0x3039d3)return Project['handleNotFound'](_0x515a45);if(!_0x3039d3[_0x6fa4('0x2f')])return Project[_0x6fa4('0x30')](_0x515a45);return Project[_0x6fa4('0x31')](_0x3039d3,_0x515a45);}function main(){var _0x4e1da8;return utilLicense[_0x6fa4('0x32')]()[_0x6fa4('0x33')](function(_0x17c24f){if(!_0x17c24f)return;if(_0x17c24f[_0x6fa4('0x34')]){if(_0x17c24f[_0x6fa4('0x35')]&&_0x17c24f[_0x6fa4('0x35')]>0x0){logger[_0x6fa4('0x15')](util['format'](_0x6fa4('0x36'),_0x17c24f[_0x6fa4('0x35')]));_0x4e1da8=_0x17c24f['callysquare'];}else{logger['info'](_0x6fa4('0x37'));}}else{logger[_0x6fa4('0x15')](_0x6fa4('0x38'));_0x4e1da8=-0x1;}})[_0x6fa4('0x33')](function(){return Project['getAll']();})[_0x6fa4('0x33')](function(_0xedad83){projects=_0xedad83;return;})[_0x6fa4('0x25')](function(_0x3f2cb4){logger['error'](_0x6fa4('0x39'),_0x3f2cb4[_0x6fa4('0x11')]);})[_0x6fa4('0x3a')](function(){var _0x17442d=require(_0x6fa4('0x3b'))(config[_0x6fa4('0x4')][_0x6fa4('0x14')],config['agi']['ip'],_0x4e1da8);_0x17442d['on'](_0x6fa4('0xd'),errorHandler);_0x17442d['on']('listening',listeningHandler);_0x17442d['on'](_0x6fa4('0x3c'),connectionHandler);_0x17442d['on'](_0x6fa4('0x2b'),closeHandler);});}main(); \ No newline at end of file +var _0x7f4c=['calleridname','callerid','dnid','uniqueid','[HANGUP]\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','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','name','handleNotFound','production','handleUnpublished','initialize','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','finally','./server','listening','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','./events','EventEmitter','defaults','127.0.0.1','nextTick','error','stack','findIndex','deleted','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1'];(function(_0x30e6a8,_0x296322){var _0x28bb68=function(_0x5109fd){while(--_0x5109fd){_0x30e6a8['push'](_0x30e6a8['shift']());}};_0x28bb68(++_0x296322);}(_0x7f4c,0xd6));var _0xc7f4=function(_0x29a4ee,_0x1c2a16){_0x29a4ee=_0x29a4ee-0x0;var _0x4a2d3f=_0x7f4c[_0x29a4ee];return _0x4a2d3f;};'use strict';var _=require(_0xc7f4('0x0'));var syncho=require(_0xc7f4('0x1'));var util=require(_0xc7f4('0x2'));var config=require(_0xc7f4('0x3'));var logger=require(_0xc7f4('0x4'))(_0xc7f4('0x5'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var Project=require('./project');var AGIEmitter=require(_0xc7f4('0x6'))[_0xc7f4('0x7')];var projects=[];config[_0xc7f4('0x5')]=_[_0xc7f4('0x8')](config[_0xc7f4('0x5')],{'ip':_0xc7f4('0x9'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x56f017){process[_0xc7f4('0xa')](function(){syncho(function(){try{setChannelVariables(_0x56f017);agiHandler(_0x56f017);}catch(_0x4f7b7e){logger[_0xc7f4('0xb')](_0x4f7b7e[_0xc7f4('0xc')]);}});});}function projectUpdateHandler(_0x592163){try{var _0x5101e7=_[_0xc7f4('0xd')](projects,['id',_0x592163['id']]);if(_0x5101e7>-0x1){if(_0x592163[_0xc7f4('0xe')]===!![]){projects[_0xc7f4('0xf')](_0x5101e7,0x1);}else{projects[_0x5101e7]=_0x592163;}}else{projects[_0xc7f4('0x10')](_0x592163);}}catch(_0x47cd25){logger['error'](_0x47cd25[_0xc7f4('0xc')]);}}function listeningHandler(){console[_0xc7f4('0x11')](_0xc7f4('0x12'),config[_0xc7f4('0x5')][_0xc7f4('0x13')]);logger[_0xc7f4('0x14')](util[_0xc7f4('0x15')](_0xc7f4('0x16'),config[_0xc7f4('0x5')]['ip'],config[_0xc7f4('0x5')]['port']));}function errorHandler(_0x5429b9){if(_0x5429b9&&_0x5429b9['name']&&_0x5429b9['message']){logger[_0xc7f4('0xb')](util[_0xc7f4('0x15')]('[%s]\x20%s',_0x5429b9['name'],_0x5429b9[_0xc7f4('0x17')]));}else{logger[_0xc7f4('0xb')](util['format']('[ERROR]\x20%s',_0x5429b9[_0xc7f4('0xc')]));}}function closeHandler(){logger[_0xc7f4('0x14')](util['format'](_0xc7f4('0x18'),this[_0xc7f4('0x19')],this[_0xc7f4('0x1a')],this[_0xc7f4('0x1b')],this[_0xc7f4('0x1c')],this[_0xc7f4('0x1d')]));try{createSquareReport(this);}catch(_0xe5883f){logger[_0xc7f4('0xb')](_0xe5883f[_0xc7f4('0xc')]);}}function timeoutHandler(){logger['info'](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xc7f4('0x19')],this[_0xc7f4('0x1a')],this[_0xc7f4('0x1b')],this[_0xc7f4('0x1c')],this[_0xc7f4('0x1d')]));}function hangupHandler(){logger[_0xc7f4('0x14')](util[_0xc7f4('0x15')](_0xc7f4('0x1e'),this[_0xc7f4('0x19')],this[_0xc7f4('0x1a')],this[_0xc7f4('0x1b')],this[_0xc7f4('0x1c')],this[_0xc7f4('0x1d')]));this[_0xc7f4('0x1f')]=!![];}function createSquareReport(_0x4ce4b7,_0x505034){rpc[_0xc7f4('0x20')](_0x4ce4b7)[_0xc7f4('0x21')](function(_0x5cfb7d){if(_0x505034){_0x505034(null,_0x5cfb7d);}})[_0xc7f4('0x22')](function(_0x298b39){if(_0x505034){_0x505034(null,_0x298b39);}});}function setChannelVariables(_0x4a8aec){for(var _0x2f39ee in _0x4a8aec){if(_0x4a8aec[_0xc7f4('0x23')](_0x2f39ee)){if(_0x2f39ee[_0xc7f4('0x24')](_0xc7f4('0x25'))===0x0){_0x4a8aec[_0x2f39ee[_0xc7f4('0x26')](0x4)]=_0x4a8aec[_0x2f39ee];delete _0x4a8aec[_0x2f39ee];}}}}function agiHandler(_0x3e0a2f){logger[_0xc7f4('0x27')](_0xc7f4('0x28'),JSON[_0xc7f4('0x29')](_0x3e0a2f,null,0x2));logger[_0xc7f4('0x14')](util[_0xc7f4('0x15')](_0xc7f4('0x2a'),_0x3e0a2f['arg_1'],_0x3e0a2f[_0xc7f4('0x1a')],_0x3e0a2f[_0xc7f4('0x1b')],_0x3e0a2f[_0xc7f4('0x1c')],_0x3e0a2f[_0xc7f4('0x1d')]));_0x3e0a2f['on'](_0xc7f4('0xb'),errorHandler);_0x3e0a2f['on']('close',closeHandler);_0x3e0a2f['on'](_0xc7f4('0x2b'),timeoutHandler);_0x3e0a2f[_0xc7f4('0x1f')]=![];_0x3e0a2f['on'](_0xc7f4('0x2c'),hangupHandler);var _0x4acd48=_['find'](projects,[_0xc7f4('0x2d'),_0x3e0a2f[_0xc7f4('0x19')]]);if(!_0x4acd48)return Project[_0xc7f4('0x2e')](_0x3e0a2f);if(!_0x4acd48[_0xc7f4('0x2f')])return Project[_0xc7f4('0x30')](_0x3e0a2f);return Project[_0xc7f4('0x31')](_0x4acd48,_0x3e0a2f);}function main(){var _0x1e80b6;return utilLicense['getLicense']()['then'](function(_0x4696fe){if(!_0x4696fe)return;if(_0x4696fe[_0xc7f4('0x32')]){if(_0x4696fe['callysquare']&&_0x4696fe[_0xc7f4('0x33')]>0x0){logger['info'](util['format'](_0xc7f4('0x34'),_0x4696fe[_0xc7f4('0x33')]));_0x1e80b6=_0x4696fe[_0xc7f4('0x33')];}else{logger['info'](_0xc7f4('0x35'));}}else{logger[_0xc7f4('0x14')](_0xc7f4('0x36'));_0x1e80b6=-0x1;}})[_0xc7f4('0x21')](function(){return Project[_0xc7f4('0x37')]();})['then'](function(_0x683ea6){projects=_0x683ea6;return;})[_0xc7f4('0x22')](function(_0x21178f){logger['error']('[LICENSE]',_0x21178f[_0xc7f4('0xc')]);})[_0xc7f4('0x38')](function(){var _0x2e202a=require(_0xc7f4('0x39'))(config[_0xc7f4('0x5')][_0xc7f4('0x13')],config[_0xc7f4('0x5')]['ip'],_0x1e80b6);_0x2e202a['on'](_0xc7f4('0xb'),errorHandler);_0x2e202a['on'](_0xc7f4('0x3a'),listeningHandler);_0x2e202a['on'](_0xc7f4('0x3b'),connectionHandler);_0x2e202a['on']('close',closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index cba4356..334369c 100644 --- a/server/services/agi/mailRpc/index.js +++ b/server/services/agi/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7ab=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','http','then','error','result'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb7ab,0xed));var _0xbb7a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb7ab[_0x2641f9];return _0x585741;};'use strict';var BPromise=require(_0xbb7a('0x0'));var jayson=require(_0xbb7a('0x1'));var client=jayson['client'][_0xbb7a('0x2')]({'port':0x232b});function request(_0xf3c2c9,_0x5637c8){return new BPromise(function(_0x1d7c37,_0x467760){return client['request'](_0xf3c2c9,_0x5637c8)[_0xbb7a('0x3')](function(_0x2cc29a){if(_0x2cc29a[_0xbb7a('0x4')]){return _0x467760(_0x2cc29a[_0xbb7a('0x4')]['message']);}else{return _0x1d7c37(_0x2cc29a[_0xbb7a('0x5')]);}})[_0xbb7a('0x6')](function(_0x18c4e7){return _0x467760(_0x18c4e7);});});}exports[_0xbb7a('0x7')]=function(_0x1e8c7d,_0x316276){return request(_0xbb7a('0x8'),{'account':_0x1e8c7d,'message':_0x316276});}; \ No newline at end of file +var _0xb313=['http','then','error','message','result','catch','SendMail','bluebird','client'];(function(_0x3199ea,_0x4d36e5){var _0x41abc4=function(_0x1da2e8){while(--_0x1da2e8){_0x3199ea['push'](_0x3199ea['shift']());}};_0x41abc4(++_0x4d36e5);}(_0xb313,0x181));var _0x3b31=function(_0x487a0b,_0x33c302){_0x487a0b=_0x487a0b-0x0;var _0x4cb1ba=_0xb313[_0x487a0b];return _0x4cb1ba;};'use strict';var BPromise=require(_0x3b31('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x3b31('0x1')][_0x3b31('0x2')]({'port':0x232b});function request(_0x3df95d,_0x1d45c1){return new BPromise(function(_0xb67860,_0x152f37){return client['request'](_0x3df95d,_0x1d45c1)[_0x3b31('0x3')](function(_0x557811){if(_0x557811[_0x3b31('0x4')]){return _0x152f37(_0x557811[_0x3b31('0x4')][_0x3b31('0x5')]);}else{return _0xb67860(_0x557811[_0x3b31('0x6')]);}})[_0x3b31('0x7')](function(_0x5ee7e2){return _0x152f37(_0x5ee7e2);});});}exports['sendMailMessage']=function(_0x31e0f3,_0x42d6e2){return request(_0x3b31('0x8'),{'account':_0x31e0f3,'message':_0x42d6e2});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 22cfc8e..35a4ad7 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d33=['extension','priority','response','code','evtHangup','isUndefined','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[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','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','util','agi','./rpc','./mailRpc','./vertices','catch','error','stack','agicommand','retry','maxRetry','addVertex','mxCell','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','start','debug','root','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','traverseBFS','clear','vertex','stringify','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2d33,0x1c5));var _0x32d3=function(_0xb4a11,_0x2f4b5b){_0xb4a11=_0xb4a11-0x0;var _0x32a010=_0x2d33[_0xb4a11];return _0x32a010;};'use strict';var _=require(_0x32d3('0x0'));var moment=require(_0x32d3('0x1'));var parser=require(_0x32d3('0x2'));var util=require(_0x32d3('0x3'));var logger=require('../../config/logger')(_0x32d3('0x4'));var rpc=require(_0x32d3('0x5'));var mailRpc=require(_0x32d3('0x6'));var Graph=require('./graph');var Vertices=require(_0x32d3('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x32d3('0x8')](function(_0x1daf2d){logger[_0x32d3('0x9')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x1daf2d[_0x32d3('0xa')]);return[];});}function addVertex(_0x596284,_0x347aac,_0x3a5c75){_0x347aac[_0x32d3('0xb')]=_0x3a5c75;if(_0x347aac['hasOwnProperty'](_0x32d3('0xc'))){_0x347aac[_0x32d3('0xd')]=parseInt(_0x347aac['retry'],0xa);}_0x596284[_0x32d3('0xe')](_['omit'](_0x347aac,_0x32d3('0xf')));}function initGraph(_0x315c34,_0x552f16){var _0x17af71=new Graph();for(var _0x4d47d8 in _0x315c34){if(_0x315c34['hasOwnProperty'](_0x4d47d8)){if(_[_0x32d3('0x10')](_0x315c34[_0x4d47d8])){for(var _0x50f5bd=0x0;_0x50f5bd<_0x315c34[_0x4d47d8][_0x32d3('0x11')];_0x50f5bd+=0x1){addVertex(_0x17af71,_0x315c34[_0x4d47d8][_0x50f5bd],_0x4d47d8);}}else{addVertex(_0x17af71,_0x315c34[_0x4d47d8],_0x4d47d8);}}}for(var _0x229055=0x0;_0x229055<_0x552f16['length'];_0x229055+=0x1){if(_0x552f16[_0x229055][_0x32d3('0x12')]&&_0x552f16[_0x229055][_0x32d3('0x13')]){_0x17af71[_0x32d3('0x14')](_0x552f16[_0x229055]['source'],_0x552f16[_0x229055]['target'],_0x552f16[_0x229055][_0x32d3('0x15')]);}}return _0x17af71;}function getRoot(_0x3df316){return parser[_0x32d3('0x16')](_0x3df316,{'object':!![]})[_0x32d3('0x17')]['root'];}function inspect(_0x23f4b2){return util['inspect'](_0x23f4b2,{'showHidden':![],'depth':null});}function initialize(_0x25572f,_0x224beb){var _0x1c02ab=getRoot(_0x25572f['production']);if(!_0x1c02ab||!_0x1c02ab[_0x32d3('0x18')])return;var _0x1fdd65,_0x2749c7,_0x4f902f;logger[_0x32d3('0x19')](_0x32d3('0x1a'),JSON['stringify'](_0x1c02ab,null,0x2));_0x224beb[_0x32d3('0x1b')]=moment()[_0x32d3('0x1c')](_0x32d3('0x1d'));_0x1fdd65=initGraph(_['omit'](_0x1c02ab,_0x32d3('0xf')),_0x1c02ab[_0x32d3('0xf')]);_0x2749c7=new Vertices(_0x224beb,rpc,mailRpc);logger[_0x32d3('0x1e')](util[_0x32d3('0x1c')](_0x32d3('0x1f'),_0x224beb[_0x32d3('0x20')],_0x224beb[_0x32d3('0x21')],_0x224beb[_0x32d3('0x22')],_0x224beb['dnid'],_0x224beb[_0x32d3('0x23')]));_0x1fdd65[_0x32d3('0x24')](_0x1c02ab[_0x32d3('0x18')]['id'],function(_0x4287e2){try{_0x4287e2=_0x2749c7[_0x32d3('0x25')](_0x4287e2);logger[_0x32d3('0x19')](_0x32d3('0x26'),JSON[_0x32d3('0x27')](_0x4287e2,null,0x2));if(_0x4287e2[_0x32d3('0xb')]===_0x32d3('0x28')){logger[_0x32d3('0x1e')](_0x32d3('0x29'));_0x224beb[_0x32d3('0x2a')]=_0x4287e2[_0x32d3('0x2a')]||_0x224beb['context'];_0x224beb[_0x32d3('0x2b')]=_0x4287e2[_0x32d3('0x2b')];_0x224beb[_0x32d3('0x2c')]=_0x4287e2['priority']?_0x4287e2['priority']-0x1:0x1;return null;}else if(_0x4287e2&&_0x2749c7[_0x4287e2[_0x32d3('0xb')]]){_0x4f902f=_0x2749c7[_0x4287e2['agicommand']](_0x4287e2);logger[_0x32d3('0x1e')](_0x32d3('0x2d'),JSON[_0x32d3('0x27')](_0x4f902f,null,0x2));if(_0x4f902f&&_0x4f902f[_0x32d3('0x2e')]===AGI_CODE_SUCCESS&&_0x4f902f['result']!==AGI_RESULT_ERROR&&!_0x224beb[_0x32d3('0x2f')]){logger['debug'](_0x32d3('0x2d'),inspect(_0x4f902f));return _[_0x32d3('0x30')](_0x4f902f['result'])?null:_0x4f902f[_0x32d3('0x31')][_0x32d3('0x32')]();}else{logger[_0x32d3('0x9')](_0x32d3('0x2d'),inspect(_0x4f902f));return null;}}else{logger['error'](_0x32d3('0x33'));return null;}}catch(_0x4f10b9){logger[_0x32d3('0x9')](_0x4f10b9['stack']);return null;}});if(_0x1c02ab[_0x32d3('0x34')]){logger['info'](util[_0x32d3('0x1c')](_0x32d3('0x35'),_0x224beb[_0x32d3('0x20')],_0x224beb['calleridname'],_0x224beb[_0x32d3('0x22')],_0x224beb['dnid'],_0x224beb[_0x32d3('0x23')]));_0x1fdd65[_0x32d3('0x24')](_0x1c02ab[_0x32d3('0x34')]['id'],function(_0x240d12){try{_0x240d12=_0x2749c7[_0x32d3('0x25')](_0x240d12);logger['debug']('vertex',JSON[_0x32d3('0x27')](_0x240d12,null,0x2));if(_0x240d12&&_0x2749c7[_0x240d12['agicommand']]){_0x4f902f=_0x2749c7[_0x240d12['agicommand']](_0x240d12);if(_0x4f902f){logger[_0x32d3('0x19')](_0x32d3('0x2d'),inspect(_0x4f902f));return _[_0x32d3('0x30')](_0x4f902f['result'])?null:_0x4f902f[_0x32d3('0x31')]['toString']();}else{logger['error']('response',inspect(_0x4f902f));return null;}}else{logger[_0x32d3('0x9')](_0x32d3('0x33'));return null;}}catch(_0x19f446){logger['error'](_0x19f446['stack']);return null;}});}logger['info'](util[_0x32d3('0x1c')](_0x32d3('0x36'),_0x224beb[_0x32d3('0x20')],_0x224beb[_0x32d3('0x21')],_0x224beb['callerid'],_0x224beb[_0x32d3('0x37')],_0x224beb[_0x32d3('0x23')]));logger[_0x32d3('0x1e')](util[_0x32d3('0x1c')](_0x32d3('0x38'),_0x224beb[_0x32d3('0x2a')],_0x224beb[_0x32d3('0x2b')],parseInt(_0x224beb[_0x32d3('0x2c')],0xa)+0x1));_0x224beb[_0x32d3('0x39')](_0x224beb[_0x32d3('0x2a')],_0x224beb[_0x32d3('0x2b')],parseInt(_0x224beb[_0x32d3('0x2c')],0xa)+0x1);_0x224beb[_0x32d3('0x3a')]();}function handleNotFound(_0x42033d){logger[_0x32d3('0x9')](util['format'](_0x32d3('0x3b'),_0x42033d['arg_1']));_0x42033d[_0x32d3('0x39')](_0x42033d[_0x32d3('0x2a')],_0x42033d[_0x32d3('0x2b')],parseInt(_0x42033d[_0x32d3('0x2c')],0xa)+0x1);_0x42033d[_0x32d3('0x3a')]();}function handleUnpublished(_0x9ecb9c){logger['error'](util[_0x32d3('0x1c')](_0x32d3('0x3c'),_0x9ecb9c[_0x32d3('0x20')]));_0x9ecb9c[_0x32d3('0x39')](_0x9ecb9c[_0x32d3('0x2a')],_0x9ecb9c[_0x32d3('0x2b')],parseInt(_0x9ecb9c[_0x32d3('0x2c')],0xa)+0x1);_0x9ecb9c[_0x32d3('0x3a')]();}module[_0x32d3('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x94d5=['[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','Project\x20%s\x20not\x20found','exports','moment','util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','isArray','length','source','target','addEdge','toJson','mxGraphModel','inspect','production','debug','root','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','omit','mxCell','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','traverseBFS','vertex','gotoc','context','extension','priority','response','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','uniqueid'];(function(_0x495dfe,_0xd3636b){var _0x41032e=function(_0x50136b){while(--_0x50136b){_0x495dfe['push'](_0x495dfe['shift']());}};_0x41032e(++_0xd3636b);}(_0x94d5,0x1ed));var _0x594d=function(_0xb2dc85,_0x5243d0){_0xb2dc85=_0xb2dc85-0x0;var _0x13f755=_0x94d5[_0xb2dc85];return _0x13f755;};'use strict';var _=require('lodash');var moment=require(_0x594d('0x0'));var parser=require('xml2json');var util=require(_0x594d('0x1'));var logger=require(_0x594d('0x2'))(_0x594d('0x3'));var rpc=require(_0x594d('0x4'));var mailRpc=require(_0x594d('0x5'));var Graph=require(_0x594d('0x6'));var Vertices=require(_0x594d('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x594d('0x8')]()[_0x594d('0x9')](function(_0x29b091){logger[_0x594d('0xa')](_0x594d('0xb'),_0x29b091[_0x594d('0xc')]);return[];});}function addVertex(_0x496cc,_0x35ba90,_0x4b73fd){_0x35ba90[_0x594d('0xd')]=_0x4b73fd;if(_0x35ba90[_0x594d('0xe')](_0x594d('0xf'))){_0x35ba90[_0x594d('0x10')]=parseInt(_0x35ba90[_0x594d('0xf')],0xa);}_0x496cc[_0x594d('0x11')](_['omit'](_0x35ba90,'mxCell'));}function initGraph(_0x59ae87,_0x2f18d2){var _0x55cfc3=new Graph();for(var _0x342367 in _0x59ae87){if(_0x59ae87[_0x594d('0xe')](_0x342367)){if(_[_0x594d('0x12')](_0x59ae87[_0x342367])){for(var _0x19a5f2=0x0;_0x19a5f2<_0x59ae87[_0x342367][_0x594d('0x13')];_0x19a5f2+=0x1){addVertex(_0x55cfc3,_0x59ae87[_0x342367][_0x19a5f2],_0x342367);}}else{addVertex(_0x55cfc3,_0x59ae87[_0x342367],_0x342367);}}}for(var _0xcb4ff4=0x0;_0xcb4ff4<_0x2f18d2[_0x594d('0x13')];_0xcb4ff4+=0x1){if(_0x2f18d2[_0xcb4ff4][_0x594d('0x14')]&&_0x2f18d2[_0xcb4ff4][_0x594d('0x15')]){_0x55cfc3[_0x594d('0x16')](_0x2f18d2[_0xcb4ff4]['source'],_0x2f18d2[_0xcb4ff4]['target'],_0x2f18d2[_0xcb4ff4]['value']);}}return _0x55cfc3;}function getRoot(_0x18e161){return parser[_0x594d('0x17')](_0x18e161,{'object':!![]})[_0x594d('0x18')]['root'];}function inspect(_0x5b8de7){return util[_0x594d('0x19')](_0x5b8de7,{'showHidden':![],'depth':null});}function initialize(_0x5c23f2,_0x12cc8f){var _0xc095cb=getRoot(_0x5c23f2[_0x594d('0x1a')]);if(!_0xc095cb||!_0xc095cb['start'])return;var _0x16f4fa,_0x1dbc09,_0x550c2d;logger[_0x594d('0x1b')](_0x594d('0x1c'),JSON[_0x594d('0x1d')](_0xc095cb,null,0x2));_0x12cc8f[_0x594d('0x1e')]=moment()[_0x594d('0x1f')](_0x594d('0x20'));_0x16f4fa=initGraph(_[_0x594d('0x21')](_0xc095cb,_0x594d('0x22')),_0xc095cb[_0x594d('0x22')]);_0x1dbc09=new Vertices(_0x12cc8f,rpc,mailRpc);logger[_0x594d('0x23')](util['format'](_0x594d('0x24'),_0x12cc8f[_0x594d('0x25')],_0x12cc8f['calleridname'],_0x12cc8f[_0x594d('0x26')],_0x12cc8f[_0x594d('0x27')],_0x12cc8f['uniqueid']));_0x16f4fa[_0x594d('0x28')](_0xc095cb['start']['id'],function(_0x5e4e12){try{_0x5e4e12=_0x1dbc09['clear'](_0x5e4e12);logger[_0x594d('0x1b')](_0x594d('0x29'),JSON['stringify'](_0x5e4e12,null,0x2));if(_0x5e4e12[_0x594d('0xd')]===_0x594d('0x2a')){logger[_0x594d('0x23')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x12cc8f[_0x594d('0x2b')]=_0x5e4e12[_0x594d('0x2b')]||_0x12cc8f[_0x594d('0x2b')];_0x12cc8f[_0x594d('0x2c')]=_0x5e4e12[_0x594d('0x2c')];_0x12cc8f[_0x594d('0x2d')]=_0x5e4e12[_0x594d('0x2d')]?_0x5e4e12[_0x594d('0x2d')]-0x1:0x1;return null;}else if(_0x5e4e12&&_0x1dbc09[_0x5e4e12[_0x594d('0xd')]]){_0x550c2d=_0x1dbc09[_0x5e4e12[_0x594d('0xd')]](_0x5e4e12);logger[_0x594d('0x23')](_0x594d('0x2e'),JSON[_0x594d('0x1d')](_0x550c2d,null,0x2));if(_0x550c2d&&_0x550c2d['code']===AGI_CODE_SUCCESS&&_0x550c2d[_0x594d('0x2f')]!==AGI_RESULT_ERROR&&!_0x12cc8f[_0x594d('0x30')]){logger[_0x594d('0x1b')](_0x594d('0x2e'),inspect(_0x550c2d));return _[_0x594d('0x31')](_0x550c2d[_0x594d('0x2f')])?null:_0x550c2d[_0x594d('0x2f')][_0x594d('0x32')]();}else{logger[_0x594d('0xa')](_0x594d('0x2e'),inspect(_0x550c2d));return null;}}else{logger[_0x594d('0xa')](_0x594d('0x33'));return null;}}catch(_0xc2286c){logger['error'](_0xc2286c[_0x594d('0xc')]);return null;}});if(_0xc095cb[_0x594d('0x34')]){logger[_0x594d('0x23')](util[_0x594d('0x1f')](_0x594d('0x35'),_0x12cc8f[_0x594d('0x25')],_0x12cc8f[_0x594d('0x36')],_0x12cc8f[_0x594d('0x26')],_0x12cc8f[_0x594d('0x27')],_0x12cc8f[_0x594d('0x37')]));_0x16f4fa[_0x594d('0x28')](_0xc095cb[_0x594d('0x34')]['id'],function(_0x25df11){try{_0x25df11=_0x1dbc09['clear'](_0x25df11);logger[_0x594d('0x1b')](_0x594d('0x29'),JSON[_0x594d('0x1d')](_0x25df11,null,0x2));if(_0x25df11&&_0x1dbc09[_0x25df11[_0x594d('0xd')]]){_0x550c2d=_0x1dbc09[_0x25df11['agicommand']](_0x25df11);if(_0x550c2d){logger[_0x594d('0x1b')]('response',inspect(_0x550c2d));return _[_0x594d('0x31')](_0x550c2d[_0x594d('0x2f')])?null:_0x550c2d[_0x594d('0x2f')][_0x594d('0x32')]();}else{logger['error'](_0x594d('0x2e'),inspect(_0x550c2d));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x3c38dc){logger[_0x594d('0xa')](_0x3c38dc[_0x594d('0xc')]);return null;}});}logger[_0x594d('0x23')](util[_0x594d('0x1f')](_0x594d('0x38'),_0x12cc8f[_0x594d('0x25')],_0x12cc8f['calleridname'],_0x12cc8f[_0x594d('0x26')],_0x12cc8f[_0x594d('0x27')],_0x12cc8f[_0x594d('0x37')]));logger['info'](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x12cc8f[_0x594d('0x2b')],_0x12cc8f['extension'],parseInt(_0x12cc8f[_0x594d('0x2d')],0xa)+0x1));_0x12cc8f[_0x594d('0x39')](_0x12cc8f[_0x594d('0x2b')],_0x12cc8f['extension'],parseInt(_0x12cc8f['priority'],0xa)+0x1);_0x12cc8f[_0x594d('0x3a')]();}function handleNotFound(_0x143de1){logger[_0x594d('0xa')](util['format'](_0x594d('0x3b'),_0x143de1['arg_1']));_0x143de1[_0x594d('0x39')](_0x143de1[_0x594d('0x2b')],_0x143de1['extension'],parseInt(_0x143de1[_0x594d('0x2d')],0xa)+0x1);_0x143de1[_0x594d('0x3a')]();}function handleUnpublished(_0x16371e){logger[_0x594d('0xa')](util[_0x594d('0x1f')]('Project\x20%s\x20not\x20published',_0x16371e[_0x594d('0x25')]));_0x16371e[_0x594d('0x39')](_0x16371e['context'],_0x16371e[_0x594d('0x2c')],parseInt(_0x16371e[_0x594d('0x2d')],0xa)+0x1);_0x16371e[_0x594d('0x3a')]();}module[_0x594d('0x3c')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 27f3699..612a63d 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2d0=['call','_localBuffer','_transform','\x0d\x0a\x0d\x0a','_inBody','indexOf','substring','length','split','slice','trim','headers','emit','line','exports','util','stream','Transform'];(function(_0x5bf9a4,_0x4a94bb){var _0xc81727=function(_0x5b7648){while(--_0x5b7648){_0x5bf9a4['push'](_0x5bf9a4['shift']());}};_0xc81727(++_0x4a94bb);}(_0xc2d0,0x9f));var _0x0c2d=function(_0x187e24,_0x393e15){_0x187e24=_0x187e24-0x0;var _0x39b658=_0xc2d0[_0x187e24];return _0x39b658;};'use strict';var util=require(_0x0c2d('0x0'));var Transform=require(_0x0c2d('0x1'))[_0x0c2d('0x2')];function AGIReply(_0x462083){Transform[_0x0c2d('0x3')](this,_0x462083);this[_0x0c2d('0x4')]='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype'][_0x0c2d('0x5')]=function(_0x38f072,_0x4be0db,_0x213d7c){var _0x28a746='\x0a',_0xb7746f=['\x0a\x0a',_0x0c2d('0x6')],_0x345122=-0x1,_0x3d52a6=-0x1,_0x170380='',_0x3f851f=0x0,_0x28adf3='',_0xcec801='';this[_0x0c2d('0x4')]+=_0x38f072['toString']();_0x28adf3=this[_0x0c2d('0x4')];if(!this[_0x0c2d('0x7')]){_0x3f851f=0x0;while(_0xb7746f[_0x3f851f]){while((_0x3d52a6=_0x28adf3[_0x0c2d('0x8')](_0xb7746f[_0x3f851f]))!=-0x1){_0x170380=_0xb7746f[_0x3f851f];_0xcec801=_0x28adf3[_0x0c2d('0x9')](0x0,_0x3d52a6);_0x28adf3=_0x28adf3[_0x0c2d('0x9')](_0x3d52a6+_0x170380[_0x0c2d('0xa')]);var _0x21bf42=_0xcec801[_0x0c2d('0xb')](_0x28a746),_0x301d3b=0x0,_0x444cd3={},_0x59b08b='',_0x27ccbf='',_0x4146d3=-0x1;while(_0x21bf42[_0x301d3b]){_0x4146d3=_0x21bf42[_0x301d3b][_0x0c2d('0x8')](':');if(_0x4146d3!=-0x1){_0x59b08b=_0x21bf42[_0x301d3b][_0x0c2d('0xc')](0x0,_0x4146d3)[_0x0c2d('0xd')]();_0x27ccbf=_0x21bf42[_0x301d3b]['slice'](_0x4146d3+0x1)[_0x0c2d('0xd')]();if(_0x59b08b[_0x0c2d('0xa')]>0x0){_0x444cd3[_0x59b08b]=_0x27ccbf;}}else{}_0x301d3b++;}this['emit'](_0x0c2d('0xe'),_0x444cd3);this[_0x0c2d('0x7')]=!![];}_0x3f851f++;}this[_0x0c2d('0x4')]=_0x28adf3;}else{while((_0x345122=_0x28adf3[_0x0c2d('0x8')](_0x28a746))!=-0x1){_0xcec801=_0x28adf3['substring'](0x0,_0x345122);this[_0x0c2d('0xf')](_0x0c2d('0x10'),_0xcec801);_0x28adf3=_0x28adf3[_0x0c2d('0x9')](_0x345122+_0x28a746[_0x0c2d('0xa')]);}this[_0x0c2d('0x4')]=_0x28adf3;}_0x213d7c();};module[_0x0c2d('0x11')]=AGIReply; \ No newline at end of file +var _0x8262=['prototype','\x0d\x0a\x0d\x0a','toString','_inBody','indexOf','substring','length','split','slice','emit','headers','line','exports','util','stream','Transform','call','_localBuffer'];(function(_0x4164f2,_0x38669f){var _0x2575c7=function(_0x24dca1){while(--_0x24dca1){_0x4164f2['push'](_0x4164f2['shift']());}};_0x2575c7(++_0x38669f);}(_0x8262,0x9d));var _0x2826=function(_0x5cee0f,_0x2c69af){_0x5cee0f=_0x5cee0f-0x0;var _0x2a1ae7=_0x8262[_0x5cee0f];return _0x2a1ae7;};'use strict';var util=require(_0x2826('0x0'));var Transform=require(_0x2826('0x1'))[_0x2826('0x2')];function AGIReply(_0x267c2e){Transform[_0x2826('0x3')](this,_0x267c2e);this[_0x2826('0x4')]='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x2826('0x5')]['_transform']=function(_0x52d098,_0x4567c5,_0x22d692){var _0x2ba3ea='\x0a',_0x429187=['\x0a\x0a',_0x2826('0x6')],_0x34f637=-0x1,_0xf141e=-0x1,_0x168e6d='',_0x256524=0x0,_0x3fadbc='',_0x5112c7='';this[_0x2826('0x4')]+=_0x52d098[_0x2826('0x7')]();_0x3fadbc=this['_localBuffer'];if(!this[_0x2826('0x8')]){_0x256524=0x0;while(_0x429187[_0x256524]){while((_0xf141e=_0x3fadbc[_0x2826('0x9')](_0x429187[_0x256524]))!=-0x1){_0x168e6d=_0x429187[_0x256524];_0x5112c7=_0x3fadbc[_0x2826('0xa')](0x0,_0xf141e);_0x3fadbc=_0x3fadbc[_0x2826('0xa')](_0xf141e+_0x168e6d[_0x2826('0xb')]);var _0x688b7a=_0x5112c7[_0x2826('0xc')](_0x2ba3ea),_0x1c9ab9=0x0,_0x5723dc={},_0x50f887='',_0x298c28='',_0x9c30c5=-0x1;while(_0x688b7a[_0x1c9ab9]){_0x9c30c5=_0x688b7a[_0x1c9ab9][_0x2826('0x9')](':');if(_0x9c30c5!=-0x1){_0x50f887=_0x688b7a[_0x1c9ab9][_0x2826('0xd')](0x0,_0x9c30c5)['trim']();_0x298c28=_0x688b7a[_0x1c9ab9][_0x2826('0xd')](_0x9c30c5+0x1)['trim']();if(_0x50f887['length']>0x0){_0x5723dc[_0x50f887]=_0x298c28;}}else{}_0x1c9ab9++;}this[_0x2826('0xe')](_0x2826('0xf'),_0x5723dc);this[_0x2826('0x8')]=!![];}_0x256524++;}this[_0x2826('0x4')]=_0x3fadbc;}else{while((_0x34f637=_0x3fadbc[_0x2826('0x9')](_0x2ba3ea))!=-0x1){_0x5112c7=_0x3fadbc['substring'](0x0,_0x34f637);this[_0x2826('0xe')](_0x2826('0x10'),_0x5112c7);_0x3fadbc=_0x3fadbc[_0x2826('0xa')](_0x34f637+_0x2ba3ea[_0x2826('0xb')]);}this[_0x2826('0x4')]=_0x3fadbc;}_0x22d692();};module[_0x2826('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 83e55c2..6f4aef8 100644 --- a/server/services/agi/rpc/index.js +++ b/server/services/agi/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24a6=['production','getSquareProject','ShowSquareProject','ShowMailAccount','MailServerOut','CloudProvider','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSquareDetailsReport','createSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','ShowCmHopper','phone','ListId','CreateCmContact','agentLogin','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','lodash','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name'];(function(_0x21c936,_0x3ef642){var _0x2a484d=function(_0x224a4d){while(--_0x224a4d){_0x21c936['push'](_0x21c936['shift']());}};_0x2a484d(++_0x3ef642);}(_0x24a6,0x14f));var _0x624a=function(_0x2b7762,_0x17baae){_0x2b7762=_0x2b7762-0x0;var _0xd7be7a=_0x24a6[_0x2b7762];return _0xd7be7a;};'use strict';var _=require(_0x624a('0x0'));var moment=require('moment');var jayson=require(_0x624a('0x1'));var client=jayson[_0x624a('0x2')][_0x624a('0x3')]({'port':0x2329});function request(_0x346672,_0x3074cb){return new Promise(function(_0x45aae2,_0x389f10){return client[_0x624a('0x4')](_0x346672,_0x3074cb)[_0x624a('0x5')](function(_0x16d101){if(_0x16d101[_0x624a('0x6')]){return _0x389f10(_0x16d101[_0x624a('0x6')][_0x624a('0x7')]);}else{return _0x45aae2(_0x16d101[_0x624a('0x8')]);}})[_0x624a('0x9')](function(_0x40cb85){return _0x389f10(_0x40cb85);});});}exports[_0x624a('0xa')]=function(){return request(_0x624a('0xb'),{'options':{'raw':![],'attributes':['id',_0x624a('0xc'),_0x624a('0xd')]}});};exports[_0x624a('0xe')]=function(_0x1339df){return request(_0x624a('0xf'),{'options':{'raw':![],'where':{'name':_0x1339df},'attributes':['production']}});};exports['getMailAccountById']=function(_0x223846){return request(_0x624a('0x10'),{'options':{'raw':![],'where':{'id':_0x223846},'include':[{'model':_0x624a('0x11'),'as':'Smtp','include':[{'model':_0x624a('0x12'),'as':_0x624a('0x12')}]}],'attributes':['id','name','email'],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x10080e){return request('ShowSquareProject',{'options':{'where':{'id':_0x10080e},'attributes':[_0x624a('0xc')]}});};exports[_0x624a('0x13')]=function(_0xe310b4){return request(_0x624a('0x14'),{'options':{'where':{'id':_0xe310b4},'attributes':['name']}});};exports[_0x624a('0x15')]=function(_0x4935f4){return request(_0x624a('0x16'),{'options':{'where':{'id':_0x4935f4},'attributes':[_0x624a('0xc')]}});};exports['getSquareOdbcById']=function(_0x201751){return request(_0x624a('0x17'),{'options':{'where':{'id':_0x201751},'attributes':[_0x624a('0x18')]}});};exports[_0x624a('0x19')]=function(_0xce9cd5){return request(_0x624a('0x1a'),{'options':{'where':{'id':_0xce9cd5},'attributes':[_0x624a('0xc')]}});};exports[_0x624a('0x1b')]=function(_0x35342c){return request(_0x624a('0x1c'),{'options':{'where':{'phone':_0x35342c['phone']},'attributes':['id']}});};exports[_0x624a('0x1d')]=function(_0x5c6901){return request(_0x624a('0x1e'),{'options':{'where':{'id':_0x5c6901},'attributes':['name']}});};exports[_0x624a('0x1f')]=function(_0x37c25f){return request(_0x624a('0x20'),{'options':{'where':{'id':_0x37c25f},'attributes':[_0x624a('0x21')]}});};exports[_0x624a('0x22')]=function(_0x54e669){return request(_0x624a('0x23'),{'options':{'raw':![],'where':{'id':_0x54e669},'include':[{'model':_0x624a('0x24'),'as':_0x624a('0x25')}]}});};exports[_0x624a('0x26')]=function(_0x5dfeec){return request(_0x624a('0x27'),{'options':{'where':{'id':_0x5dfeec},'attributes':['id',_0x624a('0xc')]}});};exports[_0x624a('0x28')]=function(_0x4ba881){return request('CreateSmsMessage',{'body':_0x4ba881});};exports['createSquareDetailsReport']=function(_0x29257b){return request(_0x624a('0x29'),{'body':_0x29257b});};exports[_0x624a('0x2a')]=function(_0x26b075){return request('CreateSquareReport',{'body':_['merge'](_0x26b075,{'project_name':_0x26b075[_0x624a('0x2b')],'prev_project_name':_0x26b075[_0x624a('0x2c')]||'','is_subproject':_0x26b075['arg_2']?!![]:![],'leaveAt':moment()[_0x624a('0x2d')](_0x624a('0x2e'))})});};exports['createSquareRecording']=function(_0x5366c4){return request('CreateSquareRecording',{'body':_0x5366c4});};exports[_0x624a('0x2f')]=function(_0x86e555){return request('CreateSquareMessage',{'body':_0x86e555});};exports['createCmContact']=function(_0x59917f){return request(_0x624a('0x30'),{'options':{'raw':![],'where':{'phone':_0x59917f[_0x624a('0x31')],'ListId':_0x59917f[_0x624a('0x32')]}}})['then'](function(_0x16178d){if(_0x16178d){return _0x16178d;}return request(_0x624a('0x33'),{'body':_0x59917f});});};exports['getPauseById']=function(_0x466af4){return request('ShowPause',{'options':{'where':{'id':_0x466af4},'attributes':[_0x624a('0xc')]}});};exports[_0x624a('0x34')]=function(_0x22140a,_0x4619a8){return request('LoginUser',{'body':{'interface':_0x4619a8},'options':{'where':_0x22140a}});};exports[_0x624a('0x35')]=function(_0x16dc8a,_0x5e8983,_0x1310a3){return request(_0x624a('0x36'),{'body':{'type':_0x5e8983,'uniqueid':_0x1310a3},'options':{'where':_0x16dc8a}});};exports[_0x624a('0x37')]=function(_0x31a242){return request(_0x624a('0x38'),{'body':{},'options':{'where':_0x31a242}});};exports[_0x624a('0x39')]=function(_0x4c359c){return request('LogoutUser',{'body':{},'options':{'where':_0x4c359c}});}; \ No newline at end of file +var _0x3c70=['CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','http','request','error','message','result','getSquareProjects','GetSquareProjects','production','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getVoiceQueueById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareReport'];(function(_0x1c009f,_0x3d174b){var _0x5d48ba=function(_0x4e25a8){while(--_0x4e25a8){_0x1c009f['push'](_0x1c009f['shift']());}};_0x5d48ba(++_0x3d174b);}(_0x3c70,0x10c));var _0x03c7=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x3c70[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0x03c7('0x0'));var moment=require(_0x03c7('0x1'));var jayson=require(_0x03c7('0x2'));var client=jayson['client'][_0x03c7('0x3')]({'port':0x2329});function request(_0x15adad,_0x1cd556){return new Promise(function(_0x37a9ea,_0x38a36b){return client[_0x03c7('0x4')](_0x15adad,_0x1cd556)['then'](function(_0x1e9745){if(_0x1e9745['error']){return _0x38a36b(_0x1e9745[_0x03c7('0x5')][_0x03c7('0x6')]);}else{return _0x37a9ea(_0x1e9745[_0x03c7('0x7')]);}})['catch'](function(_0x263185){return _0x38a36b(_0x263185);});});}exports[_0x03c7('0x8')]=function(){return request(_0x03c7('0x9'),{'options':{'raw':![],'attributes':['id','name',_0x03c7('0xa')]}});};exports['getSquareProject']=function(_0x103052){return request(_0x03c7('0xb'),{'options':{'raw':![],'where':{'name':_0x103052},'attributes':['production']}});};exports[_0x03c7('0xc')]=function(_0x2b62fb){return request(_0x03c7('0xd'),{'options':{'raw':![],'where':{'id':_0x2b62fb},'include':[{'model':_0x03c7('0xe'),'as':_0x03c7('0xf'),'include':[{'model':'CloudProvider','as':'CloudProvider'}]}],'attributes':['id',_0x03c7('0x10'),_0x03c7('0x11')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x44ba3d){return request(_0x03c7('0xb'),{'options':{'where':{'id':_0x44ba3d},'attributes':[_0x03c7('0x10')]}});};exports[_0x03c7('0x12')]=function(_0x1d9668){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x1d9668},'attributes':[_0x03c7('0x10')]}});};exports['getVariableById']=function(_0xdc48a7){return request(_0x03c7('0x13'),{'options':{'where':{'id':_0xdc48a7},'attributes':['name']}});};exports[_0x03c7('0x14')]=function(_0x345798){return request(_0x03c7('0x15'),{'options':{'where':{'id':_0x345798},'attributes':['dsn']}});};exports[_0x03c7('0x16')]=function(_0x6c852d){return request(_0x03c7('0x17'),{'options':{'where':{'id':_0x6c852d},'attributes':[_0x03c7('0x10')]}});};exports[_0x03c7('0x18')]=function(_0x2946d7){return request('GetContactByPhone',{'options':{'where':{'phone':_0x2946d7['phone']},'attributes':['id']}});};exports[_0x03c7('0x19')]=function(_0x2cd27c){return request(_0x03c7('0x1a'),{'options':{'where':{'id':_0x2cd27c},'attributes':[_0x03c7('0x10')]}});};exports[_0x03c7('0x1b')]=function(_0x5a03c6){return request(_0x03c7('0x1c'),{'options':{'where':{'id':_0x5a03c6},'attributes':[_0x03c7('0x1d')]}});};exports['getIntervalById']=function(_0x4e8062){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x4e8062},'include':[{'model':_0x03c7('0x1e'),'as':_0x03c7('0x1f')}]}});};exports[_0x03c7('0x20')]=function(_0x50b316){return request(_0x03c7('0x21'),{'options':{'where':{'id':_0x50b316},'attributes':['id',_0x03c7('0x10')]}});};exports[_0x03c7('0x22')]=function(_0x4d6a9c){return request(_0x03c7('0x23'),{'body':_0x4d6a9c});};exports['createSquareDetailsReport']=function(_0x43e541){return request('CreateSquareDetailsReport',{'body':_0x43e541});};exports[_0x03c7('0x24')]=function(_0x4844f2){return request(_0x03c7('0x25'),{'body':_[_0x03c7('0x26')](_0x4844f2,{'project_name':_0x4844f2[_0x03c7('0x27')],'prev_project_name':_0x4844f2['arg_2']||'','is_subproject':_0x4844f2[_0x03c7('0x28')]?!![]:![],'leaveAt':moment()[_0x03c7('0x29')](_0x03c7('0x2a'))})});};exports[_0x03c7('0x2b')]=function(_0x5041fe){return request('CreateSquareRecording',{'body':_0x5041fe});};exports[_0x03c7('0x2c')]=function(_0x58ad44){return request(_0x03c7('0x2d'),{'body':_0x58ad44});};exports[_0x03c7('0x2e')]=function(_0x51929b){return request(_0x03c7('0x2f'),{'options':{'raw':![],'where':{'phone':_0x51929b[_0x03c7('0x30')],'ListId':_0x51929b[_0x03c7('0x31')]}}})[_0x03c7('0x32')](function(_0x1e2b90){if(_0x1e2b90){return _0x1e2b90;}return request(_0x03c7('0x33'),{'body':_0x51929b});});};exports[_0x03c7('0x34')]=function(_0x2ab3bb){return request(_0x03c7('0x35'),{'options':{'where':{'id':_0x2ab3bb},'attributes':[_0x03c7('0x10')]}});};exports[_0x03c7('0x36')]=function(_0x4de5f4,_0x19c3ff){return request(_0x03c7('0x37'),{'body':{'interface':_0x19c3ff},'options':{'where':_0x4de5f4}});};exports[_0x03c7('0x38')]=function(_0x5ed9ca,_0x4d6871,_0x54e183){return request(_0x03c7('0x39'),{'body':{'type':_0x4d6871,'uniqueid':_0x54e183},'options':{'where':_0x5ed9ca}});};exports['agentUnpause']=function(_0x233cbd){return request(_0x03c7('0x3a'),{'body':{},'options':{'where':_0x233cbd}});};exports[_0x03c7('0x3b')]=function(_0x53fd4f){return request(_0x03c7('0x3c'),{'body':{},'options':{'where':_0x53fd4f}});}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/index.js b/server/services/agi/scripts/aws/index.js index 1738e7e..3c74279 100644 --- a/server/services/agi/scripts/aws/index.js +++ b/server/services/agi/scripts/aws/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07e8=['exports','./polly','./lex'];(function(_0x27ca2a,_0x79c1b9){var _0x14c2a=function(_0x1dccc4){while(--_0x1dccc4){_0x27ca2a['push'](_0x27ca2a['shift']());}};_0x14c2a(++_0x79c1b9);}(_0x07e8,0x10f));var _0x807e=function(_0x18a397,_0x4f7413){_0x18a397=_0x18a397-0x0;var _0x50a9b7=_0x07e8[_0x18a397];return _0x50a9b7;};var polly=require(_0x807e('0x0'));var lex=require(_0x807e('0x1'));module[_0x807e('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xed1f=['./polly','./lex'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xed1f,0x170));var _0xfed1=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0xed1f[_0x486f4a];return _0x135d99;};var polly=require(_0xfed1('0x0'));var lex=require(_0xfed1('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 560c20a..cd3f985 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['./lib/api'];(function(_0x14836e,_0x46dc51){var _0x268232=function(_0x58cf1b){while(--_0x58cf1b){_0x14836e['push'](_0x14836e['shift']());}};_0x268232(++_0x46dc51);}(_0xb7e7,0x121));var _0x7b7e=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xb7e7[_0x16d10f];return _0x50c823;};'use strict';var lex=require(_0x7b7e('0x0'));module['exports']=function(_0x40e269,_0x518dc6,_0x1b7cc7,_0x54a37f,_0x3f5804,_0x556d68){return lex(_0x40e269,_0x518dc6,_0x1b7cc7,_0x54a37f,_0x3f5804,_0x556d68);}; \ No newline at end of file +var _0x750a=['exports'];(function(_0x416623,_0x7d0d25){var _0x289659=function(_0x17c537){while(--_0x17c537){_0x416623['push'](_0x416623['shift']());}};_0x289659(++_0x7d0d25);}(_0x750a,0x140));var _0xa750=function(_0x5783ca,_0x5c2fbd){_0x5783ca=_0x5783ca-0x0;var _0x1fca68=_0x750a[_0x5783ca];return _0x1fca68;};'use strict';var lex=require('./lib/api');module[_0xa750('0x0')]=function(_0x5368b2,_0x499583,_0x139fa5,_0xeb020d,_0x1b459c,_0x19bd5f){return lex(_0x5368b2,_0x499583,_0x139fa5,_0xeb020d,_0x1b459c,_0x19bd5f);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index febe046..ae5ddb5 100644 --- a/server/services/agi/scripts/aws/lex/lib/api.js +++ b/server/services/agi/scripts/aws/lex/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x47dde3,_0xbdd88b){var _0x3e6484=function(_0x34c2c0){while(--_0x34c2c0){_0x47dde3['push'](_0x47dde3['shift']());}};_0x3e6484(++_0xbdd88b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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(_0x218d19,_0x4b439){var _0x397a6e=function(_0x53fc7b){while(--_0x53fc7b){_0x218d19['push'](_0x218d19['shift']());}};_0x397a6e(++_0x4b439);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index 30018b7..672634f 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x286e=['exports','./lib/api'];(function(_0x30ef51,_0x4356af){var _0x27e476=function(_0x492b31){while(--_0x492b31){_0x30ef51['push'](_0x30ef51['shift']());}};_0x27e476(++_0x4356af);}(_0x286e,0xc9));var _0xe286=function(_0x3225b4,_0x176296){_0x3225b4=_0x3225b4-0x0;var _0x2c1efb=_0x286e[_0x3225b4];return _0x2c1efb;};'use strict';var polly=require(_0xe286('0x0'));module[_0xe286('0x1')]=function(_0x279450,_0x32c16d,_0x2dffc6,_0x3bd652,_0x54501e,_0x12eae1,_0x3abe36){return polly(_0x279450,_0x32c16d,_0x2dffc6,_0x3bd652,_0x54501e,_0x12eae1,_0x3abe36);}; \ No newline at end of file +var _0xb689=['./lib/api','exports'];(function(_0xa98302,_0x844f27){var _0x1ad8e3=function(_0x57e51d){while(--_0x57e51d){_0xa98302['push'](_0xa98302['shift']());}};_0x1ad8e3(++_0x844f27);}(_0xb689,0xd0));var _0x9b68=function(_0x5c24b6,_0x5d43c3){_0x5c24b6=_0x5c24b6-0x0;var _0x24c670=_0xb689[_0x5c24b6];return _0x24c670;};'use strict';var polly=require(_0x9b68('0x0'));module[_0x9b68('0x1')]=function(_0x3d62f4,_0x5497ac,_0x3adcae,_0x8a100,_0x5e9405,_0x18a0c0,_0x575743){return polly(_0x3d62f4,_0x5497ac,_0x3adcae,_0x8a100,_0x5e9405,_0x18a0c0,_0x575743);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/lib/api.js b/server/services/agi/scripts/aws/polly/lib/api.js index 0394e96..1bd0796 100644 --- a/server/services/agi/scripts/aws/polly/lib/api.js +++ b/server/services/agi/scripts/aws/polly/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf670=['exports','Polly','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x3de2ae,_0x39ee8e){var _0x17405c=function(_0x33f5b1){while(--_0x33f5b1){_0x3de2ae['push'](_0x3de2ae['shift']());}};_0x17405c(++_0x39ee8e);}(_0xf670,0x107));var _0x0f67=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0xf670[_0xfcbcb8];return _0x1b1f97;};'use strict';var fs=require('fs');var path=require(_0x0f67('0x0'));var BPromise=require(_0x0f67('0x1'));var rs=require(_0x0f67('0x2'));var AWS=require(_0x0f67('0x3'));function pollyResult(_0x519734,_0x33a8dc,_0x425e49){return new BPromise(function(_0xd8410c,_0x403905){_0x519734[_0x0f67('0x4')](_0x33a8dc,function(_0x11baf7,_0x283029){if(_0x11baf7){_0x403905(_0x11baf7);}else if(_0x283029){if(_0x283029[_0x0f67('0x5')]instanceof Buffer){fs['writeFile'](_0x425e49,_0x283029[_0x0f67('0x5')],function(_0x12c884){if(_0x12c884){_0x403905(_0x12c884);}else{_0xd8410c();}});}else{_0x403905(new Error(_0x0f67('0x6')));}}else{_0x403905(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x0f67('0x7')]=function(_0x42df56,_0x1aeff8,_0x172853,_0x2cb481,_0x314610,_0x5754c7,_0x2814fc){var _0x1ae913=new AWS[(_0x0f67('0x8'))]({'accessKeyId':_0x42df56,'secretAccessKey':_0x1aeff8,'region':_0x172853});var _0x230ace={'Text':_0x314610,'TextType':_0x5754c7||'text','OutputFormat':_0x0f67('0x9'),'VoiceId':_0x2cb481};return pollyResult(_0x1ae913,_0x230ace,_0x2814fc);}; \ No newline at end of file +var _0x929e=['path','bluebird','randomstring','aws-sdk','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x929e,0xb4));var _0xe929=function(_0x5f4e49,_0x5696ad){_0x5f4e49=_0x5f4e49-0x0;var _0x373960=_0x929e[_0x5f4e49];return _0x373960;};'use strict';var fs=require('fs');var path=require(_0xe929('0x0'));var BPromise=require(_0xe929('0x1'));var rs=require(_0xe929('0x2'));var AWS=require(_0xe929('0x3'));function pollyResult(_0x81ff3,_0x4b2a08,_0x2eff66){return new BPromise(function(_0x1baa98,_0x117394){_0x81ff3['synthesizeSpeech'](_0x4b2a08,function(_0x2be724,_0x292c28){if(_0x2be724){_0x117394(_0x2be724);}else if(_0x292c28){if(_0x292c28['AudioStream']instanceof Buffer){fs[_0xe929('0x4')](_0x2eff66,_0x292c28[_0xe929('0x5')],function(_0x5248b6){if(_0x5248b6){_0x117394(_0x5248b6);}else{_0x1baa98();}});}else{_0x117394(new Error(_0xe929('0x6')));}}else{_0x117394(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xe929('0x7')]=function(_0x41904e,_0xf533b9,_0x431c0e,_0x5b57ce,_0x1937f4,_0x84610c,_0x3fe199){var _0x35ff27=new AWS['Polly']({'accessKeyId':_0x41904e,'secretAccessKey':_0xf533b9,'region':_0x431c0e});var _0x518e79={'Text':_0x1937f4,'TextType':_0x84610c||_0xe929('0x8'),'OutputFormat':_0xe929('0x9'),'VoiceId':_0x5b57ce};return pollyResult(_0x35ff27,_0x518e79,_0x3fe199);}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/asr/index.js b/server/services/agi/scripts/google/asr/index.js index 607a3f3..b02edb9 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8d3=['exports'];(function(_0x521d8d,_0x591aab){var _0x2660cd=function(_0x233589){while(--_0x233589){_0x521d8d['push'](_0x521d8d['shift']());}};_0x2660cd(++_0x591aab);}(_0xf8d3,0x1ab));var _0x3f8d=function(_0x1287a6,_0x38b142){_0x1287a6=_0x1287a6-0x0;var _0x3b6196=_0xf8d3[_0x1287a6];return _0x3b6196;};'use strict';var asr=require('./lib/api');module[_0x3f8d('0x0')]=function(_0x5767b2,_0x20ab51,_0x4ba7c2,_0x410d03){return asr(_0x5767b2,_0x20ab51,_0x4ba7c2);}; \ No newline at end of file +var _0xcee8=['./lib/api','exports'];(function(_0x5f3de3,_0x40f0f5){var _0x287e0d=function(_0x3189dc){while(--_0x3189dc){_0x5f3de3['push'](_0x5f3de3['shift']());}};_0x287e0d(++_0x40f0f5);}(_0xcee8,0xe4));var _0x8cee=function(_0xa20971,_0x1bf32c){_0xa20971=_0xa20971-0x0;var _0x4f4271=_0xcee8[_0xa20971];return _0x4f4271;};'use strict';var asr=require(_0x8cee('0x0'));module[_0x8cee('0x1')]=function(_0x5b54d0,_0xa5d555,_0x28cb16,_0x5cf7bb){return asr(_0x5b54d0,_0xa5d555,_0x28cb16);}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/asr/lib/api.js b/server/services/agi/scripts/google/asr/lib/api.js index 462524c..c960f1f 100644 --- a/server/services/agi/scripts/google/asr/lib/api.js +++ b/server/services/agi/scripts/google/asr/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4746=['POST','/v1/speech:recognize?key=','8000','url','bluebird','exports','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','string','lang\x20should\x20be\x20a\x20string','toString'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0x4746,0xc6));var _0x6474=function(_0x394e94,_0x352025){_0x394e94=_0x394e94-0x0;var _0x7f2bef=_0x4746[_0x394e94];return _0x7f2bef;};'use strict';var url=require(_0x6474('0x0'));var BPromise=require(_0x6474('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x6474('0x2')]=function(_0x59b95a,_0xd115f7,_0x244bc5){return new BPromise(function(_0x863c56,_0x156374){var _0x1314f4;if(typeof _0x59b95a!=='string'||_0x59b95a[_0x6474('0x3')]===0x0){return _0x156374(_0x6474('0x4'));}if(typeof _0xd115f7!=='string'||_0xd115f7[_0x6474('0x3')]===0x0){return _0x156374(_0x6474('0x5'));}if(typeof _0x244bc5!==_0x6474('0x6')&&(typeof _0x244bc5!==_0x6474('0x7')||_0x244bc5[_0x6474('0x3')]===0x0)){return _0x156374(_0x6474('0x8'));}try{_0x1314f4=fs['readFileSync'](_0x59b95a)[_0x6474('0x9')]('base64');}catch(_0x5335ac){return _0x156374(_0x5335ac);}return _0x863c56({'method':_0x6474('0xa'),'uri':host+_0x6474('0xb')+_0xd115f7,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x6474('0xc'),'languageCode':_0x244bc5},'audio':{'content':_0x1314f4}},'json':!![]});});}; \ No newline at end of file +var _0xfe57=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','POST','/v1/speech:recognize?key=','8000','url','bluebird','string'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xfe57,0x195));var _0x7fe5=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0xfe57[_0x1e03a6];return _0x295b64;};'use strict';var url=require(_0x7fe5('0x0'));var BPromise=require(_0x7fe5('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x3f7dca,_0x4744a9,_0xc27f79){return new BPromise(function(_0x421809,_0x89ad5f){var _0x1254d2;if(typeof _0x3f7dca!==_0x7fe5('0x2')||_0x3f7dca[_0x7fe5('0x3')]===0x0){return _0x89ad5f(_0x7fe5('0x4'));}if(typeof _0x4744a9!==_0x7fe5('0x2')||_0x4744a9[_0x7fe5('0x3')]===0x0){return _0x89ad5f(_0x7fe5('0x5'));}if(typeof _0xc27f79!==_0x7fe5('0x6')&&(typeof _0xc27f79!=='string'||_0xc27f79[_0x7fe5('0x3')]===0x0)){return _0x89ad5f('lang\x20should\x20be\x20a\x20string');}try{_0x1254d2=fs[_0x7fe5('0x7')](_0x3f7dca)[_0x7fe5('0x8')]('base64');}catch(_0x534b10){return _0x89ad5f(_0x534b10);}return _0x421809({'method':_0x7fe5('0x9'),'uri':host+_0x7fe5('0xa')+_0x4744a9,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x7fe5('0xb'),'languageCode':_0xc27f79},'audio':{'content':_0x1254d2}},'json':!![]});});}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js index bdfc426..7d531cc 100644 --- a/server/services/agi/scripts/google/index.js +++ b/server/services/agi/scripts/google/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0386=['./asr','exports'];(function(_0x46c91c,_0x45169f){var _0xae55b3=function(_0x58747c){while(--_0x58747c){_0x46c91c['push'](_0x46c91c['shift']());}};_0xae55b3(++_0x45169f);}(_0x0386,0xba));var _0x6038=function(_0x5820fe,_0x2e6d6a){_0x5820fe=_0x5820fe-0x0;var _0x3ca8bd=_0x0386[_0x5820fe];return _0x3ca8bd;};var asr=require(_0x6038('0x0'));module[_0x6038('0x1')]={'asr':asr}; \ No newline at end of file +var _0x8e62=['./asr','exports'];(function(_0x2c2390,_0x37ef1c){var _0x478b7e=function(_0x2ea947){while(--_0x2ea947){_0x2c2390['push'](_0x2c2390['shift']());}};_0x478b7e(++_0x37ef1c);}(_0x8e62,0xba));var _0x28e6=function(_0x58175f,_0x275d92){_0x58175f=_0x58175f-0x0;var _0x37e6bc=_0x8e62[_0x58175f];return _0x37e6bc;};var asr=require(_0x28e6('0x0'));module[_0x28e6('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 1cf83f1..dc9e82a 100644 --- a/server/services/agi/scripts/index.js +++ b/server/services/agi/scripts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x298b=['path','querystring','request-promise','randomstring','sox','google-tts-api','url','util','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','get','statusCode','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','finish\x20download\x20file','unlink','error','download\x20error','pipe','end','https:','WHAT_EVER','request\x20to\x20','data','wav','error\x20convert','info','resolve','tmp','writeFileSync','base64','then','chmodSync','777','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','POST','generate','.mp3','from','audioContent','writeFile','.wav','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','stringify','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','split','googleASR','uri','results','map','alternatives','transcript','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','speech','score','status','metadata','endConversation','googleDialogflowV2','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','displayName','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20confidence','confidence','awsPolly','awsLex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','parse','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','dialogflow','http','https','md5'];(function(_0x6bc68,_0x162239){var _0x102cdb=function(_0x6026cb){while(--_0x6026cb){_0x6bc68['push'](_0x6bc68['shift']());}};_0x102cdb(++_0x162239);}(_0x298b,0x19a));var _0xb298=function(_0x233758,_0x4b2bb6){_0x233758=_0x233758-0x0;var _0x206aa9=_0x298b[_0x233758];return _0x206aa9;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0xb298('0x0'));var fs=require('fs');var http=require(_0xb298('0x1'));var https=require(_0xb298('0x2'));var md5=require(_0xb298('0x3'));var path=require(_0xb298('0x4'));var querystring=require(_0xb298('0x5'));var rp=require(_0xb298('0x6'));var rs=require(_0xb298('0x7'));var sox=require(_0xb298('0x8'));var tts=require(_0xb298('0x9'));var urlParse=require(_0xb298('0xa'))['parse'];var util=require(_0xb298('0xb'));var aws=require('./aws');var google=require(_0xb298('0xc'));var sestek=require(_0xb298('0xd'));var tilde=require(_0xb298('0xe'));var logger=require(_0xb298('0xf'))(_0xb298('0x10'));var ISPEECH_API=_0xb298('0x11');function downloadFile(_0x8eac2b,_0x5a5bc6){return new BPromise(function(_0x236a8d,_0x15410d){var _0x4a6fd5=urlParse(_0x8eac2b);var _0x3a4e7e=_0x4a6fd5[_0xb298('0x12')]==='https:'?https:http;var _0x5aec5f={'host':_0x4a6fd5[_0xb298('0x13')],'path':_0x4a6fd5['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x3a4e7e[_0xb298('0x14')](_0x5aec5f,function(_0x2257c3){if(_0x2257c3[_0xb298('0x15')]!==0xc8){logger['error']('request\x20to\x20'+_0x8eac2b+_0xb298('0x16')+_0x2257c3[_0xb298('0x15')]+'\x20('+_0x2257c3[_0xb298('0x17')]+')');_0x15410d(new Error('request\x20to\x20'+_0x8eac2b+_0xb298('0x16')+_0x2257c3[_0xb298('0x15')]+'\x20('+_0x2257c3['statusMessage']+')'));return;}var _0xf3ba23=fs[_0xb298('0x18')](_0x5a5bc6);_0xf3ba23['on'](_0xb298('0x19'),function(){logger['info'](_0xb298('0x1a'));_0xf3ba23['close'](_0x236a8d);});_0xf3ba23['on']('error',function(_0x2fe619){fs[_0xb298('0x1b')](_0x5a5bc6);logger[_0xb298('0x1c')](_0xb298('0x1d'),_0x2fe619);_0x15410d(_0x2fe619);});_0x2257c3[_0xb298('0x1e')](_0xf3ba23);})['on'](_0xb298('0x1c'),function(_0x2ebba5){logger[_0xb298('0x1c')](_0x2ebba5);_0x15410d(_0x2ebba5);})[_0xb298('0x1f')]();});}function uploadFile(_0x124241){return new BPromise(function(_0x55ba4a,_0x4ec37a){var _0x4345f4=urlParse(_0x124241);var _0xe37fc0=_0x4345f4[_0xb298('0x12')]===_0xb298('0x20')?https:http;var _0x29f020={'host':_0x4345f4[_0xb298('0x13')],'path':_0x4345f4[_0xb298('0x4')],'headers':{'user-agent':_0xb298('0x21')}};_0xe37fc0[_0xb298('0x14')](_0x29f020,function(_0x1304fb){if(_0x1304fb[_0xb298('0x15')]!==0xc8){_0x4ec37a(new Error(_0xb298('0x22')+_0x124241+_0xb298('0x16')+_0x1304fb[_0xb298('0x15')]+'\x20('+_0x1304fb['statusMessage']+')'));return;}var _0x134dc9='';_0x1304fb['on'](_0xb298('0x23'),function(_0x56107c){_0x134dc9+=_0x56107c;});_0x1304fb['on']('end',function(){_0x55ba4a(_0x134dc9);});})['on']('error',function(_0x4da1d4){_0x4ec37a(_0x4da1d4);})[_0xb298('0x1f')]();});}function convertFile(_0x3e99e6,_0x495da5){return new BPromise(function(_0x4642ad,_0x48d2ad){var _0x22cd11=sox['transcode'](_0x3e99e6,_0x495da5,{'sampleRate':0x1f40,'format':_0xb298('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x22cd11['on'](_0xb298('0x1c'),function(_0xc0ea3c){logger[_0xb298('0x1c')](_0xb298('0x25'),_0xc0ea3c);_0x48d2ad(_0xc0ea3c);});_0x22cd11['on'](_0xb298('0x1f'),function(){logger[_0xb298('0x26')]('finish\x20to\x20convert');_0x4642ad();});_0x22cd11['start']();});}function base64Decode(_0x6b8873,_0x4e1b8b){var _0x1bc118=path[_0xb298('0x27')](__dirname,_0xb298('0x28'),rs['generate'](0x4)+'.wav');fs[_0xb298('0x29')](_0x1bc118,_0x6b8873,_0xb298('0x2a'));return convertFile(_0x1bc118,_0x4e1b8b)[_0xb298('0x2b')](function(){try{fs[_0xb298('0x1b')](_0x1bc118);fs[_0xb298('0x2c')](_0x4e1b8b,_0xb298('0x2d'));}catch(_0x2c393f){logger['error'](_0x2c393f);}return _0x4e1b8b['split']('.')[0x0];});}function base64Encode(_0x3c7a7a){var _0x1ddcfe=fs[_0xb298('0x2e')](_0x3c7a7a);return new Buffer(_0x1ddcfe)[_0xb298('0x2f')]('base64');}exports[_0xb298('0x30')]=function(_0x4442b8,_0x19dcb6,_0x48b431,_0x5efcc3,_0x48845b,_0x2b4b9f){var _0x5342bf,_0x27f88b;var _0x3c9b60=_0xb298('0x31');var _0x49ba7d=_0xb298('0x32')+_0x4442b8;var _0xd4490f={};if(_0x19dcb6===_0xb298('0x33')){_0xd4490f[_0xb298('0x34')]={'ssml':_0x48b431};}else{_0xd4490f[_0xb298('0x34')]={'text':_0x48b431};};_0xd4490f[_0xb298('0x35')]={'languageCode':_0x5efcc3,'ssmlGender':_0x48845b};_0xd4490f['audioConfig']={'audioEncoding':_0xb298('0x36'),'sampleRateHertz':0x1f40};var _0x3e5690={'url':_0x3c9b60+'text:synthesize'+_0x49ba7d,'method':_0xb298('0x37'),'json':!![],'body':_0xd4490f};return rp(_0x3e5690)['then'](function(_0x5c556f){return new BPromise(function(_0x1933af,_0x49a970){_0x5342bf=path[_0xb298('0x27')](__dirname,'tmp',rs[_0xb298('0x38')](0x4)+_0xb298('0x39'));var _0x48edb5=Buffer[_0xb298('0x3a')](_0x5c556f[_0xb298('0x3b')],'base64');return fs[_0xb298('0x3c')](_0x5342bf,_0x48edb5,function(_0x17bb10){_0x49a970(_0x17bb10);},function(_0x4b4a4e){fs[_0xb298('0x2c')](_0x5342bf,_0xb298('0x2d'));_0x1933af(_0x4b4a4e);});});})[_0xb298('0x2b')](function(_0x574e36){_0x27f88b=path['resolve'](__dirname,_0xb298('0x28'),rs[_0xb298('0x38')](0x4)+_0xb298('0x3d'));return convertFile(_0x5342bf,_0x27f88b);})[_0xb298('0x2b')](function(){try{fs['unlink'](_0x5342bf);fs['chmodSync'](_0x27f88b,_0xb298('0x2d'));}catch(_0x468bb2){logger[_0xb298('0x1c')](_0x468bb2);}logger['info']('googleCloudTTS\x20path',_0x27f88b['split']('.')[0x0]);return _0x27f88b['split']('.')[0x0];});};exports['googleTTS']=function(_0x10527c,_0x5d1594){var _0x225198=_0xb298('0x3e');var _0x544afb,_0x83fe74;var _0x5d855d;var _0x32987f={'encoding':'utf8','method':_0xb298('0x37'),'timeout':0x2710,'url':_0x225198,'headers':{'Content-Type':_0xb298('0x3f')},'body':_0xb298('0x40')+encodeURIComponent(JSON[_0xb298('0x41')]([[['jQ1olc',JSON['stringify']([_0x10527c,_0x5d1594||'en',![],_0xb298('0x42')]),null,'generic']]]))};return rp(_0x32987f)[_0xb298('0x2b')](function(_0x5bd1e2){try{_0x5d855d=eval(_0x5bd1e2[_0xb298('0x43')](0x5))[0x0][0x2];}catch(_0x4487a8){throw new Error(_0xb298('0x44')+_0x5bd1e2[_0xb298('0x23')]);}if(!_0x5d855d){if(_0x10527c[_0xb298('0x45')]>0xc8){throw new Error(_0xb298('0x46'));}else{throw new Error(_0xb298('0x47')+_0x5d1594+_0xb298('0x48'));}}try{_0x5d855d=eval(_0x5d855d)[0x0];}catch(_0x5b22ef){throw new Error(_0xb298('0x44')+res[_0xb298('0x23')]);}const _0x56db7b=_0x5d855d;_0x544afb=path[_0xb298('0x27')](__dirname,_0xb298('0x28'),rs['generate'](0x4)+'.mp3');fs['writeFileSync'](_0x544afb,_0x5d855d,{'encoding':'base64'});_0x83fe74=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xb298('0x3d'));return convertFile(_0x544afb,_0x83fe74);})[_0xb298('0x2b')](function(){try{fs['unlink'](_0x544afb);fs['chmodSync'](_0x83fe74,_0xb298('0x2d'));}catch(_0x527783){logger[_0xb298('0x1c')](_0x527783);}logger['info'](_0xb298('0x49'),_0x83fe74[_0xb298('0x4a')]('.')[0x0]);return _0x83fe74[_0xb298('0x4a')]('.')[0x0];});};exports[_0xb298('0x4b')]=function(_0x25a0f5,_0x4f2667,_0x15c283){return google['asr'](_0x25a0f5,_0x4f2667,_0x15c283)[_0xb298('0x2b')](function(_0x19b05b){logger[_0xb298('0x26')](_0x19b05b[_0xb298('0x4c')]);return rp(_0x19b05b);})['then'](function(_0x3ef994){var _0x5e81da='';var _0x57df43=0x0;try{fs[_0xb298('0x1b')](_0x25a0f5);}catch(_0x27163d){logger[_0xb298('0x1c')](_0x27163d);}if(_0x3ef994&&_0x3ef994['results']){_0x5e81da=_0x3ef994[_0xb298('0x4d')][_0xb298('0x4e')](function(_0x50fcf8){return _0x50fcf8&&_0x50fcf8['alternatives'][0x0]&&_0x50fcf8[_0xb298('0x4f')][0x0][_0xb298('0x50')]?_0x50fcf8['alternatives'][0x0][_0xb298('0x50')]:'';})[_0xb298('0x51')]('\x0a');_0x57df43=_0x3ef994[_0xb298('0x4d')][_0xb298('0x4e')](function(_0x576f2b){return _0x576f2b&&_0x576f2b[_0xb298('0x4f')][0x0]&&_0x576f2b['alternatives'][0x0]['confidence']?_0x576f2b[_0xb298('0x4f')][0x0]['confidence']:0x0;})['join']('\x0a');}logger['info'](_0xb298('0x52'),_0x5e81da);logger[_0xb298('0x26')](_0xb298('0x53'),_0x57df43);return{'transcript':_0x5e81da,'confidence':_0x57df43};})[_0xb298('0x54')](function(_0x5d2b6b){logger[_0xb298('0x1c')](_0xb298('0x55'),_0x5d2b6b[_0xb298('0x15')],_0x5d2b6b['name'],_0x5d2b6b[_0xb298('0x56')]);});};exports[_0xb298('0x57')]=function(_0xf42fa2,_0x3693b5,_0x5f5ba3,_0x5c0279){var _0x243afa=apiai(_0x3693b5,{'language':_0x5c0279||'en'});return _0x243afa[_0xb298('0x58')](_0x5f5ba3,{'sessionId':md5(_0xf42fa2)})[_0xb298('0x2b')](function(_0xdbe183){logger[_0xb298('0x26')](JSON[_0xb298('0x41')](_0xdbe183));return{'source':_0xdbe183[_0xb298('0x59')][_0xb298('0x5a')],'resolvedQuery':_0xdbe183[_0xb298('0x59')][_0xb298('0x5b')],'action':_0xdbe183[_0xb298('0x59')][_0xb298('0x5c')],'actionIncomplete':_0xdbe183[_0xb298('0x59')]['actionIncomplete'],'speech':_0xdbe183[_0xb298('0x59')]['fulfillment'][_0xb298('0x5d')],'score':_0xdbe183[_0xb298('0x59')][_0xb298('0x5e')],'statusCode':_0xdbe183[_0xb298('0x5f')]['code'],'endConversation':_0xdbe183[_0xb298('0x59')][_0xb298('0x60')][_0xb298('0x61')]||![],'isFallbackIntent':_0xdbe183[_0xb298('0x59')][_0xb298('0x60')]['isFallbackIntent']};});};exports[_0xb298('0x62')]=function(_0x29cfba,_0x2cf19d,_0x2749f6,_0x53e78f,_0x525c4c,_0x15f848){var _0x5f90f0=_0x53e78f['replace'](/\\n/g,'\x0a');var _0x2155bf={'credentials':{'private_key':_0x5f90f0,'client_email':_0x2749f6}};var _0x40b230=new dialogflow[(_0xb298('0x63'))](_0x2155bf);var _0x5cb693=_0x40b230[_0xb298('0x64')](_0x2cf19d,md5(_0x29cfba));var _0x50cbe6={'session':_0x5cb693,'queryInput':{'text':{'text':_0x525c4c,'languageCode':_0x15f848}}};return _0x40b230[_0xb298('0x65')](_0x50cbe6)[_0xb298('0x2b')](function(_0x2fdde4){if(_0x2fdde4&&_0x2fdde4['length']){logger[_0xb298('0x26')](_0xb298('0x66'),JSON[_0xb298('0x41')](_0x2fdde4));var _0x1319ea=_0x2fdde4[0x0];if(_0x1319ea){var _0x49baf2={'action':_0x1319ea[_0xb298('0x67')][_0xb298('0x5c')],'allRequiredParamsPresent':_0x1319ea[_0xb298('0x67')]['allRequiredParamsPresent'],'endConversation':_0x1319ea[_0xb298('0x67')]['diagnosticInfo']&&_0x1319ea['queryResult'][_0xb298('0x68')][_0xb298('0x69')]?_0x1319ea[_0xb298('0x67')][_0xb298('0x68')][_0xb298('0x69')][_0xb298('0x6a')][_0xb298('0x6b')]:![],'fulfillmentText':_0x1319ea[_0xb298('0x67')][_0xb298('0x6c')],'intentName':_0x1319ea['queryResult'][_0xb298('0x6d')][_0xb298('0x6e')],'intentDisplayName':_0x1319ea['queryResult'][_0xb298('0x6d')][_0xb298('0x6f')],'isFallbackIntent':_0x1319ea[_0xb298('0x67')][_0xb298('0x6d')]['isFallback'],'languageCode':_0x1319ea['queryResult'][_0xb298('0x70')],'queryText':_0x1319ea[_0xb298('0x67')][_0xb298('0x71')],'responseId':_0x1319ea[_0xb298('0x72')],'score':_0x1319ea['queryResult'][_0xb298('0x73')],'speech':_0x1319ea[_0xb298('0x67')][_0xb298('0x6c')],'providerResponse':JSON[_0xb298('0x41')](_0x2fdde4)};return _0x49baf2;}}});};exports[_0xb298('0x74')]=function(_0x4d6485,_0x5b88f6,_0x2dd7e1,_0x47ba3c){return tilde[_0xb298('0x75')](_0x4d6485,_0x5b88f6,_0x2dd7e1,_0x47ba3c)[_0xb298('0x2b')](function(_0x5a2eca){try{fs[_0xb298('0x1b')](_0x4d6485);}catch(_0x578883){logger[_0xb298('0x1c')](_0x578883);}logger[_0xb298('0x26')]('Tilde\x20ASR\x20transcription',_0x5a2eca[_0xb298('0x50')]);logger[_0xb298('0x26')](_0xb298('0x76'),_0x5a2eca[_0xb298('0x77')]);return _0x5a2eca;});};exports[_0xb298('0x78')]=function(_0x21bafb,_0x5013d2,_0x42d05e,_0x2cbe9b,_0x46de64,_0x2cbe36){var _0x5bb295=path['resolve'](__dirname,_0xb298('0x28'),rs[_0xb298('0x38')](0x4)+_0xb298('0x39'));var _0x8ad3ed;return aws['polly'](_0x21bafb,_0x5013d2,_0x42d05e,_0x2cbe9b,_0x46de64,_0x2cbe36,_0x5bb295)['then'](function(){_0x8ad3ed=path[_0xb298('0x27')](__dirname,_0xb298('0x28'),rs['generate'](0x4)+_0xb298('0x3d'));return convertFile(_0x5bb295,_0x8ad3ed);})[_0xb298('0x2b')](function(){try{fs['unlink'](_0x5bb295);fs['chmodSync'](_0x8ad3ed,_0xb298('0x2d'));}catch(_0x41e2b2){logger['error'](_0x41e2b2);}return _0x8ad3ed[_0xb298('0x4a')]('.')[0x0];});};exports[_0xb298('0x79')]=function(_0xa9f79c,_0x19b129,_0x57c7cb,_0x509a37,_0x4adfad,_0x2647e9){return aws['lex'](_0xa9f79c,_0x19b129,_0x57c7cb,_0x509a37,_0x4adfad,_0x2647e9)[_0xb298('0x2b')](function(_0xcda647){logger[_0xb298('0x26')](JSON['stringify'](_0xcda647));return _0xcda647;});};exports[_0xb298('0x7a')]=function(_0x5ba463,_0x5a7aca,_0x3d45ba,_0x249550){var _0x5be6d4=util['format'](_0xb298('0x7b'),ISPEECH_API,_0x5ba463,encodeURIComponent(_0x5a7aca),_0x3d45ba,_0x249550);var _0x480518=path[_0xb298('0x27')](__dirname,_0xb298('0x28'),rs[_0xb298('0x38')](0x4)+'.mp3');var _0x5196ae;return downloadFile(_0x5be6d4,_0x480518)[_0xb298('0x2b')](function(){_0x5196ae=path[_0xb298('0x27')](__dirname,_0xb298('0x28'),rs['generate'](0x4)+'.wav');return convertFile(_0x480518,_0x5196ae);})[_0xb298('0x2b')](function(){try{fs[_0xb298('0x1b')](_0x480518);fs['chmodSync'](_0x5196ae,_0xb298('0x2d'));}catch(_0x279e21){logger[_0xb298('0x1c')](_0x279e21);}return _0x5196ae[_0xb298('0x4a')]('.')[0x0];});};exports[_0xb298('0x7c')]=function(_0x3a828d,_0x439012,_0x58693a,_0x2b7e07){var _0x19451e=util[_0xb298('0x7d')](_0xb298('0x7e'),ISPEECH_API,_0x439012,_0x58693a,base64Encode(_0x3a828d),_0x2b7e07?util[_0xb298('0x7d')]('model=%s',encodeURIComponent(_0x2b7e07)):_0xb298('0x7f'));return uploadFile(_0x19451e)['then'](function(_0x21fb4b){return querystring[_0xb298('0x80')](_0x21fb4b);});};exports[_0xb298('0x81')]=function(_0x3f3928,_0x337d84){return sestek[_0xb298('0x82')](_0x3f3928,_0x337d84)[_0xb298('0x2b')](function(_0x1f5a81){logger[_0xb298('0x26')](JSON[_0xb298('0x41')](_0x1f5a81));var _0x38642c={'speech':_0x1f5a81[_0xb298('0x83')],'action':_0x1f5a81[_0xb298('0x84')]?_0x1f5a81[_0xb298('0x84')]['CustomAction']:undefined,'actiondata':_0x1f5a81[_0xb298('0x84')]?_0x1f5a81[_0xb298('0x84')][_0xb298('0x85')]:undefined};if(_0x1f5a81['channelData']&&_0x1f5a81['channelData']['AudioFromTts']){return base64Decode(_0x1f5a81['channelData'][_0xb298('0x86')][_0xb298('0x87')],path[_0xb298('0x27')](__dirname,_0xb298('0x28'),rs[_0xb298('0x38')](0x4)+'.wav'))[_0xb298('0x2b')](function(_0x498f88){_0x38642c[_0xb298('0x88')]=_0x498f88;return _0x38642c;});}return _0x38642c;});};exports[_0xb298('0x89')]=function(){return __dirname;}; \ No newline at end of file +var _0x811a=['writeFile','chmodSync','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','data','googleASR','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','googleDialogflow','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','queryText','responseId','fulfillmentText','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','lex','format','model=%s','parse','nda','text','channelData','AudioFromTts','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','request-promise','randomstring','sox','google-tts-api','url','util','./aws','./google','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','https:','WHAT_EVER','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','error','unlink','pipe','end','host','get','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','then','777','split','readFileSync','base64','googleCloudTTS','?key=','input','voice','audioConfig','MP3','.mp3','audioContent'];(function(_0x34e5d2,_0x4731a3){var _0x11e709=function(_0x3a4972){while(--_0x3a4972){_0x34e5d2['push'](_0x34e5d2['shift']());}};_0x11e709(++_0x4731a3);}(_0x811a,0xc7));var _0xa811=function(_0x425bab,_0x9ef501){_0x425bab=_0x425bab-0x0;var _0x53c76f=_0x811a[_0x425bab];return _0x53c76f;};'use strict';var apiai=require(_0xa811('0x0'));var BPromise=require(_0xa811('0x1'));var dialogflow=require(_0xa811('0x2'));var fs=require('fs');var http=require(_0xa811('0x3'));var https=require(_0xa811('0x4'));var md5=require(_0xa811('0x5'));var path=require(_0xa811('0x6'));var querystring=require('querystring');var rp=require(_0xa811('0x7'));var rs=require(_0xa811('0x8'));var sox=require(_0xa811('0x9'));var tts=require(_0xa811('0xa'));var urlParse=require(_0xa811('0xb'))['parse'];var util=require(_0xa811('0xc'));var aws=require(_0xa811('0xd'));var google=require(_0xa811('0xe'));var sestek=require(_0xa811('0xf'));var tilde=require(_0xa811('0x10'));var logger=require('../../../config/logger')(_0xa811('0x11'));var ISPEECH_API=_0xa811('0x12');function downloadFile(_0x2213fe,_0x3ff775){return new BPromise(function(_0x1230e4,_0x3a080e){var _0x11554d=urlParse(_0x2213fe);var _0x3aa7c7=_0x11554d['protocol']===_0xa811('0x13')?https:http;var _0x8f29d9={'host':_0x11554d['host'],'path':_0x11554d[_0xa811('0x6')],'headers':{'user-agent':_0xa811('0x14')}};_0x3aa7c7['get'](_0x8f29d9,function(_0x277eea){if(_0x277eea[_0xa811('0x15')]!==0xc8){logger['error'](_0xa811('0x16')+_0x2213fe+_0xa811('0x17')+_0x277eea['statusCode']+'\x20('+_0x277eea[_0xa811('0x18')]+')');_0x3a080e(new Error(_0xa811('0x16')+_0x2213fe+_0xa811('0x17')+_0x277eea['statusCode']+'\x20('+_0x277eea[_0xa811('0x18')]+')'));return;}var _0x25f76d=fs[_0xa811('0x19')](_0x3ff775);_0x25f76d['on'](_0xa811('0x1a'),function(){logger[_0xa811('0x1b')]('finish\x20download\x20file');_0x25f76d['close'](_0x1230e4);});_0x25f76d['on'](_0xa811('0x1c'),function(_0xa87790){fs[_0xa811('0x1d')](_0x3ff775);logger[_0xa811('0x1c')]('download\x20error',_0xa87790);_0x3a080e(_0xa87790);});_0x277eea[_0xa811('0x1e')](_0x25f76d);})['on'](_0xa811('0x1c'),function(_0xb02db6){logger[_0xa811('0x1c')](_0xb02db6);_0x3a080e(_0xb02db6);})[_0xa811('0x1f')]();});}function uploadFile(_0x24ca28){return new BPromise(function(_0x19da27,_0x4ec557){var _0x313cea=urlParse(_0x24ca28);var _0x529094=_0x313cea['protocol']===_0xa811('0x13')?https:http;var _0x442d65={'host':_0x313cea[_0xa811('0x20')],'path':_0x313cea[_0xa811('0x6')],'headers':{'user-agent':_0xa811('0x14')}};_0x529094[_0xa811('0x21')](_0x442d65,function(_0x59f1d9){if(_0x59f1d9[_0xa811('0x15')]!==0xc8){_0x4ec557(new Error('request\x20to\x20'+_0x24ca28+_0xa811('0x17')+_0x59f1d9[_0xa811('0x15')]+'\x20('+_0x59f1d9['statusMessage']+')'));return;}var _0x309951='';_0x59f1d9['on']('data',function(_0x20ac0b){_0x309951+=_0x20ac0b;});_0x59f1d9['on'](_0xa811('0x1f'),function(){_0x19da27(_0x309951);});})['on'](_0xa811('0x1c'),function(_0x37b473){_0x4ec557(_0x37b473);})['end']();});}function convertFile(_0x39ad6e,_0x52b517){return new BPromise(function(_0xad5e04,_0x267a93){var _0xc7b79e=sox[_0xa811('0x22')](_0x39ad6e,_0x52b517,{'sampleRate':0x1f40,'format':_0xa811('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xc7b79e['on'](_0xa811('0x1c'),function(_0x1b0283){logger[_0xa811('0x1c')](_0xa811('0x24'),_0x1b0283);_0x267a93(_0x1b0283);});_0xc7b79e['on'](_0xa811('0x1f'),function(){logger[_0xa811('0x1b')](_0xa811('0x25'));_0xad5e04();});_0xc7b79e[_0xa811('0x26')]();});}function base64Decode(_0x3499a8,_0x318c77){var _0x3aa278=path[_0xa811('0x27')](__dirname,_0xa811('0x28'),rs[_0xa811('0x29')](0x4)+_0xa811('0x2a'));fs[_0xa811('0x2b')](_0x3aa278,_0x3499a8,'base64');return convertFile(_0x3aa278,_0x318c77)[_0xa811('0x2c')](function(){try{fs[_0xa811('0x1d')](_0x3aa278);fs['chmodSync'](_0x318c77,_0xa811('0x2d'));}catch(_0x3fb008){logger[_0xa811('0x1c')](_0x3fb008);}return _0x318c77[_0xa811('0x2e')]('.')[0x0];});}function base64Encode(_0x421774){var _0x28a842=fs[_0xa811('0x2f')](_0x421774);return new Buffer(_0x28a842)['toString'](_0xa811('0x30'));}exports[_0xa811('0x31')]=function(_0x3c8ced,_0x25f8ae,_0x1447bd,_0x187bc1,_0x2c33f6,_0x23a108){var _0x606e5b,_0x3d6d06;var _0x54662f='https://texttospeech.googleapis.com/v1/';var _0x4fad98=_0xa811('0x32')+_0x3c8ced;var _0x57ba7a={};if(_0x25f8ae==='ssml'){_0x57ba7a[_0xa811('0x33')]={'ssml':_0x1447bd};}else{_0x57ba7a[_0xa811('0x33')]={'text':_0x1447bd};};_0x57ba7a[_0xa811('0x34')]={'languageCode':_0x187bc1,'ssmlGender':_0x2c33f6};_0x57ba7a[_0xa811('0x35')]={'audioEncoding':_0xa811('0x36'),'sampleRateHertz':0x1f40};var _0x2a36a8={'url':_0x54662f+'text:synthesize'+_0x4fad98,'method':'POST','json':!![],'body':_0x57ba7a};return rp(_0x2a36a8)[_0xa811('0x2c')](function(_0x2ea9a4){return new BPromise(function(_0x128f30,_0x1d7891){_0x606e5b=path['resolve'](__dirname,_0xa811('0x28'),rs[_0xa811('0x29')](0x4)+_0xa811('0x37'));var _0x7cd682=Buffer['from'](_0x2ea9a4[_0xa811('0x38')],_0xa811('0x30'));return fs[_0xa811('0x39')](_0x606e5b,_0x7cd682,function(_0x3132fc){_0x1d7891(_0x3132fc);},function(_0x138b00){fs[_0xa811('0x3a')](_0x606e5b,'777');_0x128f30(_0x138b00);});});})['then'](function(_0x2e3ba1){_0x3d6d06=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xa811('0x2a'));return convertFile(_0x606e5b,_0x3d6d06);})[_0xa811('0x2c')](function(){try{fs[_0xa811('0x1d')](_0x606e5b);fs[_0xa811('0x3a')](_0x3d6d06,_0xa811('0x2d'));}catch(_0x38a272){logger[_0xa811('0x1c')](_0x38a272);}logger[_0xa811('0x1b')](_0xa811('0x3b'),_0x3d6d06['split']('.')[0x0]);return _0x3d6d06[_0xa811('0x2e')]('.')[0x0];});};exports['googleTTS']=function(_0x2197aa,_0x37d26b){var _0x51d768=_0xa811('0x3c');var _0x1f2a7e,_0x26705e;var _0x21c298;var _0xcedf9c={'encoding':_0xa811('0x3d'),'method':_0xa811('0x3e'),'timeout':0x2710,'url':_0x51d768,'headers':{'Content-Type':_0xa811('0x3f')},'body':'f.req='+encodeURIComponent(JSON[_0xa811('0x40')]([[['jQ1olc',JSON[_0xa811('0x40')]([_0x2197aa,_0x37d26b||'en',![],_0xa811('0x41')]),null,_0xa811('0x42')]]]))};return rp(_0xcedf9c)[_0xa811('0x2c')](function(_0x48f713){try{_0x21c298=eval(_0x48f713[_0xa811('0x43')](0x5))[0x0][0x2];}catch(_0x3600ea){throw new Error(_0xa811('0x44')+_0x48f713['data']);}if(!_0x21c298){if(_0x2197aa['length']>0xc8){throw new Error(_0xa811('0x45'));}else{throw new Error(_0xa811('0x46')+_0x37d26b+_0xa811('0x47'));}}try{_0x21c298=eval(_0x21c298)[0x0];}catch(_0x344362){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xa811('0x48')]);}const _0x46eed6=_0x21c298;_0x1f2a7e=path[_0xa811('0x27')](__dirname,'tmp',rs[_0xa811('0x29')](0x4)+'.mp3');fs[_0xa811('0x2b')](_0x1f2a7e,_0x21c298,{'encoding':_0xa811('0x30')});_0x26705e=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xa811('0x2a'));return convertFile(_0x1f2a7e,_0x26705e);})[_0xa811('0x2c')](function(){try{fs[_0xa811('0x1d')](_0x1f2a7e);fs['chmodSync'](_0x26705e,'777');}catch(_0x596cba){logger['error'](_0x596cba);}logger[_0xa811('0x1b')]('goggleTTS\x20path',_0x26705e[_0xa811('0x2e')]('.')[0x0]);return _0x26705e[_0xa811('0x2e')]('.')[0x0];});};exports[_0xa811('0x49')]=function(_0x4cb0bf,_0x349eeb,_0x2c76dd){return google['asr'](_0x4cb0bf,_0x349eeb,_0x2c76dd)['then'](function(_0x4453d3){logger[_0xa811('0x1b')](_0x4453d3['uri']);return rp(_0x4453d3);})[_0xa811('0x2c')](function(_0x2a9e74){var _0x67ded6='';var _0x58328c=0x0;try{fs['unlink'](_0x4cb0bf);}catch(_0x3a89f4){logger[_0xa811('0x1c')](_0x3a89f4);}if(_0x2a9e74&&_0x2a9e74[_0xa811('0x4a')]){_0x67ded6=_0x2a9e74['results'][_0xa811('0x4b')](function(_0x4cd77d){return _0x4cd77d&&_0x4cd77d[_0xa811('0x4c')][0x0]&&_0x4cd77d['alternatives'][0x0][_0xa811('0x4d')]?_0x4cd77d[_0xa811('0x4c')][0x0][_0xa811('0x4d')]:'';})['join']('\x0a');_0x58328c=_0x2a9e74[_0xa811('0x4a')][_0xa811('0x4b')](function(_0x323bbd){return _0x323bbd&&_0x323bbd[_0xa811('0x4c')][0x0]&&_0x323bbd[_0xa811('0x4c')][0x0][_0xa811('0x4e')]?_0x323bbd[_0xa811('0x4c')][0x0]['confidence']:0x0;})[_0xa811('0x4f')]('\x0a');}logger['info'](_0xa811('0x50'),_0x67ded6);logger[_0xa811('0x1b')]('googleASR\x20confidence',_0x58328c);return{'transcript':_0x67ded6,'confidence':_0x58328c};})[_0xa811('0x51')](function(_0x2bb575){logger['error'](_0xa811('0x52'),_0x2bb575[_0xa811('0x15')],_0x2bb575[_0xa811('0x53')],_0x2bb575['message']);});};exports[_0xa811('0x54')]=function(_0x299adc,_0x3cf5cc,_0x20a428,_0x32a5ba){var _0x4171cb=apiai(_0x3cf5cc,{'language':_0x32a5ba||'en'});return _0x4171cb['textRequest'](_0x20a428,{'sessionId':md5(_0x299adc)})[_0xa811('0x2c')](function(_0x10e4ab){logger[_0xa811('0x1b')](JSON['stringify'](_0x10e4ab));return{'source':_0x10e4ab[_0xa811('0x55')]['source'],'resolvedQuery':_0x10e4ab['result'][_0xa811('0x56')],'action':_0x10e4ab['result'][_0xa811('0x57')],'actionIncomplete':_0x10e4ab[_0xa811('0x55')][_0xa811('0x58')],'speech':_0x10e4ab['result'][_0xa811('0x59')][_0xa811('0x5a')],'score':_0x10e4ab[_0xa811('0x55')][_0xa811('0x5b')],'statusCode':_0x10e4ab[_0xa811('0x5c')][_0xa811('0x5d')],'endConversation':_0x10e4ab[_0xa811('0x55')][_0xa811('0x5e')][_0xa811('0x5f')]||![],'isFallbackIntent':_0x10e4ab[_0xa811('0x55')][_0xa811('0x5e')][_0xa811('0x60')]};});};exports[_0xa811('0x61')]=function(_0x90fab5,_0x45f306,_0x4a7ad5,_0x8edb2f,_0x10939d,_0x35ad7b){var _0x4a4fd0=_0x8edb2f[_0xa811('0x62')](/\\n/g,'\x0a');var _0x224206={'credentials':{'private_key':_0x4a4fd0,'client_email':_0x4a7ad5}};var _0x45cc64=new dialogflow['SessionsClient'](_0x224206);var _0xa4ac1c=_0x45cc64[_0xa811('0x63')](_0x45f306,md5(_0x90fab5));var _0x13cee7={'session':_0xa4ac1c,'queryInput':{'text':{'text':_0x10939d,'languageCode':_0x35ad7b}}};return _0x45cc64[_0xa811('0x64')](_0x13cee7)[_0xa811('0x2c')](function(_0x44a254){if(_0x44a254&&_0x44a254[_0xa811('0x65')]){logger['info'](_0xa811('0x66'),JSON[_0xa811('0x40')](_0x44a254));var _0x1f648d=_0x44a254[0x0];if(_0x1f648d){var _0x454842={'action':_0x1f648d['queryResult'][_0xa811('0x57')],'allRequiredParamsPresent':_0x1f648d[_0xa811('0x67')]['allRequiredParamsPresent'],'endConversation':_0x1f648d[_0xa811('0x67')][_0xa811('0x68')]&&_0x1f648d[_0xa811('0x67')]['diagnosticInfo'][_0xa811('0x69')]?_0x1f648d[_0xa811('0x67')]['diagnosticInfo'][_0xa811('0x69')][_0xa811('0x6a')][_0xa811('0x6b')]:![],'fulfillmentText':_0x1f648d[_0xa811('0x67')]['fulfillmentText'],'intentName':_0x1f648d['queryResult'][_0xa811('0x6c')][_0xa811('0x53')],'intentDisplayName':_0x1f648d[_0xa811('0x67')][_0xa811('0x6c')][_0xa811('0x6d')],'isFallbackIntent':_0x1f648d[_0xa811('0x67')][_0xa811('0x6c')]['isFallback'],'languageCode':_0x1f648d[_0xa811('0x67')]['languageCode'],'queryText':_0x1f648d[_0xa811('0x67')][_0xa811('0x6e')],'responseId':_0x1f648d[_0xa811('0x6f')],'score':_0x1f648d['queryResult']['intentDetectionConfidence'],'speech':_0x1f648d[_0xa811('0x67')][_0xa811('0x70')],'providerResponse':JSON['stringify'](_0x44a254)};return _0x454842;}}});};exports[_0xa811('0x71')]=function(_0x20f620,_0x54205d,_0x1e3257,_0x379b9b){return tilde[_0xa811('0x72')](_0x20f620,_0x54205d,_0x1e3257,_0x379b9b)[_0xa811('0x2c')](function(_0x261f1c){try{fs[_0xa811('0x1d')](_0x20f620);}catch(_0x5aacbd){logger[_0xa811('0x1c')](_0x5aacbd);}logger['info'](_0xa811('0x73'),_0x261f1c['transcript']);logger[_0xa811('0x1b')](_0xa811('0x74'),_0x261f1c[_0xa811('0x4e')]);return _0x261f1c;});};exports['awsPolly']=function(_0x330f8a,_0x3fa1d3,_0x2fa7cb,_0x9d378f,_0x498875,_0x1b383f){var _0x14236b=path[_0xa811('0x27')](__dirname,_0xa811('0x28'),rs[_0xa811('0x29')](0x4)+_0xa811('0x37'));var _0x35e7fe;return aws[_0xa811('0x75')](_0x330f8a,_0x3fa1d3,_0x2fa7cb,_0x9d378f,_0x498875,_0x1b383f,_0x14236b)[_0xa811('0x2c')](function(){_0x35e7fe=path[_0xa811('0x27')](__dirname,_0xa811('0x28'),rs[_0xa811('0x29')](0x4)+_0xa811('0x2a'));return convertFile(_0x14236b,_0x35e7fe);})[_0xa811('0x2c')](function(){try{fs[_0xa811('0x1d')](_0x14236b);fs[_0xa811('0x3a')](_0x35e7fe,_0xa811('0x2d'));}catch(_0x93f08d){logger[_0xa811('0x1c')](_0x93f08d);}return _0x35e7fe[_0xa811('0x2e')]('.')[0x0];});};exports[_0xa811('0x76')]=function(_0x1253c9,_0x28aa71,_0x2b6816,_0x2331cd,_0x5dda97,_0x4bc625){return aws[_0xa811('0x77')](_0x1253c9,_0x28aa71,_0x2b6816,_0x2331cd,_0x5dda97,_0x4bc625)[_0xa811('0x2c')](function(_0x3bf28f){logger[_0xa811('0x1b')](JSON['stringify'](_0x3bf28f));return _0x3bf28f;});};exports['ispeechTTS']=function(_0x453248,_0x163394,_0x187136,_0x26e9d2){var _0x10b8f9=util[_0xa811('0x78')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x453248,encodeURIComponent(_0x163394),_0x187136,_0x26e9d2);var _0x419120=path['resolve'](__dirname,_0xa811('0x28'),rs['generate'](0x4)+'.mp3');var _0x2e727c;return downloadFile(_0x10b8f9,_0x419120)['then'](function(){_0x2e727c=path[_0xa811('0x27')](__dirname,'tmp',rs[_0xa811('0x29')](0x4)+'.wav');return convertFile(_0x419120,_0x2e727c);})[_0xa811('0x2c')](function(){try{fs['unlink'](_0x419120);fs[_0xa811('0x3a')](_0x2e727c,_0xa811('0x2d'));}catch(_0x2cf588){logger[_0xa811('0x1c')](_0x2cf588);}return _0x2e727c['split']('.')[0x0];});};exports['ispeechASR']=function(_0x39e684,_0x43b568,_0x3877ed,_0x2617ab){var _0x2343f7=util[_0xa811('0x78')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x43b568,_0x3877ed,base64Encode(_0x39e684),_0x2617ab?util[_0xa811('0x78')](_0xa811('0x79'),encodeURIComponent(_0x2617ab)):'freeform=3');return uploadFile(_0x2343f7)[_0xa811('0x2c')](function(_0x51eab0){return querystring[_0xa811('0x7a')](_0x51eab0);});};exports['sestekNDA']=function(_0x520657,_0x451ce3){return sestek[_0xa811('0x7b')](_0x520657,_0x451ce3)['then'](function(_0x211b10){logger[_0xa811('0x1b')](JSON[_0xa811('0x40')](_0x211b10));var _0xbbcbcb={'speech':_0x211b10[_0xa811('0x7c')],'action':_0x211b10['channelData']?_0x211b10[_0xa811('0x7d')]['CustomAction']:undefined,'actiondata':_0x211b10['channelData']?_0x211b10[_0xa811('0x7d')]['CustomActionData']:undefined};if(_0x211b10[_0xa811('0x7d')]&&_0x211b10[_0xa811('0x7d')][_0xa811('0x7e')]){return base64Decode(_0x211b10[_0xa811('0x7d')][_0xa811('0x7e')]['Data'],path[_0xa811('0x27')](__dirname,_0xa811('0x28'),rs[_0xa811('0x29')](0x4)+_0xa811('0x2a')))[_0xa811('0x2c')](function(_0x35818d){_0xbbcbcb['audiofile']=_0x35818d;return _0xbbcbcb;});}return _0xbbcbcb;});};exports[_0xa811('0x7f')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index d31f8ec..cb30c37 100644 --- a/server/services/agi/scripts/sestek/index.js +++ b/server/services/agi/scripts/sestek/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6818=['./nda','exports'];(function(_0x542ed0,_0x32e6bb){var _0x2298f5=function(_0x468c57){while(--_0x468c57){_0x542ed0['push'](_0x542ed0['shift']());}};_0x2298f5(++_0x32e6bb);}(_0x6818,0x140));var _0x8681=function(_0x5250d2,_0x50df3b){_0x5250d2=_0x5250d2-0x0;var _0x545b36=_0x6818[_0x5250d2];return _0x545b36;};var nda=require(_0x8681('0x0'));module[_0x8681('0x1')]={'nda':nda}; \ No newline at end of file +var _0x75f5=['exports','./nda'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0x75f5,0x10f));var _0x575f=function(_0x1d8f23,_0x1d4573){_0x1d8f23=_0x1d8f23-0x0;var _0x9499d7=_0x75f5[_0x1d8f23];return _0x9499d7;};var nda=require(_0x575f('0x0'));module[_0x575f('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index d5ecdf8..d54e726 100644 --- a/server/services/agi/scripts/sestek/nda/index.js +++ b/server/services/agi/scripts/sestek/nda/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x56dc=['calleridname','extension','text','Bearer\x20','access_token','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','custom_action_data','stringify','request-promise','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid'];(function(_0x28f922,_0x1302f8){var _0x4eceac=function(_0x2ce5a0){while(--_0x2ce5a0){_0x28f922['push'](_0x28f922['shift']());}};_0x4eceac(++_0x1302f8);}(_0x56dc,0xfd));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0xc56d('0x0'));var url=require('url');var logger=require(_0xc56d('0x1'))(_0xc56d('0x2'));module[_0xc56d('0x3')]=function(_0x11e58b,_0x1cfc0f){var _0x500a26={'method':_0xc56d('0x4'),'uri':url[_0xc56d('0x5')](_0x1cfc0f[_0xc56d('0x6')],_0xc56d('0x7')),'form':{'grant_type':_0xc56d('0x8'),'username':_0x1cfc0f[_0xc56d('0x9')],'password':_0x1cfc0f['password']},'json':!![]};return rp(_0x500a26)[_0xc56d('0xa')](function(_0x24b556){var _0x3ac7cd={'method':_0xc56d('0x4'),'uri':url[_0xc56d('0x5')](_0x1cfc0f[_0xc56d('0xb')],_0xc56d('0xc')),'body':{'type':_0x1cfc0f[_0xc56d('0xd')]||_0xc56d('0xe'),'channelId':'Nda','conversation':{'id':_0x11e58b[_0xc56d('0xf')]},'from':{'id':_0x11e58b[_0xc56d('0x10')],'name':_0x11e58b[_0xc56d('0x11')]},'recipient':{'id':_0x11e58b['dnid'],'name':_0x11e58b[_0xc56d('0x12')]},'text':_0x1cfc0f[_0xc56d('0x13')],'channelData':{}},'headers':{'Authorization':_0xc56d('0x14')+_0x24b556[_0xc56d('0x15')]},'json':!![]};if(_0x1cfc0f['project']){_0x3ac7cd[_0xc56d('0x16')][_0xc56d('0x17')][_0xc56d('0x18')]=_0x1cfc0f['project'];}if(_0x1cfc0f[_0xc56d('0x19')]=='1'){_0x3ac7cd[_0xc56d('0x16')][_0xc56d('0x17')][_0xc56d('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x1cfc0f[_0xc56d('0x1b')]){_0x3ac7cd[_0xc56d('0x16')]['channelData']['CustomAction']=_0x1cfc0f[_0xc56d('0x1b')];if(_0x1cfc0f[_0xc56d('0x1c')]){_0x3ac7cd[_0xc56d('0x16')][_0xc56d('0x17')]['CustomActionData']=_0x1cfc0f[_0xc56d('0x1c')];}}logger['info'](JSON[_0xc56d('0x1d')](_0x3ac7cd));return rp(_0x3ac7cd);});}; \ No newline at end of file +var _0xdca3=['CustomActionData','custom_action_data','info','stringify','request-promise','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','uniqueid','callerid','calleridname','dnid','extension','Bearer\x20','body','channelData','ProjectName','project','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction'];(function(_0x3a09e6,_0x32bbf9){var _0x2fa6c0=function(_0xffe110){while(--_0xffe110){_0x3a09e6['push'](_0x3a09e6['shift']());}};_0x2fa6c0(++_0x32bbf9);}(_0xdca3,0x64));var _0x3dca=function(_0x1f5c93,_0x32c21){_0x1f5c93=_0x1f5c93-0x0;var _0x43329f=_0xdca3[_0x1f5c93];return _0x43329f;};'use strict';var rp=require(_0x3dca('0x0'));var url=require('url');var logger=require(_0x3dca('0x1'))(_0x3dca('0x2'));module[_0x3dca('0x3')]=function(_0x26df5e,_0x1754d1){var _0x19f703={'method':_0x3dca('0x4'),'uri':url[_0x3dca('0x5')](_0x1754d1[_0x3dca('0x6')],_0x3dca('0x7')),'form':{'grant_type':_0x3dca('0x8'),'username':_0x1754d1['username'],'password':_0x1754d1[_0x3dca('0x8')]},'json':!![]};return rp(_0x19f703)['then'](function(_0x57264a){var _0xdea879={'method':'POST','uri':url[_0x3dca('0x5')](_0x1754d1[_0x3dca('0x9')],_0x3dca('0xa')),'body':{'type':_0x1754d1[_0x3dca('0xb')]||'message','channelId':_0x3dca('0xc'),'conversation':{'id':_0x26df5e[_0x3dca('0xd')]},'from':{'id':_0x26df5e[_0x3dca('0xe')],'name':_0x26df5e[_0x3dca('0xf')]},'recipient':{'id':_0x26df5e[_0x3dca('0x10')],'name':_0x26df5e[_0x3dca('0x11')]},'text':_0x1754d1['text'],'channelData':{}},'headers':{'Authorization':_0x3dca('0x12')+_0x57264a['access_token']},'json':!![]};if(_0x1754d1['project']){_0xdea879[_0x3dca('0x13')][_0x3dca('0x14')][_0x3dca('0x15')]=_0x1754d1[_0x3dca('0x16')];}if(_0x1754d1[_0x3dca('0x17')]=='1'){_0xdea879[_0x3dca('0x13')][_0x3dca('0x14')][_0x3dca('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x3dca('0x19')};}if(_0x1754d1[_0x3dca('0x1a')]){_0xdea879[_0x3dca('0x13')][_0x3dca('0x14')][_0x3dca('0x1b')]=_0x1754d1['custom_action'];if(_0x1754d1['custom_action_data']){_0xdea879[_0x3dca('0x13')][_0x3dca('0x14')][_0x3dca('0x1c')]=_0x1754d1[_0x3dca('0x1d')];}}logger[_0x3dca('0x1e')](JSON[_0x3dca('0x1f')](_0xdea879));return rp(_0xdea879);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/asr/index.js b/server/services/agi/scripts/tilde/asr/index.js index d760137..4020ff3 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcdef=['exports','./lib/api'];(function(_0x15178a,_0x54813f){var _0x51564f=function(_0x563255){while(--_0x563255){_0x15178a['push'](_0x15178a['shift']());}};_0x51564f(++_0x54813f);}(_0xcdef,0xb3));var _0xfcde=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xcdef[_0x19950b];return _0x3c6b41;};'use strict';var asr=require(_0xfcde('0x0'));module[_0xfcde('0x1')]=function(_0x583625,_0x27402e,_0xc4cfff,_0x290216){return asr(_0x583625,_0x27402e,_0xc4cfff,_0x290216);}; \ No newline at end of file +var _0x3cdf=['exports','./lib/api'];(function(_0x59ee41,_0xaf7db8){var _0x3ecd3e=function(_0x2f9291){while(--_0x2f9291){_0x59ee41['push'](_0x59ee41['shift']());}};_0x3ecd3e(++_0xaf7db8);}(_0x3cdf,0xe1));var _0xf3cd=function(_0x2e0dca,_0x45a901){_0x2e0dca=_0x2e0dca-0x0;var _0x31605b=_0x3cdf[_0x2e0dca];return _0x31605b;};'use strict';var asr=require(_0xf3cd('0x0'));module[_0xf3cd('0x1')]=function(_0x13a69b,_0x5c7796,_0x12be06,_0x45460b){return asr(_0x13a69b,_0x5c7796,_0x12be06,_0x45460b);}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/asr/lib/api.js b/server/services/agi/scripts/tilde/asr/lib/api.js index 0a52034..91ac48b 100644 --- a/server/services/agi/scripts/tilde/asr/lib/api.js +++ b/server/services/agi/scripts/tilde/asr/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7b8=['sha1','update','digest','hex','send','stringify','createReadStream','data','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','moment','crypto','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf7b8,0x1f0));var _0x8f7b=function(_0xdd9b59,_0x55e3a6){_0xdd9b59=_0xdd9b59-0x0;var _0x400743=_0xf7b8[_0xdd9b59];return _0x400743;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x8f7b('0x0'));var crypto=require(_0x8f7b('0x1'));var logger=require(_0x8f7b('0x2'))(_0x8f7b('0x3'));module[_0x8f7b('0x4')]=function(_0x32f0dd,_0xbeb033,_0x19b232,_0x4bbfe6){return new BPromise(function(_0x48c40c,_0x43623c){logger[_0x8f7b('0x5')]('Tilde\x20URI',_0x4bbfe6||_0x8f7b('0x6'));var _0x1871af=new WebSocket(_0x4bbfe6||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0xd3efe3='';var _0x21267c='0';var _0x14e9df='1';var _0x13d465='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x2dc1a7(_0x3085c7){var _0x146284=crypto[_0x8f7b('0x7')](_0x8f7b('0x8'));_0x146284[_0x8f7b('0x9')](_0x3085c7);return _0x146284[_0x8f7b('0xa')](_0x8f7b('0xb'));}function _0x4485ba(){try{logger[_0x8f7b('0x5')]('Open\x20Tilde\x20ASR\x20socket');var _0x31d8f2=moment()['unix']();var _0x8ab6ec=_0x2dc1a7(_0x31d8f2+_0xbeb033+_0x19b232);_0x1871af[_0x8f7b('0xc')](JSON[_0x8f7b('0xd')]({'appID':_0xbeb033,'timestamp':_0x31d8f2,'appKey':_0x8ab6ec}));var _0x4df5ea=fs[_0x8f7b('0xe')](_0x32f0dd);_0x4df5ea['on'](_0x8f7b('0xf'),function(_0x34a68a){_0x1871af[_0x8f7b('0xc')](_0x34a68a);});_0x4df5ea['on']('close',function(){_0x1871af[_0x8f7b('0xc')](_0x8f7b('0x10'));});}catch(_0x5c7a80){logger['error'](_0x8f7b('0x11'),JSON[_0x8f7b('0xd')](_0x5c7a80));_0x1871af[_0x8f7b('0x12')]();}}function _0xb90b17(_0x417e86){try{if(_0x417e86){var _0x20868a=JSON[_0x8f7b('0x13')](_0x417e86);switch(_0x20868a[_0x8f7b('0x14')]){case 0x0:if(_0x20868a[_0x8f7b('0x15')]){if(_0x20868a[_0x8f7b('0x15')][_0x8f7b('0x16')]){logger[_0x8f7b('0x5')](_0x8f7b('0x17'),JSON[_0x8f7b('0xd')](_0x20868a[_0x8f7b('0x15')][_0x8f7b('0x18')]));_0xd3efe3=_0x20868a['result'][_0x8f7b('0x18')][0x0][_0x8f7b('0x19')];_0x21267c=_0x20868a['result']['hypotheses'][0x0][_0x8f7b('0x1a')];_0x14e9df='0';_0x13d465=_0x8f7b('0x1b');_0x1871af['terminate']();}}break;case 0x1:logger[_0x8f7b('0x5')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x14e9df='1';_0x13d465=_0x8f7b('0x1c');break;case 0x2:logger['info'](_0x8f7b('0x1d'));_0x14e9df='2';_0x13d465=_0x8f7b('0x1d');break;case 0x9:logger[_0x8f7b('0x5')](_0x8f7b('0x1e'));_0x14e9df='9';_0x13d465='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0x8f7b('0x1f'));_0x14e9df='10';_0x13d465=_0x8f7b('0x1f');break;case 0xb:logger[_0x8f7b('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x14e9df='11';_0x13d465=_0x8f7b('0x20');}}}catch(_0x2ea716){logger[_0x8f7b('0x21')](_0x8f7b('0x22'),JSON[_0x8f7b('0xd')](_0x2ea716));_0x1871af[_0x8f7b('0x12')]();}}function _0x1d4be9(){logger[_0x8f7b('0x5')](_0x8f7b('0x23'));_0x48c40c({'transcript':_0xd3efe3,'confidence':_0x21267c,'status':_0x14e9df,'status_message':_0x13d465});}function _0x3843c2(_0x431569){logger[_0x8f7b('0x21')](_0x8f7b('0x24'));if(!_[_0x8f7b('0x25')](_0x431569)){logger[_0x8f7b('0x21')](_[_0x8f7b('0x26')](_0x431569)?JSON[_0x8f7b('0xd')](_0x431569):_0x431569);}}_0x1871af['on'](_0x8f7b('0x27'),_0x4485ba);_0x1871af['on'](_0x8f7b('0x28'),_0xb90b17);_0x1871af['on'](_0x8f7b('0x29'),_0x1d4be9);_0x1871af['on'](_0x8f7b('0x21'),_0x3843c2);});}; \ No newline at end of file +var _0x5191=['All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','lodash','crypto','../../../../../../config/logger','agi','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','data','close','EOS','error','stringify','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.'];(function(_0x3f2a70,_0x55a720){var _0x2f5b89=function(_0x29ef3a){while(--_0x29ef3a){_0x3f2a70['push'](_0x3f2a70['shift']());}};_0x2f5b89(++_0x55a720);}(_0x5191,0x12e));var _0x1519=function(_0x1da42f,_0x23dc53){_0x1da42f=_0x1da42f-0x0;var _0x458c83=_0x5191[_0x1da42f];return _0x458c83;};'use strict';var BPromise=require('bluebird');var _=require(_0x1519('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x1519('0x1'));var logger=require(_0x1519('0x2'))(_0x1519('0x3'));module['exports']=function(_0x1abe82,_0x38552c,_0x5725a0,_0x25a57e){return new BPromise(function(_0x3831eb,_0x3e4b96){logger['info'](_0x1519('0x4'),_0x25a57e||_0x1519('0x5'));var _0x3327b4=new WebSocket(_0x25a57e||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x1c70be='';var _0xd97851='0';var _0x22984f='1';var _0x2023e8='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x254e43(_0x1326fa){var _0x52856f=crypto[_0x1519('0x6')](_0x1519('0x7'));_0x52856f[_0x1519('0x8')](_0x1326fa);return _0x52856f[_0x1519('0x9')](_0x1519('0xa'));}function _0x51893e(){try{logger[_0x1519('0xb')](_0x1519('0xc'));var _0x902a91=moment()[_0x1519('0xd')]();var _0x398e70=_0x254e43(_0x902a91+_0x38552c+_0x5725a0);_0x3327b4[_0x1519('0xe')](JSON['stringify']({'appID':_0x38552c,'timestamp':_0x902a91,'appKey':_0x398e70}));var _0x454ad8=fs[_0x1519('0xf')](_0x1abe82);_0x454ad8['on'](_0x1519('0x10'),function(_0x46d685){_0x3327b4[_0x1519('0xe')](_0x46d685);});_0x454ad8['on'](_0x1519('0x11'),function(){_0x3327b4[_0x1519('0xe')](_0x1519('0x12'));});}catch(_0x429d87){logger[_0x1519('0x13')]('Tilde\x20ASR\x20send\x20error',JSON[_0x1519('0x14')](_0x429d87));_0x3327b4[_0x1519('0x15')]();}}function _0x23e5b7(_0x544868){try{if(_0x544868){var _0x283516=JSON[_0x1519('0x16')](_0x544868);switch(_0x283516[_0x1519('0x17')]){case 0x0:if(_0x283516[_0x1519('0x18')]){if(_0x283516[_0x1519('0x18')][_0x1519('0x19')]){logger['info'](_0x1519('0x1a'),JSON[_0x1519('0x14')](_0x283516[_0x1519('0x18')][_0x1519('0x1b')]));_0x1c70be=_0x283516[_0x1519('0x18')]['hypotheses'][0x0][_0x1519('0x1c')];_0xd97851=_0x283516[_0x1519('0x18')][_0x1519('0x1b')][0x0][_0x1519('0x1d')];_0x22984f='0';_0x2023e8='Success.';_0x3327b4[_0x1519('0x15')]();}}break;case 0x1:logger['info'](_0x1519('0x1e'));_0x22984f='1';_0x2023e8='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x1519('0xb')](_0x1519('0x1f'));_0x22984f='2';_0x2023e8=_0x1519('0x1f');break;case 0x9:logger[_0x1519('0xb')](_0x1519('0x20'));_0x22984f='9';_0x2023e8=_0x1519('0x20');break;case 0xa:logger['info']('Authentication\x20failed.');_0x22984f='10';_0x2023e8=_0x1519('0x21');break;case 0xb:logger[_0x1519('0xb')](_0x1519('0x22'));_0x22984f='11';_0x2023e8=_0x1519('0x22');}}}catch(_0x3b2dc0){logger['error'](_0x1519('0x23'),JSON[_0x1519('0x14')](_0x3b2dc0));_0x3327b4['terminate']();}}function _0x3fd393(){logger[_0x1519('0xb')](_0x1519('0x24'));_0x3831eb({'transcript':_0x1c70be,'confidence':_0xd97851,'status':_0x22984f,'status_message':_0x2023e8});}function _0x30e644(_0x19f8a8){logger['error'](_0x1519('0x25'));if(!_[_0x1519('0x26')](_0x19f8a8)){logger[_0x1519('0x13')](_[_0x1519('0x27')](_0x19f8a8)?JSON['stringify'](_0x19f8a8):_0x19f8a8);}}_0x3327b4['on'](_0x1519('0x28'),_0x51893e);_0x3327b4['on'](_0x1519('0x29'),_0x23e5b7);_0x3327b4['on'](_0x1519('0x11'),_0x3fd393);_0x3327b4['on']('error',_0x30e644);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/index.js b/server/services/agi/scripts/tilde/index.js index b8ba76c..cc97dc4 100644 --- a/server/services/agi/scripts/tilde/index.js +++ b/server/services/agi/scripts/tilde/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xccdc=['./asr','exports'];(function(_0x4a29a9,_0x58cd04){var _0x386570=function(_0x1d2d09){while(--_0x1d2d09){_0x4a29a9['push'](_0x4a29a9['shift']());}};_0x386570(++_0x58cd04);}(_0xccdc,0x1a6));var _0xcccd=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xccdc[_0x3ff085];return _0x2b68c3;};var asr=require(_0xcccd('0x0'));module[_0xcccd('0x1')]={'asr':asr}; \ No newline at end of file +var _0x7553=['./asr','exports'];(function(_0x2258c2,_0xf20066){var _0x5e6cf8=function(_0x449345){while(--_0x449345){_0x2258c2['push'](_0x2258c2['shift']());}};_0x5e6cf8(++_0xf20066);}(_0x7553,0x1bc));var _0x3755=function(_0x535345,_0x206b21){_0x535345=_0x535345-0x0;var _0x28c2b7=_0x7553[_0x535345];return _0x28c2b7;};var asr=require(_0x3755('0x0'));module[_0x3755('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 5785d0c..b382a3b 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0xf31767,_0x381746){var _0x24bd0c=function(_0x3b3472){while(--_0x3b3472){_0xf31767['push'](_0xf31767['shift']());}};_0x24bd0c(++_0x381746);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 65a3133..0b49cbd 100644 --- a/server/services/agi/vertices.js +++ b/server/services/agi/vertices.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb99=['TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','NOBEEP','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Trying\x20ispeech\x20TTS\x20%s','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','agentLogin','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','output','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','indexOf','toLowerCase','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','restAPI','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','bcc','subject','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','util','shelljs','moment','mustache','request-promise','agi','../../config/environment','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','prototype','getVariable','rpc','getVariableById','name','catch','getVoiceQueueById','then','getSquareProject','getSquareProjectById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','Intervals','%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','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','createSquareRecording','uniqueid','callerid','calleridname','context','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','getPause','getPauseById','agent','agentPause','agentLogout','internal','format','%s/%s@from-sip/n','LOCAL','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender','MALE','MP3','googleTTS','google_tts_language','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','sync','render','url','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','dialogflowV2_language','sestekNDA','ispeechTTS','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isArray','length','isPlainObject','saveRestApiResult','%s.%s','setVariable','split','replaceAll','getAndSetVariable','result','extra','maxRetry','retry','mrcpsynth','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','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','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','sesteknda','audiofile','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','maxdigit','toString','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s'];(function(_0x530cd1,_0x5d105f){var _0x263afb=function(_0xfcc2de){while(--_0xfcc2de){_0x530cd1['push'](_0x530cd1['shift']());}};_0x263afb(++_0x5d105f);}(_0xcb99,0x8b));var _0x9cb9=function(_0x3e5325,_0x55af33){_0x3e5325=_0x3e5325-0x0;var _0x5a1c63=_0xcb99[_0x3e5325];return _0x5a1c63;};'use strict';var fs=require('fs');var util=require(_0x9cb9('0x0'));var _=require('lodash');var sh=require(_0x9cb9('0x1'));var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0x9cb9('0x2'));var Mustache=require(_0x9cb9('0x3'));var rp=require(_0x9cb9('0x4'));var logger=require('../../config/logger')(_0x9cb9('0x5'));var config=require(_0x9cb9('0x6'));var scripts=require('./scripts');var FILES_PATH=_0x9cb9('0x7');var recursiveMapAttributes=['rawHeaders',_0x9cb9('0x8')];var verticesWithRetry=[_0x9cb9('0x9'),_0x9cb9('0xa'),_0x9cb9('0xb')];var AGIVertices=function(_0x82e3e,_0x124bd0,_0x106f17){this[_0x9cb9('0xc')]=_0x82e3e;this['rpc']=_0x124bd0;this['mailRpc']=_0x106f17;};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0xe')]=function(_0x1b4fa6,_0x5a0ac7){this[_0x9cb9('0xf')][_0x9cb9('0x10')](_0x1b4fa6)['then'](function(_0x4fb80c){_0x5a0ac7(null,_0x4fb80c?_0x4fb80c[_0x9cb9('0x11')]:![]);})[_0x9cb9('0x12')](function(_0x3382c8){_0x5a0ac7(_0x3382c8);});};AGIVertices[_0x9cb9('0xd')]['getVoiceQueue']=function(_0x255f8e,_0x37dc98){this[_0x9cb9('0xf')][_0x9cb9('0x13')](_0x255f8e)[_0x9cb9('0x14')](function(_0x252bef){_0x37dc98(null,_0x252bef?_0x252bef[_0x9cb9('0x11')]:![]);})[_0x9cb9('0x12')](function(_0x3975a5){_0x37dc98(_0x3975a5);});};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x15')]=function(_0x191199,_0x220ee8){this[_0x9cb9('0xf')][_0x9cb9('0x16')](_0x191199)[_0x9cb9('0x14')](function(_0x41e598){_0x220ee8(null,_0x41e598?_0x41e598[_0x9cb9('0x11')]:![]);})['catch'](function(_0x59fcae){_0x220ee8(_0x59fcae);});};AGIVertices[_0x9cb9('0xd')]['getSquareOdbc']=function(_0x5ddf77,_0x4e6abc){this[_0x9cb9('0xf')]['getSquareOdbcById'](_0x5ddf77)[_0x9cb9('0x14')](function(_0x3b1244){_0x4e6abc(null,_0x3b1244?_0x3b1244[_0x9cb9('0x17')]:![]);})[_0x9cb9('0x12')](function(_0x3633d0){_0x4e6abc(_0x3633d0);});};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x18')]=function(_0x1375e3,_0x20d210){this[_0x9cb9('0xf')][_0x9cb9('0x19')](_0x1375e3)[_0x9cb9('0x14')](function(_0x16cc17){_0x20d210(null,_0x16cc17?_0x16cc17[_0x9cb9('0x11')]:![]);})['catch'](function(_0x57fc41){_0x20d210(_0x57fc41);});};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x1a')]=function(_0x274ab3,_0x377e6f){this[_0x9cb9('0xf')][_0x9cb9('0x1b')](_0x274ab3)[_0x9cb9('0x14')](function(_0x110161){_0x377e6f(null,_0x110161?_0x110161[_0x9cb9('0x11')]:![]);})['catch'](function(_0x1f42b3){_0x377e6f(_0x1f42b3);});};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x1c')]=function(_0x40649c,_0x4db8a4){var _0xa1a575=this;this['rpc'][_0x9cb9('0x1d')](_0x40649c)[_0x9cb9('0x14')](function(_0x1ca96c){_0x4db8a4(null,_0x1ca96c?_0xa1a575[_0x9cb9('0x1e')](_0x1ca96c['save_name']):![]);})[_0x9cb9('0x12')](function(_0x3b7bba){_0x4db8a4(_0x3b7bba);});};AGIVertices[_0x9cb9('0xd')]['getMailAccount']=function(_0x3893c7,_0x5a68ac){this[_0x9cb9('0xf')][_0x9cb9('0x1f')](_0x3893c7)[_0x9cb9('0x14')](function(_0x2ed362){_0x5a68ac(null,_0x2ed362?_0x2ed362:![]);})[_0x9cb9('0x12')](function(_0x33ec8e){_0x5a68ac(_0x33ec8e);});};AGIVertices['prototype'][_0x9cb9('0x20')]=function(_0x2603a6,_0x123ada,_0x547ee8){this['mailRpc'][_0x9cb9('0x20')](_0x2603a6,_0x123ada)[_0x9cb9('0x14')](function(){_0x547ee8(null);})[_0x9cb9('0x12')](function(_0x5302f9){_0x547ee8(_0x5302f9);});};AGIVertices['prototype'][_0x9cb9('0x21')]=function(_0x395dae,_0x59a521){this[_0x9cb9('0xf')][_0x9cb9('0x22')](_0x395dae)[_0x9cb9('0x14')](function(_0x354c0f){if(_0x354c0f){if(_0x354c0f[_0x9cb9('0x23')]){_0x59a521(null,[_0x354c0f['interval']]);}else{_0x59a521(null,_[_0x9cb9('0x24')](_0x354c0f[_0x9cb9('0x25')],'interval'));}}else{_0x59a521(null,![]);}})[_0x9cb9('0x12')](function(_0x520ebf){_0x59a521(_0x520ebf);});};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x1e')]=function(_0x5206af){return util['format'](_0x9cb9('0x26'),FILES_PATH,_0x5206af);};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x27')]=function(_0x2595f9,_0x448e2c,_0x2dd463){odbc[_0x9cb9('0x28')](_0x2595f9,function(_0x55fa61){if(_0x55fa61){logger[_0x9cb9('0x29')](_0x9cb9('0x2a'),_0x55fa61);_0x2dd463(_0x55fa61);}else{logger[_0x9cb9('0x2b')](_0x9cb9('0x2c'));odbc[_0x9cb9('0x2d')](_0x448e2c,function(_0x2bbbea,_0x4ddbc2){if(_0x2bbbea){logger[_0x9cb9('0x2b')](_0x9cb9('0x2e'),_0x448e2c);_0x2dd463(_0x2bbbea);}else{logger[_0x9cb9('0x2b')](_0x9cb9('0x2f'),_0x448e2c);odbc[_0x9cb9('0x30')](function(_0x3ab4f3){if(_0x3ab4f3){logger[_0x9cb9('0x29')](_0x9cb9('0x31'),_0x3ab4f3);}_0x2dd463(null,_0x4ddbc2);});}});}});};AGIVertices[_0x9cb9('0xd')]['getSmsAccount']=function(_0x448113,_0x5c0811){this[_0x9cb9('0xf')]['getSmsAccountById'](_0x448113)[_0x9cb9('0x14')](function(_0x2f8c06){_0x5c0811(null,_0x2f8c06?_0x2f8c06:![]);})[_0x9cb9('0x12')](function(_0x1d9d54){_0x5c0811(_0x1d9d54);});};AGIVertices['prototype'][_0x9cb9('0x32')]=function(_0x4f9f9f,_0x9a4f8){this[_0x9cb9('0xf')][_0x9cb9('0x32')](_0x4f9f9f)[_0x9cb9('0x14')](function(_0x1ed0b3){_0x9a4f8(null,_0x1ed0b3);})['catch'](function(_0x26a2ff){_0x9a4f8(_0x26a2ff);});};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x33')]=function(_0x26fea4,_0x3df17f,_0xb7535){this[_0x9cb9('0xf')][_0x9cb9('0x33')]({'uniqueid':this[_0x9cb9('0xc')]['uniqueid'],'node':_0x26fea4[_0x9cb9('0x34')],'application':_0x26fea4[_0x9cb9('0x35')],'data':_0x3df17f||null,'project_name':this[_0x9cb9('0xc')][_0x9cb9('0x36')],'callerid':this[_0x9cb9('0xc')]['callerid']})[_0x9cb9('0x14')](function(_0x1f4314){if(_0xb7535){_0xb7535(null,_0x1f4314);}})[_0x9cb9('0x12')](function(_0x52c295){if(_0xb7535){_0xb7535(_0x52c295);}});};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x37')]=function(_0x22fba8,_0x4a6dc9,_0x12b06d,_0x2f72ca){this[_0x9cb9('0xf')][_0x9cb9('0x37')]({'uniqueid':this[_0x9cb9('0xc')][_0x9cb9('0x38')],'callerid':this['channel'][_0x9cb9('0x39')],'calleridname':this[_0x9cb9('0xc')][_0x9cb9('0x3a')],'context':this[_0x9cb9('0xc')][_0x9cb9('0x3b')],'extension':this[_0x9cb9('0xc')][_0x9cb9('0x3c')],'priority':this[_0x9cb9('0xc')][_0x9cb9('0x3d')],'accountcode':this[_0x9cb9('0xc')][_0x9cb9('0x3e')],'dnid':this[_0x9cb9('0xc')][_0x9cb9('0x3f')],'projectName':this['channel'][_0x9cb9('0x36')],'saveName':_0x4a6dc9,'filename':_0x22fba8['file']||_0x4a6dc9,'savePath':_0x12b06d})[_0x9cb9('0x14')](function(_0x23fece){_0x2f72ca(null,_0x23fece);})[_0x9cb9('0x12')](function(_0x5a7691){_0x2f72ca(_0x5a7691);});};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x40')]=function(_0x32d39f,_0x9da13e,_0x4d4a00,_0x507efe,_0x57475e){this['rpc']['createSquareMessage']({'uniqueid':this['channel'][_0x9cb9('0x38')],'body':_0x32d39f,'direction':_0x9da13e,'providerName':_0x4d4a00,'providerResponse':_0x507efe})[_0x9cb9('0x14')](function(_0x5ffd1e){if(_0x57475e){_0x57475e(null,_0x5ffd1e);}})['catch'](function(_0x26d944){if(_0x57475e){_0x57475e(_0x26d944);}});};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x41')]=function(_0xa29e91,_0x2ce626){this[_0x9cb9('0xf')][_0x9cb9('0x41')]({'firstName':_[_0x9cb9('0x42')](_0xa29e91['name'])||_[_0x9cb9('0x43')](_0xa29e91['name'])?_0x9cb9('0x44')+Math[_0x9cb9('0x45')]():_0xa29e91[_0x9cb9('0x11')],'lastName':_[_0x9cb9('0x42')](_0xa29e91['lastName'])||_['isNil'](_0xa29e91[_0x9cb9('0x46')])?null:_0xa29e91[_0x9cb9('0x46')],'phone':_0xa29e91[_0x9cb9('0x47')],'ListId':_0xa29e91['list_id'],'scheduledat':_0xa29e91[_0x9cb9('0x48')],'callbackUniqueid':this['channel'][_0x9cb9('0x38')],'tags':_0x9cb9('0x49'),'description':_0x9cb9('0x4a')+_0xa29e91[_0x9cb9('0x48')]['toString'](),'priority':_0xa29e91[_0x9cb9('0x4b')]})[_0x9cb9('0x14')](function(_0x5b0c80){_0x2ce626(null,_0x5b0c80);})['catch'](function(_0x50b115){_0x2ce626(_0x50b115);});};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x4c')]=function(_0x5456d4,_0x4fa419){this[_0x9cb9('0xf')][_0x9cb9('0x4d')](_0x5456d4)[_0x9cb9('0x14')](function(_0x146fec){_0x4fa419(null,_0x146fec?_0x146fec[_0x9cb9('0x11')]:![]);})['catch'](function(_0x2c9356){_0x4fa419(_0x2c9356);});};AGIVertices['prototype']['agentPause']=function(_0x32e651,_0x2e7be8,_0x18c0bc){var _0x4f28c2={'role':_0x9cb9('0x4e')};_0x4f28c2[_0x32e651]=this[_0x9cb9('0xc')][_0x9cb9('0x39')];this[_0x9cb9('0xf')][_0x9cb9('0x4f')](_0x4f28c2,_0x2e7be8,this[_0x9cb9('0xc')][_0x9cb9('0x38')])[_0x9cb9('0x14')](function(_0x2f6e63){_0x18c0bc(null,_[_0x9cb9('0x43')](_0x2f6e63)?![]:!![]);})[_0x9cb9('0x12')](function(_0x19f9ff){logger[_0x9cb9('0x29')](_0x19f9ff);_0x18c0bc(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x3e19ca,_0x41ff82){var _0x353bf9={'role':'agent'};_0x353bf9[_0x3e19ca]=this[_0x9cb9('0xc')][_0x9cb9('0x39')];this['rpc']['agentUnpause'](_0x353bf9)[_0x9cb9('0x14')](function(_0x22db43){_0x41ff82(null,_[_0x9cb9('0x43')](_0x22db43)?![]:!![]);})['catch'](function(_0x2f0ab3){logger['error'](_0x2f0ab3);_0x41ff82(null,![]);});};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x50')]=function(_0x274dcd,_0x2bf1a3){var _0x3b3897={'role':_0x9cb9('0x4e')};_0x3b3897[_0x274dcd]=this['channel']['callerid'];this[_0x9cb9('0xf')][_0x9cb9('0x50')](_0x3b3897)[_0x9cb9('0x14')](function(_0x45406f){_0x2bf1a3(null,_['isNil'](_0x45406f)?![]:!![]);})[_0x9cb9('0x12')](function(_0x36284f){logger[_0x9cb9('0x29')](_0x36284f);_0x2bf1a3(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x5a124f,_0x5c4539){var _0x2b487d={'role':'agent'};_0x2b487d[_0x5a124f]=this[_0x9cb9('0xc')][_0x9cb9('0x39')];var _0xb3f7ed=_0x5a124f!=_0x9cb9('0x51')?util[_0x9cb9('0x52')](_0x9cb9('0x53'),_0x9cb9('0x54'),this[_0x9cb9('0xc')][_0x9cb9('0x39')]):undefined;this['rpc']['agentLogin'](_0x2b487d,_0xb3f7ed)[_0x9cb9('0x14')](function(_0xab1aad){_0x5c4539(null,_['isNil'](_0xab1aad)?![]:!![]);})['catch'](function(_0x169f5d){logger[_0x9cb9('0x29')](_0x169f5d);_0x5c4539(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x4f6478,_0x4f939c){sh[_0x9cb9('0x55')](_['trim'](_0x4f6478),function(_0x276f13,_0x397ca9){var _0x56d148=_0x397ca9[_0x9cb9('0x56')](/(\r\n|\n|\r)/gm,'');_0x4f939c(null,_0x56d148);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x4dc453,_0x3cf34a){scripts[_0x9cb9('0x57')](_0x4dc453[_0x9cb9('0x58')],_0x4dc453[_0x9cb9('0x59')]||'text',_0x4dc453[_0x9cb9('0x5a')],_0x4dc453[_0x9cb9('0x5b')]||'en-US',_0x4dc453[_0x9cb9('0x5c')]||_0x9cb9('0x5d'),_0x4dc453['audioEncoding']||_0x9cb9('0x5e'))[_0x9cb9('0x14')](function(_0x1f9a1e){_0x3cf34a(null,_0x1f9a1e);})[_0x9cb9('0x12')](function(_0x168d05){_0x3cf34a(_0x168d05);});};AGIVertices[_0x9cb9('0xd')]['googleTTS']=function(_0x496990,_0x37c553){scripts[_0x9cb9('0x5f')](_0x496990[_0x9cb9('0x5a')],_0x496990[_0x9cb9('0x60')]||'en',0x1)[_0x9cb9('0x14')](function(_0x41a6da){_0x37c553(null,_0x41a6da);})[_0x9cb9('0x12')](function(_0x31445b){_0x37c553(_0x31445b);});};AGIVertices[_0x9cb9('0xd')]['restAPI']=function(_0x23a727,_0x1ef68b){var _0x3ceb83={'uri':_0x23a727['url'],'method':_0x23a727[_0x9cb9('0x61')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x23a727[_0x9cb9('0x62')])===_0x9cb9('0x63')&&parseInt(_0x23a727[_0x9cb9('0x62')])>=0x1?parseInt(_0x23a727['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x9cb9('0x64')]([_0x9cb9('0x65'),_0x9cb9('0x66')],_0x3ceb83[_0x9cb9('0x61')][_0x9cb9('0x67')]())){try{_0x3ceb83[_0x9cb9('0x68')]=_0x23a727[_0x9cb9('0x8')]?JSON[_0x9cb9('0x69')](_0x23a727[_0x9cb9('0x8')]):{};}catch(_0x24c046){logger[_0x9cb9('0x29')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x24c046);}}try{_0x3ceb83['headers']=_0x23a727['rawHeaders']?JSON[_0x9cb9('0x69')](_0x23a727[_0x9cb9('0x6a')]):{};}catch(_0x534e8c){logger[_0x9cb9('0x29')](_0x9cb9('0x6b'),_0x534e8c);}if(_0x23a727['computedVariables']){try{var _0x2ae5d7=require(_0x23a727['computedVariables'])[_0x9cb9('0x6c')](this,_0x3ceb83);_0x3ceb83['uri']=Mustache[_0x9cb9('0x6d')](_0x23a727[_0x9cb9('0x6e')],_0x2ae5d7,{},['$$','$$']);if(_0x3ceb83[_0x9cb9('0x6f')]){_0x3ceb83[_0x9cb9('0x6f')]=JSON[_0x9cb9('0x69')](Mustache['render'](JSON[_0x9cb9('0x70')](_0x3ceb83[_0x9cb9('0x6f')]),_0x2ae5d7,{},['$$','$$']));}if(_0x3ceb83[_0x9cb9('0x68')]){_0x3ceb83['body']=JSON['parse'](Mustache[_0x9cb9('0x6d')](JSON[_0x9cb9('0x70')](_0x3ceb83[_0x9cb9('0x68')]),_0x2ae5d7,{},['$$','$$']));}}catch(_0x288782){logger['error'](_0x9cb9('0x71'),_0x288782);}}rp(_0x3ceb83)[_0x9cb9('0x14')](function(_0x5141d5){var _0x28c5b8={'statusCode':_0x5141d5[_0x9cb9('0x72')]||0xc8,'statusMessage':_0x5141d5[_0x9cb9('0x73')]||'OK','headers':_0x5141d5[_0x9cb9('0x6f')]||{},'body':_0x5141d5['body']||{}};_0x1ef68b(null,_0x28c5b8);})[_0x9cb9('0x12')](function(_0x376e0f){var _0x1605aa={'statusCode':_0x376e0f[_0x9cb9('0x72')]||0x1f4,'statusMessage':_0x376e0f[_0x9cb9('0x74')]||_0x9cb9('0x75'),'headers':_0x376e0f[_0x9cb9('0x76')]['headers']||{},'body':_0x376e0f[_0x9cb9('0x76')]['body']||{}};_0x1ef68b(null,_0x1605aa);});};AGIVertices['prototype']['googleDialogflow']=function(_0x5341d1,_0x32130f){scripts['googleDialogflow'](this['channel'][_0x9cb9('0x38')],_0x5341d1[_0x9cb9('0x77')],_0x5341d1[_0x9cb9('0x5a')],_0x5341d1[_0x9cb9('0x78')]||'en')[_0x9cb9('0x14')](function(_0x393087){_0x32130f(null,_0x393087);})[_0x9cb9('0x12')](function(_0x3271ed){_0x32130f(_0x3271ed);});};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x79')]=function(_0x5971eb,_0xe48750){scripts[_0x9cb9('0x79')](this[_0x9cb9('0xc')][_0x9cb9('0x38')],_0x5971eb[_0x9cb9('0x7a')],_0x5971eb['client_email'],_0x5971eb['private_key'],_0x5971eb[_0x9cb9('0x5a')],_0x5971eb[_0x9cb9('0x7b')]||'en')['then'](function(_0x5e2feb){_0xe48750(null,_0x5e2feb);})['catch'](function(_0x5c3c4a){_0xe48750(_0x5c3c4a);});};AGIVertices['prototype'][_0x9cb9('0x7c')]=function(_0xf15cb8,_0x3419b6){scripts['sestekNDA'](this[_0x9cb9('0xc')],_0xf15cb8)[_0x9cb9('0x14')](function(_0x3e77eb){_0x3419b6(null,_0x3e77eb);})[_0x9cb9('0x12')](function(_0xe6dee8){_0x3419b6(_0xe6dee8);});};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x7d')]=function(_0xe4ff96,_0x2bfbd2){scripts[_0x9cb9('0x7d')](_0xe4ff96[_0x9cb9('0x77')],_0xe4ff96[_0x9cb9('0x5a')],_0xe4ff96['ispeech_tts_language']||_0x9cb9('0x7e'),_0xe4ff96[_0x9cb9('0x7f')])[_0x9cb9('0x14')](function(_0x45bcc5){_0x2bfbd2(null,_0x45bcc5);})['catch'](function(_0x4add7e){_0x2bfbd2(_0x4add7e);});};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x80')]=function(_0x17211d,_0x7e8994,_0x5c7786){scripts[_0x9cb9('0x80')](_0x7e8994,_0x17211d[_0x9cb9('0x77')],_0x17211d[_0x9cb9('0x81')]||_0x9cb9('0x7e'),this[_0x9cb9('0x82')](_0x17211d[_0x9cb9('0x83')])?_0x17211d[_0x9cb9('0x83')]:undefined)[_0x9cb9('0x14')](function(_0x4c5833){_0x5c7786(null,_0x4c5833);})[_0x9cb9('0x12')](function(_0x24bf4c){_0x5c7786(_0x24bf4c);});};AGIVertices['prototype'][_0x9cb9('0x84')]=function(_0x284ebf,_0x4b1a02){scripts[_0x9cb9('0x84')](_0x284ebf[_0x9cb9('0x85')],_0x284ebf['aws_secret_access_key'],_0x284ebf[_0x9cb9('0x86')],_0x284ebf[_0x9cb9('0x87')]||'Amy',_0x284ebf[_0x9cb9('0x5a')],_0x284ebf[_0x9cb9('0x88')]||_0x9cb9('0x5a'))[_0x9cb9('0x14')](function(_0x535cc7){_0x4b1a02(null,_0x535cc7);})['catch'](function(_0x59b2f0){_0x4b1a02(_0x59b2f0);});};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x89')]=function(_0x248766,_0x25cb1e){scripts[_0x9cb9('0x89')](this[_0x9cb9('0xc')][_0x9cb9('0x38')],_0x248766[_0x9cb9('0x85')],_0x248766[_0x9cb9('0x8a')],_0x248766[_0x9cb9('0x8b')],_0x248766[_0x9cb9('0x5a')],_0x248766[_0x9cb9('0x8c')])[_0x9cb9('0x14')](function(_0x516ff7){_0x25cb1e(null,_0x516ff7);})['catch'](function(_0x5b227f){_0x25cb1e(_0x5b227f);});};AGIVertices[_0x9cb9('0xd')]['googleASR']=function(_0x1b645e,_0x5b90c9,_0x3dc704){scripts[_0x9cb9('0x8d')](_0x5b90c9,_0x1b645e[_0x9cb9('0x77')],_0x1b645e[_0x9cb9('0x8e')]||_0x9cb9('0x7e'))['then'](function(_0x213566){_0x3dc704(null,_0x213566);})[_0x9cb9('0x12')](function(_0x151846){_0x3dc704(_0x151846);});};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x8f')]=function(_0x58c614,_0x54186b,_0x3d9888){scripts['tildeASR'](_0x54186b,_0x58c614[_0x9cb9('0x90')],_0x58c614[_0x9cb9('0x91')],_0x58c614[_0x9cb9('0x92')])['then'](function(_0x40c268){_0x3d9888(null,_0x40c268);})['catch'](function(_0x1fb563){_0x3d9888(_0x1fb563);});};AGIVertices[_0x9cb9('0xd')]['clear']=function(_0x13b2e9){var _0x30b6b1=_[_0x9cb9('0x64')](verticesWithRetry,_0x13b2e9[_0x9cb9('0x35')])?_0x13b2e9:_[_0x9cb9('0x93')](_0x13b2e9);for(var _0x19fa87 in _0x30b6b1){if(_0x30b6b1['hasOwnProperty'](_0x19fa87)){if(_0x30b6b1[_0x19fa87]&&_[_0x9cb9('0x94')](_0x30b6b1[_0x19fa87])){if(_['includes'](recursiveMapAttributes,_0x19fa87)){_0x30b6b1[_0x19fa87]=this[_0x9cb9('0x95')](_0x30b6b1[_0x19fa87]);}else{_0x30b6b1[_0x19fa87]=this[_0x9cb9('0x96')](_0x30b6b1[_0x19fa87]);}}}}return _0x30b6b1;};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x97')]=function(_0x4e836f){for(var _0xf025e1 in _0x4e836f){if(_0x4e836f[_0x9cb9('0x98')](_0xf025e1)){if(_['isPlainObject'](_0x4e836f[_0xf025e1])){this[_0x9cb9('0x97')](_0x4e836f[_0xf025e1]);}else if(_[_0x9cb9('0x99')](_0x4e836f[_0xf025e1])){for(var _0x17d3c3=0x0;_0x17d3c3<_0x4e836f[_0xf025e1][_0x9cb9('0x9a')];_0x17d3c3++){this['recursiveNodeIndex'](_0x4e836f[_0xf025e1][_0x17d3c3]);}}else if(_['isString'](_0x4e836f[_0xf025e1])){_0x4e836f[_0xf025e1]=this[_0x9cb9('0x96')](_0x4e836f[_0xf025e1]);}}}};AGIVertices[_0x9cb9('0xd')]['saveRestApiResult']=function(_0x3c12c2,_0x5ce461){for(var _0x1fd5f5 in _0x3c12c2){if(_0x3c12c2[_0x9cb9('0x98')](_0x1fd5f5)){if(_[_0x9cb9('0x9b')](_0x3c12c2[_0x1fd5f5])){if(!_['isEmpty'](_0x3c12c2[_0x1fd5f5])){this[_0x9cb9('0x9c')](_0x3c12c2[_0x1fd5f5],util[_0x9cb9('0x52')](_0x9cb9('0x9d'),_0x5ce461,_0x1fd5f5));}}else if(_[_0x9cb9('0x99')](_0x3c12c2[_0x1fd5f5])){for(var _0x49bb2e=0x0;_0x49bb2e<_0x3c12c2[_0x1fd5f5][_0x9cb9('0x9a')];_0x49bb2e++){this[_0x9cb9('0x9c')](_0x3c12c2[_0x1fd5f5][_0x49bb2e],util[_0x9cb9('0x52')](_0x9cb9('0x9d'),_0x5ce461,_0x1fd5f5+'['+_0x49bb2e+']'));}}else{if(!_['isNil'](_0x3c12c2[_0x1fd5f5])){this['channel'][_0x9cb9('0x9e')](util[_0x9cb9('0x52')](_0x9cb9('0x9d'),_0x5ce461,_0x1fd5f5),_0x3c12c2[_0x1fd5f5]);}}}}};AGIVertices['prototype'][_0x9cb9('0x95')]=function(_0x21f896){try{var _0x228176=JSON[_0x9cb9('0x69')](_0x21f896);this['recursiveNodeIndex'](_0x228176);return JSON[_0x9cb9('0x70')](_0x228176);}catch(_0x4ff442){return this[_0x9cb9('0x96')](_0x21f896);}};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x96')]=function(_0x256035){var _0x5028cb=_0x256035[_0x9cb9('0x9f')]('{');for(var _0x26cc0e=0x1;_0x26cc0e<_0x5028cb['length'];_0x26cc0e+=0x1){var _0x11b177=_0x5028cb[_0x26cc0e][_0x9cb9('0x9f')]('}');if(_0x11b177[_0x9cb9('0x9a')]>0x1){_0x256035=_0x256035[_0x9cb9('0xa0')]('{'+_0x11b177[0x0]+'}',this[_0x9cb9('0xc')][_0x9cb9('0xe')](_0x11b177[0x0])['extra']||_0x11b177[0x0]);}}if(_0x5028cb['length']===0x1){return _0x256035['toString']();}return this[_0x9cb9('0x96')](_0x256035);};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0xa1')]=function(_0x268025,_0x1e6e23){var _0x4369df=this[_0x9cb9('0xc')][_0x9cb9('0xe')](_0x268025);if(_0x4369df[_0x9cb9('0xa2')]===-0x1){return _0x4369df;}logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x1e6e23,_0x4369df[_0x9cb9('0xa3')]));return this[_0x9cb9('0xc')][_0x9cb9('0x9e')](_0x1e6e23,_0x4369df['extra']);};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x82')]=function(_0x407873){return _0x407873&&_0x407873!=='0'&&_0x407873!=='-1'&&_0x407873!=='';};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0xa4')]=function(_0x7b5eb7){this[_0x9cb9('0x33')][_0x9cb9('0x6c')](this,_0x7b5eb7,'-');_0x7b5eb7[_0x9cb9('0xa5')]=_0x7b5eb7[_0x9cb9('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0xa6')]=function(_0x2f01e2){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x2f01e2[_0x9cb9('0x34')]));if(!this[_0x9cb9('0x82')](_0x2f01e2[_0x9cb9('0x5a')])){return this[_0x9cb9('0xc')]['noop']('no\x20text\x20configured');}var _0x18f2d5='\x22'+_0x2f01e2['text']+'\x22';if(this[_0x9cb9('0x82')](_0x2f01e2[_0x9cb9('0x76')])){_0x18f2d5+=','+_0x2f01e2[_0x9cb9('0x76')];}var _0x6b56b6=this[_0x9cb9('0xc')][_0x9cb9('0x55')](_0x9cb9('0xa7'),_0x18f2d5);if(_0x6b56b6['result']===-0x1){return _0x6b56b6;}return this['channel'][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0xa9'),_0x18f2d5));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0xaa')]=function(_0x2c4639){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0xab'),_0x2c4639[_0x9cb9('0x34')]));if(!this[_0x9cb9('0x82')](_0x2c4639[_0x9cb9('0xac')])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0xad'));}var _0xaedb83=_0x2c4639[_0x9cb9('0xac')];if(this[_0x9cb9('0x82')](_0x2c4639['options'])){_0xaedb83+=','+_0x2c4639['options'];}var _0x3d16ad=this[_0x9cb9('0xc')][_0x9cb9('0x55')](_0x9cb9('0xae'),_0xaedb83);if(_0x3d16ad[_0x9cb9('0xa2')]===-0x1){return _0x3d16ad;}var _0x2c123f=this[_0x9cb9('0xa1')](_0x9cb9('0xaf'),'MRCP_RECOG_CONFIDENCE');if(_0x2c123f[_0x9cb9('0xa2')]===-0x1){return _0x2c123f;}var _0x55bdad=this[_0x9cb9('0xa1')](_0x9cb9('0xb0'),_0x9cb9('0xb1'));if(_0x55bdad['result']===-0x1){return _0x55bdad;}var _0x5a28a7=this[_0x9cb9('0xa1')](_0x9cb9('0xb2'),_0x9cb9('0xb3'));if(_0x5a28a7[_0x9cb9('0xa2')]===-0x1){return _0x5a28a7;}return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util['format'](_0x9cb9('0xb4'),_0xaedb83));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x5')]=function(_0x11f35b){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x11f35b[_0x9cb9('0x34')]));return this[_0x9cb9('0xc')][_0x9cb9('0x5')]([_0x11f35b['command'],_0x11f35b[_0x9cb9('0xb5')]]);};AGIVertices['prototype'][_0x9cb9('0xb6')]=function(_0x362cf4){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0xb7'),_0x362cf4[_0x9cb9('0x34')]));if(this[_0x9cb9('0x82')](_0x362cf4[_0x9cb9('0x62')])){logger[_0x9cb9('0x2b')](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x362cf4['timeout']));var _0x20700c=this[_0x9cb9('0xc')][_0x9cb9('0xb8')](_0x362cf4['timeout']);if(_0x20700c[_0x9cb9('0xa2')]===-0x1){return _0x20700c;}}return this[_0x9cb9('0xc')][_0x9cb9('0xb6')]();};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x49')]=function(_0x15291a){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0xb9'),_0x15291a[_0x9cb9('0x34')]));if(!this[_0x9cb9('0x82')](_0x15291a[_0x9cb9('0xba')])){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x15291a,'no\x20list\x20selected');}_0x15291a['scheduledAt']=moment();if(this[_0x9cb9('0x82')](_0x15291a[_0x9cb9('0xbb')])){_0x15291a[_0x9cb9('0x48')]=moment()[_0x9cb9('0xbc')](_0x15291a['delay'],_0x9cb9('0xbd'));}if(!this[_0x9cb9('0x82')](_0x15291a[_0x9cb9('0x4b')])){_0x15291a[_0x9cb9('0x4b')]=0x2;}this[_0x9cb9('0x41')][_0x9cb9('0x6c')](this,_0x15291a);return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util['format'](_0x9cb9('0xbe'),_0x15291a[_0x9cb9('0x47')],_0x15291a[_0x9cb9('0xba')],_0x15291a['scheduledAt']));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0xbf')]=function(_0x5646b7){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0xc0'),_0x5646b7[_0x9cb9('0x34')]));var _0xcccf7e=this[_0x9cb9('0xc')][_0x9cb9('0x55')](_0x5646b7[_0x9cb9('0xc1')],_0x5646b7[_0x9cb9('0x76')]);if(_0xcccf7e[_0x9cb9('0xa2')]===-0x1){return _0xcccf7e;}return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')]('Executed\x20command\x20%s\x20%s',_0x5646b7[_0x9cb9('0xc1')],_0x5646b7[_0x9cb9('0x76')]));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0xc2')]=function(_0x499778){logger['info'](util['format'](_0x9cb9('0xc3'),_0x499778[_0x9cb9('0x34')]));if(!this[_0x9cb9('0x82')](_0x499778[_0x9cb9('0x5a')])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0xc4'));}var _0x169b51='\x22'+_0x499778[_0x9cb9('0x5a')]+'\x22';if(this[_0x9cb9('0x82')](_0x499778[_0x9cb9('0x76')])){_0x169b51+=','+_0x499778[_0x9cb9('0x76')];}var _0x1200c3=this[_0x9cb9('0xc')][_0x9cb9('0x55')](_0x9cb9('0xa7'),_0x169b51);if(_0x1200c3[_0x9cb9('0xa2')]===-0x1){return _0x1200c3;}return this['channel'][_0x9cb9('0xa8')](util['format'](_0x9cb9('0xa9'),_0x169b51));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0xc5')]=function(_0x1ad3b1){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0xc6'),_0x1ad3b1[_0x9cb9('0x34')]));if(!this[_0x9cb9('0x82')](_0x1ad3b1[_0x9cb9('0x5a')])){return this['channel'][_0x9cb9('0xa8')](_0x9cb9('0xc4'));}var _0x3954cb='\x22'+_0x1ad3b1[_0x9cb9('0x5a')]+'\x22';if(this[_0x9cb9('0x82')](_0x1ad3b1['options'])){_0x3954cb+=','+_0x1ad3b1[_0x9cb9('0x76')];}var _0x4bc7ad=this[_0x9cb9('0xc')][_0x9cb9('0x55')](_0x9cb9('0xa7'),_0x3954cb);if(_0x4bc7ad[_0x9cb9('0xa2')]===-0x1){return _0x4bc7ad;}return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')]('Executed\x20command\x20MRCPSynth\x20%s',_0x3954cb));};AGIVertices[_0x9cb9('0xd')]['lumenvoxasr']=function(_0x4d1ec1){logger[_0x9cb9('0x2b')](util['format'](_0x9cb9('0xc7'),_0x4d1ec1[_0x9cb9('0x34')]));if(!this[_0x9cb9('0x82')](_0x4d1ec1[_0x9cb9('0xac')])){return this[_0x9cb9('0xc')]['noop'](_0x9cb9('0xad'));}var _0x4d1c8d=_0x4d1ec1[_0x9cb9('0xac')];if(this[_0x9cb9('0x82')](_0x4d1ec1[_0x9cb9('0x76')])){_0x4d1c8d+=','+_0x4d1ec1[_0x9cb9('0x76')];}var _0x1d1c63=this[_0x9cb9('0xc')]['exec'](_0x9cb9('0xae'),_0x4d1c8d);if(_0x1d1c63[_0x9cb9('0xa2')]===-0x1){return _0x1d1c63;}var _0x342288=this[_0x9cb9('0xa1')](_0x9cb9('0xaf'),_0x9cb9('0xc8'));if(_0x342288[_0x9cb9('0xa2')]===-0x1){return _0x342288;}var _0x16fbe2=this['getAndSetVariable'](_0x9cb9('0xb0'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x16fbe2[_0x9cb9('0xa2')]===-0x1){return _0x16fbe2;}var _0x181636=this['getAndSetVariable'](_0x9cb9('0xb2'),_0x9cb9('0xc9'));if(_0x181636[_0x9cb9('0xa2')]===-0x1){return _0x181636;}return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util['format'](_0x9cb9('0xb4'),_0x4d1c8d));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0xca')]=function(_0x18c62c){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x18c62c[_0x9cb9('0x34')]));if(!this[_0x9cb9('0x82')](_0x18c62c[_0x9cb9('0xac')])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0xad'));}var _0x567e2a=_0x18c62c['grammar'];if(this['isConfigured'](_0x18c62c[_0x9cb9('0x76')])){_0x567e2a+=','+_0x18c62c[_0x9cb9('0x76')];}var _0xa0ec41=this[_0x9cb9('0xc')][_0x9cb9('0x55')](_0x9cb9('0xae'),_0x567e2a);if(_0xa0ec41[_0x9cb9('0xa2')]===-0x1){return _0xa0ec41;}var _0x44fcce=this[_0x9cb9('0xa1')](_0x9cb9('0xaf'),_0x9cb9('0xcb'));if(_0x44fcce[_0x9cb9('0xa2')]===-0x1){return _0x44fcce;}var _0x3c1a63=this[_0x9cb9('0xa1')](_0x9cb9('0xb0'),_0x9cb9('0xcc'));if(_0x3c1a63[_0x9cb9('0xa2')]===-0x1){return _0x3c1a63;}var _0x3dec36=this[_0x9cb9('0xa1')](_0x9cb9('0xb2'),'SESTEK_ASR_INSTANCE');if(_0x3dec36['result']===-0x1){return _0x3dec36;}return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0xb4'),_0x567e2a));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0xcd')]=function(_0xbff189){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0xce'),_0xbff189[_0x9cb9('0x34')]));if(!this['isConfigured'](_0xbff189[_0x9cb9('0xcf')])){return this['channel'][_0x9cb9('0x29')](_0xbff189,_0x9cb9('0xd0'));}var _0x24dae4=this[_0x9cb9('0xd1')]['sync'](this,_0xbff189[_0x9cb9('0xcf')]);if(!_0x24dae4){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0xbff189,_0x9cb9('0xd2'));}if(!this[_0x9cb9('0x82')](_0xbff189[_0x9cb9('0x2d')])){return this[_0x9cb9('0xc')]['error'](_0xbff189,'no\x20query\x20configured');}var _0x3fe35f=_0xbff189[_0x9cb9('0x2d')][_0x9cb9('0x56')](/(\r\n|\n|\r)/gm,'\x20');this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0xd3'),_0x3fe35f));var _0x4d0b91=this[_0x9cb9('0x27')][_0x9cb9('0x6c')](this,_0x24dae4,_0x3fe35f);this[_0x9cb9('0x33')][_0x9cb9('0x6c')](this,_0xbff189,_0x3fe35f);if(!this['isConfigured'](_0xbff189[_0x9cb9('0xd4')])){return this[_0x9cb9('0xc')]['noop'](_0x9cb9('0xd5'));}var _0x49ae6f=this[_0x9cb9('0xe')]['sync'](this,_0xbff189[_0x9cb9('0xd4')]);if(!_0x49ae6f){return this[_0x9cb9('0xc')]['error'](_0xbff189,_0x9cb9('0xd6'));}var _0xf3dc1d=this;_0x4d0b91[_0x9cb9('0xd7')](function(_0x3f2c73,_0x89a724){Object[_0x9cb9('0xd8')](_0x3f2c73)['forEach'](function(_0x1b32a5){_0xf3dc1d[_0x9cb9('0xc')][_0x9cb9('0x9e')](util['format'](_0x9cb9('0xd9'),_0x49ae6f,_0x89a724,_0x1b32a5),_0x3f2c73[_0x1b32a5]);});});this[_0x9cb9('0xc')]['setVariable'](util[_0x9cb9('0x52')](_0x9cb9('0xda'),_0x49ae6f),_0x4d0b91['length']);return this['channel'][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0xdb'),_0x49ae6f));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0xdc')]=function(_0x3817b0){logger[_0x9cb9('0xdd')](util[_0x9cb9('0x52')](_0x9cb9('0xde'),_0x3817b0['label']));if(!this['isConfigured'](_0x3817b0[_0x9cb9('0xdf')])){return this[_0x9cb9('0xc')]['error'](_0x3817b0,'no\x20user\x20selected');}var _0x29bbe0=this[_0x9cb9('0x18')][_0x9cb9('0x6c')](this,_0x3817b0['sip_id']);if(!_0x29bbe0){return this['channel'][_0x9cb9('0x29')](_0x3817b0,'no\x20user\x20found');}var _0x4ab451=this['channel'][_0x9cb9('0x55')](_0x9cb9('0xe0'),[util[_0x9cb9('0x52')]('SIP/%s',_0x29bbe0),_0x3817b0[_0x9cb9('0x62')],_0x3817b0[_0x9cb9('0xe1')],_0x3817b0[_0x9cb9('0x6e')]]);if(_0x4ab451[_0x9cb9('0xa2')]===-0x1){return _0x4ab451;}return this['channel'][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0xe2'),_0x9cb9('0xe0')));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0xe3')]=function(_0x593f2a){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0xe4'),_0x593f2a[_0x9cb9('0x34')]));if(!this['isConfigured'](_0x593f2a['key'])){return this['channel'][_0x9cb9('0xa8')](_0x9cb9('0xe5'));}if(!this[_0x9cb9('0x82')](_0x593f2a[_0x9cb9('0x5a')])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0xc4'));}this[_0x9cb9('0xc')][_0x9cb9('0xe6')]=!![];this[_0x9cb9('0x33')](_0x593f2a);this[_0x9cb9('0x40')](_0x593f2a[_0x9cb9('0x5a')],'in','','');this[_0x9cb9('0xc')]['noop'](util[_0x9cb9('0x52')](_0x9cb9('0xe7'),_0x593f2a[_0x9cb9('0x5a')]));var _0x2e33e3=this['googleDialogflow'][_0x9cb9('0x6c')](this,_0x593f2a);if(_0x2e33e3){for(var _0x12b08a in _0x2e33e3){if(_0x2e33e3[_0x9cb9('0x98')](_0x12b08a)){this[_0x9cb9('0xc')][_0x9cb9('0x9e')](util['format'](_0x9cb9('0xe8'),_0x12b08a[_0x9cb9('0x67')]()),_0x2e33e3[_0x12b08a]);}}this[_0x9cb9('0x40')](_0x2e33e3[_0x9cb9('0xe9')],_0x9cb9('0xea'),_0x9cb9('0xe3'),'');return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')]('Dialogflow\x20Result\x20%s',_0x2e33e3['speech']));}return this['channel'][_0x9cb9('0x29')](_0x593f2a,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x9cb9('0xd')]['dialogflowV2']=function(_0x382b75){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x382b75['label']));if(!this['isConfigured'](_0x382b75[_0x9cb9('0x7a')])){return this[_0x9cb9('0xc')]['noop'](_0x9cb9('0xeb'));}if(!this['isConfigured'](_0x382b75[_0x9cb9('0xec')])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0xed'));}if(!this['isConfigured'](_0x382b75['private_key'])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0xee'));}if(!this[_0x9cb9('0x82')](_0x382b75[_0x9cb9('0x7b')])){return this['channel']['noop'](_0x9cb9('0xef'));}if(!this[_0x9cb9('0x82')](_0x382b75[_0x9cb9('0x5a')])){return this['channel']['noop'](_0x9cb9('0xc4'));}this[_0x9cb9('0xc')][_0x9cb9('0xe6')]=!![];this[_0x9cb9('0x33')](_0x382b75);this[_0x9cb9('0x40')](_0x382b75[_0x9cb9('0x5a')],'in','','');this[_0x9cb9('0xc')]['noop'](util['format'](_0x9cb9('0xf0'),_0x382b75[_0x9cb9('0x5a')]));var _0x26ed86=this[_0x9cb9('0x79')]['sync'](this,_0x382b75);if(_0x26ed86){for(var _0x48149e in _0x26ed86){if(_0x26ed86[_0x9cb9('0x98')](_0x48149e)){if(_0x48149e!==_0x9cb9('0xf1')){this[_0x9cb9('0xc')][_0x9cb9('0x9e')](util[_0x9cb9('0x52')](_0x9cb9('0xe8'),_0x48149e['toUpperCase']()),_0x26ed86[_0x48149e]);}}}this[_0x9cb9('0x40')](_0x26ed86[_0x9cb9('0xe9')],'out',_0x9cb9('0xf2'),_0x26ed86[_0x9cb9('0xf1')]);return this['channel'][_0x9cb9('0xa8')](util['format'](_0x9cb9('0xf3'),_0x26ed86[_0x9cb9('0xe9')]));}return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x382b75,_0x9cb9('0xf4'));};AGIVertices[_0x9cb9('0xd')]['sesteknda']=function(_0x4480eb){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0xf5'),_0x4480eb[_0x9cb9('0x34')]));if(!this[_0x9cb9('0x82')](_0x4480eb['ndauth_url'])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0xf6'));}if(!this[_0x9cb9('0x82')](_0x4480eb[_0x9cb9('0xf7')])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0xf8'));}if(!this['isConfigured'](_0x4480eb['password'])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0xf9'));}if(!this[_0x9cb9('0x82')](_0x4480eb[_0x9cb9('0xfa')])){return this[_0x9cb9('0xc')]['noop'](_0x9cb9('0xc4'));}this[_0x9cb9('0xc')][_0x9cb9('0xe6')]=!![];this[_0x9cb9('0x33')](_0x4480eb);this[_0x9cb9('0x40')](_0x4480eb[_0x9cb9('0x5a')],'in','','');this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0xfb'),_0x4480eb['text']));var _0x52cd7f=this[_0x9cb9('0x7c')][_0x9cb9('0x6c')](this,_0x4480eb);if(_0x52cd7f){for(var _0x1deda3 in _0x52cd7f){if(_0x52cd7f['hasOwnProperty'](_0x1deda3)){this[_0x9cb9('0xc')]['setVariable'](util[_0x9cb9('0x52')]('SESTEK_NDA_%s',_0x1deda3[_0x9cb9('0x67')]()),_0x52cd7f[_0x1deda3]);}}this[_0x9cb9('0x40')](_0x52cd7f[_0x9cb9('0xe9')],_0x9cb9('0xea'),_0x9cb9('0xfc'),'');if(_0x52cd7f[_0x9cb9('0xfd')]){this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x52cd7f[_0x9cb9('0xfd')]));var _0x4f3880=this[_0x9cb9('0xc')][_0x9cb9('0xfe')](_0x52cd7f[_0x9cb9('0xfd')]);try{fs[_0x9cb9('0xff')](_0x52cd7f[_0x9cb9('0xfd')]+_0x9cb9('0x100'));}catch(_0x17079f){logger[_0x9cb9('0x29')](_0x17079f);}return _0x4f3880;}else{return this['channel'][_0x9cb9('0xa8')](util['format']('SestekNDA\x20Result\x20%s',_0x52cd7f['speech']));}}return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x4480eb,_0x9cb9('0x101'));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x102')]=function(_0x638f65){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')]('Enter\x20in\x20END\x20(%s)\x20block',_0x638f65['label']));return this['channel'][_0x9cb9('0xa8')]('end');};AGIVertices[_0x9cb9('0xd')]['ext_dial']=function(_0x3d377e){logger[_0x9cb9('0x2b')](util['format'](_0x9cb9('0x103'),_0x3d377e[_0x9cb9('0x34')]));var _0x2338f6='';if(_0x3d377e[_0x9cb9('0x104')]){if(!this[_0x9cb9('0x82')](_0x3d377e['trunk_id'])){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x3d377e,_0x9cb9('0x105'));}else{var _0x1b036b=parseInt(_0x3d377e[_0x9cb9('0x104')],0xa);if(isNaN(_0x1b036b)){_0x2338f6=_0x3d377e[_0x9cb9('0x104')];}else{_0x2338f6=this[_0x9cb9('0x1a')][_0x9cb9('0x6c')](this,_0x3d377e[_0x9cb9('0x104')]);if(!_0x2338f6){return this['channel'][_0x9cb9('0x29')](_0x3d377e,_0x9cb9('0x106'));}}}}else if(_0x3d377e[_0x9cb9('0x107')]){_0x2338f6=_0x3d377e[_0x9cb9('0x107')];}else{return this['channel'][_0x9cb9('0x29')](_0x3d377e,_0x9cb9('0x105'));}var _0x5a7616=this[_0x9cb9('0xc')][_0x9cb9('0x55')](_0x9cb9('0xe0'),[util[_0x9cb9('0x52')](_0x9cb9('0x108'),_0x2338f6,_0x3d377e[_0x9cb9('0x47')]),_0x3d377e['timeout'],_0x3d377e[_0x9cb9('0xe1')],_0x3d377e[_0x9cb9('0x6e')]]);if(_0x5a7616[_0x9cb9('0xa2')]===-0x1){return _0x5a7616;}return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')]('Executed\x20command\x20%s',_0x9cb9('0xe0')));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x109')]=function(_0x2a7657){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x10a'),_0x2a7657[_0x9cb9('0x34')]));return this[_0x9cb9('0xc')][_0x9cb9('0xa8')]('finally');};AGIVertices['prototype'][_0x9cb9('0xa')]=function(_0x1b1ab7){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x10b'),_0x1b1ab7[_0x9cb9('0x34')]));if(_0x1b1ab7['retry']===0x0){return this[_0x9cb9('0xa4')](_0x1b1ab7);}_0x1b1ab7['retry']-=0x1;if(!this[_0x9cb9('0x82')](_0x1b1ab7[_0x9cb9('0x10c')])){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x1b1ab7,_0x9cb9('0x10d'));}var _0x1a4ee9=this[_0x9cb9('0x1c')]['sync'](this,_0x1b1ab7[_0x9cb9('0x10c')]);if(!_0x1a4ee9){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x1b1ab7,_0x9cb9('0x10e'));}if(!this['isConfigured'](_0x1b1ab7[_0x9cb9('0xd4')])){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x9cb9('0xd5'));}var _0x45d62d=this[_0x9cb9('0xc')]['getData'](_0x1a4ee9,_0x1b1ab7[_0x9cb9('0x10f')],_0x1b1ab7[_0x9cb9('0x110')]);var _0x2daa2c=_0x45d62d[_0x9cb9('0xa2')]?_0x45d62d[_0x9cb9('0xa2')][_0x9cb9('0x111')]():'';logger[_0x9cb9('0x2b')](_0x9cb9('0x112'),JSON['stringify'](_0x45d62d));if(_0x45d62d['result']===-0x1){this['createSquareDetailsReport'][_0x9cb9('0x6c')](this,_0x1b1ab7,_0x2daa2c);return _0x45d62d;}else if(_0x45d62d[_0x9cb9('0xa3')]===_0x9cb9('0x62')){_0x45d62d[_0x9cb9('0xa2')]=_0x2daa2c[_0x9cb9('0x9a')]>=parseInt(_0x1b1ab7[_0x9cb9('0x113')])?'x':'i';}else{_0x45d62d[_0x9cb9('0xa2')]=_0x2daa2c[_0x9cb9('0x9a')]>=parseInt(_0x1b1ab7['mindigit'])&&_0x2daa2c[_0x9cb9('0x9a')]<=parseInt(_0x1b1ab7[_0x9cb9('0x110')])?'x':'i';}var _0x533438=this['getVariable'][_0x9cb9('0x6c')](this,_0x1b1ab7['variable_id']);if(!_0x533438){return this['channel']['error'](_0x1b1ab7,'no\x20variable\x20found');}this[_0x9cb9('0xc')][_0x9cb9('0x9e')](_0x533438,_0x2daa2c);if(this[_0x9cb9('0x82')](_0x1b1ab7[_0x9cb9('0x114')])){var _0x3e4fdb=parseInt(_0x1b1ab7[_0x9cb9('0x114')],0xa);var _0xb18782=rs[_0x9cb9('0x115')]({'charset':'*','length':_0x3e4fdb});var _0x2ba0d3=_0x2daa2c[_0x9cb9('0x9a')];if(_0x2ba0d3>0x0){if(_0x2ba0d3>_0x3e4fdb){this[_0x9cb9('0x33')][_0x9cb9('0x6c')](this,_0x1b1ab7,_0x1b1ab7[_0x9cb9('0x116')]===_0x9cb9('0x117')?_0xb18782+_0x2daa2c[_0x9cb9('0x118')](_0x3e4fdb):_0x2daa2c['substr'](0x0,_0x2ba0d3-_0x3e4fdb)+_0xb18782);}else{this[_0x9cb9('0x33')][_0x9cb9('0x6c')](this,_0x1b1ab7,rs[_0x9cb9('0x115')]({'charset':'*','length':_0x2ba0d3}));}}else{this[_0x9cb9('0x33')]['sync'](this,_0x1b1ab7,'');}}else{this[_0x9cb9('0x33')]['sync'](this,_0x1b1ab7,_0x2daa2c);}return _0x45d62d;};AGIVertices['prototype']['getsecretdigits']=function(_0x3be036){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x119'),_0x3be036['label']));return this['getdigits'](_0x3be036);};AGIVertices['prototype']['goal']=function(_0x5a7393){logger[_0x9cb9('0x2b')](util['format'](_0x9cb9('0x11a'),_0x5a7393[_0x9cb9('0x34')]));this[_0x9cb9('0x33')][_0x9cb9('0x6c')](this,_0x5a7393,_0x5a7393[_0x9cb9('0x11b')]);return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x11c'),_0x5a7393[_0x9cb9('0x11b')]));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x11d')]=function(_0x1551af){logger[_0x9cb9('0x2b')](util['format'](_0x9cb9('0x11e'),_0x1551af[_0x9cb9('0x34')]));if(!this[_0x9cb9('0x82')](_0x1551af[_0x9cb9('0x85')])||!this[_0x9cb9('0x82')](_0x1551af['aws_secret_access_key'])){return this[_0x9cb9('0xc')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x1551af[_0x9cb9('0x5a')])){return this['channel'][_0x9cb9('0xa8')](_0x9cb9('0xc4'));}this['channel'][_0x9cb9('0xa8')](util['format'](_0x9cb9('0x11f'),_0x1551af[_0x9cb9('0x5a')]));var _0x1bad53=this[_0x9cb9('0x84')][_0x9cb9('0x6c')](this,_0x1551af);if(_0x1bad53){this['channel'][_0x9cb9('0xa8')](util['format'](_0x9cb9('0x120'),_0x1bad53));var _0x126e76=this[_0x9cb9('0xc')][_0x9cb9('0xfe')](_0x1bad53);try{fs[_0x9cb9('0xff')](_0x1bad53+_0x9cb9('0x100'));}catch(_0x201768){logger[_0x9cb9('0x29')](_0x201768);}return _0x126e76;}return this['channel'][_0x9cb9('0x29')](_0x1551af,_0x9cb9('0x121'));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x122')]=function(_0x8e6b4c){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x123'),_0x8e6b4c[_0x9cb9('0x34')]));if(!this[_0x9cb9('0x82')](_0x8e6b4c[_0x9cb9('0x85')])||!this[_0x9cb9('0x82')](_0x8e6b4c[_0x9cb9('0x8a')])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0x124'));}if(!this[_0x9cb9('0x82')](_0x8e6b4c[_0x9cb9('0x8c')])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')]('no\x20bot\x20name\x20configured');}if(!this[_0x9cb9('0x82')](_0x8e6b4c[_0x9cb9('0x5a')])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0xc4'));}this['channel'][_0x9cb9('0xe6')]=!![];this['createSquareDetailsReport'](_0x8e6b4c);this['createSquareMessage'](_0x8e6b4c['text'],'in','','');this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')]('Trying\x20Amazon\x20Lex:\x20%s',_0x8e6b4c[_0x9cb9('0x5a')]));var _0x2ec631=this['awsLex'][_0x9cb9('0x6c')](this,_0x8e6b4c);if(_0x2ec631){for(var _0x25f2c9 in _0x2ec631){if(_0x2ec631[_0x9cb9('0x98')](_0x25f2c9)&&_[_0x9cb9('0x94')](_0x2ec631[_0x25f2c9])){this[_0x9cb9('0xc')][_0x9cb9('0x9e')](util[_0x9cb9('0x52')](_0x9cb9('0x125'),_0x25f2c9[_0x9cb9('0x67')]()),_0x2ec631[_0x25f2c9]);}}if(_[_0x9cb9('0x43')](_0x2ec631[_0x9cb9('0x74')])){return this['channel'][_0x9cb9('0xa8')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this['createSquareMessage'](_0x2ec631['message'],_0x9cb9('0xea'),_0x9cb9('0x126'),'');return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x127'),_0x2ec631['message']));}}return this['channel'][_0x9cb9('0x29')](_0x8e6b4c,_0x9cb9('0x128'));};AGIVertices['prototype'][_0x9cb9('0x129')]=function(_0x3fed1c){logger['info'](util[_0x9cb9('0x52')](_0x9cb9('0x12a'),_0x3fed1c['label'],_0x3fed1c[_0x9cb9('0x62')]));if(!this[_0x9cb9('0x82')](_0x3fed1c[_0x9cb9('0x77')])){return this['channel'][_0x9cb9('0xa8')](_0x9cb9('0xe5'));}var _0x431797=_0x9cb9('0x12b');var _0x557d29=util[_0x9cb9('0x52')](_0x9cb9('0x12c'),FILES_PATH,rs['generate'](0x4));var _0x31f570=util['format'](_0x9cb9('0x9d'),_0x557d29,_0x431797);var _0x28e268=!![];if(_0x3fed1c[_0x9cb9('0x12d')]==='NOBEEP'){_0x28e268=![];}var _0x282393=this[_0x9cb9('0xc')][_0x9cb9('0x12e')](_0x557d29,_0x431797,_0x3fed1c[_0x9cb9('0x12f')],_0x3fed1c['timeout'],undefined,_0x28e268);if(_0x282393[_0x9cb9('0xa2')]!==-0x1){this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x130'),_0x31f570));var _0x19c712=this[_0x9cb9('0x8d')]['sync'](this,_0x3fed1c,_0x31f570);if(_0x19c712){for(var _0x2c55a5 in _0x19c712){if(_0x19c712[_0x9cb9('0x98')](_0x2c55a5)){this['channel'][_0x9cb9('0x9e')](util[_0x9cb9('0x52')](_0x9cb9('0x131'),_0x2c55a5['toUpperCase']()),_0x19c712[_0x2c55a5]);}}return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x132'),JSON[_0x9cb9('0x70')](_0x19c712)));}}return _0x282393;};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x133')]=function(_0x525e93){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x134'),_0x525e93[_0x9cb9('0x34')]));if(!this[_0x9cb9('0x82')](_0x525e93['appid'])){return this['channel'][_0x9cb9('0xa8')](_0x9cb9('0x135'));}if(!this[_0x9cb9('0x82')](_0x525e93[_0x9cb9('0x91')])){return this['channel'][_0x9cb9('0xa8')](_0x9cb9('0x136'));}var _0x3b05e='wav';var _0x3e047a=util[_0x9cb9('0x52')](_0x9cb9('0x12c'),FILES_PATH,rs[_0x9cb9('0x115')](0x4));var _0x1276fd=util[_0x9cb9('0x52')](_0x9cb9('0x9d'),_0x3e047a,_0x3b05e);var _0x34ff79=!![];if(_0x525e93['beep']==='NOBEEP'){_0x34ff79=![];}var _0x64db3a=this[_0x9cb9('0xc')][_0x9cb9('0x12e')](_0x3e047a,_0x3b05e,_0x525e93[_0x9cb9('0x12f')],_0x525e93['timeout'],undefined,_0x34ff79);if(_0x64db3a[_0x9cb9('0xa2')]!==-0x1){this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util['format'](_0x9cb9('0x137'),_0x1276fd));var _0x1b7794=this['tildeASR'][_0x9cb9('0x6c')](this,_0x525e93,_0x1276fd);if(_0x1b7794){for(var _0x8e6c4a in _0x1b7794){if(_0x1b7794[_0x9cb9('0x98')](_0x8e6c4a)){this['channel'][_0x9cb9('0x9e')](util[_0x9cb9('0x52')](_0x9cb9('0x138'),_0x8e6c4a[_0x9cb9('0x67')]()),_0x1b7794[_0x8e6c4a]);}}return this['channel'][_0x9cb9('0xa8')](util['format'](_0x9cb9('0x139'),JSON[_0x9cb9('0x70')](_0x1b7794)));}}return _0x64db3a;};AGIVertices['prototype'][_0x9cb9('0x13a')]=function(_0x32b8cb){logger['info'](util['format'](_0x9cb9('0x13b'),_0x32b8cb['label']));return this['channel'][_0x9cb9('0x13c')](_0x32b8cb['context'],_0x32b8cb[_0x9cb9('0x3c')],_0x32b8cb[_0x9cb9('0x3d')]);};AGIVertices['prototype'][_0x9cb9('0x13d')]=function(_0x5bd962){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x5bd962['label']));if(!this[_0x9cb9('0x82')](_0x5bd962[_0x9cb9('0x13e')])){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x5bd962,_0x9cb9('0x13f'));}try{var _0x365336=eval(_0x5bd962[_0x9cb9('0x13e')])?_0x9cb9('0x140'):_0x9cb9('0x141');this['channel'][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x142'),_0x5bd962['condition'],_0x365336));return{'code':0xc8,'result':_0x365336};}catch(_0x355493){return{'code':0xc8,'result':_0x9cb9('0x141')};}};AGIVertices[_0x9cb9('0xd')]['gotoiftime']=function(_0x468c8f){logger['info'](util[_0x9cb9('0x52')](_0x9cb9('0x143'),_0x468c8f['label']));if(!this['isConfigured'](_0x468c8f['interval_id'])){return this['channel'][_0x9cb9('0x29')](_0x468c8f,_0x9cb9('0x144'));}var _0x44397a=this[_0x9cb9('0x21')]['sync'](this,_0x468c8f[_0x9cb9('0x145')]);if(!_0x44397a){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x468c8f,_0x9cb9('0x146'));}for(var _0x2b8e0f=0x0;_0x2b8e0f<_0x44397a[_0x9cb9('0x9a')];_0x2b8e0f+=0x1){var _0x683977=this[_0x9cb9('0xc')]['getVariable'](util[_0x9cb9('0x52')](_0x9cb9('0x147'),_0x44397a[_0x2b8e0f]));if(_0x683977[_0x9cb9('0xa2')]===-0x1){return _0x683977;}logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x148'),_0x44397a[_0x2b8e0f],_0x683977[_0x9cb9('0xa3')]));if(_0x683977[_0x9cb9('0xa3')]===_0x9cb9('0x140')){logger['info'](util['format'](_0x9cb9('0x148'),_0x44397a[_0x2b8e0f],'true'));this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x148'),_0x44397a[_0x2b8e0f],_0x9cb9('0x140')));return{'code':0xc8,'result':_0x9cb9('0x140')};}else{logger[_0x9cb9('0x2b')](util['format'](_0x9cb9('0x148'),_0x44397a[_0x2b8e0f],'false'));this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x148'),_0x44397a[_0x2b8e0f],_0x9cb9('0x141')));}}return{'code':0xc8,'result':_0x9cb9('0x141')};};AGIVertices[_0x9cb9('0xd')]['hangup']=function(_0x24a30b){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x149'),_0x24a30b[_0x9cb9('0x34')]));return this[_0x9cb9('0xc')][_0x9cb9('0x14a')]();};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x14b')]=function(_0x52fb2a){logger[_0x9cb9('0x2b')](util['format'](_0x9cb9('0x14c'),_0x52fb2a[_0x9cb9('0x34')]));if(!this['isConfigured'](_0x52fb2a['key'])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0xe5'));}var _0x40ec6f=_0x9cb9('0x12b');var _0x322c81=util[_0x9cb9('0x52')](_0x9cb9('0x12c'),FILES_PATH,rs[_0x9cb9('0x115')](0x4));var _0x59da33=util[_0x9cb9('0x52')](_0x9cb9('0x9d'),_0x322c81,_0x40ec6f);var _0x33d5d2=!![];if(_0x52fb2a['beep']===_0x9cb9('0x14d')){_0x33d5d2=![];}var _0x2f90ff=this[_0x9cb9('0xc')][_0x9cb9('0x12e')](_0x322c81,_0x40ec6f,_0x52fb2a[_0x9cb9('0x12f')],_0x52fb2a[_0x9cb9('0x62')],undefined,_0x33d5d2);if(_0x2f90ff[_0x9cb9('0xa2')]!==-0x1){this['channel']['noop'](util[_0x9cb9('0x52')]('ispeech\x20%s\x20file\x20created',_0x59da33));var _0x4e557d=this[_0x9cb9('0x80')][_0x9cb9('0x6c')](this,_0x52fb2a,_0x59da33);if(_0x4e557d){for(var _0x22380b in _0x4e557d){if(_0x4e557d[_0x9cb9('0x98')](_0x22380b)){this['channel']['setVariable'](util[_0x9cb9('0x52')](_0x9cb9('0x14e'),_0x22380b[_0x9cb9('0x67')]()),_0x4e557d[_0x22380b]);}}return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x14f'),JSON[_0x9cb9('0x70')](_0x4e557d)));}}return _0x2f90ff;};AGIVertices[_0x9cb9('0xd')]['ispeechtts']=function(_0x1a6e7e){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x1a6e7e[_0x9cb9('0x34')]));if(!this['isConfigured'](_0x1a6e7e[_0x9cb9('0x77')])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0xe5'));}if(!this[_0x9cb9('0x82')](_0x1a6e7e[_0x9cb9('0x5a')])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0xc4'));}this['channel'][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x150'),_0x1a6e7e['text']));var _0xd3a686=this[_0x9cb9('0x7d')][_0x9cb9('0x6c')](this,_0x1a6e7e);if(_0xd3a686){this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')]('ispeech\x20%s\x20file\x20created',_0xd3a686));var _0x4ca3d5=this['channel'][_0x9cb9('0xfe')](_0xd3a686,_0x1a6e7e['intKey']);try{fs[_0x9cb9('0xff')](_0xd3a686+_0x9cb9('0x100'));}catch(_0x548e40){logger[_0x9cb9('0x29')](_0x548e40);}return _0x4ca3d5;}return this[_0x9cb9('0xc')]['error'](_0x1a6e7e,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x9cb9('0xd')]['login']=function(_0x44796c){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x44796c['label']));if(!this[_0x9cb9('0x82')](_0x44796c['findBy'])){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x44796c,'no\x20find\x20by\x20configured');}logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x151'),this[_0x9cb9('0xc')][_0x9cb9('0x39')],_0x44796c[_0x9cb9('0x152')]));var _0x535ddd=this[_0x9cb9('0x153')]['sync'](this,_0x44796c[_0x9cb9('0x152')]);if(_0x535ddd){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x154'),this[_0x9cb9('0xc')]['callerid'],_0x44796c[_0x9cb9('0x152')]));this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x154'),this[_0x9cb9('0xc')][_0x9cb9('0x39')],_0x44796c[_0x9cb9('0x152')]));return{'code':0xc8,'result':_0x9cb9('0x155')};}else{logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x156'),this[_0x9cb9('0xc')][_0x9cb9('0x39')],_0x44796c[_0x9cb9('0x152')]));this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util['format'](_0x9cb9('0x156'),this[_0x9cb9('0xc')]['callerid'],_0x44796c[_0x9cb9('0x152')]));return{'code':0xc8,'result':_0x9cb9('0x157')};}};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x158')]=function(_0x39ce0d){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x159'),_0x39ce0d[_0x9cb9('0x34')]));if(!this[_0x9cb9('0x82')](_0x39ce0d['findBy'])){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x39ce0d,_0x9cb9('0x15a'));}logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x9cb9('0xc')][_0x9cb9('0x39')],_0x39ce0d[_0x9cb9('0x152')]));var _0x5e8bfc=this[_0x9cb9('0x50')][_0x9cb9('0x6c')](this,_0x39ce0d['findBy']);if(_0x5e8bfc){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x154'),this['channel']['callerid'],_0x39ce0d['findBy']));this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util['format'](_0x9cb9('0x154'),this[_0x9cb9('0xc')]['callerid'],_0x39ce0d[_0x9cb9('0x152')]));return{'code':0xc8,'result':_0x9cb9('0x155')};}else{logger['info'](util[_0x9cb9('0x52')](_0x9cb9('0x156'),this[_0x9cb9('0xc')][_0x9cb9('0x39')],_0x39ce0d['findBy']));this['channel'][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x156'),this['channel'][_0x9cb9('0x39')],_0x39ce0d['findBy']));return{'code':0xc8,'result':_0x9cb9('0x157')};}};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x15b')]=function(_0x5ea352){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x15c'),_0x5ea352[_0x9cb9('0x34')]));if(!this['isConfigured'](_0x5ea352['operation'])){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x5ea352,_0x9cb9('0x15d'));}this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')]('math\x20%s',_0x5ea352[_0x9cb9('0x15e')]));var _0x40361e=eval(_0x5ea352[_0x9cb9('0x15e')]);if(!this[_0x9cb9('0x82')](_0x5ea352[_0x9cb9('0xd4')])){return this[_0x9cb9('0xc')]['noop'](_0x9cb9('0xd5'));}var _0x2acd56=this[_0x9cb9('0xe')]['sync'](this,_0x5ea352['variable_id']);if(!_0x2acd56){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x5ea352,_0x9cb9('0xd6'));}if(_[_0x9cb9('0x99')](_0x40361e)){var _0x5869fe=this;_0x40361e[_0x9cb9('0xd7')](function(_0x45700c,_0x5e8721){_0x5869fe[_0x9cb9('0xc')][_0x9cb9('0x9e')](util[_0x9cb9('0x52')](_0x9cb9('0x15f'),_0x2acd56,_0x5e8721),_0x45700c);});return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util['format'](_0x9cb9('0x160'),_0x2acd56));}else{return this['channel'][_0x9cb9('0x9e')](_0x2acd56,_0x40361e);}};AGIVertices[_0x9cb9('0xd')]['menu']=function(_0x291491){logger[_0x9cb9('0x2b')](util['format'](_0x9cb9('0x161'),_0x291491[_0x9cb9('0x34')]));if(_0x291491['retry']===0x0){return this[_0x9cb9('0xa4')](_0x291491);}_0x291491[_0x9cb9('0xa5')]-=0x1;if(!this[_0x9cb9('0x82')](_0x291491['file_id'])){return this['channel'][_0x9cb9('0x29')](_0x291491,_0x9cb9('0x10d'));}var _0xc91a33=this[_0x9cb9('0x1c')][_0x9cb9('0x6c')](this,_0x291491['file_id']);if(!_0xc91a33){return this[_0x9cb9('0xc')]['error'](_0x291491,_0x9cb9('0x10e'));}var _0x10fdf2=this['channel']['getData'](_0xc91a33,_0x291491['response'],_0x291491['digit']);var _0x1a2f18=_0x10fdf2['result'];if(_0x10fdf2[_0x9cb9('0xa2')]===-0x1){this[_0x9cb9('0x33')][_0x9cb9('0x6c')](this,_0x291491,'-1');return _0x10fdf2;}else if(_0x10fdf2[_0x9cb9('0xa3')]===_0x9cb9('0x62')){_0x10fdf2[_0x9cb9('0xa2')]=_0x10fdf2['result'][_0x9cb9('0x9a')]>0x0?_0x10fdf2['result']:'t';}else if(_[_0x9cb9('0x42')](_0x10fdf2[_0x9cb9('0xa2')])){_0x10fdf2['result']='#';_0x1a2f18='#';}if(!this[_0x9cb9('0x82')](_0x291491[_0x9cb9('0xd4')])){this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0xd5'));}else{var _0x3cf512=this['getVariable']['sync'](this,_0x291491[_0x9cb9('0xd4')]);if(!_0x3cf512){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x291491,'no\x20variable\x20found');}this[_0x9cb9('0xc')][_0x9cb9('0x9e')](_0x3cf512,_0x1a2f18);}this['createSquareDetailsReport']['sync'](this,_0x291491,_0x1a2f18);return _0x10fdf2;};AGIVertices[_0x9cb9('0xd')]['noop']=function(_0x4f0374){logger['info'](util[_0x9cb9('0x52')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x4f0374[_0x9cb9('0x34')]));return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x4f0374[_0x9cb9('0x162')]||_0x4f0374[_0x9cb9('0x34')]);};AGIVertices[_0x9cb9('0xd')]['pause']=function(_0x4ddc8a){logger['info'](util[_0x9cb9('0x52')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x4ddc8a['label']));if(!this[_0x9cb9('0x82')](_0x4ddc8a['findBy'])){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x4ddc8a,_0x9cb9('0x15a'));}logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x151'),this[_0x9cb9('0xc')][_0x9cb9('0x39')],_0x4ddc8a[_0x9cb9('0x152')]));var _0x3728d1=this[_0x9cb9('0x4c')][_0x9cb9('0x6c')](this,_0x4ddc8a[_0x9cb9('0x163')]);var _0x5a66aa=this['agentPause'][_0x9cb9('0x6c')](this,_0x4ddc8a[_0x9cb9('0x152')],_0x3728d1);if(_0x5a66aa){logger['info'](util[_0x9cb9('0x52')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9cb9('0xc')]['callerid'],_0x4ddc8a[_0x9cb9('0x152')]));this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x154'),this[_0x9cb9('0xc')][_0x9cb9('0x39')],_0x4ddc8a[_0x9cb9('0x152')]));return{'code':0xc8,'result':_0x9cb9('0x155')};}else{logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x156'),this[_0x9cb9('0xc')][_0x9cb9('0x39')],_0x4ddc8a[_0x9cb9('0x152')]));this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x154'),this[_0x9cb9('0xc')][_0x9cb9('0x39')],_0x4ddc8a['findBy']));return{'code':0xc8,'result':_0x9cb9('0x157')};}};AGIVertices[_0x9cb9('0xd')]['playback']=function(_0x297dcc){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x164'),_0x297dcc[_0x9cb9('0x34')]));if(!this[_0x9cb9('0x82')](_0x297dcc['file_id'])){return this['channel'][_0x9cb9('0x29')](_0x297dcc,'no\x20file\x20audio\x20selected');}var _0x9aad3=this['getSound']['sync'](this,_0x297dcc[_0x9cb9('0x10c')]);if(!_0x9aad3){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x297dcc,_0x9cb9('0x10e'));}var _0x243ed0=this[_0x9cb9('0xc')][_0x9cb9('0x55')]('PLAYBACK',[_0x9aad3,_0x297dcc[_0x9cb9('0xe1')]]);if(_0x243ed0[_0x9cb9('0xa2')]===-0x1){return _0x243ed0;}return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x165'),_0x9cb9('0x166'),_0x9aad3));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x167')]=function(_0x488a2e){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x168'),_0x488a2e[_0x9cb9('0x34')]));if(!this[_0x9cb9('0x82')](_0x488a2e[_0x9cb9('0x169')])){return this[_0x9cb9('0xc')]['error'](_0x488a2e,_0x9cb9('0x16a'));}var _0x50e11e='';var _0x1592ca=parseInt(_0x488a2e['queue_id'],0xa);if(isNaN(_0x1592ca)){_0x50e11e=_0x488a2e[_0x9cb9('0x169')];}else{_0x50e11e=this[_0x9cb9('0x16b')][_0x9cb9('0x6c')](this,_0x488a2e[_0x9cb9('0x169')]);if(!_0x50e11e){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x488a2e,'no\x20queue\x20found');}}var _0x5b0f1c='';if(this['isConfigured'](_0x488a2e['file_id'])){var _0x248840=this['getSound'][_0x9cb9('0x6c')](this,_0x488a2e[_0x9cb9('0x10c')]);if(_0x248840){_0x5b0f1c=_0x248840;}}this[_0x9cb9('0x33')][_0x9cb9('0x6c')](this,_0x488a2e,_0x50e11e);if(_0x488a2e[_0x9cb9('0xe1')][_0x9cb9('0x16c')]('x')<0x0){_0x488a2e[_0x9cb9('0xe1')]+='x';}if(_0x488a2e[_0x9cb9('0xe1')][_0x9cb9('0x16c')]('X')<0x0){_0x488a2e[_0x9cb9('0xe1')]+='X';}this[_0x9cb9('0xc')][_0x9cb9('0x9e')]('XMCS-QUEUE',_0x50e11e?_0x50e11e[_0x9cb9('0x16d')]():'');var _0x632146=this[_0x9cb9('0xc')][_0x9cb9('0x55')](_0x9cb9('0x16e'),[_0x50e11e,_0x488a2e[_0x9cb9('0xe1')],_0x488a2e[_0x9cb9('0x6e')],_0x5b0f1c,_0x488a2e['timeout'],_0x488a2e[_0x9cb9('0x5')],_0x488a2e[_0x9cb9('0x16f')],_0x488a2e[_0x9cb9('0x170')],'',_0x488a2e[_0x9cb9('0x171')]]);if(_0x632146[_0x9cb9('0xa2')]===-0x1){return _0x632146;}return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x165'),'QUEUE',_0x50e11e));};AGIVertices['prototype']['record']=function(_0x3f2e92){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x172'),_0x3f2e92[_0x9cb9('0x34')]));var _0x369075=_0x3f2e92['recordingFormat']||_0x9cb9('0x12b');var _0x2703a0=util[_0x9cb9('0x52')](_0x9cb9('0x173'),this[_0x9cb9('0xc')]['uniqueid'],rs[_0x9cb9('0x115')](0x5));var _0x589479=util['format'](_0x9cb9('0x174'),FILES_PATH,_0x2703a0,_0x369075);var _0x51e1e1=util['format'](_0x9cb9('0x12c'),FILES_PATH,_0x2703a0);this[_0x9cb9('0x37')][_0x9cb9('0x6c')](this,_0x3f2e92,_0x2703a0,_0x589479);this['channel'][_0x9cb9('0x9e')](_0x9cb9('0x175'),_0x2703a0);logger[_0x9cb9('0x2b')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x51e1e1,_0x369075,_0x3f2e92[_0x9cb9('0x176')],_0x3f2e92['timeout']);return this[_0x9cb9('0xc')]['recordFile'](_0x51e1e1,_0x369075,_0x3f2e92[_0x9cb9('0x176')],_0x3f2e92['timeout'],undefined,!![]);};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x177')]=function(_0x1f22df){logger[_0x9cb9('0x2b')](util['format'](_0x9cb9('0x178'),_0x1f22df[_0x9cb9('0x34')]));if(!this[_0x9cb9('0x82')](_0x1f22df['url'])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')]('no\x20url\x20configured');}var _0x58c9d7=this[_0x9cb9('0x179')][_0x9cb9('0x6c')](this,_0x1f22df);logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')]('Response:',util[_0x9cb9('0x17a')](_0x58c9d7,{'showHidden':![],'depth':null})));if(!this[_0x9cb9('0x82')](_0x1f22df[_0x9cb9('0xd4')])){return this[_0x9cb9('0xc')]['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x56cc4e=this[_0x9cb9('0xe')]['sync'](this,_0x1f22df[_0x9cb9('0xd4')]);if(!_0x56cc4e){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x1f22df,'no\x20variable\x20found');}this[_0x9cb9('0xc')][_0x9cb9('0x9e')](util[_0x9cb9('0x52')](_0x9cb9('0x17b'),_0x56cc4e),_0x58c9d7['statusCode']?_0x58c9d7[_0x9cb9('0x72')]:_0x9cb9('0x17c'));this['channel'][_0x9cb9('0x9e')](util[_0x9cb9('0x52')](_0x9cb9('0x17d'),_0x56cc4e),_0x58c9d7[_0x9cb9('0x73')]?_0x58c9d7[_0x9cb9('0x73')]:'OK');if(_0x58c9d7['body']){try{this[_0x9cb9('0x9c')](_0x58c9d7['body'],_0x56cc4e);}catch(_0x259d83){logger['error'](util['format'](_0x9cb9('0x17e'),_0x56cc4e));}}return this['channel'][_0x9cb9('0xa8')](util['format'](_0x9cb9('0xdb'),_0x56cc4e));};AGIVertices['prototype'][_0x9cb9('0x17f')]=function(_0xcae6e3){logger['info'](util['format'](_0x9cb9('0x180'),_0xcae6e3[_0x9cb9('0x34')]));return this[_0x9cb9('0xc')][_0x9cb9('0x181')](_0xcae6e3[_0x9cb9('0x182')][_0x9cb9('0x56')](/\s+/g,''),_0xcae6e3[_0x9cb9('0x176')]);};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x183')]=function(_0x5e4855){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x184'),_0x5e4855['label']));return this['channel'][_0x9cb9('0x185')](_0x5e4855['number'][_0x9cb9('0x56')](/\s+/g,''),_0x5e4855[_0x9cb9('0x176')]);};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x186')]=function(_0x2c6640){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x187'),_0x2c6640[_0x9cb9('0x34')]));return this[_0x9cb9('0xc')]['sayPhonetic'](_0x2c6640[_0x9cb9('0x5a')],_0x2c6640[_0x9cb9('0x176')]);};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x188')]=function(_0x3ba01c){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x189'),_0x3ba01c['label']));if(!this[_0x9cb9('0x82')](_0x3ba01c[_0x9cb9('0x18a')])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')]('no\x20mail\x20account\x20configured');}var _0x392f37=this['getMailAccount']['sync'](this,_0x3ba01c[_0x9cb9('0x18a')]);if(!_0x392f37||!_0x392f37[_0x9cb9('0x18b')]){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x3ba01c,_0x9cb9('0x18c'));}var _0x20f788={'from':util[_0x9cb9('0x52')](_0x9cb9('0x18d'),_0x392f37[_0x9cb9('0x11')],_0x392f37['email']||_0x392f37['Smtp'][_0x9cb9('0x18e')]),'to':_0x3ba01c['to']||'','cc':_0x3ba01c['cc']||'','bcc':_0x3ba01c[_0x9cb9('0x18f')]||'','subject':_0x3ba01c[_0x9cb9('0x190')],'html':_0x3ba01c['text'],'text':_0x3ba01c[_0x9cb9('0x5a')]};if(this[_0x9cb9('0x82')](_0x3ba01c['template_id'])){}logger[_0x9cb9('0xdd')]('sendMail\x20message',JSON[_0x9cb9('0x70')](_0x20f788));this['createSquareDetailsReport'][_0x9cb9('0x6c')](this,_0x3ba01c,_0x3ba01c[_0x9cb9('0x18a')]);this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x191'),_0x392f37[_0x9cb9('0x11')]));this['sendMailMessage'][_0x9cb9('0x6c')](this,_0x392f37[_0x9cb9('0x192')],_0x20f788);return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0x193'));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x194')]=function(_0x22be7f){logger[_0x9cb9('0x2b')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x22be7f['label']));return this[_0x9cb9('0xc')]['noop'](_0x9cb9('0x195'));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x196')]=function(_0x37fe42){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x197'),_0x37fe42[_0x9cb9('0x34')]));if(!this[_0x9cb9('0x82')](_0x37fe42[_0x9cb9('0x198')])){return this['channel']['noop'](_0x9cb9('0x199'));}var _0x1fb7f8=this[_0x9cb9('0x19a')]['sync'](this,_0x37fe42[_0x9cb9('0x198')]);if(!_0x1fb7f8){return this[_0x9cb9('0xc')]['error'](_0x37fe42,_0x9cb9('0x19b'));}var _0x5487d6={'body':_0x37fe42['sms_text'],'phone':_0x37fe42['to']||'','SmsAccountId':_0x1fb7f8['id']};logger['debug'](_0x9cb9('0x19c'),JSON[_0x9cb9('0x70')](_0x5487d6));this['createSquareDetailsReport'][_0x9cb9('0x6c')](this,_0x37fe42,_0x37fe42[_0x9cb9('0x198')]);this['channel']['noop'](util[_0x9cb9('0x52')](_0x9cb9('0x19d'),_0x1fb7f8[_0x9cb9('0x11')]));this[_0x9cb9('0x32')]['sync'](this,_0x5487d6);return this['channel'][_0x9cb9('0xa8')](_0x9cb9('0x19e'));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x19f')]=function(_0x197186){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x1a0'),_0x197186[_0x9cb9('0x34')]));if(!this['isConfigured'](_0x197186[_0x9cb9('0xd4')])){return this[_0x9cb9('0xc')]['error'](_0x197186,_0x9cb9('0x1a1'));}var _0xf13301=this['getVariable'][_0x9cb9('0x6c')](this,_0x197186[_0x9cb9('0xd4')]);if(!_0xf13301){return this['channel'][_0x9cb9('0x29')](_0x197186,_0x9cb9('0xd6'));}return this[_0x9cb9('0xc')][_0x9cb9('0x9e')](_0xf13301,_0x197186[_0x9cb9('0x1a2')]);};AGIVertices['prototype']['start']=function(_0x574bb3){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x1a3'),_0x574bb3[_0x9cb9('0x34')]));this[_0x9cb9('0xc')][_0x9cb9('0xa8')]('START\x20CALLY\x20SQUARE');var _0xb94df=this[_0x9cb9('0xc')][_0x9cb9('0xe')](_0x9cb9('0x1a4'));if(!_[_0x9cb9('0x42')](_0xb94df[_0x9cb9('0xa3')])){this['channel'][_0x9cb9('0x38')]=_0xb94df['extra'];}if(_0x574bb3[_0x9cb9('0xb6')]===_0x9cb9('0x1a5')){this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0x1a6'));return this[_0x9cb9('0xc')]['answer']();}return this[_0x9cb9('0xc')]['noop'](_0x9cb9('0x1a7'));};AGIVertices[_0x9cb9('0xd')]['subproject']=function(_0x34c067){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x1a8'),_0x34c067[_0x9cb9('0x34')]));if(!this['isConfigured'](_0x34c067[_0x9cb9('0x1a9')])){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x34c067,'no\x20subproject\x20selected');}var _0x2bffb6=this[_0x9cb9('0x15')][_0x9cb9('0x6c')](this,_0x34c067['project_id']);if(!this[_0x9cb9('0x82')](_0x2bffb6)){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x34c067,util['format'](_0x9cb9('0x1aa'),_0x34c067[_0x9cb9('0x1a9')]));}if(_0x2bffb6===this[_0x9cb9('0xc')][_0x9cb9('0x36')]){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x34c067,_0x9cb9('0x1ab'));}this[_0x9cb9('0x33')][_0x9cb9('0x6c')](this,_0x34c067,_0x2bffb6);var _0x179b28=this[_0x9cb9('0xc')][_0x9cb9('0x55')](_0x9cb9('0x1ac'),util[_0x9cb9('0x52')](_0x9cb9('0x1ad'),config[_0x9cb9('0x5')]['host']||_0x9cb9('0x1ae'),_0x2bffb6,this[_0x9cb9('0xc')][_0x9cb9('0x36')]));if(_0x179b28[_0x9cb9('0xa2')]===-0x1){return _0x179b28;}return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')]('Executed\x20command\x20%s\x20%s','AGI',_0x2bffb6));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x1af')]=function(_0x52e937){logger['info'](util['format'](_0x9cb9('0x1b0'),_0x52e937[_0x9cb9('0x34')]));var _0x1888c8=this[_0x9cb9('0x1b1')][_0x9cb9('0x6c')](this,_0x52e937['command']);this[_0x9cb9('0x33')][_0x9cb9('0x6c')](this,_0x52e937,_0x52e937[_0x9cb9('0x1b2')]);if(this[_0x9cb9('0x82')](_0x52e937['variable_id'])){var _0x148523=this[_0x9cb9('0xe')]['sync'](this,_0x52e937[_0x9cb9('0xd4')]);if(_0x148523){this[_0x9cb9('0xc')][_0x9cb9('0x9e')](_0x148523,_0x1888c8);return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x1b3'),_0x52e937[_0x9cb9('0x1b2')],_0x148523));}}return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x1b4'),_0x52e937[_0x9cb9('0x1b2')]));};AGIVertices['prototype'][_0x9cb9('0x1b5')]=function(_0x1f90ab){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x1b6'),_0x1f90ab['label']));_0x1f90ab[_0x9cb9('0x5a')]=_0x1f90ab[_0x9cb9('0x5a')][_0x9cb9('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x9cb9('0x82')](_0x1f90ab['apiKey'])){return this['channel'][_0x9cb9('0xa8')]('no\x20apiKey\x20configured');}if(!this[_0x9cb9('0x82')](_0x1f90ab[_0x9cb9('0x5a')])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0xc4'));}this[_0x9cb9('0xc')]['noop'](util[_0x9cb9('0x52')](_0x9cb9('0x1b7'),_0x1f90ab[_0x9cb9('0x5a')]));var _0x27bfc9=this[_0x9cb9('0x57')][_0x9cb9('0x6c')](this,_0x1f90ab);if(_0x27bfc9){this[_0x9cb9('0xc')]['noop'](util[_0x9cb9('0x52')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x27bfc9));var _0x43b4d3=this[_0x9cb9('0xc')]['streamFile'](_0x27bfc9);try{fs['unlink'](_0x27bfc9+_0x9cb9('0x100'));}catch(_0x20961d){logger[_0x9cb9('0x29')](_0x20961d);}return _0x43b4d3;}return this[_0x9cb9('0xc')]['error'](_0x1f90ab,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x1b8')]=function(_0xc349d6){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x1b9'),_0xc349d6[_0x9cb9('0x34')]));_0xc349d6[_0x9cb9('0x5a')]=_0xc349d6['text'][_0x9cb9('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0xc349d6['text'])){return this[_0x9cb9('0xc')][_0x9cb9('0xa8')](_0x9cb9('0xc4'));}this['channel'][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x1ba'),_0xc349d6[_0x9cb9('0x5a')]));var _0x2410ad=this[_0x9cb9('0x5f')][_0x9cb9('0x6c')](this,_0xc349d6);if(_0x2410ad){this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x2410ad));var _0x36b9c1=this[_0x9cb9('0xc')]['streamFile'](_0x2410ad);try{fs[_0x9cb9('0xff')](_0x2410ad+'.wav');}catch(_0x56288d){logger['error'](_0x56288d);}return _0x36b9c1;}return this['channel'][_0x9cb9('0x29')](_0xc349d6,_0x9cb9('0x1bb'));};AGIVertices['prototype'][_0x9cb9('0x1bc')]=function(_0x25bc97){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x1bd'),_0x25bc97[_0x9cb9('0x34')]));if(!this[_0x9cb9('0x82')](_0x25bc97[_0x9cb9('0x152')])){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x25bc97,_0x9cb9('0x15a'));}logger['info'](util[_0x9cb9('0x52')](_0x9cb9('0x151'),this[_0x9cb9('0xc')][_0x9cb9('0x39')],_0x25bc97['findBy']));var _0x796b11=this['agentUnpause'][_0x9cb9('0x6c')](this,_0x25bc97[_0x9cb9('0x152')]);if(_0x796b11){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x154'),this[_0x9cb9('0xc')][_0x9cb9('0x39')],_0x25bc97['findBy']));this[_0x9cb9('0xc')][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x154'),this['channel'][_0x9cb9('0x39')],_0x25bc97[_0x9cb9('0x152')]));return{'code':0xc8,'result':_0x9cb9('0x155')};}else{logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x156'),this[_0x9cb9('0xc')]['callerid'],_0x25bc97[_0x9cb9('0x152')]));this['channel'][_0x9cb9('0xa8')](util[_0x9cb9('0x52')](_0x9cb9('0x156'),this['channel'][_0x9cb9('0x39')],_0x25bc97[_0x9cb9('0x152')]));return{'code':0xc8,'result':_0x9cb9('0x157')};}};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x1be')]=function(_0x379786){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x1bf'),_0x379786['label']));var _0x3edde2=this[_0x9cb9('0xc')][_0x9cb9('0x55')](_0x9cb9('0x1c0'),[_0x379786[_0x9cb9('0x1c1')],_0x379786[_0x9cb9('0x76')]]);if(_0x3edde2[_0x9cb9('0xa2')]===-0x1){return _0x3edde2;}return this[_0x9cb9('0xc')]['noop'](util[_0x9cb9('0x52')]('Executed\x20command\x20%s\x20%s',_0x9cb9('0x1c0'),_0x379786[_0x9cb9('0x1c1')]));};AGIVertices[_0x9cb9('0xd')][_0x9cb9('0x1c2')]=function(_0x5b5b65){logger[_0x9cb9('0x2b')](util[_0x9cb9('0x52')](_0x9cb9('0x1c3'),_0x5b5b65['label']));if(!this[_0x9cb9('0x82')](_0x5b5b65[_0x9cb9('0xd4')])){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x5b5b65,_0x9cb9('0x1a1'));}var _0x2fcdb=this[_0x9cb9('0xe')][_0x9cb9('0x6c')](this,_0x5b5b65[_0x9cb9('0xd4')]);if(!_0x2fcdb){return this[_0x9cb9('0xc')][_0x9cb9('0x29')](_0x5b5b65,_0x9cb9('0xd6'));}var _0x2299f3=this[_0x9cb9('0xc')][_0x9cb9('0xe')](_0x2fcdb);return{'code':0xc8,'result':_0x2299f3[_0x9cb9('0xa3')]?_0x2299f3[_0x9cb9('0xa3')]:'-'};};String['prototype']['replaceAll']=function(_0x2556a0,_0x11085c){return this['split'](_0x2556a0)['join'](_0x11085c);};module['exports']=AGIVertices; \ No newline at end of file +var _0x5089=['getVariable','rpc','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getTrunk','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','info','Query\x20executed\x20correctly\x20%s','close','error','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','context','extension','priority','accountcode','createSquareMessage','createCmContact','isEmpty','callback_','isNil','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agent','agentPause','agentLogout','internal','agentLogin','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','number','timeout','includes','POST','PUT','method','body','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','parse','stringify','statusCode','statusMessage','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','replaceObjectAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','isString','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','replaceAllVariables','getAndSetVariable','retry','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','no\x20text\x20configured','result','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','lumenvoxasr','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','DIALOGFLOW_%s','toUpperCase','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','out','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Executed\x20command\x20%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','maxdigit','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','awspolly','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','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','no\x20appsecret\x20configured','%s/recordings/%s','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','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','no\x20key\x20configured','.wav','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','getSound','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','subject','sendMail\x20message','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','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','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','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','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','util','lodash','odbc','randomstring','moment','mustache','request-promise','agi','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','channel','mailRpc','prototype'];(function(_0x392a07,_0x203757){var _0x2133b1=function(_0x17f839){while(--_0x17f839){_0x392a07['push'](_0x392a07['shift']());}};_0x2133b1(++_0x203757);}(_0x5089,0x1bb));var _0x9508=function(_0x191c44,_0x20a896){_0x191c44=_0x191c44-0x0;var _0x1086cd=_0x5089[_0x191c44];return _0x1086cd;};'use strict';var fs=require('fs');var util=require(_0x9508('0x0'));var _=require(_0x9508('0x1'));var sh=require('shelljs');var odbc=require(_0x9508('0x2'))();var rs=require(_0x9508('0x3'));var moment=require(_0x9508('0x4'));var Mustache=require(_0x9508('0x5'));var rp=require(_0x9508('0x6'));var logger=require('../../config/logger')(_0x9508('0x7'));var config=require('../../config/environment');var scripts=require(_0x9508('0x8'));var FILES_PATH=_0x9508('0x9');var recursiveMapAttributes=[_0x9508('0xa'),'rawBody'];var verticesWithRetry=[_0x9508('0xb'),_0x9508('0xc'),'getsecretdigits'];var AGIVertices=function(_0x14dae7,_0x338897,_0x4f6720){this[_0x9508('0xd')]=_0x14dae7;this['rpc']=_0x338897;this[_0x9508('0xe')]=_0x4f6720;};AGIVertices[_0x9508('0xf')][_0x9508('0x10')]=function(_0x21f8c1,_0x839509){this[_0x9508('0x11')]['getVariableById'](_0x21f8c1)[_0x9508('0x12')](function(_0x507887){_0x839509(null,_0x507887?_0x507887[_0x9508('0x13')]:![]);})[_0x9508('0x14')](function(_0x554c90){_0x839509(_0x554c90);});};AGIVertices[_0x9508('0xf')][_0x9508('0x15')]=function(_0x10ceef,_0x4701de){this['rpc'][_0x9508('0x16')](_0x10ceef)[_0x9508('0x12')](function(_0x51c80b){_0x4701de(null,_0x51c80b?_0x51c80b[_0x9508('0x13')]:![]);})['catch'](function(_0x25d4d6){_0x4701de(_0x25d4d6);});};AGIVertices[_0x9508('0xf')][_0x9508('0x17')]=function(_0x255a03,_0x127340){this[_0x9508('0x11')][_0x9508('0x18')](_0x255a03)[_0x9508('0x12')](function(_0x5a303c){_0x127340(null,_0x5a303c?_0x5a303c[_0x9508('0x13')]:![]);})[_0x9508('0x14')](function(_0xfcc29d){_0x127340(_0xfcc29d);});};AGIVertices[_0x9508('0xf')][_0x9508('0x19')]=function(_0x22a9fe,_0x52e3c4){this['rpc'][_0x9508('0x1a')](_0x22a9fe)['then'](function(_0x2272e2){_0x52e3c4(null,_0x2272e2?_0x2272e2['dsn']:![]);})[_0x9508('0x14')](function(_0x22ff69){_0x52e3c4(_0x22ff69);});};AGIVertices[_0x9508('0xf')][_0x9508('0x1b')]=function(_0x1edf1b,_0x2f8106){this[_0x9508('0x11')]['getUserById'](_0x1edf1b)['then'](function(_0xd7b601){_0x2f8106(null,_0xd7b601?_0xd7b601[_0x9508('0x13')]:![]);})[_0x9508('0x14')](function(_0xf70830){_0x2f8106(_0xf70830);});};AGIVertices[_0x9508('0xf')][_0x9508('0x1c')]=function(_0x4b68e9,_0x5e9a80){this[_0x9508('0x11')]['getTrunkById'](_0x4b68e9)['then'](function(_0x1d4500){_0x5e9a80(null,_0x1d4500?_0x1d4500['name']:![]);})['catch'](function(_0x1c9b3e){_0x5e9a80(_0x1c9b3e);});};AGIVertices[_0x9508('0xf')]['getSound']=function(_0x49246b,_0x32b0dd){var _0x22b2e2=this;this[_0x9508('0x11')][_0x9508('0x1d')](_0x49246b)[_0x9508('0x12')](function(_0x15c32e){_0x32b0dd(null,_0x15c32e?_0x22b2e2[_0x9508('0x1e')](_0x15c32e[_0x9508('0x1f')]):![]);})[_0x9508('0x14')](function(_0x19a984){_0x32b0dd(_0x19a984);});};AGIVertices['prototype'][_0x9508('0x20')]=function(_0x3b894b,_0x2b3738){this['rpc'][_0x9508('0x21')](_0x3b894b)[_0x9508('0x12')](function(_0x5e1d31){_0x2b3738(null,_0x5e1d31?_0x5e1d31:![]);})[_0x9508('0x14')](function(_0x226645){_0x2b3738(_0x226645);});};AGIVertices['prototype'][_0x9508('0x22')]=function(_0x2fd00e,_0xb06b10,_0x36de9f){this['mailRpc']['sendMailMessage'](_0x2fd00e,_0xb06b10)[_0x9508('0x12')](function(){_0x36de9f(null);})[_0x9508('0x14')](function(_0x2677d6){_0x36de9f(_0x2677d6);});};AGIVertices['prototype']['getIntervals']=function(_0x301dd0,_0x14be59){this[_0x9508('0x11')][_0x9508('0x23')](_0x301dd0)[_0x9508('0x12')](function(_0x3f86d4){if(_0x3f86d4){if(_0x3f86d4[_0x9508('0x24')]){_0x14be59(null,[_0x3f86d4[_0x9508('0x25')]]);}else{_0x14be59(null,_[_0x9508('0x26')](_0x3f86d4[_0x9508('0x27')],'interval'));}}else{_0x14be59(null,![]);}})[_0x9508('0x14')](function(_0x27e248){_0x14be59(_0x27e248);});};AGIVertices['prototype'][_0x9508('0x1e')]=function(_0x42c23c){return util[_0x9508('0x28')](_0x9508('0x29'),FILES_PATH,_0x42c23c);};AGIVertices[_0x9508('0xf')][_0x9508('0x2a')]=function(_0x33e17c,_0x3700f1,_0xfb6676){odbc[_0x9508('0x2b')](_0x33e17c,function(_0x2a5d1b){if(_0x2a5d1b){logger['error'](_0x9508('0x2c'),_0x2a5d1b);_0xfb6676(_0x2a5d1b);}else{logger['info'](_0x9508('0x2d'));odbc[_0x9508('0x2e')](_0x3700f1,function(_0x23a8b6,_0x5644b6){if(_0x23a8b6){logger['info'](_0x9508('0x2f'),_0x3700f1);_0xfb6676(_0x23a8b6);}else{logger[_0x9508('0x30')](_0x9508('0x31'),_0x3700f1);odbc[_0x9508('0x32')](function(_0x4eb600){if(_0x4eb600){logger[_0x9508('0x33')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x4eb600);}_0xfb6676(null,_0x5644b6);});}});}});};AGIVertices[_0x9508('0xf')][_0x9508('0x34')]=function(_0x5205f8,_0x33e412){this[_0x9508('0x11')]['getSmsAccountById'](_0x5205f8)[_0x9508('0x12')](function(_0x1e6851){_0x33e412(null,_0x1e6851?_0x1e6851:![]);})[_0x9508('0x14')](function(_0x12fdc6){_0x33e412(_0x12fdc6);});};AGIVertices['prototype']['createSmsMessage']=function(_0xaf138f,_0x4ff354){this[_0x9508('0x11')][_0x9508('0x35')](_0xaf138f)[_0x9508('0x12')](function(_0x4215e9){_0x4ff354(null,_0x4215e9);})['catch'](function(_0x47e3a6){_0x4ff354(_0x47e3a6);});};AGIVertices['prototype'][_0x9508('0x36')]=function(_0x5e7fe3,_0x3f2fc1,_0x54e4bf){this[_0x9508('0x11')][_0x9508('0x36')]({'uniqueid':this[_0x9508('0xd')][_0x9508('0x37')],'node':_0x5e7fe3['label'],'application':_0x5e7fe3[_0x9508('0x38')],'data':_0x3f2fc1||null,'project_name':this[_0x9508('0xd')][_0x9508('0x39')],'callerid':this['channel'][_0x9508('0x3a')]})[_0x9508('0x12')](function(_0x560b9c){if(_0x54e4bf){_0x54e4bf(null,_0x560b9c);}})[_0x9508('0x14')](function(_0x50a4ba){if(_0x54e4bf){_0x54e4bf(_0x50a4ba);}});};AGIVertices[_0x9508('0xf')]['createSquareRecording']=function(_0x5b4888,_0x4194be,_0x168afb,_0x1936c8){this[_0x9508('0x11')][_0x9508('0x3b')]({'uniqueid':this[_0x9508('0xd')]['uniqueid'],'callerid':this[_0x9508('0xd')][_0x9508('0x3a')],'calleridname':this[_0x9508('0xd')]['calleridname'],'context':this[_0x9508('0xd')][_0x9508('0x3c')],'extension':this[_0x9508('0xd')][_0x9508('0x3d')],'priority':this['channel'][_0x9508('0x3e')],'accountcode':this['channel'][_0x9508('0x3f')],'dnid':this[_0x9508('0xd')]['dnid'],'projectName':this[_0x9508('0xd')][_0x9508('0x39')],'saveName':_0x4194be,'filename':_0x5b4888['file']||_0x4194be,'savePath':_0x168afb})[_0x9508('0x12')](function(_0x22306e){_0x1936c8(null,_0x22306e);})['catch'](function(_0x39215b){_0x1936c8(_0x39215b);});};AGIVertices['prototype'][_0x9508('0x40')]=function(_0x50df5e,_0x1e6c8c,_0x55a023,_0x49ac4f,_0x55a158){this['rpc'][_0x9508('0x40')]({'uniqueid':this[_0x9508('0xd')][_0x9508('0x37')],'body':_0x50df5e,'direction':_0x1e6c8c,'providerName':_0x55a023,'providerResponse':_0x49ac4f})[_0x9508('0x12')](function(_0x40e385){if(_0x55a158){_0x55a158(null,_0x40e385);}})[_0x9508('0x14')](function(_0x2b9854){if(_0x55a158){_0x55a158(_0x2b9854);}});};AGIVertices[_0x9508('0xf')][_0x9508('0x41')]=function(_0x5e4992,_0x3398d2){this[_0x9508('0x11')][_0x9508('0x41')]({'firstName':_[_0x9508('0x42')](_0x5e4992[_0x9508('0x13')])||_['isNil'](_0x5e4992['name'])?_0x9508('0x43')+Math['random']():_0x5e4992[_0x9508('0x13')],'lastName':_[_0x9508('0x42')](_0x5e4992['lastName'])||_[_0x9508('0x44')](_0x5e4992['lastName'])?null:_0x5e4992['lastName'],'phone':_0x5e4992[_0x9508('0x45')],'ListId':_0x5e4992[_0x9508('0x46')],'scheduledat':_0x5e4992['scheduledAt'],'callbackUniqueid':this[_0x9508('0xd')][_0x9508('0x37')],'tags':_0x9508('0x47'),'description':_0x9508('0x48')+_0x5e4992[_0x9508('0x49')][_0x9508('0x4a')](),'priority':_0x5e4992[_0x9508('0x4b')]})[_0x9508('0x12')](function(_0x367da4){_0x3398d2(null,_0x367da4);})[_0x9508('0x14')](function(_0x122934){_0x3398d2(_0x122934);});};AGIVertices[_0x9508('0xf')][_0x9508('0x4c')]=function(_0x2005f0,_0x4c7b6b){this[_0x9508('0x11')][_0x9508('0x4d')](_0x2005f0)['then'](function(_0x2573d1){_0x4c7b6b(null,_0x2573d1?_0x2573d1['name']:![]);})['catch'](function(_0x237cf9){_0x4c7b6b(_0x237cf9);});};AGIVertices[_0x9508('0xf')]['agentPause']=function(_0x199c2e,_0x198389,_0x553e6b){var _0x2d22dc={'role':_0x9508('0x4e')};_0x2d22dc[_0x199c2e]=this[_0x9508('0xd')]['callerid'];this[_0x9508('0x11')][_0x9508('0x4f')](_0x2d22dc,_0x198389,this[_0x9508('0xd')][_0x9508('0x37')])[_0x9508('0x12')](function(_0x34a4c5){_0x553e6b(null,_['isNil'](_0x34a4c5)?![]:!![]);})[_0x9508('0x14')](function(_0x460780){logger[_0x9508('0x33')](_0x460780);_0x553e6b(null,![]);});};AGIVertices[_0x9508('0xf')]['agentUnpause']=function(_0x2ff0bb,_0x5e2dab){var _0x314a07={'role':_0x9508('0x4e')};_0x314a07[_0x2ff0bb]=this['channel'][_0x9508('0x3a')];this[_0x9508('0x11')]['agentUnpause'](_0x314a07)[_0x9508('0x12')](function(_0x132e3f){_0x5e2dab(null,_[_0x9508('0x44')](_0x132e3f)?![]:!![]);})[_0x9508('0x14')](function(_0x5aa42b){logger[_0x9508('0x33')](_0x5aa42b);_0x5e2dab(null,![]);});};AGIVertices[_0x9508('0xf')][_0x9508('0x50')]=function(_0x468375,_0x27bae4){var _0x9a59f7={'role':_0x9508('0x4e')};_0x9a59f7[_0x468375]=this[_0x9508('0xd')]['callerid'];this[_0x9508('0x11')][_0x9508('0x50')](_0x9a59f7)[_0x9508('0x12')](function(_0x4fd9af){_0x27bae4(null,_[_0x9508('0x44')](_0x4fd9af)?![]:!![]);})['catch'](function(_0x3256e9){logger['error'](_0x3256e9);_0x27bae4(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x2c2cd8,_0x195be7){var _0x22c0c9={'role':'agent'};_0x22c0c9[_0x2c2cd8]=this[_0x9508('0xd')][_0x9508('0x3a')];var _0x3a092a=_0x2c2cd8!=_0x9508('0x51')?util[_0x9508('0x28')]('%s/%s@from-sip/n','LOCAL',this[_0x9508('0xd')][_0x9508('0x3a')]):undefined;this[_0x9508('0x11')][_0x9508('0x52')](_0x22c0c9,_0x3a092a)[_0x9508('0x12')](function(_0x3ec6b7){_0x195be7(null,_[_0x9508('0x44')](_0x3ec6b7)?![]:!![]);})[_0x9508('0x14')](function(_0x3e60d0){logger[_0x9508('0x33')](_0x3e60d0);_0x195be7(null,![]);});};AGIVertices[_0x9508('0xf')][_0x9508('0x53')]=function(_0x57e389,_0x520f72){sh[_0x9508('0x54')](_['trim'](_0x57e389),function(_0x3847ad,_0x47d7ff){var _0x4c89d2=_0x47d7ff[_0x9508('0x55')](/(\r\n|\n|\r)/gm,'');_0x520f72(null,_0x4c89d2);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x32da5f,_0x5f67d7){scripts[_0x9508('0x56')](_0x32da5f[_0x9508('0x57')],_0x32da5f[_0x9508('0x58')]||_0x9508('0x59'),_0x32da5f[_0x9508('0x59')],_0x32da5f[_0x9508('0x5a')]||_0x9508('0x5b'),_0x32da5f[_0x9508('0x5c')]||_0x9508('0x5d'),_0x32da5f[_0x9508('0x5e')]||_0x9508('0x5f'))[_0x9508('0x12')](function(_0x456828){_0x5f67d7(null,_0x456828);})['catch'](function(_0x2dc584){_0x5f67d7(_0x2dc584);});};AGIVertices['prototype'][_0x9508('0x60')]=function(_0x39618d,_0x42ab8e){scripts[_0x9508('0x60')](_0x39618d[_0x9508('0x59')],_0x39618d[_0x9508('0x61')]||'en',0x1)[_0x9508('0x12')](function(_0x2658e1){_0x42ab8e(null,_0x2658e1);})[_0x9508('0x14')](function(_0x18b441){_0x42ab8e(_0x18b441);});};AGIVertices[_0x9508('0xf')][_0x9508('0x62')]=function(_0x5d0d94,_0x2db0af){var _0x2020bd={'uri':_0x5d0d94[_0x9508('0x63')],'method':_0x5d0d94['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5d0d94['timeout'])===_0x9508('0x64')&&parseInt(_0x5d0d94[_0x9508('0x65')])>=0x1?parseInt(_0x5d0d94[_0x9508('0x65')])*0x3e8:0x5*0x3e8};if(_[_0x9508('0x66')]([_0x9508('0x67'),_0x9508('0x68')],_0x2020bd[_0x9508('0x69')]['toUpperCase']())){try{_0x2020bd[_0x9508('0x6a')]=_0x5d0d94['rawBody']?JSON['parse'](_0x5d0d94[_0x9508('0x6b')]):{};}catch(_0x5b576a){logger[_0x9508('0x33')](_0x9508('0x6c'),_0x5b576a);}}try{_0x2020bd['headers']=_0x5d0d94[_0x9508('0xa')]?JSON['parse'](_0x5d0d94[_0x9508('0xa')]):{};}catch(_0x5d9dd2){logger[_0x9508('0x33')](_0x9508('0x6d'),_0x5d9dd2);}if(_0x5d0d94[_0x9508('0x6e')]){try{var _0x21c1b7=require(_0x5d0d94[_0x9508('0x6e')])[_0x9508('0x6f')](this,_0x2020bd);_0x2020bd[_0x9508('0x70')]=Mustache[_0x9508('0x71')](_0x5d0d94[_0x9508('0x63')],_0x21c1b7,{},['$$','$$']);if(_0x2020bd[_0x9508('0x72')]){_0x2020bd['headers']=JSON[_0x9508('0x73')](Mustache[_0x9508('0x71')](JSON[_0x9508('0x74')](_0x2020bd[_0x9508('0x72')]),_0x21c1b7,{},['$$','$$']));}if(_0x2020bd[_0x9508('0x6a')]){_0x2020bd[_0x9508('0x6a')]=JSON['parse'](Mustache['render'](JSON[_0x9508('0x74')](_0x2020bd[_0x9508('0x6a')]),_0x21c1b7,{},['$$','$$']));}}catch(_0x1ad750){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1ad750);}}rp(_0x2020bd)[_0x9508('0x12')](function(_0x525ce2){var _0x287a1b={'statusCode':_0x525ce2[_0x9508('0x75')]||0xc8,'statusMessage':_0x525ce2[_0x9508('0x76')]||'OK','headers':_0x525ce2['headers']||{},'body':_0x525ce2[_0x9508('0x6a')]||{}};_0x2db0af(null,_0x287a1b);})[_0x9508('0x14')](function(_0x212d04){var _0x3ea6e0={'statusCode':_0x212d04[_0x9508('0x75')]||0x1f4,'statusMessage':_0x212d04[_0x9508('0x77')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x212d04['options'][_0x9508('0x72')]||{},'body':_0x212d04[_0x9508('0x78')]['body']||{}};_0x2db0af(null,_0x3ea6e0);});};AGIVertices[_0x9508('0xf')][_0x9508('0x79')]=function(_0xdf4171,_0x4959a6){scripts['googleDialogflow'](this[_0x9508('0xd')]['uniqueid'],_0xdf4171[_0x9508('0x7a')],_0xdf4171[_0x9508('0x59')],_0xdf4171[_0x9508('0x7b')]||'en')[_0x9508('0x12')](function(_0x5af5e4){_0x4959a6(null,_0x5af5e4);})[_0x9508('0x14')](function(_0x178b03){_0x4959a6(_0x178b03);});};AGIVertices['prototype'][_0x9508('0x7c')]=function(_0x146d98,_0xa89fca){scripts['googleDialogflowV2'](this[_0x9508('0xd')]['uniqueid'],_0x146d98[_0x9508('0x7d')],_0x146d98[_0x9508('0x7e')],_0x146d98[_0x9508('0x7f')],_0x146d98[_0x9508('0x59')],_0x146d98[_0x9508('0x80')]||'en')[_0x9508('0x12')](function(_0x2f9f8d){_0xa89fca(null,_0x2f9f8d);})[_0x9508('0x14')](function(_0x234b3e){_0xa89fca(_0x234b3e);});};AGIVertices[_0x9508('0xf')][_0x9508('0x81')]=function(_0x2c271e,_0x33ff9c){scripts[_0x9508('0x81')](this[_0x9508('0xd')],_0x2c271e)[_0x9508('0x12')](function(_0x482b07){_0x33ff9c(null,_0x482b07);})[_0x9508('0x14')](function(_0x47cccc){_0x33ff9c(_0x47cccc);});};AGIVertices['prototype'][_0x9508('0x82')]=function(_0x3bb289,_0x1fa1e8){scripts['ispeechTTS'](_0x3bb289[_0x9508('0x7a')],_0x3bb289[_0x9508('0x59')],_0x3bb289[_0x9508('0x83')]||_0x9508('0x5b'),_0x3bb289[_0x9508('0x84')])[_0x9508('0x12')](function(_0x303d50){_0x1fa1e8(null,_0x303d50);})['catch'](function(_0x1368d2){_0x1fa1e8(_0x1368d2);});};AGIVertices['prototype'][_0x9508('0x85')]=function(_0x2db5ed,_0x1db47b,_0x3cfd6b){scripts[_0x9508('0x85')](_0x1db47b,_0x2db5ed[_0x9508('0x7a')],_0x2db5ed[_0x9508('0x86')]||_0x9508('0x5b'),this[_0x9508('0x87')](_0x2db5ed['model'])?_0x2db5ed[_0x9508('0x88')]:undefined)['then'](function(_0x55900d){_0x3cfd6b(null,_0x55900d);})[_0x9508('0x14')](function(_0x2851ba){_0x3cfd6b(_0x2851ba);});};AGIVertices[_0x9508('0xf')][_0x9508('0x89')]=function(_0x5e3e7a,_0x54e7e8){scripts[_0x9508('0x89')](_0x5e3e7a[_0x9508('0x8a')],_0x5e3e7a[_0x9508('0x8b')],_0x5e3e7a['aws_polly_region'],_0x5e3e7a[_0x9508('0x8c')]||'Amy',_0x5e3e7a['text'],_0x5e3e7a[_0x9508('0x8d')]||'text')[_0x9508('0x12')](function(_0x1d6547){_0x54e7e8(null,_0x1d6547);})[_0x9508('0x14')](function(_0x1d443a){_0x54e7e8(_0x1d443a);});};AGIVertices[_0x9508('0xf')][_0x9508('0x8e')]=function(_0x50ce8b,_0x4566ff){scripts[_0x9508('0x8e')](this['channel'][_0x9508('0x37')],_0x50ce8b['aws_access_key_id'],_0x50ce8b['aws_secret_access_key'],_0x50ce8b[_0x9508('0x8f')],_0x50ce8b[_0x9508('0x59')],_0x50ce8b[_0x9508('0x90')])[_0x9508('0x12')](function(_0x4c8bab){_0x4566ff(null,_0x4c8bab);})[_0x9508('0x14')](function(_0x3ae1a5){_0x4566ff(_0x3ae1a5);});};AGIVertices[_0x9508('0xf')][_0x9508('0x91')]=function(_0x5eeed0,_0x510ba6,_0x4ebc98){scripts[_0x9508('0x91')](_0x510ba6,_0x5eeed0[_0x9508('0x7a')],_0x5eeed0[_0x9508('0x92')]||_0x9508('0x5b'))[_0x9508('0x12')](function(_0x291240){_0x4ebc98(null,_0x291240);})[_0x9508('0x14')](function(_0x1ac4e2){_0x4ebc98(_0x1ac4e2);});};AGIVertices[_0x9508('0xf')][_0x9508('0x93')]=function(_0x21c8c9,_0x1d31e5,_0x721116){scripts[_0x9508('0x93')](_0x1d31e5,_0x21c8c9['appid'],_0x21c8c9[_0x9508('0x94')],_0x21c8c9['uri'])[_0x9508('0x12')](function(_0x4b7ba4){_0x721116(null,_0x4b7ba4);})[_0x9508('0x14')](function(_0x4477ee){_0x721116(_0x4477ee);});};AGIVertices[_0x9508('0xf')][_0x9508('0x95')]=function(_0x155d6d){var _0x25a599=_[_0x9508('0x66')](verticesWithRetry,_0x155d6d[_0x9508('0x38')])?_0x155d6d:_[_0x9508('0x96')](_0x155d6d);for(var _0x46bd70 in _0x25a599){if(_0x25a599[_0x9508('0x97')](_0x46bd70)){if(_0x25a599[_0x46bd70]&&_['isString'](_0x25a599[_0x46bd70])){if(_[_0x9508('0x66')](recursiveMapAttributes,_0x46bd70)){_0x25a599[_0x46bd70]=this[_0x9508('0x98')](_0x25a599[_0x46bd70]);}else{_0x25a599[_0x46bd70]=this['replaceAllVariables'](_0x25a599[_0x46bd70]);}}}}return _0x25a599;};AGIVertices[_0x9508('0xf')]['recursiveNodeIndex']=function(_0x41bcd9){for(var _0x1a0901 in _0x41bcd9){if(_0x41bcd9[_0x9508('0x97')](_0x1a0901)){if(_[_0x9508('0x99')](_0x41bcd9[_0x1a0901])){this[_0x9508('0x9a')](_0x41bcd9[_0x1a0901]);}else if(_[_0x9508('0x9b')](_0x41bcd9[_0x1a0901])){for(var _0x5293da=0x0;_0x5293da<_0x41bcd9[_0x1a0901][_0x9508('0x9c')];_0x5293da++){this['recursiveNodeIndex'](_0x41bcd9[_0x1a0901][_0x5293da]);}}else if(_[_0x9508('0x9d')](_0x41bcd9[_0x1a0901])){_0x41bcd9[_0x1a0901]=this['replaceAllVariables'](_0x41bcd9[_0x1a0901]);}}}};AGIVertices[_0x9508('0xf')][_0x9508('0x9e')]=function(_0x40cc62,_0xbeee60){for(var _0x2e2eb2 in _0x40cc62){if(_0x40cc62[_0x9508('0x97')](_0x2e2eb2)){if(_[_0x9508('0x99')](_0x40cc62[_0x2e2eb2])){if(!_[_0x9508('0x42')](_0x40cc62[_0x2e2eb2])){this[_0x9508('0x9e')](_0x40cc62[_0x2e2eb2],util[_0x9508('0x28')](_0x9508('0x9f'),_0xbeee60,_0x2e2eb2));}}else if(_[_0x9508('0x9b')](_0x40cc62[_0x2e2eb2])){for(var _0x3e8b0a=0x0;_0x3e8b0a<_0x40cc62[_0x2e2eb2]['length'];_0x3e8b0a++){this['saveRestApiResult'](_0x40cc62[_0x2e2eb2][_0x3e8b0a],util[_0x9508('0x28')]('%s.%s',_0xbeee60,_0x2e2eb2+'['+_0x3e8b0a+']'));}}else{if(!_['isNil'](_0x40cc62[_0x2e2eb2])){this['channel'][_0x9508('0xa0')](util[_0x9508('0x28')]('%s.%s',_0xbeee60,_0x2e2eb2),_0x40cc62[_0x2e2eb2]);}}}}};AGIVertices['prototype'][_0x9508('0x98')]=function(_0x230a76){try{var _0x58edee=JSON[_0x9508('0x73')](_0x230a76);this['recursiveNodeIndex'](_0x58edee);return JSON[_0x9508('0x74')](_0x58edee);}catch(_0x1127db){return this['replaceAllVariables'](_0x230a76);}};AGIVertices[_0x9508('0xf')]['replaceAllVariables']=function(_0x249476){var _0x979665=_0x249476[_0x9508('0xa1')]('{');for(var _0x3e35b8=0x1;_0x3e35b8<_0x979665['length'];_0x3e35b8+=0x1){var _0x380f11=_0x979665[_0x3e35b8]['split']('}');if(_0x380f11[_0x9508('0x9c')]>0x1){_0x249476=_0x249476[_0x9508('0xa2')]('{'+_0x380f11[0x0]+'}',this[_0x9508('0xd')][_0x9508('0x10')](_0x380f11[0x0])[_0x9508('0xa3')]||_0x380f11[0x0]);}}if(_0x979665[_0x9508('0x9c')]===0x1){return _0x249476[_0x9508('0x4a')]();}return this[_0x9508('0xa4')](_0x249476);};AGIVertices[_0x9508('0xf')][_0x9508('0xa5')]=function(_0x51b44c,_0x5ede0e){var _0x28cefb=this[_0x9508('0xd')][_0x9508('0x10')](_0x51b44c);if(_0x28cefb['result']===-0x1){return _0x28cefb;}logger[_0x9508('0x30')](util[_0x9508('0x28')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x5ede0e,_0x28cefb[_0x9508('0xa3')]));return this[_0x9508('0xd')][_0x9508('0xa0')](_0x5ede0e,_0x28cefb[_0x9508('0xa3')]);};AGIVertices['prototype'][_0x9508('0x87')]=function(_0x4a2646){return _0x4a2646&&_0x4a2646!=='0'&&_0x4a2646!=='-1'&&_0x4a2646!=='';};AGIVertices['prototype']['maxRetry']=function(_0x106251){this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x106251,'-');_0x106251[_0x9508('0xa6')]=_0x106251[_0x9508('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x9508('0xf')]['mrcpsynth']=function(_0x2802b4){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0xa8'),_0x2802b4[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x2802b4['text'])){return this[_0x9508('0xd')]['noop'](_0x9508('0xaa'));}var _0xb79d84='\x22'+_0x2802b4[_0x9508('0x59')]+'\x22';if(this['isConfigured'](_0x2802b4[_0x9508('0x78')])){_0xb79d84+=','+_0x2802b4['options'];}var _0x5a4db4=this[_0x9508('0xd')][_0x9508('0x54')]('MRCPSynth',_0xb79d84);if(_0x5a4db4[_0x9508('0xab')]===-0x1){return _0x5a4db4;}return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xad'),_0xb79d84));};AGIVertices[_0x9508('0xf')][_0x9508('0xae')]=function(_0x119c3a){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0xaf'),_0x119c3a[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x119c3a[_0x9508('0xb0')])){return this['channel'][_0x9508('0xac')](_0x9508('0xb1'));}var _0x3fd814=_0x119c3a[_0x9508('0xb0')];if(this['isConfigured'](_0x119c3a[_0x9508('0x78')])){_0x3fd814+=','+_0x119c3a[_0x9508('0x78')];}var _0x14314b=this[_0x9508('0xd')][_0x9508('0x54')](_0x9508('0xb2'),_0x3fd814);if(_0x14314b['result']===-0x1){return _0x14314b;}var _0x1fdf50=this[_0x9508('0xa5')](_0x9508('0xb3'),_0x9508('0xb4'));if(_0x1fdf50[_0x9508('0xab')]===-0x1){return _0x1fdf50;}var _0x49dbc6=this['getAndSetVariable'](_0x9508('0xb5'),_0x9508('0xb6'));if(_0x49dbc6[_0x9508('0xab')]===-0x1){return _0x49dbc6;}var _0xe77013=this[_0x9508('0xa5')](_0x9508('0xb7'),_0x9508('0xb8'));if(_0xe77013['result']===-0x1){return _0xe77013;}return this[_0x9508('0xd')]['noop'](util[_0x9508('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3fd814));};AGIVertices[_0x9508('0xf')][_0x9508('0x7')]=function(_0x10beb2){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0xb9'),_0x10beb2[_0x9508('0xa9')]));return this['channel'][_0x9508('0x7')]([_0x10beb2[_0x9508('0xba')],_0x10beb2['args']]);};AGIVertices[_0x9508('0xf')][_0x9508('0xbb')]=function(_0x19d8dd){logger['info'](util['format'](_0x9508('0xbc'),_0x19d8dd[_0x9508('0xa9')]));if(this[_0x9508('0x87')](_0x19d8dd['timeout'])){logger['info'](util[_0x9508('0x28')](_0x9508('0xbd'),_0x19d8dd[_0x9508('0x65')]));var _0x3ef7e3=this[_0x9508('0xd')][_0x9508('0xbe')](_0x19d8dd[_0x9508('0x65')]);if(_0x3ef7e3[_0x9508('0xab')]===-0x1){return _0x3ef7e3;}}return this[_0x9508('0xd')][_0x9508('0xbb')]();};AGIVertices[_0x9508('0xf')][_0x9508('0x47')]=function(_0xd931a4){logger['info'](util[_0x9508('0x28')](_0x9508('0xbf'),_0xd931a4['label']));if(!this[_0x9508('0x87')](_0xd931a4[_0x9508('0x46')])){return this[_0x9508('0xd')][_0x9508('0x33')](_0xd931a4,'no\x20list\x20selected');}_0xd931a4[_0x9508('0x49')]=moment();if(this[_0x9508('0x87')](_0xd931a4['delay'])){_0xd931a4[_0x9508('0x49')]=moment()['add'](_0xd931a4[_0x9508('0xc0')],'minutes');}if(!this[_0x9508('0x87')](_0xd931a4[_0x9508('0x4b')])){_0xd931a4[_0x9508('0x4b')]=0x2;}this[_0x9508('0x41')][_0x9508('0x6f')](this,_0xd931a4);return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xc1'),_0xd931a4[_0x9508('0x45')],_0xd931a4[_0x9508('0x46')],_0xd931a4[_0x9508('0x49')]));};AGIVertices['prototype'][_0x9508('0xc2')]=function(_0x1c19ef){logger[_0x9508('0x30')](util['format'](_0x9508('0xc3'),_0x1c19ef[_0x9508('0xa9')]));var _0x1d0e4c=this[_0x9508('0xd')][_0x9508('0x54')](_0x1c19ef['application'],_0x1c19ef[_0x9508('0x78')]);if(_0x1d0e4c[_0x9508('0xab')]===-0x1){return _0x1d0e4c;}return this[_0x9508('0xd')]['noop'](util['format'](_0x9508('0xc4'),_0x1c19ef[_0x9508('0xc5')],_0x1c19ef['options']));};AGIVertices[_0x9508('0xf')][_0x9508('0xc6')]=function(_0x24cfcd){logger['info'](util[_0x9508('0x28')](_0x9508('0xc7'),_0x24cfcd[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x24cfcd['text'])){return this['channel']['noop']('no\x20text\x20configured');}var _0x1a3a7d='\x22'+_0x24cfcd['text']+'\x22';if(this[_0x9508('0x87')](_0x24cfcd[_0x9508('0x78')])){_0x1a3a7d+=','+_0x24cfcd[_0x9508('0x78')];}var _0x423786=this[_0x9508('0xd')][_0x9508('0x54')]('MRCPSynth',_0x1a3a7d);if(_0x423786[_0x9508('0xab')]===-0x1){return _0x423786;}return this['channel'][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xad'),_0x1a3a7d));};AGIVertices['prototype']['sestektts']=function(_0x36ece0){logger[_0x9508('0x30')](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x36ece0[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x36ece0[_0x9508('0x59')])){return this[_0x9508('0xd')][_0x9508('0xac')]('no\x20text\x20configured');}var _0x1fb57c='\x22'+_0x36ece0[_0x9508('0x59')]+'\x22';if(this[_0x9508('0x87')](_0x36ece0[_0x9508('0x78')])){_0x1fb57c+=','+_0x36ece0['options'];}var _0x3a066f=this['channel'][_0x9508('0x54')](_0x9508('0xc8'),_0x1fb57c);if(_0x3a066f['result']===-0x1){return _0x3a066f;}return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xad'),_0x1fb57c));};AGIVertices[_0x9508('0xf')][_0x9508('0xc9')]=function(_0x1ea1b5){logger[_0x9508('0x30')](util[_0x9508('0x28')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x1ea1b5['label']));if(!this[_0x9508('0x87')](_0x1ea1b5[_0x9508('0xb0')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x1fa662=_0x1ea1b5[_0x9508('0xb0')];if(this[_0x9508('0x87')](_0x1ea1b5[_0x9508('0x78')])){_0x1fa662+=','+_0x1ea1b5[_0x9508('0x78')];}var _0x230fdf=this['channel'][_0x9508('0x54')](_0x9508('0xb2'),_0x1fa662);if(_0x230fdf['result']===-0x1){return _0x230fdf;}var _0x1f9e4c=this['getAndSetVariable'](_0x9508('0xb3'),'LUMENVOX_ASR_CONFIDENCE');if(_0x1f9e4c[_0x9508('0xab')]===-0x1){return _0x1f9e4c;}var _0x3ca7b4=this[_0x9508('0xa5')](_0x9508('0xb5'),_0x9508('0xca'));if(_0x3ca7b4[_0x9508('0xab')]===-0x1){return _0x3ca7b4;}var _0x2ad943=this['getAndSetVariable'](_0x9508('0xb7'),_0x9508('0xcb'));if(_0x2ad943[_0x9508('0xab')]===-0x1){return _0x2ad943;}return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xcc'),_0x1fa662));};AGIVertices[_0x9508('0xf')]['sestekasr']=function(_0xfb0e8e){logger['info'](util['format'](_0x9508('0xcd'),_0xfb0e8e[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0xfb0e8e[_0x9508('0xb0')])){return this['channel'][_0x9508('0xac')](_0x9508('0xb1'));}var _0x3e1a1b=_0xfb0e8e[_0x9508('0xb0')];if(this[_0x9508('0x87')](_0xfb0e8e[_0x9508('0x78')])){_0x3e1a1b+=','+_0xfb0e8e[_0x9508('0x78')];}var _0x4aaca8=this['channel'][_0x9508('0x54')]('MRCPRecog',_0x3e1a1b);if(_0x4aaca8[_0x9508('0xab')]===-0x1){return _0x4aaca8;}var _0x4153b8=this[_0x9508('0xa5')](_0x9508('0xb3'),_0x9508('0xce'));if(_0x4153b8[_0x9508('0xab')]===-0x1){return _0x4153b8;}var _0x57ebdb=this[_0x9508('0xa5')](_0x9508('0xb5'),_0x9508('0xcf'));if(_0x57ebdb[_0x9508('0xab')]===-0x1){return _0x57ebdb;}var _0x318779=this[_0x9508('0xa5')](_0x9508('0xb7'),'SESTEK_ASR_INSTANCE');if(_0x318779[_0x9508('0xab')]===-0x1){return _0x318779;}return this[_0x9508('0xd')]['noop'](util[_0x9508('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3e1a1b));};AGIVertices[_0x9508('0xf')]['database']=function(_0x6f2407){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0xd0'),_0x6f2407[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x6f2407[_0x9508('0xd1')])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x6f2407,_0x9508('0xd2'));}var _0x30884b=this[_0x9508('0x19')][_0x9508('0x6f')](this,_0x6f2407['odbc_id']);if(!_0x30884b){return this['channel']['error'](_0x6f2407,_0x9508('0xd3'));}if(!this[_0x9508('0x87')](_0x6f2407['query'])){return this[_0x9508('0xd')]['error'](_0x6f2407,'no\x20query\x20configured');}var _0x514173=_0x6f2407['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x9508('0xd')]['noop'](util[_0x9508('0x28')](_0x9508('0xd4'),_0x514173));var _0x37043b=this['getQueryOdbc']['sync'](this,_0x30884b,_0x514173);this[_0x9508('0x36')]['sync'](this,_0x6f2407,_0x514173);if(!this[_0x9508('0x87')](_0x6f2407['variable_id'])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xd5'));}var _0x178218=this[_0x9508('0x10')][_0x9508('0x6f')](this,_0x6f2407[_0x9508('0xd6')]);if(!_0x178218){return this[_0x9508('0xd')]['error'](_0x6f2407,'no\x20variable\x20found');}var _0x58c83b=this;_0x37043b[_0x9508('0xd7')](function(_0x5e0fe1,_0x25c003){Object[_0x9508('0xd8')](_0x5e0fe1)[_0x9508('0xd7')](function(_0x2264e7){_0x58c83b[_0x9508('0xd')][_0x9508('0xa0')](util[_0x9508('0x28')](_0x9508('0xd9'),_0x178218,_0x25c003,_0x2264e7),_0x5e0fe1[_0x2264e7]);});});this[_0x9508('0xd')][_0x9508('0xa0')](util[_0x9508('0x28')](_0x9508('0xda'),_0x178218),_0x37043b[_0x9508('0x9c')]);return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xdb'),_0x178218));};AGIVertices[_0x9508('0xf')][_0x9508('0xdc')]=function(_0x18f2cc){logger['debug'](util[_0x9508('0x28')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x18f2cc['label']));if(!this[_0x9508('0x87')](_0x18f2cc[_0x9508('0xdd')])){return this['channel'][_0x9508('0x33')](_0x18f2cc,_0x9508('0xde'));}var _0x336272=this[_0x9508('0x1b')][_0x9508('0x6f')](this,_0x18f2cc['sip_id']);if(!_0x336272){return this[_0x9508('0xd')]['error'](_0x18f2cc,_0x9508('0xdf'));}var _0x5e3e51=this[_0x9508('0xd')][_0x9508('0x54')]('DIAL',[util[_0x9508('0x28')](_0x9508('0xe0'),_0x336272),_0x18f2cc['timeout'],_0x18f2cc[_0x9508('0xe1')],_0x18f2cc['url']]);if(_0x5e3e51['result']===-0x1){return _0x5e3e51;}return this['channel'][_0x9508('0xac')](util[_0x9508('0x28')]('Executed\x20command\x20%s',_0x9508('0xe2')));};AGIVertices['prototype'][_0x9508('0xe3')]=function(_0x27562c){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0xe4'),_0x27562c[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x27562c['key'])){return this[_0x9508('0xd')][_0x9508('0xac')]('no\x20key\x20configured');}if(!this[_0x9508('0x87')](_0x27562c['text'])){return this[_0x9508('0xd')]['noop']('no\x20text\x20configured');}this[_0x9508('0xd')]['bot']=!![];this[_0x9508('0x36')](_0x27562c);this[_0x9508('0x40')](_0x27562c[_0x9508('0x59')],'in','','');this['channel']['noop'](util[_0x9508('0x28')]('Trying\x20Dialogflow:\x20%s',_0x27562c[_0x9508('0x59')]));var _0x1a9606=this[_0x9508('0x79')][_0x9508('0x6f')](this,_0x27562c);if(_0x1a9606){for(var _0x4c6d79 in _0x1a9606){if(_0x1a9606[_0x9508('0x97')](_0x4c6d79)){this['channel']['setVariable'](util['format'](_0x9508('0xe5'),_0x4c6d79[_0x9508('0xe6')]()),_0x1a9606[_0x4c6d79]);}}this['createSquareMessage'](_0x1a9606[_0x9508('0xe7')],'out',_0x9508('0xe3'),'');return this['channel']['noop'](util[_0x9508('0x28')](_0x9508('0xe8'),_0x1a9606[_0x9508('0xe7')]));}return this[_0x9508('0xd')][_0x9508('0x33')](_0x27562c,_0x9508('0xe9'));};AGIVertices[_0x9508('0xf')][_0x9508('0xea')]=function(_0x58d201){logger['info'](util[_0x9508('0x28')](_0x9508('0xeb'),_0x58d201[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x58d201[_0x9508('0x7d')])){return this[_0x9508('0xd')]['noop'](_0x9508('0xec'));}if(!this[_0x9508('0x87')](_0x58d201[_0x9508('0x7e')])){return this['channel'][_0x9508('0xac')](_0x9508('0xed'));}if(!this[_0x9508('0x87')](_0x58d201[_0x9508('0x7f')])){return this[_0x9508('0xd')]['noop'](_0x9508('0xee'));}if(!this['isConfigured'](_0x58d201[_0x9508('0x80')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xef'));}if(!this[_0x9508('0x87')](_0x58d201[_0x9508('0x59')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xaa'));}this[_0x9508('0xd')][_0x9508('0xf0')]=!![];this[_0x9508('0x36')](_0x58d201);this[_0x9508('0x40')](_0x58d201[_0x9508('0x59')],'in','','');this[_0x9508('0xd')]['noop'](util[_0x9508('0x28')]('Trying\x20DialogflowV2:\x20%s',_0x58d201['text']));var _0x4fd315=this[_0x9508('0x7c')][_0x9508('0x6f')](this,_0x58d201);if(_0x4fd315){for(var _0xa0cf80 in _0x4fd315){if(_0x4fd315[_0x9508('0x97')](_0xa0cf80)){if(_0xa0cf80!=='providerResponse'){this[_0x9508('0xd')][_0x9508('0xa0')](util[_0x9508('0x28')]('DIALOGFLOW_%s',_0xa0cf80[_0x9508('0xe6')]()),_0x4fd315[_0xa0cf80]);}}}this['createSquareMessage'](_0x4fd315[_0x9508('0xe7')],_0x9508('0xf1'),'dialogflowV2',_0x4fd315[_0x9508('0xf2')]);return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xf3'),_0x4fd315['speech']));}return this[_0x9508('0xd')]['error'](_0x58d201,_0x9508('0xf4'));};AGIVertices['prototype'][_0x9508('0xf5')]=function(_0x18b597){logger[_0x9508('0x30')](util[_0x9508('0x28')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x18b597[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x18b597[_0x9508('0xf6')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xf7'));}if(!this['isConfigured'](_0x18b597[_0x9508('0xf8')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xf9'));}if(!this[_0x9508('0x87')](_0x18b597[_0x9508('0xfa')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xfb'));}if(!this[_0x9508('0x87')](_0x18b597[_0x9508('0xfc')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xaa'));}this[_0x9508('0xd')][_0x9508('0xf0')]=!![];this[_0x9508('0x36')](_0x18b597);this['createSquareMessage'](_0x18b597['text'],'in','','');this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xfd'),_0x18b597[_0x9508('0x59')]));var _0x13b61e=this[_0x9508('0x81')][_0x9508('0x6f')](this,_0x18b597);if(_0x13b61e){for(var _0x43cc15 in _0x13b61e){if(_0x13b61e[_0x9508('0x97')](_0x43cc15)){this[_0x9508('0xd')][_0x9508('0xa0')](util[_0x9508('0x28')]('SESTEK_NDA_%s',_0x43cc15[_0x9508('0xe6')]()),_0x13b61e[_0x43cc15]);}}this[_0x9508('0x40')](_0x13b61e[_0x9508('0xe7')],_0x9508('0xf1'),_0x9508('0xf5'),'');if(_0x13b61e[_0x9508('0xfe')]){this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x13b61e[_0x9508('0xfe')]));var _0x1e4ad2=this[_0x9508('0xd')][_0x9508('0xff')](_0x13b61e[_0x9508('0xfe')]);try{fs[_0x9508('0x100')](_0x13b61e[_0x9508('0xfe')]+'.wav');}catch(_0x2ba82a){logger[_0x9508('0x33')](_0x2ba82a);}return _0x1e4ad2;}else{return this['channel'][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x101'),_0x13b61e['speech']));}}return this['channel'][_0x9508('0x33')](_0x18b597,_0x9508('0x102'));};AGIVertices[_0x9508('0xf')][_0x9508('0x103')]=function(_0x16498b){logger[_0x9508('0x30')](util['format'](_0x9508('0x104'),_0x16498b[_0x9508('0xa9')]));return this['channel']['noop'](_0x9508('0x103'));};AGIVertices[_0x9508('0xf')][_0x9508('0x105')]=function(_0x327ecd){logger['info'](util[_0x9508('0x28')](_0x9508('0x106'),_0x327ecd[_0x9508('0xa9')]));var _0x59a048='';if(_0x327ecd[_0x9508('0x107')]){if(!this[_0x9508('0x87')](_0x327ecd[_0x9508('0x107')])){return this[_0x9508('0xd')]['error'](_0x327ecd,'no\x20trunk\x20selected');}else{var _0x1af797=parseInt(_0x327ecd[_0x9508('0x107')],0xa);if(isNaN(_0x1af797)){_0x59a048=_0x327ecd[_0x9508('0x107')];}else{_0x59a048=this[_0x9508('0x1c')]['sync'](this,_0x327ecd[_0x9508('0x107')]);if(!_0x59a048){return this[_0x9508('0xd')][_0x9508('0x33')](_0x327ecd,_0x9508('0x108'));}}}}else if(_0x327ecd[_0x9508('0x109')]){_0x59a048=_0x327ecd[_0x9508('0x109')];}else{return this[_0x9508('0xd')]['error'](_0x327ecd,_0x9508('0x10a'));}var _0x315832=this[_0x9508('0xd')]['exec']('DIAL',[util[_0x9508('0x28')](_0x9508('0x10b'),_0x59a048,_0x327ecd['phone']),_0x327ecd[_0x9508('0x65')],_0x327ecd['opts'],_0x327ecd[_0x9508('0x63')]]);if(_0x315832[_0x9508('0xab')]===-0x1){return _0x315832;}return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x10c'),_0x9508('0xe2')));};AGIVertices[_0x9508('0xf')]['finally']=function(_0xfaa587){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x10d'),_0xfaa587[_0x9508('0xa9')]));return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0x10e'));};AGIVertices[_0x9508('0xf')]['getdigits']=function(_0x4f0416){logger[_0x9508('0x30')](util[_0x9508('0x28')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x4f0416['label']));if(_0x4f0416[_0x9508('0xa6')]===0x0){return this[_0x9508('0xa7')](_0x4f0416);}_0x4f0416['retry']-=0x1;if(!this['isConfigured'](_0x4f0416[_0x9508('0x10f')])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x4f0416,_0x9508('0x110'));}var _0x22861c=this['getSound'][_0x9508('0x6f')](this,_0x4f0416[_0x9508('0x10f')]);if(!_0x22861c){return this[_0x9508('0xd')][_0x9508('0x33')](_0x4f0416,_0x9508('0x111'));}if(!this[_0x9508('0x87')](_0x4f0416['variable_id'])){return this[_0x9508('0xd')][_0x9508('0x33')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x12d9b1=this['channel'][_0x9508('0x112')](_0x22861c,_0x4f0416['response'],_0x4f0416[_0x9508('0x113')]);var _0x517c68=_0x12d9b1['result']?_0x12d9b1['result'][_0x9508('0x4a')]():'';logger[_0x9508('0x30')]('test',JSON[_0x9508('0x74')](_0x12d9b1));if(_0x12d9b1['result']===-0x1){this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x4f0416,_0x517c68);return _0x12d9b1;}else if(_0x12d9b1[_0x9508('0xa3')]==='timeout'){_0x12d9b1[_0x9508('0xab')]=_0x517c68['length']>=parseInt(_0x4f0416['mindigit'])?'x':'i';}else{_0x12d9b1[_0x9508('0xab')]=_0x517c68[_0x9508('0x9c')]>=parseInt(_0x4f0416[_0x9508('0x114')])&&_0x517c68[_0x9508('0x9c')]<=parseInt(_0x4f0416[_0x9508('0x113')])?'x':'i';}var _0x5871b9=this['getVariable'][_0x9508('0x6f')](this,_0x4f0416[_0x9508('0xd6')]);if(!_0x5871b9){return this['channel'][_0x9508('0x33')](_0x4f0416,_0x9508('0x115'));}this[_0x9508('0xd')]['setVariable'](_0x5871b9,_0x517c68);if(this[_0x9508('0x87')](_0x4f0416[_0x9508('0x116')])){var _0x4e9dc4=parseInt(_0x4f0416[_0x9508('0x116')],0xa);var _0x4059cb=rs[_0x9508('0x117')]({'charset':'*','length':_0x4e9dc4});var _0x30a70f=_0x517c68[_0x9508('0x9c')];if(_0x30a70f>0x0){if(_0x30a70f>_0x4e9dc4){this['createSquareDetailsReport']['sync'](this,_0x4f0416,_0x4f0416[_0x9508('0x118')]===_0x9508('0x119')?_0x4059cb+_0x517c68[_0x9508('0x11a')](_0x4e9dc4):_0x517c68[_0x9508('0x11a')](0x0,_0x30a70f-_0x4e9dc4)+_0x4059cb);}else{this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x4f0416,rs['generate']({'charset':'*','length':_0x30a70f}));}}else{this[_0x9508('0x36')]['sync'](this,_0x4f0416,'');}}else{this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x4f0416,_0x517c68);}return _0x12d9b1;};AGIVertices[_0x9508('0xf')][_0x9508('0x11b')]=function(_0x58cf1c){logger[_0x9508('0x30')](util[_0x9508('0x28')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x58cf1c['label']));return this[_0x9508('0xc')](_0x58cf1c);};AGIVertices[_0x9508('0xf')][_0x9508('0x11c')]=function(_0x48d589){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x11d'),_0x48d589[_0x9508('0xa9')]));this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x48d589,_0x48d589['goalname']);return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')]('GOAL\x20%s',_0x48d589['goalname']));};AGIVertices[_0x9508('0xf')][_0x9508('0x11e')]=function(_0x211f7e){logger[_0x9508('0x30')](util[_0x9508('0x28')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x211f7e['label']));if(!this[_0x9508('0x87')](_0x211f7e[_0x9508('0x8a')])||!this[_0x9508('0x87')](_0x211f7e['aws_secret_access_key'])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0x11f'));}if(!this['isConfigured'](_0x211f7e[_0x9508('0x59')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xaa'));}this['channel'][_0x9508('0xac')](util['format'](_0x9508('0x120'),_0x211f7e[_0x9508('0x59')]));var _0xf7cad5=this[_0x9508('0x89')][_0x9508('0x6f')](this,_0x211f7e);if(_0xf7cad5){this[_0x9508('0xd')][_0x9508('0xac')](util['format'](_0x9508('0x121'),_0xf7cad5));var _0x1d3059=this[_0x9508('0xd')][_0x9508('0xff')](_0xf7cad5);try{fs['unlink'](_0xf7cad5+'.wav');}catch(_0x5db5e6){logger[_0x9508('0x33')](_0x5db5e6);}return _0x1d3059;}return this[_0x9508('0xd')][_0x9508('0x33')](_0x211f7e,_0x9508('0x122'));};AGIVertices['prototype'][_0x9508('0x123')]=function(_0x2a5e13){logger['info'](util[_0x9508('0x28')](_0x9508('0x124'),_0x2a5e13['label']));if(!this[_0x9508('0x87')](_0x2a5e13['aws_access_key_id'])||!this[_0x9508('0x87')](_0x2a5e13[_0x9508('0x8b')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0x11f'));}if(!this['isConfigured'](_0x2a5e13[_0x9508('0x90')])){return this[_0x9508('0xd')]['noop']('no\x20bot\x20name\x20configured');}if(!this[_0x9508('0x87')](_0x2a5e13[_0x9508('0x59')])){return this[_0x9508('0xd')][_0x9508('0xac')]('no\x20text\x20configured');}this[_0x9508('0xd')][_0x9508('0xf0')]=!![];this[_0x9508('0x36')](_0x2a5e13);this[_0x9508('0x40')](_0x2a5e13[_0x9508('0x59')],'in','','');this['channel']['noop'](util[_0x9508('0x28')](_0x9508('0x125'),_0x2a5e13['text']));var _0x46620f=this[_0x9508('0x8e')][_0x9508('0x6f')](this,_0x2a5e13);if(_0x46620f){for(var _0x4f5418 in _0x46620f){if(_0x46620f[_0x9508('0x97')](_0x4f5418)&&_[_0x9508('0x9d')](_0x46620f[_0x4f5418])){this[_0x9508('0xd')][_0x9508('0xa0')](util[_0x9508('0x28')]('AWS_LEX_%s',_0x4f5418['toUpperCase']()),_0x46620f[_0x4f5418]);}}if(_['isNil'](_0x46620f[_0x9508('0x77')])){return this['channel'][_0x9508('0xac')](_0x9508('0x126'));}else{this[_0x9508('0x40')](_0x46620f[_0x9508('0x77')],_0x9508('0xf1'),_0x9508('0x127'),'');return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x128'),_0x46620f[_0x9508('0x77')]));}}return this[_0x9508('0xd')][_0x9508('0x33')](_0x2a5e13,_0x9508('0x129'));};AGIVertices['prototype'][_0x9508('0x12a')]=function(_0x3f3715){logger[_0x9508('0x30')](util['format'](_0x9508('0x12b'),_0x3f3715['label'],_0x3f3715[_0x9508('0x65')]));if(!this[_0x9508('0x87')](_0x3f3715[_0x9508('0x7a')])){return this['channel'][_0x9508('0xac')]('no\x20key\x20configured');}var _0x91599b=_0x9508('0x12c');var _0x3e9ecf=util[_0x9508('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0x9508('0x117')](0x4));var _0x180387=util[_0x9508('0x28')]('%s.%s',_0x3e9ecf,_0x91599b);var _0x514933=!![];if(_0x3f3715[_0x9508('0x12d')]==='NOBEEP'){_0x514933=![];}var _0x3e1b3b=this[_0x9508('0xd')][_0x9508('0x12e')](_0x3e9ecf,_0x91599b,_0x3f3715[_0x9508('0x12f')],_0x3f3715[_0x9508('0x65')],undefined,_0x514933);if(_0x3e1b3b[_0x9508('0xab')]!==-0x1){this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x130'),_0x180387));var _0x66a2ec=this[_0x9508('0x91')][_0x9508('0x6f')](this,_0x3f3715,_0x180387);if(_0x66a2ec){for(var _0x6c43be in _0x66a2ec){if(_0x66a2ec[_0x9508('0x97')](_0x6c43be)){this['channel'][_0x9508('0xa0')](util[_0x9508('0x28')](_0x9508('0x131'),_0x6c43be[_0x9508('0xe6')]()),_0x66a2ec[_0x6c43be]);}}return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')]('GoogleASR\x20Result\x20%s',JSON[_0x9508('0x74')](_0x66a2ec)));}}return _0x3e1b3b;};AGIVertices[_0x9508('0xf')][_0x9508('0x132')]=function(_0x124303){logger[_0x9508('0x30')](util[_0x9508('0x28')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x124303[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x124303['appid'])){return this[_0x9508('0xd')][_0x9508('0xac')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0x124303[_0x9508('0x94')])){return this[_0x9508('0xd')]['noop'](_0x9508('0x133'));}var _0x220e1f='wav';var _0x946f0f=util[_0x9508('0x28')](_0x9508('0x134'),FILES_PATH,rs['generate'](0x4));var _0x4c620c=util[_0x9508('0x28')](_0x9508('0x9f'),_0x946f0f,_0x220e1f);var _0x60c722=!![];if(_0x124303[_0x9508('0x12d')]===_0x9508('0x135')){_0x60c722=![];}var _0x4a1f78=this[_0x9508('0xd')][_0x9508('0x12e')](_0x946f0f,_0x220e1f,_0x124303[_0x9508('0x12f')],_0x124303[_0x9508('0x65')],undefined,_0x60c722);if(_0x4a1f78[_0x9508('0xab')]!==-0x1){this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x136'),_0x4c620c));var _0xa8ae21=this['tildeASR']['sync'](this,_0x124303,_0x4c620c);if(_0xa8ae21){for(var _0x541372 in _0xa8ae21){if(_0xa8ae21['hasOwnProperty'](_0x541372)){this[_0x9508('0xd')][_0x9508('0xa0')](util[_0x9508('0x28')](_0x9508('0x137'),_0x541372[_0x9508('0xe6')]()),_0xa8ae21[_0x541372]);}}return this[_0x9508('0xd')][_0x9508('0xac')](util['format'](_0x9508('0x138'),JSON['stringify'](_0xa8ae21)));}}return _0x4a1f78;};AGIVertices['prototype'][_0x9508('0x139')]=function(_0x36afbb){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x13a'),_0x36afbb['label']));return this[_0x9508('0xd')]['continueAt'](_0x36afbb['context'],_0x36afbb[_0x9508('0x3d')],_0x36afbb[_0x9508('0x3e')]);};AGIVertices['prototype'][_0x9508('0x13b')]=function(_0x18404e){logger[_0x9508('0x30')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x18404e[_0x9508('0xa9')]));if(!this['isConfigured'](_0x18404e[_0x9508('0x13c')])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x18404e,_0x9508('0x13d'));}try{var _0x32acf7=eval(_0x18404e[_0x9508('0x13c')])?_0x9508('0x13e'):_0x9508('0x13f');this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x140'),_0x18404e['condition'],_0x32acf7));return{'code':0xc8,'result':_0x32acf7};}catch(_0x4bc03d){return{'code':0xc8,'result':_0x9508('0x13f')};}};AGIVertices[_0x9508('0xf')][_0x9508('0x141')]=function(_0x4b9806){logger['info'](util[_0x9508('0x28')](_0x9508('0x142'),_0x4b9806[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x4b9806[_0x9508('0x143')])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x4b9806,_0x9508('0x144'));}var _0x5e14d2=this[_0x9508('0x145')][_0x9508('0x6f')](this,_0x4b9806['interval_id']);if(!_0x5e14d2){return this[_0x9508('0xd')][_0x9508('0x33')](_0x4b9806,'no\x20intervals\x20found');}for(var _0x786bdf=0x0;_0x786bdf<_0x5e14d2[_0x9508('0x9c')];_0x786bdf+=0x1){var _0x7db152=this[_0x9508('0xd')][_0x9508('0x10')](util[_0x9508('0x28')](_0x9508('0x146'),_0x5e14d2[_0x786bdf]));if(_0x7db152[_0x9508('0xab')]===-0x1){return _0x7db152;}logger[_0x9508('0x30')](util[_0x9508('0x28')]('IFTIME\x20%s\x20%s',_0x5e14d2[_0x786bdf],_0x7db152[_0x9508('0xa3')]));if(_0x7db152[_0x9508('0xa3')]===_0x9508('0x13e')){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x147'),_0x5e14d2[_0x786bdf],'true'));this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x147'),_0x5e14d2[_0x786bdf],_0x9508('0x13e')));return{'code':0xc8,'result':_0x9508('0x13e')};}else{logger['info'](util['format'](_0x9508('0x147'),_0x5e14d2[_0x786bdf],_0x9508('0x13f')));this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x147'),_0x5e14d2[_0x786bdf],_0x9508('0x13f')));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0x9508('0x148')]=function(_0x455508){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x149'),_0x455508['label']));return this[_0x9508('0xd')]['hangup']();};AGIVertices['prototype'][_0x9508('0x14a')]=function(_0x1ca3e5){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x14b'),_0x1ca3e5[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x1ca3e5[_0x9508('0x7a')])){return this['channel'][_0x9508('0xac')]('no\x20key\x20configured');}var _0x15b8d0='wav';var _0x42e701=util[_0x9508('0x28')](_0x9508('0x134'),FILES_PATH,rs[_0x9508('0x117')](0x4));var _0x8cdc4a=util[_0x9508('0x28')]('%s.%s',_0x42e701,_0x15b8d0);var _0x21a922=!![];if(_0x1ca3e5[_0x9508('0x12d')]===_0x9508('0x135')){_0x21a922=![];}var _0x38d7ec=this[_0x9508('0xd')][_0x9508('0x12e')](_0x42e701,_0x15b8d0,_0x1ca3e5['intKey'],_0x1ca3e5[_0x9508('0x65')],undefined,_0x21a922);if(_0x38d7ec[_0x9508('0xab')]!==-0x1){this['channel'][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x14c'),_0x8cdc4a));var _0x3770ca=this[_0x9508('0x85')][_0x9508('0x6f')](this,_0x1ca3e5,_0x8cdc4a);if(_0x3770ca){for(var _0x6584b9 in _0x3770ca){if(_0x3770ca[_0x9508('0x97')](_0x6584b9)){this[_0x9508('0xd')][_0x9508('0xa0')](util[_0x9508('0x28')](_0x9508('0x14d'),_0x6584b9[_0x9508('0xe6')]()),_0x3770ca[_0x6584b9]);}}return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')]('IspeechASR\x20Result\x20%s',JSON[_0x9508('0x74')](_0x3770ca)));}}return _0x38d7ec;};AGIVertices[_0x9508('0xf')][_0x9508('0x14e')]=function(_0x16bd55){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x14f'),_0x16bd55['label']));if(!this[_0x9508('0x87')](_0x16bd55[_0x9508('0x7a')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0x150'));}if(!this[_0x9508('0x87')](_0x16bd55['text'])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xaa'));}this[_0x9508('0xd')]['noop'](util[_0x9508('0x28')]('Trying\x20ispeech\x20TTS\x20%s',_0x16bd55[_0x9508('0x59')]));var _0x189dac=this['ispeechTTS'][_0x9508('0x6f')](this,_0x16bd55);if(_0x189dac){this[_0x9508('0xd')][_0x9508('0xac')](util['format'](_0x9508('0x14c'),_0x189dac));var _0x4ab60e=this['channel'][_0x9508('0xff')](_0x189dac,_0x16bd55[_0x9508('0x12f')]);try{fs[_0x9508('0x100')](_0x189dac+_0x9508('0x151'));}catch(_0x4698ea){logger[_0x9508('0x33')](_0x4698ea);}return _0x4ab60e;}return this[_0x9508('0xd')][_0x9508('0x33')](_0x16bd55,_0x9508('0x152'));};AGIVertices[_0x9508('0xf')][_0x9508('0x153')]=function(_0x3b9af2){logger[_0x9508('0x30')](util['format'](_0x9508('0x154'),_0x3b9af2[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x3b9af2[_0x9508('0x155')])){return this[_0x9508('0xd')]['error'](_0x3b9af2,_0x9508('0x156'));}logger[_0x9508('0x30')](util[_0x9508('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x9508('0xd')]['callerid'],_0x3b9af2[_0x9508('0x155')]));var _0x546c68=this[_0x9508('0x52')]['sync'](this,_0x3b9af2['findBy']);if(_0x546c68){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x157'),this[_0x9508('0xd')]['callerid'],_0x3b9af2['findBy']));this['channel'][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x157'),this[_0x9508('0xd')]['callerid'],_0x3b9af2['findBy']));return{'code':0xc8,'result':_0x9508('0x158')};}else{logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x159'),this['channel']['callerid'],_0x3b9af2[_0x9508('0x155')]));this[_0x9508('0xd')]['noop'](util[_0x9508('0x28')](_0x9508('0x159'),this['channel'][_0x9508('0x3a')],_0x3b9af2['findBy']));return{'code':0xc8,'result':_0x9508('0x15a')};}};AGIVertices[_0x9508('0xf')][_0x9508('0x15b')]=function(_0x1fa941){logger['info'](util[_0x9508('0x28')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x1fa941[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x1fa941[_0x9508('0x155')])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x1fa941,'no\x20find\x20by\x20configured');}logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x15c'),this[_0x9508('0xd')]['callerid'],_0x1fa941[_0x9508('0x155')]));var _0x5e6175=this[_0x9508('0x50')][_0x9508('0x6f')](this,_0x1fa941['findBy']);if(_0x5e6175){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x157'),this['channel']['callerid'],_0x1fa941['findBy']));this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x157'),this[_0x9508('0xd')]['callerid'],_0x1fa941[_0x9508('0x155')]));return{'code':0xc8,'result':_0x9508('0x158')};}else{logger[_0x9508('0x30')](util['format'](_0x9508('0x159'),this[_0x9508('0xd')][_0x9508('0x3a')],_0x1fa941[_0x9508('0x155')]));this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x159'),this['channel'][_0x9508('0x3a')],_0x1fa941['findBy']));return{'code':0xc8,'result':_0x9508('0x15a')};}};AGIVertices['prototype'][_0x9508('0x15d')]=function(_0x54250d){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x15e'),_0x54250d['label']));if(!this[_0x9508('0x87')](_0x54250d['operation'])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x54250d,_0x9508('0x15f'));}this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x160'),_0x54250d[_0x9508('0x161')]));var _0x3e7a4a=eval(_0x54250d['operation']);if(!this[_0x9508('0x87')](_0x54250d['variable_id'])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xd5'));}var _0x2db146=this['getVariable'][_0x9508('0x6f')](this,_0x54250d['variable_id']);if(!_0x2db146){return this[_0x9508('0xd')]['error'](_0x54250d,_0x9508('0x115'));}if(_[_0x9508('0x9b')](_0x3e7a4a)){var _0x36ae5a=this;_0x3e7a4a['forEach'](function(_0x3dc2bf,_0x1a24f8){_0x36ae5a['channel'][_0x9508('0xa0')](util[_0x9508('0x28')]('%s[%s]',_0x2db146,_0x1a24f8),_0x3dc2bf);});return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x162'),_0x2db146));}else{return this['channel']['setVariable'](_0x2db146,_0x3e7a4a);}};AGIVertices['prototype'][_0x9508('0xb')]=function(_0x3639a8){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x163'),_0x3639a8[_0x9508('0xa9')]));if(_0x3639a8[_0x9508('0xa6')]===0x0){return this['maxRetry'](_0x3639a8);}_0x3639a8[_0x9508('0xa6')]-=0x1;if(!this['isConfigured'](_0x3639a8['file_id'])){return this[_0x9508('0xd')]['error'](_0x3639a8,_0x9508('0x110'));}var _0x5925ed=this[_0x9508('0x164')]['sync'](this,_0x3639a8['file_id']);if(!_0x5925ed){return this[_0x9508('0xd')][_0x9508('0x33')](_0x3639a8,_0x9508('0x111'));}var _0x449173=this[_0x9508('0xd')][_0x9508('0x112')](_0x5925ed,_0x3639a8[_0x9508('0x165')],_0x3639a8[_0x9508('0x166')]);var _0x36b5db=_0x449173[_0x9508('0xab')];if(_0x449173[_0x9508('0xab')]===-0x1){this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x3639a8,'-1');return _0x449173;}else if(_0x449173[_0x9508('0xa3')]==='timeout'){_0x449173['result']=_0x449173[_0x9508('0xab')][_0x9508('0x9c')]>0x0?_0x449173[_0x9508('0xab')]:'t';}else if(_[_0x9508('0x42')](_0x449173[_0x9508('0xab')])){_0x449173[_0x9508('0xab')]='#';_0x36b5db='#';}if(!this[_0x9508('0x87')](_0x3639a8[_0x9508('0xd6')])){this['channel'][_0x9508('0xac')](_0x9508('0xd5'));}else{var _0xacb7bd=this[_0x9508('0x10')][_0x9508('0x6f')](this,_0x3639a8[_0x9508('0xd6')]);if(!_0xacb7bd){return this[_0x9508('0xd')][_0x9508('0x33')](_0x3639a8,_0x9508('0x115'));}this['channel'][_0x9508('0xa0')](_0xacb7bd,_0x36b5db);}this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x3639a8,_0x36b5db);return _0x449173;};AGIVertices['prototype'][_0x9508('0xac')]=function(_0x4487f6){logger[_0x9508('0x30')](util['format'](_0x9508('0x167'),_0x4487f6['label']));return this[_0x9508('0xd')][_0x9508('0xac')](_0x4487f6['output']||_0x4487f6[_0x9508('0xa9')]);};AGIVertices[_0x9508('0xf')]['pause']=function(_0x5580ea){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x168'),_0x5580ea[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x5580ea[_0x9508('0x155')])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x5580ea,_0x9508('0x156'));}logger['info'](util['format'](_0x9508('0x15c'),this[_0x9508('0xd')]['callerid'],_0x5580ea['findBy']));var _0xebf2ed=this[_0x9508('0x4c')][_0x9508('0x6f')](this,_0x5580ea['pause_id']);var _0x3235c1=this[_0x9508('0x4f')]['sync'](this,_0x5580ea[_0x9508('0x155')],_0xebf2ed);if(_0x3235c1){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x157'),this[_0x9508('0xd')][_0x9508('0x3a')],_0x5580ea[_0x9508('0x155')]));this['channel'][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x157'),this[_0x9508('0xd')][_0x9508('0x3a')],_0x5580ea[_0x9508('0x155')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format'](_0x9508('0x159'),this[_0x9508('0xd')]['callerid'],_0x5580ea['findBy']));this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x157'),this[_0x9508('0xd')][_0x9508('0x3a')],_0x5580ea[_0x9508('0x155')]));return{'code':0xc8,'result':_0x9508('0x15a')};}};AGIVertices[_0x9508('0xf')][_0x9508('0x169')]=function(_0x155f5e){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x16a'),_0x155f5e[_0x9508('0xa9')]));if(!this['isConfigured'](_0x155f5e[_0x9508('0x10f')])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x155f5e,_0x9508('0x110'));}var _0x4a8ef8=this[_0x9508('0x164')][_0x9508('0x6f')](this,_0x155f5e[_0x9508('0x10f')]);if(!_0x4a8ef8){return this[_0x9508('0xd')][_0x9508('0x33')](_0x155f5e,'no\x20file\x20audio\x20found');}var _0x1c7b32=this[_0x9508('0xd')][_0x9508('0x54')]('PLAYBACK',[_0x4a8ef8,_0x155f5e[_0x9508('0xe1')]]);if(_0x1c7b32[_0x9508('0xab')]===-0x1){return _0x1c7b32;}return this['channel'][_0x9508('0xac')](util['format']('Executed\x20command\x20%s\x20%s',_0x9508('0x16b'),_0x4a8ef8));};AGIVertices[_0x9508('0xf')][_0x9508('0x16c')]=function(_0x33c3ff){logger[_0x9508('0x30')](util[_0x9508('0x28')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x33c3ff[_0x9508('0xa9')]));if(!this['isConfigured'](_0x33c3ff['queue_id'])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x33c3ff,'no\x20queue\x20selected');}var _0x1a8c8e='';var _0x4b582f=parseInt(_0x33c3ff[_0x9508('0x16d')],0xa);if(isNaN(_0x4b582f)){_0x1a8c8e=_0x33c3ff[_0x9508('0x16d')];}else{_0x1a8c8e=this[_0x9508('0x15')][_0x9508('0x6f')](this,_0x33c3ff[_0x9508('0x16d')]);if(!_0x1a8c8e){return this['channel']['error'](_0x33c3ff,_0x9508('0x16e'));}}var _0x2351e0='';if(this[_0x9508('0x87')](_0x33c3ff[_0x9508('0x10f')])){var _0x402567=this[_0x9508('0x164')]['sync'](this,_0x33c3ff[_0x9508('0x10f')]);if(_0x402567){_0x2351e0=_0x402567;}}this[_0x9508('0x36')]['sync'](this,_0x33c3ff,_0x1a8c8e);if(_0x33c3ff[_0x9508('0xe1')][_0x9508('0x16f')]('x')<0x0){_0x33c3ff[_0x9508('0xe1')]+='x';}if(_0x33c3ff[_0x9508('0xe1')]['indexOf']('X')<0x0){_0x33c3ff[_0x9508('0xe1')]+='X';}this[_0x9508('0xd')]['setVariable'](_0x9508('0x170'),_0x1a8c8e?_0x1a8c8e[_0x9508('0x171')]():'');var _0x40b50c=this[_0x9508('0xd')][_0x9508('0x54')](_0x9508('0x172'),[_0x1a8c8e,_0x33c3ff[_0x9508('0xe1')],_0x33c3ff[_0x9508('0x63')],_0x2351e0,_0x33c3ff[_0x9508('0x65')],_0x33c3ff[_0x9508('0x7')],_0x33c3ff[_0x9508('0x173')],_0x33c3ff[_0x9508('0x174')],'',_0x33c3ff[_0x9508('0x175')]]);if(_0x40b50c['result']===-0x1){return _0x40b50c;}return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xc4'),_0x9508('0x172'),_0x1a8c8e));};AGIVertices[_0x9508('0xf')][_0x9508('0x176')]=function(_0x59afdf){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x177'),_0x59afdf['label']));var _0x38c7ff=_0x59afdf['recordingFormat']||_0x9508('0x12c');var _0x230200=util[_0x9508('0x28')](_0x9508('0x178'),this[_0x9508('0xd')][_0x9508('0x37')],rs[_0x9508('0x117')](0x5));var _0x2ea77c=util[_0x9508('0x28')](_0x9508('0x179'),FILES_PATH,_0x230200,_0x38c7ff);var _0x7ef314=util['format'](_0x9508('0x134'),FILES_PATH,_0x230200);this['createSquareRecording']['sync'](this,_0x59afdf,_0x230200,_0x2ea77c);this['channel'][_0x9508('0xa0')](_0x9508('0x17a'),_0x230200);logger['info'](_0x9508('0x17b'),_0x7ef314,_0x38c7ff,_0x59afdf[_0x9508('0x17c')],_0x59afdf[_0x9508('0x65')]);return this['channel'][_0x9508('0x12e')](_0x7ef314,_0x38c7ff,_0x59afdf[_0x9508('0x17c')],_0x59afdf[_0x9508('0x65')],undefined,!![]);};AGIVertices['prototype'][_0x9508('0x17d')]=function(_0x354fb3){logger[_0x9508('0x30')](util[_0x9508('0x28')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x354fb3[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x354fb3[_0x9508('0x63')])){return this['channel'][_0x9508('0xac')](_0x9508('0x17e'));}var _0x39deef=this[_0x9508('0x62')][_0x9508('0x6f')](this,_0x354fb3);logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x17f'),util['inspect'](_0x39deef,{'showHidden':![],'depth':null})));if(!this[_0x9508('0x87')](_0x354fb3[_0x9508('0xd6')])){return this[_0x9508('0xd')]['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x500406=this[_0x9508('0x10')][_0x9508('0x6f')](this,_0x354fb3[_0x9508('0xd6')]);if(!_0x500406){return this[_0x9508('0xd')][_0x9508('0x33')](_0x354fb3,_0x9508('0x115'));}this[_0x9508('0xd')][_0x9508('0xa0')](util[_0x9508('0x28')](_0x9508('0x180'),_0x500406),_0x39deef[_0x9508('0x75')]?_0x39deef[_0x9508('0x75')]:_0x9508('0x181'));this[_0x9508('0xd')][_0x9508('0xa0')](util[_0x9508('0x28')]('%s_STATUS_MESSAGE',_0x500406),_0x39deef[_0x9508('0x76')]?_0x39deef['statusMessage']:'OK');if(_0x39deef[_0x9508('0x6a')]){try{this['saveRestApiResult'](_0x39deef[_0x9508('0x6a')],_0x500406);}catch(_0x1da6be){logger[_0x9508('0x33')](util['format'](_0x9508('0x182'),_0x500406));}}return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xdb'),_0x500406));};AGIVertices[_0x9508('0xf')][_0x9508('0x183')]=function(_0x2c2f09){logger[_0x9508('0x30')](util['format'](_0x9508('0x184'),_0x2c2f09[_0x9508('0xa9')]));return this[_0x9508('0xd')][_0x9508('0x185')](_0x2c2f09[_0x9508('0x186')][_0x9508('0x55')](/\s+/g,''),_0x2c2f09[_0x9508('0x17c')]);};AGIVertices[_0x9508('0xf')][_0x9508('0x187')]=function(_0x3efeeb){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x188'),_0x3efeeb[_0x9508('0xa9')]));return this[_0x9508('0xd')][_0x9508('0x189')](_0x3efeeb['number'][_0x9508('0x55')](/\s+/g,''),_0x3efeeb[_0x9508('0x17c')]);};AGIVertices[_0x9508('0xf')][_0x9508('0x18a')]=function(_0x3d6c3e){logger[_0x9508('0x30')](util['format'](_0x9508('0x18b'),_0x3d6c3e[_0x9508('0xa9')]));return this[_0x9508('0xd')][_0x9508('0x18c')](_0x3d6c3e[_0x9508('0x59')],_0x3d6c3e['escape_digits']);};AGIVertices[_0x9508('0xf')][_0x9508('0x18d')]=function(_0x2e0a23){logger['info'](util[_0x9508('0x28')](_0x9508('0x18e'),_0x2e0a23['label']));if(!this[_0x9508('0x87')](_0x2e0a23[_0x9508('0x18f')])){return this['channel'][_0x9508('0xac')]('no\x20mail\x20account\x20configured');}var _0x35d344=this[_0x9508('0x20')][_0x9508('0x6f')](this,_0x2e0a23['account_id']);if(!_0x35d344||!_0x35d344[_0x9508('0x190')]){return this['channel'][_0x9508('0x33')](_0x2e0a23,_0x9508('0x191'));}var _0x325e75={'from':util[_0x9508('0x28')](_0x9508('0x192'),_0x35d344['name'],_0x35d344[_0x9508('0x193')]||_0x35d344[_0x9508('0x190')][_0x9508('0x194')]),'to':_0x2e0a23['to']||'','cc':_0x2e0a23['cc']||'','bcc':_0x2e0a23['bcc']||'','subject':_0x2e0a23[_0x9508('0x195')],'html':_0x2e0a23[_0x9508('0x59')],'text':_0x2e0a23[_0x9508('0x59')]};if(this[_0x9508('0x87')](_0x2e0a23['template_id'])){}logger['debug'](_0x9508('0x196'),JSON[_0x9508('0x74')](_0x325e75));this['createSquareDetailsReport']['sync'](this,_0x2e0a23,_0x2e0a23[_0x9508('0x18f')]);this['channel'][_0x9508('0xac')](util[_0x9508('0x28')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x35d344['name']));this[_0x9508('0x22')]['sync'](this,_0x35d344[_0x9508('0x197')],_0x325e75);return this['channel'][_0x9508('0xac')](_0x9508('0x198'));};AGIVertices[_0x9508('0xf')][_0x9508('0x199')]=function(_0x511b55){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x19a'),_0x511b55['label']));return this[_0x9508('0xd')]['noop'](_0x9508('0x19b'));};AGIVertices[_0x9508('0xf')][_0x9508('0x19c')]=function(_0x49e69f){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x19d'),_0x49e69f[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x49e69f[_0x9508('0x19e')])){return this['channel'][_0x9508('0xac')](_0x9508('0x19f'));}var _0x2d6b6d=this[_0x9508('0x34')][_0x9508('0x6f')](this,_0x49e69f[_0x9508('0x19e')]);if(!_0x2d6b6d){return this[_0x9508('0xd')][_0x9508('0x33')](_0x49e69f,_0x9508('0x1a0'));}var _0x4aa0a7={'body':_0x49e69f[_0x9508('0x1a1')],'phone':_0x49e69f['to']||'','SmsAccountId':_0x2d6b6d['id']};logger['debug'](_0x9508('0x1a2'),JSON['stringify'](_0x4aa0a7));this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x49e69f,_0x49e69f[_0x9508('0x19e')]);this['channel'][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x1a3'),_0x2d6b6d[_0x9508('0x13')]));this[_0x9508('0x35')][_0x9508('0x6f')](this,_0x4aa0a7);return this[_0x9508('0xd')][_0x9508('0xac')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x9508('0x1a4')]=function(_0x5a45fd){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x1a5'),_0x5a45fd[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x5a45fd[_0x9508('0xd6')])){return this['channel'][_0x9508('0x33')](_0x5a45fd,'no\x20variable\x20selected');}var _0x45d9fc=this[_0x9508('0x10')][_0x9508('0x6f')](this,_0x5a45fd[_0x9508('0xd6')]);if(!_0x45d9fc){return this[_0x9508('0xd')][_0x9508('0x33')](_0x5a45fd,'no\x20variable\x20found');}return this[_0x9508('0xd')][_0x9508('0xa0')](_0x45d9fc,_0x5a45fd[_0x9508('0x1a6')]);};AGIVertices[_0x9508('0xf')][_0x9508('0x1a7')]=function(_0x557984){logger[_0x9508('0x30')](util['format'](_0x9508('0x1a8'),_0x557984[_0x9508('0xa9')]));this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0x1a9'));var _0x5ec6ff=this[_0x9508('0xd')][_0x9508('0x10')](_0x9508('0x1aa'));if(!_['isEmpty'](_0x5ec6ff['extra'])){this[_0x9508('0xd')][_0x9508('0x37')]=_0x5ec6ff[_0x9508('0xa3')];}if(_0x557984[_0x9508('0xbb')]===_0x9508('0x1ab')){this['channel'][_0x9508('0xac')](_0x9508('0x1ac'));return this[_0x9508('0xd')][_0x9508('0xbb')]();}return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0x1ad'));};AGIVertices[_0x9508('0xf')][_0x9508('0x1ae')]=function(_0x378ba7){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x1af'),_0x378ba7[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x378ba7['project_id'])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x378ba7,'no\x20subproject\x20selected');}var _0x4c372d=this[_0x9508('0x17')]['sync'](this,_0x378ba7[_0x9508('0x1b0')]);if(!this[_0x9508('0x87')](_0x4c372d)){return this[_0x9508('0xd')]['error'](_0x378ba7,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0x378ba7[_0x9508('0x1b0')]));}if(_0x4c372d===this[_0x9508('0xd')][_0x9508('0x39')]){return this[_0x9508('0xd')][_0x9508('0x33')](_0x378ba7,_0x9508('0x1b1'));}this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x378ba7,_0x4c372d);var _0x2924b8=this['channel']['exec']('AGI',util[_0x9508('0x28')](_0x9508('0x1b2'),config[_0x9508('0x7')][_0x9508('0x1b3')]||_0x9508('0x1b4'),_0x4c372d,this[_0x9508('0xd')][_0x9508('0x39')]));if(_0x2924b8['result']===-0x1){return _0x2924b8;}return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')]('Executed\x20command\x20%s\x20%s','AGI',_0x4c372d));};AGIVertices[_0x9508('0xf')][_0x9508('0x1b5')]=function(_0x4f8b44){logger['info'](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x4f8b44[_0x9508('0xa9')]));var _0x27f03c=this[_0x9508('0x53')][_0x9508('0x6f')](this,_0x4f8b44['command']);this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x4f8b44,_0x4f8b44[_0x9508('0xba')]);if(this['isConfigured'](_0x4f8b44['variable_id'])){var _0x8d34e=this[_0x9508('0x10')]['sync'](this,_0x4f8b44[_0x9508('0xd6')]);if(_0x8d34e){this[_0x9508('0xd')]['setVariable'](_0x8d34e,_0x27f03c);return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x4f8b44['command'],_0x8d34e));}}return this[_0x9508('0xd')][_0x9508('0xac')](util['format'](_0x9508('0x1b6'),_0x4f8b44[_0x9508('0xba')]));};AGIVertices[_0x9508('0xf')][_0x9508('0x1b7')]=function(_0x420550){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x1b8'),_0x420550[_0x9508('0xa9')]));_0x420550[_0x9508('0x59')]=_0x420550['text'][_0x9508('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x420550[_0x9508('0x57')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0x1b9'));}if(!this[_0x9508('0x87')](_0x420550[_0x9508('0x59')])){return this['channel'][_0x9508('0xac')](_0x9508('0xaa'));}this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x1ba'),_0x420550['text']));var _0x250d2e=this[_0x9508('0x56')][_0x9508('0x6f')](this,_0x420550);if(_0x250d2e){this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x1bb'),_0x250d2e));var _0xf486a1=this['channel']['streamFile'](_0x250d2e);try{fs[_0x9508('0x100')](_0x250d2e+_0x9508('0x151'));}catch(_0x181408){logger['error'](_0x181408);}return _0xf486a1;}return this[_0x9508('0xd')]['error'](_0x420550,_0x9508('0x1bc'));};AGIVertices[_0x9508('0xf')][_0x9508('0x1bd')]=function(_0x1c6a40){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x1be'),_0x1c6a40[_0x9508('0xa9')]));_0x1c6a40['text']=_0x1c6a40[_0x9508('0x59')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x9508('0x87')](_0x1c6a40[_0x9508('0x59')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xaa'));}this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')]('Trying\x20Google\x20TTS\x20%s',_0x1c6a40[_0x9508('0x59')]));var _0x357dab=this[_0x9508('0x60')][_0x9508('0x6f')](this,_0x1c6a40);if(_0x357dab){this['channel'][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x1bf'),_0x357dab));var _0x3d43b8=this['channel']['streamFile'](_0x357dab);try{fs[_0x9508('0x100')](_0x357dab+_0x9508('0x151'));}catch(_0x22fba6){logger['error'](_0x22fba6);}return _0x3d43b8;}return this['channel'][_0x9508('0x33')](_0x1c6a40,_0x9508('0x1c0'));};AGIVertices[_0x9508('0xf')][_0x9508('0x1c1')]=function(_0x2c9dc6){logger['info'](util[_0x9508('0x28')](_0x9508('0x1c2'),_0x2c9dc6[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x2c9dc6[_0x9508('0x155')])){return this[_0x9508('0xd')]['error'](_0x2c9dc6,_0x9508('0x156'));}logger[_0x9508('0x30')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x9508('0x3a')],_0x2c9dc6[_0x9508('0x155')]));var _0xc8432f=this[_0x9508('0x1c3')]['sync'](this,_0x2c9dc6[_0x9508('0x155')]);if(_0xc8432f){logger['info'](util[_0x9508('0x28')](_0x9508('0x157'),this[_0x9508('0xd')][_0x9508('0x3a')],_0x2c9dc6[_0x9508('0x155')]));this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x157'),this['channel']['callerid'],_0x2c9dc6[_0x9508('0x155')]));return{'code':0xc8,'result':_0x9508('0x158')};}else{logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x159'),this['channel'][_0x9508('0x3a')],_0x2c9dc6[_0x9508('0x155')]));this[_0x9508('0xd')]['noop'](util[_0x9508('0x28')](_0x9508('0x159'),this[_0x9508('0xd')][_0x9508('0x3a')],_0x2c9dc6[_0x9508('0x155')]));return{'code':0xc8,'result':_0x9508('0x15a')};}};AGIVertices[_0x9508('0xf')][_0x9508('0x1c4')]=function(_0x141dc0){logger[_0x9508('0x30')](util['format'](_0x9508('0x1c5'),_0x141dc0[_0x9508('0xa9')]));var _0x3436fd=this[_0x9508('0xd')][_0x9508('0x54')](_0x9508('0x1c6'),[_0x141dc0[_0x9508('0x1c7')],_0x141dc0['options']]);if(_0x3436fd[_0x9508('0xab')]===-0x1){return _0x3436fd;}return this[_0x9508('0xd')]['noop'](util[_0x9508('0x28')](_0x9508('0xc4'),_0x9508('0x1c6'),_0x141dc0[_0x9508('0x1c7')]));};AGIVertices['prototype']['vswitch']=function(_0x887c22){logger['info'](util[_0x9508('0x28')](_0x9508('0x1c8'),_0x887c22[_0x9508('0xa9')]));if(!this['isConfigured'](_0x887c22['variable_id'])){return this['channel'][_0x9508('0x33')](_0x887c22,_0x9508('0x1c9'));}var _0x1b246b=this['getVariable']['sync'](this,_0x887c22['variable_id']);if(!_0x1b246b){return this['channel']['error'](_0x887c22,_0x9508('0x115'));}var _0x5daf6a=this[_0x9508('0xd')][_0x9508('0x10')](_0x1b246b);return{'code':0xc8,'result':_0x5daf6a[_0x9508('0xa3')]?_0x5daf6a[_0x9508('0xa3')]:'-'};};String[_0x9508('0xf')][_0x9508('0xa2')]=function(_0x3d08e2,_0x2d73d0){return this[_0x9508('0xa1')](_0x3d08e2)[_0x9508('0x1ca')](_0x2d73d0);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 1477b77..953e67f 100644 --- a/server/services/ami/acw/index.js +++ b/server/services/ami/acw/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe0cd=['[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','lodash','moment','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','timer','update','uniqueid','then','[%s][UPDATE][ACWTIME:%s]','catch','finally','startAcw','queue','mandatoryDispositionPause','name','Action','getAgent','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','error','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','pauseType','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','interface','[ACW][syncAgentConnect]\x20%s','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s'];(function(_0x4377a2,_0x476948){var _0x3bfed7=function(_0x479d11){while(--_0x479d11){_0x4377a2['push'](_0x4377a2['shift']());}};_0x3bfed7(++_0x476948);}(_0xe0cd,0xbc));var _0xde0c=function(_0x7f7fbc,_0x4bf6f6){_0x7f7fbc=_0x7f7fbc-0x0;var _0x18ec90=_0xe0cd[_0x7f7fbc];return _0x18ec90;};'use strict';var _=require(_0xde0c('0x0'));var moment=require(_0xde0c('0x1'));var ami=require('../ami');var logger=require('../../../config/logger')(_0xde0c('0x2'));var RpcUser=require(_0xde0c('0x3'));var RpcVoiceAgentReport=require(_0xde0c('0x4'));function Acw(_0x19fa6d){this['voiceQueues']=_0x19fa6d[_0xde0c('0x5')];this[_0xde0c('0x6')]=_0x19fa6d['agents'];this[_0xde0c('0x7')]=_0x19fa6d['timers'];this[_0xde0c('0x8')]={};ami['on'](_0xde0c('0x9'),this[_0xde0c('0xa')][_0xde0c('0xb')](this));ami['on'](_0xde0c('0xc'),this[_0xde0c('0xd')][_0xde0c('0xb')](this));ami['on'](_0xde0c('0xe'),this['syncHangup']['bind'](this));ami['on']('agentringnoanswer',this[_0xde0c('0xf')][_0xde0c('0xb')](this));ami['on'](_0xde0c('0x10'),this[_0xde0c('0x11')][_0xde0c('0xb')](this));ami['on'](_0xde0c('0x12'),this[_0xde0c('0x13')]['bind'](this));ami['on'](_0xde0c('0x14'),this[_0xde0c('0x15')][_0xde0c('0xb')](this));}function getDiff(_0x4fa627){var _0x518a1a=moment()[_0xde0c('0x16')](0x0);var _0x5e1e33=moment(_0x4fa627)[_0xde0c('0x16')](0x0);return _0x518a1a[_0xde0c('0x17')](_0x5e1e33,_0xde0c('0x18'));}Acw[_0xde0c('0x19')]['updateAcw']=function(_0x3f89b9,_0x3cc275){var _0x5b8afd=this;var _0x2d3d44=getDiff(_0x5b8afd[_0xde0c('0x7')][_0x3f89b9]['lastPauseAt']);clearTimeout(_0x5b8afd['timers'][_0x3f89b9]['timer']);_0x5b8afd['timers'][_0x3f89b9][_0xde0c('0x1a')]=![];return RpcVoiceAgentReport[_0xde0c('0x1b')]({'acwtime':_0x2d3d44},_0x5b8afd[_0xde0c('0x7')][_0x3f89b9][_0xde0c('0x1c')],_0x3f89b9)[_0xde0c('0x1d')](function(_0x15db91){logger['info'](_0xde0c('0x1e'),_0x3cc275,_0x2d3d44,_0x15db91);})[_0xde0c('0x1f')](function(_0x8ea711){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x3cc275,_0x8ea711);})[_0xde0c('0x20')](function(){delete _0x5b8afd['timers'][_0x3f89b9];});};Acw[_0xde0c('0x19')][_0xde0c('0x21')]=function(_0x2399c5){try{var _0x56f65c=this;var _0x1e726e=this[_0xde0c('0x8')][_0x2399c5]['interface'];var _0x1a2708=this[_0xde0c('0x8')][_0x2399c5][_0xde0c('0x22')];var _0x928d7=this['voiceQueues'][_0x1a2708];var _0x580df7=![];var _0xd6d9d0='ACW';if(_0x928d7['mandatoryDisposition']&&_0x928d7[_0xde0c('0x23')][_0xde0c('0x24')]){_0x580df7=!![];_0xd6d9d0=_0x928d7['mandatoryDispositionPause']['name'];}return ami[_0xde0c('0x25')]({'action':'QueuePause','interface':_0x1e726e,'paused':!![],'reason':_0xd6d9d0})[_0xde0c('0x1d')](function(){if(_0x56f65c[_0xde0c('0x6')][_0x1e726e]){return RpcUser[_0xde0c('0x26')](_0x56f65c[_0xde0c('0x6')][_0x1e726e]['id'])[_0xde0c('0x1d')](function(_0x9530f9){if(!_0x9530f9||_0x9530f9['voicePause']){logger['info'](_0xde0c('0x27'),_0x2399c5,_0x1e726e,_0x1a2708);return;}logger[_0xde0c('0x28')](_0xde0c('0x29'),_0x2399c5,_0x1e726e,_0x1a2708);var _0x203d7c=_0x56f65c[_0xde0c('0x8')][_0x2399c5][_0xde0c('0x2a')]&&_0x56f65c[_0xde0c('0x8')][_0x2399c5][_0xde0c('0x2b')]?_0x56f65c[_0xde0c('0x8')][_0x2399c5][_0xde0c('0x2b')]:_0x2399c5;return RpcUser[_0xde0c('0x2c')](_0x56f65c[_0xde0c('0x6')][_0x1e726e],_0xd6d9d0,_0x203d7c)[_0xde0c('0x1d')](function(_0x4bd14b){_0x56f65c[_0xde0c('0x5')][_0x1a2708][_0xde0c('0x2d')]-=0x1;_0x56f65c[_0xde0c('0x5')][_0x1a2708][_0xde0c('0x2e')]+=0x1;return _0x4bd14b;});})[_0xde0c('0x1d')](function(_0x2398f6){if(_0x580df7||!_0x2398f6){return;}_0x56f65c['timers'][_0x1e726e]={};logger[_0xde0c('0x28')](_0xde0c('0x2f'),_0x2399c5,_0x56f65c[_0xde0c('0x5')][_0x1a2708][_0xde0c('0x30')],_0x1e726e,_0x1a2708);_0x56f65c[_0xde0c('0x7')][_0x1e726e][_0xde0c('0x1a')]=setTimeout(_0x56f65c[_0xde0c('0x31')]['bind'](_0x56f65c,_0x1e726e),_0x56f65c['voiceQueues'][_0x1a2708][_0xde0c('0x30')]*0x3e8);_0x56f65c[_0xde0c('0x7')][_0x1e726e][_0xde0c('0x32')]=moment()[_0xde0c('0x33')](_0xde0c('0x34'));_0x56f65c['timers'][_0x1e726e][_0xde0c('0x1c')]=_0x2399c5;_0x56f65c[_0xde0c('0x7')][_0x1e726e][_0xde0c('0x22')]=_0x1a2708;_0x56f65c[_0xde0c('0x7')][_0x1e726e][_0xde0c('0x35')]=_0x56f65c[_0xde0c('0x35')][_0xde0c('0xb')](_0x56f65c,_0x1e726e,_0x2399c5);});}})[_0xde0c('0x1f')](function(){logger[_0xde0c('0x36')](_0xde0c('0x2f'),_0x2399c5,_0x56f65c[_0xde0c('0x5')][_0x1a2708][_0xde0c('0x30')],_0x1e726e,_0x1a2708);})[_0xde0c('0x20')](function(){delete _0x56f65c['channels'][_0x2399c5];});}catch(_0x550653){logger['error'](_0xde0c('0x37'),_0x550653[_0xde0c('0x38')]);}};Acw[_0xde0c('0x19')][_0xde0c('0x31')]=function(_0x3f2ae9){try{var _0x47cf06=this;if(_0x47cf06[_0xde0c('0x7')][_0x3f2ae9]){_0x47cf06[_0xde0c('0x7')][_0x3f2ae9][_0xde0c('0x1a')]=![];var _0x892bad=_0x47cf06[_0xde0c('0x7')][_0x3f2ae9][_0xde0c('0x1c')];var _0x562ac3=_0x47cf06[_0xde0c('0x7')][_0x3f2ae9][_0xde0c('0x22')];var _0x4584aa=_0x47cf06[_0xde0c('0x5')][_0x562ac3][_0xde0c('0x30')];logger['info'](_0xde0c('0x39'),_0x892bad,_0x3f2ae9);RpcUser['getAgent'](this[_0xde0c('0x6')][_0x3f2ae9]['id'])[_0xde0c('0x1d')](function(_0x59586c){if(_0x59586c[_0xde0c('0x3a')]==='ACW'){return RpcUser['saveUnpause'](_0x47cf06[_0xde0c('0x6')][_0x3f2ae9]);}});RpcVoiceAgentReport[_0xde0c('0x1b')]({'acwtime':_0x4584aa,'agentacw':!![]},_0x892bad,_0x3f2ae9)[_0xde0c('0x1d')](function(_0x584de4){logger[_0xde0c('0x28')]('[%s][UPDATE][ACWTIME:%s]',_0x892bad,_0x4584aa,_0x584de4);})[_0xde0c('0x1f')](function(_0x278ccf){logger[_0xde0c('0x36')](_0xde0c('0x3b'),_0x892bad,_0x278ccf);});}else{logger['error'](_0xde0c('0x3c'),_0x3f2ae9);if(_0x47cf06['timers']){logger[_0xde0c('0x28')](_0xde0c('0x3d'),JSON[_0xde0c('0x3e')](_0x47cf06[_0xde0c('0x7')]));}}}catch(_0x24d09e){logger['error']('[ACW][STOP]\x20%s',_0x24d09e['message']);}};Acw[_0xde0c('0x19')][_0xde0c('0xa')]=function(_0x581c82){try{if(this[_0xde0c('0x5')][_0x581c82[_0xde0c('0x22')]]&&(this['voiceQueues'][_0x581c82['queue']][_0xde0c('0x2')]||this[_0xde0c('0x5')][_0x581c82['queue']]['mandatoryDisposition'])){if(this[_0xde0c('0x6')][_0x581c82[_0xde0c('0x3f')]]){this[_0xde0c('0x8')][_0x581c82[_0xde0c('0x1c')]]={'queue':_0x581c82['queue'],'interface':_0x581c82['interface'],'destlinkedid':_0x581c82[_0xde0c('0x2b')]};}}}catch(_0x2b58fd){logger[_0xde0c('0x36')](_0xde0c('0x40'),_0x2b58fd[_0xde0c('0x38')]);}};Acw[_0xde0c('0x19')][_0xde0c('0x15')]=function(_0x596af1){try{if(this['voiceQueues'][_0x596af1[_0xde0c('0x22')]]&&(this[_0xde0c('0x5')][_0x596af1['queue']][_0xde0c('0x2')]||this[_0xde0c('0x5')][_0x596af1[_0xde0c('0x22')]][_0xde0c('0x41')])){if(this[_0xde0c('0x6')][_0x596af1[_0xde0c('0x3f')]]){this[_0xde0c('0x8')][_0x596af1[_0xde0c('0x1c')]]={'queue':_0x596af1[_0xde0c('0x22')],'interface':_0x596af1[_0xde0c('0x3f')]};}}}catch(_0x527b67){logger[_0xde0c('0x36')](_0xde0c('0x42'),_0x527b67[_0xde0c('0x38')]);}};Acw['prototype']['syncHangupRequest']=function(_0x283902){try{if(this[_0xde0c('0x8')][_0x283902['uniqueid']]&&_['isUndefined'](this[_0xde0c('0x8')][_0x283902[_0xde0c('0x1c')]][_0xde0c('0x2a')])){logger['info'](_0xde0c('0x43'),_0x283902['uniqueid']);this['startAcw'](_0x283902[_0xde0c('0x1c')]);}else if(this[_0xde0c('0x8')][_0x283902['linkedid']]&&_['isUndefined'](this[_0xde0c('0x8')][_0x283902[_0xde0c('0x44')]][_0xde0c('0x2a')])){logger[_0xde0c('0x28')]('[%s][HANGUP:LINKEDID]',_0x283902[_0xde0c('0x44')]);this['startAcw'](_0x283902['linkedid']);}}catch(_0x1f04ce){logger[_0xde0c('0x36')](_0xde0c('0x45'),_0x1f04ce[_0xde0c('0x38')]);}};Acw['prototype']['syncHangup']=function(_0x5a38fb){try{if(this[_0xde0c('0x8')][_0x5a38fb['uniqueid']]&&this[_0xde0c('0x8')][_0x5a38fb[_0xde0c('0x1c')]][_0xde0c('0x2a')]){logger[_0xde0c('0x28')](_0xde0c('0x46'),_0x5a38fb[_0xde0c('0x1c')]);this[_0xde0c('0x21')](_0x5a38fb[_0xde0c('0x1c')]);}else if(this[_0xde0c('0x8')][_0x5a38fb['linkedid']]&&this['channels'][_0x5a38fb[_0xde0c('0x44')]][_0xde0c('0x2a')]){logger[_0xde0c('0x28')](_0xde0c('0x47'),_0x5a38fb[_0xde0c('0x44')]);this[_0xde0c('0x21')](_0x5a38fb['linkedid']);}}catch(_0x18ec58){logger[_0xde0c('0x36')]('[ACW][syncHangup]\x20%s',_0x18ec58[_0xde0c('0x38')]);}};Acw[_0xde0c('0x19')]['syncAttendedTransfer']=function(_0x14d7a1){try{if(!_[_0xde0c('0x48')](this[_0xde0c('0x8')][_0x14d7a1[_0xde0c('0x49')]])){this[_0xde0c('0x21')](_0x14d7a1[_0xde0c('0x49')]);if(this['channels'][_0x14d7a1[_0xde0c('0x4a')]]){this[_0xde0c('0x8')][_0x14d7a1[_0xde0c('0x4a')]]['attended']=!![];this[_0xde0c('0x8')][_0x14d7a1[_0xde0c('0x4b')]]=this[_0xde0c('0x8')][_0x14d7a1[_0xde0c('0x4a')]];delete this['channels'][_0x14d7a1['secondtransfereruniqueid']];}}else if(!_[_0xde0c('0x48')](this[_0xde0c('0x8')][_0x14d7a1['transfertargetuniqueid']])){this['startAcw'](_0x14d7a1[_0xde0c('0x4b')]);if(this[_0xde0c('0x8')][_0x14d7a1[_0xde0c('0x4c')]]){this[_0xde0c('0x8')][_0x14d7a1[_0xde0c('0x4c')]]['attended']=!![];this[_0xde0c('0x8')][_0x14d7a1[_0xde0c('0x49')]]=this[_0xde0c('0x8')][_0x14d7a1[_0xde0c('0x4c')]];delete this[_0xde0c('0x8')][_0x14d7a1[_0xde0c('0x4c')]];}}}catch(_0x2b40be){logger['error'](_0xde0c('0x4d'),_0x2b40be['message']);}};Acw['prototype'][_0xde0c('0x13')]=function(_0x2f5eda){try{if(this['channels'][_0x2f5eda[_0xde0c('0x4e')]]){logger[_0xde0c('0x28')](_0xde0c('0x4f'),JSON['stringify'](_0x2f5eda[_0xde0c('0x4e')]));this[_0xde0c('0x21')](_0x2f5eda['transfereruniqueid']);}else if(this[_0xde0c('0x8')][_0x2f5eda['transfererlinkedid']]){logger[_0xde0c('0x28')]('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x2f5eda[_0xde0c('0x50')]));this['startAcw'](_0x2f5eda[_0xde0c('0x50')]);}}catch(_0x48e1b8){logger[_0xde0c('0x36')]('[ACW][syncBlindTransfer]\x20%s',_0x48e1b8['message']);}};Acw['prototype'][_0xde0c('0xf')]=function(_0x1dd53c){try{if(this[_0xde0c('0x5')][_0x1dd53c[_0xde0c('0x22')]]&&this[_0xde0c('0x5')][_0x1dd53c[_0xde0c('0x22')]][_0xde0c('0x51')]===_0xde0c('0x52')){if(this['agents'][_0x1dd53c[_0xde0c('0x3f')]]){logger[_0xde0c('0x28')](_0xde0c('0x53'),_0x1dd53c[_0xde0c('0x1c')],_0x1dd53c['interface'],_0x1dd53c[_0xde0c('0x22')]);return RpcUser[_0xde0c('0x2c')](this['agents'][_0x1dd53c[_0xde0c('0x3f')]],_0xde0c('0x54'),_0x1dd53c[_0xde0c('0x1c')]);}}}catch(_0x3e5345){logger[_0xde0c('0x36')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x3e5345[_0xde0c('0x38')]);}};module[_0xde0c('0x55')]=Acw; \ No newline at end of file +var _0xfe5b=['[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','transfertargetuniqueid','secondtransfereruniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','prototype','lastPauseAt','timer','update','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','startAcw','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','Action','QueuePause','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','available','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','finally','[ACW][START]\x20%s','getAgent','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0xfe5b,0x1b8));var _0xbfe5=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xfe5b[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0xbfe5('0x0'));var moment=require('moment');var ami=require(_0xbfe5('0x1'));var logger=require(_0xbfe5('0x2'))(_0xbfe5('0x3'));var RpcUser=require(_0xbfe5('0x4'));var RpcVoiceAgentReport=require(_0xbfe5('0x5'));function Acw(_0x286e65){this[_0xbfe5('0x6')]=_0x286e65[_0xbfe5('0x6')];this[_0xbfe5('0x7')]=_0x286e65[_0xbfe5('0x7')];this[_0xbfe5('0x8')]=_0x286e65[_0xbfe5('0x8')];this[_0xbfe5('0x9')]={};ami['on'](_0xbfe5('0xa'),this[_0xbfe5('0xb')][_0xbfe5('0xc')](this));ami['on'](_0xbfe5('0xd'),this[_0xbfe5('0xe')][_0xbfe5('0xc')](this));ami['on']('hangup',this[_0xbfe5('0xf')][_0xbfe5('0xc')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0xbfe5('0x10'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0xbfe5('0x11'),this[_0xbfe5('0x12')][_0xbfe5('0xc')](this));ami['on'](_0xbfe5('0x13'),this[_0xbfe5('0x14')][_0xbfe5('0xc')](this));}function getDiff(_0xea1a82){var _0x1d6838=moment()[_0xbfe5('0x15')](0x0);var _0x13384=moment(_0xea1a82)[_0xbfe5('0x15')](0x0);return _0x1d6838['diff'](_0x13384,'seconds');}Acw[_0xbfe5('0x16')]['updateAcw']=function(_0x1556cb,_0x169603){var _0x493c2f=this;var _0x20f35f=getDiff(_0x493c2f['timers'][_0x1556cb][_0xbfe5('0x17')]);clearTimeout(_0x493c2f['timers'][_0x1556cb]['timer']);_0x493c2f['timers'][_0x1556cb][_0xbfe5('0x18')]=![];return RpcVoiceAgentReport[_0xbfe5('0x19')]({'acwtime':_0x20f35f},_0x493c2f[_0xbfe5('0x8')][_0x1556cb][_0xbfe5('0x1a')],_0x1556cb)[_0xbfe5('0x1b')](function(_0x479fd2){logger[_0xbfe5('0x1c')](_0xbfe5('0x1d'),_0x169603,_0x20f35f,_0x479fd2);})[_0xbfe5('0x1e')](function(_0xa02ca0){logger[_0xbfe5('0x1f')](_0xbfe5('0x20'),_0x169603,_0xa02ca0);})['finally'](function(){delete _0x493c2f[_0xbfe5('0x8')][_0x1556cb];});};Acw[_0xbfe5('0x16')][_0xbfe5('0x21')]=function(_0x1b68c7){try{var _0x42532f=this;var _0x381787=this[_0xbfe5('0x9')][_0x1b68c7]['interface'];var _0x597123=this[_0xbfe5('0x9')][_0x1b68c7][_0xbfe5('0x22')];var _0x489925=this['voiceQueues'][_0x597123];var _0x2af9d9=![];var _0x2b9a6c=_0xbfe5('0x23');if(_0x489925[_0xbfe5('0x24')]&&_0x489925['mandatoryDispositionPause']['name']){_0x2af9d9=!![];_0x2b9a6c=_0x489925[_0xbfe5('0x25')]['name'];}return ami[_0xbfe5('0x26')]({'action':_0xbfe5('0x27'),'interface':_0x381787,'paused':!![],'reason':_0x2b9a6c})[_0xbfe5('0x1b')](function(){if(_0x42532f['agents'][_0x381787]){return RpcUser['getAgent'](_0x42532f[_0xbfe5('0x7')][_0x381787]['id'])[_0xbfe5('0x1b')](function(_0x46740a){if(!_0x46740a||_0x46740a[_0xbfe5('0x28')]){logger[_0xbfe5('0x1c')](_0xbfe5('0x29'),_0x1b68c7,_0x381787,_0x597123);return;}logger[_0xbfe5('0x1c')](_0xbfe5('0x2a'),_0x1b68c7,_0x381787,_0x597123);var _0x4eed45=_0x42532f[_0xbfe5('0x9')][_0x1b68c7][_0xbfe5('0x2b')]&&_0x42532f[_0xbfe5('0x9')][_0x1b68c7][_0xbfe5('0x2c')]?_0x42532f[_0xbfe5('0x9')][_0x1b68c7][_0xbfe5('0x2c')]:_0x1b68c7;return RpcUser[_0xbfe5('0x2d')](_0x42532f['agents'][_0x381787],_0x2b9a6c,_0x4eed45)['then'](function(_0x2c338f){_0x42532f[_0xbfe5('0x6')][_0x597123][_0xbfe5('0x2e')]-=0x1;_0x42532f[_0xbfe5('0x6')][_0x597123]['paused']+=0x1;return _0x2c338f;});})['then'](function(_0x484e1f){if(_0x2af9d9||!_0x484e1f){return;}_0x42532f[_0xbfe5('0x8')][_0x381787]={};logger['info'](_0xbfe5('0x2f'),_0x1b68c7,_0x42532f[_0xbfe5('0x6')][_0x597123][_0xbfe5('0x30')],_0x381787,_0x597123);_0x42532f['timers'][_0x381787][_0xbfe5('0x18')]=setTimeout(_0x42532f[_0xbfe5('0x31')][_0xbfe5('0xc')](_0x42532f,_0x381787),_0x42532f[_0xbfe5('0x6')][_0x597123][_0xbfe5('0x30')]*0x3e8);_0x42532f[_0xbfe5('0x8')][_0x381787][_0xbfe5('0x17')]=moment()[_0xbfe5('0x32')](_0xbfe5('0x33'));_0x42532f[_0xbfe5('0x8')][_0x381787][_0xbfe5('0x1a')]=_0x1b68c7;_0x42532f['timers'][_0x381787][_0xbfe5('0x22')]=_0x597123;_0x42532f[_0xbfe5('0x8')][_0x381787][_0xbfe5('0x34')]=_0x42532f[_0xbfe5('0x34')][_0xbfe5('0xc')](_0x42532f,_0x381787,_0x1b68c7);});}})[_0xbfe5('0x1e')](function(){logger[_0xbfe5('0x1f')](_0xbfe5('0x2f'),_0x1b68c7,_0x42532f[_0xbfe5('0x6')][_0x597123][_0xbfe5('0x30')],_0x381787,_0x597123);})[_0xbfe5('0x35')](function(){delete _0x42532f['channels'][_0x1b68c7];});}catch(_0x2566fc){logger['error'](_0xbfe5('0x36'),_0x2566fc['message']);}};Acw[_0xbfe5('0x16')][_0xbfe5('0x31')]=function(_0xfb81d4){try{var _0x41d2e7=this;if(_0x41d2e7[_0xbfe5('0x8')][_0xfb81d4]){_0x41d2e7['timers'][_0xfb81d4][_0xbfe5('0x18')]=![];var _0x12bd66=_0x41d2e7[_0xbfe5('0x8')][_0xfb81d4][_0xbfe5('0x1a')];var _0x16c868=_0x41d2e7['timers'][_0xfb81d4][_0xbfe5('0x22')];var _0x3cd622=_0x41d2e7[_0xbfe5('0x6')][_0x16c868][_0xbfe5('0x30')];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x12bd66,_0xfb81d4);RpcUser[_0xbfe5('0x37')](this[_0xbfe5('0x7')][_0xfb81d4]['id'])['then'](function(_0x3eaf26){if(_0x3eaf26['pauseType']===_0xbfe5('0x23')){return RpcUser[_0xbfe5('0x38')](_0x41d2e7['agents'][_0xfb81d4]);}});RpcVoiceAgentReport[_0xbfe5('0x19')]({'acwtime':_0x3cd622,'agentacw':!![]},_0x12bd66,_0xfb81d4)['then'](function(_0x3595a1){logger[_0xbfe5('0x1c')](_0xbfe5('0x1d'),_0x12bd66,_0x3cd622,_0x3595a1);})[_0xbfe5('0x1e')](function(_0x5cf96d){logger[_0xbfe5('0x1f')](_0xbfe5('0x20'),_0x12bd66,_0x5cf96d);});}else{logger[_0xbfe5('0x1f')](_0xbfe5('0x39'),_0xfb81d4);if(_0x41d2e7[_0xbfe5('0x8')]){logger[_0xbfe5('0x1c')](_0xbfe5('0x3a'),JSON[_0xbfe5('0x3b')](_0x41d2e7['timers']));}}}catch(_0xa74327){logger[_0xbfe5('0x1f')](_0xbfe5('0x3c'),_0xa74327[_0xbfe5('0x3d')]);}};Acw[_0xbfe5('0x16')][_0xbfe5('0xb')]=function(_0x4213c1){try{if(this[_0xbfe5('0x6')][_0x4213c1[_0xbfe5('0x22')]]&&(this['voiceQueues'][_0x4213c1['queue']][_0xbfe5('0x3')]||this[_0xbfe5('0x6')][_0x4213c1[_0xbfe5('0x22')]][_0xbfe5('0x24')])){if(this[_0xbfe5('0x7')][_0x4213c1['interface']]){this[_0xbfe5('0x9')][_0x4213c1[_0xbfe5('0x1a')]]={'queue':_0x4213c1[_0xbfe5('0x22')],'interface':_0x4213c1[_0xbfe5('0x3e')],'destlinkedid':_0x4213c1[_0xbfe5('0x2c')]};}}}catch(_0x3423d1){logger['error'](_0xbfe5('0x3f'),_0x3423d1[_0xbfe5('0x3d')]);}};Acw[_0xbfe5('0x16')][_0xbfe5('0x14')]=function(_0x3d0953){try{if(this[_0xbfe5('0x6')][_0x3d0953[_0xbfe5('0x22')]]&&(this['voiceQueues'][_0x3d0953[_0xbfe5('0x22')]][_0xbfe5('0x3')]||this[_0xbfe5('0x6')][_0x3d0953['queue']][_0xbfe5('0x24')])){if(this[_0xbfe5('0x7')][_0x3d0953['interface']]){this[_0xbfe5('0x9')][_0x3d0953['uniqueid']]={'queue':_0x3d0953['queue'],'interface':_0x3d0953[_0xbfe5('0x3e')]};}}}catch(_0x8ccb39){logger[_0xbfe5('0x1f')](_0xbfe5('0x40'),_0x8ccb39[_0xbfe5('0x3d')]);}};Acw[_0xbfe5('0x16')][_0xbfe5('0xe')]=function(_0x2d0adc){try{if(this[_0xbfe5('0x9')][_0x2d0adc[_0xbfe5('0x1a')]]&&_['isUndefined'](this[_0xbfe5('0x9')][_0x2d0adc[_0xbfe5('0x1a')]]['attended'])){logger[_0xbfe5('0x1c')](_0xbfe5('0x41'),_0x2d0adc[_0xbfe5('0x1a')]);this[_0xbfe5('0x21')](_0x2d0adc[_0xbfe5('0x1a')]);}else if(this[_0xbfe5('0x9')][_0x2d0adc[_0xbfe5('0x42')]]&&_['isUndefined'](this[_0xbfe5('0x9')][_0x2d0adc[_0xbfe5('0x42')]][_0xbfe5('0x2b')])){logger['info'](_0xbfe5('0x43'),_0x2d0adc[_0xbfe5('0x42')]);this['startAcw'](_0x2d0adc['linkedid']);}}catch(_0xe53c5f){logger[_0xbfe5('0x1f')](_0xbfe5('0x44'),_0xe53c5f[_0xbfe5('0x3d')]);}};Acw[_0xbfe5('0x16')][_0xbfe5('0xf')]=function(_0x5923d0){try{if(this[_0xbfe5('0x9')][_0x5923d0['uniqueid']]&&this[_0xbfe5('0x9')][_0x5923d0[_0xbfe5('0x1a')]][_0xbfe5('0x2b')]){logger[_0xbfe5('0x1c')](_0xbfe5('0x45'),_0x5923d0[_0xbfe5('0x1a')]);this[_0xbfe5('0x21')](_0x5923d0['uniqueid']);}else if(this[_0xbfe5('0x9')][_0x5923d0['linkedid']]&&this['channels'][_0x5923d0['linkedid']][_0xbfe5('0x2b')]){logger[_0xbfe5('0x1c')](_0xbfe5('0x46'),_0x5923d0[_0xbfe5('0x42')]);this[_0xbfe5('0x21')](_0x5923d0[_0xbfe5('0x42')]);}}catch(_0x515438){logger[_0xbfe5('0x1f')](_0xbfe5('0x47'),_0x515438[_0xbfe5('0x3d')]);}};Acw[_0xbfe5('0x16')]['syncAttendedTransfer']=function(_0x17f33c){try{if(!_[_0xbfe5('0x48')](this[_0xbfe5('0x9')][_0x17f33c[_0xbfe5('0x49')]])){this[_0xbfe5('0x21')](_0x17f33c[_0xbfe5('0x49')]);if(this[_0xbfe5('0x9')][_0x17f33c['secondtransfereruniqueid']]){this['channels'][_0x17f33c['secondtransfereruniqueid']][_0xbfe5('0x2b')]=!![];this[_0xbfe5('0x9')][_0x17f33c[_0xbfe5('0x4a')]]=this[_0xbfe5('0x9')][_0x17f33c[_0xbfe5('0x4b')]];delete this[_0xbfe5('0x9')][_0x17f33c[_0xbfe5('0x4b')]];}}else if(!_[_0xbfe5('0x48')](this[_0xbfe5('0x9')][_0x17f33c['transfertargetuniqueid']])){this['startAcw'](_0x17f33c[_0xbfe5('0x4a')]);if(this[_0xbfe5('0x9')][_0x17f33c[_0xbfe5('0x4c')]]){this['channels'][_0x17f33c[_0xbfe5('0x4c')]][_0xbfe5('0x2b')]=!![];this['channels'][_0x17f33c[_0xbfe5('0x49')]]=this[_0xbfe5('0x9')][_0x17f33c[_0xbfe5('0x4c')]];delete this[_0xbfe5('0x9')][_0x17f33c['origtransfereruniqueid']];}}}catch(_0xdcbd2e){logger[_0xbfe5('0x1f')](_0xbfe5('0x4d'),_0xdcbd2e[_0xbfe5('0x3d')]);}};Acw[_0xbfe5('0x16')][_0xbfe5('0x12')]=function(_0x2b3c6a){try{if(this['channels'][_0x2b3c6a[_0xbfe5('0x4e')]]){logger[_0xbfe5('0x1c')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xbfe5('0x3b')](_0x2b3c6a[_0xbfe5('0x4e')]));this['startAcw'](_0x2b3c6a['transfereruniqueid']);}else if(this['channels'][_0x2b3c6a['transfererlinkedid']]){logger[_0xbfe5('0x1c')](_0xbfe5('0x4f'),JSON[_0xbfe5('0x3b')](_0x2b3c6a[_0xbfe5('0x50')]));this[_0xbfe5('0x21')](_0x2b3c6a['transfererlinkedid']);}}catch(_0xa25bf8){logger[_0xbfe5('0x1f')](_0xbfe5('0x51'),_0xa25bf8[_0xbfe5('0x3d')]);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x23d5c2){try{if(this[_0xbfe5('0x6')][_0x23d5c2['queue']]&&this[_0xbfe5('0x6')][_0x23d5c2[_0xbfe5('0x22')]]['autopause']===_0xbfe5('0x52')){if(this[_0xbfe5('0x7')][_0x23d5c2['interface']]){logger[_0xbfe5('0x1c')](_0xbfe5('0x53'),_0x23d5c2['uniqueid'],_0x23d5c2[_0xbfe5('0x3e')],_0x23d5c2[_0xbfe5('0x22')]);return RpcUser[_0xbfe5('0x2d')](this['agents'][_0x23d5c2[_0xbfe5('0x3e')]],'Auto-Pause',_0x23d5c2[_0xbfe5('0x1a')]);}}}catch(_0x1e21d2){logger['error'](_0xbfe5('0x54'),_0x1e21d2[_0xbfe5('0x3d')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index dea1f4c..dcfc524 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3fc0=['resolve','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','close','asterisk-manager','util','../../config/logger','ami','../../config/environment','asterisk','port','username','password','keepConnected','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','Action','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x3fc0,0xe4));var _0x03fc=function(_0x6d6a66,_0x2924af){_0x6d6a66=_0x6d6a66-0x0;var _0x11eb6e=_0x3fc0[_0x6d6a66];return _0x11eb6e;};'use strict';var Manager=require(_0x03fc('0x0'));var BPromise=require('bluebird');var util=require(_0x03fc('0x1'));var logger=require(_0x03fc('0x2'))(_0x03fc('0x3'));var config=require(_0x03fc('0x4'));var ami=new Manager(config[_0x03fc('0x5')][_0x03fc('0x6')],config[_0x03fc('0x5')]['ip'],config['asterisk'][_0x03fc('0x7')],config[_0x03fc('0x5')][_0x03fc('0x8')],!![]);ami[_0x03fc('0x9')]();ami['Action']=BPromise[_0x03fc('0xa')](ami['action']);function error(_0x547e57){logger[_0x03fc('0xb')](util[_0x03fc('0xc')](_0x03fc('0xd'),config[_0x03fc('0x5')][_0x03fc('0x7')],config[_0x03fc('0x5')]['ip'],config['asterisk']['port'],util[_0x03fc('0xe')](_0x547e57,![],null)));}function close(){logger['error'](util[_0x03fc('0xc')](_0x03fc('0xf'),config[_0x03fc('0x5')][_0x03fc('0x7')],config['asterisk']['ip'],config[_0x03fc('0x5')][_0x03fc('0x6')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x03fc('0x10')]({'action':'sipshowregistry'});};};ami[_0x03fc('0x11')]=function(){return function(){return ami[_0x03fc('0x10')]({'action':_0x03fc('0x12')});};};ami[_0x03fc('0x13')]=function(){return function(){return ami['Action']({'action':_0x03fc('0x14')});};};ami[_0x03fc('0x15')]=function(){return function(){return ami[_0x03fc('0x10')]({'action':_0x03fc('0x16')});};};ami[_0x03fc('0x17')]=function(){return function(){return ami[_0x03fc('0x10')]({'action':'coreshowchannels'});};};function connect(){logger['info'](util[_0x03fc('0xc')](_0x03fc('0x18'),config[_0x03fc('0x5')][_0x03fc('0x7')],config[_0x03fc('0x5')]['ip'],config[_0x03fc('0x5')][_0x03fc('0x6')]));ami[_0x03fc('0x19')]('error',error);ami[_0x03fc('0x19')]('close',close);}ami['on'](_0x03fc('0x1a'),connect);ami['on'](_0x03fc('0x1b'),function(_0x4cccfe){logger[_0x03fc('0x1c')](util[_0x03fc('0xc')](_0x03fc('0x1d'),config['asterisk'][_0x03fc('0x7')],config['asterisk']['ip'],config[_0x03fc('0x5')][_0x03fc('0x6')],util['inspect'](_0x4cccfe,![],null)));});ami['on']('fullybooted',function(){logger[_0x03fc('0x1c')](util[_0x03fc('0xc')](_0x03fc('0x1e'),config[_0x03fc('0x5')][_0x03fc('0x7')],config[_0x03fc('0x5')]['ip'],config['asterisk']['port']));return Promise[_0x03fc('0x1f')]()[_0x03fc('0x20')](ami[_0x03fc('0x21')]())[_0x03fc('0x20')](ami[_0x03fc('0x11')]())[_0x03fc('0x20')](ami[_0x03fc('0x13')]())[_0x03fc('0x20')](ami[_0x03fc('0x15')]())[_0x03fc('0x20')](ami[_0x03fc('0x17')]())[_0x03fc('0x22')](function(_0x38411c){logger[_0x03fc('0xb')](_0x03fc('0x23'),util['inspect'](_0x38411c,{'showHidden':![],'depth':null}));});});ami[_0x03fc('0x19')](_0x03fc('0xb'),error);ami[_0x03fc('0x19')](_0x03fc('0x24'),close);module['exports']=ami; \ No newline at end of file +var _0xd6cc=['actionDeviceStateList','catch','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','port','asterisk','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','once','close','connect','shutdown','inspect','fullybooted','info','resolve','then'];(function(_0x24b73b,_0x2fb7fb){var _0x15cfbd=function(_0x5966c6){while(--_0x5966c6){_0x24b73b['push'](_0x24b73b['shift']());}};_0x15cfbd(++_0x2fb7fb);}(_0xd6cc,0x1d7));var _0xcd6c=function(_0x3418cf,_0x24b5b9){_0x3418cf=_0x3418cf-0x0;var _0x323adc=_0xd6cc[_0x3418cf];return _0x323adc;};'use strict';var Manager=require(_0xcd6c('0x0'));var BPromise=require(_0xcd6c('0x1'));var util=require('util');var logger=require(_0xcd6c('0x2'))(_0xcd6c('0x3'));var config=require(_0xcd6c('0x4'));var ami=new Manager(config['asterisk'][_0xcd6c('0x5')],config[_0xcd6c('0x6')]['ip'],config[_0xcd6c('0x6')]['username'],config[_0xcd6c('0x6')]['password'],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xcd6c('0x7')](ami[_0xcd6c('0x8')]);function error(_0x1af1cb){logger[_0xcd6c('0x9')](util[_0xcd6c('0xa')](_0xcd6c('0xb'),config[_0xcd6c('0x6')][_0xcd6c('0xc')],config['asterisk']['ip'],config[_0xcd6c('0x6')][_0xcd6c('0x5')],util['inspect'](_0x1af1cb,![],null)));}function close(){logger['error'](util[_0xcd6c('0xa')](_0xcd6c('0xd'),config[_0xcd6c('0x6')][_0xcd6c('0xc')],config['asterisk']['ip'],config['asterisk']['port']));}ami[_0xcd6c('0xe')]=function(){return function(){return ami['Action']({'action':_0xcd6c('0xf')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xcd6c('0x10')]({'action':_0xcd6c('0x11')});};};ami[_0xcd6c('0x12')]=function(){return function(){return ami[_0xcd6c('0x10')]({'action':_0xcd6c('0x13')});};};ami[_0xcd6c('0x14')]=function(){return function(){return ami[_0xcd6c('0x10')]({'action':_0xcd6c('0x15')});};};ami[_0xcd6c('0x16')]=function(){return function(){return ami[_0xcd6c('0x10')]({'action':_0xcd6c('0x17')});};};function connect(){logger['info'](util[_0xcd6c('0xa')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xcd6c('0x6')][_0xcd6c('0xc')],config[_0xcd6c('0x6')]['ip'],config['asterisk'][_0xcd6c('0x5')]));ami[_0xcd6c('0x18')](_0xcd6c('0x9'),error);ami[_0xcd6c('0x18')](_0xcd6c('0x19'),close);}ami['on'](_0xcd6c('0x1a'),connect);ami['on'](_0xcd6c('0x1b'),function(_0x2c55d8){logger['info'](util[_0xcd6c('0xa')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xcd6c('0xc')],config['asterisk']['ip'],config[_0xcd6c('0x6')][_0xcd6c('0x5')],util[_0xcd6c('0x1c')](_0x2c55d8,![],null)));});ami['on'](_0xcd6c('0x1d'),function(){logger[_0xcd6c('0x1e')](util[_0xcd6c('0xa')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config['asterisk'][_0xcd6c('0xc')],config[_0xcd6c('0x6')]['ip'],config['asterisk'][_0xcd6c('0x5')]));return Promise[_0xcd6c('0x1f')]()[_0xcd6c('0x20')](ami[_0xcd6c('0xe')]())[_0xcd6c('0x20')](ami[_0xcd6c('0x21')]())[_0xcd6c('0x20')](ami[_0xcd6c('0x12')]())[_0xcd6c('0x20')](ami[_0xcd6c('0x14')]())[_0xcd6c('0x20')](ami['actionCoreShowChannels']())[_0xcd6c('0x22')](function(_0x591a06){logger[_0xcd6c('0x9')]('[ami.js][fullybooted]',util[_0xcd6c('0x1c')](_0x591a06,{'showHidden':![],'depth':null}));});});ami[_0xcd6c('0x18')]('error',error);ami[_0xcd6c('0x18')]('close',close);module[_0xcd6c('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 2d0d21f..6802d50 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['message','result','catch','exports','jayson/promise','bluebird','http','Request','then','debug','memberReport','error','rpc'];(function(_0x239ce8,_0x191cb8){var _0x37963f=function(_0x1e9f2a){while(--_0x1e9f2a){_0x239ce8['push'](_0x239ce8['shift']());}};_0x37963f(++_0x191cb8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var jayson=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('ami');var client=jayson['client'][_0x0d8b('0x2')]({'port':0x2329});client[_0x0d8b('0x3')]=function(_0x43bca1,_0x364286){return new BPromise(function(_0x8196ed,_0x577834){return client['request'](_0x43bca1,_0x364286)[_0x0d8b('0x4')](function(_0x227c63){logger[_0x0d8b('0x5')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x364286,_0x227c63);if(_0x227c63[_0x0d8b('0x7')]){logger['error'](_0x0d8b('0x8'),_0x0d8b('0x6'),_0x43bca1,_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')],_0x364286);return _0x577834(_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')]);}else{return _0x8196ed(_0x227c63[_0x0d8b('0xa')]);}})[_0x0d8b('0xb')](function(_0x48fa16){logger[_0x0d8b('0x7')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x48fa16,_0x364286);return _0x577834(_0x48fa16);});});};module[_0x0d8b('0xc')]=client; \ No newline at end of file +var _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x277af0,_0x1f0361){var _0x43bd7c=function(_0x3ad480){while(--_0x3ad480){_0x277af0['push'](_0x277af0['shift']());}};_0x43bd7c(++_0x1f0361);}(_0xe706,0xa3));var _0x6e70=function(_0xa861aa,_0x2895a4){_0xa861aa=_0xa861aa-0x0;var _0x1e34de=_0xe706[_0xa861aa];return _0x1e34de;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index b817eec..91ad8b2 100644 --- a/server/services/ami/dialer/index.js +++ b/server/services/ami/dialer/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe351=['dialPowerLevel','predictive','Queue','method\x20not\x20recognized','silly','Voice\x20Queue\x20%s\x20$s','intervalIftime','Global:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueid','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','dialQueueProject2','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','getSeconds','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','agiafterat','countdropretry','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','dialDropRetryFrequency','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','CALLEREXIT','countglobal','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','syncNewExten','channel','actionid','strategy','rrmemory','isNil','locked','paused','stateinterface','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[booked][unlock3]','getQueue','response','Success','callProgressDetecting','variable','amdstatus','exten','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','membername','AMD','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','Machine','countmachineretry','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countabandonedretry','countagentrejectretry','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','[rescheduleContact][Machine]','HangupInAMD','MACHINE','countcongestionretry','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','Normal\x20Clearing','outboundUnknownCallsDay','queuesSummary','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','inUse','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','clearZombieChannels','[uniqueid]','[actions]','enqueue','Action','No\x20such\x20channel','[Dialer][checkChannel]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','loggerHandler','emptyContact','notFound','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','Agent','user:%s','user:dialPreviewRecallReminder','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','NONE','getCaller','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-CAMPAIGNID','setXMDContactVariables','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originate][error]','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','[rescheduleContact]\x20[Busy]','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','createStateFinal','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','talking','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','dialPredictiveInterval','recalculate\x20predictive\x20at','avgHandleTime','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalTotalCalls','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','loggedIn','predictiveIntervalPauses','outboundQueuePauses','[CatchErlangB]','busyFactor','check\x20failure','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','maxNumberOriginate','getContactDialerIvr','checkContactEmpty','RUNNING','ivrTotalCallsDays','[actionOriginateIvr]\x20','dialLimitQueue','pTalking','undefined','not_inuse','countReScheduled','[countReScheduled]\x20','Contact','[actionOriginate]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','getContactDialer','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','util','uuid','moment','ioredis','./utils','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','redis','defaults','localhost','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','env','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','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','erlangCalls','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','inspect','checkContactLowerLimitOriginate','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Interval','Intervals','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20disactive','Error','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','Trunk','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','length','push','command','interval','content','true','catch','indexOf','all','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','stringify','resetActiveCalls','syncCampaigns','isIVRCampaignActive','resolve','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','power','handlePower'];(function(_0x15e735,_0x1f18ea){var _0x270ce1=function(_0x36bb87){while(--_0x36bb87){_0x15e735['push'](_0x15e735['shift']());}};_0x270ce1(++_0x1f18ea);}(_0xe351,0x165));var _0x1e35=function(_0x522128,_0x3a4911){_0x522128=_0x522128-0x0;var _0x2f8416=_0xe351[_0x522128];return _0x2f8416;};'use strict';var util=require(_0x1e35('0x0'));var _=require('lodash');var uuid=require(_0x1e35('0x1'));var moment=require(_0x1e35('0x2'));var rr=require('rr');var Redis=require(_0x1e35('0x3'));var utils=require(_0x1e35('0x4'));var hopperUtils=require('./utils/hopper');var ut=require(_0x1e35('0x5'));var config=require(_0x1e35('0x6'));var logger=require(_0x1e35('0x7'))(_0x1e35('0x8'));var loggerBooked=require('../../../config/logger')(_0x1e35('0x9'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x1e35('0x7'))(_0x1e35('0xa'));var loggerSyncQueueSummary=require(_0x1e35('0x7'))(_0x1e35('0xb'));var ami=require('../ami');config[_0x1e35('0xc')]=_[_0x1e35('0xd')](config[_0x1e35('0xc')],{'host':_0x1e35('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1e35('0xc')]));var cmHopper=require(_0x1e35('0xf'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x1e35('0x10'));var Interval=require(_0x1e35('0x11'));var Action=require(_0x1e35('0x12'));var History=require(_0x1e35('0x13'));var Final=require(_0x1e35('0x14'));var AgentComplete=require(_0x1e35('0x15'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require('./models/hangup');var ipAgi=process[_0x1e35('0x16')]['XCALLY_IP_AGI']||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x1e35('0x17')]['enqueue']=function(_0x328e30){this[_0x1e35('0x18')]=this[_0x1e35('0x18')]?this['tail'][_0x1e35('0x19')](_0x328e30):_0x328e30();};function Dialer(_0x22437f,_0x532dc8){this[_0x1e35('0x1a')]=new Sequence();this[_0x1e35('0x1b')]=_0x532dc8;this[_0x1e35('0x1c')]=_0x22437f['voiceQueues'];this[_0x1e35('0x1d')]=_0x22437f[_0x1e35('0x1d')];this[_0x1e35('0x1e')]=_0x22437f[_0x1e35('0x1e')];this['trunks']=_0x22437f[_0x1e35('0x1f')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this[_0x1e35('0x20')]={};this[_0x1e35('0x21')]={};this[_0x1e35('0x22')]={};this[_0x1e35('0x23')]={};this[_0x1e35('0x24')]={};this[_0x1e35('0x25')]={};this[_0x1e35('0x26')]={};this[_0x1e35('0x27')]={};this[_0x1e35('0x28')]={};this[_0x1e35('0x29')]={};this['queuesSummary']={};ami['on'](_0x1e35('0x2a'),this[_0x1e35('0x2b')][_0x1e35('0x2c')](this));ami['on']('queuecallerabandon',this[_0x1e35('0x2d')][_0x1e35('0x2c')](this));ami['on'](_0x1e35('0x2e'),this[_0x1e35('0x2f')][_0x1e35('0x2c')](this));ami['on'](_0x1e35('0x30'),this[_0x1e35('0x31')][_0x1e35('0x2c')](this));ami['on'](_0x1e35('0x32'),this[_0x1e35('0xb')]['bind'](this));ami['on'](_0x1e35('0x33'),this['syncQueueSummaryComplete'][_0x1e35('0x2c')](this));ami['on']('hangup',this[_0x1e35('0x34')]['bind'](this));ami['on'](_0x1e35('0x35'),this['syncNewExten'][_0x1e35('0x2c')](this));ami['on'](_0x1e35('0x36'),this[_0x1e35('0x37')][_0x1e35('0x2c')](this));ami['on'](_0x1e35('0x38'),this[_0x1e35('0x39')][_0x1e35('0x2c')](this));ami['on'](_0x1e35('0x3a'),this[_0x1e35('0x3b')][_0x1e35('0x2c')](this));this[_0x1e35('0x3c')]();this[_0x1e35('0x3d')]();RpcSetting[_0x1e35('0x3e')]()[_0x1e35('0x3f')](function(_0x262cb0){previewRecallmeReminderInterval=_0x262cb0[_0x1e35('0x40')];});}function isNotNull(_0x31a223){return _0x31a223!==null&&!_[_0x1e35('0x41')](_0x31a223);}function msgResponse(_0x34afef,_0x33a889,_0x2d2b1f){return{'action':_0x34afef,'response':_0x33a889,'message':_0x2d2b1f,'stack':_0x2d2b1f};}function emit(_0x30698c,_0x2e2159,_0x41eba8){io['to'](_0x30698c)[_0x1e35('0x42')](_0x2e2159,_0x41eba8);}function emitOutboundVoiceQueueSummary(_0x14d39f){if(_0x14d39f[_0x1e35('0x43')]==='outbound'){logger[_0x1e35('0x44')](_0x1e35('0x45'),util['inspect'](_0x14d39f,{'showHidden':![],'depth':null}));emit(util[_0x1e35('0x46')](_0x1e35('0x47'),_0x14d39f[_0x1e35('0x48')]),_0x1e35('0x49'),_0x14d39f);}}function checkGetDataPredictive(_0x530276){if(isNotNull(_0x530276)&&!_[_0x1e35('0x4a')](_0x530276)){loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x4c'));loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x4d'),_0x530276['predictiveIntervalTotalCalls']);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x4e'),_0x530276[_0x1e35('0x4f')]);loggerPredictive['info'](_0x1e35('0x50'),_0x530276[_0x1e35('0x51')]);loggerPredictive[_0x1e35('0x4b')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x530276['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x52'),_0x530276['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x1e35('0x4b')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x530276[_0x1e35('0x53')]);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x54'));if(_0x530276['predictiveIntervalTotalCalls']>0x0){if(!_[_0x1e35('0x41')](_0x530276[_0x1e35('0x53')])&&_0x530276[_0x1e35('0x53')]>0x0){return!![];}loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x55'));if(!_[_0x1e35('0x41')](_0x530276['predictiveIntervalAvgHoldtime'])&&_0x530276[_0x1e35('0x56')]>0x0){return!![];}loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x57'));}else{loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x58'));}}else{loggerPredictive[_0x1e35('0x4b')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x55c438){return function(_0x426268){loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x59'));loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x5a'),_0x426268[_0x1e35('0x5b')]);loggerPredictive[_0x1e35('0x4b')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x426268[_0x1e35('0x5c')]);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x5d'),_0x426268[_0x1e35('0x5e')]);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x5f'),_0x426268[_0x1e35('0x60')]);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x5d'),_0x426268[_0x1e35('0x5e')]);loggerPredictive['info'](_0x1e35('0x54'));_[_0x1e35('0x61')](_0x55c438,_0x426268);};}function ifInterval(_0x2ced7b,_0x3f5108){if(_[_0x1e35('0x41')](_0x3f5108)){return![];}return utils['getSeconds'](undefined,_0x3f5108)<_0x2ced7b*0x3c;}function clearPredictiveAttributes(_0x4a476d){if(_0x4a476d[_0x1e35('0x26')]){_0x4a476d['startProgressive']=undefined;loggerPredictive['debug'](_0x4a476d[_0x1e35('0x48')],'startProgressive\x20value\x20cleared');}if(_0x4a476d['startPredictive']){_0x4a476d['startPredictive']=undefined;loggerPredictive[_0x1e35('0x44')](_0x4a476d['name'],'startPredictive\x20value\x20cleared');}if(_0x4a476d[_0x1e35('0x62')]){clearInterval(_0x4a476d[_0x1e35('0x62')]);_0x4a476d['handlePredictive']=undefined;loggerPredictive[_0x1e35('0x44')](_0x4a476d[_0x1e35('0x48')],_0x1e35('0x63'));}}function loggerCatchPredictive(_0x3a1a63,_0x5a072b){return function(_0x2e68d1){loggerPredictive[_0x1e35('0x64')](_0x5a072b['name'],_0x3a1a63);loggerPredictive[_0x1e35('0x64')](_0x2e68d1[_0x1e35('0x65')]);clearPredictiveAttributes(_0x5a072b);};}function loggerCatch(_0x123b78){return function(_0x4677c0){logger[_0x1e35('0x64')](_0x123b78,util[_0x1e35('0x66')](_0x4677c0,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x3632ff,_0x4d0792,_0xf56dcd){return function(_0x3d0cb0){utils[_0x1e35('0x67')](_0x4d0792,_0xf56dcd,0x0);_0x4d0792['temp']=0x0;logger['error'](_0x3632ff,util[_0x1e35('0x66')](_0x3d0cb0,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x364475){return function(_0x42a903){if(isNotNull(_0x42a903)&&isNotNull(_0x42a903[0x0])){if(_0x42a903[0x0][_0x1e35('0x68')]>0x0){_0x364475['message']=utils[_0x1e35('0x69')][_0x1e35('0x6a')];logger[_0x1e35('0x4b')](_0x1e35('0x6b')+_0x364475[_0x1e35('0x48')],_0x42a903[0x0][_0x1e35('0x68')],'contacts');}else{_0x364475[_0x1e35('0x6c')]=utils['CAMPAIGN_STATUS'][_0x1e35('0x6d')];logger[_0x1e35('0x4b')](_0x1e35('0x6e')+_0x364475['name']);}}};}function createObjHistory(_0x403c0a,_0x1c7c79,_0x17e8b7,_0x2cb13d,_0x4e3cba){_0x403c0a[_0x1e35('0x6c')]=_0x17e8b7;var _0xdff37=new Action(_0x403c0a,_0x1c7c79);var _0x506ce5=new History(_0xdff37);_0x506ce5[_0x1e35('0x6f')]=_0x2cb13d;_0x506ce5[_0x1e35('0x70')]=_0x4e3cba;_0x506ce5['endtime']=_0xdff37[_0x1e35('0x71')];return _0x506ce5;}function unlockQueueStatus(_0x2d4e65,_0x45b8a8){setTimeout(function(){if(_[_0x1e35('0x41')](_0x2d4e65[_0x1e35('0x72')])){loggerBooked[_0x1e35('0x64')](_0x1e35('0x73'),_0x45b8a8);}_0x2d4e65[_0x1e35('0x72')]=!![];loggerBooked[_0x1e35('0x4b')](_0x1e35('0x74'),_0x45b8a8,JSON['stringify'](_[_0x1e35('0x75')](_0x2d4e65,[_0x1e35('0x48'),_0x1e35('0x72')])));},0x1f3);}function checkInterval(_0x423700){return function(){if(!isNotNull(_0x423700['Interval'])){_0x423700[_0x1e35('0x6c')]=utils[_0x1e35('0x69')][_0x1e35('0x76')];throw _0x423700[_0x1e35('0x48')]+_0x1e35('0x77');}if(!isNotNull(_0x423700[_0x1e35('0x78')][_0x1e35('0x79')])){_0x423700[_0x1e35('0x6c')]=utils['CAMPAIGN_STATUS'][_0x1e35('0x76')];throw _0x423700[_0x1e35('0x48')]+_0x1e35('0x77');}if(!isNotNull(_['isEmpty'](_0x423700[_0x1e35('0x78')]['Intervals']))){_0x423700[_0x1e35('0x6c')]=utils[_0x1e35('0x69')][_0x1e35('0x76')];throw _0x423700[_0x1e35('0x48')]+_0x1e35('0x77');}};}function checkIsIVRCampaignActive(_0x4bac1c){return function(){if(!utils['isIVRCampaignActive'](_0x4bac1c)){_0x4bac1c[_0x1e35('0x6c')]=utils[_0x1e35('0x69')][_0x1e35('0x7a')];throw _0x4bac1c[_0x1e35('0x48')]+_0x1e35('0x7b');}};}function emitCampaignSummary(_0x37ddec){if(utils[_0x1e35('0x7c')](_0x37ddec)){emit(util['format'](_0x1e35('0x7d'),_0x37ddec[_0x1e35('0x48')]),'campaign:save',_0x37ddec);}}function loggerCatchQueueSummary(_0x4a8654,_0x4e234a){return function(_0x3aa871){clearPredictiveAttributes(_0x4e234a);emitCampaignSummary(_0x4e234a);loggerSyncQueueSummary[_0x1e35('0x44')](_0x4a8654,util[_0x1e35('0x66')](_0x3aa871,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x1dc458){if(_0x1dc458[_0x1e35('0x7e')]){if(_0x1dc458[_0x1e35('0x7f')]===0x0){_0x1dc458[_0x1e35('0x7e')]=![];_0x1dc458[_0x1e35('0x6c')]=utils[_0x1e35('0x69')][_0x1e35('0x7a')];loggerSyncQueueSummary['debug'](_0x1e35('0x80'),_0x1dc458[_0x1e35('0x48')],'is\x20not\x20active');}else{_0x1dc458[_0x1e35('0x6c')]=utils[_0x1e35('0x69')][_0x1e35('0x81')];loggerSyncQueueSummary[_0x1e35('0x44')](_0x1e35('0x80'),_0x1dc458[_0x1e35('0x48')],_0x1e35('0x82'));}emitCampaignSummary(_0x1dc458);}}function myreject(_0x4a607c){return function(_0x1d9655){return _0x4a607c(msgResponse('[ifTime][Action]',_0x1e35('0x83'),JSON['stringify'](_0x1d9655)));};}Dialer[_0x1e35('0x17')][_0x1e35('0x84')]=function(_0x56823d){return!_['isUndefined'](_0x56823d)&&_0x56823d&&!_[_0x1e35('0x41')](_0x56823d[_0x1e35('0x48')])&&!_[_0x1e35('0x41')](_0x56823d[_0x1e35('0x85')])&&_0x56823d[_0x1e35('0x85')]&&(this[_0x1e35('0x1f')][util[_0x1e35('0x46')](_0x1e35('0x86'),_0x56823d['name'])][_0x1e35('0x87')]===_0x1e35('0x88')||this[_0x1e35('0x1f')][util[_0x1e35('0x46')](_0x1e35('0x86'),_0x56823d[_0x1e35('0x48')])][_0x1e35('0x87')]===_0x1e35('0x89'));};Dialer[_0x1e35('0x17')]['checkIsTrunkReachable']=function(_0x4bc41f){var _0xbb3c5=this;return function(){if(!_0xbb3c5[_0x1e35('0x84')](_0x4bc41f[_0x1e35('0x8a')])){if(!_0xbb3c5[_0x1e35('0x84')](_0x4bc41f['TrunkBackup'])){_0x4bc41f[_0x1e35('0x6c')]=utils[_0x1e35('0x69')][_0x1e35('0x8b')];throw _0x4bc41f[_0x1e35('0x48')]+_0x1e35('0x8c');}}};};Dialer[_0x1e35('0x17')][_0x1e35('0x8d')]=function(_0x39e12d,_0x182fa8,_0x172097,_0x55b6ab){var _0xc56a42=this;return function(){var _0x5edc4e=!![];return _0xc56a42[_0x1e35('0x8e')](_0x39e12d,_0x182fa8,_0x172097,_0x55b6ab,_0x5edc4e);};};Dialer[_0x1e35('0x17')]['checkIfTimeIntervals']=function(_0x56eb86,_0x773c37,_0x269f98,_0x4a9a02){var _0x56936b=this;return function(){var _0x52766d=![];return _0x56936b[_0x1e35('0x8e')](_0x56eb86[_0x1e35('0x79')],_0x773c37,_0x269f98,_0x4a9a02,_0x52766d);};};Dialer[_0x1e35('0x17')][_0x1e35('0x8e')]=function(_0x7694e0,_0xf4a6e2,_0x1639bd,_0x46504c,_0x1d0085){var _0x378a49=[];return new Promise(function(_0x3c9664,_0x3396d5){if(!isNotNull(_0x7694e0)){_0x46504c[_0x1e35('0x6c')]=utils[_0x1e35('0x69')][_0x1e35('0x76')];return _0x3396d5(msgResponse(_0x1e35('0x8f'),_0x1e35('0x90'),_0x1639bd+_0x1e35('0x91')));}if(_[_0x1e35('0x4a')](_0x7694e0)){_0x46504c['message']=utils[_0x1e35('0x69')][_0x1e35('0x92')];return _0x3396d5(msgResponse('ifTime',_0x1e35('0x90'),_0x1639bd+_0x1e35('0x93')));}if(_0xf4a6e2&&_[_0x1e35('0x41')](config[_0x1e35('0x94')][_0xf4a6e2])){_0x46504c['message']=utils['CAMPAIGN_STATUS'][_0x1e35('0x95')];return _0x3396d5(msgResponse(_0x1e35('0x8f'),_0x1e35('0x90'),_0x1639bd+_0x1e35('0x96')+_0xf4a6e2));}if(_['isArray'](_0x7694e0)){for(var _0x4cef12=0x0;_0x4cef12<_0x7694e0[_0x1e35('0x97')];_0x4cef12+=0x1){_0x378a49[_0x1e35('0x98')](ami['Action']({'action':_0x1e35('0x99'),'command':util[_0x1e35('0x46')]('iftime\x20%s,%s',_0x7694e0[_0x4cef12][_0x1e35('0x9a')],!_['isUndefined'](config[_0x1e35('0x94')][_0xf4a6e2])?_0xf4a6e2:'')})[_0x1e35('0x3f')](function(_0xf6f6f9){return _0xf6f6f9[_0x1e35('0x9b')]['indexOf'](_0x1e35('0x9c'))>=0x0;})[_0x1e35('0x9d')](myreject(_0x3396d5)));}}else{_0x378a49[_0x1e35('0x98')](ami['Action']({'action':'command','command':util['format']('iftime\x20%s,%s',_0x7694e0,!_[_0x1e35('0x41')](config[_0x1e35('0x94')][_0xf4a6e2])?_0xf4a6e2:'')})[_0x1e35('0x3f')](function(_0x54c1f5){return _0x54c1f5[_0x1e35('0x9b')][_0x1e35('0x9e')](_0x1e35('0x9c'))>=0x0;})[_0x1e35('0x9d')](myreject(_0x3396d5)));}Promise[_0x1e35('0x9f')](_0x378a49)[_0x1e35('0x3f')](function(_0x14574e){var _0x41920f=_['some'](_0x14574e);if(_0x41920f){return _0x3c9664(_0x41920f);}else{_0x46504c[_0x1e35('0x6c')]=_0x1d0085?utils[_0x1e35('0x69')][_0x1e35('0xa0')]:utils[_0x1e35('0x69')][_0x1e35('0xa1')];return _0x3396d5(msgResponse('[ifTime][promiseAll]',_0x1e35('0x90'),'Global:\x20'+_0x1d0085+'\x20'+_0x1639bd+_0x1e35('0xa2')+util[_0x1e35('0x66')](_0x7694e0,{'showHidden':![],'depth':null})+_0x1e35('0xa3')+_0xf4a6e2));}})[_0x1e35('0x9d')](function(_0x1f639d){return _0x3396d5(msgResponse(_0x1e35('0x8f'),'Failure',JSON[_0x1e35('0xa4')](_0x1f639d)));});});};Dialer[_0x1e35('0x17')][_0x1e35('0x3c')]=function(){var _0x408247=this;return cmHopper[_0x1e35('0xa5')]({'active':![]},{'where':{'active':!![]}})[_0x1e35('0x3f')](function(){setInterval(function(){_0x408247['syncCampaigns']();},0x3e8);});};Dialer[_0x1e35('0x17')][_0x1e35('0xa6')]=function(){var _0x37d5be=this;var _0x552ec6;for(var _0x232e1e in this[_0x1e35('0x1d')]){if(typeof this[_0x1e35('0x1d')][_0x232e1e]!=='undefined'){_0x552ec6=this[_0x1e35('0x1d')][_0x232e1e];if(utils[_0x1e35('0x7c')](_0x552ec6)&&utils[_0x1e35('0xa7')](_0x552ec6)){_0x552ec6[_0x1e35('0x7e')]=!![];Promise[_0x1e35('0xa8')]()['then'](checkIsIVRCampaignActive(_0x552ec6))[_0x1e35('0x3f')](checkInterval(_0x552ec6))[_0x1e35('0x3f')](_0x37d5be[_0x1e35('0xa9')](_0x552ec6))[_0x1e35('0x3f')](_0x37d5be[_0x1e35('0x8d')](_0x552ec6[_0x1e35('0xaa')],_0x552ec6[_0x1e35('0xab')],_0x552ec6['name'],_0x552ec6))[_0x1e35('0x3f')](_0x37d5be[_0x1e35('0xac')](_0x552ec6['Interval'],_0x552ec6[_0x1e35('0xab')],_0x552ec6[_0x1e35('0x48')],_0x552ec6))[_0x1e35('0x3f')](_0x37d5be[_0x1e35('0xad')](_0x552ec6))[_0x1e35('0x9d')](loggerCatchQueueSummary(_0x1e35('0xae'),_0x552ec6));}else{notSendMessagesCampaign(_0x552ec6);}}}};Dialer['prototype'][_0x1e35('0xaf')]=function(_0xf69491){if(_0xf69491['dialMethod']!=='predictive'){clearPredictiveAttributes(_0xf69491);}switch(_0xf69491[_0x1e35('0xb0')]){case'progressive':this['handlePower'](_0xf69491,0x1);break;case _0x1e35('0xb1'):this[_0x1e35('0xb2')](_0xf69491,_0xf69491[_0x1e35('0xb3')]);break;case'predictive':this[_0x1e35('0xb4')](_0xf69491);break;case'booked':this[_0x1e35('0xb2')](_0xf69491,0x1);break;default:logger[_0x1e35('0x64')](_0x1e35('0xb5'),_0xf69491[_0x1e35('0x48')],_0x1e35('0xb6'));}};Dialer[_0x1e35('0x17')][_0x1e35('0x8f')]=function(_0x587807,_0x22fc4e){var _0x24103b=_0x587807[_0x1e35('0xab')];var _0x6b3a44=_0x22fc4e?_0x587807[_0x1e35('0xaa')]:_0x587807['Interval'][_0x1e35('0x79')];logger[_0x1e35('0xb7')]('Dialer::ifTime()',_0x6b3a44,_0x24103b,_0x587807[_0x1e35('0x48')],util[_0x1e35('0x46')](_0x1e35('0xb8'),_0x587807['name'],_0x587807['id']));var _0x401f95=null;return Interval[_0x1e35('0xb9')](_0x6b3a44,_0x24103b)[_0x1e35('0x3f')](function(_0x2d75dc){if(_0x2d75dc===!![]){return _0x2d75dc;}else{_0x587807[_0x1e35('0x6c')]=_0x22fc4e?utils[_0x1e35('0x69')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x1e35('0x69')][_0x1e35('0xa1')];_0x401f95=msgResponse('[ifTime][promiseAll]','Failure',_0x1e35('0xba')+_0x22fc4e+'\x20'+_0x587807['name']+_0x1e35('0xa2')+util[_0x1e35('0x66')](_0x6b3a44,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x24103b);}if(_0x401f95!==null){logger[_0x1e35('0xb7')](_0x1e35('0xbb'),_0x401f95);_0x401f95[_0x1e35('0xbc')]=_0x22fc4e;throw _0x401f95;}})[_0x1e35('0x9d')](function(_0x54948b){logger[_0x1e35('0x64')](_0x1e35('0xbd'),_0x54948b);throw msgResponse('[ifTime][Action]','Error',util['inspect'](_0x54948b,{'showHidden':![],'depth':null}));});};Dialer[_0x1e35('0x17')]['syncAgentConnect']=function(_0x245014){if(this['voiceQueues'][_0x245014[_0x1e35('0xbe')]]){if(this[_0x1e35('0x23')][_0x245014[_0x1e35('0xbf')]]&&this['uniqueId'][_0x245014['uniqueid']]['type']!==_0x1e35('0xc0')){this[_0x1e35('0xc1')](this[_0x1e35('0x1c')][_0x245014[_0x1e35('0xbe')]]);this[_0x1e35('0x23')][_0x245014[_0x1e35('0xbf')]][_0x1e35('0xc2')]=moment()[_0x1e35('0x46')](_0x1e35('0xc3'));}}};Dialer[_0x1e35('0x17')][_0x1e35('0x31')]=function(_0x1a1d07){var _0x488c23=this[_0x1e35('0x23')][_0x1a1d07[_0x1e35('0xbf')]];if(this['voiceQueues'][_0x1a1d07[_0x1e35('0xbe')]]){if(_0x488c23&&_0x488c23['type']!==_0x1e35('0xc0')){delete this['uniqueId'][_0x1a1d07['uniqueid']];this[_0x1e35('0x1c')][_0x1a1d07[_0x1e35('0xbe')]][_0x1e35('0xc4')]+=0x1;var _0x113b6f=new AgentComplete(_0x488c23,_0x1a1d07);if(_0x1a1d07[_0x1e35('0xc5')]===_0x1e35('0xc6')){_0x113b6f['agiafterat']=this[_0x1e35('0x1c')][_0x1a1d07[_0x1e35('0xbe')]][_0x1e35('0xc7')]&&this[_0x1e35('0x1c')][_0x1a1d07[_0x1e35('0xbe')]]['dialAgiAfterHangupAgent']?moment()['format'](_0x1e35('0xc3')):undefined;}hopperUtils[_0x1e35('0xc8')](_0x113b6f)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0xc9')));hopperUtils[_0x1e35('0xca')](_0x113b6f)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0xcb')));}}};Dialer[_0x1e35('0x17')][_0x1e35('0x2d')]=function(_0x8e8e15){var _0xcbeaa7=this[_0x1e35('0x23')][_0x8e8e15[_0x1e35('0xbf')]];var _0x58e418=this;var _0x1402a5=![];var _0x318362;var _0x5b46e3;if(this['voiceQueues'][_0x8e8e15[_0x1e35('0xbe')]]){if(_0xcbeaa7&&_0xcbeaa7[_0x1e35('0x43')]!==_0x1e35('0xc0')){delete this[_0x1e35('0x23')][_0x8e8e15[_0x1e35('0xbf')]];this[_0x1e35('0xc1')](this[_0x1e35('0x1c')][_0x8e8e15[_0x1e35('0xbe')]]);_0xcbeaa7['droptime']=moment()['format'](_0x1e35('0xc3'));var _0xc5aced=new QueueCallerAbandon(_0xcbeaa7,_0x8e8e15);if(utils[_0x1e35('0xcc')](_0xcbeaa7['droptime'],_0xcbeaa7[_0x1e35('0xcd')])>=_0xcbeaa7[_0x1e35('0xce')]){this[_0x1e35('0x1c')][_0x8e8e15[_0x1e35('0xbe')]][_0x1e35('0x51')]+=0x1;this['voiceQueues'][_0x8e8e15['queue']][_0x1e35('0xcf')]+=0x1;this[_0x1e35('0x1c')][_0x8e8e15[_0x1e35('0xbe')]][_0x1e35('0xd0')]+=0x1;_0xc5aced[_0x1e35('0x6f')]=0xa;_0xc5aced[_0x1e35('0x70')]=_0x1e35('0xd1');_0xc5aced[_0x1e35('0xd2')]=_0x1e35('0xd3');_0xc5aced[_0x1e35('0xd4')]=this[_0x1e35('0x1c')][_0x8e8e15['queue']][_0x1e35('0xc7')]?moment()['format'](_0x1e35('0xc3')):undefined;_0xc5aced[_0x1e35('0xd5')]+=0x1;_0xc5aced['countglobal']+=0x1;_0x318362=this['voiceQueues'][_0x8e8e15[_0x1e35('0xbe')]]['dialDropRetryFrequency'];_0x5b46e3=this[_0x1e35('0x1c')][_0x8e8e15['queue']][_0x1e35('0xd6')];hopperUtils[_0x1e35('0xd7')](_0xc5aced,_0xc5aced[_0x1e35('0x6f')],_0xcbeaa7[_0x1e35('0xd8')])['then'](function(_0x3b64ad){_0x1402a5=_0x3b64ad[_0x1e35('0xd9')]==0x1;if(_0xc5aced[_0x1e35('0xd5')]>=_0x58e418[_0x1e35('0x1c')][_0x8e8e15[_0x1e35('0xbe')]][_0x1e35('0xda')]){_0x58e418[_0x1e35('0xdb')](_0xc5aced,_0x3b64ad['additional']);}else{hopperUtils[_0x1e35('0xdc')]({'active':![],'countdropretry':_0xc5aced[_0x1e35('0xd5')],'scheduledat':moment()[_0x1e35('0xdd')](_0x58e418[_0x1e35('0x1c')][_0x8e8e15[_0x1e35('0xbe')]][_0x1e35('0xde')],'minutes')[_0x1e35('0x46')](_0x1e35('0xc3')),'ContactId':_0xcbeaa7[_0x1e35('0xdf')],'ListId':_0xcbeaa7[_0x1e35('0xe0')],'VoiceQueueId':_0xcbeaa7[_0x1e35('0xe1')]||undefined,'CampaignId':_0xcbeaa7[_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0xe3')));var _0x5347fd=new History(_0xc5aced);_0x5347fd[_0x1e35('0x6f')]=0xa;_0x5347fd[_0x1e35('0x70')]=_0x1e35('0xd1');_0x5347fd[_0x1e35('0x71')]=moment()[_0x1e35('0x46')](_0x1e35('0xc3'));_0x5347fd[_0x1e35('0xe4')]=_0x5347fd[_0x1e35('0x71')];_0x5347fd[_0x1e35('0xe5')]=_0xc5aced[_0x1e35('0xe5')];_0x5347fd['calleridnum']=_0xc5aced[_0x1e35('0xe6')];hopperUtils[_0x1e35('0xc8')](_0x5347fd)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0xe7')));}})[_0x1e35('0x3f')](function(){if(_0x1402a5)hopperUtils[_0x1e35('0xe8')](_0xc5aced,_0x318362,_0x5b46e3)['then'](function(){return 0x1;});});}else{this[_0x1e35('0x1c')][_0x8e8e15[_0x1e35('0xbe')]][_0x1e35('0xe9')]+=0x1;this[_0x1e35('0x1c')][_0x8e8e15[_0x1e35('0xbe')]]['outboundDropCallsDayCallersExit']+=0x1;_0xc5aced[_0x1e35('0x6f')]=0xb;_0xc5aced[_0x1e35('0x70')]='Abandoned';_0xc5aced['dropreason']=_0x1e35('0xea');_0xc5aced['countabandonedretry']+=0x1;_0xc5aced[_0x1e35('0xeb')]+=0x1;_0x318362=this[_0x1e35('0x1c')][_0x8e8e15['queue']][_0x1e35('0xec')];_0x5b46e3=this['voiceQueues'][_0x8e8e15['queue']][_0x1e35('0xd6')];hopperUtils[_0x1e35('0xd7')](_0xc5aced,_0xc5aced['state'],_0xcbeaa7[_0x1e35('0xd8')])[_0x1e35('0x3f')](function(_0x5a90ba){if(_0xc5aced['countabandonedretry']>=_0x58e418[_0x1e35('0x1c')][_0x8e8e15['queue']][_0x1e35('0xed')]){_0x58e418[_0x1e35('0xdb')](_0xc5aced,_0x5a90ba['additional']);}else{hopperUtils[_0x1e35('0xdc')]({'active':![],'countabandonedretry':_0xc5aced['countabandonedretry'],'scheduledat':moment()[_0x1e35('0xdd')](_0x58e418[_0x1e35('0x1c')][_0x8e8e15[_0x1e35('0xbe')]][_0x1e35('0xec')],'minutes')[_0x1e35('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xcbeaa7[_0x1e35('0xdf')],'ListId':_0xcbeaa7[_0x1e35('0xe0')],'VoiceQueueId':_0xcbeaa7[_0x1e35('0xe1')]||undefined,'CampaignId':_0xcbeaa7[_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0xee')));var _0x3bef2c=new History(_0xc5aced);_0x3bef2c[_0x1e35('0x6f')]=0xb;_0x3bef2c[_0x1e35('0x70')]='Abandoned';_0x3bef2c[_0x1e35('0x71')]=moment()[_0x1e35('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x3bef2c['endtime']=_0x3bef2c[_0x1e35('0x71')];_0x3bef2c['calleridname']=_0xc5aced['calleridname'];_0x3bef2c[_0x1e35('0xe6')]=_0xc5aced[_0x1e35('0xe6')];hopperUtils[_0x1e35('0xc8')](_0x3bef2c)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}})['then'](function(){if(_0x1402a5)hopperUtils[_0x1e35('0xe8')](_0xc5aced,_0x318362,_0x5b46e3)[_0x1e35('0x3f')](function(){return 0x1;});});}}}};Dialer[_0x1e35('0x17')][_0x1e35('0xef')]=function(_0x3eba71){if(this[_0x1e35('0x21')][_0x3eba71['uniqueid']]){this[_0x1e35('0x21')][_0x3eba71[_0x1e35('0xbf')]][_0x1e35('0xf0')]=_0x3eba71[_0x1e35('0xf0')];}if(this[_0x1e35('0x23')][_0x3eba71[_0x1e35('0xbf')]]){this[_0x1e35('0x23')][_0x3eba71['uniqueid']][_0x1e35('0xf0')]=_0x3eba71[_0x1e35('0xf0')];}};Dialer[_0x1e35('0x17')][_0x1e35('0x39')]=function(_0x25e58e){if(!this['actions'][_0x25e58e['actionid']]){return;}var _0xab3ac9=this[_0x1e35('0x1c')][this[_0x1e35('0x21')][_0x25e58e[_0x1e35('0xf1')]]['queue']][_0x1e35('0xf2')]||_0x1e35('0xf3');if(_0xab3ac9==='roundrobin'){if(this[_0x1e35('0x21')][_0x25e58e['actionid']]&&_[_0x1e35('0xf4')](this['actions'][_0x25e58e[_0x1e35('0xf1')]][_0x1e35('0xf5')])&&_0x25e58e[_0x1e35('0x87')]==='1'&&_0x25e58e[_0x1e35('0xf6')]==='0'){if(this[_0x1e35('0x1e')][_0x25e58e[_0x1e35('0xf7')]]){if(!this[_0x1e35('0x1e')][_0x25e58e[_0x1e35('0xf7')]]['locked']){this[_0x1e35('0x1e')][_0x25e58e[_0x1e35('0xf7')]][_0x1e35('0xf5')]=!![];this['actions'][_0x25e58e['actionid']][_0x1e35('0xf5')]=!![];this[_0x1e35('0x21')][_0x25e58e[_0x1e35('0xf1')]][_0x1e35('0xf7')]=_0x25e58e[_0x1e35('0xf7')];}}}}else if(_0xab3ac9===_0x1e35('0xf3')){if(this[_0x1e35('0x21')][_0x25e58e[_0x1e35('0xf1')]]){if(this[_0x1e35('0x1e')][_0x25e58e['stateinterface']]){this[_0x1e35('0x21')][_0x25e58e[_0x1e35('0xf1')]][_0x1e35('0xf7')]=_0x25e58e[_0x1e35('0xf7')];if(_['isNil'](this[_0x1e35('0x28')][this[_0x1e35('0x21')][_0x25e58e[_0x1e35('0xf1')]]['queue']])){this[_0x1e35('0x28')][this['actions'][_0x25e58e[_0x1e35('0xf1')]][_0x1e35('0xbe')]]=[];}this[_0x1e35('0x28')][this[_0x1e35('0x21')][_0x25e58e[_0x1e35('0xf1')]][_0x1e35('0xbe')]][_0x1e35('0x98')](_[_0x1e35('0x61')](_[_0x1e35('0x75')](this[_0x1e35('0x21')][_0x25e58e[_0x1e35('0xf1')]],[_0x1e35('0xf8'),_0x1e35('0xf7')]),{'status':_0x25e58e[_0x1e35('0x87')],'paused':_0x25e58e[_0x1e35('0xf6')]}));}}}};Dialer['prototype']['syncQueueStatusComplete']=function(_0x3cfa4b){if(!this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]]){return;}var _0x335970=this;var _0x56b144=this[_0x1e35('0x1c')][this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xbe')]];var _0x17a765=_0x56b144['strategy']||_0x1e35('0xf3');if(_0x17a765==='roundrobin'){if(this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]]&&this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xf7')]){this['preview'][_0x1e35('0xf9')](this['actions'][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xf8')],this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]]['stateinterface'])[_0x1e35('0x9d')](function(_0x321cba){logger[_0x1e35('0x64')](_0x1e35('0xfa'),util[_0x1e35('0x66')](_0x321cba,{'showHidden':![],'depth':null}));})['finally'](function(){_0x335970[_0x1e35('0xc1')](_0x335970[_0x1e35('0x1c')][_0x335970[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xbe')]]);_0x335970['agents'][_0x335970[_0x1e35('0x21')][_0x3cfa4b['actionid']]['stateinterface']][_0x1e35('0xf5')]=![];delete _0x335970[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]];unlockQueueStatus(_0x56b144);});}else{this[_0x1e35('0xc1')](this[_0x1e35('0x1c')][this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xbe')]]);hopperUtils[_0x1e35('0xdc')]({'active':![],'ContactId':this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xdf')],'ListId':this[_0x1e35('0x21')][_0x3cfa4b['actionid']][_0x1e35('0xe0')],'VoiceQueueId':this['actions'][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xe1')]||undefined,'CampaignId':this['actions'][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0xfb')));delete this['actions'][_0x3cfa4b[_0x1e35('0xf1')]];unlockQueueStatus(_0x56b144);}}else if(_0x17a765===_0x1e35('0xf3')){var _0xdbc000;if(this[_0x1e35('0x21')][_0x3cfa4b['actionid']]&&!_['isEmpty'](this[_0x1e35('0x28')][this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xbe')]])){if(this[_0x1e35('0x29')][_0x335970[_0x1e35('0x21')][_0x3cfa4b['actionid']]['queue']]){this[_0x1e35('0x29')][_0x335970[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]]['queue']]=this[_0x1e35('0x29')][this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xbe')]]?this[_0x1e35('0x29')][this[_0x1e35('0x21')][_0x3cfa4b['actionid']][_0x1e35('0xbe')]]:this[_0x1e35('0x28')][this[_0x1e35('0x21')][_0x3cfa4b['actionid']][_0x1e35('0xbe')]]?this[_0x1e35('0x28')][this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xbe')]][_0x1e35('0xfc')]||0x0:0x0;}this[_0x1e35('0x28')][this['actions'][_0x3cfa4b[_0x1e35('0xf1')]]['queue']][_0x1e35('0xfc')]=this[_0x1e35('0x29')][this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]]['queue']];for(var _0xe7cce2=0x0;_0xe7cce2=_0x4c745d['dialGlobalMaxRetry']){_0x40eaa6['stateGlobal'](_0x29df62,_0x25905b,_0x49b00a,_0x1e35('0x11c'));}else{if(_0x29df62[_0x1e35('0x115')]>=_0x4c745d[_0x1e35('0x11d')]){_0x40eaa6['createStateFinal'](_0x29df62,_0x25905b,_0x49b00a,_0x1e35('0x11e'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x29df62[_0x1e35('0x115')],'scheduledat':moment()[_0x1e35('0xdd')](_0x4c745d[_0x1e35('0x11f')],_0x1e35('0x120'))[_0x1e35('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x29df62[_0x1e35('0xdf')],'ListId':_0x29df62[_0x1e35('0xe0')],'VoiceQueueId':_0x29df62[_0x1e35('0xe1')]||undefined,'CampaignId':_0x29df62['CampaignId']||undefined})['catch'](loggerCatch(_0x1e35('0x121')));_0x25905b({'reschedule':0x1});}}});}if(_0x39375a[_0x1e35('0x43')]===_0x1e35('0xc0')&&this[_0x1e35('0x1d')][_0x39375a[_0x1e35('0xbe')]][_0x1e35('0x10a')]&&_0x372b01[_0x1e35('0x10b')]==='HANGUP'){delete this['uniqueId'][_0x372b01[_0x1e35('0xbf')]];this['updateOriginated'](this['campaigns'][_0x39375a[_0x1e35('0xbe')]]);_0x11172c=new Hangup(_0x39375a,_0x372b01);_0x11172c[_0x1e35('0x6f')]=0x12;_0x11172c[_0x1e35('0x70')]=_0x1e35('0x122');_0x11172c['membername']=_0x1e35('0x10f');ami['emit']('custom:amd',ut[_0x1e35('0x111')](_0x11172c,_0x1e35('0x116')));this[_0x1e35('0x112')](_0x11172c,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x39375a[_0x1e35('0x43')]==='ivr'&&this['campaigns'][_0x39375a['queue']][_0x1e35('0x10a')]&&_0x372b01[_0x1e35('0x10b')]===_0x1e35('0x123')){return new Promise(function(_0x8be506,_0x30162c){delete _0x40eaa6['uniqueId'][_0x372b01[_0x1e35('0xbf')]];_0x40eaa6[_0x1e35('0xc1')](_0x40eaa6['campaigns'][_0x39375a[_0x1e35('0xbe')]]);_0x40eaa6[_0x1e35('0x1d')][_0x39375a[_0x1e35('0xbe')]]['outboundAnswerCallsDay']+=0x1;_0x40eaa6[_0x1e35('0x1d')][_0x39375a[_0x1e35('0xbe')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x58a04c=_0x40eaa6[_0x1e35('0x1d')][_0x39375a[_0x1e35('0xbe')]];var _0x388429=new Hangup(_0x39375a,_0x372b01);_0x388429['state']=0x13;_0x388429[_0x1e35('0x70')]=_0x1e35('0x114');_0x388429[_0x1e35('0x10e')]='AMD';_0x388429[_0x1e35('0x115')]+=0x1;_0x388429['countglobal']+=0x1;_0x388429[_0x1e35('0x116')]=!![];ami['emit'](_0x1e35('0x110'),ut[_0x1e35('0x111')](_0x388429,_0x1e35('0x116')));hopperUtils[_0x1e35('0xc8')](_0x388429)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x117')));if(_0x388429[_0x1e35('0x118')]+_0x388429[_0x1e35('0x124')]+_0x388429[_0x1e35('0x119')]+_0x388429[_0x1e35('0x125')]+_0x388429[_0x1e35('0xd5')]+_0x388429[_0x1e35('0x11a')]+_0x388429['countmachineretry']+_0x388429['countagentrejectretry']>=_0x58a04c[_0x1e35('0x126')]){_0x40eaa6[_0x1e35('0x127')](_0x388429,_0x8be506,_0x30162c,_0x1e35('0x11c'));}else{if(_0x388429['countmachineretry']>=_0x58a04c[_0x1e35('0x11d')]){_0x40eaa6['createStateFinal'](_0x388429,_0x8be506,_0x30162c,'reason\x2019\x20machine....');}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x388429[_0x1e35('0x115')],'scheduledat':moment()['add'](_0x58a04c[_0x1e35('0x11f')],_0x1e35('0x120'))['format'](_0x1e35('0xc3')),'ContactId':_0x388429[_0x1e35('0xdf')],'ListId':_0x388429[_0x1e35('0xe0')],'VoiceQueueId':_0x388429[_0x1e35('0xe1')]||undefined,'CampaignId':_0x388429[_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch('[rescheduleContact][Machine]'));_0x8be506({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x1e35('0x34')]=function(_0x33ba0e){var _0x4416d4=this[_0x1e35('0x23')][_0x33ba0e[_0x1e35('0xbf')]];var _0x3d61e4;if(_0x4416d4&&_0x4416d4[_0x1e35('0x43')]===_0x1e35('0xc0')){delete this[_0x1e35('0x23')][_0x33ba0e[_0x1e35('0xbf')]];this[_0x1e35('0xc1')](this[_0x1e35('0x1d')][_0x4416d4[_0x1e35('0xbe')]]);this['campaigns'][_0x4416d4[_0x1e35('0xbe')]][_0x1e35('0x128')]+=0x1;_0x3d61e4=new Hangup(_0x4416d4,_0x33ba0e);hopperUtils[_0x1e35('0xc8')](_0x3d61e4)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x129')));hopperUtils[_0x1e35('0xca')](_0x3d61e4)['catch'](loggerCatch(_0x1e35('0x12a')));}if(_0x4416d4&&_0x4416d4[_0x1e35('0x43')]!=='ivr'&&isNotNull(this[_0x1e35('0x1c')][_0x4416d4[_0x1e35('0xbe')]][_0x1e35('0x12b')])){delete this['uniqueId'][_0x33ba0e[_0x1e35('0xbf')]];this[_0x1e35('0xc1')](this[_0x1e35('0x1c')][_0x4416d4[_0x1e35('0xbe')]]);this[_0x1e35('0x1c')][_0x4416d4[_0x1e35('0xbe')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x4416d4[_0x1e35('0xbe')]][_0x1e35('0x10d')]+=0x1;_0x3d61e4=new Hangup(_0x4416d4,_0x33ba0e);_0x3d61e4['state']=0x10;_0x3d61e4[_0x1e35('0x70')]='AnswerAGI';_0x3d61e4[_0x1e35('0x10e')]=_0x1e35('0x12c');hopperUtils[_0x1e35('0xc8')](_0x3d61e4)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x129')));hopperUtils[_0x1e35('0xca')](_0x3d61e4)['catch'](loggerCatch(_0x1e35('0x12a')));}if(_0x4416d4&&_0x4416d4[_0x1e35('0x43')]!==_0x1e35('0xc0')&&!isNotNull(this[_0x1e35('0x1c')][_0x4416d4[_0x1e35('0xbe')]][_0x1e35('0x12b')])){if(_0x33ba0e[_0x1e35('0x12d')]===_0x1e35('0x12e')){delete this[_0x1e35('0x23')][_0x33ba0e[_0x1e35('0xbf')]];this[_0x1e35('0x1c')][_0x4416d4['queue']]['outboundAnswerCallsDay']+=0x1;const _0x136d2a=new AgentComplete(_0x4416d4,_0x33ba0e);_0x136d2a[_0x1e35('0xe2')]=this[_0x1e35('0x1c')][_0x4416d4[_0x1e35('0xbe')]]['id'];hopperUtils['createHistory'](_0x136d2a)[_0x1e35('0x9d')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x136d2a)[_0x1e35('0x9d')](loggerCatch('[syncAgentComplete]'));}else{delete this[_0x1e35('0x23')][_0x33ba0e['uniqueid']];this[_0x1e35('0xc1')](this['voiceQueues'][_0x4416d4[_0x1e35('0xbe')]]);this['voiceQueues'][_0x4416d4[_0x1e35('0xbe')]][_0x1e35('0x12f')]+=0x1;_0x3d61e4=new Hangup(_0x4416d4,_0x33ba0e);_0x3d61e4[_0x1e35('0x6f')]=0xc;_0x3d61e4[_0x1e35('0x70')]=_0x33ba0e['cause-txt'];_0x3d61e4[_0x1e35('0x10e')]='Unknow';hopperUtils[_0x1e35('0xc8')](_0x3d61e4)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x129')));hopperUtils[_0x1e35('0xca')](_0x3d61e4)['catch'](loggerCatch('[syncHangupIvr]'));}}};Dialer[_0x1e35('0x17')]['syncQueueSummary']=function(_0x2e61fc){var _0x1fecda=this;if(!_0x1fecda[_0x1e35('0x130')][_0x2e61fc[_0x1e35('0x48')]]){_0x1fecda['queuesSummary'][_0x2e61fc['name']]={'running':![]};}else if(_0x1fecda[_0x1e35('0x130')][_0x2e61fc[_0x1e35('0x48')]][_0x1e35('0x131')]===!![]){return;}else if(_0x1fecda[_0x1e35('0x130')][_0x2e61fc[_0x1e35('0x48')]][_0x1e35('0x131')]===![]){_0x1fecda['queuesSummary'][_0x2e61fc[_0x1e35('0x48')]][_0x1e35('0x131')]=!![];}var _0x5ce386=_0x1fecda['voiceQueues'][_0x2e61fc[_0x1e35('0x48')]];var _0x4f9826=_0x5ce386[_0x1e35('0x6c')]!==utils[_0x1e35('0x69')][_0x1e35('0x7a')];var _0x1d8711=utils[_0x1e35('0x132')](_0x5ce386);_0x5ce386[_0x1e35('0x133')]=utils[_0x1e35('0x134')](_0x5ce386,_0x1fecda[_0x1e35('0x1f')]);Promise[_0x1e35('0xa8')]()[_0x1e35('0x3f')](function(){if(_0x5ce386[_0x1e35('0x133')]===utils[_0x1e35('0x69')]['INACTIVE']){if(_0x4f9826){clearPredictiveAttributes(_0x5ce386);_0x2e61fc[_0x1e35('0x25')]=undefined;_0x2e61fc[_0x1e35('0x26')]=undefined;}if(_0x5ce386[_0x1e35('0x133')]===utils['CAMPAIGN_STATUS'][_0x1e35('0x7a')]){_0x2e61fc[_0x1e35('0x135')]=0x0;_0x2e61fc['paused']=0x0;_0x2e61fc[_0x1e35('0x136')]=0x0;_0x2e61fc['talking']=0x0;_0x2e61fc['pTalking']=0x0;}}else if(_0x5ce386['statusMessage']===utils['CAMPAIGN_STATUS'][_0x1e35('0x137')]&&!_0x1d8711){return _0x1fecda['ifTime'](_0x5ce386,!![])[_0x1e35('0x3f')](function(){return _0x1fecda[_0x1e35('0x8f')](_0x5ce386,![]);})[_0x1e35('0x3f')](function(){return _0x1fecda['checkDialMethod'](_0x5ce386);})[_0x1e35('0x9d')](function(_0x2919c1){loggerSyncQueueSummary['debug'](_0x1e35('0x138'),util[_0x1e35('0x66')](_0x2919c1,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x5ce386);});}else{clearPredictiveAttributes(_0x5ce386);}})['then'](function(){var _0xb62e2f=_0x2e61fc[_0x1e35('0x139')](_0x5ce386);if(_0xb62e2f||_0x5ce386['queueSummaryCountersUpdated']){_0x5ce386['queueSummaryCountersUpdated']=![];_0x2e61fc[_0x1e35('0x13a')](_0x5ce386);Object[_0x1e35('0x13b')](_0x5ce386,_0x2e61fc);emitOutboundVoiceQueueSummary(_0x2e61fc);}_0x1fecda[_0x1e35('0x130')][_0x5ce386[_0x1e35('0x48')]]['running']=![];})[_0x1e35('0x9d')](function(_0x384d5c){logger[_0x1e35('0x64')](_0x1e35('0x138'),util['inspect'](_0x384d5c,{'showHidden':![],'depth':null}));_0x1fecda[_0x1e35('0x130')][_0x5ce386['name']][_0x1e35('0x131')]=![];});};Dialer[_0x1e35('0x17')]['syncQueueSummaryComplete']=_[_0x1e35('0x13c')](function(){var _0x1e6c36=_[_0x1e35('0x13d')](this['voiceQueues'],function(_0x24152d){return _0x24152d[_0x1e35('0x13e')];});var _0x4ff4ba=_[_0x1e35('0x13d')](this[_0x1e35('0x1e')],function(_0x10c48d){return _0x10c48d[_0x1e35('0x13f')]&&_0x10c48d['status']===_0x1e35('0x88');});if(_0x1e6c36[_0x1e35('0x97')]>0x0&&_0x4ff4ba[_0x1e35('0x97')]>0x0){return Promise[_0x1e35('0xa8')]()['then'](cmHopper[_0x1e35('0x140')](_[_0x1e35('0x141')](_0x1e6c36,'id'),previewRecallmeReminderInterval,_[_0x1e35('0x141')](_0x4ff4ba,'id')))[_0x1e35('0x3f')](function(_0x5600c3){for(var _0x426f6a=0x0;_0x426f6a<_0x5600c3[_0x1e35('0x97')];_0x426f6a++){var _0x31789c=_0x5600c3[_0x426f6a]['Agent']['name'];if(_0x31789c)io['to'](util[_0x1e35('0x46')]('user:%s',_0x31789c))[_0x1e35('0x42')]('user:dialPreviewRecallReminder',{'hopper':_0x5600c3[_0x426f6a]});}})[_0x1e35('0x9d')](function(_0x2694e4){logger[_0x1e35('0x64')]('checkPreviewRecallReminder',_0x2694e4);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x1e35('0x17')][_0x1e35('0x3d')]=function(){var _0x3ce88e=this;setInterval(function(){_0x3ce88e[_0x1e35('0x142')](_0x3ce88e[_0x1e35('0x23')],_0x1e35('0x143'));_0x3ce88e[_0x1e35('0x142')](_0x3ce88e[_0x1e35('0x21')],_0x1e35('0x144'));},0x32c8);};Dialer['prototype'][_0x1e35('0x142')]=function(_0x530c38,_0x2b23df){var _0x4aec17=this;for(var _0x23e669 in _0x530c38){if(typeof _0x530c38[_0x23e669]!=='undefined'){this[_0x1e35('0x1a')][_0x1e35('0x145')](function(){if(!_['isNil'](_0x530c38[_0x23e669])){return ami[_0x1e35('0x146')]({'action':_0x1e35('0x87'),'channel':_0x530c38[_0x23e669][_0x1e35('0xf0')]})['catch'](function(_0x57832c){if(_0x57832c[_0x1e35('0x6c')]===_0x1e35('0x147')){setTimeout(function(){if(_0x530c38[_0x23e669]&&_0x530c38[_0x23e669]['type']!=='ivr'){_0x4aec17['updateOriginated'](_0x4aec17[_0x1e35('0x1c')][_0x530c38[_0x23e669][_0x1e35('0xbe')]]);logger['error'](_0x1e35('0x148'),_0x2b23df,_0x23e669,_0x530c38[_0x23e669]['queue']);delete _0x530c38[_0x23e669];}if(_0x530c38[_0x23e669]&&_0x530c38[_0x23e669]['type']===_0x1e35('0xc0')){_0x4aec17['updateOriginated'](_0x4aec17['campaigns'][_0x530c38[_0x23e669][_0x1e35('0xbe')]]);logger[_0x1e35('0x64')]('[Dialer][checkChannel][ivr]',_0x2b23df,_0x23e669,_0x530c38[_0x23e669][_0x1e35('0xbe')]);delete _0x530c38[_0x23e669];}},0x2328);}});}});}}};Dialer['prototype'][_0x1e35('0x149')]=function(_0x1be317){return Promise['resolve']()[_0x1e35('0x3f')](voiceQueueRt[_0x1e35('0x149')](_0x1be317))['catch'](loggerCatch(_0x1e35('0x14a')));};Dialer[_0x1e35('0x17')][_0x1e35('0xc1')]=function(_0x110479){if(!_['isUndefined'](_0x110479)&&_0x110479!==null){if(typeof _0x110479[_0x1e35('0x7f')]!=='undefined'){if(_0x110479[_0x1e35('0x7f')]>0x0){_0x110479[_0x1e35('0x7f')]-=0x1;}else{logger[_0x1e35('0x64')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x1e35('0x64')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0x1e35('0x14b')]=function(_0x10e283,_0x371d95){var _0x452c75=this;return function(_0x573f50){_0x452c75[_0x1e35('0xc1')](_0x371d95);logger[_0x1e35('0x64')](_0x10e283,util[_0x1e35('0x66')](_0x573f50,{'showHidden':![],'depth':null}));};};Dialer[_0x1e35('0x17')][_0x1e35('0x14c')]=function(_0x38255b,_0x1d2146,_0x384cea){var _0x405f94={'state':0x19,'statedesc':_0x1e35('0x14d')};this['updateOriginated'](_0x1d2146);this[_0x1e35('0x112')](_[_0x1e35('0x61')](_0x405f94,_['pick'](_0x384cea,['ContactId',_0x1e35('0xe0'),'UserId',_0x1e35('0xe1'),_0x1e35('0xe2')])),'[emptyContact][createHistory]',_0x1e35('0x14e'));logger[_0x1e35('0x64')](_0x38255b);};Dialer['prototype'][_0x1e35('0x112')]=function(_0x47ab0f,_0x370883,_0x2500c6){hopperUtils[_0x1e35('0xc8')](_0x47ab0f)[_0x1e35('0x9d')](loggerCatch(_0x370883));hopperUtils[_0x1e35('0xca')](_0x47ab0f)[_0x1e35('0x9d')](loggerCatch(_0x2500c6));};Dialer[_0x1e35('0x17')][_0x1e35('0xdb')]=function(_0x43ad59,_0x25ad58){hopperUtils[_0x1e35('0xc8')](_0x43ad59)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0xc9')));if(_0x25ad58==0x0){hopperUtils[_0x1e35('0xca')](_0x43ad59)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x14f')));}};Dialer[_0x1e35('0x17')][_0x1e35('0x150')]=function(_0x2193dd){return Promise[_0x1e35('0xa8')]()[_0x1e35('0x3f')](cmHopper[_0x1e35('0x140')](_0x2193dd['id'],previewRecallmeReminderInterval))[_0x1e35('0x3f')](function(_0x3dece7){for(var _0x197b36=0x0;_0x197b36<_0x3dece7[_0x1e35('0x97')];_0x197b36++){var _0x24e3d0=_0x3dece7[_0x197b36][_0x1e35('0x151')]['name'];if(_0x24e3d0)io['to'](util[_0x1e35('0x46')](_0x1e35('0x152'),_0x24e3d0))[_0x1e35('0x42')](_0x1e35('0x153'),{'hopper':_0x3dece7[_0x197b36]});}})[_0x1e35('0x9d')](function(){});};Dialer['prototype'][_0x1e35('0xad')]=function(_0x21cc60){var _0x506fc7=this;return function(){_0x506fc7['handleIvr'](_0x21cc60);};};Dialer['prototype'][_0x1e35('0x154')]=function(_0xab5bfe,_0x2307a5){var _0x2c9e9c=this;var _0x489ef0=uuid['v4']();this[_0x1e35('0x21')][_0x489ef0]=new Action(_0xab5bfe,_0x2307a5,_0x489ef0);return new Promise(function(_0x4a00cc,_0x3f91b7){if(_[_0x1e35('0x41')](_0xab5bfe)&&typeof _0xab5bfe!==_0x1e35('0x155')){return _0x3f91b7(msgResponse(_0x1e35('0x156'),_0x1e35('0x90'),_0x1e35('0x157')));}if(_[_0x1e35('0x41')](_0x2307a5[_0x1e35('0x158')])||_0x2307a5[_0x1e35('0x158')]===null){return _0x3f91b7(msgResponse(_0x1e35('0x156'),_0x1e35('0x90'),_0x1e35('0x159')));}var _0xc62e47={'XMD-CALLERID':_0x2c9e9c['actions'][_0x489ef0]['getCaller'](),'XMD-AGI':_0xab5bfe['dialQueueProject']?util[_0x1e35('0x46')]('\x22agi://%s/square,%s\x22',ipAgi,_0xab5bfe[_0x1e35('0x12b')]):'NONE','XMD-AGIAFTER':_0xab5bfe[_0x1e35('0xc7')]?util[_0x1e35('0x46')](_0x1e35('0x15a'),ipAgi,_0xab5bfe[_0x1e35('0xc7')]):'NONE','XMD-QUEUE':utils[_0x1e35('0x15b')](_0xab5bfe)?util[_0x1e35('0x46')](_0x1e35('0x15c'),_0xab5bfe['name'],_0xab5bfe[_0x1e35('0x15d')]||'',_0xab5bfe[_0x1e35('0x15e')]?'c':'',_0xab5bfe['dialQueueTimeout']||0x3):_0x1e35('0x15f'),'XMD-CONTACTID':_0x2307a5['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2c9e9c['actions'][_0x489ef0][_0x1e35('0x160')](),'XMD-AMD':_0xab5bfe[_0x1e35('0x10a')]?_0x1e35('0x137'):_0x1e35('0x15f'),'XMD-DESTINATION':_0x1e35('0x161')};if(_0xab5bfe['dialAMDActive']){_0xc62e47['XMD-AMDINITIALSILENCE']=_0xab5bfe[_0x1e35('0x162')]||0x9c4;_0xc62e47[_0x1e35('0x163')]=_0xab5bfe['dialAMDGreeting']||0x5dc;_0xc62e47[_0x1e35('0x164')]=_0xab5bfe[_0x1e35('0x165')]||0x320;_0xc62e47['XMD-AMDTOTALANALYSISTIME']=_0xab5bfe['dialAMDTotalAnalysisTime']||0x1388;_0xc62e47[_0x1e35('0x166')]=_0xab5bfe[_0x1e35('0x167')]||0x64;_0xc62e47['XMD-AMDBETWEENWORDSSILENCE']=_0xab5bfe['dialAMDBetweenWordsSilence']||0x32;_0xc62e47[_0x1e35('0x168')]=_0xab5bfe[_0x1e35('0x169')]||0x3;_0xc62e47[_0x1e35('0x16a')]=_0xab5bfe[_0x1e35('0x16b')]||0x100;_0xc62e47['XMD-AMDMAXIMUMWORDLENGTH']=_0xab5bfe[_0x1e35('0x16c')]||0x1388;}if(utils[_0x1e35('0x15b')](_0xab5bfe)){_0xc62e47['XMD-VOICEQUEUEID']=_0x2307a5[_0x1e35('0xe1')];}else{_0xc62e47[_0x1e35('0x16d')]=_0x2307a5[_0x1e35('0xe2')];}var _0x5ebc37=utils[_0x1e35('0x16e')](_0x2307a5['Contact']);Object[_0x1e35('0x13b')](_0xc62e47,_0x5ebc37);var _0x2dd86b=_0x2c9e9c[_0x1e35('0x84')](_0xab5bfe[_0x1e35('0x8a')])?utils['getCallerId'](_0xab5bfe[_0x1e35('0x8a')][_0x1e35('0x16f')],_0xab5bfe[_0x1e35('0x170')],_0xab5bfe[_0x1e35('0x171')]>0x0?utils[_0x1e35('0x172')](_0xab5bfe[_0x1e35('0x173')],_0xab5bfe[_0x1e35('0x171')]):_0xab5bfe['dialOriginateCallerIdNumber']):utils[_0x1e35('0x174')](_[_0x1e35('0xf4')](_0xab5bfe[_0x1e35('0x175')])?_0xab5bfe[_0x1e35('0x8a')]['callerid']:_0xab5bfe['TrunkBackup'][_0x1e35('0x16f')],_0xab5bfe[_0x1e35('0x170')],_0xab5bfe[_0x1e35('0x171')]>0x0?utils['getCallerIdRandom'](_0xab5bfe['dialOriginateCallerIdNumber'],_0xab5bfe[_0x1e35('0x171')]):_0xab5bfe[_0x1e35('0x173')]);if(_0x2dd86b){_0xc62e47[_0x1e35('0x176')]=_0x2c9e9c[_0x1e35('0x21')][_0x489ef0][_0x1e35('0x177')]=utils[_0x1e35('0x178')](_0x2dd86b);_0xc62e47[_0x1e35('0x179')]=_0x2307a5[_0x1e35('0x158')];}_0xab5bfe[_0x1e35('0x17a')]=_0xc62e47;return ami[_0x1e35('0x146')]({'actionid':_0x489ef0,'action':'originate','channel':_0x2c9e9c[_0x1e35('0x84')](_0xab5bfe[_0x1e35('0x8a')])?util[_0x1e35('0x46')]('SIP/%s/%s%s',_0xab5bfe[_0x1e35('0x8a')]['name'],isNotNull(_0xab5bfe[_0x1e35('0x17b')])?_0xab5bfe['dialPrefix'][_0x1e35('0x17c')]()||'':'',_0xab5bfe[_0x1e35('0x17d')]>0x0?_0x2307a5[_0x1e35('0x158')][_0x1e35('0x17e')](_0xab5bfe[_0x1e35('0x17d')]):_0x2307a5[_0x1e35('0x158')]):util[_0x1e35('0x46')](_0x1e35('0x17f'),_[_0x1e35('0xf4')](_0xab5bfe[_0x1e35('0x175')])?_0xab5bfe['Trunk'][_0x1e35('0x48')]:_0xab5bfe[_0x1e35('0x175')][_0x1e35('0x48')],isNotNull(_0xab5bfe[_0x1e35('0x17b')])?_0xab5bfe[_0x1e35('0x17b')][_0x1e35('0x17c')]()||'':'',_0xab5bfe['dialCutDigit']>0x0?_0x2307a5[_0x1e35('0x158')][_0x1e35('0x17e')](_0xab5bfe[_0x1e35('0x17d')]):_0x2307a5[_0x1e35('0x158')]),'callerid':_0x2dd86b,'Exten':'xcally-motion-dialer','Context':_0x1e35('0x180'),'Priority':'1','variable':_0xc62e47,'timeout':(_0xab5bfe[_0x1e35('0x181')]||0x1e)*0x3e8,'async':!![],'channelid':_0x489ef0})['then'](function(_0x16e9bb){return _0x4a00cc(_0x16e9bb);})[_0x1e35('0x9d')](function(_0x15f7f2){_0xab5bfe[_0x1e35('0x182')]+=0x1;var _0x1b464e=new History(_0x2c9e9c[_0x1e35('0x21')][_0x489ef0]);logger['error'](util['format']('[originateError]:\x20%s',JSON[_0x1e35('0xa4')](_0x15f7f2)));_0x1b464e['state']=0xe;_0x1b464e[_0x1e35('0x70')]='OriginateError';_0x1b464e[_0x1e35('0x71')]=moment()[_0x1e35('0x46')](_0x1e35('0xc3'));_0x1b464e[_0x1e35('0xe4')]=_0x1b464e['starttime'];hopperUtils[_0x1e35('0xc8')](_0x1b464e)[_0x1e35('0x9d')](loggerCatch('[originate][error]'));_0x2c9e9c[_0x1e35('0xca')](_0x1b464e)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x183')))['finally'](function(){delete _0x2c9e9c['actions'][_0x489ef0];return _0x3f91b7(msgResponse('originate',_0x1e35('0x83'),'originate\x20action\x20Error'));});});});};Dialer['prototype'][_0x1e35('0x184')]=function(_0x59fb54,_0x8c8722,_0x52f6e1){var _0x4cab62=new History(_0x8c8722);if(_0x4cab62['countbusyretry']+_0x4cab62['countcongestionretry']+_0x4cab62[_0x1e35('0x119')]+_0x4cab62[_0x1e35('0x125')]+_0x4cab62[_0x1e35('0xd5')]+_0x4cab62[_0x1e35('0x11a')]+_0x4cab62[_0x1e35('0x115')]+_0x4cab62[_0x1e35('0x11b')]>=_0x52f6e1[_0x1e35('0x126')]-0x1){return!![];}switch(_0x59fb54){case 0x3:if(_0x4cab62[_0x1e35('0x119')]>=_0x52f6e1[_0x1e35('0x185')]-0x1){return!![];}hopperUtils[_0x1e35('0xdc')]({'active':![],'countnoanswerretry':_0x4cab62[_0x1e35('0x119')]+=0x1,'scheduledat':moment()[_0x1e35('0xdd')](_0x52f6e1[_0x1e35('0x186')],_0x1e35('0x120'))[_0x1e35('0x46')](_0x1e35('0xc3')),'ContactId':_0x4cab62['ContactId'],'ListId':_0x4cab62[_0x1e35('0xe0')],'VoiceQueueId':_0x4cab62[_0x1e35('0xe1')]||undefined,'CampaignId':_0x4cab62[_0x1e35('0xe2')]||undefined})['catch'](loggerCatch(_0x1e35('0x187')));break;case 0x5:if(_0x4cab62[_0x1e35('0x118')]>=_0x52f6e1['dialBusyMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x4cab62[_0x1e35('0x118')]+=0x1,'scheduledat':moment()[_0x1e35('0xdd')](_0x52f6e1['dialBusyRetryFrequency'],'minutes')[_0x1e35('0x46')](_0x1e35('0xc3')),'ContactId':_0x4cab62[_0x1e35('0xdf')],'ListId':_0x4cab62[_0x1e35('0xe0')],'VoiceQueueId':_0x4cab62['VoiceQueueId']||undefined,'CampaignId':_0x4cab62[_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x188')));break;case 0x8:if(_0x4cab62[_0x1e35('0x124')]>=_0x52f6e1['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x1e35('0xdc')]({'active':![],'countcongestionretry':_0x4cab62[_0x1e35('0x124')]+=0x1,'scheduledat':moment()[_0x1e35('0xdd')](_0x52f6e1['dialCongestionRetryFrequency'],'minutes')[_0x1e35('0x46')](_0x1e35('0xc3')),'ContactId':_0x4cab62['ContactId'],'ListId':_0x4cab62[_0x1e35('0xe0')],'VoiceQueueId':_0x4cab62[_0x1e35('0xe1')]||undefined,'CampaignId':_0x4cab62[_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x189')));break;case 0x0:if(_0x4cab62[_0x1e35('0x125')]>=_0x52f6e1[_0x1e35('0x18a')]-0x1){return!![];}else{hopperUtils[_0x1e35('0xdc')]({'active':![],'countnosuchnumberretry':_0x4cab62['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x52f6e1[_0x1e35('0x18b')],_0x1e35('0x120'))[_0x1e35('0x46')](_0x1e35('0xc3')),'ContactId':_0x4cab62[_0x1e35('0xdf')],'ListId':_0x4cab62[_0x1e35('0xe0')],'VoiceQueueId':_0x4cab62['VoiceQueueId']||undefined,'CampaignId':_0x4cab62['CampaignId']||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x18c')));}break;case 0xa:if(_0x4cab62['countdropretry']>=_0x52f6e1[_0x1e35('0xda')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x4cab62[_0x1e35('0xd5')]+=0x1,'scheduledat':moment()[_0x1e35('0xdd')](_0x52f6e1['dialDropRetryFrequency'],_0x1e35('0x120'))[_0x1e35('0x46')](_0x1e35('0xc3')),'ContactId':_0x4cab62[_0x1e35('0xdf')],'ListId':_0x4cab62[_0x1e35('0xe0')],'VoiceQueueId':_0x4cab62[_0x1e35('0xe1')]||undefined,'CampaignId':_0x4cab62[_0x1e35('0xe2')]||undefined})['catch'](loggerCatch(_0x1e35('0xe3')));break;case 0xb:if(_0x4cab62[_0x1e35('0x11a')]>=_0x52f6e1[_0x1e35('0xed')]-0x1){return!![];}hopperUtils[_0x1e35('0xdc')]({'active':![],'countabandonedretry':_0x4cab62[_0x1e35('0x11a')]+=0x1,'scheduledat':moment()[_0x1e35('0xdd')](_0x52f6e1[_0x1e35('0xec')],'minutes')[_0x1e35('0x46')](_0x1e35('0xc3')),'ContactId':_0x4cab62[_0x1e35('0xdf')],'ListId':_0x4cab62[_0x1e35('0xe0')],'VoiceQueueId':_0x4cab62[_0x1e35('0xe1')]||undefined,'CampaignId':_0x4cab62['CampaignId']||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0xee')));break;case 0x13:if(_0x4cab62[_0x1e35('0x115')]>=_0x52f6e1[_0x1e35('0x11d')]-0x1){return!![];}hopperUtils[_0x1e35('0xdc')]({'active':![],'countmachineretry':_0x4cab62[_0x1e35('0x115')]+=0x1,'scheduledat':moment()[_0x1e35('0xdd')](_0x52f6e1[_0x1e35('0x11f')],'minutes')['format'](_0x1e35('0xc3')),'ContactId':_0x4cab62['ContactId'],'ListId':_0x4cab62[_0x1e35('0xe0')],'VoiceQueueId':_0x4cab62[_0x1e35('0xe1')]||undefined,'CampaignId':_0x4cab62[_0x1e35('0xe2')]||undefined})['catch'](loggerCatch(_0x1e35('0x121')));break;case 0x14:if(_0x4cab62[_0x1e35('0x11b')]>=_0x52f6e1[_0x1e35('0x18d')]-0x1){return!![];}hopperUtils[_0x1e35('0xdc')]({'active':![],'countagentrejectretry':_0x4cab62[_0x1e35('0x11b')]+=0x1,'scheduledat':moment()['add'](_0x52f6e1[_0x1e35('0x18e')],_0x1e35('0x120'))[_0x1e35('0x46')](_0x1e35('0xc3')),'ContactId':_0x4cab62[_0x1e35('0xdf')],'ListId':_0x4cab62[_0x1e35('0xe0')],'VoiceQueueId':_0x4cab62['VoiceQueueId']||undefined,'CampaignId':_0x4cab62[_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x18f')));break;default:return!![];}};Dialer[_0x1e35('0x17')][_0x1e35('0x106')]=function(_0xc2d882,_0x30306f,_0x1069c7){var _0x352c5e=this;var _0x3833eb=new History(_0xc2d882);var _0x1d938d=![];var _0x29b27a;var _0x8e6091;return new Promise(function(_0xd639ea,_0x419fef){if(_[_0x1e35('0x41')](_0x30306f)&&typeof _0x30306f!=='object'){return _0x419fef(msgResponse(_0x1e35('0x190'),_0x1e35('0x90'),_0x1e35('0x191')));}if(_[_0x1e35('0x41')](_0x1069c7)&&typeof _0x1069c7!=='object'){return _0x419fef(msgResponse(_0x1e35('0x190'),_0x1e35('0x90'),_0x1e35('0x192')));}hopperUtils[_0x1e35('0xd7')](_0x3833eb,_0x1069c7[_0x1e35('0xc5')],_0x30306f)[_0x1e35('0x3f')](function(_0x11bb67){if(_0x11bb67[_0x1e35('0xd9')]==0x1)_0x1d938d=!![];switch(_0x1069c7[_0x1e35('0xc5')]){case'0':_0x30306f[_0x1e35('0x193')]+=0x1;_0x3833eb[_0x1e35('0x6f')]=0x0;_0x3833eb[_0x1e35('0x70')]=_0x1e35('0x194');_0x3833eb[_0x1e35('0x125')]+=0x1;_0x3833eb['countglobal']+=0x1;ami['emit'](_0x1e35('0x195'),ut[_0x1e35('0x111')](_0xc2d882,_0x1e35('0x196')));_0x29b27a=_0x30306f[_0x1e35('0x18b')];_0x8e6091=_0x30306f[_0x1e35('0xd6')];hopperUtils['createHistory'](_0x3833eb)[_0x1e35('0x9d')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x352c5e[_0x1e35('0x184')](0x0,_0xc2d882,_0x30306f)&&!_0x1d938d){if(_0x3833eb[_0x1e35('0x125')]>=_0x30306f[_0x1e35('0x18a')]){_0x352c5e[_0x1e35('0x197')](_0x3833eb,_0xd639ea,_0x419fef,'reason\x200\x20no\x20such\x20number....');}else{_0x352c5e[_0x1e35('0x127')](_0x3833eb,_0xd639ea,_0x419fef,_0x1e35('0x198'));}}break;case'3':_0x30306f[_0x1e35('0x199')]+=0x1;_0x3833eb[_0x1e35('0x6f')]=0x3;_0x3833eb[_0x1e35('0x70')]=_0x1e35('0x19a');_0x3833eb[_0x1e35('0x119')]+=0x1;_0x3833eb[_0x1e35('0xeb')]+=0x1;var _0x117f0f=ut[_0x1e35('0x19b')](_0xc2d882,_0x30306f);ami[_0x1e35('0x42')](_0x1e35('0x19c'),_0x117f0f);_0x29b27a=_0x30306f[_0x1e35('0x186')];_0x8e6091=_0x30306f['callAdditionalPhoneAfterMin'];hopperUtils[_0x1e35('0xc8')](_0x3833eb)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x19d')));if(_0x352c5e[_0x1e35('0x184')](0x3,_0xc2d882,_0x30306f)&&!_0x1d938d){if(_0x3833eb[_0x1e35('0x119')]>=_0x30306f[_0x1e35('0x185')]){_0x352c5e['createStateFinal'](_0x3833eb,_0xd639ea,_0x419fef,_0x1e35('0x19e'));}else{_0x352c5e['stateGlobal'](_0x3833eb,_0xd639ea,_0x419fef,_0x1e35('0x19e'));}}break;case'5':_0x30306f[_0x1e35('0x19f')]+=0x1;_0x3833eb[_0x1e35('0x6f')]=0x5;_0x3833eb[_0x1e35('0x70')]='Busy';_0x3833eb[_0x1e35('0x118')]+=0x1;_0x3833eb[_0x1e35('0xeb')]+=0x1;ami['emit'](_0x1e35('0x1a0'),ut[_0x1e35('0x111')](_0xc2d882,_0x1e35('0x1a1')));_0x29b27a=_0x30306f[_0x1e35('0x1a2')];_0x8e6091=_0x30306f[_0x1e35('0xd6')];hopperUtils[_0x1e35('0xc8')](_0x3833eb)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x1a3')));if(_0x352c5e[_0x1e35('0x184')](0x5,_0xc2d882,_0x30306f)&&!_0x1d938d){if(_0x3833eb['countbusyretry']>=_0x30306f[_0x1e35('0x1a4')]){_0x352c5e[_0x1e35('0x197')](_0x3833eb,_0xd639ea,_0x419fef,_0x1e35('0x1a5'));}else{_0x352c5e[_0x1e35('0x127')](_0x3833eb,_0xd639ea,_0x419fef,_0x1e35('0x1a5'));}}break;case'8':_0x30306f[_0x1e35('0x1a6')]+=0x1;_0x3833eb[_0x1e35('0x6f')]=0x8;_0x3833eb['statedesc']='Congestion';_0x3833eb[_0x1e35('0x124')]+=0x1;_0x3833eb[_0x1e35('0xeb')]+=0x1;_0x29b27a=_0x30306f[_0x1e35('0x1a7')];_0x8e6091=_0x30306f[_0x1e35('0xd6')];ami[_0x1e35('0x42')](_0x1e35('0x1a8'),ut['buildObj'](_0xc2d882,_0x1e35('0x1a9')));hopperUtils[_0x1e35('0xc8')](_0x3833eb)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x1aa')));if(_0x352c5e[_0x1e35('0x184')](0x8,_0xc2d882,_0x30306f)&&!_0x1d938d){if(_0x3833eb[_0x1e35('0x124')]>=_0x30306f[_0x1e35('0x1ab')]){_0x352c5e[_0x1e35('0x197')](_0x3833eb,_0xd639ea,_0x419fef,_0x1e35('0x1ac'));}else{_0x352c5e[_0x1e35('0x127')](_0x3833eb,_0xd639ea,_0x419fef,_0x1e35('0x1ac'));}}break;case'11':_0x30306f['outboundAbandonedCallsDay']+=0x1;_0x3833eb['state']=0xb;_0x3833eb[_0x1e35('0x70')]='Abandoned';_0x3833eb[_0x1e35('0x11a')]+=0x1;_0x3833eb[_0x1e35('0xeb')]+=0x1;_0x29b27a=_0x30306f[_0x1e35('0xec')];_0x8e6091=_0x30306f[_0x1e35('0xd6')];hopperUtils[_0x1e35('0xc8')](_0x3833eb)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x1ad')));if(_0x352c5e[_0x1e35('0x184')](0xb,_0xc2d882,_0x30306f)&&!_0x1d938d){if(_0x3833eb[_0x1e35('0x11a')]>=_0x30306f[_0x1e35('0xed')]){_0x352c5e['createStateFinal'](_0x3833eb,_0xd639ea,_0x419fef,_0x1e35('0x1ae'));}else{_0x352c5e[_0x1e35('0x127')](_0x3833eb,_0xd639ea,_0x419fef,_0x1e35('0x1ae'));}}break;case'20':_0x30306f[_0x1e35('0x1af')]+=0x1;_0x3833eb['state']=0x14;_0x3833eb['statedesc']=_0x1e35('0x1b0');_0x3833eb[_0x1e35('0x11b')]+=0x1;_0x3833eb[_0x1e35('0xeb')]+=0x1;_0x29b27a=_0x30306f[_0x1e35('0x18e')];_0x8e6091=_0x30306f['callAdditionalPhoneAfterMin'];ami[_0x1e35('0x42')](_0x1e35('0x1b1'),ut[_0x1e35('0x111')](_0xc2d882,_0x1e35('0x1b2')));hopperUtils['createHistory'](_0x3833eb)[_0x1e35('0x9d')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x352c5e[_0x1e35('0x184')](0x14,_0xc2d882,_0x30306f)&&!_0x1d938d){if(_0x3833eb[_0x1e35('0x11b')]>=_0x30306f['dialAgentRejectMaxRetry']){_0x352c5e['createStateFinal'](_0x3833eb,_0xd639ea,_0x419fef,'reason\x2020\x20agentreject');}else{_0x352c5e[_0x1e35('0x127')](_0x3833eb,_0xd639ea,_0x419fef,'reason\x2020\x20agentreject');}}break;default:_0x30306f[_0x1e35('0x12f')]+=0x1;_0x3833eb[_0x1e35('0x6f')]=0xc;_0x3833eb[_0x1e35('0x70')]=_0x1069c7['reason'];_0x29b27a=_0x30306f[_0x1e35('0x18e')];_0x8e6091=_0x30306f[_0x1e35('0xd6')];hopperUtils['createHistory'](_0x3833eb)[_0x1e35('0x9d')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x352c5e[_0x1e35('0x184')](_0x1069c7[_0x1e35('0xc5')],_0xc2d882,_0x30306f)&&!_0x1d938d){if(_0x3833eb['countbusyretry']+_0x3833eb[_0x1e35('0x124')]+_0x3833eb[_0x1e35('0x119')]+_0x3833eb['countnosuchnumberretry']+_0x3833eb[_0x1e35('0xd5')]+_0x3833eb['countabandonedretry']+_0x3833eb[_0x1e35('0x115')]+_0x3833eb['countagentrejectretry']>=_0x30306f['dialGlobalMaxRetry']){_0x352c5e[_0x1e35('0x127')](_0x3833eb,_0xd639ea,_0x419fef,_0x1069c7[_0x1e35('0xc5')]);}else{_0x352c5e[_0x1e35('0x197')](_0x3833eb,_0xd639ea,_0x419fef,_0x1069c7['reason']);}}}})['then'](function(){if(_0x1d938d){hopperUtils['swapAdditionalPhones'](_0x3833eb,_0x29b27a,_0x8e6091)[_0x1e35('0x3f')](function(){return _0xd639ea(0x1);});}});});};Dialer[_0x1e35('0x17')][_0x1e35('0x127')]=function(_0xbe7738,_0x4eab3e,_0x5244d9,_0x26eb92){var _0x188cdb=new Final(_0xbe7738);_0x188cdb[_0x1e35('0x6f')]=0xf;_0x188cdb[_0x1e35('0x70')]='Global';this['createStateFinal'](_0x188cdb,_0x4eab3e,_0x5244d9,_0x26eb92);};Dialer[_0x1e35('0x17')][_0x1e35('0x197')]=function(_0x18a9b5,_0x5d67a9,_0x1e5b35,_0x1261fb){hopperUtils['moveContactManagedDialer'](_0x18a9b5)[_0x1e35('0x3f')](function(){return _0x5d67a9(msgResponse(_0x1e35('0x190'),_0x1e35('0x105'),_0x1261fb));})[_0x1e35('0x9d')](function(){return _0x1e5b35(msgResponse('[moveContactManagedDialer][0]',_0x1e35('0x90'),_0x1e35('0x1b3')));});};Dialer['prototype']['predictive']=function(_0x5a45d6){var _0x4b4279=_0x5a45d6[_0x1e35('0x1b4')]/0x64;var _0x315d1a=_0x5a45d6[_0x1e35('0xcf')]/(_0x5a45d6['outboundDropCallsDayTimeout']+_0x5a45d6['outboundAnswerCallsDay']);var _0x2cf5b0=Math[_0x1e35('0x1b5')](_0x5a45d6[_0x1e35('0x1b6')]*(_0x5a45d6[_0x1e35('0x1b7')]/0x64));var _0x13acaf=Math[_0x1e35('0x1b5')](_0x5a45d6[_0x1e35('0x1b6')]*(_0x5a45d6['predictiveIntervalMinThreshold']/0x64));var _0x2de555=_0x5a45d6[_0x1e35('0x135')]+_0x5a45d6[_0x1e35('0x1b8')];var _0x4590aa=Math[_0x1e35('0x1b9')](_0x5a45d6['erlangCalls']*_0x5a45d6['erlangAbandonmentRate']*_0x5a45d6[_0x1e35('0x1ba')]*_0x5a45d6[_0x1e35('0x1bb')]);if(_['isUndefined'](_0x5a45d6[_0x1e35('0x26')])){if(!_[_0x1e35('0x41')](_0x5a45d6['startPredictive'])){_0x5a45d6[_0x1e35('0x25')]=undefined;loggerPredictive[_0x1e35('0x64')]('[startMethodPredictive][StartProgressive]',_0x1e35('0x1bc'));}if(!_[_0x1e35('0x41')](_0x5a45d6[_0x1e35('0x62')])){loggerPredictive['error'](_0x1e35('0x1bd'),_0x1e35('0x1be'));clearInterval(_0x5a45d6['handlePredictive']);_0x5a45d6['handlePredictive']=undefined;}_0x5a45d6[_0x1e35('0x26')]=moment()[_0x1e35('0x46')](_0x1e35('0xc3'));loggerPredictive['info'](_0x5a45d6[_0x1e35('0x48')],_0x1e35('0x1bf'),_0x5a45d6[_0x1e35('0x26')]);this[_0x1e35('0xb2')](_0x5a45d6,0x1);}else if(ifInterval(_0x5a45d6['dialPredictiveInterval'],_0x5a45d6['startProgressive'])){this[_0x1e35('0xb2')](_0x5a45d6,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x5a45d6[_0x1e35('0x26')],_0x5a45d6['name']);_0x5a45d6[_0x1e35('0x5b')]=0x0;_0x5a45d6[_0x1e35('0xd0')]=0x0;}else if(_0x4b4279<_0x315d1a&&_0x5a45d6['dialPredictiveOptimization']===_0x1e35('0x1c0')){clearPredictiveAttributes(_0x5a45d6);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x1c1'),_0x1e35('0x1c2'),_0x315d1a,_0x1e35('0x26'),_0x5a45d6[_0x1e35('0x48')]);}else if(_0x4590aa<_0x5a45d6[_0x1e35('0xd0')]&&_0x5a45d6[_0x1e35('0x1c3')]===_0x1e35('0x1c0')){clearPredictiveAttributes(_0x5a45d6);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x1c4'),'Max\x20Drop\x20',_0x4590aa,_0x1e35('0x1c5'),_0x5a45d6['predictiveIntervalErlangCallsDroppedCalls'],_0x1e35('0x26'),_0x5a45d6[_0x1e35('0x48')]);}else if(!ifInterval(_0x5a45d6['dialPredictiveInterval'],_0x5a45d6[_0x1e35('0x26')])&&_[_0x1e35('0x41')](_0x5a45d6['startPredictive'])&&!_[_0x1e35('0x41')](_0x5a45d6[_0x1e35('0x26')])){_0x5a45d6[_0x1e35('0x25')]=moment()['format'](_0x1e35('0xc3'));loggerPredictive['info'](_0x5a45d6[_0x1e35('0x48')],_0x1e35('0x1c6'),_0x5a45d6[_0x1e35('0x25')]);hopperUtils['avgHandleTime'](_0x5a45d6['dialPredictiveInterval'])[_0x1e35('0x3f')](this[_0x1e35('0x1c7')](_0x5a45d6))[_0x1e35('0x3f')](mergeDataErlangB(_0x5a45d6))['then'](this['startMethodPredictive'](_0x5a45d6))[_0x1e35('0x9d')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x5a45d6));}else if(!ifInterval(_0x5a45d6[_0x1e35('0x1c8')],_0x5a45d6[_0x1e35('0x25')])){_0x5a45d6[_0x1e35('0xd0')]=0x0;_0x5a45d6[_0x1e35('0x25')]=moment()[_0x1e35('0x46')](_0x1e35('0xc3'));loggerPredictive[_0x1e35('0x4b')](_0x5a45d6['name'],_0x1e35('0x1c9'),_0x5a45d6[_0x1e35('0x25')]);clearInterval(_0x5a45d6['handlePredictive']);_0x5a45d6['handlePredictive']=undefined;hopperUtils[_0x1e35('0x1ca')](_0x5a45d6[_0x1e35('0x1c8')])[_0x1e35('0x3f')](this['getDataPredictive'](_0x5a45d6))[_0x1e35('0x3f')](mergeDataErlangB(_0x5a45d6))[_0x1e35('0x3f')](this[_0x1e35('0x1cb')](_0x5a45d6))[_0x1e35('0x9d')](loggerCatchPredictive(_0x1e35('0x1cc'),_0x5a45d6));}else if(_0x5a45d6[_0x1e35('0x1b6')]&&_0x2de555<_0x5a45d6['predictiveIntervalAvailable']-_0x13acaf){clearPredictiveAttributes(_0x5a45d6);loggerPredictive[_0x1e35('0x4b')](_0x5a45d6['name'],_0x1e35('0x1cd'),_0x2de555,_0x1e35('0x1ce'),_0x5a45d6['predictiveIntervalAvailable'],'-',_0x13acaf,'=',_0x5a45d6['predictiveIntervalAvailable']-_0x13acaf,')');}else if(_0x5a45d6[_0x1e35('0x1b6')]&&_0x2de555>_0x5a45d6[_0x1e35('0x1b6')]+_0x2cf5b0){clearPredictiveAttributes(_0x5a45d6);loggerPredictive[_0x1e35('0x4b')](_0x5a45d6[_0x1e35('0x48')],_0x1e35('0x1cd'),_0x2de555,_0x1e35('0x1cf'),_0x5a45d6['predictiveIntervalAvailable'],'+',_0x2cf5b0,'=',_0x5a45d6[_0x1e35('0x1b6')]+_0x2cf5b0,')');}};Dialer[_0x1e35('0x17')]['getDataPredictive']=function(_0x34e9d6){var _0x423d94=this;return function(_0x4cec43){return new Promise(function(_0x4df008,_0x8e3179){_['merge'](_0x34e9d6,_0x4cec43[0x0]);if(checkGetDataPredictive(_0x4cec43[0x0])){var _0x3b535e=_0x34e9d6['predictiveIntervalAvailable']=_0x34e9d6[_0x1e35('0x1b8')]+_0x34e9d6['available'];var _0xf696e9=_0x34e9d6['dialPredictiveInterval']*0x3c;var _0x36197b=_0x4cec43[0x0][_0x1e35('0x53')]+_0x4cec43[0x0][_0x1e35('0x56')];var _0x19ab03=(_0x4cec43[0x0][_0x1e35('0x4f')]+_0x4cec43[0x0][_0x1e35('0x51')]+_0x4cec43[0x0][_0x1e35('0xe9')])/_0x4cec43[0x0][_0x1e35('0x1d0')];_0x34e9d6['predictiveIntervalHitRate']=_0x19ab03>0x0?_0x19ab03:0x1;switch(_0x34e9d6[_0x1e35('0x1c3')]){case _0x1e35('0x1c0'):var _0x25c64d=_0x34e9d6[_0x1e35('0x1b4')]/0x64;return _0x423d94['abandonmentRate'](_0x3b535e,_0xf696e9,_0x36197b,_0x19ab03,_0x25c64d)[_0x1e35('0x3f')](function(_0x12fc82){return _0x4df008(_0x12fc82);});case'agentBusyFactor':var _0x540bb8=_0x34e9d6['dialPredictiveOptimizationPercentage']/0x64;return _0x423d94['busyFactor'](_0x3b535e,_0xf696e9,_0x36197b,_0x19ab03,_0x540bb8)[_0x1e35('0x3f')](function(_0x49d153){return _0x4df008(_0x49d153);});default:return _0x8e3179(msgResponse(_0x1e35('0x1d1'),'Failure',_0x1e35('0x1d2')));}}else{return _0x8e3179(msgResponse(_0x1e35('0x1d1'),_0x1e35('0x90'),'check\x20failure'));}});};};Dialer[_0x1e35('0x17')][_0x1e35('0x1d3')]=function(_0x14be08){var _0x59e1d0=this;return function(_0x4a4f61){return new Promise(function(_0xc5d9de,_0x272704){_[_0x1e35('0x61')](_0x14be08,_0x4a4f61[0x0]);if(checkGetDataPredictive(_0x4a4f61[0x0])){loggerPredictive[_0x1e35('0x4b')](JSON[_0x1e35('0xa4')](_0x4a4f61[0x0]));if(_0x14be08['dialPredictiveOptimization']==='dropRate'){return _0x59e1d0['getVoiceQueueRtPauses'](_0x14be08['id'])[_0x1e35('0x3f')](function(_0x342e9b){var _0x298669=_0x14be08[_0x1e35('0x1d4')]-_0x342e9b[0x0]['outboundQueuePauses'];var _0x2bcc44=_0x14be08[_0x1e35('0x1c8')]*0x3c;var _0x462f50=_0x4a4f61[0x0][_0x1e35('0x53')]+_0x4a4f61[0x0][_0x1e35('0x56')];var _0x1b4a90=(_0x4a4f61[0x0][_0x1e35('0x4f')]+_0x4a4f61[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4a4f61[0x0][_0x1e35('0xe9')])/_0x4a4f61[0x0][_0x1e35('0x1d0')];var _0x16a140=_0x14be08[_0x1e35('0x1b4')]/0x64;_0x14be08[_0x1e35('0x1d5')]=_0x342e9b[0x0][_0x1e35('0x1d6')]||0x0;_0x14be08[_0x1e35('0x1ba')]=_0x1b4a90>0x0?_0x1b4a90:0x1;return _0x59e1d0['abandonmentRate'](_0x298669,_0x2bcc44,_0x462f50,_0x1b4a90,_0x16a140);})[_0x1e35('0x3f')](function(_0x5424a5){return _0xc5d9de(_0x5424a5);})[_0x1e35('0x9d')](function(_0x468ac4){return _0x272704(msgResponse(_0x1e35('0x1d7'),_0x1e35('0x90'),JSON[_0x1e35('0xa4')](_0x468ac4)));});}if(_0x14be08[_0x1e35('0x1c3')]==='agentBusyFactor'){return _0x59e1d0[_0x1e35('0x149')](_0x14be08['id'])[_0x1e35('0x3f')](function(_0x11067c){var _0x4c896b=_0x14be08[_0x1e35('0x1d4')]-_0x11067c[0x0][_0x1e35('0x1d6')];var _0x2d1853=_0x14be08[_0x1e35('0x1c8')]*0x3c;var _0x189371=_0x4a4f61[0x0]['predictiveIntervalAvgTalktime']+_0x4a4f61[0x0][_0x1e35('0x56')];var _0x290f76=(_0x4a4f61[0x0][_0x1e35('0x4f')]+_0x4a4f61[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4a4f61[0x0][_0x1e35('0xe9')])/_0x4a4f61[0x0][_0x1e35('0x1d0')];var _0xd730fd=_0x14be08[_0x1e35('0x1b4')]/0x64;_0x14be08[_0x1e35('0x1d5')]=_0x11067c[0x0]['outboundQueuePauses']||0x0;_0x14be08[_0x1e35('0x1ba')]=_0x290f76>0x0?_0x290f76:0x1;return _0x59e1d0[_0x1e35('0x1d8')](_0x4c896b,_0x2d1853,_0x189371,_0x290f76,_0xd730fd);})[_0x1e35('0x3f')](function(_0x18bcec){return _0xc5d9de(_0x18bcec);})[_0x1e35('0x9d')](function(_0x2a59c4){return _0x272704(msgResponse(_0x1e35('0x1d7'),_0x1e35('0x90'),JSON[_0x1e35('0xa4')](_0x2a59c4)));});}}else{return _0x272704(msgResponse('[getDataPredictive]',_0x1e35('0x90'),_0x1e35('0x1d9')));}});};};Dialer[_0x1e35('0x17')][_0x1e35('0x1cb')]=function(_0x5afbbc){var _0x207df0=this;return function(){var _0x54f1ca=0x0;var _0x3fe2ac=Math[_0x1e35('0x1b9')](_0x5afbbc[_0x1e35('0x5c')]*0x3e8);if(_0x3fe2ac>0x0){_0x3fe2ac=_0x3fe2ac<0x64?0x64:_0x3fe2ac;loggerPredictive['info'](_0x5afbbc['name'],'one\x20call\x20every:',_0x3fe2ac,_0x1e35('0x1da'));_0x5afbbc[_0x1e35('0x62')]=setInterval(function(){_0x207df0['handlePredictive'](_0x5afbbc);loggerPredictiveCalls[_0x1e35('0x4b')](_0x1e35('0x1db'),_0x54f1ca+=0x1);},_0x3fe2ac);}else{loggerPredictive['info'](_0x5afbbc[_0x1e35('0x48')],_0x1e35('0x1dc'));}};};Dialer[_0x1e35('0x17')][_0x1e35('0x1dd')]=function(_0x560f9f,_0x1eeb61){var _0x145bee=this;return function(_0x1b79c5){if(_[_0x1e35('0x4a')](_0x1b79c5)){if(_[_0x1e35('0xf4')](_0x1eeb61['UserId'])||!_0x1eeb61[_0x1e35('0x1de')]){if(_0x560f9f[_0x1e35('0xb0')]===_0x1e35('0x9')){_0x560f9f['queueStatusComplete']=_[_0x1e35('0x41')](_0x560f9f[_0x1e35('0x72')])?!![]:_0x560f9f['queueStatusComplete'];var _0x38a248=uuid['v4']();_0x145bee[_0x1e35('0x21')][_0x38a248]=new Action(_0x560f9f,_0x1eeb61,_0x38a248);loggerBooked[_0x1e35('0x4b')](_0x1e35('0x1df'),_0x38a248,'queueStatusComplete:\x20',JSON['stringify'](_0x560f9f[_0x1e35('0x72')]),_0x1e35('0x1e0'),_0x560f9f[_0x1e35('0x48')]);if(_0x560f9f['queueStatusComplete']){_0x560f9f['queueStatusComplete']=![];_0x145bee[_0x1e35('0x28')][_0x145bee[_0x1e35('0x21')][_0x38a248]['queue']]=[];ami[_0x1e35('0x146')]({'actionid':_0x38a248,'action':_0x1e35('0x1e1'),'queue':_0x560f9f[_0x1e35('0x48')]})['catch'](function(){_0x145bee[_0x1e35('0xc1')](_0x560f9f);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x145bee[_0x1e35('0x21')][_0x38a248][_0x1e35('0xdf')],'ListId':_0x145bee[_0x1e35('0x21')][_0x38a248][_0x1e35('0xe0')],'VoiceQueueId':_0x145bee[_0x1e35('0x21')][_0x38a248]['VoiceQueueId']||undefined,'CampaignId':_0x145bee[_0x1e35('0x21')][_0x38a248][_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x1e2')));delete _0x145bee[_0x1e35('0x21')][_0x38a248];});}else{loggerBooked[_0x1e35('0x4b')]('[booked][checkContactBlack][else]',JSON[_0x1e35('0xa4')](_0x560f9f[_0x1e35('0x72')]),_0x1e35('0x1e0'),_0x560f9f['name']);_0x145bee[_0x1e35('0xc1')](_0x560f9f);hopperUtils[_0x1e35('0xdc')]({'active':![],'ContactId':_0x145bee[_0x1e35('0x21')][_0x38a248]['ContactId'],'ListId':_0x145bee['actions'][_0x38a248]['ListId'],'VoiceQueueId':_0x145bee[_0x1e35('0x21')][_0x38a248][_0x1e35('0xe1')]||undefined,'CampaignId':_0x145bee[_0x1e35('0x21')][_0x38a248]['CampaignId']||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x1e2')));delete _0x145bee[_0x1e35('0x21')][_0x38a248];}}else{return _0x145bee[_0x1e35('0x154')](_0x560f9f,_0x1eeb61);}}else{if(utils[_0x1e35('0xcc')](undefined,_0x1eeb61[_0x1e35('0x1e3')])<_0x560f9f['dialRecallMeTimeout']*0x3c){if(_0x1eeb61[_0x1e35('0x151')]&&!_0x1eeb61[_0x1e35('0x151')]['voicePause']){_0x145bee[_0x1e35('0x1b')]['run'](_0x1eeb61['id'])['finally'](function(){_0x145bee[_0x1e35('0xc1')](_0x560f9f);});}else{hopperUtils[_0x1e35('0x1e4')]({'active':![]},_0x1eeb61['id'],0x1)['finally'](function(){_0x145bee[_0x1e35('0xc1')](_0x560f9f);});}}else{_0x560f9f['outboundReCallsDay']+=0x1;_0x145bee[_0x1e35('0xc1')](_0x560f9f);if(_0x560f9f[_0x1e35('0x1e5')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1eeb61[_0x1e35('0xdf')],'ListId':_0x1eeb61['ListId'],'VoiceQueueId':_0x1eeb61[_0x1e35('0xe1')]||undefined,'CampaignId':_0x1eeb61[_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x1e6')));hopperUtils['createHistory'](createObjHistory(_0x560f9f,_0x1eeb61,utils[_0x1e35('0x69')]['QUEUE_RECALL'],0x17,'RecallInQueue'))[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x1e7')));}else{_0x145bee[_0x1e35('0x112')](createObjHistory(_0x560f9f,_0x1eeb61,utils['CAMPAIGN_STATUS'][_0x1e35('0x1e8')],0x16,_0x1e35('0x1e9')),_0x1e35('0x1ea'),_0x1e35('0x1eb'));}}}}else{_0x560f9f[_0x1e35('0x1ec')]+=0x1;_0x145bee[_0x1e35('0x112')](createObjHistory(_0x560f9f,_0x1eeb61,utils['CAMPAIGN_STATUS'][_0x1e35('0x1ed')],0xd,_0x1e35('0x1ee')),'[Originate][historyBlacklist]',_0x1e35('0x1ef'));throw _0x1e35('0x1f0');}};};Dialer[_0x1e35('0x17')][_0x1e35('0x1f1')]=function(_0x266234){var _0x25b03a=this;var _0x2bd7c9=_0x266234[_0x1e35('0x1f2')]-_0x266234[_0x1e35('0x7f')];emitCampaignSummary(_0x266234);if(_0x2bd7c9>0x0&&_0x266234[_0x1e35('0x1f3')]==0x0){if(_0x2bd7c9>this[_0x1e35('0x1f4')]){_0x2bd7c9=this[_0x1e35('0x1f4')];}_0x266234[_0x1e35('0x1f3')]=0x1;hopperUtils[_0x1e35('0x1f5')](_0x266234,_0x2bd7c9)[_0x1e35('0x3f')](function(_0x216934){_0x266234[_0x1e35('0x1f3')]=0x0;if(_0x216934){if(!utils[_0x1e35('0x1f6')](_0x216934)){_0x266234[_0x1e35('0x6c')]=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger[_0x1e35('0x4b')]('[getContactCampaign2][Empty]'+_0x266234[_0x1e35('0x48')]);}else{_0x266234[_0x1e35('0x7f')]+=_0x216934[_0x1e35('0x97')];_0x266234['message']=utils[_0x1e35('0x69')][_0x1e35('0x1f7')];for(var _0x4f1450=0x0;_0x4f1450<_0x216934['length'];_0x4f1450+=0x1){_0x266234[_0x1e35('0x1f8')]+=0x1;if(_[_0x1e35('0xf4')](_0x216934[_0x4f1450])||_['isNil'](_0x216934[_0x4f1450]['Contact'])||_[_0x1e35('0xf4')](_0x216934[_0x4f1450][_0x1e35('0x158')])){_0x25b03a[_0x1e35('0x14c')]('[actionOriginate]\x20',_0x266234,_0x216934[_0x4f1450]);}else{hopperUtils['checkIsBlackListIvr'](_[_0x1e35('0x75')](_0x216934[_0x4f1450],[_0x1e35('0xe2'),'phone']))[_0x1e35('0x3f')](_0x25b03a[_0x1e35('0x1dd')](_0x266234,_0x216934[_0x4f1450]))[_0x1e35('0x9d')](_0x25b03a[_0x1e35('0x14b')](_0x1e35('0x1f9'),_0x266234));}}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x266234,_0x2bd7c9));}};Dialer[_0x1e35('0x17')][_0x1e35('0xb2')]=function(_0x1cc88e,_0x2dbb88){var _0x1992f1=this;var _0x2c11d5=[];if(_0x2dbb88<0x1||_0x1cc88e['dialMethod']===_0x1e35('0x9')){_0x2dbb88=0x1;}var _0x21de71=Math[_0x1e35('0x1b9')](_0x1cc88e[_0x1e35('0x135')]*_0x2dbb88)-_0x1cc88e['originated'];if(_0x1cc88e[_0x1e35('0x1fa')]>0x0){var _0x2add84=_0x1cc88e[_0x1e35('0x1fa')]-_0x1cc88e[_0x1e35('0x7f')]-_0x1cc88e['talking']-_0x1cc88e[_0x1e35('0x1fb')];if(_0x21de71>_0x2add84){_0x21de71=_0x2add84;}}if(_0x21de71>0x0&&_0x1cc88e[_0x1e35('0x1f3')]==0x0){if(_0x1cc88e['dialMethod']===_0x1e35('0x9')){_0x21de71=0x1;}if(_0x21de71>this['maxNumberOriginate']){_0x21de71=this['maxNumberOriginate'];}for(var _0x4a4bd0 in this[_0x1e35('0x1e')]){if(typeof this[_0x1e35('0x1e')][_0x4a4bd0]!==_0x1e35('0x1fc')){if(this['agents'][_0x4a4bd0][_0x1e35('0x6f')]===_0x1e35('0x1fd')&&this[_0x1e35('0x1e')][_0x4a4bd0][_0x1e35('0x87')]===_0x1e35('0x88')){_0x2c11d5['push'](this[_0x1e35('0x1e')][_0x4a4bd0]['id']);}}}_0x1cc88e[_0x1e35('0x1f3')]=0x1;hopperUtils['getContactDialer'](_0x1cc88e,_0x2c11d5,_0x21de71)['then'](function(_0x29f9fe){_0x1cc88e[_0x1e35('0x1f3')]=0x0;if(_0x29f9fe){if(!utils[_0x1e35('0x1f6')](_0x29f9fe)){hopperUtils[_0x1e35('0x1fe')](_0x1cc88e)[_0x1e35('0x3f')](sendMessageReschedule(_0x1cc88e))['catch'](loggerCatch(_0x1e35('0x1ff')));}else{_0x1cc88e[_0x1e35('0x7f')]+=_0x29f9fe[_0x1e35('0x97')];_0x1cc88e[_0x1e35('0x6c')]=_0x1cc88e[_0x1e35('0xb0')]==='booked'?utils[_0x1e35('0x69')][_0x1e35('0x137')]:utils[_0x1e35('0x69')]['RUNNING'];for(var _0x5be6d8=0x0;_0x5be6d8<_0x29f9fe['length'];_0x5be6d8+=0x1){if(_[_0x1e35('0xf4')](_0x29f9fe[_0x5be6d8])||_[_0x1e35('0xf4')](_0x29f9fe[_0x5be6d8][_0x1e35('0x200')])||_[_0x1e35('0xf4')](_0x29f9fe[_0x5be6d8][_0x1e35('0x158')])){_0x1992f1[_0x1e35('0x14c')](_0x1e35('0x201'),_0x1cc88e,_0x29f9fe[_0x5be6d8]);}else{hopperUtils[_0x1e35('0x202')](_[_0x1e35('0x75')](_0x29f9fe[_0x5be6d8],[_0x1e35('0xe1'),_0x1e35('0x158')]))[_0x1e35('0x3f')](_0x1992f1[_0x1e35('0x1dd')](_0x1cc88e,_0x29f9fe[_0x5be6d8]))[_0x1e35('0x9d')](_0x1992f1['loggerHandler'](_0x1e35('0x201'),_0x1cc88e));}}}}})[_0x1e35('0x9d')](loggerGetContactDialer(_0x1e35('0x203'),_0x1cc88e,_0x21de71));}};Dialer[_0x1e35('0x17')][_0x1e35('0x62')]=function(_0x17d9d3){if(_0x17d9d3['dialLimitQueue']>0x0){var _0x7edfb5=_0x17d9d3['dialLimitQueue']-_0x17d9d3['originated']-_0x17d9d3[_0x1e35('0x1b8')];if(_0x7edfb5>0x0&&_0x17d9d3[_0x1e35('0x1f3')]==0x0){this[_0x1e35('0x204')](_0x17d9d3);}else{loggerPredictiveCalls[_0x1e35('0x4b')](_0x1e35('0x205'));}}else{this['tryOriginatePredictive'](_0x17d9d3);}};Dialer['prototype'][_0x1e35('0x204')]=function(_0x1b61b0){var _0x398ec3=this;var _0x4fe6bb=[];_0x1b61b0[_0x1e35('0x7f')]+=0x1;for(var _0x24cb37 in this['agents']){if(typeof this['agents'][_0x24cb37]!==_0x1e35('0x1fc')){if(this[_0x1e35('0x1e')][_0x24cb37]['state']==='not_inuse'&&this['agents'][_0x24cb37]['status']==='reachable'){_0x4fe6bb[_0x1e35('0x98')](this[_0x1e35('0x1e')][_0x24cb37]['id']);}}}_0x1b61b0[_0x1e35('0x1f3')]=0x1;return this[_0x1e35('0x206')](_0x1b61b0['id'],_0x4fe6bb,0x1,_0x1b61b0['dialOrderByScheduledAt'],_0x1b61b0)['then'](function(_0x5f542a){_0x1b61b0[_0x1e35('0x1f3')]=0x1;if(_0x5f542a){if(!utils[_0x1e35('0x1f6')](_0x5f542a)){utils[_0x1e35('0x67')](_0x1b61b0,0x1,0x0);return hopperUtils[_0x1e35('0x1fe')](_0x1b61b0)[_0x1e35('0x3f')](sendMessageReschedule(_0x1b61b0))[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x1ff')));}else{_0x1b61b0[_0x1e35('0x6c')]=utils[_0x1e35('0x69')]['RUNNING'];if(_['isNil'](_0x5f542a[0x0])||_['isNil'](_0x5f542a[0x0][_0x1e35('0x200')])||_[_0x1e35('0xf4')](_0x5f542a[0x0][_0x1e35('0x158')])){_0x398ec3[_0x1e35('0x14c')](_0x1e35('0x201'),_0x1b61b0,_0x5f542a[0x0]);}else{return hopperUtils['checkIsBlackList'](_['pick'](_0x5f542a[0x0],[_0x1e35('0xe1'),_0x1e35('0x158')]))[_0x1e35('0x3f')](_0x398ec3[_0x1e35('0x1dd')](_0x1b61b0,_0x5f542a[0x0]))[_0x1e35('0x9d')](_0x398ec3['loggerHandler']('[actionOriginatePredictive]\x20',_0x1b61b0));}}}})[_0x1e35('0x9d')](loggerGetContactDialer(_0x1e35('0x207'),_0x1b61b0,0x1));};Dialer[_0x1e35('0x17')]['abandonmentRate']=function(_0x2a10e8,_0x481dfd,_0xa72574,_0x2cef2f,_0x3e5fac,_0x1f0607){loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x208'));loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x209'),_0x2a10e8);loggerPredictive['info'](_0x1e35('0x20a'),_0x481dfd);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x20b'),_0xa72574);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x20c'),_0x2cef2f);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x20d'),_0x3e5fac);loggerPredictive['info'](_0x1e35('0x54'));return new Promise(function(_0x33a83d,_0x35fe16){if(_0x2a10e8<=0x0||isNaN(_0x2a10e8)){return _0x35fe16(msgResponse('[abandonmentRate]','Error',_0x1e35('0x20e')+_0x2a10e8));}if(_0xa72574<=0x0||isNaN(_0xa72574)){return _0x35fe16(msgResponse(_0x1e35('0x20f'),'Error',_0x1e35('0x210')+_0xa72574));}if(_0x2cef2f<=0x0||isNaN(_0x2cef2f)){return _0x35fe16(msgResponse(_0x1e35('0x20f'),_0x1e35('0x83'),'p\x20=\x20'+_0x2cef2f));}if(_0x481dfd<=0x0||isNaN(_0x481dfd)){return _0x35fe16(msgResponse(_0x1e35('0x20f'),_0x1e35('0x83'),_0x1e35('0x211')+_0x481dfd));}if(_0x3e5fac<=0x0||isNaN(_0x3e5fac)){return _0x35fe16(msgResponse(_0x1e35('0x20f'),_0x1e35('0x83'),'Amax\x20=\x20'+_0x3e5fac));}_0x1f0607=_0x1f0607||0x0;var _0x29af51=0x1/_0xa72574;var _0x4864c3=0x0;var _0x5e34a9=0x0;var _0x3c8950=0x0;var _0x5f1621=0x0;for(var _0x1b35f4=0x0;_0x3c8950<_0x3e5fac;_0x1b35f4+=0x1){_0x5e34a9=_0x1b35f4/_0x481dfd;_0x4864c3=(_0x2cef2f*_0x5e34a9+_0x1f0607)/_0x29af51;_0x3c8950=utils[_0x1e35('0x212')](_0x4864c3,_0x2a10e8);_0x5f1621=_0x4864c3/_0x2a10e8*(0x1-utils['erlangb'](_0x4864c3,_0x2a10e8));}return _0x33a83d({'erlangCalls':_0x1b35f4,'erlangCallToSecond':_0x481dfd/_0x1b35f4,'erlangAbandonmentRate':_0x3c8950,'erlangBusyFactor':_0x5f1621});});};Dialer[_0x1e35('0x17')][_0x1e35('0x1d8')]=function(_0x55260b,_0x5bcdda,_0x1682db,_0x711518,_0x306e2b,_0x116e1e){loggerPredictive['info'](_0x1e35('0x213'));loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x209'),_0x55260b);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x20a'),_0x5bcdda);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x20b'),_0x1682db);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x20c'),_0x711518);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x214'),_0x306e2b);loggerPredictive['info'](_0x1e35('0x54'));return new Promise(function(_0x104884,_0x422c2e){if(_0x55260b<=0x0||isNaN(_0x55260b)){return _0x422c2e(msgResponse(_0x1e35('0x215'),_0x1e35('0x83'),'m\x20=\x20'+_0x55260b));}if(_0x1682db<=0x0||isNaN(_0x1682db)){return _0x422c2e(msgResponse(_0x1e35('0x215'),_0x1e35('0x83'),_0x1e35('0x210')+_0x1682db));}if(_0x711518<=0x0||isNaN(_0x711518)){return _0x422c2e(msgResponse(_0x1e35('0x215'),_0x1e35('0x83'),_0x1e35('0x216')+_0x711518));}if(_0x5bcdda<=0x0||isNaN(_0x5bcdda)){return _0x422c2e(msgResponse(_0x1e35('0x215'),'Error',_0x1e35('0x211')+_0x5bcdda));}if(_0x306e2b<=0x0||isNaN(_0x306e2b)){return _0x422c2e(msgResponse('[busyFactor]',_0x1e35('0x83'),_0x1e35('0x217')+_0x306e2b));}_0x116e1e=_0x116e1e||0x0;var _0x4d2af8=0x1/_0x1682db;var _0x1eafd6=0x0;var _0x254d8d=0x0;var _0x2a6241=0x0;var _0x11ee70=0x0;for(var _0x272204=0x0;_0x11ee70<_0x306e2b;_0x272204+=0x1){_0x254d8d=_0x272204/_0x5bcdda;_0x1eafd6=(_0x711518*_0x254d8d+_0x116e1e)/_0x4d2af8;_0x2a6241=utils[_0x1e35('0x212')](_0x1eafd6,_0x55260b);_0x11ee70=_0x1eafd6/_0x55260b*(0x1-utils[_0x1e35('0x212')](_0x1eafd6,_0x55260b));}return _0x104884({'erlangCalls':_0x272204,'erlangCallToSecond':_0x5bcdda/_0x272204,'erlangAbandonmentRate':_0x2a6241,'erlangBusyFactor':_0x11ee70});});};module['exports']=Dialer; \ No newline at end of file +var _0xd328=['predictive','progressive','handlePower','power','dialPowerLevel','booked','Queue','method\x20not\x20recognized','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','OVERTIME_INTERVAL','Global:\x20','silly','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','syncAgentConnect','uniqueid','ivr','queue','YYYY-MM-DD\x20HH:mm:ss','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','moveContactManagedDialer','syncQueueCallerAbandon','updateOriginated','droptime','outboundDropCallsDayTimeout','Drop','TIMEOUT','agiafterat','countdropretry','countglobal','dialDropRetryFrequency','verifyAdditionalPhones','voiceQueue','dialDropMaxRetry','queueCallerAbandonCreateState','additional','minutes','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','state','calleridname','calleridnum','createHistory','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','dropreason','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','rescheduleContact','add','ContactId','[rescheduleContact][Abandoned]','actions','channel','syncQueueMember','actionid','strategy','rrmemory','roundrobin','locked','stateinterface','isNil','pick','paused','syncQueueStatusComplete','preview','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','queueBookedRR','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','responsetime','callProgressDetecting','variable','amdstatus','exten','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','HangupInAMD','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','MACHINE','Machine','membername','countmachineretry','countnoanswerretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','countbusyretry','countcongestionretry','countnosuchnumberretry','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Normal\x20Clearing','[syncAgentComplete][createHistory]','[syncAgentComplete]','outboundUnknownCallsDay','running','isPreviewCampaign','statusMessage','available','inUse','pTalking','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','throttle','filter','dialPreviewRecallmeReminder','online','map','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','enqueue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','handlePreviewRecallNotifications','Agent','handleIvr','actionOriginate','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','assign','getCallerId','callerid','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','xcally-motion-dialer','OriginateError','[originate][error]','originate\x20action\x20Error','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','object','entity\x20is\x20undefine','[callProgressDetecting]','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[syncAgentComplete][createHistory][0]','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','predictiveIntervalErlangCallsDroppedCalls','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalHitRate','dialPredictiveOptimizationPercentage','abandonmentRate','busyFactor','[getDataPredictive]','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','erlangCallToSecond','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','maxNumberOriginate','getContactDialerIvr','checkContactEmpty','RUNNING','ivrTotalCallsDays','checkIsBlackListIvr','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','talking','getContactDialer','countReScheduled','ACTIVE','checkIsBlackList','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[countReScheduled]\x20','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictiveCalls','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','./models/history','./models/final','./models/hangup','env','XCALLY_IP_AGI','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queuesSummary','agentconnect','queuecallerabandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','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','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','getSeconds','debug','startProgressive\x20value\x20cleared','handlePredictive','error','stack','checkContactLowerLimitOriginate','temp','message','contactsRescheduled','CAMPAIGN_STATUS','[getContactDialer2][Empty]','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','Interval','NULL_INTERVAL','Intervals','\x20INTERVAL_IS_NULL','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','[ifTime][Action]','Error','active','status','reachable','SIP/%s','unmonitored','checkIsTrunkReachable','isTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','push','Action','command','iftime\x20%s,%s','interval','true','catch','content','all','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xd328,0x173));var _0x8d32=function(_0x18710a,_0x26d390){_0x18710a=_0x18710a-0x0;var _0x3388e=_0xd328[_0x18710a];return _0x3388e;};'use strict';var util=require(_0x8d32('0x0'));var _=require(_0x8d32('0x1'));var uuid=require(_0x8d32('0x2'));var moment=require(_0x8d32('0x3'));var rr=require('rr');var Redis=require(_0x8d32('0x4'));var utils=require(_0x8d32('0x5'));var hopperUtils=require(_0x8d32('0x6'));var ut=require(_0x8d32('0x7'));var config=require(_0x8d32('0x8'));var logger=require(_0x8d32('0x9'))(_0x8d32('0xa'));var loggerBooked=require(_0x8d32('0x9'))('booked');var loggerPredictive=require(_0x8d32('0x9'))('predictive');var loggerPredictiveCalls=require(_0x8d32('0x9'))(_0x8d32('0xb'));var loggerSyncQueueSummary=require(_0x8d32('0x9'))('syncQueueSummary');var ami=require('../ami');config['redis']=_[_0x8d32('0xc')](config[_0x8d32('0xd')],{'host':_0x8d32('0xe'),'port':0x18eb});var io=require(_0x8d32('0xf'))(new Redis(config[_0x8d32('0xd')]));var cmHopper=require(_0x8d32('0x10'));var voiceQueueRt=require(_0x8d32('0x11'));var RpcSetting=require(_0x8d32('0x12'));var Interval=require('../rpc/interval');var Action=require('./models/action');var History=require(_0x8d32('0x13'));var Final=require(_0x8d32('0x14'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0x8d32('0x15'));var ipAgi=process[_0x8d32('0x16')][_0x8d32('0x17')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x8d32('0x18')]['enqueue']=function(_0x23e86e){this['tail']=this[_0x8d32('0x19')]?this[_0x8d32('0x19')][_0x8d32('0x1a')](_0x23e86e):_0x23e86e();};function Dialer(_0x160282,_0x3efc9f){this[_0x8d32('0x1b')]=new Sequence();this['preview']=_0x3efc9f;this[_0x8d32('0x1c')]=_0x160282[_0x8d32('0x1c')];this['campaigns']=_0x160282[_0x8d32('0x1d')];this[_0x8d32('0x1e')]=_0x160282[_0x8d32('0x1e')];this['trunks']=_0x160282[_0x8d32('0x1f')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this[_0x8d32('0x20')]={};this['actions']={};this[_0x8d32('0x21')]={};this[_0x8d32('0x22')]={};this[_0x8d32('0x23')]={};this[_0x8d32('0x24')]={};this[_0x8d32('0x25')]={};this[_0x8d32('0x26')]={};this[_0x8d32('0x27')]={};this['queueBookedRR']={};this[_0x8d32('0x28')]={};ami['on'](_0x8d32('0x29'),this['syncAgentConnect']['bind'](this));ami['on'](_0x8d32('0x2a'),this['syncQueueCallerAbandon'][_0x8d32('0x2b')](this));ami['on'](_0x8d32('0x2c'),this[_0x8d32('0x2d')][_0x8d32('0x2b')](this));ami['on'](_0x8d32('0x2e'),this[_0x8d32('0x2f')]['bind'](this));ami['on'](_0x8d32('0x30'),this[_0x8d32('0x31')][_0x8d32('0x2b')](this));ami['on'](_0x8d32('0x32'),this[_0x8d32('0x33')]['bind'](this));ami['on'](_0x8d32('0x34'),this['syncHangup']['bind'](this));ami['on'](_0x8d32('0x35'),this[_0x8d32('0x36')][_0x8d32('0x2b')](this));ami['on'](_0x8d32('0x37'),this[_0x8d32('0x38')][_0x8d32('0x2b')](this));ami['on'](_0x8d32('0x39'),this['syncQueueMember'][_0x8d32('0x2b')](this));ami['on'](_0x8d32('0x3a'),this['syncQueueStatusComplete'][_0x8d32('0x2b')](this));this[_0x8d32('0x3b')]();this[_0x8d32('0x3c')]();RpcSetting[_0x8d32('0x3d')]()[_0x8d32('0x3e')](function(_0x38b39a){previewRecallmeReminderInterval=_0x38b39a[_0x8d32('0x3f')];});}function isNotNull(_0x52de2a){return _0x52de2a!==null&&!_[_0x8d32('0x40')](_0x52de2a);}function msgResponse(_0x5a9917,_0x431a73,_0x6208ec){return{'action':_0x5a9917,'response':_0x431a73,'message':_0x6208ec,'stack':_0x6208ec};}function emit(_0x1d4d0a,_0x3a073f,_0xd97f3e){io['to'](_0x1d4d0a)[_0x8d32('0x41')](_0x3a073f,_0xd97f3e);}function emitOutboundVoiceQueueSummary(_0x49cd32){if(_0x49cd32[_0x8d32('0x42')]===_0x8d32('0x43')){logger['debug'](_0x8d32('0x44'),util[_0x8d32('0x45')](_0x49cd32,{'showHidden':![],'depth':null}));emit(util[_0x8d32('0x46')](_0x8d32('0x47'),_0x49cd32[_0x8d32('0x48')]),_0x8d32('0x49'),_0x49cd32);}}function checkGetDataPredictive(_0x33778c){if(isNotNull(_0x33778c)&&!_[_0x8d32('0x4a')](_0x33778c)){loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x4c'));loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x4d'),_0x33778c[_0x8d32('0x4e')]);loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x4f'),_0x33778c[_0x8d32('0x50')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x33778c[_0x8d32('0x51')]);loggerPredictive[_0x8d32('0x4b')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x33778c[_0x8d32('0x52')]);loggerPredictive['info'](_0x8d32('0x53'),_0x33778c[_0x8d32('0x54')]);loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x55'),_0x33778c[_0x8d32('0x56')]);loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x57'));if(_0x33778c[_0x8d32('0x4e')]>0x0){if(!_['isUndefined'](_0x33778c[_0x8d32('0x56')])&&_0x33778c[_0x8d32('0x56')]>0x0){return!![];}loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x58'));if(!_[_0x8d32('0x40')](_0x33778c[_0x8d32('0x54')])&&_0x33778c['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x8d32('0x4b')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x59'));}}else{loggerPredictive[_0x8d32('0x4b')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x49ea52){return function(_0x235bc6){loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x5a'));loggerPredictive[_0x8d32('0x4b')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x235bc6[_0x8d32('0x5b')]);loggerPredictive['info'](_0x8d32('0x5c'),_0x235bc6['erlangCallToSecond']);loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x5d'),_0x235bc6[_0x8d32('0x5e')]);loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x5f'),_0x235bc6[_0x8d32('0x60')]);loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x5d'),_0x235bc6[_0x8d32('0x5e')]);loggerPredictive[_0x8d32('0x4b')]('---------------------------');_[_0x8d32('0x61')](_0x49ea52,_0x235bc6);};}function ifInterval(_0x4e25ed,_0x42744c){if(_['isUndefined'](_0x42744c)){return![];}return utils[_0x8d32('0x62')](undefined,_0x42744c)<_0x4e25ed*0x3c;}function clearPredictiveAttributes(_0xfc7cfa){if(_0xfc7cfa['startProgressive']){_0xfc7cfa['startProgressive']=undefined;loggerPredictive[_0x8d32('0x63')](_0xfc7cfa[_0x8d32('0x48')],_0x8d32('0x64'));}if(_0xfc7cfa[_0x8d32('0x24')]){_0xfc7cfa[_0x8d32('0x24')]=undefined;loggerPredictive['debug'](_0xfc7cfa['name'],'startPredictive\x20value\x20cleared');}if(_0xfc7cfa[_0x8d32('0x65')]){clearInterval(_0xfc7cfa[_0x8d32('0x65')]);_0xfc7cfa['handlePredictive']=undefined;loggerPredictive['debug'](_0xfc7cfa['name'],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x5a7ef6,_0x2eee2b){return function(_0x1a7b69){loggerPredictive[_0x8d32('0x66')](_0x2eee2b[_0x8d32('0x48')],_0x5a7ef6);loggerPredictive['error'](_0x1a7b69[_0x8d32('0x67')]);clearPredictiveAttributes(_0x2eee2b);};}function loggerCatch(_0x4ee054){return function(_0x569f3d){logger[_0x8d32('0x66')](_0x4ee054,util[_0x8d32('0x45')](_0x569f3d,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x4a4954,_0x2672f3,_0x47a7e4){return function(_0x2c0bb4){utils[_0x8d32('0x68')](_0x2672f3,_0x47a7e4,0x0);_0x2672f3[_0x8d32('0x69')]=0x0;logger[_0x8d32('0x66')](_0x4a4954,util['inspect'](_0x2c0bb4,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x80041b){return function(_0xce2e92){if(isNotNull(_0xce2e92)&&isNotNull(_0xce2e92[0x0])){if(_0xce2e92[0x0]['contactsRescheduled']>0x0){_0x80041b[_0x8d32('0x6a')]=utils['CAMPAIGN_STATUS']['CONTACTS_RESCHEDULED'];logger[_0x8d32('0x4b')]('[getContactDialer2][ReScheduled]'+_0x80041b[_0x8d32('0x48')],_0xce2e92[0x0][_0x8d32('0x6b')],'contacts');}else{_0x80041b[_0x8d32('0x6a')]=utils[_0x8d32('0x6c')]['NO_AVAILABLE_CONTACTS'];logger[_0x8d32('0x4b')](_0x8d32('0x6d')+_0x80041b[_0x8d32('0x48')]);}}};}function createObjHistory(_0x172b63,_0x5b2981,_0x3f0c7b,_0x1287f1,_0x4fa96a){_0x172b63[_0x8d32('0x6a')]=_0x3f0c7b;var _0x3fcc3f=new Action(_0x172b63,_0x5b2981);var _0xa9d61e=new History(_0x3fcc3f);_0xa9d61e['state']=_0x1287f1;_0xa9d61e[_0x8d32('0x6e')]=_0x4fa96a;_0xa9d61e[_0x8d32('0x6f')]=_0x3fcc3f[_0x8d32('0x70')];return _0xa9d61e;}function unlockQueueStatus(_0x313782,_0x52fa27){setTimeout(function(){if(_['isUndefined'](_0x313782[_0x8d32('0x71')])){loggerBooked['error'](_0x8d32('0x72'),_0x52fa27);}_0x313782['queueStatusComplete']=!![];loggerBooked[_0x8d32('0x4b')](_0x8d32('0x73'),_0x52fa27,JSON[_0x8d32('0x74')](_['pick'](_0x313782,[_0x8d32('0x48'),_0x8d32('0x71')])));},0x1f3);}function checkInterval(_0x25893d){return function(){if(!isNotNull(_0x25893d[_0x8d32('0x75')])){_0x25893d[_0x8d32('0x6a')]=utils[_0x8d32('0x6c')][_0x8d32('0x76')];throw _0x25893d[_0x8d32('0x48')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x25893d[_0x8d32('0x75')][_0x8d32('0x77')])){_0x25893d['message']=utils[_0x8d32('0x6c')]['NULL_INTERVAL'];throw _0x25893d[_0x8d32('0x48')]+_0x8d32('0x78');}if(!isNotNull(_[_0x8d32('0x4a')](_0x25893d[_0x8d32('0x75')][_0x8d32('0x77')]))){_0x25893d[_0x8d32('0x6a')]=utils[_0x8d32('0x6c')][_0x8d32('0x76')];throw _0x25893d[_0x8d32('0x48')]+_0x8d32('0x78');}};}function checkIsIVRCampaignActive(_0x5801ca){return function(){if(!utils[_0x8d32('0x79')](_0x5801ca)){_0x5801ca[_0x8d32('0x6a')]=utils['CAMPAIGN_STATUS'][_0x8d32('0x7a')];throw _0x5801ca[_0x8d32('0x48')]+_0x8d32('0x7b');}};}function emitCampaignSummary(_0x3bc385){if(utils[_0x8d32('0x7c')](_0x3bc385)){emit(util['format']('campaign:ivr:%s',_0x3bc385[_0x8d32('0x48')]),_0x8d32('0x7d'),_0x3bc385);}}function loggerCatchQueueSummary(_0x1bef83,_0x5396fe){return function(_0x5af2b5){clearPredictiveAttributes(_0x5396fe);emitCampaignSummary(_0x5396fe);loggerSyncQueueSummary['debug'](_0x1bef83,util[_0x8d32('0x45')](_0x5af2b5,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x3a8003){if(_0x3a8003[_0x8d32('0x7e')]){if(_0x3a8003[_0x8d32('0x7f')]===0x0){_0x3a8003[_0x8d32('0x7e')]=![];_0x3a8003['message']=utils[_0x8d32('0x6c')][_0x8d32('0x7a')];loggerSyncQueueSummary['debug'](_0x8d32('0x80'),_0x3a8003[_0x8d32('0x48')],_0x8d32('0x81'));}else{_0x3a8003[_0x8d32('0x6a')]=utils[_0x8d32('0x6c')]['DISACTIVED'];loggerSyncQueueSummary[_0x8d32('0x63')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3a8003[_0x8d32('0x48')],'is\x20disactive');}emitCampaignSummary(_0x3a8003);}}function myreject(_0x2f003d){return function(_0x394147){return _0x2f003d(msgResponse(_0x8d32('0x82'),_0x8d32('0x83'),JSON['stringify'](_0x394147)));};}Dialer[_0x8d32('0x18')]['isTrunkReachable']=function(_0x4fe5b1){return!_[_0x8d32('0x40')](_0x4fe5b1)&&_0x4fe5b1&&!_[_0x8d32('0x40')](_0x4fe5b1[_0x8d32('0x48')])&&!_[_0x8d32('0x40')](_0x4fe5b1['active'])&&_0x4fe5b1[_0x8d32('0x84')]&&(this[_0x8d32('0x1f')][util[_0x8d32('0x46')]('SIP/%s',_0x4fe5b1[_0x8d32('0x48')])][_0x8d32('0x85')]===_0x8d32('0x86')||this[_0x8d32('0x1f')][util['format'](_0x8d32('0x87'),_0x4fe5b1['name'])][_0x8d32('0x85')]===_0x8d32('0x88'));};Dialer[_0x8d32('0x18')][_0x8d32('0x89')]=function(_0x2edac8){var _0x737d64=this;return function(){if(!_0x737d64[_0x8d32('0x8a')](_0x2edac8[_0x8d32('0x8b')])){if(!_0x737d64[_0x8d32('0x8a')](_0x2edac8[_0x8d32('0x8c')])){_0x2edac8[_0x8d32('0x6a')]=utils[_0x8d32('0x6c')][_0x8d32('0x8d')];throw _0x2edac8['name']+_0x8d32('0x8e');}}};};Dialer[_0x8d32('0x18')][_0x8d32('0x8f')]=function(_0x13b2c4,_0x119284,_0x3d19f6,_0x3486ea){var _0x25499a=this;return function(){var _0x1eb14d=!![];return _0x25499a['ifTimeIvr'](_0x13b2c4,_0x119284,_0x3d19f6,_0x3486ea,_0x1eb14d);};};Dialer[_0x8d32('0x18')]['checkIfTimeIntervals']=function(_0x189950,_0x2923a3,_0x35ce24,_0xbad73d){var _0x24d5a8=this;return function(){var _0x19e849=![];return _0x24d5a8['ifTimeIvr'](_0x189950[_0x8d32('0x77')],_0x2923a3,_0x35ce24,_0xbad73d,_0x19e849);};};Dialer[_0x8d32('0x18')][_0x8d32('0x90')]=function(_0x33b0c9,_0x43ac53,_0x48797e,_0x41eb2e,_0x181488){var _0xe499bd=[];return new Promise(function(_0x1fbd3b,_0x3c14ff){if(!isNotNull(_0x33b0c9)){_0x41eb2e[_0x8d32('0x6a')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];return _0x3c14ff(msgResponse(_0x8d32('0x91'),_0x8d32('0x92'),_0x48797e+_0x8d32('0x93')));}if(_[_0x8d32('0x4a')](_0x33b0c9)){_0x41eb2e['message']=utils['CAMPAIGN_STATUS'][_0x8d32('0x94')];return _0x3c14ff(msgResponse(_0x8d32('0x91'),_0x8d32('0x92'),_0x48797e+_0x8d32('0x95')));}if(_0x43ac53&&_[_0x8d32('0x40')](config[_0x8d32('0x96')][_0x43ac53])){_0x41eb2e['message']=utils['CAMPAIGN_STATUS'][_0x8d32('0x97')];return _0x3c14ff(msgResponse('ifTime',_0x8d32('0x92'),_0x48797e+_0x8d32('0x98')+_0x43ac53));}if(_[_0x8d32('0x99')](_0x33b0c9)){for(var _0x421585=0x0;_0x421585<_0x33b0c9['length'];_0x421585+=0x1){_0xe499bd[_0x8d32('0x9a')](ami[_0x8d32('0x9b')]({'action':_0x8d32('0x9c'),'command':util['format'](_0x8d32('0x9d'),_0x33b0c9[_0x421585][_0x8d32('0x9e')],!_[_0x8d32('0x40')](config[_0x8d32('0x96')][_0x43ac53])?_0x43ac53:'')})['then'](function(_0x2700f5){return _0x2700f5['content']['indexOf'](_0x8d32('0x9f'))>=0x0;})[_0x8d32('0xa0')](myreject(_0x3c14ff)));}}else{_0xe499bd[_0x8d32('0x9a')](ami[_0x8d32('0x9b')]({'action':_0x8d32('0x9c'),'command':util[_0x8d32('0x46')]('iftime\x20%s,%s',_0x33b0c9,!_[_0x8d32('0x40')](config['timezones'][_0x43ac53])?_0x43ac53:'')})['then'](function(_0xe06c18){return _0xe06c18[_0x8d32('0xa1')]['indexOf'](_0x8d32('0x9f'))>=0x0;})[_0x8d32('0xa0')](myreject(_0x3c14ff)));}Promise[_0x8d32('0xa2')](_0xe499bd)[_0x8d32('0x3e')](function(_0x3c4980){var _0x47c62=_['some'](_0x3c4980);if(_0x47c62){return _0x1fbd3b(_0x47c62);}else{_0x41eb2e[_0x8d32('0x6a')]=_0x181488?utils[_0x8d32('0x6c')]['OVERTIME_GLOBAL_INTERVAL']:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];return _0x3c14ff(msgResponse(_0x8d32('0xa3'),_0x8d32('0x92'),'Global:\x20'+_0x181488+'\x20'+_0x48797e+_0x8d32('0xa4')+util['inspect'](_0x33b0c9,{'showHidden':![],'depth':null})+_0x8d32('0xa5')+_0x43ac53));}})[_0x8d32('0xa0')](function(_0x32b52f){return _0x3c14ff(msgResponse(_0x8d32('0x91'),'Failure',JSON[_0x8d32('0x74')](_0x32b52f)));});});};Dialer['prototype'][_0x8d32('0x3b')]=function(){var _0x511675=this;return cmHopper[_0x8d32('0xa6')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x511675[_0x8d32('0xa7')]();},0x3e8);});};Dialer['prototype'][_0x8d32('0xa7')]=function(){var _0x2d2ea5=this;var _0x4e0769;for(var _0x406c96 in this[_0x8d32('0x1d')]){if(typeof this[_0x8d32('0x1d')][_0x406c96]!==_0x8d32('0xa8')){_0x4e0769=this[_0x8d32('0x1d')][_0x406c96];if(utils[_0x8d32('0x7c')](_0x4e0769)&&utils['isIVRCampaignActive'](_0x4e0769)){_0x4e0769['sendMessageOneNotActive']=!![];Promise[_0x8d32('0xa9')]()[_0x8d32('0x3e')](checkIsIVRCampaignActive(_0x4e0769))[_0x8d32('0x3e')](checkInterval(_0x4e0769))[_0x8d32('0x3e')](_0x2d2ea5[_0x8d32('0x89')](_0x4e0769))[_0x8d32('0x3e')](_0x2d2ea5[_0x8d32('0x8f')](_0x4e0769[_0x8d32('0xaa')],_0x4e0769[_0x8d32('0xab')],_0x4e0769[_0x8d32('0x48')],_0x4e0769))['then'](_0x2d2ea5[_0x8d32('0xac')](_0x4e0769[_0x8d32('0x75')],_0x4e0769['dialTimezone'],_0x4e0769[_0x8d32('0x48')],_0x4e0769))['then'](_0x2d2ea5[_0x8d32('0xad')](_0x4e0769))[_0x8d32('0xa0')](loggerCatchQueueSummary(_0x8d32('0xae'),_0x4e0769));}else{notSendMessagesCampaign(_0x4e0769);}}}};Dialer[_0x8d32('0x18')][_0x8d32('0xaf')]=function(_0x353748){if(_0x353748[_0x8d32('0xb0')]!==_0x8d32('0xb1')){clearPredictiveAttributes(_0x353748);}switch(_0x353748['dialMethod']){case _0x8d32('0xb2'):this[_0x8d32('0xb3')](_0x353748,0x1);break;case _0x8d32('0xb4'):this[_0x8d32('0xb3')](_0x353748,_0x353748[_0x8d32('0xb5')]);break;case _0x8d32('0xb1'):this[_0x8d32('0xb1')](_0x353748);break;case _0x8d32('0xb6'):this[_0x8d32('0xb3')](_0x353748,0x1);break;default:logger['error'](_0x8d32('0xb7'),_0x353748[_0x8d32('0x48')],_0x8d32('0xb8'));}};Dialer[_0x8d32('0x18')][_0x8d32('0x91')]=function(_0x1eb083,_0x11c98b){var _0x3b3eef=_0x1eb083['dialTimezone'];var _0xe29a05=_0x11c98b?_0x1eb083[_0x8d32('0xaa')]:_0x1eb083[_0x8d32('0x75')]['Intervals'];logger['silly'](_0x8d32('0xb9'),_0xe29a05,_0x3b3eef,_0x1eb083[_0x8d32('0x48')],util[_0x8d32('0x46')](_0x8d32('0xba'),_0x1eb083[_0x8d32('0x48')],_0x1eb083['id']));var _0x358057=null;return Interval['intervalIftime'](_0xe29a05,_0x3b3eef)[_0x8d32('0x3e')](function(_0x382b46){if(_0x382b46===!![]){return _0x382b46;}else{_0x1eb083[_0x8d32('0x6a')]=_0x11c98b?utils[_0x8d32('0x6c')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x8d32('0x6c')][_0x8d32('0xbb')];_0x358057=msgResponse('[ifTime][promiseAll]',_0x8d32('0x92'),_0x8d32('0xbc')+_0x11c98b+'\x20'+_0x1eb083[_0x8d32('0x48')]+'\x20Interval\x20is\x20overtime:\x20'+util[_0x8d32('0x45')](_0xe29a05,{'showHidden':![],'depth':null})+_0x8d32('0xa5')+_0x3b3eef);}if(_0x358057!==null){logger[_0x8d32('0xbd')](_0x8d32('0xbe'),_0x358057);_0x358057[_0x8d32('0xbf')]=_0x11c98b;throw _0x358057;}})[_0x8d32('0xa0')](function(_0x15d3ad){logger[_0x8d32('0x66')](_0x8d32('0xc0'),_0x15d3ad);throw msgResponse(_0x8d32('0x82'),_0x8d32('0x83'),util[_0x8d32('0x45')](_0x15d3ad,{'showHidden':![],'depth':null}));});};Dialer[_0x8d32('0x18')][_0x8d32('0xc1')]=function(_0x3b398a){if(this[_0x8d32('0x1c')][_0x3b398a['queue']]){if(this[_0x8d32('0x22')][_0x3b398a[_0x8d32('0xc2')]]&&this[_0x8d32('0x22')][_0x3b398a[_0x8d32('0xc2')]][_0x8d32('0x42')]!==_0x8d32('0xc3')){this['updateOriginated'](this['voiceQueues'][_0x3b398a[_0x8d32('0xc4')]]);this[_0x8d32('0x22')][_0x3b398a[_0x8d32('0xc2')]]['answertime']=moment()[_0x8d32('0x46')](_0x8d32('0xc5'));}}};Dialer[_0x8d32('0x18')]['syncAgentComplete']=function(_0x2e17a8){var _0xc14bbd=this[_0x8d32('0x22')][_0x2e17a8[_0x8d32('0xc2')]];if(this[_0x8d32('0x1c')][_0x2e17a8[_0x8d32('0xc4')]]){if(_0xc14bbd&&_0xc14bbd['type']!==_0x8d32('0xc3')){delete this['uniqueId'][_0x2e17a8[_0x8d32('0xc2')]];this['voiceQueues'][_0x2e17a8[_0x8d32('0xc4')]]['outboundAnswerCallsDay']+=0x1;var _0x39e157=new AgentComplete(_0xc14bbd,_0x2e17a8);if(_0x2e17a8[_0x8d32('0xc6')]===_0x8d32('0xc7')){_0x39e157['agiafterat']=this[_0x8d32('0x1c')][_0x2e17a8[_0x8d32('0xc4')]][_0x8d32('0xc8')]&&this[_0x8d32('0x1c')][_0x2e17a8[_0x8d32('0xc4')]][_0x8d32('0xc9')]?moment()[_0x8d32('0x46')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils['createHistory'](_0x39e157)[_0x8d32('0xa0')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x8d32('0xca')](_0x39e157)[_0x8d32('0xa0')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype'][_0x8d32('0xcb')]=function(_0x5a9623){var _0x101403=this[_0x8d32('0x22')][_0x5a9623[_0x8d32('0xc2')]];var _0x410530=this;var _0x46d296=![];var _0x4adf87;var _0xe8f060;if(this[_0x8d32('0x1c')][_0x5a9623[_0x8d32('0xc4')]]){if(_0x101403&&_0x101403['type']!==_0x8d32('0xc3')){delete this['uniqueId'][_0x5a9623[_0x8d32('0xc2')]];this[_0x8d32('0xcc')](this['voiceQueues'][_0x5a9623[_0x8d32('0xc4')]]);_0x101403['droptime']=moment()[_0x8d32('0x46')](_0x8d32('0xc5'));var _0x26fbba=new QueueCallerAbandon(_0x101403,_0x5a9623);if(utils[_0x8d32('0x62')](_0x101403[_0x8d32('0xcd')],_0x101403['responsetime'])>=_0x101403['dialQueueTimeout']){this[_0x8d32('0x1c')][_0x5a9623['queue']][_0x8d32('0x51')]+=0x1;this[_0x8d32('0x1c')][_0x5a9623[_0x8d32('0xc4')]][_0x8d32('0xce')]+=0x1;this[_0x8d32('0x1c')][_0x5a9623[_0x8d32('0xc4')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x26fbba['state']=0xa;_0x26fbba[_0x8d32('0x6e')]=_0x8d32('0xcf');_0x26fbba['dropreason']=_0x8d32('0xd0');_0x26fbba[_0x8d32('0xd1')]=this[_0x8d32('0x1c')][_0x5a9623[_0x8d32('0xc4')]]['dialQueueProject2']?moment()['format'](_0x8d32('0xc5')):undefined;_0x26fbba[_0x8d32('0xd2')]+=0x1;_0x26fbba[_0x8d32('0xd3')]+=0x1;_0x4adf87=this['voiceQueues'][_0x5a9623[_0x8d32('0xc4')]][_0x8d32('0xd4')];_0xe8f060=this[_0x8d32('0x1c')][_0x5a9623['queue']]['callAdditionalPhoneAfterMin'];hopperUtils[_0x8d32('0xd5')](_0x26fbba,_0x26fbba['state'],_0x101403[_0x8d32('0xd6')])[_0x8d32('0x3e')](function(_0x1bb985){_0x46d296=_0x1bb985['additional']==0x1;if(_0x26fbba[_0x8d32('0xd2')]>=_0x410530[_0x8d32('0x1c')][_0x5a9623[_0x8d32('0xc4')]][_0x8d32('0xd7')]){_0x410530[_0x8d32('0xd8')](_0x26fbba,_0x1bb985[_0x8d32('0xd9')]);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x26fbba[_0x8d32('0xd2')],'scheduledat':moment()['add'](_0x410530[_0x8d32('0x1c')][_0x5a9623[_0x8d32('0xc4')]]['dialDropRetryFrequency'],_0x8d32('0xda'))[_0x8d32('0x46')](_0x8d32('0xc5')),'ContactId':_0x101403['ContactId'],'ListId':_0x101403[_0x8d32('0xdb')],'VoiceQueueId':_0x101403[_0x8d32('0xdc')]||undefined,'CampaignId':_0x101403[_0x8d32('0xdd')]||undefined})[_0x8d32('0xa0')](loggerCatch(_0x8d32('0xde')));var _0x28c2bd=new History(_0x26fbba);_0x28c2bd[_0x8d32('0xdf')]=0xa;_0x28c2bd[_0x8d32('0x6e')]=_0x8d32('0xcf');_0x28c2bd[_0x8d32('0x70')]=moment()[_0x8d32('0x46')](_0x8d32('0xc5'));_0x28c2bd[_0x8d32('0x6f')]=_0x28c2bd[_0x8d32('0x70')];_0x28c2bd[_0x8d32('0xe0')]=_0x26fbba[_0x8d32('0xe0')];_0x28c2bd['calleridnum']=_0x26fbba[_0x8d32('0xe1')];hopperUtils[_0x8d32('0xe2')](_0x28c2bd)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}})['then'](function(){if(_0x46d296)hopperUtils[_0x8d32('0xe3')](_0x26fbba,_0x4adf87,_0xe8f060)[_0x8d32('0x3e')](function(){return 0x1;});});}else{this[_0x8d32('0x1c')][_0x5a9623['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x8d32('0x1c')][_0x5a9623['queue']][_0x8d32('0xe4')]+=0x1;_0x26fbba['state']=0xb;_0x26fbba[_0x8d32('0x6e')]=_0x8d32('0xe5');_0x26fbba[_0x8d32('0xe6')]=_0x8d32('0xe7');_0x26fbba[_0x8d32('0xe8')]+=0x1;_0x26fbba[_0x8d32('0xd3')]+=0x1;_0x4adf87=this[_0x8d32('0x1c')][_0x5a9623['queue']][_0x8d32('0xe9')];_0xe8f060=this[_0x8d32('0x1c')][_0x5a9623[_0x8d32('0xc4')]][_0x8d32('0xea')];hopperUtils[_0x8d32('0xd5')](_0x26fbba,_0x26fbba['state'],_0x101403['voiceQueue'])[_0x8d32('0x3e')](function(_0x5684e0){if(_0x26fbba['countabandonedretry']>=_0x410530[_0x8d32('0x1c')][_0x5a9623[_0x8d32('0xc4')]][_0x8d32('0xeb')]){_0x410530[_0x8d32('0xd8')](_0x26fbba,_0x5684e0[_0x8d32('0xd9')]);}else{hopperUtils[_0x8d32('0xec')]({'active':![],'countabandonedretry':_0x26fbba[_0x8d32('0xe8')],'scheduledat':moment()[_0x8d32('0xed')](_0x410530[_0x8d32('0x1c')][_0x5a9623[_0x8d32('0xc4')]][_0x8d32('0xe9')],_0x8d32('0xda'))[_0x8d32('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x101403[_0x8d32('0xee')],'ListId':_0x101403['ListId'],'VoiceQueueId':_0x101403[_0x8d32('0xdc')]||undefined,'CampaignId':_0x101403[_0x8d32('0xdd')]||undefined})[_0x8d32('0xa0')](loggerCatch(_0x8d32('0xef')));var _0x5cb79b=new History(_0x26fbba);_0x5cb79b['state']=0xb;_0x5cb79b[_0x8d32('0x6e')]=_0x8d32('0xe5');_0x5cb79b[_0x8d32('0x70')]=moment()[_0x8d32('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x5cb79b[_0x8d32('0x6f')]=_0x5cb79b[_0x8d32('0x70')];_0x5cb79b[_0x8d32('0xe0')]=_0x26fbba[_0x8d32('0xe0')];_0x5cb79b[_0x8d32('0xe1')]=_0x26fbba[_0x8d32('0xe1')];hopperUtils[_0x8d32('0xe2')](_0x5cb79b)[_0x8d32('0xa0')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x8d32('0x3e')](function(){if(_0x46d296)hopperUtils[_0x8d32('0xe3')](_0x26fbba,_0x4adf87,_0xe8f060)[_0x8d32('0x3e')](function(){return 0x1;});});}}}};Dialer[_0x8d32('0x18')]['syncNewExten']=function(_0x5d89c7){if(this[_0x8d32('0xf0')][_0x5d89c7[_0x8d32('0xc2')]]){this[_0x8d32('0xf0')][_0x5d89c7[_0x8d32('0xc2')]][_0x8d32('0xf1')]=_0x5d89c7['channel'];}if(this['uniqueId'][_0x5d89c7['uniqueid']]){this[_0x8d32('0x22')][_0x5d89c7[_0x8d32('0xc2')]][_0x8d32('0xf1')]=_0x5d89c7['channel'];}};Dialer['prototype'][_0x8d32('0xf2')]=function(_0x30a232){if(!this[_0x8d32('0xf0')][_0x30a232[_0x8d32('0xf3')]]){return;}var _0x37d071=this[_0x8d32('0x1c')][this[_0x8d32('0xf0')][_0x30a232[_0x8d32('0xf3')]]['queue']][_0x8d32('0xf4')]||_0x8d32('0xf5');if(_0x37d071===_0x8d32('0xf6')){if(this[_0x8d32('0xf0')][_0x30a232[_0x8d32('0xf3')]]&&_['isNil'](this[_0x8d32('0xf0')][_0x30a232['actionid']][_0x8d32('0xf7')])&&_0x30a232[_0x8d32('0x85')]==='1'&&_0x30a232['paused']==='0'){if(this[_0x8d32('0x1e')][_0x30a232[_0x8d32('0xf8')]]){if(!this[_0x8d32('0x1e')][_0x30a232[_0x8d32('0xf8')]][_0x8d32('0xf7')]){this[_0x8d32('0x1e')][_0x30a232['stateinterface']][_0x8d32('0xf7')]=!![];this[_0x8d32('0xf0')][_0x30a232[_0x8d32('0xf3')]][_0x8d32('0xf7')]=!![];this[_0x8d32('0xf0')][_0x30a232['actionid']][_0x8d32('0xf8')]=_0x30a232['stateinterface'];}}}}else if(_0x37d071==='rrmemory'){if(this['actions'][_0x30a232[_0x8d32('0xf3')]]){if(this['agents'][_0x30a232[_0x8d32('0xf8')]]){this[_0x8d32('0xf0')][_0x30a232[_0x8d32('0xf3')]]['stateinterface']=_0x30a232['stateinterface'];if(_[_0x8d32('0xf9')](this[_0x8d32('0x27')][this[_0x8d32('0xf0')][_0x30a232[_0x8d32('0xf3')]][_0x8d32('0xc4')]])){this[_0x8d32('0x27')][this[_0x8d32('0xf0')][_0x30a232['actionid']][_0x8d32('0xc4')]]=[];}this[_0x8d32('0x27')][this[_0x8d32('0xf0')][_0x30a232['actionid']]['queue']]['push'](_['merge'](_[_0x8d32('0xfa')](this[_0x8d32('0xf0')][_0x30a232[_0x8d32('0xf3')]],['idHopper',_0x8d32('0xf8')]),{'status':_0x30a232[_0x8d32('0x85')],'paused':_0x30a232[_0x8d32('0xfb')]}));}}}};Dialer[_0x8d32('0x18')][_0x8d32('0xfc')]=function(_0x27b453){if(!this[_0x8d32('0xf0')][_0x27b453['actionid']]){return;}var _0x1b3842=this;var _0x295d14=this[_0x8d32('0x1c')][this[_0x8d32('0xf0')][_0x27b453['actionid']][_0x8d32('0xc4')]];var _0x2c3264=_0x295d14['strategy']||_0x8d32('0xf5');if(_0x2c3264===_0x8d32('0xf6')){if(this['actions'][_0x27b453[_0x8d32('0xf3')]]&&this['actions'][_0x27b453[_0x8d32('0xf3')]][_0x8d32('0xf8')]){this[_0x8d32('0xfd')][_0x8d32('0xfe')](this[_0x8d32('0xf0')][_0x27b453[_0x8d32('0xf3')]][_0x8d32('0xff')],this[_0x8d32('0xf0')][_0x27b453[_0x8d32('0xf3')]][_0x8d32('0xf8')])[_0x8d32('0xa0')](function(_0x456b7d){logger[_0x8d32('0x66')](_0x8d32('0x100'),util[_0x8d32('0x45')](_0x456b7d,{'showHidden':![],'depth':null}));})[_0x8d32('0x1a')](function(){_0x1b3842[_0x8d32('0xcc')](_0x1b3842[_0x8d32('0x1c')][_0x1b3842[_0x8d32('0xf0')][_0x27b453[_0x8d32('0xf3')]][_0x8d32('0xc4')]]);_0x1b3842['agents'][_0x1b3842[_0x8d32('0xf0')][_0x27b453[_0x8d32('0xf3')]][_0x8d32('0xf8')]]['locked']=![];delete _0x1b3842[_0x8d32('0xf0')][_0x27b453[_0x8d32('0xf3')]];unlockQueueStatus(_0x295d14);});}else{this[_0x8d32('0xcc')](this[_0x8d32('0x1c')][this[_0x8d32('0xf0')][_0x27b453[_0x8d32('0xf3')]]['queue']]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x27b453[_0x8d32('0xf3')]][_0x8d32('0xee')],'ListId':this[_0x8d32('0xf0')][_0x27b453[_0x8d32('0xf3')]][_0x8d32('0xdb')],'VoiceQueueId':this[_0x8d32('0xf0')][_0x27b453[_0x8d32('0xf3')]][_0x8d32('0xdc')]||undefined,'CampaignId':this[_0x8d32('0xf0')][_0x27b453[_0x8d32('0xf3')]][_0x8d32('0xdd')]||undefined})[_0x8d32('0xa0')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x8d32('0xf0')][_0x27b453[_0x8d32('0xf3')]];unlockQueueStatus(_0x295d14);}}else if(_0x2c3264==='rrmemory'){var _0x543d3c;if(this[_0x8d32('0xf0')][_0x27b453[_0x8d32('0xf3')]]&&!_[_0x8d32('0x4a')](this['queueBooked'][this['actions'][_0x27b453[_0x8d32('0xf3')]]['queue']])){if(this[_0x8d32('0x101')][_0x1b3842['actions'][_0x27b453[_0x8d32('0xf3')]][_0x8d32('0xc4')]]){this['queueBookedRR'][_0x1b3842[_0x8d32('0xf0')][_0x27b453[_0x8d32('0xf3')]]['queue']]=this[_0x8d32('0x101')][this[_0x8d32('0xf0')][_0x27b453[_0x8d32('0xf3')]][_0x8d32('0xc4')]]?this[_0x8d32('0x101')][this['actions'][_0x27b453[_0x8d32('0xf3')]][_0x8d32('0xc4')]]:this['queueBooked'][this['actions'][_0x27b453[_0x8d32('0xf3')]][_0x8d32('0xc4')]]?this['queueBooked'][this[_0x8d32('0xf0')][_0x27b453['actionid']][_0x8d32('0xc4')]][_0x8d32('0x102')]||0x0:0x0;}this[_0x8d32('0x27')][this['actions'][_0x27b453[_0x8d32('0xf3')]][_0x8d32('0xc4')]][_0x8d32('0x102')]=this[_0x8d32('0x101')][this[_0x8d32('0xf0')][_0x27b453[_0x8d32('0xf3')]][_0x8d32('0xc4')]];for(var _0x5b296b=0x0;_0x5b296b=_0x30a901[_0x8d32('0x124')]){_0x533871[_0x8d32('0x125')](_0xb15314,_0x37348c,_0x1e59ff,_0x8d32('0x126'));}else{if(_0xb15314[_0x8d32('0x121')]>=_0x30a901[_0x8d32('0x127')]){_0x533871[_0x8d32('0x128')](_0xb15314,_0x37348c,_0x1e59ff,_0x8d32('0x129'));}else{hopperUtils[_0x8d32('0xec')]({'active':![],'countmachineretry':_0xb15314[_0x8d32('0x121')],'scheduledat':moment()['add'](_0x30a901[_0x8d32('0x12a')],_0x8d32('0xda'))[_0x8d32('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xb15314[_0x8d32('0xee')],'ListId':_0xb15314[_0x8d32('0xdb')],'VoiceQueueId':_0xb15314['VoiceQueueId']||undefined,'CampaignId':_0xb15314['CampaignId']||undefined})['catch'](loggerCatch(_0x8d32('0x12b')));_0x37348c({'reschedule':0x1});}}});}if(_0x39cf3a[_0x8d32('0x42')]===_0x8d32('0xc3')&&this[_0x8d32('0x1d')][_0x39cf3a[_0x8d32('0xc4')]][_0x8d32('0x112')]&&_0x3b9695[_0x8d32('0x113')]===_0x8d32('0x114')){delete this[_0x8d32('0x22')][_0x3b9695[_0x8d32('0xc2')]];this[_0x8d32('0xcc')](this[_0x8d32('0x1d')][_0x39cf3a[_0x8d32('0xc4')]]);_0x490e7d=new Hangup(_0x39cf3a,_0x3b9695);_0x490e7d[_0x8d32('0xdf')]=0x12;_0x490e7d[_0x8d32('0x6e')]=_0x8d32('0x117');_0x490e7d[_0x8d32('0x120')]='AMD';ami['emit'](_0x8d32('0x119'),ut['buildObj'](_0x490e7d,_0x8d32('0x11b')));this[_0x8d32('0x11c')](_0x490e7d,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x39cf3a[_0x8d32('0x42')]==='ivr'&&this['campaigns'][_0x39cf3a['queue']][_0x8d32('0x112')]&&_0x3b9695['value']===_0x8d32('0x11e')){return new Promise(function(_0x4073a6,_0x471237){delete _0x533871[_0x8d32('0x22')][_0x3b9695['uniqueid']];_0x533871[_0x8d32('0xcc')](_0x533871[_0x8d32('0x1d')][_0x39cf3a[_0x8d32('0xc4')]]);_0x533871[_0x8d32('0x1d')][_0x39cf3a[_0x8d32('0xc4')]]['outboundAnswerCallsDay']+=0x1;_0x533871[_0x8d32('0x1d')][_0x39cf3a[_0x8d32('0xc4')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x1ac780=_0x533871['campaigns'][_0x39cf3a[_0x8d32('0xc4')]];var _0x3fac59=new Hangup(_0x39cf3a,_0x3b9695);_0x3fac59['state']=0x13;_0x3fac59['statedesc']='Machine';_0x3fac59['membername']=_0x8d32('0x118');_0x3fac59['countmachineretry']+=0x1;_0x3fac59[_0x8d32('0xd3')]+=0x1;_0x3fac59['amd']=!![];ami[_0x8d32('0x41')](_0x8d32('0x119'),ut[_0x8d32('0x11a')](_0x3fac59,_0x8d32('0x11b')));hopperUtils[_0x8d32('0xe2')](_0x3fac59)[_0x8d32('0xa0')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x3fac59[_0x8d32('0x12c')]+_0x3fac59[_0x8d32('0x12d')]+_0x3fac59['countnoanswerretry']+_0x3fac59[_0x8d32('0x12e')]+_0x3fac59[_0x8d32('0xd2')]+_0x3fac59[_0x8d32('0xe8')]+_0x3fac59[_0x8d32('0x121')]+_0x3fac59['countagentrejectretry']>=_0x1ac780[_0x8d32('0x124')]){_0x533871[_0x8d32('0x125')](_0x3fac59,_0x4073a6,_0x471237,'reason19\x20machine....');}else{if(_0x3fac59[_0x8d32('0x121')]>=_0x1ac780[_0x8d32('0x127')]){_0x533871[_0x8d32('0x128')](_0x3fac59,_0x4073a6,_0x471237,_0x8d32('0x129'));}else{hopperUtils[_0x8d32('0xec')]({'active':![],'countmachineretry':_0x3fac59[_0x8d32('0x121')],'scheduledat':moment()[_0x8d32('0xed')](_0x1ac780[_0x8d32('0x12a')],_0x8d32('0xda'))[_0x8d32('0x46')](_0x8d32('0xc5')),'ContactId':_0x3fac59['ContactId'],'ListId':_0x3fac59[_0x8d32('0xdb')],'VoiceQueueId':_0x3fac59[_0x8d32('0xdc')]||undefined,'CampaignId':_0x3fac59['CampaignId']||undefined})[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x12b')));_0x4073a6({'reschedule':0x1});}}});}}};Dialer[_0x8d32('0x18')][_0x8d32('0x12f')]=function(_0x3b4c95){var _0x77784c=this[_0x8d32('0x22')][_0x3b4c95['uniqueid']];var _0xaa9a5f;if(_0x77784c&&_0x77784c['type']===_0x8d32('0xc3')){delete this[_0x8d32('0x22')][_0x3b4c95['uniqueid']];this[_0x8d32('0xcc')](this[_0x8d32('0x1d')][_0x77784c[_0x8d32('0xc4')]]);this[_0x8d32('0x1d')][_0x77784c[_0x8d32('0xc4')]][_0x8d32('0x130')]+=0x1;_0xaa9a5f=new Hangup(_0x77784c,_0x3b4c95);hopperUtils[_0x8d32('0xe2')](_0xaa9a5f)[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x131')));hopperUtils[_0x8d32('0xca')](_0xaa9a5f)[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x132')));}if(_0x77784c&&_0x77784c['type']!==_0x8d32('0xc3')&&isNotNull(this[_0x8d32('0x1c')][_0x77784c[_0x8d32('0xc4')]][_0x8d32('0x133')])){delete this[_0x8d32('0x22')][_0x3b4c95[_0x8d32('0xc2')]];this[_0x8d32('0xcc')](this[_0x8d32('0x1c')][_0x77784c['queue']]);this['voiceQueues'][_0x77784c[_0x8d32('0xc4')]][_0x8d32('0x115')]+=0x1;this[_0x8d32('0x1c')][_0x77784c[_0x8d32('0xc4')]][_0x8d32('0x116')]+=0x1;_0xaa9a5f=new Hangup(_0x77784c,_0x3b4c95);_0xaa9a5f[_0x8d32('0xdf')]=0x10;_0xaa9a5f[_0x8d32('0x6e')]=_0x8d32('0x134');_0xaa9a5f[_0x8d32('0x120')]=_0x8d32('0x135');hopperUtils['createHistory'](_0xaa9a5f)[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x131')));hopperUtils[_0x8d32('0xca')](_0xaa9a5f)[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x132')));}if(_0x77784c&&_0x77784c[_0x8d32('0x42')]!=='ivr'&&!isNotNull(this[_0x8d32('0x1c')][_0x77784c[_0x8d32('0xc4')]][_0x8d32('0x133')])){if(_0x3b4c95[_0x8d32('0x136')]===_0x8d32('0x137')){delete this[_0x8d32('0x22')][_0x3b4c95[_0x8d32('0xc2')]];this['voiceQueues'][_0x77784c[_0x8d32('0xc4')]][_0x8d32('0x115')]+=0x1;const _0x1d9195=new AgentComplete(_0x77784c,_0x3b4c95);_0x1d9195[_0x8d32('0xdd')]=this[_0x8d32('0x1c')][_0x77784c[_0x8d32('0xc4')]]['id'];hopperUtils[_0x8d32('0xe2')](_0x1d9195)[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x138')));hopperUtils[_0x8d32('0xca')](_0x1d9195)[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x139')));}else{delete this[_0x8d32('0x22')][_0x3b4c95['uniqueid']];this[_0x8d32('0xcc')](this[_0x8d32('0x1c')][_0x77784c['queue']]);this[_0x8d32('0x1c')][_0x77784c[_0x8d32('0xc4')]][_0x8d32('0x13a')]+=0x1;_0xaa9a5f=new Hangup(_0x77784c,_0x3b4c95);_0xaa9a5f[_0x8d32('0xdf')]=0xc;_0xaa9a5f[_0x8d32('0x6e')]=_0x3b4c95['cause-txt'];_0xaa9a5f[_0x8d32('0x120')]='Unknow';hopperUtils[_0x8d32('0xe2')](_0xaa9a5f)[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x131')));hopperUtils[_0x8d32('0xca')](_0xaa9a5f)[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x132')));}}};Dialer['prototype'][_0x8d32('0x31')]=function(_0x425f89){var _0x3b3d67=this;if(!_0x3b3d67['queuesSummary'][_0x425f89['name']]){_0x3b3d67[_0x8d32('0x28')][_0x425f89[_0x8d32('0x48')]]={'running':![]};}else if(_0x3b3d67[_0x8d32('0x28')][_0x425f89['name']][_0x8d32('0x13b')]===!![]){return;}else if(_0x3b3d67[_0x8d32('0x28')][_0x425f89[_0x8d32('0x48')]][_0x8d32('0x13b')]===![]){_0x3b3d67[_0x8d32('0x28')][_0x425f89[_0x8d32('0x48')]][_0x8d32('0x13b')]=!![];}var _0x51995b=_0x3b3d67[_0x8d32('0x1c')][_0x425f89[_0x8d32('0x48')]];var _0x2d1177=_0x51995b['message']!==utils[_0x8d32('0x6c')][_0x8d32('0x7a')];var _0x2ed801=utils[_0x8d32('0x13c')](_0x51995b);_0x51995b[_0x8d32('0x13d')]=utils['getQueueCampaignStatusMessage'](_0x51995b,_0x3b3d67[_0x8d32('0x1f')]);Promise[_0x8d32('0xa9')]()[_0x8d32('0x3e')](function(){if(_0x51995b[_0x8d32('0x13d')]===utils[_0x8d32('0x6c')][_0x8d32('0x7a')]){if(_0x2d1177){clearPredictiveAttributes(_0x51995b);_0x425f89[_0x8d32('0x24')]=undefined;_0x425f89[_0x8d32('0x25')]=undefined;}if(_0x51995b[_0x8d32('0x13d')]===utils[_0x8d32('0x6c')][_0x8d32('0x7a')]){_0x425f89[_0x8d32('0x13e')]=0x0;_0x425f89[_0x8d32('0xfb')]=0x0;_0x425f89[_0x8d32('0x13f')]=0x0;_0x425f89['talking']=0x0;_0x425f89[_0x8d32('0x140')]=0x0;}}else if(_0x51995b[_0x8d32('0x13d')]===utils[_0x8d32('0x6c')]['ACTIVE']&&!_0x2ed801){return _0x3b3d67[_0x8d32('0x91')](_0x51995b,!![])['then'](function(){return _0x3b3d67['ifTime'](_0x51995b,![]);})[_0x8d32('0x3e')](function(){return _0x3b3d67['checkDialMethod'](_0x51995b);})[_0x8d32('0xa0')](function(_0x2f2466){loggerSyncQueueSummary['debug'](_0x8d32('0x141'),util[_0x8d32('0x45')](_0x2f2466,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x51995b);});}else{clearPredictiveAttributes(_0x51995b);}})[_0x8d32('0x3e')](function(){var _0x88f7=_0x425f89[_0x8d32('0x142')](_0x51995b);if(_0x88f7||_0x51995b[_0x8d32('0x143')]){_0x51995b[_0x8d32('0x143')]=![];_0x425f89[_0x8d32('0x144')](_0x51995b);Object['assign'](_0x51995b,_0x425f89);emitOutboundVoiceQueueSummary(_0x425f89);}_0x3b3d67['queuesSummary'][_0x51995b[_0x8d32('0x48')]][_0x8d32('0x13b')]=![];})['catch'](function(_0x9ecbf8){logger[_0x8d32('0x66')]('[syncQueueSummary]',util[_0x8d32('0x45')](_0x9ecbf8,{'showHidden':![],'depth':null}));_0x3b3d67[_0x8d32('0x28')][_0x51995b[_0x8d32('0x48')]][_0x8d32('0x13b')]=![];});};Dialer[_0x8d32('0x18')][_0x8d32('0x33')]=_[_0x8d32('0x145')](function(){var _0x33c04f=_[_0x8d32('0x146')](this[_0x8d32('0x1c')],function(_0x40e914){return _0x40e914[_0x8d32('0x147')];});var _0x354353=_[_0x8d32('0x146')](this[_0x8d32('0x1e')],function(_0x13ed7c){return _0x13ed7c[_0x8d32('0x148')]&&_0x13ed7c[_0x8d32('0x85')]===_0x8d32('0x86');});if(_0x33c04f['length']>0x0&&_0x354353[_0x8d32('0x103')]>0x0){return Promise['resolve']()[_0x8d32('0x3e')](cmHopper['handlePreviewRecallNotifications'](_[_0x8d32('0x149')](_0x33c04f,'id'),previewRecallmeReminderInterval,_['map'](_0x354353,'id')))[_0x8d32('0x3e')](function(_0x33e6dd){for(var _0x57b651=0x0;_0x57b651<_0x33e6dd[_0x8d32('0x103')];_0x57b651++){var _0x95a549=_0x33e6dd[_0x57b651]['Agent']['name'];if(_0x95a549)io['to'](util['format'](_0x8d32('0x14a'),_0x95a549))['emit'](_0x8d32('0x14b'),{'hopper':_0x33e6dd[_0x57b651]});}})['catch'](function(_0x405945){logger[_0x8d32('0x66')](_0x8d32('0x14c'),_0x405945);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x8d32('0x18')][_0x8d32('0x3c')]=function(){var _0x4d9b89=this;setInterval(function(){_0x4d9b89[_0x8d32('0x14d')](_0x4d9b89[_0x8d32('0x22')],_0x8d32('0x14e'));_0x4d9b89['clearZombieChannels'](_0x4d9b89['actions'],_0x8d32('0x14f'));},0x32c8);};Dialer[_0x8d32('0x18')][_0x8d32('0x14d')]=function(_0x412ad9,_0xe12275){var _0x30563c=this;for(var _0x5465ae in _0x412ad9){if(typeof _0x412ad9[_0x5465ae]!==_0x8d32('0xa8')){this['sequence'][_0x8d32('0x150')](function(){if(!_[_0x8d32('0xf9')](_0x412ad9[_0x5465ae])){return ami[_0x8d32('0x9b')]({'action':_0x8d32('0x85'),'channel':_0x412ad9[_0x5465ae]['channel']})[_0x8d32('0xa0')](function(_0x5d360f){if(_0x5d360f['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x412ad9[_0x5465ae]&&_0x412ad9[_0x5465ae][_0x8d32('0x42')]!==_0x8d32('0xc3')){_0x30563c[_0x8d32('0xcc')](_0x30563c[_0x8d32('0x1c')][_0x412ad9[_0x5465ae][_0x8d32('0xc4')]]);logger[_0x8d32('0x66')](_0x8d32('0x151'),_0xe12275,_0x5465ae,_0x412ad9[_0x5465ae][_0x8d32('0xc4')]);delete _0x412ad9[_0x5465ae];}if(_0x412ad9[_0x5465ae]&&_0x412ad9[_0x5465ae]['type']===_0x8d32('0xc3')){_0x30563c[_0x8d32('0xcc')](_0x30563c[_0x8d32('0x1d')][_0x412ad9[_0x5465ae][_0x8d32('0xc4')]]);logger['error'](_0x8d32('0x152'),_0xe12275,_0x5465ae,_0x412ad9[_0x5465ae][_0x8d32('0xc4')]);delete _0x412ad9[_0x5465ae];}},0x2328);}});}});}}};Dialer[_0x8d32('0x18')][_0x8d32('0x153')]=function(_0x4230d2){return Promise[_0x8d32('0xa9')]()['then'](voiceQueueRt[_0x8d32('0x153')](_0x4230d2))[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x154')));};Dialer['prototype'][_0x8d32('0xcc')]=function(_0x4b86aa){if(!_[_0x8d32('0x40')](_0x4b86aa)&&_0x4b86aa!==null){if(typeof _0x4b86aa[_0x8d32('0x7f')]!=='undefined'){if(_0x4b86aa['originated']>0x0){_0x4b86aa['originated']-=0x1;}else{logger['error'](_0x8d32('0x155'));}}}else{logger[_0x8d32('0x66')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x8d32('0x18')]['loggerHandler']=function(_0x5de428,_0x11982b){var _0xd479ce=this;return function(_0x66fd40){_0xd479ce[_0x8d32('0xcc')](_0x11982b);logger[_0x8d32('0x66')](_0x5de428,util['inspect'](_0x66fd40,{'showHidden':![],'depth':null}));};};Dialer[_0x8d32('0x18')][_0x8d32('0x156')]=function(_0x35305d,_0x490824,_0x82fd7f){var _0x12103e={'state':0x19,'statedesc':_0x8d32('0x157')};this[_0x8d32('0xcc')](_0x490824);this[_0x8d32('0x11c')](_['merge'](_0x12103e,_[_0x8d32('0xfa')](_0x82fd7f,[_0x8d32('0xee'),_0x8d32('0xdb'),_0x8d32('0x158'),'VoiceQueueId',_0x8d32('0xdd')])),_0x8d32('0x159'),_0x8d32('0x15a'));logger[_0x8d32('0x66')](_0x35305d);};Dialer[_0x8d32('0x18')][_0x8d32('0x11c')]=function(_0x527c10,_0x3b3151,_0x5bfff2){hopperUtils[_0x8d32('0xe2')](_0x527c10)['catch'](loggerCatch(_0x3b3151));hopperUtils[_0x8d32('0xca')](_0x527c10)[_0x8d32('0xa0')](loggerCatch(_0x5bfff2));};Dialer[_0x8d32('0x18')][_0x8d32('0xd8')]=function(_0xc3c55f,_0x2fb1bd){hopperUtils['createHistory'](_0xc3c55f)[_0x8d32('0xa0')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x2fb1bd==0x0){hopperUtils[_0x8d32('0xca')](_0xc3c55f)[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x15b')));}};Dialer[_0x8d32('0x18')][_0x8d32('0x14c')]=function(_0x3100f4){return Promise[_0x8d32('0xa9')]()[_0x8d32('0x3e')](cmHopper[_0x8d32('0x15c')](_0x3100f4['id'],previewRecallmeReminderInterval))['then'](function(_0x2877cb){for(var _0x58efcb=0x0;_0x58efcb<_0x2877cb[_0x8d32('0x103')];_0x58efcb++){var _0x46e3f5=_0x2877cb[_0x58efcb][_0x8d32('0x15d')]['name'];if(_0x46e3f5)io['to'](util[_0x8d32('0x46')]('user:%s',_0x46e3f5))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x2877cb[_0x58efcb]});}})['catch'](function(){});};Dialer['prototype'][_0x8d32('0xad')]=function(_0x572447){var _0x5d115c=this;return function(){_0x5d115c[_0x8d32('0x15e')](_0x572447);};};Dialer['prototype'][_0x8d32('0x15f')]=function(_0xc06cce,_0x53ae6b){var _0x426383=this;var _0x51f094=uuid['v4']();this['actions'][_0x51f094]=new Action(_0xc06cce,_0x53ae6b,_0x51f094);return new Promise(function(_0x39100a,_0x21dede){if(_[_0x8d32('0x40')](_0xc06cce)&&typeof _0xc06cce!=='object'){return _0x21dede(msgResponse('originate','Failure','voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x53ae6b[_0x8d32('0x160')])||_0x53ae6b[_0x8d32('0x160')]===null){return _0x21dede(msgResponse(_0x8d32('0x161'),'Failure',_0x8d32('0x162')));}var _0x34550c={'XMD-CALLERID':_0x426383[_0x8d32('0xf0')][_0x51f094][_0x8d32('0x163')](),'XMD-AGI':_0xc06cce[_0x8d32('0x133')]?util[_0x8d32('0x46')](_0x8d32('0x164'),ipAgi,_0xc06cce[_0x8d32('0x133')]):_0x8d32('0x165'),'XMD-AGIAFTER':_0xc06cce[_0x8d32('0xc8')]?util[_0x8d32('0x46')]('\x22agi://%s/square,%s\x22',ipAgi,_0xc06cce['dialQueueProject2']):'NONE','XMD-QUEUE':utils[_0x8d32('0x166')](_0xc06cce)?util[_0x8d32('0x46')](_0x8d32('0x167'),_0xc06cce[_0x8d32('0x48')],_0xc06cce[_0x8d32('0x168')]||'',_0xc06cce['dialAgiAfterHangupAgent']?'c':'',_0xc06cce[_0x8d32('0x169')]||0x3):'NONE','XMD-CONTACTID':_0x53ae6b[_0x8d32('0xee')],'XMD-CDRTYPE':_0x8d32('0xa'),'CALLERID(all)':_0x426383[_0x8d32('0xf0')][_0x51f094]['getCaller'](),'XMD-AMD':_0xc06cce[_0x8d32('0x112')]?'ACTIVE':_0x8d32('0x165'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0xc06cce[_0x8d32('0x112')]){_0x34550c[_0x8d32('0x16a')]=_0xc06cce[_0x8d32('0x16b')]||0x9c4;_0x34550c[_0x8d32('0x16c')]=_0xc06cce[_0x8d32('0x16d')]||0x5dc;_0x34550c[_0x8d32('0x16e')]=_0xc06cce['dialAMDAfterGreetingSilence']||0x320;_0x34550c['XMD-AMDTOTALANALYSISTIME']=_0xc06cce[_0x8d32('0x16f')]||0x1388;_0x34550c['XMD-AMDMINWORDLENGTH']=_0xc06cce[_0x8d32('0x170')]||0x64;_0x34550c[_0x8d32('0x171')]=_0xc06cce[_0x8d32('0x172')]||0x32;_0x34550c[_0x8d32('0x173')]=_0xc06cce[_0x8d32('0x174')]||0x3;_0x34550c['XMD-AMDSILENCETHRESHOLD']=_0xc06cce[_0x8d32('0x175')]||0x100;_0x34550c[_0x8d32('0x176')]=_0xc06cce[_0x8d32('0x177')]||0x1388;}if(utils[_0x8d32('0x166')](_0xc06cce)){_0x34550c[_0x8d32('0x178')]=_0x53ae6b[_0x8d32('0xdc')];}else{_0x34550c[_0x8d32('0x179')]=_0x53ae6b[_0x8d32('0xdd')];}var _0x4e0471=utils['setXMDContactVariables'](_0x53ae6b[_0x8d32('0x17a')]);Object[_0x8d32('0x17b')](_0x34550c,_0x4e0471);var _0x11cd04=_0x426383[_0x8d32('0x8a')](_0xc06cce[_0x8d32('0x8b')])?utils[_0x8d32('0x17c')](_0xc06cce[_0x8d32('0x8b')][_0x8d32('0x17d')],_0xc06cce[_0x8d32('0x17e')],_0xc06cce['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x8d32('0x17f')](_0xc06cce[_0x8d32('0x180')],_0xc06cce[_0x8d32('0x181')]):_0xc06cce[_0x8d32('0x180')]):utils[_0x8d32('0x17c')](_[_0x8d32('0xf9')](_0xc06cce['TrunkBackup'])?_0xc06cce[_0x8d32('0x8b')][_0x8d32('0x17d')]:_0xc06cce[_0x8d32('0x8c')][_0x8d32('0x17d')],_0xc06cce[_0x8d32('0x17e')],_0xc06cce[_0x8d32('0x181')]>0x0?utils[_0x8d32('0x17f')](_0xc06cce[_0x8d32('0x180')],_0xc06cce[_0x8d32('0x181')]):_0xc06cce[_0x8d32('0x180')]);if(_0x11cd04){_0x34550c['XMD-ORIGINATECALLERIDNAME']=_0x426383['actions'][_0x51f094][_0x8d32('0x182')]=utils[_0x8d32('0x183')](_0x11cd04);_0x34550c['XMD-ORIGINATECALLERIDNUM']=_0x53ae6b[_0x8d32('0x160')];}_0xc06cce[_0x8d32('0x184')]=_0x34550c;return ami[_0x8d32('0x9b')]({'actionid':_0x51f094,'action':'originate','channel':_0x426383['isTrunkReachable'](_0xc06cce['Trunk'])?util[_0x8d32('0x46')](_0x8d32('0x185'),_0xc06cce['Trunk'][_0x8d32('0x48')],isNotNull(_0xc06cce[_0x8d32('0x186')])?_0xc06cce[_0x8d32('0x186')][_0x8d32('0x187')]()||'':'',_0xc06cce[_0x8d32('0x188')]>0x0?_0x53ae6b[_0x8d32('0x160')]['substring'](_0xc06cce[_0x8d32('0x188')]):_0x53ae6b[_0x8d32('0x160')]):util['format'](_0x8d32('0x185'),_['isNil'](_0xc06cce[_0x8d32('0x8c')])?_0xc06cce[_0x8d32('0x8b')][_0x8d32('0x48')]:_0xc06cce[_0x8d32('0x8c')][_0x8d32('0x48')],isNotNull(_0xc06cce[_0x8d32('0x186')])?_0xc06cce['dialPrefix'][_0x8d32('0x187')]()||'':'',_0xc06cce[_0x8d32('0x188')]>0x0?_0x53ae6b[_0x8d32('0x160')][_0x8d32('0x189')](_0xc06cce[_0x8d32('0x188')]):_0x53ae6b['phone']),'callerid':_0x11cd04,'Exten':_0x8d32('0x18a'),'Context':'from-sip','Priority':'1','variable':_0x34550c,'timeout':(_0xc06cce['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x51f094})[_0x8d32('0x3e')](function(_0x479e4f){return _0x39100a(_0x479e4f);})[_0x8d32('0xa0')](function(_0x14307f){_0xc06cce['outboundOriginateFailureCallsDay']+=0x1;var _0x57bc94=new History(_0x426383['actions'][_0x51f094]);logger[_0x8d32('0x66')](util[_0x8d32('0x46')]('[originateError]:\x20%s',JSON[_0x8d32('0x74')](_0x14307f)));_0x57bc94['state']=0xe;_0x57bc94[_0x8d32('0x6e')]=_0x8d32('0x18b');_0x57bc94['starttime']=moment()[_0x8d32('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x57bc94[_0x8d32('0x6f')]=_0x57bc94[_0x8d32('0x70')];hopperUtils['createHistory'](_0x57bc94)[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x18c')));_0x426383[_0x8d32('0xca')](_0x57bc94)[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x18c')))[_0x8d32('0x1a')](function(){delete _0x426383[_0x8d32('0xf0')][_0x51f094];return _0x21dede(msgResponse(_0x8d32('0x161'),'Error',_0x8d32('0x18d')));});});});};Dialer['prototype']['checkRetriveMax']=function(_0x4c4d69,_0x2fff08,_0xe24610){var _0x290881=new History(_0x2fff08);if(_0x290881[_0x8d32('0x12c')]+_0x290881[_0x8d32('0x12d')]+_0x290881[_0x8d32('0x122')]+_0x290881['countnosuchnumberretry']+_0x290881[_0x8d32('0xd2')]+_0x290881[_0x8d32('0xe8')]+_0x290881['countmachineretry']+_0x290881[_0x8d32('0x123')]>=_0xe24610[_0x8d32('0x124')]-0x1){return!![];}switch(_0x4c4d69){case 0x3:if(_0x290881['countnoanswerretry']>=_0xe24610[_0x8d32('0x18e')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x290881[_0x8d32('0x122')]+=0x1,'scheduledat':moment()[_0x8d32('0xed')](_0xe24610['dialNoAnswerRetryFrequency'],_0x8d32('0xda'))[_0x8d32('0x46')](_0x8d32('0xc5')),'ContactId':_0x290881[_0x8d32('0xee')],'ListId':_0x290881['ListId'],'VoiceQueueId':_0x290881[_0x8d32('0xdc')]||undefined,'CampaignId':_0x290881[_0x8d32('0xdd')]||undefined})[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x18f')));break;case 0x5:if(_0x290881[_0x8d32('0x12c')]>=_0xe24610[_0x8d32('0x190')]-0x1){return!![];}hopperUtils[_0x8d32('0xec')]({'active':![],'countbusyretry':_0x290881[_0x8d32('0x12c')]+=0x1,'scheduledat':moment()['add'](_0xe24610[_0x8d32('0x191')],'minutes')[_0x8d32('0x46')](_0x8d32('0xc5')),'ContactId':_0x290881[_0x8d32('0xee')],'ListId':_0x290881[_0x8d32('0xdb')],'VoiceQueueId':_0x290881[_0x8d32('0xdc')]||undefined,'CampaignId':_0x290881[_0x8d32('0xdd')]||undefined})[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x192')));break;case 0x8:if(_0x290881[_0x8d32('0x12d')]>=_0xe24610[_0x8d32('0x193')]-0x1){return!![];}hopperUtils[_0x8d32('0xec')]({'active':![],'countcongestionretry':_0x290881[_0x8d32('0x12d')]+=0x1,'scheduledat':moment()[_0x8d32('0xed')](_0xe24610[_0x8d32('0x194')],_0x8d32('0xda'))[_0x8d32('0x46')](_0x8d32('0xc5')),'ContactId':_0x290881[_0x8d32('0xee')],'ListId':_0x290881[_0x8d32('0xdb')],'VoiceQueueId':_0x290881[_0x8d32('0xdc')]||undefined,'CampaignId':_0x290881[_0x8d32('0xdd')]||undefined})[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x195')));break;case 0x0:if(_0x290881[_0x8d32('0x12e')]>=_0xe24610[_0x8d32('0x196')]-0x1){return!![];}else{hopperUtils[_0x8d32('0xec')]({'active':![],'countnosuchnumberretry':_0x290881[_0x8d32('0x12e')]+=0x1,'scheduledat':moment()[_0x8d32('0xed')](_0xe24610[_0x8d32('0x197')],_0x8d32('0xda'))['format'](_0x8d32('0xc5')),'ContactId':_0x290881[_0x8d32('0xee')],'ListId':_0x290881[_0x8d32('0xdb')],'VoiceQueueId':_0x290881['VoiceQueueId']||undefined,'CampaignId':_0x290881[_0x8d32('0xdd')]||undefined})[_0x8d32('0xa0')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x290881['countdropretry']>=_0xe24610[_0x8d32('0xd7')]-0x1){return!![];}hopperUtils[_0x8d32('0xec')]({'active':![],'countdropretry':_0x290881[_0x8d32('0xd2')]+=0x1,'scheduledat':moment()[_0x8d32('0xed')](_0xe24610[_0x8d32('0xd4')],_0x8d32('0xda'))[_0x8d32('0x46')](_0x8d32('0xc5')),'ContactId':_0x290881[_0x8d32('0xee')],'ListId':_0x290881[_0x8d32('0xdb')],'VoiceQueueId':_0x290881[_0x8d32('0xdc')]||undefined,'CampaignId':_0x290881[_0x8d32('0xdd')]||undefined})[_0x8d32('0xa0')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x290881[_0x8d32('0xe8')]>=_0xe24610[_0x8d32('0xeb')]-0x1){return!![];}hopperUtils[_0x8d32('0xec')]({'active':![],'countabandonedretry':_0x290881[_0x8d32('0xe8')]+=0x1,'scheduledat':moment()[_0x8d32('0xed')](_0xe24610[_0x8d32('0xe9')],_0x8d32('0xda'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x290881[_0x8d32('0xee')],'ListId':_0x290881[_0x8d32('0xdb')],'VoiceQueueId':_0x290881['VoiceQueueId']||undefined,'CampaignId':_0x290881['CampaignId']||undefined})[_0x8d32('0xa0')](loggerCatch(_0x8d32('0xef')));break;case 0x13:if(_0x290881[_0x8d32('0x121')]>=_0xe24610[_0x8d32('0x127')]-0x1){return!![];}hopperUtils[_0x8d32('0xec')]({'active':![],'countmachineretry':_0x290881['countmachineretry']+=0x1,'scheduledat':moment()[_0x8d32('0xed')](_0xe24610[_0x8d32('0x12a')],'minutes')[_0x8d32('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x290881[_0x8d32('0xee')],'ListId':_0x290881[_0x8d32('0xdb')],'VoiceQueueId':_0x290881['VoiceQueueId']||undefined,'CampaignId':_0x290881[_0x8d32('0xdd')]||undefined})[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x12b')));break;case 0x14:if(_0x290881[_0x8d32('0x123')]>=_0xe24610[_0x8d32('0x198')]-0x1){return!![];}hopperUtils[_0x8d32('0xec')]({'active':![],'countagentrejectretry':_0x290881[_0x8d32('0x123')]+=0x1,'scheduledat':moment()['add'](_0xe24610[_0x8d32('0x199')],'minutes')[_0x8d32('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x290881[_0x8d32('0xee')],'ListId':_0x290881['ListId'],'VoiceQueueId':_0x290881[_0x8d32('0xdc')]||undefined,'CampaignId':_0x290881['CampaignId']||undefined})[_0x8d32('0xa0')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x8d32('0x18')][_0x8d32('0x10e')]=function(_0xe6de23,_0x282b31,_0x27edca){var _0x4b6dc3=this;var _0xf94d27=new History(_0xe6de23);var _0x3be495=![];var _0x46a2ca;var _0x901e7b;return new Promise(function(_0x4588c4,_0x1c5333){if(_[_0x8d32('0x40')](_0x282b31)&&typeof _0x282b31!==_0x8d32('0x19a')){return _0x1c5333(msgResponse('[callProgressDetecting]',_0x8d32('0x92'),_0x8d32('0x19b')));}if(_[_0x8d32('0x40')](_0x27edca)&&typeof _0x27edca!==_0x8d32('0x19a')){return _0x1c5333(msgResponse(_0x8d32('0x19c'),_0x8d32('0x92'),'evt\x20is\x20undefine'));}hopperUtils[_0x8d32('0xd5')](_0xf94d27,_0x27edca[_0x8d32('0xc6')],_0x282b31)[_0x8d32('0x3e')](function(_0x5eba48){if(_0x5eba48[_0x8d32('0xd9')]==0x1)_0x3be495=!![];switch(_0x27edca[_0x8d32('0xc6')]){case'0':_0x282b31[_0x8d32('0x19d')]+=0x1;_0xf94d27[_0x8d32('0xdf')]=0x0;_0xf94d27[_0x8d32('0x6e')]=_0x8d32('0x19e');_0xf94d27[_0x8d32('0x12e')]+=0x1;_0xf94d27[_0x8d32('0xd3')]+=0x1;ami[_0x8d32('0x41')](_0x8d32('0x19f'),ut[_0x8d32('0x11a')](_0xe6de23,_0x8d32('0x1a0')));_0x46a2ca=_0x282b31['dialNoSuchNumberRetryFrequency'];_0x901e7b=_0x282b31[_0x8d32('0xea')];hopperUtils[_0x8d32('0xe2')](_0xf94d27)[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x1a1')));if(_0x4b6dc3[_0x8d32('0x1a2')](0x0,_0xe6de23,_0x282b31)&&!_0x3be495){if(_0xf94d27['countnosuchnumberretry']>=_0x282b31['dialNoSuchNumberMaxRetry']){_0x4b6dc3[_0x8d32('0x128')](_0xf94d27,_0x4588c4,_0x1c5333,_0x8d32('0x1a3'));}else{_0x4b6dc3[_0x8d32('0x125')](_0xf94d27,_0x4588c4,_0x1c5333,_0x8d32('0x1a3'));}}break;case'3':_0x282b31[_0x8d32('0x1a4')]+=0x1;_0xf94d27[_0x8d32('0xdf')]=0x3;_0xf94d27[_0x8d32('0x6e')]=_0x8d32('0x1a5');_0xf94d27['countnoanswerretry']+=0x1;_0xf94d27['countglobal']+=0x1;var _0x4b5ced=ut[_0x8d32('0x1a6')](_0xe6de23,_0x282b31);ami[_0x8d32('0x41')]('custom:agentnoanswer',_0x4b5ced);_0x46a2ca=_0x282b31[_0x8d32('0x1a7')];_0x901e7b=_0x282b31[_0x8d32('0xea')];hopperUtils[_0x8d32('0xe2')](_0xf94d27)[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x1a8')));if(_0x4b6dc3['checkRetriveMax'](0x3,_0xe6de23,_0x282b31)&&!_0x3be495){if(_0xf94d27[_0x8d32('0x122')]>=_0x282b31[_0x8d32('0x18e')]){_0x4b6dc3[_0x8d32('0x128')](_0xf94d27,_0x4588c4,_0x1c5333,'reason\x203\x20ringing\x20no\x20answer');}else{_0x4b6dc3['stateGlobal'](_0xf94d27,_0x4588c4,_0x1c5333,_0x8d32('0x1a9'));}}break;case'5':_0x282b31['outboundBusyCallsDay']+=0x1;_0xf94d27[_0x8d32('0xdf')]=0x5;_0xf94d27[_0x8d32('0x6e')]=_0x8d32('0x1aa');_0xf94d27[_0x8d32('0x12c')]+=0x1;_0xf94d27[_0x8d32('0xd3')]+=0x1;ami[_0x8d32('0x41')](_0x8d32('0x1ab'),ut[_0x8d32('0x11a')](_0xe6de23,_0x8d32('0x1ac')));_0x46a2ca=_0x282b31[_0x8d32('0x191')];_0x901e7b=_0x282b31[_0x8d32('0xea')];hopperUtils[_0x8d32('0xe2')](_0xf94d27)[_0x8d32('0xa0')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x4b6dc3[_0x8d32('0x1a2')](0x5,_0xe6de23,_0x282b31)&&!_0x3be495){if(_0xf94d27[_0x8d32('0x12c')]>=_0x282b31[_0x8d32('0x190')]){_0x4b6dc3[_0x8d32('0x128')](_0xf94d27,_0x4588c4,_0x1c5333,_0x8d32('0x1ad'));}else{_0x4b6dc3['stateGlobal'](_0xf94d27,_0x4588c4,_0x1c5333,_0x8d32('0x1ad'));}}break;case'8':_0x282b31[_0x8d32('0x1ae')]+=0x1;_0xf94d27[_0x8d32('0xdf')]=0x8;_0xf94d27[_0x8d32('0x6e')]=_0x8d32('0x1af');_0xf94d27[_0x8d32('0x12d')]+=0x1;_0xf94d27['countglobal']+=0x1;_0x46a2ca=_0x282b31['dialCongestionRetryFrequency'];_0x901e7b=_0x282b31[_0x8d32('0xea')];ami[_0x8d32('0x41')](_0x8d32('0x1b0'),ut[_0x8d32('0x11a')](_0xe6de23,'congestion'));hopperUtils[_0x8d32('0xe2')](_0xf94d27)[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x1b1')));if(_0x4b6dc3['checkRetriveMax'](0x8,_0xe6de23,_0x282b31)&&!_0x3be495){if(_0xf94d27[_0x8d32('0x12d')]>=_0x282b31['dialCongestionMaxRetry']){_0x4b6dc3[_0x8d32('0x128')](_0xf94d27,_0x4588c4,_0x1c5333,_0x8d32('0x1b2'));}else{_0x4b6dc3['stateGlobal'](_0xf94d27,_0x4588c4,_0x1c5333,_0x8d32('0x1b2'));}}break;case'11':_0x282b31['outboundAbandonedCallsDay']+=0x1;_0xf94d27['state']=0xb;_0xf94d27[_0x8d32('0x6e')]=_0x8d32('0xe5');_0xf94d27[_0x8d32('0xe8')]+=0x1;_0xf94d27[_0x8d32('0xd3')]+=0x1;_0x46a2ca=_0x282b31[_0x8d32('0xe9')];_0x901e7b=_0x282b31[_0x8d32('0xea')];hopperUtils['createHistory'](_0xf94d27)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x4b6dc3[_0x8d32('0x1a2')](0xb,_0xe6de23,_0x282b31)&&!_0x3be495){if(_0xf94d27[_0x8d32('0xe8')]>=_0x282b31[_0x8d32('0xeb')]){_0x4b6dc3[_0x8d32('0x128')](_0xf94d27,_0x4588c4,_0x1c5333,_0x8d32('0x1b3'));}else{_0x4b6dc3[_0x8d32('0x125')](_0xf94d27,_0x4588c4,_0x1c5333,_0x8d32('0x1b3'));}}break;case'20':_0x282b31['outboundRejectCallsDay']+=0x1;_0xf94d27[_0x8d32('0xdf')]=0x14;_0xf94d27[_0x8d32('0x6e')]=_0x8d32('0x1b4');_0xf94d27[_0x8d32('0x123')]+=0x1;_0xf94d27['countglobal']+=0x1;_0x46a2ca=_0x282b31[_0x8d32('0x199')];_0x901e7b=_0x282b31['callAdditionalPhoneAfterMin'];ami[_0x8d32('0x41')]('custom:agentreject',ut[_0x8d32('0x11a')](_0xe6de23,_0x8d32('0x1b5')));hopperUtils[_0x8d32('0xe2')](_0xf94d27)[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x1b6')));if(_0x4b6dc3[_0x8d32('0x1a2')](0x14,_0xe6de23,_0x282b31)&&!_0x3be495){if(_0xf94d27[_0x8d32('0x123')]>=_0x282b31[_0x8d32('0x198')]){_0x4b6dc3['createStateFinal'](_0xf94d27,_0x4588c4,_0x1c5333,_0x8d32('0x1b7'));}else{_0x4b6dc3[_0x8d32('0x125')](_0xf94d27,_0x4588c4,_0x1c5333,_0x8d32('0x1b7'));}}break;default:_0x282b31[_0x8d32('0x13a')]+=0x1;_0xf94d27[_0x8d32('0xdf')]=0xc;_0xf94d27[_0x8d32('0x6e')]=_0x27edca[_0x8d32('0xc6')];_0x46a2ca=_0x282b31['dialAgentRejectRetryFrequency'];_0x901e7b=_0x282b31[_0x8d32('0xea')];hopperUtils[_0x8d32('0xe2')](_0xf94d27)['catch'](loggerCatch(_0x8d32('0x1b8')));if(_0x4b6dc3[_0x8d32('0x1a2')](_0x27edca[_0x8d32('0xc6')],_0xe6de23,_0x282b31)&&!_0x3be495){if(_0xf94d27[_0x8d32('0x12c')]+_0xf94d27[_0x8d32('0x12d')]+_0xf94d27[_0x8d32('0x122')]+_0xf94d27[_0x8d32('0x12e')]+_0xf94d27['countdropretry']+_0xf94d27[_0x8d32('0xe8')]+_0xf94d27[_0x8d32('0x121')]+_0xf94d27[_0x8d32('0x123')]>=_0x282b31[_0x8d32('0x124')]){_0x4b6dc3[_0x8d32('0x125')](_0xf94d27,_0x4588c4,_0x1c5333,_0x27edca[_0x8d32('0xc6')]);}else{_0x4b6dc3[_0x8d32('0x128')](_0xf94d27,_0x4588c4,_0x1c5333,_0x27edca['reason']);}}}})['then'](function(){if(_0x3be495){hopperUtils['swapAdditionalPhones'](_0xf94d27,_0x46a2ca,_0x901e7b)[_0x8d32('0x3e')](function(){return _0x4588c4(0x1);});}});});};Dialer['prototype']['stateGlobal']=function(_0x405511,_0xe73000,_0x1c696c,_0x451a0d){var _0x10c42f=new Final(_0x405511);_0x10c42f[_0x8d32('0xdf')]=0xf;_0x10c42f[_0x8d32('0x6e')]=_0x8d32('0x1b9');this[_0x8d32('0x128')](_0x10c42f,_0xe73000,_0x1c696c,_0x451a0d);};Dialer[_0x8d32('0x18')]['createStateFinal']=function(_0x17f75b,_0x57274d,_0x41ce92,_0x180ac4){hopperUtils[_0x8d32('0xca')](_0x17f75b)[_0x8d32('0x3e')](function(){return _0x57274d(msgResponse('[callProgressDetecting]',_0x8d32('0x1ba'),_0x180ac4));})[_0x8d32('0xa0')](function(){return _0x41ce92(msgResponse(_0x8d32('0x1bb'),'Failure',_0x8d32('0x1bc')));});};Dialer[_0x8d32('0x18')]['predictive']=function(_0x5f374f){var _0xe292ca=_0x5f374f['dialPredictiveOptimizationPercentage']/0x64;var _0xb52374=_0x5f374f[_0x8d32('0xce')]/(_0x5f374f[_0x8d32('0xce')]+_0x5f374f[_0x8d32('0x115')]);var _0x4cf290=Math[_0x8d32('0x1bd')](_0x5f374f[_0x8d32('0x1be')]*(_0x5f374f[_0x8d32('0x1bf')]/0x64));var _0x53831a=Math[_0x8d32('0x1bd')](_0x5f374f[_0x8d32('0x1be')]*(_0x5f374f['predictiveIntervalMinThreshold']/0x64));var _0x4ed756=_0x5f374f['available']+_0x5f374f['talking'];var _0xaa1115=Math[_0x8d32('0x1c0')](_0x5f374f[_0x8d32('0x5b')]*_0x5f374f[_0x8d32('0x5e')]*_0x5f374f['predictiveIntervalHitRate']*_0x5f374f['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x5f374f[_0x8d32('0x25')])){if(!_['isUndefined'](_0x5f374f[_0x8d32('0x24')])){_0x5f374f['startPredictive']=undefined;loggerPredictive['error'](_0x8d32('0x1c1'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x5f374f['handlePredictive'])){loggerPredictive[_0x8d32('0x66')](_0x8d32('0x1c1'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x5f374f['handlePredictive']);_0x5f374f[_0x8d32('0x65')]=undefined;}_0x5f374f[_0x8d32('0x25')]=moment()[_0x8d32('0x46')](_0x8d32('0xc5'));loggerPredictive[_0x8d32('0x4b')](_0x5f374f['name'],_0x8d32('0x1c2'),_0x5f374f[_0x8d32('0x25')]);this[_0x8d32('0xb3')](_0x5f374f,0x1);}else if(ifInterval(_0x5f374f['dialPredictiveInterval'],_0x5f374f[_0x8d32('0x25')])){this[_0x8d32('0xb3')](_0x5f374f,0x1);loggerPredictiveCalls[_0x8d32('0x4b')](_0x8d32('0x1c3'),_0x5f374f[_0x8d32('0x25')],_0x5f374f[_0x8d32('0x48')]);_0x5f374f[_0x8d32('0x5b')]=0x0;_0x5f374f['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0xe292ca<_0xb52374&&_0x5f374f[_0x8d32('0x1c4')]===_0x8d32('0x1c5')){clearPredictiveAttributes(_0x5f374f);loggerPredictive[_0x8d32('0x4b')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x8d32('0x1c6'),_0xb52374,_0x8d32('0x25'),_0x5f374f[_0x8d32('0x48')]);}else if(_0xaa1115<_0x5f374f[_0x8d32('0x1c7')]&&_0x5f374f[_0x8d32('0x1c4')]===_0x8d32('0x1c5')){clearPredictiveAttributes(_0x5f374f);loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x1c8'),_0x8d32('0x1c9'),_0xaa1115,_0x8d32('0x1ca'),_0x5f374f['predictiveIntervalErlangCallsDroppedCalls'],_0x8d32('0x25'),_0x5f374f[_0x8d32('0x48')]);}else if(!ifInterval(_0x5f374f[_0x8d32('0x1cb')],_0x5f374f[_0x8d32('0x25')])&&_['isUndefined'](_0x5f374f[_0x8d32('0x24')])&&!_[_0x8d32('0x40')](_0x5f374f['startProgressive'])){_0x5f374f[_0x8d32('0x24')]=moment()['format'](_0x8d32('0xc5'));loggerPredictive[_0x8d32('0x4b')](_0x5f374f[_0x8d32('0x48')],_0x8d32('0x1cc'),_0x5f374f[_0x8d32('0x24')]);hopperUtils[_0x8d32('0x1cd')](_0x5f374f[_0x8d32('0x1cb')])[_0x8d32('0x3e')](this[_0x8d32('0x1ce')](_0x5f374f))[_0x8d32('0x3e')](mergeDataErlangB(_0x5f374f))[_0x8d32('0x3e')](this[_0x8d32('0x1cf')](_0x5f374f))[_0x8d32('0xa0')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x5f374f));}else if(!ifInterval(_0x5f374f[_0x8d32('0x1cb')],_0x5f374f[_0x8d32('0x24')])){_0x5f374f[_0x8d32('0x1c7')]=0x0;_0x5f374f[_0x8d32('0x24')]=moment()['format'](_0x8d32('0xc5'));loggerPredictive['info'](_0x5f374f[_0x8d32('0x48')],_0x8d32('0x1d0'),_0x5f374f[_0x8d32('0x24')]);clearInterval(_0x5f374f[_0x8d32('0x65')]);_0x5f374f[_0x8d32('0x65')]=undefined;hopperUtils[_0x8d32('0x1cd')](_0x5f374f[_0x8d32('0x1cb')])[_0x8d32('0x3e')](this[_0x8d32('0x1ce')](_0x5f374f))['then'](mergeDataErlangB(_0x5f374f))[_0x8d32('0x3e')](this[_0x8d32('0x1cf')](_0x5f374f))[_0x8d32('0xa0')](loggerCatchPredictive(_0x8d32('0x1d1'),_0x5f374f));}else if(_0x5f374f[_0x8d32('0x1be')]&&_0x4ed756<_0x5f374f[_0x8d32('0x1be')]-_0x53831a){clearPredictiveAttributes(_0x5f374f);loggerPredictive[_0x8d32('0x4b')](_0x5f374f[_0x8d32('0x48')],_0x8d32('0x1d2'),_0x4ed756,_0x8d32('0x1d3'),_0x5f374f[_0x8d32('0x1be')],'-',_0x53831a,'=',_0x5f374f['predictiveIntervalAvailable']-_0x53831a,')');}else if(_0x5f374f[_0x8d32('0x1be')]&&_0x4ed756>_0x5f374f[_0x8d32('0x1be')]+_0x4cf290){clearPredictiveAttributes(_0x5f374f);loggerPredictive[_0x8d32('0x4b')](_0x5f374f[_0x8d32('0x48')],_0x8d32('0x1d2'),_0x4ed756,_0x8d32('0x1d4'),_0x5f374f[_0x8d32('0x1be')],'+',_0x4cf290,'=',_0x5f374f[_0x8d32('0x1be')]+_0x4cf290,')');}};Dialer[_0x8d32('0x18')][_0x8d32('0x1ce')]=function(_0x9faeb9){var _0x11b779=this;return function(_0x160011){return new Promise(function(_0x159bc5,_0x25a929){_[_0x8d32('0x61')](_0x9faeb9,_0x160011[0x0]);if(checkGetDataPredictive(_0x160011[0x0])){var _0x8ad88a=_0x9faeb9['predictiveIntervalAvailable']=_0x9faeb9['talking']+_0x9faeb9[_0x8d32('0x13e')];var _0x38ed1a=_0x9faeb9[_0x8d32('0x1cb')]*0x3c;var _0x390f85=_0x160011[0x0][_0x8d32('0x56')]+_0x160011[0x0][_0x8d32('0x54')];var _0x34965a=(_0x160011[0x0]['predictiveIntervalAnsweredCalls']+_0x160011[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x160011[0x0][_0x8d32('0x52')])/_0x160011[0x0]['predictiveIntervalTotalCalls'];_0x9faeb9[_0x8d32('0x1d5')]=_0x34965a>0x0?_0x34965a:0x1;switch(_0x9faeb9[_0x8d32('0x1c4')]){case'dropRate':var _0xbdebee=_0x9faeb9[_0x8d32('0x1d6')]/0x64;return _0x11b779[_0x8d32('0x1d7')](_0x8ad88a,_0x38ed1a,_0x390f85,_0x34965a,_0xbdebee)[_0x8d32('0x3e')](function(_0x138538){return _0x159bc5(_0x138538);});case'agentBusyFactor':var _0x34d8d7=_0x9faeb9[_0x8d32('0x1d6')]/0x64;return _0x11b779[_0x8d32('0x1d8')](_0x8ad88a,_0x38ed1a,_0x390f85,_0x34965a,_0x34d8d7)[_0x8d32('0x3e')](function(_0x18f4c5){return _0x159bc5(_0x18f4c5);});default:return _0x25a929(msgResponse('[getDataPredictive]','Failure','Unknown\x20Predictive'));}}else{return _0x25a929(msgResponse(_0x8d32('0x1d9'),'Failure',_0x8d32('0x1da')));}});};};Dialer[_0x8d32('0x18')]['getDataPredictiveOld']=function(_0x4e1394){var _0x51fac1=this;return function(_0x17801a){return new Promise(function(_0xd5bb2d,_0x27dfd1){_[_0x8d32('0x61')](_0x4e1394,_0x17801a[0x0]);if(checkGetDataPredictive(_0x17801a[0x0])){loggerPredictive['info'](JSON[_0x8d32('0x74')](_0x17801a[0x0]));if(_0x4e1394['dialPredictiveOptimization']==='dropRate'){return _0x51fac1[_0x8d32('0x153')](_0x4e1394['id'])[_0x8d32('0x3e')](function(_0x1f72d6){var _0x32249e=_0x4e1394[_0x8d32('0x1db')]-_0x1f72d6[0x0][_0x8d32('0x1dc')];var _0x281dc6=_0x4e1394[_0x8d32('0x1cb')]*0x3c;var _0x4a3f50=_0x17801a[0x0][_0x8d32('0x56')]+_0x17801a[0x0][_0x8d32('0x54')];var _0x432e53=(_0x17801a[0x0][_0x8d32('0x50')]+_0x17801a[0x0][_0x8d32('0x51')]+_0x17801a[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x17801a[0x0][_0x8d32('0x4e')];var _0x359324=_0x4e1394['dialPredictiveOptimizationPercentage']/0x64;_0x4e1394[_0x8d32('0x1dd')]=_0x1f72d6[0x0]['outboundQueuePauses']||0x0;_0x4e1394['predictiveIntervalHitRate']=_0x432e53>0x0?_0x432e53:0x1;return _0x51fac1[_0x8d32('0x1d7')](_0x32249e,_0x281dc6,_0x4a3f50,_0x432e53,_0x359324);})[_0x8d32('0x3e')](function(_0x120f95){return _0xd5bb2d(_0x120f95);})['catch'](function(_0x3e1927){return _0x27dfd1(msgResponse(_0x8d32('0x1de'),_0x8d32('0x92'),JSON[_0x8d32('0x74')](_0x3e1927)));});}if(_0x4e1394[_0x8d32('0x1c4')]===_0x8d32('0x1df')){return _0x51fac1[_0x8d32('0x153')](_0x4e1394['id'])['then'](function(_0x2b0928){var _0x1641e3=_0x4e1394[_0x8d32('0x1db')]-_0x2b0928[0x0]['outboundQueuePauses'];var _0x1640b6=_0x4e1394[_0x8d32('0x1cb')]*0x3c;var _0x5a2df7=_0x17801a[0x0][_0x8d32('0x56')]+_0x17801a[0x0][_0x8d32('0x54')];var _0x1b24d0=(_0x17801a[0x0]['predictiveIntervalAnsweredCalls']+_0x17801a[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x17801a[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x17801a[0x0][_0x8d32('0x4e')];var _0x37eba1=_0x4e1394['dialPredictiveOptimizationPercentage']/0x64;_0x4e1394[_0x8d32('0x1dd')]=_0x2b0928[0x0]['outboundQueuePauses']||0x0;_0x4e1394[_0x8d32('0x1d5')]=_0x1b24d0>0x0?_0x1b24d0:0x1;return _0x51fac1[_0x8d32('0x1d8')](_0x1641e3,_0x1640b6,_0x5a2df7,_0x1b24d0,_0x37eba1);})['then'](function(_0x5b0517){return _0xd5bb2d(_0x5b0517);})[_0x8d32('0xa0')](function(_0x177f7b){return _0x27dfd1(msgResponse('[CatchErlangB]','Failure',JSON['stringify'](_0x177f7b)));});}}else{return _0x27dfd1(msgResponse(_0x8d32('0x1d9'),_0x8d32('0x92'),_0x8d32('0x1da')));}});};};Dialer[_0x8d32('0x18')][_0x8d32('0x1cf')]=function(_0x4908bc){var _0x1bd942=this;return function(){var _0x168073=0x0;var _0x1d2d39=Math[_0x8d32('0x1c0')](_0x4908bc[_0x8d32('0x1e0')]*0x3e8);if(_0x1d2d39>0x0){_0x1d2d39=_0x1d2d39<0x64?0x64:_0x1d2d39;loggerPredictive[_0x8d32('0x4b')](_0x4908bc['name'],_0x8d32('0x1e1'),_0x1d2d39,_0x8d32('0x1e2'));_0x4908bc['handlePredictive']=setInterval(function(){_0x1bd942['handlePredictive'](_0x4908bc);loggerPredictiveCalls[_0x8d32('0x4b')](_0x8d32('0x1e3'),_0x168073+=0x1);},_0x1d2d39);}else{loggerPredictive['info'](_0x4908bc['name'],_0x8d32('0x1e4'));}};};Dialer[_0x8d32('0x18')][_0x8d32('0x1e5')]=function(_0x40c694,_0x4e4d5e){var _0x45afa0=this;return function(_0x3573d3){if(_['isEmpty'](_0x3573d3)){if(_[_0x8d32('0xf9')](_0x4e4d5e[_0x8d32('0x158')])||!_0x4e4d5e['recallme']){if(_0x40c694[_0x8d32('0xb0')]===_0x8d32('0xb6')){_0x40c694['queueStatusComplete']=_[_0x8d32('0x40')](_0x40c694[_0x8d32('0x71')])?!![]:_0x40c694[_0x8d32('0x71')];var _0x3a711d=uuid['v4']();_0x45afa0['actions'][_0x3a711d]=new Action(_0x40c694,_0x4e4d5e,_0x3a711d);loggerBooked['info'](_0x8d32('0x1e6'),_0x3a711d,_0x8d32('0x1e7'),JSON[_0x8d32('0x74')](_0x40c694[_0x8d32('0x71')]),_0x8d32('0x1e8'),_0x40c694['name']);if(_0x40c694[_0x8d32('0x71')]){_0x40c694['queueStatusComplete']=![];_0x45afa0[_0x8d32('0x27')][_0x45afa0['actions'][_0x3a711d]['queue']]=[];ami[_0x8d32('0x9b')]({'actionid':_0x3a711d,'action':'queuestatus','queue':_0x40c694['name']})[_0x8d32('0xa0')](function(){_0x45afa0['updateOriginated'](_0x40c694);hopperUtils[_0x8d32('0xec')]({'active':![],'ContactId':_0x45afa0['actions'][_0x3a711d][_0x8d32('0xee')],'ListId':_0x45afa0[_0x8d32('0xf0')][_0x3a711d][_0x8d32('0xdb')],'VoiceQueueId':_0x45afa0['actions'][_0x3a711d][_0x8d32('0xdc')]||undefined,'CampaignId':_0x45afa0[_0x8d32('0xf0')][_0x3a711d][_0x8d32('0xdd')]||undefined})['catch'](loggerCatch(_0x8d32('0x1e9')));delete _0x45afa0[_0x8d32('0xf0')][_0x3a711d];});}else{loggerBooked['info'](_0x8d32('0x1ea'),JSON[_0x8d32('0x74')](_0x40c694['queueStatusComplete']),'Queue:\x20',_0x40c694[_0x8d32('0x48')]);_0x45afa0[_0x8d32('0xcc')](_0x40c694);hopperUtils[_0x8d32('0xec')]({'active':![],'ContactId':_0x45afa0['actions'][_0x3a711d]['ContactId'],'ListId':_0x45afa0[_0x8d32('0xf0')][_0x3a711d][_0x8d32('0xdb')],'VoiceQueueId':_0x45afa0['actions'][_0x3a711d]['VoiceQueueId']||undefined,'CampaignId':_0x45afa0[_0x8d32('0xf0')][_0x3a711d]['CampaignId']||undefined})[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x1e9')));delete _0x45afa0[_0x8d32('0xf0')][_0x3a711d];}}else{return _0x45afa0['actionOriginate'](_0x40c694,_0x4e4d5e);}}else{if(utils['getSeconds'](undefined,_0x4e4d5e['scheduledat'])<_0x40c694[_0x8d32('0x1eb')]*0x3c){if(_0x4e4d5e[_0x8d32('0x15d')]&&!_0x4e4d5e[_0x8d32('0x15d')][_0x8d32('0x1ec')]){_0x45afa0[_0x8d32('0xfd')][_0x8d32('0xfe')](_0x4e4d5e['id'])[_0x8d32('0x1a')](function(){_0x45afa0[_0x8d32('0xcc')](_0x40c694);});}else{hopperUtils['unlockContact']({'active':![]},_0x4e4d5e['id'],0x1)['finally'](function(){_0x45afa0[_0x8d32('0xcc')](_0x40c694);});}}else{_0x40c694[_0x8d32('0x1ed')]+=0x1;_0x45afa0[_0x8d32('0xcc')](_0x40c694);if(_0x40c694[_0x8d32('0x1ee')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4e4d5e['ContactId'],'ListId':_0x4e4d5e[_0x8d32('0xdb')],'VoiceQueueId':_0x4e4d5e['VoiceQueueId']||undefined,'CampaignId':_0x4e4d5e[_0x8d32('0xdd')]||undefined})[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x1ef')));hopperUtils[_0x8d32('0xe2')](createObjHistory(_0x40c694,_0x4e4d5e,utils[_0x8d32('0x6c')][_0x8d32('0x1f0')],0x17,_0x8d32('0x1f1')))[_0x8d32('0xa0')](loggerCatch(_0x8d32('0x1f2')));}else{_0x45afa0[_0x8d32('0x11c')](createObjHistory(_0x40c694,_0x4e4d5e,utils['CAMPAIGN_STATUS']['RECALL_TIMEOUT'],0x16,_0x8d32('0x1f3')),_0x8d32('0x1f4'),_0x8d32('0x1f5'));}}}}else{_0x40c694[_0x8d32('0x1f6')]+=0x1;_0x45afa0['saveInDb'](createObjHistory(_0x40c694,_0x4e4d5e,utils['CAMPAIGN_STATUS'][_0x8d32('0x1f7')],0xd,_0x8d32('0x1f8')),'[Originate][historyBlacklist]',_0x8d32('0x1f9'));throw _0x8d32('0x1fa');}};};Dialer[_0x8d32('0x18')][_0x8d32('0x15e')]=function(_0x5b990b){var _0x3929ec=this;var _0x1b9a9b=_0x5b990b[_0x8d32('0x1fb')]-_0x5b990b[_0x8d32('0x7f')];emitCampaignSummary(_0x5b990b);if(_0x1b9a9b>0x0&&_0x5b990b[_0x8d32('0x69')]==0x0){if(_0x1b9a9b>this[_0x8d32('0x1fc')]){_0x1b9a9b=this[_0x8d32('0x1fc')];}_0x5b990b[_0x8d32('0x69')]=0x1;hopperUtils[_0x8d32('0x1fd')](_0x5b990b,_0x1b9a9b)[_0x8d32('0x3e')](function(_0x3fae18){_0x5b990b['temp']=0x0;if(_0x3fae18){if(!utils[_0x8d32('0x1fe')](_0x3fae18)){_0x5b990b[_0x8d32('0x6a')]=utils[_0x8d32('0x6c')]['NO_AVAILABLE_CONTACTS'];logger['info']('[getContactCampaign2][Empty]'+_0x5b990b[_0x8d32('0x48')]);}else{_0x5b990b[_0x8d32('0x7f')]+=_0x3fae18[_0x8d32('0x103')];_0x5b990b['message']=utils[_0x8d32('0x6c')][_0x8d32('0x1ff')];for(var _0x1ee09f=0x0;_0x1ee09f<_0x3fae18[_0x8d32('0x103')];_0x1ee09f+=0x1){_0x5b990b[_0x8d32('0x200')]+=0x1;if(_['isNil'](_0x3fae18[_0x1ee09f])||_[_0x8d32('0xf9')](_0x3fae18[_0x1ee09f][_0x8d32('0x17a')])||_[_0x8d32('0xf9')](_0x3fae18[_0x1ee09f][_0x8d32('0x160')])){_0x3929ec[_0x8d32('0x156')]('[actionOriginate]\x20',_0x5b990b,_0x3fae18[_0x1ee09f]);}else{hopperUtils[_0x8d32('0x201')](_[_0x8d32('0xfa')](_0x3fae18[_0x1ee09f],[_0x8d32('0xdd'),'phone']))[_0x8d32('0x3e')](_0x3929ec['checkContactBlack'](_0x5b990b,_0x3fae18[_0x1ee09f]))[_0x8d32('0xa0')](_0x3929ec[_0x8d32('0x202')](_0x8d32('0x203'),_0x5b990b));}}}}})[_0x8d32('0xa0')](loggerGetContactDialer(_0x8d32('0x204'),_0x5b990b,_0x1b9a9b));}};Dialer[_0x8d32('0x18')]['handlePower']=function(_0x1c5a9a,_0x4e7a74){var _0x2e38c2=this;var _0xecb6df=[];if(_0x4e7a74<0x1||_0x1c5a9a['dialMethod']===_0x8d32('0xb6')){_0x4e7a74=0x1;}var _0x25b337=Math[_0x8d32('0x1c0')](_0x1c5a9a[_0x8d32('0x13e')]*_0x4e7a74)-_0x1c5a9a[_0x8d32('0x7f')];if(_0x1c5a9a[_0x8d32('0x205')]>0x0){var _0x406626=_0x1c5a9a[_0x8d32('0x205')]-_0x1c5a9a['originated']-_0x1c5a9a[_0x8d32('0x206')]-_0x1c5a9a[_0x8d32('0x140')];if(_0x25b337>_0x406626){_0x25b337=_0x406626;}}if(_0x25b337>0x0&&_0x1c5a9a[_0x8d32('0x69')]==0x0){if(_0x1c5a9a[_0x8d32('0xb0')]===_0x8d32('0xb6')){_0x25b337=0x1;}if(_0x25b337>this[_0x8d32('0x1fc')]){_0x25b337=this[_0x8d32('0x1fc')];}for(var _0x338300 in this[_0x8d32('0x1e')]){if(typeof this[_0x8d32('0x1e')][_0x338300]!==_0x8d32('0xa8')){if(this[_0x8d32('0x1e')][_0x338300]['state']==='not_inuse'&&this[_0x8d32('0x1e')][_0x338300][_0x8d32('0x85')]===_0x8d32('0x86')){_0xecb6df['push'](this[_0x8d32('0x1e')][_0x338300]['id']);}}}_0x1c5a9a[_0x8d32('0x69')]=0x1;hopperUtils[_0x8d32('0x207')](_0x1c5a9a,_0xecb6df,_0x25b337)[_0x8d32('0x3e')](function(_0x2d8b80){_0x1c5a9a['temp']=0x0;if(_0x2d8b80){if(!utils[_0x8d32('0x1fe')](_0x2d8b80)){hopperUtils[_0x8d32('0x208')](_0x1c5a9a)[_0x8d32('0x3e')](sendMessageReschedule(_0x1c5a9a))[_0x8d32('0xa0')](loggerCatch('[countReScheduled]\x20'));}else{_0x1c5a9a[_0x8d32('0x7f')]+=_0x2d8b80['length'];_0x1c5a9a[_0x8d32('0x6a')]=_0x1c5a9a['dialMethod']===_0x8d32('0xb6')?utils[_0x8d32('0x6c')][_0x8d32('0x209')]:utils[_0x8d32('0x6c')][_0x8d32('0x1ff')];for(var _0x643654=0x0;_0x643654<_0x2d8b80[_0x8d32('0x103')];_0x643654+=0x1){if(_['isNil'](_0x2d8b80[_0x643654])||_[_0x8d32('0xf9')](_0x2d8b80[_0x643654][_0x8d32('0x17a')])||_['isNil'](_0x2d8b80[_0x643654][_0x8d32('0x160')])){_0x2e38c2[_0x8d32('0x156')]('[actionOriginate]\x20',_0x1c5a9a,_0x2d8b80[_0x643654]);}else{hopperUtils[_0x8d32('0x20a')](_[_0x8d32('0xfa')](_0x2d8b80[_0x643654],[_0x8d32('0xdc'),_0x8d32('0x160')]))[_0x8d32('0x3e')](_0x2e38c2[_0x8d32('0x1e5')](_0x1c5a9a,_0x2d8b80[_0x643654]))[_0x8d32('0xa0')](_0x2e38c2[_0x8d32('0x202')](_0x8d32('0x20b'),_0x1c5a9a));}}}}})[_0x8d32('0xa0')](loggerGetContactDialer(_0x8d32('0x20c'),_0x1c5a9a,_0x25b337));}};Dialer[_0x8d32('0x18')]['handlePredictive']=function(_0x45f4c0){if(_0x45f4c0[_0x8d32('0x205')]>0x0){var _0x193974=_0x45f4c0[_0x8d32('0x205')]-_0x45f4c0['originated']-_0x45f4c0['talking'];if(_0x193974>0x0&&_0x45f4c0[_0x8d32('0x69')]==0x0){this[_0x8d32('0x20d')](_0x45f4c0);}else{loggerPredictiveCalls[_0x8d32('0x4b')](_0x8d32('0x20e'));}}else{this['tryOriginatePredictive'](_0x45f4c0);}};Dialer[_0x8d32('0x18')]['tryOriginatePredictive']=function(_0x547389){var _0x3e920c=this;var _0x27ca9f=[];_0x547389[_0x8d32('0x7f')]+=0x1;for(var _0x5786d2 in this[_0x8d32('0x1e')]){if(typeof this[_0x8d32('0x1e')][_0x5786d2]!==_0x8d32('0xa8')){if(this['agents'][_0x5786d2][_0x8d32('0xdf')]==='not_inuse'&&this['agents'][_0x5786d2]['status']===_0x8d32('0x86')){_0x27ca9f[_0x8d32('0x9a')](this[_0x8d32('0x1e')][_0x5786d2]['id']);}}}_0x547389[_0x8d32('0x69')]=0x1;return this[_0x8d32('0x207')](_0x547389['id'],_0x27ca9f,0x1,_0x547389['dialOrderByScheduledAt'],_0x547389)[_0x8d32('0x3e')](function(_0xad851d){_0x547389['temp']=0x1;if(_0xad851d){if(!utils[_0x8d32('0x1fe')](_0xad851d)){utils[_0x8d32('0x68')](_0x547389,0x1,0x0);return hopperUtils[_0x8d32('0x208')](_0x547389)['then'](sendMessageReschedule(_0x547389))['catch'](loggerCatch(_0x8d32('0x20f')));}else{_0x547389[_0x8d32('0x6a')]=utils[_0x8d32('0x6c')][_0x8d32('0x1ff')];if(_[_0x8d32('0xf9')](_0xad851d[0x0])||_[_0x8d32('0xf9')](_0xad851d[0x0][_0x8d32('0x17a')])||_[_0x8d32('0xf9')](_0xad851d[0x0][_0x8d32('0x160')])){_0x3e920c[_0x8d32('0x156')](_0x8d32('0x20b'),_0x547389,_0xad851d[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0x8d32('0xfa')](_0xad851d[0x0],['VoiceQueueId',_0x8d32('0x160')]))[_0x8d32('0x3e')](_0x3e920c[_0x8d32('0x1e5')](_0x547389,_0xad851d[0x0]))[_0x8d32('0xa0')](_0x3e920c[_0x8d32('0x202')](_0x8d32('0x210'),_0x547389));}}}})['catch'](loggerGetContactDialer(_0x8d32('0x211'),_0x547389,0x1));};Dialer[_0x8d32('0x18')]['abandonmentRate']=function(_0x3e1318,_0x4b9dce,_0x5828d8,_0x43f119,_0x44cba5,_0x1d69c3){loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x212'));loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x213'),_0x3e1318);loggerPredictive[_0x8d32('0x4b')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4b9dce);loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x214'),_0x5828d8);loggerPredictive[_0x8d32('0x4b')]('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',_0x43f119);loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x215'),_0x44cba5);loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x57'));return new Promise(function(_0x2d012a,_0x2d1c97){if(_0x3e1318<=0x0||isNaN(_0x3e1318)){return _0x2d1c97(msgResponse('[abandonmentRate]',_0x8d32('0x83'),'m\x20=\x20'+_0x3e1318));}if(_0x5828d8<=0x0||isNaN(_0x5828d8)){return _0x2d1c97(msgResponse(_0x8d32('0x216'),_0x8d32('0x83'),_0x8d32('0x217')+_0x5828d8));}if(_0x43f119<=0x0||isNaN(_0x43f119)){return _0x2d1c97(msgResponse(_0x8d32('0x216'),_0x8d32('0x83'),_0x8d32('0x218')+_0x43f119));}if(_0x4b9dce<=0x0||isNaN(_0x4b9dce)){return _0x2d1c97(msgResponse('[abandonmentRate]',_0x8d32('0x83'),_0x8d32('0x219')+_0x4b9dce));}if(_0x44cba5<=0x0||isNaN(_0x44cba5)){return _0x2d1c97(msgResponse('[abandonmentRate]',_0x8d32('0x83'),_0x8d32('0x21a')+_0x44cba5));}_0x1d69c3=_0x1d69c3||0x0;var _0x517749=0x1/_0x5828d8;var _0x16a16d=0x0;var _0x222975=0x0;var _0x22558a=0x0;var _0x36b461=0x0;for(var _0x52440c=0x0;_0x22558a<_0x44cba5;_0x52440c+=0x1){_0x222975=_0x52440c/_0x4b9dce;_0x16a16d=(_0x43f119*_0x222975+_0x1d69c3)/_0x517749;_0x22558a=utils['erlangb'](_0x16a16d,_0x3e1318);_0x36b461=_0x16a16d/_0x3e1318*(0x1-utils[_0x8d32('0x21b')](_0x16a16d,_0x3e1318));}return _0x2d012a({'erlangCalls':_0x52440c,'erlangCallToSecond':_0x4b9dce/_0x52440c,'erlangAbandonmentRate':_0x22558a,'erlangBusyFactor':_0x36b461});});};Dialer[_0x8d32('0x18')][_0x8d32('0x1d8')]=function(_0x54a541,_0x58a89f,_0x3914f7,_0x5297a2,_0x3d6c66,_0x24cfca){loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x21c'));loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x213'),_0x54a541);loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x21d'),_0x58a89f);loggerPredictive[_0x8d32('0x4b')]('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',_0x3914f7);loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x21e'),_0x5297a2);loggerPredictive['info'](_0x8d32('0x21f'),_0x3d6c66);loggerPredictive[_0x8d32('0x4b')](_0x8d32('0x57'));return new Promise(function(_0x3fe20e,_0x2b8c31){if(_0x54a541<=0x0||isNaN(_0x54a541)){return _0x2b8c31(msgResponse(_0x8d32('0x220'),_0x8d32('0x83'),_0x8d32('0x221')+_0x54a541));}if(_0x3914f7<=0x0||isNaN(_0x3914f7)){return _0x2b8c31(msgResponse(_0x8d32('0x220'),_0x8d32('0x83'),_0x8d32('0x217')+_0x3914f7));}if(_0x5297a2<=0x0||isNaN(_0x5297a2)){return _0x2b8c31(msgResponse(_0x8d32('0x220'),_0x8d32('0x83'),_0x8d32('0x218')+_0x5297a2));}if(_0x58a89f<=0x0||isNaN(_0x58a89f)){return _0x2b8c31(msgResponse(_0x8d32('0x220'),'Error','interval\x20=\x20'+_0x58a89f));}if(_0x3d6c66<=0x0||isNaN(_0x3d6c66)){return _0x2b8c31(msgResponse('[busyFactor]',_0x8d32('0x83'),_0x8d32('0x222')+_0x3d6c66));}_0x24cfca=_0x24cfca||0x0;var _0x524558=0x1/_0x3914f7;var _0x326fc0=0x0;var _0x4496fe=0x0;var _0x529306=0x0;var _0x59cb43=0x0;for(var _0x40c638=0x0;_0x59cb43<_0x3d6c66;_0x40c638+=0x1){_0x4496fe=_0x40c638/_0x58a89f;_0x326fc0=(_0x5297a2*_0x4496fe+_0x24cfca)/_0x524558;_0x529306=utils[_0x8d32('0x21b')](_0x326fc0,_0x54a541);_0x59cb43=_0x326fc0/_0x54a541*(0x1-utils[_0x8d32('0x21b')](_0x326fc0,_0x54a541));}return _0x3fe20e({'erlangCalls':_0x40c638,'erlangCallToSecond':_0x58a89f/_0x40c638,'erlangAbandonmentRate':_0x529306,'erlangBusyFactor':_0x59cb43});});};module[_0x8d32('0x223')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index f4a0f5d..fbb2021 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5268=['moment','isNil','string','uniqueid','phone','Contact','lastName','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','voiceQueue','dialCutDigit','substring','prototype','getQueue','util','lodash'];(function(_0xbe31d1,_0x126345){var _0x7bd03=function(_0xbcacac){while(--_0xbcacac){_0xbe31d1['push'](_0xbe31d1['shift']());}};_0x7bd03(++_0x126345);}(_0x5268,0x193));var _0x8526=function(_0x56e2cb,_0x11a7b1){_0x56e2cb=_0x56e2cb-0x0;var _0x3d84a6=_0x5268[_0x56e2cb];return _0x3d84a6;};'use strict';var util=require(_0x8526('0x0'));var _=require(_0x8526('0x1'));var moment=require(_0x8526('0x2'));function checkNameSurname(_0x3cfe33,_0x2c5336,_0x438fe4){var _0x549d5c='';if(!_[_0x8526('0x3')](_0x2c5336)&&'string'===typeof _0x2c5336){_0x549d5c+=_0x2c5336;}if(!_[_0x8526('0x3')](_0x438fe4)&&_0x8526('0x4')===typeof _0x438fe4){_0x549d5c+='\x20'+_0x438fe4;}if(_0x549d5c!==''){return _0x549d5c;}return _0x3cfe33;}function Action(_0x4620f7,_0x28e6c4,_0x2cf479){this['voiceQueue']=_0x4620f7;this[_0x8526('0x5')]=_0x2cf479||undefined;this['name']=checkNameSurname(_0x28e6c4['Contact'][_0x8526('0x6')],_0x28e6c4[_0x8526('0x7')]['firstName'],_0x28e6c4[_0x8526('0x7')][_0x8526('0x8')]);this['number']=_0x28e6c4[_0x8526('0x6')];this[_0x8526('0x9')]=_0x4620f7[_0x8526('0xa')];this[_0x8526('0xb')]=_0x28e6c4[_0x8526('0xb')]||![];this['type']=_0x4620f7[_0x8526('0xc')];this[_0x8526('0xd')]=_0x4620f7[_0x8526('0xd')]||0x3;this[_0x8526('0xe')]=_0x28e6c4[_0x8526('0xe')];this[_0x8526('0xf')]=_0x28e6c4['countbusyretry'];this['countcongestionretry']=_0x28e6c4[_0x8526('0x10')];this['countnoanswerretry']=_0x28e6c4[_0x8526('0x11')];this[_0x8526('0x12')]=_0x28e6c4[_0x8526('0x12')];this['countdropretry']=_0x28e6c4['countdropretry'];this[_0x8526('0x13')]=_0x28e6c4[_0x8526('0x13')];this[_0x8526('0x14')]=_0x28e6c4[_0x8526('0x14')];this[_0x8526('0x15')]=_0x28e6c4[_0x8526('0x15')];this[_0x8526('0x16')]=_0x28e6c4[_0x8526('0x16')];this[_0x8526('0x17')]=_0x28e6c4[_0x8526('0x17')];this[_0x8526('0x18')]=_0x28e6c4['UserId'];this[_0x8526('0x19')]=_0x28e6c4[_0x8526('0x19')];this['CampaignId']=_0x28e6c4[_0x8526('0x1a')];this[_0x8526('0x1b')]=_0x28e6c4['id'];this[_0x8526('0x1c')]=_0x28e6c4['Contact'][_0x8526('0x1d')]||'';this[_0x8526('0x1e')]=moment()[_0x8526('0x1f')](_0x8526('0x20'));this[_0x8526('0x21')]=_0x28e6c4[_0x8526('0x21')];this['callbackuniqueid']=_0x28e6c4[_0x8526('0x22')];this[_0x8526('0x23')]=_0x28e6c4[_0x8526('0x23')];this[_0x8526('0x24')]=_0x28e6c4['recallme'];this[_0x8526('0x25')]='';this[_0x8526('0x26')]='';}Action['prototype'][_0x8526('0x27')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x8526('0xa')],this[_0x8526('0x28')][_0x8526('0x29')]>0x0?this['number'][_0x8526('0x2a')](this[_0x8526('0x28')][_0x8526('0x29')]):this['number']);};Action[_0x8526('0x2b')][_0x8526('0x2c')]=function(){return this[_0x8526('0x9')];};module['exports']=Action; \ No newline at end of file +var _0x3414=['format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','getQueue','exports','util','lodash','moment','string','isNil','name','Contact','firstName','lastName','number','phone','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime'];(function(_0x3b8631,_0x159763){var _0x452557=function(_0x15e9f8){while(--_0x15e9f8){_0x3b8631['push'](_0x3b8631['shift']());}};_0x452557(++_0x159763);}(_0x3414,0xea));var _0x4341=function(_0x5d06a9,_0x304a55){_0x5d06a9=_0x5d06a9-0x0;var _0x607055=_0x3414[_0x5d06a9];return _0x607055;};'use strict';var util=require(_0x4341('0x0'));var _=require(_0x4341('0x1'));var moment=require(_0x4341('0x2'));function checkNameSurname(_0x4c7e81,_0x5219e9,_0x26a6d2){var _0x223def='';if(!_['isNil'](_0x5219e9)&&_0x4341('0x3')===typeof _0x5219e9){_0x223def+=_0x5219e9;}if(!_[_0x4341('0x4')](_0x26a6d2)&&_0x4341('0x3')===typeof _0x26a6d2){_0x223def+='\x20'+_0x26a6d2;}if(_0x223def!==''){return _0x223def;}return _0x4c7e81;}function Action(_0xbec27d,_0x9934ea,_0x53be08){this['voiceQueue']=_0xbec27d;this['uniqueid']=_0x53be08||undefined;this[_0x4341('0x5')]=checkNameSurname(_0x9934ea[_0x4341('0x6')]['phone'],_0x9934ea[_0x4341('0x6')][_0x4341('0x7')],_0x9934ea[_0x4341('0x6')][_0x4341('0x8')]);this[_0x4341('0x9')]=_0x9934ea[_0x4341('0xa')];this['queue']=_0xbec27d['name'];this[_0x4341('0xb')]=_0x9934ea['active']||![];this[_0x4341('0xc')]=_0xbec27d[_0x4341('0xc')];this[_0x4341('0xd')]=_0xbec27d[_0x4341('0xd')]||0x3;this['scheduledat']=_0x9934ea[_0x4341('0xe')];this[_0x4341('0xf')]=_0x9934ea[_0x4341('0xf')];this[_0x4341('0x10')]=_0x9934ea[_0x4341('0x10')];this[_0x4341('0x11')]=_0x9934ea[_0x4341('0x11')];this[_0x4341('0x12')]=_0x9934ea[_0x4341('0x12')];this['countdropretry']=_0x9934ea['countdropretry'];this[_0x4341('0x13')]=_0x9934ea[_0x4341('0x13')];this[_0x4341('0x14')]=_0x9934ea[_0x4341('0x14')];this[_0x4341('0x15')]=_0x9934ea[_0x4341('0x15')];this[_0x4341('0x16')]=_0x9934ea[_0x4341('0x16')];this[_0x4341('0x17')]=_0x9934ea[_0x4341('0x17')];this[_0x4341('0x18')]=_0x9934ea[_0x4341('0x18')];this[_0x4341('0x19')]=_0x9934ea[_0x4341('0x19')];this[_0x4341('0x1a')]=_0x9934ea[_0x4341('0x1a')];this[_0x4341('0x1b')]=_0x9934ea['id'];this[_0x4341('0x1c')]=_0x9934ea['Contact'][_0x4341('0x7')]||'';this[_0x4341('0x1d')]=moment()[_0x4341('0x1e')](_0x4341('0x1f'));this['callback']=_0x9934ea[_0x4341('0x20')];this[_0x4341('0x21')]=_0x9934ea[_0x4341('0x21')];this[_0x4341('0x22')]=_0x9934ea[_0x4341('0x22')];this[_0x4341('0x23')]=_0x9934ea[_0x4341('0x23')];this['originatecalleridnum']='';this[_0x4341('0x24')]='';}Action[_0x4341('0x25')]['getCaller']=function(){return util['format'](_0x4341('0x26'),this['name'],this[_0x4341('0x27')][_0x4341('0x28')]>0x0?this[_0x4341('0x9')][_0x4341('0x29')](this[_0x4341('0x27')]['dialCutDigit']):this[_0x4341('0x9')]);};Action['prototype'][_0x4341('0x2a')]=function(){return this['queue'];};module[_0x4341('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 3cd68f8..242d246 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5af9=['recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','moment','../utils','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat'];(function(_0x5ce766,_0x495d80){var _0x4a68f3=function(_0x39aa58){while(--_0x39aa58){_0x5ce766['push'](_0x5ce766['shift']());}};_0x4a68f3(++_0x495d80);}(_0x5af9,0x1ec));var _0x95af=function(_0x12b8ec,_0x1655be){_0x12b8ec=_0x12b8ec-0x0;var _0x21af77=_0x5af9[_0x12b8ec];return _0x21af77;};'use strict';var moment=require(_0x95af('0x0'));var utils=require(_0x95af('0x1'));function AgentComplete(_0x56ae3b,_0x532506){this['state']=0x4;this[_0x95af('0x2')]=_0x95af('0x3');this[_0x95af('0x4')]=_0x56ae3b[_0x95af('0x4')];this['type']=_0x56ae3b[_0x95af('0x5')];this[_0x95af('0x6')]=_0x56ae3b[_0x95af('0x5')]===_0x95af('0x7')?_0x95af('0x8'):_0x56ae3b['type'];this[_0x95af('0x9')]=_0x56ae3b[_0x95af('0x9')];this[_0x95af('0xa')]=_0x56ae3b['countcongestionretry'];this['countnoanswerretry']=_0x56ae3b[_0x95af('0xb')];this[_0x95af('0xc')]=_0x56ae3b[_0x95af('0x9')]+_0x56ae3b[_0x95af('0xa')]+_0x56ae3b['countnoanswerretry']+_0x56ae3b[_0x95af('0xd')]+_0x56ae3b[_0x95af('0xe')]+_0x56ae3b[_0x95af('0xf')]+_0x56ae3b[_0x95af('0x10')]+_0x56ae3b['countagentrejectretry'];this[_0x95af('0xd')]=_0x56ae3b[_0x95af('0xd')];this[_0x95af('0xe')]=_0x56ae3b[_0x95af('0xe')];this[_0x95af('0xf')]=_0x56ae3b[_0x95af('0xf')];this[_0x95af('0x10')]=_0x56ae3b[_0x95af('0x10')];this[_0x95af('0x11')]=_0x56ae3b[_0x95af('0x11')];this[_0x95af('0x12')]=_0x532506['uniqueid'];this[_0x95af('0x13')]=_0x56ae3b[_0x95af('0x14')];this['calleridnum']=_0x56ae3b[_0x95af('0x15')];this[_0x95af('0x16')]=_0x56ae3b[_0x95af('0x16')];this[_0x95af('0x17')]=_0x56ae3b[_0x95af('0x17')];this[_0x95af('0x18')]=_0x56ae3b['answertime'];this[_0x95af('0x19')]=moment()[_0x95af('0x1a')](_0x95af('0x1b'));this['ringtime']=utils[_0x95af('0x1c')](_0x56ae3b['responsetime'],_0x56ae3b[_0x95af('0x16')]);this[_0x95af('0x1d')]=utils[_0x95af('0x1c')](_0x56ae3b['answertime'],_0x56ae3b['responsetime']);this[_0x95af('0x1e')]=utils[_0x95af('0x1c')](this['endtime'],_0x56ae3b[_0x95af('0x18')]);this[_0x95af('0x8')]=_0x532506['queue'];this[_0x95af('0x1f')]=_0x532506[_0x95af('0x1f')];this['reason']=_0x532506[_0x95af('0x20')];this['callback']=_0x56ae3b[_0x95af('0x21')];this[_0x95af('0x22')]=_0x56ae3b['callbackuniqueid'];this[_0x95af('0x23')]=_0x56ae3b[_0x95af('0x23')];this[_0x95af('0x24')]=_0x56ae3b['recallme'];this[_0x95af('0x25')]=_0x56ae3b[_0x95af('0x25')];this['ListId']=_0x56ae3b['ListId'];this[_0x95af('0x26')]=_0x56ae3b[_0x95af('0x26')];this[_0x95af('0x27')]=_0x56ae3b[_0x95af('0x27')];this[_0x95af('0x28')]=_0x56ae3b[_0x95af('0x28')];this[_0x95af('0x29')]=_0x56ae3b[_0x95af('0x29')]||'';this['originatecalleridname']=_0x56ae3b[_0x95af('0x2a')]||'';this[_0x95af('0x2b')]=_0x56ae3b[_0x95af('0x2b')];}module['exports']=AgentComplete; \ No newline at end of file +var _0x79b4=['countabandonedretry','countagentrejectretry','uniqueid','calleridname','calleridnum','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','getSeconds','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countmachineretry','countnosuchnumberretry','countdropretry'];(function(_0x3d9631,_0xf02284){var _0x3ff3f5=function(_0xb511a1){while(--_0xb511a1){_0x3d9631['push'](_0x3d9631['shift']());}};_0x3ff3f5(++_0xf02284);}(_0x79b4,0x1de));var _0x479b=function(_0x25eacb,_0x37dd8c){_0x25eacb=_0x25eacb-0x0;var _0x2d0787=_0x79b4[_0x25eacb];return _0x2d0787;};'use strict';var moment=require(_0x479b('0x0'));var utils=require(_0x479b('0x1'));function AgentComplete(_0x2f0704,_0x9cb5bf){this[_0x479b('0x2')]=0x4;this[_0x479b('0x3')]=_0x479b('0x4');this[_0x479b('0x5')]=_0x2f0704[_0x479b('0x5')];this['type']=_0x2f0704[_0x479b('0x6')];this[_0x479b('0x7')]=_0x2f0704[_0x479b('0x6')]===_0x479b('0x8')?_0x479b('0x9'):_0x2f0704[_0x479b('0x6')];this['countbusyretry']=_0x2f0704['countbusyretry'];this[_0x479b('0xa')]=_0x2f0704[_0x479b('0xa')];this[_0x479b('0xb')]=_0x2f0704[_0x479b('0xb')];this[_0x479b('0xc')]=_0x2f0704[_0x479b('0xd')]+_0x2f0704[_0x479b('0xa')]+_0x2f0704[_0x479b('0xb')]+_0x2f0704['countnosuchnumberretry']+_0x2f0704['countdropretry']+_0x2f0704['countabandonedretry']+_0x2f0704[_0x479b('0xe')]+_0x2f0704['countagentrejectretry'];this[_0x479b('0xf')]=_0x2f0704[_0x479b('0xf')];this[_0x479b('0x10')]=_0x2f0704[_0x479b('0x10')];this[_0x479b('0x11')]=_0x2f0704[_0x479b('0x11')];this['countmachineretry']=_0x2f0704[_0x479b('0xe')];this['countagentrejectretry']=_0x2f0704[_0x479b('0x12')];this[_0x479b('0x13')]=_0x9cb5bf[_0x479b('0x13')];this[_0x479b('0x14')]=_0x2f0704['name'];this[_0x479b('0x15')]=_0x2f0704['number'];this['starttime']=_0x2f0704[_0x479b('0x16')];this[_0x479b('0x17')]=_0x2f0704[_0x479b('0x17')];this[_0x479b('0x18')]=_0x2f0704[_0x479b('0x18')];this[_0x479b('0x19')]=moment()[_0x479b('0x1a')](_0x479b('0x1b'));this[_0x479b('0x1c')]=utils['getSeconds'](_0x2f0704[_0x479b('0x17')],_0x2f0704[_0x479b('0x16')]);this[_0x479b('0x1d')]=utils[_0x479b('0x1e')](_0x2f0704['answertime'],_0x2f0704[_0x479b('0x17')]);this['talktime']=utils[_0x479b('0x1e')](this[_0x479b('0x19')],_0x2f0704[_0x479b('0x18')]);this[_0x479b('0x9')]=_0x9cb5bf[_0x479b('0x9')];this[_0x479b('0x1f')]=_0x9cb5bf[_0x479b('0x1f')];this[_0x479b('0x20')]=_0x9cb5bf['reason'];this[_0x479b('0x21')]=_0x2f0704[_0x479b('0x21')];this[_0x479b('0x22')]=_0x2f0704[_0x479b('0x22')];this[_0x479b('0x23')]=_0x2f0704[_0x479b('0x23')];this['recallme']=_0x2f0704[_0x479b('0x24')];this[_0x479b('0x25')]=_0x2f0704[_0x479b('0x25')];this[_0x479b('0x26')]=_0x2f0704[_0x479b('0x26')];this[_0x479b('0x27')]=_0x2f0704[_0x479b('0x27')];this['VoiceQueueId']=_0x2f0704[_0x479b('0x28')];this[_0x479b('0x29')]=_0x2f0704['CampaignId'];this['originatecalleridnum']=_0x2f0704[_0x479b('0x2a')]||'';this[_0x479b('0x2b')]=_0x2f0704[_0x479b('0x2b')]||'';this['agiafterat']=_0x2f0704['agiafterat'];}module[_0x479b('0x2c')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index fe4cfcd..7427d46 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7cdc=['statedesc','exports','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','calleridnum','responsetime','ringtime','holdtime','callback','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridname','state'];(function(_0x13c108,_0x56ab5c){var _0x17ff51=function(_0x54a66a){while(--_0x54a66a){_0x13c108['push'](_0x13c108['shift']());}};_0x17ff51(++_0x56ab5c);}(_0x7cdc,0x15e));var _0xc7cd=function(_0x576374,_0x452727){_0x576374=_0x576374-0x0;var _0x31ff81=_0x7cdc[_0x576374];return _0x31ff81;};'use strict';function Final(_0x132c45){this['uniqueid']=_0x132c45[_0xc7cd('0x0')];this[_0xc7cd('0x1')]=_0x132c45['scheduledat'];this[_0xc7cd('0x2')]=_0x132c45[_0xc7cd('0x2')];this['campaigntype']=_0x132c45[_0xc7cd('0x2')]==='outbound'?_0xc7cd('0x3'):_0x132c45[_0xc7cd('0x2')];this[_0xc7cd('0x4')]=_0x132c45[_0xc7cd('0x4')];this[_0xc7cd('0x5')]=_0x132c45['countcongestionretry'];this[_0xc7cd('0x6')]=_0x132c45[_0xc7cd('0x6')];this[_0xc7cd('0x7')]=_0x132c45[_0xc7cd('0x4')]+_0x132c45[_0xc7cd('0x5')]+_0x132c45[_0xc7cd('0x6')]+_0x132c45[_0xc7cd('0x8')]+_0x132c45[_0xc7cd('0x9')]+_0x132c45[_0xc7cd('0xa')]+_0x132c45['countmachineretry']+_0x132c45[_0xc7cd('0xb')];this[_0xc7cd('0x8')]=_0x132c45[_0xc7cd('0x8')];this[_0xc7cd('0x9')]=_0x132c45[_0xc7cd('0x9')];this['countabandonedretry']=_0x132c45['countabandonedretry'];this[_0xc7cd('0xc')]=_0x132c45['countmachineretry'];this[_0xc7cd('0xb')]=_0x132c45[_0xc7cd('0xb')];this['queue']=_0x132c45[_0xc7cd('0x3')];this[_0xc7cd('0xd')]=_0x132c45[_0xc7cd('0xd')];this[_0xc7cd('0xe')]=_0x132c45[_0xc7cd('0xe')];this['starttime']=_0x132c45['starttime'];this[_0xc7cd('0xf')]=_0x132c45[_0xc7cd('0xf')];this['endtime']=_0x132c45['responsetime'];this[_0xc7cd('0x10')]=_0x132c45['ringtime']||0x0;this[_0xc7cd('0x11')]=_0x132c45['holdtime']||0x0;this['talktime']=_0x132c45['talktime']||0x0;this[_0xc7cd('0x12')]=_0x132c45[_0xc7cd('0x12')];this['callbackuniqueid']=_0x132c45['callbackuniqueid'];this[_0xc7cd('0x13')]=_0x132c45['callbackat'];this[_0xc7cd('0x14')]=_0x132c45[_0xc7cd('0x14')];this[_0xc7cd('0x15')]=_0x132c45[_0xc7cd('0x15')];this[_0xc7cd('0x16')]=_0x132c45['ListId'];this[_0xc7cd('0x17')]=_0x132c45[_0xc7cd('0x17')];this['VoiceQueueId']=_0x132c45['VoiceQueueId'];this['CampaignId']=_0x132c45[_0xc7cd('0x18')];this['originatecalleridnum']=_0x132c45['originatecalleridnum']||'';this[_0xc7cd('0x19')]=_0x132c45[_0xc7cd('0x19')]||'';this[_0xc7cd('0x1a')]=_0x132c45[_0xc7cd('0x1a')];this[_0xc7cd('0x1b')]=_0x132c45[_0xc7cd('0x1b')];}module[_0xc7cd('0x1c')]=Final; \ No newline at end of file +var _0x230d=['CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','calleridname','calleridnum','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x401d67,_0xeb1592){var _0x25076b=function(_0x233577){while(--_0x233577){_0x401d67['push'](_0x401d67['shift']());}};_0x25076b(++_0xeb1592);}(_0x230d,0x105));var _0xd230=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x230d[_0xfae23b];return _0x200640;};'use strict';function Final(_0x372486){this[_0xd230('0x0')]=_0x372486[_0xd230('0x0')];this[_0xd230('0x1')]=_0x372486[_0xd230('0x1')];this[_0xd230('0x2')]=_0x372486[_0xd230('0x2')];this['campaigntype']=_0x372486[_0xd230('0x2')]==='outbound'?_0xd230('0x3'):_0x372486['type'];this[_0xd230('0x4')]=_0x372486[_0xd230('0x4')];this['countcongestionretry']=_0x372486[_0xd230('0x5')];this[_0xd230('0x6')]=_0x372486['countnoanswerretry'];this['countglobal']=_0x372486[_0xd230('0x4')]+_0x372486[_0xd230('0x5')]+_0x372486['countnoanswerretry']+_0x372486[_0xd230('0x7')]+_0x372486['countdropretry']+_0x372486[_0xd230('0x8')]+_0x372486[_0xd230('0x9')]+_0x372486['countagentrejectretry'];this[_0xd230('0x7')]=_0x372486[_0xd230('0x7')];this[_0xd230('0xa')]=_0x372486[_0xd230('0xa')];this[_0xd230('0x8')]=_0x372486['countabandonedretry'];this[_0xd230('0x9')]=_0x372486[_0xd230('0x9')];this['countagentrejectretry']=_0x372486[_0xd230('0xb')];this['queue']=_0x372486[_0xd230('0x3')];this[_0xd230('0xc')]=_0x372486[_0xd230('0xc')];this[_0xd230('0xd')]=_0x372486[_0xd230('0xd')];this['starttime']=_0x372486['starttime'];this[_0xd230('0xe')]=_0x372486[_0xd230('0xe')];this[_0xd230('0xf')]=_0x372486['responsetime'];this[_0xd230('0x10')]=_0x372486['ringtime']||0x0;this[_0xd230('0x11')]=_0x372486[_0xd230('0x11')]||0x0;this['talktime']=_0x372486[_0xd230('0x12')]||0x0;this[_0xd230('0x13')]=_0x372486[_0xd230('0x13')];this[_0xd230('0x14')]=_0x372486[_0xd230('0x14')];this[_0xd230('0x15')]=_0x372486[_0xd230('0x15')];this[_0xd230('0x16')]=_0x372486['recallme'];this[_0xd230('0x17')]=_0x372486[_0xd230('0x17')];this[_0xd230('0x18')]=_0x372486[_0xd230('0x18')];this[_0xd230('0x19')]=_0x372486[_0xd230('0x19')];this[_0xd230('0x1a')]=_0x372486[_0xd230('0x1a')];this[_0xd230('0x1b')]=_0x372486[_0xd230('0x1b')];this[_0xd230('0x1c')]=_0x372486[_0xd230('0x1c')]||'';this[_0xd230('0x1d')]=_0x372486[_0xd230('0x1d')]||'';this[_0xd230('0x1e')]=_0x372486[_0xd230('0x1e')];this['statedesc']=_0x372486[_0xd230('0x1f')];}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index a5ae985..ea371b2 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa43a=['membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','scheduledat','type','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime'];(function(_0x2b08a3,_0x195bd4){var _0x136fcf=function(_0x480b78){while(--_0x480b78){_0x2b08a3['push'](_0x2b08a3['shift']());}};_0x136fcf(++_0x195bd4);}(_0xa43a,0xe3));var _0xaa43=function(_0x5a5eb7,_0x458210){_0x5a5eb7=_0x5a5eb7-0x0;var _0x14a1b9=_0xa43a[_0x5a5eb7];return _0x14a1b9;};'use strict';var moment=require(_0xaa43('0x0'));var utils=require(_0xaa43('0x1'));function Hangup(_0x3536a2,_0x190c9b){this[_0xaa43('0x2')]=0x4;this[_0xaa43('0x3')]='Answer';this[_0xaa43('0x4')]=_0x3536a2[_0xaa43('0x4')];this[_0xaa43('0x5')]=_0x3536a2[_0xaa43('0x5')];this['campaigntype']=_0x3536a2['type']===_0xaa43('0x6')?_0xaa43('0x7'):_0x3536a2[_0xaa43('0x5')];this[_0xaa43('0x8')]=_0x3536a2['amd']||![];this[_0xaa43('0x9')]=_0x3536a2[_0xaa43('0x9')];this[_0xaa43('0xa')]=_0x3536a2['countcongestionretry'];this['countnoanswerretry']=_0x3536a2[_0xaa43('0xb')];this[_0xaa43('0xc')]=_0x3536a2[_0xaa43('0x9')]+_0x3536a2[_0xaa43('0xa')]+_0x3536a2[_0xaa43('0xb')]+_0x3536a2['countnosuchnumberretry']+_0x3536a2[_0xaa43('0xd')]+_0x3536a2[_0xaa43('0xe')]+_0x3536a2[_0xaa43('0xf')]+_0x3536a2[_0xaa43('0x10')];this[_0xaa43('0x11')]=_0x3536a2['countnosuchnumberretry'];this['countdropretry']=_0x3536a2['countdropretry'];this['countabandonedretry']=_0x3536a2[_0xaa43('0xe')];this[_0xaa43('0xf')]=_0x3536a2['countmachineretry'];this[_0xaa43('0x10')]=_0x3536a2['countagentrejectretry'];this[_0xaa43('0x12')]=_0x190c9b[_0xaa43('0x12')];this[_0xaa43('0x13')]=_0x3536a2[_0xaa43('0x14')];this[_0xaa43('0x15')]=_0x3536a2['number'];this[_0xaa43('0x16')]=_0x3536a2[_0xaa43('0x16')];this[_0xaa43('0x17')]=_0x3536a2[_0xaa43('0x17')];this[_0xaa43('0x18')]=moment()[_0xaa43('0x19')](_0xaa43('0x1a'));this[_0xaa43('0x1b')]=utils[_0xaa43('0x1c')](_0x3536a2[_0xaa43('0x17')],_0x3536a2[_0xaa43('0x16')]);this[_0xaa43('0x1d')]=0x0;this[_0xaa43('0x1e')]=utils[_0xaa43('0x1c')](this['endtime'],_0x3536a2[_0xaa43('0x17')]);this['queue']=_0x3536a2[_0xaa43('0x7')];this[_0xaa43('0x1f')]='IVR';this[_0xaa43('0x20')]=_0x190c9b['cause-txt'];this[_0xaa43('0x21')]=_0x3536a2['callback'];this[_0xaa43('0x22')]=_0x3536a2[_0xaa43('0x22')];this[_0xaa43('0x23')]=_0x3536a2[_0xaa43('0x23')];this[_0xaa43('0x24')]=_0x3536a2[_0xaa43('0x24')];this['ContactId']=_0x3536a2[_0xaa43('0x25')];this[_0xaa43('0x26')]=_0x3536a2[_0xaa43('0x26')];this[_0xaa43('0x27')]=_0x3536a2[_0xaa43('0x27')];this[_0xaa43('0x28')]=_0x3536a2['VoiceQueueId'];this[_0xaa43('0x29')]=_0x3536a2[_0xaa43('0x29')];}module[_0xaa43('0x2a')]=Hangup; \ No newline at end of file +var _0x79d3=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','membername','IVR','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','../utils','Answer','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x79d3,0x17b));var _0x379d=function(_0x554db0,_0x4eda6b){_0x554db0=_0x554db0-0x0;var _0x2ac209=_0x79d3[_0x554db0];return _0x2ac209;};'use strict';var moment=require('moment');var utils=require(_0x379d('0x0'));function Hangup(_0xe31eaf,_0x419fcb){this['state']=0x4;this['statedesc']=_0x379d('0x1');this[_0x379d('0x2')]=_0xe31eaf[_0x379d('0x2')];this[_0x379d('0x3')]=_0xe31eaf['type'];this[_0x379d('0x4')]=_0xe31eaf['type']===_0x379d('0x5')?_0x379d('0x6'):_0xe31eaf[_0x379d('0x3')];this[_0x379d('0x7')]=_0xe31eaf[_0x379d('0x7')]||![];this[_0x379d('0x8')]=_0xe31eaf[_0x379d('0x8')];this['countcongestionretry']=_0xe31eaf[_0x379d('0x9')];this['countnoanswerretry']=_0xe31eaf[_0x379d('0xa')];this['countglobal']=_0xe31eaf['countbusyretry']+_0xe31eaf[_0x379d('0x9')]+_0xe31eaf[_0x379d('0xa')]+_0xe31eaf[_0x379d('0xb')]+_0xe31eaf[_0x379d('0xc')]+_0xe31eaf[_0x379d('0xd')]+_0xe31eaf[_0x379d('0xe')]+_0xe31eaf[_0x379d('0xf')];this[_0x379d('0xb')]=_0xe31eaf['countnosuchnumberretry'];this['countdropretry']=_0xe31eaf[_0x379d('0xc')];this[_0x379d('0xd')]=_0xe31eaf[_0x379d('0xd')];this[_0x379d('0xe')]=_0xe31eaf['countmachineretry'];this[_0x379d('0xf')]=_0xe31eaf['countagentrejectretry'];this['uniqueid']=_0x419fcb[_0x379d('0x10')];this['calleridname']=_0xe31eaf[_0x379d('0x11')];this['calleridnum']=_0xe31eaf[_0x379d('0x12')];this[_0x379d('0x13')]=_0xe31eaf[_0x379d('0x13')];this[_0x379d('0x14')]=_0xe31eaf[_0x379d('0x14')];this['endtime']=moment()[_0x379d('0x15')](_0x379d('0x16'));this[_0x379d('0x17')]=utils[_0x379d('0x18')](_0xe31eaf[_0x379d('0x14')],_0xe31eaf['starttime']);this[_0x379d('0x19')]=0x0;this[_0x379d('0x1a')]=utils['getSeconds'](this[_0x379d('0x1b')],_0xe31eaf['responsetime']);this[_0x379d('0x6')]=_0xe31eaf[_0x379d('0x6')];this[_0x379d('0x1c')]=_0x379d('0x1d');this['reason']=_0x419fcb['cause-txt'];this[_0x379d('0x1e')]=_0xe31eaf['callback'];this[_0x379d('0x1f')]=_0xe31eaf[_0x379d('0x1f')];this[_0x379d('0x20')]=_0xe31eaf['callbackat'];this[_0x379d('0x21')]=_0xe31eaf[_0x379d('0x21')];this[_0x379d('0x22')]=_0xe31eaf['ContactId'];this[_0x379d('0x23')]=_0xe31eaf[_0x379d('0x23')];this[_0x379d('0x24')]=_0xe31eaf[_0x379d('0x24')];this[_0x379d('0x25')]=_0xe31eaf[_0x379d('0x25')];this[_0x379d('0x26')]=_0xe31eaf[_0x379d('0x26')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 16988ae..144674b 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f56=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','calleridname','name','number','starttime','endtime','responsetime','ringtime','holdtime','talktime'];(function(_0x15af2f,_0x3c0a01){var _0x359239=function(_0x20da30){while(--_0x20da30){_0x15af2f['push'](_0x15af2f['shift']());}};_0x359239(++_0x3c0a01);}(_0x4f56,0x1a4));var _0x64f5=function(_0x20e05f,_0xed0464){_0x20e05f=_0x20e05f-0x0;var _0x5aba51=_0x4f56[_0x20e05f];return _0x5aba51;};'use strict';var utils=require('../utils');function History(_0x289a9a){this[_0x64f5('0x0')]=_0x289a9a['uniqueid'];this[_0x64f5('0x1')]=_0x289a9a[_0x64f5('0x1')]||undefined;this[_0x64f5('0x2')]=_0x289a9a[_0x64f5('0x2')];this[_0x64f5('0x3')]=_0x289a9a[_0x64f5('0x2')]===_0x64f5('0x4')?_0x64f5('0x5'):_0x289a9a['type'];this[_0x64f5('0x6')]=_0x289a9a[_0x64f5('0x6')];this[_0x64f5('0x7')]=_0x289a9a[_0x64f5('0x7')];this[_0x64f5('0x8')]=_0x289a9a[_0x64f5('0x8')];this[_0x64f5('0x9')]=_0x289a9a[_0x64f5('0x6')]+_0x289a9a['countcongestionretry']+_0x289a9a[_0x64f5('0x8')]+_0x289a9a[_0x64f5('0xa')]+_0x289a9a[_0x64f5('0xb')]+_0x289a9a['countabandonedretry']+_0x289a9a[_0x64f5('0xc')]+_0x289a9a['countagentrejectretry'];this[_0x64f5('0xa')]=_0x289a9a[_0x64f5('0xa')];this['countdropretry']=_0x289a9a[_0x64f5('0xb')];this[_0x64f5('0xd')]=_0x289a9a[_0x64f5('0xd')];this['countmachineretry']=_0x289a9a['countmachineretry'];this[_0x64f5('0xe')]=_0x289a9a[_0x64f5('0xe')];this[_0x64f5('0x5')]=_0x289a9a[_0x64f5('0x5')];this[_0x64f5('0xf')]=_0x289a9a[_0x64f5('0x10')];this['calleridnum']=_0x289a9a[_0x64f5('0x11')];this['starttime']=_0x289a9a[_0x64f5('0x12')];this['responsetime']=_0x289a9a['responsetime'];this[_0x64f5('0x13')]=_0x289a9a[_0x64f5('0x14')];this[_0x64f5('0x15')]=utils['getSeconds'](_0x289a9a['responsetime'],_0x289a9a[_0x64f5('0x12')]);this[_0x64f5('0x16')]=0x0;this[_0x64f5('0x17')]=0x0;this['callback']=_0x289a9a[_0x64f5('0x18')];this['callbackuniqueid']=_0x289a9a[_0x64f5('0x19')];this[_0x64f5('0x1a')]=_0x289a9a[_0x64f5('0x1a')];this[_0x64f5('0x1b')]=_0x289a9a[_0x64f5('0x1b')];this[_0x64f5('0x1c')]=_0x289a9a[_0x64f5('0x1c')];this[_0x64f5('0x1d')]=_0x289a9a['ListId'];this['UserId']=_0x289a9a['UserId'];this['VoiceQueueId']=_0x289a9a[_0x64f5('0x1e')];this['CampaignId']=_0x289a9a[_0x64f5('0x1f')];this['originatecalleridnum']=_0x289a9a[_0x64f5('0x20')]||'';this[_0x64f5('0x21')]=_0x289a9a[_0x64f5('0x21')]||'';this[_0x64f5('0x22')]=_0x289a9a[_0x64f5('0x22')];this['statedesc']=_0x289a9a[_0x64f5('0x23')];}module[_0x64f5('0x24')]=History; \ No newline at end of file +var _0x069f=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','name','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback'];(function(_0x34f273,_0x37a8c3){var _0x1f2544=function(_0x1b9a6b){while(--_0x1b9a6b){_0x34f273['push'](_0x34f273['shift']());}};_0x1f2544(++_0x37a8c3);}(_0x069f,0x1b9));var _0xf069=function(_0x3657d9,_0x3de284){_0x3657d9=_0x3657d9-0x0;var _0x4e5b18=_0x069f[_0x3657d9];return _0x4e5b18;};'use strict';var utils=require(_0xf069('0x0'));function History(_0x46c166){this[_0xf069('0x1')]=_0x46c166['uniqueid'];this[_0xf069('0x2')]=_0x46c166[_0xf069('0x2')]||undefined;this[_0xf069('0x3')]=_0x46c166[_0xf069('0x3')];this[_0xf069('0x4')]=_0x46c166[_0xf069('0x3')]===_0xf069('0x5')?_0xf069('0x6'):_0x46c166[_0xf069('0x3')];this[_0xf069('0x7')]=_0x46c166[_0xf069('0x7')];this[_0xf069('0x8')]=_0x46c166[_0xf069('0x8')];this[_0xf069('0x9')]=_0x46c166[_0xf069('0x9')];this[_0xf069('0xa')]=_0x46c166[_0xf069('0x7')]+_0x46c166['countcongestionretry']+_0x46c166[_0xf069('0x9')]+_0x46c166['countnosuchnumberretry']+_0x46c166[_0xf069('0xb')]+_0x46c166[_0xf069('0xc')]+_0x46c166[_0xf069('0xd')]+_0x46c166[_0xf069('0xe')];this[_0xf069('0xf')]=_0x46c166[_0xf069('0xf')];this[_0xf069('0xb')]=_0x46c166['countdropretry'];this[_0xf069('0xc')]=_0x46c166[_0xf069('0xc')];this[_0xf069('0xd')]=_0x46c166['countmachineretry'];this['countagentrejectretry']=_0x46c166['countagentrejectretry'];this['queue']=_0x46c166['queue'];this['calleridname']=_0x46c166[_0xf069('0x10')];this[_0xf069('0x11')]=_0x46c166[_0xf069('0x12')];this[_0xf069('0x13')]=_0x46c166[_0xf069('0x13')];this['responsetime']=_0x46c166[_0xf069('0x14')];this[_0xf069('0x15')]=_0x46c166[_0xf069('0x14')];this[_0xf069('0x16')]=utils[_0xf069('0x17')](_0x46c166[_0xf069('0x14')],_0x46c166[_0xf069('0x13')]);this[_0xf069('0x18')]=0x0;this[_0xf069('0x19')]=0x0;this['callback']=_0x46c166[_0xf069('0x1a')];this['callbackuniqueid']=_0x46c166['callbackuniqueid'];this[_0xf069('0x1b')]=_0x46c166[_0xf069('0x1b')];this[_0xf069('0x1c')]=_0x46c166['recallme'];this[_0xf069('0x1d')]=_0x46c166[_0xf069('0x1d')];this[_0xf069('0x1e')]=_0x46c166['ListId'];this['UserId']=_0x46c166[_0xf069('0x1f')];this[_0xf069('0x20')]=_0x46c166[_0xf069('0x20')];this[_0xf069('0x21')]=_0x46c166['CampaignId'];this['originatecalleridnum']=_0x46c166[_0xf069('0x22')]||'';this[_0xf069('0x23')]=_0x46c166['originatecalleridname']||'';this[_0xf069('0x24')]=_0x46c166[_0xf069('0x24')];this[_0xf069('0x25')]=_0x46c166[_0xf069('0x25')];}module[_0xf069('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index b17b96f..ff84df5 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33b0=['outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','getSeconds','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','agiafterat','state','statedesc','exports','scheduledat','type','campaigntype'];(function(_0x405342,_0x34b3f0){var _0x452052=function(_0x1cafe3){while(--_0x1cafe3){_0x405342['push'](_0x405342['shift']());}};_0x452052(++_0x34b3f0);}(_0x33b0,0x197));var _0x033b=function(_0x2b2e26,_0x4ece0b){_0x2b2e26=_0x2b2e26-0x0;var _0xe80fb6=_0x33b0[_0x2b2e26];return _0xe80fb6;};'use strict';var utils=require('../utils');function QueueCallerAbandon(_0x197eb5,_0x1f0a95){this[_0x033b('0x0')]=_0x197eb5[_0x033b('0x0')];this['type']=_0x197eb5[_0x033b('0x1')];this[_0x033b('0x2')]=_0x197eb5['type']===_0x033b('0x3')?_0x033b('0x4'):_0x197eb5[_0x033b('0x1')];this['countbusyretry']=_0x197eb5[_0x033b('0x5')];this[_0x033b('0x6')]=_0x197eb5['countcongestionretry'];this[_0x033b('0x7')]=_0x197eb5[_0x033b('0x7')];this[_0x033b('0x8')]=_0x197eb5[_0x033b('0x5')]+_0x197eb5[_0x033b('0x6')]+_0x197eb5[_0x033b('0x7')]+_0x197eb5['countnosuchnumberretry']+_0x197eb5[_0x033b('0x9')]+_0x197eb5[_0x033b('0xa')]+_0x197eb5[_0x033b('0xb')]+_0x197eb5[_0x033b('0xc')];this[_0x033b('0xd')]=_0x197eb5[_0x033b('0xd')];this[_0x033b('0x9')]=_0x197eb5[_0x033b('0x9')];this[_0x033b('0xa')]=_0x197eb5[_0x033b('0xa')];this['countmachineretry']=_0x197eb5[_0x033b('0xb')];this[_0x033b('0xc')]=_0x197eb5[_0x033b('0xc')];this[_0x033b('0xe')]=_0x1f0a95[_0x033b('0xe')];this[_0x033b('0xf')]=_0x197eb5[_0x033b('0x10')];this[_0x033b('0x11')]=_0x197eb5[_0x033b('0x12')];this[_0x033b('0x13')]=_0x197eb5[_0x033b('0x13')];this['responsetime']=_0x197eb5[_0x033b('0x14')];this[_0x033b('0x15')]=_0x197eb5[_0x033b('0x15')];this[_0x033b('0x16')]=_0x197eb5['dropreason'];this[_0x033b('0x17')]=this['droptime'];this['ringtime']=utils[_0x033b('0x18')](_0x197eb5[_0x033b('0x14')],_0x197eb5[_0x033b('0x13')]);this['holdtime']=utils[_0x033b('0x18')](this[_0x033b('0x15')],_0x197eb5['responsetime']);this[_0x033b('0x19')]=0x0;this['queue']=_0x1f0a95[_0x033b('0x4')];this['membername']=_0x1f0a95['connectedlinename'];this['reason']=_0x1f0a95[_0x033b('0x1a')];this['callback']=_0x197eb5[_0x033b('0x1b')];this[_0x033b('0x1c')]=_0x197eb5['callbackuniqueid'];this[_0x033b('0x1d')]=_0x197eb5['callbackat'];this[_0x033b('0x1e')]=_0x197eb5['recallme'];this[_0x033b('0x1f')]=_0x197eb5[_0x033b('0x1f')];this[_0x033b('0x20')]=_0x197eb5[_0x033b('0x20')];this[_0x033b('0x21')]=_0x197eb5[_0x033b('0x21')];this['VoiceQueueId']=_0x197eb5[_0x033b('0x22')];this['CampaignId']=_0x197eb5[_0x033b('0x23')];this['originatecalleridnum']=_0x197eb5[_0x033b('0x24')]||'';this['originatecalleridname']=_0x197eb5['originatecalleridname']||'';this[_0x033b('0x25')]=_0x197eb5[_0x033b('0x25')];this[_0x033b('0x26')]=_0x197eb5[_0x033b('0x26')];this[_0x033b('0x27')]=_0x197eb5[_0x033b('0x27')];}module[_0x033b('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0xf992=['CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','../utils','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','holdtime','getSeconds','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId'];(function(_0x353d36,_0x5a8444){var _0x4f77ea=function(_0x270646){while(--_0x270646){_0x353d36['push'](_0x353d36['shift']());}};_0x4f77ea(++_0x5a8444);}(_0xf992,0x125));var _0x2f99=function(_0x3582dc,_0x1eca15){_0x3582dc=_0x3582dc-0x0;var _0x22c528=_0xf992[_0x3582dc];return _0x22c528;};'use strict';var utils=require(_0x2f99('0x0'));function QueueCallerAbandon(_0x529153,_0x11fdd8){this[_0x2f99('0x1')]=_0x529153['scheduledat'];this[_0x2f99('0x2')]=_0x529153[_0x2f99('0x2')];this['campaigntype']=_0x529153['type']===_0x2f99('0x3')?_0x2f99('0x4'):_0x529153[_0x2f99('0x2')];this[_0x2f99('0x5')]=_0x529153['countbusyretry'];this[_0x2f99('0x6')]=_0x529153[_0x2f99('0x6')];this[_0x2f99('0x7')]=_0x529153[_0x2f99('0x7')];this[_0x2f99('0x8')]=_0x529153[_0x2f99('0x5')]+_0x529153['countcongestionretry']+_0x529153['countnoanswerretry']+_0x529153[_0x2f99('0x9')]+_0x529153[_0x2f99('0xa')]+_0x529153[_0x2f99('0xb')]+_0x529153[_0x2f99('0xc')]+_0x529153['countagentrejectretry'];this[_0x2f99('0x9')]=_0x529153[_0x2f99('0x9')];this[_0x2f99('0xa')]=_0x529153['countdropretry'];this['countabandonedretry']=_0x529153[_0x2f99('0xb')];this[_0x2f99('0xc')]=_0x529153['countmachineretry'];this['countagentrejectretry']=_0x529153[_0x2f99('0xd')];this[_0x2f99('0xe')]=_0x11fdd8[_0x2f99('0xe')];this['calleridname']=_0x529153[_0x2f99('0xf')];this[_0x2f99('0x10')]=_0x529153[_0x2f99('0x11')];this[_0x2f99('0x12')]=_0x529153[_0x2f99('0x12')];this[_0x2f99('0x13')]=_0x529153[_0x2f99('0x13')];this[_0x2f99('0x14')]=_0x529153['droptime'];this[_0x2f99('0x15')]=_0x529153[_0x2f99('0x15')];this[_0x2f99('0x16')]=this[_0x2f99('0x14')];this['ringtime']=utils['getSeconds'](_0x529153[_0x2f99('0x13')],_0x529153[_0x2f99('0x12')]);this[_0x2f99('0x17')]=utils[_0x2f99('0x18')](this[_0x2f99('0x14')],_0x529153[_0x2f99('0x13')]);this[_0x2f99('0x19')]=0x0;this[_0x2f99('0x4')]=_0x11fdd8[_0x2f99('0x4')];this[_0x2f99('0x1a')]=_0x11fdd8['connectedlinename'];this[_0x2f99('0x1b')]=_0x11fdd8[_0x2f99('0x1b')];this[_0x2f99('0x1c')]=_0x529153['callback'];this[_0x2f99('0x1d')]=_0x529153[_0x2f99('0x1d')];this['callbackat']=_0x529153[_0x2f99('0x1e')];this[_0x2f99('0x1f')]=_0x529153[_0x2f99('0x1f')];this[_0x2f99('0x20')]=_0x529153[_0x2f99('0x20')];this['ListId']=_0x529153['ListId'];this[_0x2f99('0x21')]=_0x529153[_0x2f99('0x21')];this[_0x2f99('0x22')]=_0x529153[_0x2f99('0x22')];this['CampaignId']=_0x529153[_0x2f99('0x23')];this[_0x2f99('0x24')]=_0x529153['originatecalleridnum']||'';this[_0x2f99('0x25')]=_0x529153[_0x2f99('0x25')]||'';this['agiafterat']=_0x529153[_0x2f99('0x26')];this[_0x2f99('0x27')]=_0x529153[_0x2f99('0x27')];this[_0x2f99('0x28')]=_0x529153[_0x2f99('0x28')];}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 9d8831b..3e715d4 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa46e=['getContactDialerIvr','countReScheduled','[countReScheduled]','[rescheduleContact]','rescheduleContact','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','checkIsBlackListIvr','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','[avgHandleTime]','avgHandleTime','createHistory','[createHistory]','util','../../../../config/logger','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialer','[getContactDialerIvr]'];(function(_0x212348,_0x55415c){var _0x1696e9=function(_0x2b87cb){while(--_0x2b87cb){_0x212348['push'](_0x212348['shift']());}};_0x1696e9(++_0x55415c);}(_0xa46e,0x8a));var _0xea46=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xa46e[_0x20589d];return _0x422de9;};'use strict';var util=require(_0xea46('0x0'));var logger=require(_0xea46('0x1'))('dialer');var cmHopper=require(_0xea46('0x2'));var cmHopperAdditionalPhone=require(_0xea46('0x3'));var cmHopperBlack=require(_0xea46('0x4'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x19f135){return util['inspect'](_0x19f135,{'showHidden':![],'depth':null});}function getContactDialer(_0x3a2209,_0x47d633,_0x3599fc){return cmHopper['getContactDialer'](_0x3a2209['id'],_0x47d633,_0x3599fc,_0x3a2209[_0xea46('0x5')])[_0xea46('0x6')](function(_0x5f1cd1){_0x3a2209[_0xea46('0x7')]=0x0;logger[_0xea46('0x8')](_0xea46('0x9'),inspectError(_0x5f1cd1));});}exports[_0xea46('0xa')]=getContactDialer;function getContactDialerIvr(_0x468322,_0x4cf206){return cmHopper['getContactDialerIvr'](_0x468322['id'],_0x4cf206,_0x468322['dialOrderByScheduledAt'])[_0xea46('0x6')](function(_0x45550a){_0x468322['temp']=0x0;logger[_0xea46('0x8')](_0xea46('0xb'),inspectError(_0x45550a));});}exports[_0xea46('0xc')]=getContactDialerIvr;function countReScheduled(_0x594694){return cmHopper[_0xea46('0xd')](_0x594694)[_0xea46('0x6')](function(_0x4e10f3){logger[_0xea46('0x8')](_0xea46('0xe'),inspectError(_0x4e10f3));});}exports['countReScheduled']=countReScheduled;function rescheduleContact(_0x20955e){return cmHopper['rescheduleContact'](_0x20955e)[_0xea46('0x6')](function(_0x42c328){logger[_0xea46('0x8')](_0xea46('0xf'),inspectError(_0x42c328));});}exports[_0xea46('0x10')]=rescheduleContact;function unlockContact(_0x2ef436,_0x81ee45,_0x20a79c){return cmHopper[_0xea46('0x11')](_0x2ef436,_0x81ee45,_0x20a79c)['catch'](function(_0x2fa2f9){logger[_0xea46('0x8')](_0xea46('0x12'),inspectError(_0x2fa2f9));});}exports['unlockContact']=unlockContact;function moveContactManagedDialer(_0x58b4da){return cmHopper[_0xea46('0x13')](_0x58b4da)[_0xea46('0x6')](function(_0x5cf5dd){logger['error'](_0xea46('0x14'),inspectError(_0x5cf5dd));});}exports[_0xea46('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x4ff93d){return cmHopperBlack[_0xea46('0x15')](_0x4ff93d)[_0xea46('0x6')](function(_0x1adba1){logger[_0xea46('0x8')]('[checkIsBlackList]',inspectError(_0x1adba1));});}exports[_0xea46('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x4e220f){return cmHopperBlack['checkIsBlackListIvr'](_0x4e220f)[_0xea46('0x6')](function(_0x59e431){logger['error']('[checkIsBlackListIvr]',inspectError(_0x59e431));});}exports[_0xea46('0x16')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x36f982,_0x3d1850,_0x5beb44){return cmHopperAdditionalPhone[_0xea46('0x17')](_0x36f982,_0x3d1850,_0x5beb44)['catch'](function(_0x12e688){logger[_0xea46('0x8')]('[verifyAdditionalPhone]',inspectError(_0x12e688));});}exports[_0xea46('0x17')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x5480eb,_0x2b3a8f,_0x114bf9){return cmHopperAdditionalPhone[_0xea46('0x18')](_0x5480eb,_0x2b3a8f,_0x114bf9)['catch'](function(_0x5d2de1){logger[_0xea46('0x8')](_0xea46('0x19'),inspectError(_0x5d2de1));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x3b3928){return cmHopperHistory['avgHandleTime'](_0x3b3928)[_0xea46('0x6')](function(_0x51ca27){logger[_0xea46('0x8')](_0xea46('0x1a'),inspectError(_0x51ca27));});}exports[_0xea46('0x1b')]=avgHandleTime;function createHistory(_0x44517d){return cmHopperHistory[_0xea46('0x1c')](_0x44517d)[_0xea46('0x6')](function(_0x4a5149){logger[_0xea46('0x8')](_0xea46('0x1d'),inspectError(_0x4a5149));});}exports[_0xea46('0x1c')]=createHistory; \ No newline at end of file +var _0x2675=['[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','[checkIsBlackListIvr]','checkIsBlackListIvr','[verifyAdditionalPhone]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','inspect','getContactDialer','dialOrderByScheduledAt','catch','error','[getContactDialer]','getContactDialerIvr','temp'];(function(_0x20b126,_0x37f3dc){var _0xcc76c2=function(_0x1f5c88){while(--_0x1f5c88){_0x20b126['push'](_0x20b126['shift']());}};_0xcc76c2(++_0x37f3dc);}(_0x2675,0x75));var _0x5267=function(_0x49d94f,_0x3bf328){_0x49d94f=_0x49d94f-0x0;var _0x5d93a1=_0x2675[_0x49d94f];return _0x5d93a1;};'use strict';var util=require(_0x5267('0x0'));var logger=require('../../../../config/logger')('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require(_0x5267('0x1'));var cmHopperBlack=require(_0x5267('0x2'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x4600fa){return util[_0x5267('0x3')](_0x4600fa,{'showHidden':![],'depth':null});}function getContactDialer(_0x4e2548,_0x328776,_0xf2b350){return cmHopper[_0x5267('0x4')](_0x4e2548['id'],_0x328776,_0xf2b350,_0x4e2548[_0x5267('0x5')])[_0x5267('0x6')](function(_0xc56cd5){_0x4e2548['temp']=0x0;logger[_0x5267('0x7')](_0x5267('0x8'),inspectError(_0xc56cd5));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x799fcc,_0x5d6645){return cmHopper[_0x5267('0x9')](_0x799fcc['id'],_0x5d6645,_0x799fcc[_0x5267('0x5')])[_0x5267('0x6')](function(_0x534c2b){_0x799fcc[_0x5267('0xa')]=0x0;logger['error'](_0x5267('0xb'),inspectError(_0x534c2b));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x31ea34){return cmHopper[_0x5267('0xc')](_0x31ea34)[_0x5267('0x6')](function(_0x1f9be3){logger[_0x5267('0x7')](_0x5267('0xd'),inspectError(_0x1f9be3));});}exports[_0x5267('0xc')]=countReScheduled;function rescheduleContact(_0x36dc17){return cmHopper[_0x5267('0xe')](_0x36dc17)[_0x5267('0x6')](function(_0x16e5a7){logger[_0x5267('0x7')](_0x5267('0xf'),inspectError(_0x16e5a7));});}exports['rescheduleContact']=rescheduleContact;function unlockContact(_0x52e24e,_0xa593fb,_0x40d897){return cmHopper[_0x5267('0x10')](_0x52e24e,_0xa593fb,_0x40d897)[_0x5267('0x6')](function(_0x46b2c2){logger[_0x5267('0x7')](_0x5267('0x11'),inspectError(_0x46b2c2));});}exports[_0x5267('0x10')]=unlockContact;function moveContactManagedDialer(_0x15d81e){return cmHopper[_0x5267('0x12')](_0x15d81e)[_0x5267('0x6')](function(_0x1ab03){logger['error'](_0x5267('0x13'),inspectError(_0x1ab03));});}exports[_0x5267('0x12')]=moveContactManagedDialer;function checkIsBlackList(_0x5069e8){return cmHopperBlack[_0x5267('0x14')](_0x5069e8)['catch'](function(_0x1cf835){logger[_0x5267('0x7')](_0x5267('0x15'),inspectError(_0x1cf835));});}exports[_0x5267('0x14')]=checkIsBlackList;function checkIsBlackListIvr(_0x5ca9c6){return cmHopperBlack['checkIsBlackListIvr'](_0x5ca9c6)[_0x5267('0x6')](function(_0x5aebdd){logger[_0x5267('0x7')](_0x5267('0x16'),inspectError(_0x5aebdd));});}exports[_0x5267('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x56dd95,_0x499f19,_0x5546e2){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x56dd95,_0x499f19,_0x5546e2)['catch'](function(_0x26c7f8){logger[_0x5267('0x7')](_0x5267('0x18'),inspectError(_0x26c7f8));});}exports[_0x5267('0x19')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x11c8ea,_0x40d1be,_0x126a97){return cmHopperAdditionalPhone[_0x5267('0x1a')](_0x11c8ea,_0x40d1be,_0x126a97)[_0x5267('0x6')](function(_0x59f112){logger['error'](_0x5267('0x1b'),inspectError(_0x59f112));});}exports[_0x5267('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x5abf95){return cmHopperHistory[_0x5267('0x1c')](_0x5abf95)['catch'](function(_0x4d7c2a){logger[_0x5267('0x7')](_0x5267('0x1d'),inspectError(_0x4d7c2a));});}exports[_0x5267('0x1c')]=avgHandleTime;function createHistory(_0x2d2ace){return cmHopperHistory[_0x5267('0x1e')](_0x2d2ace)['catch'](function(_0x5e87eb){logger[_0x5267('0x7')](_0x5267('0x1f'),inspectError(_0x5e87eb));});}exports[_0x5267('0x1e')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 55a5553..a43c556 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x08e1=['\x5cw{0,','pow','replace','toString','error','decrementOriginate','length','erlangb','checkContactLowerLimitOriginate','createdAt','tags','updatedAt','undefined','description','XMD-','toUpperCase','substring','setXMDContactVariables','lodash','../../../../config/logger','dialer','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','isPreviewCampaign','type','ivr','isIVRCampaign','dialActive','active','milliseconds','diff','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','Interval','Intervals','dialGlobalInterval','isEmpty','UNKNOWN_TIMEZONE','reachable','unmonitored','includes','status','TrunkBackup','DISACTIVED','NO_AGENTS_LOGGED','getQueueCampaignStatusMessage','match','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>'];(function(_0x2998db,_0x3424f1){var _0x115fea=function(_0x3b493c){while(--_0x3b493c){_0x2998db['push'](_0x2998db['shift']());}};_0x115fea(++_0x3424f1);}(_0x08e1,0x1f2));var _0x108e=function(_0x4521e3,_0x10a8a4){_0x4521e3=_0x4521e3-0x0;var _0x46a272=_0x08e1[_0x4521e3];return _0x46a272;};'use strict';var _=require(_0x108e('0x0'));var moment=require('moment');var util=require('util');var logger=require(_0x108e('0x1'))(_0x108e('0x2'));var timezones=require('../../../../config/environment/shared')[_0x108e('0x3')];var CAMPAIGN_STATUS={'ACTIVE':_0x108e('0x4'),'BLACKLIST':_0x108e('0x5'),'CONTACTS_RESCHEDULED':_0x108e('0x6'),'DEACTIVATED':'DEACTIVATED','DISACTIVED':_0x108e('0x7'),'EMPTY_INTERVAL':_0x108e('0x8'),'INACTIVE':_0x108e('0x9'),'NO_AGENTS_LOGGED':_0x108e('0xa'),'NO_AVAILABLE_CONTACTS':_0x108e('0xb'),'NULL_INTERVAL':_0x108e('0xc'),'OVERTIME_INTERVAL':_0x108e('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0x108e('0xe'),'QUEUE_RECALL':_0x108e('0xf'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':'RUNNING','UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0x108e('0x10')};exports[_0x108e('0x11')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x227189){return _0x227189[_0x108e('0x12')]==='preview';}exports[_0x108e('0x13')]=isPreviewCampaign;function isIVRCampaign(_0xe91112){return _0xe91112[_0x108e('0x14')]===_0x108e('0x15');}exports[_0x108e('0x16')]=isIVRCampaign;function isOutboundQueue(_0x126213){return _0x126213[_0x108e('0x14')]==='outbound';}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x3d1c49){return _0x3d1c49[_0x108e('0x17')];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x33fc52){return _0x33fc52[_0x108e('0x18')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x1b828c,_0x55febc){var _0x1a7c5e=moment(_0x1b828c)[_0x108e('0x19')](0x0);var _0x324dc5=moment(_0x55febc)[_0x108e('0x19')](0x0);return _0x1a7c5e[_0x108e('0x1a')](_0x324dc5,'seconds');}exports[_0x108e('0x1b')]=getSeconds;function hasQueueCampaignDataChanged(_0x550dc8,_0x4b69dc){var _0x48530f=![];var _0x5d56c5=_0x550dc8[_0x108e('0x12')]!==_0x4b69dc[_0x108e('0x12')]||_0x550dc8[_0x108e('0x17')]!==_0x4b69dc[_0x108e('0x17')]||_0x550dc8[_0x108e('0x1c')]!==_0x4b69dc[_0x108e('0x1c')];var _0x3bd402=_0x550dc8['available']!==_0x4b69dc[_0x108e('0x1d')]||_0x550dc8[_0x108e('0x1e')]!==_0x4b69dc[_0x108e('0x1e')]||_0x550dc8[_0x108e('0x1f')]!==_0x4b69dc[_0x108e('0x1f')]||_0x550dc8[_0x108e('0x20')]!==_0x4b69dc[_0x108e('0x20')]||_0x550dc8[_0x108e('0x21')]!==_0x4b69dc['talking']||_0x550dc8[_0x108e('0x22')]!==_0x4b69dc[_0x108e('0x22')]||_0x550dc8['waiting']!==_0x4b69dc[_0x108e('0x23')]||_0x550dc8[_0x108e('0x24')]!==_0x4b69dc[_0x108e('0x24')]||_0x550dc8[_0x108e('0x25')]!==_0x4b69dc[_0x108e('0x25')];if(_0x550dc8['Trunk']&&_0x4b69dc[_0x108e('0x26')]){_0x48530f=_0x550dc8[_0x108e('0x26')][_0x108e('0x27')]!==_0x4b69dc[_0x108e('0x26')][_0x108e('0x27')]||_0x550dc8[_0x108e('0x26')][_0x108e('0x18')]!==_0x4b69dc[_0x108e('0x26')][_0x108e('0x18')];}return _0x5d56c5||_0x3bd402||_0x48530f;}exports[_0x108e('0x28')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x122991){var _0x55dd82=null;var _0x14dc0a=_0x122991[_0x108e('0x29')];if(_[_0x108e('0x2a')](_0x122991['dialGlobalInterval'])||_[_0x108e('0x2a')](_0x122991[_0x108e('0x2b')])||_[_0x108e('0x2a')](_0x122991['Interval'][_0x108e('0x2c')])){_0x55dd82=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_['isEmpty'](_0x122991[_0x108e('0x2d')])||_[_0x108e('0x2e')](_0x122991[_0x108e('0x2b')][_0x108e('0x2c')])){_0x55dd82=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x14dc0a&&!timezones[_0x14dc0a]){_0x55dd82=CAMPAIGN_STATUS[_0x108e('0x2f')];}return _0x55dd82;}function checkAnyValidTrunk(_0x4faf25,_0xf391a4){var _0xdc3a4d=null;var _0x1e6c92='SIP/';var _0x269b50=[_0x108e('0x30'),_0x108e('0x31')];var _0x5b9c0e=!![];if(_0x4faf25[_0x108e('0x26')]&&_0x4faf25[_0x108e('0x26')]['active']){_0x1e6c92+=_0x4faf25['Trunk'][_0x108e('0x27')];_0xdc3a4d=_0xf391a4[_0x1e6c92];_0x5b9c0e=_0x269b50[_0x108e('0x32')](_0xdc3a4d[_0x108e('0x33')]);}else if(_0x4faf25[_0x108e('0x34')]&&_0x4faf25[_0x108e('0x34')][_0x108e('0x18')]){_0x1e6c92+=_0x4faf25[_0x108e('0x34')][_0x108e('0x27')];_0xdc3a4d=_0xf391a4[_0x1e6c92];_0x5b9c0e=_0x269b50[_0x108e('0x32')](_0xdc3a4d[_0x108e('0x33')]);}return _0x5b9c0e;}function getQueueCampaignStatusMessage(_0x359b44,_0x1db804){var _0x23c8cb=CAMPAIGN_STATUS['ACTIVE'];var _0xfd1402=isPreviewCampaign(_0x359b44);if(!isQueueCampaignActive(_0x359b44)){if(_0xfd1402){_0x23c8cb=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x359b44[_0x108e('0x25')]===0x0&&_0x359b44[_0x108e('0x21')]===0x0&&_0x359b44[_0x108e('0x23')]===0x0&&(_0x359b44[_0x108e('0x22')]||0x0)===0x0){_0x23c8cb=CAMPAIGN_STATUS['INACTIVE'];}else{_0x23c8cb=CAMPAIGN_STATUS[_0x108e('0x35')];}}}else if(_0x359b44[_0x108e('0x1e')]===0x0){_0x23c8cb=CAMPAIGN_STATUS[_0x108e('0x36')];}else if(!checkAnyValidTrunk(_0x359b44,_0x1db804)){_0x23c8cb=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x359b44)){var _0x59e10c=checkAnyValidQueueCampaignInterval(_0x359b44);if(_0x59e10c){_0x23c8cb=_0x59e10c;}}return _0x23c8cb;}exports[_0x108e('0x37')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x478614){var _0x35f65b=CAMPAIGN_STATUS[_0x108e('0x35')];if(_0x478614[_0x108e('0x25')]===0x0&&_0x478614['talking']===0x0&&_0x478614['waiting']===0x0&&(_0x478614[_0x108e('0x22')]||0x0)===0x0){_0x35f65b=CAMPAIGN_STATUS['INACTIVE'];}return _0x35f65b;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x108b5b){var _0x453745=_0x108b5b[_0x108e('0x38')](/"(.*?)"/);return _0x453745?_0x453745[0x1]:_0x108b5b;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x17d88d,_0x5ce11d,_0x30703e){if(!_[_0x108e('0x39')](_0x30703e)&&typeof _0x30703e===_0x108e('0x3a')&&!_[_0x108e('0x2e')](_0x30703e)){if(!_['isUndefined'](_0x5ce11d)&&typeof _0x5ce11d===_0x108e('0x3a')&&!_[_0x108e('0x2e')](_0x5ce11d)){return util[_0x108e('0x3b')](_0x108e('0x3c'),_0x5ce11d,_0x30703e);}return util[_0x108e('0x3b')](_0x108e('0x3c'),_0x30703e,_0x30703e);}if(!_['isUndefined'](_0x17d88d)&&typeof _0x17d88d===_0x108e('0x3a')&&!_['isEmpty'](_0x17d88d)){return _0x17d88d;}return _0x108e('0x3d');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x53d6bd,_0x57182c){var _0x52c567;var _0xbd0c34;var _0x3575d8;if(_0x57182c<=0x0){_0x57182c=0x1;}_0x52c567=new RegExp(_0x108e('0x3e')+_0x57182c+'}$');_0xbd0c34=Math[_0x108e('0x3f')](0xa,_0x57182c-0x1);_0x3575d8=Math[_0x108e('0x3f')](0xa,_0x57182c)-0x1;return util[_0x108e('0x3b')]('%s',_[_0x108e('0x40')](_0x53d6bd,_0x52c567,_['random'](_0xbd0c34,_0x3575d8)[_0x108e('0x41')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x123ff1){if(_0x123ff1['originated']&&_0x123ff1['originated']>0x0){_0x123ff1[_0x108e('0x25')]-=0x1;}else{logger[_0x108e('0x42')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0x108e('0x43')]=decrementOriginate;function checkContactEmpty(_0x263d19){return _0x263d19&&_0x263d19[_0x108e('0x44')]>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x525a7e,_0x358c0e){if(_0x358c0e===0x0){return 0x0;}var _0x3b6865=0x1;for(var _0x1608a6=0x1;_0x1608a6<=_0x358c0e;_0x1608a6+=0x1){_0x3b6865=0x1+_0x3b6865*_0x1608a6/_0x525a7e;}return 0x1/_0x3b6865;}exports[_0x108e('0x45')]=erlangb;function checkContactLowerLimitOriginate(_0x8cfe5b,_0x4f9810,_0x310e67){if(_0x4f9810>_0x310e67){for(var _0x89833d=0x0;_0x89833d<_0x4f9810-_0x310e67;_0x89833d+=0x1){decrementOriginate(_0x8cfe5b);}}}exports[_0x108e('0x46')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x597e61){var _0x3f2863={};var _0x5daea4=['id',_0x108e('0x47'),_0x108e('0x48'),_0x108e('0x49')];const _0x489fdc=0xfa;if(_0x597e61){for(var _0x1f4b7a in _0x597e61){if(typeof _0x597e61[_0x1f4b7a]!==_0x108e('0x4a')){if(!_[_0x108e('0x2a')](_0x597e61[_0x1f4b7a])&&!_0x5daea4['includes'](_0x1f4b7a)){if(_0x1f4b7a===_0x108e('0x4b')&&_0x597e61[_0x1f4b7a][_0x108e('0x44')]>_0x489fdc){_0x3f2863[_0x108e('0x4c')+_0x1f4b7a[_0x108e('0x4d')]()]=_0x597e61[_0x1f4b7a][_0x108e('0x41')]()[_0x108e('0x4e')](0x0,_0x489fdc);}else{_0x3f2863[_0x108e('0x4c')+_0x1f4b7a[_0x108e('0x4d')]()]=_0x597e61[_0x1f4b7a];}}}}}return _0x3f2863;}exports[_0x108e('0x4f')]=setXMDContactVariables; \ No newline at end of file +var _0x12ff=['extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','createdAt','description','XMD-','toUpperCase','substring','setXMDContactVariables','lodash','moment','util','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RUNNING','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','milliseconds','diff','seconds','getSeconds','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','status','TrunkBackup','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','DISACTIVED','getQueueCampaignActiveStatusMessage','match'];(function(_0x13bebc,_0x4851f4){var _0x34bc12=function(_0x1ac49c){while(--_0x1ac49c){_0x13bebc['push'](_0x13bebc['shift']());}};_0x34bc12(++_0x4851f4);}(_0x12ff,0x72));var _0xf12f=function(_0x581c60,_0x371c9c){_0x581c60=_0x581c60-0x0;var _0x131aaf=_0x12ff[_0x581c60];return _0x131aaf;};'use strict';var _=require(_0xf12f('0x0'));var moment=require(_0xf12f('0x1'));var util=require(_0xf12f('0x2'));var logger=require('../../../../config/logger')(_0xf12f('0x3'));var timezones=require(_0xf12f('0x4'))[_0xf12f('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0xf12f('0x6'),'BLACKLIST':_0xf12f('0x7'),'CONTACTS_RESCHEDULED':_0xf12f('0x8'),'DEACTIVATED':_0xf12f('0x9'),'DISACTIVED':_0xf12f('0xa'),'EMPTY_INTERVAL':_0xf12f('0xb'),'INACTIVE':_0xf12f('0xc'),'NO_AGENTS_LOGGED':_0xf12f('0xd'),'NO_AVAILABLE_CONTACTS':_0xf12f('0xe'),'NULL_INTERVAL':_0xf12f('0xf'),'OVERTIME_INTERVAL':_0xf12f('0x10'),'OVERTIME_GLOBAL_INTERVAL':_0xf12f('0x11'),'QUEUE_RECALL':_0xf12f('0x12'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':_0xf12f('0x13'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0xf12f('0x14')};exports[_0xf12f('0x15')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x30bb57){return _0x30bb57[_0xf12f('0x16')]==='preview';}exports[_0xf12f('0x17')]=isPreviewCampaign;function isIVRCampaign(_0x479403){return _0x479403[_0xf12f('0x18')]===_0xf12f('0x19');}exports[_0xf12f('0x1a')]=isIVRCampaign;function isOutboundQueue(_0x136a08){return _0x136a08[_0xf12f('0x18')]===_0xf12f('0x1b');}exports[_0xf12f('0x1c')]=isOutboundQueue;function isQueueCampaignActive(_0x407967){return _0x407967[_0xf12f('0x1d')];}exports[_0xf12f('0x1e')]=isQueueCampaignActive;function isIVRCampaignActive(_0x1705f4){return _0x1705f4[_0xf12f('0x1f')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x5b9569,_0x2023e5){var _0x449f27=moment(_0x5b9569)[_0xf12f('0x20')](0x0);var _0x5a1c9e=moment(_0x2023e5)['milliseconds'](0x0);return _0x449f27[_0xf12f('0x21')](_0x5a1c9e,_0xf12f('0x22'));}exports[_0xf12f('0x23')]=getSeconds;function hasQueueCampaignDataChanged(_0x93e25,_0x4b5d0a){var _0x3859be=![];var _0x53717f=_0x93e25[_0xf12f('0x16')]!==_0x4b5d0a[_0xf12f('0x16')]||_0x93e25[_0xf12f('0x1d')]!==_0x4b5d0a['dialActive']||_0x93e25['message']!==_0x4b5d0a['message'];var _0x21745b=_0x93e25[_0xf12f('0x24')]!==_0x4b5d0a[_0xf12f('0x24')]||_0x93e25[_0xf12f('0x25')]!==_0x4b5d0a[_0xf12f('0x25')]||_0x93e25[_0xf12f('0x26')]!==_0x4b5d0a['loggedInDb']||_0x93e25[_0xf12f('0x27')]!==_0x4b5d0a[_0xf12f('0x27')]||_0x93e25[_0xf12f('0x28')]!==_0x4b5d0a['talking']||_0x93e25[_0xf12f('0x29')]!==_0x4b5d0a[_0xf12f('0x29')]||_0x93e25[_0xf12f('0x2a')]!==_0x4b5d0a[_0xf12f('0x2a')]||_0x93e25[_0xf12f('0x2b')]!==_0x4b5d0a[_0xf12f('0x2b')]||_0x93e25[_0xf12f('0x2c')]!==_0x4b5d0a[_0xf12f('0x2c')];if(_0x93e25[_0xf12f('0x2d')]&&_0x4b5d0a[_0xf12f('0x2d')]){_0x3859be=_0x93e25[_0xf12f('0x2d')]['name']!==_0x4b5d0a['Trunk'][_0xf12f('0x2e')]||_0x93e25[_0xf12f('0x2d')][_0xf12f('0x1f')]!==_0x4b5d0a[_0xf12f('0x2d')]['active'];}return _0x53717f||_0x21745b||_0x3859be;}exports[_0xf12f('0x2f')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x1d9063){var _0x2b6918=null;var _0x244d86=_0x1d9063[_0xf12f('0x30')];if(_[_0xf12f('0x31')](_0x1d9063['dialGlobalInterval'])||_[_0xf12f('0x31')](_0x1d9063[_0xf12f('0x32')])||_['isNil'](_0x1d9063[_0xf12f('0x32')][_0xf12f('0x33')])){_0x2b6918=CAMPAIGN_STATUS[_0xf12f('0x34')];}else if(_[_0xf12f('0x35')](_0x1d9063['dialGlobalInterval'])||_['isEmpty'](_0x1d9063[_0xf12f('0x32')][_0xf12f('0x33')])){_0x2b6918=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x244d86&&!timezones[_0x244d86]){_0x2b6918=CAMPAIGN_STATUS[_0xf12f('0x36')];}return _0x2b6918;}function checkAnyValidTrunk(_0x515e5c,_0x115668){var _0x176981=null;var _0x23a0ca=_0xf12f('0x37');var _0x342f20=[_0xf12f('0x38'),_0xf12f('0x39')];var _0x3e1034=!![];if(_0x515e5c[_0xf12f('0x2d')]&&_0x515e5c['Trunk'][_0xf12f('0x1f')]){_0x23a0ca+=_0x515e5c['Trunk'][_0xf12f('0x2e')];_0x176981=_0x115668[_0x23a0ca];_0x3e1034=_0x342f20['includes'](_0x176981[_0xf12f('0x3a')]);}else if(_0x515e5c[_0xf12f('0x3b')]&&_0x515e5c['TrunkBackup']['active']){_0x23a0ca+=_0x515e5c['TrunkBackup'][_0xf12f('0x2e')];_0x176981=_0x115668[_0x23a0ca];_0x3e1034=_0x342f20['includes'](_0x176981['status']);}return _0x3e1034;}function getQueueCampaignStatusMessage(_0x3aaf87,_0x27a758){var _0x38e044=CAMPAIGN_STATUS[_0xf12f('0x6')];var _0x391964=isPreviewCampaign(_0x3aaf87);if(!isQueueCampaignActive(_0x3aaf87)){if(_0x391964){_0x38e044=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x3aaf87[_0xf12f('0x2c')]===0x0&&_0x3aaf87['talking']===0x0&&_0x3aaf87[_0xf12f('0x2a')]===0x0&&(_0x3aaf87[_0xf12f('0x29')]||0x0)===0x0){_0x38e044=CAMPAIGN_STATUS[_0xf12f('0x3c')];}else{_0x38e044=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x3aaf87['loggedIn']===0x0){_0x38e044=CAMPAIGN_STATUS[_0xf12f('0x3d')];}else if(!checkAnyValidTrunk(_0x3aaf87,_0x27a758)){_0x38e044=CAMPAIGN_STATUS[_0xf12f('0x3e')];}else if(!isPreviewCampaign(_0x3aaf87)){var _0x35e5b2=checkAnyValidQueueCampaignInterval(_0x3aaf87);if(_0x35e5b2){_0x38e044=_0x35e5b2;}}return _0x38e044;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x5cd8f1){var _0x555a12=CAMPAIGN_STATUS[_0xf12f('0x3f')];if(_0x5cd8f1[_0xf12f('0x2c')]===0x0&&_0x5cd8f1['talking']===0x0&&_0x5cd8f1[_0xf12f('0x2a')]===0x0&&(_0x5cd8f1[_0xf12f('0x29')]||0x0)===0x0){_0x555a12=CAMPAIGN_STATUS['INACTIVE'];}return _0x555a12;}exports[_0xf12f('0x40')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x4d61e8){var _0xe4228c=_0x4d61e8[_0xf12f('0x41')](/"(.*?)"/);return _0xe4228c?_0xe4228c[0x1]:_0x4d61e8;}exports[_0xf12f('0x42')]=extractCalleridName;function getCallerId(_0x260422,_0x2ec34f,_0x226899){if(!_[_0xf12f('0x43')](_0x226899)&&typeof _0x226899==='string'&&!_['isEmpty'](_0x226899)){if(!_['isUndefined'](_0x2ec34f)&&typeof _0x2ec34f===_0xf12f('0x44')&&!_[_0xf12f('0x35')](_0x2ec34f)){return util[_0xf12f('0x45')](_0xf12f('0x46'),_0x2ec34f,_0x226899);}return util['format']('\x22%s\x22\x20<%s>',_0x226899,_0x226899);}if(!_['isUndefined'](_0x260422)&&typeof _0x260422===_0xf12f('0x44')&&!_[_0xf12f('0x35')](_0x260422)){return _0x260422;}return _0xf12f('0x47');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x3069dd,_0x514e0f){var _0x256929;var _0x4d00db;var _0x37510f;if(_0x514e0f<=0x0){_0x514e0f=0x1;}_0x256929=new RegExp(_0xf12f('0x48')+_0x514e0f+'}$');_0x4d00db=Math[_0xf12f('0x49')](0xa,_0x514e0f-0x1);_0x37510f=Math[_0xf12f('0x49')](0xa,_0x514e0f)-0x1;return util[_0xf12f('0x45')]('%s',_[_0xf12f('0x4a')](_0x3069dd,_0x256929,_[_0xf12f('0x4b')](_0x4d00db,_0x37510f)[_0xf12f('0x4c')]()));}exports[_0xf12f('0x4d')]=getCallerIdRandom;function decrementOriginate(_0x30f7bb){if(_0x30f7bb[_0xf12f('0x2c')]&&_0x30f7bb[_0xf12f('0x2c')]>0x0){_0x30f7bb[_0xf12f('0x2c')]-=0x1;}else{logger[_0xf12f('0x4e')](_0xf12f('0x4f'));}}exports[_0xf12f('0x50')]=decrementOriginate;function checkContactEmpty(_0x1282a2){return _0x1282a2&&_0x1282a2[_0xf12f('0x51')]>0x0;}exports[_0xf12f('0x52')]=checkContactEmpty;function erlangb(_0x5d714b,_0x1c9a11){if(_0x1c9a11===0x0){return 0x0;}var _0x483fa1=0x1;for(var _0x5165b4=0x1;_0x5165b4<=_0x1c9a11;_0x5165b4+=0x1){_0x483fa1=0x1+_0x483fa1*_0x5165b4/_0x5d714b;}return 0x1/_0x483fa1;}exports[_0xf12f('0x53')]=erlangb;function checkContactLowerLimitOriginate(_0x929394,_0x293ed1,_0x56a886){if(_0x293ed1>_0x56a886){for(var _0x24f9be=0x0;_0x24f9be<_0x293ed1-_0x56a886;_0x24f9be+=0x1){decrementOriginate(_0x929394);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x55105b){var _0x333cbe={};var _0x25407a=['id',_0xf12f('0x54'),'tags','updatedAt'];const _0x574567=0xfa;if(_0x55105b){for(var _0x58d608 in _0x55105b){if(typeof _0x55105b[_0x58d608]!=='undefined'){if(!_[_0xf12f('0x31')](_0x55105b[_0x58d608])&&!_0x25407a['includes'](_0x58d608)){if(_0x58d608===_0xf12f('0x55')&&_0x55105b[_0x58d608][_0xf12f('0x51')]>_0x574567){_0x333cbe[_0xf12f('0x56')+_0x58d608[_0xf12f('0x57')]()]=_0x55105b[_0x58d608][_0xf12f('0x4c')]()[_0xf12f('0x58')](0x0,_0x574567);}else{_0x333cbe[_0xf12f('0x56')+_0x58d608[_0xf12f('0x57')]()]=_0x55105b[_0x58d608];}}}}}return _0x333cbe;}exports[_0xf12f('0x59')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index f009d37..f85c772 100644 --- a/server/services/ami/fax/action.js +++ b/server/services/ami/fax/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x5d489e,_0x4caf41){var _0x33a2e2=function(_0x15b13f){while(--_0x15b13f){_0x5d489e['push'](_0x5d489e['shift']());}};_0x33a2e2(++_0x4caf41);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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(_0x264283,_0x44a9d4){var _0x33130d=function(_0xeed57c){while(--_0xeed57c){_0x264283['push'](_0x264283['shift']());}};_0x33130d(++_0x44a9d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 01bffee..679bcce 100644 --- a/server/services/ami/fax/index.js +++ b/server/services/ami/fax/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c7d=['../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','bind','varset','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','syncOriginateResponse','syncNewchannel','from-voip-provider','hasOwnProperty','uniqueid','channel','name','info','actions','\x20syncNewchannel\x20','prototype','syncVarSet','variable','value','channelstate','channelstatedesc','syncNewExten','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','application/pdf','then','notify','fax','\x20notify\x20','stringify','catch','error','\x20receiveFax\x20','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','execute','%s/%s.tif','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','reachable','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./rpcDb','./channel','./util/util','./action'];(function(_0x1b3a09,_0x20c774){var _0x357bb8=function(_0xd7c6d2){while(--_0xd7c6d2){_0x1b3a09['push'](_0x1b3a09['shift']());}};_0x357bb8(++_0x20c774);}(_0x3c7d,0x69));var _0xd3c7=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x3c7d[_0x35da42];return _0x370035;};'use strict';var util=require('util');var _=require(_0xd3c7('0x0'));var BPromise=require('bluebird');var uuid=require(_0xd3c7('0x1'));var moment=require(_0xd3c7('0x2'));var path=require(_0xd3c7('0x3'));var tiff2pdf=require(_0xd3c7('0x4'));var gs=require(_0xd3c7('0x5'));var logger=require(_0xd3c7('0x6'))('fax');var ami=require(_0xd3c7('0x7'));var rpcDb=require(_0xd3c7('0x8'));var Channel=require(_0xd3c7('0x9'));var ut=require(_0xd3c7('0xa'));var Action=require(_0xd3c7('0xb'));var faxAccount=require(_0xd3c7('0xc'));var attachment=require(_0xd3c7('0xd'));var faxMessage=require(_0xd3c7('0xe'));function Fax(_0x2f1b2e){this[_0xd3c7('0xf')]={};this[_0xd3c7('0x10')]=_0x2f1b2e[_0xd3c7('0x10')];this['trunks']=_0x2f1b2e[_0xd3c7('0x11')];this['actions']={};ami['on'](_0xd3c7('0x12'),this['syncNewchannel'][_0xd3c7('0x13')](this));ami['on'](_0xd3c7('0x14'),this['syncVarSet'][_0xd3c7('0x13')](this));ami['on'](_0xd3c7('0x15'),this[_0xd3c7('0x16')][_0xd3c7('0x13')](this));ami['on'](_0xd3c7('0x17'),this['syncNewExten']['bind'](this));ami['on'](_0xd3c7('0x18'),this[_0xd3c7('0x19')]['bind'](this));ami['on'](_0xd3c7('0x1a'),this[_0xd3c7('0x1b')][_0xd3c7('0x13')](this));ami['on']('hangup',this[_0xd3c7('0x1c')][_0xd3c7('0x13')](this));ami['on']('originateresponse',this[_0xd3c7('0x1d')][_0xd3c7('0x13')](this));}Fax['prototype'][_0xd3c7('0x1e')]=function(_0x5e3f1c){if(_0x5e3f1c['context']===_0xd3c7('0x1f')){for(var _0x51987e in this['faxAccounts']){if(this[_0xd3c7('0x10')][_0xd3c7('0x20')](_0x51987e)){if(_0x5e3f1c['exten']===this[_0xd3c7('0x10')][_0x51987e]['localstationid']){this[_0xd3c7('0xf')][_0x5e3f1c[_0xd3c7('0x21')]]={};this[_0xd3c7('0xf')][_0x5e3f1c['uniqueid']][_0xd3c7('0x22')]=_0x5e3f1c[_0xd3c7('0x22')];this[_0xd3c7('0xf')][_0x5e3f1c[_0xd3c7('0x21')]]['id']=this[_0xd3c7('0x10')][_0x51987e]['id'];this['channels'][_0x5e3f1c['uniqueid']][_0xd3c7('0x23')]=this[_0xd3c7('0x10')][_0x51987e][_0xd3c7('0x23')];logger[_0xd3c7('0x24')](_0x5e3f1c[_0xd3c7('0x21')],'\x20syncNewchannel\x20');}}}}if(this[_0xd3c7('0x25')][_0x5e3f1c[_0xd3c7('0x21')]]){this[_0xd3c7('0xf')][_0x5e3f1c['uniqueid']]={};this['channels'][_0x5e3f1c[_0xd3c7('0x21')]]['channel']=_0x5e3f1c[_0xd3c7('0x22')];logger[_0xd3c7('0x24')](_0x5e3f1c[_0xd3c7('0x21')],_0xd3c7('0x26'));}};Fax[_0xd3c7('0x27')][_0xd3c7('0x28')]=function(_0x3e9200){if(this[_0xd3c7('0xf')][_0x3e9200[_0xd3c7('0x21')]]){for(var _0x51a62c in _0x3e9200[_0xd3c7('0x29')]){if(_0x3e9200[_0xd3c7('0x29')][_0xd3c7('0x20')](_0x51a62c)){this[_0xd3c7('0xf')][_0x3e9200[_0xd3c7('0x21')]][_0x51a62c]=_0x3e9200[_0xd3c7('0x2a')];}}}};Fax[_0xd3c7('0x27')]['syncNewState']=function(_0x2ae7a2){if(this[_0xd3c7('0xf')][_0x2ae7a2[_0xd3c7('0x21')]]){this['channels'][_0x2ae7a2['uniqueid']]['channelstate']=_0x2ae7a2[_0xd3c7('0x2b')];this[_0xd3c7('0xf')][_0x2ae7a2[_0xd3c7('0x21')]][_0xd3c7('0x2c')]=_0x2ae7a2['channelstatedesc'];}};Fax[_0xd3c7('0x27')][_0xd3c7('0x2d')]=function(_0x58dc1e){if(this[_0xd3c7('0xf')][_0x58dc1e[_0xd3c7('0x21')]]){for(var _0x1ac34e in _0x58dc1e['variable']){if(_0x58dc1e[_0xd3c7('0x29')][_0xd3c7('0x20')](_0x1ac34e)){this[_0xd3c7('0xf')][_0x58dc1e['uniqueid']][_0x1ac34e]=_0x58dc1e[_0xd3c7('0x2a')];}}}};Fax['prototype'][_0xd3c7('0x19')]=function(_0x34f2ce){if(this[_0xd3c7('0xf')][_0x34f2ce['uniqueid']]){this[_0xd3c7('0xf')][_0x34f2ce[_0xd3c7('0x21')]]['operation']=_0x34f2ce[_0xd3c7('0x2e')];this[_0xd3c7('0xf')][_0x34f2ce['uniqueid']][_0xd3c7('0x2f')]=_0x34f2ce['status'];this[_0xd3c7('0xf')][_0x34f2ce['uniqueid']]['localstationid']=_0x34f2ce[_0xd3c7('0x30')];this['channels'][_0x34f2ce[_0xd3c7('0x21')]][_0xd3c7('0x31')]=_0x34f2ce['filename'];logger[_0xd3c7('0x24')](_0x34f2ce[_0xd3c7('0x21')],_0xd3c7('0x32'));}};Fax[_0xd3c7('0x27')]['syncReceiveFax']=function(_0x482775){var _0x56a322=this;if(this[_0xd3c7('0xf')][_0x482775['uniqueid']]){var _0x45e8de=this['channels'][_0x482775[_0xd3c7('0x21')]]['id'];this[_0xd3c7('0xf')][_0x482775[_0xd3c7('0x21')]]['remotestationid']=_0x482775[_0xd3c7('0x33')];this['channels'][_0x482775[_0xd3c7('0x21')]][_0xd3c7('0x34')]=_0x482775[_0xd3c7('0x34')];this['channels'][_0x482775['uniqueid']][_0xd3c7('0x30')]=_0x482775[_0xd3c7('0x30')];this['channels'][_0x482775[_0xd3c7('0x21')]][_0xd3c7('0x35')]=_0x482775[_0xd3c7('0x35')];this[_0xd3c7('0xf')][_0x482775[_0xd3c7('0x21')]][_0xd3c7('0x36')]=_0x482775['transferrate'];this[_0xd3c7('0xf')][_0x482775[_0xd3c7('0x21')]]['filename']=_0x482775[_0xd3c7('0x31')];this[_0xd3c7('0xf')][_0x482775[_0xd3c7('0x21')]][_0xd3c7('0x37')]=_0x482775[_0xd3c7('0x37')];if(this[_0xd3c7('0xf')][_0x482775[_0xd3c7('0x21')]][_0xd3c7('0x34')]>0x0){tiff2pdf(_0x482775[_0xd3c7('0x31')],_0xd3c7('0x38'),function(_0x449586){logger['info'](_0x482775[_0xd3c7('0x21')],'\x20result\x20conversion\x20file\x20',_0x449586[_0xd3c7('0x39')]);attachment[_0xd3c7('0x3a')]({'name':path[_0xd3c7('0x3b')](_0x482775[_0xd3c7('0x31')])['name'],'basename':path[_0xd3c7('0x3b')](_0x482775['filename'])[_0xd3c7('0x23')]+'.pdf','type':_0xd3c7('0x3c')})[_0xd3c7('0x3d')](function(_0xdd017b){faxAccount[_0xd3c7('0x3e')](_0x45e8de,{'from':_0x482775['calleridnum'],'mapKey':_0xd3c7('0x3f'),'body':path[_0xd3c7('0x3b')](_0x482775[_0xd3c7('0x31')])[_0xd3c7('0x23')]+'.pdf','AttachmentId':_0xdd017b['id']})['catch'](function(_0x577d54){logger['error'](_0x482775[_0xd3c7('0x21')],_0xd3c7('0x40'),JSON[_0xd3c7('0x41')](_0x577d54));});})[_0xd3c7('0x42')](function(_0x41017c){logger[_0xd3c7('0x43')](_0x482775[_0xd3c7('0x21')],_0xd3c7('0x44'),JSON[_0xd3c7('0x41')](_0x41017c));});});}logger['info'](_0x482775[_0xd3c7('0x21')],'\x20receiveFax\x20');}};Fax[_0xd3c7('0x27')][_0xd3c7('0x1d')]=function(_0x43cd3f){if(this[_0xd3c7('0x25')][_0x43cd3f[_0xd3c7('0x21')]]){_['merge'](this[_0xd3c7('0xf')][_0x43cd3f[_0xd3c7('0x21')]],_[_0xd3c7('0x45')](_0x43cd3f,['response',_0xd3c7('0x46')]));}};function updateStatus(_0x560e0e){if(_0x560e0e[_0xd3c7('0x47')]){faxMessage[_0xd3c7('0x48')](_0x560e0e[_0xd3c7('0x47')],{'failMessage':_0xd3c7('0x49')})[_0xd3c7('0x3d')](function(_0x524c15){ut[_0xd3c7('0x4a')](_0xd3c7('0x4b'),_0x524c15);})[_0xd3c7('0x42')](function(_0x4c2052){ut['logger'](_0xd3c7('0x4c'),_0x4c2052);});}else{ut['logger'](_0xd3c7('0x4d'));}}Fax['prototype'][_0xd3c7('0x4e')]=function(_0x161e4f,_0x58fe6f,_0x9c6795){var _0x3da983=this;var _0x494e39={};if(_0x58fe6f){_0x494e39={'read':_0x58fe6f};}else{_0x494e39={'failMessage':_0x9c6795};}if(this[_0xd3c7('0x25')][_0x161e4f][_0xd3c7('0x47')]){faxMessage[_0xd3c7('0x48')](this['actions'][_0x161e4f][_0xd3c7('0x47')],_0x494e39)[_0xd3c7('0x3d')](function(_0x2a5a81){ut[_0xd3c7('0x4a')]('[Fax][Message][Updated]',_0x2a5a81);})['catch'](function(_0x34bdc9){ut['logger'](_0xd3c7('0x4f'),_0x34bdc9);})['finally'](function(){delete _0x3da983[_0xd3c7('0xf')][_0x161e4f];delete _0x3da983[_0xd3c7('0x25')][_0x161e4f];});}else{ut[_0xd3c7('0x4a')]('[Fax][Message][NoUpdate2]');delete this[_0xd3c7('0xf')][_0x161e4f];delete this[_0xd3c7('0x25')][_0x161e4f];}};Fax['prototype'][_0xd3c7('0x1c')]=function(_0x55bfd9){var _0x536bfe=this;if(this['channels'][_0x55bfd9['uniqueid']]){if(this[_0xd3c7('0x25')][_0x55bfd9[_0xd3c7('0x21')]]){this[_0xd3c7('0xf')][_0x55bfd9['uniqueid']]['id']=this[_0xd3c7('0x25')][_0x55bfd9['uniqueid']]['id'];this[_0xd3c7('0xf')][_0x55bfd9['uniqueid']]['name']=this['actions'][_0x55bfd9[_0xd3c7('0x21')]][_0xd3c7('0x23')];}logger[_0xd3c7('0x24')](_0x55bfd9[_0xd3c7('0x21')],this['actions'][_0x55bfd9[_0xd3c7('0x21')]]?_0xd3c7('0x50'):_0xd3c7('0x51'),JSON[_0xd3c7('0x41')](this[_0xd3c7('0xf')][_0x55bfd9[_0xd3c7('0x21')]]));if(this['actions'][_0x55bfd9[_0xd3c7('0x21')]]){if(this['channels'][_0x55bfd9['uniqueid']][_0xd3c7('0x52')]>0x0&&this[_0xd3c7('0xf')][_0x55bfd9[_0xd3c7('0x21')]]['faxstatus']==='SUCCESS'){this[_0xd3c7('0x4e')](_0x55bfd9['uniqueid'],!![]);}else{this[_0xd3c7('0x4e')](_0x55bfd9[_0xd3c7('0x21')],![],this[_0xd3c7('0xf')][_0x55bfd9[_0xd3c7('0x21')]][_0xd3c7('0x53')]?'SENDING\x20FAILED:\x20'+this[_0xd3c7('0xf')][_0x55bfd9['uniqueid']][_0xd3c7('0x53')]:'SENDING\x20FAILED');}}}};Fax['prototype'][_0xd3c7('0x54')]=function(_0x1da803){var _0x34504d=this;return new BPromise(function(_0x13ddb4,_0x57775e){_0x34504d[_0xd3c7('0x55')](_0x1da803,_0x34504d[_0xd3c7('0x10')][_0x1da803[_0xd3c7('0x56')]])['then'](function(_0x2de618){ut['logger'](_0xd3c7('0x57'),_0x2de618);_0x13ddb4(ut[_0xd3c7('0x39')](_0xd3c7('0x58')));})[_0xd3c7('0x42')](function(_0x34f588){ut[_0xd3c7('0x4a')](_0xd3c7('0x59'),_0x34f588);updateStatus(_0x1da803);_0x57775e(ut['message'](_0xd3c7('0x5a')));});});};Fax['prototype']['checkAfterSend']=function(_0x155284){var _0x57878a=this;return new BPromise(function(_0xd92991,_0x1f9138){var _0x3556bf=_0x57878a[_0xd3c7('0x5b')](_0x57878a['faxAccounts'][_0x155284[_0xd3c7('0x56')]][_0xd3c7('0x5c')],_0x155284);if(_0x3556bf[_0xd3c7('0x5d')]){_0xd92991(ut['message'](_0xd3c7('0x5e')));}else{_0x1f9138(ut[_0xd3c7('0x39')](_0x3556bf[_0xd3c7('0x39')]));}});};function originate(_0x32f2f9,_0x43b6c9,_0x1892ef){return new BPromise(function(_0x37a589,_0x12e511){if(_0x1892ef){var _0x1f0b44=util[_0xd3c7('0x5f')]('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[_0xd3c7('0x3b')](_0x32f2f9[_0xd3c7('0x3')])[_0xd3c7('0x23')],_0x32f2f9[_0xd3c7('0x3')]);gs[_0xd3c7('0x60')](_0x1f0b44)[_0xd3c7('0x3d')](function(){_0x32f2f9[_0xd3c7('0x3')]=util[_0xd3c7('0x5f')](_0xd3c7('0x61'),path['parse'](_0x32f2f9['path'])['dir'],path[_0xd3c7('0x3b')](_0x32f2f9[_0xd3c7('0x3')])[_0xd3c7('0x23')]);_0x43b6c9['XMF-PATH']=_0x32f2f9[_0xd3c7('0x3')];ut[_0xd3c7('0x4a')](_0xd3c7('0x62'),'');ami[_0xd3c7('0x63')](ut['variablesAction'](_0x32f2f9,_0x43b6c9))[_0xd3c7('0x3d')](function(_0x15cc76){_0x37a589(_0x15cc76);})['catch'](function(_0x4650e8){_0x12e511(_0x4650e8);});})['catch'](function(_0x466f78){_0x12e511(_0x466f78);});}else{ami[_0xd3c7('0x63')](ut[_0xd3c7('0x64')](_0x32f2f9,_0x43b6c9))[_0xd3c7('0x3d')](function(_0x29aeb4){_0x37a589(_0x29aeb4);})['catch'](function(_0x2a12a9){_0x12e511(_0x2a12a9);});}});}Fax[_0xd3c7('0x27')][_0xd3c7('0x55')]=function(_0x4546b4,_0x3ba3a9){var _0x185d65=this;return new BPromise(function(_0x4b8da7,_0x1b7d45){var _0x545c02=uuid['v4']();var _0x502967=ut[_0xd3c7('0x65')](_0x4546b4,_0x3ba3a9);_0x185d65['actions'][_0x545c02]=new Action(_0x545c02,_0x3ba3a9,_0x4546b4);var _0x18e955=_0x185d65[_0xd3c7('0x25')][_0x545c02];if(path['parse'](_0x4546b4[_0xd3c7('0x3')])[_0xd3c7('0x66')]==='.pdf'){originate(_0x18e955,_0x502967,!![])[_0xd3c7('0x3d')](function(_0xb7692f){_0x4b8da7(_0xb7692f);})[_0xd3c7('0x42')](function(_0x189b8c){_0x1b7d45(_0x189b8c);});}else{originate(_0x18e955,_0x502967,![])[_0xd3c7('0x3d')](function(_0xcdc4bf){_0x4b8da7(_0xcdc4bf);})[_0xd3c7('0x42')](function(_0x41f129){_0x1b7d45(_0x41f129);});}});};Fax[_0xd3c7('0x27')]['isTrunkReachable']=function(_0x129389){return!_[_0xd3c7('0x67')](_0x129389)&&!_[_0xd3c7('0x67')](_0x129389['name'])&&!_['isNil'](_0x129389[_0xd3c7('0x68')])&&_0x129389[_0xd3c7('0x68')]&&!_['isNil'](this[_0xd3c7('0x11')][util[_0xd3c7('0x5f')](_0xd3c7('0x69'),_0x129389[_0xd3c7('0x23')])])&&!_[_0xd3c7('0x67')](this[_0xd3c7('0x11')][util[_0xd3c7('0x5f')]('SIP/%s',_0x129389[_0xd3c7('0x23')])][_0xd3c7('0x2f')])&&(this[_0xd3c7('0x11')][util[_0xd3c7('0x5f')]('SIP/%s',_0x129389['name'])][_0xd3c7('0x2f')]===_0xd3c7('0x6a')||this[_0xd3c7('0x11')][util[_0xd3c7('0x5f')](_0xd3c7('0x69'),_0x129389[_0xd3c7('0x23')])]['status']==='unmonitored');};Fax[_0xd3c7('0x27')][_0xd3c7('0x5b')]=function(_0x379259,_0x4dd728){if(!this[_0xd3c7('0x6b')](_0x379259)){ut[_0xd3c7('0x4a')](_0xd3c7('0x6c'),_[_0xd3c7('0x67')](_0x379259)?'':_0x379259[_0xd3c7('0x23')]+_0xd3c7('0x6d'));return{'isValid':![],'message':_0xd3c7('0x6e')};}if(_[_0xd3c7('0x67')](_0x4dd728[_0xd3c7('0x3f')])){ut[_0xd3c7('0x4a')](_0xd3c7('0x6f'),JSON['stringify'](_0x4dd728));return{'isValid':![],'message':_0xd3c7('0x70')};}if(_[_0xd3c7('0x67')](_0x4dd728[_0xd3c7('0x3')])){ut[_0xd3c7('0x4a')](_0xd3c7('0x71'),JSON['stringify'](_0x4dd728));return{'isValid':![],'message':_0xd3c7('0x72')};}return{'isValid':!![],'message':_0xd3c7('0x73')};};module[_0xd3c7('0x74')]=Fax; \ No newline at end of file +var _0x8ec0=['catch','\x20receiveFax\x20','merge','pick','response','update','AttachmentId','logger','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','message','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','format','dir','Action','addVariables','ext','.pdf','isTrunkReachable','isNil','active','SIP/%s','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','uuid','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','prototype','syncVarSet','value','channelstate','channelstatedesc','variable','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','application/pdf','then','notify','error','\x20notify\x20','stringify'];(function(_0x3657ed,_0x1a2122){var _0x199755=function(_0x3dd259){while(--_0x3dd259){_0x3657ed['push'](_0x3657ed['shift']());}};_0x199755(++_0x1a2122);}(_0x8ec0,0x9d));var _0x08ec=function(_0x4afa16,_0x12ecd0){_0x4afa16=_0x4afa16-0x0;var _0x1214c7=_0x8ec0[_0x4afa16];return _0x1214c7;};'use strict';var util=require('util');var _=require(_0x08ec('0x0'));var BPromise=require(_0x08ec('0x1'));var uuid=require(_0x08ec('0x2'));var moment=require('moment');var path=require(_0x08ec('0x3'));var tiff2pdf=require(_0x08ec('0x4'));var gs=require(_0x08ec('0x5'));var logger=require(_0x08ec('0x6'))(_0x08ec('0x7'));var ami=require(_0x08ec('0x8'));var rpcDb=require(_0x08ec('0x9'));var Channel=require(_0x08ec('0xa'));var ut=require(_0x08ec('0xb'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0x08ec('0xc'));function Fax(_0x267077){this[_0x08ec('0xd')]={};this[_0x08ec('0xe')]=_0x267077['faxAccounts'];this[_0x08ec('0xf')]=_0x267077[_0x08ec('0xf')];this['actions']={};ami['on'](_0x08ec('0x10'),this[_0x08ec('0x11')][_0x08ec('0x12')](this));ami['on'](_0x08ec('0x13'),this['syncVarSet'][_0x08ec('0x12')](this));ami['on']('newstate',this[_0x08ec('0x14')]['bind'](this));ami['on'](_0x08ec('0x15'),this[_0x08ec('0x16')]['bind'](this));ami['on'](_0x08ec('0x17'),this[_0x08ec('0x18')][_0x08ec('0x12')](this));ami['on'](_0x08ec('0x19'),this[_0x08ec('0x1a')][_0x08ec('0x12')](this));ami['on'](_0x08ec('0x1b'),this[_0x08ec('0x1c')][_0x08ec('0x12')](this));ami['on']('originateresponse',this[_0x08ec('0x1d')][_0x08ec('0x12')](this));}Fax['prototype'][_0x08ec('0x11')]=function(_0x2fdb7d){if(_0x2fdb7d['context']==='from-voip-provider'){for(var _0x2142d5 in this['faxAccounts']){if(this[_0x08ec('0xe')][_0x08ec('0x1e')](_0x2142d5)){if(_0x2fdb7d[_0x08ec('0x1f')]===this['faxAccounts'][_0x2142d5]['localstationid']){this[_0x08ec('0xd')][_0x2fdb7d[_0x08ec('0x20')]]={};this['channels'][_0x2fdb7d[_0x08ec('0x20')]][_0x08ec('0x21')]=_0x2fdb7d[_0x08ec('0x21')];this[_0x08ec('0xd')][_0x2fdb7d[_0x08ec('0x20')]]['id']=this['faxAccounts'][_0x2142d5]['id'];this[_0x08ec('0xd')][_0x2fdb7d[_0x08ec('0x20')]]['name']=this['faxAccounts'][_0x2142d5][_0x08ec('0x22')];logger[_0x08ec('0x23')](_0x2fdb7d['uniqueid'],_0x08ec('0x24'));}}}}if(this[_0x08ec('0x25')][_0x2fdb7d[_0x08ec('0x20')]]){this[_0x08ec('0xd')][_0x2fdb7d[_0x08ec('0x20')]]={};this['channels'][_0x2fdb7d['uniqueid']]['channel']=_0x2fdb7d['channel'];logger[_0x08ec('0x23')](_0x2fdb7d[_0x08ec('0x20')],_0x08ec('0x24'));}};Fax[_0x08ec('0x26')][_0x08ec('0x27')]=function(_0x268a34){if(this['channels'][_0x268a34[_0x08ec('0x20')]]){for(var _0x183e16 in _0x268a34['variable']){if(_0x268a34['variable'][_0x08ec('0x1e')](_0x183e16)){this[_0x08ec('0xd')][_0x268a34[_0x08ec('0x20')]][_0x183e16]=_0x268a34[_0x08ec('0x28')];}}}};Fax[_0x08ec('0x26')][_0x08ec('0x14')]=function(_0x598e36){if(this[_0x08ec('0xd')][_0x598e36[_0x08ec('0x20')]]){this['channels'][_0x598e36[_0x08ec('0x20')]][_0x08ec('0x29')]=_0x598e36[_0x08ec('0x29')];this[_0x08ec('0xd')][_0x598e36[_0x08ec('0x20')]][_0x08ec('0x2a')]=_0x598e36['channelstatedesc'];}};Fax[_0x08ec('0x26')][_0x08ec('0x16')]=function(_0x16b098){if(this[_0x08ec('0xd')][_0x16b098[_0x08ec('0x20')]]){for(var _0x40ce25 in _0x16b098[_0x08ec('0x2b')]){if(_0x16b098['variable'][_0x08ec('0x1e')](_0x40ce25)){this[_0x08ec('0xd')][_0x16b098[_0x08ec('0x20')]][_0x40ce25]=_0x16b098[_0x08ec('0x28')];}}}};Fax[_0x08ec('0x26')][_0x08ec('0x18')]=function(_0x34b4aa){if(this['channels'][_0x34b4aa['uniqueid']]){this['channels'][_0x34b4aa[_0x08ec('0x20')]][_0x08ec('0x2c')]=_0x34b4aa['operation'];this[_0x08ec('0xd')][_0x34b4aa[_0x08ec('0x20')]][_0x08ec('0x2d')]=_0x34b4aa[_0x08ec('0x2d')];this['channels'][_0x34b4aa[_0x08ec('0x20')]][_0x08ec('0x2e')]=_0x34b4aa[_0x08ec('0x2e')];this[_0x08ec('0xd')][_0x34b4aa[_0x08ec('0x20')]][_0x08ec('0x2f')]=_0x34b4aa[_0x08ec('0x2f')];logger[_0x08ec('0x23')](_0x34b4aa[_0x08ec('0x20')],_0x08ec('0x30'));}};Fax['prototype'][_0x08ec('0x1a')]=function(_0x49ca96){var _0x260771=this;if(this[_0x08ec('0xd')][_0x49ca96['uniqueid']]){var _0x24689b=this['channels'][_0x49ca96['uniqueid']]['id'];this['channels'][_0x49ca96['uniqueid']][_0x08ec('0x31')]=_0x49ca96['remotestationid'];this[_0x08ec('0xd')][_0x49ca96[_0x08ec('0x20')]][_0x08ec('0x32')]=_0x49ca96['pagestransferred'];this[_0x08ec('0xd')][_0x49ca96['uniqueid']][_0x08ec('0x2e')]=_0x49ca96[_0x08ec('0x2e')];this[_0x08ec('0xd')][_0x49ca96[_0x08ec('0x20')]][_0x08ec('0x33')]=_0x49ca96[_0x08ec('0x33')];this[_0x08ec('0xd')][_0x49ca96[_0x08ec('0x20')]][_0x08ec('0x34')]=_0x49ca96[_0x08ec('0x34')];this[_0x08ec('0xd')][_0x49ca96[_0x08ec('0x20')]][_0x08ec('0x2f')]=_0x49ca96[_0x08ec('0x2f')];this[_0x08ec('0xd')][_0x49ca96[_0x08ec('0x20')]][_0x08ec('0x35')]=_0x49ca96[_0x08ec('0x35')];if(this[_0x08ec('0xd')][_0x49ca96[_0x08ec('0x20')]][_0x08ec('0x32')]>0x0){tiff2pdf(_0x49ca96['filename'],_0x08ec('0x36'),function(_0x4d5ce3){logger['info'](_0x49ca96[_0x08ec('0x20')],_0x08ec('0x37'),_0x4d5ce3['message']);attachment['create']({'name':path[_0x08ec('0x38')](_0x49ca96[_0x08ec('0x2f')])[_0x08ec('0x22')],'basename':path['parse'](_0x49ca96[_0x08ec('0x2f')])[_0x08ec('0x22')]+'.pdf','type':_0x08ec('0x39')})[_0x08ec('0x3a')](function(_0x4822ef){faxAccount[_0x08ec('0x3b')](_0x24689b,{'from':_0x49ca96[_0x08ec('0x35')],'mapKey':_0x08ec('0x7'),'body':path[_0x08ec('0x38')](_0x49ca96['filename'])[_0x08ec('0x22')]+'.pdf','AttachmentId':_0x4822ef['id']})['catch'](function(_0x415091){logger[_0x08ec('0x3c')](_0x49ca96[_0x08ec('0x20')],_0x08ec('0x3d'),JSON[_0x08ec('0x3e')](_0x415091));});})[_0x08ec('0x3f')](function(_0x21bdc6){logger[_0x08ec('0x3c')](_0x49ca96[_0x08ec('0x20')],_0x08ec('0x40'),JSON[_0x08ec('0x3e')](_0x21bdc6));});});}logger[_0x08ec('0x23')](_0x49ca96[_0x08ec('0x20')],_0x08ec('0x40'));}};Fax['prototype'][_0x08ec('0x1d')]=function(_0x32c119){if(this[_0x08ec('0x25')][_0x32c119[_0x08ec('0x20')]]){_[_0x08ec('0x41')](this[_0x08ec('0xd')][_0x32c119['uniqueid']],_[_0x08ec('0x42')](_0x32c119,[_0x08ec('0x43'),'reason']));}};function updateStatus(_0x4e7f2a){if(_0x4e7f2a['AttachmentId']){faxMessage[_0x08ec('0x44')](_0x4e7f2a[_0x08ec('0x45')],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0xce2095){ut[_0x08ec('0x46')]('[Fax][Message][Error][Updated]',_0xce2095);})['catch'](function(_0x5b34ff){ut[_0x08ec('0x46')](_0x08ec('0x47'),_0x5b34ff);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x08ec('0x26')][_0x08ec('0x48')]=function(_0x131afa,_0x476d3a,_0x541e70){var _0x397749=this;var _0x32bf85={};if(_0x476d3a){_0x32bf85={'read':_0x476d3a};}else{_0x32bf85={'failMessage':_0x541e70};}if(this['actions'][_0x131afa][_0x08ec('0x45')]){faxMessage[_0x08ec('0x44')](this[_0x08ec('0x25')][_0x131afa]['AttachmentId'],_0x32bf85)['then'](function(_0x541420){ut[_0x08ec('0x46')](_0x08ec('0x49'),_0x541420);})[_0x08ec('0x3f')](function(_0x4419fd){ut[_0x08ec('0x46')](_0x08ec('0x4a'),_0x4419fd);})[_0x08ec('0x4b')](function(){delete _0x397749['channels'][_0x131afa];delete _0x397749['actions'][_0x131afa];});}else{ut[_0x08ec('0x46')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x131afa];delete this[_0x08ec('0x25')][_0x131afa];}};Fax[_0x08ec('0x26')][_0x08ec('0x1c')]=function(_0x277dba){var _0x57248b=this;if(this[_0x08ec('0xd')][_0x277dba[_0x08ec('0x20')]]){if(this['actions'][_0x277dba['uniqueid']]){this[_0x08ec('0xd')][_0x277dba[_0x08ec('0x20')]]['id']=this[_0x08ec('0x25')][_0x277dba['uniqueid']]['id'];this[_0x08ec('0xd')][_0x277dba[_0x08ec('0x20')]][_0x08ec('0x22')]=this['actions'][_0x277dba[_0x08ec('0x20')]][_0x08ec('0x22')];}logger['info'](_0x277dba['uniqueid'],this['actions'][_0x277dba[_0x08ec('0x20')]]?_0x08ec('0x4c'):'\x20hangup\x20faxRiceive\x20',JSON[_0x08ec('0x3e')](this[_0x08ec('0xd')][_0x277dba['uniqueid']]));if(this[_0x08ec('0x25')][_0x277dba[_0x08ec('0x20')]]){if(this['channels'][_0x277dba[_0x08ec('0x20')]]['faxpages']>0x0&&this['channels'][_0x277dba[_0x08ec('0x20')]][_0x08ec('0x17')]===_0x08ec('0x4d')){this[_0x08ec('0x48')](_0x277dba[_0x08ec('0x20')],!![]);}else{this[_0x08ec('0x48')](_0x277dba['uniqueid'],![],this[_0x08ec('0xd')][_0x277dba[_0x08ec('0x20')]][_0x08ec('0x4e')]?_0x08ec('0x4f')+this[_0x08ec('0xd')][_0x277dba['uniqueid']][_0x08ec('0x4e')]:_0x08ec('0x50'));}}}};Fax[_0x08ec('0x26')][_0x08ec('0x51')]=function(_0x1f80cc){var _0x18ea65=this;return new BPromise(function(_0x52f106,_0x38a7a1){_0x18ea65['execOriginate'](_0x1f80cc,_0x18ea65['faxAccounts'][_0x1f80cc[_0x08ec('0x52')]])['then'](function(_0x364464){ut[_0x08ec('0x46')]('[Fax][execOriginate][success]',_0x364464);_0x52f106(ut[_0x08ec('0x53')]('Fax\x20received'));})[_0x08ec('0x3f')](function(_0x25e94a){ut[_0x08ec('0x46')](_0x08ec('0x54'),_0x25e94a);updateStatus(_0x1f80cc);_0x38a7a1(ut['message'](_0x08ec('0x55')));});});};Fax[_0x08ec('0x26')][_0x08ec('0x56')]=function(_0x3e0b3f){var _0x588748=this;return new BPromise(function(_0x2160af,_0x2afe0d){var _0x41500f=_0x588748[_0x08ec('0x57')](_0x588748[_0x08ec('0xe')][_0x3e0b3f['FaxAccountId']][_0x08ec('0x58')],_0x3e0b3f);if(_0x41500f[_0x08ec('0x59')]){_0x2160af(ut[_0x08ec('0x53')](_0x08ec('0x5a')));}else{_0x2afe0d(ut[_0x08ec('0x53')](_0x41500f['message']));}});};function originate(_0x58f5e6,_0x3f5ea4,_0x266f80){return new BPromise(function(_0x47bfbb,_0x5a5846){if(_0x266f80){var _0x18f5f3=util['format'](_0x08ec('0x5b'),path['parse'](_0x58f5e6['path'])[_0x08ec('0x22')],_0x58f5e6[_0x08ec('0x3')]);gs['execute'](_0x18f5f3)[_0x08ec('0x3a')](function(){_0x58f5e6[_0x08ec('0x3')]=util[_0x08ec('0x5c')]('%s/%s.tif',path[_0x08ec('0x38')](_0x58f5e6['path'])[_0x08ec('0x5d')],path[_0x08ec('0x38')](_0x58f5e6[_0x08ec('0x3')])[_0x08ec('0x22')]);_0x3f5ea4['XMF-PATH']=_0x58f5e6[_0x08ec('0x3')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0x08ec('0x5e')](ut['variablesAction'](_0x58f5e6,_0x3f5ea4))[_0x08ec('0x3a')](function(_0x9965ab){_0x47bfbb(_0x9965ab);})[_0x08ec('0x3f')](function(_0x5c4d24){_0x5a5846(_0x5c4d24);});})[_0x08ec('0x3f')](function(_0x3f4fca){_0x5a5846(_0x3f4fca);});}else{ami['Action'](ut['variablesAction'](_0x58f5e6,_0x3f5ea4))['then'](function(_0x20b62c){_0x47bfbb(_0x20b62c);})['catch'](function(_0x2444a2){_0x5a5846(_0x2444a2);});}});}Fax['prototype']['execOriginate']=function(_0x2598b5,_0x600c6){var _0x27f71d=this;return new BPromise(function(_0x57c312,_0x1264e6){var _0x2d4e84=uuid['v4']();var _0x245951=ut[_0x08ec('0x5f')](_0x2598b5,_0x600c6);_0x27f71d[_0x08ec('0x25')][_0x2d4e84]=new Action(_0x2d4e84,_0x600c6,_0x2598b5);var _0x133d1a=_0x27f71d[_0x08ec('0x25')][_0x2d4e84];if(path[_0x08ec('0x38')](_0x2598b5[_0x08ec('0x3')])[_0x08ec('0x60')]===_0x08ec('0x61')){originate(_0x133d1a,_0x245951,!![])[_0x08ec('0x3a')](function(_0x3b7b17){_0x57c312(_0x3b7b17);})[_0x08ec('0x3f')](function(_0x5b543c){_0x1264e6(_0x5b543c);});}else{originate(_0x133d1a,_0x245951,![])[_0x08ec('0x3a')](function(_0x37b688){_0x57c312(_0x37b688);})[_0x08ec('0x3f')](function(_0x433d59){_0x1264e6(_0x433d59);});}});};Fax['prototype'][_0x08ec('0x62')]=function(_0x317e19){return!_[_0x08ec('0x63')](_0x317e19)&&!_[_0x08ec('0x63')](_0x317e19[_0x08ec('0x22')])&&!_[_0x08ec('0x63')](_0x317e19[_0x08ec('0x64')])&&_0x317e19[_0x08ec('0x64')]&&!_[_0x08ec('0x63')](this['trunks'][util[_0x08ec('0x5c')](_0x08ec('0x65'),_0x317e19[_0x08ec('0x22')])])&&!_[_0x08ec('0x63')](this[_0x08ec('0xf')][util['format'](_0x08ec('0x65'),_0x317e19['name'])][_0x08ec('0x2d')])&&(this[_0x08ec('0xf')][util[_0x08ec('0x5c')](_0x08ec('0x65'),_0x317e19[_0x08ec('0x22')])][_0x08ec('0x2d')]==='reachable'||this[_0x08ec('0xf')][util[_0x08ec('0x5c')](_0x08ec('0x65'),_0x317e19['name'])][_0x08ec('0x2d')]===_0x08ec('0x66'));};Fax[_0x08ec('0x26')][_0x08ec('0x57')]=function(_0x5af101,_0x425e84){if(!this[_0x08ec('0x62')](_0x5af101)){ut['logger'](_0x08ec('0x67'),_[_0x08ec('0x63')](_0x5af101)?'':_0x5af101[_0x08ec('0x22')]+_0x08ec('0x68'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0x08ec('0x63')](_0x425e84[_0x08ec('0x7')])){ut[_0x08ec('0x46')](_0x08ec('0x69'),JSON['stringify'](_0x425e84));return{'isValid':![],'message':_0x08ec('0x6a')};}if(_['isNil'](_0x425e84['path'])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON[_0x08ec('0x3e')](_0x425e84));return{'isValid':![],'message':_0x08ec('0x6b')};}return{'isValid':!![],'message':_0x08ec('0x6c')};};module[_0x08ec('0x6d')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 4edbfc1..025a66c 100644 --- a/server/services/ami/fax/rpcDb.js +++ b/server/services/ami/fax/rpcDb.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa84=['lodash','notify','resolve','catch','bluebird','../../../config/logger','preview'];(function(_0x241c3b,_0x592963){var _0x1fef38=function(_0x4cb4ba){while(--_0x4cb4ba){_0x241c3b['push'](_0x241c3b['shift']());}};_0x1fef38(++_0x592963);}(_0xfa84,0x185));var _0x4fa8=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xfa84[_0x3bf83f];return _0x22c4a9;};'use strict';var util=require('util');var BPromise=require(_0x4fa8('0x0'));var logger=require(_0x4fa8('0x1'))(_0x4fa8('0x2'));var _=require(_0x4fa8('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x5ea10b){return function(_0x54f043){logger['error'](_0x5ea10b,util['inspect'](_0x54f043,{'showHidden':![],'depth':null}));};}exports[_0x4fa8('0x4')]=function(_0x55c71e,_0x266c2c){return BPromise[_0x4fa8('0x5')]()['then'](faxAccount[_0x4fa8('0x4')](_0x55c71e,_0x266c2c))[_0x4fa8('0x6')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xb4f4=['resolve','then','notify','catch','bluebird','../../../config/logger','preview','lodash','error','inspect'];(function(_0x26b6fe,_0x4a15dc){var _0x2cefd4=function(_0x1d817f){while(--_0x1d817f){_0x26b6fe['push'](_0x26b6fe['shift']());}};_0x2cefd4(++_0x4a15dc);}(_0xb4f4,0x68));var _0x4b4f=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xb4f4[_0x17406a];return _0x1501ff;};'use strict';var util=require('util');var BPromise=require(_0x4b4f('0x0'));var logger=require(_0x4b4f('0x1'))(_0x4b4f('0x2'));var _=require(_0x4b4f('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x5cd4fd){return function(_0x31ba84){logger[_0x4b4f('0x4')](_0x5cd4fd,util[_0x4b4f('0x5')](_0x31ba84,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x212f6c,_0x173bed){return BPromise[_0x4b4f('0x6')]()[_0x4b4f('0x7')](faxAccount[_0x4b4f('0x8')](_0x212f6c,_0x173bed))[_0x4b4f('0x9')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index d60251f..ff72ef5 100644 --- a/server/services/ami/fax/util/gs.js +++ b/server/services/ami/fax/util/gs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa89c=['inspect','../../../../config/logger','fax','bluebird','exec','execute','info','Exec\x20gs'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0xa89c,0xa1));var _0xca89=function(_0x370c9e,_0x2d2f87){_0x370c9e=_0x370c9e-0x0;var _0x1e3a1f=_0xa89c[_0x370c9e];return _0x1e3a1f;};'use strict';var util=require('util');var logger=require(_0xca89('0x0'))(_0xca89('0x1'));var BPromise=require(_0xca89('0x2'));var exec=require('child_process')[_0xca89('0x3')];exports[_0xca89('0x4')]=function(_0x40635f){return new BPromise(function(_0x1db4a7,_0x347321){exec(_0x40635f,function(_0x559c1d,_0x5a2ceb,_0x1ea7a7){logger[_0xca89('0x5')](_0xca89('0x6'),_0x5a2ceb);if(_0x559c1d){logger[_0xca89('0x5')](_0xca89('0x6'),'\x20Error\x20:',util[_0xca89('0x7')](_0x559c1d,{'showHidden':![],'depth':null}),_0x5a2ceb,_0x1ea7a7);_0x347321(_0x559c1d);}_0x1db4a7(_0x5a2ceb);});});}; \ No newline at end of file +var _0xf2b7=['../../../../config/logger','fax','bluebird','child_process','exec','execute','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x104d06,_0x45acf9){var _0x220cd9=function(_0x1c0a30){while(--_0x1c0a30){_0x104d06['push'](_0x104d06['shift']());}};_0x220cd9(++_0x45acf9);}(_0xf2b7,0x87));var _0x7f2b=function(_0x550c4d,_0x430798){_0x550c4d=_0x550c4d-0x0;var _0x10077b=_0xf2b7[_0x550c4d];return _0x10077b;};'use strict';var util=require('util');var logger=require(_0x7f2b('0x0'))(_0x7f2b('0x1'));var BPromise=require(_0x7f2b('0x2'));var exec=require(_0x7f2b('0x3'))[_0x7f2b('0x4')];exports[_0x7f2b('0x5')]=function(_0x242820){return new BPromise(function(_0x4fb50d,_0x9bd128){exec(_0x242820,function(_0x51afd8,_0x14ca9a,_0x4a18e1){logger['info']('Exec\x20gs',_0x14ca9a);if(_0x51afd8){logger['info'](_0x7f2b('0x6'),_0x7f2b('0x7'),util[_0x7f2b('0x8')](_0x51afd8,{'showHidden':![],'depth':null}),_0x14ca9a,_0x4a18e1);_0x9bd128(_0x51afd8);}_0x4fb50d(_0x14ca9a);});});}; \ No newline at end of file diff --git a/server/services/ami/fax/util/util.js b/server/services/ami/fax/util/util.js index f3bfa8b..8ad5014 100644 --- a/server/services/ami/fax/util/util.js +++ b/server/services/ami/fax/util/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7858=['util','moment','../../../../config/logger','fax','message','logger','addVariables','ecm','headerinfo','maxrate','format','\x22%s\x22','gateway','faxdetect','t38timeout','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','uniqueid'];(function(_0x4f30f4,_0x5a434c){var _0x58c6a6=function(_0x214522){while(--_0x214522){_0x4f30f4['push'](_0x4f30f4['shift']());}};_0x58c6a6(++_0x5a434c);}(_0x7858,0x8a));var _0x8785=function(_0x44ae75,_0x5ae7ee){_0x44ae75=_0x44ae75-0x0;var _0x12e1c7=_0x7858[_0x44ae75];return _0x12e1c7;};'use strict';var util=require(_0x8785('0x0'));var _=require('lodash');var moment=require(_0x8785('0x1'));var logger=require(_0x8785('0x2'))(_0x8785('0x3'));exports[_0x8785('0x4')]=function(_0x477d84){return{'message':_0x477d84};};exports[_0x8785('0x5')]=function(_0x195105,_0x5ac89b){logger['info'](_0x195105,util['inspect'](_0x5ac89b,{'showHidden':![],'depth':null}));};exports[_0x8785('0x6')]=function(_0x5202b2,_0x58ad79){var _0x5acc6d={'XMF-ECM':_0x58ad79[_0x8785('0x7')],'XMF-HEADERINFO':_0x58ad79[_0x8785('0x8')],'XMF-MINRATE':_0x58ad79['minrate'],'XMF-MAXRATE':_0x58ad79[_0x8785('0x9')],'XMF-MODEM':util[_0x8785('0xa')](_0x8785('0xb'),_0x58ad79['modem']),'XMF-GATEWAY':_0x58ad79[_0x8785('0xc')],'XMF-FAXDETECT':_0x58ad79[_0x8785('0xd')],'XMF-T38TIMEOUT':_0x58ad79[_0x8785('0xe')],'XMF-LOCALSTATIONID':_0x58ad79['localstationid'],'XMF-PATH':_0x5202b2[_0x8785('0xf')]};return _0x5acc6d;};exports[_0x8785('0x10')]=function(_0x581fb6,_0x3fadac){return{'actionid':_0x581fb6['uniqueid'],'action':_0x8785('0x11'),'channel':_0x581fb6[_0x8785('0x12')],'Exten':_0x8785('0x13'),'Context':_0x8785('0x14'),'Priority':'1','callerid':util[_0x8785('0xa')](_0x8785('0x15'),_0x581fb6[_0x8785('0x8')]?_0x581fb6[_0x8785('0x8')]:'',_0x581fb6['localstationid']),'variable':_0x3fadac,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x581fb6[_0x8785('0x16')]};}; \ No newline at end of file +var _0x9cea=['../../../../config/logger','message','info','inspect','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','lodash','moment'];(function(_0x1058ac,_0x62763e){var _0x101f1b=function(_0x41292d){while(--_0x41292d){_0x1058ac['push'](_0x1058ac['shift']());}};_0x101f1b(++_0x62763e);}(_0x9cea,0x9f));var _0xa9ce=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x9cea[_0x173441];return _0x2423a8;};'use strict';var util=require('util');var _=require(_0xa9ce('0x0'));var moment=require(_0xa9ce('0x1'));var logger=require(_0xa9ce('0x2'))('fax');exports[_0xa9ce('0x3')]=function(_0x2eec35){return{'message':_0x2eec35};};exports['logger']=function(_0x41f4a6,_0x269ac4){logger[_0xa9ce('0x4')](_0x41f4a6,util[_0xa9ce('0x5')](_0x269ac4,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x15278e,_0x19c20c){var _0x31076c={'XMF-ECM':_0x19c20c['ecm'],'XMF-HEADERINFO':_0x19c20c['headerinfo'],'XMF-MINRATE':_0x19c20c[_0xa9ce('0x6')],'XMF-MAXRATE':_0x19c20c[_0xa9ce('0x7')],'XMF-MODEM':util[_0xa9ce('0x8')](_0xa9ce('0x9'),_0x19c20c[_0xa9ce('0xa')]),'XMF-GATEWAY':_0x19c20c[_0xa9ce('0xb')],'XMF-FAXDETECT':_0x19c20c[_0xa9ce('0xc')],'XMF-T38TIMEOUT':_0x19c20c[_0xa9ce('0xd')],'XMF-LOCALSTATIONID':_0x19c20c[_0xa9ce('0xe')],'XMF-PATH':_0x15278e[_0xa9ce('0xf')]};return _0x31076c;};exports['variablesAction']=function(_0x3cee65,_0x55636a){return{'actionid':_0x3cee65[_0xa9ce('0x10')],'action':_0xa9ce('0x11'),'channel':_0x3cee65[_0xa9ce('0x12')],'Exten':_0xa9ce('0x13'),'Context':_0xa9ce('0x14'),'Priority':'1','callerid':util['format'](_0xa9ce('0x15'),_0x3cee65[_0xa9ce('0x16')]?_0x3cee65[_0xa9ce('0x16')]:'',_0x3cee65[_0xa9ce('0xe')]),'variable':_0x55636a,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3cee65['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 4b9ffa9..d00bdc7 100644 --- a/server/services/ami/index.js +++ b/server/services/ami/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb04c=['./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/servicenow','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','error','inspect','listen','sync','catch','[index.js][main]','util','moment','./server','./report','./acw','./dialer','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount'];(function(_0x154983,_0xc29edf){var _0x3d1243=function(_0x5cb7a4){while(--_0x5cb7a4){_0x154983['push'](_0x154983['shift']());}};_0x3d1243(++_0xc29edf);}(_0xb04c,0xc8));var _0xcb04=function(_0x3b2d95,_0x475e8c){_0x3b2d95=_0x3b2d95-0x0;var _0x127d32=_0xb04c[_0x3b2d95];return _0x127d32;};'use strict';var util=require(_0xcb04('0x0'));var moment=require(_0xcb04('0x1'));var server=require(_0xcb04('0x2'));var Realtime=require('./realtime');var Report=require(_0xcb04('0x3'));var Acw=require(_0xcb04('0x4'));var Trigger=require('./trigger');var Dialer=require(_0xcb04('0x5'));var Preview=require('./preview');var Fax=require(_0xcb04('0x6'));var user=require('./rpc/user');var voiceQueue=require(_0xcb04('0x7'));var voiceQueueReport=require(_0xcb04('0x8'));var voiceCallReport=require(_0xcb04('0x9'));var trunk=require(_0xcb04('0xa'));var trigger=require(_0xcb04('0xb'));var template=require(_0xcb04('0xc'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xcb04('0xd'));var voiceExtension=require(_0xcb04('0xe'));var faxAccount=require(_0xcb04('0xf'));var zendesk=require(_0xcb04('0x10'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xcb04('0x11'));var freshdesk=require(_0xcb04('0x12'));var desk=require(_0xcb04('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xcb04('0x14'));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(_0xcb04('0x15'))(_0xcb04('0x16'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xcb04('0x17')](_0xcb04('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xcb04('0x19')]()[_0xcb04('0x1a')](user[_0xcb04('0x1b')]())[_0xcb04('0x1a')](realtime[_0xcb04('0x1c')]())[_0xcb04('0x1a')](user[_0xcb04('0x1d')]())[_0xcb04('0x1a')](realtime[_0xcb04('0x1e')]())['then'](trunk[_0xcb04('0x1f')]())[_0xcb04('0x1a')](realtime['initTrunks']())[_0xcb04('0x1a')](voiceQueue[_0xcb04('0x20')]())[_0xcb04('0x1a')](realtime[_0xcb04('0x21')]())[_0xcb04('0x1a')](trigger[_0xcb04('0x22')]())[_0xcb04('0x1a')](realtime[_0xcb04('0x23')]())[_0xcb04('0x1a')](template[_0xcb04('0x24')]())[_0xcb04('0x1a')](realtime[_0xcb04('0x25')]())[_0xcb04('0x1a')](zendesk[_0xcb04('0x26')]())[_0xcb04('0x1a')](realtime[_0xcb04('0x27')]())[_0xcb04('0x1a')](salesforce[_0xcb04('0x28')]())['then'](realtime[_0xcb04('0x29')]())['then'](sugarcrm[_0xcb04('0x2a')]())['then'](realtime[_0xcb04('0x2b')]())[_0xcb04('0x1a')](freshdesk['getFreshdeskAccounts']())[_0xcb04('0x1a')](realtime[_0xcb04('0x2c')]())[_0xcb04('0x1a')](desk[_0xcb04('0x2d')]())[_0xcb04('0x1a')](realtime[_0xcb04('0x2e')]())[_0xcb04('0x1a')](zoho[_0xcb04('0x2f')]())['then'](realtime[_0xcb04('0x30')]())[_0xcb04('0x1a')](vtiger[_0xcb04('0x31')]())[_0xcb04('0x1a')](realtime[_0xcb04('0x32')]())[_0xcb04('0x1a')](freshsales[_0xcb04('0x33')]())[_0xcb04('0x1a')](realtime[_0xcb04('0x34')]())[_0xcb04('0x1a')](servicenow[_0xcb04('0x35')]())[_0xcb04('0x1a')](realtime[_0xcb04('0x36')]())[_0xcb04('0x1a')](dynamics365[_0xcb04('0x37')]())['then'](realtime[_0xcb04('0x38')]())['then'](campaign[_0xcb04('0x39')]())[_0xcb04('0x1a')](realtime[_0xcb04('0x3a')]())[_0xcb04('0x1a')](voiceExtension['getVoiceExtensions']())['then'](realtime[_0xcb04('0x3b')]())[_0xcb04('0x1a')](faxAccount[_0xcb04('0x3c')]())['then'](realtime['initFaxAccounts']())[_0xcb04('0x1a')](function(){return realtime;});}function initParams(){return Promise[_0xcb04('0x19')]()[_0xcb04('0x1a')](voiceQueueReport[_0xcb04('0x3d')]())['then'](realtime[_0xcb04('0x3e')]())['then'](cmHopperHistory[_0xcb04('0x3f')]())['then'](realtime['initVoiceQueueHopperHistory']())[_0xcb04('0x1a')](cmHopperHistory[_0xcb04('0x40')]())[_0xcb04('0x1a')](realtime['initCampaignHopperHistory']())[_0xcb04('0x1a')](voiceCallReport[_0xcb04('0x41')]())[_0xcb04('0x1a')](realtime['initVoiceCallReports']())['catch'](function(_0x1a0af6){logger[_0xcb04('0x42')]('[index.js][initParams]',util[_0xcb04('0x43')](_0x1a0af6,{'showHidden':![],'depth':null}));});}function main(){return server[_0xcb04('0x44')](realtime,preview,fax)['then'](function(){return initRealtime();})[_0xcb04('0x1a')](function(){return initParams();})['then'](function(){report[_0xcb04('0x45')]();setInterval(initRealtime,0x1388);})[_0xcb04('0x46')](function(_0x3cc150){logger['error'](_0xcb04('0x47'),util['inspect'](_0x3cc150,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xc524=['getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','sync','error','util','moment','./server','./realtime','./report','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts'];(function(_0x4efe4b,_0x2af93c){var _0x63e206=function(_0x2d2844){while(--_0x2d2844){_0x4efe4b['push'](_0x4efe4b['shift']());}};_0x63e206(++_0x2af93c);}(_0xc524,0xe5));var _0x4c52=function(_0x135641,_0x3e6ad1){_0x135641=_0x135641-0x0;var _0x5a0e07=_0xc524[_0x135641];return _0x5a0e07;};'use strict';var util=require(_0x4c52('0x0'));var moment=require(_0x4c52('0x1'));var server=require(_0x4c52('0x2'));var Realtime=require(_0x4c52('0x3'));var Report=require(_0x4c52('0x4'));var Acw=require('./acw');var Trigger=require(_0x4c52('0x5'));var Dialer=require(_0x4c52('0x6'));var Preview=require(_0x4c52('0x7'));var Fax=require('./fax');var user=require(_0x4c52('0x8'));var voiceQueue=require(_0x4c52('0x9'));var voiceQueueReport=require(_0x4c52('0xa'));var voiceCallReport=require(_0x4c52('0xb'));var trunk=require(_0x4c52('0xc'));var trigger=require('./rpc/trigger');var template=require(_0x4c52('0xd'));var cmHopperHistory=require(_0x4c52('0xe'));var campaign=require(_0x4c52('0xf'));var voiceExtension=require(_0x4c52('0x10'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x4c52('0x11'));var salesforce=require(_0x4c52('0x12'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x4c52('0x13'));var desk=require(_0x4c52('0x14'));var zoho=require(_0x4c52('0x15'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x4c52('0x16'));var servicenow=require(_0x4c52('0x17'));var dynamics365=require(_0x4c52('0x18'));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(_0x4c52('0x19'))(_0x4c52('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x4c52('0x1b')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x4c52('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x4c52('0x1d')]()[_0x4c52('0x1e')](user[_0x4c52('0x1f')]())['then'](realtime[_0x4c52('0x20')]())[_0x4c52('0x1e')](user[_0x4c52('0x21')]())[_0x4c52('0x1e')](realtime[_0x4c52('0x22')]())[_0x4c52('0x1e')](trunk['getTrunks']())['then'](realtime[_0x4c52('0x23')]())['then'](voiceQueue[_0x4c52('0x24')]())[_0x4c52('0x1e')](realtime['initVoiceQueues']())[_0x4c52('0x1e')](trigger['getTriggers']())[_0x4c52('0x1e')](realtime[_0x4c52('0x25')]())['then'](template['getTemplates']())['then'](realtime['initTemplates']())[_0x4c52('0x1e')](zendesk[_0x4c52('0x26')]())[_0x4c52('0x1e')](realtime[_0x4c52('0x27')]())[_0x4c52('0x1e')](salesforce[_0x4c52('0x28')]())[_0x4c52('0x1e')](realtime[_0x4c52('0x29')]())[_0x4c52('0x1e')](sugarcrm[_0x4c52('0x2a')]())[_0x4c52('0x1e')](realtime[_0x4c52('0x2b')]())['then'](freshdesk[_0x4c52('0x2c')]())[_0x4c52('0x1e')](realtime[_0x4c52('0x2d')]())[_0x4c52('0x1e')](desk['getDeskAccounts']())[_0x4c52('0x1e')](realtime[_0x4c52('0x2e')]())[_0x4c52('0x1e')](zoho[_0x4c52('0x2f')]())['then'](realtime[_0x4c52('0x30')]())[_0x4c52('0x1e')](vtiger[_0x4c52('0x31')]())[_0x4c52('0x1e')](realtime[_0x4c52('0x32')]())['then'](freshsales[_0x4c52('0x33')]())[_0x4c52('0x1e')](realtime[_0x4c52('0x34')]())[_0x4c52('0x1e')](servicenow['getServicenowAccounts']())['then'](realtime[_0x4c52('0x35')]())[_0x4c52('0x1e')](dynamics365[_0x4c52('0x36')]())[_0x4c52('0x1e')](realtime['initDynamics365Accounts']())[_0x4c52('0x1e')](campaign[_0x4c52('0x37')]())[_0x4c52('0x1e')](realtime[_0x4c52('0x38')]())[_0x4c52('0x1e')](voiceExtension['getVoiceExtensions']())['then'](realtime[_0x4c52('0x39')]())[_0x4c52('0x1e')](faxAccount['getFaxAccounts']())[_0x4c52('0x1e')](realtime[_0x4c52('0x3a')]())[_0x4c52('0x1e')](function(){return realtime;});}function initParams(){return Promise[_0x4c52('0x1d')]()['then'](voiceQueueReport[_0x4c52('0x3b')]())[_0x4c52('0x1e')](realtime[_0x4c52('0x3c')]())[_0x4c52('0x1e')](cmHopperHistory[_0x4c52('0x3d')]())[_0x4c52('0x1e')](realtime[_0x4c52('0x3e')]())['then'](cmHopperHistory[_0x4c52('0x3f')]())[_0x4c52('0x1e')](realtime[_0x4c52('0x40')]())[_0x4c52('0x1e')](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0x4c52('0x41')]())[_0x4c52('0x42')](function(_0x4bc85a){logger['error']('[index.js][initParams]',util['inspect'](_0x4bc85a,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x4c52('0x1e')](function(){return initRealtime();})[_0x4c52('0x1e')](function(){return initParams();})[_0x4c52('0x1e')](function(){report[_0x4c52('0x43')]();setInterval(initRealtime,0x1388);})[_0x4c52('0x42')](function(_0x568c4d){logger[_0x4c52('0x44')]('[index.js][main]',util['inspect'](_0x568c4d,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 46ae718..4f0fb4a 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ce4=['emit','user:ami:update','omit','user:presence','exports','lodash','util','md5','redis','localhost','socket.io-emitter','name','accountcode','fullname','state','unknown','stateTime','status','address','phone','online','voiceStatusQueue','onhold','local','updateStatusRealtime','toLowerCase','idle','talking','voiceStatus','statePause','voiceStatusTime','toNumber','format','email','voiceStatusCallerIdNumber','interface','user:%s'];(function(_0x32088f,_0x538e0a){var _0x43abf1=function(_0x52c41d){while(--_0x52c41d){_0x32088f['push'](_0x32088f['shift']());}};_0x43abf1(++_0x538e0a);}(_0x5ce4,0x1c1));var _0x45ce=function(_0xbeab9,_0x37ec4a){_0xbeab9=_0xbeab9-0x0;var _0x27650c=_0x5ce4[_0xbeab9];return _0x27650c;};'use strict';var _=require(_0x45ce('0x0'));var util=require(_0x45ce('0x1'));var moment=require('moment');var md5=require(_0x45ce('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x45ce('0x3')]=_['defaults'](config[_0x45ce('0x3')],{'host':_0x45ce('0x4'),'port':0x18eb});var io=require(_0x45ce('0x5'))(new Redis(config['redis']));function Agent(_0x3bb1f7){this['id']=_0x3bb1f7['id']||0x0;this[_0x45ce('0x6')]=_0x3bb1f7['name']||'';this['email']=_0x3bb1f7['email']||'';this['accountcode']=_0x3bb1f7[_0x45ce('0x7')]||'';this['fullname']=_0x3bb1f7[_0x45ce('0x8')]||'';this[_0x45ce('0x9')]=_0x45ce('0xa');this[_0x45ce('0xb')]=0x0;this[_0x45ce('0xc')]='unknown';this[_0x45ce('0xd')]='';this[_0x45ce('0xe')]='';this['mobile']='';this['interface']='';this[_0x45ce('0xf')]=_0x3bb1f7[_0x45ce('0xf')]||![];this['voiceStatus']=_0x45ce('0xa');this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x45ce('0x10')]='';this[_0x45ce('0x11')]=![];this[_0x45ce('0x12')]=![];this[_0x45ce('0x2')]='';}Agent['prototype'][_0x45ce('0x13')]=function(_0x2f4e92){var _0x4ab1d6;if(_0x2f4e92&&_0x2f4e92[_0x45ce('0x9')]){_0x4ab1d6=_0x2f4e92[_0x45ce('0x9')][_0x45ce('0x14')]();switch(_0x4ab1d6){case'not_inuse':_0x4ab1d6=_0x45ce('0x15');break;case'inuse':_0x4ab1d6=_0x45ce('0x16');break;}}if(_0x4ab1d6&&this[_0x45ce('0x17')]!==_0x4ab1d6||_0x2f4e92[_0x45ce('0x18')]){this[_0x45ce('0x19')]=_[_0x45ce('0x1a')](moment()[_0x45ce('0x1b')]('x'));}if(_0x4ab1d6){this['voiceStatus']=_0x4ab1d6;}var _0x3d3a26={'id':this['id'],'name':this[_0x45ce('0x6')],'email':this[_0x45ce('0x1c')],'accountcode':this[_0x45ce('0x7')],'fullname':this[_0x45ce('0x8')],'state':this[_0x45ce('0x9')],'stateTime':this[_0x45ce('0xb')],'status':this[_0x45ce('0xc')],'address':this['address'],'online':this[_0x45ce('0xf')],'voiceStatus':this[_0x45ce('0x17')],'voiceStatusTime':this[_0x45ce('0x19')],'voiceStatusCallerIdNumber':this[_0x45ce('0x1d')],'voiceStatusQueue':this[_0x45ce('0x10')],'interface':this[_0x45ce('0x1e')],'onhold':this[_0x45ce('0x11')]};var _0x14215b=md5(JSON['stringify'](_0x3d3a26));if(this[_0x45ce('0x2')]!==_0x14215b){this[_0x45ce('0x2')]=_0x14215b;io['to'](util['format'](_0x45ce('0x1f'),_0x3d3a26[_0x45ce('0x6')]))[_0x45ce('0x20')](_0x45ce('0x21'),_[_0x45ce('0x22')](_0x3d3a26,['online']));io[_0x45ce('0x20')](_0x45ce('0x23'),_0x3d3a26);}};module[_0x45ce('0x24')]=Agent; \ No newline at end of file +var _0x6255=['talking','statePause','format','voiceStatusCallerIdNumber','onhold','stringify','emit','user:presence','exports','lodash','util','moment','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x6255,0x199));var _0x5625=function(_0x3c7152,_0x302b29){_0x3c7152=_0x3c7152-0x0;var _0x43aea5=_0x6255[_0x3c7152];return _0x43aea5;};'use strict';var _=require(_0x5625('0x0'));var util=require(_0x5625('0x1'));var moment=require(_0x5625('0x2'));var md5=require('md5');var Redis=require(_0x5625('0x3'));var config=require(_0x5625('0x4'));config['redis']=_[_0x5625('0x5')](config[_0x5625('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x5625('0x7'))(new Redis(config[_0x5625('0x6')]));function Agent(_0x143cd0){this['id']=_0x143cd0['id']||0x0;this[_0x5625('0x8')]=_0x143cd0[_0x5625('0x8')]||'';this[_0x5625('0x9')]=_0x143cd0['email']||'';this[_0x5625('0xa')]=_0x143cd0[_0x5625('0xa')]||'';this[_0x5625('0xb')]=_0x143cd0[_0x5625('0xb')]||'';this[_0x5625('0xc')]=_0x5625('0xd');this[_0x5625('0xe')]=0x0;this[_0x5625('0xf')]=_0x5625('0xd');this[_0x5625('0x10')]='';this['phone']='';this[_0x5625('0x11')]='';this[_0x5625('0x12')]='';this['online']=_0x143cd0[_0x5625('0x13')]||![];this[_0x5625('0x14')]='unknown';this[_0x5625('0x15')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x5625('0x16')]='';this['onhold']=![];this[_0x5625('0x17')]=![];this[_0x5625('0x18')]='';}Agent[_0x5625('0x19')][_0x5625('0x1a')]=function(_0x8ff771){var _0x4b72f8;if(_0x8ff771&&_0x8ff771[_0x5625('0xc')]){_0x4b72f8=_0x8ff771['state'][_0x5625('0x1b')]();switch(_0x4b72f8){case _0x5625('0x1c'):_0x4b72f8=_0x5625('0x1d');break;case _0x5625('0x1e'):_0x4b72f8=_0x5625('0x1f');break;}}if(_0x4b72f8&&this['voiceStatus']!==_0x4b72f8||_0x8ff771[_0x5625('0x20')]){this[_0x5625('0x15')]=_['toNumber'](moment()[_0x5625('0x21')]('x'));}if(_0x4b72f8){this['voiceStatus']=_0x4b72f8;}var _0x3f3633={'id':this['id'],'name':this[_0x5625('0x8')],'email':this[_0x5625('0x9')],'accountcode':this[_0x5625('0xa')],'fullname':this[_0x5625('0xb')],'state':this[_0x5625('0xc')],'stateTime':this['stateTime'],'status':this['status'],'address':this[_0x5625('0x10')],'online':this[_0x5625('0x13')],'voiceStatus':this[_0x5625('0x14')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x5625('0x22')],'voiceStatusQueue':this[_0x5625('0x16')],'interface':this[_0x5625('0x12')],'onhold':this[_0x5625('0x23')]};var _0x131301=md5(JSON[_0x5625('0x24')](_0x3f3633));if(this[_0x5625('0x18')]!==_0x131301){this[_0x5625('0x18')]=_0x131301;io['to'](util['format']('user:%s',_0x3f3633[_0x5625('0x8')]))[_0x5625('0x25')]('user:ami:update',_['omit'](_0x3f3633,['online']));io[_0x5625('0x25')](_0x5625('0x26'),_0x3f3633);}};module[_0x5625('0x27')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index ccd5cbf..b2e4bbb 100644 --- a/server/services/ami/model/campaign.js +++ b/server/services/ami/model/campaign.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec90=['type','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','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xec90,0x1ca));var _0x0ec9=function(_0x10b465,_0x2cccb8){_0x10b465=_0x10b465-0x0;var _0x550ddc=_0xec90[_0x10b465];return _0x550ddc;};'use strict';function Campaign(_0x45a92a){this['id']=_0x45a92a['id']||0x0;this[_0x0ec9('0x0')]=_0x45a92a[_0x0ec9('0x0')]||'';this[_0x0ec9('0x1')]=_0x45a92a['type']||'campaign';this[_0x0ec9('0x2')]=0x0;this[_0x0ec9('0x3')]=0x0;this[_0x0ec9('0x4')]=0x0;this[_0x0ec9('0x5')]=0x0;this[_0x0ec9('0x6')]='';this[_0x0ec9('0x7')]=!![];this[_0x0ec9('0x8')]=_0x45a92a[_0x0ec9('0x8')];this[_0x0ec9('0x9')]=_0x45a92a['limitCalls'];this[_0x0ec9('0xa')]=_0x45a92a[_0x0ec9('0xa')]||null;this['dialGlobalInterval']=_0x45a92a['dialGlobalInterval']?_0x45a92a[_0x0ec9('0xb')]:null;this[_0x0ec9('0xc')]=_0x45a92a[_0x0ec9('0xc')];this[_0x0ec9('0xd')]=_0x45a92a['dialOriginateCallerIdNumber'];this[_0x0ec9('0xe')]=_0x45a92a[_0x0ec9('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x45a92a[_0x0ec9('0xf')];this[_0x0ec9('0x10')]=_0x45a92a[_0x0ec9('0x10')];this[_0x0ec9('0x11')]=_0x45a92a[_0x0ec9('0x11')];this[_0x0ec9('0x12')]=_0x45a92a['dialBusyRetryFrequency'];this[_0x0ec9('0x13')]=_0x45a92a['dialNoAnswerMaxRetry'];this[_0x0ec9('0x14')]=_0x45a92a[_0x0ec9('0x14')];this[_0x0ec9('0x15')]=_0x45a92a[_0x0ec9('0x15')];this[_0x0ec9('0x16')]=_0x45a92a[_0x0ec9('0x16')]||0x3;this[_0x0ec9('0x17')]=_0x45a92a[_0x0ec9('0x17')]||0x96;this[_0x0ec9('0x18')]=_0x45a92a[_0x0ec9('0x18')]||0x3;this[_0x0ec9('0x19')]=_0x45a92a[_0x0ec9('0x19')]||0x96;this[_0x0ec9('0x1a')]=_0x45a92a[_0x0ec9('0x1a')]||0x3;this[_0x0ec9('0x1b')]=_0x45a92a[_0x0ec9('0x1b')]||0x96;this['dialMachineMaxRetry']=_0x45a92a['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x45a92a[_0x0ec9('0x1c')]||0x96;this[_0x0ec9('0x1d')]=_0x45a92a['dialAgentRejectMaxRetry']||0x3;this[_0x0ec9('0x1e')]=_0x45a92a[_0x0ec9('0x1e')]||0x96;this[_0x0ec9('0x1f')]=_0x45a92a[_0x0ec9('0x1f')]||_0x0ec9('0x20');this['dialPrefix']=_0x45a92a[_0x0ec9('0x21')]||undefined;this[_0x0ec9('0x22')]=_0x45a92a['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x45a92a[_0x0ec9('0x23')]||undefined;this[_0x0ec9('0x24')]=_0x45a92a[_0x0ec9('0x24')]?_0x45a92a[_0x0ec9('0x24')]:undefined;this[_0x0ec9('0x25')]=_0x45a92a[_0x0ec9('0x25')]?_0x45a92a['Trunk']:undefined;this[_0x0ec9('0x26')]=_0x45a92a[_0x0ec9('0x26')]?_0x45a92a[_0x0ec9('0x26')]:undefined;this[_0x0ec9('0x27')]=_0x45a92a['SquareProject']?_0x45a92a[_0x0ec9('0x27')]:undefined;this[_0x0ec9('0x28')]=_0x45a92a['SquareProject']?_0x45a92a[_0x0ec9('0x27')][_0x0ec9('0x0')]:undefined;this[_0x0ec9('0x29')]=_0x45a92a[_0x0ec9('0x29')]||![];this[_0x0ec9('0x2a')]=_0x45a92a[_0x0ec9('0x2a')];this[_0x0ec9('0x2b')]=_0x45a92a[_0x0ec9('0x2b')];this[_0x0ec9('0x2c')]=_0x45a92a[_0x0ec9('0x2c')];this[_0x0ec9('0x2d')]=_0x45a92a['dialAMDTotalAnalysisTime'];this[_0x0ec9('0x2e')]=_0x45a92a[_0x0ec9('0x2e')];this['dialAMDBetweenWordsSilence']=_0x45a92a['dialAMDBetweenWordsSilence'];this[_0x0ec9('0x2f')]=_0x45a92a[_0x0ec9('0x2f')];this['dialAMDSilenceThreshold']=_0x45a92a[_0x0ec9('0x30')];this[_0x0ec9('0x31')]=_0x45a92a['dialAMDMaximumWordLength'];}module[_0x0ec9('0x32')]=Campaign; \ No newline at end of file +var _0x2dd8=['dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0x4a1f8c,_0x4afb0a){var _0x399326=function(_0x2eb8ba){while(--_0x2eb8ba){_0x4a1f8c['push'](_0x4a1f8c['shift']());}};_0x399326(++_0x4afb0a);}(_0x2dd8,0xbe));var _0x82dd=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2dd8[_0x501510];return _0x1e6ee5;};'use strict';function Campaign(_0x22e01e){this['id']=_0x22e01e['id']||0x0;this[_0x82dd('0x0')]=_0x22e01e[_0x82dd('0x0')]||'';this[_0x82dd('0x1')]=_0x22e01e[_0x82dd('0x1')]||'campaign';this[_0x82dd('0x2')]=0x0;this[_0x82dd('0x3')]=0x0;this[_0x82dd('0x4')]=0x0;this[_0x82dd('0x5')]=0x0;this[_0x82dd('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0x82dd('0x7')]=_0x22e01e[_0x82dd('0x7')];this[_0x82dd('0x8')]=_0x22e01e['limitCalls'];this[_0x82dd('0x9')]=_0x22e01e[_0x82dd('0x9')]||null;this['dialGlobalInterval']=_0x22e01e[_0x82dd('0xa')]?_0x22e01e[_0x82dd('0xa')]:null;this[_0x82dd('0xb')]=_0x22e01e[_0x82dd('0xb')];this['dialOriginateCallerIdNumber']=_0x22e01e[_0x82dd('0xc')];this['dialOriginateTimeout']=_0x22e01e[_0x82dd('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x22e01e[_0x82dd('0xe')];this[_0x82dd('0xf')]=_0x22e01e[_0x82dd('0xf')];this[_0x82dd('0x10')]=_0x22e01e[_0x82dd('0x10')];this[_0x82dd('0x11')]=_0x22e01e[_0x82dd('0x11')];this['dialNoAnswerMaxRetry']=_0x22e01e[_0x82dd('0x12')];this['dialNoAnswerRetryFrequency']=_0x22e01e[_0x82dd('0x13')];this[_0x82dd('0x14')]=_0x22e01e[_0x82dd('0x14')];this[_0x82dd('0x15')]=_0x22e01e[_0x82dd('0x15')]||0x3;this[_0x82dd('0x16')]=_0x22e01e[_0x82dd('0x16')]||0x96;this[_0x82dd('0x17')]=_0x22e01e[_0x82dd('0x17')]||0x3;this['dialDropRetryFrequency']=_0x22e01e[_0x82dd('0x18')]||0x96;this['dialAbandonedMaxRetry']=_0x22e01e[_0x82dd('0x19')]||0x3;this[_0x82dd('0x1a')]=_0x22e01e['dialAbandonedRetryFrequency']||0x96;this[_0x82dd('0x1b')]=_0x22e01e['dialMachineMaxRetry']||0x3;this[_0x82dd('0x1c')]=_0x22e01e[_0x82dd('0x1c')]||0x96;this[_0x82dd('0x1d')]=_0x22e01e[_0x82dd('0x1d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x22e01e[_0x82dd('0x1e')]||0x96;this['dialOrderByScheduledAt']=_0x22e01e[_0x82dd('0x1f')]||_0x82dd('0x20');this[_0x82dd('0x21')]=_0x22e01e[_0x82dd('0x21')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x22e01e[_0x82dd('0x22')]||undefined;this[_0x82dd('0x23')]=_0x22e01e['dialCutDigit']||undefined;this['TrunkBackup']=_0x22e01e['TrunkBackup']?_0x22e01e[_0x82dd('0x24')]:undefined;this['Trunk']=_0x22e01e[_0x82dd('0x25')]?_0x22e01e['Trunk']:undefined;this['Interval']=_0x22e01e[_0x82dd('0x26')]?_0x22e01e[_0x82dd('0x26')]:undefined;this[_0x82dd('0x27')]=_0x22e01e[_0x82dd('0x27')]?_0x22e01e['SquareProject']:undefined;this[_0x82dd('0x28')]=_0x22e01e[_0x82dd('0x27')]?_0x22e01e[_0x82dd('0x27')][_0x82dd('0x0')]:undefined;this[_0x82dd('0x29')]=_0x22e01e[_0x82dd('0x29')]||![];this[_0x82dd('0x2a')]=_0x22e01e['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x22e01e[_0x82dd('0x2b')];this[_0x82dd('0x2c')]=_0x22e01e[_0x82dd('0x2c')];this['dialAMDTotalAnalysisTime']=_0x22e01e['dialAMDTotalAnalysisTime'];this[_0x82dd('0x2d')]=_0x22e01e[_0x82dd('0x2d')];this[_0x82dd('0x2e')]=_0x22e01e['dialAMDBetweenWordsSilence'];this[_0x82dd('0x2f')]=_0x22e01e[_0x82dd('0x2f')];this[_0x82dd('0x30')]=_0x22e01e[_0x82dd('0x30')];this[_0x82dd('0x31')]=_0x22e01e[_0x82dd('0x31')];}module[_0x82dd('0x32')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 9524b4c..c0754dc 100644 --- a/server/services/ami/model/channel.js +++ b/server/services/ami/model/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3f3=['mohtime','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastdata','duration','holdtime','type','tag','disposition','monitor','transferconnectedlinenum'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xc3f3,0xd2));var _0x3c3f=function(_0x35ccbb,_0x4c8cc5){_0x35ccbb=_0x35ccbb-0x0;var _0x1575f7=_0xc3f3[_0x35ccbb];return _0x1575f7;};'use strict';function Channel(){this['starttime']=null;this[_0x3c3f('0x0')]='';this[_0x3c3f('0x1')]='';this[_0x3c3f('0x2')]=0x0;this[_0x3c3f('0x3')]='';this[_0x3c3f('0x4')]=undefined;this[_0x3c3f('0x5')]=undefined;this[_0x3c3f('0x6')]=0x0;this[_0x3c3f('0x7')]='';this[_0x3c3f('0x8')]=0x0;this[_0x3c3f('0x9')]=0x0;this[_0x3c3f('0xa')]=0x0;this[_0x3c3f('0xb')]=![];this[_0x3c3f('0xc')]=null;this[_0x3c3f('0xd')]=null;this[_0x3c3f('0xe')]=![];this[_0x3c3f('0xf')]=![];this['lastapplication']='';this[_0x3c3f('0x10')]='';this[_0x3c3f('0x11')]=0x0;this['billableseconds']=0x0;this[_0x3c3f('0x12')]=0x0;this[_0x3c3f('0x13')]=null;this[_0x3c3f('0x14')]=null;this[_0x3c3f('0x15')]=null;this[_0x3c3f('0x16')]=![];this['monitorFilename']=null;this['queue']=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0x3c3f('0x17')]=undefined;this['transferType']=undefined;this[_0x3c3f('0x18')]=0x0;}module[_0x3c3f('0x19')]=Channel; \ No newline at end of file +var _0x1956=['answertime','endtime','unmanaged','abandoned','lastdata','duration','billableseconds','holdtime','type','disposition','monitor','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x1956,0x15c));var _0x6195=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0x1956[_0x277107];return _0x1da046;};'use strict';function Channel(){this[_0x6195('0x0')]=null;this[_0x6195('0x1')]='';this[_0x6195('0x2')]='';this[_0x6195('0x3')]=0x0;this[_0x6195('0x4')]='';this[_0x6195('0x5')]=undefined;this[_0x6195('0x6')]=undefined;this['accountcode']=0x0;this[_0x6195('0x7')]='';this[_0x6195('0x8')]=0x0;this[_0x6195('0x9')]=0x0;this[_0x6195('0xa')]=0x0;this[_0x6195('0xb')]=![];this[_0x6195('0xc')]=null;this[_0x6195('0xd')]=null;this[_0x6195('0xe')]=![];this[_0x6195('0xf')]=![];this['lastapplication']='';this[_0x6195('0x10')]='';this[_0x6195('0x11')]=0x0;this[_0x6195('0x12')]=0x0;this[_0x6195('0x13')]=0x0;this[_0x6195('0x14')]=null;this['tag']=null;this[_0x6195('0x15')]=null;this[_0x6195('0x16')]=![];this['monitorFilename']=null;this[_0x6195('0x17')]=null;this[_0x6195('0x18')]=[];this[_0x6195('0x19')]=undefined;this[_0x6195('0x1a')]=undefined;this[_0x6195('0x1b')]=undefined;this[_0x6195('0x1c')]=0x0;}module[_0x6195('0x1d')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 579e873..f749507 100644 --- a/server/services/ami/model/deskAccount.js +++ b/server/services/ami/model/deskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x141b=['token','tokenSecret','type','serverUrl','Configurations','exports','username','remoteUri','authType','password','consumerSecret'];(function(_0x42e4d7,_0x4bd202){var _0x346cd8=function(_0x36c0f6){while(--_0x36c0f6){_0x42e4d7['push'](_0x42e4d7['shift']());}};_0x346cd8(++_0x4bd202);}(_0x141b,0x10e));var _0xb141=function(_0x4ff825,_0x8eef55){_0x4ff825=_0x4ff825-0x0;var _0x473c17=_0x141b[_0x4ff825];return _0x473c17;};'use strict';function DeskAccount(_0x263168){this['id']=_0x263168['id']||0x0;this['name']=_0x263168['name']||'';this[_0xb141('0x0')]=_0x263168[_0xb141('0x0')]||'';this[_0xb141('0x1')]=_0x263168[_0xb141('0x1')]||'';this['authType']=_0x263168[_0xb141('0x2')]||'';this[_0xb141('0x3')]=_0x263168[_0xb141('0x3')]||'';this['consumerKey']=_0x263168['consumerKey']||'';this[_0xb141('0x4')]=_0x263168[_0xb141('0x4')]||'';this[_0xb141('0x5')]=_0x263168['token']||'';this[_0xb141('0x6')]=_0x263168[_0xb141('0x6')]||'';this[_0xb141('0x7')]=_0x263168[_0xb141('0x7')]||'';this[_0xb141('0x8')]=_0x263168[_0xb141('0x8')]||'';this['Configurations']=_0x263168[_0xb141('0x9')]||{};}module[_0xb141('0xa')]=DeskAccount; \ No newline at end of file +var _0xb577=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey'];(function(_0x1e1af6,_0x42b93){var _0x8a25b0=function(_0x2d9f44){while(--_0x2d9f44){_0x1e1af6['push'](_0x1e1af6['shift']());}};_0x8a25b0(++_0x42b93);}(_0xb577,0x1c1));var _0x7b57=function(_0x1741c2,_0x22b19c){_0x1741c2=_0x1741c2-0x0;var _0x3ed7d=_0xb577[_0x1741c2];return _0x3ed7d;};'use strict';function DeskAccount(_0x5eccc9){this['id']=_0x5eccc9['id']||0x0;this['name']=_0x5eccc9[_0x7b57('0x0')]||'';this[_0x7b57('0x1')]=_0x5eccc9[_0x7b57('0x1')]||'';this[_0x7b57('0x2')]=_0x5eccc9[_0x7b57('0x2')]||'';this[_0x7b57('0x3')]=_0x5eccc9[_0x7b57('0x3')]||'';this[_0x7b57('0x4')]=_0x5eccc9[_0x7b57('0x4')]||'';this['consumerKey']=_0x5eccc9[_0x7b57('0x5')]||'';this[_0x7b57('0x6')]=_0x5eccc9[_0x7b57('0x6')]||'';this[_0x7b57('0x7')]=_0x5eccc9['token']||'';this[_0x7b57('0x8')]=_0x5eccc9[_0x7b57('0x8')]||'';this[_0x7b57('0x9')]=_0x5eccc9[_0x7b57('0x9')]||'';this['serverUrl']=_0x5eccc9[_0x7b57('0xa')]||'';this[_0x7b57('0xb')]=_0x5eccc9[_0x7b57('0xb')]||{};}module[_0x7b57('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index d77d5bb..5d36ece 100644 --- a/server/services/ami/model/dynamics365Account.js +++ b/server/services/ami/model/dynamics365Account.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa67a=['Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xa67a,0x1cb));var _0xaa67=function(_0x4f072c,_0x3a9840){_0x4f072c=_0x4f072c-0x0;var _0x4d2953=_0xa67a[_0x4f072c];return _0x4d2953;};'use strict';function Dynamics365Account(_0x156f80){this['id']=_0x156f80['id']||0x0;this[_0xaa67('0x0')]=_0x156f80[_0xaa67('0x0')]||'';this[_0xaa67('0x1')]=_0x156f80[_0xaa67('0x1')]||'';this[_0xaa67('0x2')]=_0x156f80[_0xaa67('0x2')]||'';this['remoteUri']=_0x156f80[_0xaa67('0x3')]||'';this[_0xaa67('0x4')]=_0x156f80[_0xaa67('0x4')]||'';this['clientId']=_0x156f80[_0xaa67('0x5')]||'';this['clientSecret']=_0x156f80[_0xaa67('0x6')]||{};this[_0xaa67('0x7')]=_0x156f80[_0xaa67('0x7')]||'';this[_0xaa67('0x8')]=_0x156f80[_0xaa67('0x8')]||![];this['Configurations']=_0x156f80[_0xaa67('0x9')]||{};this[_0xaa67('0xa')]=_0x156f80['CloudProvider']||{};}module[_0xaa67('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x2229=['Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication'];(function(_0x4cdecc,_0x321d1a){var _0x3948a9=function(_0x2a247d){while(--_0x2a247d){_0x4cdecc['push'](_0x4cdecc['shift']());}};_0x3948a9(++_0x321d1a);}(_0x2229,0x87));var _0x9222=function(_0x4a60c2,_0x285d27){_0x4a60c2=_0x4a60c2-0x0;var _0x32a906=_0x2229[_0x4a60c2];return _0x32a906;};'use strict';function Dynamics365Account(_0xbfe15a){this['id']=_0xbfe15a['id']||0x0;this[_0x9222('0x0')]=_0xbfe15a['name']||'';this[_0x9222('0x1')]=_0xbfe15a[_0x9222('0x1')]||'';this[_0x9222('0x2')]=_0xbfe15a['password']||'';this[_0x9222('0x3')]=_0xbfe15a['remoteUri']||'';this[_0x9222('0x4')]=_0xbfe15a[_0x9222('0x4')]||'';this[_0x9222('0x5')]=_0xbfe15a[_0x9222('0x5')]||'';this['clientSecret']=_0xbfe15a[_0x9222('0x6')]||{};this['serverUrl']=_0xbfe15a[_0x9222('0x7')]||'';this['modernAuthentication']=_0xbfe15a[_0x9222('0x8')]||![];this['Configurations']=_0xbfe15a[_0x9222('0x9')]||{};this[_0x9222('0xa')]=_0xbfe15a[_0x9222('0xa')]||{};}module[_0x9222('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 0bc3a87..f59bdcb 100644 --- a/server/services/ami/model/faxAccount.js +++ b/server/services/ami/model/faxAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa10b=['minrate','maxrate','modem','gateway','faxdetect','tech','SIP','Trunk','ListId','key','exports','name','description','headerinfo','localstationid'];(function(_0x217864,_0x183226){var _0x58d26f=function(_0x526adb){while(--_0x526adb){_0x217864['push'](_0x217864['shift']());}};_0x58d26f(++_0x183226);}(_0xa10b,0xb0));var _0xba10=function(_0x29f65f,_0x350f7f){_0x29f65f=_0x29f65f-0x0;var _0x45a6ca=_0xa10b[_0x29f65f];return _0x45a6ca;};'use strict';function FaxAccount(_0x50a7da){this['id']=_0x50a7da['id']||0x0;this[_0xba10('0x0')]=_0x50a7da['name']||'';this[_0xba10('0x1')]=_0x50a7da[_0xba10('0x1')];this['ecm']=_0x50a7da['ecm'];this[_0xba10('0x2')]=_0x50a7da[_0xba10('0x2')];this[_0xba10('0x3')]=_0x50a7da[_0xba10('0x3')];this[_0xba10('0x4')]=_0x50a7da['minrate']||0x960;this['maxrate']=_0x50a7da[_0xba10('0x5')]||0x3840;this[_0xba10('0x6')]=_0x50a7da['modem']||'v17,v27,v29';this[_0xba10('0x7')]=_0x50a7da['gateway']||'no';this[_0xba10('0x8')]=_0x50a7da['faxdetect']||'no';this['t38timeout']=_0x50a7da['t38timeout']||0x1388;this[_0xba10('0x9')]=_0x50a7da['tech']||_0xba10('0xa');this[_0xba10('0xb')]=_0x50a7da[_0xba10('0xb')]?_0x50a7da[_0xba10('0xb')]:undefined;this[_0xba10('0xc')]=_0x50a7da[_0xba10('0xc')];this[_0xba10('0xd')]=_0x50a7da['key'];}module[_0xba10('0xe')]=FaxAccount; \ No newline at end of file +var _0x1397=['exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','v17,v27,v29','t38timeout','tech','SIP','Trunk','ListId','key'];(function(_0x254d53,_0xe1ccfd){var _0x3794bd=function(_0x58636d){while(--_0x58636d){_0x254d53['push'](_0x254d53['shift']());}};_0x3794bd(++_0xe1ccfd);}(_0x1397,0xb5));var _0x7139=function(_0x56f0f8,_0x28d84a){_0x56f0f8=_0x56f0f8-0x0;var _0x29c23c=_0x1397[_0x56f0f8];return _0x29c23c;};'use strict';function FaxAccount(_0x2e2504){this['id']=_0x2e2504['id']||0x0;this[_0x7139('0x0')]=_0x2e2504['name']||'';this[_0x7139('0x1')]=_0x2e2504[_0x7139('0x1')];this[_0x7139('0x2')]=_0x2e2504[_0x7139('0x2')];this[_0x7139('0x3')]=_0x2e2504[_0x7139('0x3')];this['localstationid']=_0x2e2504[_0x7139('0x4')];this[_0x7139('0x5')]=_0x2e2504[_0x7139('0x5')]||0x960;this[_0x7139('0x6')]=_0x2e2504[_0x7139('0x6')]||0x3840;this['modem']=_0x2e2504['modem']||_0x7139('0x7');this['gateway']=_0x2e2504['gateway']||'no';this['faxdetect']=_0x2e2504['faxdetect']||'no';this[_0x7139('0x8')]=_0x2e2504[_0x7139('0x8')]||0x1388;this[_0x7139('0x9')]=_0x2e2504[_0x7139('0x9')]||_0x7139('0xa');this[_0x7139('0xb')]=_0x2e2504[_0x7139('0xb')]?_0x2e2504[_0x7139('0xb')]:undefined;this[_0x7139('0xc')]=_0x2e2504['ListId'];this[_0x7139('0xd')]=_0x2e2504['key'];}module[_0x7139('0xe')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 3466647..608d33b 100644 --- a/server/services/ami/model/freshdeskAccount.js +++ b/server/services/ami/model/freshdeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa0e3=['name','username','apiKey','token','remoteUri','Configurations','exports'];(function(_0xee82b5,_0x256c09){var _0x25ac5f=function(_0x490ae7){while(--_0x490ae7){_0xee82b5['push'](_0xee82b5['shift']());}};_0x25ac5f(++_0x256c09);}(_0xa0e3,0x1dc));var _0x3a0e=function(_0xafce29,_0x3c36a4){_0xafce29=_0xafce29-0x0;var _0x41d263=_0xa0e3[_0xafce29];return _0x41d263;};'use strict';function FreshdeskAccount(_0x440e34){this['id']=_0x440e34['id']||0x0;this[_0x3a0e('0x0')]=_0x440e34[_0x3a0e('0x0')]||'';this[_0x3a0e('0x1')]=_0x440e34['username']||'';this[_0x3a0e('0x2')]=_0x440e34[_0x3a0e('0x3')]||'';this['remoteUri']=_0x440e34[_0x3a0e('0x4')]||'';this['serverUrl']=_0x440e34['serverUrl']||'';this[_0x3a0e('0x5')]=_0x440e34[_0x3a0e('0x5')]||{};}module[_0x3a0e('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x1239=['remoteUri','serverUrl','Configurations','name','username','apiKey','token'];(function(_0x40c933,_0x34ed65){var _0x258cfe=function(_0x1d6c20){while(--_0x1d6c20){_0x40c933['push'](_0x40c933['shift']());}};_0x258cfe(++_0x34ed65);}(_0x1239,0x1ca));var _0x9123=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1239[_0x2dafbe];return _0x58a45a;};'use strict';function FreshdeskAccount(_0x532d0e){this['id']=_0x532d0e['id']||0x0;this['name']=_0x532d0e[_0x9123('0x0')]||'';this[_0x9123('0x1')]=_0x532d0e[_0x9123('0x1')]||'';this[_0x9123('0x2')]=_0x532d0e[_0x9123('0x3')]||'';this[_0x9123('0x4')]=_0x532d0e['remoteUri']||'';this[_0x9123('0x5')]=_0x532d0e[_0x9123('0x5')]||'';this[_0x9123('0x6')]=_0x532d0e[_0x9123('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index c1c14bb..f68b190 100644 --- a/server/services/ami/model/freshsalesAccount.js +++ b/server/services/ami/model/freshsalesAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed08=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x38262c,_0x2c2f19){var _0x13c78a=function(_0x50b9ef){while(--_0x50b9ef){_0x38262c['push'](_0x38262c['shift']());}};_0x13c78a(++_0x2c2f19);}(_0xed08,0x67));var _0x8ed0=function(_0x368eba,_0x1c6120){_0x368eba=_0x368eba-0x0;var _0x45e49a=_0xed08[_0x368eba];return _0x45e49a;};'use strict';function FreshsalesAccount(_0x12c51f){this['id']=_0x12c51f['id']||0x0;this[_0x8ed0('0x0')]=_0x12c51f[_0x8ed0('0x0')]||'';this[_0x8ed0('0x1')]=_0x12c51f[_0x8ed0('0x1')]||'';this[_0x8ed0('0x2')]=_0x12c51f[_0x8ed0('0x3')]||'';this[_0x8ed0('0x4')]=_0x12c51f[_0x8ed0('0x4')]||'';this[_0x8ed0('0x5')]=_0x12c51f[_0x8ed0('0x5')]||'';this[_0x8ed0('0x6')]=_0x12c51f[_0x8ed0('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x2d17=['remoteUri','serverUrl','Configurations','exports','name','username','token'];(function(_0x2a2324,_0x47283a){var _0x1ba7fa=function(_0x9027c1){while(--_0x9027c1){_0x2a2324['push'](_0x2a2324['shift']());}};_0x1ba7fa(++_0x47283a);}(_0x2d17,0x17e));var _0x72d1=function(_0x69d8bb,_0x241a39){_0x69d8bb=_0x69d8bb-0x0;var _0x3dbb68=_0x2d17[_0x69d8bb];return _0x3dbb68;};'use strict';function FreshsalesAccount(_0x484ae9){this['id']=_0x484ae9['id']||0x0;this[_0x72d1('0x0')]=_0x484ae9['name']||'';this[_0x72d1('0x1')]=_0x484ae9[_0x72d1('0x1')]||'';this['apiKey']=_0x484ae9[_0x72d1('0x2')]||'';this[_0x72d1('0x3')]=_0x484ae9['remoteUri']||'';this[_0x72d1('0x4')]=_0x484ae9['serverUrl']||'';this[_0x72d1('0x5')]=_0x484ae9['Configurations']||{};}module[_0x72d1('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 8cfdcfb..936b2f0 100644 --- a/server/services/ami/model/queueReport.js +++ b/server/services/ami/model/queueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c7e=['connectedlinename','accountcode','context','exten','holdtime','assigned','lastAssignedTo','motionChannel','routealias','mohtime','variables','inbound','uniqueid','calleridnum','calleridname','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4c7e,0xf1));var _0xe4c7=function(_0x5f3b30,_0x10400b){_0x5f3b30=_0x5f3b30-0x0;var _0x2584b2=_0x4c7e[_0x5f3b30];return _0x2584b2;};'use strict';function QueueReport(){this['type']=_0xe4c7('0x0');this[_0xe4c7('0x1')]='';this[_0xe4c7('0x2')]='';this[_0xe4c7('0x3')]='';this['queue']='';this['queuecallerjoinAt']=null;this[_0xe4c7('0x4')]=null;this['position']=0x1;this['count']=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0xe4c7('0x5')]=![];this[_0xe4c7('0x6')]=null;this[_0xe4c7('0x7')]=![];this[_0xe4c7('0x8')]=null;this[_0xe4c7('0x9')]=0x1;this[_0xe4c7('0xa')]='';this[_0xe4c7('0xb')]='';this[_0xe4c7('0xc')]='';this[_0xe4c7('0xd')]='';this[_0xe4c7('0xe')]='';this[_0xe4c7('0xf')]='';this['priority']='';this[_0xe4c7('0x10')]=0x0;this[_0xe4c7('0x11')]=![];this[_0xe4c7('0x12')]='';this[_0xe4c7('0x13')]='voice';this[_0xe4c7('0x14')]=null;this[_0xe4c7('0x15')]=0x0;this[_0xe4c7('0x16')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x4461=['routealias','mohtime','variables','exports','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','accountcode','context','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice'];(function(_0x28f694,_0x2e58dc){var _0x40b606=function(_0x5e1de0){while(--_0x5e1de0){_0x28f694['push'](_0x28f694['shift']());}};_0x40b606(++_0x2e58dc);}(_0x4461,0x1cf));var _0x1446=function(_0x367759,_0x3ccdb9){_0x367759=_0x367759-0x0;var _0x3c8b9f=_0x4461[_0x367759];return _0x3c8b9f;};'use strict';function QueueReport(){this[_0x1446('0x0')]='inbound';this[_0x1446('0x1')]='';this[_0x1446('0x2')]='';this[_0x1446('0x3')]='';this[_0x1446('0x4')]='';this[_0x1446('0x5')]=null;this['queuecallerleaveAt']=null;this[_0x1446('0x6')]=0x1;this[_0x1446('0x7')]=0x1;this[_0x1446('0x8')]=![];this[_0x1446('0x9')]=null;this['queuecallercomplete']=![];this[_0x1446('0xa')]=null;this[_0x1446('0xb')]=![];this[_0x1446('0xc')]=null;this[_0x1446('0xd')]=0x1;this['channel']='';this[_0x1446('0xe')]='';this['connectedlinename']='';this[_0x1446('0xf')]='';this[_0x1446('0x10')]='';this['exten']='';this[_0x1446('0x11')]='';this[_0x1446('0x12')]=0x0;this[_0x1446('0x13')]=![];this[_0x1446('0x14')]='';this[_0x1446('0x15')]=_0x1446('0x16');this[_0x1446('0x17')]=null;this[_0x1446('0x18')]=0x0;this[_0x1446('0x19')]={};}module[_0x1446('0x1a')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index b835149..47ef71c 100644 --- a/server/services/ami/model/salesforceAccount.js +++ b/server/services/ami/model/salesforceAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e52=['remoteUri','password','clientId','securityToken','type','serverUrl','Configurations','name','username'];(function(_0x26dca1,_0x4a3622){var _0x177d36=function(_0x378e94){while(--_0x378e94){_0x26dca1['push'](_0x26dca1['shift']());}};_0x177d36(++_0x4a3622);}(_0x1e52,0x7c));var _0x21e5=function(_0x205c48,_0x4d0c4a){_0x205c48=_0x205c48-0x0;var _0x4d8d79=_0x1e52[_0x205c48];return _0x4d8d79;};'use strict';function SalesforceAccount(_0x45d98e){this['id']=_0x45d98e['id']||0x0;this[_0x21e5('0x0')]=_0x45d98e[_0x21e5('0x0')]||'';this[_0x21e5('0x1')]=_0x45d98e[_0x21e5('0x1')]||'';this[_0x21e5('0x2')]=_0x45d98e[_0x21e5('0x2')]||'';this[_0x21e5('0x3')]=_0x45d98e[_0x21e5('0x3')]||'';this[_0x21e5('0x4')]=_0x45d98e[_0x21e5('0x4')]||'';this['clientSecret']=_0x45d98e['clientSecret']||'';this[_0x21e5('0x5')]=_0x45d98e[_0x21e5('0x5')]||'';this[_0x21e5('0x6')]=_0x45d98e[_0x21e5('0x6')]||'integrationTab';this[_0x21e5('0x7')]=_0x45d98e[_0x21e5('0x7')]||'';this[_0x21e5('0x8')]=_0x45d98e[_0x21e5('0x8')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0xe0e8=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl'];(function(_0x4a29c6,_0x4d7493){var _0x3b1a96=function(_0x35822e){while(--_0x35822e){_0x4a29c6['push'](_0x4a29c6['shift']());}};_0x3b1a96(++_0x4d7493);}(_0xe0e8,0x182));var _0x8e0e=function(_0x4cca4e,_0x582ff5){_0x4cca4e=_0x4cca4e-0x0;var _0x69f11f=_0xe0e8[_0x4cca4e];return _0x69f11f;};'use strict';function SalesforceAccount(_0x5c9f8c){this['id']=_0x5c9f8c['id']||0x0;this[_0x8e0e('0x0')]=_0x5c9f8c[_0x8e0e('0x0')]||'';this[_0x8e0e('0x1')]=_0x5c9f8c['username']||'';this[_0x8e0e('0x2')]=_0x5c9f8c[_0x8e0e('0x2')]||'';this[_0x8e0e('0x3')]=_0x5c9f8c[_0x8e0e('0x3')]||'';this[_0x8e0e('0x4')]=_0x5c9f8c[_0x8e0e('0x4')]||'';this[_0x8e0e('0x5')]=_0x5c9f8c['clientSecret']||'';this[_0x8e0e('0x6')]=_0x5c9f8c[_0x8e0e('0x6')]||'';this['type']=_0x5c9f8c[_0x8e0e('0x7')]||_0x8e0e('0x8');this[_0x8e0e('0x9')]=_0x5c9f8c[_0x8e0e('0x9')]||'';this[_0x8e0e('0xa')]=_0x5c9f8c[_0x8e0e('0xa')]||{};}module[_0x8e0e('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 0b6bb6f..d5bc7e8 100644 --- a/server/services/ami/model/servicenowAccount.js +++ b/server/services/ami/model/servicenowAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf0bb=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf0bb,0xc1));var _0xbf0b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf0bb[_0x2dafbe];return _0x58a45a;};'use strict';function ServicenowAccount(_0x5b5ec3){this['id']=_0x5b5ec3['id']||0x0;this['name']=_0x5b5ec3[_0xbf0b('0x0')]||'';this[_0xbf0b('0x1')]=_0x5b5ec3[_0xbf0b('0x1')]||'';this[_0xbf0b('0x2')]=_0x5b5ec3['password']||'';this[_0xbf0b('0x3')]=_0x5b5ec3[_0xbf0b('0x3')]||'';this[_0xbf0b('0x4')]=_0x5b5ec3[_0xbf0b('0x4')]||'';this[_0xbf0b('0x5')]=_0x5b5ec3[_0xbf0b('0x5')]||{};}module[_0xbf0b('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x0e37=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x55ec67,_0x1c90d5){var _0x1350f6=function(_0x5ed223){while(--_0x5ed223){_0x55ec67['push'](_0x55ec67['shift']());}};_0x1350f6(++_0x1c90d5);}(_0x0e37,0xc6));var _0x70e3=function(_0x8bd38a,_0x56a6ca){_0x8bd38a=_0x8bd38a-0x0;var _0x3023c2=_0x0e37[_0x8bd38a];return _0x3023c2;};'use strict';function ServicenowAccount(_0x11fb75){this['id']=_0x11fb75['id']||0x0;this[_0x70e3('0x0')]=_0x11fb75['name']||'';this[_0x70e3('0x1')]=_0x11fb75[_0x70e3('0x1')]||'';this[_0x70e3('0x2')]=_0x11fb75['password']||'';this[_0x70e3('0x3')]=_0x11fb75[_0x70e3('0x3')]||'';this['serverUrl']=_0x11fb75[_0x70e3('0x4')]||'';this['Configurations']=_0x11fb75[_0x70e3('0x5')]||{};}module[_0x70e3('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 9a1eb57..770375a 100644 --- a/server/services/ami/model/sugarcrmAccount.js +++ b/server/services/ami/model/sugarcrmAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7553=['exports','name','username','remoteUri','serverUrl','Configurations'];(function(_0x337be7,_0x506def){var _0x214641=function(_0x2f4edb){while(--_0x2f4edb){_0x337be7['push'](_0x337be7['shift']());}};_0x214641(++_0x506def);}(_0x7553,0x193));var _0x3755=function(_0x55a89e,_0x1a05ab){_0x55a89e=_0x55a89e-0x0;var _0x3aa2bd=_0x7553[_0x55a89e];return _0x3aa2bd;};'use strict';function SugarcrmAccount(_0x48b934){this['id']=_0x48b934['id']||0x0;this[_0x3755('0x0')]=_0x48b934['name']||'';this[_0x3755('0x1')]=_0x48b934['username']||'';this['password']=_0x48b934['password']||'';this[_0x3755('0x2')]=_0x48b934[_0x3755('0x2')]||'';this[_0x3755('0x3')]=_0x48b934[_0x3755('0x3')]||'';this[_0x3755('0x4')]=_0x48b934[_0x3755('0x4')]||{};}module[_0x3755('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x515e=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x31ee91,_0x272005){var _0x2e9410=function(_0x2b9826){while(--_0x2b9826){_0x31ee91['push'](_0x31ee91['shift']());}};_0x2e9410(++_0x272005);}(_0x515e,0xd3));var _0xe515=function(_0x275cbc,_0x2a2ed6){_0x275cbc=_0x275cbc-0x0;var _0xd4e2a8=_0x515e[_0x275cbc];return _0xd4e2a8;};'use strict';function SugarcrmAccount(_0x4abe95){this['id']=_0x4abe95['id']||0x0;this[_0xe515('0x0')]=_0x4abe95[_0xe515('0x0')]||'';this[_0xe515('0x1')]=_0x4abe95[_0xe515('0x1')]||'';this[_0xe515('0x2')]=_0x4abe95['password']||'';this[_0xe515('0x3')]=_0x4abe95[_0xe515('0x3')]||'';this[_0xe515('0x4')]=_0x4abe95[_0xe515('0x4')]||'';this[_0xe515('0x5')]=_0x4abe95[_0xe515('0x5')]||{};}module[_0xe515('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 1201ffd..fe3219f 100644 --- a/server/services/ami/model/telephone.js +++ b/server/services/ami/model/telephone.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cd9=['exports','name','accountcode','unknown','address'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5cd9,0x13c));var _0x95cd=function(_0x41ec2f,_0xedb083){_0x41ec2f=_0x41ec2f-0x0;var _0x2abd9f=_0x5cd9[_0x41ec2f];return _0x2abd9f;};'use strict';function Telephone(_0x4d5931){this['id']=_0x4d5931['id']||0x0;this[_0x95cd('0x0')]=_0x4d5931[_0x95cd('0x0')]||'';this[_0x95cd('0x1')]=_0x4d5931[_0x95cd('0x1')]||'';this['state']=_0x95cd('0x2');this['stateTime']=0x0;this['status']=_0x95cd('0x2');this[_0x95cd('0x3')]='';}module[_0x95cd('0x4')]=Telephone; \ No newline at end of file +var _0x84ae=['accountcode','state','unknown','stateTime','status','name'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x84ae,0x101));var _0xe84a=function(_0x58053e,_0x5c5ba3){_0x58053e=_0x58053e-0x0;var _0x50f82c=_0x84ae[_0x58053e];return _0x50f82c;};'use strict';function Telephone(_0x9fde07){this['id']=_0x9fde07['id']||0x0;this[_0xe84a('0x0')]=_0x9fde07[_0xe84a('0x0')]||'';this[_0xe84a('0x1')]=_0x9fde07[_0xe84a('0x1')]||'';this[_0xe84a('0x2')]=_0xe84a('0x3');this[_0xe84a('0x4')]=0x0;this[_0xe84a('0x5')]='unknown';this['address']='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index ba60944..e20d487 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x25c54c,_0x260b78){var _0x2ede94=function(_0x1873f8){while(--_0x1873f8){_0x25c54c['push'](_0x25c54c['shift']());}};_0x2ede94(++_0x260b78);}(_0xb10b,0x12a));var _0xbb10=function(_0x313dab,_0x53179c){_0x313dab=_0x313dab-0x0;var _0x18ee37=_0xb10b[_0x313dab];return _0x18ee37;};'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 _0xb10b=['name','html'];(function(_0x4d5aed,_0x1a756c){var _0x423838=function(_0x2c5cc5){while(--_0x2c5cc5){_0x4d5aed['push'](_0x4d5aed['shift']());}};_0x423838(++_0x1a756c);}(_0xb10b,0x12a));var _0xbb10=function(_0x5d2699,_0xbb63f2){_0x5d2699=_0x5d2699-0x0;var _0x2a2ee6=_0xb10b[_0x5d2699];return _0x2a2ee6;};'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 diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index f483cd3..282ba9b 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x115bd9,_0x3a6ed0){var _0xe0e123=function(_0x59f491){while(--_0x59f491){_0x115bd9['push'](_0x115bd9['shift']());}};_0xe0e123(++_0x3a6ed0);}(_0x2032,0xd9));var _0x2203=function(_0x441a2e,_0x1ead00){_0x441a2e=_0x441a2e-0x0;var _0x2ba171=_0x2032[_0x441a2e];return _0x2ba171;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file +var _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x1443dd,_0x2d5325){var _0x282579=function(_0x4bc663){while(--_0x4bc663){_0x1443dd['push'](_0x1443dd['shift']());}};_0x282579(++_0x2d5325);}(_0x9ffd,0xaa));var _0xd9ff=function(_0xb29d95,_0x1e51d6){_0xb29d95=_0xb29d95-0x0;var _0x34e9b0=_0x9ffd[_0xb29d95];return _0x34e9b0;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 761f6b1..22bc36b 100644 --- a/server/services/ami/model/trunk.js +++ b/server/services/ami/model/trunk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfbfa=['refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split','host','port','domainport'];(function(_0x5d7965,_0x44010c){var _0x20c8bd=function(_0x16163c){while(--_0x16163c){_0x5d7965['push'](_0x5d7965['shift']());}};_0x20c8bd(++_0x44010c);}(_0xfbfa,0x114));var _0xafbf=function(_0x3027b1,_0x282484){_0x3027b1=_0x3027b1-0x0;var _0x59447f=_0xfbfa[_0x3027b1];return _0x59447f;};'use strict';function Trunk(_0x24e662){this['id']=_0x24e662['id']||0x0;this[_0xafbf('0x0')]=_0x24e662[_0xafbf('0x0')]||![];this[_0xafbf('0x1')]=_0x24e662[_0xafbf('0x1')]||'';this[_0xafbf('0x2')]=_0xafbf('0x3');this[_0xafbf('0x4')]=0x0;this[_0xafbf('0x5')]=_0xafbf('0x3');this['registry']=_0x24e662[_0xafbf('0x6')]&&_0x24e662[_0xafbf('0x6')][_0xafbf('0x7')](':')?_0x24e662[_0xafbf('0x6')][_0xafbf('0x8')](':')[0x0]:'';this[_0xafbf('0x9')]='';this[_0xafbf('0xa')]='';this['domain']='';this[_0xafbf('0xb')]='';this[_0xafbf('0xc')]='';this[_0xafbf('0xd')]='unknown';this[_0xafbf('0xe')]='';this[_0xafbf('0xf')]='';this[_0xafbf('0x10')]=_0x24e662[_0xafbf('0x10')]||'';}module[_0xafbf('0x11')]=Trunk; \ No newline at end of file +var _0x127b=['refresh','stateRegistry','registrationtime','address','defaultuser','active','name','state','status','unknown','registry','indexOf','host','port'];(function(_0x412e51,_0xd6d8d5){var _0xc7aaf3=function(_0x5c762f){while(--_0x5c762f){_0x412e51['push'](_0x412e51['shift']());}};_0xc7aaf3(++_0xd6d8d5);}(_0x127b,0x1a9));var _0xb127=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x127b[_0x2c7618];return _0x5ce3f0;};'use strict';function Trunk(_0x389d99){this['id']=_0x389d99['id']||0x0;this[_0xb127('0x0')]=_0x389d99[_0xb127('0x0')]||![];this['name']=_0x389d99[_0xb127('0x1')]||'';this[_0xb127('0x2')]='unknown';this['stateTime']=0x0;this[_0xb127('0x3')]=_0xb127('0x4');this[_0xb127('0x5')]=_0x389d99['registry']&&_0x389d99[_0xb127('0x5')][_0xb127('0x6')](':')?_0x389d99[_0xb127('0x5')]['split'](':')[0x0]:'';this[_0xb127('0x7')]='';this[_0xb127('0x8')]='';this['domain']='';this['domainport']='';this[_0xb127('0x9')]='';this[_0xb127('0xa')]=_0xb127('0x4');this[_0xb127('0xb')]='';this[_0xb127('0xc')]='';this['defaultuser']=_0x389d99[_0xb127('0xd')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index e080b29..0d6bf8c 100644 --- a/server/services/ami/model/voiceExtension.js +++ b/server/services/ami/model/voiceExtension.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5754=['exten','none','mandatoryDisposition','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5754,0x160));var _0x4575=function(_0x1665d2,_0x560f2c){_0x1665d2=_0x1665d2-0x0;var _0x2fbb4c=_0x5754[_0x1665d2];return _0x2fbb4c;};'use strict';function voiceExtension(_0x425993){this['id']=_0x425993['id']||0x0;this[_0x4575('0x0')]=_0x425993['exten']||'';this['recordingFormat']=_0x425993['recordingFormat']||_0x4575('0x1');this[_0x4575('0x2')]=_0x425993['mandatoryDisposition']||![];}module[_0x4575('0x3')]=voiceExtension; \ No newline at end of file +var _0x2255=['recordingFormat','none','mandatoryDisposition','exten'];(function(_0x1ba477,_0x481b45){var _0x2a4d3a=function(_0x5ad123){while(--_0x5ad123){_0x1ba477['push'](_0x1ba477['shift']());}};_0x2a4d3a(++_0x481b45);}(_0x2255,0x187));var _0x5225=function(_0x1b9d4b,_0x4bd421){_0x1b9d4b=_0x1b9d4b-0x0;var _0x1d9dd7=_0x2255[_0x1b9d4b];return _0x1d9dd7;};'use strict';function voiceExtension(_0x2894c8){this['id']=_0x2894c8['id']||0x0;this[_0x5225('0x0')]=_0x2894c8[_0x5225('0x0')]||'';this[_0x5225('0x1')]=_0x2894c8['recordingFormat']||_0x5225('0x2');this[_0x5225('0x3')]=_0x2894c8[_0x5225('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index c2dff23..17da434 100644 --- a/server/services/ami/model/voiceQueue.js +++ b/server/services/ami/model/voiceQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e64=['startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','linear','ringall','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','abandoned','inUse','invalid','loggedIn','notInUse','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive'];(function(_0x5a0e3f,_0x394d58){var _0x563666=function(_0x5951b4){while(--_0x5951b4){_0x5a0e3f['push'](_0x5a0e3f['shift']());}};_0x563666(++_0x394d58);}(_0x6e64,0x10f));var _0x46e6=function(_0x4b2eba,_0x1532c7){_0x4b2eba=_0x4b2eba-0x0;var _0x352380=_0x6e64[_0x4b2eba];return _0x352380;};'use strict';var monitorFormat={'wav':_0x46e6('0x0'),'wav49':_0x46e6('0x1'),'gsm':_0x46e6('0x2')};var strategy={'fewestcalls':_0x46e6('0x3'),'leastrecent':'leastrecent','linear':_0x46e6('0x4'),'random':'random','ringall':_0x46e6('0x5'),'rr':'roundrobin','rrmemory':_0x46e6('0x6'),'rrordered':_0x46e6('0x7'),'wrandom':_0x46e6('0x8')};function VoiceQueue(_0x1fbeb1){this['id']=_0x1fbeb1['id']||0x0;this[_0x46e6('0x9')]=_0x1fbeb1[_0x46e6('0x9')]||'';this['monitor_format']=_0x1fbeb1[_0x46e6('0xa')]||'';this[_0x46e6('0xb')]=_0x1fbeb1[_0x46e6('0xb')]||_0x46e6('0xc');this[_0x46e6('0xd')]=0x0;this[_0x46e6('0xe')]=0x0;this[_0x46e6('0xf')]=0x0;this[_0x46e6('0x10')]=0x0;this[_0x46e6('0x11')]=0x0;this[_0x46e6('0x12')]=0x0;this['unmanaged']=0x0;this[_0x46e6('0x13')]=0x0;this['available']=0x0;this['busy']=0x0;this[_0x46e6('0x14')]=0x0;this[_0x46e6('0x15')]=0x0;this[_0x46e6('0x16')]=0x0;this[_0x46e6('0x17')]=0x0;this['onHold']=0x0;this['paused']=0x0;this[_0x46e6('0x18')]=0x0;this[_0x46e6('0x19')]=0x0;this[_0x46e6('0x1a')]=0x0;this[_0x46e6('0x1b')]=0x0;this[_0x46e6('0x1c')]=0x0;this[_0x46e6('0x1d')]=_0x1fbeb1[_0x46e6('0x1d')]||![];this['acwTimeout']=_0x1fbeb1[_0x46e6('0x1e')]||0xa;this['autopause']=_0x1fbeb1[_0x46e6('0x1f')]||'no';this[_0x46e6('0x20')]=!![];this['message']='';this['statusMessage']='';this[_0x46e6('0x21')]=0x0;this[_0x46e6('0x22')]=0x0;this[_0x46e6('0x23')]=_0x1fbeb1['dialTimezone']||null;this[_0x46e6('0x24')]=_0x1fbeb1[_0x46e6('0x24')]?_0x1fbeb1[_0x46e6('0x24')]:null;this[_0x46e6('0x25')]=_0x1fbeb1[_0x46e6('0x25')];this[_0x46e6('0x26')]=_0x1fbeb1['dialMethod']||_0x46e6('0x27');this['dialLimitChannel']=_0x1fbeb1[_0x46e6('0x28')]||0x0;this['dialLimitQueue']=_0x1fbeb1[_0x46e6('0x29')]||0x0;this['dialPowerLevel']=_0x1fbeb1['dialPowerLevel']||0x1;this[_0x46e6('0x2a')]=_0x1fbeb1[_0x46e6('0x2a')]||_0x46e6('0x2b');this['dialPredictiveOptimizationPercentage']=_0x1fbeb1[_0x46e6('0x2c')]||0.03;this[_0x46e6('0x2d')]=_0x1fbeb1['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x1fbeb1[_0x46e6('0x2e')]||'anonymous';this[_0x46e6('0x2f')]=_0x1fbeb1[_0x46e6('0x2f')]||_0x46e6('0x30');this['dialOriginateTimeout']=_0x1fbeb1[_0x46e6('0x31')]||0x1e;this[_0x46e6('0x32')]=_0x1fbeb1[_0x46e6('0x32')]||_0x46e6('0x33');this[_0x46e6('0x34')]=_0x1fbeb1[_0x46e6('0x34')]||0x3;this[_0x46e6('0x35')]=_0x1fbeb1['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x1fbeb1[_0x46e6('0x36')]||0x3;this[_0x46e6('0x37')]=_0x1fbeb1[_0x46e6('0x37')]||0x96;this[_0x46e6('0x38')]=_0x1fbeb1[_0x46e6('0x38')]||0x3;this[_0x46e6('0x39')]=_0x1fbeb1[_0x46e6('0x39')]||0x96;this[_0x46e6('0x3a')]=_0x1fbeb1[_0x46e6('0x3a')]||0x3;this[_0x46e6('0x3b')]=_0x1fbeb1['dialNoAnswerRetryFrequency']||0x96;this[_0x46e6('0x3c')]=_0x1fbeb1[_0x46e6('0x3c')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x1fbeb1['dialNoSuchNumberRetryFrequency']||0x96;this[_0x46e6('0x3d')]=_0x1fbeb1[_0x46e6('0x3d')]||0x3;this[_0x46e6('0x3e')]=_0x1fbeb1[_0x46e6('0x3e')]||0x96;this[_0x46e6('0x3f')]=_0x1fbeb1['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x1fbeb1[_0x46e6('0x40')]||0x96;this[_0x46e6('0x41')]=_0x1fbeb1[_0x46e6('0x41')]||0x3;this[_0x46e6('0x42')]=_0x1fbeb1[_0x46e6('0x42')]||0x96;this[_0x46e6('0x43')]=_0x1fbeb1[_0x46e6('0x43')]||0x3;this[_0x46e6('0x44')]=_0x1fbeb1[_0x46e6('0x44')]||0x96;this[_0x46e6('0x45')]=_0x1fbeb1[_0x46e6('0x45')]||0x3;this[_0x46e6('0x46')]=_0x1fbeb1[_0x46e6('0x46')]||0x4;this[_0x46e6('0x47')]=_0x1fbeb1['Trunk']?_0x1fbeb1[_0x46e6('0x47')]:undefined;this['TrunkBackup']=_0x1fbeb1[_0x46e6('0x48')]?_0x1fbeb1['TrunkBackup']:undefined;this[_0x46e6('0x49')]=_0x1fbeb1['dialPrefix']||undefined;this[_0x46e6('0x4a')]=_0x1fbeb1[_0x46e6('0x4a')]?_0x1fbeb1[_0x46e6('0x4a')]:undefined;this['dialOrderByScheduledAt']=_0x1fbeb1['dialOrderByScheduledAt']||_0x46e6('0x4b');this[_0x46e6('0x4c')]=_0x1fbeb1['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x46e6('0x4d')]=_0x1fbeb1[_0x46e6('0x4d')]||undefined;this['strategy']=strategy[_0x1fbeb1[_0x46e6('0x4e')]];this[_0x46e6('0x4f')]=!![];this['dialAMDActive']=_0x1fbeb1[_0x46e6('0x50')]||![];this['dialAMDInitialSilence']=_0x1fbeb1[_0x46e6('0x51')];this[_0x46e6('0x52')]=_0x1fbeb1[_0x46e6('0x52')];this[_0x46e6('0x53')]=_0x1fbeb1[_0x46e6('0x53')];this[_0x46e6('0x54')]=_0x1fbeb1[_0x46e6('0x54')];this[_0x46e6('0x55')]=_0x1fbeb1[_0x46e6('0x55')];this['dialAMDBetweenWordsSilence']=_0x1fbeb1['dialAMDBetweenWordsSilence'];this[_0x46e6('0x56')]=_0x1fbeb1[_0x46e6('0x56')];this[_0x46e6('0x57')]=_0x1fbeb1['dialAMDSilenceThreshold'];this[_0x46e6('0x58')]=_0x1fbeb1[_0x46e6('0x58')];this[_0x46e6('0x59')]=0x0;this['pTalking']=0x0;this[_0x46e6('0x5a')]=_0x1fbeb1[_0x46e6('0x5a')];this[_0x46e6('0x5b')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x46e6('0x5c')]=0x0;this[_0x46e6('0x5d')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x46e6('0x5e')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x46e6('0x5f')]=0x0;this[_0x46e6('0x60')]=0x0;this[_0x46e6('0x61')]=0x0;this[_0x46e6('0x62')]=0x0;this[_0x46e6('0x63')]=0x0;this[_0x46e6('0x64')]=undefined;this[_0x46e6('0x65')]=undefined;this['handlePredictive']=undefined;this[_0x46e6('0x66')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x46e6('0x67')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x46e6('0x68')]=0x0;this[_0x46e6('0x69')]=0x0;this[_0x46e6('0x6a')]=0x0;this[_0x46e6('0x6b')]=0x0;this[_0x46e6('0x6c')]=_0x1fbeb1[_0x46e6('0x6d')]||0x14;this['predictiveIntervalMinThreshold']=_0x1fbeb1[_0x46e6('0x6d')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x46e6('0x6e')]=0x1;this[_0x46e6('0x6f')]=0x0;this[_0x46e6('0x70')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x46e6('0x71')]=0x0;this['dialRecallMeTimeout']=_0x1fbeb1[_0x46e6('0x72')]||0x1e;this['dialRecallInQueue']=_0x1fbeb1[_0x46e6('0x73')]||![];this[_0x46e6('0x74')]=!!_0x1fbeb1['dialPreviewAutoRecallMe']||![];this[_0x46e6('0x75')]=!!_0x1fbeb1['dialPreviewRecallmeReminder']||![];this['dialQueueProject2']=_0x1fbeb1[_0x46e6('0x76')]||undefined;this[_0x46e6('0x77')]=_0x1fbeb1[_0x46e6('0x77')]||![];this[_0x46e6('0x78')]=_0x1fbeb1['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x1fbeb1[_0x46e6('0xa')]]?monitorFormat[_0x1fbeb1['monitor_format']]:undefined;this[_0x46e6('0x79')]=_0x1fbeb1[_0x46e6('0x79')]||![];this['mandatoryDispositionPause']=_0x1fbeb1['mandatoryDispositionPause']?_0x1fbeb1['mandatoryDispositionPause']:undefined;this[_0x46e6('0x7a')]=![];}module[_0x46e6('0x7b')]=VoiceQueue; \ No newline at end of file +var _0x077e=['dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','dialPredictiveIntervalMaxThreshold','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','linear','random','ringall','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','answered','sumDuration','sumBillable','abandoned','busy','inUse','invalid','loggedIn','notInUse','onHold','paused','ringing','ringInUse','talking','unavailable','acw','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry'];(function(_0xf9d07d,_0x3c0fe8){var _0x8f6683=function(_0x2fc7b3){while(--_0x2fc7b3){_0xf9d07d['push'](_0xf9d07d['shift']());}};_0x8f6683(++_0x3c0fe8);}(_0x077e,0x14a));var _0xe077=function(_0x3b927d,_0x5172a2){_0x3b927d=_0x3b927d-0x0;var _0x32af9d=_0x077e[_0x3b927d];return _0x32af9d;};'use strict';var monitorFormat={'wav':_0xe077('0x0'),'wav49':_0xe077('0x1'),'gsm':_0xe077('0x2')};var strategy={'fewestcalls':_0xe077('0x3'),'leastrecent':'leastrecent','linear':_0xe077('0x4'),'random':_0xe077('0x5'),'ringall':_0xe077('0x6'),'rr':'roundrobin','rrmemory':_0xe077('0x7'),'rrordered':_0xe077('0x8'),'wrandom':_0xe077('0x9')};function VoiceQueue(_0xe4430c){this['id']=_0xe4430c['id']||0x0;this[_0xe077('0xa')]=_0xe4430c[_0xe077('0xa')]||'';this[_0xe077('0xb')]=_0xe4430c[_0xe077('0xb')]||'';this[_0xe077('0xc')]=_0xe4430c[_0xe077('0xc')]||_0xe077('0xd');this[_0xe077('0xe')]=0x0;this['total']=0x0;this[_0xe077('0xf')]=0x0;this[_0xe077('0x10')]=0x0;this['sumHoldTime']=0x0;this[_0xe077('0x11')]=0x0;this['unmanaged']=0x0;this[_0xe077('0x12')]=0x0;this['available']=0x0;this[_0xe077('0x13')]=0x0;this[_0xe077('0x14')]=0x0;this[_0xe077('0x15')]=0x0;this[_0xe077('0x16')]=0x0;this[_0xe077('0x17')]=0x0;this[_0xe077('0x18')]=0x0;this[_0xe077('0x19')]=0x0;this[_0xe077('0x1a')]=0x0;this[_0xe077('0x1b')]=0x0;this[_0xe077('0x1c')]=0x0;this[_0xe077('0x1d')]=0x0;this['unknown']=0x0;this[_0xe077('0x1e')]=_0xe4430c[_0xe077('0x1e')]||![];this['acwTimeout']=_0xe4430c['acwTimeout']||0xa;this['autopause']=_0xe4430c[_0xe077('0x1f')]||'no';this[_0xe077('0x20')]=!![];this[_0xe077('0x21')]='';this[_0xe077('0x22')]='';this[_0xe077('0x23')]=0x0;this[_0xe077('0x24')]=0x0;this[_0xe077('0x25')]=_0xe4430c[_0xe077('0x25')]||null;this[_0xe077('0x26')]=_0xe4430c[_0xe077('0x26')]?_0xe4430c['dialGlobalInterval']:null;this[_0xe077('0x27')]=_0xe4430c[_0xe077('0x27')];this[_0xe077('0x28')]=_0xe4430c['dialMethod']||_0xe077('0x29');this['dialLimitChannel']=_0xe4430c[_0xe077('0x2a')]||0x0;this[_0xe077('0x2b')]=_0xe4430c[_0xe077('0x2b')]||0x0;this['dialPowerLevel']=_0xe4430c[_0xe077('0x2c')]||0x1;this[_0xe077('0x2d')]=_0xe4430c[_0xe077('0x2d')]||_0xe077('0x2e');this[_0xe077('0x2f')]=_0xe4430c[_0xe077('0x2f')]||0.03;this[_0xe077('0x30')]=_0xe4430c[_0xe077('0x30')]||0x258;this[_0xe077('0x31')]=_0xe4430c['dialOriginateCallerIdName']||_0xe077('0x32');this[_0xe077('0x33')]=_0xe4430c['dialOriginateCallerIdNumber']||_0xe077('0x32');this[_0xe077('0x34')]=_0xe4430c[_0xe077('0x34')]||0x1e;this[_0xe077('0x35')]=_0xe4430c[_0xe077('0x35')]||_0xe077('0x36');this[_0xe077('0x37')]=_0xe4430c[_0xe077('0x37')]||0x3;this['dialQueueProject']=_0xe4430c[_0xe077('0x38')]||undefined;this[_0xe077('0x39')]=_0xe4430c[_0xe077('0x39')]||0x3;this[_0xe077('0x3a')]=_0xe4430c[_0xe077('0x3a')]||0x96;this[_0xe077('0x3b')]=_0xe4430c[_0xe077('0x3b')]||0x3;this[_0xe077('0x3c')]=_0xe4430c[_0xe077('0x3c')]||0x96;this[_0xe077('0x3d')]=_0xe4430c[_0xe077('0x3d')]||0x3;this[_0xe077('0x3e')]=_0xe4430c[_0xe077('0x3e')]||0x96;this['dialNoSuchNumberMaxRetry']=_0xe4430c[_0xe077('0x3f')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0xe4430c[_0xe077('0x40')]||0x96;this[_0xe077('0x41')]=_0xe4430c[_0xe077('0x41')]||0x3;this['dialDropRetryFrequency']=_0xe4430c[_0xe077('0x42')]||0x96;this[_0xe077('0x43')]=_0xe4430c[_0xe077('0x43')]||0x3;this[_0xe077('0x44')]=_0xe4430c[_0xe077('0x44')]||0x96;this[_0xe077('0x45')]=_0xe4430c[_0xe077('0x45')]||0x3;this[_0xe077('0x46')]=_0xe4430c[_0xe077('0x46')]||0x96;this[_0xe077('0x47')]=_0xe4430c[_0xe077('0x47')]||0x3;this[_0xe077('0x48')]=_0xe4430c[_0xe077('0x48')]||0x96;this[_0xe077('0x49')]=_0xe4430c[_0xe077('0x49')]||0x3;this['dialGlobalMaxRetry']=_0xe4430c['dialGlobalMaxRetry']||0x4;this[_0xe077('0x4a')]=_0xe4430c[_0xe077('0x4a')]?_0xe4430c['Trunk']:undefined;this['TrunkBackup']=_0xe4430c[_0xe077('0x4b')]?_0xe4430c[_0xe077('0x4b')]:undefined;this[_0xe077('0x4c')]=_0xe4430c[_0xe077('0x4c')]||undefined;this['Interval']=_0xe4430c['Interval']?_0xe4430c[_0xe077('0x4d')]:undefined;this[_0xe077('0x4e')]=_0xe4430c[_0xe077('0x4e')]||_0xe077('0x4f');this[_0xe077('0x50')]=_0xe4430c['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xe077('0x51')]=_0xe4430c['dialCutDigit']||undefined;this['strategy']=strategy[_0xe4430c[_0xe077('0x52')]];this[_0xe077('0x53')]=!![];this[_0xe077('0x54')]=_0xe4430c[_0xe077('0x54')]||![];this[_0xe077('0x55')]=_0xe4430c['dialAMDInitialSilence'];this[_0xe077('0x56')]=_0xe4430c[_0xe077('0x56')];this['dialAMDAfterGreetingSilence']=_0xe4430c[_0xe077('0x57')];this['dialAMDTotalAnalysisTime']=_0xe4430c['dialAMDTotalAnalysisTime'];this[_0xe077('0x58')]=_0xe4430c['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0xe4430c[_0xe077('0x59')];this[_0xe077('0x5a')]=_0xe4430c['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0xe4430c[_0xe077('0x5b')];this[_0xe077('0x5c')]=_0xe4430c['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0xe077('0x5d')]=0x0;this[_0xe077('0x5e')]=_0xe4430c[_0xe077('0x5e')];this[_0xe077('0x5f')]=0x0;this[_0xe077('0x60')]=0x0;this[_0xe077('0x61')]=0x0;this[_0xe077('0x62')]=0x0;this[_0xe077('0x63')]=0x0;this[_0xe077('0x64')]=0x0;this[_0xe077('0x65')]=0x0;this[_0xe077('0x66')]=0x0;this[_0xe077('0x67')]=0x0;this[_0xe077('0x68')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xe077('0x69')]=0x0;this[_0xe077('0x6a')]=0x0;this['outboundAbandonedDay']=0x0;this[_0xe077('0x6b')]=undefined;this[_0xe077('0x6c')]=undefined;this[_0xe077('0x6d')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xe077('0x6e')]=0x0;this[_0xe077('0x6f')]=0x0;this[_0xe077('0x70')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xe077('0x71')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xe077('0x72')]=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0xe4430c[_0xe077('0x73')]||0x14;this['predictiveIntervalMinThreshold']=_0xe4430c[_0xe077('0x73')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xe077('0x74')]=0x1;this[_0xe077('0x75')]=0x0;this[_0xe077('0x76')]=0x0;this[_0xe077('0x77')]=0x0;this[_0xe077('0x78')]=0x0;this[_0xe077('0x79')]=_0xe4430c['dialRecallMeTimeout']||0x1e;this[_0xe077('0x7a')]=_0xe4430c[_0xe077('0x7a')]||![];this[_0xe077('0x7b')]=!!_0xe4430c[_0xe077('0x7b')]||![];this[_0xe077('0x7c')]=!!_0xe4430c['dialPreviewRecallmeReminder']||![];this['dialQueueProject2']=_0xe4430c[_0xe077('0x7d')]||undefined;this[_0xe077('0x7e')]=_0xe4430c[_0xe077('0x7e')]||![];this['dialAgiAfterHangupAgent']=_0xe4430c[_0xe077('0x7f')]||![];this[_0xe077('0xb')]=monitorFormat[_0xe4430c[_0xe077('0xb')]]?monitorFormat[_0xe4430c[_0xe077('0xb')]]:undefined;this[_0xe077('0x80')]=_0xe4430c[_0xe077('0x80')]||![];this[_0xe077('0x81')]=_0xe4430c[_0xe077('0x81')]?_0xe4430c[_0xe077('0x81')]:undefined;this[_0xe077('0x82')]=![];}module[_0xe077('0x83')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index c07195c..bcbf4a7 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd072=['predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','callers','length','online','incall','includes','status','booked','keys','queue','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','outboundAbandonedCallsDay','preview','exports','available','loggedIn','loggedInDb','paused','ringing','talking','waiting','answered','inUse','originated','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0xd072,0x132));var _0x2d07=function(_0x58352c,_0x3e8bc){_0x58352c=_0x58352c-0x0;var _0x31fa3c=_0xd072[_0x58352c];return _0x31fa3c;};'use strict';var INBOUND_COUNTERS=[_0x2d07('0x0'),_0x2d07('0x1'),_0x2d07('0x2'),_0x2d07('0x3'),_0x2d07('0x4'),_0x2d07('0x5'),_0x2d07('0x6')];var OUTBOUND_COUNTERS=['available',_0x2d07('0x7'),_0x2d07('0x8'),_0x2d07('0x1'),_0x2d07('0x2'),_0x2d07('0x9'),'outboundAbandonedCallsDay',_0x2d07('0xa'),_0x2d07('0xb'),_0x2d07('0xc'),_0x2d07('0xd'),_0x2d07('0xe'),_0x2d07('0xf'),_0x2d07('0x10'),'outboundRejectCallsDay',_0x2d07('0x11'),_0x2d07('0x3'),_0x2d07('0x12'),_0x2d07('0x5'),_0x2d07('0x13'),_0x2d07('0x14'),_0x2d07('0x15'),_0x2d07('0x6')];function VoiceQueueSummary(_0x231c86){this['id']=_0x231c86['id'];this[_0x2d07('0x16')]=_0x231c86[_0x2d07('0x16')];this[_0x2d07('0x17')]=_0x231c86[_0x2d07('0x17')];this[_0x2d07('0x18')]=_0x231c86[_0x2d07('0x18')]||0x0;this[_0x2d07('0x7')]=_0x231c86[_0x2d07('0x7')]||0x0;this[_0x2d07('0x0')]=_0x231c86[_0x2d07('0x0')]||0x0;this[_0x2d07('0x19')]=_0x231c86[_0x2d07('0x19')]||0x0;this[_0x2d07('0x8')]=_0x231c86[_0x2d07('0x8')]||0x0;this[_0x2d07('0x1a')]=_0x231c86[_0x2d07('0x1a')]||0x0;this['loggedIn']=_0x231c86[_0x2d07('0x1')]||0x0;this[_0x2d07('0x2')]=_0x231c86[_0x2d07('0x2')]||0x0;this[_0x2d07('0x1b')]=_0x231c86[_0x2d07('0x1b')]||0x0;this[_0x2d07('0x1c')]=_0x231c86[_0x2d07('0x1c')]||0x0;this[_0x2d07('0x3')]=_0x231c86['paused']||0x0;this[_0x2d07('0x4')]=_0x231c86[_0x2d07('0x4')]||0x0;this[_0x2d07('0x1d')]=_0x231c86[_0x2d07('0x1d')];this['sumBillable']=_0x231c86[_0x2d07('0x13')];this[_0x2d07('0x14')]=_0x231c86[_0x2d07('0x14')];this[_0x2d07('0x1e')]=_0x231c86[_0x2d07('0x1e')]||0x0;this[_0x2d07('0x5')]=_0x231c86[_0x2d07('0x5')]||0x0;this[_0x2d07('0x15')]=_0x231c86['total']||0x0;this[_0x2d07('0x1f')]=_0x231c86[_0x2d07('0x1f')];this[_0x2d07('0x20')]=_0x231c86['unavailable']||0x0;this[_0x2d07('0x21')]=_0x231c86['unknown']||0x0;this[_0x2d07('0x22')]=_0x231c86[_0x2d07('0x22')]||0x0;this[_0x2d07('0x6')]=_0x231c86['waiting']||0x0;if(_0x231c86[_0x2d07('0x1f')]===_0x2d07('0x23')){this['pTalking']=_0x231c86[_0x2d07('0x12')]||0x0;this['dialActive']=_0x231c86[_0x2d07('0x24')];this[_0x2d07('0x25')]=_0x231c86[_0x2d07('0x25')];this[_0x2d07('0x26')]=_0x231c86['dialOriginateCallerIdName'];this[_0x2d07('0x27')]=_0x231c86[_0x2d07('0x27')];this[_0x2d07('0x28')]=_0x231c86['dialOriginateTimeout'];this[_0x2d07('0x29')]=_0x231c86['dialPrefix'];this['temp']=_0x231c86[_0x2d07('0x2a')];this[_0x2d07('0x2b')]=_0x231c86['outboundAnswerAgiCallsDay'];this[_0x2d07('0xa')]=_0x231c86['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0x231c86[_0x2d07('0xb')];this[_0x2d07('0xc')]=_0x231c86['outboundBusyCallsDay'];this[_0x2d07('0xd')]=_0x231c86['outboundCongestionCallsDay'];this[_0x2d07('0x2c')]=_0x231c86[_0x2d07('0x2c')];this['outboundDropCallsDayCallersExit']=_0x231c86[_0x2d07('0x2d')];this['outboundDropCallsDayTimeout']=_0x231c86['outboundDropCallsDayTimeout'];this[_0x2d07('0xe')]=_0x231c86['outboundNoAnswerCallsDay'];this[_0x2d07('0xf')]=_0x231c86[_0x2d07('0xf')];this[_0x2d07('0x2e')]=_0x231c86['outboundOriginateFailureCallsDay'];this['outboundReCallsDay']=_0x231c86[_0x2d07('0x10')];this[_0x2d07('0x2f')]=_0x231c86[_0x2d07('0x2f')];this[_0x2d07('0x11')]=_0x231c86['outboundUnknownCallsDay'];this['predictiveIntervalAnsweredCalls']=_0x231c86['predictiveIntervalAnsweredCalls'];this[_0x2d07('0x30')]=_0x231c86['predictiveIntervalAvgHoldtime'];this[_0x2d07('0x31')]=_0x231c86[_0x2d07('0x31')];this[_0x2d07('0x32')]=_0x231c86[_0x2d07('0x32')];this[_0x2d07('0x33')]=_0x231c86['predictiveIntervalDroppedCallsTimeout'];this['predictiveIntervalErlangCalls']=_0x231c86[_0x2d07('0x34')];this[_0x2d07('0x35')]=_0x231c86[_0x2d07('0x35')];this[_0x2d07('0x36')]=_0x231c86['predictiveIntervalHitRate'];this[_0x2d07('0x37')]=_0x231c86[_0x2d07('0x37')];this[_0x2d07('0x38')]=_0x231c86[_0x2d07('0x38')];this['predictiveIntervalAvailable']=_0x231c86['predictiveIntervalAvailable'];this[_0x2d07('0x39')]=_0x231c86[_0x2d07('0x39')];this[_0x2d07('0x9')]=_0x231c86['originated'];this['erlangCalls']=_0x231c86[_0x2d07('0x3a')];this[_0x2d07('0x3b')]=_0x231c86[_0x2d07('0x3b')];this[_0x2d07('0x3c')]=_0x231c86[_0x2d07('0x3c')];this['erlangBusyFactor']=_0x231c86[_0x2d07('0x3d')];this[_0x2d07('0x3e')]=_0x231c86['startPredictive'];this[_0x2d07('0x3f')]=_0x231c86['startProgressive'];this[_0x2d07('0x40')]=_0x231c86[_0x2d07('0x40')];this[_0x2d07('0x41')]=_0x231c86[_0x2d07('0x41')];}if(_0x231c86[_0x2d07('0x42')]){this[_0x2d07('0x42')]={'id':_0x231c86['Trunk']['id'],'name':_0x231c86[_0x2d07('0x42')][_0x2d07('0x16')],'active':_0x231c86[_0x2d07('0x42')][_0x2d07('0x43')],'callerid':_0x231c86['Trunk'][_0x2d07('0x44')]};}}VoiceQueueSummary[_0x2d07('0x45')][_0x2d07('0x46')]=function(_0x2d76e1,_0x2ac0b0,_0x5791f8,_0xbb2c54){this[_0x2d07('0x2')]=0x0;this[_0x2d07('0x5')]=0x0;this[_0x2d07('0x3')]=0x0;this[_0x2d07('0x21')]=0x0;this[_0x2d07('0x1c')]=0x0;this[_0x2d07('0x8')]=0x0;this[_0x2d07('0x19')]=0x0;this[_0x2d07('0x1a')]=0x0;this[_0x2d07('0x20')]=0x0;this[_0x2d07('0x4')]=0x0;this[_0x2d07('0x1d')]=0x0;this[_0x2d07('0x1b')]=0x0;if(_0x5791f8){if(_0x5791f8['available']){this[_0x2d07('0x0')]=Number(_0x5791f8[_0x2d07('0x0')]);}if(_0x5791f8['loggedin']){this[_0x2d07('0x1')]=Number(_0x5791f8[_0x2d07('0x47')]);}if(_0x5791f8[_0x2d07('0x48')]){this['waiting']=Number(_0x5791f8['callers']);}}for(var _0x3fb560=0x0;_0x3fb560<_0x2d76e1[_0x2d07('0x49')];_0x3fb560++){var _0xd7e520=_0x2ac0b0['SIP/'+_0x2d76e1[_0x3fb560][_0x2d07('0x16')]];if(_0xd7e520&&_0xd7e520[_0x2d07('0x4a')]){this['loggedInDb']+=0x1;}if(_0x2d76e1[_0x3fb560][_0x2d07('0x4b')]==='1'){this[_0x2d07('0x5')]+=0x1;}if(_0x2d76e1[_0x3fb560][_0x2d07('0x3')]==='1'&&!['2','7','8'][_0x2d07('0x4c')](_0x2d76e1[_0x3fb560][_0x2d07('0x4d')])){this[_0x2d07('0x3')]+=0x1;}switch(_0x2d76e1[_0x3fb560]['status']){case'0':this[_0x2d07('0x21')]+=0x1;break;case'1':this[_0x2d07('0x1c')]+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0x2d07('0x19')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0x2d07('0x4')]+=0x1;break;case'7':this[_0x2d07('0x1d')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this['dialMethod']===_0x2d07('0x4e')){var _0x53fc26=Object[_0x2d07('0x4f')](_0xbb2c54);for(var _0x5e4495=0x0;_0x5e4495<_0x53fc26[_0x2d07('0x49')];_0x5e4495++){var _0xccd0cf=_0x53fc26[_0x5e4495];var _0x17180b=_0xbb2c54[_0xccd0cf];if(_0x17180b[_0x2d07('0x50')]===this[_0x2d07('0x16')]&&_0x17180b[_0x2d07('0x1f')]===_0x2d07('0x51')&&_0x17180b[_0x2d07('0x52')]===_0x2d07('0x53')){this[_0x2d07('0x5')]+=0x1;}}if(this[_0x2d07('0x5')]>this[_0x2d07('0x8')]){this[_0x2d07('0x5')]=this[_0x2d07('0x8')];}this[_0x2d07('0x12')]=0x0;}return this;};VoiceQueueSummary[_0x2d07('0x45')][_0x2d07('0x54')]=function(_0x2aaa50){var _0x88ff84=![];if(_0x2aaa50){_0x88ff84=INBOUND_COUNTERS[_0x2d07('0x55')](function(_0x2fdea8){return this[_0x2fdea8]!==_0x2aaa50[_0x2fdea8];},this);}return _0x88ff84;};VoiceQueueSummary[_0x2d07('0x45')][_0x2d07('0x56')]=function(_0x40bf8f){var _0x251659=![];var _0x5cf066=![];var _0x1970ef=![];if(_0x40bf8f){_0x251659=this['dialMethod']!==_0x40bf8f[_0x2d07('0x25')]||this['dialActive']!==_0x40bf8f[_0x2d07('0x24')]||this[_0x2d07('0x40')]!==_0x40bf8f[_0x2d07('0x40')]||this[_0x2d07('0x41')]!==_0x40bf8f[_0x2d07('0x41')];_0x5cf066=OUTBOUND_COUNTERS[_0x2d07('0x55')](function(_0x7409d4){return this[_0x7409d4]!==_0x40bf8f[_0x7409d4];},this);if(this[_0x2d07('0x42')]&&_0x40bf8f['Trunk']){_0x1970ef=this['Trunk']['name']!==_0x40bf8f[_0x2d07('0x42')][_0x2d07('0x16')]||this[_0x2d07('0x42')][_0x2d07('0x43')]!==_0x40bf8f[_0x2d07('0x42')][_0x2d07('0x43')];}}return _0x251659||_0x5cf066||_0x1970ef;};VoiceQueueSummary['prototype']['updateReportFromOutboundQueue']=function(_0x4d42bd){this[_0x2d07('0x7')]=_0x4d42bd[_0x2d07('0x7')];this[_0x2d07('0x40')]=_0x4d42bd[_0x2d07('0x40')];this[_0x2d07('0x41')]=_0x4d42bd[_0x2d07('0x41')];this[_0x2d07('0x9')]=_0x4d42bd[_0x2d07('0x9')];this[_0x2d07('0x57')]=_0x4d42bd[_0x2d07('0x57')];this[_0x2d07('0xa')]=_0x4d42bd[_0x2d07('0xa')];this[_0x2d07('0xb')]=_0x4d42bd[_0x2d07('0xb')];this[_0x2d07('0xc')]=_0x4d42bd[_0x2d07('0xc')];this[_0x2d07('0xd')]=_0x4d42bd[_0x2d07('0xd')];this[_0x2d07('0xe')]=_0x4d42bd[_0x2d07('0xe')];this[_0x2d07('0xf')]=_0x4d42bd[_0x2d07('0xf')];this[_0x2d07('0x10')]=_0x4d42bd[_0x2d07('0x10')];this[_0x2d07('0x2f')]=_0x4d42bd[_0x2d07('0x2f')];this['outboundUnknownCallsDay']=_0x4d42bd['outboundUnknownCallsDay'];this[_0x2d07('0x13')]=_0x4d42bd[_0x2d07('0x13')];this['sumDuration']=_0x4d42bd[_0x2d07('0x14')];this[_0x2d07('0x15')]=_0x4d42bd[_0x2d07('0x15')];if(this[_0x2d07('0x25')]===_0x2d07('0x58')){this['pTalking']=_0x4d42bd[_0x2d07('0x12')];}};module[_0x2d07('0x59')]=VoiceQueueSummary; \ No newline at end of file +var _0xe914=['outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','callerid','prototype','loggedin','callers','length','online','incall','includes','booked','keys','dialer','compareToInboundQueue','some','compareToOutboundQueue','active','updateReportFromOutboundQueue','outboundRejectCallsDay','available','loggedIn','paused','ringing','talking','waiting','answered','loggedInDb','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','pTalking','sumDuration','total','name','strategy','abandoned','busy','inUse','invalid','onHold','notInUse','ringInUse','sumBillable','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundCongestionCallsDay'];(function(_0x18d631,_0x4376d2){var _0x50d708=function(_0x3b6ab5){while(--_0x3b6ab5){_0x18d631['push'](_0x18d631['shift']());}};_0x50d708(++_0x4376d2);}(_0xe914,0x7f));var _0x4e91=function(_0x5f1d09,_0x18587c){_0x5f1d09=_0x5f1d09-0x0;var _0x4008b1=_0xe914[_0x5f1d09];return _0x4008b1;};'use strict';var INBOUND_COUNTERS=[_0x4e91('0x0'),_0x4e91('0x1'),'loggedInDb',_0x4e91('0x2'),_0x4e91('0x3'),_0x4e91('0x4'),_0x4e91('0x5')];var OUTBOUND_COUNTERS=[_0x4e91('0x0'),_0x4e91('0x6'),'inUse',_0x4e91('0x1'),_0x4e91('0x7'),'originated',_0x4e91('0x8'),_0x4e91('0x9'),_0x4e91('0xa'),_0x4e91('0xb'),'outboundCongestionCallsDay','outboundNoAnswerCallsDay',_0x4e91('0xc'),'outboundReCallsDay','outboundRejectCallsDay',_0x4e91('0xd'),_0x4e91('0x2'),_0x4e91('0xe'),_0x4e91('0x4'),'sumBillable',_0x4e91('0xf'),_0x4e91('0x10'),_0x4e91('0x5')];function VoiceQueueSummary(_0x559670){this['id']=_0x559670['id'];this[_0x4e91('0x11')]=_0x559670[_0x4e91('0x11')];this[_0x4e91('0x12')]=_0x559670[_0x4e91('0x12')];this[_0x4e91('0x13')]=_0x559670[_0x4e91('0x13')]||0x0;this[_0x4e91('0x6')]=_0x559670[_0x4e91('0x6')]||0x0;this[_0x4e91('0x0')]=_0x559670['available']||0x0;this[_0x4e91('0x14')]=_0x559670[_0x4e91('0x14')]||0x0;this[_0x4e91('0x15')]=_0x559670['inUse']||0x0;this[_0x4e91('0x16')]=_0x559670[_0x4e91('0x16')]||0x0;this[_0x4e91('0x1')]=_0x559670[_0x4e91('0x1')]||0x0;this[_0x4e91('0x7')]=_0x559670[_0x4e91('0x7')]||0x0;this[_0x4e91('0x17')]=_0x559670[_0x4e91('0x17')]||0x0;this['notInUse']=_0x559670[_0x4e91('0x18')]||0x0;this[_0x4e91('0x2')]=_0x559670[_0x4e91('0x2')]||0x0;this['ringing']=_0x559670[_0x4e91('0x3')]||0x0;this[_0x4e91('0x19')]=_0x559670['ringInUse'];this[_0x4e91('0x1a')]=_0x559670[_0x4e91('0x1a')];this['sumDuration']=_0x559670[_0x4e91('0xf')];this[_0x4e91('0x1b')]=_0x559670[_0x4e91('0x1b')]||0x0;this['talking']=_0x559670[_0x4e91('0x4')]||0x0;this['total']=_0x559670[_0x4e91('0x10')]||0x0;this[_0x4e91('0x1c')]=_0x559670[_0x4e91('0x1c')];this[_0x4e91('0x1d')]=_0x559670['unavailable']||0x0;this[_0x4e91('0x1e')]=_0x559670['unknown']||0x0;this[_0x4e91('0x1f')]=_0x559670['unmanaged']||0x0;this[_0x4e91('0x5')]=_0x559670['waiting']||0x0;if(_0x559670[_0x4e91('0x1c')]===_0x4e91('0x20')){this[_0x4e91('0xe')]=_0x559670['pTalking']||0x0;this[_0x4e91('0x21')]=_0x559670[_0x4e91('0x21')];this['dialMethod']=_0x559670[_0x4e91('0x22')];this[_0x4e91('0x23')]=_0x559670[_0x4e91('0x23')];this[_0x4e91('0x24')]=_0x559670[_0x4e91('0x24')];this[_0x4e91('0x25')]=_0x559670[_0x4e91('0x25')];this[_0x4e91('0x26')]=_0x559670['dialPrefix'];this['temp']=_0x559670['temp'];this[_0x4e91('0x27')]=_0x559670[_0x4e91('0x27')];this['outboundAnswerCallsDay']=_0x559670[_0x4e91('0x9')];this['outboundBlacklistCallsDay']=_0x559670['outboundBlacklistCallsDay'];this[_0x4e91('0xb')]=_0x559670[_0x4e91('0xb')];this[_0x4e91('0x28')]=_0x559670[_0x4e91('0x28')];this[_0x4e91('0x29')]=_0x559670[_0x4e91('0x29')];this['outboundDropCallsDayCallersExit']=_0x559670['outboundDropCallsDayCallersExit'];this['outboundDropCallsDayTimeout']=_0x559670[_0x4e91('0x2a')];this[_0x4e91('0x2b')]=_0x559670['outboundNoAnswerCallsDay'];this['outboundNoSuchCallsDay']=_0x559670['outboundNoSuchCallsDay'];this[_0x4e91('0x2c')]=_0x559670[_0x4e91('0x2c')];this[_0x4e91('0x2d')]=_0x559670[_0x4e91('0x2d')];this['outboundRejectCallsDay']=_0x559670['outboundRejectCallsDay'];this[_0x4e91('0xd')]=_0x559670[_0x4e91('0xd')];this[_0x4e91('0x2e')]=_0x559670[_0x4e91('0x2e')];this[_0x4e91('0x2f')]=_0x559670[_0x4e91('0x2f')];this[_0x4e91('0x30')]=_0x559670[_0x4e91('0x30')];this[_0x4e91('0x31')]=_0x559670[_0x4e91('0x31')];this[_0x4e91('0x32')]=_0x559670['predictiveIntervalDroppedCallsTimeout'];this['predictiveIntervalErlangCalls']=_0x559670[_0x4e91('0x33')];this[_0x4e91('0x34')]=_0x559670[_0x4e91('0x34')];this[_0x4e91('0x35')]=_0x559670[_0x4e91('0x35')];this[_0x4e91('0x36')]=_0x559670[_0x4e91('0x36')];this['predictiveIntervalPauses']=_0x559670[_0x4e91('0x37')];this['predictiveIntervalAvailable']=_0x559670['predictiveIntervalAvailable'];this[_0x4e91('0x38')]=_0x559670['predictiveIntervalTotalCalls'];this[_0x4e91('0x39')]=_0x559670[_0x4e91('0x39')];this[_0x4e91('0x3a')]=_0x559670[_0x4e91('0x3a')];this[_0x4e91('0x3b')]=_0x559670[_0x4e91('0x3b')];this[_0x4e91('0x3c')]=_0x559670[_0x4e91('0x3c')];this[_0x4e91('0x3d')]=_0x559670[_0x4e91('0x3d')];this[_0x4e91('0x3e')]=_0x559670[_0x4e91('0x3e')];this[_0x4e91('0x3f')]=_0x559670[_0x4e91('0x3f')];this['message']=_0x559670[_0x4e91('0x40')];this[_0x4e91('0x41')]=_0x559670[_0x4e91('0x41')];}if(_0x559670[_0x4e91('0x42')]){this[_0x4e91('0x42')]={'id':_0x559670[_0x4e91('0x42')]['id'],'name':_0x559670[_0x4e91('0x42')][_0x4e91('0x11')],'active':_0x559670[_0x4e91('0x42')]['active'],'callerid':_0x559670[_0x4e91('0x42')][_0x4e91('0x43')]};}}VoiceQueueSummary[_0x4e91('0x44')]['createReport']=function(_0x53801e,_0x1ea0fa,_0x557cc1,_0x227af4){this[_0x4e91('0x7')]=0x0;this[_0x4e91('0x4')]=0x0;this[_0x4e91('0x2')]=0x0;this[_0x4e91('0x1e')]=0x0;this['notInUse']=0x0;this['inUse']=0x0;this['busy']=0x0;this[_0x4e91('0x16')]=0x0;this[_0x4e91('0x1d')]=0x0;this[_0x4e91('0x3')]=0x0;this[_0x4e91('0x19')]=0x0;this[_0x4e91('0x17')]=0x0;if(_0x557cc1){if(_0x557cc1['available']){this[_0x4e91('0x0')]=Number(_0x557cc1[_0x4e91('0x0')]);}if(_0x557cc1[_0x4e91('0x45')]){this[_0x4e91('0x1')]=Number(_0x557cc1[_0x4e91('0x45')]);}if(_0x557cc1[_0x4e91('0x46')]){this[_0x4e91('0x5')]=Number(_0x557cc1[_0x4e91('0x46')]);}}for(var _0xd653f8=0x0;_0xd653f8<_0x53801e[_0x4e91('0x47')];_0xd653f8++){var _0x3e6efe=_0x1ea0fa['SIP/'+_0x53801e[_0xd653f8][_0x4e91('0x11')]];if(_0x3e6efe&&_0x3e6efe[_0x4e91('0x48')]){this['loggedInDb']+=0x1;}if(_0x53801e[_0xd653f8][_0x4e91('0x49')]==='1'){this[_0x4e91('0x4')]+=0x1;}if(_0x53801e[_0xd653f8][_0x4e91('0x2')]==='1'&&!['2','7','8'][_0x4e91('0x4a')](_0x53801e[_0xd653f8]['status'])){this['paused']+=0x1;}switch(_0x53801e[_0xd653f8]['status']){case'0':this[_0x4e91('0x1e')]+=0x1;break;case'1':this[_0x4e91('0x18')]+=0x1;break;case'2':this[_0x4e91('0x15')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x4e91('0x16')]+=0x1;break;case'5':this[_0x4e91('0x1d')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0x4e91('0x17')]+=0x1;break;}}if(this[_0x4e91('0x22')]===_0x4e91('0x4b')){var _0x482681=Object[_0x4e91('0x4c')](_0x227af4);for(var _0x2c401d=0x0;_0x2c401d<_0x482681[_0x4e91('0x47')];_0x2c401d++){var _0x10e9de=_0x482681[_0x2c401d];var _0xdae951=_0x227af4[_0x10e9de];if(_0xdae951['queue']===this[_0x4e91('0x11')]&&_0xdae951[_0x4e91('0x1c')]===_0x4e91('0x4d')&&_0xdae951['exten']==='xcally-motion-preview'){this['talking']+=0x1;}}if(this[_0x4e91('0x4')]>this['inUse']){this[_0x4e91('0x4')]=this[_0x4e91('0x15')];}this[_0x4e91('0xe')]=0x0;}return this;};VoiceQueueSummary[_0x4e91('0x44')][_0x4e91('0x4e')]=function(_0x3b37e0){var _0x2fb077=![];if(_0x3b37e0){_0x2fb077=INBOUND_COUNTERS[_0x4e91('0x4f')](function(_0x30dba2){return this[_0x30dba2]!==_0x3b37e0[_0x30dba2];},this);}return _0x2fb077;};VoiceQueueSummary[_0x4e91('0x44')][_0x4e91('0x50')]=function(_0x37635b){var _0x249dba=![];var _0x2ad7e4=![];var _0x38d81b=![];if(_0x37635b){_0x249dba=this['dialMethod']!==_0x37635b[_0x4e91('0x22')]||this[_0x4e91('0x21')]!==_0x37635b[_0x4e91('0x21')]||this[_0x4e91('0x40')]!==_0x37635b[_0x4e91('0x40')]||this[_0x4e91('0x41')]!==_0x37635b[_0x4e91('0x41')];_0x2ad7e4=OUTBOUND_COUNTERS[_0x4e91('0x4f')](function(_0x4465f5){return this[_0x4465f5]!==_0x37635b[_0x4465f5];},this);if(this['Trunk']&&_0x37635b[_0x4e91('0x42')]){_0x38d81b=this[_0x4e91('0x42')][_0x4e91('0x11')]!==_0x37635b[_0x4e91('0x42')]['name']||this[_0x4e91('0x42')]['active']!==_0x37635b[_0x4e91('0x42')][_0x4e91('0x51')];}}return _0x249dba||_0x2ad7e4||_0x38d81b;};VoiceQueueSummary['prototype'][_0x4e91('0x52')]=function(_0x5f5d2e){this[_0x4e91('0x6')]=_0x5f5d2e[_0x4e91('0x6')];this['message']=_0x5f5d2e[_0x4e91('0x40')];this[_0x4e91('0x41')]=_0x5f5d2e[_0x4e91('0x41')];this[_0x4e91('0x39')]=_0x5f5d2e['originated'];this[_0x4e91('0x8')]=_0x5f5d2e['outboundAbandonedCallsDay'];this[_0x4e91('0x9')]=_0x5f5d2e[_0x4e91('0x9')];this[_0x4e91('0xa')]=_0x5f5d2e[_0x4e91('0xa')];this[_0x4e91('0xb')]=_0x5f5d2e['outboundBusyCallsDay'];this['outboundCongestionCallsDay']=_0x5f5d2e[_0x4e91('0x28')];this[_0x4e91('0x2b')]=_0x5f5d2e[_0x4e91('0x2b')];this[_0x4e91('0xc')]=_0x5f5d2e[_0x4e91('0xc')];this['outboundReCallsDay']=_0x5f5d2e[_0x4e91('0x2d')];this[_0x4e91('0x53')]=_0x5f5d2e['outboundRejectCallsDay'];this[_0x4e91('0xd')]=_0x5f5d2e[_0x4e91('0xd')];this[_0x4e91('0x1a')]=_0x5f5d2e[_0x4e91('0x1a')];this['sumDuration']=_0x5f5d2e[_0x4e91('0xf')];this[_0x4e91('0x10')]=_0x5f5d2e[_0x4e91('0x10')];if(this['dialMethod']==='preview'){this[_0x4e91('0xe')]=_0x5f5d2e[_0x4e91('0xe')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 2935e5f..7af32b5 100644 --- a/server/services/ami/model/vtigerAccount.js +++ b/server/services/ami/model/vtigerAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa86=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x4d24c3,_0x369b16){var _0x1ff57a=function(_0xc85e0b){while(--_0xc85e0b){_0x4d24c3['push'](_0x4d24c3['shift']());}};_0x1ff57a(++_0x369b16);}(_0xfa86,0x1d3));var _0x6fa8=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0xfa86[_0x3203a1];return _0x24215e;};'use strict';function VtigerAccount(_0x5d090e){this['id']=_0x5d090e['id']||0x0;this[_0x6fa8('0x0')]=_0x5d090e[_0x6fa8('0x0')]||'';this[_0x6fa8('0x1')]=_0x5d090e['username']||'';this[_0x6fa8('0x2')]=_0x5d090e['accessKey']||'';this[_0x6fa8('0x3')]=_0x5d090e['remoteUri']||'';this[_0x6fa8('0x4')]=_0x5d090e[_0x6fa8('0x4')]||'';this[_0x6fa8('0x5')]=_0x5d090e['Configurations']||{};}module[_0x6fa8('0x6')]=VtigerAccount; \ No newline at end of file +var _0x4d49=['exports','username','accessKey','serverUrl','Configurations'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0x4d49,0x137));var _0x94d4=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4d49[_0x1facfa];return _0x9ec701;};'use strict';function VtigerAccount(_0x2cd164){this['id']=_0x2cd164['id']||0x0;this['name']=_0x2cd164['name']||'';this[_0x94d4('0x0')]=_0x2cd164[_0x94d4('0x0')]||'';this[_0x94d4('0x1')]=_0x2cd164[_0x94d4('0x1')]||'';this['remoteUri']=_0x2cd164['remoteUri']||'';this[_0x94d4('0x2')]=_0x2cd164[_0x94d4('0x2')]||'';this[_0x94d4('0x3')]=_0x2cd164[_0x94d4('0x3')]||{};}module[_0x94d4('0x4')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 6c60b5e..908d66c 100644 --- a/server/services/ami/model/zendeskAccount.js +++ b/server/services/ami/model/zendeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd70d=['type','integrationTab','serverUrl','Configurations','exports','username','password','token','remoteUri','authType'];(function(_0x14598c,_0x43c6c8){var _0x5adab4=function(_0x3d07b5){while(--_0x3d07b5){_0x14598c['push'](_0x14598c['shift']());}};_0x5adab4(++_0x43c6c8);}(_0xd70d,0xb9));var _0xdd70=function(_0x1b5c7f,_0x454f9d){_0x1b5c7f=_0x1b5c7f-0x0;var _0x1d7d59=_0xd70d[_0x1b5c7f];return _0x1d7d59;};'use strict';function ZendeskAccount(_0x110488){this['id']=_0x110488['id']||0x0;this['name']=_0x110488['name']||'';this[_0xdd70('0x0')]=_0x110488[_0xdd70('0x0')]||'';this[_0xdd70('0x1')]=_0x110488['password']||'';this[_0xdd70('0x2')]=_0x110488['token']||'';this['remoteUri']=_0x110488[_0xdd70('0x3')]||'';this[_0xdd70('0x4')]=_0x110488['authType']||'';this[_0xdd70('0x5')]=_0x110488[_0xdd70('0x5')]||_0xdd70('0x6');this[_0xdd70('0x7')]=_0x110488[_0xdd70('0x7')]||'';this[_0xdd70('0x8')]=_0x110488['Configurations']||{};}module[_0xdd70('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x4597=['remoteUri','authType','type','serverUrl','Configurations','exports','name','username','password'];(function(_0x3361ae,_0x4cc734){var _0xf445fc=function(_0x271b0c){while(--_0x271b0c){_0x3361ae['push'](_0x3361ae['shift']());}};_0xf445fc(++_0x4cc734);}(_0x4597,0x7b));var _0x7459=function(_0x385b7b,_0x33e9d0){_0x385b7b=_0x385b7b-0x0;var _0x704997=_0x4597[_0x385b7b];return _0x704997;};'use strict';function ZendeskAccount(_0x26c3c2){this['id']=_0x26c3c2['id']||0x0;this[_0x7459('0x0')]=_0x26c3c2[_0x7459('0x0')]||'';this[_0x7459('0x1')]=_0x26c3c2['username']||'';this['password']=_0x26c3c2[_0x7459('0x2')]||'';this['token']=_0x26c3c2['token']||'';this['remoteUri']=_0x26c3c2[_0x7459('0x3')]||'';this[_0x7459('0x4')]=_0x26c3c2[_0x7459('0x4')]||'';this[_0x7459('0x5')]=_0x26c3c2['type']||'integrationTab';this['serverUrl']=_0x26c3c2[_0x7459('0x6')]||'';this['Configurations']=_0x26c3c2[_0x7459('0x7')]||{};}module[_0x7459('0x8')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 4f0cd83..826d6c3 100644 --- a/server/services/ami/model/zohoAccount.js +++ b/server/services/ami/model/zohoAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce9a=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x3756dc,_0x25b919){var _0x2a35bb=function(_0x56e416){while(--_0x56e416){_0x3756dc['push'](_0x3756dc['shift']());}};_0x2a35bb(++_0x25b919);}(_0xce9a,0xd1));var _0xace9=function(_0x4fbd3d,_0x5ccc08){_0x4fbd3d=_0x4fbd3d-0x0;var _0x17d8ea=_0xce9a[_0x4fbd3d];return _0x17d8ea;};'use strict';function ZohoAccount(_0x2d7cba){this['id']=_0x2d7cba['id']||0x0;this[_0xace9('0x0')]=_0x2d7cba[_0xace9('0x0')]||'';this[_0xace9('0x1')]=_0x2d7cba[_0xace9('0x1')]||'';this['host']=_0x2d7cba[_0xace9('0x2')]||'';this['zone']=_0x2d7cba[_0xace9('0x3')]||'';this['clientId']=_0x2d7cba[_0xace9('0x4')]||'';this['clientSecret']=_0x2d7cba[_0xace9('0x5')]||'';this[_0xace9('0x6')]=_0x2d7cba[_0xace9('0x6')]||'';this[_0xace9('0x7')]=_0x2d7cba[_0xace9('0x7')]||'';this[_0xace9('0x8')]=_0x2d7cba[_0xace9('0x8')]||'';this[_0xace9('0x9')]=_0x2d7cba[_0xace9('0x9')]||{};}module[_0xace9('0xa')]=ZohoAccount; \ No newline at end of file +var _0xb041=['refreshToken','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x3df9dd,_0x26f5cd){var _0x4f11e4=function(_0x1993fe){while(--_0x1993fe){_0x3df9dd['push'](_0x3df9dd['shift']());}};_0x4f11e4(++_0x26f5cd);}(_0xb041,0x142));var _0x1b04=function(_0x4cb6dd,_0x58a188){_0x4cb6dd=_0x4cb6dd-0x0;var _0x5baced=_0xb041[_0x4cb6dd];return _0x5baced;};'use strict';function ZohoAccount(_0x33e1fe){this['id']=_0x33e1fe['id']||0x0;this[_0x1b04('0x0')]=_0x33e1fe[_0x1b04('0x0')]||'';this['description']=_0x33e1fe[_0x1b04('0x1')]||'';this[_0x1b04('0x2')]=_0x33e1fe[_0x1b04('0x2')]||'';this[_0x1b04('0x3')]=_0x33e1fe[_0x1b04('0x3')]||'';this[_0x1b04('0x4')]=_0x33e1fe[_0x1b04('0x4')]||'';this[_0x1b04('0x5')]=_0x33e1fe[_0x1b04('0x5')]||'';this[_0x1b04('0x6')]=_0x33e1fe[_0x1b04('0x6')]||'';this[_0x1b04('0x7')]=_0x33e1fe[_0x1b04('0x7')]||'';this['refreshToken']=_0x33e1fe[_0x1b04('0x8')]||'';this['Configurations']=_0x33e1fe['Configurations']||{};}module[_0x1b04('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index a02f4ce..b51ccf7 100644 --- a/server/services/ami/preview/action.js +++ b/server/services/ami/preview/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3423=['Agent','membername','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','prototype','getCaller','format','calleridname','number','exports','moment','isNil','string','uniqueid','idContact','queue','name','type'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x3342('0x0'));function checkNameSurname(_0x16bdb3,_0x3477de,_0x3b763d){var _0x21bdc2='';if(!_[_0x3342('0x1')](_0x3477de)&&_0x3342('0x2')===typeof _0x3477de){_0x21bdc2+=_0x3477de;}if(!_[_0x3342('0x1')](_0x3b763d)&&_0x3342('0x2')===typeof _0x3b763d){_0x21bdc2+='\x20'+_0x3b763d;}if(_0x21bdc2!==''){return _0x21bdc2;}return _0x16bdb3;}function Action(_0x19206f,_0x467453,_0x2ccbe0,_0x29c40c,_0x420d4b){this[_0x3342('0x3')]=_0x2ccbe0||undefined;this[_0x3342('0x4')]=_0x19206f['id'];this[_0x3342('0x5')]=_0x467453[_0x3342('0x6')];this[_0x3342('0x7')]=_0x467453['type'];this['campaigntype']=_0x3342('0x5');this['dialAnswer']=![];this['membername']=_['isNil'](_0x19206f['Agent'])?undefined:_0x19206f[_0x3342('0x8')][_0x3342('0x6')];this['channelAgent']=this[_0x3342('0x9')]?util['format'](_0x3342('0xa'),this[_0x3342('0x9')]):_0x29c40c||undefined;this['calleridname']=checkNameSurname(_0x19206f[_0x3342('0xb')][_0x3342('0xc')],_0x19206f[_0x3342('0xb')][_0x3342('0xd')],_0x19206f[_0x3342('0xb')][_0x3342('0xe')]);this[_0x3342('0xf')]=_0x19206f['active']||![];this[_0x3342('0x10')]=_0x19206f[_0x3342('0xc')];this['scheduledat']=_0x19206f[_0x3342('0x11')];this[_0x3342('0x12')]=_0x19206f['countbusyretry']||0x0;this['countcongestionretry']=_0x19206f[_0x3342('0x13')]||0x0;this[_0x3342('0x14')]=_0x19206f[_0x3342('0x14')]||0x0;this[_0x3342('0x15')]=(_0x19206f[_0x3342('0x12')]||0x0)+(_0x19206f[_0x3342('0x13')]||0x0)+(_0x19206f[_0x3342('0x14')]||0x0)+(_0x19206f[_0x3342('0x16')]||0x0)+(_0x19206f[_0x3342('0x17')]||0x0)+(_0x19206f['countabandonedretry']||0x0)+(_0x19206f[_0x3342('0x18')]||0x0)+(_0x19206f[_0x3342('0x19')]||0x0);this[_0x3342('0x16')]=_0x19206f['countnosuchnumberretry']||0x0;this[_0x3342('0x17')]=_0x19206f[_0x3342('0x17')]||0x0;this['countabandonedretry']=_0x19206f[_0x3342('0x1a')]||0x0;this[_0x3342('0x18')]=_0x19206f['countmachineretry']||0x0;this[_0x3342('0x19')]=_0x19206f['countagentrejectretry']||0x0;this[_0x3342('0x1b')]=_0x19206f[_0x3342('0x1b')];this[_0x3342('0x1c')]=_0x19206f[_0x3342('0x1c')];this[_0x3342('0x1d')]=_0x19206f[_0x3342('0x1d')];this[_0x3342('0x1e')]=_0x19206f[_0x3342('0x1e')];this['ContactId']=_0x19206f[_0x3342('0x1f')];this['ListId']=_0x19206f['ListId'];this[_0x3342('0x20')]=_['isNil'](_0x19206f['Agent'])?_0x19206f[_0x3342('0x20')]:_0x19206f['Agent']['id'];this[_0x3342('0x21')]=_0x19206f['VoiceQueueId'];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x3342('0x22')][_0x3342('0x23')]=function(){return util[_0x3342('0x24')]('\x22%s\x22\x20<%s>',this[_0x3342('0x25')],this[_0x3342('0x26')]);};module[_0x3342('0x27')]=Action; \ No newline at end of file +var _0xe511=['name','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','number','util','lodash','string','isNil','idContact','queue','type','campaigntype','dialAnswer','membername','Agent'];(function(_0x47a111,_0x167e06){var _0x32d643=function(_0x1e4b7a){while(--_0x1e4b7a){_0x47a111['push'](_0x47a111['shift']());}};_0x32d643(++_0x167e06);}(_0xe511,0x16f));var _0x1e51=function(_0x76289d,_0x49a654){_0x76289d=_0x76289d-0x0;var _0x2968d4=_0xe511[_0x76289d];return _0x2968d4;};'use strict';var util=require(_0x1e51('0x0'));var _=require(_0x1e51('0x1'));var moment=require('moment');function checkNameSurname(_0x2a5905,_0x5b9e45,_0x253e96){var _0xb75a96='';if(!_['isNil'](_0x5b9e45)&&_0x1e51('0x2')===typeof _0x5b9e45){_0xb75a96+=_0x5b9e45;}if(!_[_0x1e51('0x3')](_0x253e96)&&_0x1e51('0x2')===typeof _0x253e96){_0xb75a96+='\x20'+_0x253e96;}if(_0xb75a96!==''){return _0xb75a96;}return _0x2a5905;}function Action(_0x16ec99,_0x480cca,_0x26b22c,_0x21ed6b,_0x5c4590){this['uniqueid']=_0x26b22c||undefined;this[_0x1e51('0x4')]=_0x16ec99['id'];this[_0x1e51('0x5')]=_0x480cca['name'];this['type']=_0x480cca[_0x1e51('0x6')];this[_0x1e51('0x7')]=_0x1e51('0x5');this[_0x1e51('0x8')]=![];this[_0x1e51('0x9')]=_[_0x1e51('0x3')](_0x16ec99['Agent'])?undefined:_0x16ec99[_0x1e51('0xa')][_0x1e51('0xb')];this[_0x1e51('0xc')]=this[_0x1e51('0x9')]?util[_0x1e51('0xd')](_0x1e51('0xe'),this['membername']):_0x21ed6b||undefined;this[_0x1e51('0xf')]=checkNameSurname(_0x16ec99[_0x1e51('0x10')][_0x1e51('0x11')],_0x16ec99[_0x1e51('0x10')][_0x1e51('0x12')],_0x16ec99[_0x1e51('0x10')][_0x1e51('0x13')]);this[_0x1e51('0x14')]=_0x16ec99[_0x1e51('0x14')]||![];this[_0x1e51('0x15')]=_0x16ec99['phone'];this[_0x1e51('0x16')]=_0x16ec99[_0x1e51('0x16')];this[_0x1e51('0x17')]=_0x16ec99['countbusyretry']||0x0;this[_0x1e51('0x18')]=_0x16ec99['countcongestionretry']||0x0;this['countnoanswerretry']=_0x16ec99[_0x1e51('0x19')]||0x0;this[_0x1e51('0x1a')]=(_0x16ec99[_0x1e51('0x17')]||0x0)+(_0x16ec99[_0x1e51('0x18')]||0x0)+(_0x16ec99[_0x1e51('0x19')]||0x0)+(_0x16ec99[_0x1e51('0x1b')]||0x0)+(_0x16ec99['countdropretry']||0x0)+(_0x16ec99[_0x1e51('0x1c')]||0x0)+(_0x16ec99['countmachineretry']||0x0)+(_0x16ec99[_0x1e51('0x1d')]||0x0);this[_0x1e51('0x1b')]=_0x16ec99[_0x1e51('0x1b')]||0x0;this[_0x1e51('0x1e')]=_0x16ec99['countdropretry']||0x0;this['countabandonedretry']=_0x16ec99['countabandonedretry']||0x0;this['countmachineretry']=_0x16ec99[_0x1e51('0x1f')]||0x0;this['countagentrejectretry']=_0x16ec99[_0x1e51('0x1d')]||0x0;this[_0x1e51('0x20')]=_0x16ec99[_0x1e51('0x20')];this[_0x1e51('0x21')]=_0x16ec99[_0x1e51('0x21')];this[_0x1e51('0x22')]=_0x16ec99[_0x1e51('0x22')];this[_0x1e51('0x23')]=_0x16ec99['recallme'];this['ContactId']=_0x16ec99[_0x1e51('0x24')];this[_0x1e51('0x25')]=_0x16ec99[_0x1e51('0x25')];this[_0x1e51('0x26')]=_['isNil'](_0x16ec99['Agent'])?_0x16ec99['UserId']:_0x16ec99[_0x1e51('0xa')]['id'];this[_0x1e51('0x27')]=_0x16ec99[_0x1e51('0x27')];this['originatecalleridnum']='';this[_0x1e51('0x28')]='';}Action['prototype']['getCaller']=function(){return util[_0x1e51('0xd')]('\x22%s\x22\x20<%s>',this[_0x1e51('0xf')],this[_0x1e51('0x29')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index ec7ba4e..16ffc9e 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x27a871,_0x4ab414){var _0x5eb525=function(_0x3ead2d){while(--_0x3ead2d){_0x27a871['push'](_0x27a871['shift']());}};_0x5eb525(++_0x4ab414);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x3dc7f5,_0xc082af){var _0x5906c5=function(_0x32994e){while(--_0x32994e){_0x3dc7f5['push'](_0x3dc7f5['shift']());}};_0x5906c5(++_0xc082af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 437f199..dade053 100644 --- a/server/services/ami/preview/rpcDb.js +++ b/server/services/ami/preview/rpcDb.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c1f=['../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect','createHistory','[createHistory]\x20','resolve','moveContactManagedDialer','catch','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','then','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger'];(function(_0x2dcd51,_0x366aef){var _0x1c8e93=function(_0x145938){while(--_0x145938){_0x2dcd51['push'](_0x2dcd51['shift']());}};_0x1c8e93(++_0x366aef);}(_0x1c1f,0x10b));var _0xf1c1=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x1c1f[_0x5608a3];return _0x1ed50a;};'use strict';var util=require(_0xf1c1('0x0'));var BPromise=require(_0xf1c1('0x1'));var logger=require(_0xf1c1('0x2'))('preview');var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xf1c1('0x3'));var cmHopperBlack=require(_0xf1c1('0x4'));var agentReportPreview=require(_0xf1c1('0x5'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x1152cd){return function(_0xe35ae){logger[_0xf1c1('0x6')](_0x1152cd,util[_0xf1c1('0x7')](_0xe35ae,{'showHidden':![],'depth':null}));};}function create(_0x3850c8){return cmHopperHistory[_0xf1c1('0x8')](_0x3850c8)['catch'](loggerCatch(_0xf1c1('0x9')));}function createAgent(_0x476ff6){return BPromise[_0xf1c1('0xa')]()['then'](agentReportPreview['createHistory'](_0x476ff6))['catch'](loggerCatch(_0xf1c1('0x9')));}function moveContact(_0x2045da){return cmHopper[_0xf1c1('0xb')](_0x2045da,!![])[_0xf1c1('0xc')](loggerCatch(_0xf1c1('0xd')));}exports[_0xf1c1('0xe')]=function(_0x1ed099){return cmHopperBlack[_0xf1c1('0xe')](_0x1ed099)[_0xf1c1('0xc')](loggerCatch(_0xf1c1('0xf')));};exports[_0xf1c1('0x10')]=function(_0xe5370e){return BPromise[_0xf1c1('0xa')]()[_0xf1c1('0x11')](cmHopper[_0xf1c1('0x10')](_0xe5370e))[_0xf1c1('0xc')](loggerCatch(_0xf1c1('0x12')));};exports[_0xf1c1('0x8')]=function(_0x10a589,_0x1a47a3){create(_0x10a589)['catch'](loggerCatch(_0x1a47a3));moveContact(_0x10a589)[_0xf1c1('0xc')](loggerCatch(_0x1a47a3));};exports[_0xf1c1('0x13')]=function(_0x2fefe4,_0xdb6bf1){createAgent(_0x2fefe4)[_0xf1c1('0xc')](loggerCatch(_0xdb6bf1));};exports[_0xf1c1('0x14')]=function(_0x27f0b9,_0x3c921a){create(_0x27f0b9)[_0xf1c1('0xc')](loggerCatch(_0x3c921a));};exports[_0xf1c1('0x15')]=function(_0x368d3e,_0x3e58af){moveContact(_0x368d3e)['catch'](loggerCatch(_0x3e58af));};exports[_0xf1c1('0x16')]=function(_0x35fff9,_0x5f1dbf,_0x59a565){if(_0x5f1dbf){_0x35fff9[_0xf1c1('0x17')]=null;}if(_0x59a565){_0x35fff9['active']=![];}return cmHopper[_0xf1c1('0x16')](_0x35fff9)['catch'](loggerCatch(_0xf1c1('0x18')));};exports['countReScheduled']=function(_0x1815d3){return cmHopper[_0xf1c1('0x19')](_0x1815d3)[_0xf1c1('0xc')](loggerCatch(_0xf1c1('0x1a')));};exports['unlockContact']=function(_0x337aea){return cmHopper['unlockContact']({'UserId':null},_0x337aea,0x1)[_0xf1c1('0xc')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x58a589){return cmHopper[_0xf1c1('0x1b')]({'active':![]},_0x58a589,0x1)['catch'](loggerCatch(_0xf1c1('0x1c')));};exports[_0xf1c1('0x1d')]=function(_0x572ed1){var _0x1e9cf2={};_0x1e9cf2[_0xf1c1('0x1e')]=_0x572ed1[_0xf1c1('0x1e')];_0x1e9cf2['uniqueid']=_0x572ed1['uniqueid'];_0x1e9cf2[_0xf1c1('0x1f')]=_0x572ed1[_0xf1c1('0x1f')];_0x1e9cf2['calleridname']=_0x572ed1[_0xf1c1('0x20')];_0x1e9cf2['queue']=_0x572ed1[_0xf1c1('0x21')];_0x1e9cf2['queuecallerjoinAt']=_0x572ed1[_0xf1c1('0x22')];_0x1e9cf2[_0xf1c1('0x23')]=_0x572ed1[_0xf1c1('0x22')];_0x1e9cf2[_0xf1c1('0x24')]=0x1;_0x1e9cf2[_0xf1c1('0x25')]=_0x572ed1[_0xf1c1('0x26')];_0x1e9cf2['connectedlinename']=_0x572ed1[_0xf1c1('0x27')];_0x1e9cf2[_0xf1c1('0x28')]=_0xf1c1('0x29');_0x1e9cf2[_0xf1c1('0x2a')]=_0xf1c1('0x2b');_0x1e9cf2[_0xf1c1('0x2c')]=0x0;_0x1e9cf2[_0xf1c1('0x2d')]=0x1;_0x1e9cf2[_0xf1c1('0x2e')]=_0x572ed1[_0xf1c1('0x27')];_0x1e9cf2[_0xf1c1('0x2f')]=_0xf1c1('0x30');return BPromise['resolve']()[_0xf1c1('0x11')](voiceQueueReport[_0xf1c1('0x31')](_0x1e9cf2))[_0xf1c1('0xc')](loggerCatch(_0xf1c1('0x32')));};exports[_0xf1c1('0x33')]=function(_0x16bf33,_0x4b4d4f){return BPromise[_0xf1c1('0xa')]()[_0xf1c1('0x11')](cmHopper[_0xf1c1('0x33')](_0x16bf33,_0x4b4d4f))[_0xf1c1('0xc')](loggerCatch(_0xf1c1('0x34')));};exports['rescheduleContactInQueue']=function(_0x27e573){return cmHopper['rescheduleContact'](_0x27e573,!![],!![])[_0xf1c1('0xc')](loggerCatch(_0xf1c1('0x35')));}; \ No newline at end of file +var _0x2b3d=['queuecallercompleteAt','endtime','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','[createHistory]\x20','resolve','then','catch','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete'];(function(_0x26efac,_0x21ab8a){var _0x8482e4=function(_0x14db32){while(--_0x14db32){_0x26efac['push'](_0x26efac['shift']());}};_0x8482e4(++_0x21ab8a);}(_0x2b3d,0x124));var _0xd2b3=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2b3d[_0x42cae2];return _0x5f256f;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0xd2b3('0x0'))(_0xd2b3('0x1'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xd2b3('0x2'));var cmHopperBlack=require(_0xd2b3('0x3'));var agentReportPreview=require(_0xd2b3('0x4'));var voiceQueueReport=require(_0xd2b3('0x5'));function loggerCatch(_0x1894cb){return function(_0x2ecd03){logger[_0xd2b3('0x6')](_0x1894cb,util[_0xd2b3('0x7')](_0x2ecd03,{'showHidden':![],'depth':null}));};}function create(_0x484da4){return cmHopperHistory[_0xd2b3('0x8')](_0x484da4)['catch'](loggerCatch(_0xd2b3('0x9')));}function createAgent(_0x1c638b){return BPromise[_0xd2b3('0xa')]()[_0xd2b3('0xb')](agentReportPreview[_0xd2b3('0x8')](_0x1c638b))[_0xd2b3('0xc')](loggerCatch(_0xd2b3('0x9')));}function moveContact(_0x49f4d5){return cmHopper['moveContactManagedDialer'](_0x49f4d5,!![])[_0xd2b3('0xc')](loggerCatch(_0xd2b3('0xd')));}exports[_0xd2b3('0xe')]=function(_0x165738){return cmHopperBlack['checkIsBlackList'](_0x165738)[_0xd2b3('0xc')](loggerCatch(_0xd2b3('0xf')));};exports[_0xd2b3('0x10')]=function(_0x3894f3){return BPromise[_0xd2b3('0xa')]()[_0xd2b3('0xb')](cmHopper[_0xd2b3('0x10')](_0x3894f3))[_0xd2b3('0xc')](loggerCatch(_0xd2b3('0x11')));};exports[_0xd2b3('0x8')]=function(_0x3215dd,_0x2d4d83){create(_0x3215dd)[_0xd2b3('0xc')](loggerCatch(_0x2d4d83));moveContact(_0x3215dd)[_0xd2b3('0xc')](loggerCatch(_0x2d4d83));};exports[_0xd2b3('0x12')]=function(_0x49e36f,_0x2ff3a9){createAgent(_0x49e36f)[_0xd2b3('0xc')](loggerCatch(_0x2ff3a9));};exports['createCustomerHistory']=function(_0x4b7311,_0x3f203a){create(_0x4b7311)['catch'](loggerCatch(_0x3f203a));};exports[_0xd2b3('0x13')]=function(_0x519f61,_0x23fbdd){moveContact(_0x519f61)[_0xd2b3('0xc')](loggerCatch(_0x23fbdd));};exports[_0xd2b3('0x14')]=function(_0x3d5144,_0x11c362,_0x169f14){if(_0x11c362){_0x3d5144[_0xd2b3('0x15')]=null;}if(_0x169f14){_0x3d5144[_0xd2b3('0x16')]=![];}return cmHopper[_0xd2b3('0x14')](_0x3d5144)[_0xd2b3('0xc')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xd2b3('0x17')]=function(_0x5a549b){return cmHopper[_0xd2b3('0x17')](_0x5a549b)['catch'](loggerCatch(_0xd2b3('0x18')));};exports[_0xd2b3('0x19')]=function(_0xc5dc39){return cmHopper[_0xd2b3('0x19')]({'UserId':null},_0xc5dc39,0x1)['catch'](loggerCatch('[unlockContact]\x20'));};exports[_0xd2b3('0x1a')]=function(_0x37b0e5){return cmHopper['unlockContact']({'active':![]},_0x37b0e5,0x1)[_0xd2b3('0xc')](loggerCatch(_0xd2b3('0x1b')));};exports[_0xd2b3('0x1c')]=function(_0x575a63){var _0x2dc637={};_0x2dc637[_0xd2b3('0x1d')]=_0x575a63[_0xd2b3('0x1d')];_0x2dc637[_0xd2b3('0x1e')]=_0x575a63['uniqueid'];_0x2dc637[_0xd2b3('0x1f')]=_0x575a63[_0xd2b3('0x1f')];_0x2dc637[_0xd2b3('0x20')]=_0x575a63[_0xd2b3('0x20')];_0x2dc637[_0xd2b3('0x21')]=_0x575a63[_0xd2b3('0x21')];_0x2dc637[_0xd2b3('0x22')]=_0x575a63['answertime'];_0x2dc637[_0xd2b3('0x23')]=_0x575a63[_0xd2b3('0x24')];_0x2dc637[_0xd2b3('0x25')]=0x1;_0x2dc637[_0xd2b3('0x26')]=_0x575a63[_0xd2b3('0x27')];_0x2dc637[_0xd2b3('0x28')]=_0x575a63[_0xd2b3('0x29')];_0x2dc637[_0xd2b3('0x2a')]='from-sip';_0x2dc637[_0xd2b3('0x2b')]=_0xd2b3('0x2c');_0x2dc637[_0xd2b3('0x2d')]=0x0;_0x2dc637[_0xd2b3('0x2e')]=0x1;_0x2dc637[_0xd2b3('0x2f')]=_0x575a63['membername'];_0x2dc637[_0xd2b3('0x30')]=_0xd2b3('0x31');return BPromise[_0xd2b3('0xa')]()['then'](voiceQueueReport[_0xd2b3('0x32')](_0x2dc637))[_0xd2b3('0xc')](loggerCatch(_0xd2b3('0x33')));};exports[_0xd2b3('0x34')]=function(_0x350853,_0x18cd54){return BPromise[_0xd2b3('0xa')]()[_0xd2b3('0xb')](cmHopper[_0xd2b3('0x34')](_0x350853,_0x18cd54))['catch'](loggerCatch(_0xd2b3('0x35')));};exports['rescheduleContactInQueue']=function(_0x3c4660){return cmHopper[_0xd2b3('0x14')](_0x3c4660,!![],!![])['catch'](loggerCatch(_0xd2b3('0x36')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 0b08f67..f67251f 100644 --- a/server/services/ami/preview/util/util.js +++ b/server/services/ami/preview/util/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4bd=['preview','127.0.0.1','error','inspect','info','logger2','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','monitor_format','dialPreviewUrl','dialQueueProject','NONE','dialQueueProject2','\x22agi://%s/square,%s\x22','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','logAgent','responsetime','ringtime','getSeconds','logLookAgent','membername','UserId','logCustomer','endtime','talktime','answertime','isFailure','Failure','RECALL','BOOKED','uniqueid','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','name','queue','interface','channelAgent','motionChannel','voice','buildObj','not_inuse','status','reachable','push','getDiff','milliseconds','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countglobal','callback','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','keys','variables','forEach','toLowerCase','util','lodash','../../../../config/logger'];(function(_0x354216,_0x187a9f){var _0x2bbac1=function(_0x47a62e){while(--_0x47a62e){_0x354216['push'](_0x354216['shift']());}};_0x2bbac1(++_0x187a9f);}(_0xe4bd,0x89));var _0xde4b=function(_0x57e1fb,_0x80bc3d){_0x57e1fb=_0x57e1fb-0x0;var _0x320c25=_0xe4bd[_0x57e1fb];return _0x320c25;};'use strict';var util=require(_0xde4b('0x0'));var _=require(_0xde4b('0x1'));var moment=require('moment');var logger=require(_0xde4b('0x2'))(_0xde4b('0x3'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0xde4b('0x4');var utils=require('../../dialer/utils');exports['loggerCatch']=function(_0x1cfb8f){return function(_0x5111bc){logger[_0xde4b('0x5')](_0x1cfb8f,util[_0xde4b('0x6')](_0x5111bc,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x39ac6e,_0x4043d4){logger[_0xde4b('0x7')](_0x39ac6e,util['inspect'](_0x4043d4,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x55d5e9,_0xeb89ae){logger['error'](_0x55d5e9,util['inspect'](_0xeb89ae,{'showHidden':![],'depth':null}));};exports[_0xde4b('0x8')]=function(_0x510036){return function(_0x295b47){logger[_0xde4b('0x7')](_0x510036,util[_0xde4b('0x6')](_0x295b47,{'showHidden':![],'depth':null}));};};exports[_0xde4b('0x9')]=function(_0x4f62ca,_0x83b330,_0x390a80){return{'message':_0x4f62ca,'unlock':_0x83b330,'active':_0x390a80};};exports[_0xde4b('0xa')]=function(_0x645911,_0x54939c,_0x349ea2){if(!_['isUndefined'](_0x349ea2)&&_0xde4b('0xb')===typeof _0x349ea2&&!_[_0xde4b('0xc')](_0x349ea2)){if(!_[_0xde4b('0xd')](_0x54939c)&&'string'===typeof _0x54939c&&!_[_0xde4b('0xc')](_0x54939c)){return util[_0xde4b('0xe')](_0xde4b('0xf'),_0x54939c,_0x349ea2);}return util[_0xde4b('0xe')](_0xde4b('0xf'),_0x349ea2,_0x349ea2);}if(!_['isUndefined'](_0x645911)&&_0xde4b('0xb')===typeof _0x645911&&!_['isEmpty'](_0x645911)){return _0x645911;}return _0xde4b('0x10');};exports[_0xde4b('0x11')]=function(_0x26921e){if(_[_0xde4b('0x12')](_0x26921e)){return![];}return _0x26921e;};exports[_0xde4b('0x13')]=function(_0x1da8f7,_0x18c1e5,_0x5604aa,_0x2da117,_0x125394,_0x56829c){var _0x42bd1c={'XMD-QUEUE':_0x18c1e5[_0xde4b('0x14')]?_0x18c1e5[_0xde4b('0x14')]['name']:'','XMD-CALLERID':_0x2da117,'XMD-CALLERID-PREVIEW':_0x56829c?util[_0xde4b('0xe')](_0xde4b('0xf'),_0x56829c[_0xde4b('0x15')],_0x56829c[_0xde4b('0x16')]):_0x2da117,'XMD-DIALID':_0x125394,'XMD-CONTACTID':_0x18c1e5[_0xde4b('0x17')],'XMD-CDRTYPE':_0xde4b('0x18'),'CALLERID(all)':_0x2da117,'XMD-VOICEQUEUEID':_0x18c1e5[_0xde4b('0x19')],'XMD-DIALCHANNEL':_0x5604aa,'XMD-DIALTIMEOUT':_0x1da8f7[_0xde4b('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0xde4b('0xe')]('\x22rtTxX%s%s\x22',_0x1da8f7['dialQueueProject2']?'g':'',_[_0xde4b('0xc')](_0x1da8f7[_0xde4b('0x1b')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x1da8f7[_0xde4b('0x1c')]||'','XMD-AGI':_0x1da8f7[_0xde4b('0x1d')]?util[_0xde4b('0xe')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1da8f7[_0xde4b('0x1d')]):_0xde4b('0x1e'),'XMD-AGIAFTER':_0x1da8f7[_0xde4b('0x1f')]?util['format'](_0xde4b('0x20'),ipAgi,_0x1da8f7[_0xde4b('0x1f')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x56829c?_0x56829c['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x56829c?_0x56829c[_0xde4b('0x21')]:'','XMD-DESTINATION':_0xde4b('0x22'),'SIPADDHEADER':_0xde4b('0x23')};if(!_[_0xde4b('0xc')](_0x1da8f7[_0xde4b('0x1b')])){_0x42bd1c[util[_0xde4b('0xe')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x1da8f7[_0xde4b('0x1b')];_0x42bd1c[util[_0xde4b('0xe')]('%s',_0xde4b('0x24'))]=_0x125394;}return _0x42bd1c;};exports[_0xde4b('0x25')]=function(_0x1407f0){var _0x60adfd={};for(var _0x4d03dd in _0x1407f0){if(_0x1407f0[_0xde4b('0x26')](_0x4d03dd)){_0x60adfd[util[_0xde4b('0xe')]('%s',_['toLower'](_0x4d03dd))]=_0x1407f0[_0x4d03dd];}}return{'variables':_0x60adfd};};exports[_0xde4b('0x27')]=function(_0x2093de,_0x140dae){if(!_[_0xde4b('0x12')](_0x2093de)){if(_0x2093de[_0xde4b('0x26')](_0xde4b('0x28'))){if(_0x2093de[_0xde4b('0x28')]>0x0){_0x2093de[_0xde4b('0x28')]-=0x1;}else{logger[_0xde4b('0x5')](_0xde4b('0x29'),_0x140dae);}}}else{logger[_0xde4b('0x5')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x140dae);}};exports[_0xde4b('0x2a')]=function(_0x4c4927){var _0x118613=moment()[_0xde4b('0xe')](_0xde4b('0x2b'));_0x4c4927[_0xde4b('0x2c')]=0xd;_0x4c4927[_0xde4b('0x2d')]=_0xde4b('0x2e');_0x4c4927[_0xde4b('0x2f')]=_0x118613;_0x4c4927['responsetime']=_0x118613;_0x4c4927['endtime']=_0x118613;};exports[_0xde4b('0x30')]=function(_0x549311,_0x3c8c6b,_0x41d01b){var _0x26beb6=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x549311[_0xde4b('0x2c')]=_0x3c8c6b;_0x549311['statedesc']=_0x41d01b;_0x549311[_0xde4b('0x31')]=_0x26beb6;_0x549311[_0xde4b('0x32')]=utils[_0xde4b('0x33')](_0x549311[_0xde4b('0x31')],_0x549311[_0xde4b('0x2f')]);};exports[_0xde4b('0x34')]=function(_0x20c796,_0xd682f2,_0x5a8a42){_0x20c796[_0xde4b('0x35')]=_0xd682f2;_0x20c796[_0xde4b('0x36')]=_0x5a8a42;};exports[_0xde4b('0x37')]=function(_0x4bcab5,_0x1406bb,_0x163a4d){var _0x39edaf=moment()['format'](_0xde4b('0x2b'));_0x4bcab5[_0xde4b('0x2c')]=_0x1406bb;_0x4bcab5[_0xde4b('0x2d')]=_0x163a4d;_0x4bcab5['responsetime']=_0x4bcab5[_0xde4b('0x31')]?_0x4bcab5['responsetime']:_0x39edaf;_0x4bcab5[_0xde4b('0x38')]=_0x4bcab5['endtime']?_0x4bcab5[_0xde4b('0x38')]:_0x39edaf;_0x4bcab5['ringtime']=utils[_0xde4b('0x33')](_0x4bcab5[_0xde4b('0x31')]||0x0,_0x4bcab5[_0xde4b('0x2f')]||0x0);_0x4bcab5[_0xde4b('0x39')]=_0x4bcab5[_0xde4b('0x3a')]?utils[_0xde4b('0x33')](_0x4bcab5[_0xde4b('0x38')],_0x4bcab5['answertime']):0x0;};exports[_0xde4b('0x3b')]=function(_0x5d769f){return _0x5d769f===_0xde4b('0x3c');};exports['variablesAction']=function(_0x35f348,_0x2a9fda,_0x3fb83c,_0x273f01,_0x367dc3){var _0x26a1af=_0x273f01?_0xde4b('0x3d'):_0x35f348[_0xde4b('0x15')];_0x26a1af=_0x367dc3?_0xde4b('0x3e'):_0x26a1af;return{'actionid':_0x35f348[_0xde4b('0x3f')],'action':'originate','channel':_0x35f348['channelAgent'],'callerid':util[_0xde4b('0xe')](_0xde4b('0xf'),_0x26a1af,_0x35f348[_0xde4b('0x16')]),'Exten':_0xde4b('0x22'),'Context':'from-sip','Priority':'1','variable':_0x3fb83c,'timeout':(_0x2a9fda[_0xde4b('0x40')]||0x1e)*0x3e8,'async':!![],'channelid':_0x35f348[_0xde4b('0x3f')]};};exports[_0xde4b('0x41')]=function(_0x4887ff){return _0x4887ff[_0xde4b('0x42')]+_0x4887ff[_0xde4b('0x43')]+_0x4887ff[_0xde4b('0x44')]+_0x4887ff[_0xde4b('0x45')]+_0x4887ff['countnosuchnumberretry'];};exports[_0xde4b('0x46')]=function(_0x5e211d){var _0x4ff6bf=_[_0xde4b('0x47')](_0x5e211d);_0x4ff6bf[_0xde4b('0x2c')]=0xf;_0x4ff6bf[_0xde4b('0x2d')]=_0xde4b('0x48');return _0x4ff6bf;};exports[_0xde4b('0x49')]=function(_0x129318,_0x47a440,_0x26bc38){var _0x5857d9={};_0x5857d9[_0x47a440]=_0x129318[_0x47a440];_0x5857d9[_0xde4b('0x4a')]=![];_0x5857d9[_0xde4b('0x4b')]=moment()[_0xde4b('0x4c')](_0x26bc38,_0xde4b('0x4d'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5857d9['ContactId']=_0x129318[_0xde4b('0x17')];_0x5857d9[_0xde4b('0x4e')]=_0x129318[_0xde4b('0x4e')];_0x5857d9[_0xde4b('0x19')]=_0x129318[_0xde4b('0x19')]||undefined;return _0x5857d9;};exports['decrementTalkink']=function(_0x297939,_0x3ed500){if(!_[_0xde4b('0x12')](_0x297939)){if(_0x297939[_0xde4b('0x4f')]>0x0){_0x297939[_0xde4b('0x4f')]-=0x1;}else{logger[_0xde4b('0x5')](_0x3ed500,_0xde4b('0x50'));}}else{logger[_0xde4b('0x5')](_0x3ed500,_0xde4b('0x51'));}};exports[_0xde4b('0x52')]=function(_0x3a5dfe){if(_0x3a5dfe<=0x0){return!![];}return![];};function buildObj(_0x26bfd2,_0x320a3f,_0x5f5694){_0x26bfd2[_0xde4b('0x53')]=_0x320a3f;_0x26bfd2[_0xde4b('0x54')]=_0x26bfd2[_0xde4b('0x55')];_0x26bfd2[_0xde4b('0x56')]=_0x26bfd2[_0xde4b('0x57')];_0x26bfd2[_0xde4b('0x58')]=_0xde4b('0x59');if(_0x5f5694){_0x26bfd2['mandatoryDisposition']=_0x5f5694['mandatoryDisposition'];}return _0x26bfd2;}exports[_0xde4b('0x5a')]=buildObj;exports['agentReadyId']=function(_0x515159){var _0x400f38=[];for(var _0x2bcf1d in _0x515159){if(_0x515159['hasOwnProperty'](_0x2bcf1d)){if(!_[_0xde4b('0x12')](_0x515159[_0x2bcf1d])&&_0x515159[_0x2bcf1d]['state']===_0xde4b('0x5b')&&_0x515159[_0x2bcf1d][_0xde4b('0x5c')]===_0xde4b('0x5d')){_0x400f38[_0xde4b('0x5e')](_0x515159[_0x2bcf1d]['id']);}}}return _0x400f38;};exports[_0xde4b('0x5f')]=function(_0xd49057){var _0x542407=moment()[_0xde4b('0x60')](0x0);var _0x5eba44=moment(_0xd49057)[_0xde4b('0x60')](0x0);return _0x542407['diff'](_0x5eba44,'seconds');};exports['createBody']=function(_0x3c1a6b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3c1a6b[_0xde4b('0x17')],'ListId':_0x3c1a6b[_0xde4b('0x4e')],'VoiceQueueId':_0x3c1a6b[_0xde4b('0x19')]||undefined,'CampaignId':_0x3c1a6b[_0xde4b('0x61')]||undefined};};exports[_0xde4b('0x62')]=function(_0x4868b5){if(_0x4868b5===_0xde4b('0x3f')||_0x4868b5===_0xde4b('0x63')||_0x4868b5==='queue'||_0x4868b5===_0xde4b('0x64')||_0x4868b5===_0xde4b('0x65')||_0x4868b5===_0xde4b('0x66')||_0x4868b5===_0xde4b('0x35')||_0x4868b5===_0xde4b('0x57')||_0x4868b5===_0xde4b('0x15')||_0x4868b5==='active'||_0x4868b5==='calleridnum'||_0x4868b5===_0xde4b('0x4b')||_0x4868b5==='countbusyretry'||_0x4868b5==='countcongestionretry'||_0x4868b5===_0xde4b('0x44')||_0x4868b5===_0xde4b('0x67')||_0x4868b5===_0xde4b('0x68')||_0x4868b5==='callbackuniqueid'||_0x4868b5==='callbackat'||_0x4868b5===_0xde4b('0x69')||_0x4868b5===_0xde4b('0x17')||_0x4868b5===_0xde4b('0x4e')||_0x4868b5===_0xde4b('0x36')||_0x4868b5===_0xde4b('0x19')||_0x4868b5===_0xde4b('0x6a')||_0x4868b5===_0xde4b('0x6b')||_0x4868b5===_0xde4b('0x6c')||_0x4868b5===_0xde4b('0x6d')||_0x4868b5===_0xde4b('0x6e')||_0x4868b5===_0xde4b('0x6f')||_0x4868b5===_0xde4b('0x70')||_0x4868b5===_0xde4b('0x71')||_0x4868b5===_0xde4b('0x72')||_0x4868b5===_0xde4b('0x73')||_0x4868b5==='xmd-contactid'||_0x4868b5===_0xde4b('0x74')||_0x4868b5===_0xde4b('0x75')||_0x4868b5===_0xde4b('0x76')||_0x4868b5==='xmd-agi'||_0x4868b5===_0xde4b('0x77')||_0x4868b5==='rtpaudioqosbridged'||_0x4868b5==='rtpaudioqosjitter'||_0x4868b5===_0xde4b('0x78')||_0x4868b5===_0xde4b('0x79')||_0x4868b5===_0xde4b('0x7a')||_0x4868b5===_0xde4b('0x7b')||_0x4868b5==='rtpaudioqosrttbridged'||_0x4868b5===_0xde4b('0x77')||_0x4868b5==='rtpaudioqosbridged'||_0x4868b5==='rtpaudioqosjitter'||_0x4868b5===_0xde4b('0x78')||_0x4868b5===_0xde4b('0x79')||_0x4868b5===_0xde4b('0x7a')||_0x4868b5===_0xde4b('0x7b')||_0x4868b5===_0xde4b('0x7c')||_0x4868b5===_0xde4b('0x7d')||_0x4868b5===_0xde4b('0x7e')||_0x4868b5===_0xde4b('0x2c')||_0x4868b5===_0xde4b('0x2d')){return![];}return!![];};exports[_0xde4b('0x7f')]=function(_0x40b56b,_0x195459){var _0x149ec6,_0x7f15e0,_0x7f750;if(_0x195459<=0x0){_0x195459=0x1;}_0x149ec6=new RegExp(_0xde4b('0x80')+_0x195459+'}$');_0x7f15e0=Math[_0xde4b('0x81')](0xa,_0x195459-0x1);_0x7f750=Math[_0xde4b('0x81')](0xa,_0x195459)-0x1;return util[_0xde4b('0xe')]('%s',_[_0xde4b('0x82')](_0x40b56b,_0x149ec6,_[_0xde4b('0x83')](_0x7f15e0,_0x7f750)));};exports[_0xde4b('0x84')]=function(_0x7d7b9e){var _0x15772c=_0x7d7b9e[_0xde4b('0x85')](/"(.*?)"/);return _0x15772c?_0x15772c[0x1]:_0x7d7b9e;};exports[_0xde4b('0x86')]=function(_0x292a16){var _0x78fe1a=_0x292a16[_0xde4b('0x85')](/<(.*?)>/);return _0x78fe1a?_0x78fe1a[0x1]:_0x292a16;};function buildNoAnswerEventPayload(_0x4c142e,_0x32310f){var _0x44b2e0=buildObj(_0x4c142e,_0xde4b('0x87'));if(!_[_0xde4b('0xc')](_0x32310f['variables'])){Object[_0xde4b('0x88')](_0x32310f[_0xde4b('0x89')])[_0xde4b('0x8a')](function(_0x278eba){_0x44b2e0[_0x278eba[_0xde4b('0x8b')]()]=_0x32310f[_0xde4b('0x89')][_0x278eba];});}return _0x44b2e0;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file +var _0x694a=['agentReadyId','not_inuse','status','reachable','milliseconds','diff','createBody','campaigntype','dialAnswer','active','calleridnum','countbusyretry','countglobal','callbackuniqueid','callbackat','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','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepvtcallid','\x5cw{0,','pow','replace','random','match','noanswer','variables','keys','forEach','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','info','loggerError','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','ContactId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','membername','UserId','logCustomer','getSeconds','talktime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','Global','scheduledAt','scheduledat','add','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','buildObj'];(function(_0x122efd,_0x59fcc9){var _0x40eecf=function(_0x463ffa){while(--_0x463ffa){_0x122efd['push'](_0x122efd['shift']());}};_0x40eecf(++_0x59fcc9);}(_0x694a,0xbc));var _0xa694=function(_0x314148,_0x50e34b){_0x314148=_0x314148-0x0;var _0x5703c4=_0x694a[_0x314148];return _0x5703c4;};'use strict';var util=require(_0xa694('0x0'));var _=require(_0xa694('0x1'));var moment=require(_0xa694('0x2'));var logger=require(_0xa694('0x3'))('preview');var ipAgi=process['env']['XCALLY_IP_AGI']||_0xa694('0x4');var utils=require(_0xa694('0x5'));exports[_0xa694('0x6')]=function(_0x54123a){return function(_0x3f544d){logger[_0xa694('0x7')](_0x54123a,util[_0xa694('0x8')](_0x3f544d,{'showHidden':![],'depth':null}));};};exports[_0xa694('0x9')]=function(_0x3aa2f2,_0x468a90){logger[_0xa694('0xa')](_0x3aa2f2,util[_0xa694('0x8')](_0x468a90,{'showHidden':![],'depth':null}));};exports[_0xa694('0xb')]=function(_0x4e7cd6,_0x35423f){logger['error'](_0x4e7cd6,util['inspect'](_0x35423f,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x45f656){return function(_0x2cc9e9){logger['info'](_0x45f656,util[_0xa694('0x8')](_0x2cc9e9,{'showHidden':![],'depth':null}));};};exports[_0xa694('0xc')]=function(_0x1d37e5,_0x3ad279,_0x489a7e){return{'message':_0x1d37e5,'unlock':_0x3ad279,'active':_0x489a7e};};exports[_0xa694('0xd')]=function(_0x2ff637,_0x31fb5b,_0x4aa17b){if(!_[_0xa694('0xe')](_0x4aa17b)&&_0xa694('0xf')===typeof _0x4aa17b&&!_[_0xa694('0x10')](_0x4aa17b)){if(!_[_0xa694('0xe')](_0x31fb5b)&&_0xa694('0xf')===typeof _0x31fb5b&&!_[_0xa694('0x10')](_0x31fb5b)){return util[_0xa694('0x11')]('\x22%s\x22\x20<%s>',_0x31fb5b,_0x4aa17b);}return util['format'](_0xa694('0x12'),_0x4aa17b,_0x4aa17b);}if(!_[_0xa694('0xe')](_0x2ff637)&&_0xa694('0xf')===typeof _0x2ff637&&!_['isEmpty'](_0x2ff637)){return _0x2ff637;}return _0xa694('0x13');};exports[_0xa694('0x14')]=function(_0x3f25b7){if(_[_0xa694('0x15')](_0x3f25b7)){return![];}return _0x3f25b7;};exports[_0xa694('0x16')]=function(_0x4fddf2,_0x38e78d,_0x38d889,_0x265aa6,_0x4713a3,_0x1acf8b){var _0x1fc76b={'XMD-QUEUE':_0x38e78d[_0xa694('0x17')]?_0x38e78d[_0xa694('0x17')][_0xa694('0x18')]:'','XMD-CALLERID':_0x265aa6,'XMD-CALLERID-PREVIEW':_0x1acf8b?util['format']('\x22%s\x22\x20<%s>',_0x1acf8b[_0xa694('0x19')],_0x1acf8b['calleridnum']):_0x265aa6,'XMD-DIALID':_0x4713a3,'XMD-CONTACTID':_0x38e78d[_0xa694('0x1a')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x265aa6,'XMD-VOICEQUEUEID':_0x38e78d['VoiceQueueId'],'XMD-DIALCHANNEL':_0x38d889,'XMD-DIALTIMEOUT':_0x4fddf2[_0xa694('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0xa694('0x11')](_0xa694('0x1c'),_0x4fddf2[_0xa694('0x1d')]?'g':'',_['isEmpty'](_0x4fddf2[_0xa694('0x1e')])?'':_0xa694('0x1f')),'XMD-DIALURL':_0x4fddf2[_0xa694('0x20')]||'','XMD-AGI':_0x4fddf2['dialQueueProject']?util['format'](_0xa694('0x21'),ipAgi,_0x4fddf2[_0xa694('0x22')]):_0xa694('0x23'),'XMD-AGIAFTER':_0x4fddf2['dialQueueProject2']?util[_0xa694('0x11')](_0xa694('0x21'),ipAgi,_0x4fddf2[_0xa694('0x1d')]):_0xa694('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x1acf8b?_0x1acf8b[_0xa694('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x1acf8b?_0x1acf8b[_0xa694('0x25')]:'','XMD-DESTINATION':_0xa694('0x26'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xa694('0x10')](_0x4fddf2[_0xa694('0x1e')])){_0x1fc76b[util['format']('%s',_0xa694('0x27'))]=_0x4fddf2['monitor_format'];_0x1fc76b[util[_0xa694('0x11')]('%s',_0xa694('0x28'))]=_0x4713a3;}return _0x1fc76b;};exports['toLowerVariables']=function(_0x5b9e6c){var _0xfb8204={};for(var _0xe8f30a in _0x5b9e6c){if(_0x5b9e6c[_0xa694('0x29')](_0xe8f30a)){_0xfb8204[util[_0xa694('0x11')]('%s',_[_0xa694('0x2a')](_0xe8f30a))]=_0x5b9e6c[_0xe8f30a];}}return{'variables':_0xfb8204};};exports['updateOriginated']=function(_0x5a0732,_0x282864){if(!_[_0xa694('0x15')](_0x5a0732)){if(_0x5a0732['hasOwnProperty']('originated')){if(_0x5a0732[_0xa694('0x2b')]>0x0){_0x5a0732[_0xa694('0x2b')]-=0x1;}else{logger['error'](_0xa694('0x2c'),_0x282864);}}}else{logger[_0xa694('0x7')](_0xa694('0x2d'),_0x282864);}};exports[_0xa694('0x2e')]=function(_0x257c08){var _0x16c0c5=moment()['format'](_0xa694('0x2f'));_0x257c08[_0xa694('0x30')]=0xd;_0x257c08[_0xa694('0x31')]=_0xa694('0x32');_0x257c08[_0xa694('0x33')]=_0x16c0c5;_0x257c08[_0xa694('0x34')]=_0x16c0c5;_0x257c08[_0xa694('0x35')]=_0x16c0c5;};exports[_0xa694('0x36')]=function(_0x2bcda1,_0x4fd1e0,_0x1f3586){var _0x4b5d0c=moment()[_0xa694('0x11')](_0xa694('0x2f'));_0x2bcda1['state']=_0x4fd1e0;_0x2bcda1[_0xa694('0x31')]=_0x1f3586;_0x2bcda1['responsetime']=_0x4b5d0c;_0x2bcda1[_0xa694('0x37')]=utils['getSeconds'](_0x2bcda1[_0xa694('0x34')],_0x2bcda1[_0xa694('0x33')]);};exports['logLookAgent']=function(_0x5c0c3d,_0x3b2559,_0x420dc4){_0x5c0c3d[_0xa694('0x38')]=_0x3b2559;_0x5c0c3d[_0xa694('0x39')]=_0x420dc4;};exports[_0xa694('0x3a')]=function(_0x1bda5d,_0x136e6d,_0x3fcf21){var _0x5b927f=moment()['format'](_0xa694('0x2f'));_0x1bda5d[_0xa694('0x30')]=_0x136e6d;_0x1bda5d['statedesc']=_0x3fcf21;_0x1bda5d[_0xa694('0x34')]=_0x1bda5d['responsetime']?_0x1bda5d[_0xa694('0x34')]:_0x5b927f;_0x1bda5d[_0xa694('0x35')]=_0x1bda5d[_0xa694('0x35')]?_0x1bda5d[_0xa694('0x35')]:_0x5b927f;_0x1bda5d[_0xa694('0x37')]=utils[_0xa694('0x3b')](_0x1bda5d[_0xa694('0x34')]||0x0,_0x1bda5d['starttime']||0x0);_0x1bda5d[_0xa694('0x3c')]=_0x1bda5d['answertime']?utils[_0xa694('0x3b')](_0x1bda5d[_0xa694('0x35')],_0x1bda5d['answertime']):0x0;};exports[_0xa694('0x3d')]=function(_0x559d7c){return _0x559d7c===_0xa694('0x3e');};exports[_0xa694('0x3f')]=function(_0x5c248a,_0x13584f,_0x478082,_0x374bf6,_0x232189){var _0x3e647d=_0x374bf6?_0xa694('0x40'):_0x5c248a[_0xa694('0x19')];_0x3e647d=_0x232189?_0xa694('0x41'):_0x3e647d;return{'actionid':_0x5c248a[_0xa694('0x42')],'action':'originate','channel':_0x5c248a[_0xa694('0x43')],'callerid':util[_0xa694('0x11')](_0xa694('0x12'),_0x3e647d,_0x5c248a['calleridnum']),'Exten':_0xa694('0x26'),'Context':_0xa694('0x44'),'Priority':'1','variable':_0x478082,'timeout':(_0x13584f[_0xa694('0x45')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5c248a[_0xa694('0x42')]};};exports[_0xa694('0x46')]=function(_0xafa6d7){return _0xafa6d7['countbusyretry']+_0xafa6d7[_0xa694('0x47')]+_0xafa6d7[_0xa694('0x48')]+_0xafa6d7[_0xa694('0x49')]+_0xafa6d7[_0xa694('0x4a')];};exports['cloneAction']=function(_0x145715){var _0x1aa2c1=_['clone'](_0x145715);_0x1aa2c1[_0xa694('0x30')]=0xf;_0x1aa2c1[_0xa694('0x31')]=_0xa694('0x4b');return _0x1aa2c1;};exports[_0xa694('0x4c')]=function(_0x1c1536,_0x2c0c88,_0x50b9af){var _0xac4604={};_0xac4604[_0x2c0c88]=_0x1c1536[_0x2c0c88];_0xac4604['active']=![];_0xac4604[_0xa694('0x4d')]=moment()[_0xa694('0x4e')](_0x50b9af,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss');_0xac4604[_0xa694('0x1a')]=_0x1c1536[_0xa694('0x1a')];_0xac4604[_0xa694('0x4f')]=_0x1c1536[_0xa694('0x4f')];_0xac4604[_0xa694('0x50')]=_0x1c1536[_0xa694('0x50')]||undefined;return _0xac4604;};exports[_0xa694('0x51')]=function(_0xb79e77,_0x5811e8){if(!_['isNil'](_0xb79e77)){if(_0xb79e77[_0xa694('0x52')]>0x0){_0xb79e77[_0xa694('0x52')]-=0x1;}else{logger['error'](_0x5811e8,_0xa694('0x53'));}}else{logger[_0xa694('0x7')](_0x5811e8,_0xa694('0x54'));}};exports[_0xa694('0x55')]=function(_0x1c610d){if(_0x1c610d<=0x0){return!![];}return![];};function buildObj(_0x6c7308,_0x3c64d5,_0x4595de){_0x6c7308[_0xa694('0x56')]=_0x3c64d5;_0x6c7308[_0xa694('0x18')]=_0x6c7308[_0xa694('0x57')];_0x6c7308[_0xa694('0x58')]=_0x6c7308[_0xa694('0x43')];_0x6c7308[_0xa694('0x59')]=_0xa694('0x5a');if(_0x4595de){_0x6c7308['mandatoryDisposition']=_0x4595de['mandatoryDisposition'];}return _0x6c7308;}exports[_0xa694('0x5b')]=buildObj;exports[_0xa694('0x5c')]=function(_0x3f4025){var _0xd9e38d=[];for(var _0x473573 in _0x3f4025){if(_0x3f4025['hasOwnProperty'](_0x473573)){if(!_[_0xa694('0x15')](_0x3f4025[_0x473573])&&_0x3f4025[_0x473573][_0xa694('0x30')]===_0xa694('0x5d')&&_0x3f4025[_0x473573][_0xa694('0x5e')]===_0xa694('0x5f')){_0xd9e38d['push'](_0x3f4025[_0x473573]['id']);}}}return _0xd9e38d;};exports['getDiff']=function(_0x20d6c3){var _0x3beed4=moment()[_0xa694('0x60')](0x0);var _0xb877a8=moment(_0x20d6c3)['milliseconds'](0x0);return _0x3beed4[_0xa694('0x61')](_0xb877a8,'seconds');};exports[_0xa694('0x62')]=function(_0x45d475){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x45d475[_0xa694('0x1a')],'ListId':_0x45d475[_0xa694('0x4f')],'VoiceQueueId':_0x45d475['VoiceQueueId']||undefined,'CampaignId':_0x45d475['CampaignId']||undefined};};exports['filterKey']=function(_0x14ffb3){if(_0x14ffb3===_0xa694('0x42')||_0x14ffb3==='idContact'||_0x14ffb3===_0xa694('0x57')||_0x14ffb3==='type'||_0x14ffb3===_0xa694('0x63')||_0x14ffb3===_0xa694('0x64')||_0x14ffb3===_0xa694('0x38')||_0x14ffb3==='channelAgent'||_0x14ffb3===_0xa694('0x19')||_0x14ffb3===_0xa694('0x65')||_0x14ffb3===_0xa694('0x66')||_0x14ffb3===_0xa694('0x4d')||_0x14ffb3===_0xa694('0x67')||_0x14ffb3===_0xa694('0x47')||_0x14ffb3==='countnoanswerretry'||_0x14ffb3===_0xa694('0x68')||_0x14ffb3==='callback'||_0x14ffb3===_0xa694('0x69')||_0x14ffb3===_0xa694('0x6a')||_0x14ffb3==='recallme'||_0x14ffb3===_0xa694('0x1a')||_0x14ffb3===_0xa694('0x4f')||_0x14ffb3===_0xa694('0x39')||_0x14ffb3==='VoiceQueueId'||_0x14ffb3===_0xa694('0x6b')||_0x14ffb3===_0xa694('0x6c')||_0x14ffb3===_0xa694('0x6d')||_0x14ffb3===_0xa694('0x6e')||_0x14ffb3===_0xa694('0x6f')||_0x14ffb3===_0xa694('0x70')||_0x14ffb3===_0xa694('0x71')||_0x14ffb3===_0xa694('0x72')||_0x14ffb3===_0xa694('0x73')||_0x14ffb3===_0xa694('0x74')||_0x14ffb3===_0xa694('0x75')||_0x14ffb3===_0xa694('0x76')||_0x14ffb3===_0xa694('0x77')||_0x14ffb3===_0xa694('0x78')||_0x14ffb3===_0xa694('0x79')||_0x14ffb3===_0xa694('0x7a')||_0x14ffb3===_0xa694('0x7b')||_0x14ffb3===_0xa694('0x7c')||_0x14ffb3===_0xa694('0x7d')||_0x14ffb3===_0xa694('0x7e')||_0x14ffb3===_0xa694('0x7f')||_0x14ffb3==='rtpaudioqosrtt'||_0x14ffb3===_0xa694('0x80')||_0x14ffb3===_0xa694('0x7a')||_0x14ffb3===_0xa694('0x7b')||_0x14ffb3===_0xa694('0x7c')||_0x14ffb3===_0xa694('0x7d')||_0x14ffb3===_0xa694('0x7e')||_0x14ffb3==='rtpaudioqoslossbridged'||_0x14ffb3==='rtpaudioqosrtt'||_0x14ffb3===_0xa694('0x80')||_0x14ffb3==='bridgepeer'||_0x14ffb3===_0xa694('0x81')||_0x14ffb3===_0xa694('0x30')||_0x14ffb3===_0xa694('0x31')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x34cc57,_0x54f89e){var _0x3d803b,_0x73e0a1,_0xdfa0ce;if(_0x54f89e<=0x0){_0x54f89e=0x1;}_0x3d803b=new RegExp(_0xa694('0x82')+_0x54f89e+'}$');_0x73e0a1=Math['pow'](0xa,_0x54f89e-0x1);_0xdfa0ce=Math[_0xa694('0x83')](0xa,_0x54f89e)-0x1;return util[_0xa694('0x11')]('%s',_[_0xa694('0x84')](_0x34cc57,_0x3d803b,_[_0xa694('0x85')](_0x73e0a1,_0xdfa0ce)));};exports['extractCalleridName']=function(_0x542e16){var _0x4ccd5a=_0x542e16[_0xa694('0x86')](/"(.*?)"/);return _0x4ccd5a?_0x4ccd5a[0x1]:_0x542e16;};exports['extractCalleridNumber']=function(_0xc33cbb){var _0x333bd7=_0xc33cbb[_0xa694('0x86')](/<(.*?)>/);return _0x333bd7?_0x333bd7[0x1]:_0xc33cbb;};function buildNoAnswerEventPayload(_0x417b51,_0x3e0def){var _0x4cd5ee=buildObj(_0x417b51,_0xa694('0x87'));if(!_['isEmpty'](_0x3e0def[_0xa694('0x88')])){Object[_0xa694('0x89')](_0x3e0def[_0xa694('0x88')])[_0xa694('0x8a')](function(_0x212d3c){_0x4cd5ee[_0x212d3c['toLowerCase']()]=_0x3e0def[_0xa694('0x88')][_0x212d3c];});}return _0x4cd5ee;}exports[_0xa694('0x8b')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 36e6603..82adbea 100644 --- a/server/services/ami/properties.js +++ b/server/services/ami/properties.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x745d=['boolean','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','queueremove','queuepause'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x745d,0xab));var _0xd745=function(_0x451e2f,_0x189ff4){_0x451e2f=_0x451e2f-0x0;var _0x2c0c5a=_0x745d[_0x451e2f];return _0x2c0c5a;};'use strict';exports[_0xd745('0x0')]={'queue':{'type':_0xd745('0x1'),'required':!![]},'interface':{'type':_0xd745('0x1'),'required':!![]},'membername':{'type':_0xd745('0x1'),'required':!![]},'penalty':{'type':_0xd745('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xd745('0x3')]={'queue':{'type':_0xd745('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xd745('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0xd745('0x5')},'reason':{'type':_0xd745('0x1'),'required':![]}};exports[_0xd745('0x6')]={'module':{'type':_0xd745('0x1'),'required':![]}};exports[_0xd745('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xd745('0x8')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xd745('0x1')},'format':{'type':_0xd745('0x1')},'mixmonitorid':{'type':_0xd745('0x1')}};exports[_0xd745('0x9')]={'uniqueid':{'type':_0xd745('0x1'),'required':!![]}};exports[_0xd745('0xa')]={'uniqueid':{'type':_0xd745('0x1'),'required':!![]},'exten':{'type':_0xd745('0x1'),'required':!![]},'context':{'type':_0xd745('0x1')}}; \ No newline at end of file +var _0x8890=['reload','voicequeuechannel','voicequeuechannelhangup','queueadd','string','boolean','queueremove','queuepause'];(function(_0x3c0cd6,_0x5ba428){var _0x4381ec=function(_0x2ab4b3){while(--_0x2ab4b3){_0x3c0cd6['push'](_0x3c0cd6['shift']());}};_0x4381ec(++_0x5ba428);}(_0x8890,0x9b));var _0x0889=function(_0xbadc37,_0x3b1521){_0xbadc37=_0xbadc37-0x0;var _0x185db6=_0x8890[_0xbadc37];return _0x185db6;};'use strict';exports[_0x0889('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x0889('0x1'),'required':!![]},'membername':{'type':_0x0889('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x0889('0x2'),'required':![]}};exports[_0x0889('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x0889('0x1'),'required':!![]}};exports[_0x0889('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x0889('0x1'),'required':![]}};exports[_0x0889('0x5')]={'module':{'type':_0x0889('0x1'),'required':![]}};exports[_0x0889('0x6')]={'uniqueid':{'type':_0x0889('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x0889('0x1'),'required':!![]},'filename':{'type':_0x0889('0x1')},'format':{'type':_0x0889('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x0889('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x0889('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x0889('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 6ae81cd..7d780c5 100644 --- a/server/services/ami/realtime/index.js +++ b/server/services/ami/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['queuecallerabandonAt','queuecallerexitAt','total','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','moment','util','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','timers','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','isNil','interface','name','hasOwnProperty','answered','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initTriggers','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','diff','queuecallerjoinAt','seconds','queuecallercompleteAt'];(function(_0x3bd21b,_0x5a0f36){var _0x2f194a=function(_0x34b0ea){while(--_0x34b0ea){_0x3bd21b['push'](_0x3bd21b['shift']());}};_0x2f194a(++_0x5a0f36);}(_0x757a,0xde));var _0xa757=function(_0x6b2ddc,_0x3c0aaf){_0x6b2ddc=_0x6b2ddc-0x0;var _0x4efd52=_0x757a[_0x6b2ddc];return _0x4efd52;};'use strict';var _=require('lodash');var moment=require(_0xa757('0x0'));var util=require(_0xa757('0x1'));var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0xa757('0x2'));var Trigger=require(_0xa757('0x3'));var Template=require(_0xa757('0x4'));var Campaign=require(_0xa757('0x5'));var VoiceExtension=require(_0xa757('0x6'));var ZendeskAccount=require(_0xa757('0x7'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xa757('0x8'));var SugarcrmAccount=require(_0xa757('0x9'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xa757('0xa'));var VtigerAccount=require(_0xa757('0xb'));var ServicenowAccount=require(_0xa757('0xc'));var Dynamics365Account=require(_0xa757('0xd'));var FreshsalesAccount=require(_0xa757('0xe'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xa757('0xf')]={};this[_0xa757('0x10')]={};this[_0xa757('0x11')]={};this[_0xa757('0x12')]={};this[_0xa757('0x13')]={};this[_0xa757('0x14')]={};this[_0xa757('0x15')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this['queueChannels']={};this['outboundChannels']={};this[_0xa757('0x16')]={};this['settings']={};this['zendeskAccounts']={};this[_0xa757('0x17')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0xa757('0x18')]={};this[_0xa757('0x19')]={};this[_0xa757('0x1a')]={};this[_0xa757('0x1b')]={};this[_0xa757('0x1c')]={};this[_0xa757('0x1d')]={};this[_0xa757('0x1e')]={};}function freeIsNotKey(_0x2f7947,_0x185011,_0x3df1f9){var _0x50aac1=_[_0xa757('0x1f')](_0x2f7947,function(_0x44eab8){return _0x44eab8[_0x3df1f9];});for(var _0xde8248 in _0x185011){if(_0x185011['hasOwnProperty'](_0xde8248)){if(!_0x50aac1[_0xde8248]){delete _0x185011[_0xde8248];}}}}function freeIsNotKeySip(_0x54b305,_0x151c04){var _0x468d45=_[_0xa757('0x1f')](_0x54b305,function(_0x340599){return util[_0xa757('0x20')](_0xa757('0x21'),_0x340599['name']);});for(var _0x58954 in _0x151c04){if(_0x151c04['hasOwnProperty'](_0x58954)){if(!_0x468d45[_0x58954]){delete _0x151c04[_0x58954];}}}}function freeIsNotKeyAgent(_0x32c2a1,_0x167640){var _0x14014c=_[_0xa757('0x1f')](_0x32c2a1,function(_0x4d598c){var _0x5638c7=_[_0xa757('0x22')](_0x4d598c[_0xa757('0x23')])?util[_0xa757('0x20')](_0xa757('0x21'),_0x4d598c[_0xa757('0x24')]):_0x4d598c[_0xa757('0x23')];return _0x5638c7;});for(var _0x2ca10d in _0x167640){if(_0x167640[_0xa757('0x25')](_0x2ca10d)){if(!_0x14014c[_0x2ca10d]){delete _0x167640[_0x2ca10d];}}}}function clearVoiceCallReports(_0x2bf276){_0x2bf276['total']=0x0;_0x2bf276[_0xa757('0x26')]=0x0;_0x2bf276['sumHoldTime']=0x0;_0x2bf276[_0xa757('0x27')]=0x0;_0x2bf276['sumBillable']=0x0;}function clearCampaigns(_0x40551d){if(!_[_0xa757('0x28')](_0x40551d)){for(var _0x37c7e6 in _0x40551d){if(_0x40551d['hasOwnProperty'](_0x37c7e6)){_0x40551d[_0x37c7e6][_0xa757('0x29')]=0x0;_0x40551d[_0x37c7e6][_0xa757('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x471e84){if(!_[_0xa757('0x28')](_0x471e84)){for(var _0x5b4779 in _0x471e84){if(_0x471e84[_0xa757('0x25')](_0x5b4779)){_0x471e84[_0x5b4779]['total']=0x0;_0x471e84[_0x5b4779]['answered']=0x0;_0x471e84[_0x5b4779]['unmanaged']=0x0;_0x471e84[_0x5b4779]['abandoned']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2b')]=0x0;_0x471e84[_0x5b4779]['sumDuration']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2c')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x2d')]=0x0;_0x471e84[_0x5b4779]['outboundNoAnswerCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2e')]=0x0;_0x471e84[_0x5b4779]['outboundCongestionCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2f')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x30')]=0x0;_0x471e84[_0x5b4779]['outboundDropCallsDayTimeout']=0x0;_0x471e84[_0x5b4779][_0xa757('0x31')]=0x0;_0x471e84[_0x5b4779]['outboundBlacklistCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x32')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x33')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x34')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x2d')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x35')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x36')]=!![];}}}}Realtime[_0xa757('0x37')][_0xa757('0x38')]=function(_0x112282,_0x384424){for(var _0x1f5d5a in _0x384424){if(_0x112282[_0xa757('0x25')](_0x1f5d5a)){_0x112282[_0x1f5d5a]=_0x384424[_0x1f5d5a];}}};Realtime[_0xa757('0x37')][_0xa757('0x39')]=function(){var _0x27be88=this;return function(_0xc1cc20){if(_0xc1cc20){freeIsNotKeyAgent(_0xc1cc20,_0x27be88[_0xa757('0xf')]);for(var _0x1ad384=0x0,_0x1eacde={};_0x1ad384<_0xc1cc20[_0xa757('0x3a')];_0x1ad384+=0x1){_0x1eacde=_0xc1cc20[_0x1ad384];var _0x3de18f=_[_0xa757('0x22')](_0x1eacde[_0xa757('0x23')])?util[_0xa757('0x20')]('SIP/%s',_0x1eacde[_0xa757('0x24')]):_0x1eacde[_0xa757('0x23')];if(_[_0xa757('0x3b')](_0x27be88[_0xa757('0xf')][_0x3de18f])){_0x27be88[_0xa757('0xf')][_0x3de18f]=new Agent(_0x1eacde);}else{_0x27be88['mergeFromDatabase'](_0x27be88[_0xa757('0xf')][_0x3de18f],_0x1eacde);}}}return _0x27be88[_0xa757('0xf')];};};Realtime[_0xa757('0x37')][_0xa757('0x3c')]=function(){var _0xd54446=this;return function(_0xc97cb8){if(_0xc97cb8){freeIsNotKeySip(_0xc97cb8,_0xd54446['telephones']);for(var _0x1346c2=0x0,_0x444639={};_0x1346c2<_0xc97cb8[_0xa757('0x3a')];_0x1346c2+=0x1){_0x444639=_0xc97cb8[_0x1346c2];if(_[_0xa757('0x3b')](_0xd54446[_0xa757('0x10')][util[_0xa757('0x20')](_0xa757('0x21'),_0x444639[_0xa757('0x24')])])){_0xd54446[_0xa757('0x10')][util['format'](_0xa757('0x21'),_0x444639[_0xa757('0x24')])]=new Telephone(_0x444639);}else{_0xd54446[_0xa757('0x38')](_0xd54446[_0xa757('0x10')][util[_0xa757('0x20')](_0xa757('0x21'),_0x444639['name'])],_0x444639);}}}return _0xd54446[_0xa757('0x10')];};};Realtime[_0xa757('0x37')]['initTrunks']=function(){var _0x5eae0b=this;return function(_0x9607af){if(_0x9607af){freeIsNotKeySip(_0x9607af,_0x5eae0b[_0xa757('0x11')]);for(var _0x5b11fe=0x0,_0x51c3d1={};_0x5b11fe<_0x9607af[_0xa757('0x3a')];_0x5b11fe+=0x1){_0x51c3d1=_0x9607af[_0x5b11fe];if(_[_0xa757('0x3b')](_0x5eae0b[_0xa757('0x11')][util['format'](_0xa757('0x21'),_0x51c3d1[_0xa757('0x24')])])){_0x5eae0b[_0xa757('0x11')][util[_0xa757('0x20')](_0xa757('0x21'),_0x51c3d1['name'])]=new Trunk(_0x51c3d1);}else{_0x5eae0b[_0xa757('0x38')](_0x5eae0b['trunks'][util['format'](_0xa757('0x21'),_0x51c3d1[_0xa757('0x24')])],_0x51c3d1);}}}return _0x5eae0b[_0xa757('0x11')];};};Realtime[_0xa757('0x37')][_0xa757('0x3d')]=function(){var _0x5d347c=this;return function(_0x5d25bb){if(_0x5d25bb){freeIsNotKey(_0x5d25bb,_0x5d347c[_0xa757('0x13')],'id');for(var _0x129d77=0x0,_0x2b171c={};_0x129d77<_0x5d25bb[_0xa757('0x3a')];_0x129d77+=0x1){_0x2b171c=_0x5d25bb[_0x129d77];if(_[_0xa757('0x3b')](_0x5d347c[_0xa757('0x13')][_0x2b171c['id']])){_0x5d347c['triggers'][_0x2b171c['id']]=new Trigger(_0x2b171c);}else{_0x5d347c[_0xa757('0x38')](_0x5d347c[_0xa757('0x13')][_0x2b171c['id']],_0x2b171c);}}}return _0x5d347c['triggers'];};};Realtime[_0xa757('0x37')]['initTemplates']=function(){var _0x2d111e=this;return function(_0x4518dc){if(_0x4518dc){freeIsNotKey(_0x4518dc,_0x2d111e['templates'],'id');for(var _0x267d68=0x0,_0x23efad={};_0x267d68<_0x4518dc['length'];_0x267d68+=0x1){_0x23efad=_0x4518dc[_0x267d68];if(_[_0xa757('0x3b')](_0x2d111e[_0xa757('0x15')][_0x23efad['id']])){_0x2d111e[_0xa757('0x15')][_0x23efad['id']]=new Template(_0x23efad);}else{_0x2d111e[_0xa757('0x38')](_0x2d111e['templates'][_0x23efad['id']],_0x23efad);}}}return _0x2d111e[_0xa757('0x15')];};};Realtime[_0xa757('0x37')][_0xa757('0x3e')]=function(){var _0xec4610=this;return function(_0x4d7493){if(_0x4d7493){freeIsNotKey(_0x4d7493,_0xec4610[_0xa757('0x3f')],'id');for(var _0x5b6017=0x0,_0x50c131={};_0x5b6017<_0x4d7493[_0xa757('0x3a')];_0x5b6017+=0x1){_0x50c131=_0x4d7493[_0x5b6017];if(_[_0xa757('0x3b')](_0xec4610[_0xa757('0x3f')][_0x50c131['id']])){_0xec4610['zendeskAccounts'][_0x50c131['id']]=new ZendeskAccount(_0x50c131);}else{_0xec4610[_0xa757('0x38')](_0xec4610['zendeskAccounts'][_0x50c131['id']],_0x50c131);}}}return _0xec4610[_0xa757('0x3f')];};};Realtime[_0xa757('0x37')][_0xa757('0x40')]=function(){var _0xbef575=this;return function(_0x18b0ca){if(_0x18b0ca){freeIsNotKey(_0x18b0ca,_0xbef575[_0xa757('0x17')],'id');for(var _0x57bf73=0x0,_0x505cd={};_0x57bf73<_0x18b0ca['length'];_0x57bf73+=0x1){_0x505cd=_0x18b0ca[_0x57bf73];if(_[_0xa757('0x3b')](_0xbef575[_0xa757('0x17')][_0x505cd['id']])){_0xbef575[_0xa757('0x17')][_0x505cd['id']]=new SalesforceAccount(_0x505cd);}else{_0xbef575[_0xa757('0x38')](_0xbef575[_0xa757('0x17')][_0x505cd['id']],_0x505cd);}}}return _0xbef575[_0xa757('0x17')];};};Realtime[_0xa757('0x37')][_0xa757('0x41')]=function(){var _0x405397=this;return function(_0x1d05d7){if(_0x1d05d7){freeIsNotKey(_0x1d05d7,_0x405397[_0xa757('0x42')],'id');for(var _0x19ceef=0x0,_0x2367c7={};_0x19ceef<_0x1d05d7[_0xa757('0x3a')];_0x19ceef+=0x1){_0x2367c7=_0x1d05d7[_0x19ceef];if(_[_0xa757('0x3b')](_0x405397[_0xa757('0x42')][_0x2367c7['id']])){_0x405397['freshdeskAccounts'][_0x2367c7['id']]=new FreshdeskAccount(_0x2367c7);}else{_0x405397[_0xa757('0x38')](_0x405397['freshdeskAccounts'][_0x2367c7['id']],_0x2367c7);}}}return _0x405397[_0xa757('0x42')];};};Realtime[_0xa757('0x37')][_0xa757('0x43')]=function(){var _0x24c0ad=this;return function(_0x4cb461){if(_0x4cb461){freeIsNotKey(_0x4cb461,_0x24c0ad[_0xa757('0x18')],'id');for(var _0x1ee01e=0x0,_0x8614f9={};_0x1ee01e<_0x4cb461[_0xa757('0x3a')];_0x1ee01e+=0x1){_0x8614f9=_0x4cb461[_0x1ee01e];if(_['isUndefined'](_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']])){_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']]=new ZohoAccount(_0x8614f9);}else{_0x24c0ad[_0xa757('0x38')](_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']],_0x8614f9);}}}return _0x24c0ad[_0xa757('0x18')];};};Realtime[_0xa757('0x37')]['initDeskAccounts']=function(){var _0x485100=this;return function(_0x5d21c1){if(_0x5d21c1){freeIsNotKey(_0x5d21c1,_0x485100['deskAccounts'],'id');for(var _0x1d8742=0x0,_0x9b3779={};_0x1d8742<_0x5d21c1[_0xa757('0x3a')];_0x1d8742+=0x1){_0x9b3779=_0x5d21c1[_0x1d8742];if(_[_0xa757('0x3b')](_0x485100[_0xa757('0x19')][_0x9b3779['id']])){_0x485100[_0xa757('0x19')][_0x9b3779['id']]=new DeskAccount(_0x9b3779);}else{_0x485100['mergeFromDatabase'](_0x485100[_0xa757('0x19')][_0x9b3779['id']],_0x9b3779);}}}return _0x485100[_0xa757('0x19')];};};Realtime[_0xa757('0x37')][_0xa757('0x44')]=function(){var _0x48b578=this;return function(_0x26c74e){if(_0x26c74e){freeIsNotKey(_0x26c74e,_0x48b578[_0xa757('0x45')],'id');for(var _0x4af840=0x0,_0x39699d={};_0x4af840<_0x26c74e['length'];_0x4af840+=0x1){_0x39699d=_0x26c74e[_0x4af840];if(_[_0xa757('0x3b')](_0x48b578['sugarcrmAccounts'][_0x39699d['id']])){_0x48b578[_0xa757('0x45')][_0x39699d['id']]=new SugarcrmAccount(_0x39699d);}else{_0x48b578['mergeFromDatabase'](_0x48b578['sugarcrmAccounts'][_0x39699d['id']],_0x39699d);}}}return _0x48b578[_0xa757('0x45')];};};Realtime[_0xa757('0x37')][_0xa757('0x46')]=function(){var _0x1b5db5=this;return function(_0x14e226){if(_0x14e226){freeIsNotKey(_0x14e226,_0x1b5db5[_0xa757('0x1a')],'id');for(var _0x4c19a6=0x0,_0x4f0d7b={};_0x4c19a6<_0x14e226[_0xa757('0x3a')];_0x4c19a6+=0x1){_0x4f0d7b=_0x14e226[_0x4c19a6];if(_[_0xa757('0x3b')](_0x1b5db5[_0xa757('0x1a')][_0x4f0d7b['id']])){_0x1b5db5['vtigerAccounts'][_0x4f0d7b['id']]=new VtigerAccount(_0x4f0d7b);}else{_0x1b5db5['mergeFromDatabase'](_0x1b5db5[_0xa757('0x1a')][_0x4f0d7b['id']],_0x4f0d7b);}}}return _0x1b5db5[_0xa757('0x1a')];};};Realtime[_0xa757('0x37')][_0xa757('0x47')]=function(){var _0x12b802=this;return function(_0x3e6d40){if(_0x3e6d40){freeIsNotKey(_0x3e6d40,_0x12b802['servicenowAccounts'],'id');for(var _0x466728=0x0,_0x45f2a4={};_0x466728<_0x3e6d40[_0xa757('0x3a')];_0x466728+=0x1){_0x45f2a4=_0x3e6d40[_0x466728];if(_[_0xa757('0x3b')](_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']])){_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']]=new ServicenowAccount(_0x45f2a4);}else{_0x12b802[_0xa757('0x38')](_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']],_0x45f2a4);}}}return _0x12b802[_0xa757('0x1b')];};};Realtime[_0xa757('0x37')]['initDynamics365Accounts']=function(){var _0x9e96e6=this;return function(_0x5c803a){if(_0x5c803a){freeIsNotKey(_0x5c803a,_0x9e96e6['dynamics365Accounts'],'id');for(var _0x40ce42=0x0,_0x3da8c1={};_0x40ce42<_0x5c803a[_0xa757('0x3a')];_0x40ce42+=0x1){_0x3da8c1=_0x5c803a[_0x40ce42];if(_[_0xa757('0x3b')](_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']])){_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']]=new Dynamics365Account(_0x3da8c1);}else{_0x9e96e6[_0xa757('0x38')](_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']],_0x3da8c1);}}}return _0x9e96e6[_0xa757('0x1c')];};};Realtime[_0xa757('0x37')][_0xa757('0x48')]=function(){var _0x4fc507=this;return function(_0x3f8c5c){if(_0x3f8c5c){freeIsNotKey(_0x3f8c5c,_0x4fc507[_0xa757('0x1d')],'id');for(var _0x5f0b71=0x0,_0x11ebb3={};_0x5f0b71<_0x3f8c5c[_0xa757('0x3a')];_0x5f0b71+=0x1){_0x11ebb3=_0x3f8c5c[_0x5f0b71];if(_[_0xa757('0x3b')](_0x4fc507[_0xa757('0x1d')][_0x11ebb3['id']])){_0x4fc507[_0xa757('0x1d')][_0x11ebb3['id']]=new FreshsalesAccount(_0x11ebb3);}else{_0x4fc507[_0xa757('0x38')](_0x4fc507['freshsalesAccounts'][_0x11ebb3['id']],_0x11ebb3);}}}return _0x4fc507[_0xa757('0x1d')];};};Realtime['prototype'][_0xa757('0x49')]=function(){var _0x3250d0=this;return function(_0x2d9d97){for(var _0x3c87c0=0x0;_0x3c87c0<_0x2d9d97[_0xa757('0x3a')];_0x3c87c0+=0x1){_['merge'](_0x3250d0['voiceQueues'][_0x2d9d97[_0x3c87c0][_0xa757('0x24')]],_0x2d9d97[_0x3c87c0]);}return _0x3250d0[_0xa757('0x12')];};};Realtime[_0xa757('0x37')]['initVoiceQueueReports']=function(){var _0x115a94=this;return function(_0x55bc0f){clearVoiceQueues(_0x115a94[_0xa757('0x12')]);if(_0x55bc0f){_0x55bc0f=_[_0xa757('0x4a')](_0x55bc0f,_0xa757('0x4b'));for(var _0xbf1bbf in _0x55bc0f){if(_0x55bc0f[_0xa757('0x25')](_0xbf1bbf)){for(var _0x40a79b=0x0;_0x40a79b<_0x55bc0f[_0xbf1bbf]['length'];_0x40a79b+=0x1){var _0xa28144=_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4c')];if(_0x115a94[_0xa757('0x12')][_0xa28144]){if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4d')]){_0x115a94[_0xa757('0x12')][_0xa28144]['unmanaged']+=0x1;}if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4e')]){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x4f')]+=0x1;}_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x2b')]+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b]['queuecallerleaveAt'])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x51')]),_0xa757('0x52'))||0x0;if(_0x40a79b===_0x55bc0f[_0xbf1bbf]['length']-0x1){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x27')]+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x53')]||_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x54')]||_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x55')])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x51')]),_0xa757('0x52'))||0x0;_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x56')]+=0x1;if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x57')]){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x26')]+=0x1;_0x115a94[_0xa757('0x12')][_0xa28144]['sumBillable']+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x53')])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b]['queuecallerleaveAt']),_0xa757('0x52'))||0x0;}}else{_0x115a94[_0xa757('0x12')][_0xa28144]['sumDuration']+=_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x2b')]||0x0;}}}}}}return _0x115a94[_0xa757('0x12')];};};Realtime[_0xa757('0x37')][_0xa757('0x58')]=function(){var _0x312542=this;return function(_0xdb2ac6){clearVoiceCallReports(_0x312542[_0xa757('0x59')]);if(_0xdb2ac6){for(var _0x1f74af=0x0;_0x1f74af<_0xdb2ac6[_0xa757('0x3a')];_0x1f74af+=0x1){_0x312542[_0xa757('0x59')][_0xa757('0x56')]+=0x1;_0x312542[_0xa757('0x59')][_0xa757('0x27')]+=_0xdb2ac6[_0x1f74af][_0xa757('0x5a')];if(_0xdb2ac6[_0x1f74af][_0xa757('0x5b')]==='ANSWERED'){_0x312542[_0xa757('0x59')]['answered']+=0x1;_0x312542[_0xa757('0x59')][_0xa757('0x2b')]+=_0xdb2ac6[_0x1f74af][_0xa757('0x5a')]-_0xdb2ac6[_0x1f74af][_0xa757('0x5c')]||0x0;_0x312542[_0xa757('0x59')]['sumBillable']+=_0xdb2ac6[_0x1f74af][_0xa757('0x5c')];}}}return _0x312542[_0xa757('0x59')];};};Realtime[_0xa757('0x37')]['initCampaigns']=function(){var _0x3317d8=this;return function(_0x3619ec){if(_0x3619ec){freeIsNotKey(_0x3619ec,_0x3317d8[_0xa757('0x14')],'name');for(var _0x501134=0x0,_0x1f437d={};_0x501134<_0x3619ec[_0xa757('0x3a')];_0x501134+=0x1){_0x1f437d=_0x3619ec[_0x501134];if(_[_0xa757('0x3b')](_0x3317d8['campaigns'][_0x1f437d[_0xa757('0x24')]])){_0x3317d8['campaigns'][_0x1f437d['name']]=new Campaign(_0x1f437d);}else{_0x3317d8[_0xa757('0x38')](_0x3317d8[_0xa757('0x14')][_0x1f437d[_0xa757('0x24')]],_0x1f437d);_0x3317d8['campaigns'][_0x1f437d[_0xa757('0x24')]][_0xa757('0x5d')]=_0x1f437d[_0xa757('0x5e')]?_0x1f437d[_0xa757('0x5e')][_0xa757('0x24')]:undefined;}}}return _0x3317d8[_0xa757('0x14')];};};Realtime[_0xa757('0x37')][_0xa757('0x5f')]=function(){var _0xe38e76=this;return function(_0x35c1aa){if(_0x35c1aa){freeIsNotKey(_0x35c1aa,_0xe38e76[_0xa757('0x60')],'id');for(var _0xafcf19=0x0,_0x5a7042={};_0xafcf19<_0x35c1aa[_0xa757('0x3a')];_0xafcf19+=0x1){_0x5a7042=_0x35c1aa[_0xafcf19];if(_[_0xa757('0x3b')](_0xe38e76[_0xa757('0x60')][_0x5a7042['id']])){_0xe38e76[_0xa757('0x60')][_0x5a7042['id']]=new VoiceExtension(_0x5a7042);}else{_0xe38e76[_0xa757('0x38')](_0xe38e76[_0xa757('0x60')][_0x5a7042['id']],_0x5a7042);}}}return _0xe38e76[_0xa757('0x60')];};};Realtime[_0xa757('0x37')][_0xa757('0x61')]=function(){var _0x2d34b7=this;return function(_0x3997f8){clearCampaigns(_0x2d34b7[_0xa757('0x14')]);for(var _0x132033=0x0;_0x132033<_0x3997f8[_0xa757('0x3a')];_0x132033+=0x1){_[_0xa757('0x62')](_0x2d34b7[_0xa757('0x14')][_0x3997f8[_0x132033][_0xa757('0x24')]],_0x3997f8[_0x132033]);}return _0x2d34b7[_0xa757('0x14')];};};Realtime[_0xa757('0x37')][_0xa757('0x63')]=function(){var _0x1bcb2e=this;return function(_0x20ea21){if(_0x20ea21){freeIsNotKey(_0x20ea21,_0x1bcb2e['faxAccounts'],'id');for(var _0x768a79=0x0,_0x39c52a={};_0x768a79<_0x20ea21['length'];_0x768a79+=0x1){_0x39c52a=_0x20ea21[_0x768a79];if(_[_0xa757('0x3b')](_0x1bcb2e['faxAccounts'][_0x39c52a['id']])){_0x1bcb2e[_0xa757('0x1e')][_0x39c52a['id']]=new FaxAccount(_0x39c52a);}else{_0x1bcb2e[_0xa757('0x38')](_0x1bcb2e['faxAccounts'][_0x39c52a['id']],_0x39c52a);}}}return _0x1bcb2e[_0xa757('0x1e')];};};Realtime[_0xa757('0x37')][_0xa757('0x64')]=function(){var _0x7ba6b3=this;return function(_0x535ff7){if(_0x535ff7){freeIsNotKey(_0x535ff7,_0x7ba6b3[_0xa757('0x12')],_0xa757('0x24'));for(var _0x4bf5c2=0x0,_0x30716a={};_0x4bf5c2<_0x535ff7[_0xa757('0x3a')];_0x4bf5c2+=0x1){_0x30716a=_0x535ff7[_0x4bf5c2];if(_['isUndefined'](_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]])){_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]]=new VoiceQueue(_0x30716a);}else{_0x7ba6b3[_0xa757('0x38')](_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]],_0x30716a);}}}return _0x7ba6b3[_0xa757('0x12')];};};module[_0xa757('0x65')]=Realtime; \ No newline at end of file +var _0x0b0e=['total','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','initAgents','length','isNil','SIP/%s','isUndefined','prototype','initTelephones','initTrunks','trunks','initTriggers','initTemplates','salesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','diff','queuecallercomplete','answered','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','lodash','util','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','name','hasOwnProperty','format','interface'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x0b0e,0x187));var _0xe0b0=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0x0b0e[_0x15ea09];return _0x3e9c78;};'use strict';var _=require(_0xe0b0('0x0'));var moment=require('moment');var util=require(_0xe0b0('0x1'));var Agent=require('../model/agent');var Telephone=require(_0xe0b0('0x2'));var Trunk=require(_0xe0b0('0x3'));var VoiceQueue=require(_0xe0b0('0x4'));var Trigger=require(_0xe0b0('0x5'));var Template=require(_0xe0b0('0x6'));var Campaign=require(_0xe0b0('0x7'));var VoiceExtension=require(_0xe0b0('0x8'));var ZendeskAccount=require(_0xe0b0('0x9'));var SalesforceAccount=require(_0xe0b0('0xa'));var FreshdeskAccount=require(_0xe0b0('0xb'));var SugarcrmAccount=require(_0xe0b0('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xe0b0('0xd'));var ServicenowAccount=require(_0xe0b0('0xe'));var Dynamics365Account=require(_0xe0b0('0xf'));var FreshsalesAccount=require(_0xe0b0('0x10'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xe0b0('0x11')]={};this[_0xe0b0('0x12')]={};this['trunks']={};this[_0xe0b0('0x13')]={};this[_0xe0b0('0x14')]={};this['campaigns']={};this[_0xe0b0('0x15')]={};this[_0xe0b0('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xe0b0('0x17')]={};this['channels']={};this[_0xe0b0('0x18')]={};this[_0xe0b0('0x19')]={};this[_0xe0b0('0x1a')]={};this[_0xe0b0('0x1b')]={};this[_0xe0b0('0x1c')]={};this['salesforceAccounts']={};this[_0xe0b0('0x1d')]={};this[_0xe0b0('0x1e')]={};this[_0xe0b0('0x1f')]={};this[_0xe0b0('0x20')]={};this[_0xe0b0('0x21')]={};this['servicenowAccounts']={};this[_0xe0b0('0x22')]={};this['freshsalesAccounts']={};this[_0xe0b0('0x23')]={};}function freeIsNotKey(_0xadee6e,_0x519ae8,_0x11fdca){var _0x4a4cc0=_[_0xe0b0('0x24')](_0xadee6e,function(_0x100204){return _0x100204[_0x11fdca];});for(var _0x56bcc7 in _0x519ae8){if(_0x519ae8['hasOwnProperty'](_0x56bcc7)){if(!_0x4a4cc0[_0x56bcc7]){delete _0x519ae8[_0x56bcc7];}}}}function freeIsNotKeySip(_0x46bb44,_0x50a441){var _0x4df8da=_['mapKeys'](_0x46bb44,function(_0x1920ee){return util['format']('SIP/%s',_0x1920ee[_0xe0b0('0x25')]);});for(var _0x59dff5 in _0x50a441){if(_0x50a441[_0xe0b0('0x26')](_0x59dff5)){if(!_0x4df8da[_0x59dff5]){delete _0x50a441[_0x59dff5];}}}}function freeIsNotKeyAgent(_0x5dba2f,_0x2c84cc){var _0x1cd7c4=_[_0xe0b0('0x24')](_0x5dba2f,function(_0x310a6d){var _0x2cf6a1=_['isNil'](_0x310a6d['interface'])?util[_0xe0b0('0x27')]('SIP/%s',_0x310a6d[_0xe0b0('0x25')]):_0x310a6d[_0xe0b0('0x28')];return _0x2cf6a1;});for(var _0x513e63 in _0x2c84cc){if(_0x2c84cc[_0xe0b0('0x26')](_0x513e63)){if(!_0x1cd7c4[_0x513e63]){delete _0x2c84cc[_0x513e63];}}}}function clearVoiceCallReports(_0x503883){_0x503883[_0xe0b0('0x29')]=0x0;_0x503883['answered']=0x0;_0x503883[_0xe0b0('0x2a')]=0x0;_0x503883['sumDuration']=0x0;_0x503883[_0xe0b0('0x2b')]=0x0;}function clearCampaigns(_0x4de537){if(!_[_0xe0b0('0x2c')](_0x4de537)){for(var _0x4aafbe in _0x4de537){if(_0x4de537[_0xe0b0('0x26')](_0x4aafbe)){_0x4de537[_0x4aafbe]['ivrTotalCallsDays']=0x0;_0x4de537[_0x4aafbe][_0xe0b0('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x3c3bc2){if(!_[_0xe0b0('0x2c')](_0x3c3bc2)){for(var _0x1d91ad in _0x3c3bc2){if(_0x3c3bc2[_0xe0b0('0x26')](_0x1d91ad)){_0x3c3bc2[_0x1d91ad][_0xe0b0('0x29')]=0x0;_0x3c3bc2[_0x1d91ad]['answered']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2e')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2f')]=0x0;_0x3c3bc2[_0x1d91ad]['sumHoldTime']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x30')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2b')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x32')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x33')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x34')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x35')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundUnknownCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x36')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x37')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundBlacklistCallsDay']=0x0;_0x3c3bc2[_0x1d91ad]['outboundOriginateFailureCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x38')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x39')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3a')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3b')]=!![];}}}}Realtime['prototype'][_0xe0b0('0x3c')]=function(_0x3231fc,_0x7867c4){for(var _0x29d725 in _0x7867c4){if(_0x3231fc[_0xe0b0('0x26')](_0x29d725)){_0x3231fc[_0x29d725]=_0x7867c4[_0x29d725];}}};Realtime['prototype'][_0xe0b0('0x3d')]=function(){var _0x208945=this;return function(_0xfc51d3){if(_0xfc51d3){freeIsNotKeyAgent(_0xfc51d3,_0x208945[_0xe0b0('0x11')]);for(var _0x3575bc=0x0,_0x12eeb8={};_0x3575bc<_0xfc51d3[_0xe0b0('0x3e')];_0x3575bc+=0x1){_0x12eeb8=_0xfc51d3[_0x3575bc];var _0x20908f=_[_0xe0b0('0x3f')](_0x12eeb8[_0xe0b0('0x28')])?util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x12eeb8[_0xe0b0('0x25')]):_0x12eeb8[_0xe0b0('0x28')];if(_[_0xe0b0('0x41')](_0x208945['agents'][_0x20908f])){_0x208945[_0xe0b0('0x11')][_0x20908f]=new Agent(_0x12eeb8);}else{_0x208945[_0xe0b0('0x3c')](_0x208945[_0xe0b0('0x11')][_0x20908f],_0x12eeb8);}}}return _0x208945[_0xe0b0('0x11')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x43')]=function(){var _0x12024d=this;return function(_0x533fc7){if(_0x533fc7){freeIsNotKeySip(_0x533fc7,_0x12024d['telephones']);for(var _0x549d9a=0x0,_0x5317df={};_0x549d9a<_0x533fc7[_0xe0b0('0x3e')];_0x549d9a+=0x1){_0x5317df=_0x533fc7[_0x549d9a];if(_[_0xe0b0('0x41')](_0x12024d[_0xe0b0('0x12')][util['format'](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])])){_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')]('SIP/%s',_0x5317df[_0xe0b0('0x25')])]=new Telephone(_0x5317df);}else{_0x12024d[_0xe0b0('0x3c')](_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])],_0x5317df);}}}return _0x12024d[_0xe0b0('0x12')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x44')]=function(){var _0x54f251=this;return function(_0x3e349b){if(_0x3e349b){freeIsNotKeySip(_0x3e349b,_0x54f251['trunks']);for(var _0x34178d=0x0,_0x2d5f47={};_0x34178d<_0x3e349b[_0xe0b0('0x3e')];_0x34178d+=0x1){_0x2d5f47=_0x3e349b[_0x34178d];if(_[_0xe0b0('0x41')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])])){_0x54f251[_0xe0b0('0x45')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])]=new Trunk(_0x2d5f47);}else{_0x54f251[_0xe0b0('0x3c')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47['name'])],_0x2d5f47);}}}return _0x54f251['trunks'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x46')]=function(){var _0x56e7df=this;return function(_0x18a59d){if(_0x18a59d){freeIsNotKey(_0x18a59d,_0x56e7df[_0xe0b0('0x14')],'id');for(var _0x6bca5c=0x0,_0x1c869d={};_0x6bca5c<_0x18a59d[_0xe0b0('0x3e')];_0x6bca5c+=0x1){_0x1c869d=_0x18a59d[_0x6bca5c];if(_['isUndefined'](_0x56e7df['triggers'][_0x1c869d['id']])){_0x56e7df['triggers'][_0x1c869d['id']]=new Trigger(_0x1c869d);}else{_0x56e7df[_0xe0b0('0x3c')](_0x56e7df[_0xe0b0('0x14')][_0x1c869d['id']],_0x1c869d);}}}return _0x56e7df['triggers'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x47')]=function(){var _0x14197b=this;return function(_0x5f037d){if(_0x5f037d){freeIsNotKey(_0x5f037d,_0x14197b[_0xe0b0('0x15')],'id');for(var _0x5c6f94=0x0,_0x57d4b0={};_0x5c6f94<_0x5f037d[_0xe0b0('0x3e')];_0x5c6f94+=0x1){_0x57d4b0=_0x5f037d[_0x5c6f94];if(_[_0xe0b0('0x41')](_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']])){_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']]=new Template(_0x57d4b0);}else{_0x14197b[_0xe0b0('0x3c')](_0x14197b['templates'][_0x57d4b0['id']],_0x57d4b0);}}}return _0x14197b[_0xe0b0('0x15')];};};Realtime[_0xe0b0('0x42')]['initZendeskAccounts']=function(){var _0x50c805=this;return function(_0x5ddad1){if(_0x5ddad1){freeIsNotKey(_0x5ddad1,_0x50c805[_0xe0b0('0x1c')],'id');for(var _0x2184d3=0x0,_0x2419ce={};_0x2184d3<_0x5ddad1[_0xe0b0('0x3e')];_0x2184d3+=0x1){_0x2419ce=_0x5ddad1[_0x2184d3];if(_['isUndefined'](_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']])){_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']]=new ZendeskAccount(_0x2419ce);}else{_0x50c805['mergeFromDatabase'](_0x50c805['zendeskAccounts'][_0x2419ce['id']],_0x2419ce);}}}return _0x50c805[_0xe0b0('0x1c')];};};Realtime[_0xe0b0('0x42')]['initSalesforceAccounts']=function(){var _0x2b1917=this;return function(_0x27fd31){if(_0x27fd31){freeIsNotKey(_0x27fd31,_0x2b1917['salesforceAccounts'],'id');for(var _0x5cb2b6=0x0,_0x123ad2={};_0x5cb2b6<_0x27fd31['length'];_0x5cb2b6+=0x1){_0x123ad2=_0x27fd31[_0x5cb2b6];if(_[_0xe0b0('0x41')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']])){_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']]=new SalesforceAccount(_0x123ad2);}else{_0x2b1917[_0xe0b0('0x3c')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']],_0x123ad2);}}}return _0x2b1917[_0xe0b0('0x48')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x2ef908=this;return function(_0x5d380a){if(_0x5d380a){freeIsNotKey(_0x5d380a,_0x2ef908['freshdeskAccounts'],'id');for(var _0x249d9a=0x0,_0x222174={};_0x249d9a<_0x5d380a['length'];_0x249d9a+=0x1){_0x222174=_0x5d380a[_0x249d9a];if(_['isUndefined'](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']])){_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']]=new FreshdeskAccount(_0x222174);}else{_0x2ef908[_0xe0b0('0x3c')](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']],_0x222174);}}}return _0x2ef908[_0xe0b0('0x1e')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x49')]=function(){var _0x4ebb0f=this;return function(_0x22c7bc){if(_0x22c7bc){freeIsNotKey(_0x22c7bc,_0x4ebb0f['zohoAccounts'],'id');for(var _0x17b3d4=0x0,_0x54106c={};_0x17b3d4<_0x22c7bc['length'];_0x17b3d4+=0x1){_0x54106c=_0x22c7bc[_0x17b3d4];if(_[_0xe0b0('0x41')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']])){_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']]=new ZohoAccount(_0x54106c);}else{_0x4ebb0f[_0xe0b0('0x3c')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']],_0x54106c);}}}return _0x4ebb0f[_0xe0b0('0x1f')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4a')]=function(){var _0x2e1c9b=this;return function(_0x4e0d87){if(_0x4e0d87){freeIsNotKey(_0x4e0d87,_0x2e1c9b[_0xe0b0('0x20')],'id');for(var _0x57ccc9=0x0,_0x2b5553={};_0x57ccc9<_0x4e0d87[_0xe0b0('0x3e')];_0x57ccc9+=0x1){_0x2b5553=_0x4e0d87[_0x57ccc9];if(_[_0xe0b0('0x41')](_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']])){_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']]=new DeskAccount(_0x2b5553);}else{_0x2e1c9b[_0xe0b0('0x3c')](_0x2e1c9b['deskAccounts'][_0x2b5553['id']],_0x2b5553);}}}return _0x2e1c9b[_0xe0b0('0x20')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4b')]=function(){var _0x271445=this;return function(_0x3bb6d6){if(_0x3bb6d6){freeIsNotKey(_0x3bb6d6,_0x271445[_0xe0b0('0x1d')],'id');for(var _0x234cb7=0x0,_0x1a60d2={};_0x234cb7<_0x3bb6d6[_0xe0b0('0x3e')];_0x234cb7+=0x1){_0x1a60d2=_0x3bb6d6[_0x234cb7];if(_[_0xe0b0('0x41')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']])){_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']]=new SugarcrmAccount(_0x1a60d2);}else{_0x271445[_0xe0b0('0x3c')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']],_0x1a60d2);}}}return _0x271445[_0xe0b0('0x1d')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4c')]=function(){var _0x155738=this;return function(_0x5aa79b){if(_0x5aa79b){freeIsNotKey(_0x5aa79b,_0x155738[_0xe0b0('0x21')],'id');for(var _0xe7fbac=0x0,_0x1182dc={};_0xe7fbac<_0x5aa79b[_0xe0b0('0x3e')];_0xe7fbac+=0x1){_0x1182dc=_0x5aa79b[_0xe7fbac];if(_[_0xe0b0('0x41')](_0x155738[_0xe0b0('0x21')][_0x1182dc['id']])){_0x155738[_0xe0b0('0x21')][_0x1182dc['id']]=new VtigerAccount(_0x1182dc);}else{_0x155738['mergeFromDatabase'](_0x155738['vtigerAccounts'][_0x1182dc['id']],_0x1182dc);}}}return _0x155738[_0xe0b0('0x21')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4d')]=function(){var _0x47ecc1=this;return function(_0x117d20){if(_0x117d20){freeIsNotKey(_0x117d20,_0x47ecc1[_0xe0b0('0x4e')],'id');for(var _0x309efb=0x0,_0x3d820c={};_0x309efb<_0x117d20[_0xe0b0('0x3e')];_0x309efb+=0x1){_0x3d820c=_0x117d20[_0x309efb];if(_['isUndefined'](_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']])){_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']]=new ServicenowAccount(_0x3d820c);}else{_0x47ecc1[_0xe0b0('0x3c')](_0x47ecc1['servicenowAccounts'][_0x3d820c['id']],_0x3d820c);}}}return _0x47ecc1[_0xe0b0('0x4e')];};};Realtime[_0xe0b0('0x42')]['initDynamics365Accounts']=function(){var _0x1bd249=this;return function(_0x4c5478){if(_0x4c5478){freeIsNotKey(_0x4c5478,_0x1bd249['dynamics365Accounts'],'id');for(var _0x4474ac=0x0,_0x57b51e={};_0x4474ac<_0x4c5478['length'];_0x4474ac+=0x1){_0x57b51e=_0x4c5478[_0x4474ac];if(_[_0xe0b0('0x41')](_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']])){_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']]=new Dynamics365Account(_0x57b51e);}else{_0x1bd249[_0xe0b0('0x3c')](_0x1bd249['dynamics365Accounts'][_0x57b51e['id']],_0x57b51e);}}}return _0x1bd249[_0xe0b0('0x22')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4f')]=function(){var _0x41ec8e=this;return function(_0x1b29c){if(_0x1b29c){freeIsNotKey(_0x1b29c,_0x41ec8e[_0xe0b0('0x50')],'id');for(var _0xc5e88c=0x0,_0x224f1e={};_0xc5e88c<_0x1b29c['length'];_0xc5e88c+=0x1){_0x224f1e=_0x1b29c[_0xc5e88c];if(_['isUndefined'](_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']])){_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']]=new FreshsalesAccount(_0x224f1e);}else{_0x41ec8e[_0xe0b0('0x3c')](_0x41ec8e['freshsalesAccounts'][_0x224f1e['id']],_0x224f1e);}}}return _0x41ec8e['freshsalesAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x51')]=function(){var _0x5d7cf4=this;return function(_0x5eca3d){for(var _0x691136=0x0;_0x691136<_0x5eca3d[_0xe0b0('0x3e')];_0x691136+=0x1){_[_0xe0b0('0x52')](_0x5d7cf4[_0xe0b0('0x13')][_0x5eca3d[_0x691136][_0xe0b0('0x25')]],_0x5eca3d[_0x691136]);}return _0x5d7cf4[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x53')]=function(){var _0x51f209=this;return function(_0x1daff7){clearVoiceQueues(_0x51f209[_0xe0b0('0x13')]);if(_0x1daff7){_0x1daff7=_[_0xe0b0('0x54')](_0x1daff7,'uniqueid');for(var _0x4fbf44 in _0x1daff7){if(_0x1daff7['hasOwnProperty'](_0x4fbf44)){for(var _0x56ee83=0x0;_0x56ee83<_0x1daff7[_0x4fbf44]['length'];_0x56ee83+=0x1){var _0x567c06=_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x55')];if(_0x51f209['voiceQueues'][_0x567c06]){if(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexit']){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2e')]+=0x1;}if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x56')]){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2f')]+=0x1;}_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')])['diff'](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x58')]),_0xe0b0('0x59'))||0x0;if(_0x56ee83===_0x1daff7[_0x4fbf44][_0xe0b0('0x3e')]-0x1){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5a')]||_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5b')]||_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexitAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerjoinAt']),_0xe0b0('0x59'))||0x0;_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x29')]+=0x1;if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5d')]){_0x51f209['voiceQueues'][_0x567c06][_0xe0b0('0x5e')]+=0x1;_0x51f209[_0xe0b0('0x13')][_0x567c06]['sumBillable']+=moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallercompleteAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')]),_0xe0b0('0x59'))||0x0;}}else{_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]||0x0;}}}}}}return _0x51f209[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x5f')]=function(){var _0x5a63e6=this;return function(_0x4c512b){clearVoiceCallReports(_0x5a63e6[_0xe0b0('0x16')]);if(_0x4c512b){for(var _0x4880d5=0x0;_0x4880d5<_0x4c512b['length'];_0x4880d5+=0x1){_0x5a63e6['outbound']['total']+=0x1;_0x5a63e6[_0xe0b0('0x16')]['sumDuration']+=_0x4c512b[_0x4880d5][_0xe0b0('0x60')];if(_0x4c512b[_0x4880d5][_0xe0b0('0x61')]===_0xe0b0('0x62')){_0x5a63e6[_0xe0b0('0x16')]['answered']+=0x1;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2a')]+=_0x4c512b[_0x4880d5]['duration']-_0x4c512b[_0x4880d5][_0xe0b0('0x63')]||0x0;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2b')]+=_0x4c512b[_0x4880d5][_0xe0b0('0x63')];}}}return _0x5a63e6[_0xe0b0('0x16')];};};Realtime['prototype']['initCampaigns']=function(){var _0x55aef7=this;return function(_0x545694){if(_0x545694){freeIsNotKey(_0x545694,_0x55aef7['campaigns'],_0xe0b0('0x25'));for(var _0x567e1a=0x0,_0x3c09af={};_0x567e1a<_0x545694['length'];_0x567e1a+=0x1){_0x3c09af=_0x545694[_0x567e1a];if(_[_0xe0b0('0x41')](_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]])){_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]]=new Campaign(_0x3c09af);}else{_0x55aef7[_0xe0b0('0x3c')](_0x55aef7['campaigns'][_0x3c09af['name']],_0x3c09af);_0x55aef7['campaigns'][_0x3c09af['name']][_0xe0b0('0x65')]=_0x3c09af[_0xe0b0('0x66')]?_0x3c09af[_0xe0b0('0x66')][_0xe0b0('0x25')]:undefined;}}}return _0x55aef7[_0xe0b0('0x64')];};};Realtime['prototype'][_0xe0b0('0x67')]=function(){var _0x39a07b=this;return function(_0xf77616){if(_0xf77616){freeIsNotKey(_0xf77616,_0x39a07b[_0xe0b0('0x17')],'id');for(var _0x154e6d=0x0,_0x2a5082={};_0x154e6d<_0xf77616[_0xe0b0('0x3e')];_0x154e6d+=0x1){_0x2a5082=_0xf77616[_0x154e6d];if(_[_0xe0b0('0x41')](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']])){_0x39a07b['voiceExtensions'][_0x2a5082['id']]=new VoiceExtension(_0x2a5082);}else{_0x39a07b['mergeFromDatabase'](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']],_0x2a5082);}}}return _0x39a07b[_0xe0b0('0x17')];};};Realtime['prototype'][_0xe0b0('0x68')]=function(){var _0x4593f1=this;return function(_0x44c475){clearCampaigns(_0x4593f1[_0xe0b0('0x64')]);for(var _0x7358ce=0x0;_0x7358ce<_0x44c475[_0xe0b0('0x3e')];_0x7358ce+=0x1){_[_0xe0b0('0x52')](_0x4593f1[_0xe0b0('0x64')][_0x44c475[_0x7358ce]['name']],_0x44c475[_0x7358ce]);}return _0x4593f1['campaigns'];};};Realtime['prototype'][_0xe0b0('0x69')]=function(){var _0x90d471=this;return function(_0x5d2365){if(_0x5d2365){freeIsNotKey(_0x5d2365,_0x90d471[_0xe0b0('0x23')],'id');for(var _0x448694=0x0,_0x396eec={};_0x448694<_0x5d2365[_0xe0b0('0x3e')];_0x448694+=0x1){_0x396eec=_0x5d2365[_0x448694];if(_['isUndefined'](_0x90d471['faxAccounts'][_0x396eec['id']])){_0x90d471['faxAccounts'][_0x396eec['id']]=new FaxAccount(_0x396eec);}else{_0x90d471[_0xe0b0('0x3c')](_0x90d471[_0xe0b0('0x23')][_0x396eec['id']],_0x396eec);}}}return _0x90d471['faxAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x6a')]=function(){var _0x5547ee=this;return function(_0x576482){if(_0x576482){freeIsNotKey(_0x576482,_0x5547ee[_0xe0b0('0x13')],'name');for(var _0x251195=0x0,_0x5f06c0={};_0x251195<_0x576482[_0xe0b0('0x3e')];_0x251195+=0x1){_0x5f06c0=_0x576482[_0x251195];if(_[_0xe0b0('0x41')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]])){_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]]=new VoiceQueue(_0x5f06c0);}else{_0x5547ee[_0xe0b0('0x3c')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]],_0x5f06c0);}}}return _0x5547ee['voiceQueues'];};};module[_0xe0b0('0x6b')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index bb71a3c..51e4794 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc9e9=['assign','hasOwnProperty','mergeDBDataToRealtime'];(function(_0x13e1f2,_0x5089be){var _0x5d639b=function(_0x10330d){while(--_0x10330d){_0x13e1f2['push'](_0x13e1f2['shift']());}};_0x5d639b(++_0x5089be);}(_0xc9e9,0x111));var _0x9c9e=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xc9e9[_0x13ce0c];return _0x4388fb;};'use strict';function mergeDBDataToRealtime(_0x44bc15,_0x2c3ad9){var _0x1ac682=Object[_0x9c9e('0x0')]({},_0x44bc15);for(var _0x2c5702 in _0x2c3ad9){if(_0x1ac682[_0x9c9e('0x1')](_0x2c5702)){_0x1ac682[_0x2c5702]=_0x2c3ad9[_0x2c5702];}}return _0x1ac682;}exports[_0x9c9e('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xa49b=['mergeDBDataToRealtime','assign'];(function(_0x5e2217,_0x597085){var _0x146245=function(_0x2ca2a1){while(--_0x2ca2a1){_0x5e2217['push'](_0x5e2217['shift']());}};_0x146245(++_0x597085);}(_0xa49b,0xab));var _0xba49=function(_0x170bf0,_0x5bf408){_0x170bf0=_0x170bf0-0x0;var _0x48342f=_0xa49b[_0x170bf0];return _0x48342f;};'use strict';function mergeDBDataToRealtime(_0x4b9952,_0x1939cf){var _0x89aaba=Object[_0xba49('0x0')]({},_0x4b9952);for(var _0x2f2722 in _0x1939cf){if(_0x89aaba['hasOwnProperty'](_0x2f2722)){_0x89aaba[_0x2f2722]=_0x1939cf[_0x2f2722];}}return _0x89aaba;}exports[_0xba49('0x1')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 1a89f6f..4d6ec1d 100644 --- a/server/services/ami/report/index.js +++ b/server/services/ami/report/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7aba=['internal','destination','type','lastapplication','queue','lastdata','context','from-voip-provider','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','disposition','ANSWERED','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','monitor','monitors','monitorFilename','filename','createdAt','exten','connectedlinename','xcally-motion-dialer','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','voiceQueueReport','bind','voiceCallReport','voiceAgentReport','voiceDialReport','blindTransfer','attendedtransfer','findAgent','find','name','isNil','accountcode','format','SIP/%s','length','connectedlinenum','assigned','interface','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','getAgentByInternal','keys','split','outbound'];(function(_0x131a70,_0x5f53b2){var _0x212967=function(_0x2a43ac){while(--_0x2a43ac){_0x131a70['push'](_0x131a70['shift']());}};_0x212967(++_0x5f53b2);}(_0x7aba,0x88));var _0xa7ab=function(_0x3f7dc8,_0x394de7){_0x3f7dc8=_0x3f7dc8-0x0;var _0x155aaa=_0x7aba[_0x3f7dc8];return _0x155aaa;};'use strict';var _=require(_0xa7ab('0x0'));var moment=require(_0xa7ab('0x1'));var util=require(_0xa7ab('0x2'));var config=require(_0xa7ab('0x3'));var ami=require(_0xa7ab('0x4'));var RpcVoiceAgentReport=require(_0xa7ab('0x5'));var RpcVoiceCallReport=require(_0xa7ab('0x6'));var RpcVoiceDialReport=require(_0xa7ab('0x7'));var RpcMemberReport=require(_0xa7ab('0x8'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xa7ab('0x9'));var RpcVoiceTransferReport=require(_0xa7ab('0xa'));var VoiceQueueReport=require(_0xa7ab('0xb'));var VoiceCallReport=require(_0xa7ab('0xc'));var VoiceAgentReport=require(_0xa7ab('0xd'));var VoiceDialReport=require(_0xa7ab('0xe'));var UserReport=require(_0xa7ab('0xf'));function Report(_0x5d7e3a){this[_0xa7ab('0x10')]=_0x5d7e3a;this[_0xa7ab('0x11')]=_0x5d7e3a['agents'];this[_0xa7ab('0x12')]=_0x5d7e3a[_0xa7ab('0x12')];}Report[_0xa7ab('0x13')][_0xa7ab('0x14')]=function(_0x8aafad){var _0x4cbb7d=new VoiceQueueReport(this[_0xa7ab('0x10')]);var _0x37fac0=new VoiceAgentReport(this[_0xa7ab('0x10')]);var _0x1a93e5=new VoiceDialReport(this['realtime']);var _0x278d6b=new VoiceCallReport(this[_0xa7ab('0x10')]);var _0x203914=new UserReport(this[_0xa7ab('0x10')]);if(config[_0xa7ab('0x15')]&&config[_0xa7ab('0x15')][_0xa7ab('0x16')]){ami['on']('custom:voiceQueueReport',this[_0xa7ab('0x17')][_0xa7ab('0x18')](this));ami['on']('custom:voiceCallReport',this[_0xa7ab('0x19')]['bind'](this));ami['on']('custom:voiceAgentReport',this[_0xa7ab('0x1a')][_0xa7ab('0x18')](this));ami['on']('custom:voiceDialReport',this[_0xa7ab('0x1b')]['bind'](this));ami['on']('blindtransfer',this[_0xa7ab('0x1c')][_0xa7ab('0x18')](this));ami['on'](_0xa7ab('0x1d'),this['attendedTransfer'][_0xa7ab('0x18')](this));}};Report[_0xa7ab('0x13')][_0xa7ab('0x1e')]=function(_0x49e919){var _0x29bc09;_0x29bc09=_[_0xa7ab('0x1f')](this[_0xa7ab('0x11')],function(_0x9c2c96){return _0x9c2c96['accountcode']==_0x49e919||_0x9c2c96[_0xa7ab('0x20')]==_0x49e919;});if(_[_0xa7ab('0x21')](_0x29bc09)){var _0x72d6eb=_[_0xa7ab('0x1f')](this[_0xa7ab('0x12')],function(_0x1b32fd){return _0x1b32fd[_0xa7ab('0x22')]==_0x49e919||_0x1b32fd[_0xa7ab('0x20')]==_0x49e919;});if(_0x72d6eb){_0x29bc09=_[_0xa7ab('0x1f')](this[_0xa7ab('0x11')],function(_0x45bec1){return _0x45bec1['interface']==util[_0xa7ab('0x23')](_0xa7ab('0x24'),_0x72d6eb[_0xa7ab('0x20')]);});}}return _0x29bc09;};Report[_0xa7ab('0x13')][_0xa7ab('0x17')]=function(_0x2b54a8){for(var _0x3d56b3=0x0;_0x3d56b3<_0x2b54a8[_0xa7ab('0x25')];_0x3d56b3+=0x1){var _0x54b796=this[_0xa7ab('0x1e')](_0x2b54a8[_0x3d56b3][_0xa7ab('0x26')]);if(_0x54b796){_0x2b54a8[_0x3d56b3][_0xa7ab('0x22')]=_0x54b796['accountcode'];_0x2b54a8[_0x3d56b3][_0xa7ab('0x27')]=!![];_0x2b54a8[_0x3d56b3]['lastAssignedTo']=_0x54b796[_0xa7ab('0x20')];_0x2b54a8[_0x3d56b3][_0xa7ab('0x28')]=_[_0xa7ab('0x21')](_0x54b796['interface'])?util['format'](_0xa7ab('0x24'),_0x54b796[_0xa7ab('0x20')]):_0x54b796[_0xa7ab('0x28')];if(_0x2b54a8[_0x3d56b3]['queuecallercomplete']){_0x2b54a8[_0x3d56b3][_0xa7ab('0x29')]=moment()[_0xa7ab('0x23')](_0xa7ab('0x2a'));}if(_0x2b54a8[_0x3d56b3]['queuecallerexit']){_0x2b54a8[_0x3d56b3][_0xa7ab('0x2b')]=moment()[_0xa7ab('0x23')](_0xa7ab('0x2a'));}RpcMemberReport[_0xa7ab('0x17')](_0x2b54a8[_0x3d56b3]);}RpcVoiceQueueReport[_0xa7ab('0x2c')](_0x2b54a8[_0x3d56b3]);}};function extractCalleridNumber(_0x3a18a4){var _0x3e89a=_0x3a18a4[_0xa7ab('0x2d')](/<(.*?)>/);return _0x3e89a?_0x3e89a[0x1]:_0x3a18a4;}Report['prototype'][_0xa7ab('0x2e')]=function(_0x127bc2){for(var _0x21cc2d=0x0;_0x21cc2d',_0x247d1c[_0xa7ab('0x43')],_0x247d1c[_0xa7ab('0x3c')]);}if(RpcVoiceTransferReport[_0xa7ab('0x44')][_0x247d1c[_0xa7ab('0x45')]]){var _0x76a071=RpcVoiceTransferReport['transfers'][_0x247d1c[_0xa7ab('0x45')]];_0x76a071[_0xa7ab('0x46')]=_0x247d1c[_0xa7ab('0x47')];RpcVoiceTransferReport[_0xa7ab('0x1c')](_0x76a071);delete RpcVoiceTransferReport[_0xa7ab('0x44')][_0x247d1c[_0xa7ab('0x45')]];}if(_['isNil'](_0x247d1c[_0xa7ab('0x34')])){_0x247d1c[_0xa7ab('0x34')]=this['getCallType'](_0x247d1c);}if(_[_0xa7ab('0x21')](_0x247d1c[_0xa7ab('0x48')])){var _0x51d7e1=_0x247d1c[_0xa7ab('0x3f')][_0xa7ab('0x30')]('-')[0x0];var _0x4479b2=this[_0xa7ab('0x11')][_0x51d7e1];if(!_0x4479b2)_0x4479b2=this[_0xa7ab('0x2e')](_0x247d1c[_0xa7ab('0x22')]);if(_0x4479b2){_0x247d1c[_0xa7ab('0x48')]=_0x4479b2['id'];_0x247d1c[_0xa7ab('0x49')]=_0x4479b2[_0xa7ab('0x20')];}}RpcVoiceCallReport[_0xa7ab('0x2c')](_0x247d1c);if(_0x247d1c[_0xa7ab('0x4a')]){for(var _0x4444fb=0x0;_0x4444fb<_0x247d1c[_0xa7ab('0x4b')][_0xa7ab('0x25')];_0x4444fb+=0x1){_0x247d1c[_0xa7ab('0x4c')]=_0x247d1c[_0xa7ab('0x4b')][_0x4444fb][_0xa7ab('0x4d')];_0x247d1c['createdAt']=_0x247d1c[_0xa7ab('0x4b')][_0x4444fb][_0xa7ab('0x4e')];if(_0x247d1c[_0xa7ab('0x4f')]==_0xa7ab('0x3a')){_0x247d1c[_0xa7ab('0x3c')]=_0x247d1c[_0xa7ab('0x26')];_0x247d1c['calleridname']=_0x247d1c[_0xa7ab('0x50')];_0x247d1c[_0xa7ab('0x26')]=_0x247d1c[_0xa7ab('0x22')];_0x247d1c['connectedlinename']=_0x247d1c[_0xa7ab('0x49')];_0x247d1c[_0xa7ab('0x4f')]=_0x247d1c[_0xa7ab('0x3d')];}else if(_0x247d1c['exten']==_0xa7ab('0x51')){_0x247d1c[_0xa7ab('0x3c')]=_0x247d1c[_0xa7ab('0x33')];_0x247d1c[_0xa7ab('0x4f')]=_0x247d1c['originatecalleridnum'];}RpcVoiceRecording[_0xa7ab('0x2c')](_0x247d1c);}}};Report[_0xa7ab('0x13')][_0xa7ab('0x1a')]=function(_0x1b45c4){if(_['isArray'](_0x1b45c4)){_0x1b45c4[_0xa7ab('0x52')](function(_0x77655e){RpcVoiceAgentReport[_0xa7ab('0x2c')](_0x77655e);});}else{RpcVoiceAgentReport[_0xa7ab('0x2c')](_0x1b45c4);}};Report['prototype'][_0xa7ab('0x1b')]=function(_0x30dccf){RpcVoiceDialReport[_0xa7ab('0x2c')](_0x30dccf);var _0x1ad366;var _0x217b95;var _0x46e951=_0x30dccf[_0xa7ab('0x3f')];if(_[_0xa7ab('0x53')](_0x46e951,_0xa7ab('0x54'))){_0x217b95=_0x46e951[_0xa7ab('0x55')](_0x46e951['indexOf']('/')+0x1,_0x46e951[_0xa7ab('0x56')]('@'));_0x1ad366=_[_0xa7ab('0x1f')](this[_0xa7ab('0x11')],function(_0x115ff2){return _0x115ff2[_0xa7ab('0x57')]==_0x217b95||_0x115ff2[_0xa7ab('0x58')]==_0x217b95||_0x115ff2[_0xa7ab('0x22')]==_0x217b95;});}else{_0x217b95=_0x46e951[_0xa7ab('0x55')](_0x46e951[_0xa7ab('0x56')]('/')+0x1,_0x46e951[_0xa7ab('0x59')]('-'));_0x1ad366=this[_0xa7ab('0x1e')](_0x217b95);}if(_0x1ad366){_0x30dccf[_0xa7ab('0x28')]=_[_0xa7ab('0x21')](_0x1ad366['interface'])?util[_0xa7ab('0x23')]('SIP/%s',_0x1ad366[_0xa7ab('0x20')]):_0x1ad366[_0xa7ab('0x28')];_0x30dccf[_0xa7ab('0x49')]=_0x1ad366[_0xa7ab('0x20')];_0x30dccf[_0xa7ab('0x22')]=_0x1ad366['accountcode'];RpcMemberReport[_0xa7ab('0x1b')](_0x30dccf);}};Report[_0xa7ab('0x13')][_0xa7ab('0x1c')]=function(_0x41e55b){RpcVoiceTransferReport['transfers'][_0x41e55b[_0xa7ab('0x5a')]]=_0x41e55b;};Report[_0xa7ab('0x13')][_0xa7ab('0x5b')]=function(_0x394a4f){RpcVoiceTransferReport[_0xa7ab('0x5b')](_0x394a4f);};module[_0xa7ab('0x5c')]=Report; \ No newline at end of file +var _0xa08a=['calleridnum','channel','callerid','calleridpreview','disposition','ANSWERED','calleridname','transfers','transfereelinkedid','uniqueid','blindTransfer','linkedid','monitor','monitors','monitorFilename','filename','createdAt','exten','connectedlinename','membername','originatecalleridnum','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindtransfer','bind','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','format','SIP/%s','voiceQueueReport','connectedlinenum','interface','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','length','getCallType','split','outbound','internal','destination','type','lastapplication','queue','lastdata','context','from-sip','xcally-motion-preview'];(function(_0x30b046,_0x126bc2){var _0x24eda7=function(_0x382847){while(--_0x382847){_0x30b046['push'](_0x30b046['shift']());}};_0x24eda7(++_0x126bc2);}(_0xa08a,0x1dd));var _0xaa08=function(_0x3beea0,_0x416691){_0x3beea0=_0x3beea0-0x0;var _0x314eb1=_0xa08a[_0x3beea0];return _0x314eb1;};'use strict';var _=require(_0xaa08('0x0'));var moment=require('moment');var util=require(_0xaa08('0x1'));var config=require(_0xaa08('0x2'));var ami=require(_0xaa08('0x3'));var RpcVoiceAgentReport=require(_0xaa08('0x4'));var RpcVoiceCallReport=require(_0xaa08('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xaa08('0x6'));var RpcVoiceRecording=require(_0xaa08('0x7'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xaa08('0x8'));var VoiceCallReport=require(_0xaa08('0x9'));var VoiceAgentReport=require(_0xaa08('0xa'));var VoiceDialReport=require(_0xaa08('0xb'));var UserReport=require(_0xaa08('0xc'));function Report(_0x58d5d5){this[_0xaa08('0xd')]=_0x58d5d5;this[_0xaa08('0xe')]=_0x58d5d5['agents'];this['telephones']=_0x58d5d5[_0xaa08('0xf')];}Report[_0xaa08('0x10')][_0xaa08('0x11')]=function(_0x49d4d1){var _0x31c940=new VoiceQueueReport(this[_0xaa08('0xd')]);var _0x3cb1bf=new VoiceAgentReport(this[_0xaa08('0xd')]);var _0x59b5a0=new VoiceDialReport(this['realtime']);var _0xdda0fb=new VoiceCallReport(this[_0xaa08('0xd')]);var _0x5c9d00=new UserReport(this[_0xaa08('0xd')]);if(config[_0xaa08('0x12')]&&config[_0xaa08('0x12')]['disabled']){ami['on']('custom:voiceQueueReport',this['voiceQueueReport']['bind'](this));ami['on']('custom:voiceCallReport',this['voiceCallReport']['bind'](this));ami['on'](_0xaa08('0x13'),this[_0xaa08('0x14')]['bind'](this));ami['on']('custom:voiceDialReport',this[_0xaa08('0x15')]['bind'](this));ami['on'](_0xaa08('0x16'),this['blindTransfer'][_0xaa08('0x17')](this));ami['on'](_0xaa08('0x18'),this[_0xaa08('0x19')]['bind'](this));}};Report['prototype'][_0xaa08('0x1a')]=function(_0x12f751){var _0x14e1d9;_0x14e1d9=_[_0xaa08('0x1b')](this[_0xaa08('0xe')],function(_0x34b5a2){return _0x34b5a2[_0xaa08('0x1c')]==_0x12f751||_0x34b5a2[_0xaa08('0x1d')]==_0x12f751;});if(_[_0xaa08('0x1e')](_0x14e1d9)){var _0x13ead3=_[_0xaa08('0x1b')](this[_0xaa08('0xf')],function(_0x1ba3c5){return _0x1ba3c5['accountcode']==_0x12f751||_0x1ba3c5['name']==_0x12f751;});if(_0x13ead3){_0x14e1d9=_['find'](this[_0xaa08('0xe')],function(_0x527652){return _0x527652['interface']==util[_0xaa08('0x1f')](_0xaa08('0x20'),_0x13ead3[_0xaa08('0x1d')]);});}}return _0x14e1d9;};Report[_0xaa08('0x10')][_0xaa08('0x21')]=function(_0x2e0a4e){for(var _0x116f11=0x0;_0x116f11<_0x2e0a4e['length'];_0x116f11+=0x1){var _0x5507a6=this[_0xaa08('0x1a')](_0x2e0a4e[_0x116f11][_0xaa08('0x22')]);if(_0x5507a6){_0x2e0a4e[_0x116f11][_0xaa08('0x1c')]=_0x5507a6[_0xaa08('0x1c')];_0x2e0a4e[_0x116f11]['assigned']=!![];_0x2e0a4e[_0x116f11]['lastAssignedTo']=_0x5507a6['name'];_0x2e0a4e[_0x116f11][_0xaa08('0x23')]=_[_0xaa08('0x1e')](_0x5507a6[_0xaa08('0x23')])?util[_0xaa08('0x1f')]('SIP/%s',_0x5507a6[_0xaa08('0x1d')]):_0x5507a6[_0xaa08('0x23')];if(_0x2e0a4e[_0x116f11][_0xaa08('0x24')]){_0x2e0a4e[_0x116f11][_0xaa08('0x25')]=moment()[_0xaa08('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2e0a4e[_0x116f11][_0xaa08('0x26')]){_0x2e0a4e[_0x116f11][_0xaa08('0x27')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xaa08('0x21')](_0x2e0a4e[_0x116f11]);}RpcVoiceQueueReport[_0xaa08('0x28')](_0x2e0a4e[_0x116f11]);}};function extractCalleridNumber(_0x2c7bee){var _0x58c141=_0x2c7bee[_0xaa08('0x29')](/<(.*?)>/);return _0x58c141?_0x58c141[0x1]:_0x2c7bee;}Report[_0xaa08('0x10')][_0xaa08('0x2a')]=function(_0x4043cf){for(var _0x256a84=0x0;_0x256a84',_0x2e27ba[_0xaa08('0x3f')],_0x2e27ba[_0xaa08('0x39')]);}if(RpcVoiceTransferReport[_0xaa08('0x40')][_0x2e27ba['linkedid']]){var _0x4c69e7=RpcVoiceTransferReport['transfers'][_0x2e27ba['linkedid']];_0x4c69e7[_0xaa08('0x41')]=_0x2e27ba[_0xaa08('0x42')];RpcVoiceTransferReport[_0xaa08('0x43')](_0x4c69e7);delete RpcVoiceTransferReport[_0xaa08('0x40')][_0x2e27ba[_0xaa08('0x44')]];}if(_['isNil'](_0x2e27ba[_0xaa08('0x32')])){_0x2e27ba[_0xaa08('0x32')]=this[_0xaa08('0x2d')](_0x2e27ba);}if(_[_0xaa08('0x1e')](_0x2e27ba['UserId'])){var _0x43113b=_0x2e27ba[_0xaa08('0x3a')][_0xaa08('0x2e')]('-')[0x0];var _0x23d1a6=this[_0xaa08('0xe')][_0x43113b];if(!_0x23d1a6)_0x23d1a6=this[_0xaa08('0x2a')](_0x2e27ba[_0xaa08('0x1c')]);if(_0x23d1a6){_0x2e27ba['UserId']=_0x23d1a6['id'];_0x2e27ba['membername']=_0x23d1a6[_0xaa08('0x1d')];}}RpcVoiceCallReport[_0xaa08('0x28')](_0x2e27ba);if(_0x2e27ba[_0xaa08('0x45')]){for(var _0x1f1397=0x0;_0x1f1397<_0x2e27ba[_0xaa08('0x46')]['length'];_0x1f1397+=0x1){_0x2e27ba[_0xaa08('0x47')]=_0x2e27ba[_0xaa08('0x46')][_0x1f1397][_0xaa08('0x48')];_0x2e27ba['createdAt']=_0x2e27ba[_0xaa08('0x46')][_0x1f1397][_0xaa08('0x49')];if(_0x2e27ba[_0xaa08('0x4a')]=='xcally-motion-preview'){_0x2e27ba[_0xaa08('0x39')]=_0x2e27ba[_0xaa08('0x22')];_0x2e27ba[_0xaa08('0x3f')]=_0x2e27ba[_0xaa08('0x4b')];_0x2e27ba[_0xaa08('0x22')]=_0x2e27ba[_0xaa08('0x1c')];_0x2e27ba[_0xaa08('0x4b')]=_0x2e27ba[_0xaa08('0x4c')];_0x2e27ba[_0xaa08('0x4a')]=_0x2e27ba[_0xaa08('0x4d')];}else if(_0x2e27ba[_0xaa08('0x4a')]==_0xaa08('0x4e')){_0x2e27ba['calleridnum']=_0x2e27ba['destination'];_0x2e27ba[_0xaa08('0x4a')]=_0x2e27ba['originatecalleridnum'];}RpcVoiceRecording[_0xaa08('0x28')](_0x2e27ba);}}};Report[_0xaa08('0x10')]['voiceAgentReport']=function(_0x54a922){if(_[_0xaa08('0x4f')](_0x54a922)){_0x54a922[_0xaa08('0x50')](function(_0x3aab16){RpcVoiceAgentReport[_0xaa08('0x28')](_0x3aab16);});}else{RpcVoiceAgentReport[_0xaa08('0x28')](_0x54a922);}};Report['prototype'][_0xaa08('0x15')]=function(_0x5d3c5b){RpcVoiceDialReport[_0xaa08('0x28')](_0x5d3c5b);var _0x9085c3;var _0x1d0285;var _0x170468=_0x5d3c5b[_0xaa08('0x3a')];if(_[_0xaa08('0x51')](_0x170468,_0xaa08('0x52'))){_0x1d0285=_0x170468[_0xaa08('0x53')](_0x170468[_0xaa08('0x54')]('/')+0x1,_0x170468[_0xaa08('0x54')]('@'));_0x9085c3=_['find'](this[_0xaa08('0xe')],function(_0x42bf80){return _0x42bf80[_0xaa08('0x55')]==_0x1d0285||_0x42bf80[_0xaa08('0x56')]==_0x1d0285||_0x42bf80[_0xaa08('0x1c')]==_0x1d0285;});}else{_0x1d0285=_0x170468[_0xaa08('0x53')](_0x170468[_0xaa08('0x54')]('/')+0x1,_0x170468[_0xaa08('0x57')]('-'));_0x9085c3=this['findAgent'](_0x1d0285);}if(_0x9085c3){_0x5d3c5b[_0xaa08('0x23')]=_[_0xaa08('0x1e')](_0x9085c3[_0xaa08('0x23')])?util[_0xaa08('0x1f')](_0xaa08('0x20'),_0x9085c3[_0xaa08('0x1d')]):_0x9085c3[_0xaa08('0x23')];_0x5d3c5b[_0xaa08('0x4c')]=_0x9085c3['name'];_0x5d3c5b[_0xaa08('0x1c')]=_0x9085c3[_0xaa08('0x1c')];RpcMemberReport[_0xaa08('0x15')](_0x5d3c5b);}};Report[_0xaa08('0x10')][_0xaa08('0x43')]=function(_0x3e2ec1){RpcVoiceTransferReport[_0xaa08('0x40')][_0x3e2ec1[_0xaa08('0x58')]]=_0x3e2ec1;};Report[_0xaa08('0x10')][_0xaa08('0x19')]=function(_0x255a5b){RpcVoiceTransferReport['attendedTransfer'](_0x255a5b);};module['exports']=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index a255a53..38216b3 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa73e=['ami','../ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','[userReport][sipshowregistry]','inspect','[userReport][devicestatelist]','actionSipPeerStatus','prototype','isNotNull','isUndefined','emit','[userReport][registry]\x20registry:%s\x20state:%s','state','debug','[userReport][registry]','find','stateRegistry','merge','omit','event','actionid','username','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','error','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','toLowerCase','inuse','local','toNumber','format','updateStatusRealtime','stateTime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:save','substring','indexOf','mobile','phone','accountcode','info','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','exports','ioredis','bluebird','../../../config/environment','../../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa73e,0x1be));var _0xea73=function(_0x39d06b,_0x4cb1d4){_0x39d06b=_0x39d06b-0x0;var _0x37ac26=_0xa73e[_0x39d06b];return _0x37ac26;};'use strict';var _=require('lodash');var moment=require('moment');var util=require('util');var Redis=require(_0xea73('0x0'));var BPromise=require(_0xea73('0x1'));var config=require(_0xea73('0x2'));var logger=require(_0xea73('0x3'))(_0xea73('0x4'));var ami=require(_0xea73('0x5'));config[_0xea73('0x6')]=_['defaults'](config[_0xea73('0x6')],{'host':_0xea73('0x7'),'port':0x18eb});var io=require(_0xea73('0x8'))(new Redis(config[_0xea73('0x6')]));function UserReport(_0x2d50a3){this[_0xea73('0x9')]=_0x2d50a3[_0xea73('0x9')];this[_0xea73('0xa')]=_0x2d50a3[_0xea73('0xa')];this[_0xea73('0xb')]=_0x2d50a3[_0xea73('0xb')];ami['on']('registryentry',this[_0xea73('0xc')]['bind'](this));ami['on'](_0xea73('0xd'),this[_0xea73('0xc')][_0xea73('0xe')](this));ami['on'](_0xea73('0xf'),this[_0xea73('0x10')][_0xea73('0xe')](this));ami['on'](_0xea73('0x11'),this[_0xea73('0x12')][_0xea73('0xe')](this));return this[_0xea73('0x13')]();}function showSipRegistrations(){Promise[_0xea73('0x14')]()[_0xea73('0x15')](ami[_0xea73('0x16')]())[_0xea73('0x17')](function(_0x17bf78){logger['error'](_0xea73('0x18'),util[_0xea73('0x19')](_0x17bf78,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xea73('0x14')]()['then'](ami['actionDeviceStateList']())[_0xea73('0x17')](function(_0x3752fc){logger['error'](_0xea73('0x1a'),util[_0xea73('0x19')](_0x3752fc,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xea73('0x14')]()[_0xea73('0x15')](ami[_0xea73('0x1b')]())['catch'](function(_0x471613){logger['error']('[userReport][sippeerstatus]',util[_0xea73('0x19')](_0x471613,{'showHidden':![],'depth':null}));});}UserReport[_0xea73('0x1c')][_0xea73('0x13')]=function(){setInterval(function(){BPromise['resolve']()[_0xea73('0x15')](showSipRegistrations())[_0xea73('0x15')](listDeviceStates())[_0xea73('0x15')](showPeersStatus());},0x32c8);};UserReport[_0xea73('0x1c')][_0xea73('0x1d')]=function(_0x113d88){return _0x113d88!==null&&!_[_0xea73('0x1e')](_0x113d88);};UserReport['prototype'][_0xea73('0x1f')]=function(_0x236af8,_0x1860bf,_0x36edfe){io['to'](_0x236af8)[_0xea73('0x1f')](_0x1860bf,_0x36edfe);};UserReport[_0xea73('0x1c')]['syncRegistry']=function(_0x682770){try{if(this[_0xea73('0x1d')](_0x682770)){logger['info'](_0xea73('0x20'),_0x682770['username'],_0x682770[_0xea73('0x21')]);logger[_0xea73('0x22')](_0xea73('0x23'),util[_0xea73('0x19')](_0x682770,{'showHidden':![],'depth':null}));var _0x23bb4c=_[_0xea73('0x24')](this[_0xea73('0x9')],{'defaultuser':_0x682770['username']});if(_0x23bb4c){_0x682770[_0xea73('0x25')]=_0x682770['state'];_[_0xea73('0x26')](_0x23bb4c,_[_0xea73('0x27')](_0x682770,[_0xea73('0x28'),_0xea73('0x29'),_0xea73('0x2a'),_0xea73('0x21')]));logger[_0xea73('0x22')](_0xea73('0x2b'),util[_0xea73('0x19')](_0x23bb4c,{'showHidden':![],'depth':null}));this[_0xea73('0x1f')](util['format'](_0xea73('0x2c'),_0x23bb4c[_0xea73('0x2d')]),'trunk:save',_0x23bb4c);}}}catch(_0x5f3c29){logger[_0xea73('0x2e')]('[userReport][registry]',util[_0xea73('0x19')](_0x5f3c29,{'showHidden':![],'depth':null}));}};UserReport[_0xea73('0x1c')][_0xea73('0x10')]=function(_0x3f753b){try{if(this[_0xea73('0x1d')](_0x3f753b)){logger['info'](_0xea73('0x2f'),_0x3f753b[_0xea73('0x30')],_0x3f753b[_0xea73('0x21')]);logger[_0xea73('0x22')]('[userReport][devicestatechange]',util[_0xea73('0x19')](_0x3f753b,{'showHidden':![],'depth':null}));if(this[_0xea73('0xa')][_0x3f753b[_0xea73('0x30')]]){if(!this['agents'][_0x3f753b[_0xea73('0x30')]]['local']||_0x3f753b['state'][_0xea73('0x31')]()==_0xea73('0x32')){this[_0xea73('0xa')][_0x3f753b[_0xea73('0x30')]][_0xea73('0x33')]=![];if(this[_0xea73('0xa')][_0x3f753b[_0xea73('0x30')]]['state']!==_0x3f753b[_0xea73('0x21')][_0xea73('0x31')]()){this[_0xea73('0xa')][_0x3f753b[_0xea73('0x30')]]['stateTime']=_[_0xea73('0x34')](moment()[_0xea73('0x35')]('x'));}this[_0xea73('0xa')][_0x3f753b[_0xea73('0x30')]][_0xea73('0x21')]=_0x3f753b[_0xea73('0x21')][_0xea73('0x31')]();this['agents'][_0x3f753b[_0xea73('0x30')]][_0xea73('0x36')](_0x3f753b);}}else if(this[_0xea73('0xb')][_0x3f753b[_0xea73('0x30')]]){if(this['telephones'][_0x3f753b[_0xea73('0x30')]][_0xea73('0x21')]!==_0x3f753b['state'][_0xea73('0x31')]()){this[_0xea73('0xb')][_0x3f753b['device']][_0xea73('0x37')]=_[_0xea73('0x34')](moment()['format']('x'));}this[_0xea73('0xb')][_0x3f753b[_0xea73('0x30')]][_0xea73('0x21')]=_0x3f753b[_0xea73('0x21')][_0xea73('0x31')]();logger[_0xea73('0x22')](_0xea73('0x38'),util[_0xea73('0x19')](this[_0xea73('0xb')][_0x3f753b[_0xea73('0x30')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xea73('0x35')]('telephone:%s',this[_0xea73('0xb')][_0x3f753b[_0xea73('0x30')]][_0xea73('0x2d')]),'telephone:save',this[_0xea73('0xb')][_0x3f753b['device']]);}else if(this[_0xea73('0x9')][_0x3f753b[_0xea73('0x30')]]){if(this[_0xea73('0x9')][_0x3f753b[_0xea73('0x30')]]['state']!==_0x3f753b['state'][_0xea73('0x31')]()){this[_0xea73('0x9')][_0x3f753b[_0xea73('0x30')]][_0xea73('0x37')]=_['toNumber'](moment()['format']('x'));}this['trunks'][_0x3f753b[_0xea73('0x30')]][_0xea73('0x21')]=_0x3f753b[_0xea73('0x21')]['toLowerCase']();logger['debug'](_0xea73('0x39'),util[_0xea73('0x19')](this[_0xea73('0x9')][_0x3f753b[_0xea73('0x30')]],{'showHidden':![],'depth':null}));this[_0xea73('0x1f')](util[_0xea73('0x35')](_0xea73('0x2c'),this[_0xea73('0x9')][_0x3f753b['device']]['name']),_0xea73('0x3a'),this[_0xea73('0x9')][_0x3f753b['device']]);}else if(_['startsWith'](_0x3f753b['device'],'Local')){var _0x195e39=_0x3f753b[_0xea73('0x30')];var _0x400a5c=_0x195e39[_0xea73('0x3b')](_0x195e39[_0xea73('0x3c')]('/')+0x1,_0x195e39[_0xea73('0x3c')]('@'));var _0x9e14a5=_['find'](this[_0xea73('0xa')],function(_0x49a178){return _0x49a178[_0xea73('0x3d')]==_0x400a5c||_0x49a178[_0xea73('0x3e')]==_0x400a5c||_0x49a178[_0xea73('0x3f')]==_0x400a5c;});if(_0x9e14a5){if(_0x9e14a5[_0xea73('0x21')]!==_0x3f753b[_0xea73('0x21')][_0xea73('0x31')]()){_0x9e14a5[_0xea73('0x37')]=_[_0xea73('0x34')](moment()[_0xea73('0x35')]('x'));}_0x9e14a5['state']=_0x3f753b[_0xea73('0x21')][_0xea73('0x31')]();_0x9e14a5[_0xea73('0x33')]=!![];_0x9e14a5[_0xea73('0x36')](_0x3f753b);}}}}catch(_0x41e6aa){logger[_0xea73('0x2e')]('[userReport][devicestatechange]',util[_0xea73('0x19')](_0x41e6aa,{'showHidden':![],'depth':null}));}};UserReport[_0xea73('0x1c')][_0xea73('0x12')]=function(_0x4f22f7){try{if(this[_0xea73('0x1d')](_0x4f22f7)&&this['isNotNull'](_0x4f22f7[_0xea73('0x11')])){logger[_0xea73('0x40')](_0xea73('0x41'),_0x4f22f7[_0xea73('0x42')],_0x4f22f7[_0xea73('0x43')],_0x4f22f7['peerstatus']);logger[_0xea73('0x22')](_0xea73('0x44'),util[_0xea73('0x19')](_0x4f22f7,{'showHidden':![],'depth':null}));if(this[_0xea73('0xa')][_0x4f22f7[_0xea73('0x42')]]){if(!this[_0xea73('0xa')][_0x4f22f7[_0xea73('0x42')]]['local']||_0x4f22f7[_0xea73('0x11')][_0xea73('0x31')]()==_0xea73('0x45')){this['agents'][_0x4f22f7[_0xea73('0x42')]][_0xea73('0x33')]=![];this[_0xea73('0xa')][_0x4f22f7[_0xea73('0x42')]]['status']=_0x4f22f7[_0xea73('0x11')][_0xea73('0x31')]();this['agents'][_0x4f22f7['peer']][_0xea73('0x43')]=_0x4f22f7[_0xea73('0x43')];this['agents'][_0x4f22f7['peer']][_0xea73('0x36')](_0x4f22f7);}}else if(this['telephones'][_0x4f22f7[_0xea73('0x42')]]){this[_0xea73('0xb')][_0x4f22f7[_0xea73('0x42')]][_0xea73('0x46')]=_0x4f22f7[_0xea73('0x11')][_0xea73('0x31')]();this['telephones'][_0x4f22f7[_0xea73('0x42')]]['address']=_0x4f22f7[_0xea73('0x43')];logger[_0xea73('0x22')](_0xea73('0x47'),util['inspect'](this[_0xea73('0xb')][_0x4f22f7['peer']],{'showHidden':![],'depth':null}));this['emit'](util[_0xea73('0x35')](_0xea73('0x48'),this['telephones'][_0x4f22f7[_0xea73('0x42')]][_0xea73('0x2d')]),_0xea73('0x49'),this['telephones'][_0x4f22f7[_0xea73('0x42')]]);}else if(this[_0xea73('0x9')][_0x4f22f7['peer']]){this[_0xea73('0x9')][_0x4f22f7[_0xea73('0x42')]][_0xea73('0x46')]=_0x4f22f7[_0xea73('0x11')]['toLowerCase']();this[_0xea73('0x9')][_0x4f22f7['peer']][_0xea73('0x43')]=_0x4f22f7[_0xea73('0x43')];logger[_0xea73('0x22')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0xea73('0x19')](this[_0xea73('0x9')][_0x4f22f7[_0xea73('0x42')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xea73('0x35')]('trunk:%s',this['trunks'][_0x4f22f7[_0xea73('0x42')]][_0xea73('0x2d')]),_0xea73('0x3a'),this[_0xea73('0x9')][_0x4f22f7[_0xea73('0x42')]]);}}}catch(_0x36d593){logger['error'](_0xea73('0x44'),util[_0xea73('0x19')](_0x36d593,{'showHidden':![],'depth':null}));}};module[_0xea73('0x4a')]=UserReport; \ No newline at end of file +var _0xb221=['state','find','username','stateRegistry','merge','event','actionid','format','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','inuse','toLowerCase','updateStatusRealtime','stateTime','toNumber','debug','telephone:%s','telephone:save','startsWith','Local','substring','indexOf','mobile','phone','accountcode','[userReport][devicestatechange]','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xb221,0x72));var _0x1b22=function(_0x267fa5,_0x3f09b8){_0x267fa5=_0x267fa5-0x0;var _0x20fb4d=_0xb221[_0x267fa5];return _0x20fb4d;};'use strict';var _=require(_0x1b22('0x0'));var moment=require(_0x1b22('0x1'));var util=require(_0x1b22('0x2'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require(_0x1b22('0x3'));var logger=require(_0x1b22('0x4'))(_0x1b22('0x5'));var ami=require(_0x1b22('0x6'));config[_0x1b22('0x7')]=_[_0x1b22('0x8')](config['redis'],{'host':_0x1b22('0x9'),'port':0x18eb});var io=require(_0x1b22('0xa'))(new Redis(config[_0x1b22('0x7')]));function UserReport(_0x4a551a){this['trunks']=_0x4a551a[_0x1b22('0xb')];this[_0x1b22('0xc')]=_0x4a551a[_0x1b22('0xc')];this[_0x1b22('0xd')]=_0x4a551a[_0x1b22('0xd')];ami['on'](_0x1b22('0xe'),this[_0x1b22('0xf')][_0x1b22('0x10')](this));ami['on'](_0x1b22('0x11'),this[_0x1b22('0xf')][_0x1b22('0x10')](this));ami['on'](_0x1b22('0x12'),this[_0x1b22('0x13')]['bind'](this));ami['on'](_0x1b22('0x14'),this[_0x1b22('0x15')][_0x1b22('0x10')](this));return this[_0x1b22('0x16')]();}function showSipRegistrations(){Promise[_0x1b22('0x17')]()[_0x1b22('0x18')](ami[_0x1b22('0x19')]())[_0x1b22('0x1a')](function(_0x5887f8){logger[_0x1b22('0x1b')]('[userReport][sipshowregistry]',util[_0x1b22('0x1c')](_0x5887f8,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x1b22('0x18')](ami[_0x1b22('0x1d')]())[_0x1b22('0x1a')](function(_0x358cba){logger['error'](_0x1b22('0x1e'),util[_0x1b22('0x1c')](_0x358cba,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x1b22('0x17')]()['then'](ami[_0x1b22('0x1f')]())[_0x1b22('0x1a')](function(_0xeef9c7){logger[_0x1b22('0x1b')]('[userReport][sippeerstatus]',util[_0x1b22('0x1c')](_0xeef9c7,{'showHidden':![],'depth':null}));});}UserReport[_0x1b22('0x20')][_0x1b22('0x16')]=function(){setInterval(function(){BPromise[_0x1b22('0x17')]()[_0x1b22('0x18')](showSipRegistrations())[_0x1b22('0x18')](listDeviceStates())[_0x1b22('0x18')](showPeersStatus());},0x32c8);};UserReport[_0x1b22('0x20')][_0x1b22('0x21')]=function(_0x3c9371){return _0x3c9371!==null&&!_[_0x1b22('0x22')](_0x3c9371);};UserReport[_0x1b22('0x20')][_0x1b22('0x23')]=function(_0x42939e,_0x4f372b,_0x379924){io['to'](_0x42939e)[_0x1b22('0x23')](_0x4f372b,_0x379924);};UserReport[_0x1b22('0x20')][_0x1b22('0xf')]=function(_0x50e369){try{if(this[_0x1b22('0x21')](_0x50e369)){logger[_0x1b22('0x24')](_0x1b22('0x25'),_0x50e369['username'],_0x50e369[_0x1b22('0x26')]);logger['debug']('[userReport][registry]',util[_0x1b22('0x1c')](_0x50e369,{'showHidden':![],'depth':null}));var _0x4e381c=_[_0x1b22('0x27')](this[_0x1b22('0xb')],{'defaultuser':_0x50e369[_0x1b22('0x28')]});if(_0x4e381c){_0x50e369[_0x1b22('0x29')]=_0x50e369[_0x1b22('0x26')];_[_0x1b22('0x2a')](_0x4e381c,_['omit'](_0x50e369,[_0x1b22('0x2b'),_0x1b22('0x2c'),_0x1b22('0x28'),_0x1b22('0x26')]));logger['debug']('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x1b22('0x1c')](_0x4e381c,{'showHidden':![],'depth':null}));this['emit'](util[_0x1b22('0x2d')](_0x1b22('0x2e'),_0x4e381c[_0x1b22('0x2f')]),_0x1b22('0x30'),_0x4e381c);}}}catch(_0x2b9f6f){logger[_0x1b22('0x1b')]('[userReport][registry]',util[_0x1b22('0x1c')](_0x2b9f6f,{'showHidden':![],'depth':null}));}};UserReport[_0x1b22('0x20')][_0x1b22('0x13')]=function(_0x31a342){try{if(this[_0x1b22('0x21')](_0x31a342)){logger[_0x1b22('0x24')](_0x1b22('0x31'),_0x31a342[_0x1b22('0x32')],_0x31a342[_0x1b22('0x26')]);logger['debug']('[userReport][devicestatechange]',util[_0x1b22('0x1c')](_0x31a342,{'showHidden':![],'depth':null}));if(this[_0x1b22('0xc')][_0x31a342[_0x1b22('0x32')]]){if(!this[_0x1b22('0xc')][_0x31a342[_0x1b22('0x32')]][_0x1b22('0x33')]||_0x31a342[_0x1b22('0x26')]['toLowerCase']()==_0x1b22('0x34')){this[_0x1b22('0xc')][_0x31a342[_0x1b22('0x32')]]['local']=![];if(this[_0x1b22('0xc')][_0x31a342[_0x1b22('0x32')]][_0x1b22('0x26')]!==_0x31a342[_0x1b22('0x26')][_0x1b22('0x35')]()){this['agents'][_0x31a342[_0x1b22('0x32')]]['stateTime']=_['toNumber'](moment()[_0x1b22('0x2d')]('x'));}this[_0x1b22('0xc')][_0x31a342['device']]['state']=_0x31a342[_0x1b22('0x26')][_0x1b22('0x35')]();this[_0x1b22('0xc')][_0x31a342['device']][_0x1b22('0x36')](_0x31a342);}}else if(this[_0x1b22('0xd')][_0x31a342[_0x1b22('0x32')]]){if(this['telephones'][_0x31a342['device']][_0x1b22('0x26')]!==_0x31a342[_0x1b22('0x26')][_0x1b22('0x35')]()){this[_0x1b22('0xd')][_0x31a342[_0x1b22('0x32')]][_0x1b22('0x37')]=_[_0x1b22('0x38')](moment()['format']('x'));}this[_0x1b22('0xd')][_0x31a342[_0x1b22('0x32')]][_0x1b22('0x26')]=_0x31a342[_0x1b22('0x26')][_0x1b22('0x35')]();logger[_0x1b22('0x39')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x1b22('0x1c')](this[_0x1b22('0xd')][_0x31a342[_0x1b22('0x32')]],{'showHidden':![],'depth':null}));this[_0x1b22('0x23')](util[_0x1b22('0x2d')](_0x1b22('0x3a'),this[_0x1b22('0xd')][_0x31a342[_0x1b22('0x32')]][_0x1b22('0x2f')]),_0x1b22('0x3b'),this[_0x1b22('0xd')][_0x31a342[_0x1b22('0x32')]]);}else if(this['trunks'][_0x31a342[_0x1b22('0x32')]]){if(this['trunks'][_0x31a342[_0x1b22('0x32')]][_0x1b22('0x26')]!==_0x31a342[_0x1b22('0x26')][_0x1b22('0x35')]()){this[_0x1b22('0xb')][_0x31a342[_0x1b22('0x32')]][_0x1b22('0x37')]=_[_0x1b22('0x38')](moment()[_0x1b22('0x2d')]('x'));}this[_0x1b22('0xb')][_0x31a342[_0x1b22('0x32')]]['state']=_0x31a342[_0x1b22('0x26')][_0x1b22('0x35')]();logger[_0x1b22('0x39')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util['inspect'](this[_0x1b22('0xb')][_0x31a342[_0x1b22('0x32')]],{'showHidden':![],'depth':null}));this[_0x1b22('0x23')](util[_0x1b22('0x2d')](_0x1b22('0x2e'),this['trunks'][_0x31a342[_0x1b22('0x32')]][_0x1b22('0x2f')]),_0x1b22('0x30'),this[_0x1b22('0xb')][_0x31a342[_0x1b22('0x32')]]);}else if(_[_0x1b22('0x3c')](_0x31a342[_0x1b22('0x32')],_0x1b22('0x3d'))){var _0x2bac3d=_0x31a342['device'];var _0x2c0d8b=_0x2bac3d[_0x1b22('0x3e')](_0x2bac3d[_0x1b22('0x3f')]('/')+0x1,_0x2bac3d[_0x1b22('0x3f')]('@'));var _0x5bb185=_[_0x1b22('0x27')](this[_0x1b22('0xc')],function(_0x3652f9){return _0x3652f9[_0x1b22('0x40')]==_0x2c0d8b||_0x3652f9[_0x1b22('0x41')]==_0x2c0d8b||_0x3652f9[_0x1b22('0x42')]==_0x2c0d8b;});if(_0x5bb185){if(_0x5bb185[_0x1b22('0x26')]!==_0x31a342[_0x1b22('0x26')][_0x1b22('0x35')]()){_0x5bb185['stateTime']=_[_0x1b22('0x38')](moment()[_0x1b22('0x2d')]('x'));}_0x5bb185[_0x1b22('0x26')]=_0x31a342[_0x1b22('0x26')]['toLowerCase']();_0x5bb185[_0x1b22('0x33')]=!![];_0x5bb185[_0x1b22('0x36')](_0x31a342);}}}}catch(_0x537d77){logger[_0x1b22('0x1b')](_0x1b22('0x43'),util[_0x1b22('0x1c')](_0x537d77,{'showHidden':![],'depth':null}));}};UserReport[_0x1b22('0x20')][_0x1b22('0x15')]=function(_0x2441b0){try{if(this[_0x1b22('0x21')](_0x2441b0)&&this[_0x1b22('0x21')](_0x2441b0[_0x1b22('0x14')])){logger[_0x1b22('0x24')](_0x1b22('0x44'),_0x2441b0[_0x1b22('0x45')],_0x2441b0['address'],_0x2441b0[_0x1b22('0x14')]);logger[_0x1b22('0x39')](_0x1b22('0x46'),util[_0x1b22('0x1c')](_0x2441b0,{'showHidden':![],'depth':null}));if(this['agents'][_0x2441b0['peer']]){if(!this[_0x1b22('0xc')][_0x2441b0['peer']][_0x1b22('0x33')]||_0x2441b0[_0x1b22('0x14')][_0x1b22('0x35')]()==_0x1b22('0x47')){this[_0x1b22('0xc')][_0x2441b0[_0x1b22('0x45')]][_0x1b22('0x33')]=![];this[_0x1b22('0xc')][_0x2441b0[_0x1b22('0x45')]][_0x1b22('0x48')]=_0x2441b0[_0x1b22('0x14')][_0x1b22('0x35')]();this[_0x1b22('0xc')][_0x2441b0[_0x1b22('0x45')]][_0x1b22('0x49')]=_0x2441b0[_0x1b22('0x49')];this[_0x1b22('0xc')][_0x2441b0['peer']][_0x1b22('0x36')](_0x2441b0);}}else if(this[_0x1b22('0xd')][_0x2441b0['peer']]){this[_0x1b22('0xd')][_0x2441b0[_0x1b22('0x45')]][_0x1b22('0x48')]=_0x2441b0['peerstatus'][_0x1b22('0x35')]();this[_0x1b22('0xd')][_0x2441b0[_0x1b22('0x45')]]['address']=_0x2441b0[_0x1b22('0x49')];logger[_0x1b22('0x39')](_0x1b22('0x4a'),util[_0x1b22('0x1c')](this[_0x1b22('0xd')][_0x2441b0[_0x1b22('0x45')]],{'showHidden':![],'depth':null}));this[_0x1b22('0x23')](util[_0x1b22('0x2d')](_0x1b22('0x3a'),this['telephones'][_0x2441b0[_0x1b22('0x45')]][_0x1b22('0x2f')]),_0x1b22('0x3b'),this[_0x1b22('0xd')][_0x2441b0[_0x1b22('0x45')]]);}else if(this['trunks'][_0x2441b0[_0x1b22('0x45')]]){this[_0x1b22('0xb')][_0x2441b0[_0x1b22('0x45')]][_0x1b22('0x48')]=_0x2441b0[_0x1b22('0x14')][_0x1b22('0x35')]();this[_0x1b22('0xb')][_0x2441b0[_0x1b22('0x45')]][_0x1b22('0x49')]=_0x2441b0['address'];logger[_0x1b22('0x39')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x1b22('0x1c')](this['trunks'][_0x2441b0[_0x1b22('0x45')]],{'showHidden':![],'depth':null}));this[_0x1b22('0x23')](util[_0x1b22('0x2d')](_0x1b22('0x2e'),this[_0x1b22('0xb')][_0x2441b0[_0x1b22('0x45')]]['name']),'trunk:save',this[_0x1b22('0xb')][_0x2441b0[_0x1b22('0x45')]]);}}}catch(_0x51738d){logger[_0x1b22('0x1b')](_0x1b22('0x46'),util['inspect'](_0x51738d,{'showHidden':![],'depth':null}));}};module[_0x1b22('0x4b')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index cb5e62f..597eaa7 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4e1=['inspect','interface','queue','format','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','inbound','voice','omit','event','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','emit','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:called','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','merge','pick','destconnectedlinenum','exten','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','agentringnoanswerAt','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','name','user:agentringnoanswer','custom:agentringnoanswer','assign','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:%s','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','variable','keys','value','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','syncBlindTransfer','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','lodash','moment','util','../../../config/environment','defaults','localhost','socket.io-emitter','redis','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','prototype','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:'];(function(_0x533d7b,_0x3ce49d){var _0x3818fd=function(_0x59ebdf){while(--_0x59ebdf){_0x533d7b['push'](_0x533d7b['shift']());}};_0x3818fd(++_0x3ce49d);}(_0xb4e1,0x1b3));var _0x1b4e=function(_0x35b336,_0x347d1c){_0x35b336=_0x35b336-0x0;var _0x51d28c=_0xb4e1[_0x35b336];return _0x51d28c;};'use strict';var _=require(_0x1b4e('0x0'));var moment=require(_0x1b4e('0x1'));var util=require(_0x1b4e('0x2'));var Redis=require('ioredis');var config=require(_0x1b4e('0x3'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');config['redis']=_[_0x1b4e('0x4')](config['redis'],{'host':_0x1b4e('0x5'),'port':0x18eb});var io=require(_0x1b4e('0x6'))(new Redis(config[_0x1b4e('0x7')]));function VoiceAgentReport(_0x4a69eb){this[_0x1b4e('0x8')]={};this[_0x1b4e('0x9')]=_0x4a69eb[_0x1b4e('0x8')];this[_0x1b4e('0xa')]=_0x4a69eb[_0x1b4e('0xa')];this['agents']=_0x4a69eb[_0x1b4e('0xb')];this[_0x1b4e('0xc')]={};ami['on'](_0x1b4e('0xd'),this[_0x1b4e('0xe')]['bind'](this));ami['on'](_0x1b4e('0xf'),this['syncAgentConnect'][_0x1b4e('0x10')](this));ami['on'](_0x1b4e('0x11'),this[_0x1b4e('0x12')][_0x1b4e('0x10')](this));ami['on'](_0x1b4e('0x13'),this[_0x1b4e('0x14')][_0x1b4e('0x10')](this));ami['on'](_0x1b4e('0x15'),this[_0x1b4e('0x16')]['bind'](this));ami['on'](_0x1b4e('0x17'),this[_0x1b4e('0x18')][_0x1b4e('0x10')](this));ami['on'](_0x1b4e('0x19'),this[_0x1b4e('0x1a')][_0x1b4e('0x10')](this));ami['on'](_0x1b4e('0x1b'),this['syncMusicOnHoldStart'][_0x1b4e('0x10')](this));ami['on'](_0x1b4e('0x1c'),this[_0x1b4e('0x1d')][_0x1b4e('0x10')](this));ami['on'](_0x1b4e('0x1e'),this['syncAttendedTransfer'][_0x1b4e('0x10')](this));ami['on'](_0x1b4e('0x1f'),this['syncBlindTransfer'][_0x1b4e('0x10')](this));}VoiceAgentReport[_0x1b4e('0x20')]['emit']=function(_0x3766fb,_0x54aefa,_0x309ec3){io['to'](_0x3766fb)['emit'](_0x54aefa,_0x309ec3);};VoiceAgentReport['prototype'][_0x1b4e('0x21')]=function(_0x2d23ac){return _0x2d23ac!==null&&!_[_0x1b4e('0x22')](_0x2d23ac);};VoiceAgentReport[_0x1b4e('0x20')][_0x1b4e('0xe')]=function(_0x4ab303){try{if(this['isNotNull'](_0x4ab303)){logger[_0x1b4e('0x23')](_0x1b4e('0x24'),_0x4ab303[_0x1b4e('0x25')],_0x4ab303[_0x1b4e('0x26')],_0x4ab303[_0x1b4e('0x27')]);logger[_0x1b4e('0x28')](_0x1b4e('0x29'),_0x4ab303[_0x1b4e('0x25')],util[_0x1b4e('0x2a')](_0x4ab303,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['channels'][_0x4ab303[_0x1b4e('0x25')]])){this[_0x1b4e('0x8')][_0x4ab303[_0x1b4e('0x25')]]={};}var _0x1d25d0=this['agents'][_0x4ab303[_0x1b4e('0x2b')]];var _0x2ad326=this[_0x1b4e('0x8')][_0x4ab303[_0x1b4e('0x25')]][_0x4ab303['destuniqueid']];var _0x15c6fd=this['voiceQueues'][_0x4ab303[_0x1b4e('0x2c')]];var _0x2debc5=this[_0x1b4e('0xc')][_0x4ab303[_0x1b4e('0x25')]];if(_[_0x1b4e('0x22')](_0x2ad326)){_0x2ad326={'agentcalledAt':moment()[_0x1b4e('0x2d')](_0x1b4e('0x2e')),'lastevent':_0x1b4e('0x2f'),'mandatoryDisposition':_0x15c6fd&&_0x15c6fd[_0x1b4e('0x30')]?_0x15c6fd[_0x1b4e('0x30')]:![],'type':_0x15c6fd&&_0x15c6fd['type']?_0x15c6fd['type']:_0x1b4e('0x31'),'variables':_0x2debc5,'motionChannel':_0x1b4e('0x32')};}Object['assign'](_0x2ad326,_[_0x1b4e('0x33')](_0x4ab303,[_0x1b4e('0x34'),'privilege']));this[_0x1b4e('0x8')][_0x4ab303['uniqueid']][_0x4ab303[_0x1b4e('0x27')]]=_0x2ad326;logger[_0x1b4e('0x28')](_0x1b4e('0x35'),_0x4ab303[_0x1b4e('0x25')],util[_0x1b4e('0x2a')](_0x2ad326,{'showHidden':![],'depth':null}));ami[_0x1b4e('0x36')](_0x1b4e('0x37'),_0x2ad326);var _0x1a574e={'id':_0x1d25d0['id'],'calleridnum':_0x2ad326[_0x1b4e('0x38')],'queue':_0x2ad326[_0x1b4e('0x2c')],'variables':_0x2ad326[_0x1b4e('0xc')],'uniqueid':_0x4ab303[_0x1b4e('0x25')]};logger[_0x1b4e('0x28')](_0x1b4e('0x39'),_0x4ab303['uniqueid'],util[_0x1b4e('0x2a')](_0x1a574e,{'showHidden':![],'depth':null}));this[_0x1b4e('0x36')](util[_0x1b4e('0x2d')]('user:%s',_0x4ab303[_0x1b4e('0x26')]),_0x1b4e('0x3a'),_0x1a574e);}}catch(_0x51a464){logger[_0x1b4e('0x3b')](_0x1b4e('0x3c'),_0x4ab303[_0x1b4e('0x25')],util[_0x1b4e('0x2a')](_0x51a464,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1b4e('0x20')][_0x1b4e('0x3d')]=function(_0x53a423){try{if(this[_0x1b4e('0x21')](_0x53a423)){if(this[_0x1b4e('0x8')][_0x53a423[_0x1b4e('0x25')]]){for(var _0x12bf08 in this[_0x1b4e('0x8')][_0x53a423[_0x1b4e('0x25')]]){if(this[_0x1b4e('0x8')][_0x53a423['uniqueid']][_0x1b4e('0x3e')](_0x12bf08)){if(_0x53a423['destuniqueid']===_0x12bf08){logger[_0x1b4e('0x23')](_0x1b4e('0x3f'),_0x53a423[_0x1b4e('0x25')],_0x53a423['membername'],_0x53a423[_0x1b4e('0x27')]);this[_0x1b4e('0x8')][_0x53a423[_0x1b4e('0x25')]][_0x12bf08][_0x1b4e('0x40')]=moment()['format'](_0x1b4e('0x2e'));this[_0x1b4e('0x8')][_0x53a423[_0x1b4e('0x25')]][_0x12bf08]['connectedlinename']=_0x53a423[_0x1b4e('0x41')];this[_0x1b4e('0x8')][_0x53a423[_0x1b4e('0x25')]][_0x12bf08][_0x1b4e('0x42')]=_0x53a423[_0x1b4e('0x42')];this['channels'][_0x53a423[_0x1b4e('0x25')]][_0x12bf08]['destchannelstate']=_0x53a423[_0x1b4e('0x43')];this[_0x1b4e('0x8')][_0x53a423['uniqueid']][_0x12bf08][_0x1b4e('0x44')]=_0x53a423['destchannelstatedesc'];this[_0x1b4e('0x8')][_0x53a423['uniqueid']][_0x12bf08][_0x1b4e('0x45')]=_0x53a423['holdtime'];this['channels'][_0x53a423[_0x1b4e('0x25')]][_0x12bf08][_0x1b4e('0x46')]=_0x1b4e('0x47');if(this[_0x1b4e('0x9')][this[_0x1b4e('0x8')][_0x53a423[_0x1b4e('0x25')]][_0x12bf08]['uniqueid']]){var _0x9d21ac=this['voiceChannels'][this['channels'][_0x53a423['uniqueid']][_0x12bf08][_0x1b4e('0x25')]][_0x1b4e('0x48')];this['channels'][_0x53a423[_0x1b4e('0x25')]][_0x12bf08][_0x1b4e('0x48')]=_0x9d21ac;_0x53a423[_0x1b4e('0x48')]=_0x9d21ac;}_[_0x1b4e('0x49')](this['agents'][_0x53a423['interface']],_[_0x1b4e('0x4a')](_0x53a423,[_0x1b4e('0x2c'),_0x1b4e('0x4b'),_0x1b4e('0x48')]));var _0x5414e9=this[_0x1b4e('0xb')][_0x53a423[_0x1b4e('0x2b')]];var _0x4b4213={'id':_0x5414e9['id'],'name':_0x5414e9['name'],'agentconnected':!![],'destaccountcode':_0x5414e9['accountcode'],'destconnectedlinenum':this[_0x1b4e('0x8')][_0x53a423[_0x1b4e('0x25')]][_0x53a423[_0x1b4e('0x27')]][_0x1b4e('0x4c')],'queue':this['channels'][_0x53a423[_0x1b4e('0x25')]][_0x53a423['destuniqueid']]['queue'],'routealias':this[_0x1b4e('0x8')][_0x53a423[_0x1b4e('0x25')]][_0x53a423['destuniqueid']]['routealias'],'uniqueid':this[_0x1b4e('0x8')][_0x53a423['uniqueid']][_0x53a423[_0x1b4e('0x27')]][_0x1b4e('0x25')]};ami[_0x1b4e('0x36')]('custom:agentconnect',this[_0x1b4e('0x8')][_0x53a423[_0x1b4e('0x25')]][_0x53a423['destuniqueid']]);this['emit'](util[_0x1b4e('0x2d')]('user:%s',_0x53a423['membername']),_0x1b4e('0x4d'),_0x4b4213);}else if(!this[_0x1b4e('0x8')][_0x53a423[_0x1b4e('0x25')]][_0x12bf08][_0x1b4e('0x11')]&&!this['channels'][_0x53a423[_0x1b4e('0x25')]][_0x12bf08][_0x1b4e('0x15')]){logger['info'](_0x1b4e('0x4e'),_0x53a423[_0x1b4e('0x25')],this['channels'][_0x53a423[_0x1b4e('0x25')]][_0x12bf08][_0x1b4e('0x26')],_0x12bf08);this[_0x1b4e('0x8')][_0x53a423[_0x1b4e('0x25')]][_0x12bf08][_0x1b4e('0x11')]=!![];this[_0x1b4e('0x8')][_0x53a423[_0x1b4e('0x25')]][_0x12bf08]['agentringnoanswerAt']=moment()[_0x1b4e('0x2d')](_0x1b4e('0x2e'));this[_0x1b4e('0x8')][_0x53a423[_0x1b4e('0x25')]][_0x12bf08][_0x1b4e('0x4f')]=_0x53a423['destuniqueid'];this[_0x1b4e('0x8')][_0x53a423[_0x1b4e('0x25')]][_0x12bf08][_0x1b4e('0x50')]=_0x53a423[_0x1b4e('0x26')];this['channels'][_0x53a423['uniqueid']][_0x12bf08]['lastevent']=_0x1b4e('0x51');this[_0x1b4e('0x8')][_0x53a423[_0x1b4e('0x25')]][_0x12bf08][_0x1b4e('0x52')]=_0x1b4e('0x51');logger[_0x1b4e('0x28')](_0x1b4e('0x53'),_0x53a423[_0x1b4e('0x25')],util[_0x1b4e('0x2a')](this[_0x1b4e('0x8')][_0x53a423[_0x1b4e('0x25')]][_0x12bf08],{'showHidden':![],'depth':null}));ami[_0x1b4e('0x36')](_0x1b4e('0x54'),this[_0x1b4e('0x8')][_0x53a423[_0x1b4e('0x25')]][_0x12bf08]);}else{logger[_0x1b4e('0x28')](_0x1b4e('0x55'),_0x53a423[_0x1b4e('0x25')]);}}}}}}catch(_0x397aea){logger[_0x1b4e('0x3b')](_0x1b4e('0x56'),_0x53a423[_0x1b4e('0x25')],util[_0x1b4e('0x2a')](_0x397aea,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1b4e('0x20')][_0x1b4e('0x12')]=function(_0x46007c){try{if(this['isNotNull'](_0x46007c)){logger['debug'](_0x1b4e('0x57'),_0x46007c[_0x1b4e('0x25')],util['inspect'](_0x46007c,{'showHidden':![],'depth':null}));if(this['channels'][_0x46007c['uniqueid']]&&this[_0x1b4e('0x8')][_0x46007c['uniqueid']][_0x46007c[_0x1b4e('0x27')]]){logger['info']('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x46007c[_0x1b4e('0x25')],_0x46007c['membername'],_0x46007c[_0x1b4e('0x27')]);var _0x41ae3d=this[_0x1b4e('0xb')][_0x46007c[_0x1b4e('0x2b')]];var _0x99c921=this[_0x1b4e('0x8')][_0x46007c['uniqueid']][_0x46007c['destuniqueid']];_0x99c921[_0x1b4e('0x11')]=!![];_0x99c921[_0x1b4e('0x58')]=moment()[_0x1b4e('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');_0x99c921[_0x1b4e('0x46')]='rejected';_0x99c921[_0x1b4e('0x52')]=_0x1b4e('0x59');var _0xb21d4={'id':_0x41ae3d['id'],'name':_0x41ae3d['name'],'queue':_0x99c921['queue'],'uniqueid':_0x99c921[_0x1b4e('0x25')]};logger[_0x1b4e('0x28')](_0x1b4e('0x5a'),_0x46007c[_0x1b4e('0x25')],util[_0x1b4e('0x2a')](_0xb21d4,{'showHidden':![],'depth':null}));this[_0x1b4e('0x36')](util[_0x1b4e('0x2d')]('user:%s',_0x41ae3d[_0x1b4e('0x5b')]),_0x1b4e('0x5c'),_0xb21d4);ami[_0x1b4e('0x36')](_0x1b4e('0x5d'),_0x99c921);this[_0x1b4e('0x8')][_0x46007c[_0x1b4e('0x25')]][_0x46007c[_0x1b4e('0x27')]]=Object[_0x1b4e('0x5e')]({},_0x99c921);}}}catch(_0x49963a){logger[_0x1b4e('0x3b')](_0x1b4e('0x5f'),_0x46007c[_0x1b4e('0x25')],util['inspect'](_0x49963a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x1b4e('0x14')]=function(_0xec09ca){try{if(this['isNotNull'](_0xec09ca)){logger['debug'](_0x1b4e('0x60'),_0xec09ca[_0x1b4e('0x25')],util[_0x1b4e('0x2a')](_0xec09ca,{'showHidden':![],'depth':null}));if(this['channels'][_0xec09ca['uniqueid']]){for(var _0x3dab4f in this['channels'][_0xec09ca[_0x1b4e('0x25')]]){if(this['channels'][_0xec09ca[_0x1b4e('0x25')]][_0x1b4e('0x3e')](_0x3dab4f)&&!this[_0x1b4e('0x8')][_0xec09ca[_0x1b4e('0x25')]][_0x3dab4f][_0x1b4e('0x11')]&&!this[_0x1b4e('0x8')][_0xec09ca['uniqueid']][_0x3dab4f][_0x1b4e('0x15')]){logger[_0x1b4e('0x23')](_0x1b4e('0x61'),_0xec09ca['uniqueid'],this[_0x1b4e('0x8')][_0xec09ca[_0x1b4e('0x25')]][_0x3dab4f]['membername'],_0x3dab4f);this[_0x1b4e('0x8')][_0xec09ca[_0x1b4e('0x25')]][_0x3dab4f][_0x1b4e('0x11')]=!![];this['channels'][_0xec09ca[_0x1b4e('0x25')]][_0x3dab4f][_0x1b4e('0x58')]=moment()['format'](_0x1b4e('0x2e'));this['channels'][_0xec09ca['uniqueid']][_0x3dab4f][_0x1b4e('0x46')]=_0x1b4e('0x62');this[_0x1b4e('0x8')][_0xec09ca[_0x1b4e('0x25')]][_0x3dab4f]['reason']=_0x1b4e('0x62');logger['debug'](_0x1b4e('0x63'),_0xec09ca['uniqueid'],util['inspect'](this[_0x1b4e('0x8')][_0xec09ca[_0x1b4e('0x25')]][_0x3dab4f],{'showHidden':![],'depth':null}));ami['emit'](_0x1b4e('0x64'),this['channels'][_0xec09ca[_0x1b4e('0x25')]][_0x3dab4f]);}}}}}catch(_0x59aac0){logger[_0x1b4e('0x3b')](_0x1b4e('0x65'),_0xec09ca[_0x1b4e('0x25')],util[_0x1b4e('0x2a')](_0x59aac0,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentComplete']=function(_0x582743){try{if(this[_0x1b4e('0x21')](_0x582743)){logger[_0x1b4e('0x28')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x582743['uniqueid'],util[_0x1b4e('0x2a')](_0x582743,{'showHidden':![],'depth':null}));if(this['channels'][_0x582743[_0x1b4e('0x25')]]){for(var _0x23c82a in this['channels'][_0x582743[_0x1b4e('0x25')]]){if(this[_0x1b4e('0x8')][_0x582743[_0x1b4e('0x25')]][_0x1b4e('0x3e')](_0x23c82a)){if(this[_0x1b4e('0x8')][_0x582743[_0x1b4e('0x25')]][_0x23c82a][_0x1b4e('0x40')]&&!this['channels'][_0x582743[_0x1b4e('0x25')]][_0x23c82a][_0x1b4e('0x15')]){logger['info'](_0x1b4e('0x66'),_0x582743[_0x1b4e('0x25')],this['channels'][_0x582743['uniqueid']][_0x23c82a][_0x1b4e('0x26')],_0x23c82a);this[_0x1b4e('0x8')][_0x582743[_0x1b4e('0x25')]][_0x23c82a][_0x1b4e('0x15')]=!![];this[_0x1b4e('0x8')][_0x582743[_0x1b4e('0x25')]][_0x23c82a][_0x1b4e('0x67')]=moment()[_0x1b4e('0x2d')](_0x1b4e('0x2e'));this[_0x1b4e('0x8')][_0x582743[_0x1b4e('0x25')]][_0x23c82a][_0x1b4e('0x46')]=_0x1b4e('0x68');this[_0x1b4e('0x8')][_0x582743[_0x1b4e('0x25')]][_0x23c82a][_0x1b4e('0x52')]=_0x582743[_0x1b4e('0x52')]==_0x1b4e('0x69')?_0x1b4e('0x6a'):_0x582743[_0x1b4e('0x52')];this[_0x1b4e('0x8')][_0x582743['uniqueid']][_0x23c82a][_0x1b4e('0x6b')]=_0x582743['talktime'];if(this['voiceQueues'][_0x582743[_0x1b4e('0x2c')]]&&this[_0x1b4e('0xa')][_0x582743[_0x1b4e('0x2c')]][_0x1b4e('0x6c')]){this[_0x1b4e('0x8')][_0x582743[_0x1b4e('0x25')]][_0x23c82a][_0x1b4e('0x6d')]=this[_0x1b4e('0xa')][_0x582743['queue']]['acwTimeout'];this['channels'][_0x582743['uniqueid']][_0x23c82a]['agentacw']=!![];}this[_0x1b4e('0xb')][_0x582743[_0x1b4e('0x2b')]]=_['omit'](this[_0x1b4e('0xb')][_0x582743[_0x1b4e('0x2b')]],[_0x1b4e('0x2c'),_0x1b4e('0x4b')]);logger['debug']('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x582743[_0x1b4e('0x25')],util[_0x1b4e('0x2a')](this[_0x1b4e('0x8')][_0x582743[_0x1b4e('0x25')]][_0x23c82a],{'showHidden':![],'depth':null}));ami[_0x1b4e('0x36')]('custom:agentcomplete',this[_0x1b4e('0x8')][_0x582743[_0x1b4e('0x25')]][_0x23c82a]);logger[_0x1b4e('0x28')](_0x1b4e('0x6e'),_0x582743[_0x1b4e('0x25')],util[_0x1b4e('0x2a')]({'id':this[_0x1b4e('0xb')][_0x582743[_0x1b4e('0x2b')]]['id'],'destaccountcode':_0x582743[_0x1b4e('0x6f')]},{'showHidden':![],'depth':null}));this[_0x1b4e('0x36')](util['format'](_0x1b4e('0x70'),_0x582743[_0x1b4e('0x26')]),_0x1b4e('0x71'),{'id':this[_0x1b4e('0xb')][_0x582743['interface']]['id'],'destaccountcode':Number(_0x582743[_0x1b4e('0x6f')])});}}}}}}catch(_0x4c20f5){logger[_0x1b4e('0x3b')]('[%s][voiceAgentReport][agentcomplete]',_0x582743[_0x1b4e('0x25')],util['inspect'](_0x4c20f5,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x1b4e('0x18')]=function(_0x5ddd4d){try{if(this['isNotNull'](_0x5ddd4d)){logger['debug'](_0x1b4e('0x72'),_0x5ddd4d[_0x1b4e('0x25')],util[_0x1b4e('0x2a')](_0x5ddd4d,{'showHidden':![],'depth':null}));this['addVariable'](_0x5ddd4d[_0x1b4e('0x25')],_['keys'](_0x5ddd4d[_0x1b4e('0x73')])[0x0],_0x5ddd4d['value']);if(this[_0x1b4e('0x8')][_0x5ddd4d[_0x1b4e('0x25')]]){for(var _0x31dfd6 in this['channels'][_0x5ddd4d[_0x1b4e('0x25')]]){if(this['channels'][_0x5ddd4d[_0x1b4e('0x25')]]['hasOwnProperty'](_0x31dfd6)){logger[_0x1b4e('0x23')]('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x5ddd4d[_0x1b4e('0x25')],_0x31dfd6,_[_0x1b4e('0x74')](_0x5ddd4d[_0x1b4e('0x73')])[0x0],_0x5ddd4d[_0x1b4e('0x75')]);if(_[_0x1b4e('0x22')](this[_0x1b4e('0x8')][_0x5ddd4d['uniqueid']][_0x31dfd6][_0x1b4e('0xc')])){this[_0x1b4e('0x8')][_0x5ddd4d[_0x1b4e('0x25')]][_0x31dfd6][_0x1b4e('0xc')]={};}this['channels'][_0x5ddd4d[_0x1b4e('0x25')]][_0x31dfd6]['variables']=this[_0x1b4e('0xc')][_0x5ddd4d[_0x1b4e('0x25')]];}}}}}catch(_0x3dce3f){logger['error'](_0x1b4e('0x76'),_0x5ddd4d[_0x1b4e('0x25')],util['inspect'](_0x3dce3f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1b4e('0x20')]['addVariable']=function(_0x2054a3,_0x4206b2,_0x1eaa16){var _0x3d686d=[_0x1b4e('0x77'),_0x1b4e('0x78'),_0x1b4e('0x79'),'rtpaudioqosjitterbridged',_0x1b4e('0x7a'),_0x1b4e('0x7b'),_0x1b4e('0x7c'),_0x1b4e('0x7d'),'sipcallid',_0x1b4e('0x7e'),_0x1b4e('0x7f'),'bridgepvtcallid',_0x1b4e('0x80'),_0x1b4e('0x81'),_0x1b4e('0x82'),_0x1b4e('0x83'),'membername',_0x1b4e('0x84'),'memberrealtime'];if(!_['isNil'](_0x4206b2)&&!_[_0x1b4e('0x85')](_0x3d686d,_0x4206b2)){if(_[_0x1b4e('0x22')](this['variables'][_0x2054a3])){this[_0x1b4e('0xc')][_0x2054a3]={};}this[_0x1b4e('0xc')][_0x2054a3][_0x4206b2]=_0x1eaa16;}};VoiceAgentReport[_0x1b4e('0x20')][_0x1b4e('0x1a')]=function(_0x9190d9){try{if(this[_0x1b4e('0x21')](_0x9190d9)){logger[_0x1b4e('0x28')](_0x1b4e('0x86'),_0x9190d9[_0x1b4e('0x25')],util['inspect'](_0x9190d9,{'showHidden':![],'depth':null}));if(this['channels'][_0x9190d9[_0x1b4e('0x25')]]){for(var _0x4c8057 in this[_0x1b4e('0x8')][_0x9190d9[_0x1b4e('0x25')]]){if(this[_0x1b4e('0x8')][_0x9190d9[_0x1b4e('0x25')]][_0x1b4e('0x3e')](_0x4c8057)){if(this[_0x1b4e('0x8')][_0x9190d9[_0x1b4e('0x25')]][_0x4c8057][_0x1b4e('0x52')]==_0x1b4e('0x69')&&this['channels'][_0x9190d9[_0x1b4e('0x25')]][_0x4c8057]['agentcomplete']){logger[_0x1b4e('0x23')](_0x1b4e('0x87'),_0x9190d9[_0x1b4e('0x25')],_0x4c8057);this['channels'][_0x9190d9[_0x1b4e('0x25')]][_0x4c8057][_0x1b4e('0x67')]=moment()[_0x1b4e('0x2d')](_0x1b4e('0x2e'));}}}logger[_0x1b4e('0x28')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x9190d9[_0x1b4e('0x25')],util[_0x1b4e('0x2a')](_[_0x1b4e('0x88')](this['channels'][_0x9190d9[_0x1b4e('0x25')]]),{'showHidden':![],'depth':null}));ami[_0x1b4e('0x36')](_0x1b4e('0x89'),_[_0x1b4e('0x88')](this[_0x1b4e('0x8')][_0x9190d9['uniqueid']]));delete this[_0x1b4e('0x8')][_0x9190d9[_0x1b4e('0x25')]];}if(this['variables'][_0x9190d9[_0x1b4e('0x25')]]){delete this[_0x1b4e('0xc')][_0x9190d9[_0x1b4e('0x25')]];}}}catch(_0x5ece15){logger['error'](_0x1b4e('0x8a'),_0x9190d9[_0x1b4e('0x25')],util['inspect'](_0x5ece15,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1b4e('0x20')]['syncAttendedTransfer']=function(_0x2c1bfe){try{if(this[_0x1b4e('0x21')](_0x2c1bfe)){logger[_0x1b4e('0x28')](_0x1b4e('0x8b'),_0x2c1bfe['uniqueid'],util[_0x1b4e('0x2a')](_0x2c1bfe,{'showHidden':![],'depth':null}));if(this[_0x1b4e('0x8')][_0x2c1bfe[_0x1b4e('0x8c')]]){for(var _0x2afc1f in this['channels'][_0x2c1bfe[_0x1b4e('0x8c')]]){if(this['channels'][_0x2c1bfe[_0x1b4e('0x8c')]][_0x1b4e('0x3e')](_0x2afc1f)){if(_0x2c1bfe[_0x1b4e('0x8d')]===_0x2afc1f){logger[_0x1b4e('0x23')](_0x1b4e('0x8e'),_0x2c1bfe[_0x1b4e('0x25')],this[_0x1b4e('0x8')][_0x2c1bfe[_0x1b4e('0x8c')]][_0x2afc1f][_0x1b4e('0x26')],_0x2afc1f);var _0x2cc466=moment();this['channels'][_0x2c1bfe[_0x1b4e('0x8c')]][_0x2afc1f]['agentcomplete']=!![];this['channels'][_0x2c1bfe[_0x1b4e('0x8c')]][_0x2afc1f][_0x1b4e('0x67')]=moment()[_0x1b4e('0x2d')](_0x1b4e('0x2e'));this[_0x1b4e('0x8')][_0x2c1bfe[_0x1b4e('0x8c')]][_0x2afc1f][_0x1b4e('0x46')]=_0x1b4e('0x68');this[_0x1b4e('0x8')][_0x2c1bfe[_0x1b4e('0x8c')]][_0x2afc1f]['reason']=_0x1b4e('0x69');this[_0x1b4e('0x8')][_0x2c1bfe[_0x1b4e('0x8c')]][_0x2afc1f][_0x1b4e('0x6b')]=_0x2cc466[_0x1b4e('0x8f')](this[_0x1b4e('0x8')][_0x2c1bfe[_0x1b4e('0x8c')]][_0x2afc1f][_0x1b4e('0x40')],'seconds');}}}}if(this[_0x1b4e('0x8')][_0x2c1bfe[_0x1b4e('0x90')]]){var _0xe21cad=this[_0x1b4e('0x8')][_0x2c1bfe[_0x1b4e('0x90')]];this[_0x1b4e('0x8')][_0x2c1bfe[_0x1b4e('0x90')]]=this[_0x1b4e('0x8')][_0x2c1bfe[_0x1b4e('0x8c')]];this[_0x1b4e('0x8')][_0x2c1bfe['transfereeuniqueid']]=_0xe21cad;}}}catch(_0x37c4e9){logger[_0x1b4e('0x3b')](_0x1b4e('0x91'),_0x2c1bfe[_0x1b4e('0x25')],util[_0x1b4e('0x2a')](_0x37c4e9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1b4e('0x20')][_0x1b4e('0x92')]=function(_0x14b0c4){try{if(this[_0x1b4e('0x21')](_0x14b0c4)){logger[_0x1b4e('0x28')](_0x1b4e('0x93'),_0x14b0c4['uniqueid'],util[_0x1b4e('0x2a')](_0x14b0c4,{'showHidden':![],'depth':null}));if(this[_0x1b4e('0x8')][_0x14b0c4[_0x1b4e('0x8c')]]){for(var _0x1290fd in this['channels'][_0x14b0c4['transfereeuniqueid']]){if(this[_0x1b4e('0x8')][_0x14b0c4[_0x1b4e('0x8c')]]['hasOwnProperty'](_0x1290fd)){if(_0x14b0c4[_0x1b4e('0x94')]===_0x1290fd){logger[_0x1b4e('0x23')](_0x1b4e('0x95'),_0x14b0c4[_0x1b4e('0x25')],this[_0x1b4e('0x8')][_0x14b0c4[_0x1b4e('0x8c')]][_0x1290fd][_0x1b4e('0x26')],_0x1290fd);var _0x530c4c=moment();this[_0x1b4e('0x8')][_0x14b0c4[_0x1b4e('0x8c')]][_0x1290fd][_0x1b4e('0x15')]=!![];this[_0x1b4e('0x8')][_0x14b0c4[_0x1b4e('0x8c')]][_0x1290fd][_0x1b4e('0x67')]=_0x530c4c;this['channels'][_0x14b0c4[_0x1b4e('0x8c')]][_0x1290fd]['lastevent']='complete';this[_0x1b4e('0x8')][_0x14b0c4[_0x1b4e('0x8c')]][_0x1290fd][_0x1b4e('0x52')]=_0x1b4e('0x69');this[_0x1b4e('0x8')][_0x14b0c4[_0x1b4e('0x8c')]][_0x1290fd][_0x1b4e('0x6b')]=_0x530c4c[_0x1b4e('0x8f')](this['channels'][_0x14b0c4[_0x1b4e('0x8c')]][_0x1290fd][_0x1b4e('0x40')],_0x1b4e('0x96'));}}}}}}catch(_0xa5ebbe){logger[_0x1b4e('0x3b')]('[%s][voiceAgentReport][blindtransfer]',_0x14b0c4['uniqueid'],util[_0x1b4e('0x2a')](_0xa5ebbe,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1b4e('0x20')]['syncMusicOnHoldStart']=function(_0x1c86f4){var _0x2df4a9='';try{if(this[_0x1b4e('0x21')](_0x1c86f4)){logger[_0x1b4e('0x28')](_0x1b4e('0x97'),_0x1c86f4[_0x1b4e('0x25')],util[_0x1b4e('0x2a')](_0x1c86f4,{'showHidden':![],'depth':null}));if(_0x1c86f4[_0x1b4e('0x98')]){_0x2df4a9=_0x1c86f4[_0x1b4e('0x98')][_0x1b4e('0x99')](0x0,_0x1c86f4[_0x1b4e('0x98')][_0x1b4e('0x9a')]('-'));if(this[_0x1b4e('0xb')][_0x2df4a9]){logger[_0x1b4e('0x23')](_0x1b4e('0x9b'),_0x1c86f4[_0x1b4e('0x25')],_0x2df4a9);this[_0x1b4e('0xb')][_0x2df4a9][_0x1b4e('0x9c')]=!![];}}}}catch(_0x2fcb51){logger[_0x1b4e('0x3b')](_0x1b4e('0x9d'),_0x1c86f4[_0x1b4e('0x25')],util[_0x1b4e('0x2a')](_0x2fcb51,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1b4e('0x20')]['syncMusicOnHoldStop']=function(_0x4a06bf){var _0x2a8a53='';try{if(this[_0x1b4e('0x21')](_0x4a06bf)){logger[_0x1b4e('0x28')](_0x1b4e('0x9e'),_0x4a06bf['uniqueid'],util[_0x1b4e('0x2a')](_0x4a06bf,{'showHidden':![],'depth':null}));if(_0x4a06bf['channel']){_0x2a8a53=_0x4a06bf[_0x1b4e('0x98')][_0x1b4e('0x99')](0x0,_0x4a06bf[_0x1b4e('0x98')][_0x1b4e('0x9a')]('-'));if(this['agents'][_0x2a8a53]){logger[_0x1b4e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x4a06bf[_0x1b4e('0x25')],_0x2a8a53);this[_0x1b4e('0xb')][_0x2a8a53][_0x1b4e('0x9c')]=![];}}}}catch(_0x4ad5ff){logger[_0x1b4e('0x3b')]('[%s][voiceAgentReport][musiconholdstop]',_0x4a06bf[_0x1b4e('0x25')],util['inspect'](_0x4ad5ff,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xcd66=['custom:agentconnect','user:%s','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','lastevent','answered_elsewhere','reason','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','agentringnoanswerAt','rejected','user:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','agentconnectAt','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','omit','destconnectedlinenum','custom:agentcomplete','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','variable','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','syncHangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncBlindTransfer','prototype','emit','isUndefined','isNotNull','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','interface','destuniqueid','queue','YYYY-MM-DD\x20HH:mm:ss','type','inbound','assign','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','membername','user:called','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','routealias','name','accountcode','exten'];(function(_0x1b276c,_0x35a2d7){var _0x207d26=function(_0x46a67f){while(--_0x46a67f){_0x1b276c['push'](_0x1b276c['shift']());}};_0x207d26(++_0x35a2d7);}(_0xcd66,0xf5));var _0x6cd6=function(_0x512ea6,_0x162f52){_0x512ea6=_0x512ea6-0x0;var _0x52ef29=_0xcd66[_0x512ea6];return _0x52ef29;};'use strict';var _=require(_0x6cd6('0x0'));var moment=require(_0x6cd6('0x1'));var util=require(_0x6cd6('0x2'));var Redis=require(_0x6cd6('0x3'));var config=require(_0x6cd6('0x4'));var logger=require(_0x6cd6('0x5'))(_0x6cd6('0x6'));var ami=require(_0x6cd6('0x7'));config[_0x6cd6('0x8')]=_['defaults'](config[_0x6cd6('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x6cd6('0x9'))(new Redis(config['redis']));function VoiceAgentReport(_0xbd5dab){this[_0x6cd6('0xa')]={};this[_0x6cd6('0xb')]=_0xbd5dab[_0x6cd6('0xa')];this[_0x6cd6('0xc')]=_0xbd5dab['voiceQueues'];this[_0x6cd6('0xd')]=_0xbd5dab[_0x6cd6('0xd')];this[_0x6cd6('0xe')]={};ami['on'](_0x6cd6('0xf'),this[_0x6cd6('0x10')][_0x6cd6('0x11')](this));ami['on']('agentconnect',this['syncAgentConnect'][_0x6cd6('0x11')](this));ami['on'](_0x6cd6('0x12'),this[_0x6cd6('0x13')][_0x6cd6('0x11')](this));ami['on'](_0x6cd6('0x14'),this[_0x6cd6('0x15')][_0x6cd6('0x11')](this));ami['on'](_0x6cd6('0x16'),this[_0x6cd6('0x17')][_0x6cd6('0x11')](this));ami['on']('varset',this[_0x6cd6('0x18')]['bind'](this));ami['on']('hangup',this[_0x6cd6('0x19')][_0x6cd6('0x11')](this));ami['on'](_0x6cd6('0x1a'),this[_0x6cd6('0x1b')]['bind'](this));ami['on']('musiconholdstop',this[_0x6cd6('0x1c')][_0x6cd6('0x11')](this));ami['on'](_0x6cd6('0x1d'),this['syncAttendedTransfer'][_0x6cd6('0x11')](this));ami['on']('blindtransfer',this[_0x6cd6('0x1e')]['bind'](this));}VoiceAgentReport[_0x6cd6('0x1f')][_0x6cd6('0x20')]=function(_0x5d57f3,_0x47ed45,_0x15fea2){io['to'](_0x5d57f3)[_0x6cd6('0x20')](_0x47ed45,_0x15fea2);};VoiceAgentReport['prototype']['isNotNull']=function(_0x508741){return _0x508741!==null&&!_[_0x6cd6('0x21')](_0x508741);};VoiceAgentReport[_0x6cd6('0x1f')][_0x6cd6('0x10')]=function(_0x180769){try{if(this[_0x6cd6('0x22')](_0x180769)){logger['info'](_0x6cd6('0x23'),_0x180769[_0x6cd6('0x24')],_0x180769['membername'],_0x180769['destuniqueid']);logger[_0x6cd6('0x25')](_0x6cd6('0x26'),_0x180769[_0x6cd6('0x24')],util[_0x6cd6('0x27')](_0x180769,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x6cd6('0xa')][_0x180769[_0x6cd6('0x24')]])){this[_0x6cd6('0xa')][_0x180769[_0x6cd6('0x24')]]={};}var _0x2e0313=this[_0x6cd6('0xd')][_0x180769[_0x6cd6('0x28')]];var _0x5f0eed=this[_0x6cd6('0xa')][_0x180769[_0x6cd6('0x24')]][_0x180769[_0x6cd6('0x29')]];var _0x44ba88=this[_0x6cd6('0xc')][_0x180769[_0x6cd6('0x2a')]];var _0x4d6ff8=this['variables'][_0x180769[_0x6cd6('0x24')]];if(_[_0x6cd6('0x21')](_0x5f0eed)){_0x5f0eed={'agentcalledAt':moment()['format'](_0x6cd6('0x2b')),'lastevent':'called','mandatoryDisposition':_0x44ba88&&_0x44ba88['mandatoryDisposition']?_0x44ba88['mandatoryDisposition']:![],'type':_0x44ba88&&_0x44ba88[_0x6cd6('0x2c')]?_0x44ba88['type']:_0x6cd6('0x2d'),'variables':_0x4d6ff8,'motionChannel':'voice'};}Object[_0x6cd6('0x2e')](_0x5f0eed,_['omit'](_0x180769,['event',_0x6cd6('0x2f')]));this[_0x6cd6('0xa')][_0x180769[_0x6cd6('0x24')]][_0x180769['destuniqueid']]=_0x5f0eed;logger[_0x6cd6('0x25')](_0x6cd6('0x30'),_0x180769[_0x6cd6('0x24')],util[_0x6cd6('0x27')](_0x5f0eed,{'showHidden':![],'depth':null}));ami['emit'](_0x6cd6('0x31'),_0x5f0eed);var _0xcc7f61={'id':_0x2e0313['id'],'calleridnum':_0x5f0eed[_0x6cd6('0x32')],'queue':_0x5f0eed[_0x6cd6('0x2a')],'variables':_0x5f0eed[_0x6cd6('0xe')],'uniqueid':_0x180769['uniqueid']};logger[_0x6cd6('0x25')](_0x6cd6('0x33'),_0x180769[_0x6cd6('0x24')],util['inspect'](_0xcc7f61,{'showHidden':![],'depth':null}));this['emit'](util[_0x6cd6('0x34')]('user:%s',_0x180769[_0x6cd6('0x35')]),_0x6cd6('0x36'),_0xcc7f61);}}catch(_0x3c5e0c){logger['error'](_0x6cd6('0x37'),_0x180769[_0x6cd6('0x24')],util[_0x6cd6('0x27')](_0x3c5e0c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6cd6('0x1f')][_0x6cd6('0x38')]=function(_0x19de62){try{if(this[_0x6cd6('0x22')](_0x19de62)){if(this['channels'][_0x19de62['uniqueid']]){for(var _0x4517d0 in this[_0x6cd6('0xa')][_0x19de62[_0x6cd6('0x24')]]){if(this[_0x6cd6('0xa')][_0x19de62[_0x6cd6('0x24')]]['hasOwnProperty'](_0x4517d0)){if(_0x19de62[_0x6cd6('0x29')]===_0x4517d0){logger[_0x6cd6('0x39')](_0x6cd6('0x3a'),_0x19de62['uniqueid'],_0x19de62['membername'],_0x19de62['destuniqueid']);this['channels'][_0x19de62[_0x6cd6('0x24')]][_0x4517d0]['agentconnectAt']=moment()['format'](_0x6cd6('0x2b'));this[_0x6cd6('0xa')][_0x19de62['uniqueid']][_0x4517d0][_0x6cd6('0x3b')]=_0x19de62[_0x6cd6('0x3b')];this[_0x6cd6('0xa')][_0x19de62[_0x6cd6('0x24')]][_0x4517d0][_0x6cd6('0x3c')]=_0x19de62[_0x6cd6('0x3c')];this[_0x6cd6('0xa')][_0x19de62[_0x6cd6('0x24')]][_0x4517d0][_0x6cd6('0x3d')]=_0x19de62[_0x6cd6('0x3d')];this['channels'][_0x19de62['uniqueid']][_0x4517d0][_0x6cd6('0x3e')]=_0x19de62[_0x6cd6('0x3e')];this[_0x6cd6('0xa')][_0x19de62[_0x6cd6('0x24')]][_0x4517d0][_0x6cd6('0x3f')]=_0x19de62[_0x6cd6('0x3f')];this['channels'][_0x19de62[_0x6cd6('0x24')]][_0x4517d0]['lastevent']=_0x6cd6('0x40');if(this[_0x6cd6('0xb')][this['channels'][_0x19de62[_0x6cd6('0x24')]][_0x4517d0][_0x6cd6('0x24')]]){var _0x99b99e=this[_0x6cd6('0xb')][this['channels'][_0x19de62[_0x6cd6('0x24')]][_0x4517d0][_0x6cd6('0x24')]]['routealias'];this[_0x6cd6('0xa')][_0x19de62[_0x6cd6('0x24')]][_0x4517d0][_0x6cd6('0x41')]=_0x99b99e;_0x19de62[_0x6cd6('0x41')]=_0x99b99e;}_['merge'](this[_0x6cd6('0xd')][_0x19de62['interface']],_['pick'](_0x19de62,[_0x6cd6('0x2a'),'destconnectedlinenum',_0x6cd6('0x41')]));var _0x274950=this[_0x6cd6('0xd')][_0x19de62[_0x6cd6('0x28')]];var _0x27191a={'id':_0x274950['id'],'name':_0x274950[_0x6cd6('0x42')],'agentconnected':!![],'destaccountcode':_0x274950[_0x6cd6('0x43')],'destconnectedlinenum':this['channels'][_0x19de62[_0x6cd6('0x24')]][_0x19de62['destuniqueid']][_0x6cd6('0x44')],'queue':this[_0x6cd6('0xa')][_0x19de62['uniqueid']][_0x19de62[_0x6cd6('0x29')]]['queue'],'routealias':this['channels'][_0x19de62['uniqueid']][_0x19de62[_0x6cd6('0x29')]][_0x6cd6('0x41')],'uniqueid':this[_0x6cd6('0xa')][_0x19de62['uniqueid']][_0x19de62[_0x6cd6('0x29')]]['uniqueid']};ami[_0x6cd6('0x20')](_0x6cd6('0x45'),this[_0x6cd6('0xa')][_0x19de62[_0x6cd6('0x24')]][_0x19de62[_0x6cd6('0x29')]]);this[_0x6cd6('0x20')](util[_0x6cd6('0x34')](_0x6cd6('0x46'),_0x19de62['membername']),'user:agentconnect',_0x27191a);}else if(!this[_0x6cd6('0xa')][_0x19de62[_0x6cd6('0x24')]][_0x4517d0][_0x6cd6('0x12')]&&!this['channels'][_0x19de62[_0x6cd6('0x24')]][_0x4517d0][_0x6cd6('0x16')]){logger[_0x6cd6('0x39')](_0x6cd6('0x47'),_0x19de62[_0x6cd6('0x24')],this[_0x6cd6('0xa')][_0x19de62[_0x6cd6('0x24')]][_0x4517d0][_0x6cd6('0x35')],_0x4517d0);this[_0x6cd6('0xa')][_0x19de62[_0x6cd6('0x24')]][_0x4517d0][_0x6cd6('0x12')]=!![];this['channels'][_0x19de62[_0x6cd6('0x24')]][_0x4517d0]['agentringnoanswerAt']=moment()[_0x6cd6('0x34')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6cd6('0xa')][_0x19de62[_0x6cd6('0x24')]][_0x4517d0][_0x6cd6('0x48')]=_0x19de62[_0x6cd6('0x29')];this['channels'][_0x19de62[_0x6cd6('0x24')]][_0x4517d0][_0x6cd6('0x49')]=_0x19de62[_0x6cd6('0x35')];this[_0x6cd6('0xa')][_0x19de62[_0x6cd6('0x24')]][_0x4517d0][_0x6cd6('0x4a')]=_0x6cd6('0x4b');this['channels'][_0x19de62[_0x6cd6('0x24')]][_0x4517d0][_0x6cd6('0x4c')]=_0x6cd6('0x4b');logger['debug']('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x19de62['uniqueid'],util[_0x6cd6('0x27')](this[_0x6cd6('0xa')][_0x19de62[_0x6cd6('0x24')]][_0x4517d0],{'showHidden':![],'depth':null}));ami[_0x6cd6('0x20')](_0x6cd6('0x4d'),this[_0x6cd6('0xa')][_0x19de62[_0x6cd6('0x24')]][_0x4517d0]);}else{logger[_0x6cd6('0x25')](_0x6cd6('0x4e'),_0x19de62[_0x6cd6('0x24')]);}}}}}}catch(_0x4a113f){logger['error'](_0x6cd6('0x4f'),_0x19de62[_0x6cd6('0x24')],util[_0x6cd6('0x27')](_0x4a113f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6cd6('0x1f')][_0x6cd6('0x13')]=function(_0x48380f){try{if(this[_0x6cd6('0x22')](_0x48380f)){logger[_0x6cd6('0x25')](_0x6cd6('0x50'),_0x48380f['uniqueid'],util['inspect'](_0x48380f,{'showHidden':![],'depth':null}));if(this[_0x6cd6('0xa')][_0x48380f[_0x6cd6('0x24')]]&&this[_0x6cd6('0xa')][_0x48380f[_0x6cd6('0x24')]][_0x48380f['destuniqueid']]){logger[_0x6cd6('0x39')](_0x6cd6('0x51'),_0x48380f[_0x6cd6('0x24')],_0x48380f[_0x6cd6('0x35')],_0x48380f[_0x6cd6('0x29')]);var _0x43ecfb=this['agents'][_0x48380f[_0x6cd6('0x28')]];var _0x458cbb=this[_0x6cd6('0xa')][_0x48380f[_0x6cd6('0x24')]][_0x48380f[_0x6cd6('0x29')]];_0x458cbb[_0x6cd6('0x12')]=!![];_0x458cbb[_0x6cd6('0x52')]=moment()[_0x6cd6('0x34')](_0x6cd6('0x2b'));_0x458cbb[_0x6cd6('0x4a')]=_0x6cd6('0x53');_0x458cbb[_0x6cd6('0x4c')]=_0x6cd6('0x53');var _0x6ea91a={'id':_0x43ecfb['id'],'name':_0x43ecfb[_0x6cd6('0x42')],'queue':_0x458cbb[_0x6cd6('0x2a')],'uniqueid':_0x458cbb[_0x6cd6('0x24')]};logger[_0x6cd6('0x25')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x48380f[_0x6cd6('0x24')],util[_0x6cd6('0x27')](_0x6ea91a,{'showHidden':![],'depth':null}));this[_0x6cd6('0x20')](util[_0x6cd6('0x34')]('user:%s',_0x43ecfb[_0x6cd6('0x42')]),_0x6cd6('0x54'),_0x6ea91a);ami[_0x6cd6('0x20')]('custom:agentringnoanswer',_0x458cbb);this[_0x6cd6('0xa')][_0x48380f[_0x6cd6('0x24')]][_0x48380f[_0x6cd6('0x29')]]=Object['assign']({},_0x458cbb);}}}catch(_0x452870){logger[_0x6cd6('0x55')](_0x6cd6('0x56'),_0x48380f[_0x6cd6('0x24')],util[_0x6cd6('0x27')](_0x452870,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6cd6('0x1f')][_0x6cd6('0x15')]=function(_0x3ade7b){try{if(this['isNotNull'](_0x3ade7b)){logger[_0x6cd6('0x25')](_0x6cd6('0x57'),_0x3ade7b[_0x6cd6('0x24')],util[_0x6cd6('0x27')](_0x3ade7b,{'showHidden':![],'depth':null}));if(this[_0x6cd6('0xa')][_0x3ade7b['uniqueid']]){for(var _0x2f0ed5 in this['channels'][_0x3ade7b['uniqueid']]){if(this[_0x6cd6('0xa')][_0x3ade7b['uniqueid']][_0x6cd6('0x58')](_0x2f0ed5)&&!this[_0x6cd6('0xa')][_0x3ade7b[_0x6cd6('0x24')]][_0x2f0ed5][_0x6cd6('0x12')]&&!this[_0x6cd6('0xa')][_0x3ade7b['uniqueid']][_0x2f0ed5][_0x6cd6('0x16')]){logger[_0x6cd6('0x39')](_0x6cd6('0x59'),_0x3ade7b['uniqueid'],this['channels'][_0x3ade7b[_0x6cd6('0x24')]][_0x2f0ed5][_0x6cd6('0x35')],_0x2f0ed5);this[_0x6cd6('0xa')][_0x3ade7b['uniqueid']][_0x2f0ed5]['agentringnoanswer']=!![];this[_0x6cd6('0xa')][_0x3ade7b['uniqueid']][_0x2f0ed5]['agentringnoanswerAt']=moment()[_0x6cd6('0x34')](_0x6cd6('0x2b'));this[_0x6cd6('0xa')][_0x3ade7b['uniqueid']][_0x2f0ed5][_0x6cd6('0x4a')]=_0x6cd6('0x5a');this[_0x6cd6('0xa')][_0x3ade7b['uniqueid']][_0x2f0ed5][_0x6cd6('0x4c')]=_0x6cd6('0x5a');logger[_0x6cd6('0x25')](_0x6cd6('0x5b'),_0x3ade7b['uniqueid'],util[_0x6cd6('0x27')](this[_0x6cd6('0xa')][_0x3ade7b[_0x6cd6('0x24')]][_0x2f0ed5],{'showHidden':![],'depth':null}));ami['emit'](_0x6cd6('0x5c'),this[_0x6cd6('0xa')][_0x3ade7b['uniqueid']][_0x2f0ed5]);}}}}}catch(_0x553562){logger[_0x6cd6('0x55')]('[%s][voiceAgentReport][queuecallerabandon]',_0x3ade7b[_0x6cd6('0x24')],util['inspect'](_0x553562,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6cd6('0x1f')][_0x6cd6('0x17')]=function(_0x1f9591){try{if(this[_0x6cd6('0x22')](_0x1f9591)){logger[_0x6cd6('0x25')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x1f9591['uniqueid'],util[_0x6cd6('0x27')](_0x1f9591,{'showHidden':![],'depth':null}));if(this[_0x6cd6('0xa')][_0x1f9591[_0x6cd6('0x24')]]){for(var _0x2f747f in this[_0x6cd6('0xa')][_0x1f9591['uniqueid']]){if(this[_0x6cd6('0xa')][_0x1f9591[_0x6cd6('0x24')]][_0x6cd6('0x58')](_0x2f747f)){if(this[_0x6cd6('0xa')][_0x1f9591[_0x6cd6('0x24')]][_0x2f747f][_0x6cd6('0x5d')]&&!this[_0x6cd6('0xa')][_0x1f9591[_0x6cd6('0x24')]][_0x2f747f]['agentcomplete']){logger[_0x6cd6('0x39')](_0x6cd6('0x5e'),_0x1f9591[_0x6cd6('0x24')],this[_0x6cd6('0xa')][_0x1f9591[_0x6cd6('0x24')]][_0x2f747f][_0x6cd6('0x35')],_0x2f747f);this[_0x6cd6('0xa')][_0x1f9591[_0x6cd6('0x24')]][_0x2f747f]['agentcomplete']=!![];this[_0x6cd6('0xa')][_0x1f9591[_0x6cd6('0x24')]][_0x2f747f][_0x6cd6('0x5f')]=moment()[_0x6cd6('0x34')](_0x6cd6('0x2b'));this['channels'][_0x1f9591[_0x6cd6('0x24')]][_0x2f747f]['lastevent']=_0x6cd6('0x60');this[_0x6cd6('0xa')][_0x1f9591['uniqueid']][_0x2f747f][_0x6cd6('0x4c')]=_0x1f9591[_0x6cd6('0x4c')]=='transfer'?_0x6cd6('0x61'):_0x1f9591['reason'];this[_0x6cd6('0xa')][_0x1f9591['uniqueid']][_0x2f747f][_0x6cd6('0x62')]=_0x1f9591[_0x6cd6('0x62')];if(this[_0x6cd6('0xc')][_0x1f9591[_0x6cd6('0x2a')]]&&this['voiceQueues'][_0x1f9591[_0x6cd6('0x2a')]][_0x6cd6('0x63')]){this[_0x6cd6('0xa')][_0x1f9591[_0x6cd6('0x24')]][_0x2f747f][_0x6cd6('0x64')]=this[_0x6cd6('0xc')][_0x1f9591[_0x6cd6('0x2a')]][_0x6cd6('0x65')];this[_0x6cd6('0xa')][_0x1f9591[_0x6cd6('0x24')]][_0x2f747f]['agentacw']=!![];}this[_0x6cd6('0xd')][_0x1f9591[_0x6cd6('0x28')]]=_[_0x6cd6('0x66')](this[_0x6cd6('0xd')][_0x1f9591[_0x6cd6('0x28')]],[_0x6cd6('0x2a'),_0x6cd6('0x67')]);logger[_0x6cd6('0x25')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x1f9591[_0x6cd6('0x24')],util[_0x6cd6('0x27')](this[_0x6cd6('0xa')][_0x1f9591[_0x6cd6('0x24')]][_0x2f747f],{'showHidden':![],'depth':null}));ami[_0x6cd6('0x20')](_0x6cd6('0x68'),this[_0x6cd6('0xa')][_0x1f9591['uniqueid']][_0x2f747f]);logger[_0x6cd6('0x25')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x1f9591[_0x6cd6('0x24')],util['inspect']({'id':this[_0x6cd6('0xd')][_0x1f9591[_0x6cd6('0x28')]]['id'],'destaccountcode':_0x1f9591[_0x6cd6('0x69')]},{'showHidden':![],'depth':null}));this[_0x6cd6('0x20')](util[_0x6cd6('0x34')]('user:%s',_0x1f9591[_0x6cd6('0x35')]),_0x6cd6('0x6a'),{'id':this[_0x6cd6('0xd')][_0x1f9591[_0x6cd6('0x28')]]['id'],'destaccountcode':Number(_0x1f9591[_0x6cd6('0x69')])});}}}}}}catch(_0x5a3022){logger[_0x6cd6('0x55')](_0x6cd6('0x6b'),_0x1f9591['uniqueid'],util['inspect'](_0x5a3022,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6cd6('0x1f')][_0x6cd6('0x18')]=function(_0x2cdfb9){try{if(this['isNotNull'](_0x2cdfb9)){logger[_0x6cd6('0x25')](_0x6cd6('0x6c'),_0x2cdfb9[_0x6cd6('0x24')],util[_0x6cd6('0x27')](_0x2cdfb9,{'showHidden':![],'depth':null}));this[_0x6cd6('0x6d')](_0x2cdfb9[_0x6cd6('0x24')],_[_0x6cd6('0x6e')](_0x2cdfb9['variable'])[0x0],_0x2cdfb9[_0x6cd6('0x6f')]);if(this[_0x6cd6('0xa')][_0x2cdfb9[_0x6cd6('0x24')]]){for(var _0x526567 in this[_0x6cd6('0xa')][_0x2cdfb9['uniqueid']]){if(this[_0x6cd6('0xa')][_0x2cdfb9[_0x6cd6('0x24')]][_0x6cd6('0x58')](_0x526567)){logger[_0x6cd6('0x39')](_0x6cd6('0x70'),_0x2cdfb9[_0x6cd6('0x24')],_0x526567,_['keys'](_0x2cdfb9[_0x6cd6('0x71')])[0x0],_0x2cdfb9[_0x6cd6('0x6f')]);if(_[_0x6cd6('0x21')](this[_0x6cd6('0xa')][_0x2cdfb9[_0x6cd6('0x24')]][_0x526567]['variables'])){this[_0x6cd6('0xa')][_0x2cdfb9[_0x6cd6('0x24')]][_0x526567][_0x6cd6('0xe')]={};}this[_0x6cd6('0xa')][_0x2cdfb9[_0x6cd6('0x24')]][_0x526567][_0x6cd6('0xe')]=this[_0x6cd6('0xe')][_0x2cdfb9[_0x6cd6('0x24')]];}}}}}catch(_0x26d5da){logger[_0x6cd6('0x55')](_0x6cd6('0x72'),_0x2cdfb9[_0x6cd6('0x24')],util[_0x6cd6('0x27')](_0x26d5da,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6cd6('0x1f')][_0x6cd6('0x6d')]=function(_0x453dfb,_0x2b2505,_0x329f38){var _0x1e4508=[_0x6cd6('0x73'),_0x6cd6('0x74'),_0x6cd6('0x75'),_0x6cd6('0x76'),_0x6cd6('0x77'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x6cd6('0x78'),_0x6cd6('0x79'),_0x6cd6('0x7a'),_0x6cd6('0x7b'),_0x6cd6('0x7c'),_0x6cd6('0x7d'),'memberdynamic','memberinterface',_0x6cd6('0x7e'),_0x6cd6('0x35'),_0x6cd6('0x7f'),_0x6cd6('0x80')];if(!_['isNil'](_0x2b2505)&&!_[_0x6cd6('0x81')](_0x1e4508,_0x2b2505)){if(_[_0x6cd6('0x21')](this[_0x6cd6('0xe')][_0x453dfb])){this['variables'][_0x453dfb]={};}this['variables'][_0x453dfb][_0x2b2505]=_0x329f38;}};VoiceAgentReport[_0x6cd6('0x1f')][_0x6cd6('0x19')]=function(_0x3214dc){try{if(this[_0x6cd6('0x22')](_0x3214dc)){logger[_0x6cd6('0x25')](_0x6cd6('0x82'),_0x3214dc[_0x6cd6('0x24')],util[_0x6cd6('0x27')](_0x3214dc,{'showHidden':![],'depth':null}));if(this[_0x6cd6('0xa')][_0x3214dc[_0x6cd6('0x24')]]){for(var _0x3e93be in this[_0x6cd6('0xa')][_0x3214dc[_0x6cd6('0x24')]]){if(this[_0x6cd6('0xa')][_0x3214dc[_0x6cd6('0x24')]][_0x6cd6('0x58')](_0x3e93be)){if(this[_0x6cd6('0xa')][_0x3214dc[_0x6cd6('0x24')]][_0x3e93be][_0x6cd6('0x4c')]==_0x6cd6('0x83')&&this[_0x6cd6('0xa')][_0x3214dc[_0x6cd6('0x24')]][_0x3e93be]['agentcomplete']){logger[_0x6cd6('0x39')](_0x6cd6('0x84'),_0x3214dc['uniqueid'],_0x3e93be);this[_0x6cd6('0xa')][_0x3214dc[_0x6cd6('0x24')]][_0x3e93be][_0x6cd6('0x5f')]=moment()[_0x6cd6('0x34')](_0x6cd6('0x2b'));}}}logger[_0x6cd6('0x25')](_0x6cd6('0x85'),_0x3214dc[_0x6cd6('0x24')],util[_0x6cd6('0x27')](_[_0x6cd6('0x86')](this[_0x6cd6('0xa')][_0x3214dc['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0x6cd6('0x20')](_0x6cd6('0x87'),_[_0x6cd6('0x86')](this[_0x6cd6('0xa')][_0x3214dc['uniqueid']]));delete this[_0x6cd6('0xa')][_0x3214dc[_0x6cd6('0x24')]];}if(this[_0x6cd6('0xe')][_0x3214dc['uniqueid']]){delete this[_0x6cd6('0xe')][_0x3214dc[_0x6cd6('0x24')]];}}}catch(_0x23252){logger[_0x6cd6('0x55')](_0x6cd6('0x88'),_0x3214dc['uniqueid'],util[_0x6cd6('0x27')](_0x23252,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6cd6('0x89')]=function(_0x4ff9a0){try{if(this['isNotNull'](_0x4ff9a0)){logger['debug'](_0x6cd6('0x8a'),_0x4ff9a0[_0x6cd6('0x24')],util['inspect'](_0x4ff9a0,{'showHidden':![],'depth':null}));if(this['channels'][_0x4ff9a0['transfereeuniqueid']]){for(var _0x488708 in this['channels'][_0x4ff9a0[_0x6cd6('0x8b')]]){if(this[_0x6cd6('0xa')][_0x4ff9a0[_0x6cd6('0x8b')]][_0x6cd6('0x58')](_0x488708)){if(_0x4ff9a0[_0x6cd6('0x8c')]===_0x488708){logger[_0x6cd6('0x39')](_0x6cd6('0x8d'),_0x4ff9a0[_0x6cd6('0x24')],this[_0x6cd6('0xa')][_0x4ff9a0[_0x6cd6('0x8b')]][_0x488708][_0x6cd6('0x35')],_0x488708);var _0x5147f9=moment();this[_0x6cd6('0xa')][_0x4ff9a0[_0x6cd6('0x8b')]][_0x488708][_0x6cd6('0x16')]=!![];this[_0x6cd6('0xa')][_0x4ff9a0['transfereeuniqueid']][_0x488708][_0x6cd6('0x5f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x6cd6('0xa')][_0x4ff9a0[_0x6cd6('0x8b')]][_0x488708]['lastevent']=_0x6cd6('0x60');this['channels'][_0x4ff9a0['transfereeuniqueid']][_0x488708][_0x6cd6('0x4c')]=_0x6cd6('0x83');this[_0x6cd6('0xa')][_0x4ff9a0[_0x6cd6('0x8b')]][_0x488708][_0x6cd6('0x62')]=_0x5147f9[_0x6cd6('0x8e')](this[_0x6cd6('0xa')][_0x4ff9a0['transfereeuniqueid']][_0x488708]['agentconnectAt'],'seconds');}}}}if(this[_0x6cd6('0xa')][_0x4ff9a0[_0x6cd6('0x8f')]]){var _0x87180f=this['channels'][_0x4ff9a0[_0x6cd6('0x8f')]];this['channels'][_0x4ff9a0[_0x6cd6('0x8f')]]=this[_0x6cd6('0xa')][_0x4ff9a0['transfereeuniqueid']];this[_0x6cd6('0xa')][_0x4ff9a0[_0x6cd6('0x8b')]]=_0x87180f;}}}catch(_0x9570ad){logger['error'](_0x6cd6('0x90'),_0x4ff9a0[_0x6cd6('0x24')],util[_0x6cd6('0x27')](_0x9570ad,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6cd6('0x1f')][_0x6cd6('0x1e')]=function(_0x1c4cdf){try{if(this[_0x6cd6('0x22')](_0x1c4cdf)){logger['debug'](_0x6cd6('0x91'),_0x1c4cdf[_0x6cd6('0x24')],util[_0x6cd6('0x27')](_0x1c4cdf,{'showHidden':![],'depth':null}));if(this[_0x6cd6('0xa')][_0x1c4cdf['transfereeuniqueid']]){for(var _0x70ed3f in this[_0x6cd6('0xa')][_0x1c4cdf['transfereeuniqueid']]){if(this[_0x6cd6('0xa')][_0x1c4cdf[_0x6cd6('0x8b')]][_0x6cd6('0x58')](_0x70ed3f)){if(_0x1c4cdf[_0x6cd6('0x92')]===_0x70ed3f){logger[_0x6cd6('0x39')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x1c4cdf[_0x6cd6('0x24')],this['channels'][_0x1c4cdf[_0x6cd6('0x8b')]][_0x70ed3f][_0x6cd6('0x35')],_0x70ed3f);var _0x3eef56=moment();this[_0x6cd6('0xa')][_0x1c4cdf[_0x6cd6('0x8b')]][_0x70ed3f][_0x6cd6('0x16')]=!![];this[_0x6cd6('0xa')][_0x1c4cdf[_0x6cd6('0x8b')]][_0x70ed3f][_0x6cd6('0x5f')]=_0x3eef56;this[_0x6cd6('0xa')][_0x1c4cdf['transfereeuniqueid']][_0x70ed3f][_0x6cd6('0x4a')]=_0x6cd6('0x60');this[_0x6cd6('0xa')][_0x1c4cdf[_0x6cd6('0x8b')]][_0x70ed3f][_0x6cd6('0x4c')]=_0x6cd6('0x83');this[_0x6cd6('0xa')][_0x1c4cdf[_0x6cd6('0x8b')]][_0x70ed3f][_0x6cd6('0x62')]=_0x3eef56[_0x6cd6('0x8e')](this[_0x6cd6('0xa')][_0x1c4cdf[_0x6cd6('0x8b')]][_0x70ed3f][_0x6cd6('0x5d')],'seconds');}}}}}}catch(_0x50c1cb){logger[_0x6cd6('0x55')](_0x6cd6('0x93'),_0x1c4cdf[_0x6cd6('0x24')],util[_0x6cd6('0x27')](_0x50c1cb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6cd6('0x1f')]['syncMusicOnHoldStart']=function(_0x553f61){var _0x90d3a8='';try{if(this[_0x6cd6('0x22')](_0x553f61)){logger[_0x6cd6('0x25')](_0x6cd6('0x94'),_0x553f61[_0x6cd6('0x24')],util[_0x6cd6('0x27')](_0x553f61,{'showHidden':![],'depth':null}));if(_0x553f61[_0x6cd6('0x95')]){_0x90d3a8=_0x553f61[_0x6cd6('0x95')][_0x6cd6('0x96')](0x0,_0x553f61[_0x6cd6('0x95')]['lastIndexOf']('-'));if(this[_0x6cd6('0xd')][_0x90d3a8]){logger[_0x6cd6('0x39')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x553f61[_0x6cd6('0x24')],_0x90d3a8);this[_0x6cd6('0xd')][_0x90d3a8][_0x6cd6('0x97')]=!![];}}}}catch(_0x19dd6a){logger[_0x6cd6('0x55')](_0x6cd6('0x98'),_0x553f61[_0x6cd6('0x24')],util['inspect'](_0x19dd6a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6cd6('0x1f')][_0x6cd6('0x1c')]=function(_0x3d703a){var _0x1f7f8f='';try{if(this[_0x6cd6('0x22')](_0x3d703a)){logger[_0x6cd6('0x25')](_0x6cd6('0x99'),_0x3d703a[_0x6cd6('0x24')],util[_0x6cd6('0x27')](_0x3d703a,{'showHidden':![],'depth':null}));if(_0x3d703a['channel']){_0x1f7f8f=_0x3d703a[_0x6cd6('0x95')][_0x6cd6('0x96')](0x0,_0x3d703a['channel'][_0x6cd6('0x9a')]('-'));if(this['agents'][_0x1f7f8f]){logger[_0x6cd6('0x39')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3d703a['uniqueid'],_0x1f7f8f);this[_0x6cd6('0xd')][_0x1f7f8f]['onhold']=![];}}}}catch(_0x67882d){logger['error'](_0x6cd6('0x9b'),_0x3d703a[_0x6cd6('0x24')],util[_0x6cd6('0x27')](_0x67882d,{'showHidden':![],'depth':null}));}};module[_0x6cd6('0x9c')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 3e6a0e0..ebf746d 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d63=['[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','linkedid','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','pick','split','user:%s','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','isUndefined','subtract','duration','seconds','lastapplication','match','type','isNil','queue','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','channelstate','answered','answertime','calleridnum','membername','diff','connectedlinename','destinationchannel','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceCallReport][newstate]','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','replace','monitorFilename','find','push','rec','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','syncMixMonitorFilename','[%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-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','endtime','billableseconds','holdtime','omit','length','keys','user:agentcomplete','resolve','transferToInternal','stopRecordingOnTransfer','Action','StopMixMonitor','catch','then','event','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','transferType','origtransfererlinkedid','some','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','extension','BLIND','BlindTransfer','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','dial','playback','FAILED','NO\x20ANSWER','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewState','varset','syncVarSet','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','prototype','emit','isNotNull','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','debug','[%s][voiceCallReport][newcallerid]\x20event:','inspect','merge','context','from-sip','channel','exten','destconnectedlinenum','connectedlinenum','format','name','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel'];(function(_0x5074e1,_0x1a7a34){var _0x234fce=function(_0x1298ac){while(--_0x1298ac){_0x5074e1['push'](_0x5074e1['shift']());}};_0x234fce(++_0x1a7a34);}(_0x4d63,0x7c));var _0x34d6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4d63[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x34d6('0x0'));var moment=require(_0x34d6('0x1'));var util=require(_0x34d6('0x2'));var path=require('path');var Redis=require(_0x34d6('0x3'));var config=require(_0x34d6('0x4'));var logger=require(_0x34d6('0x5'))(_0x34d6('0x6'));var ami=require(_0x34d6('0x7'));var Channel=require(_0x34d6('0x8'));var RpcSetting=require(_0x34d6('0x9'));var applications=['set','queue','agi',_0x34d6('0xa'),_0x34d6('0xb'),'voicemail'];var dispositions=['NO\x20ANSWER','FAILED',_0x34d6('0xc'),_0x34d6('0xd'),_0x34d6('0xd'),_0x34d6('0xd'),'ANSWERED',_0x34d6('0xe'),_0x34d6('0xc'),'FAILED',_0x34d6('0xc')];config[_0x34d6('0xf')]=_[_0x34d6('0x10')](config[_0x34d6('0xf')],{'host':_0x34d6('0x11'),'port':0x18eb});var io=require(_0x34d6('0x12'))(new Redis(config['redis']));function VoiceCallReport(_0x12a7c3){this[_0x34d6('0x13')]=_0x12a7c3[_0x34d6('0x13')];this[_0x34d6('0x14')]=_0x12a7c3['agents'];this[_0x34d6('0x15')]={};ami['on'](_0x34d6('0x16'),this[_0x34d6('0x17')][_0x34d6('0x18')](this));ami['on'](_0x34d6('0x19'),this[_0x34d6('0x17')]['bind'](this));ami['on'](_0x34d6('0x1a'),this['syncNewChannel'][_0x34d6('0x18')](this));ami['on']('newstate',this[_0x34d6('0x1b')]['bind'](this));ami['on'](_0x34d6('0x1c'),this[_0x34d6('0x1d')][_0x34d6('0x18')](this));ami['on'](_0x34d6('0x1e'),this[_0x34d6('0x1f')][_0x34d6('0x18')](this));ami['on']('newcallerid',this[_0x34d6('0x20')][_0x34d6('0x18')](this));ami['on'](_0x34d6('0x21'),this[_0x34d6('0x22')]['bind'](this));ami['on'](_0x34d6('0x23'),this[_0x34d6('0x24')][_0x34d6('0x18')](this));ami['on'](_0x34d6('0x25'),this[_0x34d6('0x26')][_0x34d6('0x18')](this));ami['on'](_0x34d6('0x27'),this[_0x34d6('0x28')]['bind'](this));try{logger[_0x34d6('0x29')](_0x34d6('0x2a'));ami['actionCoreShowChannels']();}catch(_0x5d64b0){logger[_0x34d6('0x2b')](_0x34d6('0x2c'),util['inspect'](_0x5d64b0,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype']['isNotNull']=function(_0x341994){return _0x341994!==null&&!_['isUndefined'](_0x341994);};VoiceCallReport[_0x34d6('0x2d')][_0x34d6('0x2e')]=function(_0x43699c,_0x4de745,_0x23e353){io['to'](_0x43699c)[_0x34d6('0x2e')](_0x4de745,_0x23e353);};VoiceCallReport[_0x34d6('0x2d')][_0x34d6('0x20')]=function(_0x19b0ba){try{if(this[_0x34d6('0x2f')](_0x19b0ba)){logger[_0x34d6('0x29')](_0x34d6('0x30'),_0x19b0ba[_0x34d6('0x31')],_0x19b0ba[_0x34d6('0x32')],_0x19b0ba['calleridnum']);logger[_0x34d6('0x33')](_0x34d6('0x34'),_0x19b0ba[_0x34d6('0x31')],util[_0x34d6('0x35')](_0x19b0ba,{'showHidden':![],'depth':null}));if(_0x19b0ba[_0x34d6('0x31')]===_0x19b0ba['linkedid']){if(!_['isUndefined'](this[_0x34d6('0x13')][_0x19b0ba['uniqueid']])){_[_0x34d6('0x36')](this[_0x34d6('0x13')][_0x19b0ba[_0x34d6('0x31')]],_['pick'](_0x19b0ba,_['keys'](this[_0x34d6('0x13')][_0x19b0ba[_0x34d6('0x31')]])));}}if(_0x19b0ba[_0x34d6('0x37')]===_0x34d6('0x38')){var _0x498535=this[_0x34d6('0x14')][_0x19b0ba[_0x34d6('0x39')]['split']('-')[0x0]];if(_0x498535){if(_0x19b0ba[_0x34d6('0x3a')]=='xcally-motion-preview'){_0x498535[_0x34d6('0x3b')]=_0x19b0ba[_0x34d6('0x3c')];this[_0x34d6('0x2e')](util[_0x34d6('0x3d')]('user:%s',_0x498535[_0x34d6('0x3e')]),'user:agentconnect',{'id':_0x498535['id'],'destaccountcode':_0x498535[_0x34d6('0x3f')],'destconnectedlinenum':_0x19b0ba[_0x34d6('0x3c')]});}}}}}catch(_0x3671ed){logger['error'](_0x34d6('0x40'),_0x19b0ba[_0x34d6('0x31')],util['inspect'](_0x3671ed,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x34d6('0x2d')][_0x34d6('0x41')]=function(_0x21064e){try{if(this[_0x34d6('0x2f')](_0x21064e)){logger[_0x34d6('0x33')](_0x34d6('0x42'),_0x21064e[_0x34d6('0x31')],util[_0x34d6('0x35')](_0x21064e,{'showHidden':![],'depth':null}));if(this['channels'][_0x21064e['uniqueid']]){return;}if(_0x21064e['channel']===_0x34d6('0x43')){return;}if(_0x21064e[_0x34d6('0x31')]!==_0x21064e[_0x34d6('0x44')]&&!this[_0x34d6('0x15')][_0x21064e['linkedid']]){return;}logger[_0x34d6('0x29')](_0x34d6('0x45'),_0x21064e[_0x34d6('0x31')],_0x21064e['context'],_0x21064e[_0x34d6('0x3a')]);this['channels'][_0x21064e['uniqueid']]=new Channel();this[_0x34d6('0x13')][_0x21064e[_0x34d6('0x31')]][_0x34d6('0x46')]=moment()['format'](_0x34d6('0x47'));this['channels'][_0x21064e[_0x34d6('0x31')]][_0x34d6('0x48')]=dispositions[_[_0x34d6('0x49')](_0x21064e['channelstate'])];_[_0x34d6('0x36')](this[_0x34d6('0x13')][_0x21064e[_0x34d6('0x31')]],_[_0x34d6('0x4a')](_0x21064e,_['keys'](this[_0x34d6('0x13')][_0x21064e['uniqueid']])));if(_0x21064e[_0x34d6('0x37')]===_0x34d6('0x38')){var _0x5a1276=this[_0x34d6('0x14')][_0x21064e[_0x34d6('0x39')][_0x34d6('0x4b')]('-')[0x0]];if(_0x5a1276&&typeof _0x5a1276[_0x34d6('0x3b')]==='undefined'){_0x5a1276['destconnectedlinenum']=_0x21064e[_0x34d6('0x3a')];logger['debug']('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x21064e['uniqueid'],util['inspect']({'id':_0x5a1276['id'],'destaccountcode':_0x5a1276['accountcode'],'destconnectedlinenum':_0x21064e['exten']},{'showHidden':![],'depth':null}));this['emit'](util[_0x34d6('0x3d')](_0x34d6('0x4c'),_0x5a1276['name']),'user:agentconnect',{'id':_0x5a1276['id'],'destaccountcode':_0x5a1276['accountcode'],'destconnectedlinenum':_0x21064e[_0x34d6('0x3a')]});}}}}catch(_0x22e9f2){logger[_0x34d6('0x2b')](_0x34d6('0x4d'),_0x21064e[_0x34d6('0x31')],util['inspect'](_0x22e9f2,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x34d6('0x17')]=function(_0x31ecca){try{if(this[_0x34d6('0x2f')](_0x31ecca)){logger[_0x34d6('0x33')](_0x34d6('0x4e'),_0x31ecca[_0x34d6('0x31')],util[_0x34d6('0x35')](_0x31ecca,{'showHidden':![],'depth':null}));if(_0x31ecca[_0x34d6('0x39')]===_0x34d6('0x43')||_0x31ecca[_0x34d6('0x3a')]==='h')return;if(_0x31ecca[_0x34d6('0x31')]===_0x31ecca[_0x34d6('0x44')]||this[_0x34d6('0x15')][_0x31ecca[_0x34d6('0x44')]]){_0x31ecca[_0x34d6('0x4f')]=_0x31ecca['application']?_0x31ecca[_0x34d6('0x4f')][_0x34d6('0x50')]():undefined;_0x31ecca['applicationdata']=_0x31ecca['appdata']||_0x31ecca[_0x34d6('0x51')];if(_0x31ecca[_0x34d6('0x52')]&&!_0x31ecca[_0x34d6('0x52')][_0x34d6('0x53')](_0x34d6('0x54'))&&_0x31ecca[_0x34d6('0x4f')]!=='queue'){_0x31ecca[_0x34d6('0x51')]=_0x31ecca['applicationdata'][_0x34d6('0x50')]();}logger['info'](_0x34d6('0x55'),_0x31ecca[_0x34d6('0x31')],_0x31ecca[_0x34d6('0x4f')],_0x31ecca[_0x34d6('0x51')]);if(_[_0x34d6('0x56')](this['channels'][_0x31ecca[_0x34d6('0x31')]])){this[_0x34d6('0x13')][_0x31ecca[_0x34d6('0x31')]]=new Channel();this[_0x34d6('0x13')][_0x31ecca[_0x34d6('0x31')]][_0x34d6('0x46')]=_0x31ecca['duration']?moment()[_0x34d6('0x57')](moment[_0x34d6('0x58')](_0x31ecca[_0x34d6('0x58')])[_0x34d6('0x59')](),_0x34d6('0x59'))[_0x34d6('0x3d')](_0x34d6('0x47')):moment()[_0x34d6('0x3d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x34d6('0x13')][_0x31ecca[_0x34d6('0x31')]][_0x34d6('0x48')]=_0x34d6('0xd');}_[_0x34d6('0x36')](this['channels'][_0x31ecca[_0x34d6('0x31')]],_[_0x34d6('0x4a')](_0x31ecca,_['keys'](this[_0x34d6('0x13')][_0x31ecca[_0x34d6('0x31')]])));if(_['includes'](applications,_0x31ecca[_0x34d6('0x4f')])){this['channels'][_0x31ecca[_0x34d6('0x31')]][_0x34d6('0x5a')]=_0x31ecca[_0x34d6('0x4f')];this[_0x34d6('0x13')][_0x31ecca['uniqueid']]['lastdata']=_0x31ecca[_0x34d6('0x51')];if(_0x31ecca[_0x34d6('0x4f')]==='set'&&_[_0x34d6('0x53')](_0x31ecca['applicationdata'][_0x34d6('0x50')](),'cdr(')){var _0x304cc5=_0x31ecca[_0x34d6('0x51')][_0x34d6('0x4b')]('=');var _0x475c3f=_0x304cc5[0x0][_0x34d6('0x50')]()[_0x34d6('0x5b')](/cdr\((.*)\)/);if(_0x475c3f){if(_0x475c3f[0x1]===_0x34d6('0x5c')&&!_[_0x34d6('0x5d')](this['channels'][_0x31ecca[_0x34d6('0x31')]][_0x475c3f[0x1]]))return;this[_0x34d6('0x13')][_0x31ecca[_0x34d6('0x31')]][_0x475c3f[0x1]]=_0x304cc5[0x1];}}else if(_0x31ecca['application']===_0x34d6('0x5e')){this[_0x34d6('0x13')][_0x31ecca[_0x34d6('0x31')]][_0x34d6('0x5e')]=_0x31ecca['applicationdata']['split'](',')[0x0];}}}}}catch(_0x491b8c){logger[_0x34d6('0x2b')](_0x34d6('0x5f'),_0x31ecca[_0x34d6('0x31')],util[_0x34d6('0x35')](_0x491b8c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x34d6('0x2d')]['syncNewState']=function(_0xe60b1b){try{if(this['isNotNull'](_0xe60b1b)){logger[_0x34d6('0x29')](_0x34d6('0x60'),_0xe60b1b[_0x34d6('0x31')],_0xe60b1b['linkedid'],_0xe60b1b['calleridname'],_0xe60b1b['calleridnum']);logger[_0x34d6('0x33')]('[%s][voiceCallReport][newstate]\x20event:',_0xe60b1b[_0x34d6('0x31')],util['inspect'](_0xe60b1b,{'showHidden':![],'depth':null}));if(_0xe60b1b[_0x34d6('0x61')]!=='6')return;var _0x2bce9d=this[_0x34d6('0x14')][_0xe60b1b[_0x34d6('0x39')][_0x34d6('0x4b')]('-')[0x0]];if(_0xe60b1b[_0x34d6('0x31')]!==_0xe60b1b['linkedid']){var _0x28307d=moment();if(this[_0x34d6('0x13')][_0xe60b1b[_0x34d6('0x44')]]){if(!this[_0x34d6('0x13')][_0xe60b1b[_0x34d6('0x44')]][_0x34d6('0x62')]){this[_0x34d6('0x13')][_0xe60b1b['linkedid']][_0x34d6('0x62')]=!![];this[_0x34d6('0x13')][_0xe60b1b['linkedid']][_0x34d6('0x63')]=_0x28307d['format'](_0x34d6('0x47'));if(this[_0x34d6('0x13')][_0xe60b1b['linkedid']][_0x34d6('0x46')]){this[_0x34d6('0x13')][_0xe60b1b['linkedid']]['holdtime']=_0x28307d['diff'](this[_0x34d6('0x13')][_0xe60b1b[_0x34d6('0x44')]][_0x34d6('0x46')],'seconds');}}this['channels'][_0xe60b1b[_0x34d6('0x44')]][_0x34d6('0x44')]=_0xe60b1b['uniqueid'];if(_0xe60b1b['calleridnum']!=='xcally-motion-preview'){this[_0x34d6('0x13')][_0xe60b1b['linkedid']][_0x34d6('0x3c')]=_0xe60b1b[_0x34d6('0x64')];}this[_0x34d6('0x13')][_0xe60b1b['linkedid']]['connectedlinename']=_0xe60b1b[_0x34d6('0x32')];this[_0x34d6('0x13')][_0xe60b1b[_0x34d6('0x44')]]['destinationchannel']=_0xe60b1b[_0x34d6('0x39')];this[_0x34d6('0x13')][_0xe60b1b[_0x34d6('0x44')]]['disposition']=dispositions[_['toNumber'](_0xe60b1b[_0x34d6('0x61')])];if(_0x2bce9d){this['channels'][_0xe60b1b['linkedid']]['UserId']=_0x2bce9d['id'];this[_0x34d6('0x13')][_0xe60b1b[_0x34d6('0x44')]][_0x34d6('0x65')]=_0x2bce9d[_0x34d6('0x3e')];}}if(this[_0x34d6('0x13')][_0xe60b1b[_0x34d6('0x31')]]){if(!this['channels'][_0xe60b1b[_0x34d6('0x31')]][_0x34d6('0x62')]){this['channels'][_0xe60b1b['uniqueid']][_0x34d6('0x62')]=!![];this[_0x34d6('0x13')][_0xe60b1b['uniqueid']][_0x34d6('0x63')]=_0x28307d['format'](_0x34d6('0x47'));if(this[_0x34d6('0x13')][_0xe60b1b['uniqueid']][_0x34d6('0x46')]){this[_0x34d6('0x13')][_0xe60b1b[_0x34d6('0x31')]]['holdtime']=_0x28307d[_0x34d6('0x66')](this[_0x34d6('0x13')][_0xe60b1b[_0x34d6('0x31')]][_0x34d6('0x46')],_0x34d6('0x59'));}}if(_0xe60b1b['calleridnum']!=='xcally-motion-preview'){this['channels'][_0xe60b1b[_0x34d6('0x31')]][_0x34d6('0x3c')]=_0xe60b1b[_0x34d6('0x64')];}this['channels'][_0xe60b1b['uniqueid']][_0x34d6('0x67')]=_0xe60b1b['calleridname'];this['channels'][_0xe60b1b[_0x34d6('0x31')]][_0x34d6('0x68')]=_0xe60b1b['channel'];this[_0x34d6('0x13')][_0xe60b1b[_0x34d6('0x31')]]['disposition']=dispositions[_[_0x34d6('0x49')](_0xe60b1b['channelstate'])];}}else{if(this[_0x34d6('0x13')][_0xe60b1b[_0x34d6('0x31')]]){if(_0x2bce9d){this['channels'][_0xe60b1b['uniqueid']]['UserId']=_0x2bce9d['id'];this[_0x34d6('0x13')][_0xe60b1b[_0x34d6('0x31')]]['membername']=_0x2bce9d['name'];}}}if(_0xe60b1b['context']==='from-sip'){if(_0x2bce9d){_0x2bce9d[_0x34d6('0x3b')]=_0xe60b1b[_0x34d6('0x3a')];var _0x173e45,_0x18d62b;if(this[_0x34d6('0x13')][_0xe60b1b['uniqueid']]){_0x173e45=this[_0x34d6('0x13')][_0xe60b1b[_0x34d6('0x31')]][_0x34d6('0x69')];_0x18d62b=this['channels'][_0xe60b1b[_0x34d6('0x31')]]['queue'];}else if(this[_0x34d6('0x13')][_0xe60b1b[_0x34d6('0x44')]]){_0x173e45=this[_0x34d6('0x13')][_0xe60b1b[_0x34d6('0x44')]][_0x34d6('0x69')];_0x18d62b=this[_0x34d6('0x13')][_0xe60b1b['linkedid']][_0x34d6('0x5e')];}_0x2bce9d[_0x34d6('0x5e')]=_0x18d62b;_0x2bce9d['routealias']=_0x173e45;var _0x4fa102={'id':_0x2bce9d['id'],'name':_0x2bce9d['name'],'agentconnected':!![],'destaccountcode':_0x2bce9d[_0x34d6('0x3f')],'destconnectedlinenum':_0xe60b1b[_0x34d6('0x3a')],'queue':_0x18d62b||undefined,'routealias':_0x173e45,'uniqueid':_0xe60b1b[_0x34d6('0x44')]};logger[_0x34d6('0x33')](_0x34d6('0x6a'),_0xe60b1b['uniqueid'],util[_0x34d6('0x35')](_0x4fa102,{'showHidden':![],'depth':null}));this[_0x34d6('0x2e')](util[_0x34d6('0x3d')](_0x34d6('0x4c'),_0x2bce9d[_0x34d6('0x3e')]),_0x34d6('0x6b'),_0x4fa102);}}}}catch(_0x11f9d0){logger[_0x34d6('0x2b')](_0x34d6('0x6c'),_0xe60b1b[_0x34d6('0x31')],util[_0x34d6('0x35')](_0x11f9d0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x34d6('0x2d')]['syncMixMonitorFilename']=function(_0x27d140,_0x106604){try{if(this[_0x34d6('0x13')][_0x27d140]){logger[_0x34d6('0x29')](_0x34d6('0x6d'),_0x27d140,_0x106604);this[_0x34d6('0x13')][_0x27d140][_0x34d6('0x6e')]=!![];if(_['endsWith'](_0x106604,_0x34d6('0x6f'))){_0x106604=_0x106604[_0x34d6('0x70')](_0x34d6('0x6f'),'.WAV');}this[_0x34d6('0x13')][_0x27d140][_0x34d6('0x71')]=_0x106604;var _0x2fe76e=_[_0x34d6('0x72')](this['channels'][_0x27d140]['monitors'],{'filename':_0x106604});if(_[_0x34d6('0x5d')](_0x2fe76e)){this[_0x34d6('0x13')][_0x27d140]['monitors'][_0x34d6('0x73')]({'filename':_0x106604,'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x34d6('0x74')});}}}catch(_0x454cd3){logger[_0x34d6('0x2b')]('[%s][voiceCallReport][mixMonitorFilename]',_0x27d140,util['inspect'](_0x454cd3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x34d6('0x2d')][_0x34d6('0x1d')]=function(_0x4679cd){try{if(this[_0x34d6('0x2f')](_0x4679cd)){logger[_0x34d6('0x33')]('[%s][voiceCallReport][varset]\x20event:',_0x4679cd[_0x34d6('0x31')],util[_0x34d6('0x35')](_0x4679cd,{'showHidden':![],'depth':null}));if(this[_0x34d6('0x13')][_0x4679cd[_0x34d6('0x31')]]&&_0x4679cd[_0x34d6('0x39')]!=_0x34d6('0x43')){if(this[_0x34d6('0x2f')](_0x4679cd[_0x34d6('0x75')])){if(this[_0x34d6('0x2f')](_0x4679cd[_0x34d6('0x75')]['mixmonitor_filename'])){logger[_0x34d6('0x29')](_0x34d6('0x76'),_0x4679cd['uniqueid'],_0x4679cd[_0x34d6('0x77')]);this[_0x34d6('0x78')](_0x4679cd[_0x34d6('0x31')],_0x4679cd[_0x34d6('0x77')]);}else if(this['isNotNull'](_0x4679cd[_0x34d6('0x75')]['xmd-phone'])){logger[_0x34d6('0x29')](_0x34d6('0x79'),_0x4679cd[_0x34d6('0x31')],_0x4679cd['value']);this[_0x34d6('0x13')][_0x4679cd[_0x34d6('0x31')]]['calleridnum']=_0x4679cd[_0x34d6('0x77')];}else if(this[_0x34d6('0x2f')](_0x4679cd[_0x34d6('0x75')][_0x34d6('0x7a')])){logger[_0x34d6('0x29')](_0x34d6('0x7b'),_0x4679cd[_0x34d6('0x31')],_0x4679cd['value']);this[_0x34d6('0x13')][_0x4679cd[_0x34d6('0x31')]]['callerid']=_0x4679cd[_0x34d6('0x77')];}else if(this[_0x34d6('0x2f')](_0x4679cd[_0x34d6('0x75')][_0x34d6('0x7c')])){logger[_0x34d6('0x29')](_0x34d6('0x7d'),_0x4679cd['uniqueid'],_0x4679cd['value']);this[_0x34d6('0x13')][_0x4679cd['uniqueid']]['type']=_0x4679cd[_0x34d6('0x77')];}else if(this['isNotNull'](_0x4679cd['variable'][_0x34d6('0x7e')])){logger[_0x34d6('0x29')](_0x34d6('0x7f'),_0x4679cd['uniqueid'],_0x4679cd[_0x34d6('0x77')][_0x34d6('0x4b')](',')[0x0]);this[_0x34d6('0x13')][_0x4679cd[_0x34d6('0x31')]][_0x34d6('0x5e')]=_0x4679cd[_0x34d6('0x77')]['split'](',')[0x0];}else if(this[_0x34d6('0x2f')](_0x4679cd['variable'][_0x34d6('0x80')])){logger[_0x34d6('0x29')](_0x34d6('0x81'),_0x4679cd[_0x34d6('0x31')],_0x4679cd['value']);this[_0x34d6('0x13')][_0x4679cd[_0x34d6('0x31')]][_0x34d6('0x82')]=_0x4679cd[_0x34d6('0x77')];}else if(this[_0x34d6('0x2f')](_0x4679cd[_0x34d6('0x75')][_0x34d6('0x83')])){logger[_0x34d6('0x29')](_0x34d6('0x84'),_0x4679cd[_0x34d6('0x31')],_0x4679cd[_0x34d6('0x77')]);this[_0x34d6('0x13')][_0x4679cd['uniqueid']]['destination']=_0x4679cd[_0x34d6('0x77')];}else if(this[_0x34d6('0x2f')](_0x4679cd[_0x34d6('0x75')][_0x34d6('0x85')])){logger[_0x34d6('0x29')](_0x34d6('0x86'),_0x4679cd['uniqueid'],_0x4679cd[_0x34d6('0x77')]);this['channels'][_0x4679cd['uniqueid']][_0x34d6('0x87')]=_0x4679cd['value'];}else if(this[_0x34d6('0x2f')](_0x4679cd[_0x34d6('0x75')]['xmcs-queue'])){logger[_0x34d6('0x29')](_0x34d6('0x88'),_0x4679cd['uniqueid'],_0x4679cd['value']);this[_0x34d6('0x13')][_0x4679cd[_0x34d6('0x31')]][_0x34d6('0x5e')]=_0x4679cd[_0x34d6('0x77')];}else if(this[_0x34d6('0x2f')](_0x4679cd['variable'][_0x34d6('0x89')])){logger[_0x34d6('0x29')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x4679cd[_0x34d6('0x31')],_0x4679cd[_0x34d6('0x77')]);this['channels'][_0x4679cd[_0x34d6('0x31')]][_0x34d6('0x8a')]=_0x4679cd[_0x34d6('0x77')];}}}else if(this[_0x34d6('0x2f')](_0x4679cd[_0x34d6('0x75')]['mixmonitor_filename'])){if(_0x4679cd[_0x34d6('0x77')]){var _0x3c88da=path['parse'](_0x4679cd[_0x34d6('0x77')])[_0x34d6('0x3e')];logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x3c88da,_0x4679cd['value']);this[_0x34d6('0x78')](_0x3c88da,_0x4679cd[_0x34d6('0x77')]);}}else if(this[_0x34d6('0x13')][_0x4679cd[_0x34d6('0x44')]]){if(this[_0x34d6('0x2f')](_0x4679cd[_0x34d6('0x75')])){if(this[_0x34d6('0x2f')](_0x4679cd[_0x34d6('0x75')][_0x34d6('0x89')])){logger[_0x34d6('0x29')](_0x34d6('0x8b'),_0x4679cd[_0x34d6('0x44')],_0x4679cd[_0x34d6('0x77')]);this[_0x34d6('0x13')][_0x4679cd[_0x34d6('0x44')]]['sipcalllinkedid']=_0x4679cd[_0x34d6('0x77')];}}}}}catch(_0x414876){logger['error'](_0x34d6('0x8c'),_0x4679cd[_0x34d6('0x31')],util[_0x34d6('0x35')](_0x414876,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x34d6('0x2d')]['syncHangup']=function(_0x2587a9){try{if(this[_0x34d6('0x2f')](_0x2587a9)){logger[_0x34d6('0x33')](_0x34d6('0x8d'),_0x2587a9[_0x34d6('0x31')],util[_0x34d6('0x35')](_0x2587a9,{'showHidden':![],'depth':null}));if(this[_0x34d6('0x15')][_0x2587a9[_0x34d6('0x44')]]){if(this['channels'][this[_0x34d6('0x15')][_0x2587a9[_0x34d6('0x44')]][_0x34d6('0x44')]]){this[_0x34d6('0x13')][this['blindTransfers'][_0x2587a9[_0x34d6('0x44')]]['linkedid']][_0x34d6('0x31')]=_0x2587a9['uniqueid'];this[_0x34d6('0x13')][this[_0x34d6('0x15')][_0x2587a9[_0x34d6('0x44')]]['linkedid']][_0x34d6('0x62')]=this['channels'][_0x2587a9[_0x34d6('0x31')]][_0x34d6('0x62')];this['channels'][this[_0x34d6('0x15')][_0x2587a9[_0x34d6('0x44')]]['linkedid']]['answertime']=this['channels'][_0x2587a9[_0x34d6('0x31')]]['answertime'];this[_0x34d6('0x13')][this[_0x34d6('0x15')][_0x2587a9[_0x34d6('0x44')]][_0x34d6('0x44')]][_0x34d6('0x68')]=this['channels'][this[_0x34d6('0x15')][_0x2587a9['linkedid']][_0x34d6('0x44')]][_0x34d6('0x39')];this[_0x34d6('0x13')][this[_0x34d6('0x15')][_0x2587a9[_0x34d6('0x44')]][_0x34d6('0x44')]]['disposition']=this[_0x34d6('0x13')][_0x2587a9['uniqueid']][_0x34d6('0x48')];this[_0x34d6('0x13')][_0x2587a9[_0x34d6('0x31')]]=this[_0x34d6('0x13')][this[_0x34d6('0x15')][_0x2587a9['linkedid']][_0x34d6('0x44')]];delete this[_0x34d6('0x13')][this['blindTransfers'][_0x2587a9[_0x34d6('0x44')]]['linkedid']];}else if(this['channels'][this[_0x34d6('0x15')][_0x2587a9[_0x34d6('0x44')]]['uniqueid']]){this['channels'][this[_0x34d6('0x15')][_0x2587a9[_0x34d6('0x44')]]['uniqueid']]['uniqueid']=[this[_0x34d6('0x13')][this[_0x34d6('0x15')][_0x2587a9['linkedid']]['uniqueid']][_0x34d6('0x44')],this[_0x34d6('0x13')][this[_0x34d6('0x15')][_0x2587a9['linkedid']][_0x34d6('0x31')]][_0x34d6('0x44')]=this[_0x34d6('0x13')][this[_0x34d6('0x15')][_0x2587a9[_0x34d6('0x44')]][_0x34d6('0x31')]][_0x34d6('0x31')]][0x0];this[_0x34d6('0x13')][this[_0x34d6('0x15')][_0x2587a9['linkedid']][_0x34d6('0x31')]][_0x34d6('0x62')]=this[_0x34d6('0x13')][_0x2587a9[_0x34d6('0x31')]][_0x34d6('0x62')];this[_0x34d6('0x13')][this['blindTransfers'][_0x2587a9[_0x34d6('0x44')]][_0x34d6('0x31')]]['answertime']=this[_0x34d6('0x13')][_0x2587a9[_0x34d6('0x31')]][_0x34d6('0x63')];this['channels'][this[_0x34d6('0x15')][_0x2587a9[_0x34d6('0x44')]][_0x34d6('0x31')]][_0x34d6('0x68')]=this[_0x34d6('0x13')][this[_0x34d6('0x15')][_0x2587a9[_0x34d6('0x44')]][_0x34d6('0x31')]]['channel'];this['channels'][this['blindTransfers'][_0x2587a9[_0x34d6('0x44')]]['uniqueid']]['disposition']=this[_0x34d6('0x13')][_0x2587a9[_0x34d6('0x31')]][_0x34d6('0x48')];this[_0x34d6('0x13')][_0x2587a9[_0x34d6('0x31')]]=this['channels'][this[_0x34d6('0x15')][_0x2587a9['linkedid']]['uniqueid']];delete this[_0x34d6('0x13')][this[_0x34d6('0x15')][_0x2587a9[_0x34d6('0x44')]]['uniqueid']];}}if(this[_0x34d6('0x13')][_0x2587a9['uniqueid']]){logger[_0x34d6('0x29')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x2587a9['uniqueid'],_0x2587a9['cause-txt']);var _0x2e3660=moment();this[_0x34d6('0x13')][_0x2587a9['uniqueid']][_0x34d6('0x8e')]=_0x2e3660[_0x34d6('0x3d')](_0x34d6('0x47'));this[_0x34d6('0x13')][_0x2587a9['uniqueid']][_0x34d6('0x58')]=_0x2e3660[_0x34d6('0x66')](this[_0x34d6('0x13')][_0x2587a9[_0x34d6('0x31')]][_0x34d6('0x46')],'seconds');if(this['channels'][_0x2587a9[_0x34d6('0x31')]][_0x34d6('0x62')]){this[_0x34d6('0x13')][_0x2587a9[_0x34d6('0x31')]][_0x34d6('0x8f')]=_0x2e3660[_0x34d6('0x66')](this[_0x34d6('0x13')][_0x2587a9[_0x34d6('0x31')]][_0x34d6('0x63')],_0x34d6('0x59'));this['channels'][_0x2587a9[_0x34d6('0x31')]][_0x34d6('0x90')]=this[_0x34d6('0x13')][_0x2587a9[_0x34d6('0x31')]][_0x34d6('0x58')]-this[_0x34d6('0x13')][_0x2587a9[_0x34d6('0x31')]]['billableseconds'];}if(_0x2587a9[_0x34d6('0x37')]===_0x34d6('0x38')){if(this[_0x34d6('0x14')][_0x2587a9[_0x34d6('0x39')][_0x34d6('0x4b')]('-')[0x0]]){this[_0x34d6('0x14')][_0x2587a9[_0x34d6('0x39')][_0x34d6('0x4b')]('-')[0x0]]=_[_0x34d6('0x91')](this[_0x34d6('0x14')][_0x2587a9[_0x34d6('0x39')][_0x34d6('0x4b')]('-')[0x0]],[_0x34d6('0x3b')]);logger[_0x34d6('0x33')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x2587a9[_0x34d6('0x31')],util[_0x34d6('0x35')]({'id':this[_0x34d6('0x14')][_0x2587a9[_0x34d6('0x39')][_0x34d6('0x4b')]('-')[0x0]]['id'],'destaccountcode':this[_0x34d6('0x14')][_0x2587a9[_0x34d6('0x39')][_0x34d6('0x4b')]('-')[0x0]][_0x34d6('0x3f')]},{'showHidden':![],'depth':null}));this[_0x34d6('0x2e')](util[_0x34d6('0x3d')](_0x34d6('0x4c'),this[_0x34d6('0x14')][_0x2587a9[_0x34d6('0x39')][_0x34d6('0x4b')]('-')[0x0]][_0x34d6('0x3e')]),'user:agentcomplete',{'id':this[_0x34d6('0x14')][_0x2587a9[_0x34d6('0x39')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x34d6('0x14')][_0x2587a9['channel']['split']('-')[0x0]][_0x34d6('0x3f')]});for(var _0x25b448=0x0;_0x25b4480x0?!![]:![];if(!_0x45ed1f){return this[_0x3371('0x1c')](this[_0x3371('0x16')][_0x3371('0x70')]);}};VoiceQueueReport[_0x3371('0xc')]['syncQueueMember']=function(_0x2f8231){var _0x56b0ac=this[_0x3371('0x16')]['id'];if(this[_0x3371('0x16')][_0x3371('0x63')][_0x56b0ac]&&this[_0x3371('0x16')][_0x3371('0x63')][_0x56b0ac][_0x2f8231[_0x3371('0x62')]]){this['summary'][_0x3371('0x63')][_0x56b0ac][_0x2f8231[_0x3371('0x62')]][_0x3371('0x11')][_0x3371('0x71')](_0x2f8231);}};VoiceQueueReport[_0x3371('0xc')][_0x3371('0x19')]=function(_0x434b8f){var _0x3e58e1=this;try{if(this[_0x3371('0x5a')](_0x434b8f)&&this[_0x3371('0x5a')](_0x434b8f[_0x3371('0x4f')])){logger['debug']('[voiceQueueReport][queuesummary]\x20event:',util['inspect'](_0x434b8f,{'showHidden':![],'depth':null}));var _0x3a4330=this[_0x3371('0x14')][_0x434b8f[_0x3371('0x4f')]];if(_0x3a4330){logger[_0x3371('0x4a')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x3a4330['name']);this[_0x3371('0x16')]['queues'][_0x3a4330[_0x3371('0x65')]]={'summaryEvent':_0x434b8f};this[_0x3371('0x16')][_0x3371('0x6f')]+=0x1;return ami[_0x3371('0x3d')]({'action':_0x3371('0x63'),'queue':_0x3a4330[_0x3371('0x65')]})['then'](function(_0xc2ebd3){if(!_0x3e58e1[_0x3371('0x16')]['queuestatus'][_0x434b8f['actionid']]){_0x3e58e1[_0x3371('0x16')][_0x3371('0x63')][_0x434b8f['actionid']]={};}_0x3e58e1['summary'][_0x3371('0x63')][_0x434b8f[_0x3371('0x62')]][_0xc2ebd3[_0x3371('0x62')]]={'queue':_0x3a4330[_0x3371('0x65')],'agents':[]};})['catch'](function(_0x22bcb0){throw _0x22bcb0;});}}}catch(_0x2a9612){logger[_0x3371('0x44')](_0x3371('0x72'),util[_0x3371('0x42')](_0x2a9612,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3371('0xc')][_0x3371('0x1c')]=function(_0x55e386){if(this[_0x3371('0x16')]['statusRequests']>0x0){this['summary']['completeEvent']=_0x55e386;return;}logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util['inspect'](_0x55e386,{'showHidden':![],'depth':null}));this[_0x3371('0x16')]=initializeSummary();ami[_0x3371('0x49')](_0x3371('0x73'),{});};VoiceQueueReport['prototype'][_0x3371('0x20')]=function(_0x158ded){try{if(this[_0x3371('0x5a')](_0x158ded)){logger[_0x3371('0x4a')](_0x3371('0x74'),_0x158ded[_0x3371('0x4d')],util[_0x3371('0x42')](_0x158ded,{'showHidden':![],'depth':null}));if(_[_0x3371('0x5b')](this[_0x3371('0x43')][_0x158ded[_0x3371('0x4d')]])){this[_0x3371('0x43')][_0x158ded[_0x3371('0x4d')]]=[];}if(_[_0x3371('0x5b')](this[_0x3371('0x12')][_0x158ded[_0x3371('0x4d')]])){this['channels'][_0x158ded[_0x3371('0x4d')]]={};}var _0x40ea72=new QueueReport();_0x40ea72[_0x3371('0x4f')]=_0x158ded[_0x3371('0x4f')];_0x40ea72[_0x3371('0x56')]=this[_0x3371('0x14')][_0x40ea72[_0x3371('0x4f')]]&&this[_0x3371('0x14')][_0x40ea72['queue']][_0x3371('0x56')]?this['voiceQueues'][_0x40ea72['queue']]['type']||_0x3371('0x57'):_0x3371('0x57');_0x40ea72['queuecallerjoinAt']=moment()[_0x3371('0x53')](_0x3371('0x75'));_0x40ea72['position']=_0x158ded[_0x3371('0x76')];_0x40ea72[_0x3371('0x77')]=_0x158ded[_0x3371('0x77')];_0x40ea72['uniqueid']=_0x158ded[_0x3371('0x4d')];_0x40ea72[_0x3371('0x78')]=this[_0x3371('0x12')][_0x158ded[_0x3371('0x4d')]][_0x3371('0x78')];logger[_0x3371('0x79')](_0x3371('0x7a'),_0x40ea72[_0x3371('0x4f')],_0x40ea72['type']);Object[_0x3371('0x6b')](_0x40ea72,_[_0x3371('0x7b')](_0x158ded,_[_0x3371('0x7c')](_0x40ea72)));this[_0x3371('0x43')][_0x158ded[_0x3371('0x4d')]][_0x3371('0x71')](_0x40ea72);this[_0x3371('0x12')][_0x158ded[_0x3371('0x4d')]]=_0x40ea72;this['emitVoiceQueueChannelSave'](_0x40ea72,_0x3371('0x7d'));}}catch(_0x57a625){logger[_0x3371('0x44')](_0x3371('0x74'),_0x158ded[_0x3371('0x4d')],util[_0x3371('0x42')](_0x57a625,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3371('0xc')]['syncQueueCallerAbandon']=function(_0x10169e){try{if(this[_0x3371('0x5a')](_0x10169e)){logger[_0x3371('0x4a')]('[%s][voiceQueueReport][queuecallerabandon]',_0x10169e[_0x3371('0x4d')],util[_0x3371('0x42')](_0x10169e,{'showHidden':![],'depth':null}));if(this[_0x3371('0x43')][_0x10169e[_0x3371('0x4d')]]){var _0x377842=_[_0x3371('0x7e')](this[_0x3371('0x43')][_0x10169e['uniqueid']]);_0x377842[_0x3371('0x3a')]=![];_0x377842[_0x3371('0x7f')]=null;_0x377842['holdtime']=_0x10169e['holdtime'];_0x377842['originalposition']=_0x10169e[_0x3371('0x80')];_0x377842['queuecallerabandon']=!![];_0x377842[_0x3371('0x81')]=moment()['format'](_0x3371('0x75'));_0x377842['queuecallerexitreason']='ABANDONED';_0x377842[_0x3371('0x82')]=null;logger[_0x3371('0x79')](_0x3371('0x83'),_0x377842['queue'],_0x377842[_0x3371('0x56')]);this[_0x3371('0x12')][_0x10169e['uniqueid']]=_0x377842;this[_0x3371('0x48')](_0x377842,'queuecallerabandon');}}}catch(_0x3e600b){logger[_0x3371('0x44')](_0x3371('0x84'),_0x10169e[_0x3371('0x4d')],util[_0x3371('0x42')](_0x3e600b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3371('0x24')]=function(_0x49c248){try{if(this[_0x3371('0x5a')](_0x49c248)){logger[_0x3371('0x4a')](_0x3371('0x85'),_0x49c248[_0x3371('0x4d')],util[_0x3371('0x42')](_0x49c248,{'showHidden':![],'depth':null}));if(this[_0x3371('0x43')][_0x49c248['uniqueid']]){var _0x2ca87f=_[_0x3371('0x7e')](this[_0x3371('0x43')][_0x49c248['uniqueid']]);_0x2ca87f[_0x3371('0x86')]=moment()[_0x3371('0x53')](_0x3371('0x75'));_0x2ca87f[_0x3371('0x87')]=_0x49c248[_0x3371('0x87')];_0x2ca87f[_0x3371('0x88')]=_0x49c248['connectedlinename'];logger[_0x3371('0x79')](_0x3371('0x89'),_0x2ca87f[_0x3371('0x4f')],_0x2ca87f[_0x3371('0x56')],_0x49c248[_0x3371('0x87')],_0x49c248['connectedlinename']);this[_0x3371('0x12')][_0x49c248[_0x3371('0x4d')]]=_0x2ca87f;this[_0x3371('0x8a')](_0x2ca87f,_0x3371('0x23'));}}}catch(_0x23b8ce){logger[_0x3371('0x44')](_0x3371('0x85'),_0x49c248[_0x3371('0x4d')],util[_0x3371('0x42')](_0x23b8ce,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3371('0xc')][_0x3371('0x27')]=function(_0x7372c1){try{if(this['isNotNull'](_0x7372c1)){logger[_0x3371('0x4a')]('[%s][voiceQueueReport][agentconnect]',_0x7372c1[_0x3371('0x4d')],util[_0x3371('0x42')](_0x7372c1,{'showHidden':![],'depth':null}));if(this[_0x3371('0x43')][_0x7372c1[_0x3371('0x4d')]]){var _0x18e19d=_[_0x3371('0x7e')](this[_0x3371('0x43')][_0x7372c1['uniqueid']]);_0x18e19d[_0x3371('0x3a')]=!![];_0x18e19d[_0x3371('0x52')]=_0x3371('0x8b');logger[_0x3371('0x79')](_0x3371('0x8c'),_0x18e19d[_0x3371('0x4f')],_0x18e19d['type']);}}}catch(_0x3256d6){logger[_0x3371('0x44')](_0x3371('0x8d'),_0x7372c1[_0x3371('0x4d')],util['inspect'](_0x3256d6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3371('0x8e')]=function(_0x14556b){try{if(this[_0x3371('0x5a')](_0x14556b)){logger[_0x3371('0x4a')](_0x3371('0x8f'),_0x14556b[_0x3371('0x4d')],util[_0x3371('0x42')](_0x14556b,{'showHidden':![],'depth':null}));if(this[_0x3371('0x43')][_0x14556b[_0x3371('0x4d')]]){var _0x2eebbc=_[_0x3371('0x7e')](this[_0x3371('0x43')][_0x14556b[_0x3371('0x4d')]]);_0x2eebbc['queuecallerabandon']=![];_0x2eebbc[_0x3371('0x81')]=null;_0x2eebbc[_0x3371('0x90')]=!![];_0x2eebbc[_0x3371('0x82')]=_0x14556b[_0x3371('0x91')];_0x2eebbc[_0x3371('0x92')]=_0x14556b[_0x3371('0x92')];_0x2eebbc['queuecallercomplete']=!![];_0x2eebbc[_0x3371('0x93')]=![];_0x2eebbc[_0x3371('0x94')]=null;if(!_0x2eebbc['transfer']){if(_0x14556b['reason']==_0x3371('0x95')){_0x2eebbc[_0x3371('0x52')]=_0x3371('0x96');logger['info'](_0x3371('0x97'),_0x2eebbc[_0x3371('0x4f')],_0x2eebbc['type']);}else{if(_['startsWith'](_0x14556b['channel'][_0x3371('0x98')](),_0x3371('0x99'))){if(this[_0x3371('0x43')][_0x14556b[_0x3371('0x9a')]]){var _0x37e3e2=_[_0x3371('0x7e')](this[_0x3371('0x43')][_0x14556b[_0x3371('0x9a')]]);_0x37e3e2['queuecallercomplete']=![];_0x37e3e2[_0x3371('0x93')]=!![];_0x37e3e2[_0x3371('0x94')]=moment(_0x2eebbc[_0x3371('0x9b')])[_0x3371('0x9c')](_0x14556b['holdtime'],'seconds')['format'](_0x3371('0x75'));_0x37e3e2[_0x3371('0x52')]=_0x3371('0x9d');_0x37e3e2[_0x3371('0x95')]=!![];_0x37e3e2[_0x3371('0x9e')]=_0x3371('0x9f');_0x37e3e2[_0x3371('0xa0')]=_0x14556b['destexten'];_0x37e3e2[_0x3371('0xa1')]=_0x14556b[_0x3371('0x4d')];logger[_0x3371('0x79')](_0x3371('0xa2'),_0x37e3e2['queue'],_0x37e3e2[_0x3371('0x56')]);var _0x3056da=this[_0x3371('0x43')][_0x14556b[_0x3371('0x9a')]];this[_0x3371('0x43')][_0x14556b[_0x3371('0x9a')]]=this[_0x3371('0x43')][_0x14556b[_0x3371('0x4d')]];this[_0x3371('0x43')][_0x14556b['uniqueid']]=_0x3056da;}}else{_0x2eebbc[_0x3371('0x52')]='COMPLETEDBY'+_0x14556b['reason']['toUpperCase']();logger[_0x3371('0x79')](_0x3371('0xa3'),_0x2eebbc[_0x3371('0x4f')],_0x2eebbc['type'],_0x2eebbc['queuecallerexitreason']);}}}this[_0x3371('0x12')][_0x14556b[_0x3371('0x4d')]]=_0x2eebbc;}}}catch(_0x10cc2f){logger[_0x3371('0x44')](_0x3371('0x8f'),_0x14556b['uniqueid'],util[_0x3371('0x42')](_0x10cc2f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3371('0x28')]=function(_0x1f2690){try{if(this['isNotNull'](_0x1f2690)){logger['debug'](_0x3371('0xa4'),_0x1f2690[_0x3371('0x4d')],util[_0x3371('0x42')](_0x1f2690,{'showHidden':![],'depth':null}));this[_0x3371('0xa5')](_0x1f2690[_0x3371('0x4d')],_[_0x3371('0x7c')](_0x1f2690['variable'])[0x0],_0x1f2690[_0x3371('0xa6')]);if(this[_0x3371('0x43')][_0x1f2690[_0x3371('0x4d')]]){var _0x3703aa=_['last'](this[_0x3371('0x43')][_0x1f2690[_0x3371('0x4d')]]);if(_0x3703aa){if(this[_0x3371('0x5a')](_0x1f2690[_0x3371('0xa7')])&&this[_0x3371('0x5a')](_0x1f2690[_0x3371('0xa7')]['queuestatus'])){switch(_0x1f2690[_0x3371('0xa6')]){case _0x3371('0xa8'):_0x3703aa['queuecallerexit']=![];_0x3703aa[_0x3371('0x94')]=null;break;case _0x3371('0xa9'):_0x3703aa[_0x3371('0xaa')]=_0x3371('0xab');_0x3703aa[_0x3371('0x93')]=!![];_0x3703aa[_0x3371('0x94')]=moment()[_0x3371('0x53')](_0x3371('0x75'));_0x3703aa['queuecallerleaveAt']=moment()[_0x3371('0x53')](_0x3371('0x75'));logger[_0x3371('0x4a')](_0x3371('0xac'),_0x1f2690['uniqueid'],util[_0x3371('0x42')](_0x3703aa,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x3703aa);break;default:_0x3703aa['queuecallerexit']=!![];_0x3703aa[_0x3371('0x94')]=moment()[_0x3371('0x53')](_0x3371('0x75'));_0x3703aa[_0x3371('0x86')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x3703aa[_0x3371('0x21')]=![];_0x3703aa[_0x3371('0x81')]=null;_0x3703aa[_0x3371('0x52')]=_0x1f2690[_0x3371('0xa6')];this[_0x3371('0x12')][_0x1f2690[_0x3371('0x4d')]]=_0x3703aa;this['emitVoiceQueueChannelRemove'](_0x3703aa,_0x3371('0xad'));}else if(this[_0x3371('0x5a')](_0x1f2690[_0x3371('0xa7')])&&this[_0x3371('0x5a')](_0x1f2690[_0x3371('0xa7')][_0x3371('0xae')])){if(!_0x3703aa[_0x3371('0x21')]){_0x3703aa[_0x3371('0x93')]=!![];_0x3703aa[_0x3371('0x94')]=moment()[_0x3371('0x53')](_0x3371('0x75'));_0x3703aa[_0x3371('0x52')]=_0x3371('0xaf');_0x3703aa['queuecallerleaveAt']=moment()['format'](_0x3371('0x75'));this[_0x3371('0x12')][_0x1f2690['uniqueid']]=_0x3703aa;}}logger['info'](_0x3371('0xb0'),_0x1f2690[_0x3371('0x4d')],_0x3703aa[_0x3371('0x4f')],_0x3703aa[_0x3371('0x56')],_[_0x3371('0x7c')](_0x1f2690[_0x3371('0xa7')])[0x0],_0x1f2690[_0x3371('0xa6')]);_0x3703aa['variables']=this[_0x3371('0x17')][_0x1f2690['uniqueid']];}}}}catch(_0x3638cb){logger[_0x3371('0x44')](_0x3371('0xa4'),_0x1f2690['uniqueid'],util['inspect'](_0x3638cb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3371('0xc')][_0x3371('0xa5')]=function(_0x14b009,_0x4f2158,_0x16859b){var _0x1a0cda=[_0x3371('0xb1'),_0x3371('0xb2'),_0x3371('0xb3'),_0x3371('0xb4'),'rtpaudioqosloss',_0x3371('0xb5'),_0x3371('0xb6'),_0x3371('0xb7'),_0x3371('0xb8'),_0x3371('0xb9'),'bridgepeer',_0x3371('0xba'),_0x3371('0xbb'),_0x3371('0xbc'),_0x3371('0xbd'),_0x3371('0xbe'),'membername',_0x3371('0xbf'),_0x3371('0xc0')];if(!_[_0x3371('0x3c')](_0x4f2158)&&!_[_0x3371('0xc1')](_0x1a0cda,_0x4f2158)){if(_['isUndefined'](this[_0x3371('0x17')][_0x14b009])){this[_0x3371('0x17')][_0x14b009]={};}this[_0x3371('0x17')][_0x14b009][_0x4f2158]=_0x16859b;}};VoiceQueueReport[_0x3371('0xc')][_0x3371('0xc2')]=function(_0x558b17,_0x187798,_0x17c905){try{var _0x32366b={};if(this[_0x3371('0x43')][_0x558b17]){for(var _0x8c7c19=0x0;_0x8c7c190x0?!![]:![];if(!_0x337fac){return this[_0xec39('0x1b')](this[_0xec39('0x15')][_0xec39('0x6f')]);}};VoiceQueueReport[_0xec39('0xb')][_0xec39('0x1d')]=function(_0x105700){var _0x1c2453=this[_0xec39('0x15')]['id'];if(this[_0xec39('0x15')]['queuestatus'][_0x1c2453]&&this[_0xec39('0x15')][_0xec39('0x66')][_0x1c2453][_0x105700[_0xec39('0x65')]]){this[_0xec39('0x15')][_0xec39('0x66')][_0x1c2453][_0x105700[_0xec39('0x65')]][_0xec39('0x10')][_0xec39('0x70')](_0x105700);}};VoiceQueueReport[_0xec39('0xb')][_0xec39('0x18')]=function(_0x181ab3){var _0x3818d7=this;try{if(this[_0xec39('0x5f')](_0x181ab3)&&this[_0xec39('0x5f')](_0x181ab3['queue'])){logger[_0xec39('0x4e')](_0xec39('0x71'),util[_0xec39('0x48')](_0x181ab3,{'showHidden':![],'depth':null}));var _0x129f30=this[_0xec39('0x13')][_0x181ab3[_0xec39('0x51')]];if(_0x129f30){logger['debug'](_0xec39('0x72'),_0x129f30[_0xec39('0x5e')]);this[_0xec39('0x15')][_0xec39('0x60')][_0x129f30['name']]={'summaryEvent':_0x181ab3};this['summary']['statusRequests']+=0x1;return ami['Action']({'action':_0xec39('0x66'),'queue':_0x129f30[_0xec39('0x5e')]})[_0xec39('0x64')](function(_0x372fbb){if(!_0x3818d7[_0xec39('0x15')][_0xec39('0x66')][_0x181ab3[_0xec39('0x65')]]){_0x3818d7[_0xec39('0x15')]['queuestatus'][_0x181ab3[_0xec39('0x65')]]={};}_0x3818d7[_0xec39('0x15')][_0xec39('0x66')][_0x181ab3[_0xec39('0x65')]][_0x372fbb[_0xec39('0x65')]]={'queue':_0x129f30[_0xec39('0x5e')],'agents':[]};})[_0xec39('0x61')](function(_0x1010b6){throw _0x1010b6;});}}}catch(_0x599395){logger[_0xec39('0x46')](_0xec39('0x73'),util[_0xec39('0x48')](_0x599395,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xec39('0xb')]['syncQueueSummaryComplete']=function(_0x28b23b){if(this[_0xec39('0x15')]['statusRequests']>0x0){this[_0xec39('0x15')][_0xec39('0x6f')]=_0x28b23b;return;}logger[_0xec39('0x4e')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xec39('0x48')](_0x28b23b,{'showHidden':![],'depth':null}));this[_0xec39('0x15')]=initializeSummary();ami[_0xec39('0x4d')](_0xec39('0x74'),{});};VoiceQueueReport[_0xec39('0xb')][_0xec39('0x1f')]=function(_0x100138){try{if(this[_0xec39('0x5f')](_0x100138)){logger[_0xec39('0x4e')]('[%s][voiceQueueReport][queuecallerjoin]',_0x100138[_0xec39('0x4f')],util[_0xec39('0x48')](_0x100138,{'showHidden':![],'depth':null}));if(_[_0xec39('0x75')](this[_0xec39('0x45')][_0x100138[_0xec39('0x4f')]])){this['queueReports'][_0x100138[_0xec39('0x4f')]]=[];}if(_[_0xec39('0x75')](this[_0xec39('0x11')][_0x100138[_0xec39('0x4f')]])){this[_0xec39('0x11')][_0x100138[_0xec39('0x4f')]]={};}var _0x15adad=new QueueReport();_0x15adad[_0xec39('0x51')]=_0x100138[_0xec39('0x51')];_0x15adad[_0xec39('0x5b')]=this['voiceQueues'][_0x15adad[_0xec39('0x51')]]&&this[_0xec39('0x13')][_0x15adad[_0xec39('0x51')]][_0xec39('0x5b')]?this[_0xec39('0x13')][_0x15adad[_0xec39('0x51')]][_0xec39('0x5b')]||_0xec39('0x5c'):_0xec39('0x5c');_0x15adad['queuecallerjoinAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x15adad['position']=_0x100138[_0xec39('0x76')];_0x15adad[_0xec39('0x77')]=_0x100138['count'];_0x15adad[_0xec39('0x4f')]=_0x100138[_0xec39('0x4f')];_0x15adad[_0xec39('0x78')]=this[_0xec39('0x11')][_0x100138[_0xec39('0x4f')]][_0xec39('0x78')];logger[_0xec39('0x79')](_0xec39('0x7a'),_0x15adad['queue'],_0x15adad[_0xec39('0x5b')]);Object[_0xec39('0x6b')](_0x15adad,_[_0xec39('0x7b')](_0x100138,_['keys'](_0x15adad)));this['queueReports'][_0x100138[_0xec39('0x4f')]][_0xec39('0x70')](_0x15adad);this[_0xec39('0x11')][_0x100138[_0xec39('0x4f')]]=_0x15adad;this[_0xec39('0x7c')](_0x15adad,_0xec39('0x7d'));}}catch(_0x2468f7){logger[_0xec39('0x46')]('[%s][voiceQueueReport][queuecallerjoin]',_0x100138['uniqueid'],util[_0xec39('0x48')](_0x2468f7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xec39('0xb')][_0xec39('0x21')]=function(_0x408e7f){try{if(this[_0xec39('0x5f')](_0x408e7f)){logger['debug'](_0xec39('0x7e'),_0x408e7f['uniqueid'],util[_0xec39('0x48')](_0x408e7f,{'showHidden':![],'depth':null}));if(this[_0xec39('0x45')][_0x408e7f['uniqueid']]){var _0x185c8e=_['last'](this['queueReports'][_0x408e7f[_0xec39('0x4f')]]);_0x185c8e[_0xec39('0x3a')]=![];_0x185c8e[_0xec39('0x7f')]=null;_0x185c8e[_0xec39('0x80')]=_0x408e7f[_0xec39('0x80')];_0x185c8e[_0xec39('0x81')]=_0x408e7f[_0xec39('0x81')];_0x185c8e['queuecallerabandon']=!![];_0x185c8e[_0xec39('0x82')]=moment()['format'](_0xec39('0x83'));_0x185c8e[_0xec39('0x57')]=_0xec39('0x84');_0x185c8e['lastAssignedTo']=null;logger[_0xec39('0x79')](_0xec39('0x85'),_0x185c8e[_0xec39('0x51')],_0x185c8e[_0xec39('0x5b')]);this[_0xec39('0x11')][_0x408e7f['uniqueid']]=_0x185c8e;this[_0xec39('0x54')](_0x185c8e,'queuecallerabandon');}}}catch(_0x4feedd){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0x408e7f[_0xec39('0x4f')],util[_0xec39('0x48')](_0x4feedd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xec39('0xb')][_0xec39('0x86')]=function(_0x2c2e89){try{if(this[_0xec39('0x5f')](_0x2c2e89)){logger['debug'](_0xec39('0x87'),_0x2c2e89[_0xec39('0x4f')],util[_0xec39('0x48')](_0x2c2e89,{'showHidden':![],'depth':null}));if(this[_0xec39('0x45')][_0x2c2e89[_0xec39('0x4f')]]){var _0x197d71=_['last'](this['queueReports'][_0x2c2e89[_0xec39('0x4f')]]);_0x197d71['queuecallerleaveAt']=moment()[_0xec39('0x59')](_0xec39('0x83'));_0x197d71[_0xec39('0x88')]=_0x2c2e89['connectedlinenum'];_0x197d71['connectedlinename']=_0x2c2e89[_0xec39('0x89')];logger[_0xec39('0x79')](_0xec39('0x8a'),_0x197d71[_0xec39('0x51')],_0x197d71[_0xec39('0x5b')],_0x2c2e89['connectedlinenum'],_0x2c2e89['connectedlinename']);this[_0xec39('0x11')][_0x2c2e89[_0xec39('0x4f')]]=_0x197d71;this[_0xec39('0x7c')](_0x197d71,_0xec39('0x22'));}}}catch(_0x542d1d){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x2c2e89[_0xec39('0x4f')],util[_0xec39('0x48')](_0x542d1d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xec39('0xb')]['syncAgentConnect']=function(_0x527367){try{if(this['isNotNull'](_0x527367)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x527367[_0xec39('0x4f')],util[_0xec39('0x48')](_0x527367,{'showHidden':![],'depth':null}));if(this[_0xec39('0x45')][_0x527367['uniqueid']]){var _0x52f29a=_[_0xec39('0x8b')](this['queueReports'][_0x527367[_0xec39('0x4f')]]);_0x52f29a['queuecallercomplete']=!![];_0x52f29a['queuecallerexitreason']=_0xec39('0x8c');logger['info']('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x52f29a['queue'],_0x52f29a[_0xec39('0x5b')]);}}}catch(_0x1aa2f1){logger[_0xec39('0x46')]('[%s][voiceQueueReport][agentconnect]',_0x527367[_0xec39('0x4f')],util[_0xec39('0x48')](_0x1aa2f1,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x24cfdf){try{if(this[_0xec39('0x5f')](_0x24cfdf)){logger[_0xec39('0x4e')](_0xec39('0x8d'),_0x24cfdf[_0xec39('0x4f')],util['inspect'](_0x24cfdf,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x24cfdf['uniqueid']]){var _0x5b7493=_[_0xec39('0x8b')](this[_0xec39('0x45')][_0x24cfdf[_0xec39('0x4f')]]);_0x5b7493[_0xec39('0x20')]=![];_0x5b7493['queuecallerabandonAt']=null;_0x5b7493[_0xec39('0x8e')]=!![];_0x5b7493['lastAssignedTo']=_0x24cfdf['membername'];_0x5b7493[_0xec39('0x80')]=_0x24cfdf['holdtime'];_0x5b7493[_0xec39('0x3a')]=!![];_0x5b7493[_0xec39('0x8f')]=![];_0x5b7493[_0xec39('0x90')]=null;if(!_0x5b7493[_0xec39('0x91')]){if(_0x24cfdf[_0xec39('0x92')]==_0xec39('0x91')){_0x5b7493[_0xec39('0x57')]=_0xec39('0x93');logger[_0xec39('0x79')](_0xec39('0x94'),_0x5b7493['queue'],_0x5b7493[_0xec39('0x5b')]);}else{if(_[_0xec39('0x95')](_0x24cfdf[_0xec39('0x41')]['toLowerCase'](),_0xec39('0x96'))){if(this[_0xec39('0x45')][_0x24cfdf[_0xec39('0x97')]]){var _0x56c57b=_['last'](this[_0xec39('0x45')][_0x24cfdf[_0xec39('0x97')]]);_0x56c57b['queuecallercomplete']=![];_0x56c57b[_0xec39('0x8f')]=!![];_0x56c57b['queuecallerexitAt']=moment(_0x5b7493[_0xec39('0x98')])[_0xec39('0x99')](_0x24cfdf['holdtime'],_0xec39('0x9a'))['format'](_0xec39('0x83'));_0x56c57b[_0xec39('0x57')]=_0xec39('0x9b');_0x56c57b[_0xec39('0x91')]=!![];_0x56c57b['transfertype']=_0xec39('0x9c');_0x56c57b[_0xec39('0x9d')]=_0x24cfdf[_0xec39('0x9e')];_0x56c57b[_0xec39('0x9f')]=_0x24cfdf[_0xec39('0x4f')];logger[_0xec39('0x79')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x56c57b[_0xec39('0x51')],_0x56c57b['type']);var _0x4a2002=this[_0xec39('0x45')][_0x24cfdf[_0xec39('0x97')]];this[_0xec39('0x45')][_0x24cfdf[_0xec39('0x97')]]=this[_0xec39('0x45')][_0x24cfdf[_0xec39('0x4f')]];this[_0xec39('0x45')][_0x24cfdf[_0xec39('0x4f')]]=_0x4a2002;}}else{_0x5b7493[_0xec39('0x57')]=_0xec39('0xa0')+_0x24cfdf['reason'][_0xec39('0xa1')]();logger[_0xec39('0x79')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x5b7493[_0xec39('0x51')],_0x5b7493['type'],_0x5b7493['queuecallerexitreason']);}}}this[_0xec39('0x11')][_0x24cfdf[_0xec39('0x4f')]]=_0x5b7493;}}}catch(_0x143546){logger[_0xec39('0x46')](_0xec39('0x8d'),_0x24cfdf[_0xec39('0x4f')],util['inspect'](_0x143546,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xec39('0xb')][_0xec39('0x27')]=function(_0x76f1eb){try{if(this['isNotNull'](_0x76f1eb)){logger['debug'](_0xec39('0xa2'),_0x76f1eb['uniqueid'],util[_0xec39('0x48')](_0x76f1eb,{'showHidden':![],'depth':null}));this[_0xec39('0xa3')](_0x76f1eb[_0xec39('0x4f')],_[_0xec39('0xa4')](_0x76f1eb[_0xec39('0xa5')])[0x0],_0x76f1eb['value']);if(this[_0xec39('0x45')][_0x76f1eb[_0xec39('0x4f')]]){var _0x269b6d=_[_0xec39('0x8b')](this['queueReports'][_0x76f1eb[_0xec39('0x4f')]]);if(_0x269b6d){if(this[_0xec39('0x5f')](_0x76f1eb[_0xec39('0xa5')])&&this[_0xec39('0x5f')](_0x76f1eb['variable'][_0xec39('0x66')])){switch(_0x76f1eb[_0xec39('0xa6')]){case _0xec39('0xa7'):_0x269b6d[_0xec39('0x8f')]=![];_0x269b6d[_0xec39('0x90')]=null;break;case _0xec39('0xa8'):_0x269b6d[_0xec39('0xa9')]=_0xec39('0xaa');_0x269b6d[_0xec39('0x8f')]=!![];_0x269b6d[_0xec39('0x90')]=moment()[_0xec39('0x59')](_0xec39('0x83'));_0x269b6d['queuecallerleaveAt']=moment()[_0xec39('0x59')](_0xec39('0x83'));logger[_0xec39('0x4e')](_0xec39('0xab'),_0x76f1eb[_0xec39('0x4f')],util[_0xec39('0x48')](_0x269b6d,{'showHidden':![],'depth':null}));ami[_0xec39('0x4d')](_0xec39('0xac'),_0x269b6d);break;default:_0x269b6d[_0xec39('0x8f')]=!![];_0x269b6d[_0xec39('0x90')]=moment()['format'](_0xec39('0x83'));_0x269b6d['queuecallerleaveAt']=moment()[_0xec39('0x59')]('YYYY-MM-DD\x20HH:mm:ss');}_0x269b6d['queuecallerabandon']=![];_0x269b6d['queuecallerabandonAt']=null;_0x269b6d[_0xec39('0x57')]=_0x76f1eb[_0xec39('0xa6')];this[_0xec39('0x11')][_0x76f1eb[_0xec39('0x4f')]]=_0x269b6d;this[_0xec39('0x54')](_0x269b6d,_0xec39('0xad'));}else if(this[_0xec39('0x5f')](_0x76f1eb[_0xec39('0xa5')])&&this[_0xec39('0x5f')](_0x76f1eb[_0xec39('0xa5')][_0xec39('0xae')])){if(!_0x269b6d[_0xec39('0x20')]){_0x269b6d[_0xec39('0x8f')]=!![];_0x269b6d['queuecallerexitAt']=moment()[_0xec39('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x269b6d['queuecallerexitreason']=_0xec39('0xaf');_0x269b6d[_0xec39('0xb0')]=moment()[_0xec39('0x59')](_0xec39('0x83'));this[_0xec39('0x11')][_0x76f1eb['uniqueid']]=_0x269b6d;}}logger[_0xec39('0x79')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x76f1eb[_0xec39('0x4f')],_0x269b6d[_0xec39('0x51')],_0x269b6d[_0xec39('0x5b')],_[_0xec39('0xa4')](_0x76f1eb[_0xec39('0xa5')])[0x0],_0x76f1eb['value']);_0x269b6d[_0xec39('0x16')]=this[_0xec39('0x16')][_0x76f1eb[_0xec39('0x4f')]];}}}}catch(_0x5e1dad){logger[_0xec39('0x46')](_0xec39('0xa2'),_0x76f1eb[_0xec39('0x4f')],util[_0xec39('0x48')](_0x5e1dad,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0x373113,_0x29fc2f,_0x2f0d94){var _0x1b06f5=[_0xec39('0xb1'),'rtpaudioqosbridged',_0xec39('0xb2'),_0xec39('0xb3'),_0xec39('0xb4'),_0xec39('0xb5'),'rtpaudioqosrtt',_0xec39('0xb6'),_0xec39('0xb7'),_0xec39('0xb8'),_0xec39('0xb9'),_0xec39('0xba'),_0xec39('0xbb'),_0xec39('0xbc'),_0xec39('0xbd'),'memberlastcall',_0xec39('0xbe'),'memberpenalty',_0xec39('0xbf')];if(!_[_0xec39('0x3e')](_0x29fc2f)&&!_[_0xec39('0xc0')](_0x1b06f5,_0x29fc2f)){if(_['isUndefined'](this[_0xec39('0x16')][_0x373113])){this['variables'][_0x373113]={};}this[_0xec39('0x16')][_0x373113][_0x29fc2f]=_0x2f0d94;}};VoiceQueueReport[_0xec39('0xb')][_0xec39('0xc1')]=function(_0x3e932a,_0x5b30de,_0x4e0f45){try{var _0x38c6c0={};if(this[_0xec39('0x45')][_0x3e932a]){for(var _0x5d4066=0x0;_0x5d4066=0x0?moment(_0x256ae3[_0x4f46('0x1a')])[_0x4f46('0xc')](_0x256ae3[_0x4f46('0x19')],_0x4f46('0xd')):null,'data1':_0x4f46('0x1b'),'data2':_0x256ae3['accountcode'],'data3':_0x256ae3[_0x4f46('0x10')],'data4':_0x256ae3['dialstring']||null,'role':'agent','internal':_0x256ae3[_0x4f46('0x13')]?_[_0x4f46('0x1c')](_0x256ae3[_0x4f46('0x13')]):undefined,'uniqueid':_0x256ae3[_0x4f46('0x14')]},'log':_0x4f46('0x15')});}; \ No newline at end of file +var _0x8b18=['CreateMemberReport','voice','isNil','interface','lastAssignedTo','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','accountcode','toNumber','voiceDialReport','Request','TALKING','starttime','endtime','outbound','dialstring','agent','uniqueid','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt'];(function(_0x33f1a3,_0x1557a5){var _0x1f3d03=function(_0xfc6e8b){while(--_0xfc6e8b){_0x33f1a3['push'](_0x33f1a3['shift']());}};_0x1f3d03(++_0x1557a5);}(_0x8b18,0x138));var _0x88b1=function(_0x5e9138,_0x46178c){_0x5e9138=_0x5e9138-0x0;var _0x1098b0=_0x8b18[_0x5e9138];return _0x1098b0;};'use strict';var moment=require(_0x88b1('0x0'));var _=require(_0x88b1('0x1'));var util=require(_0x88b1('0x2'));var client=require(_0x88b1('0x3'));exports[_0x88b1('0x4')]=function(_0x5a30c8){var _0x5e0c6b=_0x5a30c8[_0x88b1('0x5')]||_0x5a30c8[_0x88b1('0x6')];return client['Request'](_0x88b1('0x7'),{'body':{'channel':_0x88b1('0x8'),'membername':_0x5a30c8['lastAssignedTo'],'interface':_[_0x88b1('0x9')](_0x5a30c8[_0x88b1('0xa')])?util['format']('SIP/%s',_0x5a30c8[_0x88b1('0xb')]):_0x5a30c8[_0x88b1('0xa')],'type':'TALKING','enterAt':_0x5a30c8[_0x88b1('0xc')],'exitAt':_0x5e0c6b,'duration':moment(_0x5e0c6b)['diff'](_0x5a30c8['queuecallerleaveAt'],_0x88b1('0xd')),'data1':_0x88b1('0xe'),'data2':_0x5a30c8[_0x88b1('0xf')],'data3':_0x5a30c8[_0x88b1('0x10')],'data4':null,'data5':_0x5a30c8[_0x88b1('0x11')],'role':'agent','internal':_0x5a30c8[_0x88b1('0x12')]?_[_0x88b1('0x13')](_0x5a30c8[_0x88b1('0x12')]):undefined,'uniqueid':_0x5a30c8['uniqueid']},'log':'CreateMemberReport'});};exports[_0x88b1('0x14')]=function(_0x2f9545){return client[_0x88b1('0x15')]('CreateMemberReport',{'body':{'channel':_0x88b1('0x8'),'membername':_0x2f9545['membername'],'interface':_0x2f9545[_0x88b1('0xa')],'type':_0x88b1('0x16'),'enterAt':_0x2f9545[_0x88b1('0x17')],'exitAt':_0x2f9545['endtime'],'duration':moment(_0x2f9545[_0x88b1('0x18')])['diff'](_0x2f9545['starttime'],_0x88b1('0xd'))>=0x0?moment(_0x2f9545[_0x88b1('0x18')])['diff'](_0x2f9545[_0x88b1('0x17')],_0x88b1('0xd')):null,'data1':_0x88b1('0x19'),'data2':_0x2f9545[_0x88b1('0x12')],'data3':_0x2f9545[_0x88b1('0x10')],'data4':_0x2f9545[_0x88b1('0x1a')]||null,'role':_0x88b1('0x1b'),'internal':_0x2f9545[_0x88b1('0x12')]?_[_0x88b1('0x13')](_0x2f9545[_0x88b1('0x12')]):undefined,'uniqueid':_0x2f9545[_0x88b1('0x1c')]},'log':_0x88b1('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 7692c24..07e34f0 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ee9=['GetSettings','getSettings','Request','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x266291,_0x3cded0){var _0x2f824c=function(_0xc6eacb){while(--_0xc6eacb){_0x266291['push'](_0x266291['shift']());}};_0x2f824c(++_0x3cded0);}(_0x6ee9,0x9c));var _0x96ee=function(_0x56ee9c,_0x35d6a6){_0x56ee9c=_0x56ee9c-0x0;var _0x212d28=_0x6ee9[_0x56ee9c];return _0x212d28;};'use strict';var client=require('../client');exports[_0x96ee('0x0')]=function(){return client[_0x96ee('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x96ee('0x2'),_0x96ee('0x3')]},'log':_0x96ee('0x4')});}; \ No newline at end of file +var _0xe896=['getSettings','Request','stopRecordingOnTransfer','../client'];(function(_0x48a7b0,_0x2f7b62){var _0x51eec1=function(_0x350646){while(--_0x350646){_0x48a7b0['push'](_0x48a7b0['shift']());}};_0x51eec1(++_0x2f7b62);}(_0xe896,0x15f));var _0x6e89=function(_0x2ceb84,_0x3316f3){_0x2ceb84=_0x2ceb84-0x0;var _0x597a33=_0xe896[_0x2ceb84];return _0x597a33;};'use strict';var client=require(_0x6e89('0x0'));exports[_0x6e89('0x1')]=function(){return client[_0x6e89('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x6e89('0x3'),'previewRecallmeReminderInterval']},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 1d40f8b..85323a1 100644 --- a/server/services/ami/rpc/template.js +++ b/server/services/ami/rpc/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3f2=['../client','getTemplates','Request','GetTemplate','name'];(function(_0x36940e,_0x11f338){var _0x3283f2=function(_0x418008){while(--_0x418008){_0x36940e['push'](_0x36940e['shift']());}};_0x3283f2(++_0x11f338);}(_0xf3f2,0x140));var _0x2f3f=function(_0x46df89,_0x2f5cec){_0x46df89=_0x46df89-0x0;var _0x22531b=_0xf3f2[_0x46df89];return _0x22531b;};'use strict';var client=require(_0x2f3f('0x0'));exports[_0x2f3f('0x1')]=function(_0xa6e193){return function(_0x1bbd45){return client[_0x2f3f('0x2')](_0x2f3f('0x3'),{'options':{'raw':!![],'attributes':['id',_0x2f3f('0x4'),'html']},'log':_0x2f3f('0x3')});};}; \ No newline at end of file +var _0xd920=['Request','GetTemplate','name','html','getTemplates'];(function(_0x4b9a1c,_0x76006b){var _0x4f0c6c=function(_0x4c6dfc){while(--_0x4c6dfc){_0x4b9a1c['push'](_0x4b9a1c['shift']());}};_0x4f0c6c(++_0x76006b);}(_0xd920,0x1ee));var _0x0d92=function(_0x55969b,_0x1ebe62){_0x55969b=_0x55969b-0x0;var _0x3d7fc1=_0xd920[_0x55969b];return _0x3d7fc1;};'use strict';var client=require('../client');exports[_0x0d92('0x0')]=function(_0x27622f){return function(_0x9075ef){return client[_0x0d92('0x1')](_0x0d92('0x2'),{'options':{'raw':!![],'attributes':['id',_0x0d92('0x3'),_0x0d92('0x4')]},'log':_0x0d92('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 8ee8112..ca977df 100644 --- a/server/services/ami/rpc/trigger.js +++ b/server/services/ami/rpc/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdbc4=['data3','data4','data5','data6','data7','../client','GetTrigger','name','channel','status','AllConditions','field','operator','AnyConditions','value','Action','Actions','data1'];(function(_0x1cde38,_0x4b85b9){var _0x42af72=function(_0x516e45){while(--_0x516e45){_0x1cde38['push'](_0x1cde38['shift']());}};_0x42af72(++_0x4b85b9);}(_0xdbc4,0x1b5));var _0x4dbc=function(_0x4a97e4,_0x4a87ab){_0x4a97e4=_0x4a97e4-0x0;var _0x6d8512=_0xdbc4[_0x4a97e4];return _0x6d8512;};'use strict';var client=require(_0x4dbc('0x0'));exports['getTriggers']=function(_0x1e2e96){return function(_0x5d1b5b){return client['Request'](_0x4dbc('0x1'),{'options':{'raw':![],'attributes':['id',_0x4dbc('0x2'),_0x4dbc('0x3'),_0x4dbc('0x4')],'include':[{'model':'Condition','as':_0x4dbc('0x5'),'attributes':['id',_0x4dbc('0x6'),_0x4dbc('0x7'),'value']},{'model':'Condition','as':_0x4dbc('0x8'),'attributes':['id',_0x4dbc('0x6'),_0x4dbc('0x7'),_0x4dbc('0x9')]},{'model':_0x4dbc('0xa'),'as':_0x4dbc('0xb'),'attributes':['id','action',_0x4dbc('0xc'),'data2',_0x4dbc('0xd'),_0x4dbc('0xe'),_0x4dbc('0xf'),_0x4dbc('0x10'),_0x4dbc('0x11')]}]},'log':_0x4dbc('0x1')});};}; \ No newline at end of file +var _0x4ec2=['operator','Action','Actions','action','data2','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','value','AnyConditions'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0x4ec2,0x1c9));var _0x24ec=function(_0x34bdb3,_0x6bc968){_0x34bdb3=_0x34bdb3-0x0;var _0x355523=_0x4ec2[_0x34bdb3];return _0x355523;};'use strict';var client=require(_0x24ec('0x0'));exports[_0x24ec('0x1')]=function(_0x440204){return function(_0x492b9c){return client[_0x24ec('0x2')](_0x24ec('0x3'),{'options':{'raw':![],'attributes':['id',_0x24ec('0x4'),_0x24ec('0x5'),_0x24ec('0x6')],'include':[{'model':_0x24ec('0x7'),'as':_0x24ec('0x8'),'attributes':['id','field','operator',_0x24ec('0x9')]},{'model':_0x24ec('0x7'),'as':_0x24ec('0xa'),'attributes':['id','field',_0x24ec('0xb'),'value']},{'model':_0x24ec('0xc'),'as':_0x24ec('0xd'),'attributes':['id',_0x24ec('0xe'),'data1',_0x24ec('0xf'),'data3','data4','data5',_0x24ec('0x10'),_0x24ec('0x11')]}]},'log':_0x24ec('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index a15ecd9..bec6912 100644 --- a/server/services/ami/rpc/trunk.js +++ b/server/services/ami/rpc/trunk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x68de=['Request','GetTrunk','name','registry','../client','getTrunks'];(function(_0x71690f,_0x11f550){var _0x2f93fd=function(_0xd1272f){while(--_0xd1272f){_0x71690f['push'](_0x71690f['shift']());}};_0x2f93fd(++_0x11f550);}(_0x68de,0xfa));var _0xe68d=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0x68de[_0x31b5a5];return _0x364cc9;};'use strict';var client=require(_0xe68d('0x0'));exports[_0xe68d('0x1')]=function(_0x54ab67){return function(_0x5b4078){return client[_0xe68d('0x2')](_0xe68d('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xe68d('0x4'),_0xe68d('0x5'),'defaultuser']},'log':_0xe68d('0x3')});};}; \ No newline at end of file +var _0x3aa2=['registry','getTrunks','GetTrunk'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3aa2,0xd3));var _0x23aa=function(_0x4fecb6,_0x45ed64){_0x4fecb6=_0x4fecb6-0x0;var _0xa9a47=_0x3aa2[_0x4fecb6];return _0xa9a47;};'use strict';var client=require('../client');exports[_0x23aa('0x0')]=function(_0x6274cd){return function(_0x132d0c){return client['Request'](_0x23aa('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x23aa('0x2'),'defaultuser']},'log':_0x23aa('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 485c91b..ba6cd01 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x5e1de6,_0xc1c462){var _0x3e2d3d=function(_0x3d58f3){while(--_0x3d58f3){_0x5e1de6['push'](_0x5e1de6['shift']());}};_0x3e2d3d(++_0xc1c462);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0xcb91[_0xdd2bfa];return _0x55397e;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file +var _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x28b4cd,_0x573ff1){var _0x4229cc=function(_0x2ba663){while(--_0x2ba663){_0x28b4cd['push'](_0x28b4cd['shift']());}};_0x4229cc(++_0x573ff1);}(_0x34e8,0x12c));var _0x834e=function(_0x282834,_0x5f57c8){_0x282834=_0x282834-0x0;var _0x2aba99=_0x34e8[_0x282834];return _0x2aba99;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 10d59d2..a898f5c 100644 --- a/server/services/ami/rpc/voiceAgentReport.js +++ b/server/services/ami/rpc/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4125=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x42020e,_0x4b92fb){var _0x561551=function(_0xf8216){while(--_0xf8216){_0x42020e['push'](_0x42020e['shift']());}};_0x561551(++_0x4b92fb);}(_0x4125,0xbf));var _0x5412=function(_0x8fb66b,_0x537fe1){_0x8fb66b=_0x8fb66b-0x0;var _0x2fa2c7=_0x4125[_0x8fb66b];return _0x2fa2c7;};'use strict';var client=require(_0x5412('0x0'));exports[_0x5412('0x1')]=function(_0x39ebde){return client[_0x5412('0x2')](_0x5412('0x3'),{'body':_0x39ebde,'log':_0x5412('0x3')});};exports[_0x5412('0x4')]=function(_0xe6bd77,_0x1792d4,_0x27314b){return client[_0x5412('0x2')](_0x5412('0x5'),{'body':_0xe6bd77,'options':{'where':{'uniqueid':_0x1792d4,'interface':_0x27314b,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x48a2=['../client','create','Request','CreateVoiceAgentReport','UpdateVoiceAgentReport'];(function(_0x4aa02d,_0x3a1bec){var _0xaf9d0c=function(_0x27c9b9){while(--_0x27c9b9){_0x4aa02d['push'](_0x4aa02d['shift']());}};_0xaf9d0c(++_0x3a1bec);}(_0x48a2,0x109));var _0x248a=function(_0x8a912d,_0x53c52b){_0x8a912d=_0x8a912d-0x0;var _0x4fb44b=_0x48a2[_0x8a912d];return _0x4fb44b;};'use strict';var client=require(_0x248a('0x0'));exports[_0x248a('0x1')]=function(_0x31adcc){return client[_0x248a('0x2')](_0x248a('0x3'),{'body':_0x31adcc,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x3c9038,_0x1480da,_0x3a7256){return client['Request'](_0x248a('0x4'),{'body':_0x3c9038,'options':{'where':{'uniqueid':_0x1480da,'interface':_0x3a7256,'agentcomplete':!![]}},'log':_0x248a('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 4d86c0f..2015e29 100644 --- a/server/services/ami/rpc/voiceCallReport.js +++ b/server/services/ami/rpc/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0afa=['endOf','type','duration','billableseconds','GetVoiceCallReports','moment','lodash','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0afa,0x98));var _0xa0af=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0afa[_0xbca1b1];return _0x4e1686;};'use strict';var moment=require(_0xa0af('0x0'));var util=require('util');var _=require(_0xa0af('0x1'));var client=require('../client');exports[_0xa0af('0x2')]=function(_0x4ea47f){return client[_0xa0af('0x3')](_0xa0af('0x4'),{'body':_[_0xa0af('0x5')](_0x4ea47f,{'source':_0x4ea47f[_0xa0af('0x6')],'destinationcontext':_0x4ea47f[_0xa0af('0x7')],'callerid':_0x4ea47f[_0xa0af('0x8')],'amaflags':_0xa0af('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0xa0af('0xa')]=function(){return function(){return client[_0xa0af('0x3')](_0xa0af('0xb'),{'options':{'where':{'type':[_0xa0af('0xc')],'createdAt':{'$between':[moment()[_0xa0af('0xd')](_0xa0af('0xe'))[_0xa0af('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xa0af('0x10')](_0xa0af('0xe'))[_0xa0af('0xf')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xa0af('0x11'),'disposition',_0xa0af('0x12'),_0xa0af('0x13')]},'log':_0xa0af('0x14')});};}; \ No newline at end of file +var _0xed57=['type','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','getVoiceCallReports','day','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1c2e36,_0xa47e1d){var _0x262a3a=function(_0x579c09){while(--_0x579c09){_0x1c2e36['push'](_0x1c2e36['shift']());}};_0x262a3a(++_0xa47e1d);}(_0xed57,0xd5));var _0x7ed5=function(_0x5ac0fd,_0x4c1347){_0x5ac0fd=_0x5ac0fd-0x0;var _0x56f6db=_0xed57[_0x5ac0fd];return _0x56f6db;};'use strict';var moment=require(_0x7ed5('0x0'));var util=require(_0x7ed5('0x1'));var _=require(_0x7ed5('0x2'));var client=require(_0x7ed5('0x3'));exports[_0x7ed5('0x4')]=function(_0x575823){return client[_0x7ed5('0x5')](_0x7ed5('0x6'),{'body':_[_0x7ed5('0x7')](_0x575823,{'source':_0x575823['calleridnum'],'destinationcontext':_0x575823[_0x7ed5('0x8')],'callerid':_0x575823[_0x7ed5('0x9')],'amaflags':_0x7ed5('0xa')}),'log':_0x7ed5('0x6')});};exports[_0x7ed5('0xb')]=function(){return function(){return client[_0x7ed5('0x5')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0x7ed5('0xc'))[_0x7ed5('0xd')](_0x7ed5('0xe')),moment()['endOf'](_0x7ed5('0xc'))['format'](_0x7ed5('0xe'))]}},'attributes':[_0x7ed5('0xf'),'disposition',_0x7ed5('0x10'),_0x7ed5('0x11')]},'log':_0x7ed5('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index e935a67..ce98b78 100644 --- a/server/services/ami/rpc/voiceDialReport.js +++ b/server/services/ami/rpc/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba8c=['Request','CreateVoiceDialReport','../client','create'];(function(_0x49fcfb,_0x504dec){var _0x964926=function(_0x327977){while(--_0x327977){_0x49fcfb['push'](_0x49fcfb['shift']());}};_0x964926(++_0x504dec);}(_0xba8c,0x8e));var _0xcba8=function(_0x226d2e,_0x458258){_0x226d2e=_0x226d2e-0x0;var _0xc5791=_0xba8c[_0x226d2e];return _0xc5791;};'use strict';var client=require(_0xcba8('0x0'));exports[_0xcba8('0x1')]=function(_0x3a2fbe){return client[_0xcba8('0x2')](_0xcba8('0x3'),{'body':_0x3a2fbe,'log':_0xcba8('0x3')});}; \ No newline at end of file +var _0x3ea1=['create','Request','CreateVoiceDialReport','../client'];(function(_0xffb539,_0x587d42){var _0x5c9e30=function(_0x1a8625){while(--_0x1a8625){_0xffb539['push'](_0xffb539['shift']());}};_0x5c9e30(++_0x587d42);}(_0x3ea1,0x83));var _0x13ea=function(_0x599c94,_0x464f0e){_0x599c94=_0x599c94-0x0;var _0x34e215=_0x3ea1[_0x599c94];return _0x34e215;};'use strict';var client=require(_0x13ea('0x0'));exports[_0x13ea('0x1')]=function(_0x3bb0a5){return client[_0x13ea('0x2')]('CreateVoiceDialReport',{'body':_0x3bb0a5,'log':_0x13ea('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 8a2c9e2..86adb27 100644 --- a/server/services/ami/rpc/voiceExtension.js +++ b/server/services/ami/rpc/voiceExtension.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x750a=['exten','recordingFormat','getVoiceExtensions'];(function(_0x49147e,_0x56b4e7){var _0x48c3d5=function(_0x1a236d){while(--_0x1a236d){_0x49147e['push'](_0x49147e['shift']());}};_0x48c3d5(++_0x56b4e7);}(_0x750a,0x140));var _0xa750=function(_0x4d84bf,_0x5adbcf){_0x4d84bf=_0x4d84bf-0x0;var _0xcd730e=_0x750a[_0x4d84bf];return _0xcd730e;};'use strict';var client=require('../client');exports[_0xa750('0x0')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xa750('0x1'),_0xa750('0x2')],'where':{'VoiceExtensionId':null}},'log':_0xa750('0x0')});};}; \ No newline at end of file +var _0x235a=['getVoiceExtensions','Request','exten','../client'];(function(_0x2b5309,_0x27c8bd){var _0x43f334=function(_0x51bcc0){while(--_0x51bcc0){_0x2b5309['push'](_0x2b5309['shift']());}};_0x43f334(++_0x27c8bd);}(_0x235a,0x1ef));var _0xa235=function(_0x54f807,_0x111551){_0x54f807=_0x54f807-0x0;var _0x198ef0=_0x235a[_0x54f807];return _0x198ef0;};'use strict';var client=require(_0xa235('0x0'));exports[_0xa235('0x1')]=function(){return function(){return client[_0xa235('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xa235('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xa235('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index bb83b3c..12dbbf3 100644 --- a/server/services/ami/rpc/voiceQueue.js +++ b/server/services/ami/rpc/voiceQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa71=['dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','callerid','mandatoryDispositionPause','TrunkBackup','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDBetweenWordsSilence'];(function(_0x2ca445,_0x40a985){var _0x434e3d=function(_0x354ff3){while(--_0x354ff3){_0x2ca445['push'](_0x2ca445['shift']());}};_0x434e3d(++_0x40a985);}(_0xfa71,0xa2));var _0x1fa7=function(_0x251429,_0x55f265){_0x251429=_0x251429-0x0;var _0x2d5d69=_0xfa71[_0x251429];return _0x2d5d69;};'use strict';var client=require(_0x1fa7('0x0'));exports[_0x1fa7('0x1')]=function(){return function(){return client[_0x1fa7('0x2')](_0x1fa7('0x3'),{'options':{'raw':![],'attributes':['id',_0x1fa7('0x4'),_0x1fa7('0x5'),_0x1fa7('0x6'),'autopause',_0x1fa7('0x7'),_0x1fa7('0x8'),'dialActive',_0x1fa7('0x9'),_0x1fa7('0xa'),_0x1fa7('0xb'),_0x1fa7('0xc'),_0x1fa7('0xd'),_0x1fa7('0xe'),_0x1fa7('0xf'),_0x1fa7('0x10'),_0x1fa7('0x11'),_0x1fa7('0x12'),'dialQueueOptions',_0x1fa7('0x13'),_0x1fa7('0x14'),'dialCongestionMaxRetry',_0x1fa7('0x15'),_0x1fa7('0x16'),'dialBusyRetryFrequency',_0x1fa7('0x17'),_0x1fa7('0x18'),_0x1fa7('0x19'),_0x1fa7('0x1a'),'dialGlobalInterval',_0x1fa7('0x1b'),_0x1fa7('0x1c'),_0x1fa7('0x1d'),'dialAMDInitialSilence',_0x1fa7('0x1e'),_0x1fa7('0x1f'),'dialAMDTotalAnalysisTime','dialAMDMinWordLength',_0x1fa7('0x20'),_0x1fa7('0x21'),_0x1fa7('0x22'),_0x1fa7('0x23'),_0x1fa7('0x24'),_0x1fa7('0x25'),_0x1fa7('0x26'),_0x1fa7('0x27'),_0x1fa7('0x28'),_0x1fa7('0x29'),_0x1fa7('0x2a'),_0x1fa7('0x7'),_0x1fa7('0x2b'),_0x1fa7('0x2c'),_0x1fa7('0x2d'),'dialNoSuchNumberMaxRetry',_0x1fa7('0x2e'),_0x1fa7('0x2f'),_0x1fa7('0x30'),_0x1fa7('0x31'),_0x1fa7('0x32'),_0x1fa7('0x33'),_0x1fa7('0x34'),_0x1fa7('0x35'),_0x1fa7('0x36'),_0x1fa7('0x37'),_0x1fa7('0x38'),_0x1fa7('0x39'),_0x1fa7('0x3a'),'dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':_0x1fa7('0x3b'),'attributes':['id',_0x1fa7('0x4'),_0x1fa7('0x3c'),'active']},{'model':'Pause','as':_0x1fa7('0x3d'),'attributes':['id',_0x1fa7('0x4')]},{'model':'Trunk','as':_0x1fa7('0x3e'),'attributes':['id',_0x1fa7('0x4'),_0x1fa7('0x3c'),'active']},{'model':'Interval','as':'Interval','attributes':['id',_0x1fa7('0x4')],'include':[{'model':'Interval','as':_0x1fa7('0x3f'),'attributes':['id',_0x1fa7('0x4'),_0x1fa7('0x40')]}]}]},'log':_0x1fa7('0x1')});};}; \ No newline at end of file +var _0x9cc7=['dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','type','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage'];(function(_0x4bc6c1,_0x3f2302){var _0x234ce4=function(_0x22bbab){while(--_0x22bbab){_0x4bc6c1['push'](_0x4bc6c1['shift']());}};_0x234ce4(++_0x3f2302);}(_0x9cc7,0x64));var _0x79cc=function(_0x2a6571,_0xf1567c){_0x2a6571=_0x2a6571-0x0;var _0xdf7731=_0x9cc7[_0x2a6571];return _0xdf7731;};'use strict';var client=require(_0x79cc('0x0'));exports[_0x79cc('0x1')]=function(){return function(){return client['Request'](_0x79cc('0x2'),{'options':{'raw':![],'attributes':['id',_0x79cc('0x3'),'acw',_0x79cc('0x4'),_0x79cc('0x5'),_0x79cc('0x6'),_0x79cc('0x7'),'dialActive','dialMethod',_0x79cc('0x8'),'dialLimitQueue',_0x79cc('0x9'),_0x79cc('0xa'),_0x79cc('0xb'),'dialPredictiveInterval',_0x79cc('0xc'),_0x79cc('0xd'),_0x79cc('0xe'),_0x79cc('0xf'),_0x79cc('0x10'),_0x79cc('0x11'),'dialCongestionMaxRetry',_0x79cc('0x12'),_0x79cc('0x13'),'dialBusyRetryFrequency',_0x79cc('0x14'),_0x79cc('0x15'),_0x79cc('0x16'),_0x79cc('0x17'),_0x79cc('0x18'),_0x79cc('0x19'),'dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence',_0x79cc('0x1a'),_0x79cc('0x1b'),'dialAMDTotalAnalysisTime',_0x79cc('0x1c'),_0x79cc('0x1d'),_0x79cc('0x1e'),'dialAMDSilenceThreshold',_0x79cc('0x1f'),'timeout',_0x79cc('0x20'),_0x79cc('0x21'),'dialOrderByScheduledAt',_0x79cc('0x22'),_0x79cc('0x23'),'dialQueueProject2',_0x79cc('0x6'),_0x79cc('0x24'),_0x79cc('0x25'),'dialCutDigit',_0x79cc('0x26'),_0x79cc('0x27'),_0x79cc('0x28'),'dialDropRetryFrequency',_0x79cc('0x29'),_0x79cc('0x2a'),_0x79cc('0x2b'),_0x79cc('0x2c'),_0x79cc('0x2d'),_0x79cc('0x2e'),'mandatoryDisposition','dialPredictiveIntervalMaxThreshold',_0x79cc('0x2f'),'dialPreviewAutoRecallMe',_0x79cc('0x30')],'include':[{'model':_0x79cc('0x31'),'as':_0x79cc('0x31'),'attributes':['id','name',_0x79cc('0x32'),_0x79cc('0x33')]},{'model':_0x79cc('0x34'),'as':'mandatoryDispositionPause','attributes':['id',_0x79cc('0x3')]},{'model':_0x79cc('0x31'),'as':'TrunkBackup','attributes':['id',_0x79cc('0x3'),_0x79cc('0x32'),_0x79cc('0x33')]},{'model':_0x79cc('0x35'),'as':'Interval','attributes':['id',_0x79cc('0x3')],'include':[{'model':'Interval','as':_0x79cc('0x36'),'attributes':['id',_0x79cc('0x3'),_0x79cc('0x37')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 8ecac5d..76365ac 100644 --- a/server/services/ami/rpc/voiceQueueReport.js +++ b/server/services/ami/rpc/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x2448d4,_0xb97fda){var _0x2b08df=function(_0x52bf52){while(--_0x52bf52){_0x2448d4['push'](_0x2448d4['shift']());}};_0x2b08df(++_0xb97fda);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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(_0x22844a,_0x40508b){var _0x4e706c=function(_0x52b2ca){while(--_0x52b2ca){_0x22844a['push'](_0x22844a['shift']());}};_0x4e706c(++_0x40508b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 6fb22ab..4482a00 100644 --- a/server/services/ami/rpc/voiceQueueRt.js +++ b/server/services/ami/rpc/voiceQueueRt.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d8c=['../client','Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7d8c,0xac));var _0xc7d8=function(_0xacad5f,_0x26f77b){_0xacad5f=_0xacad5f-0x0;var _0x55853c=_0x7d8c[_0xacad5f];return _0x55853c;};'use strict';var client=require(_0xc7d8('0x0'));exports['getVoiceQueueRtPauses']=function(_0x54bdab){return function(){return client[_0xc7d8('0x1')](_0xc7d8('0x2'),{'options':{'where':{'VoiceQueueId':_0x54bdab,'paused':!![]},'raw':!![]},'log':_0xc7d8('0x3')});};}; \ No newline at end of file +var _0xce2b=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x38d240,_0x12b9bc){var _0x3c9c1b=function(_0x2274d4){while(--_0x2274d4){_0x38d240['push'](_0x38d240['shift']());}};_0x3c9c1b(++_0x12b9bc);}(_0xce2b,0x163));var _0xbce2=function(_0x5dda44,_0x40b720){_0x5dda44=_0x5dda44-0x0;var _0x25506a=_0xce2b[_0x5dda44];return _0x25506a;};'use strict';var client=require(_0xbce2('0x0'));exports[_0xbce2('0x1')]=function(_0xb69736){return function(){return client['Request'](_0xbce2('0x2'),{'options':{'where':{'VoiceQueueId':_0xb69736,'paused':!![]},'raw':!![]},'log':_0xbce2('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 434cd48..82291a2 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x4e9c84,_0x562674){var _0x2267db=function(_0x396b5b){while(--_0x396b5b){_0x4e9c84['push'](_0x4e9c84['shift']());}};_0x2267db(++_0x562674);}(_0x7a54,0x106));var _0x47a5=function(_0x365316,_0x471018){_0x365316=_0x365316-0x0;var _0x1009de=_0x7a54[_0x365316];return _0x1009de;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x373522,_0x497f77){var _0x14ff8e=function(_0x5309c8){while(--_0x5309c8){_0x373522['push'](_0x373522['shift']());}};_0x14ff8e(++_0x497f77);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index eeb5ad4..49291d0 100644 --- a/server/services/ami/rpc/voiceTransferReport.js +++ b/server/services/ami/rpc/voiceTransferReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbe2=['transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','attended','transfers','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0xcbe2,0x18b));var _0x2cbe=function(_0x429fe1,_0x27200d){_0x429fe1=_0x429fe1-0x0;var _0x38274b=_0xcbe2[_0x429fe1];return _0x38274b;};'use strict';var client=require('../client');exports[_0x2cbe('0x0')]={};exports['blindTransfer']=function(_0x38edc5){return client['Request'](_0x2cbe('0x1'),{'body':{'result':_0x38edc5[_0x2cbe('0x2')],'transfererchannel':_0x38edc5[_0x2cbe('0x3')],'transferercalleridnum':_0x38edc5[_0x2cbe('0x4')],'transferercalleridname':_0x38edc5[_0x2cbe('0x5')],'transfererconnectedlinenum':_0x38edc5[_0x2cbe('0x6')],'transfererconnectedlinename':_0x38edc5[_0x2cbe('0x7')],'transfereraccountcode':_0x38edc5['transfereraccountcode'],'transferercontext':_0x38edc5[_0x2cbe('0x8')],'transfererexten':_0x38edc5[_0x2cbe('0x9')],'transfererlinkedid':_0x38edc5[_0x2cbe('0xa')],'transfereechannel':_0x38edc5[_0x2cbe('0xb')],'transfereecalleridnum':_0x38edc5['transfereecalleridnum'],'transfereecalleridname':_0x38edc5['transfereecalleridname'],'transfereeconnectedlinenum':_0x38edc5['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x38edc5[_0x2cbe('0xc')],'transfereeaccountcode':_0x38edc5[_0x2cbe('0xd')],'transfereecontext':_0x38edc5[_0x2cbe('0xe')],'transfereeexten':_0x38edc5[_0x2cbe('0xf')],'transfereelinkedid':_0x38edc5[_0x2cbe('0x10')],'isexternal':_0x38edc5[_0x2cbe('0x11')],'context':_0x38edc5[_0x2cbe('0x12')],'extension':_0x38edc5[_0x2cbe('0x13')],'type':_0x2cbe('0x14')},'log':_0x2cbe('0x1')});};exports[_0x2cbe('0x15')]=function(_0x2f3d7c){return client[_0x2cbe('0x16')]('CreateVoiceTransferReport',{'body':{'result':_0x2f3d7c[_0x2cbe('0x2')],'transfererchannel':_0x2f3d7c[_0x2cbe('0x17')],'transferercalleridnum':_0x2f3d7c[_0x2cbe('0x18')],'transferercalleridname':_0x2f3d7c['origtransferercalleridname'],'transfererconnectedlinenum':_0x2f3d7c[_0x2cbe('0x19')],'transfererconnectedlinename':_0x2f3d7c[_0x2cbe('0x1a')],'transfereraccountcode':_0x2f3d7c[_0x2cbe('0x1b')],'transferercontext':_0x2f3d7c[_0x2cbe('0x1c')],'transfererexten':_0x2f3d7c['secondtransfererexten'],'transfererlinkedid':_0x2f3d7c[_0x2cbe('0x1d')],'transfereechannel':_0x2f3d7c[_0x2cbe('0x1e')],'transfereecalleridnum':_0x2f3d7c['transfertargetcalleridnum'],'transfereecalleridname':_0x2f3d7c[_0x2cbe('0x1f')],'transfereeconnectedlinenum':_0x2f3d7c[_0x2cbe('0x20')],'transfereeconnectedlinename':_0x2f3d7c['transfertargetconnectedlinename'],'transfereeaccountcode':_0x2f3d7c[_0x2cbe('0x21')],'transfereecontext':_0x2f3d7c[_0x2cbe('0x22')],'transfereeexten':_0x2f3d7c[_0x2cbe('0x23')],'transfereelinkedid':_0x2f3d7c['transfertargetlinkedid'],'isexternal':_0x2f3d7c[_0x2cbe('0x11')],'context':_0x2f3d7c[_0x2cbe('0x24')],'extension':_0x2f3d7c[_0x2cbe('0x25')],'type':_0x2cbe('0x26')},'log':_0x2cbe('0x1')});}; \ No newline at end of file +var _0x449e=['transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetcontext','transfertargetlinkedid','origtransfererexten','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid'];(function(_0x27f8f8,_0xaca5c7){var _0x46bae9=function(_0x1977c0){while(--_0x1977c0){_0x27f8f8['push'](_0x27f8f8['shift']());}};_0x46bae9(++_0xaca5c7);}(_0x449e,0x126));var _0xe449=function(_0x10cb3f,_0xf72e73){_0x10cb3f=_0x10cb3f-0x0;var _0x4618e8=_0x449e[_0x10cb3f];return _0x4618e8;};'use strict';var client=require(_0xe449('0x0'));exports[_0xe449('0x1')]={};exports[_0xe449('0x2')]=function(_0x28cd1b){return client['Request'](_0xe449('0x3'),{'body':{'result':_0x28cd1b[_0xe449('0x4')],'transfererchannel':_0x28cd1b[_0xe449('0x5')],'transferercalleridnum':_0x28cd1b[_0xe449('0x6')],'transferercalleridname':_0x28cd1b[_0xe449('0x7')],'transfererconnectedlinenum':_0x28cd1b[_0xe449('0x8')],'transfererconnectedlinename':_0x28cd1b[_0xe449('0x9')],'transfereraccountcode':_0x28cd1b[_0xe449('0xa')],'transferercontext':_0x28cd1b[_0xe449('0xb')],'transfererexten':_0x28cd1b['transfererexten'],'transfererlinkedid':_0x28cd1b[_0xe449('0xc')],'transfereechannel':_0x28cd1b[_0xe449('0xd')],'transfereecalleridnum':_0x28cd1b[_0xe449('0xe')],'transfereecalleridname':_0x28cd1b[_0xe449('0xf')],'transfereeconnectedlinenum':_0x28cd1b[_0xe449('0x10')],'transfereeconnectedlinename':_0x28cd1b[_0xe449('0x11')],'transfereeaccountcode':_0x28cd1b[_0xe449('0x12')],'transfereecontext':_0x28cd1b[_0xe449('0x13')],'transfereeexten':_0x28cd1b[_0xe449('0x14')],'transfereelinkedid':_0x28cd1b[_0xe449('0x15')],'isexternal':_0x28cd1b[_0xe449('0x16')],'context':_0x28cd1b[_0xe449('0x17')],'extension':_0x28cd1b[_0xe449('0x18')],'type':'blind'},'log':_0xe449('0x3')});};exports[_0xe449('0x19')]=function(_0x25a527){return client[_0xe449('0x1a')](_0xe449('0x3'),{'body':{'result':_0x25a527['result'],'transfererchannel':_0x25a527[_0xe449('0x1b')],'transferercalleridnum':_0x25a527[_0xe449('0x1c')],'transferercalleridname':_0x25a527['origtransferercalleridname'],'transfererconnectedlinenum':_0x25a527['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x25a527[_0xe449('0x1d')],'transfereraccountcode':_0x25a527[_0xe449('0x1e')],'transferercontext':_0x25a527[_0xe449('0x1f')],'transfererexten':_0x25a527[_0xe449('0x20')],'transfererlinkedid':_0x25a527[_0xe449('0x21')],'transfereechannel':_0x25a527[_0xe449('0x22')],'transfereecalleridnum':_0x25a527[_0xe449('0x23')],'transfereecalleridname':_0x25a527[_0xe449('0x24')],'transfereeconnectedlinenum':_0x25a527[_0xe449('0x25')],'transfereeconnectedlinename':_0x25a527['transfertargetconnectedlinename'],'transfereeaccountcode':_0x25a527['transfertargetaccountcode'],'transfereecontext':_0x25a527[_0xe449('0x26')],'transfereeexten':_0x25a527['transfertargetexten'],'transfereelinkedid':_0x25a527[_0xe449('0x27')],'isexternal':_0x25a527[_0xe449('0x16')],'context':_0x25a527['origtransferercontext'],'extension':_0x25a527[_0xe449('0x28')],'type':'attended'},'log':_0xe449('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index c7560bc..d2f73d8 100644 --- a/server/services/ami/server/index.js +++ b/server/services/ami/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x4affd5,_0x417b85){var _0x37b836=function(_0x2b07cc){while(--_0x2b07cc){_0x4affd5['push'](_0x4affd5['shift']());}};_0x37b836(++_0x417b85);}(_0xb10b,0x12a));var _0xbb10=function(_0x469c7c,_0x4a54c6){_0x469c7c=_0x469c7c-0x0;var _0x4b8ffa=_0xb10b[_0x469c7c];return _0x4b8ffa;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file +var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0xd92c2d,_0x903d59){var _0x42697b=function(_0x476765){while(--_0x476765){_0xd92c2d['push'](_0xd92c2d['shift']());}};_0x42697b(++_0x903d59);}(_0xb10b,0x12a));var _0xbb10=function(_0x22b005,_0x2a6515){_0x22b005=_0x22b005-0x0;var _0x58bd11=_0xb10b[_0x22b005];return _0x58bd11;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 72d7cb1..a2cf25a 100644 --- a/server/services/ami/trigger/cmContact/index.js +++ b/server/services/ami/trigger/cmContact/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x844d=['Unknown','destcalleridname','resolve','createContact','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','bluebird','util','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data2','data5','xmd-contactid','data3','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','ListId','createdAt','scheduledAt','updatedAt','union','getContacts','then','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','phone','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname',''];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x844d,0xec));var _0xd844=function(_0x23b85e,_0x39b209){_0x23b85e=_0x23b85e-0x0;var _0x329756=_0x844d[_0x23b85e];return _0x329756;};'use strict';var _=require('lodash');var BPromise=require(_0xd844('0x0'));var Redis=require('ioredis');var util=require(_0xd844('0x1'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xd844('0x2'));var cmContactRpc=require(_0xd844('0x3'));config[_0xd844('0x4')]=_[_0xd844('0x5')](config[_0xd844('0x4')],{'host':_0xd844('0x6'),'port':0x18eb});var io=require(_0xd844('0x7'))(new Redis(config[_0xd844('0x4')]));function emit(_0x389e21,_0x4d995f,_0x204ff2,_0x1186b0,_0x35fc5b){logger[_0xd844('0x8')](_0xd844('0x9'),_0x389e21,_0x4d995f['id'],_0x204ff2,_0x1186b0,JSON[_0xd844('0xa')](_0x35fc5b));io['to'](_0x204ff2)[_0xd844('0xb')](_0x1186b0,_0x35fc5b);}exports[_0xd844('0xc')]=function(_0x32e309,_0x242412,_0x515d3a,_0x27382c){var _0x14ed7d,_0x11e14c;var _0x39e000={};var _0x3905a1;var _0x5e3773=Number(_0x515d3a['data1']);var _0x152ced=_0x515d3a[_0xd844('0xd')]?Boolean(Number(_0x515d3a[_0xd844('0xd')])):![];var _0x5a4133;var _0x36cc42=![];if(!_['isNil'](_0x515d3a[_0xd844('0xe')])){if(_0x515d3a[_0xd844('0xe')]=='1')_0x36cc42=!![];}if(!_0x36cc42){if(_0x27382c[_0xd844('0xf')]){_0x39e000['id']=_0x27382c[_0xd844('0xf')];}}if(!_0x39e000['id']){_0x39e000['ListId']=_0x5e3773;_0x5a4133=_0x515d3a[_0xd844('0x10')]&&_0x515d3a[_0xd844('0x10')]!=='0'?_0x515d3a[_0xd844('0x10')]['split'](','):['phone'];_0x39e000[_0xd844('0x11')]=_[_0xd844('0x12')](_0x5a4133,function(_0x37cebb){var _0x1a87de={};_0x1a87de[_0x37cebb]=_0x27382c[_0xd844('0x13')]?_0x27382c[_0xd844('0x14')]:_0x27382c[_0xd844('0x15')];return _0x1a87de;});_0x3905a1=_0x27382c[_0xd844('0x13')]?_0x27382c[_0xd844('0x14')]:_0x27382c[_0xd844('0x15')];}var _0x3298cc=['id',_0xd844('0x16'),_0xd844('0x17'),'phone',_0xd844('0x18'),_0xd844('0x19'),_0xd844('0x1a'),_0xd844('0x1b'),_0xd844('0x1c'),_0xd844('0x1d')];var _0x4286bc=_[_0xd844('0x1e')](_0x3298cc,_0x5a4133);BPromise['resolve']()['then'](cmContactRpc[_0xd844('0x1f')]({'attributes':_0x4286bc,'where':_0x39e000,'phone':_0x3905a1}))[_0xd844('0x20')](function(_0x5398fe){_0x11e14c=_0x5398fe;if(!_[_0xd844('0x21')](_0x11e14c)){if(_0x11e14c['length']===0x1){_0x14ed7d=_0x11e14c[0x0];logger[_0xd844('0x8')](_0xd844('0x22'),_0x27382c[_0xd844('0x23')],_0x242412['id'],_0x14ed7d['id']);}else{logger[_0xd844('0x8')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x27382c[_0xd844('0x23')],_0x242412['id'],_[_0xd844('0x12')](_0x11e14c,'id')[_0xd844('0x24')](','));}return;}else{logger[_0xd844('0x8')](_0xd844('0x25'),_0x27382c['uniqueid'],_0x242412['id']);var _0x579470={'ListId':_0x5e3773};var _0x440454=_0x515d3a['data4']&&_0x515d3a[_0xd844('0x26')]!=='0'?_0x515d3a[_0xd844('0x26')]:_0xd844('0x27');if(_0x152ced){logger[_0xd844('0x8')](_0xd844('0x28'),_0x27382c[_0xd844('0x23')],_0x242412['id']);_0x579470[_0x440454]=_[_0xd844('0x29')](_0x27382c[_0xd844('0x13')])?_0x27382c[_0xd844('0x15')]:_0x27382c[_0xd844('0x14')];if(_['isNil'](_0x27382c[_0xd844('0x13')])){_0x579470[_0xd844('0x16')]=_0x27382c[_0xd844('0x2a')]&&_0x27382c[_0xd844('0x2a')]!==_0xd844('0x2b')?_0x27382c[_0xd844('0x2a')]:_0xd844('0x2c');}else{_0x579470[_0xd844('0x16')]=_0x27382c[_0xd844('0x2d')]&&_0x27382c[_0xd844('0x2d')]!==_0xd844('0x2b')?_0x27382c[_0xd844('0x2d')]:_0xd844('0x2c');}return BPromise[_0xd844('0x2e')]()[_0xd844('0x20')](cmContactRpc[_0xd844('0x2f')](_0x579470))[_0xd844('0x20')](function(_0x109e8d){_0x14ed7d=_0x109e8d;_0x11e14c['push'](_0x109e8d);if(_0x14ed7d){logger[_0xd844('0x8')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x27382c[_0xd844('0x23')],_0x242412['id'],_0x14ed7d['id']);}return;});}else{logger[_0xd844('0x8')](_0xd844('0x30'),_0x27382c['uniqueid'],_0x242412['id']);_0x579470[_0x440454]=_[_0xd844('0x29')](_0x27382c[_0xd844('0x13')])?_0x27382c[_0xd844('0x15')]:_0x27382c[_0xd844('0x14')];if(_[_0xd844('0x29')](_0x27382c[_0xd844('0x13')])){_0x579470[_0xd844('0x16')]=_0x27382c[_0xd844('0x2a')]&&_0x27382c[_0xd844('0x2a')]!==_0xd844('0x2b')?_0x27382c['calleridname']:_0xd844('0x2c');}else{_0x579470[_0xd844('0x16')]=_0x27382c[_0xd844('0x2d')]&&_0x27382c[_0xd844('0x2d')]!==_0xd844('0x2b')?_0x27382c[_0xd844('0x2d')]:_0xd844('0x2c');}_0x14ed7d=_0x579470;_0x11e14c['push'](_0x579470);return;}}})[_0xd844('0x20')](function(){if(_0x32e309){emit(_0x27382c[_0xd844('0x23')],_0x242412,util[_0xd844('0x31')](_0xd844('0x32'),_0x32e309[_0xd844('0x33')]),util[_0xd844('0x31')](_0xd844('0x34'),_0x515d3a[_0xd844('0x35')][_0xd844('0x36')]()),{'evt':_[_0xd844('0x37')](_0x27382c,{'autoCreate':_0x152ced}),'contact':_0x14ed7d===undefined?{}:_0x14ed7d,'contacts':_0x11e14c['length']===0x0?undefined:_0x11e14c});}});}; \ No newline at end of file +var _0x513e=['[CM][%s][%s]\x20Contact\x20not\x20found','data4','phone','[CM][%s][%s]\x20Autocreate\x20enabled','calleridnum','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','name','format','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','ListId','data3','split','$or','map','routeId','destcalleridnum','firstName','lastName','mobile','fax','createdAt','updatedAt','union','resolve','getContacts','then','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join'];(function(_0x1f4fd5,_0x368647){var _0xe4540b=function(_0x32f16d){while(--_0x32f16d){_0x1f4fd5['push'](_0x1f4fd5['shift']());}};_0xe4540b(++_0x368647);}(_0x513e,0x138));var _0xe513=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x513e[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xe513('0x0'));var BPromise=require(_0xe513('0x1'));var Redis=require(_0xe513('0x2'));var util=require(_0xe513('0x3'));var config=require(_0xe513('0x4'));var logger=require(_0xe513('0x5'))(_0xe513('0x6'));var cmContactRpc=require(_0xe513('0x7'));config[_0xe513('0x8')]=_[_0xe513('0x9')](config[_0xe513('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xe513('0xa'))(new Redis(config['redis']));function emit(_0x2dd1bd,_0x125157,_0xd98878,_0x41a943,_0x395486){logger[_0xe513('0xb')](_0xe513('0xc'),_0x2dd1bd,_0x125157['id'],_0xd98878,_0x41a943,JSON[_0xe513('0xd')](_0x395486));io['to'](_0xd98878)[_0xe513('0xe')](_0x41a943,_0x395486);}exports[_0xe513('0xf')]=function(_0x54df89,_0x10e058,_0x2cb153,_0xb1aaa8){var _0x542090,_0x439eb7;var _0x3dac6b={};var _0xbbc47;var _0x435881=Number(_0x2cb153[_0xe513('0x10')]);var _0x350406=_0x2cb153[_0xe513('0x11')]?Boolean(Number(_0x2cb153['data2'])):![];var _0x9ad9ca;var _0x3d950c=![];if(!_[_0xe513('0x12')](_0x2cb153[_0xe513('0x13')])){if(_0x2cb153[_0xe513('0x13')]=='1')_0x3d950c=!![];}if(!_0x3d950c){if(_0xb1aaa8['xmd-contactid']){_0x3dac6b['id']=_0xb1aaa8['xmd-contactid'];}}if(!_0x3dac6b['id']){_0x3dac6b[_0xe513('0x14')]=_0x435881;_0x9ad9ca=_0x2cb153['data3']&&_0x2cb153['data3']!=='0'?_0x2cb153[_0xe513('0x15')][_0xe513('0x16')](','):['phone'];_0x3dac6b[_0xe513('0x17')]=_[_0xe513('0x18')](_0x9ad9ca,function(_0x405654){var _0x4dccd6={};_0x4dccd6[_0x405654]=_0xb1aaa8[_0xe513('0x19')]?_0xb1aaa8[_0xe513('0x1a')]:_0xb1aaa8['calleridnum'];return _0x4dccd6;});_0xbbc47=_0xb1aaa8[_0xe513('0x19')]?_0xb1aaa8[_0xe513('0x1a')]:_0xb1aaa8['calleridnum'];}var _0x4fe164=['id',_0xe513('0x1b'),_0xe513('0x1c'),'phone',_0xe513('0x1d'),_0xe513('0x1e'),'ListId',_0xe513('0x1f'),'scheduledAt',_0xe513('0x20')];var _0x3e425f=_[_0xe513('0x21')](_0x4fe164,_0x9ad9ca);BPromise[_0xe513('0x22')]()['then'](cmContactRpc[_0xe513('0x23')]({'attributes':_0x3e425f,'where':_0x3dac6b,'phone':_0xbbc47}))[_0xe513('0x24')](function(_0x37133e){_0x439eb7=_0x37133e;if(!_['isEmpty'](_0x439eb7)){if(_0x439eb7[_0xe513('0x25')]===0x1){_0x542090=_0x439eb7[0x0];logger[_0xe513('0xb')](_0xe513('0x26'),_0xb1aaa8[_0xe513('0x27')],_0x10e058['id'],_0x542090['id']);}else{logger[_0xe513('0xb')](_0xe513('0x28'),_0xb1aaa8[_0xe513('0x27')],_0x10e058['id'],_[_0xe513('0x18')](_0x439eb7,'id')[_0xe513('0x29')](','));}return;}else{logger[_0xe513('0xb')](_0xe513('0x2a'),_0xb1aaa8[_0xe513('0x27')],_0x10e058['id']);var _0x3f082c={'ListId':_0x435881};var _0x4a1b51=_0x2cb153[_0xe513('0x2b')]&&_0x2cb153['data4']!=='0'?_0x2cb153[_0xe513('0x2b')]:_0xe513('0x2c');if(_0x350406){logger['info'](_0xe513('0x2d'),_0xb1aaa8[_0xe513('0x27')],_0x10e058['id']);_0x3f082c[_0x4a1b51]=_[_0xe513('0x12')](_0xb1aaa8[_0xe513('0x19')])?_0xb1aaa8[_0xe513('0x2e')]:_0xb1aaa8[_0xe513('0x1a')];if(_[_0xe513('0x12')](_0xb1aaa8['routeId'])){_0x3f082c['firstName']=_0xb1aaa8[_0xe513('0x2f')]&&_0xb1aaa8[_0xe513('0x2f')]!==_0xe513('0x30')?_0xb1aaa8[_0xe513('0x2f')]:_0xe513('0x31');}else{_0x3f082c[_0xe513('0x1b')]=_0xb1aaa8['destcalleridname']&&_0xb1aaa8[_0xe513('0x32')]!==_0xe513('0x30')?_0xb1aaa8[_0xe513('0x32')]:_0xe513('0x31');}return BPromise[_0xe513('0x22')]()[_0xe513('0x24')](cmContactRpc[_0xe513('0x33')](_0x3f082c))[_0xe513('0x24')](function(_0x1b31a4){_0x542090=_0x1b31a4;_0x439eb7[_0xe513('0x34')](_0x1b31a4);if(_0x542090){logger[_0xe513('0xb')](_0xe513('0x35'),_0xb1aaa8[_0xe513('0x27')],_0x10e058['id'],_0x542090['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0xb1aaa8['uniqueid'],_0x10e058['id']);_0x3f082c[_0x4a1b51]=_['isNil'](_0xb1aaa8['routeId'])?_0xb1aaa8[_0xe513('0x2e')]:_0xb1aaa8[_0xe513('0x1a')];if(_[_0xe513('0x12')](_0xb1aaa8[_0xe513('0x19')])){_0x3f082c['firstName']=_0xb1aaa8[_0xe513('0x2f')]&&_0xb1aaa8[_0xe513('0x2f')]!==_0xe513('0x30')?_0xb1aaa8[_0xe513('0x2f')]:_0xe513('0x31');}else{_0x3f082c[_0xe513('0x1b')]=_0xb1aaa8[_0xe513('0x32')]&&_0xb1aaa8[_0xe513('0x32')]!==_0xe513('0x30')?_0xb1aaa8[_0xe513('0x32')]:_0xe513('0x31');}_0x542090=_0x3f082c;_0x439eb7[_0xe513('0x34')](_0x3f082c);return;}}})['then'](function(){if(_0x54df89){emit(_0xb1aaa8['uniqueid'],_0x10e058,util['format']('user:%s',_0x54df89[_0xe513('0x36')]),util[_0xe513('0x37')]('trigger:%s',_0x2cb153[_0xe513('0x38')][_0xe513('0x39')]()),{'evt':_[_0xe513('0x3a')](_0xb1aaa8,{'autoCreate':_0x350406}),'contact':_0x542090===undefined?{}:_0x542090,'contacts':_0x439eb7[_0xe513('0x25')]===0x0?undefined:_0x439eb7});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index bae91b3..c753713 100644 --- a/server/services/ami/trigger/index.js +++ b/server/services/ami/trigger/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7210=['winApplication','render','format','user:%s','name','trigger:%s:%s','merge','jscripty','trigger:%s','action','exec','integration','queue','routeId','urlforward','parse','search','replace','checkTrigger','channel','AllConditions','every','checkConditions','AnyConditions','some','checkTrigger:\x20trigger','field','account','ChatWebsiteId','operator','value','AccountId','upperFirst','interaction','message','event','agent','membername','lastevent','null','substatus','offlineMessage','created','equals','exports','lodash','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','custom:agentringnoanswer','bind','custom:agentcomplete','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','clone','motionChannel','undefined','debug','inspect','checkTriggers','interface','hasOwnProperty','status','variables','Actions','length','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','html','data2','uri','isNil','data3','data4','location','uriLocation','data5','windowHeight','600'];(function(_0x437924,_0x51fcb5){var _0x3592fc=function(_0x21ef3e){while(--_0x21ef3e){_0x437924['push'](_0x437924['shift']());}};_0x3592fc(++_0x51fcb5);}(_0x7210,0x137));var _0x0721=function(_0x19fec1,_0x1cc62f){_0x19fec1=_0x19fec1-0x0;var _0x29cd35=_0x7210[_0x19fec1];return _0x29cd35;};'use strict';var util=require('util');var _=require(_0x0721('0x0'));var url=require('url');var Mustache=require('mustache');var Redis=require(_0x0721('0x1'));var urlforward=require(_0x0721('0x2'));var integration=require(_0x0721('0x3'));var cmContact=require(_0x0721('0x4'));var script=require(_0x0721('0x5'));var config=require(_0x0721('0x6'));var logger=require('../../../config/logger')(_0x0721('0x7'));var ami=require(_0x0721('0x8'));config[_0x0721('0x9')]=_[_0x0721('0xa')](config[_0x0721('0x9')],{'host':_0x0721('0xb'),'port':0x18eb});var io=require(_0x0721('0xc'))(new Redis(config['redis']));var operators={'equals':function(_0x427227,_0x306a4e){return _0x427227==_0x306a4e;},'not_equals':function(_0x4491f6,_0x251bec){return _0x4491f6!=_0x251bec;}};var barAndWebActions=[_0x0721('0xd'),_0x0721('0xe'),_0x0721('0xf')];function Trigger(_0x220f72){this[_0x0721('0x10')]=_0x220f72[_0x0721('0x10')];this[_0x0721('0x11')]=_0x220f72[_0x0721('0x11')];this[_0x0721('0x12')]=_0x220f72[_0x0721('0x12')];this[_0x0721('0x13')]=_0x220f72[_0x0721('0x13')];this[_0x0721('0x14')]=_0x220f72['voiceExtensions'];this[_0x0721('0x15')]=_0x220f72[_0x0721('0x15')];this['freshdeskAccounts']=_0x220f72[_0x0721('0x16')];this[_0x0721('0x17')]=_0x220f72[_0x0721('0x17')];this[_0x0721('0x18')]=_0x220f72['sugarcrmAccounts'];this[_0x0721('0x19')]=_0x220f72[_0x0721('0x19')];this[_0x0721('0x1a')]=_0x220f72[_0x0721('0x1a')];this[_0x0721('0x1b')]=_0x220f72[_0x0721('0x1b')];this[_0x0721('0x1c')]=_0x220f72[_0x0721('0x1c')];this[_0x0721('0x1d')]=_0x220f72[_0x0721('0x1d')];this[_0x0721('0x1e')]=_0x220f72['freshsalesAccounts'];this[_0x0721('0x1f')]={'zendesk':this['zendeskAccounts'],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x0721('0x16')],'sugarcrm':this[_0x0721('0x18')],'zoho':this[_0x0721('0x19')],'desk':this[_0x0721('0x1a')],'vtiger':this[_0x0721('0x1b')],'dynamics365':this[_0x0721('0x1d')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x0721('0x1c')]};ami['on'](_0x0721('0x20'),this[_0x0721('0x21')]['bind'](this));ami['on'](_0x0721('0x22'),this[_0x0721('0x21')]['bind'](this));ami['on'](_0x0721('0x23'),this[_0x0721('0x21')][_0x0721('0x24')](this));ami['on'](_0x0721('0x25'),this[_0x0721('0x21')][_0x0721('0x24')](this));ami['on']('custom:agentnosuchnumber',this[_0x0721('0x21')][_0x0721('0x24')](this));ami['on'](_0x0721('0x26'),this[_0x0721('0x21')][_0x0721('0x24')](this));ami['on']('custom:agentbusy',this[_0x0721('0x21')]['bind'](this));ami['on'](_0x0721('0x27'),this[_0x0721('0x21')][_0x0721('0x24')](this));ami['on'](_0x0721('0x28'),this[_0x0721('0x21')]['bind'](this));ami['on'](_0x0721('0x29'),this[_0x0721('0x21')][_0x0721('0x24')](this));ami['on'](_0x0721('0x2a'),this[_0x0721('0x21')]['bind'](this));ami['on'](_0x0721('0x2b'),this[_0x0721('0x21')][_0x0721('0x24')](this));ami['on'](_0x0721('0x2c'),this[_0x0721('0x2d')][_0x0721('0x24')](this));ami['on'](_0x0721('0x2e'),this['syncAgentDial'][_0x0721('0x24')](this));ami['on'](_0x0721('0x2f'),this[_0x0721('0x2d')]['bind'](this));ami['on']('custom:newinteraction',this[_0x0721('0x21')][_0x0721('0x24')](this));ami['on'](_0x0721('0x30'),this[_0x0721('0x21')][_0x0721('0x24')](this));ami['on'](_0x0721('0x31'),this[_0x0721('0x21')][_0x0721('0x24')](this));ami['on'](_0x0721('0x32'),this[_0x0721('0x21')]['bind'](this));ami['on'](_0x0721('0x33'),this[_0x0721('0x21')][_0x0721('0x24')](this));ami['on'](_0x0721('0x34'),this[_0x0721('0x21')][_0x0721('0x24')](this));ami['on'](_0x0721('0x35'),this[_0x0721('0x21')]['bind'](this));ami['on'](_0x0721('0x36'),this[_0x0721('0x21')][_0x0721('0x24')](this));}Trigger[_0x0721('0x37')][_0x0721('0x38')]=function(_0x24cd7f,_0x376df4,_0x5d51a1){logger[_0x0721('0x39')](_0x24cd7f,_0x376df4,JSON[_0x0721('0x3a')](_0x5d51a1));io['to'](_0x24cd7f)[_0x0721('0x38')](_0x376df4,_0x5d51a1);};Trigger[_0x0721('0x37')][_0x0721('0x21')]=function(_0x4fbb50){var _0x4e7798=_[_0x0721('0x3b')](_0x4fbb50);if(typeof _0x4e7798[_0x0721('0x3c')]===_0x0721('0x3d')){_0x4e7798[_0x0721('0x3c')]='voice';}logger[_0x0721('0x3e')](_0x0721('0x21'),util[_0x0721('0x3f')](_0x4e7798,{'showHidden':!![],'depth':null}));this[_0x0721('0x40')](_0x4e7798);};Trigger[_0x0721('0x37')]['syncAgentDial']=function(_0x2596ec){if(this[_0x0721('0x11')][_0x2596ec[_0x0721('0x41')]]){this[_0x0721('0x21')](_0x2596ec);}};Trigger['prototype'][_0x0721('0x40')]=function(_0x5b4a79){var _0xbf71b2;for(var _0xb2258d in this[_0x0721('0x10')]){if(this[_0x0721('0x10')][_0x0721('0x42')](_0xb2258d)){if(this[_0x0721('0x10')][_0xb2258d][_0x0721('0x43')]){_0xbf71b2=this['checkTrigger'](this['triggers'][_0xb2258d],_0x5b4a79);if(_0xbf71b2){_['merge'](_0x5b4a79,_0x5b4a79[_0x0721('0x44')]);for(var _0x45e0d4=0x0,_0x459958,_0x115c77,_0x30379a;_0x45e0d40x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file +var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x57f72b,_0x36e5ff){var _0x8a4f06=function(_0x3a40b1){while(--_0x3a40b1){_0x57f72b['push'](_0x57f72b['shift']());}};_0x8a4f06(++_0x36e5ff);}(_0x3e74,0x175));var _0x43e7=function(_0x8508f1,_0x1c63b2){_0x8508f1=_0x8508f1-0x0;var _0x16ab12=_0x3e74[_0x8508f1];return _0x16ab12;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 0477434..b7abbfa 100644 --- a/server/services/ami/trigger/integration/dynamics365.js +++ b/server/services/ami/trigger/integration/dynamics365.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe991=['incidents','Subjects','getString','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','assign','Descriptions','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','modernAuthentication','%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','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','redis','localhost','socket.io-emitter','data7','tenantId','CloudProvider','resolve','data5','POST','clientId','remoteUri','username','password','clientSecret','access_token','catch','error','toUpperCase','message','then','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','length','internalemailaddress','info',']\x20Agent\x20found\x20','userId','systemuserid','userEmail','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','GET','contacts?$select=','&$filter=','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','picklist','type','nameField','customField','idField','indexOf','ticketType','incident'];(function(_0x68b90b,_0xb8b06a){var _0x5220ec=function(_0x226484){while(--_0x226484){_0x68b90b['push'](_0x68b90b['shift']());}};_0x5220ec(++_0xb8b06a);}(_0xe991,0xfe));var _0x1e99=function(_0x3a2bd3,_0x3c1fa5){_0x3a2bd3=_0x3a2bd3-0x0;var _0x2a250b=_0xe991[_0x3a2bd3];return _0x2a250b;};'use strict';var _=require(_0x1e99('0x0'));var rp=require(_0x1e99('0x1'));var util=require(_0x1e99('0x2'));var intUtil=require('./util');var md5=require(_0x1e99('0x3'));var Redis=require(_0x1e99('0x4'));var logger=require(_0x1e99('0x5'))(_0x1e99('0x6'));var config=require('../../../../config/environment');config[_0x1e99('0x7')]=_['defaults'](config[_0x1e99('0x7')],{'host':_0x1e99('0x8'),'port':0x18eb});var io=require(_0x1e99('0x9'))(new Redis(config[_0x1e99('0x7')]));function getAuthToken(_0x2d1cad,_0x46fe8d,_0x4532a2){if(_0x2d1cad['modernAuthentication']){_0x2d1cad['remoteUri']=_0x2d1cad['CloudProvider'][_0x1e99('0xa')];_0x2d1cad[_0x1e99('0xb')]=_0x2d1cad[_0x1e99('0xc')]['data2'];return Promise[_0x1e99('0xd')](_0x2d1cad[_0x1e99('0xc')][_0x1e99('0xe')]);}var _0x101464={'method':_0x1e99('0xf'),'uri':_0x46fe8d,'form':{'client_id':_0x2d1cad[_0x1e99('0x10')],'resource':_0x2d1cad[_0x1e99('0x11')],'username':_0x2d1cad[_0x1e99('0x12')],'password':_0x2d1cad[_0x1e99('0x13')],'grant_type':_0x1e99('0x13'),'client_secret':_0x2d1cad[_0x1e99('0x14')]},'json':!![]};return rp(_0x101464)['then'](function(_0x3307e6){return _0x3307e6[_0x1e99('0x15')];})[_0x1e99('0x16')](function(_0x3c38c1){logger[_0x1e99('0x17')]('['+[_0x4532a2[_0x1e99('0x18')]()]+']\x20Wrong\x20credentials!');return _0x3c38c1[_0x1e99('0x19')];});}function getUser(_0x3edc0e,_0x341b23,_0x345e8c,_0x5aa1b4,_0x2f2d12,_0x58207d){return new Promise(function(_0x143143,_0x569b3b){return getAuthToken(_0x341b23,_0x5aa1b4,_0x58207d)[_0x1e99('0x1a')](function(_0x5ef2cb){var _0x1e4e3a={'method':'GET','uri':_0x2f2d12+_0x1e99('0x1b'),'headers':{'Authorization':_0x1e99('0x1c')+_0x5ef2cb,'OData-Version':_0x1e99('0x1d')},'json':!![]};return rp(_0x1e4e3a);})[_0x1e99('0x1a')](function(_0x2db687){var _0x1c3577=_0x2db687[_0x1e99('0x1e')];var _0x4d3324=![];var _0x2322bf=null;if(!_[_0x1e99('0x1f')](_0x345e8c)){if(intUtil[_0x1e99('0x20')](_0x345e8c[_0x1e99('0x21')])){_0x3edc0e['userEmail']=_0x345e8c['email'];for(_0x2322bf=0x0;_0x2322bf<_0x1c3577[_0x1e99('0x22')];_0x2322bf++){if(_0x1c3577[_0x2322bf][_0x1e99('0x23')]===_0x345e8c[_0x1e99('0x21')]&&!_0x1c3577[_0x2322bf]['isdisabled']){_0x4d3324=!![];logger[_0x1e99('0x24')]('['+[_0x58207d[_0x1e99('0x18')]()]+_0x1e99('0x25')+_0x1c3577[_0x2322bf]['systemuserid']+'!');_0x3edc0e[_0x1e99('0x26')]=_0x1c3577[_0x2322bf][_0x1e99('0x27')];}}}}if(!_0x4d3324){logger[_0x1e99('0x24')]('['+[_0x58207d['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x3edc0e[_0x1e99('0x28')]=_0x341b23['username'];for(_0x2322bf=0x0;_0x2322bf<_0x1c3577['length'];_0x2322bf++){if(_0x1c3577[_0x2322bf][_0x1e99('0x23')]===_0x341b23[_0x1e99('0x12')]){_0x3edc0e[_0x1e99('0x26')]=_0x1c3577[_0x2322bf]['systemuserid'];}}}_0x143143(_0x3edc0e);})[_0x1e99('0x16')](function(_0x5d0f96){_0x569b3b(_0x5d0f96['message']);});});}function createEndUser(_0x4c9e71,_0x1c3eb1,_0x4168cb,_0x50b845,_0xfa3cb,_0x4fb8bf,_0x4a58b9){return new Promise(function(_0x25a364,_0x1a9d2d){return getAuthToken(_0x1c3eb1,_0x4168cb,_0x4fb8bf)[_0x1e99('0x1a')](function(_0x73f96f){var _0x31ff98=_0x4fb8bf[_0x1e99('0x29')]()===_0x1e99('0x2a')?_0xfa3cb[_0x1e99('0x2b')]:_0xfa3cb[_0x1e99('0x2c')];var _0x338fc2={'method':_0x1e99('0xf'),'uri':_0x50b845+_0x1e99('0x2d'),'body':{'fullname':_0x31ff98,'firstname':_0x31ff98,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x1e99('0x2e')+_0x4c9e71[_0x1e99('0x26')]+')'},'headers':{'Authorization':_0x1e99('0x1c')+_0x73f96f,'OData-Version':_0x1e99('0x1d')},'json':!![],'resolveWithFullResponse':!![]};_0x338fc2[_0x1e99('0x2f')][_0x4a58b9]=_0x31ff98;return rp(_0x338fc2);})[_0x1e99('0x1a')](function(_0x5dad99){var _0x33c4be=_0x5dad99[_0x1e99('0x30')][_0x1e99('0x31')];var _0x44df2c=_0x33c4be[_0x1e99('0x32')](_0x33c4be[_0x1e99('0x33')]('(')+0x1,_0x33c4be[_0x1e99('0x33')](')'));_0x4c9e71[_0x1e99('0x34')]=_0x44df2c;_0x25a364(_0x4c9e71);})[_0x1e99('0x16')](function(_0x23fb4e){_0x1a9d2d(_0x23fb4e['message']);});});}function getEndUser(_0x11709a,_0x535e1f,_0x22c929,_0x42a1a5,_0x2b6249,_0xbc15a3,_0xc7de66,_0x59f661){var _0x3fd6a2=_0xbc15a3[_0x1e99('0x29')]()===_0x1e99('0x2a')?_0x2b6249[_0x1e99('0x2b')]:_0x2b6249[_0x1e99('0x2c')];return getAuthToken(_0x535e1f,_0x22c929,_0xbc15a3)[_0x1e99('0x1a')](function(_0x152a69){_0x59f661=_0x59f661?_0x59f661:_0x1e99('0x35');var _0x3d0ea4={'method':_0x1e99('0x36'),'uri':_0x42a1a5+_0x1e99('0x37')+_0x59f661+_0x1e99('0x38')+_0x59f661+'\x20eq\x20\x27'+_0x3fd6a2['replace']('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x152a69,'If-None-Match':null,'OData-Version':_0x1e99('0x1d')},'json':!![]};return rp(_0x3d0ea4);})['then'](function(_0x139c99){var _0x22d792=![];if(!_0x139c99)return _0x22d792;var _0x60f708=_0x139c99[_0x1e99('0x1e')];for(var _0x1a5142=0x0;_0x1a5142<_0x60f708[_0x1e99('0x22')];_0x1a5142++){if(_0x60f708[_0x1a5142][_0x59f661]===_0x3fd6a2){_0x22d792=!![];_0x11709a[_0x1e99('0x34')]=_0x60f708[_0x1a5142][_0x1e99('0x39')];}}return _0x22d792;})[_0x1e99('0x1a')](function(_0x2d4e8f){if(_0x2d4e8f)return _0x11709a;if(_0xc7de66==='nothing'){logger['info']('['+[_0xbc15a3[_0x1e99('0x18')]()]+_0x1e99('0x3a'));return _0x11709a;}return createEndUser(_0x11709a,_0x535e1f,_0x22c929,_0x42a1a5,_0x2b6249,_0xbc15a3,_0x59f661)['then'](function(_0x497a2f){logger[_0x1e99('0x24')]('['+[_0xbc15a3[_0x1e99('0x18')]()]+_0x1e99('0x3b'),_0x497a2f[_0x1e99('0x34')]);return _0x497a2f;});});}function getCustomFields(_0x350403,_0x21b905,_0x1e3954){var _0x3a279d={};if(_0x350403[_0x1e99('0x22')]>0x0){_[_0x1e99('0x3c')](_0x350403,function(_0x15276b){if(_[_0x1e99('0x3d')](['string',_0x1e99('0x3e')],_0x15276b[_0x1e99('0x3f')])&&_0x15276b[_0x1e99('0x40')]&&!_0x15276b[_0x1e99('0x41')]){var _0x546d87=_0x15276b[_0x1e99('0x42')][_0x1e99('0x29')]();var _0x538c73=_0x546d87[_0x1e99('0x32')](0x0,_0x546d87['indexOf']('_'));var _0x1cbef3=_0x546d87['substring'](_0x546d87[_0x1e99('0x43')]('_')+0x1);if(_0x538c73===_0x1e3954){_0x3a279d[_0x1cbef3]=_0x15276b['content'];}}});}return _0x3a279d;}function getTicket(_0x1f6220,_0x13735b,_0x53213a,_0x1c356f,_0x311488,_0x452037,_0x261225){return new Promise(function(_0x33d980,_0x1e08c0){var _0xc26d5;return getAuthToken(_0x13735b,_0x53213a,_0x261225)['then'](function(_0x267815){if(_0x452037[_0x1e99('0x44')]===_0x1e99('0x45')){_0xc26d5={'method':'POST','uri':_0x1c356f+_0x1e99('0x46'),'body':Object['assign']({},{'title':intUtil['getString'](_0x452037[_0x1e99('0x47')],_0x311488,'\x20'),'description':intUtil[_0x1e99('0x48')](_0x452037['Descriptions'],_0x311488,'\x0a'),'customerid_contact@odata.bind':_0x1f6220[_0x1e99('0x34')]?_0x1e99('0x49')+_0x1f6220[_0x1e99('0x34')]+')':undefined,'ownerid@odata.bind':_0x1e99('0x2e')+_0x1f6220[_0x1e99('0x26')]+')','caseorigincode':'1'},getCustomFields(_0x452037[_0x1e99('0x4a')],_0x311488,_0x452037['ticketType'])),'headers':{'Authorization':_0x1e99('0x1c')+_0x267815,'OData-Version':_0x1e99('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x452037[_0x1e99('0x44')]===_0x1e99('0x4b')){var _0x21be03=_0x1f6220[_0x1e99('0x34')]?[{'partyid_systemuser@odata.bind':_0x1e99('0x2e')+_0x1f6220[_0x1e99('0x26')]+')','participationtypemask':_0x1f6220[_0x1e99('0x4c')]===_0x1e99('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x1f6220[_0x1e99('0x34')]+')','participationtypemask':_0x1f6220['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x1f6220[_0x1e99('0x26')]+')','participationtypemask':_0x1f6220['callDirection']==='queue'?0x2:0x1}];_0xc26d5={'method':'POST','uri':_0x1c356f+_0x1e99('0x4e'),'body':Object[_0x1e99('0x4f')]({},{'subject':intUtil['getString'](_0x452037[_0x1e99('0x47')],_0x311488,'\x20'),'phonenumber':String(_0x311488[_0x1e99('0x2c')]),'description':intUtil['getString'](_0x452037[_0x1e99('0x50')],_0x311488,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1f6220[_0x1e99('0x34')]?'/contacts('+_0x1f6220['enduserId']+')':undefined,'ownerid@odata.bind':_0x1e99('0x2e')+_0x1f6220[_0x1e99('0x26')]+')','directioncode':_0x1f6220['callDirection']===_0x1e99('0x4d')?![]:!![],'phonecall_activity_parties':_0x21be03},getCustomFields(_0x452037[_0x1e99('0x4a')],_0x311488,_0x452037[_0x1e99('0x44')])),'headers':{'Authorization':_0x1e99('0x1c')+_0x267815,'OData-Version':_0x1e99('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xc26d5);})[_0x1e99('0x1a')](function(_0x204b37){var _0x4a14a2=_0x204b37[_0x1e99('0x30')]['odata-entityid'];var _0x222f33=_0x4a14a2[_0x1e99('0x32')](_0x4a14a2['lastIndexOf']('(')+0x1,_0x4a14a2[_0x1e99('0x33')](')'));_0x1f6220['ticketId']=_0x222f33;_0x33d980(_0x1f6220);})[_0x1e99('0x16')](function(_0x2a6121){_0x1e08c0(_0x2a6121['message']);});});}function emit(_0x1c16ad,_0x119fe8,_0x498c93,_0x23add2){var _0x281f61={'uri':util[_0x1e99('0x51')](_0x1e99('0x52'),_0x1c16ad,_0x498c93,_0x23add2)};io['to'](util[_0x1e99('0x51')](_0x1e99('0x53'),_0x119fe8))[_0x1e99('0x54')](_0x1e99('0x55'),_0x281f61);}exports['cs']=function(_0xe39a49,_0x1af4c9,_0x590b15,_0x5a1407,_0x8b431a,_0x2cefa2,_0x3289cd,_0x4ea518){var _0xe32f67={};_0x2cefa2['remoteUri']=_0x2cefa2['modernAuthentication']?intUtil[_0x1e99('0x56')](_0x2cefa2['CloudProvider'][_0x1e99('0xa')]):intUtil[_0x1e99('0x56')](_0x2cefa2[_0x1e99('0x11')]);_0x2cefa2['serverUrl']=intUtil[_0x1e99('0x56')](_0x2cefa2[_0x1e99('0x57')]);_0xe32f67[_0x1e99('0x4c')]=_0x4ea518===_0x1e99('0x4d')||_0x4ea518==='unmanaged'?_0x1e99('0x4d'):_0x1e99('0x2a');var _0x315ad6=_0x2cefa2[_0x1e99('0x58')]?util[_0x1e99('0x51')](_0x1e99('0x59'),_0x2cefa2[_0x1e99('0xc')][_0x1e99('0xa')]):util[_0x1e99('0x51')](_0x1e99('0x59'),_0x2cefa2['remoteUri']);var _0x8d39c=util[_0x1e99('0x51')](_0x1e99('0x5a'),_0x2cefa2[_0x1e99('0xb')]);var _0x36a309=util[_0x1e99('0x51')](_0x1e99('0x5b'),_0x2cefa2[_0x1e99('0x57')],_0x1af4c9[_0x1e99('0x5c')],md5(_0x1af4c9[_0x1e99('0x5c')]));if(_0x8b431a&&_0x8b431a[_0x1e99('0x5d')]){logger[_0x1e99('0x24')]('[QUEUE]',_0x1e99('0x5e'));_0x1af4c9[_0x1e99('0x5f')]=_0x36a309;}else if(_0x3289cd&&_0x3289cd['recordingFormat']&&_0x3289cd[_0x1e99('0x60')]!==_0x1e99('0x61')){logger[_0x1e99('0x24')](_0x1e99('0x62'),_0x1e99('0x5e'));_0x1af4c9[_0x1e99('0x5f')]=_0x36a309;}else{_0x1af4c9[_0x1e99('0x5f')]='';}return getUser(_0xe32f67,_0x2cefa2,_0x5a1407,_0x8d39c,_0x315ad6,_0x4ea518)[_0x1e99('0x1a')](function(_0x322113){logger[_0x1e99('0x24')]('['+_0x4ea518['toUpperCase']()+_0x1e99('0x63'),_0x322113['userId']);logger[_0x1e99('0x24')]('['+_0x4ea518[_0x1e99('0x18')]()+_0x1e99('0x64'),_0x322113[_0x1e99('0x28')]);return getEndUser(_0x322113,_0x2cefa2,_0x8d39c,_0x315ad6,_0x1af4c9,_0x4ea518,_0x590b15['moduleCreate'],_0x590b15[_0x1e99('0x65')]);})[_0x1e99('0x1a')](function(_0x2c2e0b){logger[_0x1e99('0x24')]('['+_0x4ea518[_0x1e99('0x18')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x2c2e0b[_0x1e99('0x34')]);logger[_0x1e99('0x24')]('['+_0x4ea518[_0x1e99('0x18')]()+_0x1e99('0x66'),_0x1af4c9[_0x1e99('0x2c')]);return getTicket(_0x2c2e0b,_0x2cefa2,_0x8d39c,_0x315ad6,_0x1af4c9,_0x590b15,_0x4ea518);})['then'](function(_0x2da8d3){logger[_0x1e99('0x24')](util[_0x1e99('0x51')]('['+_0x4ea518[_0x1e99('0x18')]()+_0x1e99('0x67'),_0x590b15[_0x1e99('0x44')],_0x2da8d3['ticketId']));logger[_0x1e99('0x24')](util[_0x1e99('0x51')]('['+_0x4ea518[_0x1e99('0x18')]()+']\x20Call\x20direction:\x20%s',_0x4ea518));if(_0x4ea518!==_0x1e99('0x68')&&_0x590b15['openNewTab']){logger[_0x1e99('0x24')]('['+_0x4ea518[_0x1e99('0x18')]()+']',_0x1e99('0x69'));emit(_0x2cefa2[_0x1e99('0x11')],_0x5a1407[_0x1e99('0x6a')],_0x590b15[_0x1e99('0x44')],_0x2da8d3['ticketId']);}})[_0x1e99('0x16')](function(_0x3246be){logger[_0x1e99('0x17')]('['+_0x4ea518[_0x1e99('0x18')]()+_0x1e99('0x6b'),_0x3246be[_0x1e99('0x19')]);console[_0x1e99('0x17')]('Error\x20running\x20Dynamics365\x20integration',_0x3246be);});}; \ No newline at end of file +var _0x3f61=['monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','defaults','redis','localhost','socket.io-emitter','remoteUri','CloudProvider','tenantId','data5','clientId','username','password','clientSecret','then','access_token','catch','error','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','isNil','email','userEmail','length','internalemailaddress','isdisabled','info','toUpperCase','systemuserid','userId','outbound','destcalleridnum','POST','contacts','/systemusers(','Bearer\x20','body','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','calleridnum','contacts?$select=','&$filter=','replace','%2b','value','contactid',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','customField','idField','indexOf','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','callDirection','queue','headers','ticketId','user:%s','emit','modernAuthentication','data7','stripTrailingSlash','serverUrl','unmanaged','format','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x4af716,_0x10a3ec){var _0x5a69b9=function(_0x1890ab){while(--_0x1890ab){_0x4af716['push'](_0x4af716['shift']());}};_0x5a69b9(++_0x10a3ec);}(_0x3f61,0x7a));var _0x13f6=function(_0x15054f,_0x571566){_0x15054f=_0x15054f-0x0;var _0x2c4120=_0x3f61[_0x15054f];return _0x2c4120;};'use strict';var _=require('lodash');var rp=require(_0x13f6('0x0'));var util=require(_0x13f6('0x1'));var intUtil=require(_0x13f6('0x2'));var md5=require(_0x13f6('0x3'));var Redis=require(_0x13f6('0x4'));var logger=require(_0x13f6('0x5'))(_0x13f6('0x6'));var config=require('../../../../config/environment');config['redis']=_[_0x13f6('0x7')](config[_0x13f6('0x8')],{'host':_0x13f6('0x9'),'port':0x18eb});var io=require(_0x13f6('0xa'))(new Redis(config['redis']));function getAuthToken(_0x4c0751,_0x2f738f,_0x55e443){if(_0x4c0751['modernAuthentication']){_0x4c0751[_0x13f6('0xb')]=_0x4c0751[_0x13f6('0xc')]['data7'];_0x4c0751[_0x13f6('0xd')]=_0x4c0751[_0x13f6('0xc')]['data2'];return Promise['resolve'](_0x4c0751[_0x13f6('0xc')][_0x13f6('0xe')]);}var _0x18ee12={'method':'POST','uri':_0x2f738f,'form':{'client_id':_0x4c0751[_0x13f6('0xf')],'resource':_0x4c0751[_0x13f6('0xb')],'username':_0x4c0751[_0x13f6('0x10')],'password':_0x4c0751[_0x13f6('0x11')],'grant_type':_0x13f6('0x11'),'client_secret':_0x4c0751[_0x13f6('0x12')]},'json':!![]};return rp(_0x18ee12)[_0x13f6('0x13')](function(_0xed1529){return _0xed1529[_0x13f6('0x14')];})[_0x13f6('0x15')](function(_0x1bbf25){logger[_0x13f6('0x16')]('['+[_0x55e443['toUpperCase']()]+']\x20Wrong\x20credentials!');return _0x1bbf25[_0x13f6('0x17')];});}function getUser(_0x567928,_0x3f2a81,_0x3b4ea1,_0xe97fcb,_0x466367,_0x298cf6){return new Promise(function(_0x199db2,_0x3ba565){return getAuthToken(_0x3f2a81,_0xe97fcb,_0x298cf6)['then'](function(_0x1f6a91){var _0x32a7fa={'method':_0x13f6('0x18'),'uri':_0x466367+_0x13f6('0x19'),'headers':{'Authorization':'Bearer\x20'+_0x1f6a91,'OData-Version':_0x13f6('0x1a')},'json':!![]};return rp(_0x32a7fa);})['then'](function(_0x34ff46){var _0x11044f=_0x34ff46['value'];var _0x14cb00=![];var _0x165f47=null;if(!_[_0x13f6('0x1b')](_0x3b4ea1)){if(intUtil['validateEmail'](_0x3b4ea1[_0x13f6('0x1c')])){_0x567928[_0x13f6('0x1d')]=_0x3b4ea1[_0x13f6('0x1c')];for(_0x165f47=0x0;_0x165f47<_0x11044f[_0x13f6('0x1e')];_0x165f47++){if(_0x11044f[_0x165f47][_0x13f6('0x1f')]===_0x3b4ea1['email']&&!_0x11044f[_0x165f47][_0x13f6('0x20')]){_0x14cb00=!![];logger[_0x13f6('0x21')]('['+[_0x298cf6[_0x13f6('0x22')]()]+']\x20Agent\x20found\x20'+_0x11044f[_0x165f47][_0x13f6('0x23')]+'!');_0x567928[_0x13f6('0x24')]=_0x11044f[_0x165f47][_0x13f6('0x23')];}}}}if(!_0x14cb00){logger[_0x13f6('0x21')]('['+[_0x298cf6[_0x13f6('0x22')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x567928[_0x13f6('0x1d')]=_0x3f2a81['username'];for(_0x165f47=0x0;_0x165f47<_0x11044f[_0x13f6('0x1e')];_0x165f47++){if(_0x11044f[_0x165f47][_0x13f6('0x1f')]===_0x3f2a81['username']){_0x567928[_0x13f6('0x24')]=_0x11044f[_0x165f47][_0x13f6('0x23')];}}}_0x199db2(_0x567928);})['catch'](function(_0x5a2962){_0x3ba565(_0x5a2962[_0x13f6('0x17')]);});});}function createEndUser(_0x1adf6d,_0x296f71,_0x5b6399,_0x41b78c,_0x270ca1,_0x118c35,_0x148b15){return new Promise(function(_0x1a51fe,_0x47dad0){return getAuthToken(_0x296f71,_0x5b6399,_0x118c35)[_0x13f6('0x13')](function(_0x47a7d4){var _0x2a57d0=_0x118c35['toLowerCase']()===_0x13f6('0x25')?_0x270ca1[_0x13f6('0x26')]:_0x270ca1['calleridnum'];var _0xf46670={'method':_0x13f6('0x27'),'uri':_0x41b78c+_0x13f6('0x28'),'body':{'fullname':_0x2a57d0,'firstname':_0x2a57d0,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x13f6('0x29')+_0x1adf6d['userId']+')'},'headers':{'Authorization':_0x13f6('0x2a')+_0x47a7d4,'OData-Version':_0x13f6('0x1a')},'json':!![],'resolveWithFullResponse':!![]};_0xf46670[_0x13f6('0x2b')][_0x148b15]=_0x2a57d0;return rp(_0xf46670);})['then'](function(_0x39e96f){var _0x11d8c0=_0x39e96f['headers'][_0x13f6('0x2c')];var _0x1a91d7=_0x11d8c0[_0x13f6('0x2d')](_0x11d8c0[_0x13f6('0x2e')]('(')+0x1,_0x11d8c0['lastIndexOf'](')'));_0x1adf6d[_0x13f6('0x2f')]=_0x1a91d7;_0x1a51fe(_0x1adf6d);})[_0x13f6('0x15')](function(_0x2df968){_0x47dad0(_0x2df968[_0x13f6('0x17')]);});});}function getEndUser(_0x440461,_0x5156d3,_0x40d448,_0x57655e,_0x2d4257,_0x5d06c1,_0x30f3a6,_0x15048d){var _0x31846b=_0x5d06c1[_0x13f6('0x30')]()===_0x13f6('0x25')?_0x2d4257[_0x13f6('0x26')]:_0x2d4257[_0x13f6('0x31')];return getAuthToken(_0x5156d3,_0x40d448,_0x5d06c1)[_0x13f6('0x13')](function(_0x25735d){_0x15048d=_0x15048d?_0x15048d:'telephone1';var _0x29fb9c={'method':_0x13f6('0x18'),'uri':_0x57655e+_0x13f6('0x32')+_0x15048d+_0x13f6('0x33')+_0x15048d+'\x20eq\x20\x27'+_0x31846b[_0x13f6('0x34')]('+',_0x13f6('0x35'))+'\x27','headers':{'Authorization':_0x13f6('0x2a')+_0x25735d,'If-None-Match':null,'OData-Version':_0x13f6('0x1a')},'json':!![]};return rp(_0x29fb9c);})[_0x13f6('0x13')](function(_0x2ae7cc){var _0x239659=![];if(!_0x2ae7cc)return _0x239659;var _0x2f2cdd=_0x2ae7cc[_0x13f6('0x36')];for(var _0x35b603=0x0;_0x35b603<_0x2f2cdd[_0x13f6('0x1e')];_0x35b603++){if(_0x2f2cdd[_0x35b603][_0x15048d]===_0x31846b){_0x239659=!![];_0x440461['enduserId']=_0x2f2cdd[_0x35b603][_0x13f6('0x37')];}}return _0x239659;})[_0x13f6('0x13')](function(_0x57ecfb){if(_0x57ecfb)return _0x440461;if(_0x30f3a6==='nothing'){logger[_0x13f6('0x21')]('['+[_0x5d06c1[_0x13f6('0x22')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x440461;}return createEndUser(_0x440461,_0x5156d3,_0x40d448,_0x57655e,_0x2d4257,_0x5d06c1,_0x15048d)['then'](function(_0x417318){logger[_0x13f6('0x21')]('['+[_0x5d06c1[_0x13f6('0x22')]()]+_0x13f6('0x38'),_0x417318[_0x13f6('0x2f')]);return _0x417318;});});}function getCustomFields(_0x5a428f,_0x3f4373,_0x14ad8f){var _0xd95681={};if(_0x5a428f[_0x13f6('0x1e')]>0x0){_[_0x13f6('0x39')](_0x5a428f,function(_0x5193d2){if(_[_0x13f6('0x3a')]([_0x13f6('0x3b'),_0x13f6('0x3c')],_0x5193d2[_0x13f6('0x3d')])&&_0x5193d2['nameField']&&!_0x5193d2[_0x13f6('0x3e')]){var _0x59bdcd=_0x5193d2[_0x13f6('0x3f')][_0x13f6('0x30')]();var _0x3e9674=_0x59bdcd[_0x13f6('0x2d')](0x0,_0x59bdcd[_0x13f6('0x40')]('_'));var _0x2a4ba5=_0x59bdcd[_0x13f6('0x2d')](_0x59bdcd['indexOf']('_')+0x1);if(_0x3e9674===_0x14ad8f){_0xd95681[_0x2a4ba5]=_0x5193d2['content'];}}});}return _0xd95681;}function getTicket(_0x404e05,_0x33707c,_0x4d3876,_0x18dda7,_0xfb005c,_0x298c43,_0x1367cc){return new Promise(function(_0x123c78,_0x1e9c91){var _0x393973;return getAuthToken(_0x33707c,_0x4d3876,_0x1367cc)[_0x13f6('0x13')](function(_0x17afc3){if(_0x298c43[_0x13f6('0x41')]===_0x13f6('0x42')){_0x393973={'method':'POST','uri':_0x18dda7+_0x13f6('0x43'),'body':Object[_0x13f6('0x44')]({},{'title':intUtil[_0x13f6('0x45')](_0x298c43[_0x13f6('0x46')],_0xfb005c,'\x20'),'description':intUtil['getString'](_0x298c43[_0x13f6('0x47')],_0xfb005c,'\x0a'),'customerid_contact@odata.bind':_0x404e05[_0x13f6('0x2f')]?_0x13f6('0x48')+_0x404e05[_0x13f6('0x2f')]+')':undefined,'ownerid@odata.bind':_0x13f6('0x29')+_0x404e05[_0x13f6('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x298c43[_0x13f6('0x49')],_0xfb005c,_0x298c43['ticketType'])),'headers':{'Authorization':_0x13f6('0x2a')+_0x17afc3,'OData-Version':_0x13f6('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x298c43[_0x13f6('0x41')]==='phonecall'){var _0x4d471b=_0x404e05[_0x13f6('0x2f')]?[{'partyid_systemuser@odata.bind':_0x13f6('0x29')+_0x404e05[_0x13f6('0x24')]+')','participationtypemask':_0x404e05[_0x13f6('0x4a')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x13f6('0x48')+_0x404e05[_0x13f6('0x2f')]+')','participationtypemask':_0x404e05[_0x13f6('0x4a')]===_0x13f6('0x4b')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x13f6('0x29')+_0x404e05['userId']+')','participationtypemask':_0x404e05[_0x13f6('0x4a')]===_0x13f6('0x4b')?0x2:0x1}];_0x393973={'method':_0x13f6('0x27'),'uri':_0x18dda7+'phonecalls','body':Object[_0x13f6('0x44')]({},{'subject':intUtil[_0x13f6('0x45')](_0x298c43[_0x13f6('0x46')],_0xfb005c,'\x20'),'phonenumber':String(_0xfb005c[_0x13f6('0x31')]),'description':intUtil['getString'](_0x298c43[_0x13f6('0x47')],_0xfb005c,'\x0a'),'regardingobjectid_contact@odata.bind':_0x404e05[_0x13f6('0x2f')]?_0x13f6('0x48')+_0x404e05[_0x13f6('0x2f')]+')':undefined,'ownerid@odata.bind':_0x13f6('0x29')+_0x404e05[_0x13f6('0x24')]+')','directioncode':_0x404e05[_0x13f6('0x4a')]===_0x13f6('0x4b')?![]:!![],'phonecall_activity_parties':_0x4d471b},getCustomFields(_0x298c43[_0x13f6('0x49')],_0xfb005c,_0x298c43[_0x13f6('0x41')])),'headers':{'Authorization':_0x13f6('0x2a')+_0x17afc3,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x393973);})[_0x13f6('0x13')](function(_0x300522){var _0x398046=_0x300522[_0x13f6('0x4c')][_0x13f6('0x2c')];var _0x361f85=_0x398046[_0x13f6('0x2d')](_0x398046[_0x13f6('0x2e')]('(')+0x1,_0x398046[_0x13f6('0x2e')](')'));_0x404e05[_0x13f6('0x4d')]=_0x361f85;_0x123c78(_0x404e05);})[_0x13f6('0x15')](function(_0x27ce02){_0x1e9c91(_0x27ce02[_0x13f6('0x17')]);});});}function emit(_0x1213b6,_0x427c30,_0x587876,_0x570e6f){var _0x440fcd={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x1213b6,_0x587876,_0x570e6f)};io['to'](util['format'](_0x13f6('0x4e'),_0x427c30))[_0x13f6('0x4f')]('trigger:browser:url',_0x440fcd);}exports['cs']=function(_0x3cb6f3,_0x46d734,_0x1c60cc,_0x4a6f62,_0x24f1fa,_0x5ee864,_0x4e82ba,_0x35ce7d){var _0x243811={};_0x5ee864['remoteUri']=_0x5ee864[_0x13f6('0x50')]?intUtil['stripTrailingSlash'](_0x5ee864['CloudProvider'][_0x13f6('0x51')]):intUtil[_0x13f6('0x52')](_0x5ee864[_0x13f6('0xb')]);_0x5ee864[_0x13f6('0x53')]=intUtil[_0x13f6('0x52')](_0x5ee864[_0x13f6('0x53')]);_0x243811[_0x13f6('0x4a')]=_0x35ce7d===_0x13f6('0x4b')||_0x35ce7d===_0x13f6('0x54')?'queue':_0x13f6('0x25');var _0x5a0ed4=_0x5ee864[_0x13f6('0x50')]?util[_0x13f6('0x55')](_0x13f6('0x56'),_0x5ee864[_0x13f6('0xc')]['data7']):util[_0x13f6('0x55')]('%s/api/data/v9.0/',_0x5ee864[_0x13f6('0xb')]);var _0x270dea=util[_0x13f6('0x55')](_0x13f6('0x57'),_0x5ee864[_0x13f6('0xd')]);var _0x1cf13f=util[_0x13f6('0x55')](_0x13f6('0x58'),_0x5ee864['serverUrl'],_0x46d734['uniqueid'],md5(_0x46d734[_0x13f6('0x59')]));if(_0x24f1fa&&_0x24f1fa[_0x13f6('0x5a')]){logger[_0x13f6('0x21')](_0x13f6('0x5b'),_0x13f6('0x5c'));_0x46d734['recordingURL']=_0x1cf13f;}else if(_0x4e82ba&&_0x4e82ba['recordingFormat']&&_0x4e82ba[_0x13f6('0x5d')]!==_0x13f6('0x5e')){logger[_0x13f6('0x21')](_0x13f6('0x5f'),_0x13f6('0x5c'));_0x46d734[_0x13f6('0x60')]=_0x1cf13f;}else{_0x46d734[_0x13f6('0x60')]='';}return getUser(_0x243811,_0x5ee864,_0x4a6f62,_0x270dea,_0x5a0ed4,_0x35ce7d)['then'](function(_0x206fa7){logger['info']('['+_0x35ce7d[_0x13f6('0x22')]()+_0x13f6('0x61'),_0x206fa7['userId']);logger[_0x13f6('0x21')]('['+_0x35ce7d[_0x13f6('0x22')]()+_0x13f6('0x62'),_0x206fa7[_0x13f6('0x1d')]);return getEndUser(_0x206fa7,_0x5ee864,_0x270dea,_0x5a0ed4,_0x46d734,_0x35ce7d,_0x1c60cc[_0x13f6('0x63')],_0x1c60cc['additionalSearchContact']);})[_0x13f6('0x13')](function(_0x4b1ca3){logger[_0x13f6('0x21')]('['+_0x35ce7d[_0x13f6('0x22')]()+_0x13f6('0x64'),_0x4b1ca3[_0x13f6('0x2f')]);logger[_0x13f6('0x21')]('['+_0x35ce7d[_0x13f6('0x22')]()+_0x13f6('0x65'),_0x46d734[_0x13f6('0x31')]);return getTicket(_0x4b1ca3,_0x5ee864,_0x270dea,_0x5a0ed4,_0x46d734,_0x1c60cc,_0x35ce7d);})[_0x13f6('0x13')](function(_0x20d670){logger[_0x13f6('0x21')](util['format']('['+_0x35ce7d[_0x13f6('0x22')]()+_0x13f6('0x66'),_0x1c60cc[_0x13f6('0x41')],_0x20d670[_0x13f6('0x4d')]));logger[_0x13f6('0x21')](util['format']('['+_0x35ce7d[_0x13f6('0x22')]()+_0x13f6('0x67'),_0x35ce7d));if(_0x35ce7d!=='unmanaged'&&_0x1c60cc[_0x13f6('0x68')]){logger[_0x13f6('0x21')]('['+_0x35ce7d[_0x13f6('0x22')]()+']',_0x13f6('0x69'));emit(_0x5ee864[_0x13f6('0xb')],_0x4a6f62['name'],_0x1c60cc[_0x13f6('0x41')],_0x20d670[_0x13f6('0x4d')]);}})['catch'](function(_0x40e8f8){logger[_0x13f6('0x16')]('['+_0x35ce7d[_0x13f6('0x22')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x40e8f8[_0x13f6('0x17')]);console['error']('Error\x20running\x20Dynamics365\x20integration',_0x40e8f8);});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index 6f4c5c1..7f4e523 100644 --- a/server/services/ami/trigger/integration/freshdesk.js +++ b/server/services/ami/trigger/integration/freshdesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc0c6=['The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','Authorization','destcalleridname','destcalleridnum','Ticket\x20created!','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','toUpperCase','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','calleridname','calleridnum','getString','Subjects','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','then','validateEmail','%s/api/v2/agents','length','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','base64','[HTTP]','stringify','GET','forEach','includes','string','picklist','type','nameField','toLowerCase','content','toString','idField','customField','push','variable','variableName','customVariable','Variable','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:'];(function(_0x186d89,_0x47703d){var _0x39fea3=function(_0x3eddf0){while(--_0x3eddf0){_0x186d89['push'](_0x186d89['shift']());}};_0x39fea3(++_0x47703d);}(_0xc0c6,0xd1));var _0x6c0c=function(_0xd5d8da,_0xf598a0){_0xd5d8da=_0xd5d8da-0x0;var _0x3d1707=_0xc0c6[_0xd5d8da];return _0x3d1707;};'use strict';var _=require('lodash');var rp=require(_0x6c0c('0x0'));var md5=require(_0x6c0c('0x1'));var util=require(_0x6c0c('0x2'));var Redis=require(_0x6c0c('0x3'));var intUtil=require('./util');var config=require(_0x6c0c('0x4'));var logger=require(_0x6c0c('0x5'))(_0x6c0c('0x6'));config[_0x6c0c('0x7')]=_[_0x6c0c('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x6c0c('0x9'))(new Redis(config[_0x6c0c('0x7')]));var headers={'Content-Type':'application/json','Accept':_0x6c0c('0xa')};function emit(_0x3ab8c5,_0x55c3e2,_0x158592){io['to'](_0x3ab8c5)[_0x6c0c('0xb')](_0x55c3e2,_0x158592);}function getTicket(_0x35d52b,_0x51798b,_0x3f7187,_0x42b87f,_0x1dfb84){logger[_0x6c0c('0xc')](_0x6c0c('0xd'));var _0x1444b2=_[_0x6c0c('0xe')]({'responder_id':_0x51798b['id'],'requester_id':_0x3f7187['id'],'name':util['format']('Caller\x20-\x20%s',_0x1dfb84[_0x6c0c('0xf')]),'phone':_0x1dfb84[_0x6c0c('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x6c0c('0x11')](_0x42b87f[_0x6c0c('0x12')],_0x1dfb84,'\x20'),'description':intUtil['getString'](_0x42b87f[_0x6c0c('0x13')],_0x1dfb84,_0x6c0c('0x14')),'tags':getTags(_0x42b87f['Tags'],_0x6c0c('0x15'))},getCustomFields(_0x42b87f[_0x6c0c('0x16')],_0x1dfb84));_0x1444b2[_0x6c0c('0x17')]=_[_0x6c0c('0x18')](_[_0x6c0c('0x19')](_0x1444b2[_0x6c0c('0x17')],'id'),_0x6c0c('0x1a'));return request({'uri':util[_0x6c0c('0x1b')](_0x6c0c('0x1c'),_0x35d52b[_0x6c0c('0x1d')]),'method':'POST','body':_0x1444b2})[_0x6c0c('0x1e')](function(_0xbed185){logger[_0x6c0c('0xc')]('Ticket\x20created!');return _0xbed185;});}function getUser(_0x5c1f0f,_0x8437b1){if(intUtil[_0x6c0c('0x1f')](_0x8437b1)){return request({'uri':util[_0x6c0c('0x1b')](_0x6c0c('0x20'),_0x5c1f0f[_0x6c0c('0x1d')]),'qs':{'email':_0x8437b1}})[_0x6c0c('0x1e')](function(_0x3a2516){if(_0x3a2516[_0x6c0c('0x21')]){logger[_0x6c0c('0xc')]('Agent\x20found!');return _[_0x6c0c('0x22')](_0x3a2516,function(_0x5a9da1){return _0x5a9da1[_0x6c0c('0x23')]['email']===_0x8437b1;});}else{logger[_0x6c0c('0xc')](_0x6c0c('0x24'));return request({'uri':util[_0x6c0c('0x1b')](_0x6c0c('0x25'),_0x5c1f0f['remoteUri'])})[_0x6c0c('0x1e')](function(_0x40ab1e){logger['info']('Admin\x20account\x20selected.');return _0x40ab1e;});}});}else{logger[_0x6c0c('0xc')](_0x6c0c('0x26'));return request({'uri':util['format'](_0x6c0c('0x25'),_0x5c1f0f[_0x6c0c('0x1d')])})[_0x6c0c('0x1e')](function(_0xb49424){logger[_0x6c0c('0xc')](_0x6c0c('0x27'));return _0xb49424;});}}function getEndUser(_0x1af812,_0x32181e,_0x58abcf){logger[_0x6c0c('0xc')](_0x6c0c('0x28'),_0x58abcf);return request({'uri':util[_0x6c0c('0x1b')](_0x6c0c('0x29'),_0x1af812[_0x6c0c('0x1d')]),'qs':{'phone':_0x58abcf}})[_0x6c0c('0x1e')](function(_0xdc3389){if(_0xdc3389[_0x6c0c('0x21')]){logger[_0x6c0c('0xc')](_0x6c0c('0x2a'));return _[_0x6c0c('0x22')](_0xdc3389,{'phone':_0x58abcf});}else{logger[_0x6c0c('0xc')](_0x6c0c('0x2b'));return request({'uri':util['format'](_0x6c0c('0x29'),_0x1af812[_0x6c0c('0x1d')]),'method':'POST','body':{'name':_0x32181e,'phone':_0x58abcf}})[_0x6c0c('0x1e')](function(_0x4009d4){logger[_0x6c0c('0xc')](_0x6c0c('0x2c'));return _0x4009d4;});}});}function getAuth(_0x217249){return util['format']('Basic\x20%s',new Buffer(_0x217249[_0x6c0c('0x2d')]+':X')['toString'](_0x6c0c('0x2e')));}function request(_0xf1861e){logger['debug'](_0x6c0c('0x2f'),JSON[_0x6c0c('0x30')](_0xf1861e));return rp(_['defaults'](_0xf1861e,{'method':_0x6c0c('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x5459c6,_0x27f968){var _0x2aa9cb=[];if(_0x5459c6&&_0x5459c6[_0x6c0c('0x21')]>0x0){_0x2aa9cb=_['map'](_0x5459c6,_0x27f968);}return _0x2aa9cb;}function getCustomFields(_0x582ff6,_0x26a80a){var _0x2c68c5=[];var _0x4bc903={'custom_fields':[]};if(_0x582ff6[_0x6c0c('0x21')]>0x0){_[_0x6c0c('0x32')](_0x582ff6,function(_0x56d652){if(_[_0x6c0c('0x33')]([_0x6c0c('0x34'),_0x6c0c('0x35')],_0x56d652[_0x6c0c('0x36')])&&_0x56d652[_0x6c0c('0x37')]&&!_0x56d652['customField']){_0x4bc903[_0x56d652[_0x6c0c('0x37')][_0x6c0c('0x38')]()]=_0x56d652[_0x6c0c('0x39')][_0x6c0c('0x3a')]();}else if(_['includes'](['string','picklist'],_0x56d652[_0x6c0c('0x36')])&&_0x56d652[_0x6c0c('0x3b')]&&_0x56d652[_0x6c0c('0x3c')]){_0x4bc903[_0x6c0c('0x17')][_0x6c0c('0x3d')]({'id':_0x56d652['idField'],'value':_0x56d652[_0x6c0c('0x39')]['toString']()});}else if(_0x56d652[_0x6c0c('0x36')]===_0x6c0c('0x3e')&&_0x56d652[_0x6c0c('0x3f')]&&_0x56d652['idField']&&_0x56d652['customField']){_0x26a80a[_0x56d652[_0x6c0c('0x3f')]]&&_0x4bc903[_0x6c0c('0x17')]['push']({'id':_0x56d652[_0x6c0c('0x3b')],'value':_0x26a80a[_0x56d652['variableName']][_0x6c0c('0x3a')]()});}else if(_0x56d652['type']===_0x6c0c('0x40')&&_0x56d652[_0x6c0c('0x41')]&&_0x56d652[_0x6c0c('0x41')][_0x6c0c('0x15')]&&_0x56d652['idField']&&_0x56d652[_0x6c0c('0x3c')]){_0x26a80a[_0x56d652[_0x6c0c('0x41')]['name'][_0x6c0c('0x38')]()]&&_0x4bc903[_0x6c0c('0x17')][_0x6c0c('0x3d')]({'id':_0x56d652[_0x6c0c('0x3b')],'value':_0x26a80a[_0x56d652[_0x6c0c('0x41')][_0x6c0c('0x15')][_0x6c0c('0x38')]()][_0x6c0c('0x3a')]()});}});}return _0x4bc903;}exports['queue']=function(_0xd5bc1d,_0x59b6db,_0x2a6089,_0x106de4,_0x3db97c,_0x110e4d){var _0x621bb9,_0x25092c;_0x110e4d['remoteUri']=intUtil[_0x6c0c('0x42')](_0x110e4d[_0x6c0c('0x1d')]);_0x110e4d[_0x6c0c('0x43')]=intUtil[_0x6c0c('0x42')](_0x110e4d[_0x6c0c('0x43')]);if(_0x3db97c&&_0x3db97c[_0x6c0c('0x44')]){logger[_0x6c0c('0xc')](_0x6c0c('0x45'),_0x6c0c('0x46'));_0x59b6db[_0x6c0c('0x47')]=util[_0x6c0c('0x1b')](_0x6c0c('0x48'),_0x110e4d['serverUrl'],_0x59b6db['uniqueid'],md5(_0x59b6db[_0x6c0c('0x49')]));}else{_0x59b6db['recordingURL']='';}headers['Authorization']=getAuth(_0x110e4d);return getUser(_0x110e4d,_0x106de4[_0x6c0c('0x4a')])[_0x6c0c('0x1e')](function(_0x1c3023){_0x621bb9=_0x1c3023;logger[_0x6c0c('0xc')](_0x6c0c('0x4b'),_0x621bb9['id']);return getEndUser(_0x110e4d,_0x59b6db['calleridname'],_0x59b6db[_0x6c0c('0x10')]);})[_0x6c0c('0x1e')](function(_0x18f263){_0x25092c=_0x18f263;logger[_0x6c0c('0xc')](_0x6c0c('0x4c'),_0x25092c['id']);return getTicket(_0x110e4d,_0x621bb9,_0x25092c,_0x2a6089,_0x59b6db);})[_0x6c0c('0x1e')](function(_0x23f985){if(_0x23f985&&_0x23f985['id']){logger['info']('Ticket\x20created!');logger['info'](_0x6c0c('0x4d'),_0x23f985['id']);logger[_0x6c0c('0xc')](_0x6c0c('0x45'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x6c0c('0x1b')](_0x6c0c('0x4e'),_0x106de4[_0x6c0c('0x15')]),_0x6c0c('0x4f'),{'uri':util[_0x6c0c('0x1b')](_0x6c0c('0x50'),_0x110e4d['remoteUri'],_0x23f985['id'])});}})[_0x6c0c('0x51')](function(_0x24dace){logger[_0x6c0c('0x52')](_0x6c0c('0x45'),JSON['stringify'](_0x24dace));});};exports[_0x6c0c('0x53')]=function(_0x4ffb34,_0x4777a1,_0x4ade35,_0x3cec7c,_0x24e5df,_0x11076c,_0x141e11){var _0x3cf01a,_0x3aa648;_0x11076c['remoteUri']=intUtil['stripTrailingSlash'](_0x11076c[_0x6c0c('0x1d')]);_0x11076c[_0x6c0c('0x43')]=intUtil['stripTrailingSlash'](_0x11076c['serverUrl']);if(_0x141e11&&_0x141e11['recordingFormat']&&_0x141e11[_0x6c0c('0x54')]!==_0x6c0c('0x55')){logger[_0x6c0c('0xc')]('[OUTBOUND]',_0x6c0c('0x46'));_0x4777a1[_0x6c0c('0x47')]=util[_0x6c0c('0x1b')](_0x6c0c('0x48'),_0x11076c['serverUrl'],_0x4777a1[_0x6c0c('0x49')],md5(_0x4777a1[_0x6c0c('0x49')]));}headers[_0x6c0c('0x56')]=getAuth(_0x11076c);return getUser(_0x11076c,_0x3cec7c['email'])[_0x6c0c('0x1e')](function(_0x180b6a){_0x3cf01a=_0x180b6a;logger[_0x6c0c('0xc')](_0x6c0c('0x4b'),_0x3cf01a['id']);return getEndUser(_0x11076c,_0x4777a1[_0x6c0c('0x57')],_0x4777a1[_0x6c0c('0x58')]);})['then'](function(_0x48dc28){_0x3aa648=_0x48dc28;logger[_0x6c0c('0xc')]('The\x20Enduser\x20ID\x20is:',_0x3aa648['id']);return getTicket(_0x11076c,_0x3cf01a,_0x3aa648,_0x4ade35,_0x4777a1);})[_0x6c0c('0x1e')](function(_0xe79d1f){if(_0xe79d1f&&_0xe79d1f['id']){logger[_0x6c0c('0xc')](_0x6c0c('0x59'));logger[_0x6c0c('0xc')]('The\x20Ticket\x20ID\x20is:',_0xe79d1f['id']);logger['info'](_0x6c0c('0x5a'),_0x6c0c('0x5b'));emit(util[_0x6c0c('0x1b')](_0x6c0c('0x4e'),_0x3cec7c[_0x6c0c('0x15')]),'trigger:browser:url',{'uri':util['format'](_0x6c0c('0x50'),_0x11076c[_0x6c0c('0x1d')],_0xe79d1f['id'])});}})['catch'](function(_0x520838){logger[_0x6c0c('0x52')](_0x6c0c('0x5a'),JSON[_0x6c0c('0x30')](_0x520838));});};exports[_0x6c0c('0x5c')]=function(_0x40cfdb,_0x3336fc,_0x2b8e0b,_0x34429a,_0xb28879,_0x34882a){var _0x2ee1e6,_0x475c2c;_0x34882a[_0x6c0c('0x1d')]=intUtil['stripTrailingSlash'](_0x34882a[_0x6c0c('0x1d')]);_0x34882a[_0x6c0c('0x43')]=intUtil['stripTrailingSlash'](_0x34882a['serverUrl']);if(_0xb28879&&_0xb28879[_0x6c0c('0x44')]){logger[_0x6c0c('0xc')]('['+_0x3336fc[_0x6c0c('0x5d')][_0x6c0c('0x5e')]()+']',_0x6c0c('0x46'));_0x3336fc['recordingURL']=util[_0x6c0c('0x1b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x34882a[_0x6c0c('0x43')],_0x3336fc['uniqueid'],md5(_0x3336fc[_0x6c0c('0x49')]));}else{_0x3336fc[_0x6c0c('0x47')]='';}headers[_0x6c0c('0x56')]=getAuth(_0x34882a);return getUser(_0x34882a,'')[_0x6c0c('0x1e')](function(_0x53c6ff){_0x2ee1e6=_0x53c6ff;logger['info'](_0x6c0c('0x4b'),_0x2ee1e6['id']);return getEndUser(_0x34882a,_0x3336fc['calleridname'],_0x3336fc[_0x6c0c('0x10')]);})[_0x6c0c('0x1e')](function(_0x355fdf){_0x475c2c=_0x355fdf;logger[_0x6c0c('0xc')](_0x6c0c('0x4c'),_0x475c2c['id']);return getTicket(_0x34882a,_0x2ee1e6,_0x475c2c,_0x2b8e0b,_0x3336fc);})[_0x6c0c('0x1e')](function(_0x12c254){if(_0x12c254){logger['info']('Ticket\x20created!');logger[_0x6c0c('0xc')](_0x6c0c('0x4d'),_0x12c254['id']);}})[_0x6c0c('0x51')](function(_0x4643f7){logger[_0x6c0c('0x52')]('['+_0x3336fc[_0x6c0c('0x5d')][_0x6c0c('0x5e')]()+']',JSON[_0x6c0c('0x30')](_0x4643f7));});}; \ No newline at end of file +var _0xf7aa=['md5','util','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','merge','format','getString','Subjects','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','GET','map','forEach','string','picklist','type','customField','nameField','toLowerCase','content','toString','includes','idField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','user:%s','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridnum','trigger:browser:url','catch','toUpperCase','lastevent','lodash','request-promise'];(function(_0x19ac6e,_0x435862){var _0x1cdcf3=function(_0x23151c){while(--_0x23151c){_0x19ac6e['push'](_0x19ac6e['shift']());}};_0x1cdcf3(++_0x435862);}(_0xf7aa,0x1d4));var _0xaf7a=function(_0x146b91,_0x339fb2){_0x146b91=_0x146b91-0x0;var _0x55f7a3=_0xf7aa[_0x146b91];return _0x55f7a3;};'use strict';var _=require(_0xaf7a('0x0'));var rp=require(_0xaf7a('0x1'));var md5=require(_0xaf7a('0x2'));var util=require(_0xaf7a('0x3'));var Redis=require('ioredis');var intUtil=require(_0xaf7a('0x4'));var config=require('../../../../config/environment');var logger=require(_0xaf7a('0x5'))('freshdesk');config[_0xaf7a('0x6')]=_[_0xaf7a('0x7')](config[_0xaf7a('0x6')],{'host':_0xaf7a('0x8'),'port':0x18eb});var io=require(_0xaf7a('0x9'))(new Redis(config[_0xaf7a('0x6')]));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x191ddd,_0x3430be,_0x3ff6c0){io['to'](_0x191ddd)[_0xaf7a('0xa')](_0x3430be,_0x3ff6c0);}function getTicket(_0x1125a0,_0x19e91b,_0x21c39f,_0x51e410,_0x41fd80){logger[_0xaf7a('0xb')](_0xaf7a('0xc'));var _0x36e38e=_[_0xaf7a('0xd')]({'responder_id':_0x19e91b['id'],'requester_id':_0x21c39f['id'],'name':util[_0xaf7a('0xe')]('Caller\x20-\x20%s',_0x41fd80['calleridname']),'phone':_0x41fd80['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xaf7a('0xf')](_0x51e410[_0xaf7a('0x10')],_0x41fd80,'\x20'),'description':intUtil[_0xaf7a('0xf')](_0x51e410[_0xaf7a('0x11')],_0x41fd80,_0xaf7a('0x12')),'tags':getTags(_0x51e410['Tags'],_0xaf7a('0x13'))},getCustomFields(_0x51e410[_0xaf7a('0x14')],_0x41fd80));_0x36e38e[_0xaf7a('0x15')]=_[_0xaf7a('0x16')](_[_0xaf7a('0x17')](_0x36e38e[_0xaf7a('0x15')],'id'),_0xaf7a('0x18'));return request({'uri':util[_0xaf7a('0xe')](_0xaf7a('0x19'),_0x1125a0[_0xaf7a('0x1a')]),'method':'POST','body':_0x36e38e})['then'](function(_0x3685a1){logger[_0xaf7a('0xb')](_0xaf7a('0x1b'));return _0x3685a1;});}function getUser(_0x2bcac4,_0xe62635){if(intUtil[_0xaf7a('0x1c')](_0xe62635)){return request({'uri':util['format'](_0xaf7a('0x1d'),_0x2bcac4[_0xaf7a('0x1a')]),'qs':{'email':_0xe62635}})[_0xaf7a('0x1e')](function(_0x5651b4){if(_0x5651b4[_0xaf7a('0x1f')]){logger[_0xaf7a('0xb')](_0xaf7a('0x20'));return _[_0xaf7a('0x21')](_0x5651b4,function(_0x15a2d7){return _0x15a2d7[_0xaf7a('0x22')][_0xaf7a('0x23')]===_0xe62635;});}else{logger[_0xaf7a('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xaf7a('0xe')](_0xaf7a('0x24'),_0x2bcac4['remoteUri'])})[_0xaf7a('0x1e')](function(_0xe7810f){logger[_0xaf7a('0xb')](_0xaf7a('0x25'));return _0xe7810f;});}});}else{logger[_0xaf7a('0xb')](_0xaf7a('0x26'));return request({'uri':util[_0xaf7a('0xe')]('%s/api/v2/agents/me',_0x2bcac4[_0xaf7a('0x1a')])})[_0xaf7a('0x1e')](function(_0x56511f){logger[_0xaf7a('0xb')]('Admin\x20account\x20selected.');return _0x56511f;});}}function getEndUser(_0x4362d9,_0x5bc98a,_0x4eda6f){logger['info']('Searching\x20enduser\x20with\x20phone',_0x4eda6f);return request({'uri':util[_0xaf7a('0xe')](_0xaf7a('0x27'),_0x4362d9[_0xaf7a('0x1a')]),'qs':{'phone':_0x4eda6f}})[_0xaf7a('0x1e')](function(_0x5ad7b2){if(_0x5ad7b2['length']){logger[_0xaf7a('0xb')](_0xaf7a('0x28'));return _[_0xaf7a('0x21')](_0x5ad7b2,{'phone':_0x4eda6f});}else{logger[_0xaf7a('0xb')](_0xaf7a('0x29'));return request({'uri':util[_0xaf7a('0xe')]('%s/api/v2/contacts',_0x4362d9[_0xaf7a('0x1a')]),'method':'POST','body':{'name':_0x5bc98a,'phone':_0x4eda6f}})[_0xaf7a('0x1e')](function(_0x1ace69){logger[_0xaf7a('0xb')](_0xaf7a('0x2a'));return _0x1ace69;});}});}function getAuth(_0xa857b){return util[_0xaf7a('0xe')](_0xaf7a('0x2b'),new Buffer(_0xa857b[_0xaf7a('0x2c')]+':X')['toString'](_0xaf7a('0x2d')));}function request(_0x39d618){logger[_0xaf7a('0x2e')](_0xaf7a('0x2f'),JSON[_0xaf7a('0x30')](_0x39d618));return rp(_['defaults'](_0x39d618,{'method':_0xaf7a('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x3f8841,_0x42de9b){var _0x47727a=[];if(_0x3f8841&&_0x3f8841[_0xaf7a('0x1f')]>0x0){_0x47727a=_[_0xaf7a('0x32')](_0x3f8841,_0x42de9b);}return _0x47727a;}function getCustomFields(_0x3b454f,_0x3267f8){var _0x4f0421=[];var _0x2e1554={'custom_fields':[]};if(_0x3b454f['length']>0x0){_[_0xaf7a('0x33')](_0x3b454f,function(_0x1c07ed){if(_['includes']([_0xaf7a('0x34'),_0xaf7a('0x35')],_0x1c07ed[_0xaf7a('0x36')])&&_0x1c07ed['nameField']&&!_0x1c07ed[_0xaf7a('0x37')]){_0x2e1554[_0x1c07ed[_0xaf7a('0x38')][_0xaf7a('0x39')]()]=_0x1c07ed[_0xaf7a('0x3a')][_0xaf7a('0x3b')]();}else if(_[_0xaf7a('0x3c')](['string',_0xaf7a('0x35')],_0x1c07ed['type'])&&_0x1c07ed[_0xaf7a('0x3d')]&&_0x1c07ed[_0xaf7a('0x37')]){_0x2e1554[_0xaf7a('0x15')][_0xaf7a('0x3e')]({'id':_0x1c07ed[_0xaf7a('0x3d')],'value':_0x1c07ed[_0xaf7a('0x3a')][_0xaf7a('0x3b')]()});}else if(_0x1c07ed['type']===_0xaf7a('0x3f')&&_0x1c07ed[_0xaf7a('0x40')]&&_0x1c07ed[_0xaf7a('0x3d')]&&_0x1c07ed[_0xaf7a('0x37')]){_0x3267f8[_0x1c07ed[_0xaf7a('0x40')]]&&_0x2e1554['custom_fields'][_0xaf7a('0x3e')]({'id':_0x1c07ed[_0xaf7a('0x3d')],'value':_0x3267f8[_0x1c07ed[_0xaf7a('0x40')]][_0xaf7a('0x3b')]()});}else if(_0x1c07ed['type']===_0xaf7a('0x41')&&_0x1c07ed[_0xaf7a('0x42')]&&_0x1c07ed[_0xaf7a('0x42')][_0xaf7a('0x13')]&&_0x1c07ed[_0xaf7a('0x3d')]&&_0x1c07ed['customField']){_0x3267f8[_0x1c07ed[_0xaf7a('0x42')][_0xaf7a('0x13')][_0xaf7a('0x39')]()]&&_0x2e1554[_0xaf7a('0x15')][_0xaf7a('0x3e')]({'id':_0x1c07ed[_0xaf7a('0x3d')],'value':_0x3267f8[_0x1c07ed[_0xaf7a('0x42')]['name'][_0xaf7a('0x39')]()]['toString']()});}});}return _0x2e1554;}exports[_0xaf7a('0x43')]=function(_0x3c0808,_0x1628cd,_0x4523ca,_0x281fd8,_0x5eb0a5,_0x3848bd){var _0x53b4e5,_0x5a37e1;_0x3848bd[_0xaf7a('0x1a')]=intUtil[_0xaf7a('0x44')](_0x3848bd['remoteUri']);_0x3848bd[_0xaf7a('0x45')]=intUtil[_0xaf7a('0x44')](_0x3848bd[_0xaf7a('0x45')]);if(_0x5eb0a5&&_0x5eb0a5[_0xaf7a('0x46')]){logger[_0xaf7a('0xb')]('[QUEUE]',_0xaf7a('0x47'));_0x1628cd[_0xaf7a('0x48')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3848bd['serverUrl'],_0x1628cd[_0xaf7a('0x49')],md5(_0x1628cd[_0xaf7a('0x49')]));}else{_0x1628cd[_0xaf7a('0x48')]='';}headers['Authorization']=getAuth(_0x3848bd);return getUser(_0x3848bd,_0x281fd8[_0xaf7a('0x23')])[_0xaf7a('0x1e')](function(_0xd86cf2){_0x53b4e5=_0xd86cf2;logger[_0xaf7a('0xb')](_0xaf7a('0x4a'),_0x53b4e5['id']);return getEndUser(_0x3848bd,_0x1628cd[_0xaf7a('0x4b')],_0x1628cd[_0xaf7a('0x4c')]);})[_0xaf7a('0x1e')](function(_0x34ef15){_0x5a37e1=_0x34ef15;logger[_0xaf7a('0xb')](_0xaf7a('0x4d'),_0x5a37e1['id']);return getTicket(_0x3848bd,_0x53b4e5,_0x5a37e1,_0x4523ca,_0x1628cd);})['then'](function(_0x3273bd){if(_0x3273bd&&_0x3273bd['id']){logger[_0xaf7a('0xb')](_0xaf7a('0x1b'));logger[_0xaf7a('0xb')](_0xaf7a('0x4e'),_0x3273bd['id']);logger['info'](_0xaf7a('0x4f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xaf7a('0xe')](_0xaf7a('0x50'),_0x281fd8[_0xaf7a('0x13')]),'trigger:browser:url',{'uri':util[_0xaf7a('0xe')](_0xaf7a('0x51'),_0x3848bd[_0xaf7a('0x1a')],_0x3273bd['id'])});}})['catch'](function(_0x181ab1){logger[_0xaf7a('0x52')](_0xaf7a('0x4f'),JSON[_0xaf7a('0x30')](_0x181ab1));});};exports[_0xaf7a('0x53')]=function(_0x5996ec,_0x136eb4,_0x4382f3,_0x35da4c,_0x3a6b43,_0x5b532a,_0x38d4a4){var _0x1008e0,_0x5a810a;_0x5b532a[_0xaf7a('0x1a')]=intUtil['stripTrailingSlash'](_0x5b532a['remoteUri']);_0x5b532a[_0xaf7a('0x45')]=intUtil[_0xaf7a('0x44')](_0x5b532a[_0xaf7a('0x45')]);if(_0x38d4a4&&_0x38d4a4[_0xaf7a('0x54')]&&_0x38d4a4[_0xaf7a('0x54')]!==_0xaf7a('0x55')){logger[_0xaf7a('0xb')](_0xaf7a('0x56'),'Recording\x20is\x20enabled!');_0x136eb4[_0xaf7a('0x48')]=util['format'](_0xaf7a('0x57'),_0x5b532a[_0xaf7a('0x45')],_0x136eb4[_0xaf7a('0x49')],md5(_0x136eb4[_0xaf7a('0x49')]));}headers[_0xaf7a('0x58')]=getAuth(_0x5b532a);return getUser(_0x5b532a,_0x35da4c[_0xaf7a('0x23')])[_0xaf7a('0x1e')](function(_0x31b158){_0x1008e0=_0x31b158;logger[_0xaf7a('0xb')](_0xaf7a('0x4a'),_0x1008e0['id']);return getEndUser(_0x5b532a,_0x136eb4['destcalleridname'],_0x136eb4[_0xaf7a('0x59')]);})[_0xaf7a('0x1e')](function(_0x2ef53e){_0x5a810a=_0x2ef53e;logger[_0xaf7a('0xb')]('The\x20Enduser\x20ID\x20is:',_0x5a810a['id']);return getTicket(_0x5b532a,_0x1008e0,_0x5a810a,_0x4382f3,_0x136eb4);})[_0xaf7a('0x1e')](function(_0x27ffd0){if(_0x27ffd0&&_0x27ffd0['id']){logger['info'](_0xaf7a('0x1b'));logger['info'](_0xaf7a('0x4e'),_0x27ffd0['id']);logger[_0xaf7a('0xb')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xaf7a('0xe')](_0xaf7a('0x50'),_0x35da4c['name']),_0xaf7a('0x5a'),{'uri':util[_0xaf7a('0xe')](_0xaf7a('0x51'),_0x5b532a[_0xaf7a('0x1a')],_0x27ffd0['id'])});}})[_0xaf7a('0x5b')](function(_0x3a4c76){logger[_0xaf7a('0x52')](_0xaf7a('0x56'),JSON[_0xaf7a('0x30')](_0x3a4c76));});};exports['unmanaged']=function(_0x3278cd,_0x258ad4,_0x4110c0,_0x5b983d,_0x4aedef,_0x5b367a){var _0x4e4c10,_0x529fd6;_0x5b367a['remoteUri']=intUtil[_0xaf7a('0x44')](_0x5b367a[_0xaf7a('0x1a')]);_0x5b367a[_0xaf7a('0x45')]=intUtil[_0xaf7a('0x44')](_0x5b367a[_0xaf7a('0x45')]);if(_0x4aedef&&_0x4aedef[_0xaf7a('0x46')]){logger[_0xaf7a('0xb')]('['+_0x258ad4['lastevent'][_0xaf7a('0x5c')]()+']',_0xaf7a('0x47'));_0x258ad4[_0xaf7a('0x48')]=util[_0xaf7a('0xe')](_0xaf7a('0x57'),_0x5b367a[_0xaf7a('0x45')],_0x258ad4[_0xaf7a('0x49')],md5(_0x258ad4[_0xaf7a('0x49')]));}else{_0x258ad4[_0xaf7a('0x48')]='';}headers['Authorization']=getAuth(_0x5b367a);return getUser(_0x5b367a,'')[_0xaf7a('0x1e')](function(_0x4268c4){_0x4e4c10=_0x4268c4;logger[_0xaf7a('0xb')]('The\x20User\x20ID\x20is:',_0x4e4c10['id']);return getEndUser(_0x5b367a,_0x258ad4[_0xaf7a('0x4b')],_0x258ad4[_0xaf7a('0x4c')]);})[_0xaf7a('0x1e')](function(_0x5b23be){_0x529fd6=_0x5b23be;logger['info'](_0xaf7a('0x4d'),_0x529fd6['id']);return getTicket(_0x5b367a,_0x4e4c10,_0x529fd6,_0x4110c0,_0x258ad4);})['then'](function(_0x1c8626){if(_0x1c8626){logger[_0xaf7a('0xb')]('Ticket\x20created!');logger[_0xaf7a('0xb')]('The\x20Ticket\x20ID\x20is:',_0x1c8626['id']);}})['catch'](function(_0x1c3edc){logger[_0xaf7a('0x52')]('['+_0x258ad4[_0xaf7a('0x5d')][_0xaf7a('0x5c')]()+']',JSON[_0xaf7a('0x30')](_0x1c3edc));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js index aafa667..9bd87af 100644 --- a/server/services/ami/trigger/integration/freshsales.js +++ b/server/services/ami/trigger/integration/freshsales.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b87=['POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','destcalleridnum','calleridnum','callDirection','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','GET','/api/selector/owners','headers','then','users','length','email','adminEmail','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20created:'];(function(_0x4327fe,_0x4f8040){var _0x138651=function(_0x418acc){while(--_0x418acc){_0x4327fe['push'](_0x4327fe['shift']());}};_0x138651(++_0x4f8040);}(_0x8b87,0x118));var _0x78b8=function(_0x553a34,_0x4d7070){_0x553a34=_0x553a34-0x0;var _0x217fe3=_0x8b87[_0x553a34];return _0x217fe3;};'use strict';var _=require(_0x78b8('0x0'));var rp=require(_0x78b8('0x1'));var md5=require(_0x78b8('0x2'));var util=require(_0x78b8('0x3'));var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0x78b8('0x4'));var intUtil=require(_0x78b8('0x5'));var config=require(_0x78b8('0x6'));var logger=require('../../../../config/logger')('freshsales');config[_0x78b8('0x7')]=_[_0x78b8('0x8')](config[_0x78b8('0x7')],{'host':_0x78b8('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x78b8('0x7')]));function getAdminId(_0x16193d,_0x5507b2,_0x184cfb,_0x3e5945){return new Promise(function(_0x95225b,_0x587116){var _0x2248d6=![];var _0x3aac53={'method':_0x78b8('0xa'),'uri':_0x3e5945+_0x78b8('0xb'),'json':!![]};_0x3aac53[_0x78b8('0xc')]=_0x184cfb;logger['info']('Getting\x20admin\x20information');return rp(_0x3aac53)[_0x78b8('0xd')](function(_0x1aa83c){if(_0x1aa83c){var _0x2f7843=_0x1aa83c[_0x78b8('0xe')];var _0x4b345b=null;for(_0x4b345b=0x0;_0x4b345b<_0x2f7843[_0x78b8('0xf')];_0x4b345b++){if(_0x2f7843[_0x4b345b][_0x78b8('0x10')]===_0x16193d[_0x78b8('0x11')]){_0x16193d[_0x78b8('0x12')]=_0x2f7843[_0x4b345b]['id'];_0x2248d6=!![];}}if(_0x2248d6){logger[_0x78b8('0x13')](_0x78b8('0x14'),_0x16193d[_0x78b8('0x12')]);_0x95225b(_0x16193d);}else{_0x587116({'statusCode':0x194,'message':_0x78b8('0x15')});}}else{_0x587116({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x78b8('0x16')](function(_0xa63fb3){logger[_0x78b8('0x17')]('['+[_0x5507b2[_0x78b8('0x18')]()]+']',_0xa63fb3[_0x78b8('0x19')]);_0x587116(_0xa63fb3);});});}function getUser(_0xc0c354,_0xa2a01,_0x3a1a8f){return function(_0x1de8ec){return new Promise(function(_0x428a55,_0x252bfd){var _0x56e4c5={'method':_0x78b8('0xa'),'uri':_0x3a1a8f+_0x78b8('0xb'),'json':!![]};_0x56e4c5[_0x78b8('0xc')]=_0xa2a01;logger[_0x78b8('0x13')](_0x78b8('0x1a'));return rp(_0x56e4c5)[_0x78b8('0xd')](function(_0x1e35cc){if(_0x1e35cc){var _0x1a365b=_0x1e35cc[_0x78b8('0xe')];var _0x3dc973=![];var _0x5c67ce=null;if(_0x1de8ec[_0x78b8('0x1b')]!==null){logger[_0x78b8('0x13')](_0x78b8('0x1c'),_0x1de8ec[_0x78b8('0x1b')]);_0x1de8ec[_0x78b8('0x1d')]=_0x1de8ec[_0x78b8('0x1b')];for(_0x5c67ce=0x0;_0x5c67ce<_0x1a365b[_0x78b8('0xf')];_0x5c67ce++){if(_0x1a365b[_0x5c67ce]['email']===_0x1de8ec[_0x78b8('0x1b')]){_0x3dc973=!![];_0x1de8ec[_0x78b8('0x1e')]=_0x1a365b[_0x5c67ce]['id'];logger[_0x78b8('0x13')](_0x78b8('0x1f'),_0x1de8ec[_0x78b8('0x1e')]);}}}if(!_0x3dc973){logger['info'](_0x78b8('0x20'));_0x1de8ec[_0x78b8('0x1d')]=_0x1de8ec[_0x78b8('0x11')];_0x1de8ec[_0x78b8('0x1e')]=_0x1de8ec['adminId'];_0x3dc973=!![];}if(_0x3dc973){_0x428a55(_0x1de8ec);}else{_0x252bfd({'statusCode':0x194,'message':_0x78b8('0x15')});}}else{_0x252bfd({'statusCode':0x194,'message':_0x78b8('0x15')});}})[_0x78b8('0x16')](function(_0x259fec){logger['error']('['+[_0xc0c354['toUpperCase']()]+']',_0x259fec[_0x78b8('0x19')]);_0x252bfd(_0x259fec);});});};}function searchContact(_0x436024,_0x17e80b,_0x5651e0,_0x2a6c7f){return new Promise(function(_0x1861be,_0x280d12){var _0x3a0eb7={'method':'GET','headers':_0x17e80b,'uri':_0x436024+_0x78b8('0x21')+_0x2a6c7f+_0x78b8('0x22')+_0x5651e0+_0x78b8('0x23'),'json':!![]};rp(_0x3a0eb7)[_0x78b8('0xd')](function(_0x217a29){var _0x549461=_[_0x78b8('0x24')](_0x217a29[_0x78b8('0x25')][_0x78b8('0x25')],[_0x5651e0,_0x2a6c7f]);_0x1861be(_0x549461);})[_0x78b8('0x16')](function(_0x3a8d40){_0x280d12(_0x3a8d40);});});}function getEndUser(_0x1b1904,_0x7f9a20,_0x1157ba){return function(_0x45b4c7){return new Promise(function(_0x4855e5,_0x466260){logger[_0x78b8('0x13')](util[_0x78b8('0x26')](_0x78b8('0x27'),_0x45b4c7[_0x78b8('0x28')]));searchContact(_0x1157ba,_0x7f9a20,_0x78b8('0x29'),_0x45b4c7['contactNumber'])[_0x78b8('0xd')](function(_0x27001c){if(_0x27001c){_0x45b4c7[_0x78b8('0x2a')]=_0x27001c['id'];logger[_0x78b8('0x13')]('Contact\x20found\x20mobile_number:',_0x45b4c7['endUserId']);return _0x4855e5(_0x45b4c7);}searchContact(_0x1157ba,_0x7f9a20,'work_number',_0x45b4c7[_0x78b8('0x28')])[_0x78b8('0xd')](function(_0x16d9f1){if(_0x16d9f1){_0x45b4c7['endUserId']=_0x16d9f1['id'];logger[_0x78b8('0x13')]('Contact\x20found\x20work_number:',_0x45b4c7['endUserId']);return _0x4855e5(_0x45b4c7);}createEndUser(_0x45b4c7,_0x1b1904,_0x7f9a20,_0x1157ba)[_0x78b8('0xd')](function(_0x1810fe){logger[_0x78b8('0x13')](_0x78b8('0x2b'),_0x1810fe[_0x78b8('0x2a')]);return _0x4855e5(_0x1810fe);});});})[_0x78b8('0x16')](function(_0x25b7a9){_0x466260(_0x25b7a9);});});};}function createEndUser(_0x2d11c6,_0x216148,_0x20b4bc,_0x1c62ba){return new Promise(function(_0xec5d4,_0x2ea3c0){var _0x5b660a=moment();var _0x4e9f12={'method':_0x78b8('0x2c'),'uri':_0x1c62ba+_0x78b8('0x2d'),'body':{'contact':{'last_name':_0x2d11c6[_0x78b8('0x28')],'work_number':_0x2d11c6[_0x78b8('0x28')],'mobile_number':_0x2d11c6[_0x78b8('0x28')],'owner_id':_0x2d11c6['userId'],'created_at':_0x5b660a[_0x78b8('0x26')](_0x78b8('0x2e'))}},'json':!![]};_0x4e9f12[_0x78b8('0xc')]=_0x20b4bc;logger[_0x78b8('0x13')](_0x78b8('0x2f'));return rp(_0x4e9f12)[_0x78b8('0xd')](function(_0x12ce5a){_0x2d11c6[_0x78b8('0x2a')]=_0x12ce5a[_0x78b8('0x30')]['id'];_0xec5d4(_0x2d11c6);})['catch'](function(_0x382412){logger[_0x78b8('0x17')]('['+[_0x216148[_0x78b8('0x18')]()]+']',_0x382412[_0x78b8('0x19')]);_0x2ea3c0(_0x382412[_0x78b8('0x19')]);});});}function getTicket(_0x55cb25,_0x4ee00b,_0x38086a,_0x28fa6e,_0x3e9a28){return function(_0x58284b){logger[_0x78b8('0x13')](_0x78b8('0x31'));return new Promise(function(_0x4a63a5,_0x1fd4a2){var _0x438ff3=moment();var _0x471d6c={'method':_0x78b8('0x2c'),'uri':_0x38086a+_0x78b8('0x32'),'body':{'title':intUtil[_0x78b8('0x33')](_0x28fa6e[_0x78b8('0x34')],_0x3e9a28,'\x20'),'description':intUtil[_0x78b8('0x33')](_0x28fa6e[_0x78b8('0x35')],_0x3e9a28,'\x0a'),'owner_id':_0x58284b[_0x78b8('0x1e')],'creater_id':_0x58284b[_0x78b8('0x12')],'targetable_id':_0x58284b['endUserId'],'targetable_type':_0x78b8('0x36'),'created_at':_0x438ff3[_0x78b8('0x26')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x438ff3[_0x78b8('0x37')](0x1e,'m')[_0x78b8('0x26')](_0x78b8('0x2e'))},'json':!![]};_0x471d6c['headers']=_0x4ee00b;return rp(_0x471d6c)['then'](function(_0xa01cff){_0x58284b[_0x78b8('0x38')]=_0xa01cff[_0x78b8('0x39')]['id'];logger['info']('Task\x20created:',_0x58284b[_0x78b8('0x38')]);_0x4a63a5(_0x58284b);})['catch'](function(_0x485dd8){logger['error']('['+[_0x55cb25['toUpperCase']()]+']',_0x485dd8['message']);_0x1fd4a2(_0x485dd8[_0x78b8('0x19')]);});});};}function emit(_0xfe6c7f,_0x26a4db,_0x4ce9b8){var _0x3df5a4={'uri':_0xfe6c7f+'/contacts/'+_0x4ce9b8};io['to'](util[_0x78b8('0x26')]('user:%s',_0x26a4db))[_0x78b8('0x3a')](_0x78b8('0x3b'),_0x3df5a4);}exports['cs']=function(_0x265df7,_0x801304,_0xc27e84,_0x1e93f0,_0x157b9f,_0x395a1c,_0xc0e83d,_0x2b203c){var _0x20f437={};var _0x3d85e2={'Authorization':_0x78b8('0x3c')+_0x395a1c[_0x78b8('0x3d')]};_0x395a1c['remoteUri']=intUtil['stripTrailingSlash'](_0x395a1c[_0x78b8('0x3e')]);_0x395a1c[_0x78b8('0x3f')]=intUtil[_0x78b8('0x40')](_0x395a1c[_0x78b8('0x3f')]);var _0x353ee8=_0x395a1c['remoteUri'];_0x20f437[_0x78b8('0x11')]=_0x395a1c['username'];_0x20f437[_0x78b8('0x28')]=_0x2b203c['toLowerCase']()==='outbound'?_0x801304[_0x78b8('0x41')]:_0x801304[_0x78b8('0x42')];_0x20f437[_0x78b8('0x43')]=_0x2b203c==='queue'||_0x2b203c===_0x78b8('0x44')?'queue':_0x78b8('0x45');if(_0x1e93f0){_0x20f437[_0x78b8('0x1b')]=_0x1e93f0[_0x78b8('0x10')];}var _0x4ef162=util[_0x78b8('0x26')](_0x78b8('0x46'),_0x395a1c['serverUrl'],_0x801304['uniqueid'],md5(_0x801304[_0x78b8('0x47')]));if(_0x157b9f&&_0x157b9f[_0x78b8('0x48')]){logger['info']('[QUEUE]',_0x78b8('0x49'));_0x801304[_0x78b8('0x4a')]=_0x4ef162;}else if(_0xc0e83d&&_0xc0e83d[_0x78b8('0x4b')]&&_0xc0e83d[_0x78b8('0x4b')]!==_0x78b8('0x4c')){logger[_0x78b8('0x13')](_0x78b8('0x4d'),'Recording\x20is\x20enabled!');_0x801304['recordingURL']=_0x4ef162;}else{_0x801304[_0x78b8('0x4a')]='';}return getAdminId(_0x20f437,_0x2b203c,_0x3d85e2,_0x353ee8)['then'](getUser(_0x2b203c,_0x3d85e2,_0x353ee8))['then'](getEndUser(_0x2b203c,_0x3d85e2,_0x353ee8))['then'](getTicket(_0x2b203c,_0x3d85e2,_0x353ee8,_0xc27e84,_0x801304))[_0x78b8('0xd')](function(_0x511d9b){logger[_0x78b8('0x13')](util[_0x78b8('0x26')](_0x78b8('0x4e'),_0x511d9b[_0x78b8('0x38')]));if(_0x2b203c!=='unmanaged'){logger[_0x78b8('0x13')]('['+[_0x2b203c[_0x78b8('0x18')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x353ee8,_0x1e93f0['name'],_0x511d9b['endUserId']);}})['catch'](function(_0x15dd04){logger[_0x78b8('0x17')]('['+[_0x2b203c[_0x78b8('0x18')]()]+_0x78b8('0x4f'),util[_0x78b8('0x50')](_0x15dd04,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x35b0=['endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','ticketId','Task\x20created:','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','callDirection','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','length','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','users','Getting\x20user\x20with\x20email','agentEmail','email','User\x20found:','userId','Admin\x20selected','userEmail','adminEmail','GET','/api/lookup?q=','&f=','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','Contact\x20found\x20mobile_number:'];(function(_0x5712f8,_0x17156b){var _0x14a364=function(_0x1da9de){while(--_0x1da9de){_0x5712f8['push'](_0x5712f8['shift']());}};_0x14a364(++_0x17156b);}(_0x35b0,0x11e));var _0x035b=function(_0x575fd2,_0x48ba11){_0x575fd2=_0x575fd2-0x0;var _0x1bfd4f=_0x35b0[_0x575fd2];return _0x1bfd4f;};'use strict';var _=require(_0x035b('0x0'));var rp=require(_0x035b('0x1'));var md5=require('md5');var util=require(_0x035b('0x2'));var moment=require(_0x035b('0x3'));var Promise=require(_0x035b('0x4'));var Redis=require(_0x035b('0x5'));var intUtil=require(_0x035b('0x6'));var config=require(_0x035b('0x7'));var logger=require(_0x035b('0x8'))('freshsales');config[_0x035b('0x9')]=_['defaults'](config[_0x035b('0x9')],{'host':_0x035b('0xa'),'port':0x18eb});var io=require(_0x035b('0xb'))(new Redis(config['redis']));function getAdminId(_0x4c6de1,_0xdeaaf,_0x50a80c,_0x510301){return new Promise(function(_0x5b31f9,_0x45ea9f){var _0x160bec=![];var _0x375687={'method':'GET','uri':_0x510301+_0x035b('0xc'),'json':!![]};_0x375687[_0x035b('0xd')]=_0x50a80c;logger[_0x035b('0xe')](_0x035b('0xf'));return rp(_0x375687)[_0x035b('0x10')](function(_0x26004a){if(_0x26004a){var _0x2bf0c3=_0x26004a['users'];var _0x6aaece=null;for(_0x6aaece=0x0;_0x6aaece<_0x2bf0c3[_0x035b('0x11')];_0x6aaece++){if(_0x2bf0c3[_0x6aaece]['email']===_0x4c6de1['adminEmail']){_0x4c6de1[_0x035b('0x12')]=_0x2bf0c3[_0x6aaece]['id'];_0x160bec=!![];}}if(_0x160bec){logger[_0x035b('0xe')](_0x035b('0x13'),_0x4c6de1['adminId']);_0x5b31f9(_0x4c6de1);}else{_0x45ea9f({'statusCode':0x194,'message':_0x035b('0x14')});}}else{_0x45ea9f({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x035b('0x15')](function(_0x140ce5){logger[_0x035b('0x16')]('['+[_0xdeaaf[_0x035b('0x17')]()]+']',_0x140ce5[_0x035b('0x18')]);_0x45ea9f(_0x140ce5);});});}function getUser(_0x5d575b,_0x1e030b,_0x4f7cd6){return function(_0x4f5c34){return new Promise(function(_0x15c353,_0x3a21c6){var _0x3ac1f8={'method':'GET','uri':_0x4f7cd6+_0x035b('0xc'),'json':!![]};_0x3ac1f8[_0x035b('0xd')]=_0x1e030b;logger[_0x035b('0xe')]('Getting\x20user\x20list');return rp(_0x3ac1f8)[_0x035b('0x10')](function(_0x1590dc){if(_0x1590dc){var _0x3f96f2=_0x1590dc[_0x035b('0x19')];var _0x4744a9=![];var _0x56bb8b=null;if(_0x4f5c34['agentEmail']!==null){logger[_0x035b('0xe')](_0x035b('0x1a'),_0x4f5c34[_0x035b('0x1b')]);_0x4f5c34['userEmail']=_0x4f5c34[_0x035b('0x1b')];for(_0x56bb8b=0x0;_0x56bb8b<_0x3f96f2[_0x035b('0x11')];_0x56bb8b++){if(_0x3f96f2[_0x56bb8b][_0x035b('0x1c')]===_0x4f5c34[_0x035b('0x1b')]){_0x4744a9=!![];_0x4f5c34['userId']=_0x3f96f2[_0x56bb8b]['id'];logger['info'](_0x035b('0x1d'),_0x4f5c34[_0x035b('0x1e')]);}}}if(!_0x4744a9){logger['info'](_0x035b('0x1f'));_0x4f5c34[_0x035b('0x20')]=_0x4f5c34[_0x035b('0x21')];_0x4f5c34[_0x035b('0x1e')]=_0x4f5c34[_0x035b('0x12')];_0x4744a9=!![];}if(_0x4744a9){_0x15c353(_0x4f5c34);}else{_0x3a21c6({'statusCode':0x194,'message':_0x035b('0x14')});}}else{_0x3a21c6({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x035b('0x15')](function(_0x289eb3){logger[_0x035b('0x16')]('['+[_0x5d575b[_0x035b('0x17')]()]+']',_0x289eb3[_0x035b('0x18')]);_0x3a21c6(_0x289eb3);});});};}function searchContact(_0x17e58c,_0x21ab31,_0x23bbd8,_0x209ab1){return new Promise(function(_0x4218ca,_0x5f05e0){var _0x161666={'method':_0x035b('0x22'),'headers':_0x21ab31,'uri':_0x17e58c+_0x035b('0x23')+_0x209ab1+_0x035b('0x24')+_0x23bbd8+'&entities=contact','json':!![]};rp(_0x161666)[_0x035b('0x10')](function(_0x97662d){var _0x2beb93=_[_0x035b('0x25')](_0x97662d[_0x035b('0x26')]['contacts'],[_0x23bbd8,_0x209ab1]);_0x4218ca(_0x2beb93);})['catch'](function(_0x1e6d23){_0x5f05e0(_0x1e6d23);});});}function getEndUser(_0x13f3d2,_0x949f17,_0x57c4c0){return function(_0x51aa18){return new Promise(function(_0x44fef6,_0x1b775e){logger['info'](util['format'](_0x035b('0x27'),_0x51aa18[_0x035b('0x28')]));searchContact(_0x57c4c0,_0x949f17,'mobile_number',_0x51aa18[_0x035b('0x28')])[_0x035b('0x10')](function(_0x43bd6b){if(_0x43bd6b){_0x51aa18['endUserId']=_0x43bd6b['id'];logger[_0x035b('0xe')](_0x035b('0x29'),_0x51aa18[_0x035b('0x2a')]);return _0x44fef6(_0x51aa18);}searchContact(_0x57c4c0,_0x949f17,_0x035b('0x2b'),_0x51aa18[_0x035b('0x28')])['then'](function(_0x34fe9a){if(_0x34fe9a){_0x51aa18['endUserId']=_0x34fe9a['id'];logger[_0x035b('0xe')](_0x035b('0x2c'),_0x51aa18[_0x035b('0x2a')]);return _0x44fef6(_0x51aa18);}createEndUser(_0x51aa18,_0x13f3d2,_0x949f17,_0x57c4c0)['then'](function(_0x57a488){logger[_0x035b('0xe')](_0x035b('0x2d'),_0x57a488[_0x035b('0x2a')]);return _0x44fef6(_0x57a488);});});})[_0x035b('0x15')](function(_0x56a5e7){_0x1b775e(_0x56a5e7);});});};}function createEndUser(_0x866a67,_0x30dac7,_0x361d27,_0x27820a){return new Promise(function(_0x295902,_0x1d4afd){var _0xf2ddb1=moment();var _0x528e1c={'method':_0x035b('0x2e'),'uri':_0x27820a+_0x035b('0x2f'),'body':{'contact':{'last_name':_0x866a67['contactNumber'],'work_number':_0x866a67['contactNumber'],'mobile_number':_0x866a67[_0x035b('0x28')],'owner_id':_0x866a67[_0x035b('0x1e')],'created_at':_0xf2ddb1[_0x035b('0x30')](_0x035b('0x31'))}},'json':!![]};_0x528e1c[_0x035b('0xd')]=_0x361d27;logger['info']('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x528e1c)[_0x035b('0x10')](function(_0x59da5){_0x866a67[_0x035b('0x2a')]=_0x59da5[_0x035b('0x32')]['id'];_0x295902(_0x866a67);})[_0x035b('0x15')](function(_0xa4f3f6){logger[_0x035b('0x16')]('['+[_0x30dac7[_0x035b('0x17')]()]+']',_0xa4f3f6[_0x035b('0x18')]);_0x1d4afd(_0xa4f3f6['message']);});});}function getTicket(_0x4c3da4,_0x19a453,_0x4df599,_0x141a37,_0x38360e){return function(_0x16bcb6){logger['info'](_0x035b('0x33'));return new Promise(function(_0x24de4a,_0x425ae1){var _0x3bbf34=moment();var _0x454da9={'method':_0x035b('0x2e'),'uri':_0x4df599+_0x035b('0x34'),'body':{'title':intUtil['getString'](_0x141a37['Subjects'],_0x38360e,'\x20'),'description':intUtil[_0x035b('0x35')](_0x141a37[_0x035b('0x36')],_0x38360e,'\x0a'),'owner_id':_0x16bcb6['userId'],'creater_id':_0x16bcb6[_0x035b('0x12')],'targetable_id':_0x16bcb6[_0x035b('0x2a')],'targetable_type':_0x035b('0x37'),'created_at':_0x3bbf34[_0x035b('0x30')](_0x035b('0x31')),'due_date':_0x3bbf34['add'](0x1e,'m')[_0x035b('0x30')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x454da9[_0x035b('0xd')]=_0x19a453;return rp(_0x454da9)[_0x035b('0x10')](function(_0x4854bb){_0x16bcb6[_0x035b('0x38')]=_0x4854bb['task']['id'];logger[_0x035b('0xe')](_0x035b('0x39'),_0x16bcb6[_0x035b('0x38')]);_0x24de4a(_0x16bcb6);})[_0x035b('0x15')](function(_0x587e6f){logger[_0x035b('0x16')]('['+[_0x4c3da4['toUpperCase']()]+']',_0x587e6f[_0x035b('0x18')]);_0x425ae1(_0x587e6f['message']);});});};}function emit(_0xf0699,_0x228398,_0x1ef224){var _0x11a971={'uri':_0xf0699+'/contacts/'+_0x1ef224};io['to'](util[_0x035b('0x30')](_0x035b('0x3a'),_0x228398))['emit'](_0x035b('0x3b'),_0x11a971);}exports['cs']=function(_0x2ded6e,_0x5370de,_0x43df42,_0x4f2dcf,_0x5eaa13,_0x9fe380,_0x2a15d0,_0x1e836e){var _0x3454d7={};var _0x582094={'Authorization':_0x035b('0x3c')+_0x9fe380[_0x035b('0x3d')]};_0x9fe380[_0x035b('0x3e')]=intUtil[_0x035b('0x3f')](_0x9fe380[_0x035b('0x3e')]);_0x9fe380[_0x035b('0x40')]=intUtil[_0x035b('0x3f')](_0x9fe380[_0x035b('0x40')]);var _0x485972=_0x9fe380[_0x035b('0x3e')];_0x3454d7[_0x035b('0x21')]=_0x9fe380[_0x035b('0x41')];_0x3454d7['contactNumber']=_0x1e836e[_0x035b('0x42')]()==='outbound'?_0x5370de[_0x035b('0x43')]:_0x5370de[_0x035b('0x44')];_0x3454d7[_0x035b('0x45')]=_0x1e836e==='queue'||_0x1e836e===_0x035b('0x46')?'queue':'outbound';if(_0x4f2dcf){_0x3454d7[_0x035b('0x1b')]=_0x4f2dcf[_0x035b('0x1c')];}var _0x25d1bf=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x9fe380['serverUrl'],_0x5370de[_0x035b('0x47')],md5(_0x5370de['uniqueid']));if(_0x5eaa13&&_0x5eaa13[_0x035b('0x48')]){logger['info'](_0x035b('0x49'),_0x035b('0x4a'));_0x5370de[_0x035b('0x4b')]=_0x25d1bf;}else if(_0x2a15d0&&_0x2a15d0[_0x035b('0x4c')]&&_0x2a15d0[_0x035b('0x4c')]!=='none'){logger[_0x035b('0xe')]('[OUTBOUND]',_0x035b('0x4a'));_0x5370de[_0x035b('0x4b')]=_0x25d1bf;}else{_0x5370de[_0x035b('0x4b')]='';}return getAdminId(_0x3454d7,_0x1e836e,_0x582094,_0x485972)['then'](getUser(_0x1e836e,_0x582094,_0x485972))[_0x035b('0x10')](getEndUser(_0x1e836e,_0x582094,_0x485972))[_0x035b('0x10')](getTicket(_0x1e836e,_0x582094,_0x485972,_0x43df42,_0x5370de))[_0x035b('0x10')](function(_0xb168dd){logger[_0x035b('0xe')](util[_0x035b('0x30')](_0x035b('0x4d'),_0xb168dd[_0x035b('0x38')]));if(_0x1e836e!==_0x035b('0x46')){logger[_0x035b('0xe')]('['+[_0x1e836e[_0x035b('0x17')]()]+']',_0x035b('0x4e'));emit(_0x485972,_0x4f2dcf[_0x035b('0x4f')],_0xb168dd[_0x035b('0x2a')]);}})[_0x035b('0x15')](function(_0x1bd25b){logger['error']('['+[_0x1e836e[_0x035b('0x17')]()]+_0x035b('0x50'),util[_0x035b('0x51')](_0x1bd25b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js index 155b373..b357a16 100644 --- a/server/services/ami/trigger/integration/index.js +++ b/server/services/ami/trigger/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8cee=['[EXEC]','format','data3','error','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','freshsales','exec','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','unmanaged','servicenow','dynamics365','unknown\x20integration','../../../../config/logger'];(function(_0x5e61fe,_0x4ec70b){var _0x13ff2b=function(_0x300006){while(--_0x300006){_0x5e61fe['push'](_0x5e61fe['shift']());}};_0x13ff2b(++_0x4ec70b);}(_0x8cee,0x12d));var _0xe8ce=function(_0x2a56ce,_0x448f12){_0x2a56ce=_0x2a56ce-0x0;var _0x1f9977=_0x8cee[_0x2a56ce];return _0x1f9977;};'use strict';var _=require(_0xe8ce('0x0'));var util=require(_0xe8ce('0x1'));var zendesk=require(_0xe8ce('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0xe8ce('0x3'));var freshdesk=require(_0xe8ce('0x4'));var zoho=require(_0xe8ce('0x5'));var desk=require(_0xe8ce('0x6'));var vtiger=require(_0xe8ce('0x7'));var servicenow=require(_0xe8ce('0x8'));var dynamics365=require('./dynamics365');var freshsales=require('./freshsales');var integrations=[_0xe8ce('0x9'),_0xe8ce('0xa'),_0xe8ce('0xb'),_0xe8ce('0xc'),_0xe8ce('0xd'),_0xe8ce('0xe'),_0xe8ce('0xf'),'dynamics365',_0xe8ce('0x10'),'servicenow'];exports[_0xe8ce('0x11')]=function(_0x404f6f,_0x2272d1,_0x211381,_0x3691d4,_0x103e27,_0x48443e){if(_0x211381){if(_['includes'](integrations,_0x404f6f[_0xe8ce('0x12')][_0xe8ce('0x13')]())){try{var _0x2b3001=null;var _0x3f96fc='';var _0xb048e5=_0x211381[_0x404f6f[_0xe8ce('0x12')][_0xe8ce('0x13')]()];if(_0xb048e5){var _0x2f7935=_0xb048e5[_0x404f6f[_0xe8ce('0x14')]];if(_0x2f7935){var _0x21bd25=_[_0xe8ce('0x15')](_0x2f7935[_0xe8ce('0x16')],{'id':parseInt(_0x404f6f['data3'],0xa)});if(_0x21bd25){if(_0x3691d4){if(_0x103e27&&_0x2272d1[_0xe8ce('0x17')]){_0x3f96fc=_0xe8ce('0x17');}else if(_0x2272d1[_0xe8ce('0x18')]){_0x3f96fc=_0xe8ce('0x19');}else{console[_0xe8ce('0x1a')]('EVENT\x20UNKNOWN',_0x2272d1);}}else{_0x3f96fc=_0xe8ce('0x1b');}switch(_0x404f6f[_0xe8ce('0x12')]['toLowerCase']()){case'zendesk':zendesk[_0x3f96fc](_0x404f6f,_0x2272d1,_0x21bd25,_0x3691d4,_0x103e27,_0x2f7935,_0x48443e);break;case _0xe8ce('0xa'):salesforce[_0x3f96fc](_0x404f6f,_0x2272d1,_0x21bd25,_0x3691d4,_0x103e27,_0x2f7935,_0x48443e);break;case _0xe8ce('0xb'):sugarcrm[_0x3f96fc](_0x404f6f,_0x2272d1,_0x21bd25,_0x3691d4,_0x103e27,_0x2f7935,_0x48443e);break;case _0xe8ce('0xc'):freshdesk[_0x3f96fc](_0x404f6f,_0x2272d1,_0x21bd25,_0x3691d4,_0x103e27,_0x2f7935,_0x48443e);break;case _0xe8ce('0xd'):zoho[_0x3f96fc](_0x404f6f,_0x2272d1,_0x21bd25,_0x3691d4,_0x103e27,_0x2f7935,_0x48443e);break;case _0xe8ce('0xe'):desk[_0x3f96fc](_0x404f6f,_0x2272d1,_0x21bd25,_0x3691d4,_0x103e27,_0x2f7935,_0x48443e);break;case'vtiger':vtiger[_0x3f96fc](_0x404f6f,_0x2272d1,_0x21bd25,_0x3691d4,_0x103e27,_0x2f7935,_0x48443e);break;case'freshsales':freshsales['cs'](_0x404f6f,_0x2272d1,_0x21bd25,_0x3691d4,_0x103e27,_0x2f7935,_0x48443e,_0x3f96fc);break;case _0xe8ce('0x1c'):servicenow['cs'](_0x404f6f,_0x2272d1,_0x21bd25,_0x3691d4,_0x103e27,_0x2f7935,_0x48443e,_0x3f96fc);break;case _0xe8ce('0x1d'):dynamics365['cs'](_0x404f6f,_0x2272d1,_0x21bd25,_0x3691d4,_0x103e27,_0x2f7935,_0x48443e,_0x3f96fc);break;default:console[_0xe8ce('0x1a')](_0xe8ce('0x1e'));}}else{_0x2b3001=require(_0xe8ce('0x1f'))(_0x404f6f[_0xe8ce('0x12')][_0xe8ce('0x13')]());_0x2b3001['error'](_0xe8ce('0x20'),util[_0xe8ce('0x21')]('%s\x20configuration\x20#%s\x20not\x20found',_0x404f6f[_0xe8ce('0x12')][_0xe8ce('0x13')](),_0x404f6f[_0xe8ce('0x22')]));}}else{_0x2b3001=require('../../../../config/logger')(_0x404f6f[_0xe8ce('0x12')][_0xe8ce('0x13')]());_0x2b3001[_0xe8ce('0x23')](_0xe8ce('0x20'),util[_0xe8ce('0x21')](_0xe8ce('0x24'),_0x404f6f[_0xe8ce('0x12')][_0xe8ce('0x13')](),_0x404f6f[_0xe8ce('0x14')]));}}else{}}catch(_0x17bc26){console[_0xe8ce('0x23')](_0x17bc26);}}}}; \ No newline at end of file +var _0xd6fc=['%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','freshsales','servicenow','exec','data1','toLowerCase','data2','Configurations','data3','queue','outbound','log','unmanaged','vtiger','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found'];(function(_0x1e0846,_0x4aea1b){var _0x57e5d7=function(_0x2f9fb3){while(--_0x2f9fb3){_0x1e0846['push'](_0x1e0846['shift']());}};_0x57e5d7(++_0x4aea1b);}(_0xd6fc,0x95));var _0xcd6f=function(_0x12aa2c,_0x5513cf){_0x12aa2c=_0x12aa2c-0x0;var _0x4f7328=_0xd6fc[_0x12aa2c];return _0x4f7328;};'use strict';var _=require(_0xcd6f('0x0'));var util=require(_0xcd6f('0x1'));var zendesk=require(_0xcd6f('0x2'));var salesforce=require(_0xcd6f('0x3'));var sugarcrm=require(_0xcd6f('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0xcd6f('0x5'));var desk=require(_0xcd6f('0x6'));var vtiger=require('./vtiger');var servicenow=require(_0xcd6f('0x7'));var dynamics365=require(_0xcd6f('0x8'));var freshsales=require(_0xcd6f('0x9'));var integrations=[_0xcd6f('0xa'),_0xcd6f('0xb'),_0xcd6f('0xc'),_0xcd6f('0xd'),_0xcd6f('0xe'),_0xcd6f('0xf'),'vtiger','dynamics365',_0xcd6f('0x10'),_0xcd6f('0x11')];exports[_0xcd6f('0x12')]=function(_0x2e4ae9,_0x55cf77,_0x3153bd,_0x52916f,_0x44932e,_0x41da8b){if(_0x3153bd){if(_['includes'](integrations,_0x2e4ae9[_0xcd6f('0x13')][_0xcd6f('0x14')]())){try{var _0x249271=null;var _0x47c485='';var _0x4122d2=_0x3153bd[_0x2e4ae9['data1'][_0xcd6f('0x14')]()];if(_0x4122d2){var _0x261873=_0x4122d2[_0x2e4ae9[_0xcd6f('0x15')]];if(_0x261873){var _0x3ab77e=_['find'](_0x261873[_0xcd6f('0x16')],{'id':parseInt(_0x2e4ae9[_0xcd6f('0x17')],0xa)});if(_0x3ab77e){if(_0x52916f){if(_0x44932e&&_0x55cf77[_0xcd6f('0x18')]){_0x47c485=_0xcd6f('0x18');}else if(_0x55cf77['routeId']){_0x47c485=_0xcd6f('0x19');}else{console[_0xcd6f('0x1a')]('EVENT\x20UNKNOWN',_0x55cf77);}}else{_0x47c485=_0xcd6f('0x1b');}switch(_0x2e4ae9[_0xcd6f('0x13')]['toLowerCase']()){case'zendesk':zendesk[_0x47c485](_0x2e4ae9,_0x55cf77,_0x3ab77e,_0x52916f,_0x44932e,_0x261873,_0x41da8b);break;case _0xcd6f('0xb'):salesforce[_0x47c485](_0x2e4ae9,_0x55cf77,_0x3ab77e,_0x52916f,_0x44932e,_0x261873,_0x41da8b);break;case _0xcd6f('0xc'):sugarcrm[_0x47c485](_0x2e4ae9,_0x55cf77,_0x3ab77e,_0x52916f,_0x44932e,_0x261873,_0x41da8b);break;case _0xcd6f('0xd'):freshdesk[_0x47c485](_0x2e4ae9,_0x55cf77,_0x3ab77e,_0x52916f,_0x44932e,_0x261873,_0x41da8b);break;case'zoho':zoho[_0x47c485](_0x2e4ae9,_0x55cf77,_0x3ab77e,_0x52916f,_0x44932e,_0x261873,_0x41da8b);break;case _0xcd6f('0xf'):desk[_0x47c485](_0x2e4ae9,_0x55cf77,_0x3ab77e,_0x52916f,_0x44932e,_0x261873,_0x41da8b);break;case _0xcd6f('0x1c'):vtiger[_0x47c485](_0x2e4ae9,_0x55cf77,_0x3ab77e,_0x52916f,_0x44932e,_0x261873,_0x41da8b);break;case _0xcd6f('0x10'):freshsales['cs'](_0x2e4ae9,_0x55cf77,_0x3ab77e,_0x52916f,_0x44932e,_0x261873,_0x41da8b,_0x47c485);break;case _0xcd6f('0x11'):servicenow['cs'](_0x2e4ae9,_0x55cf77,_0x3ab77e,_0x52916f,_0x44932e,_0x261873,_0x41da8b,_0x47c485);break;case _0xcd6f('0x1d'):dynamics365['cs'](_0x2e4ae9,_0x55cf77,_0x3ab77e,_0x52916f,_0x44932e,_0x261873,_0x41da8b,_0x47c485);break;default:console[_0xcd6f('0x1a')](_0xcd6f('0x1e'));}}else{_0x249271=require(_0xcd6f('0x1f'))(_0x2e4ae9[_0xcd6f('0x13')][_0xcd6f('0x14')]());_0x249271[_0xcd6f('0x20')](_0xcd6f('0x21'),util[_0xcd6f('0x22')](_0xcd6f('0x23'),_0x2e4ae9['data1']['toLowerCase'](),_0x2e4ae9[_0xcd6f('0x17')]));}}else{_0x249271=require(_0xcd6f('0x1f'))(_0x2e4ae9[_0xcd6f('0x13')][_0xcd6f('0x14')]());_0x249271['error'](_0xcd6f('0x21'),util[_0xcd6f('0x22')](_0xcd6f('0x24'),_0x2e4ae9[_0xcd6f('0x13')][_0xcd6f('0x14')](),_0x2e4ae9['data2']));}}else{}}catch(_0x1e1534){console['error'](_0x1e1534);}}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/salesforce.js b/server/services/ami/trigger/integration/salesforce.js index c087d1c..3f727ca 100644 --- a/server/services/ami/trigger/integration/salesforce.js +++ b/server/services/ami/trigger/integration/salesforce.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x279d=['account','WhatId','Case','AccountId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','then','length','Email','Name','identity','user_id','display_name','resolve','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','additionalSearchAccount','Account','Lead','contact','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:browser:url','%s/%s/e','error','[QUEUE]','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','trigger:salesforce:display','instanceUrl','[OUTBOUND]','catch','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','assign','getString','ticketType','Task','ActivityDate','utc','IsRecurrence','endUserType','lead','WhoId'];(function(_0x5a3a81,_0x5e862f){var _0x59f7fa=function(_0x445a70){while(--_0x445a70){_0x5a3a81['push'](_0x5a3a81['shift']());}};_0x59f7fa(++_0x5e862f);}(_0x279d,0x162));var _0xd279=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x279d[_0x3740fe];return _0x55492b;};'use strict';var _=require(_0xd279('0x0'));var rp=require(_0xd279('0x1'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0xd279('0x2'));var jsforce=require(_0xd279('0x3'));var util=require(_0xd279('0x4'));var Redis=require(_0xd279('0x5'));var intUtil=require(_0xd279('0x6'));var config=require(_0xd279('0x7'));var logger=require(_0xd279('0x8'))('salesforce');config['redis']=_[_0xd279('0x9')](config[_0xd279('0xa')],{'host':_0xd279('0xb'),'port':0x18eb});var io=require(_0xd279('0xc'))(new Redis(config[_0xd279('0xa')]));function emit(_0x255c56,_0x595511,_0x10c3b9){io['to'](_0x255c56)[_0xd279('0xd')](_0x595511,_0x10c3b9);}function getTicket(_0x30def7,_0xcf86f7,_0x309c7a,_0x4f3072,_0x32a491,_0x2bb4a7,_0x32c474,_0x628612){var _0x5c75ef=Object[_0xd279('0xe')]({},{'OwnerId':_0xcf86f7['id'],'Subject':intUtil[_0xd279('0xf')](_0x4f3072['Subjects'],_0x32a491,'\x20'),'Description':intUtil[_0xd279('0xf')](_0x4f3072['Descriptions'],_0x32a491,'\x0a')},getCustomFields(_0x2bb4a7,_0x32a491));if(_0x309c7a){if(_0x4f3072[_0xd279('0x10')]===_0xd279('0x11')){_0x5c75ef[_0xd279('0x12')]=moment[_0xd279('0x13')]();_0x5c75ef['IsReminderSet']=![];_0x5c75ef[_0xd279('0x14')]=![];if(_0x309c7a[_0xd279('0x15')]==='contact'||_0x309c7a[_0xd279('0x15')]===_0xd279('0x16')){_0x5c75ef[_0xd279('0x17')]=_0x309c7a['id'];}else if(_0x309c7a[_0xd279('0x15')]===_0xd279('0x18')){_0x5c75ef[_0xd279('0x19')]=_0x309c7a['id'];}}else if(_0x4f3072['ticketType']===_0xd279('0x1a')){if(_0x309c7a[_0xd279('0x15')]==='contact'){_0x5c75ef['ContactId']=_0x309c7a['id'];}else if(_0x309c7a[_0xd279('0x15')]===_0xd279('0x18')){_0x5c75ef[_0xd279('0x1b')]=_0x309c7a['id'];}else if(_0x309c7a['endUserType']===_0xd279('0x16')&&_0x4f3072['leadId']){_0x5c75ef[_0x4f3072['leadId']]=_0x309c7a['id'];}else{logger[_0xd279('0x1c')](_0xd279('0x1d'));}}}return _0x32c474[_0xd279('0x1e')](_0x4f3072[_0xd279('0x10')])[_0xd279('0x1f')](_0x5c75ef);}function getUser(_0x5e6d82,_0x110217,_0xff8477){if(!_[_0xd279('0x20')](_0x110217)&&intUtil[_0xd279('0x21')](_0x110217)){var _0x2769d6={'Email':_0x110217};var _0x121022={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xff8477[_0xd279('0x1e')](_0xd279('0x22'))[_0xd279('0x23')](_0x2769d6,_0x121022)[_0xd279('0x24')]()[_0xd279('0x25')](function(_0x5eb148){if(_0x5eb148[_0xd279('0x26')]){var _0x1383e1=_[_0xd279('0x23')](_0x5eb148,function(_0x36a267){return _0x36a267[_0xd279('0x27')]===_0x110217;});if(_0x1383e1){logger[_0xd279('0x1c')]('Agent\x20%s\x20found.',_0x110217);return BPromise['resolve']({'id':_0x1383e1['Id'],'name':_0x1383e1[_0xd279('0x28')]});}}else{logger[_0xd279('0x1c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x110217);return _0xff8477[_0xd279('0x29')]()[_0xd279('0x25')](function(_0x3093f0){return BPromise['resolve']({'id':_0x3093f0[_0xd279('0x2a')],'name':_0x3093f0[_0xd279('0x2b')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x110217);return _0xff8477[_0xd279('0x29')]()['then'](function(_0x49aade){return BPromise['resolve']({'id':_0x49aade[_0xd279('0x2a')],'name':_0x49aade[_0xd279('0x2b')]});});}}function getEndUser(_0x259e6e,_0x306139,_0x1148f1,_0x18fc64,_0x61295c){var _0x432bb0={'$or':{'Phone':_0x18fc64}};var _0x114e9f={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xd279('0x2c')]()[_0xd279('0x25')](function(){logger[_0xd279('0x1c')](_0xd279('0x2d'),_0x18fc64,_0x306139[_0xd279('0x2e')]);switch(_0x306139[_0xd279('0x2e')]){case _0xd279('0x2f'):var _0xeeb8e5=_[_0xd279('0x30')](_0x432bb0);if(_0x306139[_0xd279('0x31')]){var _0x27c702={};_0x27c702[_0x306139[_0xd279('0x31')]]=_0x18fc64;_[_0xd279('0x32')](_0xeeb8e5[_0xd279('0x33')],_0x27c702);}return _0x61295c[_0xd279('0x1e')](_0xd279('0x34'))[_0xd279('0x23')](_0xeeb8e5,_0x114e9f)['execute']()['then'](function(_0xbb8627){if(_0xbb8627&&_0xbb8627[_0xd279('0x26')]){return _0xbb8627;}else{var _0x17e04d=_[_0xd279('0x30')](_0x432bb0);if(_0x306139['additionalSearchLead']){var _0xdd6beb={};_0xdd6beb[_0x306139[_0xd279('0x35')]]=_0x18fc64;_[_0xd279('0x32')](_0x17e04d['$or'],_0xdd6beb);}return _0x61295c[_0xd279('0x1e')]('Lead')[_0xd279('0x23')](_0x17e04d,_0x114e9f);}});case'account_contact_lead':var _0x31a07e=_['cloneDeep'](_0x432bb0);if(_0x306139[_0xd279('0x36')]){var _0x27c702={};_0x27c702[_0x306139['additionalSearchAccount']]=_0x18fc64;_[_0xd279('0x32')](_0x31a07e[_0xd279('0x33')],_0x27c702);}return _0x61295c[_0xd279('0x1e')](_0xd279('0x37'))[_0xd279('0x23')](_0x31a07e,_0x114e9f)[_0xd279('0x24')]()[_0xd279('0x25')](function(_0x1e5b82){if(_0x1e5b82&&_0x1e5b82['length']){return _0x1e5b82;}else{var _0x19d1eb=_[_0xd279('0x30')](_0x432bb0);if(_0x306139[_0xd279('0x31')]){var _0x14d69e={};_0x14d69e[_0x306139[_0xd279('0x31')]]=_0x18fc64;_[_0xd279('0x32')](_0x19d1eb[_0xd279('0x33')],_0x14d69e);}return _0x61295c[_0xd279('0x1e')](_0xd279('0x34'))['find'](_0x19d1eb,_0x114e9f)[_0xd279('0x25')](function(_0x400939){if(_0x400939&&_0x400939[_0xd279('0x26')]){return _0x400939;}else{var _0x40ac69=_[_0xd279('0x30')](_0x432bb0);if(_0x306139[_0xd279('0x35')]){var _0x108ea7={};_0x108ea7[_0x306139[_0xd279('0x35')]]=_0x18fc64;_[_0xd279('0x32')](_0x40ac69[_0xd279('0x33')],_0x108ea7);}return _0x61295c[_0xd279('0x1e')](_0xd279('0x38'))[_0xd279('0x23')](_0x40ac69,_0x114e9f);}});}});case _0xd279('0x39'):var _0xeeb8e5=_[_0xd279('0x30')](_0x432bb0);if(_0x306139[_0xd279('0x31')]){var _0x27c702={};_0x27c702[_0x306139[_0xd279('0x31')]]=_0x18fc64;_[_0xd279('0x32')](_0xeeb8e5[_0xd279('0x33')],_0x27c702);}return _0x61295c['sobject']('Contact')[_0xd279('0x23')](_0xeeb8e5,_0x114e9f)['execute']();case _0xd279('0x16'):var _0x4e8c4c=_[_0xd279('0x30')](_0x432bb0);if(_0x306139[_0xd279('0x35')]){var _0x27c702={};_0x27c702[_0x306139[_0xd279('0x35')]]=_0x18fc64;_[_0xd279('0x32')](_0x4e8c4c[_0xd279('0x33')],_0x27c702);}return _0x61295c[_0xd279('0x1e')]('Lead')[_0xd279('0x23')](_0x4e8c4c,_0x114e9f);case _0xd279('0x18'):var _0x31a07e=_['cloneDeep'](_0x432bb0);if(_0x306139['additionalSearchAccount']){var _0x27c702={};_0x27c702[_0x306139[_0xd279('0x36')]]=_0x18fc64;_[_0xd279('0x32')](_0x31a07e[_0xd279('0x33')],_0x27c702);}return _0x61295c[_0xd279('0x1e')](_0xd279('0x37'))['find'](_0x31a07e,_0x114e9f);default:return null;}})['then'](function(_0xc9742c){if(_0xc9742c&&_0xc9742c[_0xd279('0x26')]){var _0x56dd7e=_[_0xd279('0x3a')](_0xc9742c);if(_0x56dd7e){return BPromise[_0xd279('0x2c')]({'id':_0x56dd7e['Id'],'name':_0x56dd7e[_0xd279('0x28')],'phone':_0x56dd7e[_0xd279('0x3b')],'endUserType':_0x56dd7e[_0xd279('0x3c')][_0xd279('0x3d')][_0xd279('0x3e')]()});}}})[_0xd279('0x25')](function(_0x4d0d8b){if(_0x4d0d8b){logger[_0xd279('0x1c')](_0xd279('0x3f'),_0x4d0d8b[_0xd279('0x15')],_0x18fc64);return BPromise[_0xd279('0x2c')](_0x4d0d8b);}else{logger['info'](_0xd279('0x40'),_0x18fc64);var _0x329a16={'Phone':_0x18fc64};if(_0x306139[_0xd279('0x41')]){if(_0x306139[_0xd279('0x41')]===_0xd279('0x39')){logger[_0xd279('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x18fc64,_0x306139[_0xd279('0x41')]);_0x329a16[_0xd279('0x42')]=_0x1148f1!==_0xd279('0x43')?_0x1148f1:util[_0xd279('0x44')](_0xd279('0x45'),_0x18fc64);}else if(_0x306139[_0xd279('0x41')]===_0xd279('0x16')){logger[_0xd279('0x1c')](_0xd279('0x46'),_0x18fc64,_0x306139[_0xd279('0x41')]);_0x329a16['LastName']=_0x1148f1!==_0xd279('0x43')?_0x1148f1:util[_0xd279('0x44')](_0xd279('0x45'),_0x18fc64);_0x329a16[_0xd279('0x47')]=_0xd279('0x48');}else if(_0x306139[_0xd279('0x41')]===_0xd279('0x18')){logger[_0xd279('0x1c')](_0xd279('0x46'),_0x18fc64,_0x306139[_0xd279('0x41')]);_0x329a16[_0xd279('0x28')]=_0x1148f1!==_0xd279('0x43')?_0x1148f1:util[_0xd279('0x44')](_0xd279('0x45'),_0x18fc64);}else{return null;}}return _0x61295c[_0xd279('0x1e')](_[_0xd279('0x49')](_0x306139[_0xd279('0x41')]))['create'](_0x329a16)[_0xd279('0x25')](function(_0x4121ac){return BPromise[_0xd279('0x2c')]({'id':_0x4121ac['id'],'endUserType':_0x306139['moduleCreate']});});}});}function getCustomFields(_0x5696a1,_0x51e798){var _0x25d906={};if(_0x5696a1['length']>0x0){_[_0xd279('0x4a')](_0x5696a1,function(_0x343e06){if(_[_0xd279('0x4b')]([_0xd279('0x4c'),_0xd279('0x4d')],_0x343e06['type'])&&_0x343e06[_0xd279('0x4e')]){_0x25d906[_0x343e06[_0xd279('0x4e')]]=_0x343e06[_0xd279('0x4f')][_0xd279('0x50')]();}else if(_0x343e06['type']===_0xd279('0x51')&&_0x343e06['variableName']&&_0x343e06['idField']){_0x51e798[_0x343e06[_0xd279('0x52')]]&&(_0x25d906[_0x343e06[_0xd279('0x4e')]]=_0x51e798[_0x343e06['variableName']][_0xd279('0x50')]());}else if(_0x343e06[_0xd279('0x3d')]===_0xd279('0x53')&&_0x343e06[_0xd279('0x54')]&&_0x343e06[_0xd279('0x54')][_0xd279('0x55')]&&_0x343e06['idField']){_0x51e798[_0x343e06['Variable']['name'][_0xd279('0x3e')]()]&&(_0x25d906[_0x343e06['idField']]=_0x51e798[_0x343e06[_0xd279('0x54')]['name']['toLowerCase']()]['toString']());}});}return _0x25d906;}function getConnection(_0x59679c){var _0x5100c3=_0x59679c[_0xd279('0x56')][_0xd279('0x57')](_0x59679c[_0xd279('0x58')]);var _0x21aaa4=new jsforce[(_0xd279('0x59'))]({'oauth2':{'loginUrl':_0x59679c[_0xd279('0x5a')]||_0xd279('0x5b'),'clientId':_0x59679c['clientId'],'clientSecret':_0x59679c['clientSecret']}});return _0x21aaa4[_0xd279('0x5c')](_0x59679c[_0xd279('0x5d')],_0x5100c3)['then'](function(){logger['info'](_0xd279('0x5e'));return _0x21aaa4;});}exports['queue']=function(_0x19f486,_0xb4deaa,_0x4da2c4,_0x195ed9,_0x32a09b,_0x184b97){var _0x1b3a8b,_0x1f85f7,_0xb7e27e,_0x22caf4;_0x184b97[_0xd279('0x5f')]=intUtil[_0xd279('0x60')](_0x184b97[_0xd279('0x5f')]);_0x184b97['remoteUri']=intUtil[_0xd279('0x60')](_0x184b97[_0xd279('0x5a')]);if(_0x32a09b&&_0x32a09b['monitor_format']){logger[_0xd279('0x1c')]('[QUEUE]',_0xd279('0x61'));_0xb4deaa[_0xd279('0x62')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x184b97[_0xd279('0x5f')],_0xb4deaa[_0xd279('0x63')],md5(_0xb4deaa[_0xd279('0x63')]));}else{_0xb4deaa[_0xd279('0x62')]='';}return getConnection(_0x184b97)[_0xd279('0x25')](function(_0x544bb5){_0x22caf4=_0x544bb5;return getUser(_0x184b97,_0x195ed9[_0xd279('0x64')],_0x22caf4);})[_0xd279('0x25')](function(_0x2e3441){_0x1b3a8b=_0x2e3441;return getEndUser(_0x184b97,_0x4da2c4,_0xb4deaa[_0xd279('0x65')],_0xb4deaa[_0xd279('0x66')],_0x22caf4);})[_0xd279('0x25')](function(_0x5e127d){_0x1f85f7=_0x5e127d;return getTicket(_0x184b97,_0x1b3a8b,_0x1f85f7,_0x4da2c4,_0xb4deaa,_0x4da2c4[_0xd279('0x67')],_0x22caf4,_0xd279('0x68'));})[_0xd279('0x25')](function(_0x4ba3cd){_0xb7e27e=_0x4ba3cd;logger[_0xd279('0x1c')]('[QUEUE]\x20Ticket\x20%s\x20created',_0xb7e27e['id']);logger['info'](_0xd279('0x69'),_0xb7e27e['id'],_0x195ed9[_0xd279('0x55')],_0x184b97[_0xd279('0x3d')]);switch(_0x184b97[_0xd279('0x3d')]){case _0xd279('0x6a'):emit(util[_0xd279('0x44')](_0xd279('0x6b'),_0x195ed9['name']),'trigger:salesforce:display',{'recordId':_0xb7e27e['id']});break;case'newTab':emit(util[_0xd279('0x44')](_0xd279('0x6b'),_0x195ed9[_0xd279('0x55')]),_0xd279('0x6c'),{'uri':util['format'](_0xd279('0x6d'),_0x22caf4['instanceUrl'],_0xb7e27e['id'])});break;default:logger[_0xd279('0x6e')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x5695f8){logger['error'](_0xd279('0x6f'),_0x5695f8);});};exports[_0xd279('0x70')]=function(_0x39fb82,_0x43cbcf,_0x1b6ab3,_0x4a9f04,_0x23fdc7,_0x1296f1,_0x373e23){var _0x4ee704,_0xc324fc,_0x22cc84,_0x1b574d;_0x1296f1[_0xd279('0x5f')]=intUtil['stripTrailingSlash'](_0x1296f1[_0xd279('0x5f')]);_0x1296f1[_0xd279('0x5a')]=intUtil[_0xd279('0x60')](_0x1296f1[_0xd279('0x5a')]);if(_0x373e23&&_0x373e23[_0xd279('0x71')]&&_0x373e23[_0xd279('0x71')]!==_0xd279('0x72')){logger[_0xd279('0x1c')]('[OUTBOUND]',_0xd279('0x61'));_0x43cbcf[_0xd279('0x62')]=util[_0xd279('0x44')](_0xd279('0x73'),_0x1296f1['serverUrl'],_0x43cbcf[_0xd279('0x63')],md5(_0x43cbcf[_0xd279('0x63')]));}return getConnection(_0x1296f1)[_0xd279('0x25')](function(_0x223f04){_0x1b574d=_0x223f04;return getUser(_0x1296f1,_0x4a9f04[_0xd279('0x64')],_0x1b574d);})[_0xd279('0x25')](function(_0x25cfb5){_0x4ee704=_0x25cfb5;return getEndUser(_0x1296f1,_0x1b6ab3,_0x43cbcf[_0xd279('0x74')],_0x43cbcf[_0xd279('0x75')],_0x1b574d);})[_0xd279('0x25')](function(_0x4d7812){_0xc324fc=_0x4d7812;return getTicket(_0x1296f1,_0x4ee704,_0xc324fc,_0x1b6ab3,_0x43cbcf,_0x1b6ab3[_0xd279('0x67')],_0x1b574d,_0xd279('0x70'));})['then'](function(_0x427fc0){_0x22cc84=_0x427fc0;logger[_0xd279('0x1c')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x22cc84['id']);logger[_0xd279('0x1c')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x22cc84['id'],_0x4a9f04['name'],_0x1296f1[_0xd279('0x3d')]);switch(_0x1296f1[_0xd279('0x3d')]){case _0xd279('0x6a'):emit(util[_0xd279('0x44')](_0xd279('0x6b'),_0x4a9f04[_0xd279('0x55')]),_0xd279('0x76'),{'recordId':_0x22cc84['id']});break;case'newTab':emit(util['format'](_0xd279('0x6b'),_0x4a9f04[_0xd279('0x55')]),_0xd279('0x6c'),{'uri':util['format'](_0xd279('0x6d'),_0x1b574d[_0xd279('0x77')],_0x22cc84['id'])});break;default:logger[_0xd279('0x6e')](_0xd279('0x78'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xd279('0x79')](function(_0x4ea3a6){logger[_0xd279('0x6e')](_0xd279('0x78'),_0x4ea3a6);});};exports['unmanaged']=function(_0x3340a8,_0x5d0314,_0x269628,_0x23d47d,_0x164ae9,_0x3c3c68){var _0x50c983,_0xafb910,_0x56592a,_0x5d4b07;_0x3c3c68[_0xd279('0x5f')]=intUtil[_0xd279('0x60')](_0x3c3c68[_0xd279('0x5f')]);_0x3c3c68[_0xd279('0x5a')]=intUtil[_0xd279('0x60')](_0x3c3c68['remoteUri']);if(_0x164ae9&&_0x164ae9['monitor_format']){logger[_0xd279('0x1c')]('['+_0x5d0314[_0xd279('0x7a')][_0xd279('0x7b')]()+']','Recording\x20is\x20enabled!');_0x5d0314[_0xd279('0x62')]=util[_0xd279('0x44')](_0xd279('0x73'),_0x3c3c68[_0xd279('0x5f')],_0x5d0314[_0xd279('0x63')],md5(_0x5d0314['uniqueid']));}else{_0x5d0314['recordingURL']='';}return getConnection(_0x3c3c68)[_0xd279('0x25')](function(_0x149c98){_0x5d4b07=_0x149c98;if(!_[_0xd279('0x20')](_0x23d47d)){return getUser(_0x3c3c68,_0x23d47d[_0xd279('0x55')],_0x5d4b07);}else{return getUser(_0x3c3c68,null,_0x5d4b07);}})['then'](function(_0x4e4722){_0x50c983=_0x4e4722;return getEndUser(_0x3c3c68,_0x269628,_0x5d0314['calleridname'],_0x5d0314[_0xd279('0x66')],_0x5d4b07);})[_0xd279('0x25')](function(_0x275594){_0xafb910=_0x275594;return getTicket(_0x3c3c68,_0x50c983,_0xafb910,_0x269628,_0x5d0314,_0x269628[_0xd279('0x67')],_0x5d4b07);})['then'](function(_0x5030f3){_0x56592a=_0x5030f3;logger['info']('['+_0x5d0314[_0xd279('0x7a')][_0xd279('0x7b')]()+_0xd279('0x7c'),_0x56592a['id']);logger[_0xd279('0x1c')]('['+_0x5d0314[_0xd279('0x7a')][_0xd279('0x7b')]()+_0xd279('0x7d'),_0x3c3c68['type']);})[_0xd279('0x79')](function(_0xa0cb3a){logger['error']('['+_0x5d0314[_0xd279('0x7a')][_0xd279('0x7b')]()+']',_0xa0cb3a);});}; \ No newline at end of file +var _0xd0da=['Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','queue','stripTrailingSlash','monitor_format','[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','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl','error','catch','outbound','serverUrl','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase',']\x20Ticket\x20%s\x20created.','lastevent','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','socket.io-emitter','Subjects','getString','Descriptions','ticketType','Task','utc','IsReminderSet','endUserType','contact','WhoId','account','WhatId','ContactId','lead','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','sobject','User','execute','then','Email','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','info','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','merge','Contact','cloneDeep','additionalSearchLead','Lead','find','account_contact_lead','$or','Account','length','additionalSearchContact','additionalSearchAccount','first','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found'];(function(_0x2fc130,_0x1e4dc0){var _0xd5a6d1=function(_0x1375f8){while(--_0x1375f8){_0x2fc130['push'](_0x2fc130['shift']());}};_0xd5a6d1(++_0x1e4dc0);}(_0xd0da,0x133));var _0xad0d=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0xd0da[_0x1d87fc];return _0x492b56;};'use strict';var _=require('lodash');var rp=require(_0xad0d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0xad0d('0x1'));var jsforce=require('jsforce');var util=require(_0xad0d('0x2'));var Redis=require(_0xad0d('0x3'));var intUtil=require(_0xad0d('0x4'));var config=require(_0xad0d('0x5'));var logger=require(_0xad0d('0x6'))(_0xad0d('0x7'));config['redis']=_[_0xad0d('0x8')](config[_0xad0d('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xad0d('0xa'))(new Redis(config[_0xad0d('0x9')]));function emit(_0x41b319,_0x3fb522,_0x3f26b4){io['to'](_0x41b319)['emit'](_0x3fb522,_0x3f26b4);}function getTicket(_0x36a333,_0x3d830d,_0x5ec5,_0x1a2b9c,_0x337201,_0x40bb3d,_0x2c3f8c,_0x4df074){var _0x42b62a=Object['assign']({},{'OwnerId':_0x3d830d['id'],'Subject':intUtil['getString'](_0x1a2b9c[_0xad0d('0xb')],_0x337201,'\x20'),'Description':intUtil[_0xad0d('0xc')](_0x1a2b9c[_0xad0d('0xd')],_0x337201,'\x0a')},getCustomFields(_0x40bb3d,_0x337201));if(_0x5ec5){if(_0x1a2b9c[_0xad0d('0xe')]===_0xad0d('0xf')){_0x42b62a['ActivityDate']=moment[_0xad0d('0x10')]();_0x42b62a[_0xad0d('0x11')]=![];_0x42b62a['IsRecurrence']=![];if(_0x5ec5[_0xad0d('0x12')]===_0xad0d('0x13')||_0x5ec5[_0xad0d('0x12')]==='lead'){_0x42b62a[_0xad0d('0x14')]=_0x5ec5['id'];}else if(_0x5ec5['endUserType']===_0xad0d('0x15')){_0x42b62a[_0xad0d('0x16')]=_0x5ec5['id'];}}else if(_0x1a2b9c[_0xad0d('0xe')]==='Case'){if(_0x5ec5[_0xad0d('0x12')]===_0xad0d('0x13')){_0x42b62a[_0xad0d('0x17')]=_0x5ec5['id'];}else if(_0x5ec5[_0xad0d('0x12')]===_0xad0d('0x15')){_0x42b62a['AccountId']=_0x5ec5['id'];}else if(_0x5ec5['endUserType']===_0xad0d('0x18')&&_0x1a2b9c[_0xad0d('0x19')]){_0x42b62a[_0x1a2b9c[_0xad0d('0x19')]]=_0x5ec5['id'];}else{logger['info'](_0xad0d('0x1a'));}}}return _0x2c3f8c['sobject'](_0x1a2b9c[_0xad0d('0xe')])[_0xad0d('0x1b')](_0x42b62a);}function getUser(_0x4404f3,_0x11c44d,_0x1f65d5){if(!_[_0xad0d('0x1c')](_0x11c44d)&&intUtil['validateEmail'](_0x11c44d)){var _0x43fe77={'Email':_0x11c44d};var _0x3f2ee4={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1f65d5[_0xad0d('0x1d')](_0xad0d('0x1e'))['find'](_0x43fe77,_0x3f2ee4)[_0xad0d('0x1f')]()[_0xad0d('0x20')](function(_0x22e27f){if(_0x22e27f['length']){var _0x4b7e96=_['find'](_0x22e27f,function(_0x2aa4fd){return _0x2aa4fd[_0xad0d('0x21')]===_0x11c44d;});if(_0x4b7e96){logger['info']('Agent\x20%s\x20found.',_0x11c44d);return BPromise[_0xad0d('0x22')]({'id':_0x4b7e96['Id'],'name':_0x4b7e96[_0xad0d('0x23')]});}}else{logger['info'](_0xad0d('0x24'),_0x11c44d);return _0x1f65d5['identity']()[_0xad0d('0x20')](function(_0x27663c){return BPromise['resolve']({'id':_0x27663c[_0xad0d('0x25')],'name':_0x27663c['display_name']});});}});}else{logger[_0xad0d('0x26')](_0xad0d('0x24'),_0x11c44d);return _0x1f65d5['identity']()[_0xad0d('0x20')](function(_0x517dd0){return BPromise['resolve']({'id':_0x517dd0[_0xad0d('0x25')],'name':_0x517dd0['display_name']});});}}function getEndUser(_0x30f07f,_0x16b74c,_0x2cdf60,_0x144c70,_0x4440c1){var _0x5271c8={'$or':{'Phone':_0x144c70}};var _0x1dc527={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xad0d('0x22')]()[_0xad0d('0x20')](function(){logger[_0xad0d('0x26')](_0xad0d('0x27'),_0x144c70,_0x16b74c[_0xad0d('0x28')]);switch(_0x16b74c['moduleSearch']){case _0xad0d('0x29'):var _0xf04904=_['cloneDeep'](_0x5271c8);if(_0x16b74c['additionalSearchContact']){var _0x256dee={};_0x256dee[_0x16b74c['additionalSearchContact']]=_0x144c70;_[_0xad0d('0x2a')](_0xf04904['$or'],_0x256dee);}return _0x4440c1['sobject'](_0xad0d('0x2b'))['find'](_0xf04904,_0x1dc527)[_0xad0d('0x1f')]()[_0xad0d('0x20')](function(_0x283fb5){if(_0x283fb5&&_0x283fb5['length']){return _0x283fb5;}else{var _0x595c9=_[_0xad0d('0x2c')](_0x5271c8);if(_0x16b74c[_0xad0d('0x2d')]){var _0xd1abd2={};_0xd1abd2[_0x16b74c[_0xad0d('0x2d')]]=_0x144c70;_['merge'](_0x595c9['$or'],_0xd1abd2);}return _0x4440c1[_0xad0d('0x1d')](_0xad0d('0x2e'))[_0xad0d('0x2f')](_0x595c9,_0x1dc527);}});case _0xad0d('0x30'):var _0x5cf46d=_[_0xad0d('0x2c')](_0x5271c8);if(_0x16b74c['additionalSearchAccount']){var _0x256dee={};_0x256dee[_0x16b74c['additionalSearchAccount']]=_0x144c70;_['merge'](_0x5cf46d[_0xad0d('0x31')],_0x256dee);}return _0x4440c1[_0xad0d('0x1d')](_0xad0d('0x32'))[_0xad0d('0x2f')](_0x5cf46d,_0x1dc527)[_0xad0d('0x1f')]()['then'](function(_0x448b3b){if(_0x448b3b&&_0x448b3b[_0xad0d('0x33')]){return _0x448b3b;}else{var _0x3c8791=_['cloneDeep'](_0x5271c8);if(_0x16b74c[_0xad0d('0x34')]){var _0x30e799={};_0x30e799[_0x16b74c[_0xad0d('0x34')]]=_0x144c70;_['merge'](_0x3c8791[_0xad0d('0x31')],_0x30e799);}return _0x4440c1[_0xad0d('0x1d')](_0xad0d('0x2b'))[_0xad0d('0x2f')](_0x3c8791,_0x1dc527)['then'](function(_0x1cfca2){if(_0x1cfca2&&_0x1cfca2['length']){return _0x1cfca2;}else{var _0xc1dc88=_[_0xad0d('0x2c')](_0x5271c8);if(_0x16b74c[_0xad0d('0x2d')]){var _0x2732dc={};_0x2732dc[_0x16b74c[_0xad0d('0x2d')]]=_0x144c70;_[_0xad0d('0x2a')](_0xc1dc88[_0xad0d('0x31')],_0x2732dc);}return _0x4440c1[_0xad0d('0x1d')](_0xad0d('0x2e'))[_0xad0d('0x2f')](_0xc1dc88,_0x1dc527);}});}});case _0xad0d('0x13'):var _0xf04904=_['cloneDeep'](_0x5271c8);if(_0x16b74c[_0xad0d('0x34')]){var _0x256dee={};_0x256dee[_0x16b74c[_0xad0d('0x34')]]=_0x144c70;_[_0xad0d('0x2a')](_0xf04904[_0xad0d('0x31')],_0x256dee);}return _0x4440c1[_0xad0d('0x1d')](_0xad0d('0x2b'))[_0xad0d('0x2f')](_0xf04904,_0x1dc527)['execute']();case _0xad0d('0x18'):var _0x1436f3=_[_0xad0d('0x2c')](_0x5271c8);if(_0x16b74c[_0xad0d('0x2d')]){var _0x256dee={};_0x256dee[_0x16b74c[_0xad0d('0x2d')]]=_0x144c70;_[_0xad0d('0x2a')](_0x1436f3[_0xad0d('0x31')],_0x256dee);}return _0x4440c1['sobject'](_0xad0d('0x2e'))[_0xad0d('0x2f')](_0x1436f3,_0x1dc527);case _0xad0d('0x15'):var _0x5cf46d=_[_0xad0d('0x2c')](_0x5271c8);if(_0x16b74c[_0xad0d('0x35')]){var _0x256dee={};_0x256dee[_0x16b74c['additionalSearchAccount']]=_0x144c70;_[_0xad0d('0x2a')](_0x5cf46d['$or'],_0x256dee);}return _0x4440c1['sobject'](_0xad0d('0x32'))['find'](_0x5cf46d,_0x1dc527);default:return null;}})[_0xad0d('0x20')](function(_0x44bb11){if(_0x44bb11&&_0x44bb11['length']){var _0x169771=_[_0xad0d('0x36')](_0x44bb11);if(_0x169771){return BPromise[_0xad0d('0x22')]({'id':_0x169771['Id'],'name':_0x169771[_0xad0d('0x23')],'phone':_0x169771['Phone'],'endUserType':_0x169771[_0xad0d('0x37')][_0xad0d('0x38')][_0xad0d('0x39')]()});}}})[_0xad0d('0x20')](function(_0x57e457){if(_0x57e457){logger[_0xad0d('0x26')](_0xad0d('0x3a'),_0x57e457[_0xad0d('0x12')],_0x144c70);return BPromise[_0xad0d('0x22')](_0x57e457);}else{logger[_0xad0d('0x26')](_0xad0d('0x3b'),_0x144c70);var _0x2d3424={'Phone':_0x144c70};if(_0x16b74c[_0xad0d('0x3c')]){if(_0x16b74c[_0xad0d('0x3c')]===_0xad0d('0x13')){logger[_0xad0d('0x26')](_0xad0d('0x3d'),_0x144c70,_0x16b74c[_0xad0d('0x3c')]);_0x2d3424[_0xad0d('0x3e')]=_0x2cdf60!==_0xad0d('0x3f')?_0x2cdf60:util[_0xad0d('0x40')](_0xad0d('0x41'),_0x144c70);}else if(_0x16b74c[_0xad0d('0x3c')]==='lead'){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x144c70,_0x16b74c['moduleCreate']);_0x2d3424[_0xad0d('0x3e')]=_0x2cdf60!==_0xad0d('0x3f')?_0x2cdf60:util['format'](_0xad0d('0x41'),_0x144c70);_0x2d3424[_0xad0d('0x42')]='No\x20Company';}else if(_0x16b74c[_0xad0d('0x3c')]===_0xad0d('0x15')){logger[_0xad0d('0x26')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x144c70,_0x16b74c['moduleCreate']);_0x2d3424[_0xad0d('0x23')]=_0x2cdf60!==_0xad0d('0x3f')?_0x2cdf60:util[_0xad0d('0x40')]('Caller\x20-\x20%s',_0x144c70);}else{return null;}}return _0x4440c1[_0xad0d('0x1d')](_['upperFirst'](_0x16b74c['moduleCreate']))[_0xad0d('0x1b')](_0x2d3424)[_0xad0d('0x20')](function(_0x39fbe8){return BPromise[_0xad0d('0x22')]({'id':_0x39fbe8['id'],'endUserType':_0x16b74c['moduleCreate']});});}});}function getCustomFields(_0x569011,_0x2c0cfc){var _0x19d7cb={};if(_0x569011[_0xad0d('0x33')]>0x0){_[_0xad0d('0x43')](_0x569011,function(_0x48e07e){if(_[_0xad0d('0x44')]([_0xad0d('0x45'),_0xad0d('0x46')],_0x48e07e[_0xad0d('0x38')])&&_0x48e07e[_0xad0d('0x47')]){_0x19d7cb[_0x48e07e[_0xad0d('0x47')]]=_0x48e07e[_0xad0d('0x48')][_0xad0d('0x49')]();}else if(_0x48e07e['type']===_0xad0d('0x4a')&&_0x48e07e[_0xad0d('0x4b')]&&_0x48e07e[_0xad0d('0x47')]){_0x2c0cfc[_0x48e07e[_0xad0d('0x4b')]]&&(_0x19d7cb[_0x48e07e[_0xad0d('0x47')]]=_0x2c0cfc[_0x48e07e['variableName']][_0xad0d('0x49')]());}else if(_0x48e07e['type']===_0xad0d('0x4c')&&_0x48e07e['Variable']&&_0x48e07e[_0xad0d('0x4d')]['name']&&_0x48e07e[_0xad0d('0x47')]){_0x2c0cfc[_0x48e07e['Variable'][_0xad0d('0x4e')]['toLowerCase']()]&&(_0x19d7cb[_0x48e07e[_0xad0d('0x47')]]=_0x2c0cfc[_0x48e07e[_0xad0d('0x4d')][_0xad0d('0x4e')][_0xad0d('0x39')]()][_0xad0d('0x49')]());}});}return _0x19d7cb;}function getConnection(_0x2da2b2){var _0x2f86ce=_0x2da2b2['password'][_0xad0d('0x4f')](_0x2da2b2[_0xad0d('0x50')]);var _0x5524f0=new jsforce[(_0xad0d('0x51'))]({'oauth2':{'loginUrl':_0x2da2b2[_0xad0d('0x52')]||_0xad0d('0x53'),'clientId':_0x2da2b2[_0xad0d('0x54')],'clientSecret':_0x2da2b2[_0xad0d('0x55')]}});return _0x5524f0['login'](_0x2da2b2[_0xad0d('0x56')],_0x2f86ce)['then'](function(){logger[_0xad0d('0x26')](_0xad0d('0x57'));return _0x5524f0;});}exports[_0xad0d('0x58')]=function(_0x5f2311,_0xbbcba3,_0x12c18f,_0x31acfd,_0x5172a5,_0x2facb0){var _0x56ecf8,_0x204725,_0x46d350,_0x3abc76;_0x2facb0['serverUrl']=intUtil[_0xad0d('0x59')](_0x2facb0['serverUrl']);_0x2facb0[_0xad0d('0x52')]=intUtil[_0xad0d('0x59')](_0x2facb0['remoteUri']);if(_0x5172a5&&_0x5172a5[_0xad0d('0x5a')]){logger[_0xad0d('0x26')](_0xad0d('0x5b'),_0xad0d('0x5c'));_0xbbcba3[_0xad0d('0x5d')]=util['format'](_0xad0d('0x5e'),_0x2facb0['serverUrl'],_0xbbcba3[_0xad0d('0x5f')],md5(_0xbbcba3['uniqueid']));}else{_0xbbcba3[_0xad0d('0x5d')]='';}return getConnection(_0x2facb0)['then'](function(_0x977da6){_0x3abc76=_0x977da6;return getUser(_0x2facb0,_0x31acfd[_0xad0d('0x60')],_0x3abc76);})[_0xad0d('0x20')](function(_0x11d7b0){_0x56ecf8=_0x11d7b0;return getEndUser(_0x2facb0,_0x12c18f,_0xbbcba3[_0xad0d('0x61')],_0xbbcba3[_0xad0d('0x62')],_0x3abc76);})[_0xad0d('0x20')](function(_0x11fe5a){_0x204725=_0x11fe5a;return getTicket(_0x2facb0,_0x56ecf8,_0x204725,_0x12c18f,_0xbbcba3,_0x12c18f[_0xad0d('0x63')],_0x3abc76,_0xad0d('0x58'));})[_0xad0d('0x20')](function(_0x291005){_0x46d350=_0x291005;logger['info'](_0xad0d('0x64'),_0x46d350['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x46d350['id'],_0x31acfd[_0xad0d('0x4e')],_0x2facb0[_0xad0d('0x38')]);switch(_0x2facb0['type']){case _0xad0d('0x65'):emit(util[_0xad0d('0x40')](_0xad0d('0x66'),_0x31acfd['name']),_0xad0d('0x67'),{'recordId':_0x46d350['id']});break;case _0xad0d('0x68'):emit(util['format'](_0xad0d('0x66'),_0x31acfd['name']),_0xad0d('0x69'),{'uri':util[_0xad0d('0x40')]('%s/%s/e',_0x3abc76[_0xad0d('0x6a')],_0x46d350['id'])});break;default:logger[_0xad0d('0x6b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xad0d('0x6c')](function(_0x8a83a8){logger[_0xad0d('0x6b')]('[QUEUE]',_0x8a83a8);});};exports[_0xad0d('0x6d')]=function(_0x22c2ad,_0x1427d1,_0x387b1d,_0x2c7df4,_0x171b7a,_0x2b32e3,_0x1558bf){var _0x384b9e,_0x3219f0,_0x45307e,_0x946044;_0x2b32e3[_0xad0d('0x6e')]=intUtil[_0xad0d('0x59')](_0x2b32e3[_0xad0d('0x6e')]);_0x2b32e3[_0xad0d('0x52')]=intUtil[_0xad0d('0x59')](_0x2b32e3['remoteUri']);if(_0x1558bf&&_0x1558bf[_0xad0d('0x6f')]&&_0x1558bf[_0xad0d('0x6f')]!==_0xad0d('0x70')){logger['info'](_0xad0d('0x71'),_0xad0d('0x5c'));_0x1427d1[_0xad0d('0x5d')]=util[_0xad0d('0x40')](_0xad0d('0x5e'),_0x2b32e3[_0xad0d('0x6e')],_0x1427d1[_0xad0d('0x5f')],md5(_0x1427d1['uniqueid']));}return getConnection(_0x2b32e3)[_0xad0d('0x20')](function(_0x56814c){_0x946044=_0x56814c;return getUser(_0x2b32e3,_0x2c7df4['email'],_0x946044);})[_0xad0d('0x20')](function(_0x4405f8){_0x384b9e=_0x4405f8;return getEndUser(_0x2b32e3,_0x387b1d,_0x1427d1[_0xad0d('0x72')],_0x1427d1[_0xad0d('0x73')],_0x946044);})[_0xad0d('0x20')](function(_0x513fe2){_0x3219f0=_0x513fe2;return getTicket(_0x2b32e3,_0x384b9e,_0x3219f0,_0x387b1d,_0x1427d1,_0x387b1d[_0xad0d('0x63')],_0x946044,_0xad0d('0x6d'));})['then'](function(_0x1d03cf){_0x45307e=_0x1d03cf;logger[_0xad0d('0x26')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x45307e['id']);logger[_0xad0d('0x26')](_0xad0d('0x74'),_0x45307e['id'],_0x2c7df4[_0xad0d('0x4e')],_0x2b32e3[_0xad0d('0x38')]);switch(_0x2b32e3['type']){case _0xad0d('0x65'):emit(util[_0xad0d('0x40')](_0xad0d('0x66'),_0x2c7df4[_0xad0d('0x4e')]),_0xad0d('0x67'),{'recordId':_0x45307e['id']});break;case _0xad0d('0x68'):emit(util[_0xad0d('0x40')](_0xad0d('0x66'),_0x2c7df4[_0xad0d('0x4e')]),'trigger:browser:url',{'uri':util[_0xad0d('0x40')]('%s/%s/e',_0x946044['instanceUrl'],_0x45307e['id'])});break;default:logger[_0xad0d('0x6b')](_0xad0d('0x71'),_0xad0d('0x75'));}})[_0xad0d('0x6c')](function(_0x2de089){logger[_0xad0d('0x6b')](_0xad0d('0x71'),_0x2de089);});};exports[_0xad0d('0x76')]=function(_0x1b8f95,_0x31ed8a,_0x215aa0,_0x4a8ae2,_0x25fd33,_0x4eb193){var _0x572d76,_0x5bc8a9,_0x5c14ef,_0x284ddd;_0x4eb193[_0xad0d('0x6e')]=intUtil[_0xad0d('0x59')](_0x4eb193[_0xad0d('0x6e')]);_0x4eb193[_0xad0d('0x52')]=intUtil[_0xad0d('0x59')](_0x4eb193[_0xad0d('0x52')]);if(_0x25fd33&&_0x25fd33['monitor_format']){logger[_0xad0d('0x26')]('['+_0x31ed8a['lastevent'][_0xad0d('0x77')]()+']',_0xad0d('0x5c'));_0x31ed8a[_0xad0d('0x5d')]=util[_0xad0d('0x40')](_0xad0d('0x5e'),_0x4eb193['serverUrl'],_0x31ed8a[_0xad0d('0x5f')],md5(_0x31ed8a[_0xad0d('0x5f')]));}else{_0x31ed8a[_0xad0d('0x5d')]='';}return getConnection(_0x4eb193)[_0xad0d('0x20')](function(_0xba0eb4){_0x284ddd=_0xba0eb4;if(!_[_0xad0d('0x1c')](_0x4a8ae2)){return getUser(_0x4eb193,_0x4a8ae2[_0xad0d('0x4e')],_0x284ddd);}else{return getUser(_0x4eb193,null,_0x284ddd);}})[_0xad0d('0x20')](function(_0x2dc5c6){_0x572d76=_0x2dc5c6;return getEndUser(_0x4eb193,_0x215aa0,_0x31ed8a['calleridname'],_0x31ed8a[_0xad0d('0x62')],_0x284ddd);})[_0xad0d('0x20')](function(_0xb9ac19){_0x5bc8a9=_0xb9ac19;return getTicket(_0x4eb193,_0x572d76,_0x5bc8a9,_0x215aa0,_0x31ed8a,_0x215aa0[_0xad0d('0x63')],_0x284ddd);})['then'](function(_0xf44ddb){_0x5c14ef=_0xf44ddb;logger['info']('['+_0x31ed8a['lastevent']['toUpperCase']()+_0xad0d('0x78'),_0x5c14ef['id']);logger[_0xad0d('0x26')]('['+_0x31ed8a['lastevent'][_0xad0d('0x77')]()+']\x20Integration\x20account\x20type\x20%s.',_0x4eb193['type']);})[_0xad0d('0x6c')](function(_0x5031ac){logger['error']('['+_0x31ed8a[_0xad0d('0x79')][_0xad0d('0x77')]()+']',_0x5031ac);});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/servicenow.js b/server/services/ami/trigger/integration/servicenow.js index d688a6b..3b50af3 100644 --- a/server/services/ami/trigger/integration/servicenow.js +++ b/server/services/ami/trigger/integration/servicenow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09c8=['user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','incident','Incident','all','push','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','./util','../../../../config/environment','../../../../config/logger','servicenow','localhost','redis','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','then','],\x20getUser\x20entity','active','true','sys_id','userId','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber'];(function(_0x32d797,_0x53c890){var _0x3eb3b6=function(_0x35e0a5){while(--_0x35e0a5){_0x32d797['push'](_0x32d797['shift']());}};_0x3eb3b6(++_0x53c890);}(_0x09c8,0x191));var _0x809c=function(_0x21bad0,_0x4798f9){_0x21bad0=_0x21bad0-0x0;var _0x2f2990=_0x09c8[_0x21bad0];return _0x2f2990;};'use strict';var _=require(_0x809c('0x0'));var Promise=require(_0x809c('0x1'));var rp=require(_0x809c('0x2'));var util=require(_0x809c('0x3'));var md5=require(_0x809c('0x4'));var Redis=require('ioredis');var intUtil=require(_0x809c('0x5'));var config=require(_0x809c('0x6'));var logger=require(_0x809c('0x7'))(_0x809c('0x8'));config['redis']=_['defaults'](config['redis'],{'host':_0x809c('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x809c('0xa')]));function getAdminUser(_0x1cea28,_0x2e9149,_0x3112e1,_0x5dfcb6,_0x3f6bf7,_0x209138){return new Promise(function(_0x306708,_0x15c49d){var _0x3e7c73={'method':_0x809c('0xb'),'uri':_0x5dfcb6+_0x809c('0xc')+'&'+_0x3f6bf7+'&'+_0x209138,'auth':_0x2e9149,'json':!![]};return rp(_0x3e7c73)['then'](function(_0x56b9a5){if(_0x56b9a5[_0x809c('0xd')][_0x809c('0xe')]>0x0){_0x3112e1[_0x809c('0xf')]=_0x56b9a5[_0x809c('0xd')][0x0]['sys_id'];}logger['info']('['+[_0x1cea28['toUpperCase']()]+_0x809c('0x10'),_0x3112e1);_0x306708(_0x3112e1);})[_0x809c('0x11')](function(_0x368723){logger[_0x809c('0x12')]('['+[_0x1cea28[_0x809c('0x13')]()]+']',_0x368723[_0x809c('0x14')]);_0x15c49d(_0x368723[_0x809c('0x14')]);});});}function getUser(_0x537be7,_0x4d96ea,_0x2e97a5,_0x19cdc3,_0x56a6d6){return function(_0x2a7d35){logger[_0x809c('0x15')]('['+[_0x537be7[_0x809c('0x13')]()]+_0x809c('0x16'),_0x2a7d35);return new Promise(function(_0x58a5b2,_0x20da2a){if(intUtil[_0x809c('0x17')](_0x2a7d35[_0x809c('0x18')])){var _0x1b9398={'method':_0x809c('0xb'),'uri':_0x2e97a5+_0x809c('0x19')+_0x2a7d35['userEmail']+'&'+_0x19cdc3+'&'+_0x56a6d6,'auth':_0x4d96ea,'json':!![]};logger[_0x809c('0x15')]('['+[_0x537be7[_0x809c('0x13')]()]+'],\x20getUser\x20rp\x20obj',_0x1b9398);return rp(_0x1b9398)[_0x809c('0x1a')](function(_0x4bea43){logger['info']('['+[_0x537be7[_0x809c('0x13')]()]+_0x809c('0x1b'),_0x4bea43);if(_0x4bea43['result'][_0x809c('0xe')]>0x0&&String(_0x4bea43[_0x809c('0xd')][0x0][_0x809c('0x1c')])===_0x809c('0x1d')){_0x2a7d35['userId']=_0x4bea43[_0x809c('0xd')][0x0][_0x809c('0x1e')];}else{_0x2a7d35[_0x809c('0x1f')]=_0x2a7d35[_0x809c('0xf')];_0x2a7d35[_0x809c('0x18')]=_0x2a7d35['adminEmail'];}logger[_0x809c('0x15')]('['+[_0x537be7['toUpperCase']()]+_0x809c('0x20'),_0x2a7d35);_0x58a5b2(_0x2a7d35);})['catch'](function(_0x1b40f9){logger[_0x809c('0x12')]('['+[_0x537be7['toUpperCase']()]+']',_0x1b40f9['message']);_0x20da2a(_0x1b40f9[_0x809c('0x14')]);});}else{logger[_0x809c('0x15')]('['+[_0x537be7[_0x809c('0x13')]()]+_0x809c('0x21'));_0x2a7d35[_0x809c('0x1f')]=_0x2a7d35[_0x809c('0xf')];_0x2a7d35[_0x809c('0x18')]=_0x2a7d35[_0x809c('0x22')];_0x58a5b2(_0x2a7d35);}});};}function createEndUser(_0x2effb7,_0x436ea4,_0x5d9936,_0x3d99d9,_0xb34853){logger[_0x809c('0x15')]('['+[_0x2effb7['toUpperCase']()]+_0x809c('0x23'),_0x5d9936);return new Promise(function(_0x378be6,_0x5bc49b){var _0x1b2b5f={'method':_0x809c('0x24'),'uri':_0x3d99d9+_0x809c('0x25')+_0xb34853,'body':{'user_name':_0x5d9936[_0x809c('0x26')],'roles':_0x809c('0x27'),'first_name':_0x5d9936['endUserNumber'],'active':_0x809c('0x1d'),'date_format':_0x809c('0x28'),'phone':_0x5d9936['endUserNumber']},'auth':_0x436ea4,'json':!![]};return rp(_0x1b2b5f)[_0x809c('0x1a')](function(_0xc6edcd){logger[_0x809c('0x15')]('['+[_0x2effb7['toUpperCase']()]+_0x809c('0x29'),_0xc6edcd[_0x809c('0xd')]);_0x5d9936['endUserId']=_0xc6edcd['result'][_0x809c('0x1e')];_0x378be6(_0x5d9936);})[_0x809c('0x11')](function(_0x3a0662){logger[_0x809c('0x12')]('['+[_0x2effb7[_0x809c('0x13')]()]+']',_0x3a0662[_0x809c('0x14')]);_0x5bc49b(_0x3a0662[_0x809c('0x14')]);});});}function getEndUser(_0x34d3b3,_0x1514d7,_0x9cb6c3,_0x12292c,_0x2f0afe){return function(_0x35fa28){logger[_0x809c('0x15')]('['+[_0x34d3b3['toUpperCase']()]+_0x809c('0x2a'),_0x35fa28);return new Promise(function(_0x21cca6,_0xb60b8c){var _0x503971={'method':_0x809c('0xb'),'uri':_0x9cb6c3+_0x809c('0x2b')+_0x35fa28['endUserNumber']+'&'+_0x12292c+'&'+_0x2f0afe,'auth':_0x1514d7,'json':!![]};return rp(_0x503971)[_0x809c('0x1a')](function(_0x5c1ecd){if(_0x5c1ecd[_0x809c('0xd')][_0x809c('0xe')]>0x0){_0x35fa28[_0x809c('0x2c')]=_0x5c1ecd[_0x809c('0xd')][0x0][_0x809c('0x1e')];logger[_0x809c('0x15')]('['+[_0x34d3b3['toUpperCase']()]+_0x809c('0x2d'),_0x35fa28);_0x21cca6(_0x35fa28);}else{return createEndUser(_0x34d3b3,_0x1514d7,_0x35fa28,_0x9cb6c3,_0x12292c)[_0x809c('0x1a')](function(_0x19c635){logger[_0x809c('0x15')]('['+[_0x34d3b3['toUpperCase']()]+_0x809c('0x2e'),_0x19c635);_0x21cca6(_0x19c635);});}})[_0x809c('0x11')](function(_0x4dd774){logger[_0x809c('0x12')]('['+[_0x34d3b3[_0x809c('0x13')]()]+']',_0x4dd774[_0x809c('0x14')]);_0xb60b8c(_0x4dd774['message']);});});};}function getCustomFields(_0x6e8264,_0x3634f7){var _0x304dd1={};if(_0x6e8264[_0x809c('0xe')]>0x0){_[_0x809c('0x2f')](_0x6e8264,function(_0x30695e){if(_[_0x809c('0x30')]([_0x809c('0x31'),_0x809c('0x32')],_0x30695e[_0x809c('0x33')])&&_0x30695e[_0x809c('0x34')]&&!_0x30695e[_0x809c('0x35')]){_0x304dd1[_0x30695e['nameField'][_0x809c('0x36')]()]=_0x30695e[_0x809c('0x37')][_0x809c('0x38')]();}else if(_['includes'](['string',_0x809c('0x32')],_0x30695e[_0x809c('0x33')])&&_0x30695e[_0x809c('0x39')]&&_0x30695e['customField']){_0x304dd1[_0x30695e[_0x809c('0x39')][_0x809c('0x36')]()]=_0x30695e[_0x809c('0x37')][_0x809c('0x38')]();}else if(_0x30695e[_0x809c('0x33')]===_0x809c('0x3a')&&_0x30695e[_0x809c('0x3b')]&&_0x30695e[_0x809c('0x39')]&&_0x30695e['customField']){_0x304dd1[_0x30695e[_0x809c('0x39')][_0x809c('0x36')]()]=_0x3634f7[_0x30695e[_0x809c('0x3b')]]['toString']();}else if(_0x30695e[_0x809c('0x33')]===_0x809c('0x3c')&&_0x30695e['Variable']&&_0x30695e[_0x809c('0x3d')]['name']&&_0x30695e[_0x809c('0x39')]&&_0x30695e[_0x809c('0x35')]){_0x304dd1[_0x30695e[_0x809c('0x39')][_0x809c('0x36')]()]=_0x3634f7[_0x30695e['Variable'][_0x809c('0x3e')][_0x809c('0x36')]()]['toString']();}});}return _0x304dd1;}function getTicket(_0xc3d7c4,_0x4a1a3f,_0x109521,_0x2fb98b,_0xfa101d,_0x2d1307){return function(_0x1dad7e){logger[_0x809c('0x15')]('['+[_0xc3d7c4[_0x809c('0x13')]()]+_0x809c('0x3f'),_0x1dad7e);return new Promise(function(_0x635906,_0xc6f441){var _0x54d1b6=_0xc3d7c4[_0x809c('0x36')]()===_0x809c('0x40')?_0x1dad7e[_0x809c('0x1f')]:_0x1dad7e[_0x809c('0x2c')];var _0x547e9f={'method':'POST','uri':_0x109521+'incident'+'?'+_0x2d1307,'body':Object[_0x809c('0x41')]({},{'active':_0x809c('0x1d'),'caller_id':_0x54d1b6,'assigned_to':_0x1dad7e[_0x809c('0x1f')],'short_description':intUtil[_0x809c('0x42')](_0x2fb98b[_0x809c('0x43')],_0xfa101d,'\x20'),'description':intUtil['getString'](_0x2fb98b['Descriptions'],_0xfa101d,'\x0a')},getCustomFields(_0x2fb98b[_0x809c('0x44')],_0xfa101d)),'auth':_0x4a1a3f,'json':!![]};return rp(_0x547e9f)[_0x809c('0x1a')](function(_0xb75340){logger[_0x809c('0x15')]('['+[_0xc3d7c4['toUpperCase']()]+_0x809c('0x45'),_0xb75340[_0x809c('0xd')]);_0x1dad7e[_0x809c('0x46')]=_0xb75340[_0x809c('0xd')][_0x809c('0x1e')];_0x1dad7e[_0x809c('0x47')]=_0xb75340['result'][_0x809c('0x48')];logger[_0x809c('0x15')]('['+[_0xc3d7c4[_0x809c('0x13')]()]+_0x809c('0x49'),_0x1dad7e);_0x635906(_0x1dad7e);})[_0x809c('0x11')](function(_0x9d813d){logger[_0x809c('0x12')]('['+[_0xc3d7c4[_0x809c('0x13')]()]+']',_0x9d813d['message']);_0xc6f441(_0x9d813d[_0x809c('0x14')]);});});};}function createRemoteTag(_0x2bb638,_0x41c5a0,_0x48bbb2,_0x22e03d){return new Promise(function(_0x4e8aac,_0x333666){var _0x309125={'method':'POST','uri':_0x48bbb2+_0x809c('0x4a')+'?'+_0x22e03d,'body':{'short_description':_0x2bb638,'global':!![],'active':!![],'name':_0x2bb638},'auth':_0x41c5a0,'json':!![]};return rp(_0x309125)[_0x809c('0x1a')](function(_0x3eabb4){var _0x58555c=_0x3eabb4[_0x809c('0xd')][_0x809c('0x1e')];_0x4e8aac(_0x58555c);});});}function getRemoteTag(_0x1e9dbb,_0x57aa29,_0x4d54b7,_0x14f8ca,_0x4f1c43){return new Promise(function(_0x72724d,_0x2c7ae6){var _0x24e9f2={'method':_0x809c('0xb'),'uri':_0x4d54b7+_0x809c('0x4a')+'?sysparm_query=name%3D'+_0x1e9dbb+'&'+_0x14f8ca,'auth':_0x57aa29,'json':!![]};return rp(_0x24e9f2)[_0x809c('0x1a')](function(_0xfec905){if(_0xfec905[_0x809c('0xd')]['length']>0x0){var _0x48b893=_0xfec905[_0x809c('0xd')][0x0][_0x809c('0x1e')];_0x72724d(_0x48b893);}else{return createRemoteTag(_0x1e9dbb,_0x57aa29,_0x4d54b7,_0x14f8ca)[_0x809c('0x1a')](function(_0x4ff14e){_0x72724d(_0x4ff14e);});}});});}function assignTagToIncident(_0xcf832c,_0x33c52e,_0x41f75e,_0x39fc9e,_0x3581b3){return new Promise(function(_0x3e3248,_0x2472fa){var _0x77bc6a={'method':'POST','uri':_0x41f75e+'label_entry'+'?'+_0x3581b3,'body':{'label':_0xcf832c,'table':_0x809c('0x4b'),'id_type':_0x809c('0x4c'),'table_key':_0x39fc9e[_0x809c('0x46')],'title':'Incident\x20-\x20'+_0x39fc9e[_0x809c('0x47')],'id_display':_0x39fc9e[_0x809c('0x47')]},'auth':_0x33c52e,'json':!![]};return rp(_0x77bc6a)[_0x809c('0x1a')](function(_0x116bed){_0x3e3248();})['catch'](function(){_0x3e3248();});});}function manageTags(_0x4477c8,_0x462e5f,_0x263d2f,_0x36d6fe,_0x4b5355,_0x2eb2dd,_0x160117){return new Promise(function(_0x31c50b,_0xb1adc4){var _0x459396=[];_0x462e5f['forEach'](function(_0x4f4d1e){_0x459396['push'](getRemoteTag(_0x4f4d1e,_0x263d2f,_0x36d6fe,_0x2eb2dd,_0x160117));});return Promise[_0x809c('0x4d')](_0x459396)['then'](function(_0x41cc1f){if(_0x41cc1f[_0x809c('0xe')]){logger[_0x809c('0x15')]('['+[_0x4477c8['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x41cc1f);var _0x264738=[];_0x41cc1f['forEach'](function(_0x581e2f){_0x264738[_0x809c('0x4e')](assignTagToIncident(_0x581e2f,_0x263d2f,_0x36d6fe,_0x4b5355,_0x2eb2dd));});return Promise[_0x809c('0x4d')](_0x264738)[_0x809c('0x1a')](function(){_0x31c50b();})[_0x809c('0x11')](function(){_0x31c50b();});}else{_0x31c50b();}});});}function getTags(_0x30f8d0,_0x4e8081,_0x53fcad,_0x4f1a3c,_0x3a369e,_0x11ea51){return function(_0x5ccca2){return new Promise(function(_0x2b75a1,_0x4c45ca){var _0x380c92=[];var _0x24909b=_0x4f1a3c['Tags'];if(_0x24909b&&_0x24909b[_0x809c('0xe')]>0x0){_0x380c92=_[_0x809c('0x4f')](_0x24909b,_0x809c('0x3e'));}if(_0x380c92[_0x809c('0xe')]>0x0){return manageTags(_0x30f8d0,_0x380c92,_0x4e8081,_0x53fcad,_0x5ccca2,_0x3a369e,_0x11ea51)[_0x809c('0x1a')](function(){_0x2b75a1(_0x5ccca2);});}else{_0x2b75a1(_0x5ccca2);}});};}function emit(_0x267de4,_0x31344d,_0x56fcef){var _0x5f1da1='%26sysparm_record_target%3Dincident'+_0x809c('0x50')+_0x809c('0x51')+_0x809c('0x52');var _0x354c8f={'uri':_0x267de4+_0x809c('0x53')+_0x56fcef+_0x5f1da1};io['to'](util[_0x809c('0x54')]('user:%s',_0x31344d))['emit'](_0x809c('0x55'),_0x354c8f);}exports['cs']=function(_0x174101,_0x576666,_0xf59e1e,_0x3570d5,_0x439912,_0x6723b,_0x2ead1f,_0x1938f4){var _0x487223={};var _0x4fab93={'user':_0x6723b[_0x809c('0x56')],'pass':_0x6723b[_0x809c('0x57')]};var _0x561021=_0x809c('0x58');var _0x3a0102='sysparm_display_value=true';_0x6723b[_0x809c('0x59')]=intUtil[_0x809c('0x5a')](_0x6723b[_0x809c('0x59')]);_0x6723b[_0x809c('0x5b')]=intUtil['stripTrailingSlash'](_0x6723b[_0x809c('0x5b')]);var _0x168fd8=util[_0x809c('0x54')](_0x809c('0x5c'),_0x6723b[_0x809c('0x59')]);_0x487223['userEmail']=!_['isNil'](_0x3570d5)?_0x3570d5[_0x809c('0x5d')]:null;_0x487223[_0x809c('0x22')]=_0x6723b[_0x809c('0x5d')];_0x487223[_0x809c('0x26')]=_0x1938f4[_0x809c('0x36')]()===_0x809c('0x40')?_0x576666[_0x809c('0x5e')]:_0x576666[_0x809c('0x5f')];_0x487223[_0x809c('0x60')]=_0x1938f4===_0x809c('0x61')||_0x1938f4===_0x809c('0x62')?_0x809c('0x61'):'outbound';var _0x11cbf5=util[_0x809c('0x54')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x6723b[_0x809c('0x5b')],_0x576666[_0x809c('0x63')],md5(_0x576666[_0x809c('0x63')]));if(_0x439912&&_0x439912[_0x809c('0x64')]){logger[_0x809c('0x15')](_0x809c('0x65'),_0x809c('0x66'));_0x576666[_0x809c('0x67')]=_0x11cbf5;}else if(_0x2ead1f&&_0x2ead1f['recordingFormat']&&_0x2ead1f[_0x809c('0x68')]!==_0x809c('0x69')){logger['info']('[OUTBOUND]',_0x809c('0x66'));_0x576666['recordingURL']=_0x11cbf5;}else{_0x576666['recordingURL']='';}return getAdminUser(_0x1938f4,_0x4fab93,_0x487223,_0x168fd8,_0x3a0102,_0x561021)['then'](getUser(_0x1938f4,_0x4fab93,_0x168fd8,_0x3a0102,_0x561021))[_0x809c('0x1a')](getEndUser(_0x1938f4,_0x4fab93,_0x168fd8,_0x3a0102,_0x561021))[_0x809c('0x1a')](getTicket(_0x1938f4,_0x4fab93,_0x168fd8,_0xf59e1e,_0x576666,_0x3a0102))[_0x809c('0x1a')](function(_0x3a917e){logger['info'](util[_0x809c('0x54')]('The\x20ticket\x20ID\x20is:\x20%s',_0x3a917e[_0x809c('0x46')]));logger['info'](util[_0x809c('0x54')](_0x809c('0x6a'),_0x1938f4));if(_0x1938f4!==_0x809c('0x62')){logger[_0x809c('0x15')]('['+[_0x1938f4['toUpperCase']()]+']',_0x809c('0x6b'));emit(_0x6723b[_0x809c('0x59')],_0x3570d5[_0x809c('0x3e')],_0x3a917e[_0x809c('0x46')]);}})[_0x809c('0x11')](function(_0x25b716){logger[_0x809c('0x12')]('['+[_0x1938f4['toUpperCase']()]+_0x809c('0x6c'),util[_0x809c('0x6d')](_0x25b716,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xbb32=['util','md5','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','result','length','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','sys_id','userId','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','then','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','includes','nameField','customField','toLowerCase','content','toString','string','picklist','type','variable','variableName','idField','Variable','name',']\x20getTicket\x20input\x20crm','outbound','POST','incident','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','isNil','email','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise'];(function(_0x10b332,_0x3ebf4a){var _0x1519e=function(_0x4e484e){while(--_0x4e484e){_0x10b332['push'](_0x10b332['shift']());}};_0x1519e(++_0x3ebf4a);}(_0xbb32,0x1b9));var _0x2bb3=function(_0x282ff9,_0x268bfe){_0x282ff9=_0x282ff9-0x0;var _0x542612=_0xbb32[_0x282ff9];return _0x542612;};'use strict';var _=require(_0x2bb3('0x0'));var Promise=require(_0x2bb3('0x1'));var rp=require(_0x2bb3('0x2'));var util=require(_0x2bb3('0x3'));var md5=require(_0x2bb3('0x4'));var Redis=require('ioredis');var intUtil=require(_0x2bb3('0x5'));var config=require(_0x2bb3('0x6'));var logger=require(_0x2bb3('0x7'))(_0x2bb3('0x8'));config['redis']=_['defaults'](config[_0x2bb3('0x9')],{'host':_0x2bb3('0xa'),'port':0x18eb});var io=require(_0x2bb3('0xb'))(new Redis(config[_0x2bb3('0x9')]));function getAdminUser(_0x5b24b7,_0x2a74b8,_0x52e423,_0x585712,_0x122342,_0x538b49){return new Promise(function(_0x25f6e7,_0x5cdc03){var _0xb5522b={'method':_0x2bb3('0xc'),'uri':_0x585712+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x122342+'&'+_0x538b49,'auth':_0x2a74b8,'json':!![]};return rp(_0xb5522b)['then'](function(_0x4387e9){if(_0x4387e9[_0x2bb3('0xd')][_0x2bb3('0xe')]>0x0){_0x52e423[_0x2bb3('0xf')]=_0x4387e9[_0x2bb3('0xd')][0x0]['sys_id'];}logger[_0x2bb3('0x10')]('['+[_0x5b24b7[_0x2bb3('0x11')]()]+_0x2bb3('0x12'),_0x52e423);_0x25f6e7(_0x52e423);})[_0x2bb3('0x13')](function(_0x594e51){logger[_0x2bb3('0x14')]('['+[_0x5b24b7['toUpperCase']()]+']',_0x594e51[_0x2bb3('0x15')]);_0x5cdc03(_0x594e51[_0x2bb3('0x15')]);});});}function getUser(_0x481313,_0x5c2c7e,_0x4142ff,_0x1d77d0,_0x14315a){return function(_0x44e2b2){logger[_0x2bb3('0x10')]('['+[_0x481313[_0x2bb3('0x11')]()]+_0x2bb3('0x16'),_0x44e2b2);return new Promise(function(_0x263274,_0x49027a){if(intUtil[_0x2bb3('0x17')](_0x44e2b2[_0x2bb3('0x18')])){var _0x40f855={'method':_0x2bb3('0xc'),'uri':_0x4142ff+'sys_user?sysparm_query=email%3D'+_0x44e2b2[_0x2bb3('0x18')]+'&'+_0x1d77d0+'&'+_0x14315a,'auth':_0x5c2c7e,'json':!![]};logger[_0x2bb3('0x10')]('['+[_0x481313['toUpperCase']()]+_0x2bb3('0x19'),_0x40f855);return rp(_0x40f855)['then'](function(_0x3674a6){logger[_0x2bb3('0x10')]('['+[_0x481313['toUpperCase']()]+_0x2bb3('0x1a'),_0x3674a6);if(_0x3674a6[_0x2bb3('0xd')][_0x2bb3('0xe')]>0x0&&String(_0x3674a6[_0x2bb3('0xd')][0x0][_0x2bb3('0x1b')])===_0x2bb3('0x1c')){_0x44e2b2['userId']=_0x3674a6['result'][0x0][_0x2bb3('0x1d')];}else{_0x44e2b2[_0x2bb3('0x1e')]=_0x44e2b2['adminId'];_0x44e2b2[_0x2bb3('0x18')]=_0x44e2b2[_0x2bb3('0x1f')];}logger[_0x2bb3('0x10')]('['+[_0x481313[_0x2bb3('0x11')]()]+'],\x20getUser\x20crm',_0x44e2b2);_0x263274(_0x44e2b2);})[_0x2bb3('0x13')](function(_0x15d163){logger[_0x2bb3('0x14')]('['+[_0x481313['toUpperCase']()]+']',_0x15d163[_0x2bb3('0x15')]);_0x49027a(_0x15d163[_0x2bb3('0x15')]);});}else{logger[_0x2bb3('0x10')]('['+[_0x481313[_0x2bb3('0x11')]()]+_0x2bb3('0x20'));_0x44e2b2[_0x2bb3('0x1e')]=_0x44e2b2[_0x2bb3('0xf')];_0x44e2b2[_0x2bb3('0x18')]=_0x44e2b2[_0x2bb3('0x1f')];_0x263274(_0x44e2b2);}});};}function createEndUser(_0x57226b,_0x5109b2,_0x101b6e,_0x17ac0f,_0x9e7390){logger['info']('['+[_0x57226b[_0x2bb3('0x11')]()]+_0x2bb3('0x21'),_0x101b6e);return new Promise(function(_0x3a84c0,_0x2344f2){var _0x1e69f2={'method':'POST','uri':_0x17ac0f+_0x2bb3('0x22')+_0x9e7390,'body':{'user_name':_0x101b6e[_0x2bb3('0x23')],'roles':_0x2bb3('0x24'),'first_name':_0x101b6e[_0x2bb3('0x23')],'active':_0x2bb3('0x1c'),'date_format':_0x2bb3('0x25'),'phone':_0x101b6e[_0x2bb3('0x23')]},'auth':_0x5109b2,'json':!![]};return rp(_0x1e69f2)[_0x2bb3('0x26')](function(_0x2990ac){logger['info']('['+[_0x57226b[_0x2bb3('0x11')]()]+_0x2bb3('0x27'),_0x2990ac[_0x2bb3('0xd')]);_0x101b6e[_0x2bb3('0x28')]=_0x2990ac[_0x2bb3('0xd')]['sys_id'];_0x3a84c0(_0x101b6e);})[_0x2bb3('0x13')](function(_0x4e9657){logger[_0x2bb3('0x14')]('['+[_0x57226b[_0x2bb3('0x11')]()]+']',_0x4e9657['message']);_0x2344f2(_0x4e9657[_0x2bb3('0x15')]);});});}function getEndUser(_0x4cca1,_0x4fdeb5,_0x59c8ee,_0x3b4287,_0x2541fa){return function(_0x35517b){logger['info']('['+[_0x4cca1[_0x2bb3('0x11')]()]+_0x2bb3('0x29'),_0x35517b);return new Promise(function(_0xd7f634,_0x46025a){var _0x564211={'method':_0x2bb3('0xc'),'uri':_0x59c8ee+_0x2bb3('0x2a')+_0x35517b[_0x2bb3('0x23')]+'&'+_0x3b4287+'&'+_0x2541fa,'auth':_0x4fdeb5,'json':!![]};return rp(_0x564211)[_0x2bb3('0x26')](function(_0x595fab){if(_0x595fab[_0x2bb3('0xd')][_0x2bb3('0xe')]>0x0){_0x35517b[_0x2bb3('0x28')]=_0x595fab['result'][0x0]['sys_id'];logger['info']('['+[_0x4cca1['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x35517b);_0xd7f634(_0x35517b);}else{return createEndUser(_0x4cca1,_0x4fdeb5,_0x35517b,_0x59c8ee,_0x3b4287)[_0x2bb3('0x26')](function(_0x164cb2){logger[_0x2bb3('0x10')]('['+[_0x4cca1['toUpperCase']()]+_0x2bb3('0x2b'),_0x164cb2);_0xd7f634(_0x164cb2);});}})[_0x2bb3('0x13')](function(_0x329b4a){logger[_0x2bb3('0x14')]('['+[_0x4cca1[_0x2bb3('0x11')]()]+']',_0x329b4a[_0x2bb3('0x15')]);_0x46025a(_0x329b4a[_0x2bb3('0x15')]);});});};}function getCustomFields(_0x5384a1,_0x25d1e9){var _0x5f2c53={};if(_0x5384a1['length']>0x0){_[_0x2bb3('0x2c')](_0x5384a1,function(_0xded5c7){if(_[_0x2bb3('0x2d')](['string','picklist'],_0xded5c7['type'])&&_0xded5c7[_0x2bb3('0x2e')]&&!_0xded5c7[_0x2bb3('0x2f')]){_0x5f2c53[_0xded5c7[_0x2bb3('0x2e')][_0x2bb3('0x30')]()]=_0xded5c7[_0x2bb3('0x31')][_0x2bb3('0x32')]();}else if(_[_0x2bb3('0x2d')]([_0x2bb3('0x33'),_0x2bb3('0x34')],_0xded5c7[_0x2bb3('0x35')])&&_0xded5c7['idField']&&_0xded5c7[_0x2bb3('0x2f')]){_0x5f2c53[_0xded5c7['idField'][_0x2bb3('0x30')]()]=_0xded5c7['content'][_0x2bb3('0x32')]();}else if(_0xded5c7['type']===_0x2bb3('0x36')&&_0xded5c7[_0x2bb3('0x37')]&&_0xded5c7['idField']&&_0xded5c7[_0x2bb3('0x2f')]){_0x5f2c53[_0xded5c7[_0x2bb3('0x38')][_0x2bb3('0x30')]()]=_0x25d1e9[_0xded5c7[_0x2bb3('0x37')]][_0x2bb3('0x32')]();}else if(_0xded5c7[_0x2bb3('0x35')]==='customVariable'&&_0xded5c7[_0x2bb3('0x39')]&&_0xded5c7[_0x2bb3('0x39')][_0x2bb3('0x3a')]&&_0xded5c7[_0x2bb3('0x38')]&&_0xded5c7[_0x2bb3('0x2f')]){_0x5f2c53[_0xded5c7[_0x2bb3('0x38')]['toLowerCase']()]=_0x25d1e9[_0xded5c7[_0x2bb3('0x39')]['name'][_0x2bb3('0x30')]()][_0x2bb3('0x32')]();}});}return _0x5f2c53;}function getTicket(_0x1969a8,_0x15aec0,_0x317f27,_0x59b059,_0x5f02bc,_0x3e050c){return function(_0x40645f){logger['info']('['+[_0x1969a8[_0x2bb3('0x11')]()]+_0x2bb3('0x3b'),_0x40645f);return new Promise(function(_0x21b63f,_0x13f950){var _0x1dd44f=_0x1969a8[_0x2bb3('0x30')]()===_0x2bb3('0x3c')?_0x40645f[_0x2bb3('0x1e')]:_0x40645f[_0x2bb3('0x28')];var _0x8a603b={'method':_0x2bb3('0x3d'),'uri':_0x317f27+_0x2bb3('0x3e')+'?'+_0x3e050c,'body':Object['assign']({},{'active':_0x2bb3('0x1c'),'caller_id':_0x1dd44f,'assigned_to':_0x40645f['userId'],'short_description':intUtil[_0x2bb3('0x3f')](_0x59b059['Subjects'],_0x5f02bc,'\x20'),'description':intUtil[_0x2bb3('0x3f')](_0x59b059[_0x2bb3('0x40')],_0x5f02bc,'\x0a')},getCustomFields(_0x59b059['Fields'],_0x5f02bc)),'auth':_0x15aec0,'json':!![]};return rp(_0x8a603b)['then'](function(_0x8ca315){logger[_0x2bb3('0x10')]('['+[_0x1969a8[_0x2bb3('0x11')]()]+_0x2bb3('0x41'),_0x8ca315[_0x2bb3('0xd')]);_0x40645f[_0x2bb3('0x42')]=_0x8ca315[_0x2bb3('0xd')][_0x2bb3('0x1d')];_0x40645f[_0x2bb3('0x43')]=_0x8ca315['result'][_0x2bb3('0x44')];logger[_0x2bb3('0x10')]('['+[_0x1969a8[_0x2bb3('0x11')]()]+_0x2bb3('0x45'),_0x40645f);_0x21b63f(_0x40645f);})[_0x2bb3('0x13')](function(_0x499df0){logger['error']('['+[_0x1969a8[_0x2bb3('0x11')]()]+']',_0x499df0[_0x2bb3('0x15')]);_0x13f950(_0x499df0[_0x2bb3('0x15')]);});});};}function createRemoteTag(_0x1d2f73,_0x1481b7,_0x4270b4,_0x315f94){return new Promise(function(_0x1fcbaf,_0x19f0a5){var _0x4a2014={'method':_0x2bb3('0x3d'),'uri':_0x4270b4+_0x2bb3('0x46')+'?'+_0x315f94,'body':{'short_description':_0x1d2f73,'global':!![],'active':!![],'name':_0x1d2f73},'auth':_0x1481b7,'json':!![]};return rp(_0x4a2014)[_0x2bb3('0x26')](function(_0x4aee3c){var _0x2cef1f=_0x4aee3c[_0x2bb3('0xd')][_0x2bb3('0x1d')];_0x1fcbaf(_0x2cef1f);});});}function getRemoteTag(_0x49afb4,_0x2eb3fe,_0x365987,_0x68d584,_0x3ffc9d){return new Promise(function(_0x18da2d,_0x6c9bd8){var _0x424842={'method':'GET','uri':_0x365987+_0x2bb3('0x46')+_0x2bb3('0x47')+_0x49afb4+'&'+_0x68d584,'auth':_0x2eb3fe,'json':!![]};return rp(_0x424842)[_0x2bb3('0x26')](function(_0x16566e){if(_0x16566e[_0x2bb3('0xd')]['length']>0x0){var _0x418162=_0x16566e[_0x2bb3('0xd')][0x0][_0x2bb3('0x1d')];_0x18da2d(_0x418162);}else{return createRemoteTag(_0x49afb4,_0x2eb3fe,_0x365987,_0x68d584)[_0x2bb3('0x26')](function(_0xe593c1){_0x18da2d(_0xe593c1);});}});});}function assignTagToIncident(_0x51af2e,_0x22078e,_0x24d0c4,_0x33f7f6,_0x1d6e52){return new Promise(function(_0x1436b9,_0x524e04){var _0x5a7982={'method':_0x2bb3('0x3d'),'uri':_0x24d0c4+_0x2bb3('0x48')+'?'+_0x1d6e52,'body':{'label':_0x51af2e,'table':_0x2bb3('0x3e'),'id_type':_0x2bb3('0x49'),'table_key':_0x33f7f6[_0x2bb3('0x42')],'title':'Incident\x20-\x20'+_0x33f7f6[_0x2bb3('0x43')],'id_display':_0x33f7f6['ticketNumber']},'auth':_0x22078e,'json':!![]};return rp(_0x5a7982)[_0x2bb3('0x26')](function(_0x53df09){_0x1436b9();})[_0x2bb3('0x13')](function(){_0x1436b9();});});}function manageTags(_0x5d6adf,_0x116c39,_0x21cb4a,_0x81932c,_0x27b675,_0x4e1595,_0x366027){return new Promise(function(_0x89ba2,_0x3dcbb6){var _0x581b06=[];_0x116c39['forEach'](function(_0x26c5e9){_0x581b06[_0x2bb3('0x4a')](getRemoteTag(_0x26c5e9,_0x21cb4a,_0x81932c,_0x4e1595,_0x366027));});return Promise[_0x2bb3('0x4b')](_0x581b06)[_0x2bb3('0x26')](function(_0x475598){if(_0x475598[_0x2bb3('0xe')]){logger[_0x2bb3('0x10')]('['+[_0x5d6adf[_0x2bb3('0x11')]()]+_0x2bb3('0x4c'),_0x475598);var _0x36083e=[];_0x475598[_0x2bb3('0x2c')](function(_0x57f77f){_0x36083e[_0x2bb3('0x4a')](assignTagToIncident(_0x57f77f,_0x21cb4a,_0x81932c,_0x27b675,_0x4e1595));});return Promise['all'](_0x36083e)[_0x2bb3('0x26')](function(){_0x89ba2();})['catch'](function(){_0x89ba2();});}else{_0x89ba2();}});});}function getTags(_0x5ec5fb,_0x38421b,_0x1384aa,_0x35a741,_0x4ae83b,_0x110295){return function(_0x5e2e72){return new Promise(function(_0x1cc5bd,_0x5c6737){var _0x22bb87=[];var _0x3b9142=_0x35a741[_0x2bb3('0x4d')];if(_0x3b9142&&_0x3b9142[_0x2bb3('0xe')]>0x0){_0x22bb87=_[_0x2bb3('0x4e')](_0x3b9142,_0x2bb3('0x3a'));}if(_0x22bb87['length']>0x0){return manageTags(_0x5ec5fb,_0x22bb87,_0x38421b,_0x1384aa,_0x5e2e72,_0x4ae83b,_0x110295)[_0x2bb3('0x26')](function(){_0x1cc5bd(_0x5e2e72);});}else{_0x1cc5bd(_0x5e2e72);}});};}function emit(_0x258b06,_0x33839d,_0x4fef5b){var _0x4b869a=_0x2bb3('0x4f')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x2bb3('0x50')+_0x2bb3('0x51');var _0x452822={'uri':_0x258b06+_0x2bb3('0x52')+_0x4fef5b+_0x4b869a};io['to'](util[_0x2bb3('0x53')](_0x2bb3('0x54'),_0x33839d))[_0x2bb3('0x55')](_0x2bb3('0x56'),_0x452822);}exports['cs']=function(_0xb8d51d,_0x4bba87,_0x266b69,_0x422f2d,_0x2bcba6,_0x2092d2,_0x4acb7d,_0x4caa8b){var _0x1ea53b={};var _0x2c2a0c={'user':_0x2092d2[_0x2bb3('0x57')],'pass':_0x2092d2[_0x2bb3('0x58')]};var _0x16f344=_0x2bb3('0x59');var _0x13e70d=_0x2bb3('0x5a');_0x2092d2[_0x2bb3('0x5b')]=intUtil['stripTrailingSlash'](_0x2092d2['remoteUri']);_0x2092d2[_0x2bb3('0x5c')]=intUtil[_0x2bb3('0x5d')](_0x2092d2[_0x2bb3('0x5c')]);var _0x43b5a6=util[_0x2bb3('0x53')]('%s/api/now/table/',_0x2092d2[_0x2bb3('0x5b')]);_0x1ea53b[_0x2bb3('0x18')]=!_[_0x2bb3('0x5e')](_0x422f2d)?_0x422f2d['email']:null;_0x1ea53b[_0x2bb3('0x1f')]=_0x2092d2[_0x2bb3('0x5f')];_0x1ea53b[_0x2bb3('0x23')]=_0x4caa8b['toLowerCase']()===_0x2bb3('0x3c')?_0x4bba87['destcalleridnum']:_0x4bba87[_0x2bb3('0x60')];_0x1ea53b[_0x2bb3('0x61')]=_0x4caa8b===_0x2bb3('0x62')||_0x4caa8b===_0x2bb3('0x63')?'queue':_0x2bb3('0x3c');var _0x533c86=util[_0x2bb3('0x53')](_0x2bb3('0x64'),_0x2092d2[_0x2bb3('0x5c')],_0x4bba87[_0x2bb3('0x65')],md5(_0x4bba87[_0x2bb3('0x65')]));if(_0x2bcba6&&_0x2bcba6[_0x2bb3('0x66')]){logger[_0x2bb3('0x10')](_0x2bb3('0x67'),'Recording\x20is\x20enabled!');_0x4bba87[_0x2bb3('0x68')]=_0x533c86;}else if(_0x4acb7d&&_0x4acb7d['recordingFormat']&&_0x4acb7d[_0x2bb3('0x69')]!==_0x2bb3('0x6a')){logger['info'](_0x2bb3('0x6b'),'Recording\x20is\x20enabled!');_0x4bba87[_0x2bb3('0x68')]=_0x533c86;}else{_0x4bba87[_0x2bb3('0x68')]='';}return getAdminUser(_0x4caa8b,_0x2c2a0c,_0x1ea53b,_0x43b5a6,_0x13e70d,_0x16f344)[_0x2bb3('0x26')](getUser(_0x4caa8b,_0x2c2a0c,_0x43b5a6,_0x13e70d,_0x16f344))['then'](getEndUser(_0x4caa8b,_0x2c2a0c,_0x43b5a6,_0x13e70d,_0x16f344))[_0x2bb3('0x26')](getTicket(_0x4caa8b,_0x2c2a0c,_0x43b5a6,_0x266b69,_0x4bba87,_0x13e70d))[_0x2bb3('0x26')](function(_0x3cc387){logger[_0x2bb3('0x10')](util[_0x2bb3('0x53')](_0x2bb3('0x6c'),_0x3cc387[_0x2bb3('0x42')]));logger['info'](util[_0x2bb3('0x53')](_0x2bb3('0x6d'),_0x4caa8b));if(_0x4caa8b!==_0x2bb3('0x63')){logger[_0x2bb3('0x10')]('['+[_0x4caa8b[_0x2bb3('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2092d2['remoteUri'],_0x422f2d[_0x2bb3('0x3a')],_0x3cc387[_0x2bb3('0x42')]);}})[_0x2bb3('0x13')](function(_0x34211d){logger[_0x2bb3('0x14')]('['+[_0x4caa8b[_0x2bb3('0x11')]()]+_0x2bb3('0x6e'),util['inspect'](_0x34211d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js index 41d847d..f8e9825 100644 --- a/server/services/ami/trigger/integration/sugarcrm.js +++ b/server/services/ami/trigger/integration/sugarcrm.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0558=['isNil','The\x20User\x20ID\x20is:','calleridname','Ticket\x20created!','bluebird','ioredis','../../../../config/environment','sugarcrm','redis','defaults','socket.io-emitter','POST','emit','info','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','Contacts','parent_name','direction','length','forEach','push','idField','variableName','JSON','stringify','Calls','format','Basic\x20%s','apiKey','Employees','name','entry_list','name_value_list','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','user_name','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','','Enduser\x20created.','first_name','[HTTP]','merge','map','string','nameField','toLowerCase','content','toString','type','customField','custom_fields','variable','customVariable','Variable','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','Inbound','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','catch','error','[QUEUE]','outbound','%s/service/v4_1/rest.php','recordingFormat','none','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','Outbound','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','[OUTBOUND]','lastevent','toUpperCase'];(function(_0x42c6cc,_0x3ad790){var _0x203753=function(_0x1aaa2c){while(--_0x1aaa2c){_0x42c6cc['push'](_0x42c6cc['shift']());}};_0x203753(++_0x3ad790);}(_0x0558,0x1dc));var _0x8055=function(_0x42f0d1,_0x45fe4a){_0x42f0d1=_0x42f0d1-0x0;var _0x43f981=_0x0558[_0x42f0d1];return _0x43f981;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x8055('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x8055('0x1'));var intUtil=require('./util');var config=require(_0x8055('0x2'));var logger=require('../../../../config/logger')(_0x8055('0x3'));config[_0x8055('0x4')]=_[_0x8055('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8055('0x6'))(new Redis(config['redis']));var def={'method':_0x8055('0x7'),'json':!![]};function emit(_0x3ecdee,_0x49671b,_0x363853){io['to'](_0x3ecdee)[_0x8055('0x8')](_0x49671b,_0x363853);}function getTicket(_0x363fa4,_0x4dc341,_0x5ba3ab,_0x1a86bb,_0x452d90,_0x36c5ee,_0x4874ca,_0x41d597){logger[_0x8055('0x9')]('Creating\x20new\x20ticket...');var _0x484264=new Date();var _0x4a7647=[{'name':'name','value':intUtil[_0x8055('0xa')](_0x1a86bb[_0x8055('0xb')],_0x452d90,'\x20')},{'name':_0x8055('0xc'),'value':_0x4dc341['id']},{'name':_0x8055('0xd'),'value':_0x4dc341['id']},{'name':_0x8055('0xe'),'value':intUtil['getString'](_0x1a86bb[_0x8055('0xf')],_0x452d90,'\x0a')},{'name':_0x8055('0x10'),'value':_0x484264[_0x8055('0x11')]()[_0x8055('0x12')](0x0,0x13)[_0x8055('0x13')]('T','\x20')},{'name':_0x8055('0x14'),'value':'0'},{'name':_0x8055('0x15'),'value':'15'},{'name':'parent_id','value':_0x5ba3ab['id']},{'name':'parent_type','value':_0x8055('0x16')},{'name':_0x8055('0x17'),'value':_0x5ba3ab['name']},{'name':_0x8055('0x18'),'value':_0x41d597}];if(_0x36c5ee[_0x8055('0x19')]){_[_0x8055('0x1a')](_0x36c5ee,function(_0x57e64e){if(_0x452d90[_0x57e64e['variableName']]){_0x4a7647[_0x8055('0x1b')]({'name':_0x57e64e[_0x8055('0x1c')],'value':_0x452d90[_0x57e64e[_0x8055('0x1d')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x8055('0x1e'),'response_type':_0x8055('0x1e'),'rest_data':JSON[_0x8055('0x1f')]({'session':_0x4874ca['id'],'module_name':_0x8055('0x20'),'name_value_list':_0x4a7647})}});}function getAuth(_0x16dd34){return util[_0x8055('0x21')](_0x8055('0x22'),new Buffer(_0x16dd34[_0x8055('0x23')]+':X')['toString']('base64'));}function getServerInfo(_0xab1c6d){return request({'form':{'method':'get_server_info','input_type':_0x8055('0x1e'),'response_type':_0x8055('0x1e'),'rest_data':JSON[_0x8055('0x1f')]({'session':_0xab1c6d['id']})}});}function getUser(_0x346b14,_0x15d521,_0x4282fa){if(!_['isNil'](_0x15d521)){logger['info']('Getting\x20agent\x20with\x20name',_0x15d521);return request({'form':{'method':'get_entry_list','input_type':_0x8055('0x1e'),'response_type':_0x8055('0x1e'),'rest_data':JSON[_0x8055('0x1f')]({'session':_0x4282fa['id'],'module_name':_0x8055('0x24'),'query':util[_0x8055('0x21')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x15d521),'order_by':'','offset':'0','select_fields':['id',_0x8055('0x25'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x43064f){if(_0x43064f[_0x8055('0x26')][_0x8055('0x19')]){var _0x58f547=_['find'](_0x43064f[_0x8055('0x26')],function(_0x5cc8de){return _0x5cc8de[_0x8055('0x27')]['user_name']['value']===_0x15d521;});if(_0x58f547){logger['info'](_0x8055('0x28'));return BPromise[_0x8055('0x29')]({'id':_0x58f547['name_value_list']['id'][_0x8055('0x2a')],'name':_0x58f547[_0x8055('0x27')][_0x8055('0x25')][_0x8055('0x2a')]});}}logger[_0x8055('0x9')](_0x8055('0x2b'));return BPromise[_0x8055('0x29')]({'id':_0x4282fa[_0x8055('0x27')][_0x8055('0x2c')][_0x8055('0x2a')],'name':_0x4282fa[_0x8055('0x27')][_0x8055('0x2d')][_0x8055('0x2a')]});});}else{logger['info'](_0x8055('0x2e'));return BPromise[_0x8055('0x29')]({'id':_0x4282fa[_0x8055('0x27')]['user_id'][_0x8055('0x2a')],'name':_0x4282fa[_0x8055('0x27')]['user_name'][_0x8055('0x2a')]});}}function getEndUser(_0x110f91,_0x2474b2,_0x1578a4,_0xb3af60){logger[_0x8055('0x9')](_0x8055('0x2f'),_0x1578a4);return request({'form':{'method':_0x8055('0x30'),'input_type':_0x8055('0x1e'),'response_type':_0x8055('0x1e'),'rest_data':JSON['stringify']({'session':_0xb3af60['id'],'module_name':_0x8055('0x16'),'query':util[_0x8055('0x21')](_0x8055('0x31'),_0x1578a4),'order_by':'','offset':'0','select_fields':['id',_0x8055('0x25'),_0x8055('0x32')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8055('0x33')](function(_0x3fea6c){if(_0x3fea6c['entry_list'][_0x8055('0x19')]){var _0x55c4e7=_['find'](_0x3fea6c[_0x8055('0x26')],function(_0x3a19bc){return _0x3a19bc[_0x8055('0x27')][_0x8055('0x32')]['value']===_0x1578a4;});if(_0x55c4e7){logger[_0x8055('0x9')](_0x8055('0x34'));return BPromise[_0x8055('0x29')]({'id':_0x55c4e7[_0x8055('0x27')]['id'][_0x8055('0x2a')],'name':_0x55c4e7[_0x8055('0x27')][_0x8055('0x25')][_0x8055('0x2a')],'phone':_0x55c4e7[_0x8055('0x27')][_0x8055('0x32')][_0x8055('0x2a')]});}}else{logger[_0x8055('0x9')](_0x8055('0x35'));return request({'form':{'method':_0x8055('0x36'),'input_type':_0x8055('0x1e'),'response_type':'JSON','rest_data':JSON[_0x8055('0x1f')]({'session':_0xb3af60['id'],'module_name':_0x8055('0x16'),'name_value_list':[{'name':'first_name','value':_0x2474b2!==_0x8055('0x37')?_0x2474b2:util[_0x8055('0x21')]('Caller\x20-\x20%s',_0x1578a4)},{'name':_0x8055('0x32'),'value':_0x1578a4}]})}})[_0x8055('0x33')](function(_0x44a666){logger['info'](_0x8055('0x38'));return BPromise[_0x8055('0x29')]({'id':_0x44a666['id'],'name':_0x44a666['entry_list'][_0x8055('0x39')][_0x8055('0x2a')],'phone':_0x44a666[_0x8055('0x26')]['phone_home'][_0x8055('0x2a')]});});}});}function request(_0x4e2060){logger['debug'](_0x8055('0x3a'),JSON['stringify'](_0x4e2060));return rp(_[_0x8055('0x3b')](def,_0x4e2060));}function getTags(_0x2d778f,_0xc9dde9){var _0x53c469=[];if(_0x2d778f&&_0x2d778f[_0x8055('0x19')]>0x0){_0x53c469=_[_0x8055('0x3c')](_0x2d778f,_0xc9dde9);}return _0x53c469;}function getCustomFields(_0x58361b,_0x563cde){var _0x50dc28=[];var _0x3707ee={'custom_fields':[]};if(_0x58361b['length']>0x0){_[_0x8055('0x1a')](_0x58361b,function(_0xa977d0){if(_0xa977d0['type']===_0x8055('0x3d')&&_0xa977d0[_0x8055('0x3e')]&&!_0xa977d0['customField']){_0x3707ee[_0xa977d0[_0x8055('0x3e')][_0x8055('0x3f')]()]=_0xa977d0[_0x8055('0x40')][_0x8055('0x41')]();}else if(_0xa977d0[_0x8055('0x42')]==='string'&&_0xa977d0[_0x8055('0x1c')]&&_0xa977d0[_0x8055('0x43')]){_0x3707ee[_0x8055('0x44')]['push']({'id':_0xa977d0['idField'],'value':_0xa977d0['content'][_0x8055('0x41')]()});}else if(_0xa977d0[_0x8055('0x42')]===_0x8055('0x45')&&_0xa977d0['variableName']&&_0xa977d0['idField']&&_0xa977d0[_0x8055('0x43')]){_0x563cde[_0xa977d0['variableName']]&&_0x3707ee[_0x8055('0x44')]['push']({'id':_0xa977d0[_0x8055('0x1c')],'value':_0x563cde[_0xa977d0[_0x8055('0x1d')]]['toString']()});}else if(_0xa977d0[_0x8055('0x42')]===_0x8055('0x46')&&_0xa977d0[_0x8055('0x47')]&&_0xa977d0[_0x8055('0x47')][_0x8055('0x25')]&&_0xa977d0['idField']&&_0xa977d0['customField']){_0x563cde[_0xa977d0['Variable'][_0x8055('0x25')][_0x8055('0x3f')]()]&&_0x3707ee[_0x8055('0x44')][_0x8055('0x1b')]({'id':_0xa977d0[_0x8055('0x1c')],'value':_0x563cde[_0xa977d0[_0x8055('0x47')]['name'][_0x8055('0x3f')]()]['toString']()});}});}return _0x3707ee;}function getConnection(_0x48367e){return request({'method':_0x8055('0x7'),'form':{'method':'login','input_type':_0x8055('0x1e'),'response_type':_0x8055('0x1e'),'rest_data':JSON[_0x8055('0x1f')]({'user_auth':{'user_name':_0x48367e['username'],'password':_0x48367e[_0x8055('0x48')],'encryption':_0x8055('0x49')},'application':_0x8055('0x4a')})}})[_0x8055('0x33')](function(_0x3472d6){var _0x3f4103=_0x3472d6;if(_0x3f4103['id']){def[_0x8055('0x4b')]=_0x3f4103['id'];return BPromise[_0x8055('0x29')](_0x3f4103);}else{throw new Error(util[_0x8055('0x21')](_0x8055('0x4c'),_0x48367e['id']));}});}function setRelationship(_0x5cd024,_0x961c3f,_0x25fb0c,_0x3d7b13){return request({'form':{'method':_0x8055('0x4d'),'input_type':_0x8055('0x1e'),'response_type':_0x8055('0x1e'),'rest_data':JSON[_0x8055('0x1f')]({'session':_0x5cd024['id'],'module_name':'Calls','module_id':_0x25fb0c['id'],'link_field_name':_0x3d7b13,'related_ids':[_0x961c3f['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x8055('0x4e')]=function(_0x43eeb8,_0x2ba69e,_0x40745d,_0xf3dc6c,_0x5c68e9,_0xf83f6e){var _0x4146ae,_0x3010f0,_0x2fa0b8,_0x3176cd;_0xf83f6e[_0x8055('0x4f')]=intUtil[_0x8055('0x50')](_0xf83f6e[_0x8055('0x4f')]);_0xf83f6e[_0x8055('0x51')]=intUtil[_0x8055('0x50')](_0xf83f6e[_0x8055('0x51')]);def[_0x8055('0x52')]=util[_0x8055('0x21')]('%s/service/v4_1/rest.php',_0xf83f6e['remoteUri']);if(_0x5c68e9&&_0x5c68e9[_0x8055('0x53')]){logger[_0x8055('0x9')]('[QUEUE]',_0x8055('0x54'));_0x2ba69e[_0x8055('0x55')]=util[_0x8055('0x21')](_0x8055('0x56'),_0xf83f6e[_0x8055('0x51')],_0x2ba69e[_0x8055('0x57')],md5(_0x2ba69e[_0x8055('0x57')]));}else{_0x2ba69e[_0x8055('0x55')]='';}return getConnection(_0xf83f6e)[_0x8055('0x33')](function(_0x50d569){_0x3176cd=_0x50d569;return getUser(_0xf83f6e,_0xf3dc6c[_0x8055('0x25')],_0x3176cd);})['then'](function(_0x2554fd){_0x4146ae=_0x2554fd;logger['info']('The\x20User\x20ID\x20is:',_0x4146ae['id']);return getEndUser(_0xf83f6e,_0x2ba69e['calleridname'],_0x2ba69e[_0x8055('0x58')],_0x3176cd);})['then'](function(_0x5c28b9){_0x3010f0=_0x5c28b9;logger[_0x8055('0x9')]('The\x20Enduser\x20ID\x20is:',_0x3010f0['id']);return getTicket(_0xf83f6e,_0x4146ae,_0x3010f0,_0x40745d,_0x2ba69e,_0x40745d['Fields'],_0x3176cd,_0x8055('0x59'));})[_0x8055('0x33')](function(_0x2da201){_0x2fa0b8=_0x2da201;logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x2fa0b8['id']);return setRelationship(_0x3176cd,_0x4146ae,_0x2fa0b8,_0x8055('0x5a'));})[_0x8055('0x33')](function(){return setRelationship(_0x3176cd,_0x3010f0,_0x2fa0b8,_0x8055('0x5b'));})[_0x8055('0x33')](function(){return getServerInfo(_0x3176cd);})['then'](function(_0xa5628a){var _0x58057b=parseInt(_0xa5628a[_0x8055('0x5c')][_0x8055('0x5d')](0x0));var _0x433a07=util['format'](_0x8055('0x5e'),_0xf83f6e[_0x8055('0x4f')],_0x2fa0b8['id']);if(_0x58057b>0x6){_0x433a07=util[_0x8055('0x21')](_0x8055('0x5f'),_0xf83f6e[_0x8055('0x4f')],_0x2fa0b8['id']);}logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x8055('0x21')]('user:%s',_0xf3dc6c[_0x8055('0x25')]),'trigger:browser:url',{'uri':_0x433a07});})[_0x8055('0x60')](function(_0x4a472f){logger[_0x8055('0x61')](_0x8055('0x62'),JSON[_0x8055('0x1f')](_0x4a472f));});};exports[_0x8055('0x63')]=function(_0x15dfd2,_0x187208,_0x57743b,_0x41e579,_0x5dfe43,_0x4a4a15,_0x3c624e){var _0x3720bd,_0x195674,_0x391a65,_0x617bb0;_0x4a4a15[_0x8055('0x4f')]=intUtil[_0x8055('0x50')](_0x4a4a15[_0x8055('0x4f')]);_0x4a4a15['serverUrl']=intUtil['stripTrailingSlash'](_0x4a4a15[_0x8055('0x51')]);def['uri']=util['format'](_0x8055('0x64'),_0x4a4a15['remoteUri']);if(_0x3c624e&&_0x3c624e[_0x8055('0x65')]&&_0x3c624e['recordingFormat']!==_0x8055('0x66')){logger[_0x8055('0x9')]('[OUTBOUND]',_0x8055('0x54'));_0x187208['recordingURL']=util[_0x8055('0x21')](_0x8055('0x56'),_0x4a4a15[_0x8055('0x51')],_0x187208[_0x8055('0x57')],md5(_0x187208[_0x8055('0x57')]));}return getConnection(_0x4a4a15)[_0x8055('0x33')](function(_0x28b2ce){_0x617bb0=_0x28b2ce;return getUser(_0x4a4a15,_0x41e579[_0x8055('0x25')],_0x617bb0);})['then'](function(_0xc5bad){_0x3720bd=_0xc5bad;logger['info']('The\x20User\x20ID\x20is:',_0x3720bd['id']);return getEndUser(_0x4a4a15,_0x187208[_0x8055('0x67')],_0x187208[_0x8055('0x68')],_0x617bb0);})[_0x8055('0x33')](function(_0x54fbbf){_0x195674=_0x54fbbf;logger['info'](_0x8055('0x69'),_0x195674['id']);return getTicket(_0x4a4a15,_0x3720bd,_0x195674,_0x57743b,_0x187208,_0x57743b[_0x8055('0x6a')],_0x617bb0,_0x8055('0x6b'));})['then'](function(_0x5af225){_0x391a65=_0x5af225;logger[_0x8055('0x9')]('Ticket\x20created!');logger[_0x8055('0x9')](_0x8055('0x6c'),_0x391a65['id']);return setRelationship(_0x617bb0,_0x3720bd,_0x391a65,_0x8055('0x5a'));})[_0x8055('0x33')](function(){return setRelationship(_0x617bb0,_0x195674,_0x391a65,_0x8055('0x5b'));})[_0x8055('0x33')](function(){return getServerInfo(_0x617bb0);})[_0x8055('0x33')](function(_0x3ee7f9){var _0x3e5f4a=parseInt(_0x3ee7f9[_0x8055('0x5c')][_0x8055('0x5d')](0x0));var _0x234fa2=util[_0x8055('0x21')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x4a4a15[_0x8055('0x4f')],_0x391a65['id']);if(_0x3e5f4a>0x6){_0x234fa2=util[_0x8055('0x21')](_0x8055('0x5f'),_0x4a4a15[_0x8055('0x4f')],_0x391a65['id']);}logger['info']('[OUTBOUND]',_0x8055('0x6d'));emit(util['format']('user:%s',_0x41e579['name']),_0x8055('0x6e'),{'uri':_0x234fa2});})[_0x8055('0x60')](function(_0x2e3bf9){logger[_0x8055('0x61')](_0x8055('0x6f'),JSON[_0x8055('0x1f')](_0x2e3bf9));});};exports['unmanaged']=function(_0xcdaf3a,_0x5741c5,_0x52cc15,_0x473f54,_0x4726af,_0x5a792b){var _0x22bca1,_0x5080cd,_0x37bf68,_0x38c442;_0x5a792b[_0x8055('0x4f')]=intUtil[_0x8055('0x50')](_0x5a792b[_0x8055('0x4f')]);_0x5a792b['serverUrl']=intUtil[_0x8055('0x50')](_0x5a792b[_0x8055('0x51')]);def[_0x8055('0x52')]=util[_0x8055('0x21')](_0x8055('0x64'),_0x5a792b[_0x8055('0x4f')]);if(_0x4726af&&_0x4726af[_0x8055('0x53')]){logger[_0x8055('0x9')]('['+_0x5741c5[_0x8055('0x70')][_0x8055('0x71')]()+']',_0x8055('0x54'));_0x5741c5['recordingURL']=util[_0x8055('0x21')](_0x8055('0x56'),_0x5a792b[_0x8055('0x51')],_0x5741c5['uniqueid'],md5(_0x5741c5['uniqueid']));}else{_0x5741c5['recordingURL']='';}return getConnection(_0x5a792b)[_0x8055('0x33')](function(_0x17a2dc){_0x38c442=_0x17a2dc;if(!_[_0x8055('0x72')](_0x473f54)){return getUser(_0x5a792b,_0x473f54['name'],_0x38c442);}else{return getUser(_0x5a792b,null,_0x38c442);}})['then'](function(_0x3d6c6d){_0x22bca1=_0x3d6c6d;logger[_0x8055('0x9')](_0x8055('0x73'),_0x22bca1['id']);return getEndUser(_0x5a792b,_0x5741c5[_0x8055('0x74')],_0x5741c5['calleridnum'],_0x38c442);})['then'](function(_0x20c091){_0x5080cd=_0x20c091;logger['info'](_0x8055('0x69'),_0x5080cd['id']);return getTicket(_0x5a792b,_0x22bca1,_0x5080cd,_0x52cc15,_0x5741c5,_0x52cc15['Fields'],_0x38c442,_0x8055('0x59'));})[_0x8055('0x33')](function(_0x1efac6){_0x37bf68=_0x1efac6;logger[_0x8055('0x9')](_0x8055('0x75'));logger[_0x8055('0x9')](_0x8055('0x6c'),_0x37bf68['id']);return setRelationship(_0x38c442,_0x22bca1,_0x37bf68,_0x8055('0x5a'));})[_0x8055('0x33')](function(){return setRelationship(_0x38c442,_0x5080cd,_0x37bf68,_0x8055('0x5b'));})['then'](function(){return getServerInfo(_0x38c442);})[_0x8055('0x60')](function(_0x252436){logger[_0x8055('0x61')]('['+_0x5741c5[_0x8055('0x70')][_0x8055('0x71')]()+']',JSON[_0x8055('0x1f')](_0x252436));});}; \ No newline at end of file +var _0x7471=['parent_type','direction','length','forEach','push','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','user_name','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','get_entry_list','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','phone_home','Enduser\x20created.','[HTTP]','merge','map','type','string','customField','nameField','toLowerCase','idField','custom_fields','content','variableName','customVariable','Variable','POST','login','username','password','xCALLY\x20Motion\x20integration','sessionID','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','outbound','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','users','charAt','error','unmanaged','lastevent','calleridname','toUpperCase','lodash','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','info','Creating\x20new\x20ticket...','Subjects','assigned_user_id','created_by','description','getString','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes'];(function(_0x4d8961,_0x335a9b){var _0x31bbf0=function(_0x111989){while(--_0x111989){_0x4d8961['push'](_0x4d8961['shift']());}};_0x31bbf0(++_0x335a9b);}(_0x7471,0xdb));var _0x1747=function(_0x4e67cc,_0x89bb8){_0x4e67cc=_0x4e67cc-0x0;var _0x2a3529=_0x7471[_0x4e67cc];return _0x2a3529;};'use strict';var _=require(_0x1747('0x0'));var rp=require('request-promise');var BPromise=require(_0x1747('0x1'));var md5=require('md5');var util=require(_0x1747('0x2'));var Redis=require(_0x1747('0x3'));var intUtil=require(_0x1747('0x4'));var config=require(_0x1747('0x5'));var logger=require(_0x1747('0x6'))('sugarcrm');config[_0x1747('0x7')]=_[_0x1747('0x8')](config['redis'],{'host':_0x1747('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x290fee,_0x33510a,_0x4e62cd){io['to'](_0x290fee)['emit'](_0x33510a,_0x4e62cd);}function getTicket(_0x1e0e16,_0x54b5dd,_0x22d83a,_0x233fdc,_0x5f2028,_0x4ae846,_0x23c1f2,_0x593907){logger[_0x1747('0xa')](_0x1747('0xb'));var _0x5e724d=new Date();var _0x366c58=[{'name':'name','value':intUtil['getString'](_0x233fdc[_0x1747('0xc')],_0x5f2028,'\x20')},{'name':_0x1747('0xd'),'value':_0x54b5dd['id']},{'name':_0x1747('0xe'),'value':_0x54b5dd['id']},{'name':_0x1747('0xf'),'value':intUtil[_0x1747('0x10')](_0x233fdc[_0x1747('0x11')],_0x5f2028,'\x0a')},{'name':'date_start','value':_0x5e724d[_0x1747('0x12')]()[_0x1747('0x13')](0x0,0x13)[_0x1747('0x14')]('T','\x20')},{'name':_0x1747('0x15'),'value':'0'},{'name':_0x1747('0x16'),'value':'15'},{'name':'parent_id','value':_0x22d83a['id']},{'name':_0x1747('0x17'),'value':'Contacts'},{'name':'parent_name','value':_0x22d83a['name']},{'name':_0x1747('0x18'),'value':_0x593907}];if(_0x4ae846[_0x1747('0x19')]){_[_0x1747('0x1a')](_0x4ae846,function(_0x54157b){if(_0x5f2028[_0x54157b['variableName']]){_0x366c58[_0x1747('0x1b')]({'name':_0x54157b['idField'],'value':_0x5f2028[_0x54157b['variableName']]});}});}return request({'form':{'method':_0x1747('0x1c'),'input_type':'JSON','response_type':_0x1747('0x1d'),'rest_data':JSON[_0x1747('0x1e')]({'session':_0x23c1f2['id'],'module_name':_0x1747('0x1f'),'name_value_list':_0x366c58})}});}function getAuth(_0x38d088){return util[_0x1747('0x20')](_0x1747('0x21'),new Buffer(_0x38d088[_0x1747('0x22')]+':X')[_0x1747('0x23')](_0x1747('0x24')));}function getServerInfo(_0xb28de){return request({'form':{'method':_0x1747('0x25'),'input_type':_0x1747('0x1d'),'response_type':_0x1747('0x1d'),'rest_data':JSON[_0x1747('0x1e')]({'session':_0xb28de['id']})}});}function getUser(_0x251ade,_0x2b545c,_0x2aab29){if(!_[_0x1747('0x26')](_0x2b545c)){logger[_0x1747('0xa')](_0x1747('0x27'),_0x2b545c);return request({'form':{'method':'get_entry_list','input_type':_0x1747('0x1d'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2aab29['id'],'module_name':_0x1747('0x28'),'query':util[_0x1747('0x20')](_0x1747('0x29'),_0x2b545c),'order_by':'','offset':'0','select_fields':['id',_0x1747('0x2a'),_0x1747('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x5da49b){if(_0x5da49b[_0x1747('0x2c')][_0x1747('0x19')]){var _0x46f467=_[_0x1747('0x2d')](_0x5da49b[_0x1747('0x2c')],function(_0x365859){return _0x365859[_0x1747('0x2e')][_0x1747('0x2b')][_0x1747('0x2f')]===_0x2b545c;});if(_0x46f467){logger[_0x1747('0xa')](_0x1747('0x30'));return BPromise[_0x1747('0x31')]({'id':_0x46f467[_0x1747('0x2e')]['id']['value'],'name':_0x46f467[_0x1747('0x2e')][_0x1747('0x2a')][_0x1747('0x2f')]});}}logger[_0x1747('0xa')](_0x1747('0x32'));return BPromise['resolve']({'id':_0x2aab29[_0x1747('0x2e')][_0x1747('0x33')]['value'],'name':_0x2aab29[_0x1747('0x2e')][_0x1747('0x2b')]['value']});});}else{logger[_0x1747('0xa')](_0x1747('0x34'));return BPromise[_0x1747('0x31')]({'id':_0x2aab29['name_value_list'][_0x1747('0x33')][_0x1747('0x2f')],'name':_0x2aab29['name_value_list'][_0x1747('0x2b')]['value']});}}function getEndUser(_0x14c0f1,_0x3bb112,_0x2afa3d,_0x4463d1){logger[_0x1747('0xa')]('Searching\x20enduser\x20with\x20phone',_0x2afa3d);return request({'form':{'method':_0x1747('0x35'),'input_type':_0x1747('0x1d'),'response_type':_0x1747('0x1d'),'rest_data':JSON[_0x1747('0x1e')]({'session':_0x4463d1['id'],'module_name':_0x1747('0x36'),'query':util[_0x1747('0x20')](_0x1747('0x37'),_0x2afa3d),'order_by':'','offset':'0','select_fields':['id',_0x1747('0x2a'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1747('0x38')](function(_0x2b0a07){if(_0x2b0a07[_0x1747('0x2c')]['length']){var _0x4ac211=_[_0x1747('0x2d')](_0x2b0a07[_0x1747('0x2c')],function(_0x18a151){return _0x18a151[_0x1747('0x2e')]['phone_home'][_0x1747('0x2f')]===_0x2afa3d;});if(_0x4ac211){logger[_0x1747('0xa')](_0x1747('0x39'));return BPromise[_0x1747('0x31')]({'id':_0x4ac211['name_value_list']['id'][_0x1747('0x2f')],'name':_0x4ac211[_0x1747('0x2e')][_0x1747('0x2a')][_0x1747('0x2f')],'phone':_0x4ac211['name_value_list']['phone_home'][_0x1747('0x2f')]});}}else{logger[_0x1747('0xa')](_0x1747('0x3a'));return request({'form':{'method':'set_entry','input_type':_0x1747('0x1d'),'response_type':_0x1747('0x1d'),'rest_data':JSON[_0x1747('0x1e')]({'session':_0x4463d1['id'],'module_name':_0x1747('0x36'),'name_value_list':[{'name':_0x1747('0x3b'),'value':_0x3bb112!==_0x1747('0x3c')?_0x3bb112:util[_0x1747('0x20')](_0x1747('0x3d'),_0x2afa3d)},{'name':_0x1747('0x3e'),'value':_0x2afa3d}]})}})[_0x1747('0x38')](function(_0x25c5da){logger['info'](_0x1747('0x3f'));return BPromise[_0x1747('0x31')]({'id':_0x25c5da['id'],'name':_0x25c5da['entry_list']['first_name']['value'],'phone':_0x25c5da['entry_list'][_0x1747('0x3e')][_0x1747('0x2f')]});});}});}function request(_0x22e341){logger['debug'](_0x1747('0x40'),JSON[_0x1747('0x1e')](_0x22e341));return rp(_[_0x1747('0x41')](def,_0x22e341));}function getTags(_0x6b7163,_0x266b21){var _0x26b44b=[];if(_0x6b7163&&_0x6b7163[_0x1747('0x19')]>0x0){_0x26b44b=_[_0x1747('0x42')](_0x6b7163,_0x266b21);}return _0x26b44b;}function getCustomFields(_0x437cd0,_0x29f6f2){var _0xdc89e3=[];var _0x4c80ba={'custom_fields':[]};if(_0x437cd0[_0x1747('0x19')]>0x0){_[_0x1747('0x1a')](_0x437cd0,function(_0x25cdfa){if(_0x25cdfa[_0x1747('0x43')]===_0x1747('0x44')&&_0x25cdfa['nameField']&&!_0x25cdfa[_0x1747('0x45')]){_0x4c80ba[_0x25cdfa[_0x1747('0x46')][_0x1747('0x47')]()]=_0x25cdfa['content']['toString']();}else if(_0x25cdfa[_0x1747('0x43')]===_0x1747('0x44')&&_0x25cdfa[_0x1747('0x48')]&&_0x25cdfa[_0x1747('0x45')]){_0x4c80ba[_0x1747('0x49')][_0x1747('0x1b')]({'id':_0x25cdfa[_0x1747('0x48')],'value':_0x25cdfa[_0x1747('0x4a')][_0x1747('0x23')]()});}else if(_0x25cdfa[_0x1747('0x43')]==='variable'&&_0x25cdfa['variableName']&&_0x25cdfa[_0x1747('0x48')]&&_0x25cdfa[_0x1747('0x45')]){_0x29f6f2[_0x25cdfa[_0x1747('0x4b')]]&&_0x4c80ba[_0x1747('0x49')][_0x1747('0x1b')]({'id':_0x25cdfa[_0x1747('0x48')],'value':_0x29f6f2[_0x25cdfa[_0x1747('0x4b')]][_0x1747('0x23')]()});}else if(_0x25cdfa[_0x1747('0x43')]===_0x1747('0x4c')&&_0x25cdfa['Variable']&&_0x25cdfa[_0x1747('0x4d')]['name']&&_0x25cdfa[_0x1747('0x48')]&&_0x25cdfa[_0x1747('0x45')]){_0x29f6f2[_0x25cdfa[_0x1747('0x4d')][_0x1747('0x2a')][_0x1747('0x47')]()]&&_0x4c80ba['custom_fields'][_0x1747('0x1b')]({'id':_0x25cdfa['idField'],'value':_0x29f6f2[_0x25cdfa[_0x1747('0x4d')][_0x1747('0x2a')][_0x1747('0x47')]()][_0x1747('0x23')]()});}});}return _0x4c80ba;}function getConnection(_0x2f4ed7){return request({'method':_0x1747('0x4e'),'form':{'method':_0x1747('0x4f'),'input_type':_0x1747('0x1d'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2f4ed7[_0x1747('0x50')],'password':_0x2f4ed7[_0x1747('0x51')],'encryption':'PLAIN'},'application':_0x1747('0x52')})}})[_0x1747('0x38')](function(_0x57b4e4){var _0x22d2ed=_0x57b4e4;if(_0x22d2ed['id']){def[_0x1747('0x53')]=_0x22d2ed['id'];return BPromise[_0x1747('0x31')](_0x22d2ed);}else{throw new Error(util[_0x1747('0x20')]('Account\x20%d\x20is\x20not\x20valid',_0x2f4ed7['id']));}});}function setRelationship(_0x361823,_0x303d74,_0x5ce543,_0x25a857){return request({'form':{'method':_0x1747('0x54'),'input_type':'JSON','response_type':_0x1747('0x1d'),'rest_data':JSON[_0x1747('0x1e')]({'session':_0x361823['id'],'module_name':_0x1747('0x1f'),'module_id':_0x5ce543['id'],'link_field_name':_0x25a857,'related_ids':[_0x303d74['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x2d5cbc,_0xb5e00d,_0x4e89c4,_0x4ef07f,_0x23b465,_0x110be5){var _0x21114b,_0x72e6ba,_0x52752a,_0x2b3818;_0x110be5[_0x1747('0x55')]=intUtil[_0x1747('0x56')](_0x110be5['remoteUri']);_0x110be5[_0x1747('0x57')]=intUtil[_0x1747('0x56')](_0x110be5[_0x1747('0x57')]);def[_0x1747('0x58')]=util[_0x1747('0x20')](_0x1747('0x59'),_0x110be5[_0x1747('0x55')]);if(_0x23b465&&_0x23b465[_0x1747('0x5a')]){logger[_0x1747('0xa')](_0x1747('0x5b'),_0x1747('0x5c'));_0xb5e00d[_0x1747('0x5d')]=util[_0x1747('0x20')](_0x1747('0x5e'),_0x110be5['serverUrl'],_0xb5e00d[_0x1747('0x5f')],md5(_0xb5e00d['uniqueid']));}else{_0xb5e00d['recordingURL']='';}return getConnection(_0x110be5)[_0x1747('0x38')](function(_0xc96fec){_0x2b3818=_0xc96fec;return getUser(_0x110be5,_0x4ef07f['name'],_0x2b3818);})[_0x1747('0x38')](function(_0x147a97){_0x21114b=_0x147a97;logger[_0x1747('0xa')](_0x1747('0x60'),_0x21114b['id']);return getEndUser(_0x110be5,_0xb5e00d['calleridname'],_0xb5e00d['calleridnum'],_0x2b3818);})[_0x1747('0x38')](function(_0x57ad3e){_0x72e6ba=_0x57ad3e;logger[_0x1747('0xa')](_0x1747('0x61'),_0x72e6ba['id']);return getTicket(_0x110be5,_0x21114b,_0x72e6ba,_0x4e89c4,_0xb5e00d,_0x4e89c4['Fields'],_0x2b3818,_0x1747('0x62'));})[_0x1747('0x38')](function(_0x3248b9){_0x52752a=_0x3248b9;logger[_0x1747('0xa')](_0x1747('0x63'));logger[_0x1747('0xa')](_0x1747('0x64'),_0x52752a['id']);return setRelationship(_0x2b3818,_0x21114b,_0x52752a,'users');})[_0x1747('0x38')](function(){return setRelationship(_0x2b3818,_0x72e6ba,_0x52752a,_0x1747('0x65'));})[_0x1747('0x38')](function(){return getServerInfo(_0x2b3818);})[_0x1747('0x38')](function(_0xbe313a){var _0x15f978=parseInt(_0xbe313a[_0x1747('0x66')]['charAt'](0x0));var _0xe4425e=util[_0x1747('0x20')](_0x1747('0x67'),_0x110be5[_0x1747('0x55')],_0x52752a['id']);if(_0x15f978>0x6){_0xe4425e=util[_0x1747('0x20')](_0x1747('0x68'),_0x110be5['remoteUri'],_0x52752a['id']);}logger['info'](_0x1747('0x5b'),_0x1747('0x69'));emit(util[_0x1747('0x20')]('user:%s',_0x4ef07f['name']),_0x1747('0x6a'),{'uri':_0xe4425e});})[_0x1747('0x6b')](function(_0x197a93){logger['error'](_0x1747('0x5b'),JSON[_0x1747('0x1e')](_0x197a93));});};exports[_0x1747('0x6c')]=function(_0x4a8b64,_0x559f75,_0x108ede,_0x515bb6,_0x56ccdc,_0x5849c8,_0x1f6b96){var _0x45e11c,_0x24f3cd,_0x2d8e71,_0x56a0f6;_0x5849c8[_0x1747('0x55')]=intUtil[_0x1747('0x56')](_0x5849c8[_0x1747('0x55')]);_0x5849c8[_0x1747('0x57')]=intUtil['stripTrailingSlash'](_0x5849c8[_0x1747('0x57')]);def[_0x1747('0x58')]=util[_0x1747('0x20')](_0x1747('0x59'),_0x5849c8[_0x1747('0x55')]);if(_0x1f6b96&&_0x1f6b96[_0x1747('0x6d')]&&_0x1f6b96['recordingFormat']!==_0x1747('0x6e')){logger['info']('[OUTBOUND]',_0x1747('0x5c'));_0x559f75[_0x1747('0x5d')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5849c8[_0x1747('0x57')],_0x559f75[_0x1747('0x5f')],md5(_0x559f75[_0x1747('0x5f')]));}return getConnection(_0x5849c8)[_0x1747('0x38')](function(_0xb5b00){_0x56a0f6=_0xb5b00;return getUser(_0x5849c8,_0x515bb6[_0x1747('0x2a')],_0x56a0f6);})[_0x1747('0x38')](function(_0xb2a237){_0x45e11c=_0xb2a237;logger['info'](_0x1747('0x60'),_0x45e11c['id']);return getEndUser(_0x5849c8,_0x559f75[_0x1747('0x6f')],_0x559f75[_0x1747('0x70')],_0x56a0f6);})[_0x1747('0x38')](function(_0x33c0aa){_0x24f3cd=_0x33c0aa;logger['info']('The\x20Enduser\x20ID\x20is:',_0x24f3cd['id']);return getTicket(_0x5849c8,_0x45e11c,_0x24f3cd,_0x108ede,_0x559f75,_0x108ede['Fields'],_0x56a0f6,_0x1747('0x71'));})[_0x1747('0x38')](function(_0x31ca22){_0x2d8e71=_0x31ca22;logger[_0x1747('0xa')](_0x1747('0x63'));logger[_0x1747('0xa')](_0x1747('0x64'),_0x2d8e71['id']);return setRelationship(_0x56a0f6,_0x45e11c,_0x2d8e71,_0x1747('0x72'));})[_0x1747('0x38')](function(){return setRelationship(_0x56a0f6,_0x24f3cd,_0x2d8e71,_0x1747('0x65'));})['then'](function(){return getServerInfo(_0x56a0f6);})['then'](function(_0x31a1b8){var _0x1017a1=parseInt(_0x31a1b8['version'][_0x1747('0x73')](0x0));var _0x136b83=util[_0x1747('0x20')](_0x1747('0x67'),_0x5849c8[_0x1747('0x55')],_0x2d8e71['id']);if(_0x1017a1>0x6){_0x136b83=util['format'](_0x1747('0x68'),_0x5849c8['remoteUri'],_0x2d8e71['id']);}logger[_0x1747('0xa')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x1747('0x20')]('user:%s',_0x515bb6[_0x1747('0x2a')]),'trigger:browser:url',{'uri':_0x136b83});})['catch'](function(_0x5a9619){logger[_0x1747('0x74')]('[OUTBOUND]',JSON[_0x1747('0x1e')](_0x5a9619));});};exports[_0x1747('0x75')]=function(_0x1e227a,_0x5c930e,_0x4fddb9,_0x55e5f5,_0xbe2898,_0x2e6bd4){var _0x2c20a3,_0x2ace9b,_0x528209,_0x2a47c2;_0x2e6bd4[_0x1747('0x55')]=intUtil[_0x1747('0x56')](_0x2e6bd4[_0x1747('0x55')]);_0x2e6bd4['serverUrl']=intUtil[_0x1747('0x56')](_0x2e6bd4[_0x1747('0x57')]);def[_0x1747('0x58')]=util[_0x1747('0x20')]('%s/service/v4_1/rest.php',_0x2e6bd4['remoteUri']);if(_0xbe2898&&_0xbe2898[_0x1747('0x5a')]){logger[_0x1747('0xa')]('['+_0x5c930e[_0x1747('0x76')]['toUpperCase']()+']',_0x1747('0x5c'));_0x5c930e[_0x1747('0x5d')]=util[_0x1747('0x20')](_0x1747('0x5e'),_0x2e6bd4['serverUrl'],_0x5c930e['uniqueid'],md5(_0x5c930e[_0x1747('0x5f')]));}else{_0x5c930e[_0x1747('0x5d')]='';}return getConnection(_0x2e6bd4)[_0x1747('0x38')](function(_0x37776f){_0x2a47c2=_0x37776f;if(!_[_0x1747('0x26')](_0x55e5f5)){return getUser(_0x2e6bd4,_0x55e5f5['name'],_0x2a47c2);}else{return getUser(_0x2e6bd4,null,_0x2a47c2);}})[_0x1747('0x38')](function(_0x37d4f4){_0x2c20a3=_0x37d4f4;logger[_0x1747('0xa')]('The\x20User\x20ID\x20is:',_0x2c20a3['id']);return getEndUser(_0x2e6bd4,_0x5c930e[_0x1747('0x77')],_0x5c930e['calleridnum'],_0x2a47c2);})[_0x1747('0x38')](function(_0x106126){_0x2ace9b=_0x106126;logger[_0x1747('0xa')](_0x1747('0x61'),_0x2ace9b['id']);return getTicket(_0x2e6bd4,_0x2c20a3,_0x2ace9b,_0x4fddb9,_0x5c930e,_0x4fddb9['Fields'],_0x2a47c2,_0x1747('0x62'));})[_0x1747('0x38')](function(_0x28153e){_0x528209=_0x28153e;logger[_0x1747('0xa')]('Ticket\x20created!');logger['info'](_0x1747('0x64'),_0x528209['id']);return setRelationship(_0x2a47c2,_0x2c20a3,_0x528209,'users');})[_0x1747('0x38')](function(){return setRelationship(_0x2a47c2,_0x2ace9b,_0x528209,_0x1747('0x65'));})[_0x1747('0x38')](function(){return getServerInfo(_0x2a47c2);})[_0x1747('0x6b')](function(_0x364574){logger[_0x1747('0x74')]('['+_0x5c930e[_0x1747('0x76')][_0x1747('0x78')]()+']',JSON[_0x1747('0x1e')](_0x364574));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/util.js b/server/services/ami/trigger/integration/util.js index b56e72a..dffe2f5 100644 --- a/server/services/ami/trigger/integration/util.js +++ b/server/services/ami/trigger/integration/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x01d5=['stripTrailingSlash','slice','substring','validateEmail','isNil','test','util','getString','length','sortBy','type','string','push','content','variable','variableName','toString','Variable','name','toLowerCase','key','format','%s:\x20%s','keyType','customVariable','join'];(function(_0x14b1aa,_0xda93f6){var _0x51b55e=function(_0x225326){while(--_0x225326){_0x14b1aa['push'](_0x14b1aa['shift']());}};_0x51b55e(++_0xda93f6);}(_0x01d5,0xd6));var _0x501d=function(_0x39d058,_0x5da013){_0x39d058=_0x39d058-0x0;var _0x40a174=_0x01d5[_0x39d058];return _0x40a174;};'use strict';var _=require('lodash');var util=require(_0x501d('0x0'));exports[_0x501d('0x1')]=function(_0x75e5c6,_0x4a3641,_0xb133d5){var _0x17edaf=[];if(_0x75e5c6[_0x501d('0x2')]>0x0){var _0x40e19a=_[_0x501d('0x3')](_0x75e5c6,['id']);for(var _0x2bda05=0x0;_0x2bda05<_0x40e19a[_0x501d('0x2')];_0x2bda05++){var _0x4c184b=_0x40e19a[_0x2bda05];if(_0x4c184b[_0x501d('0x4')]===_0x501d('0x5')){_0x17edaf[_0x501d('0x6')](_0x4c184b[_0x501d('0x7')]);}else if(_0x4c184b['type']===_0x501d('0x8')&&_0x4c184b['variableName']){_0x4a3641[_0x4c184b[_0x501d('0x9')]]&&_0x17edaf[_0x501d('0x6')](_0x4a3641[_0x4c184b[_0x501d('0x9')]][_0x501d('0xa')]());}else if(_0x4c184b['type']==='customVariable'&&_0x4c184b[_0x501d('0xb')]&&_0x4c184b['Variable'][_0x501d('0xc')]){_0x4a3641[_0x4c184b['Variable'][_0x501d('0xc')][_0x501d('0xd')]()]&&_0x17edaf[_0x501d('0x6')](_0x4a3641[_0x4c184b[_0x501d('0xb')][_0x501d('0xc')][_0x501d('0xd')]()][_0x501d('0xa')]());}else if(_0x4c184b[_0x501d('0x4')]==='keyValue'){if(_0x4c184b['keyType']===_0x501d('0x5')&&_0x4c184b[_0x501d('0xe')]){_0x17edaf[_0x501d('0x6')](util[_0x501d('0xf')](_0x501d('0x10'),_0x4c184b[_0x501d('0xe')],_0x4c184b['keyContent']));}else if(_0x4c184b[_0x501d('0x11')]===_0x501d('0x8')&&_0x4c184b[_0x501d('0x9')]&&_0x4c184b['key']){_0x4a3641[_0x4c184b[_0x501d('0x9')]]&&_0x17edaf[_0x501d('0x6')](util[_0x501d('0xf')](_0x501d('0x10'),_0x4c184b['key'],_0x4a3641[_0x4c184b['variableName']]));}else if(_0x4c184b[_0x501d('0x11')]===_0x501d('0x12')&&_0x4c184b['Variable']&&_0x4c184b[_0x501d('0xb')][_0x501d('0xc')]&&_0x4c184b[_0x501d('0xe')]){_0x4a3641[_0x4c184b[_0x501d('0xb')]['name']['toLowerCase']()]&&_0x17edaf[_0x501d('0x6')](util['format'](_0x501d('0x10'),_0x4c184b[_0x501d('0xe')],_0x4a3641[_0x4c184b[_0x501d('0xb')]['name'][_0x501d('0xd')]()]));}}}}return _0x17edaf[_0x501d('0x13')](_0xb133d5);};exports[_0x501d('0x14')]=function(_0x472bae){var _0x44801c=_0x472bae[_0x501d('0x15')](-0x1);if(_0x44801c==='/'){_0x472bae=_0x472bae[_0x501d('0x16')](0x0,_0x472bae['lastIndexOf'](_0x44801c));}return _0x472bae;};exports[_0x501d('0x17')]=function(_0x16fa06){if(!_[_0x501d('0x18')](_0x16fa06)&&_0x16fa06!==''){var _0x45a2da=/^(([^<>()\[\]\\.,;:\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 _0x45a2da[_0x501d('0x19')](String(_0x16fa06)[_0x501d('0xd')]());}else{return![];}}; \ No newline at end of file +var _0x2651=['keyType','string','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','lastIndexOf','isNil','test','lodash','getString','sortBy','length','type','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue'];(function(_0x4c7be4,_0x3e314b){var _0x39e2d1=function(_0x4da425){while(--_0x4da425){_0x4c7be4['push'](_0x4c7be4['shift']());}};_0x39e2d1(++_0x3e314b);}(_0x2651,0xc1));var _0x1265=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x2651[_0x5834bc];return _0x3e183a;};'use strict';var _=require(_0x1265('0x0'));var util=require('util');exports[_0x1265('0x1')]=function(_0x3ad127,_0x1fbf48,_0x41236a){var _0x2fc638=[];if(_0x3ad127['length']>0x0){var _0x447294=_[_0x1265('0x2')](_0x3ad127,['id']);for(var _0x51ea1c=0x0;_0x51ea1c<_0x447294[_0x1265('0x3')];_0x51ea1c++){var _0xdea988=_0x447294[_0x51ea1c];if(_0xdea988[_0x1265('0x4')]==='string'){_0x2fc638[_0x1265('0x5')](_0xdea988[_0x1265('0x6')]);}else if(_0xdea988[_0x1265('0x4')]===_0x1265('0x7')&&_0xdea988['variableName']){_0x1fbf48[_0xdea988[_0x1265('0x8')]]&&_0x2fc638[_0x1265('0x5')](_0x1fbf48[_0xdea988[_0x1265('0x8')]][_0x1265('0x9')]());}else if(_0xdea988[_0x1265('0x4')]===_0x1265('0xa')&&_0xdea988['Variable']&&_0xdea988[_0x1265('0xb')][_0x1265('0xc')]){_0x1fbf48[_0xdea988[_0x1265('0xb')][_0x1265('0xc')]['toLowerCase']()]&&_0x2fc638['push'](_0x1fbf48[_0xdea988[_0x1265('0xb')][_0x1265('0xc')][_0x1265('0xd')]()][_0x1265('0x9')]());}else if(_0xdea988['type']===_0x1265('0xe')){if(_0xdea988[_0x1265('0xf')]===_0x1265('0x10')&&_0xdea988[_0x1265('0x11')]){_0x2fc638['push'](util[_0x1265('0x12')](_0x1265('0x13'),_0xdea988[_0x1265('0x11')],_0xdea988[_0x1265('0x14')]));}else if(_0xdea988[_0x1265('0xf')]==='variable'&&_0xdea988[_0x1265('0x8')]&&_0xdea988[_0x1265('0x11')]){_0x1fbf48[_0xdea988['variableName']]&&_0x2fc638[_0x1265('0x5')](util[_0x1265('0x12')](_0x1265('0x13'),_0xdea988[_0x1265('0x11')],_0x1fbf48[_0xdea988[_0x1265('0x8')]]));}else if(_0xdea988['keyType']===_0x1265('0xa')&&_0xdea988[_0x1265('0xb')]&&_0xdea988[_0x1265('0xb')][_0x1265('0xc')]&&_0xdea988[_0x1265('0x11')]){_0x1fbf48[_0xdea988[_0x1265('0xb')][_0x1265('0xc')][_0x1265('0xd')]()]&&_0x2fc638['push'](util['format'](_0x1265('0x13'),_0xdea988['key'],_0x1fbf48[_0xdea988[_0x1265('0xb')][_0x1265('0xc')][_0x1265('0xd')]()]));}}}}return _0x2fc638[_0x1265('0x15')](_0x41236a);};exports[_0x1265('0x16')]=function(_0xec8f9b){var _0x4c7106=_0xec8f9b['slice'](-0x1);if(_0x4c7106==='/'){_0xec8f9b=_0xec8f9b['substring'](0x0,_0xec8f9b[_0x1265('0x17')](_0x4c7106));}return _0xec8f9b;};exports['validateEmail']=function(_0xd0b349){if(!_[_0x1265('0x18')](_0xd0b349)&&_0xd0b349!==''){var _0xd7c036=/^(([^<>()\[\]\\.,;:\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 _0xd7c036[_0x1265('0x19')](String(_0xd0b349)[_0x1265('0xd')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 0cce6df..55c72be 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x187c7f,_0x17bb75){var _0x291034=function(_0x4c472c){while(--_0x4c472c){_0x187c7f['push'](_0x187c7f['shift']());}};_0x291034(++_0x17bb75);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'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(_0x56cdc6,_0x50ba73){var _0x2dba5a=function(_0x44f255){while(--_0x44f255){_0x56cdc6['push'](_0x56cdc6['shift']());}};_0x2dba5a(++_0x50ba73);}(_0xe706,0xa3));var _0x6e70=function(_0x1f1bf8,_0x48c57d){_0x1f1bf8=_0x1f1bf8-0x0;var _0xcefd99=_0xe706[_0x1f1bf8];return _0xcefd99;};'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 diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 17dab10..4b37c7e 100644 --- a/server/services/ami/trigger/integration/zendesk.js +++ b/server/services/ami/trigger/integration/zendesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8365=['push','content','variable','variableName','custom_fields','customVariable','Variable','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','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','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','[OUTBOUND]','recordingURL','email','destcalleridname','destcalleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','/api/v2','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','%s/search.json','remoteUri','count','Agent\x20found!','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','user','authType','password','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','stringify','map','includes','picklist','type','nameField','toLowerCase','idField','customField'];(function(_0x552b08,_0x8fbec8){var _0x145d1b=function(_0x4ec2d2){while(--_0x4ec2d2){_0x552b08['push'](_0x552b08['shift']());}};_0x145d1b(++_0x8fbec8);}(_0x8365,0x105));var _0x5836=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x8365[_0x2642cb];return _0xe6e41;};'use strict';var _=require(_0x5836('0x0'));var rp=require(_0x5836('0x1'));var md5=require('md5');var util=require(_0x5836('0x2'));var Redis=require('ioredis');var intUtil=require(_0x5836('0x3'));var config=require(_0x5836('0x4'));var logger=require(_0x5836('0x5'))('zendesk');config[_0x5836('0x6')]=_[_0x5836('0x7')](config[_0x5836('0x6')],{'host':_0x5836('0x8'),'port':0x18eb});var io=require(_0x5836('0x9'))(new Redis(config[_0x5836('0x6')]));function emit(_0x40dd1a,_0x20719c,_0x6a9a21){io['to'](_0x40dd1a)[_0x5836('0xa')](_0x20719c,_0x6a9a21);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x377d3e,_0x153cb5,_0xc10399,_0x5dd7cc,_0x1f07aa){logger[_0x5836('0xb')](_0x5836('0xc'));return request({'uri':util[_0x5836('0xd')](_0x5836('0xe'),_0x377d3e['remoteUri']),'method':_0x5836('0xf'),'body':{'ticket':_[_0x5836('0x10')]({'requester_id':_0xc10399['id'],'submitter_id':_0x153cb5?_0x153cb5['id']:undefined,'assignee_id':_0x153cb5?_0x153cb5['id']:undefined,'tags':getTags(_0x5dd7cc[_0x5836('0x11')],_0x5836('0x12')),'subject':intUtil[_0x5836('0x13')](_0x5dd7cc[_0x5836('0x14')],_0x1f07aa,'\x20'),'description':intUtil[_0x5836('0x13')](_0x5dd7cc[_0x5836('0x15')],_0x1f07aa,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x5dd7cc['Descriptions'],_0x1f07aa,'\x0a')}},getCustomFields(_0x5dd7cc[_0x5836('0x16')],_0x1f07aa))}})[_0x5836('0x17')](function(_0x242e8d){logger['info'](_0x5836('0x18'));return _0x242e8d[_0x5836('0x19')];});}function getUser(_0x1352e4,_0x3e40d1){if(intUtil[_0x5836('0x1a')](_0x3e40d1)){logger['info']('Getting\x20agent\x20with\x20email',_0x3e40d1);return request({'uri':util[_0x5836('0xd')](_0x5836('0x1b'),_0x1352e4[_0x5836('0x1c')]),'qs':{'query':util[_0x5836('0xd')]('type:user\x20role:agent\x20email:%s',_0x3e40d1)}})[_0x5836('0x17')](function(_0x2ba245){if(_0x2ba245[_0x5836('0x1d')]){logger[_0x5836('0xb')](_0x5836('0x1e'));return _['find'](_0x2ba245[_0x5836('0x1f')],{'email':_0x3e40d1,'role':'agent'});}else{logger['info'](_0x5836('0x20'));return request({'uri':util[_0x5836('0xd')]('%s/users/me.json',_0x1352e4[_0x5836('0x1c')])})[_0x5836('0x17')](function(_0x3140a3){logger[_0x5836('0xb')]('Admin\x20account\x20selected.');return _0x3140a3['user'];});}});}else{logger[_0x5836('0xb')](_0x5836('0x20'));return request({'uri':util[_0x5836('0xd')](_0x5836('0x21'),_0x1352e4['remoteUri'])})[_0x5836('0x17')](function(_0x24cec8){logger['info'](_0x5836('0x22'));return _0x24cec8['user'];});}}function getEndUser(_0x386920,_0x585323,_0x638d4a){logger['info']('Searching\x20enduser\x20with\x20phone',_0x638d4a);return request({'uri':util['format'](_0x5836('0x1b'),_0x386920[_0x5836('0x1c')]),'qs':{'query':util[_0x5836('0xd')](_0x5836('0x23'),_0x638d4a)}})['then'](function(_0x2c1b89){var _0xe0e64c;if(_0x2c1b89[_0x5836('0x1f')][_0x5836('0x24')]){_0x2c1b89['results']=_[_0x5836('0x25')](_0x2c1b89[_0x5836('0x1f')],{'suspended':![],'role':_0x5836('0x26')});if(_0x2c1b89[_0x5836('0x1f')]['length']){_0xe0e64c=_['first'](_0x2c1b89[_0x5836('0x1f')]);}}if(_0xe0e64c){logger[_0x5836('0xb')](_0x5836('0x27'));return _0xe0e64c;}else{logger[_0x5836('0xb')](_0x5836('0x28'));return request({'uri':util[_0x5836('0xd')](_0x5836('0x29'),_0x386920[_0x5836('0x1c')]),'method':_0x5836('0xf'),'body':{'user':{'role':_0x5836('0x26'),'name':util[_0x5836('0xd')](_0x5836('0x2a'),_0x585323||_0x638d4a),'phone':_0x638d4a}}})[_0x5836('0x17')](function(_0xfac375){logger['info'](_0x5836('0x2b'));return _0xfac375[_0x5836('0x2c')];});}});}function getAuth(_0x2a5d82){var _0x5a3811;if(_0x2a5d82[_0x5836('0x2d')]===_0x5836('0x2e')){_0x5a3811=util['format']('%s:%s',_0x2a5d82[_0x5836('0x2f')],_0x2a5d82['password']);}else if(_0x2a5d82[_0x5836('0x2d')]===_0x5836('0x30')){_0x5a3811=util['format'](_0x5836('0x31'),_0x2a5d82[_0x5836('0x2f')],_0x2a5d82[_0x5836('0x30')]);}return util['format'](_0x5836('0x32'),new Buffer(_0x5a3811)[_0x5836('0x33')](_0x5836('0x34')));}function request(_0x5b1800){logger[_0x5836('0x35')]('[HTTP]',JSON[_0x5836('0x36')](_0x5b1800));return rp(_[_0x5836('0x7')](_0x5b1800,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x4124a3,_0x5015c8){var _0x39ffd0=[];if(_0x4124a3&&_0x4124a3[_0x5836('0x24')]>0x0){_0x39ffd0=_[_0x5836('0x37')](_0x4124a3,_0x5015c8);}return _0x39ffd0;}function getCustomFields(_0x3c2d2a,_0x4734b6){var _0x25456d=[];var _0x3f1b0b={'custom_fields':[]};if(_0x3c2d2a[_0x5836('0x24')]>0x0){_['forEach'](_0x3c2d2a,function(_0x3f8149){if(_[_0x5836('0x38')](['string',_0x5836('0x39')],_0x3f8149[_0x5836('0x3a')])&&_0x3f8149[_0x5836('0x3b')]&&!_0x3f8149['customField']){_0x3f1b0b[_0x3f8149[_0x5836('0x3b')][_0x5836('0x3c')]()]=_0x3f8149['content'][_0x5836('0x33')]();}else if(_['includes'](['string',_0x5836('0x39')],_0x3f8149[_0x5836('0x3a')])&&_0x3f8149[_0x5836('0x3d')]&&_0x3f8149[_0x5836('0x3e')]){_0x3f1b0b['custom_fields'][_0x5836('0x3f')]({'id':_0x3f8149['idField'],'value':_0x3f8149[_0x5836('0x40')][_0x5836('0x33')]()});}else if(_0x3f8149[_0x5836('0x3a')]===_0x5836('0x41')&&_0x3f8149['variableName']&&_0x3f8149[_0x5836('0x3d')]&&_0x3f8149[_0x5836('0x3e')]){_0x4734b6[_0x3f8149[_0x5836('0x42')]]&&_0x3f1b0b[_0x5836('0x43')][_0x5836('0x3f')]({'id':_0x3f8149[_0x5836('0x3d')],'value':_0x4734b6[_0x3f8149[_0x5836('0x42')]][_0x5836('0x33')]()});}else if(_0x3f8149[_0x5836('0x3a')]===_0x5836('0x44')&&_0x3f8149[_0x5836('0x45')]&&_0x3f8149['Variable']['name']&&_0x3f8149['idField']&&_0x3f8149['customField']){_0x4734b6[_0x3f8149[_0x5836('0x45')][_0x5836('0x12')][_0x5836('0x3c')]()]&&_0x3f1b0b[_0x5836('0x43')]['push']({'id':_0x3f8149[_0x5836('0x3d')],'value':_0x4734b6[_0x3f8149[_0x5836('0x45')][_0x5836('0x12')]['toLowerCase']()][_0x5836('0x33')]()});}});}return _0x3f1b0b;}exports['queue']=function(_0x4b04ac,_0x11d093,_0x315fa6,_0x1ce644,_0x44597f,_0x1e2a54){var _0x47cb75,_0x157b4f;_0x1e2a54[_0x5836('0x1c')]=intUtil['stripTrailingSlash'](_0x1e2a54[_0x5836('0x1c')]);_0x1e2a54[_0x5836('0x46')]=intUtil[_0x5836('0x47')](_0x1e2a54[_0x5836('0x46')]);if(_0x44597f&&_0x44597f[_0x5836('0x48')]){logger[_0x5836('0xb')](_0x5836('0x49'),_0x5836('0x4a'));_0x11d093['recordingURL']=util[_0x5836('0xd')](_0x5836('0x4b'),_0x1e2a54['serverUrl'],_0x11d093[_0x5836('0x4c')],md5(_0x11d093[_0x5836('0x4c')]));}else{_0x11d093['recordingURL']='';}headers[_0x5836('0x4d')]=getAuth(_0x1e2a54);return getUser(_0x1e2a54,_0x1ce644['email'])['then'](function(_0xa3b7b2){_0x47cb75=_0xa3b7b2;logger['info'](_0x5836('0x4e'),_0x47cb75['id']);return getEndUser(_0x1e2a54,_0x11d093[_0x5836('0x4f')],_0x11d093[_0x5836('0x50')]);})['then'](function(_0x432b6e){_0x157b4f=_0x432b6e;logger[_0x5836('0xb')](_0x5836('0x51'),_0x157b4f['id']);return getTicket(_0x1e2a54,_0x47cb75,_0x157b4f,_0x315fa6,_0x11d093);})[_0x5836('0x17')](function(_0x59e764){if(_0x59e764){logger[_0x5836('0xb')](_0x5836('0x52'),_0x59e764['id']);switch(_0x1e2a54['type']){case'integrationTab':logger[_0x5836('0xb')](_0x5836('0x49'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x5836('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x1e2a54['remoteUri'],_0x47cb75['id'],_0x59e764['id']),'method':_0x5836('0xf')});case _0x5836('0x53'):logger[_0x5836('0xb')]('[QUEUE]',_0x5836('0x54'));emit(util[_0x5836('0xd')](_0x5836('0x55'),_0x1ce644[_0x5836('0x12')]),_0x5836('0x56'),{'uri':util[_0x5836('0xd')](_0x5836('0x57'),_0x1e2a54[_0x5836('0x1c')][_0x5836('0x58')]('/api/v2',''),_0x59e764['id'])});break;default:logger[_0x5836('0x59')]('[QUEUE]',_0x5836('0x5a'));}}})['catch'](function(_0x488501){logger[_0x5836('0x59')](_0x5836('0x5b'),util[_0x5836('0x5c')](_0x488501,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x550cab,_0x1a422f,_0xf7f38,_0x5f01d4,_0x2f1ab8,_0x30b8aa,_0x576852){var _0x14cea5,_0x5ee290;_0x30b8aa[_0x5836('0x1c')]=intUtil['stripTrailingSlash'](_0x30b8aa[_0x5836('0x1c')]);_0x30b8aa[_0x5836('0x46')]=intUtil['stripTrailingSlash'](_0x30b8aa[_0x5836('0x46')]);if(_0x576852&&_0x576852['recordingFormat']&&_0x576852[_0x5836('0x5d')]!=='none'){logger[_0x5836('0xb')](_0x5836('0x5e'),_0x5836('0x4a'));_0x1a422f[_0x5836('0x5f')]=util[_0x5836('0xd')](_0x5836('0x4b'),_0x30b8aa['serverUrl'],_0x1a422f[_0x5836('0x4c')],md5(_0x1a422f[_0x5836('0x4c')]));}headers[_0x5836('0x4d')]=getAuth(_0x30b8aa);return getUser(_0x30b8aa,_0x5f01d4[_0x5836('0x60')])['then'](function(_0x3fcb4e){_0x14cea5=_0x3fcb4e;logger[_0x5836('0xb')]('The\x20User\x20ID\x20is:',_0x14cea5['id']);return getEndUser(_0x30b8aa,_0x1a422f[_0x5836('0x61')],_0x1a422f[_0x5836('0x62')]);})[_0x5836('0x17')](function(_0xa4e560){_0x5ee290=_0xa4e560;logger[_0x5836('0xb')]('The\x20Enduser\x20ID\x20is:',_0x5ee290['id']);return getTicket(_0x30b8aa,_0x14cea5,_0x5ee290,_0xf7f38,_0x1a422f);})[_0x5836('0x17')](function(_0x28a6be){if(_0x28a6be){logger['info'](_0x5836('0x52'),_0x28a6be['id']);switch(_0x30b8aa[_0x5836('0x3a')]){case _0x5836('0x63'):logger['info'](_0x5836('0x5e'),_0x5836('0x64'));return request({'uri':util[_0x5836('0xd')](_0x5836('0x65'),_0x30b8aa[_0x5836('0x1c')],_0x14cea5['id'],_0x28a6be['id']),'method':'POST'});case _0x5836('0x53'):logger[_0x5836('0xb')](_0x5836('0x5e'),_0x5836('0x54'));emit(util[_0x5836('0xd')](_0x5836('0x55'),_0x5f01d4['name']),_0x5836('0x56'),{'uri':util['format'](_0x5836('0x57'),_0x30b8aa['remoteUri'][_0x5836('0x58')](_0x5836('0x66'),''),_0x28a6be['id'])});break;default:logger[_0x5836('0x59')]('[OUTBOUND]',_0x5836('0x5a'));}}})[_0x5836('0x67')](function(_0x1135c1){logger[_0x5836('0x59')](_0x5836('0x68'),util[_0x5836('0x5c')](_0x1135c1,{'showHidden':!![],'depth':null}));});};exports[_0x5836('0x69')]=function(_0x1e7cf0,_0x21d38a,_0x581da1,_0x5092e6,_0x4aeea7,_0x4f90e8){var _0x5793ce,_0x2ba32d;_0x4f90e8[_0x5836('0x1c')]=intUtil[_0x5836('0x47')](_0x4f90e8[_0x5836('0x1c')]);_0x4f90e8['serverUrl']=intUtil[_0x5836('0x47')](_0x4f90e8['serverUrl']);if(_0x4aeea7&&_0x4aeea7[_0x5836('0x48')]){logger['info']('['+_0x21d38a['lastevent'][_0x5836('0x6a')]()+']',_0x5836('0x4a'));_0x21d38a['recordingURL']=util[_0x5836('0xd')](_0x5836('0x4b'),_0x4f90e8[_0x5836('0x46')],_0x21d38a['uniqueid'],md5(_0x21d38a[_0x5836('0x4c')]));}else{_0x21d38a[_0x5836('0x5f')]='';}headers[_0x5836('0x4d')]=getAuth(_0x4f90e8);return getUser(_0x4f90e8)['then'](function(_0x16624e){_0x5793ce=_0x16624e;logger[_0x5836('0xb')](_0x5836('0x4e'),_0x5793ce['id']);return getEndUser(_0x4f90e8,_0x21d38a[_0x5836('0x4f')],_0x21d38a['calleridnum']);})[_0x5836('0x17')](function(_0x4cc57b){_0x2ba32d=_0x4cc57b;logger[_0x5836('0xb')](_0x5836('0x51'),_0x2ba32d['id']);return getTicket(_0x4f90e8,_0x5793ce,_0x2ba32d,_0x581da1,_0x21d38a);})[_0x5836('0x17')](function(_0x4819b6){if(_0x4819b6){logger[_0x5836('0xb')](_0x5836('0x52'),_0x4819b6['id']);}})[_0x5836('0x67')](function(_0x2f9b95){logger[_0x5836('0x59')]('['+_0x21d38a['lastevent']['toUpperCase']()+']'+_0x5836('0x6b'),util['inspect'](_0x2f9b95,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xb05e=['toLowerCase','includes','custom_fields','idField','content','toString','type','variable','variableName','push','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','error','outbound','recordingFormat','[OUTBOUND]','destcalleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','%s/agent/tickets/%s','catch','inspect','toUpperCase','calleridname','calleridnum','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','%s:%s','username','password','authType','token','%s/token:%s','base64','stringify','GET','map','forEach','string','picklist','customField','nameField'];(function(_0xcd5094,_0x4cffa4){var _0x54ba35=function(_0x2bfe43){while(--_0x2bfe43){_0xcd5094['push'](_0xcd5094['shift']());}};_0x54ba35(++_0x4cffa4);}(_0xb05e,0x109));var _0xeb05=function(_0x31a70d,_0x1cdbac){_0x31a70d=_0x31a70d-0x0;var _0x57b422=_0xb05e[_0x31a70d];return _0x57b422;};'use strict';var _=require(_0xeb05('0x0'));var rp=require(_0xeb05('0x1'));var md5=require(_0xeb05('0x2'));var util=require(_0xeb05('0x3'));var Redis=require('ioredis');var intUtil=require(_0xeb05('0x4'));var config=require('../../../../config/environment');var logger=require(_0xeb05('0x5'))('zendesk');config['redis']=_[_0xeb05('0x6')](config[_0xeb05('0x7')],{'host':_0xeb05('0x8'),'port':0x18eb});var io=require(_0xeb05('0x9'))(new Redis(config[_0xeb05('0x7')]));function emit(_0x5b9147,_0x47853,_0x33989e){io['to'](_0x5b9147)[_0xeb05('0xa')](_0x47853,_0x33989e);}var headers={'Content-Type':_0xeb05('0xb'),'Accept':_0xeb05('0xb')};function getTicket(_0x1bf19d,_0x86f753,_0x399c1c,_0x19340e,_0x16bab9){logger[_0xeb05('0xc')](_0xeb05('0xd'));return request({'uri':util[_0xeb05('0xe')](_0xeb05('0xf'),_0x1bf19d[_0xeb05('0x10')]),'method':_0xeb05('0x11'),'body':{'ticket':_['merge']({'requester_id':_0x399c1c['id'],'submitter_id':_0x86f753?_0x86f753['id']:undefined,'assignee_id':_0x86f753?_0x86f753['id']:undefined,'tags':getTags(_0x19340e[_0xeb05('0x12')],_0xeb05('0x13')),'subject':intUtil[_0xeb05('0x14')](_0x19340e[_0xeb05('0x15')],_0x16bab9,'\x20'),'description':intUtil['getString'](_0x19340e[_0xeb05('0x16')],_0x16bab9,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x19340e[_0xeb05('0x16')],_0x16bab9,'\x0a')}},getCustomFields(_0x19340e[_0xeb05('0x17')],_0x16bab9))}})[_0xeb05('0x18')](function(_0x3538da){logger[_0xeb05('0xc')](_0xeb05('0x19'));return _0x3538da[_0xeb05('0x1a')];});}function getUser(_0x52fad4,_0x10b093){if(intUtil[_0xeb05('0x1b')](_0x10b093)){logger[_0xeb05('0xc')](_0xeb05('0x1c'),_0x10b093);return request({'uri':util['format'](_0xeb05('0x1d'),_0x52fad4[_0xeb05('0x10')]),'qs':{'query':util[_0xeb05('0xe')](_0xeb05('0x1e'),_0x10b093)}})[_0xeb05('0x18')](function(_0x43137b){if(_0x43137b[_0xeb05('0x1f')]){logger[_0xeb05('0xc')]('Agent\x20found!');return _[_0xeb05('0x20')](_0x43137b[_0xeb05('0x21')],{'email':_0x10b093,'role':_0xeb05('0x22')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xeb05('0xe')](_0xeb05('0x23'),_0x52fad4[_0xeb05('0x10')])})[_0xeb05('0x18')](function(_0x519b3b){logger[_0xeb05('0xc')](_0xeb05('0x24'));return _0x519b3b['user'];});}});}else{logger['info'](_0xeb05('0x25'));return request({'uri':util[_0xeb05('0xe')]('%s/users/me.json',_0x52fad4[_0xeb05('0x10')])})[_0xeb05('0x18')](function(_0x387db7){logger[_0xeb05('0xc')](_0xeb05('0x24'));return _0x387db7[_0xeb05('0x26')];});}}function getEndUser(_0x187e5b,_0x16aaaa,_0x5b61c3){logger[_0xeb05('0xc')](_0xeb05('0x27'),_0x5b61c3);return request({'uri':util['format']('%s/search.json',_0x187e5b[_0xeb05('0x10')]),'qs':{'query':util[_0xeb05('0xe')](_0xeb05('0x28'),_0x5b61c3)}})[_0xeb05('0x18')](function(_0x1d42c2){var _0x4521a5;if(_0x1d42c2['results'][_0xeb05('0x29')]){_0x1d42c2[_0xeb05('0x21')]=_['filter'](_0x1d42c2[_0xeb05('0x21')],{'suspended':![],'role':_0xeb05('0x2a')});if(_0x1d42c2[_0xeb05('0x21')][_0xeb05('0x29')]){_0x4521a5=_['first'](_0x1d42c2[_0xeb05('0x21')]);}}if(_0x4521a5){logger[_0xeb05('0xc')](_0xeb05('0x2b'));return _0x4521a5;}else{logger[_0xeb05('0xc')](_0xeb05('0x2c'));return request({'uri':util[_0xeb05('0xe')](_0xeb05('0x2d'),_0x187e5b[_0xeb05('0x10')]),'method':_0xeb05('0x11'),'body':{'user':{'role':_0xeb05('0x2a'),'name':util['format'](_0xeb05('0x2e'),_0x16aaaa||_0x5b61c3),'phone':_0x5b61c3}}})[_0xeb05('0x18')](function(_0x1e58e0){logger['info']('Enduser\x20created.');return _0x1e58e0[_0xeb05('0x26')];});}});}function getAuth(_0x7a42a9){var _0x2feb3c;if(_0x7a42a9['authType']==='password'){_0x2feb3c=util[_0xeb05('0xe')](_0xeb05('0x2f'),_0x7a42a9[_0xeb05('0x30')],_0x7a42a9[_0xeb05('0x31')]);}else if(_0x7a42a9[_0xeb05('0x32')]===_0xeb05('0x33')){_0x2feb3c=util[_0xeb05('0xe')](_0xeb05('0x34'),_0x7a42a9[_0xeb05('0x30')],_0x7a42a9[_0xeb05('0x33')]);}return util['format']('Basic\x20%s',new Buffer(_0x2feb3c)['toString'](_0xeb05('0x35')));}function request(_0x5b3bb5){logger['debug']('[HTTP]',JSON[_0xeb05('0x36')](_0x5b3bb5));return rp(_[_0xeb05('0x6')](_0x5b3bb5,{'method':_0xeb05('0x37'),'headers':headers,'json':!![]}));}function getTags(_0xfeef9a,_0x3e4e02){var _0x49292b=[];if(_0xfeef9a&&_0xfeef9a['length']>0x0){_0x49292b=_[_0xeb05('0x38')](_0xfeef9a,_0x3e4e02);}return _0x49292b;}function getCustomFields(_0x100dbc,_0x129ab4){var _0x4f9da7=[];var _0x154ae9={'custom_fields':[]};if(_0x100dbc[_0xeb05('0x29')]>0x0){_[_0xeb05('0x39')](_0x100dbc,function(_0x3e2861){if(_['includes']([_0xeb05('0x3a'),_0xeb05('0x3b')],_0x3e2861['type'])&&_0x3e2861['nameField']&&!_0x3e2861[_0xeb05('0x3c')]){_0x154ae9[_0x3e2861[_0xeb05('0x3d')][_0xeb05('0x3e')]()]=_0x3e2861['content']['toString']();}else if(_[_0xeb05('0x3f')]([_0xeb05('0x3a'),_0xeb05('0x3b')],_0x3e2861['type'])&&_0x3e2861['idField']&&_0x3e2861[_0xeb05('0x3c')]){_0x154ae9[_0xeb05('0x40')]['push']({'id':_0x3e2861[_0xeb05('0x41')],'value':_0x3e2861[_0xeb05('0x42')][_0xeb05('0x43')]()});}else if(_0x3e2861[_0xeb05('0x44')]===_0xeb05('0x45')&&_0x3e2861[_0xeb05('0x46')]&&_0x3e2861['idField']&&_0x3e2861[_0xeb05('0x3c')]){_0x129ab4[_0x3e2861[_0xeb05('0x46')]]&&_0x154ae9[_0xeb05('0x40')][_0xeb05('0x47')]({'id':_0x3e2861[_0xeb05('0x41')],'value':_0x129ab4[_0x3e2861[_0xeb05('0x46')]][_0xeb05('0x43')]()});}else if(_0x3e2861[_0xeb05('0x44')]==='customVariable'&&_0x3e2861[_0xeb05('0x48')]&&_0x3e2861[_0xeb05('0x48')][_0xeb05('0x13')]&&_0x3e2861['idField']&&_0x3e2861[_0xeb05('0x3c')]){_0x129ab4[_0x3e2861[_0xeb05('0x48')][_0xeb05('0x13')][_0xeb05('0x3e')]()]&&_0x154ae9[_0xeb05('0x40')][_0xeb05('0x47')]({'id':_0x3e2861[_0xeb05('0x41')],'value':_0x129ab4[_0x3e2861[_0xeb05('0x48')][_0xeb05('0x13')]['toLowerCase']()][_0xeb05('0x43')]()});}});}return _0x154ae9;}exports[_0xeb05('0x49')]=function(_0x47f627,_0x35ae55,_0x4e58ed,_0x3acec2,_0xe84f69,_0x11f151){var _0x1495db,_0x584f67;_0x11f151[_0xeb05('0x10')]=intUtil[_0xeb05('0x4a')](_0x11f151[_0xeb05('0x10')]);_0x11f151[_0xeb05('0x4b')]=intUtil['stripTrailingSlash'](_0x11f151[_0xeb05('0x4b')]);if(_0xe84f69&&_0xe84f69[_0xeb05('0x4c')]){logger[_0xeb05('0xc')](_0xeb05('0x4d'),_0xeb05('0x4e'));_0x35ae55[_0xeb05('0x4f')]=util[_0xeb05('0xe')](_0xeb05('0x50'),_0x11f151[_0xeb05('0x4b')],_0x35ae55[_0xeb05('0x51')],md5(_0x35ae55['uniqueid']));}else{_0x35ae55['recordingURL']='';}headers[_0xeb05('0x52')]=getAuth(_0x11f151);return getUser(_0x11f151,_0x3acec2[_0xeb05('0x53')])[_0xeb05('0x18')](function(_0x475545){_0x1495db=_0x475545;logger[_0xeb05('0xc')](_0xeb05('0x54'),_0x1495db['id']);return getEndUser(_0x11f151,_0x35ae55['calleridname'],_0x35ae55['calleridnum']);})[_0xeb05('0x18')](function(_0x2eaca6){_0x584f67=_0x2eaca6;logger[_0xeb05('0xc')](_0xeb05('0x55'),_0x584f67['id']);return getTicket(_0x11f151,_0x1495db,_0x584f67,_0x4e58ed,_0x35ae55);})['then'](function(_0x52083b){if(_0x52083b){logger[_0xeb05('0xc')]('The\x20Ticket\x20ID\x20is:',_0x52083b['id']);switch(_0x11f151['type']){case'integrationTab':logger[_0xeb05('0xc')](_0xeb05('0x4d'),_0xeb05('0x56'));return request({'uri':util[_0xeb05('0xe')](_0xeb05('0x57'),_0x11f151['remoteUri'],_0x1495db['id'],_0x52083b['id']),'method':_0xeb05('0x11')});case'newTab':logger[_0xeb05('0xc')](_0xeb05('0x4d'),_0xeb05('0x58'));emit(util['format'](_0xeb05('0x59'),_0x3acec2['name']),_0xeb05('0x5a'),{'uri':util['format']('%s/agent/tickets/%s',_0x11f151[_0xeb05('0x10')][_0xeb05('0x5b')](_0xeb05('0x5c'),''),_0x52083b['id'])});break;default:logger['error']('[QUEUE]',_0xeb05('0x5d'));}}})['catch'](function(_0x2afb96){logger[_0xeb05('0x5e')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x2afb96,{'showHidden':!![],'depth':null}));});};exports[_0xeb05('0x5f')]=function(_0x177d02,_0x597248,_0x47b19d,_0x22debf,_0x3d7d06,_0x4d5f05,_0x396f81){var _0x5e9468,_0x459e7f;_0x4d5f05[_0xeb05('0x10')]=intUtil[_0xeb05('0x4a')](_0x4d5f05[_0xeb05('0x10')]);_0x4d5f05[_0xeb05('0x4b')]=intUtil['stripTrailingSlash'](_0x4d5f05[_0xeb05('0x4b')]);if(_0x396f81&&_0x396f81[_0xeb05('0x60')]&&_0x396f81[_0xeb05('0x60')]!=='none'){logger[_0xeb05('0xc')](_0xeb05('0x61'),_0xeb05('0x4e'));_0x597248[_0xeb05('0x4f')]=util[_0xeb05('0xe')](_0xeb05('0x50'),_0x4d5f05['serverUrl'],_0x597248[_0xeb05('0x51')],md5(_0x597248[_0xeb05('0x51')]));}headers['Authorization']=getAuth(_0x4d5f05);return getUser(_0x4d5f05,_0x22debf[_0xeb05('0x53')])['then'](function(_0x2d04f3){_0x5e9468=_0x2d04f3;logger[_0xeb05('0xc')]('The\x20User\x20ID\x20is:',_0x5e9468['id']);return getEndUser(_0x4d5f05,_0x597248['destcalleridname'],_0x597248[_0xeb05('0x62')]);})[_0xeb05('0x18')](function(_0x1619a9){_0x459e7f=_0x1619a9;logger['info']('The\x20Enduser\x20ID\x20is:',_0x459e7f['id']);return getTicket(_0x4d5f05,_0x5e9468,_0x459e7f,_0x47b19d,_0x597248);})[_0xeb05('0x18')](function(_0x533388){if(_0x533388){logger['info'](_0xeb05('0x63'),_0x533388['id']);switch(_0x4d5f05[_0xeb05('0x44')]){case _0xeb05('0x64'):logger[_0xeb05('0xc')](_0xeb05('0x61'),_0xeb05('0x56'));return request({'uri':util[_0xeb05('0xe')](_0xeb05('0x57'),_0x4d5f05['remoteUri'],_0x5e9468['id'],_0x533388['id']),'method':_0xeb05('0x11')});case'newTab':logger[_0xeb05('0xc')](_0xeb05('0x61'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xeb05('0xe')]('user:%s',_0x22debf[_0xeb05('0x13')]),_0xeb05('0x5a'),{'uri':util['format'](_0xeb05('0x65'),_0x4d5f05[_0xeb05('0x10')]['replace'](_0xeb05('0x5c'),''),_0x533388['id'])});break;default:logger[_0xeb05('0x5e')](_0xeb05('0x61'),_0xeb05('0x5d'));}}})[_0xeb05('0x66')](function(_0x3386a){logger[_0xeb05('0x5e')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xeb05('0x67')](_0x3386a,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x188fa7,_0x2e4d64,_0x2bde1c,_0x329960,_0x5acfc7,_0x158061){var _0x4ed82a,_0x144d04;_0x158061[_0xeb05('0x10')]=intUtil['stripTrailingSlash'](_0x158061[_0xeb05('0x10')]);_0x158061[_0xeb05('0x4b')]=intUtil[_0xeb05('0x4a')](_0x158061['serverUrl']);if(_0x5acfc7&&_0x5acfc7[_0xeb05('0x4c')]){logger['info']('['+_0x2e4d64['lastevent'][_0xeb05('0x68')]()+']',_0xeb05('0x4e'));_0x2e4d64[_0xeb05('0x4f')]=util[_0xeb05('0xe')](_0xeb05('0x50'),_0x158061[_0xeb05('0x4b')],_0x2e4d64[_0xeb05('0x51')],md5(_0x2e4d64[_0xeb05('0x51')]));}else{_0x2e4d64[_0xeb05('0x4f')]='';}headers[_0xeb05('0x52')]=getAuth(_0x158061);return getUser(_0x158061)[_0xeb05('0x18')](function(_0x3e4251){_0x4ed82a=_0x3e4251;logger[_0xeb05('0xc')](_0xeb05('0x54'),_0x4ed82a['id']);return getEndUser(_0x158061,_0x2e4d64[_0xeb05('0x69')],_0x2e4d64[_0xeb05('0x6a')]);})[_0xeb05('0x18')](function(_0x198afd){_0x144d04=_0x198afd;logger[_0xeb05('0xc')](_0xeb05('0x55'),_0x144d04['id']);return getTicket(_0x158061,_0x4ed82a,_0x144d04,_0x2bde1c,_0x2e4d64);})['then'](function(_0xb1d7){if(_0xb1d7){logger[_0xeb05('0xc')](_0xeb05('0x63'),_0xb1d7['id']);}})[_0xeb05('0x66')](function(_0x2e7c5c){logger[_0xeb05('0x5e')]('['+_0x2e4d64[_0xeb05('0x6b')][_0xeb05('0x68')]()+']'+_0xeb05('0x6c'),util[_0xeb05('0x67')](_0x2e7c5c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zoho.js b/server/services/ami/trigger/integration/zoho.js index 49852eb..d7e958c 100644 --- a/server/services/ami/trigger/integration/zoho.js +++ b/server/services/ami/trigger/integration/zoho.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e14=['outbound','agentcalledAt','Inbound','merge','/crm/v2/Calls','code','Call\x20created!','err','queue','host','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','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...','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','destcalleridname','Outbound','user:%s','unmanaged','monitor_format','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','[HTTP]','stringify','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Using\x20the\x20admin\x20account!','Administrator','user','The\x20failing\x20result\x20is','https://www.zohoapis.','startCase','role','first_name','last_name','data','SUCCESS','details','enduserType','moduleCreate','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Leads','Creating\x20new\x20call...','Owner','profile','administrator','Subject','getString','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','called','Call_Result','Called','complete','Answered','rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0x5e14,0x164));var _0x45e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e14[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x45e1('0x0'));var rp=require(_0x45e1('0x1'));var md5=require(_0x45e1('0x2'));var util=require(_0x45e1('0x3'));var intUtil=require(_0x45e1('0x4'));var moment=require(_0x45e1('0x5'));var Redis=require(_0x45e1('0x6'));var BPromise=require(_0x45e1('0x7'));var config=require(_0x45e1('0x8'));var logger=require(_0x45e1('0x9'))(_0x45e1('0xa'));config[_0x45e1('0xb')]=_[_0x45e1('0xc')](config[_0x45e1('0xb')],{'host':_0x45e1('0xd'),'port':0x18eb});var io=require(_0x45e1('0xe'))(new Redis(config[_0x45e1('0xb')]));function emit(_0x4062de,_0x2296b3,_0x128854){io['to'](_0x4062de)[_0x45e1('0xf')](_0x2296b3,_0x128854);}function request(_0x1c57cf){logger['debug'](_0x45e1('0x10'),JSON[_0x45e1('0x11')](_0x1c57cf));return rp(_0x1c57cf);}function getCustomFields(_0x3f45ac,_0x514726){var _0x2f58a3={};if(_0x3f45ac['length']>0x0){_[_0x45e1('0x12')](_0x3f45ac,function(_0x257ac8){if(_[_0x45e1('0x13')]([_0x45e1('0x14'),_0x45e1('0x15')],_0x257ac8[_0x45e1('0x16')])&&_0x257ac8[_0x45e1('0x17')]){_0x2f58a3[_0x257ac8['idField']]=_0x257ac8[_0x45e1('0x18')][_0x45e1('0x19')]();}else if(_0x257ac8[_0x45e1('0x16')]===_0x45e1('0x1a')&&_0x257ac8[_0x45e1('0x1b')]&&_0x257ac8[_0x45e1('0x17')]&&_0x514726[_0x257ac8[_0x45e1('0x1b')]]){_0x2f58a3[_0x257ac8['idField']]=_0x514726[_0x257ac8['variableName']][_0x45e1('0x19')]();}else if(_0x257ac8['type']==='customVariable'&&_0x257ac8['Variable']&&_0x257ac8[_0x45e1('0x1c')][_0x45e1('0x1d')]&&_0x257ac8[_0x45e1('0x17')]&&_0x514726[_0x257ac8[_0x45e1('0x1c')][_0x45e1('0x1d')][_0x45e1('0x1e')]()]){_0x2f58a3[_0x257ac8[_0x45e1('0x17')]]=_0x514726[_0x257ac8[_0x45e1('0x1c')]['name'][_0x45e1('0x1e')]()]['toString']();}});}return _0x2f58a3;}function getName(_0x3134f4){if(_0x3134f4[_0x45e1('0x1f')]('\x20')>0x0){var _0x1f2c01=_0x3134f4[_0x45e1('0x20')](/ (.+)/);if(_0x1f2c01[0x1]){return _0x1f2c01;}}return[_0x3134f4,_0x3134f4];}var accountsTokens={};function getAccessToken(_0x393fdf){return new Promise(function(_0x4f4884,_0x34d043){if(!_[_0x45e1('0x21')](accountsTokens[_0x393fdf['id']])&&!_[_0x45e1('0x21')](accountsTokens[_0x393fdf['id']][_0x45e1('0x22')])){if(moment()[_0x45e1('0x23')](accountsTokens[_0x393fdf['id']][_0x45e1('0x24')])){_0x4f4884(accountsTokens[_0x393fdf['id']][_0x45e1('0x22')]);}}var _0x2bdd53;switch(_0x393fdf[_0x45e1('0x25')]){case'US':_0x2bdd53=_0x45e1('0x26');break;case'AU':_0x2bdd53=_0x45e1('0x27');break;case'EU':_0x2bdd53=_0x45e1('0x28');break;case'IN':_0x2bdd53=_0x45e1('0x29');break;case'CN':_0x2bdd53=_0x45e1('0x2a');break;default:_0x2bdd53=_0x45e1('0x28');break;}var _0x2d615a={'method':_0x45e1('0x2b'),'uri':_0x2bdd53+_0x45e1('0x2c'),'qs':{'refresh_token':_0x393fdf[_0x45e1('0x2d')],'client_id':_0x393fdf[_0x45e1('0x2e')],'client_secret':_0x393fdf[_0x45e1('0x2f')],'grant_type':_0x45e1('0x30')},'json':!![]};return rp(_0x2d615a)[_0x45e1('0x31')](function(_0x668f14){accountsTokens[_0x393fdf['id']]={'access_token':_0x668f14[_0x45e1('0x22')],'expires_in':moment()[_0x45e1('0x32')](_0x668f14[_0x45e1('0x24')],_0x45e1('0x33'))};_0x4f4884(_0x668f14[_0x45e1('0x22')]);})[_0x45e1('0x34')](function(_0x541a9a){logger[_0x45e1('0x35')]('Failing\x20creating\x20the\x20access_token',_0x541a9a[_0x45e1('0x36')]);_0x34d043(_0x541a9a);});});}function getUser(_0x1b97ff,_0x4fccf0,_0x2f42f2,_0x327b22){logger[_0x45e1('0x37')](_0x45e1('0x38'));return request({'method':_0x45e1('0x39'),'uri':util[_0x45e1('0x3a')](_0x45e1('0x3b'),_0x4fccf0),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x45e1('0x3c')+_0x1b97ff},'json':!![]})['then'](function(_0x2c87e0){if(_0x2c87e0[_0x45e1('0x3d')]){var _0x3df426=-0x1;if(_[_0x45e1('0x3e')](_0x2c87e0['users'])){if(!_['isNil'](_0x327b22)){_0x3df426=_[_0x45e1('0x3f')](_0x2c87e0['users'],function(_0x36e74a){return _0x36e74a[_0x45e1('0x40')]===_0x327b22;});}if(_0x3df426>=0x0){logger[_0x45e1('0x37')]('Agent\x20found!');}else{logger[_0x45e1('0x37')](_0x45e1('0x41'));_0x3df426=_[_0x45e1('0x3f')](_0x2c87e0[_0x45e1('0x3d')],function(_0x2658f8){return _0x2658f8['profile'][_0x45e1('0x1d')]===_0x45e1('0x42');});}return _0x2c87e0[_0x45e1('0x3d')][_0x3df426];}else{if(_0x2c87e0['user']['profile'][_0x45e1('0x1d')]===_0x45e1('0x42')){logger['info']('Using\x20the\x20admin\x20account!');user=_0x2c87e0[_0x45e1('0x43')];return user;}else{logger[_0x45e1('0x35')]('The\x20failing\x20result\x20is',JSON[_0x45e1('0x11')](_0x2c87e0));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x45e1('0x11')](_0x2c87e0));}}}else{logger[_0x45e1('0x35')](_0x45e1('0x44'),JSON['stringify'](_0x2c87e0));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x45e1('0x11')](_0x2c87e0));}})[_0x45e1('0x34')](function(_0x2bd459){console[_0x45e1('0x35')](_0x2bd459);});}function getZohoUser(_0x5e0b48,_0x4b3d8f){return new BPromise(function(_0x537556,_0x14b90c){request(_0x5e0b48)[_0x45e1('0x31')](function(_0x2c1500){var _0x534357=null;if(_0x2c1500){_0x534357=_0x2c1500['data'][0x0];_0x534357['enduserType']=_0x4b3d8f;}_0x537556(_0x534357);})[_0x45e1('0x34')](function(_0x114a13){_0x14b90c(_0x114a13);});});}function createEndUser(_0x466cac,_0x134210,_0xf264db,_0x2ef57b,_0x566b6f,_0x14ced3){var _0xf264db=getName(_0xf264db);return request({'method':_0x45e1('0x2b'),'uri':_0x45e1('0x45')+_0x134210+'/crm/v2/'+_[_0x45e1('0x46')](_0x14ced3['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0xf264db[0x1],'First_Name':_0xf264db[0x0],'Phone':_0x2ef57b,'Owner':{'name':!_[_0x45e1('0x21')](_0x566b6f['role'][_0x45e1('0x1d')])?_0x566b6f[_0x45e1('0x47')][_0x45e1('0x1d')]:!_[_0x45e1('0x21')](_0x566b6f[_0x45e1('0x48')])?_0x566b6f['first_name']+'\x20'+_0x566b6f[_0x45e1('0x49')]:_0x566b6f[_0x45e1('0x49')],'id':_0x566b6f['id']}}]},'headers':{'Authorization':_0x45e1('0x3c')+_0x466cac},'json':!![]})[_0x45e1('0x31')](function(_0x1c1a10){if(_0x1c1a10&&_0x1c1a10[_0x45e1('0x4a')][0x0]['code']===_0x45e1('0x4b')){var _0x859bb3=_0x1c1a10['data'][0x0][_0x45e1('0x4c')];_0x859bb3[_0x45e1('0x4d')]=_[_0x45e1('0x46')](_0x14ced3[_0x45e1('0x4e')])+'s';return _0x859bb3;}logger[_0x45e1('0x35')](_0x45e1('0x44'),JSON[_0x45e1('0x11')](data));throw new Error(_0x45e1('0x4f')+JSON[_0x45e1('0x11')](data));})[_0x45e1('0x34')](function(_0x10629e){console[_0x45e1('0x50')](_0x45e1('0x51'),_0x10629e);});}function getEndUser(_0x307c42,_0x20f299,_0x480f13,_0x138f48,_0x24fe84,_0x7362,_0x2f9b98){var _0x112d67={'method':_0x45e1('0x39'),'uri':'','headers':{'Authorization':_0x45e1('0x3c')+_0x307c42},'json':!![]};switch(_0x2f9b98[_0x45e1('0x52')]){case _0x45e1('0x53'):_0x112d67[_0x45e1('0x54')]=_0x45e1('0x45')+_0x20f299+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x24fe84+'))';return getZohoUser(_0x112d67,_0x45e1('0x55'))['then'](function(_0x21f7e9){if(_0x21f7e9)return _0x21f7e9;_0x112d67[_0x45e1('0x54')]=_0x45e1('0x45')+_0x20f299+_0x45e1('0x56')+_0x24fe84+'))';return getZohoUser(_0x112d67,'Leads')[_0x45e1('0x31')](function(_0x38f779){if(_0x38f779)return _0x38f779;if(_0x2f9b98[_0x45e1('0x4e')]!=_0x45e1('0x57')){return createEndUser(_0x307c42,_0x20f299,_0x138f48,_0x24fe84,_0x7362,_0x2f9b98);}else{return{};}});});break;case _0x45e1('0x58'):_0x112d67[_0x45e1('0x54')]='https://www.zohoapis.'+_0x20f299+_0x45e1('0x59')+_0x24fe84+'))';return getZohoUser(_0x112d67,_0x45e1('0x55'))[_0x45e1('0x31')](function(_0x43bba4){if(_0x43bba4)return _0x43bba4;if(_0x2f9b98['moduleCreate']!=_0x45e1('0x57')){return createEndUser(_0x307c42,_0x20f299,_0x138f48,_0x24fe84,_0x7362,_0x2f9b98);}else{return{};}});break;case _0x45e1('0x5a'):_0x112d67[_0x45e1('0x54')]=_0x45e1('0x45')+_0x20f299+_0x45e1('0x56')+_0x24fe84+'))';return getZohoUser(_0x112d67,_0x45e1('0x5b'))[_0x45e1('0x31')](function(_0x36e1e2){if(_0x36e1e2)return _0x36e1e2;if(_0x2f9b98[_0x45e1('0x4e')]!=_0x45e1('0x57')){return createEndUser(_0x307c42,_0x20f299,_0x138f48,_0x24fe84,_0x7362,_0x2f9b98);}else{return{};}});break;}}function getCall(_0x53f2f4,_0x2e9a34,_0x273043,_0x3234f1,_0x2126a9,_0x5f1be7,_0x2a5a99,_0x10d9ff){logger['info'](_0x45e1('0x5c'));var _0x46caae={};_0x46caae[_0x45e1('0x5d')]={'name':!_[_0x45e1('0x21')](_0x3234f1[_0x45e1('0x47')]['name'])&&!_[_0x45e1('0x21')](_0x3234f1[_0x45e1('0x5e')][_0x45e1('0x1d')])&&_0x3234f1[_0x45e1('0x5e')]['name']===_0x45e1('0x5f')?_0x3234f1[_0x45e1('0x47')]['name']:!_[_0x45e1('0x21')](_0x3234f1[_0x45e1('0x48')])?_0x3234f1[_0x45e1('0x48')]+'\x20'+_0x3234f1[_0x45e1('0x49')]:_0x3234f1[_0x45e1('0x49')],'id':_0x3234f1['id']};_0x46caae[_0x45e1('0x60')]=intUtil['getString'](_0x5f1be7['Subjects'],_0x2a5a99,'\x20');_0x46caae['Description']=intUtil[_0x45e1('0x61')](_0x5f1be7['Descriptions'],_0x2a5a99,'\x0a');if(_0x2126a9[_0x45e1('0x4d')]===_0x45e1('0x55')){_0x46caae[_0x45e1('0x62')]={'name':!_['isNil'](_0x2126a9[_0x45e1('0x63')])?_0x2126a9[_0x45e1('0x63')]:!_[_0x45e1('0x21')](_0x2126a9[_0x45e1('0x64')])?_0x2126a9[_0x45e1('0x64')]+'\x20'+_0x2126a9['Last_Name']:_0x2126a9[_0x45e1('0x65')],'id':_0x2126a9['id']};}if(_0x2126a9[_0x45e1('0x4d')]===_0x45e1('0x5b')){_0x46caae[_0x45e1('0x66')]={'name':!_[_0x45e1('0x21')](_0x2126a9[_0x45e1('0x63')])?_0x2126a9[_0x45e1('0x63')]:!_['isNil'](_0x2126a9[_0x45e1('0x64')])?_0x2126a9[_0x45e1('0x64')]+'\x20'+_0x2126a9[_0x45e1('0x65')]:_0x2126a9[_0x45e1('0x65')],'id':_0x2126a9['id']};_0x46caae[_0x45e1('0x67')]=_[_0x45e1('0x46')](_0x2126a9[_0x45e1('0x4d')]);}if(_0x2a5a99[_0x45e1('0x68')]){_0x46caae[_0x45e1('0x69')]=moment[_0x45e1('0x6a')](parseInt(_0x2a5a99['talktime'])*0x3e8)[_0x45e1('0x3a')](_0x45e1('0x6b'));}else if(_0x2a5a99[_0x45e1('0x6c')]&&_0x2a5a99[_0x45e1('0x6d')]){_0x46caae['Call_Duration']=moment[_0x45e1('0x6a')](moment(_0x2a5a99[_0x45e1('0x6d')],'YYYY-MM-DDTHH:mm:ss')[_0x45e1('0x6e')](moment(_0x2a5a99[_0x45e1('0x6f')],_0x45e1('0x70'))))['format'](_0x45e1('0x6b'));}switch(_0x2a5a99['lastevent']){case _0x45e1('0x71'):_0x46caae[_0x45e1('0x72')]=_0x45e1('0x73');break;case _0x45e1('0x74'):case'connect':_0x46caae['Call_Result']=_0x45e1('0x75');break;case _0x45e1('0x76'):_0x46caae[_0x45e1('0x72')]='Rejected';break;case _0x45e1('0x77'):_0x46caae[_0x45e1('0x72')]=_0x45e1('0x78');break;case _0x45e1('0x79'):_0x46caae['Call_Result']=_0x45e1('0x7a');default:}_0x46caae[_0x45e1('0x7b')]=(_0x10d9ff===_0x45e1('0x7c')?moment(_0x2a5a99[_0x45e1('0x6f')])[_0x45e1('0x3a')](_0x45e1('0x70')):moment(_0x2a5a99[_0x45e1('0x7d')])[_0x45e1('0x3a')](_0x45e1('0x70')))||moment()['format'](_0x45e1('0x70'));_0x46caae['Call_Type']=_0x10d9ff||_0x45e1('0x7e');_0x46caae=_[_0x45e1('0x7f')](_0x46caae,getCustomFields(_0x5f1be7['Fields'],_0x2a5a99));return request({'method':_0x45e1('0x2b'),'uri':_0x45e1('0x45')+_0x2e9a34+_0x45e1('0x80'),'headers':{'Authorization':_0x45e1('0x3c')+_0x53f2f4},'body':{'data':[_0x46caae]},'json':!![]})[_0x45e1('0x31')](function(_0x422c9b){if(_0x422c9b&&_0x422c9b[_0x45e1('0x4a')][0x0][_0x45e1('0x81')]===_0x45e1('0x4b')){logger[_0x45e1('0x37')](_0x45e1('0x82'));return{'id':_0x422c9b[_0x45e1('0x4a')][0x0][_0x45e1('0x4c')]['id']};}})[_0x45e1('0x34')](function(_0x3aa63a){logger['info'](_0x45e1('0x83'),_0x3aa63a[_0x45e1('0x36')]);console[_0x45e1('0x50')](_0x45e1('0x83'),_0x3aa63a);});}exports[_0x45e1('0x84')]=function(_0xf29469,_0x14eff9,_0x12afc0,_0x3bf436,_0x4c1afd,_0xb45629){var _0x4661de,_0x116711,_0x4f7bd4;_0xb45629[_0x45e1('0x85')]=intUtil['stripTrailingSlash'](_0xb45629['host']);_0xb45629[_0x45e1('0x86')]=intUtil[_0x45e1('0x87')](_0xb45629['serverUrl']);if(_0x4c1afd&&_0x4c1afd['monitor_format']){logger[_0x45e1('0x37')](_0x45e1('0x88'),_0x45e1('0x89'));_0x14eff9[_0x45e1('0x8a')]=_0xb45629[_0x45e1('0x86')]+_0x45e1('0x8b')+_0x14eff9['uniqueid']+_0x45e1('0x8c')+md5(_0x14eff9[_0x45e1('0x8d')]);}else{_0x14eff9[_0x45e1('0x8a')]='';}var _0x2af5bc=_0xb45629[_0x45e1('0x85')]===_0x45e1('0x8e')?'eu':_0x45e1('0x8f');return getAccessToken(_0xb45629)['then'](function(_0x523b7f){_0x4f7bd4=_0x523b7f;return getUser(_0x4f7bd4,_0x2af5bc,_0xb45629,_0x3bf436[_0x45e1('0x40')]);})['then'](function(_0x518b44){_0x4661de=_0x518b44;logger[_0x45e1('0x37')](_0x45e1('0x90'),_0x4661de['id']);return getEndUser(_0x4f7bd4,_0x2af5bc,_0xb45629,_0x14eff9[_0x45e1('0x91')],_0x14eff9[_0x45e1('0x92')],_0x4661de,_0x12afc0);})[_0x45e1('0x31')](function(_0x295edf){_0x116711=_0x295edf;return getCall(_0x4f7bd4,_0x2af5bc,_0xb45629,_0x4661de,_0x116711,_0x12afc0,_0x14eff9,_0x45e1('0x7e'));})[_0x45e1('0x31')](function(_0x295481){if(_0x295481){logger['info'](_0x45e1('0x93'),_0x295481['id']);logger[_0x45e1('0x37')](_0x45e1('0x88'),_0x45e1('0x94'));emit(util['format']('user:%s',_0x3bf436['name']),_0x45e1('0x95'),{'uri':'https://crm.'+_0xb45629[_0x45e1('0x85')]+_0x45e1('0x96')+_0x295481['id']});}})[_0x45e1('0x34')](function(_0x273709){logger[_0x45e1('0x35')](_0x45e1('0x88'),JSON['stringify'](_0x273709));});};exports[_0x45e1('0x7c')]=function(_0x3e4589,_0x15a96a,_0x1f6753,_0x1242e1,_0x141a3b,_0x2e7374,_0xf12da5){var _0x84481c,_0x315040,_0x577a2b;_0x2e7374[_0x45e1('0x85')]=intUtil['stripTrailingSlash'](_0x2e7374[_0x45e1('0x85')]);_0x2e7374[_0x45e1('0x86')]=intUtil[_0x45e1('0x87')](_0x2e7374[_0x45e1('0x86')]);if(_0xf12da5&&_0xf12da5[_0x45e1('0x97')]&&_0xf12da5[_0x45e1('0x97')]!=='none'){logger[_0x45e1('0x37')](_0x45e1('0x98'),'Recording\x20is\x20enabled!');_0x15a96a[_0x45e1('0x8a')]=_0x2e7374[_0x45e1('0x86')]+'/api/voice/recordings/'+_0x15a96a[_0x45e1('0x8d')]+'/downloads?type=uniqueid&token='+md5(_0x15a96a[_0x45e1('0x8d')]);}var _0x5ed00c=_0x2e7374[_0x45e1('0x85')]===_0x45e1('0x8e')?'eu':_0x45e1('0x8f');return getAccessToken(_0x2e7374)[_0x45e1('0x31')](function(_0x1da8ce){_0x577a2b=_0x1da8ce;return getUser(_0x577a2b,_0x5ed00c,_0x2e7374,_0x1242e1[_0x45e1('0x40')]);})[_0x45e1('0x31')](function(_0x26cab0){_0x84481c=_0x26cab0;logger['info']('The\x20User\x20ID\x20is:',_0x84481c['id']);return getEndUser(_0x577a2b,_0x5ed00c,_0x2e7374,_0x15a96a[_0x45e1('0x99')],_0x15a96a['destcalleridnum'],_0x84481c,_0x1f6753);})['then'](function(_0x72e054){_0x315040=_0x72e054;return getCall(_0x577a2b,_0x5ed00c,_0x2e7374,_0x84481c,_0x315040,_0x1f6753,_0x15a96a,_0x45e1('0x9a'));})[_0x45e1('0x31')](function(_0x42f46e){if(_0x42f46e){logger[_0x45e1('0x37')](_0x45e1('0x93'),_0x42f46e['id']);logger[_0x45e1('0x37')](_0x45e1('0x98'),_0x45e1('0x94'));emit(util[_0x45e1('0x3a')](_0x45e1('0x9b'),_0x1242e1[_0x45e1('0x1d')]),_0x45e1('0x95'),{'uri':'https://crm.'+_0x2e7374[_0x45e1('0x85')]+_0x45e1('0x96')+_0x42f46e['id']});}})[_0x45e1('0x34')](function(_0x190a93){logger[_0x45e1('0x35')]('[OUTBOUND]',JSON['stringify'](_0x190a93));});};exports[_0x45e1('0x9c')]=function(_0x2d9455,_0x1e781e,_0x4ce0e1,_0x279148,_0x115358,_0x31c2e6){var _0x58f309,_0x3fe214,_0x5284bc;_0x31c2e6['host']=intUtil[_0x45e1('0x87')](_0x31c2e6[_0x45e1('0x85')]);_0x31c2e6[_0x45e1('0x86')]=intUtil[_0x45e1('0x87')](_0x31c2e6[_0x45e1('0x86')]);if(_0x115358&&_0x115358[_0x45e1('0x9d')]){logger[_0x45e1('0x37')]('['+_0x1e781e[_0x45e1('0x9e')][_0x45e1('0x9f')]()+']','Recording\x20is\x20enabled!');_0x1e781e[_0x45e1('0x8a')]=_0x31c2e6['serverUrl']+_0x45e1('0x8b')+_0x1e781e['uniqueid']+_0x45e1('0x8c')+md5(_0x1e781e[_0x45e1('0x8d')]);}else{_0x1e781e['recordingURL']='';}var _0x45e8bf=_0x31c2e6[_0x45e1('0x85')]==='zoho.eu'?'eu':_0x45e1('0x8f');return getAccessToken(_0x31c2e6)[_0x45e1('0x31')](function(_0x3f134a){_0x5284bc=_0x3f134a;return getUser(_0x5284bc,_0x45e8bf,_0x31c2e6);})[_0x45e1('0x31')](function(_0x41554c){_0x58f309=_0x41554c;logger[_0x45e1('0x37')](_0x45e1('0x90'),_0x58f309['id']);return getEndUser(_0x5284bc,_0x45e8bf,_0x31c2e6,_0x1e781e[_0x45e1('0x91')],_0x1e781e[_0x45e1('0x92')],_0x58f309,_0x4ce0e1);})[_0x45e1('0x31')](function(_0x14a4b8){_0x3fe214=_0x14a4b8;return getCall(_0x5284bc,_0x45e8bf,_0x31c2e6,_0x58f309,_0x3fe214,_0x4ce0e1,_0x1e781e,_0x45e1('0x7e'));})[_0x45e1('0x31')](function(_0x464dc5){if(_0x464dc5){logger[_0x45e1('0x37')](_0x45e1('0x93'),_0x464dc5['id']);}})['catch'](function(_0x29bb55){logger[_0x45e1('0x35')]('['+_0x1e781e[_0x45e1('0x9e')][_0x45e1('0x9f')]()+']',JSON['stringify'](_0x29bb55));});}; \ No newline at end of file +var _0x0e7a=['info','profile','Administrator','user','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','Creating\x20new\x20call...','Owner','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','format','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Called','complete','connect','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Call_Start_Time','agentcalledAt','Call_Type','Fields','/crm/v2/Calls','Call\x20created!','stack','err','queue','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','outbound','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','/downloads?type=uniqueid&token=','destcalleridname','destcalleridnum','Outbound','unmanaged','toUpperCase','lodash','request-promise','md5','util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','debug','stringify','length','forEach','includes','string','picklist','idField','content','toString','variableName','type','Variable','name','toLowerCase','indexOf','isNil','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.eu','POST','refreshToken','refresh_token','add','catch','error','Failing\x20creating\x20the\x20access_token','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','then','users','isArrayLikeObject','findIndex','email'];(function(_0x1e5354,_0x309302){var _0x21b00f=function(_0x3073b6){while(--_0x3073b6){_0x1e5354['push'](_0x1e5354['shift']());}};_0x21b00f(++_0x309302);}(_0x0e7a,0xff));var _0xa0e7=function(_0x5712fa,_0x3b7818){_0x5712fa=_0x5712fa-0x0;var _0x3d7e1b=_0x0e7a[_0x5712fa];return _0x3d7e1b;};'use strict';var _=require(_0xa0e7('0x0'));var rp=require(_0xa0e7('0x1'));var md5=require(_0xa0e7('0x2'));var util=require(_0xa0e7('0x3'));var intUtil=require('./util');var moment=require(_0xa0e7('0x4'));var Redis=require(_0xa0e7('0x5'));var BPromise=require(_0xa0e7('0x6'));var config=require(_0xa0e7('0x7'));var logger=require(_0xa0e7('0x8'))('zoho');config[_0xa0e7('0x9')]=_[_0xa0e7('0xa')](config[_0xa0e7('0x9')],{'host':_0xa0e7('0xb'),'port':0x18eb});var io=require(_0xa0e7('0xc'))(new Redis(config[_0xa0e7('0x9')]));function emit(_0x3a1986,_0x4f7a98,_0xef8303){io['to'](_0x3a1986)['emit'](_0x4f7a98,_0xef8303);}function request(_0xdab967){logger[_0xa0e7('0xd')]('[HTTP]',JSON[_0xa0e7('0xe')](_0xdab967));return rp(_0xdab967);}function getCustomFields(_0x16c2c6,_0x34b958){var _0x11cd0d={};if(_0x16c2c6[_0xa0e7('0xf')]>0x0){_[_0xa0e7('0x10')](_0x16c2c6,function(_0x35964c){if(_[_0xa0e7('0x11')]([_0xa0e7('0x12'),_0xa0e7('0x13')],_0x35964c['type'])&&_0x35964c[_0xa0e7('0x14')]){_0x11cd0d[_0x35964c[_0xa0e7('0x14')]]=_0x35964c[_0xa0e7('0x15')][_0xa0e7('0x16')]();}else if(_0x35964c['type']==='variable'&&_0x35964c[_0xa0e7('0x17')]&&_0x35964c[_0xa0e7('0x14')]&&_0x34b958[_0x35964c[_0xa0e7('0x17')]]){_0x11cd0d[_0x35964c[_0xa0e7('0x14')]]=_0x34b958[_0x35964c[_0xa0e7('0x17')]][_0xa0e7('0x16')]();}else if(_0x35964c[_0xa0e7('0x18')]==='customVariable'&&_0x35964c[_0xa0e7('0x19')]&&_0x35964c['Variable'][_0xa0e7('0x1a')]&&_0x35964c['idField']&&_0x34b958[_0x35964c['Variable'][_0xa0e7('0x1a')][_0xa0e7('0x1b')]()]){_0x11cd0d[_0x35964c[_0xa0e7('0x14')]]=_0x34b958[_0x35964c[_0xa0e7('0x19')][_0xa0e7('0x1a')][_0xa0e7('0x1b')]()][_0xa0e7('0x16')]();}});}return _0x11cd0d;}function getName(_0x47a7e5){if(_0x47a7e5[_0xa0e7('0x1c')]('\x20')>0x0){var _0x1b965a=_0x47a7e5['split'](/ (.+)/);if(_0x1b965a[0x1]){return _0x1b965a;}}return[_0x47a7e5,_0x47a7e5];}var accountsTokens={};function getAccessToken(_0x45affa){return new Promise(function(_0x277f66,_0x1c4712){if(!_[_0xa0e7('0x1d')](accountsTokens[_0x45affa['id']])&&!_[_0xa0e7('0x1d')](accountsTokens[_0x45affa['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x45affa['id']][_0xa0e7('0x1e')])){_0x277f66(accountsTokens[_0x45affa['id']][_0xa0e7('0x1f')]);}}var _0x12f261;switch(_0x45affa[_0xa0e7('0x20')]){case'US':_0x12f261=_0xa0e7('0x21');break;case'AU':_0x12f261='https://accounts.zoho.com.au';break;case'EU':_0x12f261=_0xa0e7('0x22');break;case'IN':_0x12f261='https://accounts.zoho.in';break;case'CN':_0x12f261='https://accounts.zoho.com.cn';break;default:_0x12f261=_0xa0e7('0x22');break;}var _0x38578f={'method':_0xa0e7('0x23'),'uri':_0x12f261+'/oauth/v2/token','qs':{'refresh_token':_0x45affa[_0xa0e7('0x24')],'client_id':_0x45affa['clientId'],'client_secret':_0x45affa['clientSecret'],'grant_type':_0xa0e7('0x25')},'json':!![]};return rp(_0x38578f)['then'](function(_0x1d0ac4){accountsTokens[_0x45affa['id']]={'access_token':_0x1d0ac4[_0xa0e7('0x1f')],'expires_in':moment()[_0xa0e7('0x26')](_0x1d0ac4[_0xa0e7('0x1e')],'seconds')};_0x277f66(_0x1d0ac4['access_token']);})[_0xa0e7('0x27')](function(_0x3f6b31){logger[_0xa0e7('0x28')](_0xa0e7('0x29'),_0x3f6b31['stack']);_0x1c4712(_0x3f6b31);});});}function getUser(_0x415084,_0x5bf934,_0xf7bf8,_0x3ef406){logger['info']('Search\x20user');return request({'method':'GET','uri':util['format'](_0xa0e7('0x2a'),_0x5bf934),'qs':{'type':_0xa0e7('0x2b')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x415084},'json':!![]})[_0xa0e7('0x2c')](function(_0xf0715a){if(_0xf0715a[_0xa0e7('0x2d')]){var _0x597565=-0x1;if(_[_0xa0e7('0x2e')](_0xf0715a[_0xa0e7('0x2d')])){if(!_['isNil'](_0x3ef406)){_0x597565=_[_0xa0e7('0x2f')](_0xf0715a[_0xa0e7('0x2d')],function(_0x53ad97){return _0x53ad97[_0xa0e7('0x30')]===_0x3ef406;});}if(_0x597565>=0x0){logger[_0xa0e7('0x31')]('Agent\x20found!');}else{logger[_0xa0e7('0x31')]('Using\x20the\x20admin\x20account!');_0x597565=_[_0xa0e7('0x2f')](_0xf0715a[_0xa0e7('0x2d')],function(_0x1fedc3){return _0x1fedc3[_0xa0e7('0x32')][_0xa0e7('0x1a')]===_0xa0e7('0x33');});}return _0xf0715a[_0xa0e7('0x2d')][_0x597565];}else{if(_0xf0715a[_0xa0e7('0x34')][_0xa0e7('0x32')][_0xa0e7('0x1a')]===_0xa0e7('0x33')){logger['info'](_0xa0e7('0x35'));user=_0xf0715a[_0xa0e7('0x34')];return user;}else{logger['error'](_0xa0e7('0x36'),JSON[_0xa0e7('0xe')](_0xf0715a));throw new Error(_0xa0e7('0x37')+JSON[_0xa0e7('0xe')](_0xf0715a));}}}else{logger[_0xa0e7('0x28')]('The\x20failing\x20result\x20is',JSON[_0xa0e7('0xe')](_0xf0715a));throw new Error(_0xa0e7('0x37')+JSON[_0xa0e7('0xe')](_0xf0715a));}})[_0xa0e7('0x27')](function(_0x13cd0b){console['error'](_0x13cd0b);});}function getZohoUser(_0x424bf7,_0x3cb5cf){return new BPromise(function(_0x23d0ff,_0x6bc09b){request(_0x424bf7)[_0xa0e7('0x2c')](function(_0x196085){var _0x3f34a5=null;if(_0x196085){_0x3f34a5=_0x196085[_0xa0e7('0x38')][0x0];_0x3f34a5[_0xa0e7('0x39')]=_0x3cb5cf;}_0x23d0ff(_0x3f34a5);})[_0xa0e7('0x27')](function(_0x100cb3){_0x6bc09b(_0x100cb3);});});}function createEndUser(_0xd6fc05,_0x3bc34a,_0x2ef3ff,_0x4dbdd4,_0x4de036,_0xd21d66){var _0x2ef3ff=getName(_0x2ef3ff);return request({'method':_0xa0e7('0x23'),'uri':_0xa0e7('0x3a')+_0x3bc34a+_0xa0e7('0x3b')+_[_0xa0e7('0x3c')](_0xd21d66[_0xa0e7('0x3d')])+'s','body':{'data':[{'Last_Name':_0x2ef3ff[0x1],'First_Name':_0x2ef3ff[0x0],'Phone':_0x4dbdd4,'Owner':{'name':!_[_0xa0e7('0x1d')](_0x4de036[_0xa0e7('0x3e')]['name'])?_0x4de036[_0xa0e7('0x3e')]['name']:!_[_0xa0e7('0x1d')](_0x4de036[_0xa0e7('0x3f')])?_0x4de036[_0xa0e7('0x3f')]+'\x20'+_0x4de036['last_name']:_0x4de036[_0xa0e7('0x40')],'id':_0x4de036['id']}}]},'headers':{'Authorization':_0xa0e7('0x41')+_0xd6fc05},'json':!![]})[_0xa0e7('0x2c')](function(_0x2cb24c){if(_0x2cb24c&&_0x2cb24c[_0xa0e7('0x38')][0x0][_0xa0e7('0x42')]===_0xa0e7('0x43')){var _0x559757=_0x2cb24c['data'][0x0][_0xa0e7('0x44')];_0x559757[_0xa0e7('0x39')]=_[_0xa0e7('0x3c')](_0xd21d66[_0xa0e7('0x3d')])+'s';return _0x559757;}logger[_0xa0e7('0x28')]('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error(_0xa0e7('0x45')+JSON[_0xa0e7('0xe')](data));})[_0xa0e7('0x27')](function(_0x1a753f){console[_0xa0e7('0x46')](_0xa0e7('0x47'),_0x1a753f);});}function getEndUser(_0x1f83d7,_0x2087f3,_0x1ae249,_0x2590e9,_0x595d8b,_0x3a419e,_0x238b8f){var _0x5715a2={'method':_0xa0e7('0x48'),'uri':'','headers':{'Authorization':_0xa0e7('0x41')+_0x1f83d7},'json':!![]};switch(_0x238b8f[_0xa0e7('0x49')]){case _0xa0e7('0x4a'):_0x5715a2['uri']=_0xa0e7('0x3a')+_0x2087f3+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x595d8b+'))';return getZohoUser(_0x5715a2,'Contacts')[_0xa0e7('0x2c')](function(_0x43b2d5){if(_0x43b2d5)return _0x43b2d5;_0x5715a2['uri']=_0xa0e7('0x3a')+_0x2087f3+_0xa0e7('0x4b')+_0x595d8b+'))';return getZohoUser(_0x5715a2,_0xa0e7('0x4c'))[_0xa0e7('0x2c')](function(_0x151c46){if(_0x151c46)return _0x151c46;if(_0x238b8f['moduleCreate']!=_0xa0e7('0x4d')){return createEndUser(_0x1f83d7,_0x2087f3,_0x2590e9,_0x595d8b,_0x3a419e,_0x238b8f);}else{return{};}});});break;case'contact':_0x5715a2['uri']=_0xa0e7('0x3a')+_0x2087f3+_0xa0e7('0x4e')+_0x595d8b+'))';return getZohoUser(_0x5715a2,_0xa0e7('0x4f'))[_0xa0e7('0x2c')](function(_0x240dd1){if(_0x240dd1)return _0x240dd1;if(_0x238b8f[_0xa0e7('0x3d')]!='nothing'){return createEndUser(_0x1f83d7,_0x2087f3,_0x2590e9,_0x595d8b,_0x3a419e,_0x238b8f);}else{return{};}});break;case'lead':_0x5715a2[_0xa0e7('0x50')]=_0xa0e7('0x3a')+_0x2087f3+_0xa0e7('0x4b')+_0x595d8b+'))';return getZohoUser(_0x5715a2,_0xa0e7('0x4c'))[_0xa0e7('0x2c')](function(_0x270e11){if(_0x270e11)return _0x270e11;if(_0x238b8f[_0xa0e7('0x3d')]!=_0xa0e7('0x4d')){return createEndUser(_0x1f83d7,_0x2087f3,_0x2590e9,_0x595d8b,_0x3a419e,_0x238b8f);}else{return{};}});break;}}function getCall(_0x52f9d6,_0x13c41a,_0x43d411,_0x2c3cab,_0x389a3f,_0x3e148f,_0x2527e8,_0x486517){logger[_0xa0e7('0x31')](_0xa0e7('0x51'));var _0x26421f={};_0x26421f[_0xa0e7('0x52')]={'name':!_['isNil'](_0x2c3cab[_0xa0e7('0x3e')][_0xa0e7('0x1a')])&&!_[_0xa0e7('0x1d')](_0x2c3cab[_0xa0e7('0x32')]['name'])&&_0x2c3cab[_0xa0e7('0x32')]['name']==='administrator'?_0x2c3cab['role']['name']:!_[_0xa0e7('0x1d')](_0x2c3cab['first_name'])?_0x2c3cab[_0xa0e7('0x3f')]+'\x20'+_0x2c3cab[_0xa0e7('0x40')]:_0x2c3cab[_0xa0e7('0x40')],'id':_0x2c3cab['id']};_0x26421f[_0xa0e7('0x53')]=intUtil[_0xa0e7('0x54')](_0x3e148f[_0xa0e7('0x55')],_0x2527e8,'\x20');_0x26421f[_0xa0e7('0x56')]=intUtil[_0xa0e7('0x54')](_0x3e148f[_0xa0e7('0x57')],_0x2527e8,'\x0a');if(_0x389a3f[_0xa0e7('0x39')]===_0xa0e7('0x4f')){_0x26421f[_0xa0e7('0x58')]={'name':!_['isNil'](_0x389a3f[_0xa0e7('0x59')])?_0x389a3f[_0xa0e7('0x59')]:!_['isNil'](_0x389a3f['First_Name'])?_0x389a3f[_0xa0e7('0x5a')]+'\x20'+_0x389a3f[_0xa0e7('0x5b')]:_0x389a3f[_0xa0e7('0x5b')],'id':_0x389a3f['id']};}if(_0x389a3f[_0xa0e7('0x39')]===_0xa0e7('0x4c')){_0x26421f[_0xa0e7('0x5c')]={'name':!_['isNil'](_0x389a3f[_0xa0e7('0x59')])?_0x389a3f[_0xa0e7('0x59')]:!_['isNil'](_0x389a3f[_0xa0e7('0x5a')])?_0x389a3f['First_Name']+'\x20'+_0x389a3f['Last_Name']:_0x389a3f[_0xa0e7('0x5b')],'id':_0x389a3f['id']};_0x26421f['$se_module']=_[_0xa0e7('0x3c')](_0x389a3f['enduserType']);}if(_0x2527e8[_0xa0e7('0x5d')]){_0x26421f[_0xa0e7('0x5e')]=moment[_0xa0e7('0x5f')](parseInt(_0x2527e8[_0xa0e7('0x5d')])*0x3e8)[_0xa0e7('0x60')](_0xa0e7('0x61'));}else if(_0x2527e8[_0xa0e7('0x62')]&&_0x2527e8[_0xa0e7('0x63')]){_0x26421f[_0xa0e7('0x5e')]=moment[_0xa0e7('0x5f')](moment(_0x2527e8[_0xa0e7('0x63')],_0xa0e7('0x64'))['diff'](moment(_0x2527e8['starttime'],_0xa0e7('0x64'))))[_0xa0e7('0x60')]('mm:ss');}switch(_0x2527e8[_0xa0e7('0x65')]){case _0xa0e7('0x66'):_0x26421f['Call_Result']=_0xa0e7('0x67');break;case _0xa0e7('0x68'):case _0xa0e7('0x69'):_0x26421f[_0xa0e7('0x6a')]=_0xa0e7('0x6b');break;case _0xa0e7('0x6c'):_0x26421f[_0xa0e7('0x6a')]=_0xa0e7('0x6d');break;case _0xa0e7('0x6e'):_0x26421f[_0xa0e7('0x6a')]=_0xa0e7('0x6f');break;case _0xa0e7('0x70'):_0x26421f['Call_Result']='Timeout';default:}_0x26421f[_0xa0e7('0x71')]=(_0x486517==='outbound'?moment(_0x2527e8['starttime'])['format'](_0xa0e7('0x64')):moment(_0x2527e8[_0xa0e7('0x72')])[_0xa0e7('0x60')](_0xa0e7('0x64')))||moment()['format'](_0xa0e7('0x64'));_0x26421f[_0xa0e7('0x73')]=_0x486517||'Inbound';_0x26421f=_['merge'](_0x26421f,getCustomFields(_0x3e148f[_0xa0e7('0x74')],_0x2527e8));return request({'method':_0xa0e7('0x23'),'uri':_0xa0e7('0x3a')+_0x13c41a+_0xa0e7('0x75'),'headers':{'Authorization':_0xa0e7('0x41')+_0x52f9d6},'body':{'data':[_0x26421f]},'json':!![]})[_0xa0e7('0x2c')](function(_0x236cac){if(_0x236cac&&_0x236cac[_0xa0e7('0x38')][0x0][_0xa0e7('0x42')]===_0xa0e7('0x43')){logger[_0xa0e7('0x31')](_0xa0e7('0x76'));return{'id':_0x236cac[_0xa0e7('0x38')][0x0][_0xa0e7('0x44')]['id']};}})[_0xa0e7('0x27')](function(_0x35f94e){logger[_0xa0e7('0x31')]('err',_0x35f94e[_0xa0e7('0x77')]);console[_0xa0e7('0x46')](_0xa0e7('0x78'),_0x35f94e);});}exports[_0xa0e7('0x79')]=function(_0x2ba8df,_0x398b50,_0x537fff,_0x4238e0,_0x116560,_0x254882){var _0x55e466,_0x4f3194,_0x35937b;_0x254882['host']=intUtil[_0xa0e7('0x7a')](_0x254882[_0xa0e7('0x7b')]);_0x254882[_0xa0e7('0x7c')]=intUtil[_0xa0e7('0x7a')](_0x254882[_0xa0e7('0x7c')]);if(_0x116560&&_0x116560[_0xa0e7('0x7d')]){logger[_0xa0e7('0x31')](_0xa0e7('0x7e'),_0xa0e7('0x7f'));_0x398b50['recordingURL']=_0x254882[_0xa0e7('0x7c')]+'/api/voice/recordings/'+_0x398b50[_0xa0e7('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x398b50[_0xa0e7('0x80')]);}else{_0x398b50[_0xa0e7('0x81')]='';}var _0x5b3cf6=_0x254882[_0xa0e7('0x7b')]===_0xa0e7('0x82')?'eu':_0xa0e7('0x83');return getAccessToken(_0x254882)[_0xa0e7('0x2c')](function(_0x3d5c4e){_0x35937b=_0x3d5c4e;return getUser(_0x35937b,_0x5b3cf6,_0x254882,_0x4238e0[_0xa0e7('0x30')]);})[_0xa0e7('0x2c')](function(_0x4d2cc6){_0x55e466=_0x4d2cc6;logger[_0xa0e7('0x31')](_0xa0e7('0x84'),_0x55e466['id']);return getEndUser(_0x35937b,_0x5b3cf6,_0x254882,_0x398b50[_0xa0e7('0x85')],_0x398b50[_0xa0e7('0x86')],_0x55e466,_0x537fff);})[_0xa0e7('0x2c')](function(_0x4a0e93){_0x4f3194=_0x4a0e93;return getCall(_0x35937b,_0x5b3cf6,_0x254882,_0x55e466,_0x4f3194,_0x537fff,_0x398b50,_0xa0e7('0x87'));})[_0xa0e7('0x2c')](function(_0x395ff6){if(_0x395ff6){logger[_0xa0e7('0x31')](_0xa0e7('0x88'),_0x395ff6['id']);logger[_0xa0e7('0x31')]('[QUEUE]',_0xa0e7('0x89'));emit(util[_0xa0e7('0x60')](_0xa0e7('0x8a'),_0x4238e0[_0xa0e7('0x1a')]),_0xa0e7('0x8b'),{'uri':_0xa0e7('0x8c')+_0x254882[_0xa0e7('0x7b')]+'/crm/EntityInfo.do?module=Calls&id='+_0x395ff6['id']});}})['catch'](function(_0x477a26){logger[_0xa0e7('0x28')](_0xa0e7('0x7e'),JSON[_0xa0e7('0xe')](_0x477a26));});};exports[_0xa0e7('0x8d')]=function(_0x4b5b69,_0x3fa25b,_0x4074ba,_0xb882f8,_0x9128ee,_0x3c944c,_0x247181){var _0x2f39e0,_0x56504b,_0xe7d7db;_0x3c944c[_0xa0e7('0x7b')]=intUtil[_0xa0e7('0x7a')](_0x3c944c['host']);_0x3c944c[_0xa0e7('0x7c')]=intUtil[_0xa0e7('0x7a')](_0x3c944c['serverUrl']);if(_0x247181&&_0x247181[_0xa0e7('0x8e')]&&_0x247181[_0xa0e7('0x8e')]!==_0xa0e7('0x8f')){logger['info'](_0xa0e7('0x90'),'Recording\x20is\x20enabled!');_0x3fa25b['recordingURL']=_0x3c944c[_0xa0e7('0x7c')]+_0xa0e7('0x91')+_0x3fa25b[_0xa0e7('0x80')]+_0xa0e7('0x92')+md5(_0x3fa25b['uniqueid']);}var _0xdfc26e=_0x3c944c['host']==='zoho.eu'?'eu':_0xa0e7('0x83');return getAccessToken(_0x3c944c)[_0xa0e7('0x2c')](function(_0x128b1d){_0xe7d7db=_0x128b1d;return getUser(_0xe7d7db,_0xdfc26e,_0x3c944c,_0xb882f8[_0xa0e7('0x30')]);})[_0xa0e7('0x2c')](function(_0x3be884){_0x2f39e0=_0x3be884;logger[_0xa0e7('0x31')](_0xa0e7('0x84'),_0x2f39e0['id']);return getEndUser(_0xe7d7db,_0xdfc26e,_0x3c944c,_0x3fa25b[_0xa0e7('0x93')],_0x3fa25b[_0xa0e7('0x94')],_0x2f39e0,_0x4074ba);})[_0xa0e7('0x2c')](function(_0x2cd46d){_0x56504b=_0x2cd46d;return getCall(_0xe7d7db,_0xdfc26e,_0x3c944c,_0x2f39e0,_0x56504b,_0x4074ba,_0x3fa25b,_0xa0e7('0x95'));})[_0xa0e7('0x2c')](function(_0x3fd83f){if(_0x3fd83f){logger[_0xa0e7('0x31')]('The\x20Call\x20ID\x20is:',_0x3fd83f['id']);logger[_0xa0e7('0x31')]('[OUTBOUND]',_0xa0e7('0x89'));emit(util[_0xa0e7('0x60')](_0xa0e7('0x8a'),_0xb882f8[_0xa0e7('0x1a')]),_0xa0e7('0x8b'),{'uri':_0xa0e7('0x8c')+_0x3c944c[_0xa0e7('0x7b')]+'/crm/EntityInfo.do?module=Calls&id='+_0x3fd83f['id']});}})[_0xa0e7('0x27')](function(_0x5ac77c){logger['error'](_0xa0e7('0x90'),JSON[_0xa0e7('0xe')](_0x5ac77c));});};exports[_0xa0e7('0x96')]=function(_0x95f2a5,_0x3f1fe3,_0x58b56e,_0x48e9b9,_0x2ef64f,_0x537767){var _0x58adc1,_0x1fe9e8,_0x591a2e;_0x537767[_0xa0e7('0x7b')]=intUtil[_0xa0e7('0x7a')](_0x537767['host']);_0x537767[_0xa0e7('0x7c')]=intUtil[_0xa0e7('0x7a')](_0x537767[_0xa0e7('0x7c')]);if(_0x2ef64f&&_0x2ef64f[_0xa0e7('0x7d')]){logger[_0xa0e7('0x31')]('['+_0x3f1fe3['lastevent']['toUpperCase']()+']',_0xa0e7('0x7f'));_0x3f1fe3[_0xa0e7('0x81')]=_0x537767[_0xa0e7('0x7c')]+_0xa0e7('0x91')+_0x3f1fe3[_0xa0e7('0x80')]+_0xa0e7('0x92')+md5(_0x3f1fe3[_0xa0e7('0x80')]);}else{_0x3f1fe3[_0xa0e7('0x81')]='';}var _0x3e6344=_0x537767[_0xa0e7('0x7b')]===_0xa0e7('0x82')?'eu':_0xa0e7('0x83');return getAccessToken(_0x537767)[_0xa0e7('0x2c')](function(_0x3a2084){_0x591a2e=_0x3a2084;return getUser(_0x591a2e,_0x3e6344,_0x537767);})[_0xa0e7('0x2c')](function(_0x2c2a12){_0x58adc1=_0x2c2a12;logger['info'](_0xa0e7('0x84'),_0x58adc1['id']);return getEndUser(_0x591a2e,_0x3e6344,_0x537767,_0x3f1fe3['calleridname'],_0x3f1fe3[_0xa0e7('0x86')],_0x58adc1,_0x58b56e);})[_0xa0e7('0x2c')](function(_0x1ae460){_0x1fe9e8=_0x1ae460;return getCall(_0x591a2e,_0x3e6344,_0x537767,_0x58adc1,_0x1fe9e8,_0x58b56e,_0x3f1fe3,'Inbound');})[_0xa0e7('0x2c')](function(_0x5f0d9e){if(_0x5f0d9e){logger[_0xa0e7('0x31')](_0xa0e7('0x88'),_0x5f0d9e['id']);}})[_0xa0e7('0x27')](function(_0x4658c5){logger['error']('['+_0x3f1fe3[_0xa0e7('0x65')][_0xa0e7('0x97')]()+']',JSON[_0xa0e7('0xe')](_0x4658c5));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/script/index.js b/server/services/ami/trigger/script/index.js index 6afe46c..9a87525 100644 --- a/server/services/ami/trigger/script/index.js +++ b/server/services/ami/trigger/script/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ba1=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','util','mustache','../../../../config/logger','trigger','data2','Script','data3','exec','format'];(function(_0xddedad,_0x4c5e10){var _0xe4e8e6=function(_0x467080){while(--_0x467080){_0xddedad['push'](_0xddedad['shift']());}};_0xe4e8e6(++_0x4c5e10);}(_0x0ba1,0x1e1));var _0x10ba=function(_0x24517a,_0x174f91){_0x24517a=_0x24517a-0x0;var _0x55a0a0=_0x0ba1[_0x24517a];return _0x55a0a0;};'use strict';var util=require(_0x10ba('0x0'));var sh=require('shelljs');var Mustache=require(_0x10ba('0x1'));var logger=require(_0x10ba('0x2'))(_0x10ba('0x3'));exports['exec']=function(_0x2b87d1,_0x531257){var _0x4fdef3=_0x2b87d1[_0x10ba('0x4')]?_0x2b87d1['data2']:_0x10ba('0x5');var _0x13ce0a=_0x2b87d1['data3']?Mustache['render'](_0x2b87d1[_0x10ba('0x6')],_0x531257):_0x531257;sh[_0x10ba('0x7')](_0x13ce0a,function(_0x295b6f,_0x36176e,_0x52da12){if(_0x295b6f!==0x0){logger['error'](util[_0x10ba('0x8')](_0x10ba('0x9'),_0x4fdef3,_0x13ce0a,_0x295b6f,_0x52da12));}else{logger['info'](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x4fdef3,_0x13ce0a,_0x36176e));}});}; \ No newline at end of file +var _0x5040=['trigger','data2','Script','data3','exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','../../../../config/logger'];(function(_0x3c542d,_0x32df6a){var _0x4f58f9=function(_0x4cb103){while(--_0x4cb103){_0x3c542d['push'](_0x3c542d['shift']());}};_0x4f58f9(++_0x32df6a);}(_0x5040,0x76));var _0x0504=function(_0x52f095,_0x579d0d){_0x52f095=_0x52f095-0x0;var _0x575577=_0x5040[_0x52f095];return _0x575577;};'use strict';var util=require(_0x0504('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0x0504('0x1'))(_0x0504('0x2'));exports['exec']=function(_0x3e1eab,_0x273139){var _0x4c652b=_0x3e1eab[_0x0504('0x3')]?_0x3e1eab[_0x0504('0x3')]:_0x0504('0x4');var _0xfcad96=_0x3e1eab[_0x0504('0x5')]?Mustache['render'](_0x3e1eab[_0x0504('0x5')],_0x273139):_0x273139;sh[_0x0504('0x6')](_0xfcad96,function(_0x3a2209,_0x3e9cf9,_0x222e56){if(_0x3a2209!==0x0){logger[_0x0504('0x7')](util[_0x0504('0x8')](_0x0504('0x9'),_0x4c652b,_0xfcad96,_0x3a2209,_0x222e56));}else{logger[_0x0504('0xa')](util[_0x0504('0x8')](_0x0504('0xb'),_0x4c652b,_0xfcad96,_0x3e9cf9));}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js index f401803..3ba3f65 100644 --- a/server/services/ami/trigger/urlforward/index.js +++ b/server/services/ami/trigger/urlforward/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3401=['info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','number','headers','data6','parse','error','stack','GET','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20'];(function(_0x1bd4a6,_0x13116c){var _0x2ce051=function(_0x4c96b8){while(--_0x4c96b8){_0x1bd4a6['push'](_0x1bd4a6['shift']());}};_0x2ce051(++_0x13116c);}(_0x3401,0x1a9));var _0x1340=function(_0x19cd0c,_0xd18fa1){_0x19cd0c=_0x19cd0c-0x0;var _0x2008e9=_0x3401[_0x19cd0c];return _0x2008e9;};'use strict';var rp=require(_0x1340('0x0'));var util=require(_0x1340('0x1'));var _=require(_0x1340('0x2'));var Mustache=require(_0x1340('0x3'));var logger=require(_0x1340('0x4'))(_0x1340('0x5'));exports[_0x1340('0x6')]=function(_0xd7a154,_0x3abc69){var _0x23dbb4,_0x45aefc;var _0x2c2611={'method':_0xd7a154[_0x1340('0x7')][_0x1340('0x8')](),'uri':Mustache[_0x1340('0x9')](_0xd7a154[_0x1340('0xa')],_0x3abc69),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xd7a154[_0x1340('0xb')])===_0x1340('0xc')&&parseInt(_0xd7a154[_0x1340('0xb')])>=0x1&&parseInt(_0xd7a154['data5'])<=0xa?parseInt(_0xd7a154[_0x1340('0xb')])*0x3e8:0x5*0x3e8};try{_0x2c2611[_0x1340('0xd')]=_0xd7a154[_0x1340('0xe')]?JSON[_0x1340('0xf')](Mustache['render'](_0xd7a154[_0x1340('0xe')],_0x3abc69)):{};}catch(_0x20aca7){logger[_0x1340('0x10')](_0x20aca7[_0x1340('0x11')]);}switch(_0xd7a154[_0x1340('0x7')][_0x1340('0x8')]()){case _0x1340('0x12'):case'DELETE':_0x23dbb4=null;_0x2c2611['qs']=_0x3abc69;break;case _0x1340('0x13'):case _0x1340('0x14'):if(_0xd7a154[_0x1340('0x15')]){try{_0x23dbb4=JSON[_0x1340('0xf')](Mustache[_0x1340('0x9')](_0xd7a154['data7'],_0x3abc69));_0x2c2611[_0x1340('0x16')]=_0x23dbb4;}catch(_0x2f9c06){logger[_0x1340('0x10')](_0x2f9c06[_0x1340('0x11')]);logger[_0x1340('0x10')](_0x1340('0x17'));}}else{_0x23dbb4=_0x3abc69;_0x2c2611[_0x1340('0x16')]=_0x23dbb4;}break;}logger['info'](util[_0x1340('0x18')](_0x1340('0x19'),_0xd7a154[_0x1340('0x7')],_0xd7a154['data2'],JSON[_0x1340('0x1a')](_0x2c2611)));rp(_0x2c2611)[_0x1340('0x1b')](function(_0x18b425){_0x23dbb4=!_[_0x1340('0x1c')](_0x23dbb4)?_0x1340('0x1d')+_0x23dbb4:'';_0x45aefc=typeof _0x18b425[_0x1340('0x16')]==='object'?JSON['stringify'](_0x18b425[_0x1340('0x16')]):_0x18b425[_0x1340('0x16')];logger[_0x1340('0x1e')](util[_0x1340('0x18')](_0x1340('0x1f'),_0xd7a154[_0x1340('0x7')],_0xd7a154['data2'],_0x18b425['statusCode'],_0x45aefc));})['catch'](function(_0x5a1380){logger[_0x1340('0x10')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0xd7a154[_0x1340('0x7')],_0xd7a154[_0x1340('0xa')],_0x5a1380[_0x1340('0x20')],_0x5a1380[_0x1340('0x21')],_0x5a1380[_0x1340('0x22')]));});}; \ No newline at end of file +var _0x7e75=['parse','render','error','stack','GET','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','%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','util','lodash','mustache','trigger','data1','toUpperCase','data5','number','data6'];(function(_0x232e85,_0x300cf4){var _0x4618ae=function(_0x55e2d8){while(--_0x55e2d8){_0x232e85['push'](_0x232e85['shift']());}};_0x4618ae(++_0x300cf4);}(_0x7e75,0xf7));var _0x57e7=function(_0x444d90,_0x11c679){_0x444d90=_0x444d90-0x0;var _0x3a8344=_0x7e75[_0x444d90];return _0x3a8344;};'use strict';var rp=require('request-promise');var util=require(_0x57e7('0x0'));var _=require(_0x57e7('0x1'));var Mustache=require(_0x57e7('0x2'));var logger=require('../../../../config/logger')(_0x57e7('0x3'));exports['exec']=function(_0xbfbd62,_0x5a0455){var _0x325249,_0x1f78d0;var _0x268b87={'method':_0xbfbd62[_0x57e7('0x4')][_0x57e7('0x5')](),'uri':Mustache['render'](_0xbfbd62['data2'],_0x5a0455),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xbfbd62[_0x57e7('0x6')])===_0x57e7('0x7')&&parseInt(_0xbfbd62[_0x57e7('0x6')])>=0x1&&parseInt(_0xbfbd62['data5'])<=0xa?parseInt(_0xbfbd62['data5'])*0x3e8:0x5*0x3e8};try{_0x268b87['headers']=_0xbfbd62[_0x57e7('0x8')]?JSON[_0x57e7('0x9')](Mustache[_0x57e7('0xa')](_0xbfbd62[_0x57e7('0x8')],_0x5a0455)):{};}catch(_0x168e3f){logger[_0x57e7('0xb')](_0x168e3f[_0x57e7('0xc')]);}switch(_0xbfbd62[_0x57e7('0x4')]['toUpperCase']()){case _0x57e7('0xd'):case'DELETE':_0x325249=null;_0x268b87['qs']=_0x5a0455;break;case _0x57e7('0xe'):case _0x57e7('0xf'):if(_0xbfbd62[_0x57e7('0x10')]){try{_0x325249=JSON[_0x57e7('0x9')](Mustache[_0x57e7('0xa')](_0xbfbd62[_0x57e7('0x10')],_0x5a0455));_0x268b87[_0x57e7('0x11')]=_0x325249;}catch(_0x1e5284){logger[_0x57e7('0xb')](_0x1e5284[_0x57e7('0xc')]);logger[_0x57e7('0xb')](_0x57e7('0x12'));}}else{_0x325249=_0x5a0455;_0x268b87[_0x57e7('0x11')]=_0x325249;}break;}logger[_0x57e7('0x13')](util[_0x57e7('0x14')](_0x57e7('0x15'),_0xbfbd62['data1'],_0xbfbd62[_0x57e7('0x16')],JSON[_0x57e7('0x17')](_0x268b87)));rp(_0x268b87)[_0x57e7('0x18')](function(_0x4f7529){_0x325249=!_[_0x57e7('0x19')](_0x325249)?_0x57e7('0x1a')+_0x325249:'';_0x1f78d0=typeof _0x4f7529[_0x57e7('0x11')]==='object'?JSON[_0x57e7('0x17')](_0x4f7529[_0x57e7('0x11')]):_0x4f7529[_0x57e7('0x11')];logger[_0x57e7('0x13')](util['format'](_0x57e7('0x1b'),_0xbfbd62['data1'],_0xbfbd62[_0x57e7('0x16')],_0x4f7529[_0x57e7('0x1c')],_0x1f78d0));})['catch'](function(_0xe89c4a){logger['error'](util[_0x57e7('0x14')](_0x57e7('0x1d'),_0xbfbd62[_0x57e7('0x4')],_0xbfbd62[_0x57e7('0x16')],_0xe89c4a[_0x57e7('0x1c')],_0xe89c4a[_0x57e7('0x1e')],_0xe89c4a[_0x57e7('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index e308fe3..e482b17 100644 --- a/server/services/email/client.js +++ b/server/services/email/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd24=['result','catch','exports','bluebird','routing','client','request','then','rpc','error','message'];(function(_0x41b6e3,_0x505829){var _0x3cb0ab=function(_0x5c2492){while(--_0x5c2492){_0x41b6e3['push'](_0x41b6e3['shift']());}};_0x3cb0ab(++_0x505829);}(_0xdd24,0xbe));var _0x4dd2=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdd24[_0x432682];return _0x463d05;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x4dd2('0x0'));var logger=require('../../config/logger')(_0x4dd2('0x1'));var client=jayson[_0x4dd2('0x2')]['http']({'port':0x2329});client['Request']=function(_0x29a757,_0x18744a){return new BPromise(function(_0x30c3ce,_0x234655){return client[_0x4dd2('0x3')](_0x29a757,_0x18744a)[_0x4dd2('0x4')](function(_0x5eba38){logger['debug'](_0x4dd2('0x5'),_0x4dd2('0x1'),_0x29a757,_0x18744a,_0x5eba38);if(_0x5eba38[_0x4dd2('0x6')]){logger[_0x4dd2('0x6')](_0x4dd2('0x5'),_0x4dd2('0x1'),_0x29a757,_0x5eba38[_0x4dd2('0x6')][_0x4dd2('0x7')],_0x18744a);return _0x234655(_0x5eba38[_0x4dd2('0x6')][_0x4dd2('0x7')]);}else{return _0x30c3ce(_0x5eba38[_0x4dd2('0x8')]);}})[_0x4dd2('0x9')](function(_0x45b8a6){logger[_0x4dd2('0x6')](_0x4dd2('0x5'),_0x4dd2('0x1'),_0x29a757,_0x45b8a6,_0x18744a);return _0x234655(_0x45b8a6);});});};module[_0x4dd2('0xa')]=client; \ No newline at end of file +var _0xb022=['error','message','result','catch','exports','jayson/promise','../../config/logger','client','Request','request','then','debug','rpc','routing'];(function(_0x11a220,_0x4e470a){var _0x20d8fe=function(_0xbedfd){while(--_0xbedfd){_0x11a220['push'](_0x11a220['shift']());}};_0x20d8fe(++_0x4e470a);}(_0xb022,0x10f));var _0x2b02=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb022[_0x19e35c];return _0x3e1fe8;};'use strict';var jayson=require(_0x2b02('0x0'));var BPromise=require('bluebird');var logger=require(_0x2b02('0x1'))('routing');var client=jayson[_0x2b02('0x2')]['http']({'port':0x2329});client[_0x2b02('0x3')]=function(_0x5f553f,_0x2b749f){return new BPromise(function(_0x1e98c3,_0x3fd0a3){return client[_0x2b02('0x4')](_0x5f553f,_0x2b749f)[_0x2b02('0x5')](function(_0x1d1c04){logger[_0x2b02('0x6')](_0x2b02('0x7'),_0x2b02('0x8'),_0x5f553f,_0x2b749f,_0x1d1c04);if(_0x1d1c04[_0x2b02('0x9')]){logger['error'](_0x2b02('0x7'),_0x2b02('0x8'),_0x5f553f,_0x1d1c04[_0x2b02('0x9')][_0x2b02('0xa')],_0x2b749f);return _0x3fd0a3(_0x1d1c04[_0x2b02('0x9')][_0x2b02('0xa')]);}else{return _0x1e98c3(_0x1d1c04[_0x2b02('0xb')]);}})[_0x2b02('0xc')](function(_0x1536ff){logger[_0x2b02('0x9')](_0x2b02('0x7'),_0x2b02('0x8'),_0x5f553f,_0x1536ff,_0x2b749f);return _0x3fd0a3(_0x1536ff);});});};module[_0x2b02('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 1a9cc2e..d61d9d7 100644 --- a/server/services/email/index.js +++ b/server/services/email/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7a4=['listen','loginMailFrequency','./server','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','getMailAccounts','then','initMailAccounts','refresh'];(function(_0x31a1cd,_0x35d7e1){var _0x13fa9b=function(_0xf40c74){while(--_0xf40c74){_0x31a1cd['push'](_0x31a1cd['shift']());}};_0x13fa9b(++_0x35d7e1);}(_0xd7a4,0x1bc));var _0x4d7a=function(_0x125bef,_0x1ec954){_0x125bef=_0x125bef-0x0;var _0x1be6bd=_0xd7a4[_0x125bef];return _0x1be6bd;};'use strict';var server=require(_0x4d7a('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x4d7a('0x1'));var mailAccount=require(_0x4d7a('0x2'));var setting=require(_0x4d7a('0x3'));var logger=require(_0x4d7a('0x4'))(_0x4d7a('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x4d7a('0x6')]()['then'](mailAccount[_0x4d7a('0x7')]())[_0x4d7a('0x8')](realtime[_0x4d7a('0x9')]())[_0x4d7a('0x8')](function(){email[_0x4d7a('0xa')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x4d7a('0xb')](realtime,email)[_0x4d7a('0x8')](function(){return initRealtime();})[_0x4d7a('0x8')](function(){return setting['getSettings']();})['then'](function(_0x2934b5){return setInterval(initRealtime,_0x2934b5[_0x4d7a('0xc')]*0x3e8);})['catch'](function(_0x3e1af8){logger['error']('Email\x20service\x20initialization',_0x3e1af8);});}main(); \ No newline at end of file +var _0xf97a=['refresh','mailAccounts','listen','loginMailFrequency','catch','error','Email\x20service\x20initialization','./lib/email','./rpc/mailAccount','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts'];(function(_0x1bef4e,_0x48553b){var _0x4491da=function(_0x75dc1a){while(--_0x75dc1a){_0x1bef4e['push'](_0x1bef4e['shift']());}};_0x4491da(++_0x48553b);}(_0xf97a,0x1ba));var _0xaf97=function(_0xcb2d98,_0xf99870){_0xcb2d98=_0xcb2d98-0x0;var _0x469632=_0xf97a[_0xcb2d98];return _0x469632;};'use strict';var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0xaf97('0x0'));var mailAccount=require(_0xaf97('0x1'));var setting=require('./rpc/setting');var logger=require(_0xaf97('0x2'))(_0xaf97('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xaf97('0x4')]()[_0xaf97('0x5')](mailAccount[_0xaf97('0x6')]())[_0xaf97('0x5')](realtime[_0xaf97('0x7')]())[_0xaf97('0x5')](function(){email[_0xaf97('0x8')](realtime[_0xaf97('0x9')]);return realtime;});}function main(){return server[_0xaf97('0xa')](realtime,email)[_0xaf97('0x5')](function(){return initRealtime();})[_0xaf97('0x5')](function(){return setting['getSettings']();})['then'](function(_0x4a7b8d){return setInterval(initRealtime,_0x4a7b8d[_0xaf97('0xb')]*0x3e8);})[_0xaf97('0xc')](function(_0x4ac9e1){logger[_0xaf97('0xd')](_0xaf97('0xe'),_0x4ac9e1);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 2d48709..be88607 100644 --- a/server/services/email/lib/email.js +++ b/server/services/email/lib/email.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe877=['connected','messages','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','verifySmtp','Smtp','smtp','catch','exports','lodash','moment','bluebird','md5','../../../config/environment','../../../config/logger','email','redis','defaults','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','emit','name','key','active','Imap','status','messageStatus','total','stringify','mailAccount:update','prototype','refresh','hasOwnProperty','service','provider','custom','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','handleImapError','isNil','disabled'];(function(_0x4e3c96,_0x2237a9){var _0x10e946=function(_0xc4a7bb){while(--_0xc4a7bb){_0x4e3c96['push'](_0x4e3c96['shift']());}};_0x10e946(++_0x2237a9);}(_0xe877,0xeb));var _0x7e87=function(_0x2dad32,_0x448732){_0x2dad32=_0x2dad32-0x0;var _0x3a8966=_0xe877[_0x2dad32];return _0x3a8966;};'use strict';var _=require(_0x7e87('0x0'));var moment=require(_0x7e87('0x1'));var BPromise=require(_0x7e87('0x2'));var md5=require(_0x7e87('0x3'));var Redis=require('ioredis');var config=require(_0x7e87('0x4'));var logger=require(_0x7e87('0x5'))(_0x7e87('0x6'));config[_0x7e87('0x7')]=_[_0x7e87('0x8')](config[_0x7e87('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7e87('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x7e87('0x9'));var mailAccount=require(_0x7e87('0xa'));var md5Accounts={};function EmailChannel(_0x8e8ad1){logger[_0x7e87('0xb')](_0x7e87('0xc'));this[_0x7e87('0xd')]=_0x8e8ad1[_0x7e87('0xd')];this[_0x7e87('0xe')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0x7e87('0xf')]=function(_0x43f5cb){var _0x764882=this['mailAccounts'][_0x43f5cb];var _0x1a7f69={'id':_0x764882['id'],'name':_0x764882[_0x7e87('0x10')],'key':_0x764882[_0x7e87('0x11')],'active':_0x764882[_0x7e87('0x12')],'Imap':{'status':_0x764882[_0x7e87('0x13')][_0x7e87('0x14')],'messageStatus':_0x764882[_0x7e87('0x13')][_0x7e87('0x15')],'total':_0x764882[_0x7e87('0x13')][_0x7e87('0x16')]}};if(_['isNil'](md5Accounts[_0x43f5cb])){md5Accounts[_0x43f5cb]={};}var _0x42db61=md5(JSON[_0x7e87('0x17')](_0x1a7f69));if(md5Accounts[_0x43f5cb][_0x7e87('0x3')]!==_0x42db61){md5Accounts[_0x43f5cb][_0x7e87('0x3')]=_0x42db61;io[_0x7e87('0xf')](_0x7e87('0x18'),_0x1a7f69);}};EmailChannel[_0x7e87('0x19')][_0x7e87('0x1a')]=function(_0x4db2eb){for(var _0x302a84 in _0x4db2eb){if(_0x4db2eb[_0x7e87('0x1b')](_0x302a84)){if(_0x4db2eb[_0x302a84][_0x7e87('0x13')]&&_0x4db2eb[_0x302a84]['active']){var _0x1f1663=_0x4db2eb[_0x302a84]['Imap'];if(!_0x1f1663[_0x7e87('0x1c')]&&_0x4db2eb[_0x302a84][_0x7e87('0x1d')]!==_0x7e87('0x1e'))_0x1f1663['service']=_0x4db2eb[_0x302a84][_0x7e87('0x1d')];if(!this[_0x7e87('0xe')][_0x7e87('0x1b')](_0x1f1663['id'])){this[_0x7e87('0xe')][_0x1f1663['id']]=new EmailImap(_0x1f1663,_0x4db2eb[_0x302a84]['email']);this[_0x7e87('0xe')][_0x1f1663['id']]['on']('box',this[_0x7e87('0x1f')]['bind'](this,_0x302a84));this[_0x7e87('0xe')][_0x1f1663['id']]['on'](_0x7e87('0x6'),this[_0x7e87('0x20')][_0x7e87('0x21')](this,_0x302a84));this['imapAccounts'][_0x1f1663['id']]['on'](_0x7e87('0x22'),this[_0x7e87('0x23')][_0x7e87('0x21')](this,_0x302a84));this['imapAccounts'][_0x1f1663['id']]['on'](_0x7e87('0x24'),this[_0x7e87('0x25')][_0x7e87('0x21')](this,_0x302a84));}}else{if(_[_0x7e87('0x26')](this[_0x7e87('0xd')][_0x302a84][_0x7e87('0x13')])){this['mailAccounts'][_0x302a84][_0x7e87('0x13')]={};}this['mailAccounts'][_0x302a84]['Imap'][_0x7e87('0x14')]=_0x7e87('0x27');this['mailAccounts'][_0x302a84][_0x7e87('0x13')][_0x7e87('0x15')]='';this[_0x7e87('0xf')](_0x302a84);}}}};EmailChannel[_0x7e87('0x19')][_0x7e87('0x1f')]=function(_0x1c2754,_0x37f181){if(this[_0x7e87('0xd')][_0x1c2754]){this[_0x7e87('0xd')][_0x1c2754]['Imap']['status']=_0x7e87('0x28');this[_0x7e87('0xd')][_0x1c2754][_0x7e87('0x13')][_0x7e87('0x15')]=_0x37f181[_0x7e87('0x10')];if(_0x37f181[_0x7e87('0x29')]){this[_0x7e87('0xd')][_0x1c2754][_0x7e87('0x13')][_0x7e87('0x16')]=_0x37f181[_0x7e87('0x29')][_0x7e87('0x16')];}return this[_0x7e87('0xf')](_0x1c2754);}};EmailChannel['prototype'][_0x7e87('0x20')]=function(_0x14d5ed,_0x975fe1){logger[_0x7e87('0xb')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x975fe1[_0x7e87('0x2a')],_0x975fe1['lastName'],_0x975fe1[_0x7e87('0x2b')],_0x14d5ed);if(this[_0x7e87('0xd')][_0x14d5ed]){return mailAccount[_0x7e87('0x2c')](_0x14d5ed,_0x975fe1)[_0x7e87('0x2d')](function(_0xa2458e){if(_0xa2458e){logger[_0x7e87('0xb')](_0x7e87('0x2e'));}})['catch'](function(_0x15a6df){logger['error'](_0x7e87('0x2f'),JSON['stringify'](_0x15a6df));});}};EmailChannel[_0x7e87('0x19')][_0x7e87('0x23')]=function(_0x3d7979){if(this[_0x7e87('0xd')][_0x3d7979]&&this['mailAccounts'][_0x3d7979][_0x7e87('0x13')]){if(this['imapAccounts'][this[_0x7e87('0xd')][_0x3d7979][_0x7e87('0x13')]['id']]){delete this['imapAccounts'][this[_0x7e87('0xd')][_0x3d7979][_0x7e87('0x13')]['id']];}this['mailAccounts'][_0x3d7979][_0x7e87('0x13')]['lastSync']=moment();this['emit'](_0x3d7979);}};EmailChannel[_0x7e87('0x19')][_0x7e87('0x25')]=function(_0x95553e,_0x1e0913){if(this['mailAccounts'][_0x95553e]){this[_0x7e87('0xd')][_0x95553e][_0x7e87('0x13')][_0x7e87('0x14')]=_0x7e87('0x24');this[_0x7e87('0xd')][_0x95553e][_0x7e87('0x13')][_0x7e87('0x15')]=_0x1e0913;return this['emit'](_0x95553e);}};EmailChannel['prototype'][_0x7e87('0x30')]=function(_0x21dda1,_0xc576e3){return this['smtp'][_0x7e87('0x31')](_0x21dda1,_0xc576e3);};EmailChannel[_0x7e87('0x19')][_0x7e87('0x32')]=function(_0x4c1e8b){var _0x838afa=this;if(this[_0x7e87('0xd')][_0x4c1e8b['id']]){if(_['isNil'](this[_0x7e87('0xd')][_0x4c1e8b['id']]['Smtp'])){this[_0x7e87('0xd')][_0x4c1e8b['id']][_0x7e87('0x33')]={};}this[_0x7e87('0xd')][_0x4c1e8b['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x443120,_0x1cefa5){return _0x838afa[_0x7e87('0x34')]['verify'](_0x4c1e8b)[_0x7e87('0x2d')](function(_0x4be45f){_0x838afa['mailAccounts'][_0x4c1e8b['id']][_0x7e87('0x33')][_0x7e87('0x14')]='verified';_0x838afa[_0x7e87('0xd')][_0x4c1e8b['id']]['Smtp'][_0x7e87('0x15')]='';_0x838afa[_0x7e87('0xf')](_0x4c1e8b['id']);_0x443120(_0x4be45f);})[_0x7e87('0x35')](function(_0x52c69a){_0x838afa[_0x7e87('0xd')][_0x4c1e8b['id']][_0x7e87('0x33')][_0x7e87('0x14')]=_0x7e87('0x24');_0x838afa[_0x7e87('0xd')][_0x4c1e8b['id']]['Smtp'][_0x7e87('0x15')]=_0x52c69a;_0x838afa[_0x7e87('0xf')](_0x4c1e8b['id']);_0x1cefa5(_0x52c69a);});});}return this[_0x7e87('0x34')]['verify'](_0x4c1e8b);};module[_0x7e87('0x36')]=EmailChannel; \ No newline at end of file +var _0x740c=['messages','firstName','lastName','from','notify','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','verify','verified','lodash','bluebird','md5','ioredis','../../../config/logger','email','redis','defaults','localhost','./imap','./smtp','info','mailAccounts','smtp','prototype','emit','name','active','Imap','status','messageStatus','total','isNil','mailAccount:update','refresh','service','provider','imapAccounts','hasOwnProperty','handleImapBox','bind','handleImapEmail','end','error','disabled','connected'];(function(_0x3395c1,_0x3e0f36){var _0x25faab=function(_0x303759){while(--_0x303759){_0x3395c1['push'](_0x3395c1['shift']());}};_0x25faab(++_0x3e0f36);}(_0x740c,0xe0));var _0xc740=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x740c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc740('0x0'));var moment=require('moment');var BPromise=require(_0xc740('0x1'));var md5=require(_0xc740('0x2'));var Redis=require(_0xc740('0x3'));var config=require('../../../config/environment');var logger=require(_0xc740('0x4'))(_0xc740('0x5'));config[_0xc740('0x6')]=_[_0xc740('0x7')](config[_0xc740('0x6')],{'host':_0xc740('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0xc740('0x9'));var EmailSmtp=require(_0xc740('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x488e43){logger[_0xc740('0xb')]('start\x20email\x20channel');this['mailAccounts']=_0x488e43[_0xc740('0xc')];this['imapAccounts']={};this[_0xc740('0xd')]=new EmailSmtp();}EmailChannel[_0xc740('0xe')][_0xc740('0xf')]=function(_0xe18e1a){var _0x467031=this[_0xc740('0xc')][_0xe18e1a];var _0xb090c2={'id':_0x467031['id'],'name':_0x467031[_0xc740('0x10')],'key':_0x467031['key'],'active':_0x467031[_0xc740('0x11')],'Imap':{'status':_0x467031[_0xc740('0x12')][_0xc740('0x13')],'messageStatus':_0x467031[_0xc740('0x12')][_0xc740('0x14')],'total':_0x467031[_0xc740('0x12')][_0xc740('0x15')]}};if(_[_0xc740('0x16')](md5Accounts[_0xe18e1a])){md5Accounts[_0xe18e1a]={};}var _0x5e7da=md5(JSON['stringify'](_0xb090c2));if(md5Accounts[_0xe18e1a][_0xc740('0x2')]!==_0x5e7da){md5Accounts[_0xe18e1a]['md5']=_0x5e7da;io[_0xc740('0xf')](_0xc740('0x17'),_0xb090c2);}};EmailChannel[_0xc740('0xe')][_0xc740('0x18')]=function(_0x48fbf4){for(var _0xa44ece in _0x48fbf4){if(_0x48fbf4['hasOwnProperty'](_0xa44ece)){if(_0x48fbf4[_0xa44ece][_0xc740('0x12')]&&_0x48fbf4[_0xa44ece][_0xc740('0x11')]){var _0x536119=_0x48fbf4[_0xa44ece][_0xc740('0x12')];if(!_0x536119[_0xc740('0x19')]&&_0x48fbf4[_0xa44ece]['provider']!=='custom')_0x536119['service']=_0x48fbf4[_0xa44ece][_0xc740('0x1a')];if(!this[_0xc740('0x1b')][_0xc740('0x1c')](_0x536119['id'])){this[_0xc740('0x1b')][_0x536119['id']]=new EmailImap(_0x536119,_0x48fbf4[_0xa44ece][_0xc740('0x5')]);this[_0xc740('0x1b')][_0x536119['id']]['on']('box',this[_0xc740('0x1d')][_0xc740('0x1e')](this,_0xa44ece));this['imapAccounts'][_0x536119['id']]['on'](_0xc740('0x5'),this[_0xc740('0x1f')][_0xc740('0x1e')](this,_0xa44ece));this[_0xc740('0x1b')][_0x536119['id']]['on'](_0xc740('0x20'),this['handleImapEnd'][_0xc740('0x1e')](this,_0xa44ece));this[_0xc740('0x1b')][_0x536119['id']]['on'](_0xc740('0x21'),this['handleImapError'][_0xc740('0x1e')](this,_0xa44ece));}}else{if(_[_0xc740('0x16')](this[_0xc740('0xc')][_0xa44ece][_0xc740('0x12')])){this['mailAccounts'][_0xa44ece][_0xc740('0x12')]={};}this[_0xc740('0xc')][_0xa44ece]['Imap']['status']=_0xc740('0x22');this[_0xc740('0xc')][_0xa44ece]['Imap']['messageStatus']='';this['emit'](_0xa44ece);}}}};EmailChannel['prototype'][_0xc740('0x1d')]=function(_0x2f7f1f,_0x598943){if(this[_0xc740('0xc')][_0x2f7f1f]){this[_0xc740('0xc')][_0x2f7f1f][_0xc740('0x12')][_0xc740('0x13')]=_0xc740('0x23');this['mailAccounts'][_0x2f7f1f][_0xc740('0x12')][_0xc740('0x14')]=_0x598943[_0xc740('0x10')];if(_0x598943[_0xc740('0x24')]){this['mailAccounts'][_0x2f7f1f][_0xc740('0x12')]['total']=_0x598943[_0xc740('0x24')][_0xc740('0x15')];}return this[_0xc740('0xf')](_0x2f7f1f);}};EmailChannel[_0xc740('0xe')][_0xc740('0x1f')]=function(_0x39758a,_0x178930){logger[_0xc740('0xb')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x178930[_0xc740('0x25')],_0x178930[_0xc740('0x26')],_0x178930[_0xc740('0x27')],_0x39758a);if(this[_0xc740('0xc')][_0x39758a]){return mailAccount[_0xc740('0x28')](_0x39758a,_0x178930)[_0xc740('0x29')](function(_0x57b8a7){if(_0x57b8a7){logger[_0xc740('0xb')]('Mail\x20accepted\x20from\x20routing');}})[_0xc740('0x2a')](function(_0x2f0e35){logger[_0xc740('0x21')](_0xc740('0x2b'),JSON['stringify'](_0x2f0e35));});}};EmailChannel[_0xc740('0xe')]['handleImapEnd']=function(_0x4f5d84){if(this[_0xc740('0xc')][_0x4f5d84]&&this['mailAccounts'][_0x4f5d84][_0xc740('0x12')]){if(this[_0xc740('0x1b')][this[_0xc740('0xc')][_0x4f5d84][_0xc740('0x12')]['id']]){delete this[_0xc740('0x1b')][this[_0xc740('0xc')][_0x4f5d84][_0xc740('0x12')]['id']];}this['mailAccounts'][_0x4f5d84][_0xc740('0x12')][_0xc740('0x2c')]=moment();this[_0xc740('0xf')](_0x4f5d84);}};EmailChannel[_0xc740('0xe')][_0xc740('0x2d')]=function(_0x4f436c,_0x49cc6e){if(this[_0xc740('0xc')][_0x4f436c]){this[_0xc740('0xc')][_0x4f436c][_0xc740('0x12')]['status']='error';this[_0xc740('0xc')][_0x4f436c][_0xc740('0x12')][_0xc740('0x14')]=_0x49cc6e;return this[_0xc740('0xf')](_0x4f436c);}};EmailChannel[_0xc740('0xe')][_0xc740('0x2e')]=function(_0x385c79,_0x3edef9){return this[_0xc740('0xd')][_0xc740('0x2f')](_0x385c79,_0x3edef9);};EmailChannel[_0xc740('0xe')][_0xc740('0x30')]=function(_0x396923){var _0x33fc95=this;if(this[_0xc740('0xc')][_0x396923['id']]){if(_[_0xc740('0x16')](this[_0xc740('0xc')][_0x396923['id']][_0xc740('0x31')])){this[_0xc740('0xc')][_0x396923['id']]['Smtp']={};}this['mailAccounts'][_0x396923['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x91445f,_0x1aa54f){return _0x33fc95[_0xc740('0xd')][_0xc740('0x32')](_0x396923)[_0xc740('0x29')](function(_0x3be9b1){_0x33fc95[_0xc740('0xc')][_0x396923['id']][_0xc740('0x31')][_0xc740('0x13')]=_0xc740('0x33');_0x33fc95[_0xc740('0xc')][_0x396923['id']][_0xc740('0x31')]['messageStatus']='';_0x33fc95[_0xc740('0xf')](_0x396923['id']);_0x91445f(_0x3be9b1);})[_0xc740('0x2a')](function(_0x60e7eb){_0x33fc95['mailAccounts'][_0x396923['id']]['Smtp'][_0xc740('0x13')]='error';_0x33fc95['mailAccounts'][_0x396923['id']][_0xc740('0x31')][_0xc740('0x14')]=_0x60e7eb;_0x33fc95[_0xc740('0xf')](_0x396923['id']);_0x1aa54f(_0x60e7eb);});});}return this[_0xc740('0xd')][_0xc740('0x32')](_0x396923);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 5c79722..aedc479 100644 --- a/server/services/email/lib/imap.js +++ b/server/services/email/lib/imap.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x755e=['emit','box','readUnseen','handleCloseBox','handleError','search','handleReadUnseen','fetch','handleFetchMessage','handleFetchError','closeBox','body','handleMessageBody','attributes','handleMessageEnd','handleMessageAttributes','handleSimpleParser','parser','handleFetchEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','EventEmitter','../../../config/logger','email','mailbox','account','once','ready','handleReady','bind','end','handleEnd','error','inherits','prototype','getAccount','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','data5','password','authentication','host','port','tls','autotls','required','openBox','handleOpenBox'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x755e,0x96));var _0xe755=function(_0x19e206,_0x3e945d){_0x19e206=_0x19e206-0x0;var _0x531b21=_0x755e[_0x19e206];return _0x531b21;};'use strict';var _=require(_0xe755('0x0'));var util=require(_0xe755('0x1'));var Imap=require(_0xe755('0x2'));var simpleParser=require(_0xe755('0x3'))[_0xe755('0x4')];var Iconv=require(_0xe755('0x5'))[_0xe755('0x6')];var EventEmitter=require('events')[_0xe755('0x7')];var utils=require('./utils');var logger=require(_0xe755('0x8'))(_0xe755('0x9'));function EmailImap(_0xe29839,_0x3b82da){this[_0xe755('0xa')]=_0xe29839['mailbox'];this[_0xe755('0xb')]=this['getAccount'](_0xe29839,_0x3b82da);this[_0xe755('0x2')]=new Imap(this['account']);this[_0xe755('0x2')][_0xe755('0xc')](_0xe755('0xd'),this[_0xe755('0xe')][_0xe755('0xf')](this));this[_0xe755('0x2')][_0xe755('0xc')](_0xe755('0x10'),this[_0xe755('0x11')][_0xe755('0xf')](this));this[_0xe755('0x2')]['on'](_0xe755('0x12'),this['handleError'][_0xe755('0xf')](this));this[_0xe755('0x2')]['connect']();}util[_0xe755('0x13')](EmailImap,EventEmitter);EmailImap[_0xe755('0x14')][_0xe755('0x15')]=function(_0x5e0a17,_0x3a7848){var _0x306ddc={'connTimeout':_0x5e0a17['connTimeout']?_0x5e0a17[_0xe755('0x16')]*0x3e8:0x2710,'authTimeout':_0x5e0a17[_0xe755('0x17')]?_0x5e0a17['authTimeout']*0x3e8:0x1388};if(_0x5e0a17[_0xe755('0x18')]){_0x306ddc['user']=_0x5e0a17[_0xe755('0x19')];if(_0x5e0a17[_0xe755('0x1a')]){_0x306ddc[_0xe755('0x1b')]=utils[_0xe755('0x1c')](_0x5e0a17['CloudProvider'][_0xe755('0x1d')],_0x5e0a17['user']);}else{_0x306ddc[_0xe755('0x1e')]=_0x5e0a17['password'];}}else{if(_0x5e0a17[_0xe755('0x1f')]){_0x306ddc[_0xe755('0x19')]=_0x5e0a17['user'];_0x306ddc[_0xe755('0x1e')]=_0x5e0a17[_0xe755('0x1e')];}}_0x306ddc[_0xe755('0x9')]=_0x3a7848||_0x5e0a17[_0xe755('0x19')]||'anonymous@xcally.com';_0x306ddc[_0xe755('0x20')]=_0x5e0a17[_0xe755('0x20')];_0x306ddc[_0xe755('0x21')]=_0x5e0a17[_0xe755('0x21')]||0x3e1;if(_0x5e0a17[_0xe755('0x22')]){_0x306ddc[_0xe755('0x22')]=!![];}else{_0x306ddc[_0xe755('0x22')]=![];_0x306ddc[_0xe755('0x23')]=_0xe755('0x24');}return _0x306ddc;};EmailImap[_0xe755('0x14')]['handleReady']=function(){this[_0xe755('0x2')][_0xe755('0x25')](this[_0xe755('0xa')],![],this[_0xe755('0x26')][_0xe755('0xf')](this));};EmailImap[_0xe755('0x14')][_0xe755('0x26')]=function(_0x8c24d8,_0x5a2e38){if(_0x8c24d8){this['handleError'](_0x8c24d8,!![]);}else{this[_0xe755('0x27')](_0xe755('0x28'),_0x5a2e38);this[_0xe755('0x29')]();}};EmailImap[_0xe755('0x14')][_0xe755('0x2a')]=function(_0x43b4da){if(_0x43b4da){this[_0xe755('0x2b')](_0x43b4da,!![]);}else{this[_0xe755('0x2')]['end']();}};EmailImap[_0xe755('0x14')][_0xe755('0x29')]=function(){this['imap'][_0xe755('0x2c')](['UNSEEN'],this[_0xe755('0x2d')][_0xe755('0xf')](this));};EmailImap['prototype'][_0xe755('0x2d')]=function(_0xf95ffa,_0x1e19dc){if(_0xf95ffa){this[_0xe755('0x2b')](_0xf95ffa,!![]);}else{if(_0x1e19dc['length']){try{var _0x3d0cb6=this[_0xe755('0x2')][_0xe755('0x2e')](_0x1e19dc,{'bodies':'','markSeen':!![]});_0x3d0cb6['on']('message',this[_0xe755('0x2f')][_0xe755('0xf')](this));_0x3d0cb6[_0xe755('0xc')](_0xe755('0x12'),this[_0xe755('0x30')]['bind'](this));_0x3d0cb6[_0xe755('0xc')](_0xe755('0x10'),this['handleFetchEnd'][_0xe755('0xf')](this));}catch(_0x1a7e2e){logger[_0xe755('0x12')](_0x1a7e2e);}}else{this[_0xe755('0x2')][_0xe755('0x31')](!![],this[_0xe755('0x2a')][_0xe755('0xf')](this));}}};EmailImap[_0xe755('0x14')]['handleFetchMessage']=function(_0x1fadab){_0x1fadab['on'](_0xe755('0x32'),this[_0xe755('0x33')]['bind'](this));_0x1fadab[_0xe755('0xc')](_0xe755('0x34'),this['handleMessageAttributes'][_0xe755('0xf')](this));_0x1fadab[_0xe755('0xc')](_0xe755('0x10'),this[_0xe755('0x35')][_0xe755('0xf')](this));};EmailImap[_0xe755('0x14')][_0xe755('0x33')]=function(_0x3e661d){simpleParser(_0x3e661d,{'Iconv':Iconv},this['handleSimpleParser'][_0xe755('0xf')](this));};EmailImap[_0xe755('0x14')][_0xe755('0x36')]=function(){};EmailImap['prototype'][_0xe755('0x35')]=function(){};EmailImap[_0xe755('0x14')][_0xe755('0x37')]=function(_0x5321c6,_0x48e7df){if(_0x5321c6){logger[_0xe755('0x12')](_0x5321c6);}else{var _0x3cf0db=this;utils[_0xe755('0x38')](this['account'],_0x48e7df,function(_0x4a545c){_0x3cf0db[_0xe755('0x27')](_0xe755('0x9'),_0x4a545c);});}};EmailImap[_0xe755('0x14')][_0xe755('0x39')]=function(){this[_0xe755('0x2')][_0xe755('0x31')](!![],this[_0xe755('0x2a')][_0xe755('0xf')](this));};EmailImap[_0xe755('0x14')][_0xe755('0x30')]=function(_0x28e6b5){this[_0xe755('0x2b')](_0x28e6b5);this[_0xe755('0x2')]['closeBox'](!![],this['handleCloseBox'][_0xe755('0xf')](this));};EmailImap[_0xe755('0x14')][_0xe755('0x11')]=function(){this[_0xe755('0x27')](_0xe755('0x10'));};EmailImap[_0xe755('0x14')]['handleError']=function(_0x915a5,_0x32d165){logger[_0xe755('0x12')](_0xe755('0x2b'),this[_0xe755('0xb')][_0xe755('0x9')],JSON[_0xe755('0x3a')](_0x915a5));var _0x5ded3b='';if(_0x915a5){if(_0x915a5[_0xe755('0x3b')]){_0x5ded3b=_0x915a5['textCode'];}else{for(var _0x16f4a8 in _0x915a5){if(_0x915a5[_0xe755('0x3c')](_0x16f4a8)){_0x5ded3b+=_[_0xe755('0x3d')](_0x16f4a8)+':\x20'+_0x915a5[_0x16f4a8]+'\x0a';}}}}if(_0x32d165){this[_0xe755('0x2')][_0xe755('0x10')]();}else{this[_0xe755('0x27')](_0xe755('0x12'),_0x5ded3b);this[_0xe755('0x27')](_0xe755('0x10'));}};module[_0xe755('0x3e')]=EmailImap; \ No newline at end of file +var _0xb19e=['required','openBox','handleOpenBox','emit','handleCloseBox','readUnseen','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','upperFirst','exports','lodash','util','simpleParser','iconv','Iconv','events','./utils','../../../config/logger','email','mailbox','account','getAccount','imap','once','handleReady','bind','end','handleEnd','error','handleError','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','autotls'];(function(_0x71680e,_0x1fc38e){var _0x5cbf9f=function(_0x11010a){while(--_0x11010a){_0x71680e['push'](_0x71680e['shift']());}};_0x5cbf9f(++_0x1fc38e);}(_0xb19e,0x92));var _0xeb19=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0xb19e[_0x2ca2d0];return _0x521c23;};'use strict';var _=require(_0xeb19('0x0'));var util=require(_0xeb19('0x1'));var Imap=require('imap');var simpleParser=require('mailparser')[_0xeb19('0x2')];var Iconv=require(_0xeb19('0x3'))[_0xeb19('0x4')];var EventEmitter=require(_0xeb19('0x5'))['EventEmitter'];var utils=require(_0xeb19('0x6'));var logger=require(_0xeb19('0x7'))(_0xeb19('0x8'));function EmailImap(_0x5ba457,_0x5db780){this[_0xeb19('0x9')]=_0x5ba457['mailbox'];this[_0xeb19('0xa')]=this[_0xeb19('0xb')](_0x5ba457,_0x5db780);this[_0xeb19('0xc')]=new Imap(this[_0xeb19('0xa')]);this['imap'][_0xeb19('0xd')]('ready',this[_0xeb19('0xe')][_0xeb19('0xf')](this));this[_0xeb19('0xc')]['once'](_0xeb19('0x10'),this[_0xeb19('0x11')][_0xeb19('0xf')](this));this[_0xeb19('0xc')]['on'](_0xeb19('0x12'),this[_0xeb19('0x13')][_0xeb19('0xf')](this));this[_0xeb19('0xc')]['connect']();}util[_0xeb19('0x14')](EmailImap,EventEmitter);EmailImap[_0xeb19('0x15')][_0xeb19('0xb')]=function(_0x7c93fd,_0x1f2065){var _0x282820={'connTimeout':_0x7c93fd[_0xeb19('0x16')]?_0x7c93fd[_0xeb19('0x16')]*0x3e8:0x2710,'authTimeout':_0x7c93fd[_0xeb19('0x17')]?_0x7c93fd['authTimeout']*0x3e8:0x1388};if(_0x7c93fd[_0xeb19('0x18')]){_0x282820[_0xeb19('0x19')]=_0x7c93fd[_0xeb19('0x19')];if(_0x7c93fd[_0xeb19('0x1a')]){_0x282820[_0xeb19('0x1b')]=utils[_0xeb19('0x1c')](_0x7c93fd[_0xeb19('0x1d')][_0xeb19('0x1e')],_0x7c93fd[_0xeb19('0x19')]);}else{_0x282820[_0xeb19('0x1f')]=_0x7c93fd[_0xeb19('0x1f')];}}else{if(_0x7c93fd[_0xeb19('0x20')]){_0x282820['user']=_0x7c93fd['user'];_0x282820[_0xeb19('0x1f')]=_0x7c93fd[_0xeb19('0x1f')];}}_0x282820[_0xeb19('0x8')]=_0x1f2065||_0x7c93fd['user']||'anonymous@xcally.com';_0x282820['host']=_0x7c93fd[_0xeb19('0x21')];_0x282820['port']=_0x7c93fd[_0xeb19('0x22')]||0x3e1;if(_0x7c93fd['tls']){_0x282820[_0xeb19('0x23')]=!![];}else{_0x282820[_0xeb19('0x23')]=![];_0x282820[_0xeb19('0x24')]=_0xeb19('0x25');}return _0x282820;};EmailImap['prototype']['handleReady']=function(){this[_0xeb19('0xc')][_0xeb19('0x26')](this[_0xeb19('0x9')],![],this['handleOpenBox'][_0xeb19('0xf')](this));};EmailImap['prototype'][_0xeb19('0x27')]=function(_0x18d818,_0x9cf71c){if(_0x18d818){this['handleError'](_0x18d818,!![]);}else{this[_0xeb19('0x28')]('box',_0x9cf71c);this['readUnseen']();}};EmailImap['prototype'][_0xeb19('0x29')]=function(_0x5a033b){if(_0x5a033b){this[_0xeb19('0x13')](_0x5a033b,!![]);}else{this[_0xeb19('0xc')][_0xeb19('0x10')]();}};EmailImap['prototype'][_0xeb19('0x2a')]=function(){this['imap']['search']([_0xeb19('0x2b')],this[_0xeb19('0x2c')][_0xeb19('0xf')](this));};EmailImap['prototype'][_0xeb19('0x2c')]=function(_0x57e20c,_0x3facc3){if(_0x57e20c){this[_0xeb19('0x13')](_0x57e20c,!![]);}else{if(_0x3facc3['length']){try{var _0x298508=this[_0xeb19('0xc')][_0xeb19('0x2d')](_0x3facc3,{'bodies':'','markSeen':!![]});_0x298508['on'](_0xeb19('0x2e'),this[_0xeb19('0x2f')][_0xeb19('0xf')](this));_0x298508['once'](_0xeb19('0x12'),this[_0xeb19('0x30')][_0xeb19('0xf')](this));_0x298508[_0xeb19('0xd')](_0xeb19('0x10'),this[_0xeb19('0x31')][_0xeb19('0xf')](this));}catch(_0x53c825){logger[_0xeb19('0x12')](_0x53c825);}}else{this['imap'][_0xeb19('0x32')](!![],this[_0xeb19('0x29')][_0xeb19('0xf')](this));}}};EmailImap['prototype'][_0xeb19('0x2f')]=function(_0x5c5160){_0x5c5160['on'](_0xeb19('0x33'),this[_0xeb19('0x34')][_0xeb19('0xf')](this));_0x5c5160['once']('attributes',this[_0xeb19('0x35')]['bind'](this));_0x5c5160[_0xeb19('0xd')](_0xeb19('0x10'),this[_0xeb19('0x36')]['bind'](this));};EmailImap[_0xeb19('0x15')][_0xeb19('0x34')]=function(_0x5b1f55){simpleParser(_0x5b1f55,{'Iconv':Iconv},this['handleSimpleParser'][_0xeb19('0xf')](this));};EmailImap['prototype'][_0xeb19('0x35')]=function(){};EmailImap[_0xeb19('0x15')][_0xeb19('0x36')]=function(){};EmailImap['prototype'][_0xeb19('0x37')]=function(_0x43e45d,_0x3a168d){if(_0x43e45d){logger[_0xeb19('0x12')](_0x43e45d);}else{var _0x25e5f3=this;utils[_0xeb19('0x38')](this[_0xeb19('0xa')],_0x3a168d,function(_0x4e28e1){_0x25e5f3[_0xeb19('0x28')](_0xeb19('0x8'),_0x4e28e1);});}};EmailImap[_0xeb19('0x15')][_0xeb19('0x31')]=function(){this[_0xeb19('0xc')][_0xeb19('0x32')](!![],this[_0xeb19('0x29')]['bind'](this));};EmailImap[_0xeb19('0x15')][_0xeb19('0x30')]=function(_0x2095dc){this[_0xeb19('0x13')](_0x2095dc);this['imap'][_0xeb19('0x32')](!![],this[_0xeb19('0x29')]['bind'](this));};EmailImap[_0xeb19('0x15')][_0xeb19('0x11')]=function(){this[_0xeb19('0x28')](_0xeb19('0x10'));};EmailImap[_0xeb19('0x15')][_0xeb19('0x13')]=function(_0x522a5f,_0x394d4a){logger[_0xeb19('0x12')]('handleError',this['account'][_0xeb19('0x8')],JSON[_0xeb19('0x39')](_0x522a5f));var _0x4d4b91='';if(_0x522a5f){if(_0x522a5f['textCode']){_0x4d4b91=_0x522a5f[_0xeb19('0x3a')];}else{for(var _0x2a0665 in _0x522a5f){if(_0x522a5f['hasOwnProperty'](_0x2a0665)){_0x4d4b91+=_[_0xeb19('0x3b')](_0x2a0665)+':\x20'+_0x522a5f[_0x2a0665]+'\x0a';}}}}if(_0x394d4a){this[_0xeb19('0xc')]['end']();}else{this[_0xeb19('0x28')](_0xeb19('0x12'),_0x4d4b91);this['emit'](_0xeb19('0x10'));}};module[_0xeb19('0x3c')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 754fabe..afe496a 100644 --- a/server/services/email/lib/smtp.js +++ b/server/services/email/lib/smtp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90ba=['exports','nodemailer','nodemailer-plugin-inline-base64','prototype','use','compile','verify','createTransport','Not\x20verifired'];(function(_0x3371cb,_0x45cb27){var _0x2be43b=function(_0x170456){while(--_0x170456){_0x3371cb['push'](_0x3371cb['shift']());}};_0x2be43b(++_0x45cb27);}(_0x90ba,0x160));var _0xa90b=function(_0x1ba90e,_0x2743c2){_0x1ba90e=_0x1ba90e-0x0;var _0x5b2075=_0x90ba[_0x1ba90e];return _0x5b2075;};'use strict';var nodemailer=require(_0xa90b('0x0'));var inlineBase64=require(_0xa90b('0x1'));function EmailSmtp(){}EmailSmtp[_0xa90b('0x2')]['send']=function(_0x3005ee,_0x324d88){return new Promise(function(_0xc9d8,_0x11e2b1){var _0x430a8c=nodemailer['createTransport'](_0x3005ee);_0x430a8c[_0xa90b('0x3')](_0xa90b('0x4'),inlineBase64());_0x430a8c['sendMail'](_0x324d88,function(_0x3ffdfe,_0x536da1){if(_0x3ffdfe){_0x11e2b1(_0x3ffdfe['toString']());}else{_0xc9d8(_0x536da1);}});});};EmailSmtp['prototype'][_0xa90b('0x5')]=function(_0x48c8d1){return new Promise(function(_0x8f1e24,_0x26b8e2){var _0x4cf2fe=nodemailer[_0xa90b('0x6')](_0x48c8d1);_0x4cf2fe[_0xa90b('0x5')](function(_0x4aa2fc,_0x1cabf6){if(_0x4aa2fc){_0x26b8e2(_0x4aa2fc['toString']());}else{if(_0x1cabf6){_0x8f1e24(_0x1cabf6);}else{_0x26b8e2(_0xa90b('0x7'));}}});});};module[_0xa90b('0x8')]=EmailSmtp; \ No newline at end of file +var _0xd234=['sendMail','toString','prototype','verify','createTransport','exports','nodemailer','nodemailer-plugin-inline-base64','use','compile'];(function(_0x316105,_0x5a24cd){var _0xb0b187=function(_0x28fb48){while(--_0x28fb48){_0x316105['push'](_0x316105['shift']());}};_0xb0b187(++_0x5a24cd);}(_0xd234,0x114));var _0x4d23=function(_0x3b1e53,_0x24b184){_0x3b1e53=_0x3b1e53-0x0;var _0x5dbcf0=_0xd234[_0x3b1e53];return _0x5dbcf0;};'use strict';var nodemailer=require(_0x4d23('0x0'));var inlineBase64=require(_0x4d23('0x1'));function EmailSmtp(){}EmailSmtp['prototype']['send']=function(_0x4e803f,_0x57f4f8){return new Promise(function(_0x34f738,_0x52fc8e){var _0x27b48a=nodemailer['createTransport'](_0x4e803f);_0x27b48a[_0x4d23('0x2')](_0x4d23('0x3'),inlineBase64());_0x27b48a[_0x4d23('0x4')](_0x57f4f8,function(_0x3b81cd,_0x530201){if(_0x3b81cd){_0x52fc8e(_0x3b81cd[_0x4d23('0x5')]());}else{_0x34f738(_0x530201);}});});};EmailSmtp[_0x4d23('0x6')][_0x4d23('0x7')]=function(_0x1b122b){return new Promise(function(_0x482589,_0x2a1fbc){var _0x52ff1e=nodemailer[_0x4d23('0x8')](_0x1b122b);_0x52ff1e['verify'](function(_0x244d58,_0xce6d63){if(_0x244d58){_0x2a1fbc(_0x244d58[_0x4d23('0x5')]());}else{if(_0xce6d63){_0x482589(_0xce6d63);}else{_0x2a1fbc('Not\x20verifired');}}});});};module[_0x4d23('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index e578fa6..19e1af7 100644 --- a/server/services/email/lib/utils.js +++ b/server/services/email/lib/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d23=['content','contentType','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','headerLines','indexOf','line','isAutoreply','from','messageId','inReplyTo','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','Attachments','Title','Data','

Empty\x20message

','user=','auth=Bearer\x20','utf-8','base64','moment','path','util','email','head','value','address','anonymous','generate','@xcally.com','name','substring','split','length','slice','join','Anonymous','pop','isEmpty','test','html','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originTo','originCc','attachments','attach','type','attachment','attachment-','format','root','writeFileSync'];(function(_0x528fde,_0x312f46){var _0x163f8b=function(_0x3a4fc2){while(--_0x3a4fc2){_0x528fde['push'](_0x528fde['shift']());}};_0x163f8b(++_0x312f46);}(_0x9d23,0xa4));var _0x39d2=function(_0x5ea13a,_0x1abd76){_0x5ea13a=_0x5ea13a-0x0;var _0x1073b7=_0x9d23[_0x5ea13a];return _0x1073b7;};'use strict';var _=require('lodash');var moment=require(_0x39d2('0x0'));var random=require('randomstring');var fs=require('fs');var path=require(_0x39d2('0x1'));var util=require(_0x39d2('0x2'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x39d2('0x3'));var config=require('../../../config/environment');function getAddress(_0x422b63){var _0x38658b=_[_0x39d2('0x4')](_0x422b63[_0x39d2('0x5')]);return _0x38658b&&_0x38658b[_0x39d2('0x6')]?_0x38658b[_0x39d2('0x6')]:_0x39d2('0x7')+random[_0x39d2('0x8')](0x6)+_0x39d2('0x9');}function getFirstName(_0x13ab42){var _0x4e8c8b=_[_0x39d2('0x4')](_0x13ab42[_0x39d2('0x5')]);if(_0x4e8c8b&&_0x4e8c8b[_0x39d2('0xa')]){if(_0x4e8c8b[_0x39d2('0xa')]==_0x4e8c8b[_0x39d2('0x6')]){return _0x4e8c8b[_0x39d2('0xa')][_0x39d2('0xb')](0x0,_0x4e8c8b[_0x39d2('0xa')]['indexOf']('@'));}var _0x4eff2d=_0x4e8c8b[_0x39d2('0xa')][_0x39d2('0xc')](/\s+/);return _0x4eff2d[_0x39d2('0xd')]>0x1?_0x4eff2d[_0x39d2('0xe')](0x0,-0x1)[_0x39d2('0xf')]('\x20'):_0x4e8c8b[_0x39d2('0xa')];}return _0x39d2('0x10');}function getLastName(_0x2829c8){var _0x518593=_[_0x39d2('0x4')](_0x2829c8[_0x39d2('0x5')]);if(_0x518593&&_0x518593['name']){var _0x983e10=_0x518593[_0x39d2('0xa')][_0x39d2('0xc')](/\s+/);return _0x983e10[_0x39d2('0xd')]>0x1?_0x983e10[_0x39d2('0x11')]():'';}return'';}function getMails(_0x1e2caa,_0x438945){var _0x54c4e7='';for(var _0x145059=0x0;_0x145059<_0x438945[_0x39d2('0x5')][_0x39d2('0xd')];_0x145059+=0x1){if(_0x438945[_0x39d2('0x5')][_0x145059][_0x39d2('0x6')]!==_0x1e2caa){if(!_[_0x39d2('0x12')](_0x54c4e7)){_0x54c4e7+=',';}_0x54c4e7+=_0x438945[_0x39d2('0x5')][_0x145059][_0x39d2('0xa')]||_0x438945[_0x39d2('0x5')][_0x145059][_0x39d2('0x6')]||'';_0x54c4e7+='\x20<';_0x54c4e7+=_0x438945[_0x39d2('0x5')][_0x145059]['address']?_0x438945[_0x39d2('0x5')][_0x145059][_0x39d2('0x6')]:_0x39d2('0x7')+random[_0x39d2('0x8')](0x6)+'@xcally.com';_0x54c4e7+='>';}}return _0x54c4e7;}function parseEmail(_0x43f17e,_0x12aeb0,_0x3f8628){if(_0x12aeb0['html']){var _0x3dcf79=/)<[^<]*)*<\/script>/gi;while(_0x3dcf79[_0x39d2('0x13')](_0x12aeb0[_0x39d2('0x14')])){_0x12aeb0[_0x39d2('0x14')]=_0x12aeb0[_0x39d2('0x14')]['replace'](_0x3dcf79,'');}if(_0x12aeb0[_0x39d2('0x14')][_0x39d2('0x15')](_0x39d2('0x16'))){var _0x5535ed=[];_0x12aeb0['attachments'][_0x39d2('0x17')](_0x3d8eed=>{_0x5535ed[_0x39d2('0x18')](_0x3d8eed[_0x39d2('0x19')]);});var _0x3c4f95=/]+>/g;var _0x530508=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1eb1e0=_0x12aeb0[_0x39d2('0x14')][_0x39d2('0x1a')](_0x530508,'_SRC');var _0x5700e0=_0x1eb1e0[_0x39d2('0x1a')](_0x3c4f95,_0x39d2('0x1b'));for(let _0x3ef732=0x0;_0x3ef732<_0x5535ed['length'];_0x3ef732++){var _0x40baa9=_0x5700e0[_0x39d2('0x1a')](_0x39d2('0x1b'),_0x39d2('0x1c')+_0x5535ed[_0x3ef732]+_0x39d2('0x1d'));_0x5700e0=_0x40baa9;}_0x12aeb0['html']=_0x5700e0;}_0x3f8628[_0x39d2('0x1e')]=_0x12aeb0[_0x39d2('0x14')];}else{_0x3f8628[_0x39d2('0x1e')]=_0x12aeb0[_0x39d2('0x1f')];}if(_0x3f8628['body']){_0x3f8628[_0x39d2('0x1e')]=_0x3f8628[_0x39d2('0x1e')][_0x39d2('0x1a')](/0x0){var _0x44d547=[_0x39d2('0x2d'),_0x39d2('0x2e'),_0x39d2('0x2f')];for(var _0x12ea82=0x0;_0x12ea82<_0x12aeb0[_0x39d2('0x30')][_0x39d2('0xd')];_0x12ea82++){var _0x3300c9=_[_0x39d2('0x31')](_0x44d547,_0x12aeb0[_0x39d2('0x30')][_0x12ea82][_0x39d2('0x32')]);if(_0x3300c9>=0x0){_0x3f8628[_0x39d2('0x33')]=!![];}}}return _0x3f8628;}exports['parser']=function(_0x2270fe,_0x1223ca,_0x3bb01a){var _0xf915e0={'from':getAddress(_0x1223ca[_0x39d2('0x34')]),'firstName':getFirstName(_0x1223ca[_0x39d2('0x34')]),'lastName':getLastName(_0x1223ca[_0x39d2('0x34')]),'mapKey':'email','message':{'from':getMails(_0x2270fe[_0x39d2('0x3')],_0x1223ca[_0x39d2('0x34')]),'to':_0x2270fe['email'],'cc':'','subject':_0x1223ca['subject']||'','messageId':_0x1223ca[_0x39d2('0x35')],'inReplyTo':_0x1223ca[_0x39d2('0x36')],'sentAt':moment(_0x1223ca['date'])[_0x39d2('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x1223ca[_0x39d2('0x14')]&&!_0x1223ca[_0x39d2('0x1f')]){var _0x4b1e37=_[_0x39d2('0x37')](_0x1223ca[_0x39d2('0x23')],{'contentType':_0x39d2('0x38')});if(_0x4b1e37[_0x39d2('0xd')]){logger['info'](util[_0x39d2('0x28')](_0x39d2('0x39'),_0x1223ca['messageId']));tnef[_0x39d2('0x3a')](_[_0x39d2('0x3b')](_0x4b1e37)[_0x39d2('0x2b')],function(_0xd71718,_0x56591f){if(_0x56591f){_0x1223ca[_0x39d2('0x14')]=_0x56591f[_0x39d2('0x3c')]||'

Empty\x20message

';if(_0x56591f[_0x39d2('0x3d')]){for(var _0x13aef4=0x0;_0x13aef4<_0x56591f[_0x39d2('0x3d')][_0x39d2('0xd')];_0x13aef4++){var _0x2d88a1=_0x56591f['Attachments'][_0x13aef4];_0xf915e0['message'][_0x39d2('0x23')][_0x39d2('0x18')]({'filename':_0x2d88a1[_0x39d2('0x3e')],'content':Buffer[_0x39d2('0x34')](_0x2d88a1[_0x39d2('0x3f')])});}}}_0x3bb01a(parseEmail(_0x2270fe,_0x1223ca,_0xf915e0));});}else{_0x1223ca[_0x39d2('0x14')]=_0x39d2('0x40');_0x3bb01a(parseEmail(_0x2270fe,_0x1223ca,_0xf915e0));}}else{_0x3bb01a(parseEmail(_0x2270fe,_0x1223ca,_0xf915e0));}};exports['generateXOAuth2Token']=function(_0x1eafbd,_0x4761fa){var _0x5e202e=[_0x39d2('0x41')+(_0x4761fa||''),_0x39d2('0x42')+_0x1eafbd,'',''];return Buffer['from'](_0x5e202e[_0x39d2('0xf')](''),_0x39d2('0x43'))['toString'](_0x39d2('0x44'));}; \ No newline at end of file +var _0x80a1=['format','%s-%s','now','server/files/attachments/','content','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','parser','from','subject','messageId','inReplyTo','filter','info','first','

Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','generate','@xcally.com','name','substring','indexOf','split','slice','join','length','pop','isEmpty','html','test','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originTo','email','includes','bcc','attachments','attach','attachment','attachment-'];(function(_0x33ad45,_0x5c9ca4){var _0x4508d7=function(_0x5efbb5){while(--_0x5efbb5){_0x33ad45['push'](_0x33ad45['shift']());}};_0x4508d7(++_0x5c9ca4);}(_0x80a1,0x185));var _0x180a=function(_0x23c20b,_0x51a195){_0x23c20b=_0x23c20b-0x0;var _0x39cd83=_0x80a1[_0x23c20b];return _0x39cd83;};'use strict';var _=require(_0x180a('0x0'));var moment=require(_0x180a('0x1'));var random=require(_0x180a('0x2'));var fs=require('fs');var path=require(_0x180a('0x3'));var util=require(_0x180a('0x4'));var tnef=require(_0x180a('0x5'));var logger=require(_0x180a('0x6'))('email');var config=require(_0x180a('0x7'));function getAddress(_0x1de20f){var _0xa44443=_[_0x180a('0x8')](_0x1de20f[_0x180a('0x9')]);return _0xa44443&&_0xa44443[_0x180a('0xa')]?_0xa44443['address']:'anonymous'+random[_0x180a('0xb')](0x6)+_0x180a('0xc');}function getFirstName(_0x377aee){var _0x4a59ab=_[_0x180a('0x8')](_0x377aee[_0x180a('0x9')]);if(_0x4a59ab&&_0x4a59ab[_0x180a('0xd')]){if(_0x4a59ab[_0x180a('0xd')]==_0x4a59ab[_0x180a('0xa')]){return _0x4a59ab[_0x180a('0xd')][_0x180a('0xe')](0x0,_0x4a59ab[_0x180a('0xd')][_0x180a('0xf')]('@'));}var _0x3d17e8=_0x4a59ab[_0x180a('0xd')][_0x180a('0x10')](/\s+/);return _0x3d17e8['length']>0x1?_0x3d17e8[_0x180a('0x11')](0x0,-0x1)[_0x180a('0x12')]('\x20'):_0x4a59ab[_0x180a('0xd')];}return'Anonymous';}function getLastName(_0x82d3d5){var _0xd9bf49=_[_0x180a('0x8')](_0x82d3d5[_0x180a('0x9')]);if(_0xd9bf49&&_0xd9bf49[_0x180a('0xd')]){var _0x53b0f8=_0xd9bf49[_0x180a('0xd')]['split'](/\s+/);return _0x53b0f8[_0x180a('0x13')]>0x1?_0x53b0f8[_0x180a('0x14')]():'';}return'';}function getMails(_0x2ed1ab,_0x7ee3a0){var _0x9553db='';for(var _0x33610c=0x0;_0x33610c<_0x7ee3a0[_0x180a('0x9')][_0x180a('0x13')];_0x33610c+=0x1){if(_0x7ee3a0['value'][_0x33610c][_0x180a('0xa')]!==_0x2ed1ab){if(!_[_0x180a('0x15')](_0x9553db)){_0x9553db+=',';}_0x9553db+=_0x7ee3a0[_0x180a('0x9')][_0x33610c][_0x180a('0xd')]||_0x7ee3a0[_0x180a('0x9')][_0x33610c][_0x180a('0xa')]||'';_0x9553db+='\x20<';_0x9553db+=_0x7ee3a0[_0x180a('0x9')][_0x33610c][_0x180a('0xa')]?_0x7ee3a0[_0x180a('0x9')][_0x33610c][_0x180a('0xa')]:'anonymous'+random[_0x180a('0xb')](0x6)+_0x180a('0xc');_0x9553db+='>';}}return _0x9553db;}function parseEmail(_0x56b91c,_0x52a7ca,_0x360908){if(_0x52a7ca[_0x180a('0x16')]){var _0x475531=/)<[^<]*)*<\/script>/gi;while(_0x475531[_0x180a('0x17')](_0x52a7ca[_0x180a('0x16')])){_0x52a7ca['html']=_0x52a7ca['html']['replace'](_0x475531,'');}if(_0x52a7ca[_0x180a('0x16')]['includes'](_0x180a('0x18'))){var _0x1acc29=[];_0x52a7ca['attachments'][_0x180a('0x19')](_0x4fec98=>{_0x1acc29['push'](_0x4fec98[_0x180a('0x1a')]);});var _0x5c0a6f=/]+>/g;var _0x2921b8=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3eeab6=_0x52a7ca['html'][_0x180a('0x1b')](_0x2921b8,_0x180a('0x1c'));var _0x5e27ab=_0x3eeab6[_0x180a('0x1b')](_0x5c0a6f,_0x180a('0x1d'));for(let _0x5d9118=0x0;_0x5d9118<_0x1acc29[_0x180a('0x13')];_0x5d9118++){var _0x47e949=_0x5e27ab[_0x180a('0x1b')](_0x180a('0x1d'),_0x180a('0x1e')+_0x1acc29[_0x5d9118]+_0x180a('0x1f'));_0x5e27ab=_0x47e949;}_0x52a7ca[_0x180a('0x16')]=_0x5e27ab;}_0x360908['body']=_0x52a7ca['html'];}else{_0x360908[_0x180a('0x20')]=_0x52a7ca[_0x180a('0x21')];}if(_0x360908[_0x180a('0x20')]){_0x360908[_0x180a('0x20')]=_0x360908[_0x180a('0x20')]['replace'](/0x0){var _0x26b23d=[_0x180a('0x33'),_0x180a('0x34'),_0x180a('0x35')];for(var _0x308cfe=0x0;_0x308cfe<_0x52a7ca[_0x180a('0x32')][_0x180a('0x13')];_0x308cfe++){var _0x35fea0=_['indexOf'](_0x26b23d,_0x52a7ca['headerLines'][_0x308cfe][_0x180a('0x36')]);if(_0x35fea0>=0x0){_0x360908['isAutoreply']=!![];}}}return _0x360908;}exports[_0x180a('0x37')]=function(_0x1c6a9d,_0x21806c,_0x165730){var _0x42122c={'from':getAddress(_0x21806c[_0x180a('0x38')]),'firstName':getFirstName(_0x21806c[_0x180a('0x38')]),'lastName':getLastName(_0x21806c[_0x180a('0x38')]),'mapKey':'email','message':{'from':getMails(_0x1c6a9d[_0x180a('0x24')],_0x21806c[_0x180a('0x38')]),'to':_0x1c6a9d['email'],'cc':'','subject':_0x21806c[_0x180a('0x39')]||'','messageId':_0x21806c[_0x180a('0x3a')],'inReplyTo':_0x21806c[_0x180a('0x3b')],'sentAt':moment(_0x21806c['date'])[_0x180a('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x21806c[_0x180a('0x16')]&&!_0x21806c[_0x180a('0x21')]){var _0x164477=_[_0x180a('0x3c')](_0x21806c[_0x180a('0x27')],{'contentType':'application/ms-tnef'});if(_0x164477['length']){logger[_0x180a('0x3d')](util[_0x180a('0x2b')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x21806c['messageId']));tnef['parseBuffer'](_[_0x180a('0x3e')](_0x164477)['content'],function(_0x21c3b8,_0x2c4bf9){if(_0x2c4bf9){_0x21806c['html']=_0x2c4bf9['BodyHTML']||_0x180a('0x3f');if(_0x2c4bf9[_0x180a('0x40')]){for(var _0x59d1f7=0x0;_0x59d1f7<_0x2c4bf9['Attachments'][_0x180a('0x13')];_0x59d1f7++){var _0x20af02=_0x2c4bf9[_0x180a('0x40')][_0x59d1f7];_0x42122c[_0x180a('0x22')][_0x180a('0x27')]['push']({'filename':_0x20af02[_0x180a('0x41')],'content':Buffer[_0x180a('0x38')](_0x20af02[_0x180a('0x42')])});}}}_0x165730(parseEmail(_0x1c6a9d,_0x21806c,_0x42122c));});}else{_0x21806c[_0x180a('0x16')]=_0x180a('0x3f');_0x165730(parseEmail(_0x1c6a9d,_0x21806c,_0x42122c));}}else{_0x165730(parseEmail(_0x1c6a9d,_0x21806c,_0x42122c));}};exports[_0x180a('0x43')]=function(_0x50dcde,_0x3cb53b){var _0x11000d=[_0x180a('0x44')+(_0x3cb53b||''),_0x180a('0x45')+_0x50dcde,'',''];return Buffer[_0x180a('0x38')](_0x11000d[_0x180a('0x12')](''),_0x180a('0x46'))[_0x180a('0x47')]('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 58378e9..b5f7fb6 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8dde=['exports','lodash','name','Service','key','SERV','active','Imap','Smtp'];(function(_0x5de3a6,_0x12bca5){var _0x4caac7=function(_0x53f91a){while(--_0x53f91a){_0x5de3a6['push'](_0x5de3a6['shift']());}};_0x4caac7(++_0x12bca5);}(_0x8dde,0x9a));var _0xe8dd=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x8dde[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require(_0xe8dd('0x0'));function MailAccount(_0x109166){this['id']=_0x109166['id']||0x0;this[_0xe8dd('0x1')]=_0x109166[_0xe8dd('0x1')]||_0xe8dd('0x2');this[_0xe8dd('0x3')]=_0x109166[_0xe8dd('0x3')]||_0xe8dd('0x4');this[_0xe8dd('0x5')]=_0x109166[_0xe8dd('0x5')]||![];this[_0xe8dd('0x6')]=_0x109166[_0xe8dd('0x6')]||[];this[_0xe8dd('0x7')]=_0x109166['Smtp']||[];}module[_0xe8dd('0x8')]=MailAccount; \ No newline at end of file +var _0xbe3c=['Smtp','exports','lodash','name','Service','key','SERV','active','Imap'];(function(_0x2a1583,_0x1156d6){var _0x542a44=function(_0x41d8d1){while(--_0x41d8d1){_0x2a1583['push'](_0x2a1583['shift']());}};_0x542a44(++_0x1156d6);}(_0xbe3c,0xbf));var _0xcbe3=function(_0x4ff443,_0x5e1148){_0x4ff443=_0x4ff443-0x0;var _0x12832a=_0xbe3c[_0x4ff443];return _0x12832a;};'use strict';var _=require(_0xcbe3('0x0'));function MailAccount(_0x35218f){this['id']=_0x35218f['id']||0x0;this[_0xcbe3('0x1')]=_0x35218f[_0xcbe3('0x1')]||_0xcbe3('0x2');this['key']=_0x35218f[_0xcbe3('0x3')]||_0xcbe3('0x4');this[_0xcbe3('0x5')]=_0x35218f['active']||![];this[_0xcbe3('0x6')]=_0x35218f[_0xcbe3('0x6')]||[];this[_0xcbe3('0x7')]=_0x35218f[_0xcbe3('0x7')]||[];}module[_0xcbe3('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 533066e..df4e7e0 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa407=['initMailAccounts','length','isUndefined','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','mergeFromDatabase','prototype'];(function(_0x48338c,_0x579750){var _0x411564=function(_0x4440c3){while(--_0x4440c3){_0x48338c['push'](_0x48338c['shift']());}};_0x411564(++_0x579750);}(_0xa407,0x93));var _0x7a40=function(_0x18e781,_0x297e3d){_0x18e781=_0x18e781-0x0;var _0x1a60ef=_0xa407[_0x18e781];return _0x1a60ef;};'use strict';var _=require(_0x7a40('0x0'));var MailAccount=require(_0x7a40('0x1'));var Realtime=function(){this[_0x7a40('0x2')]={};};function freeIsNotKey(_0x2dc9fa,_0x5dc682,_0x59218c){var _0x383692=_[_0x7a40('0x3')](_0x2dc9fa,function(_0x34e0f0,_0x265ce3){return _0x34e0f0[_0x59218c];});for(var _0x310ebb in _0x5dc682){if(_0x5dc682[_0x7a40('0x4')](_0x310ebb)){if(!_0x383692[_0x310ebb]){delete _0x5dc682[_0x310ebb];}}}}Realtime['prototype'][_0x7a40('0x5')]=function(_0x3641c1,_0x4b09d5){for(var _0x59d826 in _0x4b09d5){if(_0x3641c1['hasOwnProperty'](_0x59d826)){_0x3641c1[_0x59d826]=_0x4b09d5[_0x59d826];}}};Realtime[_0x7a40('0x6')][_0x7a40('0x7')]=function(){var _0x2de832=this;return function(_0x2efe87){if(_0x2efe87){freeIsNotKey(_0x2efe87,_0x2de832['mailAccounts'],'id');for(var _0x5b6b50=0x0,_0x40cc9d={},_0x4e3bc9={};_0x5b6b50<_0x2efe87[_0x7a40('0x8')];_0x5b6b50+=0x1){_0x40cc9d=_0x2efe87[_0x5b6b50];if(_[_0x7a40('0x9')](_0x2de832[_0x7a40('0x2')][_0x40cc9d['id']])){_0x2de832[_0x7a40('0x2')][_0x40cc9d['id']]=new MailAccount(_0x40cc9d);}else{_['merge'](_0x2de832[_0x7a40('0x2')][_0x40cc9d['id']],_0x40cc9d);}}}return _0x2de832[_0x7a40('0x2')];};};module[_0x7a40('0xa')]=Realtime; \ No newline at end of file +var _0x2568=['../model/mailAccount','mailAccounts','hasOwnProperty','initMailAccounts','length','isUndefined','lodash'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2568,0x110));var _0x8256=function(_0x18198b,_0x20dca6){_0x18198b=_0x18198b-0x0;var _0x1400ff=_0x2568[_0x18198b];return _0x1400ff;};'use strict';var _=require(_0x8256('0x0'));var MailAccount=require(_0x8256('0x1'));var Realtime=function(){this[_0x8256('0x2')]={};};function freeIsNotKey(_0xe20d24,_0x42e665,_0x7faacf){var _0x238cda=_['mapKeys'](_0xe20d24,function(_0x1ad28a,_0x47b0ad){return _0x1ad28a[_0x7faacf];});for(var _0x8124cc in _0x42e665){if(_0x42e665['hasOwnProperty'](_0x8124cc)){if(!_0x238cda[_0x8124cc]){delete _0x42e665[_0x8124cc];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x102cd6,_0x1d417e){for(var _0x1ee667 in _0x1d417e){if(_0x102cd6[_0x8256('0x3')](_0x1ee667)){_0x102cd6[_0x1ee667]=_0x1d417e[_0x1ee667];}}};Realtime['prototype'][_0x8256('0x4')]=function(){var _0x43b8e3=this;return function(_0x18dd76){if(_0x18dd76){freeIsNotKey(_0x18dd76,_0x43b8e3[_0x8256('0x2')],'id');for(var _0x15359c=0x0,_0x3b31c7={},_0x1fb455={};_0x15359c<_0x18dd76[_0x8256('0x5')];_0x15359c+=0x1){_0x3b31c7=_0x18dd76[_0x15359c];if(_[_0x8256('0x6')](_0x43b8e3['mailAccounts'][_0x3b31c7['id']])){_0x43b8e3[_0x8256('0x2')][_0x3b31c7['id']]=new MailAccount(_0x3b31c7);}else{_['merge'](_0x43b8e3[_0x8256('0x2')][_0x3b31c7['id']],_0x3b31c7);}}}return _0x43b8e3[_0x8256('0x2')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index cf4ddaa..09aaa7d 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe61c=['Smtp','getMailAccount','notify','NotifyMailAccount','../client','Request','GetMailAccount','name','email','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','MailServerOut'];(function(_0x2e2e41,_0x3a7848){var _0x266226=function(_0x458e0a){while(--_0x458e0a){_0x2e2e41['push'](_0x2e2e41['shift']());}};_0x266226(++_0x3a7848);}(_0xe61c,0xee));var _0xce61=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xe61c[_0x6cf19c];return _0xce14f3;};'use strict';var client=require(_0xce61('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0xce61('0x1')](_0xce61('0x2'),{'options':{'attributes':['id',_0xce61('0x3'),'provider','service',_0xce61('0x4'),'active',_0xce61('0x5'),_0xce61('0x6'),_0xce61('0x7')],'raw':![],'include':[{'model':_0xce61('0x8'),'as':_0xce61('0x9'),'include':[{'model':_0xce61('0xa'),'attributes':['id',_0xce61('0x3'),'service',_0xce61('0xb'),_0xce61('0xc')],'as':_0xce61('0xa')}]},{'model':_0xce61('0xd'),'as':_0xce61('0xe'),'include':[{'model':_0xce61('0xa'),'attributes':['id',_0xce61('0x3'),'service',_0xce61('0xb'),_0xce61('0xc')],'as':'CloudProvider'}]}]},'log':_0xce61('0xf')});};};exports[_0xce61('0x10')]=function(_0x50a936,_0x32e03e){return client['Request'](_0xce61('0x11'),{'account':{'id':_0x50a936},'body':_0x32e03e,'log':_0xce61('0x11')});}; \ No newline at end of file +var _0xb0e5=['MailServerOut','Smtp','getMailAccount','notify','../client','getMailAccounts','Request','GetMailAccount','name','email','key','TemplateId','MailServerIn','service','type','data5','CloudProvider'];(function(_0x1720f6,_0x5e9128){var _0x46e9fd=function(_0x4e3c53){while(--_0x4e3c53){_0x1720f6['push'](_0x1720f6['shift']());}};_0x46e9fd(++_0x5e9128);}(_0xb0e5,0x1ad));var _0x5b0e=function(_0x3e98d1,_0x45e559){_0x3e98d1=_0x3e98d1-0x0;var _0x2fcfb0=_0xb0e5[_0x3e98d1];return _0x2fcfb0;};'use strict';var client=require(_0x5b0e('0x0'));exports[_0x5b0e('0x1')]=function(){return function(){return client[_0x5b0e('0x2')](_0x5b0e('0x3'),{'options':{'attributes':['id',_0x5b0e('0x4'),'provider','service',_0x5b0e('0x5'),'active',_0x5b0e('0x6'),'ListId',_0x5b0e('0x7')],'raw':![],'include':[{'model':_0x5b0e('0x8'),'as':'Imap','include':[{'model':'CloudProvider','attributes':['id',_0x5b0e('0x4'),_0x5b0e('0x9'),_0x5b0e('0xa'),_0x5b0e('0xb')],'as':_0x5b0e('0xc')}]},{'model':_0x5b0e('0xd'),'as':_0x5b0e('0xe'),'include':[{'model':_0x5b0e('0xc'),'attributes':['id',_0x5b0e('0x4'),'service',_0x5b0e('0xa'),'data5'],'as':'CloudProvider'}]}]},'log':_0x5b0e('0xf')});};};exports[_0x5b0e('0x10')]=function(_0x3d0b5e,_0x526ad2){return client[_0x5b0e('0x2')]('NotifyMailAccount',{'account':{'id':_0x3d0b5e},'body':_0x526ad2,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 00f1938..7e0fb9b 100644 --- a/server/services/email/rpc/setting.js +++ b/server/services/email/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e50=['GetSettings','../client','getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x59eacf,_0x56ec4a){var _0x5d74f2=function(_0x5476ed){while(--_0x5476ed){_0x59eacf['push'](_0x59eacf['shift']());}};_0x5d74f2(++_0x56ec4a);}(_0x8e50,0xeb));var _0x08e5=function(_0x19ee3a,_0x1c597f){_0x19ee3a=_0x19ee3a-0x0;var _0x3d7d89=_0x8e50[_0x19ee3a];return _0x3d7d89;};'use strict';var client=require(_0x08e5('0x0'));exports[_0x08e5('0x1')]=function(){return client[_0x08e5('0x2')](_0x08e5('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x08e5('0x4')]},'log':_0x08e5('0x5')});}; \ No newline at end of file +var _0x74ce=['../client','getSettings','Request','GetSettings'];(function(_0x3f31a5,_0x526752){var _0x5e27e0=function(_0xd3b2ce){while(--_0xd3b2ce){_0x3f31a5['push'](_0x3f31a5['shift']());}};_0x5e27e0(++_0x526752);}(_0x74ce,0x178));var _0xe74c=function(_0x2f34b6,_0x201448){_0x2f34b6=_0x2f34b6-0x0;var _0x1aad52=_0x74ce[_0x2f34b6];return _0x1aad52;};'use strict';var client=require(_0xe74c('0x0'));exports[_0xe74c('0x1')]=function(){return client[_0xe74c('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xe74c('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 303176e..a6357a1 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 857b1bb..3147342 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b53=['createServer','listen','port','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','sticky-session','ioredis'];(function(_0x36f3df,_0x2b1621){var _0xcfb7b7=function(_0xcc9fc0){while(--_0xcc9fc0){_0x36f3df['push'](_0x36f3df['shift']());}};_0xcfb7b7(++_0x2b1621);}(_0x2b53,0x183));var _0x32b5=function(_0x5a14d6,_0x52b6f8){_0x5a14d6=_0x5a14d6-0x0;var _0x11865f=_0x2b53[_0x5a14d6];return _0x11865f;};'use strict';var _=require('lodash');var http=require(_0x32b5('0x0'));var express=require(_0x32b5('0x1'));var sticky=require(_0x32b5('0x2'));var Redis=require(_0x32b5('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0x32b5('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0x32b5('0x5')](server,config[_0x32b5('0x6')])){var socketio=require('socket.io')(server,{'transports':[_0x32b5('0x7'),_0x32b5('0x8')]});config[_0x32b5('0x9')]=_[_0x32b5('0xa')](config[_0x32b5('0x9')],{'host':_0x32b5('0xb'),'port':0x18eb});socketio[_0x32b5('0xc')](require(_0x32b5('0xd'))({'pubClient':new Redis(config[_0x32b5('0x9')]),'subClient':new Redis(config[_0x32b5('0x9')])}));require(_0x32b5('0xe'))[_0x32b5('0xf')]();require(_0x32b5('0x10'))[_0x32b5('0xf')](socketio);require('../../config/express')[_0x32b5('0xf')](app);require(_0x32b5('0x11'))[_0x32b5('0xf')](app);}else{server[_0x32b5('0x12')](_0x32b5('0x13'),function(){console[_0x32b5('0x14')](_0x32b5('0x15'),config[_0x32b5('0x6')]);});}exports=module[_0x32b5('0x16')]=app; \ No newline at end of file +var _0x394e=['localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','polling','redis'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x394e,0x1a9));var _0xe394=function(_0x2fbb45,_0x1b2c7f){_0x2fbb45=_0x2fbb45-0x0;var _0x526325=_0x394e[_0x2fbb45];return _0x526325;};'use strict';var _=require(_0xe394('0x0'));var http=require(_0xe394('0x1'));var express=require(_0xe394('0x2'));var sticky=require('sticky-session');var Redis=require(_0xe394('0x3'));var config=require(_0xe394('0x4'));var app=express();var server=http[_0xe394('0x5')](app);server[_0xe394('0x6')]=0xdbba0;if(sticky[_0xe394('0x7')](server,config[_0xe394('0x8')])){var socketio=require(_0xe394('0x9'))(server,{'transports':['websocket',_0xe394('0xa')]});config[_0xe394('0xb')]=_['defaults'](config[_0xe394('0xb')],{'host':_0xe394('0xc'),'port':0x18eb});socketio[_0xe394('0xd')](require(_0xe394('0xe'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xe394('0xb')])}));require(_0xe394('0xf'))[_0xe394('0x10')]();require(_0xe394('0x11'))[_0xe394('0x10')](socketio);require('../../config/express')[_0xe394('0x10')](app);require(_0xe394('0x12'))['default'](app);}else{server[_0xe394('0x13')]('listening',function(){console[_0xe394('0x14')](_0xe394('0x15'),config[_0xe394('0x8')]);});}exports=module[_0xe394('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index e9a7dd4..dd1920b 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x725f=['http','Request','request','then','rpc','error','message','result','exports','jayson/promise','bluebird','routing','client'];(function(_0x174530,_0xc92416){var _0x260378=function(_0x4740dd){while(--_0x4740dd){_0x174530['push'](_0x174530['shift']());}};_0x260378(++_0xc92416);}(_0x725f,0x98));var _0xf725=function(_0x2ecc14,_0x27a19c){_0x2ecc14=_0x2ecc14-0x0;var _0x24ba1e=_0x725f[_0x2ecc14];return _0x24ba1e;};'use strict';var jayson=require(_0xf725('0x0'));var BPromise=require(_0xf725('0x1'));var logger=require('../../config/logger')(_0xf725('0x2'));var client=jayson[_0xf725('0x3')][_0xf725('0x4')]({'port':0x2329});client[_0xf725('0x5')]=function(_0x95685,_0x4627e6){return new BPromise(function(_0x3476fc,_0xa0f9c0){return client[_0xf725('0x6')](_0x95685,_0x4627e6)[_0xf725('0x7')](function(_0x5b820b){logger['debug'](_0xf725('0x8'),_0xf725('0x2'),_0x95685,_0x4627e6,_0x5b820b);if(_0x5b820b[_0xf725('0x9')]){logger[_0xf725('0x9')](_0xf725('0x8'),_0xf725('0x2'),_0x95685,_0x5b820b['error'][_0xf725('0xa')],_0x4627e6);return _0xa0f9c0(_0x5b820b[_0xf725('0x9')]['message']);}else{return _0x3476fc(_0x5b820b[_0xf725('0xb')]);}})['catch'](function(_0x31393a){logger[_0xf725('0x9')]('rpc',_0xf725('0x2'),_0x95685,_0x31393a,_0x4627e6);return _0xa0f9c0(_0x31393a);});});};module[_0xf725('0xc')]=client; \ No newline at end of file +var _0x57d4=['Request','request','then','routing','error','rpc','message','result','exports','bluebird','../../config/logger','client'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x57d4,0x75));var _0x457d=function(_0x38c16d,_0x12c7a3){_0x38c16d=_0x38c16d-0x0;var _0x20d775=_0x57d4[_0x38c16d];return _0x20d775;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x457d('0x0'));var logger=require(_0x457d('0x1'))('routing');var client=jayson[_0x457d('0x2')]['http']({'port':0x2329});client[_0x457d('0x3')]=function(_0x31c2c9,_0x3ea8b7){return new BPromise(function(_0x189d7c,_0x4fde7c){return client[_0x457d('0x4')](_0x31c2c9,_0x3ea8b7)[_0x457d('0x5')](function(_0x6b36){logger['debug']('rpc',_0x457d('0x6'),_0x31c2c9,_0x3ea8b7,_0x6b36);if(_0x6b36['error']){logger[_0x457d('0x7')](_0x457d('0x8'),_0x457d('0x6'),_0x31c2c9,_0x6b36[_0x457d('0x7')][_0x457d('0x9')],_0x3ea8b7);return _0x4fde7c(_0x6b36[_0x457d('0x7')][_0x457d('0x9')]);}else{return _0x189d7c(_0x6b36[_0x457d('0xa')]);}})['catch'](function(_0x27f12d){logger[_0x457d('0x7')](_0x457d('0x8'),_0x457d('0x6'),_0x31c2c9,_0x27f12d,_0x3ea8b7);return _0x4fde7c(_0x27f12d);});});};module[_0x457d('0xb')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 83ff4b3..01051c4 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd54c=['initMailQueues','getFaxQueues','initWhatsappQueues','catch','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','then','getAgents','initIntervals','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues'];(function(_0x17997d,_0x2264a4){var _0x5dbd8d=function(_0x5d2aca){while(--_0x5d2aca){_0x17997d['push'](_0x17997d['shift']());}};_0x5dbd8d(++_0x2264a4);}(_0xd54c,0x1bc));var _0xcd54=function(_0x355d24,_0x28bab1){_0x355d24=_0x355d24-0x0;var _0xcef39a=_0xd54c[_0x355d24];return _0xcef39a;};'use strict';var BPromise=require(_0xcd54('0x0'));var server=require(_0xcd54('0x1'));var Realtime=require(_0xcd54('0x2'));var user=require(_0xcd54('0x3'));var interval=require(_0xcd54('0x4'));var openchannelQueue=require(_0xcd54('0x5'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xcd54('0x6'));var mailQueue=require(_0xcd54('0x7'));var faxQueue=require(_0xcd54('0x8'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xcd54('0x9')](user[_0xcd54('0xa')]())[_0xcd54('0x9')](realtime['initAgents']())[_0xcd54('0x9')](interval['getIntervals']())[_0xcd54('0x9')](realtime[_0xcd54('0xb')]())[_0xcd54('0x9')](openchannelQueue['getOpenchannelQueues']())[_0xcd54('0x9')](realtime['initOpenchannelQueues']())[_0xcd54('0x9')](chatQueue['getChatQueues']())[_0xcd54('0x9')](realtime[_0xcd54('0xc')]())['then'](smsQueue[_0xcd54('0xd')]())[_0xcd54('0x9')](realtime[_0xcd54('0xe')]())[_0xcd54('0x9')](mailQueue[_0xcd54('0xf')]())[_0xcd54('0x9')](realtime[_0xcd54('0x10')]())[_0xcd54('0x9')](faxQueue[_0xcd54('0x11')]())[_0xcd54('0x9')](realtime['initFaxQueues']())[_0xcd54('0x9')](whatsappQueue['getWhatsappQueues']())[_0xcd54('0x9')](realtime[_0xcd54('0x12')]())[_0xcd54('0x9')](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x51205e){return initRealtime();})[_0xcd54('0x9')](function(_0x11bf2d){return setInterval(initRealtime,0x1388);})[_0xcd54('0x13')](function(_0x17f7e3){console['log'](_0x17f7e3);});}main(); \ No newline at end of file +var _0x84b4=['initSmsQueues','getMailQueues','initMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues'];(function(_0x550a09,_0x54b8dc){var _0x4ca9cd=function(_0x233661){while(--_0x233661){_0x550a09['push'](_0x550a09['shift']());}};_0x4ca9cd(++_0x54b8dc);}(_0x84b4,0x104));var _0x484b=function(_0x3e3217,_0x518c13){_0x3e3217=_0x3e3217-0x0;var _0x425fac=_0x84b4[_0x3e3217];return _0x425fac;};'use strict';var BPromise=require(_0x484b('0x0'));var server=require('./server');var Realtime=require(_0x484b('0x1'));var user=require(_0x484b('0x2'));var interval=require(_0x484b('0x3'));var openchannelQueue=require(_0x484b('0x4'));var chatQueue=require(_0x484b('0x5'));var smsQueue=require(_0x484b('0x6'));var mailQueue=require(_0x484b('0x7'));var faxQueue=require(_0x484b('0x8'));var whatsappQueue=require(_0x484b('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x484b('0xa')]()[_0x484b('0xb')](user[_0x484b('0xc')]())[_0x484b('0xb')](realtime[_0x484b('0xd')]())['then'](interval[_0x484b('0xe')]())[_0x484b('0xb')](realtime[_0x484b('0xf')]())[_0x484b('0xb')](openchannelQueue[_0x484b('0x10')]())['then'](realtime[_0x484b('0x11')]())[_0x484b('0xb')](chatQueue['getChatQueues']())['then'](realtime[_0x484b('0x12')]())[_0x484b('0xb')](smsQueue[_0x484b('0x13')]())[_0x484b('0xb')](realtime[_0x484b('0x14')]())['then'](mailQueue[_0x484b('0x15')]())['then'](realtime[_0x484b('0x16')]())['then'](faxQueue['getFaxQueues']())[_0x484b('0xb')](realtime[_0x484b('0x17')]())[_0x484b('0xb')](whatsappQueue[_0x484b('0x18')]())[_0x484b('0xb')](realtime[_0x484b('0x19')]())['then'](function(){return realtime;});}function main(){return server[_0x484b('0x1a')](realtime)['then'](function(_0xd223a8){return initRealtime();})[_0x484b('0xb')](function(_0x168b2d){return setInterval(initRealtime,0x1388);})[_0x484b('0x1b')](function(_0x209d04){console['log'](_0x209d04);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index 9bd6ca4..39da235 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x2a6463,_0xbf0e47){var _0x59b812=function(_0x4913b1){while(--_0x4913b1){_0x2a6463['push'](_0x2a6463['shift']());}};_0x59b812(++_0xbf0e47);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xc4aa[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file +var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x34d103,_0x362659){var _0x5a975d=function(_0x5cfaa0){while(--_0x5cfaa0){_0x34d103['push'](_0x34d103['shift']());}};_0x5a975d(++_0x362659);}(_0x5fc3,0xa8));var _0x35fc=function(_0x329437,_0x1de73a){_0x329437=_0x329437-0x0;var _0x3789d9=_0x5fc3[_0x329437];return _0x3789d9;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index d64a87b..4a9ac8a 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e1a=['bluebird','jayson/promise','then','error','message','result','catch'];(function(_0x16ef97,_0x3549e4){var _0x71c41=function(_0x5a9be4){while(--_0x5a9be4){_0x16ef97['push'](_0x16ef97['shift']());}};_0x71c41(++_0x3549e4);}(_0x0e1a,0xee));var _0xa0e1=function(_0x1c717a,_0x33fa97){_0x1c717a=_0x1c717a-0x0;var _0xafc905=_0x0e1a[_0x1c717a];return _0xafc905;};'use strict';var BPromise=require(_0xa0e1('0x0'));var jayson=require(_0xa0e1('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x4b23da,_0x47953a){return new BPromise(function(_0x168f51,_0x2d8d50){return client['request'](_0x4b23da,_0x47953a)[_0xa0e1('0x2')](function(_0x470843){if(_0x470843['error']){return _0x2d8d50(_0x470843[_0xa0e1('0x3')][_0xa0e1('0x4')]);}else{return _0x168f51(_0x470843[_0xa0e1('0x5')]);}})[_0xa0e1('0x6')](function(_0x3b053b){return _0x2d8d50(_0x3b053b);});});}exports['sendMailMessage']=function(_0x32b155,_0x13b024){return request('SendMail',{'account':_0x32b155,'message':_0x13b024});}; \ No newline at end of file +var _0xa571=['catch','sendMailMessage','SendMail','bluebird','client','http','request','then','error','message','result'];(function(_0x4549ce,_0x5e0e98){var _0x260434=function(_0x8031ce){while(--_0x8031ce){_0x4549ce['push'](_0x4549ce['shift']());}};_0x260434(++_0x5e0e98);}(_0xa571,0x71));var _0x1a57=function(_0xb3beb1,_0x4a5118){_0xb3beb1=_0xb3beb1-0x0;var _0xd1f8e9=_0xa571[_0xb3beb1];return _0xd1f8e9;};'use strict';var BPromise=require(_0x1a57('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x1a57('0x1')][_0x1a57('0x2')]({'port':0x232b});function request(_0x4a94f1,_0x1ae4f4){return new BPromise(function(_0x1155e6,_0x2ca8ef){return client[_0x1a57('0x3')](_0x4a94f1,_0x1ae4f4)[_0x1a57('0x4')](function(_0x428e04){if(_0x428e04[_0x1a57('0x5')]){return _0x2ca8ef(_0x428e04[_0x1a57('0x5')][_0x1a57('0x6')]);}else{return _0x1155e6(_0x428e04[_0x1a57('0x7')]);}})[_0x1a57('0x8')](function(_0x283178){return _0x2ca8ef(_0x283178);});});}exports[_0x1a57('0x9')]=function(_0x1e3c01,_0x14340d){return request(_0x1a57('0xa'),{'account':_0x1e3c01,'message':_0x14340d});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 23572e7..56ebd42 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6050=['Status','StatusTime','format','online','faxStatusTime','smsStatus','stringify','emit','user:routing:update','exports','lodash','md5','moment','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','chat','openchannel','length'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x6050,0x196));var _0x0605=function(_0x4527e9,_0x777c23){_0x4527e9=_0x4527e9-0x0;var _0x5dbb97=_0x6050[_0x4527e9];return _0x5dbb97;};'use strict';var _=require(_0x0605('0x0'));var md5=require(_0x0605('0x1'));var moment=require(_0x0605('0x2'));var Redis=require(_0x0605('0x3'));var config=require(_0x0605('0x4'));config[_0x0605('0x5')]=_['defaults'](config[_0x0605('0x5')],{'host':_0x0605('0x6'),'port':0x18eb});var io=require(_0x0605('0x7'))(new Redis(config['redis']));function Agent(_0x533b6d){this['id']=_0x533b6d['id']||0x0;this['name']=_0x533b6d[_0x0605('0x8')]||'';this['online']=_0x533b6d['online']||!![];this['voicePause']=_0x533b6d[_0x0605('0x9')]||![];this[_0x0605('0xa')]=_0x533b6d[_0x0605('0xa')]||![];this[_0x0605('0xb')]=_0x533b6d[_0x0605('0xb')]||![];this['faxPause']=_0x533b6d[_0x0605('0xc')]||![];this[_0x0605('0xd')]=_0x533b6d[_0x0605('0xd')]||![];this[_0x0605('0xe')]=_0x533b6d[_0x0605('0xe')]||![];this[_0x0605('0xf')]=_0x0605('0x10');this[_0x0605('0x11')]=0x0;this[_0x0605('0x12')]=_0x533b6d[_0x0605('0x12')]||0x0;this[_0x0605('0x13')]=0x0;this[_0x0605('0x14')]=_0x0605('0x10');this[_0x0605('0x15')]=0x0;this[_0x0605('0x16')]=_0x533b6d[_0x0605('0x16')]||0x0;this[_0x0605('0x17')]=0x0;this[_0x0605('0x18')]=_0x0605('0x10');this['faxStatusTime']=0x0;this[_0x0605('0x19')]=_0x533b6d[_0x0605('0x19')]||0x0;this[_0x0605('0x1a')]=0x0;this['smsStatus']='unknown';this[_0x0605('0x1b')]=0x0;this[_0x0605('0x1c')]=_0x533b6d[_0x0605('0x1c')]||0x0;this[_0x0605('0x1d')]=0x0;this[_0x0605('0x1e')]=_0x0605('0x10');this[_0x0605('0x1f')]=0x0;this[_0x0605('0x20')]=_0x533b6d[_0x0605('0x20')]||0x0;this[_0x0605('0x21')]=0x0;this[_0x0605('0x22')]=_0x0605('0x10');this[_0x0605('0x23')]=0x0;this[_0x0605('0x24')]=_0x533b6d['openchannelCapacity']||0x0;this[_0x0605('0x25')]=0x0;this[_0x0605('0x26')]=![];this[_0x0605('0x27')]=undefined;this[_0x0605('0x1')]='';this[_0x0605('0x28')]={};this[_0x0605('0x29')]={};this[_0x0605('0x2a')]={};this[_0x0605('0x2b')]={};this[_0x0605('0x2c')]={};this['whatsappWaitingInteractions']={};this[_0x0605('0x2d')]();}Agent['prototype'][_0x0605('0x2e')]=function(_0x118e9c){if(this[_0x118e9c+_0x0605('0x2f')]>0x0){if(this[_0x118e9c+_0x0605('0x30')]>0x0&&this[_0x118e9c+_0x0605('0x2f')]>=this[_0x118e9c+_0x0605('0x30')]){return _0x0605('0x31');}else{return _0x0605('0x32');}}else{return _0x0605('0x33');}};Agent[_0x0605('0x34')][_0x0605('0x2d')]=function(){var _0x1c3722=['mail',_0x0605('0x35'),_0x0605('0x36'),'fax','sms','whatsapp'];for(var _0x33558f=0x0;_0x33558f<_0x1c3722[_0x0605('0x37')];_0x33558f+=0x1){var _0x4163cd=this[_0x0605('0x2e')](_0x1c3722[_0x33558f]);if(this[_0x1c3722[_0x33558f]+_0x0605('0x38')]!==_0x4163cd){this[_0x1c3722[_0x33558f]+_0x0605('0x39')]=_['toNumber'](moment()[_0x0605('0x3a')]('x'));}this[_0x1c3722[_0x33558f]+'Status']=_0x4163cd;}var _0xa836f2={'id':this['id'],'name':this[_0x0605('0x8')],'online':this[_0x0605('0x3b')],'voicePause':this[_0x0605('0x9')],'chatPause':this[_0x0605('0xa')],'mailPause':this[_0x0605('0xb')],'smsPause':this['smsPause'],'faxPause':this[_0x0605('0xc')],'openchannelPause':this[_0x0605('0xe')],'chatStatus':this[_0x0605('0xf')],'chatStatusTime':this[_0x0605('0x11')],'chatCapacity':this[_0x0605('0x12')],'chatCurrentCapacity':this[_0x0605('0x13')],'mailStatus':this[_0x0605('0x14')],'mailStatusTime':this[_0x0605('0x15')],'mailCapacity':this[_0x0605('0x16')],'mailCurrentCapacity':this[_0x0605('0x17')],'faxStatus':this[_0x0605('0x18')],'faxStatusTime':this[_0x0605('0x3c')],'faxCapacity':this[_0x0605('0x19')],'faxCurrentCapacity':this[_0x0605('0x1a')],'smsStatus':this[_0x0605('0x3d')],'smsStatusTime':this[_0x0605('0x1b')],'smsCapacity':this[_0x0605('0x1c')],'smsCurrentCapacity':this[_0x0605('0x1d')],'whatsappStatus':this[_0x0605('0x1e')],'whatsappStatusTime':this[_0x0605('0x1f')],'whatsappCapacity':this[_0x0605('0x20')],'whatsappCurrentCapacity':this[_0x0605('0x21')],'openchannelStatus':this[_0x0605('0x22')],'openchannelStatusTime':this[_0x0605('0x23')],'openchannelCapacity':this[_0x0605('0x24')],'openchannelCurrentCapacity':this[_0x0605('0x25')],'busy':this[_0x0605('0x26')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x0605('0x28')],'faxWaitingInteractions':this[_0x0605('0x29')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this[_0x0605('0x2b')],'smsWaitingInteractions':this[_0x0605('0x2c')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x2aac18=md5(JSON[_0x0605('0x3e')](_0xa836f2));if(this[_0x0605('0x1')]!==_0x2aac18){this[_0x0605('0x1')]=_0x2aac18;io[_0x0605('0x3f')](_0x0605('0x40'),_['omit'](_0xa836f2,['online']));}};module[_0x0605('0x41')]=Agent; \ No newline at end of file +var _0xfcbb=['exports','lodash','md5','moment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','busy','busyQueue','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','updateRealtime','mail','chat','openchannel','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatStatusTime','openchannelCurrentCapacity','chatWaitingInteractions','omit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x267763,_0x39581d){_0x267763=_0x267763-0x0;var _0x2e7178=_0xfcbb[_0x267763];return _0x2e7178;};'use strict';var _=require(_0xbfcb('0x0'));var md5=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xbfcb('0x3')]=_[_0xbfcb('0x4')](config[_0xbfcb('0x3')],{'host':_0xbfcb('0x5'),'port':0x18eb});var io=require(_0xbfcb('0x6'))(new Redis(config['redis']));function Agent(_0x5201d3){this['id']=_0x5201d3['id']||0x0;this[_0xbfcb('0x7')]=_0x5201d3[_0xbfcb('0x7')]||'';this[_0xbfcb('0x8')]=_0x5201d3[_0xbfcb('0x8')]||!![];this[_0xbfcb('0x9')]=_0x5201d3[_0xbfcb('0x9')]||![];this[_0xbfcb('0xa')]=_0x5201d3['chatPause']||![];this[_0xbfcb('0xb')]=_0x5201d3[_0xbfcb('0xb')]||![];this[_0xbfcb('0xc')]=_0x5201d3['faxPause']||![];this[_0xbfcb('0xd')]=_0x5201d3[_0xbfcb('0xd')]||![];this[_0xbfcb('0xe')]=_0x5201d3[_0xbfcb('0xe')]||![];this[_0xbfcb('0xf')]=_0xbfcb('0x10');this['chatStatusTime']=0x0;this[_0xbfcb('0x11')]=_0x5201d3[_0xbfcb('0x11')]||0x0;this[_0xbfcb('0x12')]=0x0;this[_0xbfcb('0x13')]='unknown';this[_0xbfcb('0x14')]=0x0;this['mailCapacity']=_0x5201d3[_0xbfcb('0x15')]||0x0;this[_0xbfcb('0x16')]=0x0;this[_0xbfcb('0x17')]=_0xbfcb('0x10');this[_0xbfcb('0x18')]=0x0;this[_0xbfcb('0x19')]=_0x5201d3[_0xbfcb('0x19')]||0x0;this[_0xbfcb('0x1a')]=0x0;this[_0xbfcb('0x1b')]=_0xbfcb('0x10');this[_0xbfcb('0x1c')]=0x0;this[_0xbfcb('0x1d')]=_0x5201d3[_0xbfcb('0x1d')]||0x0;this[_0xbfcb('0x1e')]=0x0;this[_0xbfcb('0x1f')]=_0xbfcb('0x10');this[_0xbfcb('0x20')]=0x0;this[_0xbfcb('0x21')]=_0x5201d3[_0xbfcb('0x21')]||0x0;this[_0xbfcb('0x22')]=0x0;this[_0xbfcb('0x23')]=_0xbfcb('0x10');this['openchannelStatusTime']=0x0;this[_0xbfcb('0x24')]=_0x5201d3[_0xbfcb('0x24')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xbfcb('0x25')]=![];this[_0xbfcb('0x26')]=undefined;this['md5']='';this['chatWaitingInteractions']={};this[_0xbfcb('0x27')]={};this[_0xbfcb('0x28')]={};this[_0xbfcb('0x29')]={};this[_0xbfcb('0x2a')]={};this[_0xbfcb('0x2b')]={};this['updateRealtime']();}Agent[_0xbfcb('0x2c')][_0xbfcb('0x2d')]=function(_0x2d9288){if(this[_0x2d9288+_0xbfcb('0x2e')]>0x0){if(this[_0x2d9288+_0xbfcb('0x2f')]>0x0&&this[_0x2d9288+_0xbfcb('0x2e')]>=this[_0x2d9288+_0xbfcb('0x2f')]){return _0xbfcb('0x30');}else{return _0xbfcb('0x31');}}else{return _0xbfcb('0x32');}};Agent[_0xbfcb('0x2c')][_0xbfcb('0x33')]=function(){var _0x3ef71c=[_0xbfcb('0x34'),_0xbfcb('0x35'),_0xbfcb('0x36'),'fax',_0xbfcb('0x37'),_0xbfcb('0x38')];for(var _0x4cf7ca=0x0;_0x4cf7ca<_0x3ef71c[_0xbfcb('0x39')];_0x4cf7ca+=0x1){var _0x15197b=this[_0xbfcb('0x2d')](_0x3ef71c[_0x4cf7ca]);if(this[_0x3ef71c[_0x4cf7ca]+_0xbfcb('0x3a')]!==_0x15197b){this[_0x3ef71c[_0x4cf7ca]+_0xbfcb('0x3b')]=_[_0xbfcb('0x3c')](moment()[_0xbfcb('0x3d')]('x'));}this[_0x3ef71c[_0x4cf7ca]+_0xbfcb('0x3a')]=_0x15197b;}var _0x434764={'id':this['id'],'name':this[_0xbfcb('0x7')],'online':this['online'],'voicePause':this[_0xbfcb('0x9')],'chatPause':this[_0xbfcb('0xa')],'mailPause':this[_0xbfcb('0xb')],'smsPause':this[_0xbfcb('0xd')],'faxPause':this[_0xbfcb('0xc')],'openchannelPause':this[_0xbfcb('0xe')],'chatStatus':this[_0xbfcb('0xf')],'chatStatusTime':this[_0xbfcb('0x3e')],'chatCapacity':this[_0xbfcb('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xbfcb('0x13')],'mailStatusTime':this[_0xbfcb('0x14')],'mailCapacity':this[_0xbfcb('0x15')],'mailCurrentCapacity':this[_0xbfcb('0x16')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xbfcb('0x19')],'faxCurrentCapacity':this[_0xbfcb('0x1a')],'smsStatus':this[_0xbfcb('0x1b')],'smsStatusTime':this[_0xbfcb('0x1c')],'smsCapacity':this[_0xbfcb('0x1d')],'smsCurrentCapacity':this[_0xbfcb('0x1e')],'whatsappStatus':this[_0xbfcb('0x1f')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0xbfcb('0x23')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xbfcb('0x24')],'openchannelCurrentCapacity':this[_0xbfcb('0x3f')],'busy':this['busy'],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0xbfcb('0x40')],'faxWaitingInteractions':this[_0xbfcb('0x27')],'mailWaitingInteractions':this[_0xbfcb('0x28')],'openchannelWaitingInteractions':this[_0xbfcb('0x29')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0xbfcb('0x2b')]};var _0xf35aa5=md5(JSON['stringify'](_0x434764));if(this['md5']!==_0xf35aa5){this[_0xbfcb('0x1')]=_0xf35aa5;io['emit']('user:routing:update',_[_0xbfcb('0x41')](_0x434764,[_0xbfcb('0x8')]));}};module[_0xbfcb('0x42')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 09e7ea8..fd4fad6 100644 --- a/server/services/routing/model/chatQueue.js +++ b/server/services/routing/model/chatQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41ee=['map','loggedIn','paused','length','online','chatPause','available','stringify','md5','format','emit','chat_queue:save','lodash','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x41ee,0xa2));var _0xe41e=function(_0x4a4f50,_0x728c80){_0x4a4f50=_0x4a4f50-0x0;var _0x2d2788=_0x41ee[_0x4a4f50];return _0x2d2788;};'use strict';var _=require(_0xe41e('0x0'));var md5=require('md5');var util=require(_0xe41e('0x1'));var Redis=require(_0xe41e('0x2'));var config=require(_0xe41e('0x3'));config[_0xe41e('0x4')]=_[_0xe41e('0x5')](config[_0xe41e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xe41e('0x6'))(new Redis(config[_0xe41e('0x4')]));function ChatQueue(_0x2b16c6){this['id']=_0x2b16c6['id']||0x0;this[_0xe41e('0x7')]=_0x2b16c6[_0xe41e('0x7')]||'';this[_0xe41e('0x8')]=_0x2b16c6[_0xe41e('0x8')]||0xa;this[_0xe41e('0x9')]=_0x2b16c6[_0xe41e('0x9')]||_0xe41e('0xa');this['Agents']=_0x2b16c6[_0xe41e('0xb')];this[_0xe41e('0xc')]={};this[_0xe41e('0xd')]=0x0;this['md5']='';this[_0xe41e('0xe')]();this[_0xe41e('0xf')]();}ChatQueue[_0xe41e('0x10')][_0xe41e('0xe')]=function(){var _0x134352=this[_0xe41e('0xc')][_0xe41e('0x11')];this[_0xe41e('0xc')]=_[_0xe41e('0x12')](this[_0xe41e('0xb')],'id');this[_0xe41e('0xc')][_0xe41e('0x11')]=_0x134352;};ChatQueue['prototype'][_0xe41e('0xf')]=function(){this[_0xe41e('0x13')]=0x0;this[_0xe41e('0x14')]=0x0;for(var _0x254e7b=0x0;_0x254e7b=0x0?this[_0xe41e('0x18')]:0x0;var _0x24b925={'id':this['id'],'available':this[_0xe41e('0x18')],'loggedIn':this[_0xe41e('0x13')],'name':this[_0xe41e('0x7')],'paused':this[_0xe41e('0x14')],'waiting':this[_0xe41e('0xd')]};var _0x3b1778=md5(JSON[_0xe41e('0x19')](_0x24b925));if(this[_0xe41e('0x1a')]!==_0x3b1778){this[_0xe41e('0x1a')]=_0x3b1778;io['to'](util[_0xe41e('0x1b')]('chat:queue:%s',_0x24b925[_0xe41e('0x7')]))[_0xe41e('0x1c')](_0xe41e('0x1d'),_0x24b925);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x17b6=['name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','prototype','mapAgentsId','_rr','updateRealtime','loggedIn','length','online','paused','available','stringify','format','emit','chat_queue:save','lodash','util','ioredis','../../../config/environment','redis'];(function(_0x146cb9,_0x349d0b){var _0x2dbc9a=function(_0x2917ac){while(--_0x2917ac){_0x146cb9['push'](_0x146cb9['shift']());}};_0x2dbc9a(++_0x349d0b);}(_0x17b6,0x97));var _0x617b=function(_0x183d41,_0x1aebd7){_0x183d41=_0x183d41-0x0;var _0x4f0939=_0x17b6[_0x183d41];return _0x4f0939;};'use strict';var _=require(_0x617b('0x0'));var md5=require('md5');var util=require(_0x617b('0x1'));var Redis=require(_0x617b('0x2'));var config=require(_0x617b('0x3'));config[_0x617b('0x4')]=_['defaults'](config[_0x617b('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x617b('0x4')]));function ChatQueue(_0x27a345){this['id']=_0x27a345['id']||0x0;this[_0x617b('0x5')]=_0x27a345['name']||'';this[_0x617b('0x6')]=_0x27a345[_0x617b('0x6')]||0xa;this['strategy']=_0x27a345[_0x617b('0x7')]||_0x617b('0x8');this[_0x617b('0x9')]=_0x27a345[_0x617b('0x9')];this['mapAgentsId']={};this[_0x617b('0xa')]=0x0;this[_0x617b('0xb')]='';this[_0x617b('0xc')]();this['updateRealtime']();}ChatQueue[_0x617b('0xd')][_0x617b('0xc')]=function(){var _0x8aa1d6=this[_0x617b('0xe')][_0x617b('0xf')];this[_0x617b('0xe')]=_['map'](this['Agents'],'id');this[_0x617b('0xe')][_0x617b('0xf')]=_0x8aa1d6;};ChatQueue[_0x617b('0xd')][_0x617b('0x10')]=function(){this[_0x617b('0x11')]=0x0;this['paused']=0x0;for(var _0x374426=0x0;_0x374426=0x0?this[_0x617b('0x15')]:0x0;var _0x2178a0={'id':this['id'],'available':this[_0x617b('0x15')],'loggedIn':this[_0x617b('0x11')],'name':this[_0x617b('0x5')],'paused':this[_0x617b('0x14')],'waiting':this[_0x617b('0xa')]};var _0x128f25=md5(JSON[_0x617b('0x16')](_0x2178a0));if(this[_0x617b('0xb')]!==_0x128f25){this[_0x617b('0xb')]=_0x128f25;io['to'](util[_0x617b('0x17')]('chat:queue:%s',_0x2178a0[_0x617b('0x5')]))[_0x617b('0x18')](_0x617b('0x19'),_0x2178a0);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 9cd4ba5..08525c4 100644 --- a/server/services/routing/model/faxQueue.js +++ b/server/services/routing/model/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd461=['paused','available','waiting','format','fax_queue:save','exports','lodash','md5','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','length','online','faxPause'];(function(_0x4e9bcc,_0x4b8b08){var _0x4e5530=function(_0x5c79e7){while(--_0x5c79e7){_0x4e9bcc['push'](_0x4e9bcc['shift']());}};_0x4e5530(++_0x4b8b08);}(_0xd461,0x8d));var _0x1d46=function(_0x592ca4,_0x226923){_0x592ca4=_0x592ca4-0x0;var _0x5d9537=_0xd461[_0x592ca4];return _0x5d9537;};'use strict';var _=require(_0x1d46('0x0'));var md5=require(_0x1d46('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x1d46('0x2'));config[_0x1d46('0x3')]=_['defaults'](config[_0x1d46('0x3')],{'host':_0x1d46('0x4'),'port':0x18eb});var io=require(_0x1d46('0x5'))(new Redis(config[_0x1d46('0x3')]));function FaxQueue(_0x2066f5){this['id']=_0x2066f5['id']||0x0;this['name']=_0x2066f5[_0x1d46('0x6')]||'';this[_0x1d46('0x7')]=_0x2066f5[_0x1d46('0x7')]||0xa;this[_0x1d46('0x8')]=_0x2066f5[_0x1d46('0x8')]||_0x1d46('0x9');this['Agents']=_0x2066f5[_0x1d46('0xa')];this[_0x1d46('0xb')]={};this['waiting']=0x0;this[_0x1d46('0x1')]='';this[_0x1d46('0xc')]();this[_0x1d46('0xd')]();}FaxQueue['prototype'][_0x1d46('0xc')]=function(){var _0x4a11e6=this[_0x1d46('0xb')]['_rr'];this[_0x1d46('0xb')]=_[_0x1d46('0xe')](this[_0x1d46('0xa')],'id');this[_0x1d46('0xb')][_0x1d46('0xf')]=_0x4a11e6;};FaxQueue[_0x1d46('0x10')][_0x1d46('0xd')]=function(){this[_0x1d46('0x11')]=0x0;this['paused']=0x0;for(var _0x3ce5d0=0x0;_0x3ce5d0=0x0?this[_0x1d46('0x16')]:0x0;var _0x3b43db={'id':this['id'],'available':this[_0x1d46('0x16')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1d46('0x17')]};var _0x36e140=md5(JSON['stringify'](_0x3b43db));if(this[_0x1d46('0x1')]!==_0x36e140){this[_0x1d46('0x1')]=_0x36e140;io['to'](util[_0x1d46('0x18')]('fax:queue:%s',_0x3b43db[_0x1d46('0x6')]))['emit'](_0x1d46('0x19'),_0x3b43db);}};module[_0x1d46('0x1a')]=FaxQueue; \ No newline at end of file +var _0x2939=['lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','faxPause','available','stringify','format','emit','fax_queue:save','exports'];(function(_0x25307b,_0xdb1782){var _0x2642f7=function(_0x51cc2b){while(--_0x51cc2b){_0x25307b['push'](_0x25307b['shift']());}};_0x2642f7(++_0xdb1782);}(_0x2939,0x78));var _0x9293=function(_0x38674e,_0x170f1e){_0x38674e=_0x38674e-0x0;var _0x282a8a=_0x2939[_0x38674e];return _0x282a8a;};'use strict';var _=require(_0x9293('0x0'));var md5=require(_0x9293('0x1'));var util=require(_0x9293('0x2'));var Redis=require(_0x9293('0x3'));var config=require(_0x9293('0x4'));config[_0x9293('0x5')]=_[_0x9293('0x6')](config[_0x9293('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9293('0x7'))(new Redis(config[_0x9293('0x5')]));function FaxQueue(_0x5f2a12){this['id']=_0x5f2a12['id']||0x0;this[_0x9293('0x8')]=_0x5f2a12['name']||'';this[_0x9293('0x9')]=_0x5f2a12['timeout']||0xa;this[_0x9293('0xa')]=_0x5f2a12['strategy']||_0x9293('0xb');this[_0x9293('0xc')]=_0x5f2a12[_0x9293('0xc')];this[_0x9293('0xd')]={};this[_0x9293('0xe')]=0x0;this[_0x9293('0x1')]='';this[_0x9293('0xf')]();this[_0x9293('0x10')]();}FaxQueue[_0x9293('0x11')][_0x9293('0xf')]=function(){var _0x2cb534=this[_0x9293('0xd')][_0x9293('0x12')];this['mapAgentsId']=_['map'](this[_0x9293('0xc')],'id');this[_0x9293('0xd')]['_rr']=_0x2cb534;};FaxQueue[_0x9293('0x11')][_0x9293('0x10')]=function(){this[_0x9293('0x13')]=0x0;this[_0x9293('0x14')]=0x0;for(var _0x5412fb=0x0;_0x5412fb=0x0?this[_0x9293('0x18')]:0x0;var _0xec70d8={'id':this['id'],'available':this[_0x9293('0x18')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x9293('0x14')],'waiting':this['waiting']};var _0x10cf49=md5(JSON[_0x9293('0x19')](_0xec70d8));if(this[_0x9293('0x1')]!==_0x10cf49){this[_0x9293('0x1')]=_0x10cf49;io['to'](util[_0x9293('0x1a')]('fax:queue:%s',_0xec70d8[_0x9293('0x8')]))[_0x9293('0x1b')](_0x9293('0x1c'),_0xec70d8);}};module[_0x9293('0x1d')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 7b3ab71..3e170b4 100644 --- a/server/services/routing/model/interval.js +++ b/server/services/routing/model/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae96=['Intervals','name'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xae96,0x143));var _0x6ae9=function(_0x3cc3d9,_0x1f2dd1){_0x3cc3d9=_0x3cc3d9-0x0;var _0x418dcc=_0xae96[_0x3cc3d9];return _0x418dcc;};'use strict';function Interval(_0x4dc94b){this['id']=_0x4dc94b['id']||0x0;this[_0x6ae9('0x0')]=_0x4dc94b[_0x6ae9('0x0')]||'';this['Intervals']=_0x4dc94b[_0x6ae9('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0xaff6=['exports','name'];(function(_0x229cc8,_0x5cad95){var _0x1f5a1f=function(_0xfc7f11){while(--_0xfc7f11){_0x229cc8['push'](_0x229cc8['shift']());}};_0x1f5a1f(++_0x5cad95);}(_0xaff6,0xd9));var _0x6aff=function(_0x154983,_0xc29edf){_0x154983=_0x154983-0x0;var _0x3d1243=_0xaff6[_0x154983];return _0x3d1243;};'use strict';function Interval(_0xc9b69){this['id']=_0xc9b69['id']||0x0;this[_0x6aff('0x0')]=_0xc9b69['name']||'';this['Intervals']=_0xc9b69['Intervals']||{};}module[_0x6aff('0x1')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 43c3900..79ab424 100644 --- a/server/services/routing/model/mailQueue.js +++ b/server/services/routing/model/mailQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c22=['available','format','mail:queue:%s','emit','exports','lodash','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length'];(function(_0x27347d,_0x2ae865){var _0x1bb297=function(_0x45312d){while(--_0x45312d){_0x27347d['push'](_0x27347d['shift']());}};_0x1bb297(++_0x2ae865);}(_0x7c22,0x17f));var _0x27c2=function(_0x3564a2,_0x4ff9e5){_0x3564a2=_0x3564a2-0x0;var _0x7c4d72=_0x7c22[_0x3564a2];return _0x7c4d72;};'use strict';var _=require(_0x27c2('0x0'));var md5=require(_0x27c2('0x1'));var util=require(_0x27c2('0x2'));var Redis=require(_0x27c2('0x3'));var config=require('../../../config/environment');config[_0x27c2('0x4')]=_['defaults'](config[_0x27c2('0x4')],{'host':_0x27c2('0x5'),'port':0x18eb});var io=require(_0x27c2('0x6'))(new Redis(config[_0x27c2('0x4')]));function MailQueue(_0x44175c){this['id']=_0x44175c['id']||0x0;this[_0x27c2('0x7')]=_0x44175c['name']||'';this['timeout']=_0x44175c[_0x27c2('0x8')]||0xa;this[_0x27c2('0x9')]=_0x44175c[_0x27c2('0x9')]||_0x27c2('0xa');this[_0x27c2('0xb')]=_0x44175c[_0x27c2('0xb')];this[_0x27c2('0xc')]={};this[_0x27c2('0xd')]=0x0;this['md5']='';this[_0x27c2('0xe')]();this[_0x27c2('0xf')]();}MailQueue[_0x27c2('0x10')][_0x27c2('0xe')]=function(){var _0x43934c=this['mapAgentsId'][_0x27c2('0x11')];this['mapAgentsId']=_[_0x27c2('0x12')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x43934c;};MailQueue['prototype'][_0x27c2('0xf')]=function(){this[_0x27c2('0x13')]=0x0;this[_0x27c2('0x14')]=0x0;for(var _0x3846b4=0x0;_0x3846b4=0x0?this['available']:0x0;var _0x5c6bc7={'id':this['id'],'available':this['available'],'loggedIn':this[_0x27c2('0x13')],'name':this[_0x27c2('0x7')],'paused':this[_0x27c2('0x14')],'waiting':this['waiting']};var _0x594e44=md5(JSON['stringify'](_0x5c6bc7));if(this[_0x27c2('0x1')]!==_0x594e44){this[_0x27c2('0x1')]=_0x594e44;io['to'](util[_0x27c2('0x17')](_0x27c2('0x18'),_0x5c6bc7[_0x27c2('0x7')]))[_0x27c2('0x19')]('mail_queue:save',_0x5c6bc7);}};module[_0x27c2('0x1a')]=MailQueue; \ No newline at end of file +var _0xa38c=['updateRouting','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','mailPause','available','stringify','format','mail:queue:%s','mail_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','prototype'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xa38c,0x1b3));var _0xca38=function(_0x4fcb0f,_0x5e8627){_0x4fcb0f=_0x4fcb0f-0x0;var _0xf9107d=_0xa38c[_0x4fcb0f];return _0xf9107d;};'use strict';var _=require(_0xca38('0x0'));var md5=require(_0xca38('0x1'));var util=require(_0xca38('0x2'));var Redis=require(_0xca38('0x3'));var config=require('../../../config/environment');config[_0xca38('0x4')]=_[_0xca38('0x5')](config[_0xca38('0x4')],{'host':_0xca38('0x6'),'port':0x18eb});var io=require(_0xca38('0x7'))(new Redis(config[_0xca38('0x4')]));function MailQueue(_0x110813){this['id']=_0x110813['id']||0x0;this['name']=_0x110813[_0xca38('0x8')]||'';this['timeout']=_0x110813[_0xca38('0x9')]||0xa;this[_0xca38('0xa')]=_0x110813[_0xca38('0xa')]||_0xca38('0xb');this[_0xca38('0xc')]=_0x110813[_0xca38('0xc')];this['mapAgentsId']={};this[_0xca38('0xd')]=0x0;this[_0xca38('0x1')]='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0xca38('0xe')][_0xca38('0xf')]=function(){var _0x3fa4c0=this[_0xca38('0x10')]['_rr'];this[_0xca38('0x10')]=_[_0xca38('0x11')](this['Agents'],'id');this['mapAgentsId'][_0xca38('0x12')]=_0x3fa4c0;};MailQueue[_0xca38('0xe')][_0xca38('0x13')]=function(){this[_0xca38('0x14')]=0x0;this[_0xca38('0x15')]=0x0;for(var _0x4042e9=0x0;_0x4042e9=0x0?this[_0xca38('0x18')]:0x0;var _0x1f5fda={'id':this['id'],'available':this[_0xca38('0x18')],'loggedIn':this[_0xca38('0x14')],'name':this[_0xca38('0x8')],'paused':this[_0xca38('0x15')],'waiting':this['waiting']};var _0x454eed=md5(JSON[_0xca38('0x19')](_0x1f5fda));if(this[_0xca38('0x1')]!==_0x454eed){this[_0xca38('0x1')]=_0x454eed;io['to'](util[_0xca38('0x1a')](_0xca38('0x1b'),_0x1f5fda[_0xca38('0x8')]))['emit'](_0xca38('0x1c'),_0x1f5fda);}};module[_0xca38('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 817e7ce..8f274e1 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x4d5a9e,_0x4f87f6){var _0x3b71c6=function(_0x3b29b9){while(--_0x3b29b9){_0x4d5a9e['push'](_0x4d5a9e['shift']());}};_0x3b71c6(++_0x4f87f6);}(_0x814b,0x1a2));var _0xb814=function(_0xb8cfbe,_0x2e81b6){_0xb8cfbe=_0xb8cfbe-0x0;var _0x227d51=_0x814b[_0xb8cfbe];return _0x227d51;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x7a54,0x106));var _0x47a5=function(_0x100acf,_0x2288df){_0x100acf=_0x100acf-0x0;var _0x4f435a=_0x7a54[_0x100acf];return _0x4f435a;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index e44407e..f5bbc3e 100644 --- a/server/services/routing/model/smsQueue.js +++ b/server/services/routing/model/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d46=['exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','Agents','online','smsPause','available','waiting','format','sms:queue:%s','sms_queue:save'];(function(_0x3b0256,_0x402269){var _0x2d6b5f=function(_0x41a9e2){while(--_0x41a9e2){_0x3b0256['push'](_0x3b0256['shift']());}};_0x2d6b5f(++_0x402269);}(_0x4d46,0x197));var _0x64d4=function(_0x553e25,_0x214f94){_0x553e25=_0x553e25-0x0;var _0x18b236=_0x4d46[_0x553e25];return _0x18b236;};'use strict';var _=require(_0x64d4('0x0'));var md5=require(_0x64d4('0x1'));var util=require(_0x64d4('0x2'));var Redis=require(_0x64d4('0x3'));var config=require(_0x64d4('0x4'));config[_0x64d4('0x5')]=_['defaults'](config[_0x64d4('0x5')],{'host':_0x64d4('0x6'),'port':0x18eb});var io=require(_0x64d4('0x7'))(new Redis(config[_0x64d4('0x5')]));function SmsQueue(_0x1f7d33){this['id']=_0x1f7d33['id']||0x0;this[_0x64d4('0x8')]=_0x1f7d33['name']||'';this[_0x64d4('0x9')]=_0x1f7d33[_0x64d4('0x9')]||0xa;this['strategy']=_0x1f7d33[_0x64d4('0xa')]||_0x64d4('0xb');this['Agents']=_0x1f7d33['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0x64d4('0xc')]();this[_0x64d4('0xd')]();}SmsQueue[_0x64d4('0xe')][_0x64d4('0xc')]=function(){var _0x766524=this[_0x64d4('0xf')][_0x64d4('0x10')];this[_0x64d4('0xf')]=_[_0x64d4('0x11')](this['Agents'],'id');this[_0x64d4('0xf')]['_rr']=_0x766524;};SmsQueue[_0x64d4('0xe')][_0x64d4('0xd')]=function(){this[_0x64d4('0x12')]=0x0;this[_0x64d4('0x13')]=0x0;for(var _0x13b111=0x0;_0x13b111=0x0?this[_0x64d4('0x17')]:0x0;var _0x155b60={'id':this['id'],'available':this[_0x64d4('0x17')],'loggedIn':this[_0x64d4('0x12')],'name':this[_0x64d4('0x8')],'paused':this[_0x64d4('0x13')],'waiting':this[_0x64d4('0x18')]};var _0x2549e9=md5(JSON['stringify'](_0x155b60));if(this[_0x64d4('0x1')]!==_0x2549e9){this[_0x64d4('0x1')]=_0x2549e9;io['to'](util[_0x64d4('0x19')](_0x64d4('0x1a'),_0x155b60['name']))['emit'](_0x64d4('0x1b'),_0x155b60);}};module[_0x64d4('0x1c')]=SmsQueue; \ No newline at end of file +var _0x26c2=['format','emit','sms_queue:save','exports','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','_rr','map','prototype','updateRealtime','loggedIn','paused','length','online','smsPause','available','waiting','stringify'];(function(_0x3466f2,_0x40feab){var _0x569ca2=function(_0x46b750){while(--_0x46b750){_0x3466f2['push'](_0x3466f2['shift']());}};_0x569ca2(++_0x40feab);}(_0x26c2,0x130));var _0x226c=function(_0x33afbe,_0xf0e2cd){_0x33afbe=_0x33afbe-0x0;var _0x55dc2c=_0x26c2[_0x33afbe];return _0x55dc2c;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require(_0x226c('0x0'));var config=require(_0x226c('0x1'));config[_0x226c('0x2')]=_[_0x226c('0x3')](config['redis'],{'host':_0x226c('0x4'),'port':0x18eb});var io=require(_0x226c('0x5'))(new Redis(config['redis']));function SmsQueue(_0x1719ed){this['id']=_0x1719ed['id']||0x0;this[_0x226c('0x6')]=_0x1719ed[_0x226c('0x6')]||'';this[_0x226c('0x7')]=_0x1719ed[_0x226c('0x7')]||0xa;this['strategy']=_0x1719ed[_0x226c('0x8')]||_0x226c('0x9');this[_0x226c('0xa')]=_0x1719ed[_0x226c('0xa')];this[_0x226c('0xb')]={};this['waiting']=0x0;this[_0x226c('0xc')]='';this[_0x226c('0xd')]();this['updateRealtime']();}SmsQueue['prototype'][_0x226c('0xd')]=function(){var _0x1a5961=this[_0x226c('0xb')][_0x226c('0xe')];this[_0x226c('0xb')]=_[_0x226c('0xf')](this[_0x226c('0xa')],'id');this['mapAgentsId']['_rr']=_0x1a5961;};SmsQueue[_0x226c('0x10')][_0x226c('0x11')]=function(){this[_0x226c('0x12')]=0x0;this[_0x226c('0x13')]=0x0;for(var _0x4eb557=0x0;_0x4eb557=0x0?this['available']:0x0;var _0x36fa74={'id':this['id'],'available':this[_0x226c('0x17')],'loggedIn':this[_0x226c('0x12')],'name':this[_0x226c('0x6')],'paused':this['paused'],'waiting':this[_0x226c('0x18')]};var _0xb6417f=md5(JSON[_0x226c('0x19')](_0x36fa74));if(this[_0x226c('0xc')]!==_0xb6417f){this[_0x226c('0xc')]=_0xb6417f;io['to'](util[_0x226c('0x1a')]('sms:queue:%s',_0x36fa74[_0x226c('0x6')]))[_0x226c('0x1b')](_0x226c('0x1c'),_0x36fa74);}};module[_0x226c('0x1d')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index bde18f9..c4c2fc6 100644 --- a/server/services/routing/model/whatsappQueue.js +++ b/server/services/routing/model/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ec9=['lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','strategy','Agents','waiting','updateRouting','updateRealtime','_rr','mapAgentsId','map','prototype','loggedIn','paused','length','online','whatsappPause','available','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x8ec9,0x70));var _0x98ec=function(_0x514a95,_0x148dfe){_0x514a95=_0x514a95-0x0;var _0xeac33f=_0x8ec9[_0x514a95];return _0xeac33f;};'use strict';var _=require(_0x98ec('0x0'));var md5=require(_0x98ec('0x1'));var util=require(_0x98ec('0x2'));var Redis=require(_0x98ec('0x3'));var config=require(_0x98ec('0x4'));config[_0x98ec('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x98ec('0x6'))(new Redis(config['redis']));function WhatsappQueue(_0xd07f70){this['id']=_0xd07f70['id']||0x0;this[_0x98ec('0x7')]=_0xd07f70[_0x98ec('0x7')]||'';this['timeout']=_0xd07f70['timeout']||0xa;this['strategy']=_0xd07f70[_0x98ec('0x8')]||'beepall';this['Agents']=_0xd07f70[_0x98ec('0x9')];this['mapAgentsId']={};this[_0x98ec('0xa')]=0x0;this[_0x98ec('0x1')]='';this[_0x98ec('0xb')]();this[_0x98ec('0xc')]();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x1b7170=this['mapAgentsId'][_0x98ec('0xd')];this[_0x98ec('0xe')]=_[_0x98ec('0xf')](this[_0x98ec('0x9')],'id');this[_0x98ec('0xe')][_0x98ec('0xd')]=_0x1b7170;};WhatsappQueue[_0x98ec('0x10')][_0x98ec('0xc')]=function(){this[_0x98ec('0x11')]=0x0;this[_0x98ec('0x12')]=0x0;for(var _0xac8f9=0x0;_0xac8f9=0x0?this[_0x98ec('0x16')]:0x0;var _0x3c5b45={'id':this['id'],'available':this[_0x98ec('0x16')],'loggedIn':this[_0x98ec('0x11')],'name':this[_0x98ec('0x7')],'paused':this['paused'],'waiting':this[_0x98ec('0xa')]};var _0xc796d0=md5(JSON['stringify'](_0x3c5b45));if(this['md5']!==_0xc796d0){this[_0x98ec('0x1')]=_0xc796d0;io['to'](util[_0x98ec('0x17')](_0x98ec('0x18'),_0x3c5b45[_0x98ec('0x7')]))[_0x98ec('0x19')](_0x98ec('0x1a'),_0x3c5b45);}};module[_0x98ec('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0xcbc8=['updateRouting','updateRealtime','_rr','prototype','paused','length','online','loggedIn','whatsappPause','available','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','md5','util','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting'];(function(_0x42646c,_0x36bcc5){var _0xe7748a=function(_0x48bc48){while(--_0x48bc48){_0x42646c['push'](_0x42646c['shift']());}};_0xe7748a(++_0x36bcc5);}(_0xcbc8,0x196));var _0x8cbc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcbc8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8cbc('0x0'));var md5=require(_0x8cbc('0x1'));var util=require(_0x8cbc('0x2'));var Redis=require(_0x8cbc('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x8cbc('0x4')](config[_0x8cbc('0x5')],{'host':_0x8cbc('0x6'),'port':0x18eb});var io=require(_0x8cbc('0x7'))(new Redis(config[_0x8cbc('0x5')]));function WhatsappQueue(_0x346a5c){this['id']=_0x346a5c['id']||0x0;this[_0x8cbc('0x8')]=_0x346a5c[_0x8cbc('0x8')]||'';this[_0x8cbc('0x9')]=_0x346a5c[_0x8cbc('0x9')]||0xa;this['strategy']=_0x346a5c[_0x8cbc('0xa')]||'beepall';this[_0x8cbc('0xb')]=_0x346a5c[_0x8cbc('0xb')];this[_0x8cbc('0xc')]={};this[_0x8cbc('0xd')]=0x0;this[_0x8cbc('0x1')]='';this[_0x8cbc('0xe')]();this[_0x8cbc('0xf')]();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x316f46=this[_0x8cbc('0xc')][_0x8cbc('0x10')];this[_0x8cbc('0xc')]=_['map'](this[_0x8cbc('0xb')],'id');this[_0x8cbc('0xc')][_0x8cbc('0x10')]=_0x316f46;};WhatsappQueue[_0x8cbc('0x11')][_0x8cbc('0xf')]=function(){this['loggedIn']=0x0;this[_0x8cbc('0x12')]=0x0;for(var _0x1c3f03=0x0;_0x1c3f03=0x0?this[_0x8cbc('0x17')]:0x0;var _0x36a6b9={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8cbc('0x15')],'name':this[_0x8cbc('0x8')],'paused':this[_0x8cbc('0x12')],'waiting':this[_0x8cbc('0xd')]};var _0x56bb4e=md5(JSON[_0x8cbc('0x18')](_0x36a6b9));if(this[_0x8cbc('0x1')]!==_0x56bb4e){this[_0x8cbc('0x1')]=_0x56bb4e;io['to'](util['format'](_0x8cbc('0x19'),_0x36a6b9[_0x8cbc('0x8')]))[_0x8cbc('0x1a')](_0x8cbc('0x1b'),_0x36a6b9);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index d5b6376..abe252d 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x4db47f,_0x1020d4){var _0x755f4=function(_0x3632ab){while(--_0x3632ab){_0x4db47f['push'](_0x4db47f['shift']());}};_0x755f4(++_0x1020d4);}(_0xb10b,0x12a));var _0xbb10=function(_0x189b3b,_0x484de8){_0x189b3b=_0x189b3b-0x0;var _0x7c4721=_0xb10b[_0x189b3b];return _0x7c4721;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 1fa7325..aaeebbd 100644 --- a/server/services/routing/rpc/chatInteraction.js +++ b/server/services/routing/rpc/chatInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x506f=['../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x506f,0x110));var _0xf506=function(_0x57b204,_0xb14d7f){_0x57b204=_0x57b204-0x0;var _0x394744=_0x506f[_0x57b204];return _0x394744;};'use strict';var client=require(_0xf506('0x0'));exports[_0xf506('0x1')]=function(_0x2b41a2,_0x46f4b0){return client[_0xf506('0x2')](_0xf506('0x3'),{'body':_0x46f4b0,'options':{'where':{'id':_0x2b41a2}},'log':_0xf506('0x4')});};exports[_0xf506('0x5')]=function(_0x30ec54,_0xd581ee){return client[_0xf506('0x2')](_0xf506('0x6'),{'body':_0xd581ee,'options':{'where':{'id':_0x30ec54}},'log':_0xf506('0x7')});}; \ No newline at end of file +var _0x4730=['updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction'];(function(_0x324f7f,_0x34504f){var _0x56e96d=function(_0x37d6bb){while(--_0x37d6bb){_0x324f7f['push'](_0x324f7f['shift']());}};_0x56e96d(++_0x34504f);}(_0x4730,0xa4));var _0x0473=function(_0x371b29,_0x2d33ed){_0x371b29=_0x371b29-0x0;var _0x434d79=_0x4730[_0x371b29];return _0x434d79;};'use strict';var client=require(_0x0473('0x0'));exports[_0x0473('0x1')]=function(_0x398b7c,_0x81dc84){return client[_0x0473('0x2')](_0x0473('0x3'),{'body':_0x81dc84,'options':{'where':{'id':_0x398b7c}},'log':_0x0473('0x4')});};exports[_0x0473('0x5')]=function(_0x353418,_0x4b929f){return client[_0x0473('0x2')](_0x0473('0x6'),{'body':_0x4b929f,'options':{'where':{'id':_0x353418}},'log':_0x0473('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 67374c9..19d6fb8 100644 --- a/server/services/routing/rpc/chatMessage.js +++ b/server/services/routing/rpc/chatMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd17=['create','CreateChatMessage','../client'];(function(_0x20e0bf,_0x2a6453){var _0xb7ae82=function(_0x50a739){while(--_0x50a739){_0x20e0bf['push'](_0x20e0bf['shift']());}};_0xb7ae82(++_0x2a6453);}(_0xfd17,0xaa));var _0x7fd1=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0xfd17[_0xfcbcb8];return _0x1b1f97;};'use strict';var client=require(_0x7fd1('0x0'));exports[_0x7fd1('0x1')]=function(_0xfcb321){return client['Request'](_0x7fd1('0x2'),{'body':_0xfcb321,'log':'createChatMessage'});}; \ No newline at end of file +var _0xb37b=['CreateChatMessage','../client','create','Request'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xb37b,0x1dd));var _0xbb37=function(_0xd93df9,_0x58284c){_0xd93df9=_0xd93df9-0x0;var _0x4b3d1d=_0xb37b[_0xd93df9];return _0x4b3d1d;};'use strict';var client=require(_0xbb37('0x0'));exports[_0xbb37('0x1')]=function(_0x5ce0d4){return client[_0xbb37('0x2')](_0xbb37('0x3'),{'body':_0x5ce0d4,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 410ac1c..51dd64d 100644 --- a/server/services/routing/rpc/chatQueue.js +++ b/server/services/routing/rpc/chatQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbeff=['GetChatQueue','name','timeout','Agents','online','chatPause','getChatQueues','Request'];(function(_0x540110,_0x3408c5){var _0x25311d=function(_0xe0b013){while(--_0xe0b013){_0x540110['push'](_0x540110['shift']());}};_0x25311d(++_0x3408c5);}(_0xbeff,0x8e));var _0xfbef=function(_0x1d5d3f,_0x3a9d08){_0x1d5d3f=_0x1d5d3f-0x0;var _0x6f9221=_0xbeff[_0x1d5d3f];return _0x6f9221;};'use strict';var client=require('../client');exports[_0xfbef('0x0')]=function(){return function(){return client[_0xfbef('0x1')](_0xfbef('0x2'),{'options':{'raw':![],'attributes':['id',_0xfbef('0x3'),_0xfbef('0x4'),'strategy'],'include':[{'model':'User','as':_0xfbef('0x5'),'attributes':['id',_0xfbef('0x3'),_0xfbef('0x6'),_0xfbef('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x1a8f=['Request','GetChatQueue','name','timeout','strategy','chatPause','getChatQueues','../client'];(function(_0x2faeaa,_0x42e74d){var _0x142ffe=function(_0xfe122e){while(--_0xfe122e){_0x2faeaa['push'](_0x2faeaa['shift']());}};_0x142ffe(++_0x42e74d);}(_0x1a8f,0x87));var _0xf1a8=function(_0x4032e3,_0x6d6449){_0x4032e3=_0x4032e3-0x0;var _0x34f51a=_0x1a8f[_0x4032e3];return _0x34f51a;};'use strict';var client=require(_0xf1a8('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xf1a8('0x1')](_0xf1a8('0x2'),{'options':{'raw':![],'attributes':['id',_0xf1a8('0x3'),_0xf1a8('0x4'),_0xf1a8('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id','name','online',_0xf1a8('0x6')]}]},'log':_0xf1a8('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index af3833d..a640f56 100644 --- a/server/services/routing/rpc/chatQueueReport.js +++ b/server/services/routing/rpc/chatQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2fed=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create'];(function(_0x53c5cf,_0x3ef208){var _0x3261aa=function(_0x69b1d){while(--_0x69b1d){_0x53c5cf['push'](_0x53c5cf['shift']());}};_0x3261aa(++_0x3ef208);}(_0x2fed,0x7c));var _0xd2fe=function(_0x2b4fe0,_0x5450f5){_0x2b4fe0=_0x2b4fe0-0x0;var _0x1e79fe=_0x2fed[_0x2b4fe0];return _0x1e79fe;};'use strict';var client=require(_0xd2fe('0x0'));exports[_0xd2fe('0x1')]=function(_0x35bf53){return client[_0xd2fe('0x2')](_0xd2fe('0x3'),{'body':_0x35bf53,'log':'CreateChatQueueReport'});};exports[_0xd2fe('0x4')]=function(_0x20b497,_0x48707a){return client['Request'](_0xd2fe('0x5'),{'body':_0x48707a,'options':{'where':{'uniqueid':_0x20b497},'order':[['id',_0xd2fe('0x6')]],'limit':0x1},'log':_0xd2fe('0x5')});}; \ No newline at end of file +var _0x0207=['CreateChatQueueReport','update','Request','UpdateChatQueueReport','create'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x0207,0x162));var _0x7020=function(_0x2ea9b5,_0x5c0e88){_0x2ea9b5=_0x2ea9b5-0x0;var _0x1b8dab=_0x0207[_0x2ea9b5];return _0x1b8dab;};'use strict';var client=require('../client');exports[_0x7020('0x0')]=function(_0x4a5f80){return client['Request'](_0x7020('0x1'),{'body':_0x4a5f80,'log':_0x7020('0x1')});};exports[_0x7020('0x2')]=function(_0x15db09,_0x2e62fd){return client[_0x7020('0x3')](_0x7020('0x4'),{'body':_0x2e62fd,'options':{'where':{'uniqueid':_0x15db09},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 9bd7240..c0d1df4 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x43df9b,_0x36ccd2){var _0xdc5a1=function(_0x575453){while(--_0x575453){_0x43df9b['push'](_0x43df9b['shift']());}};_0xdc5a1(++_0x36ccd2);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x43b88c,_0x46fb04){var _0x407299=function(_0x16dcd3){while(--_0x16dcd3){_0x43b88c['push'](_0x43b88c['shift']());}};_0x407299(++_0x46fb04);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 4364624..6211ddc 100644 --- a/server/services/routing/rpc/faxMessage.js +++ b/server/services/routing/rpc/faxMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x539b=['CreateFaxMessage','createFaxMessage','../client','create','Request'];(function(_0x31c19c,_0xbe4b70){var _0x1a87f7=function(_0x23cf92){while(--_0x23cf92){_0x31c19c['push'](_0x31c19c['shift']());}};_0x1a87f7(++_0xbe4b70);}(_0x539b,0x156));var _0xb539=function(_0x56b0e0,_0x33d3a7){_0x56b0e0=_0x56b0e0-0x0;var _0x203de0=_0x539b[_0x56b0e0];return _0x203de0;};'use strict';var client=require(_0xb539('0x0'));exports[_0xb539('0x1')]=function(_0x8c860a){return client[_0xb539('0x2')](_0xb539('0x3'),{'body':_0x8c860a,'log':_0xb539('0x4')});}; \ No newline at end of file +var _0x6ac6=['create','Request','CreateFaxMessage','../client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6ac6,0xe3));var _0x66ac=function(_0x485d07,_0x1a6a6b){_0x485d07=_0x485d07-0x0;var _0x3307a7=_0x6ac6[_0x485d07];return _0x3307a7;};'use strict';var client=require(_0x66ac('0x0'));exports[_0x66ac('0x1')]=function(_0x17f51b){return client[_0x66ac('0x2')](_0x66ac('0x3'),{'body':_0x17f51b,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 2f51729..e48dddf 100644 --- a/server/services/routing/rpc/faxQueue.js +++ b/server/services/routing/rpc/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf0a=['name','timeout','User','Agents','getFaxQueues','Request'];(function(_0x1f0eca,_0x346c73){var _0x77e18c=function(_0x108304){while(--_0x108304){_0x1f0eca['push'](_0x1f0eca['shift']());}};_0x77e18c(++_0x346c73);}(_0xcf0a,0x1de));var _0xacf0=function(_0x53c28a,_0xeac20e){_0x53c28a=_0x53c28a-0x0;var _0x45f627=_0xcf0a[_0x53c28a];return _0x45f627;};'use strict';var client=require('../client');exports[_0xacf0('0x0')]=function(){return function(){return client[_0xacf0('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xacf0('0x2'),_0xacf0('0x3'),'strategy'],'include':[{'model':_0xacf0('0x4'),'as':_0xacf0('0x5'),'attributes':['id','name','online','faxPause']}]},'log':_0xacf0('0x0')});};}; \ No newline at end of file +var _0xe36a=['User','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','strategy'];(function(_0x42c793,_0x82a277){var _0x4ec0d5=function(_0x1c6e67){while(--_0x1c6e67){_0x42c793['push'](_0x42c793['shift']());}};_0x4ec0d5(++_0x82a277);}(_0xe36a,0x108));var _0xae36=function(_0xbfbef0,_0x218b21){_0xbfbef0=_0xbfbef0-0x0;var _0x3fdf6f=_0xe36a[_0xbfbef0];return _0x3fdf6f;};'use strict';var client=require(_0xae36('0x0'));exports[_0xae36('0x1')]=function(){return function(){return client[_0xae36('0x2')](_0xae36('0x3'),{'options':{'raw':![],'attributes':['id',_0xae36('0x4'),'timeout',_0xae36('0x5')],'include':[{'model':_0xae36('0x6'),'as':'Agents','attributes':['id',_0xae36('0x4'),_0xae36('0x7'),_0xae36('0x8')]}]},'log':_0xae36('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 5a11e0d..f74b25c 100644 --- a/server/services/routing/rpc/faxQueueReport.js +++ b/server/services/routing/rpc/faxQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f92=['UpdateFaxQueueReport','DESC','create','Request','CreateFaxQueueReport'];(function(_0x4361f6,_0xa68336){var _0xc922aa=function(_0x5caa7f){while(--_0x5caa7f){_0x4361f6['push'](_0x4361f6['shift']());}};_0xc922aa(++_0xa68336);}(_0x2f92,0x197));var _0x22f9=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x2f92[_0x513aa5];return _0x1a1a7c;};'use strict';var client=require('../client');exports[_0x22f9('0x0')]=function(_0x3fe863){return client[_0x22f9('0x1')](_0x22f9('0x2'),{'body':_0x3fe863,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x237447,_0x32fdc2){return client[_0x22f9('0x1')](_0x22f9('0x3'),{'body':_0x32fdc2,'options':{'where':{'uniqueid':_0x237447},'order':[['id',_0x22f9('0x4')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0xe3ec=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','Request'];(function(_0x791545,_0x4c2098){var _0x14a7e6=function(_0x22563b){while(--_0x22563b){_0x791545['push'](_0x791545['shift']());}};_0x14a7e6(++_0x4c2098);}(_0xe3ec,0x154));var _0xce3e=function(_0x50daad,_0x35a772){_0x50daad=_0x50daad-0x0;var _0x3c2d72=_0xe3ec[_0x50daad];return _0x3c2d72;};'use strict';var client=require(_0xce3e('0x0'));exports['create']=function(_0x489dcb){return client[_0xce3e('0x1')](_0xce3e('0x2'),{'body':_0x489dcb,'log':'CreateFaxQueueReport'});};exports[_0xce3e('0x3')]=function(_0x2edd2e,_0x202fee){return client[_0xce3e('0x1')](_0xce3e('0x4'),{'body':_0x202fee,'options':{'where':{'uniqueid':_0x2edd2e},'order':[['id',_0xce3e('0x5')]],'limit':0x1},'log':_0xce3e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 9f7c585..81f76c3 100644 --- a/server/services/routing/rpc/interval.js +++ b/server/services/routing/rpc/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3b7=['Request','name','Interval','Intervals','getIntervals'];(function(_0x1ce6a1,_0x3f46b8){var _0x46b798=function(_0x2319e7){while(--_0x2319e7){_0x1ce6a1['push'](_0x1ce6a1['shift']());}};_0x46b798(++_0x3f46b8);}(_0xc3b7,0x168));var _0x7c3b=function(_0x5c90cf,_0x1c591e){_0x5c90cf=_0x5c90cf-0x0;var _0x50a2fb=_0xc3b7[_0x5c90cf];return _0x50a2fb;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client[_0x7c3b('0x0')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x7c3b('0x1')],'include':[{'model':_0x7c3b('0x2'),'as':_0x7c3b('0x3'),'attributes':['id',_0x7c3b('0x1'),'interval']}]},'log':_0x7c3b('0x4')});};}; \ No newline at end of file +var _0xdb38=['interval','getIntervals','Request','name','Intervals'];(function(_0x326558,_0x4a22a1){var _0x5cd3a0=function(_0x412b66){while(--_0x412b66){_0x326558['push'](_0x326558['shift']());}};_0x5cd3a0(++_0x4a22a1);}(_0xdb38,0xe7));var _0x8db3=function(_0x7f16d2,_0x542ecf){_0x7f16d2=_0x7f16d2-0x0;var _0x42ad6a=_0xdb38[_0x7f16d2];return _0x42ad6a;};'use strict';var client=require('../client');exports[_0x8db3('0x0')]=function(){return function(){return client[_0x8db3('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x8db3('0x2')],'include':[{'model':'Interval','as':_0x8db3('0x3'),'attributes':['id',_0x8db3('0x2'),_0x8db3('0x4')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 30bcf46..880d6e2 100644 --- a/server/services/routing/rpc/mailInteraction.js +++ b/server/services/routing/rpc/mailInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c9a=['updateMailInteraction','AddTagsToMailInteraction','../client','Request','UpdateMailInteraction'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0x1c9a,0x98));var _0xa1c9=function(_0x3ce68b,_0x5df546){_0x3ce68b=_0x3ce68b-0x0;var _0x2cdb3e=_0x1c9a[_0x3ce68b];return _0x2cdb3e;};'use strict';var client=require(_0xa1c9('0x0'));exports['update']=function(_0x470dcd,_0x5c45c5){return client[_0xa1c9('0x1')](_0xa1c9('0x2'),{'body':_0x5c45c5,'options':{'where':{'id':_0x470dcd}},'log':_0xa1c9('0x3')});};exports['addTags']=function(_0x21c0fc,_0x45d1f7){return client[_0xa1c9('0x1')](_0xa1c9('0x4'),{'body':_0x45d1f7,'options':{'where':{'id':_0x21c0fc}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x4888=['AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x20cdb5,_0x2a0714){var _0x32b9e7=function(_0x3fb0f5){while(--_0x3fb0f5){_0x20cdb5['push'](_0x20cdb5['shift']());}};_0x32b9e7(++_0x2a0714);}(_0x4888,0x198));var _0x8488=function(_0x1b0dd3,_0x510b79){_0x1b0dd3=_0x1b0dd3-0x0;var _0x31b5da=_0x4888[_0x1b0dd3];return _0x31b5da;};'use strict';var client=require('../client');exports[_0x8488('0x0')]=function(_0x1f0e53,_0x2af900){return client[_0x8488('0x1')](_0x8488('0x2'),{'body':_0x2af900,'options':{'where':{'id':_0x1f0e53}},'log':_0x8488('0x3')});};exports[_0x8488('0x4')]=function(_0x571e4b,_0x267093){return client[_0x8488('0x1')](_0x8488('0x5'),{'body':_0x267093,'options':{'where':{'id':_0x571e4b}},'log':_0x8488('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 9e8a459..b62cd81 100644 --- a/server/services/routing/rpc/mailMessage.js +++ b/server/services/routing/rpc/mailMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5793=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x3afc75,_0x32dc5b){var _0x16f415=function(_0x405862){while(--_0x405862){_0x3afc75['push'](_0x3afc75['shift']());}};_0x16f415(++_0x32dc5b);}(_0x5793,0x198));var _0x3579=function(_0x3952d3,_0x45439e){_0x3952d3=_0x3952d3-0x0;var _0x542269=_0x5793[_0x3952d3];return _0x542269;};'use strict';var client=require(_0x3579('0x0'));exports[_0x3579('0x1')]=function(_0x85e0a5){return client[_0x3579('0x2')](_0x3579('0x3'),{'body':_0x85e0a5,'log':_0x3579('0x4')});}; \ No newline at end of file +var _0xf27c=['createMailMessage','../client','create','Request'];(function(_0x3b6d60,_0xfb23be){var _0x54beb5=function(_0x28a234){while(--_0x28a234){_0x3b6d60['push'](_0x3b6d60['shift']());}};_0x54beb5(++_0xfb23be);}(_0xf27c,0x155));var _0xcf27=function(_0xcd9a05,_0x3d7f5e){_0xcd9a05=_0xcd9a05-0x0;var _0x216942=_0xf27c[_0xcd9a05];return _0x216942;};'use strict';var client=require(_0xcf27('0x0'));exports[_0xcf27('0x1')]=function(_0x2a2601){return client[_0xcf27('0x2')]('CreateMailMessage',{'body':_0x2a2601,'log':_0xcf27('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 199dd2e..a148404 100644 --- a/server/services/routing/rpc/mailQueue.js +++ b/server/services/routing/rpc/mailQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc66b=['mailPause','../client','getMailQueues','GetMailQueue','timeout','strategy','User','name','online'];(function(_0x3bbf4e,_0x35d420){var _0x5833c2=function(_0x4da5c7){while(--_0x4da5c7){_0x3bbf4e['push'](_0x3bbf4e['shift']());}};_0x5833c2(++_0x35d420);}(_0xc66b,0x76));var _0xbc66=function(_0x236c89,_0xd76ba9){_0x236c89=_0x236c89-0x0;var _0x3b2a15=_0xc66b[_0x236c89];return _0x3b2a15;};'use strict';var client=require(_0xbc66('0x0'));exports[_0xbc66('0x1')]=function(){return function(){return client['Request'](_0xbc66('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xbc66('0x3'),_0xbc66('0x4')],'include':[{'model':_0xbc66('0x5'),'as':'Agents','attributes':['id',_0xbc66('0x6'),_0xbc66('0x7'),_0xbc66('0x8')]}]},'log':_0xbc66('0x1')});};}; \ No newline at end of file +var _0x1b38=['getMailQueues','Request','GetMailQueue','name','timeout','strategy','User','Agents','mailPause','../client'];(function(_0x56e902,_0x5aa67e){var _0x826c44=function(_0xc51336){while(--_0xc51336){_0x56e902['push'](_0x56e902['shift']());}};_0x826c44(++_0x5aa67e);}(_0x1b38,0x95));var _0x81b3=function(_0x19d19c,_0x1f05da){_0x19d19c=_0x19d19c-0x0;var _0x849751=_0x1b38[_0x19d19c];return _0x849751;};'use strict';var client=require(_0x81b3('0x0'));exports[_0x81b3('0x1')]=function(){return function(){return client[_0x81b3('0x2')](_0x81b3('0x3'),{'options':{'raw':![],'attributes':['id',_0x81b3('0x4'),_0x81b3('0x5'),_0x81b3('0x6')],'include':[{'model':_0x81b3('0x7'),'as':_0x81b3('0x8'),'attributes':['id',_0x81b3('0x4'),'online',_0x81b3('0x9')]}]},'log':_0x81b3('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 9438adb..9cd0e32 100644 --- a/server/services/routing/rpc/mailQueueReport.js +++ b/server/services/routing/rpc/mailQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35f5=['../client','Request','CreateMailQueueReport','UpdateMailQueueReport'];(function(_0x5442a5,_0x4110f1){var _0x130af0=function(_0x457ec2){while(--_0x457ec2){_0x5442a5['push'](_0x5442a5['shift']());}};_0x130af0(++_0x4110f1);}(_0x35f5,0x100));var _0x535f=function(_0xd1a252,_0x16396f){_0xd1a252=_0xd1a252-0x0;var _0x560ee1=_0x35f5[_0xd1a252];return _0x560ee1;};'use strict';var client=require(_0x535f('0x0'));exports['create']=function(_0x11d139){return client[_0x535f('0x1')](_0x535f('0x2'),{'body':_0x11d139,'log':_0x535f('0x2')});};exports['update']=function(_0x4aa724,_0x5f4a18){return client[_0x535f('0x1')](_0x535f('0x3'),{'body':_0x5f4a18,'options':{'where':{'uniqueid':_0x4aa724},'order':[['id','DESC']],'limit':0x1},'log':_0x535f('0x3')});}; \ No newline at end of file +var _0xbff5=['update','DESC','UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport'];(function(_0x4a06ec,_0x34c102){var _0x2acc36=function(_0x14a411){while(--_0x14a411){_0x4a06ec['push'](_0x4a06ec['shift']());}};_0x2acc36(++_0x34c102);}(_0xbff5,0x1bc));var _0x5bff=function(_0x5dd53c,_0x469245){_0x5dd53c=_0x5dd53c-0x0;var _0x13503d=_0xbff5[_0x5dd53c];return _0x13503d;};'use strict';var client=require(_0x5bff('0x0'));exports[_0x5bff('0x1')]=function(_0xd96d55){return client[_0x5bff('0x2')](_0x5bff('0x3'),{'body':_0xd96d55,'log':_0x5bff('0x3')});};exports[_0x5bff('0x4')]=function(_0x4dccf3,_0x3868ae){return client['Request']('UpdateMailQueueReport',{'body':_0x3868ae,'options':{'where':{'uniqueid':_0x4dccf3},'order':[['id',_0x5bff('0x5')]],'limit':0x1},'log':_0x5bff('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 48fa56c..861970d 100644 --- a/server/services/routing/rpc/openchannelInteraction.js +++ b/server/services/routing/rpc/openchannelInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4ad=['addTagsToChatInteraction','../client','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction'];(function(_0x393b41,_0x7973a3){var _0x5d738a=function(_0x3b4078){while(--_0x3b4078){_0x393b41['push'](_0x393b41['shift']());}};_0x5d738a(++_0x7973a3);}(_0xf4ad,0xbe));var _0xdf4a=function(_0x48ae62,_0x3cfce7){_0x48ae62=_0x48ae62-0x0;var _0x2634a6=_0xf4ad[_0x48ae62];return _0x2634a6;};'use strict';var client=require(_0xdf4a('0x0'));exports['update']=function(_0x11e896,_0x3ada29){return client['Request'](_0xdf4a('0x1'),{'body':_0x3ada29,'options':{'where':{'id':_0x11e896}},'log':_0xdf4a('0x2')});};exports[_0xdf4a('0x3')]=function(_0x46c2f0,_0x5b62e3){return client[_0xdf4a('0x4')](_0xdf4a('0x5'),{'body':_0x5b62e3,'options':{'where':{'id':_0x46c2f0}},'log':_0xdf4a('0x6')});}; \ No newline at end of file +var _0x1a90=['updateOpenchannelInteraction','addTags','addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction'];(function(_0x433cfe,_0x47ce1e){var _0x1843a8=function(_0x3685bb){while(--_0x3685bb){_0x433cfe['push'](_0x433cfe['shift']());}};_0x1843a8(++_0x47ce1e);}(_0x1a90,0x165));var _0x01a9=function(_0x5757cf,_0x303a83){_0x5757cf=_0x5757cf-0x0;var _0x2e2732=_0x1a90[_0x5757cf];return _0x2e2732;};'use strict';var client=require(_0x01a9('0x0'));exports['update']=function(_0x566283,_0x41bcc3){return client[_0x01a9('0x1')](_0x01a9('0x2'),{'body':_0x41bcc3,'options':{'where':{'id':_0x566283}},'log':_0x01a9('0x3')});};exports[_0x01a9('0x4')]=function(_0x19632f,_0xb5cbcd){return client[_0x01a9('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0xb5cbcd,'options':{'where':{'id':_0x19632f}},'log':_0x01a9('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 59a1ff7..efcf041 100644 --- a/server/services/routing/rpc/openchannelMessage.js +++ b/server/services/routing/rpc/openchannelMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1738=['createOpenchannelMessage','../client','create','Request'];(function(_0x28415e,_0x30c1eb){var _0x3d2e05=function(_0x1e7668){while(--_0x1e7668){_0x28415e['push'](_0x28415e['shift']());}};_0x3d2e05(++_0x30c1eb);}(_0x1738,0x89));var _0x8173=function(_0x1d3a5d,_0x17fc32){_0x1d3a5d=_0x1d3a5d-0x0;var _0x257078=_0x1738[_0x1d3a5d];return _0x257078;};'use strict';var client=require(_0x8173('0x0'));exports[_0x8173('0x1')]=function(_0x367ac8){return client[_0x8173('0x2')]('CreateOpenchannelMessage',{'body':_0x367ac8,'log':_0x8173('0x3')});}; \ No newline at end of file +var _0xc5c2=['createOpenchannelMessage','Request','CreateOpenchannelMessage'];(function(_0x4ec620,_0xb0f633){var _0x341ad0=function(_0x54cca4){while(--_0x54cca4){_0x4ec620['push'](_0x4ec620['shift']());}};_0x341ad0(++_0xb0f633);}(_0xc5c2,0x18d));var _0x2c5c=function(_0x12d7f4,_0x1c0317){_0x12d7f4=_0x12d7f4-0x0;var _0x1027b0=_0xc5c2[_0x12d7f4];return _0x1027b0;};'use strict';var client=require('../client');exports['create']=function(_0x162356){return client[_0x2c5c('0x0')](_0x2c5c('0x1'),{'body':_0x162356,'log':_0x2c5c('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 543fd2d..bda86df 100644 --- a/server/services/routing/rpc/openchannelQueue.js +++ b/server/services/routing/rpc/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc964=['GetOpenchannelQueue','timeout','User','name','online','openchannelPause','getOpenchannelQueues','../client'];(function(_0x291057,_0x282230){var _0x568961=function(_0x38fb0d){while(--_0x38fb0d){_0x291057['push'](_0x291057['shift']());}};_0x568961(++_0x282230);}(_0xc964,0x107));var _0x4c96=function(_0x3c0cf0,_0x4567f4){_0x3c0cf0=_0x3c0cf0-0x0;var _0x4ba214=_0xc964[_0x3c0cf0];return _0x4ba214;};'use strict';var client=require(_0x4c96('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client['Request'](_0x4c96('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x4c96('0x2'),'strategy'],'include':[{'model':_0x4c96('0x3'),'as':'Agents','attributes':['id',_0x4c96('0x4'),_0x4c96('0x5'),_0x4c96('0x6')]}]},'log':_0x4c96('0x7')});};}; \ No newline at end of file +var _0xd606=['openchannelPause','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents','online'];(function(_0x501c00,_0x1dc98b){var _0x5ad836=function(_0x21299f){while(--_0x21299f){_0x501c00['push'](_0x501c00['shift']());}};_0x5ad836(++_0x1dc98b);}(_0xd606,0x120));var _0x6d60=function(_0x1238d1,_0x3fedc4){_0x1238d1=_0x1238d1-0x0;var _0x1e3f40=_0xd606[_0x1238d1];return _0x1e3f40;};'use strict';var client=require(_0x6d60('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x6d60('0x1')](_0x6d60('0x2'),{'options':{'raw':![],'attributes':['id',_0x6d60('0x3'),_0x6d60('0x4'),_0x6d60('0x5')],'include':[{'model':_0x6d60('0x6'),'as':_0x6d60('0x7'),'attributes':['id',_0x6d60('0x3'),_0x6d60('0x8'),_0x6d60('0x9')]}]},'log':_0x6d60('0xa')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 7c3d31b..2702af4 100644 --- a/server/services/routing/rpc/openchannelQueueReport.js +++ b/server/services/routing/rpc/openchannelQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ace=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create','Request'];(function(_0x47623f,_0x148f3a){var _0x282ce8=function(_0x35bca1){while(--_0x35bca1){_0x47623f['push'](_0x47623f['shift']());}};_0x282ce8(++_0x148f3a);}(_0x7ace,0xd6));var _0xe7ac=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x7ace[_0x138adb];return _0x1b27f2;};'use strict';var client=require(_0xe7ac('0x0'));exports[_0xe7ac('0x1')]=function(_0x269021){return client[_0xe7ac('0x2')](_0xe7ac('0x3'),{'body':_0x269021,'log':_0xe7ac('0x3')});};exports[_0xe7ac('0x4')]=function(_0x581be1,_0x53d981){return client['Request'](_0xe7ac('0x5'),{'body':_0x53d981,'options':{'where':{'uniqueid':_0x581be1},'order':[['id',_0xe7ac('0x6')]],'limit':0x1},'log':_0xe7ac('0x5')});}; \ No newline at end of file +var _0x4fe9=['../client','Request','CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport'];(function(_0x5660d5,_0x235c27){var _0x2a144d=function(_0x54fb3f){while(--_0x54fb3f){_0x5660d5['push'](_0x5660d5['shift']());}};_0x2a144d(++_0x235c27);}(_0x4fe9,0x90));var _0x94fe=function(_0x32f7a0,_0x5577fd){_0x32f7a0=_0x32f7a0-0x0;var _0x490782=_0x4fe9[_0x32f7a0];return _0x490782;};'use strict';var client=require(_0x94fe('0x0'));exports['create']=function(_0x3e18ae){return client[_0x94fe('0x1')](_0x94fe('0x2'),{'body':_0x3e18ae,'log':_0x94fe('0x2')});};exports[_0x94fe('0x3')]=function(_0x40f8da,_0x2f5211){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x2f5211,'options':{'where':{'uniqueid':_0x40f8da},'order':[['id',_0x94fe('0x4')]],'limit':0x1},'log':_0x94fe('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 7f4c2b9..6d0a31b 100644 --- a/server/services/routing/rpc/smsInteraction.js +++ b/server/services/routing/rpc/smsInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34f8=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','addTags'];(function(_0x1ce269,_0x20ec6e){var _0x3c66e0=function(_0x115c45){while(--_0x115c45){_0x1ce269['push'](_0x1ce269['shift']());}};_0x3c66e0(++_0x20ec6e);}(_0x34f8,0x80));var _0x834f=function(_0x3046a7,_0x224ffb){_0x3046a7=_0x3046a7-0x0;var _0x6b4b2=_0x34f8[_0x3046a7];return _0x6b4b2;};'use strict';var client=require(_0x834f('0x0'));exports[_0x834f('0x1')]=function(_0x2a7837,_0x45ec5b){return client[_0x834f('0x2')]('UpdateSmsInteraction',{'body':_0x45ec5b,'options':{'where':{'id':_0x2a7837}},'log':'updateSmsInteraction'});};exports[_0x834f('0x3')]=function(_0x92264b,_0x4d23b1){return client[_0x834f('0x2')](_0x834f('0x4'),{'body':_0x4d23b1,'options':{'where':{'id':_0x92264b}},'log':_0x834f('0x5')});}; \ No newline at end of file +var _0x004c=['../client','update','UpdateSmsInteraction','updateSmsInteraction','addTags','Request','addTagsToSmsInteraction'];(function(_0x2f54b6,_0x3cc6cb){var _0x169f21=function(_0x4dac27){while(--_0x4dac27){_0x2f54b6['push'](_0x2f54b6['shift']());}};_0x169f21(++_0x3cc6cb);}(_0x004c,0x85));var _0xc004=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x004c[_0x11c573];return _0x6b72de;};'use strict';var client=require(_0xc004('0x0'));exports[_0xc004('0x1')]=function(_0x3fa239,_0x2cf6a8){return client['Request'](_0xc004('0x2'),{'body':_0x2cf6a8,'options':{'where':{'id':_0x3fa239}},'log':_0xc004('0x3')});};exports[_0xc004('0x4')]=function(_0x38a8b9,_0x571646){return client[_0xc004('0x5')]('AddTagsToSmsInteraction',{'body':_0x571646,'options':{'where':{'id':_0x38a8b9}},'log':_0xc004('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 9b3e7a4..312cfbe 100644 --- a/server/services/routing/rpc/smsMessage.js +++ b/server/services/routing/rpc/smsMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x252e=['Request','createSmsMessage','../client','create'];(function(_0x17e696,_0xad1c39){var _0x1a9e33=function(_0x28d22a){while(--_0x28d22a){_0x17e696['push'](_0x17e696['shift']());}};_0x1a9e33(++_0xad1c39);}(_0x252e,0xd6));var _0xe252=function(_0x50e402,_0x3b585f){_0x50e402=_0x50e402-0x0;var _0x1c33a3=_0x252e[_0x50e402];return _0x1c33a3;};'use strict';var client=require(_0xe252('0x0'));exports[_0xe252('0x1')]=function(_0x3ecc22){return client[_0xe252('0x2')]('CreateSmsMessage',{'body':_0x3ecc22,'log':_0xe252('0x3')});}; \ No newline at end of file +var _0xeee6=['CreateSmsMessage','../client','create'];(function(_0x13c391,_0x147226){var _0x14d618=function(_0x375bb8){while(--_0x375bb8){_0x13c391['push'](_0x13c391['shift']());}};_0x14d618(++_0x147226);}(_0xeee6,0x121));var _0x6eee=function(_0x52aace,_0x90caaf){_0x52aace=_0x52aace-0x0;var _0x40e019=_0xeee6[_0x52aace];return _0x40e019;};'use strict';var client=require(_0x6eee('0x0'));exports[_0x6eee('0x1')]=function(_0x3e8729){return client['Request'](_0x6eee('0x2'),{'body':_0x3e8729,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index e4d4dae..b4ffdff 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x5023ff,_0x27993a){var _0x3f1764=function(_0x13e6f1){while(--_0x13e6f1){_0x5023ff['push'](_0x5023ff['shift']());}};_0x3f1764(++_0x27993a);}(_0xe706,0xa3));var _0x6e70=function(_0x2a59af,_0x18d558){_0x2a59af=_0x2a59af-0x0;var _0x3af243=_0xe706[_0x2a59af];return _0x3af243;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file +var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x11e935,_0x2e932d){var _0x456bbe=function(_0x175186){while(--_0x175186){_0x11e935['push'](_0x11e935['shift']());}};_0x456bbe(++_0x2e932d);}(_0xe706,0xa3));var _0x6e70=function(_0x4259a3,_0x2f9e82){_0x4259a3=_0x4259a3-0x0;var _0x5dfed4=_0xe706[_0x4259a3];return _0x5dfed4;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index c4b6f02..6f568a8 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x12a2a6,_0x374ff1){var _0x1754ae=function(_0x49d787){while(--_0x49d787){_0x12a2a6['push'](_0x12a2a6['shift']());}};_0x1754ae(++_0x374ff1);}(_0xedd9,0xfc));var _0x9edd=function(_0x26e9d3,_0x4cb793){_0x26e9d3=_0x26e9d3-0x0;var _0x17739b=_0xedd9[_0x26e9d3];return _0x17739b;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file +var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x5502d8,_0x3266f4){var _0x3a510c=function(_0x5d2001){while(--_0x5d2001){_0x5502d8['push'](_0x5502d8['shift']());}};_0x3a510c(++_0x3266f4);}(_0x3e74,0x175));var _0x43e7=function(_0x2890ad,_0x39eb3c){_0x2890ad=_0x2890ad-0x0;var _0x3cbedd=_0x3e74[_0x2890ad];return _0x3cbedd;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index bb50cfb..bbdcead 100644 --- a/server/services/routing/rpc/user.js +++ b/server/services/routing/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x273e2b,_0x13d430){var _0x3d891b=function(_0x5d77b7){while(--_0x5d77b7){_0x273e2b['push'](_0x273e2b['shift']());}};_0x3d891b(++_0x13d430);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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(_0x44878d,_0x48db95){var _0x37ec37=function(_0x111e9c){while(--_0x111e9c){_0x44878d['push'](_0x44878d['shift']());}};_0x37ec37(++_0x48db95);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index 0594ecb..82146ff 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcde7=['addTagsToWhatsappInteraction','Request','addTags','AddTagsToWhatsappInteraction'];(function(_0x3f70d8,_0x56bee8){var _0x57c8b2=function(_0x496dc2){while(--_0x496dc2){_0x3f70d8['push'](_0x3f70d8['shift']());}};_0x57c8b2(++_0x56bee8);}(_0xcde7,0x65));var _0x7cde=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xcde7[_0x59ee6f];return _0x4c0979;};'use strict';var client=require('../client');exports['update']=function(_0x210314,_0x2e1936){return client[_0x7cde('0x0')]('UpdateWhatsappInteraction',{'body':_0x2e1936,'options':{'where':{'id':_0x210314}},'log':'updateWhatsappInteraction'});};exports[_0x7cde('0x1')]=function(_0x47962e,_0x23ec50){return client[_0x7cde('0x0')](_0x7cde('0x2'),{'body':_0x23ec50,'options':{'where':{'id':_0x47962e}},'log':_0x7cde('0x3')});}; \ No newline at end of file +var _0x1623=['updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','../client','Request','UpdateWhatsappInteraction'];(function(_0xb7b878,_0x5c3b92){var _0x3c84b9=function(_0x21d5a2){while(--_0x21d5a2){_0xb7b878['push'](_0xb7b878['shift']());}};_0x3c84b9(++_0x5c3b92);}(_0x1623,0xab));var _0x3162=function(_0x2f1f40,_0x29f142){_0x2f1f40=_0x2f1f40-0x0;var _0x2ca0a3=_0x1623[_0x2f1f40];return _0x2ca0a3;};'use strict';var client=require(_0x3162('0x0'));exports['update']=function(_0x5b17d4,_0x311951){return client[_0x3162('0x1')](_0x3162('0x2'),{'body':_0x311951,'options':{'where':{'id':_0x5b17d4}},'log':_0x3162('0x3')});};exports[_0x3162('0x4')]=function(_0x4ce2bd,_0x5d49d0){return client[_0x3162('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x5d49d0,'options':{'where':{'id':_0x4ce2bd}},'log':_0x3162('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index ccaa617..051f436 100644 --- a/server/services/routing/rpc/whatsappMessage.js +++ b/server/services/routing/rpc/whatsappMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52e4=['CreateWhatsappMessage','create'];(function(_0x496ebe,_0x5a224a){var _0x392b56=function(_0x18d137){while(--_0x18d137){_0x496ebe['push'](_0x496ebe['shift']());}};_0x392b56(++_0x5a224a);}(_0x52e4,0x1b3));var _0x452e=function(_0x3f5f1a,_0x47bf16){_0x3f5f1a=_0x3f5f1a-0x0;var _0x3d28bd=_0x52e4[_0x3f5f1a];return _0x3d28bd;};'use strict';var client=require('../client');exports[_0x452e('0x0')]=function(_0x1201b8){return client['Request'](_0x452e('0x1'),{'body':_0x1201b8,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0xf401=['Request','CreateWhatsappMessage','../client'];(function(_0x150654,_0x22e377){var _0x28dbee=function(_0x31703f){while(--_0x31703f){_0x150654['push'](_0x150654['shift']());}};_0x28dbee(++_0x22e377);}(_0xf401,0x1df));var _0x1f40=function(_0x5d78bf,_0x3c7bd7){_0x5d78bf=_0x5d78bf-0x0;var _0x7c07d4=_0xf401[_0x5d78bf];return _0x7c07d4;};'use strict';var client=require(_0x1f40('0x0'));exports['create']=function(_0x7a2ad6){return client[_0x1f40('0x1')](_0x1f40('0x2'),{'body':_0x7a2ad6,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 7b58b9b..3c7f993 100644 --- a/server/services/routing/rpc/whatsappQueue.js +++ b/server/services/routing/rpc/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a31=['GetWhatsappQueue','name','strategy','User','Agents','online','whatsappPause','../client','getWhatsappQueues','Request'];(function(_0x2650c6,_0x1c56df){var _0x207c8c=function(_0x6a470b){while(--_0x6a470b){_0x2650c6['push'](_0x2650c6['shift']());}};_0x207c8c(++_0x1c56df);}(_0x6a31,0xed));var _0x16a3=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0x6a31[_0x2fee96];return _0x2e6ad1;};'use strict';var client=require(_0x16a3('0x0'));exports[_0x16a3('0x1')]=function(){return function(){return client[_0x16a3('0x2')](_0x16a3('0x3'),{'options':{'raw':![],'attributes':['id',_0x16a3('0x4'),'timeout',_0x16a3('0x5')],'include':[{'model':_0x16a3('0x6'),'as':_0x16a3('0x7'),'attributes':['id',_0x16a3('0x4'),_0x16a3('0x8'),_0x16a3('0x9')]}]},'log':_0x16a3('0x1')});};}; \ No newline at end of file +var _0x8b2c=['GetWhatsappQueue','name','strategy','Agents','online','whatsappPause','../client','getWhatsappQueues','Request'];(function(_0x1e2072,_0xe3cc90){var _0x22956b=function(_0x118dcf){while(--_0x118dcf){_0x1e2072['push'](_0x1e2072['shift']());}};_0x22956b(++_0xe3cc90);}(_0x8b2c,0x19b));var _0xc8b2=function(_0x15e62a,_0x73cd0d){_0x15e62a=_0x15e62a-0x0;var _0x281df9=_0x8b2c[_0x15e62a];return _0x281df9;};'use strict';var client=require(_0xc8b2('0x0'));exports[_0xc8b2('0x1')]=function(){return function(){return client[_0xc8b2('0x2')](_0xc8b2('0x3'),{'options':{'raw':![],'attributes':['id',_0xc8b2('0x4'),'timeout',_0xc8b2('0x5')],'include':[{'model':'User','as':_0xc8b2('0x6'),'attributes':['id','name',_0xc8b2('0x7'),_0xc8b2('0x8')]}]},'log':_0xc8b2('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 60fcfc0..0a9f060 100644 --- a/server/services/routing/rpc/whatsappQueueReport.js +++ b/server/services/routing/rpc/whatsappQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed29=['create','CreateWhatsappQueueReport','Request','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x4f2c3a,_0x6bde90){var _0x17d91c=function(_0xaaf630){while(--_0xaaf630){_0x4f2c3a['push'](_0x4f2c3a['shift']());}};_0x17d91c(++_0x6bde90);}(_0xed29,0x6b));var _0x9ed2=function(_0x3328b4,_0x403a24){_0x3328b4=_0x3328b4-0x0;var _0x530143=_0xed29[_0x3328b4];return _0x530143;};'use strict';var client=require(_0x9ed2('0x0'));exports[_0x9ed2('0x1')]=function(_0x281b6e){return client['Request'](_0x9ed2('0x2'),{'body':_0x281b6e,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x4b1252,_0x5c5926){return client[_0x9ed2('0x3')](_0x9ed2('0x4'),{'body':_0x5c5926,'options':{'where':{'uniqueid':_0x4b1252},'order':[['id',_0x9ed2('0x5')]],'limit':0x1},'log':_0x9ed2('0x4')});}; \ No newline at end of file +var _0x8bd2=['Request','UpdateWhatsappQueueReport','DESC','create','CreateWhatsappQueueReport','update'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0x8bd2,0xb7));var _0x28bd=function(_0x3c2b2e,_0x3e6e53){_0x3c2b2e=_0x3c2b2e-0x0;var _0x27a338=_0x8bd2[_0x3c2b2e];return _0x27a338;};'use strict';var client=require('../client');exports[_0x28bd('0x0')]=function(_0x19983d){return client['Request'](_0x28bd('0x1'),{'body':_0x19983d,'log':_0x28bd('0x1')});};exports[_0x28bd('0x2')]=function(_0x2274f4,_0x5908ee){return client[_0x28bd('0x3')](_0x28bd('0x4'),{'body':_0x5908ee,'options':{'where':{'uniqueid':_0x2274f4},'order':[['id',_0x28bd('0x5')]],'limit':0x1},'log':_0x28bd('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 7a210c1..ddddeca 100644 --- a/server/services/routing/server/applications/agent.js +++ b/server/services/routing/server/applications/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe205=['end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','rules','info','[%s][AGENT]\x20ROUTING\x20END','next','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map','message','stop','find','timeout','createQueue','atimeout','channel','START:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe205,0xc5));var _0x5e20=function(_0x3c317a,_0x298a26){_0x3c317a=_0x3c317a-0x0;var _0x45d798=_0xe205[_0x3c317a];return _0x45d798;};'use strict';var schema=require(_0x5e20('0x0'));var _=require(_0x5e20('0x1'));var util=require(_0x5e20('0x2'));var seqqueue=require(_0x5e20('0x3'));var logger=require(_0x5e20('0x4'))(_0x5e20('0x5'));var strategy=require(_0x5e20('0x6'));var queue=schema({'name':{'type':_0x5e20('0x7'),'required':!![],'message':_0x5e20('0x8')},'timeout':{'type':_0x5e20('0x9'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x158684,_0x564995,_0x446633){return logger['info'](util[_0x5e20('0xa')](_0x5e20('0xb'),_0x158684,_0x564995['name'],_0x446633));}function handleFindAgent(_0x31615c){return function(_0xf6aeec){return _0xf6aeec[_0x5e20('0xc')][_0x5e20('0xd')]()===_0x31615c[_0x5e20('0xd')]();};}exports[_0x5e20('0xe')]=function(_0x5b2428,_0x53d503,_0x6106d7,_0x1cea27){return function(_0x12634a){try{var _0x26c74a={'name':_0x53d503[0x0],'timeout':_0x53d503[0x1]};var _0x245751=queue['validate'](_0x26c74a,{'typecast':!![]});if(_0x245751['length']){logger['error'](_0x5e20('0xf'),_0x5b2428,_[_0x5e20('0x10')](_0x245751,_0x5e20('0x11'))['join'](',\x20'));_0x12634a[_0x5e20('0x12')]();}else{var _0x1daf55=_[_0x5e20('0x13')](_0x6106d7['agents'],handleFindAgent(_0x26c74a[_0x5e20('0xc')]));if(_0x1daf55){var _0x2824f2=(_0x26c74a[_0x5e20('0x14')]||0xa)*0x3e8;var _0x57d8cd,_0x52b37c;var _0x2f9b3b=seqqueue[_0x5e20('0x15')](_0x2824f2);_0x2f9b3b['id']=_0x5b2428;_0x2f9b3b[_0x5e20('0x16')]=_0x2824f2;_0x2f9b3b[_0x5e20('0x17')]=_0x1cea27[_0x5e20('0x17')];writeLog(_0x5b2428,_0x1daf55,util[_0x5e20('0xa')](_0x5e20('0x18'),_0x2824f2));_0x6106d7['rules'][_0x5b2428]['on'](_0x5e20('0x19'),function(){logger['info'](_0x5e20('0x1a'),_0x5b2428);clearTimeout(_0x52b37c);_0x52b37c=undefined;_0x2f9b3b[_0x5e20('0x1b')]();if(_0x6106d7['rules'][_0x5b2428]){delete _0x6106d7['rules'][_0x5b2428];}_0x12634a[_0x5e20('0x12')]();});_0x6106d7['rules'][_0x5b2428]['on'](_0x5e20('0x1c'),function(){if(_0x6106d7[_0x5e20('0x1d')][_0x5b2428]){delete _0x6106d7[_0x5e20('0x1d')][_0x5b2428];}});_0x52b37c=setTimeout(function(){logger[_0x5e20('0x1e')](_0x5e20('0x1f'),_0x5b2428);clearTimeout(_0x52b37c);_0x2f9b3b['close']();_0x12634a[_0x5e20('0x20')]();},_0x2824f2);strategy['agent'](_0x2f9b3b,_0x1daf55,_0x6106d7,_0x1cea27);}else{logger[_0x5e20('0x21')](_0x5e20('0x22'),_0x5b2428,_0x26c74a[_0x5e20('0xc')]);_0x12634a[_0x5e20('0x12')]();}}}catch(_0x38606b){console[_0x5e20('0x23')](_0x38606b);logger[_0x5e20('0x21')](_0x5e20('0x24'),_0x5b2428,_0x38606b['stack']);_0x12634a[_0x5e20('0x12')]();}};}; \ No newline at end of file +var _0xff5b=['end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','close','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','util','../../../../config/logger','string','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','validate','error','[%s][AGENT]\x20%s','map','join','stop','find','timeout','createQueue','atimeout','channel','START:%s','rules'];(function(_0x3e3faa,_0x4c84ab){var _0x4b10bb=function(_0x4a6224){while(--_0x4a6224){_0x3e3faa['push'](_0x3e3faa['shift']());}};_0x4b10bb(++_0x4c84ab);}(_0xff5b,0x1e8));var _0xbff5=function(_0x349a72,_0x306ff4){_0x349a72=_0x349a72-0x0;var _0x9fb112=_0xff5b[_0x349a72];return _0x9fb112;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0xbff5('0x0'));var seqqueue=require('seq-queue');var logger=require(_0xbff5('0x1'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':_0xbff5('0x2'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xbff5('0x3'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x867f7a,_0x206e16,_0x4735e2){return logger[_0xbff5('0x4')](util[_0xbff5('0x5')](_0xbff5('0x6'),_0x867f7a,_0x206e16[_0xbff5('0x7')],_0x4735e2));}function handleFindAgent(_0x1ab20a){return function(_0x4a30be){return _0x4a30be[_0xbff5('0x7')][_0xbff5('0x8')]()===_0x1ab20a[_0xbff5('0x8')]();};}exports['consequence']=function(_0x3b3639,_0x1843a0,_0xaad5b0,_0x8a1b4d){return function(_0x3832e2){try{var _0xc134e6={'name':_0x1843a0[0x0],'timeout':_0x1843a0[0x1]};var _0x44bc48=queue[_0xbff5('0x9')](_0xc134e6,{'typecast':!![]});if(_0x44bc48['length']){logger[_0xbff5('0xa')](_0xbff5('0xb'),_0x3b3639,_[_0xbff5('0xc')](_0x44bc48,'message')[_0xbff5('0xd')](',\x20'));_0x3832e2[_0xbff5('0xe')]();}else{var _0x40373c=_[_0xbff5('0xf')](_0xaad5b0['agents'],handleFindAgent(_0xc134e6[_0xbff5('0x7')]));if(_0x40373c){var _0x505b05=(_0xc134e6[_0xbff5('0x10')]||0xa)*0x3e8;var _0x4ca607,_0x28448b;var _0x3e49b9=seqqueue[_0xbff5('0x11')](_0x505b05);_0x3e49b9['id']=_0x3b3639;_0x3e49b9[_0xbff5('0x12')]=_0x505b05;_0x3e49b9['channel']=_0x8a1b4d[_0xbff5('0x13')];writeLog(_0x3b3639,_0x40373c,util[_0xbff5('0x5')](_0xbff5('0x14'),_0x505b05));_0xaad5b0[_0xbff5('0x15')][_0x3b3639]['on'](_0xbff5('0x16'),function(){logger[_0xbff5('0x4')](_0xbff5('0x17'),_0x3b3639);clearTimeout(_0x28448b);_0x28448b=undefined;_0x3e49b9['close']();if(_0xaad5b0[_0xbff5('0x15')][_0x3b3639]){delete _0xaad5b0[_0xbff5('0x15')][_0x3b3639];}_0x3832e2[_0xbff5('0xe')]();});_0xaad5b0[_0xbff5('0x15')][_0x3b3639]['on'](_0xbff5('0x18'),function(){if(_0xaad5b0['rules'][_0x3b3639]){delete _0xaad5b0[_0xbff5('0x15')][_0x3b3639];}});_0x28448b=setTimeout(function(){logger[_0xbff5('0x4')](_0xbff5('0x19'),_0x3b3639);clearTimeout(_0x28448b);_0x3e49b9[_0xbff5('0x1a')]();_0x3832e2['next']();},_0x505b05);strategy['agent'](_0x3e49b9,_0x40373c,_0xaad5b0,_0x8a1b4d);}else{logger[_0xbff5('0xa')](_0xbff5('0x1b'),_0x3b3639,_0xc134e6['name']);_0x3832e2['stop']();}}}catch(_0x22f9b4){console[_0xbff5('0x1c')](_0x22f9b4);logger[_0xbff5('0xa')]('[%s][QUEUE]\x20%s',_0x3b3639,_0x22f9b4[_0xbff5('0x1d')]);_0x3832e2[_0xbff5('0xe')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index bb30ff0..8c94d4a 100644 --- a/server/services/routing/server/applications/amazonlex.js +++ b/server/services/routing/server/applications/amazonlex.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2cc=['info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','error','amazonlex','providerName','stringify','create','Failed','catch','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','whatsapp','chat','ChatWebsiteId','account','upperFirst','created','isEmpty','body','getMustacheRender','Message','then'];(function(_0x1d38fc,_0x27cd20){var _0x1a260c=function(_0x3f31ab){while(--_0x3f31ab){_0x1d38fc['push'](_0x1d38fc['shift']());}};_0x1a260c(++_0x27cd20);}(_0xc2cc,0x9d));var _0xcc2c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc2cc[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var moment=require(_0xcc2c('0x0'));var AWS=require('aws-sdk');var utils=require(_0xcc2c('0x1'));var logger=require(_0xcc2c('0x2'))(_0xcc2c('0x3'));var rpc={'chatMessage':require(_0xcc2c('0x4')),'openchannelMessage':require(_0xcc2c('0x5')),'mailMessage':require(_0xcc2c('0x6')),'smsMessage':require(_0xcc2c('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xcc2c('0x8')]=function(_0x59901a,_0x39dd93){return function(_0xeade23){try{if(!_[_0xcc2c('0x9')](this[_0xcc2c('0xa')][_0xcc2c('0xb')])){logger['info'](_0xcc2c('0xc'),_0x59901a,_0xcc2c('0xd'));return _0xeade23[_0xcc2c('0xe')]();}var _0x2e9e4a={'ContactId':this[_0xcc2c('0xf')]['id'],'sentAt':moment()[_0xcc2c('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xcc2c('0x11')};if(this[_0xcc2c('0x12')]===_0xcc2c('0x13')||this[_0xcc2c('0x12')]===_0xcc2c('0x14')){_0x2e9e4a['phone']=this[_0xcc2c('0xa')]['phone'];}var _0x39eb7c=this[_0xcc2c('0x12')];if(_0x39eb7c===_0xcc2c('0x15')){_0x2e9e4a[_0xcc2c('0x16')]=this[_0xcc2c('0x17')]['id'];}else{_0x2e9e4a[_['upperFirst'](_0x39eb7c)+'AccountId']=this[_0xcc2c('0x17')]['id'];}_0x2e9e4a[_[_0xcc2c('0x18')](_0x39eb7c)+'InteractionId']=this[_0xcc2c('0xa')]['id'];if(this['interaction'][_0xcc2c('0x19')]){var _0x5a2637=_0x39dd93[0x4];if(!_[_0xcc2c('0x1a')](_0x5a2637)){_0x2e9e4a[_0xcc2c('0x1b')]=utils[_0xcc2c('0x1c')](_0x5a2637,this);return rpc[_0x39eb7c+_0xcc2c('0x1d')]['create'](_0x2e9e4a)[_0xcc2c('0x1e')](function(_0xcbde4a){logger['info']('[%s][AMAZONLEX]\x20%s',_0x59901a,_0x2e9e4a[_0xcc2c('0x1b')]);})['catch'](function(_0x2d8c5a){logger['error']('[%s][AMAZONLEX]\x20%s',_0x59901a,JSON['stringify'](_0x2d8c5a));})['finally'](function(){logger[_0xcc2c('0x1f')](_0xcc2c('0x20'),_0x59901a);_0xeade23[_0xcc2c('0x21')]();});}else{logger['info'](_0xcc2c('0x22'),_0x59901a);_0xeade23[_0xcc2c('0x21')]();}}else{var _0x11d13b=this;var _0xc5c2e4=new AWS[(_0xcc2c('0x23'))]({'accessKeyId':_0x39dd93[0x0],'secretAccessKey':_0x39dd93[0x1],'region':_0x39dd93[0x2]});var _0x91b91a={'botAlias':_0xcc2c('0x24'),'botName':_0x39dd93[0x3],'inputText':this[_0xcc2c('0x25')][_0xcc2c('0x1b')],'userId':this[_0xcc2c('0x12')]+':'+this[_0xcc2c('0xa')]['id'][_0xcc2c('0x26')]()};_0xc5c2e4[_0xcc2c('0x27')](_0x91b91a,function(_0x2dd509,_0x30a7b1){if(_0x2dd509){logger[_0xcc2c('0x28')](_0xcc2c('0xc'),_0x59901a,_0x2dd509[_0xcc2c('0x25')]);_0xeade23[_0xcc2c('0xe')]();}else if(_0x30a7b1&&_0x30a7b1[_0xcc2c('0x25')]){_0x11d13b['body'][_0xcc2c('0x29')]=_0x30a7b1;_0x2e9e4a[_0xcc2c('0x1b')]=_0x30a7b1[_0xcc2c('0x25')];_0x2e9e4a[_0xcc2c('0x2a')]=_0xcc2c('0x29');_0x2e9e4a['providerResponse']=JSON[_0xcc2c('0x2b')](_0x30a7b1);return rpc[_0x39eb7c+_0xcc2c('0x1d')][_0xcc2c('0x2c')](_0x2e9e4a)[_0xcc2c('0x1e')](function(_0x7542b4){logger[_0xcc2c('0x1f')](_0xcc2c('0xc'),_0x59901a,_0x2e9e4a[_0xcc2c('0x1b')]);if(_0x30a7b1['dialogState']==_0xcc2c('0x2d')){_0xeade23[_0xcc2c('0xe')]();}else{_0xeade23['stop']();}})[_0xcc2c('0x2e')](function(_0x26af80){logger[_0xcc2c('0x28')](_0xcc2c('0xc'),_0x59901a,JSON[_0xcc2c('0x2b')](_0x26af80));_0xeade23[_0xcc2c('0xe')]();});}else{_0xeade23[_0xcc2c('0xe')]();}});}}catch(_0x5a2359){logger[_0xcc2c('0x28')]('[%s][AMAZONLEX]\x20%s',_0x59901a,JSON['stringify'](_0x5a2359));_0xeade23[_0xcc2c('0x21')]();}};}; \ No newline at end of file +var _0x3d5f=['ChatWebsiteId','account','AccountId','InteractionId','isEmpty','Message','then','info','[%s][AMAZONLEX]\x20%s','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','message','toString','postText','body','amazonlex','providerResponse','dialogState','Failed','stringify','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','sms','channel','chat'];(function(_0x407fcd,_0x34326e){var _0x3cc78a=function(_0x3115f7){while(--_0x3115f7){_0x407fcd['push'](_0x407fcd['shift']());}};_0x3cc78a(++_0x34326e);}(_0x3d5f,0x14c));var _0xf3d5=function(_0x5dc5c6,_0x38366b){_0x5dc5c6=_0x5dc5c6-0x0;var _0x11f053=_0x3d5f[_0x5dc5c6];return _0x11f053;};'use strict';var _=require(_0xf3d5('0x0'));var moment=require('moment');var AWS=require(_0xf3d5('0x1'));var utils=require(_0xf3d5('0x2'));var logger=require(_0xf3d5('0x3'))(_0xf3d5('0x4'));var rpc={'chatMessage':require(_0xf3d5('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xf3d5('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xf3d5('0x7')),'whatsappMessage':require(_0xf3d5('0x8'))};exports[_0xf3d5('0x9')]=function(_0x11aeaf,_0x26f160){return function(_0x194a38){try{if(!_['isNil'](this[_0xf3d5('0xa')][_0xf3d5('0xb')])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x11aeaf,_0xf3d5('0xc'));return _0x194a38[_0xf3d5('0xd')]();}var _0x354428={'ContactId':this[_0xf3d5('0xe')]['id'],'sentAt':moment()[_0xf3d5('0xf')](_0xf3d5('0x10')),'direction':'out'};if(this['channel']===_0xf3d5('0x11')||this[_0xf3d5('0x12')]==='whatsapp'){_0x354428['phone']=this['interaction']['phone'];}var _0x42c91f=this[_0xf3d5('0x12')];if(_0x42c91f===_0xf3d5('0x13')){_0x354428[_0xf3d5('0x14')]=this[_0xf3d5('0x15')]['id'];}else{_0x354428[_['upperFirst'](_0x42c91f)+_0xf3d5('0x16')]=this[_0xf3d5('0x15')]['id'];}_0x354428[_['upperFirst'](_0x42c91f)+_0xf3d5('0x17')]=this['interaction']['id'];if(this[_0xf3d5('0xa')]['created']){var _0x32fd7a=_0x26f160[0x4];if(!_[_0xf3d5('0x18')](_0x32fd7a)){_0x354428['body']=utils['getMustacheRender'](_0x32fd7a,this);return rpc[_0x42c91f+_0xf3d5('0x19')]['create'](_0x354428)[_0xf3d5('0x1a')](function(_0x445202){logger[_0xf3d5('0x1b')](_0xf3d5('0x1c'),_0x11aeaf,_0x354428['body']);})[_0xf3d5('0x1d')](function(_0x3f2e03){logger[_0xf3d5('0x1e')](_0xf3d5('0x1c'),_0x11aeaf,JSON['stringify'](_0x3f2e03));})[_0xf3d5('0x1f')](function(){logger['info'](_0xf3d5('0x20'),_0x11aeaf);_0x194a38[_0xf3d5('0x21')]();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x11aeaf);_0x194a38[_0xf3d5('0x21')]();}}else{var _0x525171=this;var _0xdd27f2=new AWS[(_0xf3d5('0x22'))]({'accessKeyId':_0x26f160[0x0],'secretAccessKey':_0x26f160[0x1],'region':_0x26f160[0x2]});var _0x13071c={'botAlias':'$LATEST','botName':_0x26f160[0x3],'inputText':this[_0xf3d5('0x23')]['body'],'userId':this[_0xf3d5('0x12')]+':'+this[_0xf3d5('0xa')]['id'][_0xf3d5('0x24')]()};_0xdd27f2[_0xf3d5('0x25')](_0x13071c,function(_0x1e83cc,_0x2e3733){if(_0x1e83cc){logger[_0xf3d5('0x1e')](_0xf3d5('0x1c'),_0x11aeaf,_0x1e83cc[_0xf3d5('0x23')]);_0x194a38['next']();}else if(_0x2e3733&&_0x2e3733[_0xf3d5('0x23')]){_0x525171[_0xf3d5('0x26')][_0xf3d5('0x27')]=_0x2e3733;_0x354428['body']=_0x2e3733[_0xf3d5('0x23')];_0x354428['providerName']=_0xf3d5('0x27');_0x354428[_0xf3d5('0x28')]=JSON['stringify'](_0x2e3733);return rpc[_0x42c91f+_0xf3d5('0x19')]['create'](_0x354428)[_0xf3d5('0x1a')](function(_0x1811c7){logger[_0xf3d5('0x1b')](_0xf3d5('0x1c'),_0x11aeaf,_0x354428[_0xf3d5('0x26')]);if(_0x2e3733[_0xf3d5('0x29')]==_0xf3d5('0x2a')){_0x194a38[_0xf3d5('0xd')]();}else{_0x194a38[_0xf3d5('0x21')]();}})[_0xf3d5('0x1d')](function(_0x4d4843){logger[_0xf3d5('0x1e')](_0xf3d5('0x1c'),_0x11aeaf,JSON['stringify'](_0x4d4843));_0x194a38[_0xf3d5('0xd')]();});}else{_0x194a38[_0xf3d5('0xd')]();}});}}catch(_0x3b9367){logger[_0xf3d5('0x1e')](_0xf3d5('0x1c'),_0x11aeaf,JSON[_0xf3d5('0x2b')](_0x3b9367));_0x194a38[_0xf3d5('0x21')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 960a091..7591e78 100644 --- a/server/services/routing/server/applications/autoreply.js +++ b/server/services/routing/server/applications/autoreply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa83=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/smsInteraction','../../mailRpc','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','inReplyTo','messageId','html','','','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','resolve','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','update','lodash','moment','./utils'];(function(_0x1ba6b1,_0x43dc2e){var _0x3e7af9=function(_0xa876ab){while(--_0xa876ab){_0x1ba6b1['push'](_0x1ba6b1['shift']());}};_0x3e7af9(++_0x43dc2e);}(_0xfa83,0x147));var _0x3fa8=function(_0x4de835,_0x400376){_0x4de835=_0x4de835-0x0;var _0xfebeb8=_0xfa83[_0x4de835];return _0xfebeb8;};'use strict';var _=require(_0x3fa8('0x0'));var moment=require(_0x3fa8('0x1'));var utils=require(_0x3fa8('0x2'));var logger=require('../../../../config/logger')(_0x3fa8('0x3'));var rpc={'chatMessage':require(_0x3fa8('0x4')),'openchannelMessage':require(_0x3fa8('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x3fa8('0x6')),'faxMessage':require(_0x3fa8('0x7')),'whatsappMessage':require(_0x3fa8('0x8')),'chatInteraction':require(_0x3fa8('0x9')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x3fa8('0xa')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x3fa8('0xb'));exports['consequence']=function(_0x18c4bb,_0x2714f8,_0x43abfe,_0x263dd1){return function(_0x5dc9ba){try{var _0x50f81d=this[_0x3fa8('0xc')];if(_0x50f81d===_0x3fa8('0xd')&&_0x263dd1[_0x3fa8('0xe')][_0x3fa8('0xf')]){logger[_0x3fa8('0x10')](_0x3fa8('0x11'),_0x18c4bb,_0x3fa8('0x12'));return _0x5dc9ba[_0x3fa8('0x13')]();}if(_0x2714f8[0x0]==='1'&&(_[_0x3fa8('0x14')](this[_0x3fa8('0x15')][_0x3fa8('0x16')])||!this[_0x3fa8('0x15')]['created'])){logger[_0x3fa8('0x10')]('[%s][AUTOREPLY]\x20%s',_0x18c4bb,'Autoreply\x20already\x20sent');return _0x5dc9ba[_0x3fa8('0x13')]();}if(_0x2714f8[0x0]==='2'&&this[_0x3fa8('0x15')][_0x3fa8('0x17')]){logger[_0x3fa8('0x10')](_0x3fa8('0x18'),_0x18c4bb,_0x3fa8('0x19'));return _0x5dc9ba[_0x3fa8('0x13')]();}var _0x2965c4={'ContactId':this['contact']['id'],'sentAt':moment()[_0x3fa8('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x3fa8('0x1b')};if(this[_0x3fa8('0xc')]==='mail'){_0x2965c4[_0x3fa8('0xe')]=utils[_0x3fa8('0x1c')](_0x2714f8[0x2],this);}else{_0x2965c4[_0x3fa8('0xe')]=utils[_0x3fa8('0x1c')](_0x2714f8[0x1],this);}if(this[_0x3fa8('0x1d')]){_0x2965c4['to']=this[_0x3fa8('0x1d')][_0x3fa8('0x1e')]||'';if(this[_0x3fa8('0xc')]===_0x3fa8('0xd')&&_0x2714f8[0x1]==='1'){_0x2965c4['cc']=this[_0x3fa8('0x1d')]['cc']||'';}_0x2965c4[_0x3fa8('0x1e')]=this['message']['to']||'';_0x2965c4['phone']=this['message'][_0x3fa8('0x1f')]||'';_0x2965c4[_0x3fa8('0x20')]=!![];if(this[_0x3fa8('0x1d')][_0x3fa8('0x21')]){_0x2965c4[_0x3fa8('0x21')]='';_0x2965c4[_0x3fa8('0x21')]+=_[_0x3fa8('0x22')](this[_0x3fa8('0x1d')][_0x3fa8('0x21')],_0x3fa8('0x23'))?'':_0x3fa8('0x24');_0x2965c4[_0x3fa8('0x21')]+=this[_0x3fa8('0x1d')][_0x3fa8('0x21')];}}if(this[_0x3fa8('0xc')]===_0x3fa8('0x25')){_0x2965c4[_0x3fa8('0x26')]=this[_0x3fa8('0x27')]['id'];}else{_0x2965c4[_[_0x3fa8('0x28')](this[_0x3fa8('0xc')])+_0x3fa8('0x29')]=this['account']['id'];}_0x2965c4[_[_0x3fa8('0x28')](this[_0x3fa8('0xc')])+'InteractionId']=this['interaction']['id'];var _0x4406cb=this['interaction'];if(rpc[this['channel']+'Message']){if(this[_0x3fa8('0xc')]===_0x3fa8('0xd')){_0x2965c4[_0x3fa8('0x2a')]=this['message'][_0x3fa8('0x2b')];_0x2965c4[_0x3fa8('0x2c')]=_0x3fa8('0x2d')+_['replace'](_0x2965c4[_0x3fa8('0xe')],_0x3fa8('0x2e'),'','replace','','All','auto_reply','sendMailMessage','smtpOptions','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','update','stop','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','created','info','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','body','getMustacheRender','message','from','phone','subject','startsWith','Re:','chat'];(function(_0x2e6c75,_0x1bdbb7){var _0x13a9ea=function(_0x6ad297){while(--_0x6ad297){_0x2e6c75['push'](_0x2e6c75['shift']());}};_0x13a9ea(++_0x1bdbb7);}(_0xb841,0xe4));var _0x1b84=function(_0x131e95,_0x46c5c9){_0x131e95=_0x131e95-0x0;var _0x2b1cf=_0xb841[_0x131e95];return _0x2b1cf;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0x1b84('0x0'));var logger=require(_0x1b84('0x1'))('routing');var rpc={'chatMessage':require(_0x1b84('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1b84('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x1b84('0x4')),'whatsappMessage':require(_0x1b84('0x5')),'chatInteraction':require(_0x1b84('0x6')),'openchannelInteraction':require(_0x1b84('0x7')),'mailInteraction':require(_0x1b84('0x8')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x1b84('0x9'))};var mailRpc=require(_0x1b84('0xa'));exports[_0x1b84('0xb')]=function(_0xdcf386,_0x4beca9,_0x4ee04e,_0x34e24b){return function(_0x45a5b6){try{var _0x2306cd=this[_0x1b84('0xc')];if(_0x2306cd===_0x1b84('0xd')&&_0x34e24b['body'][_0x1b84('0xe')]){logger['info'](_0x1b84('0xf'),_0xdcf386,_0x1b84('0x10'));return _0x45a5b6[_0x1b84('0x11')]();}if(_0x4beca9[0x0]==='1'&&(_['isNil'](this[_0x1b84('0x12')][_0x1b84('0x13')])||!this['interaction']['created'])){logger[_0x1b84('0x14')]('[%s][AUTOREPLY]\x20%s',_0xdcf386,_0x1b84('0x15'));return _0x45a5b6[_0x1b84('0x11')]();}if(_0x4beca9[0x0]==='2'&&this[_0x1b84('0x12')]['autoreplyExecuted']){logger[_0x1b84('0x14')](_0x1b84('0x16'),_0xdcf386,_0x1b84('0x17'));return _0x45a5b6[_0x1b84('0x11')]();}var _0x174351={'ContactId':this[_0x1b84('0x18')]['id'],'sentAt':moment()[_0x1b84('0x19')](_0x1b84('0x1a')),'direction':'out'};if(this[_0x1b84('0xc')]===_0x1b84('0xd')){_0x174351[_0x1b84('0x1b')]=utils[_0x1b84('0x1c')](_0x4beca9[0x2],this);}else{_0x174351[_0x1b84('0x1b')]=utils[_0x1b84('0x1c')](_0x4beca9[0x1],this);}if(this[_0x1b84('0x1d')]){_0x174351['to']=this[_0x1b84('0x1d')][_0x1b84('0x1e')]||'';if(this[_0x1b84('0xc')]===_0x1b84('0xd')&&_0x4beca9[0x1]==='1'){_0x174351['cc']=this['message']['cc']||'';}_0x174351[_0x1b84('0x1e')]=this[_0x1b84('0x1d')]['to']||'';_0x174351[_0x1b84('0x1f')]=this[_0x1b84('0x1d')][_0x1b84('0x1f')]||'';_0x174351['read']=!![];if(this[_0x1b84('0x1d')][_0x1b84('0x20')]){_0x174351['subject']='';_0x174351[_0x1b84('0x20')]+=_[_0x1b84('0x21')](this[_0x1b84('0x1d')][_0x1b84('0x20')],_0x1b84('0x22'))?'':'Re:\x20';_0x174351[_0x1b84('0x20')]+=this[_0x1b84('0x1d')][_0x1b84('0x20')];}}if(this[_0x1b84('0xc')]===_0x1b84('0x23')){_0x174351[_0x1b84('0x24')]=this[_0x1b84('0x25')]['id'];}else{_0x174351[_[_0x1b84('0x26')](this[_0x1b84('0xc')])+'AccountId']=this[_0x1b84('0x25')]['id'];}_0x174351[_[_0x1b84('0x26')](this['channel'])+_0x1b84('0x27')]=this[_0x1b84('0x12')]['id'];var _0x3a92a4=this['interaction'];if(rpc[this[_0x1b84('0xc')]+_0x1b84('0x28')]){if(this[_0x1b84('0xc')]===_0x1b84('0xd')){_0x174351[_0x1b84('0x29')]=this[_0x1b84('0x1d')][_0x1b84('0x2a')];_0x174351[_0x1b84('0x2b')]=_0x1b84('0x2c')+_[_0x1b84('0x2d')](_0x174351[_0x1b84('0x1b')],_0x1b84('0x2e'),_0x1b84('0x2f'))+_0x1b84('0x30');_0x174351['headers']={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x1b84('0x31'),'Precedence':_0x1b84('0x32')};return mailRpc[_0x1b84('0x33')](this['account'][_0x1b84('0x34')],_0x174351)[_0x1b84('0x35')](function(_0x42efd4){logger['info']('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0xdcf386);_0x174351['messageId']=_0x42efd4[_0x1b84('0x1d')]['messageId'];return rpc[_0x2306cd+_0x1b84('0x28')]['create'](_0x174351);})[_0x1b84('0x35')](function(_0x342265){logger[_0x1b84('0x14')](_0x1b84('0xf'),_0xdcf386,JSON[_0x1b84('0x36')](_0x342265));})[_0x1b84('0x37')](function(_0x22c05a){logger[_0x1b84('0x38')](_0x1b84('0x39'),_0xdcf386,JSON[_0x1b84('0x36')](_0x22c05a));})[_0x1b84('0x3a')](function(){Promise[_0x1b84('0x3b')]()['then'](function(){if(_0x4beca9[0x0]!=='2'||_0x3a92a4[_0x1b84('0x3c')])return;return rpc[_0x2306cd+_0x1b84('0x3d')]['update'](_0x3a92a4['id'],{'autoreplyExecuted':!![]})['then'](function(_0x3eb6ff){logger[_0x1b84('0x14')](_0x1b84('0x16'),_0xdcf386,JSON['stringify'](_0x3eb6ff));})['catch'](function(_0x21013e){logger['error'](_0x1b84('0x3e'),_0xdcf386,JSON[_0x1b84('0x36')](_0x21013e));});})[_0x1b84('0x35')](function(){_0x45a5b6[_0x1b84('0x11')]();});});}else{return rpc[this['channel']+'Message'][_0x1b84('0x3f')](_0x174351)['then'](function(){logger[_0x1b84('0x14')](_0x1b84('0xf'),_0xdcf386,_0x174351[_0x1b84('0x1b')]);})['catch'](function(_0xd3a754){logger[_0x1b84('0x38')]('[%s][AUTOREPLY]\x20%s',_0xdcf386,JSON[_0x1b84('0x36')](_0xd3a754));})[_0x1b84('0x3a')](function(){Promise['resolve']()[_0x1b84('0x35')](function(){if(_0x4beca9[0x0]!=='2'||_0x3a92a4[_0x1b84('0x3c')])return;return rpc[_0x2306cd+'Interaction'][_0x1b84('0x40')](_0x3a92a4['id'],{'autoreplyExecuted':!![]})[_0x1b84('0x35')](function(_0x7d5e82){logger['info'](_0x1b84('0x16'),_0xdcf386,JSON['stringify'](_0x7d5e82));})[_0x1b84('0x37')](function(_0x23bf81){logger[_0x1b84('0x38')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0xdcf386,JSON[_0x1b84('0x36')](_0x23bf81));});})[_0x1b84('0x35')](function(){_0x45a5b6['next']();});});}}}catch(_0x55944d){logger['error'](_0x1b84('0xf'),_0xdcf386,JSON[_0x1b84('0x36')](_0x55944d));_0x45a5b6[_0x1b84('0x41')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 835ee29..f6bc16f 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa532=['Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','stop','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','format','YYYY-MM-DD\x20HH:mm:ss','system','channel'];(function(_0x850181,_0x5263cb){var _0x5a6457=function(_0x2ec1bb){while(--_0x2ec1bb){_0x850181['push'](_0x850181['shift']());}};_0x5a6457(++_0x5263cb);}(_0xa532,0xb0));var _0x2a53=function(_0x55822d,_0x58b6ea){_0x55822d=_0x55822d-0x0;var _0x39eb7d=_0xa532[_0x55822d];return _0x39eb7d;};'use strict';var moment=require(_0x2a53('0x0'));var logger=require('../../../../config/logger')(_0x2a53('0x1'));var rpc={'chatInteraction':require(_0x2a53('0x2')),'openchannelInteraction':require(_0x2a53('0x3')),'smsInteraction':require(_0x2a53('0x4')),'mailInteraction':require(_0x2a53('0x5')),'faxInteraction':require(_0x2a53('0x6')),'whatsappInteraction':require(_0x2a53('0x7'))};exports['consequence']=function(_0x261eef,_0x4c1d98,_0x265f95,_0x245673){return function(_0x29b351){try{logger[_0x2a53('0x8')]('[%s][CLOSE]\x20reason\x20%s',_0x261eef,_0x4c1d98[0x0]);var _0xdd5986={'closed':0x1,'closedAt':moment()[_0x2a53('0x9')](_0x2a53('0xa')),'closeReason':_0x2a53('0xb'),'disposition':_0x4c1d98[0x0]};if(rpc[_0x245673[_0x2a53('0xc')]+_0x2a53('0xd')]){rpc[_0x245673[_0x2a53('0xc')]+'Interaction'][_0x2a53('0xe')](_0x245673[_0x2a53('0xf')]['id'],_0xdd5986)['then'](function(_0x4e8e46){logger[_0x2a53('0x8')](_0x2a53('0x10'),_0x261eef,_0x245673[_0x2a53('0xf')]['id']);})['catch'](function(_0x4c12df){logger[_0x2a53('0x11')](_0x2a53('0x12'),_0x261eef,JSON[_0x2a53('0x13')](_0x4c12df));})['finally'](function(){_0x29b351[_0x2a53('0x14')]();});}}catch(_0xc9166d){logger[_0x2a53('0x11')]('[%s][CLOSE]\x20%s',_0x261eef,JSON[_0x2a53('0x13')](_0xc9166d));_0x29b351[_0x2a53('0x14')]();}};}; \ No newline at end of file +var _0x4fb6=['update','interaction','then','info','error','[%s][CLOSE]\x20%s','finally','stop','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction'];(function(_0x5eee46,_0x1bc4e0){var _0x93390c=function(_0x3492b7){while(--_0x3492b7){_0x5eee46['push'](_0x5eee46['shift']());}};_0x93390c(++_0x1bc4e0);}(_0x4fb6,0xe4));var _0x64fb=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x4fb6[_0x1a9204];return _0x17ca68;};'use strict';var moment=require('moment');var logger=require(_0x64fb('0x0'))(_0x64fb('0x1'));var rpc={'chatInteraction':require(_0x64fb('0x2')),'openchannelInteraction':require(_0x64fb('0x3')),'smsInteraction':require(_0x64fb('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x64fb('0x5')),'whatsappInteraction':require(_0x64fb('0x6'))};exports[_0x64fb('0x7')]=function(_0x120885,_0x312bd0,_0x2c9ee6,_0xf401c4){return function(_0x4387be){try{logger['info'](_0x64fb('0x8'),_0x120885,_0x312bd0[0x0]);var _0x40cba1={'closed':0x1,'closedAt':moment()['format'](_0x64fb('0x9')),'closeReason':'system','disposition':_0x312bd0[0x0]};if(rpc[_0xf401c4[_0x64fb('0xa')]+_0x64fb('0xb')]){rpc[_0xf401c4[_0x64fb('0xa')]+_0x64fb('0xb')][_0x64fb('0xc')](_0xf401c4[_0x64fb('0xd')]['id'],_0x40cba1)[_0x64fb('0xe')](function(_0x5d06b3){logger[_0x64fb('0xf')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x120885,_0xf401c4['interaction']['id']);})['catch'](function(_0x835a2c){logger[_0x64fb('0x10')](_0x64fb('0x11'),_0x120885,JSON['stringify'](_0x835a2c));})[_0x64fb('0x12')](function(){_0x4387be['stop']();});}}catch(_0x2b61e9){logger[_0x64fb('0x10')](_0x64fb('0x11'),_0x120885,JSON['stringify'](_0x2b61e9));_0x4387be[_0x64fb('0x13')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 49adab0..8a8ee7b 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a9f=['fulfillment','speech','providerName','providerResponse','stringify','result','metadata','endConversation','next','catch','moment','apiai-promise','../../../../config/logger','../../rpc/chatMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','body','getMustacheRender','Message','create','then','error','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'];(function(_0x184bf4,_0x40833f){var _0x2eb209=function(_0xdb65e1){while(--_0xdb65e1){_0x184bf4['push'](_0x184bf4['shift']());}};_0x2eb209(++_0x40833f);}(_0x0a9f,0x64));var _0xf0a9=function(_0x2aaeac,_0x30bda5){_0x2aaeac=_0x2aaeac-0x0;var _0x757741=_0x0a9f[_0x2aaeac];return _0x757741;};'use strict';var _=require('lodash');var moment=require(_0xf0a9('0x0'));var apiai=require(_0xf0a9('0x1'));var md5=require('md5');var utils=require('./utils');var logger=require(_0xf0a9('0x2'))('routing');var rpc={'chatMessage':require(_0xf0a9('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xf0a9('0x4'))};exports[_0xf0a9('0x5')]=function(_0x4e9fa6,_0x63889e){return function(_0x4d14e0){try{if(!_[_0xf0a9('0x6')](this[_0xf0a9('0x7')]['UserId'])){logger[_0xf0a9('0x8')](_0xf0a9('0x9'),_0x4e9fa6,_0xf0a9('0xa'));return _0x4d14e0['next']();}var _0x46b44b={'ContactId':this['contact']['id'],'sentAt':moment()[_0xf0a9('0xb')](_0xf0a9('0xc')),'direction':_0xf0a9('0xd')};if(this[_0xf0a9('0xe')]==='sms'||this[_0xf0a9('0xe')]===_0xf0a9('0xf')){_0x46b44b[_0xf0a9('0x10')]=this[_0xf0a9('0x7')]['phone'];}var _0x53f7bf=this[_0xf0a9('0xe')];if(_0x53f7bf===_0xf0a9('0x11')){_0x46b44b[_0xf0a9('0x12')]=this[_0xf0a9('0x13')]['id'];}else{_0x46b44b[_[_0xf0a9('0x14')](_0x53f7bf)+_0xf0a9('0x15')]=this[_0xf0a9('0x13')]['id'];}_0x46b44b[_['upperFirst'](_0x53f7bf)+_0xf0a9('0x16')]=this[_0xf0a9('0x7')]['id'];if(this[_0xf0a9('0x7')]['created']){var _0x1d98a6=_0x63889e[0x2];if(!_['isEmpty'](_0x1d98a6)){_0x46b44b[_0xf0a9('0x17')]=utils[_0xf0a9('0x18')](_0x1d98a6,this);return rpc[_0x53f7bf+_0xf0a9('0x19')][_0xf0a9('0x1a')](_0x46b44b)[_0xf0a9('0x1b')](function(_0x37ddab){logger[_0xf0a9('0x8')](_0xf0a9('0x9'),_0x4e9fa6,_0x46b44b[_0xf0a9('0x17')]);})['catch'](function(_0x3e122e){logger[_0xf0a9('0x1c')](_0xf0a9('0x9'),_0x4e9fa6,JSON['stringify'](_0x3e122e));})[_0xf0a9('0x1d')](function(){logger['info'](_0xf0a9('0x1e'),_0x4e9fa6);_0x4d14e0[_0xf0a9('0x1f')]();});}else{logger['info'](_0xf0a9('0x20'),_0x4e9fa6);_0x4d14e0[_0xf0a9('0x1f')]();}}else{var _0xad2291=this;var _0x52b3cf=apiai(_0x63889e[0x0],{'language':_0x63889e[0x1]||'en'});return _0x52b3cf[_0xf0a9('0x21')](this[_0xf0a9('0x22')][_0xf0a9('0x17')],{'sessionId':md5(this[_0xf0a9('0x7')]['id'])})[_0xf0a9('0x1b')](function(_0x41c958){_0xad2291[_0xf0a9('0x17')]['dialogflow']=_0x41c958;_0x46b44b['body']=_0x41c958['result'][_0xf0a9('0x23')][_0xf0a9('0x24')];_0x46b44b[_0xf0a9('0x25')]='dialogflow';_0x46b44b[_0xf0a9('0x26')]=JSON[_0xf0a9('0x27')](_0x41c958);return rpc[_0x53f7bf+_0xf0a9('0x19')][_0xf0a9('0x1a')](_0x46b44b)[_0xf0a9('0x1b')](function(_0x215fcd){logger['info'](_0xf0a9('0x9'),_0x4e9fa6,_0x46b44b[_0xf0a9('0x17')]);if(_0x41c958[_0xf0a9('0x28')][_0xf0a9('0x29')][_0xf0a9('0x2a')]){_0x4d14e0['next']();}else{_0x4d14e0[_0xf0a9('0x1f')]();}})['catch'](function(_0x492927){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x4e9fa6,JSON[_0xf0a9('0x27')](_0x492927));_0x4d14e0[_0xf0a9('0x2b')]();});})[_0xf0a9('0x2c')](function(_0x5d2a12){logger[_0xf0a9('0x1c')]('[%s][DIALOGFLOW]\x20%s',_0x4e9fa6,_0x5d2a12[_0xf0a9('0x22')]);_0x4d14e0[_0xf0a9('0x2b')]();});}}catch(_0x4b3c25){logger[_0xf0a9('0x1c')](_0xf0a9('0x9'),_0x4e9fa6,JSON[_0xf0a9('0x27')](_0x4b3c25));_0x4d14e0[_0xf0a9('0x1f')]();}};}; \ No newline at end of file +var _0x9d5c=['error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','dialogflow','result','fulfillment','speech','providerResponse','Message','metadata','endConversation','next','catch','lodash','apiai-promise','md5','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','create','then','body'];(function(_0x5cdf2c,_0x43f629){var _0x13924a=function(_0x2494f5){while(--_0x2494f5){_0x5cdf2c['push'](_0x5cdf2c['shift']());}};_0x13924a(++_0x43f629);}(_0x9d5c,0x98));var _0xc9d5=function(_0x33caef,_0x1b94c7){_0x33caef=_0x33caef-0x0;var _0x4ba079=_0x9d5c[_0x33caef];return _0x4ba079;};'use strict';var _=require(_0xc9d5('0x0'));var moment=require('moment');var apiai=require(_0xc9d5('0x1'));var md5=require(_0xc9d5('0x2'));var utils=require('./utils');var logger=require(_0xc9d5('0x3'))(_0xc9d5('0x4'));var rpc={'chatMessage':require(_0xc9d5('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xc9d5('0x6')),'smsMessage':require(_0xc9d5('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xc9d5('0x8'))};exports[_0xc9d5('0x9')]=function(_0x1a91f5,_0x955d2d){return function(_0x2edfbc){try{if(!_[_0xc9d5('0xa')](this[_0xc9d5('0xb')][_0xc9d5('0xc')])){logger[_0xc9d5('0xd')](_0xc9d5('0xe'),_0x1a91f5,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2edfbc['next']();}var _0x53816b={'ContactId':this['contact']['id'],'sentAt':moment()[_0xc9d5('0xf')](_0xc9d5('0x10')),'direction':_0xc9d5('0x11')};if(this[_0xc9d5('0x12')]===_0xc9d5('0x13')||this[_0xc9d5('0x12')]===_0xc9d5('0x14')){_0x53816b['phone']=this['interaction']['phone'];}var _0x2c40c2=this[_0xc9d5('0x12')];if(_0x2c40c2===_0xc9d5('0x15')){_0x53816b[_0xc9d5('0x16')]=this['account']['id'];}else{_0x53816b[_[_0xc9d5('0x17')](_0x2c40c2)+_0xc9d5('0x18')]=this['account']['id'];}_0x53816b[_[_0xc9d5('0x17')](_0x2c40c2)+_0xc9d5('0x19')]=this['interaction']['id'];if(this['interaction'][_0xc9d5('0x1a')]){var _0x7d5471=_0x955d2d[0x2];if(!_[_0xc9d5('0x1b')](_0x7d5471)){_0x53816b['body']=utils[_0xc9d5('0x1c')](_0x7d5471,this);return rpc[_0x2c40c2+'Message'][_0xc9d5('0x1d')](_0x53816b)[_0xc9d5('0x1e')](function(_0x3105d2){logger[_0xc9d5('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x1a91f5,_0x53816b[_0xc9d5('0x1f')]);})['catch'](function(_0x4431d2){logger[_0xc9d5('0x20')](_0xc9d5('0xe'),_0x1a91f5,JSON[_0xc9d5('0x21')](_0x4431d2));})['finally'](function(){logger[_0xc9d5('0xd')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1a91f5);_0x2edfbc['stop']();});}else{logger[_0xc9d5('0xd')](_0xc9d5('0x22'),_0x1a91f5);_0x2edfbc[_0xc9d5('0x23')]();}}else{var _0x7ce117=this;var _0x1447c9=apiai(_0x955d2d[0x0],{'language':_0x955d2d[0x1]||'en'});return _0x1447c9['textRequest'](this['message'][_0xc9d5('0x1f')],{'sessionId':md5(this[_0xc9d5('0xb')]['id'])})[_0xc9d5('0x1e')](function(_0x1424c9){_0x7ce117[_0xc9d5('0x1f')][_0xc9d5('0x24')]=_0x1424c9;_0x53816b[_0xc9d5('0x1f')]=_0x1424c9[_0xc9d5('0x25')][_0xc9d5('0x26')][_0xc9d5('0x27')];_0x53816b['providerName']=_0xc9d5('0x24');_0x53816b[_0xc9d5('0x28')]=JSON[_0xc9d5('0x21')](_0x1424c9);return rpc[_0x2c40c2+_0xc9d5('0x29')][_0xc9d5('0x1d')](_0x53816b)[_0xc9d5('0x1e')](function(_0x41a5d7){logger['info'](_0xc9d5('0xe'),_0x1a91f5,_0x53816b[_0xc9d5('0x1f')]);if(_0x1424c9['result'][_0xc9d5('0x2a')][_0xc9d5('0x2b')]){_0x2edfbc[_0xc9d5('0x2c')]();}else{_0x2edfbc[_0xc9d5('0x23')]();}})[_0xc9d5('0x2d')](function(_0x3ab4bc){logger[_0xc9d5('0x20')](_0xc9d5('0xe'),_0x1a91f5,JSON[_0xc9d5('0x21')](_0x3ab4bc));_0x2edfbc['next']();});})[_0xc9d5('0x2d')](function(_0x41d217){logger[_0xc9d5('0x20')]('[%s][DIALOGFLOW]\x20%s',_0x1a91f5,_0x41d217['message']);_0x2edfbc['next']();});}}catch(_0x58991f){logger[_0xc9d5('0x20')](_0xc9d5('0xe'),_0x1a91f5,JSON[_0xc9d5('0x21')](_0x58991f));_0x2edfbc[_0xc9d5('0x23')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 980d732..af578ec 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd385=['YYYY-MM-DD\x20HH:mm:ss','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','getMustacheRender','catch','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','sessionPath','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','intent','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','stringify','push','fulfillmentText','all','next','stack','lodash','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','create','then','error','isNil','interaction','UserId','info','[%s][DIALOGFLOWV2]\x20%s','contact','format'];(function(_0x498ccc,_0x1b7dd4){var _0xbaf470=function(_0x358227){while(--_0x358227){_0x498ccc['push'](_0x498ccc['shift']());}};_0xbaf470(++_0x1b7dd4);}(_0xd385,0x104));var _0x5d38=function(_0x50a7d6,_0x109734){_0x50a7d6=_0x50a7d6-0x0;var _0x37feb7=_0xd385[_0x50a7d6];return _0x37feb7;};'use strict';var _=require(_0x5d38('0x0'));var dialogflow=require('dialogflow');var md5=require('md5');var moment=require(_0x5d38('0x1'));var Promise=require(_0x5d38('0x2'));var logger=require(_0x5d38('0x3'))(_0x5d38('0x4'));var utils=require(_0x5d38('0x5'));var rpc={'chatMessage':require(_0x5d38('0x6')),'openchannelMessage':require(_0x5d38('0x7')),'mailMessage':require(_0x5d38('0x8')),'smsMessage':require(_0x5d38('0x9')),'faxMessage':require(_0x5d38('0xa')),'whatsappMessage':require(_0x5d38('0xb'))};function createMessage(_0x3c8907,_0x585fc3,_0x429eb6,_0x2b9b57){return new Promise(function(_0x5e4029,_0xff20f5){var _0x1e0fd8=_['clone'](_0x429eb6);_0x1e0fd8[_0x5d38('0xc')]=_0x2b9b57;return rpc[_0x585fc3+_0x5d38('0xd')][_0x5d38('0xe')](_0x1e0fd8)[_0x5d38('0xf')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x3c8907,_0x1e0fd8[_0x5d38('0xc')]);_0x5e4029();})['catch'](function(_0x145d9b){logger[_0x5d38('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x3c8907,JSON['stringify'](_0x145d9b));_0xff20f5(_0x145d9b);});});}exports['consequence']=function(_0x5b0c9d,_0x5e717e){return function(_0x46b163){try{if(!_[_0x5d38('0x11')](this[_0x5d38('0x12')][_0x5d38('0x13')])){logger[_0x5d38('0x14')](_0x5d38('0x15'),_0x5b0c9d,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x46b163['next']();}var _0x10ba96={'ContactId':this[_0x5d38('0x16')]['id'],'sentAt':moment()[_0x5d38('0x17')](_0x5d38('0x18')),'direction':'out'};if(this[_0x5d38('0x19')]===_0x5d38('0x1a')||this[_0x5d38('0x19')]==='whatsapp'){_0x10ba96[_0x5d38('0x1b')]=this[_0x5d38('0x12')]['phone'];}var _0x528cf2=this[_0x5d38('0x19')];if(_0x528cf2===_0x5d38('0x1c')){_0x10ba96[_0x5d38('0x1d')]=this[_0x5d38('0x1e')]['id'];}else{_0x10ba96[_[_0x5d38('0x1f')](_0x528cf2)+_0x5d38('0x20')]=this[_0x5d38('0x1e')]['id'];}_0x10ba96[_['upperFirst'](_0x528cf2)+'InteractionId']=this[_0x5d38('0x12')]['id'];if(this[_0x5d38('0x12')][_0x5d38('0x21')]){var _0x1523e=_0x5e717e[0x4];if(!_[_0x5d38('0x22')](_0x1523e)){_0x10ba96[_0x5d38('0xc')]=utils[_0x5d38('0x23')](_0x1523e,this);return rpc[_0x528cf2+_0x5d38('0xd')][_0x5d38('0xe')](_0x10ba96)[_0x5d38('0xf')](function(_0x1b55da){logger[_0x5d38('0x14')](_0x5d38('0x15'),_0x5b0c9d,_0x10ba96[_0x5d38('0xc')]);})[_0x5d38('0x24')](function(_0x285362){logger[_0x5d38('0x10')](_0x5d38('0x15'),_0x5b0c9d,JSON['stringify'](_0x285362));})[_0x5d38('0x25')](function(){logger[_0x5d38('0x14')](_0x5d38('0x26'),_0x5b0c9d);_0x46b163[_0x5d38('0x27')]();});}else{logger[_0x5d38('0x14')](_0x5d38('0x28'),_0x5b0c9d);_0x46b163[_0x5d38('0x27')]();}}else{var _0x44d177=this;var _0x3ce1d8=_0x5e717e[0x2][_0x5d38('0x29')](/\\n/g,'\x0a');var _0x48e1c8={'credentials':{'private_key':_0x3ce1d8,'client_email':_0x5e717e[0x1]}};var _0x365bc5=new dialogflow['SessionsClient'](_0x48e1c8);var _0x32266b=_0x365bc5[_0x5d38('0x2a')](_0x5e717e[0x0],md5(_0x44d177[_0x5d38('0x12')]['id']));var _0x45958d={'session':_0x32266b,'queryInput':{'text':{'text':_0x44d177['message'][_0x5d38('0xc')],'languageCode':_0x5e717e[0x3]||'en'}}};return _0x365bc5[_0x5d38('0x2b')](_0x45958d)['then'](function(_0x6d07df){if(_0x6d07df&&_0x6d07df[_0x5d38('0x2c')]){_0x44d177[_0x5d38('0xc')][_0x5d38('0x2d')]=_0x6d07df;var _0x44464e=_0x6d07df[0x0];var _0x295641=_0x44464e[_0x5d38('0x2e')][_0x5d38('0x2f')]&&_0x44464e['queryResult'][_0x5d38('0x2f')][_0x5d38('0x30')]?_0x44464e[_0x5d38('0x2e')]['diagnosticInfo'][_0x5d38('0x30')]['end_conversation'][_0x5d38('0x31')]:![];_0x44d177[_0x5d38('0xc')][_0x5d38('0x32')]=_0x44464e['queryResult'][_0x5d38('0x33')];_0x44d177[_0x5d38('0xc')][_0x5d38('0x34')]=_0x44464e['queryResult'][_0x5d38('0x35')];_0x44d177[_0x5d38('0xc')][_0x5d38('0x36')]=_0x44464e['queryResult'][_0x5d38('0x2f')]&&_0x44464e[_0x5d38('0x2e')][_0x5d38('0x2f')][_0x5d38('0x30')]?_0x44464e[_0x5d38('0x2e')][_0x5d38('0x2f')]['fields']['end_conversation']['boolValue']:![];_0x44d177[_0x5d38('0xc')][_0x5d38('0x37')]=_0x44464e[_0x5d38('0x2e')]['intent'][_0x5d38('0x38')];_0x44d177['body'][_0x5d38('0x39')]=_0x44464e['queryResult']['intent'][_0x5d38('0x3a')];_0x44d177[_0x5d38('0xc')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x44464e[_0x5d38('0x2e')][_0x5d38('0x3b')]['isFallback'];_0x44d177[_0x5d38('0xc')][_0x5d38('0x3c')]=_0x44464e[_0x5d38('0x2e')]['languageCode'];_0x44d177[_0x5d38('0xc')][_0x5d38('0x3d')]=_0x44464e[_0x5d38('0x2e')]['queryText'];_0x44d177['body'][_0x5d38('0x3e')]=_0x44464e[_0x5d38('0x2e')][_0x5d38('0x3f')];_0x10ba96[_0x5d38('0x40')]=_0x5d38('0x2d');_0x10ba96['providerResponse']=JSON[_0x5d38('0x41')](_0x6d07df);var _0x45997f=[];for(var _0x42b8d7=0x0;_0x42b8d7<_0x6d07df[_0x5d38('0x2c')];_0x42b8d7++){var _0x275cd7=_0x6d07df[_0x42b8d7];if(_0x275cd7&&_0x275cd7[_0x5d38('0x2e')]&&_0x275cd7[_0x5d38('0x2e')]['fulfillmentText']){_0x45997f[_0x5d38('0x42')](createMessage(_0x5b0c9d,_0x528cf2,_0x10ba96,_0x275cd7['queryResult'][_0x5d38('0x43')]));}}return Promise[_0x5d38('0x44')](_0x45997f)[_0x5d38('0xf')](function(){if(_0x295641){_0x46b163[_0x5d38('0x45')]();}else{_0x46b163[_0x5d38('0x27')]();}})[_0x5d38('0x24')](function(_0x4000d4){logger['error'](_0x5d38('0x15'),_0x5b0c9d,JSON['stringify'](_0x4000d4));_0x46b163[_0x5d38('0x45')]();});}})['catch'](function(_0xb79fb){logger[_0x5d38('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x5b0c9d,_0xb79fb['message'],_0xb79fb[_0x5d38('0x46')]);_0x46b163[_0x5d38('0x45')]();});}}catch(_0x11d3b8){logger['error'](_0x5d38('0x15'),_0x5b0c9d,JSON[_0x5d38('0x41')](_0x11d3b8));_0x46b163[_0x5d38('0x27')]();}};}; \ No newline at end of file +var _0x5d46=['interaction','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','then','catch','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','sessionPath','message','detectIntent','dialogflowV2','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','queryResult','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','boolValue','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','length','fulfillmentText','push','all','next','stack','lodash','dialogflow','md5','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','error','stringify','consequence','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','channel','sms','whatsapp','phone'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0x5d46,0x10c));var _0x65d4=function(_0x194db3,_0x103c6c){_0x194db3=_0x194db3-0x0;var _0x4e7a5b=_0x5d46[_0x194db3];return _0x4e7a5b;};'use strict';var _=require(_0x65d4('0x0'));var dialogflow=require(_0x65d4('0x1'));var md5=require(_0x65d4('0x2'));var moment=require('moment');var Promise=require(_0x65d4('0x3'));var logger=require(_0x65d4('0x4'))(_0x65d4('0x5'));var utils=require(_0x65d4('0x6'));var rpc={'chatMessage':require(_0x65d4('0x7')),'openchannelMessage':require(_0x65d4('0x8')),'mailMessage':require(_0x65d4('0x9')),'smsMessage':require(_0x65d4('0xa')),'faxMessage':require(_0x65d4('0xb')),'whatsappMessage':require(_0x65d4('0xc'))};function createMessage(_0x1469f3,_0x49d698,_0x4ae100,_0x159c8f){return new Promise(function(_0x48c50e,_0x250640){var _0x5c5e3a=_[_0x65d4('0xd')](_0x4ae100);_0x5c5e3a[_0x65d4('0xe')]=_0x159c8f;return rpc[_0x49d698+_0x65d4('0xf')][_0x65d4('0x10')](_0x5c5e3a)['then'](function(){logger[_0x65d4('0x11')](_0x65d4('0x12'),_0x1469f3,_0x5c5e3a['body']);_0x48c50e();})['catch'](function(_0x59aac6){logger[_0x65d4('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x1469f3,JSON[_0x65d4('0x14')](_0x59aac6));_0x250640(_0x59aac6);});});}exports[_0x65d4('0x15')]=function(_0x32a053,_0x2d531f){return function(_0x37d984){try{if(!_[_0x65d4('0x16')](this['interaction'][_0x65d4('0x17')])){logger['info'](_0x65d4('0x12'),_0x32a053,_0x65d4('0x18'));return _0x37d984['next']();}var _0x5ec7a5={'ContactId':this[_0x65d4('0x19')]['id'],'sentAt':moment()[_0x65d4('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x65d4('0x1b')};if(this[_0x65d4('0x1c')]===_0x65d4('0x1d')||this[_0x65d4('0x1c')]===_0x65d4('0x1e')){_0x5ec7a5[_0x65d4('0x1f')]=this[_0x65d4('0x20')]['phone'];}var _0x107cce=this[_0x65d4('0x1c')];if(_0x107cce===_0x65d4('0x21')){_0x5ec7a5['ChatWebsiteId']=this[_0x65d4('0x22')]['id'];}else{_0x5ec7a5[_[_0x65d4('0x23')](_0x107cce)+_0x65d4('0x24')]=this[_0x65d4('0x22')]['id'];}_0x5ec7a5[_[_0x65d4('0x23')](_0x107cce)+_0x65d4('0x25')]=this[_0x65d4('0x20')]['id'];if(this[_0x65d4('0x20')][_0x65d4('0x26')]){var _0x304638=_0x2d531f[0x4];if(!_[_0x65d4('0x27')](_0x304638)){_0x5ec7a5[_0x65d4('0xe')]=utils[_0x65d4('0x28')](_0x304638,this);return rpc[_0x107cce+'Message'][_0x65d4('0x10')](_0x5ec7a5)[_0x65d4('0x29')](function(_0x3509eb){logger['info'](_0x65d4('0x12'),_0x32a053,_0x5ec7a5['body']);})[_0x65d4('0x2a')](function(_0x11c100){logger[_0x65d4('0x13')](_0x65d4('0x12'),_0x32a053,JSON[_0x65d4('0x14')](_0x11c100));})['finally'](function(){logger[_0x65d4('0x11')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x32a053);_0x37d984[_0x65d4('0x2b')]();});}else{logger['info'](_0x65d4('0x2c'),_0x32a053);_0x37d984[_0x65d4('0x2b')]();}}else{var _0x5a8fbf=this;var _0x7a730f=_0x2d531f[0x2]['replace'](/\\n/g,'\x0a');var _0x9d2c5e={'credentials':{'private_key':_0x7a730f,'client_email':_0x2d531f[0x1]}};var _0x15662d=new dialogflow['SessionsClient'](_0x9d2c5e);var _0x114853=_0x15662d[_0x65d4('0x2d')](_0x2d531f[0x0],md5(_0x5a8fbf[_0x65d4('0x20')]['id']));var _0x3f6542={'session':_0x114853,'queryInput':{'text':{'text':_0x5a8fbf[_0x65d4('0x2e')][_0x65d4('0xe')],'languageCode':_0x2d531f[0x3]||'en'}}};return _0x15662d[_0x65d4('0x2f')](_0x3f6542)['then'](function(_0x43988d){if(_0x43988d&&_0x43988d['length']){_0x5a8fbf[_0x65d4('0xe')][_0x65d4('0x30')]=_0x43988d;var _0x2c3576=_0x43988d[0x0];var _0x49bf6d=_0x2c3576['queryResult'][_0x65d4('0x31')]&&_0x2c3576['queryResult'][_0x65d4('0x31')][_0x65d4('0x32')]?_0x2c3576['queryResult']['diagnosticInfo'][_0x65d4('0x32')][_0x65d4('0x33')]['boolValue']:![];_0x5a8fbf[_0x65d4('0xe')][_0x65d4('0x34')]=_0x2c3576[_0x65d4('0x35')][_0x65d4('0x36')];_0x5a8fbf[_0x65d4('0xe')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x2c3576[_0x65d4('0x35')][_0x65d4('0x37')];_0x5a8fbf[_0x65d4('0xe')][_0x65d4('0x38')]=_0x2c3576[_0x65d4('0x35')][_0x65d4('0x31')]&&_0x2c3576[_0x65d4('0x35')][_0x65d4('0x31')][_0x65d4('0x32')]?_0x2c3576[_0x65d4('0x35')][_0x65d4('0x31')][_0x65d4('0x32')][_0x65d4('0x33')][_0x65d4('0x39')]:![];_0x5a8fbf['body']['DIALOGFLOWV2_INTENTNAME']=_0x2c3576[_0x65d4('0x35')][_0x65d4('0x3a')][_0x65d4('0x3b')];_0x5a8fbf[_0x65d4('0xe')][_0x65d4('0x3c')]=_0x2c3576[_0x65d4('0x35')][_0x65d4('0x3a')][_0x65d4('0x3d')];_0x5a8fbf[_0x65d4('0xe')][_0x65d4('0x3e')]=_0x2c3576[_0x65d4('0x35')][_0x65d4('0x3a')][_0x65d4('0x3f')];_0x5a8fbf[_0x65d4('0xe')][_0x65d4('0x40')]=_0x2c3576['queryResult']['languageCode'];_0x5a8fbf['body']['DIALOGFLOWV2_QUERYTEXT']=_0x2c3576[_0x65d4('0x35')][_0x65d4('0x41')];_0x5a8fbf[_0x65d4('0xe')][_0x65d4('0x42')]=_0x2c3576[_0x65d4('0x35')][_0x65d4('0x43')];_0x5ec7a5['providerName']='dialogflowV2';_0x5ec7a5[_0x65d4('0x44')]=JSON[_0x65d4('0x14')](_0x43988d);var _0x55e5e6=[];for(var _0xd55cf4=0x0;_0xd55cf4<_0x43988d[_0x65d4('0x45')];_0xd55cf4++){var _0x1d026a=_0x43988d[_0xd55cf4];if(_0x1d026a&&_0x1d026a[_0x65d4('0x35')]&&_0x1d026a[_0x65d4('0x35')][_0x65d4('0x46')]){_0x55e5e6[_0x65d4('0x47')](createMessage(_0x32a053,_0x107cce,_0x5ec7a5,_0x1d026a[_0x65d4('0x35')][_0x65d4('0x46')]));}}return Promise[_0x65d4('0x48')](_0x55e5e6)[_0x65d4('0x29')](function(){if(_0x49bf6d){_0x37d984[_0x65d4('0x49')]();}else{_0x37d984[_0x65d4('0x2b')]();}})[_0x65d4('0x2a')](function(_0x91ae26){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x32a053,JSON['stringify'](_0x91ae26));_0x37d984['next']();});}})[_0x65d4('0x2a')](function(_0x588847){logger[_0x65d4('0x13')](_0x65d4('0x12'),_0x32a053,_0x588847['message'],_0x588847[_0x65d4('0x4a')]);_0x37d984[_0x65d4('0x49')]();});}}catch(_0x5bf7d9){logger[_0x65d4('0x13')](_0x65d4('0x12'),_0x32a053,JSON[_0x65d4('0x14')](_0x5bf7d9));_0x37d984[_0x65d4('0x2b')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 7427580..d8eaf39 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa21a=['priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','[%s][GOTOIF]\x20%s','map','join','stop','condition'];(function(_0x50abc4,_0x558d64){var _0x5a745d=function(_0x4e835b){while(--_0x4e835b){_0x50abc4['push'](_0x50abc4['shift']());}};_0x5a745d(++_0x558d64);}(_0xa21a,0x84));var _0xaa21=function(_0x393a64,_0x21edb5){_0x393a64=_0x393a64-0x0;var _0x443751=_0xa21a[_0x393a64];return _0x443751;};'use strict';var schema=require(_0xaa21('0x0'));var _=require(_0xaa21('0x1'));var htmlToText=require(_0xaa21('0x2'));var utils=require(_0xaa21('0x3'));var logger=require(_0xaa21('0x4'))(_0xaa21('0x5'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xaa21('0x6')},'priorityTrue':{'type':_0xaa21('0x7'),'message':_0xaa21('0x8')},'priorityFalse':{'type':_0xaa21('0x7'),'message':_0xaa21('0x9')}});exports['consequence']=function(_0x2c6307,_0x43ba26){return function(_0x5b7250){try{var _0x53e14e={'condition':htmlToText[_0xaa21('0xa')](utils[_0xaa21('0xb')](_0x43ba26[0x0],this),{'wordwrap':![]})[_0xaa21('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x43ba26[0x1],'priorityFalse':_0x43ba26[0x2]};var _0x1082c7=gotoif['validate'](_0x53e14e,{'typecast':!![]});if(_0x1082c7['length']){logger['error'](_0xaa21('0xd'),_0x2c6307,_[_0xaa21('0xe')](_0x1082c7,'message')[_0xaa21('0xf')](',\x20'));_0x5b7250[_0xaa21('0x10')]();}else{try{var _0x5e295b=eval('('+_0x53e14e[_0xaa21('0x11')]+')');var _0x4664c=_0x5e295b?_0x53e14e['priorityTrue']:_0x53e14e[_0xaa21('0x12')];logger[_0xaa21('0x13')](_0xaa21('0x14'),_0x2c6307,_0x53e14e[_0xaa21('0x11')],_0x5e295b,_0x4664c||'next');if(_0x4664c){var _0x5b8bcf=_[_0xaa21('0x15')](_0x5b7250[_0xaa21('0x16')](),{'p':_0x4664c});if(_0x5b8bcf>=0x0){logger[_0xaa21('0x13')](_0xaa21('0x17'),_0x2c6307,_0x4664c||_0xaa21('0x18'),_0x5b8bcf);_0x5b7250[_0xaa21('0x18')](_0x5b8bcf);}else{logger[_0xaa21('0x13')](_0xaa21('0x19'),_0x2c6307,_0x4664c||_0xaa21('0x18'));_0x5b7250[_0xaa21('0x10')]();}}else{_0x5b7250[_0xaa21('0x18')]();}}catch(_0x3c0eb2){logger[_0xaa21('0x1a')](_0xaa21('0x1b'),_0x2c6307,_0x3c0eb2[_0xaa21('0x1c')]);_0x5b7250[_0xaa21('0x10')]();}}}catch(_0x112856){logger[_0xaa21('0x1a')](_0xaa21('0xd'),_0x2c6307,JSON[_0xaa21('0x1d')](_0x112856));_0x5b7250[_0xaa21('0x10')]();}};}; \ No newline at end of file +var _0xda91=['[%s][GOTOIF]\x20%s','stringify','validate','html-to-text','./utils','../../../../config/logger','routing','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','map','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','error'];(function(_0x2cebbe,_0x963f13){var _0x4fb79a=function(_0x22adfc){while(--_0x22adfc){_0x2cebbe['push'](_0x2cebbe['shift']());}};_0x4fb79a(++_0x963f13);}(_0xda91,0x72));var _0x1da9=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xda91[_0x502c7d];return _0x30b7ed;};'use strict';var schema=require(_0x1da9('0x0'));var _=require('lodash');var htmlToText=require(_0x1da9('0x1'));var utils=require(_0x1da9('0x2'));var logger=require(_0x1da9('0x3'))(_0x1da9('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x1da9('0x5'),'message':_0x1da9('0x6')},'priorityFalse':{'type':_0x1da9('0x5'),'message':_0x1da9('0x7')}});exports[_0x1da9('0x8')]=function(_0x435d64,_0x1b135f){return function(_0x54a413){try{var _0x5053a9={'condition':htmlToText[_0x1da9('0x9')](utils['getMustacheRender'](_0x1b135f[0x0],this),{'wordwrap':![]})[_0x1da9('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1b135f[0x1],'priorityFalse':_0x1b135f[0x2]};var _0x11ecd7=gotoif['validate'](_0x5053a9,{'typecast':!![]});if(_0x11ecd7[_0x1da9('0xb')]){logger['error']('[%s][GOTOIF]\x20%s',_0x435d64,_[_0x1da9('0xc')](_0x11ecd7,_0x1da9('0xd'))[_0x1da9('0xe')](',\x20'));_0x54a413[_0x1da9('0xf')]();}else{try{var _0x812fe3=eval('('+_0x5053a9[_0x1da9('0x10')]+')');var _0x4ac870=_0x812fe3?_0x5053a9[_0x1da9('0x11')]:_0x5053a9[_0x1da9('0x12')];logger[_0x1da9('0x13')](_0x1da9('0x14'),_0x435d64,_0x5053a9[_0x1da9('0x10')],_0x812fe3,_0x4ac870||_0x1da9('0x15'));if(_0x4ac870){var _0x10cf93=_['findIndex'](_0x54a413[_0x1da9('0x16')](),{'p':_0x4ac870});if(_0x10cf93>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x435d64,_0x4ac870||'next',_0x10cf93);_0x54a413['next'](_0x10cf93);}else{logger[_0x1da9('0x13')](_0x1da9('0x17'),_0x435d64,_0x4ac870||_0x1da9('0x15'));_0x54a413[_0x1da9('0xf')]();}}else{_0x54a413[_0x1da9('0x15')]();}}catch(_0x153467){logger['error'](_0x1da9('0x18'),_0x435d64,_0x153467[_0x1da9('0xd')]);_0x54a413[_0x1da9('0xf')]();}}}catch(_0x3d7985){logger[_0x1da9('0x19')](_0x1da9('0x1a'),_0x435d64,JSON[_0x1da9('0x1b')](_0x3d7985));_0x54a413[_0x1da9('0xf')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 61ee75e..c05b02e 100644 --- a/server/services/routing/server/applications/gotop.js +++ b/server/services/routing/server/applications/gotop.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc63f=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','lodash','routing'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0xc63f,0x11d));var _0xfc63=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc63f[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xfc63('0x0'));var _=require(_0xfc63('0x1'));var logger=require('../../../../config/logger')(_0xfc63('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xfc63('0x3')}});exports[_0xfc63('0x4')]=function(_0x17ae34,_0x382ea0){return function(_0x1848e9){try{var _0xd6e38e={'priority':_0x382ea0[0x0]};var _0x455b08=gotop['validate'](_0xd6e38e,{'typecast':!![]});if(_0x455b08[_0xfc63('0x5')]){logger[_0xfc63('0x6')](_0xfc63('0x7'),_0x17ae34,_[_0xfc63('0x8')](_0x455b08,_0xfc63('0x9'))['join'](',\x20'));_0x1848e9[_0xfc63('0xa')]();}else{logger[_0xfc63('0xb')]('[%s][GOTOP]\x20priority\x20%s',_0x17ae34,_0xd6e38e[_0xfc63('0xc')]);if(_0xd6e38e[_0xfc63('0xc')]){var _0x3901e5=_[_0xfc63('0xd')](_0x1848e9[_0xfc63('0xe')](),{'p':_0xd6e38e[_0xfc63('0xc')]});if(_0x3901e5>=0x0){logger[_0xfc63('0xb')](_0xfc63('0xf'),_0x17ae34,_0xd6e38e[_0xfc63('0xc')]||_0xfc63('0x10'),_0x3901e5);_0x1848e9[_0xfc63('0x10')](_0x3901e5);}else{logger[_0xfc63('0xb')](_0xfc63('0x11'),_0x17ae34,_0xd6e38e[_0xfc63('0xc')]||_0xfc63('0x10'));_0x1848e9['stop']();}}else{_0x1848e9[_0xfc63('0x10')]();}}}catch(_0x1acfce){logger['error']('[%s][GOTOP]\x20%s',_0x17ae34,JSON['stringify'](_0x1acfce));_0x1848e9[_0xfc63('0xa')]();}};}; \ No newline at end of file +var _0xc988=['info','priority','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','../../../../config/logger','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','join','stop'];(function(_0x5aaf93,_0x5c0001){var _0x17d307=function(_0x21d77a){while(--_0x21d77a){_0x5aaf93['push'](_0x5aaf93['shift']());}};_0x17d307(++_0x5c0001);}(_0xc988,0x1d4));var _0x8c98=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xc988[_0x46d0c9];return _0x174506;};'use strict';var schema=require(_0x8c98('0x0'));var _=require('lodash');var logger=require(_0x8c98('0x1'))('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x8c98('0x2')}});exports['consequence']=function(_0x84342e,_0x4b596){return function(_0x28d33d){try{var _0x3b6f40={'priority':_0x4b596[0x0]};var _0x359407=gotop[_0x8c98('0x0')](_0x3b6f40,{'typecast':!![]});if(_0x359407[_0x8c98('0x3')]){logger[_0x8c98('0x4')](_0x8c98('0x5'),_0x84342e,_['map'](_0x359407,'message')[_0x8c98('0x6')](',\x20'));_0x28d33d[_0x8c98('0x7')]();}else{logger[_0x8c98('0x8')]('[%s][GOTOP]\x20priority\x20%s',_0x84342e,_0x3b6f40['priority']);if(_0x3b6f40[_0x8c98('0x9')]){var _0x4afbd5=_['findIndex'](_0x28d33d[_0x8c98('0xa')](),{'p':_0x3b6f40[_0x8c98('0x9')]});if(_0x4afbd5>=0x0){logger[_0x8c98('0x8')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x84342e,_0x3b6f40[_0x8c98('0x9')]||_0x8c98('0xb'),_0x4afbd5);_0x28d33d['next'](_0x4afbd5);}else{logger[_0x8c98('0x8')](_0x8c98('0xc'),_0x84342e,_0x3b6f40[_0x8c98('0x9')]||'next');_0x28d33d['stop']();}}else{_0x28d33d[_0x8c98('0xb')]();}}}catch(_0x22b0db){logger[_0x8c98('0x4')]('[%s][GOTOP]\x20%s',_0x84342e,JSON[_0x8c98('0xd')](_0x22b0db));_0x28d33d['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 10604df..3730f37 100644 --- a/server/services/routing/server/applications/message.js +++ b/server/services/routing/server/applications/message.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f9b=['stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','getMustacheRender','contact','chat','ChatWebsiteId','account','channel','upperFirst','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify'];(function(_0x1fd8fa,_0x3c2e0f){var _0x311b53=function(_0x550012){while(--_0x550012){_0x1fd8fa['push'](_0x1fd8fa['shift']());}};_0x311b53(++_0x3c2e0f);}(_0x4f9b,0x6d));var _0xb4f9=function(_0x9cfbbe,_0x12a1cf){_0x9cfbbe=_0x9cfbbe-0x0;var _0x21c39b=_0x4f9b[_0x9cfbbe];return _0x21c39b;};'use strict';var _=require(_0xb4f9('0x0'));var utils=require(_0xb4f9('0x1'));var logger=require(_0xb4f9('0x2'))(_0xb4f9('0x3'));var rpc={'chatMessage':require(_0xb4f9('0x4')),'openchannelMessage':require(_0xb4f9('0x5')),'mailMessage':require(_0xb4f9('0x6')),'smsMessage':require(_0xb4f9('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x25947a,_0x38c813){return function(_0x2fa71b){try{var _0x4e8f3c={'body':utils[_0xb4f9('0x8')](_0x38c813[0x0],this),'ContactId':this[_0xb4f9('0x9')]['id']};if(this['channel']===_0xb4f9('0xa')){_0x4e8f3c[_0xb4f9('0xb')]=this[_0xb4f9('0xc')]['id'];}else{_0x4e8f3c[_['upperFirst'](this[_0xb4f9('0xd')])+'AccountId']=this[_0xb4f9('0xc')]['id'];}_0x4e8f3c[_[_0xb4f9('0xe')](this[_0xb4f9('0xd')])+_0xb4f9('0xf')]=this[_0xb4f9('0x10')]['id'];if(rpc[this[_0xb4f9('0xd')]+_0xb4f9('0x11')]){return rpc[this['channel']+_0xb4f9('0x11')][_0xb4f9('0x12')](_0x4e8f3c)[_0xb4f9('0x13')](function(_0x4927d9){logger['info'](_0xb4f9('0x14'),_0x25947a,_0x4e8f3c[_0xb4f9('0x15')]);_0x2fa71b[_0xb4f9('0x16')]();})[_0xb4f9('0x17')](function(_0x25b8d9){logger[_0xb4f9('0x18')](_0xb4f9('0x14'),_0x25947a,JSON[_0xb4f9('0x19')](_0x25b8d9));_0x2fa71b[_0xb4f9('0x1a')]();});}}catch(_0x170792){logger[_0xb4f9('0x18')](_0xb4f9('0x14'),_0x25947a,JSON['stringify'](_0x170792));_0x2fa71b[_0xb4f9('0x1a')]();}};}; \ No newline at end of file +var _0xa6ea=['Message','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xa6ea,0x122));var _0xaa6e=function(_0x459c7b,_0x1b4508){_0x459c7b=_0x459c7b-0x0;var _0x5e04f1=_0xa6ea[_0x459c7b];return _0x5e04f1;};'use strict';var _=require(_0xaa6e('0x0'));var utils=require(_0xaa6e('0x1'));var logger=require(_0xaa6e('0x2'))(_0xaa6e('0x3'));var rpc={'chatMessage':require(_0xaa6e('0x4')),'openchannelMessage':require(_0xaa6e('0x5')),'mailMessage':require(_0xaa6e('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xaa6e('0x7')),'whatsappMessage':require(_0xaa6e('0x8'))};exports[_0xaa6e('0x9')]=function(_0x37b6ee,_0xb01d1d){return function(_0x53d333){try{var _0x543fc1={'body':utils[_0xaa6e('0xa')](_0xb01d1d[0x0],this),'ContactId':this[_0xaa6e('0xb')]['id']};if(this[_0xaa6e('0xc')]===_0xaa6e('0xd')){_0x543fc1[_0xaa6e('0xe')]=this[_0xaa6e('0xf')]['id'];}else{_0x543fc1[_[_0xaa6e('0x10')](this['channel'])+_0xaa6e('0x11')]=this['account']['id'];}_0x543fc1[_['upperFirst'](this[_0xaa6e('0xc')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0xaa6e('0xc')]+_0xaa6e('0x12')]){return rpc[this['channel']+_0xaa6e('0x12')]['create'](_0x543fc1)[_0xaa6e('0x13')](function(_0x234bc8){logger[_0xaa6e('0x14')](_0xaa6e('0x15'),_0x37b6ee,_0x543fc1[_0xaa6e('0x16')]);_0x53d333[_0xaa6e('0x17')]();})[_0xaa6e('0x18')](function(_0x1da120){logger[_0xaa6e('0x19')]('[%s][MESSAGE]\x20%s',_0x37b6ee,JSON[_0xaa6e('0x1a')](_0x1da120));_0x53d333[_0xaa6e('0x1b')]();});}}catch(_0x22b001){logger['error'](_0xaa6e('0x15'),_0x37b6ee,JSON[_0xaa6e('0x1a')](_0x22b001));_0x53d333[_0xaa6e('0x1b')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 6968fc9..83a6048 100644 --- a/server/services/routing/server/applications/noop.js +++ b/server/services/routing/server/applications/noop.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0146=['../../../../config/logger','routing','info','[%s][NOOP]\x20%s','getMustacheRender','error','stringify'];(function(_0x4fc06b,_0x1bd518){var _0x47e08b=function(_0x3d7c5c){while(--_0x3d7c5c){_0x4fc06b['push'](_0x4fc06b['shift']());}};_0x47e08b(++_0x1bd518);}(_0x0146,0x118));var _0x6014=function(_0x2cd1fb,_0x291f55){_0x2cd1fb=_0x2cd1fb-0x0;var _0x48fd2b=_0x0146[_0x2cd1fb];return _0x48fd2b;};'use strict';var utils=require('./utils');var logger=require(_0x6014('0x0'))(_0x6014('0x1'));exports['consequence']=function(_0xc2d208,_0x48e4d6){return function(_0x1bce7a){try{logger[_0x6014('0x2')](_0x6014('0x3'),_0xc2d208,utils[_0x6014('0x4')](_0x48e4d6[0x0],this));_0x1bce7a['next']();}catch(_0x309fe8){logger[_0x6014('0x5')]('[%s][NOOP]\x20%s',_0xc2d208,JSON[_0x6014('0x6')](_0x309fe8));_0x1bce7a['stop']();}};}; \ No newline at end of file +var _0xcacd=['info','getMustacheRender','next','error','[%s][NOOP]\x20%s','stringify','stop','../../../../config/logger','routing','consequence'];(function(_0x4a5948,_0x419e87){var _0x406499=function(_0x4dcb00){while(--_0x4dcb00){_0x4a5948['push'](_0x4a5948['shift']());}};_0x406499(++_0x419e87);}(_0xcacd,0x1f1));var _0xdcac=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xcacd[_0x167cc1];return _0x10bc4b;};'use strict';var utils=require('./utils');var logger=require(_0xdcac('0x0'))(_0xdcac('0x1'));exports[_0xdcac('0x2')]=function(_0x17e19f,_0x514d71){return function(_0x1d75fc){try{logger[_0xdcac('0x3')]('[%s][NOOP]\x20%s',_0x17e19f,utils[_0xdcac('0x4')](_0x514d71[0x0],this));_0x1d75fc[_0xdcac('0x5')]();}catch(_0x24833e){logger[_0xdcac('0x6')](_0xdcac('0x7'),_0x17e19f,JSON[_0xdcac('0x8')](_0x24833e));_0x1d75fc[_0xdcac('0x9')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 08529db..79d37ea 100644 --- a/server/services/routing/server/applications/queue.js +++ b/server/services/routing/server/applications/queue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf519=['WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update','then','timeout','[%s][END:QUEUE][NAME:%s]','error','update\x20queue\x20report','toLowerCase','validate','length','[%s][QUEUE]\x20%s','map','join','find','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','account','queue','joinAt','emit','clone','push','capitalize','InteractionId','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','interaction','MessageId','message','chat','AccountId'];(function(_0xb2eb8,_0xeebbdf){var _0xd94a48=function(_0x34344b){while(--_0x34344b){_0xb2eb8['push'](_0xb2eb8['shift']());}};_0xd94a48(++_0xeebbdf);}(_0xf519,0xcd));var _0x9f51=function(_0x5751e6,_0x125e5e){_0x5751e6=_0x5751e6-0x0;var _0x4199e4=_0xf519[_0x5751e6];return _0x4199e4;};'use strict';var schema=require('validate');var _=require(_0x9f51('0x0'));var util=require(_0x9f51('0x1'));var seqqueue=require(_0x9f51('0x2'));var moment=require(_0x9f51('0x3'));var Redis=require(_0x9f51('0x4'));var config=require(_0x9f51('0x5'));var logger=require(_0x9f51('0x6'))(_0x9f51('0x7'));var strategy=require(_0x9f51('0x8'));config[_0x9f51('0x9')]=_[_0x9f51('0xa')](config[_0x9f51('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id','queue_id',_0x9f51('0xb'),_0x9f51('0xc'),'from',_0x9f51('0xd')];function emit(_0x3dbffe,_0xf8ca8a,_0x43913e){io['to'](_0x3dbffe)[_0x9f51('0xe')](_0xf8ca8a,_0x43913e);}function emitChannelQueueInteraction(_0x51cc02,_0x5dd9aa,_0x534b59,_0x225242,_0x510cf1,_0xe18219,_0x2e096a,_0x13ac98){var _0x36c1e3=_[_0x9f51('0xf')](_0x534b59);_0x36c1e3['queue_id']=_0x13ac98;_0x36c1e3['queue']=_0x5dd9aa;_0x36c1e3['account']=_0x225242;_0x36c1e3['id']=_0x510cf1;if(_0xe18219){attributes[_0x9f51('0x10')](_[_0x9f51('0x11')](_0x51cc02)+_0x9f51('0x12'));_0x2e096a[util['format'](_0x9f51('0x13'),_0x51cc02)][_0x510cf1]=_[_0x9f51('0x14')](_0x36c1e3,attributes);}else{delete _0x2e096a[util[_0x9f51('0x15')]('%sQueuesWaitingInteractions',_0x51cc02)][_0x510cf1];}emit(util[_0x9f51('0x15')](_0x9f51('0x16'),_0x51cc02,_0x5dd9aa),util[_0x9f51('0x15')](_0x9f51('0x17'),_0x51cc02,_0xe18219?_0x9f51('0x18'):_0x9f51('0x19')),_[_0x9f51('0x14')](_0x36c1e3,attributes));}var rpc={'openchannelQueueReport':require(_0x9f51('0x1a')),'mailQueueReport':require(_0x9f51('0x1b')),'chatQueueReport':require(_0x9f51('0x1c')),'smsQueueReport':require(_0x9f51('0x1d')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x9f51('0x1e')),'chatInteraction':require(_0x9f51('0x1f')),'faxInteraction':require(_0x9f51('0x20')),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x9f51('0x21')),'whatsappInteraction':require(_0x9f51('0x22'))};var queue=schema({'name':{'type':_0x9f51('0x23'),'required':!![],'message':_0x9f51('0x24')},'timeout':{'type':'number','message':_0x9f51('0x25')}});function startRouting(_0x4bb0fe,_0xe6ba87,_0x5aa363,_0x509516){if(_0x4bb0fe&&_0xe6ba87&&_0x5aa363){_0xe6ba87[_0x9f51('0x26')]+=0x1;var _0x1b64ab={'uniqueid':_0x4bb0fe,'from':_0x5aa363['body']?_0x5aa363[_0x9f51('0x27')]['from']:'','joinAt':moment()[_0x9f51('0x15')](_0x9f51('0x28')),'ContactId':_0x5aa363[_0x9f51('0x29')]?_0x5aa363[_0x9f51('0x29')]['id']:null,'ListId':_0x5aa363[_0x9f51('0x2a')]?_0x5aa363['list']['id']:null};_0x1b64ab[_[_0x9f51('0x2b')](_0x5aa363[_0x9f51('0x2c')])+'QueueId']=_0xe6ba87['id']||null;_0x1b64ab[_['upperFirst'](_0x5aa363['channel'])+_0x9f51('0x12')]=_0x5aa363[_0x9f51('0x2d')]?_0x5aa363[_0x9f51('0x2d')]['id']:null;_0x1b64ab[_[_0x9f51('0x2b')](_0x5aa363['channel'])+_0x9f51('0x2e')]=_0x5aa363[_0x9f51('0x2f')]?_0x5aa363[_0x9f51('0x2f')]['id']:null;_0x1b64ab[_[_0x9f51('0x2b')](_0x5aa363[_0x9f51('0x2c')])+(_0x5aa363[_0x9f51('0x2c')]!==_0x9f51('0x30')?_0x9f51('0x31'):_0x9f51('0x32'))]=_0x5aa363[_0x9f51('0xb')]?_0x5aa363['account']['id']:null;logger[_0x9f51('0x33')](util[_0x9f51('0x15')](_0x9f51('0x34'),_0x4bb0fe,_0xe6ba87[_0x9f51('0x35')]));emitChannelQueueInteraction(_0x5aa363[_0x9f51('0x2c')],_0xe6ba87['name'],_0x1b64ab,_0x5aa363[_0x9f51('0xb')]['name'],_0x5aa363[_0x9f51('0x2f')]['id'],!![],_0x509516,_0xe6ba87['id']);if(rpc[_0x5aa363['channel']+_0x9f51('0x36')]){return rpc[_0x5aa363['channel']+_0x9f51('0x36')][_0x9f51('0x37')](_0x1b64ab)[_0x9f51('0x38')](function(_0x4f3501){logger['error'](_0x9f51('0x39'),_0x4f3501);});}}}function stopRouting(_0x53f15f,_0x4bf600,_0x1b7e76,_0x3f3546){if(_0x53f15f&&_0x4bf600){_0x4bf600[_0x9f51('0x26')]-=0x1;var _0x1fa8d7={'leaveAt':moment()[_0x9f51('0x15')](_0x9f51('0x28')),'acceptAt':moment()[_0x9f51('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0x9f51('0x33')](util['format'](_0x9f51('0x3a'),_0x53f15f,_0x4bf600['name']));emitChannelQueueInteraction(_0x1b7e76[_0x9f51('0x2c')],_0x4bf600[_0x9f51('0x35')],_0x1b7e76[_0x9f51('0x27')],_0x1b7e76[_0x9f51('0xb')][_0x9f51('0x35')],_0x1b7e76[_0x9f51('0x2f')]['id'],![],_0x3f3546,_0x4bf600['id']);return rpc[_0x1b7e76['channel']+'Interaction'][_0x9f51('0x3b')](_0x1b7e76[_0x9f51('0x2d')]['id'],{'queueId':_0x4bf600['id']})[_0x9f51('0x3c')](function(){if(rpc[_0x1b7e76[_0x9f51('0x2c')]+'QueueReport']){return rpc[_0x1b7e76[_0x9f51('0x2c')]+_0x9f51('0x36')][_0x9f51('0x3b')](_0x53f15f,_0x1fa8d7)[_0x9f51('0x38')](function(_0x113bc6){logger['error']('update\x20queue\x20report',_0x113bc6);});}});}}function endRouting(_0x3cfcc1,_0x32e958,_0x4a0606,_0x149de5){if(_0x3cfcc1&&_0x32e958){_0x32e958[_0x9f51('0x26')]-=0x1;var _0x65f35e={'leaveAt':moment()[_0x9f51('0x15')](_0x9f51('0x28')),'exitAt':moment()[_0x9f51('0x15')](_0x9f51('0x28')),'reason':_0x9f51('0x3d')};logger['info'](util[_0x9f51('0x15')](_0x9f51('0x3e'),_0x3cfcc1,_0x32e958[_0x9f51('0x35')]));emitChannelQueueInteraction(_0x4a0606[_0x9f51('0x2c')],_0x32e958[_0x9f51('0x35')],_0x4a0606[_0x9f51('0x27')],_0x4a0606[_0x9f51('0xb')]['name'],_0x4a0606[_0x9f51('0x2f')]['id'],![],_0x149de5);if(rpc[_0x4a0606[_0x9f51('0x2c')]+'QueueReport']){return rpc[_0x4a0606[_0x9f51('0x2c')]+_0x9f51('0x36')]['update'](_0x3cfcc1,_0x65f35e)[_0x9f51('0x38')](function(_0x2d691d){logger[_0x9f51('0x3f')](_0x9f51('0x40'),_0x2d691d);});}}}function handleFindQueue(_0x720792){return function(_0x3bc85d){return _0x3bc85d[_0x9f51('0x35')]['toLowerCase']()===_0x720792[_0x9f51('0x41')]();};}exports['consequence']=function(_0x16e8c7,_0x5408d4,_0x31c6cb,_0x2dbd61){return function(_0x445087){try{var _0x3f862f={'name':_0x5408d4[0x0],'timeout':_0x5408d4[0x1]};var _0x1c6d8e=queue[_0x9f51('0x42')](_0x3f862f,{'typecast':!![]});if(_0x1c6d8e[_0x9f51('0x43')]){logger['error'](_0x9f51('0x44'),_0x16e8c7,_[_0x9f51('0x45')](_0x1c6d8e,'message')[_0x9f51('0x46')](',\x20'));_0x445087['stop']();}else{var _0x19044a=_[_0x9f51('0x47')](_0x31c6cb[_0x2dbd61[_0x9f51('0x2c')]+'Queues'],handleFindQueue(_0x3f862f[_0x9f51('0x35')]));if(_0x19044a){startRouting(_0x16e8c7,_0x19044a,_0x2dbd61,_0x31c6cb);var _0x2710f8=(_0x19044a[_0x9f51('0x3d')]||0xa)*0x3e8;var _0x472887=(_0x3f862f[_0x9f51('0x3d')]||0x14)*0x3e8;var _0x3d70a3;if(_0x2710f8>_0x472887){_0x472887=_0x2710f8;}var _0x5b5334=seqqueue['createQueue'](_0x2710f8);_0x5b5334['id']=_0x16e8c7;_0x5b5334[_0x9f51('0x48')]=_0x2710f8;_0x5b5334[_0x9f51('0x49')]=_0x472887;_0x5b5334[_0x9f51('0x2c')]=_0x2dbd61[_0x9f51('0x2c')];_0x31c6cb[_0x9f51('0x4a')][_0x16e8c7]['on'](_0x9f51('0x4b'),function(){logger[_0x9f51('0x33')](_0x9f51('0x4c'),_0x16e8c7);stopRouting(_0x16e8c7,_0x19044a,_0x2dbd61,_0x31c6cb);clearTimeout(_0x3d70a3);_0x3d70a3=undefined;_0x5b5334[_0x9f51('0x4d')](!![]);if(_0x31c6cb['rules'][_0x16e8c7]){delete _0x31c6cb['rules'][_0x16e8c7];}_0x445087[_0x9f51('0x4e')]();});_0x31c6cb[_0x9f51('0x4a')][_0x16e8c7]['on'](_0x9f51('0x4f'),function(){if(_0x31c6cb[_0x9f51('0x4a')][_0x16e8c7]){delete _0x31c6cb[_0x9f51('0x4a')][_0x16e8c7];}});_0x3d70a3=setTimeout(function(){logger['info'](_0x9f51('0x50'),_0x16e8c7);endRouting(_0x16e8c7,_0x19044a,_0x2dbd61,_0x31c6cb);clearTimeout(_0x3d70a3);_0x5b5334[_0x9f51('0x4d')](!![]);_0x445087[_0x9f51('0x51')]();},_0x472887);switch(_0x19044a['strategy']){case'rrmemory':strategy[_0x9f51('0x52')](_0x5b5334,_0x19044a,_0x31c6cb,_0x2dbd61);break;default:strategy[_0x9f51('0x53')](_0x5b5334,_0x19044a,_0x31c6cb,_0x2dbd61);}}else{logger[_0x9f51('0x3f')](_0x9f51('0x54'),_0x16e8c7,_0x3f862f[_0x9f51('0x35')]);_0x445087[_0x9f51('0x4e')]();}}}catch(_0x5a35bd){logger[_0x9f51('0x3f')](_0x9f51('0x44'),_0x16e8c7,_0x5a35bd['stack']);_0x445087['stop']();}};}; \ No newline at end of file +var _0xd509=['contact','list','channel','interaction','MessageId','upperFirst','chat','AccountId','WebsiteId','name','message','QueueReport','create','error','YYYY-MM-DD\x20HH:mm:ss','info','Interaction','update','then','catch','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','stop','Queues','timeout','createQueue','atimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','./strategy','defaults','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body'];(function(_0x26667a,_0x69076e){var _0x1d2d3b=function(_0x3c80b7){while(--_0x3c80b7){_0x26667a['push'](_0x26667a['shift']());}};_0x1d2d3b(++_0x69076e);}(_0xd509,0x80));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require('validate');var _=require(_0x9d50('0x0'));var util=require(_0x9d50('0x1'));var seqqueue=require(_0x9d50('0x2'));var moment=require(_0x9d50('0x3'));var Redis=require('ioredis');var config=require(_0x9d50('0x4'));var logger=require(_0x9d50('0x5'))('routing');var strategy=require(_0x9d50('0x6'));config['redis']=_[_0x9d50('0x7')](config[_0x9d50('0x8')],{'host':_0x9d50('0x9'),'port':0x18eb});var io=require(_0x9d50('0xa'))(new Redis(config[_0x9d50('0x8')]));var attributes=['id',_0x9d50('0xb'),_0x9d50('0xc'),_0x9d50('0xd'),_0x9d50('0xe'),_0x9d50('0xf')];function emit(_0x2ee6c0,_0x2e6bc6,_0x3fe9ac){io['to'](_0x2ee6c0)[_0x9d50('0x10')](_0x2e6bc6,_0x3fe9ac);}function emitChannelQueueInteraction(_0xb98262,_0x436990,_0x3b7b01,_0xf7c670,_0x57167a,_0x2f2818,_0x49ebe4,_0x32e7af){var _0x569965=_[_0x9d50('0x11')](_0x3b7b01);_0x569965[_0x9d50('0xb')]=_0x32e7af;_0x569965[_0x9d50('0xd')]=_0x436990;_0x569965['account']=_0xf7c670;_0x569965['id']=_0x57167a;if(_0x2f2818){attributes[_0x9d50('0x12')](_[_0x9d50('0x13')](_0xb98262)+_0x9d50('0x14'));_0x49ebe4[util[_0x9d50('0x15')](_0x9d50('0x16'),_0xb98262)][_0x57167a]=_[_0x9d50('0x17')](_0x569965,attributes);}else{delete _0x49ebe4[util[_0x9d50('0x15')](_0x9d50('0x16'),_0xb98262)][_0x57167a];}emit(util[_0x9d50('0x15')]('%s:queue:%s',_0xb98262,_0x436990),util['format'](_0x9d50('0x18'),_0xb98262,_0x2f2818?_0x9d50('0x19'):_0x9d50('0x1a')),_[_0x9d50('0x17')](_0x569965,attributes));}var rpc={'openchannelQueueReport':require(_0x9d50('0x1b')),'mailQueueReport':require(_0x9d50('0x1c')),'chatQueueReport':require(_0x9d50('0x1d')),'smsQueueReport':require(_0x9d50('0x1e')),'faxQueueReport':require(_0x9d50('0x1f')),'whatsappQueueReport':require(_0x9d50('0x20')),'chatInteraction':require(_0x9d50('0x21')),'faxInteraction':require(_0x9d50('0x22')),'mailInteraction':require(_0x9d50('0x23')),'openchannelInteraction':require(_0x9d50('0x24')),'smsInteraction':require(_0x9d50('0x25')),'whatsappInteraction':require(_0x9d50('0x26'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x9d50('0x27')},'timeout':{'type':_0x9d50('0x28'),'message':_0x9d50('0x29')}});function startRouting(_0x3d176b,_0x35f61e,_0x3521b8,_0x46070d){if(_0x3d176b&&_0x35f61e&&_0x3521b8){_0x35f61e[_0x9d50('0x2a')]+=0x1;var _0xb96a4f={'uniqueid':_0x3d176b,'from':_0x3521b8[_0x9d50('0x2b')]?_0x3521b8[_0x9d50('0x2b')][_0x9d50('0xe')]:'','joinAt':moment()[_0x9d50('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3521b8[_0x9d50('0x2c')]?_0x3521b8[_0x9d50('0x2c')]['id']:null,'ListId':_0x3521b8[_0x9d50('0x2d')]?_0x3521b8[_0x9d50('0x2d')]['id']:null};_0xb96a4f[_['upperFirst'](_0x3521b8[_0x9d50('0x2e')])+'QueueId']=_0x35f61e['id']||null;_0xb96a4f[_['upperFirst'](_0x3521b8[_0x9d50('0x2e')])+_0x9d50('0x14')]=_0x3521b8[_0x9d50('0x2f')]?_0x3521b8[_0x9d50('0x2f')]['id']:null;_0xb96a4f[_['upperFirst'](_0x3521b8[_0x9d50('0x2e')])+_0x9d50('0x30')]=_0x3521b8['message']?_0x3521b8['message']['id']:null;_0xb96a4f[_[_0x9d50('0x31')](_0x3521b8[_0x9d50('0x2e')])+(_0x3521b8[_0x9d50('0x2e')]!==_0x9d50('0x32')?_0x9d50('0x33'):_0x9d50('0x34'))]=_0x3521b8[_0x9d50('0xc')]?_0x3521b8[_0x9d50('0xc')]['id']:null;logger['info'](util['format']('[%s][START:QUEUE][NAME:%s]',_0x3d176b,_0x35f61e[_0x9d50('0x35')]));emitChannelQueueInteraction(_0x3521b8['channel'],_0x35f61e['name'],_0xb96a4f,_0x3521b8[_0x9d50('0xc')]['name'],_0x3521b8[_0x9d50('0x36')]['id'],!![],_0x46070d,_0x35f61e['id']);if(rpc[_0x3521b8[_0x9d50('0x2e')]+'QueueReport']){return rpc[_0x3521b8[_0x9d50('0x2e')]+_0x9d50('0x37')][_0x9d50('0x38')](_0xb96a4f)['catch'](function(_0x2103e3){logger[_0x9d50('0x39')]('create\x20queue\x20report',_0x2103e3);});}}}function stopRouting(_0x3d3c88,_0x3ebeae,_0x17a965,_0x212013){if(_0x3d3c88&&_0x3ebeae){_0x3ebeae[_0x9d50('0x2a')]-=0x1;var _0x172597={'leaveAt':moment()[_0x9d50('0x15')](_0x9d50('0x3a')),'acceptAt':moment()[_0x9d50('0x15')](_0x9d50('0x3a')),'reason':'accepted'};logger[_0x9d50('0x3b')](util[_0x9d50('0x15')]('[%s][STOP:QUEUE][NAME:%s]',_0x3d3c88,_0x3ebeae[_0x9d50('0x35')]));emitChannelQueueInteraction(_0x17a965[_0x9d50('0x2e')],_0x3ebeae[_0x9d50('0x35')],_0x17a965[_0x9d50('0x2b')],_0x17a965['account'][_0x9d50('0x35')],_0x17a965[_0x9d50('0x36')]['id'],![],_0x212013,_0x3ebeae['id']);return rpc[_0x17a965['channel']+_0x9d50('0x3c')][_0x9d50('0x3d')](_0x17a965['interaction']['id'],{'queueId':_0x3ebeae['id']})[_0x9d50('0x3e')](function(){if(rpc[_0x17a965[_0x9d50('0x2e')]+'QueueReport']){return rpc[_0x17a965[_0x9d50('0x2e')]+'QueueReport'][_0x9d50('0x3d')](_0x3d3c88,_0x172597)[_0x9d50('0x3f')](function(_0x404d75){logger[_0x9d50('0x39')](_0x9d50('0x40'),_0x404d75);});}});}}function endRouting(_0x5c4bd7,_0x3f22e1,_0x537bc8,_0x2bd567){if(_0x5c4bd7&&_0x3f22e1){_0x3f22e1['waiting']-=0x1;var _0x271273={'leaveAt':moment()['format'](_0x9d50('0x3a')),'exitAt':moment()[_0x9d50('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0x9d50('0x3b')](util[_0x9d50('0x15')](_0x9d50('0x41'),_0x5c4bd7,_0x3f22e1[_0x9d50('0x35')]));emitChannelQueueInteraction(_0x537bc8[_0x9d50('0x2e')],_0x3f22e1[_0x9d50('0x35')],_0x537bc8['body'],_0x537bc8[_0x9d50('0xc')]['name'],_0x537bc8[_0x9d50('0x36')]['id'],![],_0x2bd567);if(rpc[_0x537bc8[_0x9d50('0x2e')]+_0x9d50('0x37')]){return rpc[_0x537bc8['channel']+_0x9d50('0x37')][_0x9d50('0x3d')](_0x5c4bd7,_0x271273)['catch'](function(_0x3cf4ee){logger[_0x9d50('0x39')]('update\x20queue\x20report',_0x3cf4ee);});}}}function handleFindQueue(_0x1bd3c6){return function(_0x5c85a4){return _0x5c85a4[_0x9d50('0x35')][_0x9d50('0x42')]()===_0x1bd3c6[_0x9d50('0x42')]();};}exports[_0x9d50('0x43')]=function(_0x143297,_0x1bd653,_0x5708b6,_0x38448f){return function(_0xb45eb7){try{var _0x306a96={'name':_0x1bd653[0x0],'timeout':_0x1bd653[0x1]};var _0x2e0578=queue[_0x9d50('0x44')](_0x306a96,{'typecast':!![]});if(_0x2e0578[_0x9d50('0x45')]){logger[_0x9d50('0x39')](_0x9d50('0x46'),_0x143297,_['map'](_0x2e0578,'message')['join'](',\x20'));_0xb45eb7[_0x9d50('0x47')]();}else{var _0x5d6f58=_['find'](_0x5708b6[_0x38448f[_0x9d50('0x2e')]+_0x9d50('0x48')],handleFindQueue(_0x306a96[_0x9d50('0x35')]));if(_0x5d6f58){startRouting(_0x143297,_0x5d6f58,_0x38448f,_0x5708b6);var _0x52b606=(_0x5d6f58[_0x9d50('0x49')]||0xa)*0x3e8;var _0x479837=(_0x306a96['timeout']||0x14)*0x3e8;var _0x1c41fb;if(_0x52b606>_0x479837){_0x479837=_0x52b606;}var _0x5ec5a2=seqqueue[_0x9d50('0x4a')](_0x52b606);_0x5ec5a2['id']=_0x143297;_0x5ec5a2[_0x9d50('0x4b')]=_0x52b606;_0x5ec5a2['qtimeout']=_0x479837;_0x5ec5a2[_0x9d50('0x2e')]=_0x38448f[_0x9d50('0x2e')];_0x5708b6[_0x9d50('0x4c')][_0x143297]['on']('end',function(){logger[_0x9d50('0x3b')](_0x9d50('0x4d'),_0x143297);stopRouting(_0x143297,_0x5d6f58,_0x38448f,_0x5708b6);clearTimeout(_0x1c41fb);_0x1c41fb=undefined;_0x5ec5a2[_0x9d50('0x4e')](!![]);if(_0x5708b6['rules'][_0x143297]){delete _0x5708b6[_0x9d50('0x4c')][_0x143297];}_0xb45eb7['stop']();});_0x5708b6[_0x9d50('0x4c')][_0x143297]['on'](_0x9d50('0x4f'),function(){if(_0x5708b6['rules'][_0x143297]){delete _0x5708b6['rules'][_0x143297];}});_0x1c41fb=setTimeout(function(){logger[_0x9d50('0x3b')](_0x9d50('0x50'),_0x143297);endRouting(_0x143297,_0x5d6f58,_0x38448f,_0x5708b6);clearTimeout(_0x1c41fb);_0x5ec5a2['close'](!![]);_0xb45eb7[_0x9d50('0x51')]();},_0x479837);switch(_0x5d6f58[_0x9d50('0x52')]){case _0x9d50('0x53'):strategy[_0x9d50('0x53')](_0x5ec5a2,_0x5d6f58,_0x5708b6,_0x38448f);break;default:strategy[_0x9d50('0x54')](_0x5ec5a2,_0x5d6f58,_0x5708b6,_0x38448f);}}else{logger[_0x9d50('0x39')](_0x9d50('0x55'),_0x143297,_0x306a96[_0x9d50('0x35')]);_0xb45eb7[_0x9d50('0x47')]();}}}catch(_0x193ebf){logger[_0x9d50('0x39')]('[%s][QUEUE]\x20%s',_0x143297,_0x193ebf['stack']);_0xb45eb7['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 1cd7cd3..31f05c7 100644 --- a/server/services/routing/server/applications/strategy/agent.js +++ b/server/services/routing/server/applications/strategy/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d0e=['handleTimeout','prototype','handleDrained','debug','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','realtime','busy','busyQueue','saveWaitingNotification','channel','notificationId','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','squeue','push','handleRun','bind'];(function(_0x280899,_0x578f6e){var _0x3f5e38=function(_0x123e52){while(--_0x123e52){_0x280899['push'](_0x280899['shift']());}};_0x3f5e38(++_0x578f6e);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x32d43e,_0x30db72){_0x32d43e=_0x32d43e-0x0;var _0x1fc269=_0x8d0e[_0x32d43e];return _0x1fc269;};'use strict';var _=require(_0xe8d0('0x0'));var uuid=require(_0xe8d0('0x1'));var util=require(_0xe8d0('0x2'));var logger=require(_0xe8d0('0x3'))(_0xe8d0('0x4'));var Agent=function(_0x3584ab,_0x15521e,_0x940176,_0x32cee9){this['notificationId']=uuid['v4']();this[_0xe8d0('0x5')]=_0x3584ab;this['agent']=_0x15521e;this['realtime']=_0x940176;this[_0xe8d0('0x4')]=_0x32cee9;this[_0xe8d0('0x5')][_0xe8d0('0x6')](this[_0xe8d0('0x7')][_0xe8d0('0x8')](this),this[_0xe8d0('0x9')][_0xe8d0('0x8')](this));this[_0xe8d0('0x5')]['on']('timeout',this[_0xe8d0('0x9')][_0xe8d0('0x8')](this));this[_0xe8d0('0x5')]['on']('drained',this['handleDrained'][_0xe8d0('0x8')](this));};Agent[_0xe8d0('0xa')][_0xe8d0('0x6')]=function(){this[_0xe8d0('0x5')][_0xe8d0('0x6')](this[_0xe8d0('0x7')]['bind'](this),this[_0xe8d0('0x9')][_0xe8d0('0x8')](this));};Agent['prototype'][_0xe8d0('0xb')]=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0xe8d0('0x7')]=function(){logger[_0xe8d0('0xc')](_0xe8d0('0xd'),this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0xe')]['id']);if(_[_0xe8d0('0xf')](this['realtime'][_0xe8d0('0x10')][this['agent']['id']])){logger[_0xe8d0('0xc')](_0xe8d0('0x11'),this[_0xe8d0('0x5')]['id'],this['agent']['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this[_0xe8d0('0x4')][_0xe8d0('0x12')]||util[_0xe8d0('0x13')](this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0x14')]['agents'][this[_0xe8d0('0xe')]['id']],this[_0xe8d0('0x5')]['channel'],![])){this['realtime']['agents'][this[_0xe8d0('0xe')]['id']][_0xe8d0('0x15')]=!![];this[_0xe8d0('0x14')][_0xe8d0('0x10')][this[_0xe8d0('0xe')]['id']][_0xe8d0('0x16')]=undefined;util[_0xe8d0('0x17')](this[_0xe8d0('0x14')],this[_0xe8d0('0x4')],this['agent'],this[_0xe8d0('0x5')][_0xe8d0('0x18')]);util['showNotification'](this[_0xe8d0('0x19')],this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0x14')][_0xe8d0('0x10')][this[_0xe8d0('0xe')]['id']],null,this[_0xe8d0('0x4')]);util[_0xe8d0('0x1a')](this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0x14')][_0xe8d0('0x10')][this[_0xe8d0('0xe')]['id']],'RINGING'+(this[_0xe8d0('0x4')][_0xe8d0('0x12')]?_0xe8d0('0x1b'):''));}else{logger['debug'](_0xe8d0('0x1c'),this[_0xe8d0('0x5')]['id'],this['agent']['id']);setTimeout(this[_0xe8d0('0x6')][_0xe8d0('0x8')](this),0x3e8);}}};Agent[_0xe8d0('0xa')][_0xe8d0('0x9')]=function(_0x3cf3d6){if(_['isNil'](this[_0xe8d0('0x14')]['agents'][this['agent']['id']])){return logger['debug'](_0xe8d0('0x11'),this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0xe')]['id']);}else{logger['debug']('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xe8d0('0x5')]['id'],this['agent']['id']);util[_0xe8d0('0x1d')](this[_0xe8d0('0x19')],this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0x14')][_0xe8d0('0x10')][this['agent']['id']],null,this[_0xe8d0('0x4')]);this[_0xe8d0('0x14')][_0xe8d0('0x10')][this[_0xe8d0('0xe')]['id']]['busy']=![];this[_0xe8d0('0x14')][_0xe8d0('0x10')][this['agent']['id']][_0xe8d0('0x16')]=undefined;util['removeWaitingNotification'](this[_0xe8d0('0x14')],this['routing'],this[_0xe8d0('0xe')],this['squeue'][_0xe8d0('0x18')]);util[_0xe8d0('0x1a')](this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0x14')]['agents'][this[_0xe8d0('0xe')]['id']],_0x3cf3d6?_0xe8d0('0x1e'):_0xe8d0('0x1f'));}if(!_0x3cf3d6){setTimeout(this['push'][_0xe8d0('0x8')](this),0x3e8);}};function agent(_0xa02b8d,_0xdfc807,_0x9cb99b,_0x1ecd41){return new Agent(_0xa02b8d,_0xdfc807,_0x9cb99b,_0x1ecd41);}module['exports']=agent; \ No newline at end of file +var _0x5089=['uuid','../../../../../config/logger','routing','notificationId','agent','realtime','push','handleRun','handleTimeout','bind','timeout','squeue','drained','handleDrained','prototype','debug','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','busyQueue','saveWaitingNotification','channel','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','writeLog','STOP','TIMEOUT','exports','lodash'];(function(_0x1597cb,_0x33d3c4){var _0x50e941=function(_0x3f382f){while(--_0x3f382f){_0x1597cb['push'](_0x1597cb['shift']());}};_0x50e941(++_0x33d3c4);}(_0x5089,0x1bb));var _0x9508=function(_0x11ca63,_0xea9f9c){_0x11ca63=_0x11ca63-0x0;var _0x41f1f6=_0x5089[_0x11ca63];return _0x41f1f6;};'use strict';var _=require(_0x9508('0x0'));var uuid=require(_0x9508('0x1'));var util=require('./util');var logger=require(_0x9508('0x2'))(_0x9508('0x3'));var Agent=function(_0x7dd13d,_0x100d7e,_0x172549,_0x59d3ee){this[_0x9508('0x4')]=uuid['v4']();this['squeue']=_0x7dd13d;this[_0x9508('0x5')]=_0x100d7e;this[_0x9508('0x6')]=_0x172549;this[_0x9508('0x3')]=_0x59d3ee;this['squeue'][_0x9508('0x7')](this[_0x9508('0x8')]['bind'](this),this[_0x9508('0x9')][_0x9508('0xa')](this));this['squeue']['on'](_0x9508('0xb'),this['handleTimeout'][_0x9508('0xa')](this));this[_0x9508('0xc')]['on'](_0x9508('0xd'),this[_0x9508('0xe')][_0x9508('0xa')](this));};Agent[_0x9508('0xf')]['push']=function(){this[_0x9508('0xc')]['push'](this[_0x9508('0x8')][_0x9508('0xa')](this),this['handleTimeout'][_0x9508('0xa')](this));};Agent[_0x9508('0xf')][_0x9508('0xe')]=function(){this[_0x9508('0x9')](!![]);};Agent['prototype'][_0x9508('0x8')]=function(){logger[_0x9508('0x10')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x9508('0xc')]['id'],this['agent']['id']);if(_[_0x9508('0x11')](this[_0x9508('0x6')][_0x9508('0x12')][this[_0x9508('0x5')]['id']])){logger[_0x9508('0x10')](_0x9508('0x13'),this[_0x9508('0xc')]['id'],this[_0x9508('0x5')]['id']);setTimeout(this['push'][_0x9508('0xa')](this),0x3e8);}else{if(this[_0x9508('0x3')][_0x9508('0x14')]||util[_0x9508('0x15')](this[_0x9508('0xc')]['id'],this[_0x9508('0x6')]['agents'][this['agent']['id']],this[_0x9508('0xc')]['channel'],![])){this[_0x9508('0x6')]['agents'][this[_0x9508('0x5')]['id']][_0x9508('0x16')]=!![];this[_0x9508('0x6')][_0x9508('0x12')][this[_0x9508('0x5')]['id']][_0x9508('0x17')]=undefined;util[_0x9508('0x18')](this['realtime'],this['routing'],this[_0x9508('0x5')],this[_0x9508('0xc')][_0x9508('0x19')]);util[_0x9508('0x1a')](this[_0x9508('0x4')],this[_0x9508('0xc')]['id'],this['realtime']['agents'][this[_0x9508('0x5')]['id']],null,this['routing']);util['writeLog'](this[_0x9508('0xc')]['id'],this['realtime']['agents'][this[_0x9508('0x5')]['id']],_0x9508('0x1b')+(this['routing'][_0x9508('0x14')]?_0x9508('0x1c'):''));}else{logger[_0x9508('0x10')](_0x9508('0x1d'),this[_0x9508('0xc')]['id'],this[_0x9508('0x5')]['id']);setTimeout(this[_0x9508('0x7')][_0x9508('0xa')](this),0x3e8);}}};Agent[_0x9508('0xf')][_0x9508('0x9')]=function(_0x19a984){if(_['isNil'](this[_0x9508('0x6')][_0x9508('0x12')][this[_0x9508('0x5')]['id']])){return logger['debug'](_0x9508('0x13'),this[_0x9508('0xc')]['id'],this['agent']['id']);}else{logger[_0x9508('0x10')](_0x9508('0x1e'),this['squeue']['id'],this[_0x9508('0x5')]['id']);util[_0x9508('0x1f')](this[_0x9508('0x4')],this[_0x9508('0xc')]['id'],this['realtime']['agents'][this[_0x9508('0x5')]['id']],null,this[_0x9508('0x3')]);this[_0x9508('0x6')]['agents'][this['agent']['id']][_0x9508('0x16')]=![];this[_0x9508('0x6')][_0x9508('0x12')][this[_0x9508('0x5')]['id']][_0x9508('0x17')]=undefined;util[_0x9508('0x20')](this[_0x9508('0x6')],this[_0x9508('0x3')],this[_0x9508('0x5')],this[_0x9508('0xc')]['channel']);util[_0x9508('0x21')](this[_0x9508('0xc')]['id'],this['realtime'][_0x9508('0x12')][this[_0x9508('0x5')]['id']],_0x19a984?_0x9508('0x22'):_0x9508('0x23'));}if(!_0x19a984){setTimeout(this[_0x9508('0x7')][_0x9508('0xa')](this),0x3e8);}};function agent(_0x33e17c,_0x3700f1,_0xfb6676,_0x98ff75){return new Agent(_0x33e17c,_0x3700f1,_0xfb6676,_0x98ff75);}module[_0x9508('0x24')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 9ba0dc4..6b8b0ee 100644 --- a/server/services/routing/server/applications/strategy/beepall.js +++ b/server/services/routing/server/applications/strategy/beepall.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe4e=['saveWaitingNotification','channel','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','debug','[%s][QUEUE]\x20EMPTY','hideNotification','busyQueue','uuid','./util','routing','notificationId','squeue','queue','realtime','push','handleTimeout','bind','timeout','drained','prototype','handleDrained','handleRun','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog','RINGING','busy'];(function(_0x1698ef,_0x2c0531){var _0x407b52=function(_0x4d3ad6){while(--_0x4d3ad6){_0x1698ef['push'](_0x1698ef['shift']());}};_0x407b52(++_0x2c0531);}(_0xfe4e,0x1e8));var _0xefe4=function(_0x95cf71,_0x597e5b){_0x95cf71=_0x95cf71-0x0;var _0x979b54=_0xfe4e[_0x95cf71];return _0x979b54;};'use strict';var _=require('lodash');var uuid=require(_0xefe4('0x0'));var util=require(_0xefe4('0x1'));var logger=require('../../../../../config/logger')(_0xefe4('0x2'));var Beepall=function(_0x1bcd8e,_0x2a46c8,_0x22f2d2,_0x1f76f6){this[_0xefe4('0x3')]=uuid['v4']();this[_0xefe4('0x4')]=_0x1bcd8e;this[_0xefe4('0x5')]=_0x2a46c8;this[_0xefe4('0x6')]=_0x22f2d2;this[_0xefe4('0x2')]=_0x1f76f6;this[_0xefe4('0x4')][_0xefe4('0x7')](this['handleRun']['bind'](this),this[_0xefe4('0x8')][_0xefe4('0x9')](this));this[_0xefe4('0x4')]['on'](_0xefe4('0xa'),this[_0xefe4('0x8')][_0xefe4('0x9')](this));this[_0xefe4('0x4')]['on'](_0xefe4('0xb'),this['handleDrained']['bind'](this));};Beepall['prototype'][_0xefe4('0x7')]=function(){this[_0xefe4('0x4')][_0xefe4('0x7')](this['handleRun'][_0xefe4('0x9')](this),this[_0xefe4('0x8')][_0xefe4('0x9')](this));};Beepall[_0xefe4('0xc')][_0xefe4('0xd')]=function(){this[_0xefe4('0x8')](!![]);};Beepall[_0xefe4('0xc')][_0xefe4('0xe')]=function(){var _0x286299=!![];if(!_[_0xefe4('0xf')](this[_0xefe4('0x5')])&&!_[_0xefe4('0xf')](this['queue'][_0xefe4('0x10')])&&this[_0xefe4('0x5')][_0xefe4('0x10')][_0xefe4('0x11')]>0x0){for(var _0x44171f=0x0,_0x54cd88;_0x44171f0x0){for(var _0x1de718=0x0,_0x40f344;_0x1de7180x0&&_0x483f04[_0x3a686a+_0x3450('0x21')]>=_0x483f04[_0x3a686a+'Capacity']){writeLog(_0x263154,_0x483f04,_0x3a686a[_0x3450('0x22')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x3450('0x23')]=function(_0x6f83a7,_0x1e36ef,_0x446289,_0x427002,_0x51ff61){return sendNotification(!![],_0x6f83a7,_0x1e36ef,_0x446289,_0x427002,_0x51ff61);};exports[_0x3450('0x24')]=function(_0xfadde1,_0x3874f8,_0x21f009,_0x4466ff,_0x2dc089){return sendNotification(![],_0xfadde1,_0x3874f8,_0x21f009,_0x4466ff,_0x2dc089);};exports['checkWaitingNotifications']=function(_0x14b2d2,_0x47fbf0,_0x26f6e2){var _0xd738a7=_0x47fbf0[_0x3450('0x25')][_0x3450('0x26')];if(!_0xd738a7&&_0x26f6e2){_0xd738a7=_0x26f6e2['id'];}var _0x3804af=_[_0x3450('0x27')](_0x14b2d2[_0x47fbf0[_0x3450('0x28')]+_0x3450('0x29')],function(_0x29fe16){var _0x4378a5=_[_0x3450('0x2a')](_0x47fbf0[_0x3450('0x28')])+_0x3450('0x2b');return _0x29fe16[_0x4378a5]===_0x47fbf0[_0x3450('0x25')]['id'];});if(!_0x3804af&&_0xd738a7&&_0x14b2d2['agents'][_0xd738a7]){_0x3804af=_[_0x3450('0x27')](_0x14b2d2[_0x3450('0x2c')][_0xd738a7][_0x47fbf0['channel']+_0x3450('0x2d')],function(_0x91f820){return _0x91f820['id']===_0x47fbf0[_0x3450('0x25')]['id'];});}return _0x3804af;};exports['saveWaitingNotification']=function(_0x20b2e4,_0xb8f07c,_0x5a15c6,_0x29d817){if(_0x5a15c6&&_0x5a15c6['id']&&_0x20b2e4[_0x3450('0x2c')]&&_0x20b2e4['agents'][_0x5a15c6['id']]){_0x20b2e4['agents'][_0x5a15c6['id']][_0x29d817+_0x3450('0x2d')][_0xb8f07c[_0x3450('0x15')]['id']]={'id':_0xb8f07c['interaction']['id']};}};exports[_0x3450('0x2e')]=function(_0x11dbe8,_0x312889,_0x357dfd,_0x1091ef){if(_0x357dfd&&_0x357dfd['id']&&_0x11dbe8[_0x3450('0x2c')]&&_0x11dbe8[_0x3450('0x2c')][_0x357dfd['id']]){delete _0x11dbe8[_0x3450('0x2c')][_0x357dfd['id']][_0x1091ef+'WaitingInteractions'][_0x312889[_0x3450('0x15')]['id']];}};exports['writeLog']=writeLog; \ No newline at end of file +var _0x22ab=['hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','interaction','UserId','some','QueuesWaitingInteractions','capitalize','channel','agents','WaitingInteractions','saveWaitingNotification','message','removeWaitingNotification','writeLog','lodash','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','redis','localhost','socket.io-emitter','split','\x20interaction','name','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','error','format','[%s][QUEUE]\x20%s','user:%s','emit','notification:%s','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','Pause','PAUSE'];(function(_0x113edd,_0x43270e){var _0x8ae2fd=function(_0x58a77a){while(--_0x58a77a){_0x113edd['push'](_0x113edd['shift']());}};_0x8ae2fd(++_0x43270e);}(_0x22ab,0x78));var _0xb22a=function(_0x44c37d,_0x19119f){_0x44c37d=_0x44c37d-0x0;var _0x29e087=_0x22ab[_0x44c37d];return _0x29e087;};'use strict';var _=require(_0xb22a('0x0'));var util=require(_0xb22a('0x1'));var utils=require(_0xb22a('0x2'));var Redis=require(_0xb22a('0x3'));var config=require(_0xb22a('0x4'));var logger=require(_0xb22a('0x5'))('routing');config['redis']=_['defaults'](config[_0xb22a('0x6')],{'host':_0xb22a('0x7'),'port':0x18eb});var io=require(_0xb22a('0x8'))(new Redis(config[_0xb22a('0x6')]));function sendNotification(_0x1daebb,_0x3d02c9,_0x57c439,_0x3b74f6,_0x47665e,_0x62e619){var _0x3bcc61=_0x62e619||{};var _0x185eaa=_0x57c439[_0xb22a('0x9')]('.');var _0x35e145={'uniqueid':_0x3d02c9,'channel':_0x185eaa[0x0],'id':_0x185eaa[0x1],'title':_0x185eaa[0x0]+_0xb22a('0xa'),'interactionId':_0x185eaa[0x2],'queue':_0x47665e?_0x47665e[_0xb22a('0xb')]:null,'sound':_0x3bcc61[_0xb22a('0xc')][_0xb22a('0xd')],'shake':_0x3bcc61[_0xb22a('0xc')][_0xb22a('0xe')]};try{if(!_0x3bcc61[_0xb22a('0xf')]){_0x3bcc61[_0xb22a('0xf')]={};}if(_0x47665e){_0x3bcc61[_0xb22a('0xf')]['queue']=_0x47665e;}else if(_0x3bcc61[_0xb22a('0xf')][_0xb22a('0x10')]){delete _0x3bcc61[_0xb22a('0xf')]['queue'];}_0x35e145[_0xb22a('0x11')]=utils[_0xb22a('0x12')](_0x3bcc61[_0xb22a('0xc')][_0xb22a('0x13')],_0x3bcc61);}catch(_0x531bc2){_0x35e145[_0xb22a('0x11')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0xb22a('0x14')](util[_0xb22a('0x15')](_0xb22a('0x16'),_0x3d02c9,_0x531bc2['message']));}io['to'](util[_0xb22a('0x15')](_0xb22a('0x17'),_0x3b74f6[_0xb22a('0xb')]))[_0xb22a('0x18')](util[_0xb22a('0x15')](_0xb22a('0x19'),_0x1daebb?'save':'remove'),_0x35e145);}function writeLog(_0x48c98e,_0x3c6497,_0x4475b3){return logger['debug'](util[_0xb22a('0x15')](_0xb22a('0x1a'),_0x48c98e,_0x3c6497['name'],_0x4475b3));}exports[_0xb22a('0x1b')]=function(_0x39c586,_0x486e3c,_0x3586b1,_0x3d176b){if(_0x486e3c[_0xb22a('0x1c')]){writeLog(_0x39c586,_0x486e3c,_0xb22a('0x1d'));return![];}if(!_0x486e3c[_0xb22a('0x1e')]){writeLog(_0x39c586,_0x486e3c,'OFFLINE');return![];}if(_0x486e3c[_0x3586b1+_0xb22a('0x1f')]){writeLog(_0x39c586,_0x486e3c,_0xb22a('0x20'));return![];}if(_0x3d176b&&_0x486e3c[_0xb22a('0x21')](_0x3586b1+_0xb22a('0x22'))&&_0x486e3c[_0xb22a('0x21')](_0x3586b1+_0xb22a('0x23'))){if(_0x486e3c[_0x3586b1+'Capacity']>0x0&&_0x486e3c[_0x3586b1+'CurrentCapacity']>=_0x486e3c[_0x3586b1+'Capacity']){writeLog(_0x39c586,_0x486e3c,_0x3586b1[_0xb22a('0x24')]()+_0xb22a('0x25'));return![];}}return!![];};exports['showNotification']=function(_0x3b8f4a,_0x4c0bf8,_0x25f1ec,_0x18956b,_0x53bf5f){return sendNotification(!![],_0x3b8f4a,_0x4c0bf8,_0x25f1ec,_0x18956b,_0x53bf5f);};exports[_0xb22a('0x26')]=function(_0xe940a3,_0x246e02,_0x3c7f67,_0x45084e,_0x480cce){return sendNotification(![],_0xe940a3,_0x246e02,_0x3c7f67,_0x45084e,_0x480cce);};exports['checkWaitingNotifications']=function(_0x317b48,_0x1fc24e,_0x48590b){var _0x7bc169=_0x1fc24e[_0xb22a('0x27')][_0xb22a('0x28')];if(!_0x7bc169&&_0x48590b){_0x7bc169=_0x48590b['id'];}var _0x33fd91=_[_0xb22a('0x29')](_0x317b48[_0x1fc24e['channel']+_0xb22a('0x2a')],function(_0x3ac208){var _0x89ef57=_[_0xb22a('0x2b')](_0x1fc24e[_0xb22a('0x2c')])+'InteractionId';return _0x3ac208[_0x89ef57]===_0x1fc24e[_0xb22a('0x27')]['id'];});if(!_0x33fd91&&_0x7bc169&&_0x317b48[_0xb22a('0x2d')][_0x7bc169]){_0x33fd91=_[_0xb22a('0x29')](_0x317b48[_0xb22a('0x2d')][_0x7bc169][_0x1fc24e['channel']+_0xb22a('0x2e')],function(_0x58190f){return _0x58190f['id']===_0x1fc24e['interaction']['id'];});}return _0x33fd91;};exports[_0xb22a('0x2f')]=function(_0x1fb9d8,_0x5f275f,_0x9d26ad,_0x261a42){if(_0x9d26ad&&_0x9d26ad['id']&&_0x1fb9d8[_0xb22a('0x2d')]&&_0x1fb9d8[_0xb22a('0x2d')][_0x9d26ad['id']]){_0x1fb9d8[_0xb22a('0x2d')][_0x9d26ad['id']][_0x261a42+_0xb22a('0x2e')][_0x5f275f[_0xb22a('0x30')]['id']]={'id':_0x5f275f['interaction']['id']};}};exports[_0xb22a('0x31')]=function(_0x1ace5e,_0x715e7d,_0x1d3d6e,_0x2de1b8){if(_0x1d3d6e&&_0x1d3d6e['id']&&_0x1ace5e['agents']&&_0x1ace5e[_0xb22a('0x2d')][_0x1d3d6e['id']]){delete _0x1ace5e[_0xb22a('0x2d')][_0x1d3d6e['id']][_0x2de1b8+_0xb22a('0x2e')][_0x715e7d[_0xb22a('0x30')]['id']];}};exports[_0xb22a('0x32')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index d894225..c1cddd3 100644 --- a/server/services/routing/server/applications/system.js +++ b/server/services/routing/server/applications/system.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a13=['isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x8a13,0xd6));var _0x38a1=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0x8a13[_0x59befa];return _0x1dd63d;};'use strict';var schema=require(_0x38a1('0x0'));var sh=require(_0x38a1('0x1'));var _=require(_0x38a1('0x2'));var utils=require(_0x38a1('0x3'));var logger=require(_0x38a1('0x4'))(_0x38a1('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0x38a1('0x6')}});exports[_0x38a1('0x7')]=function(_0x397f8d,_0x10b66e){return function(_0x2ccc1a){try{var _0x1bf204={'command':_0x10b66e[0x0]};var _0x4d4fcd=system['validate'](_0x1bf204,{'typecast':!![]});if(_0x4d4fcd[_0x38a1('0x8')]){logger[_0x38a1('0x9')](_0x38a1('0xa'),_0x397f8d,_[_0x38a1('0xb')](_0x4d4fcd,'message')['join'](',\x20'));logger[_0x38a1('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x397f8d);_0x2ccc1a[_0x38a1('0xd')]();}else{var _0x3e6f3d=this;var _0xf7c34e=utils[_0x38a1('0xe')](_0x10b66e[0x0],this);logger[_0x38a1('0xc')](_0x38a1('0xf'),_0x397f8d,_0xf7c34e);sh[_0x38a1('0x10')](_['trim'](_0xf7c34e),function(_0x4e4c11,_0xc46104){logger[_0x38a1('0xc')](_0x38a1('0x11'),_0x397f8d,_0x4e4c11);if(_0x4e4c11==0x0){var _0x9eb9e5=_0xc46104[_0x38a1('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x38a1('0x13')](_0x10b66e[0x1])||_[_0x38a1('0x14')](_0x10b66e[0x1])){logger[_0x38a1('0xc')]('[%s][SYSTEM]\x20no\x20variable',_0x397f8d);_0x3e6f3d[_0x38a1('0x15')][_0x10b66e[0x1]]=_0x9eb9e5;}else{logger[_0x38a1('0xc')](_0x38a1('0x16'),_0x397f8d,_0x10b66e[0x1],_0x9eb9e5);_0x3e6f3d[_0x38a1('0x15')][_0x10b66e[0x1]]=_0x9eb9e5;}}_0x2ccc1a[_0x38a1('0xd')]();});}}catch(_0x3412f7){logger[_0x38a1('0x9')]('[%s][SYSTEM]\x20%s',_0x397f8d,_[_0x38a1('0x17')](_0x3412f7)?JSON[_0x38a1('0x18')](_0x3412f7):_0x3412f7);logger[_0x38a1('0xc')](_0x38a1('0x19'),_0x397f8d);_0x2ccc1a[_0x38a1('0xd')]();}};}; \ No newline at end of file +var _0xae5e=['isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xae5e,0x1d2));var _0xeae5=function(_0x55d83c,_0xb0a29){_0x55d83c=_0x55d83c-0x0;var _0x404671=_0xae5e[_0x55d83c];return _0x404671;};'use strict';var schema=require(_0xeae5('0x0'));var sh=require('shelljs');var _=require('lodash');var utils=require(_0xeae5('0x1'));var logger=require(_0xeae5('0x2'))(_0xeae5('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0xeae5('0x4')}});exports['consequence']=function(_0xefba31,_0x53d165){return function(_0x46515e){try{var _0x2b2391={'command':_0x53d165[0x0]};var _0x4728dd=system[_0xeae5('0x0')](_0x2b2391,{'typecast':!![]});if(_0x4728dd[_0xeae5('0x5')]){logger['error'](_0xeae5('0x6'),_0xefba31,_[_0xeae5('0x7')](_0x4728dd,'message')[_0xeae5('0x8')](',\x20'));logger[_0xeae5('0x9')](_0xeae5('0xa'),_0xefba31);_0x46515e[_0xeae5('0xb')]();}else{var _0x3d3e4e=this;var _0x118706=utils[_0xeae5('0xc')](_0x53d165[0x0],this);logger[_0xeae5('0x9')](_0xeae5('0xd'),_0xefba31,_0x118706);sh[_0xeae5('0xe')](_['trim'](_0x118706),function(_0x93ce8,_0x4c1bc7){logger[_0xeae5('0x9')](_0xeae5('0xf'),_0xefba31,_0x93ce8);if(_0x93ce8==0x0){var _0x2cdbc4=_0x4c1bc7['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xeae5('0x10')](_0x53d165[0x1])||_[_0xeae5('0x11')](_0x53d165[0x1])){logger['info'](_0xeae5('0x12'),_0xefba31);_0x3d3e4e[_0xeae5('0x13')][_0x53d165[0x1]]=_0x2cdbc4;}else{logger[_0xeae5('0x9')](_0xeae5('0x14'),_0xefba31,_0x53d165[0x1],_0x2cdbc4);_0x3d3e4e[_0xeae5('0x13')][_0x53d165[0x1]]=_0x2cdbc4;}}_0x46515e[_0xeae5('0xb')]();});}}catch(_0x734fc0){logger['error']('[%s][SYSTEM]\x20%s',_0xefba31,_[_0xeae5('0x15')](_0x734fc0)?JSON[_0xeae5('0x16')](_0x734fc0):_0x734fc0);logger[_0xeae5('0x9')](_0xeae5('0xa'),_0xefba31);_0x46515e[_0xeae5('0xb')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index e07d506..b38675b 100644 --- a/server/services/routing/server/applications/tag.js +++ b/server/services/routing/server/applications/tag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x195e=['Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','next','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel'];(function(_0xe1346d,_0x296c8b){var _0x11ccec=function(_0x50799f){while(--_0x50799f){_0xe1346d['push'](_0xe1346d['shift']());}};_0x11ccec(++_0x296c8b);}(_0x195e,0xe9));var _0xe195=function(_0xf32008,_0x461060){_0xf32008=_0xf32008-0x0;var _0x6be258=_0x195e[_0xf32008];return _0x6be258;};'use strict';var schema=require(_0xe195('0x0'));var _=require(_0xe195('0x1'));var rpc={'chatInteraction':require(_0xe195('0x2')),'openchannelInteraction':require(_0xe195('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xe195('0x4')),'faxInteraction':require(_0xe195('0x5')),'whatsappInteraction':require(_0xe195('0x6'))};var logger=require(_0xe195('0x7'))(_0xe195('0x8'));var tag=schema({'tag':{'type':_0xe195('0x9'),'required':!![],'message':_0xe195('0xa')}});exports[_0xe195('0xb')]=function(_0x2b5014,_0x4cf9b1,_0x39636b,_0xd1258d){return function(_0x569c09){try{var _0x39215c={'tag':_0x4cf9b1[0x0]};var _0x123b39=tag[_0xe195('0x0')](_0x39215c,{'typecast':!![]});if(_0x123b39[_0xe195('0xc')]){logger[_0xe195('0xd')](_0xe195('0xe'),_0x2b5014,_['map'](_0x123b39,'message')[_0xe195('0xf')](',\x20'));logger[_0xe195('0x10')](_0xe195('0x11'),_0x2b5014);_0x569c09['next']();}else{var _0x3c27de={'ids':[_0x4cf9b1[0x0]]};if(rpc[_0xd1258d[_0xe195('0x12')]+_0xe195('0x13')]){rpc[_0xd1258d[_0xe195('0x12')]+_0xe195('0x13')]['addTags'](_0xd1258d[_0xe195('0x14')]['id'],_0x3c27de)[_0xe195('0x15')](function(_0x34c1b3){logger[_0xe195('0x10')](_0xe195('0x16'),_0x2b5014,_0x4cf9b1[0x1],_0xd1258d['channel'],_0xd1258d[_0xe195('0x14')]['id']);})[_0xe195('0x17')](function(_0x48f9cb){logger[_0xe195('0xd')](_0xe195('0xe'),_0x2b5014,JSON[_0xe195('0x18')](_0x48f9cb));logger['info'](_0xe195('0x11'),_0x2b5014);})[_0xe195('0x19')](function(){_0x569c09[_0xe195('0x1a')]();});}}}catch(_0x4c70f3){logger[_0xe195('0xd')](_0xe195('0xe'),_0x2b5014,_[_0xe195('0x1b')](_0x4c70f3)?JSON[_0xe195('0x18')](_0x4c70f3):_0x4c70f3);logger[_0xe195('0x10')](_0xe195('0x11'),_0x2b5014);_0x569c09[_0xe195('0x1a')]();}};}; \ No newline at end of file +var _0x51e3=['next','channel','Interaction','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x51e3,0x1d6));var _0x351e=function(_0x2c1ed4,_0x5b93e7){_0x2c1ed4=_0x2c1ed4-0x0;var _0x5cf40d=_0x51e3[_0x2c1ed4];return _0x5cf40d;};'use strict';var schema=require(_0x351e('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x351e('0x1')),'openchannelInteraction':require(_0x351e('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x351e('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x351e('0x4'))};var logger=require(_0x351e('0x5'))(_0x351e('0x6'));var tag=schema({'tag':{'type':_0x351e('0x7'),'required':!![],'message':_0x351e('0x8')}});exports[_0x351e('0x9')]=function(_0x4321d1,_0x2c5172,_0xb0e2d2,_0x34c62b){return function(_0x59a165){try{var _0x436855={'tag':_0x2c5172[0x0]};var _0x170add=tag[_0x351e('0x0')](_0x436855,{'typecast':!![]});if(_0x170add['length']){logger[_0x351e('0xa')](_0x351e('0xb'),_0x4321d1,_[_0x351e('0xc')](_0x170add,_0x351e('0xd'))[_0x351e('0xe')](',\x20'));logger['info'](_0x351e('0xf'),_0x4321d1);_0x59a165[_0x351e('0x10')]();}else{var _0x44b971={'ids':[_0x2c5172[0x0]]};if(rpc[_0x34c62b[_0x351e('0x11')]+_0x351e('0x12')]){rpc[_0x34c62b[_0x351e('0x11')]+_0x351e('0x12')][_0x351e('0x13')](_0x34c62b[_0x351e('0x14')]['id'],_0x44b971)[_0x351e('0x15')](function(_0x2c530d){logger[_0x351e('0x16')](_0x351e('0x17'),_0x4321d1,_0x2c5172[0x1],_0x34c62b[_0x351e('0x11')],_0x34c62b['interaction']['id']);})[_0x351e('0x18')](function(_0x2e7408){logger['error'](_0x351e('0xb'),_0x4321d1,JSON[_0x351e('0x19')](_0x2e7408));logger[_0x351e('0x16')](_0x351e('0xf'),_0x4321d1);})[_0x351e('0x1a')](function(){_0x59a165[_0x351e('0x10')]();});}}}catch(_0x42a0e1){logger[_0x351e('0xa')]('[%s][TAG]\x20%s',_0x4321d1,_['isObject'](_0x42a0e1)?JSON['stringify'](_0x42a0e1):_0x42a0e1);logger[_0x351e('0x16')](_0x351e('0xf'),_0x4321d1);_0x59a165['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index e33e84e..e7f8cc1 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe434=['logged','&serviceId=','&data=','then','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','title','jsonrpc','2.0','method','login','stringify','POST','result'];(function(_0x3d7d68,_0x2e5967){var _0x43c8f4=function(_0x49f5cc){while(--_0x49f5cc){_0x3d7d68['push'](_0x3d7d68['shift']());}};_0x43c8f4(++_0x2e5967);}(_0xe434,0x191));var _0x4e43=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xe434[_0x46aff0];return _0x9d78cf;};'use strict';var rp=require(_0x4e43('0x0'));var logger=require(_0x4e43('0x1'))(_0x4e43('0x2'));var _=require(_0x4e43('0x3'));var arr=[];exports[_0x4e43('0x4')]=function(_0x5415fa,_0x1e43e4){return function(_0x124373){var _0x34b2af=_0x1e43e4[0xa];var _0x56f2f3=_0x1e43e4[0xb];var _0x131154=_0x1e43e4[0xc];var _0x334c7c=_0x1e43e4[0xd];var _0x3c264e=_0x1e43e4[0xe];var _0xeadf3b=_0x1e43e4[0xf][_0x4e43('0x5')](/\n/g,_0x4e43('0x6'));var _0x2acdf4=_0x1e43e4[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x4e43('0x7')](_0x56f2f3)){arr[_0x4e43('0x8')](_0x56f2f3);var _0xe3d87=_0x1e43e4[0x3];var _0x134f2e=_0x1e43e4[0x4];var _0x2665f7=_0x1e43e4[0x1];var _0x567764=_0x1e43e4[0x0];var _0x5a675e={};_0x5a675e[_0x4e43('0x9')]=_0x1e43e4[0x8]+_0x4e43('0xa')+_0x131154+'|'+_0x34b2af+'|'+_0x334c7c+'|'+_0x56f2f3+'|'+_0x3c264e;_0x5a675e['urlOnRing']=_0x1e43e4[0x7]+'?params='+_0x131154+'|'+_0x34b2af+'|'+_0x334c7c+'|'+_0x56f2f3+'|'+_0x3c264e+'|'+_0xeadf3b+'|'+_0x2acdf4;_0x5a675e[_0x4e43('0xb')]=_0x1e43e4[0x9];var _0x51f7ca={};_0x51f7ca[_0x4e43('0xc')]=_0x4e43('0xd');_0x51f7ca[_0x4e43('0xe')]=_0x4e43('0xf');var _0x5ecc6b=[];_0x5ecc6b['push'](_0x1e43e4[0x2]);_0x5ecc6b[_0x4e43('0x8')](_0x1e43e4[0x5]);_0x5ecc6b[_0x4e43('0x8')](_0x1e43e4[0x6]);_0x51f7ca['params']=_0x5ecc6b;_0x51f7ca['id']=0x1;var _0x1fc059=JSON[_0x4e43('0x10')](_0x51f7ca);var _0x537e83={'encoding':'utf8','method':_0x4e43('0x11'),'timeout':0x2710,'url':_0xe3d87,'headers':{'Content-Type':'application/json-rpc'},'body':_0x1fc059};return rp(_0x537e83)['then'](function(_0x1c4a06){const _0x4a4674=JSON['parse'](_0x1c4a06);if(!_0x4a4674[_0x4e43('0x12')][_0x4e43('0x13')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x1a7b4e=_0x56f2f3;var _0x3f5a75='channelId='+_0x2665f7+_0x4e43('0x14')+_0x567764+'&sessionId='+_0x1a7b4e+_0x4e43('0x15')+JSON['stringify'](_0x5a675e);var _0x341dd6=_0x134f2e+'?'+_0x3f5a75;return rp(_0x341dd6);})[_0x4e43('0x16')](function(_0x26e8cc){logger[_0x4e43('0x17')](_0x4e43('0x18'),_0x5415fa,_0x26e8cc);_0x124373[_0x4e43('0x19')]();})[_0x4e43('0x1a')](function(_0x4fd76b){logger[_0x4e43('0x1b')](_0x4e43('0x1c'),_0x5415fa,_['isObject'](_0x4fd76b)?JSON[_0x4e43('0x10')](_0x4fd76b):_0x4fd76b);_0x124373[_0x4e43('0x19')]();});}else{logger[_0x4e43('0x17')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x5415fa);_0x124373[_0x4e43('0x1d')]();}};}; \ No newline at end of file +var _0x29d4=['title','jsonrpc','2.0','login','stringify','utf8','POST','application/json-rpc','then','result','logged','channelId=','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','routing','consequence','\x20-\x20','replace','includes','push','urlOnAnswer','?params='];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x29d4,0xef));var _0x429d=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x29d4[_0x9aada2];return _0x196dff;};'use strict';var rp=require('request-promise');var logger=require(_0x429d('0x0'))(_0x429d('0x1'));var _=require('lodash');var arr=[];exports[_0x429d('0x2')]=function(_0x879166,_0x4b5a5b){return function(_0x3313c7){var _0x2c9c99=_0x4b5a5b[0xa];var _0x56f910=_0x4b5a5b[0xb];var _0x5775fb=_0x4b5a5b[0xc];var _0x285769=_0x4b5a5b[0xd];var _0x7adf95=_0x4b5a5b[0xe];var _0x2e01e0=_0x4b5a5b[0xf]['replace'](/\n/g,_0x429d('0x3'));var _0x30be43=_0x4b5a5b[0x10][_0x429d('0x4')](/\n/g,'\x20');if(!arr[_0x429d('0x5')](_0x56f910)){arr[_0x429d('0x6')](_0x56f910);var _0x21032d=_0x4b5a5b[0x3];var _0x214854=_0x4b5a5b[0x4];var _0x45ea84=_0x4b5a5b[0x1];var _0xa73e9f=_0x4b5a5b[0x0];var _0x5bd12a={};_0x5bd12a[_0x429d('0x7')]=_0x4b5a5b[0x8]+_0x429d('0x8')+_0x5775fb+'|'+_0x2c9c99+'|'+_0x285769+'|'+_0x56f910+'|'+_0x7adf95;_0x5bd12a['urlOnRing']=_0x4b5a5b[0x7]+_0x429d('0x8')+_0x5775fb+'|'+_0x2c9c99+'|'+_0x285769+'|'+_0x56f910+'|'+_0x7adf95+'|'+_0x2e01e0+'|'+_0x30be43;_0x5bd12a[_0x429d('0x9')]=_0x4b5a5b[0x9];var _0x10d086={};_0x10d086[_0x429d('0xa')]=_0x429d('0xb');_0x10d086['method']=_0x429d('0xc');var _0x16cc31=[];_0x16cc31[_0x429d('0x6')](_0x4b5a5b[0x2]);_0x16cc31['push'](_0x4b5a5b[0x5]);_0x16cc31['push'](_0x4b5a5b[0x6]);_0x10d086['params']=_0x16cc31;_0x10d086['id']=0x1;var _0x15df6b=JSON[_0x429d('0xd')](_0x10d086);var _0x5d99a3={'encoding':_0x429d('0xe'),'method':_0x429d('0xf'),'timeout':0x2710,'url':_0x21032d,'headers':{'Content-Type':_0x429d('0x10')},'body':_0x15df6b};return rp(_0x5d99a3)[_0x429d('0x11')](function(_0x230128){const _0x4f2739=JSON['parse'](_0x230128);if(!_0x4f2739[_0x429d('0x12')][_0x429d('0x13')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x2c3516=_0x56f910;var _0x25abf7=_0x429d('0x14')+_0x45ea84+'&serviceId='+_0xa73e9f+_0x429d('0x15')+_0x2c3516+_0x429d('0x16')+JSON[_0x429d('0xd')](_0x5bd12a);var _0x3e6f87=_0x214854+'?'+_0x25abf7;return rp(_0x3e6f87);})['then'](function(_0x587bff){logger['info'](_0x429d('0x17'),_0x879166,_0x587bff);_0x3313c7[_0x429d('0x18')]();})[_0x429d('0x19')](function(_0x56644c){logger[_0x429d('0x1a')]('[%s][TVOX]\x20%s',_0x879166,_[_0x429d('0x1b')](_0x56644c)?JSON['stringify'](_0x56644c):_0x56644c);_0x3313c7[_0x429d('0x18')]();});}else{logger[_0x429d('0x1c')](_0x429d('0x1d'),_0x879166);_0x3313c7[_0x429d('0x1e')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 4aec888..b3e5bea 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x55a858,_0x1fd254){var _0x3fc987=function(_0x564d5e){while(--_0x564d5e){_0x55a858['push'](_0x55a858['shift']());}};_0x3fc987(++_0x1fd254);}(_0xe706,0xa3));var _0x6e70=function(_0x5089ea,_0x3d8378){_0x5089ea=_0x5089ea-0x0;var _0xabe953=_0xe706[_0x5089ea];return _0xabe953;};'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 _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x388526,_0x1dba9d){var _0x2e76b0=function(_0x2a450a){while(--_0x2a450a){_0x388526['push'](_0x388526['shift']());}};_0x2e76b0(++_0x1dba9d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 982d7f5..7271b92 100644 --- a/server/services/routing/server/index.js +++ b/server/services/routing/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x96f2=['length','existsSync','join','.js','app','push','slice','appdata','split','dialogflowv2','amazonlex','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','rules','execute','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','update','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','./applications/strategy/util','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','channel','message','interaction','checkWaitingNotifications','transfer','isArray','applications'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x96f2,0xb0));var _0x296f=function(_0x378549,_0x263305){_0x378549=_0x378549-0x0;var _0x2c4e75=_0x96f2[_0x378549];return _0x2c4e75;};'use strict';var _=require(_0x296f('0x0'));var util=require('util');var path=require(_0x296f('0x1'));var fs=require('fs');var jayson=require(_0x296f('0x2'));var BPromise=require(_0x296f('0x3'));var utils=require('./applications/utils');var sUtils=require(_0x296f('0x4'));var logger=require(_0x296f('0x5'))(_0x296f('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x296f('0x7')),'chatQueueReport':require(_0x296f('0x8')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x296f('0x9'))};var RuleEngine=require(_0x296f('0xa'));function getId(_0x2dc0ca,_0x28f708,_0x30ed43){return util[_0x296f('0xb')](_0x296f('0xc'),_0x2dc0ca,_0x28f708||0x0,_0x30ed43||0x0);}function getIntervals(_0x3ea699,_0x2f81ac){var _0x3729ab=[];if(!_['isNil'](_0x2f81ac[_0x296f('0xd')])&&!_[_0x296f('0xe')](_0x3ea699[_0x2f81ac[_0x296f('0xd')]])&&!_['isNil'](_0x3ea699[_0x2f81ac[_0x296f('0xd')]][_0x296f('0xf')])){_0x3729ab=_[_0x296f('0x10')](_0x3ea699[_0x2f81ac[_0x296f('0xd')]]['Intervals'],'interval');}else if(!_['isNil'](_0x2f81ac[_0x296f('0x11')])){_0x3729ab=[_0x2f81ac[_0x296f('0x11')]];}return _0x3729ab;}exports[_0x296f('0x12')]=function(_0xe843fc){_0xe843fc['rules']={};return new BPromise(function(_0xac5d0,_0x496675){var _0x4e0b88={'Start':function(_0x367e03){var _0x2ae0f4=this;return new Promise(function(_0x33654c,_0xa3d57a){if(_0x367e03){try{var _0x4cfa9a=[];var _0x4a2aaa=getId(_0x367e03[_0x296f('0x13')],_0x367e03['message']?_0x367e03[_0x296f('0x14')]['id']:0x0,_0x367e03[_0x296f('0x15')]?_0x367e03[_0x296f('0x15')]['id']:0x0);var _0x48725e=sUtils[_0x296f('0x16')](_0xe843fc,_0x367e03);if(_0x367e03[_0x296f('0x17')]||!_0x48725e&&_0x367e03['applications']&&_[_0x296f('0x18')](_0x367e03[_0x296f('0x19')])&&_0x367e03[_0x296f('0x19')][_0x296f('0x1a')]){for(var _0x5cedbc=0x0;_0x5cedbc<_0x367e03[_0x296f('0x19')][_0x296f('0x1a')];_0x5cedbc+=0x1){var _0x54f5d8=_0x367e03['applications'][_0x5cedbc];if(fs[_0x296f('0x1b')](path[_0x296f('0x1c')](__dirname,_0x296f('0x19'),_0x54f5d8['app']+_0x296f('0x1d')))){var _0x108c9b=[];switch(_0x54f5d8[_0x296f('0x1e')]['toLowerCase']()){case'autoreply':var _0x12abfb=_0x54f5d8['appdata']['split'](',');if(_0x367e03[_0x296f('0x13')]==='mail'){_0x108c9b['push'](_0x12abfb[0x0]);_0x108c9b['push'](_0x12abfb[0x1]);_0x108c9b[_0x296f('0x1f')](_0x12abfb[_0x296f('0x20')](0x2,_0x12abfb[_0x296f('0x1a')])[_0x296f('0x1c')](','));}else{_0x108c9b[_0x296f('0x1f')](_0x12abfb[0x0]);_0x108c9b[_0x296f('0x1f')](_0x12abfb['slice'](0x1,_0x12abfb['length'])[_0x296f('0x1c')](','));}break;case'dialogflow':var _0xc47d1f=_0x54f5d8[_0x296f('0x21')][_0x296f('0x22')](',');_0x108c9b[_0x296f('0x1f')](_0xc47d1f[0x0]);_0x108c9b[_0x296f('0x1f')](_0xc47d1f[0x1]);_0x108c9b[_0x296f('0x1f')](_0xc47d1f['slice'](0x2,_0xc47d1f[_0x296f('0x1a')])['join'](','));break;case _0x296f('0x23'):var _0x288c3e=_0x54f5d8[_0x296f('0x21')][_0x296f('0x22')](',');_0x108c9b[_0x296f('0x1f')](_0x288c3e[0x0]);_0x108c9b[_0x296f('0x1f')](_0x288c3e[0x1]);_0x108c9b[_0x296f('0x1f')](_0x288c3e[0x2]);_0x108c9b[_0x296f('0x1f')](_0x288c3e[0x3]);_0x108c9b[_0x296f('0x1f')](_0x288c3e[_0x296f('0x20')](0x4,_0x288c3e[_0x296f('0x1a')])[_0x296f('0x1c')](','));break;case _0x296f('0x24'):var _0x54bab2=_0x54f5d8[_0x296f('0x21')][_0x296f('0x22')](',');_0x108c9b[_0x296f('0x1f')](_0x54bab2[0x0]);_0x108c9b[_0x296f('0x1f')](_0x54bab2[0x1]);_0x108c9b['push'](_0x54bab2[0x2]);_0x108c9b['push'](_0x54bab2[0x3]);_0x108c9b['push'](_0x54bab2[_0x296f('0x20')](0x4,_0x54bab2[_0x296f('0x1a')])['join'](','));break;case _0x296f('0x14'):_0x108c9b[_0x296f('0x1f')](_0x54f5d8['appdata']);break;case'tag':_0x108c9b[_0x296f('0x1f')](_0x54f5d8[_0x296f('0x25')]);_0x108c9b['push'](_0x54f5d8[_0x296f('0x21')]);break;case _0x296f('0x26'):var _0x1f57de=utils[_0x296f('0x27')](_0x367e03[_0x296f('0x28')][_0x296f('0x29')],_0x367e03);var _0x532ed1=_0x54f5d8['appdata']['split'](',');_0x108c9b[_0x296f('0x1f')](_0x532ed1[0x0]);_0x108c9b['push'](_0x532ed1[0x1]);_0x108c9b['push'](_0x532ed1[0x2]);_0x108c9b[_0x296f('0x1f')](_0x532ed1[0x3]);_0x108c9b[_0x296f('0x1f')](_0x532ed1[0x4]);_0x108c9b[_0x296f('0x1f')](_0x532ed1[0x5]);_0x108c9b[_0x296f('0x1f')](_0x532ed1[0x6]);_0x108c9b[_0x296f('0x1f')](_0x532ed1[0x7]);_0x108c9b[_0x296f('0x1f')](_0x532ed1[0x8]);_0x108c9b[_0x296f('0x1f')](_0x532ed1[0x9]);_0x108c9b['push'](_0x532ed1[0xa]);_0x108c9b[_0x296f('0x1f')](_0x367e03[_0x296f('0x15')]['id']);_0x108c9b[_0x296f('0x1f')](_0x367e03[_0x296f('0x14')]['id']);_0x108c9b[_0x296f('0x1f')](_0x54f5d8[_0x296f('0x2a')]);_0x108c9b[_0x296f('0x1f')](_0x367e03[_0x296f('0x15')]['ContactId']);_0x108c9b[_0x296f('0x1f')](_0x367e03[_0x296f('0x2b')]['body']);_0x108c9b[_0x296f('0x1f')](_0x1f57de);break;default:_0x108c9b=_[_0x296f('0xe')](_0x54f5d8['appdata'])?[]:_0x54f5d8['appdata'][_0x296f('0x22')](',');}var _0x150f29={'id':util[_0x296f('0xb')](_0x296f('0x2c'),_0x4a2aaa,_0x54f5d8['id'],_0x54f5d8[_0x296f('0x1e')]),'condition':require(_0x296f('0x2d'))[_0x296f('0x2e')](_0x4a2aaa,getIntervals(_0xe843fc[_0x296f('0x2f')],_0x54f5d8),_0xe843fc),'consequence':require(_0x296f('0x30')+_0x54f5d8['app'])[_0x296f('0x31')](_0x4a2aaa,_0x108c9b,_0xe843fc,_0x367e03),'p':_0x54f5d8['priority']||0x0};logger[_0x296f('0x32')](_0x296f('0x33'),_0x150f29['id'],_0x296f('0x34'),getIntervals(_0xe843fc[_0x296f('0x2f')],_0x54f5d8)['join'](_0x296f('0x35')));_0x4cfa9a['push'](_0x150f29);}else{logger[_0x296f('0x36')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,'applications',_0x54f5d8[_0x296f('0x1e')]+_0x296f('0x1d')));}}_0xe843fc[_0x296f('0x37')][_0x4a2aaa]=new RuleEngine(_0x4cfa9a);_0xe843fc[_0x296f('0x37')][_0x4a2aaa][_0x296f('0x38')](_0x367e03,function(_0x2e962e){logger[_0x296f('0x32')]('Applications\x20executed',JSON['stringify'](_0x2e962e[_0x296f('0x39')]));if(_0xe843fc['rules'][_0x4a2aaa]){_0xe843fc[_0x296f('0x37')][_0x4a2aaa][_0x296f('0x3a')](_0x296f('0x3b'));}});return _0x33654c({'code':0xc8,'message':_0x367e03});}else{if(_0x48725e){logger[_0x296f('0x32')](util[_0x296f('0xb')](_0x296f('0x3c'),_0x4a2aaa));}else{logger[_0x296f('0x32')](_0x296f('0x3d'));}return _0x33654c({'code':0xc8,'message':_0x367e03});}}catch(_0x58b308){logger['error'](_0x58b308[_0x296f('0x3e')]);return _0xa3d57a(_0x2ae0f4[_0x296f('0x36')](0x1f4,_0x58b308));}}return _0xa3d57a(_0x296f('0x3f'));});},'AcceptMessage':function(_0x420e0c){var _0x4c96fb=this;return new Promise(function(_0xc4724f,_0x4ccd43){if(_0x420e0c['agent']&&_0x420e0c[_0x296f('0x40')]['id']){if(_0xe843fc[_0x296f('0x41')][_0x420e0c['agent']['id']]){_0xe843fc['agents'][_0x420e0c[_0x296f('0x40')]['id']][_0x296f('0x42')]=![];_0xe843fc['agents'][_0x420e0c[_0x296f('0x40')]['id']]['busyQueue']=undefined;}}if(_0x420e0c['message']&&_0x420e0c['message']['id']){try{var _0x164a60=getId(_0x420e0c[_0x296f('0x13')],_0x420e0c[_0x296f('0x14')]?_0x420e0c['message']['id']:0x0,_0x420e0c[_0x296f('0x15')]?_0x420e0c[_0x296f('0x15')]['id']:0x0);if(_0xe843fc[_0x296f('0x37')][_0x164a60]){_0xe843fc['rules'][_0x164a60][_0x296f('0x3a')](_0x296f('0x43'));if(rpc[_0x420e0c['channel']+_0x296f('0x44')]){rpc[_0x420e0c[_0x296f('0x13')]+'QueueReport'][_0x296f('0x45')](_0x164a60,{'UserId':_0x420e0c['message']['UserId']})['catch'](function(){logger[_0x296f('0x36')](_0x296f('0x46'));});}}return _0xc4724f({'code':0xc8,'message':_0x420e0c});}catch(_0x561407){logger[_0x296f('0x36')](_0x561407[_0x296f('0x3e')]);return _0x4ccd43(_0x4c96fb[_0x296f('0x36')](0x1f4,_0x561407));}}logger[_0x296f('0x36')]('message\x20is\x20empty');return _0x4ccd43(_0x4c96fb['error'](0x1f4,_0x296f('0x47')));});},'RejectMessage':function(_0x5425bc){var _0x164bb2=this;return new Promise(function(_0x1c7c26,_0x4f2c16){if(_0x5425bc[_0x296f('0x40')]&&_0x5425bc[_0x296f('0x40')]['id']){try{if(_0xe843fc[_0x296f('0x41')][_0x5425bc['agent']['id']]){_0xe843fc[_0x296f('0x41')][_0x5425bc[_0x296f('0x40')]['id']][_0x296f('0x42')]=![];_0xe843fc[_0x296f('0x41')][_0x5425bc[_0x296f('0x40')]['id']][_0x296f('0x48')]=undefined;}return _0x1c7c26({'code':0xc8,'message':_0x5425bc});}catch(_0x4787fb){logger[_0x296f('0x36')](_0x4787fb['stack']);return _0x4f2c16(_0x164bb2[_0x296f('0x36')](0x1f4,_0x4787fb));}}logger[_0x296f('0x36')](_0x296f('0x47'));return _0x4f2c16(_0x164bb2[_0x296f('0x36')](0x1f4,_0x296f('0x47')));});},'AbandonInteraction':function(_0x373b9c){var _0x301ba7=this;return new Promise(function(_0x5621ad,_0x34357a){if(_0x373b9c[_0x296f('0x13')]&&_0x373b9c['interaction']&&_0x373b9c[_0x296f('0x15')]['id']){try{var _0x426e08=getId(_0x373b9c['channel'],_0x373b9c[_0x296f('0x14')]?_0x373b9c[_0x296f('0x14')]['id']:0x0,_0x373b9c[_0x296f('0x15')]?_0x373b9c['interaction']['id']:0x0);if(_0xe843fc[_0x296f('0x37')][_0x426e08]){_0xe843fc[_0x296f('0x37')][_0x426e08][_0x296f('0x3a')](_0x296f('0x43'));}return _0x5621ad({'code':0xc8,'message':_0x373b9c});}catch(_0x4a7203){logger[_0x296f('0x36')](_0x4a7203[_0x296f('0x3e')]);return _0x34357a(_0x301ba7['error'](0x1f4,_0x4a7203));}}logger[_0x296f('0x36')](_0x296f('0x47'));return _0x34357a(_0x301ba7[_0x296f('0x36')](0x1f4,_0x296f('0x47')));});},'AgentCapacity':function(_0x7c088){var _0x269de9=this;return new Promise(function(_0x2a8444,_0x14c324){if(_0xe843fc[_0x296f('0x41')][_0x296f('0x49')](_0x7c088['id'])){for(var _0x56b59d in _0x7c088[_0x296f('0x4a')]){if(_0x7c088['capacity'][_0x296f('0x49')](_0x56b59d)){if(_0xe843fc[_0x296f('0x41')][_0x7c088['id']][_0x296f('0x49')](_0x56b59d+_0x296f('0x4b'))){_0xe843fc[_0x296f('0x41')][_0x7c088['id']][_0x56b59d+'CurrentCapacity']=parseInt(_0x7c088['capacity'][_0x56b59d],0xa);}}}_0xe843fc[_0x296f('0x41')][_0x7c088['id']][_0x296f('0x4c')]();return _0x2a8444({'code':0xc8,'message':_0xe843fc['agents'][_0x7c088['id']]});}else{return _0x14c324(_0x269de9[_0x296f('0x36')](0x1f4,_0x296f('0x4d')));}});},'Agents':function(_0x46a4c6){return new Promise(function(_0x50a96a){var _0x1e3fe4=_['values'](_0xe843fc[_0x296f('0x41')]);if(_0x46a4c6&&_0x46a4c6['id']){var _0x13702f=_['find'](_0x1e3fe4,function(_0x12063a){return _0x12063a['id']===_0x46a4c6['id'];});_0x50a96a(_0x13702f);}else{_0x50a96a({'count':_0x1e3fe4['length'],'rows':_0x1e3fe4});}});},'ChatQueues':function(){return new Promise(function(_0x483a6e){var _0xa63a05=[];for(var _0x317bf3 in _0xe843fc['chatQueues']){if(_0xe843fc[_0x296f('0x4e')][_0x296f('0x49')](_0x317bf3)){var _0x22b98a=_0xe843fc[_0x296f('0x4e')][_0x317bf3];var _0x947ec={'id':_0x22b98a['id'],'available':_0x22b98a[_0x296f('0x4f')],'loggedIn':_0x22b98a[_0x296f('0x50')],'name':_0x22b98a[_0x296f('0x51')],'paused':_0x22b98a[_0x296f('0x52')],'waiting':_0x22b98a[_0x296f('0x53')]};_0xa63a05[_0x296f('0x1f')](_0x947ec);}}_0x483a6e({'count':_0xa63a05[_0x296f('0x1a')],'rows':_0xa63a05});});},'MailQueues':function(){return new Promise(function(_0x509a83){var _0x40ce8e=[];for(var _0x5fa47e in _0xe843fc[_0x296f('0x54')]){if(_0xe843fc[_0x296f('0x54')][_0x296f('0x49')](_0x5fa47e)){var _0x14482a=_0xe843fc['mailQueues'][_0x5fa47e];var _0x572189={'id':_0x14482a['id'],'available':_0x14482a[_0x296f('0x4f')],'loggedIn':_0x14482a[_0x296f('0x50')],'name':_0x14482a['name'],'paused':_0x14482a['paused'],'waiting':_0x14482a[_0x296f('0x53')]};_0x40ce8e[_0x296f('0x1f')](_0x572189);}}_0x509a83({'count':_0x40ce8e[_0x296f('0x1a')],'rows':_0x40ce8e});});},'OpenchannelQueues':function(){return new Promise(function(_0x35b5a5){var _0x476b9d=[];for(var _0x597a85 in _0xe843fc[_0x296f('0x55')]){if(_0xe843fc[_0x296f('0x55')][_0x296f('0x49')](_0x597a85)){var _0x3eb46e=_0xe843fc['openchannelQueues'][_0x597a85];var _0x142155={'id':_0x3eb46e['id'],'available':_0x3eb46e[_0x296f('0x4f')],'loggedIn':_0x3eb46e['loggedIn'],'name':_0x3eb46e[_0x296f('0x51')],'paused':_0x3eb46e[_0x296f('0x52')],'waiting':_0x3eb46e[_0x296f('0x53')]};_0x476b9d[_0x296f('0x1f')](_0x142155);}}_0x35b5a5({'count':_0x476b9d[_0x296f('0x1a')],'rows':_0x476b9d});});},'SmsQueues':function(){return new Promise(function(_0x5a1996){var _0x1b9a8c=[];for(var _0x137b1d in _0xe843fc['smsQueues']){if(_0xe843fc[_0x296f('0x56')][_0x296f('0x49')](_0x137b1d)){var _0x203ee7=_0xe843fc[_0x296f('0x56')][_0x137b1d];var _0x5e766f={'id':_0x203ee7['id'],'available':_0x203ee7[_0x296f('0x4f')],'loggedIn':_0x203ee7[_0x296f('0x50')],'name':_0x203ee7[_0x296f('0x51')],'paused':_0x203ee7[_0x296f('0x52')],'waiting':_0x203ee7['waiting']};_0x1b9a8c['push'](_0x5e766f);}}_0x5a1996({'count':_0x1b9a8c[_0x296f('0x1a')],'rows':_0x1b9a8c});});},'FaxQueues':function(){return new Promise(function(_0x2def58){var _0x3a803d=[];for(var _0x42c9be in _0xe843fc[_0x296f('0x57')]){if(_0xe843fc[_0x296f('0x57')][_0x296f('0x49')](_0x42c9be)){var _0x45f7a1=_0xe843fc[_0x296f('0x57')][_0x42c9be];var _0x5478e7={'id':_0x45f7a1['id'],'available':_0x45f7a1[_0x296f('0x4f')],'loggedIn':_0x45f7a1[_0x296f('0x50')],'name':_0x45f7a1['name'],'paused':_0x45f7a1[_0x296f('0x52')],'waiting':_0x45f7a1[_0x296f('0x53')]};_0x3a803d[_0x296f('0x1f')](_0x5478e7);}}_0x2def58({'count':_0x3a803d[_0x296f('0x1a')],'rows':_0x3a803d});});},'WhatsappQueues':function(){return new Promise(function(_0x518949){var _0x4c7e03=[];for(var _0x48a0d3 in _0xe843fc[_0x296f('0x58')]){if(_0xe843fc['whatsappQueues'][_0x296f('0x49')](_0x48a0d3)){var _0xc058b1=_0xe843fc[_0x296f('0x58')][_0x48a0d3];var _0x365c41={'id':_0xc058b1['id'],'available':_0xc058b1[_0x296f('0x4f')],'loggedIn':_0xc058b1[_0x296f('0x50')],'name':_0xc058b1[_0x296f('0x51')],'paused':_0xc058b1[_0x296f('0x52')],'waiting':_0xc058b1[_0x296f('0x53')]};_0x4c7e03[_0x296f('0x1f')](_0x365c41);}}_0x518949({'count':_0x4c7e03[_0x296f('0x1a')],'rows':_0x4c7e03});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x4315ea){var _0x30a5af=_[_0x296f('0x59')](_0xe843fc[_0x296f('0x5a')]);_0x4315ea({'count':_0x30a5af[_0x296f('0x1a')],'rows':_0x30a5af});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x17e899){var _0x2f8da4=_[_0x296f('0x59')](_0xe843fc[_0x296f('0x5b')]);_0x17e899({'count':_0x2f8da4[_0x296f('0x1a')],'rows':_0x2f8da4});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x39cab0){var _0x5bb2d1=_['values'](_0xe843fc['openchannelQueuesWaitingInteractions']);_0x39cab0({'count':_0x5bb2d1[_0x296f('0x1a')],'rows':_0x5bb2d1});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x37a721){var _0xdf7dba=_[_0x296f('0x59')](_0xe843fc[_0x296f('0x5c')]);_0x37a721({'count':_0xdf7dba[_0x296f('0x1a')],'rows':_0xdf7dba});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x575b16){var _0x1ca525=_[_0x296f('0x59')](_0xe843fc[_0x296f('0x5d')]);_0x575b16({'count':_0x1ca525['length'],'rows':_0x1ca525});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x4eb94f){var _0x2a63e1=_[_0x296f('0x59')](_0xe843fc[_0x296f('0x5e')]);_0x4eb94f({'count':_0x2a63e1[_0x296f('0x1a')],'rows':_0x2a63e1});});}};var _0x5e21e4=jayson[_0x296f('0x5f')](_0x4e0b88)['http']();_0x5e21e4['on'](_0x296f('0x36'),function(_0x4e8586){logger[_0x296f('0x36')](JSON[_0x296f('0x60')](_0x4e8586));return _0x496675(_0x4e8586);});_0x5e21e4[_0x296f('0x12')](0x232c,_0x296f('0x61'),function(){console[_0x296f('0x62')](_0x296f('0x63'),0x232c);return _0xac5d0(_0x296f('0x64')+0x232c);});});}; \ No newline at end of file +var _0xdadc=['waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','values','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','checkWaitingNotifications','transfer','isArray','applications','length','existsSync','app','.js','toLowerCase','split','push','slice','dialogflow','appdata','join','dialogflowv2','amazonlex','tag','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','format','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','emit','Skipped\x20routing\x20for\x20%s','stack','agent','agents','end','QueueReport','update','catch','message\x20is\x20empty','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','find','chatQueues','available','loggedIn','name','paused'];(function(_0x3120e6,_0x324456){var _0x5b739f=function(_0x2e03ab){while(--_0x2e03ab){_0x3120e6['push'](_0x3120e6['shift']());}};_0x5b739f(++_0x324456);}(_0xdadc,0x75));var _0xcdad=function(_0x4f9210,_0x41006d){_0x4f9210=_0x4f9210-0x0;var _0x9b4dc5=_0xdadc[_0x4f9210];return _0x9b4dc5;};'use strict';var _=require(_0xcdad('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0xcdad('0x1'));var BPromise=require(_0xcdad('0x2'));var utils=require(_0xcdad('0x3'));var sUtils=require(_0xcdad('0x4'));var logger=require(_0xcdad('0x5'))(_0xcdad('0x6'));var rpc={'openchannelQueueReport':require(_0xcdad('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xcdad('0x8')),'smsQueueReport':require(_0xcdad('0x9')),'faxQueueReport':require(_0xcdad('0xa')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0xe8e0c6,_0x12f7f7,_0x1e5607){return util['format'](_0xcdad('0xb'),_0xe8e0c6,_0x12f7f7||0x0,_0x1e5607||0x0);}function getIntervals(_0x194878,_0x31b674){var _0x523085=[];if(!_['isNil'](_0x31b674['IntervalId'])&&!_[_0xcdad('0xc')](_0x194878[_0x31b674[_0xcdad('0xd')]])&&!_[_0xcdad('0xc')](_0x194878[_0x31b674[_0xcdad('0xd')]][_0xcdad('0xe')])){_0x523085=_[_0xcdad('0xf')](_0x194878[_0x31b674[_0xcdad('0xd')]][_0xcdad('0xe')],'interval');}else if(!_['isNil'](_0x31b674[_0xcdad('0x10')])){_0x523085=[_0x31b674[_0xcdad('0x10')]];}return _0x523085;}exports['listen']=function(_0x477d12){_0x477d12[_0xcdad('0x11')]={};return new BPromise(function(_0x1df46e,_0x419589){var _0xc9a15e={'Start':function(_0xdddda5){var _0x1b7cab=this;return new Promise(function(_0x53eb63,_0x54b2fe){if(_0xdddda5){try{var _0x541a28=[];var _0x2b41b3=getId(_0xdddda5[_0xcdad('0x12')],_0xdddda5['message']?_0xdddda5[_0xcdad('0x13')]['id']:0x0,_0xdddda5['interaction']?_0xdddda5[_0xcdad('0x14')]['id']:0x0);var _0x3eb574=sUtils[_0xcdad('0x15')](_0x477d12,_0xdddda5);if(_0xdddda5[_0xcdad('0x16')]||!_0x3eb574&&_0xdddda5['applications']&&_[_0xcdad('0x17')](_0xdddda5[_0xcdad('0x18')])&&_0xdddda5[_0xcdad('0x18')][_0xcdad('0x19')]){for(var _0x26c7af=0x0;_0x26c7af<_0xdddda5[_0xcdad('0x18')][_0xcdad('0x19')];_0x26c7af+=0x1){var _0x496b99=_0xdddda5[_0xcdad('0x18')][_0x26c7af];if(fs[_0xcdad('0x1a')](path['join'](__dirname,_0xcdad('0x18'),_0x496b99[_0xcdad('0x1b')]+_0xcdad('0x1c')))){var _0x163896=[];switch(_0x496b99[_0xcdad('0x1b')][_0xcdad('0x1d')]()){case'autoreply':var _0x26005e=_0x496b99['appdata'][_0xcdad('0x1e')](',');if(_0xdddda5[_0xcdad('0x12')]==='mail'){_0x163896[_0xcdad('0x1f')](_0x26005e[0x0]);_0x163896[_0xcdad('0x1f')](_0x26005e[0x1]);_0x163896[_0xcdad('0x1f')](_0x26005e[_0xcdad('0x20')](0x2,_0x26005e[_0xcdad('0x19')])['join'](','));}else{_0x163896['push'](_0x26005e[0x0]);_0x163896[_0xcdad('0x1f')](_0x26005e[_0xcdad('0x20')](0x1,_0x26005e['length'])['join'](','));}break;case _0xcdad('0x21'):var _0x3ff588=_0x496b99[_0xcdad('0x22')]['split'](',');_0x163896[_0xcdad('0x1f')](_0x3ff588[0x0]);_0x163896[_0xcdad('0x1f')](_0x3ff588[0x1]);_0x163896[_0xcdad('0x1f')](_0x3ff588[_0xcdad('0x20')](0x2,_0x3ff588[_0xcdad('0x19')])[_0xcdad('0x23')](','));break;case _0xcdad('0x24'):var _0x2f02ca=_0x496b99[_0xcdad('0x22')][_0xcdad('0x1e')](',');_0x163896[_0xcdad('0x1f')](_0x2f02ca[0x0]);_0x163896[_0xcdad('0x1f')](_0x2f02ca[0x1]);_0x163896['push'](_0x2f02ca[0x2]);_0x163896[_0xcdad('0x1f')](_0x2f02ca[0x3]);_0x163896[_0xcdad('0x1f')](_0x2f02ca['slice'](0x4,_0x2f02ca['length'])[_0xcdad('0x23')](','));break;case _0xcdad('0x25'):var _0x3e8cc5=_0x496b99['appdata'][_0xcdad('0x1e')](',');_0x163896[_0xcdad('0x1f')](_0x3e8cc5[0x0]);_0x163896[_0xcdad('0x1f')](_0x3e8cc5[0x1]);_0x163896[_0xcdad('0x1f')](_0x3e8cc5[0x2]);_0x163896['push'](_0x3e8cc5[0x3]);_0x163896[_0xcdad('0x1f')](_0x3e8cc5[_0xcdad('0x20')](0x4,_0x3e8cc5['length'])['join'](','));break;case _0xcdad('0x13'):_0x163896[_0xcdad('0x1f')](_0x496b99[_0xcdad('0x22')]);break;case _0xcdad('0x26'):_0x163896['push'](_0x496b99['TagId']);_0x163896['push'](_0x496b99[_0xcdad('0x22')]);break;case _0xcdad('0x27'):var _0x24e9a3=utils[_0xcdad('0x28')](_0xdddda5[_0xcdad('0x29')][_0xcdad('0x2a')],_0xdddda5);var _0x28ab33=_0x496b99['appdata'][_0xcdad('0x1e')](',');_0x163896[_0xcdad('0x1f')](_0x28ab33[0x0]);_0x163896[_0xcdad('0x1f')](_0x28ab33[0x1]);_0x163896['push'](_0x28ab33[0x2]);_0x163896[_0xcdad('0x1f')](_0x28ab33[0x3]);_0x163896['push'](_0x28ab33[0x4]);_0x163896['push'](_0x28ab33[0x5]);_0x163896[_0xcdad('0x1f')](_0x28ab33[0x6]);_0x163896[_0xcdad('0x1f')](_0x28ab33[0x7]);_0x163896[_0xcdad('0x1f')](_0x28ab33[0x8]);_0x163896['push'](_0x28ab33[0x9]);_0x163896[_0xcdad('0x1f')](_0x28ab33[0xa]);_0x163896[_0xcdad('0x1f')](_0xdddda5['interaction']['id']);_0x163896['push'](_0xdddda5['message']['id']);_0x163896[_0xcdad('0x1f')](_0x496b99[_0xcdad('0x2b')]);_0x163896[_0xcdad('0x1f')](_0xdddda5[_0xcdad('0x14')][_0xcdad('0x2c')]);_0x163896['push'](_0xdddda5[_0xcdad('0x2d')]['body']);_0x163896[_0xcdad('0x1f')](_0x24e9a3);break;default:_0x163896=_[_0xcdad('0xc')](_0x496b99['appdata'])?[]:_0x496b99[_0xcdad('0x22')][_0xcdad('0x1e')](',');}var _0x1a8708={'id':util[_0xcdad('0x2e')](_0xcdad('0x2f'),_0x2b41b3,_0x496b99['id'],_0x496b99[_0xcdad('0x1b')]),'condition':require(_0xcdad('0x30'))[_0xcdad('0x31')](_0x2b41b3,getIntervals(_0x477d12[_0xcdad('0x32')],_0x496b99),_0x477d12),'consequence':require(_0xcdad('0x33')+_0x496b99[_0xcdad('0x1b')])['consequence'](_0x2b41b3,_0x163896,_0x477d12,_0xdddda5),'p':_0x496b99[_0xcdad('0x34')]||0x0};logger[_0xcdad('0x35')](_0xcdad('0x36'),_0x1a8708['id'],_0xcdad('0x37'),getIntervals(_0x477d12[_0xcdad('0x32')],_0x496b99)[_0xcdad('0x23')]('\x20|\x20'));_0x541a28['push'](_0x1a8708);}else{logger[_0xcdad('0x38')](_0xcdad('0x39'),path['join'](__dirname,_0xcdad('0x18'),_0x496b99[_0xcdad('0x1b')]+_0xcdad('0x1c')));}}_0x477d12[_0xcdad('0x11')][_0x2b41b3]=new RuleEngine(_0x541a28);_0x477d12[_0xcdad('0x11')][_0x2b41b3][_0xcdad('0x3a')](_0xdddda5,function(_0x39a805){logger[_0xcdad('0x35')]('Applications\x20executed',JSON[_0xcdad('0x3b')](_0x39a805['matchPath']));if(_0x477d12[_0xcdad('0x11')][_0x2b41b3]){_0x477d12[_0xcdad('0x11')][_0x2b41b3][_0xcdad('0x3c')]('complete');}});return _0x53eb63({'code':0xc8,'message':_0xdddda5});}else{if(_0x3eb574){logger['info'](util[_0xcdad('0x2e')](_0xcdad('0x3d'),_0x2b41b3));}else{logger[_0xcdad('0x35')]('No\x20applications\x20to\x20execute');}return _0x53eb63({'code':0xc8,'message':_0xdddda5});}}catch(_0x434e74){logger[_0xcdad('0x38')](_0x434e74[_0xcdad('0x3e')]);return _0x54b2fe(_0x1b7cab[_0xcdad('0x38')](0x1f4,_0x434e74));}}return _0x54b2fe('routing\x20is\x20empty');});},'AcceptMessage':function(_0x3e77d7){var _0x2a67cb=this;return new Promise(function(_0x915121,_0x19ea59){if(_0x3e77d7['agent']&&_0x3e77d7[_0xcdad('0x3f')]['id']){if(_0x477d12[_0xcdad('0x40')][_0x3e77d7[_0xcdad('0x3f')]['id']]){_0x477d12['agents'][_0x3e77d7[_0xcdad('0x3f')]['id']]['busy']=![];_0x477d12[_0xcdad('0x40')][_0x3e77d7['agent']['id']]['busyQueue']=undefined;}}if(_0x3e77d7[_0xcdad('0x13')]&&_0x3e77d7['message']['id']){try{var _0x551fa3=getId(_0x3e77d7[_0xcdad('0x12')],_0x3e77d7[_0xcdad('0x13')]?_0x3e77d7[_0xcdad('0x13')]['id']:0x0,_0x3e77d7[_0xcdad('0x14')]?_0x3e77d7[_0xcdad('0x14')]['id']:0x0);if(_0x477d12[_0xcdad('0x11')][_0x551fa3]){_0x477d12[_0xcdad('0x11')][_0x551fa3][_0xcdad('0x3c')](_0xcdad('0x41'));if(rpc[_0x3e77d7[_0xcdad('0x12')]+_0xcdad('0x42')]){rpc[_0x3e77d7['channel']+_0xcdad('0x42')][_0xcdad('0x43')](_0x551fa3,{'UserId':_0x3e77d7[_0xcdad('0x13')]['UserId']})[_0xcdad('0x44')](function(){logger[_0xcdad('0x38')]('error\x20update\x20queue\x20report');});}}return _0x915121({'code':0xc8,'message':_0x3e77d7});}catch(_0x57440a){logger[_0xcdad('0x38')](_0x57440a[_0xcdad('0x3e')]);return _0x19ea59(_0x2a67cb[_0xcdad('0x38')](0x1f4,_0x57440a));}}logger[_0xcdad('0x38')](_0xcdad('0x45'));return _0x19ea59(_0x2a67cb[_0xcdad('0x38')](0x1f4,_0xcdad('0x45')));});},'RejectMessage':function(_0x1e918a){var _0x189da7=this;return new Promise(function(_0x5d6603,_0x2c35b3){if(_0x1e918a[_0xcdad('0x3f')]&&_0x1e918a['agent']['id']){try{if(_0x477d12['agents'][_0x1e918a['agent']['id']]){_0x477d12[_0xcdad('0x40')][_0x1e918a['agent']['id']][_0xcdad('0x46')]=![];_0x477d12[_0xcdad('0x40')][_0x1e918a['agent']['id']]['busyQueue']=undefined;}return _0x5d6603({'code':0xc8,'message':_0x1e918a});}catch(_0x2a4fce){logger[_0xcdad('0x38')](_0x2a4fce[_0xcdad('0x3e')]);return _0x2c35b3(_0x189da7[_0xcdad('0x38')](0x1f4,_0x2a4fce));}}logger[_0xcdad('0x38')]('message\x20is\x20empty');return _0x2c35b3(_0x189da7[_0xcdad('0x38')](0x1f4,_0xcdad('0x45')));});},'AbandonInteraction':function(_0x2f507f){var _0x1c14d1=this;return new Promise(function(_0x390380,_0x323592){if(_0x2f507f[_0xcdad('0x12')]&&_0x2f507f['interaction']&&_0x2f507f[_0xcdad('0x14')]['id']){try{var _0x9a95cc=getId(_0x2f507f[_0xcdad('0x12')],_0x2f507f[_0xcdad('0x13')]?_0x2f507f['message']['id']:0x0,_0x2f507f[_0xcdad('0x14')]?_0x2f507f[_0xcdad('0x14')]['id']:0x0);if(_0x477d12[_0xcdad('0x11')][_0x9a95cc]){_0x477d12[_0xcdad('0x11')][_0x9a95cc]['emit'](_0xcdad('0x41'));}return _0x390380({'code':0xc8,'message':_0x2f507f});}catch(_0x677ef0){logger[_0xcdad('0x38')](_0x677ef0[_0xcdad('0x3e')]);return _0x323592(_0x1c14d1['error'](0x1f4,_0x677ef0));}}logger[_0xcdad('0x38')](_0xcdad('0x45'));return _0x323592(_0x1c14d1['error'](0x1f4,_0xcdad('0x45')));});},'AgentCapacity':function(_0x5c347d){var _0x20a3f4=this;return new Promise(function(_0x3a118c,_0x5e9d07){if(_0x477d12[_0xcdad('0x40')][_0xcdad('0x47')](_0x5c347d['id'])){for(var _0x3d5c64 in _0x5c347d[_0xcdad('0x48')]){if(_0x5c347d[_0xcdad('0x48')][_0xcdad('0x47')](_0x3d5c64)){if(_0x477d12[_0xcdad('0x40')][_0x5c347d['id']][_0xcdad('0x47')](_0x3d5c64+_0xcdad('0x49'))){_0x477d12[_0xcdad('0x40')][_0x5c347d['id']][_0x3d5c64+_0xcdad('0x49')]=parseInt(_0x5c347d[_0xcdad('0x48')][_0x3d5c64],0xa);}}}_0x477d12[_0xcdad('0x40')][_0x5c347d['id']][_0xcdad('0x4a')]();return _0x3a118c({'code':0xc8,'message':_0x477d12[_0xcdad('0x40')][_0x5c347d['id']]});}else{return _0x5e9d07(_0x20a3f4['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x1aca0c){return new Promise(function(_0x20f430){var _0xe4a0cb=_['values'](_0x477d12[_0xcdad('0x40')]);if(_0x1aca0c&&_0x1aca0c['id']){var _0x271ff6=_[_0xcdad('0x4b')](_0xe4a0cb,function(_0xb5db02){return _0xb5db02['id']===_0x1aca0c['id'];});_0x20f430(_0x271ff6);}else{_0x20f430({'count':_0xe4a0cb[_0xcdad('0x19')],'rows':_0xe4a0cb});}});},'ChatQueues':function(){return new Promise(function(_0x13bcca){var _0x3e6adb=[];for(var _0x505e81 in _0x477d12[_0xcdad('0x4c')]){if(_0x477d12[_0xcdad('0x4c')][_0xcdad('0x47')](_0x505e81)){var _0x393207=_0x477d12['chatQueues'][_0x505e81];var _0x3bbf0b={'id':_0x393207['id'],'available':_0x393207[_0xcdad('0x4d')],'loggedIn':_0x393207[_0xcdad('0x4e')],'name':_0x393207[_0xcdad('0x4f')],'paused':_0x393207[_0xcdad('0x50')],'waiting':_0x393207[_0xcdad('0x51')]};_0x3e6adb[_0xcdad('0x1f')](_0x3bbf0b);}}_0x13bcca({'count':_0x3e6adb[_0xcdad('0x19')],'rows':_0x3e6adb});});},'MailQueues':function(){return new Promise(function(_0x46a387){var _0x5d4357=[];for(var _0x580852 in _0x477d12['mailQueues']){if(_0x477d12[_0xcdad('0x52')][_0xcdad('0x47')](_0x580852)){var _0x235cf7=_0x477d12[_0xcdad('0x52')][_0x580852];var _0x1ff54a={'id':_0x235cf7['id'],'available':_0x235cf7[_0xcdad('0x4d')],'loggedIn':_0x235cf7[_0xcdad('0x4e')],'name':_0x235cf7[_0xcdad('0x4f')],'paused':_0x235cf7[_0xcdad('0x50')],'waiting':_0x235cf7[_0xcdad('0x51')]};_0x5d4357[_0xcdad('0x1f')](_0x1ff54a);}}_0x46a387({'count':_0x5d4357[_0xcdad('0x19')],'rows':_0x5d4357});});},'OpenchannelQueues':function(){return new Promise(function(_0x86f6f0){var _0x391b64=[];for(var _0x502a70 in _0x477d12['openchannelQueues']){if(_0x477d12[_0xcdad('0x53')][_0xcdad('0x47')](_0x502a70)){var _0x37abf1=_0x477d12['openchannelQueues'][_0x502a70];var _0x2e2979={'id':_0x37abf1['id'],'available':_0x37abf1[_0xcdad('0x4d')],'loggedIn':_0x37abf1[_0xcdad('0x4e')],'name':_0x37abf1[_0xcdad('0x4f')],'paused':_0x37abf1[_0xcdad('0x50')],'waiting':_0x37abf1[_0xcdad('0x51')]};_0x391b64[_0xcdad('0x1f')](_0x2e2979);}}_0x86f6f0({'count':_0x391b64[_0xcdad('0x19')],'rows':_0x391b64});});},'SmsQueues':function(){return new Promise(function(_0x3dbafa){var _0x49bfd1=[];for(var _0x2c2f0e in _0x477d12['smsQueues']){if(_0x477d12[_0xcdad('0x54')][_0xcdad('0x47')](_0x2c2f0e)){var _0x292c89=_0x477d12[_0xcdad('0x54')][_0x2c2f0e];var _0x2c6c04={'id':_0x292c89['id'],'available':_0x292c89[_0xcdad('0x4d')],'loggedIn':_0x292c89['loggedIn'],'name':_0x292c89[_0xcdad('0x4f')],'paused':_0x292c89[_0xcdad('0x50')],'waiting':_0x292c89[_0xcdad('0x51')]};_0x49bfd1['push'](_0x2c6c04);}}_0x3dbafa({'count':_0x49bfd1[_0xcdad('0x19')],'rows':_0x49bfd1});});},'FaxQueues':function(){return new Promise(function(_0x3ff673){var _0x5688e9=[];for(var _0x38d0d6 in _0x477d12['faxQueues']){if(_0x477d12[_0xcdad('0x55')][_0xcdad('0x47')](_0x38d0d6)){var _0x5e1c02=_0x477d12[_0xcdad('0x55')][_0x38d0d6];var _0x2d68ad={'id':_0x5e1c02['id'],'available':_0x5e1c02[_0xcdad('0x4d')],'loggedIn':_0x5e1c02[_0xcdad('0x4e')],'name':_0x5e1c02['name'],'paused':_0x5e1c02[_0xcdad('0x50')],'waiting':_0x5e1c02[_0xcdad('0x51')]};_0x5688e9[_0xcdad('0x1f')](_0x2d68ad);}}_0x3ff673({'count':_0x5688e9[_0xcdad('0x19')],'rows':_0x5688e9});});},'WhatsappQueues':function(){return new Promise(function(_0x1bbf3f){var _0x345ced=[];for(var _0x13de84 in _0x477d12[_0xcdad('0x56')]){if(_0x477d12[_0xcdad('0x56')][_0xcdad('0x47')](_0x13de84)){var _0x44a43b=_0x477d12[_0xcdad('0x56')][_0x13de84];var _0x2982e0={'id':_0x44a43b['id'],'available':_0x44a43b[_0xcdad('0x4d')],'loggedIn':_0x44a43b[_0xcdad('0x4e')],'name':_0x44a43b[_0xcdad('0x4f')],'paused':_0x44a43b[_0xcdad('0x50')],'waiting':_0x44a43b[_0xcdad('0x51')]};_0x345ced[_0xcdad('0x1f')](_0x2982e0);}}_0x1bbf3f({'count':_0x345ced[_0xcdad('0x19')],'rows':_0x345ced});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x1e3e68){var _0x4a4c19=_['values'](_0x477d12[_0xcdad('0x57')]);_0x1e3e68({'count':_0x4a4c19[_0xcdad('0x19')],'rows':_0x4a4c19});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x45aebc){var _0x586fa8=_[_0xcdad('0x58')](_0x477d12['mailQueuesWaitingInteractions']);_0x45aebc({'count':_0x586fa8['length'],'rows':_0x586fa8});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1b6c02){var _0x125f2d=_[_0xcdad('0x58')](_0x477d12[_0xcdad('0x59')]);_0x1b6c02({'count':_0x125f2d[_0xcdad('0x19')],'rows':_0x125f2d});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x10b948){var _0x569c4a=_[_0xcdad('0x58')](_0x477d12['smsQueuesWaitingInteractions']);_0x10b948({'count':_0x569c4a[_0xcdad('0x19')],'rows':_0x569c4a});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x18a796){var _0x1edfce=_[_0xcdad('0x58')](_0x477d12[_0xcdad('0x5a')]);_0x18a796({'count':_0x1edfce[_0xcdad('0x19')],'rows':_0x1edfce});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x3ba0b5){var _0x4d1863=_[_0xcdad('0x58')](_0x477d12[_0xcdad('0x5b')]);_0x3ba0b5({'count':_0x4d1863['length'],'rows':_0x4d1863});});}};var _0x8f710b=jayson[_0xcdad('0x5c')](_0xc9a15e)[_0xcdad('0x5d')]();_0x8f710b['on']('error',function(_0x43e5e4){logger[_0xcdad('0x38')](JSON['stringify'](_0x43e5e4));return _0x419589(_0x43e5e4);});_0x8f710b[_0xcdad('0x5e')](0x232c,_0xcdad('0x5f'),function(){console[_0xcdad('0x60')](_0xcdad('0x61'),0x232c);return _0x1df46e(_0xcdad('0x62')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 7c24f94..8dd2468 100644 --- a/server/services/routing/server/interval.js +++ b/server/services/routing/server/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf63=['client','http','request','then','error','message','result','catch','condition','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','when','\x20|\x20','util','bluebird','jayson/promise','../../../config/logger'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xcf63,0x8d));var _0x3cf6=function(_0x24571d,_0x3bd61b){_0x24571d=_0x24571d-0x0;var _0x57de25=_0xcf63[_0x24571d];return _0x57de25;};'use strict';var util=require(_0x3cf6('0x0'));var BPromise=require(_0x3cf6('0x1'));var jayson=require(_0x3cf6('0x2'));var _=require('lodash');var logger=require(_0x3cf6('0x3'))('routing');var client=jayson[_0x3cf6('0x4')][_0x3cf6('0x5')]({'port':0x232a});function request(_0x1c9e39,_0x2c35cd){return new BPromise(function(_0x3263e8,_0x317139){return client[_0x3cf6('0x6')](_0x1c9e39,_0x2c35cd)[_0x3cf6('0x7')](function(_0x497ec8){if(_0x497ec8['error']){return _0x317139(_0x497ec8[_0x3cf6('0x8')][_0x3cf6('0x9')]);}else{return _0x3263e8(_0x497ec8[_0x3cf6('0xa')]);}})[_0x3cf6('0xb')](function(_0x178be4){return _0x317139(_0x178be4);});});}exports[_0x3cf6('0xc')]=function(_0x1d5c67,_0x5864ff,_0x50a0bd){return function(_0x4db520){if(_0x50a0bd['rules']&&!_0x50a0bd['rules'][_0x1d5c67]){logger[_0x3cf6('0xd')](_0x3cf6('0xe'),_0x1d5c67);return _0x4db520[_0x3cf6('0xf')]();}var _0x5a483a=[];for(var _0xdc3605=0x0;_0xdc3605<_0x5864ff[_0x3cf6('0x10')];_0xdc3605+=0x1){_0x5a483a[_0x3cf6('0x11')](request('Command',{'command':util[_0x3cf6('0x12')](_0x3cf6('0x13'),_0x5864ff[_0xdc3605])})[_0x3cf6('0x7')](function(_0x130bcf){return _0x130bcf&&_0x130bcf[_0x3cf6('0x9')]&&_0x130bcf[_0x3cf6('0x9')][_0x3cf6('0x14')](_0x3cf6('0x15'))>=0x0?!![]:![];})[_0x3cf6('0xb')](function(){logger[_0x3cf6('0x8')](_0x3cf6('0x16'),_0x1d5c67,_0x5864ff[_0xdc3605]);}));}BPromise[_0x3cf6('0x17')](_0x5a483a)['then'](function(_0x496411){var _0x519423=_[_0x3cf6('0x18')](_0x496411);logger[_0x3cf6('0xd')](_0x3cf6('0x19'),_0x1d5c67,_0x5864ff[_0x3cf6('0x1a')]('\x20|\x20'),_0x519423);_0x4db520[_0x3cf6('0x1b')](_0x519423);})[_0x3cf6('0xb')](function(_0x123fd5){logger[_0x3cf6('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x1d5c67,_0x5864ff[_0x3cf6('0x1a')](_0x3cf6('0x1c')),_0x123fd5['stack']);_0x4db520['stop']();});};}; \ No newline at end of file +var _0x34b5=['result','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','format','message','catch','all','some','join','\x20|\x20','when','[%s][INTERVAL]\x20%s\x20%s','stack','stop','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','then','error'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x34b5,0x1b6));var _0x534b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34b5[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x534b('0x0'));var BPromise=require(_0x534b('0x1'));var jayson=require(_0x534b('0x2'));var _=require(_0x534b('0x3'));var logger=require(_0x534b('0x4'))(_0x534b('0x5'));var client=jayson['client'][_0x534b('0x6')]({'port':0x232a});function request(_0x5639c4,_0x5c84dd){return new BPromise(function(_0xeeb0f,_0x52697a){return client[_0x534b('0x7')](_0x5639c4,_0x5c84dd)[_0x534b('0x8')](function(_0x440b5c){if(_0x440b5c[_0x534b('0x9')]){return _0x52697a(_0x440b5c[_0x534b('0x9')]['message']);}else{return _0xeeb0f(_0x440b5c[_0x534b('0xa')]);}})['catch'](function(_0x4beeee){return _0x52697a(_0x4beeee);});});}exports[_0x534b('0xb')]=function(_0x4fe9a4,_0x1d881a,_0x78daf4){return function(_0x236bbe){if(_0x78daf4[_0x534b('0xc')]&&!_0x78daf4[_0x534b('0xc')][_0x4fe9a4]){logger[_0x534b('0xd')](_0x534b('0xe'),_0x4fe9a4);return _0x236bbe['stop']();}var _0x5401ef=[];for(var _0x45a4ce=0x0;_0x45a4ce<_0x1d881a[_0x534b('0xf')];_0x45a4ce+=0x1){_0x5401ef[_0x534b('0x10')](request('Command',{'command':util[_0x534b('0x11')]('iftime\x20%s',_0x1d881a[_0x45a4ce])})[_0x534b('0x8')](function(_0x26638f){return _0x26638f&&_0x26638f[_0x534b('0x12')]&&_0x26638f[_0x534b('0x12')]['indexOf']('true')>=0x0?!![]:![];})[_0x534b('0x13')](function(){logger[_0x534b('0x9')]('[%s][INTERVAL]\x20%s',_0x4fe9a4,_0x1d881a[_0x45a4ce]);}));}BPromise[_0x534b('0x14')](_0x5401ef)[_0x534b('0x8')](function(_0x214dc9){var _0x46b9fc=_[_0x534b('0x15')](_0x214dc9);logger['info']('[%s][INTERVAL]\x20%s\x20%s',_0x4fe9a4,_0x1d881a[_0x534b('0x16')](_0x534b('0x17')),_0x46b9fc);_0x236bbe[_0x534b('0x18')](_0x46b9fc);})['catch'](function(_0x3d8756){logger[_0x534b('0x9')](_0x534b('0x19'),_0x4fe9a4,_0x1d881a[_0x534b('0x16')](_0x534b('0x17')),_0x3d8756[_0x534b('0x1a')]);_0x236bbe[_0x534b('0x1b')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index a93b2fb..b5fc058 100644 --- a/server/services/xdr/agents.controller.js +++ b/server/services/xdr/agents.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ec6=['connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agentcompleteAt','agent','lodash','util','./utils','format','uniqueid','queue','interface','calleridnum','lastevent','then','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','connectedlinenum','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]'];(function(_0x4d2258,_0x47083d){var _0x3a5163=function(_0x3ddce0){while(--_0x3ddce0){_0x4d2258['push'](_0x4d2258['shift']());}};_0x3a5163(++_0x47083d);}(_0x5ec6,0x7f));var _0x65ec=function(_0x291d6e,_0x56c25f){_0x291d6e=_0x291d6e-0x0;var _0x23af80=_0x5ec6[_0x291d6e];return _0x23af80;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var utils=require(_0x65ec('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5c0775,_0x1b924d){utils['info'](util[_0x65ec('0x3')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x5c0775[_0x65ec('0x4')],_0x5c0775['channel'],_0x5c0775[_0x65ec('0x5')],_0x5c0775['membername'],_0x5c0775[_0x65ec('0x6')],_0x5c0775[_0x65ec('0x7')],_0x5c0775['connectedlinenum'],_0x5c0775[_0x65ec('0x8')]));if(_0x5c0775[_0x65ec('0x5')]){utils['getVoiceQueueByName'](_0x5c0775[_0x65ec('0x5')])[_0x65ec('0x9')](function(_0x300f83){if(_0x300f83){_0x5c0775['type']=_0x300f83['type'];_0x5c0775[_0x65ec('0xa')]=_0x5c0775['agentcomplete']?_0x300f83[_0x65ec('0xb')]:![];_0x5c0775[_0x65ec('0xc')]=_0x5c0775['agentacw']?_0x300f83[_0x65ec('0xd')]:0x0;}utils[_0x65ec('0xe')]('CreateVoiceAgentReport',_0x5c0775);});}else{utils[_0x65ec('0xe')](_0x65ec('0xf'),_0x5c0775);}if(_0x1b924d){delete transfers[_0x5c0775['uniqueid']];}else{delete agents[_0x5c0775[_0x65ec('0x10')]];}}exports[_0x65ec('0x11')]=function(_0x411a7b){try{utils[_0x65ec('0x12')](util[_0x65ec('0x3')](_0x65ec('0x13'),_0x411a7b[_0x65ec('0x4')]),_0x411a7b);agents[_0x411a7b[_0x65ec('0x10')]]=_0x411a7b;agents[_0x411a7b['destuniqueid']][_0x65ec('0x14')]=utils[_0x65ec('0x15')]();agents[_0x411a7b[_0x65ec('0x10')]]['lastevent']='called';agents[_0x411a7b[_0x65ec('0x10')]][_0x65ec('0x16')]=null;agents[_0x411a7b[_0x65ec('0x10')]]['connectedlinename']=null;utils[_0x65ec('0x17')](util[_0x65ec('0x3')](_0x65ec('0x18'),_0x411a7b[_0x65ec('0x4')],agents[_0x411a7b[_0x65ec('0x10')]][_0x65ec('0x19')],_0x411a7b[_0x65ec('0x10')]));}catch(_0x3ef058){utils[_0x65ec('0x1a')](util[_0x65ec('0x3')](_0x65ec('0x13'),_0x411a7b[_0x65ec('0x4')]),_0x3ef058);}};exports[_0x65ec('0x1b')]=function(_0x1467ac){try{if(!_[_0x65ec('0x1c')](agents[_0x1467ac[_0x65ec('0x10')]])){utils[_0x65ec('0x12')](util[_0x65ec('0x3')](_0x65ec('0x1d'),_0x1467ac['uniqueid']),_0x1467ac);utils[_0x65ec('0x17')](util[_0x65ec('0x3')](_0x65ec('0x1e'),_0x1467ac[_0x65ec('0x4')],agents[_0x1467ac[_0x65ec('0x10')]][_0x65ec('0x19')],_0x1467ac[_0x65ec('0x10')]));agents[_0x1467ac['destuniqueid']][_0x65ec('0x1b')]=!![];agents[_0x1467ac[_0x65ec('0x10')]][_0x65ec('0x1f')]=utils[_0x65ec('0x15')]();agents[_0x1467ac[_0x65ec('0x10')]][_0x65ec('0x8')]=_0x65ec('0x20');agents[_0x1467ac[_0x65ec('0x10')]][_0x65ec('0x21')]='timeout';agents[_0x1467ac[_0x65ec('0x10')]][_0x65ec('0x22')]=_0x1467ac[_0x65ec('0x23')]?parseInt(_0x1467ac[_0x65ec('0x23')])/0x3e8:0x0;agents[_0x1467ac['destuniqueid']][_0x65ec('0x24')]=0x0;unanswered['push'](_0x1467ac[_0x65ec('0x10')]);}}catch(_0x1ada47){utils[_0x65ec('0x1a')](util[_0x65ec('0x3')](_0x65ec('0x1d'),_0x1467ac[_0x65ec('0x4')]),_0x1ada47);}};exports[_0x65ec('0x25')]=function(_0x39410f){try{_[_0x65ec('0x26')](agents,function(_0xeec5d4,_0x3c97e2){if(_0xeec5d4['uniqueid']==_0x39410f['uniqueid']&&!_[_0x65ec('0x27')](unanswered,_0xeec5d4['destuniqueid'])){utils[_0x65ec('0x12')](util[_0x65ec('0x3')]('[%s][agents][queuecallerabandon]',_0x39410f[_0x65ec('0x4')]),_0x39410f);utils[_0x65ec('0x17')](util[_0x65ec('0x3')](_0x65ec('0x28'),_0x39410f['uniqueid'],_0xeec5d4[_0x65ec('0x19')],_0xeec5d4[_0x65ec('0x10')]));_0xeec5d4[_0x65ec('0x1b')]=!![];_0xeec5d4[_0x65ec('0x1f')]=utils[_0x65ec('0x15')]();_0xeec5d4[_0x65ec('0x8')]=_0x65ec('0x29');_0xeec5d4[_0x65ec('0x21')]=_0x65ec('0x29');_0xeec5d4[_0x65ec('0x22')]=_0x39410f['holdtime'];_0xeec5d4[_0x65ec('0x24')]=0x0;writeDB(_0xeec5d4);}});}catch(_0x1e20c4){utils['error'](util[_0x65ec('0x3')](_0x65ec('0x2a'),_0x39410f[_0x65ec('0x4')]),_0x1e20c4);}};exports[_0x65ec('0x2b')]=function(_0x134cce){try{if(agents[_0x134cce[_0x65ec('0x10')]]){utils[_0x65ec('0x12')](util['format'](_0x65ec('0x2c'),_0x134cce[_0x65ec('0x4')]),_0x134cce);utils[_0x65ec('0x17')](util[_0x65ec('0x3')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x134cce[_0x65ec('0x4')],agents[_0x134cce[_0x65ec('0x10')]][_0x65ec('0x19')],_0x134cce[_0x65ec('0x10')]));agents[_0x134cce['destuniqueid']]['agentconnectAt']=utils[_0x65ec('0x15')]();agents[_0x134cce['destuniqueid']][_0x65ec('0x16')]=_0x134cce[_0x65ec('0x16')];agents[_0x134cce['destuniqueid']][_0x65ec('0x2d')]=_0x134cce[_0x65ec('0x2d')];agents[_0x134cce[_0x65ec('0x10')]][_0x65ec('0x22')]=_0x134cce[_0x65ec('0x23')];agents[_0x134cce[_0x65ec('0x10')]][_0x65ec('0x8')]=_0x65ec('0x2e');_[_0x65ec('0x26')](agents,function(_0x2ce56f,_0x3561ef){if(_0x2ce56f['destuniqueid']!=_0x134cce[_0x65ec('0x10')]&&_0x2ce56f['uniqueid']==_0x134cce[_0x65ec('0x4')]){_0x2ce56f[_0x65ec('0x24')]=0x0;_0x2ce56f[_0x65ec('0x22')]=_0x134cce[_0x65ec('0x23')];_0x2ce56f[_0x65ec('0x1b')]=!![];_0x2ce56f[_0x65ec('0x1f')]=utils['now']();_0x2ce56f[_0x65ec('0x8')]='answered_elsewhere';_0x2ce56f['reason']=_0x65ec('0x2f');_0x2ce56f[_0x65ec('0x30')]=_0x134cce[_0x65ec('0x10')];_0x2ce56f[_0x65ec('0x31')]=_0x134cce[_0x65ec('0x19')];writeDB(_0x2ce56f);}});}}catch(_0x524235){utils['error'](util[_0x65ec('0x3')](_0x65ec('0x2c'),_0x134cce[_0x65ec('0x4')]),_0x524235);}};exports[_0x65ec('0x32')]=function(_0x11edd1){try{if(!_['isNil'](agents[_0x11edd1['destuniqueid']])){utils[_0x65ec('0x12')](util[_0x65ec('0x3')](_0x65ec('0x33'),_0x11edd1[_0x65ec('0x4')]),_0x11edd1);utils[_0x65ec('0x17')](util[_0x65ec('0x3')](_0x65ec('0x34'),_0x11edd1['uniqueid'],agents[_0x11edd1[_0x65ec('0x10')]][_0x65ec('0x19')],_0x11edd1[_0x65ec('0x10')]));agents[_0x11edd1['destuniqueid']][_0x65ec('0x32')]=!![];agents[_0x11edd1[_0x65ec('0x10')]]['agentcompleteAt']=utils[_0x65ec('0x15')]();agents[_0x11edd1[_0x65ec('0x10')]][_0x65ec('0x24')]=utils[_0x65ec('0x35')](agents[_0x11edd1[_0x65ec('0x10')]]['agentcompleteAt'],agents[_0x11edd1[_0x65ec('0x10')]][_0x65ec('0x36')]);agents[_0x11edd1[_0x65ec('0x10')]][_0x65ec('0x21')]=_0x11edd1['reason'];agents[_0x11edd1[_0x65ec('0x10')]]['lastevent']=_0x65ec('0x37');writeDB(agents[_0x11edd1[_0x65ec('0x10')]]);}}catch(_0x3095f5){utils['error'](util['format'](_0x65ec('0x33'),_0x11edd1[_0x65ec('0x4')]),_0x3095f5);}};exports[_0x65ec('0x38')]=function(_0x2111af){try{if(!_[_0x65ec('0x1c')](agents[_0x2111af[_0x65ec('0x39')]])){utils[_0x65ec('0x12')](util[_0x65ec('0x3')](_0x65ec('0x3a'),_0x2111af[_0x65ec('0x4')]),_0x2111af);utils[_0x65ec('0x17')](util[_0x65ec('0x3')](_0x65ec('0x3b'),_0x2111af[_0x65ec('0x4')],agents[_0x2111af[_0x65ec('0x39')]][_0x65ec('0x19')],agents[_0x2111af[_0x65ec('0x39')]]['uniqueid']));agents[_0x2111af[_0x65ec('0x39')]][_0x65ec('0x3c')]=!![];agents[_0x2111af['transfereruniqueid']][_0x65ec('0x3d')]=_0x65ec('0x3e');agents[_0x2111af[_0x65ec('0x39')]]['transferexten']=_0x2111af[_0x65ec('0x3f')];agents[_0x2111af[_0x65ec('0x39')]][_0x65ec('0x40')]=agents[_0x2111af['transfereruniqueid']][_0x65ec('0x4')];}}catch(_0x5e5e48){utils['error'](util[_0x65ec('0x3')](_0x65ec('0x3a'),_0x2111af[_0x65ec('0x4')]),_0x5e5e48);}};exports['attendedtransfer']=function(_0x2df855){try{utils[_0x65ec('0x12')](util[_0x65ec('0x3')](_0x65ec('0x41'),_0x2df855[_0x65ec('0x42')]),_0x2df855);if(_0x2df855[_0x65ec('0x42')]==_0x2df855[_0x65ec('0x43')]){if(!_[_0x65ec('0x1c')](agents[_0x2df855[_0x65ec('0x44')]])){utils['info'](util['format'](_0x65ec('0x45'),_0x2df855['origtransfereruniqueid'],agents[_0x2df855[_0x65ec('0x44')]]['membername']));agents[_0x2df855[_0x65ec('0x44')]][_0x65ec('0x3c')]=!![];agents[_0x2df855[_0x65ec('0x44')]][_0x65ec('0x3d')]=_0x65ec('0x46');agents[_0x2df855[_0x65ec('0x44')]][_0x65ec('0x47')]=_0x2df855['origtransfererexten'];agents[_0x2df855[_0x65ec('0x44')]][_0x65ec('0x40')]=_0x2df855[_0x65ec('0x42')];}if(_0x2df855[_0x65ec('0x48')]&&agents[_0x2df855[_0x65ec('0x48')]]){agents[_0x2df855['transfereeuniqueid']][_0x65ec('0x49')]=0x1;transfers[_0x2df855[_0x65ec('0x48')]]=_[_0x65ec('0x4a')](agents[_0x2df855[_0x65ec('0x48')]]);transfers[_0x2df855[_0x65ec('0x48')]][_0x65ec('0x7')]=agents[_0x2df855[_0x65ec('0x44')]][_0x65ec('0x7')];transfers[_0x2df855['transfereeuniqueid']][_0x65ec('0x4b')]=agents[_0x2df855[_0x65ec('0x44')]][_0x65ec('0x4b')];transfers[_0x2df855[_0x65ec('0x48')]][_0x65ec('0x14')]=utils[_0x65ec('0x15')]();transfers[_0x2df855[_0x65ec('0x48')]]['agentconnectAt']=utils['now']();transfers[_0x2df855[_0x65ec('0x48')]]['holdtime']=0x0;transfers[_0x2df855[_0x65ec('0x48')]][_0x65ec('0x49')]=0x2;}}else if(_0x2df855['secondtransfereruniqueid']==_0x2df855[_0x65ec('0x4c')]){if(!_[_0x65ec('0x1c')](agents[_0x2df855[_0x65ec('0x42')]])){utils[_0x65ec('0x17')](util[_0x65ec('0x3')](_0x65ec('0x45'),_0x2df855[_0x65ec('0x42')],agents[_0x2df855['origtransfereruniqueid']]['membername']));agents[_0x2df855[_0x65ec('0x42')]][_0x65ec('0x3c')]=!![];agents[_0x2df855[_0x65ec('0x42')]]['transfertype']=_0x65ec('0x46');agents[_0x2df855[_0x65ec('0x42')]][_0x65ec('0x47')]=_0x2df855[_0x65ec('0x4d')];agents[_0x2df855[_0x65ec('0x42')]][_0x65ec('0x40')]=_0x2df855[_0x65ec('0x44')];}if(_0x2df855['transfertargetuniqueid']&&agents[_0x2df855[_0x65ec('0x4e')]]){agents[_0x2df855[_0x65ec('0x4e')]][_0x65ec('0x49')]=0x1;transfers[_0x2df855[_0x65ec('0x4e')]]=_[_0x65ec('0x4a')](agents[_0x2df855[_0x65ec('0x4e')]]);transfers[_0x2df855[_0x65ec('0x4e')]][_0x65ec('0x7')]=agents[_0x2df855[_0x65ec('0x42')]]['calleridnum'];transfers[_0x2df855['transfertargetuniqueid']][_0x65ec('0x4b')]=agents[_0x2df855['origtransfereruniqueid']]['calleridname'];transfers[_0x2df855[_0x65ec('0x4e')]][_0x65ec('0x14')]=utils[_0x65ec('0x15')]();transfers[_0x2df855['transfertargetuniqueid']]['agentconnectAt']=utils[_0x65ec('0x15')]();transfers[_0x2df855['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0x2df855['transfertargetuniqueid']][_0x65ec('0x49')]=0x2;}}}catch(_0x4f52ed){utils[_0x65ec('0x1a')](util[_0x65ec('0x3')](_0x65ec('0x41'),_0x2df855['origtransfereruniqueid']),_0x4f52ed);}};exports['hangup']=function(_0x258e14){try{utils['debug'](util[_0x65ec('0x3')](_0x65ec('0x4f'),_0x258e14[_0x65ec('0x4')]),_0x258e14);if(agents[_0x258e14[_0x65ec('0x4')]]&&agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x21')]===_0x65ec('0x20')){if(_0x258e14[_0x65ec('0x50')]==='21'){agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x21')]='rejected';agents[_0x258e14[_0x65ec('0x4')]]['lastevent']=_0x65ec('0x51');}utils[_0x65ec('0x17')](util[_0x65ec('0x3')](_0x65ec('0x52'),_0x258e14['uniqueid'],agents[_0x258e14[_0x65ec('0x4')]]['membername'],agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x21')],agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x8')]));writeDB(agents[_0x258e14['uniqueid']]);var _0x5307ac=unanswered['indexOf'](_0x258e14[_0x65ec('0x4')]);if(_0x5307ac>-0x1){unanswered[_0x65ec('0x53')](_0x5307ac,0x1);}}if(transfers[_0x258e14[_0x65ec('0x4')]]){transfers[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x32')]=!![];transfers[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x54')]=utils[_0x65ec('0x15')]();transfers[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x24')]=utils[_0x65ec('0x35')](transfers[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x54')],transfers[_0x258e14['uniqueid']][_0x65ec('0x36')]);transfers[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x21')]=_0x65ec('0x55');transfers[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x8')]=_0x65ec('0x37');utils[_0x65ec('0x17')](util[_0x65ec('0x3')](_0x65ec('0x52'),_0x258e14['uniqueid'],transfers[_0x258e14[_0x65ec('0x4')]]['membername'],transfers[_0x258e14['uniqueid']][_0x65ec('0x21')],transfers[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x8')]));writeDB(transfers[_0x258e14[_0x65ec('0x4')]],!![]);}if(agents[_0x258e14[_0x65ec('0x4')]]&&agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x36')]){agents[_0x258e14[_0x65ec('0x4')]]['agentcomplete']=!![];agents[_0x258e14[_0x65ec('0x4')]]['agentcompleteAt']=utils[_0x65ec('0x15')]();agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x24')]=utils['diffTime'](agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x54')],agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x36')]);agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x21')]=agents[_0x258e14[_0x65ec('0x4')]]['transfer']?_0x65ec('0x3c'):_0x65ec('0x55');agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x8')]='complete';utils['info'](util[_0x65ec('0x3')](_0x65ec('0x52'),_0x258e14[_0x65ec('0x4')],agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x19')],agents[_0x258e14[_0x65ec('0x4')]]['reason'],agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x8')]));writeDB(agents[_0x258e14[_0x65ec('0x4')]]);}}catch(_0x127e67){utils[_0x65ec('0x1a')](util[_0x65ec('0x3')](_0x65ec('0x4f'),_0x258e14[_0x65ec('0x4')]),_0x127e67);}}; \ No newline at end of file +var _0xb7e7=['answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridname','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','./utils','format','uniqueid','channel','queue','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','destuniqueid','agentcalledAt','now','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','timeout','holdtime','ringtime','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','talktime','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere'];(function(_0x590506,_0x15243){var _0x34ca29=function(_0x4589fa){while(--_0x4589fa){_0x590506['push'](_0x590506['shift']());}};_0x34ca29(++_0x15243);}(_0xb7e7,0x121));var _0x7b7e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xb7e7[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var utils=require(_0x7b7e('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x518dc6,_0x1b7cc7){utils['info'](util[_0x7b7e('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x518dc6[_0x7b7e('0x3')],_0x518dc6[_0x7b7e('0x4')],_0x518dc6[_0x7b7e('0x5')],_0x518dc6['membername'],_0x518dc6['interface'],_0x518dc6[_0x7b7e('0x6')],_0x518dc6[_0x7b7e('0x7')],_0x518dc6[_0x7b7e('0x8')]));if(_0x518dc6['queue']){utils[_0x7b7e('0x9')](_0x518dc6[_0x7b7e('0x5')])[_0x7b7e('0xa')](function(_0x1647e5){if(_0x1647e5){_0x518dc6[_0x7b7e('0xb')]=_0x1647e5[_0x7b7e('0xb')];_0x518dc6[_0x7b7e('0xc')]=_0x518dc6['agentcomplete']?_0x1647e5[_0x7b7e('0xd')]:![];_0x518dc6[_0x7b7e('0xe')]=_0x518dc6[_0x7b7e('0xc')]?_0x1647e5[_0x7b7e('0xf')]:0x0;}utils[_0x7b7e('0x10')](_0x7b7e('0x11'),_0x518dc6);});}else{utils[_0x7b7e('0x10')](_0x7b7e('0x11'),_0x518dc6);}if(_0x1b7cc7){delete transfers[_0x518dc6[_0x7b7e('0x3')]];}else{delete agents[_0x518dc6['destuniqueid']];}}exports[_0x7b7e('0x12')]=function(_0x430eab){try{utils['debug'](util[_0x7b7e('0x2')]('[%s][agents][agentcalled]',_0x430eab['uniqueid']),_0x430eab);agents[_0x430eab[_0x7b7e('0x13')]]=_0x430eab;agents[_0x430eab[_0x7b7e('0x13')]][_0x7b7e('0x14')]=utils[_0x7b7e('0x15')]();agents[_0x430eab[_0x7b7e('0x13')]]['lastevent']='called';agents[_0x430eab[_0x7b7e('0x13')]][_0x7b7e('0x7')]=null;agents[_0x430eab[_0x7b7e('0x13')]][_0x7b7e('0x16')]=null;utils[_0x7b7e('0x17')](util[_0x7b7e('0x2')](_0x7b7e('0x18'),_0x430eab[_0x7b7e('0x3')],agents[_0x430eab[_0x7b7e('0x13')]][_0x7b7e('0x19')],_0x430eab[_0x7b7e('0x13')]));}catch(_0x14f4fe){utils[_0x7b7e('0x1a')](util[_0x7b7e('0x2')](_0x7b7e('0x1b'),_0x430eab[_0x7b7e('0x3')]),_0x14f4fe);}};exports[_0x7b7e('0x1c')]=function(_0x49eddb){try{if(!_[_0x7b7e('0x1d')](agents[_0x49eddb[_0x7b7e('0x13')]])){utils[_0x7b7e('0x1e')](util['format'](_0x7b7e('0x1f'),_0x49eddb[_0x7b7e('0x3')]),_0x49eddb);utils[_0x7b7e('0x17')](util[_0x7b7e('0x2')](_0x7b7e('0x20'),_0x49eddb[_0x7b7e('0x3')],agents[_0x49eddb[_0x7b7e('0x13')]][_0x7b7e('0x19')],_0x49eddb['destuniqueid']));agents[_0x49eddb['destuniqueid']]['agentringnoanswer']=!![];agents[_0x49eddb[_0x7b7e('0x13')]][_0x7b7e('0x21')]=utils[_0x7b7e('0x15')]();agents[_0x49eddb['destuniqueid']]['lastevent']='timeout';agents[_0x49eddb[_0x7b7e('0x13')]][_0x7b7e('0x22')]=_0x7b7e('0x23');agents[_0x49eddb[_0x7b7e('0x13')]][_0x7b7e('0x24')]=_0x49eddb['ringtime']?parseInt(_0x49eddb[_0x7b7e('0x25')])/0x3e8:0x0;agents[_0x49eddb[_0x7b7e('0x13')]]['talktime']=0x0;unanswered['push'](_0x49eddb['destuniqueid']);}}catch(_0x12ef0b){utils[_0x7b7e('0x1a')](util['format'](_0x7b7e('0x1f'),_0x49eddb['uniqueid']),_0x12ef0b);}};exports[_0x7b7e('0x26')]=function(_0xb9b6bf){try{_[_0x7b7e('0x27')](agents,function(_0x5515ca,_0x3960b8){if(_0x5515ca[_0x7b7e('0x3')]==_0xb9b6bf[_0x7b7e('0x3')]&&!_[_0x7b7e('0x28')](unanswered,_0x5515ca[_0x7b7e('0x13')])){utils['debug'](util[_0x7b7e('0x2')]('[%s][agents][queuecallerabandon]',_0xb9b6bf[_0x7b7e('0x3')]),_0xb9b6bf);utils[_0x7b7e('0x17')](util[_0x7b7e('0x2')](_0x7b7e('0x29'),_0xb9b6bf[_0x7b7e('0x3')],_0x5515ca[_0x7b7e('0x19')],_0x5515ca[_0x7b7e('0x13')]));_0x5515ca['agentringnoanswer']=!![];_0x5515ca['agentringnoanswerAt']=utils[_0x7b7e('0x15')]();_0x5515ca[_0x7b7e('0x8')]='abandoned';_0x5515ca[_0x7b7e('0x22')]=_0x7b7e('0x2a');_0x5515ca[_0x7b7e('0x24')]=_0xb9b6bf['holdtime'];_0x5515ca[_0x7b7e('0x2b')]=0x0;writeDB(_0x5515ca);}});}catch(_0x256908){utils[_0x7b7e('0x1a')](util[_0x7b7e('0x2')](_0x7b7e('0x2c'),_0xb9b6bf[_0x7b7e('0x3')]),_0x256908);}};exports[_0x7b7e('0x2d')]=function(_0x202f04){try{if(agents[_0x202f04[_0x7b7e('0x13')]]){utils[_0x7b7e('0x1e')](util[_0x7b7e('0x2')](_0x7b7e('0x2e'),_0x202f04[_0x7b7e('0x3')]),_0x202f04);utils[_0x7b7e('0x17')](util[_0x7b7e('0x2')](_0x7b7e('0x2f'),_0x202f04['uniqueid'],agents[_0x202f04[_0x7b7e('0x13')]][_0x7b7e('0x19')],_0x202f04[_0x7b7e('0x13')]));agents[_0x202f04[_0x7b7e('0x13')]][_0x7b7e('0x30')]=utils[_0x7b7e('0x15')]();agents[_0x202f04[_0x7b7e('0x13')]][_0x7b7e('0x7')]=_0x202f04[_0x7b7e('0x7')];agents[_0x202f04[_0x7b7e('0x13')]]['connectedlinename']=_0x202f04[_0x7b7e('0x16')];agents[_0x202f04[_0x7b7e('0x13')]][_0x7b7e('0x24')]=_0x202f04[_0x7b7e('0x25')];agents[_0x202f04['destuniqueid']][_0x7b7e('0x8')]=_0x7b7e('0x31');_[_0x7b7e('0x27')](agents,function(_0x5c58c0,_0x4a2888){if(_0x5c58c0[_0x7b7e('0x13')]!=_0x202f04['destuniqueid']&&_0x5c58c0[_0x7b7e('0x3')]==_0x202f04[_0x7b7e('0x3')]){_0x5c58c0['talktime']=0x0;_0x5c58c0[_0x7b7e('0x24')]=_0x202f04[_0x7b7e('0x25')];_0x5c58c0[_0x7b7e('0x1c')]=!![];_0x5c58c0[_0x7b7e('0x21')]=utils[_0x7b7e('0x15')]();_0x5c58c0[_0x7b7e('0x8')]=_0x7b7e('0x32');_0x5c58c0[_0x7b7e('0x22')]=_0x7b7e('0x32');_0x5c58c0['answeredelsewheredestinationuniqueid']=_0x202f04['destuniqueid'];_0x5c58c0[_0x7b7e('0x33')]=_0x202f04['membername'];writeDB(_0x5c58c0);}});}}catch(_0x41c8a6){utils['error'](util['format'](_0x7b7e('0x2e'),_0x202f04['uniqueid']),_0x41c8a6);}};exports[_0x7b7e('0x34')]=function(_0x52051c){try{if(!_[_0x7b7e('0x1d')](agents[_0x52051c[_0x7b7e('0x13')]])){utils[_0x7b7e('0x1e')](util[_0x7b7e('0x2')]('[%s][agents][agentcomplete]',_0x52051c[_0x7b7e('0x3')]),_0x52051c);utils[_0x7b7e('0x17')](util[_0x7b7e('0x2')](_0x7b7e('0x35'),_0x52051c[_0x7b7e('0x3')],agents[_0x52051c[_0x7b7e('0x13')]]['membername'],_0x52051c['destuniqueid']));agents[_0x52051c['destuniqueid']][_0x7b7e('0x34')]=!![];agents[_0x52051c[_0x7b7e('0x13')]][_0x7b7e('0x36')]=utils[_0x7b7e('0x15')]();agents[_0x52051c[_0x7b7e('0x13')]][_0x7b7e('0x2b')]=utils['diffTime'](agents[_0x52051c[_0x7b7e('0x13')]][_0x7b7e('0x36')],agents[_0x52051c['destuniqueid']]['agentconnectAt']);agents[_0x52051c[_0x7b7e('0x13')]][_0x7b7e('0x22')]=_0x52051c[_0x7b7e('0x22')];agents[_0x52051c[_0x7b7e('0x13')]][_0x7b7e('0x8')]=_0x7b7e('0x37');writeDB(agents[_0x52051c['destuniqueid']]);}}catch(_0x2673eb){utils['error'](util[_0x7b7e('0x2')](_0x7b7e('0x38'),_0x52051c[_0x7b7e('0x3')]),_0x2673eb);}};exports[_0x7b7e('0x39')]=function(_0x58e4e6){try{if(!_[_0x7b7e('0x1d')](agents[_0x58e4e6[_0x7b7e('0x3a')]])){utils[_0x7b7e('0x1e')](util[_0x7b7e('0x2')](_0x7b7e('0x3b'),_0x58e4e6['uniqueid']),_0x58e4e6);utils[_0x7b7e('0x17')](util[_0x7b7e('0x2')](_0x7b7e('0x3c'),_0x58e4e6[_0x7b7e('0x3')],agents[_0x58e4e6[_0x7b7e('0x3a')]]['membername'],agents[_0x58e4e6[_0x7b7e('0x3a')]][_0x7b7e('0x3')]));agents[_0x58e4e6[_0x7b7e('0x3a')]][_0x7b7e('0x3d')]=!![];agents[_0x58e4e6[_0x7b7e('0x3a')]][_0x7b7e('0x3e')]=_0x7b7e('0x3f');agents[_0x58e4e6['transfereruniqueid']][_0x7b7e('0x40')]=_0x58e4e6['extension'];agents[_0x58e4e6[_0x7b7e('0x3a')]][_0x7b7e('0x41')]=agents[_0x58e4e6['transfereruniqueid']][_0x7b7e('0x3')];}}catch(_0x44e3a0){utils[_0x7b7e('0x1a')](util[_0x7b7e('0x2')](_0x7b7e('0x3b'),_0x58e4e6[_0x7b7e('0x3')]),_0x44e3a0);}};exports[_0x7b7e('0x42')]=function(_0x5f15ce){try{utils[_0x7b7e('0x1e')](util[_0x7b7e('0x2')](_0x7b7e('0x43'),_0x5f15ce[_0x7b7e('0x44')]),_0x5f15ce);if(_0x5f15ce['origtransfereruniqueid']==_0x5f15ce['origtransfererlinkedid']){if(!_['isNil'](agents[_0x5f15ce[_0x7b7e('0x45')]])){utils[_0x7b7e('0x17')](util[_0x7b7e('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x5f15ce['origtransfereruniqueid'],agents[_0x5f15ce[_0x7b7e('0x45')]][_0x7b7e('0x19')]));agents[_0x5f15ce['secondtransfereruniqueid']][_0x7b7e('0x3d')]=!![];agents[_0x5f15ce[_0x7b7e('0x45')]][_0x7b7e('0x3e')]='ATTENDED';agents[_0x5f15ce[_0x7b7e('0x45')]][_0x7b7e('0x40')]=_0x5f15ce['origtransfererexten'];agents[_0x5f15ce[_0x7b7e('0x45')]][_0x7b7e('0x41')]=_0x5f15ce[_0x7b7e('0x44')];}if(_0x5f15ce[_0x7b7e('0x46')]&&agents[_0x5f15ce[_0x7b7e('0x46')]]){agents[_0x5f15ce[_0x7b7e('0x46')]][_0x7b7e('0x47')]=0x1;transfers[_0x5f15ce[_0x7b7e('0x46')]]=_[_0x7b7e('0x48')](agents[_0x5f15ce['transfereeuniqueid']]);transfers[_0x5f15ce[_0x7b7e('0x46')]][_0x7b7e('0x6')]=agents[_0x5f15ce['secondtransfereruniqueid']][_0x7b7e('0x6')];transfers[_0x5f15ce[_0x7b7e('0x46')]][_0x7b7e('0x49')]=agents[_0x5f15ce['secondtransfereruniqueid']][_0x7b7e('0x49')];transfers[_0x5f15ce['transfereeuniqueid']][_0x7b7e('0x14')]=utils[_0x7b7e('0x15')]();transfers[_0x5f15ce['transfereeuniqueid']][_0x7b7e('0x30')]=utils[_0x7b7e('0x15')]();transfers[_0x5f15ce['transfereeuniqueid']][_0x7b7e('0x24')]=0x0;transfers[_0x5f15ce[_0x7b7e('0x46')]][_0x7b7e('0x47')]=0x2;}}else if(_0x5f15ce[_0x7b7e('0x45')]==_0x5f15ce['secondtransfererlinkedid']){if(!_[_0x7b7e('0x1d')](agents[_0x5f15ce[_0x7b7e('0x44')]])){utils[_0x7b7e('0x17')](util[_0x7b7e('0x2')](_0x7b7e('0x4a'),_0x5f15ce[_0x7b7e('0x44')],agents[_0x5f15ce[_0x7b7e('0x44')]][_0x7b7e('0x19')]));agents[_0x5f15ce[_0x7b7e('0x44')]][_0x7b7e('0x3d')]=!![];agents[_0x5f15ce['origtransfereruniqueid']][_0x7b7e('0x3e')]='ATTENDED';agents[_0x5f15ce['origtransfereruniqueid']][_0x7b7e('0x40')]=_0x5f15ce[_0x7b7e('0x4b')];agents[_0x5f15ce[_0x7b7e('0x44')]][_0x7b7e('0x41')]=_0x5f15ce['secondtransfereruniqueid'];}if(_0x5f15ce[_0x7b7e('0x4c')]&&agents[_0x5f15ce[_0x7b7e('0x4c')]]){agents[_0x5f15ce[_0x7b7e('0x4c')]][_0x7b7e('0x47')]=0x1;transfers[_0x5f15ce[_0x7b7e('0x4c')]]=_[_0x7b7e('0x48')](agents[_0x5f15ce['transfertargetuniqueid']]);transfers[_0x5f15ce[_0x7b7e('0x4c')]]['calleridnum']=agents[_0x5f15ce['origtransfereruniqueid']][_0x7b7e('0x6')];transfers[_0x5f15ce['transfertargetuniqueid']][_0x7b7e('0x49')]=agents[_0x5f15ce['origtransfereruniqueid']][_0x7b7e('0x49')];transfers[_0x5f15ce[_0x7b7e('0x4c')]]['agentcalledAt']=utils[_0x7b7e('0x15')]();transfers[_0x5f15ce[_0x7b7e('0x4c')]]['agentconnectAt']=utils[_0x7b7e('0x15')]();transfers[_0x5f15ce[_0x7b7e('0x4c')]][_0x7b7e('0x24')]=0x0;transfers[_0x5f15ce[_0x7b7e('0x4c')]][_0x7b7e('0x47')]=0x2;}}}catch(_0x2147d9){utils[_0x7b7e('0x1a')](util[_0x7b7e('0x2')](_0x7b7e('0x43'),_0x5f15ce[_0x7b7e('0x44')]),_0x2147d9);}};exports['hangup']=function(_0x59ecf9){try{utils[_0x7b7e('0x1e')](util[_0x7b7e('0x2')](_0x7b7e('0x4d'),_0x59ecf9[_0x7b7e('0x3')]),_0x59ecf9);if(agents[_0x59ecf9[_0x7b7e('0x3')]]&&agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x22')]==='timeout'){if(_0x59ecf9[_0x7b7e('0x4e')]==='21'){agents[_0x59ecf9[_0x7b7e('0x3')]]['reason']=_0x7b7e('0x4f');agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x8')]=_0x7b7e('0x4f');}utils[_0x7b7e('0x17')](util[_0x7b7e('0x2')](_0x7b7e('0x50'),_0x59ecf9[_0x7b7e('0x3')],agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x19')],agents[_0x59ecf9[_0x7b7e('0x3')]]['reason'],agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x8')]));writeDB(agents[_0x59ecf9[_0x7b7e('0x3')]]);var _0x122053=unanswered[_0x7b7e('0x51')](_0x59ecf9[_0x7b7e('0x3')]);if(_0x122053>-0x1){unanswered[_0x7b7e('0x52')](_0x122053,0x1);}}if(transfers[_0x59ecf9['uniqueid']]){transfers[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x34')]=!![];transfers[_0x59ecf9[_0x7b7e('0x3')]]['agentcompleteAt']=utils[_0x7b7e('0x15')]();transfers[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x2b')]=utils[_0x7b7e('0x53')](transfers[_0x59ecf9[_0x7b7e('0x3')]]['agentcompleteAt'],transfers[_0x59ecf9['uniqueid']]['agentconnectAt']);transfers[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x22')]=_0x7b7e('0x54');transfers[_0x59ecf9['uniqueid']][_0x7b7e('0x8')]=_0x7b7e('0x37');utils[_0x7b7e('0x17')](util['format'](_0x7b7e('0x50'),_0x59ecf9[_0x7b7e('0x3')],transfers[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x19')],transfers[_0x59ecf9['uniqueid']][_0x7b7e('0x22')],transfers[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x8')]));writeDB(transfers[_0x59ecf9[_0x7b7e('0x3')]],!![]);}if(agents[_0x59ecf9['uniqueid']]&&agents[_0x59ecf9['uniqueid']][_0x7b7e('0x30')]){agents[_0x59ecf9['uniqueid']][_0x7b7e('0x34')]=!![];agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x36')]=utils[_0x7b7e('0x15')]();agents[_0x59ecf9['uniqueid']][_0x7b7e('0x2b')]=utils[_0x7b7e('0x53')](agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x36')],agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x30')]);agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x22')]=agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x3d')]?_0x7b7e('0x3d'):_0x7b7e('0x54');agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x8')]=_0x7b7e('0x37');utils[_0x7b7e('0x17')](util['format'](_0x7b7e('0x50'),_0x59ecf9[_0x7b7e('0x3')],agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x19')],agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x22')],agents[_0x59ecf9[_0x7b7e('0x3')]]['lastevent']));writeDB(agents[_0x59ecf9[_0x7b7e('0x3')]]);}}catch(_0x3880be){utils[_0x7b7e('0x1a')](util[_0x7b7e('0x2')](_0x7b7e('0x4d'),_0x59ecf9['uniqueid']),_0x3880be);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 3690bde..27929e9 100644 --- a/server/services/xdr/calls.controller.js +++ b/server/services/xdr/calls.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca9a=['musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','toLowerCase','appdata','cdr','substring','lastIndexOf','includes','noop','execif','set','gotoif','application','lastapplication','[%s][calls][newexten]','lodash','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','uniqueid','newchannel','debug','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','now','error','[%s][calls][newchannel]','newstate','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','channelstate','transfer','answertime','disposition','toNumber','hangup','callerid','cause-txt','duration','diffTime','starttime','billableseconds','endtime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','destinationchannel','userfield','transfertargetchannel','origtransfererchannel','_attended'];(function(_0x65c0bb,_0x82e7b8){var _0x320bd5=function(_0x6e1675){while(--_0x6e1675){_0x65c0bb['push'](_0x65c0bb['shift']());}};_0x320bd5(++_0x82e7b8);}(_0xca9a,0x172));var _0xaca9=function(_0x537217,_0x3f38b3){_0x537217=_0x537217-0x0;var _0x34aeb6=_0xca9a[_0x537217];return _0x34aeb6;};'use strict';var _=require(_0xaca9('0x0'));var util=require(_0xaca9('0x1'));var utils=require(_0xaca9('0x2'));var dispositions=['NO\x20ANSWER',_0xaca9('0x3'),_0xaca9('0x3'),_0xaca9('0x4'),_0xaca9('0x4'),_0xaca9('0x4'),_0xaca9('0x5'),_0xaca9('0x6'),_0xaca9('0x3'),_0xaca9('0x3'),'FAILED'];var channels={};function writeDB(_0xad8b45){utils[_0xaca9('0x7')](util[_0xaca9('0x8')](_0xaca9('0x9'),_0xad8b45['uniqueid'],_0xad8b45['channel'],_0xad8b45[_0xaca9('0xa')],_0xad8b45[_0xaca9('0xb')],_0xad8b45[_0xaca9('0xc')],_0xad8b45[_0xaca9('0xd')],_0xad8b45[_0xaca9('0xe')],_0xad8b45[_0xaca9('0xf')]));if(_0xad8b45[_0xaca9('0x10')]){utils[_0xaca9('0x11')](_0xad8b45['accountcode'])[_0xaca9('0x12')](function(_0xee4eb8){if(_0xee4eb8){_0xad8b45[_0xaca9('0x13')]=_0xee4eb8['id'];}utils[_0xaca9('0x14')](_0xaca9('0x15'),_0xad8b45);});}else{utils[_0xaca9('0x14')]('CreateVoiceCallReport',_0xad8b45);}if(channels[_0xad8b45[_0xaca9('0x16')]]){delete channels[_0xad8b45[_0xaca9('0x16')]];}}exports[_0xaca9('0x17')]=function(_0x1f6d5f){try{utils[_0xaca9('0x18')](util['format']('[%s][calls][newchannel]',_0x1f6d5f[_0xaca9('0x16')]),_0x1f6d5f);if(_0x1f6d5f[_0xaca9('0x16')]==_0x1f6d5f['linkedid']&&_0x1f6d5f[_0xaca9('0x19')]!=_0xaca9('0x1a')){utils['info'](util['format'](_0xaca9('0x1b'),_0x1f6d5f[_0xaca9('0x16')],_0x1f6d5f['context'],_0x1f6d5f['exten']));channels[_0x1f6d5f[_0xaca9('0x16')]]={'uniqueid':_0x1f6d5f[_0xaca9('0x16')],'accountcode':_0x1f6d5f[_0xaca9('0x10')],'source':_0x1f6d5f[_0xaca9('0xd')],'destination':_0x1f6d5f['exten'],'destinationcontext':_0x1f6d5f[_0xaca9('0x1c')],'channel':_0x1f6d5f[_0xaca9('0x19')],'starttime':utils[_0xaca9('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xaca9('0x4'),'amaflags':'DOCUMENTATION'};}}catch(_0x2808a7){utils[_0xaca9('0x1e')](util['format'](_0xaca9('0x1f'),_0x1f6d5f[_0xaca9('0x16')]),_0x2808a7);}};exports[_0xaca9('0x20')]=function(_0x1f0427){try{utils[_0xaca9('0x18')](util[_0xaca9('0x8')]('[%s][calls][newstate]',_0x1f0427[_0xaca9('0x16')]),_0x1f0427);if(!_[_0xaca9('0x21')](channels[_0x1f0427['uniqueid']])&&_0x1f0427['channelstate']==0x6){utils[_0xaca9('0x7')](util[_0xaca9('0x8')](_0xaca9('0x22'),_0x1f0427[_0xaca9('0x16')],_0x1f0427['context'],_0x1f0427[_0xaca9('0x19')]));if(_[_0xaca9('0x21')](channels[_0x1f0427['uniqueid']][_0xaca9('0x23')])){channels[_0x1f0427[_0xaca9('0x16')]][_0xaca9('0x23')]=utils[_0xaca9('0x1d')]();}}else if(!_['isNil'](channels[_0x1f0427[_0xaca9('0x24')]])&&_0x1f0427[_0xaca9('0x25')]==0x6&&_0x1f0427['context']!=_0xaca9('0x26')){utils[_0xaca9('0x7')](util['format']('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x1f0427[_0xaca9('0x16')],_0x1f0427[_0xaca9('0x24')],_0x1f0427[_0xaca9('0x1c')],_0x1f0427['channel']));channels[_0x1f0427[_0xaca9('0x24')]][_0xaca9('0x10')]=_0x1f0427[_0xaca9('0x10')];channels[_0x1f0427[_0xaca9('0x24')]]['destinationchannel']=_0x1f0427[_0xaca9('0x19')];if(_[_0xaca9('0x21')](channels[_0x1f0427[_0xaca9('0x24')]][_0xaca9('0x27')])){channels[_0x1f0427[_0xaca9('0x24')]][_0xaca9('0x27')]=utils[_0xaca9('0x1d')]();}channels[_0x1f0427['linkedid']][_0xaca9('0x28')]=dispositions[_[_0xaca9('0x29')](_0x1f0427['channelstate'])]||_0xaca9('0x5');}}catch(_0x172349){utils[_0xaca9('0x1e')](util[_0xaca9('0x8')]('[%s][calls][newstate]',_0x1f0427[_0xaca9('0x16')]),_0x172349);}};exports[_0xaca9('0x2a')]=function(_0xa393d8){try{if(!_[_0xaca9('0x21')](channels[_0xa393d8[_0xaca9('0x16')]])){utils[_0xaca9('0x18')](util[_0xaca9('0x8')]('[%s][calls][hangup]',_0xa393d8[_0xaca9('0x16')]),_0xa393d8);if(_[_0xaca9('0x21')](channels[_0xa393d8[_0xaca9('0x16')]]['callerid'])){channels[_0xa393d8[_0xaca9('0x16')]][_0xaca9('0x2b')]=_0xa393d8['calleridname']+'\x20<'+_0xa393d8[_0xaca9('0xd')]+'>';}utils['info'](util[_0xaca9('0x8')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0xa393d8[_0xaca9('0x16')],channels[_0xa393d8[_0xaca9('0x16')]][_0xaca9('0x2b')],_0xa393d8[_0xaca9('0x2c')]));channels[_0xa393d8[_0xaca9('0x16')]]['endtime']=utils[_0xaca9('0x1d')]();channels[_0xa393d8['uniqueid']][_0xaca9('0x2d')]=utils[_0xaca9('0x2e')](channels[_0xa393d8[_0xaca9('0x16')]]['endtime'],channels[_0xa393d8[_0xaca9('0x16')]][_0xaca9('0x2f')]);channels[_0xa393d8[_0xaca9('0x16')]][_0xaca9('0x30')]=channels[_0xa393d8[_0xaca9('0x16')]][_0xaca9('0x27')]?utils[_0xaca9('0x2e')](channels[_0xa393d8['uniqueid']][_0xaca9('0x31')],channels[_0xa393d8[_0xaca9('0x16')]][_0xaca9('0x27')]):0x0;writeDB(channels[_0xa393d8['uniqueid']]);}}catch(_0xff4d3){utils[_0xaca9('0x1e')](util[_0xaca9('0x8')](_0xaca9('0x32'),_0xa393d8[_0xaca9('0x16')]),_0xff4d3);}};exports[_0xaca9('0x33')]=function(_0x5064c5){try{if(!_[_0xaca9('0x21')](channels[_0x5064c5[_0xaca9('0x34')]])){utils['debug'](util[_0xaca9('0x8')](_0xaca9('0x35'),_0x5064c5[_0xaca9('0x36')]),_0x5064c5);if(channels[_0x5064c5[_0xaca9('0x34')]]['channel']==_0x5064c5[_0xaca9('0x37')]){utils['info'](util[_0xaca9('0x8')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5064c5[_0xaca9('0x36')],_0x5064c5[_0xaca9('0x34')],_0x5064c5[_0xaca9('0x38')]));channels[_0x5064c5[_0xaca9('0x34')]][_0xaca9('0x39')]=_0x5064c5[_0xaca9('0x38')];channels[_0x5064c5['localtwolinkedid']][_0xaca9('0x3a')]='_attended';}else if(channels[_0x5064c5[_0xaca9('0x34')]][_0xaca9('0x19')]=_0x5064c5[_0xaca9('0x3b')]){utils[_0xaca9('0x7')](util[_0xaca9('0x8')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5064c5[_0xaca9('0x36')],_0x5064c5[_0xaca9('0x34')],_0x5064c5[_0xaca9('0x3c')]));channels[_0x5064c5[_0xaca9('0x34')]]['destinationchannel']=_0x5064c5[_0xaca9('0x3c')];channels[_0x5064c5['localtwolinkedid']][_0xaca9('0x3a')]=_0xaca9('0x3d');}}}catch(_0x54b58d){utils['error'](util[_0xaca9('0x8')](_0xaca9('0x35'),_0x5064c5[_0xaca9('0x36')]),_0x54b58d);}};exports[_0xaca9('0x3e')]=function(_0x222603){try{if(!_['isNil'](channels[_0x222603[_0xaca9('0x16')]])){utils[_0xaca9('0x18')](util[_0xaca9('0x8')](_0xaca9('0x3f'),_0x222603['uniqueid']),_0x222603);channels[_0x222603[_0xaca9('0x16')]][_0xaca9('0x40')]=utils[_0xaca9('0x1d')]();utils['info'](util[_0xaca9('0x8')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x222603[_0xaca9('0x16')],channels[_0x222603[_0xaca9('0x16')]][_0xaca9('0x40')]));}}catch(_0x240f83){utils[_0xaca9('0x1e')](util[_0xaca9('0x8')](_0xaca9('0x3f'),_0x222603[_0xaca9('0x16')]),_0x240f83);}};exports[_0xaca9('0x41')]=function(_0x42838d){try{if(!_[_0xaca9('0x21')](channels[_0x42838d[_0xaca9('0x16')]])){utils[_0xaca9('0x18')](util[_0xaca9('0x8')](_0xaca9('0x42'),_0x42838d[_0xaca9('0x16')]),_0x42838d);if(!_[_0xaca9('0x21')](channels[_0x42838d['uniqueid']][_0xaca9('0x40')])){channels[_0x42838d[_0xaca9('0x16')]][_0xaca9('0x43')]+=utils['diffTime'](utils['now'](),channels[_0x42838d[_0xaca9('0x16')]][_0xaca9('0x40')]);utils['info'](util[_0xaca9('0x8')](_0xaca9('0x44'),_0x42838d[_0xaca9('0x16')],channels[_0x42838d[_0xaca9('0x16')]][_0xaca9('0x43')]));delete channels[_0x42838d['uniqueid']][_0xaca9('0x40')];}}}catch(_0xeb2e28){utils[_0xaca9('0x1e')](util['format']('[%s][calls][musiconholdstop]',_0x42838d['uniqueid']),_0xeb2e28);}};exports['varset']=function(_0xb02044){try{if(!_[_0xaca9('0x21')](channels[_0xb02044[_0xaca9('0x16')]])){utils[_0xaca9('0x18')](util[_0xaca9('0x8')](_0xaca9('0x45'),_0xb02044[_0xaca9('0x16')]),_0xb02044);if(!_[_0xaca9('0x21')](_0xb02044[_0xaca9('0x46')][_0xaca9('0x47')])){utils['info'](util['format'](_0xaca9('0x48'),_0xb02044[_0xaca9('0x16')],_0xb02044[_0xaca9('0x49')]));channels[_0xb02044[_0xaca9('0x16')]]['source']=_0xb02044[_0xaca9('0x49')];}if(!_['isNil'](_0xb02044[_0xaca9('0x46')][_0xaca9('0x4a')])){utils['info'](util[_0xaca9('0x8')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0xb02044[_0xaca9('0x16')],_0xb02044['value']));channels[_0xb02044[_0xaca9('0x16')]]['destination']=_0xb02044[_0xaca9('0x49')];channels[_0xb02044[_0xaca9('0x16')]][_0xaca9('0x2b')]='\x22'+_0xb02044[_0xaca9('0x49')]+_0xaca9('0x4b')+_0xb02044[_0xaca9('0x49')]+'>';}if(!_['isNil'](_0xb02044[_0xaca9('0x46')][_0xaca9('0x4c')])||!_[_0xaca9('0x21')](_0xb02044['variable'][_0xaca9('0x4d')])){utils[_0xaca9('0x7')](util[_0xaca9('0x8')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0xb02044[_0xaca9('0x16')],!_[_0xaca9('0x21')](_0xb02044['variable']['xmd-callerid-preview'])?_0xaca9('0x4c'):'xmd-callerid',_0xb02044[_0xaca9('0x49')]));channels[_0xb02044[_0xaca9('0x16')]][_0xaca9('0x2b')]=_0xb02044[_0xaca9('0x49')];}if(!_[_0xaca9('0x21')](_0xb02044[_0xaca9('0x46')][_0xaca9('0x4e')])||!_[_0xaca9('0x21')](_0xb02044['variable'][_0xaca9('0x4f')])){utils[_0xaca9('0x7')](util[_0xaca9('0x8')](_0xaca9('0x50'),_0xb02044[_0xaca9('0x16')],!_[_0xaca9('0x21')](_0xb02044[_0xaca9('0x46')][_0xaca9('0x4e')])?_0xaca9('0x4e'):_0xaca9('0x4f'),_0xb02044[_0xaca9('0x49')]));channels[_0xb02044[_0xaca9('0x16')]]['lastapplication']='Queue';channels[_0xb02044[_0xaca9('0x16')]][_0xaca9('0x51')]=_0xb02044[_0xaca9('0x49')];channels[_0xb02044[_0xaca9('0x16')]][_0xaca9('0xa')]=!![];}if(!_[_0xaca9('0x21')](_0xb02044[_0xaca9('0x46')][_0xaca9('0x52')])){utils[_0xaca9('0x7')](util[_0xaca9('0x8')](_0xaca9('0x53'),_0xb02044[_0xaca9('0x16')],_0xb02044['value']));channels[_0xb02044[_0xaca9('0x16')]][_0xaca9('0x54')]=_0xb02044[_0xaca9('0x49')];}if(!_[_0xaca9('0x21')](_0xb02044['variable'][_0xaca9('0x55')])){utils['info'](util[_0xaca9('0x8')](_0xaca9('0x56'),_0xb02044[_0xaca9('0x16')],_0xb02044[_0xaca9('0x49')]));channels[_0xb02044[_0xaca9('0x16')]][_0xaca9('0x57')]=_0xb02044[_0xaca9('0x49')];}if(!_[_0xaca9('0x21')](_0xb02044['variable'][_0xaca9('0x58')])){utils[_0xaca9('0x7')](util[_0xaca9('0x8')](_0xaca9('0x59'),_0xb02044[_0xaca9('0x16')],_0xb02044[_0xaca9('0x49')]));channels[_0xb02044[_0xaca9('0x16')]][_0xaca9('0x5a')]=_0xb02044[_0xaca9('0x49')];}if(!_['isNil'](_0xb02044[_0xaca9('0x46')]['sipcallid'])){utils['info'](util[_0xaca9('0x8')](_0xaca9('0x5b'),_0xb02044[_0xaca9('0x16')],_0xb02044[_0xaca9('0x49')]));channels[_0xb02044[_0xaca9('0x16')]][_0xaca9('0x5c')]=_0xb02044['value'];}}}catch(_0x2625fe){utils[_0xaca9('0x1e')](util[_0xaca9('0x8')]('[%s][calls][varset]',_0xb02044['uniqueid']),_0x2625fe);}};exports[_0xaca9('0x5d')]=function(_0x2a4db4){try{if(!_[_0xaca9('0x21')](channels[_0x2a4db4['uniqueid']])){utils[_0xaca9('0x18')](util[_0xaca9('0x8')]('[%s][calls][newexten]',_0x2a4db4[_0xaca9('0x16')]),_0x2a4db4);utils['info'](util[_0xaca9('0x8')](_0xaca9('0x5e'),_0x2a4db4[_0xaca9('0x16')],_0x2a4db4['application'],_0x2a4db4['appdata']));if(_0x2a4db4['application'][_0xaca9('0x5f')]()=='set'&&_['startsWith'](_0x2a4db4[_0xaca9('0x60')]['toLowerCase'](),_0xaca9('0x61'))){var _0x2ffd20=_0x2a4db4['appdata']['split']('=');var _0x388afe=_0x2ffd20[0x0][_0xaca9('0x62')](_0x2ffd20[0x0]['lastIndexOf']('(')+0x1,_0x2ffd20[0x0][_0xaca9('0x63')](')'));var _0x157898=_0x2ffd20[0x1];channels[_0x2a4db4[_0xaca9('0x16')]][_0x388afe]=_0x157898;}if(!_[_0xaca9('0x64')]([_0xaca9('0x2a'),_0xaca9('0x65'),_0xaca9('0x66'),_0xaca9('0x67'),_0xaca9('0x68')],_0x2a4db4[_0xaca9('0x69')][_0xaca9('0x5f')]())){channels[_0x2a4db4[_0xaca9('0x16')]][_0xaca9('0x6a')]=_0x2a4db4[_0xaca9('0x69')];channels[_0x2a4db4['uniqueid']]['lastdata']=_0x2a4db4[_0xaca9('0x60')];}}}catch(_0x460dd9){utils['error'](util[_0xaca9('0x8')](_0xaca9('0x6b'),_0x2a4db4['uniqueid']),_0x460dd9);}}; \ No newline at end of file +var _0x7854=['musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','Queue','lastdata','queue','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','./utils','FAILED','NO\x20ANSWER','ANSWERED','info','uniqueid','channel','membername','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','format','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','error','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','diffTime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','origtransfererchannel','musiconholdstart'];(function(_0xdfd8da,_0x27e19f){var _0x21aa74=function(_0x2a5e09){while(--_0x2a5e09){_0xdfd8da['push'](_0xdfd8da['shift']());}};_0x21aa74(++_0x27e19f);}(_0x7854,0x97));var _0x4785=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x7854[_0x45f951];return _0x24756c;};'use strict';var _=require(_0x4785('0x0'));var util=require('util');var utils=require(_0x4785('0x1'));var dispositions=['NO\x20ANSWER',_0x4785('0x2'),_0x4785('0x2'),'NO\x20ANSWER',_0x4785('0x3'),_0x4785('0x3'),_0x4785('0x4'),'BUSY',_0x4785('0x2'),_0x4785('0x2'),_0x4785('0x2')];var channels={};function writeDB(_0x28da59){utils[_0x4785('0x5')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x28da59[_0x4785('0x6')],_0x28da59[_0x4785('0x7')],_0x28da59['queue'],_0x28da59[_0x4785('0x8')],_0x28da59['interface'],_0x28da59[_0x4785('0x9')],_0x28da59[_0x4785('0xa')],_0x28da59[_0x4785('0xb')]));if(_0x28da59[_0x4785('0xc')]){utils[_0x4785('0xd')](_0x28da59['accountcode'])[_0x4785('0xe')](function(_0x5bad02){if(_0x5bad02){_0x28da59[_0x4785('0xf')]=_0x5bad02['id'];}utils['request']('CreateVoiceCallReport',_0x28da59);});}else{utils[_0x4785('0x10')](_0x4785('0x11'),_0x28da59);}if(channels[_0x28da59[_0x4785('0x6')]]){delete channels[_0x28da59[_0x4785('0x6')]];}}exports[_0x4785('0x12')]=function(_0x19c49e){try{utils[_0x4785('0x13')](util['format'](_0x4785('0x14'),_0x19c49e[_0x4785('0x6')]),_0x19c49e);if(_0x19c49e[_0x4785('0x6')]==_0x19c49e[_0x4785('0x15')]&&_0x19c49e[_0x4785('0x7')]!=_0x4785('0x16')){utils['info'](util[_0x4785('0x17')](_0x4785('0x18'),_0x19c49e['uniqueid'],_0x19c49e[_0x4785('0x19')],_0x19c49e[_0x4785('0x1a')]));channels[_0x19c49e[_0x4785('0x6')]]={'uniqueid':_0x19c49e[_0x4785('0x6')],'accountcode':_0x19c49e[_0x4785('0xc')],'source':_0x19c49e[_0x4785('0x9')],'destination':_0x19c49e[_0x4785('0x1a')],'destinationcontext':_0x19c49e[_0x4785('0x19')],'channel':_0x19c49e[_0x4785('0x7')],'starttime':utils[_0x4785('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x4785('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x2e3d46){utils[_0x4785('0x1c')](util[_0x4785('0x17')]('[%s][calls][newchannel]',_0x19c49e['uniqueid']),_0x2e3d46);}};exports['newstate']=function(_0x4c8483){try{utils['debug'](util[_0x4785('0x17')](_0x4785('0x1d'),_0x4c8483[_0x4785('0x6')]),_0x4c8483);if(!_[_0x4785('0x1e')](channels[_0x4c8483[_0x4785('0x6')]])&&_0x4c8483['channelstate']==0x6){utils['info'](util['format'](_0x4785('0x1f'),_0x4c8483[_0x4785('0x6')],_0x4c8483['context'],_0x4c8483[_0x4785('0x7')]));if(_[_0x4785('0x1e')](channels[_0x4c8483['uniqueid']][_0x4785('0x20')])){channels[_0x4c8483[_0x4785('0x6')]][_0x4785('0x20')]=utils['now']();}}else if(!_[_0x4785('0x1e')](channels[_0x4c8483[_0x4785('0x15')]])&&_0x4c8483[_0x4785('0x21')]==0x6&&_0x4c8483['context']!=_0x4785('0x22')){utils['info'](util['format'](_0x4785('0x23'),_0x4c8483[_0x4785('0x6')],_0x4c8483[_0x4785('0x15')],_0x4c8483['context'],_0x4c8483[_0x4785('0x7')]));channels[_0x4c8483[_0x4785('0x15')]][_0x4785('0xc')]=_0x4c8483[_0x4785('0xc')];channels[_0x4c8483[_0x4785('0x15')]][_0x4785('0x24')]=_0x4c8483[_0x4785('0x7')];if(_[_0x4785('0x1e')](channels[_0x4c8483[_0x4785('0x15')]][_0x4785('0x25')])){channels[_0x4c8483[_0x4785('0x15')]]['answertime']=utils[_0x4785('0x1b')]();}channels[_0x4c8483[_0x4785('0x15')]][_0x4785('0x26')]=dispositions[_[_0x4785('0x27')](_0x4c8483[_0x4785('0x21')])]||'ANSWERED';}}catch(_0x4c1bfa){utils[_0x4785('0x1c')](util['format'](_0x4785('0x1d'),_0x4c8483['uniqueid']),_0x4c1bfa);}};exports['hangup']=function(_0x4a944a){try{if(!_[_0x4785('0x1e')](channels[_0x4a944a['uniqueid']])){utils[_0x4785('0x13')](util[_0x4785('0x17')](_0x4785('0x28'),_0x4a944a['uniqueid']),_0x4a944a);if(_[_0x4785('0x1e')](channels[_0x4a944a['uniqueid']][_0x4785('0x29')])){channels[_0x4a944a[_0x4785('0x6')]][_0x4785('0x29')]=_0x4a944a[_0x4785('0x2a')]+'\x20<'+_0x4a944a['calleridnum']+'>';}utils[_0x4785('0x5')](util[_0x4785('0x17')](_0x4785('0x2b'),_0x4a944a['uniqueid'],channels[_0x4a944a['uniqueid']][_0x4785('0x29')],_0x4a944a['cause-txt']));channels[_0x4a944a[_0x4785('0x6')]][_0x4785('0x2c')]=utils[_0x4785('0x1b')]();channels[_0x4a944a[_0x4785('0x6')]]['duration']=utils[_0x4785('0x2d')](channels[_0x4a944a[_0x4785('0x6')]][_0x4785('0x2c')],channels[_0x4a944a['uniqueid']]['starttime']);channels[_0x4a944a['uniqueid']][_0x4785('0x2e')]=channels[_0x4a944a['uniqueid']][_0x4785('0x25')]?utils[_0x4785('0x2d')](channels[_0x4a944a[_0x4785('0x6')]]['endtime'],channels[_0x4a944a[_0x4785('0x6')]][_0x4785('0x25')]):0x0;writeDB(channels[_0x4a944a[_0x4785('0x6')]]);}}catch(_0x365c00){utils[_0x4785('0x1c')](util[_0x4785('0x17')](_0x4785('0x28'),_0x4a944a[_0x4785('0x6')]),_0x365c00);}};exports[_0x4785('0x2f')]=function(_0x389c46){try{if(!_['isNil'](channels[_0x389c46[_0x4785('0x30')]])){utils[_0x4785('0x13')](util[_0x4785('0x17')](_0x4785('0x31'),_0x389c46['origtransfereruniqueid']),_0x389c46);if(channels[_0x389c46[_0x4785('0x30')]]['channel']==_0x389c46['transfereechannel']){utils[_0x4785('0x5')](util[_0x4785('0x17')](_0x4785('0x32'),_0x389c46[_0x4785('0x33')],_0x389c46[_0x4785('0x30')],_0x389c46[_0x4785('0x34')]));channels[_0x389c46['localtwolinkedid']][_0x4785('0x24')]=_0x389c46[_0x4785('0x34')];channels[_0x389c46[_0x4785('0x30')]][_0x4785('0x35')]=_0x4785('0x36');}else if(channels[_0x389c46[_0x4785('0x30')]]['channel']=_0x389c46['transfertargetchannel']){utils[_0x4785('0x5')](util['format'](_0x4785('0x32'),_0x389c46[_0x4785('0x33')],_0x389c46[_0x4785('0x30')],_0x389c46[_0x4785('0x37')]));channels[_0x389c46['localtwolinkedid']][_0x4785('0x24')]=_0x389c46[_0x4785('0x37')];channels[_0x389c46['localtwolinkedid']][_0x4785('0x35')]=_0x4785('0x36');}}}catch(_0x4c84dc){utils[_0x4785('0x1c')](util['format'](_0x4785('0x31'),_0x389c46[_0x4785('0x33')]),_0x4c84dc);}};exports[_0x4785('0x38')]=function(_0x1eb5c5){try{if(!_[_0x4785('0x1e')](channels[_0x1eb5c5[_0x4785('0x6')]])){utils[_0x4785('0x13')](util['format']('[%s][calls][musiconholdstart]',_0x1eb5c5[_0x4785('0x6')]),_0x1eb5c5);channels[_0x1eb5c5['uniqueid']][_0x4785('0x39')]=utils[_0x4785('0x1b')]();utils[_0x4785('0x5')](util[_0x4785('0x17')](_0x4785('0x3a'),_0x1eb5c5[_0x4785('0x6')],channels[_0x1eb5c5[_0x4785('0x6')]][_0x4785('0x39')]));}}catch(_0x10694b){utils['error'](util['format'](_0x4785('0x3b'),_0x1eb5c5['uniqueid']),_0x10694b);}};exports[_0x4785('0x3c')]=function(_0x5aa210){try{if(!_['isNil'](channels[_0x5aa210[_0x4785('0x6')]])){utils[_0x4785('0x13')](util[_0x4785('0x17')](_0x4785('0x3d'),_0x5aa210[_0x4785('0x6')]),_0x5aa210);if(!_[_0x4785('0x1e')](channels[_0x5aa210[_0x4785('0x6')]]['musiconholdstartAt'])){channels[_0x5aa210[_0x4785('0x6')]]['mohtime']+=utils[_0x4785('0x2d')](utils[_0x4785('0x1b')](),channels[_0x5aa210[_0x4785('0x6')]][_0x4785('0x39')]);utils[_0x4785('0x5')](util[_0x4785('0x17')](_0x4785('0x3e'),_0x5aa210['uniqueid'],channels[_0x5aa210[_0x4785('0x6')]][_0x4785('0x3f')]));delete channels[_0x5aa210[_0x4785('0x6')]][_0x4785('0x39')];}}}catch(_0x139fa0){utils[_0x4785('0x1c')](util[_0x4785('0x17')](_0x4785('0x3d'),_0x5aa210[_0x4785('0x6')]),_0x139fa0);}};exports[_0x4785('0x40')]=function(_0x15a07d){try{if(!_['isNil'](channels[_0x15a07d[_0x4785('0x6')]])){utils[_0x4785('0x13')](util[_0x4785('0x17')](_0x4785('0x41'),_0x15a07d[_0x4785('0x6')]),_0x15a07d);if(!_[_0x4785('0x1e')](_0x15a07d[_0x4785('0x42')]['xmd-originatecalleridnum'])){utils[_0x4785('0x5')](util[_0x4785('0x17')](_0x4785('0x43'),_0x15a07d[_0x4785('0x6')],_0x15a07d[_0x4785('0x44')]));channels[_0x15a07d['uniqueid']][_0x4785('0x45')]=_0x15a07d[_0x4785('0x44')];}if(!_[_0x4785('0x1e')](_0x15a07d[_0x4785('0x42')][_0x4785('0x46')])){utils['info'](util[_0x4785('0x17')](_0x4785('0x47'),_0x15a07d['uniqueid'],_0x15a07d[_0x4785('0x44')]));channels[_0x15a07d[_0x4785('0x6')]][_0x4785('0x48')]=_0x15a07d[_0x4785('0x44')];channels[_0x15a07d[_0x4785('0x6')]][_0x4785('0x29')]='\x22'+_0x15a07d[_0x4785('0x44')]+_0x4785('0x49')+_0x15a07d[_0x4785('0x44')]+'>';}if(!_['isNil'](_0x15a07d['variable'][_0x4785('0x4a')])||!_[_0x4785('0x1e')](_0x15a07d[_0x4785('0x42')]['xmd-callerid'])){utils[_0x4785('0x5')](util['format'](_0x4785('0x4b'),_0x15a07d[_0x4785('0x6')],!_[_0x4785('0x1e')](_0x15a07d[_0x4785('0x42')][_0x4785('0x4a')])?'xmd-callerid-preview':_0x4785('0x4c'),_0x15a07d[_0x4785('0x44')]));channels[_0x15a07d['uniqueid']][_0x4785('0x29')]=_0x15a07d[_0x4785('0x44')];}if(!_[_0x4785('0x1e')](_0x15a07d['variable'][_0x4785('0x4d')])||!_[_0x4785('0x1e')](_0x15a07d[_0x4785('0x42')][_0x4785('0x4e')])){utils[_0x4785('0x5')](util[_0x4785('0x17')](_0x4785('0x4b'),_0x15a07d[_0x4785('0x6')],!_[_0x4785('0x1e')](_0x15a07d['variable'][_0x4785('0x4d')])?_0x4785('0x4d'):'xmcs-queue',_0x15a07d['value']));channels[_0x15a07d[_0x4785('0x6')]]['lastapplication']=_0x4785('0x4f');channels[_0x15a07d[_0x4785('0x6')]][_0x4785('0x50')]=_0x15a07d[_0x4785('0x44')];channels[_0x15a07d['uniqueid']][_0x4785('0x51')]=!![];}if(!_['isNil'](_0x15a07d[_0x4785('0x42')]['xmd-contactid'])){utils[_0x4785('0x5')](util[_0x4785('0x17')](_0x4785('0x52'),_0x15a07d[_0x4785('0x6')],_0x15a07d[_0x4785('0x44')]));channels[_0x15a07d['uniqueid']][_0x4785('0x53')]=_0x15a07d[_0x4785('0x44')];}if(!_[_0x4785('0x1e')](_0x15a07d[_0x4785('0x42')][_0x4785('0x54')])){utils[_0x4785('0x5')](util[_0x4785('0x17')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x15a07d[_0x4785('0x6')],_0x15a07d['value']));channels[_0x15a07d[_0x4785('0x6')]][_0x4785('0x55')]=_0x15a07d[_0x4785('0x44')];}if(!_[_0x4785('0x1e')](_0x15a07d[_0x4785('0x42')]['outboundrouteid'])){utils[_0x4785('0x5')](util[_0x4785('0x17')](_0x4785('0x56'),_0x15a07d[_0x4785('0x6')],_0x15a07d['value']));channels[_0x15a07d[_0x4785('0x6')]]['routeid']=_0x15a07d['value'];}if(!_[_0x4785('0x1e')](_0x15a07d[_0x4785('0x42')][_0x4785('0x57')])){utils['info'](util['format'](_0x4785('0x58'),_0x15a07d[_0x4785('0x6')],_0x15a07d[_0x4785('0x44')]));channels[_0x15a07d[_0x4785('0x6')]][_0x4785('0x57')]=_0x15a07d['value'];}}}catch(_0x238fb2){utils[_0x4785('0x1c')](util[_0x4785('0x17')](_0x4785('0x41'),_0x15a07d['uniqueid']),_0x238fb2);}};exports['newexten']=function(_0x38067d){try{if(!_[_0x4785('0x1e')](channels[_0x38067d[_0x4785('0x6')]])){utils['debug'](util[_0x4785('0x17')](_0x4785('0x59'),_0x38067d['uniqueid']),_0x38067d);utils[_0x4785('0x5')](util[_0x4785('0x17')](_0x4785('0x5a'),_0x38067d[_0x4785('0x6')],_0x38067d[_0x4785('0x5b')],_0x38067d[_0x4785('0x5c')]));if(_0x38067d[_0x4785('0x5b')]['toLowerCase']()==_0x4785('0x5d')&&_[_0x4785('0x5e')](_0x38067d[_0x4785('0x5c')][_0x4785('0x5f')](),_0x4785('0x60'))){var _0x2a3085=_0x38067d[_0x4785('0x5c')][_0x4785('0x61')]('=');var _0x17dfb9=_0x2a3085[0x0][_0x4785('0x62')](_0x2a3085[0x0][_0x4785('0x63')]('(')+0x1,_0x2a3085[0x0][_0x4785('0x63')](')'));var _0x34a2b2=_0x2a3085[0x1];channels[_0x38067d[_0x4785('0x6')]][_0x17dfb9]=_0x34a2b2;}if(!_[_0x4785('0x64')](['hangup',_0x4785('0x65'),_0x4785('0x66'),_0x4785('0x5d'),_0x4785('0x67')],_0x38067d['application'][_0x4785('0x5f')]())){channels[_0x38067d[_0x4785('0x6')]]['lastapplication']=_0x38067d['application'];channels[_0x38067d[_0x4785('0x6')]][_0x4785('0x50')]=_0x38067d[_0x4785('0x5c')];}}}catch(_0x1d18c1){utils['error'](util[_0x4785('0x17')]('[%s][calls][newexten]',_0x38067d[_0x4785('0x6')]),_0x1d18c1);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index f523759..40fdd6d 100644 --- a/server/services/xdr/core.controller.js +++ b/server/services/xdr/core.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5327=['[core]\x20fullybooted','error','close','managerevent','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted'];(function(_0xbf802e,_0x329296){var _0x19e99b=function(_0x36e374){while(--_0x36e374){_0xbf802e['push'](_0xbf802e['shift']());}};_0x19e99b(++_0x329296);}(_0x5327,0x1bc));var _0x7532=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5327[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0x7532('0x0'));exports[_0x7532('0x1')]=function(){utils[_0x7532('0x2')](_0x7532('0x3'));};exports[_0x7532('0x4')]=function(){utils[_0x7532('0x2')](_0x7532('0x5'));};exports[_0x7532('0x6')]=function(){utils[_0x7532('0x2')](_0x7532('0x7'));};exports[_0x7532('0x8')]=function(_0x4b5655){utils['error']('[core]\x20error',_0x4b5655);};exports[_0x7532('0x9')]=function(){utils[_0x7532('0x2')]('[core]\x20close');};exports[_0x7532('0xa')]=function(_0xa8e9a6){}; \ No newline at end of file +var _0xa33a=['error','close','[core]\x20close','managerevent','connect','info','[core]\x20connected','[core]\x20shutdown','fullybooted'];(function(_0x1f6db5,_0x403788){var _0x24c2af=function(_0x8271c8){while(--_0x8271c8){_0x1f6db5['push'](_0x1f6db5['shift']());}};_0x24c2af(++_0x403788);}(_0xa33a,0x1e1));var _0xaa33=function(_0x198fce,_0x37df8f){_0x198fce=_0x198fce-0x0;var _0x139868=_0xa33a[_0x198fce];return _0x139868;};'use strict';var utils=require('./utils');exports[_0xaa33('0x0')]=function(){utils[_0xaa33('0x1')](_0xaa33('0x2'));};exports['shutdown']=function(){utils[_0xaa33('0x1')](_0xaa33('0x3'));};exports[_0xaa33('0x4')]=function(){utils['info']('[core]\x20fullybooted');};exports['error']=function(_0x460975){utils[_0xaa33('0x5')]('[core]\x20error',_0x460975);};exports[_0xaa33('0x6')]=function(){utils[_0xaa33('0x1')](_0xaa33('0x7'));};exports[_0xaa33('0x8')]=function(_0x55df32){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index c7c9785..0c5a066 100644 --- a/server/services/xdr/dials.controller.js +++ b/server/services/xdr/dials.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33e9=['dialbegin','assign','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','dialstatus','ANSWER','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','error','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','duration','starttime','holdtime','diffTime','endtime','[%s][dials][hangup]','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','request','newexten','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr(routeid)','split','varset','debug','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value'];(function(_0x3ff2f9,_0x544ba1){var _0x3b0913=function(_0x554288){while(--_0x554288){_0x3ff2f9['push'](_0x3ff2f9['shift']());}};_0x3b0913(++_0x544ba1);}(_0x33e9,0x184));var _0x933e=function(_0x1d5191,_0x9e2c74){_0x1d5191=_0x1d5191-0x0;var _0x3aa495=_0x33e9[_0x1d5191];return _0x3aa495;};'use strict';var _=require(_0x933e('0x0'));var util=require(_0x933e('0x1'));var utils=require(_0x933e('0x2'));var dials={};function writeDB(_0xce3594){utils[_0x933e('0x3')](util[_0x933e('0x4')](_0x933e('0x5'),_0xce3594[_0x933e('0x6')],_0xce3594[_0x933e('0x7')],_0xce3594['dialstring'],_0xce3594[_0x933e('0x8')],_0xce3594[_0x933e('0x9')],_0xce3594['dialstatus']));utils[_0x933e('0xa')]('CreateVoiceDialReport',_0xce3594);delete dials[_0xce3594['uniqueid']];}exports[_0x933e('0xb')]=function(_0x52fb4e){try{utils['debug'](util[_0x933e('0x4')](_0x933e('0xc'),_0x52fb4e[_0x933e('0x6')]),_0x52fb4e);utils[_0x933e('0x3')](util[_0x933e('0x4')](_0x933e('0xd'),_0x52fb4e[_0x933e('0x6')],_0x52fb4e[_0x933e('0xe')],_0x52fb4e[_0x933e('0xf')]));if(_0x52fb4e[_0x933e('0xe')][_0x933e('0x10')]()=='set'&&_[_0x933e('0x11')](_0x52fb4e[_0x933e('0xf')][_0x933e('0x10')](),_0x933e('0x12'))){var _0x2d3fe2=_0x52fb4e[_0x933e('0xf')][_0x933e('0x13')]('=');dials[_0x52fb4e[_0x933e('0x6')]]={'routeId':_0x2d3fe2[0x1]};}}catch(_0x212f0b){utils['error'](util[_0x933e('0x4')](_0x933e('0xc'),_0x52fb4e[_0x933e('0x6')]),_0x212f0b);}};exports[_0x933e('0x14')]=function(_0x19acb3){try{utils[_0x933e('0x15')](util[_0x933e('0x4')](_0x933e('0x16'),_0x19acb3[_0x933e('0x6')]),_0x19acb3);if(!_[_0x933e('0x17')](_0x19acb3[_0x933e('0x18')][_0x933e('0x19')])){utils[_0x933e('0x3')](util[_0x933e('0x4')](_0x933e('0x1a'),_0x19acb3['uniqueid'],_0x19acb3[_0x933e('0x1b')]));dials[_0x19acb3[_0x933e('0x6')]]={'routeId':_0x19acb3['value']};}}catch(_0xb3f6){utils['error'](util[_0x933e('0x4')](_0x933e('0x16'),_0x19acb3[_0x933e('0x6')]),_0xb3f6);}};exports[_0x933e('0x1c')]=function(_0x4f382){try{if(!_['isNil'](dials[_0x4f382[_0x933e('0x6')]])){utils[_0x933e('0x15')](util[_0x933e('0x4')]('[%s][dials][dialbegin]',_0x4f382[_0x933e('0x6')]),_0x4f382);dials[_0x4f382[_0x933e('0x6')]]=_[_0x933e('0x1d')](dials[_0x4f382['uniqueid']],_0x4f382);dials[_0x4f382['uniqueid']]['starttime']=utils['now']();dials[_0x4f382['uniqueid']][_0x933e('0x1e')]=_0x933e('0x1f');utils[_0x933e('0x3')](util[_0x933e('0x4')](_0x933e('0x20'),_0x4f382[_0x933e('0x6')],dials[_0x4f382[_0x933e('0x6')]]['starttime']));}}catch(_0x80d80c){utils['error'](util[_0x933e('0x4')](_0x933e('0x21'),_0x4f382[_0x933e('0x6')]),_0x80d80c);}};exports[_0x933e('0x22')]=function(_0x5ecb33){try{if(!_[_0x933e('0x17')](dials[_0x5ecb33[_0x933e('0x6')]])){utils[_0x933e('0x15')](util[_0x933e('0x4')](_0x933e('0x23'),_0x5ecb33[_0x933e('0x6')]),_0x5ecb33);dials[_0x5ecb33['uniqueid']][_0x933e('0x24')]=_0x5ecb33[_0x933e('0x24')];if(_0x5ecb33[_0x933e('0x24')]==_0x933e('0x25')){dials[_0x5ecb33[_0x933e('0x6')]]=_['assign'](dials[_0x5ecb33[_0x933e('0x6')]],_0x5ecb33);dials[_0x5ecb33['uniqueid']][_0x933e('0x26')]=utils[_0x933e('0x27')]();dials[_0x5ecb33['uniqueid']][_0x933e('0x1e')]=_0x933e('0x28');utils[_0x933e('0x3')](util[_0x933e('0x4')](_0x933e('0x29'),_0x5ecb33[_0x933e('0x6')],_0x5ecb33[_0x933e('0x24')],dials[_0x5ecb33[_0x933e('0x6')]][_0x933e('0x26')]));}else{utils[_0x933e('0x3')](util[_0x933e('0x4')]('[%s][dials][dialend]\x20dialstatus:%s',_0x5ecb33['uniqueid'],_0x5ecb33['dialstatus']));}}}catch(_0x2bfde7){utils[_0x933e('0x2a')](util[_0x933e('0x4')]('[%s][dials][dialend]',_0x5ecb33['uniqueid']),_0x2bfde7);}};exports[_0x933e('0x2b')]=function(_0x31998b){try{if(!_[_0x933e('0x17')](dials[_0x31998b['uniqueid']])){utils[_0x933e('0x15')](util['format']('[%s][dials][hangup]',_0x31998b[_0x933e('0x6')]),_0x31998b);utils[_0x933e('0x3')](util[_0x933e('0x4')](_0x933e('0x2c'),_0x31998b[_0x933e('0x6')],_0x31998b[_0x933e('0x8')],_0x31998b['calleridname'],_0x31998b[_0x933e('0x2d')]));dials[_0x31998b[_0x933e('0x6')]]=_[_0x933e('0x1d')](dials[_0x31998b[_0x933e('0x6')]],{'endtime':utils[_0x933e('0x27')](),'lastevent':'complete'});dials[_0x31998b[_0x933e('0x6')]][_0x933e('0x2e')]=utils['diffTime'](dials[_0x31998b['uniqueid']]['endtime'],dials[_0x31998b['uniqueid']][_0x933e('0x2f')]);dials[_0x31998b[_0x933e('0x6')]][_0x933e('0x30')]=utils[_0x933e('0x31')](dials[_0x31998b[_0x933e('0x6')]][_0x933e('0x26')]||dials[_0x31998b['uniqueid']][_0x933e('0x32')],dials[_0x31998b[_0x933e('0x6')]][_0x933e('0x2f')]);dials[_0x31998b['uniqueid']]['billableseconds']=dials[_0x31998b[_0x933e('0x6')]]['answertime']?utils[_0x933e('0x31')](dials[_0x31998b[_0x933e('0x6')]][_0x933e('0x32')],dials[_0x31998b[_0x933e('0x6')]][_0x933e('0x26')]):0x0;writeDB(dials[_0x31998b[_0x933e('0x6')]]);}}catch(_0x53c1f0){utils['error'](util[_0x933e('0x4')](_0x933e('0x33'),_0x31998b[_0x933e('0x6')]),_0x53c1f0);}}; \ No newline at end of file +var _0xce72=['dialstatus','request','newexten','debug','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','[%s][dials][varset]','isNil','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][hangup]','cause-txt','complete','endtime','billableseconds','diffTime','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum'];(function(_0x31cc6e,_0x4da430){var _0x39a234=function(_0x3fe7cd){while(--_0x3fe7cd){_0x31cc6e['push'](_0x31cc6e['shift']());}};_0x39a234(++_0x4da430);}(_0xce72,0xd8));var _0x2ce7=function(_0x397261,_0xff6699){_0x397261=_0x397261-0x0;var _0x3c4fde=_0xce72[_0x397261];return _0x3c4fde;};'use strict';var _=require('lodash');var util=require(_0x2ce7('0x0'));var utils=require(_0x2ce7('0x1'));var dials={};function writeDB(_0x41ea12){utils['info'](util[_0x2ce7('0x2')](_0x2ce7('0x3'),_0x41ea12[_0x2ce7('0x4')],_0x41ea12[_0x2ce7('0x5')],_0x41ea12[_0x2ce7('0x6')],_0x41ea12[_0x2ce7('0x7')],_0x41ea12[_0x2ce7('0x8')],_0x41ea12[_0x2ce7('0x9')]));utils[_0x2ce7('0xa')]('CreateVoiceDialReport',_0x41ea12);delete dials[_0x41ea12[_0x2ce7('0x4')]];}exports[_0x2ce7('0xb')]=function(_0x294a5d){try{utils[_0x2ce7('0xc')](util[_0x2ce7('0x2')](_0x2ce7('0xd'),_0x294a5d[_0x2ce7('0x4')]),_0x294a5d);utils[_0x2ce7('0xe')](util['format'](_0x2ce7('0xf'),_0x294a5d[_0x2ce7('0x4')],_0x294a5d[_0x2ce7('0x10')],_0x294a5d[_0x2ce7('0x11')]));if(_0x294a5d[_0x2ce7('0x10')][_0x2ce7('0x12')]()==_0x2ce7('0x13')&&_[_0x2ce7('0x14')](_0x294a5d[_0x2ce7('0x11')]['toLowerCase'](),_0x2ce7('0x15'))){var _0x290132=_0x294a5d['appdata'][_0x2ce7('0x16')]('=');dials[_0x294a5d[_0x2ce7('0x4')]]={'routeId':_0x290132[0x1]};}}catch(_0x268114){utils[_0x2ce7('0x17')](util[_0x2ce7('0x2')]('[%s][dials][newexten]',_0x294a5d[_0x2ce7('0x4')]),_0x268114);}};exports['varset']=function(_0x4c8497){try{utils[_0x2ce7('0xc')](util[_0x2ce7('0x2')](_0x2ce7('0x18'),_0x4c8497[_0x2ce7('0x4')]),_0x4c8497);if(!_[_0x2ce7('0x19')](_0x4c8497['variable']['outboundrouteid'])){utils[_0x2ce7('0xe')](util['format'](_0x2ce7('0x1a'),_0x4c8497[_0x2ce7('0x4')],_0x4c8497['value']));dials[_0x4c8497[_0x2ce7('0x4')]]={'routeId':_0x4c8497[_0x2ce7('0x1b')]};}}catch(_0x360d45){utils[_0x2ce7('0x17')](util[_0x2ce7('0x2')](_0x2ce7('0x18'),_0x4c8497[_0x2ce7('0x4')]),_0x360d45);}};exports['dialbegin']=function(_0x5c506e){try{if(!_['isNil'](dials[_0x5c506e[_0x2ce7('0x4')]])){utils[_0x2ce7('0xc')](util[_0x2ce7('0x2')]('[%s][dials][dialbegin]',_0x5c506e[_0x2ce7('0x4')]),_0x5c506e);dials[_0x5c506e[_0x2ce7('0x4')]]=_[_0x2ce7('0x1c')](dials[_0x5c506e['uniqueid']],_0x5c506e);dials[_0x5c506e[_0x2ce7('0x4')]][_0x2ce7('0x1d')]=utils[_0x2ce7('0x1e')]();dials[_0x5c506e[_0x2ce7('0x4')]][_0x2ce7('0x1f')]=_0x2ce7('0x20');utils[_0x2ce7('0xe')](util[_0x2ce7('0x2')](_0x2ce7('0x21'),_0x5c506e['uniqueid'],dials[_0x5c506e[_0x2ce7('0x4')]][_0x2ce7('0x1d')]));}}catch(_0x3ac4f4){utils[_0x2ce7('0x17')](util['format'](_0x2ce7('0x22'),_0x5c506e['uniqueid']),_0x3ac4f4);}};exports['dialend']=function(_0xe31e3d){try{if(!_[_0x2ce7('0x19')](dials[_0xe31e3d[_0x2ce7('0x4')]])){utils[_0x2ce7('0xc')](util[_0x2ce7('0x2')](_0x2ce7('0x23'),_0xe31e3d[_0x2ce7('0x4')]),_0xe31e3d);dials[_0xe31e3d[_0x2ce7('0x4')]][_0x2ce7('0x9')]=_0xe31e3d['dialstatus'];if(_0xe31e3d[_0x2ce7('0x9')]==_0x2ce7('0x24')){dials[_0xe31e3d[_0x2ce7('0x4')]]=_['assign'](dials[_0xe31e3d[_0x2ce7('0x4')]],_0xe31e3d);dials[_0xe31e3d[_0x2ce7('0x4')]][_0x2ce7('0x25')]=utils['now']();dials[_0xe31e3d[_0x2ce7('0x4')]][_0x2ce7('0x1f')]=_0x2ce7('0x26');utils[_0x2ce7('0xe')](util[_0x2ce7('0x2')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0xe31e3d[_0x2ce7('0x4')],_0xe31e3d[_0x2ce7('0x9')],dials[_0xe31e3d[_0x2ce7('0x4')]][_0x2ce7('0x25')]));}else{utils[_0x2ce7('0xe')](util[_0x2ce7('0x2')]('[%s][dials][dialend]\x20dialstatus:%s',_0xe31e3d['uniqueid'],_0xe31e3d[_0x2ce7('0x9')]));}}}catch(_0x28488e){utils[_0x2ce7('0x17')](util[_0x2ce7('0x2')]('[%s][dials][dialend]',_0xe31e3d['uniqueid']),_0x28488e);}};exports['hangup']=function(_0x31b798){try{if(!_[_0x2ce7('0x19')](dials[_0x31b798[_0x2ce7('0x4')]])){utils['debug'](util[_0x2ce7('0x2')](_0x2ce7('0x27'),_0x31b798['uniqueid']),_0x31b798);utils[_0x2ce7('0xe')](util[_0x2ce7('0x2')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x31b798['uniqueid'],_0x31b798['calleridnum'],_0x31b798['calleridname'],_0x31b798[_0x2ce7('0x28')]));dials[_0x31b798[_0x2ce7('0x4')]]=_['assign'](dials[_0x31b798[_0x2ce7('0x4')]],{'endtime':utils[_0x2ce7('0x1e')](),'lastevent':_0x2ce7('0x29')});dials[_0x31b798[_0x2ce7('0x4')]]['duration']=utils['diffTime'](dials[_0x31b798['uniqueid']]['endtime'],dials[_0x31b798[_0x2ce7('0x4')]][_0x2ce7('0x1d')]);dials[_0x31b798[_0x2ce7('0x4')]]['holdtime']=utils['diffTime'](dials[_0x31b798[_0x2ce7('0x4')]]['answertime']||dials[_0x31b798[_0x2ce7('0x4')]][_0x2ce7('0x2a')],dials[_0x31b798[_0x2ce7('0x4')]][_0x2ce7('0x1d')]);dials[_0x31b798[_0x2ce7('0x4')]][_0x2ce7('0x2b')]=dials[_0x31b798[_0x2ce7('0x4')]]['answertime']?utils[_0x2ce7('0x2c')](dials[_0x31b798[_0x2ce7('0x4')]][_0x2ce7('0x2a')],dials[_0x31b798['uniqueid']][_0x2ce7('0x25')]):0x0;writeDB(dials[_0x31b798[_0x2ce7('0x4')]]);}}catch(_0x438e28){utils['error'](util[_0x2ce7('0x2')](_0x2ce7('0x27'),_0x31b798[_0x2ce7('0x4')]),_0x438e28);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index ecf1ca3..615e4ec 100644 --- a/server/services/xdr/index.js +++ b/server/services/xdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa0=['device','format','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','queuecallerleave','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','production','local','port','asterisk','username','keepConnected','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]'];(function(_0x4eae00,_0x3cac00){var _0x479b17=function(_0x3b684b){while(--_0x3b684b){_0x4eae00['push'](_0x4eae00['shift']());}};_0x479b17(++_0x3cac00);}(_0x6aa0,0xb1));var _0x06aa=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x6aa0[_0x3c8e9a];return _0x2d4c57;};var AsteriskManager=require(_0x06aa('0x0'));var config=require(_0x06aa('0x1'));var utils=require(_0x06aa('0x2'));var util=require(_0x06aa('0x3'));var isXDREnabled=config[_0x06aa('0x4')]&&config[_0x06aa('0x4')][_0x06aa('0x5')]?!config['xdr']['disabled']:!![];var isProduction=config['env']===_0x06aa('0x6')||![];var isLocalAsterisk=config[_0x06aa('0x4')]&&config[_0x06aa('0x4')][_0x06aa('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x06aa('0x8')],config[_0x06aa('0x9')]['ip'],config[_0x06aa('0x9')][_0x06aa('0xa')],config[_0x06aa('0x9')]['password'],!![]);ami[_0x06aa('0xb')]();if(!isXDREnabled){utils[_0x06aa('0xc')](_0x06aa('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x06aa('0xc')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x06aa('0xe'));var calls=require(_0x06aa('0xf'));var queues=require(_0x06aa('0x10'));var recordings=require(_0x06aa('0x11'));var members=require(_0x06aa('0x12'));var dials=require('./dials.controller');var transfers=require(_0x06aa('0x13'));var core=require(_0x06aa('0x14'));ami['on'](_0x06aa('0x15'),core[_0x06aa('0x15')]);ami['on'](_0x06aa('0x16'),core[_0x06aa('0x16')]);ami['on']('fullybooted',core[_0x06aa('0x17')]);ami['on'](_0x06aa('0x18'),core[_0x06aa('0x18')]);ami['on'](_0x06aa('0x19'),core[_0x06aa('0x19')]);ami['on'](_0x06aa('0x1a'),core[_0x06aa('0x1a')]);ami['on'](_0x06aa('0x1b'),function(_0x2538c7){try{utils[_0x06aa('0x1c')](util['format'](_0x06aa('0x1d'),_0x2538c7[_0x06aa('0x1e')]),_0x2538c7);members['devicestatechange'](_0x2538c7);}catch(_0x436783){utils[_0x06aa('0x18')](util[_0x06aa('0x1f')](_0x06aa('0x1d'),_0x2538c7[_0x06aa('0x1e')]),_0x436783);}});ami['on'](_0x06aa('0x20'),function(_0x5c7f4d){try{utils['debug'](util[_0x06aa('0x1f')]('[%s][index][agentcalled]',_0x5c7f4d[_0x06aa('0x21')]),_0x5c7f4d);agents[_0x06aa('0x20')](_0x5c7f4d);}catch(_0x5d270b){utils['error'](util[_0x06aa('0x1f')](_0x06aa('0x22'),_0x5c7f4d['uniqueid']),_0x5d270b);}});ami['on'](_0x06aa('0x23'),function(_0x128c84){try{utils['debug'](util[_0x06aa('0x1f')](_0x06aa('0x24'),_0x128c84[_0x06aa('0x21')]),_0x128c84);agents[_0x06aa('0x23')](_0x128c84);}catch(_0x182e13){utils[_0x06aa('0x18')](util[_0x06aa('0x1f')](_0x06aa('0x24'),_0x128c84[_0x06aa('0x21')]),_0x182e13);}});ami['on'](_0x06aa('0x25'),function(_0x48cdab){try{utils[_0x06aa('0x1c')](util[_0x06aa('0x1f')](_0x06aa('0x26'),_0x48cdab['uniqueid']),_0x48cdab);agents['agentconnect'](_0x48cdab);queues[_0x06aa('0x25')](_0x48cdab);}catch(_0x2bd350){utils['error'](util[_0x06aa('0x1f')](_0x06aa('0x26'),_0x48cdab[_0x06aa('0x21')]),_0x2bd350);}});ami['on'](_0x06aa('0x27'),function(_0x352f39){try{utils[_0x06aa('0x1c')](util['format']('[%s][index][agentcomplete]',_0x352f39[_0x06aa('0x21')]),_0x352f39);agents[_0x06aa('0x27')](_0x352f39);queues[_0x06aa('0x27')](_0x352f39);members[_0x06aa('0x27')](_0x352f39);}catch(_0x41102a){utils['error'](util[_0x06aa('0x1f')]('[%s][index][agentcomplete]',_0x352f39[_0x06aa('0x21')]),_0x41102a);}});ami['on'](_0x06aa('0x28'),function(_0x1c9b02){try{utils[_0x06aa('0x1c')](util[_0x06aa('0x1f')](_0x06aa('0x29'),_0x1c9b02[_0x06aa('0x21')]),_0x1c9b02);agents['queuecallerabandon'](_0x1c9b02);queues[_0x06aa('0x28')](_0x1c9b02);}catch(_0x562a5f){utils[_0x06aa('0x18')](util['format'](_0x06aa('0x29'),_0x1c9b02['uniqueid']),_0x562a5f);}});ami['on'](_0x06aa('0x2a'),function(_0x309275){try{utils[_0x06aa('0x1c')](util[_0x06aa('0x1f')]('[%s][index][queuecallerjoin]',_0x309275[_0x06aa('0x21')]),_0x309275);queues[_0x06aa('0x2a')](_0x309275);recordings[_0x06aa('0x2a')](_0x309275);}catch(_0x5d4b79){utils[_0x06aa('0x18')](util['format']('[%s][index][queuecallerjoin]',_0x309275[_0x06aa('0x21')]),_0x5d4b79);}});ami['on'](_0x06aa('0x2b'),function(_0x369b85){try{utils['debug'](util[_0x06aa('0x1f')]('[%s][index][queuecallerleave]',_0x369b85[_0x06aa('0x21')]),_0x369b85);queues[_0x06aa('0x2b')](_0x369b85);}catch(_0x3549b2){utils['error'](util['format']('[%s][index][queuecallerleave]',_0x369b85[_0x06aa('0x21')]),_0x3549b2);}});ami['on']('musiconholdstart',function(_0x315fb3){try{utils[_0x06aa('0x1c')](util[_0x06aa('0x1f')](_0x06aa('0x2c'),_0x315fb3[_0x06aa('0x21')]),_0x315fb3);queues[_0x06aa('0x2d')](_0x315fb3);calls[_0x06aa('0x2d')](_0x315fb3);}catch(_0x2aee5a){utils[_0x06aa('0x18')](util[_0x06aa('0x1f')]('[%s][index][musiconholdstart]',_0x315fb3[_0x06aa('0x21')]),_0x2aee5a);}});ami['on'](_0x06aa('0x2e'),function(_0x3fec9e){try{utils['debug'](util['format']('[%s][index][musiconholdstop]',_0x3fec9e[_0x06aa('0x21')]),_0x3fec9e);queues[_0x06aa('0x2e')](_0x3fec9e);calls[_0x06aa('0x2e')](_0x3fec9e);}catch(_0x41a54a){utils['error'](util[_0x06aa('0x1f')](_0x06aa('0x2f'),_0x3fec9e[_0x06aa('0x21')]),_0x41a54a);}});ami['on'](_0x06aa('0x30'),function(_0x4ad763){try{utils[_0x06aa('0x1c')](util[_0x06aa('0x1f')](_0x06aa('0x31'),_0x4ad763[_0x06aa('0x21')]),_0x4ad763);calls[_0x06aa('0x30')](_0x4ad763);recordings['newstate'](_0x4ad763);}catch(_0x2d3631){utils[_0x06aa('0x18')](util[_0x06aa('0x1f')](_0x06aa('0x31'),_0x4ad763[_0x06aa('0x21')]),_0x2d3631);}});ami['on'](_0x06aa('0x32'),function(_0xb9dbcd){try{utils[_0x06aa('0x1c')](util[_0x06aa('0x1f')]('[%s][index][hangup]',_0xb9dbcd[_0x06aa('0x21')]),_0xb9dbcd);calls[_0x06aa('0x32')](_0xb9dbcd);recordings[_0x06aa('0x32')](_0xb9dbcd);dials[_0x06aa('0x32')](_0xb9dbcd);agents['hangup'](_0xb9dbcd);queues[_0x06aa('0x32')](_0xb9dbcd);}catch(_0x293519){utils[_0x06aa('0x18')](util[_0x06aa('0x1f')](_0x06aa('0x33'),_0xb9dbcd[_0x06aa('0x21')]),_0x293519);}});ami['on'](_0x06aa('0x34'),function(_0x1bdba8){try{utils[_0x06aa('0x1c')](util[_0x06aa('0x1f')](_0x06aa('0x35'),_0x1bdba8[_0x06aa('0x21')]),_0x1bdba8);members[_0x06aa('0x34')](_0x1bdba8);}catch(_0x4e25a9){utils[_0x06aa('0x18')](util['format']('[%s][index][cdr]',_0x1bdba8['uniqueid']),_0x4e25a9);}});ami['on'](_0x06aa('0x36'),function(_0x1b040f){try{utils[_0x06aa('0x1c')](util['format'](_0x06aa('0x37'),_0x1b040f[_0x06aa('0x21')]),_0x1b040f);queues[_0x06aa('0x36')](_0x1b040f);agents[_0x06aa('0x36')](_0x1b040f);transfers['blindtransfer'](_0x1b040f);}catch(_0x2aeff4){utils['error'](util[_0x06aa('0x1f')](_0x06aa('0x37'),_0x1b040f['uniqueid']),_0x2aeff4);}});ami['on'](_0x06aa('0x38'),function(_0x5f076f){try{utils[_0x06aa('0x1c')](util[_0x06aa('0x1f')](_0x06aa('0x39'),_0x5f076f[_0x06aa('0x3a')]),_0x5f076f);queues['attendedtransfer'](_0x5f076f);transfers[_0x06aa('0x38')](_0x5f076f);agents[_0x06aa('0x38')](_0x5f076f);calls[_0x06aa('0x38')](_0x5f076f);}catch(_0x4e5f6d){utils[_0x06aa('0x18')](util[_0x06aa('0x1f')](_0x06aa('0x39'),_0x5f076f[_0x06aa('0x3a')]),_0x4e5f6d);}});ami['on'](_0x06aa('0x3b'),function(_0x394b7a){try{utils[_0x06aa('0x1c')](util[_0x06aa('0x1f')](_0x06aa('0x3c'),_0x394b7a[_0x06aa('0x21')]),_0x394b7a);queues[_0x06aa('0x3b')](_0x394b7a);recordings['varset'](_0x394b7a);calls['varset'](_0x394b7a);dials[_0x06aa('0x3b')](_0x394b7a);}catch(_0x45a5f6){utils[_0x06aa('0x18')](util[_0x06aa('0x1f')]('[%s][index][varset]',_0x394b7a[_0x06aa('0x21')]),_0x45a5f6);}});ami['on'](_0x06aa('0x3d'),function(_0x42853a){try{utils['debug'](util[_0x06aa('0x1f')](_0x06aa('0x3e'),_0x42853a[_0x06aa('0x21')]),_0x42853a);calls[_0x06aa('0x3d')](_0x42853a);recordings[_0x06aa('0x3d')](_0x42853a);dials['newexten'](_0x42853a);}catch(_0x3c9c57){utils[_0x06aa('0x18')](util[_0x06aa('0x1f')](_0x06aa('0x3e'),_0x42853a[_0x06aa('0x21')]),_0x3c9c57);}});ami['on']('newchannel',function(_0x1cc3dc){try{utils['debug'](util[_0x06aa('0x1f')]('[%s][index][newchannel]',_0x1cc3dc['uniqueid']),_0x1cc3dc);calls[_0x06aa('0x3f')](_0x1cc3dc);recordings[_0x06aa('0x3f')](_0x1cc3dc);}catch(_0x263aa7){utils[_0x06aa('0x18')](util['format'](_0x06aa('0x40'),_0x1cc3dc[_0x06aa('0x21')]),_0x263aa7);}});ami['on'](_0x06aa('0x41'),function(_0x2b1ae7){try{utils[_0x06aa('0x1c')](util[_0x06aa('0x1f')](_0x06aa('0x42'),_0x2b1ae7[_0x06aa('0x21')]),_0x2b1ae7);dials[_0x06aa('0x41')](_0x2b1ae7);}catch(_0x524ca3){utils[_0x06aa('0x18')](util[_0x06aa('0x1f')]('[%s]dialbegin',_0x2b1ae7[_0x06aa('0x21')]),_0x524ca3);}});ami['on'](_0x06aa('0x43'),function(_0x2887e8){try{utils[_0x06aa('0x1c')](util[_0x06aa('0x1f')](_0x06aa('0x44'),_0x2887e8[_0x06aa('0x21')]),_0x2887e8);dials[_0x06aa('0x43')](_0x2887e8);}catch(_0x5f33d5){utils[_0x06aa('0x18')](util[_0x06aa('0x1f')](_0x06aa('0x44'),_0x2887e8[_0x06aa('0x21')]),_0x5f33d5);}});} \ No newline at end of file +var _0x8ffa=['./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','./utils','util','xdr','disabled','env','production','local','asterisk','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller'];(function(_0x1df160,_0x2bde77){var _0x1c1317=function(_0x134d16){while(--_0x134d16){_0x1df160['push'](_0x1df160['shift']());}};_0x1c1317(++_0x2bde77);}(_0x8ffa,0x150));var _0xa8ff=function(_0x3abeea,_0x5d5472){_0x3abeea=_0x3abeea-0x0;var _0x54c5a6=_0x8ffa[_0x3abeea];return _0x54c5a6;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0xa8ff('0x0'));var util=require(_0xa8ff('0x1'));var isXDREnabled=config[_0xa8ff('0x2')]&&config[_0xa8ff('0x2')][_0xa8ff('0x3')]?!config[_0xa8ff('0x2')]['disabled']:!![];var isProduction=config[_0xa8ff('0x4')]===_0xa8ff('0x5')||![];var isLocalAsterisk=config[_0xa8ff('0x2')]&&config[_0xa8ff('0x2')][_0xa8ff('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0xa8ff('0x7')]['port'],config[_0xa8ff('0x7')]['ip'],config[_0xa8ff('0x7')]['username'],config[_0xa8ff('0x7')][_0xa8ff('0x8')],!![]);ami[_0xa8ff('0x9')]();if(!isXDREnabled){utils[_0xa8ff('0xa')](_0xa8ff('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xa8ff('0xa')](_0xa8ff('0xc'));}else{var agents=require('./agents.controller');var calls=require(_0xa8ff('0xd'));var queues=require('./queues.controller');var recordings=require(_0xa8ff('0xe'));var members=require(_0xa8ff('0xf'));var dials=require(_0xa8ff('0x10'));var transfers=require(_0xa8ff('0x11'));var core=require(_0xa8ff('0x12'));ami['on']('connect',core[_0xa8ff('0x13')]);ami['on'](_0xa8ff('0x14'),core[_0xa8ff('0x14')]);ami['on'](_0xa8ff('0x15'),core['fullybooted']);ami['on'](_0xa8ff('0x16'),core[_0xa8ff('0x16')]);ami['on'](_0xa8ff('0x17'),core['close']);ami['on'](_0xa8ff('0x18'),core[_0xa8ff('0x18')]);ami['on'](_0xa8ff('0x19'),function(_0xbc47f4){try{utils['debug'](util[_0xa8ff('0x1a')]('[%s][index][devicestatechange]',_0xbc47f4['device']),_0xbc47f4);members[_0xa8ff('0x19')](_0xbc47f4);}catch(_0x5e5452){utils[_0xa8ff('0x16')](util[_0xa8ff('0x1a')](_0xa8ff('0x1b'),_0xbc47f4[_0xa8ff('0x1c')]),_0x5e5452);}});ami['on'](_0xa8ff('0x1d'),function(_0x33f7b2){try{utils[_0xa8ff('0x1e')](util[_0xa8ff('0x1a')]('[%s][index][agentcalled]',_0x33f7b2['uniqueid']),_0x33f7b2);agents[_0xa8ff('0x1d')](_0x33f7b2);}catch(_0xa18a79){utils[_0xa8ff('0x16')](util[_0xa8ff('0x1a')](_0xa8ff('0x1f'),_0x33f7b2[_0xa8ff('0x20')]),_0xa18a79);}});ami['on'](_0xa8ff('0x21'),function(_0x4761a6){try{utils[_0xa8ff('0x1e')](util[_0xa8ff('0x1a')](_0xa8ff('0x22'),_0x4761a6[_0xa8ff('0x20')]),_0x4761a6);agents[_0xa8ff('0x21')](_0x4761a6);}catch(_0x4ae231){utils['error'](util[_0xa8ff('0x1a')](_0xa8ff('0x22'),_0x4761a6[_0xa8ff('0x20')]),_0x4ae231);}});ami['on']('agentconnect',function(_0x5e883c){try{utils[_0xa8ff('0x1e')](util[_0xa8ff('0x1a')](_0xa8ff('0x23'),_0x5e883c[_0xa8ff('0x20')]),_0x5e883c);agents[_0xa8ff('0x24')](_0x5e883c);queues['agentconnect'](_0x5e883c);}catch(_0x5b2d5e){utils[_0xa8ff('0x16')](util[_0xa8ff('0x1a')](_0xa8ff('0x23'),_0x5e883c[_0xa8ff('0x20')]),_0x5b2d5e);}});ami['on']('agentcomplete',function(_0x10ed17){try{utils['debug'](util[_0xa8ff('0x1a')](_0xa8ff('0x25'),_0x10ed17['uniqueid']),_0x10ed17);agents['agentcomplete'](_0x10ed17);queues[_0xa8ff('0x26')](_0x10ed17);members[_0xa8ff('0x26')](_0x10ed17);}catch(_0x3771c0){utils[_0xa8ff('0x16')](util[_0xa8ff('0x1a')](_0xa8ff('0x25'),_0x10ed17[_0xa8ff('0x20')]),_0x3771c0);}});ami['on'](_0xa8ff('0x27'),function(_0x599fa){try{utils[_0xa8ff('0x1e')](util['format'](_0xa8ff('0x28'),_0x599fa[_0xa8ff('0x20')]),_0x599fa);agents[_0xa8ff('0x27')](_0x599fa);queues[_0xa8ff('0x27')](_0x599fa);}catch(_0x5ef275){utils['error'](util[_0xa8ff('0x1a')](_0xa8ff('0x28'),_0x599fa['uniqueid']),_0x5ef275);}});ami['on'](_0xa8ff('0x29'),function(_0x5a4102){try{utils['debug'](util[_0xa8ff('0x1a')](_0xa8ff('0x2a'),_0x5a4102[_0xa8ff('0x20')]),_0x5a4102);queues[_0xa8ff('0x29')](_0x5a4102);recordings['queuecallerjoin'](_0x5a4102);}catch(_0x43d74b){utils[_0xa8ff('0x16')](util[_0xa8ff('0x1a')](_0xa8ff('0x2a'),_0x5a4102['uniqueid']),_0x43d74b);}});ami['on'](_0xa8ff('0x2b'),function(_0x4af85e){try{utils['debug'](util[_0xa8ff('0x1a')]('[%s][index][queuecallerleave]',_0x4af85e[_0xa8ff('0x20')]),_0x4af85e);queues[_0xa8ff('0x2b')](_0x4af85e);}catch(_0x3d9ca5){utils['error'](util['format'](_0xa8ff('0x2c'),_0x4af85e['uniqueid']),_0x3d9ca5);}});ami['on'](_0xa8ff('0x2d'),function(_0x1baaa4){try{utils[_0xa8ff('0x1e')](util[_0xa8ff('0x1a')](_0xa8ff('0x2e'),_0x1baaa4[_0xa8ff('0x20')]),_0x1baaa4);queues[_0xa8ff('0x2d')](_0x1baaa4);calls[_0xa8ff('0x2d')](_0x1baaa4);}catch(_0x19ea6d){utils[_0xa8ff('0x16')](util[_0xa8ff('0x1a')]('[%s][index][musiconholdstart]',_0x1baaa4['uniqueid']),_0x19ea6d);}});ami['on'](_0xa8ff('0x2f'),function(_0x4ba5fc){try{utils['debug'](util[_0xa8ff('0x1a')]('[%s][index][musiconholdstop]',_0x4ba5fc[_0xa8ff('0x20')]),_0x4ba5fc);queues[_0xa8ff('0x2f')](_0x4ba5fc);calls[_0xa8ff('0x2f')](_0x4ba5fc);}catch(_0x34e98c){utils[_0xa8ff('0x16')](util[_0xa8ff('0x1a')](_0xa8ff('0x30'),_0x4ba5fc[_0xa8ff('0x20')]),_0x34e98c);}});ami['on'](_0xa8ff('0x31'),function(_0x571d10){try{utils[_0xa8ff('0x1e')](util[_0xa8ff('0x1a')]('[%s][index][newstate]',_0x571d10[_0xa8ff('0x20')]),_0x571d10);calls[_0xa8ff('0x31')](_0x571d10);recordings[_0xa8ff('0x31')](_0x571d10);}catch(_0x1c293a){utils[_0xa8ff('0x16')](util[_0xa8ff('0x1a')](_0xa8ff('0x32'),_0x571d10['uniqueid']),_0x1c293a);}});ami['on'](_0xa8ff('0x33'),function(_0x4e10de){try{utils[_0xa8ff('0x1e')](util[_0xa8ff('0x1a')](_0xa8ff('0x34'),_0x4e10de[_0xa8ff('0x20')]),_0x4e10de);calls[_0xa8ff('0x33')](_0x4e10de);recordings['hangup'](_0x4e10de);dials['hangup'](_0x4e10de);agents[_0xa8ff('0x33')](_0x4e10de);queues[_0xa8ff('0x33')](_0x4e10de);}catch(_0x4d9f21){utils[_0xa8ff('0x16')](util[_0xa8ff('0x1a')](_0xa8ff('0x34'),_0x4e10de[_0xa8ff('0x20')]),_0x4d9f21);}});ami['on']('cdr',function(_0x26bd45){try{utils[_0xa8ff('0x1e')](util[_0xa8ff('0x1a')](_0xa8ff('0x35'),_0x26bd45[_0xa8ff('0x20')]),_0x26bd45);members[_0xa8ff('0x36')](_0x26bd45);}catch(_0x42edc2){utils[_0xa8ff('0x16')](util[_0xa8ff('0x1a')]('[%s][index][cdr]',_0x26bd45[_0xa8ff('0x20')]),_0x42edc2);}});ami['on'](_0xa8ff('0x37'),function(_0x53c92f){try{utils[_0xa8ff('0x1e')](util[_0xa8ff('0x1a')](_0xa8ff('0x38'),_0x53c92f['uniqueid']),_0x53c92f);queues[_0xa8ff('0x37')](_0x53c92f);agents['blindtransfer'](_0x53c92f);transfers['blindtransfer'](_0x53c92f);}catch(_0x232898){utils[_0xa8ff('0x16')](util['format']('[%s][index][blindtransfer]',_0x53c92f[_0xa8ff('0x20')]),_0x232898);}});ami['on'](_0xa8ff('0x39'),function(_0x1fd1c7){try{utils['debug'](util[_0xa8ff('0x1a')](_0xa8ff('0x3a'),_0x1fd1c7[_0xa8ff('0x3b')]),_0x1fd1c7);queues[_0xa8ff('0x39')](_0x1fd1c7);transfers[_0xa8ff('0x39')](_0x1fd1c7);agents[_0xa8ff('0x39')](_0x1fd1c7);calls[_0xa8ff('0x39')](_0x1fd1c7);}catch(_0x439c6e){utils[_0xa8ff('0x16')](util[_0xa8ff('0x1a')](_0xa8ff('0x3a'),_0x1fd1c7[_0xa8ff('0x3b')]),_0x439c6e);}});ami['on'](_0xa8ff('0x3c'),function(_0x594dee){try{utils[_0xa8ff('0x1e')](util[_0xa8ff('0x1a')](_0xa8ff('0x3d'),_0x594dee[_0xa8ff('0x20')]),_0x594dee);queues['varset'](_0x594dee);recordings[_0xa8ff('0x3c')](_0x594dee);calls[_0xa8ff('0x3c')](_0x594dee);dials[_0xa8ff('0x3c')](_0x594dee);}catch(_0x2ebc9f){utils[_0xa8ff('0x16')](util[_0xa8ff('0x1a')]('[%s][index][varset]',_0x594dee[_0xa8ff('0x20')]),_0x2ebc9f);}});ami['on']('newexten',function(_0x2395f4){try{utils[_0xa8ff('0x1e')](util['format'](_0xa8ff('0x3e'),_0x2395f4[_0xa8ff('0x20')]),_0x2395f4);calls[_0xa8ff('0x3f')](_0x2395f4);recordings['newexten'](_0x2395f4);dials[_0xa8ff('0x3f')](_0x2395f4);}catch(_0xadaccf){utils[_0xa8ff('0x16')](util[_0xa8ff('0x1a')](_0xa8ff('0x3e'),_0x2395f4[_0xa8ff('0x20')]),_0xadaccf);}});ami['on'](_0xa8ff('0x40'),function(_0x3548f1){try{utils['debug'](util['format'](_0xa8ff('0x41'),_0x3548f1['uniqueid']),_0x3548f1);calls[_0xa8ff('0x40')](_0x3548f1);recordings[_0xa8ff('0x40')](_0x3548f1);}catch(_0x108351){utils[_0xa8ff('0x16')](util[_0xa8ff('0x1a')]('[%s][index][newchannel]',_0x3548f1[_0xa8ff('0x20')]),_0x108351);}});ami['on']('dialbegin',function(_0x217059){try{utils[_0xa8ff('0x1e')](util[_0xa8ff('0x1a')]('[%s][index][dialbegin]',_0x217059[_0xa8ff('0x20')]),_0x217059);dials[_0xa8ff('0x42')](_0x217059);}catch(_0xe2a8b4){utils[_0xa8ff('0x16')](util['format'](_0xa8ff('0x43'),_0x217059[_0xa8ff('0x20')]),_0xe2a8b4);}});ami['on'](_0xa8ff('0x44'),function(_0x10b7f5){try{utils[_0xa8ff('0x1e')](util[_0xa8ff('0x1a')]('[%s][index][dialend]',_0x10b7f5[_0xa8ff('0x20')]),_0x10b7f5);dials[_0xa8ff('0x44')](_0x10b7f5);}catch(_0x295b14){utils[_0xa8ff('0x16')](util[_0xa8ff('0x1a')](_0xa8ff('0x45'),_0x10b7f5[_0xa8ff('0x20')]),_0x295b14);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 8003599..06789e4 100644 --- a/server/services/xdr/members.controller.js +++ b/server/services/xdr/members.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d66=['source','data1','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','format','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','error','[%s][members][writeDB]','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','uniqueid','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','assign','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel'];(function(_0x2a453b,_0x479c50){var _0x132f79=function(_0x5e3d83){while(--_0x5e3d83){_0x2a453b['push'](_0x2a453b['shift']());}};_0x132f79(++_0x479c50);}(_0x6d66,0x9c));var _0x66d6=function(_0x52dfb6,_0xd5f97){_0x52dfb6=_0x52dfb6-0x0;var _0x45d9e9=_0x6d66[_0x52dfb6];return _0x45d9e9;};'use strict';var _=require(_0x66d6('0x0'));var util=require(_0x66d6('0x1'));var utils=require(_0x66d6('0x2'));var members={};var exclude=[_0x66d6('0x3'),'Queue:'];function writeDB(_0x12d820){utils['info'](util[_0x66d6('0x4')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x12d820['uniqueid'],_0x12d820[_0x66d6('0x5')],_0x12d820[_0x66d6('0x6')],_0x12d820[_0x66d6('0x7')],_0x12d820[_0x66d6('0x8')],_0x12d820[_0x66d6('0x9')]));if(_0x12d820[_0x66d6('0x5')]){utils[_0x66d6('0xa')](_0x12d820[_0x66d6('0x5')])[_0x66d6('0xb')](function(_0x47a275){if(_0x47a275){_0x12d820['membername']=_0x47a275[_0x66d6('0xc')];_0x12d820[_0x66d6('0xd')]=_0x47a275[_0x66d6('0xd')];utils[_0x66d6('0xe')](_0x66d6('0xf'),_0x12d820);}else{utils[_0x66d6('0x10')](_0x12d820[_0x66d6('0x5')][_0x66d6('0x11')]('/')[0x1])[_0x66d6('0xb')](function(_0x3d4819){if(_0x3d4819){_0x12d820['membername']=_0x3d4819[_0x66d6('0xc')];_0x12d820[_0x66d6('0xd')]=_0x3d4819[_0x66d6('0xd')];utils[_0x66d6('0xe')](_0x66d6('0xf'),_0x12d820);}});}})['catch'](function(_0x1e4503){utils[_0x66d6('0x12')](util[_0x66d6('0x4')](_0x66d6('0x13'),_0x12d820['uniqueid']),_0x1e4503);});}delete members[_0x12d820[_0x66d6('0x5')]];}function startsWith(_0x156323,_0x3da88b){return _['some'](_0x156323,function(_0x36e04b){return _[_0x66d6('0x14')](_0x3da88b,_0x36e04b);});}exports[_0x66d6('0x15')]=function(_0x5a5f8f){try{utils[_0x66d6('0x16')](util[_0x66d6('0x4')](_0x66d6('0x17'),members[_0x5a5f8f[_0x66d6('0x18')]]?members[_0x5a5f8f['device']][_0x66d6('0x19')]:_0x5a5f8f['device']),_0x5a5f8f);utils[_0x66d6('0x1a')](util['format'](_0x66d6('0x1b'),members[_0x5a5f8f[_0x66d6('0x18')]]?members[_0x5a5f8f[_0x66d6('0x18')]]['uniqueid']:_0x5a5f8f[_0x66d6('0x18')],_0x5a5f8f[_0x66d6('0x1c')],_0x5a5f8f[_0x66d6('0x18')]));switch(_0x5a5f8f[_0x66d6('0x1c')]){case _0x66d6('0x1d'):case _0x66d6('0x1e'):if(!startsWith(exclude,_0x5a5f8f['device'])){members[_0x5a5f8f[_0x66d6('0x18')]]={'channel':'voice','interface':_0x5a5f8f[_0x66d6('0x18')],'type':'TALKING','enterAt':utils[_0x66d6('0x1f')](),'role':'agent'};}break;case _0x66d6('0x20'):if(!_[_0x66d6('0x21')](members[_0x5a5f8f[_0x66d6('0x18')]])){members[_0x5a5f8f[_0x66d6('0x18')]][_0x66d6('0x22')]=utils['now']();members[_0x5a5f8f['device']][_0x66d6('0x23')]=utils[_0x66d6('0x24')](members[_0x5a5f8f[_0x66d6('0x18')]][_0x66d6('0x22')],members[_0x5a5f8f[_0x66d6('0x18')]][_0x66d6('0x25')]);if(members[_0x5a5f8f[_0x66d6('0x18')]]['uniqueid']){writeDB(members[_0x5a5f8f[_0x66d6('0x18')]]);}}break;default:break;}}catch(_0x451480){utils['error'](util[_0x66d6('0x4')]('[%s][members][devicestatechange]',members[_0x5a5f8f[_0x66d6('0x18')]]?members[_0x5a5f8f[_0x66d6('0x18')]][_0x66d6('0x19')]:_0x5a5f8f[_0x66d6('0x18')]),_0x451480);}};exports[_0x66d6('0x26')]=function(_0x55dc37){try{if(!_['isNil'](members[_0x55dc37[_0x66d6('0x5')]])){utils[_0x66d6('0x16')](util['format'](_0x66d6('0x27'),_0x55dc37[_0x66d6('0x19')]),_0x55dc37);utils['info'](util[_0x66d6('0x4')](_0x66d6('0x28'),_0x55dc37['uniqueid'],_0x55dc37[_0x66d6('0x5')],_0x55dc37[_0x66d6('0x29')]));members[_0x55dc37[_0x66d6('0x5')]]=_['assign'](members[_0x55dc37[_0x66d6('0x5')]],{'data4':_0x55dc37[_0x66d6('0x29')],'uniqueid':_0x55dc37[_0x66d6('0x19')]});}}catch(_0x4db862){utils[_0x66d6('0x12')](util['format']('[%s][members][agentcomplete]',_0x55dc37[_0x66d6('0x19')]),_0x4db862);}};exports[_0x66d6('0x2a')]=function(_0x1db520){try{utils[_0x66d6('0x16')](util['format']('[%s][members][cdr]',_0x1db520[_0x66d6('0x19')]),_0x1db520);if(_0x1db520[_0x66d6('0x6')]){var _0x4ef4c4=_0x1db520[_0x66d6('0x6')][_0x66d6('0x11')]('-')[0x0];if(!_[_0x66d6('0x21')](members[_0x4ef4c4])){members[_0x4ef4c4]=_[_0x66d6('0x2b')](members[_0x4ef4c4],{'data1':members[_0x4ef4c4]['data1']||_0x1db520[_0x66d6('0x9')],'data2':members[_0x4ef4c4][_0x66d6('0x7')]||_0x1db520['source'],'data3':members[_0x4ef4c4][_0x66d6('0x2c')]||_0x1db520[_0x66d6('0x2d')],'uniqueid':members[_0x4ef4c4][_0x66d6('0x19')]||_0x1db520[_0x66d6('0x19')]});utils['info'](util[_0x66d6('0x4')](_0x66d6('0x2e'),_0x1db520[_0x66d6('0x19')],members[_0x4ef4c4]['data1'],members[_0x4ef4c4]['data2'],members[_0x4ef4c4][_0x66d6('0x2c')]));if(members[_0x4ef4c4][_0x66d6('0x22')]){writeDB(members[_0x4ef4c4]);}}}if(_0x1db520[_0x66d6('0x2f')]){var _0x33d4d2=_0x1db520['destinationchannel'][_0x66d6('0x11')]('-')[0x0];if(!_[_0x66d6('0x21')](members[_0x33d4d2])){members[_0x33d4d2]=_[_0x66d6('0x2b')](members[_0x33d4d2],{'data1':members[_0x33d4d2]['data1']||_0x1db520[_0x66d6('0x9')],'data2':members[_0x33d4d2]['data2']||_0x1db520[_0x66d6('0x30')],'data3':members[_0x33d4d2][_0x66d6('0x2c')]||_0x1db520[_0x66d6('0x2d')],'uniqueid':members[_0x33d4d2][_0x66d6('0x19')]||_0x1db520[_0x66d6('0x19')]});utils['info'](util[_0x66d6('0x4')](_0x66d6('0x2e'),_0x1db520[_0x66d6('0x19')],members[_0x33d4d2][_0x66d6('0x31')],members[_0x33d4d2][_0x66d6('0x7')],members[_0x33d4d2][_0x66d6('0x2c')]));if(members[_0x33d4d2][_0x66d6('0x22')]){writeDB(members[_0x33d4d2]);}}}}catch(_0x53bf6b){utils[_0x66d6('0x12')](util[_0x66d6('0x4')](_0x66d6('0x32'),_0x1db520[_0x66d6('0x19')]),_0x53bf6b);}}; \ No newline at end of file +var _0x914c=['[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','channel','split','data1','type','source','destination','data3','exitAt','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','then','request','CreateMemberReport','getUserByName','name','internal','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','diffTime','agentcomplete','[%s][members][agentcomplete]'];(function(_0x47712e,_0xcdea4){var _0x46b9cc=function(_0x5c29e8){while(--_0x5c29e8){_0x47712e['push'](_0x47712e['shift']());}};_0x46b9cc(++_0xcdea4);}(_0x914c,0x122));var _0xc914=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x914c[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0xc914('0x0'));var util=require(_0xc914('0x1'));var utils=require(_0xc914('0x2'));var members={};var exclude=[_0xc914('0x3'),_0xc914('0x4')];function writeDB(_0xd992ca){utils[_0xc914('0x5')](util[_0xc914('0x6')](_0xc914('0x7'),_0xd992ca[_0xc914('0x8')],_0xd992ca[_0xc914('0x9')],_0xd992ca['channel'],_0xd992ca[_0xc914('0xa')],_0xd992ca[_0xc914('0xb')],_0xd992ca['type']));if(_0xd992ca[_0xc914('0x9')]){utils['getUserByInterface'](_0xd992ca[_0xc914('0x9')])[_0xc914('0xc')](function(_0x453362){if(_0x453362){_0xd992ca[_0xc914('0xb')]=_0x453362['name'];_0xd992ca['internal']=_0x453362['internal'];utils[_0xc914('0xd')](_0xc914('0xe'),_0xd992ca);}else{utils[_0xc914('0xf')](_0xd992ca['interface']['split']('/')[0x1])[_0xc914('0xc')](function(_0x438aa5){if(_0x438aa5){_0xd992ca[_0xc914('0xb')]=_0x438aa5[_0xc914('0x10')];_0xd992ca['internal']=_0x438aa5[_0xc914('0x11')];utils[_0xc914('0xd')]('CreateMemberReport',_0xd992ca);}});}})[_0xc914('0x12')](function(_0x22bd8a){utils[_0xc914('0x13')](util[_0xc914('0x6')](_0xc914('0x14'),_0xd992ca['uniqueid']),_0x22bd8a);});}delete members[_0xd992ca[_0xc914('0x9')]];}function startsWith(_0x241588,_0x109109){return _[_0xc914('0x15')](_0x241588,function(_0x243ed7){return _[_0xc914('0x16')](_0x109109,_0x243ed7);});}exports[_0xc914('0x17')]=function(_0x5b9e53){try{utils[_0xc914('0x18')](util[_0xc914('0x6')](_0xc914('0x19'),members[_0x5b9e53[_0xc914('0x1a')]]?members[_0x5b9e53[_0xc914('0x1a')]][_0xc914('0x8')]:_0x5b9e53[_0xc914('0x1a')]),_0x5b9e53);utils[_0xc914('0x5')](util[_0xc914('0x6')](_0xc914('0x1b'),members[_0x5b9e53['device']]?members[_0x5b9e53[_0xc914('0x1a')]][_0xc914('0x8')]:_0x5b9e53[_0xc914('0x1a')],_0x5b9e53[_0xc914('0x1c')],_0x5b9e53[_0xc914('0x1a')]));switch(_0x5b9e53[_0xc914('0x1c')]){case _0xc914('0x1d'):case _0xc914('0x1e'):if(!startsWith(exclude,_0x5b9e53[_0xc914('0x1a')])){members[_0x5b9e53[_0xc914('0x1a')]]={'channel':_0xc914('0x1f'),'interface':_0x5b9e53['device'],'type':_0xc914('0x20'),'enterAt':utils[_0xc914('0x21')](),'role':_0xc914('0x22')};}break;case _0xc914('0x23'):if(!_[_0xc914('0x24')](members[_0x5b9e53['device']])){members[_0x5b9e53[_0xc914('0x1a')]]['exitAt']=utils['now']();members[_0x5b9e53['device']]['duration']=utils[_0xc914('0x25')](members[_0x5b9e53[_0xc914('0x1a')]]['exitAt'],members[_0x5b9e53[_0xc914('0x1a')]]['enterAt']);if(members[_0x5b9e53['device']][_0xc914('0x8')]){writeDB(members[_0x5b9e53[_0xc914('0x1a')]]);}}break;default:break;}}catch(_0xb00998){utils[_0xc914('0x13')](util[_0xc914('0x6')]('[%s][members][devicestatechange]',members[_0x5b9e53[_0xc914('0x1a')]]?members[_0x5b9e53[_0xc914('0x1a')]][_0xc914('0x8')]:_0x5b9e53[_0xc914('0x1a')]),_0xb00998);}};exports[_0xc914('0x26')]=function(_0x126201){try{if(!_[_0xc914('0x24')](members[_0x126201[_0xc914('0x9')]])){utils[_0xc914('0x18')](util[_0xc914('0x6')](_0xc914('0x27'),_0x126201[_0xc914('0x8')]),_0x126201);utils['info'](util[_0xc914('0x6')](_0xc914('0x28'),_0x126201[_0xc914('0x8')],_0x126201[_0xc914('0x9')],_0x126201[_0xc914('0x29')]));members[_0x126201[_0xc914('0x9')]]=_[_0xc914('0x2a')](members[_0x126201[_0xc914('0x9')]],{'data4':_0x126201[_0xc914('0x29')],'uniqueid':_0x126201[_0xc914('0x8')]});}}catch(_0x121a64){utils[_0xc914('0x13')](util[_0xc914('0x6')](_0xc914('0x27'),_0x126201[_0xc914('0x8')]),_0x121a64);}};exports[_0xc914('0x2b')]=function(_0x3e445d){try{utils['debug'](util[_0xc914('0x6')]('[%s][members][cdr]',_0x3e445d[_0xc914('0x8')]),_0x3e445d);if(_0x3e445d[_0xc914('0x2c')]){var _0x18b36f=_0x3e445d[_0xc914('0x2c')][_0xc914('0x2d')]('-')[0x0];if(!_[_0xc914('0x24')](members[_0x18b36f])){members[_0x18b36f]=_['assign'](members[_0x18b36f],{'data1':members[_0x18b36f][_0xc914('0x2e')]||_0x3e445d[_0xc914('0x2f')],'data2':members[_0x18b36f][_0xc914('0xa')]||_0x3e445d[_0xc914('0x30')],'data3':members[_0x18b36f]['data3']||_0x3e445d[_0xc914('0x31')],'uniqueid':members[_0x18b36f][_0xc914('0x8')]||_0x3e445d[_0xc914('0x8')]});utils[_0xc914('0x5')](util[_0xc914('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x3e445d['uniqueid'],members[_0x18b36f]['data1'],members[_0x18b36f]['data2'],members[_0x18b36f][_0xc914('0x32')]));if(members[_0x18b36f][_0xc914('0x33')]){writeDB(members[_0x18b36f]);}}}if(_0x3e445d[_0xc914('0x34')]){var _0x325c0a=_0x3e445d[_0xc914('0x34')][_0xc914('0x2d')]('-')[0x0];if(!_['isNil'](members[_0x325c0a])){members[_0x325c0a]=_[_0xc914('0x2a')](members[_0x325c0a],{'data1':members[_0x325c0a][_0xc914('0x2e')]||_0x3e445d[_0xc914('0x2f')],'data2':members[_0x325c0a]['data2']||_0x3e445d['source'],'data3':members[_0x325c0a]['data3']||_0x3e445d[_0xc914('0x31')],'uniqueid':members[_0x325c0a][_0xc914('0x8')]||_0x3e445d['uniqueid']});utils[_0xc914('0x5')](util['format'](_0xc914('0x35'),_0x3e445d[_0xc914('0x8')],members[_0x325c0a][_0xc914('0x2e')],members[_0x325c0a][_0xc914('0xa')],members[_0x325c0a][_0xc914('0x32')]));if(members[_0x325c0a][_0xc914('0x33')]){writeDB(members[_0x325c0a]);}}}}catch(_0x6cc3eb){utils[_0xc914('0x13')](util[_0xc914('0x6')](_0xc914('0x36'),_0x3e445d['uniqueid']),_0x6cc3eb);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index dbd70cd..c892428 100644 --- a/server/services/xdr/queues.controller.js +++ b/server/services/xdr/queues.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x11c0=['then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','position','now','error','hangup','isNil','debug','[%s][queues][hangup]','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','assigned','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][blindtransfer]','transfereeuniqueid','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','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertype','ATTENDED','transferexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','calleridnum','accountcode','getVoiceQueueByName'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x11c0,0x191));var _0x011c=function(_0x31b0de,_0x1a70ca){_0x31b0de=_0x31b0de-0x0;var _0x34b2ce=_0x11c0[_0x31b0de];return _0x34b2ce;};'use strict';var _=require(_0x011c('0x0'));var util=require(_0x011c('0x1'));var utils=require(_0x011c('0x2'));var queues={};function writeDB(_0x5aafec){utils[_0x011c('0x3')](util[_0x011c('0x4')](_0x011c('0x5'),_0x5aafec['uniqueid'],_0x5aafec[_0x011c('0x6')],_0x5aafec[_0x011c('0x7')],_0x5aafec['lastAssignedTo'],_0x5aafec[_0x011c('0x8')],_0x5aafec[_0x011c('0x9')],_0x5aafec['queuecallerexitreason']));if(_0x5aafec[_0x011c('0x7')]){utils[_0x011c('0xa')](_0x5aafec[_0x011c('0x7')])[_0x011c('0xb')](function(_0x1bcf4d){if(_0x1bcf4d){_0x5aafec['type']=_0x1bcf4d[_0x011c('0xc')];}utils[_0x011c('0xd')](_0x011c('0xe'),_0x5aafec);});}else{utils[_0x011c('0xd')](_0x011c('0xe'),_0x5aafec);}if(_0x5aafec['transfereduniqueid']){delete queues[_0x5aafec[_0x011c('0xf')]];}else{delete queues[_0x5aafec[_0x011c('0x10')]];}}exports[_0x011c('0x11')]=function(_0x49ed3b){try{utils['debug'](util[_0x011c('0x4')](_0x011c('0x12'),_0x49ed3b[_0x011c('0x10')]),_0x49ed3b);utils[_0x011c('0x3')](util[_0x011c('0x4')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x49ed3b[_0x011c('0x10')],_0x49ed3b[_0x011c('0x7')],_0x49ed3b[_0x011c('0x13')]));queues[_0x49ed3b[_0x011c('0x10')]]=_['assign'](_0x49ed3b,{'originalposition':_0x49ed3b['position'],'queuecallerjoinAt':utils[_0x011c('0x14')](),'mohtime':0x0});}catch(_0x4b61b3){utils[_0x011c('0x15')](util['format']('[%s][queues][queuecallerjoin]',_0x49ed3b[_0x011c('0x10')]),_0x4b61b3);}};exports[_0x011c('0x16')]=function(_0x4c9252){try{if(!_[_0x011c('0x17')](queues[_0x4c9252[_0x011c('0x10')]])){utils[_0x011c('0x18')](util['format'](_0x011c('0x19'),_0x4c9252[_0x011c('0x10')]),_0x4c9252);if(queues[_0x4c9252[_0x011c('0x10')]]['queuecallerleaveAt']){if(!queues[_0x4c9252['uniqueid']]['queuecallerabandon']&&!queues[_0x4c9252[_0x011c('0x10')]]['queuecallerexit']){queues[_0x4c9252[_0x011c('0x10')]]['queuecallercomplete']=!![];queues[_0x4c9252[_0x011c('0x10')]][_0x011c('0x1a')]=utils['now']();queues[_0x4c9252['uniqueid']][_0x011c('0x1b')]=_0x011c('0x1c');}utils[_0x011c('0x3')](util[_0x011c('0x4')](_0x011c('0x1d'),_0x4c9252[_0x011c('0x10')],queues[_0x4c9252[_0x011c('0x10')]][_0x011c('0x1e')],queues[_0x4c9252[_0x011c('0x10')]][_0x011c('0x1b')]));writeDB(queues[_0x4c9252[_0x011c('0x10')]]);}else if(queues[_0x4c9252[_0x011c('0x10')]]['transfereduniqueid']){utils[_0x011c('0x3')](util[_0x011c('0x4')](_0x011c('0x1f'),_0x4c9252[_0x011c('0x10')],queues[_0x4c9252[_0x011c('0x10')]][_0x011c('0x1e')],queues[_0x4c9252[_0x011c('0x10')]][_0x011c('0xf')]));queues[queues[_0x4c9252[_0x011c('0x10')]]['transfereduniqueid']]=queues[_0x4c9252['uniqueid']];queues[queues[_0x4c9252[_0x011c('0x10')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x4c9252[_0x011c('0x10')]];}}}catch(_0x283571){utils[_0x011c('0x15')](util['format']('[%s][queues][hangup]',_0x4c9252[_0x011c('0x10')]),_0x283571);}};exports[_0x011c('0x20')]=function(_0x4cd466){try{utils[_0x011c('0x18')](util['format']('[%s][queues][varset]',_0x4cd466[_0x011c('0x10')]),_0x4cd466);if(!_[_0x011c('0x17')](_0x4cd466['variable'][_0x011c('0x21')])&&_0x4cd466[_0x011c('0x22')][_0x011c('0x23')]()!==_0x011c('0x24')){if(!_[_0x011c('0x17')](queues[_0x4cd466[_0x011c('0x10')]])){queues[_0x4cd466[_0x011c('0x10')]][_0x011c('0x25')]=![];queues[_0x4cd466['uniqueid']]['queuecallerabandonAt']=null;queues[_0x4cd466[_0x011c('0x10')]][_0x011c('0x26')]=!![];queues[_0x4cd466[_0x011c('0x10')]][_0x011c('0x27')]=utils['now']();queues[_0x4cd466[_0x011c('0x10')]][_0x011c('0x1b')]=_0x4cd466[_0x011c('0x22')][_0x011c('0x23')]();utils['info'](util['format'](_0x011c('0x28'),_0x4cd466[_0x011c('0x10')],queues[_0x4cd466[_0x011c('0x10')]][_0x011c('0x1e')],_0x4cd466['value'],queues[_0x4cd466['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x4cd466[_0x011c('0x10')]]);}}else if(!_['isNil'](_0x4cd466['variable'][_0x011c('0x29')])){if(!_['isNil'](queues[_0x4cd466['uniqueid']])&&!queues[_0x4cd466[_0x011c('0x10')]]['queuecallerabandon']){queues[_0x4cd466[_0x011c('0x10')]][_0x011c('0x25')]=![];queues[_0x4cd466['uniqueid']][_0x011c('0x2a')]=null;queues[_0x4cd466[_0x011c('0x10')]]['queuecallerexit']=!![];queues[_0x4cd466[_0x011c('0x10')]]['queuecallerexitAt']=utils['now']();queues[_0x4cd466[_0x011c('0x10')]][_0x011c('0x1b')]=_0x011c('0x2b');utils['info'](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x4cd466[_0x011c('0x10')],queues[_0x4cd466[_0x011c('0x10')]][_0x011c('0x1e')],_0x4cd466['value'],queues[_0x4cd466['uniqueid']][_0x011c('0x1b')]));}}}catch(_0x2e427c){utils['error'](util[_0x011c('0x4')](_0x011c('0x2c'),_0x4cd466[_0x011c('0x10')]),_0x2e427c);}};exports['queuecallerabandon']=function(_0x36282a){try{if(!_[_0x011c('0x17')](queues[_0x36282a[_0x011c('0x10')]])){utils[_0x011c('0x18')](util[_0x011c('0x4')]('[%s][queues][queuecallerabandon]',_0x36282a[_0x011c('0x10')]),_0x36282a);queues[_0x36282a[_0x011c('0x10')]][_0x011c('0x26')]=![];queues[_0x36282a[_0x011c('0x10')]][_0x011c('0x27')]=null;queues[_0x36282a[_0x011c('0x10')]][_0x011c('0x25')]=!![];queues[_0x36282a[_0x011c('0x10')]][_0x011c('0x2a')]=utils[_0x011c('0x14')]();queues[_0x36282a['uniqueid']][_0x011c('0x1b')]=_0x011c('0x2d');utils[_0x011c('0x3')](util[_0x011c('0x4')](_0x011c('0x2e'),_0x36282a[_0x011c('0x10')],queues[_0x36282a[_0x011c('0x10')]][_0x011c('0x1e')],queues[_0x36282a[_0x011c('0x10')]][_0x011c('0x1b')]));}}catch(_0x34f247){utils['error'](util['format']('[%s][queues][queuecallerabandon]',_0x36282a[_0x011c('0x10')]),_0x34f247);}};exports[_0x011c('0x2f')]=function(_0x2cb24b){try{if(!_[_0x011c('0x17')](queues[_0x2cb24b[_0x011c('0x10')]])){utils[_0x011c('0x18')](util[_0x011c('0x4')](_0x011c('0x30'),_0x2cb24b[_0x011c('0x10')]),_0x2cb24b);utils[_0x011c('0x3')](util['format'](_0x011c('0x31'),_0x2cb24b[_0x011c('0x10')],queues[_0x2cb24b[_0x011c('0x10')]][_0x011c('0x1e')],_0x2cb24b[_0x011c('0x32')],_0x2cb24b[_0x011c('0x33')]));queues[_0x2cb24b['uniqueid']][_0x011c('0x2f')]=!![];queues[_0x2cb24b['uniqueid']][_0x011c('0x34')]=utils[_0x011c('0x14')]();queues[_0x2cb24b[_0x011c('0x10')]][_0x011c('0x35')]=utils['diffTime'](queues[_0x2cb24b[_0x011c('0x10')]]['queuecallerleaveAt'],queues[_0x2cb24b[_0x011c('0x10')]][_0x011c('0x36')]);queues[_0x2cb24b[_0x011c('0x10')]]['position']=_0x2cb24b[_0x011c('0x13')];queues[_0x2cb24b['uniqueid']][_0x011c('0x37')]=_0x2cb24b[_0x011c('0x37')];queues[_0x2cb24b[_0x011c('0x10')]][_0x011c('0x32')]=_0x2cb24b[_0x011c('0x32')];queues[_0x2cb24b[_0x011c('0x10')]][_0x011c('0x33')]=_0x2cb24b[_0x011c('0x33')];}}catch(_0x3dff93){utils[_0x011c('0x15')](util[_0x011c('0x4')]('[%s][queues][queuecallerleave]',_0x2cb24b[_0x011c('0x10')]),_0x3dff93);}};exports[_0x011c('0x38')]=function(_0x1b5185){try{if(!_[_0x011c('0x17')](queues[_0x1b5185[_0x011c('0x10')]])){utils[_0x011c('0x18')](util[_0x011c('0x4')](_0x011c('0x39'),_0x1b5185[_0x011c('0x10')]),_0x1b5185);utils[_0x011c('0x3')](util[_0x011c('0x4')](_0x011c('0x3a'),_0x1b5185[_0x011c('0x10')],queues[_0x1b5185[_0x011c('0x10')]][_0x011c('0x1e')],_0x1b5185[_0x011c('0x3b')],_0x1b5185['destaccountcode']));queues[_0x1b5185[_0x011c('0x10')]][_0x011c('0x25')]=![];queues[_0x1b5185['uniqueid']][_0x011c('0x25')]=![];queues[_0x1b5185[_0x011c('0x10')]]['queuecallerabandonAt']=null;queues[_0x1b5185[_0x011c('0x10')]][_0x011c('0x26')]=![];queues[_0x1b5185['uniqueid']][_0x011c('0x1b')]=null;queues[_0x1b5185[_0x011c('0x10')]][_0x011c('0x27')]=null;queues[_0x1b5185[_0x011c('0x10')]]['assigned']=!![];queues[_0x1b5185[_0x011c('0x10')]]['accountcode']=_0x1b5185[_0x011c('0x3c')];queues[_0x1b5185[_0x011c('0x10')]][_0x011c('0x3d')]=_0x1b5185[_0x011c('0x3b')];}}catch(_0x319012){utils['error'](util[_0x011c('0x4')](_0x011c('0x39'),_0x1b5185[_0x011c('0x10')]),_0x319012);}};exports[_0x011c('0x3e')]=function(_0x51e622){try{if(!_[_0x011c('0x17')](queues[_0x51e622[_0x011c('0x10')]])){if(queues[_0x51e622[_0x011c('0x10')]]['queuecallerleaveAt']){utils['debug'](util[_0x011c('0x4')](_0x011c('0x3f'),_0x51e622['uniqueid']),_0x51e622);queues[_0x51e622[_0x011c('0x10')]][_0x011c('0x25')]=![];queues[_0x51e622[_0x011c('0x10')]][_0x011c('0x25')]=![];queues[_0x51e622[_0x011c('0x10')]][_0x011c('0x2a')]=null;queues[_0x51e622['uniqueid']][_0x011c('0x26')]=![];queues[_0x51e622[_0x011c('0x10')]][_0x011c('0x27')]=null;queues[_0x51e622[_0x011c('0x10')]][_0x011c('0x40')]=!![];queues[_0x51e622[_0x011c('0x10')]][_0x011c('0x3d')]=_0x51e622[_0x011c('0x3b')];queues[_0x51e622[_0x011c('0x10')]][_0x011c('0x41')]=!![];queues[_0x51e622[_0x011c('0x10')]][_0x011c('0x1a')]=utils[_0x011c('0x14')]();if(_0x51e622[_0x011c('0x42')]==_0x011c('0x43')){if(!queues[_0x51e622[_0x011c('0x10')]][_0x011c('0x43')]){queues[_0x51e622['uniqueid']][_0x011c('0x1b')]=_0x011c('0x44');}}else{queues[_0x51e622['uniqueid']][_0x011c('0x1b')]=_0x011c('0x45')+_0x51e622['reason']['toUpperCase']();}utils[_0x011c('0x3')](util[_0x011c('0x4')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x51e622[_0x011c('0x10')],queues[_0x51e622[_0x011c('0x10')]]['name'],_0x51e622[_0x011c('0x3b')],queues[_0x51e622[_0x011c('0x10')]][_0x011c('0x1b')]));writeDB(queues[_0x51e622[_0x011c('0x10')]]);}}}catch(_0x4a5c79){utils[_0x011c('0x15')](util[_0x011c('0x4')]('[%s][queues][agentcomplete]',_0x51e622['uniqueid']),_0x4a5c79);}};exports['blindtransfer']=function(_0x31fcbb){try{if(!_[_0x011c('0x17')](queues[_0x31fcbb['transfereeuniqueid']])){utils[_0x011c('0x18')](util['format'](_0x011c('0x46'),_0x31fcbb[_0x011c('0x10')]),_0x31fcbb);queues[_0x31fcbb[_0x011c('0x47')]][_0x011c('0x43')]=!![];queues[_0x31fcbb['transfereeuniqueid']]['transfertype']='BLIND';queues[_0x31fcbb[_0x011c('0x47')]]['transferexten']=_0x31fcbb[_0x011c('0x48')];queues[_0x31fcbb[_0x011c('0x47')]][_0x011c('0x49')]=_0x31fcbb[_0x011c('0x47')];queues[_0x31fcbb[_0x011c('0x47')]][_0x011c('0x1b')]=_0x011c('0x4a');utils[_0x011c('0x3')](util['format'](_0x011c('0x4b'),_0x31fcbb[_0x011c('0x10')],queues[_0x31fcbb['transfereeuniqueid']]['name'],_0x31fcbb[_0x011c('0x47')],_0x31fcbb[_0x011c('0x48')]));}}catch(_0x30b070){utils['error'](util[_0x011c('0x4')](_0x011c('0x46'),_0x31fcbb[_0x011c('0x10')]),_0x30b070);}};exports[_0x011c('0x4c')]=function(_0x146cee){try{utils[_0x011c('0x18')](util[_0x011c('0x4')](_0x011c('0x4d'),_0x146cee['origtransfereruniqueid']),_0x146cee);if(_0x146cee[_0x011c('0x4e')]==_0x146cee[_0x011c('0x4f')]){if(!_['isNil'](queues[_0x146cee[_0x011c('0x50')]])){utils[_0x011c('0x3')](util[_0x011c('0x4')](_0x011c('0x51'),_0x146cee[_0x011c('0x4e')],queues[_0x146cee['secondtransfererlinkedid']]['name'],_0x146cee['origtransfererexten']));queues[_0x146cee[_0x011c('0x50')]][_0x011c('0x43')]=!![];queues[_0x146cee[_0x011c('0x50')]]['transfertype']='ATTENDED';queues[_0x146cee['secondtransfererlinkedid']]['transferexten']=_0x146cee['origtransfererexten'];queues[_0x146cee[_0x011c('0x50')]][_0x011c('0x49')]=_0x146cee[_0x011c('0x4e')];queues[_0x146cee[_0x011c('0x50')]][_0x011c('0x1b')]=_0x011c('0x52');}if(!_['isNil'](queues[_0x146cee['origtransfererlinkedid']])){if(_0x146cee[_0x011c('0x53')]&&queues[_0x146cee[_0x011c('0x53')]]){queues[_0x146cee['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x146cee['transfereeuniqueid']]=_['clone'](queues[_0x146cee[_0x011c('0x53')]]);queues[_0x146cee[_0x011c('0x47')]]['transfereduniqueid']=_0x146cee['transfertargetuniqueid'];queues[_0x146cee['transfereeuniqueid']][_0x011c('0x54')]=0x2;queues[_0x146cee['transfereeuniqueid']][_0x011c('0x8')]=queues[_0x146cee[_0x011c('0x50')]][_0x011c('0x8')];queues[_0x146cee[_0x011c('0x47')]][_0x011c('0x55')]=queues[_0x146cee['secondtransfererlinkedid']][_0x011c('0x55')];queues[_0x146cee[_0x011c('0x47')]][_0x011c('0x36')]=utils[_0x011c('0x14')]();queues[_0x146cee['transfereeuniqueid']][_0x011c('0x34')]=utils['now']();queues[_0x146cee[_0x011c('0x47')]][_0x011c('0x35')]=0x0;queues[_0x146cee['transfereeuniqueid']][_0x011c('0x56')]=0x0;utils[_0x011c('0x3')](util['format'](_0x011c('0x57'),_0x146cee[_0x011c('0x4e')],queues[_0x146cee['transfereeuniqueid']]['name'],queues[_0x146cee['transfereeuniqueid']]['calleridnum'],queues[_0x146cee[_0x011c('0x47')]][_0x011c('0x55')]));}else{utils[_0x011c('0x3')](util['format'](_0x011c('0x58'),_0x146cee['origtransfereruniqueid'],queues[_0x146cee[_0x011c('0x4f')]][_0x011c('0x1e')],_0x146cee[_0x011c('0x50')]));queues[_0x146cee[_0x011c('0x4f')]][_0x011c('0xf')]=_0x146cee['secondtransfererlinkedid'];}}}else if(_0x146cee[_0x011c('0x59')]==_0x146cee[_0x011c('0x50')]){if(!_[_0x011c('0x17')](queues[_0x146cee[_0x011c('0x4f')]])){utils[_0x011c('0x3')](util[_0x011c('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x146cee[_0x011c('0x4e')],queues[_0x146cee[_0x011c('0x4f')]]['name'],_0x146cee[_0x011c('0x59')],_0x146cee[_0x011c('0x5a')]));queues[_0x146cee['origtransfererlinkedid']][_0x011c('0x43')]=!![];queues[_0x146cee[_0x011c('0x4f')]][_0x011c('0x5b')]=_0x011c('0x5c');queues[_0x146cee[_0x011c('0x4f')]][_0x011c('0x5d')]=_0x146cee[_0x011c('0x5a')];queues[_0x146cee[_0x011c('0x4f')]][_0x011c('0x49')]=_0x146cee[_0x011c('0x59')];queues[_0x146cee['origtransfererlinkedid']][_0x011c('0x1b')]='ATTENDEDTRANSFER';}if(!_[_0x011c('0x17')](queues[_0x146cee['secondtransfererlinkedid']])){if(_0x146cee[_0x011c('0x5e')]&&queues[_0x146cee[_0x011c('0x5e')]]){queues[_0x146cee[_0x011c('0x5e')]][_0x011c('0x54')]=0x1;queues[_0x146cee[_0x011c('0x5f')]]=_['clone'](queues[_0x146cee['transfertargetlinkedid']]);queues[_0x146cee[_0x011c('0x5f')]][_0x011c('0xf')]=_0x146cee['transfertargetuniqueid'];queues[_0x146cee[_0x011c('0x5f')]][_0x011c('0x54')]=0x2;queues[_0x146cee[_0x011c('0x5f')]][_0x011c('0x8')]=queues[_0x146cee[_0x011c('0x4f')]]['calleridnum'];queues[_0x146cee[_0x011c('0x5f')]][_0x011c('0x55')]=queues[_0x146cee[_0x011c('0x4f')]]['calleridname'];queues[_0x146cee[_0x011c('0x5f')]][_0x011c('0x36')]=utils[_0x011c('0x14')]();queues[_0x146cee[_0x011c('0x5f')]][_0x011c('0x34')]=utils[_0x011c('0x14')]();queues[_0x146cee[_0x011c('0x5f')]][_0x011c('0x35')]=0x0;queues[_0x146cee[_0x011c('0x5f')]][_0x011c('0x56')]=0x0;utils[_0x011c('0x3')](util[_0x011c('0x4')](_0x011c('0x60'),_0x146cee[_0x011c('0x4e')],queues[_0x146cee['transfertargetuniqueid']][_0x011c('0x1e')],queues[_0x146cee[_0x011c('0x5f')]][_0x011c('0xf')],queues[_0x146cee['transfertargetuniqueid']][_0x011c('0x8')],queues[_0x146cee[_0x011c('0x5f')]][_0x011c('0x55')]));}else{utils['info'](util[_0x011c('0x4')](_0x011c('0x58'),_0x146cee['origtransfereruniqueid'],queues[_0x146cee[_0x011c('0x50')]][_0x011c('0x1e')],_0x146cee[_0x011c('0x4f')]));queues[_0x146cee[_0x011c('0x50')]][_0x011c('0xf')]=_0x146cee['origtransfererlinkedid'];}}}}catch(_0x5c0dbd){utils[_0x011c('0x15')](util[_0x011c('0x4')](_0x011c('0x4d'),_0x146cee[_0x011c('0x4e')]),_0x5c0dbd);}};exports[_0x011c('0x61')]=function(_0x18fa02){try{if(!_[_0x011c('0x17')](queues[_0x18fa02[_0x011c('0x10')]])){utils[_0x011c('0x18')](util[_0x011c('0x4')](_0x011c('0x62'),_0x18fa02[_0x011c('0x10')]),_0x18fa02);queues[_0x18fa02[_0x011c('0x10')]][_0x011c('0x63')]=utils['now']();utils[_0x011c('0x3')](util[_0x011c('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x18fa02['uniqueid'],queues[_0x18fa02[_0x011c('0x10')]][_0x011c('0x1e')],queues[_0x18fa02[_0x011c('0x10')]]['musiconholdstartAt']));}}catch(_0x4ae0e5){utils[_0x011c('0x15')](util['format'](_0x011c('0x62'),_0x18fa02[_0x011c('0x10')]),_0x4ae0e5);}};exports[_0x011c('0x64')]=function(_0x4abbe1){try{if(!_[_0x011c('0x17')](queues[_0x4abbe1[_0x011c('0x10')]])){if(!_[_0x011c('0x17')](queues[_0x4abbe1[_0x011c('0x10')]][_0x011c('0x63')])){utils[_0x011c('0x18')](util[_0x011c('0x4')](_0x011c('0x65'),_0x4abbe1[_0x011c('0x10')]),_0x4abbe1);queues[_0x4abbe1[_0x011c('0x10')]][_0x011c('0x56')]+=utils['diffTime'](utils[_0x011c('0x14')](),queues[_0x4abbe1[_0x011c('0x10')]][_0x011c('0x63')]);utils[_0x011c('0x3')](util[_0x011c('0x4')](_0x011c('0x66'),_0x4abbe1[_0x011c('0x10')],queues[_0x4abbe1[_0x011c('0x10')]]['name'],queues[_0x4abbe1[_0x011c('0x10')]][_0x011c('0x56')]));delete queues[_0x4abbe1['uniqueid']]['musiconholdstartAt'];}}}catch(_0x206c52){utils[_0x011c('0x15')](util['format']('[%s][queues][musiconholdstop]',_0x4abbe1[_0x011c('0x10')]),_0x206c52);}}; \ No newline at end of file +var _0xb339=['agentcomplete','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','extension','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','transferexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','clone','mohtime','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','lodash','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','hangup','isNil','[%s][queues][hangup]','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','[%s][queues][varset]','variable','value','CONTINUE','queuecallerexit','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandon','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','error','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','destaccountcode','[%s][queues][agentconnect]'];(function(_0x4a464e,_0x250abf){var _0x54d070=function(_0xf56d7){while(--_0xf56d7){_0x4a464e['push'](_0x4a464e['shift']());}};_0x54d070(++_0x250abf);}(_0xb339,0x15a));var _0x9b33=function(_0x5645ad,_0x580ea3){_0x5645ad=_0x5645ad-0x0;var _0x17d292=_0xb339[_0x5645ad];return _0x17d292;};'use strict';var _=require(_0x9b33('0x0'));var util=require('util');var utils=require(_0x9b33('0x1'));var queues={};function writeDB(_0x4da4f1){utils['info'](util[_0x9b33('0x2')](_0x9b33('0x3'),_0x4da4f1[_0x9b33('0x4')],_0x4da4f1[_0x9b33('0x5')],_0x4da4f1['queue'],_0x4da4f1[_0x9b33('0x6')],_0x4da4f1[_0x9b33('0x7')],_0x4da4f1[_0x9b33('0x8')],_0x4da4f1[_0x9b33('0x9')]));if(_0x4da4f1[_0x9b33('0xa')]){utils['getVoiceQueueByName'](_0x4da4f1[_0x9b33('0xa')])[_0x9b33('0xb')](function(_0xe41379){if(_0xe41379){_0x4da4f1[_0x9b33('0xc')]=_0xe41379[_0x9b33('0xc')];}utils[_0x9b33('0xd')]('CreateVoiceQueueReport',_0x4da4f1);});}else{utils[_0x9b33('0xd')](_0x9b33('0xe'),_0x4da4f1);}if(_0x4da4f1['transfereduniqueid']){delete queues[_0x4da4f1[_0x9b33('0xf')]];}else{delete queues[_0x4da4f1[_0x9b33('0x4')]];}}exports[_0x9b33('0x10')]=function(_0x4929cf){try{utils[_0x9b33('0x11')](util[_0x9b33('0x2')](_0x9b33('0x12'),_0x4929cf[_0x9b33('0x4')]),_0x4929cf);utils[_0x9b33('0x13')](util['format'](_0x9b33('0x14'),_0x4929cf['uniqueid'],_0x4929cf[_0x9b33('0xa')],_0x4929cf[_0x9b33('0x15')]));queues[_0x4929cf['uniqueid']]=_[_0x9b33('0x16')](_0x4929cf,{'originalposition':_0x4929cf['position'],'queuecallerjoinAt':utils[_0x9b33('0x17')](),'mohtime':0x0});}catch(_0x2337e8){utils['error'](util[_0x9b33('0x2')](_0x9b33('0x12'),_0x4929cf[_0x9b33('0x4')]),_0x2337e8);}};exports[_0x9b33('0x18')]=function(_0x1d261d){try{if(!_[_0x9b33('0x19')](queues[_0x1d261d['uniqueid']])){utils['debug'](util[_0x9b33('0x2')](_0x9b33('0x1a'),_0x1d261d[_0x9b33('0x4')]),_0x1d261d);if(queues[_0x1d261d[_0x9b33('0x4')]]['queuecallerleaveAt']){if(!queues[_0x1d261d[_0x9b33('0x4')]]['queuecallerabandon']&&!queues[_0x1d261d[_0x9b33('0x4')]]['queuecallerexit']){queues[_0x1d261d['uniqueid']][_0x9b33('0x1b')]=!![];queues[_0x1d261d[_0x9b33('0x4')]][_0x9b33('0x1c')]=utils['now']();queues[_0x1d261d[_0x9b33('0x4')]][_0x9b33('0x9')]=_0x9b33('0x1d');}utils[_0x9b33('0x13')](util[_0x9b33('0x2')](_0x9b33('0x1e'),_0x1d261d['uniqueid'],queues[_0x1d261d[_0x9b33('0x4')]][_0x9b33('0x1f')],queues[_0x1d261d[_0x9b33('0x4')]][_0x9b33('0x9')]));writeDB(queues[_0x1d261d[_0x9b33('0x4')]]);}else if(queues[_0x1d261d['uniqueid']][_0x9b33('0xf')]){utils[_0x9b33('0x13')](util['format'](_0x9b33('0x20'),_0x1d261d[_0x9b33('0x4')],queues[_0x1d261d[_0x9b33('0x4')]][_0x9b33('0x1f')],queues[_0x1d261d[_0x9b33('0x4')]][_0x9b33('0xf')]));queues[queues[_0x1d261d[_0x9b33('0x4')]][_0x9b33('0xf')]]=queues[_0x1d261d['uniqueid']];queues[queues[_0x1d261d[_0x9b33('0x4')]][_0x9b33('0xf')]]['queuecallerenterreason']=0x2;delete queues[_0x1d261d[_0x9b33('0x4')]];}}}catch(_0x1c2703){utils['error'](util['format'](_0x9b33('0x1a'),_0x1d261d[_0x9b33('0x4')]),_0x1c2703);}};exports[_0x9b33('0x21')]=function(_0xc81ca7){try{utils[_0x9b33('0x11')](util[_0x9b33('0x2')](_0x9b33('0x22'),_0xc81ca7['uniqueid']),_0xc81ca7);if(!_[_0x9b33('0x19')](_0xc81ca7[_0x9b33('0x23')]['queuestatus'])&&_0xc81ca7[_0x9b33('0x24')]['toUpperCase']()!==_0x9b33('0x25')){if(!_['isNil'](queues[_0xc81ca7[_0x9b33('0x4')]])){queues[_0xc81ca7[_0x9b33('0x4')]]['queuecallerabandon']=![];queues[_0xc81ca7['uniqueid']]['queuecallerabandonAt']=null;queues[_0xc81ca7[_0x9b33('0x4')]][_0x9b33('0x26')]=!![];queues[_0xc81ca7[_0x9b33('0x4')]][_0x9b33('0x27')]=utils[_0x9b33('0x17')]();queues[_0xc81ca7[_0x9b33('0x4')]]['queuecallerexitreason']=_0xc81ca7[_0x9b33('0x24')][_0x9b33('0x28')]();utils[_0x9b33('0x13')](util[_0x9b33('0x2')](_0x9b33('0x29'),_0xc81ca7[_0x9b33('0x4')],queues[_0xc81ca7[_0x9b33('0x4')]][_0x9b33('0x1f')],_0xc81ca7[_0x9b33('0x24')],queues[_0xc81ca7['uniqueid']][_0x9b33('0x9')]));writeDB(queues[_0xc81ca7[_0x9b33('0x4')]]);}}else if(!_['isNil'](_0xc81ca7[_0x9b33('0x23')][_0x9b33('0x2a')])){if(!_[_0x9b33('0x19')](queues[_0xc81ca7[_0x9b33('0x4')]])&&!queues[_0xc81ca7[_0x9b33('0x4')]][_0x9b33('0x2b')]){queues[_0xc81ca7[_0x9b33('0x4')]][_0x9b33('0x2b')]=![];queues[_0xc81ca7[_0x9b33('0x4')]][_0x9b33('0x2c')]=null;queues[_0xc81ca7[_0x9b33('0x4')]][_0x9b33('0x26')]=!![];queues[_0xc81ca7[_0x9b33('0x4')]]['queuecallerexitAt']=utils[_0x9b33('0x17')]();queues[_0xc81ca7[_0x9b33('0x4')]][_0x9b33('0x9')]=_0x9b33('0x2d');utils[_0x9b33('0x13')](util['format'](_0x9b33('0x2e'),_0xc81ca7['uniqueid'],queues[_0xc81ca7['uniqueid']][_0x9b33('0x1f')],_0xc81ca7[_0x9b33('0x24')],queues[_0xc81ca7[_0x9b33('0x4')]][_0x9b33('0x9')]));}}}catch(_0x119ae3){utils[_0x9b33('0x2f')](util['format'](_0x9b33('0x22'),_0xc81ca7[_0x9b33('0x4')]),_0x119ae3);}};exports[_0x9b33('0x2b')]=function(_0x417451){try{if(!_[_0x9b33('0x19')](queues[_0x417451['uniqueid']])){utils['debug'](util[_0x9b33('0x2')](_0x9b33('0x30'),_0x417451[_0x9b33('0x4')]),_0x417451);queues[_0x417451['uniqueid']][_0x9b33('0x26')]=![];queues[_0x417451[_0x9b33('0x4')]][_0x9b33('0x27')]=null;queues[_0x417451['uniqueid']][_0x9b33('0x2b')]=!![];queues[_0x417451[_0x9b33('0x4')]][_0x9b33('0x2c')]=utils[_0x9b33('0x17')]();queues[_0x417451[_0x9b33('0x4')]][_0x9b33('0x9')]='ABANDONED';utils[_0x9b33('0x13')](util[_0x9b33('0x2')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x417451[_0x9b33('0x4')],queues[_0x417451[_0x9b33('0x4')]][_0x9b33('0x1f')],queues[_0x417451[_0x9b33('0x4')]][_0x9b33('0x9')]));}}catch(_0x2db6a5){utils[_0x9b33('0x2f')](util[_0x9b33('0x2')](_0x9b33('0x30'),_0x417451[_0x9b33('0x4')]),_0x2db6a5);}};exports['queuecallerleave']=function(_0x278970){try{if(!_[_0x9b33('0x19')](queues[_0x278970[_0x9b33('0x4')]])){utils['debug'](util['format']('[%s][queues][queuecallerleave]',_0x278970[_0x9b33('0x4')]),_0x278970);utils[_0x9b33('0x13')](util[_0x9b33('0x2')](_0x9b33('0x31'),_0x278970[_0x9b33('0x4')],queues[_0x278970['uniqueid']][_0x9b33('0x1f')],_0x278970[_0x9b33('0x32')],_0x278970[_0x9b33('0x33')]));queues[_0x278970['uniqueid']]['queuecallerleave']=!![];queues[_0x278970[_0x9b33('0x4')]][_0x9b33('0x34')]=utils['now']();queues[_0x278970[_0x9b33('0x4')]][_0x9b33('0x35')]=utils[_0x9b33('0x36')](queues[_0x278970[_0x9b33('0x4')]][_0x9b33('0x34')],queues[_0x278970[_0x9b33('0x4')]][_0x9b33('0x37')]);queues[_0x278970[_0x9b33('0x4')]][_0x9b33('0x15')]=_0x278970[_0x9b33('0x15')];queues[_0x278970[_0x9b33('0x4')]][_0x9b33('0x38')]=_0x278970[_0x9b33('0x38')];queues[_0x278970[_0x9b33('0x4')]][_0x9b33('0x32')]=_0x278970[_0x9b33('0x32')];queues[_0x278970[_0x9b33('0x4')]][_0x9b33('0x33')]=_0x278970[_0x9b33('0x33')];}}catch(_0x46d5c1){utils[_0x9b33('0x2f')](util[_0x9b33('0x2')]('[%s][queues][queuecallerleave]',_0x278970['uniqueid']),_0x46d5c1);}};exports['agentconnect']=function(_0x410e8c){try{if(!_[_0x9b33('0x19')](queues[_0x410e8c[_0x9b33('0x4')]])){utils['debug'](util[_0x9b33('0x2')]('[%s][queues][agentconnect]',_0x410e8c[_0x9b33('0x4')]),_0x410e8c);utils[_0x9b33('0x13')](util[_0x9b33('0x2')](_0x9b33('0x39'),_0x410e8c[_0x9b33('0x4')],queues[_0x410e8c['uniqueid']][_0x9b33('0x1f')],_0x410e8c[_0x9b33('0x3a')],_0x410e8c['destaccountcode']));queues[_0x410e8c[_0x9b33('0x4')]][_0x9b33('0x2b')]=![];queues[_0x410e8c[_0x9b33('0x4')]][_0x9b33('0x2b')]=![];queues[_0x410e8c['uniqueid']][_0x9b33('0x2c')]=null;queues[_0x410e8c[_0x9b33('0x4')]][_0x9b33('0x26')]=![];queues[_0x410e8c[_0x9b33('0x4')]][_0x9b33('0x9')]=null;queues[_0x410e8c[_0x9b33('0x4')]][_0x9b33('0x27')]=null;queues[_0x410e8c['uniqueid']][_0x9b33('0x3b')]=!![];queues[_0x410e8c[_0x9b33('0x4')]][_0x9b33('0x8')]=_0x410e8c[_0x9b33('0x3c')];queues[_0x410e8c[_0x9b33('0x4')]][_0x9b33('0x6')]=_0x410e8c[_0x9b33('0x3a')];}}catch(_0x3c4308){utils[_0x9b33('0x2f')](util[_0x9b33('0x2')](_0x9b33('0x3d'),_0x410e8c[_0x9b33('0x4')]),_0x3c4308);}};exports[_0x9b33('0x3e')]=function(_0x2293df){try{if(!_['isNil'](queues[_0x2293df[_0x9b33('0x4')]])){if(queues[_0x2293df[_0x9b33('0x4')]]['queuecallerleaveAt']){utils[_0x9b33('0x11')](util['format']('[%s][queues][agentcomplete]',_0x2293df[_0x9b33('0x4')]),_0x2293df);queues[_0x2293df['uniqueid']][_0x9b33('0x2b')]=![];queues[_0x2293df['uniqueid']]['queuecallerabandon']=![];queues[_0x2293df['uniqueid']][_0x9b33('0x2c')]=null;queues[_0x2293df[_0x9b33('0x4')]][_0x9b33('0x26')]=![];queues[_0x2293df['uniqueid']][_0x9b33('0x27')]=null;queues[_0x2293df['uniqueid']]['assigned']=!![];queues[_0x2293df['uniqueid']][_0x9b33('0x6')]=_0x2293df[_0x9b33('0x3a')];queues[_0x2293df[_0x9b33('0x4')]]['queuecallercomplete']=!![];queues[_0x2293df[_0x9b33('0x4')]]['queuecallercompleteAt']=utils['now']();if(_0x2293df[_0x9b33('0x3f')]==_0x9b33('0x40')){if(!queues[_0x2293df['uniqueid']][_0x9b33('0x40')]){queues[_0x2293df[_0x9b33('0x4')]][_0x9b33('0x9')]='TRANSFER';}}else{queues[_0x2293df[_0x9b33('0x4')]][_0x9b33('0x9')]=_0x9b33('0x41')+_0x2293df['reason'][_0x9b33('0x28')]();}utils[_0x9b33('0x13')](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x2293df[_0x9b33('0x4')],queues[_0x2293df[_0x9b33('0x4')]][_0x9b33('0x1f')],_0x2293df[_0x9b33('0x3a')],queues[_0x2293df['uniqueid']][_0x9b33('0x9')]));writeDB(queues[_0x2293df[_0x9b33('0x4')]]);}}}catch(_0x4f0b94){utils[_0x9b33('0x2f')](util[_0x9b33('0x2')](_0x9b33('0x42'),_0x2293df['uniqueid']),_0x4f0b94);}};exports[_0x9b33('0x43')]=function(_0x124ab5){try{if(!_[_0x9b33('0x19')](queues[_0x124ab5[_0x9b33('0x44')]])){utils['debug'](util[_0x9b33('0x2')](_0x9b33('0x45'),_0x124ab5[_0x9b33('0x4')]),_0x124ab5);queues[_0x124ab5['transfereeuniqueid']]['transfer']=!![];queues[_0x124ab5[_0x9b33('0x44')]][_0x9b33('0x46')]=_0x9b33('0x47');queues[_0x124ab5['transfereeuniqueid']]['transferexten']=_0x124ab5[_0x9b33('0x48')];queues[_0x124ab5[_0x9b33('0x44')]]['transferuniqueid']=_0x124ab5[_0x9b33('0x44')];queues[_0x124ab5[_0x9b33('0x44')]][_0x9b33('0x9')]=_0x9b33('0x49');utils[_0x9b33('0x13')](util[_0x9b33('0x2')](_0x9b33('0x4a'),_0x124ab5['uniqueid'],queues[_0x124ab5[_0x9b33('0x44')]][_0x9b33('0x1f')],_0x124ab5[_0x9b33('0x44')],_0x124ab5[_0x9b33('0x48')]));}}catch(_0x32cf42){utils[_0x9b33('0x2f')](util[_0x9b33('0x2')]('[%s][queues][blindtransfer]',_0x124ab5[_0x9b33('0x4')]),_0x32cf42);}};exports[_0x9b33('0x4b')]=function(_0x568bab){try{utils[_0x9b33('0x11')](util[_0x9b33('0x2')](_0x9b33('0x4c'),_0x568bab['origtransfereruniqueid']),_0x568bab);if(_0x568bab[_0x9b33('0x4d')]==_0x568bab[_0x9b33('0x4e')]){if(!_[_0x9b33('0x19')](queues[_0x568bab[_0x9b33('0x4f')]])){utils[_0x9b33('0x13')](util[_0x9b33('0x2')](_0x9b33('0x50'),_0x568bab[_0x9b33('0x4d')],queues[_0x568bab['secondtransfererlinkedid']]['name'],_0x568bab[_0x9b33('0x51')]));queues[_0x568bab['secondtransfererlinkedid']]['transfer']=!![];queues[_0x568bab[_0x9b33('0x4f')]]['transfertype']=_0x9b33('0x52');queues[_0x568bab[_0x9b33('0x4f')]][_0x9b33('0x53')]=_0x568bab[_0x9b33('0x51')];queues[_0x568bab[_0x9b33('0x4f')]][_0x9b33('0x54')]=_0x568bab[_0x9b33('0x4d')];queues[_0x568bab[_0x9b33('0x4f')]][_0x9b33('0x9')]=_0x9b33('0x55');}if(!_[_0x9b33('0x19')](queues[_0x568bab[_0x9b33('0x4e')]])){if(_0x568bab[_0x9b33('0x56')]&&queues[_0x568bab[_0x9b33('0x56')]]){queues[_0x568bab[_0x9b33('0x56')]][_0x9b33('0x57')]=0x1;queues[_0x568bab['transfereeuniqueid']]=_['clone'](queues[_0x568bab['transfereelinkedid']]);queues[_0x568bab['transfereeuniqueid']][_0x9b33('0xf')]=_0x568bab[_0x9b33('0x58')];queues[_0x568bab[_0x9b33('0x44')]][_0x9b33('0x57')]=0x2;queues[_0x568bab[_0x9b33('0x44')]][_0x9b33('0x7')]=queues[_0x568bab[_0x9b33('0x4f')]]['calleridnum'];queues[_0x568bab[_0x9b33('0x44')]][_0x9b33('0x59')]=queues[_0x568bab[_0x9b33('0x4f')]][_0x9b33('0x59')];queues[_0x568bab[_0x9b33('0x44')]][_0x9b33('0x37')]=utils[_0x9b33('0x17')]();queues[_0x568bab['transfereeuniqueid']][_0x9b33('0x34')]=utils['now']();queues[_0x568bab[_0x9b33('0x44')]][_0x9b33('0x35')]=0x0;queues[_0x568bab['transfereeuniqueid']]['mohtime']=0x0;utils[_0x9b33('0x13')](util[_0x9b33('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x568bab[_0x9b33('0x4d')],queues[_0x568bab[_0x9b33('0x44')]][_0x9b33('0x1f')],queues[_0x568bab[_0x9b33('0x44')]][_0x9b33('0x7')],queues[_0x568bab[_0x9b33('0x44')]][_0x9b33('0x59')]));}else{utils[_0x9b33('0x13')](util['format'](_0x9b33('0x5a'),_0x568bab[_0x9b33('0x4d')],queues[_0x568bab[_0x9b33('0x4e')]][_0x9b33('0x1f')],_0x568bab['secondtransfererlinkedid']));queues[_0x568bab[_0x9b33('0x4e')]][_0x9b33('0xf')]=_0x568bab['secondtransfererlinkedid'];}}}else if(_0x568bab[_0x9b33('0x5b')]==_0x568bab[_0x9b33('0x4f')]){if(!_['isNil'](queues[_0x568bab[_0x9b33('0x4e')]])){utils['info'](util['format'](_0x9b33('0x5c'),_0x568bab['origtransfereruniqueid'],queues[_0x568bab['origtransfererlinkedid']][_0x9b33('0x1f')],_0x568bab[_0x9b33('0x5b')],_0x568bab[_0x9b33('0x5d')]));queues[_0x568bab['origtransfererlinkedid']][_0x9b33('0x40')]=!![];queues[_0x568bab['origtransfererlinkedid']][_0x9b33('0x46')]='ATTENDED';queues[_0x568bab[_0x9b33('0x4e')]][_0x9b33('0x53')]=_0x568bab[_0x9b33('0x5d')];queues[_0x568bab[_0x9b33('0x4e')]]['transferuniqueid']=_0x568bab['secondtransfereruniqueid'];queues[_0x568bab['origtransfererlinkedid']][_0x9b33('0x9')]=_0x9b33('0x55');}if(!_['isNil'](queues[_0x568bab[_0x9b33('0x4f')]])){if(_0x568bab[_0x9b33('0x5e')]&&queues[_0x568bab[_0x9b33('0x5e')]]){queues[_0x568bab[_0x9b33('0x5e')]][_0x9b33('0x57')]=0x1;queues[_0x568bab['transfertargetuniqueid']]=_[_0x9b33('0x5f')](queues[_0x568bab[_0x9b33('0x5e')]]);queues[_0x568bab['transfertargetuniqueid']][_0x9b33('0xf')]=_0x568bab['transfertargetuniqueid'];queues[_0x568bab[_0x9b33('0x58')]]['queuecallerenterreason']=0x2;queues[_0x568bab[_0x9b33('0x58')]]['calleridnum']=queues[_0x568bab[_0x9b33('0x4e')]][_0x9b33('0x7')];queues[_0x568bab[_0x9b33('0x58')]][_0x9b33('0x59')]=queues[_0x568bab[_0x9b33('0x4e')]][_0x9b33('0x59')];queues[_0x568bab[_0x9b33('0x58')]]['queuecallerjoinAt']=utils[_0x9b33('0x17')]();queues[_0x568bab[_0x9b33('0x58')]]['queuecallerleaveAt']=utils['now']();queues[_0x568bab[_0x9b33('0x58')]][_0x9b33('0x35')]=0x0;queues[_0x568bab[_0x9b33('0x58')]][_0x9b33('0x60')]=0x0;utils[_0x9b33('0x13')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x568bab[_0x9b33('0x4d')],queues[_0x568bab[_0x9b33('0x58')]][_0x9b33('0x1f')],queues[_0x568bab[_0x9b33('0x58')]][_0x9b33('0xf')],queues[_0x568bab[_0x9b33('0x58')]][_0x9b33('0x7')],queues[_0x568bab[_0x9b33('0x58')]][_0x9b33('0x59')]));}else{utils[_0x9b33('0x13')](util[_0x9b33('0x2')](_0x9b33('0x5a'),_0x568bab['origtransfereruniqueid'],queues[_0x568bab[_0x9b33('0x4f')]][_0x9b33('0x1f')],_0x568bab[_0x9b33('0x4e')]));queues[_0x568bab[_0x9b33('0x4f')]][_0x9b33('0xf')]=_0x568bab[_0x9b33('0x4e')];}}}}catch(_0x8c108a){utils['error'](util[_0x9b33('0x2')](_0x9b33('0x4c'),_0x568bab[_0x9b33('0x4d')]),_0x8c108a);}};exports['musiconholdstart']=function(_0x1b5761){try{if(!_['isNil'](queues[_0x1b5761['uniqueid']])){utils[_0x9b33('0x11')](util[_0x9b33('0x2')](_0x9b33('0x61'),_0x1b5761[_0x9b33('0x4')]),_0x1b5761);queues[_0x1b5761[_0x9b33('0x4')]][_0x9b33('0x62')]=utils[_0x9b33('0x17')]();utils[_0x9b33('0x13')](util['format'](_0x9b33('0x63'),_0x1b5761['uniqueid'],queues[_0x1b5761[_0x9b33('0x4')]][_0x9b33('0x1f')],queues[_0x1b5761[_0x9b33('0x4')]][_0x9b33('0x62')]));}}catch(_0x41d237){utils['error'](util[_0x9b33('0x2')](_0x9b33('0x61'),_0x1b5761['uniqueid']),_0x41d237);}};exports[_0x9b33('0x64')]=function(_0x36d235){try{if(!_[_0x9b33('0x19')](queues[_0x36d235['uniqueid']])){if(!_['isNil'](queues[_0x36d235[_0x9b33('0x4')]][_0x9b33('0x62')])){utils[_0x9b33('0x11')](util[_0x9b33('0x2')](_0x9b33('0x65'),_0x36d235[_0x9b33('0x4')]),_0x36d235);queues[_0x36d235['uniqueid']][_0x9b33('0x60')]+=utils['diffTime'](utils[_0x9b33('0x17')](),queues[_0x36d235['uniqueid']][_0x9b33('0x62')]);utils['info'](util[_0x9b33('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x36d235['uniqueid'],queues[_0x36d235[_0x9b33('0x4')]][_0x9b33('0x1f')],queues[_0x36d235[_0x9b33('0x4')]][_0x9b33('0x60')]));delete queues[_0x36d235['uniqueid']][_0x9b33('0x62')];}}}catch(_0x565613){utils[_0x9b33('0x2f')](util[_0x9b33('0x2')](_0x9b33('0x65'),_0x36d235[_0x9b33('0x4')]),_0x565613);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index d4ee1bd..9b4c70c 100644 --- a/server/services/xdr/recordings.controller.js +++ b/server/services/xdr/recordings.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x112e=['push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','then','name','UserId','request','CreateVoiceRecording','newchannel','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','[%s][recordings][newstate]','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','find','monitors'];(function(_0x2b948f,_0x398e62){var _0x1237bc=function(_0x3c1843){while(--_0x3c1843){_0x2b948f['push'](_0x2b948f['shift']());}};_0x1237bc(++_0x398e62);}(_0x112e,0x194));var _0xe112=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x112e[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0xe112('0x0'));var util=require(_0xe112('0x1'));var utils=require(_0xe112('0x2'));var recordings={};function writeDB(_0x2a88f8){utils[_0xe112('0x3')](util[_0xe112('0x4')](_0xe112('0x5'),_0x2a88f8[_0xe112('0x6')]));if(_0x2a88f8['accountcode']){utils['getUserByInternal'](_0x2a88f8[_0xe112('0x7')])[_0xe112('0x8')](function(_0x237e35){if(_0x237e35){_0x2a88f8['membername']=_0x237e35[_0xe112('0x9')];_0x2a88f8[_0xe112('0xa')]=_0x237e35['id'];}utils[_0xe112('0xb')]('CreateVoiceRecording',_0x2a88f8);});}else{utils[_0xe112('0xb')](_0xe112('0xc'),_0x2a88f8);}}exports[_0xe112('0xd')]=function(_0x91f6b2){try{utils[_0xe112('0xe')](util[_0xe112('0x4')]('[%s][recordings][newchannel]',_0x91f6b2[_0xe112('0x6')]),_0x91f6b2);if(_0x91f6b2[_0xe112('0x6')]==_0x91f6b2[_0xe112('0xf')]){utils['info'](util[_0xe112('0x4')](_0xe112('0x10'),_0x91f6b2[_0xe112('0x6')],_0x91f6b2[_0xe112('0x11')],_0x91f6b2[_0xe112('0x12')]));recordings[_0x91f6b2['uniqueid']]={'uniqueid':_0x91f6b2[_0xe112('0x6')],'accountcode':_0x91f6b2[_0xe112('0x7')],'exten':_0x91f6b2[_0xe112('0x12')],'context':_0x91f6b2[_0xe112('0x11')],'channel':_0x91f6b2[_0xe112('0x13')],'monitors':[]};}}catch(_0x363a2c){utils['error'](util['format']('[%s][recordings][newchannel]',_0x91f6b2['uniqueid']),_0x363a2c);}};exports[_0xe112('0x14')]=function(_0x437955){try{utils['debug'](util[_0xe112('0x4')]('[%s][recordings][newstate]',_0x437955[_0xe112('0x6')]),_0x437955);if(!_[_0xe112('0x15')](recordings[_0x437955[_0xe112('0x6')]])&&_0x437955[_0xe112('0x16')]==0x6){utils[_0xe112('0x3')](util[_0xe112('0x4')](_0xe112('0x17'),_0x437955[_0xe112('0x6')],_0x437955[_0xe112('0x11')],_0x437955['channel']));}else if(!_['isNil'](recordings[_0x437955[_0xe112('0xf')]])&&_0x437955[_0xe112('0x16')]==0x6&&_0x437955['context']!=_0xe112('0x18')){utils[_0xe112('0x3')](util[_0xe112('0x4')](_0xe112('0x19'),_0x437955[_0xe112('0x6')],_0x437955[_0xe112('0xf')],_0x437955[_0xe112('0x11')],_0x437955[_0xe112('0x13')]));recordings[_0x437955['linkedid']]['accountcode']=_0x437955[_0xe112('0x7')];}}catch(_0x15c894){utils[_0xe112('0x1a')](util[_0xe112('0x4')](_0xe112('0x1b'),_0x437955[_0xe112('0x6')]),_0x15c894);}};exports['varset']=function(_0x26447c){try{if(!_[_0xe112('0x15')](_0x26447c[_0xe112('0x1c')])&&!_['isNil'](_0x26447c[_0xe112('0x1c')][_0xe112('0x1d')])){utils[_0xe112('0xe')](util[_0xe112('0x4')]('[%s][recordings][varset]',_0x26447c[_0xe112('0x6')]),_0x26447c);utils['info'](util[_0xe112('0x4')](_0xe112('0x1e'),_0x26447c[_0xe112('0x6')],_0x26447c[_0xe112('0x1c')],_0x26447c[_0xe112('0x1f')]));if(_[_0xe112('0x20')](_0x26447c['value'],'.wav49')){_0x26447c['value']=_0x26447c['value'][_0xe112('0x21')](_0xe112('0x22'),'.WAV');}if(recordings[_0x26447c['linkedid']]){var _0xac3589=_[_0xe112('0x23')](recordings[_0x26447c[_0xe112('0xf')]][_0xe112('0x24')],{'value':_0x26447c['value']});if(_[_0xe112('0x15')](_0xac3589)){recordings[_0x26447c['linkedid']]['monitors'][_0xe112('0x25')]({'value':_0x26447c[_0xe112('0x1f')]});}}}}catch(_0x1b70fe){utils[_0xe112('0x1a')](util['format'](_0xe112('0x26'),_0x26447c[_0xe112('0x6')]),_0x1b70fe);}};exports[_0xe112('0x27')]=function(_0x24e140){try{if(!_[_0xe112('0x15')](recordings[_0x24e140['uniqueid']])){utils[_0xe112('0xe')](util[_0xe112('0x4')](_0xe112('0x28'),_0x24e140[_0xe112('0x6')]),_0x24e140);utils[_0xe112('0x3')](util[_0xe112('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x24e140['uniqueid'],_0x24e140['calleridnum'],_0x24e140[_0xe112('0x29')],_0x24e140[_0xe112('0x2a')]));recordings[_0x24e140[_0xe112('0x6')]][_0xe112('0x2b')]=_0x24e140[_0xe112('0x2b')];recordings[_0x24e140['uniqueid']][_0xe112('0x29')]=_0x24e140['calleridname'];recordings[_0x24e140[_0xe112('0x6')]][_0xe112('0x2c')]=_0x24e140[_0xe112('0x2c')];recordings[_0x24e140[_0xe112('0x6')]]['connectedlinename']=_0x24e140[_0xe112('0x2d')];if(recordings[_0x24e140[_0xe112('0x6')]][_0xe112('0x2e')]==_0xe112('0x2f')&&recordings[_0x24e140[_0xe112('0x6')]]['accountcode']){recordings[_0x24e140['uniqueid']][_0xe112('0x2c')]=recordings[_0x24e140[_0xe112('0x6')]][_0xe112('0x7')];recordings[_0x24e140[_0xe112('0x6')]][_0xe112('0x2d')]='';}recordings[_0x24e140['uniqueid']][_0xe112('0x24')][_0xe112('0x30')](function(_0x3f7d97){var _0x47f96c=_[_0xe112('0x31')](recordings[_0x24e140[_0xe112('0x6')]]);_0x47f96c[_0xe112('0x1f')]=_0x3f7d97[_0xe112('0x1f')];writeDB(_0x47f96c);});delete recordings[_0x24e140[_0xe112('0x6')]];}}catch(_0x87559d){utils[_0xe112('0x1a')](util[_0xe112('0x4')]('[%s][recordings][hangup]',_0x24e140[_0xe112('0x6')]),_0x87559d);}};exports['newexten']=function(_0x350bd4){try{if(!_[_0xe112('0x15')](recordings[_0x350bd4['uniqueid']])){utils[_0xe112('0xe')](util[_0xe112('0x4')]('[%s][recordings][newexten]',_0x350bd4[_0xe112('0x6')]),_0x350bd4);utils[_0xe112('0x3')](util[_0xe112('0x4')](_0xe112('0x32'),_0x350bd4[_0xe112('0x6')],_0x350bd4[_0xe112('0x33')],_0x350bd4[_0xe112('0x34')]));if(_0x350bd4[_0xe112('0x33')][_0xe112('0x35')]()==_0xe112('0x36')&&_[_0xe112('0x37')](_0x350bd4[_0xe112('0x34')][_0xe112('0x35')](),_0xe112('0x38'))){var _0x374dfe=_0x350bd4['appdata']['split']('=');var _0x2581fb=_0x374dfe[0x0]['substring'](_0x374dfe[0x0]['lastIndexOf']('(')+0x1,_0x374dfe[0x0][_0xe112('0x39')](')'));var _0x4c595d=_0x374dfe[0x1];recordings[_0x350bd4[_0xe112('0x6')]][_0x2581fb]=_0x4c595d;}}}catch(_0x22e27b){utils[_0xe112('0x1a')](util[_0xe112('0x4')](_0xe112('0x3a'),_0x350bd4[_0xe112('0x6')]),_0x22e27b);}};exports[_0xe112('0x3b')]=function(_0x3084f6){try{if(!_[_0xe112('0x15')](recordings[_0x3084f6[_0xe112('0x6')]])){utils['debug'](util['format'](_0xe112('0x3c'),_0x3084f6['uniqueid']),_0x3084f6);utils[_0xe112('0x3')](util['format'](_0xe112('0x3d'),_0x3084f6[_0xe112('0x6')],_0x3084f6[_0xe112('0x3e')]));recordings[_0x3084f6[_0xe112('0x6')]][_0xe112('0x3e')]=_0x3084f6['queue'];}}catch(_0x173cc5){utils[_0xe112('0x1a')](util[_0xe112('0x4')](_0xe112('0x3c'),_0x3084f6[_0xe112('0x6')]),_0x173cc5);}}; \ No newline at end of file +var _0x3c44=['[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','lodash','util','./utils','info','[%s][recordings][writeDB]','uniqueid','accountcode','then','membername','name','request','CreateVoiceRecording','newchannel','debug','linkedid','format','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','[%s][recordings][newchannel]','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','.WAV','find','monitors','push','hangup'];(function(_0xaf99c9,_0x36e1fc){var _0x23879d=function(_0x30cf03){while(--_0x30cf03){_0xaf99c9['push'](_0xaf99c9['shift']());}};_0x23879d(++_0x36e1fc);}(_0x3c44,0x12a));var _0x43c4=function(_0xcfd65a,_0xbc65c8){_0xcfd65a=_0xcfd65a-0x0;var _0x58370b=_0x3c44[_0xcfd65a];return _0x58370b;};'use strict';var _=require(_0x43c4('0x0'));var util=require(_0x43c4('0x1'));var utils=require(_0x43c4('0x2'));var recordings={};function writeDB(_0x379c9c){utils[_0x43c4('0x3')](util['format'](_0x43c4('0x4'),_0x379c9c[_0x43c4('0x5')]));if(_0x379c9c['accountcode']){utils['getUserByInternal'](_0x379c9c[_0x43c4('0x6')])[_0x43c4('0x7')](function(_0x5e2d29){if(_0x5e2d29){_0x379c9c[_0x43c4('0x8')]=_0x5e2d29[_0x43c4('0x9')];_0x379c9c['UserId']=_0x5e2d29['id'];}utils[_0x43c4('0xa')](_0x43c4('0xb'),_0x379c9c);});}else{utils[_0x43c4('0xa')](_0x43c4('0xb'),_0x379c9c);}}exports[_0x43c4('0xc')]=function(_0x337f24){try{utils[_0x43c4('0xd')](util['format']('[%s][recordings][newchannel]',_0x337f24[_0x43c4('0x5')]),_0x337f24);if(_0x337f24['uniqueid']==_0x337f24[_0x43c4('0xe')]){utils[_0x43c4('0x3')](util[_0x43c4('0xf')](_0x43c4('0x10'),_0x337f24[_0x43c4('0x5')],_0x337f24['context'],_0x337f24['exten']));recordings[_0x337f24[_0x43c4('0x5')]]={'uniqueid':_0x337f24['uniqueid'],'accountcode':_0x337f24['accountcode'],'exten':_0x337f24[_0x43c4('0x11')],'context':_0x337f24[_0x43c4('0x12')],'channel':_0x337f24[_0x43c4('0x13')],'monitors':[]};}}catch(_0x1972c9){utils[_0x43c4('0x14')](util['format'](_0x43c4('0x15'),_0x337f24[_0x43c4('0x5')]),_0x1972c9);}};exports[_0x43c4('0x16')]=function(_0x537a77){try{utils[_0x43c4('0xd')](util[_0x43c4('0xf')](_0x43c4('0x17'),_0x537a77[_0x43c4('0x5')]),_0x537a77);if(!_[_0x43c4('0x18')](recordings[_0x537a77[_0x43c4('0x5')]])&&_0x537a77[_0x43c4('0x19')]==0x6){utils[_0x43c4('0x3')](util[_0x43c4('0xf')](_0x43c4('0x1a'),_0x537a77[_0x43c4('0x5')],_0x537a77[_0x43c4('0x12')],_0x537a77['channel']));}else if(!_[_0x43c4('0x18')](recordings[_0x537a77[_0x43c4('0xe')]])&&_0x537a77['channelstate']==0x6&&_0x537a77[_0x43c4('0x12')]!=_0x43c4('0x1b')){utils[_0x43c4('0x3')](util[_0x43c4('0xf')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x537a77[_0x43c4('0x5')],_0x537a77['linkedid'],_0x537a77['context'],_0x537a77[_0x43c4('0x13')]));recordings[_0x537a77['linkedid']]['accountcode']=_0x537a77[_0x43c4('0x6')];}}catch(_0x17baf4){utils[_0x43c4('0x14')](util[_0x43c4('0xf')](_0x43c4('0x17'),_0x537a77[_0x43c4('0x5')]),_0x17baf4);}};exports[_0x43c4('0x1c')]=function(_0x1c40b4){try{if(!_['isNil'](_0x1c40b4['variable'])&&!_[_0x43c4('0x18')](_0x1c40b4[_0x43c4('0x1d')][_0x43c4('0x1e')])){utils[_0x43c4('0xd')](util[_0x43c4('0xf')](_0x43c4('0x1f'),_0x1c40b4[_0x43c4('0x5')]),_0x1c40b4);utils[_0x43c4('0x3')](util['format'](_0x43c4('0x20'),_0x1c40b4[_0x43c4('0x5')],_0x1c40b4[_0x43c4('0x1d')],_0x1c40b4[_0x43c4('0x21')]));if(_[_0x43c4('0x22')](_0x1c40b4[_0x43c4('0x21')],'.wav49')){_0x1c40b4['value']=_0x1c40b4[_0x43c4('0x21')][_0x43c4('0x23')](_0x43c4('0x24'),_0x43c4('0x25'));}if(recordings[_0x1c40b4['linkedid']]){var _0x316303=_[_0x43c4('0x26')](recordings[_0x1c40b4[_0x43c4('0xe')]][_0x43c4('0x27')],{'value':_0x1c40b4[_0x43c4('0x21')]});if(_[_0x43c4('0x18')](_0x316303)){recordings[_0x1c40b4['linkedid']][_0x43c4('0x27')][_0x43c4('0x28')]({'value':_0x1c40b4[_0x43c4('0x21')]});}}}}catch(_0x34a6bb){utils[_0x43c4('0x14')](util['format'](_0x43c4('0x1f'),_0x1c40b4['uniqueid']),_0x34a6bb);}};exports[_0x43c4('0x29')]=function(_0x28f9bd){try{if(!_[_0x43c4('0x18')](recordings[_0x28f9bd[_0x43c4('0x5')]])){utils['debug'](util[_0x43c4('0xf')](_0x43c4('0x2a'),_0x28f9bd[_0x43c4('0x5')]),_0x28f9bd);utils[_0x43c4('0x3')](util[_0x43c4('0xf')](_0x43c4('0x2b'),_0x28f9bd['uniqueid'],_0x28f9bd[_0x43c4('0x2c')],_0x28f9bd['calleridname'],_0x28f9bd[_0x43c4('0x2d')]));recordings[_0x28f9bd[_0x43c4('0x5')]][_0x43c4('0x2c')]=_0x28f9bd['calleridnum'];recordings[_0x28f9bd[_0x43c4('0x5')]][_0x43c4('0x2e')]=_0x28f9bd[_0x43c4('0x2e')];recordings[_0x28f9bd[_0x43c4('0x5')]][_0x43c4('0x2f')]=_0x28f9bd['connectedlinenum'];recordings[_0x28f9bd['uniqueid']][_0x43c4('0x30')]=_0x28f9bd[_0x43c4('0x30')];if(recordings[_0x28f9bd['uniqueid']][_0x43c4('0x31')]==_0x43c4('0x32')&&recordings[_0x28f9bd[_0x43c4('0x5')]][_0x43c4('0x6')]){recordings[_0x28f9bd[_0x43c4('0x5')]][_0x43c4('0x2f')]=recordings[_0x28f9bd[_0x43c4('0x5')]][_0x43c4('0x6')];recordings[_0x28f9bd['uniqueid']][_0x43c4('0x30')]='';}recordings[_0x28f9bd[_0x43c4('0x5')]][_0x43c4('0x27')]['forEach'](function(_0x11b23f){var _0x1e0420=_[_0x43c4('0x33')](recordings[_0x28f9bd[_0x43c4('0x5')]]);_0x1e0420[_0x43c4('0x21')]=_0x11b23f[_0x43c4('0x21')];writeDB(_0x1e0420);});delete recordings[_0x28f9bd['uniqueid']];}}catch(_0x5782f5){utils[_0x43c4('0x14')](util['format'](_0x43c4('0x2a'),_0x28f9bd[_0x43c4('0x5')]),_0x5782f5);}};exports[_0x43c4('0x34')]=function(_0x1c2283){try{if(!_['isNil'](recordings[_0x1c2283[_0x43c4('0x5')]])){utils[_0x43c4('0xd')](util[_0x43c4('0xf')](_0x43c4('0x35'),_0x1c2283['uniqueid']),_0x1c2283);utils['info'](util[_0x43c4('0xf')](_0x43c4('0x36'),_0x1c2283[_0x43c4('0x5')],_0x1c2283['application'],_0x1c2283[_0x43c4('0x37')]));if(_0x1c2283[_0x43c4('0x38')][_0x43c4('0x39')]()==_0x43c4('0x3a')&&_[_0x43c4('0x3b')](_0x1c2283[_0x43c4('0x37')][_0x43c4('0x39')](),_0x43c4('0x3c'))){var _0xdecb50=_0x1c2283[_0x43c4('0x37')][_0x43c4('0x3d')]('=');var _0x334ed2=_0xdecb50[0x0][_0x43c4('0x3e')](_0xdecb50[0x0]['lastIndexOf']('(')+0x1,_0xdecb50[0x0][_0x43c4('0x3f')](')'));var _0x17fcc6=_0xdecb50[0x1];recordings[_0x1c2283[_0x43c4('0x5')]][_0x334ed2]=_0x17fcc6;}}}catch(_0x38b4ba){utils[_0x43c4('0x14')](util[_0x43c4('0xf')]('[%s][recordings][newexten]',_0x1c2283[_0x43c4('0x5')]),_0x38b4ba);}};exports[_0x43c4('0x40')]=function(_0x576874){try{if(!_[_0x43c4('0x18')](recordings[_0x576874[_0x43c4('0x5')]])){utils[_0x43c4('0xd')](util[_0x43c4('0xf')]('[%s][recordings][queuecallerjoin]',_0x576874['uniqueid']),_0x576874);utils['info'](util[_0x43c4('0xf')](_0x43c4('0x41'),_0x576874['uniqueid'],_0x576874['queue']));recordings[_0x576874[_0x43c4('0x5')]]['queue']=_0x576874[_0x43c4('0x42')];}}catch(_0x1f704f){utils[_0x43c4('0x14')](util['format'](_0x43c4('0x43'),_0x576874['uniqueid']),_0x1f704f);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 8e7aaaf..07e29fa 100644 --- a/server/services/xdr/transfers.controller.js +++ b/server/services/xdr/transfers.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed65=['transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfereecalleridnum','transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode'];(function(_0x38d6f0,_0x5ef3f5){var _0x420dcf=function(_0x1b52d4){while(--_0x1b52d4){_0x38d6f0['push'](_0x38d6f0['shift']());}};_0x420dcf(++_0x5ef3f5);}(_0xed65,0xd6));var _0x5ed6=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0xed65[_0x31b5b2];return _0x364f13;};'use strict';var _=require('lodash');var util=require(_0x5ed6('0x0'));var utils=require(_0x5ed6('0x1'));function writeDB(_0x3ec3a2){utils[_0x5ed6('0x2')](util[_0x5ed6('0x3')](_0x5ed6('0x4'),_0x3ec3a2[_0x5ed6('0x5')]===_0x5ed6('0x6')?_0x3ec3a2[_0x5ed6('0x7')]:_0x3ec3a2[_0x5ed6('0x8')],_0x3ec3a2[_0x5ed6('0x5')]));utils[_0x5ed6('0x9')](_0x5ed6('0xa'),_0x3ec3a2);}exports[_0x5ed6('0xb')]=function(_0x174cba){try{utils[_0x5ed6('0xc')](util['format'](_0x5ed6('0xd'),_0x174cba['uniqueid']),_0x174cba);utils[_0x5ed6('0x2')](util[_0x5ed6('0x3')](_0x5ed6('0xe'),_0x174cba[_0x5ed6('0x8')],_0x174cba['transferercalleridnum'],_0x174cba['transferercalleridname'],_0x174cba[_0x5ed6('0xf')],_0x174cba[_0x5ed6('0x10')]));_0x174cba['type']=_0x5ed6('0x11');writeDB(_0x174cba);}catch(_0x42e5ea){utils[_0x5ed6('0x12')](util[_0x5ed6('0x3')](_0x5ed6('0xd'),_0x174cba[_0x5ed6('0x8')]),_0x42e5ea);}};exports[_0x5ed6('0x13')]=function(_0x18afbc){try{utils[_0x5ed6('0xc')](util[_0x5ed6('0x3')]('[%s][transfers][attendedtransfer]',_0x18afbc[_0x5ed6('0x7')]),_0x18afbc);utils[_0x5ed6('0x2')](util[_0x5ed6('0x3')](_0x5ed6('0x14'),_0x18afbc['origtransfereruniqueid'],_0x18afbc[_0x5ed6('0x15')],_0x18afbc[_0x5ed6('0x16')],_0x18afbc[_0x5ed6('0x17')],_0x18afbc['transfertargetcalleridname']));_0x18afbc=_[_0x5ed6('0x18')](_0x18afbc,{'transfererchannel':_0x18afbc['origtransfererchannel'],'transferercalleridnum':_0x18afbc[_0x5ed6('0x15')],'transferercalleridname':_0x18afbc['origtransferercalleridname'],'transfererconnectedlinenum':_0x18afbc['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x18afbc[_0x5ed6('0x19')],'transfereraccountcode':_0x18afbc[_0x5ed6('0x1a')],'transferercontext':_0x18afbc[_0x5ed6('0x1b')],'transfererexten':_0x18afbc[_0x5ed6('0x1c')],'transfererlinkedid':_0x18afbc[_0x5ed6('0x1d')],'context':_0x18afbc[_0x5ed6('0x1e')],'extension':_0x18afbc[_0x5ed6('0x1f')],'type':_0x5ed6('0x6')});if(_[_0x5ed6('0x20')](_0x18afbc[_0x5ed6('0x21')])){_0x18afbc=_[_0x5ed6('0x18')](_0x18afbc,{'transfereechannel':_0x18afbc[_0x5ed6('0x22')],'transfereecalleridnum':_0x18afbc['transfertargetcalleridnum'],'transfereecalleridname':_0x18afbc[_0x5ed6('0x23')],'transfereeconnectedlinenum':_0x18afbc[_0x5ed6('0x24')],'transfereeconnectedlinename':_0x18afbc['transfertargetconnectedlinename'],'transfereeaccountcode':_0x18afbc[_0x5ed6('0x25')],'transfereecontext':_0x18afbc[_0x5ed6('0x26')],'transfereeexten':_0x18afbc[_0x5ed6('0x27')],'transfereelinkedid':_0x18afbc[_0x5ed6('0x28')]});}writeDB(_0x18afbc);}catch(_0x40ad0b){utils[_0x5ed6('0x12')](util[_0x5ed6('0x3')](_0x5ed6('0x29'),_0x18afbc[_0x5ed6('0x7')]),_0x40ad0b);}}; \ No newline at end of file +var _0x41ef=['secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','./utils','info','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode'];(function(_0x2419a6,_0x13b170){var _0x41590f=function(_0x25780f){while(--_0x25780f){_0x2419a6['push'](_0x2419a6['shift']());}};_0x41590f(++_0x13b170);}(_0x41ef,0x6a));var _0xf41e=function(_0x1b15b4,_0x4b5d7c){_0x1b15b4=_0x1b15b4-0x0;var _0x10d385=_0x41ef[_0x1b15b4];return _0x10d385;};'use strict';var _=require('lodash');var util=require(_0xf41e('0x0'));var utils=require(_0xf41e('0x1'));function writeDB(_0x14e2b7){utils[_0xf41e('0x2')](util['format'](_0xf41e('0x3'),_0x14e2b7[_0xf41e('0x4')]===_0xf41e('0x5')?_0x14e2b7[_0xf41e('0x6')]:_0x14e2b7[_0xf41e('0x7')],_0x14e2b7[_0xf41e('0x4')]));utils[_0xf41e('0x8')](_0xf41e('0x9'),_0x14e2b7);}exports[_0xf41e('0xa')]=function(_0x4927d4){try{utils[_0xf41e('0xb')](util[_0xf41e('0xc')](_0xf41e('0xd'),_0x4927d4[_0xf41e('0x7')]),_0x4927d4);utils[_0xf41e('0x2')](util[_0xf41e('0xc')](_0xf41e('0xe'),_0x4927d4[_0xf41e('0x7')],_0x4927d4[_0xf41e('0xf')],_0x4927d4[_0xf41e('0x10')],_0x4927d4[_0xf41e('0x11')],_0x4927d4[_0xf41e('0x12')]));_0x4927d4['type']=_0xf41e('0x13');writeDB(_0x4927d4);}catch(_0x4ef667){utils[_0xf41e('0x14')](util[_0xf41e('0xc')]('[%s][transfers][blindtransfer]',_0x4927d4[_0xf41e('0x7')]),_0x4ef667);}};exports[_0xf41e('0x15')]=function(_0x57b246){try{utils['debug'](util[_0xf41e('0xc')](_0xf41e('0x16'),_0x57b246[_0xf41e('0x6')]),_0x57b246);utils['info'](util['format'](_0xf41e('0x17'),_0x57b246['origtransfereruniqueid'],_0x57b246[_0xf41e('0x18')],_0x57b246[_0xf41e('0x19')],_0x57b246[_0xf41e('0x1a')],_0x57b246['transfertargetcalleridname']));_0x57b246=_[_0xf41e('0x1b')](_0x57b246,{'transfererchannel':_0x57b246[_0xf41e('0x1c')],'transferercalleridnum':_0x57b246[_0xf41e('0x18')],'transferercalleridname':_0x57b246[_0xf41e('0x19')],'transfererconnectedlinenum':_0x57b246[_0xf41e('0x1d')],'transfererconnectedlinename':_0x57b246[_0xf41e('0x1e')],'transfereraccountcode':_0x57b246[_0xf41e('0x1f')],'transferercontext':_0x57b246[_0xf41e('0x20')],'transfererexten':_0x57b246[_0xf41e('0x21')],'transfererlinkedid':_0x57b246[_0xf41e('0x22')],'context':_0x57b246[_0xf41e('0x23')],'extension':_0x57b246[_0xf41e('0x24')],'type':'attended'});if(_[_0xf41e('0x25')](_0x57b246[_0xf41e('0x26')])){_0x57b246=_[_0xf41e('0x1b')](_0x57b246,{'transfereechannel':_0x57b246['transfertargetchannel'],'transfereecalleridnum':_0x57b246[_0xf41e('0x1a')],'transfereecalleridname':_0x57b246[_0xf41e('0x27')],'transfereeconnectedlinenum':_0x57b246[_0xf41e('0x28')],'transfereeconnectedlinename':_0x57b246[_0xf41e('0x29')],'transfereeaccountcode':_0x57b246[_0xf41e('0x2a')],'transfereecontext':_0x57b246[_0xf41e('0x2b')],'transfereeexten':_0x57b246[_0xf41e('0x2c')],'transfereelinkedid':_0x57b246[_0xf41e('0x2d')]});}writeDB(_0x57b246);}catch(_0x3b903c){utils[_0xf41e('0x14')](util[_0xf41e('0xc')](_0xf41e('0x16'),_0x57b246['origtransfereruniqueid']),_0x3b903c);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 18643cb..da630f6 100644 --- a/server/services/xdr/utils.js +++ b/server/services/xdr/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7527=['type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','format','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue'];(function(_0x3ab0ac,_0x1ea9cf){var _0x1f743d=function(_0x45fb92){while(--_0x45fb92){_0x3ab0ac['push'](_0x3ab0ac['shift']());}};_0x1f743d(++_0x1ea9cf);}(_0x7527,0x1a9));var _0x7752=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7527[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x7752('0x0'));var moment=require(_0x7752('0x1'));var util=require(_0x7752('0x2'));var client=jayson[_0x7752('0x3')][_0x7752('0x4')]({'port':0x2329});var logger=require(_0x7752('0x5'))(_0x7752('0x6'));exports[_0x7752('0x7')]=function(_0x1b0fca,_0xd9fe55){logger['info'](_0x1b0fca,_0xd9fe55?util[_0x7752('0x8')](_0xd9fe55,{'showHidden':![],'depth':null}):'');};exports[_0x7752('0x9')]=function(_0x4af8e8,_0xdec6ea){logger[_0x7752('0x9')](_0x4af8e8,_0xdec6ea?util[_0x7752('0x8')](_0xdec6ea,{'showHidden':![],'depth':null}):'');};exports[_0x7752('0xa')]=function(_0x3dd1b7,_0x50557f){logger[_0x7752('0xa')](_0x3dd1b7,_0x50557f?util[_0x7752('0x8')](_0x50557f,{'showHidden':![],'depth':null}):'');};exports[_0x7752('0xb')]=function(_0x128a4c,_0x17bc06){return client['request'](_0x128a4c,{'body':_0x17bc06})[_0x7752('0xc')](function(_0x165977){logger[_0x7752('0x9')]('[utils][request]\x20name:%s',_0x128a4c,_0x165977?util['inspect'](_0x165977,{'showHidden':![],'depth':null}):'');})[_0x7752('0xd')](function(_0x4d38f0){logger[_0x7752('0xa')](_0x7752('0xe'),_0x128a4c,_0x4d38f0?util[_0x7752('0x8')](_0x4d38f0,{'showHidden':![],'depth':null}):'');});};function getUser(_0x43f3cb){return client[_0x7752('0xb')](_0x7752('0xf'),{'options':{'raw':!![],'attributes':['id',_0x7752('0x10'),_0x7752('0x11'),_0x7752('0x12')],'where':_0x43f3cb,'limit':0x1}})[_0x7752('0xc')](function(_0x263cb3){logger[_0x7752('0x9')](_0x7752('0x13'),JSON[_0x7752('0x14')](_0x43f3cb),_0x263cb3?util[_0x7752('0x8')](_0x263cb3,{'showHidden':![],'depth':null}):'');return _0x263cb3[_0x7752('0x15')][_0x7752('0x16')]?_0x263cb3[_0x7752('0x15')][0x0]:null;});}exports[_0x7752('0x17')]=function(_0xfe8b4){return new BPromise(function(_0x7e2e55,_0x203c0b){if(_0xfe8b4){return getUser({'internal':_0xfe8b4})[_0x7752('0xc')](function(_0x33c46c){logger[_0x7752('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0xfe8b4,_0x33c46c?_0x7752('0x18'):_0x7752('0x19'));return _0x7e2e55(_0x33c46c);})[_0x7752('0xd')](function(_0x456cbb){logger[_0x7752('0xa')](_0x7752('0x1a'),_0x456cbb?util[_0x7752('0x8')](_0x456cbb,{'showHidden':![],'depth':null}):'');return _0x7e2e55(null);});}return _0x7e2e55(null);});};exports[_0x7752('0x1b')]=function(_0x24fccc){return new BPromise(function(_0x1c6917,_0x41f15f){if(_0x24fccc){return getUser({'interface':_0x24fccc})[_0x7752('0xc')](function(_0x2a9345){logger[_0x7752('0x7')](_0x7752('0x1c'),_0x24fccc,_0x2a9345?_0x7752('0x18'):'notfound');return _0x1c6917(_0x2a9345);})[_0x7752('0xd')](function(_0x3c44af){logger[_0x7752('0xa')](_0x7752('0x1d'),_0x3c44af?util[_0x7752('0x8')](_0x3c44af,{'showHidden':![],'depth':null}):'');return _0x1c6917(null);});}return _0x1c6917(null);});};exports['getUserByName']=function(_0x5e0717){return new BPromise(function(_0x547d18,_0x3f7c18){if(_0x5e0717){return getUser({'name':_0x5e0717})[_0x7752('0xc')](function(_0x296735){logger[_0x7752('0x7')](_0x7752('0x1e'),_0x5e0717,_0x296735?_0x7752('0x18'):_0x7752('0x19'));return _0x547d18(_0x296735);})['catch'](function(_0x218d7d){logger[_0x7752('0xa')](_0x7752('0x1f'),_0x218d7d?util[_0x7752('0x8')](_0x218d7d,{'showHidden':![],'depth':null}):'');return _0x547d18(null);});}return _0x547d18(null);});};exports[_0x7752('0x20')]=function(_0x2f467c){return new BPromise(function(_0x5bc029,_0x12350d){if(_0x2f467c){return client[_0x7752('0xb')](_0x7752('0x21'),{'options':{'raw':!![],'attributes':['id',_0x7752('0x11'),_0x7752('0x22'),_0x7752('0x23'),_0x7752('0x24')],'where':{'name':_0x2f467c},'limit':0x1}})['then'](function(_0x51a1c1){logger[_0x7752('0x9')](_0x7752('0x25'),_0x2f467c,_0x51a1c1?util['inspect'](_0x51a1c1,{'showHidden':![],'depth':null}):'');logger[_0x7752('0x7')](_0x7752('0x26'),_0x2f467c,_0x51a1c1?_0x7752('0x18'):_0x7752('0x19'));return _0x5bc029(_0x51a1c1['result']['length']?_0x51a1c1['result'][0x0]:null);})[_0x7752('0xd')](function(_0x24ae34){logger[_0x7752('0xa')](_0x7752('0x27'),_0x24ae34?util[_0x7752('0x8')](_0x24ae34,{'showHidden':![],'depth':null}):'');return _0x5bc029(null);});}return _0x5bc029(null);});};exports[_0x7752('0x28')]=function(_0x6d22f0,_0x400079){return moment(_0x6d22f0)['add'](_0x400079,_0x7752('0x29'))['format'](_0x7752('0x2a'));};exports[_0x7752('0x2b')]=function(_0x203953,_0x249a96){return moment(_0x203953)['subtract'](_0x249a96,_0x7752('0x29'))[_0x7752('0x2c')](_0x7752('0x2a'));};exports[_0x7752('0x2d')]=function(_0x599f0,_0x4a16f1){return moment(_0x599f0)[_0x7752('0x2e')](moment(_0x4a16f1),_0x7752('0x29'));};exports[_0x7752('0x2f')]=function(_0x427a33,_0x2bccc6){return parseInt(_0x427a33,0xa)+parseInt(_0x2bccc6,0xa);};exports[_0x7752('0x30')]=function(){return moment()[_0x7752('0x2c')](_0x7752('0x2a'));};exports[_0x7752('0x31')]=function(_0x1cd15a,_0x4258ed){if(_0x4258ed){return moment(_0x1cd15a)[_0x7752('0x31')](_0x4258ed);}return!![];};exports['isBefore']=function(_0x96eeb5,_0x402b41){if(_0x402b41){return moment(_0x96eeb5)[_0x7752('0x32')](_0x402b41);}else if(_0x96eeb5){return!![];}return![];}; \ No newline at end of file +var _0x50a1=['diff','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','../../config/logger','xdr','info','inspect','debug','error','[utils][request]\x20name:%s','catch','GetUser','internal','interface','[utils][getUser]\x20where:%s','result','length','getUserByInternal','then','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','found','[utils][getUserByName]','getVoiceQueueByName','request','GetVoiceQueue','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','addTime','add','format','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','diffTime'];(function(_0x4f0cd0,_0x603ad6){var _0x18205e=function(_0x3941ac){while(--_0x3941ac){_0x4f0cd0['push'](_0x4f0cd0['shift']());}};_0x18205e(++_0x603ad6);}(_0x50a1,0x9a));var _0x150a=function(_0xbcb407,_0x108738){_0xbcb407=_0xbcb407-0x0;var _0x5ccca8=_0x50a1[_0xbcb407];return _0x5ccca8;};'use strict';var BPromise=require(_0x150a('0x0'));var jayson=require(_0x150a('0x1'));var moment=require(_0x150a('0x2'));var util=require(_0x150a('0x3'));var client=jayson[_0x150a('0x4')]['http']({'port':0x2329});var logger=require(_0x150a('0x5'))(_0x150a('0x6'));exports[_0x150a('0x7')]=function(_0x4e8a1a,_0x10182e){logger[_0x150a('0x7')](_0x4e8a1a,_0x10182e?util[_0x150a('0x8')](_0x10182e,{'showHidden':![],'depth':null}):'');};exports[_0x150a('0x9')]=function(_0x52b124,_0x393022){logger[_0x150a('0x9')](_0x52b124,_0x393022?util[_0x150a('0x8')](_0x393022,{'showHidden':![],'depth':null}):'');};exports[_0x150a('0xa')]=function(_0x553c6a,_0x98416a){logger[_0x150a('0xa')](_0x553c6a,_0x98416a?util['inspect'](_0x98416a,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x555c7f,_0x2d1d5c){return client['request'](_0x555c7f,{'body':_0x2d1d5c})['then'](function(_0x5e47ad){logger[_0x150a('0x9')](_0x150a('0xb'),_0x555c7f,_0x5e47ad?util[_0x150a('0x8')](_0x5e47ad,{'showHidden':![],'depth':null}):'');})[_0x150a('0xc')](function(_0x263177){logger['error']('[utils][request]\x20name:%s',_0x555c7f,_0x263177?util['inspect'](_0x263177,{'showHidden':![],'depth':null}):'');});};function getUser(_0x41051c){return client['request'](_0x150a('0xd'),{'options':{'raw':!![],'attributes':['id',_0x150a('0xe'),'name',_0x150a('0xf')],'where':_0x41051c,'limit':0x1}})['then'](function(_0x3b16a0){logger[_0x150a('0x9')](_0x150a('0x10'),JSON['stringify'](_0x41051c),_0x3b16a0?util[_0x150a('0x8')](_0x3b16a0,{'showHidden':![],'depth':null}):'');return _0x3b16a0[_0x150a('0x11')][_0x150a('0x12')]?_0x3b16a0[_0x150a('0x11')][0x0]:null;});}exports[_0x150a('0x13')]=function(_0x178197){return new BPromise(function(_0x13e4a5,_0x5a977f){if(_0x178197){return getUser({'internal':_0x178197})[_0x150a('0x14')](function(_0x3bd70f){logger[_0x150a('0x7')](_0x150a('0x15'),_0x178197,_0x3bd70f?'found':_0x150a('0x16'));return _0x13e4a5(_0x3bd70f);})[_0x150a('0xc')](function(_0x1cc2de){logger[_0x150a('0xa')](_0x150a('0x17'),_0x1cc2de?util['inspect'](_0x1cc2de,{'showHidden':![],'depth':null}):'');return _0x13e4a5(null);});}return _0x13e4a5(null);});};exports[_0x150a('0x18')]=function(_0x15d43e){return new BPromise(function(_0xc8cd0,_0x333f7a){if(_0x15d43e){return getUser({'interface':_0x15d43e})[_0x150a('0x14')](function(_0x5f396c){logger[_0x150a('0x7')](_0x150a('0x19'),_0x15d43e,_0x5f396c?'found':'notfound');return _0xc8cd0(_0x5f396c);})['catch'](function(_0x10ea91){logger[_0x150a('0xa')](_0x150a('0x1a'),_0x10ea91?util['inspect'](_0x10ea91,{'showHidden':![],'depth':null}):'');return _0xc8cd0(null);});}return _0xc8cd0(null);});};exports[_0x150a('0x1b')]=function(_0x343bf4){return new BPromise(function(_0x37ae78,_0x116309){if(_0x343bf4){return getUser({'name':_0x343bf4})['then'](function(_0x39a0d7){logger[_0x150a('0x7')](_0x150a('0x1c'),_0x343bf4,_0x39a0d7?_0x150a('0x1d'):_0x150a('0x16'));return _0x37ae78(_0x39a0d7);})[_0x150a('0xc')](function(_0x33cca8){logger['error'](_0x150a('0x1e'),_0x33cca8?util[_0x150a('0x8')](_0x33cca8,{'showHidden':![],'depth':null}):'');return _0x37ae78(null);});}return _0x37ae78(null);});};exports[_0x150a('0x1f')]=function(_0x2d6207){return new BPromise(function(_0x439309,_0x2fb206){if(_0x2d6207){return client[_0x150a('0x20')](_0x150a('0x21'),{'options':{'raw':!![],'attributes':['id',_0x150a('0x22'),_0x150a('0x23'),_0x150a('0x24'),_0x150a('0x25')],'where':{'name':_0x2d6207},'limit':0x1}})[_0x150a('0x14')](function(_0x40234d){logger[_0x150a('0x9')](_0x150a('0x26'),_0x2d6207,_0x40234d?util['inspect'](_0x40234d,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x2d6207,_0x40234d?_0x150a('0x1d'):_0x150a('0x16'));return _0x439309(_0x40234d[_0x150a('0x11')][_0x150a('0x12')]?_0x40234d[_0x150a('0x11')][0x0]:null);})[_0x150a('0xc')](function(_0x4ca707){logger[_0x150a('0xa')]('[utils][getVoiceQueueByName]',_0x4ca707?util[_0x150a('0x8')](_0x4ca707,{'showHidden':![],'depth':null}):'');return _0x439309(null);});}return _0x439309(null);});};exports[_0x150a('0x27')]=function(_0x143082,_0x504047){return moment(_0x143082)[_0x150a('0x28')](_0x504047,'seconds')[_0x150a('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports['subtractTime']=function(_0xb4e801,_0x4170d6){return moment(_0xb4e801)[_0x150a('0x2a')](_0x4170d6,_0x150a('0x2b'))[_0x150a('0x29')](_0x150a('0x2c'));};exports[_0x150a('0x2d')]=function(_0x3fbcde,_0x5a6924){return moment(_0x3fbcde)[_0x150a('0x2e')](moment(_0x5a6924),_0x150a('0x2b'));};exports[_0x150a('0x2f')]=function(_0x5e2b90,_0x56bbe4){return parseInt(_0x5e2b90,0xa)+parseInt(_0x56bbe4,0xa);};exports['now']=function(){return moment()[_0x150a('0x29')](_0x150a('0x2c'));};exports[_0x150a('0x30')]=function(_0x55abed,_0x39831c){if(_0x39831c){return moment(_0x55abed)[_0x150a('0x30')](_0x39831c);}return!![];};exports[_0x150a('0x31')]=function(_0x2cdb2a,_0x2b58db){if(_0x2b58db){return moment(_0x2cdb2a)['isBefore'](_0x2b58db);}else if(_0x2cdb2a){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 2918cc9..d149b99 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24e1=['name','ensureDir','log','user','then','no-user','data','api','auth','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','method','headers','x-forwarded-for','connection','url','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','format','remoteAddress','other','agent_id','agent_name','test','setupLoggers','fs-extra','lodash','path','util','./loggers','./mask-sensitive-data','join','/var','xcally','client','role'];(function(_0x53760b,_0x10983b){var _0x13eb2a=function(_0x3c62d2){while(--_0x3c62d2){_0x53760b['push'](_0x53760b['shift']());}};_0x13eb2a(++_0x10983b);}(_0x24e1,0x1d9));var _0x124e=function(_0x39ee89,_0x249960){_0x39ee89=_0x39ee89-0x0;var _0x2065ec=_0x24e1[_0x39ee89];return _0x2065ec;};var fs=require(_0x124e('0x0'));var _=require(_0x124e('0x1'));var ewinston=require('express-winston');var path=require(_0x124e('0x2'));var util=require(_0x124e('0x3'));var fileLogger=require(_0x124e('0x4'))['fileLogger'];var safeTemplate=require('./safe-template')['safeTemplate'];var maskSensitiveData=require(_0x124e('0x5'))['maskSensitiveData'];function ClientSideLogger(){function _0x550c3a(_0x38060f){var _0x1a9b2c=path[_0x124e('0x6')](_0x124e('0x7'),'log',_0x124e('0x8'));var _0x460299=path[_0x124e('0x6')](_0x124e('0x9'),_0x38060f[_0x124e('0xa')]+'-'+_0x38060f[_0x124e('0xb')]);return fs[_0x124e('0xc')](path[_0x124e('0x6')](_0x1a9b2c,_0x460299))['then'](function(){var _0x58868f=fileLogger(_0x124e('0x9'),path[_0x124e('0x6')](_0x1a9b2c,_0x460299));return _0x58868f;})['catch'](function(_0x1bfdbc){throw _0x1bfdbc;});}this[_0x124e('0xd')]=function(_0x5d474d,_0x2b1a4c,_0x5bd603,_0x46fce2){return _0x550c3a(_0x5d474d[_0x124e('0xe')])[_0x124e('0xf')](function(_0x2b3de3){var _0x158063=_0x2b3de3[_0x2b1a4c];return _0x158063;})[_0x124e('0xf')](function(_0x3494bc){var _0x421be1=_0x5d474d[_0x124e('0xe')]?_0x5d474d['user']['id']:_0x124e('0x10');var _0x4e366d=_0x46fce2[_0x124e('0x11')];var _0x22f940=_0x46fce2['timestamp'];var _0x43fa0d=new Date(Number(_0x22f940));return _0x3494bc(_0x421be1,_0x43fa0d,_0x5bd603,_0x4e366d);})['catch'](function(_0x1c93e2){fileLogger(_0x124e('0x9'))['error'](_0x1c93e2);});};}function setupLoggers(_0x476d9d){return new Promise(function(_0x4b358b){var _0x531f45=new ClientSideLogger();var _0x475840=fileLogger(_0x124e('0x12'));var _0x532e3d=fileLogger(_0x124e('0x13'));_0x476d9d['set'](_0x124e('0x14'),_0x531f45);_0x476d9d[_0x124e('0x15')](ewinston[_0x124e('0x16')]({'winstonInstance':_0x475840,'meta':![],'statusLevels':!![],'msg':function(_0x44523b,_0x4df09a){var _0x1aa126=_0x124e('0x17');if(!_[_0x124e('0x18')](_0x44523b[_0x124e('0x19')])){_0x1aa126+=_0x124e('0x1a');var _0x376a0c=_0x44523b[_0x124e('0x19')];maskSensitiveData(_0x376a0c);}return safeTemplate(util['format'](_0x1aa126,_0x44523b[_0x124e('0x1b')],_0x44523b[_0x124e('0x1c')][_0x124e('0x1d')]?_0x44523b[_0x124e('0x1c')]['x-forwarded-for']:_0x44523b[_0x124e('0x1e')]['remoteAddress']||_0x44523b['ip'],_0x44523b[_0x124e('0x1f')],_0x4df09a[_0x124e('0x20')],_0x4df09a[_0x124e('0x21')],_0x44523b['user']?_0x44523b[_0x124e('0xe')]['id']:null,_0x44523b[_0x124e('0xe')]?_0x44523b[_0x124e('0xe')][_0x124e('0xb')]:null,_0x44523b['user']?_0x44523b[_0x124e('0xe')]['role']:null,_0x376a0c?util[_0x124e('0x22')](_0x376a0c,![],null):''));}}));_0x476d9d['use'](ewinston['logger']({'winstonInstance':_0x532e3d,'meta':![],'statusLevels':!![],'msg':function(_0x1df961,_0x238a9f){var _0xa618ef=_0x124e('0x23');if(_0x1df961['body']&&_0x1df961[_0x124e('0x19')][_0x124e('0x24')]&&_0x1df961[_0x124e('0x19')]['agent_id']){_0xa618ef='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x124e('0x25')](_0xa618ef,_0x1df961[_0x124e('0x1b')],_0x1df961['headers'][_0x124e('0x1d')]?_0x1df961[_0x124e('0x1c')][_0x124e('0x1d')]:_0x1df961['connection'][_0x124e('0x26')]||_0x1df961['ip'],_0x1df961['url'],_0x238a9f[_0x124e('0x20')],_0x238a9f[_0x124e('0x21')],_0x1df961[_0x124e('0xe')]?_0x1df961[_0x124e('0xe')]['id']:null,_0x1df961[_0x124e('0xe')]?_0x1df961['user'][_0x124e('0xb')]:null,_0x1df961['user']?_0x1df961[_0x124e('0xe')][_0x124e('0xa')]:null,_0x1df961[_0x124e('0x19')]&&_0x1df961[_0x124e('0x19')][_0x124e('0x24')]?_0x1df961[_0x124e('0x19')][_0x124e('0x24')]:_0x124e('0x27'),_0x1df961[_0x124e('0x19')]&&_0x1df961[_0x124e('0x19')][_0x124e('0x28')]?_0x1df961['body'][_0x124e('0x28')]:'',_0x1df961[_0x124e('0x19')]&&_0x1df961[_0x124e('0x19')][_0x124e('0x29')]?_0x1df961[_0x124e('0x19')]['agent_name']:'');},'ignoreRoute':function(_0x1bb88e){var _0x1ae87d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1ae87d[_0x124e('0x2a')](_0x1bb88e[_0x124e('0x1f')]);}}));return _0x4b358b();});}exports[_0x124e('0x2b')]=setupLoggers; \ No newline at end of file +var _0xd9a8=['body','\x20body=%s','format','method','headers','x-forwarded-for','remoteAddress','url','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','statusCode','agent_name','test','setupLoggers','fs-extra','lodash','path','util','fileLogger','safeTemplate','./mask-sensitive-data','maskSensitiveData','log','xcally','join','client','role','name','ensureDir','catch','user','no-user','data','api','auth','client-side-logger','use','logger','isEmpty'];(function(_0x307086,_0x3bfe4e){var _0x699043=function(_0x1a7677){while(--_0x1a7677){_0x307086['push'](_0x307086['shift']());}};_0x699043(++_0x3bfe4e);}(_0xd9a8,0x13f));var _0x8d9a=function(_0x1ff58e,_0x59883f){_0x1ff58e=_0x1ff58e-0x0;var _0x365452=_0xd9a8[_0x1ff58e];return _0x365452;};var fs=require(_0x8d9a('0x0'));var _=require(_0x8d9a('0x1'));var ewinston=require('express-winston');var path=require(_0x8d9a('0x2'));var util=require(_0x8d9a('0x3'));var fileLogger=require('./loggers')[_0x8d9a('0x4')];var safeTemplate=require('./safe-template')[_0x8d9a('0x5')];var maskSensitiveData=require(_0x8d9a('0x6'))[_0x8d9a('0x7')];function ClientSideLogger(){function _0xdecaf7(_0x4fa0c3){var _0xfcc0cd=path['join']('/var',_0x8d9a('0x8'),_0x8d9a('0x9'));var _0x4b5bc8=path[_0x8d9a('0xa')](_0x8d9a('0xb'),_0x4fa0c3[_0x8d9a('0xc')]+'-'+_0x4fa0c3[_0x8d9a('0xd')]);return fs[_0x8d9a('0xe')](path[_0x8d9a('0xa')](_0xfcc0cd,_0x4b5bc8))['then'](function(){var _0x34e58e=fileLogger(_0x8d9a('0xb'),path['join'](_0xfcc0cd,_0x4b5bc8));return _0x34e58e;})[_0x8d9a('0xf')](function(_0x5e4ca8){throw _0x5e4ca8;});}this[_0x8d9a('0x8')]=function(_0xce9e57,_0x498848,_0x4fe7ae,_0x5a49e5){return _0xdecaf7(_0xce9e57[_0x8d9a('0x10')])['then'](function(_0x306e7a){var _0x3e917f=_0x306e7a[_0x498848];return _0x3e917f;})['then'](function(_0x1c9d3a){var _0x5dfbc5=_0xce9e57[_0x8d9a('0x10')]?_0xce9e57[_0x8d9a('0x10')]['id']:_0x8d9a('0x11');var _0x3dbf70=_0x5a49e5[_0x8d9a('0x12')];var _0x502260=_0x5a49e5['timestamp'];var _0x139409=new Date(Number(_0x502260));return _0x1c9d3a(_0x5dfbc5,_0x139409,_0x4fe7ae,_0x3dbf70);})[_0x8d9a('0xf')](function(_0x5a1415){fileLogger(_0x8d9a('0xb'))['error'](_0x5a1415);});};}function setupLoggers(_0xc8859f){return new Promise(function(_0x4b95b1){var _0x5f3476=new ClientSideLogger();var _0x39f53f=fileLogger(_0x8d9a('0x13'));var _0x374cc7=fileLogger(_0x8d9a('0x14'));_0xc8859f['set'](_0x8d9a('0x15'),_0x5f3476);_0xc8859f[_0x8d9a('0x16')](ewinston[_0x8d9a('0x17')]({'winstonInstance':_0x39f53f,'meta':![],'statusLevels':!![],'msg':function(_0x511ede,_0x4337b5){var _0x20dbdc='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x8d9a('0x18')](_0x511ede[_0x8d9a('0x19')])){_0x20dbdc+=_0x8d9a('0x1a');var _0x518fc4=_0x511ede[_0x8d9a('0x19')];maskSensitiveData(_0x518fc4);}return safeTemplate(util[_0x8d9a('0x1b')](_0x20dbdc,_0x511ede[_0x8d9a('0x1c')],_0x511ede[_0x8d9a('0x1d')][_0x8d9a('0x1e')]?_0x511ede['headers'][_0x8d9a('0x1e')]:_0x511ede['connection'][_0x8d9a('0x1f')]||_0x511ede['ip'],_0x511ede[_0x8d9a('0x20')],_0x4337b5['statusCode'],_0x4337b5['responseTime'],_0x511ede[_0x8d9a('0x10')]?_0x511ede[_0x8d9a('0x10')]['id']:null,_0x511ede[_0x8d9a('0x10')]?_0x511ede[_0x8d9a('0x10')]['name']:null,_0x511ede[_0x8d9a('0x10')]?_0x511ede[_0x8d9a('0x10')][_0x8d9a('0xc')]:null,_0x518fc4?util[_0x8d9a('0x21')](_0x518fc4,![],null):''));}}));_0xc8859f[_0x8d9a('0x16')](ewinston[_0x8d9a('0x17')]({'winstonInstance':_0x374cc7,'meta':![],'statusLevels':!![],'msg':function(_0xe31ba6,_0x4eda1c){var _0x4ef136=_0x8d9a('0x22');if(_0xe31ba6[_0x8d9a('0x19')]&&_0xe31ba6[_0x8d9a('0x19')][_0x8d9a('0x23')]&&_0xe31ba6[_0x8d9a('0x19')][_0x8d9a('0x24')]){_0x4ef136=_0x8d9a('0x25');}return util['format'](_0x4ef136,_0xe31ba6[_0x8d9a('0x1c')],_0xe31ba6[_0x8d9a('0x1d')][_0x8d9a('0x1e')]?_0xe31ba6[_0x8d9a('0x1d')][_0x8d9a('0x1e')]:_0xe31ba6[_0x8d9a('0x26')]['remoteAddress']||_0xe31ba6['ip'],_0xe31ba6[_0x8d9a('0x20')],_0x4eda1c[_0x8d9a('0x27')],_0x4eda1c['responseTime'],_0xe31ba6[_0x8d9a('0x10')]?_0xe31ba6[_0x8d9a('0x10')]['id']:null,_0xe31ba6[_0x8d9a('0x10')]?_0xe31ba6[_0x8d9a('0x10')]['name']:null,_0xe31ba6[_0x8d9a('0x10')]?_0xe31ba6[_0x8d9a('0x10')][_0x8d9a('0xc')]:null,_0xe31ba6[_0x8d9a('0x19')]&&_0xe31ba6[_0x8d9a('0x19')]['device']?_0xe31ba6[_0x8d9a('0x19')][_0x8d9a('0x23')]:'other',_0xe31ba6[_0x8d9a('0x19')]&&_0xe31ba6[_0x8d9a('0x19')][_0x8d9a('0x24')]?_0xe31ba6[_0x8d9a('0x19')][_0x8d9a('0x24')]:'',_0xe31ba6[_0x8d9a('0x19')]&&_0xe31ba6[_0x8d9a('0x19')][_0x8d9a('0x28')]?_0xe31ba6[_0x8d9a('0x19')][_0x8d9a('0x28')]:'');},'ignoreRoute':function(_0xa45d15){var _0xe59648=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xe59648[_0x8d9a('0x29')](_0xa45d15[_0x8d9a('0x20')]);}}));return _0x4b95b1();});}exports[_0x8d9a('0x2a')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 19aaf05..ea33c7c 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc684=['iftime','moment-timezone','source','join','isValid','map','locale','weekdaysShort','toLowerCase','indexOf','slice','exports','circularDoWInterval','concat','circularMonthInterval','clone','hours','minutes','isBefore','day','endOf','isBetween','timeCompare','format','ddd','includes','dowCompare','date','daysInMonth','max','min','domCompare','MMM','monthCompare','test','split','padStart','length'];(function(_0x475aa9,_0x439aab){var _0x360bbc=function(_0x331a22){while(--_0x331a22){_0x475aa9['push'](_0x475aa9['shift']());}};_0x360bbc(++_0x439aab);}(_0xc684,0xbf));var _0x4c68=function(_0x4403c8,_0x47e7f8){_0x4403c8=_0x4403c8-0x0;var _0x221ca2=_0xc684[_0x4403c8];return _0x221ca2;};var _=require('lodash');var moment=require(_0x4c68('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0x577645){return _0x577645[_0x4c68('0x1')];})[_0x4c68('0x2')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x3ade64){if(!_0x3ade64[_0x4c68('0x3')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x37a432){var _0x290a28=_0x37a432['split'](':')[_0x4c68('0x4')](function(_0x282ba2){return parseInt(_0x282ba2,0xa);});var _0x3d91ee=_0x290a28[0x0];var _0x5d11e5=_0x290a28[0x1];if(_0x3d91ee<0x0||_0x3d91ee>0x17||_0x5d11e5<0x0||_0x5d11e5>0x3b){throw new Error(EINVALID_DATE);}return[_0x3d91ee,_0x5d11e5];}function circularDoWInterval(_0x3062ff,_0x540375){if(_0x3062ff===_0x540375){return[_0x3062ff];}else{var _0x3da32b=moment[_0x4c68('0x5')]();moment[_0x4c68('0x5')]('en');var _0x40b210=moment[_0x4c68('0x6')]()[_0x4c68('0x4')](function(_0x214c24){return _0x214c24[_0x4c68('0x7')]();});moment[_0x4c68('0x5')](_0x3da32b);var _0x26cfd9=_0x40b210[_0x4c68('0x8')](_0x3062ff);var _0x345fdd=_0x40b210[_0x4c68('0x8')](_0x540375);if(_0x345fdd>_0x26cfd9){return _0x40b210[_0x4c68('0x9')](_0x26cfd9,_0x345fdd+0x1);}else{var _0x565a8a=_0x40b210[_0x4c68('0x9')](0x0,_0x345fdd+0x1);var _0x7ce7c3=_0x40b210[_0x4c68('0x9')](_0x26cfd9);return _0x7ce7c3['concat'](_0x565a8a);}}}module[_0x4c68('0xa')][_0x4c68('0xb')]=circularDoWInterval;function circularMonthInterval(_0x23c8c0,_0x5135c9){if(_0x23c8c0===_0x5135c9){return[_0x23c8c0];}else{var _0x591cea=moment[_0x4c68('0x5')]();moment[_0x4c68('0x5')]('en');var _0xb5314e=moment['monthsShort']()[_0x4c68('0x4')](function(_0x4280cd){return _0x4280cd[_0x4c68('0x7')]();});moment['locale'](_0x591cea);var _0x4ee9b9=_0xb5314e['indexOf'](_0x23c8c0);var _0x3a5910=_0xb5314e[_0x4c68('0x8')](_0x5135c9);if(_0x3a5910>_0x4ee9b9){return _0xb5314e[_0x4c68('0x9')](_0x4ee9b9,_0x3a5910+0x1);}else{var _0x2f51a3=_0xb5314e['slice'](0x0,_0x3a5910+0x1);var _0x320ebf=_0xb5314e[_0x4c68('0x9')](_0x4ee9b9);return _0x320ebf[_0x4c68('0xc')](_0x2f51a3);}}}module['exports'][_0x4c68('0xd')]=circularMonthInterval;function parseDom(_0x229687){var _0x1798f5=parseInt(_0x229687,0xa);if(_0x1798f5<0x1||_0x1798f5>0x1f){throw new Error(EINVALID_DATE);}return _0x1798f5;}function timeCompare(_0x5c2749,_0x5e152a,_0x11d177){var _0xecffb8=_0x5c2749[_0x4c68('0xe')]();var _0x39cee6=extractTime(_0x5e152a);var _0x45a644=_0x39cee6[0x0];var _0x1fac9a=_0x39cee6[0x1];var _0x2c7323=_0x5c2749[_0x4c68('0xe')]()[_0x4c68('0xf')](_0x45a644)[_0x4c68('0x10')](_0x1fac9a);throwIfDateNotValid(_0x2c7323);var _0x507c90=extractTime(_0x11d177);var _0x267f5e=_0x507c90[0x0];var _0x35a2f9=_0x507c90[0x1];var _0x534268=_0x5c2749['clone']()['hours'](_0x267f5e)['minutes'](_0x35a2f9);throwIfDateNotValid(_0x534268);if(_0x534268[_0x4c68('0x11')](_0x2c7323)){var _0x11bff0=_0xecffb8['clone']()['startOf'](_0x4c68('0x12'));var _0x10b29e=_0xecffb8[_0x4c68('0xe')]()[_0x4c68('0x13')](_0x4c68('0x12'));return _0xecffb8['isBetween'](_0x2c7323,_0x10b29e,undefined,'[]')||_0xecffb8['isBetween'](_0x11bff0,_0x534268,undefined,'[]');}else{return _0xecffb8[_0x4c68('0x14')](_0x2c7323,_0x534268,undefined,'[]');}}module[_0x4c68('0xa')][_0x4c68('0x15')]=timeCompare;function dowCompare(_0x186c58,_0x1322a0,_0x428ac5){var _0x144180=_0x186c58['locale']('en')[_0x4c68('0x16')](_0x4c68('0x17'))[_0x4c68('0x7')]();return circularDoWInterval(_0x1322a0,_0x428ac5)[_0x4c68('0x18')](_0x144180);}module[_0x4c68('0xa')][_0x4c68('0x19')]=dowCompare;function domCompare(_0x138cdb,_0x5f25d5,_0x21d143){var _0x56cb4f=_0x138cdb[_0x4c68('0x1a')]();if(_0x5f25d5===_0x21d143){return _0x56cb4f===_0x5f25d5;}else{var _0x1042ce=_0x138cdb[_0x4c68('0x1b')]();var _0x5c5f26=_0x5f25d5<_0x21d143;let _0x197e48=![];var _0x561b8f=0x0;var _0x1066fd=0x0;if(_0x5c5f26){_0x561b8f=Math[_0x4c68('0x1c')](0x1,_0x5f25d5);_0x1066fd=Math[_0x4c68('0x1d')](_0x21d143,_0x1042ce);_0x197e48=_0x56cb4f>=_0x561b8f&&_0x56cb4f<=_0x1066fd;}else{_0x561b8f=Math['min'](_0x5f25d5,_0x1042ce);_0x1066fd=Math['max'](0x1,_0x21d143);_0x197e48=_0x56cb4f>=_0x561b8f||_0x56cb4f<=_0x1066fd;}return _0x197e48;}}module['exports'][_0x4c68('0x1e')]=domCompare;function monthCompare(_0x35a6d2,_0x3fde3c,_0x1bdff4){var _0x117747=_0x35a6d2[_0x4c68('0x5')]('en')['format'](_0x4c68('0x1f'))['toLowerCase']();return circularMonthInterval(_0x3fde3c,_0x1bdff4)[_0x4c68('0x18')](_0x117747);}module[_0x4c68('0xa')][_0x4c68('0x20')]=monthCompare;function iftime(_0x711e7d,_0x3e2cf3=moment['tz']['guess'](),_0x1cb3b9=moment()){if(!validateRx[_0x4c68('0x21')](_0x711e7d)){throw new Error(EINVALID_STRING);}else{var _0x227fa6=(moment['isMoment'](_0x1cb3b9)?_0x1cb3b9['clone']():moment(_0x1cb3b9))['tz'](_0x3e2cf3)['locale']('en');throwIfDateNotValid(_0x227fa6);var _0x3af8ed=_0x711e7d['split'](',');var _0x3c1e09=_0x3af8ed[0x0];var _0x2c401f=_0x3af8ed[0x1];var _0x458835=_0x3af8ed[0x2];var _0x3202a8=_0x3af8ed[0x3];let _0x37a467=!![];if(_0x3c1e09!=='*'){var _0x295ad4=_0x3c1e09[_0x4c68('0x22')]('-');var _0x419777=_[_0x4c68('0x23')](_0x295ad4[0x0],0x5,'0');var _0xe4b8d3=_0x295ad4[_0x4c68('0x24')]===0x2?_[_0x4c68('0x23')](_0x295ad4[0x1],0x5,'0'):_0x419777;_0x37a467=timeCompare(_0x227fa6,_0x419777,_0xe4b8d3);}let _0x2bb6fd=!![];if(_0x2c401f!=='*'){var _0x4289c8=_0x2c401f[_0x4c68('0x22')]('-');var _0x51cee1=_0x4289c8[0x0];var _0x54b21b=_0x4289c8[_0x4c68('0x24')]===0x2?_0x4289c8[0x1]:_0x51cee1;_0x2bb6fd=dowCompare(_0x227fa6,_0x51cee1,_0x54b21b);}let _0x12ebe6=!![];if(_0x458835!=='*'){var _0x103699=_0x458835[_0x4c68('0x22')]('-');var _0x108303=parseDom(_0x103699[0x0]);var _0x41b396=_0x103699[_0x4c68('0x24')]===0x2?parseDom(_0x103699[0x1]):_0x108303;_0x12ebe6=domCompare(_0x227fa6,_0x108303,_0x41b396);}let _0x3f1300=!![];if(_0x3202a8!=='*'){var _0x31a20a=_0x3202a8[_0x4c68('0x22')]('-');var _0x34c48f=_0x31a20a[0x0];var _0x4a517a=_0x31a20a[_0x4c68('0x24')]===0x2?_0x31a20a[0x1]:_0x31a20a[0x0];_0x3f1300=monthCompare(_0x227fa6,_0x34c48f,_0x4a517a);}return _0x37a467&&_0x2bb6fd&&_0x12ebe6&&_0x3f1300;}}module[_0x4c68('0xa')][_0x4c68('0x25')]=iftime; \ No newline at end of file +var _0x3749=['map','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','toLowerCase','indexOf','slice','exports','circularDoWInterval','clone','hours','minutes','isBefore','startOf','day','isBetween','timeCompare','format','ddd','dowCompare','daysInMonth','min','max','MMM','includes','monthCompare','guess','length','iftime','lodash'];(function(_0xe6095b,_0x17857d){var _0x106b8b=function(_0x1e0781){while(--_0x1e0781){_0xe6095b['push'](_0xe6095b['shift']());}};_0x106b8b(++_0x17857d);}(_0x3749,0xcb));var _0x9374=function(_0x4982a5,_0xad13ed){_0x4982a5=_0x4982a5-0x0;var _0x26f5ff=_0x3749[_0x4982a5];return _0x26f5ff;};var _=require(_0x9374('0x0'));var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x9374('0x1')](function(_0x11e828){return _0x11e828[_0x9374('0x2')];})[_0x9374('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x9374('0x4');var EINVALID_DATE=_0x9374('0x5');function throwIfDateNotValid(_0x54df9d){if(!_0x54df9d[_0x9374('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x31fbe9){var _0x2b1627=_0x31fbe9[_0x9374('0x7')](':')[_0x9374('0x1')](function(_0x6cf1fc){return parseInt(_0x6cf1fc,0xa);});var _0x302713=_0x2b1627[0x0];var _0x1ec4a7=_0x2b1627[0x1];if(_0x302713<0x0||_0x302713>0x17||_0x1ec4a7<0x0||_0x1ec4a7>0x3b){throw new Error(EINVALID_DATE);}return[_0x302713,_0x1ec4a7];}function circularDoWInterval(_0x5c11cc,_0x12dfb5){if(_0x5c11cc===_0x12dfb5){return[_0x5c11cc];}else{var _0xd0d62e=moment['locale']();moment[_0x9374('0x8')]('en');var _0x166990=moment['weekdaysShort']()['map'](function(_0x505d73){return _0x505d73[_0x9374('0x9')]();});moment[_0x9374('0x8')](_0xd0d62e);var _0x297c75=_0x166990[_0x9374('0xa')](_0x5c11cc);var _0x2e0d08=_0x166990['indexOf'](_0x12dfb5);if(_0x2e0d08>_0x297c75){return _0x166990['slice'](_0x297c75,_0x2e0d08+0x1);}else{var _0x28b273=_0x166990['slice'](0x0,_0x2e0d08+0x1);var _0x46de02=_0x166990[_0x9374('0xb')](_0x297c75);return _0x46de02['concat'](_0x28b273);}}}module[_0x9374('0xc')][_0x9374('0xd')]=circularDoWInterval;function circularMonthInterval(_0x7cf7a9,_0x1dad8e){if(_0x7cf7a9===_0x1dad8e){return[_0x7cf7a9];}else{var _0x3aa754=moment[_0x9374('0x8')]();moment['locale']('en');var _0x5e963d=moment['monthsShort']()['map'](function(_0x4ebdf3){return _0x4ebdf3[_0x9374('0x9')]();});moment[_0x9374('0x8')](_0x3aa754);var _0x28b84d=_0x5e963d['indexOf'](_0x7cf7a9);var _0x47bd14=_0x5e963d[_0x9374('0xa')](_0x1dad8e);if(_0x47bd14>_0x28b84d){return _0x5e963d[_0x9374('0xb')](_0x28b84d,_0x47bd14+0x1);}else{var _0x3645af=_0x5e963d[_0x9374('0xb')](0x0,_0x47bd14+0x1);var _0x3cbb79=_0x5e963d[_0x9374('0xb')](_0x28b84d);return _0x3cbb79['concat'](_0x3645af);}}}module[_0x9374('0xc')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x1f3d5c){var _0x32defc=parseInt(_0x1f3d5c,0xa);if(_0x32defc<0x1||_0x32defc>0x1f){throw new Error(EINVALID_DATE);}return _0x32defc;}function timeCompare(_0x310814,_0x39e085,_0x47fb66){var _0x6f961f=_0x310814[_0x9374('0xe')]();var _0x5f2ba6=extractTime(_0x39e085);var _0x2f8373=_0x5f2ba6[0x0];var _0x32eaf6=_0x5f2ba6[0x1];var _0x2e3b20=_0x310814[_0x9374('0xe')]()[_0x9374('0xf')](_0x2f8373)['minutes'](_0x32eaf6);throwIfDateNotValid(_0x2e3b20);var _0x27e5cd=extractTime(_0x47fb66);var _0x5e4af7=_0x27e5cd[0x0];var _0xca9a08=_0x27e5cd[0x1];var _0x3e6276=_0x310814[_0x9374('0xe')]()[_0x9374('0xf')](_0x5e4af7)[_0x9374('0x10')](_0xca9a08);throwIfDateNotValid(_0x3e6276);if(_0x3e6276[_0x9374('0x11')](_0x2e3b20)){var _0x42b0a9=_0x6f961f[_0x9374('0xe')]()[_0x9374('0x12')](_0x9374('0x13'));var _0x495182=_0x6f961f['clone']()['endOf'](_0x9374('0x13'));return _0x6f961f[_0x9374('0x14')](_0x2e3b20,_0x495182,undefined,'[]')||_0x6f961f[_0x9374('0x14')](_0x42b0a9,_0x3e6276,undefined,'[]');}else{return _0x6f961f[_0x9374('0x14')](_0x2e3b20,_0x3e6276,undefined,'[]');}}module['exports'][_0x9374('0x15')]=timeCompare;function dowCompare(_0x14d74f,_0x2ec0d0,_0x5584bd){var _0x262838=_0x14d74f[_0x9374('0x8')]('en')[_0x9374('0x16')](_0x9374('0x17'))[_0x9374('0x9')]();return circularDoWInterval(_0x2ec0d0,_0x5584bd)['includes'](_0x262838);}module['exports'][_0x9374('0x18')]=dowCompare;function domCompare(_0x5acd0f,_0x2dae05,_0x1ff56b){var _0x23cb7f=_0x5acd0f['date']();if(_0x2dae05===_0x1ff56b){return _0x23cb7f===_0x2dae05;}else{var _0x1195c4=_0x5acd0f[_0x9374('0x19')]();var _0x523060=_0x2dae05<_0x1ff56b;let _0x52e320=![];var _0x26e7d2=0x0;var _0xe1c7b2=0x0;if(_0x523060){_0x26e7d2=Math['max'](0x1,_0x2dae05);_0xe1c7b2=Math[_0x9374('0x1a')](_0x1ff56b,_0x1195c4);_0x52e320=_0x23cb7f>=_0x26e7d2&&_0x23cb7f<=_0xe1c7b2;}else{_0x26e7d2=Math[_0x9374('0x1a')](_0x2dae05,_0x1195c4);_0xe1c7b2=Math[_0x9374('0x1b')](0x1,_0x1ff56b);_0x52e320=_0x23cb7f>=_0x26e7d2||_0x23cb7f<=_0xe1c7b2;}return _0x52e320;}}module[_0x9374('0xc')]['domCompare']=domCompare;function monthCompare(_0x5ec56b,_0x2a94d3,_0x47728a){var _0xbc1824=_0x5ec56b[_0x9374('0x8')]('en')[_0x9374('0x16')](_0x9374('0x1c'))[_0x9374('0x9')]();return circularMonthInterval(_0x2a94d3,_0x47728a)[_0x9374('0x1d')](_0xbc1824);}module[_0x9374('0xc')][_0x9374('0x1e')]=monthCompare;function iftime(_0x2c5e33,_0x4bbe68=moment['tz'][_0x9374('0x1f')](),_0x422596=moment()){if(!validateRx['test'](_0x2c5e33)){throw new Error(EINVALID_STRING);}else{var _0x2a72ba=(moment['isMoment'](_0x422596)?_0x422596[_0x9374('0xe')]():moment(_0x422596))['tz'](_0x4bbe68)['locale']('en');throwIfDateNotValid(_0x2a72ba);var _0x5ce68e=_0x2c5e33['split'](',');var _0x1bb12b=_0x5ce68e[0x0];var _0x274337=_0x5ce68e[0x1];var _0x2e420d=_0x5ce68e[0x2];var _0x42a86b=_0x5ce68e[0x3];let _0x3d61d1=!![];if(_0x1bb12b!=='*'){var _0x4ea9fb=_0x1bb12b[_0x9374('0x7')]('-');var _0x2f4e4f=_['padStart'](_0x4ea9fb[0x0],0x5,'0');var _0x51925e=_0x4ea9fb[_0x9374('0x20')]===0x2?_['padStart'](_0x4ea9fb[0x1],0x5,'0'):_0x2f4e4f;_0x3d61d1=timeCompare(_0x2a72ba,_0x2f4e4f,_0x51925e);}let _0x3a3ce9=!![];if(_0x274337!=='*'){var _0x5e6170=_0x274337[_0x9374('0x7')]('-');var _0x5aa58b=_0x5e6170[0x0];var _0x1204ad=_0x5e6170[_0x9374('0x20')]===0x2?_0x5e6170[0x1]:_0x5aa58b;_0x3a3ce9=dowCompare(_0x2a72ba,_0x5aa58b,_0x1204ad);}let _0x25a0ad=!![];if(_0x2e420d!=='*'){var _0x4c1615=_0x2e420d[_0x9374('0x7')]('-');var _0x196f66=parseDom(_0x4c1615[0x0]);var _0x394fb7=_0x4c1615[_0x9374('0x20')]===0x2?parseDom(_0x4c1615[0x1]):_0x196f66;_0x25a0ad=domCompare(_0x2a72ba,_0x196f66,_0x394fb7);}let _0x1fffde=!![];if(_0x42a86b!=='*'){var _0x26f6cf=_0x42a86b[_0x9374('0x7')]('-');var _0x3b67f7=_0x26f6cf[0x0];var _0xbc3d6e=_0x26f6cf[_0x9374('0x20')]===0x2?_0x26f6cf[0x1]:_0x26f6cf[0x0];_0x1fffde=monthCompare(_0x2a72ba,_0x3b67f7,_0xbc3d6e);}return _0x3d61d1&&_0x3a3ce9&&_0x25a0ad&&_0x1fffde;}}module['exports'][_0x9374('0x21')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 6c2f00b..b2210bc 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec61=['path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','Logger','transports','Console','warn','File','error','%s-%s','consoleLogger','fileLogger'];(function(_0x3254f5,_0x10843d){var _0x38910b=function(_0x35c9b6){while(--_0x35c9b6){_0x3254f5['push'](_0x3254f5['shift']());}};_0x38910b(++_0x10843d);}(_0xec61,0x18c));var _0x1ec6=function(_0x1c05b8,_0x2f0355){_0x1c05b8=_0x1c05b8-0x0;var _0x1a8b05=_0xec61[_0x1c05b8];return _0x1a8b05;};'use strict';var path=require(_0x1ec6('0x0'));var util=require(_0x1ec6('0x1'));var moment=require(_0x1ec6('0x2'));var winston=require(_0x1ec6('0x3'));var config=require(_0x1ec6('0x4'));var debugLevel=config[_0x1ec6('0x5')]?config['debugLevel'][_0x1ec6('0x6')]():_0x1ec6('0x7');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':_0x1ec6('0x8'),'error':_0x1ec6('0x9'),'warn':_0x1ec6('0xa'),'info':_0x1ec6('0xb'),'print':_0x1ec6('0xc'),'success':_0x1ec6('0xd'),'http':_0x1ec6('0xe'),'verbose':_0x1ec6('0xf'),'debug':_0x1ec6('0x10'),'silly':_0x1ec6('0x11')};winston[_0x1ec6('0x12')](XC_LOG_COLORS);function getLogFileName(_0x5c3fd6,_0x11c9cd,_0x5efa5f){var _0x2f4c6f=_0x5c3fd6||_0x1ec6('0x13');return path[_0x1ec6('0x14')](_0x2f4c6f,util[_0x1ec6('0x15')](_0x1ec6('0x16'),_0x11c9cd,_0x5efa5f));}function formatter(_0x5a568a,_0x395109){_0x395109[_0x1ec6('0x17')]=_0x395109[_0x1ec6('0x17')][_0x1ec6('0x18')](/@@{/g,_0x1ec6('0x19'))[_0x1ec6('0x18')](/}@@/g,_0x1ec6('0x1a'))['replace'](/@{/g,'{{')[_0x1ec6('0x18')](/}@/g,'}}');return util[_0x1ec6('0x15')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x395109['level'][_0x1ec6('0x1b')](),_0x5a568a,_0x395109[_0x1ec6('0x17')]);}function fileFormat(_0x1aa045,_0x24a351){_0x24a351['message']=_0x24a351[_0x1ec6('0x17')][_0x1ec6('0x18')](/@@{/g,_0x1ec6('0x19'))[_0x1ec6('0x18')](/}@@/g,'}}}')[_0x1ec6('0x18')](/@{/g,'{{')[_0x1ec6('0x18')](/}@/g,'}}');var _0x2e5976=_0x24a351[_0x1ec6('0x1c')]&&Object[_0x1ec6('0x1d')](_0x24a351[_0x1ec6('0x1c')])[_0x1ec6('0x1e')]?'\x0a\x09'+JSON[_0x1ec6('0x1f')](_0x24a351[_0x1ec6('0x1c')]):'';return util[_0x1ec6('0x15')](_0x1ec6('0x20'),moment()[_0x1ec6('0x15')](_0x1ec6('0x21')),_0x24a351[_0x1ec6('0x22')][_0x1ec6('0x1b')](),_0x1aa045,_0x24a351[_0x1ec6('0x17')],_0x2e5976);}function consoleLogger(){var _0x1be9c0=new winston[(_0x1ec6('0x23'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x1ec6('0x24'))][(_0x1ec6('0x25'))]({'level':_0x1ec6('0x26'),'json':![],'formatter':function(_0x31ceb9){return formatter('',_0x31ceb9);}})]});return _0x1be9c0;}function fileLogger(_0x16c3d0,_0x1ff5c8){var _0x543bcc=new winston[(_0x1ec6('0x23'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x1ec6('0x27'))]({'name':util[_0x1ec6('0x15')]('%s-%s',_0x16c3d0,_0x1ec6('0x28')),'filename':getLogFileName(_0x1ff5c8,_0x16c3d0,_0x1ec6('0x28')),'level':_0x1ec6('0x28'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3e6492){return fileFormat(_0x16c3d0,_0x3e6492);}}),new winston[(_0x1ec6('0x24'))]['File']({'name':util[_0x1ec6('0x15')](_0x1ec6('0x29'),_0x16c3d0,debugLevel),'filename':getLogFileName(_0x1ff5c8,_0x16c3d0,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x262afd){return fileFormat(_0x16c3d0,_0x262afd);}}),new winston[(_0x1ec6('0x24'))]['Console']({'level':_0x1ec6('0x26'),'json':![],'formatter':function(_0x58d02f){return fileFormat(_0x16c3d0,_0x58d02f);}})]});return _0x543bcc;}exports[_0x1ec6('0x2a')]=consoleLogger;exports[_0x1ec6('0x2b')]=fileLogger; \ No newline at end of file +var _0xee6f=['addColors','join','%s-%s.log','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','level','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','Logger','%s-%s','error','transports','Console','consoleLogger','path','util','moment','../config/environment','debugLevel','info','red','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20cyan'];(function(_0x5c67e1,_0x377eb7){var _0x34459e=function(_0x4ad33e){while(--_0x4ad33e){_0x5c67e1['push'](_0x5c67e1['shift']());}};_0x34459e(++_0x377eb7);}(_0xee6f,0xc5));var _0xfee6=function(_0x1ba8b2,_0x42adf4){_0x1ba8b2=_0x1ba8b2-0x0;var _0x3b3f2c=_0xee6f[_0x1ba8b2];return _0x3b3f2c;};'use strict';var path=require(_0xfee6('0x0'));var util=require(_0xfee6('0x1'));var moment=require(_0xfee6('0x2'));var winston=require('winston');var config=require(_0xfee6('0x3'));var debugLevel=config[_0xfee6('0x4')]?config['debugLevel']['toLowerCase']():_0xfee6('0x5');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':'redBG\x20white','error':_0xfee6('0x6'),'warn':'bold\x20yellow','info':_0xfee6('0x7'),'print':_0xfee6('0x8'),'success':_0xfee6('0x9'),'http':_0xfee6('0xa'),'verbose':_0xfee6('0xb'),'debug':'bold\x20blue','silly':_0xfee6('0xc')};winston[_0xfee6('0xd')](XC_LOG_COLORS);function getLogFileName(_0x846500,_0xc119b8,_0x2ab834){var _0x3a0681=_0x846500||'/var/log/xcally';return path[_0xfee6('0xe')](_0x3a0681,util['format'](_0xfee6('0xf'),_0xc119b8,_0x2ab834));}function formatter(_0x5bdf53,_0x3d4c07){_0x3d4c07[_0xfee6('0x10')]=_0x3d4c07[_0xfee6('0x10')][_0xfee6('0x11')](/@@{/g,_0xfee6('0x12'))['replace'](/}@@/g,_0xfee6('0x13'))[_0xfee6('0x11')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xfee6('0x14')](_0xfee6('0x15'),moment()[_0xfee6('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),_0x3d4c07[_0xfee6('0x16')]['toUpperCase'](),_0x5bdf53,_0x3d4c07[_0xfee6('0x10')]);}function fileFormat(_0x58e1f5,_0x4d4b53){_0x4d4b53[_0xfee6('0x10')]=_0x4d4b53[_0xfee6('0x10')][_0xfee6('0x11')](/@@{/g,_0xfee6('0x12'))[_0xfee6('0x11')](/}@@/g,_0xfee6('0x13'))[_0xfee6('0x11')](/@{/g,'{{')[_0xfee6('0x11')](/}@/g,'}}');var _0x4ec51f=_0x4d4b53[_0xfee6('0x17')]&&Object[_0xfee6('0x18')](_0x4d4b53[_0xfee6('0x17')])[_0xfee6('0x19')]?'\x0a\x09'+JSON[_0xfee6('0x1a')](_0x4d4b53['meta']):'';return util[_0xfee6('0x14')](_0xfee6('0x1b'),moment()[_0xfee6('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),_0x4d4b53[_0xfee6('0x16')][_0xfee6('0x1c')](),_0x58e1f5,_0x4d4b53[_0xfee6('0x10')],_0x4ec51f);}function consoleLogger(){var _0x105fea=new winston[(_0xfee6('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['Console']({'level':'warn','json':![],'formatter':function(_0x303b4a){return formatter('',_0x303b4a);}})]});return _0x105fea;}function fileLogger(_0x400bd7,_0x46eee8){var _0x4509aa=new winston[(_0xfee6('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['File']({'name':util['format'](_0xfee6('0x1e'),_0x400bd7,'error'),'filename':getLogFileName(_0x46eee8,_0x400bd7,_0xfee6('0x1f')),'level':_0xfee6('0x1f'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5a3ff8){return fileFormat(_0x400bd7,_0x5a3ff8);}}),new winston[(_0xfee6('0x20'))]['File']({'name':util[_0xfee6('0x14')](_0xfee6('0x1e'),_0x400bd7,debugLevel),'filename':getLogFileName(_0x46eee8,_0x400bd7,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4f7121){return fileFormat(_0x400bd7,_0x4f7121);}}),new winston[(_0xfee6('0x20'))][(_0xfee6('0x21'))]({'level':'warn','json':![],'formatter':function(_0x4609a3){return fileFormat(_0x400bd7,_0x4609a3);}})]});return _0x4509aa;}exports[_0xfee6('0x22')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 3054726..11ab609 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57ca=['accesskeyid','secretaccesskey','key','user','accountSid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','@@{','replace','}@@','includes','exports','username','password','apiKey','firstName','lastName','street','phone','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerSecret','calleridname','calleridnum','vidaooApiKey','privateKey'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x57ca,0x108));var _0xa57c=function(_0x170901,_0x2fba04){_0x170901=_0x170901-0x0;var _0x1ae418=_0x57ca[_0x170901];return _0x1ae418;};var _=require('lodash');var sensitiveFields=[_0xa57c('0x0'),_0xa57c('0x1'),'newPassword',_0xa57c('0x2'),_0xa57c('0x3'),_0xa57c('0x4'),_0xa57c('0x5'),_0xa57c('0x6'),'mobile',_0xa57c('0x7'),_0xa57c('0x8'),_0xa57c('0x9'),_0xa57c('0xa'),_0xa57c('0xb'),_0xa57c('0xc'),_0xa57c('0xd'),_0xa57c('0xe'),'token',_0xa57c('0xf'),'accessToken',_0xa57c('0x10'),_0xa57c('0x11'),'consumerKey',_0xa57c('0x12'),'membername',_0xa57c('0x13'),_0xa57c('0x14'),'exten',_0xa57c('0x15'),'clientEmail',_0xa57c('0x16'),_0xa57c('0x17'),_0xa57c('0x18'),_0xa57c('0x19'),_0xa57c('0x1a'),'pass',_0xa57c('0x1b'),'localstationid',_0xa57c('0x1c'),_0xa57c('0x1d'),_0xa57c('0x1e'),_0xa57c('0x1f')];function maskSensitiveData(_0x3238ff){const _0x37a323=/(?!^)[\s\S](?!$)/g;if(_[_0xa57c('0x20')](_0x3238ff)){for(const _0x4b4bdb in _0x3238ff){if(_[_0xa57c('0x21')](_0x3238ff[_0x4b4bdb])){for(let _0xdf7ff6=0x0;_0xdf7ff6<_0x3238ff[_0x4b4bdb][_0xa57c('0x22')];_0xdf7ff6++){maskSensitiveData(_0x3238ff[_0x4b4bdb][_0xdf7ff6]);}}else if(_['isPlainObject'](_0x3238ff[_0x4b4bdb])){maskSensitiveData(_0x3238ff[_0x4b4bdb]);}else if(_[_0xa57c('0x23')](_0x3238ff[_0x4b4bdb])){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb]['replace'](/{{{/g,_0xa57c('0x24'))[_0xa57c('0x25')](/}}}/g,_0xa57c('0x26'))[_0xa57c('0x25')](/{{/g,'@{')[_0xa57c('0x25')](/}}/g,'}@');if(_[_0xa57c('0x27')](sensitiveFields,_0x4b4bdb)){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb][_0xa57c('0x25')](_0x37a323,'*');}}}}}module[_0xa57c('0x28')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x66fa=['calleridnum','vidaooApiKey','privateKey','secretaccesskey','key','user','localstationid','oldPassword','isPlainObject','length','isString','replace','includes','exports','maskSensitiveData','lodash','username','newPassword','apiKey','firstName','lastName','street','phone','mobile','clientId','clientSecret','securityToken','code','accessKey','token','accessToken','authToken','calleridname'];(function(_0x4d6622,_0x14debf){var _0x730fc5=function(_0x2201e5){while(--_0x2201e5){_0x4d6622['push'](_0x4d6622['shift']());}};_0x730fc5(++_0x14debf);}(_0x66fa,0x117));var _0xa66f=function(_0x2b7be1,_0x180183){_0x2b7be1=_0x2b7be1-0x0;var _0x3affd2=_0x66fa[_0x2b7be1];return _0x3affd2;};var _=require(_0xa66f('0x0'));var sensitiveFields=[_0xa66f('0x1'),'password',_0xa66f('0x2'),_0xa66f('0x3'),_0xa66f('0x4'),_0xa66f('0x5'),_0xa66f('0x6'),_0xa66f('0x7'),_0xa66f('0x8'),'fax','email',_0xa66f('0x9'),_0xa66f('0xa'),_0xa66f('0xb'),_0xa66f('0xc'),_0xa66f('0xd'),'tenantId',_0xa66f('0xe'),'channelSecret',_0xa66f('0xf'),'accessTokenSecret',_0xa66f('0x10'),'consumerKey','consumerSecret','membername',_0xa66f('0x11'),_0xa66f('0x12'),'exten',_0xa66f('0x13'),'clientEmail',_0xa66f('0x14'),'accesskeyid',_0xa66f('0x15'),_0xa66f('0x16'),_0xa66f('0x17'),'pass','accountSid',_0xa66f('0x18'),'dsn','secret','registry',_0xa66f('0x19')];function maskSensitiveData(_0x452c37){const _0x267129=/(?!^)[\s\S](?!$)/g;if(_[_0xa66f('0x1a')](_0x452c37)){for(const _0xd348f9 in _0x452c37){if(_['isArray'](_0x452c37[_0xd348f9])){for(let _0x5510dc=0x0;_0x5510dc<_0x452c37[_0xd348f9][_0xa66f('0x1b')];_0x5510dc++){maskSensitiveData(_0x452c37[_0xd348f9][_0x5510dc]);}}else if(_[_0xa66f('0x1a')](_0x452c37[_0xd348f9])){maskSensitiveData(_0x452c37[_0xd348f9]);}else if(_[_0xa66f('0x1c')](_0x452c37[_0xd348f9])){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](/{{{/g,'@@{')[_0xa66f('0x1d')](/}}}/g,'}@@')['replace'](/{{/g,'@{')[_0xa66f('0x1d')](/}}/g,'}@');if(_[_0xa66f('0x1e')](sensitiveFields,_0xd348f9)){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](_0x267129,'*');}}}}}module[_0xa66f('0x1f')][_0xa66f('0x20')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/misc.js b/server/utils/misc.js index 183a37a..ecfe5bc 100644 --- a/server/utils/misc.js +++ b/server/utils/misc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57ca=['\x5c$&'];(function(_0x45ebfc,_0x5be1b0){var _0x4aace6=function(_0x5c658e){while(--_0x5c658e){_0x45ebfc['push'](_0x45ebfc['shift']());}};_0x4aace6(++_0x5be1b0);}(_0x57ca,0x108));var _0xa57c=function(_0xdc175a,_0xd7340f){_0xdc175a=_0xdc175a-0x0;var _0x5e22e5=_0x57ca[_0xdc175a];return _0x5e22e5;};module['exports']={'escapeRegExp'(_0x29cc65,_0x4ad696=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x29cc65['replace'](_0x4ad696,_0xa57c('0x0'));}}; \ No newline at end of file +var _0xc4aa=['\x5c$&','exports','replace'];(function(_0x3f5549,_0x1f7b34){var _0x261d86=function(_0x8cbfbe){while(--_0x8cbfbe){_0x3f5549['push'](_0x3f5549['shift']());}};_0x261d86(++_0x1f7b34);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc4aa[_0x199572];return _0x13cfa3;};module[_0xac4a('0x0')]={'escapeRegExp'(_0x5a86db,_0x40a0d0=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x5a86db[_0xac4a('0x1')](_0x40a0d0,_0xac4a('0x2'));}}; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 9983cb5..fe4896e 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c00=['replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','string'];(function(_0x18ac52,_0x356756){var _0x107bd2=function(_0x53d564){while(--_0x53d564){_0x18ac52['push'](_0x18ac52['shift']());}};_0x107bd2(++_0x356756);}(_0x5c00,0x17e));var _0x05c0=function(_0x318054,_0x516efd){_0x318054=_0x318054-0x0;var _0x19a6ae=_0x5c00[_0x318054];return _0x19a6ae;};var _=require(_0x05c0('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x7f1364){return _0x7f1364==='{{'?_0x05c0('0x1'):'\x20}\x20}';}function safeTemplate(_0x1e76da){var _0x5859bc=_0x1e76da;if(typeof _0x1e76da===_0x05c0('0x2')){_0x5859bc=_0x1e76da[_0x05c0('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x05c0('0x4')](_0x1e76da)){_0x5859bc=_0x1e76da[_0x05c0('0x5')](function(_0x565efc){return safeTemplate(_0x565efc);});}else if(_[_0x05c0('0x6')](_0x1e76da)){_0x5859bc=Object[_0x05c0('0x7')](_0x1e76da)[_0x05c0('0x8')](function(_0x27dc10,_0x5b9f09){_0x27dc10[_0x5b9f09]=safeTemplate(_0x1e76da[_0x5b9f09]);return _0x27dc10;},{});}return _0x5859bc;}module[_0x05c0('0x9')][_0x05c0('0xa')]=safeTemplate; \ No newline at end of file +var _0x9c00=['isPlainObject','exports','safeTemplate','lodash','replace','isArray','map'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0x9c00,0x1a0));var _0x09c0=function(_0xf7f60a,_0x15f736){_0xf7f60a=_0xf7f60a-0x0;var _0x2567ad=_0x9c00[_0xf7f60a];return _0x2567ad;};var _=require(_0x09c0('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x170d8b){return _0x170d8b==='{{'?'{\x20{\x20':'\x20}\x20}';}function safeTemplate(_0xe0d293){var _0x8c9907=_0xe0d293;if(typeof _0xe0d293==='string'){_0x8c9907=_0xe0d293[_0x09c0('0x1')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x09c0('0x2')](_0xe0d293)){_0x8c9907=_0xe0d293[_0x09c0('0x3')](function(_0x2fd03e){return safeTemplate(_0x2fd03e);});}else if(_[_0x09c0('0x4')](_0xe0d293)){_0x8c9907=Object['keys'](_0xe0d293)['reduce'](function(_0x1f3d7e,_0x17d11f){_0x1f3d7e[_0x17d11f]=safeTemplate(_0xe0d293[_0x17d11f]);return _0x1f3d7e;},{});}return _0x8c9907;}module[_0x09c0('0x5')][_0x09c0('0x6')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 15b9b66..ee54ea4 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64f9=['resolve','server/app.json','legacy-libs','isArray','apps','findIndex','name','env','string','NODE_PATH','readJSON','info','Updating\x20app.json','writeJSON','exports','fs-extra','path','root'];(function(_0x2ae7b0,_0x30137f){var _0x111498=function(_0x5efbce){while(--_0x5efbce){_0x2ae7b0['push'](_0x2ae7b0['shift']());}};_0x111498(++_0x30137f);}(_0x64f9,0x189));var _0x964f=function(_0x29aefc,_0x4dcf53){_0x29aefc=_0x29aefc-0x0;var _0x11be36=_0x64f9[_0x29aefc];return _0x11be36;};var fs=require(_0x964f('0x0'));var path=require(_0x964f('0x1'));var config=require('../config/environment');var root=config[_0x964f('0x2')];var APP_JSON_PATH=path[_0x964f('0x3')](root,_0x964f('0x4'));var NODEPATH=path['resolve'](root,_0x964f('0x5'));function setLegacyLibsNodeEnvPath(_0x9e6607){let _0x529792=![];if(Array[_0x964f('0x6')](_0x9e6607[_0x964f('0x7')])){var _0x1d5215=_0x9e6607[_0x964f('0x7')][_0x964f('0x8')](function(_0x3abaaf){return _0x3abaaf[_0x964f('0x9')]==='motion2';});if(_0x1d5215>-0x1){var _0x78e6b2=_0x9e6607[_0x964f('0x7')][_0x1d5215];if(typeof _0x78e6b2[_0x964f('0xa')]['NODE_PATH']!==_0x964f('0xb')){_0x78e6b2[_0x964f('0xa')][_0x964f('0xc')]=NODEPATH;_0x529792=!![];}}return{'appConfig':_0x9e6607,'updated':_0x529792};}}function updateAppConfig(_0x555890){return fs['pathExists'](APP_JSON_PATH)['then'](function(_0x4dbd4){if(_0x4dbd4){return fs[_0x964f('0xd')](APP_JSON_PATH)['then'](function(_0x3bec7e){var _0xca87ea=setLegacyLibsNodeEnvPath(_0x3bec7e);if(_0xca87ea['updated']){_0x555890[_0x964f('0xe')](_0x964f('0xf'));return fs[_0x964f('0x10')](APP_JSON_PATH,_0x3bec7e,{'spaces':0x2});}else{return Promise[_0x964f('0x3')]();}});}else{return Promise['resolve']();}});}module[_0x964f('0x11')]=updateAppConfig; \ No newline at end of file +var _0x374e=['info','Updating\x20app.json','writeJSON','exports','fs-extra','path','root','server/app.json','resolve','legacy-libs','isArray','apps','findIndex','name','motion2','env','string','NODE_PATH','pathExists','then'];(function(_0x1ab588,_0x15b086){var _0x41d5a9=function(_0x46d264){while(--_0x46d264){_0x1ab588['push'](_0x1ab588['shift']());}};_0x41d5a9(++_0x15b086);}(_0x374e,0x1d0));var _0xe374=function(_0x4c8bf8,_0x34e122){_0x4c8bf8=_0x4c8bf8-0x0;var _0x3f1056=_0x374e[_0x4c8bf8];return _0x3f1056;};var fs=require(_0xe374('0x0'));var path=require(_0xe374('0x1'));var config=require('../config/environment');var root=config[_0xe374('0x2')];var APP_JSON_PATH=path['resolve'](root,_0xe374('0x3'));var NODEPATH=path[_0xe374('0x4')](root,_0xe374('0x5'));function setLegacyLibsNodeEnvPath(_0x7e45ec){let _0x1adc37=![];if(Array[_0xe374('0x6')](_0x7e45ec[_0xe374('0x7')])){var _0x438bbf=_0x7e45ec[_0xe374('0x7')][_0xe374('0x8')](function(_0x4a994f){return _0x4a994f[_0xe374('0x9')]===_0xe374('0xa');});if(_0x438bbf>-0x1){var _0x1ed71d=_0x7e45ec[_0xe374('0x7')][_0x438bbf];if(typeof _0x1ed71d[_0xe374('0xb')]['NODE_PATH']!==_0xe374('0xc')){_0x1ed71d['env'][_0xe374('0xd')]=NODEPATH;_0x1adc37=!![];}}return{'appConfig':_0x7e45ec,'updated':_0x1adc37};}}function updateAppConfig(_0x313757){return fs[_0xe374('0xe')](APP_JSON_PATH)[_0xe374('0xf')](function(_0xc4fc10){if(_0xc4fc10){return fs['readJSON'](APP_JSON_PATH)[_0xe374('0xf')](function(_0x2b1946){var _0x432a24=setLegacyLibsNodeEnvPath(_0x2b1946);if(_0x432a24['updated']){_0x313757[_0xe374('0x10')](_0xe374('0x11'));return fs[_0xe374('0x12')](APP_JSON_PATH,_0x2b1946,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise[_0xe374('0x4')]();}});}module[_0xe374('0x13')]=updateAppConfig; \ No newline at end of file -- 1.7.1